From: Andrea Amorese Date: Wed, 15 Sep 2021 13:34:17 +0000 (+0200) Subject: Built motion from commit 5dcc0f33.|2.5.35 X-Git-Url: http://repos.xcallymotion.com/base//%22https:/wiki.xcallymotion.com/display/XMV/%C3%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%C2%20%20%20%20%20%20%2017%C3%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%C210001E%C3%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%C202%C3%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%C2%20%20%20%20%20%20%200%C3%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%C205?a=commitdiff_plain;h=aaf01197949d4ea1e8d40b656cefe7ade2ec8639;p=motion2.git Built motion from commit 5dcc0f33.|2.5.35 --- diff --git a/apidoc/api_project.js b/apidoc/api_project.js index 1ae53b6..b8a84cf 100644 --- a/apidoc/api_project.js +++ b/apidoc/api_project.js @@ -17,7 +17,7 @@ define({ "apidoc": "0.3.0", "generator": { "name": "apidoc", - "time": "2021-09-15T13:05:10.798Z", + "time": "2021-09-15T13:26:14.328Z", "url": "http://apidocjs.com", "version": "0.24.0" } diff --git a/apidoc/api_project.json b/apidoc/api_project.json index 39d1335..a75a564 100644 --- a/apidoc/api_project.json +++ b/apidoc/api_project.json @@ -17,7 +17,7 @@ "apidoc": "0.3.0", "generator": { "name": "apidoc", - "time": "2021-09-15T13:05:10.798Z", + "time": "2021-09-15T13:26:14.328Z", "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 f96a55b..b596f73 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 _0xb82a=['STRING','integration','motionbar','jscripty','browser','bot','jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]','contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]','contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]','browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]','TEXT','exports','VIRTUAL','action'];(function(_0x5ca52d,_0x3a4a22){var _0x89e54e=function(_0x54bdf4){while(--_0x54bdf4){_0x5ca52d['push'](_0x5ca52d['shift']());}};_0x89e54e(++_0x3a4a22);}(_0xb82a,0x93));var _0xab82=function(_0x5a6a38,_0x1c9ca7){_0x5a6a38=_0x5a6a38-0x0;var _0x447727=_0xb82a[_0x5a6a38];return _0x447727;};'use strict';var Sequelize=require('sequelize');module[_0xab82('0x0')]={'name':{'type':Sequelize[_0xab82('0x1')],'get':function(_0xfdb50){return this['getDataValue'](_0xab82('0x2'));}},'action':{'type':Sequelize[_0xab82('0x3')],'allowNull':![],'validate':{'isIn':{'args':[['contactManager',_0xab82('0x4'),_0xab82('0x5'),_0xab82('0x6'),'urlForward',_0xab82('0x7'),_0xab82('0x8'),'script']],'msg':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'}},'comment':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'},'data1':{'type':Sequelize[_0xab82('0x3')](0x1000),'comment':_0xab82('0x9')},'data2':{'type':Sequelize['STRING'](0x1000),'comment':_0xab82('0xa')},'data3':{'type':Sequelize[_0xab82('0x3')](0x1000),'comment':_0xab82('0xb')},'data4':{'type':Sequelize[_0xab82('0x3')](0x1000),'comments':_0xab82('0xc')},'data5':{'type':Sequelize[_0xab82('0x3')](0x1000),'comments':_0xab82('0xd')},'data6':{'type':Sequelize[_0xab82('0x3')],'comments':'urlForward[headers],\x20browser[wsindowHeight]'},'data7':{'type':Sequelize[_0xab82('0xe')],'comments':'urlForward[body]'}}; \ No newline at end of file +var _0xadb5=['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)]','browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]','urlForward[headers],\x20browser[wsindowHeight]','exports','VIRTUAL','getDataValue','STRING','contactManager','integration','motionbar','jscripty','urlForward'];(function(_0x4351bd,_0xe8856a){var _0x5ccd4e=function(_0x3fc64d){while(--_0x3fc64d){_0x4351bd['push'](_0x4351bd['shift']());}};_0x5ccd4e(++_0xe8856a);}(_0xadb5,0x1c2));var _0x5adb=function(_0x4d8e20,_0x4bc692){_0x4d8e20=_0x4d8e20-0x0;var _0x3d9f12=_0xadb5[_0x4d8e20];return _0x3d9f12;};'use strict';var Sequelize=require('sequelize');module[_0x5adb('0x0')]={'name':{'type':Sequelize[_0x5adb('0x1')],'get':function(_0x4dcc2a){return this[_0x5adb('0x2')]('action');}},'action':{'type':Sequelize[_0x5adb('0x3')],'allowNull':![],'validate':{'isIn':{'args':[[_0x5adb('0x4'),_0x5adb('0x5'),_0x5adb('0x6'),_0x5adb('0x7'),_0x5adb('0x8'),'browser',_0x5adb('0x9'),'script']],'msg':_0x5adb('0xa')}},'comment':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'},'data1':{'type':Sequelize[_0x5adb('0x3')](0x1000),'comment':_0x5adb('0xb')},'data2':{'type':Sequelize[_0x5adb('0x3')](0x1000),'comment':_0x5adb('0xc')},'data3':{'type':Sequelize[_0x5adb('0x3')](0x1000),'comment':_0x5adb('0xd')},'data4':{'type':Sequelize[_0x5adb('0x3')](0x1000),'comments':_0x5adb('0xe')},'data5':{'type':Sequelize[_0x5adb('0x3')](0x1000),'comments':_0x5adb('0xf')},'data6':{'type':Sequelize[_0x5adb('0x3')],'comments':_0x5adb('0x10')},'data7':{'type':Sequelize['TEXT'],'comments':'urlForward[body]'}}; \ No newline at end of file diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js index d004c3e..a034df4 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 _0x5aed=['params','catch','eml-format','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','update','destroy','then','end','error','stack','name','send','body','Action','find'];(function(_0x3510a2,_0x1d56fb){var _0x310df9=function(_0x26694c){while(--_0x26694c){_0x3510a2['push'](_0x3510a2['shift']());}};_0x310df9(++_0x1d56fb);}(_0x5aed,0xc2));var _0xd5ae=function(_0x3a1d30,_0x50b697){_0x3a1d30=_0x3a1d30-0x0;var _0x19226a=_0x5aed[_0x3a1d30];return _0x19226a;};'use strict';var emlformat=require(_0xd5ae('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xd5ae('0x1'));var BPromise=require(_0xd5ae('0x2'));var Mustache=require(_0xd5ae('0x3'));var util=require(_0xd5ae('0x4'));var path=require(_0xd5ae('0x5'));var sox=require(_0xd5ae('0x6'));var csv=require('to-csv');var ejs=require(_0xd5ae('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd5ae('0x8'));var squel=require(_0xd5ae('0x9'));var crypto=require(_0xd5ae('0xa'));var jsforce=require(_0xd5ae('0xb'));var deskjs=require(_0xd5ae('0xc'));var toCsv=require(_0xd5ae('0xd'));var querystring=require(_0xd5ae('0xe'));var Papa=require('papaparse');var Redis=require(_0xd5ae('0xf'));var authService=require(_0xd5ae('0x10'));var qs=require(_0xd5ae('0x11'));var as=require(_0xd5ae('0x12'));var hardwareService=require(_0xd5ae('0x13'));var logger=require(_0xd5ae('0x14'))(_0xd5ae('0x15'));var utils=require('../../config/utils');var config=require(_0xd5ae('0x16'));var licenseUtil=require(_0xd5ae('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2ec907,_0x38aa66){_0x38aa66=_0x38aa66||0xcc;return function(_0x364733){if(_0x364733){return _0x2ec907[_0xd5ae('0x18')](_0x38aa66);}return _0x2ec907[_0xd5ae('0x19')](_0x38aa66)['end']();};}function respondWithResult(_0x162284,_0x3bc71f){_0x3bc71f=_0x3bc71f||0xc8;return function(_0x1611dc){if(_0x1611dc){return _0x162284[_0xd5ae('0x19')](_0x3bc71f)[_0xd5ae('0x1a')](_0x1611dc);}};}function respondWithFilteredResult(_0x3e7bd3,_0x3d2aac){return function(_0x5dcd02){if(_0x5dcd02){var _0xd2cfa8=typeof _0x3d2aac['offset']===_0xd5ae('0x1b')&&typeof _0x3d2aac[_0xd5ae('0x1c')]===_0xd5ae('0x1b');var _0x24f4ec=_0x5dcd02[_0xd5ae('0x1d')];var _0x547880=_0xd2cfa8?0x0:_0x3d2aac[_0xd5ae('0x1e')];var _0x193733=_0xd2cfa8?_0x5dcd02[_0xd5ae('0x1d')]:_0x3d2aac[_0xd5ae('0x1e')]+_0x3d2aac[_0xd5ae('0x1c')];var _0x362e4f;if(_0x193733>=_0x24f4ec){_0x193733=_0x24f4ec;_0x362e4f=0xc8;}else{_0x362e4f=0xce;}_0x3e7bd3[_0xd5ae('0x19')](_0x362e4f);return _0x3e7bd3[_0xd5ae('0x1f')](_0xd5ae('0x20'),_0x547880+'-'+_0x193733+'/'+_0x24f4ec)[_0xd5ae('0x1a')](_0x5dcd02);}return null;};}function patchUpdates(_0x43d8cb){return function(_0xd56a40){try{jsonpatch[_0xd5ae('0x21')](_0xd56a40,_0x43d8cb,!![]);}catch(_0x50e929){return BPromise[_0xd5ae('0x22')](_0x50e929);}return _0xd56a40['save']();};}function saveUpdates(_0x210fb2,_0x51c98f){return function(_0x297dd3){if(_0x297dd3){return _0x297dd3[_0xd5ae('0x23')](_0x210fb2)['then'](function(_0x35d3e){return _0x35d3e;});}return null;};}function removeEntity(_0x1be767,_0x46a5d0){return function(_0x144ca3){if(_0x144ca3){return _0x144ca3[_0xd5ae('0x24')]()[_0xd5ae('0x25')](function(){_0x1be767[_0xd5ae('0x19')](0xcc)[_0xd5ae('0x26')]();});}};}function handleEntityNotFound(_0x513c9a,_0x19664c){return function(_0x2663ff){if(!_0x2663ff){_0x513c9a[_0xd5ae('0x18')](0x194);}return _0x2663ff;};}function handleError(_0x4cb6a6,_0x4f57f8){_0x4f57f8=_0x4f57f8||0x1f4;return function(_0x44c0a5){logger[_0xd5ae('0x27')](_0x44c0a5[_0xd5ae('0x28')]);if(_0x44c0a5[_0xd5ae('0x29')]){delete _0x44c0a5[_0xd5ae('0x29')];}_0x4cb6a6[_0xd5ae('0x19')](_0x4f57f8)[_0xd5ae('0x2a')](_0x44c0a5);};}exports[_0xd5ae('0x23')]=function(_0x231208,_0x161118){if(_0x231208['body']['id']){delete _0x231208[_0xd5ae('0x2b')]['id'];}return db[_0xd5ae('0x2c')][_0xd5ae('0x2d')]({'where':{'id':_0x231208[_0xd5ae('0x2e')]['id']}})['then'](handleEntityNotFound(_0x161118,null))[_0xd5ae('0x25')](saveUpdates(_0x231208[_0xd5ae('0x2b')],null))['then'](respondWithResult(_0x161118,null))[_0xd5ae('0x2f')](handleError(_0x161118,null));};exports[_0xd5ae('0x24')]=function(_0x445aed,_0x4d2ba8){return db[_0xd5ae('0x2c')][_0xd5ae('0x2d')]({'where':{'id':_0x445aed[_0xd5ae('0x2e')]['id']}})['then'](handleEntityNotFound(_0x4d2ba8,null))[_0xd5ae('0x25')](removeEntity(_0x4d2ba8,null))[_0xd5ae('0x2f')](handleError(_0x4d2ba8,null));}; \ No newline at end of file +var _0x20c8=['json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','sendStatus','error','stack','send','body','find','params','destroy','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','status','end'];(function(_0x432a18,_0x573c9e){var _0x5032c8=function(_0x508d93){while(--_0x508d93){_0x432a18['push'](_0x432a18['shift']());}};_0x5032c8(++_0x573c9e);}(_0x20c8,0xf5));var _0x820c=function(_0x331289,_0x28b209){_0x331289=_0x331289-0x0;var _0x36520e=_0x20c8[_0x331289];return _0x36520e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x820c('0x0'));var zipdir=require(_0x820c('0x1'));var jsonpatch=require(_0x820c('0x2'));var rp=require(_0x820c('0x3'));var moment=require(_0x820c('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x820c('0x5'));var util=require(_0x820c('0x6'));var path=require(_0x820c('0x7'));var sox=require('sox');var csv=require(_0x820c('0x8'));var ejs=require(_0x820c('0x9'));var fs=require('fs');var fs_extra=require(_0x820c('0xa'));var _=require(_0x820c('0xb'));var squel=require('squel');var crypto=require(_0x820c('0xc'));var jsforce=require(_0x820c('0xd'));var deskjs=require(_0x820c('0xe'));var toCsv=require(_0x820c('0x8'));var querystring=require(_0x820c('0xf'));var Papa=require('papaparse');var Redis=require(_0x820c('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x820c('0x11'));var as=require(_0x820c('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x820c('0x13'))('api');var utils=require(_0x820c('0x14'));var config=require(_0x820c('0x15'));var licenseUtil=require(_0x820c('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5eb9c7,_0x18c9ed){_0x18c9ed=_0x18c9ed||0xcc;return function(_0x1ca1a7){if(_0x1ca1a7){return _0x5eb9c7['sendStatus'](_0x18c9ed);}return _0x5eb9c7[_0x820c('0x17')](_0x18c9ed)[_0x820c('0x18')]();};}function respondWithResult(_0x3c4eb8,_0x4a6654){_0x4a6654=_0x4a6654||0xc8;return function(_0x2506c1){if(_0x2506c1){return _0x3c4eb8['status'](_0x4a6654)[_0x820c('0x19')](_0x2506c1);}};}function respondWithFilteredResult(_0x2ab37f,_0x4ae973){return function(_0x1351f3){if(_0x1351f3){var _0x63aa49=typeof _0x4ae973[_0x820c('0x1a')]===_0x820c('0x1b')&&typeof _0x4ae973[_0x820c('0x1c')]===_0x820c('0x1b');var _0x47fc32=_0x1351f3['count'];var _0x4d57e3=_0x63aa49?0x0:_0x4ae973[_0x820c('0x1a')];var _0x2c95ca=_0x63aa49?_0x1351f3[_0x820c('0x1d')]:_0x4ae973[_0x820c('0x1a')]+_0x4ae973['limit'];var _0x99680e;if(_0x2c95ca>=_0x47fc32){_0x2c95ca=_0x47fc32;_0x99680e=0xc8;}else{_0x99680e=0xce;}_0x2ab37f[_0x820c('0x17')](_0x99680e);return _0x2ab37f[_0x820c('0x1e')](_0x820c('0x1f'),_0x4d57e3+'-'+_0x2c95ca+'/'+_0x47fc32)['json'](_0x1351f3);}return null;};}function patchUpdates(_0x5ba36a){return function(_0x38f881){try{jsonpatch[_0x820c('0x20')](_0x38f881,_0x5ba36a,!![]);}catch(_0x15ab22){return BPromise[_0x820c('0x21')](_0x15ab22);}return _0x38f881[_0x820c('0x22')]();};}function saveUpdates(_0x4bba55,_0x3afc3c){return function(_0x492125){if(_0x492125){return _0x492125[_0x820c('0x23')](_0x4bba55)[_0x820c('0x24')](function(_0x19a52a){return _0x19a52a;});}return null;};}function removeEntity(_0x263f4f,_0x2fda78){return function(_0x15a6d2){if(_0x15a6d2){return _0x15a6d2['destroy']()['then'](function(){_0x263f4f[_0x820c('0x17')](0xcc)[_0x820c('0x18')]();});}};}function handleEntityNotFound(_0x583f05,_0x34428c){return function(_0x7b126d){if(!_0x7b126d){_0x583f05[_0x820c('0x25')](0x194);}return _0x7b126d;};}function handleError(_0xa3b685,_0x3eb355){_0x3eb355=_0x3eb355||0x1f4;return function(_0x4a2dab){logger[_0x820c('0x26')](_0x4a2dab[_0x820c('0x27')]);if(_0x4a2dab['name']){delete _0x4a2dab['name'];}_0xa3b685[_0x820c('0x17')](_0x3eb355)[_0x820c('0x28')](_0x4a2dab);};}exports[_0x820c('0x23')]=function(_0x5c9e8f,_0x2ec9a9){if(_0x5c9e8f['body']['id']){delete _0x5c9e8f[_0x820c('0x29')]['id'];}return db['Action'][_0x820c('0x2a')]({'where':{'id':_0x5c9e8f[_0x820c('0x2b')]['id']}})[_0x820c('0x24')](handleEntityNotFound(_0x2ec9a9,null))[_0x820c('0x24')](saveUpdates(_0x5c9e8f['body'],null))[_0x820c('0x24')](respondWithResult(_0x2ec9a9,null))['catch'](handleError(_0x2ec9a9,null));};exports[_0x820c('0x2c')]=function(_0x2b8f8,_0x3ad2e9){return db['Action']['find']({'where':{'id':_0x2b8f8[_0x820c('0x2b')]['id']}})[_0x820c('0x24')](handleEntityNotFound(_0x3ad2e9,null))[_0x820c('0x24')](removeEntity(_0x3ad2e9,null))['catch'](handleError(_0x3ad2e9,null));}; \ No newline at end of file diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js index e19bfe9..ad4997a 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 _0xd810=['moment','path','../../config/environment','exports','define','Action','tools_actions','lodash','util','api'];(function(_0x40ddcd,_0x18afb1){var _0x36ca16=function(_0x49f70b){while(--_0x49f70b){_0x40ddcd['push'](_0x40ddcd['shift']());}};_0x36ca16(++_0x18afb1);}(_0xd810,0x1dd));var _0x0d81=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0xd810[_0x2c91e9];return _0x13f0ff;};'use strict';var _=require(_0x0d81('0x0'));var util=require(_0x0d81('0x1'));var logger=require('../../config/logger')(_0x0d81('0x2'));var moment=require(_0x0d81('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x0d81('0x4'));var rimraf=require('rimraf');var config=require(_0x0d81('0x5'));var attributes=require('./action.attributes');module[_0x0d81('0x6')]=function(_0x3ca23e,_0xa8b39f){return _0x3ca23e[_0x0d81('0x7')](_0x0d81('0x8'),attributes,{'tableName':_0x0d81('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1576=['exports','define','Action','../../config/logger','api','bluebird','path','rimraf','../../config/environment','./action.attributes'];(function(_0x2065a0,_0x37f1b2){var _0x2e4c65=function(_0x46d5e0){while(--_0x46d5e0){_0x2065a0['push'](_0x2065a0['shift']());}};_0x2e4c65(++_0x37f1b2);}(_0x1576,0x67));var _0x6157=function(_0x4ca796,_0x10dc47){_0x4ca796=_0x4ca796-0x0;var _0x171f87=_0x1576[_0x4ca796];return _0x171f87;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x6157('0x0'))(_0x6157('0x1'));var moment=require('moment');var BPromise=require(_0x6157('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6157('0x3'));var rimraf=require(_0x6157('0x4'));var config=require(_0x6157('0x5'));var attributes=require(_0x6157('0x6'));module[_0x6157('0x7')]=function(_0x43a89f,_0x233812){return _0x43a89f[_0x6157('0x8')](_0x6157('0x9'),attributes,{'tableName':'tools_actions','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 23c0824..9868a25 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 _0x7217=['stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Action,\x20%s,\x20%s','debug','Action,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x3d42d8,_0x4cffaa){var _0x27fc41=function(_0x3a363b){while(--_0x3a363b){_0x3d42d8['push'](_0x3d42d8['shift']());}};_0x27fc41(++_0x4cffaa);}(_0x7217,0x19e));var _0x7721=function(_0x4c7fb5,_0x2548ef){_0x4c7fb5=_0x4c7fb5-0x0;var _0x2e10ac=_0x7217[_0x4c7fb5];return _0x2e10ac;};'use strict';var _=require(_0x7721('0x0'));var util=require('util');var moment=require(_0x7721('0x1'));var BPromise=require(_0x7721('0x2'));var rs=require(_0x7721('0x3'));var fs=require('fs');var Redis=require(_0x7721('0x4'));var db=require(_0x7721('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x7721('0x6'));var config=require(_0x7721('0x7'));var jayson=require(_0x7721('0x8'));var client=jayson[_0x7721('0x9')][_0x7721('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xf7ff37,_0x18ab6b,_0x21f680){return new BPromise(function(_0x225610,_0x2f99ed){return client[_0x7721('0xb')](_0xf7ff37,_0x21f680)[_0x7721('0xc')](function(_0xfa8835){logger[_0x7721('0xd')](_0x7721('0xe'),_0x18ab6b,'request\x20sent');logger[_0x7721('0xf')](_0x7721('0x10'),_0x18ab6b,_0x7721('0x11'),JSON[_0x7721('0x12')](_0xfa8835));if(_0xfa8835[_0x7721('0x13')]){if(_0xfa8835[_0x7721('0x13')][_0x7721('0x14')]===0x1f4){logger[_0x7721('0x13')]('Action,\x20%s,\x20%s',_0x18ab6b,_0xfa8835[_0x7721('0x13')][_0x7721('0x15')]);return _0x2f99ed(_0xfa8835['error'][_0x7721('0x15')]);}logger[_0x7721('0x13')](_0x7721('0xe'),_0x18ab6b,_0xfa8835[_0x7721('0x13')]['message']);return _0x225610(_0xfa8835[_0x7721('0x13')][_0x7721('0x15')]);}else{logger['info']('Action,\x20%s,\x20%s',_0x18ab6b,'request\x20sent');_0x225610(_0xfa8835[_0x7721('0x16')][_0x7721('0x15')]);}})[_0x7721('0x17')](function(_0x32550d){logger['error'](_0x7721('0xe'),_0x18ab6b,_0x32550d);_0x2f99ed(_0x32550d);});});} \ No newline at end of file +var _0x4975=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','Action,\x20%s,\x20%s','request\x20sent','debug','Action,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','moment','bluebird','randomstring'];(function(_0x4baae2,_0x487ab6){var _0x1a2285=function(_0x1cea47){while(--_0x1cea47){_0x4baae2['push'](_0x4baae2['shift']());}};_0x1a2285(++_0x487ab6);}(_0x4975,0x86));var _0x5497=function(_0x5dbe83,_0x30f5eb){_0x5dbe83=_0x5dbe83-0x0;var _0x598efd=_0x4975[_0x5dbe83];return _0x598efd;};'use strict';var _=require(_0x5497('0x0'));var util=require('util');var moment=require(_0x5497('0x1'));var BPromise=require(_0x5497('0x2'));var rs=require(_0x5497('0x3'));var fs=require('fs');var Redis=require(_0x5497('0x4'));var db=require(_0x5497('0x5'))['db'];var utils=require(_0x5497('0x6'));var logger=require(_0x5497('0x7'))(_0x5497('0x8'));var config=require(_0x5497('0x9'));var jayson=require(_0x5497('0xa'));var client=jayson['client'][_0x5497('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4f563d,_0x1d0019,_0x674a2a){return new BPromise(function(_0x368e8b,_0x57f930){return client[_0x5497('0xc')](_0x4f563d,_0x674a2a)['then'](function(_0x1f63d8){logger[_0x5497('0xd')](_0x5497('0xe'),_0x1d0019,_0x5497('0xf'));logger[_0x5497('0x10')](_0x5497('0x11'),_0x1d0019,_0x5497('0xf'),JSON[_0x5497('0x12')](_0x1f63d8));if(_0x1f63d8['error']){if(_0x1f63d8['error']['code']===0x1f4){logger[_0x5497('0x13')](_0x5497('0xe'),_0x1d0019,_0x1f63d8[_0x5497('0x13')][_0x5497('0x14')]);return _0x57f930(_0x1f63d8[_0x5497('0x13')][_0x5497('0x14')]);}logger[_0x5497('0x13')](_0x5497('0xe'),_0x1d0019,_0x1f63d8[_0x5497('0x13')][_0x5497('0x14')]);return _0x368e8b(_0x1f63d8['error'][_0x5497('0x14')]);}else{logger['info'](_0x5497('0xe'),_0x1d0019,_0x5497('0xf'));_0x368e8b(_0x1f63d8[_0x5497('0x15')][_0x5497('0x14')]);}})[_0x5497('0x16')](function(_0x4073e6){logger[_0x5497('0x13')]('Action,\x20%s,\x20%s',_0x1d0019,_0x4073e6);_0x57f930(_0x4073e6);});});} \ No newline at end of file diff --git a/server/api/action/index.js b/server/api/action/index.js index 9a70e37..6e3b541 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 _0xf271=['../../config/environment','./action.controller','put','/:id','update','delete','isAuthenticated','destroy','exports','util','path','express','../../components/auth/service'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf271,0x1b6));var _0x1f27=function(_0xc5985b,_0x1240a1){_0xc5985b=_0xc5985b-0x0;var _0x5f5abd=_0xf271[_0xc5985b];return _0x5f5abd;};'use strict';var multer=require('multer');var util=require(_0x1f27('0x0'));var path=require(_0x1f27('0x1'));var timeout=require('connect-timeout');var express=require(_0x1f27('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x1f27('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x1f27('0x4'));var controller=require(_0x1f27('0x5'));router[_0x1f27('0x6')](_0x1f27('0x7'),auth['isAuthenticated'](),controller[_0x1f27('0x8')]);router[_0x1f27('0x9')]('/:id',auth[_0x1f27('0xa')](),controller[_0x1f27('0xb')]);module[_0x1f27('0xc')]=router; \ No newline at end of file +var _0x0f76=['connect-timeout','express','Router','fs-extra','../../components/interaction/service','./action.controller','put','/:id','isAuthenticated','update','delete','multer','util','path'];(function(_0x4691f1,_0x1f7dcb){var _0x2937b8=function(_0x15b4cc){while(--_0x15b4cc){_0x4691f1['push'](_0x4691f1['shift']());}};_0x2937b8(++_0x1f7dcb);}(_0x0f76,0x1d9));var _0x60f7=function(_0x38622b,_0x3cfdf7){_0x38622b=_0x38622b-0x0;var _0x2c1a7a=_0x0f76[_0x38622b];return _0x2c1a7a;};'use strict';var multer=require(_0x60f7('0x0'));var util=require(_0x60f7('0x1'));var path=require(_0x60f7('0x2'));var timeout=require(_0x60f7('0x3'));var express=require(_0x60f7('0x4'));var router=express[_0x60f7('0x5')]();var fs_extra=require(_0x60f7('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x60f7('0x7'));var config=require('../../config/environment');var controller=require(_0x60f7('0x8'));router[_0x60f7('0x9')](_0x60f7('0xa'),auth[_0x60f7('0xb')](),controller[_0x60f7('0xc')]);router[_0x60f7('0xd')](_0x60f7('0xa'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.attributes.js b/server/api/analyticCustomReport/analyticCustomReport.attributes.js index a02456e..aa72b9e 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 _0x98a8=['sequelize','exports','STRING','TEXT'];(function(_0x57686a,_0x54adbd){var _0x335299=function(_0x5a931b){while(--_0x5a931b){_0x57686a['push'](_0x57686a['shift']());}};_0x335299(++_0x54adbd);}(_0x98a8,0x12c));var _0x898a=function(_0x16c859,_0x12b9f9){_0x16c859=_0x16c859-0x0;var _0x3475e7=_0x98a8[_0x16c859];return _0x3475e7;};'use strict';var Sequelize=require(_0x898a('0x0'));module[_0x898a('0x1')]={'name':{'type':Sequelize[_0x898a('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x898a('0x2')]},'parent':{'type':Sequelize[_0x898a('0x2')]},'table':{'type':Sequelize[_0x898a('0x2')]},'conditions':{'type':Sequelize[_0x898a('0x3')]},'joins':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0x5fab=['exports','STRING','TEXT','sequelize'];(function(_0x48b88f,_0x2e1e94){var _0x34d441=function(_0x4eeea2){while(--_0x4eeea2){_0x48b88f['push'](_0x48b88f['shift']());}};_0x34d441(++_0x2e1e94);}(_0x5fab,0x177));var _0xb5fa=function(_0x125597,_0x1d5ddd){_0x125597=_0x125597-0x0;var _0x5a6818=_0x5fab[_0x125597];return _0x5a6818;};'use strict';var Sequelize=require(_0xb5fa('0x0'));module[_0xb5fa('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0xb5fa('0x2')]},'parent':{'type':Sequelize[_0xb5fa('0x2')]},'table':{'type':Sequelize[_0xb5fa('0x2')]},'conditions':{'type':Sequelize[_0xb5fa('0x3')]},'joins':{'type':Sequelize[_0xb5fa('0x3')]}}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js index d8f39a4..0604d21 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 _0x478d=['count','set','Content-Range','apply','reject','save','update','then','get','CustomReports','destroy','error','name','map','AnalyticCustomReport','rawAttributes','fieldName','key','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','length','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','preview','join','left_join','right_join','cross_join','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','value','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','from','MetricId','metric','function','replace','format','groupBy','orderBy','DESC','alias','joins','type','table','parentKey','foreignTable','foreignKey','conditions','parse','Limited\x20Query:','toString','sequelize','SELECT','SUM(%s)','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','IS\x20NOT\x20NULL','getFields','%s.%s\x20=\x20%s.%s','clone','output','web','fullPath','%s-%s.%s','randomstring','csv','custom','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(*)','QueryTypes','run','runReport','debug','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x478d,0x89));var _0xd478=function(_0x50d993,_0x300507){_0x50d993=_0x50d993-0x0;var _0x5483d4=_0x478d[_0x50d993];return _0x5483d4;};'use strict';var emlformat=require(_0xd478('0x0'));var rimraf=require(_0xd478('0x1'));var zipdir=require(_0xd478('0x2'));var jsonpatch=require(_0xd478('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xd478('0x4'));var Mustache=require(_0xd478('0x5'));var util=require(_0xd478('0x6'));var path=require(_0xd478('0x7'));var sox=require(_0xd478('0x8'));var csv=require(_0xd478('0x9'));var ejs=require(_0xd478('0xa'));var fs=require('fs');var fs_extra=require(_0xd478('0xb'));var _=require(_0xd478('0xc'));var squel=require(_0xd478('0xd'));var crypto=require('crypto');var jsforce=require(_0xd478('0xe'));var deskjs=require(_0xd478('0xf'));var toCsv=require(_0xd478('0x9'));var querystring=require(_0xd478('0x10'));var Papa=require(_0xd478('0x11'));var Redis=require(_0xd478('0x12'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd478('0x13'));var logger=require('../../config/logger')(_0xd478('0x14'));var utils=require(_0xd478('0x15'));var config=require(_0xd478('0x16'));var licenseUtil=require(_0xd478('0x17'));var db=require(_0xd478('0x18'))['db'];var dbH=require(_0xd478('0x18'))['dbH'];function respondWithStatusCode(_0x49ae82,_0x3eb661){_0x3eb661=_0x3eb661||0xcc;return function(_0x2bebf6){if(_0x2bebf6){return _0x49ae82[_0xd478('0x19')](_0x3eb661);}return _0x49ae82['status'](_0x3eb661)[_0xd478('0x1a')]();};}function respondWithResult(_0x513069,_0xfb7f78){_0xfb7f78=_0xfb7f78||0xc8;return function(_0x359d81){if(_0x359d81){return _0x513069[_0xd478('0x1b')](_0xfb7f78)[_0xd478('0x1c')](_0x359d81);}};}function respondWithFilteredResult(_0x5d4d48,_0x58b0fc){return function(_0x5b254f){if(_0x5b254f){var _0x4f2247=typeof _0x58b0fc[_0xd478('0x1d')]===_0xd478('0x1e')&&typeof _0x58b0fc[_0xd478('0x1f')]===_0xd478('0x1e');var _0x4bcd77=_0x5b254f[_0xd478('0x20')];var _0x2b36cd=_0x4f2247?0x0:_0x58b0fc[_0xd478('0x1d')];var _0x13f9af=_0x4f2247?_0x5b254f[_0xd478('0x20')]:_0x58b0fc[_0xd478('0x1d')]+_0x58b0fc['limit'];var _0x1e64cc;if(_0x13f9af>=_0x4bcd77){_0x13f9af=_0x4bcd77;_0x1e64cc=0xc8;}else{_0x1e64cc=0xce;}_0x5d4d48['status'](_0x1e64cc);return _0x5d4d48[_0xd478('0x21')](_0xd478('0x22'),_0x2b36cd+'-'+_0x13f9af+'/'+_0x4bcd77)[_0xd478('0x1c')](_0x5b254f);}return null;};}function patchUpdates(_0x2aec56){return function(_0x44347d){try{jsonpatch[_0xd478('0x23')](_0x44347d,_0x2aec56,!![]);}catch(_0x54e2a5){return BPromise[_0xd478('0x24')](_0x54e2a5);}return _0x44347d[_0xd478('0x25')]();};}function saveUpdates(_0x45b957,_0x1263de){return function(_0x13c57f){if(_0x13c57f){return _0x13c57f[_0xd478('0x26')](_0x45b957)[_0xd478('0x27')](function(_0x2236d0){return _0x2236d0;});}return null;};}function removeEntity(_0x470a11,_0x476396){return function(_0x5b6d7e){if(_0x5b6d7e){return _0x5b6d7e['destroy']()[_0xd478('0x27')](function(){var _0x4b983c=_0x5b6d7e[_0xd478('0x28')]({'plain':!![]});var _0x3021ea=_0xd478('0x29');return db['UserProfileResource'][_0xd478('0x2a')]({'where':{'type':_0x3021ea,'resourceId':_0x4b983c['id']}})['then'](function(){return _0x5b6d7e;});})['then'](function(){_0x470a11[_0xd478('0x1b')](0xcc)[_0xd478('0x1a')]();});}};}function handleEntityNotFound(_0x2356db,_0x5ca354){return function(_0x2b7db7){if(!_0x2b7db7){_0x2356db[_0xd478('0x19')](0x194);}return _0x2b7db7;};}function handleError(_0x3a4c8f,_0xf6d0e5){_0xf6d0e5=_0xf6d0e5||0x1f4;return function(_0x77ba3b){logger[_0xd478('0x2b')](_0x77ba3b['stack']);if(_0x77ba3b[_0xd478('0x2c')]){delete _0x77ba3b[_0xd478('0x2c')];}_0x3a4c8f[_0xd478('0x1b')](_0xf6d0e5)['send'](_0x77ba3b);};}exports['index']=function(_0x598278,_0x225976){var _0x255893={},_0x3cd539={},_0x49c04a={'count':0x0,'rows':[]};var _0x2bd975=_[_0xd478('0x2d')](db[_0xd478('0x2e')][_0xd478('0x2f')],function(_0x22e74a){return{'name':_0x22e74a[_0xd478('0x30')],'type':_0x22e74a['type'][_0xd478('0x31')]};});_0x3cd539[_0xd478('0x32')]=_[_0xd478('0x2d')](_0x2bd975,'name');_0x3cd539[_0xd478('0x33')]=_[_0xd478('0x34')](_0x598278['query']);_0x3cd539[_0xd478('0x35')]=_['intersection'](_0x3cd539[_0xd478('0x32')],_0x3cd539['query']);_0x255893[_0xd478('0x36')]=_[_0xd478('0x37')](_0x3cd539[_0xd478('0x32')],qs[_0xd478('0x38')](_0x598278[_0xd478('0x33')]['fields']));_0x255893[_0xd478('0x36')]=_0x255893[_0xd478('0x36')]['length']?_0x255893['attributes']:_0x3cd539[_0xd478('0x32')];if(!_0x598278[_0xd478('0x33')][_0xd478('0x39')]('nolimit')){_0x255893[_0xd478('0x1f')]=qs[_0xd478('0x1f')](_0x598278[_0xd478('0x33')][_0xd478('0x1f')]);_0x255893[_0xd478('0x1d')]=qs['offset'](_0x598278['query'][_0xd478('0x1d')]);}_0x255893[_0xd478('0x3a')]=qs[_0xd478('0x3b')](_0x598278[_0xd478('0x33')][_0xd478('0x3b')]);_0x255893[_0xd478('0x3c')]=qs['filters'](_[_0xd478('0x3d')](_0x598278['query'],_0x3cd539['filters']),_0x2bd975);if(_0x598278[_0xd478('0x33')][_0xd478('0x3e')]){_0x255893[_0xd478('0x3c')]=_[_0xd478('0x3f')](_0x255893[_0xd478('0x3c')],{'$or':_[_0xd478('0x2d')](_0x2bd975,function(_0x4fd87b){if(_0x4fd87b['type']!==_0xd478('0x40')){var _0x536e85={};_0x536e85[_0x4fd87b[_0xd478('0x2c')]]={'$like':'%'+_0x598278[_0xd478('0x33')][_0xd478('0x3e')]+'%'};return _0x536e85;}})});}_0x255893=_[_0xd478('0x3f')]({},_0x255893,_0x598278[_0xd478('0x41')]);var _0xed1d8e={'where':_0x255893['where']};return db[_0xd478('0x2e')]['count'](_0xed1d8e)[_0xd478('0x27')](function(_0x275074){_0x49c04a['count']=_0x275074;if(_0x598278[_0xd478('0x33')][_0xd478('0x42')]){_0x255893[_0xd478('0x43')]=[{'all':!![]}];}return db[_0xd478('0x2e')][_0xd478('0x44')](_0x255893);})[_0xd478('0x27')](function(_0x1ab951){_0x49c04a[_0xd478('0x45')]=_0x1ab951;return _0x49c04a;})[_0xd478('0x27')](respondWithFilteredResult(_0x225976,_0x255893))[_0xd478('0x46')](handleError(_0x225976,null));};exports['show']=function(_0x34ad15,_0x1dc1c6){var _0x4d1b1a={'raw':![],'where':{'id':_0x34ad15[_0xd478('0x47')]['id']}},_0x4dda7a={};_0x4dda7a['model']=_['keys'](db[_0xd478('0x2e')][_0xd478('0x2f')]);_0x4dda7a[_0xd478('0x33')]=_[_0xd478('0x34')](_0x34ad15[_0xd478('0x33')]);_0x4dda7a[_0xd478('0x35')]=_[_0xd478('0x37')](_0x4dda7a[_0xd478('0x32')],_0x4dda7a[_0xd478('0x33')]);_0x4d1b1a[_0xd478('0x36')]=_[_0xd478('0x37')](_0x4dda7a[_0xd478('0x32')],qs[_0xd478('0x38')](_0x34ad15[_0xd478('0x33')][_0xd478('0x38')]));_0x4d1b1a[_0xd478('0x36')]=_0x4d1b1a[_0xd478('0x36')][_0xd478('0x48')]?_0x4d1b1a[_0xd478('0x36')]:_0x4dda7a['model'];if(_0x34ad15[_0xd478('0x33')][_0xd478('0x42')]){_0x4d1b1a[_0xd478('0x43')]=[{'all':!![]}];}_0x4d1b1a=_['merge']({},_0x4d1b1a,_0x34ad15[_0xd478('0x41')]);return db['AnalyticCustomReport'][_0xd478('0x49')](_0x4d1b1a)[_0xd478('0x27')](handleEntityNotFound(_0x1dc1c6,null))[_0xd478('0x27')](respondWithResult(_0x1dc1c6,null))['catch'](handleError(_0x1dc1c6,null));};exports[_0xd478('0x4a')]=function(_0x4f65f0,_0x19070f){return db[_0xd478('0x2e')][_0xd478('0x4a')](_0x4f65f0[_0xd478('0x4b')],{})[_0xd478('0x27')](function(_0x29a6cc){var _0x3d443f=_0x4f65f0[_0xd478('0x4c')][_0xd478('0x28')]({'plain':!![]});if(!_0x3d443f)throw new Error(_0xd478('0x4d'));if(_0x3d443f[_0xd478('0x4e')]===_0xd478('0x4c')){var _0x528c26=_0x29a6cc[_0xd478('0x28')]({'plain':!![]});var _0x59201b='Reports';return db[_0xd478('0x4f')][_0xd478('0x49')]({'where':{'name':_0x59201b,'userProfileId':_0x3d443f['userProfileId']},'raw':!![]})[_0xd478('0x27')](function(_0x4fdbe0){if(_0x4fdbe0&&_0x4fdbe0[_0xd478('0x50')]===0x0){return db[_0xd478('0x51')][_0xd478('0x4a')]({'name':_0x528c26['name'],'resourceId':_0x528c26['id'],'type':_0xd478('0x29'),'sectionId':_0x4fdbe0['id']},{})['then'](function(){return _0x29a6cc;});}else{return _0x29a6cc;}})['catch'](function(_0x3091d9){logger[_0xd478('0x2b')](_0xd478('0x52'),_0x3091d9);throw _0x3091d9;});}return _0x29a6cc;})[_0xd478('0x27')](respondWithResult(_0x19070f,0xc9))[_0xd478('0x46')](handleError(_0x19070f,null));};exports[_0xd478('0x26')]=function(_0x12135e,_0x458751){if(_0x12135e['body']['id']){delete _0x12135e[_0xd478('0x4b')]['id'];}return db[_0xd478('0x2e')]['find']({'where':{'id':_0x12135e['params']['id']}})[_0xd478('0x27')](handleEntityNotFound(_0x458751,null))[_0xd478('0x27')](saveUpdates(_0x12135e[_0xd478('0x4b')],null))['then'](respondWithResult(_0x458751,null))['catch'](handleError(_0x458751,null));};exports[_0xd478('0x2a')]=function(_0x3d6122,_0x1b758b){return db[_0xd478('0x2e')]['find']({'where':{'id':_0x3d6122[_0xd478('0x47')]['id']}})[_0xd478('0x27')](handleEntityNotFound(_0x1b758b,null))[_0xd478('0x27')](removeEntity(_0x1b758b,null))[_0xd478('0x46')](handleError(_0x1b758b,null));};exports[_0xd478('0x53')]=function(_0x4a7812,_0x3059e8){var _0x3a843b=0xa;var _0x4300ce=[_0xd478('0x54'),_0xd478('0x55'),_0xd478('0x56'),_0xd478('0x57')];var _0x1714d2={'SUM':'SUM(%s)','COUNT':_0xd478('0x58'),'COUNT DISTINCT':_0xd478('0x59'),'MAX':_0xd478('0x5a'),'MIN':_0xd478('0x5b'),'AVG':'AVG(%s)','GROUP_CONCAT':_0xd478('0x5c'),'GROUP_CONCAT ASC':_0xd478('0x5d'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x2838f7={'SEC_TO_TIME':_0xd478('0x5e'),'DATE':_0xd478('0x5f'),'HOUR':_0xd478('0x60'),'ROUND':_0xd478('0x61'),'UNIX_TIMESTAMP':_0xd478('0x62')};var _0x364935=function(_0x22ec6a){return!_[_0xd478('0x63')]([_0xd478('0x64'),'IS\x20NOT\x20NULL',_0xd478('0x65'),_0xd478('0x66')],_0x22ec6a);};var _0x1efe18=function(_0xc21242){if(!_0xc21242||!_0xc21242[_0xd478('0x67')]['length']){return'';}for(var _0xdc14f3='(',_0x5141b8=0x0;_0x5141b8<_0xc21242[_0xd478('0x67')]['length'];_0x5141b8+=0x1){_0x5141b8>0x0&&(_0xdc14f3+='\x20'+_0xc21242[_0xd478('0x68')]+'\x20');_0xdc14f3+=_0xc21242[_0xd478('0x67')][_0x5141b8][_0xd478('0x69')]?_0x1efe18(_0xc21242[_0xd478('0x67')][_0x5141b8]['group']):_0xc21242['rules'][_0x5141b8][_0xd478('0x6a')]+'\x20'+_0xc21242[_0xd478('0x67')][_0x5141b8][_0xd478('0x6b')]+(_0x364935(_0xc21242[_0xd478('0x67')][_0x5141b8]['condition'])?'\x20'+_0xc21242[_0xd478('0x67')][_0x5141b8][_0xd478('0x6c')]:'');}return _0xdc14f3+')';};var _0x50cefd={'where':{'id':_0x4a7812[_0xd478('0x47')]['id']}},_0x1c34d6,_0xbfb162,_0x52b817,_0x4e3172,_0x370feb;_0x50cefd=_[_0xd478('0x3f')]({},_0x50cefd,_0x4a7812[_0xd478('0x41')]);return db[_0xd478('0x2e')]['find'](_0x50cefd)[_0xd478('0x27')](function(_0x46e7b3){if(_0x46e7b3){_0x1c34d6=_0x46e7b3;return _0x46e7b3['getFields']();}return null;})[_0xd478('0x27')](function(_0x1f4392){if(_0x1f4392){if(!_0x1f4392[_0xd478('0x48')]){throw new db[(_0xd478('0x6d'))][(_0xd478('0x6e'))](_0xd478('0x6f'),0x193);}_0xbfb162=_0x1f4392;return db[_0xd478('0x70')]['findAll']({'raw':!![]});}return null;})['then'](function(_0x2f530e){if(_0x2f530e){_0x52b817=_[_0xd478('0x71')](_0x2f530e,'id');var _0x3ec742;var _0x4c6a79=squel[_0xd478('0x72')]();_0x4c6a79[_0xd478('0x73')](_0x1c34d6['table']);for(var _0x5ceb2a=0x0;_0x5ceb2a<_0xbfb162[_0xd478('0x48')];_0x5ceb2a+=0x1){_0x3ec742=_0xbfb162[_0x5ceb2a][_0xd478('0x74')]?_0x52b817[_0xbfb162[_0x5ceb2a][_0xd478('0x74')]][_0xd478('0x75')]:_0xbfb162[_0x5ceb2a][_0xd478('0x6a')];_0x3ec742=_0xbfb162[_0x5ceb2a][_0xd478('0x76')]?_[_0xd478('0x77')](_0x1714d2[_0xbfb162[_0x5ceb2a][_0xd478('0x76')]],'%s',_0x3ec742):_0x3ec742;_0x3ec742=_0xbfb162[_0x5ceb2a][_0xd478('0x78')]?_[_0xd478('0x77')](_0x2838f7[_0xbfb162[_0x5ceb2a][_0xd478('0x78')]],'%s',_0x3ec742):_0x3ec742;if(_0xbfb162[_0x5ceb2a][_0xd478('0x79')]){_0x4c6a79['group'](_0x3ec742);}_0xbfb162[_0x5ceb2a][_0xd478('0x7a')]&&_0x4c6a79['order'](_0x3ec742,_0xbfb162[_0x5ceb2a][_0xd478('0x7a')]===_0xd478('0x7b')?![]:!![]);_0x4c6a79[_0xd478('0x6a')](_0x3ec742,_0xbfb162[_0x5ceb2a][_0xd478('0x7c')]||_0x3ec742);}if(_0x1c34d6[_0xd478('0x7d')]){_0x1c34d6['joins']=JSON['parse'](_0x1c34d6[_0xd478('0x7d')]);for(var _0x130c8f=0x0;_0x130c8f<_0x1c34d6[_0xd478('0x7d')]['length'];_0x130c8f+=0x1){if(_0x1c34d6[_0xd478('0x7d')][_0x130c8f][_0xd478('0x7e')]&&_[_0xd478('0x63')](_0x4300ce,_0x1c34d6[_0xd478('0x7d')][_0x130c8f][_0xd478('0x7e')])&&_0x1c34d6[_0xd478('0x7d')][_0x130c8f]['parentKey']&&_0x1c34d6[_0xd478('0x7d')][_0x130c8f]['foreignTable']&&_0x1c34d6[_0xd478('0x7d')][_0x130c8f]['foreignKey']){_0x4c6a79[_0x1c34d6[_0xd478('0x7d')][_0x130c8f]['type']](_0x1c34d6[_0xd478('0x7d')][_0x130c8f]['foreignTable'],null,util[_0xd478('0x78')]('%s.%s\x20=\x20%s.%s',_0x1c34d6[_0xd478('0x7f')],_0x1c34d6[_0xd478('0x7d')][_0x130c8f][_0xd478('0x80')],_0x1c34d6[_0xd478('0x7d')][_0x130c8f][_0xd478('0x81')],_0x1c34d6['joins'][_0x130c8f][_0xd478('0x82')]));}}}if(_0x1c34d6[_0xd478('0x83')]){_0x1c34d6['conditions']=JSON[_0xd478('0x84')](_0x1c34d6[_0xd478('0x83')]);_0x4c6a79[_0xd478('0x3c')](_0x1efe18(_0x1c34d6[_0xd478('0x83')][_0xd478('0x69')]));}_0x370feb=_0x4c6a79['clone']();_0x4c6a79[_0xd478('0x1f')](_0x3a843b);_0x4c6a79[_0xd478('0x1d')](0x0);logger['debug'](_0xd478('0x85'),_0x4c6a79[_0xd478('0x86')]());return dbH[_0xd478('0x87')][_0xd478('0x33')](_0x4c6a79[_0xd478('0x86')](),{'type':dbH['sequelize']['QueryTypes'][_0xd478('0x88')]});}})['then'](respondWithResult(_0x3059e8,null))[_0xd478('0x46')](handleError(_0x3059e8,null));};function runReport(_0x4f746f,_0x3f6e07,_0x5507c4){var _0x1adce9=_0x3f6e07[_0xd478('0x2c')];var _0x212002=0xa;var _0x23315c=['join',_0xd478('0x55'),_0xd478('0x56'),_0xd478('0x57')];var _0x23cb57={'SUM':_0xd478('0x89'),'COUNT':_0xd478('0x58'),'COUNT DISTINCT':_0xd478('0x59'),'MAX':'MAX(%s)','MIN':_0xd478('0x5b'),'AVG':_0xd478('0x8a'),'GROUP_CONCAT':_0xd478('0x5c'),'GROUP_CONCAT ASC':_0xd478('0x5d'),'GROUP_CONCAT DESC':_0xd478('0x8b')};var _0x4efae6={'SEC_TO_TIME':_0xd478('0x5e'),'DATE':'DATE(%s)','HOUR':'HOUR(%s)','ROUND':_0xd478('0x61'),'UNIX_TIMESTAMP':_0xd478('0x62')};var _0xd475e8=function(_0x4298be){return!_[_0xd478('0x63')]([_0xd478('0x64'),_0xd478('0x8c'),_0xd478('0x65'),'IS\x20NOT\x20EMPTY'],_0x4298be);};var _0x52b669=function(_0x55d698){if(!_0x55d698||!_0x55d698[_0xd478('0x67')]['length']){return'';}for(var _0x399152='(',_0x5bb4e9=0x0;_0x5bb4e9<_0x55d698[_0xd478('0x67')][_0xd478('0x48')];_0x5bb4e9+=0x1){_0x5bb4e9>0x0&&(_0x399152+='\x20'+_0x55d698['operator']+'\x20');_0x399152+=_0x55d698[_0xd478('0x67')][_0x5bb4e9][_0xd478('0x69')]?_0x52b669(_0x55d698['rules'][_0x5bb4e9][_0xd478('0x69')]):_0x55d698[_0xd478('0x67')][_0x5bb4e9][_0xd478('0x6a')]+'\x20'+_0x55d698['rules'][_0x5bb4e9]['condition']+(_0xd475e8(_0x55d698[_0xd478('0x67')][_0x5bb4e9][_0xd478('0x6b')])?'\x20'+_0x55d698['rules'][_0x5bb4e9][_0xd478('0x6c')]:'');}return _0x399152+')';};var _0x3e1f76={'where':{'id':_0x4f746f['id']}},_0x288429,_0x2e9138,_0x3cb4cd,_0x2958ba,_0x49b823;_0x3e1f76=_['merge']({},_0x3e1f76,_0x5507c4);return db['AnalyticCustomReport'][_0xd478('0x49')](_0x3e1f76)[_0xd478('0x27')](function(_0x26c7e2){if(_0x26c7e2){_0x288429=_0x26c7e2;return _0x26c7e2[_0xd478('0x8d')]();}return null;})[_0xd478('0x27')](function(_0x374e95){if(_0x374e95){if(!_0x374e95[_0xd478('0x48')]){throw new db[(_0xd478('0x6d'))][(_0xd478('0x6e'))](_0xd478('0x6f'),0x193);}_0x2e9138=_0x374e95;return db[_0xd478('0x70')][_0xd478('0x44')]({'raw':!![]});}return null;})[_0xd478('0x27')](function(_0x45bade){if(_0x45bade){_0x3cb4cd=_[_0xd478('0x71')](_0x45bade,'id');var _0x184d8b;var _0x51e96a=squel['select']();_0x51e96a[_0xd478('0x73')](_0x288429[_0xd478('0x7f')]);for(var _0x53755f=0x0;_0x53755f<_0x2e9138[_0xd478('0x48')];_0x53755f+=0x1){_0x184d8b=_0x2e9138[_0x53755f][_0xd478('0x74')]?_0x3cb4cd[_0x2e9138[_0x53755f][_0xd478('0x74')]][_0xd478('0x75')]:_0x2e9138[_0x53755f][_0xd478('0x6a')];_0x184d8b=_0x2e9138[_0x53755f][_0xd478('0x76')]?_[_0xd478('0x77')](_0x23cb57[_0x2e9138[_0x53755f][_0xd478('0x76')]],'%s',_0x184d8b):_0x184d8b;_0x184d8b=_0x2e9138[_0x53755f][_0xd478('0x78')]?_[_0xd478('0x77')](_0x4efae6[_0x2e9138[_0x53755f][_0xd478('0x78')]],'%s',_0x184d8b):_0x184d8b;if(_0x2e9138[_0x53755f][_0xd478('0x79')]){_0x51e96a[_0xd478('0x69')](_0x184d8b);}_0x2e9138[_0x53755f]['orderBy']&&_0x51e96a[_0xd478('0x3a')](_0x184d8b,_0x2e9138[_0x53755f]['orderBy']===_0xd478('0x7b')?![]:!![]);_0x51e96a[_0xd478('0x6a')](_0x184d8b,_0x2e9138[_0x53755f][_0xd478('0x7c')]||_0x184d8b);}if(_0x288429[_0xd478('0x7d')]){_0x288429[_0xd478('0x7d')]=JSON['parse'](_0x288429[_0xd478('0x7d')]);for(var _0x2798ed=0x0;_0x2798ed<_0x288429['joins'][_0xd478('0x48')];_0x2798ed+=0x1){if(_0x288429['joins'][_0x2798ed]['type']&&_['includes'](_0x23315c,_0x288429['joins'][_0x2798ed]['type'])&&_0x288429['joins'][_0x2798ed][_0xd478('0x80')]&&_0x288429[_0xd478('0x7d')][_0x2798ed][_0xd478('0x81')]&&_0x288429['joins'][_0x2798ed][_0xd478('0x82')]){_0x51e96a[_0x288429['joins'][_0x2798ed][_0xd478('0x7e')]](_0x288429[_0xd478('0x7d')][_0x2798ed][_0xd478('0x81')],null,util[_0xd478('0x78')](_0xd478('0x8e'),_0x288429[_0xd478('0x7f')],_0x288429[_0xd478('0x7d')][_0x2798ed]['parentKey'],_0x288429[_0xd478('0x7d')][_0x2798ed][_0xd478('0x81')],_0x288429[_0xd478('0x7d')][_0x2798ed][_0xd478('0x82')]));}}}if(_0x288429[_0xd478('0x83')]){_0x288429['conditions']=JSON[_0xd478('0x84')](_0x288429[_0xd478('0x83')]);_0x51e96a['where'](_0x52b669(_0x288429[_0xd478('0x83')]['group']));}_0x49b823=_0x51e96a[_0xd478('0x8f')]();_0x51e96a[_0xd478('0x1f')](_0x212002);_0x51e96a['offset'](0x0);return;}})['then'](function(){if(_0x3f6e07[_0xd478('0x90')]===_0xd478('0x91')){return null;}var _0x3de3ec=_['merge'](_0x3f6e07,{'name':_0x3f6e07[_0xd478('0x92')]||_0x3f6e07[_0xd478('0x2c')]||_0x288429['name'],'basename':_0x1adce9,'savename':util[_0xd478('0x78')](_0xd478('0x93'),_0x3f6e07[_0xd478('0x2c')]||_0x288429['name'],require(_0xd478('0x94'))['generate'](0x4),_0x3f6e07[_0xd478('0x90')]||_0xd478('0x95')),'reportId':_0x288429['id'],'reportType':_0xd478('0x96')});return db['AnalyticExtractedReport'][_0xd478('0x4a')](_0x3de3ec,{'raw':!![]});})[_0xd478('0x27')](function(_0x259133){if(_0x288429[_0xd478('0x7f')]===_0xd478('0x97')){_0x49b823[_0xd478('0x3c')](_0x288429[_0xd478('0x7f')]+_0xd478('0x98'),_0x3f6e07[_0xd478('0x99')],_0x3f6e07[_0xd478('0x9a')]);}else{_0x49b823[_0xd478('0x3c')](_0x288429[_0xd478('0x7f')]+_0xd478('0x9b'),_0x3f6e07[_0xd478('0x99')],_0x3f6e07[_0xd478('0x9a')]);}if(_0x259133){logger[_0xd478('0x9c')](_0xd478('0x9d'),_0x49b823['toString']());require(_0xd478('0x9e'))[_0xd478('0x9f')](path[_0xd478('0x54')](__dirname,_0xd478('0xa0'),_0x259133[_0xd478('0x90')]),[_0x259133['id'],_0x49b823[_0xd478('0x86')](),path[_0xd478('0x54')](__dirname,_0xd478('0xa1'),_0x259133[_0xd478('0xa2')]),_0x1adce9]);return _0x259133;}else{var _0x26aa4a=squel[_0xd478('0x72')]();_0x26aa4a[_0xd478('0x73')]('('+_0x49b823[_0xd478('0x86')]()+')',_0xd478('0xa3'));_0x26aa4a[_0xd478('0x6a')](_0xd478('0xa4'),_0xd478('0x20'));_0x49b823[_0xd478('0x1f')](_0x3f6e07[_0xd478('0x1f')]||_0x212002);_0x49b823['offset'](_0x3f6e07[_0xd478('0x1d')]||0x0);return dbH[_0xd478('0x87')]['query'](_0x26aa4a[_0xd478('0x86')](),{'type':dbH[_0xd478('0x87')][_0xd478('0xa5')][_0xd478('0x88')]})[_0xd478('0x27')](function(_0x356d24){if(!_0x356d24[_0xd478('0x48')]){_0x2958ba=0x0;}else{_0x2958ba=_0x356d24[0x0][_0xd478('0x20')]||0x0;}return dbH['sequelize'][_0xd478('0x33')](_0x49b823[_0xd478('0x86')](),{'type':dbH[_0xd478('0x87')][_0xd478('0xa5')]['SELECT']});})[_0xd478('0x27')](function(_0x4f93ae){return{'rows':_0x4f93ae||[],'count':_0x2958ba};});}});}exports[_0xd478('0xa6')]=function(_0x14b003,_0x19aca1){return runReport(_0x14b003[_0xd478('0x47')],_0x14b003['query'],_0x14b003['options'])['then'](respondWithResult(_0x19aca1,null))['catch'](handleError(_0x19aca1,null));};exports[_0xd478('0xa7')]=runReport;exports['query']=function(_0x3bb8ac,_0x23165f){var _0x5469f3=0xa;var _0x4ca728=[_0xd478('0x54'),_0xd478('0x55'),'right_join',_0xd478('0x57')];var _0x563f78={'SUM':_0xd478('0x89'),'COUNT':_0xd478('0x58'),'COUNT DISTINCT':_0xd478('0x59'),'MAX':_0xd478('0x5a'),'MIN':_0xd478('0x5b'),'AVG':_0xd478('0x8a'),'GROUP_CONCAT':_0xd478('0x5c'),'GROUP_CONCAT ASC':_0xd478('0x5d'),'GROUP_CONCAT DESC':_0xd478('0x8b')};var _0x4513a5={'SEC_TO_TIME':_0xd478('0x5e'),'DATE':_0xd478('0x5f'),'HOUR':'HOUR(%s)','ROUND':_0xd478('0x61'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x1303cb=function(_0x26bef3){return!_[_0xd478('0x63')]([_0xd478('0x64'),_0xd478('0x8c'),'IS\x20EMPTY',_0xd478('0x66')],_0x26bef3);};var _0x1d6392=function(_0x5fdd2f){if(!_0x5fdd2f||!_0x5fdd2f[_0xd478('0x67')][_0xd478('0x48')]){return'';}for(var _0x32de35='(',_0xda5577=0x0;_0xda5577<_0x5fdd2f[_0xd478('0x67')][_0xd478('0x48')];_0xda5577+=0x1){_0xda5577>0x0&&(_0x32de35+='\x20'+_0x5fdd2f[_0xd478('0x68')]+'\x20');_0x32de35+=_0x5fdd2f[_0xd478('0x67')][_0xda5577][_0xd478('0x69')]?_0x1d6392(_0x5fdd2f[_0xd478('0x67')][_0xda5577][_0xd478('0x69')]):_0x5fdd2f[_0xd478('0x67')][_0xda5577][_0xd478('0x6a')]+'\x20'+_0x5fdd2f[_0xd478('0x67')][_0xda5577][_0xd478('0x6b')]+(_0x1303cb(_0x5fdd2f[_0xd478('0x67')][_0xda5577]['condition'])?'\x20'+_0x5fdd2f[_0xd478('0x67')][_0xda5577]['value']:'');}return _0x32de35+')';};var _0x43be1b={'where':{'id':_0x3bb8ac[_0xd478('0x47')]['id']}},_0x50929e,_0x1a666d,_0xd2c6d0,_0x92d0e1,_0x1e877c;_0x43be1b=_[_0xd478('0x3f')]({},_0x43be1b,_0x3bb8ac[_0xd478('0x41')]);return db[_0xd478('0x2e')][_0xd478('0x49')](_0x43be1b)[_0xd478('0x27')](function(_0x47a256){if(_0x47a256){_0x50929e=_0x47a256;return _0x47a256['getFields']();}return null;})[_0xd478('0x27')](function(_0x4459a7){if(_0x4459a7){if(!_0x4459a7[_0xd478('0x48')]){throw new db['Sequelize']['ValidationErrorItem'](_0xd478('0x6f'),0x193);}_0x1a666d=_0x4459a7;return db['AnalyticMetric'][_0xd478('0x44')]({'raw':!![]});}return null;})[_0xd478('0x27')](function(_0x3a071d){if(_0x3a071d){_0xd2c6d0=_[_0xd478('0x71')](_0x3a071d,'id');var _0x17255e;var _0x34413c=squel['select']();_0x34413c['from'](_0x50929e[_0xd478('0x7f')]);for(var _0x2f742c=0x0;_0x2f742c<_0x1a666d[_0xd478('0x48')];_0x2f742c+=0x1){_0x17255e=_0x1a666d[_0x2f742c]['MetricId']?_0xd2c6d0[_0x1a666d[_0x2f742c][_0xd478('0x74')]][_0xd478('0x75')]:_0x1a666d[_0x2f742c]['field'];_0x17255e=_0x1a666d[_0x2f742c][_0xd478('0x76')]?_[_0xd478('0x77')](_0x563f78[_0x1a666d[_0x2f742c]['function']],'%s',_0x17255e):_0x17255e;_0x17255e=_0x1a666d[_0x2f742c][_0xd478('0x78')]?_[_0xd478('0x77')](_0x4513a5[_0x1a666d[_0x2f742c][_0xd478('0x78')]],'%s',_0x17255e):_0x17255e;if(_0x1a666d[_0x2f742c][_0xd478('0x79')]){_0x34413c[_0xd478('0x69')](_0x17255e);}_0x1a666d[_0x2f742c]['orderBy']&&_0x34413c[_0xd478('0x3a')](_0x17255e,_0x1a666d[_0x2f742c][_0xd478('0x7a')]===_0xd478('0x7b')?![]:!![]);_0x34413c['field'](_0x17255e,_0x1a666d[_0x2f742c][_0xd478('0x7c')]||_0x17255e);}if(_0x50929e[_0xd478('0x7d')]){_0x50929e['joins']=JSON['parse'](_0x50929e[_0xd478('0x7d')]);for(var _0x27ca0b=0x0;_0x27ca0b<_0x50929e[_0xd478('0x7d')][_0xd478('0x48')];_0x27ca0b+=0x1){if(_0x50929e[_0xd478('0x7d')][_0x27ca0b][_0xd478('0x7e')]&&_[_0xd478('0x63')](_0x4ca728,_0x50929e[_0xd478('0x7d')][_0x27ca0b][_0xd478('0x7e')])&&_0x50929e[_0xd478('0x7d')][_0x27ca0b][_0xd478('0x80')]&&_0x50929e[_0xd478('0x7d')][_0x27ca0b][_0xd478('0x81')]&&_0x50929e['joins'][_0x27ca0b][_0xd478('0x82')]){_0x34413c[_0x50929e[_0xd478('0x7d')][_0x27ca0b][_0xd478('0x7e')]](_0x50929e[_0xd478('0x7d')][_0x27ca0b][_0xd478('0x81')],null,util['format'](_0xd478('0x8e'),_0x50929e[_0xd478('0x7f')],_0x50929e[_0xd478('0x7d')][_0x27ca0b][_0xd478('0x80')],_0x50929e[_0xd478('0x7d')][_0x27ca0b][_0xd478('0x81')],_0x50929e[_0xd478('0x7d')][_0x27ca0b][_0xd478('0x82')]));}}}if(_0x50929e[_0xd478('0x83')]){_0x50929e[_0xd478('0x83')]=JSON[_0xd478('0x84')](_0x50929e['conditions']);_0x34413c[_0xd478('0x3c')](_0x1d6392(_0x50929e[_0xd478('0x83')][_0xd478('0x69')]));}_0x1e877c=_0x34413c[_0xd478('0x8f')]();_0x34413c['limit'](_0x5469f3);_0x34413c[_0xd478('0x1d')](0x0);logger[_0xd478('0xa8')](_0xd478('0x85'),_0x34413c['toString']());return dbH[_0xd478('0x87')][_0xd478('0x33')](_0x34413c[_0xd478('0x86')](),{'type':dbH[_0xd478('0x87')][_0xd478('0xa5')]['SELECT']});}})[_0xd478('0x27')](function(){return{'sql':_0x1e877c[_0xd478('0x86')]()};})[_0xd478('0x27')](respondWithResult(_0x23165f,null))[_0xd478('0x46')](handleError(_0x23165f,null));}; \ No newline at end of file +var _0x6a92=['COUNT(%s)','MIN(%s)','ValidationErrorItem','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','sox','to-csv','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','dbH','sendStatus','status','end','offset','undefined','limit','set','Content-Range','json','apply','reject','save','update','then','destroy','get','CustomReports','UserProfileResource','stack','name','index','map','AnalyticCustomReport','rawAttributes','fieldName','type','key','model','query','keys','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','count','includeAll','include','findAll','rows','catch','show','params','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','Reports','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','left_join','right_join','cross_join','SUM(%s)','COUNT(DISTINCT\x20%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','length','operator','group','field','condition','value','getFields','Sequelize','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','table','metric','replace','function','format','groupBy','orderBy','DESC','alias','joins','parse','includes','parentKey','foreignTable','foreignKey','conditions','debug','Limited\x20Query:','toString','sequelize','QueryTypes','join','MAX(%s)','SEC_TO_TIME(%s)','IS\x20NULL','from','MetricId','%s.%s\x20=\x20%s.%s','clone','output','web','fullPath','generate','csv','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','countTable','COUNT(*)','SELECT','run'];(function(_0x98b4,_0x5dbc5a){var _0x10f069=function(_0x2e3cfd){while(--_0x2e3cfd){_0x98b4['push'](_0x98b4['shift']());}};_0x10f069(++_0x5dbc5a);}(_0x6a92,0x14b));var _0x26a9=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x6a92[_0x59ee6f];return _0x4c0979;};'use strict';var emlformat=require(_0x26a9('0x0'));var rimraf=require(_0x26a9('0x1'));var zipdir=require(_0x26a9('0x2'));var jsonpatch=require(_0x26a9('0x3'));var rp=require(_0x26a9('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x26a9('0x5'));var csv=require(_0x26a9('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x26a9('0x7'));var jsforce=require(_0x26a9('0x8'));var deskjs=require(_0x26a9('0x9'));var toCsv=require(_0x26a9('0x6'));var querystring=require(_0x26a9('0xa'));var Papa=require(_0x26a9('0xb'));var Redis=require(_0x26a9('0xc'));var authService=require('../../components/auth/service');var qs=require(_0x26a9('0xd'));var as=require(_0x26a9('0xe'));var hardwareService=require(_0x26a9('0xf'));var logger=require(_0x26a9('0x10'))('api');var utils=require('../../config/utils');var config=require(_0x26a9('0x11'));var licenseUtil=require(_0x26a9('0x12'));var db=require(_0x26a9('0x13'))['db'];var dbH=require(_0x26a9('0x13'))[_0x26a9('0x14')];function respondWithStatusCode(_0x2a5004,_0x1ed7a3){_0x1ed7a3=_0x1ed7a3||0xcc;return function(_0x2184e3){if(_0x2184e3){return _0x2a5004[_0x26a9('0x15')](_0x1ed7a3);}return _0x2a5004[_0x26a9('0x16')](_0x1ed7a3)[_0x26a9('0x17')]();};}function respondWithResult(_0x258843,_0x2623ad){_0x2623ad=_0x2623ad||0xc8;return function(_0x20fb05){if(_0x20fb05){return _0x258843[_0x26a9('0x16')](_0x2623ad)['json'](_0x20fb05);}};}function respondWithFilteredResult(_0x46a255,_0x1ea87b){return function(_0x5d0bca){if(_0x5d0bca){var _0x52e2fe=typeof _0x1ea87b[_0x26a9('0x18')]===_0x26a9('0x19')&&typeof _0x1ea87b[_0x26a9('0x1a')]===_0x26a9('0x19');var _0x3e34b4=_0x5d0bca['count'];var _0x199f11=_0x52e2fe?0x0:_0x1ea87b['offset'];var _0x2ecac9=_0x52e2fe?_0x5d0bca['count']:_0x1ea87b['offset']+_0x1ea87b[_0x26a9('0x1a')];var _0x16e64a;if(_0x2ecac9>=_0x3e34b4){_0x2ecac9=_0x3e34b4;_0x16e64a=0xc8;}else{_0x16e64a=0xce;}_0x46a255[_0x26a9('0x16')](_0x16e64a);return _0x46a255[_0x26a9('0x1b')](_0x26a9('0x1c'),_0x199f11+'-'+_0x2ecac9+'/'+_0x3e34b4)[_0x26a9('0x1d')](_0x5d0bca);}return null;};}function patchUpdates(_0x268fa4){return function(_0x5c3e9c){try{jsonpatch[_0x26a9('0x1e')](_0x5c3e9c,_0x268fa4,!![]);}catch(_0x39ea38){return BPromise[_0x26a9('0x1f')](_0x39ea38);}return _0x5c3e9c[_0x26a9('0x20')]();};}function saveUpdates(_0x3ee43f,_0x1964be){return function(_0x4917b7){if(_0x4917b7){return _0x4917b7[_0x26a9('0x21')](_0x3ee43f)[_0x26a9('0x22')](function(_0x433939){return _0x433939;});}return null;};}function removeEntity(_0x2effcf,_0x4e487f){return function(_0x5425dd){if(_0x5425dd){return _0x5425dd[_0x26a9('0x23')]()[_0x26a9('0x22')](function(){var _0x3a1d7a=_0x5425dd[_0x26a9('0x24')]({'plain':!![]});var _0x46f312=_0x26a9('0x25');return db[_0x26a9('0x26')][_0x26a9('0x23')]({'where':{'type':_0x46f312,'resourceId':_0x3a1d7a['id']}})['then'](function(){return _0x5425dd;});})[_0x26a9('0x22')](function(){_0x2effcf[_0x26a9('0x16')](0xcc)[_0x26a9('0x17')]();});}};}function handleEntityNotFound(_0x82b0b2,_0x3d8e60){return function(_0x45c67f){if(!_0x45c67f){_0x82b0b2[_0x26a9('0x15')](0x194);}return _0x45c67f;};}function handleError(_0x3aaac4,_0x35fdbf){_0x35fdbf=_0x35fdbf||0x1f4;return function(_0x201435){logger['error'](_0x201435[_0x26a9('0x27')]);if(_0x201435[_0x26a9('0x28')]){delete _0x201435[_0x26a9('0x28')];}_0x3aaac4[_0x26a9('0x16')](_0x35fdbf)['send'](_0x201435);};}exports[_0x26a9('0x29')]=function(_0x698200,_0xc00a9e){var _0x321666={},_0x48a052={},_0x23edcb={'count':0x0,'rows':[]};var _0x46944a=_[_0x26a9('0x2a')](db[_0x26a9('0x2b')][_0x26a9('0x2c')],function(_0x37fc46){return{'name':_0x37fc46[_0x26a9('0x2d')],'type':_0x37fc46[_0x26a9('0x2e')][_0x26a9('0x2f')]};});_0x48a052[_0x26a9('0x30')]=_[_0x26a9('0x2a')](_0x46944a,_0x26a9('0x28'));_0x48a052[_0x26a9('0x31')]=_[_0x26a9('0x32')](_0x698200[_0x26a9('0x31')]);_0x48a052['filters']=_['intersection'](_0x48a052[_0x26a9('0x30')],_0x48a052[_0x26a9('0x31')]);_0x321666[_0x26a9('0x33')]=_[_0x26a9('0x34')](_0x48a052[_0x26a9('0x30')],qs['fields'](_0x698200[_0x26a9('0x31')][_0x26a9('0x35')]));_0x321666['attributes']=_0x321666[_0x26a9('0x33')]['length']?_0x321666[_0x26a9('0x33')]:_0x48a052[_0x26a9('0x30')];if(!_0x698200[_0x26a9('0x31')][_0x26a9('0x36')](_0x26a9('0x37'))){_0x321666[_0x26a9('0x1a')]=qs[_0x26a9('0x1a')](_0x698200[_0x26a9('0x31')][_0x26a9('0x1a')]);_0x321666[_0x26a9('0x18')]=qs[_0x26a9('0x18')](_0x698200[_0x26a9('0x31')][_0x26a9('0x18')]);}_0x321666[_0x26a9('0x38')]=qs[_0x26a9('0x39')](_0x698200['query']['sort']);_0x321666[_0x26a9('0x3a')]=qs[_0x26a9('0x3b')](_[_0x26a9('0x3c')](_0x698200[_0x26a9('0x31')],_0x48a052['filters']),_0x46944a);if(_0x698200[_0x26a9('0x31')][_0x26a9('0x3d')]){_0x321666[_0x26a9('0x3a')]=_[_0x26a9('0x3e')](_0x321666[_0x26a9('0x3a')],{'$or':_['map'](_0x46944a,function(_0x58aabd){if(_0x58aabd[_0x26a9('0x2e')]!==_0x26a9('0x3f')){var _0x3b76ff={};_0x3b76ff[_0x58aabd[_0x26a9('0x28')]]={'$like':'%'+_0x698200[_0x26a9('0x31')][_0x26a9('0x3d')]+'%'};return _0x3b76ff;}})});}_0x321666=_[_0x26a9('0x3e')]({},_0x321666,_0x698200[_0x26a9('0x40')]);var _0x57c2eb={'where':_0x321666[_0x26a9('0x3a')]};return db[_0x26a9('0x2b')]['count'](_0x57c2eb)[_0x26a9('0x22')](function(_0x292510){_0x23edcb[_0x26a9('0x41')]=_0x292510;if(_0x698200[_0x26a9('0x31')][_0x26a9('0x42')]){_0x321666[_0x26a9('0x43')]=[{'all':!![]}];}return db['AnalyticCustomReport'][_0x26a9('0x44')](_0x321666);})[_0x26a9('0x22')](function(_0x7610fa){_0x23edcb[_0x26a9('0x45')]=_0x7610fa;return _0x23edcb;})[_0x26a9('0x22')](respondWithFilteredResult(_0xc00a9e,_0x321666))[_0x26a9('0x46')](handleError(_0xc00a9e,null));};exports[_0x26a9('0x47')]=function(_0x371233,_0x1250c5){var _0x43f056={'raw':![],'where':{'id':_0x371233[_0x26a9('0x48')]['id']}},_0x1fddae={};_0x1fddae[_0x26a9('0x30')]=_[_0x26a9('0x32')](db[_0x26a9('0x2b')]['rawAttributes']);_0x1fddae[_0x26a9('0x31')]=_[_0x26a9('0x32')](_0x371233[_0x26a9('0x31')]);_0x1fddae['filters']=_['intersection'](_0x1fddae['model'],_0x1fddae[_0x26a9('0x31')]);_0x43f056[_0x26a9('0x33')]=_[_0x26a9('0x34')](_0x1fddae[_0x26a9('0x30')],qs[_0x26a9('0x35')](_0x371233[_0x26a9('0x31')]['fields']));_0x43f056[_0x26a9('0x33')]=_0x43f056[_0x26a9('0x33')]['length']?_0x43f056[_0x26a9('0x33')]:_0x1fddae[_0x26a9('0x30')];if(_0x371233[_0x26a9('0x31')][_0x26a9('0x42')]){_0x43f056[_0x26a9('0x43')]=[{'all':!![]}];}_0x43f056=_['merge']({},_0x43f056,_0x371233[_0x26a9('0x40')]);return db[_0x26a9('0x2b')]['find'](_0x43f056)[_0x26a9('0x22')](handleEntityNotFound(_0x1250c5,null))[_0x26a9('0x22')](respondWithResult(_0x1250c5,null))[_0x26a9('0x46')](handleError(_0x1250c5,null));};exports[_0x26a9('0x49')]=function(_0x3ea356,_0x2b1cce){return db['AnalyticCustomReport'][_0x26a9('0x49')](_0x3ea356['body'],{})[_0x26a9('0x22')](function(_0x1676cf){var _0x286618=_0x3ea356['user'][_0x26a9('0x24')]({'plain':!![]});if(!_0x286618)throw new Error(_0x26a9('0x4a'));if(_0x286618['role']===_0x26a9('0x4b')){var _0x503847=_0x1676cf[_0x26a9('0x24')]({'plain':!![]});var _0x5ca244=_0x26a9('0x4c');return db[_0x26a9('0x4d')][_0x26a9('0x4e')]({'where':{'name':_0x5ca244,'userProfileId':_0x286618[_0x26a9('0x4f')]},'raw':!![]})[_0x26a9('0x22')](function(_0xd368b4){if(_0xd368b4&&_0xd368b4[_0x26a9('0x50')]===0x0){return db[_0x26a9('0x26')][_0x26a9('0x49')]({'name':_0x503847[_0x26a9('0x28')],'resourceId':_0x503847['id'],'type':'CustomReports','sectionId':_0xd368b4['id']},{})['then'](function(){return _0x1676cf;});}else{return _0x1676cf;}})['catch'](function(_0x2f1e47){logger['error'](_0x26a9('0x51'),_0x2f1e47);throw _0x2f1e47;});}return _0x1676cf;})[_0x26a9('0x22')](respondWithResult(_0x2b1cce,0xc9))['catch'](handleError(_0x2b1cce,null));};exports['update']=function(_0x285617,_0x20246a){if(_0x285617[_0x26a9('0x52')]['id']){delete _0x285617[_0x26a9('0x52')]['id'];}return db[_0x26a9('0x2b')]['find']({'where':{'id':_0x285617[_0x26a9('0x48')]['id']}})[_0x26a9('0x22')](handleEntityNotFound(_0x20246a,null))[_0x26a9('0x22')](saveUpdates(_0x285617[_0x26a9('0x52')],null))['then'](respondWithResult(_0x20246a,null))[_0x26a9('0x46')](handleError(_0x20246a,null));};exports[_0x26a9('0x23')]=function(_0x5963a4,_0x121f16){return db[_0x26a9('0x2b')][_0x26a9('0x4e')]({'where':{'id':_0x5963a4[_0x26a9('0x48')]['id']}})[_0x26a9('0x22')](handleEntityNotFound(_0x121f16,null))['then'](removeEntity(_0x121f16,null))[_0x26a9('0x46')](handleError(_0x121f16,null));};exports['preview']=function(_0x5c9c41,_0x4dec9d){var _0x2e9cb2=0xa;var _0x59dd16=['join',_0x26a9('0x53'),_0x26a9('0x54'),_0x26a9('0x55')];var _0x753316={'SUM':_0x26a9('0x56'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x26a9('0x57'),'MAX':'MAX(%s)','MIN':'MIN(%s)','AVG':_0x26a9('0x58'),'GROUP_CONCAT':_0x26a9('0x59'),'GROUP_CONCAT ASC':_0x26a9('0x5a'),'GROUP_CONCAT DESC':_0x26a9('0x5b')};var _0x54722a={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x26a9('0x5c'),'HOUR':_0x26a9('0x5d'),'ROUND':_0x26a9('0x5e'),'UNIX_TIMESTAMP':_0x26a9('0x5f')};var _0x5e9c17=function(_0x5e4ccf){return!_['includes'](['IS\x20NULL',_0x26a9('0x60'),_0x26a9('0x61'),_0x26a9('0x62')],_0x5e4ccf);};var _0x381291=function(_0x19094c){if(!_0x19094c||!_0x19094c[_0x26a9('0x63')][_0x26a9('0x64')]){return'';}for(var _0x2ef2f6='(',_0x37f894=0x0;_0x37f894<_0x19094c[_0x26a9('0x63')][_0x26a9('0x64')];_0x37f894+=0x1){_0x37f894>0x0&&(_0x2ef2f6+='\x20'+_0x19094c[_0x26a9('0x65')]+'\x20');_0x2ef2f6+=_0x19094c[_0x26a9('0x63')][_0x37f894][_0x26a9('0x66')]?_0x381291(_0x19094c[_0x26a9('0x63')][_0x37f894][_0x26a9('0x66')]):_0x19094c[_0x26a9('0x63')][_0x37f894][_0x26a9('0x67')]+'\x20'+_0x19094c[_0x26a9('0x63')][_0x37f894]['condition']+(_0x5e9c17(_0x19094c['rules'][_0x37f894][_0x26a9('0x68')])?'\x20'+_0x19094c[_0x26a9('0x63')][_0x37f894][_0x26a9('0x69')]:'');}return _0x2ef2f6+')';};var _0x429b41={'where':{'id':_0x5c9c41[_0x26a9('0x48')]['id']}},_0x4b94e3,_0x3dca39,_0x23e853,_0x37cc05,_0x858f5e;_0x429b41=_[_0x26a9('0x3e')]({},_0x429b41,_0x5c9c41[_0x26a9('0x40')]);return db['AnalyticCustomReport']['find'](_0x429b41)['then'](function(_0x6122a4){if(_0x6122a4){_0x4b94e3=_0x6122a4;return _0x6122a4[_0x26a9('0x6a')]();}return null;})[_0x26a9('0x22')](function(_0x2760b6){if(_0x2760b6){if(!_0x2760b6[_0x26a9('0x64')]){throw new db[(_0x26a9('0x6b'))]['ValidationErrorItem'](_0x26a9('0x6c'),0x193);}_0x3dca39=_0x2760b6;return db[_0x26a9('0x6d')][_0x26a9('0x44')]({'raw':!![]});}return null;})['then'](function(_0x1b3624){if(_0x1b3624){_0x23e853=_[_0x26a9('0x6e')](_0x1b3624,'id');var _0xfe2e80;var _0x4c73a8=squel[_0x26a9('0x6f')]();_0x4c73a8['from'](_0x4b94e3[_0x26a9('0x70')]);for(var _0x2f3353=0x0;_0x2f3353<_0x3dca39[_0x26a9('0x64')];_0x2f3353+=0x1){_0xfe2e80=_0x3dca39[_0x2f3353]['MetricId']?_0x23e853[_0x3dca39[_0x2f3353]['MetricId']][_0x26a9('0x71')]:_0x3dca39[_0x2f3353][_0x26a9('0x67')];_0xfe2e80=_0x3dca39[_0x2f3353]['function']?_[_0x26a9('0x72')](_0x753316[_0x3dca39[_0x2f3353][_0x26a9('0x73')]],'%s',_0xfe2e80):_0xfe2e80;_0xfe2e80=_0x3dca39[_0x2f3353][_0x26a9('0x74')]?_[_0x26a9('0x72')](_0x54722a[_0x3dca39[_0x2f3353]['format']],'%s',_0xfe2e80):_0xfe2e80;if(_0x3dca39[_0x2f3353][_0x26a9('0x75')]){_0x4c73a8[_0x26a9('0x66')](_0xfe2e80);}_0x3dca39[_0x2f3353][_0x26a9('0x76')]&&_0x4c73a8['order'](_0xfe2e80,_0x3dca39[_0x2f3353][_0x26a9('0x76')]===_0x26a9('0x77')?![]:!![]);_0x4c73a8['field'](_0xfe2e80,_0x3dca39[_0x2f3353][_0x26a9('0x78')]||_0xfe2e80);}if(_0x4b94e3['joins']){_0x4b94e3[_0x26a9('0x79')]=JSON[_0x26a9('0x7a')](_0x4b94e3['joins']);for(var _0x22cbad=0x0;_0x22cbad<_0x4b94e3['joins'][_0x26a9('0x64')];_0x22cbad+=0x1){if(_0x4b94e3[_0x26a9('0x79')][_0x22cbad][_0x26a9('0x2e')]&&_[_0x26a9('0x7b')](_0x59dd16,_0x4b94e3['joins'][_0x22cbad][_0x26a9('0x2e')])&&_0x4b94e3['joins'][_0x22cbad][_0x26a9('0x7c')]&&_0x4b94e3['joins'][_0x22cbad][_0x26a9('0x7d')]&&_0x4b94e3['joins'][_0x22cbad]['foreignKey']){_0x4c73a8[_0x4b94e3[_0x26a9('0x79')][_0x22cbad]['type']](_0x4b94e3['joins'][_0x22cbad][_0x26a9('0x7d')],null,util[_0x26a9('0x74')]('%s.%s\x20=\x20%s.%s',_0x4b94e3[_0x26a9('0x70')],_0x4b94e3[_0x26a9('0x79')][_0x22cbad][_0x26a9('0x7c')],_0x4b94e3['joins'][_0x22cbad][_0x26a9('0x7d')],_0x4b94e3[_0x26a9('0x79')][_0x22cbad][_0x26a9('0x7e')]));}}}if(_0x4b94e3['conditions']){_0x4b94e3[_0x26a9('0x7f')]=JSON['parse'](_0x4b94e3[_0x26a9('0x7f')]);_0x4c73a8[_0x26a9('0x3a')](_0x381291(_0x4b94e3[_0x26a9('0x7f')][_0x26a9('0x66')]));}_0x858f5e=_0x4c73a8['clone']();_0x4c73a8['limit'](_0x2e9cb2);_0x4c73a8[_0x26a9('0x18')](0x0);logger[_0x26a9('0x80')](_0x26a9('0x81'),_0x4c73a8[_0x26a9('0x82')]());return dbH[_0x26a9('0x83')][_0x26a9('0x31')](_0x4c73a8[_0x26a9('0x82')](),{'type':dbH[_0x26a9('0x83')][_0x26a9('0x84')]['SELECT']});}})[_0x26a9('0x22')](respondWithResult(_0x4dec9d,null))[_0x26a9('0x46')](handleError(_0x4dec9d,null));};function runReport(_0x4b43e7,_0x2fc029,_0x45b579){var _0x31307b=_0x2fc029[_0x26a9('0x28')];var _0x14efb0=0xa;var _0x1f4578=[_0x26a9('0x85'),_0x26a9('0x53'),_0x26a9('0x54'),'cross_join'];var _0xee8dbb={'SUM':_0x26a9('0x56'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x26a9('0x57'),'MAX':_0x26a9('0x86'),'MIN':'MIN(%s)','AVG':_0x26a9('0x58'),'GROUP_CONCAT':_0x26a9('0x59'),'GROUP_CONCAT ASC':_0x26a9('0x5a'),'GROUP_CONCAT DESC':_0x26a9('0x5b')};var _0x182730={'SEC_TO_TIME':_0x26a9('0x87'),'DATE':_0x26a9('0x5c'),'HOUR':_0x26a9('0x5d'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x26a9('0x5f')};var _0x5754b3=function(_0x272e22){return!_[_0x26a9('0x7b')]([_0x26a9('0x88'),_0x26a9('0x60'),'IS\x20EMPTY',_0x26a9('0x62')],_0x272e22);};var _0x438016=function(_0x3d31d5){if(!_0x3d31d5||!_0x3d31d5[_0x26a9('0x63')][_0x26a9('0x64')]){return'';}for(var _0x7127ba='(',_0x264104=0x0;_0x264104<_0x3d31d5[_0x26a9('0x63')][_0x26a9('0x64')];_0x264104+=0x1){_0x264104>0x0&&(_0x7127ba+='\x20'+_0x3d31d5[_0x26a9('0x65')]+'\x20');_0x7127ba+=_0x3d31d5[_0x26a9('0x63')][_0x264104]['group']?_0x438016(_0x3d31d5[_0x26a9('0x63')][_0x264104]['group']):_0x3d31d5['rules'][_0x264104]['field']+'\x20'+_0x3d31d5[_0x26a9('0x63')][_0x264104]['condition']+(_0x5754b3(_0x3d31d5[_0x26a9('0x63')][_0x264104][_0x26a9('0x68')])?'\x20'+_0x3d31d5['rules'][_0x264104][_0x26a9('0x69')]:'');}return _0x7127ba+')';};var _0x3db52d={'where':{'id':_0x4b43e7['id']}},_0x4ba431,_0x2fd1b8,_0x5d1889,_0x52dcaa,_0x323253;_0x3db52d=_[_0x26a9('0x3e')]({},_0x3db52d,_0x45b579);return db[_0x26a9('0x2b')][_0x26a9('0x4e')](_0x3db52d)[_0x26a9('0x22')](function(_0x4edf55){if(_0x4edf55){_0x4ba431=_0x4edf55;return _0x4edf55[_0x26a9('0x6a')]();}return null;})[_0x26a9('0x22')](function(_0x1a30c7){if(_0x1a30c7){if(!_0x1a30c7['length']){throw new db[(_0x26a9('0x6b'))]['ValidationErrorItem'](_0x26a9('0x6c'),0x193);}_0x2fd1b8=_0x1a30c7;return db[_0x26a9('0x6d')]['findAll']({'raw':!![]});}return null;})[_0x26a9('0x22')](function(_0x5204bf){if(_0x5204bf){_0x5d1889=_[_0x26a9('0x6e')](_0x5204bf,'id');var _0x56d1fc;var _0xb52cd2=squel[_0x26a9('0x6f')]();_0xb52cd2[_0x26a9('0x89')](_0x4ba431[_0x26a9('0x70')]);for(var _0x3160db=0x0;_0x3160db<_0x2fd1b8['length'];_0x3160db+=0x1){_0x56d1fc=_0x2fd1b8[_0x3160db][_0x26a9('0x8a')]?_0x5d1889[_0x2fd1b8[_0x3160db]['MetricId']][_0x26a9('0x71')]:_0x2fd1b8[_0x3160db]['field'];_0x56d1fc=_0x2fd1b8[_0x3160db][_0x26a9('0x73')]?_[_0x26a9('0x72')](_0xee8dbb[_0x2fd1b8[_0x3160db][_0x26a9('0x73')]],'%s',_0x56d1fc):_0x56d1fc;_0x56d1fc=_0x2fd1b8[_0x3160db]['format']?_[_0x26a9('0x72')](_0x182730[_0x2fd1b8[_0x3160db][_0x26a9('0x74')]],'%s',_0x56d1fc):_0x56d1fc;if(_0x2fd1b8[_0x3160db][_0x26a9('0x75')]){_0xb52cd2[_0x26a9('0x66')](_0x56d1fc);}_0x2fd1b8[_0x3160db][_0x26a9('0x76')]&&_0xb52cd2[_0x26a9('0x38')](_0x56d1fc,_0x2fd1b8[_0x3160db][_0x26a9('0x76')]===_0x26a9('0x77')?![]:!![]);_0xb52cd2['field'](_0x56d1fc,_0x2fd1b8[_0x3160db]['alias']||_0x56d1fc);}if(_0x4ba431[_0x26a9('0x79')]){_0x4ba431[_0x26a9('0x79')]=JSON['parse'](_0x4ba431[_0x26a9('0x79')]);for(var _0xb7434c=0x0;_0xb7434c<_0x4ba431['joins'][_0x26a9('0x64')];_0xb7434c+=0x1){if(_0x4ba431[_0x26a9('0x79')][_0xb7434c][_0x26a9('0x2e')]&&_['includes'](_0x1f4578,_0x4ba431['joins'][_0xb7434c][_0x26a9('0x2e')])&&_0x4ba431[_0x26a9('0x79')][_0xb7434c]['parentKey']&&_0x4ba431[_0x26a9('0x79')][_0xb7434c][_0x26a9('0x7d')]&&_0x4ba431[_0x26a9('0x79')][_0xb7434c][_0x26a9('0x7e')]){_0xb52cd2[_0x4ba431['joins'][_0xb7434c]['type']](_0x4ba431[_0x26a9('0x79')][_0xb7434c][_0x26a9('0x7d')],null,util[_0x26a9('0x74')](_0x26a9('0x8b'),_0x4ba431[_0x26a9('0x70')],_0x4ba431['joins'][_0xb7434c]['parentKey'],_0x4ba431['joins'][_0xb7434c][_0x26a9('0x7d')],_0x4ba431['joins'][_0xb7434c][_0x26a9('0x7e')]));}}}if(_0x4ba431[_0x26a9('0x7f')]){_0x4ba431[_0x26a9('0x7f')]=JSON[_0x26a9('0x7a')](_0x4ba431[_0x26a9('0x7f')]);_0xb52cd2[_0x26a9('0x3a')](_0x438016(_0x4ba431[_0x26a9('0x7f')][_0x26a9('0x66')]));}_0x323253=_0xb52cd2[_0x26a9('0x8c')]();_0xb52cd2[_0x26a9('0x1a')](_0x14efb0);_0xb52cd2[_0x26a9('0x18')](0x0);return;}})['then'](function(){if(_0x2fc029[_0x26a9('0x8d')]===_0x26a9('0x8e')){return null;}var _0x14f1b1=_[_0x26a9('0x3e')](_0x2fc029,{'name':_0x2fc029[_0x26a9('0x8f')]||_0x2fc029['name']||_0x4ba431[_0x26a9('0x28')],'basename':_0x31307b,'savename':util['format']('%s-%s.%s',_0x2fc029['name']||_0x4ba431[_0x26a9('0x28')],require('randomstring')[_0x26a9('0x90')](0x4),_0x2fc029['output']||_0x26a9('0x91')),'reportId':_0x4ba431['id'],'reportType':'custom'});return db[_0x26a9('0x92')][_0x26a9('0x49')](_0x14f1b1,{'raw':!![]});})['then'](function(_0x3fba78){if(_0x4ba431['table']===_0x26a9('0x93')){_0x323253[_0x26a9('0x3a')](_0x4ba431[_0x26a9('0x70')]+_0x26a9('0x94'),_0x2fc029['startDate'],_0x2fc029[_0x26a9('0x95')]);}else{_0x323253['where'](_0x4ba431[_0x26a9('0x70')]+_0x26a9('0x96'),_0x2fc029['startDate'],_0x2fc029[_0x26a9('0x95')]);}if(_0x3fba78){logger[_0x26a9('0x97')](_0x26a9('0x98'),_0x323253[_0x26a9('0x82')]());require(_0x26a9('0x99'))[_0x26a9('0x9a')](path[_0x26a9('0x85')](__dirname,_0x26a9('0x9b'),_0x3fba78[_0x26a9('0x8d')]),[_0x3fba78['id'],_0x323253[_0x26a9('0x82')](),path[_0x26a9('0x85')](__dirname,_0x26a9('0x9c'),_0x3fba78['savename']),_0x31307b]);return _0x3fba78;}else{var _0x5d7592=squel[_0x26a9('0x6f')]();_0x5d7592[_0x26a9('0x89')]('('+_0x323253[_0x26a9('0x82')]()+')',_0x26a9('0x9d'));_0x5d7592[_0x26a9('0x67')](_0x26a9('0x9e'),_0x26a9('0x41'));_0x323253[_0x26a9('0x1a')](_0x2fc029[_0x26a9('0x1a')]||_0x14efb0);_0x323253[_0x26a9('0x18')](_0x2fc029[_0x26a9('0x18')]||0x0);return dbH[_0x26a9('0x83')][_0x26a9('0x31')](_0x5d7592[_0x26a9('0x82')](),{'type':dbH[_0x26a9('0x83')]['QueryTypes'][_0x26a9('0x9f')]})[_0x26a9('0x22')](function(_0x372a0f){if(!_0x372a0f[_0x26a9('0x64')]){_0x52dcaa=0x0;}else{_0x52dcaa=_0x372a0f[0x0][_0x26a9('0x41')]||0x0;}return dbH[_0x26a9('0x83')][_0x26a9('0x31')](_0x323253[_0x26a9('0x82')](),{'type':dbH[_0x26a9('0x83')]['QueryTypes'][_0x26a9('0x9f')]});})['then'](function(_0x1e3bf2){return{'rows':_0x1e3bf2||[],'count':_0x52dcaa};});}});}exports[_0x26a9('0xa0')]=function(_0x346d71,_0x2496c8){return runReport(_0x346d71[_0x26a9('0x48')],_0x346d71[_0x26a9('0x31')],_0x346d71[_0x26a9('0x40')])[_0x26a9('0x22')](respondWithResult(_0x2496c8,null))['catch'](handleError(_0x2496c8,null));};exports['runReport']=runReport;exports[_0x26a9('0x31')]=function(_0x5d811b,_0x1e8e93){var _0x3419d3=0xa;var _0xdc1efb=[_0x26a9('0x85'),_0x26a9('0x53'),'right_join',_0x26a9('0x55')];var _0x991b94={'SUM':_0x26a9('0x56'),'COUNT':_0x26a9('0xa1'),'COUNT DISTINCT':_0x26a9('0x57'),'MAX':_0x26a9('0x86'),'MIN':_0x26a9('0xa2'),'AVG':_0x26a9('0x58'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x26a9('0x5b')};var _0x28635c={'SEC_TO_TIME':_0x26a9('0x87'),'DATE':_0x26a9('0x5c'),'HOUR':'HOUR(%s)','ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x26a9('0x5f')};var _0x489a48=function(_0x39dd81){return!_[_0x26a9('0x7b')]([_0x26a9('0x88'),'IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY'],_0x39dd81);};var _0x1f3149=function(_0x1a9ad2){if(!_0x1a9ad2||!_0x1a9ad2[_0x26a9('0x63')][_0x26a9('0x64')]){return'';}for(var _0x5ab9e3='(',_0x3be049=0x0;_0x3be049<_0x1a9ad2['rules']['length'];_0x3be049+=0x1){_0x3be049>0x0&&(_0x5ab9e3+='\x20'+_0x1a9ad2['operator']+'\x20');_0x5ab9e3+=_0x1a9ad2[_0x26a9('0x63')][_0x3be049][_0x26a9('0x66')]?_0x1f3149(_0x1a9ad2[_0x26a9('0x63')][_0x3be049][_0x26a9('0x66')]):_0x1a9ad2[_0x26a9('0x63')][_0x3be049][_0x26a9('0x67')]+'\x20'+_0x1a9ad2[_0x26a9('0x63')][_0x3be049][_0x26a9('0x68')]+(_0x489a48(_0x1a9ad2[_0x26a9('0x63')][_0x3be049]['condition'])?'\x20'+_0x1a9ad2[_0x26a9('0x63')][_0x3be049]['value']:'');}return _0x5ab9e3+')';};var _0x35334d={'where':{'id':_0x5d811b[_0x26a9('0x48')]['id']}},_0x4db6fa,_0x543806,_0x4f8f63,_0x5f1ded,_0x270b0f;_0x35334d=_[_0x26a9('0x3e')]({},_0x35334d,_0x5d811b['options']);return db[_0x26a9('0x2b')][_0x26a9('0x4e')](_0x35334d)['then'](function(_0x5ea7dd){if(_0x5ea7dd){_0x4db6fa=_0x5ea7dd;return _0x5ea7dd[_0x26a9('0x6a')]();}return null;})[_0x26a9('0x22')](function(_0x20b0d9){if(_0x20b0d9){if(!_0x20b0d9['length']){throw new db[(_0x26a9('0x6b'))][(_0x26a9('0xa3'))](_0x26a9('0x6c'),0x193);}_0x543806=_0x20b0d9;return db[_0x26a9('0x6d')]['findAll']({'raw':!![]});}return null;})[_0x26a9('0x22')](function(_0x3dcd42){if(_0x3dcd42){_0x4f8f63=_[_0x26a9('0x6e')](_0x3dcd42,'id');var _0x4c3709;var _0x4c1b94=squel[_0x26a9('0x6f')]();_0x4c1b94['from'](_0x4db6fa[_0x26a9('0x70')]);for(var _0x5ce5b6=0x0;_0x5ce5b6<_0x543806[_0x26a9('0x64')];_0x5ce5b6+=0x1){_0x4c3709=_0x543806[_0x5ce5b6]['MetricId']?_0x4f8f63[_0x543806[_0x5ce5b6][_0x26a9('0x8a')]][_0x26a9('0x71')]:_0x543806[_0x5ce5b6][_0x26a9('0x67')];_0x4c3709=_0x543806[_0x5ce5b6][_0x26a9('0x73')]?_[_0x26a9('0x72')](_0x991b94[_0x543806[_0x5ce5b6][_0x26a9('0x73')]],'%s',_0x4c3709):_0x4c3709;_0x4c3709=_0x543806[_0x5ce5b6][_0x26a9('0x74')]?_['replace'](_0x28635c[_0x543806[_0x5ce5b6][_0x26a9('0x74')]],'%s',_0x4c3709):_0x4c3709;if(_0x543806[_0x5ce5b6]['groupBy']){_0x4c1b94[_0x26a9('0x66')](_0x4c3709);}_0x543806[_0x5ce5b6][_0x26a9('0x76')]&&_0x4c1b94['order'](_0x4c3709,_0x543806[_0x5ce5b6][_0x26a9('0x76')]==='DESC'?![]:!![]);_0x4c1b94['field'](_0x4c3709,_0x543806[_0x5ce5b6][_0x26a9('0x78')]||_0x4c3709);}if(_0x4db6fa[_0x26a9('0x79')]){_0x4db6fa[_0x26a9('0x79')]=JSON[_0x26a9('0x7a')](_0x4db6fa[_0x26a9('0x79')]);for(var _0x411f97=0x0;_0x411f97<_0x4db6fa['joins'][_0x26a9('0x64')];_0x411f97+=0x1){if(_0x4db6fa[_0x26a9('0x79')][_0x411f97]['type']&&_[_0x26a9('0x7b')](_0xdc1efb,_0x4db6fa[_0x26a9('0x79')][_0x411f97][_0x26a9('0x2e')])&&_0x4db6fa[_0x26a9('0x79')][_0x411f97][_0x26a9('0x7c')]&&_0x4db6fa[_0x26a9('0x79')][_0x411f97]['foreignTable']&&_0x4db6fa[_0x26a9('0x79')][_0x411f97][_0x26a9('0x7e')]){_0x4c1b94[_0x4db6fa['joins'][_0x411f97][_0x26a9('0x2e')]](_0x4db6fa[_0x26a9('0x79')][_0x411f97][_0x26a9('0x7d')],null,util['format'](_0x26a9('0x8b'),_0x4db6fa['table'],_0x4db6fa['joins'][_0x411f97][_0x26a9('0x7c')],_0x4db6fa[_0x26a9('0x79')][_0x411f97][_0x26a9('0x7d')],_0x4db6fa[_0x26a9('0x79')][_0x411f97][_0x26a9('0x7e')]));}}}if(_0x4db6fa[_0x26a9('0x7f')]){_0x4db6fa[_0x26a9('0x7f')]=JSON[_0x26a9('0x7a')](_0x4db6fa['conditions']);_0x4c1b94[_0x26a9('0x3a')](_0x1f3149(_0x4db6fa[_0x26a9('0x7f')]['group']));}_0x270b0f=_0x4c1b94[_0x26a9('0x8c')]();_0x4c1b94[_0x26a9('0x1a')](_0x3419d3);_0x4c1b94['offset'](0x0);logger[_0x26a9('0x80')]('Limited\x20Query:',_0x4c1b94[_0x26a9('0x82')]());return dbH[_0x26a9('0x83')][_0x26a9('0x31')](_0x4c1b94[_0x26a9('0x82')](),{'type':dbH[_0x26a9('0x83')][_0x26a9('0x84')]['SELECT']});}})['then'](function(){return{'sql':_0x270b0f[_0x26a9('0x82')]()};})['then'](respondWithResult(_0x1e8e93,null))['catch'](handleError(_0x1e8e93,null));}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js index 99eefe0..4925e39 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 _0xad3b=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','AnalyticCustomReport','analytics_custom_reports','lodash'];(function(_0x55e303,_0x4b003a){var _0x443e26=function(_0xecb1c9){while(--_0xecb1c9){_0x55e303['push'](_0x55e303['shift']());}};_0x443e26(++_0x4b003a);}(_0xad3b,0x1ac));var _0xbad3=function(_0x7de33e,_0x46a873){_0x7de33e=_0x7de33e-0x0;var _0x9b0f8=_0xad3b[_0x7de33e];return _0x9b0f8;};'use strict';var _=require(_0xbad3('0x0'));var util=require(_0xbad3('0x1'));var logger=require(_0xbad3('0x2'))(_0xbad3('0x3'));var moment=require(_0xbad3('0x4'));var BPromise=require(_0xbad3('0x5'));var rp=require(_0xbad3('0x6'));var fs=require('fs');var path=require(_0xbad3('0x7'));var rimraf=require(_0xbad3('0x8'));var config=require(_0xbad3('0x9'));var attributes=require('./analyticCustomReport.attributes');module[_0xbad3('0xa')]=function(_0x113b21,_0x557ee0){return _0x113b21['define'](_0xbad3('0xb'),attributes,{'tableName':_0xbad3('0xc'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x63fe=['moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','AnalyticCustomReport','lodash','util'];(function(_0x2850f7,_0x418e10){var _0x4f2034=function(_0x277011){while(--_0x277011){_0x2850f7['push'](_0x2850f7['shift']());}};_0x4f2034(++_0x418e10);}(_0x63fe,0x152));var _0xe63f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x63fe[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xe63f('0x0'));var util=require(_0xe63f('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xe63f('0x2'));var BPromise=require(_0xe63f('0x3'));var rp=require(_0xe63f('0x4'));var fs=require('fs');var path=require(_0xe63f('0x5'));var rimraf=require(_0xe63f('0x6'));var config=require(_0xe63f('0x7'));var attributes=require('./analyticCustomReport.attributes');module[_0xe63f('0x8')]=function(_0x1275fc,_0x5d3937){return _0x1275fc['define'](_0xe63f('0x9'),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 df4aeec..587c89f 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 _0x3ccf=['client','http','request','then','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','lodash','moment','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise'];(function(_0x40f46f,_0x16bba2){var _0x9d21a=function(_0x2ad948){while(--_0x2ad948){_0x40f46f['push'](_0x40f46f['shift']());}};_0x9d21a(++_0x16bba2);}(_0x3ccf,0x139));var _0xf3cc=function(_0x44a58e,_0x3ced08){_0x44a58e=_0x44a58e-0x0;var _0x42fca0=_0x3ccf[_0x44a58e];return _0x42fca0;};'use strict';var _=require(_0xf3cc('0x0'));var util=require('util');var moment=require(_0xf3cc('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf3cc('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xf3cc('0x3'));var logger=require('../../config/logger')(_0xf3cc('0x4'));var config=require(_0xf3cc('0x5'));var jayson=require(_0xf3cc('0x6'));var client=jayson[_0xf3cc('0x7')][_0xf3cc('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3a0d83,_0x5d55c6,_0x1e3b91){return new BPromise(function(_0x48e9bc,_0x3fe586){return client[_0xf3cc('0x9')](_0x3a0d83,_0x1e3b91)[_0xf3cc('0xa')](function(_0x505e61){logger['info'](_0xf3cc('0xb'),_0x5d55c6,_0xf3cc('0xc'));logger[_0xf3cc('0xd')](_0xf3cc('0xe'),_0x5d55c6,'request\x20sent',JSON[_0xf3cc('0xf')](_0x505e61));if(_0x505e61['error']){if(_0x505e61[_0xf3cc('0x10')]['code']===0x1f4){logger[_0xf3cc('0x10')](_0xf3cc('0xb'),_0x5d55c6,_0x505e61[_0xf3cc('0x10')][_0xf3cc('0x11')]);return _0x3fe586(_0x505e61['error'][_0xf3cc('0x11')]);}logger[_0xf3cc('0x10')]('AnalyticCustomReport,\x20%s,\x20%s',_0x5d55c6,_0x505e61[_0xf3cc('0x10')][_0xf3cc('0x11')]);return _0x48e9bc(_0x505e61['error'][_0xf3cc('0x11')]);}else{logger[_0xf3cc('0x12')](_0xf3cc('0xb'),_0x5d55c6,_0xf3cc('0xc'));_0x48e9bc(_0x505e61[_0xf3cc('0x13')]['message']);}})['catch'](function(_0x52d677){logger[_0xf3cc('0x10')](_0xf3cc('0xb'),_0x5d55c6,_0x52d677);_0x3fe586(_0x52d677);});});} \ No newline at end of file +var _0x913a=['ioredis','../../mysqldb','rpc','jayson/promise','client','request','then','info','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','bluebird'];(function(_0x51cc3b,_0x1c027c){var _0x36169f=function(_0x3dba28){while(--_0x3dba28){_0x51cc3b['push'](_0x51cc3b['shift']());}};_0x36169f(++_0x1c027c);}(_0x913a,0xce));var _0xa913=function(_0x4e0af5,_0x17fe4e){_0x4e0af5=_0x4e0af5-0x0;var _0x32e630=_0x913a[_0x4e0af5];return _0x32e630;};'use strict';var _=require(_0xa913('0x0'));var util=require(_0xa913('0x1'));var moment=require(_0xa913('0x2'));var BPromise=require(_0xa913('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa913('0x4'));var db=require(_0xa913('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xa913('0x6'));var config=require('../../config/environment');var jayson=require(_0xa913('0x7'));var client=jayson[_0xa913('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x56ffbe,_0x3f6179,_0x1a3387){return new BPromise(function(_0x210d50,_0x3a2d87){return client[_0xa913('0x9')](_0x56ffbe,_0x1a3387)[_0xa913('0xa')](function(_0x5a1139){logger[_0xa913('0xb')](_0xa913('0xc'),_0x3f6179,_0xa913('0xd'));logger[_0xa913('0xe')](_0xa913('0xf'),_0x3f6179,_0xa913('0xd'),JSON['stringify'](_0x5a1139));if(_0x5a1139[_0xa913('0x10')]){if(_0x5a1139[_0xa913('0x10')][_0xa913('0x11')]===0x1f4){logger['error'](_0xa913('0xc'),_0x3f6179,_0x5a1139[_0xa913('0x10')][_0xa913('0x12')]);return _0x3a2d87(_0x5a1139[_0xa913('0x10')]['message']);}logger['error']('AnalyticCustomReport,\x20%s,\x20%s',_0x3f6179,_0x5a1139[_0xa913('0x10')][_0xa913('0x12')]);return _0x210d50(_0x5a1139[_0xa913('0x10')][_0xa913('0x12')]);}else{logger[_0xa913('0xb')](_0xa913('0xc'),_0x3f6179,_0xa913('0xd'));_0x210d50(_0x5a1139[_0xa913('0x13')][_0xa913('0x12')]);}})[_0xa913('0x14')](function(_0x4452b9){logger[_0xa913('0x10')]('AnalyticCustomReport,\x20%s,\x20%s',_0x3f6179,_0x4452b9);_0x3a2d87(_0x4452b9);});});} \ No newline at end of file diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js index ec70b0b..6329505 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 _0xab51=['../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','show','/:id/preview','/:id/run','run','/:id/query','query','create','/:id','destroy','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x51df00,_0x4ac573){var _0x198328=function(_0x24e0ec){while(--_0x24e0ec){_0x51df00['push'](_0x51df00['shift']());}};_0x198328(++_0x4ac573);}(_0xab51,0x10b));var _0x1ab5=function(_0x239e86,_0x31e495){_0x239e86=_0x239e86-0x0;var _0x212026=_0xab51[_0x239e86];return _0x212026;};'use strict';var multer=require('multer');var util=require(_0x1ab5('0x0'));var path=require(_0x1ab5('0x1'));var timeout=require(_0x1ab5('0x2'));var express=require(_0x1ab5('0x3'));var router=express[_0x1ab5('0x4')]();var fs_extra=require(_0x1ab5('0x5'));var auth=require(_0x1ab5('0x6'));var interaction=require(_0x1ab5('0x7'));var config=require(_0x1ab5('0x8'));var controller=require('./analyticCustomReport.controller');router[_0x1ab5('0x9')]('/',auth[_0x1ab5('0xa')](),controller[_0x1ab5('0xb')]);router[_0x1ab5('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x1ab5('0xc')]);router['get'](_0x1ab5('0xd'),auth[_0x1ab5('0xa')](),controller['preview']);router[_0x1ab5('0x9')](_0x1ab5('0xe'),auth['isAuthenticated'](),controller[_0x1ab5('0xf')]);router['get'](_0x1ab5('0x10'),auth['isAuthenticated'](),controller[_0x1ab5('0x11')]);router['post']('/',auth[_0x1ab5('0xa')](),controller[_0x1ab5('0x12')]);router['put'](_0x1ab5('0x13'),auth[_0x1ab5('0xa')](),controller['update']);router['delete']('/:id',auth[_0x1ab5('0xa')](),controller[_0x1ab5('0x14')]);module['exports']=router; \ No newline at end of file +var _0x86ce=['../../components/interaction/service','../../config/environment','./analyticCustomReport.controller','get','index','/:id','isAuthenticated','/:id/preview','run','/:id/query','query','post','create','update','exports','multer','path','express','Router','fs-extra'];(function(_0x22ffbf,_0x16f31e){var _0x360c17=function(_0x40807f){while(--_0x40807f){_0x22ffbf['push'](_0x22ffbf['shift']());}};_0x360c17(++_0x16f31e);}(_0x86ce,0x19f));var _0xe86c=function(_0x40ac5e,_0x2de228){_0x40ac5e=_0x40ac5e-0x0;var _0x2839d6=_0x86ce[_0x40ac5e];return _0x2839d6;};'use strict';var multer=require(_0xe86c('0x0'));var util=require('util');var path=require(_0xe86c('0x1'));var timeout=require('connect-timeout');var express=require(_0xe86c('0x2'));var router=express[_0xe86c('0x3')]();var fs_extra=require(_0xe86c('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xe86c('0x5'));var config=require(_0xe86c('0x6'));var controller=require(_0xe86c('0x7'));router[_0xe86c('0x8')]('/',auth['isAuthenticated'](),controller[_0xe86c('0x9')]);router['get'](_0xe86c('0xa'),auth[_0xe86c('0xb')](),controller['show']);router[_0xe86c('0x8')](_0xe86c('0xc'),auth[_0xe86c('0xb')](),controller['preview']);router['get']('/:id/run',auth[_0xe86c('0xb')](),controller[_0xe86c('0xd')]);router[_0xe86c('0x8')](_0xe86c('0xe'),auth[_0xe86c('0xb')](),controller[_0xe86c('0xf')]);router[_0xe86c('0x10')]('/',auth[_0xe86c('0xb')](),controller[_0xe86c('0x11')]);router['put'](_0xe86c('0xa'),auth[_0xe86c('0xb')](),controller[_0xe86c('0x12')]);router['delete'](_0xe86c('0xa'),auth[_0xe86c('0xb')](),controller['destroy']);module[_0xe86c('0x13')]=router; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js index 54466d2..cf4b6a9 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 _0x98a8=['sequelize','exports','STRING','TEXT'];(function(_0xe55d0b,_0x4fbad3){var _0x33ca22=function(_0x3ef848){while(--_0x3ef848){_0xe55d0b['push'](_0xe55d0b['shift']());}};_0x33ca22(++_0x4fbad3);}(_0x98a8,0x12c));var _0x898a=function(_0x5c61f2,_0x22e09b){_0x5c61f2=_0x5c61f2-0x0;var _0x165bbc=_0x98a8[_0x5c61f2];return _0x165bbc;};'use strict';var Sequelize=require(_0x898a('0x0'));module[_0x898a('0x1')]={'name':{'type':Sequelize[_0x898a('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x898a('0x2')]},'parent':{'type':Sequelize[_0x898a('0x2')]},'table':{'type':Sequelize[_0x898a('0x2')]},'conditions':{'type':Sequelize[_0x898a('0x3')]},'joins':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0x46ed=['sequelize','exports','STRING','TEXT'];(function(_0x102e37,_0x14a181){var _0x35a07c=function(_0x16577f){while(--_0x16577f){_0x102e37['push'](_0x102e37['shift']());}};_0x35a07c(++_0x14a181);}(_0x46ed,0x168));var _0xd46e=function(_0x599f41,_0x4db732){_0x599f41=_0x599f41-0x0;var _0x2e4d58=_0x46ed[_0x599f41];return _0x2e4d58;};'use strict';var Sequelize=require(_0xd46e('0x0'));module[_0xd46e('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0xd46e('0x2')]},'parent':{'type':Sequelize[_0xd46e('0x2')]},'table':{'type':Sequelize[_0xd46e('0x2')]},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize[_0xd46e('0x3')]}}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js index e69eedd..5f678f0 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 _0x1967=['conditions','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','SUM(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','IS\x20NOT\x20NULL','table','web','%s-%s.%s','randomstring','output','default','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','fork','../../components/export/','../../files/reports','savename','countTable','COUNT(*)','runReport','select','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','dbH','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','reject','update','then','destroy','get','stack','name','send','index','map','AnalyticDefaultReport','rawAttributes','fieldName','type','key','model','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','where','merge','VIRTUAL','filter','options','includeAll','findAll','rows','show','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','DefaultReports','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','join','left_join','right_join','cross_join','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','value','getFields','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','from','MetricId','metric','function','replace','format','groupBy','orderBy','DESC','alias','joins','parse','foreignTable','%s.%s\x20=\x20%s.%s','parentKey','foreignKey'];(function(_0x155b23,_0x4eade0){var _0x11c586=function(_0x2667a8){while(--_0x2667a8){_0x155b23['push'](_0x155b23['shift']());}};_0x11c586(++_0x4eade0);}(_0x1967,0x173));var _0x7196=function(_0x2eef88,_0x3fcdce){_0x2eef88=_0x2eef88-0x0;var _0x3a2677=_0x1967[_0x2eef88];return _0x3a2677;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7196('0x0'));var zipdir=require(_0x7196('0x1'));var jsonpatch=require(_0x7196('0x2'));var rp=require(_0x7196('0x3'));var moment=require(_0x7196('0x4'));var BPromise=require(_0x7196('0x5'));var Mustache=require(_0x7196('0x6'));var util=require(_0x7196('0x7'));var path=require(_0x7196('0x8'));var sox=require(_0x7196('0x9'));var csv=require('to-csv');var ejs=require(_0x7196('0xa'));var fs=require('fs');var fs_extra=require(_0x7196('0xb'));var _=require(_0x7196('0xc'));var squel=require(_0x7196('0xd'));var crypto=require(_0x7196('0xe'));var jsforce=require(_0x7196('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x7196('0x10'));var querystring=require(_0x7196('0x11'));var Papa=require(_0x7196('0x12'));var Redis=require(_0x7196('0x13'));var authService=require(_0x7196('0x14'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7196('0x15'));var logger=require(_0x7196('0x16'))(_0x7196('0x17'));var utils=require(_0x7196('0x18'));var config=require(_0x7196('0x19'));var licenseUtil=require(_0x7196('0x1a'));var db=require(_0x7196('0x1b'))['db'];var dbH=require(_0x7196('0x1b'))[_0x7196('0x1c')];function respondWithStatusCode(_0xba707b,_0x154101){_0x154101=_0x154101||0xcc;return function(_0x4e8c4c){if(_0x4e8c4c){return _0xba707b[_0x7196('0x1d')](_0x154101);}return _0xba707b[_0x7196('0x1e')](_0x154101)[_0x7196('0x1f')]();};}function respondWithResult(_0xf098c1,_0x511aa1){_0x511aa1=_0x511aa1||0xc8;return function(_0x31c778){if(_0x31c778){return _0xf098c1['status'](_0x511aa1)[_0x7196('0x20')](_0x31c778);}};}function respondWithFilteredResult(_0x2590a6,_0xf7e97){return function(_0x3ed1ad){if(_0x3ed1ad){var _0x12dce7=typeof _0xf7e97[_0x7196('0x21')]===_0x7196('0x22')&&typeof _0xf7e97[_0x7196('0x23')]===_0x7196('0x22');var _0x32fe2b=_0x3ed1ad[_0x7196('0x24')];var _0x5b716a=_0x12dce7?0x0:_0xf7e97['offset'];var _0x448f13=_0x12dce7?_0x3ed1ad[_0x7196('0x24')]:_0xf7e97[_0x7196('0x21')]+_0xf7e97['limit'];var _0x39b944;if(_0x448f13>=_0x32fe2b){_0x448f13=_0x32fe2b;_0x39b944=0xc8;}else{_0x39b944=0xce;}_0x2590a6['status'](_0x39b944);return _0x2590a6['set'](_0x7196('0x25'),_0x5b716a+'-'+_0x448f13+'/'+_0x32fe2b)[_0x7196('0x20')](_0x3ed1ad);}return null;};}function patchUpdates(_0x8dee9d){return function(_0x4ddf78){try{jsonpatch['apply'](_0x4ddf78,_0x8dee9d,!![]);}catch(_0x38d291){return BPromise[_0x7196('0x26')](_0x38d291);}return _0x4ddf78['save']();};}function saveUpdates(_0x18649b,_0x27ff84){return function(_0x6e22e5){if(_0x6e22e5){return _0x6e22e5[_0x7196('0x27')](_0x18649b)[_0x7196('0x28')](function(_0x549f34){return _0x549f34;});}return null;};}function removeEntity(_0x3f8178,_0x520d01){return function(_0x3ce9a0){if(_0x3ce9a0){return _0x3ce9a0[_0x7196('0x29')]()[_0x7196('0x28')](function(){var _0xa69810=_0x3ce9a0[_0x7196('0x2a')]({'plain':!![]});var _0x43f6a2='DefaultReports';return db['UserProfileResource'][_0x7196('0x29')]({'where':{'type':_0x43f6a2,'resourceId':_0xa69810['id']}})[_0x7196('0x28')](function(){return _0x3ce9a0;});})[_0x7196('0x28')](function(){_0x3f8178['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x41cfd2,_0x162cfc){return function(_0x675e64){if(!_0x675e64){_0x41cfd2['sendStatus'](0x194);}return _0x675e64;};}function handleError(_0x35eef9,_0x4ecea1){_0x4ecea1=_0x4ecea1||0x1f4;return function(_0x4fd339){logger['error'](_0x4fd339[_0x7196('0x2b')]);if(_0x4fd339[_0x7196('0x2c')]){delete _0x4fd339[_0x7196('0x2c')];}_0x35eef9['status'](_0x4ecea1)[_0x7196('0x2d')](_0x4fd339);};}exports[_0x7196('0x2e')]=function(_0x2f9583,_0xf999e9){var _0x50c386={},_0x39710d={},_0x429160={'count':0x0,'rows':[]};var _0xd07f22=_[_0x7196('0x2f')](db[_0x7196('0x30')][_0x7196('0x31')],function(_0x15c5f0){return{'name':_0x15c5f0[_0x7196('0x32')],'type':_0x15c5f0[_0x7196('0x33')][_0x7196('0x34')]};});_0x39710d[_0x7196('0x35')]=_['map'](_0xd07f22,_0x7196('0x2c'));_0x39710d['query']=_[_0x7196('0x36')](_0x2f9583['query']);_0x39710d[_0x7196('0x37')]=_[_0x7196('0x38')](_0x39710d['model'],_0x39710d[_0x7196('0x39')]);_0x50c386[_0x7196('0x3a')]=_[_0x7196('0x38')](_0x39710d[_0x7196('0x35')],qs[_0x7196('0x3b')](_0x2f9583['query'][_0x7196('0x3b')]));_0x50c386[_0x7196('0x3a')]=_0x50c386[_0x7196('0x3a')][_0x7196('0x3c')]?_0x50c386[_0x7196('0x3a')]:_0x39710d[_0x7196('0x35')];if(!_0x2f9583['query'][_0x7196('0x3d')](_0x7196('0x3e'))){_0x50c386[_0x7196('0x23')]=qs['limit'](_0x2f9583[_0x7196('0x39')][_0x7196('0x23')]);_0x50c386[_0x7196('0x21')]=qs[_0x7196('0x21')](_0x2f9583[_0x7196('0x39')][_0x7196('0x21')]);}_0x50c386[_0x7196('0x3f')]=qs[_0x7196('0x40')](_0x2f9583[_0x7196('0x39')][_0x7196('0x40')]);_0x50c386['where']=qs[_0x7196('0x37')](_[_0x7196('0x41')](_0x2f9583['query'],_0x39710d[_0x7196('0x37')]),_0xd07f22);if(_0x2f9583['query']['filter']){_0x50c386[_0x7196('0x42')]=_[_0x7196('0x43')](_0x50c386['where'],{'$or':_['map'](_0xd07f22,function(_0x1bad95){if(_0x1bad95[_0x7196('0x33')]!==_0x7196('0x44')){var _0x4c2341={};_0x4c2341[_0x1bad95[_0x7196('0x2c')]]={'$like':'%'+_0x2f9583[_0x7196('0x39')][_0x7196('0x45')]+'%'};return _0x4c2341;}})});}_0x50c386=_[_0x7196('0x43')]({},_0x50c386,_0x2f9583[_0x7196('0x46')]);var _0x428d76={'where':_0x50c386[_0x7196('0x42')]};return db[_0x7196('0x30')]['count'](_0x428d76)[_0x7196('0x28')](function(_0xa852e1){_0x429160['count']=_0xa852e1;if(_0x2f9583[_0x7196('0x39')][_0x7196('0x47')]){_0x50c386['include']=[{'all':!![]}];}return db[_0x7196('0x30')][_0x7196('0x48')](_0x50c386);})[_0x7196('0x28')](function(_0x5749e2){_0x429160[_0x7196('0x49')]=_0x5749e2;return _0x429160;})[_0x7196('0x28')](respondWithFilteredResult(_0xf999e9,_0x50c386))['catch'](handleError(_0xf999e9,null));};exports[_0x7196('0x4a')]=function(_0x1a7052,_0x4f0c6c){var _0x335e6f={'raw':!![],'where':{'id':_0x1a7052['params']['id']}},_0x53a5e6={};_0x53a5e6['model']=_['keys'](db['AnalyticDefaultReport'][_0x7196('0x31')]);_0x53a5e6['query']=_[_0x7196('0x36')](_0x1a7052[_0x7196('0x39')]);_0x53a5e6[_0x7196('0x37')]=_[_0x7196('0x38')](_0x53a5e6['model'],_0x53a5e6[_0x7196('0x39')]);_0x335e6f['attributes']=_[_0x7196('0x38')](_0x53a5e6[_0x7196('0x35')],qs[_0x7196('0x3b')](_0x1a7052['query'][_0x7196('0x3b')]));_0x335e6f[_0x7196('0x3a')]=_0x335e6f[_0x7196('0x3a')]['length']?_0x335e6f['attributes']:_0x53a5e6[_0x7196('0x35')];if(_0x1a7052['query'][_0x7196('0x47')]){_0x335e6f['include']=[{'all':!![]}];}_0x335e6f=_['merge']({},_0x335e6f,_0x1a7052[_0x7196('0x46')]);return db['AnalyticDefaultReport']['find'](_0x335e6f)['then'](handleEntityNotFound(_0x4f0c6c,null))[_0x7196('0x28')](respondWithResult(_0x4f0c6c,null))['catch'](handleError(_0x4f0c6c,null));};exports['create']=function(_0x28591e,_0x182c8b){return db[_0x7196('0x30')][_0x7196('0x4b')](_0x28591e['body'],{})[_0x7196('0x28')](function(_0x564688){var _0x36844f=_0x28591e[_0x7196('0x4c')]['get']({'plain':!![]});if(!_0x36844f)throw new Error(_0x7196('0x4d'));if(_0x36844f[_0x7196('0x4e')]===_0x7196('0x4c')){var _0x4fa18f=_0x564688[_0x7196('0x2a')]({'plain':!![]});var _0x5d51aa=_0x7196('0x4f');return db[_0x7196('0x50')][_0x7196('0x51')]({'where':{'name':_0x5d51aa,'userProfileId':_0x36844f[_0x7196('0x52')]},'raw':!![]})[_0x7196('0x28')](function(_0x19733a){if(_0x19733a&&_0x19733a[_0x7196('0x53')]===0x0){return db[_0x7196('0x54')]['create']({'name':_0x4fa18f['name'],'resourceId':_0x4fa18f['id'],'type':_0x7196('0x55'),'sectionId':_0x19733a['id']},{})[_0x7196('0x28')](function(){return _0x564688;});}else{return _0x564688;}})[_0x7196('0x56')](function(_0xe4b032){logger['error'](_0x7196('0x57'),_0xe4b032);throw _0xe4b032;});}return _0x564688;})[_0x7196('0x28')](respondWithResult(_0x182c8b,0xc9))[_0x7196('0x56')](handleError(_0x182c8b,null));};exports[_0x7196('0x27')]=function(_0x9fcfd4,_0x3177c2){if(_0x9fcfd4[_0x7196('0x58')]['id']){delete _0x9fcfd4[_0x7196('0x58')]['id'];}return db[_0x7196('0x30')][_0x7196('0x51')]({'where':{'id':_0x9fcfd4[_0x7196('0x59')]['id']}})['then'](handleEntityNotFound(_0x3177c2,null))[_0x7196('0x28')](saveUpdates(_0x9fcfd4[_0x7196('0x58')],null))[_0x7196('0x28')](respondWithResult(_0x3177c2,null))['catch'](handleError(_0x3177c2,null));};exports[_0x7196('0x29')]=function(_0x5ca1ca,_0x34407d){return db[_0x7196('0x30')][_0x7196('0x51')]({'where':{'id':_0x5ca1ca[_0x7196('0x59')]['id']}})[_0x7196('0x28')](handleEntityNotFound(_0x34407d,null))['then'](removeEntity(_0x34407d,null))[_0x7196('0x56')](handleError(_0x34407d,null));};exports['preview']=function(_0x4be36d,_0x5b9824){var _0x1bc358=0xa;var _0x3be180=[_0x7196('0x5a'),_0x7196('0x5b'),_0x7196('0x5c'),_0x7196('0x5d')];var _0x2d8b3d={'SUM':'SUM(%s)','COUNT':_0x7196('0x5e'),'COUNT DISTINCT':_0x7196('0x5f'),'MAX':_0x7196('0x60'),'MIN':_0x7196('0x61'),'AVG':_0x7196('0x62'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x7196('0x63')};var _0x1c7eb2={'SEC_TO_TIME':_0x7196('0x64'),'DATE':_0x7196('0x65'),'HOUR':_0x7196('0x66'),'ROUND':_0x7196('0x67'),'UNIX_TIMESTAMP':_0x7196('0x68')};var _0x43ee13=function(_0x13e9d0){return!_[_0x7196('0x69')]([_0x7196('0x6a'),'IS\x20NOT\x20NULL',_0x7196('0x6b'),_0x7196('0x6c')],_0x13e9d0);};var _0x27d5d7=function(_0x33f43b){if(!_0x33f43b||!_0x33f43b['rules'][_0x7196('0x3c')]){return'';}for(var _0x204c3a='(',_0x1f3acc=0x0;_0x1f3acc<_0x33f43b[_0x7196('0x6d')][_0x7196('0x3c')];_0x1f3acc+=0x1){_0x1f3acc>0x0&&(_0x204c3a+='\x20'+_0x33f43b[_0x7196('0x6e')]+'\x20');_0x204c3a+=_0x33f43b[_0x7196('0x6d')][_0x1f3acc]['group']?_0x27d5d7(_0x33f43b[_0x7196('0x6d')][_0x1f3acc][_0x7196('0x6f')]):_0x33f43b[_0x7196('0x6d')][_0x1f3acc][_0x7196('0x70')]+'\x20'+_0x33f43b['rules'][_0x1f3acc][_0x7196('0x71')]+(_0x43ee13(_0x33f43b[_0x7196('0x6d')][_0x1f3acc][_0x7196('0x71')])?'\x20'+_0x33f43b[_0x7196('0x6d')][_0x1f3acc][_0x7196('0x72')]:'');}return _0x204c3a+')';};var _0x37c6be={'where':{'id':_0x4be36d['params']['id']}},_0x57065,_0x517dfb,_0x56b2eb,_0x56955e,_0x72f6f1;_0x37c6be=_[_0x7196('0x43')]({},_0x37c6be,_0x4be36d[_0x7196('0x46')]);return db[_0x7196('0x30')][_0x7196('0x51')](_0x37c6be)[_0x7196('0x28')](function(_0x30d44f){if(_0x30d44f){_0x57065=_0x30d44f;return _0x30d44f[_0x7196('0x73')]();}return null;})[_0x7196('0x28')](function(_0x3881a5){if(_0x3881a5){if(!_0x3881a5['length']){throw new db['Sequelize'][(_0x7196('0x74'))](_0x7196('0x75'),0x193);}_0x517dfb=_0x3881a5;return db[_0x7196('0x76')][_0x7196('0x48')]({'raw':!![]});}return null;})[_0x7196('0x28')](function(_0x45e21f){if(_0x45e21f){_0x56b2eb=_[_0x7196('0x77')](_0x45e21f,'id');var _0x2f36f8;var _0x4cc5e3=squel['select']();_0x4cc5e3[_0x7196('0x78')](_0x57065['table']);for(var _0x30d114=0x0;_0x30d114<_0x517dfb['length'];_0x30d114+=0x1){_0x2f36f8=_0x517dfb[_0x30d114][_0x7196('0x79')]?_0x56b2eb[_0x517dfb[_0x30d114][_0x7196('0x79')]][_0x7196('0x7a')]:_0x517dfb[_0x30d114][_0x7196('0x70')];_0x2f36f8=_0x517dfb[_0x30d114]['function']?_['replace'](_0x2d8b3d[_0x517dfb[_0x30d114][_0x7196('0x7b')]],'%s',_0x2f36f8):_0x2f36f8;_0x2f36f8=_0x517dfb[_0x30d114]['format']?_[_0x7196('0x7c')](_0x1c7eb2[_0x517dfb[_0x30d114][_0x7196('0x7d')]],'%s',_0x2f36f8):_0x2f36f8;if(_0x517dfb[_0x30d114][_0x7196('0x7e')]){_0x4cc5e3[_0x7196('0x6f')](_0x2f36f8);}_0x517dfb[_0x30d114][_0x7196('0x7f')]&&_0x4cc5e3[_0x7196('0x3f')](_0x2f36f8,_0x517dfb[_0x30d114]['orderBy']===_0x7196('0x80')?![]:!![]);_0x4cc5e3[_0x7196('0x70')](_0x2f36f8,_0x517dfb[_0x30d114][_0x7196('0x81')]||_0x2f36f8);}if(_0x57065[_0x7196('0x82')]){_0x57065[_0x7196('0x82')]=JSON[_0x7196('0x83')](_0x57065[_0x7196('0x82')]);for(var _0x473c0e=0x0;_0x473c0e<_0x57065[_0x7196('0x82')][_0x7196('0x3c')];_0x473c0e+=0x1){if(_0x57065[_0x7196('0x82')][_0x473c0e][_0x7196('0x33')]&&_['includes'](_0x3be180,_0x57065[_0x7196('0x82')][_0x473c0e][_0x7196('0x33')])&&_0x57065['joins'][_0x473c0e]['parentKey']&&_0x57065[_0x7196('0x82')][_0x473c0e][_0x7196('0x84')]&&_0x57065[_0x7196('0x82')][_0x473c0e]['foreignKey']){_0x4cc5e3[_0x57065[_0x7196('0x82')][_0x473c0e]['type']](_0x57065[_0x7196('0x82')][_0x473c0e][_0x7196('0x84')],null,util['format'](_0x7196('0x85'),_0x57065['table'],_0x57065['joins'][_0x473c0e][_0x7196('0x86')],_0x57065[_0x7196('0x82')][_0x473c0e][_0x7196('0x84')],_0x57065['joins'][_0x473c0e][_0x7196('0x87')]));}}}if(_0x57065['conditions']){_0x57065[_0x7196('0x88')]=JSON[_0x7196('0x83')](_0x57065[_0x7196('0x88')]);_0x4cc5e3[_0x7196('0x42')](_0x27d5d7(_0x57065[_0x7196('0x88')]['group']));}_0x72f6f1=_0x4cc5e3[_0x7196('0x89')]();_0x4cc5e3[_0x7196('0x23')](_0x1bc358);_0x4cc5e3[_0x7196('0x21')](0x0);logger[_0x7196('0x8a')](_0x7196('0x8b'),_0x4cc5e3[_0x7196('0x8c')]());return dbH[_0x7196('0x8d')][_0x7196('0x39')](_0x4cc5e3['toString'](),{'type':dbH[_0x7196('0x8d')][_0x7196('0x8e')][_0x7196('0x8f')]});}})[_0x7196('0x28')](respondWithResult(_0x5b9824,null))['catch'](handleError(_0x5b9824,null));};function runReport(_0x1364f5,_0x2cb53c,_0x4fe2cb){var _0x2e4807=_0x2cb53c['name'];var _0xd6d8cf=0xa;var _0x5318c1=[_0x7196('0x5a'),_0x7196('0x5b'),'right_join',_0x7196('0x5d')];var _0x2b52c0={'SUM':_0x7196('0x90'),'COUNT':'COUNT(%s)','COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x7196('0x60'),'MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':_0x7196('0x91'),'GROUP_CONCAT ASC':_0x7196('0x92'),'GROUP_CONCAT DESC':_0x7196('0x63')};var _0x509c4a={'SEC_TO_TIME':_0x7196('0x64'),'DATE':_0x7196('0x65'),'HOUR':_0x7196('0x66'),'ROUND':_0x7196('0x67'),'UNIX_TIMESTAMP':_0x7196('0x68')};var _0x26048c=function(_0x1a4d17){return!_[_0x7196('0x69')]([_0x7196('0x6a'),_0x7196('0x93'),_0x7196('0x6b'),'IS\x20NOT\x20EMPTY'],_0x1a4d17);};var _0x5acff1=function(_0x32ab6c){if(!_0x32ab6c||!_0x32ab6c['rules']['length']){return'';}for(var _0x2bfdc4='(',_0x1604fa=0x0;_0x1604fa<_0x32ab6c[_0x7196('0x6d')][_0x7196('0x3c')];_0x1604fa+=0x1){_0x1604fa>0x0&&(_0x2bfdc4+='\x20'+_0x32ab6c['operator']+'\x20');_0x2bfdc4+=_0x32ab6c['rules'][_0x1604fa][_0x7196('0x6f')]?_0x5acff1(_0x32ab6c[_0x7196('0x6d')][_0x1604fa][_0x7196('0x6f')]):_0x32ab6c[_0x7196('0x6d')][_0x1604fa]['field']+'\x20'+_0x32ab6c[_0x7196('0x6d')][_0x1604fa]['condition']+(_0x26048c(_0x32ab6c['rules'][_0x1604fa][_0x7196('0x71')])?'\x20'+_0x32ab6c[_0x7196('0x6d')][_0x1604fa][_0x7196('0x72')]:'');}return _0x2bfdc4+')';};var _0x494418={'where':{'id':_0x1364f5['id']}},_0x400aa5,_0x40d4c3,_0x1824e2,_0x30c54b,_0x10712f;_0x494418=_[_0x7196('0x43')]({},_0x494418,_0x4fe2cb);return db[_0x7196('0x30')][_0x7196('0x51')](_0x494418)['then'](function(_0x9bd2ea){if(_0x9bd2ea){_0x400aa5=_0x9bd2ea;return _0x9bd2ea[_0x7196('0x73')]();}return null;})[_0x7196('0x28')](function(_0x408760){if(_0x408760){if(!_0x408760[_0x7196('0x3c')]){throw new db['Sequelize'][(_0x7196('0x74'))](_0x7196('0x75'),0x193);}_0x40d4c3=_0x408760;return db[_0x7196('0x76')]['findAll']({'raw':!![]});}return null;})[_0x7196('0x28')](function(_0x4b98de){if(_0x4b98de){_0x1824e2=_['keyBy'](_0x4b98de,'id');var _0x1dcf93;var _0x25d323=squel['select']();_0x25d323[_0x7196('0x78')](_0x400aa5[_0x7196('0x94')]);for(var _0x48ceda=0x0;_0x48ceda<_0x40d4c3[_0x7196('0x3c')];_0x48ceda+=0x1){_0x1dcf93=_0x40d4c3[_0x48ceda][_0x7196('0x79')]?_0x1824e2[_0x40d4c3[_0x48ceda][_0x7196('0x79')]][_0x7196('0x7a')]:_0x40d4c3[_0x48ceda][_0x7196('0x70')];_0x1dcf93=_0x40d4c3[_0x48ceda][_0x7196('0x7b')]?_['replace'](_0x2b52c0[_0x40d4c3[_0x48ceda][_0x7196('0x7b')]],'%s',_0x1dcf93):_0x1dcf93;_0x1dcf93=_0x40d4c3[_0x48ceda][_0x7196('0x7d')]?_[_0x7196('0x7c')](_0x509c4a[_0x40d4c3[_0x48ceda]['format']],'%s',_0x1dcf93):_0x1dcf93;if(_0x40d4c3[_0x48ceda]['groupBy']){_0x25d323['group'](_0x1dcf93);}_0x40d4c3[_0x48ceda][_0x7196('0x7f')]&&_0x25d323[_0x7196('0x3f')](_0x1dcf93,_0x40d4c3[_0x48ceda][_0x7196('0x7f')]==='DESC'?![]:!![]);_0x25d323[_0x7196('0x70')](_0x1dcf93,_0x40d4c3[_0x48ceda]['alias']||_0x1dcf93);}if(_0x400aa5[_0x7196('0x82')]){_0x400aa5['joins']=JSON[_0x7196('0x83')](_0x400aa5[_0x7196('0x82')]);for(var _0x33d5bf=0x0;_0x33d5bf<_0x400aa5[_0x7196('0x82')][_0x7196('0x3c')];_0x33d5bf+=0x1){if(_0x400aa5[_0x7196('0x82')][_0x33d5bf][_0x7196('0x33')]&&_['includes'](_0x5318c1,_0x400aa5[_0x7196('0x82')][_0x33d5bf]['type'])&&_0x400aa5['joins'][_0x33d5bf]['parentKey']&&_0x400aa5['joins'][_0x33d5bf]['foreignTable']&&_0x400aa5[_0x7196('0x82')][_0x33d5bf][_0x7196('0x87')]){_0x25d323[_0x400aa5[_0x7196('0x82')][_0x33d5bf]['type']](_0x400aa5[_0x7196('0x82')][_0x33d5bf]['foreignTable'],null,util['format']('%s.%s\x20=\x20%s.%s',_0x400aa5[_0x7196('0x94')],_0x400aa5['joins'][_0x33d5bf][_0x7196('0x86')],_0x400aa5[_0x7196('0x82')][_0x33d5bf][_0x7196('0x84')],_0x400aa5[_0x7196('0x82')][_0x33d5bf][_0x7196('0x87')]));}}}if(_0x400aa5[_0x7196('0x88')]){_0x400aa5[_0x7196('0x88')]=JSON[_0x7196('0x83')](_0x400aa5['conditions']);_0x25d323[_0x7196('0x42')](_0x5acff1(_0x400aa5[_0x7196('0x88')][_0x7196('0x6f')]));}_0x10712f=_0x25d323['clone']();_0x25d323[_0x7196('0x23')](_0xd6d8cf);_0x25d323[_0x7196('0x21')](0x0);return;}})[_0x7196('0x28')](function(){if(_0x2cb53c['output']===_0x7196('0x95')){return null;}var _0x46a563=_[_0x7196('0x43')](_0x2cb53c,{'name':_0x2cb53c['fullPath']||_0x2cb53c[_0x7196('0x2c')]||_0x400aa5[_0x7196('0x2c')],'basename':_0x2e4807,'savename':util['format'](_0x7196('0x96'),_0x2cb53c['name']||_0x400aa5[_0x7196('0x2c')],require(_0x7196('0x97'))['generate'](0x4),_0x2cb53c[_0x7196('0x98')]||'csv'),'reportId':_0x400aa5['id'],'reportType':_0x7196('0x99')});return db[_0x7196('0x9a')][_0x7196('0x4b')](_0x46a563,{'raw':!![]});})['then'](function(_0xd9619d){if(_0x400aa5[_0x7196('0x94')]===_0x7196('0x9b')){_0x10712f[_0x7196('0x42')](_0x400aa5['table']+_0x7196('0x9c'),_0x2cb53c[_0x7196('0x9d')],_0x2cb53c[_0x7196('0x9e')]);}else{_0x10712f['where'](_0x400aa5['table']+_0x7196('0x9f'),_0x2cb53c[_0x7196('0x9d')],_0x2cb53c[_0x7196('0x9e')]);}if(_0xd9619d){logger[_0x7196('0xa0')]('Run\x20Query:',_0x10712f[_0x7196('0x8c')]());require('child_process')[_0x7196('0xa1')](path['join'](__dirname,_0x7196('0xa2'),_0xd9619d[_0x7196('0x98')]),[_0xd9619d['id'],_0x10712f[_0x7196('0x8c')](),path[_0x7196('0x5a')](__dirname,_0x7196('0xa3'),_0xd9619d[_0x7196('0xa4')]),_0x2e4807]);return _0xd9619d;}else{var _0x342fb1=squel['select']();_0x342fb1[_0x7196('0x78')]('('+_0x10712f[_0x7196('0x8c')]()+')',_0x7196('0xa5'));_0x342fb1[_0x7196('0x70')](_0x7196('0xa6'),_0x7196('0x24'));_0x10712f[_0x7196('0x23')](_0x2cb53c[_0x7196('0x23')]||_0xd6d8cf);_0x10712f['offset'](_0x2cb53c[_0x7196('0x21')]||0x0);return dbH[_0x7196('0x8d')]['query'](_0x342fb1[_0x7196('0x8c')](),{'type':dbH[_0x7196('0x8d')]['QueryTypes'][_0x7196('0x8f')]})[_0x7196('0x28')](function(_0xdf1ede){if(!_0xdf1ede[_0x7196('0x3c')]){_0x30c54b=0x0;}else{_0x30c54b=_0xdf1ede[0x0]['count']||0x0;}return dbH['sequelize'][_0x7196('0x39')](_0x10712f['toString'](),{'type':dbH[_0x7196('0x8d')][_0x7196('0x8e')][_0x7196('0x8f')]});})[_0x7196('0x28')](function(_0x2df80a){return{'rows':_0x2df80a||[],'count':_0x30c54b};});}});}exports['run']=function(_0x392e74,_0x17ba6d){return runReport(_0x392e74[_0x7196('0x59')],_0x392e74[_0x7196('0x39')],_0x392e74[_0x7196('0x46')])[_0x7196('0x28')](respondWithResult(_0x17ba6d,null))[_0x7196('0x56')](handleError(_0x17ba6d,null));};exports[_0x7196('0xa7')]=runReport;exports[_0x7196('0x39')]=function(_0x5a3c87,_0x58fb86){var _0x51da79=0xa;var _0x144613=[_0x7196('0x5a'),_0x7196('0x5b'),_0x7196('0x5c'),_0x7196('0x5d')];var _0x9055af={'SUM':_0x7196('0x90'),'COUNT':_0x7196('0x5e'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':_0x7196('0x91'),'GROUP_CONCAT ASC':_0x7196('0x92'),'GROUP_CONCAT DESC':_0x7196('0x63')};var _0xab9595={'SEC_TO_TIME':_0x7196('0x64'),'DATE':_0x7196('0x65'),'HOUR':'HOUR(%s)','ROUND':_0x7196('0x67'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x5236a0=function(_0x520fe8){return!_['includes'](['IS\x20NULL',_0x7196('0x93'),'IS\x20EMPTY',_0x7196('0x6c')],_0x520fe8);};var _0x425a57=function(_0x302728){if(!_0x302728||!_0x302728[_0x7196('0x6d')][_0x7196('0x3c')]){return'';}for(var _0x14492e='(',_0x58df43=0x0;_0x58df43<_0x302728[_0x7196('0x6d')][_0x7196('0x3c')];_0x58df43+=0x1){_0x58df43>0x0&&(_0x14492e+='\x20'+_0x302728[_0x7196('0x6e')]+'\x20');_0x14492e+=_0x302728['rules'][_0x58df43][_0x7196('0x6f')]?_0x425a57(_0x302728[_0x7196('0x6d')][_0x58df43][_0x7196('0x6f')]):_0x302728['rules'][_0x58df43]['field']+'\x20'+_0x302728[_0x7196('0x6d')][_0x58df43][_0x7196('0x71')]+(_0x5236a0(_0x302728[_0x7196('0x6d')][_0x58df43][_0x7196('0x71')])?'\x20'+_0x302728[_0x7196('0x6d')][_0x58df43][_0x7196('0x72')]:'');}return _0x14492e+')';};var _0x1a8a5a={'where':{'id':_0x5a3c87[_0x7196('0x59')]['id']}},_0x2944e5,_0x3f9385,_0xbd94ef,_0x5d2a56,_0x2fb552;_0x1a8a5a=_['merge']({},_0x1a8a5a,_0x5a3c87[_0x7196('0x46')]);return db[_0x7196('0x30')]['find'](_0x1a8a5a)[_0x7196('0x28')](function(_0x386259){if(_0x386259){_0x2944e5=_0x386259;return _0x386259[_0x7196('0x73')]();}return null;})[_0x7196('0x28')](function(_0x1e7a64){if(_0x1e7a64){if(!_0x1e7a64[_0x7196('0x3c')]){throw new db['Sequelize']['ValidationErrorItem'](_0x7196('0x75'),0x193);}_0x3f9385=_0x1e7a64;return db['AnalyticMetric'][_0x7196('0x48')]({'raw':!![]});}return null;})[_0x7196('0x28')](function(_0x30db09){if(_0x30db09){_0xbd94ef=_['keyBy'](_0x30db09,'id');var _0x4729e1;var _0x66e1e6=squel[_0x7196('0xa8')]();_0x66e1e6[_0x7196('0x78')](_0x2944e5[_0x7196('0x94')]);for(var _0x1e2105=0x0;_0x1e2105<_0x3f9385[_0x7196('0x3c')];_0x1e2105+=0x1){_0x4729e1=_0x3f9385[_0x1e2105][_0x7196('0x79')]?_0xbd94ef[_0x3f9385[_0x1e2105][_0x7196('0x79')]]['metric']:_0x3f9385[_0x1e2105][_0x7196('0x70')];_0x4729e1=_0x3f9385[_0x1e2105][_0x7196('0x7b')]?_[_0x7196('0x7c')](_0x9055af[_0x3f9385[_0x1e2105][_0x7196('0x7b')]],'%s',_0x4729e1):_0x4729e1;_0x4729e1=_0x3f9385[_0x1e2105][_0x7196('0x7d')]?_[_0x7196('0x7c')](_0xab9595[_0x3f9385[_0x1e2105]['format']],'%s',_0x4729e1):_0x4729e1;if(_0x3f9385[_0x1e2105][_0x7196('0x7e')]){_0x66e1e6['group'](_0x4729e1);}_0x3f9385[_0x1e2105][_0x7196('0x7f')]&&_0x66e1e6[_0x7196('0x3f')](_0x4729e1,_0x3f9385[_0x1e2105][_0x7196('0x7f')]==='DESC'?![]:!![]);_0x66e1e6['field'](_0x4729e1,_0x3f9385[_0x1e2105][_0x7196('0x81')]||_0x4729e1);}if(_0x2944e5[_0x7196('0x82')]){_0x2944e5[_0x7196('0x82')]=JSON[_0x7196('0x83')](_0x2944e5[_0x7196('0x82')]);for(var _0x220315=0x0;_0x220315<_0x2944e5[_0x7196('0x82')][_0x7196('0x3c')];_0x220315+=0x1){if(_0x2944e5['joins'][_0x220315][_0x7196('0x33')]&&_[_0x7196('0x69')](_0x144613,_0x2944e5['joins'][_0x220315][_0x7196('0x33')])&&_0x2944e5[_0x7196('0x82')][_0x220315][_0x7196('0x86')]&&_0x2944e5['joins'][_0x220315][_0x7196('0x84')]&&_0x2944e5[_0x7196('0x82')][_0x220315][_0x7196('0x87')]){_0x66e1e6[_0x2944e5[_0x7196('0x82')][_0x220315][_0x7196('0x33')]](_0x2944e5['joins'][_0x220315]['foreignTable'],null,util[_0x7196('0x7d')](_0x7196('0x85'),_0x2944e5[_0x7196('0x94')],_0x2944e5[_0x7196('0x82')][_0x220315][_0x7196('0x86')],_0x2944e5[_0x7196('0x82')][_0x220315]['foreignTable'],_0x2944e5[_0x7196('0x82')][_0x220315][_0x7196('0x87')]));}}}if(_0x2944e5[_0x7196('0x88')]){_0x2944e5[_0x7196('0x88')]=JSON['parse'](_0x2944e5[_0x7196('0x88')]);_0x66e1e6[_0x7196('0x42')](_0x425a57(_0x2944e5[_0x7196('0x88')][_0x7196('0x6f')]));}_0x2fb552=_0x66e1e6[_0x7196('0x89')]();_0x66e1e6[_0x7196('0x23')](_0x51da79);_0x66e1e6[_0x7196('0x21')](0x0);logger[_0x7196('0x8a')](_0x7196('0x8b'),_0x66e1e6[_0x7196('0x8c')]());return dbH[_0x7196('0x8d')][_0x7196('0x39')](_0x66e1e6['toString'](),{'type':dbH[_0x7196('0x8d')]['QueryTypes'][_0x7196('0x8f')]});}})['then'](function(){return{'sql':_0x2fb552[_0x7196('0x8c')]()};})['then'](respondWithResult(_0x58fb86,null))[_0x7196('0x56')](handleError(_0x58fb86,null));}; \ No newline at end of file +var _0x2675=['AnalyticDefaultReport','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','nolimit','sort','where','filters','pick','VIRTUAL','merge','options','includeAll','include','catch','params','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','Reports','UserProfileSection','find','userProfileId','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','preview','join','left_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','DATE(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20NOT\x20EMPTY','rules','operator','group','condition','value','getFields','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','findAll','select','table','MetricId','metric','field','function','replace','format','groupBy','order','orderBy','DESC','joins','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','conditions','parse','clone','toString','sequelize','QueryTypes','right_join','SEC_TO_TIME(%s)','IS\x20EMPTY','Sequelize','keyBy','from','alias','output','randomstring','generate','csv','default','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','info','Run\x20Query:','child_process','fork','../../files/reports','savename','COUNT(*)','SELECT','run','runReport','MIN(%s)','debug','eml-format','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','dbH','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','destroy','then','get','DefaultReports','name','map'];(function(_0x1eaf5e,_0x333d16){var _0x409fa2=function(_0x57f633){while(--_0x57f633){_0x1eaf5e['push'](_0x1eaf5e['shift']());}};_0x409fa2(++_0x333d16);}(_0x2675,0x75));var _0x5267=function(_0x5a66dc,_0x29bb95){_0x5a66dc=_0x5a66dc-0x0;var _0x5bbf22=_0x2675[_0x5a66dc];return _0x5bbf22;};'use strict';var emlformat=require(_0x5267('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x5267('0x1'));var moment=require(_0x5267('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x5267('0x3'));var util=require(_0x5267('0x4'));var path=require('path');var sox=require(_0x5267('0x5'));var csv=require(_0x5267('0x6'));var ejs=require(_0x5267('0x7'));var fs=require('fs');var fs_extra=require(_0x5267('0x8'));var _=require(_0x5267('0x9'));var squel=require(_0x5267('0xa'));var crypto=require('crypto');var jsforce=require(_0x5267('0xb'));var deskjs=require(_0x5267('0xc'));var toCsv=require('to-csv');var querystring=require(_0x5267('0xd'));var Papa=require('papaparse');var Redis=require(_0x5267('0xe'));var authService=require(_0x5267('0xf'));var qs=require(_0x5267('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5267('0x11'));var logger=require('../../config/logger')(_0x5267('0x12'));var utils=require('../../config/utils');var config=require(_0x5267('0x13'));var licenseUtil=require(_0x5267('0x14'));var db=require(_0x5267('0x15'))['db'];var dbH=require(_0x5267('0x15'))[_0x5267('0x16')];function respondWithStatusCode(_0x1171b9,_0x20785c){_0x20785c=_0x20785c||0xcc;return function(_0x36dc17){if(_0x36dc17){return _0x1171b9[_0x5267('0x17')](_0x20785c);}return _0x1171b9[_0x5267('0x18')](_0x20785c)[_0x5267('0x19')]();};}function respondWithResult(_0x29349a,_0x3e2bab){_0x3e2bab=_0x3e2bab||0xc8;return function(_0x548040){if(_0x548040){return _0x29349a['status'](_0x3e2bab)[_0x5267('0x1a')](_0x548040);}};}function respondWithFilteredResult(_0x40d897,_0x38a147){return function(_0x3f5344){if(_0x3f5344){var _0x46b2c2=typeof _0x38a147[_0x5267('0x1b')]===_0x5267('0x1c')&&typeof _0x38a147[_0x5267('0x1d')]===_0x5267('0x1c');var _0xb1c97a=_0x3f5344[_0x5267('0x1e')];var _0x1ab03=_0x46b2c2?0x0:_0x38a147['offset'];var _0x18f32e=_0x46b2c2?_0x3f5344[_0x5267('0x1e')]:_0x38a147['offset']+_0x38a147[_0x5267('0x1d')];var _0x56733e;if(_0x18f32e>=_0xb1c97a){_0x18f32e=_0xb1c97a;_0x56733e=0xc8;}else{_0x56733e=0xce;}_0x40d897[_0x5267('0x18')](_0x56733e);return _0x40d897[_0x5267('0x1f')](_0x5267('0x20'),_0x1ab03+'-'+_0x18f32e+'/'+_0xb1c97a)[_0x5267('0x1a')](_0x3f5344);}return null;};}function patchUpdates(_0x5ca9c6){return function(_0x4dd637){try{jsonpatch[_0x5267('0x21')](_0x4dd637,_0x5ca9c6,!![]);}catch(_0x5aebdd){return BPromise[_0x5267('0x22')](_0x5aebdd);}return _0x4dd637[_0x5267('0x23')]();};}function saveUpdates(_0x3b53ac,_0x56dd95){return function(_0x499f19){if(_0x499f19){return _0x499f19['update'](_0x3b53ac)['then'](function(_0x5ea6a6){return _0x5ea6a6;});}return null;};}function removeEntity(_0x26c7f8,_0x399e64){return function(_0x2d761d){if(_0x2d761d){return _0x2d761d[_0x5267('0x24')]()[_0x5267('0x25')](function(){var _0x40d1be=_0x2d761d[_0x5267('0x26')]({'plain':!![]});var _0x220e03=_0x5267('0x27');return db['UserProfileResource']['destroy']({'where':{'type':_0x220e03,'resourceId':_0x40d1be['id']}})[_0x5267('0x25')](function(){return _0x2d761d;});})[_0x5267('0x25')](function(){_0x26c7f8['status'](0xcc)[_0x5267('0x19')]();});}};}function handleEntityNotFound(_0x52504e,_0x4d7c2a){return function(_0x43e7e7){if(!_0x43e7e7){_0x52504e[_0x5267('0x17')](0x194);}return _0x43e7e7;};}function handleError(_0x1f33b7,_0x2d2ace){_0x2d2ace=_0x2d2ace||0x1f4;return function(_0x33c431){logger['error'](_0x33c431['stack']);if(_0x33c431[_0x5267('0x28')]){delete _0x33c431[_0x5267('0x28')];}_0x1f33b7[_0x5267('0x18')](_0x2d2ace)['send'](_0x33c431);};}exports['index']=function(_0xbe7922,_0x3ef2a8){var _0x1fa725={},_0x5bec7e={},_0x59b091={'count':0x0,'rows':[]};var _0x2249a1=_[_0x5267('0x29')](db[_0x5267('0x2a')][_0x5267('0x2b')],function(_0x5bbb83){return{'name':_0x5bbb83[_0x5267('0x2c')],'type':_0x5bbb83[_0x5267('0x2d')][_0x5267('0x2e')]};});_0x5bec7e[_0x5267('0x2f')]=_[_0x5267('0x29')](_0x2249a1,_0x5267('0x28'));_0x5bec7e[_0x5267('0x30')]=_[_0x5267('0x31')](_0xbe7922['query']);_0x5bec7e['filters']=_[_0x5267('0x32')](_0x5bec7e['model'],_0x5bec7e[_0x5267('0x30')]);_0x1fa725[_0x5267('0x33')]=_[_0x5267('0x32')](_0x5bec7e[_0x5267('0x2f')],qs['fields'](_0xbe7922[_0x5267('0x30')][_0x5267('0x34')]));_0x1fa725[_0x5267('0x33')]=_0x1fa725[_0x5267('0x33')][_0x5267('0x35')]?_0x1fa725[_0x5267('0x33')]:_0x5bec7e[_0x5267('0x2f')];if(!_0xbe7922[_0x5267('0x30')]['hasOwnProperty'](_0x5267('0x36'))){_0x1fa725['limit']=qs[_0x5267('0x1d')](_0xbe7922[_0x5267('0x30')][_0x5267('0x1d')]);_0x1fa725[_0x5267('0x1b')]=qs[_0x5267('0x1b')](_0xbe7922[_0x5267('0x30')][_0x5267('0x1b')]);}_0x1fa725['order']=qs[_0x5267('0x37')](_0xbe7922[_0x5267('0x30')][_0x5267('0x37')]);_0x1fa725[_0x5267('0x38')]=qs[_0x5267('0x39')](_[_0x5267('0x3a')](_0xbe7922[_0x5267('0x30')],_0x5bec7e['filters']),_0x2249a1);if(_0xbe7922[_0x5267('0x30')]['filter']){_0x1fa725[_0x5267('0x38')]=_['merge'](_0x1fa725['where'],{'$or':_['map'](_0x2249a1,function(_0x46bfcc){if(_0x46bfcc['type']!==_0x5267('0x3b')){var _0x146476={};_0x146476[_0x46bfcc[_0x5267('0x28')]]={'$like':'%'+_0xbe7922[_0x5267('0x30')]['filter']+'%'};return _0x146476;}})});}_0x1fa725=_[_0x5267('0x3c')]({},_0x1fa725,_0xbe7922[_0x5267('0x3d')]);var _0x588edf={'where':_0x1fa725['where']};return db[_0x5267('0x2a')]['count'](_0x588edf)[_0x5267('0x25')](function(_0x1cf94a){_0x59b091[_0x5267('0x1e')]=_0x1cf94a;if(_0xbe7922[_0x5267('0x30')][_0x5267('0x3e')]){_0x1fa725[_0x5267('0x3f')]=[{'all':!![]}];}return db[_0x5267('0x2a')]['findAll'](_0x1fa725);})['then'](function(_0x28ea4a){_0x59b091['rows']=_0x28ea4a;return _0x59b091;})[_0x5267('0x25')](respondWithFilteredResult(_0x3ef2a8,_0x1fa725))[_0x5267('0x40')](handleError(_0x3ef2a8,null));};exports['show']=function(_0x1fa925,_0xc764cd){var _0x299a13={'raw':!![],'where':{'id':_0x1fa925[_0x5267('0x41')]['id']}},_0x161fed={};_0x161fed[_0x5267('0x2f')]=_[_0x5267('0x31')](db[_0x5267('0x2a')][_0x5267('0x2b')]);_0x161fed['query']=_[_0x5267('0x31')](_0x1fa925[_0x5267('0x30')]);_0x161fed[_0x5267('0x39')]=_[_0x5267('0x32')](_0x161fed[_0x5267('0x2f')],_0x161fed['query']);_0x299a13[_0x5267('0x33')]=_['intersection'](_0x161fed[_0x5267('0x2f')],qs['fields'](_0x1fa925['query'][_0x5267('0x34')]));_0x299a13['attributes']=_0x299a13[_0x5267('0x33')][_0x5267('0x35')]?_0x299a13[_0x5267('0x33')]:_0x161fed[_0x5267('0x2f')];if(_0x1fa925['query'][_0x5267('0x3e')]){_0x299a13['include']=[{'all':!![]}];}_0x299a13=_['merge']({},_0x299a13,_0x1fa925[_0x5267('0x3d')]);return db[_0x5267('0x2a')]['find'](_0x299a13)['then'](handleEntityNotFound(_0xc764cd,null))[_0x5267('0x25')](respondWithResult(_0xc764cd,null))[_0x5267('0x40')](handleError(_0xc764cd,null));};exports[_0x5267('0x42')]=function(_0x1b5a7e,_0x1c2803){return db[_0x5267('0x2a')][_0x5267('0x42')](_0x1b5a7e[_0x5267('0x43')],{})[_0x5267('0x25')](function(_0x2cfe09){var _0x21b040=_0x1b5a7e[_0x5267('0x44')][_0x5267('0x26')]({'plain':!![]});if(!_0x21b040)throw new Error(_0x5267('0x45'));if(_0x21b040['role']===_0x5267('0x44')){var _0x466d46=_0x2cfe09[_0x5267('0x26')]({'plain':!![]});var _0x4f0148=_0x5267('0x46');return db[_0x5267('0x47')][_0x5267('0x48')]({'where':{'name':_0x4f0148,'userProfileId':_0x21b040[_0x5267('0x49')]},'raw':!![]})[_0x5267('0x25')](function(_0x1457cf){if(_0x1457cf&&_0x1457cf['autoAssociation']===0x0){return db[_0x5267('0x4a')]['create']({'name':_0x466d46[_0x5267('0x28')],'resourceId':_0x466d46['id'],'type':_0x5267('0x27'),'sectionId':_0x1457cf['id']},{})[_0x5267('0x25')](function(){return _0x2cfe09;});}else{return _0x2cfe09;}})[_0x5267('0x40')](function(_0x91b932){logger[_0x5267('0x4b')](_0x5267('0x4c'),_0x91b932);throw _0x91b932;});}return _0x2cfe09;})['then'](respondWithResult(_0x1c2803,0xc9))['catch'](handleError(_0x1c2803,null));};exports[_0x5267('0x4d')]=function(_0x15b5c9,_0x566b6f){if(_0x15b5c9[_0x5267('0x43')]['id']){delete _0x15b5c9['body']['id'];}return db['AnalyticDefaultReport'][_0x5267('0x48')]({'where':{'id':_0x15b5c9[_0x5267('0x41')]['id']}})[_0x5267('0x25')](handleEntityNotFound(_0x566b6f,null))[_0x5267('0x25')](saveUpdates(_0x15b5c9[_0x5267('0x43')],null))[_0x5267('0x25')](respondWithResult(_0x566b6f,null))[_0x5267('0x40')](handleError(_0x566b6f,null));};exports[_0x5267('0x24')]=function(_0xf0b5a9,_0x43d254){return db['AnalyticDefaultReport'][_0x5267('0x48')]({'where':{'id':_0xf0b5a9[_0x5267('0x41')]['id']}})[_0x5267('0x25')](handleEntityNotFound(_0x43d254,null))[_0x5267('0x25')](removeEntity(_0x43d254,null))[_0x5267('0x40')](handleError(_0x43d254,null));};exports[_0x5267('0x4e')]=function(_0x552211,_0x195575){var _0x5ad1ce=0xa;var _0x1522d6=[_0x5267('0x4f'),_0x5267('0x50'),'right_join',_0x5267('0x51')];var _0x161dab={'SUM':_0x5267('0x52'),'COUNT':_0x5267('0x53'),'COUNT DISTINCT':_0x5267('0x54'),'MAX':_0x5267('0x55'),'MIN':'MIN(%s)','AVG':_0x5267('0x56'),'GROUP_CONCAT':_0x5267('0x57'),'GROUP_CONCAT ASC':_0x5267('0x58'),'GROUP_CONCAT DESC':_0x5267('0x59')};var _0x51220c={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x5267('0x5a'),'HOUR':'HOUR(%s)','ROUND':_0x5267('0x5b'),'UNIX_TIMESTAMP':_0x5267('0x5c')};var _0x4e3771=function(_0x489780){return!_[_0x5267('0x5d')]([_0x5267('0x5e'),_0x5267('0x5f'),'IS\x20EMPTY',_0x5267('0x60')],_0x489780);};var _0xc88193=function(_0x293e61){if(!_0x293e61||!_0x293e61[_0x5267('0x61')]['length']){return'';}for(var _0x5a87b5='(',_0x540ab8=0x0;_0x540ab8<_0x293e61[_0x5267('0x61')][_0x5267('0x35')];_0x540ab8+=0x1){_0x540ab8>0x0&&(_0x5a87b5+='\x20'+_0x293e61[_0x5267('0x62')]+'\x20');_0x5a87b5+=_0x293e61[_0x5267('0x61')][_0x540ab8][_0x5267('0x63')]?_0xc88193(_0x293e61[_0x5267('0x61')][_0x540ab8][_0x5267('0x63')]):_0x293e61[_0x5267('0x61')][_0x540ab8]['field']+'\x20'+_0x293e61[_0x5267('0x61')][_0x540ab8][_0x5267('0x64')]+(_0x4e3771(_0x293e61['rules'][_0x540ab8][_0x5267('0x64')])?'\x20'+_0x293e61[_0x5267('0x61')][_0x540ab8][_0x5267('0x65')]:'');}return _0x5a87b5+')';};var _0x1b6dd7={'where':{'id':_0x552211[_0x5267('0x41')]['id']}},_0x19adf5,_0xde1ecd,_0x4915f4,_0x2ca259,_0x726410;_0x1b6dd7=_[_0x5267('0x3c')]({},_0x1b6dd7,_0x552211[_0x5267('0x3d')]);return db[_0x5267('0x2a')]['find'](_0x1b6dd7)[_0x5267('0x25')](function(_0x87465){if(_0x87465){_0x19adf5=_0x87465;return _0x87465[_0x5267('0x66')]();}return null;})[_0x5267('0x25')](function(_0x1a4016){if(_0x1a4016){if(!_0x1a4016[_0x5267('0x35')]){throw new db['Sequelize'][(_0x5267('0x67'))](_0x5267('0x68'),0x193);}_0xde1ecd=_0x1a4016;return db[_0x5267('0x69')][_0x5267('0x6a')]({'raw':!![]});}return null;})['then'](function(_0x516e6e){if(_0x516e6e){_0x4915f4=_['keyBy'](_0x516e6e,'id');var _0x910f97;var _0x5cca85=squel[_0x5267('0x6b')]();_0x5cca85['from'](_0x19adf5[_0x5267('0x6c')]);for(var _0x1150ba=0x0;_0x1150ba<_0xde1ecd[_0x5267('0x35')];_0x1150ba+=0x1){_0x910f97=_0xde1ecd[_0x1150ba][_0x5267('0x6d')]?_0x4915f4[_0xde1ecd[_0x1150ba][_0x5267('0x6d')]][_0x5267('0x6e')]:_0xde1ecd[_0x1150ba][_0x5267('0x6f')];_0x910f97=_0xde1ecd[_0x1150ba][_0x5267('0x70')]?_['replace'](_0x161dab[_0xde1ecd[_0x1150ba]['function']],'%s',_0x910f97):_0x910f97;_0x910f97=_0xde1ecd[_0x1150ba]['format']?_[_0x5267('0x71')](_0x51220c[_0xde1ecd[_0x1150ba][_0x5267('0x72')]],'%s',_0x910f97):_0x910f97;if(_0xde1ecd[_0x1150ba][_0x5267('0x73')]){_0x5cca85[_0x5267('0x63')](_0x910f97);}_0xde1ecd[_0x1150ba]['orderBy']&&_0x5cca85[_0x5267('0x74')](_0x910f97,_0xde1ecd[_0x1150ba][_0x5267('0x75')]===_0x5267('0x76')?![]:!![]);_0x5cca85[_0x5267('0x6f')](_0x910f97,_0xde1ecd[_0x1150ba]['alias']||_0x910f97);}if(_0x19adf5[_0x5267('0x77')]){_0x19adf5[_0x5267('0x77')]=JSON['parse'](_0x19adf5[_0x5267('0x77')]);for(var _0x268805=0x0;_0x268805<_0x19adf5['joins']['length'];_0x268805+=0x1){if(_0x19adf5[_0x5267('0x77')][_0x268805][_0x5267('0x2d')]&&_['includes'](_0x1522d6,_0x19adf5['joins'][_0x268805][_0x5267('0x2d')])&&_0x19adf5[_0x5267('0x77')][_0x268805][_0x5267('0x78')]&&_0x19adf5[_0x5267('0x77')][_0x268805][_0x5267('0x79')]&&_0x19adf5['joins'][_0x268805][_0x5267('0x7a')]){_0x5cca85[_0x19adf5[_0x5267('0x77')][_0x268805]['type']](_0x19adf5[_0x5267('0x77')][_0x268805][_0x5267('0x79')],null,util[_0x5267('0x72')](_0x5267('0x7b'),_0x19adf5[_0x5267('0x6c')],_0x19adf5[_0x5267('0x77')][_0x268805][_0x5267('0x78')],_0x19adf5[_0x5267('0x77')][_0x268805]['foreignTable'],_0x19adf5['joins'][_0x268805][_0x5267('0x7a')]));}}}if(_0x19adf5[_0x5267('0x7c')]){_0x19adf5[_0x5267('0x7c')]=JSON[_0x5267('0x7d')](_0x19adf5['conditions']);_0x5cca85[_0x5267('0x38')](_0xc88193(_0x19adf5['conditions'][_0x5267('0x63')]));}_0x726410=_0x5cca85[_0x5267('0x7e')]();_0x5cca85[_0x5267('0x1d')](_0x5ad1ce);_0x5cca85[_0x5267('0x1b')](0x0);logger['debug']('Limited\x20Query:',_0x5cca85[_0x5267('0x7f')]());return dbH[_0x5267('0x80')][_0x5267('0x30')](_0x5cca85[_0x5267('0x7f')](),{'type':dbH[_0x5267('0x80')][_0x5267('0x81')]['SELECT']});}})[_0x5267('0x25')](respondWithResult(_0x195575,null))['catch'](handleError(_0x195575,null));};function runReport(_0x418a03,_0x5b8026,_0x2c2b95){var _0x20888d=_0x5b8026[_0x5267('0x28')];var _0x87aa90=0xa;var _0x164cc1=[_0x5267('0x4f'),_0x5267('0x50'),_0x5267('0x82'),_0x5267('0x51')];var _0x28e4b6={'SUM':_0x5267('0x52'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x5267('0x54'),'MAX':_0x5267('0x55'),'MIN':'MIN(%s)','AVG':_0x5267('0x56'),'GROUP_CONCAT':_0x5267('0x57'),'GROUP_CONCAT ASC':_0x5267('0x58'),'GROUP_CONCAT DESC':_0x5267('0x59')};var _0xd18795={'SEC_TO_TIME':_0x5267('0x83'),'DATE':_0x5267('0x5a'),'HOUR':'HOUR(%s)','ROUND':_0x5267('0x5b'),'UNIX_TIMESTAMP':_0x5267('0x5c')};var _0x2543a4=function(_0x2feea8){return!_[_0x5267('0x5d')](['IS\x20NULL','IS\x20NOT\x20NULL',_0x5267('0x84'),_0x5267('0x60')],_0x2feea8);};var _0x199ff6=function(_0xbf36fb){if(!_0xbf36fb||!_0xbf36fb['rules'][_0x5267('0x35')]){return'';}for(var _0x3cc775='(',_0x2630f2=0x0;_0x2630f2<_0xbf36fb[_0x5267('0x61')][_0x5267('0x35')];_0x2630f2+=0x1){_0x2630f2>0x0&&(_0x3cc775+='\x20'+_0xbf36fb[_0x5267('0x62')]+'\x20');_0x3cc775+=_0xbf36fb[_0x5267('0x61')][_0x2630f2][_0x5267('0x63')]?_0x199ff6(_0xbf36fb[_0x5267('0x61')][_0x2630f2][_0x5267('0x63')]):_0xbf36fb[_0x5267('0x61')][_0x2630f2][_0x5267('0x6f')]+'\x20'+_0xbf36fb[_0x5267('0x61')][_0x2630f2]['condition']+(_0x2543a4(_0xbf36fb[_0x5267('0x61')][_0x2630f2][_0x5267('0x64')])?'\x20'+_0xbf36fb[_0x5267('0x61')][_0x2630f2][_0x5267('0x65')]:'');}return _0x3cc775+')';};var _0x447b5f={'where':{'id':_0x418a03['id']}},_0x25ce90,_0x257c69,_0x160c9c,_0x42694a,_0x11a2f4;_0x447b5f=_[_0x5267('0x3c')]({},_0x447b5f,_0x2c2b95);return db[_0x5267('0x2a')][_0x5267('0x48')](_0x447b5f)[_0x5267('0x25')](function(_0x35c3b7){if(_0x35c3b7){_0x25ce90=_0x35c3b7;return _0x35c3b7[_0x5267('0x66')]();}return null;})[_0x5267('0x25')](function(_0x35a4a3){if(_0x35a4a3){if(!_0x35a4a3[_0x5267('0x35')]){throw new db[(_0x5267('0x85'))][(_0x5267('0x67'))](_0x5267('0x68'),0x193);}_0x257c69=_0x35a4a3;return db[_0x5267('0x69')]['findAll']({'raw':!![]});}return null;})[_0x5267('0x25')](function(_0x318393){if(_0x318393){_0x160c9c=_[_0x5267('0x86')](_0x318393,'id');var _0x405eb4;var _0x38f5b7=squel['select']();_0x38f5b7[_0x5267('0x87')](_0x25ce90[_0x5267('0x6c')]);for(var _0x4c68cd=0x0;_0x4c68cd<_0x257c69['length'];_0x4c68cd+=0x1){_0x405eb4=_0x257c69[_0x4c68cd]['MetricId']?_0x160c9c[_0x257c69[_0x4c68cd][_0x5267('0x6d')]]['metric']:_0x257c69[_0x4c68cd][_0x5267('0x6f')];_0x405eb4=_0x257c69[_0x4c68cd]['function']?_['replace'](_0x28e4b6[_0x257c69[_0x4c68cd][_0x5267('0x70')]],'%s',_0x405eb4):_0x405eb4;_0x405eb4=_0x257c69[_0x4c68cd][_0x5267('0x72')]?_[_0x5267('0x71')](_0xd18795[_0x257c69[_0x4c68cd][_0x5267('0x72')]],'%s',_0x405eb4):_0x405eb4;if(_0x257c69[_0x4c68cd][_0x5267('0x73')]){_0x38f5b7['group'](_0x405eb4);}_0x257c69[_0x4c68cd]['orderBy']&&_0x38f5b7[_0x5267('0x74')](_0x405eb4,_0x257c69[_0x4c68cd][_0x5267('0x75')]===_0x5267('0x76')?![]:!![]);_0x38f5b7[_0x5267('0x6f')](_0x405eb4,_0x257c69[_0x4c68cd][_0x5267('0x88')]||_0x405eb4);}if(_0x25ce90['joins']){_0x25ce90[_0x5267('0x77')]=JSON['parse'](_0x25ce90['joins']);for(var _0x3dfd8d=0x0;_0x3dfd8d<_0x25ce90['joins']['length'];_0x3dfd8d+=0x1){if(_0x25ce90[_0x5267('0x77')][_0x3dfd8d][_0x5267('0x2d')]&&_['includes'](_0x164cc1,_0x25ce90['joins'][_0x3dfd8d]['type'])&&_0x25ce90[_0x5267('0x77')][_0x3dfd8d]['parentKey']&&_0x25ce90[_0x5267('0x77')][_0x3dfd8d]['foreignTable']&&_0x25ce90[_0x5267('0x77')][_0x3dfd8d][_0x5267('0x7a')]){_0x38f5b7[_0x25ce90['joins'][_0x3dfd8d][_0x5267('0x2d')]](_0x25ce90[_0x5267('0x77')][_0x3dfd8d][_0x5267('0x79')],null,util[_0x5267('0x72')](_0x5267('0x7b'),_0x25ce90[_0x5267('0x6c')],_0x25ce90['joins'][_0x3dfd8d]['parentKey'],_0x25ce90[_0x5267('0x77')][_0x3dfd8d]['foreignTable'],_0x25ce90['joins'][_0x3dfd8d][_0x5267('0x7a')]));}}}if(_0x25ce90['conditions']){_0x25ce90[_0x5267('0x7c')]=JSON['parse'](_0x25ce90[_0x5267('0x7c')]);_0x38f5b7['where'](_0x199ff6(_0x25ce90[_0x5267('0x7c')][_0x5267('0x63')]));}_0x11a2f4=_0x38f5b7[_0x5267('0x7e')]();_0x38f5b7[_0x5267('0x1d')](_0x87aa90);_0x38f5b7[_0x5267('0x1b')](0x0);return;}})[_0x5267('0x25')](function(){if(_0x5b8026[_0x5267('0x89')]==='web'){return null;}var _0x4df99f=_[_0x5267('0x3c')](_0x5b8026,{'name':_0x5b8026['fullPath']||_0x5b8026['name']||_0x25ce90['name'],'basename':_0x20888d,'savename':util['format']('%s-%s.%s',_0x5b8026['name']||_0x25ce90[_0x5267('0x28')],require(_0x5267('0x8a'))[_0x5267('0x8b')](0x4),_0x5b8026[_0x5267('0x89')]||_0x5267('0x8c')),'reportId':_0x25ce90['id'],'reportType':_0x5267('0x8d')});return db[_0x5267('0x8e')][_0x5267('0x42')](_0x4df99f,{'raw':!![]});})['then'](function(_0x5df23d){if(_0x25ce90['table']===_0x5267('0x8f')){_0x11a2f4[_0x5267('0x38')](_0x25ce90['table']+_0x5267('0x90'),_0x5b8026[_0x5267('0x91')],_0x5b8026[_0x5267('0x92')]);}else{_0x11a2f4[_0x5267('0x38')](_0x25ce90['table']+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x5b8026[_0x5267('0x91')],_0x5b8026[_0x5267('0x92')]);}if(_0x5df23d){logger[_0x5267('0x93')](_0x5267('0x94'),_0x11a2f4[_0x5267('0x7f')]());require(_0x5267('0x95'))[_0x5267('0x96')](path['join'](__dirname,'../../components/export/',_0x5df23d['output']),[_0x5df23d['id'],_0x11a2f4[_0x5267('0x7f')](),path[_0x5267('0x4f')](__dirname,_0x5267('0x97'),_0x5df23d[_0x5267('0x98')]),_0x20888d]);return _0x5df23d;}else{var _0x190ef4=squel[_0x5267('0x6b')]();_0x190ef4['from']('('+_0x11a2f4[_0x5267('0x7f')]()+')','countTable');_0x190ef4[_0x5267('0x6f')](_0x5267('0x99'),_0x5267('0x1e'));_0x11a2f4[_0x5267('0x1d')](_0x5b8026[_0x5267('0x1d')]||_0x87aa90);_0x11a2f4['offset'](_0x5b8026[_0x5267('0x1b')]||0x0);return dbH[_0x5267('0x80')][_0x5267('0x30')](_0x190ef4['toString'](),{'type':dbH['sequelize']['QueryTypes'][_0x5267('0x9a')]})[_0x5267('0x25')](function(_0x1be763){if(!_0x1be763[_0x5267('0x35')]){_0x42694a=0x0;}else{_0x42694a=_0x1be763[0x0]['count']||0x0;}return dbH['sequelize'][_0x5267('0x30')](_0x11a2f4[_0x5267('0x7f')](),{'type':dbH['sequelize'][_0x5267('0x81')][_0x5267('0x9a')]});})['then'](function(_0x5005b3){return{'rows':_0x5005b3||[],'count':_0x42694a};});}});}exports[_0x5267('0x9b')]=function(_0x11a6f4,_0x5a16ee){return runReport(_0x11a6f4[_0x5267('0x41')],_0x11a6f4[_0x5267('0x30')],_0x11a6f4[_0x5267('0x3d')])[_0x5267('0x25')](respondWithResult(_0x5a16ee,null))[_0x5267('0x40')](handleError(_0x5a16ee,null));};exports[_0x5267('0x9c')]=runReport;exports[_0x5267('0x30')]=function(_0x1e9651,_0x66da7a){var _0x54b582=0xa;var _0x4e4724=[_0x5267('0x4f'),'left_join',_0x5267('0x82'),_0x5267('0x51')];var _0x2722f9={'SUM':_0x5267('0x52'),'COUNT':_0x5267('0x53'),'COUNT DISTINCT':_0x5267('0x54'),'MAX':_0x5267('0x55'),'MIN':_0x5267('0x9d'),'AVG':_0x5267('0x56'),'GROUP_CONCAT':_0x5267('0x57'),'GROUP_CONCAT ASC':_0x5267('0x58'),'GROUP_CONCAT DESC':_0x5267('0x59')};var _0x5909b3={'SEC_TO_TIME':_0x5267('0x83'),'DATE':'DATE(%s)','HOUR':'HOUR(%s)','ROUND':_0x5267('0x5b'),'UNIX_TIMESTAMP':_0x5267('0x5c')};var _0x1d7987=function(_0x59efe1){return!_[_0x5267('0x5d')]([_0x5267('0x5e'),_0x5267('0x5f'),_0x5267('0x84'),_0x5267('0x60')],_0x59efe1);};var _0x46c79e=function(_0xcfba51){if(!_0xcfba51||!_0xcfba51[_0x5267('0x61')][_0x5267('0x35')]){return'';}for(var _0x3c5516='(',_0x1e8367=0x0;_0x1e8367<_0xcfba51[_0x5267('0x61')]['length'];_0x1e8367+=0x1){_0x1e8367>0x0&&(_0x3c5516+='\x20'+_0xcfba51[_0x5267('0x62')]+'\x20');_0x3c5516+=_0xcfba51[_0x5267('0x61')][_0x1e8367]['group']?_0x46c79e(_0xcfba51[_0x5267('0x61')][_0x1e8367][_0x5267('0x63')]):_0xcfba51[_0x5267('0x61')][_0x1e8367][_0x5267('0x6f')]+'\x20'+_0xcfba51['rules'][_0x1e8367][_0x5267('0x64')]+(_0x1d7987(_0xcfba51[_0x5267('0x61')][_0x1e8367][_0x5267('0x64')])?'\x20'+_0xcfba51['rules'][_0x1e8367][_0x5267('0x65')]:'');}return _0x3c5516+')';};var _0x19935d={'where':{'id':_0x1e9651[_0x5267('0x41')]['id']}},_0x3102e0,_0x2d215e,_0xc0af94,_0x178080,_0x3485ab;_0x19935d=_[_0x5267('0x3c')]({},_0x19935d,_0x1e9651['options']);return db[_0x5267('0x2a')][_0x5267('0x48')](_0x19935d)['then'](function(_0x17d2d4){if(_0x17d2d4){_0x3102e0=_0x17d2d4;return _0x17d2d4['getFields']();}return null;})[_0x5267('0x25')](function(_0x4c5a26){if(_0x4c5a26){if(!_0x4c5a26[_0x5267('0x35')]){throw new db[(_0x5267('0x85'))]['ValidationErrorItem']('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x2d215e=_0x4c5a26;return db[_0x5267('0x69')][_0x5267('0x6a')]({'raw':!![]});}return null;})[_0x5267('0x25')](function(_0x1a0883){if(_0x1a0883){_0xc0af94=_[_0x5267('0x86')](_0x1a0883,'id');var _0x501da6;var _0x3dcf73=squel['select']();_0x3dcf73['from'](_0x3102e0['table']);for(var _0x1ded05=0x0;_0x1ded05<_0x2d215e[_0x5267('0x35')];_0x1ded05+=0x1){_0x501da6=_0x2d215e[_0x1ded05][_0x5267('0x6d')]?_0xc0af94[_0x2d215e[_0x1ded05][_0x5267('0x6d')]][_0x5267('0x6e')]:_0x2d215e[_0x1ded05][_0x5267('0x6f')];_0x501da6=_0x2d215e[_0x1ded05][_0x5267('0x70')]?_['replace'](_0x2722f9[_0x2d215e[_0x1ded05]['function']],'%s',_0x501da6):_0x501da6;_0x501da6=_0x2d215e[_0x1ded05][_0x5267('0x72')]?_[_0x5267('0x71')](_0x5909b3[_0x2d215e[_0x1ded05][_0x5267('0x72')]],'%s',_0x501da6):_0x501da6;if(_0x2d215e[_0x1ded05][_0x5267('0x73')]){_0x3dcf73[_0x5267('0x63')](_0x501da6);}_0x2d215e[_0x1ded05]['orderBy']&&_0x3dcf73[_0x5267('0x74')](_0x501da6,_0x2d215e[_0x1ded05][_0x5267('0x75')]===_0x5267('0x76')?![]:!![]);_0x3dcf73[_0x5267('0x6f')](_0x501da6,_0x2d215e[_0x1ded05][_0x5267('0x88')]||_0x501da6);}if(_0x3102e0['joins']){_0x3102e0[_0x5267('0x77')]=JSON[_0x5267('0x7d')](_0x3102e0[_0x5267('0x77')]);for(var _0x4bfafd=0x0;_0x4bfafd<_0x3102e0[_0x5267('0x77')]['length'];_0x4bfafd+=0x1){if(_0x3102e0[_0x5267('0x77')][_0x4bfafd][_0x5267('0x2d')]&&_['includes'](_0x4e4724,_0x3102e0[_0x5267('0x77')][_0x4bfafd]['type'])&&_0x3102e0[_0x5267('0x77')][_0x4bfafd][_0x5267('0x78')]&&_0x3102e0['joins'][_0x4bfafd][_0x5267('0x79')]&&_0x3102e0[_0x5267('0x77')][_0x4bfafd]['foreignKey']){_0x3dcf73[_0x3102e0[_0x5267('0x77')][_0x4bfafd][_0x5267('0x2d')]](_0x3102e0[_0x5267('0x77')][_0x4bfafd][_0x5267('0x79')],null,util[_0x5267('0x72')]('%s.%s\x20=\x20%s.%s',_0x3102e0['table'],_0x3102e0[_0x5267('0x77')][_0x4bfafd][_0x5267('0x78')],_0x3102e0['joins'][_0x4bfafd][_0x5267('0x79')],_0x3102e0['joins'][_0x4bfafd][_0x5267('0x7a')]));}}}if(_0x3102e0[_0x5267('0x7c')]){_0x3102e0[_0x5267('0x7c')]=JSON[_0x5267('0x7d')](_0x3102e0[_0x5267('0x7c')]);_0x3dcf73[_0x5267('0x38')](_0x46c79e(_0x3102e0[_0x5267('0x7c')][_0x5267('0x63')]));}_0x3485ab=_0x3dcf73[_0x5267('0x7e')]();_0x3dcf73[_0x5267('0x1d')](_0x54b582);_0x3dcf73[_0x5267('0x1b')](0x0);logger[_0x5267('0x9e')]('Limited\x20Query:',_0x3dcf73[_0x5267('0x7f')]());return dbH[_0x5267('0x80')][_0x5267('0x30')](_0x3dcf73[_0x5267('0x7f')](),{'type':dbH[_0x5267('0x80')][_0x5267('0x81')][_0x5267('0x9a')]});}})[_0x5267('0x25')](function(){return{'sql':_0x3485ab[_0x5267('0x7f')]()};})[_0x5267('0x25')](respondWithResult(_0x66da7a,null))[_0x5267('0x40')](handleError(_0x66da7a,null));}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js index ee32f7c..0fdcd95 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 _0xb7c1=['analytics_default_reports','lodash','../../config/logger','moment','bluebird','request-promise','path','rimraf','define','AnalyticDefaultReport'];(function(_0x3ef4b8,_0x25f619){var _0x541717=function(_0xaddbc7){while(--_0xaddbc7){_0x3ef4b8['push'](_0x3ef4b8['shift']());}};_0x541717(++_0x25f619);}(_0xb7c1,0x1c3));var _0x1b7c=function(_0x25d4a7,_0x4a29e5){_0x25d4a7=_0x25d4a7-0x0;var _0x100eac=_0xb7c1[_0x25d4a7];return _0x100eac;};'use strict';var _=require(_0x1b7c('0x0'));var util=require('util');var logger=require(_0x1b7c('0x1'))('api');var moment=require(_0x1b7c('0x2'));var BPromise=require(_0x1b7c('0x3'));var rp=require(_0x1b7c('0x4'));var fs=require('fs');var path=require(_0x1b7c('0x5'));var rimraf=require(_0x1b7c('0x6'));var config=require('../../config/environment');var attributes=require('./analyticDefaultReport.attributes');module['exports']=function(_0x48e54b,_0x16d234){return _0x48e54b[_0x1b7c('0x7')](_0x1b7c('0x8'),attributes,{'tableName':_0x1b7c('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6aa2=['analytics_default_reports','util','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','./analyticDefaultReport.attributes','exports','AnalyticDefaultReport'];(function(_0x19cce8,_0x23a814){var _0x575f93=function(_0x515f8b){while(--_0x515f8b){_0x19cce8['push'](_0x19cce8['shift']());}};_0x575f93(++_0x23a814);}(_0x6aa2,0x1f0));var _0x26aa=function(_0x1c97c8,_0x28d564){_0x1c97c8=_0x1c97c8-0x0;var _0x2c096d=_0x6aa2[_0x1c97c8];return _0x2c096d;};'use strict';var _=require('lodash');var util=require(_0x26aa('0x0'));var logger=require(_0x26aa('0x1'))('api');var moment=require('moment');var BPromise=require(_0x26aa('0x2'));var rp=require(_0x26aa('0x3'));var fs=require('fs');var path=require(_0x26aa('0x4'));var rimraf=require(_0x26aa('0x5'));var config=require(_0x26aa('0x6'));var attributes=require(_0x26aa('0x7'));module[_0x26aa('0x8')]=function(_0x297863,_0x1c4871){return _0x297863['define'](_0x26aa('0x9'),attributes,{'tableName':_0x26aa('0xa'),'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 3411767..20750db 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 _0xb8fc=['util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','then','info','AnalyticDefaultReport,\x20%s,\x20%s','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','lodash'];(function(_0x14d45f,_0x2d0dbb){var _0x176c80=function(_0x3c2046){while(--_0x3c2046){_0x14d45f['push'](_0x14d45f['shift']());}};_0x176c80(++_0x2d0dbb);}(_0xb8fc,0x1cd));var _0xcb8f=function(_0x22fb5b,_0x4d747a){_0x22fb5b=_0x22fb5b-0x0;var _0xf98be5=_0xb8fc[_0x22fb5b];return _0xf98be5;};'use strict';var _=require(_0xcb8f('0x0'));var util=require(_0xcb8f('0x1'));var moment=require(_0xcb8f('0x2'));var BPromise=require(_0xcb8f('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xcb8f('0x4'));var db=require(_0xcb8f('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xcb8f('0x6'))(_0xcb8f('0x7'));var config=require(_0xcb8f('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xcb8f('0x9')][_0xcb8f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x23f5d3,_0x3fbf84,_0x15ed90){return new BPromise(function(_0x48591c,_0x2b87ac){return client[_0xcb8f('0xb')](_0x23f5d3,_0x15ed90)[_0xcb8f('0xc')](function(_0x557a8b){logger[_0xcb8f('0xd')](_0xcb8f('0xe'),_0x3fbf84,'request\x20sent');logger[_0xcb8f('0xf')](_0xcb8f('0x10'),_0x3fbf84,_0xcb8f('0x11'),JSON[_0xcb8f('0x12')](_0x557a8b));if(_0x557a8b['error']){if(_0x557a8b[_0xcb8f('0x13')][_0xcb8f('0x14')]===0x1f4){logger[_0xcb8f('0x13')](_0xcb8f('0xe'),_0x3fbf84,_0x557a8b['error'][_0xcb8f('0x15')]);return _0x2b87ac(_0x557a8b[_0xcb8f('0x13')][_0xcb8f('0x15')]);}logger['error'](_0xcb8f('0xe'),_0x3fbf84,_0x557a8b[_0xcb8f('0x13')][_0xcb8f('0x15')]);return _0x48591c(_0x557a8b[_0xcb8f('0x13')][_0xcb8f('0x15')]);}else{logger['info'](_0xcb8f('0xe'),_0x3fbf84,'request\x20sent');_0x48591c(_0x557a8b['result'][_0xcb8f('0x15')]);}})['catch'](function(_0x1b60a9){logger[_0xcb8f('0x13')](_0xcb8f('0xe'),_0x3fbf84,_0x1b60a9);_0x2b87ac(_0x1b60a9);});});} \ No newline at end of file +var _0xb24a=['AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify','error','code','AnalyticDefaultReport,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','debug'];(function(_0x26a899,_0x39ab90){var _0x438794=function(_0x2bc763){while(--_0x2bc763){_0x26a899['push'](_0x26a899['shift']());}};_0x438794(++_0x39ab90);}(_0xb24a,0x174));var _0xab24=function(_0x151381,_0x97b314){_0x151381=_0x151381-0x0;var _0x2afab6=_0xb24a[_0x151381];return _0x2afab6;};'use strict';var _=require(_0xab24('0x0'));var util=require(_0xab24('0x1'));var moment=require(_0xab24('0x2'));var BPromise=require(_0xab24('0x3'));var rs=require(_0xab24('0x4'));var fs=require('fs');var Redis=require(_0xab24('0x5'));var db=require(_0xab24('0x6'))['db'];var utils=require(_0xab24('0x7'));var logger=require(_0xab24('0x8'))(_0xab24('0x9'));var config=require(_0xab24('0xa'));var jayson=require(_0xab24('0xb'));var client=jayson[_0xab24('0xc')][_0xab24('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x1b237c,_0x1400b6,_0x116f3c){return new BPromise(function(_0x57e7e9,_0x1099fc){return client[_0xab24('0xe')](_0x1b237c,_0x116f3c)['then'](function(_0x54e62a){logger[_0xab24('0xf')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x1400b6,_0xab24('0x10'));logger[_0xab24('0x11')](_0xab24('0x12'),_0x1400b6,_0xab24('0x10'),JSON[_0xab24('0x13')](_0x54e62a));if(_0x54e62a[_0xab24('0x14')]){if(_0x54e62a[_0xab24('0x14')][_0xab24('0x15')]===0x1f4){logger[_0xab24('0x14')](_0xab24('0x16'),_0x1400b6,_0x54e62a[_0xab24('0x14')][_0xab24('0x17')]);return _0x1099fc(_0x54e62a['error']['message']);}logger[_0xab24('0x14')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x1400b6,_0x54e62a[_0xab24('0x14')][_0xab24('0x17')]);return _0x57e7e9(_0x54e62a[_0xab24('0x14')]['message']);}else{logger[_0xab24('0xf')](_0xab24('0x16'),_0x1400b6,_0xab24('0x10'));_0x57e7e9(_0x54e62a[_0xab24('0x18')][_0xab24('0x17')]);}})[_0xab24('0x19')](function(_0x17bf8b){logger[_0xab24('0x14')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x1400b6,_0x17bf8b);_0x1099fc(_0x17bf8b);});});} \ No newline at end of file diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js index ea19f9c..f3a1562 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 _0x8344=['show','/:id/preview','preview','/:id/run','run','/:id/query','post','create','update','exports','multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticDefaultReport.controller','isAuthenticated','get','/:id'];(function(_0x199572,_0x33e667){var _0x13cfa3=function(_0x53c075){while(--_0x53c075){_0x199572['push'](_0x199572['shift']());}};_0x13cfa3(++_0x33e667);}(_0x8344,0x1c2));var _0x4834=function(_0x4739d9,_0x28a496){_0x4739d9=_0x4739d9-0x0;var _0x421b01=_0x8344[_0x4739d9];return _0x421b01;};'use strict';var multer=require(_0x4834('0x0'));var util=require(_0x4834('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x4834('0x2'));var router=express[_0x4834('0x3')]();var fs_extra=require(_0x4834('0x4'));var auth=require(_0x4834('0x5'));var interaction=require(_0x4834('0x6'));var config=require(_0x4834('0x7'));var controller=require(_0x4834('0x8'));router['get']('/',auth[_0x4834('0x9')](),controller['index']);router[_0x4834('0xa')](_0x4834('0xb'),auth[_0x4834('0x9')](),controller[_0x4834('0xc')]);router[_0x4834('0xa')](_0x4834('0xd'),auth[_0x4834('0x9')](),controller[_0x4834('0xe')]);router[_0x4834('0xa')](_0x4834('0xf'),auth[_0x4834('0x9')](),controller[_0x4834('0x10')]);router[_0x4834('0xa')](_0x4834('0x11'),auth[_0x4834('0x9')](),controller['query']);router[_0x4834('0x12')]('/',auth[_0x4834('0x9')](),controller[_0x4834('0x13')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x4834('0x14')]);router['delete'](_0x4834('0xb'),auth[_0x4834('0x9')](),controller['destroy']);module[_0x4834('0x15')]=router; \ No newline at end of file +var _0x92f3=['get','isAuthenticated','index','/:id','show','/:id/preview','preview','run','query','post','create','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./analyticDefaultReport.controller'];(function(_0x269ee8,_0x477226){var _0x4d98bd=function(_0x20d4c4){while(--_0x20d4c4){_0x269ee8['push'](_0x269ee8['shift']());}};_0x4d98bd(++_0x477226);}(_0x92f3,0xf0));var _0x392f=function(_0x14fda1,_0x5e8ab1){_0x14fda1=_0x14fda1-0x0;var _0x3bade2=_0x92f3[_0x14fda1];return _0x3bade2;};'use strict';var multer=require(_0x392f('0x0'));var util=require(_0x392f('0x1'));var path=require(_0x392f('0x2'));var timeout=require(_0x392f('0x3'));var express=require(_0x392f('0x4'));var router=express[_0x392f('0x5')]();var fs_extra=require(_0x392f('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x392f('0x7'));var config=require(_0x392f('0x8'));var controller=require(_0x392f('0x9'));router[_0x392f('0xa')]('/',auth[_0x392f('0xb')](),controller[_0x392f('0xc')]);router[_0x392f('0xa')](_0x392f('0xd'),auth[_0x392f('0xb')](),controller[_0x392f('0xe')]);router['get'](_0x392f('0xf'),auth['isAuthenticated'](),controller[_0x392f('0x10')]);router['get']('/:id/run',auth[_0x392f('0xb')](),controller[_0x392f('0x11')]);router[_0x392f('0xa')]('/:id/query',auth['isAuthenticated'](),controller[_0x392f('0x12')]);router[_0x392f('0x13')]('/',auth['isAuthenticated'](),controller[_0x392f('0x14')]);router[_0x392f('0x15')]('/:id',auth[_0x392f('0xb')](),controller[_0x392f('0x16')]);router['delete'](_0x392f('0xd'),auth[_0x392f('0xb')](),controller[_0x392f('0x17')]);module[_0x392f('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 409d8d6..206e942 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 _0xa784=['manual','INTEGER','UNSIGNED','sequelize','moment','exports','STRING','csv','pdf','DATE','Loading','ENUM'];(function(_0x4d613c,_0x55f220){var _0x301fe3=function(_0x5eec0b){while(--_0x5eec0b){_0x4d613c['push'](_0x4d613c['shift']());}};_0x301fe3(++_0x55f220);}(_0xa784,0x1cb));var _0x4a78=function(_0x56ef8b,_0x3df1db){_0x56ef8b=_0x56ef8b-0x0;var _0x33099e=_0xa784[_0x56ef8b];return _0x33099e;};'use strict';var Sequelize=require(_0x4a78('0x0'));var moment=require(_0x4a78('0x1'));module[_0x4a78('0x2')]={'name':{'type':Sequelize[_0x4a78('0x3')],'allowNull':![]},'basename':{'type':Sequelize[_0x4a78('0x3')],'allowNull':![]},'output':{'type':Sequelize['ENUM'](_0x4a78('0x4'),_0x4a78('0x5'),'xlsx'),'allowNull':![],'defaultValue':_0x4a78('0x4')},'savename':{'type':Sequelize[_0x4a78('0x3')],'allowNull':![]},'startDate':{'type':Sequelize[_0x4a78('0x6')]},'endDate':{'type':Sequelize['DATE']},'status':{'type':Sequelize[_0x4a78('0x3')],'defaultValue':_0x4a78('0x7')},'type':{'type':Sequelize[_0x4a78('0x8')](_0x4a78('0x9'),'scheduled'),'allowNull':![],'defaultValue':_0x4a78('0x9')},'reportId':{'type':Sequelize[_0x4a78('0xa')](0xb)[_0x4a78('0xb')]},'reportType':{'type':Sequelize[_0x4a78('0x3')]}}; \ No newline at end of file +var _0xe2fa=['ENUM','csv','pdf','manual','scheduled','INTEGER','sequelize','moment','STRING'];(function(_0x476123,_0x47b9cc){var _0x5ca23f=function(_0x44d115){while(--_0x44d115){_0x476123['push'](_0x476123['shift']());}};_0x5ca23f(++_0x47b9cc);}(_0xe2fa,0x7b));var _0xae2f=function(_0x35452d,_0x2b9b36){_0x35452d=_0x35452d-0x0;var _0x5b20ca=_0xe2fa[_0x35452d];return _0x5b20ca;};'use strict';var Sequelize=require(_0xae2f('0x0'));var moment=require(_0xae2f('0x1'));module['exports']={'name':{'type':Sequelize[_0xae2f('0x2')],'allowNull':![]},'basename':{'type':Sequelize[_0xae2f('0x2')],'allowNull':![]},'output':{'type':Sequelize[_0xae2f('0x3')](_0xae2f('0x4'),_0xae2f('0x5'),'xlsx'),'allowNull':![],'defaultValue':_0xae2f('0x4')},'savename':{'type':Sequelize['STRING'],'allowNull':![]},'startDate':{'type':Sequelize['DATE']},'endDate':{'type':Sequelize['DATE']},'status':{'type':Sequelize[_0xae2f('0x2')],'defaultValue':'Loading'},'type':{'type':Sequelize[_0xae2f('0x3')](_0xae2f('0x6'),_0xae2f('0x7')),'allowNull':![],'defaultValue':'manual'},'reportId':{'type':Sequelize[_0xae2f('0x8')](0xb)['UNSIGNED']},'reportType':{'type':Sequelize[_0xae2f('0x2')]}}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js index 05b4202..1bae488 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 _0x67b0=['undefined','limit','offset','count','set','Content-Range','apply','save','update','then','destroy','get','ExtractedReports','UserProfileResource','end','error','stack','name','send','AnalyticExtractedReport','rawAttributes','fieldName','type','key','map','query','keys','intersection','model','attributes','fields','hasOwnProperty','nolimit','sort','where','filters','pick','merge','VIRTUAL','options','includeAll','include','rows','catch','params','length','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','basename','savename','existsSync','root','server/files/reports','Sequelize','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','download','format','%s.%s','output','toLowerCase','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json'];(function(_0x4d64ec,_0x13bea3){var _0x2cae69=function(_0x31ad8e){while(--_0x31ad8e){_0x4d64ec['push'](_0x4d64ec['shift']());}};_0x2cae69(++_0x13bea3);}(_0x67b0,0x104));var _0x067b=function(_0x32cb16,_0x4508e5){_0x32cb16=_0x32cb16-0x0;var _0x751c94=_0x67b0[_0x32cb16];return _0x751c94;};'use strict';var emlformat=require(_0x067b('0x0'));var rimraf=require(_0x067b('0x1'));var zipdir=require(_0x067b('0x2'));var jsonpatch=require(_0x067b('0x3'));var rp=require(_0x067b('0x4'));var moment=require(_0x067b('0x5'));var BPromise=require(_0x067b('0x6'));var Mustache=require('mustache');var util=require(_0x067b('0x7'));var path=require(_0x067b('0x8'));var sox=require(_0x067b('0x9'));var csv=require(_0x067b('0xa'));var ejs=require(_0x067b('0xb'));var fs=require('fs');var fs_extra=require(_0x067b('0xc'));var _=require(_0x067b('0xd'));var squel=require('squel');var crypto=require(_0x067b('0xe'));var jsforce=require(_0x067b('0xf'));var deskjs=require(_0x067b('0x10'));var toCsv=require(_0x067b('0xa'));var querystring=require(_0x067b('0x11'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x067b('0x12'));var as=require(_0x067b('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x067b('0x14'));var utils=require(_0x067b('0x15'));var config=require(_0x067b('0x16'));var licenseUtil=require(_0x067b('0x17'));var db=require(_0x067b('0x18'))['db'];function respondWithStatusCode(_0x282658,_0x408cab){_0x408cab=_0x408cab||0xcc;return function(_0x68e735){if(_0x68e735){return _0x282658[_0x067b('0x19')](_0x408cab);}return _0x282658[_0x067b('0x1a')](_0x408cab)['end']();};}function respondWithResult(_0xdc9ddb,_0x520c79){_0x520c79=_0x520c79||0xc8;return function(_0x514f7){if(_0x514f7){return _0xdc9ddb[_0x067b('0x1a')](_0x520c79)[_0x067b('0x1b')](_0x514f7);}};}function respondWithFilteredResult(_0x3dbfd5,_0x4db750){return function(_0x459fc6){if(_0x459fc6){var _0x4dc59f=typeof _0x4db750['offset']===_0x067b('0x1c')&&typeof _0x4db750[_0x067b('0x1d')]===_0x067b('0x1c');var _0xc53fb9=_0x459fc6['count'];var _0x51663b=_0x4dc59f?0x0:_0x4db750[_0x067b('0x1e')];var _0x170359=_0x4dc59f?_0x459fc6[_0x067b('0x1f')]:_0x4db750['offset']+_0x4db750[_0x067b('0x1d')];var _0x5cf474;if(_0x170359>=_0xc53fb9){_0x170359=_0xc53fb9;_0x5cf474=0xc8;}else{_0x5cf474=0xce;}_0x3dbfd5[_0x067b('0x1a')](_0x5cf474);return _0x3dbfd5[_0x067b('0x20')](_0x067b('0x21'),_0x51663b+'-'+_0x170359+'/'+_0xc53fb9)[_0x067b('0x1b')](_0x459fc6);}return null;};}function patchUpdates(_0x484328){return function(_0xf54fcf){try{jsonpatch[_0x067b('0x22')](_0xf54fcf,_0x484328,!![]);}catch(_0x332f4f){return BPromise['reject'](_0x332f4f);}return _0xf54fcf[_0x067b('0x23')]();};}function saveUpdates(_0x4cfac5,_0x5e0918){return function(_0x29dae0){if(_0x29dae0){return _0x29dae0[_0x067b('0x24')](_0x4cfac5)[_0x067b('0x25')](function(_0x5d2e9c){return _0x5d2e9c;});}return null;};}function removeEntity(_0x24b4c2,_0x127b48){return function(_0x138ef8){if(_0x138ef8){return _0x138ef8[_0x067b('0x26')]()[_0x067b('0x25')](function(){var _0x6ae57e=_0x138ef8[_0x067b('0x27')]({'plain':!![]});var _0x9ad5bf=_0x067b('0x28');return db[_0x067b('0x29')][_0x067b('0x26')]({'where':{'type':_0x9ad5bf,'resourceId':_0x6ae57e['id']}})['then'](function(){return _0x138ef8;});})['then'](function(){_0x24b4c2['status'](0xcc)[_0x067b('0x2a')]();});}};}function handleEntityNotFound(_0x164cdf,_0x1e98b5){return function(_0x16e7f6){if(!_0x16e7f6){_0x164cdf[_0x067b('0x19')](0x194);}return _0x16e7f6;};}function handleError(_0x135200,_0x54c7bd){_0x54c7bd=_0x54c7bd||0x1f4;return function(_0x5055ef){logger[_0x067b('0x2b')](_0x5055ef[_0x067b('0x2c')]);if(_0x5055ef['name']){delete _0x5055ef[_0x067b('0x2d')];}_0x135200[_0x067b('0x1a')](_0x54c7bd)[_0x067b('0x2e')](_0x5055ef);};}exports['index']=function(_0x66af74,_0x3ce549){var _0x100261={},_0xb7f2c7={},_0x293fdd={'count':0x0,'rows':[]};var _0x30f596=_['map'](db[_0x067b('0x2f')][_0x067b('0x30')],function(_0x4ff162){return{'name':_0x4ff162[_0x067b('0x31')],'type':_0x4ff162[_0x067b('0x32')][_0x067b('0x33')]};});_0xb7f2c7['model']=_[_0x067b('0x34')](_0x30f596,_0x067b('0x2d'));_0xb7f2c7[_0x067b('0x35')]=_[_0x067b('0x36')](_0x66af74['query']);_0xb7f2c7['filters']=_[_0x067b('0x37')](_0xb7f2c7[_0x067b('0x38')],_0xb7f2c7['query']);_0x100261[_0x067b('0x39')]=_[_0x067b('0x37')](_0xb7f2c7[_0x067b('0x38')],qs[_0x067b('0x3a')](_0x66af74[_0x067b('0x35')]['fields']));_0x100261[_0x067b('0x39')]=_0x100261['attributes']['length']?_0x100261[_0x067b('0x39')]:_0xb7f2c7[_0x067b('0x38')];if(!_0x66af74[_0x067b('0x35')][_0x067b('0x3b')](_0x067b('0x3c'))){_0x100261[_0x067b('0x1d')]=qs[_0x067b('0x1d')](_0x66af74[_0x067b('0x35')]['limit']);_0x100261[_0x067b('0x1e')]=qs[_0x067b('0x1e')](_0x66af74[_0x067b('0x35')][_0x067b('0x1e')]);}_0x100261['order']=qs[_0x067b('0x3d')](_0x66af74[_0x067b('0x35')][_0x067b('0x3d')]);_0x100261[_0x067b('0x3e')]=qs[_0x067b('0x3f')](_[_0x067b('0x40')](_0x66af74['query'],_0xb7f2c7[_0x067b('0x3f')]),_0x30f596);if(_0x66af74[_0x067b('0x35')]['filter']){_0x100261[_0x067b('0x3e')]=_[_0x067b('0x41')](_0x100261[_0x067b('0x3e')],{'$or':_['map'](_0x30f596,function(_0x26a7bc){if(_0x26a7bc['type']!==_0x067b('0x42')){var _0x295581={};_0x295581[_0x26a7bc[_0x067b('0x2d')]]={'$like':'%'+_0x66af74[_0x067b('0x35')]['filter']+'%'};return _0x295581;}})});}_0x100261=_[_0x067b('0x41')]({},_0x100261,_0x66af74[_0x067b('0x43')]);var _0x3bde83={'where':_0x100261[_0x067b('0x3e')]};return db[_0x067b('0x2f')]['count'](_0x3bde83)[_0x067b('0x25')](function(_0x524d7a){_0x293fdd[_0x067b('0x1f')]=_0x524d7a;if(_0x66af74['query'][_0x067b('0x44')]){_0x100261[_0x067b('0x45')]=[{'all':!![]}];}return db[_0x067b('0x2f')]['findAll'](_0x100261);})['then'](function(_0x521631){_0x293fdd[_0x067b('0x46')]=_0x521631;return _0x293fdd;})[_0x067b('0x25')](respondWithFilteredResult(_0x3ce549,_0x100261))[_0x067b('0x47')](handleError(_0x3ce549,null));};exports['show']=function(_0x267615,_0x1a6951){var _0x32545b={'raw':!![],'where':{'id':_0x267615[_0x067b('0x48')]['id']}},_0x3d30c6={};_0x3d30c6['model']=_[_0x067b('0x36')](db[_0x067b('0x2f')][_0x067b('0x30')]);_0x3d30c6['query']=_[_0x067b('0x36')](_0x267615[_0x067b('0x35')]);_0x3d30c6[_0x067b('0x3f')]=_[_0x067b('0x37')](_0x3d30c6[_0x067b('0x38')],_0x3d30c6[_0x067b('0x35')]);_0x32545b[_0x067b('0x39')]=_['intersection'](_0x3d30c6[_0x067b('0x38')],qs[_0x067b('0x3a')](_0x267615[_0x067b('0x35')][_0x067b('0x3a')]));_0x32545b[_0x067b('0x39')]=_0x32545b['attributes'][_0x067b('0x49')]?_0x32545b[_0x067b('0x39')]:_0x3d30c6[_0x067b('0x38')];if(_0x267615['query'][_0x067b('0x44')]){_0x32545b[_0x067b('0x45')]=[{'all':!![]}];}_0x32545b=_[_0x067b('0x41')]({},_0x32545b,_0x267615[_0x067b('0x43')]);return db[_0x067b('0x2f')][_0x067b('0x4a')](_0x32545b)['then'](handleEntityNotFound(_0x1a6951,null))['then'](respondWithResult(_0x1a6951,null))['catch'](handleError(_0x1a6951,null));};exports[_0x067b('0x4b')]=function(_0x502929,_0x86717c){return db['AnalyticExtractedReport'][_0x067b('0x4b')](_0x502929[_0x067b('0x4c')],{})['then'](function(_0x5b7b3d){var _0x42ec1a=_0x502929['user'][_0x067b('0x27')]({'plain':!![]});if(!_0x42ec1a)throw new Error(_0x067b('0x4d'));if(_0x42ec1a[_0x067b('0x4e')]===_0x067b('0x4f')){var _0x11ff50=_0x5b7b3d[_0x067b('0x27')]({'plain':!![]});var _0x548da2=_0x067b('0x28');return db[_0x067b('0x50')][_0x067b('0x4a')]({'where':{'name':_0x548da2,'userProfileId':_0x42ec1a[_0x067b('0x51')]},'raw':!![]})[_0x067b('0x25')](function(_0x39320e){if(_0x39320e&&_0x39320e['autoAssociation']===0x0){return db[_0x067b('0x29')][_0x067b('0x4b')]({'name':_0x11ff50[_0x067b('0x2d')],'resourceId':_0x11ff50['id'],'type':_0x39320e[_0x067b('0x2d')],'sectionId':_0x39320e['id']},{})[_0x067b('0x25')](function(){return _0x5b7b3d;});}else{return _0x5b7b3d;}})[_0x067b('0x47')](function(_0x36f76b){logger[_0x067b('0x2b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x36f76b);throw _0x36f76b;});}return _0x5b7b3d;})[_0x067b('0x25')](respondWithResult(_0x86717c,0xc9))[_0x067b('0x47')](handleError(_0x86717c,null));};exports[_0x067b('0x24')]=function(_0x2f767d,_0x1fb167){if(_0x2f767d[_0x067b('0x4c')]['id']){delete _0x2f767d[_0x067b('0x4c')]['id'];}return db['AnalyticExtractedReport'][_0x067b('0x4a')]({'where':{'id':_0x2f767d[_0x067b('0x48')]['id']}})[_0x067b('0x25')](handleEntityNotFound(_0x1fb167,null))[_0x067b('0x25')](saveUpdates(_0x2f767d['body'],null))['then'](respondWithResult(_0x1fb167,null))['catch'](handleError(_0x1fb167,null));};exports[_0x067b('0x26')]=function(_0x3f68ad,_0x13251a){return db[_0x067b('0x2f')][_0x067b('0x4a')]({'where':{'id':_0x3f68ad[_0x067b('0x48')]['id']}})[_0x067b('0x25')](handleEntityNotFound(_0x13251a,null))[_0x067b('0x25')](removeEntity(_0x13251a,null))[_0x067b('0x47')](handleError(_0x13251a,null));};exports['download']=function(_0x16835f,_0x382c4b,_0x361d89){return db['AnalyticExtractedReport'][_0x067b('0x4a')]({'where':{'id':_0x16835f[_0x067b('0x48')]['id']},'attributes':['name',_0x067b('0x52'),_0x067b('0x53'),'output'],'raw':!![]})[_0x067b('0x25')](handleEntityNotFound(_0x382c4b,null))[_0x067b('0x25')](function(_0x37ad46){if(_0x37ad46){if(!fs[_0x067b('0x54')](path['join'](config[_0x067b('0x55')],_0x067b('0x56'),_0x37ad46[_0x067b('0x53')]))){throw new db[(_0x067b('0x57'))][(_0x067b('0x58'))](_0x067b('0x59'));}if(_0x16835f['query'][_0x067b('0x5a')]){return _0x382c4b[_0x067b('0x19')](0xc8);}return _0x382c4b[_0x067b('0x5b')](path['join'](config[_0x067b('0x55')],_0x067b('0x56'),_0x37ad46[_0x067b('0x53')]),util[_0x067b('0x5c')](_0x067b('0x5d'),_0x37ad46['basename']||_0x37ad46['name'],_0x37ad46[_0x067b('0x5e')][_0x067b('0x5f')]()));}})[_0x067b('0x47')](handleError(_0x382c4b,null));}; \ No newline at end of file +var _0xa7a9=['AnalyticExtractedReport','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','options','includeAll','include','rows','catch','show','params','merge','find','create','body','user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','basename','savename','output','join','root','server/files/reports','Sequelize','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','download','format','%s.%s','toLowerCase','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','limit','undefined','count','set','reject','save','update','then','destroy','get','ExtractedReports','UserProfileResource','end','error','name','index','map'];(function(_0x5328cb,_0x26290e){var _0x2cd881=function(_0x4e92d1){while(--_0x4e92d1){_0x5328cb['push'](_0x5328cb['shift']());}};_0x2cd881(++_0x26290e);}(_0xa7a9,0x14c));var _0x9a7a=function(_0x315aa7,_0x22e094){_0x315aa7=_0x315aa7-0x0;var _0x819ef2=_0xa7a9[_0x315aa7];return _0x819ef2;};'use strict';var emlformat=require(_0x9a7a('0x0'));var rimraf=require(_0x9a7a('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9a7a('0x2'));var rp=require(_0x9a7a('0x3'));var moment=require(_0x9a7a('0x4'));var BPromise=require(_0x9a7a('0x5'));var Mustache=require('mustache');var util=require(_0x9a7a('0x6'));var path=require(_0x9a7a('0x7'));var sox=require(_0x9a7a('0x8'));var csv=require(_0x9a7a('0x9'));var ejs=require(_0x9a7a('0xa'));var fs=require('fs');var fs_extra=require(_0x9a7a('0xb'));var _=require(_0x9a7a('0xc'));var squel=require(_0x9a7a('0xd'));var crypto=require('crypto');var jsforce=require(_0x9a7a('0xe'));var deskjs=require(_0x9a7a('0xf'));var toCsv=require(_0x9a7a('0x9'));var querystring=require(_0x9a7a('0x10'));var Papa=require(_0x9a7a('0x11'));var Redis=require(_0x9a7a('0x12'));var authService=require(_0x9a7a('0x13'));var qs=require(_0x9a7a('0x14'));var as=require(_0x9a7a('0x15'));var hardwareService=require(_0x9a7a('0x16'));var logger=require('../../config/logger')(_0x9a7a('0x17'));var utils=require(_0x9a7a('0x18'));var config=require(_0x9a7a('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0x9a7a('0x1a'))['db'];function respondWithStatusCode(_0x25c06b,_0x5863c2){_0x5863c2=_0x5863c2||0xcc;return function(_0x29cb48){if(_0x29cb48){return _0x25c06b[_0x9a7a('0x1b')](_0x5863c2);}return _0x25c06b[_0x9a7a('0x1c')](_0x5863c2)['end']();};}function respondWithResult(_0x1d5014,_0xb95d20){_0xb95d20=_0xb95d20||0xc8;return function(_0x3d9d61){if(_0x3d9d61){return _0x1d5014[_0x9a7a('0x1c')](_0xb95d20)[_0x9a7a('0x1d')](_0x3d9d61);}};}function respondWithFilteredResult(_0x529f1e,_0x25bcb4){return function(_0x3583e4){if(_0x3583e4){var _0x17c795=typeof _0x25bcb4[_0x9a7a('0x1e')]==='undefined'&&typeof _0x25bcb4[_0x9a7a('0x1f')]===_0x9a7a('0x20');var _0x325d5a=_0x3583e4[_0x9a7a('0x21')];var _0x2dc870=_0x17c795?0x0:_0x25bcb4[_0x9a7a('0x1e')];var _0x19c320=_0x17c795?_0x3583e4['count']:_0x25bcb4[_0x9a7a('0x1e')]+_0x25bcb4['limit'];var _0x158291;if(_0x19c320>=_0x325d5a){_0x19c320=_0x325d5a;_0x158291=0xc8;}else{_0x158291=0xce;}_0x529f1e[_0x9a7a('0x1c')](_0x158291);return _0x529f1e[_0x9a7a('0x22')]('Content-Range',_0x2dc870+'-'+_0x19c320+'/'+_0x325d5a)['json'](_0x3583e4);}return null;};}function patchUpdates(_0x4abcd4){return function(_0x203367){try{jsonpatch['apply'](_0x203367,_0x4abcd4,!![]);}catch(_0x4f6302){return BPromise[_0x9a7a('0x23')](_0x4f6302);}return _0x203367[_0x9a7a('0x24')]();};}function saveUpdates(_0x2b394b,_0x2d6783){return function(_0x412a96){if(_0x412a96){return _0x412a96[_0x9a7a('0x25')](_0x2b394b)[_0x9a7a('0x26')](function(_0x3a6e61){return _0x3a6e61;});}return null;};}function removeEntity(_0x2f2dd1,_0x25af8b){return function(_0x30098d){if(_0x30098d){return _0x30098d[_0x9a7a('0x27')]()[_0x9a7a('0x26')](function(){var _0x2f520c=_0x30098d[_0x9a7a('0x28')]({'plain':!![]});var _0x53ab4e=_0x9a7a('0x29');return db[_0x9a7a('0x2a')]['destroy']({'where':{'type':_0x53ab4e,'resourceId':_0x2f520c['id']}})['then'](function(){return _0x30098d;});})[_0x9a7a('0x26')](function(){_0x2f2dd1['status'](0xcc)[_0x9a7a('0x2b')]();});}};}function handleEntityNotFound(_0x1fa4d5,_0x139ae8){return function(_0x8deea8){if(!_0x8deea8){_0x1fa4d5['sendStatus'](0x194);}return _0x8deea8;};}function handleError(_0x5082de,_0x4842c2){_0x4842c2=_0x4842c2||0x1f4;return function(_0x13a6ea){logger[_0x9a7a('0x2c')](_0x13a6ea['stack']);if(_0x13a6ea[_0x9a7a('0x2d')]){delete _0x13a6ea[_0x9a7a('0x2d')];}_0x5082de[_0x9a7a('0x1c')](_0x4842c2)['send'](_0x13a6ea);};}exports[_0x9a7a('0x2e')]=function(_0x280fa0,_0x537dc1){var _0x5f343c={},_0x4f4d97={},_0x431f27={'count':0x0,'rows':[]};var _0x32c2f6=_[_0x9a7a('0x2f')](db[_0x9a7a('0x30')]['rawAttributes'],function(_0x168039){return{'name':_0x168039['fieldName'],'type':_0x168039[_0x9a7a('0x31')][_0x9a7a('0x32')]};});_0x4f4d97[_0x9a7a('0x33')]=_[_0x9a7a('0x2f')](_0x32c2f6,'name');_0x4f4d97[_0x9a7a('0x34')]=_[_0x9a7a('0x35')](_0x280fa0[_0x9a7a('0x34')]);_0x4f4d97[_0x9a7a('0x36')]=_['intersection'](_0x4f4d97['model'],_0x4f4d97[_0x9a7a('0x34')]);_0x5f343c[_0x9a7a('0x37')]=_[_0x9a7a('0x38')](_0x4f4d97[_0x9a7a('0x33')],qs[_0x9a7a('0x39')](_0x280fa0['query'][_0x9a7a('0x39')]));_0x5f343c['attributes']=_0x5f343c[_0x9a7a('0x37')][_0x9a7a('0x3a')]?_0x5f343c[_0x9a7a('0x37')]:_0x4f4d97[_0x9a7a('0x33')];if(!_0x280fa0[_0x9a7a('0x34')][_0x9a7a('0x3b')](_0x9a7a('0x3c'))){_0x5f343c[_0x9a7a('0x1f')]=qs[_0x9a7a('0x1f')](_0x280fa0[_0x9a7a('0x34')][_0x9a7a('0x1f')]);_0x5f343c[_0x9a7a('0x1e')]=qs['offset'](_0x280fa0['query']['offset']);}_0x5f343c['order']=qs[_0x9a7a('0x3d')](_0x280fa0[_0x9a7a('0x34')][_0x9a7a('0x3d')]);_0x5f343c[_0x9a7a('0x3e')]=qs['filters'](_[_0x9a7a('0x3f')](_0x280fa0[_0x9a7a('0x34')],_0x4f4d97['filters']),_0x32c2f6);if(_0x280fa0[_0x9a7a('0x34')]['filter']){_0x5f343c[_0x9a7a('0x3e')]=_['merge'](_0x5f343c['where'],{'$or':_[_0x9a7a('0x2f')](_0x32c2f6,function(_0x23d5b1){if(_0x23d5b1['type']!=='VIRTUAL'){var _0x23a0d1={};_0x23a0d1[_0x23d5b1[_0x9a7a('0x2d')]]={'$like':'%'+_0x280fa0[_0x9a7a('0x34')][_0x9a7a('0x40')]+'%'};return _0x23a0d1;}})});}_0x5f343c=_['merge']({},_0x5f343c,_0x280fa0[_0x9a7a('0x41')]);var _0x1699b4={'where':_0x5f343c[_0x9a7a('0x3e')]};return db[_0x9a7a('0x30')][_0x9a7a('0x21')](_0x1699b4)[_0x9a7a('0x26')](function(_0x196c47){_0x431f27[_0x9a7a('0x21')]=_0x196c47;if(_0x280fa0[_0x9a7a('0x34')][_0x9a7a('0x42')]){_0x5f343c[_0x9a7a('0x43')]=[{'all':!![]}];}return db['AnalyticExtractedReport']['findAll'](_0x5f343c);})['then'](function(_0x3b871a){_0x431f27[_0x9a7a('0x44')]=_0x3b871a;return _0x431f27;})[_0x9a7a('0x26')](respondWithFilteredResult(_0x537dc1,_0x5f343c))[_0x9a7a('0x45')](handleError(_0x537dc1,null));};exports[_0x9a7a('0x46')]=function(_0x150bc0,_0x40bc93){var _0x4ca805={'raw':!![],'where':{'id':_0x150bc0[_0x9a7a('0x47')]['id']}},_0x2557f4={};_0x2557f4[_0x9a7a('0x33')]=_['keys'](db[_0x9a7a('0x30')]['rawAttributes']);_0x2557f4[_0x9a7a('0x34')]=_[_0x9a7a('0x35')](_0x150bc0[_0x9a7a('0x34')]);_0x2557f4[_0x9a7a('0x36')]=_[_0x9a7a('0x38')](_0x2557f4[_0x9a7a('0x33')],_0x2557f4[_0x9a7a('0x34')]);_0x4ca805[_0x9a7a('0x37')]=_[_0x9a7a('0x38')](_0x2557f4[_0x9a7a('0x33')],qs[_0x9a7a('0x39')](_0x150bc0[_0x9a7a('0x34')]['fields']));_0x4ca805[_0x9a7a('0x37')]=_0x4ca805[_0x9a7a('0x37')][_0x9a7a('0x3a')]?_0x4ca805[_0x9a7a('0x37')]:_0x2557f4[_0x9a7a('0x33')];if(_0x150bc0['query']['includeAll']){_0x4ca805[_0x9a7a('0x43')]=[{'all':!![]}];}_0x4ca805=_[_0x9a7a('0x48')]({},_0x4ca805,_0x150bc0['options']);return db['AnalyticExtractedReport'][_0x9a7a('0x49')](_0x4ca805)[_0x9a7a('0x26')](handleEntityNotFound(_0x40bc93,null))[_0x9a7a('0x26')](respondWithResult(_0x40bc93,null))['catch'](handleError(_0x40bc93,null));};exports[_0x9a7a('0x4a')]=function(_0x2679ab,_0x11b2c4){return db[_0x9a7a('0x30')][_0x9a7a('0x4a')](_0x2679ab[_0x9a7a('0x4b')],{})['then'](function(_0x474aaa){var _0x172837=_0x2679ab[_0x9a7a('0x4c')]['get']({'plain':!![]});if(!_0x172837)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x172837[_0x9a7a('0x4d')]==='user'){var _0x4ac3fc=_0x474aaa['get']({'plain':!![]});var _0x14afe5=_0x9a7a('0x29');return db[_0x9a7a('0x4e')][_0x9a7a('0x49')]({'where':{'name':_0x14afe5,'userProfileId':_0x172837['userProfileId']},'raw':!![]})[_0x9a7a('0x26')](function(_0x2a9fc0){if(_0x2a9fc0&&_0x2a9fc0[_0x9a7a('0x4f')]===0x0){return db[_0x9a7a('0x2a')][_0x9a7a('0x4a')]({'name':_0x4ac3fc['name'],'resourceId':_0x4ac3fc['id'],'type':_0x2a9fc0[_0x9a7a('0x2d')],'sectionId':_0x2a9fc0['id']},{})[_0x9a7a('0x26')](function(){return _0x474aaa;});}else{return _0x474aaa;}})[_0x9a7a('0x45')](function(_0x22d971){logger[_0x9a7a('0x2c')](_0x9a7a('0x50'),_0x22d971);throw _0x22d971;});}return _0x474aaa;})[_0x9a7a('0x26')](respondWithResult(_0x11b2c4,0xc9))[_0x9a7a('0x45')](handleError(_0x11b2c4,null));};exports['update']=function(_0x1d85b3,_0xf8c860){if(_0x1d85b3[_0x9a7a('0x4b')]['id']){delete _0x1d85b3[_0x9a7a('0x4b')]['id'];}return db[_0x9a7a('0x30')][_0x9a7a('0x49')]({'where':{'id':_0x1d85b3[_0x9a7a('0x47')]['id']}})[_0x9a7a('0x26')](handleEntityNotFound(_0xf8c860,null))[_0x9a7a('0x26')](saveUpdates(_0x1d85b3[_0x9a7a('0x4b')],null))[_0x9a7a('0x26')](respondWithResult(_0xf8c860,null))[_0x9a7a('0x45')](handleError(_0xf8c860,null));};exports[_0x9a7a('0x27')]=function(_0x272e52,_0x5a8301){return db[_0x9a7a('0x30')]['find']({'where':{'id':_0x272e52[_0x9a7a('0x47')]['id']}})[_0x9a7a('0x26')](handleEntityNotFound(_0x5a8301,null))[_0x9a7a('0x26')](removeEntity(_0x5a8301,null))['catch'](handleError(_0x5a8301,null));};exports['download']=function(_0x2aa519,_0x169a2a,_0x307c58){return db['AnalyticExtractedReport']['find']({'where':{'id':_0x2aa519[_0x9a7a('0x47')]['id']},'attributes':['name',_0x9a7a('0x51'),_0x9a7a('0x52'),_0x9a7a('0x53')],'raw':!![]})['then'](handleEntityNotFound(_0x169a2a,null))[_0x9a7a('0x26')](function(_0x290e59){if(_0x290e59){if(!fs['existsSync'](path[_0x9a7a('0x54')](config[_0x9a7a('0x55')],_0x9a7a('0x56'),_0x290e59['savename']))){throw new db[(_0x9a7a('0x57'))][(_0x9a7a('0x58'))](_0x9a7a('0x59'));}if(_0x2aa519[_0x9a7a('0x34')][_0x9a7a('0x5a')]){return _0x169a2a['sendStatus'](0xc8);}return _0x169a2a[_0x9a7a('0x5b')](path[_0x9a7a('0x54')](config[_0x9a7a('0x55')],_0x9a7a('0x56'),_0x290e59[_0x9a7a('0x52')]),util[_0x9a7a('0x5c')](_0x9a7a('0x5d'),_0x290e59['basename']||_0x290e59['name'],_0x290e59[_0x9a7a('0x53')][_0x9a7a('0x5e')]()));}})[_0x9a7a('0x45')](handleError(_0x169a2a,null));}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js index f54d50f..7c151d6 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 _0x7a6e=['exports','define','AnalyticExtractedReport','analytics_extracted_reports','lodash','../../config/logger','api','bluebird','request-promise','path','../../config/environment','./analyticExtractedReport.attributes'];(function(_0x3d59e3,_0x1638a8){var _0x3c6471=function(_0x3b9b1b){while(--_0x3b9b1b){_0x3d59e3['push'](_0x3d59e3['shift']());}};_0x3c6471(++_0x1638a8);}(_0x7a6e,0xa0));var _0xe7a6=function(_0x21586f,_0x4bcf74){_0x21586f=_0x21586f-0x0;var _0x620124=_0x7a6e[_0x21586f];return _0x620124;};'use strict';var _=require(_0xe7a6('0x0'));var util=require('util');var logger=require(_0xe7a6('0x1'))(_0xe7a6('0x2'));var moment=require('moment');var BPromise=require(_0xe7a6('0x3'));var rp=require(_0xe7a6('0x4'));var fs=require('fs');var path=require(_0xe7a6('0x5'));var rimraf=require('rimraf');var config=require(_0xe7a6('0x6'));var attributes=require(_0xe7a6('0x7'));module[_0xe7a6('0x8')]=function(_0x1ef0b6,_0xe85122){return _0x1ef0b6[_0xe7a6('0x9')](_0xe7a6('0xa'),attributes,{'tableName':_0xe7a6('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb027=['analytics_extracted_reports','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','exports','define'];(function(_0x2ac8bf,_0x4d5ba9){var _0x9b5632=function(_0x3160c6){while(--_0x3160c6){_0x2ac8bf['push'](_0x2ac8bf['shift']());}};_0x9b5632(++_0x4d5ba9);}(_0xb027,0x1d5));var _0x7b02=function(_0x358f8e,_0x5c13ae){_0x358f8e=_0x358f8e-0x0;var _0x3b428c=_0xb027[_0x358f8e];return _0x3b428c;};'use strict';var _=require(_0x7b02('0x0'));var util=require(_0x7b02('0x1'));var logger=require(_0x7b02('0x2'))(_0x7b02('0x3'));var moment=require(_0x7b02('0x4'));var BPromise=require(_0x7b02('0x5'));var rp=require(_0x7b02('0x6'));var fs=require('fs');var path=require(_0x7b02('0x7'));var rimraf=require('rimraf');var config=require(_0x7b02('0x8'));var attributes=require('./analyticExtractedReport.attributes');module[_0x7b02('0x9')]=function(_0x56cf99,_0x2caaef){return _0x56cf99[_0x7b02('0xa')]('AnalyticExtractedReport',attributes,{'tableName':_0x7b02('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.rpc.js b/server/api/analyticExtractedReport/analyticExtractedReport.rpc.js index 60f59f3..c76873c 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 _0xe49d=['code','error','message','result','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','info','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x48f32d,_0x39e043){var _0x870bbf=function(_0x549d78){while(--_0x549d78){_0x48f32d['push'](_0x48f32d['shift']());}};_0x870bbf(++_0x39e043);}(_0xe49d,0xf6));var _0xde49=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xe49d[_0x321bb2];return _0x9c12ed;};'use strict';var _=require('lodash');var util=require(_0xde49('0x0'));var moment=require(_0xde49('0x1'));var BPromise=require(_0xde49('0x2'));var rs=require(_0xde49('0x3'));var fs=require('fs');var Redis=require(_0xde49('0x4'));var db=require(_0xde49('0x5'))['db'];var utils=require(_0xde49('0x6'));var logger=require(_0xde49('0x7'))(_0xde49('0x8'));var config=require('../../config/environment');var jayson=require(_0xde49('0x9'));var client=jayson[_0xde49('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4d3375,_0x86ab0d,_0x13d963){return new BPromise(function(_0x3f5a65,_0x15b346){return client[_0xde49('0xb')](_0x4d3375,_0x13d963)[_0xde49('0xc')](function(_0x5b3707){logger[_0xde49('0xd')](_0xde49('0xe'),_0x86ab0d,_0xde49('0xf'));logger['debug'](_0xde49('0x10'),_0x86ab0d,_0xde49('0xf'),JSON[_0xde49('0x11')](_0x5b3707));if(_0x5b3707['error']){if(_0x5b3707['error'][_0xde49('0x12')]===0x1f4){logger[_0xde49('0x13')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x86ab0d,_0x5b3707[_0xde49('0x13')][_0xde49('0x14')]);return _0x15b346(_0x5b3707['error'][_0xde49('0x14')]);}logger['error'](_0xde49('0xe'),_0x86ab0d,_0x5b3707[_0xde49('0x13')][_0xde49('0x14')]);return _0x3f5a65(_0x5b3707[_0xde49('0x13')][_0xde49('0x14')]);}else{logger[_0xde49('0xd')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x86ab0d,_0xde49('0xf'));_0x3f5a65(_0x5b3707[_0xde49('0x15')][_0xde49('0x14')]);}})['catch'](function(_0x1c4714){logger[_0xde49('0x13')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x86ab0d,_0x1c4714);_0x15b346(_0x1c4714);});});} \ No newline at end of file +var _0xfa46=['info','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then'];(function(_0x2053ea,_0x1ab2d4){var _0x2232c4=function(_0x4230df){while(--_0x4230df){_0x2053ea['push'](_0x2053ea['shift']());}};_0x2232c4(++_0x1ab2d4);}(_0xfa46,0x17f));var _0x6fa4=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0xfa46[_0x17d9e3];return _0x14192d;};'use strict';var _=require(_0x6fa4('0x0'));var util=require(_0x6fa4('0x1'));var moment=require(_0x6fa4('0x2'));var BPromise=require(_0x6fa4('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6fa4('0x4'));var db=require(_0x6fa4('0x5'))['db'];var utils=require(_0x6fa4('0x6'));var logger=require(_0x6fa4('0x7'))(_0x6fa4('0x8'));var config=require(_0x6fa4('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x6fa4('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3d9319,_0x19413f,_0x598229){return new BPromise(function(_0x5ba229,_0x36aeda){return client[_0x6fa4('0xb')](_0x3d9319,_0x598229)[_0x6fa4('0xc')](function(_0x2194c0){logger[_0x6fa4('0xd')](_0x6fa4('0xe'),_0x19413f,_0x6fa4('0xf'));logger[_0x6fa4('0x10')](_0x6fa4('0x11'),_0x19413f,_0x6fa4('0xf'),JSON[_0x6fa4('0x12')](_0x2194c0));if(_0x2194c0[_0x6fa4('0x13')]){if(_0x2194c0['error']['code']===0x1f4){logger[_0x6fa4('0x13')](_0x6fa4('0xe'),_0x19413f,_0x2194c0[_0x6fa4('0x13')][_0x6fa4('0x14')]);return _0x36aeda(_0x2194c0['error'][_0x6fa4('0x14')]);}logger[_0x6fa4('0x13')](_0x6fa4('0xe'),_0x19413f,_0x2194c0[_0x6fa4('0x13')][_0x6fa4('0x14')]);return _0x5ba229(_0x2194c0[_0x6fa4('0x13')][_0x6fa4('0x14')]);}else{logger[_0x6fa4('0xd')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x19413f,_0x6fa4('0xf'));_0x5ba229(_0x2194c0[_0x6fa4('0x15')]['message']);}})['catch'](function(_0x4a1c4f){logger[_0x6fa4('0x13')](_0x6fa4('0xe'),_0x19413f,_0x4a1c4f);_0x36aeda(_0x4a1c4f);});});} \ No newline at end of file diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js index 9a6145c..69c8d94 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 _0x2428=['exports','util','express','fs-extra','./analyticExtractedReport.controller','get','isAuthenticated','/:id','show','/:id/download','download','post','create','update','delete','destroy'];(function(_0x273dc5,_0x268a81){var _0x46dae7=function(_0x263d62){while(--_0x263d62){_0x273dc5['push'](_0x273dc5['shift']());}};_0x46dae7(++_0x268a81);}(_0x2428,0xf1));var _0x8242=function(_0x59a6d6,_0x27895c){_0x59a6d6=_0x59a6d6-0x0;var _0x5bdb96=_0x2428[_0x59a6d6];return _0x5bdb96;};'use strict';var multer=require('multer');var util=require(_0x8242('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x8242('0x1'));var router=express['Router']();var fs_extra=require(_0x8242('0x2'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x8242('0x3'));router[_0x8242('0x4')]('/',auth[_0x8242('0x5')](),controller['index']);router[_0x8242('0x4')](_0x8242('0x6'),auth[_0x8242('0x5')](),controller[_0x8242('0x7')]);router[_0x8242('0x4')](_0x8242('0x8'),auth[_0x8242('0x5')](),controller[_0x8242('0x9')]);router[_0x8242('0xa')]('/',auth[_0x8242('0x5')](),controller[_0x8242('0xb')]);router['put'](_0x8242('0x6'),auth[_0x8242('0x5')](),controller[_0x8242('0xc')]);router[_0x8242('0xd')](_0x8242('0x6'),auth[_0x8242('0x5')](),controller[_0x8242('0xe')]);module[_0x8242('0xf')]=router; \ No newline at end of file +var _0xf7fd=['../../components/interaction/service','./analyticExtractedReport.controller','get','isAuthenticated','index','/:id','show','/:id/download','download','post','create','update','delete','multer','util'];(function(_0x263a74,_0xc31414){var _0x2aa86c=function(_0x382896){while(--_0x382896){_0x263a74['push'](_0x263a74['shift']());}};_0x2aa86c(++_0xc31414);}(_0xf7fd,0xdf));var _0xdf7f=function(_0x934425,_0x5af72f){_0x934425=_0x934425-0x0;var _0x31d596=_0xf7fd[_0x934425];return _0x31d596;};'use strict';var multer=require(_0xdf7f('0x0'));var util=require(_0xdf7f('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xdf7f('0x2'));var config=require('../../config/environment');var controller=require(_0xdf7f('0x3'));router[_0xdf7f('0x4')]('/',auth[_0xdf7f('0x5')](),controller[_0xdf7f('0x6')]);router[_0xdf7f('0x4')](_0xdf7f('0x7'),auth[_0xdf7f('0x5')](),controller[_0xdf7f('0x8')]);router[_0xdf7f('0x4')](_0xdf7f('0x9'),auth['isAuthenticated'](),controller[_0xdf7f('0xa')]);router[_0xdf7f('0xb')]('/',auth[_0xdf7f('0x5')](),controller[_0xdf7f('0xc')]);router['put'](_0xdf7f('0x7'),auth[_0xdf7f('0x5')](),controller[_0xdf7f('0xd')]);router[_0xdf7f('0xe')](_0xdf7f('0x7'),auth[_0xdf7f('0x5')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.attributes.js b/server/api/analyticFieldReport/analyticFieldReport.attributes.js index a3d4ccf..f8e8e60 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 _0x0d22=['exports','TEXT','STRING','BOOLEAN','sequelize'];(function(_0x1ca8fe,_0x5d22bb){var _0x3350f6=function(_0x2790c0){while(--_0x2790c0){_0x1ca8fe['push'](_0x1ca8fe['shift']());}};_0x3350f6(++_0x5d22bb);}(_0x0d22,0x77));var _0x20d2=function(_0x500419,_0x549162){_0x500419=_0x500419-0x0;var _0x241c1a=_0x0d22[_0x500419];return _0x241c1a;};'use strict';var Sequelize=require(_0x20d2('0x0'));module[_0x20d2('0x1')]={'field':{'type':Sequelize[_0x20d2('0x2')]},'alias':{'type':Sequelize[_0x20d2('0x3')]},'function':{'type':Sequelize[_0x20d2('0x3')]},'format':{'type':Sequelize['STRING']},'groupBy':{'type':Sequelize[_0x20d2('0x4')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x20d2('0x3')]},'custom':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0x0a20=['STRING','BOOLEAN','sequelize','TEXT'];(function(_0x23496e,_0x5c2620){var _0xd5128e=function(_0x503fdc){while(--_0x503fdc){_0x23496e['push'](_0x23496e['shift']());}};_0xd5128e(++_0x5c2620);}(_0x0a20,0x1b6));var _0x00a2=function(_0x4fd5cb,_0x64f2dd){_0x4fd5cb=_0x4fd5cb-0x0;var _0x1768d6=_0x0a20[_0x4fd5cb];return _0x1768d6;};'use strict';var Sequelize=require(_0x00a2('0x0'));module['exports']={'field':{'type':Sequelize[_0x00a2('0x1')]},'alias':{'type':Sequelize[_0x00a2('0x2')]},'function':{'type':Sequelize[_0x00a2('0x2')]},'format':{'type':Sequelize[_0x00a2('0x2')]},'groupBy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'orderBy':{'type':Sequelize['STRING']},'custom':{'type':Sequelize[_0x00a2('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 2a46950..6599fa9 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 _0xf523=['model','intersection','fields','attributes','length','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','catch','params','includeAll','find','create','body','bulkCreate','bulkDestroy','ids','AnalyticCustomReport','findOne','sequelize','CustomReportId','eml-format','rimraf','zip-dir','moment','util','path','to-csv','ejs','fs-extra','lodash','crypto','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','limit','undefined','count','offset','set','Content-Range','apply','save','update','then','destroy','sendStatus','error','stack','name','map','AnalyticFieldReport','rawAttributes','type','key','query','keys','filters'];(function(_0x1528a6,_0xb9cb17){var _0x2a107f=function(_0x41f090){while(--_0x41f090){_0x1528a6['push'](_0x1528a6['shift']());}};_0x2a107f(++_0xb9cb17);}(_0xf523,0x1ea));var _0x3f52=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xf523[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require(_0x3f52('0x0'));var rimraf=require(_0x3f52('0x1'));var zipdir=require(_0x3f52('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x3f52('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x3f52('0x4'));var path=require(_0x3f52('0x5'));var sox=require('sox');var csv=require(_0x3f52('0x6'));var ejs=require(_0x3f52('0x7'));var fs=require('fs');var fs_extra=require(_0x3f52('0x8'));var _=require(_0x3f52('0x9'));var squel=require('squel');var crypto=require(_0x3f52('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x3f52('0xb'));var Redis=require(_0x3f52('0xc'));var authService=require(_0x3f52('0xd'));var qs=require(_0x3f52('0xe'));var as=require(_0x3f52('0xf'));var hardwareService=require(_0x3f52('0x10'));var logger=require(_0x3f52('0x11'))(_0x3f52('0x12'));var utils=require(_0x3f52('0x13'));var config=require(_0x3f52('0x14'));var licenseUtil=require(_0x3f52('0x15'));var db=require(_0x3f52('0x16'))['db'];function respondWithStatusCode(_0x374d5a,_0x587503){_0x587503=_0x587503||0xcc;return function(_0x509382){if(_0x509382){return _0x374d5a['sendStatus'](_0x587503);}return _0x374d5a[_0x3f52('0x17')](_0x587503)[_0x3f52('0x18')]();};}function respondWithResult(_0x16dbf6,_0x23e271){_0x23e271=_0x23e271||0xc8;return function(_0xf59bf){if(_0xf59bf){return _0x16dbf6[_0x3f52('0x17')](_0x23e271)[_0x3f52('0x19')](_0xf59bf);}};}function respondWithFilteredResult(_0x2b44fc,_0x5127de){return function(_0x5e522b){if(_0x5e522b){var _0x1ae2ad=typeof _0x5127de['offset']==='undefined'&&typeof _0x5127de[_0x3f52('0x1a')]===_0x3f52('0x1b');var _0x1df939=_0x5e522b[_0x3f52('0x1c')];var _0x18e2cd=_0x1ae2ad?0x0:_0x5127de[_0x3f52('0x1d')];var _0x4c4fa8=_0x1ae2ad?_0x5e522b[_0x3f52('0x1c')]:_0x5127de[_0x3f52('0x1d')]+_0x5127de[_0x3f52('0x1a')];var _0x18af1a;if(_0x4c4fa8>=_0x1df939){_0x4c4fa8=_0x1df939;_0x18af1a=0xc8;}else{_0x18af1a=0xce;}_0x2b44fc[_0x3f52('0x17')](_0x18af1a);return _0x2b44fc[_0x3f52('0x1e')](_0x3f52('0x1f'),_0x18e2cd+'-'+_0x4c4fa8+'/'+_0x1df939)[_0x3f52('0x19')](_0x5e522b);}return null;};}function patchUpdates(_0xf42b80){return function(_0x2a8609){try{jsonpatch[_0x3f52('0x20')](_0x2a8609,_0xf42b80,!![]);}catch(_0x15c692){return BPromise['reject'](_0x15c692);}return _0x2a8609[_0x3f52('0x21')]();};}function saveUpdates(_0x2a43f6,_0x97124){return function(_0x3fe0d4){if(_0x3fe0d4){return _0x3fe0d4[_0x3f52('0x22')](_0x2a43f6)[_0x3f52('0x23')](function(_0x15828a){return _0x15828a;});}return null;};}function removeEntity(_0x1a7b3b,_0x2526a0){return function(_0x2262ff){if(_0x2262ff){return _0x2262ff[_0x3f52('0x24')]()[_0x3f52('0x23')](function(){_0x1a7b3b[_0x3f52('0x17')](0xcc)[_0x3f52('0x18')]();});}};}function handleEntityNotFound(_0x64f882,_0x260c62){return function(_0x1d9a6f){if(!_0x1d9a6f){_0x64f882[_0x3f52('0x25')](0x194);}return _0x1d9a6f;};}function handleError(_0x47b87f,_0x23203e){_0x23203e=_0x23203e||0x1f4;return function(_0xb9334f){logger[_0x3f52('0x26')](_0xb9334f[_0x3f52('0x27')]);if(_0xb9334f[_0x3f52('0x28')]){delete _0xb9334f[_0x3f52('0x28')];}_0x47b87f[_0x3f52('0x17')](_0x23203e)['send'](_0xb9334f);};}exports['index']=function(_0x5b9d25,_0x33e4aa){var _0x1df8e0={},_0x54d99f={},_0x5b04c5={'count':0x0,'rows':[]};var _0x4089ab=_[_0x3f52('0x29')](db[_0x3f52('0x2a')][_0x3f52('0x2b')],function(_0x501545){return{'name':_0x501545['fieldName'],'type':_0x501545[_0x3f52('0x2c')][_0x3f52('0x2d')]};});_0x54d99f['model']=_[_0x3f52('0x29')](_0x4089ab,'name');_0x54d99f[_0x3f52('0x2e')]=_[_0x3f52('0x2f')](_0x5b9d25[_0x3f52('0x2e')]);_0x54d99f[_0x3f52('0x30')]=_['intersection'](_0x54d99f[_0x3f52('0x31')],_0x54d99f[_0x3f52('0x2e')]);_0x1df8e0['attributes']=_[_0x3f52('0x32')](_0x54d99f[_0x3f52('0x31')],qs['fields'](_0x5b9d25[_0x3f52('0x2e')][_0x3f52('0x33')]));_0x1df8e0['attributes']=_0x1df8e0[_0x3f52('0x34')][_0x3f52('0x35')]?_0x1df8e0[_0x3f52('0x34')]:_0x54d99f[_0x3f52('0x31')];if(!_0x5b9d25[_0x3f52('0x2e')]['hasOwnProperty']('nolimit')){_0x1df8e0[_0x3f52('0x1a')]=qs[_0x3f52('0x1a')](_0x5b9d25[_0x3f52('0x2e')][_0x3f52('0x1a')]);_0x1df8e0[_0x3f52('0x1d')]=qs[_0x3f52('0x1d')](_0x5b9d25[_0x3f52('0x2e')][_0x3f52('0x1d')]);}_0x1df8e0[_0x3f52('0x36')]=qs['sort'](_0x5b9d25[_0x3f52('0x2e')][_0x3f52('0x37')]);_0x1df8e0[_0x3f52('0x38')]=qs[_0x3f52('0x30')](_[_0x3f52('0x39')](_0x5b9d25['query'],_0x54d99f[_0x3f52('0x30')]),_0x4089ab);if(_0x5b9d25[_0x3f52('0x2e')][_0x3f52('0x3a')]){_0x1df8e0[_0x3f52('0x38')]=_[_0x3f52('0x3b')](_0x1df8e0[_0x3f52('0x38')],{'$or':_[_0x3f52('0x29')](_0x4089ab,function(_0x33e31c){if(_0x33e31c[_0x3f52('0x2c')]!==_0x3f52('0x3c')){var _0x49f6ac={};_0x49f6ac[_0x33e31c[_0x3f52('0x28')]]={'$like':'%'+_0x5b9d25[_0x3f52('0x2e')][_0x3f52('0x3a')]+'%'};return _0x49f6ac;}})});}_0x1df8e0=_['merge']({},_0x1df8e0,_0x5b9d25[_0x3f52('0x3d')]);var _0x1fb0a5={'where':_0x1df8e0['where']};return db[_0x3f52('0x2a')][_0x3f52('0x1c')](_0x1fb0a5)[_0x3f52('0x23')](function(_0x1ca153){_0x5b04c5[_0x3f52('0x1c')]=_0x1ca153;if(_0x5b9d25[_0x3f52('0x2e')]['includeAll']){_0x1df8e0[_0x3f52('0x3e')]=[{'all':!![]}];}return db[_0x3f52('0x2a')][_0x3f52('0x3f')](_0x1df8e0);})[_0x3f52('0x23')](function(_0x144293){_0x5b04c5['rows']=_0x144293;return _0x5b04c5;})[_0x3f52('0x23')](respondWithFilteredResult(_0x33e4aa,_0x1df8e0))[_0x3f52('0x40')](handleError(_0x33e4aa,null));};exports['show']=function(_0x4f96f0,_0x2fb34d){var _0x5c8421={'raw':![],'where':{'id':_0x4f96f0[_0x3f52('0x41')]['id']}},_0x422c6d={};_0x422c6d[_0x3f52('0x31')]=_['keys'](db[_0x3f52('0x2a')][_0x3f52('0x2b')]);_0x422c6d['query']=_[_0x3f52('0x2f')](_0x4f96f0[_0x3f52('0x2e')]);_0x422c6d[_0x3f52('0x30')]=_[_0x3f52('0x32')](_0x422c6d[_0x3f52('0x31')],_0x422c6d['query']);_0x5c8421['attributes']=_[_0x3f52('0x32')](_0x422c6d['model'],qs[_0x3f52('0x33')](_0x4f96f0[_0x3f52('0x2e')][_0x3f52('0x33')]));_0x5c8421['attributes']=_0x5c8421[_0x3f52('0x34')]['length']?_0x5c8421[_0x3f52('0x34')]:_0x422c6d[_0x3f52('0x31')];if(_0x4f96f0[_0x3f52('0x2e')][_0x3f52('0x42')]){_0x5c8421[_0x3f52('0x3e')]=[{'all':!![]}];}_0x5c8421=_[_0x3f52('0x3b')]({},_0x5c8421,_0x4f96f0['options']);return db[_0x3f52('0x2a')][_0x3f52('0x43')](_0x5c8421)[_0x3f52('0x23')](handleEntityNotFound(_0x2fb34d,null))['then'](respondWithResult(_0x2fb34d,null))[_0x3f52('0x40')](handleError(_0x2fb34d,null));};exports[_0x3f52('0x44')]=function(_0xaaab67,_0x52a3d2){return db['AnalyticFieldReport'][_0x3f52('0x44')](_0xaaab67[_0x3f52('0x45')],{})['then'](respondWithResult(_0x52a3d2,0xc9))[_0x3f52('0x40')](handleError(_0x52a3d2,null));};exports[_0x3f52('0x46')]=function(_0x59f80b,_0x291a23){return db['AnalyticFieldReport'][_0x3f52('0x46')](_0x59f80b['body'],{'raw':![],'individualHooks':!![]})[_0x3f52('0x23')](respondWithResult(_0x291a23,0xc9))[_0x3f52('0x40')](handleError(_0x291a23,null));};exports['update']=function(_0x51956b,_0x6f6ece){if(_0x51956b[_0x3f52('0x45')]['id']){delete _0x51956b['body']['id'];}return db['AnalyticFieldReport'][_0x3f52('0x43')]({'where':{'id':_0x51956b['params']['id']}})[_0x3f52('0x23')](handleEntityNotFound(_0x6f6ece,null))[_0x3f52('0x23')](saveUpdates(_0x51956b[_0x3f52('0x45')],null))[_0x3f52('0x23')](respondWithResult(_0x6f6ece,null))['catch'](handleError(_0x6f6ece,null));};exports[_0x3f52('0x24')]=function(_0x450e38,_0x595ebe){return db[_0x3f52('0x2a')][_0x3f52('0x43')]({'where':{'id':_0x450e38[_0x3f52('0x41')]['id']}})[_0x3f52('0x23')](handleEntityNotFound(_0x595ebe,null))[_0x3f52('0x23')](removeEntity(_0x595ebe,null))[_0x3f52('0x40')](handleError(_0x595ebe,null));};exports[_0x3f52('0x47')]=function(_0x58ed77,_0x55a806){return db[_0x3f52('0x2a')]['destroy']({'where':{'id':_0x58ed77[_0x3f52('0x2e')][_0x3f52('0x48')]||[]},'raw':![],'individualHooks':!![]})[_0x3f52('0x23')](respondWithResult(_0x55a806,0xcc))[_0x3f52('0x40')](handleError(_0x55a806,null));};exports['addFields']=function(_0x6c7cc5,_0x3bea66,_0x50ee19){return db[_0x3f52('0x49')][_0x3f52('0x4a')]({'where':{'id':_0x6c7cc5[_0x3f52('0x41')]['id']}})['then'](handleEntityNotFound(_0x3bea66,null))[_0x3f52('0x23')](function(_0x1037a6){if(_0x1037a6){return db[_0x3f52('0x4b')]['transaction'](function(_0x25ad3e){return db[_0x3f52('0x2a')][_0x3f52('0x24')]({'where':{'CustomReportId':_0x6c7cc5[_0x3f52('0x41')]['id']},'transaction':_0x25ad3e})['then'](function(_0x11b529){var _0x4f0694=_[_0x3f52('0x29')](_0x6c7cc5[_0x3f52('0x45')],function(_0x3bf614){delete _0x3bf614['id'];_0x3bf614[_0x3f52('0x4c')]=_0x6c7cc5[_0x3f52('0x41')]['id'];return _0x3bf614;});return db[_0x3f52('0x2a')]['bulkCreate'](_0x4f0694,{'transaction':_0x25ad3e});});})['then'](function(){return db[_0x3f52('0x2a')]['findAll']({'where':{'CustomReportId':_0x6c7cc5[_0x3f52('0x41')]['id']}});});}})[_0x3f52('0x23')](respondWithResult(_0x3bea66,null))[_0x3f52('0x40')](handleError(_0x3bea66,null));}; \ No newline at end of file +var _0x8fb4=['fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/util','status','json','offset','undefined','limit','count','set','Content-Range','save','update','destroy','then','error','name','send','map','AnalyticFieldReport','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','includeAll','rows','catch','show','params','fields','include','options','create','bulkCreate','body','find','bulkDestroy','addFields','AnalyticCustomReport','findOne','sequelize','CustomReportId','findAll','eml-format'];(function(_0x41ba0c,_0x1f406a){var _0x10ea82=function(_0x1f870d){while(--_0x1f870d){_0x41ba0c['push'](_0x41ba0c['shift']());}};_0x10ea82(++_0x1f406a);}(_0x8fb4,0x171));var _0x48fb=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x8fb4[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require(_0x48fb('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x48fb('0x1'));var rp=require(_0x48fb('0x2'));var moment=require(_0x48fb('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x48fb('0x4'));var util=require(_0x48fb('0x5'));var path=require('path');var sox=require(_0x48fb('0x6'));var csv=require(_0x48fb('0x7'));var ejs=require(_0x48fb('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x48fb('0x9'));var squel=require(_0x48fb('0xa'));var crypto=require(_0x48fb('0xb'));var jsforce=require(_0x48fb('0xc'));var deskjs=require(_0x48fb('0xd'));var toCsv=require(_0x48fb('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x48fb('0xe'));var authService=require(_0x48fb('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x48fb('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x48fb('0x11'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x11c591,_0x1febf1){_0x1febf1=_0x1febf1||0xcc;return function(_0x77a23b){if(_0x77a23b){return _0x11c591['sendStatus'](_0x1febf1);}return _0x11c591[_0x48fb('0x12')](_0x1febf1)['end']();};}function respondWithResult(_0x4d07e5,_0x416708){_0x416708=_0x416708||0xc8;return function(_0x4ee9bc){if(_0x4ee9bc){return _0x4d07e5['status'](_0x416708)[_0x48fb('0x13')](_0x4ee9bc);}};}function respondWithFilteredResult(_0x157554,_0x6732e){return function(_0x4ea736){if(_0x4ea736){var _0x2e89ae=typeof _0x6732e[_0x48fb('0x14')]===_0x48fb('0x15')&&typeof _0x6732e[_0x48fb('0x16')]==='undefined';var _0x3f2fda=_0x4ea736['count'];var _0x4e7075=_0x2e89ae?0x0:_0x6732e[_0x48fb('0x14')];var _0x84e805=_0x2e89ae?_0x4ea736[_0x48fb('0x17')]:_0x6732e['offset']+_0x6732e['limit'];var _0x153806;if(_0x84e805>=_0x3f2fda){_0x84e805=_0x3f2fda;_0x153806=0xc8;}else{_0x153806=0xce;}_0x157554['status'](_0x153806);return _0x157554[_0x48fb('0x18')](_0x48fb('0x19'),_0x4e7075+'-'+_0x84e805+'/'+_0x3f2fda)['json'](_0x4ea736);}return null;};}function patchUpdates(_0x450c96){return function(_0x436546){try{jsonpatch['apply'](_0x436546,_0x450c96,!![]);}catch(_0x1a896c){return BPromise['reject'](_0x1a896c);}return _0x436546[_0x48fb('0x1a')]();};}function saveUpdates(_0x342ae3,_0x5bc267){return function(_0x3aaff9){if(_0x3aaff9){return _0x3aaff9[_0x48fb('0x1b')](_0x342ae3)['then'](function(_0x141950){return _0x141950;});}return null;};}function removeEntity(_0x666581,_0x13bdaa){return function(_0x1e0ac4){if(_0x1e0ac4){return _0x1e0ac4[_0x48fb('0x1c')]()[_0x48fb('0x1d')](function(){_0x666581[_0x48fb('0x12')](0xcc)['end']();});}};}function handleEntityNotFound(_0x468239,_0x995240){return function(_0x417807){if(!_0x417807){_0x468239['sendStatus'](0x194);}return _0x417807;};}function handleError(_0x95d9b0,_0x2cd0fa){_0x2cd0fa=_0x2cd0fa||0x1f4;return function(_0x3aae32){logger[_0x48fb('0x1e')](_0x3aae32['stack']);if(_0x3aae32['name']){delete _0x3aae32[_0x48fb('0x1f')];}_0x95d9b0[_0x48fb('0x12')](_0x2cd0fa)[_0x48fb('0x20')](_0x3aae32);};}exports['index']=function(_0x48d979,_0x2ad78e){var _0x410f25={},_0x1634d0={},_0x2bb666={'count':0x0,'rows':[]};var _0x244e8a=_[_0x48fb('0x21')](db[_0x48fb('0x22')][_0x48fb('0x23')],function(_0xafbf9c){return{'name':_0xafbf9c[_0x48fb('0x24')],'type':_0xafbf9c[_0x48fb('0x25')][_0x48fb('0x26')]};});_0x1634d0[_0x48fb('0x27')]=_[_0x48fb('0x21')](_0x244e8a,_0x48fb('0x1f'));_0x1634d0['query']=_[_0x48fb('0x28')](_0x48d979[_0x48fb('0x29')]);_0x1634d0[_0x48fb('0x2a')]=_[_0x48fb('0x2b')](_0x1634d0['model'],_0x1634d0[_0x48fb('0x29')]);_0x410f25[_0x48fb('0x2c')]=_[_0x48fb('0x2b')](_0x1634d0['model'],qs['fields'](_0x48d979[_0x48fb('0x29')]['fields']));_0x410f25[_0x48fb('0x2c')]=_0x410f25[_0x48fb('0x2c')][_0x48fb('0x2d')]?_0x410f25[_0x48fb('0x2c')]:_0x1634d0[_0x48fb('0x27')];if(!_0x48d979[_0x48fb('0x29')][_0x48fb('0x2e')](_0x48fb('0x2f'))){_0x410f25['limit']=qs[_0x48fb('0x16')](_0x48d979[_0x48fb('0x29')][_0x48fb('0x16')]);_0x410f25[_0x48fb('0x14')]=qs[_0x48fb('0x14')](_0x48d979[_0x48fb('0x29')][_0x48fb('0x14')]);}_0x410f25[_0x48fb('0x30')]=qs['sort'](_0x48d979[_0x48fb('0x29')][_0x48fb('0x31')]);_0x410f25[_0x48fb('0x32')]=qs[_0x48fb('0x2a')](_[_0x48fb('0x33')](_0x48d979[_0x48fb('0x29')],_0x1634d0[_0x48fb('0x2a')]),_0x244e8a);if(_0x48d979[_0x48fb('0x29')][_0x48fb('0x34')]){_0x410f25[_0x48fb('0x32')]=_['merge'](_0x410f25[_0x48fb('0x32')],{'$or':_[_0x48fb('0x21')](_0x244e8a,function(_0x40968f){if(_0x40968f[_0x48fb('0x25')]!==_0x48fb('0x35')){var _0x61ef3b={};_0x61ef3b[_0x40968f[_0x48fb('0x1f')]]={'$like':'%'+_0x48d979[_0x48fb('0x29')][_0x48fb('0x34')]+'%'};return _0x61ef3b;}})});}_0x410f25=_[_0x48fb('0x36')]({},_0x410f25,_0x48d979['options']);var _0x5833bf={'where':_0x410f25[_0x48fb('0x32')]};return db['AnalyticFieldReport'][_0x48fb('0x17')](_0x5833bf)['then'](function(_0x29c8e9){_0x2bb666[_0x48fb('0x17')]=_0x29c8e9;if(_0x48d979[_0x48fb('0x29')][_0x48fb('0x37')]){_0x410f25['include']=[{'all':!![]}];}return db[_0x48fb('0x22')]['findAll'](_0x410f25);})[_0x48fb('0x1d')](function(_0x5784f6){_0x2bb666[_0x48fb('0x38')]=_0x5784f6;return _0x2bb666;})[_0x48fb('0x1d')](respondWithFilteredResult(_0x2ad78e,_0x410f25))[_0x48fb('0x39')](handleError(_0x2ad78e,null));};exports[_0x48fb('0x3a')]=function(_0x4dd72a,_0x4c6d3c){var _0x402521={'raw':![],'where':{'id':_0x4dd72a[_0x48fb('0x3b')]['id']}},_0x527fcf={};_0x527fcf['model']=_[_0x48fb('0x28')](db[_0x48fb('0x22')][_0x48fb('0x23')]);_0x527fcf[_0x48fb('0x29')]=_[_0x48fb('0x28')](_0x4dd72a[_0x48fb('0x29')]);_0x527fcf['filters']=_[_0x48fb('0x2b')](_0x527fcf[_0x48fb('0x27')],_0x527fcf[_0x48fb('0x29')]);_0x402521[_0x48fb('0x2c')]=_[_0x48fb('0x2b')](_0x527fcf[_0x48fb('0x27')],qs[_0x48fb('0x3c')](_0x4dd72a[_0x48fb('0x29')]['fields']));_0x402521['attributes']=_0x402521['attributes']['length']?_0x402521['attributes']:_0x527fcf['model'];if(_0x4dd72a[_0x48fb('0x29')][_0x48fb('0x37')]){_0x402521[_0x48fb('0x3d')]=[{'all':!![]}];}_0x402521=_[_0x48fb('0x36')]({},_0x402521,_0x4dd72a[_0x48fb('0x3e')]);return db[_0x48fb('0x22')]['find'](_0x402521)[_0x48fb('0x1d')](handleEntityNotFound(_0x4c6d3c,null))[_0x48fb('0x1d')](respondWithResult(_0x4c6d3c,null))[_0x48fb('0x39')](handleError(_0x4c6d3c,null));};exports['create']=function(_0x516552,_0x112e8d){return db['AnalyticFieldReport'][_0x48fb('0x3f')](_0x516552['body'],{})[_0x48fb('0x1d')](respondWithResult(_0x112e8d,0xc9))[_0x48fb('0x39')](handleError(_0x112e8d,null));};exports[_0x48fb('0x40')]=function(_0xdd8a1a,_0x40363b){return db[_0x48fb('0x22')]['bulkCreate'](_0xdd8a1a[_0x48fb('0x41')],{'raw':![],'individualHooks':!![]})[_0x48fb('0x1d')](respondWithResult(_0x40363b,0xc9))[_0x48fb('0x39')](handleError(_0x40363b,null));};exports['update']=function(_0x50408c,_0x1ca462){if(_0x50408c[_0x48fb('0x41')]['id']){delete _0x50408c['body']['id'];}return db[_0x48fb('0x22')][_0x48fb('0x42')]({'where':{'id':_0x50408c['params']['id']}})[_0x48fb('0x1d')](handleEntityNotFound(_0x1ca462,null))[_0x48fb('0x1d')](saveUpdates(_0x50408c['body'],null))[_0x48fb('0x1d')](respondWithResult(_0x1ca462,null))[_0x48fb('0x39')](handleError(_0x1ca462,null));};exports[_0x48fb('0x1c')]=function(_0x350b40,_0x434f66){return db[_0x48fb('0x22')][_0x48fb('0x42')]({'where':{'id':_0x350b40[_0x48fb('0x3b')]['id']}})[_0x48fb('0x1d')](handleEntityNotFound(_0x434f66,null))[_0x48fb('0x1d')](removeEntity(_0x434f66,null))[_0x48fb('0x39')](handleError(_0x434f66,null));};exports[_0x48fb('0x43')]=function(_0x3dd94b,_0x46d1cb){return db[_0x48fb('0x22')][_0x48fb('0x1c')]({'where':{'id':_0x3dd94b[_0x48fb('0x29')]['ids']||[]},'raw':![],'individualHooks':!![]})[_0x48fb('0x1d')](respondWithResult(_0x46d1cb,0xcc))['catch'](handleError(_0x46d1cb,null));};exports[_0x48fb('0x44')]=function(_0xcc9417,_0x24fd8e,_0x58731e){return db[_0x48fb('0x45')][_0x48fb('0x46')]({'where':{'id':_0xcc9417['params']['id']}})[_0x48fb('0x1d')](handleEntityNotFound(_0x24fd8e,null))[_0x48fb('0x1d')](function(_0x144175){if(_0x144175){return db[_0x48fb('0x47')]['transaction'](function(_0x2257f7){return db[_0x48fb('0x22')][_0x48fb('0x1c')]({'where':{'CustomReportId':_0xcc9417[_0x48fb('0x3b')]['id']},'transaction':_0x2257f7})[_0x48fb('0x1d')](function(_0x1beb0c){var _0x48366c=_[_0x48fb('0x21')](_0xcc9417[_0x48fb('0x41')],function(_0x5c5f2c){delete _0x5c5f2c['id'];_0x5c5f2c[_0x48fb('0x48')]=_0xcc9417['params']['id'];return _0x5c5f2c;});return db[_0x48fb('0x22')][_0x48fb('0x40')](_0x48366c,{'transaction':_0x2257f7});});})[_0x48fb('0x1d')](function(){return db[_0x48fb('0x22')][_0x48fb('0x49')]({'where':{'CustomReportId':_0xcc9417[_0x48fb('0x3b')]['id']}});});}})[_0x48fb('0x1d')](respondWithResult(_0x24fd8e,null))['catch'](handleError(_0x24fd8e,null));}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js index 5ab12b0..664ae03 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 _0x0e5c=['moment','bluebird','request-promise','rimraf','../../config/environment','./analyticFieldReport.attributes','exports','AnalyticFieldReport','analytics_report_fields','lodash','util','../../config/logger'];(function(_0x44cf11,_0x2b3e94){var _0x340b46=function(_0x239e00){while(--_0x239e00){_0x44cf11['push'](_0x44cf11['shift']());}};_0x340b46(++_0x2b3e94);}(_0x0e5c,0xf9));var _0xc0e5=function(_0x2637ac,_0x377857){_0x2637ac=_0x2637ac-0x0;var _0x4a5758=_0x0e5c[_0x2637ac];return _0x4a5758;};'use strict';var _=require(_0xc0e5('0x0'));var util=require(_0xc0e5('0x1'));var logger=require(_0xc0e5('0x2'))('api');var moment=require(_0xc0e5('0x3'));var BPromise=require(_0xc0e5('0x4'));var rp=require(_0xc0e5('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc0e5('0x6'));var config=require(_0xc0e5('0x7'));var attributes=require(_0xc0e5('0x8'));module[_0xc0e5('0x9')]=function(_0x191066,_0x11e1d8){return _0x191066['define'](_0xc0e5('0xa'),attributes,{'tableName':_0xc0e5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8134=['bluebird','request-promise','rimraf','../../config/environment','exports','define','AnalyticFieldReport','analytics_report_fields','lodash','util','../../config/logger','api'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x8134,0x17c));var _0x4813=function(_0x1c24cd,_0x43643c){_0x1c24cd=_0x1c24cd-0x0;var _0x4a344a=_0x8134[_0x1c24cd];return _0x4a344a;};'use strict';var _=require(_0x4813('0x0'));var util=require(_0x4813('0x1'));var logger=require(_0x4813('0x2'))(_0x4813('0x3'));var moment=require('moment');var BPromise=require(_0x4813('0x4'));var rp=require(_0x4813('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4813('0x6'));var config=require(_0x4813('0x7'));var attributes=require('./analyticFieldReport.attributes');module[_0x4813('0x8')]=function(_0x16274a,_0x42f81c){return _0x16274a[_0x4813('0x9')](_0x4813('0xa'),attributes,{'tableName':_0x4813('0xb'),'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 76220bf..dd0933f 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 _0xeb8e=['message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','error'];(function(_0x52e0ed,_0x37ad14){var _0x4cc89b=function(_0x2836fb){while(--_0x2836fb){_0x52e0ed['push'](_0x52e0ed['shift']());}};_0x4cc89b(++_0x37ad14);}(_0xeb8e,0xb6));var _0xeeb8=function(_0x46ba59,_0x13776e){_0x46ba59=_0x46ba59-0x0;var _0x4f4ef7=_0xeb8e[_0x46ba59];return _0x4f4ef7;};'use strict';var _=require(_0xeeb8('0x0'));var util=require(_0xeeb8('0x1'));var moment=require(_0xeeb8('0x2'));var BPromise=require(_0xeeb8('0x3'));var rs=require(_0xeeb8('0x4'));var fs=require('fs');var Redis=require(_0xeeb8('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xeeb8('0x6'));var logger=require(_0xeeb8('0x7'))(_0xeeb8('0x8'));var config=require(_0xeeb8('0x9'));var jayson=require(_0xeeb8('0xa'));var client=jayson['client'][_0xeeb8('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5d9bbb,_0x40523e,_0x2a703c){return new BPromise(function(_0xfc258f,_0x45ac77){return client['request'](_0x5d9bbb,_0x2a703c)['then'](function(_0x454387){logger[_0xeeb8('0xc')](_0xeeb8('0xd'),_0x40523e,_0xeeb8('0xe'));logger['debug']('AnalyticFieldReport,\x20%s,\x20%s,\x20%s',_0x40523e,_0xeeb8('0xe'),JSON['stringify'](_0x454387));if(_0x454387[_0xeeb8('0xf')]){if(_0x454387[_0xeeb8('0xf')]['code']===0x1f4){logger[_0xeeb8('0xf')]('AnalyticFieldReport,\x20%s,\x20%s',_0x40523e,_0x454387['error'][_0xeeb8('0x10')]);return _0x45ac77(_0x454387[_0xeeb8('0xf')][_0xeeb8('0x10')]);}logger[_0xeeb8('0xf')](_0xeeb8('0xd'),_0x40523e,_0x454387['error'][_0xeeb8('0x10')]);return _0xfc258f(_0x454387[_0xeeb8('0xf')][_0xeeb8('0x10')]);}else{logger[_0xeeb8('0xc')](_0xeeb8('0xd'),_0x40523e,_0xeeb8('0xe'));_0xfc258f(_0x454387[_0xeeb8('0x11')][_0xeeb8('0x10')]);}})['catch'](function(_0xaf867){logger[_0xeeb8('0xf')](_0xeeb8('0xd'),_0x40523e,_0xaf867);_0x45ac77(_0xaf867);});});} \ No newline at end of file +var _0x7fda=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','AnalyticFieldReport,\x20%s,\x20%s','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','result','catch','lodash','util','moment','bluebird'];(function(_0x50eeec,_0x537e74){var _0x2a78d9=function(_0x45a5a7){while(--_0x45a5a7){_0x50eeec['push'](_0x50eeec['shift']());}};_0x2a78d9(++_0x537e74);}(_0x7fda,0x1d7));var _0xa7fd=function(_0x3540d8,_0xeb99d4){_0x3540d8=_0x3540d8-0x0;var _0x515fbd=_0x7fda[_0x3540d8];return _0x515fbd;};'use strict';var _=require(_0xa7fd('0x0'));var util=require(_0xa7fd('0x1'));var moment=require(_0xa7fd('0x2'));var BPromise=require(_0xa7fd('0x3'));var rs=require(_0xa7fd('0x4'));var fs=require('fs');var Redis=require(_0xa7fd('0x5'));var db=require(_0xa7fd('0x6'))['db'];var utils=require(_0xa7fd('0x7'));var logger=require(_0xa7fd('0x8'))(_0xa7fd('0x9'));var config=require('../../config/environment');var jayson=require(_0xa7fd('0xa'));var client=jayson[_0xa7fd('0xb')][_0xa7fd('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x271dcd,_0x59c7d5,_0x49e185){return new BPromise(function(_0x277f25,_0xb24aed){return client[_0xa7fd('0xd')](_0x271dcd,_0x49e185)[_0xa7fd('0xe')](function(_0x5810bf){logger['info'](_0xa7fd('0xf'),_0x59c7d5,'request\x20sent');logger[_0xa7fd('0x10')](_0xa7fd('0x11'),_0x59c7d5,_0xa7fd('0x12'),JSON[_0xa7fd('0x13')](_0x5810bf));if(_0x5810bf[_0xa7fd('0x14')]){if(_0x5810bf['error']['code']===0x1f4){logger[_0xa7fd('0x14')](_0xa7fd('0xf'),_0x59c7d5,_0x5810bf[_0xa7fd('0x14')][_0xa7fd('0x15')]);return _0xb24aed(_0x5810bf['error'][_0xa7fd('0x15')]);}logger[_0xa7fd('0x14')](_0xa7fd('0xf'),_0x59c7d5,_0x5810bf['error'][_0xa7fd('0x15')]);return _0x277f25(_0x5810bf[_0xa7fd('0x14')][_0xa7fd('0x15')]);}else{logger[_0xa7fd('0x16')](_0xa7fd('0xf'),_0x59c7d5,_0xa7fd('0x12'));_0x277f25(_0x5810bf[_0xa7fd('0x17')][_0xa7fd('0x15')]);}})[_0xa7fd('0x18')](function(_0x7f54bf){logger[_0xa7fd('0x14')](_0xa7fd('0xf'),_0x59c7d5,_0x7f54bf);_0xb24aed(_0x7f54bf);});});} \ No newline at end of file diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js index e93ee35..c4db127 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(_0x4e7fdc,_0x3fee62){var _0x258325=function(_0x27dd05){while(--_0x27dd05){_0x4e7fdc['push'](_0x4e7fdc['shift']());}};_0x258325(++_0x3fee62);}(_0xa9e0,0x123));var _0x0a9e=function(_0x36dfbd,_0x5bfe2d){_0x36dfbd=_0x36dfbd-0x0;var _0x4ecad9=_0xa9e0[_0x36dfbd];return _0x4ecad9;};'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(_0x13bfdc,_0xd30266){var _0x208cc6=function(_0x2e75b3){while(--_0x2e75b3){_0x13bfdc['push'](_0x13bfdc['shift']());}};_0x208cc6(++_0xd30266);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xa9e0[_0x5b644e];return _0x49c6bf;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0xb')]('/',auth['isAuthenticated'](),controller['create']);router[_0x0a9e('0xb')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xb')](_0x0a9e('0xf'),auth['isAuthenticated'](),controller['addFields']);router['put']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x11')](_0x0a9e('0x12'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);router['delete'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x14')]);module[_0x0a9e('0x15')]=router; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.attributes.js b/server/api/analyticMetric/analyticMetric.attributes.js index 8b45045..09cefa0 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 _0x4e83=['name','exports','STRING'];(function(_0x2f05ea,_0x2ece07){var _0x43a9c0=function(_0x1187b1){while(--_0x1187b1){_0x2f05ea['push'](_0x2f05ea['shift']());}};_0x43a9c0(++_0x2ece07);}(_0x4e83,0x88));var _0x34e8=function(_0x291276,_0x5a4690){_0x291276=_0x291276-0x0;var _0x303ab3=_0x4e83[_0x291276];return _0x303ab3;};'use strict';var Sequelize=require('sequelize');module[_0x34e8('0x0')]={'name':{'type':Sequelize[_0x34e8('0x1')],'allowNull':![],'unique':_0x34e8('0x2')},'table':{'type':Sequelize[_0x34e8('0x1')]},'metric':{'type':Sequelize['TEXT']},'description':{'type':Sequelize[_0x34e8('0x1')]}}; \ No newline at end of file +var _0x9e5e=['STRING','TEXT','sequelize','exports','name'];(function(_0x24516c,_0x59fcd8){var _0xaf2987=function(_0x9f8828){while(--_0x9f8828){_0x24516c['push'](_0x24516c['shift']());}};_0xaf2987(++_0x59fcd8);}(_0x9e5e,0x1e2));var _0xe9e5=function(_0x243b59,_0x3f9495){_0x243b59=_0x243b59-0x0;var _0x3e1676=_0x9e5e[_0x243b59];return _0x3e1676;};'use strict';var Sequelize=require(_0xe9e5('0x0'));module[_0xe9e5('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xe9e5('0x2')},'table':{'type':Sequelize[_0xe9e5('0x3')]},'metric':{'type':Sequelize[_0xe9e5('0x4')]},'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 2f08890..ea90f30 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 _0xe14b=['papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','limit','count','offset','set','json','apply','save','update','then','get','Metrics','UserProfileResource','destroy','error','stack','name','send','index','map','AnalyticMetric','rawAttributes','fieldName','type','model','query','filters','attributes','intersection','fields','order','sort','pick','filter','where','merge','VIRTUAL','options','include','findAll','rows','show','keys','length','includeAll','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','params','eml-format','rimraf','request-promise','moment','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring'];(function(_0xaa0527,_0x4cdcfa){var _0x44076a=function(_0x54f595){while(--_0x54f595){_0xaa0527['push'](_0xaa0527['shift']());}};_0x44076a(++_0x4cdcfa);}(_0xe14b,0x93));var _0xbe14=function(_0x4dcaa2,_0x1315e5){_0x4dcaa2=_0x4dcaa2-0x0;var _0x500c72=_0xe14b[_0x4dcaa2];return _0x500c72;};'use strict';var emlformat=require(_0xbe14('0x0'));var rimraf=require(_0xbe14('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xbe14('0x2'));var moment=require(_0xbe14('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xbe14('0x4'));var util=require('util');var path=require('path');var sox=require(_0xbe14('0x5'));var csv=require(_0xbe14('0x6'));var ejs=require(_0xbe14('0x7'));var fs=require('fs');var fs_extra=require(_0xbe14('0x8'));var _=require(_0xbe14('0x9'));var squel=require(_0xbe14('0xa'));var crypto=require(_0xbe14('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xbe14('0xc'));var Papa=require(_0xbe14('0xd'));var Redis=require(_0xbe14('0xe'));var authService=require(_0xbe14('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbe14('0x10'));var logger=require(_0xbe14('0x11'))('api');var utils=require(_0xbe14('0x12'));var config=require(_0xbe14('0x13'));var licenseUtil=require(_0xbe14('0x14'));var db=require(_0xbe14('0x15'))['db'];function respondWithStatusCode(_0x27792f,_0x3b898d){_0x3b898d=_0x3b898d||0xcc;return function(_0x23a730){if(_0x23a730){return _0x27792f[_0xbe14('0x16')](_0x3b898d);}return _0x27792f[_0xbe14('0x17')](_0x3b898d)[_0xbe14('0x18')]();};}function respondWithResult(_0x1e4826,_0x33fd54){_0x33fd54=_0x33fd54||0xc8;return function(_0x813399){if(_0x813399){return _0x1e4826['status'](_0x33fd54)['json'](_0x813399);}};}function respondWithFilteredResult(_0x3f58f5,_0x3dc4a9){return function(_0xf4ac9){if(_0xf4ac9){var _0x37ce4e=typeof _0x3dc4a9['offset']===_0xbe14('0x19')&&typeof _0x3dc4a9[_0xbe14('0x1a')]===_0xbe14('0x19');var _0x123ede=_0xf4ac9[_0xbe14('0x1b')];var _0x29ab73=_0x37ce4e?0x0:_0x3dc4a9[_0xbe14('0x1c')];var _0x5ea1f8=_0x37ce4e?_0xf4ac9[_0xbe14('0x1b')]:_0x3dc4a9[_0xbe14('0x1c')]+_0x3dc4a9[_0xbe14('0x1a')];var _0x433459;if(_0x5ea1f8>=_0x123ede){_0x5ea1f8=_0x123ede;_0x433459=0xc8;}else{_0x433459=0xce;}_0x3f58f5[_0xbe14('0x17')](_0x433459);return _0x3f58f5[_0xbe14('0x1d')]('Content-Range',_0x29ab73+'-'+_0x5ea1f8+'/'+_0x123ede)[_0xbe14('0x1e')](_0xf4ac9);}return null;};}function patchUpdates(_0x4a1bbd){return function(_0x417c8d){try{jsonpatch[_0xbe14('0x1f')](_0x417c8d,_0x4a1bbd,!![]);}catch(_0x188ec4){return BPromise['reject'](_0x188ec4);}return _0x417c8d[_0xbe14('0x20')]();};}function saveUpdates(_0x56d845,_0x3c1c85){return function(_0x56e80c){if(_0x56e80c){return _0x56e80c[_0xbe14('0x21')](_0x56d845)['then'](function(_0x274018){return _0x274018;});}return null;};}function removeEntity(_0x3d3608,_0x505dbd){return function(_0x2da350){if(_0x2da350){return _0x2da350['destroy']()[_0xbe14('0x22')](function(){var _0x4851f8=_0x2da350[_0xbe14('0x23')]({'plain':!![]});var _0x5fa043=_0xbe14('0x24');return db[_0xbe14('0x25')][_0xbe14('0x26')]({'where':{'type':_0x5fa043,'resourceId':_0x4851f8['id']}})[_0xbe14('0x22')](function(){return _0x2da350;});})['then'](function(){_0x3d3608[_0xbe14('0x17')](0xcc)[_0xbe14('0x18')]();});}};}function handleEntityNotFound(_0x391556,_0x169369){return function(_0x5dd475){if(!_0x5dd475){_0x391556[_0xbe14('0x16')](0x194);}return _0x5dd475;};}function handleError(_0x29fc64,_0x59bf34){_0x59bf34=_0x59bf34||0x1f4;return function(_0x3c3613){logger[_0xbe14('0x27')](_0x3c3613[_0xbe14('0x28')]);if(_0x3c3613[_0xbe14('0x29')]){delete _0x3c3613[_0xbe14('0x29')];}_0x29fc64[_0xbe14('0x17')](_0x59bf34)[_0xbe14('0x2a')](_0x3c3613);};}exports[_0xbe14('0x2b')]=function(_0x4168c8,_0x16a159){var _0x40538f={},_0x3bf43c={},_0x39dc0a={'count':0x0,'rows':[]};var _0x10ae36=_[_0xbe14('0x2c')](db[_0xbe14('0x2d')][_0xbe14('0x2e')],function(_0x2ff48e){return{'name':_0x2ff48e[_0xbe14('0x2f')],'type':_0x2ff48e[_0xbe14('0x30')]['key']};});_0x3bf43c[_0xbe14('0x31')]=_['map'](_0x10ae36,'name');_0x3bf43c[_0xbe14('0x32')]=_['keys'](_0x4168c8[_0xbe14('0x32')]);_0x3bf43c[_0xbe14('0x33')]=_['intersection'](_0x3bf43c['model'],_0x3bf43c['query']);_0x40538f[_0xbe14('0x34')]=_[_0xbe14('0x35')](_0x3bf43c['model'],qs[_0xbe14('0x36')](_0x4168c8[_0xbe14('0x32')][_0xbe14('0x36')]));_0x40538f[_0xbe14('0x34')]=_0x40538f[_0xbe14('0x34')]['length']?_0x40538f['attributes']:_0x3bf43c[_0xbe14('0x31')];if(!_0x4168c8['query']['hasOwnProperty']('nolimit')){_0x40538f[_0xbe14('0x1a')]=qs[_0xbe14('0x1a')](_0x4168c8[_0xbe14('0x32')][_0xbe14('0x1a')]);_0x40538f[_0xbe14('0x1c')]=qs[_0xbe14('0x1c')](_0x4168c8[_0xbe14('0x32')][_0xbe14('0x1c')]);}_0x40538f[_0xbe14('0x37')]=qs[_0xbe14('0x38')](_0x4168c8[_0xbe14('0x32')][_0xbe14('0x38')]);_0x40538f['where']=qs['filters'](_[_0xbe14('0x39')](_0x4168c8[_0xbe14('0x32')],_0x3bf43c[_0xbe14('0x33')]),_0x10ae36);if(_0x4168c8['query'][_0xbe14('0x3a')]){_0x40538f[_0xbe14('0x3b')]=_[_0xbe14('0x3c')](_0x40538f[_0xbe14('0x3b')],{'$or':_[_0xbe14('0x2c')](_0x10ae36,function(_0x25ee1f){if(_0x25ee1f[_0xbe14('0x30')]!==_0xbe14('0x3d')){var _0x1b2608={};_0x1b2608[_0x25ee1f['name']]={'$like':'%'+_0x4168c8[_0xbe14('0x32')][_0xbe14('0x3a')]+'%'};return _0x1b2608;}})});}_0x40538f=_[_0xbe14('0x3c')]({},_0x40538f,_0x4168c8[_0xbe14('0x3e')]);var _0x3287b9={'where':_0x40538f[_0xbe14('0x3b')]};return db['AnalyticMetric'][_0xbe14('0x1b')](_0x3287b9)[_0xbe14('0x22')](function(_0x1220c9){_0x39dc0a[_0xbe14('0x1b')]=_0x1220c9;if(_0x4168c8['query']['includeAll']){_0x40538f[_0xbe14('0x3f')]=[{'all':!![]}];}return db[_0xbe14('0x2d')][_0xbe14('0x40')](_0x40538f);})['then'](function(_0x5d5318){_0x39dc0a[_0xbe14('0x41')]=_0x5d5318;return _0x39dc0a;})['then'](respondWithFilteredResult(_0x16a159,_0x40538f))['catch'](handleError(_0x16a159,null));};exports[_0xbe14('0x42')]=function(_0x1f0355,_0x8216c3){var _0x5051e4={'raw':!![],'where':{'id':_0x1f0355['params']['id']}},_0x558525={};_0x558525[_0xbe14('0x31')]=_[_0xbe14('0x43')](db[_0xbe14('0x2d')]['rawAttributes']);_0x558525[_0xbe14('0x32')]=_[_0xbe14('0x43')](_0x1f0355[_0xbe14('0x32')]);_0x558525[_0xbe14('0x33')]=_['intersection'](_0x558525['model'],_0x558525[_0xbe14('0x32')]);_0x5051e4[_0xbe14('0x34')]=_[_0xbe14('0x35')](_0x558525[_0xbe14('0x31')],qs[_0xbe14('0x36')](_0x1f0355['query']['fields']));_0x5051e4[_0xbe14('0x34')]=_0x5051e4[_0xbe14('0x34')][_0xbe14('0x44')]?_0x5051e4[_0xbe14('0x34')]:_0x558525['model'];if(_0x1f0355[_0xbe14('0x32')][_0xbe14('0x45')]){_0x5051e4['include']=[{'all':!![]}];}_0x5051e4=_[_0xbe14('0x3c')]({},_0x5051e4,_0x1f0355[_0xbe14('0x3e')]);return db[_0xbe14('0x2d')][_0xbe14('0x46')](_0x5051e4)['then'](handleEntityNotFound(_0x8216c3,null))['then'](respondWithResult(_0x8216c3,null))[_0xbe14('0x47')](handleError(_0x8216c3,null));};exports[_0xbe14('0x48')]=function(_0x4a1a37,_0x5acf90){return db[_0xbe14('0x2d')][_0xbe14('0x48')](_0x4a1a37[_0xbe14('0x49')],{})[_0xbe14('0x22')](function(_0xdbc6e1){var _0xd04fd5=_0x4a1a37[_0xbe14('0x4a')]['get']({'plain':!![]});if(!_0xd04fd5)throw new Error(_0xbe14('0x4b'));if(_0xd04fd5[_0xbe14('0x4c')]===_0xbe14('0x4a')){var _0x22b1f8=_0xdbc6e1[_0xbe14('0x23')]({'plain':!![]});var _0x494c32=_0xbe14('0x24');return db[_0xbe14('0x4d')][_0xbe14('0x46')]({'where':{'name':_0x494c32,'userProfileId':_0xd04fd5[_0xbe14('0x4e')]},'raw':!![]})[_0xbe14('0x22')](function(_0x2dbeb1){if(_0x2dbeb1&&_0x2dbeb1['autoAssociation']===0x0){return db['UserProfileResource'][_0xbe14('0x48')]({'name':_0x22b1f8[_0xbe14('0x29')],'resourceId':_0x22b1f8['id'],'type':_0x2dbeb1[_0xbe14('0x29')],'sectionId':_0x2dbeb1['id']},{})['then'](function(){return _0xdbc6e1;});}else{return _0xdbc6e1;}})['catch'](function(_0x44fe0d){logger[_0xbe14('0x27')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x44fe0d);throw _0x44fe0d;});}return _0xdbc6e1;})[_0xbe14('0x22')](respondWithResult(_0x5acf90,0xc9))[_0xbe14('0x47')](handleError(_0x5acf90,null));};exports['update']=function(_0x28f995,_0x4a40d2){if(_0x28f995[_0xbe14('0x49')]['id']){delete _0x28f995[_0xbe14('0x49')]['id'];}return db[_0xbe14('0x2d')]['find']({'where':{'id':_0x28f995[_0xbe14('0x4f')]['id']}})[_0xbe14('0x22')](handleEntityNotFound(_0x4a40d2,null))['then'](saveUpdates(_0x28f995[_0xbe14('0x49')],null))[_0xbe14('0x22')](respondWithResult(_0x4a40d2,null))[_0xbe14('0x47')](handleError(_0x4a40d2,null));};exports[_0xbe14('0x26')]=function(_0x49322f,_0x4f06a3){return db[_0xbe14('0x2d')][_0xbe14('0x46')]({'where':{'id':_0x49322f[_0xbe14('0x4f')]['id']}})[_0xbe14('0x22')](handleEntityNotFound(_0x4f06a3,null))[_0xbe14('0x22')](removeEntity(_0x4f06a3,null))[_0xbe14('0x47')](handleError(_0x4f06a3,null));}; \ No newline at end of file +var _0x7217=['Content-Range','apply','reject','save','update','then','destroy','get','Metrics','UserProfileResource','sendStatus','error','stack','name','send','index','map','AnalyticMetric','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','nolimit','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','rows','catch','show','params','rawAttributes','find','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set'];(function(_0x3cdc74,_0x451492){var _0xf75be2=function(_0x24c053){while(--_0x24c053){_0x3cdc74['push'](_0x3cdc74['shift']());}};_0xf75be2(++_0x451492);}(_0x7217,0x19e));var _0x7721=function(_0x1b349a,_0x22222c){_0x1b349a=_0x1b349a-0x0;var _0x5d1f7c=_0x7217[_0x1b349a];return _0x5d1f7c;};'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('mustache');var util=require('util');var path=require(_0x7721('0x6'));var sox=require(_0x7721('0x7'));var csv=require(_0x7721('0x8'));var ejs=require(_0x7721('0x9'));var fs=require('fs');var fs_extra=require(_0x7721('0xa'));var _=require(_0x7721('0xb'));var squel=require(_0x7721('0xc'));var crypto=require(_0x7721('0xd'));var jsforce=require(_0x7721('0xe'));var deskjs=require(_0x7721('0xf'));var toCsv=require(_0x7721('0x8'));var querystring=require(_0x7721('0x10'));var Papa=require(_0x7721('0x11'));var Redis=require(_0x7721('0x12'));var authService=require(_0x7721('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x7721('0x14'));var hardwareService=require(_0x7721('0x15'));var logger=require(_0x7721('0x16'))(_0x7721('0x17'));var utils=require(_0x7721('0x18'));var config=require(_0x7721('0x19'));var licenseUtil=require(_0x7721('0x1a'));var db=require(_0x7721('0x1b'))['db'];function respondWithStatusCode(_0x55b4ca,_0x2911ec){_0x2911ec=_0x2911ec||0xcc;return function(_0x199930){if(_0x199930){return _0x55b4ca['sendStatus'](_0x2911ec);}return _0x55b4ca[_0x7721('0x1c')](_0x2911ec)[_0x7721('0x1d')]();};}function respondWithResult(_0x3f01c5,_0x2e9752){_0x2e9752=_0x2e9752||0xc8;return function(_0x5069da){if(_0x5069da){return _0x3f01c5[_0x7721('0x1c')](_0x2e9752)[_0x7721('0x1e')](_0x5069da);}};}function respondWithFilteredResult(_0x534f1b,_0x4e199a){return function(_0x4b183e){if(_0x4b183e){var _0x5ed54=typeof _0x4e199a[_0x7721('0x1f')]===_0x7721('0x20')&&typeof _0x4e199a[_0x7721('0x21')]==='undefined';var _0x20f669=_0x4b183e['count'];var _0x3fc09e=_0x5ed54?0x0:_0x4e199a['offset'];var _0xfec626=_0x5ed54?_0x4b183e[_0x7721('0x22')]:_0x4e199a[_0x7721('0x1f')]+_0x4e199a[_0x7721('0x21')];var _0x2286e5;if(_0xfec626>=_0x20f669){_0xfec626=_0x20f669;_0x2286e5=0xc8;}else{_0x2286e5=0xce;}_0x534f1b[_0x7721('0x1c')](_0x2286e5);return _0x534f1b[_0x7721('0x23')](_0x7721('0x24'),_0x3fc09e+'-'+_0xfec626+'/'+_0x20f669)[_0x7721('0x1e')](_0x4b183e);}return null;};}function patchUpdates(_0xaeccc4){return function(_0x4ce1db){try{jsonpatch[_0x7721('0x25')](_0x4ce1db,_0xaeccc4,!![]);}catch(_0x2c1583){return BPromise[_0x7721('0x26')](_0x2c1583);}return _0x4ce1db[_0x7721('0x27')]();};}function saveUpdates(_0x57140c,_0x28f5a6){return function(_0x512f31){if(_0x512f31){return _0x512f31[_0x7721('0x28')](_0x57140c)[_0x7721('0x29')](function(_0x3e8a4e){return _0x3e8a4e;});}return null;};}function removeEntity(_0x1caad8,_0x121cc4){return function(_0x395b15){if(_0x395b15){return _0x395b15[_0x7721('0x2a')]()['then'](function(){var _0x216f20=_0x395b15[_0x7721('0x2b')]({'plain':!![]});var _0x125564=_0x7721('0x2c');return db[_0x7721('0x2d')][_0x7721('0x2a')]({'where':{'type':_0x125564,'resourceId':_0x216f20['id']}})[_0x7721('0x29')](function(){return _0x395b15;});})[_0x7721('0x29')](function(){_0x1caad8[_0x7721('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x258ddf,_0x5b0551){return function(_0x499b87){if(!_0x499b87){_0x258ddf[_0x7721('0x2e')](0x194);}return _0x499b87;};}function handleError(_0x343c19,_0x53c904){_0x53c904=_0x53c904||0x1f4;return function(_0x158d98){logger[_0x7721('0x2f')](_0x158d98[_0x7721('0x30')]);if(_0x158d98[_0x7721('0x31')]){delete _0x158d98[_0x7721('0x31')];}_0x343c19['status'](_0x53c904)[_0x7721('0x32')](_0x158d98);};}exports[_0x7721('0x33')]=function(_0x497f9f,_0x4a25c9){var _0xfde9ec={},_0x220bbf={},_0x48f329={'count':0x0,'rows':[]};var _0x46f772=_[_0x7721('0x34')](db[_0x7721('0x35')]['rawAttributes'],function(_0x3d9a32){return{'name':_0x3d9a32[_0x7721('0x36')],'type':_0x3d9a32[_0x7721('0x37')][_0x7721('0x38')]};});_0x220bbf[_0x7721('0x39')]=_['map'](_0x46f772,_0x7721('0x31'));_0x220bbf[_0x7721('0x3a')]=_[_0x7721('0x3b')](_0x497f9f['query']);_0x220bbf[_0x7721('0x3c')]=_[_0x7721('0x3d')](_0x220bbf['model'],_0x220bbf[_0x7721('0x3a')]);_0xfde9ec['attributes']=_[_0x7721('0x3d')](_0x220bbf[_0x7721('0x39')],qs[_0x7721('0x3e')](_0x497f9f[_0x7721('0x3a')][_0x7721('0x3e')]));_0xfde9ec[_0x7721('0x3f')]=_0xfde9ec[_0x7721('0x3f')][_0x7721('0x40')]?_0xfde9ec[_0x7721('0x3f')]:_0x220bbf[_0x7721('0x39')];if(!_0x497f9f[_0x7721('0x3a')]['hasOwnProperty'](_0x7721('0x41'))){_0xfde9ec['limit']=qs[_0x7721('0x21')](_0x497f9f[_0x7721('0x3a')][_0x7721('0x21')]);_0xfde9ec[_0x7721('0x1f')]=qs[_0x7721('0x1f')](_0x497f9f[_0x7721('0x3a')]['offset']);}_0xfde9ec['order']=qs['sort'](_0x497f9f['query'][_0x7721('0x42')]);_0xfde9ec[_0x7721('0x43')]=qs[_0x7721('0x3c')](_[_0x7721('0x44')](_0x497f9f['query'],_0x220bbf[_0x7721('0x3c')]),_0x46f772);if(_0x497f9f['query'][_0x7721('0x45')]){_0xfde9ec[_0x7721('0x43')]=_['merge'](_0xfde9ec[_0x7721('0x43')],{'$or':_[_0x7721('0x34')](_0x46f772,function(_0x4e77ff){if(_0x4e77ff['type']!==_0x7721('0x46')){var _0xfc4dc4={};_0xfc4dc4[_0x4e77ff[_0x7721('0x31')]]={'$like':'%'+_0x497f9f[_0x7721('0x3a')]['filter']+'%'};return _0xfc4dc4;}})});}_0xfde9ec=_[_0x7721('0x47')]({},_0xfde9ec,_0x497f9f[_0x7721('0x48')]);var _0x40ce8c={'where':_0xfde9ec[_0x7721('0x43')]};return db[_0x7721('0x35')]['count'](_0x40ce8c)[_0x7721('0x29')](function(_0x4a2c28){_0x48f329[_0x7721('0x22')]=_0x4a2c28;if(_0x497f9f['query'][_0x7721('0x49')]){_0xfde9ec[_0x7721('0x4a')]=[{'all':!![]}];}return db[_0x7721('0x35')]['findAll'](_0xfde9ec);})[_0x7721('0x29')](function(_0x11d853){_0x48f329[_0x7721('0x4b')]=_0x11d853;return _0x48f329;})['then'](respondWithFilteredResult(_0x4a25c9,_0xfde9ec))[_0x7721('0x4c')](handleError(_0x4a25c9,null));};exports[_0x7721('0x4d')]=function(_0xdb3033,_0x2d5f35){var _0x135dbc={'raw':!![],'where':{'id':_0xdb3033[_0x7721('0x4e')]['id']}},_0x57d09b={};_0x57d09b['model']=_['keys'](db[_0x7721('0x35')][_0x7721('0x4f')]);_0x57d09b[_0x7721('0x3a')]=_[_0x7721('0x3b')](_0xdb3033[_0x7721('0x3a')]);_0x57d09b[_0x7721('0x3c')]=_[_0x7721('0x3d')](_0x57d09b[_0x7721('0x39')],_0x57d09b[_0x7721('0x3a')]);_0x135dbc[_0x7721('0x3f')]=_['intersection'](_0x57d09b['model'],qs[_0x7721('0x3e')](_0xdb3033[_0x7721('0x3a')][_0x7721('0x3e')]));_0x135dbc[_0x7721('0x3f')]=_0x135dbc['attributes'][_0x7721('0x40')]?_0x135dbc[_0x7721('0x3f')]:_0x57d09b['model'];if(_0xdb3033[_0x7721('0x3a')]['includeAll']){_0x135dbc[_0x7721('0x4a')]=[{'all':!![]}];}_0x135dbc=_['merge']({},_0x135dbc,_0xdb3033[_0x7721('0x48')]);return db[_0x7721('0x35')][_0x7721('0x50')](_0x135dbc)['then'](handleEntityNotFound(_0x2d5f35,null))[_0x7721('0x29')](respondWithResult(_0x2d5f35,null))[_0x7721('0x4c')](handleError(_0x2d5f35,null));};exports['create']=function(_0x223d93,_0x1196c2){return db[_0x7721('0x35')]['create'](_0x223d93[_0x7721('0x51')],{})['then'](function(_0xdb1ca8){var _0x310549=_0x223d93[_0x7721('0x52')][_0x7721('0x2b')]({'plain':!![]});if(!_0x310549)throw new Error(_0x7721('0x53'));if(_0x310549[_0x7721('0x54')]===_0x7721('0x52')){var _0x7fbb73=_0xdb1ca8[_0x7721('0x2b')]({'plain':!![]});var _0x3386aa=_0x7721('0x2c');return db[_0x7721('0x55')][_0x7721('0x50')]({'where':{'name':_0x3386aa,'userProfileId':_0x310549[_0x7721('0x56')]},'raw':!![]})[_0x7721('0x29')](function(_0x5b741d){if(_0x5b741d&&_0x5b741d[_0x7721('0x57')]===0x0){return db[_0x7721('0x2d')][_0x7721('0x58')]({'name':_0x7fbb73[_0x7721('0x31')],'resourceId':_0x7fbb73['id'],'type':_0x5b741d[_0x7721('0x31')],'sectionId':_0x5b741d['id']},{})[_0x7721('0x29')](function(){return _0xdb1ca8;});}else{return _0xdb1ca8;}})[_0x7721('0x4c')](function(_0x57484c){logger[_0x7721('0x2f')](_0x7721('0x59'),_0x57484c);throw _0x57484c;});}return _0xdb1ca8;})[_0x7721('0x29')](respondWithResult(_0x1196c2,0xc9))[_0x7721('0x4c')](handleError(_0x1196c2,null));};exports[_0x7721('0x28')]=function(_0x9c0d4,_0x7fbd6c){if(_0x9c0d4[_0x7721('0x51')]['id']){delete _0x9c0d4[_0x7721('0x51')]['id'];}return db[_0x7721('0x35')][_0x7721('0x50')]({'where':{'id':_0x9c0d4['params']['id']}})[_0x7721('0x29')](handleEntityNotFound(_0x7fbd6c,null))[_0x7721('0x29')](saveUpdates(_0x9c0d4[_0x7721('0x51')],null))[_0x7721('0x29')](respondWithResult(_0x7fbd6c,null))[_0x7721('0x4c')](handleError(_0x7fbd6c,null));};exports[_0x7721('0x2a')]=function(_0x41644f,_0x36fe6f){return db[_0x7721('0x35')][_0x7721('0x50')]({'where':{'id':_0x41644f[_0x7721('0x4e')]['id']}})[_0x7721('0x29')](handleEntityNotFound(_0x36fe6f,null))[_0x7721('0x29')](removeEntity(_0x36fe6f,null))[_0x7721('0x4c')](handleError(_0x36fe6f,null));}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js index 0d4ae1e..216c752 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 _0x720b=['util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','exports','define','AnalyticMetric','lodash'];(function(_0x317b22,_0x24188c){var _0x586db7=function(_0x45193b){while(--_0x45193b){_0x317b22['push'](_0x317b22['shift']());}};_0x586db7(++_0x24188c);}(_0x720b,0x1d8));var _0xb720=function(_0x1788b8,_0x1c87d0){_0x1788b8=_0x1788b8-0x0;var _0x3721ca=_0x720b[_0x1788b8];return _0x3721ca;};'use strict';var _=require(_0xb720('0x0'));var util=require(_0xb720('0x1'));var logger=require(_0xb720('0x2'))('api');var moment=require(_0xb720('0x3'));var BPromise=require(_0xb720('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb720('0x5'));var rimraf=require(_0xb720('0x6'));var config=require(_0xb720('0x7'));var attributes=require('./analyticMetric.attributes');module[_0xb720('0x8')]=function(_0xa46698,_0x2f3125){return _0xa46698[_0xb720('0x9')](_0xb720('0xa'),attributes,{'tableName':'analytics_metrics','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3c94=['bluebird','request-promise','path','rimraf','../../config/environment','./analyticMetric.attributes','exports','define','AnalyticMetric','analytics_metrics','lodash','util','../../config/logger','api','moment'];(function(_0x2f05a1,_0x2452ca){var _0x45281c=function(_0x402016){while(--_0x402016){_0x2f05a1['push'](_0x2f05a1['shift']());}};_0x45281c(++_0x2452ca);}(_0x3c94,0xcd));var _0x43c9=function(_0x4309d9,_0x5b0b57){_0x4309d9=_0x4309d9-0x0;var _0x1af166=_0x3c94[_0x4309d9];return _0x1af166;};'use strict';var _=require(_0x43c9('0x0'));var util=require(_0x43c9('0x1'));var logger=require(_0x43c9('0x2'))(_0x43c9('0x3'));var moment=require(_0x43c9('0x4'));var BPromise=require(_0x43c9('0x5'));var rp=require(_0x43c9('0x6'));var fs=require('fs');var path=require(_0x43c9('0x7'));var rimraf=require(_0x43c9('0x8'));var config=require(_0x43c9('0x9'));var attributes=require(_0x43c9('0xa'));module[_0x43c9('0xb')]=function(_0x4fdfc2,_0x39c220){return _0x4fdfc2[_0x43c9('0xc')](_0x43c9('0xd'),attributes,{'tableName':_0x43c9('0xe'),'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 c6418f9..e8b8f0e 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 _0xe568=['error','code','message','AnalyticMetric,\x20%s,\x20%s','result','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','info','request\x20sent','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x5b2c7e,_0x3d22f0){var _0x5ec399=function(_0x1a87ad){while(--_0x1a87ad){_0x5b2c7e['push'](_0x5b2c7e['shift']());}};_0x5ec399(++_0x3d22f0);}(_0xe568,0x1e8));var _0x8e56=function(_0x5b756c,_0x3621b6){_0x5b756c=_0x5b756c-0x0;var _0x2e0952=_0xe568[_0x5b756c];return _0x2e0952;};'use strict';var _=require(_0x8e56('0x0'));var util=require('util');var moment=require(_0x8e56('0x1'));var BPromise=require(_0x8e56('0x2'));var rs=require(_0x8e56('0x3'));var fs=require('fs');var Redis=require(_0x8e56('0x4'));var db=require(_0x8e56('0x5'))['db'];var utils=require(_0x8e56('0x6'));var logger=require(_0x8e56('0x7'))(_0x8e56('0x8'));var config=require(_0x8e56('0x9'));var jayson=require(_0x8e56('0xa'));var client=jayson['client'][_0x8e56('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2e58a2,_0xb5dfd3,_0x43381e){return new BPromise(function(_0x3e8add,_0x5312c5){return client['request'](_0x2e58a2,_0x43381e)[_0x8e56('0xc')](function(_0x40cd7d){logger[_0x8e56('0xd')]('AnalyticMetric,\x20%s,\x20%s',_0xb5dfd3,_0x8e56('0xe'));logger[_0x8e56('0xf')](_0x8e56('0x10'),_0xb5dfd3,_0x8e56('0xe'),JSON[_0x8e56('0x11')](_0x40cd7d));if(_0x40cd7d[_0x8e56('0x12')]){if(_0x40cd7d[_0x8e56('0x12')][_0x8e56('0x13')]===0x1f4){logger[_0x8e56('0x12')]('AnalyticMetric,\x20%s,\x20%s',_0xb5dfd3,_0x40cd7d[_0x8e56('0x12')][_0x8e56('0x14')]);return _0x5312c5(_0x40cd7d[_0x8e56('0x12')]['message']);}logger[_0x8e56('0x12')](_0x8e56('0x15'),_0xb5dfd3,_0x40cd7d[_0x8e56('0x12')][_0x8e56('0x14')]);return _0x3e8add(_0x40cd7d[_0x8e56('0x12')][_0x8e56('0x14')]);}else{logger[_0x8e56('0xd')](_0x8e56('0x15'),_0xb5dfd3,_0x8e56('0xe'));_0x3e8add(_0x40cd7d[_0x8e56('0x16')]['message']);}})['catch'](function(_0x1515e6){logger[_0x8e56('0x12')]('AnalyticMetric,\x20%s,\x20%s',_0xb5dfd3,_0x1515e6);_0x5312c5(_0x1515e6);});});} \ No newline at end of file +var _0x6b09=['debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','http','request','then','info','AnalyticMetric,\x20%s,\x20%s','request\x20sent'];(function(_0x25d386,_0x108d0d){var _0x857f4a=function(_0x3eb98d){while(--_0x3eb98d){_0x25d386['push'](_0x25d386['shift']());}};_0x857f4a(++_0x108d0d);}(_0x6b09,0x1a9));var _0x96b0=function(_0x305486,_0x24acd4){_0x305486=_0x305486-0x0;var _0xa04940=_0x6b09[_0x305486];return _0xa04940;};'use strict';var _=require(_0x96b0('0x0'));var util=require('util');var moment=require(_0x96b0('0x1'));var BPromise=require(_0x96b0('0x2'));var rs=require(_0x96b0('0x3'));var fs=require('fs');var Redis=require(_0x96b0('0x4'));var db=require(_0x96b0('0x5'))['db'];var utils=require(_0x96b0('0x6'));var logger=require(_0x96b0('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x96b0('0x8'));var client=jayson['client'][_0x96b0('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1d59ff,_0x40a3c3,_0x3f54a2){return new BPromise(function(_0x561363,_0x14f050){return client[_0x96b0('0xa')](_0x1d59ff,_0x3f54a2)[_0x96b0('0xb')](function(_0x174358){logger[_0x96b0('0xc')](_0x96b0('0xd'),_0x40a3c3,_0x96b0('0xe'));logger[_0x96b0('0xf')](_0x96b0('0x10'),_0x40a3c3,_0x96b0('0xe'),JSON[_0x96b0('0x11')](_0x174358));if(_0x174358[_0x96b0('0x12')]){if(_0x174358[_0x96b0('0x12')][_0x96b0('0x13')]===0x1f4){logger[_0x96b0('0x12')](_0x96b0('0xd'),_0x40a3c3,_0x174358[_0x96b0('0x12')][_0x96b0('0x14')]);return _0x14f050(_0x174358[_0x96b0('0x12')][_0x96b0('0x14')]);}logger[_0x96b0('0x12')](_0x96b0('0xd'),_0x40a3c3,_0x174358[_0x96b0('0x12')][_0x96b0('0x14')]);return _0x561363(_0x174358[_0x96b0('0x12')][_0x96b0('0x14')]);}else{logger[_0x96b0('0xc')](_0x96b0('0xd'),_0x40a3c3,_0x96b0('0xe'));_0x561363(_0x174358['result'][_0x96b0('0x14')]);}})[_0x96b0('0x15')](function(_0x29dd47){logger[_0x96b0('0x12')](_0x96b0('0xd'),_0x40a3c3,_0x29dd47);_0x14f050(_0x29dd47);});});} \ No newline at end of file diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js index df48774..748de02 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 _0xbfe8=['isAuthenticated','/:id','show','post','create','put','update','delete','destroy','util','connect-timeout','express','../../components/auth/service','../../components/interaction/service','./analyticMetric.controller','get'];(function(_0x31ad84,_0x3a1364){var _0x2ab374=function(_0x596f0a){while(--_0x596f0a){_0x31ad84['push'](_0x31ad84['shift']());}};_0x2ab374(++_0x3a1364);}(_0xbfe8,0x1b9));var _0x8bfe=function(_0x1fb162,_0x106090){_0x1fb162=_0x1fb162-0x0;var _0x3081b7=_0xbfe8[_0x1fb162];return _0x3081b7;};'use strict';var multer=require('multer');var util=require(_0x8bfe('0x0'));var path=require('path');var timeout=require(_0x8bfe('0x1'));var express=require(_0x8bfe('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x8bfe('0x3'));var interaction=require(_0x8bfe('0x4'));var config=require('../../config/environment');var controller=require(_0x8bfe('0x5'));router[_0x8bfe('0x6')]('/',auth[_0x8bfe('0x7')](),controller['index']);router[_0x8bfe('0x6')](_0x8bfe('0x8'),auth[_0x8bfe('0x7')](),controller[_0x8bfe('0x9')]);router[_0x8bfe('0xa')]('/',auth[_0x8bfe('0x7')](),controller[_0x8bfe('0xb')]);router[_0x8bfe('0xc')](_0x8bfe('0x8'),auth[_0x8bfe('0x7')](),controller[_0x8bfe('0xd')]);router[_0x8bfe('0xe')](_0x8bfe('0x8'),auth[_0x8bfe('0x7')](),controller[_0x8bfe('0xf')]);module['exports']=router; \ No newline at end of file +var _0x9206=['express','Router','../../components/interaction/service','../../config/environment','isAuthenticated','get','/:id','show','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout'];(function(_0x2779a1,_0x12ee57){var _0x441dbc=function(_0x183514){while(--_0x183514){_0x2779a1['push'](_0x2779a1['shift']());}};_0x441dbc(++_0x12ee57);}(_0x9206,0x176));var _0x6920=function(_0x3bccf9,_0x466002){_0x3bccf9=_0x3bccf9-0x0;var _0xb1616a=_0x9206[_0x3bccf9];return _0xb1616a;};'use strict';var multer=require(_0x6920('0x0'));var util=require(_0x6920('0x1'));var path=require(_0x6920('0x2'));var timeout=require(_0x6920('0x3'));var express=require(_0x6920('0x4'));var router=express[_0x6920('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x6920('0x6'));var config=require(_0x6920('0x7'));var controller=require('./analyticMetric.controller');router['get']('/',auth[_0x6920('0x8')](),controller['index']);router[_0x6920('0x9')](_0x6920('0xa'),auth[_0x6920('0x8')](),controller[_0x6920('0xb')]);router['post']('/',auth['isAuthenticated'](),controller[_0x6920('0xc')]);router[_0x6920('0xd')](_0x6920('0xa'),auth[_0x6920('0x8')](),controller[_0x6920('0xe')]);router[_0x6920('0xf')](_0x6920('0xa'),auth[_0x6920('0x8')](),controller[_0x6920('0x10')]);module[_0x6920('0x11')]=router; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.attributes.js b/server/api/analyticTreeReport/analyticTreeReport.attributes.js index 48ae0f7..a7277d2 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 _0x55b5=['sequelize','exports'];(function(_0x419560,_0x16a92c){var _0x52a0a9=function(_0x1cdc67){while(--_0x1cdc67){_0x419560['push'](_0x419560['shift']());}};_0x52a0a9(++_0x16a92c);}(_0x55b5,0x11a));var _0x555b=function(_0x2a720b,_0x44eee0){_0x2a720b=_0x2a720b-0x0;var _0x950dbd=_0x55b5[_0x2a720b];return _0x950dbd;};'use strict';var Sequelize=require(_0x555b('0x0'));module[_0x555b('0x1')]={'tree':{'type':Sequelize['TEXT'],'allowNull':![]}}; \ No newline at end of file +var _0xb1d3=['exports','sequelize'];(function(_0x461da6,_0x8da886){var _0x508911=function(_0x1456ae){while(--_0x1456ae){_0x461da6['push'](_0x461da6['shift']());}};_0x508911(++_0x8da886);}(_0xb1d3,0x8f));var _0x3b1d=function(_0x44c9d9,_0x5b6595){_0x44c9d9=_0x44c9d9-0x0;var _0x55a82f=_0xb1d3[_0x44c9d9];return _0x55a82f;};'use strict';var Sequelize=require(_0x3b1d('0x0'));module[_0x3b1d('0x1')]={'tree':{'type':Sequelize['TEXT'],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.controller.js b/server/api/analyticTreeReport/analyticTreeReport.controller.js index cbb7f80..d7eb8d3 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 _0x4a62=['json','apply','reject','update','then','destroy','stack','name','send','map','AnalyticTreeReport','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','rawAttributes','length','create','body','find','zip-dir','fast-json-patch','request-promise','moment','util','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../mysqldb','sendStatus','status','end','undefined','limit','count','offset','set'];(function(_0x452d36,_0x4503db){var _0x3d64c7=function(_0x4a4d0e){while(--_0x4a4d0e){_0x452d36['push'](_0x452d36['shift']());}};_0x3d64c7(++_0x4503db);}(_0x4a62,0xb6));var _0x24a6=function(_0x290711,_0x297cd1){_0x290711=_0x290711-0x0;var _0x49dca4=_0x4a62[_0x290711];return _0x49dca4;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x24a6('0x0'));var jsonpatch=require(_0x24a6('0x1'));var rp=require(_0x24a6('0x2'));var moment=require(_0x24a6('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x24a6('0x4'));var path=require('path');var sox=require('sox');var csv=require(_0x24a6('0x5'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x24a6('0x6'));var squel=require(_0x24a6('0x7'));var crypto=require(_0x24a6('0x8'));var jsforce=require(_0x24a6('0x9'));var deskjs=require(_0x24a6('0xa'));var toCsv=require(_0x24a6('0x5'));var querystring=require(_0x24a6('0xb'));var Papa=require(_0x24a6('0xc'));var Redis=require('ioredis');var authService=require(_0x24a6('0xd'));var qs=require(_0x24a6('0xe'));var as=require(_0x24a6('0xf'));var hardwareService=require(_0x24a6('0x10'));var logger=require('../../config/logger')(_0x24a6('0x11'));var utils=require('../../config/utils');var config=require(_0x24a6('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0x24a6('0x13'))['db'];function respondWithStatusCode(_0x44af8b,_0x17c984){_0x17c984=_0x17c984||0xcc;return function(_0x1fb6df){if(_0x1fb6df){return _0x44af8b[_0x24a6('0x14')](_0x17c984);}return _0x44af8b[_0x24a6('0x15')](_0x17c984)[_0x24a6('0x16')]();};}function respondWithResult(_0x236a95,_0x23355d){_0x23355d=_0x23355d||0xc8;return function(_0x4b69eb){if(_0x4b69eb){return _0x236a95[_0x24a6('0x15')](_0x23355d)['json'](_0x4b69eb);}};}function respondWithFilteredResult(_0x282643,_0x5ef812){return function(_0x5c68a6){if(_0x5c68a6){var _0x182150=typeof _0x5ef812['offset']===_0x24a6('0x17')&&typeof _0x5ef812[_0x24a6('0x18')]===_0x24a6('0x17');var _0x5d957f=_0x5c68a6[_0x24a6('0x19')];var _0x420002=_0x182150?0x0:_0x5ef812['offset'];var _0x2a87cf=_0x182150?_0x5c68a6['count']:_0x5ef812[_0x24a6('0x1a')]+_0x5ef812[_0x24a6('0x18')];var _0xe89032;if(_0x2a87cf>=_0x5d957f){_0x2a87cf=_0x5d957f;_0xe89032=0xc8;}else{_0xe89032=0xce;}_0x282643[_0x24a6('0x15')](_0xe89032);return _0x282643[_0x24a6('0x1b')]('Content-Range',_0x420002+'-'+_0x2a87cf+'/'+_0x5d957f)[_0x24a6('0x1c')](_0x5c68a6);}return null;};}function patchUpdates(_0x18a1d4){return function(_0x4e1df4){try{jsonpatch[_0x24a6('0x1d')](_0x4e1df4,_0x18a1d4,!![]);}catch(_0x1d625e){return BPromise[_0x24a6('0x1e')](_0x1d625e);}return _0x4e1df4['save']();};}function saveUpdates(_0x340f61,_0x486ebb){return function(_0x5a9dfe){if(_0x5a9dfe){return _0x5a9dfe[_0x24a6('0x1f')](_0x340f61)[_0x24a6('0x20')](function(_0x1b2db4){return _0x1b2db4;});}return null;};}function removeEntity(_0x3d832d,_0x394928){return function(_0x8ca262){if(_0x8ca262){return _0x8ca262[_0x24a6('0x21')]()[_0x24a6('0x20')](function(){_0x3d832d[_0x24a6('0x15')](0xcc)[_0x24a6('0x16')]();});}};}function handleEntityNotFound(_0x580b34,_0x378e00){return function(_0xbd4ffb){if(!_0xbd4ffb){_0x580b34[_0x24a6('0x14')](0x194);}return _0xbd4ffb;};}function handleError(_0x2e64e2,_0xa61c91){_0xa61c91=_0xa61c91||0x1f4;return function(_0x171bbe){logger['error'](_0x171bbe[_0x24a6('0x22')]);if(_0x171bbe[_0x24a6('0x23')]){delete _0x171bbe[_0x24a6('0x23')];}_0x2e64e2[_0x24a6('0x15')](_0xa61c91)[_0x24a6('0x24')](_0x171bbe);};}exports['index']=function(_0x10cf3f,_0x307663){var _0x5b06a1={},_0x5cd06c={},_0x200df7={'count':0x0,'rows':[]};var _0x321645=_[_0x24a6('0x25')](db[_0x24a6('0x26')]['rawAttributes'],function(_0xa87873){return{'name':_0xa87873[_0x24a6('0x27')],'type':_0xa87873[_0x24a6('0x28')][_0x24a6('0x29')]};});_0x5cd06c[_0x24a6('0x2a')]=_[_0x24a6('0x25')](_0x321645,_0x24a6('0x23'));_0x5cd06c[_0x24a6('0x2b')]=_[_0x24a6('0x2c')](_0x10cf3f[_0x24a6('0x2b')]);_0x5cd06c[_0x24a6('0x2d')]=_[_0x24a6('0x2e')](_0x5cd06c[_0x24a6('0x2a')],_0x5cd06c[_0x24a6('0x2b')]);_0x5b06a1[_0x24a6('0x2f')]=_[_0x24a6('0x2e')](_0x5cd06c['model'],qs[_0x24a6('0x30')](_0x10cf3f[_0x24a6('0x2b')][_0x24a6('0x30')]));_0x5b06a1[_0x24a6('0x2f')]=_0x5b06a1[_0x24a6('0x2f')]['length']?_0x5b06a1['attributes']:_0x5cd06c[_0x24a6('0x2a')];if(!_0x10cf3f[_0x24a6('0x2b')][_0x24a6('0x31')](_0x24a6('0x32'))){_0x5b06a1['limit']=qs[_0x24a6('0x18')](_0x10cf3f[_0x24a6('0x2b')]['limit']);_0x5b06a1[_0x24a6('0x1a')]=qs[_0x24a6('0x1a')](_0x10cf3f['query'][_0x24a6('0x1a')]);}_0x5b06a1[_0x24a6('0x33')]=qs[_0x24a6('0x34')](_0x10cf3f[_0x24a6('0x2b')][_0x24a6('0x34')]);_0x5b06a1[_0x24a6('0x35')]=qs['filters'](_[_0x24a6('0x36')](_0x10cf3f[_0x24a6('0x2b')],_0x5cd06c[_0x24a6('0x2d')]),_0x321645);if(_0x10cf3f['query'][_0x24a6('0x37')]){_0x5b06a1[_0x24a6('0x35')]=_[_0x24a6('0x38')](_0x5b06a1[_0x24a6('0x35')],{'$or':_[_0x24a6('0x25')](_0x321645,function(_0x4eafa5){if(_0x4eafa5[_0x24a6('0x28')]!==_0x24a6('0x39')){var _0x1c0dd4={};_0x1c0dd4[_0x4eafa5[_0x24a6('0x23')]]={'$like':'%'+_0x10cf3f['query'][_0x24a6('0x37')]+'%'};return _0x1c0dd4;}})});}_0x5b06a1=_[_0x24a6('0x38')]({},_0x5b06a1,_0x10cf3f[_0x24a6('0x3a')]);var _0x24bb99={'where':_0x5b06a1['where']};return db[_0x24a6('0x26')]['count'](_0x24bb99)[_0x24a6('0x20')](function(_0x1bc3ca){_0x200df7[_0x24a6('0x19')]=_0x1bc3ca;if(_0x10cf3f[_0x24a6('0x2b')][_0x24a6('0x3b')]){_0x5b06a1[_0x24a6('0x3c')]=[{'all':!![]}];}return db[_0x24a6('0x26')][_0x24a6('0x3d')](_0x5b06a1);})['then'](function(_0x5eedff){_0x200df7[_0x24a6('0x3e')]=_0x5eedff;return _0x200df7;})[_0x24a6('0x20')](respondWithFilteredResult(_0x307663,_0x5b06a1))[_0x24a6('0x3f')](handleError(_0x307663,null));};exports['show']=function(_0x40a442,_0x425d72){var _0x1ea463={'raw':!![],'where':{'id':_0x40a442[_0x24a6('0x40')]['id']}},_0x3fdf8c={};_0x3fdf8c[_0x24a6('0x2a')]=_[_0x24a6('0x2c')](db[_0x24a6('0x26')][_0x24a6('0x41')]);_0x3fdf8c[_0x24a6('0x2b')]=_[_0x24a6('0x2c')](_0x40a442[_0x24a6('0x2b')]);_0x3fdf8c[_0x24a6('0x2d')]=_[_0x24a6('0x2e')](_0x3fdf8c[_0x24a6('0x2a')],_0x3fdf8c[_0x24a6('0x2b')]);_0x1ea463['attributes']=_[_0x24a6('0x2e')](_0x3fdf8c['model'],qs[_0x24a6('0x30')](_0x40a442[_0x24a6('0x2b')][_0x24a6('0x30')]));_0x1ea463[_0x24a6('0x2f')]=_0x1ea463[_0x24a6('0x2f')][_0x24a6('0x42')]?_0x1ea463['attributes']:_0x3fdf8c[_0x24a6('0x2a')];if(_0x40a442['query'][_0x24a6('0x3b')]){_0x1ea463[_0x24a6('0x3c')]=[{'all':!![]}];}_0x1ea463=_[_0x24a6('0x38')]({},_0x1ea463,_0x40a442[_0x24a6('0x3a')]);return db[_0x24a6('0x26')]['find'](_0x1ea463)[_0x24a6('0x20')](handleEntityNotFound(_0x425d72,null))['then'](respondWithResult(_0x425d72,null))['catch'](handleError(_0x425d72,null));};exports[_0x24a6('0x43')]=function(_0x11a37b,_0x8cce11){return db['AnalyticTreeReport'][_0x24a6('0x43')](_0x11a37b[_0x24a6('0x44')],{})[_0x24a6('0x20')](respondWithResult(_0x8cce11,0xc9))[_0x24a6('0x3f')](handleError(_0x8cce11,null));};exports[_0x24a6('0x1f')]=function(_0x1fe6c6,_0x5dce20){if(_0x1fe6c6[_0x24a6('0x44')]['id']){delete _0x1fe6c6[_0x24a6('0x44')]['id'];}return db['AnalyticTreeReport'][_0x24a6('0x45')]({'where':{'id':_0x1fe6c6[_0x24a6('0x40')]['id']}})['then'](handleEntityNotFound(_0x5dce20,null))[_0x24a6('0x20')](saveUpdates(_0x1fe6c6[_0x24a6('0x44')],null))[_0x24a6('0x20')](respondWithResult(_0x5dce20,null))['catch'](handleError(_0x5dce20,null));};exports['destroy']=function(_0x129af1,_0x306c7b){return db[_0x24a6('0x26')]['find']({'where':{'id':_0x129af1[_0x24a6('0x40')]['id']}})['then'](handleEntityNotFound(_0x306c7b,null))[_0x24a6('0x20')](removeEntity(_0x306c7b,null))[_0x24a6('0x3f')](handleError(_0x306c7b,null));}; \ No newline at end of file +var _0xe965=['rawAttributes','include','options','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','destroy','then','end','error','stack','name','send','index','AnalyticTreeReport','fieldName','type','key','model','map','filters','intersection','attributes','fields','query','hasOwnProperty','nolimit','order','sort','where','merge','filter','includeAll','findAll','catch','show','params','keys'];(function(_0x12fc8d,_0x19ee33){var _0x3f9d04=function(_0x52e51c){while(--_0x52e51c){_0x12fc8d['push'](_0x12fc8d['shift']());}};_0x3f9d04(++_0x19ee33);}(_0xe965,0xa2));var _0x5e96=function(_0x55f7eb,_0x1e91a6){_0x55f7eb=_0x55f7eb-0x0;var _0x2eb687=_0xe965[_0x55f7eb];return _0x2eb687;};'use strict';var emlformat=require(_0x5e96('0x0'));var rimraf=require(_0x5e96('0x1'));var zipdir=require(_0x5e96('0x2'));var jsonpatch=require(_0x5e96('0x3'));var rp=require(_0x5e96('0x4'));var moment=require(_0x5e96('0x5'));var BPromise=require(_0x5e96('0x6'));var Mustache=require(_0x5e96('0x7'));var util=require(_0x5e96('0x8'));var path=require(_0x5e96('0x9'));var sox=require(_0x5e96('0xa'));var csv=require('to-csv');var ejs=require(_0x5e96('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x5e96('0xc'));var crypto=require(_0x5e96('0xd'));var jsforce=require(_0x5e96('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x5e96('0xf'));var querystring=require(_0x5e96('0x10'));var Papa=require(_0x5e96('0x11'));var Redis=require(_0x5e96('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x5e96('0x13'));var as=require(_0x5e96('0x14'));var hardwareService=require(_0x5e96('0x15'));var logger=require('../../config/logger')(_0x5e96('0x16'));var utils=require(_0x5e96('0x17'));var config=require(_0x5e96('0x18'));var licenseUtil=require(_0x5e96('0x19'));var db=require(_0x5e96('0x1a'))['db'];function respondWithStatusCode(_0x53f4f5,_0x2afbae){_0x2afbae=_0x2afbae||0xcc;return function(_0x4f23d1){if(_0x4f23d1){return _0x53f4f5[_0x5e96('0x1b')](_0x2afbae);}return _0x53f4f5[_0x5e96('0x1c')](_0x2afbae)['end']();};}function respondWithResult(_0x27e870,_0x3586e2){_0x3586e2=_0x3586e2||0xc8;return function(_0x112c74){if(_0x112c74){return _0x27e870[_0x5e96('0x1c')](_0x3586e2)[_0x5e96('0x1d')](_0x112c74);}};}function respondWithFilteredResult(_0xdbbf87,_0x724844){return function(_0x4327a6){if(_0x4327a6){var _0xb3f69d=typeof _0x724844['offset']===_0x5e96('0x1e')&&typeof _0x724844[_0x5e96('0x1f')]===_0x5e96('0x1e');var _0x24a735=_0x4327a6['count'];var _0x23f9fb=_0xb3f69d?0x0:_0x724844['offset'];var _0xb576b7=_0xb3f69d?_0x4327a6[_0x5e96('0x20')]:_0x724844[_0x5e96('0x21')]+_0x724844[_0x5e96('0x1f')];var _0x4bbcfb;if(_0xb576b7>=_0x24a735){_0xb576b7=_0x24a735;_0x4bbcfb=0xc8;}else{_0x4bbcfb=0xce;}_0xdbbf87[_0x5e96('0x1c')](_0x4bbcfb);return _0xdbbf87[_0x5e96('0x22')](_0x5e96('0x23'),_0x23f9fb+'-'+_0xb576b7+'/'+_0x24a735)[_0x5e96('0x1d')](_0x4327a6);}return null;};}function patchUpdates(_0x5df72b){return function(_0x538009){try{jsonpatch[_0x5e96('0x24')](_0x538009,_0x5df72b,!![]);}catch(_0x323f19){return BPromise[_0x5e96('0x25')](_0x323f19);}return _0x538009[_0x5e96('0x26')]();};}function saveUpdates(_0x1bf1e2,_0x1c0583){return function(_0x20fae9){if(_0x20fae9){return _0x20fae9[_0x5e96('0x27')](_0x1bf1e2)['then'](function(_0x16ab1a){return _0x16ab1a;});}return null;};}function removeEntity(_0x3422f6,_0x5c4137){return function(_0x59f530){if(_0x59f530){return _0x59f530[_0x5e96('0x28')]()[_0x5e96('0x29')](function(){_0x3422f6[_0x5e96('0x1c')](0xcc)[_0x5e96('0x2a')]();});}};}function handleEntityNotFound(_0x5e53f8,_0xcd487a){return function(_0x1fe3e2){if(!_0x1fe3e2){_0x5e53f8[_0x5e96('0x1b')](0x194);}return _0x1fe3e2;};}function handleError(_0x4bbe5a,_0x298295){_0x298295=_0x298295||0x1f4;return function(_0x464776){logger[_0x5e96('0x2b')](_0x464776[_0x5e96('0x2c')]);if(_0x464776[_0x5e96('0x2d')]){delete _0x464776[_0x5e96('0x2d')];}_0x4bbe5a['status'](_0x298295)[_0x5e96('0x2e')](_0x464776);};}exports[_0x5e96('0x2f')]=function(_0x514052,_0x4c683c){var _0x1e7281={},_0x18501c={},_0x3382cb={'count':0x0,'rows':[]};var _0x34f7f1=_['map'](db[_0x5e96('0x30')]['rawAttributes'],function(_0x5eb5e3){return{'name':_0x5eb5e3[_0x5e96('0x31')],'type':_0x5eb5e3[_0x5e96('0x32')][_0x5e96('0x33')]};});_0x18501c[_0x5e96('0x34')]=_[_0x5e96('0x35')](_0x34f7f1,_0x5e96('0x2d'));_0x18501c['query']=_['keys'](_0x514052['query']);_0x18501c[_0x5e96('0x36')]=_[_0x5e96('0x37')](_0x18501c[_0x5e96('0x34')],_0x18501c['query']);_0x1e7281[_0x5e96('0x38')]=_[_0x5e96('0x37')](_0x18501c[_0x5e96('0x34')],qs[_0x5e96('0x39')](_0x514052[_0x5e96('0x3a')]['fields']));_0x1e7281[_0x5e96('0x38')]=_0x1e7281[_0x5e96('0x38')]['length']?_0x1e7281['attributes']:_0x18501c[_0x5e96('0x34')];if(!_0x514052[_0x5e96('0x3a')][_0x5e96('0x3b')](_0x5e96('0x3c'))){_0x1e7281[_0x5e96('0x1f')]=qs[_0x5e96('0x1f')](_0x514052[_0x5e96('0x3a')][_0x5e96('0x1f')]);_0x1e7281['offset']=qs[_0x5e96('0x21')](_0x514052[_0x5e96('0x3a')][_0x5e96('0x21')]);}_0x1e7281[_0x5e96('0x3d')]=qs[_0x5e96('0x3e')](_0x514052['query'][_0x5e96('0x3e')]);_0x1e7281['where']=qs[_0x5e96('0x36')](_['pick'](_0x514052[_0x5e96('0x3a')],_0x18501c[_0x5e96('0x36')]),_0x34f7f1);if(_0x514052[_0x5e96('0x3a')]['filter']){_0x1e7281[_0x5e96('0x3f')]=_[_0x5e96('0x40')](_0x1e7281[_0x5e96('0x3f')],{'$or':_[_0x5e96('0x35')](_0x34f7f1,function(_0x5246e9){if(_0x5246e9[_0x5e96('0x32')]!=='VIRTUAL'){var _0x3e7b79={};_0x3e7b79[_0x5246e9[_0x5e96('0x2d')]]={'$like':'%'+_0x514052[_0x5e96('0x3a')][_0x5e96('0x41')]+'%'};return _0x3e7b79;}})});}_0x1e7281=_[_0x5e96('0x40')]({},_0x1e7281,_0x514052['options']);var _0xd49ca4={'where':_0x1e7281[_0x5e96('0x3f')]};return db['AnalyticTreeReport'][_0x5e96('0x20')](_0xd49ca4)['then'](function(_0x236b86){_0x3382cb[_0x5e96('0x20')]=_0x236b86;if(_0x514052['query'][_0x5e96('0x42')]){_0x1e7281['include']=[{'all':!![]}];}return db['AnalyticTreeReport'][_0x5e96('0x43')](_0x1e7281);})[_0x5e96('0x29')](function(_0x64f243){_0x3382cb['rows']=_0x64f243;return _0x3382cb;})[_0x5e96('0x29')](respondWithFilteredResult(_0x4c683c,_0x1e7281))[_0x5e96('0x44')](handleError(_0x4c683c,null));};exports[_0x5e96('0x45')]=function(_0x38f0a9,_0x492b40){var _0x3a049a={'raw':!![],'where':{'id':_0x38f0a9[_0x5e96('0x46')]['id']}},_0x50ef6b={};_0x50ef6b[_0x5e96('0x34')]=_[_0x5e96('0x47')](db[_0x5e96('0x30')][_0x5e96('0x48')]);_0x50ef6b[_0x5e96('0x3a')]=_[_0x5e96('0x47')](_0x38f0a9[_0x5e96('0x3a')]);_0x50ef6b[_0x5e96('0x36')]=_[_0x5e96('0x37')](_0x50ef6b[_0x5e96('0x34')],_0x50ef6b['query']);_0x3a049a['attributes']=_[_0x5e96('0x37')](_0x50ef6b[_0x5e96('0x34')],qs[_0x5e96('0x39')](_0x38f0a9[_0x5e96('0x3a')][_0x5e96('0x39')]));_0x3a049a[_0x5e96('0x38')]=_0x3a049a[_0x5e96('0x38')]['length']?_0x3a049a[_0x5e96('0x38')]:_0x50ef6b['model'];if(_0x38f0a9[_0x5e96('0x3a')]['includeAll']){_0x3a049a[_0x5e96('0x49')]=[{'all':!![]}];}_0x3a049a=_[_0x5e96('0x40')]({},_0x3a049a,_0x38f0a9[_0x5e96('0x4a')]);return db['AnalyticTreeReport'][_0x5e96('0x4b')](_0x3a049a)['then'](handleEntityNotFound(_0x492b40,null))[_0x5e96('0x29')](respondWithResult(_0x492b40,null))['catch'](handleError(_0x492b40,null));};exports['create']=function(_0x51408e,_0x1dbd8e){return db[_0x5e96('0x30')][_0x5e96('0x4c')](_0x51408e[_0x5e96('0x4d')],{})[_0x5e96('0x29')](respondWithResult(_0x1dbd8e,0xc9))[_0x5e96('0x44')](handleError(_0x1dbd8e,null));};exports['update']=function(_0x4c829d,_0x37e772){if(_0x4c829d[_0x5e96('0x4d')]['id']){delete _0x4c829d['body']['id'];}return db[_0x5e96('0x30')][_0x5e96('0x4b')]({'where':{'id':_0x4c829d[_0x5e96('0x46')]['id']}})[_0x5e96('0x29')](handleEntityNotFound(_0x37e772,null))['then'](saveUpdates(_0x4c829d[_0x5e96('0x4d')],null))['then'](respondWithResult(_0x37e772,null))[_0x5e96('0x44')](handleError(_0x37e772,null));};exports[_0x5e96('0x28')]=function(_0x3a1405,_0x32564d){return db[_0x5e96('0x30')][_0x5e96('0x4b')]({'where':{'id':_0x3a1405[_0x5e96('0x46')]['id']}})[_0x5e96('0x29')](handleEntityNotFound(_0x32564d,null))['then'](removeEntity(_0x32564d,null))[_0x5e96('0x44')](handleError(_0x32564d,null));}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js index ca6d276..cec5a90 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 _0xe56f=['util','api','moment','bluebird','path','rimraf','../../config/environment','./analyticTreeReport.attributes','define','AnalyticTreeReport','analytics_report_trees'];(function(_0x49d6d2,_0x2219e2){var _0x5c7578=function(_0x2c5ad5){while(--_0x2c5ad5){_0x49d6d2['push'](_0x49d6d2['shift']());}};_0x5c7578(++_0x2219e2);}(_0xe56f,0xe7));var _0xfe56=function(_0xea571a,_0x1e82cb){_0xea571a=_0xea571a-0x0;var _0x193c91=_0xe56f[_0xea571a];return _0x193c91;};'use strict';var _=require('lodash');var util=require(_0xfe56('0x0'));var logger=require('../../config/logger')(_0xfe56('0x1'));var moment=require(_0xfe56('0x2'));var BPromise=require(_0xfe56('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xfe56('0x4'));var rimraf=require(_0xfe56('0x5'));var config=require(_0xfe56('0x6'));var attributes=require(_0xfe56('0x7'));module['exports']=function(_0x42e05a,_0x75756a){return _0x42e05a[_0xfe56('0x8')](_0xfe56('0x9'),attributes,{'tableName':_0xfe56('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf7bd=['request-promise','path','rimraf','./analyticTreeReport.attributes','exports','define','AnalyticTreeReport','analytics_report_trees','lodash','util','../../config/logger','api','bluebird'];(function(_0x1dc0b9,_0x43ffca){var _0x20013a=function(_0x147ffa){while(--_0x147ffa){_0x1dc0b9['push'](_0x1dc0b9['shift']());}};_0x20013a(++_0x43ffca);}(_0xf7bd,0x97));var _0xdf7b=function(_0x34aec4,_0x3801da){_0x34aec4=_0x34aec4-0x0;var _0x51e1a7=_0xf7bd[_0x34aec4];return _0x51e1a7;};'use strict';var _=require(_0xdf7b('0x0'));var util=require(_0xdf7b('0x1'));var logger=require(_0xdf7b('0x2'))(_0xdf7b('0x3'));var moment=require('moment');var BPromise=require(_0xdf7b('0x4'));var rp=require(_0xdf7b('0x5'));var fs=require('fs');var path=require(_0xdf7b('0x6'));var rimraf=require(_0xdf7b('0x7'));var config=require('../../config/environment');var attributes=require(_0xdf7b('0x8'));module[_0xdf7b('0x9')]=function(_0x380bb1,_0x2dc5b1){return _0x380bb1[_0xdf7b('0xa')](_0xdf7b('0xb'),attributes,{'tableName':_0xdf7b('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 a5efe38..5e75a0d 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 _0x7a54=['info','AnalyticTreeReport,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x7a54,0x106));var _0x47a5=function(_0x15d27b,_0x7ce7f3){_0x15d27b=_0x15d27b-0x0;var _0x2f4769=_0x7a54[_0x15d27b];return _0x2f4769;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});} \ No newline at end of file +var _0xadb5=['error','code','message','result','catch','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x15329c,_0x44a0a2){var _0x566604=function(_0x2c3c88){while(--_0x2c3c88){_0x15329c['push'](_0x15329c['shift']());}};_0x566604(++_0x44a0a2);}(_0xadb5,0xad));var _0x5adb=function(_0x229448,_0x5ba929){_0x229448=_0x229448-0x0;var _0xc0953b=_0xadb5[_0x229448];return _0xc0953b;};'use strict';var _=require('lodash');var util=require(_0x5adb('0x0'));var moment=require('moment');var BPromise=require(_0x5adb('0x1'));var rs=require(_0x5adb('0x2'));var fs=require('fs');var Redis=require(_0x5adb('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x5adb('0x4'));var logger=require(_0x5adb('0x5'))(_0x5adb('0x6'));var config=require('../../config/environment');var jayson=require(_0x5adb('0x7'));var client=jayson[_0x5adb('0x8')][_0x5adb('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3213e8,_0xdf3776,_0x353885){return new BPromise(function(_0x47228a,_0x6d1b45){return client[_0x5adb('0xa')](_0x3213e8,_0x353885)[_0x5adb('0xb')](function(_0x34f59d){logger[_0x5adb('0xc')](_0x5adb('0xd'),_0xdf3776,_0x5adb('0xe'));logger['debug']('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0xdf3776,_0x5adb('0xe'),JSON[_0x5adb('0xf')](_0x34f59d));if(_0x34f59d[_0x5adb('0x10')]){if(_0x34f59d['error'][_0x5adb('0x11')]===0x1f4){logger['error'](_0x5adb('0xd'),_0xdf3776,_0x34f59d['error'][_0x5adb('0x12')]);return _0x6d1b45(_0x34f59d[_0x5adb('0x10')][_0x5adb('0x12')]);}logger['error'](_0x5adb('0xd'),_0xdf3776,_0x34f59d[_0x5adb('0x10')][_0x5adb('0x12')]);return _0x47228a(_0x34f59d['error'][_0x5adb('0x12')]);}else{logger['info'](_0x5adb('0xd'),_0xdf3776,_0x5adb('0xe'));_0x47228a(_0x34f59d[_0x5adb('0x13')][_0x5adb('0x12')]);}})[_0x5adb('0x14')](function(_0x39d24d){logger[_0x5adb('0x10')](_0x5adb('0xd'),_0xdf3776,_0x39d24d);_0x6d1b45(_0x39d24d);});});} \ No newline at end of file diff --git a/server/api/analyticTreeReport/index.js b/server/api/analyticTreeReport/index.js index dc4f639..0ac227d 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 _0x4d78=['connect-timeout','express','Router','fs-extra','../../components/interaction/service','isAuthenticated','get','/:id','show','post','create','delete','destroy','exports','multer','util'];(function(_0x4ed1d4,_0x512d9a){var _0x28e363=function(_0x2bdfb7){while(--_0x2bdfb7){_0x4ed1d4['push'](_0x4ed1d4['shift']());}};_0x28e363(++_0x512d9a);}(_0x4d78,0x15e));var _0x84d7=function(_0x575db5,_0x4fb77b){_0x575db5=_0x575db5-0x0;var _0x565306=_0x4d78[_0x575db5];return _0x565306;};'use strict';var multer=require(_0x84d7('0x0'));var util=require(_0x84d7('0x1'));var path=require('path');var timeout=require(_0x84d7('0x2'));var express=require(_0x84d7('0x3'));var router=express[_0x84d7('0x4')]();var fs_extra=require(_0x84d7('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x84d7('0x6'));var config=require('../../config/environment');var controller=require('./analyticTreeReport.controller');router['get']('/',auth[_0x84d7('0x7')](),controller['index']);router[_0x84d7('0x8')](_0x84d7('0x9'),auth['isAuthenticated'](),controller[_0x84d7('0xa')]);router[_0x84d7('0xb')]('/',auth['isAuthenticated'](),controller[_0x84d7('0xc')]);router['put'](_0x84d7('0x9'),auth['isAuthenticated'](),controller['update']);router[_0x84d7('0xd')](_0x84d7('0x9'),auth[_0x84d7('0x7')](),controller[_0x84d7('0xe')]);module[_0x84d7('0xf')]=router; \ No newline at end of file +var _0x3964=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticTreeReport.controller','get','isAuthenticated','post','create','put','/:id','delete','exports','util','path','express'];(function(_0x369151,_0x179f72){var _0x4292d5=function(_0x330422){while(--_0x330422){_0x369151['push'](_0x369151['shift']());}};_0x4292d5(++_0x179f72);}(_0x3964,0x195));var _0x4396=function(_0x5298d6,_0x2eb820){_0x5298d6=_0x5298d6-0x0;var _0x12618d=_0x3964[_0x5298d6];return _0x12618d;};'use strict';var multer=require('multer');var util=require(_0x4396('0x0'));var path=require(_0x4396('0x1'));var timeout=require('connect-timeout');var express=require(_0x4396('0x2'));var router=express[_0x4396('0x3')]();var fs_extra=require(_0x4396('0x4'));var auth=require(_0x4396('0x5'));var interaction=require(_0x4396('0x6'));var config=require(_0x4396('0x7'));var controller=require(_0x4396('0x8'));router[_0x4396('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x4396('0x9')]('/:id',auth[_0x4396('0xa')](),controller['show']);router[_0x4396('0xb')]('/',auth[_0x4396('0xa')](),controller[_0x4396('0xc')]);router[_0x4396('0xd')](_0x4396('0xe'),auth[_0x4396('0xa')](),controller['update']);router[_0x4396('0xf')]('/:id',auth[_0x4396('0xa')](),controller['destroy']);module[_0x4396('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 11757e4..ff663b7 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 _0xde9d=['sequelize','exports','STRING'];(function(_0xfed3cd,_0xde2737){var _0x1f3b8f=function(_0x20c836){while(--_0x20c836){_0xfed3cd['push'](_0xfed3cd['shift']());}};_0x1f3b8f(++_0xde2737);}(_0xde9d,0x156));var _0xdde9=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0xde9d[_0x4565bf];return _0x5610ba;};'use strict';var Sequelize=require(_0xdde9('0x0'));module[_0xdde9('0x1')]={'name':{'type':Sequelize[_0xdde9('0x2')]},'basename':{'type':Sequelize[_0xdde9('0x2')]},'type':{'type':Sequelize[_0xdde9('0x2')]}}; \ No newline at end of file +var _0x2ce1=['STRING'];(function(_0x44b5d9,_0xe28bb1){var _0x25d599=function(_0x33d5ed){while(--_0x33d5ed){_0x44b5d9['push'](_0x44b5d9['shift']());}};_0x25d599(++_0xe28bb1);}(_0x2ce1,0x8b));var _0x12ce=function(_0x2363f2,_0x3acbd6){_0x2363f2=_0x2363f2-0x0;var _0x33783e=_0x2ce1[_0x2363f2];return _0x33783e;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING']},'basename':{'type':Sequelize[_0x12ce('0x0')]},'type':{'type':Sequelize[_0x12ce('0x0')]}}; \ No newline at end of file diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js index a60edde..741dae4 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 _0x2557=['root','server/files/attachments/','offline-chat/','basename','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','error','stack','name','map','Attachment','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','options','includeAll','include','rows','params','rawAttributes','find','catch','clone','createdAt','body','updatedAt','create','file','originalname','type','mimetype','download','findOne','ChatOfflineMessageId','join'];(function(_0x187c83,_0x28bac6){var _0x92f9c8=function(_0x4f453a){while(--_0x4f453a){_0x187c83['push'](_0x187c83['shift']());}};_0x92f9c8(++_0x28bac6);}(_0x2557,0x1ad));var _0x7255=function(_0x18b38c,_0x1543ab){_0x18b38c=_0x18b38c-0x0;var _0x353d28=_0x2557[_0x18b38c];return _0x353d28;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7255('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x7255('0x1'));var rp=require(_0x7255('0x2'));var moment=require(_0x7255('0x3'));var BPromise=require(_0x7255('0x4'));var Mustache=require(_0x7255('0x5'));var util=require(_0x7255('0x6'));var path=require(_0x7255('0x7'));var sox=require(_0x7255('0x8'));var csv=require(_0x7255('0x9'));var ejs=require(_0x7255('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7255('0xb'));var squel=require(_0x7255('0xc'));var crypto=require(_0x7255('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x7255('0xe'));var toCsv=require('to-csv');var querystring=require(_0x7255('0xf'));var Papa=require(_0x7255('0x10'));var Redis=require(_0x7255('0x11'));var authService=require(_0x7255('0x12'));var qs=require(_0x7255('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7255('0x14'));var logger=require(_0x7255('0x15'))(_0x7255('0x16'));var utils=require(_0x7255('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x7255('0x18'));var db=require(_0x7255('0x19'))['db'];function respondWithStatusCode(_0x15611e,_0x478fa6){_0x478fa6=_0x478fa6||0xcc;return function(_0x140b07){if(_0x140b07){return _0x15611e['sendStatus'](_0x478fa6);}return _0x15611e['status'](_0x478fa6)[_0x7255('0x1a')]();};}function respondWithResult(_0x151313,_0x3555f7){_0x3555f7=_0x3555f7||0xc8;return function(_0x3cb985){if(_0x3cb985){return _0x151313[_0x7255('0x1b')](_0x3555f7)[_0x7255('0x1c')](_0x3cb985);}};}function respondWithFilteredResult(_0x1712df,_0x43c564){return function(_0x480707){if(_0x480707){var _0x22a809=typeof _0x43c564[_0x7255('0x1d')]===_0x7255('0x1e')&&typeof _0x43c564[_0x7255('0x1f')]==='undefined';var _0xe6ea28=_0x480707[_0x7255('0x20')];var _0x3081fa=_0x22a809?0x0:_0x43c564[_0x7255('0x1d')];var _0x212812=_0x22a809?_0x480707[_0x7255('0x20')]:_0x43c564[_0x7255('0x1d')]+_0x43c564['limit'];var _0x87e479;if(_0x212812>=_0xe6ea28){_0x212812=_0xe6ea28;_0x87e479=0xc8;}else{_0x87e479=0xce;}_0x1712df[_0x7255('0x1b')](_0x87e479);return _0x1712df[_0x7255('0x21')](_0x7255('0x22'),_0x3081fa+'-'+_0x212812+'/'+_0xe6ea28)['json'](_0x480707);}return null;};}function patchUpdates(_0x1ed8e8){return function(_0x1da5ab){try{jsonpatch[_0x7255('0x23')](_0x1da5ab,_0x1ed8e8,!![]);}catch(_0x473f5b){return BPromise['reject'](_0x473f5b);}return _0x1da5ab[_0x7255('0x24')]();};}function saveUpdates(_0xfed10a,_0xd97f4e){return function(_0x443c84){if(_0x443c84){return _0x443c84[_0x7255('0x25')](_0xfed10a)[_0x7255('0x26')](function(_0x5a17c3){return _0x5a17c3;});}return null;};}function removeEntity(_0x174f4b,_0x26f3fb){return function(_0x388f9e){if(_0x388f9e){return _0x388f9e['destroy']()[_0x7255('0x26')](function(){_0x174f4b[_0x7255('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2c4528,_0x380dcd){return function(_0x1e3f15){if(!_0x1e3f15){_0x2c4528['sendStatus'](0x194);}return _0x1e3f15;};}function handleError(_0x1ba7ba,_0x6a5213){_0x6a5213=_0x6a5213||0x1f4;return function(_0x12116a){logger[_0x7255('0x27')](_0x12116a[_0x7255('0x28')]);if(_0x12116a[_0x7255('0x29')]){delete _0x12116a[_0x7255('0x29')];}_0x1ba7ba[_0x7255('0x1b')](_0x6a5213)['send'](_0x12116a);};}exports['index']=function(_0x49b073,_0x4b80da){var _0x4d10a1={},_0x1509dc={},_0x3e3c0c={'count':0x0,'rows':[]};var _0x40f728=_[_0x7255('0x2a')](db[_0x7255('0x2b')]['rawAttributes'],function(_0x45f078){return{'name':_0x45f078[_0x7255('0x2c')],'type':_0x45f078['type'][_0x7255('0x2d')]};});_0x1509dc[_0x7255('0x2e')]=_[_0x7255('0x2a')](_0x40f728,_0x7255('0x29'));_0x1509dc[_0x7255('0x2f')]=_[_0x7255('0x30')](_0x49b073[_0x7255('0x2f')]);_0x1509dc[_0x7255('0x31')]=_[_0x7255('0x32')](_0x1509dc[_0x7255('0x2e')],_0x1509dc[_0x7255('0x2f')]);_0x4d10a1[_0x7255('0x33')]=_[_0x7255('0x32')](_0x1509dc['model'],qs[_0x7255('0x34')](_0x49b073[_0x7255('0x2f')][_0x7255('0x34')]));_0x4d10a1[_0x7255('0x33')]=_0x4d10a1['attributes'][_0x7255('0x35')]?_0x4d10a1[_0x7255('0x33')]:_0x1509dc[_0x7255('0x2e')];if(!_0x49b073['query'][_0x7255('0x36')](_0x7255('0x37'))){_0x4d10a1[_0x7255('0x1f')]=qs[_0x7255('0x1f')](_0x49b073['query'][_0x7255('0x1f')]);_0x4d10a1[_0x7255('0x1d')]=qs[_0x7255('0x1d')](_0x49b073[_0x7255('0x2f')]['offset']);}_0x4d10a1['order']=qs[_0x7255('0x38')](_0x49b073[_0x7255('0x2f')]['sort']);_0x4d10a1[_0x7255('0x39')]=qs[_0x7255('0x31')](_['pick'](_0x49b073[_0x7255('0x2f')],_0x1509dc['filters']),_0x40f728);if(_0x49b073[_0x7255('0x2f')][_0x7255('0x3a')]){_0x4d10a1[_0x7255('0x39')]=_[_0x7255('0x3b')](_0x4d10a1[_0x7255('0x39')],{'$or':_['map'](_0x40f728,function(_0x29a28c){if(_0x29a28c['type']!=='VIRTUAL'){var _0x5f3b7d={};_0x5f3b7d[_0x29a28c[_0x7255('0x29')]]={'$like':'%'+_0x49b073[_0x7255('0x2f')][_0x7255('0x3a')]+'%'};return _0x5f3b7d;}})});}_0x4d10a1=_['merge']({},_0x4d10a1,_0x49b073[_0x7255('0x3c')]);var _0x2ed668={'where':_0x4d10a1[_0x7255('0x39')]};return db[_0x7255('0x2b')][_0x7255('0x20')](_0x2ed668)[_0x7255('0x26')](function(_0x18764d){_0x3e3c0c[_0x7255('0x20')]=_0x18764d;if(_0x49b073[_0x7255('0x2f')][_0x7255('0x3d')]){_0x4d10a1[_0x7255('0x3e')]=[{'all':!![]}];}return db[_0x7255('0x2b')]['findAll'](_0x4d10a1);})[_0x7255('0x26')](function(_0x48cc6f){_0x3e3c0c[_0x7255('0x3f')]=_0x48cc6f;return _0x3e3c0c;})[_0x7255('0x26')](respondWithFilteredResult(_0x4b80da,_0x4d10a1))['catch'](handleError(_0x4b80da,null));};exports['show']=function(_0x40745c,_0x2e1015){var _0x22cc28={'raw':!![],'where':{'id':_0x40745c[_0x7255('0x40')]['id']}},_0x5358b9={};_0x5358b9[_0x7255('0x2e')]=_[_0x7255('0x30')](db[_0x7255('0x2b')][_0x7255('0x41')]);_0x5358b9['query']=_[_0x7255('0x30')](_0x40745c[_0x7255('0x2f')]);_0x5358b9['filters']=_[_0x7255('0x32')](_0x5358b9[_0x7255('0x2e')],_0x5358b9[_0x7255('0x2f')]);_0x22cc28['attributes']=_['intersection'](_0x5358b9[_0x7255('0x2e')],qs[_0x7255('0x34')](_0x40745c[_0x7255('0x2f')][_0x7255('0x34')]));_0x22cc28[_0x7255('0x33')]=_0x22cc28[_0x7255('0x33')][_0x7255('0x35')]?_0x22cc28[_0x7255('0x33')]:_0x5358b9[_0x7255('0x2e')];if(_0x40745c[_0x7255('0x2f')][_0x7255('0x3d')]){_0x22cc28[_0x7255('0x3e')]=[{'all':!![]}];}_0x22cc28=_[_0x7255('0x3b')]({},_0x22cc28,_0x40745c[_0x7255('0x3c')]);return db[_0x7255('0x2b')][_0x7255('0x42')](_0x22cc28)['then'](handleEntityNotFound(_0x2e1015,null))['then'](respondWithResult(_0x2e1015,null))[_0x7255('0x43')](handleError(_0x2e1015,null));};exports[_0x7255('0x44')]=function(_0x613052,_0x26abb6){var _0x1219d6={'where':{'id':_0x613052[_0x7255('0x40')]['id']}},_0x1458fe={};_0x1458fe['model']=_['keys'](db[_0x7255('0x2b')][_0x7255('0x41')]);_0x1219d6[_0x7255('0x33')]=_[_0x7255('0x32')](_0x1458fe[_0x7255('0x2e')],qs[_0x7255('0x34')](_0x613052[_0x7255('0x2f')][_0x7255('0x34')]));_0x1219d6[_0x7255('0x33')]=_0x1219d6['attributes'][_0x7255('0x35')]?_0x1219d6[_0x7255('0x33')]:_0x1458fe[_0x7255('0x2e')];if(_0x613052[_0x7255('0x2f')][_0x7255('0x3d')]){_0x1219d6[_0x7255('0x3e')]=[{'all':!![]}];}_0x1219d6=_[_0x7255('0x3b')]({},_0x1219d6,_0x613052['options']);return db[_0x7255('0x2b')][_0x7255('0x42')](_0x1219d6)[_0x7255('0x26')](handleEntityNotFound(_0x26abb6,null))['then'](function(_0x2f0a1e){if(_0x2f0a1e){var _0x349950=_0x2f0a1e['get']({'plain':!![]});_0x349950=qs['omit'](_0x349950,['id',_0x7255('0x45'),'updatedAt']);_0x613052[_0x7255('0x46')]=_['omit'](_0x613052[_0x7255('0x46')],['id',_0x7255('0x45'),_0x7255('0x47')]);return db[_0x7255('0x2b')][_0x7255('0x48')](_['merge'](_0x349950,_0x613052[_0x7255('0x46')]),{'include':_0x613052['query'][_0x7255('0x3d')]?[{'all':!![]}]:undefined});}})[_0x7255('0x26')](respondWithResult(_0x26abb6,0xc9))[_0x7255('0x43')](handleError(_0x26abb6,null));};exports[_0x7255('0x25')]=function(_0x190c0d,_0x1356b0){if(_0x190c0d[_0x7255('0x46')]['id']){delete _0x190c0d[_0x7255('0x46')]['id'];}return db[_0x7255('0x2b')][_0x7255('0x42')]({'where':{'id':_0x190c0d[_0x7255('0x40')]['id']}})[_0x7255('0x26')](handleEntityNotFound(_0x1356b0,null))[_0x7255('0x26')](saveUpdates(_0x190c0d[_0x7255('0x46')],null))[_0x7255('0x26')](respondWithResult(_0x1356b0,null))[_0x7255('0x43')](handleError(_0x1356b0,null));};exports['destroy']=function(_0x594a49,_0x460cd0){return db['Attachment']['find']({'where':{'id':_0x594a49[_0x7255('0x40')]['id']}})['then'](handleEntityNotFound(_0x460cd0,null))[_0x7255('0x26')](removeEntity(_0x460cd0,null))[_0x7255('0x43')](handleError(_0x460cd0,null));};exports[_0x7255('0x48')]=function(_0x189f30,_0x37bb91,_0x27a283){_0x189f30[_0x7255('0x46')][_0x7255('0x29')]=_0x189f30[_0x7255('0x49')][_0x7255('0x4a')];_0x189f30['body']['basename']=_0x189f30[_0x7255('0x49')]['filename'];_0x189f30[_0x7255('0x46')][_0x7255('0x4b')]=_0x189f30['file'][_0x7255('0x4c')];return db[_0x7255('0x2b')][_0x7255('0x48')](_0x189f30[_0x7255('0x46')])['then'](respondWithResult(_0x37bb91,0xc9))[_0x7255('0x43')](handleError(_0x37bb91,null));};exports[_0x7255('0x4d')]=function(_0x4c2a8a,_0x27e556,_0x80f277){return db[_0x7255('0x2b')][_0x7255('0x4e')]({'where':{'id':_0x4c2a8a[_0x7255('0x40')]['id']},'raw':!![]})[_0x7255('0x26')](handleEntityNotFound(_0x27e556,null))[_0x7255('0x26')](function(_0x40fb1c){if(_0x40fb1c){var _0x399958=_0x40fb1c[_0x7255('0x4f')]!==null;var _0x261216=path[_0x7255('0x50')](config[_0x7255('0x51')],_0x7255('0x52'));if(_0x399958){_0x261216=path[_0x7255('0x50')](_0x261216,_0x7255('0x53'));}var _0xad7f7c=path[_0x7255('0x50')](_0x261216,_0x40fb1c[_0x7255('0x54')]);return _0x27e556[_0x7255('0x4d')](_0xad7f7c);}})[_0x7255('0x43')](handleError(_0x27e556,null));}; \ No newline at end of file +var _0x8409=['createdAt','create','body','file','originalname','basename','filename','mimetype','download','findOne','join','root','offline-chat/','rimraf','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../mysqldb','end','status','json','offset','undefined','count','set','Content-Range','apply','save','update','then','destroy','sendStatus','error','stack','name','index','map','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','limit','order','sort','where','pick','filter','merge','Attachment','includeAll','include','rows','catch','show','params','rawAttributes','options','find','get','updatedAt','omit'];(function(_0x47ce7a,_0x24da4f){var _0x161fcd=function(_0x4dc9d0){while(--_0x4dc9d0){_0x47ce7a['push'](_0x47ce7a['shift']());}};_0x161fcd(++_0x24da4f);}(_0x8409,0x1b1));var _0x9840=function(_0x588783,_0x550af0){_0x588783=_0x588783-0x0;var _0x146ed6=_0x8409[_0x588783];return _0x146ed6;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9840('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x9840('0x1'));var moment=require(_0x9840('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x9840('0x3'));var util=require(_0x9840('0x4'));var path=require(_0x9840('0x5'));var sox=require(_0x9840('0x6'));var csv=require(_0x9840('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9840('0x8'));var _=require('lodash');var squel=require(_0x9840('0x9'));var crypto=require('crypto');var jsforce=require(_0x9840('0xa'));var deskjs=require(_0x9840('0xb'));var toCsv=require('to-csv');var querystring=require(_0x9840('0xc'));var Papa=require(_0x9840('0xd'));var Redis=require(_0x9840('0xe'));var authService=require(_0x9840('0xf'));var qs=require(_0x9840('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9840('0x11'));var logger=require('../../config/logger')(_0x9840('0x12'));var utils=require(_0x9840('0x13'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x9840('0x14'))['db'];function respondWithStatusCode(_0x4364da,_0x37d134){_0x37d134=_0x37d134||0xcc;return function(_0x593e80){if(_0x593e80){return _0x4364da['sendStatus'](_0x37d134);}return _0x4364da['status'](_0x37d134)[_0x9840('0x15')]();};}function respondWithResult(_0x92ab44,_0x5b676d){_0x5b676d=_0x5b676d||0xc8;return function(_0x491fe9){if(_0x491fe9){return _0x92ab44[_0x9840('0x16')](_0x5b676d)[_0x9840('0x17')](_0x491fe9);}};}function respondWithFilteredResult(_0x1835e0,_0xbd750b){return function(_0x10072b){if(_0x10072b){var _0x6aac23=typeof _0xbd750b[_0x9840('0x18')]===_0x9840('0x19')&&typeof _0xbd750b['limit']===_0x9840('0x19');var _0x5afcfe=_0x10072b[_0x9840('0x1a')];var _0x578aeb=_0x6aac23?0x0:_0xbd750b[_0x9840('0x18')];var _0x41179b=_0x6aac23?_0x10072b[_0x9840('0x1a')]:_0xbd750b[_0x9840('0x18')]+_0xbd750b['limit'];var _0x2e7a54;if(_0x41179b>=_0x5afcfe){_0x41179b=_0x5afcfe;_0x2e7a54=0xc8;}else{_0x2e7a54=0xce;}_0x1835e0[_0x9840('0x16')](_0x2e7a54);return _0x1835e0[_0x9840('0x1b')](_0x9840('0x1c'),_0x578aeb+'-'+_0x41179b+'/'+_0x5afcfe)[_0x9840('0x17')](_0x10072b);}return null;};}function patchUpdates(_0x1580e0){return function(_0x10bded){try{jsonpatch[_0x9840('0x1d')](_0x10bded,_0x1580e0,!![]);}catch(_0x22c6d2){return BPromise['reject'](_0x22c6d2);}return _0x10bded[_0x9840('0x1e')]();};}function saveUpdates(_0x5990be,_0x44cecc){return function(_0x52b36b){if(_0x52b36b){return _0x52b36b[_0x9840('0x1f')](_0x5990be)[_0x9840('0x20')](function(_0x57c3ce){return _0x57c3ce;});}return null;};}function removeEntity(_0x10ab7e,_0x98d7ba){return function(_0x290794){if(_0x290794){return _0x290794[_0x9840('0x21')]()[_0x9840('0x20')](function(){_0x10ab7e[_0x9840('0x16')](0xcc)[_0x9840('0x15')]();});}};}function handleEntityNotFound(_0x5f1ea9,_0x4bc5e2){return function(_0x5534c6){if(!_0x5534c6){_0x5f1ea9[_0x9840('0x22')](0x194);}return _0x5534c6;};}function handleError(_0xc363d2,_0x52e5a8){_0x52e5a8=_0x52e5a8||0x1f4;return function(_0x30a8c5){logger[_0x9840('0x23')](_0x30a8c5[_0x9840('0x24')]);if(_0x30a8c5[_0x9840('0x25')]){delete _0x30a8c5['name'];}_0xc363d2[_0x9840('0x16')](_0x52e5a8)['send'](_0x30a8c5);};}exports[_0x9840('0x26')]=function(_0x336109,_0x5a76b7){var _0x50047a={},_0x20cab6={},_0x35076e={'count':0x0,'rows':[]};var _0x2a5cd1=_[_0x9840('0x27')](db['Attachment']['rawAttributes'],function(_0x13f6fc){return{'name':_0x13f6fc[_0x9840('0x28')],'type':_0x13f6fc[_0x9840('0x29')][_0x9840('0x2a')]};});_0x20cab6['model']=_[_0x9840('0x27')](_0x2a5cd1,'name');_0x20cab6[_0x9840('0x2b')]=_[_0x9840('0x2c')](_0x336109[_0x9840('0x2b')]);_0x20cab6[_0x9840('0x2d')]=_[_0x9840('0x2e')](_0x20cab6[_0x9840('0x2f')],_0x20cab6['query']);_0x50047a[_0x9840('0x30')]=_[_0x9840('0x2e')](_0x20cab6[_0x9840('0x2f')],qs[_0x9840('0x31')](_0x336109[_0x9840('0x2b')][_0x9840('0x31')]));_0x50047a[_0x9840('0x30')]=_0x50047a['attributes'][_0x9840('0x32')]?_0x50047a['attributes']:_0x20cab6[_0x9840('0x2f')];if(!_0x336109[_0x9840('0x2b')]['hasOwnProperty']('nolimit')){_0x50047a[_0x9840('0x33')]=qs[_0x9840('0x33')](_0x336109[_0x9840('0x2b')][_0x9840('0x33')]);_0x50047a[_0x9840('0x18')]=qs[_0x9840('0x18')](_0x336109[_0x9840('0x2b')]['offset']);}_0x50047a[_0x9840('0x34')]=qs[_0x9840('0x35')](_0x336109[_0x9840('0x2b')][_0x9840('0x35')]);_0x50047a[_0x9840('0x36')]=qs[_0x9840('0x2d')](_[_0x9840('0x37')](_0x336109['query'],_0x20cab6['filters']),_0x2a5cd1);if(_0x336109[_0x9840('0x2b')][_0x9840('0x38')]){_0x50047a['where']=_[_0x9840('0x39')](_0x50047a[_0x9840('0x36')],{'$or':_[_0x9840('0x27')](_0x2a5cd1,function(_0x5952f5){if(_0x5952f5['type']!=='VIRTUAL'){var _0x30f39e={};_0x30f39e[_0x5952f5[_0x9840('0x25')]]={'$like':'%'+_0x336109[_0x9840('0x2b')][_0x9840('0x38')]+'%'};return _0x30f39e;}})});}_0x50047a=_[_0x9840('0x39')]({},_0x50047a,_0x336109['options']);var _0x38d0aa={'where':_0x50047a['where']};return db[_0x9840('0x3a')][_0x9840('0x1a')](_0x38d0aa)[_0x9840('0x20')](function(_0x5ed277){_0x35076e[_0x9840('0x1a')]=_0x5ed277;if(_0x336109['query'][_0x9840('0x3b')]){_0x50047a[_0x9840('0x3c')]=[{'all':!![]}];}return db[_0x9840('0x3a')]['findAll'](_0x50047a);})[_0x9840('0x20')](function(_0x3ee4c0){_0x35076e[_0x9840('0x3d')]=_0x3ee4c0;return _0x35076e;})[_0x9840('0x20')](respondWithFilteredResult(_0x5a76b7,_0x50047a))[_0x9840('0x3e')](handleError(_0x5a76b7,null));};exports[_0x9840('0x3f')]=function(_0x33976d,_0x565c88){var _0x123bd7={'raw':!![],'where':{'id':_0x33976d[_0x9840('0x40')]['id']}},_0x1fb8a8={};_0x1fb8a8[_0x9840('0x2f')]=_['keys'](db[_0x9840('0x3a')][_0x9840('0x41')]);_0x1fb8a8['query']=_[_0x9840('0x2c')](_0x33976d['query']);_0x1fb8a8[_0x9840('0x2d')]=_[_0x9840('0x2e')](_0x1fb8a8[_0x9840('0x2f')],_0x1fb8a8[_0x9840('0x2b')]);_0x123bd7[_0x9840('0x30')]=_[_0x9840('0x2e')](_0x1fb8a8[_0x9840('0x2f')],qs[_0x9840('0x31')](_0x33976d[_0x9840('0x2b')]['fields']));_0x123bd7[_0x9840('0x30')]=_0x123bd7[_0x9840('0x30')][_0x9840('0x32')]?_0x123bd7[_0x9840('0x30')]:_0x1fb8a8[_0x9840('0x2f')];if(_0x33976d[_0x9840('0x2b')]['includeAll']){_0x123bd7[_0x9840('0x3c')]=[{'all':!![]}];}_0x123bd7=_[_0x9840('0x39')]({},_0x123bd7,_0x33976d[_0x9840('0x42')]);return db['Attachment'][_0x9840('0x43')](_0x123bd7)[_0x9840('0x20')](handleEntityNotFound(_0x565c88,null))[_0x9840('0x20')](respondWithResult(_0x565c88,null))[_0x9840('0x3e')](handleError(_0x565c88,null));};exports['clone']=function(_0x552848,_0x53c02b){var _0x1fa224={'where':{'id':_0x552848[_0x9840('0x40')]['id']}},_0x37007e={};_0x37007e['model']=_[_0x9840('0x2c')](db[_0x9840('0x3a')][_0x9840('0x41')]);_0x1fa224[_0x9840('0x30')]=_[_0x9840('0x2e')](_0x37007e['model'],qs[_0x9840('0x31')](_0x552848[_0x9840('0x2b')][_0x9840('0x31')]));_0x1fa224['attributes']=_0x1fa224[_0x9840('0x30')][_0x9840('0x32')]?_0x1fa224[_0x9840('0x30')]:_0x37007e[_0x9840('0x2f')];if(_0x552848[_0x9840('0x2b')][_0x9840('0x3b')]){_0x1fa224[_0x9840('0x3c')]=[{'all':!![]}];}_0x1fa224=_[_0x9840('0x39')]({},_0x1fa224,_0x552848[_0x9840('0x42')]);return db[_0x9840('0x3a')][_0x9840('0x43')](_0x1fa224)[_0x9840('0x20')](handleEntityNotFound(_0x53c02b,null))[_0x9840('0x20')](function(_0x430bbd){if(_0x430bbd){var _0x2792bd=_0x430bbd[_0x9840('0x44')]({'plain':!![]});_0x2792bd=qs['omit'](_0x2792bd,['id','createdAt',_0x9840('0x45')]);_0x552848['body']=_[_0x9840('0x46')](_0x552848['body'],['id',_0x9840('0x47'),_0x9840('0x45')]);return db[_0x9840('0x3a')][_0x9840('0x48')](_['merge'](_0x2792bd,_0x552848['body']),{'include':_0x552848[_0x9840('0x2b')][_0x9840('0x3b')]?[{'all':!![]}]:undefined});}})[_0x9840('0x20')](respondWithResult(_0x53c02b,0xc9))[_0x9840('0x3e')](handleError(_0x53c02b,null));};exports[_0x9840('0x1f')]=function(_0xc5f1fa,_0x1e23ba){if(_0xc5f1fa['body']['id']){delete _0xc5f1fa[_0x9840('0x49')]['id'];}return db['Attachment'][_0x9840('0x43')]({'where':{'id':_0xc5f1fa['params']['id']}})[_0x9840('0x20')](handleEntityNotFound(_0x1e23ba,null))[_0x9840('0x20')](saveUpdates(_0xc5f1fa['body'],null))[_0x9840('0x20')](respondWithResult(_0x1e23ba,null))['catch'](handleError(_0x1e23ba,null));};exports[_0x9840('0x21')]=function(_0x565ebf,_0x533523){return db[_0x9840('0x3a')]['find']({'where':{'id':_0x565ebf[_0x9840('0x40')]['id']}})[_0x9840('0x20')](handleEntityNotFound(_0x533523,null))[_0x9840('0x20')](removeEntity(_0x533523,null))[_0x9840('0x3e')](handleError(_0x533523,null));};exports['create']=function(_0x20fa65,_0x236ff8,_0x4cd134){_0x20fa65[_0x9840('0x49')][_0x9840('0x25')]=_0x20fa65[_0x9840('0x4a')][_0x9840('0x4b')];_0x20fa65[_0x9840('0x49')][_0x9840('0x4c')]=_0x20fa65[_0x9840('0x4a')][_0x9840('0x4d')];_0x20fa65[_0x9840('0x49')][_0x9840('0x29')]=_0x20fa65[_0x9840('0x4a')][_0x9840('0x4e')];return db['Attachment'][_0x9840('0x48')](_0x20fa65[_0x9840('0x49')])[_0x9840('0x20')](respondWithResult(_0x236ff8,0xc9))[_0x9840('0x3e')](handleError(_0x236ff8,null));};exports[_0x9840('0x4f')]=function(_0x2857f2,_0x5b00db,_0x32896f){return db[_0x9840('0x3a')][_0x9840('0x50')]({'where':{'id':_0x2857f2[_0x9840('0x40')]['id']},'raw':!![]})[_0x9840('0x20')](handleEntityNotFound(_0x5b00db,null))[_0x9840('0x20')](function(_0x48f755){if(_0x48f755){var _0x4447c2=_0x48f755['ChatOfflineMessageId']!==null;var _0x2cca3e=path[_0x9840('0x51')](config[_0x9840('0x52')],'server/files/attachments/');if(_0x4447c2){_0x2cca3e=path[_0x9840('0x51')](_0x2cca3e,_0x9840('0x53'));}var _0x40b43d=path['join'](_0x2cca3e,_0x48f755[_0x9840('0x4c')]);return _0x5b00db[_0x9840('0x4f')](_0x40b43d);}})['catch'](handleError(_0x5b00db,null));}; \ No newline at end of file diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js index 9415528..53446e4 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 _0xed52=['moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','Attachment','util','api'];(function(_0x2b9462,_0x262d45){var _0x2bb1fb=function(_0xc6f90f){while(--_0xc6f90f){_0x2b9462['push'](_0x2b9462['shift']());}};_0x2bb1fb(++_0x262d45);}(_0xed52,0x1b6));var _0x2ed5=function(_0x54d4fe,_0x55e869){_0x54d4fe=_0x54d4fe-0x0;var _0x1ab5bb=_0xed52[_0x54d4fe];return _0x1ab5bb;};'use strict';var _=require('lodash');var util=require(_0x2ed5('0x0'));var logger=require('../../config/logger')(_0x2ed5('0x1'));var moment=require(_0x2ed5('0x2'));var BPromise=require(_0x2ed5('0x3'));var rp=require(_0x2ed5('0x4'));var fs=require('fs');var path=require(_0x2ed5('0x5'));var rimraf=require(_0x2ed5('0x6'));var config=require(_0x2ed5('0x7'));var attributes=require('./attachment.attributes');module[_0x2ed5('0x8')]=function(_0x50541c,_0x5cea66){return _0x50541c[_0x2ed5('0x9')](_0x2ed5('0xa'),attributes,{'tableName':'attachments','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7b7d=['bluebird','path','rimraf','../../config/environment','./attachment.attributes','exports','define','Attachment','attachments','util','../../config/logger'];(function(_0x2adf4,_0x5df6de){var _0x45d47d=function(_0x903910){while(--_0x903910){_0x2adf4['push'](_0x2adf4['shift']());}};_0x45d47d(++_0x5df6de);}(_0x7b7d,0x148));var _0xd7b7=function(_0xb4688d,_0x3276fe){_0xb4688d=_0xb4688d-0x0;var _0x4e08bd=_0x7b7d[_0xb4688d];return _0x4e08bd;};'use strict';var _=require('lodash');var util=require(_0xd7b7('0x0'));var logger=require(_0xd7b7('0x1'))('api');var moment=require('moment');var BPromise=require(_0xd7b7('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd7b7('0x3'));var rimraf=require(_0xd7b7('0x4'));var config=require(_0xd7b7('0x5'));var attributes=require(_0xd7b7('0x6'));module[_0xd7b7('0x7')]=function(_0x34c0fd,_0x1fb1a5){return _0x34c0fd[_0xd7b7('0x8')](_0xd7b7('0x9'),attributes,{'tableName':_0xd7b7('0xa'),'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 b2638b5..55acf67 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 _0x78f0=['client','request','then','info','Attachment,\x20%s,\x20%s','request\x20sent','Attachment,\x20%s,\x20%s,\x20%s','error','code','message','result','CreateAttachment','Attachment','create','body','options','debug','stringify','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise'];(function(_0x35dd48,_0x41e6f8){var _0xb71d96=function(_0x45c7a8){while(--_0x45c7a8){_0x35dd48['push'](_0x35dd48['shift']());}};_0xb71d96(++_0x41e6f8);}(_0x78f0,0x15d));var _0x078f=function(_0x145bf4,_0x57e69e){_0x145bf4=_0x145bf4-0x0;var _0x3735ae=_0x78f0[_0x145bf4];return _0x3735ae;};'use strict';var _=require(_0x078f('0x0'));var util=require(_0x078f('0x1'));var moment=require(_0x078f('0x2'));var BPromise=require(_0x078f('0x3'));var rs=require(_0x078f('0x4'));var fs=require('fs');var Redis=require(_0x078f('0x5'));var db=require(_0x078f('0x6'))['db'];var utils=require(_0x078f('0x7'));var logger=require('../../config/logger')(_0x078f('0x8'));var config=require(_0x078f('0x9'));var jayson=require(_0x078f('0xa'));var client=jayson[_0x078f('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x728cfe,_0x205510,_0x4a7db3){return new BPromise(function(_0x2ef013,_0x1901e3){return client[_0x078f('0xc')](_0x728cfe,_0x4a7db3)[_0x078f('0xd')](function(_0x7e87f){logger[_0x078f('0xe')](_0x078f('0xf'),_0x205510,_0x078f('0x10'));logger['debug'](_0x078f('0x11'),_0x205510,_0x078f('0x10'),JSON['stringify'](_0x7e87f));if(_0x7e87f[_0x078f('0x12')]){if(_0x7e87f[_0x078f('0x12')][_0x078f('0x13')]===0x1f4){logger[_0x078f('0x12')]('Attachment,\x20%s,\x20%s',_0x205510,_0x7e87f['error'][_0x078f('0x14')]);return _0x1901e3(_0x7e87f[_0x078f('0x12')][_0x078f('0x14')]);}logger[_0x078f('0x12')]('Attachment,\x20%s,\x20%s',_0x205510,_0x7e87f[_0x078f('0x12')][_0x078f('0x14')]);return _0x2ef013(_0x7e87f['error'][_0x078f('0x14')]);}else{logger[_0x078f('0xe')](_0x078f('0xf'),_0x205510,_0x078f('0x10'));_0x2ef013(_0x7e87f[_0x078f('0x15')][_0x078f('0x14')]);}})['catch'](function(_0x56bad2){logger[_0x078f('0x12')](_0x078f('0xf'),_0x205510,_0x56bad2);_0x1901e3(_0x56bad2);});});}exports[_0x078f('0x16')]=function(_0x19a182){var _0x201560=this;return new Promise(function(_0x25bb2d,_0xb8af8c){return db[_0x078f('0x17')][_0x078f('0x18')](_0x19a182[_0x078f('0x19')],{'raw':_0x19a182[_0x078f('0x1a')]?_0x19a182[_0x078f('0x1a')]['raw']===undefined?!![]:![]:!![]})[_0x078f('0xd')](function(_0x52c74f){logger['info'](_0x078f('0x16'),_0x19a182);logger[_0x078f('0x1b')](_0x078f('0x16'),_0x19a182,JSON[_0x078f('0x1c')](_0x52c74f));_0x25bb2d(_0x52c74f);})[_0x078f('0x1d')](function(_0x2c6db4){logger[_0x078f('0x12')](_0x078f('0x16'),_0x2c6db4[_0x078f('0x14')],_0x19a182);_0xb8af8c(_0x201560['error'](0x1f4,_0x2c6db4[_0x078f('0x14')]));});});}; \ No newline at end of file +var _0xc831=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','info','debug','Attachment,\x20%s,\x20%s,\x20%s','request\x20sent','error','Attachment,\x20%s,\x20%s','message','result','catch','create','options','then','util','moment','bluebird','randomstring','ioredis'];(function(_0x35e3f0,_0xd0df49){var _0x3ebd9c=function(_0x3fd3ed){while(--_0x3fd3ed){_0x35e3f0['push'](_0x35e3f0['shift']());}};_0x3ebd9c(++_0xd0df49);}(_0xc831,0x103));var _0x1c83=function(_0x55900e,_0x12da81){_0x55900e=_0x55900e-0x0;var _0x3bb561=_0xc831[_0x55900e];return _0x3bb561;};'use strict';var _=require('lodash');var util=require(_0x1c83('0x0'));var moment=require(_0x1c83('0x1'));var BPromise=require(_0x1c83('0x2'));var rs=require(_0x1c83('0x3'));var fs=require('fs');var Redis=require(_0x1c83('0x4'));var db=require(_0x1c83('0x5'))['db'];var utils=require(_0x1c83('0x6'));var logger=require(_0x1c83('0x7'))(_0x1c83('0x8'));var config=require(_0x1c83('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1c83('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x52ec70,_0x1ce77e,_0x1953e5){return new BPromise(function(_0x29ceee,_0x38f254){return client[_0x1c83('0xb')](_0x52ec70,_0x1953e5)['then'](function(_0x9cb1e2){logger[_0x1c83('0xc')]('Attachment,\x20%s,\x20%s',_0x1ce77e,'request\x20sent');logger[_0x1c83('0xd')](_0x1c83('0xe'),_0x1ce77e,_0x1c83('0xf'),JSON['stringify'](_0x9cb1e2));if(_0x9cb1e2[_0x1c83('0x10')]){if(_0x9cb1e2['error']['code']===0x1f4){logger[_0x1c83('0x10')](_0x1c83('0x11'),_0x1ce77e,_0x9cb1e2[_0x1c83('0x10')][_0x1c83('0x12')]);return _0x38f254(_0x9cb1e2[_0x1c83('0x10')][_0x1c83('0x12')]);}logger[_0x1c83('0x10')]('Attachment,\x20%s,\x20%s',_0x1ce77e,_0x9cb1e2[_0x1c83('0x10')][_0x1c83('0x12')]);return _0x29ceee(_0x9cb1e2[_0x1c83('0x10')][_0x1c83('0x12')]);}else{logger[_0x1c83('0xc')]('Attachment,\x20%s,\x20%s',_0x1ce77e,_0x1c83('0xf'));_0x29ceee(_0x9cb1e2[_0x1c83('0x13')][_0x1c83('0x12')]);}})[_0x1c83('0x14')](function(_0x596a69){logger[_0x1c83('0x10')]('Attachment,\x20%s,\x20%s',_0x1ce77e,_0x596a69);_0x38f254(_0x596a69);});});}exports['CreateAttachment']=function(_0x3b3369){var _0x1d6027=this;return new Promise(function(_0x2ec743,_0x37a7ac){return db['Attachment'][_0x1c83('0x15')](_0x3b3369['body'],{'raw':_0x3b3369[_0x1c83('0x16')]?_0x3b3369[_0x1c83('0x16')]['raw']===undefined?!![]:![]:!![]})[_0x1c83('0x17')](function(_0x1b5a71){logger['info']('CreateAttachment',_0x3b3369);logger[_0x1c83('0xd')]('CreateAttachment',_0x3b3369,JSON['stringify'](_0x1b5a71));_0x2ec743(_0x1b5a71);})[_0x1c83('0x14')](function(_0x3e216d){logger[_0x1c83('0x10')]('CreateAttachment',_0x3e216d[_0x1c83('0x12')],_0x3b3369);_0x37a7ac(_0x1d6027[_0x1c83('0x10')](0x1f4,_0x3e216d[_0x1c83('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js index c21d89c..0da67df 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 _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(_0x10af03,_0x3d8790){var _0x3e0018=function(_0x741b01){while(--_0x741b01){_0x10af03['push'](_0x10af03['shift']());}};_0x3e0018(++_0x3d8790);}(_0xadb5,0xad));var _0x5adb=function(_0x5db436,_0x10fe25){_0x5db436=_0x5db436-0x0;var _0x2b3577=_0xadb5[_0x5db436];return _0x2b3577;};'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 +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(_0x437b9a,_0x2306d6){var _0x451ff5=function(_0x46789b){while(--_0x46789b){_0x437b9a['push'](_0x437b9a['shift']());}};_0x451ff5(++_0x2306d6);}(_0x5f2f,0x73));var _0xf5f2=function(_0x2ea33d,_0x1076c9){_0x2ea33d=_0x2ea33d-0x0;var _0x2065a8=_0x5f2f[_0x2ea33d];return _0x2065a8;};'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 diff --git a/server/api/authGoogle/authGoogle.controller.js b/server/api/authGoogle/authGoogle.controller.js index 7e361ff..e1021fa 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 _0x7499=['authenticate','/login','callback','google','clientID','clientSecret','secret','findOne','allowedLoginAttempts','blockDuration','then','User','find','map','value','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blocked','blockedAt','add','minutes','getLicense','catch','lodash','passport-google-oauth20','Strategy','moment','../../config/environment','../../config/utils','login'];(function(_0x3b38b9,_0x257b5f){var _0x5e6531=function(_0x14a246){while(--_0x14a246){_0x3b38b9['push'](_0x3b38b9['shift']());}};_0x5e6531(++_0x257b5f);}(_0x7499,0x199));var _0x9749=function(_0x227c55,_0x49db56){_0x227c55=_0x227c55-0x0;var _0x49e02b=_0x7499[_0x227c55];return _0x49e02b;};'use strict';var _=require(_0x9749('0x0'));var passport=require('passport');var GoogleStrategy=require(_0x9749('0x1'))[_0x9749('0x2')];var moment=require(_0x9749('0x3'));var db=require('../../mysqldb')['db'];var config=require(_0x9749('0x4'));var signToken=require('../../components/auth/service')['signToken'];var utils=require(_0x9749('0x5'));exports[_0x9749('0x6')]=passport[_0x9749('0x7')]('google',{'failureRedirect':_0x9749('0x8'),'scope':['profile','email'],'session':![]});exports[_0x9749('0x9')]=passport[_0x9749('0x7')](_0x9749('0xa'),{'failureRedirect':_0x9749('0x8'),'session':![]});passport['use'](new GoogleStrategy({'clientID':config[_0x9749('0xa')]?config['google'][_0x9749('0xb')]:'id','clientSecret':config[_0x9749('0xa')]?config[_0x9749('0xa')][_0x9749('0xc')]:_0x9749('0xd'),'callbackURL':config[_0x9749('0xa')]?config[_0x9749('0xa')]['callbackURL']:''},function(_0x480d89,_0x2cfbd1,_0x4c49a2,_0x39f8e4){var _0x3769fc,_0x1d9cf9;return db['Setting'][_0x9749('0xe')]({'where':{'id':0x1},'attributes':[_0x9749('0xf'),_0x9749('0x10')],'raw':!![]})[_0x9749('0x11')](function(_0xc1166c){_0x3769fc=_0xc1166c;return db[_0x9749('0x12')][_0x9749('0x13')]({'where':{'email':_[_0x9749('0x14')](_0x4c49a2['emails'],_0x9749('0x15')),'role':{'$or':[_0x9749('0x16'),_0x9749('0x17'),_0x9749('0x18')]}}});})['then'](function(_0x4d33bc){_0x1d9cf9=_0x4d33bc;if(_0x1d9cf9){if(_0x1d9cf9['disabled']){return _0x39f8e4(_0x9749('0x19'));}else if(_0x3769fc[_0x9749('0x10')]>0x0){if(_0x1d9cf9[_0x9749('0x1a')]){if(moment(_0x1d9cf9[_0x9749('0x1b')])[_0x9749('0x1c')](_0x3769fc['blockDuration'],_0x9749('0x1d'))>moment()){return _0x39f8e4(_0x9749('0x19'));}else{return utils['clearBlockUser'](_0x1d9cf9,0x0,![],null)['then'](function(){return utils['getLicense'](_0x1d9cf9);})[_0x9749('0x11')](function(){return _0x39f8e4(null,_0x1d9cf9);});}}else{return utils[_0x9749('0x1e')](_0x1d9cf9)[_0x9749('0x11')](function(){return _0x39f8e4(null,_0x1d9cf9);});}}else{return utils['getLicense'](_0x1d9cf9)['then'](function(){return _0x39f8e4(null,_0x1d9cf9);});}}return _0x39f8e4(_0x9749('0x19'));})[_0x9749('0x1f')](function(_0x1bcbae){_0x39f8e4(_0x1bcbae);});})); \ No newline at end of file +var _0x16d9=['map','value','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blocked','blockedAt','add','minutes','clearBlockUser','getLicense','catch','lodash','passport','passport-google-oauth20','moment','../../config/environment','../../components/auth/service','signToken','../../config/utils','authenticate','google','/login','profile','use','clientID','clientSecret','secret','callbackURL','Setting','findOne','allowedLoginAttempts','blockDuration','then'];(function(_0x16f0cf,_0x4b1c90){var _0x1c4cf3=function(_0xfd905e){while(--_0xfd905e){_0x16f0cf['push'](_0x16f0cf['shift']());}};_0x1c4cf3(++_0x4b1c90);}(_0x16d9,0x125));var _0x916d=function(_0x200af4,_0x8416e8){_0x200af4=_0x200af4-0x0;var _0x3831b6=_0x16d9[_0x200af4];return _0x3831b6;};'use strict';var _=require(_0x916d('0x0'));var passport=require(_0x916d('0x1'));var GoogleStrategy=require(_0x916d('0x2'))['Strategy'];var moment=require(_0x916d('0x3'));var db=require('../../mysqldb')['db'];var config=require(_0x916d('0x4'));var signToken=require(_0x916d('0x5'))[_0x916d('0x6')];var utils=require(_0x916d('0x7'));exports['login']=passport[_0x916d('0x8')](_0x916d('0x9'),{'failureRedirect':_0x916d('0xa'),'scope':[_0x916d('0xb'),'email'],'session':![]});exports['callback']=passport[_0x916d('0x8')](_0x916d('0x9'),{'failureRedirect':_0x916d('0xa'),'session':![]});passport[_0x916d('0xc')](new GoogleStrategy({'clientID':config[_0x916d('0x9')]?config['google'][_0x916d('0xd')]:'id','clientSecret':config[_0x916d('0x9')]?config[_0x916d('0x9')][_0x916d('0xe')]:_0x916d('0xf'),'callbackURL':config[_0x916d('0x9')]?config[_0x916d('0x9')][_0x916d('0x10')]:''},function(_0x4d516f,_0x5c436f,_0x5f1ff0,_0x1543ba){var _0x5e4387,_0x315dde;return db[_0x916d('0x11')][_0x916d('0x12')]({'where':{'id':0x1},'attributes':[_0x916d('0x13'),_0x916d('0x14')],'raw':!![]})[_0x916d('0x15')](function(_0x1419cc){_0x5e4387=_0x1419cc;return db['User']['find']({'where':{'email':_[_0x916d('0x16')](_0x5f1ff0['emails'],_0x916d('0x17')),'role':{'$or':[_0x916d('0x18'),_0x916d('0x19'),_0x916d('0x1a')]}}});})[_0x916d('0x15')](function(_0x281994){_0x315dde=_0x281994;if(_0x315dde){if(_0x315dde['disabled']){return _0x1543ba(_0x916d('0x1b'));}else if(_0x5e4387['blockDuration']>0x0){if(_0x315dde[_0x916d('0x1c')]){if(moment(_0x315dde[_0x916d('0x1d')])[_0x916d('0x1e')](_0x5e4387['blockDuration'],_0x916d('0x1f'))>moment()){return _0x1543ba('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{return utils[_0x916d('0x20')](_0x315dde,0x0,![],null)['then'](function(){return utils['getLicense'](_0x315dde);})['then'](function(){return _0x1543ba(null,_0x315dde);});}}else{return utils[_0x916d('0x21')](_0x315dde)[_0x916d('0x15')](function(){return _0x1543ba(null,_0x315dde);});}}else{return utils['getLicense'](_0x315dde)[_0x916d('0x15')](function(){return _0x1543ba(null,_0x315dde);});}}return _0x1543ba('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');})[_0x916d('0x22')](function(_0x27825f){_0x1543ba(_0x27825f);});})); \ No newline at end of file diff --git a/server/api/authGoogle/index.js b/server/api/authGoogle/index.js index dbb712e..80b5cd6 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 _0x4a2e=['express','passport','Router','./authGoogle.controller','../user/user.controller.js','../../components/auth/service','get','login','setTokenCookie'];(function(_0x55808c,_0x243a4e){var _0x4cb402=function(_0x291981){while(--_0x291981){_0x55808c['push'](_0x55808c['shift']());}};_0x4cb402(++_0x243a4e);}(_0x4a2e,0x87));var _0xe4a2=function(_0x2170e4,_0x5b969e){_0x2170e4=_0x2170e4-0x0;var _0xec86f5=_0x4a2e[_0x2170e4];return _0xec86f5;};'use strict';var express=require(_0xe4a2('0x0'));var passport=require(_0xe4a2('0x1'));var router=express[_0xe4a2('0x2')]();var controller=require(_0xe4a2('0x3'));var userController=require(_0xe4a2('0x4'));var authService=require(_0xe4a2('0x5'));router[_0xe4a2('0x6')]('/',controller[_0xe4a2('0x7')]);router['get']('/callback',controller['callback'],authService['isMiddleware'],userController[_0xe4a2('0x7')],authService[_0xe4a2('0x8')]);module['exports']=router; \ No newline at end of file +var _0x9e0b=['setTokenCookie','express','../user/user.controller.js','../../components/auth/service','get','callback','isMiddleware','login'];(function(_0x3186aa,_0x34c21e){var _0x2d8c36=function(_0x239e99){while(--_0x239e99){_0x3186aa['push'](_0x3186aa['shift']());}};_0x2d8c36(++_0x34c21e);}(_0x9e0b,0xc1));var _0xb9e0=function(_0x4e676e,_0x2a7c6d){_0x4e676e=_0x4e676e-0x0;var _0x336a3c=_0x9e0b[_0x4e676e];return _0x336a3c;};'use strict';var express=require(_0xb9e0('0x0'));var passport=require('passport');var router=express['Router']();var controller=require('./authGoogle.controller');var userController=require(_0xb9e0('0x1'));var authService=require(_0xb9e0('0x2'));router[_0xb9e0('0x3')]('/',controller['login']);router[_0xb9e0('0x3')]('/callback',controller[_0xb9e0('0x4')],authService[_0xb9e0('0x5')],userController[_0xb9e0('0x6')],authService[_0xb9e0('0x7')]);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 8ff6770..e04303a 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 _0xd3d1=['Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','online','forgot','body','Email\x20parameter\x20is\x20missing','generate','trim','User','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','minutes','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','now','xCally\x20Motion\x20Password\x20Reset','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','headers','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','status','Reset\x20Email\x20sent!','params','token','securePassword','enforcePasswordHistory','passwordHistoryLimit','validatePasswordPattern','previousPasswords','validatePasswordHistory','Password\x20reset!','use','util','passport','jayson/promise','lodash','randomstring','moment','../../mysqldb','../../components/auth/service','../../config/utils','client','http','Setting','findOne','blockDuration','then','name','password','salt','role','disabled','blocked','blockedAt','admin','user','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','loginAttempts','allowedLoginAttempts','add','clearBlockUser','getLicense','catch','MailAccount','find','email','MailServerOut','Smtp','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','service','host','port','secure','auth','merge','format','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','stringify','send'];(function(_0x41fa3f,_0x956935){var _0x214975=function(_0x113abf){while(--_0x113abf){_0x41fa3f['push'](_0x41fa3f['shift']());}};_0x214975(++_0x956935);}(_0xd3d1,0x172));var _0x1d3d=function(_0x36ed48,_0x1ee0d4){_0x36ed48=_0x36ed48-0x0;var _0x51c63a=_0xd3d1[_0x36ed48];return _0x51c63a;};'use strict';var util=require(_0x1d3d('0x0'));var passport=require(_0x1d3d('0x1'));var LocalStrategy=require('passport-local')['Strategy'];var jayson=require(_0x1d3d('0x2'));var _=require(_0x1d3d('0x3'));var rs=require(_0x1d3d('0x4'));var moment=require(_0x1d3d('0x5'));var db=require(_0x1d3d('0x6'))['db'];var authService=require(_0x1d3d('0x7'));var utils=require(_0x1d3d('0x8'));var client=jayson[_0x1d3d('0x9')][_0x1d3d('0xa')]({'port':0x232b});function localAuthenticate(_0x449475,_0x3831ce,_0xb1b3c6,_0xe10bca){var _0x2c377c,_0xbea61e;return db[_0x1d3d('0xb')][_0x1d3d('0xc')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0x1d3d('0xd')],'raw':!![]})[_0x1d3d('0xe')](function(_0x32d5da){_0x2c377c=_0x32d5da;return _0x449475[_0x1d3d('0xc')]({'attributes':['id',_0x1d3d('0xf'),_0x1d3d('0x10'),_0x1d3d('0x11'),_0x1d3d('0x12'),_0x1d3d('0x13'),_0x1d3d('0x14'),_0x1d3d('0x15'),'loginAttempts'],'where':{'name':_0x3831ce,'role':{'$or':[_0x1d3d('0x16'),_0x1d3d('0x17'),'agent']}}});})['then'](function(_0x12bd00){if(!_0x12bd00||_0x12bd00&&_0x12bd00[_0x1d3d('0xf')]!==_0x3831ce){throw new Error(_0x1d3d('0x18'));}else{_0xbea61e=_0x12bd00;return _0xbea61e;}})['then'](function(){_0xbea61e[_0x1d3d('0x19')](_0xb1b3c6,function(_0x4dcc22,_0x1d54f3){var _0x33e7d9=_0xbea61e[_0x1d3d('0x1a')]+0x1;if(_0x4dcc22){return _0xe10bca(_0x4dcc22);}else if(!_0x1d54f3){if(_0xbea61e[_0x1d3d('0x13')]){return _0xe10bca(null,![],{'message':_0x1d3d('0x18')});}else if(_0x2c377c[_0x1d3d('0x1b')]>0x0){if(_0xbea61e[_0x1d3d('0x14')]){if(_0x2c377c['blockDuration']>0x0){if(moment(_0xbea61e['blockedAt'])[_0x1d3d('0x1c')](_0x2c377c[_0x1d3d('0xd')],'minutes')>moment()){return _0xe10bca(null,![],{'message':_0x1d3d('0x18')});}else{return utils['clearBlockUser'](_0xbea61e,_0x33e7d9,![],null)[_0x1d3d('0xe')](function(){return _0xe10bca(null,![],{'message':_0x1d3d('0x18')});});}}else{return _0xe10bca(null,![],{'message':_0x1d3d('0x18')});}}else{if(_0x33e7d9>=_0x2c377c[_0x1d3d('0x1b')]){return utils['clearBlockUser'](_0xbea61e,0x0,!![],moment())[_0x1d3d('0xe')](function(){return _0xe10bca(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}else{return utils['clearBlockUser'](_0xbea61e,_0x33e7d9,![],null)[_0x1d3d('0xe')](function(){return _0xe10bca(null,![],{'message':_0x1d3d('0x18')});});}}}else{return _0xe10bca(null,![],{'message':_0x1d3d('0x18')});}}else{if(_0xbea61e[_0x1d3d('0x13')]){return _0xe10bca(null,![],{'message':_0x1d3d('0x18')});}else if(_0x2c377c[_0x1d3d('0x1b')]>0x0){if(_0xbea61e[_0x1d3d('0x14')]){if(_0x2c377c[_0x1d3d('0xd')]>0x0){if(moment(_0xbea61e[_0x1d3d('0x15')])[_0x1d3d('0x1c')](_0x2c377c[_0x1d3d('0xd')],'minutes')>moment()){return _0xe10bca(null,![],{'message':_0x1d3d('0x18')});}else{return utils[_0x1d3d('0x1d')](_0xbea61e,0x0,![],null)['then'](function(){return utils[_0x1d3d('0x1e')](_0xbea61e);})['then'](function(){return _0xe10bca(null,_0xbea61e);});}}else{return _0xe10bca(null,![],{'message':_0x1d3d('0x18')});}}else{return utils[_0x1d3d('0x1d')](_0xbea61e,0x0,![],null)[_0x1d3d('0xe')](function(){return utils[_0x1d3d('0x1e')](_0xbea61e);})[_0x1d3d('0xe')](function(){return _0xe10bca(null,_0xbea61e);})[_0x1d3d('0x1f')](function(_0x2b8074){return _0xe10bca(null,![],_0x2b8074);});}}else{if(_0xbea61e[_0x1d3d('0x14')]){return _0xe10bca(null,![],{'message':_0x1d3d('0x18')});}else{return utils[_0x1d3d('0x1e')](_0xbea61e)[_0x1d3d('0xe')](function(){return _0xe10bca(null,_0xbea61e);});}}}});})['catch'](function(_0x3f5681){return _0xe10bca(null,![],_0x3f5681);});}function sendServiceMail(_0x5b2986){return db[_0x1d3d('0x20')][_0x1d3d('0x21')]({'where':{'service':!![]},'attributes':['id','name',_0x1d3d('0x22')],'include':[{'model':db[_0x1d3d('0x23')],'as':_0x1d3d('0x24')}]})[_0x1d3d('0xe')](function(_0x4abbfc){if(!_0x4abbfc){throw new Error(_0x1d3d('0x25'));}var _0x235ef3={'tls':{'rejectUnauthorized':![]}};if(_0x4abbfc['Smtp'][_0x1d3d('0x26')]){_0x235ef3['service']=_0x4abbfc[_0x1d3d('0x24')][_0x1d3d('0x26')];}else{_0x235ef3['host']=_0x4abbfc[_0x1d3d('0x24')][_0x1d3d('0x27')];_0x235ef3[_0x1d3d('0x28')]=_0x4abbfc[_0x1d3d('0x24')][_0x1d3d('0x28')];_0x235ef3[_0x1d3d('0x29')]=_0x4abbfc[_0x1d3d('0x24')][_0x1d3d('0x29')];}if(_0x4abbfc[_0x1d3d('0x24')]['authentication']){_0x235ef3[_0x1d3d('0x2a')]={'user':_0x4abbfc[_0x1d3d('0x24')][_0x1d3d('0x17')],'pass':_0x4abbfc[_0x1d3d('0x24')]['pass']};}var _0x4a1e67={'account':_0x235ef3,'message':_[_0x1d3d('0x2b')]({'from':util[_0x1d3d('0x2c')]('\x22%s\x22\x20<%s>',_0x4abbfc[_0x1d3d('0xf')],_0x4abbfc[_0x1d3d('0x22')]||_0x4abbfc[_0x1d3d('0x24')][_0x1d3d('0x17')])},_0x5b2986)};return client['request']('SendMail',_0x4a1e67);})[_0x1d3d('0xe')](function(_0x505d06){if(_0x505d06[_0x1d3d('0x2d')]){throw new Error(util[_0x1d3d('0x2c')](_0x1d3d('0x2e'),_0x505d06[_0x1d3d('0x2d')][_0x1d3d('0x2f')]||JSON[_0x1d3d('0x30')](_0x505d06[_0x1d3d('0x2d')])));}return!![];});}function handleError(_0x303cc7,_0x4b15a3,_0xdfdf1c){return _0x303cc7['status'](_0x4b15a3||0x1f4)[_0x1d3d('0x31')]({'message':_0xdfdf1c?_0xdfdf1c[_0x1d3d('0x2f')]||_0xdfdf1c:''});}exports['login']=function(_0x175e8a,_0x2319af,_0x182083){passport[_0x1d3d('0x19')]('local',function(_0x4a9914,_0x434dad,_0x59502c){var _0x290853=_0x4a9914||_0x59502c;if(_0x290853){return handleError(_0x2319af,0x191,_0x290853);}if(!_0x434dad){return handleError(_0x2319af,0x194,{'message':_0x1d3d('0x32')});}else{var _0x5ba0cd={'payload':{'id':_0x434dad['id'],'role':_0x434dad[_0x1d3d('0x12')]},'options':{'expiresIn':0x15180}};return authService[_0x1d3d('0x33')](_0x5ba0cd)['then'](function(_0x2d5015){_0x2319af[_0x1d3d('0x34')]({'id':_0x434dad['id'],'token':_0x2d5015,'statusCall':'','isAlreadyLogged':_0x434dad[_0x1d3d('0x35')]});});}})(_0x175e8a,_0x2319af,_0x182083);};exports[_0x1d3d('0x36')]=function(_0x1fec46,_0x36c713,_0x502507){if(!_0x1fec46[_0x1d3d('0x37')][_0x1d3d('0x22')]){return handleError(_0x36c713,0x1f4,{'message':_0x1d3d('0x38')});}var _0x3941bd=rs[_0x1d3d('0x39')]();_0x1fec46['body'][_0x1d3d('0x22')]=_0x1fec46[_0x1d3d('0x37')][_0x1d3d('0x22')][_0x1d3d('0x3a')]()['toLowerCase']();var _0x3d1c0c;return db[_0x1d3d('0xb')][_0x1d3d('0xc')]({'where':{'id':0x1},'attributes':[_0x1d3d('0x1b'),_0x1d3d('0xd')],'raw':!![]})['then'](function(_0x5def94){_0x3d1c0c=_0x5def94;return db[_0x1d3d('0x3b')][_0x1d3d('0x21')]({'where':{'email':_0x1fec46[_0x1d3d('0x37')][_0x1d3d('0x22')]}});})[_0x1d3d('0xe')](function(_0x5c87c6){if(!_0x5c87c6){throw new Error(_0x1d3d('0x3c'));}if(_0x5c87c6['disabled']){throw new Error(_0x1d3d('0x3d'));}if(_0x5c87c6[_0x1d3d('0x14')]){if(moment(_0x5c87c6[_0x1d3d('0x15')])[_0x1d3d('0x1c')](_0x3d1c0c['blockDuration'],_0x1d3d('0x3e'))>moment()){throw new Error(_0x1d3d('0x3f'));}else{_0x5c87c6[_0x1d3d('0x14')]=![];_0x5c87c6[_0x1d3d('0x15')]=null;}}_0x5c87c6[_0x1d3d('0x40')]=_0x3941bd;_0x5c87c6[_0x1d3d('0x41')]=Date[_0x1d3d('0x42')]()+0x36ee80;return _0x5c87c6['save']();})[_0x1d3d('0xe')](function(){return sendServiceMail({'to':_0x1fec46['body'][_0x1d3d('0x22')],'subject':_0x1d3d('0x43'),'text':'You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a'+_0x1d3d('0x44')+'https://'+_0x1fec46[_0x1d3d('0x45')]['host']+_0x1d3d('0x46')+_0x3941bd+'\x0a\x0a'+_0x1d3d('0x47')});})[_0x1d3d('0xe')](function(){_0x36c713[_0x1d3d('0x48')](0xc8)[_0x1d3d('0x31')]({'message':_0x1d3d('0x49')});})[_0x1d3d('0x1f')](function(_0x1b3573){return handleError(_0x36c713,0x1f4,_0x1b3573);});};exports['reset']=function(_0x5899cc,_0x527e6e,_0x299088){return db[_0x1d3d('0x3b')][_0x1d3d('0x21')]({'where':{'resetPasswordToken':_0x5899cc[_0x1d3d('0x4a')][_0x1d3d('0x4b')],'resetPasswordExpires':{'$gt':Date[_0x1d3d('0x42')]()}}})['then'](function(_0x5cc4c1){if(!_0x5cc4c1){throw new Error('Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.');}return db['Setting'][_0x1d3d('0xc')]({'attributes':['id',_0x1d3d('0x4c'),_0x1d3d('0x4d'),_0x1d3d('0x4e')]})[_0x1d3d('0xe')](function(_0x363f4c){if(_0x363f4c[_0x1d3d('0x4c')])authService[_0x1d3d('0x4f')](_0x5899cc[_0x1d3d('0x37')][_0x1d3d('0x10')]);if(!_0x363f4c[_0x1d3d('0x4d')]||!_0x5cc4c1[_0x1d3d('0x50')])return _0x5cc4c1;authService[_0x1d3d('0x51')](_0x5899cc[_0x1d3d('0x37')][_0x1d3d('0x10')],_0x5cc4c1['previousPasswords'],_0x363f4c[_0x1d3d('0x4e')]);return _0x5cc4c1;})[_0x1d3d('0xe')](function(){_0x5cc4c1[_0x1d3d('0x10')]=_0x5899cc[_0x1d3d('0x37')]['password'];_0x5cc4c1[_0x1d3d('0x40')]=null;_0x5cc4c1['resetPasswordExpires']=null;return _0x5cc4c1['save']();});})[_0x1d3d('0xe')](function(){_0x527e6e[_0x1d3d('0x48')](0xc8)['send']({'message':_0x1d3d('0x52')});})[_0x1d3d('0x1f')](function(_0x5a364e){return handleError(_0x527e6e,0x1f4,_0x5a364e);});};passport[_0x1d3d('0x53')](new LocalStrategy({'usernameField':_0x1d3d('0xf'),'passwordField':_0x1d3d('0x10')},function(_0x3ad696,_0x3dc699,_0x267586){return localAuthenticate(db[_0x1d3d('0x3b')],_0x3ad696,_0x3dc699,_0x267586);})); \ No newline at end of file +var _0x11a9=['If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','Reset\x20Email\x20sent!','reset','params','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','enforcePasswordHistory','validatePasswordHistory','previousPasswords','passwordHistoryLimit','resetPasswordToken','save','Password\x20reset!','catch','use','util','passport','passport-local','Strategy','jayson/promise','lodash','randomstring','moment','../../mysqldb','../../components/auth/service','../../config/utils','client','http','Setting','findOne','allowedLoginAttempts','blockDuration','then','password','salt','role','disabled','blockedAt','loginAttempts','user','agent','name','authenticate','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blocked','minutes','clearBlockUser','getLicense','MailAccount','find','email','MailServerOut','Smtp','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','service','host','port','secure','authentication','auth','pass','\x22%s\x22\x20<%s>','request','SendMail','format','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','error','message','stringify','status','send','login','local','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','online','forgot','body','trim','User','add','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordExpires','xCally\x20Motion\x20Password\x20Reset','https://','headers','/reset/'];(function(_0x10ee1d,_0x24594c){var _0x42de36=function(_0x4bf070){while(--_0x4bf070){_0x10ee1d['push'](_0x10ee1d['shift']());}};_0x42de36(++_0x24594c);}(_0x11a9,0x11b));var _0x911a=function(_0x47950c,_0x51a382){_0x47950c=_0x47950c-0x0;var _0x246e0a=_0x11a9[_0x47950c];return _0x246e0a;};'use strict';var util=require(_0x911a('0x0'));var passport=require(_0x911a('0x1'));var LocalStrategy=require(_0x911a('0x2'))[_0x911a('0x3')];var jayson=require(_0x911a('0x4'));var _=require(_0x911a('0x5'));var rs=require(_0x911a('0x6'));var moment=require(_0x911a('0x7'));var db=require(_0x911a('0x8'))['db'];var authService=require(_0x911a('0x9'));var utils=require(_0x911a('0xa'));var client=jayson[_0x911a('0xb')][_0x911a('0xc')]({'port':0x232b});function localAuthenticate(_0x514fb7,_0x423335,_0x572f0c,_0x1621e8){var _0x1066af,_0x181ec0;return db[_0x911a('0xd')][_0x911a('0xe')]({'where':{'id':0x1},'attributes':[_0x911a('0xf'),_0x911a('0x10')],'raw':!![]})[_0x911a('0x11')](function(_0x394a04){_0x1066af=_0x394a04;return _0x514fb7[_0x911a('0xe')]({'attributes':['id','name',_0x911a('0x12'),_0x911a('0x13'),_0x911a('0x14'),_0x911a('0x15'),'blocked',_0x911a('0x16'),_0x911a('0x17')],'where':{'name':_0x423335,'role':{'$or':['admin',_0x911a('0x18'),_0x911a('0x19')]}}});})['then'](function(_0x459be8){if(!_0x459be8||_0x459be8&&_0x459be8[_0x911a('0x1a')]!==_0x423335){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{_0x181ec0=_0x459be8;return _0x181ec0;}})['then'](function(){_0x181ec0[_0x911a('0x1b')](_0x572f0c,function(_0x416ec9,_0x470510){var _0x3959b6=_0x181ec0['loginAttempts']+0x1;if(_0x416ec9){return _0x1621e8(_0x416ec9);}else if(!_0x470510){if(_0x181ec0[_0x911a('0x15')]){return _0x1621e8(null,![],{'message':_0x911a('0x1c')});}else if(_0x1066af[_0x911a('0xf')]>0x0){if(_0x181ec0[_0x911a('0x1d')]){if(_0x1066af[_0x911a('0x10')]>0x0){if(moment(_0x181ec0['blockedAt'])['add'](_0x1066af[_0x911a('0x10')],_0x911a('0x1e'))>moment()){return _0x1621e8(null,![],{'message':_0x911a('0x1c')});}else{return utils['clearBlockUser'](_0x181ec0,_0x3959b6,![],null)[_0x911a('0x11')](function(){return _0x1621e8(null,![],{'message':_0x911a('0x1c')});});}}else{return _0x1621e8(null,![],{'message':_0x911a('0x1c')});}}else{if(_0x3959b6>=_0x1066af[_0x911a('0xf')]){return utils['clearBlockUser'](_0x181ec0,0x0,!![],moment())['then'](function(){return _0x1621e8(null,![],{'message':_0x911a('0x1c')});});}else{return utils[_0x911a('0x1f')](_0x181ec0,_0x3959b6,![],null)[_0x911a('0x11')](function(){return _0x1621e8(null,![],{'message':_0x911a('0x1c')});});}}}else{return _0x1621e8(null,![],{'message':_0x911a('0x1c')});}}else{if(_0x181ec0[_0x911a('0x15')]){return _0x1621e8(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x1066af[_0x911a('0xf')]>0x0){if(_0x181ec0[_0x911a('0x1d')]){if(_0x1066af['blockDuration']>0x0){if(moment(_0x181ec0[_0x911a('0x16')])['add'](_0x1066af[_0x911a('0x10')],_0x911a('0x1e'))>moment()){return _0x1621e8(null,![],{'message':_0x911a('0x1c')});}else{return utils[_0x911a('0x1f')](_0x181ec0,0x0,![],null)[_0x911a('0x11')](function(){return utils[_0x911a('0x20')](_0x181ec0);})['then'](function(){return _0x1621e8(null,_0x181ec0);});}}else{return _0x1621e8(null,![],{'message':_0x911a('0x1c')});}}else{return utils[_0x911a('0x1f')](_0x181ec0,0x0,![],null)[_0x911a('0x11')](function(){return utils[_0x911a('0x20')](_0x181ec0);})[_0x911a('0x11')](function(){return _0x1621e8(null,_0x181ec0);})['catch'](function(_0x1d172f){return _0x1621e8(null,![],_0x1d172f);});}}else{if(_0x181ec0[_0x911a('0x1d')]){return _0x1621e8(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0x911a('0x20')](_0x181ec0)[_0x911a('0x11')](function(){return _0x1621e8(null,_0x181ec0);});}}}});})['catch'](function(_0x41ff99){return _0x1621e8(null,![],_0x41ff99);});}function sendServiceMail(_0x4c36c5){return db[_0x911a('0x21')][_0x911a('0x22')]({'where':{'service':!![]},'attributes':['id',_0x911a('0x1a'),_0x911a('0x23')],'include':[{'model':db[_0x911a('0x24')],'as':_0x911a('0x25')}]})[_0x911a('0x11')](function(_0x166cb5){if(!_0x166cb5){throw new Error(_0x911a('0x26'));}var _0x4a407e={'tls':{'rejectUnauthorized':![]}};if(_0x166cb5['Smtp'][_0x911a('0x27')]){_0x4a407e[_0x911a('0x27')]=_0x166cb5[_0x911a('0x25')][_0x911a('0x27')];}else{_0x4a407e[_0x911a('0x28')]=_0x166cb5[_0x911a('0x25')][_0x911a('0x28')];_0x4a407e[_0x911a('0x29')]=_0x166cb5[_0x911a('0x25')]['port'];_0x4a407e['secure']=_0x166cb5[_0x911a('0x25')][_0x911a('0x2a')];}if(_0x166cb5['Smtp'][_0x911a('0x2b')]){_0x4a407e[_0x911a('0x2c')]={'user':_0x166cb5[_0x911a('0x25')]['user'],'pass':_0x166cb5[_0x911a('0x25')][_0x911a('0x2d')]};}var _0x585d23={'account':_0x4a407e,'message':_['merge']({'from':util['format'](_0x911a('0x2e'),_0x166cb5[_0x911a('0x1a')],_0x166cb5[_0x911a('0x23')]||_0x166cb5[_0x911a('0x25')][_0x911a('0x18')])},_0x4c36c5)};return client[_0x911a('0x2f')](_0x911a('0x30'),_0x585d23);})['then'](function(_0x13072c){if(_0x13072c['error']){throw new Error(util[_0x911a('0x31')](_0x911a('0x32'),_0x13072c[_0x911a('0x33')][_0x911a('0x34')]||JSON[_0x911a('0x35')](_0x13072c[_0x911a('0x33')])));}return!![];});}function handleError(_0x5e5003,_0x1187b3,_0x1ebe4b){return _0x5e5003[_0x911a('0x36')](_0x1187b3||0x1f4)[_0x911a('0x37')]({'message':_0x1ebe4b?_0x1ebe4b['message']||_0x1ebe4b:''});}exports[_0x911a('0x38')]=function(_0x4aff6d,_0x2a9c04,_0x2148ea){passport[_0x911a('0x1b')](_0x911a('0x39'),function(_0x4bcda9,_0x1dfa6b,_0x44b0a7){var _0x2a2793=_0x4bcda9||_0x44b0a7;if(_0x2a2793){return handleError(_0x2a9c04,0x191,_0x2a2793);}if(!_0x1dfa6b){return handleError(_0x2a9c04,0x194,{'message':_0x911a('0x3a')});}else{var _0x545e36={'payload':{'id':_0x1dfa6b['id'],'role':_0x1dfa6b['role']},'options':{'expiresIn':0x15180}};return authService[_0x911a('0x3b')](_0x545e36)[_0x911a('0x11')](function(_0x359cee){_0x2a9c04[_0x911a('0x3c')]({'id':_0x1dfa6b['id'],'token':_0x359cee,'statusCall':'','isAlreadyLogged':_0x1dfa6b[_0x911a('0x3d')]});});}})(_0x4aff6d,_0x2a9c04,_0x2148ea);};exports[_0x911a('0x3e')]=function(_0x3e78d3,_0x1845da,_0x579a10){if(!_0x3e78d3['body']['email']){return handleError(_0x1845da,0x1f4,{'message':'Email\x20parameter\x20is\x20missing'});}var _0x52d5e3=rs['generate']();_0x3e78d3[_0x911a('0x3f')][_0x911a('0x23')]=_0x3e78d3[_0x911a('0x3f')][_0x911a('0x23')][_0x911a('0x40')]()['toLowerCase']();var _0x335202;return db[_0x911a('0xd')][_0x911a('0xe')]({'where':{'id':0x1},'attributes':[_0x911a('0xf'),_0x911a('0x10')],'raw':!![]})[_0x911a('0x11')](function(_0x3a2dd0){_0x335202=_0x3a2dd0;return db[_0x911a('0x41')][_0x911a('0x22')]({'where':{'email':_0x3e78d3['body'][_0x911a('0x23')]}});})[_0x911a('0x11')](function(_0x535221){if(!_0x535221){throw new Error('This\x20email\x20is\x20not\x20registered.');}if(_0x535221[_0x911a('0x15')]){throw new Error('The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.');}if(_0x535221[_0x911a('0x1d')]){if(moment(_0x535221[_0x911a('0x16')])[_0x911a('0x42')](_0x335202[_0x911a('0x10')],_0x911a('0x1e'))>moment()){throw new Error(_0x911a('0x43'));}else{_0x535221[_0x911a('0x1d')]=![];_0x535221[_0x911a('0x16')]=null;}}_0x535221['resetPasswordToken']=_0x52d5e3;_0x535221[_0x911a('0x44')]=Date['now']()+0x36ee80;return _0x535221['save']();})[_0x911a('0x11')](function(){return sendServiceMail({'to':_0x3e78d3['body'][_0x911a('0x23')],'subject':_0x911a('0x45'),'text':'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'+_0x911a('0x46')+_0x3e78d3[_0x911a('0x47')][_0x911a('0x28')]+_0x911a('0x48')+_0x52d5e3+'\x0a\x0a'+_0x911a('0x49')});})[_0x911a('0x11')](function(){_0x1845da[_0x911a('0x36')](0xc8)[_0x911a('0x37')]({'message':_0x911a('0x4a')});})['catch'](function(_0x3e4bdd){return handleError(_0x1845da,0x1f4,_0x3e4bdd);});};exports[_0x911a('0x4b')]=function(_0x15a57a,_0x430284,_0xff586c){return db[_0x911a('0x41')][_0x911a('0x22')]({'where':{'resetPasswordToken':_0x15a57a[_0x911a('0x4c')][_0x911a('0x4d')],'resetPasswordExpires':{'$gt':Date['now']()}}})[_0x911a('0x11')](function(_0x3e0cb2){if(!_0x3e0cb2){throw new Error(_0x911a('0x4e'));}return db[_0x911a('0xd')]['findOne']({'attributes':['id',_0x911a('0x4f'),_0x911a('0x50'),'passwordHistoryLimit']})[_0x911a('0x11')](function(_0x1432ac){if(_0x1432ac['securePassword'])authService['validatePasswordPattern'](_0x15a57a[_0x911a('0x3f')][_0x911a('0x12')]);if(!_0x1432ac[_0x911a('0x50')]||!_0x3e0cb2['previousPasswords'])return _0x3e0cb2;authService[_0x911a('0x51')](_0x15a57a['body'][_0x911a('0x12')],_0x3e0cb2[_0x911a('0x52')],_0x1432ac[_0x911a('0x53')]);return _0x3e0cb2;})[_0x911a('0x11')](function(){_0x3e0cb2[_0x911a('0x12')]=_0x15a57a['body'][_0x911a('0x12')];_0x3e0cb2[_0x911a('0x54')]=null;_0x3e0cb2['resetPasswordExpires']=null;return _0x3e0cb2[_0x911a('0x55')]();});})['then'](function(){_0x430284[_0x911a('0x36')](0xc8)['send']({'message':_0x911a('0x56')});})[_0x911a('0x57')](function(_0x56a014){return handleError(_0x430284,0x1f4,_0x56a014);});};passport[_0x911a('0x58')](new LocalStrategy({'usernameField':_0x911a('0x1a'),'passwordField':_0x911a('0x12')},function(_0x479d28,_0x272d5c,_0x287402){return localAuthenticate(db[_0x911a('0x41')],_0x479d28,_0x272d5c,_0x287402);})); \ No newline at end of file diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js index 0a20ce9..cf035f9 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 _0x9ca4=['./authLocal.controller','post','login','/forgot','forgot','Router'];(function(_0x3054be,_0x1bdc8b){var _0x3df150=function(_0x56cfbf){while(--_0x56cfbf){_0x3054be['push'](_0x3054be['shift']());}};_0x3df150(++_0x1bdc8b);}(_0x9ca4,0x71));var _0x49ca=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9ca4[_0x3dd15e];return _0x231fd0;};'use strict';var express=require('express');var router=express[_0x49ca('0x0')]();var controller=require(_0x49ca('0x1'));router[_0x49ca('0x2')]('/',controller[_0x49ca('0x3')]);router[_0x49ca('0x2')](_0x49ca('0x4'),controller[_0x49ca('0x5')]);router['post']('/reset/:token',controller['reset']);module['exports']=router; \ No newline at end of file +var _0xc780=['exports','express','Router','./authLocal.controller','post','login','/forgot','forgot','reset'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc780,0x14e));var _0x0c78=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc780[_0x3dd15e];return _0x231fd0;};'use strict';var express=require(_0x0c78('0x0'));var router=express[_0x0c78('0x1')]();var controller=require(_0x0c78('0x2'));router[_0x0c78('0x3')]('/',controller[_0x0c78('0x4')]);router[_0x0c78('0x3')](_0x0c78('0x5'),controller[_0x0c78('0x6')]);router['post']('/reset/:token',controller[_0x0c78('0x7')]);module[_0x0c78('0x8')]=router; \ No newline at end of file diff --git a/server/api/automation/automation.attributes.js b/server/api/automation/automation.attributes.js index 99114be..ffd4c2c 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 _0x2605=['BOOLEAN','INTEGER','sequelize','exports','STRING'];(function(_0x4570a3,_0x4f8d6e){var _0x1ddbd3=function(_0xff53fd){while(--_0xff53fd){_0x4570a3['push'](_0x4570a3['shift']());}};_0x1ddbd3(++_0x4f8d6e);}(_0x2605,0x75));var _0x5260=function(_0x25b24a,_0x1c0163){_0x25b24a=_0x25b24a-0x0;var _0x224e68=_0x2605[_0x25b24a];return _0x224e68;};'use strict';var Sequelize=require(_0x5260('0x0'));module[_0x5260('0x1')]={'name':{'type':Sequelize[_0x5260('0x2')],'allowNull':![]},'channel':{'type':Sequelize[_0x5260('0x2')]},'description':{'type':Sequelize[_0x5260('0x2')]},'status':{'type':Sequelize[_0x5260('0x3')],'defaultValue':![]},'timeout':{'type':Sequelize[_0x5260('0x4')],'defaultValue':0xa}}; \ No newline at end of file +var _0xfc0c=['exports','STRING','BOOLEAN','INTEGER','sequelize'];(function(_0x53cb8b,_0x1074de){var _0x5a7658=function(_0xc3b5c9){while(--_0xc3b5c9){_0x53cb8b['push'](_0x53cb8b['shift']());}};_0x5a7658(++_0x1074de);}(_0xfc0c,0x68));var _0xcfc0=function(_0x167346,_0x1c1dfc){_0x167346=_0x167346-0x0;var _0x41d4af=_0xfc0c[_0x167346];return _0x41d4af;};'use strict';var Sequelize=require(_0xcfc0('0x0'));module[_0xcfc0('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'channel':{'type':Sequelize[_0xcfc0('0x2')]},'description':{'type':Sequelize['STRING']},'status':{'type':Sequelize[_0xcfc0('0x3')],'defaultValue':![]},'timeout':{'type':Sequelize[_0xcfc0('0x4')],'defaultValue':0xa}}; \ No newline at end of file diff --git a/server/api/automation/automation.controller.js b/server/api/automation/automation.controller.js index 47c4b5c..e57b09b 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 _0xf474=['moment','mustache','util','path','to-csv','fs-extra','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','stack','name','index','map','Automation','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','filter','where','VIRTUAL','merge','options','includeAll','findAll','rows','show','rawAttributes','find','catch','create','body','params','addConditions','ids','omit','getConditions','findOne','Condition','nolimit','addActions','Action','pick','getActions','eml-format','zip-dir','request-promise'];(function(_0x204a28,_0x359c57){var _0x2d8e3d=function(_0xbfd9b6){while(--_0xbfd9b6){_0x204a28['push'](_0x204a28['shift']());}};_0x2d8e3d(++_0x359c57);}(_0xf474,0x1e3));var _0x4f47=function(_0x5f309e,_0x66e31){_0x5f309e=_0x5f309e-0x0;var _0x487b5e=_0xf474[_0x5f309e];return _0x487b5e;};'use strict';var emlformat=require(_0x4f47('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4f47('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4f47('0x2'));var moment=require(_0x4f47('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x4f47('0x4'));var util=require(_0x4f47('0x5'));var path=require(_0x4f47('0x6'));var sox=require('sox');var csv=require(_0x4f47('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4f47('0x8'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x4f47('0x9'));var deskjs=require(_0x4f47('0xa'));var toCsv=require(_0x4f47('0x7'));var querystring=require('querystring');var Papa=require(_0x4f47('0xb'));var Redis=require(_0x4f47('0xc'));var authService=require(_0x4f47('0xd'));var qs=require(_0x4f47('0xe'));var as=require(_0x4f47('0xf'));var hardwareService=require(_0x4f47('0x10'));var logger=require(_0x4f47('0x11'))(_0x4f47('0x12'));var utils=require('../../config/utils');var config=require(_0x4f47('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x4f47('0x14'))['db'];function respondWithStatusCode(_0x428e45,_0x5bd21a){_0x5bd21a=_0x5bd21a||0xcc;return function(_0x134b90){if(_0x134b90){return _0x428e45[_0x4f47('0x15')](_0x5bd21a);}return _0x428e45[_0x4f47('0x16')](_0x5bd21a)['end']();};}function respondWithResult(_0x150db1,_0xecf9de){_0xecf9de=_0xecf9de||0xc8;return function(_0x2d8ef6){if(_0x2d8ef6){return _0x150db1[_0x4f47('0x16')](_0xecf9de)[_0x4f47('0x17')](_0x2d8ef6);}};}function respondWithFilteredResult(_0x29aec2,_0x427367){return function(_0x213e24){if(_0x213e24){var _0x70a382=typeof _0x427367[_0x4f47('0x18')]===_0x4f47('0x19')&&typeof _0x427367[_0x4f47('0x1a')]===_0x4f47('0x19');var _0x4f8cb8=_0x213e24[_0x4f47('0x1b')];var _0x52129b=_0x70a382?0x0:_0x427367[_0x4f47('0x18')];var _0x4db954=_0x70a382?_0x213e24[_0x4f47('0x1b')]:_0x427367[_0x4f47('0x18')]+_0x427367['limit'];var _0x3b4328;if(_0x4db954>=_0x4f8cb8){_0x4db954=_0x4f8cb8;_0x3b4328=0xc8;}else{_0x3b4328=0xce;}_0x29aec2['status'](_0x3b4328);return _0x29aec2[_0x4f47('0x1c')](_0x4f47('0x1d'),_0x52129b+'-'+_0x4db954+'/'+_0x4f8cb8)[_0x4f47('0x17')](_0x213e24);}return null;};}function patchUpdates(_0xbb357d){return function(_0x5f24b1){try{jsonpatch[_0x4f47('0x1e')](_0x5f24b1,_0xbb357d,!![]);}catch(_0xe19b57){return BPromise[_0x4f47('0x1f')](_0xe19b57);}return _0x5f24b1[_0x4f47('0x20')]();};}function saveUpdates(_0x28818f,_0x4279e4){return function(_0x16e5d5){if(_0x16e5d5){return _0x16e5d5[_0x4f47('0x21')](_0x28818f)['then'](function(_0x5a1146){return _0x5a1146;});}return null;};}function removeEntity(_0x966c67,_0x2c141d){return function(_0x4ed11b){if(_0x4ed11b){return _0x4ed11b[_0x4f47('0x22')]()[_0x4f47('0x23')](function(){_0x966c67['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x2736b0,_0x4caff3){return function(_0x2d08a3){if(!_0x2d08a3){_0x2736b0[_0x4f47('0x15')](0x194);}return _0x2d08a3;};}function handleError(_0x145a0b,_0x31f9e0){_0x31f9e0=_0x31f9e0||0x1f4;return function(_0x4d8ad4){logger['error'](_0x4d8ad4[_0x4f47('0x24')]);if(_0x4d8ad4[_0x4f47('0x25')]){delete _0x4d8ad4[_0x4f47('0x25')];}_0x145a0b[_0x4f47('0x16')](_0x31f9e0)['send'](_0x4d8ad4);};}exports[_0x4f47('0x26')]=function(_0x592c56,_0x3a7632){var _0x2f78e2={},_0x2ccb9a={},_0x4f12ba={'count':0x0,'rows':[]};var _0xe13ffb=_[_0x4f47('0x27')](db[_0x4f47('0x28')]['rawAttributes'],function(_0x295eeb){return{'name':_0x295eeb[_0x4f47('0x29')],'type':_0x295eeb[_0x4f47('0x2a')][_0x4f47('0x2b')]};});_0x2ccb9a[_0x4f47('0x2c')]=_[_0x4f47('0x27')](_0xe13ffb,_0x4f47('0x25'));_0x2ccb9a[_0x4f47('0x2d')]=_[_0x4f47('0x2e')](_0x592c56[_0x4f47('0x2d')]);_0x2ccb9a[_0x4f47('0x2f')]=_[_0x4f47('0x30')](_0x2ccb9a['model'],_0x2ccb9a[_0x4f47('0x2d')]);_0x2f78e2['attributes']=_['intersection'](_0x2ccb9a[_0x4f47('0x2c')],qs['fields'](_0x592c56[_0x4f47('0x2d')][_0x4f47('0x31')]));_0x2f78e2[_0x4f47('0x32')]=_0x2f78e2['attributes'][_0x4f47('0x33')]?_0x2f78e2[_0x4f47('0x32')]:_0x2ccb9a[_0x4f47('0x2c')];if(!_0x592c56[_0x4f47('0x2d')][_0x4f47('0x34')]('nolimit')){_0x2f78e2[_0x4f47('0x1a')]=qs['limit'](_0x592c56[_0x4f47('0x2d')][_0x4f47('0x1a')]);_0x2f78e2[_0x4f47('0x18')]=qs['offset'](_0x592c56['query'][_0x4f47('0x18')]);}_0x2f78e2[_0x4f47('0x35')]=qs[_0x4f47('0x36')](_0x592c56[_0x4f47('0x2d')][_0x4f47('0x36')]);_0x2f78e2['where']=qs[_0x4f47('0x2f')](_['pick'](_0x592c56[_0x4f47('0x2d')],_0x2ccb9a[_0x4f47('0x2f')]),_0xe13ffb);if(_0x592c56[_0x4f47('0x2d')][_0x4f47('0x37')]){_0x2f78e2['where']=_['merge'](_0x2f78e2[_0x4f47('0x38')],{'$or':_[_0x4f47('0x27')](_0xe13ffb,function(_0x261b28){if(_0x261b28['type']!==_0x4f47('0x39')){var _0x1812f5={};_0x1812f5[_0x261b28[_0x4f47('0x25')]]={'$like':'%'+_0x592c56[_0x4f47('0x2d')][_0x4f47('0x37')]+'%'};return _0x1812f5;}})});}_0x2f78e2=_[_0x4f47('0x3a')]({},_0x2f78e2,_0x592c56[_0x4f47('0x3b')]);var _0x3a0a6a={'where':_0x2f78e2[_0x4f47('0x38')]};return db[_0x4f47('0x28')][_0x4f47('0x1b')](_0x3a0a6a)[_0x4f47('0x23')](function(_0x5729c){_0x4f12ba[_0x4f47('0x1b')]=_0x5729c;if(_0x592c56['query'][_0x4f47('0x3c')]){_0x2f78e2['include']=[{'all':!![]}];}return db['Automation'][_0x4f47('0x3d')](_0x2f78e2);})[_0x4f47('0x23')](function(_0xc2502b){_0x4f12ba[_0x4f47('0x3e')]=_0xc2502b;return _0x4f12ba;})[_0x4f47('0x23')](respondWithFilteredResult(_0x3a7632,_0x2f78e2))['catch'](handleError(_0x3a7632,null));};exports[_0x4f47('0x3f')]=function(_0x3eb7c9,_0x6b6be6){var _0x322046={'raw':![],'where':{'id':_0x3eb7c9['params']['id']}},_0x21ab66={};_0x21ab66[_0x4f47('0x2c')]=_[_0x4f47('0x2e')](db[_0x4f47('0x28')][_0x4f47('0x40')]);_0x21ab66[_0x4f47('0x2d')]=_['keys'](_0x3eb7c9[_0x4f47('0x2d')]);_0x21ab66[_0x4f47('0x2f')]=_['intersection'](_0x21ab66['model'],_0x21ab66[_0x4f47('0x2d')]);_0x322046['attributes']=_['intersection'](_0x21ab66[_0x4f47('0x2c')],qs[_0x4f47('0x31')](_0x3eb7c9[_0x4f47('0x2d')]['fields']));_0x322046[_0x4f47('0x32')]=_0x322046[_0x4f47('0x32')][_0x4f47('0x33')]?_0x322046[_0x4f47('0x32')]:_0x21ab66[_0x4f47('0x2c')];if(_0x3eb7c9[_0x4f47('0x2d')][_0x4f47('0x3c')]){_0x322046['include']=[{'all':!![]}];}_0x322046=_['merge']({},_0x322046,_0x3eb7c9['options']);return db['Automation'][_0x4f47('0x41')](_0x322046)['then'](handleEntityNotFound(_0x6b6be6,null))[_0x4f47('0x23')](respondWithResult(_0x6b6be6,null))[_0x4f47('0x42')](handleError(_0x6b6be6,null));};exports[_0x4f47('0x43')]=function(_0x59e7cd,_0x3647b3){return db[_0x4f47('0x28')][_0x4f47('0x43')](_0x59e7cd['body'],{})['then'](respondWithResult(_0x3647b3,0xc9))[_0x4f47('0x42')](handleError(_0x3647b3,null));};exports['update']=function(_0x44798e,_0x4b583f){if(_0x44798e[_0x4f47('0x44')]['id']){delete _0x44798e[_0x4f47('0x44')]['id'];}return db[_0x4f47('0x28')][_0x4f47('0x41')]({'where':{'id':_0x44798e[_0x4f47('0x45')]['id']}})['then'](handleEntityNotFound(_0x4b583f,null))['then'](saveUpdates(_0x44798e[_0x4f47('0x44')],null))[_0x4f47('0x23')](respondWithResult(_0x4b583f,null))[_0x4f47('0x42')](handleError(_0x4b583f,null));};exports['destroy']=function(_0x455ac6,_0x1528bf){return db['Automation'][_0x4f47('0x41')]({'where':{'id':_0x455ac6[_0x4f47('0x45')]['id']}})['then'](handleEntityNotFound(_0x1528bf,null))['then'](removeEntity(_0x1528bf,null))[_0x4f47('0x42')](handleError(_0x1528bf,null));};exports[_0x4f47('0x46')]=function(_0x28b387,_0x58e265,_0x2e29c7){return db['Condition'][_0x4f47('0x41')]({'where':{'id':_0x28b387[_0x4f47('0x45')]['id']}})[_0x4f47('0x23')](handleEntityNotFound(_0x58e265,null))[_0x4f47('0x23')](function(_0x4d14c8){if(_0x4d14c8){return _0x4d14c8['addConditions'](_0x28b387[_0x4f47('0x44')][_0x4f47('0x47')],_[_0x4f47('0x48')](_0x28b387[_0x4f47('0x44')],[_0x4f47('0x47'),'id'])||{});}})[_0x4f47('0x23')](respondWithResult(_0x58e265,null))[_0x4f47('0x42')](handleError(_0x58e265,null));};exports[_0x4f47('0x49')]=function(_0xa5f3d,_0x34643f,_0x22a919){var _0x114e83={};var _0x243b5c={};var _0x1ade75;var _0xa2b0ce;return db[_0x4f47('0x28')][_0x4f47('0x4a')]({'where':{'id':_0xa5f3d[_0x4f47('0x45')]['id']}})[_0x4f47('0x23')](handleEntityNotFound(_0x34643f,null))['then'](function(_0x25856b){if(_0x25856b){_0x1ade75=_0x25856b;_0x243b5c['model']=_[_0x4f47('0x2e')](db[_0x4f47('0x4b')][_0x4f47('0x40')]);_0x243b5c[_0x4f47('0x2d')]=_[_0x4f47('0x2e')](_0xa5f3d[_0x4f47('0x2d')]);_0x243b5c[_0x4f47('0x2f')]=_['intersection'](_0x243b5c[_0x4f47('0x2c')],_0x243b5c[_0x4f47('0x2d')]);_0x114e83[_0x4f47('0x32')]=_[_0x4f47('0x30')](_0x243b5c[_0x4f47('0x2c')],qs[_0x4f47('0x31')](_0xa5f3d[_0x4f47('0x2d')][_0x4f47('0x31')]));_0x114e83[_0x4f47('0x32')]=_0x114e83['attributes'][_0x4f47('0x33')]?_0x114e83[_0x4f47('0x32')]:_0x243b5c[_0x4f47('0x2c')];_0x114e83[_0x4f47('0x35')]=qs[_0x4f47('0x36')](_0xa5f3d[_0x4f47('0x2d')][_0x4f47('0x36')]);_0x114e83[_0x4f47('0x38')]=qs[_0x4f47('0x2f')](_['pick'](_0xa5f3d['query'],_0x243b5c[_0x4f47('0x2f')]));if(_0xa5f3d[_0x4f47('0x2d')][_0x4f47('0x37')]){_0x114e83[_0x4f47('0x38')]=_[_0x4f47('0x3a')](_0x114e83[_0x4f47('0x38')],{'$or':_[_0x4f47('0x27')](_0x114e83[_0x4f47('0x32')],function(_0x3cad35){var _0x50d4e4={};_0x50d4e4[_0x3cad35]={'$like':'%'+_0xa5f3d[_0x4f47('0x2d')][_0x4f47('0x37')]+'%'};return _0x50d4e4;})});}_0x114e83=_['merge']({},_0x114e83,_0xa5f3d[_0x4f47('0x3b')]);return _0x1ade75['getConditions'](_0x114e83);}})[_0x4f47('0x23')](function(_0x287e5c){if(_0x287e5c){_0xa2b0ce=_0x287e5c[_0x4f47('0x33')];if(!_0xa5f3d[_0x4f47('0x2d')][_0x4f47('0x34')](_0x4f47('0x4c'))){_0x114e83[_0x4f47('0x1a')]=qs[_0x4f47('0x1a')](_0xa5f3d['query']['limit']);_0x114e83[_0x4f47('0x18')]=qs[_0x4f47('0x18')](_0xa5f3d[_0x4f47('0x2d')][_0x4f47('0x18')]);}return _0x1ade75[_0x4f47('0x49')](_0x114e83);}})[_0x4f47('0x23')](function(_0x170cbe){if(_0x170cbe){return _0x170cbe?{'count':_0xa2b0ce,'rows':_0x170cbe}:null;}})['then'](respondWithResult(_0x34643f,null))[_0x4f47('0x42')](handleError(_0x34643f,null));};exports[_0x4f47('0x4d')]=function(_0x11739e,_0x1c2c38,_0x20d445){return db[_0x4f47('0x4e')][_0x4f47('0x41')]({'where':{'id':_0x11739e[_0x4f47('0x45')]['id']}})[_0x4f47('0x23')](handleEntityNotFound(_0x1c2c38,null))[_0x4f47('0x23')](function(_0x5e6bb2){if(_0x5e6bb2){return _0x5e6bb2['addActions'](_0x11739e['body']['ids'],_['omit'](_0x11739e[_0x4f47('0x44')],[_0x4f47('0x47'),'id'])||{});}})[_0x4f47('0x23')](respondWithResult(_0x1c2c38,null))['catch'](handleError(_0x1c2c38,null));};exports['getActions']=function(_0xb56137,_0x58cca3,_0x52c1e9){var _0x2a7f0d={};var _0x596c12={};var _0x38b6dc;var _0x2fd577;return db[_0x4f47('0x28')][_0x4f47('0x4a')]({'where':{'id':_0xb56137[_0x4f47('0x45')]['id']}})[_0x4f47('0x23')](handleEntityNotFound(_0x58cca3,null))['then'](function(_0x2a5c73){if(_0x2a5c73){_0x38b6dc=_0x2a5c73;_0x596c12[_0x4f47('0x2c')]=_[_0x4f47('0x2e')](db[_0x4f47('0x4e')][_0x4f47('0x40')]);_0x596c12[_0x4f47('0x2d')]=_[_0x4f47('0x2e')](_0xb56137[_0x4f47('0x2d')]);_0x596c12[_0x4f47('0x2f')]=_[_0x4f47('0x30')](_0x596c12['model'],_0x596c12[_0x4f47('0x2d')]);_0x2a7f0d[_0x4f47('0x32')]=_['intersection'](_0x596c12[_0x4f47('0x2c')],qs[_0x4f47('0x31')](_0xb56137[_0x4f47('0x2d')][_0x4f47('0x31')]));_0x2a7f0d[_0x4f47('0x32')]=_0x2a7f0d['attributes'][_0x4f47('0x33')]?_0x2a7f0d[_0x4f47('0x32')]:_0x596c12[_0x4f47('0x2c')];_0x2a7f0d[_0x4f47('0x35')]=qs[_0x4f47('0x36')](_0xb56137[_0x4f47('0x2d')][_0x4f47('0x36')]);_0x2a7f0d['where']=qs[_0x4f47('0x2f')](_[_0x4f47('0x4f')](_0xb56137[_0x4f47('0x2d')],_0x596c12[_0x4f47('0x2f')]));if(_0xb56137['query'][_0x4f47('0x37')]){_0x2a7f0d['where']=_[_0x4f47('0x3a')](_0x2a7f0d[_0x4f47('0x38')],{'$or':_[_0x4f47('0x27')](_0x2a7f0d[_0x4f47('0x32')],function(_0x21c736){var _0x29f923={};_0x29f923[_0x21c736]={'$like':'%'+_0xb56137['query']['filter']+'%'};return _0x29f923;})});}_0x2a7f0d=_[_0x4f47('0x3a')]({},_0x2a7f0d,_0xb56137[_0x4f47('0x3b')]);return _0x38b6dc[_0x4f47('0x50')](_0x2a7f0d);}})[_0x4f47('0x23')](function(_0x11c731){if(_0x11c731){_0x2fd577=_0x11c731[_0x4f47('0x33')];if(!_0xb56137[_0x4f47('0x2d')]['hasOwnProperty'](_0x4f47('0x4c'))){_0x2a7f0d[_0x4f47('0x1a')]=qs[_0x4f47('0x1a')](_0xb56137[_0x4f47('0x2d')]['limit']);_0x2a7f0d[_0x4f47('0x18')]=qs['offset'](_0xb56137[_0x4f47('0x2d')][_0x4f47('0x18')]);}return _0x38b6dc['getActions'](_0x2a7f0d);}})[_0x4f47('0x23')](function(_0x88b343){if(_0x88b343){return _0x88b343?{'count':_0x2fd577,'rows':_0x88b343}:null;}})[_0x4f47('0x23')](respondWithResult(_0x58cca3,null))[_0x4f47('0x42')](handleError(_0x58cca3,null));}; \ No newline at end of file +var _0x980a=['Content-Range','json','reject','save','then','destroy','stack','name','send','map','Automation','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','catch','keys','rawAttributes','include','find','create','body','update','addConditions','params','ids','omit','getConditions','findOne','Condition','addActions','getActions','Action','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','ejs','fs-extra','squel','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x980a,0xd7));var _0xa980=function(_0x2fc4b4,_0x303983){_0x2fc4b4=_0x2fc4b4-0x0;var _0x4b6b70=_0x980a[_0x2fc4b4];return _0x4b6b70;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa980('0x0'));var zipdir=require(_0xa980('0x1'));var jsonpatch=require(_0xa980('0x2'));var rp=require(_0xa980('0x3'));var moment=require('moment');var BPromise=require(_0xa980('0x4'));var Mustache=require('mustache');var util=require(_0xa980('0x5'));var path=require(_0xa980('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xa980('0x7'));var fs=require('fs');var fs_extra=require(_0xa980('0x8'));var _=require('lodash');var squel=require(_0xa980('0x9'));var crypto=require('crypto');var jsforce=require(_0xa980('0xa'));var deskjs=require(_0xa980('0xb'));var toCsv=require(_0xa980('0xc'));var querystring=require(_0xa980('0xd'));var Papa=require('papaparse');var Redis=require(_0xa980('0xe'));var authService=require(_0xa980('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xa980('0x10'));var hardwareService=require(_0xa980('0x11'));var logger=require(_0xa980('0x12'))('api');var utils=require(_0xa980('0x13'));var config=require(_0xa980('0x14'));var licenseUtil=require(_0xa980('0x15'));var db=require(_0xa980('0x16'))['db'];function respondWithStatusCode(_0x4699d9,_0xd1becc){_0xd1becc=_0xd1becc||0xcc;return function(_0x3b710c){if(_0x3b710c){return _0x4699d9[_0xa980('0x17')](_0xd1becc);}return _0x4699d9[_0xa980('0x18')](_0xd1becc)[_0xa980('0x19')]();};}function respondWithResult(_0x5f3e4e,_0x1e6e81){_0x1e6e81=_0x1e6e81||0xc8;return function(_0x1503c0){if(_0x1503c0){return _0x5f3e4e[_0xa980('0x18')](_0x1e6e81)['json'](_0x1503c0);}};}function respondWithFilteredResult(_0x323a9a,_0x47a810){return function(_0x1b1a39){if(_0x1b1a39){var _0x2a65a1=typeof _0x47a810[_0xa980('0x1a')]===_0xa980('0x1b')&&typeof _0x47a810[_0xa980('0x1c')]===_0xa980('0x1b');var _0x406a1e=_0x1b1a39['count'];var _0x5cb149=_0x2a65a1?0x0:_0x47a810[_0xa980('0x1a')];var _0x22d131=_0x2a65a1?_0x1b1a39[_0xa980('0x1d')]:_0x47a810['offset']+_0x47a810['limit'];var _0x4e2158;if(_0x22d131>=_0x406a1e){_0x22d131=_0x406a1e;_0x4e2158=0xc8;}else{_0x4e2158=0xce;}_0x323a9a[_0xa980('0x18')](_0x4e2158);return _0x323a9a[_0xa980('0x1e')](_0xa980('0x1f'),_0x5cb149+'-'+_0x22d131+'/'+_0x406a1e)[_0xa980('0x20')](_0x1b1a39);}return null;};}function patchUpdates(_0x31ddef){return function(_0x27272f){try{jsonpatch['apply'](_0x27272f,_0x31ddef,!![]);}catch(_0x255e0b){return BPromise[_0xa980('0x21')](_0x255e0b);}return _0x27272f[_0xa980('0x22')]();};}function saveUpdates(_0x3c4e45,_0x1793f0){return function(_0x1af85e){if(_0x1af85e){return _0x1af85e['update'](_0x3c4e45)[_0xa980('0x23')](function(_0x771039){return _0x771039;});}return null;};}function removeEntity(_0x532c63,_0x1ed7f8){return function(_0x15d80e){if(_0x15d80e){return _0x15d80e[_0xa980('0x24')]()['then'](function(){_0x532c63['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x287d3f,_0x13779f){return function(_0x2c57aa){if(!_0x2c57aa){_0x287d3f[_0xa980('0x17')](0x194);}return _0x2c57aa;};}function handleError(_0x25ba2a,_0x5817ee){_0x5817ee=_0x5817ee||0x1f4;return function(_0x4dac77){logger['error'](_0x4dac77[_0xa980('0x25')]);if(_0x4dac77[_0xa980('0x26')]){delete _0x4dac77['name'];}_0x25ba2a[_0xa980('0x18')](_0x5817ee)[_0xa980('0x27')](_0x4dac77);};}exports['index']=function(_0x1fe0ea,_0x513b58){var _0x2374c4={},_0x4d6f9b={},_0x5a7119={'count':0x0,'rows':[]};var _0x410ddd=_[_0xa980('0x28')](db[_0xa980('0x29')]['rawAttributes'],function(_0x5750d9){return{'name':_0x5750d9[_0xa980('0x2a')],'type':_0x5750d9[_0xa980('0x2b')][_0xa980('0x2c')]};});_0x4d6f9b[_0xa980('0x2d')]=_[_0xa980('0x28')](_0x410ddd,_0xa980('0x26'));_0x4d6f9b[_0xa980('0x2e')]=_['keys'](_0x1fe0ea[_0xa980('0x2e')]);_0x4d6f9b[_0xa980('0x2f')]=_[_0xa980('0x30')](_0x4d6f9b[_0xa980('0x2d')],_0x4d6f9b[_0xa980('0x2e')]);_0x2374c4[_0xa980('0x31')]=_['intersection'](_0x4d6f9b[_0xa980('0x2d')],qs[_0xa980('0x32')](_0x1fe0ea['query']['fields']));_0x2374c4['attributes']=_0x2374c4[_0xa980('0x31')][_0xa980('0x33')]?_0x2374c4[_0xa980('0x31')]:_0x4d6f9b['model'];if(!_0x1fe0ea['query'][_0xa980('0x34')](_0xa980('0x35'))){_0x2374c4['limit']=qs[_0xa980('0x1c')](_0x1fe0ea[_0xa980('0x2e')]['limit']);_0x2374c4['offset']=qs[_0xa980('0x1a')](_0x1fe0ea[_0xa980('0x2e')][_0xa980('0x1a')]);}_0x2374c4[_0xa980('0x36')]=qs[_0xa980('0x37')](_0x1fe0ea[_0xa980('0x2e')][_0xa980('0x37')]);_0x2374c4[_0xa980('0x38')]=qs['filters'](_[_0xa980('0x39')](_0x1fe0ea[_0xa980('0x2e')],_0x4d6f9b[_0xa980('0x2f')]),_0x410ddd);if(_0x1fe0ea[_0xa980('0x2e')][_0xa980('0x3a')]){_0x2374c4[_0xa980('0x38')]=_[_0xa980('0x3b')](_0x2374c4[_0xa980('0x38')],{'$or':_['map'](_0x410ddd,function(_0x4d8de6){if(_0x4d8de6[_0xa980('0x2b')]!==_0xa980('0x3c')){var _0x499af1={};_0x499af1[_0x4d8de6['name']]={'$like':'%'+_0x1fe0ea[_0xa980('0x2e')]['filter']+'%'};return _0x499af1;}})});}_0x2374c4=_[_0xa980('0x3b')]({},_0x2374c4,_0x1fe0ea[_0xa980('0x3d')]);var _0x54d2da={'where':_0x2374c4[_0xa980('0x38')]};return db[_0xa980('0x29')][_0xa980('0x1d')](_0x54d2da)[_0xa980('0x23')](function(_0x383f3e){_0x5a7119[_0xa980('0x1d')]=_0x383f3e;if(_0x1fe0ea['query'][_0xa980('0x3e')]){_0x2374c4['include']=[{'all':!![]}];}return db[_0xa980('0x29')][_0xa980('0x3f')](_0x2374c4);})[_0xa980('0x23')](function(_0x56290f){_0x5a7119['rows']=_0x56290f;return _0x5a7119;})[_0xa980('0x23')](respondWithFilteredResult(_0x513b58,_0x2374c4))[_0xa980('0x40')](handleError(_0x513b58,null));};exports['show']=function(_0x2a053d,_0xe3f47a){var _0x15496a={'raw':![],'where':{'id':_0x2a053d['params']['id']}},_0x2763d3={};_0x2763d3[_0xa980('0x2d')]=_[_0xa980('0x41')](db[_0xa980('0x29')][_0xa980('0x42')]);_0x2763d3[_0xa980('0x2e')]=_[_0xa980('0x41')](_0x2a053d[_0xa980('0x2e')]);_0x2763d3[_0xa980('0x2f')]=_[_0xa980('0x30')](_0x2763d3[_0xa980('0x2d')],_0x2763d3[_0xa980('0x2e')]);_0x15496a['attributes']=_[_0xa980('0x30')](_0x2763d3[_0xa980('0x2d')],qs[_0xa980('0x32')](_0x2a053d['query'][_0xa980('0x32')]));_0x15496a[_0xa980('0x31')]=_0x15496a[_0xa980('0x31')]['length']?_0x15496a[_0xa980('0x31')]:_0x2763d3[_0xa980('0x2d')];if(_0x2a053d[_0xa980('0x2e')][_0xa980('0x3e')]){_0x15496a[_0xa980('0x43')]=[{'all':!![]}];}_0x15496a=_[_0xa980('0x3b')]({},_0x15496a,_0x2a053d[_0xa980('0x3d')]);return db[_0xa980('0x29')][_0xa980('0x44')](_0x15496a)[_0xa980('0x23')](handleEntityNotFound(_0xe3f47a,null))[_0xa980('0x23')](respondWithResult(_0xe3f47a,null))[_0xa980('0x40')](handleError(_0xe3f47a,null));};exports[_0xa980('0x45')]=function(_0x5425cd,_0x131838){return db['Automation']['create'](_0x5425cd[_0xa980('0x46')],{})[_0xa980('0x23')](respondWithResult(_0x131838,0xc9))[_0xa980('0x40')](handleError(_0x131838,null));};exports[_0xa980('0x47')]=function(_0x4a9d3d,_0x18c762){if(_0x4a9d3d[_0xa980('0x46')]['id']){delete _0x4a9d3d['body']['id'];}return db['Automation'][_0xa980('0x44')]({'where':{'id':_0x4a9d3d['params']['id']}})[_0xa980('0x23')](handleEntityNotFound(_0x18c762,null))[_0xa980('0x23')](saveUpdates(_0x4a9d3d['body'],null))[_0xa980('0x23')](respondWithResult(_0x18c762,null))[_0xa980('0x40')](handleError(_0x18c762,null));};exports['destroy']=function(_0x4f4c87,_0x30cff1){return db[_0xa980('0x29')][_0xa980('0x44')]({'where':{'id':_0x4f4c87['params']['id']}})['then'](handleEntityNotFound(_0x30cff1,null))[_0xa980('0x23')](removeEntity(_0x30cff1,null))['catch'](handleError(_0x30cff1,null));};exports[_0xa980('0x48')]=function(_0x197134,_0x1580f4,_0x3cc0f6){return db['Condition'][_0xa980('0x44')]({'where':{'id':_0x197134[_0xa980('0x49')]['id']}})[_0xa980('0x23')](handleEntityNotFound(_0x1580f4,null))['then'](function(_0x11378c){if(_0x11378c){return _0x11378c[_0xa980('0x48')](_0x197134['body'][_0xa980('0x4a')],_[_0xa980('0x4b')](_0x197134[_0xa980('0x46')],[_0xa980('0x4a'),'id'])||{});}})[_0xa980('0x23')](respondWithResult(_0x1580f4,null))['catch'](handleError(_0x1580f4,null));};exports[_0xa980('0x4c')]=function(_0x30666a,_0x4d11dd,_0x8daf7f){var _0x48aa93={};var _0x551414={};var _0x14d15e;var _0xa14ed6;return db[_0xa980('0x29')][_0xa980('0x4d')]({'where':{'id':_0x30666a[_0xa980('0x49')]['id']}})['then'](handleEntityNotFound(_0x4d11dd,null))[_0xa980('0x23')](function(_0x2b01d0){if(_0x2b01d0){_0x14d15e=_0x2b01d0;_0x551414['model']=_['keys'](db[_0xa980('0x4e')][_0xa980('0x42')]);_0x551414[_0xa980('0x2e')]=_['keys'](_0x30666a[_0xa980('0x2e')]);_0x551414[_0xa980('0x2f')]=_[_0xa980('0x30')](_0x551414[_0xa980('0x2d')],_0x551414[_0xa980('0x2e')]);_0x48aa93[_0xa980('0x31')]=_[_0xa980('0x30')](_0x551414[_0xa980('0x2d')],qs[_0xa980('0x32')](_0x30666a[_0xa980('0x2e')][_0xa980('0x32')]));_0x48aa93['attributes']=_0x48aa93[_0xa980('0x31')][_0xa980('0x33')]?_0x48aa93[_0xa980('0x31')]:_0x551414[_0xa980('0x2d')];_0x48aa93[_0xa980('0x36')]=qs[_0xa980('0x37')](_0x30666a[_0xa980('0x2e')][_0xa980('0x37')]);_0x48aa93[_0xa980('0x38')]=qs[_0xa980('0x2f')](_[_0xa980('0x39')](_0x30666a[_0xa980('0x2e')],_0x551414['filters']));if(_0x30666a[_0xa980('0x2e')]['filter']){_0x48aa93[_0xa980('0x38')]=_[_0xa980('0x3b')](_0x48aa93[_0xa980('0x38')],{'$or':_[_0xa980('0x28')](_0x48aa93[_0xa980('0x31')],function(_0x25095f){var _0x50600b={};_0x50600b[_0x25095f]={'$like':'%'+_0x30666a[_0xa980('0x2e')][_0xa980('0x3a')]+'%'};return _0x50600b;})});}_0x48aa93=_[_0xa980('0x3b')]({},_0x48aa93,_0x30666a[_0xa980('0x3d')]);return _0x14d15e[_0xa980('0x4c')](_0x48aa93);}})[_0xa980('0x23')](function(_0x30e236){if(_0x30e236){_0xa14ed6=_0x30e236[_0xa980('0x33')];if(!_0x30666a[_0xa980('0x2e')][_0xa980('0x34')](_0xa980('0x35'))){_0x48aa93[_0xa980('0x1c')]=qs[_0xa980('0x1c')](_0x30666a['query'][_0xa980('0x1c')]);_0x48aa93[_0xa980('0x1a')]=qs[_0xa980('0x1a')](_0x30666a[_0xa980('0x2e')][_0xa980('0x1a')]);}return _0x14d15e[_0xa980('0x4c')](_0x48aa93);}})['then'](function(_0x2cb937){if(_0x2cb937){return _0x2cb937?{'count':_0xa14ed6,'rows':_0x2cb937}:null;}})[_0xa980('0x23')](respondWithResult(_0x4d11dd,null))[_0xa980('0x40')](handleError(_0x4d11dd,null));};exports[_0xa980('0x4f')]=function(_0x5bb585,_0x277df5,_0x457e9b){return db['Action'][_0xa980('0x44')]({'where':{'id':_0x5bb585[_0xa980('0x49')]['id']}})['then'](handleEntityNotFound(_0x277df5,null))[_0xa980('0x23')](function(_0x1e3ed3){if(_0x1e3ed3){return _0x1e3ed3[_0xa980('0x4f')](_0x5bb585[_0xa980('0x46')][_0xa980('0x4a')],_[_0xa980('0x4b')](_0x5bb585['body'],['ids','id'])||{});}})['then'](respondWithResult(_0x277df5,null))[_0xa980('0x40')](handleError(_0x277df5,null));};exports[_0xa980('0x50')]=function(_0x511999,_0x1f947f,_0x31d309){var _0x2954a8={};var _0x313472={};var _0xc0fb88;var _0x35a4d0;return db[_0xa980('0x29')][_0xa980('0x4d')]({'where':{'id':_0x511999['params']['id']}})[_0xa980('0x23')](handleEntityNotFound(_0x1f947f,null))[_0xa980('0x23')](function(_0x279040){if(_0x279040){_0xc0fb88=_0x279040;_0x313472[_0xa980('0x2d')]=_['keys'](db[_0xa980('0x51')][_0xa980('0x42')]);_0x313472['query']=_[_0xa980('0x41')](_0x511999[_0xa980('0x2e')]);_0x313472[_0xa980('0x2f')]=_[_0xa980('0x30')](_0x313472[_0xa980('0x2d')],_0x313472['query']);_0x2954a8[_0xa980('0x31')]=_['intersection'](_0x313472[_0xa980('0x2d')],qs[_0xa980('0x32')](_0x511999[_0xa980('0x2e')][_0xa980('0x32')]));_0x2954a8[_0xa980('0x31')]=_0x2954a8[_0xa980('0x31')][_0xa980('0x33')]?_0x2954a8['attributes']:_0x313472[_0xa980('0x2d')];_0x2954a8[_0xa980('0x36')]=qs[_0xa980('0x37')](_0x511999[_0xa980('0x2e')][_0xa980('0x37')]);_0x2954a8[_0xa980('0x38')]=qs[_0xa980('0x2f')](_[_0xa980('0x39')](_0x511999[_0xa980('0x2e')],_0x313472[_0xa980('0x2f')]));if(_0x511999['query']['filter']){_0x2954a8[_0xa980('0x38')]=_[_0xa980('0x3b')](_0x2954a8[_0xa980('0x38')],{'$or':_[_0xa980('0x28')](_0x2954a8[_0xa980('0x31')],function(_0x4894fc){var _0x1327dd={};_0x1327dd[_0x4894fc]={'$like':'%'+_0x511999[_0xa980('0x2e')][_0xa980('0x3a')]+'%'};return _0x1327dd;})});}_0x2954a8=_[_0xa980('0x3b')]({},_0x2954a8,_0x511999[_0xa980('0x3d')]);return _0xc0fb88[_0xa980('0x50')](_0x2954a8);}})[_0xa980('0x23')](function(_0x216d6f){if(_0x216d6f){_0x35a4d0=_0x216d6f[_0xa980('0x33')];if(!_0x511999[_0xa980('0x2e')][_0xa980('0x34')](_0xa980('0x35'))){_0x2954a8[_0xa980('0x1c')]=qs[_0xa980('0x1c')](_0x511999['query'][_0xa980('0x1c')]);_0x2954a8[_0xa980('0x1a')]=qs[_0xa980('0x1a')](_0x511999[_0xa980('0x2e')][_0xa980('0x1a')]);}return _0xc0fb88['getActions'](_0x2954a8);}})[_0xa980('0x23')](function(_0x13d41a){if(_0x13d41a){return _0x13d41a?{'count':_0x35a4d0,'rows':_0x13d41a}:null;}})['then'](respondWithResult(_0x1f947f,null))[_0xa980('0x40')](handleError(_0x1f947f,null));}; \ No newline at end of file diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js index 9290a07..ffec7d1 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 _0xe9ac=['../../config/environment','./automation.attributes','exports','Automation','tools_automations','lodash','util','../../config/logger','api','request-promise','path','rimraf'];(function(_0x47fb54,_0x28698c){var _0x1139a7=function(_0x17c781){while(--_0x17c781){_0x47fb54['push'](_0x47fb54['shift']());}};_0x1139a7(++_0x28698c);}(_0xe9ac,0x179));var _0xce9a=function(_0x50a692,_0x500525){_0x50a692=_0x50a692-0x0;var _0x1157fe=_0xe9ac[_0x50a692];return _0x1157fe;};'use strict';var _=require(_0xce9a('0x0'));var util=require(_0xce9a('0x1'));var logger=require(_0xce9a('0x2'))(_0xce9a('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xce9a('0x4'));var fs=require('fs');var path=require(_0xce9a('0x5'));var rimraf=require(_0xce9a('0x6'));var config=require(_0xce9a('0x7'));var attributes=require(_0xce9a('0x8'));module[_0xce9a('0x9')]=function(_0x131ba9,_0x287779){return _0x131ba9['define'](_0xce9a('0xa'),attributes,{'tableName':_0xce9a('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x668d=['bluebird','request-promise','rimraf','./automation.attributes','define','Automation','lodash','util','../../config/logger','moment'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x668d,0x132));var _0xd668=function(_0x54c8ba,_0x222ff4){_0x54c8ba=_0x54c8ba-0x0;var _0x726301=_0x668d[_0x54c8ba];return _0x726301;};'use strict';var _=require(_0xd668('0x0'));var util=require(_0xd668('0x1'));var logger=require(_0xd668('0x2'))('api');var moment=require(_0xd668('0x3'));var BPromise=require(_0xd668('0x4'));var rp=require(_0xd668('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd668('0x6'));var config=require('../../config/environment');var attributes=require(_0xd668('0x7'));module['exports']=function(_0x39b5f9,_0x2eb6fd){return _0x39b5f9[_0xd668('0x8')](_0xd668('0x9'),attributes,{'tableName':'tools_automations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/automation/automation.rpc.js b/server/api/automation/automation.rpc.js index dd340e5..0a8352a 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 _0x38b8=['client','http','request','then','Automation,\x20%s,\x20%s','debug','Automation,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','lodash','moment','bluebird','ioredis','../../config/logger','rpc'];(function(_0x527acd,_0x32b758){var _0x2c990f=function(_0x1eeb32){while(--_0x1eeb32){_0x527acd['push'](_0x527acd['shift']());}};_0x2c990f(++_0x32b758);}(_0x38b8,0x7f));var _0x838b=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x38b8[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x838b('0x0'));var util=require('util');var moment=require(_0x838b('0x1'));var BPromise=require(_0x838b('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x838b('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x838b('0x4'))(_0x838b('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x838b('0x6')][_0x838b('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x5c516c,_0x2d3e96,_0x15184b){return new BPromise(function(_0x4b9530,_0x552245){return client[_0x838b('0x8')](_0x5c516c,_0x15184b)[_0x838b('0x9')](function(_0x31ba84){logger['info'](_0x838b('0xa'),_0x2d3e96,'request\x20sent');logger[_0x838b('0xb')](_0x838b('0xc'),_0x2d3e96,_0x838b('0xd'),JSON[_0x838b('0xe')](_0x31ba84));if(_0x31ba84[_0x838b('0xf')]){if(_0x31ba84[_0x838b('0xf')]['code']===0x1f4){logger[_0x838b('0xf')](_0x838b('0xa'),_0x2d3e96,_0x31ba84[_0x838b('0xf')][_0x838b('0x10')]);return _0x552245(_0x31ba84[_0x838b('0xf')][_0x838b('0x10')]);}logger[_0x838b('0xf')](_0x838b('0xa'),_0x2d3e96,_0x31ba84[_0x838b('0xf')]['message']);return _0x4b9530(_0x31ba84[_0x838b('0xf')]['message']);}else{logger['info']('Automation,\x20%s,\x20%s',_0x2d3e96,_0x838b('0xd'));_0x4b9530(_0x31ba84[_0x838b('0x11')][_0x838b('0x10')]);}})[_0x838b('0x12')](function(_0x94e893){logger['error'](_0x838b('0xa'),_0x2d3e96,_0x94e893);_0x552245(_0x94e893);});});} \ No newline at end of file +var _0x7b08=['code','message','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','Automation,\x20%s,\x20%s','request\x20sent','debug','Automation,\x20%s,\x20%s,\x20%s','error'];(function(_0x2e6dee,_0x1a61b0){var _0x47706=function(_0x365546){while(--_0x365546){_0x2e6dee['push'](_0x2e6dee['shift']());}};_0x47706(++_0x1a61b0);}(_0x7b08,0x163));var _0x87b0=function(_0x2a97b6,_0x48709b){_0x2a97b6=_0x2a97b6-0x0;var _0x1df3ce=_0x7b08[_0x2a97b6];return _0x1df3ce;};'use strict';var _=require(_0x87b0('0x0'));var util=require('util');var moment=require(_0x87b0('0x1'));var BPromise=require(_0x87b0('0x2'));var rs=require(_0x87b0('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x87b0('0x4'))['db'];var utils=require(_0x87b0('0x5'));var logger=require(_0x87b0('0x6'))(_0x87b0('0x7'));var config=require('../../config/environment');var jayson=require(_0x87b0('0x8'));var client=jayson[_0x87b0('0x9')][_0x87b0('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x419841,_0x130650,_0x41dcc8){return new BPromise(function(_0x1a7f35,_0x4015e2){return client[_0x87b0('0xb')](_0x419841,_0x41dcc8)[_0x87b0('0xc')](function(_0x52f596){logger[_0x87b0('0xd')](_0x87b0('0xe'),_0x130650,_0x87b0('0xf'));logger[_0x87b0('0x10')](_0x87b0('0x11'),_0x130650,_0x87b0('0xf'),JSON['stringify'](_0x52f596));if(_0x52f596['error']){if(_0x52f596[_0x87b0('0x12')][_0x87b0('0x13')]===0x1f4){logger[_0x87b0('0x12')](_0x87b0('0xe'),_0x130650,_0x52f596[_0x87b0('0x12')][_0x87b0('0x14')]);return _0x4015e2(_0x52f596['error'][_0x87b0('0x14')]);}logger[_0x87b0('0x12')]('Automation,\x20%s,\x20%s',_0x130650,_0x52f596['error'][_0x87b0('0x14')]);return _0x1a7f35(_0x52f596['error']['message']);}else{logger['info'](_0x87b0('0xe'),_0x130650,_0x87b0('0xf'));_0x1a7f35(_0x52f596['result'][_0x87b0('0x14')]);}})[_0x87b0('0x15')](function(_0x2b37d6){logger[_0x87b0('0x12')](_0x87b0('0xe'),_0x130650,_0x2b37d6);_0x4015e2(_0x2b37d6);});});} \ No newline at end of file diff --git a/server/api/automation/index.js b/server/api/automation/index.js index 5831605..c01e26e 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 _0xa73a=['connect-timeout','express','Router','../../config/environment','./automation.controller','get','isAuthenticated','index','/:id','/:id/conditions','getConditions','/:id/actions','post','create','addConditions','put','update','delete','destroy','exports','util','path'];(function(_0x3740fe,_0x6c543c){var _0x55492b=function(_0x1f851f){while(--_0x1f851f){_0x3740fe['push'](_0x3740fe['shift']());}};_0x55492b(++_0x6c543c);}(_0xa73a,0x82));var _0xaa73=function(_0x51c726,_0x332b95){_0x51c726=_0x51c726-0x0;var _0x23fe86=_0xa73a[_0x51c726];return _0x23fe86;};'use strict';var multer=require('multer');var util=require(_0xaa73('0x0'));var path=require(_0xaa73('0x1'));var timeout=require(_0xaa73('0x2'));var express=require(_0xaa73('0x3'));var router=express[_0xaa73('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xaa73('0x5'));var controller=require(_0xaa73('0x6'));router[_0xaa73('0x7')]('/',auth[_0xaa73('0x8')](),controller[_0xaa73('0x9')]);router[_0xaa73('0x7')](_0xaa73('0xa'),auth['isAuthenticated'](),controller['show']);router[_0xaa73('0x7')](_0xaa73('0xb'),auth[_0xaa73('0x8')](),controller[_0xaa73('0xc')]);router[_0xaa73('0x7')](_0xaa73('0xd'),auth['isAuthenticated'](),controller['getActions']);router[_0xaa73('0xe')]('/',auth['isAuthenticated'](),controller[_0xaa73('0xf')]);router['post'](_0xaa73('0xb'),auth[_0xaa73('0x8')](),controller[_0xaa73('0x10')]);router[_0xaa73('0xe')](_0xaa73('0xd'),auth[_0xaa73('0x8')](),controller['addActions']);router[_0xaa73('0x11')](_0xaa73('0xa'),auth[_0xaa73('0x8')](),controller[_0xaa73('0x12')]);router[_0xaa73('0x13')](_0xaa73('0xa'),auth[_0xaa73('0x8')](),controller[_0xaa73('0x14')]);module[_0xaa73('0x15')]=router; \ No newline at end of file +var _0x808a=['destroy','exports','multer','util','path','connect-timeout','../../components/interaction/service','../../config/environment','./automation.controller','get','index','/:id','/:id/conditions','getConditions','isAuthenticated','getActions','post','create','/:id/actions','addActions','put','update','delete'];(function(_0x364869,_0x95313c){var _0x3964c1=function(_0x23d934){while(--_0x23d934){_0x364869['push'](_0x364869['shift']());}};_0x3964c1(++_0x95313c);}(_0x808a,0x1b7));var _0xa808=function(_0x2c50e4,_0x15cd2f){_0x2c50e4=_0x2c50e4-0x0;var _0x474118=_0x808a[_0x2c50e4];return _0x474118;};'use strict';var multer=require(_0xa808('0x0'));var util=require(_0xa808('0x1'));var path=require(_0xa808('0x2'));var timeout=require(_0xa808('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xa808('0x4'));var config=require(_0xa808('0x5'));var controller=require(_0xa808('0x6'));router[_0xa808('0x7')]('/',auth['isAuthenticated'](),controller[_0xa808('0x8')]);router[_0xa808('0x7')](_0xa808('0x9'),auth['isAuthenticated'](),controller['show']);router[_0xa808('0x7')](_0xa808('0xa'),auth['isAuthenticated'](),controller[_0xa808('0xb')]);router['get']('/:id/actions',auth[_0xa808('0xc')](),controller[_0xa808('0xd')]);router[_0xa808('0xe')]('/',auth[_0xa808('0xc')](),controller[_0xa808('0xf')]);router[_0xa808('0xe')](_0xa808('0xa'),auth[_0xa808('0xc')](),controller['addConditions']);router['post'](_0xa808('0x10'),auth[_0xa808('0xc')](),controller[_0xa808('0x11')]);router[_0xa808('0x12')](_0xa808('0x9'),auth['isAuthenticated'](),controller[_0xa808('0x13')]);router[_0xa808('0x14')]('/:id',auth[_0xa808('0xc')](),controller[_0xa808('0x15')]);module[_0xa808('0x16')]=router; \ No newline at end of file diff --git a/server/api/campaign/campaign.attributes.js b/server/api/campaign/campaign.attributes.js index c3b0bef..ffddd35 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 _0x2651=['#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','STRING','ENUM','ivr','BOOLEAN','INTEGER','UNSIGNED','Max\x20200\x20calls.','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','always','never','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','DESC','ASC','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'];(function(_0x420a89,_0x46290b){var _0x2a6956=function(_0x77b1c5){while(--_0x77b1c5){_0x420a89['push'](_0x420a89['shift']());}};_0x2a6956(++_0x46290b);}(_0x2651,0x166));var _0x1265=function(_0x342700,_0x569f75){_0x342700=_0x342700-0x0;var _0x53406f=_0x2651[_0x342700];return _0x53406f;};'use strict';var Sequelize=require(_0x1265('0x0'));module['exports']={'name':{'type':Sequelize[_0x1265('0x1')],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x1265('0x2')](_0x1265('0x3')),'allowNull':![],'defaultValue':_0x1265('0x3')},'description':{'type':Sequelize[_0x1265('0x1')]},'active':{'type':Sequelize[_0x1265('0x4')],'defaultValue':0x0,'comment':'Active/Disactive\x20Campaign'},'limitCalls':{'type':Sequelize[_0x1265('0x5')](0x4)[_0x1265('0x6')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0x1265('0x7')},'dialOriginateCallerIdName':{'type':Sequelize['STRING']},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x1265('0x1')]},'dialOriginateTimeout':{'type':Sequelize[_0x1265('0x5')](0x3)[_0x1265('0x6')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':'Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialCongestionMaxRetry':{'type':Sequelize[_0x1265('0x5')](0x3)[_0x1265('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Congestion\x20Retry\x20(min:1,\x20max:999)'},'dialCongestionRetryFrequency':{'type':Sequelize[_0x1265('0x5')](0x5)[_0x1265('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialBusyMaxRetry':{'type':Sequelize[_0x1265('0x5')](0x3)[_0x1265('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1265('0x8')},'dialBusyRetryFrequency':{'type':Sequelize[_0x1265('0x5')](0x5)[_0x1265('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1265('0x9')},'dialNoAnswerMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x1265('0x6')],'defaultValue':0x3,'comment':_0x1265('0xa')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x1265('0x5')](0x5)[_0x1265('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1265('0xb')},'dialGlobalMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x1265('0xc')},'dialTimezone':{'type':Sequelize[_0x1265('0x1')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x1265('0x1')],'defaultValue':'07:00-22:00,*,*,*'},'dialCheckDuplicateType':{'type':Sequelize['ENUM'](_0x1265('0xd'),_0x1265('0xe'),_0x1265('0xf')),'defaultValue':_0x1265('0xd')},'dialAMDActive':{'type':Sequelize[_0x1265('0x4')],'defaultValue':0x0,'comment':_0x1265('0x10')},'dialAMDInitialSilence':{'type':Sequelize['INTEGER'](0x9)[_0x1265('0x6')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':'#AMD\x20Initial\x20Silence'},'dialAMDGreeting':{'type':Sequelize[_0x1265('0x5')](0x9)[_0x1265('0x6')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x1265('0x11')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x1265('0x5')](0x9)[_0x1265('0x6')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x1265('0x12')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x1265('0x5')](0x9)[_0x1265('0x6')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Total\x20Analysis\x20Time'},'dialAMDMinWordLength':{'type':Sequelize[_0x1265('0x5')](0x9)[_0x1265('0x6')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x1265('0x13')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x1265('0x5')](0x9)[_0x1265('0x6')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x1265('0x14')},'dialAMDMaximumNumberOfWords':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize[_0x1265('0x5')](0x5)['UNSIGNED'],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x1265('0x15')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x1265('0x5')](0x9)[_0x1265('0x6')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x1265('0x16')},'dialOrderByScheduledAt':{'type':Sequelize[_0x1265('0x2')](_0x1265('0x17'),_0x1265('0x18')),'defaultValue':_0x1265('0x17')},'dialPrefix':{'type':Sequelize[_0x1265('0x1')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x1265('0x5')](0x3)[_0x1265('0x6')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Random\x20Last\x20Digit\x20(min:1,\x20max:15)'},'dialCutDigit':{'type':Sequelize[_0x1265('0x5')](0x3)[_0x1265('0x6')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Cut\x20Digit\x20(min:1,\x20max:15)'},'dialNoSuchNumberMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x1265('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)'},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x1265('0x5')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1265('0x19')},'dialDropMaxRetry':{'type':Sequelize[_0x1265('0x5')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1265('0x1a')},'dialDropRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x1265('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1265('0x1b')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x1265('0x5')](0x3)[_0x1265('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1265('0x1c')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x1265('0x5')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1265('0x1d')},'dialMachineMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x1265('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Machine\x20Retry\x20(min:1,\x20max:999)'},'dialMachineRetryFrequency':{'type':Sequelize[_0x1265('0x5')](0x5)[_0x1265('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x1265('0x5')](0x3)[_0x1265('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1265('0x1e')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x1265('0x5')](0x5)[_0x1265('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1265('0x1f')}}; \ No newline at end of file +var _0x784a=['#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','DESC','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)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','exports','STRING','ENUM','ivr','Active/Disactive\x20Campaign','INTEGER','UNSIGNED','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)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','never','always','BOOLEAN','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence'];(function(_0x1a680b,_0x3df1ae){var _0x19c9ec=function(_0x45a199){while(--_0x45a199){_0x1a680b['push'](_0x1a680b['shift']());}};_0x19c9ec(++_0x3df1ae);}(_0x784a,0x130));var _0xa784=function(_0x2283dc,_0x2fcfc5){_0x2283dc=_0x2283dc-0x0;var _0x16db90=_0x784a[_0x2283dc];return _0x16db90;};'use strict';var Sequelize=require(_0xa784('0x0'));module[_0xa784('0x1')]={'name':{'type':Sequelize[_0xa784('0x2')],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0xa784('0x3')]('ivr'),'allowNull':![],'defaultValue':_0xa784('0x4')},'description':{'type':Sequelize[_0xa784('0x2')]},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0xa784('0x5')},'limitCalls':{'type':Sequelize['INTEGER'](0x4)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':'Max\x20200\x20calls.'},'dialOriginateCallerIdName':{'type':Sequelize[_0xa784('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xa784('0x2')]},'dialOriginateTimeout':{'type':Sequelize[_0xa784('0x6')](0x3)[_0xa784('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xa784('0x8')},'dialCongestionMaxRetry':{'type':Sequelize[_0xa784('0x6')](0x3)[_0xa784('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xa784('0x9')},'dialCongestionRetryFrequency':{'type':Sequelize[_0xa784('0x6')](0x5)[_0xa784('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xa784('0xa')},'dialBusyMaxRetry':{'type':Sequelize[_0xa784('0x6')](0x3)[_0xa784('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xa784('0xb')},'dialBusyRetryFrequency':{'type':Sequelize[_0xa784('0x6')](0x5)[_0xa784('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xa784('0xc')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xa784('0x6')](0x3)[_0xa784('0x7')],'defaultValue':0x3,'comment':_0xa784('0xd')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xa784('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xa784('0xe')},'dialGlobalMaxRetry':{'type':Sequelize[_0xa784('0x6')](0x3)[_0xa784('0x7')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xa784('0xf')},'dialTimezone':{'type':Sequelize['STRING'],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize['STRING'],'defaultValue':_0xa784('0x10')},'dialCheckDuplicateType':{'type':Sequelize[_0xa784('0x3')]('always',_0xa784('0x11'),'onlyIfOpen'),'defaultValue':_0xa784('0x12')},'dialAMDActive':{'type':Sequelize[_0xa784('0x13')],'defaultValue':0x0,'comment':_0xa784('0x14')},'dialAMDInitialSilence':{'type':Sequelize[_0xa784('0x6')](0x9)['UNSIGNED'],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xa784('0x15')},'dialAMDGreeting':{'type':Sequelize[_0xa784('0x6')](0x9)[_0xa784('0x7')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xa784('0x16')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xa784('0x6')](0x9)['UNSIGNED'],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0xa784('0x17')},'dialAMDTotalAnalysisTime':{'type':Sequelize['INTEGER'](0x9)[_0xa784('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xa784('0x18')},'dialAMDMinWordLength':{'type':Sequelize[_0xa784('0x6')](0x9)[_0xa784('0x7')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xa784('0x19')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xa784('0x6')](0x9)[_0xa784('0x7')],'defaultValue':0x32,'validate':{'min':0x0},'comment':'#AMD\x20Between\x20Words\x20Silence'},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xa784('0x6')](0x9)[_0xa784('0x7')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0xa784('0x1a')},'dialAMDSilenceThreshold':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xa784('0x1b')},'dialAMDMaximumWordLength':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xa784('0x1c')},'dialOrderByScheduledAt':{'type':Sequelize['ENUM'](_0xa784('0x1d'),_0xa784('0x1e')),'defaultValue':_0xa784('0x1d')},'dialPrefix':{'type':Sequelize['STRING'],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xa784('0x6')](0x3)[_0xa784('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xa784('0x1f')},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)[_0xa784('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xa784('0x20')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0xa784('0x6')](0x3)[_0xa784('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xa784('0x21')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0xa784('0x6')](0x5)[_0xa784('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xa784('0x22')},'dialDropMaxRetry':{'type':Sequelize[_0xa784('0x6')](0x3)[_0xa784('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xa784('0x23')},'dialDropRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xa784('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAbandonedMaxRetry':{'type':Sequelize[_0xa784('0x6')](0x3)[_0xa784('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xa784('0x24')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0xa784('0x6')](0x5)[_0xa784('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xa784('0x25')},'dialMachineMaxRetry':{'type':Sequelize[_0xa784('0x6')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xa784('0x26')},'dialMachineRetryFrequency':{'type':Sequelize[_0xa784('0x6')](0x5)[_0xa784('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAgentRejectMaxRetry':{'type':Sequelize[_0xa784('0x6')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xa784('0x27')},'dialAgentRejectRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xa784('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xa784('0x28')}}; \ No newline at end of file diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js index e8cb5a4..d3954b5 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 _0xacb4=['json','reject','save','then','destroy','get','IvrCampaigns','stack','name','send','map','Campaign','rawAttributes','fieldName','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','keys','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','error','clone','omit','createdAt','updatedAt','CmHopper','CampaignId','getHopperHistories','findOne','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','CmList','addLists','ids','dialCheckDuplicateType','always','insert','cm_hopper','phone','scheduledAt','ContactId','select','NOW()','field','CmListId','toString','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','from','cm_hopper_final','CampaignId\x20=\x20?','COALESCE(phone,\x27\x27)','onlyIfOpen','into','fromQuery','ListId','push','sequelize','getBlackLists','addBlackLists','spread','cm_hopper_black','all','removeBlackLists','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','limit','count','set'];(function(_0x159c09,_0x2f5974){var _0x21810d=function(_0x445dc3){while(--_0x445dc3){_0x159c09['push'](_0x159c09['shift']());}};_0x21810d(++_0x2f5974);}(_0xacb4,0x65));var _0x4acb=function(_0x3a2a3c,_0x37bd31){_0x3a2a3c=_0x3a2a3c-0x0;var _0x50ac9a=_0xacb4[_0x3a2a3c];return _0x50ac9a;};'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('util');var path=require(_0x4acb('0x8'));var sox=require(_0x4acb('0x9'));var csv=require(_0x4acb('0xa'));var ejs=require(_0x4acb('0xb'));var fs=require('fs');var fs_extra=require(_0x4acb('0xc'));var _=require(_0x4acb('0xd'));var squel=require(_0x4acb('0xe'));var crypto=require(_0x4acb('0xf'));var jsforce=require(_0x4acb('0x10'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x4acb('0x11'));var Papa=require(_0x4acb('0x12'));var Redis=require('ioredis');var authService=require(_0x4acb('0x13'));var qs=require(_0x4acb('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4acb('0x15'));var logger=require('../../config/logger')(_0x4acb('0x16'));var utils=require(_0x4acb('0x17'));var config=require(_0x4acb('0x18'));var licenseUtil=require(_0x4acb('0x19'));var db=require(_0x4acb('0x1a'))['db'];function respondWithStatusCode(_0x12a5d1,_0x44b01f){_0x44b01f=_0x44b01f||0xcc;return function(_0x191a68){if(_0x191a68){return _0x12a5d1[_0x4acb('0x1b')](_0x44b01f);}return _0x12a5d1['status'](_0x44b01f)['end']();};}function respondWithResult(_0x457070,_0x5d72ec){_0x5d72ec=_0x5d72ec||0xc8;return function(_0x3d239f){if(_0x3d239f){return _0x457070[_0x4acb('0x1c')](_0x5d72ec)['json'](_0x3d239f);}};}function respondWithFilteredResult(_0x36bea3,_0x5f006c){return function(_0x16366c){if(_0x16366c){var _0x151cd8=typeof _0x5f006c[_0x4acb('0x1d')]===_0x4acb('0x1e')&&typeof _0x5f006c[_0x4acb('0x1f')]===_0x4acb('0x1e');var _0x13cfad=_0x16366c[_0x4acb('0x20')];var _0x55e90d=_0x151cd8?0x0:_0x5f006c[_0x4acb('0x1d')];var _0x52e693=_0x151cd8?_0x16366c['count']:_0x5f006c[_0x4acb('0x1d')]+_0x5f006c[_0x4acb('0x1f')];var _0x9a2ae7;if(_0x52e693>=_0x13cfad){_0x52e693=_0x13cfad;_0x9a2ae7=0xc8;}else{_0x9a2ae7=0xce;}_0x36bea3[_0x4acb('0x1c')](_0x9a2ae7);return _0x36bea3[_0x4acb('0x21')]('Content-Range',_0x55e90d+'-'+_0x52e693+'/'+_0x13cfad)[_0x4acb('0x22')](_0x16366c);}return null;};}function patchUpdates(_0x539053){return function(_0xaf3168){try{jsonpatch['apply'](_0xaf3168,_0x539053,!![]);}catch(_0x3a33f4){return BPromise[_0x4acb('0x23')](_0x3a33f4);}return _0xaf3168[_0x4acb('0x24')]();};}function saveUpdates(_0x28b3fc,_0x411a3a){return function(_0x5d1a80){if(_0x5d1a80){return _0x5d1a80['update'](_0x28b3fc)[_0x4acb('0x25')](function(_0x25b206){return _0x25b206;});}return null;};}function removeEntity(_0x580689,_0x4b042d){return function(_0x2b3b0a){if(_0x2b3b0a){return _0x2b3b0a[_0x4acb('0x26')]()['then'](function(){var _0x4b4204=_0x2b3b0a[_0x4acb('0x27')]({'plain':!![]});var _0x3e3274=_0x4acb('0x28');return db['UserProfileResource'][_0x4acb('0x26')]({'where':{'type':_0x3e3274,'resourceId':_0x4b4204['id']}})['then'](function(){return _0x2b3b0a;});})['then'](function(){_0x580689[_0x4acb('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3294ce,_0x17fe21){return function(_0x55ba09){if(!_0x55ba09){_0x3294ce[_0x4acb('0x1b')](0x194);}return _0x55ba09;};}function handleError(_0xd0842f,_0x19088a){_0x19088a=_0x19088a||0x1f4;return function(_0xe124a8){logger['error'](_0xe124a8[_0x4acb('0x29')]);if(_0xe124a8[_0x4acb('0x2a')]){delete _0xe124a8[_0x4acb('0x2a')];}_0xd0842f['status'](_0x19088a)[_0x4acb('0x2b')](_0xe124a8);};}exports['index']=function(_0x2143b5,_0x2fe797){var _0x15da3e={},_0x237c06={},_0x2ee086={'count':0x0,'rows':[]};var _0x908547=_[_0x4acb('0x2c')](db[_0x4acb('0x2d')][_0x4acb('0x2e')],function(_0x433c95){return{'name':_0x433c95[_0x4acb('0x2f')],'type':_0x433c95['type']['key']};});_0x237c06[_0x4acb('0x30')]=_[_0x4acb('0x2c')](_0x908547,'name');_0x237c06[_0x4acb('0x31')]=_['keys'](_0x2143b5[_0x4acb('0x31')]);_0x237c06[_0x4acb('0x32')]=_[_0x4acb('0x33')](_0x237c06['model'],_0x237c06[_0x4acb('0x31')]);_0x15da3e['attributes']=_[_0x4acb('0x33')](_0x237c06['model'],qs[_0x4acb('0x34')](_0x2143b5[_0x4acb('0x31')][_0x4acb('0x34')]));_0x15da3e[_0x4acb('0x35')]=_0x15da3e['attributes'][_0x4acb('0x36')]?_0x15da3e[_0x4acb('0x35')]:_0x237c06[_0x4acb('0x30')];if(!_0x2143b5[_0x4acb('0x31')][_0x4acb('0x37')](_0x4acb('0x38'))){_0x15da3e[_0x4acb('0x1f')]=qs[_0x4acb('0x1f')](_0x2143b5[_0x4acb('0x31')][_0x4acb('0x1f')]);_0x15da3e[_0x4acb('0x1d')]=qs[_0x4acb('0x1d')](_0x2143b5[_0x4acb('0x31')][_0x4acb('0x1d')]);}_0x15da3e[_0x4acb('0x39')]=qs['sort'](_0x2143b5[_0x4acb('0x31')][_0x4acb('0x3a')]);_0x15da3e[_0x4acb('0x3b')]=qs[_0x4acb('0x32')](_[_0x4acb('0x3c')](_0x2143b5['query'],_0x237c06[_0x4acb('0x32')]),_0x908547);if(_0x2143b5['query'][_0x4acb('0x3d')]){_0x15da3e[_0x4acb('0x3b')]=_[_0x4acb('0x3e')](_0x15da3e[_0x4acb('0x3b')],{'$or':_['map'](_0x908547,function(_0x26d574){if(_0x26d574['type']!==_0x4acb('0x3f')){var _0x3da2fe={};_0x3da2fe[_0x26d574[_0x4acb('0x2a')]]={'$like':'%'+_0x2143b5[_0x4acb('0x31')][_0x4acb('0x3d')]+'%'};return _0x3da2fe;}})});}_0x15da3e=_[_0x4acb('0x3e')]({},_0x15da3e,_0x2143b5[_0x4acb('0x40')]);var _0x589cd6={'where':_0x15da3e[_0x4acb('0x3b')]};return db[_0x4acb('0x2d')][_0x4acb('0x20')](_0x589cd6)[_0x4acb('0x25')](function(_0x470e02){_0x2ee086[_0x4acb('0x20')]=_0x470e02;if(_0x2143b5['query']['includeAll']){_0x15da3e[_0x4acb('0x41')]=[{'all':!![]}];}return db[_0x4acb('0x2d')][_0x4acb('0x42')](_0x15da3e);})['then'](function(_0x30f846){_0x2ee086[_0x4acb('0x43')]=_0x30f846;return _0x2ee086;})[_0x4acb('0x25')](respondWithFilteredResult(_0x2fe797,_0x15da3e))[_0x4acb('0x44')](handleError(_0x2fe797,null));};exports[_0x4acb('0x45')]=function(_0x772054,_0x36a1a1){var _0x1d70e3={'raw':![],'where':{'id':_0x772054[_0x4acb('0x46')]['id']}},_0x4d1a89={};_0x4d1a89['model']=_[_0x4acb('0x47')](db['Campaign'][_0x4acb('0x2e')]);_0x4d1a89[_0x4acb('0x31')]=_[_0x4acb('0x47')](_0x772054[_0x4acb('0x31')]);_0x4d1a89[_0x4acb('0x32')]=_[_0x4acb('0x33')](_0x4d1a89[_0x4acb('0x30')],_0x4d1a89[_0x4acb('0x31')]);_0x1d70e3[_0x4acb('0x35')]=_[_0x4acb('0x33')](_0x4d1a89[_0x4acb('0x30')],qs[_0x4acb('0x34')](_0x772054[_0x4acb('0x31')][_0x4acb('0x34')]));_0x1d70e3[_0x4acb('0x35')]=_0x1d70e3[_0x4acb('0x35')][_0x4acb('0x36')]?_0x1d70e3[_0x4acb('0x35')]:_0x4d1a89['model'];if(_0x772054['query'][_0x4acb('0x48')]){_0x1d70e3[_0x4acb('0x41')]=[{'all':!![]}];}_0x1d70e3=_['merge']({},_0x1d70e3,_0x772054[_0x4acb('0x40')]);return db[_0x4acb('0x2d')][_0x4acb('0x49')](_0x1d70e3)[_0x4acb('0x25')](handleEntityNotFound(_0x36a1a1,null))[_0x4acb('0x25')](respondWithResult(_0x36a1a1,null))[_0x4acb('0x44')](handleError(_0x36a1a1,null));};exports[_0x4acb('0x4a')]=function(_0x3038fc,_0x2faa00){return db[_0x4acb('0x2d')][_0x4acb('0x4a')](_0x3038fc[_0x4acb('0x4b')],{})[_0x4acb('0x25')](function(_0x447074){var _0x240550=_0x3038fc[_0x4acb('0x4c')]['get']({'plain':!![]});if(!_0x240550)throw new Error(_0x4acb('0x4d'));if(_0x240550[_0x4acb('0x4e')]===_0x4acb('0x4c')){var _0x46ee62=_0x447074[_0x4acb('0x27')]({'plain':!![]});var _0x2436a6=_0x4acb('0x28');return db[_0x4acb('0x4f')][_0x4acb('0x49')]({'where':{'name':_0x2436a6,'userProfileId':_0x240550[_0x4acb('0x50')]},'raw':!![]})['then'](function(_0x5ac4a6){if(_0x5ac4a6&&_0x5ac4a6[_0x4acb('0x51')]===0x0){return db[_0x4acb('0x52')][_0x4acb('0x4a')]({'name':_0x46ee62[_0x4acb('0x2a')],'resourceId':_0x46ee62['id'],'type':_0x5ac4a6[_0x4acb('0x2a')],'sectionId':_0x5ac4a6['id']},{})[_0x4acb('0x25')](function(){return _0x447074;});}else{return _0x447074;}})[_0x4acb('0x44')](function(_0x1fe026){logger[_0x4acb('0x53')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1fe026);throw _0x1fe026;});}return _0x447074;})[_0x4acb('0x25')](respondWithResult(_0x2faa00,0xc9))['catch'](handleError(_0x2faa00,null));};exports[_0x4acb('0x54')]=function(_0x4c6ccd,_0x50244b){var _0x3b280c={'where':{'id':_0x4c6ccd[_0x4acb('0x46')]['id']}},_0xcb3439={};_0xcb3439[_0x4acb('0x30')]=_['keys'](db[_0x4acb('0x2d')][_0x4acb('0x2e')]);_0x3b280c[_0x4acb('0x35')]=_[_0x4acb('0x33')](_0xcb3439['model'],qs['fields'](_0x4c6ccd['query'][_0x4acb('0x34')]));_0x3b280c['attributes']=_0x3b280c[_0x4acb('0x35')][_0x4acb('0x36')]?_0x3b280c['attributes']:_0xcb3439[_0x4acb('0x30')];if(_0x4c6ccd[_0x4acb('0x31')][_0x4acb('0x48')]){_0x3b280c[_0x4acb('0x41')]=[{'all':!![]}];}_0x3b280c=_[_0x4acb('0x3e')]({},_0x3b280c,_0x4c6ccd[_0x4acb('0x40')]);return db[_0x4acb('0x2d')]['find'](_0x3b280c)[_0x4acb('0x25')](handleEntityNotFound(_0x50244b,null))[_0x4acb('0x25')](function(_0x5acb94){if(_0x5acb94){var _0x2898fb=_0x5acb94[_0x4acb('0x27')]({'plain':!![]});_0x2898fb=qs[_0x4acb('0x55')](_0x2898fb,['id',_0x4acb('0x56'),_0x4acb('0x57')]);_0x4c6ccd[_0x4acb('0x4b')]=_[_0x4acb('0x55')](_0x4c6ccd[_0x4acb('0x4b')],['id',_0x4acb('0x56'),_0x4acb('0x57')]);return db[_0x4acb('0x2d')][_0x4acb('0x4a')](_[_0x4acb('0x3e')](_0x2898fb,_0x4c6ccd['body']),{'include':_0x4c6ccd[_0x4acb('0x31')][_0x4acb('0x48')]?[{'all':!![]}]:undefined})[_0x4acb('0x25')](function(_0x2b6b22){var _0x485d50=_0x4c6ccd[_0x4acb('0x4c')][_0x4acb('0x27')]({'plain':!![]});if(!_0x485d50)throw new Error(_0x4acb('0x4d'));if(_0x485d50[_0x4acb('0x4e')]===_0x4acb('0x4c')){var _0x445631=_0x2b6b22[_0x4acb('0x27')]({'plain':!![]});var _0x3a5b73=_0x4acb('0x28');return db['UserProfileSection'][_0x4acb('0x49')]({'where':{'name':_0x3a5b73,'userProfileId':_0x485d50['userProfileId']},'raw':!![]})['then'](function(_0x368ec8){if(_0x368ec8&&_0x368ec8[_0x4acb('0x51')]===0x0){return db[_0x4acb('0x52')][_0x4acb('0x4a')]({'name':_0x445631[_0x4acb('0x2a')],'resourceId':_0x445631['id'],'type':_0x368ec8[_0x4acb('0x2a')],'sectionId':_0x368ec8['id']},{})[_0x4acb('0x25')](function(){return _0x2b6b22;});}else{return _0x2b6b22;}})[_0x4acb('0x44')](function(_0x2f4b99){logger[_0x4acb('0x53')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2f4b99);throw _0x2f4b99;});}return _0x2b6b22;});}})[_0x4acb('0x25')](respondWithResult(_0x50244b,0xc9))[_0x4acb('0x44')](handleError(_0x50244b,null));};exports['update']=function(_0xd47aff,_0x2e7673){if(_0xd47aff[_0x4acb('0x4b')]['id']){delete _0xd47aff[_0x4acb('0x4b')]['id'];}return db['Campaign'][_0x4acb('0x49')]({'where':{'id':_0xd47aff[_0x4acb('0x46')]['id']}})['then'](handleEntityNotFound(_0x2e7673,null))[_0x4acb('0x25')](saveUpdates(_0xd47aff[_0x4acb('0x4b')],null))['then'](respondWithResult(_0x2e7673,null))['catch'](handleError(_0x2e7673,null));};exports[_0x4acb('0x26')]=function(_0x281376,_0x425b42){return db[_0x4acb('0x2d')][_0x4acb('0x49')]({'where':{'id':_0x281376[_0x4acb('0x46')]['id']}})['then'](handleEntityNotFound(_0x425b42,null))['then'](removeEntity(_0x425b42,null))[_0x4acb('0x44')](handleError(_0x425b42,null));};exports['getHoppers']=function(_0x2c67df,_0x14ed35,_0x5ae296){var _0x43fb42={'raw':!![],'where':{}};var _0x58bf68={};var _0x443bd3={'count':0x0,'rows':[]};return db['Campaign']['findOne']({'where':{'id':_0x2c67df[_0x4acb('0x46')]['id']}})[_0x4acb('0x25')](handleEntityNotFound(_0x14ed35,null))[_0x4acb('0x25')](function(_0x360b1e){if(_0x360b1e){_0x58bf68[_0x4acb('0x30')]=_[_0x4acb('0x47')](db[_0x4acb('0x58')][_0x4acb('0x2e')]);_0x58bf68[_0x4acb('0x31')]=_[_0x4acb('0x47')](_0x2c67df[_0x4acb('0x31')]);_0x58bf68[_0x4acb('0x32')]=_['intersection'](_0x58bf68[_0x4acb('0x30')],_0x58bf68['query']);_0x43fb42[_0x4acb('0x35')]=_[_0x4acb('0x33')](_0x58bf68[_0x4acb('0x30')],qs[_0x4acb('0x34')](_0x2c67df[_0x4acb('0x31')][_0x4acb('0x34')]));_0x43fb42[_0x4acb('0x35')]=_0x43fb42[_0x4acb('0x35')][_0x4acb('0x36')]?_0x43fb42[_0x4acb('0x35')]:_0x58bf68['model'];if(!_0x2c67df['query'][_0x4acb('0x37')](_0x4acb('0x38'))){_0x43fb42['limit']=qs['limit'](_0x2c67df[_0x4acb('0x31')][_0x4acb('0x1f')]);_0x43fb42[_0x4acb('0x1d')]=qs['offset'](_0x2c67df[_0x4acb('0x31')][_0x4acb('0x1d')]);}_0x43fb42[_0x4acb('0x39')]=qs[_0x4acb('0x3a')](_0x2c67df[_0x4acb('0x31')]['sort']);_0x43fb42[_0x4acb('0x3b')]=qs['filters'](_[_0x4acb('0x3c')](_0x2c67df[_0x4acb('0x31')],_0x58bf68[_0x4acb('0x32')]));_0x43fb42['where'][_0x4acb('0x59')]=_0x360b1e['id'];if(_0x2c67df[_0x4acb('0x31')][_0x4acb('0x3d')]){_0x43fb42['where']=_[_0x4acb('0x3e')](_0x43fb42[_0x4acb('0x3b')],{'$or':_[_0x4acb('0x2c')](_0x43fb42[_0x4acb('0x35')],function(_0x484c34){var _0x34bffb={};_0x34bffb[_0x484c34]={'$like':'%'+_0x2c67df[_0x4acb('0x31')]['filter']+'%'};return _0x34bffb;})});}_0x43fb42=_['merge']({},_0x43fb42,_0x2c67df['options']);return db[_0x4acb('0x58')][_0x4acb('0x20')]({'where':_0x43fb42[_0x4acb('0x3b')]})[_0x4acb('0x25')](function(_0x41012f){_0x443bd3['count']=_0x41012f;if(_0x2c67df[_0x4acb('0x31')][_0x4acb('0x48')]){_0x43fb42[_0x4acb('0x41')]=[{'all':!![]}];}return db[_0x4acb('0x58')][_0x4acb('0x42')](_0x43fb42);})['then'](function(_0x17aa8f){_0x443bd3[_0x4acb('0x43')]=_0x17aa8f;return _0x443bd3;});}})[_0x4acb('0x25')](respondWithFilteredResult(_0x14ed35,_0x43fb42))[_0x4acb('0x44')](handleError(_0x14ed35,null));};exports[_0x4acb('0x5a')]=function(_0x1e45c2,_0xcb384a,_0x3714c2){var _0x69ee5a={'raw':!![],'where':{}};var _0x1900b3={};var _0x5e2f45={'count':0x0,'rows':[]};return db[_0x4acb('0x2d')][_0x4acb('0x5b')]({'where':{'id':_0x1e45c2[_0x4acb('0x46')]['id']}})[_0x4acb('0x25')](handleEntityNotFound(_0xcb384a,null))[_0x4acb('0x25')](function(_0x3c30ac){if(_0x3c30ac){_0x1900b3['model']=_[_0x4acb('0x47')](db['CmHopperHistory'][_0x4acb('0x2e')]);_0x1900b3['query']=_['keys'](_0x1e45c2['query']);_0x1900b3['filters']=_[_0x4acb('0x33')](_0x1900b3[_0x4acb('0x30')],_0x1900b3[_0x4acb('0x31')]);_0x69ee5a[_0x4acb('0x35')]=_['intersection'](_0x1900b3[_0x4acb('0x30')],qs['fields'](_0x1e45c2[_0x4acb('0x31')][_0x4acb('0x34')]));_0x69ee5a[_0x4acb('0x35')]=_0x69ee5a[_0x4acb('0x35')]['length']?_0x69ee5a[_0x4acb('0x35')]:_0x1900b3[_0x4acb('0x30')];if(!_0x1e45c2['query'][_0x4acb('0x37')](_0x4acb('0x38'))){_0x69ee5a[_0x4acb('0x1f')]=qs[_0x4acb('0x1f')](_0x1e45c2[_0x4acb('0x31')][_0x4acb('0x1f')]);_0x69ee5a['offset']=qs[_0x4acb('0x1d')](_0x1e45c2[_0x4acb('0x31')][_0x4acb('0x1d')]);}_0x69ee5a[_0x4acb('0x39')]=qs[_0x4acb('0x3a')](_0x1e45c2[_0x4acb('0x31')][_0x4acb('0x3a')]);_0x69ee5a[_0x4acb('0x3b')]=qs[_0x4acb('0x32')](_[_0x4acb('0x3c')](_0x1e45c2[_0x4acb('0x31')],_0x1900b3[_0x4acb('0x32')]));_0x69ee5a[_0x4acb('0x3b')][_0x4acb('0x59')]=_0x3c30ac['id'];if(_0x1e45c2[_0x4acb('0x31')]['filter']){_0x69ee5a[_0x4acb('0x3b')]=_[_0x4acb('0x3e')](_0x69ee5a[_0x4acb('0x3b')],{'$or':_[_0x4acb('0x2c')](_0x69ee5a['attributes'],function(_0x4e1f46){var _0x5894fb={};_0x5894fb[_0x4e1f46]={'$like':'%'+_0x1e45c2[_0x4acb('0x31')][_0x4acb('0x3d')]+'%'};return _0x5894fb;})});}_0x69ee5a=_['merge']({},_0x69ee5a,_0x1e45c2['options']);return db[_0x4acb('0x5c')][_0x4acb('0x20')]({'where':_0x69ee5a[_0x4acb('0x3b')]})[_0x4acb('0x25')](function(_0x46d16e){_0x5e2f45[_0x4acb('0x20')]=_0x46d16e;if(_0x1e45c2[_0x4acb('0x31')][_0x4acb('0x48')]){_0x69ee5a[_0x4acb('0x41')]=[{'all':!![]}];}return db[_0x4acb('0x5c')][_0x4acb('0x42')](_0x69ee5a);})['then'](function(_0x1b3426){_0x5e2f45[_0x4acb('0x43')]=_0x1b3426;return _0x5e2f45;});}})[_0x4acb('0x25')](respondWithFilteredResult(_0xcb384a,_0x69ee5a))[_0x4acb('0x44')](handleError(_0xcb384a,null));};exports[_0x4acb('0x5d')]=function(_0x4c2155,_0x409ce4,_0xeab406){var _0x2e4681={'raw':!![],'where':{}};var _0x2653ff={};var _0x248bae={'count':0x0,'rows':[]};return db['Campaign'][_0x4acb('0x5b')]({'where':{'id':_0x4c2155[_0x4acb('0x46')]['id']}})['then'](handleEntityNotFound(_0x409ce4,null))[_0x4acb('0x25')](function(_0x12bcae){if(_0x12bcae){_0x2653ff[_0x4acb('0x30')]=_['keys'](db[_0x4acb('0x5e')]['rawAttributes']);_0x2653ff[_0x4acb('0x31')]=_[_0x4acb('0x47')](_0x4c2155[_0x4acb('0x31')]);_0x2653ff[_0x4acb('0x32')]=_[_0x4acb('0x33')](_0x2653ff[_0x4acb('0x30')],_0x2653ff['query']);_0x2e4681[_0x4acb('0x35')]=_['intersection'](_0x2653ff[_0x4acb('0x30')],qs[_0x4acb('0x34')](_0x4c2155['query'][_0x4acb('0x34')]));_0x2e4681[_0x4acb('0x35')]=_0x2e4681[_0x4acb('0x35')][_0x4acb('0x36')]?_0x2e4681['attributes']:_0x2653ff['model'];if(!_0x4c2155[_0x4acb('0x31')]['hasOwnProperty'](_0x4acb('0x38'))){_0x2e4681[_0x4acb('0x1f')]=qs[_0x4acb('0x1f')](_0x4c2155[_0x4acb('0x31')][_0x4acb('0x1f')]);_0x2e4681['offset']=qs[_0x4acb('0x1d')](_0x4c2155[_0x4acb('0x31')][_0x4acb('0x1d')]);}_0x2e4681[_0x4acb('0x39')]=qs[_0x4acb('0x3a')](_0x4c2155[_0x4acb('0x31')][_0x4acb('0x3a')]);_0x2e4681[_0x4acb('0x3b')]=qs[_0x4acb('0x32')](_[_0x4acb('0x3c')](_0x4c2155[_0x4acb('0x31')],_0x2653ff[_0x4acb('0x32')]));_0x2e4681[_0x4acb('0x3b')][_0x4acb('0x59')]=_0x12bcae['id'];if(_0x4c2155[_0x4acb('0x31')][_0x4acb('0x3d')]){_0x2e4681[_0x4acb('0x3b')]=_[_0x4acb('0x3e')](_0x2e4681[_0x4acb('0x3b')],{'$or':_[_0x4acb('0x2c')](_0x2e4681['attributes'],function(_0x15fe08){var _0x5b15e6={};_0x5b15e6[_0x15fe08]={'$like':'%'+_0x4c2155[_0x4acb('0x31')][_0x4acb('0x3d')]+'%'};return _0x5b15e6;})});}_0x2e4681=_[_0x4acb('0x3e')]({},_0x2e4681,_0x4c2155[_0x4acb('0x40')]);return db[_0x4acb('0x5e')]['count']({'where':_0x2e4681[_0x4acb('0x3b')]})[_0x4acb('0x25')](function(_0x3b511a){_0x248bae[_0x4acb('0x20')]=_0x3b511a;if(_0x4c2155[_0x4acb('0x31')][_0x4acb('0x48')]){_0x2e4681[_0x4acb('0x41')]=[{'all':!![]}];}return db[_0x4acb('0x5e')][_0x4acb('0x42')](_0x2e4681);})['then'](function(_0x317d80){_0x248bae[_0x4acb('0x43')]=_0x317d80;return _0x248bae;});}})[_0x4acb('0x25')](respondWithFilteredResult(_0x409ce4,_0x2e4681))[_0x4acb('0x44')](handleError(_0x409ce4,null));};exports[_0x4acb('0x5f')]=function(_0x1891d8,_0x50e1f2,_0x543e06){var _0xbad350={'raw':!![],'where':{}};var _0x2cff65={};var _0x2566b={'count':0x0,'rows':[]};return db[_0x4acb('0x2d')][_0x4acb('0x5b')]({'where':{'id':_0x1891d8[_0x4acb('0x46')]['id']}})[_0x4acb('0x25')](handleEntityNotFound(_0x50e1f2,null))[_0x4acb('0x25')](function(_0x460b8e){if(_0x460b8e){_0x2cff65[_0x4acb('0x30')]=_[_0x4acb('0x47')](db[_0x4acb('0x60')]['rawAttributes']);_0x2cff65[_0x4acb('0x31')]=_[_0x4acb('0x47')](_0x1891d8['query']);_0x2cff65[_0x4acb('0x32')]=_['intersection'](_0x2cff65[_0x4acb('0x30')],_0x2cff65['query']);_0xbad350[_0x4acb('0x35')]=_[_0x4acb('0x33')](_0x2cff65['model'],qs[_0x4acb('0x34')](_0x1891d8['query'][_0x4acb('0x34')]));_0xbad350[_0x4acb('0x35')]=_0xbad350[_0x4acb('0x35')][_0x4acb('0x36')]?_0xbad350[_0x4acb('0x35')]:_0x2cff65[_0x4acb('0x30')];if(!_0x1891d8[_0x4acb('0x31')][_0x4acb('0x37')](_0x4acb('0x38'))){_0xbad350[_0x4acb('0x1f')]=qs[_0x4acb('0x1f')](_0x1891d8[_0x4acb('0x31')][_0x4acb('0x1f')]);_0xbad350['offset']=qs[_0x4acb('0x1d')](_0x1891d8['query'][_0x4acb('0x1d')]);}_0xbad350[_0x4acb('0x39')]=qs[_0x4acb('0x3a')](_0x1891d8[_0x4acb('0x31')][_0x4acb('0x3a')]);_0xbad350[_0x4acb('0x3b')]=qs[_0x4acb('0x32')](_[_0x4acb('0x3c')](_0x1891d8[_0x4acb('0x31')],_0x2cff65['filters']));_0xbad350[_0x4acb('0x3b')][_0x4acb('0x59')]=_0x460b8e['id'];if(_0x1891d8[_0x4acb('0x31')][_0x4acb('0x3d')]){_0xbad350['where']=_[_0x4acb('0x3e')](_0xbad350[_0x4acb('0x3b')],{'$or':_[_0x4acb('0x2c')](_0xbad350[_0x4acb('0x35')],function(_0x4e9813){var _0x35649d={};_0x35649d[_0x4e9813]={'$like':'%'+_0x1891d8[_0x4acb('0x31')][_0x4acb('0x3d')]+'%'};return _0x35649d;})});}_0xbad350=_[_0x4acb('0x3e')]({},_0xbad350,_0x1891d8[_0x4acb('0x40')]);return db[_0x4acb('0x60')]['count']({'where':_0xbad350[_0x4acb('0x3b')]})[_0x4acb('0x25')](function(_0x5e643f){_0x2566b[_0x4acb('0x20')]=_0x5e643f;if(_0x1891d8[_0x4acb('0x31')][_0x4acb('0x48')]){_0xbad350[_0x4acb('0x41')]=[{'all':!![]}];}return db['CmHopperBlack'][_0x4acb('0x42')](_0xbad350);})['then'](function(_0x233b03){_0x2566b['rows']=_0x233b03;return _0x2566b;});}})[_0x4acb('0x25')](respondWithFilteredResult(_0x50e1f2,_0xbad350))[_0x4acb('0x44')](handleError(_0x50e1f2,null));};exports[_0x4acb('0x61')]=function(_0x3b1888,_0x462e08,_0x5b596b){var _0x5b170a={};var _0x28ccda={};var _0x1d8c90;var _0x2060a1;return db['Campaign'][_0x4acb('0x5b')]({'where':{'id':_0x3b1888[_0x4acb('0x46')]['id']}})[_0x4acb('0x25')](handleEntityNotFound(_0x462e08,null))[_0x4acb('0x25')](function(_0x4706a4){if(_0x4706a4){_0x1d8c90=_0x4706a4;_0x28ccda[_0x4acb('0x30')]=_[_0x4acb('0x47')](db[_0x4acb('0x62')]['rawAttributes']);_0x28ccda[_0x4acb('0x31')]=_[_0x4acb('0x47')](_0x3b1888[_0x4acb('0x31')]);_0x28ccda[_0x4acb('0x32')]=_[_0x4acb('0x33')](_0x28ccda['model'],_0x28ccda[_0x4acb('0x31')]);_0x5b170a['attributes']=_[_0x4acb('0x33')](_0x28ccda['model'],qs['fields'](_0x3b1888['query'][_0x4acb('0x34')]));_0x5b170a['attributes']=_0x5b170a['attributes'][_0x4acb('0x36')]?_0x5b170a['attributes']:_0x28ccda[_0x4acb('0x30')];_0x5b170a['order']=qs[_0x4acb('0x3a')](_0x3b1888['query'][_0x4acb('0x3a')]);_0x5b170a[_0x4acb('0x3b')]=qs['filters'](_[_0x4acb('0x3c')](_0x3b1888[_0x4acb('0x31')],_0x28ccda[_0x4acb('0x32')]));if(_0x3b1888[_0x4acb('0x31')][_0x4acb('0x3d')]){_0x5b170a['where']=_[_0x4acb('0x3e')](_0x5b170a[_0x4acb('0x3b')],{'$or':_['map'](_0x5b170a['attributes'],function(_0x4cbb01){var _0x444dd0={};_0x444dd0[_0x4cbb01]={'$like':'%'+_0x3b1888['query'][_0x4acb('0x3d')]+'%'};return _0x444dd0;})});}_0x5b170a=_[_0x4acb('0x3e')]({},_0x5b170a,_0x3b1888[_0x4acb('0x40')]);return _0x1d8c90[_0x4acb('0x61')](_0x5b170a);}})[_0x4acb('0x25')](function(_0x311da4){if(_0x311da4){_0x2060a1=_0x311da4[_0x4acb('0x36')];if(!_0x3b1888[_0x4acb('0x31')][_0x4acb('0x37')](_0x4acb('0x38'))){_0x5b170a[_0x4acb('0x1f')]=qs[_0x4acb('0x1f')](_0x3b1888[_0x4acb('0x31')][_0x4acb('0x1f')]);_0x5b170a[_0x4acb('0x1d')]=qs[_0x4acb('0x1d')](_0x3b1888['query'][_0x4acb('0x1d')]);}return _0x1d8c90[_0x4acb('0x61')](_0x5b170a);}})[_0x4acb('0x25')](function(_0x514bd0){if(_0x514bd0){return _0x514bd0?{'count':_0x2060a1,'rows':_0x514bd0}:null;}})[_0x4acb('0x25')](respondWithResult(_0x462e08,null))['catch'](handleError(_0x462e08,null));};exports[_0x4acb('0x63')]=function(_0x3ab902,_0x69f063,_0x2ffc83){var _0x4efbcc,_0x1a49dc;return db[_0x4acb('0x2d')][_0x4acb('0x49')]({'where':{'id':_0x3ab902[_0x4acb('0x46')]['id']}})['then'](handleEntityNotFound(_0x69f063,null))[_0x4acb('0x25')](function(_0x612bd4){if(_0x612bd4){_0x1a49dc=_0x612bd4;return _0x612bd4['addLists'](_0x3ab902[_0x4acb('0x4b')][_0x4acb('0x64')],_['omit'](_0x3ab902['body'],[_0x4acb('0x64'),'id'])||{});}return null;})['spread'](function(_0x2efab0){var _0x1fb476;_0x4efbcc=_0x2efab0||[];var _0x8e5b0e=[];if(_0x2efab0){for(var _0x568149=0x0;_0x568149<_0x2efab0[_0x4acb('0x36')];_0x568149+=0x1){var _0xf22ad9=_0x2efab0[_0x568149][_0x4acb('0x27')]({'plain':!![]});_0x1a49dc[_0x4acb('0x65')]=_0x3ab902['body'][_0x4acb('0x65')]?_0x3ab902[_0x4acb('0x4b')][_0x4acb('0x65')]:_0x1a49dc[_0x4acb('0x65')];switch(_0x1a49dc['dialCheckDuplicateType']){case _0x4acb('0x66'):_0x1fb476=squel[_0x4acb('0x67')]()['into'](_0x4acb('0x68'))['fromQuery']([_0x4acb('0x69'),_0x4acb('0x6a'),_0x4acb('0x6b'),'ListId',_0x4acb('0x59'),_0x4acb('0x56'),_0x4acb('0x57')],squel[_0x4acb('0x6c')]()['field']('phone','phone')['field'](_0x4acb('0x6d'),'scheduledAt')[_0x4acb('0x6e')]('id',_0x4acb('0x6b'))[_0x4acb('0x6e')](_0xf22ad9[_0x4acb('0x6f')]['toString'](),'ListId')[_0x4acb('0x6e')](_0x3ab902[_0x4acb('0x46')]['id'][_0x4acb('0x70')](),_0x4acb('0x59'))[_0x4acb('0x6e')](_0x4acb('0x6d'),_0x4acb('0x56'))['field'](_0x4acb('0x6d'),'updatedAt')['from'](_0x4acb('0x71'))[_0x4acb('0x3b')](_0x4acb('0x72'))[_0x4acb('0x3b')](_0x4acb('0x73'),_0xf22ad9[_0x4acb('0x6f')]['toString']())[_0x4acb('0x3b')](_0x4acb('0x74'))[_0x4acb('0x3b')](_0x4acb('0x75'),squel['select']()['field'](_0x4acb('0x76'))[_0x4acb('0x77')](_0x4acb('0x78'))[_0x4acb('0x3b')](_0x4acb('0x79'),_0x3ab902['params']['id'][_0x4acb('0x70')]()))[_0x4acb('0x3b')](_0x4acb('0x75'),squel[_0x4acb('0x6c')]()[_0x4acb('0x6e')](_0x4acb('0x7a'))[_0x4acb('0x77')](_0x4acb('0x68'))[_0x4acb('0x3b')]('CampaignId\x20=\x20?',_0x3ab902[_0x4acb('0x46')]['id'][_0x4acb('0x70')]())))[_0x4acb('0x70')]();break;case _0x4acb('0x7b'):_0x1fb476=squel[_0x4acb('0x67')]()[_0x4acb('0x7c')]('cm_hopper')[_0x4acb('0x7d')]([_0x4acb('0x69'),'scheduledAt','ContactId',_0x4acb('0x7e'),_0x4acb('0x59'),_0x4acb('0x56'),_0x4acb('0x57')],squel[_0x4acb('0x6c')]()[_0x4acb('0x6e')](_0x4acb('0x69'),_0x4acb('0x69'))[_0x4acb('0x6e')](_0x4acb('0x6d'),_0x4acb('0x6a'))[_0x4acb('0x6e')]('id','ContactId')[_0x4acb('0x6e')](_0xf22ad9[_0x4acb('0x6f')][_0x4acb('0x70')](),_0x4acb('0x7e'))['field'](_0x3ab902[_0x4acb('0x46')]['id'][_0x4acb('0x70')](),_0x4acb('0x59'))[_0x4acb('0x6e')](_0x4acb('0x6d'),_0x4acb('0x56'))[_0x4acb('0x6e')](_0x4acb('0x6d'),_0x4acb('0x57'))[_0x4acb('0x77')](_0x4acb('0x71'))['where']('deletedAt\x20IS\x20NULL')[_0x4acb('0x3b')](_0x4acb('0x73'),_0xf22ad9[_0x4acb('0x6f')][_0x4acb('0x70')]())['where'](_0x4acb('0x74'))['where'](_0x4acb('0x75'),squel[_0x4acb('0x6c')]()[_0x4acb('0x6e')](_0x4acb('0x7a'))[_0x4acb('0x77')](_0x4acb('0x68'))[_0x4acb('0x3b')]('CampaignId\x20=\x20?',_0x3ab902[_0x4acb('0x46')]['id'][_0x4acb('0x70')]())))[_0x4acb('0x70')]();break;default:_0x1fb476=squel[_0x4acb('0x67')]()['into']('cm_hopper')['fromQuery']([_0x4acb('0x69'),'scheduledAt','ContactId',_0x4acb('0x7e'),_0x4acb('0x59'),_0x4acb('0x56'),_0x4acb('0x57')],squel['select']()[_0x4acb('0x6e')]('phone',_0x4acb('0x69'))[_0x4acb('0x6e')](_0x4acb('0x6d'),'scheduledAt')[_0x4acb('0x6e')]('id',_0x4acb('0x6b'))['field'](_0xf22ad9[_0x4acb('0x6f')]['toString'](),_0x4acb('0x7e'))[_0x4acb('0x6e')](_0x3ab902['params']['id'][_0x4acb('0x70')](),_0x4acb('0x59'))[_0x4acb('0x6e')](_0x4acb('0x6d'),'createdAt')[_0x4acb('0x6e')]('NOW()','updatedAt')[_0x4acb('0x77')](_0x4acb('0x71'))[_0x4acb('0x3b')](_0x4acb('0x72'))[_0x4acb('0x3b')]('ListId\x20=\x20?',_0xf22ad9[_0x4acb('0x6f')][_0x4acb('0x70')]())[_0x4acb('0x3b')]('phone\x20IS\x20NOT\x20NULL'))[_0x4acb('0x70')]();}_0x8e5b0e[_0x4acb('0x7f')](db[_0x4acb('0x80')]['query'](_0x1fb476));}return BPromise['all'](_0x8e5b0e);}})['then'](function(){return _0x4efbcc;})[_0x4acb('0x25')](respondWithResult(_0x69f063,null))[_0x4acb('0x44')](handleError(_0x69f063,null));};exports['removeLists']=function(_0x3c01b2,_0x4d30d8,_0x30a2b3){return db['Campaign'][_0x4acb('0x49')]({'where':{'id':_0x3c01b2['params']['id']}})['then'](handleEntityNotFound(_0x4d30d8,null))['then'](function(_0x270b48){if(_0x270b48){return _0x270b48['removeLists'](_0x3c01b2[_0x4acb('0x31')]['ids']);}})[_0x4acb('0x25')](function(_0x16813d){if(_0x16813d){return db[_0x4acb('0x58')][_0x4acb('0x26')]({'where':{'ListId':_0x3c01b2[_0x4acb('0x31')][_0x4acb('0x64')],'CampaignId':_0x3c01b2[_0x4acb('0x46')]['id']}})[_0x4acb('0x25')](function(){return _0x16813d;});}})['then'](respondWithStatusCode(_0x4d30d8,null))[_0x4acb('0x44')](handleError(_0x4d30d8,null));};exports[_0x4acb('0x81')]=function(_0x167e27,_0x5d7f56,_0x2860ee){var _0x3790a3={};var _0xa14495={};var _0x440e20;var _0x5e2a27;return db[_0x4acb('0x2d')][_0x4acb('0x5b')]({'where':{'id':_0x167e27[_0x4acb('0x46')]['id']}})[_0x4acb('0x25')](handleEntityNotFound(_0x5d7f56,null))[_0x4acb('0x25')](function(_0x2a9176){if(_0x2a9176){_0x440e20=_0x2a9176;_0xa14495[_0x4acb('0x30')]=_[_0x4acb('0x47')](db[_0x4acb('0x62')]['rawAttributes']);_0xa14495[_0x4acb('0x31')]=_[_0x4acb('0x47')](_0x167e27[_0x4acb('0x31')]);_0xa14495[_0x4acb('0x32')]=_[_0x4acb('0x33')](_0xa14495[_0x4acb('0x30')],_0xa14495['query']);_0x3790a3['attributes']=_[_0x4acb('0x33')](_0xa14495[_0x4acb('0x30')],qs[_0x4acb('0x34')](_0x167e27[_0x4acb('0x31')]['fields']));_0x3790a3[_0x4acb('0x35')]=_0x3790a3['attributes'][_0x4acb('0x36')]?_0x3790a3[_0x4acb('0x35')]:_0xa14495[_0x4acb('0x30')];_0x3790a3['order']=qs[_0x4acb('0x3a')](_0x167e27[_0x4acb('0x31')][_0x4acb('0x3a')]);_0x3790a3[_0x4acb('0x3b')]=qs[_0x4acb('0x32')](_[_0x4acb('0x3c')](_0x167e27[_0x4acb('0x31')],_0xa14495[_0x4acb('0x32')]));if(_0x167e27['query'][_0x4acb('0x3d')]){_0x3790a3['where']=_[_0x4acb('0x3e')](_0x3790a3['where'],{'$or':_[_0x4acb('0x2c')](_0x3790a3[_0x4acb('0x35')],function(_0x5a48fd){var _0x39d79f={};_0x39d79f[_0x5a48fd]={'$like':'%'+_0x167e27[_0x4acb('0x31')][_0x4acb('0x3d')]+'%'};return _0x39d79f;})});}_0x3790a3=_[_0x4acb('0x3e')]({},_0x3790a3,_0x167e27[_0x4acb('0x40')]);return _0x440e20[_0x4acb('0x81')](_0x3790a3);}})[_0x4acb('0x25')](function(_0x3f9725){if(_0x3f9725){_0x5e2a27=_0x3f9725[_0x4acb('0x36')];if(!_0x167e27[_0x4acb('0x31')][_0x4acb('0x37')]('nolimit')){_0x3790a3[_0x4acb('0x1f')]=qs[_0x4acb('0x1f')](_0x167e27[_0x4acb('0x31')][_0x4acb('0x1f')]);_0x3790a3[_0x4acb('0x1d')]=qs[_0x4acb('0x1d')](_0x167e27[_0x4acb('0x31')]['offset']);}return _0x440e20[_0x4acb('0x81')](_0x3790a3);}})[_0x4acb('0x25')](function(_0x2a6142){if(_0x2a6142){return _0x2a6142?{'count':_0x5e2a27,'rows':_0x2a6142}:null;}})[_0x4acb('0x25')](respondWithResult(_0x5d7f56,null))[_0x4acb('0x44')](handleError(_0x5d7f56,null));};exports[_0x4acb('0x82')]=function(_0x5b6a8c,_0x1e1f25,_0x34eb5b){var _0x1aa7bd,_0x595853;return db[_0x4acb('0x2d')][_0x4acb('0x49')]({'where':{'id':_0x5b6a8c[_0x4acb('0x46')]['id']}})[_0x4acb('0x25')](handleEntityNotFound(_0x1e1f25,null))['then'](function(_0x389386){if(_0x389386){_0x595853=_0x389386;return _0x389386[_0x4acb('0x82')](_0x5b6a8c[_0x4acb('0x4b')][_0x4acb('0x64')],_[_0x4acb('0x55')](_0x5b6a8c[_0x4acb('0x4b')],['ids','id'])||{});}return null;})[_0x4acb('0x83')](function(_0x4430e6){var _0x4cf474;_0x1aa7bd=_0x4430e6||[];var _0x5d6e89=[];if(_0x4430e6){for(var _0x4c0ee2=0x0;_0x4c0ee2<_0x4430e6[_0x4acb('0x36')];_0x4c0ee2+=0x1){var _0x143a15=_0x4430e6[_0x4c0ee2][_0x4acb('0x27')]({'plain':!![]});_0x4cf474=squel[_0x4acb('0x67')]()[_0x4acb('0x7c')](_0x4acb('0x84'))[_0x4acb('0x7d')]([_0x4acb('0x69'),_0x4acb('0x6b'),_0x4acb('0x7e'),_0x4acb('0x59'),_0x4acb('0x56'),_0x4acb('0x57')],squel['select']()[_0x4acb('0x6e')]('phone','phone')[_0x4acb('0x6e')]('id',_0x4acb('0x6b'))['field'](_0x143a15[_0x4acb('0x6f')][_0x4acb('0x70')](),_0x4acb('0x7e'))['field'](_0x5b6a8c['params']['id'][_0x4acb('0x70')](),_0x4acb('0x59'))[_0x4acb('0x6e')](_0x4acb('0x6d'),'createdAt')[_0x4acb('0x6e')](_0x4acb('0x6d'),_0x4acb('0x57'))[_0x4acb('0x77')](_0x4acb('0x71'))[_0x4acb('0x3b')]('deletedAt\x20IS\x20NULL')[_0x4acb('0x3b')]('ListId\x20=\x20?',_0x143a15[_0x4acb('0x6f')]['toString']())[_0x4acb('0x3b')]('phone\x20IS\x20NOT\x20NULL'))['toString']();_0x5d6e89[_0x4acb('0x7f')](db[_0x4acb('0x80')]['query'](_0x4cf474));}return BPromise[_0x4acb('0x85')](_0x5d6e89);}})[_0x4acb('0x25')](function(){return _0x1aa7bd;})['then'](respondWithResult(_0x1e1f25,null))[_0x4acb('0x44')](handleError(_0x1e1f25,null));};exports[_0x4acb('0x86')]=function(_0x1484d3,_0x4f20b3,_0x521b5e){return db[_0x4acb('0x2d')][_0x4acb('0x49')]({'where':{'id':_0x1484d3[_0x4acb('0x46')]['id']}})['then'](handleEntityNotFound(_0x4f20b3,null))[_0x4acb('0x25')](function(_0xfc65a5){if(_0xfc65a5){return _0xfc65a5[_0x4acb('0x86')](_0x1484d3['query'][_0x4acb('0x64')]);}})['then'](function(_0x263c1d){if(_0x263c1d){return db[_0x4acb('0x60')]['destroy']({'where':{'ListId':_0x1484d3[_0x4acb('0x31')][_0x4acb('0x64')],'CampaignId':_0x1484d3[_0x4acb('0x46')]['id']}})[_0x4acb('0x25')](function(){return _0x263c1d;});}})[_0x4acb('0x25')](respondWithStatusCode(_0x4f20b3,null))['catch'](handleError(_0x4f20b3,null));}; \ No newline at end of file +var _0x6736=['show','params','find','catch','create','body','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','updatedAt','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','getHoppers','findOne','CmHopper','sort','CampaignId','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','CmList','ids','spread','dialCheckDuplicateType','always','fromQuery','phone','scheduledAt','ListId','select','field','NOW()','ContactId','CmListId','toString','from','cm_contacts','deletedAt\x20IS\x20NULL','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','cm_hopper','CampaignId\x20=\x20?','insert','COALESCE(phone,\x27\x27)','into','ListId\x20=\x20?','push','sequelize','all','removeLists','getBlackLists','addBlackLists','cm_hopper_black','removeBlackLists','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','apply','reject','save','then','destroy','get','IvrCampaigns','UserProfileResource','error','stack','name','send','index','map','Campaign','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows'];(function(_0x53d172,_0x46611b){var _0x1bd0a2=function(_0x19fb52){while(--_0x19fb52){_0x53d172['push'](_0x53d172['shift']());}};_0x1bd0a2(++_0x46611b);}(_0x6736,0x1d6));var _0x6673=function(_0x5c7f9d,_0x30c84c){_0x5c7f9d=_0x5c7f9d-0x0;var _0x144822=_0x6736[_0x5c7f9d];return _0x144822;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6673('0x0'));var zipdir=require(_0x6673('0x1'));var jsonpatch=require(_0x6673('0x2'));var rp=require(_0x6673('0x3'));var moment=require(_0x6673('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x6673('0x5'));var util=require('util');var path=require(_0x6673('0x6'));var sox=require('sox');var csv=require(_0x6673('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6673('0x8'));var _=require(_0x6673('0x9'));var squel=require(_0x6673('0xa'));var crypto=require(_0x6673('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x6673('0xc'));var toCsv=require(_0x6673('0x7'));var querystring=require(_0x6673('0xd'));var Papa=require(_0x6673('0xe'));var Redis=require(_0x6673('0xf'));var authService=require(_0x6673('0x10'));var qs=require(_0x6673('0x11'));var as=require(_0x6673('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x6673('0x13'))(_0x6673('0x14'));var utils=require(_0x6673('0x15'));var config=require(_0x6673('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x6673('0x17'))['db'];function respondWithStatusCode(_0x1b9fc3,_0x4eb153){_0x4eb153=_0x4eb153||0xcc;return function(_0x182fac){if(_0x182fac){return _0x1b9fc3[_0x6673('0x18')](_0x4eb153);}return _0x1b9fc3[_0x6673('0x19')](_0x4eb153)[_0x6673('0x1a')]();};}function respondWithResult(_0x46e8e3,_0xa833ec){_0xa833ec=_0xa833ec||0xc8;return function(_0x4619ad){if(_0x4619ad){return _0x46e8e3[_0x6673('0x19')](_0xa833ec)[_0x6673('0x1b')](_0x4619ad);}};}function respondWithFilteredResult(_0x4e84de,_0x434c97){return function(_0x51853e){if(_0x51853e){var _0x3b3a23=typeof _0x434c97[_0x6673('0x1c')]===_0x6673('0x1d')&&typeof _0x434c97['limit']===_0x6673('0x1d');var _0x569149=_0x51853e[_0x6673('0x1e')];var _0x1ddd8a=_0x3b3a23?0x0:_0x434c97[_0x6673('0x1c')];var _0x32ed6c=_0x3b3a23?_0x51853e[_0x6673('0x1e')]:_0x434c97[_0x6673('0x1c')]+_0x434c97['limit'];var _0x29a5a8;if(_0x32ed6c>=_0x569149){_0x32ed6c=_0x569149;_0x29a5a8=0xc8;}else{_0x29a5a8=0xce;}_0x4e84de['status'](_0x29a5a8);return _0x4e84de[_0x6673('0x1f')](_0x6673('0x20'),_0x1ddd8a+'-'+_0x32ed6c+'/'+_0x569149)[_0x6673('0x1b')](_0x51853e);}return null;};}function patchUpdates(_0x100039){return function(_0x43212b){try{jsonpatch[_0x6673('0x21')](_0x43212b,_0x100039,!![]);}catch(_0x5653db){return BPromise[_0x6673('0x22')](_0x5653db);}return _0x43212b[_0x6673('0x23')]();};}function saveUpdates(_0x106f66,_0x1efd8f){return function(_0x2a5e3b){if(_0x2a5e3b){return _0x2a5e3b['update'](_0x106f66)[_0x6673('0x24')](function(_0x216367){return _0x216367;});}return null;};}function removeEntity(_0x583a2d,_0x459090){return function(_0x209a72){if(_0x209a72){return _0x209a72[_0x6673('0x25')]()[_0x6673('0x24')](function(){var _0x111cc9=_0x209a72[_0x6673('0x26')]({'plain':!![]});var _0x5daf73=_0x6673('0x27');return db[_0x6673('0x28')][_0x6673('0x25')]({'where':{'type':_0x5daf73,'resourceId':_0x111cc9['id']}})[_0x6673('0x24')](function(){return _0x209a72;});})[_0x6673('0x24')](function(){_0x583a2d[_0x6673('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x459bbf,_0x41189f){return function(_0xae5d98){if(!_0xae5d98){_0x459bbf[_0x6673('0x18')](0x194);}return _0xae5d98;};}function handleError(_0x46b4ff,_0x33cddf){_0x33cddf=_0x33cddf||0x1f4;return function(_0x4f7d93){logger[_0x6673('0x29')](_0x4f7d93[_0x6673('0x2a')]);if(_0x4f7d93['name']){delete _0x4f7d93[_0x6673('0x2b')];}_0x46b4ff['status'](_0x33cddf)[_0x6673('0x2c')](_0x4f7d93);};}exports[_0x6673('0x2d')]=function(_0x19e0de,_0x49545a){var _0x1c75e2={},_0x172747={},_0x3aa365={'count':0x0,'rows':[]};var _0x9d51c2=_[_0x6673('0x2e')](db[_0x6673('0x2f')][_0x6673('0x30')],function(_0x4b7a77){return{'name':_0x4b7a77[_0x6673('0x31')],'type':_0x4b7a77[_0x6673('0x32')][_0x6673('0x33')]};});_0x172747[_0x6673('0x34')]=_[_0x6673('0x2e')](_0x9d51c2,_0x6673('0x2b'));_0x172747[_0x6673('0x35')]=_[_0x6673('0x36')](_0x19e0de[_0x6673('0x35')]);_0x172747['filters']=_[_0x6673('0x37')](_0x172747[_0x6673('0x34')],_0x172747[_0x6673('0x35')]);_0x1c75e2[_0x6673('0x38')]=_[_0x6673('0x37')](_0x172747[_0x6673('0x34')],qs[_0x6673('0x39')](_0x19e0de[_0x6673('0x35')][_0x6673('0x39')]));_0x1c75e2[_0x6673('0x38')]=_0x1c75e2['attributes'][_0x6673('0x3a')]?_0x1c75e2[_0x6673('0x38')]:_0x172747[_0x6673('0x34')];if(!_0x19e0de[_0x6673('0x35')][_0x6673('0x3b')](_0x6673('0x3c'))){_0x1c75e2['limit']=qs[_0x6673('0x3d')](_0x19e0de['query'][_0x6673('0x3d')]);_0x1c75e2[_0x6673('0x1c')]=qs[_0x6673('0x1c')](_0x19e0de['query'][_0x6673('0x1c')]);}_0x1c75e2[_0x6673('0x3e')]=qs['sort'](_0x19e0de['query']['sort']);_0x1c75e2[_0x6673('0x3f')]=qs[_0x6673('0x40')](_[_0x6673('0x41')](_0x19e0de[_0x6673('0x35')],_0x172747[_0x6673('0x40')]),_0x9d51c2);if(_0x19e0de[_0x6673('0x35')][_0x6673('0x42')]){_0x1c75e2[_0x6673('0x3f')]=_[_0x6673('0x43')](_0x1c75e2[_0x6673('0x3f')],{'$or':_[_0x6673('0x2e')](_0x9d51c2,function(_0x18f863){if(_0x18f863[_0x6673('0x32')]!==_0x6673('0x44')){var _0xe00bc5={};_0xe00bc5[_0x18f863[_0x6673('0x2b')]]={'$like':'%'+_0x19e0de[_0x6673('0x35')][_0x6673('0x42')]+'%'};return _0xe00bc5;}})});}_0x1c75e2=_[_0x6673('0x43')]({},_0x1c75e2,_0x19e0de[_0x6673('0x45')]);var _0x356f4f={'where':_0x1c75e2[_0x6673('0x3f')]};return db[_0x6673('0x2f')][_0x6673('0x1e')](_0x356f4f)[_0x6673('0x24')](function(_0x3254f7){_0x3aa365['count']=_0x3254f7;if(_0x19e0de[_0x6673('0x35')][_0x6673('0x46')]){_0x1c75e2[_0x6673('0x47')]=[{'all':!![]}];}return db['Campaign'][_0x6673('0x48')](_0x1c75e2);})[_0x6673('0x24')](function(_0x37bd1f){_0x3aa365[_0x6673('0x49')]=_0x37bd1f;return _0x3aa365;})[_0x6673('0x24')](respondWithFilteredResult(_0x49545a,_0x1c75e2))['catch'](handleError(_0x49545a,null));};exports[_0x6673('0x4a')]=function(_0x390deb,_0x590c01){var _0x1fe834={'raw':![],'where':{'id':_0x390deb[_0x6673('0x4b')]['id']}},_0x47414a={};_0x47414a['model']=_[_0x6673('0x36')](db[_0x6673('0x2f')][_0x6673('0x30')]);_0x47414a['query']=_['keys'](_0x390deb[_0x6673('0x35')]);_0x47414a['filters']=_['intersection'](_0x47414a[_0x6673('0x34')],_0x47414a[_0x6673('0x35')]);_0x1fe834[_0x6673('0x38')]=_[_0x6673('0x37')](_0x47414a['model'],qs[_0x6673('0x39')](_0x390deb['query']['fields']));_0x1fe834[_0x6673('0x38')]=_0x1fe834[_0x6673('0x38')]['length']?_0x1fe834[_0x6673('0x38')]:_0x47414a['model'];if(_0x390deb['query'][_0x6673('0x46')]){_0x1fe834['include']=[{'all':!![]}];}_0x1fe834=_[_0x6673('0x43')]({},_0x1fe834,_0x390deb[_0x6673('0x45')]);return db['Campaign'][_0x6673('0x4c')](_0x1fe834)['then'](handleEntityNotFound(_0x590c01,null))['then'](respondWithResult(_0x590c01,null))[_0x6673('0x4d')](handleError(_0x590c01,null));};exports['create']=function(_0x288486,_0x1b20f0){return db[_0x6673('0x2f')][_0x6673('0x4e')](_0x288486[_0x6673('0x4f')],{})[_0x6673('0x24')](function(_0x315431){var _0x8f3181=_0x288486['user'][_0x6673('0x26')]({'plain':!![]});if(!_0x8f3181)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x8f3181[_0x6673('0x50')]==='user'){var _0x307926=_0x315431[_0x6673('0x26')]({'plain':!![]});var _0xfa5393=_0x6673('0x27');return db[_0x6673('0x51')][_0x6673('0x4c')]({'where':{'name':_0xfa5393,'userProfileId':_0x8f3181[_0x6673('0x52')]},'raw':!![]})[_0x6673('0x24')](function(_0x5449b0){if(_0x5449b0&&_0x5449b0[_0x6673('0x53')]===0x0){return db[_0x6673('0x28')][_0x6673('0x4e')]({'name':_0x307926[_0x6673('0x2b')],'resourceId':_0x307926['id'],'type':_0x5449b0[_0x6673('0x2b')],'sectionId':_0x5449b0['id']},{})[_0x6673('0x24')](function(){return _0x315431;});}else{return _0x315431;}})[_0x6673('0x4d')](function(_0x49ece8){logger[_0x6673('0x29')](_0x6673('0x54'),_0x49ece8);throw _0x49ece8;});}return _0x315431;})[_0x6673('0x24')](respondWithResult(_0x1b20f0,0xc9))[_0x6673('0x4d')](handleError(_0x1b20f0,null));};exports[_0x6673('0x55')]=function(_0x56856e,_0x36733e){var _0x376f49={'where':{'id':_0x56856e[_0x6673('0x4b')]['id']}},_0xe79030={};_0xe79030[_0x6673('0x34')]=_[_0x6673('0x36')](db[_0x6673('0x2f')]['rawAttributes']);_0x376f49['attributes']=_[_0x6673('0x37')](_0xe79030[_0x6673('0x34')],qs['fields'](_0x56856e[_0x6673('0x35')][_0x6673('0x39')]));_0x376f49['attributes']=_0x376f49['attributes']['length']?_0x376f49[_0x6673('0x38')]:_0xe79030[_0x6673('0x34')];if(_0x56856e['query'][_0x6673('0x46')]){_0x376f49[_0x6673('0x47')]=[{'all':!![]}];}_0x376f49=_[_0x6673('0x43')]({},_0x376f49,_0x56856e[_0x6673('0x45')]);return db['Campaign'][_0x6673('0x4c')](_0x376f49)['then'](handleEntityNotFound(_0x36733e,null))[_0x6673('0x24')](function(_0xba20f6){if(_0xba20f6){var _0x9d6ba0=_0xba20f6[_0x6673('0x26')]({'plain':!![]});_0x9d6ba0=qs[_0x6673('0x56')](_0x9d6ba0,['id',_0x6673('0x57'),_0x6673('0x58')]);_0x56856e['body']=_[_0x6673('0x56')](_0x56856e[_0x6673('0x4f')],['id',_0x6673('0x57'),_0x6673('0x58')]);return db[_0x6673('0x2f')][_0x6673('0x4e')](_[_0x6673('0x43')](_0x9d6ba0,_0x56856e['body']),{'include':_0x56856e[_0x6673('0x35')][_0x6673('0x46')]?[{'all':!![]}]:undefined})[_0x6673('0x24')](function(_0x5250ab){var _0x587f82=_0x56856e[_0x6673('0x59')][_0x6673('0x26')]({'plain':!![]});if(!_0x587f82)throw new Error(_0x6673('0x5a'));if(_0x587f82['role']===_0x6673('0x59')){var _0x21998d=_0x5250ab['get']({'plain':!![]});var _0x3d450b=_0x6673('0x27');return db[_0x6673('0x51')][_0x6673('0x4c')]({'where':{'name':_0x3d450b,'userProfileId':_0x587f82['userProfileId']},'raw':!![]})[_0x6673('0x24')](function(_0x3a89a2){if(_0x3a89a2&&_0x3a89a2[_0x6673('0x53')]===0x0){return db[_0x6673('0x28')][_0x6673('0x4e')]({'name':_0x21998d[_0x6673('0x2b')],'resourceId':_0x21998d['id'],'type':_0x3a89a2[_0x6673('0x2b')],'sectionId':_0x3a89a2['id']},{})['then'](function(){return _0x5250ab;});}else{return _0x5250ab;}})[_0x6673('0x4d')](function(_0x28a91b){logger[_0x6673('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x28a91b);throw _0x28a91b;});}return _0x5250ab;});}})[_0x6673('0x24')](respondWithResult(_0x36733e,0xc9))[_0x6673('0x4d')](handleError(_0x36733e,null));};exports['update']=function(_0x213bcc,_0x4a869f){if(_0x213bcc[_0x6673('0x4f')]['id']){delete _0x213bcc['body']['id'];}return db[_0x6673('0x2f')][_0x6673('0x4c')]({'where':{'id':_0x213bcc[_0x6673('0x4b')]['id']}})['then'](handleEntityNotFound(_0x4a869f,null))['then'](saveUpdates(_0x213bcc['body'],null))['then'](respondWithResult(_0x4a869f,null))[_0x6673('0x4d')](handleError(_0x4a869f,null));};exports[_0x6673('0x25')]=function(_0x3cf07f,_0x56fc7b){return db[_0x6673('0x2f')]['find']({'where':{'id':_0x3cf07f[_0x6673('0x4b')]['id']}})[_0x6673('0x24')](handleEntityNotFound(_0x56fc7b,null))['then'](removeEntity(_0x56fc7b,null))[_0x6673('0x4d')](handleError(_0x56fc7b,null));};exports[_0x6673('0x5b')]=function(_0x1fb934,_0x3597e0,_0x30831c){var _0xebb888={'raw':!![],'where':{}};var _0x4ee105={};var _0x112be4={'count':0x0,'rows':[]};return db['Campaign'][_0x6673('0x5c')]({'where':{'id':_0x1fb934[_0x6673('0x4b')]['id']}})['then'](handleEntityNotFound(_0x3597e0,null))[_0x6673('0x24')](function(_0xb229a9){if(_0xb229a9){_0x4ee105['model']=_[_0x6673('0x36')](db[_0x6673('0x5d')][_0x6673('0x30')]);_0x4ee105[_0x6673('0x35')]=_[_0x6673('0x36')](_0x1fb934[_0x6673('0x35')]);_0x4ee105[_0x6673('0x40')]=_[_0x6673('0x37')](_0x4ee105[_0x6673('0x34')],_0x4ee105[_0x6673('0x35')]);_0xebb888[_0x6673('0x38')]=_[_0x6673('0x37')](_0x4ee105[_0x6673('0x34')],qs[_0x6673('0x39')](_0x1fb934[_0x6673('0x35')][_0x6673('0x39')]));_0xebb888['attributes']=_0xebb888[_0x6673('0x38')][_0x6673('0x3a')]?_0xebb888[_0x6673('0x38')]:_0x4ee105[_0x6673('0x34')];if(!_0x1fb934[_0x6673('0x35')][_0x6673('0x3b')](_0x6673('0x3c'))){_0xebb888[_0x6673('0x3d')]=qs[_0x6673('0x3d')](_0x1fb934[_0x6673('0x35')][_0x6673('0x3d')]);_0xebb888[_0x6673('0x1c')]=qs[_0x6673('0x1c')](_0x1fb934[_0x6673('0x35')][_0x6673('0x1c')]);}_0xebb888[_0x6673('0x3e')]=qs[_0x6673('0x5e')](_0x1fb934[_0x6673('0x35')][_0x6673('0x5e')]);_0xebb888[_0x6673('0x3f')]=qs['filters'](_[_0x6673('0x41')](_0x1fb934[_0x6673('0x35')],_0x4ee105['filters']));_0xebb888[_0x6673('0x3f')][_0x6673('0x5f')]=_0xb229a9['id'];if(_0x1fb934['query'][_0x6673('0x42')]){_0xebb888[_0x6673('0x3f')]=_[_0x6673('0x43')](_0xebb888[_0x6673('0x3f')],{'$or':_[_0x6673('0x2e')](_0xebb888[_0x6673('0x38')],function(_0x43c96a){var _0x3e8a13={};_0x3e8a13[_0x43c96a]={'$like':'%'+_0x1fb934['query'][_0x6673('0x42')]+'%'};return _0x3e8a13;})});}_0xebb888=_[_0x6673('0x43')]({},_0xebb888,_0x1fb934['options']);return db[_0x6673('0x5d')][_0x6673('0x1e')]({'where':_0xebb888[_0x6673('0x3f')]})['then'](function(_0x16b45d){_0x112be4['count']=_0x16b45d;if(_0x1fb934[_0x6673('0x35')][_0x6673('0x46')]){_0xebb888['include']=[{'all':!![]}];}return db[_0x6673('0x5d')][_0x6673('0x48')](_0xebb888);})[_0x6673('0x24')](function(_0x4e45e7){_0x112be4['rows']=_0x4e45e7;return _0x112be4;});}})[_0x6673('0x24')](respondWithFilteredResult(_0x3597e0,_0xebb888))[_0x6673('0x4d')](handleError(_0x3597e0,null));};exports['getHopperHistories']=function(_0x20066f,_0x1d46da,_0x3e212f){var _0x53f1e5={'raw':!![],'where':{}};var _0xa4560a={};var _0x553ae7={'count':0x0,'rows':[]};return db[_0x6673('0x2f')][_0x6673('0x5c')]({'where':{'id':_0x20066f[_0x6673('0x4b')]['id']}})['then'](handleEntityNotFound(_0x1d46da,null))['then'](function(_0xc39a5e){if(_0xc39a5e){_0xa4560a[_0x6673('0x34')]=_[_0x6673('0x36')](db[_0x6673('0x60')]['rawAttributes']);_0xa4560a[_0x6673('0x35')]=_['keys'](_0x20066f['query']);_0xa4560a[_0x6673('0x40')]=_['intersection'](_0xa4560a[_0x6673('0x34')],_0xa4560a[_0x6673('0x35')]);_0x53f1e5[_0x6673('0x38')]=_[_0x6673('0x37')](_0xa4560a['model'],qs[_0x6673('0x39')](_0x20066f['query']['fields']));_0x53f1e5[_0x6673('0x38')]=_0x53f1e5[_0x6673('0x38')][_0x6673('0x3a')]?_0x53f1e5[_0x6673('0x38')]:_0xa4560a[_0x6673('0x34')];if(!_0x20066f[_0x6673('0x35')][_0x6673('0x3b')](_0x6673('0x3c'))){_0x53f1e5[_0x6673('0x3d')]=qs[_0x6673('0x3d')](_0x20066f[_0x6673('0x35')]['limit']);_0x53f1e5[_0x6673('0x1c')]=qs['offset'](_0x20066f[_0x6673('0x35')][_0x6673('0x1c')]);}_0x53f1e5['order']=qs[_0x6673('0x5e')](_0x20066f[_0x6673('0x35')]['sort']);_0x53f1e5[_0x6673('0x3f')]=qs[_0x6673('0x40')](_[_0x6673('0x41')](_0x20066f['query'],_0xa4560a[_0x6673('0x40')]));_0x53f1e5[_0x6673('0x3f')][_0x6673('0x5f')]=_0xc39a5e['id'];if(_0x20066f[_0x6673('0x35')]['filter']){_0x53f1e5[_0x6673('0x3f')]=_[_0x6673('0x43')](_0x53f1e5['where'],{'$or':_[_0x6673('0x2e')](_0x53f1e5[_0x6673('0x38')],function(_0x281079){var _0x1a088a={};_0x1a088a[_0x281079]={'$like':'%'+_0x20066f[_0x6673('0x35')][_0x6673('0x42')]+'%'};return _0x1a088a;})});}_0x53f1e5=_[_0x6673('0x43')]({},_0x53f1e5,_0x20066f[_0x6673('0x45')]);return db[_0x6673('0x60')][_0x6673('0x1e')]({'where':_0x53f1e5[_0x6673('0x3f')]})[_0x6673('0x24')](function(_0x212196){_0x553ae7[_0x6673('0x1e')]=_0x212196;if(_0x20066f['query'][_0x6673('0x46')]){_0x53f1e5[_0x6673('0x47')]=[{'all':!![]}];}return db['CmHopperHistory'][_0x6673('0x48')](_0x53f1e5);})[_0x6673('0x24')](function(_0x22bc19){_0x553ae7[_0x6673('0x49')]=_0x22bc19;return _0x553ae7;});}})['then'](respondWithFilteredResult(_0x1d46da,_0x53f1e5))[_0x6673('0x4d')](handleError(_0x1d46da,null));};exports[_0x6673('0x61')]=function(_0x27f78d,_0x5087ed,_0x38e164){var _0x44725d={'raw':!![],'where':{}};var _0x35f152={};var _0x3131d3={'count':0x0,'rows':[]};return db[_0x6673('0x2f')][_0x6673('0x5c')]({'where':{'id':_0x27f78d[_0x6673('0x4b')]['id']}})[_0x6673('0x24')](handleEntityNotFound(_0x5087ed,null))['then'](function(_0xef0de9){if(_0xef0de9){_0x35f152[_0x6673('0x34')]=_[_0x6673('0x36')](db[_0x6673('0x62')][_0x6673('0x30')]);_0x35f152[_0x6673('0x35')]=_[_0x6673('0x36')](_0x27f78d[_0x6673('0x35')]);_0x35f152[_0x6673('0x40')]=_[_0x6673('0x37')](_0x35f152['model'],_0x35f152[_0x6673('0x35')]);_0x44725d['attributes']=_[_0x6673('0x37')](_0x35f152[_0x6673('0x34')],qs[_0x6673('0x39')](_0x27f78d[_0x6673('0x35')][_0x6673('0x39')]));_0x44725d[_0x6673('0x38')]=_0x44725d[_0x6673('0x38')][_0x6673('0x3a')]?_0x44725d['attributes']:_0x35f152[_0x6673('0x34')];if(!_0x27f78d[_0x6673('0x35')]['hasOwnProperty'](_0x6673('0x3c'))){_0x44725d[_0x6673('0x3d')]=qs['limit'](_0x27f78d[_0x6673('0x35')][_0x6673('0x3d')]);_0x44725d[_0x6673('0x1c')]=qs[_0x6673('0x1c')](_0x27f78d['query'][_0x6673('0x1c')]);}_0x44725d['order']=qs[_0x6673('0x5e')](_0x27f78d[_0x6673('0x35')][_0x6673('0x5e')]);_0x44725d[_0x6673('0x3f')]=qs[_0x6673('0x40')](_[_0x6673('0x41')](_0x27f78d[_0x6673('0x35')],_0x35f152[_0x6673('0x40')]));_0x44725d[_0x6673('0x3f')][_0x6673('0x5f')]=_0xef0de9['id'];if(_0x27f78d[_0x6673('0x35')]['filter']){_0x44725d[_0x6673('0x3f')]=_[_0x6673('0x43')](_0x44725d['where'],{'$or':_['map'](_0x44725d['attributes'],function(_0x4a08d0){var _0x3c22ee={};_0x3c22ee[_0x4a08d0]={'$like':'%'+_0x27f78d['query'][_0x6673('0x42')]+'%'};return _0x3c22ee;})});}_0x44725d=_['merge']({},_0x44725d,_0x27f78d[_0x6673('0x45')]);return db[_0x6673('0x62')][_0x6673('0x1e')]({'where':_0x44725d[_0x6673('0x3f')]})[_0x6673('0x24')](function(_0xbf91a5){_0x3131d3[_0x6673('0x1e')]=_0xbf91a5;if(_0x27f78d[_0x6673('0x35')]['includeAll']){_0x44725d[_0x6673('0x47')]=[{'all':!![]}];}return db[_0x6673('0x62')][_0x6673('0x48')](_0x44725d);})['then'](function(_0xd1f64a){_0x3131d3[_0x6673('0x49')]=_0xd1f64a;return _0x3131d3;});}})[_0x6673('0x24')](respondWithFilteredResult(_0x5087ed,_0x44725d))[_0x6673('0x4d')](handleError(_0x5087ed,null));};exports[_0x6673('0x63')]=function(_0x4cec7e,_0x26723b,_0x535ba8){var _0x69e093={'raw':!![],'where':{}};var _0x2e0ebf={};var _0x219892={'count':0x0,'rows':[]};return db['Campaign']['findOne']({'where':{'id':_0x4cec7e[_0x6673('0x4b')]['id']}})[_0x6673('0x24')](handleEntityNotFound(_0x26723b,null))['then'](function(_0x3e35fe){if(_0x3e35fe){_0x2e0ebf[_0x6673('0x34')]=_[_0x6673('0x36')](db[_0x6673('0x64')][_0x6673('0x30')]);_0x2e0ebf[_0x6673('0x35')]=_[_0x6673('0x36')](_0x4cec7e[_0x6673('0x35')]);_0x2e0ebf['filters']=_[_0x6673('0x37')](_0x2e0ebf[_0x6673('0x34')],_0x2e0ebf[_0x6673('0x35')]);_0x69e093[_0x6673('0x38')]=_[_0x6673('0x37')](_0x2e0ebf[_0x6673('0x34')],qs[_0x6673('0x39')](_0x4cec7e['query']['fields']));_0x69e093['attributes']=_0x69e093[_0x6673('0x38')][_0x6673('0x3a')]?_0x69e093[_0x6673('0x38')]:_0x2e0ebf[_0x6673('0x34')];if(!_0x4cec7e['query'][_0x6673('0x3b')](_0x6673('0x3c'))){_0x69e093[_0x6673('0x3d')]=qs[_0x6673('0x3d')](_0x4cec7e[_0x6673('0x35')][_0x6673('0x3d')]);_0x69e093[_0x6673('0x1c')]=qs[_0x6673('0x1c')](_0x4cec7e[_0x6673('0x35')][_0x6673('0x1c')]);}_0x69e093['order']=qs[_0x6673('0x5e')](_0x4cec7e[_0x6673('0x35')][_0x6673('0x5e')]);_0x69e093['where']=qs[_0x6673('0x40')](_['pick'](_0x4cec7e[_0x6673('0x35')],_0x2e0ebf[_0x6673('0x40')]));_0x69e093[_0x6673('0x3f')][_0x6673('0x5f')]=_0x3e35fe['id'];if(_0x4cec7e['query']['filter']){_0x69e093['where']=_[_0x6673('0x43')](_0x69e093[_0x6673('0x3f')],{'$or':_[_0x6673('0x2e')](_0x69e093[_0x6673('0x38')],function(_0x293c58){var _0x389468={};_0x389468[_0x293c58]={'$like':'%'+_0x4cec7e['query'][_0x6673('0x42')]+'%'};return _0x389468;})});}_0x69e093=_[_0x6673('0x43')]({},_0x69e093,_0x4cec7e[_0x6673('0x45')]);return db['CmHopperBlack']['count']({'where':_0x69e093['where']})[_0x6673('0x24')](function(_0x420c87){_0x219892[_0x6673('0x1e')]=_0x420c87;if(_0x4cec7e[_0x6673('0x35')][_0x6673('0x46')]){_0x69e093[_0x6673('0x47')]=[{'all':!![]}];}return db[_0x6673('0x64')][_0x6673('0x48')](_0x69e093);})[_0x6673('0x24')](function(_0x566bf5){_0x219892[_0x6673('0x49')]=_0x566bf5;return _0x219892;});}})[_0x6673('0x24')](respondWithFilteredResult(_0x26723b,_0x69e093))[_0x6673('0x4d')](handleError(_0x26723b,null));};exports[_0x6673('0x65')]=function(_0x35a7fe,_0x10d3ce,_0x369965){var _0x2fd171={};var _0x541ff5={};var _0x570fcb;var _0x53a5c4;return db[_0x6673('0x2f')]['findOne']({'where':{'id':_0x35a7fe[_0x6673('0x4b')]['id']}})[_0x6673('0x24')](handleEntityNotFound(_0x10d3ce,null))['then'](function(_0x546415){if(_0x546415){_0x570fcb=_0x546415;_0x541ff5[_0x6673('0x34')]=_['keys'](db[_0x6673('0x66')]['rawAttributes']);_0x541ff5[_0x6673('0x35')]=_[_0x6673('0x36')](_0x35a7fe['query']);_0x541ff5[_0x6673('0x40')]=_[_0x6673('0x37')](_0x541ff5[_0x6673('0x34')],_0x541ff5[_0x6673('0x35')]);_0x2fd171[_0x6673('0x38')]=_['intersection'](_0x541ff5['model'],qs[_0x6673('0x39')](_0x35a7fe[_0x6673('0x35')][_0x6673('0x39')]));_0x2fd171[_0x6673('0x38')]=_0x2fd171['attributes'][_0x6673('0x3a')]?_0x2fd171[_0x6673('0x38')]:_0x541ff5[_0x6673('0x34')];_0x2fd171[_0x6673('0x3e')]=qs['sort'](_0x35a7fe['query'][_0x6673('0x5e')]);_0x2fd171[_0x6673('0x3f')]=qs[_0x6673('0x40')](_[_0x6673('0x41')](_0x35a7fe['query'],_0x541ff5['filters']));if(_0x35a7fe[_0x6673('0x35')]['filter']){_0x2fd171[_0x6673('0x3f')]=_['merge'](_0x2fd171[_0x6673('0x3f')],{'$or':_[_0x6673('0x2e')](_0x2fd171[_0x6673('0x38')],function(_0x149244){var _0x47d19b={};_0x47d19b[_0x149244]={'$like':'%'+_0x35a7fe[_0x6673('0x35')][_0x6673('0x42')]+'%'};return _0x47d19b;})});}_0x2fd171=_[_0x6673('0x43')]({},_0x2fd171,_0x35a7fe['options']);return _0x570fcb['getLists'](_0x2fd171);}})[_0x6673('0x24')](function(_0x533f73){if(_0x533f73){_0x53a5c4=_0x533f73[_0x6673('0x3a')];if(!_0x35a7fe[_0x6673('0x35')][_0x6673('0x3b')](_0x6673('0x3c'))){_0x2fd171['limit']=qs[_0x6673('0x3d')](_0x35a7fe['query']['limit']);_0x2fd171['offset']=qs[_0x6673('0x1c')](_0x35a7fe[_0x6673('0x35')][_0x6673('0x1c')]);}return _0x570fcb[_0x6673('0x65')](_0x2fd171);}})[_0x6673('0x24')](function(_0x451c25){if(_0x451c25){return _0x451c25?{'count':_0x53a5c4,'rows':_0x451c25}:null;}})[_0x6673('0x24')](respondWithResult(_0x10d3ce,null))[_0x6673('0x4d')](handleError(_0x10d3ce,null));};exports['addLists']=function(_0x8d36f5,_0x242fd2,_0x59fadd){var _0x3de842,_0xb6c691;return db['Campaign']['find']({'where':{'id':_0x8d36f5[_0x6673('0x4b')]['id']}})['then'](handleEntityNotFound(_0x242fd2,null))[_0x6673('0x24')](function(_0x50732a){if(_0x50732a){_0xb6c691=_0x50732a;return _0x50732a['addLists'](_0x8d36f5[_0x6673('0x4f')][_0x6673('0x67')],_[_0x6673('0x56')](_0x8d36f5[_0x6673('0x4f')],[_0x6673('0x67'),'id'])||{});}return null;})[_0x6673('0x68')](function(_0x1fd9cc){var _0xb20a6b;_0x3de842=_0x1fd9cc||[];var _0x1fcd9e=[];if(_0x1fd9cc){for(var _0x3c8d76=0x0;_0x3c8d76<_0x1fd9cc[_0x6673('0x3a')];_0x3c8d76+=0x1){var _0x56f150=_0x1fd9cc[_0x3c8d76][_0x6673('0x26')]({'plain':!![]});_0xb6c691['dialCheckDuplicateType']=_0x8d36f5[_0x6673('0x4f')][_0x6673('0x69')]?_0x8d36f5[_0x6673('0x4f')][_0x6673('0x69')]:_0xb6c691['dialCheckDuplicateType'];switch(_0xb6c691[_0x6673('0x69')]){case _0x6673('0x6a'):_0xb20a6b=squel['insert']()['into']('cm_hopper')[_0x6673('0x6b')]([_0x6673('0x6c'),_0x6673('0x6d'),'ContactId',_0x6673('0x6e'),_0x6673('0x5f'),'createdAt',_0x6673('0x58')],squel[_0x6673('0x6f')]()[_0x6673('0x70')](_0x6673('0x6c'),_0x6673('0x6c'))['field'](_0x6673('0x71'),_0x6673('0x6d'))[_0x6673('0x70')]('id',_0x6673('0x72'))['field'](_0x56f150[_0x6673('0x73')][_0x6673('0x74')](),_0x6673('0x6e'))[_0x6673('0x70')](_0x8d36f5[_0x6673('0x4b')]['id'][_0x6673('0x74')](),_0x6673('0x5f'))[_0x6673('0x70')](_0x6673('0x71'),'createdAt')[_0x6673('0x70')]('NOW()',_0x6673('0x58'))[_0x6673('0x75')](_0x6673('0x76'))[_0x6673('0x3f')](_0x6673('0x77'))['where']('ListId\x20=\x20?',_0x56f150[_0x6673('0x73')]['toString']())['where'](_0x6673('0x78'))[_0x6673('0x3f')](_0x6673('0x79'),squel[_0x6673('0x6f')]()[_0x6673('0x70')]('COALESCE(calleridnum,\x27\x27)')[_0x6673('0x75')]('cm_hopper_final')[_0x6673('0x3f')]('CampaignId\x20=\x20?',_0x8d36f5[_0x6673('0x4b')]['id'][_0x6673('0x74')]()))[_0x6673('0x3f')](_0x6673('0x79'),squel[_0x6673('0x6f')]()[_0x6673('0x70')]('COALESCE(phone,\x27\x27)')[_0x6673('0x75')](_0x6673('0x7a'))[_0x6673('0x3f')](_0x6673('0x7b'),_0x8d36f5[_0x6673('0x4b')]['id'][_0x6673('0x74')]())))[_0x6673('0x74')]();break;case'onlyIfOpen':_0xb20a6b=squel[_0x6673('0x7c')]()['into']('cm_hopper')[_0x6673('0x6b')]([_0x6673('0x6c'),_0x6673('0x6d'),_0x6673('0x72'),'ListId',_0x6673('0x5f'),_0x6673('0x57'),_0x6673('0x58')],squel[_0x6673('0x6f')]()[_0x6673('0x70')](_0x6673('0x6c'),_0x6673('0x6c'))[_0x6673('0x70')](_0x6673('0x71'),_0x6673('0x6d'))[_0x6673('0x70')]('id',_0x6673('0x72'))[_0x6673('0x70')](_0x56f150['CmListId'][_0x6673('0x74')](),_0x6673('0x6e'))[_0x6673('0x70')](_0x8d36f5[_0x6673('0x4b')]['id']['toString'](),'CampaignId')[_0x6673('0x70')](_0x6673('0x71'),_0x6673('0x57'))[_0x6673('0x70')](_0x6673('0x71'),'updatedAt')[_0x6673('0x75')](_0x6673('0x76'))[_0x6673('0x3f')](_0x6673('0x77'))[_0x6673('0x3f')]('ListId\x20=\x20?',_0x56f150['CmListId'][_0x6673('0x74')]())['where'](_0x6673('0x78'))[_0x6673('0x3f')](_0x6673('0x79'),squel[_0x6673('0x6f')]()[_0x6673('0x70')](_0x6673('0x7d'))[_0x6673('0x75')]('cm_hopper')[_0x6673('0x3f')](_0x6673('0x7b'),_0x8d36f5[_0x6673('0x4b')]['id'][_0x6673('0x74')]())))['toString']();break;default:_0xb20a6b=squel[_0x6673('0x7c')]()[_0x6673('0x7e')](_0x6673('0x7a'))[_0x6673('0x6b')]([_0x6673('0x6c'),'scheduledAt',_0x6673('0x72'),'ListId',_0x6673('0x5f'),_0x6673('0x57'),_0x6673('0x58')],squel['select']()['field'](_0x6673('0x6c'),'phone')[_0x6673('0x70')](_0x6673('0x71'),_0x6673('0x6d'))[_0x6673('0x70')]('id',_0x6673('0x72'))[_0x6673('0x70')](_0x56f150[_0x6673('0x73')][_0x6673('0x74')](),_0x6673('0x6e'))[_0x6673('0x70')](_0x8d36f5[_0x6673('0x4b')]['id'][_0x6673('0x74')](),_0x6673('0x5f'))['field'](_0x6673('0x71'),_0x6673('0x57'))['field'](_0x6673('0x71'),_0x6673('0x58'))[_0x6673('0x75')](_0x6673('0x76'))[_0x6673('0x3f')]('deletedAt\x20IS\x20NULL')[_0x6673('0x3f')](_0x6673('0x7f'),_0x56f150['CmListId'][_0x6673('0x74')]())[_0x6673('0x3f')](_0x6673('0x78')))[_0x6673('0x74')]();}_0x1fcd9e[_0x6673('0x80')](db[_0x6673('0x81')]['query'](_0xb20a6b));}return BPromise[_0x6673('0x82')](_0x1fcd9e);}})[_0x6673('0x24')](function(){return _0x3de842;})[_0x6673('0x24')](respondWithResult(_0x242fd2,null))[_0x6673('0x4d')](handleError(_0x242fd2,null));};exports['removeLists']=function(_0x448a76,_0x14ca61,_0x5f1b0f){return db[_0x6673('0x2f')][_0x6673('0x4c')]({'where':{'id':_0x448a76[_0x6673('0x4b')]['id']}})['then'](handleEntityNotFound(_0x14ca61,null))['then'](function(_0x375c5e){if(_0x375c5e){return _0x375c5e[_0x6673('0x83')](_0x448a76['query'][_0x6673('0x67')]);}})[_0x6673('0x24')](function(_0x3af094){if(_0x3af094){return db[_0x6673('0x5d')][_0x6673('0x25')]({'where':{'ListId':_0x448a76[_0x6673('0x35')][_0x6673('0x67')],'CampaignId':_0x448a76['params']['id']}})[_0x6673('0x24')](function(){return _0x3af094;});}})[_0x6673('0x24')](respondWithStatusCode(_0x14ca61,null))[_0x6673('0x4d')](handleError(_0x14ca61,null));};exports['getBlackLists']=function(_0x214345,_0x462889,_0x284039){var _0x2652de={};var _0xb2ee90={};var _0x41fb28;var _0x5f4415;return db[_0x6673('0x2f')][_0x6673('0x5c')]({'where':{'id':_0x214345[_0x6673('0x4b')]['id']}})[_0x6673('0x24')](handleEntityNotFound(_0x462889,null))['then'](function(_0x47b830){if(_0x47b830){_0x41fb28=_0x47b830;_0xb2ee90[_0x6673('0x34')]=_[_0x6673('0x36')](db[_0x6673('0x66')][_0x6673('0x30')]);_0xb2ee90[_0x6673('0x35')]=_['keys'](_0x214345[_0x6673('0x35')]);_0xb2ee90[_0x6673('0x40')]=_['intersection'](_0xb2ee90['model'],_0xb2ee90[_0x6673('0x35')]);_0x2652de['attributes']=_['intersection'](_0xb2ee90[_0x6673('0x34')],qs[_0x6673('0x39')](_0x214345[_0x6673('0x35')]['fields']));_0x2652de['attributes']=_0x2652de['attributes'][_0x6673('0x3a')]?_0x2652de[_0x6673('0x38')]:_0xb2ee90[_0x6673('0x34')];_0x2652de[_0x6673('0x3e')]=qs[_0x6673('0x5e')](_0x214345[_0x6673('0x35')]['sort']);_0x2652de[_0x6673('0x3f')]=qs[_0x6673('0x40')](_[_0x6673('0x41')](_0x214345[_0x6673('0x35')],_0xb2ee90[_0x6673('0x40')]));if(_0x214345[_0x6673('0x35')][_0x6673('0x42')]){_0x2652de[_0x6673('0x3f')]=_[_0x6673('0x43')](_0x2652de['where'],{'$or':_[_0x6673('0x2e')](_0x2652de[_0x6673('0x38')],function(_0x36caf7){var _0x39a2ef={};_0x39a2ef[_0x36caf7]={'$like':'%'+_0x214345[_0x6673('0x35')][_0x6673('0x42')]+'%'};return _0x39a2ef;})});}_0x2652de=_[_0x6673('0x43')]({},_0x2652de,_0x214345[_0x6673('0x45')]);return _0x41fb28[_0x6673('0x84')](_0x2652de);}})[_0x6673('0x24')](function(_0x37f9eb){if(_0x37f9eb){_0x5f4415=_0x37f9eb[_0x6673('0x3a')];if(!_0x214345[_0x6673('0x35')][_0x6673('0x3b')]('nolimit')){_0x2652de[_0x6673('0x3d')]=qs[_0x6673('0x3d')](_0x214345[_0x6673('0x35')]['limit']);_0x2652de[_0x6673('0x1c')]=qs['offset'](_0x214345[_0x6673('0x35')][_0x6673('0x1c')]);}return _0x41fb28[_0x6673('0x84')](_0x2652de);}})[_0x6673('0x24')](function(_0x298b2b){if(_0x298b2b){return _0x298b2b?{'count':_0x5f4415,'rows':_0x298b2b}:null;}})[_0x6673('0x24')](respondWithResult(_0x462889,null))[_0x6673('0x4d')](handleError(_0x462889,null));};exports[_0x6673('0x85')]=function(_0x467af3,_0x1ca3f7,_0xf68480){var _0x358c4d,_0x198c42;return db[_0x6673('0x2f')][_0x6673('0x4c')]({'where':{'id':_0x467af3[_0x6673('0x4b')]['id']}})[_0x6673('0x24')](handleEntityNotFound(_0x1ca3f7,null))[_0x6673('0x24')](function(_0x1a08c1){if(_0x1a08c1){_0x198c42=_0x1a08c1;return _0x1a08c1[_0x6673('0x85')](_0x467af3[_0x6673('0x4f')][_0x6673('0x67')],_[_0x6673('0x56')](_0x467af3['body'],[_0x6673('0x67'),'id'])||{});}return null;})['spread'](function(_0x1587d4){var _0xcc61aa;_0x358c4d=_0x1587d4||[];var _0x41c554=[];if(_0x1587d4){for(var _0x52f291=0x0;_0x52f291<_0x1587d4[_0x6673('0x3a')];_0x52f291+=0x1){var _0x1706b7=_0x1587d4[_0x52f291][_0x6673('0x26')]({'plain':!![]});_0xcc61aa=squel[_0x6673('0x7c')]()[_0x6673('0x7e')](_0x6673('0x86'))[_0x6673('0x6b')]([_0x6673('0x6c'),_0x6673('0x72'),_0x6673('0x6e'),'CampaignId',_0x6673('0x57'),'updatedAt'],squel['select']()[_0x6673('0x70')](_0x6673('0x6c'),_0x6673('0x6c'))['field']('id',_0x6673('0x72'))[_0x6673('0x70')](_0x1706b7[_0x6673('0x73')][_0x6673('0x74')](),_0x6673('0x6e'))[_0x6673('0x70')](_0x467af3[_0x6673('0x4b')]['id'][_0x6673('0x74')](),_0x6673('0x5f'))[_0x6673('0x70')]('NOW()',_0x6673('0x57'))[_0x6673('0x70')](_0x6673('0x71'),_0x6673('0x58'))[_0x6673('0x75')](_0x6673('0x76'))[_0x6673('0x3f')](_0x6673('0x77'))[_0x6673('0x3f')](_0x6673('0x7f'),_0x1706b7[_0x6673('0x73')][_0x6673('0x74')]())[_0x6673('0x3f')](_0x6673('0x78')))[_0x6673('0x74')]();_0x41c554[_0x6673('0x80')](db[_0x6673('0x81')]['query'](_0xcc61aa));}return BPromise[_0x6673('0x82')](_0x41c554);}})[_0x6673('0x24')](function(){return _0x358c4d;})[_0x6673('0x24')](respondWithResult(_0x1ca3f7,null))[_0x6673('0x4d')](handleError(_0x1ca3f7,null));};exports[_0x6673('0x87')]=function(_0x2f70e8,_0x5848ed,_0x5ec55b){return db[_0x6673('0x2f')][_0x6673('0x4c')]({'where':{'id':_0x2f70e8[_0x6673('0x4b')]['id']}})[_0x6673('0x24')](handleEntityNotFound(_0x5848ed,null))['then'](function(_0x567a8f){if(_0x567a8f){return _0x567a8f[_0x6673('0x87')](_0x2f70e8[_0x6673('0x35')]['ids']);}})['then'](function(_0x318d89){if(_0x318d89){return db['CmHopperBlack']['destroy']({'where':{'ListId':_0x2f70e8[_0x6673('0x35')][_0x6673('0x67')],'CampaignId':_0x2f70e8[_0x6673('0x4b')]['id']}})[_0x6673('0x24')](function(){return _0x318d89;});}})[_0x6673('0x24')](respondWithStatusCode(_0x5848ed,null))[_0x6673('0x4d')](handleError(_0x5848ed,null));}; \ No newline at end of file diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js index ef09006..7a81da6 100644 --- a/server/api/campaign/campaign.model.js +++ b/server/api/campaign/campaign.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['exports','define','Campaign','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./campaign.attributes'];(function(_0x2235bf,_0x3a06a7){var _0x4c3a64=function(_0x3b3bb6){while(--_0x3b3bb6){_0x2235bf['push'](_0x2235bf['shift']());}};_0x4c3a64(++_0x3a06a7);}(_0x9957,0x93));var _0x7995=function(_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(_0x1e883f,_0x24d516){var _0x192684=function(_0x11fe53){while(--_0x11fe53){_0x1e883f['push'](_0x1e883f['shift']());}};_0x192684(++_0x24d516);}(_0x7a54,0x106));var _0x47a5=function(_0x28ddab,_0x4b0488){_0x28ddab=_0x28ddab-0x0;var _0x1af504=_0x7a54[_0x28ddab];return _0x1af504;};'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 39190b1..df15769 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 _0xeebe=['jayson/promise','client','http','request','then','request\x20sent','debug','Campaign,\x20%s,\x20%s,\x20%s','stringify','error','message','Campaign,\x20%s,\x20%s','info','result','catch','GetCampaign','Campaign','findAll','options','attributes','limit','map','include','model','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x4c5153,_0x493be){var _0x3b6182=function(_0x1a9326){while(--_0x1a9326){_0x4c5153['push'](_0x4c5153['shift']());}};_0x3b6182(++_0x493be);}(_0xeebe,0xff));var _0xeeeb=function(_0xc4001c,_0x1bf8f0){_0xc4001c=_0xc4001c-0x0;var _0x49f7bc=_0xeebe[_0xc4001c];return _0x49f7bc;};'use strict';var _=require(_0xeeeb('0x0'));var util=require('util');var moment=require(_0xeeeb('0x1'));var BPromise=require('bluebird');var rs=require(_0xeeeb('0x2'));var fs=require('fs');var Redis=require(_0xeeeb('0x3'));var db=require(_0xeeeb('0x4'))['db'];var utils=require(_0xeeeb('0x5'));var logger=require(_0xeeeb('0x6'))(_0xeeeb('0x7'));var config=require(_0xeeeb('0x8'));var jayson=require(_0xeeeb('0x9'));var client=jayson[_0xeeeb('0xa')][_0xeeeb('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x46c645,_0x3083ab,_0x41847e){return new BPromise(function(_0x1f88ea,_0xc3e1ba){return client[_0xeeeb('0xc')](_0x46c645,_0x41847e)[_0xeeeb('0xd')](function(_0x426a82){logger['info']('Campaign,\x20%s,\x20%s',_0x3083ab,_0xeeeb('0xe'));logger[_0xeeeb('0xf')](_0xeeeb('0x10'),_0x3083ab,'request\x20sent',JSON[_0xeeeb('0x11')](_0x426a82));if(_0x426a82[_0xeeeb('0x12')]){if(_0x426a82[_0xeeeb('0x12')]['code']===0x1f4){logger[_0xeeeb('0x12')]('Campaign,\x20%s,\x20%s',_0x3083ab,_0x426a82['error'][_0xeeeb('0x13')]);return _0xc3e1ba(_0x426a82[_0xeeeb('0x12')][_0xeeeb('0x13')]);}logger[_0xeeeb('0x12')](_0xeeeb('0x14'),_0x3083ab,_0x426a82[_0xeeeb('0x12')][_0xeeeb('0x13')]);return _0x1f88ea(_0x426a82[_0xeeeb('0x12')][_0xeeeb('0x13')]);}else{logger[_0xeeeb('0x15')](_0xeeeb('0x14'),_0x3083ab,_0xeeeb('0xe'));_0x1f88ea(_0x426a82[_0xeeeb('0x16')][_0xeeeb('0x13')]);}})[_0xeeeb('0x17')](function(_0x1b1d02){logger[_0xeeeb('0x12')](_0xeeeb('0x14'),_0x3083ab,_0x1b1d02);_0xc3e1ba(_0x1b1d02);});});}exports[_0xeeeb('0x18')]=function(_0x2db8b1){var _0x37efe6=this;return new Promise(function(_0x1af658,_0x2dba71){return db[_0xeeeb('0x19')][_0xeeeb('0x1a')]({'raw':_0x2db8b1[_0xeeeb('0x1b')]?_0x2db8b1[_0xeeeb('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x2db8b1[_0xeeeb('0x1b')]?_0x2db8b1['options']['where']||null:null,'attributes':_0x2db8b1['options']?_0x2db8b1['options'][_0xeeeb('0x1c')]||null:null,'limit':_0x2db8b1[_0xeeeb('0x1b')]?_0x2db8b1[_0xeeeb('0x1b')][_0xeeeb('0x1d')]||null:null,'include':_0x2db8b1[_0xeeeb('0x1b')]?_0x2db8b1['options']['include']?_[_0xeeeb('0x1e')](_0x2db8b1[_0xeeeb('0x1b')][_0xeeeb('0x1f')],function(_0x70ce3c){return{'model':db[_0x70ce3c[_0xeeeb('0x20')]],'as':_0x70ce3c['as'],'attributes':_0x70ce3c['attributes'],'include':_0x70ce3c[_0xeeeb('0x1f')]?_[_0xeeeb('0x1e')](_0x70ce3c['include'],function(_0x495a08){return{'model':db[_0x495a08[_0xeeeb('0x20')]],'as':_0x495a08['as'],'attributes':_0x495a08[_0xeeeb('0x1c')],'include':_0x495a08[_0xeeeb('0x1f')]?_[_0xeeeb('0x1e')](_0x495a08[_0xeeeb('0x1f')],function(_0x192698){return{'model':db[_0x192698[_0xeeeb('0x20')]],'as':_0x192698['as'],'attributes':_0x192698[_0xeeeb('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xeeeb('0xd')](function(_0x25e359){logger[_0xeeeb('0x15')]('GetCampaign',_0x2db8b1);logger['debug'](_0xeeeb('0x18'),_0x2db8b1,JSON[_0xeeeb('0x11')](_0x25e359));_0x1af658(_0x25e359);})[_0xeeeb('0x17')](function(_0x49e349){logger[_0xeeeb('0x12')](_0xeeeb('0x18'),_0x49e349['message'],_0x2db8b1);_0x2dba71(_0x37efe6[_0xeeeb('0x12')](0x1f4,_0x49e349[_0xeeeb('0x13')]));});});}; \ No newline at end of file +var _0xa991=['map','model','stringify','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Campaign,\x20%s,\x20%s','debug','Campaign,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','catch','GetCampaign','Campaign','findAll','options','raw','attributes','include'];(function(_0x5ac7c3,_0x2bea51){var _0x33760=function(_0x40e2cf){while(--_0x40e2cf){_0x5ac7c3['push'](_0x5ac7c3['shift']());}};_0x33760(++_0x2bea51);}(_0xa991,0x143));var _0x1a99=function(_0x2d2c16,_0x4e88b6){_0x2d2c16=_0x2d2c16-0x0;var _0x53f2fb=_0xa991[_0x2d2c16];return _0x53f2fb;};'use strict';var _=require(_0x1a99('0x0'));var util=require('util');var moment=require(_0x1a99('0x1'));var BPromise=require(_0x1a99('0x2'));var rs=require(_0x1a99('0x3'));var fs=require('fs');var Redis=require(_0x1a99('0x4'));var db=require(_0x1a99('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x1a99('0x6'))(_0x1a99('0x7'));var config=require(_0x1a99('0x8'));var jayson=require(_0x1a99('0x9'));var client=jayson[_0x1a99('0xa')][_0x1a99('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xbaf427,_0x50e382,_0x8e29c6){return new BPromise(function(_0x507189,_0x334f61){return client[_0x1a99('0xc')](_0xbaf427,_0x8e29c6)[_0x1a99('0xd')](function(_0x30c4d2){logger[_0x1a99('0xe')](_0x1a99('0xf'),_0x50e382,'request\x20sent');logger[_0x1a99('0x10')](_0x1a99('0x11'),_0x50e382,_0x1a99('0x12'),JSON['stringify'](_0x30c4d2));if(_0x30c4d2[_0x1a99('0x13')]){if(_0x30c4d2[_0x1a99('0x13')]['code']===0x1f4){logger[_0x1a99('0x13')]('Campaign,\x20%s,\x20%s',_0x50e382,_0x30c4d2['error'][_0x1a99('0x14')]);return _0x334f61(_0x30c4d2[_0x1a99('0x13')][_0x1a99('0x14')]);}logger[_0x1a99('0x13')]('Campaign,\x20%s,\x20%s',_0x50e382,_0x30c4d2[_0x1a99('0x13')][_0x1a99('0x14')]);return _0x507189(_0x30c4d2[_0x1a99('0x13')][_0x1a99('0x14')]);}else{logger[_0x1a99('0xe')]('Campaign,\x20%s,\x20%s',_0x50e382,_0x1a99('0x12'));_0x507189(_0x30c4d2['result'][_0x1a99('0x14')]);}})[_0x1a99('0x15')](function(_0x166dff){logger[_0x1a99('0x13')](_0x1a99('0xf'),_0x50e382,_0x166dff);_0x334f61(_0x166dff);});});}exports[_0x1a99('0x16')]=function(_0x5c0f09){var _0x5e453a=this;return new Promise(function(_0x250781,_0x50af8e){return db[_0x1a99('0x17')][_0x1a99('0x18')]({'raw':_0x5c0f09[_0x1a99('0x19')]?_0x5c0f09[_0x1a99('0x19')][_0x1a99('0x1a')]===undefined?!![]:![]:!![],'where':_0x5c0f09[_0x1a99('0x19')]?_0x5c0f09[_0x1a99('0x19')]['where']||null:null,'attributes':_0x5c0f09[_0x1a99('0x19')]?_0x5c0f09[_0x1a99('0x19')][_0x1a99('0x1b')]||null:null,'limit':_0x5c0f09[_0x1a99('0x19')]?_0x5c0f09[_0x1a99('0x19')]['limit']||null:null,'include':_0x5c0f09[_0x1a99('0x19')]?_0x5c0f09[_0x1a99('0x19')][_0x1a99('0x1c')]?_[_0x1a99('0x1d')](_0x5c0f09['options'][_0x1a99('0x1c')],function(_0x2e6a05){return{'model':db[_0x2e6a05['model']],'as':_0x2e6a05['as'],'attributes':_0x2e6a05[_0x1a99('0x1b')],'include':_0x2e6a05[_0x1a99('0x1c')]?_['map'](_0x2e6a05[_0x1a99('0x1c')],function(_0x1812be){return{'model':db[_0x1812be[_0x1a99('0x1e')]],'as':_0x1812be['as'],'attributes':_0x1812be['attributes'],'include':_0x1812be['include']?_[_0x1a99('0x1d')](_0x1812be['include'],function(_0x210060){return{'model':db[_0x210060[_0x1a99('0x1e')]],'as':_0x210060['as'],'attributes':_0x210060[_0x1a99('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x1a99('0xd')](function(_0xb4e8d4){logger[_0x1a99('0xe')](_0x1a99('0x16'),_0x5c0f09);logger[_0x1a99('0x10')](_0x1a99('0x16'),_0x5c0f09,JSON[_0x1a99('0x1f')](_0xb4e8d4));_0x250781(_0xb4e8d4);})['catch'](function(_0x5d4545){logger[_0x1a99('0x13')](_0x1a99('0x16'),_0x5d4545['message'],_0x5c0f09);_0x50af8e(_0x5e453a[_0x1a99('0x13')](0x1f4,_0x5d4545[_0x1a99('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js index 7dfd4e9..9cd4bfc 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 _0x41ee=['Router','fs-extra','get','isAuthenticated','show','/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','/:id/hopper_black','getHopperBlacks','/:id/lists','getLists','/:id/blacklists','getBlackLists','post','/:id','update','delete','exports','multer','util','connect-timeout','express'];(function(_0x190077,_0x52f751){var _0x522c30=function(_0x14da2a){while(--_0x14da2a){_0x190077['push'](_0x190077['shift']());}};_0x522c30(++_0x52f751);}(_0x41ee,0x141));var _0xe41e=function(_0x5b0fad,_0x577006){_0x5b0fad=_0x5b0fad-0x0;var _0x54ecd9=_0x41ee[_0x5b0fad];return _0x54ecd9;};'use strict';var multer=require(_0xe41e('0x0'));var util=require(_0xe41e('0x1'));var path=require('path');var timeout=require(_0xe41e('0x2'));var express=require(_0xe41e('0x3'));var router=express[_0xe41e('0x4')]();var fs_extra=require(_0xe41e('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./campaign.controller');router[_0xe41e('0x6')]('/',auth[_0xe41e('0x7')](),controller['index']);router[_0xe41e('0x6')]('/:id',auth[_0xe41e('0x7')](),controller[_0xe41e('0x8')]);router[_0xe41e('0x6')](_0xe41e('0x9'),auth[_0xe41e('0x7')](),controller[_0xe41e('0xa')]);router['get'](_0xe41e('0xb'),auth[_0xe41e('0x7')](),controller[_0xe41e('0xc')]);router[_0xe41e('0x6')](_0xe41e('0xd'),auth[_0xe41e('0x7')](),controller['getHopperFinals']);router[_0xe41e('0x6')](_0xe41e('0xe'),auth[_0xe41e('0x7')](),controller[_0xe41e('0xf')]);router['get'](_0xe41e('0x10'),auth[_0xe41e('0x7')](),controller[_0xe41e('0x11')]);router[_0xe41e('0x6')](_0xe41e('0x12'),auth['isAuthenticated'](),controller[_0xe41e('0x13')]);router[_0xe41e('0x14')]('/',auth['isAuthenticated'](),controller['create']);router[_0xe41e('0x14')]('/:id/clone',auth[_0xe41e('0x7')](),controller['clone']);router[_0xe41e('0x14')](_0xe41e('0x10'),auth[_0xe41e('0x7')](),controller['addLists']);router[_0xe41e('0x14')](_0xe41e('0x12'),auth['isAuthenticated'](),controller['addBlackLists']);router['put'](_0xe41e('0x15'),auth[_0xe41e('0x7')](),controller[_0xe41e('0x16')]);router[_0xe41e('0x17')]('/:id',auth['isAuthenticated'](),controller['destroy']);router[_0xe41e('0x17')](_0xe41e('0x10'),auth[_0xe41e('0x7')](),controller['removeLists']);router[_0xe41e('0x17')](_0xe41e('0x12'),auth['isAuthenticated'](),controller['removeBlackLists']);module[_0xe41e('0x18')]=router; \ No newline at end of file +var _0xd4b0=['exports','multer','util','path','connect-timeout','express','Router','fs-extra','./campaign.controller','isAuthenticated','index','/:id','get','/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','/:id/hopper_black','getHopperBlacks','/:id/lists','getBlackLists','post','/:id/clone','clone','put','delete','destroy','removeLists','/:id/blacklists','removeBlackLists'];(function(_0x126558,_0x143c9a){var _0x1f6d14=function(_0x2b0eea){while(--_0x2b0eea){_0x126558['push'](_0x126558['shift']());}};_0x1f6d14(++_0x143c9a);}(_0xd4b0,0xbb));var _0x0d4b=function(_0x19561a,_0x1c5bde){_0x19561a=_0x19561a-0x0;var _0x390fa8=_0xd4b0[_0x19561a];return _0x390fa8;};'use strict';var multer=require(_0x0d4b('0x0'));var util=require(_0x0d4b('0x1'));var path=require(_0x0d4b('0x2'));var timeout=require(_0x0d4b('0x3'));var express=require(_0x0d4b('0x4'));var router=express[_0x0d4b('0x5')]();var fs_extra=require(_0x0d4b('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x0d4b('0x7'));router['get']('/',auth[_0x0d4b('0x8')](),controller[_0x0d4b('0x9')]);router['get'](_0x0d4b('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0d4b('0xb')](_0x0d4b('0xc'),auth[_0x0d4b('0x8')](),controller[_0x0d4b('0xd')]);router['get'](_0x0d4b('0xe'),auth[_0x0d4b('0x8')](),controller[_0x0d4b('0xf')]);router[_0x0d4b('0xb')](_0x0d4b('0x10'),auth[_0x0d4b('0x8')](),controller['getHopperFinals']);router[_0x0d4b('0xb')](_0x0d4b('0x11'),auth[_0x0d4b('0x8')](),controller[_0x0d4b('0x12')]);router[_0x0d4b('0xb')](_0x0d4b('0x13'),auth[_0x0d4b('0x8')](),controller['getLists']);router['get']('/:id/blacklists',auth['isAuthenticated'](),controller[_0x0d4b('0x14')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x0d4b('0x15')](_0x0d4b('0x16'),auth[_0x0d4b('0x8')](),controller[_0x0d4b('0x17')]);router['post'](_0x0d4b('0x13'),auth[_0x0d4b('0x8')](),controller['addLists']);router[_0x0d4b('0x15')]('/:id/blacklists',auth[_0x0d4b('0x8')](),controller['addBlackLists']);router[_0x0d4b('0x18')]('/:id',auth[_0x0d4b('0x8')](),controller['update']);router[_0x0d4b('0x19')](_0x0d4b('0xa'),auth[_0x0d4b('0x8')](),controller[_0x0d4b('0x1a')]);router[_0x0d4b('0x19')](_0x0d4b('0x13'),auth[_0x0d4b('0x8')](),controller[_0x0d4b('0x1b')]);router[_0x0d4b('0x19')](_0x0d4b('0x1c'),auth[_0x0d4b('0x8')](),controller[_0x0d4b('0x1d')]);module[_0x0d4b('0x1e')]=router; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.attributes.js b/server/api/cannedAnswer/cannedAnswer.attributes.js index 26a234b..c359abe 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 _0x5e7a=['STRING','sequelize'];(function(_0x527a6c,_0x15b18d){var _0x4c780d=function(_0xebc03){while(--_0xebc03){_0x527a6c['push'](_0x527a6c['shift']());}};_0x4c780d(++_0x15b18d);}(_0x5e7a,0x183));var _0xa5e7=function(_0x3376bd,_0x4fdb2a){_0x3376bd=_0x3376bd-0x0;var _0x587b0b=_0x5e7a[_0x3376bd];return _0x587b0b;};'use strict';var Sequelize=require(_0xa5e7('0x0'));module['exports']={'key':{'type':Sequelize[_0xa5e7('0x1')],'allowNull':![]},'value':{'type':Sequelize['TEXT'],'allowNull':![]},'description':{'type':Sequelize[_0xa5e7('0x1')]},'name':{'type':Sequelize['VIRTUAL'],'get':function(){return this['getDataValue']('key');}}}; \ No newline at end of file +var _0xcc13=['exports','STRING','TEXT','VIRTUAL','getDataValue','key','sequelize'];(function(_0x162075,_0x57b6b3){var _0x4db000=function(_0x478716){while(--_0x478716){_0x162075['push'](_0x162075['shift']());}};_0x4db000(++_0x57b6b3);}(_0xcc13,0x19c));var _0x3cc1=function(_0x91245c,_0x480d3f){_0x91245c=_0x91245c-0x0;var _0x4efdaa=_0xcc13[_0x91245c];return _0x4efdaa;};'use strict';var Sequelize=require(_0x3cc1('0x0'));module[_0x3cc1('0x1')]={'key':{'type':Sequelize[_0x3cc1('0x2')],'allowNull':![]},'value':{'type':Sequelize[_0x3cc1('0x3')],'allowNull':![]},'description':{'type':Sequelize[_0x3cc1('0x2')]},'name':{'type':Sequelize[_0x3cc1('0x4')],'get':function(){return this[_0x3cc1('0x5')](_0x3cc1('0x6'));}}}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js index 248026c..ed02fc1 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 _0x2297=['mustache','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','undefined','limit','count','offset','set','Content-Range','json','apply','save','then','destroy','get','UserProfileResource','end','error','stack','name','send','CannedAnswer','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','catch','params','update','body','find','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','ValidationError','The\x20inserted\x20key\x20already\x20exists.','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','CannedAnswers','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','zip-dir','request-promise','moment','bluebird'];(function(_0x597f28,_0x14c9c8){var _0x273ac9=function(_0x592734){while(--_0x592734){_0x597f28['push'](_0x597f28['shift']());}};_0x273ac9(++_0x14c9c8);}(_0x2297,0x1bd));var _0x7229=function(_0x2ec739,_0x3e1b40){_0x2ec739=_0x2ec739-0x0;var _0x293eb4=_0x2297[_0x2ec739];return _0x293eb4;};'use strict';var emlformat=require(_0x7229('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7229('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7229('0x2'));var moment=require(_0x7229('0x3'));var BPromise=require(_0x7229('0x4'));var Mustache=require(_0x7229('0x5'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x7229('0x6'));var ejs=require(_0x7229('0x7'));var fs=require('fs');var fs_extra=require(_0x7229('0x8'));var _=require(_0x7229('0x9'));var squel=require(_0x7229('0xa'));var crypto=require(_0x7229('0xb'));var jsforce=require(_0x7229('0xc'));var deskjs=require(_0x7229('0xd'));var toCsv=require('to-csv');var querystring=require(_0x7229('0xe'));var Papa=require(_0x7229('0xf'));var Redis=require(_0x7229('0x10'));var authService=require(_0x7229('0x11'));var qs=require(_0x7229('0x12'));var as=require(_0x7229('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x7229('0x14'))(_0x7229('0x15'));var utils=require(_0x7229('0x16'));var config=require(_0x7229('0x17'));var licenseUtil=require(_0x7229('0x18'));var db=require(_0x7229('0x19'))['db'];function respondWithStatusCode(_0x12edca,_0x4bb17b){_0x4bb17b=_0x4bb17b||0xcc;return function(_0x59ad3b){if(_0x59ad3b){return _0x12edca[_0x7229('0x1a')](_0x4bb17b);}return _0x12edca[_0x7229('0x1b')](_0x4bb17b)['end']();};}function respondWithResult(_0x137cd7,_0x18725d){_0x18725d=_0x18725d||0xc8;return function(_0x539e8f){if(_0x539e8f){return _0x137cd7[_0x7229('0x1b')](_0x18725d)['json'](_0x539e8f);}};}function respondWithFilteredResult(_0x1b7249,_0x2c9575){return function(_0x4aa3b2){if(_0x4aa3b2){var _0x3662c3=typeof _0x2c9575['offset']===_0x7229('0x1c')&&typeof _0x2c9575[_0x7229('0x1d')]===_0x7229('0x1c');var _0x31d2c5=_0x4aa3b2[_0x7229('0x1e')];var _0x4f40e4=_0x3662c3?0x0:_0x2c9575[_0x7229('0x1f')];var _0x4ceca4=_0x3662c3?_0x4aa3b2[_0x7229('0x1e')]:_0x2c9575['offset']+_0x2c9575[_0x7229('0x1d')];var _0x52d705;if(_0x4ceca4>=_0x31d2c5){_0x4ceca4=_0x31d2c5;_0x52d705=0xc8;}else{_0x52d705=0xce;}_0x1b7249['status'](_0x52d705);return _0x1b7249[_0x7229('0x20')](_0x7229('0x21'),_0x4f40e4+'-'+_0x4ceca4+'/'+_0x31d2c5)[_0x7229('0x22')](_0x4aa3b2);}return null;};}function patchUpdates(_0x4f5e40){return function(_0x1bff17){try{jsonpatch[_0x7229('0x23')](_0x1bff17,_0x4f5e40,!![]);}catch(_0x2e4908){return BPromise['reject'](_0x2e4908);}return _0x1bff17[_0x7229('0x24')]();};}function saveUpdates(_0x13c286,_0x1306de){return function(_0x124951){if(_0x124951){return _0x124951['update'](_0x13c286)[_0x7229('0x25')](function(_0x1ab818){return _0x1ab818;});}return null;};}function removeEntity(_0x439a59,_0x34ba10){return function(_0x31d13b){if(_0x31d13b){return _0x31d13b[_0x7229('0x26')]()['then'](function(){var _0x471718=_0x31d13b[_0x7229('0x27')]({'plain':!![]});var _0x47a845='CannedAnswers';return db[_0x7229('0x28')]['destroy']({'where':{'type':_0x47a845,'resourceId':_0x471718['id']}})[_0x7229('0x25')](function(){return _0x31d13b;});})[_0x7229('0x25')](function(){_0x439a59[_0x7229('0x1b')](0xcc)[_0x7229('0x29')]();});}};}function handleEntityNotFound(_0x550b9d,_0x221116){return function(_0x207a37){if(!_0x207a37){_0x550b9d[_0x7229('0x1a')](0x194);}return _0x207a37;};}function handleError(_0xff29c9,_0xe103c5){_0xe103c5=_0xe103c5||0x1f4;return function(_0x43df8e){logger[_0x7229('0x2a')](_0x43df8e[_0x7229('0x2b')]);if(_0x43df8e[_0x7229('0x2c')]){delete _0x43df8e[_0x7229('0x2c')];}_0xff29c9[_0x7229('0x1b')](_0xe103c5)[_0x7229('0x2d')](_0x43df8e);};}exports['index']=function(_0x4f1bc1,_0x46ea77){var _0x32d00e={},_0x78ba5a={},_0x2f6256={'count':0x0,'rows':[]};var _0x2f3ea0=_['map'](db[_0x7229('0x2e')][_0x7229('0x2f')],function(_0x5e0e5c){return{'name':_0x5e0e5c[_0x7229('0x30')],'type':_0x5e0e5c[_0x7229('0x31')][_0x7229('0x32')]};});_0x78ba5a[_0x7229('0x33')]=_['map'](_0x2f3ea0,'name');_0x78ba5a[_0x7229('0x34')]=_[_0x7229('0x35')](_0x4f1bc1[_0x7229('0x34')]);_0x78ba5a[_0x7229('0x36')]=_[_0x7229('0x37')](_0x78ba5a[_0x7229('0x33')],_0x78ba5a[_0x7229('0x34')]);_0x32d00e[_0x7229('0x38')]=_['intersection'](_0x78ba5a['model'],qs[_0x7229('0x39')](_0x4f1bc1[_0x7229('0x34')][_0x7229('0x39')]));_0x32d00e[_0x7229('0x38')]=_0x32d00e[_0x7229('0x38')][_0x7229('0x3a')]?_0x32d00e['attributes']:_0x78ba5a[_0x7229('0x33')];if(!_0x4f1bc1['query'][_0x7229('0x3b')](_0x7229('0x3c'))){_0x32d00e[_0x7229('0x1d')]=qs[_0x7229('0x1d')](_0x4f1bc1['query'][_0x7229('0x1d')]);_0x32d00e[_0x7229('0x1f')]=qs['offset'](_0x4f1bc1[_0x7229('0x34')][_0x7229('0x1f')]);}_0x32d00e[_0x7229('0x3d')]=qs[_0x7229('0x3e')](_0x4f1bc1[_0x7229('0x34')][_0x7229('0x3e')]);_0x32d00e[_0x7229('0x3f')]=qs[_0x7229('0x36')](_[_0x7229('0x40')](_0x4f1bc1[_0x7229('0x34')],_0x78ba5a['filters']),_0x2f3ea0);if(_0x4f1bc1[_0x7229('0x34')][_0x7229('0x41')]){_0x32d00e[_0x7229('0x3f')]=_[_0x7229('0x42')](_0x32d00e[_0x7229('0x3f')],{'$or':[{'key':{'$like':'%'+_0x4f1bc1[_0x7229('0x34')][_0x7229('0x41')]+'%'}},{'value':{'$like':'%'+_0x4f1bc1[_0x7229('0x34')][_0x7229('0x41')]+'%'}}]});}_0x32d00e=_['merge']({},_0x32d00e,_0x4f1bc1[_0x7229('0x43')]);var _0x92fd1a={'where':_0x32d00e['where']};return db[_0x7229('0x2e')][_0x7229('0x1e')](_0x92fd1a)[_0x7229('0x25')](function(_0x41377c){_0x2f6256[_0x7229('0x1e')]=_0x41377c;if(_0x4f1bc1['query'][_0x7229('0x44')]){_0x32d00e[_0x7229('0x45')]=[{'all':!![]}];}return db['CannedAnswer'][_0x7229('0x46')](_0x32d00e);})[_0x7229('0x25')](function(_0x58b8d6){_0x2f6256['rows']=_0x58b8d6;return _0x2f6256;})[_0x7229('0x25')](respondWithFilteredResult(_0x46ea77,_0x32d00e))[_0x7229('0x47')](handleError(_0x46ea77,null));};exports['show']=function(_0x251e51,_0x1dd94a){var _0x56e180={'raw':!![],'where':{'id':_0x251e51[_0x7229('0x48')]['id']}},_0x577e03={};_0x577e03[_0x7229('0x33')]=_[_0x7229('0x35')](db[_0x7229('0x2e')][_0x7229('0x2f')]);_0x577e03['query']=_[_0x7229('0x35')](_0x251e51[_0x7229('0x34')]);_0x577e03[_0x7229('0x36')]=_[_0x7229('0x37')](_0x577e03[_0x7229('0x33')],_0x577e03[_0x7229('0x34')]);_0x56e180[_0x7229('0x38')]=_[_0x7229('0x37')](_0x577e03[_0x7229('0x33')],qs[_0x7229('0x39')](_0x251e51['query'][_0x7229('0x39')]));_0x56e180[_0x7229('0x38')]=_0x56e180[_0x7229('0x38')][_0x7229('0x3a')]?_0x56e180[_0x7229('0x38')]:_0x577e03['model'];if(_0x251e51[_0x7229('0x34')][_0x7229('0x44')]){_0x56e180[_0x7229('0x45')]=[{'all':!![]}];}_0x56e180=_[_0x7229('0x42')]({},_0x56e180,_0x251e51[_0x7229('0x43')]);return db['CannedAnswer']['find'](_0x56e180)[_0x7229('0x25')](handleEntityNotFound(_0x1dd94a,null))['then'](respondWithResult(_0x1dd94a,null))[_0x7229('0x47')](handleError(_0x1dd94a,null));};exports[_0x7229('0x49')]=function(_0x282ce4,_0x250ebe){if(_0x282ce4[_0x7229('0x4a')]['id']){delete _0x282ce4[_0x7229('0x4a')]['id'];}return db[_0x7229('0x2e')]['find']({'where':{'id':_0x282ce4[_0x7229('0x48')]['id']}})[_0x7229('0x25')](handleEntityNotFound(_0x250ebe,null))[_0x7229('0x25')](saveUpdates(_0x282ce4[_0x7229('0x4a')],null))[_0x7229('0x25')](respondWithResult(_0x250ebe,null))[_0x7229('0x47')](handleError(_0x250ebe,null));};exports[_0x7229('0x26')]=function(_0x2f3cac,_0x5c6ba7){return db[_0x7229('0x2e')][_0x7229('0x4b')]({'where':{'id':_0x2f3cac[_0x7229('0x48')]['id']}})['then'](handleEntityNotFound(_0x5c6ba7,null))[_0x7229('0x25')](removeEntity(_0x5c6ba7,null))[_0x7229('0x47')](handleError(_0x5c6ba7,null));};exports[_0x7229('0x4c')]=function(_0x379604,_0x19726e){var _0x204560={'key':_0x379604[_0x7229('0x4a')][_0x7229('0x32')]};if(_0x379604[_0x7229('0x4a')][_0x7229('0x4d')]){_0x204560[_0x7229('0x4d')]=_0x379604[_0x7229('0x4a')][_0x7229('0x4d')];}else if(_0x379604[_0x7229('0x4a')][_0x7229('0x4e')]){_0x204560[_0x7229('0x4e')]=_0x379604['body'][_0x7229('0x4e')];}else if(_0x379604['body'][_0x7229('0x4f')]){_0x204560[_0x7229('0x4f')]=_0x379604[_0x7229('0x4a')][_0x7229('0x4f')];}else if(_0x379604[_0x7229('0x4a')]['ChatWebsiteId']){_0x204560[_0x7229('0x50')]=_0x379604[_0x7229('0x4a')][_0x7229('0x50')];}return db[_0x7229('0x2e')][_0x7229('0x4b')]({'where':_0x204560})[_0x7229('0x25')](function(_0xdcd8ae){if(_0xdcd8ae){throw new db['Sequelize'][(_0x7229('0x51'))](_0x7229('0x52'));}return db['CannedAnswer']['create'](_0x379604[_0x7229('0x4a')]);})[_0x7229('0x25')](function(_0x5d4b42){var _0x5cda0e=_0x379604[_0x7229('0x53')][_0x7229('0x27')]({'plain':!![]});if(!_0x5cda0e)throw new Error(_0x7229('0x54'));if(_0x5cda0e['role']==='user'){var _0x36ecb4=_0x5d4b42[_0x7229('0x27')]({'plain':!![]});return db[_0x7229('0x55')][_0x7229('0x4b')]({'where':{'name':_0x7229('0x56'),'userProfileId':_0x5cda0e[_0x7229('0x57')]},'raw':!![]})['then'](function(_0x517d5d){if(_0x517d5d&&_0x517d5d[_0x7229('0x58')]===0x0){return db[_0x7229('0x28')][_0x7229('0x4c')]({'name':_0x36ecb4['name'],'resourceId':_0x36ecb4['id'],'type':_0x517d5d[_0x7229('0x2c')],'sectionId':_0x517d5d['id']},{})[_0x7229('0x25')](function(){return _0x5d4b42;});}else{return _0x5d4b42;}})[_0x7229('0x47')](function(_0x4963f8){logger[_0x7229('0x2a')](_0x7229('0x59'),_0x4963f8);throw _0x4963f8;});}return _0x5d4b42;})[_0x7229('0x25')](respondWithResult(_0x19726e,0xc9))[_0x7229('0x47')](handleError(_0x19726e,null));}; \ No newline at end of file +var _0x9d09=['name','send','index','CannedAnswer','rawAttributes','fieldName','type','model','query','keys','intersection','fields','attributes','length','nolimit','order','sort','filters','filter','where','merge','include','findAll','rows','catch','params','includeAll','options','find','body','create','key','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','ValidationError','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','undefined','limit','offset','count','status','set','Content-Range','apply','reject','save','update','then','destroy','get','CannedAnswers','stack'];(function(_0x274b87,_0x468600){var _0x33066c=function(_0x219ae7){while(--_0x219ae7){_0x274b87['push'](_0x274b87['shift']());}};_0x33066c(++_0x468600);}(_0x9d09,0x89));var _0x99d0=function(_0x208500,_0x6bb670){_0x208500=_0x208500-0x0;var _0x16a788=_0x9d09[_0x208500];return _0x16a788;};'use strict';var emlformat=require(_0x99d0('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x99d0('0x1'));var rp=require(_0x99d0('0x2'));var moment=require(_0x99d0('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x99d0('0x4'));var util=require(_0x99d0('0x5'));var path=require(_0x99d0('0x6'));var sox=require(_0x99d0('0x7'));var csv=require('to-csv');var ejs=require(_0x99d0('0x8'));var fs=require('fs');var fs_extra=require(_0x99d0('0x9'));var _=require('lodash');var squel=require(_0x99d0('0xa'));var crypto=require(_0x99d0('0xb'));var jsforce=require(_0x99d0('0xc'));var deskjs=require(_0x99d0('0xd'));var toCsv=require(_0x99d0('0xe'));var querystring=require('querystring');var Papa=require(_0x99d0('0xf'));var Redis=require(_0x99d0('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x99d0('0x11'));var as=require(_0x99d0('0x12'));var hardwareService=require(_0x99d0('0x13'));var logger=require(_0x99d0('0x14'))(_0x99d0('0x15'));var utils=require(_0x99d0('0x16'));var config=require(_0x99d0('0x17'));var licenseUtil=require(_0x99d0('0x18'));var db=require(_0x99d0('0x19'))['db'];function respondWithStatusCode(_0x2b3ad5,_0x1658b1){_0x1658b1=_0x1658b1||0xcc;return function(_0x335ff0){if(_0x335ff0){return _0x2b3ad5[_0x99d0('0x1a')](_0x1658b1);}return _0x2b3ad5['status'](_0x1658b1)[_0x99d0('0x1b')]();};}function respondWithResult(_0xdf1561,_0x136263){_0x136263=_0x136263||0xc8;return function(_0x562197){if(_0x562197){return _0xdf1561['status'](_0x136263)[_0x99d0('0x1c')](_0x562197);}};}function respondWithFilteredResult(_0x21c8ef,_0x584b23){return function(_0x143f18){if(_0x143f18){var _0x9b3e15=typeof _0x584b23['offset']===_0x99d0('0x1d')&&typeof _0x584b23[_0x99d0('0x1e')]===_0x99d0('0x1d');var _0x2a2450=_0x143f18['count'];var _0x409783=_0x9b3e15?0x0:_0x584b23[_0x99d0('0x1f')];var _0x41e3cc=_0x9b3e15?_0x143f18[_0x99d0('0x20')]:_0x584b23['offset']+_0x584b23[_0x99d0('0x1e')];var _0x2f2e02;if(_0x41e3cc>=_0x2a2450){_0x41e3cc=_0x2a2450;_0x2f2e02=0xc8;}else{_0x2f2e02=0xce;}_0x21c8ef[_0x99d0('0x21')](_0x2f2e02);return _0x21c8ef[_0x99d0('0x22')](_0x99d0('0x23'),_0x409783+'-'+_0x41e3cc+'/'+_0x2a2450)[_0x99d0('0x1c')](_0x143f18);}return null;};}function patchUpdates(_0x710b2d){return function(_0x3584f8){try{jsonpatch[_0x99d0('0x24')](_0x3584f8,_0x710b2d,!![]);}catch(_0x2786e2){return BPromise[_0x99d0('0x25')](_0x2786e2);}return _0x3584f8[_0x99d0('0x26')]();};}function saveUpdates(_0xbeb1a3,_0xc7d1d5){return function(_0x3d7050){if(_0x3d7050){return _0x3d7050[_0x99d0('0x27')](_0xbeb1a3)[_0x99d0('0x28')](function(_0x18d535){return _0x18d535;});}return null;};}function removeEntity(_0x503b03,_0x1f9fa5){return function(_0x403631){if(_0x403631){return _0x403631[_0x99d0('0x29')]()[_0x99d0('0x28')](function(){var _0x12f2e3=_0x403631[_0x99d0('0x2a')]({'plain':!![]});var _0x399b98=_0x99d0('0x2b');return db['UserProfileResource'][_0x99d0('0x29')]({'where':{'type':_0x399b98,'resourceId':_0x12f2e3['id']}})[_0x99d0('0x28')](function(){return _0x403631;});})[_0x99d0('0x28')](function(){_0x503b03[_0x99d0('0x21')](0xcc)[_0x99d0('0x1b')]();});}};}function handleEntityNotFound(_0x1e9f46,_0x3bb66f){return function(_0x5e2f5e){if(!_0x5e2f5e){_0x1e9f46[_0x99d0('0x1a')](0x194);}return _0x5e2f5e;};}function handleError(_0x8b1422,_0x3a9951){_0x3a9951=_0x3a9951||0x1f4;return function(_0x5a746d){logger['error'](_0x5a746d[_0x99d0('0x2c')]);if(_0x5a746d['name']){delete _0x5a746d[_0x99d0('0x2d')];}_0x8b1422[_0x99d0('0x21')](_0x3a9951)[_0x99d0('0x2e')](_0x5a746d);};}exports[_0x99d0('0x2f')]=function(_0x9e11bd,_0x50446f){var _0x5b9911={},_0x45f36d={},_0x48520d={'count':0x0,'rows':[]};var _0x423d02=_['map'](db[_0x99d0('0x30')][_0x99d0('0x31')],function(_0x50a05b){return{'name':_0x50a05b[_0x99d0('0x32')],'type':_0x50a05b[_0x99d0('0x33')]['key']};});_0x45f36d[_0x99d0('0x34')]=_['map'](_0x423d02,_0x99d0('0x2d'));_0x45f36d[_0x99d0('0x35')]=_[_0x99d0('0x36')](_0x9e11bd[_0x99d0('0x35')]);_0x45f36d['filters']=_[_0x99d0('0x37')](_0x45f36d[_0x99d0('0x34')],_0x45f36d[_0x99d0('0x35')]);_0x5b9911['attributes']=_[_0x99d0('0x37')](_0x45f36d[_0x99d0('0x34')],qs[_0x99d0('0x38')](_0x9e11bd[_0x99d0('0x35')][_0x99d0('0x38')]));_0x5b9911[_0x99d0('0x39')]=_0x5b9911['attributes'][_0x99d0('0x3a')]?_0x5b9911[_0x99d0('0x39')]:_0x45f36d[_0x99d0('0x34')];if(!_0x9e11bd['query']['hasOwnProperty'](_0x99d0('0x3b'))){_0x5b9911['limit']=qs[_0x99d0('0x1e')](_0x9e11bd[_0x99d0('0x35')][_0x99d0('0x1e')]);_0x5b9911[_0x99d0('0x1f')]=qs[_0x99d0('0x1f')](_0x9e11bd[_0x99d0('0x35')][_0x99d0('0x1f')]);}_0x5b9911[_0x99d0('0x3c')]=qs[_0x99d0('0x3d')](_0x9e11bd[_0x99d0('0x35')]['sort']);_0x5b9911['where']=qs['filters'](_['pick'](_0x9e11bd['query'],_0x45f36d[_0x99d0('0x3e')]),_0x423d02);if(_0x9e11bd[_0x99d0('0x35')][_0x99d0('0x3f')]){_0x5b9911[_0x99d0('0x40')]=_[_0x99d0('0x41')](_0x5b9911[_0x99d0('0x40')],{'$or':[{'key':{'$like':'%'+_0x9e11bd[_0x99d0('0x35')]['filter']+'%'}},{'value':{'$like':'%'+_0x9e11bd[_0x99d0('0x35')][_0x99d0('0x3f')]+'%'}}]});}_0x5b9911=_[_0x99d0('0x41')]({},_0x5b9911,_0x9e11bd['options']);var _0x52e8c0={'where':_0x5b9911[_0x99d0('0x40')]};return db[_0x99d0('0x30')][_0x99d0('0x20')](_0x52e8c0)[_0x99d0('0x28')](function(_0x429526){_0x48520d[_0x99d0('0x20')]=_0x429526;if(_0x9e11bd['query']['includeAll']){_0x5b9911[_0x99d0('0x42')]=[{'all':!![]}];}return db[_0x99d0('0x30')][_0x99d0('0x43')](_0x5b9911);})['then'](function(_0x20c67e){_0x48520d[_0x99d0('0x44')]=_0x20c67e;return _0x48520d;})[_0x99d0('0x28')](respondWithFilteredResult(_0x50446f,_0x5b9911))[_0x99d0('0x45')](handleError(_0x50446f,null));};exports['show']=function(_0xd512f8,_0x1e5506){var _0x51f312={'raw':!![],'where':{'id':_0xd512f8[_0x99d0('0x46')]['id']}},_0x53c48e={};_0x53c48e[_0x99d0('0x34')]=_['keys'](db['CannedAnswer'][_0x99d0('0x31')]);_0x53c48e[_0x99d0('0x35')]=_['keys'](_0xd512f8[_0x99d0('0x35')]);_0x53c48e[_0x99d0('0x3e')]=_['intersection'](_0x53c48e[_0x99d0('0x34')],_0x53c48e[_0x99d0('0x35')]);_0x51f312[_0x99d0('0x39')]=_['intersection'](_0x53c48e[_0x99d0('0x34')],qs[_0x99d0('0x38')](_0xd512f8['query'][_0x99d0('0x38')]));_0x51f312[_0x99d0('0x39')]=_0x51f312[_0x99d0('0x39')]['length']?_0x51f312[_0x99d0('0x39')]:_0x53c48e[_0x99d0('0x34')];if(_0xd512f8['query'][_0x99d0('0x47')]){_0x51f312[_0x99d0('0x42')]=[{'all':!![]}];}_0x51f312=_[_0x99d0('0x41')]({},_0x51f312,_0xd512f8[_0x99d0('0x48')]);return db[_0x99d0('0x30')][_0x99d0('0x49')](_0x51f312)[_0x99d0('0x28')](handleEntityNotFound(_0x1e5506,null))[_0x99d0('0x28')](respondWithResult(_0x1e5506,null))[_0x99d0('0x45')](handleError(_0x1e5506,null));};exports[_0x99d0('0x27')]=function(_0x308c36,_0x42cef0){if(_0x308c36[_0x99d0('0x4a')]['id']){delete _0x308c36[_0x99d0('0x4a')]['id'];}return db['CannedAnswer']['find']({'where':{'id':_0x308c36[_0x99d0('0x46')]['id']}})['then'](handleEntityNotFound(_0x42cef0,null))[_0x99d0('0x28')](saveUpdates(_0x308c36[_0x99d0('0x4a')],null))[_0x99d0('0x28')](respondWithResult(_0x42cef0,null))[_0x99d0('0x45')](handleError(_0x42cef0,null));};exports[_0x99d0('0x29')]=function(_0x13027f,_0x2e04ff){return db[_0x99d0('0x30')][_0x99d0('0x49')]({'where':{'id':_0x13027f[_0x99d0('0x46')]['id']}})[_0x99d0('0x28')](handleEntityNotFound(_0x2e04ff,null))[_0x99d0('0x28')](removeEntity(_0x2e04ff,null))[_0x99d0('0x45')](handleError(_0x2e04ff,null));};exports[_0x99d0('0x4b')]=function(_0x4c489b,_0x310100){var _0x290ade={'key':_0x4c489b[_0x99d0('0x4a')][_0x99d0('0x4c')]};if(_0x4c489b[_0x99d0('0x4a')]['MailAccountId']){_0x290ade[_0x99d0('0x4d')]=_0x4c489b['body'][_0x99d0('0x4d')];}else if(_0x4c489b['body']['SmsAccountId']){_0x290ade[_0x99d0('0x4e')]=_0x4c489b[_0x99d0('0x4a')][_0x99d0('0x4e')];}else if(_0x4c489b[_0x99d0('0x4a')][_0x99d0('0x4f')]){_0x290ade['OpenchannelAccountId']=_0x4c489b[_0x99d0('0x4a')][_0x99d0('0x4f')];}else if(_0x4c489b[_0x99d0('0x4a')][_0x99d0('0x50')]){_0x290ade[_0x99d0('0x50')]=_0x4c489b['body'][_0x99d0('0x50')];}return db[_0x99d0('0x30')][_0x99d0('0x49')]({'where':_0x290ade})[_0x99d0('0x28')](function(_0x36fa6d){if(_0x36fa6d){throw new db['Sequelize'][(_0x99d0('0x51'))]('The\x20inserted\x20key\x20already\x20exists.');}return db[_0x99d0('0x30')][_0x99d0('0x4b')](_0x4c489b['body']);})[_0x99d0('0x28')](function(_0x14dbce){var _0x4c2647=_0x4c489b['user'][_0x99d0('0x2a')]({'plain':!![]});if(!_0x4c2647)throw new Error(_0x99d0('0x52'));if(_0x4c2647[_0x99d0('0x53')]===_0x99d0('0x54')){var _0x3926d2=_0x14dbce[_0x99d0('0x2a')]({'plain':!![]});return db[_0x99d0('0x55')][_0x99d0('0x49')]({'where':{'name':_0x99d0('0x2b'),'userProfileId':_0x4c2647[_0x99d0('0x56')]},'raw':!![]})[_0x99d0('0x28')](function(_0xaf2c51){if(_0xaf2c51&&_0xaf2c51[_0x99d0('0x57')]===0x0){return db[_0x99d0('0x58')][_0x99d0('0x4b')]({'name':_0x3926d2[_0x99d0('0x2d')],'resourceId':_0x3926d2['id'],'type':_0xaf2c51[_0x99d0('0x2d')],'sectionId':_0xaf2c51['id']},{})[_0x99d0('0x28')](function(){return _0x14dbce;});}else{return _0x14dbce;}})['catch'](function(_0x4f13d0){logger[_0x99d0('0x59')](_0x99d0('0x5a'),_0x4f13d0);throw _0x4f13d0;});}return _0x14dbce;})[_0x99d0('0x28')](respondWithResult(_0x310100,0xc9))[_0x99d0('0x45')](handleError(_0x310100,null));}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js index bae4708..aecd138 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 _0x09da=['../../config/environment','exports','define','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','bluebird','request-promise','rimraf'];(function(_0x341e0f,_0x4a09d0){var _0x59555a=function(_0x4343a8){while(--_0x4343a8){_0x341e0f['push'](_0x341e0f['shift']());}};_0x59555a(++_0x4a09d0);}(_0x09da,0x65));var _0xa09d=function(_0x5830e3,_0x5ead48){_0x5830e3=_0x5830e3-0x0;var _0x27d4ca=_0x09da[_0x5830e3];return _0x27d4ca;};'use strict';var _=require(_0xa09d('0x0'));var util=require('util');var logger=require(_0xa09d('0x1'))(_0xa09d('0x2'));var moment=require(_0xa09d('0x3'));var BPromise=require(_0xa09d('0x4'));var rp=require(_0xa09d('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa09d('0x6'));var config=require(_0xa09d('0x7'));var attributes=require('./cannedAnswer.attributes');module[_0xa09d('0x8')]=function(_0x2c896b,_0x19a837){return _0x2c896b[_0xa09d('0x9')]('CannedAnswer',attributes,{'tableName':'tools_canned_answers','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xa09d('0xa'),'collate':_0xa09d('0xb')});}; \ No newline at end of file +var _0xd6e9=['lodash','util','../../config/logger','moment','bluebird','path','./cannedAnswer.attributes','exports','define','CannedAnswer','utf8mb4','utf8mb4_unicode_ci'];(function(_0x3e8bfe,_0x4d05c9){var _0x5ba38c=function(_0x2f88fe){while(--_0x2f88fe){_0x3e8bfe['push'](_0x3e8bfe['shift']());}};_0x5ba38c(++_0x4d05c9);}(_0xd6e9,0x1b0));var _0x9d6e=function(_0x549101,_0x235e0b){_0x549101=_0x549101-0x0;var _0x4caec5=_0xd6e9[_0x549101];return _0x4caec5;};'use strict';var _=require(_0x9d6e('0x0'));var util=require(_0x9d6e('0x1'));var logger=require(_0x9d6e('0x2'))('api');var moment=require(_0x9d6e('0x3'));var BPromise=require(_0x9d6e('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9d6e('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x9d6e('0x6'));module[_0x9d6e('0x7')]=function(_0x20906c,_0x413737){return _0x20906c[_0x9d6e('0x8')](_0x9d6e('0x9'),attributes,{'tableName':'tools_canned_answers','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x9d6e('0xa'),'collate':_0x9d6e('0xb')});}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js index fd5af61..2f1a9cf 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(_0x4aa632,_0x3a05ae){var _0x483cb6=function(_0x3df4b7){while(--_0x3df4b7){_0x4aa632['push'](_0x4aa632['shift']());}};_0x483cb6(++_0x3a05ae);}(_0xa9e0,0x123));var _0x0a9e=function(_0x102e37,_0x14a181){_0x102e37=_0x102e37-0x0;var _0x35a07c=_0xa9e0[_0x102e37];return _0x35a07c;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var 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(_0x506354,_0x562c3b){var _0x170ae1=function(_0x389917){while(--_0x389917){_0x506354['push'](_0x506354['shift']());}};_0x170ae1(++_0x562c3b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x373dee,_0x1a8c45){_0x373dee=_0x373dee-0x0;var _0x46798f=_0xa9e0[_0x373dee];return _0x46798f;};'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 8eeecd8..bc72820 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 _0x0902=['destroy','exports','multer','util','connect-timeout','Router','fs-extra','../../components/interaction/service','./cannedAnswer.controller','get','isAuthenticated','show','create','put','/:id','update','delete'];(function(_0x1fab39,_0x2a27a7){var _0x19f088=function(_0x3c1fd8){while(--_0x3c1fd8){_0x1fab39['push'](_0x1fab39['shift']());}};_0x19f088(++_0x2a27a7);}(_0x0902,0x1de));var _0x2090=function(_0x1e6659,_0x1f860c){_0x1e6659=_0x1e6659-0x0;var _0x4d16e4=_0x0902[_0x1e6659];return _0x4d16e4;};'use strict';var multer=require(_0x2090('0x0'));var util=require(_0x2090('0x1'));var path=require('path');var timeout=require(_0x2090('0x2'));var express=require('express');var router=express[_0x2090('0x3')]();var fs_extra=require(_0x2090('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x2090('0x5'));var config=require('../../config/environment');var controller=require(_0x2090('0x6'));router[_0x2090('0x7')]('/',auth['isAuthenticated'](),controller['index']);router['get']('/:id',auth[_0x2090('0x8')](),controller[_0x2090('0x9')]);router['post']('/',auth[_0x2090('0x8')](),controller[_0x2090('0xa')]);router[_0x2090('0xb')](_0x2090('0xc'),auth[_0x2090('0x8')](),controller[_0x2090('0xd')]);router[_0x2090('0xe')](_0x2090('0xc'),auth[_0x2090('0x8')](),controller[_0x2090('0xf')]);module[_0x2090('0x10')]=router; \ No newline at end of file +var _0x31be=['create','/:id','update','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cannedAnswer.controller','get','isAuthenticated','show'];(function(_0x3e18b6,_0x458678){var _0x4b128d=function(_0x16470c){while(--_0x16470c){_0x3e18b6['push'](_0x3e18b6['shift']());}};_0x4b128d(++_0x458678);}(_0x31be,0xcb));var _0xe31b=function(_0x226cb3,_0x48ed57){_0x226cb3=_0x226cb3-0x0;var _0x304fa6=_0x31be[_0x226cb3];return _0x304fa6;};'use strict';var multer=require('multer');var util=require(_0xe31b('0x0'));var path=require(_0xe31b('0x1'));var timeout=require(_0xe31b('0x2'));var express=require(_0xe31b('0x3'));var router=express[_0xe31b('0x4')]();var fs_extra=require(_0xe31b('0x5'));var auth=require(_0xe31b('0x6'));var interaction=require(_0xe31b('0x7'));var config=require(_0xe31b('0x8'));var controller=require(_0xe31b('0x9'));router[_0xe31b('0xa')]('/',auth['isAuthenticated'](),controller['index']);router[_0xe31b('0xa')]('/:id',auth[_0xe31b('0xb')](),controller[_0xe31b('0xc')]);router['post']('/',auth[_0xe31b('0xb')](),controller[_0xe31b('0xd')]);router['put'](_0xe31b('0xe'),auth[_0xe31b('0xb')](),controller[_0xe31b('0xf')]);router['delete'](_0xe31b('0xe'),auth['isAuthenticated'](),controller[_0xe31b('0x10')]);module[_0xe31b('0x11')]=router; \ No newline at end of file diff --git a/server/api/cdr/cdr.attributes.js b/server/api/cdr/cdr.attributes.js index 67aa40c..9ffdb78 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 _0x2bc6=['sequelize','exports','DATE','STRING','INTEGER'];(function(_0x53a7a8,_0xed2bff){var _0x555f71=function(_0x48e696){while(--_0x48e696){_0x53a7a8['push'](_0x53a7a8['shift']());}};_0x555f71(++_0xed2bff);}(_0x2bc6,0x163));var _0x62bc=function(_0x138443,_0x4dbe63){_0x138443=_0x138443-0x0;var _0x2c14c7=_0x2bc6[_0x138443];return _0x2c14c7;};'use strict';var Sequelize=require(_0x62bc('0x0'));module[_0x62bc('0x1')]={'calldate':{'type':Sequelize[_0x62bc('0x2')],'allowNull':![],'defaultValue':'1970-01-01\x2000:00:01'},'clid':{'type':Sequelize['STRING']},'src':{'type':Sequelize['STRING']},'dst':{'type':Sequelize['STRING']},'dcontext':{'type':Sequelize[_0x62bc('0x3')]},'channel':{'type':Sequelize['STRING']},'dstchannel':{'type':Sequelize[_0x62bc('0x3')]},'lastapp':{'type':Sequelize[_0x62bc('0x3')]},'lastdata':{'type':Sequelize['STRING']},'duration':{'type':Sequelize[_0x62bc('0x4')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x62bc('0x4')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x62bc('0x3')]},'amaflags':{'type':Sequelize[_0x62bc('0x4')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x62bc('0x3')]},'userfield':{'type':Sequelize[_0x62bc('0x3')]},'uniqueid':{'type':Sequelize['STRING']},'linkedid':{'type':Sequelize[_0x62bc('0x3')]},'sequence':{'type':Sequelize[_0x62bc('0x3')]},'peeraccount':{'type':Sequelize[_0x62bc('0x3')]},'type':{'type':Sequelize[_0x62bc('0x3')]},'tag':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xe812=['STRING','INTEGER','exports','DATE'];(function(_0x234e21,_0x3f50ad){var _0x5113e5=function(_0x5f3f5b){while(--_0x5f3f5b){_0x234e21['push'](_0x234e21['shift']());}};_0x5113e5(++_0x3f50ad);}(_0xe812,0x1f2));var _0x2e81=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0xe812[_0x3bf83f];return _0x22c4a9;};'use strict';var Sequelize=require('sequelize');module[_0x2e81('0x0')]={'calldate':{'type':Sequelize[_0x2e81('0x1')],'allowNull':![],'defaultValue':'1970-01-01\x2000:00:01'},'clid':{'type':Sequelize['STRING']},'src':{'type':Sequelize[_0x2e81('0x2')]},'dst':{'type':Sequelize[_0x2e81('0x2')]},'dcontext':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x2e81('0x2')]},'dstchannel':{'type':Sequelize[_0x2e81('0x2')]},'lastapp':{'type':Sequelize['STRING']},'lastdata':{'type':Sequelize[_0x2e81('0x2')]},'duration':{'type':Sequelize[_0x2e81('0x3')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x2e81('0x2')]},'amaflags':{'type':Sequelize[_0x2e81('0x3')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x2e81('0x2')]},'userfield':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x2e81('0x2')]},'linkedid':{'type':Sequelize[_0x2e81('0x2')]},'sequence':{'type':Sequelize[_0x2e81('0x2')]},'peeraccount':{'type':Sequelize[_0x2e81('0x2')]},'type':{'type':Sequelize['STRING']},'tag':{'type':Sequelize[_0x2e81('0x2')]}}; \ No newline at end of file diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js index 4068013..72795b3 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 _0x6b8f=['attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','count','includeAll','rows','catch','show','params','keys','find','create','body','describe','rimraf','fast-json-patch','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','squel','crypto','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','apply','reject','save','update','destroy','then','end','name','send','index','map','Cdr','rawAttributes','fieldName','type','key','query','filters','intersection','model'];(function(_0x4697fa,_0x21c841){var _0x390950=function(_0x3deb8a){while(--_0x3deb8a){_0x4697fa['push'](_0x4697fa['shift']());}};_0x390950(++_0x21c841);}(_0x6b8f,0x1bc));var _0xf6b8=function(_0x56c3b7,_0x8e84ae){_0x56c3b7=_0x56c3b7-0x0;var _0x22fd20=_0x6b8f[_0x56c3b7];return _0x22fd20;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf6b8('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf6b8('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xf6b8('0x2'));var Mustache=require(_0xf6b8('0x3'));var util=require('util');var path=require(_0xf6b8('0x4'));var sox=require(_0xf6b8('0x5'));var csv=require(_0xf6b8('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf6b8('0x7'));var _=require(_0xf6b8('0x8'));var squel=require(_0xf6b8('0x9'));var crypto=require(_0xf6b8('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xf6b8('0x6'));var querystring=require('querystring');var Papa=require(_0xf6b8('0xb'));var Redis=require(_0xf6b8('0xc'));var authService=require(_0xf6b8('0xd'));var qs=require(_0xf6b8('0xe'));var as=require(_0xf6b8('0xf'));var hardwareService=require(_0xf6b8('0x10'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0xf6b8('0x11'));var licenseUtil=require(_0xf6b8('0x12'));var db=require(_0xf6b8('0x13'))['db'];function respondWithStatusCode(_0x1d96b9,_0x5a6118){_0x5a6118=_0x5a6118||0xcc;return function(_0x4e5235){if(_0x4e5235){return _0x1d96b9[_0xf6b8('0x14')](_0x5a6118);}return _0x1d96b9[_0xf6b8('0x15')](_0x5a6118)['end']();};}function respondWithResult(_0xfcecc9,_0x2db10c){_0x2db10c=_0x2db10c||0xc8;return function(_0x454d8a){if(_0x454d8a){return _0xfcecc9['status'](_0x2db10c)[_0xf6b8('0x16')](_0x454d8a);}};}function respondWithFilteredResult(_0x53d744,_0x410345){return function(_0x1ee041){if(_0x1ee041){var _0x2e1748=typeof _0x410345[_0xf6b8('0x17')]===_0xf6b8('0x18')&&typeof _0x410345['limit']==='undefined';var _0x3bb9ae=_0x1ee041['count'];var _0x3cf63c=_0x2e1748?0x0:_0x410345[_0xf6b8('0x17')];var _0x4a93a8=_0x2e1748?_0x1ee041['count']:_0x410345[_0xf6b8('0x17')]+_0x410345[_0xf6b8('0x19')];var _0x3081db;if(_0x4a93a8>=_0x3bb9ae){_0x4a93a8=_0x3bb9ae;_0x3081db=0xc8;}else{_0x3081db=0xce;}_0x53d744[_0xf6b8('0x15')](_0x3081db);return _0x53d744['set']('Content-Range',_0x3cf63c+'-'+_0x4a93a8+'/'+_0x3bb9ae)['json'](_0x1ee041);}return null;};}function patchUpdates(_0x3298a4){return function(_0x2a8195){try{jsonpatch[_0xf6b8('0x1a')](_0x2a8195,_0x3298a4,!![]);}catch(_0x56b48a){return BPromise[_0xf6b8('0x1b')](_0x56b48a);}return _0x2a8195[_0xf6b8('0x1c')]();};}function saveUpdates(_0x3d2c57,_0x9c660c){return function(_0x5dd616){if(_0x5dd616){return _0x5dd616[_0xf6b8('0x1d')](_0x3d2c57)['then'](function(_0x22c52d){return _0x22c52d;});}return null;};}function removeEntity(_0x2b5bd3,_0x13a451){return function(_0x4127c9){if(_0x4127c9){return _0x4127c9[_0xf6b8('0x1e')]()[_0xf6b8('0x1f')](function(){_0x2b5bd3['status'](0xcc)[_0xf6b8('0x20')]();});}};}function handleEntityNotFound(_0x1ebfea,_0x4815f7){return function(_0x205d6c){if(!_0x205d6c){_0x1ebfea[_0xf6b8('0x14')](0x194);}return _0x205d6c;};}function handleError(_0x324057,_0xd5ebb5){_0xd5ebb5=_0xd5ebb5||0x1f4;return function(_0x3365b8){logger['error'](_0x3365b8['stack']);if(_0x3365b8[_0xf6b8('0x21')]){delete _0x3365b8[_0xf6b8('0x21')];}_0x324057['status'](_0xd5ebb5)[_0xf6b8('0x22')](_0x3365b8);};}exports[_0xf6b8('0x23')]=function(_0x888319,_0x5a7f55){var _0x458935={},_0xc958f4={},_0x511896={'count':0x0,'rows':[]};var _0x309f04=_[_0xf6b8('0x24')](db[_0xf6b8('0x25')][_0xf6b8('0x26')],function(_0x51ffcf){return{'name':_0x51ffcf[_0xf6b8('0x27')],'type':_0x51ffcf[_0xf6b8('0x28')][_0xf6b8('0x29')]};});_0xc958f4['model']=_[_0xf6b8('0x24')](_0x309f04,_0xf6b8('0x21'));_0xc958f4[_0xf6b8('0x2a')]=_['keys'](_0x888319[_0xf6b8('0x2a')]);_0xc958f4[_0xf6b8('0x2b')]=_[_0xf6b8('0x2c')](_0xc958f4[_0xf6b8('0x2d')],_0xc958f4['query']);_0x458935[_0xf6b8('0x2e')]=_[_0xf6b8('0x2c')](_0xc958f4[_0xf6b8('0x2d')],qs['fields'](_0x888319['query'][_0xf6b8('0x2f')]));_0x458935[_0xf6b8('0x2e')]=_0x458935[_0xf6b8('0x2e')][_0xf6b8('0x30')]?_0x458935[_0xf6b8('0x2e')]:_0xc958f4[_0xf6b8('0x2d')];if(!_0x888319[_0xf6b8('0x2a')][_0xf6b8('0x31')](_0xf6b8('0x32'))){_0x458935[_0xf6b8('0x19')]=qs[_0xf6b8('0x19')](_0x888319[_0xf6b8('0x2a')][_0xf6b8('0x19')]);_0x458935[_0xf6b8('0x17')]=qs[_0xf6b8('0x17')](_0x888319[_0xf6b8('0x2a')][_0xf6b8('0x17')]);}_0x458935[_0xf6b8('0x33')]=qs['sort'](_0x888319['query'][_0xf6b8('0x34')]);_0x458935[_0xf6b8('0x35')]=qs[_0xf6b8('0x2b')](_[_0xf6b8('0x36')](_0x888319[_0xf6b8('0x2a')],_0xc958f4[_0xf6b8('0x2b')]),_0x309f04);if(_0x888319[_0xf6b8('0x2a')][_0xf6b8('0x37')]){_0x458935[_0xf6b8('0x35')]=_[_0xf6b8('0x38')](_0x458935[_0xf6b8('0x35')],{'$or':_[_0xf6b8('0x24')](_0x309f04,function(_0x4a8c49){if(_0x4a8c49[_0xf6b8('0x28')]!==_0xf6b8('0x39')){var _0x5d26ad={};_0x5d26ad[_0x4a8c49[_0xf6b8('0x21')]]={'$like':'%'+_0x888319[_0xf6b8('0x2a')][_0xf6b8('0x37')]+'%'};return _0x5d26ad;}})});}_0x458935=_[_0xf6b8('0x38')]({},_0x458935,_0x888319[_0xf6b8('0x3a')]);var _0x87a4ee={'where':_0x458935[_0xf6b8('0x35')]};return db[_0xf6b8('0x25')][_0xf6b8('0x3b')](_0x87a4ee)[_0xf6b8('0x1f')](function(_0x15a63b){_0x511896[_0xf6b8('0x3b')]=_0x15a63b;if(_0x888319[_0xf6b8('0x2a')][_0xf6b8('0x3c')]){_0x458935['include']=[{'all':!![]}];}return db['Cdr']['findAll'](_0x458935);})[_0xf6b8('0x1f')](function(_0x2c68f5){_0x511896[_0xf6b8('0x3d')]=_0x2c68f5;return _0x511896;})[_0xf6b8('0x1f')](respondWithFilteredResult(_0x5a7f55,_0x458935))[_0xf6b8('0x3e')](handleError(_0x5a7f55,null));};exports[_0xf6b8('0x3f')]=function(_0x1390dc,_0x48f4cb){var _0x1f5e72={'raw':!![],'where':{'id':_0x1390dc[_0xf6b8('0x40')]['id']}},_0x5086d9={};_0x5086d9[_0xf6b8('0x2d')]=_[_0xf6b8('0x41')](db[_0xf6b8('0x25')][_0xf6b8('0x26')]);_0x5086d9['query']=_[_0xf6b8('0x41')](_0x1390dc[_0xf6b8('0x2a')]);_0x5086d9[_0xf6b8('0x2b')]=_[_0xf6b8('0x2c')](_0x5086d9[_0xf6b8('0x2d')],_0x5086d9['query']);_0x1f5e72[_0xf6b8('0x2e')]=_[_0xf6b8('0x2c')](_0x5086d9[_0xf6b8('0x2d')],qs['fields'](_0x1390dc['query'][_0xf6b8('0x2f')]));_0x1f5e72[_0xf6b8('0x2e')]=_0x1f5e72[_0xf6b8('0x2e')][_0xf6b8('0x30')]?_0x1f5e72['attributes']:_0x5086d9['model'];if(_0x1390dc['query'][_0xf6b8('0x3c')]){_0x1f5e72['include']=[{'all':!![]}];}_0x1f5e72=_[_0xf6b8('0x38')]({},_0x1f5e72,_0x1390dc[_0xf6b8('0x3a')]);return db[_0xf6b8('0x25')][_0xf6b8('0x42')](_0x1f5e72)[_0xf6b8('0x1f')](handleEntityNotFound(_0x48f4cb,null))[_0xf6b8('0x1f')](respondWithResult(_0x48f4cb,null))[_0xf6b8('0x3e')](handleError(_0x48f4cb,null));};exports[_0xf6b8('0x43')]=function(_0x394a34,_0x597511){return db[_0xf6b8('0x25')]['create'](_0x394a34[_0xf6b8('0x44')],{})[_0xf6b8('0x1f')](respondWithResult(_0x597511,0xc9))[_0xf6b8('0x3e')](handleError(_0x597511,null));};exports[_0xf6b8('0x1d')]=function(_0x1abf17,_0x291845){if(_0x1abf17[_0xf6b8('0x44')]['id']){delete _0x1abf17['body']['id'];}return db[_0xf6b8('0x25')][_0xf6b8('0x42')]({'where':{'id':_0x1abf17[_0xf6b8('0x40')]['id']}})[_0xf6b8('0x1f')](handleEntityNotFound(_0x291845,null))['then'](saveUpdates(_0x1abf17[_0xf6b8('0x44')],null))[_0xf6b8('0x1f')](respondWithResult(_0x291845,null))['catch'](handleError(_0x291845,null));};exports[_0xf6b8('0x1e')]=function(_0x143164,_0x392582){return db[_0xf6b8('0x25')][_0xf6b8('0x42')]({'where':{'id':_0x143164['params']['id']}})[_0xf6b8('0x1f')](handleEntityNotFound(_0x392582,null))[_0xf6b8('0x1f')](removeEntity(_0x392582,null))['catch'](handleError(_0x392582,null));};exports['describe']=function(_0x55c392,_0x22c1eb){return db[_0xf6b8('0x25')][_0xf6b8('0x45')]()[_0xf6b8('0x1f')](respondWithResult(_0x22c1eb,null))['catch'](handleError(_0x22c1eb,null));}; \ No newline at end of file +var _0xee14=['params','describe','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../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','apply','reject','save','update','destroy','then','error','stack','name','send','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','Cdr','includeAll','include','findAll','rows','catch','find','create','body'];(function(_0x36fb91,_0x339e6a){var _0x544ee7=function(_0x3b1efc){while(--_0x3b1efc){_0x36fb91['push'](_0x36fb91['shift']());}};_0x544ee7(++_0x339e6a);}(_0xee14,0x13a));var _0x4ee1=function(_0x24fa67,_0x55031d){_0x24fa67=_0x24fa67-0x0;var _0x1182ef=_0xee14[_0x24fa67];return _0x1182ef;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x4ee1('0x0'));var jsonpatch=require(_0x4ee1('0x1'));var rp=require(_0x4ee1('0x2'));var moment=require(_0x4ee1('0x3'));var BPromise=require(_0x4ee1('0x4'));var Mustache=require(_0x4ee1('0x5'));var util=require(_0x4ee1('0x6'));var path=require(_0x4ee1('0x7'));var sox=require(_0x4ee1('0x8'));var csv=require('to-csv');var ejs=require(_0x4ee1('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4ee1('0xa'));var squel=require(_0x4ee1('0xb'));var crypto=require(_0x4ee1('0xc'));var jsforce=require(_0x4ee1('0xd'));var deskjs=require(_0x4ee1('0xe'));var toCsv=require(_0x4ee1('0xf'));var querystring=require('querystring');var Papa=require(_0x4ee1('0x10'));var Redis=require(_0x4ee1('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x4ee1('0x12'));var as=require(_0x4ee1('0x13'));var hardwareService=require(_0x4ee1('0x14'));var logger=require(_0x4ee1('0x15'))('api');var utils=require(_0x4ee1('0x16'));var config=require(_0x4ee1('0x17'));var licenseUtil=require(_0x4ee1('0x18'));var db=require(_0x4ee1('0x19'))['db'];function respondWithStatusCode(_0x2f864e,_0x174427){_0x174427=_0x174427||0xcc;return function(_0x5616d6){if(_0x5616d6){return _0x2f864e[_0x4ee1('0x1a')](_0x174427);}return _0x2f864e[_0x4ee1('0x1b')](_0x174427)[_0x4ee1('0x1c')]();};}function respondWithResult(_0x24a915,_0x46d2c2){_0x46d2c2=_0x46d2c2||0xc8;return function(_0x1c342a){if(_0x1c342a){return _0x24a915[_0x4ee1('0x1b')](_0x46d2c2)[_0x4ee1('0x1d')](_0x1c342a);}};}function respondWithFilteredResult(_0xb7eafd,_0x4e3490){return function(_0x2f9194){if(_0x2f9194){var _0x38008f=typeof _0x4e3490[_0x4ee1('0x1e')]===_0x4ee1('0x1f')&&typeof _0x4e3490[_0x4ee1('0x20')]===_0x4ee1('0x1f');var _0x2eff91=_0x2f9194[_0x4ee1('0x21')];var _0x360056=_0x38008f?0x0:_0x4e3490[_0x4ee1('0x1e')];var _0x274de5=_0x38008f?_0x2f9194['count']:_0x4e3490[_0x4ee1('0x1e')]+_0x4e3490[_0x4ee1('0x20')];var _0x173388;if(_0x274de5>=_0x2eff91){_0x274de5=_0x2eff91;_0x173388=0xc8;}else{_0x173388=0xce;}_0xb7eafd[_0x4ee1('0x1b')](_0x173388);return _0xb7eafd[_0x4ee1('0x22')](_0x4ee1('0x23'),_0x360056+'-'+_0x274de5+'/'+_0x2eff91)['json'](_0x2f9194);}return null;};}function patchUpdates(_0x8a631f){return function(_0x333e96){try{jsonpatch[_0x4ee1('0x24')](_0x333e96,_0x8a631f,!![]);}catch(_0x3f0d59){return BPromise[_0x4ee1('0x25')](_0x3f0d59);}return _0x333e96[_0x4ee1('0x26')]();};}function saveUpdates(_0x328f21,_0x40fd98){return function(_0x1dc1a8){if(_0x1dc1a8){return _0x1dc1a8[_0x4ee1('0x27')](_0x328f21)['then'](function(_0x53d43f){return _0x53d43f;});}return null;};}function removeEntity(_0x14110c,_0x459e2e){return function(_0xaf87e7){if(_0xaf87e7){return _0xaf87e7[_0x4ee1('0x28')]()[_0x4ee1('0x29')](function(){_0x14110c[_0x4ee1('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5cc0b5,_0x442c71){return function(_0x28b7e1){if(!_0x28b7e1){_0x5cc0b5['sendStatus'](0x194);}return _0x28b7e1;};}function handleError(_0x35900d,_0x213db8){_0x213db8=_0x213db8||0x1f4;return function(_0x36654c){logger[_0x4ee1('0x2a')](_0x36654c[_0x4ee1('0x2b')]);if(_0x36654c[_0x4ee1('0x2c')]){delete _0x36654c[_0x4ee1('0x2c')];}_0x35900d['status'](_0x213db8)[_0x4ee1('0x2d')](_0x36654c);};}exports['index']=function(_0x4746c2,_0x4ec408){var _0x3dc870={},_0x1d91be={},_0x59a34e={'count':0x0,'rows':[]};var _0x13944c=_[_0x4ee1('0x2e')](db['Cdr'][_0x4ee1('0x2f')],function(_0x5b3792){return{'name':_0x5b3792[_0x4ee1('0x30')],'type':_0x5b3792[_0x4ee1('0x31')][_0x4ee1('0x32')]};});_0x1d91be[_0x4ee1('0x33')]=_[_0x4ee1('0x2e')](_0x13944c,'name');_0x1d91be[_0x4ee1('0x34')]=_[_0x4ee1('0x35')](_0x4746c2[_0x4ee1('0x34')]);_0x1d91be[_0x4ee1('0x36')]=_[_0x4ee1('0x37')](_0x1d91be[_0x4ee1('0x33')],_0x1d91be['query']);_0x3dc870['attributes']=_[_0x4ee1('0x37')](_0x1d91be[_0x4ee1('0x33')],qs[_0x4ee1('0x38')](_0x4746c2['query'][_0x4ee1('0x38')]));_0x3dc870[_0x4ee1('0x39')]=_0x3dc870[_0x4ee1('0x39')][_0x4ee1('0x3a')]?_0x3dc870[_0x4ee1('0x39')]:_0x1d91be[_0x4ee1('0x33')];if(!_0x4746c2[_0x4ee1('0x34')][_0x4ee1('0x3b')](_0x4ee1('0x3c'))){_0x3dc870[_0x4ee1('0x20')]=qs[_0x4ee1('0x20')](_0x4746c2[_0x4ee1('0x34')][_0x4ee1('0x20')]);_0x3dc870['offset']=qs[_0x4ee1('0x1e')](_0x4746c2[_0x4ee1('0x34')][_0x4ee1('0x1e')]);}_0x3dc870['order']=qs['sort'](_0x4746c2[_0x4ee1('0x34')][_0x4ee1('0x3d')]);_0x3dc870[_0x4ee1('0x3e')]=qs[_0x4ee1('0x36')](_['pick'](_0x4746c2[_0x4ee1('0x34')],_0x1d91be[_0x4ee1('0x36')]),_0x13944c);if(_0x4746c2[_0x4ee1('0x34')][_0x4ee1('0x3f')]){_0x3dc870[_0x4ee1('0x3e')]=_[_0x4ee1('0x40')](_0x3dc870[_0x4ee1('0x3e')],{'$or':_[_0x4ee1('0x2e')](_0x13944c,function(_0x59b5cc){if(_0x59b5cc[_0x4ee1('0x31')]!==_0x4ee1('0x41')){var _0x345003={};_0x345003[_0x59b5cc[_0x4ee1('0x2c')]]={'$like':'%'+_0x4746c2[_0x4ee1('0x34')][_0x4ee1('0x3f')]+'%'};return _0x345003;}})});}_0x3dc870=_['merge']({},_0x3dc870,_0x4746c2[_0x4ee1('0x42')]);var _0x37176a={'where':_0x3dc870[_0x4ee1('0x3e')]};return db[_0x4ee1('0x43')][_0x4ee1('0x21')](_0x37176a)[_0x4ee1('0x29')](function(_0x3f0d8b){_0x59a34e[_0x4ee1('0x21')]=_0x3f0d8b;if(_0x4746c2[_0x4ee1('0x34')][_0x4ee1('0x44')]){_0x3dc870[_0x4ee1('0x45')]=[{'all':!![]}];}return db[_0x4ee1('0x43')][_0x4ee1('0x46')](_0x3dc870);})['then'](function(_0x3b3bed){_0x59a34e[_0x4ee1('0x47')]=_0x3b3bed;return _0x59a34e;})['then'](respondWithFilteredResult(_0x4ec408,_0x3dc870))[_0x4ee1('0x48')](handleError(_0x4ec408,null));};exports['show']=function(_0x174167,_0x52ebc0){var _0x14c333={'raw':!![],'where':{'id':_0x174167['params']['id']}},_0xc7580c={};_0xc7580c[_0x4ee1('0x33')]=_[_0x4ee1('0x35')](db[_0x4ee1('0x43')][_0x4ee1('0x2f')]);_0xc7580c['query']=_[_0x4ee1('0x35')](_0x174167[_0x4ee1('0x34')]);_0xc7580c[_0x4ee1('0x36')]=_['intersection'](_0xc7580c['model'],_0xc7580c[_0x4ee1('0x34')]);_0x14c333[_0x4ee1('0x39')]=_[_0x4ee1('0x37')](_0xc7580c[_0x4ee1('0x33')],qs[_0x4ee1('0x38')](_0x174167['query']['fields']));_0x14c333[_0x4ee1('0x39')]=_0x14c333[_0x4ee1('0x39')][_0x4ee1('0x3a')]?_0x14c333[_0x4ee1('0x39')]:_0xc7580c['model'];if(_0x174167[_0x4ee1('0x34')][_0x4ee1('0x44')]){_0x14c333['include']=[{'all':!![]}];}_0x14c333=_[_0x4ee1('0x40')]({},_0x14c333,_0x174167[_0x4ee1('0x42')]);return db[_0x4ee1('0x43')][_0x4ee1('0x49')](_0x14c333)[_0x4ee1('0x29')](handleEntityNotFound(_0x52ebc0,null))[_0x4ee1('0x29')](respondWithResult(_0x52ebc0,null))[_0x4ee1('0x48')](handleError(_0x52ebc0,null));};exports[_0x4ee1('0x4a')]=function(_0x390051,_0x4ebb28){return db['Cdr'][_0x4ee1('0x4a')](_0x390051[_0x4ee1('0x4b')],{})[_0x4ee1('0x29')](respondWithResult(_0x4ebb28,0xc9))[_0x4ee1('0x48')](handleError(_0x4ebb28,null));};exports['update']=function(_0x35edf5,_0x3c66d1){if(_0x35edf5[_0x4ee1('0x4b')]['id']){delete _0x35edf5[_0x4ee1('0x4b')]['id'];}return db[_0x4ee1('0x43')]['find']({'where':{'id':_0x35edf5[_0x4ee1('0x4c')]['id']}})[_0x4ee1('0x29')](handleEntityNotFound(_0x3c66d1,null))[_0x4ee1('0x29')](saveUpdates(_0x35edf5['body'],null))[_0x4ee1('0x29')](respondWithResult(_0x3c66d1,null))['catch'](handleError(_0x3c66d1,null));};exports[_0x4ee1('0x28')]=function(_0x5a1114,_0x30a1cd){return db['Cdr'][_0x4ee1('0x49')]({'where':{'id':_0x5a1114['params']['id']}})[_0x4ee1('0x29')](handleEntityNotFound(_0x30a1cd,null))[_0x4ee1('0x29')](removeEntity(_0x30a1cd,null))[_0x4ee1('0x48')](handleError(_0x30a1cd,null));};exports['describe']=function(_0x3368ed,_0x4118d7){return db[_0x4ee1('0x43')][_0x4ee1('0x4d')]()[_0x4ee1('0x29')](respondWithResult(_0x4118d7,null))[_0x4ee1('0x48')](handleError(_0x4118d7,null));}; \ No newline at end of file diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js index d46171e..d1b7337 100644 --- a/server/api/cdr/cdr.model.js +++ b/server/api/cdr/cdr.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['Cdr','cdr','accountcode','disposition','dst','src','uniqueid','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./cdr.attributes','exports'];(function(_0x2fa7f5,_0x14a9a9){var _0x385d4c=function(_0x524ce6){while(--_0x524ce6){_0x2fa7f5['push'](_0x2fa7f5['shift']());}};_0x385d4c(++_0x14a9a9);}(_0x7a54,0x106));var _0x47a5=function(_0x228396,_0x15ed8a){_0x228396=_0x228396-0x0;var _0x27d393=_0x7a54[_0x228396];return _0x27d393;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[{'name':'accountcode','fields':[_0x47a5('0xc')]},{'name':'calldate','fields':['calldate']},{'name':'disposition','fields':[_0x47a5('0xd')]},{'name':_0x47a5('0xe'),'fields':['dst']},{'name':_0x47a5('0xf'),'fields':['src']},{'name':'uniqueid','fields':[_0x47a5('0x10')]}],'timestamps':![]});}; \ No newline at end of file +var _0x9957=['dst','src','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./cdr.attributes','exports','define','Cdr','accountcode','calldate','disposition'];(function(_0x32f7ca,_0x42503d){var _0x29108b=function(_0x210e6f){while(--_0x210e6f){_0x32f7ca['push'](_0x32f7ca['shift']());}};_0x29108b(++_0x42503d);}(_0x9957,0x93));var _0x7995=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x9957[_0xbca1b1];return _0x4e1686;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'cdr','paranoid':![],'indexes':[{'name':_0x7995('0xc'),'fields':[_0x7995('0xc')]},{'name':'calldate','fields':[_0x7995('0xd')]},{'name':_0x7995('0xe'),'fields':[_0x7995('0xe')]},{'name':_0x7995('0xf'),'fields':[_0x7995('0xf')]},{'name':_0x7995('0x10'),'fields':[_0x7995('0x10')]},{'name':'uniqueid','fields':[_0x7995('0x11')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/cdr/cdr.rpc.js b/server/api/cdr/cdr.rpc.js index 1d73822..080003a 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 _0x0f32=['lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','client','http','then','Cdr,\x20%s,\x20%s','request\x20sent','debug','Cdr,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch'];(function(_0x68c979,_0x431cff){var _0x4f0001=function(_0xa7595d){while(--_0xa7595d){_0x68c979['push'](_0x68c979['shift']());}};_0x4f0001(++_0x431cff);}(_0x0f32,0x1ce));var _0x20f3=function(_0x1e7df1,_0x2f1ad3){_0x1e7df1=_0x1e7df1-0x0;var _0x176276=_0x0f32[_0x1e7df1];return _0x176276;};'use strict';var _=require(_0x20f3('0x0'));var util=require(_0x20f3('0x1'));var moment=require(_0x20f3('0x2'));var BPromise=require(_0x20f3('0x3'));var rs=require(_0x20f3('0x4'));var fs=require('fs');var Redis=require(_0x20f3('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x20f3('0x6'));var logger=require(_0x20f3('0x7'))('rpc');var config=require(_0x20f3('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x20f3('0x9')][_0x20f3('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x52e3f3,_0x36b169,_0x40364b){return new BPromise(function(_0x47ebd2,_0x2bd65c){return client['request'](_0x52e3f3,_0x40364b)[_0x20f3('0xb')](function(_0x2beaa2){logger['info'](_0x20f3('0xc'),_0x36b169,_0x20f3('0xd'));logger[_0x20f3('0xe')](_0x20f3('0xf'),_0x36b169,_0x20f3('0xd'),JSON['stringify'](_0x2beaa2));if(_0x2beaa2[_0x20f3('0x10')]){if(_0x2beaa2['error'][_0x20f3('0x11')]===0x1f4){logger[_0x20f3('0x10')](_0x20f3('0xc'),_0x36b169,_0x2beaa2[_0x20f3('0x10')]['message']);return _0x2bd65c(_0x2beaa2[_0x20f3('0x10')][_0x20f3('0x12')]);}logger[_0x20f3('0x10')](_0x20f3('0xc'),_0x36b169,_0x2beaa2[_0x20f3('0x10')][_0x20f3('0x12')]);return _0x47ebd2(_0x2beaa2['error']['message']);}else{logger[_0x20f3('0x13')](_0x20f3('0xc'),_0x36b169,_0x20f3('0xd'));_0x47ebd2(_0x2beaa2[_0x20f3('0x14')][_0x20f3('0x12')]);}})[_0x20f3('0x15')](function(_0x35cd3e){logger[_0x20f3('0x10')](_0x20f3('0xc'),_0x36b169,_0x35cd3e);_0x2bd65c(_0x35cd3e);});});} \ No newline at end of file +var _0x0478=['../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','Cdr,\x20%s,\x20%s','request\x20sent','debug','Cdr,\x20%s,\x20%s,\x20%s','error','code','message','result','lodash','util','randomstring'];(function(_0x4c836d,_0x144891){var _0x299319=function(_0x5ea7a1){while(--_0x5ea7a1){_0x4c836d['push'](_0x4c836d['shift']());}};_0x299319(++_0x144891);}(_0x0478,0x123));var _0x8047=function(_0x23db1c,_0x41409a){_0x23db1c=_0x23db1c-0x0;var _0x1d5f7c=_0x0478[_0x23db1c];return _0x1d5f7c;};'use strict';var _=require(_0x8047('0x0'));var util=require(_0x8047('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x8047('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8047('0x3'))['db'];var utils=require(_0x8047('0x4'));var logger=require(_0x8047('0x5'))(_0x8047('0x6'));var config=require('../../config/environment');var jayson=require(_0x8047('0x7'));var client=jayson[_0x8047('0x8')][_0x8047('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5bf76b,_0x4b51fc,_0x4acfc6){return new BPromise(function(_0x2653e0,_0x5abda1){return client[_0x8047('0xa')](_0x5bf76b,_0x4acfc6)[_0x8047('0xb')](function(_0x1f92f7){logger[_0x8047('0xc')](_0x8047('0xd'),_0x4b51fc,_0x8047('0xe'));logger[_0x8047('0xf')](_0x8047('0x10'),_0x4b51fc,'request\x20sent',JSON['stringify'](_0x1f92f7));if(_0x1f92f7['error']){if(_0x1f92f7[_0x8047('0x11')][_0x8047('0x12')]===0x1f4){logger['error'](_0x8047('0xd'),_0x4b51fc,_0x1f92f7['error'][_0x8047('0x13')]);return _0x5abda1(_0x1f92f7[_0x8047('0x11')][_0x8047('0x13')]);}logger[_0x8047('0x11')]('Cdr,\x20%s,\x20%s',_0x4b51fc,_0x1f92f7[_0x8047('0x11')]['message']);return _0x2653e0(_0x1f92f7['error'][_0x8047('0x13')]);}else{logger['info']('Cdr,\x20%s,\x20%s',_0x4b51fc,_0x8047('0xe'));_0x2653e0(_0x1f92f7[_0x8047('0x14')][_0x8047('0x13')]);}})['catch'](function(_0x2bc1f6){logger[_0x8047('0x11')]('Cdr,\x20%s,\x20%s',_0x4b51fc,_0x2bc1f6);_0x5abda1(_0x2bc1f6);});});} \ No newline at end of file diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js index 16287f5..d87523b 100644 --- a/server/api/cdr/index.js +++ b/server/api/cdr/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['isAuthenticated','create','put','/:id','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cdr.controller','get','index','/describe','show','post'];(function(_0xb6e2ea,_0x3b26e9){var _0x2a57bb=function(_0x2a1ac9){while(--_0x2a1ac9){_0xb6e2ea['push'](_0xb6e2ea['shift']());}};_0x2a57bb(++_0x3b26e9);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4baae2,_0x487ab6){_0x4baae2=_0x4baae2-0x0;var _0x1a2285=_0xa9e0[_0x4baae2];return _0x1a2285;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0xc')]('/',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')](_0x0a9e('0x10'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x11')]);module[_0x0a9e('0x12')]=router; \ No newline at end of file +var _0xd8b0=['destroy','exports','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','describe','/:id','show','post','create','put','update'];(function(_0x4c742f,_0x2bd40a){var _0x2913ae=function(_0x4e2759){while(--_0x4e2759){_0x4c742f['push'](_0x4c742f['shift']());}};_0x2913ae(++_0x2bd40a);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./cdr.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xb'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['delete'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x11')]);module[_0x0d8b('0x12')]=router; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.attributes.js b/server/api/chatApplication/chatApplication.attributes.js index 4f4f7dc..763bbd2 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 _0x4328=['sequelize','exports','STRING','noop','TEXT'];(function(_0x5462a3,_0x3ad64d){var _0x1239e2=function(_0x578993){while(--_0x578993){_0x5462a3['push'](_0x5462a3['shift']());}};_0x1239e2(++_0x3ad64d);}(_0x4328,0x91));var _0x8432=function(_0x3ed12b,_0x1ffe2a){_0x3ed12b=_0x3ed12b-0x0;var _0x2e49de=_0x4328[_0x3ed12b];return _0x2e49de;};'use strict';var Sequelize=require(_0x8432('0x0'));module[_0x8432('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x8432('0x2')],'allowNull':![],'defaultValue':_0x8432('0x3')},'appdata':{'type':Sequelize[_0x8432('0x4')]()},'description':{'type':Sequelize[_0x8432('0x2')]},'interval':{'type':Sequelize[_0x8432('0x2')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file +var _0x5a9c=['INTEGER','STRING','noop','TEXT','*,*,*,*','exports'];(function(_0x46d0c9,_0x526bfa){var _0x174506=function(_0x654bc6){while(--_0x654bc6){_0x46d0c9['push'](_0x46d0c9['shift']());}};_0x174506(++_0x526bfa);}(_0x5a9c,0xcb));var _0xc5a9=function(_0x27fa03,_0x19d0ce){_0x27fa03=_0x27fa03-0x0;var _0x1746c3=_0x5a9c[_0x27fa03];return _0x1746c3;};'use strict';var Sequelize=require('sequelize');module[_0xc5a9('0x0')]={'priority':{'type':Sequelize[_0xc5a9('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0xc5a9('0x2')],'allowNull':![],'defaultValue':_0xc5a9('0x3')},'appdata':{'type':Sequelize[_0xc5a9('0x4')]()},'description':{'type':Sequelize[_0xc5a9('0x2')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0xc5a9('0x5')}}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js index 432e4b8..6ff79cc 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 _0xcbe1=['lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','json','offset','limit','undefined','set','apply','save','update','then','destroy','error','stack','name','send','show','params','keys','ChatApplication','rawAttributes','query','filters','intersection','model','attributes','fields','length','includeAll','include','find','catch','body','rimraf','bluebird','mustache','path','to-csv','ejs'];(function(_0x1c2ea4,_0x16ac04){var _0x575866=function(_0x47272b){while(--_0x47272b){_0x1c2ea4['push'](_0x1c2ea4['shift']());}};_0x575866(++_0x16ac04);}(_0xcbe1,0x1a2));var _0x1cbe=function(_0x1509f7,_0x2fc1d2){_0x1509f7=_0x1509f7-0x0;var _0x3211a0=_0xcbe1[_0x1509f7];return _0x3211a0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1cbe('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x1cbe('0x1'));var Mustache=require(_0x1cbe('0x2'));var util=require('util');var path=require(_0x1cbe('0x3'));var sox=require('sox');var csv=require(_0x1cbe('0x4'));var ejs=require(_0x1cbe('0x5'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x1cbe('0x6'));var squel=require(_0x1cbe('0x7'));var crypto=require(_0x1cbe('0x8'));var jsforce=require(_0x1cbe('0x9'));var deskjs=require(_0x1cbe('0xa'));var toCsv=require(_0x1cbe('0x4'));var querystring=require(_0x1cbe('0xb'));var Papa=require(_0x1cbe('0xc'));var Redis=require('ioredis');var authService=require(_0x1cbe('0xd'));var qs=require('../../components/parsers/qs');var as=require(_0x1cbe('0xe'));var hardwareService=require(_0x1cbe('0xf'));var logger=require(_0x1cbe('0x10'))(_0x1cbe('0x11'));var utils=require('../../config/utils');var config=require(_0x1cbe('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0x1cbe('0x13'))['db'];function respondWithStatusCode(_0x15f8a9,_0x4959a8){_0x4959a8=_0x4959a8||0xcc;return function(_0x42da0e){if(_0x42da0e){return _0x15f8a9[_0x1cbe('0x14')](_0x4959a8);}return _0x15f8a9[_0x1cbe('0x15')](_0x4959a8)['end']();};}function respondWithResult(_0x244e61,_0x42a345){_0x42a345=_0x42a345||0xc8;return function(_0x2304c2){if(_0x2304c2){return _0x244e61[_0x1cbe('0x15')](_0x42a345)[_0x1cbe('0x16')](_0x2304c2);}};}function respondWithFilteredResult(_0x14784f,_0x3eb11f){return function(_0x25093a){if(_0x25093a){var _0x109cd7=typeof _0x3eb11f[_0x1cbe('0x17')]==='undefined'&&typeof _0x3eb11f[_0x1cbe('0x18')]===_0x1cbe('0x19');var _0x244a1d=_0x25093a['count'];var _0x1836a7=_0x109cd7?0x0:_0x3eb11f[_0x1cbe('0x17')];var _0x45268b=_0x109cd7?_0x25093a['count']:_0x3eb11f['offset']+_0x3eb11f[_0x1cbe('0x18')];var _0x75e87a;if(_0x45268b>=_0x244a1d){_0x45268b=_0x244a1d;_0x75e87a=0xc8;}else{_0x75e87a=0xce;}_0x14784f[_0x1cbe('0x15')](_0x75e87a);return _0x14784f[_0x1cbe('0x1a')]('Content-Range',_0x1836a7+'-'+_0x45268b+'/'+_0x244a1d)['json'](_0x25093a);}return null;};}function patchUpdates(_0x3f2d7d){return function(_0x3bf29c){try{jsonpatch[_0x1cbe('0x1b')](_0x3bf29c,_0x3f2d7d,!![]);}catch(_0x56f3c6){return BPromise['reject'](_0x56f3c6);}return _0x3bf29c[_0x1cbe('0x1c')]();};}function saveUpdates(_0x4aff8d,_0x33b678){return function(_0x192a76){if(_0x192a76){return _0x192a76[_0x1cbe('0x1d')](_0x4aff8d)[_0x1cbe('0x1e')](function(_0x19b93f){return _0x19b93f;});}return null;};}function removeEntity(_0x1e175b,_0x2aedba){return function(_0x23495c){if(_0x23495c){return _0x23495c[_0x1cbe('0x1f')]()['then'](function(){_0x1e175b[_0x1cbe('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1fb6aa,_0x2208bd){return function(_0x384845){if(!_0x384845){_0x1fb6aa['sendStatus'](0x194);}return _0x384845;};}function handleError(_0x26a5b7,_0x17066a){_0x17066a=_0x17066a||0x1f4;return function(_0x1b391d){logger[_0x1cbe('0x20')](_0x1b391d[_0x1cbe('0x21')]);if(_0x1b391d[_0x1cbe('0x22')]){delete _0x1b391d['name'];}_0x26a5b7[_0x1cbe('0x15')](_0x17066a)[_0x1cbe('0x23')](_0x1b391d);};}exports[_0x1cbe('0x24')]=function(_0x5d781d,_0x4c840e){var _0xa30ec5={'raw':!![],'where':{'id':_0x5d781d[_0x1cbe('0x25')]['id']}},_0x52d0d5={};_0x52d0d5['model']=_[_0x1cbe('0x26')](db[_0x1cbe('0x27')][_0x1cbe('0x28')]);_0x52d0d5[_0x1cbe('0x29')]=_['keys'](_0x5d781d[_0x1cbe('0x29')]);_0x52d0d5[_0x1cbe('0x2a')]=_[_0x1cbe('0x2b')](_0x52d0d5[_0x1cbe('0x2c')],_0x52d0d5[_0x1cbe('0x29')]);_0xa30ec5[_0x1cbe('0x2d')]=_['intersection'](_0x52d0d5['model'],qs[_0x1cbe('0x2e')](_0x5d781d['query'][_0x1cbe('0x2e')]));_0xa30ec5[_0x1cbe('0x2d')]=_0xa30ec5['attributes'][_0x1cbe('0x2f')]?_0xa30ec5['attributes']:_0x52d0d5[_0x1cbe('0x2c')];if(_0x5d781d[_0x1cbe('0x29')][_0x1cbe('0x30')]){_0xa30ec5[_0x1cbe('0x31')]=[{'all':!![]}];}_0xa30ec5=_['merge']({},_0xa30ec5,_0x5d781d['options']);return db[_0x1cbe('0x27')][_0x1cbe('0x32')](_0xa30ec5)[_0x1cbe('0x1e')](handleEntityNotFound(_0x4c840e,null))[_0x1cbe('0x1e')](respondWithResult(_0x4c840e,null))[_0x1cbe('0x33')](handleError(_0x4c840e,null));};exports['update']=function(_0x431f13,_0x1602fd){if(_0x431f13['body']['id']){delete _0x431f13[_0x1cbe('0x34')]['id'];}return db[_0x1cbe('0x27')][_0x1cbe('0x32')]({'where':{'id':_0x431f13['params']['id']}})['then'](handleEntityNotFound(_0x1602fd,null))[_0x1cbe('0x1e')](saveUpdates(_0x431f13[_0x1cbe('0x34')],null))[_0x1cbe('0x1e')](respondWithResult(_0x1602fd,null))[_0x1cbe('0x33')](handleError(_0x1602fd,null));};exports[_0x1cbe('0x1f')]=function(_0x42d45b,_0x2bdc30){return db[_0x1cbe('0x27')]['find']({'where':{'id':_0x42d45b[_0x1cbe('0x25')]['id']}})['then'](handleEntityNotFound(_0x2bdc30,null))[_0x1cbe('0x1e')](removeEntity(_0x2bdc30,null))['catch'](handleError(_0x2bdc30,null));}; \ No newline at end of file +var _0x2ec8=['include','options','ChatApplication','find','update','body','catch','eml-format','rimraf','zip-dir','fast-json-patch','moment','util','sox','to-csv','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','offset','undefined','limit','count','Content-Range','apply','reject','save','then','destroy','stack','name','send','show','params','model','keys','rawAttributes','query','filters','intersection','fields','attributes','length','includeAll'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x2ec8,0x188));var _0x82ec=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x2ec8[_0x6131cd];return _0x47e916;};'use strict';var emlformat=require(_0x82ec('0x0'));var rimraf=require(_0x82ec('0x1'));var zipdir=require(_0x82ec('0x2'));var jsonpatch=require(_0x82ec('0x3'));var rp=require('request-promise');var moment=require(_0x82ec('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x82ec('0x5'));var path=require('path');var sox=require(_0x82ec('0x6'));var csv=require(_0x82ec('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x82ec('0x8'));var jsforce=require(_0x82ec('0x9'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x82ec('0xa'));var Papa=require(_0x82ec('0xb'));var Redis=require('ioredis');var authService=require(_0x82ec('0xc'));var qs=require(_0x82ec('0xd'));var as=require(_0x82ec('0xe'));var hardwareService=require(_0x82ec('0xf'));var logger=require(_0x82ec('0x10'))('api');var utils=require(_0x82ec('0x11'));var config=require(_0x82ec('0x12'));var licenseUtil=require(_0x82ec('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x317339,_0x1eb33e){_0x1eb33e=_0x1eb33e||0xcc;return function(_0x53d03a){if(_0x53d03a){return _0x317339[_0x82ec('0x14')](_0x1eb33e);}return _0x317339['status'](_0x1eb33e)[_0x82ec('0x15')]();};}function respondWithResult(_0x43ec87,_0x20d982){_0x20d982=_0x20d982||0xc8;return function(_0x5b7cc2){if(_0x5b7cc2){return _0x43ec87[_0x82ec('0x16')](_0x20d982)['json'](_0x5b7cc2);}};}function respondWithFilteredResult(_0x1f0b2c,_0x4ce834){return function(_0x5dd9d9){if(_0x5dd9d9){var _0x57a4f3=typeof _0x4ce834[_0x82ec('0x17')]===_0x82ec('0x18')&&typeof _0x4ce834[_0x82ec('0x19')]===_0x82ec('0x18');var _0x212b3f=_0x5dd9d9[_0x82ec('0x1a')];var _0xb5bd7b=_0x57a4f3?0x0:_0x4ce834['offset'];var _0x4259ff=_0x57a4f3?_0x5dd9d9[_0x82ec('0x1a')]:_0x4ce834['offset']+_0x4ce834['limit'];var _0x430443;if(_0x4259ff>=_0x212b3f){_0x4259ff=_0x212b3f;_0x430443=0xc8;}else{_0x430443=0xce;}_0x1f0b2c[_0x82ec('0x16')](_0x430443);return _0x1f0b2c['set'](_0x82ec('0x1b'),_0xb5bd7b+'-'+_0x4259ff+'/'+_0x212b3f)['json'](_0x5dd9d9);}return null;};}function patchUpdates(_0x2e687e){return function(_0x52eb20){try{jsonpatch[_0x82ec('0x1c')](_0x52eb20,_0x2e687e,!![]);}catch(_0x29ba81){return BPromise[_0x82ec('0x1d')](_0x29ba81);}return _0x52eb20[_0x82ec('0x1e')]();};}function saveUpdates(_0x161cb4,_0x11564f){return function(_0x35d865){if(_0x35d865){return _0x35d865['update'](_0x161cb4)[_0x82ec('0x1f')](function(_0x5e8abb){return _0x5e8abb;});}return null;};}function removeEntity(_0x8cb8a0,_0x1839cf){return function(_0x3e341d){if(_0x3e341d){return _0x3e341d[_0x82ec('0x20')]()[_0x82ec('0x1f')](function(){_0x8cb8a0['status'](0xcc)[_0x82ec('0x15')]();});}};}function handleEntityNotFound(_0x14ddcf,_0x3b66d5){return function(_0x22f671){if(!_0x22f671){_0x14ddcf['sendStatus'](0x194);}return _0x22f671;};}function handleError(_0x24ce5f,_0x533a2e){_0x533a2e=_0x533a2e||0x1f4;return function(_0x397abc){logger['error'](_0x397abc[_0x82ec('0x21')]);if(_0x397abc[_0x82ec('0x22')]){delete _0x397abc[_0x82ec('0x22')];}_0x24ce5f[_0x82ec('0x16')](_0x533a2e)[_0x82ec('0x23')](_0x397abc);};}exports[_0x82ec('0x24')]=function(_0xaa0f81,_0x21e69d){var _0x4b94d1={'raw':!![],'where':{'id':_0xaa0f81[_0x82ec('0x25')]['id']}},_0x12cb9e={};_0x12cb9e[_0x82ec('0x26')]=_[_0x82ec('0x27')](db['ChatApplication'][_0x82ec('0x28')]);_0x12cb9e[_0x82ec('0x29')]=_['keys'](_0xaa0f81[_0x82ec('0x29')]);_0x12cb9e[_0x82ec('0x2a')]=_[_0x82ec('0x2b')](_0x12cb9e[_0x82ec('0x26')],_0x12cb9e[_0x82ec('0x29')]);_0x4b94d1['attributes']=_[_0x82ec('0x2b')](_0x12cb9e[_0x82ec('0x26')],qs['fields'](_0xaa0f81[_0x82ec('0x29')][_0x82ec('0x2c')]));_0x4b94d1[_0x82ec('0x2d')]=_0x4b94d1['attributes'][_0x82ec('0x2e')]?_0x4b94d1[_0x82ec('0x2d')]:_0x12cb9e['model'];if(_0xaa0f81[_0x82ec('0x29')][_0x82ec('0x2f')]){_0x4b94d1[_0x82ec('0x30')]=[{'all':!![]}];}_0x4b94d1=_['merge']({},_0x4b94d1,_0xaa0f81[_0x82ec('0x31')]);return db[_0x82ec('0x32')][_0x82ec('0x33')](_0x4b94d1)[_0x82ec('0x1f')](handleEntityNotFound(_0x21e69d,null))[_0x82ec('0x1f')](respondWithResult(_0x21e69d,null))['catch'](handleError(_0x21e69d,null));};exports[_0x82ec('0x34')]=function(_0xecf6a1,_0x21a4ef){if(_0xecf6a1[_0x82ec('0x35')]['id']){delete _0xecf6a1[_0x82ec('0x35')]['id'];}return db[_0x82ec('0x32')][_0x82ec('0x33')]({'where':{'id':_0xecf6a1['params']['id']}})[_0x82ec('0x1f')](handleEntityNotFound(_0x21a4ef,null))[_0x82ec('0x1f')](saveUpdates(_0xecf6a1[_0x82ec('0x35')],null))[_0x82ec('0x1f')](respondWithResult(_0x21a4ef,null))[_0x82ec('0x36')](handleError(_0x21a4ef,null));};exports[_0x82ec('0x20')]=function(_0x41d47c,_0xd93c01){return db[_0x82ec('0x32')][_0x82ec('0x33')]({'where':{'id':_0x41d47c['params']['id']}})['then'](handleEntityNotFound(_0xd93c01,null))['then'](removeEntity(_0xd93c01,null))[_0x82ec('0x36')](handleError(_0xd93c01,null));}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js index 9c108c5..8881725 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 _0x87e6=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','ChatApplication','chat_applications','utf8mb4','utf8mb4_unicode_ci','lodash'];(function(_0x1c4e07,_0x56e8a4){var _0x344614=function(_0xfe9ecd){while(--_0xfe9ecd){_0x1c4e07['push'](_0x1c4e07['shift']());}};_0x344614(++_0x56e8a4);}(_0x87e6,0x1a3));var _0x687e=function(_0x252d97,_0x271b41){_0x252d97=_0x252d97-0x0;var _0x5d1e86=_0x87e6[_0x252d97];return _0x5d1e86;};'use strict';var _=require(_0x687e('0x0'));var util=require(_0x687e('0x1'));var logger=require(_0x687e('0x2'))(_0x687e('0x3'));var moment=require(_0x687e('0x4'));var BPromise=require(_0x687e('0x5'));var rp=require(_0x687e('0x6'));var fs=require('fs');var path=require(_0x687e('0x7'));var rimraf=require(_0x687e('0x8'));var config=require(_0x687e('0x9'));var attributes=require('./chatApplication.attributes');module[_0x687e('0xa')]=function(_0x2886ce,_0x4d0403){return _0x2886ce['define'](_0x687e('0xb'),attributes,{'tableName':_0x687e('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x687e('0xd'),'collate':_0x687e('0xe')});}; \ No newline at end of file +var _0x53d5=['moment','bluebird','request-promise','rimraf','../../config/environment','./chatApplication.attributes','exports','define','ChatApplication','chat_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api'];(function(_0x53b034,_0x4d5512){var _0xbc8392=function(_0x5dbf7d){while(--_0x5dbf7d){_0x53b034['push'](_0x53b034['shift']());}};_0xbc8392(++_0x4d5512);}(_0x53d5,0x1cc));var _0x553d=function(_0x1ada8b,_0x2b4817){_0x1ada8b=_0x1ada8b-0x0;var _0x5ca2e7=_0x53d5[_0x1ada8b];return _0x5ca2e7;};'use strict';var _=require(_0x553d('0x0'));var util=require(_0x553d('0x1'));var logger=require(_0x553d('0x2'))(_0x553d('0x3'));var moment=require(_0x553d('0x4'));var BPromise=require(_0x553d('0x5'));var rp=require(_0x553d('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x553d('0x7'));var config=require(_0x553d('0x8'));var attributes=require(_0x553d('0x9'));module[_0x553d('0xa')]=function(_0x2936ad,_0x5328ca){return _0x2936ad[_0x553d('0xb')](_0x553d('0xc'),attributes,{'tableName':_0x553d('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x553d('0xe'),'collate':_0x553d('0xf')});}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.rpc.js b/server/api/chatApplication/chatApplication.rpc.js index 281a359..ad94fe0 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 _0x8a45=['jayson/promise','http','then','info','request\x20sent','debug','ChatApplication,\x20%s,\x20%s,\x20%s','error','ChatApplication,\x20%s,\x20%s','message','result','catch','lodash','moment','bluebird','ioredis','../../config/utils','../../config/logger'];(function(_0x1999ca,_0x2951ea){var _0xfcfdf6=function(_0x33b015){while(--_0x33b015){_0x1999ca['push'](_0x1999ca['shift']());}};_0xfcfdf6(++_0x2951ea);}(_0x8a45,0xc0));var _0x58a4=function(_0x9c7d6a,_0x1aa2cc){_0x9c7d6a=_0x9c7d6a-0x0;var _0x145395=_0x8a45[_0x9c7d6a];return _0x145395;};'use strict';var _=require(_0x58a4('0x0'));var util=require('util');var moment=require(_0x58a4('0x1'));var BPromise=require(_0x58a4('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x58a4('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x58a4('0x4'));var logger=require(_0x58a4('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0x58a4('0x6'));var client=jayson['client'][_0x58a4('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x470bd0,_0x553175,_0x280071){return new BPromise(function(_0x47acad,_0x1aa105){return client['request'](_0x470bd0,_0x280071)[_0x58a4('0x8')](function(_0x489cd0){logger[_0x58a4('0x9')]('ChatApplication,\x20%s,\x20%s',_0x553175,_0x58a4('0xa'));logger[_0x58a4('0xb')](_0x58a4('0xc'),_0x553175,'request\x20sent',JSON['stringify'](_0x489cd0));if(_0x489cd0[_0x58a4('0xd')]){if(_0x489cd0[_0x58a4('0xd')]['code']===0x1f4){logger[_0x58a4('0xd')](_0x58a4('0xe'),_0x553175,_0x489cd0[_0x58a4('0xd')][_0x58a4('0xf')]);return _0x1aa105(_0x489cd0[_0x58a4('0xd')]['message']);}logger[_0x58a4('0xd')](_0x58a4('0xe'),_0x553175,_0x489cd0[_0x58a4('0xd')][_0x58a4('0xf')]);return _0x47acad(_0x489cd0[_0x58a4('0xd')][_0x58a4('0xf')]);}else{logger[_0x58a4('0x9')]('ChatApplication,\x20%s,\x20%s',_0x553175,_0x58a4('0xa'));_0x47acad(_0x489cd0[_0x58a4('0x10')][_0x58a4('0xf')]);}})[_0x58a4('0x11')](function(_0x53fa66){logger[_0x58a4('0xd')](_0x58a4('0xe'),_0x553175,_0x53fa66);_0x1aa105(_0x53fa66);});});} \ No newline at end of file +var _0xed3e=['client','http','request','then','info','ChatApplication,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','jayson/promise'];(function(_0x1a29c5,_0x4665ce){var _0x25e4d2=function(_0x134030){while(--_0x134030){_0x1a29c5['push'](_0x1a29c5['shift']());}};_0x25e4d2(++_0x4665ce);}(_0xed3e,0x1c5));var _0xeed3=function(_0x5d4c24,_0x1167bc){_0x5d4c24=_0x5d4c24-0x0;var _0x17054c=_0xed3e[_0x5d4c24];return _0x17054c;};'use strict';var _=require(_0xeed3('0x0'));var util=require(_0xeed3('0x1'));var moment=require(_0xeed3('0x2'));var BPromise=require(_0xeed3('0x3'));var rs=require(_0xeed3('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xeed3('0x5'));var logger=require(_0xeed3('0x6'))(_0xeed3('0x7'));var config=require('../../config/environment');var jayson=require(_0xeed3('0x8'));var client=jayson[_0xeed3('0x9')][_0xeed3('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x28151b,_0x2beba1,_0x5879e0){return new BPromise(function(_0x86c5ba,_0x52e87f){return client[_0xeed3('0xb')](_0x28151b,_0x5879e0)[_0xeed3('0xc')](function(_0xef4f69){logger[_0xeed3('0xd')](_0xeed3('0xe'),_0x2beba1,_0xeed3('0xf'));logger[_0xeed3('0x10')]('ChatApplication,\x20%s,\x20%s,\x20%s',_0x2beba1,_0xeed3('0xf'),JSON[_0xeed3('0x11')](_0xef4f69));if(_0xef4f69[_0xeed3('0x12')]){if(_0xef4f69[_0xeed3('0x12')][_0xeed3('0x13')]===0x1f4){logger['error'](_0xeed3('0xe'),_0x2beba1,_0xef4f69[_0xeed3('0x12')][_0xeed3('0x14')]);return _0x52e87f(_0xef4f69['error']['message']);}logger['error'](_0xeed3('0xe'),_0x2beba1,_0xef4f69[_0xeed3('0x12')]['message']);return _0x86c5ba(_0xef4f69['error'][_0xeed3('0x14')]);}else{logger[_0xeed3('0xd')](_0xeed3('0xe'),_0x2beba1,_0xeed3('0xf'));_0x86c5ba(_0xef4f69['result'][_0xeed3('0x14')]);}})[_0xeed3('0x15')](function(_0x25b84d){logger[_0xeed3('0x12')](_0xeed3('0xe'),_0x2beba1,_0x25b84d);_0x52e87f(_0x25b84d);});});} \ No newline at end of file diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js index 875a90e..8523e57 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 _0x94d6=['../../components/interaction/service','./chatApplication.controller','/:id','isAuthenticated','show','put','delete','destroy','multer','util','path','connect-timeout','fs-extra','../../components/auth/service'];(function(_0x328b1c,_0xec0b4f){var _0x4dbeaa=function(_0x432519){while(--_0x432519){_0x328b1c['push'](_0x328b1c['shift']());}};_0x4dbeaa(++_0xec0b4f);}(_0x94d6,0x86));var _0x694d=function(_0x25c266,_0x4dca1a){_0x25c266=_0x25c266-0x0;var _0x273de8=_0x94d6[_0x25c266];return _0x273de8;};'use strict';var multer=require(_0x694d('0x0'));var util=require(_0x694d('0x1'));var path=require(_0x694d('0x2'));var timeout=require(_0x694d('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x694d('0x4'));var auth=require(_0x694d('0x5'));var interaction=require(_0x694d('0x6'));var config=require('../../config/environment');var controller=require(_0x694d('0x7'));router['get'](_0x694d('0x8'),auth[_0x694d('0x9')](),controller[_0x694d('0xa')]);router[_0x694d('0xb')](_0x694d('0x8'),auth[_0x694d('0x9')](),controller['update']);router[_0x694d('0xc')](_0x694d('0x8'),auth[_0x694d('0x9')](),controller[_0x694d('0xd')]);module['exports']=router; \ No newline at end of file +var _0x321d=['multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','get','isAuthenticated','show','put','/:id','update','destroy','exports'];(function(_0x33feca,_0x2bd9ae){var _0x3c558f=function(_0x11bede){while(--_0x11bede){_0x33feca['push'](_0x33feca['shift']());}};_0x3c558f(++_0x2bd9ae);}(_0x321d,0x1b0));var _0xd321=function(_0x294579,_0x5d079f){_0x294579=_0x294579-0x0;var _0x577487=_0x321d[_0x294579];return _0x577487;};'use strict';var multer=require(_0xd321('0x0'));var util=require(_0xd321('0x1'));var path=require(_0xd321('0x2'));var timeout=require(_0xd321('0x3'));var express=require(_0xd321('0x4'));var router=express[_0xd321('0x5')]();var fs_extra=require(_0xd321('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xd321('0x7'));var config=require('../../config/environment');var controller=require('./chatApplication.controller');router[_0xd321('0x8')]('/:id',auth[_0xd321('0x9')](),controller[_0xd321('0xa')]);router[_0xd321('0xb')](_0xd321('0xc'),auth[_0xd321('0x9')](),controller[_0xd321('0xd')]);router['delete'](_0xd321('0xc'),auth[_0xd321('0x9')](),controller[_0xd321('0xe')]);module[_0xd321('0xf')]=router; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.attributes.js b/server/api/chatGroup/chatGroup.attributes.js index c20e069..4470a7f 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 _0xca3d=['sequelize','exports','STRING','BOOLEAN'];(function(_0x15b942,_0xbdfd4e){var _0x591756=function(_0xa1f2c8){while(--_0xa1f2c8){_0x15b942['push'](_0x15b942['shift']());}};_0x591756(++_0xbdfd4e);}(_0xca3d,0x68));var _0xdca3=function(_0x3e6188,_0xd8d390){_0x3e6188=_0x3e6188-0x0;var _0x47bfe6=_0xca3d[_0x3e6188];return _0x47bfe6;};'use strict';var Sequelize=require(_0xdca3('0x0'));module[_0xdca3('0x1')]={'name':{'type':Sequelize[_0xdca3('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xdca3('0x2')]},'write':{'type':Sequelize[_0xdca3('0x3')],'defaultValue':!![]}}; \ No newline at end of file +var _0x5e0e=['BOOLEAN','sequelize','exports','STRING'];(function(_0x134c2e,_0x3573c4){var _0x2825db=function(_0x2a574d){while(--_0x2a574d){_0x134c2e['push'](_0x134c2e['shift']());}};_0x2825db(++_0x3573c4);}(_0x5e0e,0x89));var _0xe5e0=function(_0x5d19f8,_0x56a7bb){_0x5d19f8=_0x5d19f8-0x0;var _0x42e896=_0x5e0e[_0x5d19f8];return _0x42e896;};'use strict';var Sequelize=require(_0xe5e0('0x0'));module[_0xe5e0('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0xe5e0('0x2')]},'write':{'type':Sequelize[_0xe5e0('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 a90b8c0..497f4b6 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 _0x206d=['jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./chatGroup.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','reject','update','destroy','then','error','stack','name','send','ChatGroup','rawAttributes','fieldName','model','map','query','keys','intersection','attributes','length','hasOwnProperty','order','sort','where','filters','merge','type','filter','options','include','findAll','rows','show','fields','find','catch','body','params','describe','ChatInternalMessage','user','toInteger','addMembers','ids','findOne','User','pick','getMembers','nolimit','removeMembers','addMessage','create','getMessages','$gte','split','YYYY-MM-DD\x20HH:mm:ss','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','lodash'];(function(_0x460da1,_0x39c1f7){var _0x40bd3f=function(_0x2ad582){while(--_0x2ad582){_0x460da1['push'](_0x460da1['shift']());}};_0x40bd3f(++_0x39c1f7);}(_0x206d,0x10a));var _0xd206=function(_0x297e68,_0x4d9576){_0x297e68=_0x297e68-0x0;var _0x2b296c=_0x206d[_0x297e68];return _0x2b296c;};'use strict';var emlformat=require(_0xd206('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd206('0x1'));var jsonpatch=require(_0xd206('0x2'));var rp=require(_0xd206('0x3'));var moment=require('moment');var BPromise=require(_0xd206('0x4'));var Mustache=require(_0xd206('0x5'));var util=require(_0xd206('0x6'));var path=require(_0xd206('0x7'));var sox=require(_0xd206('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd206('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xd206('0xa'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xd206('0xb'));var Papa=require(_0xd206('0xc'));var Redis=require(_0xd206('0xd'));var authService=require(_0xd206('0xe'));var qs=require(_0xd206('0xf'));var as=require(_0xd206('0x10'));var hardwareService=require(_0xd206('0x11'));var logger=require(_0xd206('0x12'))(_0xd206('0x13'));var utils=require(_0xd206('0x14'));var config=require(_0xd206('0x15'));var licenseUtil=require(_0xd206('0x16'));var db=require(_0xd206('0x17'))['db'];config[_0xd206('0x18')]=_[_0xd206('0x19')](config[_0xd206('0x18')],{'host':'localhost','port':0x18eb});var socket=require(_0xd206('0x1a'))(new Redis(config[_0xd206('0x18')]));require(_0xd206('0x1b'))[_0xd206('0x1c')](socket);function respondWithStatusCode(_0x116fcb,_0x460137){_0x460137=_0x460137||0xcc;return function(_0x29e980){if(_0x29e980){return _0x116fcb[_0xd206('0x1d')](_0x460137);}return _0x116fcb[_0xd206('0x1e')](_0x460137)[_0xd206('0x1f')]();};}function respondWithResult(_0x947490,_0x20cd11){_0x20cd11=_0x20cd11||0xc8;return function(_0xe1bf1e){if(_0xe1bf1e){return _0x947490['status'](_0x20cd11)[_0xd206('0x20')](_0xe1bf1e);}};}function respondWithFilteredResult(_0x1ea061,_0x4a5fc2){return function(_0x7de165){if(_0x7de165){var _0x288463=typeof _0x4a5fc2[_0xd206('0x21')]===_0xd206('0x22')&&typeof _0x4a5fc2[_0xd206('0x23')]===_0xd206('0x22');var _0x5dfb00=_0x7de165['count'];var _0x1eb733=_0x288463?0x0:_0x4a5fc2[_0xd206('0x21')];var _0x4cf06a=_0x288463?_0x7de165[_0xd206('0x24')]:_0x4a5fc2['offset']+_0x4a5fc2[_0xd206('0x23')];var _0x5e93c6;if(_0x4cf06a>=_0x5dfb00){_0x4cf06a=_0x5dfb00;_0x5e93c6=0xc8;}else{_0x5e93c6=0xce;}_0x1ea061[_0xd206('0x1e')](_0x5e93c6);return _0x1ea061[_0xd206('0x25')]('Content-Range',_0x1eb733+'-'+_0x4cf06a+'/'+_0x5dfb00)[_0xd206('0x20')](_0x7de165);}return null;};}function patchUpdates(_0xca88a2){return function(_0x46d740){try{jsonpatch['apply'](_0x46d740,_0xca88a2,!![]);}catch(_0x5430fe){return BPromise[_0xd206('0x26')](_0x5430fe);}return _0x46d740['save']();};}function saveUpdates(_0x12d9e7,_0x1e5dcf){return function(_0x18730a){if(_0x18730a){return _0x18730a[_0xd206('0x27')](_0x12d9e7)['then'](function(_0x2200a6){return _0x2200a6;});}return null;};}function removeEntity(_0x31c81b,_0x2a4713){return function(_0x1e8b0d){if(_0x1e8b0d){return _0x1e8b0d[_0xd206('0x28')]()[_0xd206('0x29')](function(){_0x31c81b[_0xd206('0x1e')](0xcc)[_0xd206('0x1f')]();});}};}function handleEntityNotFound(_0x1cb021,_0x562f97){return function(_0x187606){if(!_0x187606){_0x1cb021[_0xd206('0x1d')](0x194);}return _0x187606;};}function handleError(_0x3a62b6,_0x364691){_0x364691=_0x364691||0x1f4;return function(_0x2d48dd){logger[_0xd206('0x2a')](_0x2d48dd[_0xd206('0x2b')]);if(_0x2d48dd[_0xd206('0x2c')]){delete _0x2d48dd[_0xd206('0x2c')];}_0x3a62b6[_0xd206('0x1e')](_0x364691)[_0xd206('0x2d')](_0x2d48dd);};}exports['index']=function(_0x1040a0,_0x1e6dfa){var _0x3a5fe5={},_0x5a9610={},_0x24e6b2={'count':0x0,'rows':[]};var _0x5c45d6=_['map'](db[_0xd206('0x2e')][_0xd206('0x2f')],function(_0x263680){return{'name':_0x263680[_0xd206('0x30')],'type':_0x263680['type']['key']};});_0x5a9610[_0xd206('0x31')]=_[_0xd206('0x32')](_0x5c45d6,_0xd206('0x2c'));_0x5a9610[_0xd206('0x33')]=_[_0xd206('0x34')](_0x1040a0[_0xd206('0x33')]);_0x5a9610['filters']=_[_0xd206('0x35')](_0x5a9610[_0xd206('0x31')],_0x5a9610[_0xd206('0x33')]);_0x3a5fe5[_0xd206('0x36')]=_[_0xd206('0x35')](_0x5a9610[_0xd206('0x31')],qs['fields'](_0x1040a0[_0xd206('0x33')]['fields']));_0x3a5fe5['attributes']=_0x3a5fe5['attributes'][_0xd206('0x37')]?_0x3a5fe5[_0xd206('0x36')]:_0x5a9610[_0xd206('0x31')];if(!_0x1040a0[_0xd206('0x33')][_0xd206('0x38')]('nolimit')){_0x3a5fe5[_0xd206('0x23')]=qs['limit'](_0x1040a0[_0xd206('0x33')][_0xd206('0x23')]);_0x3a5fe5['offset']=qs[_0xd206('0x21')](_0x1040a0[_0xd206('0x33')][_0xd206('0x21')]);}_0x3a5fe5[_0xd206('0x39')]=qs[_0xd206('0x3a')](_0x1040a0['query'][_0xd206('0x3a')]);_0x3a5fe5[_0xd206('0x3b')]=qs[_0xd206('0x3c')](_['pick'](_0x1040a0[_0xd206('0x33')],_0x5a9610[_0xd206('0x3c')]),_0x5c45d6);if(_0x1040a0[_0xd206('0x33')]['filter']){_0x3a5fe5[_0xd206('0x3b')]=_[_0xd206('0x3d')](_0x3a5fe5['where'],{'$or':_[_0xd206('0x32')](_0x5c45d6,function(_0x1a529b){if(_0x1a529b[_0xd206('0x3e')]!=='VIRTUAL'){var _0x7fa216={};_0x7fa216[_0x1a529b[_0xd206('0x2c')]]={'$like':'%'+_0x1040a0[_0xd206('0x33')][_0xd206('0x3f')]+'%'};return _0x7fa216;}})});}_0x3a5fe5=_[_0xd206('0x3d')]({},_0x3a5fe5,_0x1040a0[_0xd206('0x40')]);var _0x1e8dfe={'where':_0x3a5fe5[_0xd206('0x3b')]};return db['ChatGroup']['count'](_0x1e8dfe)['then'](function(_0x106a0a){_0x24e6b2[_0xd206('0x24')]=_0x106a0a;if(_0x1040a0['query']['includeAll']){_0x3a5fe5[_0xd206('0x41')]=[{'all':!![]}];}return db[_0xd206('0x2e')][_0xd206('0x42')](_0x3a5fe5);})[_0xd206('0x29')](function(_0x3afa7a){_0x24e6b2[_0xd206('0x43')]=_0x3afa7a;return _0x24e6b2;})[_0xd206('0x29')](respondWithFilteredResult(_0x1e6dfa,_0x3a5fe5))['catch'](handleError(_0x1e6dfa,null));};exports[_0xd206('0x44')]=function(_0x5d76bc,_0x4a86e3){var _0x5ecac8={'raw':!![],'where':{'id':_0x5d76bc['params']['id']}},_0x2e8182={};_0x2e8182['model']=_[_0xd206('0x34')](db['ChatGroup']['rawAttributes']);_0x2e8182['query']=_[_0xd206('0x34')](_0x5d76bc['query']);_0x2e8182[_0xd206('0x3c')]=_[_0xd206('0x35')](_0x2e8182[_0xd206('0x31')],_0x2e8182[_0xd206('0x33')]);_0x5ecac8[_0xd206('0x36')]=_[_0xd206('0x35')](_0x2e8182['model'],qs[_0xd206('0x45')](_0x5d76bc[_0xd206('0x33')][_0xd206('0x45')]));_0x5ecac8['attributes']=_0x5ecac8['attributes']['length']?_0x5ecac8[_0xd206('0x36')]:_0x2e8182[_0xd206('0x31')];if(_0x5d76bc[_0xd206('0x33')]['includeAll']){_0x5ecac8['include']=[{'all':!![]}];}_0x5ecac8=_[_0xd206('0x3d')]({},_0x5ecac8,_0x5d76bc['options']);return db[_0xd206('0x2e')][_0xd206('0x46')](_0x5ecac8)[_0xd206('0x29')](handleEntityNotFound(_0x4a86e3,null))[_0xd206('0x29')](respondWithResult(_0x4a86e3,null))[_0xd206('0x47')](handleError(_0x4a86e3,null));};exports['create']=function(_0x445cbd,_0x47c445){return db[_0xd206('0x2e')]['create'](_0x445cbd[_0xd206('0x48')],{})['then'](respondWithResult(_0x47c445,0xc9))[_0xd206('0x47')](handleError(_0x47c445,null));};exports[_0xd206('0x27')]=function(_0x58b79e,_0xea2b1){if(_0x58b79e['body']['id']){delete _0x58b79e['body']['id'];}return db[_0xd206('0x2e')][_0xd206('0x46')]({'where':{'id':_0x58b79e[_0xd206('0x49')]['id']}})[_0xd206('0x29')](handleEntityNotFound(_0xea2b1,null))['then'](saveUpdates(_0x58b79e[_0xd206('0x48')],null))[_0xd206('0x29')](respondWithResult(_0xea2b1,null))['catch'](handleError(_0xea2b1,null));};exports['destroy']=function(_0x1508aa,_0x3dad47){return db[_0xd206('0x2e')][_0xd206('0x46')]({'where':{'id':_0x1508aa[_0xd206('0x49')]['id']}})[_0xd206('0x29')](handleEntityNotFound(_0x3dad47,null))[_0xd206('0x29')](removeEntity(_0x3dad47,null))['catch'](handleError(_0x3dad47,null));};exports['describe']=function(_0x4bc11e,_0x31dc76){return db[_0xd206('0x2e')][_0xd206('0x4a')]()[_0xd206('0x29')](respondWithResult(_0x31dc76,null))[_0xd206('0x47')](handleError(_0x31dc76,null));};exports['getUnread']=function(_0x17375d,_0x476b26,_0x5e559f){return db[_0xd206('0x4b')]['count']({'where':{'ChatGroupId':_0x17375d[_0xd206('0x49')]['id'],'ToId':_0x17375d[_0xd206('0x4c')]['id'],'read':![]}})[_0xd206('0x29')](function(_0x46eac9){return{'id':_[_0xd206('0x4d')](_0x17375d[_0xd206('0x49')]['id']),'count':_0x46eac9};})[_0xd206('0x29')](respondWithResult(_0x476b26,null))[_0xd206('0x47')](handleError(_0x476b26,null));};exports[_0xd206('0x4e')]=function(_0x53f541,_0x21076a,_0x5af264){return db[_0xd206('0x2e')][_0xd206('0x46')]({'where':{'id':_0x53f541[_0xd206('0x49')]['id']}})[_0xd206('0x29')](handleEntityNotFound(_0x21076a,null))[_0xd206('0x29')](function(_0x35009d){if(_0x35009d){return _0x35009d[_0xd206('0x4e')](_0x53f541[_0xd206('0x48')][_0xd206('0x4f')],_['omit'](_0x53f541[_0xd206('0x48')],[_0xd206('0x4f'),'id'])||{});}})[_0xd206('0x29')](respondWithResult(_0x21076a,null))['catch'](handleError(_0x21076a,null));};exports['getMembers']=function(_0x558a02,_0x5e1c1a,_0x24326f){var _0x12ab46={};var _0x125dca={};var _0x467c14;var _0x440325;return db[_0xd206('0x2e')][_0xd206('0x50')]({'where':{'id':_0x558a02['params']['id']}})[_0xd206('0x29')](handleEntityNotFound(_0x5e1c1a,null))[_0xd206('0x29')](function(_0x4d3e5e){if(_0x4d3e5e){_0x467c14=_0x4d3e5e;_0x125dca[_0xd206('0x31')]=_['keys'](db[_0xd206('0x51')][_0xd206('0x2f')]);_0x125dca['query']=_[_0xd206('0x34')](_0x558a02[_0xd206('0x33')]);_0x125dca[_0xd206('0x3c')]=_[_0xd206('0x35')](_0x125dca[_0xd206('0x31')],_0x125dca[_0xd206('0x33')]);_0x12ab46[_0xd206('0x36')]=_['intersection'](_0x125dca['model'],qs['fields'](_0x558a02[_0xd206('0x33')][_0xd206('0x45')]));_0x12ab46[_0xd206('0x36')]=_0x12ab46['attributes'][_0xd206('0x37')]?_0x12ab46[_0xd206('0x36')]:_0x125dca[_0xd206('0x31')];_0x12ab46[_0xd206('0x39')]=qs['sort'](_0x558a02[_0xd206('0x33')][_0xd206('0x3a')]);_0x12ab46[_0xd206('0x3b')]=qs[_0xd206('0x3c')](_[_0xd206('0x52')](_0x558a02[_0xd206('0x33')],_0x125dca[_0xd206('0x3c')]));if(_0x558a02[_0xd206('0x33')][_0xd206('0x3f')]){_0x12ab46['where']=_['merge'](_0x12ab46['where'],{'$or':_['map'](_0x12ab46['attributes'],function(_0x1250cb){var _0x23c597={};_0x23c597[_0x1250cb]={'$like':'%'+_0x558a02['query']['filter']+'%'};return _0x23c597;})});}_0x12ab46=_[_0xd206('0x3d')]({},_0x12ab46,_0x558a02[_0xd206('0x40')]);return _0x467c14[_0xd206('0x53')](_0x12ab46);}})[_0xd206('0x29')](function(_0x48db22){if(_0x48db22){_0x440325=_0x48db22[_0xd206('0x37')];if(!_0x558a02[_0xd206('0x33')][_0xd206('0x38')](_0xd206('0x54'))){_0x12ab46['limit']=qs[_0xd206('0x23')](_0x558a02[_0xd206('0x33')][_0xd206('0x23')]);_0x12ab46[_0xd206('0x21')]=qs[_0xd206('0x21')](_0x558a02[_0xd206('0x33')]['offset']);}return _0x467c14[_0xd206('0x53')](_0x12ab46);}})[_0xd206('0x29')](function(_0x22c1d8){if(_0x22c1d8){return _0x22c1d8?{'count':_0x440325,'rows':_0x22c1d8}:null;}})[_0xd206('0x29')](respondWithResult(_0x5e1c1a,null))['catch'](handleError(_0x5e1c1a,null));};exports[_0xd206('0x55')]=function(_0x8da27b,_0x3489b7,_0x381924){return db['ChatGroup'][_0xd206('0x46')]({'where':{'id':_0x8da27b[_0xd206('0x49')]['id']}})['then'](handleEntityNotFound(_0x3489b7,null))[_0xd206('0x29')](function(_0x1deecc){if(_0x1deecc){return _0x1deecc[_0xd206('0x55')](_0x8da27b[_0xd206('0x33')][_0xd206('0x4f')]);}})[_0xd206('0x29')](respondWithStatusCode(_0x3489b7,null))[_0xd206('0x47')](handleError(_0x3489b7,null));};exports[_0xd206('0x56')]=function(_0x412f9b,_0x1f8e3a,_0x5dba77){if(_0x412f9b[_0xd206('0x48')]['id']){delete _0x412f9b[_0xd206('0x48')]['id'];}return db[_0xd206('0x2e')]['find']({'where':{'id':_0x412f9b[_0xd206('0x49')]['id']}})[_0xd206('0x29')](handleEntityNotFound(_0x1f8e3a,null))[_0xd206('0x29')](function(_0x35068a){if(_0x35068a){_0x412f9b['body']['ChatGroupId']=_0x35068a['id'];return db[_0xd206('0x4b')][_0xd206('0x57')](_0x412f9b[_0xd206('0x48')]);}})[_0xd206('0x29')](respondWithResult(_0x1f8e3a,null))['catch'](handleError(_0x1f8e3a,null));};exports[_0xd206('0x58')]=function(_0x140ee4,_0x242b72,_0x1b7276){var _0x48edf0={};var _0x28ec27={};var _0x50fa5c;var _0x222911;return db[_0xd206('0x2e')]['findOne']({'where':{'id':_0x140ee4[_0xd206('0x49')]['id']}})[_0xd206('0x29')](handleEntityNotFound(_0x242b72,null))[_0xd206('0x29')](function(_0x440cfb){if(_0x440cfb){_0x50fa5c=_0x440cfb;_0x28ec27[_0xd206('0x31')]=_[_0xd206('0x34')](db[_0xd206('0x4b')][_0xd206('0x2f')]);_0x28ec27[_0xd206('0x33')]=_[_0xd206('0x34')](_0x140ee4[_0xd206('0x33')]);_0x28ec27[_0xd206('0x3c')]=_[_0xd206('0x35')](_0x28ec27[_0xd206('0x31')],_0x28ec27[_0xd206('0x33')]);_0x48edf0[_0xd206('0x36')]=_[_0xd206('0x35')](_0x28ec27[_0xd206('0x31')],qs[_0xd206('0x45')](_0x140ee4[_0xd206('0x33')][_0xd206('0x45')]));_0x48edf0[_0xd206('0x36')]=_0x48edf0[_0xd206('0x36')][_0xd206('0x37')]?_0x48edf0['attributes']:_0x28ec27[_0xd206('0x31')];_0x48edf0[_0xd206('0x39')]=qs[_0xd206('0x3a')](_0x140ee4['query']['sort']);_0x48edf0['where']=qs[_0xd206('0x3c')](_['pick'](_0x140ee4['query'],_0x28ec27[_0xd206('0x3c')]));if(_0x140ee4['query'][_0xd206('0x3f')]){_0x48edf0[_0xd206('0x3b')]=_[_0xd206('0x3d')](_0x48edf0['where'],{'$or':_[_0xd206('0x32')](_0x48edf0[_0xd206('0x36')],function(_0x39dfe5){var _0x1dedc9={};_0x1dedc9[_0x39dfe5]={'$like':'%'+_0x140ee4[_0xd206('0x33')][_0xd206('0x3f')]+'%'};return _0x1dedc9;})});}if(_0x140ee4[_0xd206('0x33')][_0xd206('0x59')]){var _0x15dfa7=_0x140ee4['query'][_0xd206('0x59')][_0xd206('0x5a')](',');var _0x293e1e={};_0x293e1e[_0x15dfa7[0x0]]={'$gte':moment(_0x15dfa7[0x1])['format'](_0xd206('0x5b'))};_0x48edf0['where']=_[_0xd206('0x3d')](_0x48edf0['where'],_0x293e1e);}_0x48edf0=_[_0xd206('0x3d')]({},_0x48edf0,_0x140ee4[_0xd206('0x40')]);return _0x50fa5c['getMessages'](_0x48edf0);}})['then'](function(_0x10d216){if(_0x10d216){_0x222911=_0x10d216['length'];if(!_0x140ee4['query'][_0xd206('0x38')](_0xd206('0x54'))){_0x48edf0['limit']=qs[_0xd206('0x23')](_0x140ee4['query'][_0xd206('0x23')]);_0x48edf0[_0xd206('0x21')]=qs[_0xd206('0x21')](_0x140ee4[_0xd206('0x33')]['offset']);}return _0x50fa5c[_0xd206('0x58')](_0x48edf0);}})[_0xd206('0x29')](function(_0x175377){if(_0x175377){return _0x175377?{'count':_0x222911,'rows':_0x175377}:null;}})[_0xd206('0x29')](respondWithResult(_0x242b72,null))['catch'](handleError(_0x242b72,null));}; \ No newline at end of file +var _0xbd80=['nolimit','order','sort','where','filters','pick','filter','merge','type','VIRTUAL','count','includeAll','include','rows','params','length','find','catch','create','body','update','describe','getUnread','ChatInternalMessage','addMembers','omit','ids','findOne','User','options','getMembers','removeMembers','addMessage','getMessages','$gte','split','YYYY-MM-DD\x20HH:mm:ss','eml-format','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','ejs','fs-extra','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','sendStatus','end','status','json','offset','undefined','limit','set','Content-Range','apply','save','then','destroy','error','name','send','index','map','ChatGroup','rawAttributes','fieldName','key','model','query','keys','intersection','attributes','fields','hasOwnProperty'];(function(_0x28e9b6,_0x11ba36){var _0x58008b=function(_0x3da5e3){while(--_0x3da5e3){_0x28e9b6['push'](_0x28e9b6['shift']());}};_0x58008b(++_0x11ba36);}(_0xbd80,0xdf));var _0x0bd8=function(_0x10d349,_0x437a26){_0x10d349=_0x10d349-0x0;var _0x492633=_0xbd80[_0x10d349];return _0x492633;};'use strict';var emlformat=require(_0x0bd8('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x0bd8('0x1'));var jsonpatch=require(_0x0bd8('0x2'));var rp=require('request-promise');var moment=require(_0x0bd8('0x3'));var BPromise=require(_0x0bd8('0x4'));var Mustache=require('mustache');var util=require(_0x0bd8('0x5'));var path=require(_0x0bd8('0x6'));var sox=require(_0x0bd8('0x7'));var csv=require('to-csv');var ejs=require(_0x0bd8('0x8'));var fs=require('fs');var fs_extra=require(_0x0bd8('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x0bd8('0xa'));var jsforce=require(_0x0bd8('0xb'));var deskjs=require(_0x0bd8('0xc'));var toCsv=require('to-csv');var querystring=require(_0x0bd8('0xd'));var Papa=require('papaparse');var Redis=require(_0x0bd8('0xe'));var authService=require(_0x0bd8('0xf'));var qs=require(_0x0bd8('0x10'));var as=require(_0x0bd8('0x11'));var hardwareService=require(_0x0bd8('0x12'));var logger=require(_0x0bd8('0x13'))(_0x0bd8('0x14'));var utils=require(_0x0bd8('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x0bd8('0x16'));var db=require(_0x0bd8('0x17'))['db'];config[_0x0bd8('0x18')]=_[_0x0bd8('0x19')](config[_0x0bd8('0x18')],{'host':_0x0bd8('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0bd8('0x18')]));require('./chatGroup.socket')['register'](socket);function respondWithStatusCode(_0xd5230a,_0x45d147){_0x45d147=_0x45d147||0xcc;return function(_0x1c466e){if(_0x1c466e){return _0xd5230a[_0x0bd8('0x1b')](_0x45d147);}return _0xd5230a['status'](_0x45d147)[_0x0bd8('0x1c')]();};}function respondWithResult(_0x239806,_0x279769){_0x279769=_0x279769||0xc8;return function(_0x30fca8){if(_0x30fca8){return _0x239806[_0x0bd8('0x1d')](_0x279769)[_0x0bd8('0x1e')](_0x30fca8);}};}function respondWithFilteredResult(_0x5584f4,_0x28ee43){return function(_0x31123c){if(_0x31123c){var _0x255600=typeof _0x28ee43[_0x0bd8('0x1f')]===_0x0bd8('0x20')&&typeof _0x28ee43['limit']===_0x0bd8('0x20');var _0x1506bf=_0x31123c['count'];var _0x346779=_0x255600?0x0:_0x28ee43['offset'];var _0x1708d6=_0x255600?_0x31123c['count']:_0x28ee43[_0x0bd8('0x1f')]+_0x28ee43[_0x0bd8('0x21')];var _0xbadf1a;if(_0x1708d6>=_0x1506bf){_0x1708d6=_0x1506bf;_0xbadf1a=0xc8;}else{_0xbadf1a=0xce;}_0x5584f4[_0x0bd8('0x1d')](_0xbadf1a);return _0x5584f4[_0x0bd8('0x22')](_0x0bd8('0x23'),_0x346779+'-'+_0x1708d6+'/'+_0x1506bf)[_0x0bd8('0x1e')](_0x31123c);}return null;};}function patchUpdates(_0x2a2095){return function(_0xf8e191){try{jsonpatch[_0x0bd8('0x24')](_0xf8e191,_0x2a2095,!![]);}catch(_0x20a58e){return BPromise['reject'](_0x20a58e);}return _0xf8e191[_0x0bd8('0x25')]();};}function saveUpdates(_0x17f672,_0x3f2395){return function(_0x57c39d){if(_0x57c39d){return _0x57c39d['update'](_0x17f672)[_0x0bd8('0x26')](function(_0x148ce8){return _0x148ce8;});}return null;};}function removeEntity(_0x411d1e,_0x303571){return function(_0x317187){if(_0x317187){return _0x317187[_0x0bd8('0x27')]()[_0x0bd8('0x26')](function(){_0x411d1e[_0x0bd8('0x1d')](0xcc)[_0x0bd8('0x1c')]();});}};}function handleEntityNotFound(_0x32cbd0,_0x57896b){return function(_0x384a4b){if(!_0x384a4b){_0x32cbd0['sendStatus'](0x194);}return _0x384a4b;};}function handleError(_0x553c14,_0x16e673){_0x16e673=_0x16e673||0x1f4;return function(_0xf5a618){logger[_0x0bd8('0x28')](_0xf5a618['stack']);if(_0xf5a618[_0x0bd8('0x29')]){delete _0xf5a618['name'];}_0x553c14[_0x0bd8('0x1d')](_0x16e673)[_0x0bd8('0x2a')](_0xf5a618);};}exports[_0x0bd8('0x2b')]=function(_0x4eb7cd,_0x2552da){var _0x2ec430={},_0x26f3e5={},_0x2ba764={'count':0x0,'rows':[]};var _0x5bcbe3=_[_0x0bd8('0x2c')](db[_0x0bd8('0x2d')][_0x0bd8('0x2e')],function(_0x54b524){return{'name':_0x54b524[_0x0bd8('0x2f')],'type':_0x54b524['type'][_0x0bd8('0x30')]};});_0x26f3e5[_0x0bd8('0x31')]=_[_0x0bd8('0x2c')](_0x5bcbe3,'name');_0x26f3e5[_0x0bd8('0x32')]=_[_0x0bd8('0x33')](_0x4eb7cd['query']);_0x26f3e5['filters']=_[_0x0bd8('0x34')](_0x26f3e5[_0x0bd8('0x31')],_0x26f3e5['query']);_0x2ec430[_0x0bd8('0x35')]=_[_0x0bd8('0x34')](_0x26f3e5[_0x0bd8('0x31')],qs[_0x0bd8('0x36')](_0x4eb7cd['query']['fields']));_0x2ec430[_0x0bd8('0x35')]=_0x2ec430[_0x0bd8('0x35')]['length']?_0x2ec430[_0x0bd8('0x35')]:_0x26f3e5[_0x0bd8('0x31')];if(!_0x4eb7cd[_0x0bd8('0x32')][_0x0bd8('0x37')](_0x0bd8('0x38'))){_0x2ec430[_0x0bd8('0x21')]=qs[_0x0bd8('0x21')](_0x4eb7cd[_0x0bd8('0x32')][_0x0bd8('0x21')]);_0x2ec430[_0x0bd8('0x1f')]=qs[_0x0bd8('0x1f')](_0x4eb7cd[_0x0bd8('0x32')][_0x0bd8('0x1f')]);}_0x2ec430[_0x0bd8('0x39')]=qs[_0x0bd8('0x3a')](_0x4eb7cd[_0x0bd8('0x32')][_0x0bd8('0x3a')]);_0x2ec430[_0x0bd8('0x3b')]=qs[_0x0bd8('0x3c')](_[_0x0bd8('0x3d')](_0x4eb7cd[_0x0bd8('0x32')],_0x26f3e5['filters']),_0x5bcbe3);if(_0x4eb7cd[_0x0bd8('0x32')][_0x0bd8('0x3e')]){_0x2ec430[_0x0bd8('0x3b')]=_[_0x0bd8('0x3f')](_0x2ec430['where'],{'$or':_[_0x0bd8('0x2c')](_0x5bcbe3,function(_0x3d80b8){if(_0x3d80b8[_0x0bd8('0x40')]!==_0x0bd8('0x41')){var _0x2d5d62={};_0x2d5d62[_0x3d80b8[_0x0bd8('0x29')]]={'$like':'%'+_0x4eb7cd[_0x0bd8('0x32')]['filter']+'%'};return _0x2d5d62;}})});}_0x2ec430=_[_0x0bd8('0x3f')]({},_0x2ec430,_0x4eb7cd['options']);var _0x4ddc7a={'where':_0x2ec430[_0x0bd8('0x3b')]};return db[_0x0bd8('0x2d')][_0x0bd8('0x42')](_0x4ddc7a)['then'](function(_0x4395ab){_0x2ba764[_0x0bd8('0x42')]=_0x4395ab;if(_0x4eb7cd['query'][_0x0bd8('0x43')]){_0x2ec430[_0x0bd8('0x44')]=[{'all':!![]}];}return db['ChatGroup']['findAll'](_0x2ec430);})[_0x0bd8('0x26')](function(_0x3e6fd9){_0x2ba764[_0x0bd8('0x45')]=_0x3e6fd9;return _0x2ba764;})[_0x0bd8('0x26')](respondWithFilteredResult(_0x2552da,_0x2ec430))['catch'](handleError(_0x2552da,null));};exports['show']=function(_0x218828,_0x4b8041){var _0x7cd3f4={'raw':!![],'where':{'id':_0x218828[_0x0bd8('0x46')]['id']}},_0x29db54={};_0x29db54[_0x0bd8('0x31')]=_[_0x0bd8('0x33')](db['ChatGroup'][_0x0bd8('0x2e')]);_0x29db54[_0x0bd8('0x32')]=_[_0x0bd8('0x33')](_0x218828[_0x0bd8('0x32')]);_0x29db54['filters']=_[_0x0bd8('0x34')](_0x29db54[_0x0bd8('0x31')],_0x29db54[_0x0bd8('0x32')]);_0x7cd3f4[_0x0bd8('0x35')]=_[_0x0bd8('0x34')](_0x29db54[_0x0bd8('0x31')],qs[_0x0bd8('0x36')](_0x218828[_0x0bd8('0x32')]['fields']));_0x7cd3f4[_0x0bd8('0x35')]=_0x7cd3f4[_0x0bd8('0x35')][_0x0bd8('0x47')]?_0x7cd3f4[_0x0bd8('0x35')]:_0x29db54['model'];if(_0x218828[_0x0bd8('0x32')][_0x0bd8('0x43')]){_0x7cd3f4[_0x0bd8('0x44')]=[{'all':!![]}];}_0x7cd3f4=_[_0x0bd8('0x3f')]({},_0x7cd3f4,_0x218828['options']);return db[_0x0bd8('0x2d')][_0x0bd8('0x48')](_0x7cd3f4)['then'](handleEntityNotFound(_0x4b8041,null))[_0x0bd8('0x26')](respondWithResult(_0x4b8041,null))[_0x0bd8('0x49')](handleError(_0x4b8041,null));};exports[_0x0bd8('0x4a')]=function(_0x4afd40,_0x45615b){return db[_0x0bd8('0x2d')]['create'](_0x4afd40[_0x0bd8('0x4b')],{})['then'](respondWithResult(_0x45615b,0xc9))[_0x0bd8('0x49')](handleError(_0x45615b,null));};exports[_0x0bd8('0x4c')]=function(_0x190c10,_0x55e14f){if(_0x190c10['body']['id']){delete _0x190c10[_0x0bd8('0x4b')]['id'];}return db[_0x0bd8('0x2d')][_0x0bd8('0x48')]({'where':{'id':_0x190c10['params']['id']}})['then'](handleEntityNotFound(_0x55e14f,null))[_0x0bd8('0x26')](saveUpdates(_0x190c10[_0x0bd8('0x4b')],null))['then'](respondWithResult(_0x55e14f,null))[_0x0bd8('0x49')](handleError(_0x55e14f,null));};exports[_0x0bd8('0x27')]=function(_0x5d6b30,_0x240647){return db[_0x0bd8('0x2d')][_0x0bd8('0x48')]({'where':{'id':_0x5d6b30[_0x0bd8('0x46')]['id']}})[_0x0bd8('0x26')](handleEntityNotFound(_0x240647,null))['then'](removeEntity(_0x240647,null))[_0x0bd8('0x49')](handleError(_0x240647,null));};exports[_0x0bd8('0x4d')]=function(_0x15707f,_0x3faee1){return db['ChatGroup'][_0x0bd8('0x4d')]()['then'](respondWithResult(_0x3faee1,null))[_0x0bd8('0x49')](handleError(_0x3faee1,null));};exports[_0x0bd8('0x4e')]=function(_0x4a3967,_0x436a6d,_0x4207d6){return db[_0x0bd8('0x4f')][_0x0bd8('0x42')]({'where':{'ChatGroupId':_0x4a3967[_0x0bd8('0x46')]['id'],'ToId':_0x4a3967['user']['id'],'read':![]}})[_0x0bd8('0x26')](function(_0x53ac85){return{'id':_['toInteger'](_0x4a3967[_0x0bd8('0x46')]['id']),'count':_0x53ac85};})[_0x0bd8('0x26')](respondWithResult(_0x436a6d,null))['catch'](handleError(_0x436a6d,null));};exports[_0x0bd8('0x50')]=function(_0xb384d4,_0x28bf19,_0x83b3b4){return db['ChatGroup'][_0x0bd8('0x48')]({'where':{'id':_0xb384d4[_0x0bd8('0x46')]['id']}})[_0x0bd8('0x26')](handleEntityNotFound(_0x28bf19,null))[_0x0bd8('0x26')](function(_0x5d4f53){if(_0x5d4f53){return _0x5d4f53[_0x0bd8('0x50')](_0xb384d4[_0x0bd8('0x4b')]['ids'],_[_0x0bd8('0x51')](_0xb384d4['body'],[_0x0bd8('0x52'),'id'])||{});}})['then'](respondWithResult(_0x28bf19,null))[_0x0bd8('0x49')](handleError(_0x28bf19,null));};exports['getMembers']=function(_0x1b272c,_0x4894c7,_0x52701b){var _0x360056={};var _0x101484={};var _0x3e639f;var _0x232505;return db[_0x0bd8('0x2d')][_0x0bd8('0x53')]({'where':{'id':_0x1b272c[_0x0bd8('0x46')]['id']}})['then'](handleEntityNotFound(_0x4894c7,null))[_0x0bd8('0x26')](function(_0x502e3f){if(_0x502e3f){_0x3e639f=_0x502e3f;_0x101484[_0x0bd8('0x31')]=_[_0x0bd8('0x33')](db[_0x0bd8('0x54')]['rawAttributes']);_0x101484['query']=_['keys'](_0x1b272c['query']);_0x101484[_0x0bd8('0x3c')]=_[_0x0bd8('0x34')](_0x101484[_0x0bd8('0x31')],_0x101484[_0x0bd8('0x32')]);_0x360056[_0x0bd8('0x35')]=_[_0x0bd8('0x34')](_0x101484[_0x0bd8('0x31')],qs[_0x0bd8('0x36')](_0x1b272c['query'][_0x0bd8('0x36')]));_0x360056[_0x0bd8('0x35')]=_0x360056['attributes'][_0x0bd8('0x47')]?_0x360056[_0x0bd8('0x35')]:_0x101484[_0x0bd8('0x31')];_0x360056['order']=qs[_0x0bd8('0x3a')](_0x1b272c[_0x0bd8('0x32')][_0x0bd8('0x3a')]);_0x360056[_0x0bd8('0x3b')]=qs[_0x0bd8('0x3c')](_[_0x0bd8('0x3d')](_0x1b272c[_0x0bd8('0x32')],_0x101484['filters']));if(_0x1b272c[_0x0bd8('0x32')][_0x0bd8('0x3e')]){_0x360056[_0x0bd8('0x3b')]=_[_0x0bd8('0x3f')](_0x360056[_0x0bd8('0x3b')],{'$or':_[_0x0bd8('0x2c')](_0x360056[_0x0bd8('0x35')],function(_0x28584d){var _0x3c67b3={};_0x3c67b3[_0x28584d]={'$like':'%'+_0x1b272c[_0x0bd8('0x32')][_0x0bd8('0x3e')]+'%'};return _0x3c67b3;})});}_0x360056=_[_0x0bd8('0x3f')]({},_0x360056,_0x1b272c[_0x0bd8('0x55')]);return _0x3e639f['getMembers'](_0x360056);}})[_0x0bd8('0x26')](function(_0xab9651){if(_0xab9651){_0x232505=_0xab9651['length'];if(!_0x1b272c[_0x0bd8('0x32')]['hasOwnProperty']('nolimit')){_0x360056[_0x0bd8('0x21')]=qs[_0x0bd8('0x21')](_0x1b272c[_0x0bd8('0x32')][_0x0bd8('0x21')]);_0x360056['offset']=qs[_0x0bd8('0x1f')](_0x1b272c[_0x0bd8('0x32')][_0x0bd8('0x1f')]);}return _0x3e639f[_0x0bd8('0x56')](_0x360056);}})[_0x0bd8('0x26')](function(_0x30d989){if(_0x30d989){return _0x30d989?{'count':_0x232505,'rows':_0x30d989}:null;}})[_0x0bd8('0x26')](respondWithResult(_0x4894c7,null))[_0x0bd8('0x49')](handleError(_0x4894c7,null));};exports[_0x0bd8('0x57')]=function(_0x2369f5,_0x34eb55,_0xc265d6){return db['ChatGroup'][_0x0bd8('0x48')]({'where':{'id':_0x2369f5['params']['id']}})[_0x0bd8('0x26')](handleEntityNotFound(_0x34eb55,null))[_0x0bd8('0x26')](function(_0x38db56){if(_0x38db56){return _0x38db56[_0x0bd8('0x57')](_0x2369f5[_0x0bd8('0x32')][_0x0bd8('0x52')]);}})['then'](respondWithStatusCode(_0x34eb55,null))['catch'](handleError(_0x34eb55,null));};exports[_0x0bd8('0x58')]=function(_0x5ea82c,_0x503550,_0x40dd5e){if(_0x5ea82c['body']['id']){delete _0x5ea82c[_0x0bd8('0x4b')]['id'];}return db['ChatGroup'][_0x0bd8('0x48')]({'where':{'id':_0x5ea82c[_0x0bd8('0x46')]['id']}})['then'](handleEntityNotFound(_0x503550,null))[_0x0bd8('0x26')](function(_0x4bc762){if(_0x4bc762){_0x5ea82c[_0x0bd8('0x4b')]['ChatGroupId']=_0x4bc762['id'];return db[_0x0bd8('0x4f')][_0x0bd8('0x4a')](_0x5ea82c[_0x0bd8('0x4b')]);}})[_0x0bd8('0x26')](respondWithResult(_0x503550,null))['catch'](handleError(_0x503550,null));};exports[_0x0bd8('0x59')]=function(_0x26d02b,_0x4924b4,_0x3f4706){var _0x2eda7e={};var _0x19ed06={};var _0x3b3a9b;var _0x17c51c;return db[_0x0bd8('0x2d')][_0x0bd8('0x53')]({'where':{'id':_0x26d02b[_0x0bd8('0x46')]['id']}})[_0x0bd8('0x26')](handleEntityNotFound(_0x4924b4,null))['then'](function(_0x4fc2ac){if(_0x4fc2ac){_0x3b3a9b=_0x4fc2ac;_0x19ed06[_0x0bd8('0x31')]=_[_0x0bd8('0x33')](db['ChatInternalMessage']['rawAttributes']);_0x19ed06[_0x0bd8('0x32')]=_[_0x0bd8('0x33')](_0x26d02b['query']);_0x19ed06['filters']=_['intersection'](_0x19ed06[_0x0bd8('0x31')],_0x19ed06[_0x0bd8('0x32')]);_0x2eda7e[_0x0bd8('0x35')]=_[_0x0bd8('0x34')](_0x19ed06['model'],qs[_0x0bd8('0x36')](_0x26d02b['query'][_0x0bd8('0x36')]));_0x2eda7e[_0x0bd8('0x35')]=_0x2eda7e[_0x0bd8('0x35')][_0x0bd8('0x47')]?_0x2eda7e[_0x0bd8('0x35')]:_0x19ed06[_0x0bd8('0x31')];_0x2eda7e[_0x0bd8('0x39')]=qs[_0x0bd8('0x3a')](_0x26d02b[_0x0bd8('0x32')][_0x0bd8('0x3a')]);_0x2eda7e[_0x0bd8('0x3b')]=qs[_0x0bd8('0x3c')](_[_0x0bd8('0x3d')](_0x26d02b[_0x0bd8('0x32')],_0x19ed06[_0x0bd8('0x3c')]));if(_0x26d02b[_0x0bd8('0x32')]['filter']){_0x2eda7e['where']=_[_0x0bd8('0x3f')](_0x2eda7e[_0x0bd8('0x3b')],{'$or':_[_0x0bd8('0x2c')](_0x2eda7e[_0x0bd8('0x35')],function(_0x4d319c){var _0x51275f={};_0x51275f[_0x4d319c]={'$like':'%'+_0x26d02b[_0x0bd8('0x32')]['filter']+'%'};return _0x51275f;})});}if(_0x26d02b[_0x0bd8('0x32')][_0x0bd8('0x5a')]){var _0x4c0a38=_0x26d02b[_0x0bd8('0x32')][_0x0bd8('0x5a')][_0x0bd8('0x5b')](',');var _0x32c3a4={};_0x32c3a4[_0x4c0a38[0x0]]={'$gte':moment(_0x4c0a38[0x1])['format'](_0x0bd8('0x5c'))};_0x2eda7e['where']=_[_0x0bd8('0x3f')](_0x2eda7e[_0x0bd8('0x3b')],_0x32c3a4);}_0x2eda7e=_[_0x0bd8('0x3f')]({},_0x2eda7e,_0x26d02b[_0x0bd8('0x55')]);return _0x3b3a9b[_0x0bd8('0x59')](_0x2eda7e);}})[_0x0bd8('0x26')](function(_0x4f0ad3){if(_0x4f0ad3){_0x17c51c=_0x4f0ad3['length'];if(!_0x26d02b[_0x0bd8('0x32')][_0x0bd8('0x37')]('nolimit')){_0x2eda7e[_0x0bd8('0x21')]=qs['limit'](_0x26d02b[_0x0bd8('0x32')]['limit']);_0x2eda7e['offset']=qs[_0x0bd8('0x1f')](_0x26d02b[_0x0bd8('0x32')][_0x0bd8('0x1f')]);}return _0x3b3a9b[_0x0bd8('0x59')](_0x2eda7e);}})[_0x0bd8('0x26')](function(_0xb42168){if(_0xb42168){return _0xb42168?{'count':_0x17c51c,'rows':_0xb42168}:null;}})[_0x0bd8('0x26')](respondWithResult(_0x4924b4,null))['catch'](handleError(_0x4924b4,null));}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js index 53ff63c..6f93dd0 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 _0x6fad=['ChatGroup','setMaxListeners','save','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0xdf774e,_0x390adc){var _0x31c816=function(_0x535b68){while(--_0x535b68){_0xdf774e['push'](_0xdf774e['shift']());}};_0x31c816(++_0x390adc);}(_0x6fad,0x17a));var _0xd6fa=function(_0x483d2b,_0x2dd6d1){_0x483d2b=_0x483d2b-0x0;var _0x8d6023=_0x6fad[_0x483d2b];return _0x8d6023;};'use strict';var EventEmitter=require(_0xd6fa('0x0'));var ChatGroup=require(_0xd6fa('0x1'))['db'][_0xd6fa('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0xd6fa('0x3')](0x0);var events={'afterCreate':_0xd6fa('0x4'),'afterUpdate':'update','afterDestroy':_0xd6fa('0x5')};function emitEvent(_0x4af892){return function(_0x3cd6a2,_0x542461,_0x40ac02){ChatGroupEvents['emit'](_0x4af892+':'+_0x3cd6a2['id'],_0x3cd6a2);ChatGroupEvents[_0xd6fa('0x6')](_0x4af892,_0x3cd6a2);_0x40ac02(null);};}for(var e in events){if(events[_0xd6fa('0x7')](e)){var event=events[e];ChatGroup[_0xd6fa('0x8')](e,emitEvent(event));}}module[_0xd6fa('0x9')]=ChatGroupEvents; \ No newline at end of file +var _0x1932=['setMaxListeners','save','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','ChatGroup'];(function(_0x24f31b,_0x44b8f3){var _0x488401=function(_0x204caf){while(--_0x204caf){_0x24f31b['push'](_0x24f31b['shift']());}};_0x488401(++_0x44b8f3);}(_0x1932,0xbb));var _0x2193=function(_0x2dea24,_0x2fc021){_0x2dea24=_0x2dea24-0x0;var _0x309d58=_0x1932[_0x2dea24];return _0x309d58;};'use strict';var EventEmitter=require(_0x2193('0x0'));var ChatGroup=require(_0x2193('0x1'))['db'][_0x2193('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x2193('0x3')](0x0);var events={'afterCreate':_0x2193('0x4'),'afterUpdate':'update','afterDestroy':_0x2193('0x5')};function emitEvent(_0x3f6543){return function(_0x1d0fc1,_0x1557cc,_0x3c391e){ChatGroupEvents[_0x2193('0x6')](_0x3f6543+':'+_0x1d0fc1['id'],_0x1d0fc1);ChatGroupEvents[_0x2193('0x6')](_0x3f6543,_0x1d0fc1);_0x3c391e(null);};}for(var e in events){if(events[_0x2193('0x7')](e)){var event=events[e];ChatGroup[_0x2193('0x8')](e,emitEvent(event));}}module[_0x2193('0x9')]=ChatGroupEvents; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.model.js b/server/api/chatGroup/chatGroup.model.js index 2380ee5..27133cf 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 _0x787c=['chat_groups','util','../../config/logger','api','moment','bluebird','path','rimraf','./chatGroup.attributes','define','ChatGroup'];(function(_0x37469b,_0x53776a){var _0x1666e8=function(_0x48b5aa){while(--_0x48b5aa){_0x37469b['push'](_0x37469b['shift']());}};_0x1666e8(++_0x53776a);}(_0x787c,0x109));var _0xc787=function(_0x59bd52,_0x127aeb){_0x59bd52=_0x59bd52-0x0;var _0x1508d9=_0x787c[_0x59bd52];return _0x1508d9;};'use strict';var _=require('lodash');var util=require(_0xc787('0x0'));var logger=require(_0xc787('0x1'))(_0xc787('0x2'));var moment=require(_0xc787('0x3'));var BPromise=require(_0xc787('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc787('0x5'));var rimraf=require(_0xc787('0x6'));var config=require('../../config/environment');var attributes=require(_0xc787('0x7'));module['exports']=function(_0x4248f1,_0x495781){return _0x4248f1[_0xc787('0x8')](_0xc787('0x9'),attributes,{'tableName':_0xc787('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf210=['../../config/environment','define','ChatGroup','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x201f9f,_0x34e8ee){var _0x486a33=function(_0x23c494){while(--_0x23c494){_0x201f9f['push'](_0x201f9f['shift']());}};_0x486a33(++_0x34e8ee);}(_0xf210,0x1a7));var _0x0f21=function(_0x464e79,_0xb60fe0){_0x464e79=_0x464e79-0x0;var _0x2daf70=_0xf210[_0x464e79];return _0x2daf70;};'use strict';var _=require(_0x0f21('0x0'));var util=require(_0x0f21('0x1'));var logger=require(_0x0f21('0x2'))(_0x0f21('0x3'));var moment=require(_0x0f21('0x4'));var BPromise=require(_0x0f21('0x5'));var rp=require(_0x0f21('0x6'));var fs=require('fs');var path=require(_0x0f21('0x7'));var rimraf=require(_0x0f21('0x8'));var config=require(_0x0f21('0x9'));var attributes=require('./chatGroup.attributes');module['exports']=function(_0xaeb52a,_0x1573b1){return _0xaeb52a[_0x0f21('0xa')](_0x0f21('0xb'),attributes,{'tableName':'chat_groups','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.rpc.js b/server/api/chatGroup/chatGroup.rpc.js index dc4741d..98bba2a 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 _0x22f6=['ChatGroup,\x20%s,\x20%s','request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','register','request','then','info'];(function(_0x2bf880,_0x2ffe36){var _0x3687c4=function(_0x27dea7){while(--_0x27dea7){_0x2bf880['push'](_0x2bf880['shift']());}};_0x3687c4(++_0x2ffe36);}(_0x22f6,0x10e));var _0x622f=function(_0x592a80,_0x537c3e){_0x592a80=_0x592a80-0x0;var _0x4f56fe=_0x22f6[_0x592a80];return _0x4f56fe;};'use strict';var _=require(_0x622f('0x0'));var util=require('util');var moment=require(_0x622f('0x1'));var BPromise=require('bluebird');var rs=require(_0x622f('0x2'));var fs=require('fs');var Redis=require(_0x622f('0x3'));var db=require(_0x622f('0x4'))['db'];var utils=require(_0x622f('0x5'));var logger=require(_0x622f('0x6'))(_0x622f('0x7'));var config=require(_0x622f('0x8'));var jayson=require(_0x622f('0x9'));var client=jayson[_0x622f('0xa')][_0x622f('0xb')]({'port':0x232a});config['redis']=_[_0x622f('0xc')](config[_0x622f('0xd')],{'host':_0x622f('0xe'),'port':0x18eb});var socket=require(_0x622f('0xf'))(new Redis(config['redis']));require('./chatGroup.socket')[_0x622f('0x10')](socket);function respondWithRpcPromise(_0x25f5d1,_0x1bf4fa,_0x7373ac){return new BPromise(function(_0x4eac2f,_0x12882d){return client[_0x622f('0x11')](_0x25f5d1,_0x7373ac)[_0x622f('0x12')](function(_0x259b4a){logger[_0x622f('0x13')](_0x622f('0x14'),_0x1bf4fa,_0x622f('0x15'));logger[_0x622f('0x16')](_0x622f('0x17'),_0x1bf4fa,'request\x20sent',JSON[_0x622f('0x18')](_0x259b4a));if(_0x259b4a[_0x622f('0x19')]){if(_0x259b4a[_0x622f('0x19')]['code']===0x1f4){logger[_0x622f('0x19')]('ChatGroup,\x20%s,\x20%s',_0x1bf4fa,_0x259b4a[_0x622f('0x19')]['message']);return _0x12882d(_0x259b4a[_0x622f('0x19')]['message']);}logger['error'](_0x622f('0x14'),_0x1bf4fa,_0x259b4a[_0x622f('0x19')][_0x622f('0x1a')]);return _0x4eac2f(_0x259b4a['error'][_0x622f('0x1a')]);}else{logger[_0x622f('0x13')](_0x622f('0x14'),_0x1bf4fa,_0x622f('0x15'));_0x4eac2f(_0x259b4a[_0x622f('0x1b')]['message']);}})[_0x622f('0x1c')](function(_0x30003f){logger['error'](_0x622f('0x14'),_0x1bf4fa,_0x30003f);_0x12882d(_0x30003f);});});} \ No newline at end of file +var _0x24ca=['../../config/utils','rpc','../../config/environment','jayson/promise','defaults','redis','localhost','socket.io-emitter','./chatGroup.socket','request','then','info','ChatGroup,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','bluebird','ioredis','../../mysqldb'];(function(_0x21aec3,_0x5c97e9){var _0x288bbc=function(_0x2283fe){while(--_0x2283fe){_0x21aec3['push'](_0x21aec3['shift']());}};_0x288bbc(++_0x5c97e9);}(_0x24ca,0x8c));var _0xa24c=function(_0x135904,_0x1e252b){_0x135904=_0x135904-0x0;var _0x1ce7d5=_0x24ca[_0x135904];return _0x1ce7d5;};'use strict';var _=require(_0xa24c('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xa24c('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa24c('0x2'));var db=require(_0xa24c('0x3'))['db'];var utils=require(_0xa24c('0x4'));var logger=require('../../config/logger')(_0xa24c('0x5'));var config=require(_0xa24c('0x6'));var jayson=require(_0xa24c('0x7'));var client=jayson['client']['http']({'port':0x232a});config['redis']=_[_0xa24c('0x8')](config[_0xa24c('0x9')],{'host':_0xa24c('0xa'),'port':0x18eb});var socket=require(_0xa24c('0xb'))(new Redis(config[_0xa24c('0x9')]));require(_0xa24c('0xc'))['register'](socket);function respondWithRpcPromise(_0x101ca7,_0x413b3d,_0x355882){return new BPromise(function(_0x584595,_0x5a474b){return client[_0xa24c('0xd')](_0x101ca7,_0x355882)[_0xa24c('0xe')](function(_0x2da0c3){logger[_0xa24c('0xf')](_0xa24c('0x10'),_0x413b3d,_0xa24c('0x11'));logger['debug']('ChatGroup,\x20%s,\x20%s,\x20%s',_0x413b3d,'request\x20sent',JSON[_0xa24c('0x12')](_0x2da0c3));if(_0x2da0c3[_0xa24c('0x13')]){if(_0x2da0c3[_0xa24c('0x13')][_0xa24c('0x14')]===0x1f4){logger[_0xa24c('0x13')]('ChatGroup,\x20%s,\x20%s',_0x413b3d,_0x2da0c3[_0xa24c('0x13')]['message']);return _0x5a474b(_0x2da0c3['error']['message']);}logger[_0xa24c('0x13')](_0xa24c('0x10'),_0x413b3d,_0x2da0c3[_0xa24c('0x13')][_0xa24c('0x15')]);return _0x584595(_0x2da0c3[_0xa24c('0x13')][_0xa24c('0x15')]);}else{logger[_0xa24c('0xf')](_0xa24c('0x10'),_0x413b3d,_0xa24c('0x11'));_0x584595(_0x2da0c3[_0xa24c('0x16')][_0xa24c('0x15')]);}})[_0xa24c('0x17')](function(_0x278cce){logger[_0xa24c('0x13')]('ChatGroup,\x20%s,\x20%s',_0x413b3d,_0x278cce);_0x5a474b(_0x278cce);});});} \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js index f782c51..ff94cf9 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 _0x9a9c=['removeListener','register','length','chatGroup:','./chatGroup.events','save','remove','update','emit'];(function(_0x1947f7,_0x5225ce){var _0x1e0181=function(_0xf28fb){while(--_0xf28fb){_0x1947f7['push'](_0x1947f7['shift']());}};_0x1e0181(++_0x5225ce);}(_0x9a9c,0x100));var _0xc9a9=function(_0x434b9b,_0x1241e4){_0x434b9b=_0x434b9b-0x0;var _0x25d7a2=_0x9a9c[_0x434b9b];return _0x25d7a2;};'use strict';var ChatGroupEvents=require(_0xc9a9('0x0'));var events=[_0xc9a9('0x1'),_0xc9a9('0x2'),_0xc9a9('0x3')];function createListener(_0x595fb1,_0x426f8c){return function(_0x162091){_0x426f8c[_0xc9a9('0x4')](_0x595fb1,_0x162091);};}function removeListener(_0x23db6c,_0x305181){return function(){ChatGroupEvents[_0xc9a9('0x5')](_0x23db6c,_0x305181);};}exports[_0xc9a9('0x6')]=function(_0x590081){for(var _0x1f6a42=0x0,_0x4b4e47=events[_0xc9a9('0x7')];_0x1f6a42<_0x4b4e47;_0x1f6a42++){var _0x3eab19=events[_0x1f6a42];var _0x57fc1b=createListener(_0xc9a9('0x8')+_0x3eab19,_0x590081);ChatGroupEvents['on'](_0x3eab19,_0x57fc1b);}}; \ No newline at end of file +var _0xe9cb=['save','remove','update','emit','length','chatGroup:','./chatGroup.events'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe9cb,0xfb));var _0xbe9c=function(_0x17c84b,_0x209fb2){_0x17c84b=_0x17c84b-0x0;var _0x168720=_0xe9cb[_0x17c84b];return _0x168720;};'use strict';var ChatGroupEvents=require(_0xbe9c('0x0'));var events=[_0xbe9c('0x1'),_0xbe9c('0x2'),_0xbe9c('0x3')];function createListener(_0x16a75c,_0x37faf4){return function(_0x3aa5b7){_0x37faf4[_0xbe9c('0x4')](_0x16a75c,_0x3aa5b7);};}function removeListener(_0x2e3058,_0x212528){return function(){ChatGroupEvents['removeListener'](_0x2e3058,_0x212528);};}exports['register']=function(_0x45ef3f){for(var _0x199b85=0x0,_0x4ee7ed=events[_0xbe9c('0x5')];_0x199b85<_0x4ee7ed;_0x199b85++){var _0x5dbb3d=events[_0x199b85];var _0x11add5=createListener(_0xbe9c('0x6')+_0x5dbb3d,_0x45ef3f);ChatGroupEvents['on'](_0x5dbb3d,_0x11add5);}}; \ No newline at end of file diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js index e0a3abd..ab0da45 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 _0x8ffa=['getMembers','/:id/messages','getMessages','post','addMembers','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatGroup.controller','index','/describe','describe','/:id','isAuthenticated','show','get','/:id/members'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x8ffa,0x186));var _0xa8ff=function(_0x3cb072,_0x43ebdf){_0x3cb072=_0x3cb072-0x0;var _0x83be2c=_0x8ffa[_0x3cb072];return _0x83be2c;};'use strict';var multer=require(_0xa8ff('0x0'));var util=require(_0xa8ff('0x1'));var path=require('path');var timeout=require(_0xa8ff('0x2'));var express=require(_0xa8ff('0x3'));var router=express[_0xa8ff('0x4')]();var fs_extra=require(_0xa8ff('0x5'));var auth=require(_0xa8ff('0x6'));var interaction=require(_0xa8ff('0x7'));var config=require(_0xa8ff('0x8'));var controller=require(_0xa8ff('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0xa8ff('0xa')]);router['get'](_0xa8ff('0xb'),auth['isAuthenticated'](),controller[_0xa8ff('0xc')]);router['get'](_0xa8ff('0xd'),auth[_0xa8ff('0xe')](),controller[_0xa8ff('0xf')]);router[_0xa8ff('0x10')]('/:id/unread',auth['isAuthenticated'](),controller['getUnread']);router[_0xa8ff('0x10')](_0xa8ff('0x11'),auth[_0xa8ff('0xe')](),controller[_0xa8ff('0x12')]);router['get'](_0xa8ff('0x13'),auth[_0xa8ff('0xe')](),controller[_0xa8ff('0x14')]);router[_0xa8ff('0x15')]('/',auth[_0xa8ff('0xe')](),controller['create']);router[_0xa8ff('0x15')](_0xa8ff('0x11'),auth[_0xa8ff('0xe')](),controller[_0xa8ff('0x16')]);router[_0xa8ff('0x15')](_0xa8ff('0x13'),auth[_0xa8ff('0xe')](),controller['addMessage']);router['put'](_0xa8ff('0xd'),auth['isAuthenticated'](),controller['update']);router['delete'](_0xa8ff('0xd'),auth[_0xa8ff('0xe')](),controller['destroy']);router['delete'](_0xa8ff('0x11'),auth[_0xa8ff('0xe')](),controller['removeMembers']);module[_0xa8ff('0x17')]=router; \ No newline at end of file +var _0x834d=['/:id/messages','getMessages','post','create','addMessage','put','delete','destroy','removeMembers','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../config/environment','./chatGroup.controller','isAuthenticated','index','get','/describe','describe','/:id','show','/:id/unread','getUnread','/:id/members','getMembers'];(function(_0x4e9182,_0x3b49b1){var _0x17aef7=function(_0x516e65){while(--_0x516e65){_0x4e9182['push'](_0x4e9182['shift']());}};_0x17aef7(++_0x3b49b1);}(_0x834d,0x1bd));var _0xd834=function(_0x1c82e0,_0x220f1d){_0x1c82e0=_0x1c82e0-0x0;var _0x24f907=_0x834d[_0x1c82e0];return _0x24f907;};'use strict';var multer=require(_0xd834('0x0'));var util=require(_0xd834('0x1'));var path=require(_0xd834('0x2'));var timeout=require(_0xd834('0x3'));var express=require('express');var router=express[_0xd834('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xd834('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xd834('0x6'));var controller=require(_0xd834('0x7'));router['get']('/',auth[_0xd834('0x8')](),controller[_0xd834('0x9')]);router[_0xd834('0xa')](_0xd834('0xb'),auth[_0xd834('0x8')](),controller[_0xd834('0xc')]);router[_0xd834('0xa')](_0xd834('0xd'),auth[_0xd834('0x8')](),controller[_0xd834('0xe')]);router[_0xd834('0xa')](_0xd834('0xf'),auth[_0xd834('0x8')](),controller[_0xd834('0x10')]);router[_0xd834('0xa')](_0xd834('0x11'),auth['isAuthenticated'](),controller[_0xd834('0x12')]);router[_0xd834('0xa')](_0xd834('0x13'),auth['isAuthenticated'](),controller[_0xd834('0x14')]);router[_0xd834('0x15')]('/',auth['isAuthenticated'](),controller[_0xd834('0x16')]);router[_0xd834('0x15')](_0xd834('0x11'),auth['isAuthenticated'](),controller['addMembers']);router[_0xd834('0x15')]('/:id/messages',auth[_0xd834('0x8')](),controller[_0xd834('0x17')]);router[_0xd834('0x18')](_0xd834('0xd'),auth[_0xd834('0x8')](),controller['update']);router[_0xd834('0x19')](_0xd834('0xd'),auth[_0xd834('0x8')](),controller[_0xd834('0x1a')]);router[_0xd834('0x19')](_0xd834('0x11'),auth[_0xd834('0x8')](),controller[_0xd834('0x1b')]);module[_0xd834('0x1c')]=router; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.attributes.js b/server/api/chatInteraction/chatInteraction.attributes.js index 4ee025b..36eb74e 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 _0x8e44=['BOOLEAN','star','thumb','TEXT','STRING','DATE','long','out','sequelize','exports'];(function(_0x4d9bd9,_0x53603b){var _0x4c1945=function(_0x126f78){while(--_0x126f78){_0x4d9bd9['push'](_0x4d9bd9['shift']());}};_0x4c1945(++_0x53603b);}(_0x8e44,0x1ac));var _0x48e4=function(_0x1eb359,_0x4cda30){_0x1eb359=_0x1eb359-0x0;var _0x3fdf23=_0x8e44[_0x1eb359];return _0x3fdf23;};'use strict';var Sequelize=require(_0x48e4('0x0'));module[_0x48e4('0x1')]={'closed':{'type':Sequelize[_0x48e4('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize['INTEGER']},'ratingType':{'type':Sequelize['ENUM'](_0x48e4('0x3'),_0x48e4('0x4')),'defaultValue':_0x48e4('0x3')},'ratingMessage':{'type':Sequelize[_0x48e4('0x5')]},'pathTranscript':{'type':Sequelize['TEXT']},'mailTranscript':{'type':Sequelize[_0x48e4('0x6')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x48e4('0x7')]},'disposition':{'type':Sequelize[_0x48e4('0x6')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x48e4('0x6')]},'browserName':{'type':Sequelize[_0x48e4('0x6')]},'browserVersion':{'type':Sequelize[_0x48e4('0x6')]},'osName':{'type':Sequelize[_0x48e4('0x6')]},'osVersion':{'type':Sequelize[_0x48e4('0x6')]},'deviceModel':{'type':Sequelize[_0x48e4('0x6')]},'deviceVendor':{'type':Sequelize[_0x48e4('0x6')]},'deviceType':{'type':Sequelize[_0x48e4('0x6')]},'referer':{'type':Sequelize[_0x48e4('0x5')]},'customerIp':{'type':Sequelize['STRING']},'formData':{'type':Sequelize[_0x48e4('0x5')](_0x48e4('0x8'))},'read1stAt':{'type':Sequelize[_0x48e4('0x7')]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x48e4('0x9')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x48e4('0x6')]},'customerPort':{'type':Sequelize[_0x48e4('0x6')]},'vidaooSessionId':{'type':Sequelize[_0x48e4('0x5')]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0x9354=['star','thumb','TEXT','STRING','DATE','long','exports','BOOLEAN','ENUM'];(function(_0x2c7618,_0x26be9c){var _0x5ce3f0=function(_0x1837b3){while(--_0x1837b3){_0x2c7618['push'](_0x2c7618['shift']());}};_0x5ce3f0(++_0x26be9c);}(_0x9354,0x96));var _0x4935=function(_0x350182,_0x2a9feb){_0x350182=_0x350182-0x0;var _0x4a0892=_0x9354[_0x350182];return _0x4a0892;};'use strict';var Sequelize=require('sequelize');module[_0x4935('0x0')]={'closed':{'type':Sequelize[_0x4935('0x1')],'defaultValue':![]},'ratingValue':{'type':Sequelize['INTEGER']},'ratingType':{'type':Sequelize[_0x4935('0x2')](_0x4935('0x3'),_0x4935('0x4')),'defaultValue':_0x4935('0x3')},'ratingMessage':{'type':Sequelize['TEXT']},'pathTranscript':{'type':Sequelize[_0x4935('0x5')]},'mailTranscript':{'type':Sequelize[_0x4935('0x6')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x4935('0x7')]},'disposition':{'type':Sequelize[_0x4935('0x6')]},'secondDisposition':{'type':Sequelize[_0x4935('0x6')]},'thirdDisposition':{'type':Sequelize[_0x4935('0x6')]},'note':{'type':Sequelize[_0x4935('0x6')]},'browserName':{'type':Sequelize[_0x4935('0x6')]},'browserVersion':{'type':Sequelize[_0x4935('0x6')]},'osName':{'type':Sequelize['STRING']},'osVersion':{'type':Sequelize[_0x4935('0x6')]},'deviceModel':{'type':Sequelize['STRING']},'deviceVendor':{'type':Sequelize[_0x4935('0x6')]},'deviceType':{'type':Sequelize[_0x4935('0x6')]},'referer':{'type':Sequelize[_0x4935('0x5')]},'customerIp':{'type':Sequelize[_0x4935('0x6')]},'formData':{'type':Sequelize[_0x4935('0x5')](_0x4935('0x8'))},'read1stAt':{'type':Sequelize['DATE']},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0x4935('0x2')]('in','out'),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize['STRING']},'customerPort':{'type':Sequelize[_0x4935('0x6')]},'vidaooSessionId':{'type':Sequelize[_0x4935('0x5')]},'autoreplyExecuted':{'type':Sequelize[_0x4935('0x1')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js index aaa904f..b8dfbe6 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 _0x8603=['Unauthorized','ChatOfflineMessageId','join','root','server/files/attachments/','offline-chat/','close','server/files/chat/upload/','format','transcript-%s.txt','now','pathTranscript','Messages','CmContact','%s%d','agentAlias','System','Visitor','agentIdentifier','website_alias','agent_alias','alias','agent_fullname','[%s]\x20%s:\x20%s\x0a','MM/DD/YYYY\x20HH:mm:ss','direction','secret','appendFileSync','MailServerOut','Smtp','service','host','port','secure','auth','pass','SendMail','sendMail','\x22%s\x22\x20<%s>','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','mailTranscript','addMessage','ids','omit','getMessages','nolimit','pick','YYYY-MM-DD\x20HH:mm:ss','includeAll','findAll','rows','getMyMessages','hasOwnProperty','includeAgent','addTags','setTags','spread','chatInteractionTags:save','removeTags','download','unix','server','files','attachments','Attachment','Account','Owner','mkdirSync','Chat','N.A.','closedAt','disposition','osName','referer','customerIp','customerPort','tail','existsSync','createReadStream','pipe','createWriteStream','lastName','renderFile','views','transcript-','.pdf','createPdfFromHTML','log','err','unlinkSync','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','sox','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/export/pdf','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatInteraction.socket','register','client','http','request','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','save','update','then','stack','name','send','render','contact','agent','interaction','account','Users','fullname','Tags','TagIds','split','push','catch','index','map','ChatInteraction','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','order','sort','where','field','color','from','tools_tags','select','u.id','u.fullname','user_has_chat_interactions','left_join','users','u.id\x20=\x20ui.UserId','cm_contacts','o.id\x20=\x20i.UserId','chat_websites','chat_messages','me.ChatInteractionId\x20=\x20i.id','chat_interaction_has_tags','it.ChatInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','sqlOperator','conditions','find','unreadMessages','value','`\x20=\x200','having','Contact','operator','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','ContactId','buildExpression','text','Tag','forEach','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','start','body','keys','some','isEmpty','ChatWebsiteId','i.ChatWebsiteId\x20IN\x20?','concat','createdAt','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','isArray','tag','filter','replace','isNumeric','i.id\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','group','i.id','Sequelize','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','t.id\x20IN\x20?','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','user','getChatWebsites','i.ChatWebsiteId\x20IS\x20NULL','role','sequelize','toString','keyBy','merge','a.key','Account.key','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','c.lastName','Contact.lastName','c.email','Contact.email','Contact.phone','c.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.ChatInteractionId\x20IN\x20?','groupBy','ChatInteractionId','all','show','params','include','options','create','describe','createVidaooSession','findOne','ChatWebsite','vidaooApiKey','vidaooEscalation','vidaooMetadata','email','https://api-vidaoo.xcally.com/api/v1/meetings','vidaooTopic','isNull','vidaooNote','follow','ValidationError','Error\x20in\x20Vidaoo\x20configuration','out','ChatMessage','customUpdate','abandon','Interaction\x20already\x20assigned','closed','AbandonInteraction','file','originalname','basename','mimetype','attachmentDownload'];(function(_0x2d8807,_0x155dad){var _0x531262=function(_0x832361){while(--_0x832361){_0x2d8807['push'](_0x2d8807['shift']());}};_0x531262(++_0x155dad);}(_0x8603,0x190));var _0x3860=function(_0x549344,_0x8bd5c3){_0x549344=_0x549344-0x0;var _0x40eacd=_0x8603[_0x549344];return _0x40eacd;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3860('0x0'));var zipdir=require(_0x3860('0x1'));var jsonpatch=require(_0x3860('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x3860('0x3'));var Mustache=require(_0x3860('0x4'));var util=require(_0x3860('0x5'));var path=require('path');var sox=require(_0x3860('0x6'));var csv=require('to-csv');var ejs=require(_0x3860('0x7'));var fs=require('fs');var fs_extra=require(_0x3860('0x8'));var _=require(_0x3860('0x9'));var squel=require(_0x3860('0xa'));var crypto=require(_0x3860('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x3860('0xc'));var Papa=require(_0x3860('0xd'));var Redis=require('ioredis');var authService=require(_0x3860('0xe'));var qs=require(_0x3860('0xf'));var as=require('../../components/parsers/advancedSearch');var pdf=require(_0x3860('0x10'));var hardwareService=require(_0x3860('0x11'));var logger=require('../../config/logger')(_0x3860('0x12'));var utils=require(_0x3860('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x3860('0x14'));var db=require(_0x3860('0x15'))['db'];config[_0x3860('0x16')]=_[_0x3860('0x17')](config[_0x3860('0x16')],{'host':_0x3860('0x18'),'port':0x18eb});var socket=require(_0x3860('0x19'))(new Redis(config[_0x3860('0x16')]));require(_0x3860('0x1a'))[_0x3860('0x1b')](socket);var jayson=require('jayson/promise');var client=jayson[_0x3860('0x1c')][_0x3860('0x1d')]({'port':0x232b});var client9004=jayson[_0x3860('0x1c')][_0x3860('0x1d')]({'port':0x232c});function respondWithRpcPromise(_0x1055b3,_0xfa0c9a,_0x2d8a3a,_0x378305){return new BPromise(function(_0x311fdb,_0x3c0d91){var _0x3e51b4=_0x378305||client;return _0x3e51b4[_0x3860('0x1e')](_0x1055b3,_0x2d8a3a)['then'](function(_0x4863bd){logger[_0x3860('0x1f')](_0x3860('0x20'),_0xfa0c9a,_0x3860('0x21'));logger['debug'](_0x3860('0x22'),_0xfa0c9a,_0x3860('0x21'),JSON[_0x3860('0x23')](_0x4863bd));if(_0x4863bd[_0x3860('0x24')]){if(_0x4863bd[_0x3860('0x24')][_0x3860('0x25')]===0x1f4){logger[_0x3860('0x24')](_0x3860('0x20'),_0xfa0c9a,_0x4863bd[_0x3860('0x24')][_0x3860('0x26')]);return _0x3c0d91(_0x4863bd[_0x3860('0x24')][_0x3860('0x26')]);}logger[_0x3860('0x24')](_0x3860('0x20'),_0xfa0c9a,_0x4863bd[_0x3860('0x24')]['message']);return _0x311fdb(_0x4863bd[_0x3860('0x24')][_0x3860('0x26')]);}else{logger[_0x3860('0x1f')](_0x3860('0x20'),_0xfa0c9a,_0x3860('0x21'));_0x311fdb(_0x4863bd['result'][_0x3860('0x26')]);}})['catch'](function(_0x577750){logger[_0x3860('0x24')](_0x3860('0x20'),_0xfa0c9a,_0x577750);_0x3c0d91(_0x577750);});});}function respondWithStatusCode(_0x54b5ec,_0x4d9a90){_0x4d9a90=_0x4d9a90||0xcc;return function(_0x5f42d5){if(_0x5f42d5){return _0x54b5ec[_0x3860('0x27')](_0x4d9a90);}return _0x54b5ec[_0x3860('0x28')](_0x4d9a90)[_0x3860('0x29')]();};}function respondWithResult(_0x371f3a,_0x9332a5){_0x9332a5=_0x9332a5||0xc8;return function(_0x228d34){if(_0x228d34){return _0x371f3a['status'](_0x9332a5)['json'](_0x228d34);}};}function respondWithFilteredResult(_0x389bd0,_0x1f1809){return function(_0x5a9af2){if(_0x5a9af2){var _0x2551f4=typeof _0x1f1809[_0x3860('0x2a')]===_0x3860('0x2b')&&typeof _0x1f1809[_0x3860('0x2c')]===_0x3860('0x2b');var _0x4bbae9=_0x5a9af2[_0x3860('0x2d')];var _0xf624ba=_0x2551f4?0x0:_0x1f1809[_0x3860('0x2a')];var _0x4bd90c=_0x2551f4?_0x5a9af2[_0x3860('0x2d')]:_0x1f1809['offset']+_0x1f1809[_0x3860('0x2c')];var _0x4825f0;if(_0x4bd90c>=_0x4bbae9){_0x4bd90c=_0x4bbae9;_0x4825f0=0xc8;}else{_0x4825f0=0xce;}_0x389bd0[_0x3860('0x28')](_0x4825f0);return _0x389bd0[_0x3860('0x2e')](_0x3860('0x2f'),_0xf624ba+'-'+_0x4bd90c+'/'+_0x4bbae9)['json'](_0x5a9af2);}return null;};}function patchUpdates(_0x39c751){return function(_0x451b0c){try{jsonpatch['apply'](_0x451b0c,_0x39c751,!![]);}catch(_0x1c94cc){return BPromise['reject'](_0x1c94cc);}return _0x451b0c[_0x3860('0x30')]();};}function saveUpdates(_0x3a577a,_0x35185c){return function(_0x2fc231){if(_0x2fc231){return _0x2fc231[_0x3860('0x31')](_0x3a577a)[_0x3860('0x32')](function(_0x1d3fd0){return _0x1d3fd0;});}return null;};}function removeEntity(_0x4d30bc,_0x1a48b6){return function(_0x396ccf){if(_0x396ccf){return _0x396ccf['destroy']()[_0x3860('0x32')](function(){_0x4d30bc[_0x3860('0x28')](0xcc)[_0x3860('0x29')]();});}};}function handleEntityNotFound(_0x5af661,_0x523cc1){return function(_0x285b1b){if(!_0x285b1b){_0x5af661[_0x3860('0x27')](0x194);}return _0x285b1b;};}function handleError(_0x3abf18,_0xa921ed){_0xa921ed=_0xa921ed||0x1f4;return function(_0x59271f){logger['error'](_0x59271f[_0x3860('0x33')]);if(_0x59271f[_0x3860('0x34')]){delete _0x59271f[_0x3860('0x34')];}_0x3abf18[_0x3860('0x28')](_0xa921ed)[_0x3860('0x35')](_0x59271f);};}function getMustacheRender(_0x4df2a9,_0x424424){return Mustache[_0x3860('0x36')](_0x4df2a9,_['merge'](_0x424424['body'],{'contact':_0x424424[_0x3860('0x37')],'message':_0x424424[_0x3860('0x26')],'agent':_0x424424[_0x3860('0x38')],'interaction':_0x424424[_0x3860('0x39')],'account':_0x424424[_0x3860('0x3a')]}))||'';}function getInteractionUsers(_0x592311,_0x28f04d){return new BPromise(function(_0x510aef,_0x112600){try{if(_0x28f04d[_0x592311['id']]){_0x592311[_0x3860('0x3b')]=_['map'](_0x28f04d[_0x592311['id']],function(_0x36d9bd){return{'id':_0x36d9bd['id'],'fullname':_0x36d9bd[_0x3860('0x3c')]};});}}catch(_0x4f3303){_0x112600(_0x4f3303);}_0x510aef(_0x592311);});}function getInteractionTags(_0x1ef9aa,_0xc7d34d){return new BPromise(function(_0x15bd2c,_0xf346e){try{if(_0x1ef9aa['TagIds']){_0x1ef9aa[_0x3860('0x3d')]=[];_0x1ef9aa[_0x3860('0x3e')][_0x3860('0x3f')](',')['forEach'](function(_0x3a87e5){_0x1ef9aa['Tags'][_0x3860('0x40')](_0xc7d34d[_0x3a87e5]);});}delete _0x1ef9aa[_0x3860('0x3e')];}catch(_0x405bfc){_0xf346e(_0x405bfc);}_0x15bd2c(_0x1ef9aa);});}function updateChatInteraction(_0x3f613f,_0x2220c8,_0x3f4216){return new BPromise(function(_0x4e0a44,_0xbbbf01){return getInteractionUsers(_0x3f613f,_0x3f4216)[_0x3860('0x32')](function(_0x5dc78f){return getInteractionTags(_0x5dc78f,_0x2220c8);})['then'](function(_0x2938d4){_0x4e0a44(_0x2938d4);})[_0x3860('0x41')](function(_0x4f2f53){_0xbbbf01(_0x4f2f53);});});}exports[_0x3860('0x42')]=function(_0x30d8eb,_0x4c6c23){var _0xa6791a={},_0x56a650={},_0x392dc3={'count':0x0,'rows':[]};var _0x37e5c3=_[_0x3860('0x43')](db[_0x3860('0x44')][_0x3860('0x45')],function(_0x15ebbd){return{'name':_0x15ebbd[_0x3860('0x46')],'type':_0x15ebbd[_0x3860('0x47')][_0x3860('0x48')]};});_0x56a650[_0x3860('0x49')]=_[_0x3860('0x43')](_0x37e5c3,'name');_0x56a650[_0x3860('0x4a')]=_['keys'](_0x30d8eb[_0x3860('0x4a')]);_0x56a650[_0x3860('0x4b')]=_[_0x3860('0x4c')](_0x56a650[_0x3860('0x49')],_0x56a650[_0x3860('0x4a')]);_0xa6791a[_0x3860('0x4d')]=_[_0x3860('0x4c')](_0x56a650[_0x3860('0x49')],qs['fields'](_0x30d8eb[_0x3860('0x4a')][_0x3860('0x4e')]));_0xa6791a[_0x3860('0x4d')]=_0xa6791a['attributes'][_0x3860('0x4f')]?_0xa6791a[_0x3860('0x4d')]:_0x56a650[_0x3860('0x49')];if(!_0x30d8eb[_0x3860('0x4a')]['hasOwnProperty']('nolimit')){_0xa6791a[_0x3860('0x2c')]=qs['limit'](_0x30d8eb[_0x3860('0x4a')][_0x3860('0x2c')]);_0xa6791a[_0x3860('0x2a')]=qs['offset'](_0x30d8eb[_0x3860('0x4a')]['offset']);}_0xa6791a[_0x3860('0x50')]=qs['sort'](_0x30d8eb[_0x3860('0x4a')][_0x3860('0x51')]);_0xa6791a[_0x3860('0x52')]=qs['filters'](_['pick'](_0x30d8eb[_0x3860('0x4a')],_0x56a650[_0x3860('0x4b')]),_0x37e5c3);var _0x478dd9=[];var _0x3910f5=squel['select']()[_0x3860('0x53')]('id')[_0x3860('0x53')](_0x3860('0x34'))[_0x3860('0x53')](_0x3860('0x54'))[_0x3860('0x55')](_0x3860('0x56'));var _0x5a9987=squel[_0x3860('0x57')]()[_0x3860('0x53')](_0x3860('0x58'))[_0x3860('0x53')](_0x3860('0x59'))[_0x3860('0x53')]('ui.ChatInteractionId')[_0x3860('0x55')](_0x3860('0x5a'),'ui')[_0x3860('0x5b')](_0x3860('0x5c'),'u',_0x3860('0x5d'));var _0x1e2b5d=squel[_0x3860('0x57')]()[_0x3860('0x55')]('chat_interactions','i')[_0x3860('0x5b')](_0x3860('0x5e'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0x3860('0x5b')](_0x3860('0x5c'),'o',_0x3860('0x5f'))['left_join'](_0x3860('0x60'),'a','a.id\x20=\x20i.ChatWebsiteId')[_0x3860('0x5b')](_0x3860('0x61'),'me',_0x3860('0x62'))[_0x3860('0x5b')](_0x3860('0x63'),'it',_0x3860('0x64'))[_0x3860('0x5b')](_0x3860('0x56'),'t',_0x3860('0x65'));var _0x151492=squel[_0x3860('0x66')]();var _0x2bac24=[];var _0x58147d=squel['expr']();var _0x5111e0;if(_0x30d8eb[_0x3860('0x4a')]['search']){_0x5111e0=as['parseSearch'](_0x30d8eb[_0x3860('0x4a')][_0x3860('0x67')]);var _0x2ff440=_0x5111e0[_0x3860('0x68')];for(var _0x3d6c17=0x0;_0x3d6c17<_0x5111e0[_0x3860('0x69')]['length'];_0x3d6c17++){var _0x49ec68=_0x5111e0['conditions'][_0x3d6c17];var _0x1d6c70='i';var _0x1c1da4=_[_0x3860('0x6a')](_0x37e5c3,['name',_0x49ec68[_0x3860('0x53')]]);if(!_0x1c1da4){switch(_0x49ec68['field']){case _0x3860('0x6b'):if(_0x49ec68[_0x3860('0x6c')]==0x1){_0x1e2b5d['having']('`'+_0x49ec68[_0x3860('0x53')]+_0x3860('0x6d'));}else{_0x1e2b5d[_0x3860('0x6e')]('`'+_0x49ec68[_0x3860('0x53')]+'`\x20>\x200');}break;case _0x3860('0x6f'):if(_0x49ec68[_0x3860('0x70')]===_0x3860('0x71')){if(_0x49ec68['value']['split']('\x20')[_0x3860('0x4f')]>0x1){_0x151492[_0x2ff440](_0x3860('0x72'),qs[_0x3860('0x73')](_0x49ec68[_0x3860('0x6c')]),null);}else{var _0x28a8b4='%'+_0x49ec68[_0x3860('0x6c')]+'%';_0x151492[_0x2ff440]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x28a8b4,_0x28a8b4,_0x28a8b4);}}else{_0x1c1da4=_[_0x3860('0x6a')](_0x37e5c3,[_0x3860('0x34'),'ContactId']);_0x49ec68[_0x3860('0x53')]=_0x3860('0x74');_0x3427a5=as[_0x3860('0x75')](_0x1d6c70,_0x1c1da4[_0x3860('0x47')],_0x49ec68);_0x151492[_0x2ff440](_0x3427a5[_0x3860('0x76')],_0x3427a5[_0x3860('0x6c')]['start'],_0x3427a5[_0x3860('0x6c')][_0x3860('0x29')]);}break;case _0x3860('0x77'):var _0x27e5ab=_0x49ec68[_0x3860('0x6c')][_0x3860('0x3f')](',')['map'](function(_0x1ae31b){return Number(_0x1ae31b);});_0x27e5ab[_0x3860('0x78')](function(_0x1c33dc){_0x58147d['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x1c33dc+',%');});_0x2bac24=_['union'](_0x2bac24,_0x27e5ab);break;case _0x3860('0x79'):if(_0x49ec68[_0x3860('0x70')]===_0x3860('0x71')){_0x151492[_0x2ff440](_0x3860('0x7a'),'%'+_0x49ec68[_0x3860('0x6c')]+'%',null);}else{_0x1c1da4=_['find'](_0x37e5c3,['name',_0x3860('0x7b')]);_0x49ec68[_0x3860('0x53')]='UserId';_0x3427a5=as['buildExpression'](_0x1d6c70,_0x1c1da4[_0x3860('0x47')],_0x49ec68);_0x151492[_0x2ff440](_0x3427a5[_0x3860('0x76')],_0x3427a5['value'][_0x3860('0x7c')],_0x3427a5[_0x3860('0x6c')][_0x3860('0x29')]);}break;case _0x3860('0x7d'):_0x3427a5=as['buildExpression']('me',null,_0x49ec68);_0x151492[_0x2ff440](_0x3427a5[_0x3860('0x76')],_0x3427a5[_0x3860('0x6c')]['start'],_0x3427a5['value'][_0x3860('0x29')]);break;}}else{var _0x3427a5=as['buildExpression'](_0x1d6c70,_0x1c1da4[_0x3860('0x47')],_0x49ec68);_0x151492[_0x2ff440](_0x3427a5['text'],_0x3427a5[_0x3860('0x6c')]['start'],_0x3427a5['value'][_0x3860('0x29')]);}}}else{var _0x49c356=_(_0x30d8eb[_0x3860('0x4a')])[_0x3860('0x7e')]()[_0x3860('0x43')](function(_0x2fd2f4){return _[_0x3860('0x7f')](_0x37e5c3,[_0x3860('0x34'),_0x2fd2f4])?_0x2fd2f4:undefined;})['compact']()[_0x3860('0x6c')]();if(!_[_0x3860('0x80')](_0x49c356)){_0x49c356[_0x3860('0x78')](function(_0x5d7cc4){if(_0x5d7cc4===_0x3860('0x81')){_0x1e2b5d['where'](_0x3860('0x82'),[][_0x3860('0x83')](_0x30d8eb['query'][_0x5d7cc4]));}else if(_0x5d7cc4===_0x3860('0x84')){var _0x2cd731=JSON[_0x3860('0x85')](_0x30d8eb['query'][_0x5d7cc4])['$gte'];var _0x5a282a=JSON['parse'](_0x30d8eb[_0x3860('0x4a')][_0x5d7cc4])[_0x3860('0x86')];_0x1e2b5d[_0x3860('0x52')](_0x3860('0x87'),_0x2cd731,_0x5a282a);}else{if(_0x30d8eb['query'][_0x5d7cc4]==='null'){_0x1e2b5d[_0x3860('0x52')]('i.'+_0x5d7cc4+_0x3860('0x88'));}else{_0x1e2b5d[_0x3860('0x52')]('i.'+_0x5d7cc4+_0x3860('0x89'),_0x30d8eb['query'][_0x5d7cc4]);}}});}if(_0x30d8eb[_0x3860('0x4a')][_0x3860('0x8a')]){if(_0x30d8eb['query']['read']==0x1){_0x1e2b5d[_0x3860('0x6e')](_0x3860('0x8b'));}else{_0x1e2b5d[_0x3860('0x6e')](_0x3860('0x8c'));}}if(_0x30d8eb['query']['tag']){_0x2bac24=_[_0x3860('0x8d')](_0x30d8eb['query'][_0x3860('0x8e')])?_0x30d8eb[_0x3860('0x4a')]['tag']:new Array(_0x30d8eb['query']['tag']);_0x2bac24[_0x3860('0x78')](function(_0x36116e){_0x58147d['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x36116e+',%');});}if(_0x30d8eb[_0x3860('0x4a')][_0x3860('0x8f')]){var _0x2351fe=_0x30d8eb[_0x3860('0x4a')][_0x3860('0x8f')]['replace']('\x5c','\x5c\x5c')[_0x3860('0x90')](/'/g,'\x27\x27');if(qs[_0x3860('0x91')](_0x2351fe)){_0x151492['or'](_0x3860('0x92'),_0x2351fe+'%');}else{_0x151492['or'](_0x3860('0x93'),qs[_0x3860('0x73')](_0x2351fe))['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x2351fe+'%');}}}_0x1e2b5d[_0x3860('0x52')](_0x151492);_0x1e2b5d[_0x3860('0x94')](_0x3860('0x95'));var _0x41ee6f={'type':db[_0x3860('0x96')]['QueryTypes']['SELECT'],'raw':!![]};var _0x196c50=_0x1e2b5d[_0x3860('0x97')]();_0x196c50[_0x3860('0x53')](_0x3860('0x95'));_0x196c50[_0x3860('0x53')](_0x3860('0x98'),_0x3860('0x6b'));if(_0xa6791a['order']){_0xa6791a[_0x3860('0x50')][_0x3860('0x78')](function(_0x58eddd){var _0x1ff95b=_0x58eddd[0x0]===_0x3860('0x99')?_0x58eddd[0x0]:'i.'+_0x58eddd[0x0];_0x1e2b5d[_0x3860('0x50')](_0x1ff95b,_0x58eddd[0x1]==='DESC'?![]:!![]);});}if(!_[_0x3860('0x80')](_0x2bac24)){_0x1e2b5d[_0x3860('0x6e')](_0x58147d);_0x196c50['where'](_0x3860('0x9a'),_0x2bac24);}BPromise['resolve']()[_0x3860('0x32')](function(){if(!_0x5111e0){if(_0x30d8eb[_0x3860('0x4a')]['ChatWebsiteId'])return;_0x196c50[_0x3860('0x52')](_0x3860('0x9b'));_0x1e2b5d[_0x3860('0x52')](_0x3860('0x9b'));return;}if(_0x30d8eb[_0x3860('0x9c')]['role']!==_0x3860('0x38'))return;return _0x30d8eb[_0x3860('0x9c')][_0x3860('0x9d')]({'attributes':['id'],'raw':!![]})[_0x3860('0x32')](function(_0x3c9837){if(_['isEmpty'](_0x3c9837)){_0x196c50['where'](_0x3860('0x9e'));_0x1e2b5d[_0x3860('0x52')]('i.ChatWebsiteId\x20IS\x20NULL');}else{_0x196c50[_0x3860('0x52')](_0x3860('0x82'),_[_0x3860('0x43')](_0x3c9837,'id'));_0x1e2b5d[_0x3860('0x52')]('i.ChatWebsiteId\x20IN\x20?',_[_0x3860('0x43')](_0x3c9837,'id'));}});})['then'](function(){if(_0x30d8eb[_0x3860('0x9c')][_0x3860('0x9f')]===_0x3860('0x38')&&!_0x5111e0&&!_0x30d8eb[_0x3860('0x4a')][_0x3860('0x81')])return[];return db[_0x3860('0xa0')][_0x3860('0x4a')](_0x196c50['toString'](),_0x41ee6f);})[_0x3860('0x32')](function(_0x47396d){_0x392dc3['count']=_0x47396d['length'];if(_0x392dc3['count']===0x0)return[];return db['sequelize'][_0x3860('0x4a')](_0x3910f5[_0x3860('0xa1')](),_0x41ee6f)[_0x3860('0x32')](function(_0x1482cd){_0x478dd9=_[_0x3860('0xa2')](_0x1482cd,'id');_0x41ee6f=_[_0x3860('0xa3')](_0x41ee6f,{'model':db['ChatInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x30d8eb[_0x3860('0x4a')]['fields']){_0xa6791a[_0x3860('0x4d')][_0x3860('0x78')](function(_0x897ea0){_0x1e2b5d[_0x3860('0x53')]('i.'+_0x897ea0);});}else{_0x1e2b5d[_0x3860('0x53')](_0x3860('0x98'),_0x3860('0x6b'));_0x1e2b5d[_0x3860('0x53')](_0x3860('0xa4'),_0x3860('0xa5'));_0x1e2b5d[_0x3860('0x53')]('a.mandatoryDisposition',_0x3860('0xa6'));_0x1e2b5d[_0x3860('0x53')](_0x3860('0xa7'),'contactName');_0x1e2b5d[_0x3860('0x53')](_0x3860('0xa8'));_0x1e2b5d[_0x3860('0x53')](_0x3860('0xa9'),'Contact.firstName');_0x1e2b5d[_0x3860('0x53')](_0x3860('0xaa'),_0x3860('0xab'));_0x1e2b5d['field'](_0x3860('0xac'),_0x3860('0xad'));_0x1e2b5d[_0x3860('0x53')]('c.phone',_0x3860('0xae'));_0x1e2b5d[_0x3860('0x53')](_0x3860('0xaf'),'Contact.mobile');_0x1e2b5d[_0x3860('0x53')](_0x3860('0xb0'),_0x3860('0xb1'));_0x1e2b5d['field'](_0x3860('0xb2'),_0x3860('0xb3'));_0x1e2b5d[_0x3860('0x53')]('o.internal',_0x3860('0xb4'));_0x1e2b5d['field'](_0x3860('0xb5'),'TagIds');}if(_0xa6791a[_0x3860('0x2c')])_0x1e2b5d[_0x3860('0x2c')](_0xa6791a[_0x3860('0x2c')]);if(_0xa6791a[_0x3860('0x2a')])_0x1e2b5d[_0x3860('0x2a')](_0xa6791a[_0x3860('0x2a')]);return db[_0x3860('0xa0')][_0x3860('0x4a')](_0x1e2b5d[_0x3860('0xa1')](),_0x41ee6f);})[_0x3860('0x32')](function(_0x10b4e8){if(_0x10b4e8[_0x3860('0x4f')]>0x0)_0x5a9987[_0x3860('0x52')](_0x3860('0xb6'),_[_0x3860('0x43')](_0x10b4e8,'id'));return db[_0x3860('0xa0')][_0x3860('0x4a')](_0x5a9987[_0x3860('0xa1')](),_0x41ee6f)['then'](function(_0x37575b){var _0x1d6d2b=_[_0x3860('0xb7')](_0x37575b,_0x3860('0xb8'));var _0x3e6bf8=[];_0x10b4e8[_0x3860('0x78')](function(_0xffe2a1){_0x3e6bf8[_0x3860('0x40')](updateChatInteraction(_0xffe2a1,_0x478dd9,_0x1d6d2b));});return BPromise[_0x3860('0xb9')](_0x3e6bf8);});});})[_0x3860('0x32')](function(_0x3b932d){_0x392dc3['rows']=_0x3b932d;return _0x392dc3;})[_0x3860('0x32')](respondWithFilteredResult(_0x4c6c23,_0xa6791a))[_0x3860('0x41')](handleError(_0x4c6c23,null));};exports[_0x3860('0xba')]=function(_0x6334ca,_0x4a929e){var _0x1a1994={'raw':![],'where':{'id':_0x6334ca[_0x3860('0xbb')]['id']}},_0x2ece36={};_0x2ece36[_0x3860('0x49')]=_['keys'](db[_0x3860('0x44')]['rawAttributes']);_0x2ece36['query']=_[_0x3860('0x7e')](_0x6334ca[_0x3860('0x4a')]);_0x2ece36[_0x3860('0x4b')]=_[_0x3860('0x4c')](_0x2ece36[_0x3860('0x49')],_0x2ece36[_0x3860('0x4a')]);_0x1a1994[_0x3860('0x4d')]=_[_0x3860('0x4c')](_0x2ece36[_0x3860('0x49')],qs[_0x3860('0x4e')](_0x6334ca[_0x3860('0x4a')][_0x3860('0x4e')]));_0x1a1994[_0x3860('0x4d')]=_0x1a1994['attributes'][_0x3860('0x4f')]?_0x1a1994['attributes']:_0x2ece36[_0x3860('0x49')];if(_0x6334ca[_0x3860('0x4a')]['includeAll']){_0x1a1994[_0x3860('0xbc')]=[{'all':!![]}];}_0x1a1994=_[_0x3860('0xa3')]({},_0x1a1994,_0x6334ca[_0x3860('0xbd')]);return db[_0x3860('0x44')][_0x3860('0x6a')](_0x1a1994)[_0x3860('0x32')](handleEntityNotFound(_0x4a929e,null))[_0x3860('0x32')](respondWithResult(_0x4a929e,null))['catch'](handleError(_0x4a929e,null));};exports[_0x3860('0xbe')]=function(_0x6d1819,_0x9e1682){return db[_0x3860('0x44')][_0x3860('0xbe')](_0x6d1819['body'],{})[_0x3860('0x32')](respondWithResult(_0x9e1682,0xc9))['catch'](handleError(_0x9e1682,null));};exports['update']=function(_0x56af8c,_0x1059a4){if(_0x56af8c[_0x3860('0x7d')]['id']){delete _0x56af8c[_0x3860('0x7d')]['id'];}return db[_0x3860('0x44')][_0x3860('0x6a')]({'where':{'id':_0x56af8c[_0x3860('0xbb')]['id']}})[_0x3860('0x32')](handleEntityNotFound(_0x1059a4,null))[_0x3860('0x32')](saveUpdates(_0x56af8c['body'],null))[_0x3860('0x32')](respondWithResult(_0x1059a4,null))[_0x3860('0x41')](handleError(_0x1059a4,null));};exports['destroy']=function(_0x490884,_0x4428eb){return db[_0x3860('0x44')][_0x3860('0x6a')]({'where':{'id':_0x490884['params']['id']}})[_0x3860('0x32')](handleEntityNotFound(_0x4428eb,null))['then'](removeEntity(_0x4428eb,null))[_0x3860('0x41')](handleError(_0x4428eb,null));};exports['describe']=function(_0x41fd53,_0xf91fc2){return db['ChatInteraction'][_0x3860('0xbf')]()[_0x3860('0x32')](respondWithResult(_0xf91fc2,null))['catch'](handleError(_0xf91fc2,null));};exports[_0x3860('0xc0')]=function(_0x398bc1,_0x3312c4){var _0x501519=_0x398bc1[_0x3860('0xbb')]['id'];var _0x47fba5;var _0x3e3dac;var _0x18b845;return db['ChatInteraction'][_0x3860('0xc1')]({'where':{'id':_0x501519}})[_0x3860('0x32')](function(_0x2b1dc1){_0x47fba5=_0x2b1dc1;return db[_0x3860('0xc2')][_0x3860('0xc1')]({'where':{'id':_0x2b1dc1['ChatWebsiteId']},'attributes':['id',_0x3860('0xc3'),_0x3860('0xc4'),'vidaooTopic','vidaooNote',_0x3860('0xc5')],'raw':!![]});})['then'](function(_0xe27f6b){if(_0xe27f6b&&_0xe27f6b[_0x3860('0xc3')]&&_0xe27f6b['vidaooEscalation']){_0x3e3dac=_0xe27f6b;var _0x1041bf={'interaction':{'id':_0x501519},'agent':{'id':_0x398bc1['user']['id'],'name':_0x398bc1[_0x3860('0x9c')]['name'],'fullname':_0x398bc1[_0x3860('0x9c')][_0x3860('0x3c')],'email':_0x398bc1[_0x3860('0x9c')][_0x3860('0xc6')]},'contact':_0x398bc1['body'][_0x3860('0x37')],'account':_0x398bc1[_0x3860('0x7d')][_0x3860('0x3a')]};var _0x1e1baf={'rejectUnauthorized':![],'method':'POST','url':_0x3860('0xc7'),'headers':{'X-APIKEY':_0xe27f6b[_0x3860('0xc3')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x398bc1['user'][_0x3860('0xc6')]],'buttons':null,'topic':_0x3e3dac[_0x3860('0xc8')],'note':_[_0x3860('0xc9')](_0x3e3dac[_0x3860('0xca')])?null:getMustacheRender(_0x3e3dac['vidaooNote'],_0x1041bf),'metadata':null},'redirect':_0x3860('0xcb'),'json':!![]};try{if(!_[_0x3860('0xc9')](_0x3e3dac[_0x3860('0xc5')])){var _0x1ce6e6=getMustacheRender(_0x3e3dac['vidaooMetadata'],_0x1041bf);var _0x1df44=JSON['parse'](_0x1ce6e6);_0x1e1baf['body']['metadata']=_0x1df44;}}catch(_0x15b53f){throw new db[(_0x3860('0x96'))][(_0x3860('0xcc'))]('Error\x20in\x20conversion\x20vidaooMetadata');}return rp(_0x1e1baf);}else{throw new db[(_0x3860('0x96'))]['ValidationError'](_0x3860('0xcd'));}})[_0x3860('0x32')](function(_0x21c052){_0x18b845=_0x21c052;if(_0x18b845['id']){var _0x3a920b={'body':_0x18b845['join_url'],'ChatWebsiteId':_0x3e3dac['id'],'ChatInteractionId':_0x47fba5['id'],'direction':_0x3860('0xce'),'UserId':_0x398bc1[_0x3860('0x9c')]['id']};return db[_0x3860('0xcf')]['create'](_0x3a920b,{});}else{throw new db[(_0x3860('0x96'))][(_0x3860('0xcc'))]('Unable\x20to\x20create\x20Vidaoo\x20session');}})['then'](function(){return _0x47fba5['updateAttributes']({'vidaooSessionId':_0x18b845['id']});})['then'](respondWithResult(_0x3312c4,null))[_0x3860('0x41')](handleError(_0x3312c4,null));};exports[_0x3860('0xd0')]=function(_0x2a09a2,_0x266347){if(_0x2a09a2[_0x3860('0x7d')]['id']){delete _0x2a09a2[_0x3860('0x7d')]['id'];}return db[_0x3860('0x44')]['find']({'where':{'id':_0x2a09a2['params']['id']},'include':[{'model':db['CmContact'],'as':_0x3860('0x6f')}]})[_0x3860('0x32')](handleEntityNotFound(_0x266347,null))[_0x3860('0x32')](saveUpdates(_0x2a09a2['body'],null))[_0x3860('0x32')](respondWithResult(_0x266347,null))['catch'](handleError(_0x266347,null));};exports['abandon']=function(_0x5f0700,_0x46f630,_0x505ba2){if(_0x5f0700['body']['id']){delete _0x5f0700[_0x3860('0x7d')]['id'];}return db[_0x3860('0x44')][_0x3860('0x6a')]({'where':{'id':_0x5f0700[_0x3860('0xbb')]['id']}})['then'](function(_0x53392b){if(!_0x53392b){logger['error']('abandonInteraction,\x20%s,\x20%s,\x20%s',_0x3860('0xd1'),0x194,'entity\x20not\x20found');_0x46f630['sendStatus'](0x194);}else{if(_0x53392b[_0x3860('0x7b')]){throw new db[(_0x3860('0x96'))][(_0x3860('0xcc'))](_0x3860('0xd2'));}}return _0x53392b;})['then'](function(_0x6e541d){if(_0x6e541d){return _0x6e541d[_0x3860('0x31')]({'closed':_0x5f0700[_0x3860('0x7d')][_0x3860('0xd3')],'disposition':_0x5f0700['body']['disposition']})[_0x3860('0x32')](function(_0x55c19c){return _0x55c19c;});}})[_0x3860('0x32')](function(_0x4ab85d){return respondWithRpcPromise(_0x3860('0xd4'),_0x3860('0xd1'),_0x5f0700[_0x3860('0x7d')],client9004);})[_0x3860('0x32')](respondWithResult(_0x46f630,null))[_0x3860('0x41')](handleError(_0x46f630,null));};exports['attachmentUpload']=function(_0x5d3c4d,_0x5e3c54,_0x39e855){_0x5d3c4d[_0x3860('0x7d')][_0x3860('0x34')]=_0x5d3c4d[_0x3860('0xd5')][_0x3860('0xd6')];_0x5d3c4d['body'][_0x3860('0xd7')]=_0x5d3c4d[_0x3860('0xd5')]['filename'];_0x5d3c4d[_0x3860('0x7d')]['type']=_0x5d3c4d[_0x3860('0xd5')][_0x3860('0xd8')];return db['Attachment'][_0x3860('0xbe')](_0x5d3c4d[_0x3860('0x7d')])[_0x3860('0x32')](respondWithResult(_0x5e3c54,0xc9))[_0x3860('0x41')](handleError(_0x5e3c54,null));};exports[_0x3860('0xd9')]=function(_0x3e2dfc,_0x135e84,_0x199bbc){return db[_0x3860('0x44')][_0x3860('0xc1')]({'where':{'id':_0x3e2dfc[_0x3860('0xbb')]['id']},'raw':!![]})[_0x3860('0x32')](handleEntityNotFound(_0x135e84,null))['then'](function(_0x369a4b){if(_0x369a4b){if(_0x369a4b['closed']){return _0x135e84[_0x3860('0x28')](0x193)['json']({'status':0x193,'message':_0x3860('0xda')});}return db['Attachment'][_0x3860('0xc1')]({'where':{'id':_0x3e2dfc['query']['attachId']},'raw':!![]})[_0x3860('0x32')](handleEntityNotFound(_0x135e84,null));}})[_0x3860('0x32')](function(_0xa152b4){if(_0xa152b4){var _0x28931d=_0xa152b4[_0x3860('0xdb')]!==null;var _0x5e65a2=path[_0x3860('0xdc')](config[_0x3860('0xdd')],_0x3860('0xde'));if(_0x28931d){_0x5e65a2=path[_0x3860('0xdc')](_0x5e65a2,_0x3860('0xdf'));}var _0x268658=path['join'](_0x5e65a2,_0xa152b4[_0x3860('0xd7')]);return _0x135e84['download'](_0x268658);}})[_0x3860('0x41')](handleError(_0x135e84,null));};exports[_0x3860('0xe0')]=function(_0x118c4e,_0x471da9){var _0x244ceb=null;var _0x24f8a6=null;var _0x532349=null;var _0x17fa12=null;if(_0x118c4e[_0x3860('0x7d')]['id']){delete _0x118c4e[_0x3860('0x7d')]['id'];}if(_0x118c4e[_0x3860('0x7d')]['mailTranscript']){_0x17fa12=path[_0x3860('0xdc')](config[_0x3860('0xdd')],_0x3860('0xe1'),util[_0x3860('0xe2')](_0x3860('0xe3'),Date[_0x3860('0xe4')]()));_0x118c4e['body'][_0x3860('0xe5')]=_0x17fa12;}return db[_0x3860('0x44')][_0x3860('0x6a')]({'where':{'id':_0x118c4e[_0x3860('0xbb')]['id']},'include':[{'model':db[_0x3860('0xcf')],'as':_0x3860('0xe6'),'include':[{'model':db['User'],'as':'User'}]}]})['then'](handleEntityNotFound(_0x471da9,null))[_0x3860('0x32')](saveUpdates(_0x118c4e[_0x3860('0x7d')],null))['then'](function(_0x276828){if(_0x276828){_0x244ceb=_0x276828;return db[_0x3860('0xc2')][_0x3860('0x6a')]({'where':{'id':_0x244ceb[_0x3860('0x81')]}});}})[_0x3860('0x32')](function(_0x1740d0){if(_0x1740d0){_0x532349=_0x1740d0;return db[_0x3860('0xe7')][_0x3860('0x6a')]({'where':{'id':_0x244ceb[_0x3860('0x74')]}});}})[_0x3860('0x32')](function(_0x975c7f){if(_0x975c7f){_0x24f8a6=_0x975c7f;if(_0x17fa12){var _0x23207b=null;for(var _0x1a1366=0x1;_0x1a1366<_0x244ceb[_0x3860('0xe6')][_0x3860('0x4f')];++_0x1a1366){_0x23207b=_0x244ceb['Messages'][_0x1a1366];var _0x56566c=_0x23207b[_0x3860('0x7b')]?util[_0x3860('0xe2')](_0x3860('0xe8'),_0x532349[_0x3860('0xe9')],_0x23207b[_0x3860('0x7b')]):_0x3860('0xea');var _0x1290e7=_0x118c4e[_0x3860('0x7d')]['customer']||util[_0x3860('0xe2')](_0x3860('0xe8'),_0x3860('0xeb'),_0x23207b['ContactId']);switch(_0x532349[_0x3860('0xec')]){case _0x3860('0xed'):_0x56566c=_0x23207b[_0x3860('0x7b')]?util[_0x3860('0xe2')](_0x3860('0xe8'),_0x532349[_0x3860('0xe9')],_0x23207b[_0x3860('0x7b')]):_0x3860('0xea');break;case _0x3860('0xee'):_0x56566c=_0x23207b['UserId']?_0x23207b[_0x3860('0x79')][_0x3860('0xef')]||_0x23207b['User'][_0x3860('0x3c')]:_0x3860('0xea');break;case _0x3860('0xf0'):_0x56566c=_0x23207b['UserId']?_0x23207b[_0x3860('0x79')][_0x3860('0x3c')]:_0x3860('0xea');break;default:_0x56566c=_0x23207b[_0x3860('0x7b')]?util['format']('%s%d',_0x532349[_0x3860('0xe9')],_0x23207b['UserId']):_0x3860('0xea');}var _0x15314d=util[_0x3860('0xe2')](_0x3860('0xf1'),moment(_0x23207b[_0x3860('0x84')])[_0x3860('0xe2')](_0x3860('0xf2')),_0x23207b[_0x3860('0xf3')]==='in'?_0x1290e7:_0x56566c,_0x23207b['body']);if(!_0x23207b[_0x3860('0xf4')]){fs[_0x3860('0xf5')](_0x17fa12,_0x15314d);}}return db['MailAccount']['findOne']({'where':{'service':!![]},'include':[{'model':db[_0x3860('0xf6')],'as':'Smtp','raw':!![]}]});}}})[_0x3860('0x32')](function(_0x2bf644){if(_0x2bf644&&_0x2bf644[_0x3860('0xf7')]&&_0x118c4e[_0x3860('0x7d')]){var _0xd95981={'tls':{'rejectUnauthorized':![]}};if(_0x2bf644[_0x3860('0xf7')][_0x3860('0xf8')]){_0xd95981[_0x3860('0xf8')]=_0x2bf644['Smtp']['service'];}else{_0xd95981[_0x3860('0xf9')]=_0x2bf644['Smtp'][_0x3860('0xf9')];_0xd95981[_0x3860('0xfa')]=_0x2bf644[_0x3860('0xf7')][_0x3860('0xfa')];_0xd95981[_0x3860('0xfb')]=_0x2bf644[_0x3860('0xf7')][_0x3860('0xfb')];}if(_0x2bf644['Smtp']['authentication']){_0xd95981[_0x3860('0xfc')]={'user':_0x2bf644[_0x3860('0xf7')][_0x3860('0x9c')],'pass':_0x2bf644['Smtp'][_0x3860('0xfd')]};}return respondWithRpcPromise(_0x3860('0xfe'),_0x3860('0xff'),{'account':_0xd95981,'message':{'from':util['format'](_0x3860('0x100'),_0x2bf644[_0x3860('0x34')],_0x2bf644['email']||_0x2bf644['Smtp']['user']),'to':_0x118c4e['body']['mailTranscript'],'subject':_0x3860('0x101'),'text':util[_0x3860('0xe2')](_0x3860('0x102'),_0x118c4e[_0x3860('0x7d')][_0x3860('0x103')]),'attachments':[{'path':_0x17fa12}]}})['then'](function(){return _0x244ceb;})[_0x3860('0x41')](function(_0x5235e){console['error'](_0x5235e);});}else{return _0x244ceb;}})[_0x3860('0x32')](respondWithStatusCode(_0x471da9,0xc8))[_0x3860('0x41')](handleError(_0x471da9,null));};exports[_0x3860('0x104')]=function(_0x38cdf1,_0x4ab7b2,_0x4c8a10){return db['ChatMessage'][_0x3860('0x6a')]({'where':{'id':_0x38cdf1['params']['id']}})[_0x3860('0x32')](handleEntityNotFound(_0x4ab7b2,null))[_0x3860('0x32')](function(_0x2adf67){if(_0x2adf67){return _0x2adf67[_0x3860('0x104')](_0x38cdf1[_0x3860('0x7d')][_0x3860('0x105')],_[_0x3860('0x106')](_0x38cdf1[_0x3860('0x7d')],[_0x3860('0x105'),'id'])||{});}})[_0x3860('0x32')](respondWithResult(_0x4ab7b2,null))[_0x3860('0x41')](handleError(_0x4ab7b2,null));};exports[_0x3860('0x107')]=function(_0x173790,_0x20d0d2,_0x8d3ad7){var _0xf1e9ab={'raw':![],'where':{}};var _0xcf350b={};var _0x1348e0={'count':0x0,'rows':[]};return db['ChatInteraction'][_0x3860('0xc1')]({'where':{'id':_0x173790['params']['id']}})[_0x3860('0x32')](handleEntityNotFound(_0x20d0d2,null))[_0x3860('0x32')](function(_0x11d0ab){if(_0x11d0ab){_0xcf350b[_0x3860('0x49')]=_[_0x3860('0x7e')](db[_0x3860('0xcf')][_0x3860('0x45')]);_0xcf350b[_0x3860('0x4a')]=_[_0x3860('0x7e')](_0x173790['query']);_0xcf350b[_0x3860('0x4b')]=_[_0x3860('0x4c')](_0xcf350b[_0x3860('0x49')],_0xcf350b[_0x3860('0x4a')]);_0xf1e9ab[_0x3860('0x4d')]=_[_0x3860('0x4c')](_0xcf350b[_0x3860('0x49')],qs['fields'](_0x173790[_0x3860('0x4a')][_0x3860('0x4e')]));_0xf1e9ab[_0x3860('0x4d')]=_0xf1e9ab['attributes'][_0x3860('0x4f')]?_0xf1e9ab[_0x3860('0x4d')]:_0xcf350b[_0x3860('0x49')];if(!_0x173790['query']['hasOwnProperty'](_0x3860('0x108'))){_0xf1e9ab[_0x3860('0x2c')]=qs['limit'](_0x173790[_0x3860('0x4a')]['limit']);_0xf1e9ab[_0x3860('0x2a')]=qs[_0x3860('0x2a')](_0x173790['query'][_0x3860('0x2a')]);}_0xf1e9ab['order']=qs[_0x3860('0x51')](_0x173790[_0x3860('0x4a')][_0x3860('0x51')]);_0xf1e9ab[_0x3860('0x52')]=qs[_0x3860('0x4b')](_[_0x3860('0x109')](_0x173790[_0x3860('0x4a')],_0xcf350b['filters']));_0xf1e9ab[_0x3860('0x52')]['ChatInteractionId']=_0x11d0ab['id'];if(_0x173790[_0x3860('0x4a')][_0x3860('0x8f')]){_0xf1e9ab['where']=_['merge'](_0xf1e9ab[_0x3860('0x52')],{'$or':_[_0x3860('0x43')](_0xf1e9ab[_0x3860('0x4d')],function(_0x234f93){var _0x5ed001={};_0x5ed001[_0x234f93]={'$like':'%'+_0x173790[_0x3860('0x4a')][_0x3860('0x8f')]+'%'};return _0x5ed001;})});}if(_0x173790[_0x3860('0x4a')]['$gte']){var _0x1ac962=_0x173790[_0x3860('0x4a')]['$gte'][_0x3860('0x3f')](',');var _0x35dbfe={};_0x35dbfe[_0x1ac962[0x0]]={'$gte':moment(_0x1ac962[0x1])[_0x3860('0xe2')](_0x3860('0x10a'))};_0xf1e9ab[_0x3860('0x52')]=_[_0x3860('0xa3')](_0xf1e9ab[_0x3860('0x52')],_0x35dbfe);}_0xf1e9ab=_['merge']({},_0xf1e9ab,_0x173790[_0x3860('0xbd')]);return db[_0x3860('0xcf')][_0x3860('0x2d')]({'where':_0xf1e9ab[_0x3860('0x52')]})[_0x3860('0x32')](function(_0x54ebd7){_0x1348e0[_0x3860('0x2d')]=_0x54ebd7;if(_0x173790[_0x3860('0x4a')][_0x3860('0x10b')]){_0xf1e9ab[_0x3860('0xbc')]=[{'all':!![]}];}return db[_0x3860('0xcf')][_0x3860('0x10c')](_0xf1e9ab);})['then'](function(_0x16457e){_0x1348e0[_0x3860('0x10d')]=_0x16457e;return _0x1348e0;});}})[_0x3860('0x32')](respondWithFilteredResult(_0x20d0d2,_0xf1e9ab))[_0x3860('0x41')](handleError(_0x20d0d2,null));};exports[_0x3860('0x10e')]=function(_0x2b6605,_0x11409b,_0x187e3b){var _0x4fb4f3={'where':{}},_0x21b179={},_0x28b7a2={'count':0x0,'rows':[]};return db[_0x3860('0x44')][_0x3860('0xc1')]({'where':{'id':_0x2b6605[_0x3860('0xbb')]['id']}})[_0x3860('0x32')](handleEntityNotFound(_0x11409b,null))[_0x3860('0x32')](function(_0x2ca2e7){if(_0x2ca2e7){_0x21b179[_0x3860('0x49')]=_['keys'](db[_0x3860('0xcf')][_0x3860('0x45')]);_0x21b179[_0x3860('0x4a')]=_[_0x3860('0x7e')](_0x2b6605[_0x3860('0x4a')]);_0x21b179[_0x3860('0x4b')]=_[_0x3860('0x4c')](_0x21b179[_0x3860('0x49')],_0x21b179[_0x3860('0x4a')]);_0x4fb4f3[_0x3860('0x4d')]=_[_0x3860('0x4c')](_0x21b179[_0x3860('0x49')],qs[_0x3860('0x4e')](_0x2b6605[_0x3860('0x4a')][_0x3860('0x4e')]));_0x4fb4f3['attributes']=_0x4fb4f3[_0x3860('0x4d')][_0x3860('0x4f')]?_0x4fb4f3[_0x3860('0x4d')]:_0x21b179[_0x3860('0x49')];if(!_0x2b6605[_0x3860('0x4a')][_0x3860('0x10f')](_0x3860('0x108'))){_0x4fb4f3[_0x3860('0x2c')]=qs[_0x3860('0x2c')](_0x2b6605[_0x3860('0x4a')][_0x3860('0x2c')]);_0x4fb4f3[_0x3860('0x2a')]=qs['offset'](_0x2b6605[_0x3860('0x4a')]['offset']);}_0x4fb4f3[_0x3860('0x50')]=qs['sort'](_0x2b6605[_0x3860('0x4a')]['sort']);_0x4fb4f3[_0x3860('0x52')]=qs[_0x3860('0x4b')](_['pick'](_0x2b6605[_0x3860('0x4a')],_0x21b179[_0x3860('0x4b')]));_0x4fb4f3[_0x3860('0x52')][_0x3860('0xb8')]=_0x2ca2e7['id'];if(_0x2b6605[_0x3860('0x4a')]['filter']){_0x4fb4f3['where']=_[_0x3860('0xa3')](_0x4fb4f3[_0x3860('0x52')],{'$or':_[_0x3860('0x43')](_0x4fb4f3[_0x3860('0x4d')],function(_0x31a537){var _0x438121={};_0x438121[_0x31a537]={'$like':'%'+_0x2b6605[_0x3860('0x4a')]['filter']+'%'};return _0x438121;})});}_0x4fb4f3[_0x3860('0x52')]['secret']=![];if(_0x2b6605[_0x3860('0x4a')]['id']){_0x4fb4f3[_0x3860('0x52')]['id']={'$gt':_0x2b6605[_0x3860('0x4a')]['id']};}_0x4fb4f3=_[_0x3860('0xa3')]({},_0x4fb4f3,_0x2b6605['options']);return db[_0x3860('0xcf')][_0x3860('0x2d')]({'where':_0x4fb4f3['where']})[_0x3860('0x32')](function(_0x4d4366){_0x28b7a2[_0x3860('0x2d')]=_0x4d4366;_0x4fb4f3[_0x3860('0xbc')]=[];if(_0x2b6605[_0x3860('0x4a')][_0x3860('0x110')]){_0x4fb4f3[_0x3860('0xbc')][_0x3860('0x40')]({'model':db[_0x3860('0x79')],'as':_0x3860('0x79'),'attributes':['id',_0x3860('0x3c'),'alias']});}if(_0x2b6605[_0x3860('0x4a')][_0x3860('0x10b')]){_0x4fb4f3[_0x3860('0xbc')]=[{'all':!![]}];}return db['ChatMessage']['findAll'](_0x4fb4f3);})['then'](function(_0x39c52e){_0x28b7a2[_0x3860('0x10d')]=_0x39c52e;return _0x28b7a2;});}})[_0x3860('0x32')](respondWithFilteredResult(_0x11409b,_0x4fb4f3))[_0x3860('0x41')](handleError(_0x11409b,null));};exports[_0x3860('0x111')]=function(_0x185040,_0x14cef9,_0x5e1ed4){return db[_0x3860('0x44')][_0x3860('0x6a')]({'where':{'id':_0x185040[_0x3860('0xbb')]['id']}})[_0x3860('0x32')](handleEntityNotFound(_0x14cef9,null))['then'](function(_0xbc013a){if(_0xbc013a){return _0xbc013a[_0x3860('0x112')](_0x185040['body'][_0x3860('0x105')],_[_0x3860('0x106')](_0x185040[_0x3860('0x7d')],[_0x3860('0x105'),'id'])||{})[_0x3860('0x113')](function(){return db[_0x3860('0x77')][_0x3860('0x10c')]({'attributes':['id',_0x3860('0x34'),_0x3860('0x54')],'where':{'id':_0x185040[_0x3860('0x7d')][_0x3860('0x105')]}});})[_0x3860('0x32')](function(_0x57f603){socket['emit'](_0x3860('0x114'),{'id':Number(_0x185040['params']['id']),'tags':_0x57f603||[]});return{'id':Number(_0x185040['params']['id']),'tags':_0x57f603||[]};});}})[_0x3860('0x32')](respondWithResult(_0x14cef9,null))[_0x3860('0x41')](handleError(_0x14cef9,null));};exports[_0x3860('0x115')]=function(_0x2e2ff3,_0x27c591,_0x8b9a7a){return db['ChatInteraction'][_0x3860('0x6a')]({'where':{'id':_0x2e2ff3[_0x3860('0xbb')]['id']}})['then'](handleEntityNotFound(_0x27c591,null))[_0x3860('0x32')](function(_0x5ecd57){if(_0x5ecd57){return _0x5ecd57['removeTags'](_0x2e2ff3['query'][_0x3860('0x105')]);}})[_0x3860('0x32')](respondWithStatusCode(_0x27c591,null))[_0x3860('0x41')](handleError(_0x27c591,null));};exports[_0x3860('0x116')]=function(_0x39524a,_0xa0492b){var _0x4d44de=moment()[_0x3860('0x117')]()[_0x3860('0xa1')]();var _0x1dcd01=path['join'](config[_0x3860('0xdd')],_0x3860('0x118'),_0x3860('0x119'),'tmp');var _0x198422=path['join'](config[_0x3860('0xdd')],'server',_0x3860('0x119'),_0x3860('0x11a'));var _0x1a97c1=path[_0x3860('0xdc')](_0x1dcd01,_0x4d44de);var _0x4cc748=util[_0x3860('0xe2')]('transcript-%d-%s.zip',_0x39524a[_0x3860('0xbb')]['id'],_0x4d44de);var _0x18fd61=path['join'](_0x1dcd01,_0x4cc748);var _0x39eb63=[];_0x39eb63[_0x3860('0x40')]({'model':db['User'],'as':_0x3860('0x79'),'attributes':['id',_0x3860('0x3c')],'raw':!![]});_0x39eb63[_0x3860('0x40')]({'model':db[_0x3860('0xe7')],'as':_0x3860('0x6f'),'attributes':['id','firstName','lastName'],'raw':!![]});if(_0x39524a[_0x3860('0x4a')]['attachments']){_0x39eb63[_0x3860('0x40')]({'model':db[_0x3860('0x11b')],'as':'Attachment','raw':!![]});}var _0x134dfd=[{'model':db[_0x3860('0xcf')],'as':_0x3860('0xe6'),'attributes':['id','body',_0x3860('0x84'),'direction','secret','read'],'include':_0x39eb63}];_0x134dfd['push']({'model':db['ChatWebsite'],'as':_0x3860('0x11c'),'attributes':['id',_0x3860('0x34')]});_0x134dfd['push']({'model':db[_0x3860('0x79')],'as':_0x3860('0x11d'),'attributes':['id',_0x3860('0x3c')]});return db[_0x3860('0x44')][_0x3860('0x6a')]({'where':{'id':_0x39524a[_0x3860('0xbb')]['id']},'include':_0x134dfd})[_0x3860('0x32')](handleEntityNotFound(_0xa0492b,null))['then'](function(_0x2fe51b){if(_0x2fe51b){var _0x51bf5a=_0x2fe51b['get']({'plain':!![]});fs[_0x3860('0x11e')](_0x1a97c1);var _0x33abf1={'channel':_0x3860('0x11f'),'account':_0x51bf5a[_0x3860('0x11c')][_0x3860('0x34')],'agent':_0x51bf5a['Owner']?_0x51bf5a[_0x3860('0x11d')]['fullname']:_0x3860('0x120'),'createdAt':moment(_0x51bf5a['createdAt'])[_0x3860('0xe2')](_0x3860('0x10a'))[_0x3860('0xa1')](),'closedAt':_0x51bf5a[_0x3860('0xd3')]?moment(_0x51bf5a[_0x3860('0x121')])[_0x3860('0xe2')](_0x3860('0x10a'))[_0x3860('0xa1')]():'','disposition':_0x51bf5a[_0x3860('0x122')],'chatInfo':{'browser':_0x51bf5a['browserName'],'os':_0x51bf5a[_0x3860('0x123')],'referer':_0x51bf5a[_0x3860('0x124')],'customerIp':_0x51bf5a[_0x3860('0x125')],'customerPort':_0x51bf5a[_0x3860('0x126')]?_0x51bf5a[_0x3860('0x126')]:'N.A.'},'messages':_(_0x51bf5a[_0x3860('0xe6')])[_0x3860('0x127')]()['filter']({'secret':![]})['map'](function(_0x5b23d2){if(_0x5b23d2[_0x3860('0x11b')]){var _0x409781=path[_0x3860('0xdc')](_0x198422,_0x5b23d2[_0x3860('0x11b')][_0x3860('0xd7')]);if(fs[_0x3860('0x128')](_0x409781)){fs[_0x3860('0x129')](_0x409781)[_0x3860('0x12a')](fs[_0x3860('0x12b')](path[_0x3860('0xdc')](_0x1a97c1,_0x5b23d2[_0x3860('0x11b')][_0x3860('0xd7')])));}}return{'date':moment(_0x5b23d2[_0x3860('0x84')])[_0x3860('0xe2')](_0x3860('0x10a'))[_0x3860('0xa1')](),'sender':_0x5b23d2[_0x3860('0xf3')]===_0x3860('0xce')?_0x5b23d2[_0x3860('0x79')]?_0x5b23d2['User'][_0x3860('0x3c')]:_0x3860('0xea'):_0x5b23d2[_0x3860('0x6f')]['firstName']+(_0x5b23d2[_0x3860('0x6f')][_0x3860('0x12c')]?'\x20'+_0x5b23d2['Contact'][_0x3860('0x12c')]:''),'body':_0x5b23d2['Attachment']?_0x5b23d2['Attachment'][_0x3860('0xd7')]:_0x5b23d2[_0x3860('0x7d')],'direction':_0x5b23d2[_0x3860('0xf3')]===_0x3860('0xce')?'A':'C','secret':_0x5b23d2[_0x3860('0xf4')],'read':_0x5b23d2[_0x3860('0x8a')],'attachment':_0x5b23d2['Attachment']};})[_0x3860('0x6c')]()};return ejs[_0x3860('0x12d')](path[_0x3860('0xdc')](config['root'],_0x3860('0x118'),_0x3860('0x12e'),'downloadInteraction.ejs'),{'interaction':_0x33abf1})[_0x3860('0x32')](function(_0x5c5755){var _0x5dfb3b=path[_0x3860('0xdc')](_0x1a97c1,_0x3860('0x12f')+_0x51bf5a['id']+'-'+_0x4d44de+_0x3860('0x130'));var _0x1eba76={'path':_0x5dfb3b,'channel':'Chat','interactionId':_0x51bf5a['id']};return pdf[_0x3860('0x131')](_0x5c5755,_0x1eba76);})['then'](function(){return new BPromise(function(_0x34ad82,_0x44ac65){zipdir(_0x1a97c1,{'saveTo':_0x18fd61},function(_0x43cc98,_0xd9ff70){if(_0x43cc98)return _0x44ac65(_0x43cc98);return _0x34ad82(_0xd9ff70);});})['then'](function(){return new BPromise(function(_0x52e611,_0x4ccefa){rimraf(_0x1a97c1,function(_0x2c90b){if(_0x2c90b)_0x4ccefa(_0x2c90b);return _0x52e611();});});})[_0x3860('0x32')](function(){return _0xa0492b[_0x3860('0x116')](_0x18fd61,_0x4cc748,function(_0x3046f4){if(_0x3046f4){console[_0x3860('0x132')](_0x3860('0x133'),_0x3046f4);}else{fs[_0x3860('0x134')](_0x18fd61);}});});});}else{return _0xa0492b['sendStatus'](0xc8);}})[_0x3860('0x41')](handleError(_0xa0492b,null));}; \ No newline at end of file +var _0xda2d=['update','destroy','name','send','render','merge','agent','interaction','account','Users','map','Tags','split','forEach','TagIds','index','ChatInteraction','rawAttributes','fieldName','type','key','model','keys','query','intersection','fields','attributes','nolimit','order','sort','filters','pick','field','color','tools_tags','select','u.id','u.fullname','from','user_has_chat_interactions','left_join','u.id\x20=\x20ui.UserId','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','users','a.id\x20=\x20i.ChatWebsiteId','me.ChatInteractionId\x20=\x20i.id','chat_interaction_has_tags','t.id\x20=\x20it.TagId','expr','search','sqlOperator','conditions','length','find','unreadMessages','value','having','`\x20=\x200','`\x20>\x200','Contact','operator','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','start','body','some','compact','where','i.ChatWebsiteId\x20IN\x20?','concat','createdAt','parse','$gte','$lte','null','\x20IS\x20NULL','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','isNumeric','i.id\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','SELECT','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','DESC','isEmpty','t.id\x20IN\x20?','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','user','role','getChatWebsites','i.ChatWebsiteId\x20IS\x20NULL','toString','sequelize','keyBy','a.key','Account.key','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','c.lastName','Contact.lastName','c.email','Contact.email','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','groupBy','ChatInteractionId','push','show','params','include','options','create','describe','findOne','ChatWebsiteId','vidaooEscalation','vidaooTopic','vidaooApiKey','fullname','email','contact','POST','https://api-vidaoo.xcally.com/api/v1/meetings','isNull','vidaooNote','follow','vidaooMetadata','metadata','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','Error\x20in\x20Vidaoo\x20configuration','join_url','out','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','CmContact','abandon','Interaction\x20already\x20assigned','disposition','attachmentUpload','file','filename','mimetype','attachmentDownload','closed','Unauthorized','attachId','ChatOfflineMessageId','join','offline-chat/','basename','download','close','mailTranscript','root','server/files/chat/upload/','transcript-%s.txt','now','pathTranscript','Messages','ChatWebsite','format','%s%d','agentAlias','customer','Visitor','website_alias','UserId','System','agent_alias','alias','agent_fullname','MM/DD/YYYY\x20HH:mm:ss','direction','appendFileSync','MailAccount','MailServerOut','Smtp','service','host','port','secure','authentication','auth','pass','SendMail','sendMail','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ids','omit','getMessages','hasOwnProperty','YYYY-MM-DD\x20HH:mm:ss','includeAll','rows','getMyMessages','addTags','setTags','findAll','chatInteractionTags:save','removeTags','unix','server','tmp','files','attachments','firstName','lastName','Attachment','Account','Owner','get','Chat','N.A.','browserName','osName','referer','customerIp','customerPort','tail','existsSync','createReadStream','renderFile','views','downloadInteraction.ejs','.pdf','createPdfFromHTML','err','unlinkSync','rimraf','zip-dir','fast-json-patch','request-promise','moment','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/license/hardware','../../config/logger','api','../../config/utils','redis','defaults','localhost','socket.io-emitter','./chatInteraction.socket','jayson/promise','http','client','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','sendStatus','end','status','json','offset','undefined','limit','count','set','reject','save'];(function(_0x39f097,_0x17116b){var _0x544f6a=function(_0x457caf){while(--_0x457caf){_0x39f097['push'](_0x39f097['shift']());}};_0x544f6a(++_0x17116b);}(_0xda2d,0x102));var _0xdda2=function(_0x568b12,_0x258f8f){_0x568b12=_0x568b12-0x0;var _0x341f20=_0xda2d[_0x568b12];return _0x341f20;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xdda2('0x0'));var zipdir=require(_0xdda2('0x1'));var jsonpatch=require(_0xdda2('0x2'));var rp=require(_0xdda2('0x3'));var moment=require(_0xdda2('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xdda2('0x5'));var sox=require(_0xdda2('0x6'));var csv=require(_0xdda2('0x7'));var ejs=require(_0xdda2('0x8'));var fs=require('fs');var fs_extra=require(_0xdda2('0x9'));var _=require(_0xdda2('0xa'));var squel=require(_0xdda2('0xb'));var crypto=require(_0xdda2('0xc'));var jsforce=require(_0xdda2('0xd'));var deskjs=require(_0xdda2('0xe'));var toCsv=require('to-csv');var querystring=require(_0xdda2('0xf'));var Papa=require(_0xdda2('0x10'));var Redis=require('ioredis');var authService=require(_0xdda2('0x11'));var qs=require(_0xdda2('0x12'));var as=require(_0xdda2('0x13'));var pdf=require(_0xdda2('0x14'));var hardwareService=require(_0xdda2('0x15'));var logger=require(_0xdda2('0x16'))(_0xdda2('0x17'));var utils=require(_0xdda2('0x18'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0xdda2('0x19')]=_[_0xdda2('0x1a')](config[_0xdda2('0x19')],{'host':_0xdda2('0x1b'),'port':0x18eb});var socket=require(_0xdda2('0x1c'))(new Redis(config[_0xdda2('0x19')]));require(_0xdda2('0x1d'))['register'](socket);var jayson=require(_0xdda2('0x1e'));var client=jayson['client'][_0xdda2('0x1f')]({'port':0x232b});var client9004=jayson[_0xdda2('0x20')][_0xdda2('0x1f')]({'port':0x232c});function respondWithRpcPromise(_0x457764,_0x1922b1,_0x5d8a83,_0x55d674){return new BPromise(function(_0x43f67b,_0x518c6d){var _0x1a5192=_0x55d674||client;return _0x1a5192[_0xdda2('0x21')](_0x457764,_0x5d8a83)[_0xdda2('0x22')](function(_0x2b6ee8){logger[_0xdda2('0x23')](_0xdda2('0x24'),_0x1922b1,_0xdda2('0x25'));logger[_0xdda2('0x26')](_0xdda2('0x27'),_0x1922b1,_0xdda2('0x25'),JSON[_0xdda2('0x28')](_0x2b6ee8));if(_0x2b6ee8[_0xdda2('0x29')]){if(_0x2b6ee8['error'][_0xdda2('0x2a')]===0x1f4){logger['error'](_0xdda2('0x24'),_0x1922b1,_0x2b6ee8[_0xdda2('0x29')][_0xdda2('0x2b')]);return _0x518c6d(_0x2b6ee8['error'][_0xdda2('0x2b')]);}logger['error'](_0xdda2('0x24'),_0x1922b1,_0x2b6ee8[_0xdda2('0x29')]['message']);return _0x43f67b(_0x2b6ee8[_0xdda2('0x29')][_0xdda2('0x2b')]);}else{logger[_0xdda2('0x23')](_0xdda2('0x24'),_0x1922b1,_0xdda2('0x25'));_0x43f67b(_0x2b6ee8['result'][_0xdda2('0x2b')]);}})[_0xdda2('0x2c')](function(_0x2391a5){logger[_0xdda2('0x29')]('ChatInteraction,\x20%s,\x20%s',_0x1922b1,_0x2391a5);_0x518c6d(_0x2391a5);});});}function respondWithStatusCode(_0x4e97dc,_0x28da54){_0x28da54=_0x28da54||0xcc;return function(_0x4567e7){if(_0x4567e7){return _0x4e97dc[_0xdda2('0x2d')](_0x28da54);}return _0x4e97dc['status'](_0x28da54)[_0xdda2('0x2e')]();};}function respondWithResult(_0x5d26ae,_0x2e755b){_0x2e755b=_0x2e755b||0xc8;return function(_0xe53dee){if(_0xe53dee){return _0x5d26ae[_0xdda2('0x2f')](_0x2e755b)[_0xdda2('0x30')](_0xe53dee);}};}function respondWithFilteredResult(_0x4bb8a4,_0x24c37d){return function(_0x255bbc){if(_0x255bbc){var _0x53acb5=typeof _0x24c37d[_0xdda2('0x31')]===_0xdda2('0x32')&&typeof _0x24c37d[_0xdda2('0x33')]===_0xdda2('0x32');var _0x5540e5=_0x255bbc[_0xdda2('0x34')];var _0x5e107f=_0x53acb5?0x0:_0x24c37d['offset'];var _0x1ca9f3=_0x53acb5?_0x255bbc['count']:_0x24c37d[_0xdda2('0x31')]+_0x24c37d['limit'];var _0x53ff76;if(_0x1ca9f3>=_0x5540e5){_0x1ca9f3=_0x5540e5;_0x53ff76=0xc8;}else{_0x53ff76=0xce;}_0x4bb8a4['status'](_0x53ff76);return _0x4bb8a4[_0xdda2('0x35')]('Content-Range',_0x5e107f+'-'+_0x1ca9f3+'/'+_0x5540e5)[_0xdda2('0x30')](_0x255bbc);}return null;};}function patchUpdates(_0x508664){return function(_0x5cba58){try{jsonpatch['apply'](_0x5cba58,_0x508664,!![]);}catch(_0x4637c1){return BPromise[_0xdda2('0x36')](_0x4637c1);}return _0x5cba58[_0xdda2('0x37')]();};}function saveUpdates(_0x2fd592,_0x12e96d){return function(_0x644a24){if(_0x644a24){return _0x644a24[_0xdda2('0x38')](_0x2fd592)[_0xdda2('0x22')](function(_0x3cddbd){return _0x3cddbd;});}return null;};}function removeEntity(_0x2bcf47,_0x4a32ea){return function(_0x461621){if(_0x461621){return _0x461621[_0xdda2('0x39')]()[_0xdda2('0x22')](function(){_0x2bcf47[_0xdda2('0x2f')](0xcc)[_0xdda2('0x2e')]();});}};}function handleEntityNotFound(_0x33c4b0,_0x45d3ad){return function(_0x5835cd){if(!_0x5835cd){_0x33c4b0['sendStatus'](0x194);}return _0x5835cd;};}function handleError(_0xa03f5,_0x1cf553){_0x1cf553=_0x1cf553||0x1f4;return function(_0x40eb19){logger['error'](_0x40eb19['stack']);if(_0x40eb19[_0xdda2('0x3a')]){delete _0x40eb19[_0xdda2('0x3a')];}_0xa03f5[_0xdda2('0x2f')](_0x1cf553)[_0xdda2('0x3b')](_0x40eb19);};}function getMustacheRender(_0x246001,_0x5ab419){return Mustache[_0xdda2('0x3c')](_0x246001,_[_0xdda2('0x3d')](_0x5ab419['body'],{'contact':_0x5ab419['contact'],'message':_0x5ab419[_0xdda2('0x2b')],'agent':_0x5ab419[_0xdda2('0x3e')],'interaction':_0x5ab419[_0xdda2('0x3f')],'account':_0x5ab419[_0xdda2('0x40')]}))||'';}function getInteractionUsers(_0x20969d,_0x585eba){return new BPromise(function(_0x2e7847,_0x226de2){try{if(_0x585eba[_0x20969d['id']]){_0x20969d[_0xdda2('0x41')]=_[_0xdda2('0x42')](_0x585eba[_0x20969d['id']],function(_0x50c4ae){return{'id':_0x50c4ae['id'],'fullname':_0x50c4ae['fullname']};});}}catch(_0x203972){_0x226de2(_0x203972);}_0x2e7847(_0x20969d);});}function getInteractionTags(_0x2e0524,_0x7a25fe){return new BPromise(function(_0x5a92e9,_0x1bb2a7){try{if(_0x2e0524['TagIds']){_0x2e0524[_0xdda2('0x43')]=[];_0x2e0524['TagIds'][_0xdda2('0x44')](',')[_0xdda2('0x45')](function(_0x1db762){_0x2e0524[_0xdda2('0x43')]['push'](_0x7a25fe[_0x1db762]);});}delete _0x2e0524[_0xdda2('0x46')];}catch(_0x574f8f){_0x1bb2a7(_0x574f8f);}_0x5a92e9(_0x2e0524);});}function updateChatInteraction(_0x392f70,_0x4d3b78,_0x1d1678){return new BPromise(function(_0x12589b,_0x153acf){return getInteractionUsers(_0x392f70,_0x1d1678)[_0xdda2('0x22')](function(_0x38dc03){return getInteractionTags(_0x38dc03,_0x4d3b78);})['then'](function(_0x1e29dc){_0x12589b(_0x1e29dc);})[_0xdda2('0x2c')](function(_0x54735b){_0x153acf(_0x54735b);});});}exports[_0xdda2('0x47')]=function(_0x546847,_0x292e70){var _0x45c802={},_0x1741a0={},_0x355b6a={'count':0x0,'rows':[]};var _0x3f1f9b=_[_0xdda2('0x42')](db[_0xdda2('0x48')][_0xdda2('0x49')],function(_0xff55){return{'name':_0xff55[_0xdda2('0x4a')],'type':_0xff55[_0xdda2('0x4b')][_0xdda2('0x4c')]};});_0x1741a0[_0xdda2('0x4d')]=_['map'](_0x3f1f9b,'name');_0x1741a0['query']=_[_0xdda2('0x4e')](_0x546847[_0xdda2('0x4f')]);_0x1741a0['filters']=_[_0xdda2('0x50')](_0x1741a0[_0xdda2('0x4d')],_0x1741a0[_0xdda2('0x4f')]);_0x45c802['attributes']=_[_0xdda2('0x50')](_0x1741a0[_0xdda2('0x4d')],qs['fields'](_0x546847['query'][_0xdda2('0x51')]));_0x45c802['attributes']=_0x45c802[_0xdda2('0x52')]['length']?_0x45c802[_0xdda2('0x52')]:_0x1741a0[_0xdda2('0x4d')];if(!_0x546847['query']['hasOwnProperty'](_0xdda2('0x53'))){_0x45c802[_0xdda2('0x33')]=qs[_0xdda2('0x33')](_0x546847[_0xdda2('0x4f')]['limit']);_0x45c802[_0xdda2('0x31')]=qs[_0xdda2('0x31')](_0x546847[_0xdda2('0x4f')][_0xdda2('0x31')]);}_0x45c802[_0xdda2('0x54')]=qs['sort'](_0x546847[_0xdda2('0x4f')][_0xdda2('0x55')]);_0x45c802['where']=qs[_0xdda2('0x56')](_[_0xdda2('0x57')](_0x546847[_0xdda2('0x4f')],_0x1741a0[_0xdda2('0x56')]),_0x3f1f9b);var _0x161d7b=[];var _0x265169=squel['select']()[_0xdda2('0x58')]('id')['field'](_0xdda2('0x3a'))['field'](_0xdda2('0x59'))['from'](_0xdda2('0x5a'));var _0x11c8b1=squel[_0xdda2('0x5b')]()[_0xdda2('0x58')](_0xdda2('0x5c'))[_0xdda2('0x58')](_0xdda2('0x5d'))[_0xdda2('0x58')]('ui.ChatInteractionId')[_0xdda2('0x5e')](_0xdda2('0x5f'),'ui')[_0xdda2('0x60')]('users','u',_0xdda2('0x61'));var _0x1c2d24=squel['select']()[_0xdda2('0x5e')]('chat_interactions','i')[_0xdda2('0x60')](_0xdda2('0x62'),'c',_0xdda2('0x63'))[_0xdda2('0x60')](_0xdda2('0x64'),'o','o.id\x20=\x20i.UserId')['left_join']('chat_websites','a',_0xdda2('0x65'))[_0xdda2('0x60')]('chat_messages','me',_0xdda2('0x66'))[_0xdda2('0x60')](_0xdda2('0x67'),'it','it.ChatInteractionId\x20=\x20i.id')[_0xdda2('0x60')](_0xdda2('0x5a'),'t',_0xdda2('0x68'));var _0x58ae15=squel[_0xdda2('0x69')]();var _0x4495e5=[];var _0x7eb83f=squel[_0xdda2('0x69')]();var _0x5d8602;if(_0x546847[_0xdda2('0x4f')]['search']){_0x5d8602=as['parseSearch'](_0x546847['query'][_0xdda2('0x6a')]);var _0x35b38a=_0x5d8602[_0xdda2('0x6b')];for(var _0x433cb0=0x0;_0x433cb0<_0x5d8602[_0xdda2('0x6c')][_0xdda2('0x6d')];_0x433cb0++){var _0x29a739=_0x5d8602[_0xdda2('0x6c')][_0x433cb0];var _0x269ad1='i';var _0x138c2f=_[_0xdda2('0x6e')](_0x3f1f9b,['name',_0x29a739[_0xdda2('0x58')]]);if(!_0x138c2f){switch(_0x29a739[_0xdda2('0x58')]){case _0xdda2('0x6f'):if(_0x29a739[_0xdda2('0x70')]==0x1){_0x1c2d24[_0xdda2('0x71')]('`'+_0x29a739[_0xdda2('0x58')]+_0xdda2('0x72'));}else{_0x1c2d24['having']('`'+_0x29a739[_0xdda2('0x58')]+_0xdda2('0x73'));}break;case _0xdda2('0x74'):if(_0x29a739[_0xdda2('0x75')]===_0xdda2('0x76')){if(_0x29a739['value'][_0xdda2('0x44')]('\x20')[_0xdda2('0x6d')]>0x1){_0x58ae15[_0x35b38a](_0xdda2('0x77'),qs[_0xdda2('0x78')](_0x29a739[_0xdda2('0x70')]),null);}else{var _0x4a6f28='%'+_0x29a739[_0xdda2('0x70')]+'%';_0x58ae15[_0x35b38a](_0xdda2('0x79'),_0x4a6f28,_0x4a6f28,_0x4a6f28);}}else{_0x138c2f=_[_0xdda2('0x6e')](_0x3f1f9b,[_0xdda2('0x3a'),_0xdda2('0x7a')]);_0x29a739['field']=_0xdda2('0x7a');_0x27780e=as[_0xdda2('0x7b')](_0x269ad1,_0x138c2f[_0xdda2('0x4b')],_0x29a739);_0x58ae15[_0x35b38a](_0x27780e['text'],_0x27780e[_0xdda2('0x70')]['start'],_0x27780e[_0xdda2('0x70')][_0xdda2('0x2e')]);}break;case _0xdda2('0x7c'):var _0x5c351c=_0x29a739[_0xdda2('0x70')][_0xdda2('0x44')](',')['map'](function(_0x13c0d9){return Number(_0x13c0d9);});_0x5c351c['forEach'](function(_0x3d645b){_0x7eb83f['or'](_0xdda2('0x7d'),'%,'+_0x3d645b+',%');});_0x4495e5=_[_0xdda2('0x7e')](_0x4495e5,_0x5c351c);break;case _0xdda2('0x7f'):if(_0x29a739[_0xdda2('0x75')]==='$substring'){_0x58ae15[_0x35b38a]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x29a739[_0xdda2('0x70')]+'%',null);}else{_0x138c2f=_[_0xdda2('0x6e')](_0x3f1f9b,['name','UserId']);_0x29a739[_0xdda2('0x58')]='UserId';_0x27780e=as[_0xdda2('0x7b')](_0x269ad1,_0x138c2f[_0xdda2('0x4b')],_0x29a739);_0x58ae15[_0x35b38a](_0x27780e['text'],_0x27780e[_0xdda2('0x70')][_0xdda2('0x80')],_0x27780e[_0xdda2('0x70')][_0xdda2('0x2e')]);}break;case _0xdda2('0x81'):_0x27780e=as[_0xdda2('0x7b')]('me',null,_0x29a739);_0x58ae15[_0x35b38a](_0x27780e['text'],_0x27780e[_0xdda2('0x70')][_0xdda2('0x80')],_0x27780e[_0xdda2('0x70')]['end']);break;}}else{var _0x27780e=as[_0xdda2('0x7b')](_0x269ad1,_0x138c2f['type'],_0x29a739);_0x58ae15[_0x35b38a](_0x27780e['text'],_0x27780e[_0xdda2('0x70')][_0xdda2('0x80')],_0x27780e[_0xdda2('0x70')]['end']);}}}else{var _0x585a72=_(_0x546847[_0xdda2('0x4f')])['keys']()[_0xdda2('0x42')](function(_0x150dcd){return _[_0xdda2('0x82')](_0x3f1f9b,[_0xdda2('0x3a'),_0x150dcd])?_0x150dcd:undefined;})[_0xdda2('0x83')]()[_0xdda2('0x70')]();if(!_['isEmpty'](_0x585a72)){_0x585a72['forEach'](function(_0x218b96){if(_0x218b96==='ChatWebsiteId'){_0x1c2d24[_0xdda2('0x84')](_0xdda2('0x85'),[][_0xdda2('0x86')](_0x546847[_0xdda2('0x4f')][_0x218b96]));}else if(_0x218b96===_0xdda2('0x87')){var _0x104024=JSON[_0xdda2('0x88')](_0x546847[_0xdda2('0x4f')][_0x218b96])[_0xdda2('0x89')];var _0x495a28=JSON[_0xdda2('0x88')](_0x546847[_0xdda2('0x4f')][_0x218b96])[_0xdda2('0x8a')];_0x1c2d24[_0xdda2('0x84')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x104024,_0x495a28);}else{if(_0x546847[_0xdda2('0x4f')][_0x218b96]===_0xdda2('0x8b')){_0x1c2d24[_0xdda2('0x84')]('i.'+_0x218b96+_0xdda2('0x8c'));}else{_0x1c2d24['where']('i.'+_0x218b96+'\x20=\x20?',_0x546847[_0xdda2('0x4f')][_0x218b96]);}}});}if(_0x546847[_0xdda2('0x4f')][_0xdda2('0x8d')]){if(_0x546847[_0xdda2('0x4f')]['read']==0x1){_0x1c2d24[_0xdda2('0x71')](_0xdda2('0x8e'));}else{_0x1c2d24[_0xdda2('0x71')](_0xdda2('0x8f'));}}if(_0x546847[_0xdda2('0x4f')][_0xdda2('0x90')]){_0x4495e5=_[_0xdda2('0x91')](_0x546847[_0xdda2('0x4f')][_0xdda2('0x90')])?_0x546847[_0xdda2('0x4f')][_0xdda2('0x90')]:new Array(_0x546847[_0xdda2('0x4f')][_0xdda2('0x90')]);_0x4495e5[_0xdda2('0x45')](function(_0x2411e8){_0x7eb83f['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x2411e8+',%');});}if(_0x546847[_0xdda2('0x4f')][_0xdda2('0x92')]){var _0x58fcea=_0x546847['query'][_0xdda2('0x92')][_0xdda2('0x93')]('\x5c','\x5c\x5c')[_0xdda2('0x93')](/'/g,'\x27\x27');if(qs[_0xdda2('0x94')](_0x58fcea)){_0x58ae15['or'](_0xdda2('0x95'),_0x58fcea+'%');}else{_0x58ae15['or'](_0xdda2('0x96'),qs['getFullTextValue'](_0x58fcea))['or'](_0xdda2('0x97'),_0x58fcea+'%');}}}_0x1c2d24[_0xdda2('0x84')](_0x58ae15);_0x1c2d24[_0xdda2('0x98')](_0xdda2('0x99'));var _0x563be8={'type':db[_0xdda2('0x9a')]['QueryTypes'][_0xdda2('0x9b')],'raw':!![]};var _0x6b6dad=_0x1c2d24['clone']();_0x6b6dad[_0xdda2('0x58')](_0xdda2('0x99'));_0x6b6dad[_0xdda2('0x58')](_0xdda2('0x9c'),_0xdda2('0x6f'));if(_0x45c802[_0xdda2('0x54')]){_0x45c802[_0xdda2('0x54')][_0xdda2('0x45')](function(_0x3a375d){var _0x3e82bb=_0x3a375d[0x0]===_0xdda2('0x9d')?_0x3a375d[0x0]:'i.'+_0x3a375d[0x0];_0x1c2d24['order'](_0x3e82bb,_0x3a375d[0x1]===_0xdda2('0x9e')?![]:!![]);});}if(!_[_0xdda2('0x9f')](_0x4495e5)){_0x1c2d24[_0xdda2('0x71')](_0x7eb83f);_0x6b6dad[_0xdda2('0x84')](_0xdda2('0xa0'),_0x4495e5);}BPromise['resolve']()[_0xdda2('0x22')](function(){if(!_0x5d8602){if(_0x546847[_0xdda2('0x4f')]['ChatWebsiteId'])return;_0x6b6dad[_0xdda2('0x84')](_0xdda2('0xa1'));_0x1c2d24['where']('i.ChatWebsiteId\x20IS\x20NOT\x20NULL');return;}if(_0x546847[_0xdda2('0xa2')][_0xdda2('0xa3')]!==_0xdda2('0x3e'))return;return _0x546847[_0xdda2('0xa2')][_0xdda2('0xa4')]({'attributes':['id'],'raw':!![]})[_0xdda2('0x22')](function(_0x525e93){if(_[_0xdda2('0x9f')](_0x525e93)){_0x6b6dad[_0xdda2('0x84')]('i.ChatWebsiteId\x20IS\x20NULL');_0x1c2d24[_0xdda2('0x84')](_0xdda2('0xa5'));}else{_0x6b6dad['where'](_0xdda2('0x85'),_[_0xdda2('0x42')](_0x525e93,'id'));_0x1c2d24[_0xdda2('0x84')]('i.ChatWebsiteId\x20IN\x20?',_[_0xdda2('0x42')](_0x525e93,'id'));}});})['then'](function(){if(_0x546847[_0xdda2('0xa2')][_0xdda2('0xa3')]===_0xdda2('0x3e')&&!_0x5d8602&&!_0x546847[_0xdda2('0x4f')]['ChatWebsiteId'])return[];return db['sequelize'][_0xdda2('0x4f')](_0x6b6dad[_0xdda2('0xa6')](),_0x563be8);})['then'](function(_0x468e32){_0x355b6a[_0xdda2('0x34')]=_0x468e32[_0xdda2('0x6d')];if(_0x355b6a[_0xdda2('0x34')]===0x0)return[];return db[_0xdda2('0xa7')][_0xdda2('0x4f')](_0x265169[_0xdda2('0xa6')](),_0x563be8)[_0xdda2('0x22')](function(_0x3046c1){_0x161d7b=_[_0xdda2('0xa8')](_0x3046c1,'id');_0x563be8=_[_0xdda2('0x3d')](_0x563be8,{'model':db[_0xdda2('0x48')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x546847['query']['fields']){_0x45c802['attributes'][_0xdda2('0x45')](function(_0x4edf20){_0x1c2d24[_0xdda2('0x58')]('i.'+_0x4edf20);});}else{_0x1c2d24[_0xdda2('0x58')](_0xdda2('0x9c'),_0xdda2('0x6f'));_0x1c2d24['field'](_0xdda2('0xa9'),_0xdda2('0xaa'));_0x1c2d24[_0xdda2('0x58')]('a.mandatoryDisposition',_0xdda2('0xab'));_0x1c2d24[_0xdda2('0x58')](_0xdda2('0xac'),'contactName');_0x1c2d24['field'](_0xdda2('0xad'));_0x1c2d24[_0xdda2('0x58')](_0xdda2('0xae'),'Contact.firstName');_0x1c2d24[_0xdda2('0x58')](_0xdda2('0xaf'),_0xdda2('0xb0'));_0x1c2d24[_0xdda2('0x58')](_0xdda2('0xb1'),_0xdda2('0xb2'));_0x1c2d24[_0xdda2('0x58')]('c.phone',_0xdda2('0xb3'));_0x1c2d24[_0xdda2('0x58')](_0xdda2('0xb4'),_0xdda2('0xb5'));_0x1c2d24['field'](_0xdda2('0xb6'),_0xdda2('0xb7'));_0x1c2d24[_0xdda2('0x58')](_0xdda2('0xb8'),'Owner.fullname');_0x1c2d24['field']('o.internal',_0xdda2('0xb9'));_0x1c2d24[_0xdda2('0x58')](_0xdda2('0xba'),_0xdda2('0x46'));}if(_0x45c802[_0xdda2('0x33')])_0x1c2d24[_0xdda2('0x33')](_0x45c802['limit']);if(_0x45c802[_0xdda2('0x31')])_0x1c2d24[_0xdda2('0x31')](_0x45c802[_0xdda2('0x31')]);return db[_0xdda2('0xa7')][_0xdda2('0x4f')](_0x1c2d24[_0xdda2('0xa6')](),_0x563be8);})[_0xdda2('0x22')](function(_0xbfd011){if(_0xbfd011['length']>0x0)_0x11c8b1[_0xdda2('0x84')]('ui.ChatInteractionId\x20IN\x20?',_[_0xdda2('0x42')](_0xbfd011,'id'));return db['sequelize'][_0xdda2('0x4f')](_0x11c8b1['toString'](),_0x563be8)[_0xdda2('0x22')](function(_0x31e555){var _0x329d18=_[_0xdda2('0xbb')](_0x31e555,_0xdda2('0xbc'));var _0x18a102=[];_0xbfd011[_0xdda2('0x45')](function(_0x28ba40){_0x18a102[_0xdda2('0xbd')](updateChatInteraction(_0x28ba40,_0x161d7b,_0x329d18));});return BPromise['all'](_0x18a102);});});})[_0xdda2('0x22')](function(_0x434d79){_0x355b6a['rows']=_0x434d79;return _0x355b6a;})[_0xdda2('0x22')](respondWithFilteredResult(_0x292e70,_0x45c802))[_0xdda2('0x2c')](handleError(_0x292e70,null));};exports[_0xdda2('0xbe')]=function(_0x5600da,_0x1702ae){var _0x21ade3={'raw':![],'where':{'id':_0x5600da[_0xdda2('0xbf')]['id']}},_0x251408={};_0x251408[_0xdda2('0x4d')]=_[_0xdda2('0x4e')](db[_0xdda2('0x48')][_0xdda2('0x49')]);_0x251408[_0xdda2('0x4f')]=_[_0xdda2('0x4e')](_0x5600da['query']);_0x251408[_0xdda2('0x56')]=_[_0xdda2('0x50')](_0x251408[_0xdda2('0x4d')],_0x251408[_0xdda2('0x4f')]);_0x21ade3[_0xdda2('0x52')]=_['intersection'](_0x251408[_0xdda2('0x4d')],qs[_0xdda2('0x51')](_0x5600da[_0xdda2('0x4f')]['fields']));_0x21ade3[_0xdda2('0x52')]=_0x21ade3[_0xdda2('0x52')][_0xdda2('0x6d')]?_0x21ade3['attributes']:_0x251408[_0xdda2('0x4d')];if(_0x5600da['query']['includeAll']){_0x21ade3[_0xdda2('0xc0')]=[{'all':!![]}];}_0x21ade3=_[_0xdda2('0x3d')]({},_0x21ade3,_0x5600da[_0xdda2('0xc1')]);return db[_0xdda2('0x48')][_0xdda2('0x6e')](_0x21ade3)[_0xdda2('0x22')](handleEntityNotFound(_0x1702ae,null))[_0xdda2('0x22')](respondWithResult(_0x1702ae,null))['catch'](handleError(_0x1702ae,null));};exports['create']=function(_0x3aab39,_0x1c1cf6){return db[_0xdda2('0x48')][_0xdda2('0xc2')](_0x3aab39[_0xdda2('0x81')],{})['then'](respondWithResult(_0x1c1cf6,0xc9))[_0xdda2('0x2c')](handleError(_0x1c1cf6,null));};exports[_0xdda2('0x38')]=function(_0x489cda,_0x233494){if(_0x489cda[_0xdda2('0x81')]['id']){delete _0x489cda[_0xdda2('0x81')]['id'];}return db[_0xdda2('0x48')][_0xdda2('0x6e')]({'where':{'id':_0x489cda[_0xdda2('0xbf')]['id']}})[_0xdda2('0x22')](handleEntityNotFound(_0x233494,null))[_0xdda2('0x22')](saveUpdates(_0x489cda[_0xdda2('0x81')],null))[_0xdda2('0x22')](respondWithResult(_0x233494,null))[_0xdda2('0x2c')](handleError(_0x233494,null));};exports[_0xdda2('0x39')]=function(_0x416993,_0x47b7a5){return db[_0xdda2('0x48')]['find']({'where':{'id':_0x416993[_0xdda2('0xbf')]['id']}})[_0xdda2('0x22')](handleEntityNotFound(_0x47b7a5,null))[_0xdda2('0x22')](removeEntity(_0x47b7a5,null))['catch'](handleError(_0x47b7a5,null));};exports[_0xdda2('0xc3')]=function(_0xb93d3b,_0x3d59cb){return db['ChatInteraction'][_0xdda2('0xc3')]()[_0xdda2('0x22')](respondWithResult(_0x3d59cb,null))[_0xdda2('0x2c')](handleError(_0x3d59cb,null));};exports['createVidaooSession']=function(_0x5916cb,_0x123065){var _0x5611a0=_0x5916cb[_0xdda2('0xbf')]['id'];var _0x174eb9;var _0x23b9bd;var _0x182570;return db['ChatInteraction'][_0xdda2('0xc4')]({'where':{'id':_0x5611a0}})['then'](function(_0x5a1e60){_0x174eb9=_0x5a1e60;return db['ChatWebsite']['findOne']({'where':{'id':_0x5a1e60[_0xdda2('0xc5')]},'attributes':['id','vidaooApiKey',_0xdda2('0xc6'),_0xdda2('0xc7'),'vidaooNote','vidaooMetadata'],'raw':!![]});})[_0xdda2('0x22')](function(_0x255853){if(_0x255853&&_0x255853[_0xdda2('0xc8')]&&_0x255853[_0xdda2('0xc6')]){_0x23b9bd=_0x255853;var _0x55d25d={'interaction':{'id':_0x5611a0},'agent':{'id':_0x5916cb['user']['id'],'name':_0x5916cb[_0xdda2('0xa2')][_0xdda2('0x3a')],'fullname':_0x5916cb[_0xdda2('0xa2')][_0xdda2('0xc9')],'email':_0x5916cb['user'][_0xdda2('0xca')]},'contact':_0x5916cb[_0xdda2('0x81')][_0xdda2('0xcb')],'account':_0x5916cb[_0xdda2('0x81')][_0xdda2('0x40')]};var _0x1fdc68={'rejectUnauthorized':![],'method':_0xdda2('0xcc'),'url':_0xdda2('0xcd'),'headers':{'X-APIKEY':_0x255853[_0xdda2('0xc8')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x5916cb[_0xdda2('0xa2')][_0xdda2('0xca')]],'buttons':null,'topic':_0x23b9bd[_0xdda2('0xc7')],'note':_[_0xdda2('0xce')](_0x23b9bd[_0xdda2('0xcf')])?null:getMustacheRender(_0x23b9bd[_0xdda2('0xcf')],_0x55d25d),'metadata':null},'redirect':_0xdda2('0xd0'),'json':!![]};try{if(!_['isNull'](_0x23b9bd[_0xdda2('0xd1')])){var _0x1e5460=getMustacheRender(_0x23b9bd[_0xdda2('0xd1')],_0x55d25d);var _0xa386d1=JSON[_0xdda2('0x88')](_0x1e5460);_0x1fdc68[_0xdda2('0x81')][_0xdda2('0xd2')]=_0xa386d1;}}catch(_0x1945bc){throw new db[(_0xdda2('0x9a'))][(_0xdda2('0xd3'))](_0xdda2('0xd4'));}return rp(_0x1fdc68);}else{throw new db[(_0xdda2('0x9a'))][(_0xdda2('0xd3'))](_0xdda2('0xd5'));}})[_0xdda2('0x22')](function(_0x5308f1){_0x182570=_0x5308f1;if(_0x182570['id']){var _0x17c084={'body':_0x182570[_0xdda2('0xd6')],'ChatWebsiteId':_0x23b9bd['id'],'ChatInteractionId':_0x174eb9['id'],'direction':_0xdda2('0xd7'),'UserId':_0x5916cb[_0xdda2('0xa2')]['id']};return db[_0xdda2('0xd8')][_0xdda2('0xc2')](_0x17c084,{});}else{throw new db[(_0xdda2('0x9a'))][(_0xdda2('0xd3'))](_0xdda2('0xd9'));}})[_0xdda2('0x22')](function(){return _0x174eb9['updateAttributes']({'vidaooSessionId':_0x182570['id']});})[_0xdda2('0x22')](respondWithResult(_0x123065,null))['catch'](handleError(_0x123065,null));};exports['customUpdate']=function(_0xfd249a,_0x142e6a){if(_0xfd249a[_0xdda2('0x81')]['id']){delete _0xfd249a[_0xdda2('0x81')]['id'];}return db[_0xdda2('0x48')]['find']({'where':{'id':_0xfd249a[_0xdda2('0xbf')]['id']},'include':[{'model':db[_0xdda2('0xda')],'as':_0xdda2('0x74')}]})[_0xdda2('0x22')](handleEntityNotFound(_0x142e6a,null))[_0xdda2('0x22')](saveUpdates(_0xfd249a[_0xdda2('0x81')],null))[_0xdda2('0x22')](respondWithResult(_0x142e6a,null))[_0xdda2('0x2c')](handleError(_0x142e6a,null));};exports['abandon']=function(_0x5738f9,_0x3795b2,_0x38902f){if(_0x5738f9[_0xdda2('0x81')]['id']){delete _0x5738f9['body']['id'];}return db['ChatInteraction']['find']({'where':{'id':_0x5738f9[_0xdda2('0xbf')]['id']}})[_0xdda2('0x22')](function(_0x253ca6){if(!_0x253ca6){logger[_0xdda2('0x29')]('abandonInteraction,\x20%s,\x20%s,\x20%s',_0xdda2('0xdb'),0x194,'entity\x20not\x20found');_0x3795b2[_0xdda2('0x2d')](0x194);}else{if(_0x253ca6['UserId']){throw new db[(_0xdda2('0x9a'))][(_0xdda2('0xd3'))](_0xdda2('0xdc'));}}return _0x253ca6;})['then'](function(_0x335dc1){if(_0x335dc1){return _0x335dc1[_0xdda2('0x38')]({'closed':_0x5738f9[_0xdda2('0x81')]['closed'],'disposition':_0x5738f9[_0xdda2('0x81')][_0xdda2('0xdd')]})['then'](function(_0x1ec330){return _0x1ec330;});}})[_0xdda2('0x22')](function(_0x48e6e6){return respondWithRpcPromise('AbandonInteraction','abandon',_0x5738f9[_0xdda2('0x81')],client9004);})['then'](respondWithResult(_0x3795b2,null))['catch'](handleError(_0x3795b2,null));};exports[_0xdda2('0xde')]=function(_0x4444b4,_0x2279f8,_0x40e6a9){_0x4444b4[_0xdda2('0x81')][_0xdda2('0x3a')]=_0x4444b4['file']['originalname'];_0x4444b4[_0xdda2('0x81')]['basename']=_0x4444b4[_0xdda2('0xdf')][_0xdda2('0xe0')];_0x4444b4[_0xdda2('0x81')][_0xdda2('0x4b')]=_0x4444b4[_0xdda2('0xdf')][_0xdda2('0xe1')];return db['Attachment'][_0xdda2('0xc2')](_0x4444b4['body'])[_0xdda2('0x22')](respondWithResult(_0x2279f8,0xc9))[_0xdda2('0x2c')](handleError(_0x2279f8,null));};exports[_0xdda2('0xe2')]=function(_0x245ab5,_0x1001ce,_0x343795){return db[_0xdda2('0x48')][_0xdda2('0xc4')]({'where':{'id':_0x245ab5[_0xdda2('0xbf')]['id']},'raw':!![]})[_0xdda2('0x22')](handleEntityNotFound(_0x1001ce,null))[_0xdda2('0x22')](function(_0x3fb6a2){if(_0x3fb6a2){if(_0x3fb6a2[_0xdda2('0xe3')]){return _0x1001ce[_0xdda2('0x2f')](0x193)[_0xdda2('0x30')]({'status':0x193,'message':_0xdda2('0xe4')});}return db['Attachment'][_0xdda2('0xc4')]({'where':{'id':_0x245ab5[_0xdda2('0x4f')][_0xdda2('0xe5')]},'raw':!![]})[_0xdda2('0x22')](handleEntityNotFound(_0x1001ce,null));}})[_0xdda2('0x22')](function(_0xb42ead){if(_0xb42ead){var _0x29aa4e=_0xb42ead[_0xdda2('0xe6')]!==null;var _0xb38883=path[_0xdda2('0xe7')](config['root'],'server/files/attachments/');if(_0x29aa4e){_0xb38883=path['join'](_0xb38883,_0xdda2('0xe8'));}var _0x447793=path['join'](_0xb38883,_0xb42ead[_0xdda2('0xe9')]);return _0x1001ce[_0xdda2('0xea')](_0x447793);}})[_0xdda2('0x2c')](handleError(_0x1001ce,null));};exports[_0xdda2('0xeb')]=function(_0x105176,_0x1b4d6c){var _0x4aecf6=null;var _0x11d373=null;var _0x5898cf=null;var _0x319929=null;if(_0x105176[_0xdda2('0x81')]['id']){delete _0x105176[_0xdda2('0x81')]['id'];}if(_0x105176['body'][_0xdda2('0xec')]){_0x319929=path[_0xdda2('0xe7')](config[_0xdda2('0xed')],_0xdda2('0xee'),util['format'](_0xdda2('0xef'),Date[_0xdda2('0xf0')]()));_0x105176[_0xdda2('0x81')][_0xdda2('0xf1')]=_0x319929;}return db[_0xdda2('0x48')]['find']({'where':{'id':_0x105176[_0xdda2('0xbf')]['id']},'include':[{'model':db['ChatMessage'],'as':_0xdda2('0xf2'),'include':[{'model':db[_0xdda2('0x7f')],'as':_0xdda2('0x7f')}]}]})['then'](handleEntityNotFound(_0x1b4d6c,null))[_0xdda2('0x22')](saveUpdates(_0x105176[_0xdda2('0x81')],null))[_0xdda2('0x22')](function(_0x1894fc){if(_0x1894fc){_0x4aecf6=_0x1894fc;return db[_0xdda2('0xf3')][_0xdda2('0x6e')]({'where':{'id':_0x4aecf6[_0xdda2('0xc5')]}});}})[_0xdda2('0x22')](function(_0x469635){if(_0x469635){_0x5898cf=_0x469635;return db[_0xdda2('0xda')][_0xdda2('0x6e')]({'where':{'id':_0x4aecf6[_0xdda2('0x7a')]}});}})[_0xdda2('0x22')](function(_0x1d2039){if(_0x1d2039){_0x11d373=_0x1d2039;if(_0x319929){var _0xee0164=null;for(var _0x58fa2a=0x1;_0x58fa2a<_0x4aecf6[_0xdda2('0xf2')]['length'];++_0x58fa2a){_0xee0164=_0x4aecf6[_0xdda2('0xf2')][_0x58fa2a];var _0xbe4ca=_0xee0164['UserId']?util[_0xdda2('0xf4')](_0xdda2('0xf5'),_0x5898cf[_0xdda2('0xf6')],_0xee0164['UserId']):'System';var _0x5c88b4=_0x105176[_0xdda2('0x81')][_0xdda2('0xf7')]||util[_0xdda2('0xf4')]('%s%d',_0xdda2('0xf8'),_0xee0164[_0xdda2('0x7a')]);switch(_0x5898cf['agentIdentifier']){case _0xdda2('0xf9'):_0xbe4ca=_0xee0164[_0xdda2('0xfa')]?util[_0xdda2('0xf4')]('%s%d',_0x5898cf[_0xdda2('0xf6')],_0xee0164[_0xdda2('0xfa')]):_0xdda2('0xfb');break;case _0xdda2('0xfc'):_0xbe4ca=_0xee0164[_0xdda2('0xfa')]?_0xee0164['User'][_0xdda2('0xfd')]||_0xee0164['User'][_0xdda2('0xc9')]:_0xdda2('0xfb');break;case _0xdda2('0xfe'):_0xbe4ca=_0xee0164['UserId']?_0xee0164['User'][_0xdda2('0xc9')]:_0xdda2('0xfb');break;default:_0xbe4ca=_0xee0164[_0xdda2('0xfa')]?util[_0xdda2('0xf4')](_0xdda2('0xf5'),_0x5898cf[_0xdda2('0xf6')],_0xee0164[_0xdda2('0xfa')]):'System';}var _0x2506bb=util[_0xdda2('0xf4')]('[%s]\x20%s:\x20%s\x0a',moment(_0xee0164[_0xdda2('0x87')])[_0xdda2('0xf4')](_0xdda2('0xff')),_0xee0164[_0xdda2('0x100')]==='in'?_0x5c88b4:_0xbe4ca,_0xee0164[_0xdda2('0x81')]);if(!_0xee0164['secret']){fs[_0xdda2('0x101')](_0x319929,_0x2506bb);}}return db[_0xdda2('0x102')][_0xdda2('0xc4')]({'where':{'service':!![]},'include':[{'model':db[_0xdda2('0x103')],'as':_0xdda2('0x104'),'raw':!![]}]});}}})['then'](function(_0x4dcc77){if(_0x4dcc77&&_0x4dcc77[_0xdda2('0x104')]&&_0x105176[_0xdda2('0x81')]){var _0xbcc6b9={'tls':{'rejectUnauthorized':![]}};if(_0x4dcc77[_0xdda2('0x104')]['service']){_0xbcc6b9['service']=_0x4dcc77[_0xdda2('0x104')][_0xdda2('0x105')];}else{_0xbcc6b9[_0xdda2('0x106')]=_0x4dcc77[_0xdda2('0x104')][_0xdda2('0x106')];_0xbcc6b9[_0xdda2('0x107')]=_0x4dcc77[_0xdda2('0x104')]['port'];_0xbcc6b9['secure']=_0x4dcc77[_0xdda2('0x104')][_0xdda2('0x108')];}if(_0x4dcc77['Smtp'][_0xdda2('0x109')]){_0xbcc6b9[_0xdda2('0x10a')]={'user':_0x4dcc77[_0xdda2('0x104')][_0xdda2('0xa2')],'pass':_0x4dcc77['Smtp'][_0xdda2('0x10b')]};}return respondWithRpcPromise(_0xdda2('0x10c'),_0xdda2('0x10d'),{'account':_0xbcc6b9,'message':{'from':util[_0xdda2('0xf4')]('\x22%s\x22\x20<%s>',_0x4dcc77[_0xdda2('0x3a')],_0x4dcc77['email']||_0x4dcc77['Smtp']['user']),'to':_0x105176[_0xdda2('0x81')][_0xdda2('0xec')],'subject':_0xdda2('0x10e'),'text':util[_0xdda2('0xf4')](_0xdda2('0x10f'),_0x105176['body'][_0xdda2('0xec')]),'attachments':[{'path':_0x319929}]}})[_0xdda2('0x22')](function(){return _0x4aecf6;})['catch'](function(_0x202a23){console[_0xdda2('0x29')](_0x202a23);});}else{return _0x4aecf6;}})[_0xdda2('0x22')](respondWithStatusCode(_0x1b4d6c,0xc8))[_0xdda2('0x2c')](handleError(_0x1b4d6c,null));};exports[_0xdda2('0x110')]=function(_0x12a7f4,_0x62b26e,_0x642b33){return db['ChatMessage']['find']({'where':{'id':_0x12a7f4[_0xdda2('0xbf')]['id']}})[_0xdda2('0x22')](handleEntityNotFound(_0x62b26e,null))[_0xdda2('0x22')](function(_0x2139ff){if(_0x2139ff){return _0x2139ff[_0xdda2('0x110')](_0x12a7f4[_0xdda2('0x81')][_0xdda2('0x111')],_[_0xdda2('0x112')](_0x12a7f4[_0xdda2('0x81')],[_0xdda2('0x111'),'id'])||{});}})[_0xdda2('0x22')](respondWithResult(_0x62b26e,null))['catch'](handleError(_0x62b26e,null));};exports[_0xdda2('0x113')]=function(_0x3da9e4,_0x5fa59e,_0x6280b0){var _0x228f40={'raw':![],'where':{}};var _0x27ff5d={};var _0x325be9={'count':0x0,'rows':[]};return db['ChatInteraction'][_0xdda2('0xc4')]({'where':{'id':_0x3da9e4[_0xdda2('0xbf')]['id']}})[_0xdda2('0x22')](handleEntityNotFound(_0x5fa59e,null))[_0xdda2('0x22')](function(_0x11db0f){if(_0x11db0f){_0x27ff5d['model']=_[_0xdda2('0x4e')](db[_0xdda2('0xd8')][_0xdda2('0x49')]);_0x27ff5d[_0xdda2('0x4f')]=_[_0xdda2('0x4e')](_0x3da9e4['query']);_0x27ff5d[_0xdda2('0x56')]=_['intersection'](_0x27ff5d['model'],_0x27ff5d[_0xdda2('0x4f')]);_0x228f40['attributes']=_[_0xdda2('0x50')](_0x27ff5d[_0xdda2('0x4d')],qs[_0xdda2('0x51')](_0x3da9e4[_0xdda2('0x4f')][_0xdda2('0x51')]));_0x228f40[_0xdda2('0x52')]=_0x228f40[_0xdda2('0x52')][_0xdda2('0x6d')]?_0x228f40[_0xdda2('0x52')]:_0x27ff5d[_0xdda2('0x4d')];if(!_0x3da9e4[_0xdda2('0x4f')][_0xdda2('0x114')](_0xdda2('0x53'))){_0x228f40[_0xdda2('0x33')]=qs[_0xdda2('0x33')](_0x3da9e4[_0xdda2('0x4f')]['limit']);_0x228f40['offset']=qs[_0xdda2('0x31')](_0x3da9e4[_0xdda2('0x4f')]['offset']);}_0x228f40[_0xdda2('0x54')]=qs[_0xdda2('0x55')](_0x3da9e4[_0xdda2('0x4f')]['sort']);_0x228f40['where']=qs[_0xdda2('0x56')](_[_0xdda2('0x57')](_0x3da9e4['query'],_0x27ff5d[_0xdda2('0x56')]));_0x228f40[_0xdda2('0x84')][_0xdda2('0xbc')]=_0x11db0f['id'];if(_0x3da9e4[_0xdda2('0x4f')][_0xdda2('0x92')]){_0x228f40[_0xdda2('0x84')]=_[_0xdda2('0x3d')](_0x228f40[_0xdda2('0x84')],{'$or':_[_0xdda2('0x42')](_0x228f40[_0xdda2('0x52')],function(_0x39a334){var _0xeedb00={};_0xeedb00[_0x39a334]={'$like':'%'+_0x3da9e4['query'][_0xdda2('0x92')]+'%'};return _0xeedb00;})});}if(_0x3da9e4['query']['$gte']){var _0x27765b=_0x3da9e4[_0xdda2('0x4f')][_0xdda2('0x89')][_0xdda2('0x44')](',');var _0x4d288d={};_0x4d288d[_0x27765b[0x0]]={'$gte':moment(_0x27765b[0x1])[_0xdda2('0xf4')](_0xdda2('0x115'))};_0x228f40[_0xdda2('0x84')]=_[_0xdda2('0x3d')](_0x228f40['where'],_0x4d288d);}_0x228f40=_['merge']({},_0x228f40,_0x3da9e4[_0xdda2('0xc1')]);return db[_0xdda2('0xd8')][_0xdda2('0x34')]({'where':_0x228f40[_0xdda2('0x84')]})[_0xdda2('0x22')](function(_0x1f8f48){_0x325be9[_0xdda2('0x34')]=_0x1f8f48;if(_0x3da9e4[_0xdda2('0x4f')][_0xdda2('0x116')]){_0x228f40[_0xdda2('0xc0')]=[{'all':!![]}];}return db[_0xdda2('0xd8')]['findAll'](_0x228f40);})[_0xdda2('0x22')](function(_0x4dbada){_0x325be9[_0xdda2('0x117')]=_0x4dbada;return _0x325be9;});}})['then'](respondWithFilteredResult(_0x5fa59e,_0x228f40))[_0xdda2('0x2c')](handleError(_0x5fa59e,null));};exports[_0xdda2('0x118')]=function(_0x25650a,_0x3410ec,_0x59441d){var _0x4948ae={'where':{}},_0x472860={},_0x32564c={'count':0x0,'rows':[]};return db[_0xdda2('0x48')][_0xdda2('0xc4')]({'where':{'id':_0x25650a['params']['id']}})[_0xdda2('0x22')](handleEntityNotFound(_0x3410ec,null))[_0xdda2('0x22')](function(_0x316316){if(_0x316316){_0x472860[_0xdda2('0x4d')]=_[_0xdda2('0x4e')](db[_0xdda2('0xd8')][_0xdda2('0x49')]);_0x472860[_0xdda2('0x4f')]=_[_0xdda2('0x4e')](_0x25650a[_0xdda2('0x4f')]);_0x472860[_0xdda2('0x56')]=_[_0xdda2('0x50')](_0x472860[_0xdda2('0x4d')],_0x472860[_0xdda2('0x4f')]);_0x4948ae['attributes']=_[_0xdda2('0x50')](_0x472860[_0xdda2('0x4d')],qs['fields'](_0x25650a[_0xdda2('0x4f')][_0xdda2('0x51')]));_0x4948ae[_0xdda2('0x52')]=_0x4948ae[_0xdda2('0x52')][_0xdda2('0x6d')]?_0x4948ae[_0xdda2('0x52')]:_0x472860['model'];if(!_0x25650a[_0xdda2('0x4f')][_0xdda2('0x114')](_0xdda2('0x53'))){_0x4948ae['limit']=qs[_0xdda2('0x33')](_0x25650a[_0xdda2('0x4f')][_0xdda2('0x33')]);_0x4948ae[_0xdda2('0x31')]=qs['offset'](_0x25650a['query']['offset']);}_0x4948ae[_0xdda2('0x54')]=qs[_0xdda2('0x55')](_0x25650a[_0xdda2('0x4f')][_0xdda2('0x55')]);_0x4948ae['where']=qs[_0xdda2('0x56')](_[_0xdda2('0x57')](_0x25650a['query'],_0x472860[_0xdda2('0x56')]));_0x4948ae[_0xdda2('0x84')]['ChatInteractionId']=_0x316316['id'];if(_0x25650a[_0xdda2('0x4f')]['filter']){_0x4948ae[_0xdda2('0x84')]=_[_0xdda2('0x3d')](_0x4948ae['where'],{'$or':_[_0xdda2('0x42')](_0x4948ae[_0xdda2('0x52')],function(_0x57cf2b){var _0x30e01c={};_0x30e01c[_0x57cf2b]={'$like':'%'+_0x25650a[_0xdda2('0x4f')]['filter']+'%'};return _0x30e01c;})});}_0x4948ae[_0xdda2('0x84')]['secret']=![];if(_0x25650a[_0xdda2('0x4f')]['id']){_0x4948ae[_0xdda2('0x84')]['id']={'$gt':_0x25650a[_0xdda2('0x4f')]['id']};}_0x4948ae=_[_0xdda2('0x3d')]({},_0x4948ae,_0x25650a[_0xdda2('0xc1')]);return db[_0xdda2('0xd8')][_0xdda2('0x34')]({'where':_0x4948ae[_0xdda2('0x84')]})['then'](function(_0x5343eb){_0x32564c[_0xdda2('0x34')]=_0x5343eb;_0x4948ae['include']=[];if(_0x25650a[_0xdda2('0x4f')]['includeAgent']){_0x4948ae['include'][_0xdda2('0xbd')]({'model':db[_0xdda2('0x7f')],'as':_0xdda2('0x7f'),'attributes':['id',_0xdda2('0xc9'),_0xdda2('0xfd')]});}if(_0x25650a[_0xdda2('0x4f')][_0xdda2('0x116')]){_0x4948ae[_0xdda2('0xc0')]=[{'all':!![]}];}return db['ChatMessage']['findAll'](_0x4948ae);})[_0xdda2('0x22')](function(_0x1eb2df){_0x32564c[_0xdda2('0x117')]=_0x1eb2df;return _0x32564c;});}})[_0xdda2('0x22')](respondWithFilteredResult(_0x3410ec,_0x4948ae))[_0xdda2('0x2c')](handleError(_0x3410ec,null));};exports[_0xdda2('0x119')]=function(_0x198e16,_0x12d2a9,_0xc6dbe4){return db[_0xdda2('0x48')][_0xdda2('0x6e')]({'where':{'id':_0x198e16[_0xdda2('0xbf')]['id']}})[_0xdda2('0x22')](handleEntityNotFound(_0x12d2a9,null))['then'](function(_0xaabf31){if(_0xaabf31){return _0xaabf31[_0xdda2('0x11a')](_0x198e16[_0xdda2('0x81')][_0xdda2('0x111')],_[_0xdda2('0x112')](_0x198e16[_0xdda2('0x81')],[_0xdda2('0x111'),'id'])||{})['spread'](function(){return db[_0xdda2('0x7c')][_0xdda2('0x11b')]({'attributes':['id',_0xdda2('0x3a'),_0xdda2('0x59')],'where':{'id':_0x198e16[_0xdda2('0x81')][_0xdda2('0x111')]}});})[_0xdda2('0x22')](function(_0x39b18f){socket['emit'](_0xdda2('0x11c'),{'id':Number(_0x198e16['params']['id']),'tags':_0x39b18f||[]});return{'id':Number(_0x198e16['params']['id']),'tags':_0x39b18f||[]};});}})[_0xdda2('0x22')](respondWithResult(_0x12d2a9,null))[_0xdda2('0x2c')](handleError(_0x12d2a9,null));};exports[_0xdda2('0x11d')]=function(_0xa13c22,_0x3b8dca,_0x1bbd6e){return db[_0xdda2('0x48')][_0xdda2('0x6e')]({'where':{'id':_0xa13c22['params']['id']}})[_0xdda2('0x22')](handleEntityNotFound(_0x3b8dca,null))['then'](function(_0x4e85b0){if(_0x4e85b0){return _0x4e85b0[_0xdda2('0x11d')](_0xa13c22[_0xdda2('0x4f')][_0xdda2('0x111')]);}})[_0xdda2('0x22')](respondWithStatusCode(_0x3b8dca,null))[_0xdda2('0x2c')](handleError(_0x3b8dca,null));};exports['download']=function(_0x18d90c,_0xeae3c3){var _0x47a929=moment()[_0xdda2('0x11e')]()[_0xdda2('0xa6')]();var _0x1ebdd0=path[_0xdda2('0xe7')](config[_0xdda2('0xed')],_0xdda2('0x11f'),'files',_0xdda2('0x120'));var _0x5496df=path[_0xdda2('0xe7')](config[_0xdda2('0xed')],'server',_0xdda2('0x121'),_0xdda2('0x122'));var _0x5671bf=path['join'](_0x1ebdd0,_0x47a929);var _0x35cdcd=util['format']('transcript-%d-%s.zip',_0x18d90c['params']['id'],_0x47a929);var _0xc13cd3=path[_0xdda2('0xe7')](_0x1ebdd0,_0x35cdcd);var _0x20f56f=[];_0x20f56f[_0xdda2('0xbd')]({'model':db[_0xdda2('0x7f')],'as':'User','attributes':['id',_0xdda2('0xc9')],'raw':!![]});_0x20f56f[_0xdda2('0xbd')]({'model':db[_0xdda2('0xda')],'as':_0xdda2('0x74'),'attributes':['id',_0xdda2('0x123'),_0xdda2('0x124')],'raw':!![]});if(_0x18d90c[_0xdda2('0x4f')]['attachments']){_0x20f56f['push']({'model':db[_0xdda2('0x125')],'as':_0xdda2('0x125'),'raw':!![]});}var _0x749b15=[{'model':db[_0xdda2('0xd8')],'as':_0xdda2('0xf2'),'attributes':['id',_0xdda2('0x81'),_0xdda2('0x87'),_0xdda2('0x100'),'secret','read'],'include':_0x20f56f}];_0x749b15['push']({'model':db[_0xdda2('0xf3')],'as':_0xdda2('0x126'),'attributes':['id',_0xdda2('0x3a')]});_0x749b15[_0xdda2('0xbd')]({'model':db[_0xdda2('0x7f')],'as':_0xdda2('0x127'),'attributes':['id','fullname']});return db[_0xdda2('0x48')][_0xdda2('0x6e')]({'where':{'id':_0x18d90c['params']['id']},'include':_0x749b15})[_0xdda2('0x22')](handleEntityNotFound(_0xeae3c3,null))[_0xdda2('0x22')](function(_0x50b325){if(_0x50b325){var _0x35ea7f=_0x50b325[_0xdda2('0x128')]({'plain':!![]});fs['mkdirSync'](_0x5671bf);var _0x10719d={'channel':_0xdda2('0x129'),'account':_0x35ea7f[_0xdda2('0x126')]['name'],'agent':_0x35ea7f[_0xdda2('0x127')]?_0x35ea7f[_0xdda2('0x127')][_0xdda2('0xc9')]:_0xdda2('0x12a'),'createdAt':moment(_0x35ea7f[_0xdda2('0x87')])[_0xdda2('0xf4')]('YYYY-MM-DD\x20HH:mm:ss')[_0xdda2('0xa6')](),'closedAt':_0x35ea7f[_0xdda2('0xe3')]?moment(_0x35ea7f['closedAt'])[_0xdda2('0xf4')](_0xdda2('0x115'))['toString']():'','disposition':_0x35ea7f[_0xdda2('0xdd')],'chatInfo':{'browser':_0x35ea7f[_0xdda2('0x12b')],'os':_0x35ea7f[_0xdda2('0x12c')],'referer':_0x35ea7f[_0xdda2('0x12d')],'customerIp':_0x35ea7f[_0xdda2('0x12e')],'customerPort':_0x35ea7f[_0xdda2('0x12f')]?_0x35ea7f[_0xdda2('0x12f')]:_0xdda2('0x12a')},'messages':_(_0x35ea7f[_0xdda2('0xf2')])[_0xdda2('0x130')]()[_0xdda2('0x92')]({'secret':![]})[_0xdda2('0x42')](function(_0x57f1ad){if(_0x57f1ad[_0xdda2('0x125')]){var _0x8fa72e=path[_0xdda2('0xe7')](_0x5496df,_0x57f1ad['Attachment']['basename']);if(fs[_0xdda2('0x131')](_0x8fa72e)){fs[_0xdda2('0x132')](_0x8fa72e)['pipe'](fs['createWriteStream'](path[_0xdda2('0xe7')](_0x5671bf,_0x57f1ad['Attachment'][_0xdda2('0xe9')])));}}return{'date':moment(_0x57f1ad[_0xdda2('0x87')])['format'](_0xdda2('0x115'))[_0xdda2('0xa6')](),'sender':_0x57f1ad[_0xdda2('0x100')]===_0xdda2('0xd7')?_0x57f1ad[_0xdda2('0x7f')]?_0x57f1ad[_0xdda2('0x7f')]['fullname']:'System':_0x57f1ad[_0xdda2('0x74')][_0xdda2('0x123')]+(_0x57f1ad[_0xdda2('0x74')][_0xdda2('0x124')]?'\x20'+_0x57f1ad[_0xdda2('0x74')][_0xdda2('0x124')]:''),'body':_0x57f1ad[_0xdda2('0x125')]?_0x57f1ad[_0xdda2('0x125')][_0xdda2('0xe9')]:_0x57f1ad[_0xdda2('0x81')],'direction':_0x57f1ad[_0xdda2('0x100')]===_0xdda2('0xd7')?'A':'C','secret':_0x57f1ad['secret'],'read':_0x57f1ad[_0xdda2('0x8d')],'attachment':_0x57f1ad[_0xdda2('0x125')]};})['value']()};return ejs[_0xdda2('0x133')](path['join'](config[_0xdda2('0xed')],_0xdda2('0x11f'),_0xdda2('0x134'),_0xdda2('0x135')),{'interaction':_0x10719d})[_0xdda2('0x22')](function(_0x3d8f28){var _0x1826a9=path['join'](_0x5671bf,'transcript-'+_0x35ea7f['id']+'-'+_0x47a929+_0xdda2('0x136'));var _0x20b702={'path':_0x1826a9,'channel':_0xdda2('0x129'),'interactionId':_0x35ea7f['id']};return pdf[_0xdda2('0x137')](_0x3d8f28,_0x20b702);})[_0xdda2('0x22')](function(){return new BPromise(function(_0xf9ca6e,_0x3eb4b7){zipdir(_0x5671bf,{'saveTo':_0xc13cd3},function(_0x5eb398,_0x315585){if(_0x5eb398)return _0x3eb4b7(_0x5eb398);return _0xf9ca6e(_0x315585);});})['then'](function(){return new BPromise(function(_0x4f20d3,_0x1685e4){rimraf(_0x5671bf,function(_0x5dbd5d){if(_0x5dbd5d)_0x1685e4(_0x5dbd5d);return _0x4f20d3();});});})['then'](function(){return _0xeae3c3['download'](_0xc13cd3,_0x35cdcd,function(_0x43c68a){if(_0x43c68a){console['log'](_0xdda2('0x138'),_0x43c68a);}else{fs[_0xdda2('0x139')](_0xc13cd3);}});});});}else{return _0xeae3c3['sendStatus'](0xc8);}})[_0xdda2('0x2c')](handleError(_0xeae3c3,null));}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js index 0f16d58..f4ded3e 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 _0x3e43=['setMaxListeners','update','remove','then','setDataValue','map','findAll','unreadMessages','length','emit','hasOwnProperty','hook','exports','events','../../mysqldb','ChatInteraction','ChatMessage'];(function(_0x2f45ea,_0x15c656){var _0x485a84=function(_0x4a1fe3){while(--_0x4a1fe3){_0x2f45ea['push'](_0x2f45ea['shift']());}};_0x485a84(++_0x15c656);}(_0x3e43,0x172));var _0x33e4=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x3e43[_0xbca1b1];return _0x4e1686;};'use strict';var EventEmitter=require(_0x33e4('0x0'));var ChatInteraction=require(_0x33e4('0x1'))['db'][_0x33e4('0x2')];var ChatMessage=require(_0x33e4('0x1'))['db'][_0x33e4('0x3')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x33e4('0x4')](0x0);var events={'afterCreate':'save','afterUpdate':_0x33e4('0x5'),'afterDestroy':_0x33e4('0x6')};function emitEvent(_0x32aa79){return function(_0x41c798,_0x12c09c,_0xf8dffc){_0x41c798['getUsers']({'attributes':['id'],'raw':!![]})[_0x33e4('0x7')](function(_0x40ed4c){_0x41c798[_0x33e4('0x8')]('Users',_0x40ed4c[_0x33e4('0x9')](function(_0x3b1f5d){return{'id':_0x3b1f5d['id']};}));return ChatMessage[_0x33e4('0xa')]({'where':{'ChatInteractionId':_0x41c798['id'],'direction':'in','read':![]},'raw':!![]});})[_0x33e4('0x7')](function(_0x3a9a99){_0x41c798['setDataValue'](_0x33e4('0xb'),_0x3a9a99[_0x33e4('0xc')]);ChatInteractionEvents[_0x33e4('0xd')](_0x32aa79+':'+_0x41c798['id'],_0x41c798);ChatInteractionEvents[_0x33e4('0xd')](_0x32aa79,_0x41c798);_0xf8dffc(null);})['catch'](_0xf8dffc(null));};}for(var e in events){if(events[_0x33e4('0xe')](e)){var event=events[e];ChatInteraction[_0x33e4('0xf')](e,emitEvent(event));}}module[_0x33e4('0x10')]=ChatInteractionEvents; \ No newline at end of file +var _0x1065=['catch','hasOwnProperty','hook','events','../../mysqldb','setMaxListeners','save','update','remove','getUsers','then','Users','map','findAll','unreadMessages','length','emit'];(function(_0x31eee4,_0x59f9a1){var _0x4b0c41=function(_0x288c64){while(--_0x288c64){_0x31eee4['push'](_0x31eee4['shift']());}};_0x4b0c41(++_0x59f9a1);}(_0x1065,0x102));var _0x5106=function(_0x289fbf,_0x3ce4fa){_0x289fbf=_0x289fbf-0x0;var _0x7cb48e=_0x1065[_0x289fbf];return _0x7cb48e;};'use strict';var EventEmitter=require(_0x5106('0x0'));var ChatInteraction=require(_0x5106('0x1'))['db']['ChatInteraction'];var ChatMessage=require(_0x5106('0x1'))['db']['ChatMessage'];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x5106('0x2')](0x0);var events={'afterCreate':_0x5106('0x3'),'afterUpdate':_0x5106('0x4'),'afterDestroy':_0x5106('0x5')};function emitEvent(_0x1dc088){return function(_0x5d262d,_0x168c83,_0xade699){_0x5d262d[_0x5106('0x6')]({'attributes':['id'],'raw':!![]})[_0x5106('0x7')](function(_0x150cd8){_0x5d262d['setDataValue'](_0x5106('0x8'),_0x150cd8[_0x5106('0x9')](function(_0x55124a){return{'id':_0x55124a['id']};}));return ChatMessage[_0x5106('0xa')]({'where':{'ChatInteractionId':_0x5d262d['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x2b632b){_0x5d262d['setDataValue'](_0x5106('0xb'),_0x2b632b[_0x5106('0xc')]);ChatInteractionEvents[_0x5106('0xd')](_0x1dc088+':'+_0x5d262d['id'],_0x5d262d);ChatInteractionEvents[_0x5106('0xd')](_0x1dc088,_0x5d262d);_0xade699(null);})[_0x5106('0xe')](_0xade699(null));};}for(var e in events){if(events[_0x5106('0xf')](e)){var event=events[e];ChatInteraction[_0x5106('0x10')](e,emitEvent(event));}}module['exports']=ChatInteractionEvents; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.model.js b/server/api/chatInteraction/chatInteraction.model.js index 3a55417..4360824 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 _0xac3e=['YYYY-MM-DD\x20HH:mm:ss','utf8mb4','utf8mb4_unicode_ci','../../config/logger','api','bluebird','path','rimraf','../../config/environment','./chatInteraction.attributes','define','changed','closed','closedAt'];(function(_0x322e2f,_0x363871){var _0x3d70e3=function(_0x274e2d){while(--_0x274e2d){_0x322e2f['push'](_0x322e2f['shift']());}};_0x3d70e3(++_0x363871);}(_0xac3e,0x65));var _0xeac3=function(_0x3e44fa,_0x75ed2a){_0x3e44fa=_0x3e44fa-0x0;var _0x2a0aba=_0xac3e[_0x3e44fa];return _0x2a0aba;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xeac3('0x0'))(_0xeac3('0x1'));var moment=require('moment');var BPromise=require(_0xeac3('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xeac3('0x3'));var rimraf=require(_0xeac3('0x4'));var config=require(_0xeac3('0x5'));var attributes=require(_0xeac3('0x6'));module['exports']=function(_0x289814,_0x2a9285){return _0x289814[_0xeac3('0x7')]('ChatInteraction',attributes,{'tableName':'chat_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x5e4fe7,_0x3e8d78,_0x59bbb4){if(_0x5e4fe7[_0xeac3('0x8')](_0xeac3('0x9'))){_0x5e4fe7[_0xeac3('0xa')]=moment()['format'](_0xeac3('0xb'));}_0x59bbb4(null,_0x5e4fe7);}},'charset':_0xeac3('0xc'),'collate':_0xeac3('0xd')});}; \ No newline at end of file +var _0x7fa8=['ChatInteraction','changed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4_unicode_ci','../../config/logger','api','bluebird','request-promise','path','rimraf','./chatInteraction.attributes','exports','define'];(function(_0x1cc155,_0x511e93){var _0x3c6d20=function(_0x55f215){while(--_0x55f215){_0x1cc155['push'](_0x1cc155['shift']());}};_0x3c6d20(++_0x511e93);}(_0x7fa8,0x19b));var _0x87fa=function(_0x59efbb,_0x1b77e1){_0x59efbb=_0x59efbb-0x0;var _0x1e143c=_0x7fa8[_0x59efbb];return _0x1e143c;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x87fa('0x0'))(_0x87fa('0x1'));var moment=require('moment');var BPromise=require(_0x87fa('0x2'));var rp=require(_0x87fa('0x3'));var fs=require('fs');var path=require(_0x87fa('0x4'));var rimraf=require(_0x87fa('0x5'));var config=require('../../config/environment');var attributes=require(_0x87fa('0x6'));module[_0x87fa('0x7')]=function(_0x1b0dab,_0x3c3f09){return _0x1b0dab[_0x87fa('0x8')](_0x87fa('0x9'),attributes,{'tableName':'chat_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x345e02,_0x2229cd,_0xdb1a3d){if(_0x345e02[_0x87fa('0xa')]('closed')){_0x345e02[_0x87fa('0xb')]=moment()[_0x87fa('0xc')](_0x87fa('0xd'));}_0xdb1a3d(null,_0x345e02);}},'charset':'utf8mb4','collate':_0x87fa('0xe')});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js index 21cc0a1..3f39b0e 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 _0xd130=['ChatInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','update','options','raw','where','limit','UpdateChatInteraction','AddTagsToChatInteraction','body','ids','omit','spread','AddTags','lodash','util','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','localhost','socket.io-emitter','./chatInteraction.socket','register','request','then','info','ChatInteraction,\x20%s,\x20%s','debug'];(function(_0x350a45,_0x5812da){var _0xc10305=function(_0x66f741){while(--_0x66f741){_0x350a45['push'](_0x350a45['shift']());}};_0xc10305(++_0x5812da);}(_0xd130,0x1a4));var _0x0d13=function(_0x56ee6d,_0x134754){_0x56ee6d=_0x56ee6d-0x0;var _0x99537f=_0xd130[_0x56ee6d];return _0x99537f;};'use strict';var _=require(_0x0d13('0x0'));var util=require(_0x0d13('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x0d13('0x2'));var fs=require('fs');var Redis=require(_0x0d13('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0d13('0x4'));var logger=require(_0x0d13('0x5'))(_0x0d13('0x6'));var config=require(_0x0d13('0x7'));var jayson=require(_0x0d13('0x8'));var client=jayson[_0x0d13('0x9')]['http']({'port':0x232a});config['redis']=_['defaults'](config[_0x0d13('0xa')],{'host':_0x0d13('0xb'),'port':0x18eb});var socket=require(_0x0d13('0xc'))(new Redis(config[_0x0d13('0xa')]));require(_0x0d13('0xd'))[_0x0d13('0xe')](socket);function respondWithRpcPromise(_0x2ff1be,_0x5172ef,_0x14eb58){return new BPromise(function(_0x37160e,_0x12c98c){return client[_0x0d13('0xf')](_0x2ff1be,_0x14eb58)[_0x0d13('0x10')](function(_0x236677){logger[_0x0d13('0x11')](_0x0d13('0x12'),_0x5172ef,'request\x20sent');logger[_0x0d13('0x13')](_0x0d13('0x14'),_0x5172ef,_0x0d13('0x15'),JSON[_0x0d13('0x16')](_0x236677));if(_0x236677[_0x0d13('0x17')]){if(_0x236677[_0x0d13('0x17')][_0x0d13('0x18')]===0x1f4){logger[_0x0d13('0x17')](_0x0d13('0x12'),_0x5172ef,_0x236677[_0x0d13('0x17')][_0x0d13('0x19')]);return _0x12c98c(_0x236677[_0x0d13('0x17')]['message']);}logger[_0x0d13('0x17')](_0x0d13('0x12'),_0x5172ef,_0x236677[_0x0d13('0x17')][_0x0d13('0x19')]);return _0x37160e(_0x236677['error'][_0x0d13('0x19')]);}else{logger[_0x0d13('0x11')](_0x0d13('0x12'),_0x5172ef,_0x0d13('0x15'));_0x37160e(_0x236677[_0x0d13('0x1a')][_0x0d13('0x19')]);}})[_0x0d13('0x1b')](function(_0x48b8ed){logger[_0x0d13('0x17')](_0x0d13('0x12'),_0x5172ef,_0x48b8ed);_0x12c98c(_0x48b8ed);});});}exports['UpdateChatInteraction']=function(_0x279fc7){var _0x12e367=this;return new Promise(function(_0x47b368,_0x1dfb25){return db['ChatInteraction'][_0x0d13('0x1c')](_0x279fc7['body'],{'raw':_0x279fc7[_0x0d13('0x1d')]?_0x279fc7[_0x0d13('0x1d')][_0x0d13('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x279fc7['options']?_0x279fc7[_0x0d13('0x1d')][_0x0d13('0x1f')]||null:null,'attributes':_0x279fc7['options']?_0x279fc7[_0x0d13('0x1d')]['attributes']||null:null,'limit':_0x279fc7[_0x0d13('0x1d')]?_0x279fc7[_0x0d13('0x1d')][_0x0d13('0x20')]||null:null})[_0x0d13('0x10')](function(_0x475b08){logger['info'](_0x0d13('0x21'),_0x279fc7);logger['debug']('UpdateChatInteraction',_0x279fc7,JSON[_0x0d13('0x16')](_0x475b08));_0x47b368(_0x475b08);})[_0x0d13('0x1b')](function(_0x589396){logger['error'](_0x0d13('0x21'),_0x589396[_0x0d13('0x19')],_0x279fc7);_0x1dfb25(_0x12e367[_0x0d13('0x17')](0x1f4,_0x589396[_0x0d13('0x19')]));});});};exports[_0x0d13('0x22')]=function(_0x34bdda){return new Promise(function(_0x348aae,_0x344c49){return db['ChatInteraction']['find']({'where':_0x34bdda[_0x0d13('0x1d')]?_0x34bdda[_0x0d13('0x1d')][_0x0d13('0x1f')]||null:null})[_0x0d13('0x10')](function(_0x29ec67){if(_0x29ec67){return _0x29ec67['addTags'](_0x34bdda[_0x0d13('0x23')][_0x0d13('0x24')],_[_0x0d13('0x25')](_0x34bdda[_0x0d13('0x23')],[_0x0d13('0x24'),'id'])||{});}})[_0x0d13('0x26')](function(_0x1f9d07){logger['info']('AddTags',_0x34bdda);logger['debug'](_0x0d13('0x27'),_0x34bdda,JSON['stringify'](_0x1f9d07));_0x348aae(_0x1f9d07);})['catch'](function(_0x3089bd){logger['error'](_0x0d13('0x27'),_0x3089bd[_0x0d13('0x19')],_0x34bdda);_0x344c49(_this[_0x0d13('0x17')](0x1f4,_0x3089bd[_0x0d13('0x19')]));});});}; \ No newline at end of file +var _0x4376=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./chatInteraction.socket','register','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','ChatInteraction','update','body','options','raw','where','attributes','UpdateChatInteraction','debug','addTags','ids','omit','spread','AddTags','lodash','util','moment'];(function(_0x28fde4,_0x4fbc40){var _0xdc3f1b=function(_0x58f4be){while(--_0x58f4be){_0x28fde4['push'](_0x28fde4['shift']());}};_0xdc3f1b(++_0x4fbc40);}(_0x4376,0x1bf));var _0x6437=function(_0x2e9280,_0x44d032){_0x2e9280=_0x2e9280-0x0;var _0x17f9e5=_0x4376[_0x2e9280];return _0x17f9e5;};'use strict';var _=require(_0x6437('0x0'));var util=require(_0x6437('0x1'));var moment=require(_0x6437('0x2'));var BPromise=require(_0x6437('0x3'));var rs=require(_0x6437('0x4'));var fs=require('fs');var Redis=require(_0x6437('0x5'));var db=require(_0x6437('0x6'))['db'];var utils=require(_0x6437('0x7'));var logger=require(_0x6437('0x8'))(_0x6437('0x9'));var config=require(_0x6437('0xa'));var jayson=require('jayson/promise');var client=jayson[_0x6437('0xb')][_0x6437('0xc')]({'port':0x232a});config[_0x6437('0xd')]=_[_0x6437('0xe')](config['redis'],{'host':_0x6437('0xf'),'port':0x18eb});var socket=require(_0x6437('0x10'))(new Redis(config['redis']));require(_0x6437('0x11'))[_0x6437('0x12')](socket);function respondWithRpcPromise(_0x28a805,_0x2f66e0,_0x3c4dc8){return new BPromise(function(_0x4226b3,_0x2c821c){return client[_0x6437('0x13')](_0x28a805,_0x3c4dc8)[_0x6437('0x14')](function(_0x446cb){logger[_0x6437('0x15')](_0x6437('0x16'),_0x2f66e0,_0x6437('0x17'));logger['debug'](_0x6437('0x18'),_0x2f66e0,_0x6437('0x17'),JSON[_0x6437('0x19')](_0x446cb));if(_0x446cb['error']){if(_0x446cb[_0x6437('0x1a')][_0x6437('0x1b')]===0x1f4){logger['error'](_0x6437('0x16'),_0x2f66e0,_0x446cb['error'][_0x6437('0x1c')]);return _0x2c821c(_0x446cb[_0x6437('0x1a')][_0x6437('0x1c')]);}logger['error'](_0x6437('0x16'),_0x2f66e0,_0x446cb[_0x6437('0x1a')][_0x6437('0x1c')]);return _0x4226b3(_0x446cb[_0x6437('0x1a')][_0x6437('0x1c')]);}else{logger[_0x6437('0x15')](_0x6437('0x16'),_0x2f66e0,_0x6437('0x17'));_0x4226b3(_0x446cb[_0x6437('0x1d')][_0x6437('0x1c')]);}})[_0x6437('0x1e')](function(_0x5dfcd3){logger['error']('ChatInteraction,\x20%s,\x20%s',_0x2f66e0,_0x5dfcd3);_0x2c821c(_0x5dfcd3);});});}exports['UpdateChatInteraction']=function(_0x729071){var _0x19db61=this;return new Promise(function(_0x3fe0cf,_0x5c110e){return db[_0x6437('0x1f')][_0x6437('0x20')](_0x729071[_0x6437('0x21')],{'raw':_0x729071[_0x6437('0x22')]?_0x729071[_0x6437('0x22')][_0x6437('0x23')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x729071[_0x6437('0x22')]?_0x729071['options'][_0x6437('0x24')]||null:null,'attributes':_0x729071['options']?_0x729071[_0x6437('0x22')][_0x6437('0x25')]||null:null,'limit':_0x729071[_0x6437('0x22')]?_0x729071[_0x6437('0x22')]['limit']||null:null})[_0x6437('0x14')](function(_0x3b640a){logger['info'](_0x6437('0x26'),_0x729071);logger[_0x6437('0x27')]('UpdateChatInteraction',_0x729071,JSON[_0x6437('0x19')](_0x3b640a));_0x3fe0cf(_0x3b640a);})[_0x6437('0x1e')](function(_0x21c67b){logger[_0x6437('0x1a')](_0x6437('0x26'),_0x21c67b[_0x6437('0x1c')],_0x729071);_0x5c110e(_0x19db61[_0x6437('0x1a')](0x1f4,_0x21c67b['message']));});});};exports['AddTagsToChatInteraction']=function(_0x5b88cb){return new Promise(function(_0x1dae43,_0x41d854){return db[_0x6437('0x1f')]['find']({'where':_0x5b88cb[_0x6437('0x22')]?_0x5b88cb['options'][_0x6437('0x24')]||null:null})['then'](function(_0x4ba6ca){if(_0x4ba6ca){return _0x4ba6ca[_0x6437('0x28')](_0x5b88cb[_0x6437('0x21')][_0x6437('0x29')],_[_0x6437('0x2a')](_0x5b88cb[_0x6437('0x21')],['ids','id'])||{});}})[_0x6437('0x2b')](function(_0x40d47d){logger[_0x6437('0x15')](_0x6437('0x2c'),_0x5b88cb);logger[_0x6437('0x27')](_0x6437('0x2c'),_0x5b88cb,JSON[_0x6437('0x19')](_0x40d47d));_0x1dae43(_0x40d47d);})[_0x6437('0x1e')](function(_0x15c702){logger[_0x6437('0x1a')]('AddTags',_0x15c702['message'],_0x5b88cb);_0x41d854(_this[_0x6437('0x1a')](0x1f4,_0x15c702[_0x6437('0x1c')]));});});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js index 3f1c3c1..e36fc6a 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 _0xf5a7=['save','update','emit','removeListener','register','chatInteraction:','./chatInteraction.events'];(function(_0x38d528,_0x5936a7){var _0xd4af6d=function(_0x13081d){while(--_0x13081d){_0x38d528['push'](_0x38d528['shift']());}};_0xd4af6d(++_0x5936a7);}(_0xf5a7,0x133));var _0x7f5a=function(_0x5afe71,_0x1f3820){_0x5afe71=_0x5afe71-0x0;var _0x605239=_0xf5a7[_0x5afe71];return _0x605239;};'use strict';var ChatInteractionEvents=require(_0x7f5a('0x0'));var events=[_0x7f5a('0x1'),'remove',_0x7f5a('0x2')];function createListener(_0x13cc6f,_0x15a24a){return function(_0x25616d){_0x15a24a[_0x7f5a('0x3')](_0x13cc6f,_0x25616d);};}function removeListener(_0x342fa0,_0x6da3f3){return function(){ChatInteractionEvents[_0x7f5a('0x4')](_0x342fa0,_0x6da3f3);};}exports[_0x7f5a('0x5')]=function(_0x520bf9){for(var _0x2808f2=0x0,_0x2be845=events['length'];_0x2808f2<_0x2be845;_0x2808f2++){var _0x19c400=events[_0x2808f2];var _0x46d6d5=createListener(_0x7f5a('0x6')+_0x19c400,_0x520bf9);ChatInteractionEvents['on'](_0x19c400,_0x46d6d5);}}; \ No newline at end of file +var _0x6f46=['remove','update','emit','removeListener','register','length','chatInteraction:','./chatInteraction.events','save'];(function(_0x3a186f,_0x1f9dc0){var _0x56f426=function(_0x361077){while(--_0x361077){_0x3a186f['push'](_0x3a186f['shift']());}};_0x56f426(++_0x1f9dc0);}(_0x6f46,0x130));var _0x66f4=function(_0x478e2f,_0xcc2041){_0x478e2f=_0x478e2f-0x0;var _0x4b088d=_0x6f46[_0x478e2f];return _0x4b088d;};'use strict';var ChatInteractionEvents=require(_0x66f4('0x0'));var events=[_0x66f4('0x1'),_0x66f4('0x2'),_0x66f4('0x3')];function createListener(_0x2146c5,_0xb53aa5){return function(_0x5d5c31){_0xb53aa5[_0x66f4('0x4')](_0x2146c5,_0x5d5c31);};}function removeListener(_0x2637a1,_0x483675){return function(){ChatInteractionEvents[_0x66f4('0x5')](_0x2637a1,_0x483675);};}exports[_0x66f4('0x6')]=function(_0x166b8e){for(var _0x372eaf=0x0,_0x4e54b0=events[_0x66f4('0x7')];_0x372eaf<_0x4e54b0;_0x372eaf++){var _0xc079b8=events[_0x372eaf];var _0x28ef26=createListener(_0x66f4('0x8')+_0xc079b8,_0x166b8e);ChatInteractionEvents['on'](_0xc079b8,_0x28ef26);}}; \ No newline at end of file diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js index 884e49a..f3cae07 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 _0x3874=['attachmentUpload','addMessage','/:id/tags','addTags','put','tracked','chat','chatinteraction:update','update','/:id/abandon','abandon','/:id/close','close','delete','chatinteraction:destroy','destroy','removeTags','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','get','index','isAuthenticated','/:id','/:id/attachment_download','isChatInteractionAuthorized','/:id/messages','/:id/my_messages','getMyMessages','/:id/download','download','post','/:id/vidaoo','createVidaooSession','diskStorage','root','server/files/attachments/','format','%s-%s','now','originalname','replace','/:id/attachment_upload','single','file'];(function(_0x45ea0d,_0x3dc677){var _0x1c9606=function(_0x26ea18){while(--_0x26ea18){_0x45ea0d['push'](_0x45ea0d['shift']());}};_0x1c9606(++_0x3dc677);}(_0x3874,0x16f));var _0x4387=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x3874[_0x432682];return _0x463d05;};'use strict';var multer=require(_0x4387('0x0'));var util=require(_0x4387('0x1'));var path=require(_0x4387('0x2'));var timeout=require(_0x4387('0x3'));var express=require(_0x4387('0x4'));var router=express[_0x4387('0x5')]();var fs_extra=require(_0x4387('0x6'));var auth=require(_0x4387('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./chatInteraction.controller');router[_0x4387('0x8')]('/',auth['isAuthenticated'](),controller[_0x4387('0x9')]);router[_0x4387('0x8')]('/describe',auth[_0x4387('0xa')](),controller['describe']);router['get'](_0x4387('0xb'),auth['isChatInteractionAuthorized'](),controller['show']);router[_0x4387('0x8')](_0x4387('0xc'),auth[_0x4387('0xd')](),controller['attachmentDownload']);router[_0x4387('0x8')](_0x4387('0xe'),auth[_0x4387('0xa')](),controller['getMessages']);router[_0x4387('0x8')](_0x4387('0xf'),auth['isChatInteractionAuthorized'](),controller[_0x4387('0x10')]);router['get'](_0x4387('0x11'),auth[_0x4387('0xa')](),controller[_0x4387('0x12')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x4387('0x13')](_0x4387('0x14'),auth[_0x4387('0xa')](),controller[_0x4387('0x15')]);var upload=multer({'storage':multer[_0x4387('0x16')]({'destination':function(_0x5ac8c2,_0x15e0c5,_0x1ad59b){_0x1ad59b(null,path['join'](config[_0x4387('0x17')],_0x4387('0x18')));},'filename':function(_0x21e52e,_0x4c9697,_0x3328e6){_0x3328e6(null,util[_0x4387('0x19')](_0x4387('0x1a'),Date[_0x4387('0x1b')](),_0x4c9697[_0x4387('0x1c')][_0x4387('0x1d')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x4387('0x13')](_0x4387('0x1e'),upload[_0x4387('0x1f')](_0x4387('0x20')),controller[_0x4387('0x21')]);router[_0x4387('0x13')]('/:id/messages',auth[_0x4387('0xd')](),controller[_0x4387('0x22')]);router[_0x4387('0x13')](_0x4387('0x23'),auth[_0x4387('0xa')](),interaction['tracked']('chat','chatinteraction:addtags'),controller[_0x4387('0x24')]);router[_0x4387('0x25')](_0x4387('0xb'),auth['isAuthenticated'](),interaction[_0x4387('0x26')](_0x4387('0x27'),_0x4387('0x28')),controller[_0x4387('0x29')]);router['put']('/:id/custom_update',controller['customUpdate']);router[_0x4387('0x25')](_0x4387('0x2a'),auth['isChatInteractionAuthorized'](),controller[_0x4387('0x2b')]);router[_0x4387('0x25')](_0x4387('0x2c'),controller[_0x4387('0x2d')]);router[_0x4387('0x2e')](_0x4387('0xb'),auth[_0x4387('0xa')](),interaction[_0x4387('0x26')](_0x4387('0x27'),_0x4387('0x2f')),controller[_0x4387('0x30')]);router[_0x4387('0x2e')]('/:id/tags',auth[_0x4387('0xa')](),controller[_0x4387('0x31')]);module['exports']=router; \ No newline at end of file +var _0x7183=['abandon','/:id/close','chat','chatinteraction:destroy','destroy','delete','/:id/tags','removeTags','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInteraction.controller','get','isAuthenticated','/:id','isChatInteractionAuthorized','show','/:id/attachment_download','attachmentDownload','/:id/messages','getMyMessages','download','create','post','/:id/vidaoo','diskStorage','join','server/files/attachments/','%s-%s','now','originalname','replace','/:id/attachment_upload','single','attachmentUpload','tracked','chatinteraction:addtags','addTags','put','update','customUpdate'];(function(_0x49a4c1,_0x3d8e97){var _0x6e73cc=function(_0x3497b7){while(--_0x3497b7){_0x49a4c1['push'](_0x49a4c1['shift']());}};_0x6e73cc(++_0x3d8e97);}(_0x7183,0x99));var _0x3718=function(_0x346737,_0x3e6081){_0x346737=_0x346737-0x0;var _0x1ade2e=_0x7183[_0x346737];return _0x1ade2e;};'use strict';var multer=require(_0x3718('0x0'));var util=require(_0x3718('0x1'));var path=require(_0x3718('0x2'));var timeout=require('connect-timeout');var express=require(_0x3718('0x3'));var router=express[_0x3718('0x4')]();var fs_extra=require(_0x3718('0x5'));var auth=require(_0x3718('0x6'));var interaction=require(_0x3718('0x7'));var config=require(_0x3718('0x8'));var controller=require(_0x3718('0x9'));router[_0x3718('0xa')]('/',auth['isAuthenticated'](),controller['index']);router[_0x3718('0xa')]('/describe',auth[_0x3718('0xb')](),controller['describe']);router[_0x3718('0xa')](_0x3718('0xc'),auth[_0x3718('0xd')](),controller[_0x3718('0xe')]);router[_0x3718('0xa')](_0x3718('0xf'),auth[_0x3718('0xd')](),controller[_0x3718('0x10')]);router['get'](_0x3718('0x11'),auth[_0x3718('0xb')](),controller['getMessages']);router[_0x3718('0xa')]('/:id/my_messages',auth['isChatInteractionAuthorized'](),controller[_0x3718('0x12')]);router[_0x3718('0xa')]('/:id/download',auth[_0x3718('0xb')](),controller[_0x3718('0x13')]);router['post']('/',auth['isAuthenticated'](),controller[_0x3718('0x14')]);router[_0x3718('0x15')](_0x3718('0x16'),auth[_0x3718('0xb')](),controller['createVidaooSession']);var upload=multer({'storage':multer[_0x3718('0x17')]({'destination':function(_0x560b08,_0x166dee,_0x394d73){_0x394d73(null,path[_0x3718('0x18')](config['root'],_0x3718('0x19')));},'filename':function(_0x5cd477,_0x1f028f,_0x26041f){_0x26041f(null,util['format'](_0x3718('0x1a'),Date[_0x3718('0x1b')](),_0x1f028f[_0x3718('0x1c')][_0x3718('0x1d')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x3718('0x15')](_0x3718('0x1e'),upload[_0x3718('0x1f')]('file'),controller[_0x3718('0x20')]);router[_0x3718('0x15')](_0x3718('0x11'),auth[_0x3718('0xd')](),controller['addMessage']);router[_0x3718('0x15')]('/:id/tags',auth[_0x3718('0xb')](),interaction[_0x3718('0x21')]('chat',_0x3718('0x22')),controller[_0x3718('0x23')]);router[_0x3718('0x24')]('/:id',auth[_0x3718('0xb')](),interaction[_0x3718('0x21')]('chat','chatinteraction:update'),controller[_0x3718('0x25')]);router[_0x3718('0x24')]('/:id/custom_update',controller[_0x3718('0x26')]);router[_0x3718('0x24')]('/:id/abandon',auth['isChatInteractionAuthorized'](),controller[_0x3718('0x27')]);router['put'](_0x3718('0x28'),controller['close']);router['delete'](_0x3718('0xc'),auth[_0x3718('0xb')](),interaction['tracked'](_0x3718('0x29'),_0x3718('0x2a')),controller[_0x3718('0x2b')]);router[_0x3718('0x2c')](_0x3718('0x2d'),auth[_0x3718('0xb')](),controller[_0x3718('0x2e')]);module[_0x3718('0x2f')]=router; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.attributes.js b/server/api/chatInternalMessage/chatInternalMessage.attributes.js index aece924..df1d8c2 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 _0x51b0=['sequelize','exports','BOOLEAN','INTEGER'];(function(_0x49d971,_0x3e01e2){var _0x5f0ab0=function(_0x163dc8){while(--_0x163dc8){_0x49d971['push'](_0x49d971['shift']());}};_0x5f0ab0(++_0x3e01e2);}(_0x51b0,0x1c4));var _0x051b=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x51b0[_0xbca1b1];return _0x4e1686;};'use strict';var Sequelize=require(_0x051b('0x0'));module[_0x051b('0x1')]={'body':{'type':Sequelize['TEXT']('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x051b('0x2')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x051b('0x3')]}}; \ No newline at end of file +var _0x3cc9=['medium','BOOLEAN','INTEGER','sequelize','exports','TEXT'];(function(_0x18a79d,_0x57bd2c){var _0x4f8848=function(_0x28af80){while(--_0x28af80){_0x18a79d['push'](_0x18a79d['shift']());}};_0x4f8848(++_0x57bd2c);}(_0x3cc9,0xf9));var _0x93cc=function(_0x3b992e,_0x3b4c94){_0x3b992e=_0x3b992e-0x0;var _0x3a9916=_0x3cc9[_0x3b992e];return _0x3a9916;};'use strict';var Sequelize=require(_0x93cc('0x0'));module[_0x93cc('0x1')]={'body':{'type':Sequelize[_0x93cc('0x2')](_0x93cc('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x93cc('0x4')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x93cc('0x5')]}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.controller.js b/server/api/chatInternalMessage/chatInternalMessage.controller.js index 0dddb87..3ea9020 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 _0x7775=['limit','count','set','apply','update','then','destroy','error','stack','name','send','index','map','ChatInternalMessage','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','describe','get','messages','lastMessageAt','createdAt','format','YYYY-MM-DD\x20HH:mm:ss','lastMessage','getUsers','User','agent','admin','user','fullname','role','userpic','internal','online','lastLoginAt','showWebBar','sort','-online','VoiceQueues','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','Agents','userProfileId','UserProfileResource','isEmpty','resourceId','push','FromId','ToId','read','-createdAt','rimraf','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','./chatInternalMessage.socket','register','end','status','json','offset','undefined'];(function(_0x5ea1c,_0x2ef7b9){var _0x54bd68=function(_0x1cc3d3){while(--_0x1cc3d3){_0x5ea1c['push'](_0x5ea1c['shift']());}};_0x54bd68(++_0x2ef7b9);}(_0x7775,0xbf));var _0x5777=function(_0xca5c47,_0x263ba4){_0xca5c47=_0xca5c47-0x0;var _0x410497=_0x7775[_0xca5c47];return _0x410497;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5777('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5777('0x1'));var rp=require('request-promise');var moment=require(_0x5777('0x2'));var BPromise=require(_0x5777('0x3'));var Mustache=require(_0x5777('0x4'));var util=require('util');var path=require(_0x5777('0x5'));var sox=require(_0x5777('0x6'));var csv=require(_0x5777('0x7'));var ejs=require(_0x5777('0x8'));var fs=require('fs');var fs_extra=require(_0x5777('0x9'));var _=require(_0x5777('0xa'));var squel=require(_0x5777('0xb'));var crypto=require(_0x5777('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x5777('0xd'));var toCsv=require(_0x5777('0x7'));var querystring=require(_0x5777('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x5777('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x5777('0x10'));var hardwareService=require(_0x5777('0x11'));var logger=require(_0x5777('0x12'))(_0x5777('0x13'));var utils=require(_0x5777('0x14'));var config=require(_0x5777('0x15'));var licenseUtil=require(_0x5777('0x16'));var db=require(_0x5777('0x17'))['db'];config[_0x5777('0x18')]=_['defaults'](config['redis'],{'host':_0x5777('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x5777('0x18')]));require(_0x5777('0x1a'))[_0x5777('0x1b')](socket);function respondWithStatusCode(_0x5818ee,_0x1a3fa9){_0x1a3fa9=_0x1a3fa9||0xcc;return function(_0x162c0c){if(_0x162c0c){return _0x5818ee['sendStatus'](_0x1a3fa9);}return _0x5818ee['status'](_0x1a3fa9)[_0x5777('0x1c')]();};}function respondWithResult(_0x11c629,_0x373f4b){_0x373f4b=_0x373f4b||0xc8;return function(_0x4aba5d){if(_0x4aba5d){return _0x11c629[_0x5777('0x1d')](_0x373f4b)[_0x5777('0x1e')](_0x4aba5d);}};}function respondWithFilteredResult(_0x2a47e4,_0x46f2f6){return function(_0x2f5f9a){if(_0x2f5f9a){var _0x2a6bd2=typeof _0x46f2f6[_0x5777('0x1f')]===_0x5777('0x20')&&typeof _0x46f2f6[_0x5777('0x21')]===_0x5777('0x20');var _0x4c6901=_0x2f5f9a[_0x5777('0x22')];var _0x1cdf4d=_0x2a6bd2?0x0:_0x46f2f6[_0x5777('0x1f')];var _0x4a040f=_0x2a6bd2?_0x2f5f9a[_0x5777('0x22')]:_0x46f2f6[_0x5777('0x1f')]+_0x46f2f6['limit'];var _0x5b3c07;if(_0x4a040f>=_0x4c6901){_0x4a040f=_0x4c6901;_0x5b3c07=0xc8;}else{_0x5b3c07=0xce;}_0x2a47e4[_0x5777('0x1d')](_0x5b3c07);return _0x2a47e4[_0x5777('0x23')]('Content-Range',_0x1cdf4d+'-'+_0x4a040f+'/'+_0x4c6901)[_0x5777('0x1e')](_0x2f5f9a);}return null;};}function patchUpdates(_0x222798){return function(_0x52edf3){try{jsonpatch[_0x5777('0x24')](_0x52edf3,_0x222798,!![]);}catch(_0x1bb771){return BPromise['reject'](_0x1bb771);}return _0x52edf3['save']();};}function saveUpdates(_0x2907cb,_0x3b5757){return function(_0x4315e0){if(_0x4315e0){return _0x4315e0[_0x5777('0x25')](_0x2907cb)[_0x5777('0x26')](function(_0x351899){return _0x351899;});}return null;};}function removeEntity(_0x1071ca,_0x4270d4){return function(_0x1f980f){if(_0x1f980f){return _0x1f980f[_0x5777('0x27')]()['then'](function(){_0x1071ca[_0x5777('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x23f767,_0x572307){return function(_0x94ea92){if(!_0x94ea92){_0x23f767['sendStatus'](0x194);}return _0x94ea92;};}function handleError(_0x33d3f8,_0x59995f){_0x59995f=_0x59995f||0x1f4;return function(_0x5666b9){logger[_0x5777('0x28')](_0x5666b9[_0x5777('0x29')]);if(_0x5666b9[_0x5777('0x2a')]){delete _0x5666b9[_0x5777('0x2a')];}_0x33d3f8[_0x5777('0x1d')](_0x59995f)[_0x5777('0x2b')](_0x5666b9);};}exports[_0x5777('0x2c')]=function(_0x57466f,_0x231b05){var _0x1e3f76={},_0x5ec9dd={},_0x5a7ff7={'count':0x0,'rows':[]};var _0x19260e=_[_0x5777('0x2d')](db[_0x5777('0x2e')][_0x5777('0x2f')],function(_0x54ff9e){return{'name':_0x54ff9e[_0x5777('0x30')],'type':_0x54ff9e[_0x5777('0x31')][_0x5777('0x32')]};});_0x5ec9dd[_0x5777('0x33')]=_[_0x5777('0x2d')](_0x19260e,_0x5777('0x2a'));_0x5ec9dd[_0x5777('0x34')]=_[_0x5777('0x35')](_0x57466f[_0x5777('0x34')]);_0x5ec9dd[_0x5777('0x36')]=_[_0x5777('0x37')](_0x5ec9dd[_0x5777('0x33')],_0x5ec9dd[_0x5777('0x34')]);_0x1e3f76[_0x5777('0x38')]=_[_0x5777('0x37')](_0x5ec9dd[_0x5777('0x33')],qs[_0x5777('0x39')](_0x57466f[_0x5777('0x34')]['fields']));_0x1e3f76[_0x5777('0x38')]=_0x1e3f76[_0x5777('0x38')][_0x5777('0x3a')]?_0x1e3f76[_0x5777('0x38')]:_0x5ec9dd[_0x5777('0x33')];if(!_0x57466f['query']['hasOwnProperty'](_0x5777('0x3b'))){_0x1e3f76[_0x5777('0x21')]=qs[_0x5777('0x21')](_0x57466f[_0x5777('0x34')][_0x5777('0x21')]);_0x1e3f76['offset']=qs[_0x5777('0x1f')](_0x57466f[_0x5777('0x34')][_0x5777('0x1f')]);}_0x1e3f76[_0x5777('0x3c')]=qs['sort'](_0x57466f[_0x5777('0x34')]['sort']);_0x1e3f76[_0x5777('0x3d')]=qs['filters'](_[_0x5777('0x3e')](_0x57466f[_0x5777('0x34')],_0x5ec9dd['filters']),_0x19260e);if(_0x57466f[_0x5777('0x34')][_0x5777('0x3f')]){_0x1e3f76[_0x5777('0x3d')]=_[_0x5777('0x40')](_0x1e3f76[_0x5777('0x3d')],{'$or':_[_0x5777('0x2d')](_0x19260e,function(_0x1e9371){if(_0x1e9371[_0x5777('0x31')]!==_0x5777('0x41')){var _0x438db={};_0x438db[_0x1e9371['name']]={'$like':'%'+_0x57466f['query'][_0x5777('0x3f')]+'%'};return _0x438db;}})});}_0x1e3f76=_[_0x5777('0x40')]({},_0x1e3f76,_0x57466f[_0x5777('0x42')]);var _0x3d6385={'where':_0x1e3f76[_0x5777('0x3d')]};return db[_0x5777('0x2e')]['count'](_0x3d6385)[_0x5777('0x26')](function(_0x582b19){_0x5a7ff7[_0x5777('0x22')]=_0x582b19;if(_0x57466f[_0x5777('0x34')][_0x5777('0x43')]){_0x1e3f76[_0x5777('0x44')]=[{'all':!![]}];}return db[_0x5777('0x2e')][_0x5777('0x45')](_0x1e3f76);})[_0x5777('0x26')](function(_0x49c4ff){_0x5a7ff7[_0x5777('0x46')]=_0x49c4ff;return _0x5a7ff7;})[_0x5777('0x26')](respondWithFilteredResult(_0x231b05,_0x1e3f76))[_0x5777('0x47')](handleError(_0x231b05,null));};exports[_0x5777('0x48')]=function(_0x30f17c,_0x398ee6){var _0xdfaebb={'raw':!![],'where':{'id':_0x30f17c[_0x5777('0x49')]['id']}},_0x10f88e={};_0x10f88e[_0x5777('0x33')]=_[_0x5777('0x35')](db[_0x5777('0x2e')]['rawAttributes']);_0x10f88e[_0x5777('0x34')]=_[_0x5777('0x35')](_0x30f17c[_0x5777('0x34')]);_0x10f88e[_0x5777('0x36')]=_[_0x5777('0x37')](_0x10f88e[_0x5777('0x33')],_0x10f88e[_0x5777('0x34')]);_0xdfaebb[_0x5777('0x38')]=_[_0x5777('0x37')](_0x10f88e[_0x5777('0x33')],qs[_0x5777('0x39')](_0x30f17c[_0x5777('0x34')][_0x5777('0x39')]));_0xdfaebb[_0x5777('0x38')]=_0xdfaebb[_0x5777('0x38')]['length']?_0xdfaebb[_0x5777('0x38')]:_0x10f88e[_0x5777('0x33')];if(_0x30f17c['query'][_0x5777('0x43')]){_0xdfaebb[_0x5777('0x44')]=[{'all':!![]}];}_0xdfaebb=_[_0x5777('0x40')]({},_0xdfaebb,_0x30f17c[_0x5777('0x42')]);return db[_0x5777('0x2e')][_0x5777('0x4a')](_0xdfaebb)['then'](handleEntityNotFound(_0x398ee6,null))[_0x5777('0x26')](respondWithResult(_0x398ee6,null))['catch'](handleError(_0x398ee6,null));};exports[_0x5777('0x4b')]=function(_0x26c800,_0x5c65ed){return db[_0x5777('0x2e')][_0x5777('0x4b')](_0x26c800[_0x5777('0x4c')],{})['then'](respondWithResult(_0x5c65ed,0xc9))[_0x5777('0x47')](handleError(_0x5c65ed,null));};exports['update']=function(_0xfe0bcd,_0x5259dd){if(_0xfe0bcd[_0x5777('0x4c')]['id']){delete _0xfe0bcd[_0x5777('0x4c')]['id'];}return db[_0x5777('0x2e')]['find']({'where':{'id':_0xfe0bcd['params']['id']}})['then'](handleEntityNotFound(_0x5259dd,null))[_0x5777('0x26')](saveUpdates(_0xfe0bcd[_0x5777('0x4c')],null))[_0x5777('0x26')](respondWithResult(_0x5259dd,null))[_0x5777('0x47')](handleError(_0x5259dd,null));};exports[_0x5777('0x27')]=function(_0x2e4ca5,_0x5d3774){return db[_0x5777('0x2e')]['find']({'where':{'id':_0x2e4ca5[_0x5777('0x49')]['id']}})[_0x5777('0x26')](handleEntityNotFound(_0x5d3774,null))[_0x5777('0x26')](removeEntity(_0x5d3774,null))[_0x5777('0x47')](handleError(_0x5d3774,null));};exports[_0x5777('0x4d')]=function(_0x4daf1d,_0x5222f3){return db[_0x5777('0x2e')]['describe']()['then'](respondWithResult(_0x5222f3,null))[_0x5777('0x47')](handleError(_0x5222f3,null));};function wrapUser(_0x20e3af){return function(_0x33392b){var _0x5b12ea=_0x20e3af[_0x5777('0x4e')]({'plain':!![]});_0x5b12ea[_0x5777('0x4f')]=[];if(_0x33392b){_0x5b12ea[_0x5777('0x50')]=_0x33392b[_0x5777('0x51')];_0x5b12ea['lastMessage']=_0x33392b;}else{_0x5b12ea[_0x5777('0x50')]=moment(0x0)[_0x5777('0x52')](_0x5777('0x53'));_0x5b12ea[_0x5777('0x54')]={};}return _0x5b12ea;};}exports[_0x5777('0x55')]=function(_0x29cc5a,_0x1bfb8a,_0x3c9e02){var _0x471b29=[];return db[_0x5777('0x56')][_0x5777('0x45')]({'where':{'role':[_0x5777('0x57'),_0x5777('0x58'),_0x5777('0x59')]},'attributes':['id',_0x5777('0x5a'),_0x5777('0x2a'),_0x5777('0x5b'),_0x5777('0x5c'),_0x5777('0x5d'),_0x5777('0x5e'),_0x5777('0x5f'),'allowmessenger',_0x5777('0x60')],'order':qs[_0x5777('0x61')](_0x5777('0x62')),'include':[{'model':db['VoiceQueue'],'as':_0x5777('0x63'),'attributes':['id','name',_0x5777('0x31')],'through':{'attributes':[]}}]})[_0x5777('0x26')](function(_0x52bf79){if(_0x52bf79){var _0x296f34=_0x29cc5a[_0x5777('0x59')]['get']({'plain':!![]});if(!_0x296f34)throw new Error(_0x5777('0x64'));if(_0x296f34[_0x5777('0x5b')]===_0x5777('0x59')){return db[_0x5777('0x65')][_0x5777('0x4a')]({'where':{'name':_0x5777('0x66'),'userProfileId':_0x296f34[_0x5777('0x67')]},'raw':!![]})[_0x5777('0x26')](function(_0xca06b8){if(_0xca06b8){if(_0xca06b8['autoAssociation']===0x0){return db[_0x5777('0x68')][_0x5777('0x45')]({'where':{'sectionId':_0xca06b8['id']},'raw':!![]})[_0x5777('0x26')](function(_0x15c533){var _0x165fa9=[];if(_[_0x5777('0x69')](_0x15c533)){_0x165fa9=_[_0x5777('0x3f')](_0x52bf79,function(_0x5d60ab){if(_0x5d60ab[_0x5777('0x5b')]!==_0x5777('0x57')){return _0x5d60ab;}});return _0x165fa9;}else{for(var _0x82d64e=0x0;_0x82d64e<_0x52bf79[_0x5777('0x3a')];_0x82d64e++){var _0x1ca567=_0x52bf79[_0x82d64e];if(_0x1ca567[_0x5777('0x5b')]==='agent'){var _0x362694=_[_0x5777('0x4a')](_0x15c533,function(_0x50fe0e){return _0x50fe0e[_0x5777('0x6a')]===_0x1ca567['id'];});if(_0x362694)_0x165fa9[_0x5777('0x6b')](_0x1ca567);}else{_0x165fa9[_0x5777('0x6b')](_0x1ca567);}}return _0x165fa9;}});}else{return _0x52bf79;}}else{var _0x246458=_['filter'](_0x52bf79,function(_0x3c4529){if(_0x3c4529[_0x5777('0x5b')]!==_0x5777('0x57')){return _0x3c4529;}});return _0x246458;}});}else{return _0x52bf79;}}})['then'](function(_0x438da6){var _0x150e04=[];if(_0x438da6){_0x471b29=_0x438da6;for(var _0x3f2ab9=0x0;_0x3f2ab9<_0x438da6[_0x5777('0x3a')];_0x3f2ab9+=0x1){_0x471b29[_0x3f2ab9][_0x5777('0x4f')]=[];_0x150e04[_0x5777('0x6b')](db[_0x5777('0x2e')][_0x5777('0x4a')]({'where':{'FromId':[_0x29cc5a[_0x5777('0x59')]['id'],_0x438da6[_0x3f2ab9]['id']],'ToId':[_0x29cc5a[_0x5777('0x59')]['id'],_0x438da6[_0x3f2ab9]['id']],'ChatGroupId':null},'attributes':['id',_0x5777('0x51'),_0x5777('0x6c'),_0x5777('0x6d'),_0x5777('0x6e'),'body'],'order':qs['sort'](_0x5777('0x6f')),'limit':0x1,'offset':0x0,'raw':!![]})[_0x5777('0x26')](wrapUser(_0x438da6[_0x3f2ab9])));}return BPromise['all'](_0x150e04);}return[];})['then'](function(_0x6c0da0){return{'rows':_0x6c0da0,'count':_0x6c0da0[_0x5777('0x3a')]};})[_0x5777('0x26')](respondWithResult(_0x1bfb8a,null))['catch'](handleError(_0x1bfb8a,null));}; \ No newline at end of file +var _0x3afa=['path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./chatInternalMessage.socket','register','status','end','json','offset','undefined','count','set','Content-Range','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','map','ChatInternalMessage','rawAttributes','type','key','model','query','keys','intersection','attributes','length','hasOwnProperty','nolimit','limit','order','sort','filters','pick','where','merge','VIRTUAL','filter','options','includeAll','include','rows','catch','show','params','fields','find','create','body','describe','lastMessageAt','createdAt','lastMessage','format','YYYY-MM-DD\x20HH:mm:ss','getUsers','findAll','admin','user','fullname','role','online','lastLoginAt','allowmessenger','showWebBar','VoiceQueue','VoiceQueues','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','agent','resourceId','push','FromId','ToId','-createdAt','all','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird'];(function(_0x5037ab,_0x43209e){var _0x512adb=function(_0x261783){while(--_0x261783){_0x5037ab['push'](_0x5037ab['shift']());}};_0x512adb(++_0x43209e);}(_0x3afa,0x152));var _0xa3af=function(_0x2730da,_0x1098bd){_0x2730da=_0x2730da-0x0;var _0xfe9991=_0x3afa[_0x2730da];return _0xfe9991;};'use strict';var emlformat=require(_0xa3af('0x0'));var rimraf=require(_0xa3af('0x1'));var zipdir=require(_0xa3af('0x2'));var jsonpatch=require(_0xa3af('0x3'));var rp=require(_0xa3af('0x4'));var moment=require(_0xa3af('0x5'));var BPromise=require(_0xa3af('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0xa3af('0x7'));var sox=require(_0xa3af('0x8'));var csv=require(_0xa3af('0x9'));var ejs=require(_0xa3af('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa3af('0xb'));var squel=require(_0xa3af('0xc'));var crypto=require(_0xa3af('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xa3af('0xe'));var toCsv=require(_0xa3af('0x9'));var querystring=require('querystring');var Papa=require(_0xa3af('0xf'));var Redis=require(_0xa3af('0x10'));var authService=require(_0xa3af('0x11'));var qs=require(_0xa3af('0x12'));var as=require(_0xa3af('0x13'));var hardwareService=require(_0xa3af('0x14'));var logger=require(_0xa3af('0x15'))(_0xa3af('0x16'));var utils=require(_0xa3af('0x17'));var config=require(_0xa3af('0x18'));var licenseUtil=require(_0xa3af('0x19'));var db=require(_0xa3af('0x1a'))['db'];config[_0xa3af('0x1b')]=_[_0xa3af('0x1c')](config[_0xa3af('0x1b')],{'host':'localhost','port':0x18eb});var socket=require(_0xa3af('0x1d'))(new Redis(config[_0xa3af('0x1b')]));require(_0xa3af('0x1e'))[_0xa3af('0x1f')](socket);function respondWithStatusCode(_0x409c8b,_0x54d8cc){_0x54d8cc=_0x54d8cc||0xcc;return function(_0x141ddf){if(_0x141ddf){return _0x409c8b['sendStatus'](_0x54d8cc);}return _0x409c8b[_0xa3af('0x20')](_0x54d8cc)[_0xa3af('0x21')]();};}function respondWithResult(_0x3e2f73,_0x192bb4){_0x192bb4=_0x192bb4||0xc8;return function(_0x2800be){if(_0x2800be){return _0x3e2f73['status'](_0x192bb4)[_0xa3af('0x22')](_0x2800be);}};}function respondWithFilteredResult(_0x2603ce,_0x3b10c0){return function(_0x2fdaef){if(_0x2fdaef){var _0x2944ab=typeof _0x3b10c0[_0xa3af('0x23')]===_0xa3af('0x24')&&typeof _0x3b10c0['limit']==='undefined';var _0x4969c1=_0x2fdaef[_0xa3af('0x25')];var _0x3ebbe7=_0x2944ab?0x0:_0x3b10c0[_0xa3af('0x23')];var _0x2dd304=_0x2944ab?_0x2fdaef[_0xa3af('0x25')]:_0x3b10c0[_0xa3af('0x23')]+_0x3b10c0['limit'];var _0x28cf51;if(_0x2dd304>=_0x4969c1){_0x2dd304=_0x4969c1;_0x28cf51=0xc8;}else{_0x28cf51=0xce;}_0x2603ce[_0xa3af('0x20')](_0x28cf51);return _0x2603ce[_0xa3af('0x26')](_0xa3af('0x27'),_0x3ebbe7+'-'+_0x2dd304+'/'+_0x4969c1)[_0xa3af('0x22')](_0x2fdaef);}return null;};}function patchUpdates(_0x43c4a4){return function(_0x3ca78e){try{jsonpatch['apply'](_0x3ca78e,_0x43c4a4,!![]);}catch(_0x38be0b){return BPromise[_0xa3af('0x28')](_0x38be0b);}return _0x3ca78e[_0xa3af('0x29')]();};}function saveUpdates(_0x473472,_0x4d33bb){return function(_0x4dbee1){if(_0x4dbee1){return _0x4dbee1[_0xa3af('0x2a')](_0x473472)[_0xa3af('0x2b')](function(_0xdb22a9){return _0xdb22a9;});}return null;};}function removeEntity(_0x4fd66c,_0x36a89a){return function(_0x385a19){if(_0x385a19){return _0x385a19[_0xa3af('0x2c')]()['then'](function(){_0x4fd66c[_0xa3af('0x20')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5bbf8e,_0x21c2fc){return function(_0x1c3e1e){if(!_0x1c3e1e){_0x5bbf8e[_0xa3af('0x2d')](0x194);}return _0x1c3e1e;};}function handleError(_0x165dbd,_0x5b080b){_0x5b080b=_0x5b080b||0x1f4;return function(_0x34f725){logger[_0xa3af('0x2e')](_0x34f725[_0xa3af('0x2f')]);if(_0x34f725[_0xa3af('0x30')]){delete _0x34f725[_0xa3af('0x30')];}_0x165dbd[_0xa3af('0x20')](_0x5b080b)[_0xa3af('0x31')](_0x34f725);};}exports[_0xa3af('0x32')]=function(_0xd1750,_0x188cc9){var _0x576217={},_0x290957={},_0x572844={'count':0x0,'rows':[]};var _0x195843=_[_0xa3af('0x33')](db[_0xa3af('0x34')][_0xa3af('0x35')],function(_0x2c11ab){return{'name':_0x2c11ab['fieldName'],'type':_0x2c11ab[_0xa3af('0x36')][_0xa3af('0x37')]};});_0x290957[_0xa3af('0x38')]=_[_0xa3af('0x33')](_0x195843,'name');_0x290957[_0xa3af('0x39')]=_[_0xa3af('0x3a')](_0xd1750[_0xa3af('0x39')]);_0x290957['filters']=_[_0xa3af('0x3b')](_0x290957['model'],_0x290957[_0xa3af('0x39')]);_0x576217['attributes']=_['intersection'](_0x290957[_0xa3af('0x38')],qs['fields'](_0xd1750[_0xa3af('0x39')]['fields']));_0x576217[_0xa3af('0x3c')]=_0x576217['attributes'][_0xa3af('0x3d')]?_0x576217[_0xa3af('0x3c')]:_0x290957['model'];if(!_0xd1750['query'][_0xa3af('0x3e')](_0xa3af('0x3f'))){_0x576217['limit']=qs[_0xa3af('0x40')](_0xd1750[_0xa3af('0x39')][_0xa3af('0x40')]);_0x576217['offset']=qs[_0xa3af('0x23')](_0xd1750[_0xa3af('0x39')][_0xa3af('0x23')]);}_0x576217[_0xa3af('0x41')]=qs[_0xa3af('0x42')](_0xd1750[_0xa3af('0x39')]['sort']);_0x576217['where']=qs[_0xa3af('0x43')](_[_0xa3af('0x44')](_0xd1750[_0xa3af('0x39')],_0x290957[_0xa3af('0x43')]),_0x195843);if(_0xd1750[_0xa3af('0x39')]['filter']){_0x576217[_0xa3af('0x45')]=_[_0xa3af('0x46')](_0x576217[_0xa3af('0x45')],{'$or':_['map'](_0x195843,function(_0x9a8899){if(_0x9a8899[_0xa3af('0x36')]!==_0xa3af('0x47')){var _0xdbf572={};_0xdbf572[_0x9a8899[_0xa3af('0x30')]]={'$like':'%'+_0xd1750['query'][_0xa3af('0x48')]+'%'};return _0xdbf572;}})});}_0x576217=_[_0xa3af('0x46')]({},_0x576217,_0xd1750[_0xa3af('0x49')]);var _0x335cda={'where':_0x576217[_0xa3af('0x45')]};return db['ChatInternalMessage'][_0xa3af('0x25')](_0x335cda)[_0xa3af('0x2b')](function(_0x46cee0){_0x572844[_0xa3af('0x25')]=_0x46cee0;if(_0xd1750[_0xa3af('0x39')][_0xa3af('0x4a')]){_0x576217[_0xa3af('0x4b')]=[{'all':!![]}];}return db[_0xa3af('0x34')]['findAll'](_0x576217);})[_0xa3af('0x2b')](function(_0x53b69b){_0x572844[_0xa3af('0x4c')]=_0x53b69b;return _0x572844;})[_0xa3af('0x2b')](respondWithFilteredResult(_0x188cc9,_0x576217))[_0xa3af('0x4d')](handleError(_0x188cc9,null));};exports[_0xa3af('0x4e')]=function(_0x48869e,_0x4b596d){var _0x3b316d={'raw':!![],'where':{'id':_0x48869e[_0xa3af('0x4f')]['id']}},_0x4ef1f7={};_0x4ef1f7[_0xa3af('0x38')]=_[_0xa3af('0x3a')](db[_0xa3af('0x34')][_0xa3af('0x35')]);_0x4ef1f7[_0xa3af('0x39')]=_['keys'](_0x48869e[_0xa3af('0x39')]);_0x4ef1f7['filters']=_[_0xa3af('0x3b')](_0x4ef1f7[_0xa3af('0x38')],_0x4ef1f7[_0xa3af('0x39')]);_0x3b316d[_0xa3af('0x3c')]=_[_0xa3af('0x3b')](_0x4ef1f7[_0xa3af('0x38')],qs[_0xa3af('0x50')](_0x48869e[_0xa3af('0x39')][_0xa3af('0x50')]));_0x3b316d[_0xa3af('0x3c')]=_0x3b316d[_0xa3af('0x3c')][_0xa3af('0x3d')]?_0x3b316d['attributes']:_0x4ef1f7['model'];if(_0x48869e['query'][_0xa3af('0x4a')]){_0x3b316d[_0xa3af('0x4b')]=[{'all':!![]}];}_0x3b316d=_[_0xa3af('0x46')]({},_0x3b316d,_0x48869e[_0xa3af('0x49')]);return db[_0xa3af('0x34')][_0xa3af('0x51')](_0x3b316d)[_0xa3af('0x2b')](handleEntityNotFound(_0x4b596d,null))['then'](respondWithResult(_0x4b596d,null))[_0xa3af('0x4d')](handleError(_0x4b596d,null));};exports[_0xa3af('0x52')]=function(_0x390312,_0x91c337){return db['ChatInternalMessage'][_0xa3af('0x52')](_0x390312['body'],{})[_0xa3af('0x2b')](respondWithResult(_0x91c337,0xc9))[_0xa3af('0x4d')](handleError(_0x91c337,null));};exports['update']=function(_0x4b9a6b,_0x35557c){if(_0x4b9a6b[_0xa3af('0x53')]['id']){delete _0x4b9a6b[_0xa3af('0x53')]['id'];}return db['ChatInternalMessage']['find']({'where':{'id':_0x4b9a6b[_0xa3af('0x4f')]['id']}})[_0xa3af('0x2b')](handleEntityNotFound(_0x35557c,null))[_0xa3af('0x2b')](saveUpdates(_0x4b9a6b[_0xa3af('0x53')],null))['then'](respondWithResult(_0x35557c,null))[_0xa3af('0x4d')](handleError(_0x35557c,null));};exports[_0xa3af('0x2c')]=function(_0x39d838,_0x57a4db){return db[_0xa3af('0x34')]['find']({'where':{'id':_0x39d838['params']['id']}})[_0xa3af('0x2b')](handleEntityNotFound(_0x57a4db,null))[_0xa3af('0x2b')](removeEntity(_0x57a4db,null))[_0xa3af('0x4d')](handleError(_0x57a4db,null));};exports[_0xa3af('0x54')]=function(_0x1b8905,_0x4adc9f){return db['ChatInternalMessage'][_0xa3af('0x54')]()[_0xa3af('0x2b')](respondWithResult(_0x4adc9f,null))[_0xa3af('0x4d')](handleError(_0x4adc9f,null));};function wrapUser(_0x506a3e){return function(_0x24a7eb){var _0x52d604=_0x506a3e['get']({'plain':!![]});_0x52d604['messages']=[];if(_0x24a7eb){_0x52d604[_0xa3af('0x55')]=_0x24a7eb[_0xa3af('0x56')];_0x52d604[_0xa3af('0x57')]=_0x24a7eb;}else{_0x52d604['lastMessageAt']=moment(0x0)[_0xa3af('0x58')](_0xa3af('0x59'));_0x52d604['lastMessage']={};}return _0x52d604;};}exports[_0xa3af('0x5a')]=function(_0x20320e,_0x1ea190,_0x2d4690){var _0x4a072a=[];return db['User'][_0xa3af('0x5b')]({'where':{'role':['agent',_0xa3af('0x5c'),_0xa3af('0x5d')]},'attributes':['id',_0xa3af('0x5e'),_0xa3af('0x30'),_0xa3af('0x5f'),'userpic','internal',_0xa3af('0x60'),_0xa3af('0x61'),_0xa3af('0x62'),_0xa3af('0x63')],'order':qs[_0xa3af('0x42')]('-online'),'include':[{'model':db[_0xa3af('0x64')],'as':_0xa3af('0x65'),'attributes':['id',_0xa3af('0x30'),_0xa3af('0x36')],'through':{'attributes':[]}}]})[_0xa3af('0x2b')](function(_0x5b18ff){if(_0x5b18ff){var _0x1d55ec=_0x20320e[_0xa3af('0x5d')][_0xa3af('0x66')]({'plain':!![]});if(!_0x1d55ec)throw new Error(_0xa3af('0x67'));if(_0x1d55ec['role']===_0xa3af('0x5d')){return db[_0xa3af('0x68')][_0xa3af('0x51')]({'where':{'name':'Agents','userProfileId':_0x1d55ec[_0xa3af('0x69')]},'raw':!![]})[_0xa3af('0x2b')](function(_0x2361be){if(_0x2361be){if(_0x2361be[_0xa3af('0x6a')]===0x0){return db[_0xa3af('0x6b')]['findAll']({'where':{'sectionId':_0x2361be['id']},'raw':!![]})['then'](function(_0xbf70f){var _0x2c4ef6=[];if(_['isEmpty'](_0xbf70f)){_0x2c4ef6=_[_0xa3af('0x48')](_0x5b18ff,function(_0x30d7b5){if(_0x30d7b5[_0xa3af('0x5f')]!==_0xa3af('0x6c')){return _0x30d7b5;}});return _0x2c4ef6;}else{for(var _0x183e8f=0x0;_0x183e8f<_0x5b18ff[_0xa3af('0x3d')];_0x183e8f++){var _0x486481=_0x5b18ff[_0x183e8f];if(_0x486481['role']==='agent'){var _0x59ff4a=_['find'](_0xbf70f,function(_0x5d09fa){return _0x5d09fa[_0xa3af('0x6d')]===_0x486481['id'];});if(_0x59ff4a)_0x2c4ef6[_0xa3af('0x6e')](_0x486481);}else{_0x2c4ef6[_0xa3af('0x6e')](_0x486481);}}return _0x2c4ef6;}});}else{return _0x5b18ff;}}else{var _0x11c23b=_[_0xa3af('0x48')](_0x5b18ff,function(_0x144e61){if(_0x144e61['role']!==_0xa3af('0x6c')){return _0x144e61;}});return _0x11c23b;}});}else{return _0x5b18ff;}}})['then'](function(_0x2e8dce){var _0x56ee4c=[];if(_0x2e8dce){_0x4a072a=_0x2e8dce;for(var _0x277967=0x0;_0x277967<_0x2e8dce[_0xa3af('0x3d')];_0x277967+=0x1){_0x4a072a[_0x277967]['messages']=[];_0x56ee4c['push'](db['ChatInternalMessage'][_0xa3af('0x51')]({'where':{'FromId':[_0x20320e[_0xa3af('0x5d')]['id'],_0x2e8dce[_0x277967]['id']],'ToId':[_0x20320e[_0xa3af('0x5d')]['id'],_0x2e8dce[_0x277967]['id']],'ChatGroupId':null},'attributes':['id','createdAt',_0xa3af('0x6f'),_0xa3af('0x70'),'read','body'],'order':qs[_0xa3af('0x42')](_0xa3af('0x71')),'limit':0x1,'offset':0x0,'raw':!![]})[_0xa3af('0x2b')](wrapUser(_0x2e8dce[_0x277967])));}return BPromise[_0xa3af('0x72')](_0x56ee4c);}return[];})[_0xa3af('0x2b')](function(_0x2f0738){return{'rows':_0x2f0738,'count':_0x2f0738['length']};})[_0xa3af('0x2b')](respondWithResult(_0x1ea190,null))[_0xa3af('0x4d')](handleError(_0x1ea190,null));}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js index bb9e16c..bf84093 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 _0xc6bf=['events','../../mysqldb','ChatInternalMessage','save','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x5240b7,_0x8a64b2){var _0x1a5d16=function(_0x5bf461){while(--_0x5bf461){_0x5240b7['push'](_0x5240b7['shift']());}};_0x1a5d16(++_0x8a64b2);}(_0xc6bf,0x118));var _0xfc6b=function(_0x260b48,_0x117977){_0x260b48=_0x260b48-0x0;var _0x3f730b=_0xc6bf[_0x260b48];return _0x3f730b;};'use strict';var EventEmitter=require(_0xfc6b('0x0'));var ChatInternalMessage=require(_0xfc6b('0x1'))['db'][_0xfc6b('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xfc6b('0x3'),'afterUpdate':_0xfc6b('0x4'),'afterDestroy':_0xfc6b('0x5')};function emitEvent(_0x1ad681){return function(_0x25fac6,_0x2074a6,_0x39ea5b){ChatInternalMessageEvents[_0xfc6b('0x6')](_0x1ad681+':'+_0x25fac6['id'],_0x25fac6);ChatInternalMessageEvents['emit'](_0x1ad681,_0x25fac6);_0x39ea5b(null);};}for(var e in events){if(events[_0xfc6b('0x7')](e)){var event=events[e];ChatInternalMessage[_0xfc6b('0x8')](e,emitEvent(event));}}module[_0xfc6b('0x9')]=ChatInternalMessageEvents; \ No newline at end of file +var _0x573c=['save','update','remove','emit','hook','events','../../mysqldb','setMaxListeners'];(function(_0x5b66b1,_0x3acd9f){var _0x409294=function(_0x52f89d){while(--_0x52f89d){_0x5b66b1['push'](_0x5b66b1['shift']());}};_0x409294(++_0x3acd9f);}(_0x573c,0x125));var _0xc573=function(_0x53c330,_0x1d2f20){_0x53c330=_0x53c330-0x0;var _0x3b30ef=_0x573c[_0x53c330];return _0x3b30ef;};'use strict';var EventEmitter=require(_0xc573('0x0'));var ChatInternalMessage=require(_0xc573('0x1'))['db']['ChatInternalMessage'];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0xc573('0x2')](0x0);var events={'afterCreate':_0xc573('0x3'),'afterUpdate':_0xc573('0x4'),'afterDestroy':_0xc573('0x5')};function emitEvent(_0x2f1e99){return function(_0x33cf1a,_0x5b95dc,_0xb821d1){ChatInternalMessageEvents[_0xc573('0x6')](_0x2f1e99+':'+_0x33cf1a['id'],_0x33cf1a);ChatInternalMessageEvents[_0xc573('0x6')](_0x2f1e99,_0x33cf1a);_0xb821d1(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInternalMessage[_0xc573('0x7')](e,emitEvent(event));}}module['exports']=ChatInternalMessageEvents; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.model.js b/server/api/chatInternalMessage/chatInternalMessage.model.js index d339e6c..b27aca5 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 _0xf592=['define','ChatInternalMessage','chat_internal_messages','utf8mb4_unicode_ci','lodash','util','request-promise','path','../../config/environment','./chatInternalMessage.attributes','exports'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xf592,0x67));var _0x2f59=function(_0x3ffdcc,_0x3ffcc9){_0x3ffdcc=_0x3ffdcc-0x0;var _0x64fcd6=_0xf592[_0x3ffdcc];return _0x64fcd6;};'use strict';var _=require(_0x2f59('0x0'));var util=require(_0x2f59('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x2f59('0x2'));var fs=require('fs');var path=require(_0x2f59('0x3'));var rimraf=require('rimraf');var config=require(_0x2f59('0x4'));var attributes=require(_0x2f59('0x5'));module[_0x2f59('0x6')]=function(_0x1e4d77,_0x2fd84d){return _0x1e4d77[_0x2f59('0x7')](_0x2f59('0x8'),attributes,{'tableName':_0x2f59('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x2f59('0xa')});}; \ No newline at end of file +var _0x3de5=['util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatInternalMessage.attributes','define','ChatInternalMessage','chat_internal_messages','utf8mb4','utf8mb4_unicode_ci','lodash'];(function(_0x19dd76,_0xb6f9bb){var _0x15bcf5=function(_0xc2e13d){while(--_0xc2e13d){_0x19dd76['push'](_0x19dd76['shift']());}};_0x15bcf5(++_0xb6f9bb);}(_0x3de5,0x11c));var _0x53de=function(_0x4cf745,_0x420870){_0x4cf745=_0x4cf745-0x0;var _0x2a7aa6=_0x3de5[_0x4cf745];return _0x2a7aa6;};'use strict';var _=require(_0x53de('0x0'));var util=require(_0x53de('0x1'));var logger=require(_0x53de('0x2'))('api');var moment=require(_0x53de('0x3'));var BPromise=require(_0x53de('0x4'));var rp=require(_0x53de('0x5'));var fs=require('fs');var path=require(_0x53de('0x6'));var rimraf=require(_0x53de('0x7'));var config=require(_0x53de('0x8'));var attributes=require(_0x53de('0x9'));module['exports']=function(_0x4ed372,_0x5bdce3){return _0x4ed372[_0x53de('0xa')](_0x53de('0xb'),attributes,{'tableName':_0x53de('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x53de('0xd'),'collate':_0x53de('0xe')});}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js index dcc2446..87a2202 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 _0x577e=['client','defaults','redis','socket.io-emitter','./chatInternalMessage.socket','register','request','then','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment'];(function(_0x3dc6f4,_0x362e2a){var _0x3b18e9=function(_0x5bf19e){while(--_0x5bf19e){_0x3dc6f4['push'](_0x3dc6f4['shift']());}};_0x3b18e9(++_0x362e2a);}(_0x577e,0x9a));var _0xe577=function(_0x3fe042,_0x1106f7){_0x3fe042=_0x3fe042-0x0;var _0x7d4a1f=_0x577e[_0x3fe042];return _0x7d4a1f;};'use strict';var _=require('lodash');var util=require(_0xe577('0x0'));var moment=require('moment');var BPromise=require(_0xe577('0x1'));var rs=require(_0xe577('0x2'));var fs=require('fs');var Redis=require(_0xe577('0x3'));var db=require(_0xe577('0x4'))['db'];var utils=require(_0xe577('0x5'));var logger=require('../../config/logger')(_0xe577('0x6'));var config=require(_0xe577('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xe577('0x8')]['http']({'port':0x232a});config['redis']=_[_0xe577('0x9')](config[_0xe577('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0xe577('0xb'))(new Redis(config[_0xe577('0xa')]));require(_0xe577('0xc'))[_0xe577('0xd')](socket);function respondWithRpcPromise(_0x5ea707,_0x474a64,_0x43e663){return new BPromise(function(_0x4f4e92,_0x247427){return client[_0xe577('0xe')](_0x5ea707,_0x43e663)[_0xe577('0xf')](function(_0x55f6d0){logger['info'](_0xe577('0x10'),_0x474a64,_0xe577('0x11'));logger[_0xe577('0x12')](_0xe577('0x13'),_0x474a64,_0xe577('0x11'),JSON[_0xe577('0x14')](_0x55f6d0));if(_0x55f6d0[_0xe577('0x15')]){if(_0x55f6d0[_0xe577('0x15')][_0xe577('0x16')]===0x1f4){logger[_0xe577('0x15')](_0xe577('0x10'),_0x474a64,_0x55f6d0['error'][_0xe577('0x17')]);return _0x247427(_0x55f6d0[_0xe577('0x15')]['message']);}logger[_0xe577('0x15')](_0xe577('0x10'),_0x474a64,_0x55f6d0[_0xe577('0x15')][_0xe577('0x17')]);return _0x4f4e92(_0x55f6d0[_0xe577('0x15')][_0xe577('0x17')]);}else{logger[_0xe577('0x18')](_0xe577('0x10'),_0x474a64,_0xe577('0x11'));_0x4f4e92(_0x55f6d0[_0xe577('0x19')][_0xe577('0x17')]);}})[_0xe577('0x1a')](function(_0xdbf8c5){logger['error'](_0xe577('0x10'),_0x474a64,_0xdbf8c5);_0x247427(_0xdbf8c5);});});} \ No newline at end of file +var _0x6c50=['catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','jayson/promise','client','http','redis','defaults','socket.io-emitter','register','request','info','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','error','code','message','result'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x6c50,0xe2));var _0x06c5=function(_0x5440d9,_0x3c8420){_0x5440d9=_0x5440d9-0x0;var _0x1f8184=_0x6c50[_0x5440d9];return _0x1f8184;};'use strict';var _=require(_0x06c5('0x0'));var util=require('util');var moment=require(_0x06c5('0x1'));var BPromise=require(_0x06c5('0x2'));var rs=require(_0x06c5('0x3'));var fs=require('fs');var Redis=require(_0x06c5('0x4'));var db=require(_0x06c5('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x06c5('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x06c5('0x7'));var client=jayson[_0x06c5('0x8')][_0x06c5('0x9')]({'port':0x232a});config[_0x06c5('0xa')]=_[_0x06c5('0xb')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x06c5('0xc'))(new Redis(config['redis']));require('./chatInternalMessage.socket')[_0x06c5('0xd')](socket);function respondWithRpcPromise(_0x24531c,_0x3c2ca0,_0x960b24){return new BPromise(function(_0x40cab7,_0x163455){return client[_0x06c5('0xe')](_0x24531c,_0x960b24)['then'](function(_0x4e1d94){logger[_0x06c5('0xf')](_0x06c5('0x10'),_0x3c2ca0,_0x06c5('0x11'));logger[_0x06c5('0x12')](_0x06c5('0x13'),_0x3c2ca0,_0x06c5('0x11'),JSON['stringify'](_0x4e1d94));if(_0x4e1d94['error']){if(_0x4e1d94[_0x06c5('0x14')][_0x06c5('0x15')]===0x1f4){logger[_0x06c5('0x14')]('ChatInternalMessage,\x20%s,\x20%s',_0x3c2ca0,_0x4e1d94['error'][_0x06c5('0x16')]);return _0x163455(_0x4e1d94[_0x06c5('0x14')]['message']);}logger[_0x06c5('0x14')](_0x06c5('0x10'),_0x3c2ca0,_0x4e1d94[_0x06c5('0x14')][_0x06c5('0x16')]);return _0x40cab7(_0x4e1d94[_0x06c5('0x14')][_0x06c5('0x16')]);}else{logger[_0x06c5('0xf')](_0x06c5('0x10'),_0x3c2ca0,_0x06c5('0x11'));_0x40cab7(_0x4e1d94[_0x06c5('0x17')][_0x06c5('0x16')]);}})[_0x06c5('0x18')](function(_0x42a29b){logger[_0x06c5('0x14')]('ChatInternalMessage,\x20%s,\x20%s',_0x3c2ca0,_0x42a29b);_0x163455(_0x42a29b);});});} \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js index 9b43870..fd32b50 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 _0x8ab7=['chatInternalMessage:','save','remove','update','emit','removeListener','register','length'];(function(_0x322a11,_0x579bc7){var _0x3b6372=function(_0x20f87a){while(--_0x20f87a){_0x322a11['push'](_0x322a11['shift']());}};_0x3b6372(++_0x579bc7);}(_0x8ab7,0x1c9));var _0x78ab=function(_0x400944,_0x1697df){_0x400944=_0x400944-0x0;var _0x40083c=_0x8ab7[_0x400944];return _0x40083c;};'use strict';var ChatInternalMessageEvents=require('./chatInternalMessage.events');var events=[_0x78ab('0x0'),_0x78ab('0x1'),_0x78ab('0x2')];function createListener(_0x2df218,_0x5291b7){return function(_0x3ef27b){_0x5291b7[_0x78ab('0x3')](_0x2df218,_0x3ef27b);};}function removeListener(_0x4892e2,_0x4d7ee3){return function(){ChatInternalMessageEvents[_0x78ab('0x4')](_0x4892e2,_0x4d7ee3);};}exports[_0x78ab('0x5')]=function(_0x4e0bcd){for(var _0x5563ff=0x0,_0x27364e=events[_0x78ab('0x6')];_0x5563ff<_0x27364e;_0x5563ff++){var _0x4affed=events[_0x5563ff];var _0x1d54c0=createListener(_0x78ab('0x7')+_0x4affed,_0x4e0bcd);ChatInternalMessageEvents['on'](_0x4affed,_0x1d54c0);}}; \ No newline at end of file +var _0xb9ff=['save','remove','update','emit','removeListener','register'];(function(_0x31e29a,_0x349c9b){var _0x32d892=function(_0x41cc86){while(--_0x41cc86){_0x31e29a['push'](_0x31e29a['shift']());}};_0x32d892(++_0x349c9b);}(_0xb9ff,0xcc));var _0xfb9f=function(_0x47b7a1,_0xcb3ccf){_0x47b7a1=_0x47b7a1-0x0;var _0x2fa61a=_0xb9ff[_0x47b7a1];return _0x2fa61a;};'use strict';var ChatInternalMessageEvents=require('./chatInternalMessage.events');var events=[_0xfb9f('0x0'),_0xfb9f('0x1'),_0xfb9f('0x2')];function createListener(_0x3b227b,_0x449a60){return function(_0xb2241e){_0x449a60[_0xfb9f('0x3')](_0x3b227b,_0xb2241e);};}function removeListener(_0x256edd,_0x161b27){return function(){ChatInternalMessageEvents[_0xfb9f('0x4')](_0x256edd,_0x161b27);};}exports[_0xfb9f('0x5')]=function(_0x147496){for(var _0x186009=0x0,_0x131cf1=events['length'];_0x186009<_0x131cf1;_0x186009++){var _0x528d30=events[_0x186009];var _0x5eb285=createListener('chatInternalMessage:'+_0x528d30,_0x147496);ChatInternalMessageEvents['on'](_0x528d30,_0x5eb285);}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js index 993fe65..0e4e37e 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 _0x48d0=['isAuthenticated','/describe','describe','/users','getUsers','/:id','show','post','create','delete','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./chatInternalMessage.controller','get'];(function(_0x1ac41b,_0x4100af){var _0x5bcb09=function(_0x2c559){while(--_0x2c559){_0x1ac41b['push'](_0x1ac41b['shift']());}};_0x5bcb09(++_0x4100af);}(_0x48d0,0xd3));var _0x048d=function(_0x297072,_0x528b3d){_0x297072=_0x297072-0x0;var _0x354d12=_0x48d0[_0x297072];return _0x354d12;};'use strict';var multer=require(_0x048d('0x0'));var util=require(_0x048d('0x1'));var path=require('path');var timeout=require(_0x048d('0x2'));var express=require(_0x048d('0x3'));var router=express[_0x048d('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x048d('0x5'));var interaction=require(_0x048d('0x6'));var config=require('../../config/environment');var controller=require(_0x048d('0x7'));router[_0x048d('0x8')]('/',auth[_0x048d('0x9')](),controller['index']);router[_0x048d('0x8')](_0x048d('0xa'),auth['isAuthenticated'](),controller[_0x048d('0xb')]);router[_0x048d('0x8')](_0x048d('0xc'),auth[_0x048d('0x9')](),controller[_0x048d('0xd')]);router[_0x048d('0x8')](_0x048d('0xe'),auth[_0x048d('0x9')](),controller[_0x048d('0xf')]);router[_0x048d('0x10')]('/',auth[_0x048d('0x9')](),controller[_0x048d('0x11')]);router['put'](_0x048d('0xe'),controller['update']);router[_0x048d('0x12')](_0x048d('0xe'),auth[_0x048d('0x9')](),controller['destroy']);module[_0x048d('0x13')]=router; \ No newline at end of file +var _0x8d5c=['describe','/users','/:id','show','create','put','update','delete','destroy','exports','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated'];(function(_0x1aba9c,_0xfad763){var _0x93e8bf=function(_0x538fbb){while(--_0x538fbb){_0x1aba9c['push'](_0x1aba9c['shift']());}};_0x93e8bf(++_0xfad763);}(_0x8d5c,0x114));var _0xc8d5=function(_0x2f5a22,_0x5e9f03){_0x2f5a22=_0x2f5a22-0x0;var _0x326b70=_0x8d5c[_0x2f5a22];return _0x326b70;};'use strict';var multer=require('multer');var util=require(_0xc8d5('0x0'));var path=require('path');var timeout=require(_0xc8d5('0x1'));var express=require(_0xc8d5('0x2'));var router=express[_0xc8d5('0x3')]();var fs_extra=require(_0xc8d5('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xc8d5('0x5'));var config=require(_0xc8d5('0x6'));var controller=require('./chatInternalMessage.controller');router[_0xc8d5('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0xc8d5('0x7')]('/describe',auth[_0xc8d5('0x8')](),controller[_0xc8d5('0x9')]);router[_0xc8d5('0x7')](_0xc8d5('0xa'),auth[_0xc8d5('0x8')](),controller['getUsers']);router[_0xc8d5('0x7')](_0xc8d5('0xb'),auth[_0xc8d5('0x8')](),controller[_0xc8d5('0xc')]);router['post']('/',auth[_0xc8d5('0x8')](),controller[_0xc8d5('0xd')]);router[_0xc8d5('0xe')](_0xc8d5('0xb'),controller[_0xc8d5('0xf')]);router[_0xc8d5('0x10')]('/:id',auth[_0xc8d5('0x8')](),controller[_0xc8d5('0x11')]);module[_0xc8d5('0x12')]=router; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.attributes.js b/server/api/chatMessage/chatMessage.attributes.js index b4888cd..9384810 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 _0xfe9d=['sequelize','exports','TEXT','medium','BOOLEAN','ENUM','out','DATE','STRING'];(function(_0x449607,_0x287561){var _0x972d5=function(_0x222241){while(--_0x222241){_0x449607['push'](_0x449607['shift']());}};_0x972d5(++_0x287561);}(_0xfe9d,0x10e));var _0xdfe9=function(_0x2acbaa,_0x3ddd5f){_0x2acbaa=_0x2acbaa-0x0;var _0x36841c=_0xfe9d[_0x2acbaa];return _0x36841c;};'use strict';var Sequelize=require(_0xdfe9('0x0'));module[_0xdfe9('0x1')]={'body':{'type':Sequelize[_0xdfe9('0x2')](_0xdfe9('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0xdfe9('0x4')],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0xdfe9('0x5')]('in','out'),'defaultValue':_0xdfe9('0x6'),'allowNull':![]},'readAt':{'type':Sequelize[_0xdfe9('0x7')]},'providerName':{'type':Sequelize[_0xdfe9('0x8')]},'providerResponse':{'type':Sequelize[_0xdfe9('0x2')]}}; \ No newline at end of file +var _0xdf92=['out','DATE','STRING','TEXT','sequelize','medium','BOOLEAN','ENUM'];(function(_0x21eb1b,_0x6996c1){var _0x4b8a27=function(_0x2dacc4){while(--_0x2dacc4){_0x21eb1b['push'](_0x21eb1b['shift']());}};_0x4b8a27(++_0x6996c1);}(_0xdf92,0x10c));var _0x2df9=function(_0x437331,_0x14532e){_0x437331=_0x437331-0x0;var _0x9f55c4=_0xdf92[_0x437331];return _0x9f55c4;};'use strict';var Sequelize=require(_0x2df9('0x0'));module['exports']={'body':{'type':Sequelize['TEXT'](_0x2df9('0x1')),'allowNull':![]},'read':{'type':Sequelize[_0x2df9('0x2')],'defaultValue':![]},'secret':{'type':Sequelize[_0x2df9('0x2')],'defaultValue':![]},'direction':{'type':Sequelize[_0x2df9('0x3')]('in',_0x2df9('0x4')),'defaultValue':_0x2df9('0x4'),'allowNull':![]},'readAt':{'type':Sequelize[_0x2df9('0x5')]},'providerName':{'type':Sequelize[_0x2df9('0x6')]},'providerResponse':{'type':Sequelize[_0x2df9('0x7')]}}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js index 6ad86a2..843f575 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 _0xeb92=['Content-Range','apply','save','update','end','stack','name','send','index','map','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','ChatMessage','count','includeAll','include','rows','show','rawAttributes','options','create','body','find','destroy','params','describe','chat-interactions','accept','chat','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','ChatInteraction','ChatInteractionId','read1stAt','interaction','info','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','Sequelize','QueryTypes','contact','fullname','email','internal','manual','interface','SIP/%s','channel','motionChannel','EventManager','acceptmessage','parse','formData','reject','null','RejectMessage','rejectMessage','ContactId','User','event','rejectmessage','eml-format','rimraf','zip-dir','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./chatMessage.socket','register','jayson/promise','client','http','request','then','ChatMessage,\x20%s,\x20%s','debug','request\x20sent','error','code','message','catch','sendStatus','status','json','offset','undefined','limit','set'];(function(_0x1b5404,_0x177d01){var _0x23a5e7=function(_0xcbda9e){while(--_0xcbda9e){_0x1b5404['push'](_0x1b5404['shift']());}};_0x23a5e7(++_0x177d01);}(_0xeb92,0x166));var _0x2eb9=function(_0xda5392,_0x3ac59e){_0xda5392=_0xda5392-0x0;var _0x2b08c0=_0xeb92[_0xda5392];return _0x2b08c0;};'use strict';var emlformat=require(_0x2eb9('0x0'));var rimraf=require(_0x2eb9('0x1'));var zipdir=require(_0x2eb9('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x2eb9('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x2eb9('0x4'));var util=require(_0x2eb9('0x5'));var path=require(_0x2eb9('0x6'));var sox=require(_0x2eb9('0x7'));var csv=require(_0x2eb9('0x8'));var ejs=require(_0x2eb9('0x9'));var fs=require('fs');var fs_extra=require(_0x2eb9('0xa'));var _=require(_0x2eb9('0xb'));var squel=require(_0x2eb9('0xc'));var crypto=require('crypto');var jsforce=require(_0x2eb9('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x2eb9('0x8'));var querystring=require('querystring');var Papa=require(_0x2eb9('0xe'));var Redis=require(_0x2eb9('0xf'));var authService=require(_0x2eb9('0x10'));var qs=require(_0x2eb9('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2eb9('0x12'));var logger=require(_0x2eb9('0x13'))(_0x2eb9('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x2eb9('0x15'));var db=require('../../mysqldb')['db'];config[_0x2eb9('0x16')]=_[_0x2eb9('0x17')](config['redis'],{'host':_0x2eb9('0x18'),'port':0x18eb});var socket=require(_0x2eb9('0x19'))(new Redis(config['redis']));require(_0x2eb9('0x1a'))[_0x2eb9('0x1b')](socket);var jayson=require(_0x2eb9('0x1c'));var client=jayson[_0x2eb9('0x1d')][_0x2eb9('0x1e')]({'port':0x232c});var client9002=jayson[_0x2eb9('0x1d')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2f29cd,_0x561a25,_0x2858b1,_0x13769c){return new BPromise(function(_0x5ea3e9,_0x31f76b){var _0x35e454=_0x13769c||client;return _0x35e454[_0x2eb9('0x1f')](_0x2f29cd,_0x2858b1)[_0x2eb9('0x20')](function(_0xb80132){logger['info'](_0x2eb9('0x21'),_0x561a25,'request\x20sent');logger[_0x2eb9('0x22')]('ChatMessage,\x20%s,\x20%s,\x20%s',_0x561a25,_0x2eb9('0x23'),JSON['stringify'](_0xb80132));if(_0xb80132[_0x2eb9('0x24')]){if(_0xb80132[_0x2eb9('0x24')][_0x2eb9('0x25')]===0x1f4){logger[_0x2eb9('0x24')](_0x2eb9('0x21'),_0x561a25,_0xb80132['error'][_0x2eb9('0x26')]);return _0x31f76b(_0xb80132[_0x2eb9('0x24')]['message']);}logger[_0x2eb9('0x24')](_0x2eb9('0x21'),_0x561a25,_0xb80132[_0x2eb9('0x24')][_0x2eb9('0x26')]);return _0x5ea3e9(_0xb80132[_0x2eb9('0x24')][_0x2eb9('0x26')]);}else{logger['info']('ChatMessage,\x20%s,\x20%s',_0x561a25,'request\x20sent');_0x5ea3e9(_0xb80132['result'][_0x2eb9('0x26')]);}})[_0x2eb9('0x27')](function(_0x276047){logger[_0x2eb9('0x24')]('ChatMessage,\x20%s,\x20%s',_0x561a25,_0x276047);_0x31f76b(_0x276047);});});}function respondWithStatusCode(_0x100f88,_0x8ae4a4){_0x8ae4a4=_0x8ae4a4||0xcc;return function(_0x3b74a0){if(_0x3b74a0){return _0x100f88[_0x2eb9('0x28')](_0x8ae4a4);}return _0x100f88[_0x2eb9('0x29')](_0x8ae4a4)['end']();};}function respondWithResult(_0x442a4a,_0x58e0b3){_0x58e0b3=_0x58e0b3||0xc8;return function(_0x19e494){if(_0x19e494){return _0x442a4a['status'](_0x58e0b3)[_0x2eb9('0x2a')](_0x19e494);}};}function respondWithFilteredResult(_0x5c0027,_0x2d9f30){return function(_0x5b4e88){if(_0x5b4e88){var _0x5357a3=typeof _0x2d9f30[_0x2eb9('0x2b')]===_0x2eb9('0x2c')&&typeof _0x2d9f30['limit']===_0x2eb9('0x2c');var _0x5c7aac=_0x5b4e88['count'];var _0x545239=_0x5357a3?0x0:_0x2d9f30[_0x2eb9('0x2b')];var _0x768bc6=_0x5357a3?_0x5b4e88['count']:_0x2d9f30[_0x2eb9('0x2b')]+_0x2d9f30[_0x2eb9('0x2d')];var _0x424cf9;if(_0x768bc6>=_0x5c7aac){_0x768bc6=_0x5c7aac;_0x424cf9=0xc8;}else{_0x424cf9=0xce;}_0x5c0027['status'](_0x424cf9);return _0x5c0027[_0x2eb9('0x2e')](_0x2eb9('0x2f'),_0x545239+'-'+_0x768bc6+'/'+_0x5c7aac)[_0x2eb9('0x2a')](_0x5b4e88);}return null;};}function patchUpdates(_0x19a2ab){return function(_0xfbba59){try{jsonpatch[_0x2eb9('0x30')](_0xfbba59,_0x19a2ab,!![]);}catch(_0x169573){return BPromise['reject'](_0x169573);}return _0xfbba59[_0x2eb9('0x31')]();};}function saveUpdates(_0x33eb18,_0x204ae4){return function(_0x3c2d2a){if(_0x3c2d2a){return _0x3c2d2a[_0x2eb9('0x32')](_0x33eb18)['then'](function(_0x5a283e){return _0x5a283e;});}return null;};}function removeEntity(_0x3631e3,_0x363ccb){return function(_0x4b4508){if(_0x4b4508){return _0x4b4508['destroy']()['then'](function(){_0x3631e3[_0x2eb9('0x29')](0xcc)[_0x2eb9('0x33')]();});}};}function handleEntityNotFound(_0x28932b,_0x5f0ac7){return function(_0x222052){if(!_0x222052){_0x28932b[_0x2eb9('0x28')](0x194);}return _0x222052;};}function handleError(_0x210e98,_0x14a847){_0x14a847=_0x14a847||0x1f4;return function(_0x45aa37){logger[_0x2eb9('0x24')](_0x45aa37[_0x2eb9('0x34')]);if(_0x45aa37['name']){delete _0x45aa37[_0x2eb9('0x35')];}_0x210e98['status'](_0x14a847)[_0x2eb9('0x36')](_0x45aa37);};}exports[_0x2eb9('0x37')]=function(_0x1749cd,_0x5bda24){var _0x446855={},_0x2fda3a={},_0x3b771c={'count':0x0,'rows':[]};var _0x3cb4ea=_[_0x2eb9('0x38')](db['ChatMessage']['rawAttributes'],function(_0x279598){return{'name':_0x279598[_0x2eb9('0x39')],'type':_0x279598[_0x2eb9('0x3a')][_0x2eb9('0x3b')]};});_0x2fda3a[_0x2eb9('0x3c')]=_[_0x2eb9('0x38')](_0x3cb4ea,_0x2eb9('0x35'));_0x2fda3a[_0x2eb9('0x3d')]=_[_0x2eb9('0x3e')](_0x1749cd[_0x2eb9('0x3d')]);_0x2fda3a[_0x2eb9('0x3f')]=_['intersection'](_0x2fda3a[_0x2eb9('0x3c')],_0x2fda3a['query']);_0x446855[_0x2eb9('0x40')]=_[_0x2eb9('0x41')](_0x2fda3a[_0x2eb9('0x3c')],qs[_0x2eb9('0x42')](_0x1749cd['query'][_0x2eb9('0x42')]));_0x446855[_0x2eb9('0x40')]=_0x446855[_0x2eb9('0x40')][_0x2eb9('0x43')]?_0x446855[_0x2eb9('0x40')]:_0x2fda3a[_0x2eb9('0x3c')];if(!_0x1749cd[_0x2eb9('0x3d')][_0x2eb9('0x44')](_0x2eb9('0x45'))){_0x446855['limit']=qs[_0x2eb9('0x2d')](_0x1749cd[_0x2eb9('0x3d')][_0x2eb9('0x2d')]);_0x446855[_0x2eb9('0x2b')]=qs[_0x2eb9('0x2b')](_0x1749cd[_0x2eb9('0x3d')][_0x2eb9('0x2b')]);}_0x446855[_0x2eb9('0x46')]=qs[_0x2eb9('0x47')](_0x1749cd[_0x2eb9('0x3d')]['sort']);_0x446855['where']=qs[_0x2eb9('0x3f')](_[_0x2eb9('0x48')](_0x1749cd['query'],_0x2fda3a[_0x2eb9('0x3f')]),_0x3cb4ea);if(_0x1749cd[_0x2eb9('0x3d')][_0x2eb9('0x49')]){_0x446855[_0x2eb9('0x4a')]=_[_0x2eb9('0x4b')](_0x446855[_0x2eb9('0x4a')],{'$or':_[_0x2eb9('0x38')](_0x3cb4ea,function(_0xa43787){if(_0xa43787['type']!==_0x2eb9('0x4c')){var _0x650816={};_0x650816[_0xa43787['name']]={'$like':'%'+_0x1749cd[_0x2eb9('0x3d')]['filter']+'%'};return _0x650816;}})});}_0x446855=_[_0x2eb9('0x4b')]({},_0x446855,_0x1749cd['options']);var _0x4d386c={'where':_0x446855['where']};return db[_0x2eb9('0x4d')]['count'](_0x4d386c)[_0x2eb9('0x20')](function(_0x24dbb5){_0x3b771c[_0x2eb9('0x4e')]=_0x24dbb5;if(_0x1749cd[_0x2eb9('0x3d')][_0x2eb9('0x4f')]){_0x446855[_0x2eb9('0x50')]=[{'all':!![]}];}return db[_0x2eb9('0x4d')]['findAll'](_0x446855);})['then'](function(_0x41cf55){_0x3b771c[_0x2eb9('0x51')]=_0x41cf55;return _0x3b771c;})[_0x2eb9('0x20')](respondWithFilteredResult(_0x5bda24,_0x446855))[_0x2eb9('0x27')](handleError(_0x5bda24,null));};exports[_0x2eb9('0x52')]=function(_0x49014a,_0x1f2fea){var _0x323d8e={'raw':!![],'where':{'id':_0x49014a['params']['id']}},_0x4a49c2={};_0x4a49c2[_0x2eb9('0x3c')]=_[_0x2eb9('0x3e')](db[_0x2eb9('0x4d')][_0x2eb9('0x53')]);_0x4a49c2[_0x2eb9('0x3d')]=_[_0x2eb9('0x3e')](_0x49014a[_0x2eb9('0x3d')]);_0x4a49c2[_0x2eb9('0x3f')]=_[_0x2eb9('0x41')](_0x4a49c2[_0x2eb9('0x3c')],_0x4a49c2[_0x2eb9('0x3d')]);_0x323d8e['attributes']=_[_0x2eb9('0x41')](_0x4a49c2[_0x2eb9('0x3c')],qs[_0x2eb9('0x42')](_0x49014a['query']['fields']));_0x323d8e[_0x2eb9('0x40')]=_0x323d8e[_0x2eb9('0x40')][_0x2eb9('0x43')]?_0x323d8e[_0x2eb9('0x40')]:_0x4a49c2[_0x2eb9('0x3c')];if(_0x49014a[_0x2eb9('0x3d')][_0x2eb9('0x4f')]){_0x323d8e['include']=[{'all':!![]}];}_0x323d8e=_[_0x2eb9('0x4b')]({},_0x323d8e,_0x49014a[_0x2eb9('0x54')]);return db['ChatMessage']['find'](_0x323d8e)[_0x2eb9('0x20')](handleEntityNotFound(_0x1f2fea,null))['then'](respondWithResult(_0x1f2fea,null))[_0x2eb9('0x27')](handleError(_0x1f2fea,null));};exports['create']=function(_0x4ceb7a,_0x48c039){return db[_0x2eb9('0x4d')][_0x2eb9('0x55')](_0x4ceb7a['body'],{})[_0x2eb9('0x20')](respondWithResult(_0x48c039,0xc9))[_0x2eb9('0x27')](handleError(_0x48c039,null));};exports[_0x2eb9('0x32')]=function(_0x3908b2,_0x51a972){if(_0x3908b2['body']['id']){delete _0x3908b2[_0x2eb9('0x56')]['id'];}return db['ChatMessage'][_0x2eb9('0x57')]({'where':{'id':_0x3908b2['params']['id']}})[_0x2eb9('0x20')](handleEntityNotFound(_0x51a972,null))[_0x2eb9('0x20')](saveUpdates(_0x3908b2[_0x2eb9('0x56')],null))['then'](respondWithResult(_0x51a972,null))[_0x2eb9('0x27')](handleError(_0x51a972,null));};exports[_0x2eb9('0x58')]=function(_0x26e8c3,_0x9bf206){return db[_0x2eb9('0x4d')]['find']({'where':{'id':_0x26e8c3[_0x2eb9('0x59')]['id']}})[_0x2eb9('0x20')](handleEntityNotFound(_0x9bf206,null))[_0x2eb9('0x20')](removeEntity(_0x9bf206,null))[_0x2eb9('0x27')](handleError(_0x9bf206,null));};exports[_0x2eb9('0x5a')]=function(_0x23a1f0,_0x53d895){return db['ChatMessage']['describe']()[_0x2eb9('0x20')](respondWithResult(_0x53d895,null))[_0x2eb9('0x27')](handleError(_0x53d895,null));};var interaction_log=require(_0x2eb9('0x13'))(_0x2eb9('0x5b'));exports[_0x2eb9('0x5c')]=function(_0x1cf5ec,_0xb71419,_0x1f9d5b){var _0xfc41a4={'agent':{},'channel':_0x2eb9('0x5d')};if(_0x1cf5ec[_0x2eb9('0x56')]['id']){delete _0x1cf5ec[_0x2eb9('0x56')]['id'];}_0x1cf5ec['body'][_0x2eb9('0x5e')]=!![];_0x1cf5ec[_0x2eb9('0x56')][_0x2eb9('0x5f')]=moment()[_0x2eb9('0x60')](_0x2eb9('0x61'));_0x1cf5ec[_0x2eb9('0x56')][_0x2eb9('0x62')]=_0x1cf5ec[_0x2eb9('0x56')]['UserId']||_0x1cf5ec[_0x2eb9('0x63')]['id'];_0xfc41a4[_0x2eb9('0x64')]['id']=_0x1cf5ec[_0x2eb9('0x56')][_0x2eb9('0x62')];return db['ChatMessage'][_0x2eb9('0x57')]({'where':{'id':_0x1cf5ec[_0x2eb9('0x59')]['id'],'UserId':null}})[_0x2eb9('0x20')](handleEntityNotFound(_0xb71419,null))[_0x2eb9('0x20')](saveUpdates(_0x1cf5ec['body'],null))[_0x2eb9('0x20')](function(_0xfdbfe9){if(_0xfdbfe9){_0xfc41a4[_0x2eb9('0x26')]=_0xfdbfe9[_0x2eb9('0x65')]({'plain':!![]});return db[_0x2eb9('0x66')][_0x2eb9('0x57')]({'where':{'id':_0xfdbfe9[_0x2eb9('0x67')]}});}return null;})[_0x2eb9('0x20')](handleEntityNotFound(_0xb71419,null))[_0x2eb9('0x20')](function(_0x17c78a){if(_0x17c78a){return _0x17c78a[_0x2eb9('0x32')]({'UserId':_0x1cf5ec['body'][_0x2eb9('0x62')],'read1stAt':_['isNil'](_0x17c78a[_0x2eb9('0x68')])?moment()[_0x2eb9('0x60')](_0x2eb9('0x61')):undefined});}return null;})[_0x2eb9('0x20')](function(_0x59887f){if(_0x59887f){_0xfc41a4[_0x2eb9('0x69')]=_0x59887f[_0x2eb9('0x65')]({'plain':!![]});interaction_log[_0x2eb9('0x6a')](_0x2eb9('0x6b'),_0x1cf5ec[_0x2eb9('0x63')]['id'],_0x1cf5ec[_0x2eb9('0x63')][_0x2eb9('0x35')],_0x1cf5ec['user'][_0x2eb9('0x6c')],_0xfc41a4[_0x2eb9('0x69')]['id'],_0x1cf5ec[_0x2eb9('0x56')]?JSON['stringify'](_0x1cf5ec[_0x2eb9('0x56')]):'null');return respondWithRpcPromise('AcceptMessage',_0x2eb9('0x6d'),_0xfc41a4);}return null;})[_0x2eb9('0x20')](function(_0x4a3b38){var _0x42372f=_0x2eb9('0x6e')+_0x4a3b38[_0x2eb9('0x26')]['ContactId'];return db[_0x2eb9('0x6f')][_0x2eb9('0x3d')](_0x42372f,{'type':db[_0x2eb9('0x70')][_0x2eb9('0x71')]['SELECT'],'raw':!![]})[_0x2eb9('0x20')](function(_0x4fd82c){return _0x4fd82c;});})[_0x2eb9('0x20')](function(_0x304d51){if(_0x304d51){_0xfc41a4[_0x2eb9('0x26')][_0x2eb9('0x72')]=_0x304d51[0x0];if(!_0x1cf5ec[_0x2eb9('0x56')][_0x2eb9('0x62')])return;return db['User'][_0x2eb9('0x57')]({'where':{'id':_0x1cf5ec['body'][_0x2eb9('0x62')],'role':'agent'},'attributes':['id',_0x2eb9('0x35'),_0x2eb9('0x73'),_0x2eb9('0x74'),_0x2eb9('0x75')],'raw':!![]});}return null;})[_0x2eb9('0x20')](function(_0x35eab5){if(!_0x35eab5)return null;_0xfc41a4[_0x2eb9('0x26')][_0x2eb9('0x64')]=_0x35eab5;return _0xfc41a4;})[_0x2eb9('0x20')](function(_0x180ccb){if(_0x180ccb){if(_0x1cf5ec[_0x2eb9('0x56')][_0x2eb9('0x76')]){_0xfc41a4['message'][_0x2eb9('0x77')]=util[_0x2eb9('0x60')](_0x2eb9('0x78'),_0x1cf5ec['user'][_0x2eb9('0x35')]);_0xfc41a4[_0x2eb9('0x26')][_0x2eb9('0x79')]=_0xfc41a4[_0x2eb9('0x79')];_0xfc41a4[_0x2eb9('0x26')][_0x2eb9('0x7a')]=_0xfc41a4[_0x2eb9('0x79')];_0xfc41a4[_0x2eb9('0x26')]['event']=_0x2eb9('0x5c');return respondWithRpcPromise(_0x2eb9('0x7b'),'EventManager',{'event':_0x2eb9('0x7c'),'message':_['merge'](_0xfc41a4['message'],JSON[_0x2eb9('0x7d')](_0xfc41a4[_0x2eb9('0x69')][_0x2eb9('0x7e')]))},client9002)[_0x2eb9('0x20')](function(){return _0xfc41a4;});}return _0xfc41a4;}return null;})[_0x2eb9('0x20')](respondWithResult(_0xb71419,null))['catch'](handleError(_0xb71419,null));};var interaction_log=require(_0x2eb9('0x13'))(_0x2eb9('0x5b'));exports[_0x2eb9('0x7f')]=function(_0x2eeea8,_0x4ecd56,_0x340d6a){var _0x3cc636={'agent':{},'channel':'chat'};if(_0x2eeea8[_0x2eb9('0x56')]['id']){delete _0x2eeea8['body']['id'];}_0x2eeea8['body'][_0x2eb9('0x62')]=_0x2eeea8[_0x2eb9('0x56')][_0x2eb9('0x62')]||_0x2eeea8[_0x2eb9('0x63')]['id'];_0x3cc636['agent']['id']=_0x2eeea8['body'][_0x2eb9('0x62')];return db[_0x2eb9('0x4d')][_0x2eb9('0x57')]({'where':{'id':_0x2eeea8['params']['id'],'UserId':null}})[_0x2eb9('0x20')](handleEntityNotFound(_0x4ecd56,null))[_0x2eb9('0x20')](function(_0x34e054){if(_0x34e054){_0x3cc636[_0x2eb9('0x26')]=_0x34e054[_0x2eb9('0x65')]({'plain':!![]});return db[_0x2eb9('0x66')]['find']({'where':{'id':_0x34e054['ChatInteractionId']}});}return null;})[_0x2eb9('0x20')](handleEntityNotFound(_0x4ecd56,null))[_0x2eb9('0x20')](function(_0x2af1fd){if(_0x2af1fd){_0x3cc636['interaction']=_0x2af1fd['get']({'plain':!![]});interaction_log[_0x2eb9('0x6a')]('[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x2eeea8[_0x2eb9('0x63')]['id'],_0x2eeea8[_0x2eb9('0x63')][_0x2eb9('0x35')],_0x2eeea8[_0x2eb9('0x63')][_0x2eb9('0x6c')],_0x3cc636[_0x2eb9('0x69')]['id'],_0x2eeea8[_0x2eb9('0x56')]?JSON['stringify'](_0x2eeea8[_0x2eb9('0x56')]):_0x2eb9('0x80'));return respondWithRpcPromise(_0x2eb9('0x81'),_0x2eb9('0x82'),_0x3cc636);}return null;})[_0x2eb9('0x20')](function(_0xa9a834){var _0x1675b6=_0x2eb9('0x6e')+_0xa9a834['message'][_0x2eb9('0x83')];return db[_0x2eb9('0x6f')][_0x2eb9('0x3d')](_0x1675b6,{'type':db[_0x2eb9('0x70')]['QueryTypes']['SELECT'],'raw':!![]})[_0x2eb9('0x20')](function(_0x3c372d){return _0x3c372d;});})[_0x2eb9('0x20')](function(_0x465599){if(_0x465599){_0x3cc636[_0x2eb9('0x26')][_0x2eb9('0x72')]=_0x465599[0x0];if(!_0x2eeea8[_0x2eb9('0x56')][_0x2eb9('0x62')])return;return db[_0x2eb9('0x84')][_0x2eb9('0x57')]({'where':{'id':_0x2eeea8[_0x2eb9('0x56')][_0x2eb9('0x62')],'role':_0x2eb9('0x64')},'attributes':['id',_0x2eb9('0x35'),_0x2eb9('0x73'),_0x2eb9('0x74'),_0x2eb9('0x75')],'raw':!![]});}return null;})[_0x2eb9('0x20')](function(_0x46ebf9){if(!_0x46ebf9)return null;_0x3cc636[_0x2eb9('0x26')][_0x2eb9('0x64')]=_0x46ebf9;return _0x3cc636;})['then'](function(_0xe5607e){if(_0xe5607e){_0xe5607e[_0x2eb9('0x26')][_0x2eb9('0x77')]=util[_0x2eb9('0x60')](_0x2eb9('0x78'),_0x2eeea8['user']['name']);_0xe5607e[_0x2eb9('0x26')][_0x2eb9('0x79')]=_0x3cc636[_0x2eb9('0x79')];_0xe5607e['message']['motionChannel']=_0x3cc636[_0x2eb9('0x79')];_0xe5607e[_0x2eb9('0x26')][_0x2eb9('0x85')]=_0x2eb9('0x7f');respondWithRpcPromise(_0x2eb9('0x7b'),'EventManager',{'event':_0x2eb9('0x86'),'message':_['merge'](_0x3cc636[_0x2eb9('0x26')],JSON[_0x2eb9('0x7d')](_0x3cc636[_0x2eb9('0x69')][_0x2eb9('0x7e')]))},client9002);return _0x3cc636;}return null;})[_0x2eb9('0x20')](respondWithResult(_0x4ecd56,null))[_0x2eb9('0x27')](handleError(_0x4ecd56,null));}; \ No newline at end of file +var _0x3f5b=['acceptmessage','formData','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','Sequelize','fullname','reject','parse','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./chatMessage.socket','register','jayson/promise','http','client','request','then','info','stringify','code','error','ChatMessage,\x20%s,\x20%s','message','request\x20sent','result','status','json','offset','limit','undefined','count','set','Content-Range','save','update','destroy','end','sendStatus','stack','name','send','index','map','ChatMessage','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','catch','show','params','find','create','body','describe','chat-interactions','accept','chat','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','get','ChatInteraction','isNil','read1stAt','role','interaction','null','acceptMessage','ContactId','sequelize','QueryTypes','SELECT','contact','User','email','internal','agent','manual','interface','SIP/%s','channel','motionChannel','EventManager'];(function(_0x1b2ff7,_0x12a034){var _0x31656a=function(_0x1165a5){while(--_0x1165a5){_0x1b2ff7['push'](_0x1b2ff7['shift']());}};_0x31656a(++_0x12a034);}(_0x3f5b,0x194));var _0xb3f5=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3f5b[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xb3f5('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xb3f5('0x1'));var jsonpatch=require(_0xb3f5('0x2'));var rp=require('request-promise');var moment=require(_0xb3f5('0x3'));var BPromise=require(_0xb3f5('0x4'));var Mustache=require(_0xb3f5('0x5'));var util=require('util');var path=require(_0xb3f5('0x6'));var sox=require(_0xb3f5('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb3f5('0x8'));var _=require(_0xb3f5('0x9'));var squel=require(_0xb3f5('0xa'));var crypto=require('crypto');var jsforce=require(_0xb3f5('0xb'));var deskjs=require(_0xb3f5('0xc'));var toCsv=require(_0xb3f5('0xd'));var querystring=require(_0xb3f5('0xe'));var Papa=require(_0xb3f5('0xf'));var Redis=require(_0xb3f5('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb3f5('0x11'));var logger=require(_0xb3f5('0x12'))(_0xb3f5('0x13'));var utils=require(_0xb3f5('0x14'));var config=require(_0xb3f5('0x15'));var licenseUtil=require(_0xb3f5('0x16'));var db=require(_0xb3f5('0x17'))['db'];config['redis']=_['defaults'](config[_0xb3f5('0x18')],{'host':_0xb3f5('0x19'),'port':0x18eb});var socket=require(_0xb3f5('0x1a'))(new Redis(config[_0xb3f5('0x18')]));require(_0xb3f5('0x1b'))[_0xb3f5('0x1c')](socket);var jayson=require(_0xb3f5('0x1d'));var client=jayson['client'][_0xb3f5('0x1e')]({'port':0x232c});var client9002=jayson[_0xb3f5('0x1f')]['http']({'port':0x232a});function respondWithRpcPromise(_0x30f37c,_0x5342a6,_0x4ab469,_0x461ebb){return new BPromise(function(_0x126969,_0x48c4e0){var _0x19de74=_0x461ebb||client;return _0x19de74[_0xb3f5('0x20')](_0x30f37c,_0x4ab469)[_0xb3f5('0x21')](function(_0x3e2063){logger[_0xb3f5('0x22')]('ChatMessage,\x20%s,\x20%s',_0x5342a6,'request\x20sent');logger['debug']('ChatMessage,\x20%s,\x20%s,\x20%s',_0x5342a6,'request\x20sent',JSON[_0xb3f5('0x23')](_0x3e2063));if(_0x3e2063['error']){if(_0x3e2063['error'][_0xb3f5('0x24')]===0x1f4){logger[_0xb3f5('0x25')](_0xb3f5('0x26'),_0x5342a6,_0x3e2063[_0xb3f5('0x25')]['message']);return _0x48c4e0(_0x3e2063['error'][_0xb3f5('0x27')]);}logger[_0xb3f5('0x25')]('ChatMessage,\x20%s,\x20%s',_0x5342a6,_0x3e2063[_0xb3f5('0x25')][_0xb3f5('0x27')]);return _0x126969(_0x3e2063[_0xb3f5('0x25')][_0xb3f5('0x27')]);}else{logger[_0xb3f5('0x22')](_0xb3f5('0x26'),_0x5342a6,_0xb3f5('0x28'));_0x126969(_0x3e2063[_0xb3f5('0x29')][_0xb3f5('0x27')]);}})['catch'](function(_0x5a85d0){logger[_0xb3f5('0x25')](_0xb3f5('0x26'),_0x5342a6,_0x5a85d0);_0x48c4e0(_0x5a85d0);});});}function respondWithStatusCode(_0x35eeb5,_0x47c005){_0x47c005=_0x47c005||0xcc;return function(_0x218fec){if(_0x218fec){return _0x35eeb5['sendStatus'](_0x47c005);}return _0x35eeb5[_0xb3f5('0x2a')](_0x47c005)['end']();};}function respondWithResult(_0x1b29e2,_0xaa8908){_0xaa8908=_0xaa8908||0xc8;return function(_0x31ff87){if(_0x31ff87){return _0x1b29e2[_0xb3f5('0x2a')](_0xaa8908)[_0xb3f5('0x2b')](_0x31ff87);}};}function respondWithFilteredResult(_0x5f3b84,_0x403921){return function(_0x3cbcf3){if(_0x3cbcf3){var _0x57da44=typeof _0x403921[_0xb3f5('0x2c')]==='undefined'&&typeof _0x403921[_0xb3f5('0x2d')]===_0xb3f5('0x2e');var _0x448cc5=_0x3cbcf3[_0xb3f5('0x2f')];var _0x3156e8=_0x57da44?0x0:_0x403921[_0xb3f5('0x2c')];var _0x4a0797=_0x57da44?_0x3cbcf3[_0xb3f5('0x2f')]:_0x403921['offset']+_0x403921[_0xb3f5('0x2d')];var _0x33df29;if(_0x4a0797>=_0x448cc5){_0x4a0797=_0x448cc5;_0x33df29=0xc8;}else{_0x33df29=0xce;}_0x5f3b84[_0xb3f5('0x2a')](_0x33df29);return _0x5f3b84[_0xb3f5('0x30')](_0xb3f5('0x31'),_0x3156e8+'-'+_0x4a0797+'/'+_0x448cc5)['json'](_0x3cbcf3);}return null;};}function patchUpdates(_0x45c83c){return function(_0x2914df){try{jsonpatch['apply'](_0x2914df,_0x45c83c,!![]);}catch(_0x54502e){return BPromise['reject'](_0x54502e);}return _0x2914df[_0xb3f5('0x32')]();};}function saveUpdates(_0x158b92,_0x26d36c){return function(_0x3b3742){if(_0x3b3742){return _0x3b3742[_0xb3f5('0x33')](_0x158b92)[_0xb3f5('0x21')](function(_0x5f29b3){return _0x5f29b3;});}return null;};}function removeEntity(_0x4e24af,_0x4215c6){return function(_0x3bbb78){if(_0x3bbb78){return _0x3bbb78[_0xb3f5('0x34')]()['then'](function(){_0x4e24af[_0xb3f5('0x2a')](0xcc)[_0xb3f5('0x35')]();});}};}function handleEntityNotFound(_0x435234,_0x5583a2){return function(_0x60d4ea){if(!_0x60d4ea){_0x435234[_0xb3f5('0x36')](0x194);}return _0x60d4ea;};}function handleError(_0x1a6dfd,_0x38f90f){_0x38f90f=_0x38f90f||0x1f4;return function(_0x30b858){logger[_0xb3f5('0x25')](_0x30b858[_0xb3f5('0x37')]);if(_0x30b858['name']){delete _0x30b858[_0xb3f5('0x38')];}_0x1a6dfd[_0xb3f5('0x2a')](_0x38f90f)[_0xb3f5('0x39')](_0x30b858);};}exports[_0xb3f5('0x3a')]=function(_0x3fc236,_0x469d43){var _0x33a179={},_0x119902={},_0x39121c={'count':0x0,'rows':[]};var _0x5b3bfe=_[_0xb3f5('0x3b')](db[_0xb3f5('0x3c')][_0xb3f5('0x3d')],function(_0x179b05){return{'name':_0x179b05[_0xb3f5('0x3e')],'type':_0x179b05[_0xb3f5('0x3f')][_0xb3f5('0x40')]};});_0x119902[_0xb3f5('0x41')]=_['map'](_0x5b3bfe,_0xb3f5('0x38'));_0x119902[_0xb3f5('0x42')]=_[_0xb3f5('0x43')](_0x3fc236['query']);_0x119902[_0xb3f5('0x44')]=_[_0xb3f5('0x45')](_0x119902[_0xb3f5('0x41')],_0x119902[_0xb3f5('0x42')]);_0x33a179[_0xb3f5('0x46')]=_[_0xb3f5('0x45')](_0x119902[_0xb3f5('0x41')],qs['fields'](_0x3fc236[_0xb3f5('0x42')][_0xb3f5('0x47')]));_0x33a179[_0xb3f5('0x46')]=_0x33a179['attributes'][_0xb3f5('0x48')]?_0x33a179[_0xb3f5('0x46')]:_0x119902[_0xb3f5('0x41')];if(!_0x3fc236['query'][_0xb3f5('0x49')]('nolimit')){_0x33a179[_0xb3f5('0x2d')]=qs[_0xb3f5('0x2d')](_0x3fc236[_0xb3f5('0x42')][_0xb3f5('0x2d')]);_0x33a179[_0xb3f5('0x2c')]=qs['offset'](_0x3fc236[_0xb3f5('0x42')][_0xb3f5('0x2c')]);}_0x33a179[_0xb3f5('0x4a')]=qs[_0xb3f5('0x4b')](_0x3fc236['query'][_0xb3f5('0x4b')]);_0x33a179[_0xb3f5('0x4c')]=qs['filters'](_[_0xb3f5('0x4d')](_0x3fc236[_0xb3f5('0x42')],_0x119902['filters']),_0x5b3bfe);if(_0x3fc236[_0xb3f5('0x42')]['filter']){_0x33a179['where']=_[_0xb3f5('0x4e')](_0x33a179[_0xb3f5('0x4c')],{'$or':_[_0xb3f5('0x3b')](_0x5b3bfe,function(_0x498656){if(_0x498656[_0xb3f5('0x3f')]!==_0xb3f5('0x4f')){var _0x16990e={};_0x16990e[_0x498656[_0xb3f5('0x38')]]={'$like':'%'+_0x3fc236[_0xb3f5('0x42')][_0xb3f5('0x50')]+'%'};return _0x16990e;}})});}_0x33a179=_[_0xb3f5('0x4e')]({},_0x33a179,_0x3fc236[_0xb3f5('0x51')]);var _0x4c9894={'where':_0x33a179['where']};return db[_0xb3f5('0x3c')]['count'](_0x4c9894)['then'](function(_0x303f60){_0x39121c[_0xb3f5('0x2f')]=_0x303f60;if(_0x3fc236['query'][_0xb3f5('0x52')]){_0x33a179[_0xb3f5('0x53')]=[{'all':!![]}];}return db[_0xb3f5('0x3c')][_0xb3f5('0x54')](_0x33a179);})['then'](function(_0x34456f){_0x39121c['rows']=_0x34456f;return _0x39121c;})['then'](respondWithFilteredResult(_0x469d43,_0x33a179))[_0xb3f5('0x55')](handleError(_0x469d43,null));};exports[_0xb3f5('0x56')]=function(_0x3529be,_0x931ea5){var _0x42ef24={'raw':!![],'where':{'id':_0x3529be[_0xb3f5('0x57')]['id']}},_0x37ad3e={};_0x37ad3e[_0xb3f5('0x41')]=_[_0xb3f5('0x43')](db[_0xb3f5('0x3c')]['rawAttributes']);_0x37ad3e[_0xb3f5('0x42')]=_['keys'](_0x3529be[_0xb3f5('0x42')]);_0x37ad3e['filters']=_[_0xb3f5('0x45')](_0x37ad3e[_0xb3f5('0x41')],_0x37ad3e[_0xb3f5('0x42')]);_0x42ef24[_0xb3f5('0x46')]=_[_0xb3f5('0x45')](_0x37ad3e[_0xb3f5('0x41')],qs[_0xb3f5('0x47')](_0x3529be[_0xb3f5('0x42')][_0xb3f5('0x47')]));_0x42ef24['attributes']=_0x42ef24[_0xb3f5('0x46')][_0xb3f5('0x48')]?_0x42ef24['attributes']:_0x37ad3e[_0xb3f5('0x41')];if(_0x3529be[_0xb3f5('0x42')][_0xb3f5('0x52')]){_0x42ef24[_0xb3f5('0x53')]=[{'all':!![]}];}_0x42ef24=_[_0xb3f5('0x4e')]({},_0x42ef24,_0x3529be[_0xb3f5('0x51')]);return db[_0xb3f5('0x3c')][_0xb3f5('0x58')](_0x42ef24)[_0xb3f5('0x21')](handleEntityNotFound(_0x931ea5,null))[_0xb3f5('0x21')](respondWithResult(_0x931ea5,null))[_0xb3f5('0x55')](handleError(_0x931ea5,null));};exports[_0xb3f5('0x59')]=function(_0x3fa8ba,_0x46df26){return db['ChatMessage'][_0xb3f5('0x59')](_0x3fa8ba[_0xb3f5('0x5a')],{})['then'](respondWithResult(_0x46df26,0xc9))['catch'](handleError(_0x46df26,null));};exports['update']=function(_0x1dddeb,_0xd6b3a7){if(_0x1dddeb['body']['id']){delete _0x1dddeb[_0xb3f5('0x5a')]['id'];}return db[_0xb3f5('0x3c')][_0xb3f5('0x58')]({'where':{'id':_0x1dddeb['params']['id']}})['then'](handleEntityNotFound(_0xd6b3a7,null))[_0xb3f5('0x21')](saveUpdates(_0x1dddeb[_0xb3f5('0x5a')],null))[_0xb3f5('0x21')](respondWithResult(_0xd6b3a7,null))['catch'](handleError(_0xd6b3a7,null));};exports[_0xb3f5('0x34')]=function(_0x46ee11,_0x3b37d0){return db[_0xb3f5('0x3c')][_0xb3f5('0x58')]({'where':{'id':_0x46ee11[_0xb3f5('0x57')]['id']}})['then'](handleEntityNotFound(_0x3b37d0,null))['then'](removeEntity(_0x3b37d0,null))[_0xb3f5('0x55')](handleError(_0x3b37d0,null));};exports[_0xb3f5('0x5b')]=function(_0x184c45,_0x351283){return db[_0xb3f5('0x3c')][_0xb3f5('0x5b')]()[_0xb3f5('0x21')](respondWithResult(_0x351283,null))['catch'](handleError(_0x351283,null));};var interaction_log=require('../../config/logger')(_0xb3f5('0x5c'));exports[_0xb3f5('0x5d')]=function(_0x34d7bb,_0x8395be,_0x488320){var _0x13c309={'agent':{},'channel':_0xb3f5('0x5e')};if(_0x34d7bb[_0xb3f5('0x5a')]['id']){delete _0x34d7bb['body']['id'];}_0x34d7bb[_0xb3f5('0x5a')][_0xb3f5('0x5f')]=!![];_0x34d7bb['body'][_0xb3f5('0x60')]=moment()[_0xb3f5('0x61')](_0xb3f5('0x62'));_0x34d7bb[_0xb3f5('0x5a')][_0xb3f5('0x63')]=_0x34d7bb[_0xb3f5('0x5a')][_0xb3f5('0x63')]||_0x34d7bb[_0xb3f5('0x64')]['id'];_0x13c309['agent']['id']=_0x34d7bb['body']['UserId'];return db[_0xb3f5('0x3c')][_0xb3f5('0x58')]({'where':{'id':_0x34d7bb[_0xb3f5('0x57')]['id'],'UserId':null}})[_0xb3f5('0x21')](handleEntityNotFound(_0x8395be,null))[_0xb3f5('0x21')](saveUpdates(_0x34d7bb[_0xb3f5('0x5a')],null))[_0xb3f5('0x21')](function(_0x20c670){if(_0x20c670){_0x13c309[_0xb3f5('0x27')]=_0x20c670[_0xb3f5('0x65')]({'plain':!![]});return db[_0xb3f5('0x66')][_0xb3f5('0x58')]({'where':{'id':_0x20c670['ChatInteractionId']}});}return null;})[_0xb3f5('0x21')](handleEntityNotFound(_0x8395be,null))[_0xb3f5('0x21')](function(_0x3fdac7){if(_0x3fdac7){return _0x3fdac7['update']({'UserId':_0x34d7bb[_0xb3f5('0x5a')][_0xb3f5('0x63')],'read1stAt':_[_0xb3f5('0x67')](_0x3fdac7[_0xb3f5('0x68')])?moment()[_0xb3f5('0x61')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0xb3f5('0x21')](function(_0x576df0){if(_0x576df0){_0x13c309['interaction']=_0x576df0[_0xb3f5('0x65')]({'plain':!![]});interaction_log['info']('[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x34d7bb['user']['id'],_0x34d7bb[_0xb3f5('0x64')]['name'],_0x34d7bb[_0xb3f5('0x64')][_0xb3f5('0x69')],_0x13c309[_0xb3f5('0x6a')]['id'],_0x34d7bb[_0xb3f5('0x5a')]?JSON[_0xb3f5('0x23')](_0x34d7bb['body']):_0xb3f5('0x6b'));return respondWithRpcPromise('AcceptMessage',_0xb3f5('0x6c'),_0x13c309);}return null;})['then'](function(_0x346ce4){var _0x1fff1c='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x346ce4[_0xb3f5('0x27')][_0xb3f5('0x6d')];return db[_0xb3f5('0x6e')][_0xb3f5('0x42')](_0x1fff1c,{'type':db['Sequelize'][_0xb3f5('0x6f')][_0xb3f5('0x70')],'raw':!![]})[_0xb3f5('0x21')](function(_0x380280){return _0x380280;});})['then'](function(_0x3edb6e){if(_0x3edb6e){_0x13c309[_0xb3f5('0x27')][_0xb3f5('0x71')]=_0x3edb6e[0x0];if(!_0x34d7bb[_0xb3f5('0x5a')]['UserId'])return;return db[_0xb3f5('0x72')][_0xb3f5('0x58')]({'where':{'id':_0x34d7bb['body'][_0xb3f5('0x63')],'role':'agent'},'attributes':['id',_0xb3f5('0x38'),'fullname',_0xb3f5('0x73'),_0xb3f5('0x74')],'raw':!![]});}return null;})[_0xb3f5('0x21')](function(_0x57ba7b){if(!_0x57ba7b)return null;_0x13c309['message'][_0xb3f5('0x75')]=_0x57ba7b;return _0x13c309;})['then'](function(_0x366845){if(_0x366845){if(_0x34d7bb[_0xb3f5('0x5a')][_0xb3f5('0x76')]){_0x13c309[_0xb3f5('0x27')][_0xb3f5('0x77')]=util['format'](_0xb3f5('0x78'),_0x34d7bb['user']['name']);_0x13c309[_0xb3f5('0x27')][_0xb3f5('0x79')]=_0x13c309[_0xb3f5('0x79')];_0x13c309[_0xb3f5('0x27')][_0xb3f5('0x7a')]=_0x13c309[_0xb3f5('0x79')];_0x13c309[_0xb3f5('0x27')]['event']='accept';return respondWithRpcPromise(_0xb3f5('0x7b'),_0xb3f5('0x7b'),{'event':_0xb3f5('0x7c'),'message':_[_0xb3f5('0x4e')](_0x13c309[_0xb3f5('0x27')],JSON['parse'](_0x13c309['interaction'][_0xb3f5('0x7d')]))},client9002)['then'](function(){return _0x13c309;});}return _0x13c309;}return null;})[_0xb3f5('0x21')](respondWithResult(_0x8395be,null))['catch'](handleError(_0x8395be,null));};var interaction_log=require('../../config/logger')(_0xb3f5('0x5c'));exports['reject']=function(_0x422d91,_0x19ac42,_0x3afba1){var _0x3b34a0={'agent':{},'channel':_0xb3f5('0x5e')};if(_0x422d91[_0xb3f5('0x5a')]['id']){delete _0x422d91[_0xb3f5('0x5a')]['id'];}_0x422d91[_0xb3f5('0x5a')][_0xb3f5('0x63')]=_0x422d91[_0xb3f5('0x5a')][_0xb3f5('0x63')]||_0x422d91[_0xb3f5('0x64')]['id'];_0x3b34a0[_0xb3f5('0x75')]['id']=_0x422d91[_0xb3f5('0x5a')][_0xb3f5('0x63')];return db['ChatMessage'][_0xb3f5('0x58')]({'where':{'id':_0x422d91[_0xb3f5('0x57')]['id'],'UserId':null}})[_0xb3f5('0x21')](handleEntityNotFound(_0x19ac42,null))['then'](function(_0x38ebfe){if(_0x38ebfe){_0x3b34a0[_0xb3f5('0x27')]=_0x38ebfe[_0xb3f5('0x65')]({'plain':!![]});return db[_0xb3f5('0x66')][_0xb3f5('0x58')]({'where':{'id':_0x38ebfe['ChatInteractionId']}});}return null;})[_0xb3f5('0x21')](handleEntityNotFound(_0x19ac42,null))[_0xb3f5('0x21')](function(_0x43e9d2){if(_0x43e9d2){_0x3b34a0['interaction']=_0x43e9d2[_0xb3f5('0x65')]({'plain':!![]});interaction_log[_0xb3f5('0x22')]('[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x422d91[_0xb3f5('0x64')]['id'],_0x422d91['user'][_0xb3f5('0x38')],_0x422d91[_0xb3f5('0x64')][_0xb3f5('0x69')],_0x3b34a0[_0xb3f5('0x6a')]['id'],_0x422d91[_0xb3f5('0x5a')]?JSON[_0xb3f5('0x23')](_0x422d91[_0xb3f5('0x5a')]):_0xb3f5('0x6b'));return respondWithRpcPromise('RejectMessage',_0xb3f5('0x7e'),_0x3b34a0);}return null;})[_0xb3f5('0x21')](function(_0x29a1e9){var _0x34990a=_0xb3f5('0x7f')+_0x29a1e9['message'][_0xb3f5('0x6d')];return db['sequelize'][_0xb3f5('0x42')](_0x34990a,{'type':db[_0xb3f5('0x80')][_0xb3f5('0x6f')][_0xb3f5('0x70')],'raw':!![]})[_0xb3f5('0x21')](function(_0x27e71b){return _0x27e71b;});})[_0xb3f5('0x21')](function(_0x2dc480){if(_0x2dc480){_0x3b34a0[_0xb3f5('0x27')][_0xb3f5('0x71')]=_0x2dc480[0x0];if(!_0x422d91[_0xb3f5('0x5a')][_0xb3f5('0x63')])return;return db[_0xb3f5('0x72')][_0xb3f5('0x58')]({'where':{'id':_0x422d91[_0xb3f5('0x5a')][_0xb3f5('0x63')],'role':_0xb3f5('0x75')},'attributes':['id',_0xb3f5('0x38'),_0xb3f5('0x81'),_0xb3f5('0x73'),_0xb3f5('0x74')],'raw':!![]});}return null;})[_0xb3f5('0x21')](function(_0x56b07b){if(!_0x56b07b)return null;_0x3b34a0[_0xb3f5('0x27')][_0xb3f5('0x75')]=_0x56b07b;return _0x3b34a0;})[_0xb3f5('0x21')](function(_0xf19bdf){if(_0xf19bdf){_0xf19bdf[_0xb3f5('0x27')][_0xb3f5('0x77')]=util[_0xb3f5('0x61')](_0xb3f5('0x78'),_0x422d91['user'][_0xb3f5('0x38')]);_0xf19bdf[_0xb3f5('0x27')][_0xb3f5('0x79')]=_0x3b34a0[_0xb3f5('0x79')];_0xf19bdf['message'][_0xb3f5('0x7a')]=_0x3b34a0['channel'];_0xf19bdf['message']['event']=_0xb3f5('0x82');respondWithRpcPromise(_0xb3f5('0x7b'),_0xb3f5('0x7b'),{'event':'rejectmessage','message':_[_0xb3f5('0x4e')](_0x3b34a0[_0xb3f5('0x27')],JSON[_0xb3f5('0x83')](_0x3b34a0['interaction'][_0xb3f5('0x7d')]))},client9002);return _0x3b34a0;}return null;})[_0xb3f5('0x21')](respondWithResult(_0x19ac42,null))[_0xb3f5('0x55')](handleError(_0x19ac42,null));}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js index 670a9f1..9faddf6 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 _0x37d0=['events','../../mysqldb','ChatMessage','setMaxListeners','update','emit','hasOwnProperty','hook','exports'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x37d0,0x183));var _0x037d=function(_0x31eca0,_0x107115){_0x31eca0=_0x31eca0-0x0;var _0xc89205=_0x37d0[_0x31eca0];return _0xc89205;};'use strict';var EventEmitter=require(_0x037d('0x0'));var ChatMessage=require(_0x037d('0x1'))['db'][_0x037d('0x2')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x037d('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x037d('0x4'),'afterDestroy':'remove'};function emitEvent(_0x5c6265){return function(_0x3c7aae,_0x2d7b2c,_0x2fd0bc){ChatMessageEvents[_0x037d('0x5')](_0x5c6265+':'+_0x3c7aae['id'],_0x3c7aae);ChatMessageEvents[_0x037d('0x5')](_0x5c6265,_0x3c7aae);_0x2fd0bc(null);};}for(var e in events){if(events[_0x037d('0x6')](e)){var event=events[e];ChatMessage[_0x037d('0x7')](e,emitEvent(event));}}module[_0x037d('0x8')]=ChatMessageEvents; \ No newline at end of file +var _0x13a0=['exports','events','../../mysqldb','setMaxListeners','save','remove','emit','hasOwnProperty','hook'];(function(_0x245049,_0x56e156){var _0xabd14b=function(_0x4bfdaf){while(--_0x4bfdaf){_0x245049['push'](_0x245049['shift']());}};_0xabd14b(++_0x56e156);}(_0x13a0,0x7f));var _0x013a=function(_0x50f0e9,_0x2f9300){_0x50f0e9=_0x50f0e9-0x0;var _0x12dae4=_0x13a0[_0x50f0e9];return _0x12dae4;};'use strict';var EventEmitter=require(_0x013a('0x0'));var ChatMessage=require(_0x013a('0x1'))['db']['ChatMessage'];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x013a('0x2')](0x0);var events={'afterCreate':_0x013a('0x3'),'afterUpdate':'update','afterDestroy':_0x013a('0x4')};function emitEvent(_0x81dd52){return function(_0x478f2c,_0x137c8d,_0x40a998){ChatMessageEvents['emit'](_0x81dd52+':'+_0x478f2c['id'],_0x478f2c);ChatMessageEvents[_0x013a('0x5')](_0x81dd52,_0x478f2c);_0x40a998(null);};}for(var e in events){if(events[_0x013a('0x6')](e)){var event=events[e];ChatMessage[_0x013a('0x7')](e,emitEvent(event));}}module[_0x013a('0x8')]=ChatMessageEvents; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.model.js b/server/api/chatMessage/chatMessage.model.js index f983b0c..10d07cf 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 _0x5249=['ChatMessage','chat_messages','body','FULLTEXT','models','get','direction','toLowerCase','out','UserId','ChatInteraction','ChatInteractionId','then','update','createdAt','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./chatMessage.attributes','exports','define'];(function(_0x206c5c,_0xa5d383){var _0x1a8f0e=function(_0x5a4ebd){while(--_0x5a4ebd){_0x206c5c['push'](_0x206c5c['shift']());}};_0x1a8f0e(++_0xa5d383);}(_0x5249,0x8f));var _0x9524=function(_0x4a3632,_0x55e899){_0x4a3632=_0x4a3632-0x0;var _0x40ed2a=_0x5249[_0x4a3632];return _0x40ed2a;};'use strict';var _=require(_0x9524('0x0'));var util=require(_0x9524('0x1'));var logger=require(_0x9524('0x2'))(_0x9524('0x3'));var moment=require('moment');var BPromise=require(_0x9524('0x4'));var rp=require(_0x9524('0x5'));var fs=require('fs');var path=require(_0x9524('0x6'));var rimraf=require(_0x9524('0x7'));var config=require(_0x9524('0x8'));var attributes=require(_0x9524('0x9'));module[_0x9524('0xa')]=function(_0xe8e81b,_0x5d3710){return _0xe8e81b[_0x9524('0xb')](_0x9524('0xc'),attributes,{'tableName':_0x9524('0xd'),'paranoid':![],'indexes':[{'name':'fti_chat_messages','fields':[_0x9524('0xe')],'type':_0x9524('0xf')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x3a4be3,_0x505eb9,_0xd97f36){var _0x33c800=_0xe8e81b[_0x9524('0x10')];var _0x264208=_0x3a4be3[_0x9524('0x11')]({'plain':!![]});if(_0x264208[_0x9524('0x12')][_0x9524('0x13')]()==='in'||_0x264208['direction']['toLowerCase']()===_0x9524('0x14')&&!_0x264208['secret']&&!_['isNil'](_0x264208[_0x9524('0x15')])){_0x33c800[_0x9524('0x16')]['findOne']({'where':{'id':_0x264208[_0x9524('0x17')]}})[_0x9524('0x18')](function(_0x46bf2d){if(_0x46bf2d){_0x46bf2d[_0x9524('0x19')]({'lastMsgAt':_0x264208[_0x9524('0x1a')],'lastMsgDirection':_0x264208['direction'][_0x9524('0x13')]()});}})[_0x9524('0x1b')](function(_0x53358b){console[_0x9524('0x1c')](_0x53358b);});}_0xd97f36();}},'charset':_0x9524('0x1d'),'collate':_0x9524('0x1e')});}; \ No newline at end of file +var _0x8de7=['util','../../config/logger','moment','request-promise','path','rimraf','../../config/environment','./chatMessage.attributes','exports','ChatMessage','fti_chat_messages','FULLTEXT','get','direction','toLowerCase','isNil','findOne','ChatInteractionId','then','update','createdAt','catch','error','utf8mb4','lodash'];(function(_0x19687e,_0x154a9c){var _0x414fb2=function(_0x450c3a){while(--_0x450c3a){_0x19687e['push'](_0x19687e['shift']());}};_0x414fb2(++_0x154a9c);}(_0x8de7,0xf9));var _0x78de=function(_0x3c186e,_0x271faa){_0x3c186e=_0x3c186e-0x0;var _0x5c761e=_0x8de7[_0x3c186e];return _0x5c761e;};'use strict';var _=require(_0x78de('0x0'));var util=require(_0x78de('0x1'));var logger=require(_0x78de('0x2'))('api');var moment=require(_0x78de('0x3'));var BPromise=require('bluebird');var rp=require(_0x78de('0x4'));var fs=require('fs');var path=require(_0x78de('0x5'));var rimraf=require(_0x78de('0x6'));var config=require(_0x78de('0x7'));var attributes=require(_0x78de('0x8'));module[_0x78de('0x9')]=function(_0x5162a0,_0x55bfa7){return _0x5162a0['define'](_0x78de('0xa'),attributes,{'tableName':'chat_messages','paranoid':![],'indexes':[{'name':_0x78de('0xb'),'fields':['body'],'type':_0x78de('0xc')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x338355,_0x4a4b91,_0x9e3f7b){var _0x1eeb0b=_0x5162a0['models'];var _0x543cb0=_0x338355[_0x78de('0xd')]({'plain':!![]});if(_0x543cb0[_0x78de('0xe')][_0x78de('0xf')]()==='in'||_0x543cb0[_0x78de('0xe')][_0x78de('0xf')]()==='out'&&!_0x543cb0['secret']&&!_[_0x78de('0x10')](_0x543cb0['UserId'])){_0x1eeb0b['ChatInteraction'][_0x78de('0x11')]({'where':{'id':_0x543cb0[_0x78de('0x12')]}})[_0x78de('0x13')](function(_0x1a4e98){if(_0x1a4e98){_0x1a4e98[_0x78de('0x14')]({'lastMsgAt':_0x543cb0[_0x78de('0x15')],'lastMsgDirection':_0x543cb0[_0x78de('0xe')]['toLowerCase']()});}})[_0x78de('0x16')](function(_0x452ae4){console[_0x78de('0x17')](_0x452ae4);});}_0x9e3f7b();}},'charset':_0x78de('0x18'),'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 3bd6f32..42396a2 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 _0xabf7=['localhost','socket.io-emitter','./chatMessage.socket','register','then','request\x20sent','debug','error','code','message','ChatMessage,\x20%s,\x20%s','info','result','catch','CreateChatMessage','body','options','raw','stringify','lodash','moment','bluebird','randomstring','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','redis','defaults'];(function(_0x521afb,_0x4a97d9){var _0x3bbe5f=function(_0x138426){while(--_0x138426){_0x521afb['push'](_0x521afb['shift']());}};_0x3bbe5f(++_0x4a97d9);}(_0xabf7,0xae));var _0x7abf=function(_0x5c4886,_0x1d9665){_0x5c4886=_0x5c4886-0x0;var _0x4fe65a=_0xabf7[_0x5c4886];return _0x4fe65a;};'use strict';var _=require(_0x7abf('0x0'));var util=require('util');var moment=require(_0x7abf('0x1'));var BPromise=require(_0x7abf('0x2'));var rs=require(_0x7abf('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7abf('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x7abf('0x5'));var config=require(_0x7abf('0x6'));var jayson=require(_0x7abf('0x7'));var client=jayson[_0x7abf('0x8')][_0x7abf('0x9')]({'port':0x232a});config[_0x7abf('0xa')]=_[_0x7abf('0xb')](config['redis'],{'host':_0x7abf('0xc'),'port':0x18eb});var socket=require(_0x7abf('0xd'))(new Redis(config[_0x7abf('0xa')]));require(_0x7abf('0xe'))[_0x7abf('0xf')](socket);function respondWithRpcPromise(_0x5a0ce2,_0x5c9da3,_0x3e8c13){return new BPromise(function(_0x10e5ee,_0x54ae39){return client['request'](_0x5a0ce2,_0x3e8c13)[_0x7abf('0x10')](function(_0x15748a){logger['info']('ChatMessage,\x20%s,\x20%s',_0x5c9da3,_0x7abf('0x11'));logger[_0x7abf('0x12')]('ChatMessage,\x20%s,\x20%s,\x20%s',_0x5c9da3,_0x7abf('0x11'),JSON['stringify'](_0x15748a));if(_0x15748a['error']){if(_0x15748a[_0x7abf('0x13')][_0x7abf('0x14')]===0x1f4){logger[_0x7abf('0x13')]('ChatMessage,\x20%s,\x20%s',_0x5c9da3,_0x15748a[_0x7abf('0x13')][_0x7abf('0x15')]);return _0x54ae39(_0x15748a[_0x7abf('0x13')][_0x7abf('0x15')]);}logger[_0x7abf('0x13')](_0x7abf('0x16'),_0x5c9da3,_0x15748a[_0x7abf('0x13')][_0x7abf('0x15')]);return _0x10e5ee(_0x15748a[_0x7abf('0x13')][_0x7abf('0x15')]);}else{logger[_0x7abf('0x17')](_0x7abf('0x16'),_0x5c9da3,_0x7abf('0x11'));_0x10e5ee(_0x15748a[_0x7abf('0x18')][_0x7abf('0x15')]);}})[_0x7abf('0x19')](function(_0x3d8105){logger['error'](_0x7abf('0x16'),_0x5c9da3,_0x3d8105);_0x54ae39(_0x3d8105);});});}exports[_0x7abf('0x1a')]=function(_0x464c48){var _0x37d04a=this;return new Promise(function(_0x5375d5,_0x570385){return db['ChatMessage']['create'](_0x464c48[_0x7abf('0x1b')],{'raw':_0x464c48[_0x7abf('0x1c')]?_0x464c48[_0x7abf('0x1c')][_0x7abf('0x1d')]===undefined?!![]:![]:!![]})[_0x7abf('0x10')](function(_0x44801f){logger['info'](_0x7abf('0x1a'),_0x464c48);logger[_0x7abf('0x12')]('CreateChatMessage',_0x464c48,JSON[_0x7abf('0x1e')](_0x44801f));_0x5375d5(_0x44801f);})[_0x7abf('0x19')](function(_0x3f52f4){logger['error'](_0x7abf('0x1a'),_0x3f52f4[_0x7abf('0x15')],_0x464c48);_0x570385(_0x37d04a[_0x7abf('0x13')](0x1f4,_0x3f52f4[_0x7abf('0x15')]));});});}; \ No newline at end of file +var _0x0309=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','redis','socket.io-emitter','./chatMessage.socket','request','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateChatMessage','body','options','raw','debug','lodash','moment','randomstring'];(function(_0x5f09c5,_0x2bfca0){var _0x426ad9=function(_0x18fe5f){while(--_0x18fe5f){_0x5f09c5['push'](_0x5f09c5['shift']());}};_0x426ad9(++_0x2bfca0);}(_0x0309,0x165));var _0x9030=function(_0x2c7620,_0xde491c){_0x2c7620=_0x2c7620-0x0;var _0x45b5aa=_0x0309[_0x2c7620];return _0x45b5aa;};'use strict';var _=require(_0x9030('0x0'));var util=require('util');var moment=require(_0x9030('0x1'));var BPromise=require('bluebird');var rs=require(_0x9030('0x2'));var fs=require('fs');var Redis=require(_0x9030('0x3'));var db=require(_0x9030('0x4'))['db'];var utils=require(_0x9030('0x5'));var logger=require(_0x9030('0x6'))(_0x9030('0x7'));var config=require(_0x9030('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x9030('0x9')]({'port':0x232a});config[_0x9030('0xa')]=_['defaults'](config[_0x9030('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x9030('0xb'))(new Redis(config[_0x9030('0xa')]));require(_0x9030('0xc'))['register'](socket);function respondWithRpcPromise(_0xe2c28b,_0x1da9ec,_0x337b86){return new BPromise(function(_0x53ef39,_0x37d6e0){return client[_0x9030('0xd')](_0xe2c28b,_0x337b86)[_0x9030('0xe')](function(_0x11a539){logger[_0x9030('0xf')](_0x9030('0x10'),_0x1da9ec,_0x9030('0x11'));logger['debug'](_0x9030('0x12'),_0x1da9ec,_0x9030('0x11'),JSON[_0x9030('0x13')](_0x11a539));if(_0x11a539[_0x9030('0x14')]){if(_0x11a539['error'][_0x9030('0x15')]===0x1f4){logger[_0x9030('0x14')](_0x9030('0x10'),_0x1da9ec,_0x11a539[_0x9030('0x14')][_0x9030('0x16')]);return _0x37d6e0(_0x11a539[_0x9030('0x14')][_0x9030('0x16')]);}logger[_0x9030('0x14')](_0x9030('0x10'),_0x1da9ec,_0x11a539['error'][_0x9030('0x16')]);return _0x53ef39(_0x11a539[_0x9030('0x14')][_0x9030('0x16')]);}else{logger[_0x9030('0xf')](_0x9030('0x10'),_0x1da9ec,_0x9030('0x11'));_0x53ef39(_0x11a539[_0x9030('0x17')][_0x9030('0x16')]);}})[_0x9030('0x18')](function(_0x31e196){logger[_0x9030('0x14')](_0x9030('0x10'),_0x1da9ec,_0x31e196);_0x37d6e0(_0x31e196);});});}exports[_0x9030('0x19')]=function(_0x243e7d){var _0x1e5988=this;return new Promise(function(_0x285d93,_0x4105ec){return db['ChatMessage']['create'](_0x243e7d[_0x9030('0x1a')],{'raw':_0x243e7d[_0x9030('0x1b')]?_0x243e7d['options'][_0x9030('0x1c')]===undefined?!![]:![]:!![]})[_0x9030('0xe')](function(_0x1f806a){logger[_0x9030('0xf')]('CreateChatMessage',_0x243e7d);logger[_0x9030('0x1d')]('CreateChatMessage',_0x243e7d,JSON['stringify'](_0x1f806a));_0x285d93(_0x1f806a);})[_0x9030('0x18')](function(_0x2b205c){logger[_0x9030('0x14')]('CreateChatMessage',_0x2b205c[_0x9030('0x16')],_0x243e7d);_0x4105ec(_0x1e5988[_0x9030('0x14')](0x1f4,_0x2b205c[_0x9030('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js index 1b862b2..9bb402b 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 _0x9009=['removeListener','register','length','chatMessage:','./chatMessage.events','remove','update','emit'];(function(_0x3d9b04,_0x1e851a){var _0x557936=function(_0x3bf3ae){while(--_0x3bf3ae){_0x3d9b04['push'](_0x3d9b04['shift']());}};_0x557936(++_0x1e851a);}(_0x9009,0x1d4));var _0x9900=function(_0x302a8a,_0x36d2cc){_0x302a8a=_0x302a8a-0x0;var _0x59f478=_0x9009[_0x302a8a];return _0x59f478;};'use strict';var ChatMessageEvents=require(_0x9900('0x0'));var events=['save',_0x9900('0x1'),_0x9900('0x2')];function createListener(_0x5d0a60,_0x12d637){return function(_0x177acf){_0x12d637[_0x9900('0x3')](_0x5d0a60,_0x177acf);};}function removeListener(_0x224abb,_0x5705f1){return function(){ChatMessageEvents[_0x9900('0x4')](_0x224abb,_0x5705f1);};}exports[_0x9900('0x5')]=function(_0x502dac){for(var _0x59dd25=0x0,_0x16de4e=events[_0x9900('0x6')];_0x59dd25<_0x16de4e;_0x59dd25++){var _0x4abe19=events[_0x59dd25];var _0x2f085b=createListener(_0x9900('0x7')+_0x4abe19,_0x502dac);ChatMessageEvents['on'](_0x4abe19,_0x2f085b);}}; \ No newline at end of file +var _0x6dac=['update','emit','removeListener','register','length','chatMessage:','./chatMessage.events','save','remove'];(function(_0x45d10e,_0x56fc1a){var _0x3627f1=function(_0xdc9851){while(--_0xdc9851){_0x45d10e['push'](_0x45d10e['shift']());}};_0x3627f1(++_0x56fc1a);}(_0x6dac,0x16e));var _0xc6da=function(_0x5b92a1,_0x26f283){_0x5b92a1=_0x5b92a1-0x0;var _0x16fee9=_0x6dac[_0x5b92a1];return _0x16fee9;};'use strict';var ChatMessageEvents=require(_0xc6da('0x0'));var events=[_0xc6da('0x1'),_0xc6da('0x2'),_0xc6da('0x3')];function createListener(_0x133ecc,_0x224a52){return function(_0x3391f5){_0x224a52[_0xc6da('0x4')](_0x133ecc,_0x3391f5);};}function removeListener(_0x28663f,_0x338470){return function(){ChatMessageEvents[_0xc6da('0x5')](_0x28663f,_0x338470);};}exports[_0xc6da('0x6')]=function(_0x325f49){for(var _0x5caf49=0x0,_0x1ebd11=events[_0xc6da('0x7')];_0x5caf49<_0x1ebd11;_0x5caf49++){var _0x5a0d8d=events[_0x5caf49];var _0x3047d3=createListener(_0xc6da('0x8')+_0x5a0d8d,_0x325f49);ChatMessageEvents['on'](_0x5a0d8d,_0x3047d3);}}; \ No newline at end of file diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js index b272b3f..86dd9ec 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 _0x8cba=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','tracked','chat','create','put','update','/:id/accept','accept','reject','delete','destroy','exports','multer','util'];(function(_0x1d9738,_0xa45e1){var _0xc28768=function(_0x28efad){while(--_0x28efad){_0x1d9738['push'](_0x1d9738['shift']());}};_0xc28768(++_0xa45e1);}(_0x8cba,0x16a));var _0xa8cb=function(_0x9765f2,_0x4fe9c6){_0x9765f2=_0x9765f2-0x0;var _0x27c61c=_0x8cba[_0x9765f2];return _0x27c61c;};'use strict';var multer=require(_0xa8cb('0x0'));var util=require(_0xa8cb('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0xa8cb('0x2'));var auth=require(_0xa8cb('0x3'));var interaction=require(_0xa8cb('0x4'));var config=require(_0xa8cb('0x5'));var controller=require(_0xa8cb('0x6'));router[_0xa8cb('0x7')]('/',auth[_0xa8cb('0x8')](),controller[_0xa8cb('0x9')]);router[_0xa8cb('0x7')](_0xa8cb('0xa'),auth['isAuthenticated'](),controller[_0xa8cb('0xb')]);router[_0xa8cb('0x7')](_0xa8cb('0xc'),auth[_0xa8cb('0x8')](),controller[_0xa8cb('0xd')]);router[_0xa8cb('0xe')]('/',auth[_0xa8cb('0x8')](),interaction[_0xa8cb('0xf')](_0xa8cb('0x10'),'chatmessage:create'),controller[_0xa8cb('0x11')]);router[_0xa8cb('0x12')](_0xa8cb('0xc'),controller[_0xa8cb('0x13')]);router[_0xa8cb('0x12')](_0xa8cb('0x14'),auth[_0xa8cb('0x8')](),controller[_0xa8cb('0x15')]);router[_0xa8cb('0x12')]('/:id/reject',auth[_0xa8cb('0x8')](),controller[_0xa8cb('0x16')]);router[_0xa8cb('0x17')](_0xa8cb('0xc'),auth[_0xa8cb('0x8')](),controller[_0xa8cb('0x18')]);module[_0xa8cb('0x19')]=router; \ No newline at end of file +var _0xf9fc=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatMessage.controller','get','isAuthenticated','index','/describe','/:id','show','tracked','chat','chatmessage:create','create','put','update','accept','reject','delete','destroy','multer','util','connect-timeout'];(function(_0x4429e0,_0xee6f1f){var _0x51a5b3=function(_0x16eb11){while(--_0x16eb11){_0x4429e0['push'](_0x4429e0['shift']());}};_0x51a5b3(++_0xee6f1f);}(_0xf9fc,0x101));var _0xcf9f=function(_0x25a06f,_0x126b87){_0x25a06f=_0x25a06f-0x0;var _0x387815=_0xf9fc[_0x25a06f];return _0x387815;};'use strict';var multer=require(_0xcf9f('0x0'));var util=require(_0xcf9f('0x1'));var path=require('path');var timeout=require(_0xcf9f('0x2'));var express=require(_0xcf9f('0x3'));var router=express[_0xcf9f('0x4')]();var fs_extra=require(_0xcf9f('0x5'));var auth=require(_0xcf9f('0x6'));var interaction=require(_0xcf9f('0x7'));var config=require(_0xcf9f('0x8'));var controller=require(_0xcf9f('0x9'));router[_0xcf9f('0xa')]('/',auth[_0xcf9f('0xb')](),controller[_0xcf9f('0xc')]);router[_0xcf9f('0xa')](_0xcf9f('0xd'),auth[_0xcf9f('0xb')](),controller['describe']);router[_0xcf9f('0xa')](_0xcf9f('0xe'),auth[_0xcf9f('0xb')](),controller[_0xcf9f('0xf')]);router['post']('/',auth[_0xcf9f('0xb')](),interaction[_0xcf9f('0x10')](_0xcf9f('0x11'),_0xcf9f('0x12')),controller[_0xcf9f('0x13')]);router[_0xcf9f('0x14')]('/:id',controller[_0xcf9f('0x15')]);router[_0xcf9f('0x14')]('/:id/accept',auth[_0xcf9f('0xb')](),controller[_0xcf9f('0x16')]);router[_0xcf9f('0x14')]('/:id/reject',auth[_0xcf9f('0xb')](),controller[_0xcf9f('0x17')]);router[_0xcf9f('0x18')]('/:id',auth[_0xcf9f('0xb')](),controller[_0xcf9f('0x19')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js index 05c368f..0f2651a 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 _0x19db=['sequelize','medium'];(function(_0x15acaa,_0x2b38aa){var _0x59197e=function(_0x3e928e){while(--_0x3e928e){_0x15acaa['push'](_0x15acaa['shift']());}};_0x59197e(++_0x2b38aa);}(_0x19db,0x140));var _0xb19d=function(_0x4c03ae,_0x5856b0){_0x4c03ae=_0x4c03ae-0x0;var _0x1acaab=_0x19db[_0x4c03ae];return _0x1acaab;};'use strict';var Sequelize=require(_0xb19d('0x0'));module['exports']={'body':{'type':Sequelize['TEXT'](_0xb19d('0x1')),'allowNull':![]}}; \ No newline at end of file +var _0x075c=['exports','TEXT','medium','sequelize'];(function(_0x4e05f4,_0x4db342){var _0x171234=function(_0xdcb71a){while(--_0xdcb71a){_0x4e05f4['push'](_0x4e05f4['shift']());}};_0x171234(++_0x4db342);}(_0x075c,0x15f));var _0xc075=function(_0x58c4f3,_0x38827d){_0x58c4f3=_0x58c4f3-0x0;var _0x1dfee5=_0x075c[_0x58c4f3];return _0x1dfee5;};'use strict';var Sequelize=require(_0xc075('0x0'));module[_0xc075('0x1')]={'body':{'type':Sequelize[_0xc075('0x2')](_0xc075('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 3a54695..dc50d8c 100644 --- a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js +++ b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy','error','name','send','index','fieldName','type','key','model','map','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','ChatOfflineMessage','findAll','rows','show','rawAttributes','includeAll','include','find','create','catch','body','params','Attachment','forEach','join','root','server','files','attachments','basename','existsSync','remove','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb'];(function(_0x2c8d53,_0x2fc3b2){var _0x1482ec=function(_0x3d6413){while(--_0x3d6413){_0x2c8d53['push'](_0x2c8d53['shift']());}};_0x1482ec(++_0x2fc3b2);}(_0x9957,0x93));var _0x7995=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x9957[_0x1facfa];return _0x9ec701;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){var _0x514445={},_0x456a28={},_0x3250e0={'count':0x0,'rows':[]};var _0x4253e5=_['map'](db['ChatOfflineMessage']['rawAttributes'],function(_0x3573be){return{'name':_0x3573be[_0x7995('0x2c')],'type':_0x3573be[_0x7995('0x2d')][_0x7995('0x2e')]};});_0x456a28[_0x7995('0x2f')]=_[_0x7995('0x30')](_0x4253e5,'name');_0x456a28['query']=_[_0x7995('0x31')](_0x4b6f99['query']);_0x456a28[_0x7995('0x32')]=_[_0x7995('0x33')](_0x456a28[_0x7995('0x2f')],_0x456a28[_0x7995('0x34')]);_0x514445[_0x7995('0x35')]=_['intersection'](_0x456a28[_0x7995('0x2f')],qs[_0x7995('0x36')](_0x4b6f99['query']['fields']));_0x514445['attributes']=_0x514445[_0x7995('0x35')][_0x7995('0x37')]?_0x514445['attributes']:_0x456a28[_0x7995('0x2f')];if(!_0x4b6f99['query'][_0x7995('0x38')](_0x7995('0x39'))){_0x514445[_0x7995('0x21')]=qs['limit'](_0x4b6f99['query'][_0x7995('0x21')]);_0x514445['offset']=qs['offset'](_0x4b6f99[_0x7995('0x34')][_0x7995('0x20')]);}_0x514445['order']=qs[_0x7995('0x3a')](_0x4b6f99[_0x7995('0x34')][_0x7995('0x3a')]);_0x514445[_0x7995('0x3b')]=qs[_0x7995('0x32')](_['pick'](_0x4b6f99[_0x7995('0x34')],_0x456a28[_0x7995('0x32')]),_0x4253e5);if(_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]){_0x514445['where']=_[_0x7995('0x3d')](_0x514445[_0x7995('0x3b')],{'$or':_[_0x7995('0x30')](_0x4253e5,function(_0xe5ea43){if(_0xe5ea43[_0x7995('0x2d')]!==_0x7995('0x3e')){var _0x5688a1={};_0x5688a1[_0xe5ea43[_0x7995('0x29')]]={'$like':'%'+_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]+'%'};return _0x5688a1;}})});}_0x514445=_[_0x7995('0x3d')]({},_0x514445,_0x4b6f99[_0x7995('0x3f')]);var _0x298fc2={'where':_0x514445[_0x7995('0x3b')]};return db[_0x7995('0x40')][_0x7995('0x1f')](_0x298fc2)[_0x7995('0x26')](function(_0x6fe77b){_0x3250e0[_0x7995('0x1f')]=_0x6fe77b;if(_0x4b6f99[_0x7995('0x34')]['includeAll']){_0x514445['include']=[{'all':!![]}];}return db[_0x7995('0x40')][_0x7995('0x41')](_0x514445);})['then'](function(_0x4b0855){_0x3250e0[_0x7995('0x42')]=_0x4b0855;return _0x3250e0;})['then'](respondWithFilteredResult(_0x9b2a15,_0x514445))['catch'](handleError(_0x9b2a15,null));};exports[_0x7995('0x43')]=function(_0x36e28b,_0x35c8ff){var _0x576b96={'raw':!![],'where':{'id':_0x36e28b['params']['id']}},_0x46ac4f={};_0x46ac4f[_0x7995('0x2f')]=_['keys'](db['ChatOfflineMessage'][_0x7995('0x44')]);_0x46ac4f[_0x7995('0x34')]=_[_0x7995('0x31')](_0x36e28b[_0x7995('0x34')]);_0x46ac4f['filters']=_[_0x7995('0x33')](_0x46ac4f[_0x7995('0x2f')],_0x46ac4f[_0x7995('0x34')]);_0x576b96[_0x7995('0x35')]=_['intersection'](_0x46ac4f['model'],qs[_0x7995('0x36')](_0x36e28b['query'][_0x7995('0x36')]));_0x576b96['attributes']=_0x576b96[_0x7995('0x35')]['length']?_0x576b96[_0x7995('0x35')]:_0x46ac4f[_0x7995('0x2f')];if(_0x36e28b['query'][_0x7995('0x45')]){_0x576b96[_0x7995('0x46')]=[{'all':!![]}];}_0x576b96=_[_0x7995('0x3d')]({},_0x576b96,_0x36e28b[_0x7995('0x3f')]);return db['ChatOfflineMessage'][_0x7995('0x47')](_0x576b96)[_0x7995('0x26')](handleEntityNotFound(_0x35c8ff,null))[_0x7995('0x26')](respondWithResult(_0x35c8ff,null))['catch'](handleError(_0x35c8ff,null));};exports[_0x7995('0x48')]=function(_0x44f516,_0x511567){return db[_0x7995('0x40')][_0x7995('0x48')](_0x44f516['body'],{})[_0x7995('0x26')](respondWithResult(_0x511567,0xc9))[_0x7995('0x49')](handleError(_0x511567,null));};exports['update']=function(_0x3d1dbb,_0x5843ba){if(_0x3d1dbb[_0x7995('0x4a')]['id']){delete _0x3d1dbb[_0x7995('0x4a')]['id'];}return db[_0x7995('0x40')][_0x7995('0x47')]({'where':{'id':_0x3d1dbb[_0x7995('0x4b')]['id']}})[_0x7995('0x26')](handleEntityNotFound(_0x5843ba,null))[_0x7995('0x26')](saveUpdates(_0x3d1dbb['body'],null))[_0x7995('0x26')](respondWithResult(_0x5843ba,null))[_0x7995('0x49')](handleError(_0x5843ba,null));};exports[_0x7995('0x27')]=function(_0x4ffc8a,_0x19da63){return db[_0x7995('0x4c')][_0x7995('0x41')]({'where':{'ChatOfflineMessageId':_0x4ffc8a['params']['id']},'raw':!![]})['then'](function(_0x5a592e){_0x5a592e[_0x7995('0x4d')](function(_0x1fd1ca){var _0x4cf5db=path[_0x7995('0x4e')](config[_0x7995('0x4f')],_0x7995('0x50'),_0x7995('0x51'),_0x7995('0x52'),'offline-chat',_0x1fd1ca[_0x7995('0x53')]);var _0x4ab09f=fs[_0x7995('0x54')](_0x4cf5db);if(_0x4ab09f)fs_extra[_0x7995('0x55')](_0x4cf5db);});})[_0x7995('0x26')](function(){return db['ChatOfflineMessage']['find']({'where':{'id':_0x4ffc8a['params']['id']},'individualHooks':!![]});})['then'](handleEntityNotFound(_0x19da63,null))[_0x7995('0x26')](removeEntity(_0x19da63,null))[_0x7995('0x49')](handleError(_0x19da63,null));};exports[_0x7995('0x56')]=function(_0x150261,_0x1d957e){return db[_0x7995('0x40')][_0x7995('0x56')]()[_0x7995('0x26')](respondWithResult(_0x1d957e,null))[_0x7995('0x49')](handleError(_0x1d957e,null));}; \ No newline at end of file +var _0x7a54=['filter','VIRTUAL','includeAll','include','findAll','rows','show','params','length','merge','options','find','catch','body','Attachment','join','server','attachments','offline-chat','basename','remove','describe','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','ChatOfflineMessage','fieldName','type','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0x2763f2,_0x416af8){var _0x3ef471=function(_0x288aa2){while(--_0x288aa2){_0x2763f2['push'](_0x2763f2['shift']());}};_0x3ef471(++_0x416af8);}(_0x7a54,0x106));var _0x47a5=function(_0x18b00a,_0x562eb2){_0x18b00a=_0x18b00a-0x0;var _0x49a885=_0x7a54[_0x18b00a];return _0x49a885;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x29')]=function(_0x136b14,_0x16631f){var _0x361bfa={},_0x1127f8={},_0x11a4fa={'count':0x0,'rows':[]};var _0x3ad507=_['map'](db[_0x47a5('0x2a')]['rawAttributes'],function(_0x2ef875){return{'name':_0x2ef875[_0x47a5('0x2b')],'type':_0x2ef875[_0x47a5('0x2c')]['key']};});_0x1127f8[_0x47a5('0x2d')]=_[_0x47a5('0x2e')](_0x3ad507,_0x47a5('0x27'));_0x1127f8[_0x47a5('0x2f')]=_['keys'](_0x136b14['query']);_0x1127f8[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x1127f8['model'],_0x1127f8['query']);_0x361bfa[_0x47a5('0x32')]=_[_0x47a5('0x31')](_0x1127f8['model'],qs[_0x47a5('0x33')](_0x136b14['query'][_0x47a5('0x33')]));_0x361bfa[_0x47a5('0x32')]=_0x361bfa['attributes']['length']?_0x361bfa[_0x47a5('0x32')]:_0x1127f8['model'];if(!_0x136b14[_0x47a5('0x2f')][_0x47a5('0x34')](_0x47a5('0x35'))){_0x361bfa['limit']=qs[_0x47a5('0x1d')](_0x136b14['query']['limit']);_0x361bfa[_0x47a5('0x1a')]=qs['offset'](_0x136b14[_0x47a5('0x2f')]['offset']);}_0x361bfa[_0x47a5('0x36')]=qs[_0x47a5('0x37')](_0x136b14[_0x47a5('0x2f')][_0x47a5('0x37')]);_0x361bfa[_0x47a5('0x38')]=qs[_0x47a5('0x30')](_[_0x47a5('0x39')](_0x136b14[_0x47a5('0x2f')],_0x1127f8[_0x47a5('0x30')]),_0x3ad507);if(_0x136b14['query'][_0x47a5('0x3a')]){_0x361bfa[_0x47a5('0x38')]=_['merge'](_0x361bfa[_0x47a5('0x38')],{'$or':_[_0x47a5('0x2e')](_0x3ad507,function(_0x1d4348){if(_0x1d4348['type']!==_0x47a5('0x3b')){var _0x10f660={};_0x10f660[_0x1d4348['name']]={'$like':'%'+_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3a')]+'%'};return _0x10f660;}})});}_0x361bfa=_['merge']({},_0x361bfa,_0x136b14['options']);var _0x5ebd8c={'where':_0x361bfa[_0x47a5('0x38')]};return db['ChatOfflineMessage'][_0x47a5('0x1c')](_0x5ebd8c)[_0x47a5('0x23')](function(_0x301a85){_0x11a4fa[_0x47a5('0x1c')]=_0x301a85;if(_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x361bfa[_0x47a5('0x3d')]=[{'all':!![]}];}return db[_0x47a5('0x2a')][_0x47a5('0x3e')](_0x361bfa);})[_0x47a5('0x23')](function(_0x280500){_0x11a4fa[_0x47a5('0x3f')]=_0x280500;return _0x11a4fa;})[_0x47a5('0x23')](respondWithFilteredResult(_0x16631f,_0x361bfa))['catch'](handleError(_0x16631f,null));};exports[_0x47a5('0x40')]=function(_0x1c36fa,_0x331474){var _0x23bd8d={'raw':!![],'where':{'id':_0x1c36fa[_0x47a5('0x41')]['id']}},_0x586f4f={};_0x586f4f['model']=_['keys'](db['ChatOfflineMessage']['rawAttributes']);_0x586f4f[_0x47a5('0x2f')]=_['keys'](_0x1c36fa[_0x47a5('0x2f')]);_0x586f4f[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x586f4f['model'],_0x586f4f[_0x47a5('0x2f')]);_0x23bd8d[_0x47a5('0x32')]=_['intersection'](_0x586f4f['model'],qs[_0x47a5('0x33')](_0x1c36fa['query'][_0x47a5('0x33')]));_0x23bd8d[_0x47a5('0x32')]=_0x23bd8d[_0x47a5('0x32')][_0x47a5('0x42')]?_0x23bd8d[_0x47a5('0x32')]:_0x586f4f[_0x47a5('0x2d')];if(_0x1c36fa[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x23bd8d[_0x47a5('0x3d')]=[{'all':!![]}];}_0x23bd8d=_[_0x47a5('0x43')]({},_0x23bd8d,_0x1c36fa[_0x47a5('0x44')]);return db[_0x47a5('0x2a')][_0x47a5('0x45')](_0x23bd8d)[_0x47a5('0x23')](handleEntityNotFound(_0x331474,null))[_0x47a5('0x23')](respondWithResult(_0x331474,null))[_0x47a5('0x46')](handleError(_0x331474,null));};exports['create']=function(_0x2d38de,_0x23bb04){return db['ChatOfflineMessage']['create'](_0x2d38de[_0x47a5('0x47')],{})['then'](respondWithResult(_0x23bb04,0xc9))[_0x47a5('0x46')](handleError(_0x23bb04,null));};exports[_0x47a5('0x22')]=function(_0x54c35f,_0x4f62d3){if(_0x54c35f[_0x47a5('0x47')]['id']){delete _0x54c35f['body']['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x54c35f[_0x47a5('0x41')]['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x4f62d3,null))[_0x47a5('0x23')](saveUpdates(_0x54c35f[_0x47a5('0x47')],null))[_0x47a5('0x23')](respondWithResult(_0x4f62d3,null))['catch'](handleError(_0x4f62d3,null));};exports['destroy']=function(_0x2dd1db,_0x411230){return db[_0x47a5('0x48')][_0x47a5('0x3e')]({'where':{'ChatOfflineMessageId':_0x2dd1db[_0x47a5('0x41')]['id']},'raw':!![]})[_0x47a5('0x23')](function(_0x249de5){_0x249de5['forEach'](function(_0x45cca5){var _0x1c9a62=path[_0x47a5('0x49')](config['root'],_0x47a5('0x4a'),'files',_0x47a5('0x4b'),_0x47a5('0x4c'),_0x45cca5[_0x47a5('0x4d')]);var _0xf03bd5=fs['existsSync'](_0x1c9a62);if(_0xf03bd5)fs_extra[_0x47a5('0x4e')](_0x1c9a62);});})[_0x47a5('0x23')](function(){return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x2dd1db[_0x47a5('0x41')]['id']},'individualHooks':!![]});})[_0x47a5('0x23')](handleEntityNotFound(_0x411230,null))[_0x47a5('0x23')](removeEntity(_0x411230,null))['catch'](handleError(_0x411230,null));};exports[_0x47a5('0x4f')]=function(_0x43721b,_0x187d7e){return db[_0x47a5('0x2a')][_0x47a5('0x4f')]()[_0x47a5('0x23')](respondWithResult(_0x187d7e,null))['catch'](handleError(_0x187d7e,null));}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.model.js b/server/api/chatOfflineMessage/chatOfflineMessage.model.js index 44ff5cb..e15699e 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 _0x6334=['rimraf','../../config/environment','./chatOfflineMessage.attributes','exports','chat_offline_messages','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x507a1f,_0x4abed0){var _0x2336f5=function(_0x33e4a6){while(--_0x33e4a6){_0x507a1f['push'](_0x507a1f['shift']());}};_0x2336f5(++_0x4abed0);}(_0x6334,0x142));var _0x4633=function(_0x3d42d8,_0x4cffaa){_0x3d42d8=_0x3d42d8-0x0;var _0x27fc41=_0x6334[_0x3d42d8];return _0x27fc41;};'use strict';var _=require(_0x4633('0x0'));var util=require(_0x4633('0x1'));var logger=require(_0x4633('0x2'))(_0x4633('0x3'));var moment=require(_0x4633('0x4'));var BPromise=require(_0x4633('0x5'));var rp=require(_0x4633('0x6'));var fs=require('fs');var path=require(_0x4633('0x7'));var rimraf=require(_0x4633('0x8'));var config=require(_0x4633('0x9'));var attributes=require(_0x4633('0xa'));module[_0x4633('0xb')]=function(_0x506a81,_0x5939ee){return _0x506a81['define']('ChatOfflineMessage',attributes,{'tableName':_0x4633('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x4633('0xd'),'collate':_0x4633('0xe')});}; \ No newline at end of file +var _0xe5d6=['./chatOfflineMessage.attributes','exports','define','ChatOfflineMessage','chat_offline_messages','utf8mb4_unicode_ci','util','../../config/logger','moment','request-promise','path','rimraf','../../config/environment'];(function(_0x393f98,_0x3cc5c7){var _0x32c37e=function(_0xef7a63){while(--_0xef7a63){_0x393f98['push'](_0x393f98['shift']());}};_0x32c37e(++_0x3cc5c7);}(_0xe5d6,0x88));var _0x6e5d=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0xe5d6[_0x5ddb1c];return _0x354adc;};'use strict';var _=require('lodash');var util=require(_0x6e5d('0x0'));var logger=require(_0x6e5d('0x1'))('api');var moment=require(_0x6e5d('0x2'));var BPromise=require('bluebird');var rp=require(_0x6e5d('0x3'));var fs=require('fs');var path=require(_0x6e5d('0x4'));var rimraf=require(_0x6e5d('0x5'));var config=require(_0x6e5d('0x6'));var attributes=require(_0x6e5d('0x7'));module[_0x6e5d('0x8')]=function(_0x5dc2d9,_0x1dc23b){return _0x5dc2d9[_0x6e5d('0x9')](_0x6e5d('0xa'),attributes,{'tableName':_0x6e5d('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x6e5d('0xc')});}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js index e7450b3..c4492b5 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 _0x295f=['request\x20sent','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','util','moment','bluebird','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ChatOfflineMessage,\x20%s,\x20%s'];(function(_0x392496,_0x31c716){var _0x53d9f4=function(_0x36ee5a){while(--_0x36ee5a){_0x392496['push'](_0x392496['shift']());}};_0x53d9f4(++_0x31c716);}(_0x295f,0x168));var _0xf295=function(_0x4a27d8,_0x27bf8d){_0x4a27d8=_0x4a27d8-0x0;var _0x13a9a6=_0x295f[_0x4a27d8];return _0x13a9a6;};'use strict';var _=require('lodash');var util=require(_0xf295('0x0'));var moment=require(_0xf295('0x1'));var BPromise=require(_0xf295('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf295('0x3'));var db=require(_0xf295('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xf295('0x5'));var config=require(_0xf295('0x6'));var jayson=require(_0xf295('0x7'));var client=jayson[_0xf295('0x8')][_0xf295('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x50a890,_0x2b302f,_0x44e292){return new BPromise(function(_0x1f3320,_0x4041d5){return client[_0xf295('0xa')](_0x50a890,_0x44e292)[_0xf295('0xb')](function(_0xaf1853){logger[_0xf295('0xc')](_0xf295('0xd'),_0x2b302f,_0xf295('0xe'));logger[_0xf295('0xf')](_0xf295('0x10'),_0x2b302f,'request\x20sent',JSON[_0xf295('0x11')](_0xaf1853));if(_0xaf1853[_0xf295('0x12')]){if(_0xaf1853['error'][_0xf295('0x13')]===0x1f4){logger[_0xf295('0x12')](_0xf295('0xd'),_0x2b302f,_0xaf1853[_0xf295('0x12')][_0xf295('0x14')]);return _0x4041d5(_0xaf1853[_0xf295('0x12')][_0xf295('0x14')]);}logger[_0xf295('0x12')](_0xf295('0xd'),_0x2b302f,_0xaf1853[_0xf295('0x12')][_0xf295('0x14')]);return _0x1f3320(_0xaf1853[_0xf295('0x12')][_0xf295('0x14')]);}else{logger[_0xf295('0xc')](_0xf295('0xd'),_0x2b302f,_0xf295('0xe'));_0x1f3320(_0xaf1853[_0xf295('0x15')][_0xf295('0x14')]);}})['catch'](function(_0x57e1bc){logger[_0xf295('0x12')](_0xf295('0xd'),_0x2b302f,_0x57e1bc);_0x4041d5(_0x57e1bc);});});} \ No newline at end of file +var _0x38b4=['ChatOfflineMessage,\x20%s,\x20%s','message','result','catch','lodash','moment','bluebird','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','request\x20sent','error','code'];(function(_0x37a2c0,_0x26d3ba){var _0x3066d1=function(_0xff7021){while(--_0xff7021){_0x37a2c0['push'](_0x37a2c0['shift']());}};_0x3066d1(++_0x26d3ba);}(_0x38b4,0x13f));var _0x438b=function(_0x1da04e,_0x31024b){_0x1da04e=_0x1da04e-0x0;var _0xdd8c41=_0x38b4[_0x1da04e];return _0xdd8c41;};'use strict';var _=require(_0x438b('0x0'));var util=require('util');var moment=require(_0x438b('0x1'));var BPromise=require(_0x438b('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x438b('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x438b('0x4'))(_0x438b('0x5'));var config=require(_0x438b('0x6'));var jayson=require(_0x438b('0x7'));var client=jayson[_0x438b('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x9629a1,_0x3e0c7e,_0x1e421d){return new BPromise(function(_0x39728d,_0x48ae01){return client[_0x438b('0x9')](_0x9629a1,_0x1e421d)[_0x438b('0xa')](function(_0x1b8079){logger[_0x438b('0xb')]('ChatOfflineMessage,\x20%s,\x20%s',_0x3e0c7e,'request\x20sent');logger[_0x438b('0xc')](_0x438b('0xd'),_0x3e0c7e,_0x438b('0xe'),JSON['stringify'](_0x1b8079));if(_0x1b8079[_0x438b('0xf')]){if(_0x1b8079['error'][_0x438b('0x10')]===0x1f4){logger[_0x438b('0xf')](_0x438b('0x11'),_0x3e0c7e,_0x1b8079[_0x438b('0xf')][_0x438b('0x12')]);return _0x48ae01(_0x1b8079[_0x438b('0xf')][_0x438b('0x12')]);}logger['error'](_0x438b('0x11'),_0x3e0c7e,_0x1b8079['error']['message']);return _0x39728d(_0x1b8079[_0x438b('0xf')][_0x438b('0x12')]);}else{logger[_0x438b('0xb')](_0x438b('0x11'),_0x3e0c7e,_0x438b('0xe'));_0x39728d(_0x1b8079[_0x438b('0x13')][_0x438b('0x12')]);}})[_0x438b('0x14')](function(_0x44b3d4){logger[_0x438b('0xf')](_0x438b('0x11'),_0x3e0c7e,_0x44b3d4);_0x48ae01(_0x44b3d4);});});} \ No newline at end of file diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js index 86911b4..2a1d16f 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 _0x2d59=['update','destroy','exports','multer','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatOfflineMessage.controller','get','isAuthenticated','/describe','describe','/:id','show','post','create'];(function(_0x45c262,_0x2e3ce5){var _0x4f2ba6=function(_0x4912d1){while(--_0x4912d1){_0x45c262['push'](_0x45c262['shift']());}};_0x4f2ba6(++_0x2e3ce5);}(_0x2d59,0x93));var _0x92d5=function(_0x14314b,_0x54fba0){_0x14314b=_0x14314b-0x0;var _0x148dc5=_0x2d59[_0x14314b];return _0x148dc5;};'use strict';var multer=require(_0x92d5('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x92d5('0x1'));var router=express[_0x92d5('0x2')]();var fs_extra=require(_0x92d5('0x3'));var auth=require(_0x92d5('0x4'));var interaction=require(_0x92d5('0x5'));var config=require('../../config/environment');var controller=require(_0x92d5('0x6'));router[_0x92d5('0x7')]('/',auth[_0x92d5('0x8')](),controller['index']);router[_0x92d5('0x7')](_0x92d5('0x9'),auth[_0x92d5('0x8')](),controller[_0x92d5('0xa')]);router[_0x92d5('0x7')](_0x92d5('0xb'),auth[_0x92d5('0x8')](),controller[_0x92d5('0xc')]);router[_0x92d5('0xd')]('/',auth[_0x92d5('0x8')](),controller[_0x92d5('0xe')]);router['put']('/:id',auth[_0x92d5('0x8')](),controller[_0x92d5('0xf')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x92d5('0x10')]);module[_0x92d5('0x11')]=router; \ No newline at end of file +var _0xaf35=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatOfflineMessage.controller','index','/describe','isAuthenticated','describe','get','/:id','post','create','put','update','delete','destroy','exports','util','path','connect-timeout'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xaf35,0x1c9));var _0x5af3=function(_0x350343,_0x256f69){_0x350343=_0x350343-0x0;var _0x9afc1c=_0xaf35[_0x350343];return _0x9afc1c;};'use strict';var multer=require('multer');var util=require(_0x5af3('0x0'));var path=require(_0x5af3('0x1'));var timeout=require(_0x5af3('0x2'));var express=require(_0x5af3('0x3'));var router=express[_0x5af3('0x4')]();var fs_extra=require(_0x5af3('0x5'));var auth=require(_0x5af3('0x6'));var interaction=require(_0x5af3('0x7'));var config=require(_0x5af3('0x8'));var controller=require(_0x5af3('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0x5af3('0xa')]);router['get'](_0x5af3('0xb'),auth[_0x5af3('0xc')](),controller[_0x5af3('0xd')]);router[_0x5af3('0xe')](_0x5af3('0xf'),auth[_0x5af3('0xc')](),controller['show']);router[_0x5af3('0x10')]('/',auth[_0x5af3('0xc')](),controller[_0x5af3('0x11')]);router[_0x5af3('0x12')](_0x5af3('0xf'),auth[_0x5af3('0xc')](),controller[_0x5af3('0x13')]);router[_0x5af3('0x14')]('/:id',auth['isAuthenticated'](),controller[_0x5af3('0x15')]);module[_0x5af3('0x16')]=router; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.attributes.js b/server/api/chatProactiveAction/chatProactiveAction.attributes.js index b08752b..ea19597 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 _0x2153=['timeout','STRING','ENUM','mouseOver'];(function(_0x499001,_0x3f27ae){var _0x320c65=function(_0x121fea){while(--_0x121fea){_0x499001['push'](_0x499001['shift']());}};_0x320c65(++_0x3f27ae);}(_0x2153,0x6d));var _0x3215=function(_0xebd0ea,_0x42e607){_0xebd0ea=_0xebd0ea-0x0;var _0x4f2b7c=_0x2153[_0xebd0ea];return _0x4f2b7c;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x3215('0x0')],'allowNull':![]},'type':{'type':Sequelize[_0x3215('0x1')](_0x3215('0x2'),_0x3215('0x3')),'defaultValue':_0x3215('0x2')},'selector':{'type':Sequelize[_0x3215('0x0')]},'timeout':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0xbe4c=['INTEGER','sequelize','STRING','ENUM','mouseOver','timeout'];(function(_0x313840,_0x4a2159){var _0x3c1092=function(_0x355c80){while(--_0x355c80){_0x313840['push'](_0x313840['shift']());}};_0x3c1092(++_0x4a2159);}(_0xbe4c,0x1db));var _0xcbe4=function(_0x323dc9,_0xaca039){_0x323dc9=_0x323dc9-0x0;var _0x474718=_0xbe4c[_0x323dc9];return _0x474718;};'use strict';var Sequelize=require(_0xcbe4('0x0'));module['exports']={'name':{'type':Sequelize[_0xcbe4('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0xcbe4('0x2')](_0xcbe4('0x3'),_0xcbe4('0x4')),'defaultValue':'mouseOver'},'selector':{'type':Sequelize[_0xcbe4('0x1')]},'timeout':{'type':Sequelize[_0xcbe4('0x5')]}}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.controller.js b/server/api/chatProactiveAction/chatProactiveAction.controller.js index 0257953..74cd11a 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 _0xfb8f=['find','catch','create','body','rimraf','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','end','stack','send','show','params','model','keys','ChatProactiveAction','query','filters','attributes','intersection','fields','length','includeAll'];(function(_0x5828c1,_0x5c54a1){var _0x61a7e8=function(_0x4628e4){while(--_0x4628e4){_0x5828c1['push'](_0x5828c1['shift']());}};_0x61a7e8(++_0x5c54a1);}(_0xfb8f,0x18c));var _0xffb8=function(_0x4b2892,_0x5546b2){_0x4b2892=_0x4b2892-0x0;var _0x34aaac=_0xfb8f[_0x4b2892];return _0x34aaac;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xffb8('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xffb8('0x1'));var moment=require(_0xffb8('0x2'));var BPromise=require(_0xffb8('0x3'));var Mustache=require(_0xffb8('0x4'));var util=require(_0xffb8('0x5'));var path=require('path');var sox=require(_0xffb8('0x6'));var csv=require(_0xffb8('0x7'));var ejs=require(_0xffb8('0x8'));var fs=require('fs');var fs_extra=require(_0xffb8('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xffb8('0xa'));var jsforce=require(_0xffb8('0xb'));var deskjs=require(_0xffb8('0xc'));var toCsv=require(_0xffb8('0x7'));var querystring=require(_0xffb8('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xffb8('0xe'));var qs=require(_0xffb8('0xf'));var as=require(_0xffb8('0x10'));var hardwareService=require(_0xffb8('0x11'));var logger=require(_0xffb8('0x12'))('api');var utils=require(_0xffb8('0x13'));var config=require(_0xffb8('0x14'));var licenseUtil=require(_0xffb8('0x15'));var db=require(_0xffb8('0x16'))['db'];function respondWithStatusCode(_0x40d9e4,_0x5498a8){_0x5498a8=_0x5498a8||0xcc;return function(_0x3b4516){if(_0x3b4516){return _0x40d9e4[_0xffb8('0x17')](_0x5498a8);}return _0x40d9e4[_0xffb8('0x18')](_0x5498a8)['end']();};}function respondWithResult(_0x79b08b,_0x5187a3){_0x5187a3=_0x5187a3||0xc8;return function(_0x4a2121){if(_0x4a2121){return _0x79b08b[_0xffb8('0x18')](_0x5187a3)[_0xffb8('0x19')](_0x4a2121);}};}function respondWithFilteredResult(_0x3a423f,_0xbcc782){return function(_0x261c48){if(_0x261c48){var _0x462d8e=typeof _0xbcc782[_0xffb8('0x1a')]===_0xffb8('0x1b')&&typeof _0xbcc782[_0xffb8('0x1c')]==='undefined';var _0x4c835f=_0x261c48[_0xffb8('0x1d')];var _0x514cba=_0x462d8e?0x0:_0xbcc782['offset'];var _0x506284=_0x462d8e?_0x261c48['count']:_0xbcc782[_0xffb8('0x1a')]+_0xbcc782[_0xffb8('0x1c')];var _0x31f5c8;if(_0x506284>=_0x4c835f){_0x506284=_0x4c835f;_0x31f5c8=0xc8;}else{_0x31f5c8=0xce;}_0x3a423f[_0xffb8('0x18')](_0x31f5c8);return _0x3a423f['set'](_0xffb8('0x1e'),_0x514cba+'-'+_0x506284+'/'+_0x4c835f)[_0xffb8('0x19')](_0x261c48);}return null;};}function patchUpdates(_0x2c9e1c){return function(_0x591f51){try{jsonpatch[_0xffb8('0x1f')](_0x591f51,_0x2c9e1c,!![]);}catch(_0x51d7fe){return BPromise[_0xffb8('0x20')](_0x51d7fe);}return _0x591f51[_0xffb8('0x21')]();};}function saveUpdates(_0x5216f0,_0x14be86){return function(_0x39785c){if(_0x39785c){return _0x39785c[_0xffb8('0x22')](_0x5216f0)[_0xffb8('0x23')](function(_0x2e83a2){return _0x2e83a2;});}return null;};}function removeEntity(_0x1813a0,_0x237726){return function(_0x570582){if(_0x570582){return _0x570582[_0xffb8('0x24')]()['then'](function(){_0x1813a0[_0xffb8('0x18')](0xcc)[_0xffb8('0x25')]();});}};}function handleEntityNotFound(_0x59fa17,_0x4b3a25){return function(_0x10927d){if(!_0x10927d){_0x59fa17[_0xffb8('0x17')](0x194);}return _0x10927d;};}function handleError(_0x4d85e1,_0x42f01f){_0x42f01f=_0x42f01f||0x1f4;return function(_0x457bfa){logger['error'](_0x457bfa[_0xffb8('0x26')]);if(_0x457bfa['name']){delete _0x457bfa['name'];}_0x4d85e1[_0xffb8('0x18')](_0x42f01f)[_0xffb8('0x27')](_0x457bfa);};}exports[_0xffb8('0x28')]=function(_0x52e150,_0x5b91bc){var _0x3dd2d1={'raw':!![],'where':{'id':_0x52e150[_0xffb8('0x29')]['id']}},_0x2562fa={};_0x2562fa[_0xffb8('0x2a')]=_[_0xffb8('0x2b')](db[_0xffb8('0x2c')]['rawAttributes']);_0x2562fa[_0xffb8('0x2d')]=_['keys'](_0x52e150[_0xffb8('0x2d')]);_0x2562fa[_0xffb8('0x2e')]=_['intersection'](_0x2562fa[_0xffb8('0x2a')],_0x2562fa[_0xffb8('0x2d')]);_0x3dd2d1[_0xffb8('0x2f')]=_[_0xffb8('0x30')](_0x2562fa[_0xffb8('0x2a')],qs[_0xffb8('0x31')](_0x52e150['query'][_0xffb8('0x31')]));_0x3dd2d1[_0xffb8('0x2f')]=_0x3dd2d1[_0xffb8('0x2f')][_0xffb8('0x32')]?_0x3dd2d1[_0xffb8('0x2f')]:_0x2562fa[_0xffb8('0x2a')];if(_0x52e150[_0xffb8('0x2d')][_0xffb8('0x33')]){_0x3dd2d1['include']=[{'all':!![]}];}_0x3dd2d1=_['merge']({},_0x3dd2d1,_0x52e150['options']);return db[_0xffb8('0x2c')][_0xffb8('0x34')](_0x3dd2d1)[_0xffb8('0x23')](handleEntityNotFound(_0x5b91bc,null))['then'](respondWithResult(_0x5b91bc,null))[_0xffb8('0x35')](handleError(_0x5b91bc,null));};exports[_0xffb8('0x36')]=function(_0x4eb022,_0xde5eb3){return db[_0xffb8('0x2c')]['create'](_0x4eb022['body'],{})[_0xffb8('0x23')](respondWithResult(_0xde5eb3,0xc9))[_0xffb8('0x35')](handleError(_0xde5eb3,null));};exports['update']=function(_0x2f58e1,_0x385a38){if(_0x2f58e1['body']['id']){delete _0x2f58e1[_0xffb8('0x37')]['id'];}return db[_0xffb8('0x2c')][_0xffb8('0x34')]({'where':{'id':_0x2f58e1[_0xffb8('0x29')]['id']}})[_0xffb8('0x23')](handleEntityNotFound(_0x385a38,null))[_0xffb8('0x23')](saveUpdates(_0x2f58e1[_0xffb8('0x37')],null))['then'](respondWithResult(_0x385a38,null))['catch'](handleError(_0x385a38,null));};exports[_0xffb8('0x24')]=function(_0x3b709f,_0x4ed74f){return db['ChatProactiveAction'][_0xffb8('0x34')]({'where':{'id':_0x3b709f[_0xffb8('0x29')]['id']}})['then'](handleEntityNotFound(_0x4ed74f,null))[_0xffb8('0x23')](removeEntity(_0x4ed74f,null))[_0xffb8('0x35')](handleError(_0x4ed74f,null));}; \ No newline at end of file +var _0x1b69=['end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','then','destroy','error','stack','name','send','show','params','model','keys','ChatProactiveAction','rawAttributes','query','filters','intersection','attributes','fields','length','merge','find','catch','create','update','body','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status'];(function(_0x4c4759,_0x503d6b){var _0x5e93d2=function(_0x25e0d0){while(--_0x25e0d0){_0x4c4759['push'](_0x4c4759['shift']());}};_0x5e93d2(++_0x503d6b);}(_0x1b69,0x190));var _0x91b6=function(_0x256b72,_0x340985){_0x256b72=_0x256b72-0x0;var _0x2183e3=_0x1b69[_0x256b72];return _0x2183e3;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x91b6('0x0'));var rp=require(_0x91b6('0x1'));var moment=require(_0x91b6('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x91b6('0x3'));var util=require(_0x91b6('0x4'));var path=require(_0x91b6('0x5'));var sox=require(_0x91b6('0x6'));var csv=require(_0x91b6('0x7'));var ejs=require(_0x91b6('0x8'));var fs=require('fs');var fs_extra=require(_0x91b6('0x9'));var _=require(_0x91b6('0xa'));var squel=require(_0x91b6('0xb'));var crypto=require(_0x91b6('0xc'));var jsforce=require(_0x91b6('0xd'));var deskjs=require(_0x91b6('0xe'));var toCsv=require(_0x91b6('0x7'));var querystring=require(_0x91b6('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x91b6('0x10'));var qs=require(_0x91b6('0x11'));var as=require(_0x91b6('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x91b6('0x13'))(_0x91b6('0x14'));var utils=require(_0x91b6('0x15'));var config=require(_0x91b6('0x16'));var licenseUtil=require(_0x91b6('0x17'));var db=require(_0x91b6('0x18'))['db'];function respondWithStatusCode(_0x4cd206,_0x322317){_0x322317=_0x322317||0xcc;return function(_0x572a5f){if(_0x572a5f){return _0x4cd206[_0x91b6('0x19')](_0x322317);}return _0x4cd206[_0x91b6('0x1a')](_0x322317)[_0x91b6('0x1b')]();};}function respondWithResult(_0x42dc29,_0x4c65e5){_0x4c65e5=_0x4c65e5||0xc8;return function(_0x8ce679){if(_0x8ce679){return _0x42dc29[_0x91b6('0x1a')](_0x4c65e5)[_0x91b6('0x1c')](_0x8ce679);}};}function respondWithFilteredResult(_0x3c3f6f,_0x43acc5){return function(_0x5162ee){if(_0x5162ee){var _0x29841d=typeof _0x43acc5[_0x91b6('0x1d')]===_0x91b6('0x1e')&&typeof _0x43acc5[_0x91b6('0x1f')]==='undefined';var _0x54f004=_0x5162ee[_0x91b6('0x20')];var _0xf29bcf=_0x29841d?0x0:_0x43acc5[_0x91b6('0x1d')];var _0x1693e5=_0x29841d?_0x5162ee[_0x91b6('0x20')]:_0x43acc5[_0x91b6('0x1d')]+_0x43acc5['limit'];var _0x1660af;if(_0x1693e5>=_0x54f004){_0x1693e5=_0x54f004;_0x1660af=0xc8;}else{_0x1660af=0xce;}_0x3c3f6f['status'](_0x1660af);return _0x3c3f6f[_0x91b6('0x21')](_0x91b6('0x22'),_0xf29bcf+'-'+_0x1693e5+'/'+_0x54f004)[_0x91b6('0x1c')](_0x5162ee);}return null;};}function patchUpdates(_0x294422){return function(_0x46e684){try{jsonpatch[_0x91b6('0x23')](_0x46e684,_0x294422,!![]);}catch(_0x4297f1){return BPromise[_0x91b6('0x24')](_0x4297f1);}return _0x46e684['save']();};}function saveUpdates(_0x28fd3d,_0x1b877e){return function(_0xe34dc0){if(_0xe34dc0){return _0xe34dc0['update'](_0x28fd3d)[_0x91b6('0x25')](function(_0x2bba08){return _0x2bba08;});}return null;};}function removeEntity(_0x4e1e2c,_0x53675b){return function(_0x2b5e5c){if(_0x2b5e5c){return _0x2b5e5c[_0x91b6('0x26')]()[_0x91b6('0x25')](function(){_0x4e1e2c[_0x91b6('0x1a')](0xcc)[_0x91b6('0x1b')]();});}};}function handleEntityNotFound(_0x582775,_0x28e36a){return function(_0x2f4197){if(!_0x2f4197){_0x582775['sendStatus'](0x194);}return _0x2f4197;};}function handleError(_0x166c13,_0x410f0f){_0x410f0f=_0x410f0f||0x1f4;return function(_0x27a485){logger[_0x91b6('0x27')](_0x27a485[_0x91b6('0x28')]);if(_0x27a485[_0x91b6('0x29')]){delete _0x27a485[_0x91b6('0x29')];}_0x166c13[_0x91b6('0x1a')](_0x410f0f)[_0x91b6('0x2a')](_0x27a485);};}exports[_0x91b6('0x2b')]=function(_0x51d011,_0x52c8f0){var _0x1c3595={'raw':!![],'where':{'id':_0x51d011[_0x91b6('0x2c')]['id']}},_0x2993ba={};_0x2993ba[_0x91b6('0x2d')]=_[_0x91b6('0x2e')](db[_0x91b6('0x2f')][_0x91b6('0x30')]);_0x2993ba[_0x91b6('0x31')]=_[_0x91b6('0x2e')](_0x51d011[_0x91b6('0x31')]);_0x2993ba[_0x91b6('0x32')]=_[_0x91b6('0x33')](_0x2993ba[_0x91b6('0x2d')],_0x2993ba[_0x91b6('0x31')]);_0x1c3595[_0x91b6('0x34')]=_[_0x91b6('0x33')](_0x2993ba[_0x91b6('0x2d')],qs[_0x91b6('0x35')](_0x51d011[_0x91b6('0x31')][_0x91b6('0x35')]));_0x1c3595[_0x91b6('0x34')]=_0x1c3595['attributes'][_0x91b6('0x36')]?_0x1c3595[_0x91b6('0x34')]:_0x2993ba[_0x91b6('0x2d')];if(_0x51d011[_0x91b6('0x31')]['includeAll']){_0x1c3595['include']=[{'all':!![]}];}_0x1c3595=_[_0x91b6('0x37')]({},_0x1c3595,_0x51d011['options']);return db[_0x91b6('0x2f')][_0x91b6('0x38')](_0x1c3595)['then'](handleEntityNotFound(_0x52c8f0,null))['then'](respondWithResult(_0x52c8f0,null))[_0x91b6('0x39')](handleError(_0x52c8f0,null));};exports[_0x91b6('0x3a')]=function(_0x488106,_0x25d32c){return db[_0x91b6('0x2f')][_0x91b6('0x3a')](_0x488106['body'],{})[_0x91b6('0x25')](respondWithResult(_0x25d32c,0xc9))[_0x91b6('0x39')](handleError(_0x25d32c,null));};exports[_0x91b6('0x3b')]=function(_0x5e7f6e,_0x17b655){if(_0x5e7f6e[_0x91b6('0x3c')]['id']){delete _0x5e7f6e[_0x91b6('0x3c')]['id'];}return db[_0x91b6('0x2f')][_0x91b6('0x38')]({'where':{'id':_0x5e7f6e[_0x91b6('0x2c')]['id']}})[_0x91b6('0x25')](handleEntityNotFound(_0x17b655,null))[_0x91b6('0x25')](saveUpdates(_0x5e7f6e[_0x91b6('0x3c')],null))[_0x91b6('0x25')](respondWithResult(_0x17b655,null))[_0x91b6('0x39')](handleError(_0x17b655,null));};exports[_0x91b6('0x26')]=function(_0x1f4d28,_0x5c609b){return db['ChatProactiveAction'][_0x91b6('0x38')]({'where':{'id':_0x1f4d28['params']['id']}})[_0x91b6('0x25')](handleEntityNotFound(_0x5c609b,null))[_0x91b6('0x25')](removeEntity(_0x5c609b,null))[_0x91b6('0x39')](handleError(_0x5c609b,null));}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js index 01bd366..5c580d5 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 _0x52fe=['../../config/logger','moment','bluebird','path','rimraf','./chatProactiveAction.attributes','exports','define','ChatProactiveAction','util'];(function(_0x497a88,_0x300eb7){var _0x5a301d=function(_0x9e4e0e){while(--_0x9e4e0e){_0x497a88['push'](_0x497a88['shift']());}};_0x5a301d(++_0x300eb7);}(_0x52fe,0x77));var _0xe52f=function(_0x3f6add,_0x3767a2){_0x3f6add=_0x3f6add-0x0;var _0x79f224=_0x52fe[_0x3f6add];return _0x79f224;};'use strict';var _=require('lodash');var util=require(_0xe52f('0x0'));var logger=require(_0xe52f('0x1'))('api');var moment=require(_0xe52f('0x2'));var BPromise=require(_0xe52f('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe52f('0x4'));var rimraf=require(_0xe52f('0x5'));var config=require('../../config/environment');var attributes=require(_0xe52f('0x6'));module[_0xe52f('0x7')]=function(_0x46f0ab,_0x3cdb70){return _0x46f0ab[_0xe52f('0x8')](_0xe52f('0x9'),attributes,{'tableName':'chat_proactive_actions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9107=['rimraf','./chatProactiveAction.attributes','exports','define','chat_proactive_actions','lodash','util','../../config/logger','moment','request-promise','path'];(function(_0x3e8270,_0x293590){var _0x1ccde9=function(_0x213490){while(--_0x213490){_0x3e8270['push'](_0x3e8270['shift']());}};_0x1ccde9(++_0x293590);}(_0x9107,0xd6));var _0x7910=function(_0x2d315b,_0x507dfb){_0x2d315b=_0x2d315b-0x0;var _0x526cab=_0x9107[_0x2d315b];return _0x526cab;};'use strict';var _=require(_0x7910('0x0'));var util=require(_0x7910('0x1'));var logger=require(_0x7910('0x2'))('api');var moment=require(_0x7910('0x3'));var BPromise=require('bluebird');var rp=require(_0x7910('0x4'));var fs=require('fs');var path=require(_0x7910('0x5'));var rimraf=require(_0x7910('0x6'));var config=require('../../config/environment');var attributes=require(_0x7910('0x7'));module[_0x7910('0x8')]=function(_0x2e998e,_0x36daf0){return _0x2e998e[_0x7910('0x9')]('ChatProactiveAction',attributes,{'tableName':_0x7910('0xa'),'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 8b6b77a..428e108 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 _0xe951=['ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','randomstring'];(function(_0x1abc86,_0x57e03c){var _0x11ddc1=function(_0x4b36c4){while(--_0x4b36c4){_0x1abc86['push'](_0x1abc86['shift']());}};_0x11ddc1(++_0x57e03c);}(_0xe951,0xed));var _0x1e95=function(_0x470d22,_0x1b6a4f){_0x470d22=_0x470d22-0x0;var _0x3cc44d=_0xe951[_0x470d22];return _0x3cc44d;};'use strict';var _=require(_0x1e95('0x0'));var util=require(_0x1e95('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x1e95('0x2'));var fs=require('fs');var Redis=require(_0x1e95('0x3'));var db=require(_0x1e95('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x1e95('0x5'))(_0x1e95('0x6'));var config=require(_0x1e95('0x7'));var jayson=require(_0x1e95('0x8'));var client=jayson[_0x1e95('0x9')][_0x1e95('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x294874,_0x23bb84,_0x2fc296){return new BPromise(function(_0x3a2c81,_0x57349a){return client['request'](_0x294874,_0x2fc296)['then'](function(_0x53a4ec){logger[_0x1e95('0xb')](_0x1e95('0xc'),_0x23bb84,'request\x20sent');logger['debug']('ChatProactiveAction,\x20%s,\x20%s,\x20%s',_0x23bb84,_0x1e95('0xd'),JSON[_0x1e95('0xe')](_0x53a4ec));if(_0x53a4ec[_0x1e95('0xf')]){if(_0x53a4ec['error'][_0x1e95('0x10')]===0x1f4){logger[_0x1e95('0xf')](_0x1e95('0xc'),_0x23bb84,_0x53a4ec['error'][_0x1e95('0x11')]);return _0x57349a(_0x53a4ec[_0x1e95('0xf')]['message']);}logger[_0x1e95('0xf')]('ChatProactiveAction,\x20%s,\x20%s',_0x23bb84,_0x53a4ec[_0x1e95('0xf')][_0x1e95('0x11')]);return _0x3a2c81(_0x53a4ec[_0x1e95('0xf')][_0x1e95('0x11')]);}else{logger[_0x1e95('0xb')](_0x1e95('0xc'),_0x23bb84,_0x1e95('0xd'));_0x3a2c81(_0x53a4ec[_0x1e95('0x12')]['message']);}})[_0x1e95('0x13')](function(_0x32d753){logger['error'](_0x1e95('0xc'),_0x23bb84,_0x32d753);_0x57349a(_0x32d753);});});} \ No newline at end of file +var _0xfe2c=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','ChatProactiveAction,\x20%s,\x20%s','catch','lodash','util'];(function(_0x4fde08,_0x463a36){var _0x12e725=function(_0x2670c5){while(--_0x2670c5){_0x4fde08['push'](_0x4fde08['shift']());}};_0x12e725(++_0x463a36);}(_0xfe2c,0x1d2));var _0xcfe2=function(_0x54cb56,_0x5968fb){_0x54cb56=_0x54cb56-0x0;var _0x579bb7=_0xfe2c[_0x54cb56];return _0x579bb7;};'use strict';var _=require(_0xcfe2('0x0'));var util=require(_0xcfe2('0x1'));var moment=require(_0xcfe2('0x2'));var BPromise=require(_0xcfe2('0x3'));var rs=require(_0xcfe2('0x4'));var fs=require('fs');var Redis=require(_0xcfe2('0x5'));var db=require(_0xcfe2('0x6'))['db'];var utils=require(_0xcfe2('0x7'));var logger=require(_0xcfe2('0x8'))(_0xcfe2('0x9'));var config=require(_0xcfe2('0xa'));var jayson=require(_0xcfe2('0xb'));var client=jayson[_0xcfe2('0xc')][_0xcfe2('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x5b6c0f,_0x3f3500,_0x58d2df){return new BPromise(function(_0x220dd7,_0x3c7aad){return client[_0xcfe2('0xe')](_0x5b6c0f,_0x58d2df)[_0xcfe2('0xf')](function(_0x81ca91){logger[_0xcfe2('0x10')]('ChatProactiveAction,\x20%s,\x20%s',_0x3f3500,'request\x20sent');logger[_0xcfe2('0x11')](_0xcfe2('0x12'),_0x3f3500,_0xcfe2('0x13'),JSON[_0xcfe2('0x14')](_0x81ca91));if(_0x81ca91[_0xcfe2('0x15')]){if(_0x81ca91[_0xcfe2('0x15')][_0xcfe2('0x16')]===0x1f4){logger[_0xcfe2('0x15')]('ChatProactiveAction,\x20%s,\x20%s',_0x3f3500,_0x81ca91[_0xcfe2('0x15')]['message']);return _0x3c7aad(_0x81ca91[_0xcfe2('0x15')][_0xcfe2('0x17')]);}logger[_0xcfe2('0x15')](_0xcfe2('0x18'),_0x3f3500,_0x81ca91[_0xcfe2('0x15')][_0xcfe2('0x17')]);return _0x220dd7(_0x81ca91[_0xcfe2('0x15')][_0xcfe2('0x17')]);}else{logger[_0xcfe2('0x10')](_0xcfe2('0x18'),_0x3f3500,_0xcfe2('0x13'));_0x220dd7(_0x81ca91['result']['message']);}})[_0xcfe2('0x19')](function(_0x560177){logger[_0xcfe2('0x15')](_0xcfe2('0x18'),_0x3f3500,_0x560177);_0x3c7aad(_0x560177);});});} \ No newline at end of file diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js index 306a678..1245969 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 _0xbd51=['show','post','isAuthenticated','create','put','delete','destroy','exports','multer','path','connect-timeout','express','Router','./chatProactiveAction.controller','get','/:id'];(function(_0x250a98,_0x1d0ef1){var _0x487ffe=function(_0x3ba181){while(--_0x3ba181){_0x250a98['push'](_0x250a98['shift']());}};_0x487ffe(++_0x1d0ef1);}(_0xbd51,0x1a8));var _0x1bd5=function(_0x2aa4b2,_0x499f41){_0x2aa4b2=_0x2aa4b2-0x0;var _0x44a0e7=_0xbd51[_0x2aa4b2];return _0x44a0e7;};'use strict';var multer=require(_0x1bd5('0x0'));var util=require('util');var path=require(_0x1bd5('0x1'));var timeout=require(_0x1bd5('0x2'));var express=require(_0x1bd5('0x3'));var router=express[_0x1bd5('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x1bd5('0x5'));router[_0x1bd5('0x6')](_0x1bd5('0x7'),auth['isAuthenticated'](),controller[_0x1bd5('0x8')]);router[_0x1bd5('0x9')]('/',auth[_0x1bd5('0xa')](),controller[_0x1bd5('0xb')]);router[_0x1bd5('0xc')]('/:id',auth[_0x1bd5('0xa')](),controller['update']);router[_0x1bd5('0xd')](_0x1bd5('0x7'),auth[_0x1bd5('0xa')](),controller[_0x1bd5('0xe')]);module[_0x1bd5('0xf')]=router; \ No newline at end of file +var _0x2bd8=['multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatProactiveAction.controller','get','/:id','show','post','isAuthenticated','create','exports'];(function(_0x386c3e,_0x44a375){var _0x4b8e13=function(_0x583c8f){while(--_0x583c8f){_0x386c3e['push'](_0x386c3e['shift']());}};_0x4b8e13(++_0x44a375);}(_0x2bd8,0x130));var _0x82bd=function(_0x392dab,_0x586519){_0x392dab=_0x392dab-0x0;var _0x9f4f11=_0x2bd8[_0x392dab];return _0x9f4f11;};'use strict';var multer=require(_0x82bd('0x0'));var util=require('util');var path=require(_0x82bd('0x1'));var timeout=require(_0x82bd('0x2'));var express=require(_0x82bd('0x3'));var router=express[_0x82bd('0x4')]();var fs_extra=require(_0x82bd('0x5'));var auth=require(_0x82bd('0x6'));var interaction=require(_0x82bd('0x7'));var config=require('../../config/environment');var controller=require(_0x82bd('0x8'));router[_0x82bd('0x9')](_0x82bd('0xa'),auth['isAuthenticated'](),controller[_0x82bd('0xb')]);router[_0x82bd('0xc')]('/',auth[_0x82bd('0xd')](),controller[_0x82bd('0xe')]);router['put'](_0x82bd('0xa'),auth['isAuthenticated'](),controller['update']);router['delete'](_0x82bd('0xa'),auth['isAuthenticated'](),controller['destroy']);module[_0x82bd('0xf')]=router; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.attributes.js b/server/api/chatQueue/chatQueue.attributes.js index fa22584..0a5ce47 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 _0x8eea=['roundrobin','sequelize','exports','name','STRING','ENUM','rrmemory'];(function(_0x2f7c06,_0x1ff273){var _0x14c390=function(_0x17e81b){while(--_0x17e81b){_0x2f7c06['push'](_0x2f7c06['shift']());}};_0x14c390(++_0x1ff273);}(_0x8eea,0x166));var _0xa8ee=function(_0x18cd5b,_0x10240b){_0x18cd5b=_0x18cd5b-0x0;var _0x5eaa52=_0x8eea[_0x18cd5b];return _0x5eaa52;};'use strict';var Sequelize=require(_0xa8ee('0x0'));module[_0xa8ee('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xa8ee('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xa8ee('0x3')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xa8ee('0x4')](_0xa8ee('0x5'),'beepall',_0xa8ee('0x6'))}}; \ No newline at end of file +var _0xae56=['exports','STRING','name','INTEGER','sequelize'];(function(_0x3df871,_0xda2e11){var _0x570f7b=function(_0xfaac78){while(--_0xfaac78){_0x3df871['push'](_0x3df871['shift']());}};_0x570f7b(++_0xda2e11);}(_0xae56,0x17b));var _0x6ae5=function(_0x213e94,_0x46b9df){_0x213e94=_0x213e94-0x0;var _0x50e258=_0xae56[_0x213e94];return _0x50e258;};'use strict';var Sequelize=require(_0x6ae5('0x0'));module[_0x6ae5('0x1')]={'name':{'type':Sequelize[_0x6ae5('0x2')],'unique':_0x6ae5('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x6ae5('0x2')]},'timeout':{'type':Sequelize[_0x6ae5('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM']('rrmemory','beepall','roundrobin')}}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js index a30421a..12432f2 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 _0x2720=['request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','destroy','get','ChatQueues','UserProfileResource','sendStatus','stack','name','send','index','map','ChatQueue','rawAttributes','fieldName','key','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','show','params','includeAll','find','catch','create','body','user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserChatQueue','length','ChatQueueId','User','findAndCountAll','UserId','agent','chatPause','updatedAt','format','%s/%s','SIP','createdAt','Team','getTeams','addTeams','ids','Agents','online','voicePause','interface','flatMap','sequelize','transaction','each','findOrCreate','forEach','emit','userChatQueue:save','field','tq.TeamId','from','team_has_chat_queues','join','ChatQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','TeamId','includes','all','union','compact','value','removeAgents','userChatQueue:remove','addAgents','omit','spread','isArray','getAgents','fast-json-patch','moment','util','path','sox','to-csv','ejs','lodash','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./chatQueue.socket','register','jayson/promise','http','then','info','ChatQueue,\x20%s,\x20%s'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x2720,0x1b0));var _0x0272=function(_0x4591ca,_0x147b15){_0x4591ca=_0x4591ca-0x0;var _0x4688f2=_0x2720[_0x4591ca];return _0x4688f2;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x0272('0x0'));var rp=require('request-promise');var moment=require(_0x0272('0x1'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x0272('0x2'));var path=require(_0x0272('0x3'));var sox=require(_0x0272('0x4'));var csv=require(_0x0272('0x5'));var ejs=require(_0x0272('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0272('0x7'));var squel=require('squel');var crypto=require(_0x0272('0x8'));var jsforce=require('jsforce');var deskjs=require(_0x0272('0x9'));var toCsv=require(_0x0272('0x5'));var querystring=require('querystring');var Papa=require(_0x0272('0xa'));var Redis=require(_0x0272('0xb'));var authService=require(_0x0272('0xc'));var qs=require('../../components/parsers/qs');var as=require(_0x0272('0xd'));var hardwareService=require(_0x0272('0xe'));var logger=require('../../config/logger')(_0x0272('0xf'));var utils=require(_0x0272('0x10'));var config=require(_0x0272('0x11'));var licenseUtil=require(_0x0272('0x12'));var db=require(_0x0272('0x13'))['db'];config[_0x0272('0x14')]=_[_0x0272('0x15')](config[_0x0272('0x14')],{'host':'localhost','port':0x18eb});var socket=require(_0x0272('0x16'))(new Redis(config['redis']));require(_0x0272('0x17'))[_0x0272('0x18')](socket);var jayson=require(_0x0272('0x19'));var client=jayson['client'][_0x0272('0x1a')]({'port':0x232a});function respondWithRpcPromise(_0x3eecbc,_0x16aea2,_0x35315a,_0x7bd5e6){return new BPromise(function(_0x435ca4,_0x519fa0){var _0x320025=_0x7bd5e6||client;return _0x320025['request'](_0x3eecbc,_0x35315a)[_0x0272('0x1b')](function(_0x3f3240){logger[_0x0272('0x1c')](_0x0272('0x1d'),_0x16aea2,_0x0272('0x1e'));logger[_0x0272('0x1f')](_0x0272('0x20'),_0x16aea2,_0x0272('0x1e'),JSON[_0x0272('0x21')](_0x3f3240));if(_0x3f3240[_0x0272('0x22')]){if(_0x3f3240['error'][_0x0272('0x23')]===0x1f4){logger[_0x0272('0x22')]('ChatQueue,\x20%s,\x20%s',_0x16aea2,_0x3f3240[_0x0272('0x22')][_0x0272('0x24')]);return _0x519fa0(_0x3f3240[_0x0272('0x22')][_0x0272('0x24')]);}logger[_0x0272('0x22')](_0x0272('0x1d'),_0x16aea2,_0x3f3240[_0x0272('0x22')][_0x0272('0x24')]);return _0x435ca4(_0x3f3240[_0x0272('0x22')]['message']);}else{logger[_0x0272('0x1c')](_0x0272('0x1d'),_0x16aea2,_0x0272('0x1e'));_0x435ca4(_0x3f3240[_0x0272('0x25')][_0x0272('0x24')]);}})['catch'](function(_0x3554c6){logger[_0x0272('0x22')](_0x0272('0x1d'),_0x16aea2,_0x3554c6);_0x519fa0(_0x3554c6);});});}function respondWithStatusCode(_0x5de12e,_0x28ecfc){_0x28ecfc=_0x28ecfc||0xcc;return function(_0x5d375d){if(_0x5d375d){return _0x5de12e['sendStatus'](_0x28ecfc);}return _0x5de12e[_0x0272('0x26')](_0x28ecfc)[_0x0272('0x27')]();};}function respondWithResult(_0x2e31c9,_0x106e77){_0x106e77=_0x106e77||0xc8;return function(_0xc1a6c1){if(_0xc1a6c1){return _0x2e31c9[_0x0272('0x26')](_0x106e77)[_0x0272('0x28')](_0xc1a6c1);}};}function respondWithFilteredResult(_0x3cb11f,_0x4c514e){return function(_0x1f67b7){if(_0x1f67b7){var _0x18117b=typeof _0x4c514e[_0x0272('0x29')]===_0x0272('0x2a')&&typeof _0x4c514e[_0x0272('0x2b')]==='undefined';var _0x389933=_0x1f67b7[_0x0272('0x2c')];var _0x59aacb=_0x18117b?0x0:_0x4c514e['offset'];var _0x3987fe=_0x18117b?_0x1f67b7[_0x0272('0x2c')]:_0x4c514e[_0x0272('0x29')]+_0x4c514e[_0x0272('0x2b')];var _0x899332;if(_0x3987fe>=_0x389933){_0x3987fe=_0x389933;_0x899332=0xc8;}else{_0x899332=0xce;}_0x3cb11f[_0x0272('0x26')](_0x899332);return _0x3cb11f[_0x0272('0x2d')](_0x0272('0x2e'),_0x59aacb+'-'+_0x3987fe+'/'+_0x389933)[_0x0272('0x28')](_0x1f67b7);}return null;};}function patchUpdates(_0x3d0efa){return function(_0x440e92){try{jsonpatch[_0x0272('0x2f')](_0x440e92,_0x3d0efa,!![]);}catch(_0x4e0825){return BPromise[_0x0272('0x30')](_0x4e0825);}return _0x440e92['save']();};}function saveUpdates(_0x37ac2d,_0x41e7a7){return function(_0x59c60e){if(_0x59c60e){return _0x59c60e[_0x0272('0x31')](_0x37ac2d)[_0x0272('0x1b')](function(_0x5332ba){return _0x5332ba;});}return null;};}function removeEntity(_0x506ae3,_0x43bd66){return function(_0xdb5ba2){if(_0xdb5ba2){return _0xdb5ba2[_0x0272('0x32')]()[_0x0272('0x1b')](function(){var _0x2c73ef=_0xdb5ba2[_0x0272('0x33')]({'plain':!![]});var _0x3248ea=_0x0272('0x34');return db[_0x0272('0x35')][_0x0272('0x32')]({'where':{'type':_0x3248ea,'resourceId':_0x2c73ef['id']}})[_0x0272('0x1b')](function(){return _0xdb5ba2;});})[_0x0272('0x1b')](function(){_0x506ae3['status'](0xcc)[_0x0272('0x27')]();});}};}function handleEntityNotFound(_0x46b6a8,_0x4def48){return function(_0x1fd736){if(!_0x1fd736){_0x46b6a8[_0x0272('0x36')](0x194);}return _0x1fd736;};}function handleError(_0x3a793b,_0x335b3d){_0x335b3d=_0x335b3d||0x1f4;return function(_0x1b50fb){logger['error'](_0x1b50fb[_0x0272('0x37')]);if(_0x1b50fb['name']){delete _0x1b50fb[_0x0272('0x38')];}_0x3a793b[_0x0272('0x26')](_0x335b3d)[_0x0272('0x39')](_0x1b50fb);};}exports[_0x0272('0x3a')]=function(_0x64e6ab,_0x51c016){var _0x1963a4={},_0x180aad={},_0x37065c={'count':0x0,'rows':[]};var _0x5edf79=_[_0x0272('0x3b')](db[_0x0272('0x3c')][_0x0272('0x3d')],function(_0x3f4ab4){return{'name':_0x3f4ab4[_0x0272('0x3e')],'type':_0x3f4ab4['type'][_0x0272('0x3f')]};});_0x180aad['model']=_[_0x0272('0x3b')](_0x5edf79,_0x0272('0x38'));_0x180aad[_0x0272('0x40')]=_[_0x0272('0x41')](_0x64e6ab[_0x0272('0x40')]);_0x180aad[_0x0272('0x42')]=_[_0x0272('0x43')](_0x180aad[_0x0272('0x44')],_0x180aad[_0x0272('0x40')]);_0x1963a4[_0x0272('0x45')]=_['intersection'](_0x180aad[_0x0272('0x44')],qs[_0x0272('0x46')](_0x64e6ab[_0x0272('0x40')][_0x0272('0x46')]));_0x1963a4['attributes']=_0x1963a4[_0x0272('0x45')]['length']?_0x1963a4[_0x0272('0x45')]:_0x180aad[_0x0272('0x44')];if(!_0x64e6ab[_0x0272('0x40')][_0x0272('0x47')](_0x0272('0x48'))){_0x1963a4[_0x0272('0x2b')]=qs[_0x0272('0x2b')](_0x64e6ab[_0x0272('0x40')][_0x0272('0x2b')]);_0x1963a4[_0x0272('0x29')]=qs[_0x0272('0x29')](_0x64e6ab[_0x0272('0x40')][_0x0272('0x29')]);}_0x1963a4[_0x0272('0x49')]=qs['sort'](_0x64e6ab[_0x0272('0x40')][_0x0272('0x4a')]);_0x1963a4[_0x0272('0x4b')]=qs[_0x0272('0x42')](_[_0x0272('0x4c')](_0x64e6ab[_0x0272('0x40')],_0x180aad[_0x0272('0x42')]),_0x5edf79);if(_0x64e6ab[_0x0272('0x40')][_0x0272('0x4d')]){_0x1963a4[_0x0272('0x4b')]=_[_0x0272('0x4e')](_0x1963a4[_0x0272('0x4b')],{'$or':_[_0x0272('0x3b')](_0x5edf79,function(_0x34aab0){if(_0x34aab0['type']!==_0x0272('0x4f')){var _0x361fdb={};_0x361fdb[_0x34aab0[_0x0272('0x38')]]={'$like':'%'+_0x64e6ab[_0x0272('0x40')][_0x0272('0x4d')]+'%'};return _0x361fdb;}})});}_0x1963a4=_['merge']({},_0x1963a4,_0x64e6ab[_0x0272('0x50')]);var _0x392034={'where':_0x1963a4[_0x0272('0x4b')]};return db[_0x0272('0x3c')]['count'](_0x392034)['then'](function(_0x1c133a){_0x37065c[_0x0272('0x2c')]=_0x1c133a;if(_0x64e6ab['query']['includeAll']){_0x1963a4[_0x0272('0x51')]=[{'all':!![]}];}return db[_0x0272('0x3c')][_0x0272('0x52')](_0x1963a4);})[_0x0272('0x1b')](function(_0x18088b){_0x37065c[_0x0272('0x53')]=_0x18088b;return _0x37065c;})[_0x0272('0x1b')](respondWithFilteredResult(_0x51c016,_0x1963a4))['catch'](handleError(_0x51c016,null));};exports[_0x0272('0x54')]=function(_0x5e4773,_0x26fd4c){var _0x5d5969={'raw':!![],'where':{'id':_0x5e4773[_0x0272('0x55')]['id']}},_0x54d0dc={};_0x54d0dc[_0x0272('0x44')]=_['keys'](db[_0x0272('0x3c')][_0x0272('0x3d')]);_0x54d0dc[_0x0272('0x40')]=_[_0x0272('0x41')](_0x5e4773[_0x0272('0x40')]);_0x54d0dc[_0x0272('0x42')]=_[_0x0272('0x43')](_0x54d0dc[_0x0272('0x44')],_0x54d0dc[_0x0272('0x40')]);_0x5d5969['attributes']=_[_0x0272('0x43')](_0x54d0dc[_0x0272('0x44')],qs[_0x0272('0x46')](_0x5e4773[_0x0272('0x40')]['fields']));_0x5d5969['attributes']=_0x5d5969[_0x0272('0x45')]['length']?_0x5d5969[_0x0272('0x45')]:_0x54d0dc[_0x0272('0x44')];if(_0x5e4773[_0x0272('0x40')][_0x0272('0x56')]){_0x5d5969['include']=[{'all':!![]}];}_0x5d5969=_[_0x0272('0x4e')]({},_0x5d5969,_0x5e4773[_0x0272('0x50')]);return db[_0x0272('0x3c')][_0x0272('0x57')](_0x5d5969)[_0x0272('0x1b')](handleEntityNotFound(_0x26fd4c,null))[_0x0272('0x1b')](respondWithResult(_0x26fd4c,null))[_0x0272('0x58')](handleError(_0x26fd4c,null));};exports[_0x0272('0x59')]=function(_0x34c762,_0x3f5e8c){return db[_0x0272('0x3c')]['create'](_0x34c762[_0x0272('0x5a')],{})['then'](function(_0x1bd51a){var _0x31b2ab=_0x34c762[_0x0272('0x5b')]['get']({'plain':!![]});if(!_0x31b2ab)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x31b2ab[_0x0272('0x5c')]==='user'){var _0x40067d=_0x1bd51a[_0x0272('0x33')]({'plain':!![]});var _0x4c224a=_0x0272('0x34');return db[_0x0272('0x5d')][_0x0272('0x57')]({'where':{'name':_0x4c224a,'userProfileId':_0x31b2ab[_0x0272('0x5e')]},'raw':!![]})[_0x0272('0x1b')](function(_0x2ed7cb){if(_0x2ed7cb&&_0x2ed7cb[_0x0272('0x5f')]===0x0){return db[_0x0272('0x35')][_0x0272('0x59')]({'name':_0x40067d[_0x0272('0x38')],'resourceId':_0x40067d['id'],'type':_0x2ed7cb[_0x0272('0x38')],'sectionId':_0x2ed7cb['id']},{})['then'](function(){return _0x1bd51a;});}else{return _0x1bd51a;}})['catch'](function(_0x2708d9){logger[_0x0272('0x22')](_0x0272('0x60'),_0x2708d9);throw _0x2708d9;});}return _0x1bd51a;})[_0x0272('0x1b')](respondWithResult(_0x3f5e8c,0xc9))[_0x0272('0x58')](handleError(_0x3f5e8c,null));};exports[_0x0272('0x31')]=function(_0x465960,_0x38ded4){if(_0x465960['body']['id']){delete _0x465960['body']['id'];}return db[_0x0272('0x3c')][_0x0272('0x57')]({'where':{'id':_0x465960['params']['id']}})[_0x0272('0x1b')](handleEntityNotFound(_0x38ded4,null))[_0x0272('0x1b')](saveUpdates(_0x465960[_0x0272('0x5a')],null))[_0x0272('0x1b')](respondWithResult(_0x38ded4,null))[_0x0272('0x58')](handleError(_0x38ded4,null));};exports[_0x0272('0x32')]=function(_0x2e4348,_0x359f2c){return db[_0x0272('0x3c')][_0x0272('0x57')]({'where':{'id':_0x2e4348[_0x0272('0x55')]['id']}})[_0x0272('0x1b')](handleEntityNotFound(_0x359f2c,null))[_0x0272('0x1b')](removeEntity(_0x359f2c,null))[_0x0272('0x58')](handleError(_0x359f2c,null));};exports[_0x0272('0x61')]=function(_0x96b3dd,_0x229757){return db['ChatQueue'][_0x0272('0x61')]()[_0x0272('0x1b')](respondWithResult(_0x229757,null))[_0x0272('0x58')](handleError(_0x229757,null));};exports[_0x0272('0x62')]=function(_0x3091b6,_0x3053ff,_0x429687){var _0x551b06={'raw':!![],'where':{}},_0x21e946={},_0x3526b0;return db['ChatQueue'][_0x0272('0x63')]({'where':{'id':_0x3091b6[_0x0272('0x55')]['id']}})[_0x0272('0x1b')](handleEntityNotFound(_0x3053ff,null))['then'](function(_0x3148d1){if(_0x3148d1){_0x3526b0=_0x3148d1['get']({'plain':!![]});_0x21e946[_0x0272('0x44')]=_['keys'](db[_0x0272('0x64')][_0x0272('0x3d')]);_0x21e946[_0x0272('0x40')]=_[_0x0272('0x41')](_0x3091b6[_0x0272('0x40')]);_0x21e946['filters']=_['intersection'](_0x21e946[_0x0272('0x44')],_0x21e946[_0x0272('0x40')]);_0x551b06['attributes']=_['intersection'](_0x21e946['model'],qs[_0x0272('0x46')](_0x3091b6['query']['fields']));_0x551b06[_0x0272('0x45')]=_0x551b06[_0x0272('0x45')][_0x0272('0x65')]?_0x551b06[_0x0272('0x45')]:_0x21e946[_0x0272('0x44')];if(!_0x3091b6['query'][_0x0272('0x47')](_0x0272('0x48'))){_0x551b06['limit']=qs[_0x0272('0x2b')](_0x3091b6[_0x0272('0x40')]['limit']);_0x551b06[_0x0272('0x29')]=qs['offset'](_0x3091b6[_0x0272('0x40')][_0x0272('0x29')]);}_0x551b06[_0x0272('0x49')]=qs[_0x0272('0x4a')](_0x3091b6[_0x0272('0x40')]['sort']);_0x551b06[_0x0272('0x4b')]=qs[_0x0272('0x42')](_['pick'](_0x3091b6[_0x0272('0x40')],_0x21e946[_0x0272('0x42')]));_0x551b06[_0x0272('0x4b')][_0x0272('0x66')]=_0x3148d1['id'];if(_0x3091b6['query'][_0x0272('0x4d')]){_0x551b06['where']=_[_0x0272('0x4e')](_0x551b06[_0x0272('0x4b')],{'$or':_[_0x0272('0x3b')](_0x551b06[_0x0272('0x45')],function(_0x6f5317){var _0x308874={};_0x308874[_0x6f5317]={'$like':'%'+_0x3091b6['query'][_0x0272('0x4d')]+'%'};return _0x308874;})});}_0x551b06=_[_0x0272('0x4e')]({},_0x551b06,_0x3091b6[_0x0272('0x50')]);return db[_0x0272('0x64')]['findAll'](_0x551b06);}})[_0x0272('0x1b')](function(_0x1e1de7){if(_0x1e1de7){return db[_0x0272('0x67')][_0x0272('0x68')]({'where':{'id':_[_0x0272('0x3b')](_0x1e1de7,_0x0272('0x69')),'role':_0x0272('0x6a')},'attributes':['id',_0x0272('0x38'),_0x0272('0x6b'),_0x0272('0x6c'),'createdAt']});}})[_0x0272('0x1b')](function(_0x3a9e14){if(_0x3a9e14){return{'count':_0x3a9e14[_0x0272('0x2c')],'rows':_[_0x0272('0x3b')](_0x3a9e14[_0x0272('0x53')],function(_0x864298){return{'membername':_0x864298[_0x0272('0x38')],'UserId':_0x864298['id'],'queue_name':_0x3526b0[_0x0272('0x38')],'ChatQueueId':_0x3526b0['id'],'interface':util[_0x0272('0x6d')](_0x0272('0x6e'),_0x0272('0x6f'),_0x864298['name']),'penalty':0x0,'paused':_0x864298[_0x0272('0x6b')],'createdAt':_0x864298[_0x0272('0x70')],'updatedAt':_0x864298[_0x0272('0x6c')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x3053ff,_0x551b06))[_0x0272('0x58')](handleError(_0x3053ff,null));};exports['getTeams']=function(_0xd2de45,_0x3ebf94,_0x4cb753){var _0x2c0459={};var _0x1fd272={};var _0x4f29de;var _0x31f230;return db[_0x0272('0x3c')]['findOne']({'where':{'id':_0xd2de45[_0x0272('0x55')]['id']}})['then'](handleEntityNotFound(_0x3ebf94,null))[_0x0272('0x1b')](function(_0x1b103b){if(_0x1b103b){_0x4f29de=_0x1b103b;_0x1fd272[_0x0272('0x44')]=_[_0x0272('0x41')](db[_0x0272('0x71')]['rawAttributes']);_0x1fd272[_0x0272('0x40')]=_['keys'](_0xd2de45['query']);_0x1fd272['filters']=_[_0x0272('0x43')](_0x1fd272['model'],_0x1fd272[_0x0272('0x40')]);_0x2c0459[_0x0272('0x45')]=_['intersection'](_0x1fd272[_0x0272('0x44')],qs['fields'](_0xd2de45[_0x0272('0x40')][_0x0272('0x46')]));_0x2c0459['attributes']=_0x2c0459[_0x0272('0x45')][_0x0272('0x65')]?_0x2c0459[_0x0272('0x45')]:_0x1fd272['model'];_0x2c0459[_0x0272('0x49')]=qs[_0x0272('0x4a')](_0xd2de45['query'][_0x0272('0x4a')]);_0x2c0459[_0x0272('0x4b')]=qs[_0x0272('0x42')](_[_0x0272('0x4c')](_0xd2de45[_0x0272('0x40')],_0x1fd272[_0x0272('0x42')]));if(_0xd2de45[_0x0272('0x40')][_0x0272('0x4d')]){_0x2c0459[_0x0272('0x4b')]=_['merge'](_0x2c0459['where'],{'$or':_[_0x0272('0x3b')](_0x2c0459[_0x0272('0x45')],function(_0x2e7419){var _0x592010={};_0x592010[_0x2e7419]={'$like':'%'+_0xd2de45[_0x0272('0x40')]['filter']+'%'};return _0x592010;})});}_0x2c0459=_[_0x0272('0x4e')]({},_0x2c0459,_0xd2de45[_0x0272('0x50')]);return _0x4f29de[_0x0272('0x72')](_0x2c0459);}})['then'](function(_0x3fdc72){if(_0x3fdc72){_0x31f230=_0x3fdc72[_0x0272('0x65')];if(!_0xd2de45[_0x0272('0x40')][_0x0272('0x47')](_0x0272('0x48'))){_0x2c0459[_0x0272('0x2b')]=qs[_0x0272('0x2b')](_0xd2de45['query'][_0x0272('0x2b')]);_0x2c0459[_0x0272('0x29')]=qs[_0x0272('0x29')](_0xd2de45['query']['offset']);}return _0x4f29de[_0x0272('0x72')](_0x2c0459);}})[_0x0272('0x1b')](function(_0x6ce2f3){if(_0x6ce2f3){return _0x6ce2f3?{'count':_0x31f230,'rows':_0x6ce2f3}:null;}})[_0x0272('0x1b')](respondWithResult(_0x3ebf94,null))[_0x0272('0x58')](handleError(_0x3ebf94,null));};exports[_0x0272('0x73')]=function(_0x4d7b38,_0xa29d70,_0x1c7314){var _0x2ff651=_0x4d7b38[_0x0272('0x5a')][_0x0272('0x74')];return db[_0x0272('0x71')][_0x0272('0x52')]({'where':{'id':_0x2ff651},'attributes':['id'],'include':[{'model':db[_0x0272('0x67')],'as':_0x0272('0x75'),'attributes':['id',_0x0272('0x38'),_0x0272('0x76'),_0x0272('0x77'),_0x0272('0x78')],'raw':!![]}]})[_0x0272('0x1b')](function(_0x307ea1){if(_0x307ea1){var _0x463762=_[_0x0272('0x79')](_0x307ea1,function(_0x1dd8cd){var _0x4c23d2=_0x1dd8cd['get']({'plain':!![]});return _0x4c23d2['Agents'];});return db[_0x0272('0x3c')][_0x0272('0x57')]({'where':{'id':_0x4d7b38[_0x0272('0x55')]['id']}})[_0x0272('0x1b')](function(_0x88083d){return db[_0x0272('0x7a')][_0x0272('0x7b')](function(_0x220634){return _0x88083d[_0x0272('0x73')](_0x2ff651,{'transaction':_0x220634})[_0x0272('0x1b')](function(){return BPromise[_0x0272('0x7c')](_0x463762,function(_0x1dbbe6){return db[_0x0272('0x64')][_0x0272('0x7d')]({'where':{'UserId':_0x1dbbe6['id'],'ChatQueueId':_0x4d7b38[_0x0272('0x55')]['id']},'transaction':_0x220634});});})[_0x0272('0x1b')](function(){_0x463762[_0x0272('0x7e')](function(_0x44d423){socket[_0x0272('0x7f')](_0x0272('0x80'),{'UserId':_0x44d423['id'],'ChatQueueId':_0x88083d['id']});});});});});}})[_0x0272('0x1b')](respondWithStatusCode(_0xa29d70,null))[_0x0272('0x58')](handleError(_0xa29d70,null));};exports['removeTeams']=function(_0x5bab2d,_0x246d96,_0x55e514){return db['Team']['findAll']({'where':{'id':_0x5bab2d[_0x0272('0x40')][_0x0272('0x74')]},'attributes':['id'],'include':[{'model':db[_0x0272('0x67')],'as':_0x0272('0x75'),'attributes':['id'],'raw':!![]}]})[_0x0272('0x1b')](handleEntityNotFound(_0x246d96,null))[_0x0272('0x1b')](function(_0x3680e1){var _0x38a25c=_[_0x0272('0x3b')](_0x3680e1,'id');var _0x1378e0=[];var _0x4b9eb2=[];var _0x10e99c=squel['select']();_0x10e99c[_0x0272('0x81')](_0x0272('0x82'))[_0x0272('0x83')](_0x0272('0x84'),'tq')[_0x0272('0x85')]('user_has_teams','ut','ut.TeamId\x20=\x20tq.TeamId')[_0x0272('0x4b')](_0x0272('0x86'),_0x5bab2d[_0x0272('0x55')]['id']);for(var _0x5ea008=0x0;_0x5ea008<_0x3680e1[_0x0272('0x65')];_0x5ea008+=0x1){let _0x3f2213=_0x3680e1[_0x5ea008];for(var _0x3063d4=0x0;_0x3063d4<_0x3f2213[_0x0272('0x75')]['length'];_0x3063d4+=0x1){let _0x377fc2=_0x3f2213[_0x0272('0x75')][_0x3063d4];var _0x3c48b3=_0x10e99c[_0x0272('0x87')]();_0x3c48b3[_0x0272('0x4b')](_0x0272('0x88'),_0x377fc2['id']);_0x4b9eb2[_0x0272('0x89')](db[_0x0272('0x7a')][_0x0272('0x40')](_0x3c48b3[_0x0272('0x8a')](),{'type':db[_0x0272('0x7a')][_0x0272('0x8b')][_0x0272('0x8c')]})['then'](function(_0x252bfc){if(_0x252bfc['length']===0x1){return _0x377fc2['id'];}else{var _0x21c462=_['every'](_[_0x0272('0x3b')](_0x252bfc,_0x0272('0x8d')),function(_0xc6ee8b){return _[_0x0272('0x8e')](_0x38a25c,_0xc6ee8b);});if(_0x21c462){return _0x377fc2['id'];}}}));}}return BPromise[_0x0272('0x8f')](_0x4b9eb2)[_0x0272('0x1b')](function(_0x5e60be){_0x1378e0=_(_0x1378e0)[_0x0272('0x90')](_0x5e60be)[_0x0272('0x91')]()[_0x0272('0x92')]();return db['ChatQueue'][_0x0272('0x57')]({'where':{'id':_0x5bab2d[_0x0272('0x55')]['id']}})[_0x0272('0x1b')](function(_0x14930a){return db['sequelize'][_0x0272('0x7b')](function(_0x15e655){return _0x14930a['removeTeams'](_0x5bab2d[_0x0272('0x40')]['ids'],{'transaction':_0x15e655})[_0x0272('0x1b')](function(){if(!_['isEmpty'](_0x1378e0)){return _0x14930a[_0x0272('0x93')](_0x1378e0,{'transaction':_0x15e655});}})[_0x0272('0x1b')](function(){_0x1378e0[_0x0272('0x7e')](function(_0x193fca){socket[_0x0272('0x7f')](_0x0272('0x94'),{'UserId':_0x193fca,'ChatQueueId':_0x14930a['id']});});});});});});})['then'](respondWithStatusCode(_0x246d96,null))['catch'](handleError(_0x246d96,null));};exports[_0x0272('0x95')]=function(_0x3d3f49,_0x515cd3,_0x312423){return db['ChatQueue']['find']({'where':{'id':_0x3d3f49[_0x0272('0x55')]['id']}})[_0x0272('0x1b')](handleEntityNotFound(_0x515cd3,null))['then'](function(_0x42a809){if(_0x42a809){return _0x42a809['addAgents'](_0x3d3f49[_0x0272('0x5a')]['ids'],_[_0x0272('0x96')](_0x3d3f49[_0x0272('0x5a')],[_0x0272('0x74'),'id'])||{})[_0x0272('0x97')](function(_0x591341){for(var _0x31cbe7=0x0;_0x31cbe7<_0x3d3f49[_0x0272('0x5a')]['ids'][_0x0272('0x65')];_0x31cbe7+=0x1){socket[_0x0272('0x7f')](_0x0272('0x80'),{'UserId':Number(_0x3d3f49['body'][_0x0272('0x74')][_0x31cbe7]),'ChatQueueId':Number(_0x3d3f49[_0x0272('0x55')]['id'])});}return _0x591341;});}})[_0x0272('0x1b')](respondWithResult(_0x515cd3,null))[_0x0272('0x58')](handleError(_0x515cd3,null));};exports[_0x0272('0x93')]=function(_0x19b02b,_0x242e61,_0x33f1f9){return db[_0x0272('0x3c')][_0x0272('0x57')]({'where':{'id':_0x19b02b[_0x0272('0x55')]['id']}})['then'](handleEntityNotFound(_0x242e61,null))['then'](function(_0x45c7f2){if(_0x45c7f2){return _0x45c7f2[_0x0272('0x93')](_0x19b02b[_0x0272('0x40')][_0x0272('0x74')])[_0x0272('0x1b')](function(){if(_[_0x0272('0x98')](_0x19b02b[_0x0272('0x40')][_0x0272('0x74')])){for(var _0x170ae9=0x0;_0x170ae9<_0x19b02b[_0x0272('0x40')][_0x0272('0x74')]['length'];_0x170ae9+=0x1){socket[_0x0272('0x7f')](_0x0272('0x94'),{'UserId':Number(_0x19b02b[_0x0272('0x40')][_0x0272('0x74')][_0x170ae9]),'ChatQueueId':Number(_0x19b02b['params']['id'])});}}else{socket['emit']('userChatQueue:remove',{'UserId':Number(_0x19b02b[_0x0272('0x40')]['ids']),'ChatQueueId':Number(_0x19b02b[_0x0272('0x55')]['id'])});}});}})[_0x0272('0x1b')](respondWithStatusCode(_0x242e61,null))[_0x0272('0x58')](handleError(_0x242e61,null));};exports[_0x0272('0x99')]=function(_0x1fa51e,_0x2898ea,_0x1994f7){var _0x5b1edd={};var _0x1cac6b={};var _0x303398;var _0x5430a1;return db[_0x0272('0x3c')][_0x0272('0x63')]({'where':{'id':_0x1fa51e[_0x0272('0x55')]['id']}})[_0x0272('0x1b')](handleEntityNotFound(_0x2898ea,null))[_0x0272('0x1b')](function(_0x3d11ae){if(_0x3d11ae){_0x303398=_0x3d11ae;_0x1cac6b[_0x0272('0x44')]=_[_0x0272('0x41')](db['User']['rawAttributes']);_0x1cac6b[_0x0272('0x40')]=_[_0x0272('0x41')](_0x1fa51e[_0x0272('0x40')]);_0x1cac6b[_0x0272('0x42')]=_[_0x0272('0x43')](_0x1cac6b[_0x0272('0x44')],_0x1cac6b[_0x0272('0x40')]);_0x5b1edd[_0x0272('0x45')]=_[_0x0272('0x43')](_0x1cac6b[_0x0272('0x44')],qs['fields'](_0x1fa51e['query']['fields']));_0x5b1edd[_0x0272('0x45')]=_0x5b1edd[_0x0272('0x45')][_0x0272('0x65')]?_0x5b1edd[_0x0272('0x45')]:_0x1cac6b[_0x0272('0x44')];_0x5b1edd[_0x0272('0x49')]=qs['sort'](_0x1fa51e[_0x0272('0x40')]['sort']);_0x5b1edd[_0x0272('0x4b')]=qs[_0x0272('0x42')](_[_0x0272('0x4c')](_0x1fa51e[_0x0272('0x40')],_0x1cac6b['filters']));if(_0x1fa51e[_0x0272('0x40')][_0x0272('0x4d')]){_0x5b1edd[_0x0272('0x4b')]=_[_0x0272('0x4e')](_0x5b1edd[_0x0272('0x4b')],{'$or':_[_0x0272('0x3b')](_0x5b1edd['attributes'],function(_0x563697){var _0x63ff24={};_0x63ff24[_0x563697]={'$like':'%'+_0x1fa51e[_0x0272('0x40')]['filter']+'%'};return _0x63ff24;})});}_0x5b1edd=_[_0x0272('0x4e')]({},_0x5b1edd,_0x1fa51e[_0x0272('0x50')]);return _0x303398[_0x0272('0x99')](_0x5b1edd);}})[_0x0272('0x1b')](function(_0xa2f78d){if(_0xa2f78d){_0x5430a1=_0xa2f78d[_0x0272('0x65')];if(!_0x1fa51e['query'][_0x0272('0x47')](_0x0272('0x48'))){_0x5b1edd[_0x0272('0x2b')]=qs[_0x0272('0x2b')](_0x1fa51e[_0x0272('0x40')]['limit']);_0x5b1edd[_0x0272('0x29')]=qs[_0x0272('0x29')](_0x1fa51e[_0x0272('0x40')][_0x0272('0x29')]);}return _0x303398[_0x0272('0x99')](_0x5b1edd);}})[_0x0272('0x1b')](function(_0x443b94){if(_0x443b94){return _0x443b94?{'count':_0x5430a1,'rows':_0x443b94}:null;}})[_0x0272('0x1b')](respondWithResult(_0x2898ea,null))['catch'](handleError(_0x2898ea,null));}; \ No newline at end of file +var _0x0bbb=['UserId','agent','updatedAt','createdAt','format','SIP','chatPause','Team','getTeams','addTeams','ids','online','interface','flatMap','Agents','sequelize','transaction','each','findOrCreate','emit','userChatQueue:save','removeTeams','select','field','from','team_has_chat_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','clone','ut.UserId\x20=\x20?','push','toString','every','TeamId','includes','union','compact','isEmpty','removeAgents','forEach','userChatQueue:remove','addAgents','omit','getAgents','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','register','jayson/promise','client','http','request','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','error','code','message','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','update','destroy','get','ChatQueues','name','send','index','ChatQueue','rawAttributes','fieldName','key','model','map','query','intersection','fields','attributes','length','nolimit','sort','where','filters','pick','filter','type','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','params','keys','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','getMembers','findOne','UserChatQueue','hasOwnProperty','order','User','findAndCountAll'];(function(_0x3439c5,_0x234368){var _0xadbae7=function(_0x5ba27f){while(--_0x5ba27f){_0x3439c5['push'](_0x3439c5['shift']());}};_0xadbae7(++_0x234368);}(_0x0bbb,0x157));var _0xb0bb=function(_0x3e5229,_0x667a9e){_0x3e5229=_0x3e5229-0x0;var _0x54bdc4=_0x0bbb[_0x3e5229];return _0x54bdc4;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xb0bb('0x0'));var jsonpatch=require(_0xb0bb('0x1'));var rp=require('request-promise');var moment=require(_0xb0bb('0x2'));var BPromise=require(_0xb0bb('0x3'));var Mustache=require(_0xb0bb('0x4'));var util=require(_0xb0bb('0x5'));var path=require(_0xb0bb('0x6'));var sox=require(_0xb0bb('0x7'));var csv=require(_0xb0bb('0x8'));var ejs=require(_0xb0bb('0x9'));var fs=require('fs');var fs_extra=require(_0xb0bb('0xa'));var _=require(_0xb0bb('0xb'));var squel=require(_0xb0bb('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xb0bb('0xd'));var toCsv=require(_0xb0bb('0x8'));var querystring=require(_0xb0bb('0xe'));var Papa=require(_0xb0bb('0xf'));var Redis=require(_0xb0bb('0x10'));var authService=require(_0xb0bb('0x11'));var qs=require(_0xb0bb('0x12'));var as=require(_0xb0bb('0x13'));var hardwareService=require(_0xb0bb('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0xb0bb('0x15'));var config=require(_0xb0bb('0x16'));var licenseUtil=require(_0xb0bb('0x17'));var db=require('../../mysqldb')['db'];config[_0xb0bb('0x18')]=_[_0xb0bb('0x19')](config[_0xb0bb('0x18')],{'host':_0xb0bb('0x1a'),'port':0x18eb});var socket=require(_0xb0bb('0x1b'))(new Redis(config[_0xb0bb('0x18')]));require(_0xb0bb('0x1c'))[_0xb0bb('0x1d')](socket);var jayson=require(_0xb0bb('0x1e'));var client=jayson[_0xb0bb('0x1f')][_0xb0bb('0x20')]({'port':0x232a});function respondWithRpcPromise(_0x1fdb7f,_0x4224a8,_0x634abc,_0x31eb0e){return new BPromise(function(_0x1e2faa,_0x18d7f8){var _0x253bdb=_0x31eb0e||client;return _0x253bdb[_0xb0bb('0x21')](_0x1fdb7f,_0x634abc)[_0xb0bb('0x22')](function(_0x1dc36c){logger[_0xb0bb('0x23')](_0xb0bb('0x24'),_0x4224a8,_0xb0bb('0x25'));logger[_0xb0bb('0x26')](_0xb0bb('0x27'),_0x4224a8,_0xb0bb('0x25'),JSON['stringify'](_0x1dc36c));if(_0x1dc36c[_0xb0bb('0x28')]){if(_0x1dc36c[_0xb0bb('0x28')][_0xb0bb('0x29')]===0x1f4){logger[_0xb0bb('0x28')]('ChatQueue,\x20%s,\x20%s',_0x4224a8,_0x1dc36c[_0xb0bb('0x28')]['message']);return _0x18d7f8(_0x1dc36c[_0xb0bb('0x28')][_0xb0bb('0x2a')]);}logger[_0xb0bb('0x28')](_0xb0bb('0x24'),_0x4224a8,_0x1dc36c[_0xb0bb('0x28')][_0xb0bb('0x2a')]);return _0x1e2faa(_0x1dc36c[_0xb0bb('0x28')][_0xb0bb('0x2a')]);}else{logger[_0xb0bb('0x23')]('ChatQueue,\x20%s,\x20%s',_0x4224a8,_0xb0bb('0x25'));_0x1e2faa(_0x1dc36c['result']['message']);}})['catch'](function(_0x423ba9){logger['error'](_0xb0bb('0x24'),_0x4224a8,_0x423ba9);_0x18d7f8(_0x423ba9);});});}function respondWithStatusCode(_0x36da1e,_0x1b6a7a){_0x1b6a7a=_0x1b6a7a||0xcc;return function(_0x2b2989){if(_0x2b2989){return _0x36da1e[_0xb0bb('0x2b')](_0x1b6a7a);}return _0x36da1e[_0xb0bb('0x2c')](_0x1b6a7a)[_0xb0bb('0x2d')]();};}function respondWithResult(_0x511bde,_0x375ab6){_0x375ab6=_0x375ab6||0xc8;return function(_0x13a9ed){if(_0x13a9ed){return _0x511bde['status'](_0x375ab6)[_0xb0bb('0x2e')](_0x13a9ed);}};}function respondWithFilteredResult(_0x458b84,_0x152e09){return function(_0x230523){if(_0x230523){var _0x4f41ac=typeof _0x152e09[_0xb0bb('0x2f')]===_0xb0bb('0x30')&&typeof _0x152e09[_0xb0bb('0x31')]===_0xb0bb('0x30');var _0x2e2b8c=_0x230523[_0xb0bb('0x32')];var _0x10edab=_0x4f41ac?0x0:_0x152e09[_0xb0bb('0x2f')];var _0x585ad9=_0x4f41ac?_0x230523[_0xb0bb('0x32')]:_0x152e09[_0xb0bb('0x2f')]+_0x152e09[_0xb0bb('0x31')];var _0x5e4c53;if(_0x585ad9>=_0x2e2b8c){_0x585ad9=_0x2e2b8c;_0x5e4c53=0xc8;}else{_0x5e4c53=0xce;}_0x458b84['status'](_0x5e4c53);return _0x458b84[_0xb0bb('0x33')]('Content-Range',_0x10edab+'-'+_0x585ad9+'/'+_0x2e2b8c)[_0xb0bb('0x2e')](_0x230523);}return null;};}function patchUpdates(_0x52c353){return function(_0x465ae4){try{jsonpatch[_0xb0bb('0x34')](_0x465ae4,_0x52c353,!![]);}catch(_0x3412e8){return BPromise['reject'](_0x3412e8);}return _0x465ae4['save']();};}function saveUpdates(_0x2a8fa7,_0xc90021){return function(_0xf2b63a){if(_0xf2b63a){return _0xf2b63a[_0xb0bb('0x35')](_0x2a8fa7)[_0xb0bb('0x22')](function(_0x3070bb){return _0x3070bb;});}return null;};}function removeEntity(_0x4f1dca,_0x16d906){return function(_0xab6b29){if(_0xab6b29){return _0xab6b29[_0xb0bb('0x36')]()[_0xb0bb('0x22')](function(){var _0x3e7f55=_0xab6b29[_0xb0bb('0x37')]({'plain':!![]});var _0x3b51ea=_0xb0bb('0x38');return db['UserProfileResource'][_0xb0bb('0x36')]({'where':{'type':_0x3b51ea,'resourceId':_0x3e7f55['id']}})[_0xb0bb('0x22')](function(){return _0xab6b29;});})[_0xb0bb('0x22')](function(){_0x4f1dca['status'](0xcc)[_0xb0bb('0x2d')]();});}};}function handleEntityNotFound(_0x1f4432,_0x4e73cb){return function(_0x59c881){if(!_0x59c881){_0x1f4432[_0xb0bb('0x2b')](0x194);}return _0x59c881;};}function handleError(_0x5e9ae1,_0x44e2b4){_0x44e2b4=_0x44e2b4||0x1f4;return function(_0x310b37){logger['error'](_0x310b37['stack']);if(_0x310b37[_0xb0bb('0x39')]){delete _0x310b37[_0xb0bb('0x39')];}_0x5e9ae1['status'](_0x44e2b4)[_0xb0bb('0x3a')](_0x310b37);};}exports[_0xb0bb('0x3b')]=function(_0x28e264,_0x31f94a){var _0x2e4c55={},_0x54a635={},_0x306d38={'count':0x0,'rows':[]};var _0x3884a3=_['map'](db[_0xb0bb('0x3c')][_0xb0bb('0x3d')],function(_0x569a8f){return{'name':_0x569a8f[_0xb0bb('0x3e')],'type':_0x569a8f['type'][_0xb0bb('0x3f')]};});_0x54a635[_0xb0bb('0x40')]=_[_0xb0bb('0x41')](_0x3884a3,_0xb0bb('0x39'));_0x54a635['query']=_['keys'](_0x28e264[_0xb0bb('0x42')]);_0x54a635['filters']=_['intersection'](_0x54a635[_0xb0bb('0x40')],_0x54a635[_0xb0bb('0x42')]);_0x2e4c55['attributes']=_[_0xb0bb('0x43')](_0x54a635[_0xb0bb('0x40')],qs[_0xb0bb('0x44')](_0x28e264['query']['fields']));_0x2e4c55[_0xb0bb('0x45')]=_0x2e4c55[_0xb0bb('0x45')][_0xb0bb('0x46')]?_0x2e4c55[_0xb0bb('0x45')]:_0x54a635[_0xb0bb('0x40')];if(!_0x28e264[_0xb0bb('0x42')]['hasOwnProperty'](_0xb0bb('0x47'))){_0x2e4c55[_0xb0bb('0x31')]=qs['limit'](_0x28e264[_0xb0bb('0x42')][_0xb0bb('0x31')]);_0x2e4c55['offset']=qs['offset'](_0x28e264[_0xb0bb('0x42')]['offset']);}_0x2e4c55['order']=qs[_0xb0bb('0x48')](_0x28e264[_0xb0bb('0x42')][_0xb0bb('0x48')]);_0x2e4c55[_0xb0bb('0x49')]=qs[_0xb0bb('0x4a')](_[_0xb0bb('0x4b')](_0x28e264[_0xb0bb('0x42')],_0x54a635['filters']),_0x3884a3);if(_0x28e264['query'][_0xb0bb('0x4c')]){_0x2e4c55[_0xb0bb('0x49')]=_['merge'](_0x2e4c55[_0xb0bb('0x49')],{'$or':_[_0xb0bb('0x41')](_0x3884a3,function(_0x487adb){if(_0x487adb[_0xb0bb('0x4d')]!==_0xb0bb('0x4e')){var _0x25628d={};_0x25628d[_0x487adb[_0xb0bb('0x39')]]={'$like':'%'+_0x28e264[_0xb0bb('0x42')][_0xb0bb('0x4c')]+'%'};return _0x25628d;}})});}_0x2e4c55=_[_0xb0bb('0x4f')]({},_0x2e4c55,_0x28e264[_0xb0bb('0x50')]);var _0x330fb8={'where':_0x2e4c55['where']};return db[_0xb0bb('0x3c')][_0xb0bb('0x32')](_0x330fb8)[_0xb0bb('0x22')](function(_0x1d842e){_0x306d38[_0xb0bb('0x32')]=_0x1d842e;if(_0x28e264['query'][_0xb0bb('0x51')]){_0x2e4c55[_0xb0bb('0x52')]=[{'all':!![]}];}return db['ChatQueue'][_0xb0bb('0x53')](_0x2e4c55);})[_0xb0bb('0x22')](function(_0x555044){_0x306d38[_0xb0bb('0x54')]=_0x555044;return _0x306d38;})['then'](respondWithFilteredResult(_0x31f94a,_0x2e4c55))[_0xb0bb('0x55')](handleError(_0x31f94a,null));};exports['show']=function(_0x5c242d,_0x24841b){var _0x261cad={'raw':!![],'where':{'id':_0x5c242d[_0xb0bb('0x56')]['id']}},_0x27a420={};_0x27a420[_0xb0bb('0x40')]=_[_0xb0bb('0x57')](db[_0xb0bb('0x3c')][_0xb0bb('0x3d')]);_0x27a420['query']=_[_0xb0bb('0x57')](_0x5c242d[_0xb0bb('0x42')]);_0x27a420[_0xb0bb('0x4a')]=_[_0xb0bb('0x43')](_0x27a420[_0xb0bb('0x40')],_0x27a420[_0xb0bb('0x42')]);_0x261cad['attributes']=_[_0xb0bb('0x43')](_0x27a420[_0xb0bb('0x40')],qs['fields'](_0x5c242d[_0xb0bb('0x42')][_0xb0bb('0x44')]));_0x261cad['attributes']=_0x261cad[_0xb0bb('0x45')]['length']?_0x261cad['attributes']:_0x27a420[_0xb0bb('0x40')];if(_0x5c242d[_0xb0bb('0x42')][_0xb0bb('0x51')]){_0x261cad[_0xb0bb('0x52')]=[{'all':!![]}];}_0x261cad=_[_0xb0bb('0x4f')]({},_0x261cad,_0x5c242d[_0xb0bb('0x50')]);return db[_0xb0bb('0x3c')][_0xb0bb('0x58')](_0x261cad)['then'](handleEntityNotFound(_0x24841b,null))['then'](respondWithResult(_0x24841b,null))[_0xb0bb('0x55')](handleError(_0x24841b,null));};exports[_0xb0bb('0x59')]=function(_0x343db4,_0x1981fa){return db[_0xb0bb('0x3c')][_0xb0bb('0x59')](_0x343db4['body'],{})['then'](function(_0x394ee9){var _0x160d78=_0x343db4['user'][_0xb0bb('0x37')]({'plain':!![]});if(!_0x160d78)throw new Error(_0xb0bb('0x5a'));if(_0x160d78[_0xb0bb('0x5b')]==='user'){var _0x15f199=_0x394ee9['get']({'plain':!![]});var _0x58de04=_0xb0bb('0x38');return db[_0xb0bb('0x5c')][_0xb0bb('0x58')]({'where':{'name':_0x58de04,'userProfileId':_0x160d78[_0xb0bb('0x5d')]},'raw':!![]})[_0xb0bb('0x22')](function(_0xc097d2){if(_0xc097d2&&_0xc097d2['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x15f199[_0xb0bb('0x39')],'resourceId':_0x15f199['id'],'type':_0xc097d2[_0xb0bb('0x39')],'sectionId':_0xc097d2['id']},{})[_0xb0bb('0x22')](function(){return _0x394ee9;});}else{return _0x394ee9;}})[_0xb0bb('0x55')](function(_0x118815){logger['error'](_0xb0bb('0x5e'),_0x118815);throw _0x118815;});}return _0x394ee9;})[_0xb0bb('0x22')](respondWithResult(_0x1981fa,0xc9))[_0xb0bb('0x55')](handleError(_0x1981fa,null));};exports[_0xb0bb('0x35')]=function(_0x4c84c0,_0x36b34b){if(_0x4c84c0[_0xb0bb('0x5f')]['id']){delete _0x4c84c0[_0xb0bb('0x5f')]['id'];}return db[_0xb0bb('0x3c')][_0xb0bb('0x58')]({'where':{'id':_0x4c84c0[_0xb0bb('0x56')]['id']}})[_0xb0bb('0x22')](handleEntityNotFound(_0x36b34b,null))[_0xb0bb('0x22')](saveUpdates(_0x4c84c0[_0xb0bb('0x5f')],null))[_0xb0bb('0x22')](respondWithResult(_0x36b34b,null))[_0xb0bb('0x55')](handleError(_0x36b34b,null));};exports[_0xb0bb('0x36')]=function(_0x501de8,_0x178168){return db['ChatQueue'][_0xb0bb('0x58')]({'where':{'id':_0x501de8[_0xb0bb('0x56')]['id']}})[_0xb0bb('0x22')](handleEntityNotFound(_0x178168,null))[_0xb0bb('0x22')](removeEntity(_0x178168,null))[_0xb0bb('0x55')](handleError(_0x178168,null));};exports[_0xb0bb('0x60')]=function(_0x298134,_0xfc1aac){return db[_0xb0bb('0x3c')][_0xb0bb('0x60')]()[_0xb0bb('0x22')](respondWithResult(_0xfc1aac,null))['catch'](handleError(_0xfc1aac,null));};exports[_0xb0bb('0x61')]=function(_0x41820a,_0x43537f,_0x39edab){var _0x5bdc14={'raw':!![],'where':{}},_0xfa2449={},_0x370da8;return db[_0xb0bb('0x3c')][_0xb0bb('0x62')]({'where':{'id':_0x41820a['params']['id']}})[_0xb0bb('0x22')](handleEntityNotFound(_0x43537f,null))['then'](function(_0x2c0442){if(_0x2c0442){_0x370da8=_0x2c0442[_0xb0bb('0x37')]({'plain':!![]});_0xfa2449[_0xb0bb('0x40')]=_[_0xb0bb('0x57')](db[_0xb0bb('0x63')]['rawAttributes']);_0xfa2449['query']=_[_0xb0bb('0x57')](_0x41820a['query']);_0xfa2449[_0xb0bb('0x4a')]=_[_0xb0bb('0x43')](_0xfa2449[_0xb0bb('0x40')],_0xfa2449[_0xb0bb('0x42')]);_0x5bdc14[_0xb0bb('0x45')]=_[_0xb0bb('0x43')](_0xfa2449[_0xb0bb('0x40')],qs[_0xb0bb('0x44')](_0x41820a[_0xb0bb('0x42')][_0xb0bb('0x44')]));_0x5bdc14[_0xb0bb('0x45')]=_0x5bdc14[_0xb0bb('0x45')][_0xb0bb('0x46')]?_0x5bdc14['attributes']:_0xfa2449['model'];if(!_0x41820a['query'][_0xb0bb('0x64')]('nolimit')){_0x5bdc14[_0xb0bb('0x31')]=qs[_0xb0bb('0x31')](_0x41820a[_0xb0bb('0x42')]['limit']);_0x5bdc14[_0xb0bb('0x2f')]=qs['offset'](_0x41820a[_0xb0bb('0x42')][_0xb0bb('0x2f')]);}_0x5bdc14[_0xb0bb('0x65')]=qs['sort'](_0x41820a[_0xb0bb('0x42')][_0xb0bb('0x48')]);_0x5bdc14[_0xb0bb('0x49')]=qs[_0xb0bb('0x4a')](_[_0xb0bb('0x4b')](_0x41820a[_0xb0bb('0x42')],_0xfa2449[_0xb0bb('0x4a')]));_0x5bdc14['where']['ChatQueueId']=_0x2c0442['id'];if(_0x41820a[_0xb0bb('0x42')][_0xb0bb('0x4c')]){_0x5bdc14[_0xb0bb('0x49')]=_[_0xb0bb('0x4f')](_0x5bdc14[_0xb0bb('0x49')],{'$or':_[_0xb0bb('0x41')](_0x5bdc14[_0xb0bb('0x45')],function(_0x2751a5){var _0x1cbe8d={};_0x1cbe8d[_0x2751a5]={'$like':'%'+_0x41820a['query'][_0xb0bb('0x4c')]+'%'};return _0x1cbe8d;})});}_0x5bdc14=_[_0xb0bb('0x4f')]({},_0x5bdc14,_0x41820a[_0xb0bb('0x50')]);return db[_0xb0bb('0x63')][_0xb0bb('0x53')](_0x5bdc14);}})['then'](function(_0x30844a){if(_0x30844a){return db[_0xb0bb('0x66')][_0xb0bb('0x67')]({'where':{'id':_[_0xb0bb('0x41')](_0x30844a,_0xb0bb('0x68')),'role':_0xb0bb('0x69')},'attributes':['id',_0xb0bb('0x39'),'chatPause',_0xb0bb('0x6a'),_0xb0bb('0x6b')]});}})[_0xb0bb('0x22')](function(_0x4829e8){if(_0x4829e8){return{'count':_0x4829e8['count'],'rows':_['map'](_0x4829e8[_0xb0bb('0x54')],function(_0x2cc560){return{'membername':_0x2cc560[_0xb0bb('0x39')],'UserId':_0x2cc560['id'],'queue_name':_0x370da8['name'],'ChatQueueId':_0x370da8['id'],'interface':util[_0xb0bb('0x6c')]('%s/%s',_0xb0bb('0x6d'),_0x2cc560[_0xb0bb('0x39')]),'penalty':0x0,'paused':_0x2cc560[_0xb0bb('0x6e')],'createdAt':_0x2cc560[_0xb0bb('0x6b')],'updatedAt':_0x2cc560[_0xb0bb('0x6a')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xb0bb('0x22')](respondWithFilteredResult(_0x43537f,_0x5bdc14))['catch'](handleError(_0x43537f,null));};exports['getTeams']=function(_0x4e6689,_0x4181f7,_0x434386){var _0x4c8999={};var _0x452e2c={};var _0x184955;var _0x3b6722;return db['ChatQueue'][_0xb0bb('0x62')]({'where':{'id':_0x4e6689[_0xb0bb('0x56')]['id']}})[_0xb0bb('0x22')](handleEntityNotFound(_0x4181f7,null))[_0xb0bb('0x22')](function(_0x2e475a){if(_0x2e475a){_0x184955=_0x2e475a;_0x452e2c[_0xb0bb('0x40')]=_[_0xb0bb('0x57')](db[_0xb0bb('0x6f')][_0xb0bb('0x3d')]);_0x452e2c[_0xb0bb('0x42')]=_[_0xb0bb('0x57')](_0x4e6689[_0xb0bb('0x42')]);_0x452e2c[_0xb0bb('0x4a')]=_[_0xb0bb('0x43')](_0x452e2c[_0xb0bb('0x40')],_0x452e2c['query']);_0x4c8999[_0xb0bb('0x45')]=_[_0xb0bb('0x43')](_0x452e2c['model'],qs['fields'](_0x4e6689[_0xb0bb('0x42')]['fields']));_0x4c8999['attributes']=_0x4c8999[_0xb0bb('0x45')][_0xb0bb('0x46')]?_0x4c8999[_0xb0bb('0x45')]:_0x452e2c[_0xb0bb('0x40')];_0x4c8999['order']=qs[_0xb0bb('0x48')](_0x4e6689[_0xb0bb('0x42')]['sort']);_0x4c8999[_0xb0bb('0x49')]=qs[_0xb0bb('0x4a')](_[_0xb0bb('0x4b')](_0x4e6689[_0xb0bb('0x42')],_0x452e2c[_0xb0bb('0x4a')]));if(_0x4e6689[_0xb0bb('0x42')][_0xb0bb('0x4c')]){_0x4c8999[_0xb0bb('0x49')]=_[_0xb0bb('0x4f')](_0x4c8999[_0xb0bb('0x49')],{'$or':_[_0xb0bb('0x41')](_0x4c8999['attributes'],function(_0x594732){var _0x45ba04={};_0x45ba04[_0x594732]={'$like':'%'+_0x4e6689[_0xb0bb('0x42')][_0xb0bb('0x4c')]+'%'};return _0x45ba04;})});}_0x4c8999=_[_0xb0bb('0x4f')]({},_0x4c8999,_0x4e6689[_0xb0bb('0x50')]);return _0x184955[_0xb0bb('0x70')](_0x4c8999);}})[_0xb0bb('0x22')](function(_0x4385a3){if(_0x4385a3){_0x3b6722=_0x4385a3[_0xb0bb('0x46')];if(!_0x4e6689[_0xb0bb('0x42')][_0xb0bb('0x64')](_0xb0bb('0x47'))){_0x4c8999[_0xb0bb('0x31')]=qs[_0xb0bb('0x31')](_0x4e6689[_0xb0bb('0x42')][_0xb0bb('0x31')]);_0x4c8999[_0xb0bb('0x2f')]=qs[_0xb0bb('0x2f')](_0x4e6689[_0xb0bb('0x42')][_0xb0bb('0x2f')]);}return _0x184955[_0xb0bb('0x70')](_0x4c8999);}})[_0xb0bb('0x22')](function(_0x5997c5){if(_0x5997c5){return _0x5997c5?{'count':_0x3b6722,'rows':_0x5997c5}:null;}})[_0xb0bb('0x22')](respondWithResult(_0x4181f7,null))['catch'](handleError(_0x4181f7,null));};exports[_0xb0bb('0x71')]=function(_0x2ca3e7,_0x24a4f3,_0x4cabee){var _0x2be745=_0x2ca3e7[_0xb0bb('0x5f')][_0xb0bb('0x72')];return db['Team'][_0xb0bb('0x53')]({'where':{'id':_0x2be745},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id',_0xb0bb('0x39'),_0xb0bb('0x73'),'voicePause',_0xb0bb('0x74')],'raw':!![]}]})[_0xb0bb('0x22')](function(_0x2b8930){if(_0x2b8930){var _0x33811b=_[_0xb0bb('0x75')](_0x2b8930,function(_0x5881d4){var _0x41ed28=_0x5881d4[_0xb0bb('0x37')]({'plain':!![]});return _0x41ed28[_0xb0bb('0x76')];});return db[_0xb0bb('0x3c')][_0xb0bb('0x58')]({'where':{'id':_0x2ca3e7[_0xb0bb('0x56')]['id']}})[_0xb0bb('0x22')](function(_0x253b4d){return db[_0xb0bb('0x77')][_0xb0bb('0x78')](function(_0x31b816){return _0x253b4d[_0xb0bb('0x71')](_0x2be745,{'transaction':_0x31b816})['then'](function(){return BPromise[_0xb0bb('0x79')](_0x33811b,function(_0x2be98f){return db[_0xb0bb('0x63')][_0xb0bb('0x7a')]({'where':{'UserId':_0x2be98f['id'],'ChatQueueId':_0x2ca3e7[_0xb0bb('0x56')]['id']},'transaction':_0x31b816});});})[_0xb0bb('0x22')](function(){_0x33811b['forEach'](function(_0x10a685){socket[_0xb0bb('0x7b')](_0xb0bb('0x7c'),{'UserId':_0x10a685['id'],'ChatQueueId':_0x253b4d['id']});});});});});}})[_0xb0bb('0x22')](respondWithStatusCode(_0x24a4f3,null))['catch'](handleError(_0x24a4f3,null));};exports[_0xb0bb('0x7d')]=function(_0x4df7c9,_0x47e412,_0x496253){return db[_0xb0bb('0x6f')][_0xb0bb('0x53')]({'where':{'id':_0x4df7c9['query'][_0xb0bb('0x72')]},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0xb0bb('0x22')](handleEntityNotFound(_0x47e412,null))[_0xb0bb('0x22')](function(_0x1bbcf9){var _0xe2de3d=_['map'](_0x1bbcf9,'id');var _0x56a09b=[];var _0x1fadf4=[];var _0x2dc9f2=squel[_0xb0bb('0x7e')]();_0x2dc9f2[_0xb0bb('0x7f')]('tq.TeamId')[_0xb0bb('0x80')](_0xb0bb('0x81'),'tq')[_0xb0bb('0x82')](_0xb0bb('0x83'),'ut',_0xb0bb('0x84'))[_0xb0bb('0x49')]('ChatQueueId\x20=\x20?',_0x4df7c9[_0xb0bb('0x56')]['id']);for(var _0x212abf=0x0;_0x212abf<_0x1bbcf9['length'];_0x212abf+=0x1){let _0x18aac3=_0x1bbcf9[_0x212abf];for(var _0x9d6c0e=0x0;_0x9d6c0e<_0x18aac3[_0xb0bb('0x76')][_0xb0bb('0x46')];_0x9d6c0e+=0x1){let _0x245ca9=_0x18aac3[_0xb0bb('0x76')][_0x9d6c0e];var _0x26d67c=_0x2dc9f2[_0xb0bb('0x85')]();_0x26d67c['where'](_0xb0bb('0x86'),_0x245ca9['id']);_0x1fadf4[_0xb0bb('0x87')](db[_0xb0bb('0x77')][_0xb0bb('0x42')](_0x26d67c[_0xb0bb('0x88')](),{'type':db[_0xb0bb('0x77')]['QueryTypes']['SELECT']})[_0xb0bb('0x22')](function(_0x36a432){if(_0x36a432['length']===0x1){return _0x245ca9['id'];}else{var _0x8c6f2d=_[_0xb0bb('0x89')](_[_0xb0bb('0x41')](_0x36a432,_0xb0bb('0x8a')),function(_0x4bc552){return _[_0xb0bb('0x8b')](_0xe2de3d,_0x4bc552);});if(_0x8c6f2d){return _0x245ca9['id'];}}}));}}return BPromise['all'](_0x1fadf4)[_0xb0bb('0x22')](function(_0x5df5e1){_0x56a09b=_(_0x56a09b)[_0xb0bb('0x8c')](_0x5df5e1)[_0xb0bb('0x8d')]()['value']();return db[_0xb0bb('0x3c')]['find']({'where':{'id':_0x4df7c9[_0xb0bb('0x56')]['id']}})[_0xb0bb('0x22')](function(_0x1b3a05){return db[_0xb0bb('0x77')][_0xb0bb('0x78')](function(_0x1938b0){return _0x1b3a05['removeTeams'](_0x4df7c9[_0xb0bb('0x42')][_0xb0bb('0x72')],{'transaction':_0x1938b0})['then'](function(){if(!_[_0xb0bb('0x8e')](_0x56a09b)){return _0x1b3a05[_0xb0bb('0x8f')](_0x56a09b,{'transaction':_0x1938b0});}})['then'](function(){_0x56a09b[_0xb0bb('0x90')](function(_0x43efb9){socket['emit'](_0xb0bb('0x91'),{'UserId':_0x43efb9,'ChatQueueId':_0x1b3a05['id']});});});});});});})['then'](respondWithStatusCode(_0x47e412,null))[_0xb0bb('0x55')](handleError(_0x47e412,null));};exports[_0xb0bb('0x92')]=function(_0x3996e8,_0x5733bf,_0x56c29e){return db[_0xb0bb('0x3c')][_0xb0bb('0x58')]({'where':{'id':_0x3996e8[_0xb0bb('0x56')]['id']}})[_0xb0bb('0x22')](handleEntityNotFound(_0x5733bf,null))['then'](function(_0x10a013){if(_0x10a013){return _0x10a013['addAgents'](_0x3996e8[_0xb0bb('0x5f')]['ids'],_[_0xb0bb('0x93')](_0x3996e8[_0xb0bb('0x5f')],['ids','id'])||{})['spread'](function(_0x272f98){for(var _0x4ce43d=0x0;_0x4ce43d<_0x3996e8[_0xb0bb('0x5f')][_0xb0bb('0x72')][_0xb0bb('0x46')];_0x4ce43d+=0x1){socket[_0xb0bb('0x7b')](_0xb0bb('0x7c'),{'UserId':Number(_0x3996e8[_0xb0bb('0x5f')][_0xb0bb('0x72')][_0x4ce43d]),'ChatQueueId':Number(_0x3996e8['params']['id'])});}return _0x272f98;});}})['then'](respondWithResult(_0x5733bf,null))[_0xb0bb('0x55')](handleError(_0x5733bf,null));};exports[_0xb0bb('0x8f')]=function(_0x147677,_0x1a9a0d,_0x1c78a6){return db['ChatQueue'][_0xb0bb('0x58')]({'where':{'id':_0x147677['params']['id']}})['then'](handleEntityNotFound(_0x1a9a0d,null))[_0xb0bb('0x22')](function(_0x356b92){if(_0x356b92){return _0x356b92[_0xb0bb('0x8f')](_0x147677['query']['ids'])[_0xb0bb('0x22')](function(){if(_['isArray'](_0x147677['query'][_0xb0bb('0x72')])){for(var _0x26a7c1=0x0;_0x26a7c1<_0x147677[_0xb0bb('0x42')][_0xb0bb('0x72')][_0xb0bb('0x46')];_0x26a7c1+=0x1){socket[_0xb0bb('0x7b')]('userChatQueue:remove',{'UserId':Number(_0x147677['query'][_0xb0bb('0x72')][_0x26a7c1]),'ChatQueueId':Number(_0x147677[_0xb0bb('0x56')]['id'])});}}else{socket[_0xb0bb('0x7b')](_0xb0bb('0x91'),{'UserId':Number(_0x147677[_0xb0bb('0x42')]['ids']),'ChatQueueId':Number(_0x147677[_0xb0bb('0x56')]['id'])});}});}})['then'](respondWithStatusCode(_0x1a9a0d,null))[_0xb0bb('0x55')](handleError(_0x1a9a0d,null));};exports[_0xb0bb('0x94')]=function(_0x12b29e,_0x1fe8e1,_0x441625){var _0xfbcf7b={};var _0x29f872={};var _0x143f27;var _0x2da98d;return db[_0xb0bb('0x3c')][_0xb0bb('0x62')]({'where':{'id':_0x12b29e[_0xb0bb('0x56')]['id']}})[_0xb0bb('0x22')](handleEntityNotFound(_0x1fe8e1,null))[_0xb0bb('0x22')](function(_0x3834){if(_0x3834){_0x143f27=_0x3834;_0x29f872[_0xb0bb('0x40')]=_[_0xb0bb('0x57')](db[_0xb0bb('0x66')][_0xb0bb('0x3d')]);_0x29f872[_0xb0bb('0x42')]=_[_0xb0bb('0x57')](_0x12b29e[_0xb0bb('0x42')]);_0x29f872[_0xb0bb('0x4a')]=_[_0xb0bb('0x43')](_0x29f872[_0xb0bb('0x40')],_0x29f872[_0xb0bb('0x42')]);_0xfbcf7b[_0xb0bb('0x45')]=_[_0xb0bb('0x43')](_0x29f872['model'],qs[_0xb0bb('0x44')](_0x12b29e[_0xb0bb('0x42')][_0xb0bb('0x44')]));_0xfbcf7b['attributes']=_0xfbcf7b['attributes']['length']?_0xfbcf7b[_0xb0bb('0x45')]:_0x29f872[_0xb0bb('0x40')];_0xfbcf7b['order']=qs[_0xb0bb('0x48')](_0x12b29e[_0xb0bb('0x42')]['sort']);_0xfbcf7b['where']=qs['filters'](_[_0xb0bb('0x4b')](_0x12b29e['query'],_0x29f872[_0xb0bb('0x4a')]));if(_0x12b29e[_0xb0bb('0x42')]['filter']){_0xfbcf7b[_0xb0bb('0x49')]=_[_0xb0bb('0x4f')](_0xfbcf7b['where'],{'$or':_[_0xb0bb('0x41')](_0xfbcf7b[_0xb0bb('0x45')],function(_0x4b6cde){var _0x22d313={};_0x22d313[_0x4b6cde]={'$like':'%'+_0x12b29e[_0xb0bb('0x42')][_0xb0bb('0x4c')]+'%'};return _0x22d313;})});}_0xfbcf7b=_['merge']({},_0xfbcf7b,_0x12b29e['options']);return _0x143f27[_0xb0bb('0x94')](_0xfbcf7b);}})[_0xb0bb('0x22')](function(_0x2dc88f){if(_0x2dc88f){_0x2da98d=_0x2dc88f[_0xb0bb('0x46')];if(!_0x12b29e['query']['hasOwnProperty']('nolimit')){_0xfbcf7b[_0xb0bb('0x31')]=qs[_0xb0bb('0x31')](_0x12b29e[_0xb0bb('0x42')][_0xb0bb('0x31')]);_0xfbcf7b[_0xb0bb('0x2f')]=qs[_0xb0bb('0x2f')](_0x12b29e['query'][_0xb0bb('0x2f')]);}return _0x143f27[_0xb0bb('0x94')](_0xfbcf7b);}})['then'](function(_0x2e57f9){if(_0x2e57f9){return _0x2e57f9?{'count':_0x2da98d,'rows':_0x2e57f9}:null;}})['then'](respondWithResult(_0x1fe8e1,null))['catch'](handleError(_0x1fe8e1,null));}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js index a3c431b..7416548 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 _0x40dd=['save','update','remove','emit','exports','events','../../mysqldb','setMaxListeners'];(function(_0x44f9a1,_0x914b7e){var _0x138599=function(_0x532941){while(--_0x532941){_0x44f9a1['push'](_0x44f9a1['shift']());}};_0x138599(++_0x914b7e);}(_0x40dd,0x18d));var _0xd40d=function(_0x47e7cb,_0x4c1b8d){_0x47e7cb=_0x47e7cb-0x0;var _0x2a8874=_0x40dd[_0x47e7cb];return _0x2a8874;};'use strict';var EventEmitter=require(_0xd40d('0x0'));var ChatQueue=require(_0xd40d('0x1'))['db']['ChatQueue'];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0xd40d('0x2')](0x0);var events={'afterCreate':_0xd40d('0x3'),'afterUpdate':_0xd40d('0x4'),'afterDestroy':_0xd40d('0x5')};function emitEvent(_0x1f3430){return function(_0x1fe9c4,_0x2f951b,_0x2f0ba9){ChatQueueEvents[_0xd40d('0x6')](_0x1f3430+':'+_0x1fe9c4['id'],_0x1fe9c4);ChatQueueEvents[_0xd40d('0x6')](_0x1f3430,_0x1fe9c4);_0x2f0ba9(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatQueue['hook'](e,emitEvent(event));}}module[_0xd40d('0x7')]=ChatQueueEvents; \ No newline at end of file +var _0x58d1=['../../mysqldb','ChatQueue','setMaxListeners','save','update','emit','hasOwnProperty','hook','exports'];(function(_0x50f4a8,_0x31dfb7){var _0xbdd3c2=function(_0x21328e){while(--_0x21328e){_0x50f4a8['push'](_0x50f4a8['shift']());}};_0xbdd3c2(++_0x31dfb7);}(_0x58d1,0x15f));var _0x158d=function(_0x7450d2,_0x46afc8){_0x7450d2=_0x7450d2-0x0;var _0x5987aa=_0x58d1[_0x7450d2];return _0x5987aa;};'use strict';var EventEmitter=require('events');var ChatQueue=require(_0x158d('0x0'))['db'][_0x158d('0x1')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x158d('0x2')](0x0);var events={'afterCreate':_0x158d('0x3'),'afterUpdate':_0x158d('0x4'),'afterDestroy':'remove'};function emitEvent(_0x40dee4){return function(_0x103892,_0x41e005,_0x2b0ed1){ChatQueueEvents[_0x158d('0x5')](_0x40dee4+':'+_0x103892['id'],_0x103892);ChatQueueEvents[_0x158d('0x5')](_0x40dee4,_0x103892);_0x2b0ed1(null);};}for(var e in events){if(events[_0x158d('0x6')](e)){var event=events[e];ChatQueue[_0x158d('0x7')](e,emitEvent(event));}}module[_0x158d('0x8')]=ChatQueueEvents; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.model.js b/server/api/chatQueue/chatQueue.model.js index 5858abd..9bcbbbc 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 _0xe052=['ChatQueue','chat_queues','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./chatQueue.attributes','exports','define'];(function(_0x1abfa6,_0x34604d){var _0x7bc255=function(_0x5ed569){while(--_0x5ed569){_0x1abfa6['push'](_0x1abfa6['shift']());}};_0x7bc255(++_0x34604d);}(_0xe052,0x1d6));var _0x2e05=function(_0x3d4436,_0x526479){_0x3d4436=_0x3d4436-0x0;var _0x5567ba=_0xe052[_0x3d4436];return _0x5567ba;};'use strict';var _=require(_0x2e05('0x0'));var util=require(_0x2e05('0x1'));var logger=require(_0x2e05('0x2'))(_0x2e05('0x3'));var moment=require('moment');var BPromise=require(_0x2e05('0x4'));var rp=require(_0x2e05('0x5'));var fs=require('fs');var path=require(_0x2e05('0x6'));var rimraf=require(_0x2e05('0x7'));var config=require('../../config/environment');var attributes=require(_0x2e05('0x8'));module[_0x2e05('0x9')]=function(_0x41944d,_0x1cd8c2){return _0x41944d[_0x2e05('0xa')](_0x2e05('0xb'),attributes,{'tableName':_0x2e05('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6985=['path','rimraf','./chatQueue.attributes','define','ChatQueue','chat_queues','lodash','util','../../config/logger','api','bluebird','request-promise'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x6985,0x17a));var _0x5698=function(_0x5f7b7d,_0x384e4f){_0x5f7b7d=_0x5f7b7d-0x0;var _0x326f50=_0x6985[_0x5f7b7d];return _0x326f50;};'use strict';var _=require(_0x5698('0x0'));var util=require(_0x5698('0x1'));var logger=require(_0x5698('0x2'))(_0x5698('0x3'));var moment=require('moment');var BPromise=require(_0x5698('0x4'));var rp=require(_0x5698('0x5'));var fs=require('fs');var path=require(_0x5698('0x6'));var rimraf=require(_0x5698('0x7'));var config=require('../../config/environment');var attributes=require(_0x5698('0x8'));module['exports']=function(_0x1e72a5,_0x44803a){return _0x1e72a5[_0x5698('0x9')](_0x5698('0xa'),attributes,{'tableName':_0x5698('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.rpc.js b/server/api/chatQueue/chatQueue.rpc.js index 2742b6c..8f7a488 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 _0xb3f9=['stringify','error','code','message','result','GetChatQueue','ChatQueue','findAll','options','attributes','model','include','map','ShowChatQueue','find','raw','where','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','redis','defaults','./chatQueue.socket','register','request','then','info','ChatQueue,\x20%s,\x20%s','debug','ChatQueue,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb3f9,0x122));var _0x9b3f=function(_0x2bf2dd,_0x3aff9c){_0x2bf2dd=_0x2bf2dd-0x0;var _0x1f1448=_0xb3f9[_0x2bf2dd];return _0x1f1448;};'use strict';var _=require(_0x9b3f('0x0'));var util=require(_0x9b3f('0x1'));var moment=require(_0x9b3f('0x2'));var BPromise=require(_0x9b3f('0x3'));var rs=require(_0x9b3f('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9b3f('0x5'))['db'];var utils=require(_0x9b3f('0x6'));var logger=require(_0x9b3f('0x7'))(_0x9b3f('0x8'));var config=require('../../config/environment');var jayson=require(_0x9b3f('0x9'));var client=jayson['client'][_0x9b3f('0xa')]({'port':0x232a});config[_0x9b3f('0xb')]=_[_0x9b3f('0xc')](config[_0x9b3f('0xb')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x9b3f('0xb')]));require(_0x9b3f('0xd'))[_0x9b3f('0xe')](socket);function respondWithRpcPromise(_0x23305a,_0x3864d9,_0x2a53d1){return new BPromise(function(_0x32eafa,_0x154317){return client[_0x9b3f('0xf')](_0x23305a,_0x2a53d1)[_0x9b3f('0x10')](function(_0x862c95){logger[_0x9b3f('0x11')](_0x9b3f('0x12'),_0x3864d9,'request\x20sent');logger[_0x9b3f('0x13')](_0x9b3f('0x14'),_0x3864d9,_0x9b3f('0x15'),JSON[_0x9b3f('0x16')](_0x862c95));if(_0x862c95[_0x9b3f('0x17')]){if(_0x862c95[_0x9b3f('0x17')][_0x9b3f('0x18')]===0x1f4){logger[_0x9b3f('0x17')](_0x9b3f('0x12'),_0x3864d9,_0x862c95[_0x9b3f('0x17')][_0x9b3f('0x19')]);return _0x154317(_0x862c95[_0x9b3f('0x17')][_0x9b3f('0x19')]);}logger['error'](_0x9b3f('0x12'),_0x3864d9,_0x862c95[_0x9b3f('0x17')][_0x9b3f('0x19')]);return _0x32eafa(_0x862c95[_0x9b3f('0x17')]['message']);}else{logger[_0x9b3f('0x11')](_0x9b3f('0x12'),_0x3864d9,_0x9b3f('0x15'));_0x32eafa(_0x862c95[_0x9b3f('0x1a')][_0x9b3f('0x19')]);}})['catch'](function(_0x281ad6){logger['error'](_0x9b3f('0x12'),_0x3864d9,_0x281ad6);_0x154317(_0x281ad6);});});}exports[_0x9b3f('0x1b')]=function(_0x1c29d2){var _0x110388=this;return new Promise(function(_0x34ec2b,_0x4b1ce2){return db[_0x9b3f('0x1c')][_0x9b3f('0x1d')]({'raw':_0x1c29d2['options']?_0x1c29d2[_0x9b3f('0x1e')]['raw']===undefined?!![]:![]:!![],'where':_0x1c29d2['options']?_0x1c29d2[_0x9b3f('0x1e')]['where']||null:null,'attributes':_0x1c29d2[_0x9b3f('0x1e')]?_0x1c29d2[_0x9b3f('0x1e')][_0x9b3f('0x1f')]||null:null,'limit':_0x1c29d2['options']?_0x1c29d2['options']['limit']||null:null,'include':_0x1c29d2[_0x9b3f('0x1e')]?_0x1c29d2[_0x9b3f('0x1e')]['include']?_['map'](_0x1c29d2[_0x9b3f('0x1e')]['include'],function(_0xfae7d3){return{'model':db[_0xfae7d3[_0x9b3f('0x20')]],'as':_0xfae7d3['as'],'attributes':_0xfae7d3[_0x9b3f('0x1f')],'include':_0xfae7d3[_0x9b3f('0x21')]?_[_0x9b3f('0x22')](_0xfae7d3[_0x9b3f('0x21')],function(_0x3b9429){return{'model':db[_0x3b9429[_0x9b3f('0x20')]],'as':_0x3b9429['as'],'attributes':_0x3b9429[_0x9b3f('0x1f')],'include':_0x3b9429[_0x9b3f('0x21')]?_[_0x9b3f('0x22')](_0x3b9429['include'],function(_0x54cfa9){return{'model':db[_0x54cfa9['model']],'as':_0x54cfa9['as'],'attributes':_0x54cfa9[_0x9b3f('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x9b3f('0x10')](function(_0x406e30){logger['info'](_0x9b3f('0x1b'),_0x1c29d2);logger[_0x9b3f('0x13')](_0x9b3f('0x1b'),_0x1c29d2,JSON['stringify'](_0x406e30));_0x34ec2b(_0x406e30);})['catch'](function(_0x52c8d9){logger[_0x9b3f('0x17')](_0x9b3f('0x1b'),_0x52c8d9['message'],_0x1c29d2);_0x4b1ce2(_0x110388['error'](0x1f4,_0x52c8d9['message']));});});};exports[_0x9b3f('0x23')]=function(_0x432532){var _0x5617d9=this;return new Promise(function(_0x1d9faa,_0x458aaf){return db['ChatQueue'][_0x9b3f('0x24')]({'raw':_0x432532[_0x9b3f('0x1e')]?_0x432532[_0x9b3f('0x1e')][_0x9b3f('0x25')]===undefined?!![]:![]:!![],'where':_0x432532[_0x9b3f('0x1e')]?_0x432532[_0x9b3f('0x1e')][_0x9b3f('0x26')]||null:null,'attributes':_0x432532[_0x9b3f('0x1e')]?_0x432532['options'][_0x9b3f('0x1f')]||null:null,'include':_0x432532[_0x9b3f('0x1e')]?_0x432532[_0x9b3f('0x1e')]['include']?_[_0x9b3f('0x22')](_0x432532[_0x9b3f('0x1e')][_0x9b3f('0x21')],function(_0x1fd02d){return{'model':db[_0x1fd02d[_0x9b3f('0x20')]],'as':_0x1fd02d['as'],'attributes':_0x1fd02d[_0x9b3f('0x1f')],'include':_0x1fd02d['include']?_['map'](_0x1fd02d[_0x9b3f('0x21')],function(_0x236473){return{'model':db[_0x236473['model']],'as':_0x236473['as'],'attributes':_0x236473['attributes'],'include':_0x236473[_0x9b3f('0x21')]?_[_0x9b3f('0x22')](_0x236473[_0x9b3f('0x21')],function(_0x2f6b33){return{'model':db[_0x2f6b33[_0x9b3f('0x20')]],'as':_0x2f6b33['as'],'attributes':_0x2f6b33['attributes']};}):[]};}):[]};}):[]:[]})[_0x9b3f('0x10')](function(_0x19f6bd){logger[_0x9b3f('0x11')](_0x9b3f('0x23'),_0x432532);logger[_0x9b3f('0x13')](_0x9b3f('0x23'),_0x432532,JSON['stringify'](_0x19f6bd));_0x1d9faa(_0x19f6bd);})['catch'](function(_0x568984){logger[_0x9b3f('0x17')](_0x9b3f('0x23'),_0x568984['message'],_0x432532);_0x458aaf(_0x5617d9[_0x9b3f('0x17')](0x1f4,_0x568984[_0x9b3f('0x19')]));});});}; \ No newline at end of file +var _0xbb35=['include','ShowChatQueue','ChatQueue','find','catch','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','request','then','info','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatQueue,\x20%s,\x20%s','message','result','GetChatQueue','findAll','options','where','attributes','limit','map','model'];(function(_0x5829c5,_0x45802e){var _0x5fc1ca=function(_0x33e4d7){while(--_0x33e4d7){_0x5829c5['push'](_0x5829c5['shift']());}};_0x5fc1ca(++_0x45802e);}(_0xbb35,0x1d3));var _0x5bb3=function(_0x2a6744,_0x545256){_0x2a6744=_0x2a6744-0x0;var _0x6e87ea=_0xbb35[_0x2a6744];return _0x6e87ea;};'use strict';var _=require('lodash');var util=require(_0x5bb3('0x0'));var moment=require(_0x5bb3('0x1'));var BPromise=require(_0x5bb3('0x2'));var rs=require(_0x5bb3('0x3'));var fs=require('fs');var Redis=require(_0x5bb3('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x5bb3('0x5'));var logger=require(_0x5bb3('0x6'))(_0x5bb3('0x7'));var config=require(_0x5bb3('0x8'));var jayson=require(_0x5bb3('0x9'));var client=jayson[_0x5bb3('0xa')][_0x5bb3('0xb')]({'port':0x232a});config[_0x5bb3('0xc')]=_[_0x5bb3('0xd')](config['redis'],{'host':_0x5bb3('0xe'),'port':0x18eb});var socket=require(_0x5bb3('0xf'))(new Redis(config[_0x5bb3('0xc')]));require(_0x5bb3('0x10'))['register'](socket);function respondWithRpcPromise(_0x399f28,_0x5621a8,_0x4035d1){return new BPromise(function(_0x5a8b3b,_0x12513f){return client[_0x5bb3('0x11')](_0x399f28,_0x4035d1)[_0x5bb3('0x12')](function(_0x3212c8){logger[_0x5bb3('0x13')]('ChatQueue,\x20%s,\x20%s',_0x5621a8,_0x5bb3('0x14'));logger[_0x5bb3('0x15')](_0x5bb3('0x16'),_0x5621a8,'request\x20sent',JSON[_0x5bb3('0x17')](_0x3212c8));if(_0x3212c8[_0x5bb3('0x18')]){if(_0x3212c8[_0x5bb3('0x18')][_0x5bb3('0x19')]===0x1f4){logger[_0x5bb3('0x18')](_0x5bb3('0x1a'),_0x5621a8,_0x3212c8[_0x5bb3('0x18')][_0x5bb3('0x1b')]);return _0x12513f(_0x3212c8['error']['message']);}logger['error'](_0x5bb3('0x1a'),_0x5621a8,_0x3212c8[_0x5bb3('0x18')][_0x5bb3('0x1b')]);return _0x5a8b3b(_0x3212c8[_0x5bb3('0x18')][_0x5bb3('0x1b')]);}else{logger[_0x5bb3('0x13')](_0x5bb3('0x1a'),_0x5621a8,_0x5bb3('0x14'));_0x5a8b3b(_0x3212c8[_0x5bb3('0x1c')][_0x5bb3('0x1b')]);}})['catch'](function(_0x5a541b){logger[_0x5bb3('0x18')](_0x5bb3('0x1a'),_0x5621a8,_0x5a541b);_0x12513f(_0x5a541b);});});}exports[_0x5bb3('0x1d')]=function(_0x442ee2){var _0x197d38=this;return new Promise(function(_0x3fe551,_0x2630b4){return db['ChatQueue'][_0x5bb3('0x1e')]({'raw':_0x442ee2[_0x5bb3('0x1f')]?_0x442ee2[_0x5bb3('0x1f')]['raw']===undefined?!![]:![]:!![],'where':_0x442ee2[_0x5bb3('0x1f')]?_0x442ee2['options'][_0x5bb3('0x20')]||null:null,'attributes':_0x442ee2['options']?_0x442ee2[_0x5bb3('0x1f')][_0x5bb3('0x21')]||null:null,'limit':_0x442ee2[_0x5bb3('0x1f')]?_0x442ee2[_0x5bb3('0x1f')][_0x5bb3('0x22')]||null:null,'include':_0x442ee2[_0x5bb3('0x1f')]?_0x442ee2[_0x5bb3('0x1f')]['include']?_[_0x5bb3('0x23')](_0x442ee2[_0x5bb3('0x1f')]['include'],function(_0x439ee4){return{'model':db[_0x439ee4[_0x5bb3('0x24')]],'as':_0x439ee4['as'],'attributes':_0x439ee4[_0x5bb3('0x21')],'include':_0x439ee4[_0x5bb3('0x25')]?_[_0x5bb3('0x23')](_0x439ee4[_0x5bb3('0x25')],function(_0x405eea){return{'model':db[_0x405eea[_0x5bb3('0x24')]],'as':_0x405eea['as'],'attributes':_0x405eea['attributes'],'include':_0x405eea['include']?_[_0x5bb3('0x23')](_0x405eea['include'],function(_0x182516){return{'model':db[_0x182516['model']],'as':_0x182516['as'],'attributes':_0x182516[_0x5bb3('0x21')]};}):[]};}):[]};}):[]:[]})[_0x5bb3('0x12')](function(_0x104efe){logger['info'](_0x5bb3('0x1d'),_0x442ee2);logger[_0x5bb3('0x15')](_0x5bb3('0x1d'),_0x442ee2,JSON[_0x5bb3('0x17')](_0x104efe));_0x3fe551(_0x104efe);})['catch'](function(_0x55276b){logger[_0x5bb3('0x18')]('GetChatQueue',_0x55276b[_0x5bb3('0x1b')],_0x442ee2);_0x2630b4(_0x197d38[_0x5bb3('0x18')](0x1f4,_0x55276b['message']));});});};exports[_0x5bb3('0x26')]=function(_0xd935a7){var _0x3d7115=this;return new Promise(function(_0xe5981a,_0x46ba29){return db[_0x5bb3('0x27')][_0x5bb3('0x28')]({'raw':_0xd935a7['options']?_0xd935a7[_0x5bb3('0x1f')]['raw']===undefined?!![]:![]:!![],'where':_0xd935a7[_0x5bb3('0x1f')]?_0xd935a7[_0x5bb3('0x1f')][_0x5bb3('0x20')]||null:null,'attributes':_0xd935a7[_0x5bb3('0x1f')]?_0xd935a7['options']['attributes']||null:null,'include':_0xd935a7[_0x5bb3('0x1f')]?_0xd935a7[_0x5bb3('0x1f')][_0x5bb3('0x25')]?_[_0x5bb3('0x23')](_0xd935a7[_0x5bb3('0x1f')][_0x5bb3('0x25')],function(_0x4a7678){return{'model':db[_0x4a7678[_0x5bb3('0x24')]],'as':_0x4a7678['as'],'attributes':_0x4a7678[_0x5bb3('0x21')],'include':_0x4a7678[_0x5bb3('0x25')]?_[_0x5bb3('0x23')](_0x4a7678[_0x5bb3('0x25')],function(_0x5df4c5){return{'model':db[_0x5df4c5[_0x5bb3('0x24')]],'as':_0x5df4c5['as'],'attributes':_0x5df4c5[_0x5bb3('0x21')],'include':_0x5df4c5[_0x5bb3('0x25')]?_[_0x5bb3('0x23')](_0x5df4c5[_0x5bb3('0x25')],function(_0x24ff2c){return{'model':db[_0x24ff2c[_0x5bb3('0x24')]],'as':_0x24ff2c['as'],'attributes':_0x24ff2c[_0x5bb3('0x21')]};}):[]};}):[]};}):[]:[]})[_0x5bb3('0x12')](function(_0x19c820){logger['info'](_0x5bb3('0x26'),_0xd935a7);logger[_0x5bb3('0x15')](_0x5bb3('0x26'),_0xd935a7,JSON[_0x5bb3('0x17')](_0x19c820));_0xe5981a(_0x19c820);})[_0x5bb3('0x29')](function(_0x40cc9d){logger[_0x5bb3('0x18')](_0x5bb3('0x26'),_0x40cc9d[_0x5bb3('0x1b')],_0xd935a7);_0x46ba29(_0x3d7115[_0x5bb3('0x18')](0x1f4,_0x40cc9d[_0x5bb3('0x1b')]));});});}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js index e3d26c4..a7adc34 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 _0xc3b5=['length','remove','update','emit','register'];(function(_0x585786,_0x2d9d8d){var _0xfe74c0=function(_0x53222c){while(--_0x53222c){_0x585786['push'](_0x585786['shift']());}};_0xfe74c0(++_0x2d9d8d);}(_0xc3b5,0x6f));var _0x5c3b=function(_0x4ec2d4,_0x293a03){_0x4ec2d4=_0x4ec2d4-0x0;var _0x451d0c=_0xc3b5[_0x4ec2d4];return _0x451d0c;};'use strict';var ChatQueueEvents=require('./chatQueue.events');var events=['save',_0x5c3b('0x0'),_0x5c3b('0x1')];function createListener(_0xbe95d4,_0x3acf12){return function(_0x2f9a72){_0x3acf12[_0x5c3b('0x2')](_0xbe95d4,_0x2f9a72);};}function removeListener(_0x237a61,_0x48f8a1){return function(){ChatQueueEvents['removeListener'](_0x237a61,_0x48f8a1);};}exports[_0x5c3b('0x3')]=function(_0x6b8a1e){for(var _0x56345e=0x0,_0x568a28=events[_0x5c3b('0x4')];_0x56345e<_0x568a28;_0x56345e++){var _0x420839=events[_0x56345e];var _0x3892ad=createListener('chatQueue:'+_0x420839,_0x6b8a1e);ChatQueueEvents['on'](_0x420839,_0x3892ad);}}; \ No newline at end of file +var _0xbd50=['length','./chatQueue.events','save','remove','emit'];(function(_0x5ec51a,_0x2cf6c5){var _0x461878=function(_0x9c6572){while(--_0x9c6572){_0x5ec51a['push'](_0x5ec51a['shift']());}};_0x461878(++_0x2cf6c5);}(_0xbd50,0x196));var _0x0bd5=function(_0x3fe780,_0x26079d){_0x3fe780=_0x3fe780-0x0;var _0x59c64e=_0xbd50[_0x3fe780];return _0x59c64e;};'use strict';var ChatQueueEvents=require(_0x0bd5('0x0'));var events=[_0x0bd5('0x1'),_0x0bd5('0x2'),'update'];function createListener(_0x44fcb9,_0x167372){return function(_0x37acba){_0x167372[_0x0bd5('0x3')](_0x44fcb9,_0x37acba);};}function removeListener(_0x15620d,_0x4c17ee){return function(){ChatQueueEvents['removeListener'](_0x15620d,_0x4c17ee);};}exports['register']=function(_0x376024){for(var _0x2ef1d0=0x0,_0xcc6cfa=events[_0x0bd5('0x4')];_0x2ef1d0<_0xcc6cfa;_0x2ef1d0++){var _0x1b99f3=events[_0x2ef1d0];var _0x5ebe64=createListener('chatQueue:'+_0x1b99f3,_0x376024);ChatQueueEvents['on'](_0x1b99f3,_0x5ebe64);}}; \ No newline at end of file diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js index 90ad93c..27b4464 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(_0x24f2ab,_0x50dc87){var _0x2c6e50=function(_0x20792c){while(--_0x20792c){_0x24f2ab['push'](_0x24f2ab['shift']());}};_0x2c6e50(++_0x50dc87);}(_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',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 _0x3e74=['../../config/environment','./chatQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','show','getMembers','/:id/teams','getTeams','getAgents','post','addTeams','addAgents','put','delete','removeTeams','/:id/users','removeAgents','exports','multer','path','connect-timeout','express','../../components/auth/service'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x3e74,0x175));var _0x43e7=function(_0x373165,_0x2facaa){_0x373165=_0x373165-0x0;var _0xe72735=_0x3e74[_0x373165];return _0xe72735;};'use strict';var multer=require(_0x43e7('0x0'));var util=require('util');var path=require(_0x43e7('0x1'));var timeout=require(_0x43e7('0x2'));var express=require(_0x43e7('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x43e7('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x43e7('0x5'));var controller=require(_0x43e7('0x6'));router[_0x43e7('0x7')]('/',auth[_0x43e7('0x8')](),controller[_0x43e7('0x9')]);router['get'](_0x43e7('0xa'),auth[_0x43e7('0x8')](),controller[_0x43e7('0xb')]);router[_0x43e7('0x7')](_0x43e7('0xc'),auth['isAuthenticated'](),controller[_0x43e7('0xd')]);router['get']('/:id/members',auth[_0x43e7('0x8')](),controller[_0x43e7('0xe')]);router['get'](_0x43e7('0xf'),auth['isAuthenticated'](),controller[_0x43e7('0x10')]);router[_0x43e7('0x7')]('/:id/users',auth[_0x43e7('0x8')](),controller[_0x43e7('0x11')]);router[_0x43e7('0x12')]('/',auth[_0x43e7('0x8')](),controller['create']);router['post'](_0x43e7('0xf'),auth[_0x43e7('0x8')](),controller[_0x43e7('0x13')]);router['post']('/:id/users',auth[_0x43e7('0x8')](),controller[_0x43e7('0x14')]);router[_0x43e7('0x15')](_0x43e7('0xc'),auth['isAuthenticated'](),controller['update']);router[_0x43e7('0x16')](_0x43e7('0xc'),auth[_0x43e7('0x8')](),controller['destroy']);router['delete'](_0x43e7('0xf'),auth[_0x43e7('0x8')](),controller[_0x43e7('0x17')]);router[_0x43e7('0x16')](_0x43e7('0x18'),auth[_0x43e7('0x8')](),controller[_0x43e7('0x19')]);module[_0x43e7('0x1a')]=router; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.attributes.js b/server/api/chatQueueReport/chatQueueReport.attributes.js index 6e0cc32..4d9eb0d 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 _0x6649=['DATE','moment','sequelize','STRING'];(function(_0x75c346,_0x3aa49a){var _0x2b4b02=function(_0x48fdf3){while(--_0x48fdf3){_0x75c346['push'](_0x75c346['shift']());}};_0x2b4b02(++_0x3aa49a);}(_0x6649,0x141));var _0x9664=function(_0x40b8c6,_0xebe95e){_0x40b8c6=_0x40b8c6-0x0;var _0x47b92e=_0x6649[_0x40b8c6];return _0x47b92e;};'use strict';var moment=require(_0x9664('0x0'));var Sequelize=require(_0x9664('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0x9664('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x9664('0x2')]},'joinAt':{'type':Sequelize[_0x9664('0x3')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0x9664('0x3')]},'exitAt':{'type':Sequelize[_0x9664('0x3')]},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x2a8d=['DATE','moment','sequelize','exports','STRING'];(function(_0x35885a,_0x42fed7){var _0xe86249=function(_0x98edb3){while(--_0x98edb3){_0x35885a['push'](_0x35885a['shift']());}};_0xe86249(++_0x42fed7);}(_0x2a8d,0x11e));var _0xd2a8=function(_0x4e1a49,_0x4da738){_0x4e1a49=_0x4e1a49-0x0;var _0x136aae=_0x2a8d[_0x4e1a49];return _0x136aae;};'use strict';var moment=require(_0xd2a8('0x0'));var Sequelize=require(_0xd2a8('0x1'));module[_0xd2a8('0x2')]={'uniqueid':{'type':Sequelize[_0xd2a8('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0xd2a8('0x3')]},'joinAt':{'type':Sequelize[_0xd2a8('0x4')]},'leaveAt':{'type':Sequelize[_0xd2a8('0x4')]},'acceptAt':{'type':Sequelize[_0xd2a8('0x4')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js index affc61e..d6b0554 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 _0x9261=['rows','show','params','rawAttributes','find','catch','create','body','destroy','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','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','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','stack','name','send','index','map','ChatQueueReport','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','nolimit','sort','where','merge','VIRTUAL','filter','options','includeAll','include','findAll'];(function(_0x47a7d0,_0x4e182d){var _0xb9bd08=function(_0x588ee2){while(--_0x588ee2){_0x47a7d0['push'](_0x47a7d0['shift']());}};_0xb9bd08(++_0x4e182d);}(_0x9261,0x1de));var _0x1926=function(_0x1ea6eb,_0x33d3d4){_0x1ea6eb=_0x1ea6eb-0x0;var _0x127200=_0x9261[_0x1ea6eb];return _0x127200;};'use strict';var emlformat=require(_0x1926('0x0'));var rimraf=require(_0x1926('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x1926('0x2'));var rp=require(_0x1926('0x3'));var moment=require(_0x1926('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x1926('0x5'));var util=require(_0x1926('0x6'));var path=require(_0x1926('0x7'));var sox=require(_0x1926('0x8'));var csv=require(_0x1926('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1926('0xa'));var _=require('lodash');var squel=require(_0x1926('0xb'));var crypto=require(_0x1926('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x1926('0xd'));var toCsv=require(_0x1926('0x9'));var querystring=require(_0x1926('0xe'));var Papa=require(_0x1926('0xf'));var Redis=require(_0x1926('0x10'));var authService=require(_0x1926('0x11'));var qs=require(_0x1926('0x12'));var as=require(_0x1926('0x13'));var hardwareService=require(_0x1926('0x14'));var logger=require(_0x1926('0x15'))(_0x1926('0x16'));var utils=require(_0x1926('0x17'));var config=require(_0x1926('0x18'));var licenseUtil=require(_0x1926('0x19'));var db=require(_0x1926('0x1a'))['db'];function respondWithStatusCode(_0x3d4817,_0x10a758){_0x10a758=_0x10a758||0xcc;return function(_0x41f84d){if(_0x41f84d){return _0x3d4817[_0x1926('0x1b')](_0x10a758);}return _0x3d4817[_0x1926('0x1c')](_0x10a758)[_0x1926('0x1d')]();};}function respondWithResult(_0x33779c,_0x2ed996){_0x2ed996=_0x2ed996||0xc8;return function(_0x4ff9ff){if(_0x4ff9ff){return _0x33779c[_0x1926('0x1c')](_0x2ed996)[_0x1926('0x1e')](_0x4ff9ff);}};}function respondWithFilteredResult(_0x53f820,_0xe13cde){return function(_0x348117){if(_0x348117){var _0x42a80b=typeof _0xe13cde['offset']===_0x1926('0x1f')&&typeof _0xe13cde[_0x1926('0x20')]==='undefined';var _0x21e214=_0x348117[_0x1926('0x21')];var _0xdfa757=_0x42a80b?0x0:_0xe13cde[_0x1926('0x22')];var _0x1b8d73=_0x42a80b?_0x348117[_0x1926('0x21')]:_0xe13cde[_0x1926('0x22')]+_0xe13cde[_0x1926('0x20')];var _0x1e4b49;if(_0x1b8d73>=_0x21e214){_0x1b8d73=_0x21e214;_0x1e4b49=0xc8;}else{_0x1e4b49=0xce;}_0x53f820[_0x1926('0x1c')](_0x1e4b49);return _0x53f820[_0x1926('0x23')](_0x1926('0x24'),_0xdfa757+'-'+_0x1b8d73+'/'+_0x21e214)[_0x1926('0x1e')](_0x348117);}return null;};}function patchUpdates(_0x4e4657){return function(_0x4866f5){try{jsonpatch[_0x1926('0x25')](_0x4866f5,_0x4e4657,!![]);}catch(_0x32fb7a){return BPromise[_0x1926('0x26')](_0x32fb7a);}return _0x4866f5[_0x1926('0x27')]();};}function saveUpdates(_0x2361e2,_0x31d906){return function(_0x32bd70){if(_0x32bd70){return _0x32bd70[_0x1926('0x28')](_0x2361e2)[_0x1926('0x29')](function(_0x3e0ab0){return _0x3e0ab0;});}return null;};}function removeEntity(_0x328aa9,_0x49d367){return function(_0x5d00c7){if(_0x5d00c7){return _0x5d00c7['destroy']()['then'](function(){_0x328aa9[_0x1926('0x1c')](0xcc)[_0x1926('0x1d')]();});}};}function handleEntityNotFound(_0x11e28e,_0x462c85){return function(_0x4fc645){if(!_0x4fc645){_0x11e28e['sendStatus'](0x194);}return _0x4fc645;};}function handleError(_0x561b3a,_0x3659fa){_0x3659fa=_0x3659fa||0x1f4;return function(_0x142f45){logger['error'](_0x142f45[_0x1926('0x2a')]);if(_0x142f45[_0x1926('0x2b')]){delete _0x142f45[_0x1926('0x2b')];}_0x561b3a[_0x1926('0x1c')](_0x3659fa)[_0x1926('0x2c')](_0x142f45);};}exports[_0x1926('0x2d')]=function(_0x267513,_0xd60129){var _0x1c8290={},_0x521645={},_0x22e16e={'count':0x0,'rows':[]};var _0x42e41e=_[_0x1926('0x2e')](db[_0x1926('0x2f')]['rawAttributes'],function(_0x391915){return{'name':_0x391915[_0x1926('0x30')],'type':_0x391915[_0x1926('0x31')][_0x1926('0x32')]};});_0x521645[_0x1926('0x33')]=_['map'](_0x42e41e,_0x1926('0x2b'));_0x521645['query']=_[_0x1926('0x34')](_0x267513[_0x1926('0x35')]);_0x521645[_0x1926('0x36')]=_[_0x1926('0x37')](_0x521645['model'],_0x521645[_0x1926('0x35')]);_0x1c8290[_0x1926('0x38')]=_[_0x1926('0x37')](_0x521645['model'],qs[_0x1926('0x39')](_0x267513[_0x1926('0x35')][_0x1926('0x39')]));_0x1c8290[_0x1926('0x38')]=_0x1c8290[_0x1926('0x38')]['length']?_0x1c8290['attributes']:_0x521645[_0x1926('0x33')];if(!_0x267513['query']['hasOwnProperty'](_0x1926('0x3a'))){_0x1c8290['limit']=qs[_0x1926('0x20')](_0x267513[_0x1926('0x35')][_0x1926('0x20')]);_0x1c8290['offset']=qs[_0x1926('0x22')](_0x267513[_0x1926('0x35')]['offset']);}_0x1c8290['order']=qs[_0x1926('0x3b')](_0x267513[_0x1926('0x35')][_0x1926('0x3b')]);_0x1c8290[_0x1926('0x3c')]=qs[_0x1926('0x36')](_['pick'](_0x267513[_0x1926('0x35')],_0x521645[_0x1926('0x36')]),_0x42e41e);if(_0x267513[_0x1926('0x35')]['filter']){_0x1c8290[_0x1926('0x3c')]=_[_0x1926('0x3d')](_0x1c8290[_0x1926('0x3c')],{'$or':_[_0x1926('0x2e')](_0x42e41e,function(_0x44f157){if(_0x44f157[_0x1926('0x31')]!==_0x1926('0x3e')){var _0x436ed7={};_0x436ed7[_0x44f157[_0x1926('0x2b')]]={'$like':'%'+_0x267513[_0x1926('0x35')][_0x1926('0x3f')]+'%'};return _0x436ed7;}})});}_0x1c8290=_[_0x1926('0x3d')]({},_0x1c8290,_0x267513[_0x1926('0x40')]);var _0x372204={'where':_0x1c8290[_0x1926('0x3c')]};return db[_0x1926('0x2f')][_0x1926('0x21')](_0x372204)['then'](function(_0x285a2f){_0x22e16e[_0x1926('0x21')]=_0x285a2f;if(_0x267513['query'][_0x1926('0x41')]){_0x1c8290[_0x1926('0x42')]=[{'all':!![]}];}return db['ChatQueueReport'][_0x1926('0x43')](_0x1c8290);})[_0x1926('0x29')](function(_0x362df6){_0x22e16e[_0x1926('0x44')]=_0x362df6;return _0x22e16e;})[_0x1926('0x29')](respondWithFilteredResult(_0xd60129,_0x1c8290))['catch'](handleError(_0xd60129,null));};exports[_0x1926('0x45')]=function(_0x313632,_0x54efec){var _0x164c26={'raw':!![],'where':{'id':_0x313632[_0x1926('0x46')]['id']}},_0x5cff82={};_0x5cff82['model']=_[_0x1926('0x34')](db[_0x1926('0x2f')][_0x1926('0x47')]);_0x5cff82[_0x1926('0x35')]=_[_0x1926('0x34')](_0x313632['query']);_0x5cff82[_0x1926('0x36')]=_[_0x1926('0x37')](_0x5cff82[_0x1926('0x33')],_0x5cff82[_0x1926('0x35')]);_0x164c26[_0x1926('0x38')]=_[_0x1926('0x37')](_0x5cff82[_0x1926('0x33')],qs[_0x1926('0x39')](_0x313632[_0x1926('0x35')]['fields']));_0x164c26['attributes']=_0x164c26[_0x1926('0x38')]['length']?_0x164c26[_0x1926('0x38')]:_0x5cff82['model'];if(_0x313632[_0x1926('0x35')][_0x1926('0x41')]){_0x164c26[_0x1926('0x42')]=[{'all':!![]}];}_0x164c26=_[_0x1926('0x3d')]({},_0x164c26,_0x313632['options']);return db[_0x1926('0x2f')][_0x1926('0x48')](_0x164c26)[_0x1926('0x29')](handleEntityNotFound(_0x54efec,null))[_0x1926('0x29')](respondWithResult(_0x54efec,null))[_0x1926('0x49')](handleError(_0x54efec,null));};exports[_0x1926('0x4a')]=function(_0x503e40,_0x12c3a1){return db['ChatQueueReport'][_0x1926('0x4a')](_0x503e40[_0x1926('0x4b')],{})[_0x1926('0x29')](respondWithResult(_0x12c3a1,0xc9))[_0x1926('0x49')](handleError(_0x12c3a1,null));};exports[_0x1926('0x28')]=function(_0x5dfd39,_0x9fb405){if(_0x5dfd39[_0x1926('0x4b')]['id']){delete _0x5dfd39[_0x1926('0x4b')]['id'];}return db[_0x1926('0x2f')][_0x1926('0x48')]({'where':{'id':_0x5dfd39['params']['id']}})[_0x1926('0x29')](handleEntityNotFound(_0x9fb405,null))[_0x1926('0x29')](saveUpdates(_0x5dfd39[_0x1926('0x4b')],null))['then'](respondWithResult(_0x9fb405,null))['catch'](handleError(_0x9fb405,null));};exports[_0x1926('0x4c')]=function(_0x44c541,_0x5ecc18){return db[_0x1926('0x2f')][_0x1926('0x48')]({'where':{'id':_0x44c541[_0x1926('0x46')]['id']}})['then'](handleEntityNotFound(_0x5ecc18,null))[_0x1926('0x29')](removeEntity(_0x5ecc18,null))[_0x1926('0x49')](handleError(_0x5ecc18,null));};exports[_0x1926('0x4d')]=function(_0x3cca11,_0x47f9da){return db[_0x1926('0x2f')][_0x1926('0x4d')]()[_0x1926('0x29')](respondWithResult(_0x47f9da,null))[_0x1926('0x49')](handleError(_0x47f9da,null));}; \ No newline at end of file +var _0x5a4f=['fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','keys','merge','find','create','body','destroy','describe','eml-format','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','count','limit','Content-Range','apply','reject','save','update','then','error','stack','name','send','index','ChatQueueReport','rawAttributes','fieldName','type','key','model','map','query','filters','intersection'];(function(_0x718486,_0x48532c){var _0x4bab67=function(_0x1e36cc){while(--_0x1e36cc){_0x718486['push'](_0x718486['shift']());}};_0x4bab67(++_0x48532c);}(_0x5a4f,0x10d));var _0xf5a4=function(_0xefd519,_0xc62635){_0xefd519=_0xefd519-0x0;var _0x4bb882=_0x5a4f[_0xefd519];return _0x4bb882;};'use strict';var emlformat=require(_0xf5a4('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf5a4('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf5a4('0x2'));var moment=require('moment');var BPromise=require(_0xf5a4('0x3'));var Mustache=require(_0xf5a4('0x4'));var util=require(_0xf5a4('0x5'));var path=require(_0xf5a4('0x6'));var sox=require(_0xf5a4('0x7'));var csv=require(_0xf5a4('0x8'));var ejs=require(_0xf5a4('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf5a4('0xa'));var squel=require(_0xf5a4('0xb'));var crypto=require(_0xf5a4('0xc'));var jsforce=require(_0xf5a4('0xd'));var deskjs=require(_0xf5a4('0xe'));var toCsv=require(_0xf5a4('0x8'));var querystring=require(_0xf5a4('0xf'));var Papa=require(_0xf5a4('0x10'));var Redis=require(_0xf5a4('0x11'));var authService=require(_0xf5a4('0x12'));var qs=require(_0xf5a4('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf5a4('0x14'));var logger=require(_0xf5a4('0x15'))(_0xf5a4('0x16'));var utils=require(_0xf5a4('0x17'));var config=require(_0xf5a4('0x18'));var licenseUtil=require(_0xf5a4('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3aa256,_0x137b7c){_0x137b7c=_0x137b7c||0xcc;return function(_0x216b6a){if(_0x216b6a){return _0x3aa256[_0xf5a4('0x1a')](_0x137b7c);}return _0x3aa256[_0xf5a4('0x1b')](_0x137b7c)[_0xf5a4('0x1c')]();};}function respondWithResult(_0x43055a,_0x5310f2){_0x5310f2=_0x5310f2||0xc8;return function(_0x93fd28){if(_0x93fd28){return _0x43055a[_0xf5a4('0x1b')](_0x5310f2)[_0xf5a4('0x1d')](_0x93fd28);}};}function respondWithFilteredResult(_0x423a18,_0xc0a8f2){return function(_0x2d2678){if(_0x2d2678){var _0x494e51=typeof _0xc0a8f2[_0xf5a4('0x1e')]===_0xf5a4('0x1f')&&typeof _0xc0a8f2['limit']===_0xf5a4('0x1f');var _0x4f6d5b=_0x2d2678['count'];var _0x1aad18=_0x494e51?0x0:_0xc0a8f2[_0xf5a4('0x1e')];var _0x30d013=_0x494e51?_0x2d2678[_0xf5a4('0x20')]:_0xc0a8f2[_0xf5a4('0x1e')]+_0xc0a8f2[_0xf5a4('0x21')];var _0x1b271c;if(_0x30d013>=_0x4f6d5b){_0x30d013=_0x4f6d5b;_0x1b271c=0xc8;}else{_0x1b271c=0xce;}_0x423a18[_0xf5a4('0x1b')](_0x1b271c);return _0x423a18['set'](_0xf5a4('0x22'),_0x1aad18+'-'+_0x30d013+'/'+_0x4f6d5b)[_0xf5a4('0x1d')](_0x2d2678);}return null;};}function patchUpdates(_0x4fefcb){return function(_0x48c45f){try{jsonpatch[_0xf5a4('0x23')](_0x48c45f,_0x4fefcb,!![]);}catch(_0x289c72){return BPromise[_0xf5a4('0x24')](_0x289c72);}return _0x48c45f[_0xf5a4('0x25')]();};}function saveUpdates(_0xe67382,_0x5d577a){return function(_0x544d10){if(_0x544d10){return _0x544d10[_0xf5a4('0x26')](_0xe67382)[_0xf5a4('0x27')](function(_0x43bcb9){return _0x43bcb9;});}return null;};}function removeEntity(_0x378a7c,_0x139db6){return function(_0x27ebae){if(_0x27ebae){return _0x27ebae['destroy']()[_0xf5a4('0x27')](function(){_0x378a7c[_0xf5a4('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x36d007,_0x4ad997){return function(_0x2093be){if(!_0x2093be){_0x36d007[_0xf5a4('0x1a')](0x194);}return _0x2093be;};}function handleError(_0x9cfdfb,_0x39612c){_0x39612c=_0x39612c||0x1f4;return function(_0x4ea5e0){logger[_0xf5a4('0x28')](_0x4ea5e0[_0xf5a4('0x29')]);if(_0x4ea5e0[_0xf5a4('0x2a')]){delete _0x4ea5e0[_0xf5a4('0x2a')];}_0x9cfdfb[_0xf5a4('0x1b')](_0x39612c)[_0xf5a4('0x2b')](_0x4ea5e0);};}exports[_0xf5a4('0x2c')]=function(_0x594303,_0x3c53cf){var _0x3701bd={},_0x2c0ca8={},_0x9761cf={'count':0x0,'rows':[]};var _0x219aa6=_['map'](db[_0xf5a4('0x2d')][_0xf5a4('0x2e')],function(_0x403ca4){return{'name':_0x403ca4[_0xf5a4('0x2f')],'type':_0x403ca4[_0xf5a4('0x30')][_0xf5a4('0x31')]};});_0x2c0ca8[_0xf5a4('0x32')]=_[_0xf5a4('0x33')](_0x219aa6,_0xf5a4('0x2a'));_0x2c0ca8['query']=_['keys'](_0x594303[_0xf5a4('0x34')]);_0x2c0ca8[_0xf5a4('0x35')]=_[_0xf5a4('0x36')](_0x2c0ca8[_0xf5a4('0x32')],_0x2c0ca8[_0xf5a4('0x34')]);_0x3701bd['attributes']=_[_0xf5a4('0x36')](_0x2c0ca8[_0xf5a4('0x32')],qs[_0xf5a4('0x37')](_0x594303[_0xf5a4('0x34')]['fields']));_0x3701bd[_0xf5a4('0x38')]=_0x3701bd[_0xf5a4('0x38')][_0xf5a4('0x39')]?_0x3701bd['attributes']:_0x2c0ca8['model'];if(!_0x594303[_0xf5a4('0x34')][_0xf5a4('0x3a')](_0xf5a4('0x3b'))){_0x3701bd[_0xf5a4('0x21')]=qs[_0xf5a4('0x21')](_0x594303[_0xf5a4('0x34')][_0xf5a4('0x21')]);_0x3701bd[_0xf5a4('0x1e')]=qs[_0xf5a4('0x1e')](_0x594303['query'][_0xf5a4('0x1e')]);}_0x3701bd[_0xf5a4('0x3c')]=qs[_0xf5a4('0x3d')](_0x594303['query'][_0xf5a4('0x3d')]);_0x3701bd[_0xf5a4('0x3e')]=qs['filters'](_[_0xf5a4('0x3f')](_0x594303[_0xf5a4('0x34')],_0x2c0ca8[_0xf5a4('0x35')]),_0x219aa6);if(_0x594303[_0xf5a4('0x34')][_0xf5a4('0x40')]){_0x3701bd[_0xf5a4('0x3e')]=_['merge'](_0x3701bd['where'],{'$or':_['map'](_0x219aa6,function(_0x619809){if(_0x619809['type']!==_0xf5a4('0x41')){var _0xde4caf={};_0xde4caf[_0x619809[_0xf5a4('0x2a')]]={'$like':'%'+_0x594303[_0xf5a4('0x34')][_0xf5a4('0x40')]+'%'};return _0xde4caf;}})});}_0x3701bd=_['merge']({},_0x3701bd,_0x594303[_0xf5a4('0x42')]);var _0x32ec06={'where':_0x3701bd[_0xf5a4('0x3e')]};return db['ChatQueueReport'][_0xf5a4('0x20')](_0x32ec06)['then'](function(_0x13e64e){_0x9761cf[_0xf5a4('0x20')]=_0x13e64e;if(_0x594303['query'][_0xf5a4('0x43')]){_0x3701bd[_0xf5a4('0x44')]=[{'all':!![]}];}return db[_0xf5a4('0x2d')][_0xf5a4('0x45')](_0x3701bd);})['then'](function(_0xecc70){_0x9761cf[_0xf5a4('0x46')]=_0xecc70;return _0x9761cf;})[_0xf5a4('0x27')](respondWithFilteredResult(_0x3c53cf,_0x3701bd))[_0xf5a4('0x47')](handleError(_0x3c53cf,null));};exports[_0xf5a4('0x48')]=function(_0x55af71,_0x1bbf04){var _0x4c4d98={'raw':!![],'where':{'id':_0x55af71[_0xf5a4('0x49')]['id']}},_0x5e2f8d={};_0x5e2f8d[_0xf5a4('0x32')]=_[_0xf5a4('0x4a')](db[_0xf5a4('0x2d')][_0xf5a4('0x2e')]);_0x5e2f8d[_0xf5a4('0x34')]=_[_0xf5a4('0x4a')](_0x55af71[_0xf5a4('0x34')]);_0x5e2f8d[_0xf5a4('0x35')]=_[_0xf5a4('0x36')](_0x5e2f8d[_0xf5a4('0x32')],_0x5e2f8d['query']);_0x4c4d98[_0xf5a4('0x38')]=_[_0xf5a4('0x36')](_0x5e2f8d[_0xf5a4('0x32')],qs[_0xf5a4('0x37')](_0x55af71['query'][_0xf5a4('0x37')]));_0x4c4d98[_0xf5a4('0x38')]=_0x4c4d98[_0xf5a4('0x38')][_0xf5a4('0x39')]?_0x4c4d98['attributes']:_0x5e2f8d[_0xf5a4('0x32')];if(_0x55af71[_0xf5a4('0x34')][_0xf5a4('0x43')]){_0x4c4d98[_0xf5a4('0x44')]=[{'all':!![]}];}_0x4c4d98=_[_0xf5a4('0x4b')]({},_0x4c4d98,_0x55af71['options']);return db[_0xf5a4('0x2d')][_0xf5a4('0x4c')](_0x4c4d98)[_0xf5a4('0x27')](handleEntityNotFound(_0x1bbf04,null))[_0xf5a4('0x27')](respondWithResult(_0x1bbf04,null))[_0xf5a4('0x47')](handleError(_0x1bbf04,null));};exports[_0xf5a4('0x4d')]=function(_0x2108fc,_0x10d8de){return db['ChatQueueReport'][_0xf5a4('0x4d')](_0x2108fc['body'],{})[_0xf5a4('0x27')](respondWithResult(_0x10d8de,0xc9))[_0xf5a4('0x47')](handleError(_0x10d8de,null));};exports[_0xf5a4('0x26')]=function(_0x32a976,_0xd75892){if(_0x32a976[_0xf5a4('0x4e')]['id']){delete _0x32a976[_0xf5a4('0x4e')]['id'];}return db['ChatQueueReport'][_0xf5a4('0x4c')]({'where':{'id':_0x32a976[_0xf5a4('0x49')]['id']}})[_0xf5a4('0x27')](handleEntityNotFound(_0xd75892,null))[_0xf5a4('0x27')](saveUpdates(_0x32a976['body'],null))[_0xf5a4('0x27')](respondWithResult(_0xd75892,null))[_0xf5a4('0x47')](handleError(_0xd75892,null));};exports[_0xf5a4('0x4f')]=function(_0x190fac,_0x116ee2){return db[_0xf5a4('0x2d')][_0xf5a4('0x4c')]({'where':{'id':_0x190fac[_0xf5a4('0x49')]['id']}})[_0xf5a4('0x27')](handleEntityNotFound(_0x116ee2,null))['then'](removeEntity(_0x116ee2,null))['catch'](handleError(_0x116ee2,null));};exports[_0xf5a4('0x50')]=function(_0x552836,_0x1a5e2c){return db['ChatQueueReport'][_0xf5a4('0x50')]()[_0xf5a4('0x27')](respondWithResult(_0x1a5e2c,null))['catch'](handleError(_0x1a5e2c,null));}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js index f233458..0198b6b 100644 --- a/server/api/chatQueueReport/chatQueueReport.model.js +++ b/server/api/chatQueueReport/chatQueueReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd8b0=['define','report_chat_queue','uniqueid','lodash','util','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x30adfe,_0x437447){var _0x506bde=function(_0x20c125){while(--_0x20c125){_0x30adfe['push'](_0x30adfe['shift']());}};_0x506bde(++_0x437447);}(_0xd8b0,0xad));var _0x0d8b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd8b0[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x0d8b('0x2'));var rp=require(_0x0d8b('0x3'));var fs=require('fs');var path=require(_0x0d8b('0x4'));var rimraf=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var attributes=require('./chatQueueReport.attributes');module['exports']=function(_0x3f8b6f,_0x227c63){return _0x3f8b6f[_0x0d8b('0x7')]('ChatQueueReport',attributes,{'tableName':_0x0d8b('0x8'),'paranoid':![],'indexes':[{'name':_0x0d8b('0x9'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0xb10b=['../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define','report_chat_queue','uniqueid','lodash'];(function(_0x324012,_0x23f45f){var _0x435cf2=function(_0x378a82){while(--_0x378a82){_0x324012['push'](_0x324012['shift']());}};_0x435cf2(++_0x23f45f);}(_0xb10b,0x12a));var _0xbb10=function(_0x2aaa60,_0x22258f){_0x2aaa60=_0x2aaa60-0x0;var _0x2e3fa5=_0xb10b[_0x2aaa60];return _0x2e3fa5;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var logger=require(_0xbb10('0x1'))(_0xbb10('0x2'));var moment=require(_0xbb10('0x3'));var BPromise=require('bluebird');var rp=require(_0xbb10('0x4'));var fs=require('fs');var path=require(_0xbb10('0x5'));var rimraf=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var attributes=require(_0xbb10('0x8'));module[_0xbb10('0x9')]=function(_0x481979,_0x328583){return _0x481979[_0xbb10('0xa')]('ChatQueueReport',attributes,{'tableName':_0xbb10('0xb'),'paranoid':![],'indexes':[{'name':_0xbb10('0xc'),'fields':[_0xbb10('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.rpc.js b/server/api/chatQueueReport/chatQueueReport.rpc.js index f8c4b95..947d40c 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 _0x6e7c=['request','then','info','ChatQueueReport,\x20%s,\x20%s','debug','request\x20sent','error','code','message','result','create','options','raw','CreateChatQueueReport','stringify','catch','UpdateChatQueueReport','ChatQueueReport','attributes','limit','util','bluebird','ioredis','../../mysqldb','../../config/logger','jayson/promise','http'];(function(_0xdcb1ab,_0x3aee18){var _0x1d29b7=function(_0x1b4d23){while(--_0x1b4d23){_0xdcb1ab['push'](_0xdcb1ab['shift']());}};_0x1d29b7(++_0x3aee18);}(_0x6e7c,0xb6));var _0xc6e7=function(_0x51be45,_0x159a6a){_0x51be45=_0x51be45-0x0;var _0x1622aa=_0x6e7c[_0x51be45];return _0x1622aa;};'use strict';var _=require('lodash');var util=require(_0xc6e7('0x0'));var moment=require('moment');var BPromise=require(_0xc6e7('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc6e7('0x2'));var db=require(_0xc6e7('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xc6e7('0x4'))('rpc');var config=require('../../config/environment');var jayson=require(_0xc6e7('0x5'));var client=jayson['client'][_0xc6e7('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x27c24c,_0x19beb0,_0x53b818){return new BPromise(function(_0x283c01,_0x1a6920){return client[_0xc6e7('0x7')](_0x27c24c,_0x53b818)[_0xc6e7('0x8')](function(_0x307e27){logger[_0xc6e7('0x9')](_0xc6e7('0xa'),_0x19beb0,'request\x20sent');logger[_0xc6e7('0xb')]('ChatQueueReport,\x20%s,\x20%s,\x20%s',_0x19beb0,_0xc6e7('0xc'),JSON['stringify'](_0x307e27));if(_0x307e27['error']){if(_0x307e27[_0xc6e7('0xd')][_0xc6e7('0xe')]===0x1f4){logger[_0xc6e7('0xd')](_0xc6e7('0xa'),_0x19beb0,_0x307e27[_0xc6e7('0xd')]['message']);return _0x1a6920(_0x307e27[_0xc6e7('0xd')][_0xc6e7('0xf')]);}logger[_0xc6e7('0xd')](_0xc6e7('0xa'),_0x19beb0,_0x307e27['error'][_0xc6e7('0xf')]);return _0x283c01(_0x307e27[_0xc6e7('0xd')][_0xc6e7('0xf')]);}else{logger['info'](_0xc6e7('0xa'),_0x19beb0,_0xc6e7('0xc'));_0x283c01(_0x307e27[_0xc6e7('0x10')][_0xc6e7('0xf')]);}})['catch'](function(_0x5d7a23){logger['error'](_0xc6e7('0xa'),_0x19beb0,_0x5d7a23);_0x1a6920(_0x5d7a23);});});}exports['CreateChatQueueReport']=function(_0x31821b){var _0x185c0a=this;return new Promise(function(_0x1d94c6,_0x17f942){return db['ChatQueueReport'][_0xc6e7('0x11')](_0x31821b['body'],{'raw':_0x31821b[_0xc6e7('0x12')]?_0x31821b[_0xc6e7('0x12')][_0xc6e7('0x13')]===undefined?!![]:![]:!![]})[_0xc6e7('0x8')](function(_0x438f13){logger[_0xc6e7('0x9')](_0xc6e7('0x14'),_0x31821b);logger[_0xc6e7('0xb')](_0xc6e7('0x14'),_0x31821b,JSON[_0xc6e7('0x15')](_0x438f13));_0x1d94c6(_0x438f13);})[_0xc6e7('0x16')](function(_0x395c87){logger[_0xc6e7('0xd')]('CreateChatQueueReport',_0x395c87[_0xc6e7('0xf')],_0x31821b);_0x17f942(_0x185c0a['error'](0x1f4,_0x395c87[_0xc6e7('0xf')]));});});};exports[_0xc6e7('0x17')]=function(_0xa3a9cf){var _0x40e70e=this;return new Promise(function(_0x524152,_0x572102){return db[_0xc6e7('0x18')]['update'](_0xa3a9cf['body'],{'raw':_0xa3a9cf[_0xc6e7('0x12')]?_0xa3a9cf[_0xc6e7('0x12')][_0xc6e7('0x13')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xa3a9cf['options']?_0xa3a9cf[_0xc6e7('0x12')]['where']||null:null,'attributes':_0xa3a9cf[_0xc6e7('0x12')]?_0xa3a9cf['options'][_0xc6e7('0x19')]||null:null,'limit':_0xa3a9cf['options']?_0xa3a9cf[_0xc6e7('0x12')][_0xc6e7('0x1a')]||null:null})[_0xc6e7('0x8')](function(_0x1b6c65){logger[_0xc6e7('0x9')](_0xc6e7('0x17'),_0xa3a9cf);logger[_0xc6e7('0xb')](_0xc6e7('0x17'),_0xa3a9cf,JSON['stringify'](_0x1b6c65));_0x524152(_0x1b6c65);})['catch'](function(_0x1a43a6){logger[_0xc6e7('0xd')](_0xc6e7('0x17'),_0x1a43a6[_0xc6e7('0xf')],_0xa3a9cf);_0x572102(_0x40e70e[_0xc6e7('0xd')](0x1f4,_0x1a43a6[_0xc6e7('0xf')]));});});}; \ No newline at end of file +var _0x4bde=['jayson/promise','client','http','request','then','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','ChatQueueReport,\x20%s,\x20%s','message','info','result','catch','CreateChatQueueReport','ChatQueueReport','options','raw','stringify','UpdateChatQueueReport','body','where','attributes','limit','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment'];(function(_0x587070,_0x50c31c){var _0x5a6554=function(_0x134626){while(--_0x134626){_0x587070['push'](_0x587070['shift']());}};_0x5a6554(++_0x50c31c);}(_0x4bde,0x1b1));var _0xe4bd=function(_0x33c32a,_0x2143db){_0x33c32a=_0x33c32a-0x0;var _0x221571=_0x4bde[_0x33c32a];return _0x221571;};'use strict';var _=require(_0xe4bd('0x0'));var util=require(_0xe4bd('0x1'));var moment=require(_0xe4bd('0x2'));var BPromise=require('bluebird');var rs=require(_0xe4bd('0x3'));var fs=require('fs');var Redis=require(_0xe4bd('0x4'));var db=require(_0xe4bd('0x5'))['db'];var utils=require(_0xe4bd('0x6'));var logger=require('../../config/logger')(_0xe4bd('0x7'));var config=require(_0xe4bd('0x8'));var jayson=require(_0xe4bd('0x9'));var client=jayson[_0xe4bd('0xa')][_0xe4bd('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4008eb,_0x4c933b,_0x2cf33d){return new BPromise(function(_0xbd04ce,_0x262295){return client[_0xe4bd('0xc')](_0x4008eb,_0x2cf33d)[_0xe4bd('0xd')](function(_0x3ef7e7){logger['info']('ChatQueueReport,\x20%s,\x20%s',_0x4c933b,'request\x20sent');logger[_0xe4bd('0xe')](_0xe4bd('0xf'),_0x4c933b,_0xe4bd('0x10'),JSON['stringify'](_0x3ef7e7));if(_0x3ef7e7[_0xe4bd('0x11')]){if(_0x3ef7e7[_0xe4bd('0x11')][_0xe4bd('0x12')]===0x1f4){logger[_0xe4bd('0x11')]('ChatQueueReport,\x20%s,\x20%s',_0x4c933b,_0x3ef7e7[_0xe4bd('0x11')]['message']);return _0x262295(_0x3ef7e7[_0xe4bd('0x11')]['message']);}logger[_0xe4bd('0x11')](_0xe4bd('0x13'),_0x4c933b,_0x3ef7e7[_0xe4bd('0x11')][_0xe4bd('0x14')]);return _0xbd04ce(_0x3ef7e7[_0xe4bd('0x11')][_0xe4bd('0x14')]);}else{logger[_0xe4bd('0x15')](_0xe4bd('0x13'),_0x4c933b,_0xe4bd('0x10'));_0xbd04ce(_0x3ef7e7[_0xe4bd('0x16')][_0xe4bd('0x14')]);}})[_0xe4bd('0x17')](function(_0x470cd1){logger['error'](_0xe4bd('0x13'),_0x4c933b,_0x470cd1);_0x262295(_0x470cd1);});});}exports[_0xe4bd('0x18')]=function(_0x5982f4){var _0x1731a1=this;return new Promise(function(_0x3dccd4,_0x544b3c){return db[_0xe4bd('0x19')]['create'](_0x5982f4['body'],{'raw':_0x5982f4[_0xe4bd('0x1a')]?_0x5982f4[_0xe4bd('0x1a')][_0xe4bd('0x1b')]===undefined?!![]:![]:!![]})[_0xe4bd('0xd')](function(_0x10a234){logger[_0xe4bd('0x15')](_0xe4bd('0x18'),_0x5982f4);logger['debug'](_0xe4bd('0x18'),_0x5982f4,JSON[_0xe4bd('0x1c')](_0x10a234));_0x3dccd4(_0x10a234);})['catch'](function(_0x2a5f40){logger[_0xe4bd('0x11')](_0xe4bd('0x18'),_0x2a5f40[_0xe4bd('0x14')],_0x5982f4);_0x544b3c(_0x1731a1[_0xe4bd('0x11')](0x1f4,_0x2a5f40[_0xe4bd('0x14')]));});});};exports[_0xe4bd('0x1d')]=function(_0x1e2abf){var _0x35d0ef=this;return new Promise(function(_0x4edd31,_0x1ab72b){return db[_0xe4bd('0x19')]['update'](_0x1e2abf[_0xe4bd('0x1e')],{'raw':_0x1e2abf[_0xe4bd('0x1a')]?_0x1e2abf[_0xe4bd('0x1a')][_0xe4bd('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1e2abf[_0xe4bd('0x1a')]?_0x1e2abf[_0xe4bd('0x1a')][_0xe4bd('0x1f')]||null:null,'attributes':_0x1e2abf[_0xe4bd('0x1a')]?_0x1e2abf['options'][_0xe4bd('0x20')]||null:null,'limit':_0x1e2abf[_0xe4bd('0x1a')]?_0x1e2abf[_0xe4bd('0x1a')][_0xe4bd('0x21')]||null:null})[_0xe4bd('0xd')](function(_0x17d143){logger[_0xe4bd('0x15')](_0xe4bd('0x1d'),_0x1e2abf);logger['debug'](_0xe4bd('0x1d'),_0x1e2abf,JSON[_0xe4bd('0x1c')](_0x17d143));_0x4edd31(_0x17d143);})[_0xe4bd('0x17')](function(_0xaad372){logger[_0xe4bd('0x11')](_0xe4bd('0x1d'),_0xaad372[_0xe4bd('0x14')],_0x1e2abf);_0x1ab72b(_0x35d0ef[_0xe4bd('0x11')](0x1f4,_0xaad372[_0xe4bd('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js index c036320..f0f9188 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 _0xb78f=['post','create','delete','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./chatQueueReport.controller','get','isAuthenticated','index','/describe','/:id','show'];(function(_0x253946,_0x1c8d56){var _0x198cd6=function(_0x502fa3){while(--_0x502fa3){_0x253946['push'](_0x253946['shift']());}};_0x198cd6(++_0x1c8d56);}(_0xb78f,0x1e0));var _0xfb78=function(_0x15eddc,_0xbbdbb5){_0x15eddc=_0x15eddc-0x0;var _0x50ae3c=_0xb78f[_0x15eddc];return _0x50ae3c;};'use strict';var multer=require(_0xfb78('0x0'));var util=require('util');var path=require(_0xfb78('0x1'));var timeout=require(_0xfb78('0x2'));var express=require(_0xfb78('0x3'));var router=express['Router']();var fs_extra=require(_0xfb78('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xfb78('0x5'));var config=require(_0xfb78('0x6'));var controller=require(_0xfb78('0x7'));router[_0xfb78('0x8')]('/',auth[_0xfb78('0x9')](),controller[_0xfb78('0xa')]);router[_0xfb78('0x8')](_0xfb78('0xb'),auth[_0xfb78('0x9')](),controller['describe']);router['get'](_0xfb78('0xc'),auth[_0xfb78('0x9')](),controller[_0xfb78('0xd')]);router[_0xfb78('0xe')]('/',auth[_0xfb78('0x9')](),controller[_0xfb78('0xf')]);router['put']('/:id',auth['isAuthenticated'](),controller['update']);router[_0xfb78('0x10')](_0xfb78('0xc'),auth[_0xfb78('0x9')](),controller[_0xfb78('0x11')]);module[_0xfb78('0x12')]=router; \ No newline at end of file +var _0x2411=['show','post','put','delete','destroy','multer','util','connect-timeout','express','Router','fs-extra','../../config/environment','./chatQueueReport.controller','get','isAuthenticated','index','/describe','describe','/:id'];(function(_0x17b6e3,_0x4522ed){var _0x3906f3=function(_0x430f87){while(--_0x430f87){_0x17b6e3['push'](_0x17b6e3['shift']());}};_0x3906f3(++_0x4522ed);}(_0x2411,0x1a7));var _0x1241=function(_0x8b8564,_0x162976){_0x8b8564=_0x8b8564-0x0;var _0x360c61=_0x2411[_0x8b8564];return _0x360c61;};'use strict';var multer=require(_0x1241('0x0'));var util=require(_0x1241('0x1'));var path=require('path');var timeout=require(_0x1241('0x2'));var express=require(_0x1241('0x3'));var router=express[_0x1241('0x4')]();var fs_extra=require(_0x1241('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x1241('0x6'));var controller=require(_0x1241('0x7'));router[_0x1241('0x8')]('/',auth[_0x1241('0x9')](),controller[_0x1241('0xa')]);router[_0x1241('0x8')](_0x1241('0xb'),auth[_0x1241('0x9')](),controller[_0x1241('0xc')]);router[_0x1241('0x8')](_0x1241('0xd'),auth[_0x1241('0x9')](),controller[_0x1241('0xe')]);router[_0x1241('0xf')]('/',auth[_0x1241('0x9')](),controller['create']);router[_0x1241('0x10')](_0x1241('0xd'),auth[_0x1241('0x9')](),controller['update']);router[_0x1241('0x11')](_0x1241('0xd'),auth[_0x1241('0x9')](),controller[_0x1241('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.attributes.js b/server/api/chatTransferReport/chatTransferReport.attributes.js index e4b46cb..5523c40 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 _0x54ef=['agent','queue','DATE','NOW','moment','sequelize','exports','ENUM','account'];(function(_0x581249,_0x483f03){var _0x284bae=function(_0x2faadd){while(--_0x2faadd){_0x581249['push'](_0x581249['shift']());}};_0x284bae(++_0x483f03);}(_0x54ef,0x112));var _0xf54e=function(_0x1b4d4a,_0x36dd52){_0x1b4d4a=_0x1b4d4a-0x0;var _0x1fe3c6=_0x54ef[_0x1b4d4a];return _0x1fe3c6;};'use strict';var moment=require(_0xf54e('0x0'));var Sequelize=require(_0xf54e('0x1'));module[_0xf54e('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xf54e('0x3')](_0xf54e('0x4'),_0xf54e('0x5'),_0xf54e('0x6')),'allowNull':![],'defaultValue':_0xf54e('0x6')},'transferredAt':{'type':Sequelize[_0xf54e('0x7')],'allowNull':![],'defaultValue':Sequelize[_0xf54e('0x8')]}}; \ No newline at end of file +var _0xf4eb=['NOW','moment','account','queue','DATE'];(function(_0x4231e6,_0x49977e){var _0x2f25a0=function(_0x3f6b88){while(--_0x3f6b88){_0x4231e6['push'](_0x4231e6['shift']());}};_0x2f25a0(++_0x49977e);}(_0xf4eb,0xec));var _0xbf4e=function(_0x1a82f8,_0x51bb85){_0x1a82f8=_0x1a82f8-0x0;var _0xf536bb=_0xf4eb[_0x1a82f8];return _0xf536bb;};'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/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js index 4822182..8a7ef4d 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 _0x35d5=['key','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','sort','filter','where','merge','options','include','findAll','rows','catch','params','ChatTransferReport','length','includeAll','find','create','body','describe','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','offset','limit','count','Content-Range','json','apply','reject','update','destroy','then','name','send','index','map','rawAttributes','fieldName','type'];(function(_0x39e9f4,_0x7da7be){var _0x16b495=function(_0x4e126d){while(--_0x4e126d){_0x39e9f4['push'](_0x39e9f4['shift']());}};_0x16b495(++_0x7da7be);}(_0x35d5,0x1b3));var _0x535d=function(_0x1798ef,_0x57527c){_0x1798ef=_0x1798ef-0x0;var _0x5b98ec=_0x35d5[_0x1798ef];return _0x5b98ec;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x535d('0x0'));var zipdir=require(_0x535d('0x1'));var jsonpatch=require(_0x535d('0x2'));var rp=require('request-promise');var moment=require(_0x535d('0x3'));var BPromise=require(_0x535d('0x4'));var Mustache=require(_0x535d('0x5'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x535d('0x6'));var ejs=require(_0x535d('0x7'));var fs=require('fs');var fs_extra=require(_0x535d('0x8'));var _=require(_0x535d('0x9'));var squel=require(_0x535d('0xa'));var crypto=require('crypto');var jsforce=require(_0x535d('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x535d('0x6'));var querystring=require(_0x535d('0xc'));var Papa=require(_0x535d('0xd'));var Redis=require(_0x535d('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x535d('0xf'));var as=require(_0x535d('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x535d('0x11'))(_0x535d('0x12'));var utils=require(_0x535d('0x13'));var config=require(_0x535d('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x535d('0x15'))['db'];function respondWithStatusCode(_0xba761f,_0x5e35d2){_0x5e35d2=_0x5e35d2||0xcc;return function(_0x343509){if(_0x343509){return _0xba761f[_0x535d('0x16')](_0x5e35d2);}return _0xba761f['status'](_0x5e35d2)['end']();};}function respondWithResult(_0xcbdacd,_0x4fca01){_0x4fca01=_0x4fca01||0xc8;return function(_0x5880cd){if(_0x5880cd){return _0xcbdacd[_0x535d('0x17')](_0x4fca01)['json'](_0x5880cd);}};}function respondWithFilteredResult(_0x1e8f30,_0x4954c4){return function(_0x42a484){if(_0x42a484){var _0x1d904a=typeof _0x4954c4[_0x535d('0x18')]==='undefined'&&typeof _0x4954c4[_0x535d('0x19')]==='undefined';var _0x1612d9=_0x42a484[_0x535d('0x1a')];var _0x2126fb=_0x1d904a?0x0:_0x4954c4[_0x535d('0x18')];var _0x46522a=_0x1d904a?_0x42a484[_0x535d('0x1a')]:_0x4954c4['offset']+_0x4954c4['limit'];var _0x55812d;if(_0x46522a>=_0x1612d9){_0x46522a=_0x1612d9;_0x55812d=0xc8;}else{_0x55812d=0xce;}_0x1e8f30['status'](_0x55812d);return _0x1e8f30['set'](_0x535d('0x1b'),_0x2126fb+'-'+_0x46522a+'/'+_0x1612d9)[_0x535d('0x1c')](_0x42a484);}return null;};}function patchUpdates(_0x40a01e){return function(_0x24acbb){try{jsonpatch[_0x535d('0x1d')](_0x24acbb,_0x40a01e,!![]);}catch(_0x4d3a02){return BPromise[_0x535d('0x1e')](_0x4d3a02);}return _0x24acbb['save']();};}function saveUpdates(_0x56344c,_0x277b74){return function(_0x2036d7){if(_0x2036d7){return _0x2036d7[_0x535d('0x1f')](_0x56344c)['then'](function(_0x46d36b){return _0x46d36b;});}return null;};}function removeEntity(_0x25463f,_0x2ee5b9){return function(_0x30e40b){if(_0x30e40b){return _0x30e40b[_0x535d('0x20')]()[_0x535d('0x21')](function(){_0x25463f[_0x535d('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5cb3e1,_0x87e2d3){return function(_0x12f59b){if(!_0x12f59b){_0x5cb3e1[_0x535d('0x16')](0x194);}return _0x12f59b;};}function handleError(_0x209868,_0x52a539){_0x52a539=_0x52a539||0x1f4;return function(_0x2bd432){logger['error'](_0x2bd432['stack']);if(_0x2bd432[_0x535d('0x22')]){delete _0x2bd432[_0x535d('0x22')];}_0x209868['status'](_0x52a539)[_0x535d('0x23')](_0x2bd432);};}exports[_0x535d('0x24')]=function(_0x3adcae,_0x10ea48){var _0x154e1d={},_0x56a867={},_0x112fd8={'count':0x0,'rows':[]};var _0x5037a3=_[_0x535d('0x25')](db['ChatTransferReport'][_0x535d('0x26')],function(_0x12bef5){return{'name':_0x12bef5[_0x535d('0x27')],'type':_0x12bef5[_0x535d('0x28')][_0x535d('0x29')]};});_0x56a867['model']=_[_0x535d('0x25')](_0x5037a3,_0x535d('0x22'));_0x56a867[_0x535d('0x2a')]=_[_0x535d('0x2b')](_0x3adcae[_0x535d('0x2a')]);_0x56a867[_0x535d('0x2c')]=_[_0x535d('0x2d')](_0x56a867[_0x535d('0x2e')],_0x56a867[_0x535d('0x2a')]);_0x154e1d[_0x535d('0x2f')]=_[_0x535d('0x2d')](_0x56a867[_0x535d('0x2e')],qs[_0x535d('0x30')](_0x3adcae['query'][_0x535d('0x30')]));_0x154e1d[_0x535d('0x2f')]=_0x154e1d[_0x535d('0x2f')]['length']?_0x154e1d[_0x535d('0x2f')]:_0x56a867[_0x535d('0x2e')];if(!_0x3adcae[_0x535d('0x2a')][_0x535d('0x31')](_0x535d('0x32'))){_0x154e1d[_0x535d('0x19')]=qs[_0x535d('0x19')](_0x3adcae[_0x535d('0x2a')][_0x535d('0x19')]);_0x154e1d[_0x535d('0x18')]=qs[_0x535d('0x18')](_0x3adcae[_0x535d('0x2a')][_0x535d('0x18')]);}_0x154e1d['order']=qs[_0x535d('0x33')](_0x3adcae[_0x535d('0x2a')]['sort']);_0x154e1d['where']=qs[_0x535d('0x2c')](_['pick'](_0x3adcae[_0x535d('0x2a')],_0x56a867['filters']),_0x5037a3);if(_0x3adcae[_0x535d('0x2a')][_0x535d('0x34')]){_0x154e1d[_0x535d('0x35')]=_[_0x535d('0x36')](_0x154e1d[_0x535d('0x35')],{'$or':_[_0x535d('0x25')](_0x5037a3,function(_0x2e66fd){if(_0x2e66fd[_0x535d('0x28')]!=='VIRTUAL'){var _0x41644a={};_0x41644a[_0x2e66fd[_0x535d('0x22')]]={'$like':'%'+_0x3adcae[_0x535d('0x2a')][_0x535d('0x34')]+'%'};return _0x41644a;}})});}_0x154e1d=_[_0x535d('0x36')]({},_0x154e1d,_0x3adcae[_0x535d('0x37')]);var _0xde6902={'where':_0x154e1d['where']};return db['ChatTransferReport'][_0x535d('0x1a')](_0xde6902)[_0x535d('0x21')](function(_0x174a9f){_0x112fd8[_0x535d('0x1a')]=_0x174a9f;if(_0x3adcae[_0x535d('0x2a')]['includeAll']){_0x154e1d[_0x535d('0x38')]=[{'all':!![]}];}return db['ChatTransferReport'][_0x535d('0x39')](_0x154e1d);})[_0x535d('0x21')](function(_0x564a5b){_0x112fd8[_0x535d('0x3a')]=_0x564a5b;return _0x112fd8;})[_0x535d('0x21')](respondWithFilteredResult(_0x10ea48,_0x154e1d))[_0x535d('0x3b')](handleError(_0x10ea48,null));};exports['show']=function(_0x7f619,_0x262b37){var _0x23c7ae={'raw':!![],'where':{'id':_0x7f619[_0x535d('0x3c')]['id']}},_0x56fdd0={};_0x56fdd0[_0x535d('0x2e')]=_['keys'](db[_0x535d('0x3d')][_0x535d('0x26')]);_0x56fdd0[_0x535d('0x2a')]=_['keys'](_0x7f619[_0x535d('0x2a')]);_0x56fdd0[_0x535d('0x2c')]=_[_0x535d('0x2d')](_0x56fdd0[_0x535d('0x2e')],_0x56fdd0[_0x535d('0x2a')]);_0x23c7ae['attributes']=_['intersection'](_0x56fdd0['model'],qs['fields'](_0x7f619[_0x535d('0x2a')][_0x535d('0x30')]));_0x23c7ae[_0x535d('0x2f')]=_0x23c7ae[_0x535d('0x2f')][_0x535d('0x3e')]?_0x23c7ae['attributes']:_0x56fdd0[_0x535d('0x2e')];if(_0x7f619[_0x535d('0x2a')][_0x535d('0x3f')]){_0x23c7ae[_0x535d('0x38')]=[{'all':!![]}];}_0x23c7ae=_[_0x535d('0x36')]({},_0x23c7ae,_0x7f619[_0x535d('0x37')]);return db['ChatTransferReport'][_0x535d('0x40')](_0x23c7ae)['then'](handleEntityNotFound(_0x262b37,null))['then'](respondWithResult(_0x262b37,null))[_0x535d('0x3b')](handleError(_0x262b37,null));};exports[_0x535d('0x41')]=function(_0x4aca77,_0x5cb21c){return db['ChatTransferReport'][_0x535d('0x41')](_0x4aca77[_0x535d('0x42')],{})[_0x535d('0x21')](respondWithResult(_0x5cb21c,0xc9))[_0x535d('0x3b')](handleError(_0x5cb21c,null));};exports[_0x535d('0x1f')]=function(_0xa94f5d,_0x5bfb01){if(_0xa94f5d['body']['id']){delete _0xa94f5d[_0x535d('0x42')]['id'];}return db[_0x535d('0x3d')]['find']({'where':{'id':_0xa94f5d[_0x535d('0x3c')]['id']}})[_0x535d('0x21')](handleEntityNotFound(_0x5bfb01,null))[_0x535d('0x21')](saveUpdates(_0xa94f5d[_0x535d('0x42')],null))[_0x535d('0x21')](respondWithResult(_0x5bfb01,null))[_0x535d('0x3b')](handleError(_0x5bfb01,null));};exports[_0x535d('0x20')]=function(_0x1ad744,_0x742e9d){return db[_0x535d('0x3d')][_0x535d('0x40')]({'where':{'id':_0x1ad744['params']['id']}})[_0x535d('0x21')](handleEntityNotFound(_0x742e9d,null))[_0x535d('0x21')](removeEntity(_0x742e9d,null))[_0x535d('0x3b')](handleError(_0x742e9d,null));};exports[_0x535d('0x43')]=function(_0x4e0943,_0x4b5e0d){return db[_0x535d('0x3d')][_0x535d('0x43')]()['then'](respondWithResult(_0x4b5e0d,null))[_0x535d('0x3b')](handleError(_0x4b5e0d,null));}; \ No newline at end of file +var _0xedc9=['rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','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','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','update','then','stack','name','send','index','map','ChatTransferReport','rawAttributes','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','includeAll','include','rows','catch','show','params','options','find','create','body','destroy','describe'];(function(_0x4c7935,_0x4a53fb){var _0x30651d=function(_0x12f35f){while(--_0x12f35f){_0x4c7935['push'](_0x4c7935['shift']());}};_0x30651d(++_0x4a53fb);}(_0xedc9,0x1c2));var _0x9edc=function(_0x54501d,_0x42e8a6){_0x54501d=_0x54501d-0x0;var _0x2b9b2c=_0xedc9[_0x54501d];return _0x2b9b2c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9edc('0x0'));var zipdir=require(_0x9edc('0x1'));var jsonpatch=require(_0x9edc('0x2'));var rp=require(_0x9edc('0x3'));var moment=require('moment');var BPromise=require(_0x9edc('0x4'));var Mustache=require(_0x9edc('0x5'));var util=require(_0x9edc('0x6'));var path=require(_0x9edc('0x7'));var sox=require(_0x9edc('0x8'));var csv=require('to-csv');var ejs=require(_0x9edc('0x9'));var fs=require('fs');var fs_extra=require(_0x9edc('0xa'));var _=require(_0x9edc('0xb'));var squel=require(_0x9edc('0xc'));var crypto=require(_0x9edc('0xd'));var jsforce=require(_0x9edc('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x9edc('0xf'));var Papa=require(_0x9edc('0x10'));var Redis=require('ioredis');var authService=require(_0x9edc('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x9edc('0x12'));var hardwareService=require(_0x9edc('0x13'));var logger=require(_0x9edc('0x14'))('api');var utils=require(_0x9edc('0x15'));var config=require(_0x9edc('0x16'));var licenseUtil=require(_0x9edc('0x17'));var db=require(_0x9edc('0x18'))['db'];function respondWithStatusCode(_0x330879,_0x21ebd6){_0x21ebd6=_0x21ebd6||0xcc;return function(_0x25c1f4){if(_0x25c1f4){return _0x330879[_0x9edc('0x19')](_0x21ebd6);}return _0x330879[_0x9edc('0x1a')](_0x21ebd6)[_0x9edc('0x1b')]();};}function respondWithResult(_0x1b2d7c,_0x4754ee){_0x4754ee=_0x4754ee||0xc8;return function(_0x273207){if(_0x273207){return _0x1b2d7c[_0x9edc('0x1a')](_0x4754ee)[_0x9edc('0x1c')](_0x273207);}};}function respondWithFilteredResult(_0x46d85b,_0x2edf85){return function(_0xc38ae2){if(_0xc38ae2){var _0x2880e3=typeof _0x2edf85[_0x9edc('0x1d')]===_0x9edc('0x1e')&&typeof _0x2edf85[_0x9edc('0x1f')]===_0x9edc('0x1e');var _0x40be82=_0xc38ae2[_0x9edc('0x20')];var _0x46f9f3=_0x2880e3?0x0:_0x2edf85[_0x9edc('0x1d')];var _0x3825f3=_0x2880e3?_0xc38ae2[_0x9edc('0x20')]:_0x2edf85[_0x9edc('0x1d')]+_0x2edf85[_0x9edc('0x1f')];var _0x296443;if(_0x3825f3>=_0x40be82){_0x3825f3=_0x40be82;_0x296443=0xc8;}else{_0x296443=0xce;}_0x46d85b[_0x9edc('0x1a')](_0x296443);return _0x46d85b['set'](_0x9edc('0x21'),_0x46f9f3+'-'+_0x3825f3+'/'+_0x40be82)[_0x9edc('0x1c')](_0xc38ae2);}return null;};}function patchUpdates(_0x5c9bfc){return function(_0x99f071){try{jsonpatch[_0x9edc('0x22')](_0x99f071,_0x5c9bfc,!![]);}catch(_0x1d8b0c){return BPromise['reject'](_0x1d8b0c);}return _0x99f071['save']();};}function saveUpdates(_0x45552d,_0xfb7751){return function(_0x4cb1ae){if(_0x4cb1ae){return _0x4cb1ae[_0x9edc('0x23')](_0x45552d)['then'](function(_0x286e3c){return _0x286e3c;});}return null;};}function removeEntity(_0x807b40,_0x5ca452){return function(_0x1ca3e1){if(_0x1ca3e1){return _0x1ca3e1['destroy']()[_0x9edc('0x24')](function(){_0x807b40[_0x9edc('0x1a')](0xcc)[_0x9edc('0x1b')]();});}};}function handleEntityNotFound(_0xfa28a2,_0x24b9c5){return function(_0x397d32){if(!_0x397d32){_0xfa28a2['sendStatus'](0x194);}return _0x397d32;};}function handleError(_0x32ed59,_0x1bc9a7){_0x1bc9a7=_0x1bc9a7||0x1f4;return function(_0x559454){logger['error'](_0x559454[_0x9edc('0x25')]);if(_0x559454['name']){delete _0x559454[_0x9edc('0x26')];}_0x32ed59['status'](_0x1bc9a7)[_0x9edc('0x27')](_0x559454);};}exports[_0x9edc('0x28')]=function(_0xc6151,_0x4e9587){var _0x159336={},_0x5661c0={},_0x73c8b5={'count':0x0,'rows':[]};var _0x58e2de=_[_0x9edc('0x29')](db[_0x9edc('0x2a')][_0x9edc('0x2b')],function(_0x42cf4d){return{'name':_0x42cf4d['fieldName'],'type':_0x42cf4d[_0x9edc('0x2c')][_0x9edc('0x2d')]};});_0x5661c0[_0x9edc('0x2e')]=_[_0x9edc('0x29')](_0x58e2de,_0x9edc('0x26'));_0x5661c0[_0x9edc('0x2f')]=_[_0x9edc('0x30')](_0xc6151[_0x9edc('0x2f')]);_0x5661c0[_0x9edc('0x31')]=_['intersection'](_0x5661c0[_0x9edc('0x2e')],_0x5661c0[_0x9edc('0x2f')]);_0x159336[_0x9edc('0x32')]=_[_0x9edc('0x33')](_0x5661c0[_0x9edc('0x2e')],qs['fields'](_0xc6151['query'][_0x9edc('0x34')]));_0x159336[_0x9edc('0x32')]=_0x159336[_0x9edc('0x32')][_0x9edc('0x35')]?_0x159336[_0x9edc('0x32')]:_0x5661c0[_0x9edc('0x2e')];if(!_0xc6151[_0x9edc('0x2f')][_0x9edc('0x36')](_0x9edc('0x37'))){_0x159336['limit']=qs['limit'](_0xc6151[_0x9edc('0x2f')]['limit']);_0x159336['offset']=qs['offset'](_0xc6151[_0x9edc('0x2f')]['offset']);}_0x159336[_0x9edc('0x38')]=qs[_0x9edc('0x39')](_0xc6151[_0x9edc('0x2f')]['sort']);_0x159336[_0x9edc('0x3a')]=qs[_0x9edc('0x31')](_[_0x9edc('0x3b')](_0xc6151['query'],_0x5661c0[_0x9edc('0x31')]),_0x58e2de);if(_0xc6151[_0x9edc('0x2f')][_0x9edc('0x3c')]){_0x159336[_0x9edc('0x3a')]=_['merge'](_0x159336[_0x9edc('0x3a')],{'$or':_[_0x9edc('0x29')](_0x58e2de,function(_0x1ada61){if(_0x1ada61['type']!==_0x9edc('0x3d')){var _0x59b861={};_0x59b861[_0x1ada61['name']]={'$like':'%'+_0xc6151[_0x9edc('0x2f')][_0x9edc('0x3c')]+'%'};return _0x59b861;}})});}_0x159336=_[_0x9edc('0x3e')]({},_0x159336,_0xc6151['options']);var _0x2e2204={'where':_0x159336[_0x9edc('0x3a')]};return db[_0x9edc('0x2a')]['count'](_0x2e2204)[_0x9edc('0x24')](function(_0x508fad){_0x73c8b5['count']=_0x508fad;if(_0xc6151['query'][_0x9edc('0x3f')]){_0x159336[_0x9edc('0x40')]=[{'all':!![]}];}return db[_0x9edc('0x2a')]['findAll'](_0x159336);})[_0x9edc('0x24')](function(_0x491e9c){_0x73c8b5[_0x9edc('0x41')]=_0x491e9c;return _0x73c8b5;})[_0x9edc('0x24')](respondWithFilteredResult(_0x4e9587,_0x159336))[_0x9edc('0x42')](handleError(_0x4e9587,null));};exports[_0x9edc('0x43')]=function(_0x3f2c6d,_0x896d25){var _0x292ede={'raw':!![],'where':{'id':_0x3f2c6d[_0x9edc('0x44')]['id']}},_0x5b3084={};_0x5b3084[_0x9edc('0x2e')]=_['keys'](db['ChatTransferReport'][_0x9edc('0x2b')]);_0x5b3084[_0x9edc('0x2f')]=_[_0x9edc('0x30')](_0x3f2c6d[_0x9edc('0x2f')]);_0x5b3084['filters']=_['intersection'](_0x5b3084[_0x9edc('0x2e')],_0x5b3084['query']);_0x292ede[_0x9edc('0x32')]=_[_0x9edc('0x33')](_0x5b3084[_0x9edc('0x2e')],qs[_0x9edc('0x34')](_0x3f2c6d[_0x9edc('0x2f')][_0x9edc('0x34')]));_0x292ede['attributes']=_0x292ede[_0x9edc('0x32')][_0x9edc('0x35')]?_0x292ede[_0x9edc('0x32')]:_0x5b3084[_0x9edc('0x2e')];if(_0x3f2c6d[_0x9edc('0x2f')][_0x9edc('0x3f')]){_0x292ede[_0x9edc('0x40')]=[{'all':!![]}];}_0x292ede=_[_0x9edc('0x3e')]({},_0x292ede,_0x3f2c6d[_0x9edc('0x45')]);return db['ChatTransferReport'][_0x9edc('0x46')](_0x292ede)[_0x9edc('0x24')](handleEntityNotFound(_0x896d25,null))[_0x9edc('0x24')](respondWithResult(_0x896d25,null))['catch'](handleError(_0x896d25,null));};exports[_0x9edc('0x47')]=function(_0x5daf72,_0x236701){return db['ChatTransferReport'][_0x9edc('0x47')](_0x5daf72[_0x9edc('0x48')],{})[_0x9edc('0x24')](respondWithResult(_0x236701,0xc9))[_0x9edc('0x42')](handleError(_0x236701,null));};exports[_0x9edc('0x23')]=function(_0xaf370b,_0x3cc99c){if(_0xaf370b[_0x9edc('0x48')]['id']){delete _0xaf370b['body']['id'];}return db['ChatTransferReport'][_0x9edc('0x46')]({'where':{'id':_0xaf370b[_0x9edc('0x44')]['id']}})[_0x9edc('0x24')](handleEntityNotFound(_0x3cc99c,null))[_0x9edc('0x24')](saveUpdates(_0xaf370b['body'],null))[_0x9edc('0x24')](respondWithResult(_0x3cc99c,null))[_0x9edc('0x42')](handleError(_0x3cc99c,null));};exports[_0x9edc('0x49')]=function(_0x1c3439,_0x40c92a){return db[_0x9edc('0x2a')][_0x9edc('0x46')]({'where':{'id':_0x1c3439[_0x9edc('0x44')]['id']}})[_0x9edc('0x24')](handleEntityNotFound(_0x40c92a,null))[_0x9edc('0x24')](removeEntity(_0x40c92a,null))[_0x9edc('0x42')](handleError(_0x40c92a,null));};exports[_0x9edc('0x4a')]=function(_0x10f8f0,_0x530fca){return db[_0x9edc('0x2a')][_0x9edc('0x4a')]()[_0x9edc('0x24')](respondWithResult(_0x530fca,null))['catch'](handleError(_0x530fca,null));}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js index 9406c3d..318e141 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 _0x0509=['util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./chatTransferReport.attributes','exports','define','ChatTransferReport','report_chat_transfer','uniqueid'];(function(_0x324e9a,_0x443ff1){var _0xa6a0bf=function(_0x25b7f9){while(--_0x25b7f9){_0x324e9a['push'](_0x324e9a['shift']());}};_0xa6a0bf(++_0x443ff1);}(_0x0509,0x70));var _0x9050=function(_0x4671a5,_0x1db5f4){_0x4671a5=_0x4671a5-0x0;var _0x12f1ac=_0x0509[_0x4671a5];return _0x12f1ac;};'use strict';var _=require('lodash');var util=require(_0x9050('0x0'));var logger=require(_0x9050('0x1'))(_0x9050('0x2'));var moment=require(_0x9050('0x3'));var BPromise=require(_0x9050('0x4'));var rp=require(_0x9050('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9050('0x6'));var config=require(_0x9050('0x7'));var attributes=require(_0x9050('0x8'));module[_0x9050('0x9')]=function(_0x408458,_0x21902b){return _0x408458[_0x9050('0xa')](_0x9050('0xb'),attributes,{'tableName':_0x9050('0xc'),'paranoid':![],'indexes':[{'name':_0x9050('0xd'),'fields':[_0x9050('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x767c=['api','moment','bluebird','request-promise','rimraf','../../config/environment','./chatTransferReport.attributes','exports','define','report_chat_transfer','uniqueid','util','../../config/logger'];(function(_0x121d92,_0x437735){var _0x5ed768=function(_0x1b493e){while(--_0x1b493e){_0x121d92['push'](_0x121d92['shift']());}};_0x5ed768(++_0x437735);}(_0x767c,0x191));var _0xc767=function(_0x17ad88,_0x5e66e1){_0x17ad88=_0x17ad88-0x0;var _0x3778cd=_0x767c[_0x17ad88];return _0x3778cd;};'use strict';var _=require('lodash');var util=require(_0xc767('0x0'));var logger=require(_0xc767('0x1'))(_0xc767('0x2'));var moment=require(_0xc767('0x3'));var BPromise=require(_0xc767('0x4'));var rp=require(_0xc767('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc767('0x6'));var config=require(_0xc767('0x7'));var attributes=require(_0xc767('0x8'));module[_0xc767('0x9')]=function(_0x2ccdc0,_0x337d61){return _0x2ccdc0[_0xc767('0xa')]('ChatTransferReport',attributes,{'tableName':_0xc767('0xb'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xc767('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.rpc.js b/server/api/chatTransferReport/chatTransferReport.rpc.js index c160f2a..b29abcf 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 _0xc500=['request\x20sent','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','ChatTransferReport,\x20%s,\x20%s'];(function(_0x369151,_0x179f72){var _0x4292d5=function(_0x330422){while(--_0x330422){_0x369151['push'](_0x369151['shift']());}};_0x4292d5(++_0x179f72);}(_0xc500,0xf9));var _0x0c50=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc500[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x0c50('0x0'));var moment=require(_0x0c50('0x1'));var BPromise=require(_0x0c50('0x2'));var rs=require(_0x0c50('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0c50('0x4'))['db'];var utils=require(_0x0c50('0x5'));var logger=require(_0x0c50('0x6'))('rpc');var config=require(_0x0c50('0x7'));var jayson=require(_0x0c50('0x8'));var client=jayson[_0x0c50('0x9')][_0x0c50('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x284aeb,_0x5c6d0b,_0x4fe3c7){return new BPromise(function(_0x429c3b,_0x22a132){return client[_0x0c50('0xb')](_0x284aeb,_0x4fe3c7)[_0x0c50('0xc')](function(_0x4d8086){logger[_0x0c50('0xd')](_0x0c50('0xe'),_0x5c6d0b,_0x0c50('0xf'));logger['debug'](_0x0c50('0x10'),_0x5c6d0b,_0x0c50('0xf'),JSON[_0x0c50('0x11')](_0x4d8086));if(_0x4d8086[_0x0c50('0x12')]){if(_0x4d8086['error']['code']===0x1f4){logger[_0x0c50('0x12')](_0x0c50('0xe'),_0x5c6d0b,_0x4d8086[_0x0c50('0x12')][_0x0c50('0x13')]);return _0x22a132(_0x4d8086[_0x0c50('0x12')][_0x0c50('0x13')]);}logger[_0x0c50('0x12')]('ChatTransferReport,\x20%s,\x20%s',_0x5c6d0b,_0x4d8086[_0x0c50('0x12')][_0x0c50('0x13')]);return _0x429c3b(_0x4d8086[_0x0c50('0x12')][_0x0c50('0x13')]);}else{logger[_0x0c50('0xd')](_0x0c50('0xe'),_0x5c6d0b,_0x0c50('0xf'));_0x429c3b(_0x4d8086[_0x0c50('0x14')][_0x0c50('0x13')]);}})[_0x0c50('0x15')](function(_0xb0cf77){logger[_0x0c50('0x12')](_0x0c50('0xe'),_0x5c6d0b,_0xb0cf77);_0x22a132(_0xb0cf77);});});} \ No newline at end of file +var _0x4336=['http','request','then','info','ChatTransferReport,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise'];(function(_0x5c37cf,_0x4272af){var _0x12c384=function(_0x1bdfbe){while(--_0x1bdfbe){_0x5c37cf['push'](_0x5c37cf['shift']());}};_0x12c384(++_0x4272af);}(_0x4336,0x19b));var _0x6433=function(_0x317f77,_0x53b44b){_0x317f77=_0x317f77-0x0;var _0x1f41df=_0x4336[_0x317f77];return _0x1f41df;};'use strict';var _=require('lodash');var util=require(_0x6433('0x0'));var moment=require(_0x6433('0x1'));var BPromise=require(_0x6433('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6433('0x3'));var db=require(_0x6433('0x4'))['db'];var utils=require(_0x6433('0x5'));var logger=require(_0x6433('0x6'))(_0x6433('0x7'));var config=require('../../config/environment');var jayson=require(_0x6433('0x8'));var client=jayson['client'][_0x6433('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x39fc5a,_0x22093b,_0x47650){return new BPromise(function(_0x2c169f,_0x2f2c3d){return client[_0x6433('0xa')](_0x39fc5a,_0x47650)[_0x6433('0xb')](function(_0x5e60b6){logger[_0x6433('0xc')](_0x6433('0xd'),_0x22093b,'request\x20sent');logger['debug']('ChatTransferReport,\x20%s,\x20%s,\x20%s',_0x22093b,_0x6433('0xe'),JSON[_0x6433('0xf')](_0x5e60b6));if(_0x5e60b6['error']){if(_0x5e60b6[_0x6433('0x10')][_0x6433('0x11')]===0x1f4){logger[_0x6433('0x10')](_0x6433('0xd'),_0x22093b,_0x5e60b6['error'][_0x6433('0x12')]);return _0x2f2c3d(_0x5e60b6[_0x6433('0x10')][_0x6433('0x12')]);}logger[_0x6433('0x10')](_0x6433('0xd'),_0x22093b,_0x5e60b6['error']['message']);return _0x2c169f(_0x5e60b6['error'][_0x6433('0x12')]);}else{logger[_0x6433('0xc')](_0x6433('0xd'),_0x22093b,_0x6433('0xe'));_0x2c169f(_0x5e60b6[_0x6433('0x13')]['message']);}})['catch'](function(_0x2ec2d5){logger[_0x6433('0x10')](_0x6433('0xd'),_0x22093b,_0x2ec2d5);_0x2f2c3d(_0x2ec2d5);});});} \ No newline at end of file diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js index b1dfc10..8bf5e64 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 _0x6b7d=['../../components/interaction/service','./chatTransferReport.controller','get','isAuthenticated','index','describe','/:id','post','create','put','update','delete','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x33439d,_0x39574a){var _0x3541b2=function(_0x396624){while(--_0x396624){_0x33439d['push'](_0x33439d['shift']());}};_0x3541b2(++_0x39574a);}(_0x6b7d,0x139));var _0xd6b7=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x6b7d[_0x5ddb1c];return _0x354adc;};'use strict';var multer=require(_0xd6b7('0x0'));var util=require(_0xd6b7('0x1'));var path=require(_0xd6b7('0x2'));var timeout=require('connect-timeout');var express=require(_0xd6b7('0x3'));var router=express[_0xd6b7('0x4')]();var fs_extra=require(_0xd6b7('0x5'));var auth=require(_0xd6b7('0x6'));var interaction=require(_0xd6b7('0x7'));var config=require('../../config/environment');var controller=require(_0xd6b7('0x8'));router[_0xd6b7('0x9')]('/',auth[_0xd6b7('0xa')](),controller[_0xd6b7('0xb')]);router['get']('/describe',auth[_0xd6b7('0xa')](),controller[_0xd6b7('0xc')]);router[_0xd6b7('0x9')](_0xd6b7('0xd'),auth[_0xd6b7('0xa')](),controller['show']);router[_0xd6b7('0xe')]('/',auth['isAuthenticated'](),controller[_0xd6b7('0xf')]);router[_0xd6b7('0x10')](_0xd6b7('0xd'),auth['isAuthenticated'](),controller[_0xd6b7('0x11')]);router[_0xd6b7('0x12')](_0xd6b7('0xd'),auth[_0xd6b7('0xa')](),controller['destroy']);module[_0xd6b7('0x13')]=router; \ No newline at end of file +var _0x2afe=['get','isAuthenticated','index','/describe','show','post','create','put','/:id','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment'];(function(_0x7e7b9c,_0x3237f5){var _0x114d2f=function(_0x16433f){while(--_0x16433f){_0x7e7b9c['push'](_0x7e7b9c['shift']());}};_0x114d2f(++_0x3237f5);}(_0x2afe,0x98));var _0xe2af=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2afe[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require(_0xe2af('0x0'));var path=require(_0xe2af('0x1'));var timeout=require(_0xe2af('0x2'));var express=require(_0xe2af('0x3'));var router=express[_0xe2af('0x4')]();var fs_extra=require(_0xe2af('0x5'));var auth=require(_0xe2af('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xe2af('0x7'));var controller=require('./chatTransferReport.controller');router[_0xe2af('0x8')]('/',auth[_0xe2af('0x9')](),controller[_0xe2af('0xa')]);router[_0xe2af('0x8')](_0xe2af('0xb'),auth['isAuthenticated'](),controller['describe']);router[_0xe2af('0x8')]('/:id',auth[_0xe2af('0x9')](),controller[_0xe2af('0xc')]);router[_0xe2af('0xd')]('/',auth['isAuthenticated'](),controller[_0xe2af('0xe')]);router[_0xe2af('0xf')](_0xe2af('0x10'),auth[_0xe2af('0x9')](),controller['update']);router[_0xe2af('0x11')](_0xe2af('0x10'),auth[_0xe2af('0x9')](),controller[_0xe2af('0x12')]);module[_0xe2af('0x13')]=router; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.attributes.js b/server/api/chatWebsite/chatWebsite.attributes.js index 3afe6e5..0176f48 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 _0x226c=['Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','randomstring','exports','STRING','address','email','Agent','#011F6A','#ffffff','rounded','squared','We\x20are\x20here!','Chat','Contact\x20us','INTEGER','BOOLEAN','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Note','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Send','Skip','ENUM','star','thumb','input','name','getDataValue','onlineForm','parse','stringify','textarea','Leave\x20your\x20comments','offlineForm','setDataValue','generate','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','New\x20offline\x20message\x20from\x20websiteName','Your\x20request\x20has\x20not\x20been\x20processed.','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','website_alias','bottom_right','alternate','#fafafa','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'];(function(_0x28b62e,_0x165526){var _0x3699a6=function(_0x4ac938){while(--_0x4ac938){_0x28b62e['push'](_0x28b62e['shift']());}};_0x3699a6(++_0x165526);}(_0x226c,0x99));var _0xc226=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x226c[_0x1facfa];return _0x9ec701;};'use strict';var Sequelize=require('sequelize');var rs=require(_0xc226('0x0'));module[_0xc226('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'address':{'type':Sequelize[_0xc226('0x2')],'allowNull':![],'unique':_0xc226('0x3')},'description':{'type':Sequelize[_0xc226('0x2')]},'mapKey':{'type':Sequelize[_0xc226('0x2')],'defaultValue':_0xc226('0x4')},'mapKeyOffline':{'type':Sequelize[_0xc226('0x2')],'defaultValue':_0xc226('0x4')},'key':{'type':Sequelize[_0xc226('0x2')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0xc226('0x2')],'defaultValue':_0xc226('0x5')},'customerAlias':{'type':Sequelize[_0xc226('0x2')],'defaultValue':'Me'},'color':{'type':Sequelize[_0xc226('0x2')],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0xc226('0x2')],'allowNull':![],'defaultValue':_0xc226('0x6'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0xc226('0x2')],'allowNull':![],'defaultValue':_0xc226('0x7'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xf},'remote':{'type':Sequelize[_0xc226('0x2')]},'animation':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'header_shape':{'type':Sequelize['ENUM'](_0xc226('0x8'),_0xc226('0x9')),'defaultValue':'rounded'},'header_online':{'type':Sequelize[_0xc226('0x2')],'defaultValue':_0xc226('0xa')},'start_chat_button':{'type':Sequelize[_0xc226('0x2')],'defaultValue':_0xc226('0xb')},'offline_chat_button':{'type':Sequelize[_0xc226('0x2')],'defaultValue':'Send'},'header_offline':{'type':Sequelize[_0xc226('0x2')],'defaultValue':_0xc226('0xc')},'download_transcript':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'timeout':{'type':Sequelize[_0xc226('0xd')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0xc226('0x2')],'defaultValue':'Powered\x20by\x20xCALLY'},'defaultWhiteLabel':{'type':Sequelize[_0xc226('0xe')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0xc226('0xf')]},'closingQuestion':{'type':Sequelize['STRING'],'defaultValue':_0xc226('0x10')},'formSubmitSuccessMessage':{'type':Sequelize[_0xc226('0x2')],'defaultValue':_0xc226('0x11')},'formSubmitFailureMessage':{'type':Sequelize['STRING'],'defaultValue':'Form\x20submission\x20error'},'noteTitle':{'type':Sequelize['STRING'],'defaultValue':_0xc226('0x12')},'placeholderMessage':{'type':Sequelize['STRING'],'defaultValue':_0xc226('0x13')},'closingMessage':{'type':Sequelize[_0xc226('0x2')],'defaultValue':_0xc226('0x14')},'closingMessageButton':{'type':Sequelize[_0xc226('0x2')],'defaultValue':_0xc226('0x15')},'skipMessageButton':{'type':Sequelize[_0xc226('0x2')],'defaultValue':_0xc226('0x16')},'conditionAgreement':{'type':Sequelize[_0xc226('0xe')],'defaultValue':![]},'enableRating':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableFeedback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0xc226('0xe')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize['STRING'],'defaultValue':'Feedback'},'ratingType':{'type':Sequelize[_0xc226('0x17')](_0xc226('0x18'),_0xc226('0x19')),'defaultValue':'star'},'ratingStarsNumber':{'type':Sequelize[_0xc226('0xd')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0xc226('0xf')],'defaultValue':function(){return JSON['stringify']({'items':[{'type':_0xc226('0x1a'),'variable':null,'config':{'placeholder':_0xc226('0x1b'),'type':'text','required':!![]},'props':{'title':_0xc226('0x1b'),'helpText':''}},{'type':'input','props':{'title':_0xc226('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0xc226('0x4'),'type':_0xc226('0x4')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0xc226('0x1c')](_0xc226('0x1d'))?JSON[_0xc226('0x1e')](this[_0xc226('0x1c')](_0xc226('0x1d'))):{};},'set':function(_0x3ab448){return this['setDataValue']('onlineForm',JSON[_0xc226('0x1f')](_0x3ab448));}},'offlineForm':{'type':Sequelize[_0xc226('0xf')],'defaultValue':function(){return JSON[_0xc226('0x1f')]({'items':[{'type':'input','props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0xc226('0x4'),'type':_0xc226('0x4')},'variable':null},{'type':_0xc226('0x20'),'config':{'placeholder':'Comments'},'props':{'title':'Comments','helpText':_0xc226('0x21')}}],'fromKey':0x0});},'get':function(){return this[_0xc226('0x1c')](_0xc226('0x22'))?JSON[_0xc226('0x1e')](this[_0xc226('0x1c')]('offlineForm')):{};},'set':function(_0x1c0733){return this[_0xc226('0x23')](_0xc226('0x22'),JSON[_0xc226('0x1f')](_0x1c0733));}},'token':{'type':Sequelize[_0xc226('0x2')],'defaultValue':function(){return rs[_0xc226('0x24')]();}},'autoclose':{'type':Sequelize[_0xc226('0xe')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0xc226('0xe')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0xc226('0xe')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0xc226('0x2')]},'forwardOffline':{'type':Sequelize[_0xc226('0xe')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0xc226('0x2')]},'waitingTitle':{'type':Sequelize[_0xc226('0x2')],'defaultValue':'All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.'},'waitingMessage':{'type':Sequelize['STRING'],'defaultValue':_0xc226('0x25')},'offlineMessageSubject':{'type':Sequelize['STRING'],'defaultValue':_0xc226('0x26')},'offlineMessageBody':{'type':Sequelize['STRING'],'defaultValue':'You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:'},'enableUnmanagedNote':{'type':Sequelize[_0xc226('0xe')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0xc226('0x2')],'defaultValue':_0xc226('0x27')},'skipUnmanaged':{'type':Sequelize[_0xc226('0x2')],'defaultValue':_0xc226('0x16')},'sendUnmanaged':{'type':Sequelize[_0xc226('0x2')],'defaultValue':_0xc226('0x15')},'enableCustomerAttachment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0xc226('0xe')],'defaultValue':![]},'agentAvatar':{'type':Sequelize['TEXT']},'showAgentAvatar':{'type':Sequelize[_0xc226('0xe')],'defaultValue':![]},'timezone':{'type':Sequelize[_0xc226('0x2')]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0xc226('0x28');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xc226('0xe')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0xc226('0x2')],'defaultValue':_0xc226('0x29')},'waitForTheAssignedAgent':{'type':Sequelize[_0xc226('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0xc226('0x2')],'defaultValue':_0xc226('0x2a')},'verticalAlignment':{'type':Sequelize[_0xc226('0xd')],'defaultValue':0x1e},'messagesAlignment':{'type':Sequelize[_0xc226('0x2')],'defaultValue':_0xc226('0x2b')},'defaultTitle':{'type':Sequelize[_0xc226('0x2')]},'customerAvatar':{'type':Sequelize[_0xc226('0xf')]},'showCustomerAvatar':{'type':Sequelize[_0xc226('0xe')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0xc226('0xd')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xc226('0x2c'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0xc226('0xe')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xc226('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0xc226('0x2')],'defaultValue':_0xc226('0x2d')},'systemAvatar':{'type':Sequelize['TEXT']},'mandatoryDispositionPauseId':{'type':Sequelize[_0xc226('0xd')],'comment':_0xc226('0x2e')},'mandatoryDisposition':{'type':Sequelize[_0xc226('0xe')],'defaultValue':![],'comment':_0xc226('0x2f'),'set':function(_0x5c1996){if(!_0x5c1996)this[_0xc226('0x23')]('mandatoryDispositionPauseId',null);this['setDataValue'](_0xc226('0x30'),_0x5c1996);}},'vidaooEscalation':{'type':Sequelize[_0xc226('0xe')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize['STRING']},'vidaooTopic':{'type':Sequelize[_0xc226('0x2')],'allowNull':![],'defaultValue':_0xc226('0x31')},'vidaooNote':{'type':Sequelize[_0xc226('0x2')],'defaultValue':function(){return'Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}';}},'vidaooMetadata':{'type':Sequelize[_0xc226('0xf')],'defaultValue':null},'openNewInteraction':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0xc226('0xf')]}}; \ No newline at end of file +var _0x3315=['text','email','getDataValue','onlineForm','parse','setDataValue','textarea','Comments','offlineForm','generate','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','New\x20offline\x20message\x20from\x20websiteName','Your\x20request\x20has\x20not\x20been\x20processed.','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','website_alias','bottom_right','alternate','#fafafa','mandatoryDispositionPauseId','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize','randomstring','exports','STRING','address','Agent','#011F6A','INTEGER','BOOLEAN','rounded','squared','Send','Contact\x20us','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Note','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Skip','Feedback','ENUM','thumb','star','stringify','input','name'];(function(_0x5d4623,_0x70c5fe){var _0x1f7727=function(_0x476d26){while(--_0x476d26){_0x5d4623['push'](_0x5d4623['shift']());}};_0x1f7727(++_0x70c5fe);}(_0x3315,0x15e));var _0x5331=function(_0x2bd70a,_0x11e551){_0x2bd70a=_0x2bd70a-0x0;var _0x6d664f=_0x3315[_0x2bd70a];return _0x6d664f;};'use strict';var Sequelize=require(_0x5331('0x0'));var rs=require(_0x5331('0x1'));module[_0x5331('0x2')]={'name':{'type':Sequelize[_0x5331('0x3')],'allowNull':![]},'address':{'type':Sequelize[_0x5331('0x3')],'allowNull':![],'unique':_0x5331('0x4')},'description':{'type':Sequelize[_0x5331('0x3')]},'mapKey':{'type':Sequelize['STRING'],'defaultValue':'email'},'mapKeyOffline':{'type':Sequelize[_0x5331('0x3')],'defaultValue':'email'},'key':{'type':Sequelize[_0x5331('0x3')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0x5331('0x3')],'defaultValue':_0x5331('0x5')},'customerAlias':{'type':Sequelize[_0x5331('0x3')],'defaultValue':'Me'},'color':{'type':Sequelize[_0x5331('0x3')],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x5331('0x3')],'allowNull':![],'defaultValue':_0x5331('0x6'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x5331('0x7')],'defaultValue':0xf},'remote':{'type':Sequelize['STRING']},'animation':{'type':Sequelize[_0x5331('0x8')],'defaultValue':!![]},'header_shape':{'type':Sequelize['ENUM'](_0x5331('0x9'),_0x5331('0xa')),'defaultValue':_0x5331('0x9')},'header_online':{'type':Sequelize[_0x5331('0x3')],'defaultValue':'We\x20are\x20here!'},'start_chat_button':{'type':Sequelize['STRING'],'defaultValue':'Chat'},'offline_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0x5331('0xb')},'header_offline':{'type':Sequelize['STRING'],'defaultValue':_0x5331('0xc')},'download_transcript':{'type':Sequelize[_0x5331('0x8')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0x5331('0x7')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x5331('0x3')],'defaultValue':'Powered\x20by\x20xCALLY'},'defaultWhiteLabel':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x5331('0xd')]},'closingQuestion':{'type':Sequelize['STRING'],'defaultValue':_0x5331('0xe')},'formSubmitSuccessMessage':{'type':Sequelize['STRING'],'defaultValue':'Form\x20properly\x20submitted'},'formSubmitFailureMessage':{'type':Sequelize[_0x5331('0x3')],'defaultValue':'Form\x20submission\x20error'},'noteTitle':{'type':Sequelize['STRING'],'defaultValue':_0x5331('0xf')},'placeholderMessage':{'type':Sequelize['STRING'],'defaultValue':_0x5331('0x10')},'closingMessage':{'type':Sequelize[_0x5331('0x3')],'defaultValue':_0x5331('0x11')},'closingMessageButton':{'type':Sequelize[_0x5331('0x3')],'defaultValue':_0x5331('0xb')},'skipMessageButton':{'type':Sequelize[_0x5331('0x3')],'defaultValue':_0x5331('0x12')},'conditionAgreement':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x5331('0x8')],'defaultValue':![]},'enableFeedback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0x5331('0x8')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x5331('0x3')],'defaultValue':_0x5331('0x13')},'ratingType':{'type':Sequelize[_0x5331('0x14')]('star',_0x5331('0x15')),'defaultValue':_0x5331('0x16')},'ratingStarsNumber':{'type':Sequelize[_0x5331('0x7')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x5331('0xd')],'defaultValue':function(){return JSON[_0x5331('0x17')]({'items':[{'type':_0x5331('0x18'),'variable':null,'config':{'placeholder':_0x5331('0x19'),'type':_0x5331('0x1a'),'required':!![]},'props':{'title':_0x5331('0x19'),'helpText':''}},{'type':'input','props':{'title':_0x5331('0x1b'),'helpText':''},'config':{'required':!![],'placeholder':_0x5331('0x1b'),'type':_0x5331('0x1b')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x5331('0x1c')](_0x5331('0x1d'))?JSON[_0x5331('0x1e')](this[_0x5331('0x1c')]('onlineForm')):{};},'set':function(_0x565c95){return this[_0x5331('0x1f')](_0x5331('0x1d'),JSON[_0x5331('0x17')](_0x565c95));}},'offlineForm':{'type':Sequelize[_0x5331('0xd')],'defaultValue':function(){return JSON[_0x5331('0x17')]({'items':[{'type':_0x5331('0x18'),'props':{'title':_0x5331('0x1b'),'helpText':''},'config':{'required':!![],'placeholder':_0x5331('0x1b'),'type':_0x5331('0x1b')},'variable':null},{'type':_0x5331('0x20'),'config':{'placeholder':_0x5331('0x21')},'props':{'title':_0x5331('0x21'),'helpText':'Leave\x20your\x20comments'}}],'fromKey':0x0});},'get':function(){return this[_0x5331('0x1c')](_0x5331('0x22'))?JSON[_0x5331('0x1e')](this[_0x5331('0x1c')](_0x5331('0x22'))):{};},'set':function(_0x4a1cf9){return this[_0x5331('0x1f')](_0x5331('0x22'),JSON[_0x5331('0x17')](_0x4a1cf9));}},'token':{'type':Sequelize[_0x5331('0x3')],'defaultValue':function(){return rs[_0x5331('0x23')]();}},'autoclose':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x5331('0x8')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x5331('0x8')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize['STRING']},'forwardOffline':{'type':Sequelize[_0x5331('0x8')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x5331('0x3')]},'waitingTitle':{'type':Sequelize[_0x5331('0x3')],'defaultValue':_0x5331('0x24')},'waitingMessage':{'type':Sequelize[_0x5331('0x3')],'defaultValue':_0x5331('0x25')},'offlineMessageSubject':{'type':Sequelize[_0x5331('0x3')],'defaultValue':_0x5331('0x26')},'offlineMessageBody':{'type':Sequelize[_0x5331('0x3')],'defaultValue':'You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:'},'enableUnmanagedNote':{'type':Sequelize[_0x5331('0x8')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize['STRING'],'defaultValue':_0x5331('0x27')},'skipUnmanaged':{'type':Sequelize[_0x5331('0x3')],'defaultValue':'Skip'},'sendUnmanaged':{'type':Sequelize[_0x5331('0x3')],'defaultValue':_0x5331('0xb')},'enableCustomerAttachment':{'type':Sequelize[_0x5331('0x8')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x5331('0x8')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x5331('0xd')]},'showAgentAvatar':{'type':Sequelize[_0x5331('0x8')],'defaultValue':![]},'timezone':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize[_0x5331('0xd')],'defaultValue':function(){return _0x5331('0x28');}},'notificationSound':{'type':Sequelize[_0x5331('0x8')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x5331('0x8')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x5331('0x8')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize['STRING'],'defaultValue':_0x5331('0x29')},'waitForTheAssignedAgent':{'type':Sequelize[_0x5331('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x5331('0x3')],'defaultValue':_0x5331('0x2a')},'verticalAlignment':{'type':Sequelize[_0x5331('0x7')],'defaultValue':0x1e},'messagesAlignment':{'type':Sequelize[_0x5331('0x3')],'defaultValue':_0x5331('0x2b')},'defaultTitle':{'type':Sequelize['STRING']},'customerAvatar':{'type':Sequelize[_0x5331('0xd')]},'showCustomerAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x5331('0x7')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x5331('0x3')],'allowNull':![],'defaultValue':_0x5331('0x2c'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x5331('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x5331('0x8')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x5331('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x5331('0x3')],'defaultValue':'System'},'systemAvatar':{'type':Sequelize[_0x5331('0xd')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x5331('0x7')],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x5331('0x8')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x1705ad){if(!_0x1705ad)this[_0x5331('0x1f')](_0x5331('0x2d'),null);this[_0x5331('0x1f')]('mandatoryDisposition',_0x1705ad);}},'vidaooEscalation':{'type':Sequelize[_0x5331('0x8')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0x5331('0x3')]},'vidaooTopic':{'type':Sequelize[_0x5331('0x3')],'allowNull':![],'defaultValue':'Generated\x20by\x20XCALLY\x20Motion'},'vidaooNote':{'type':Sequelize[_0x5331('0x3')],'defaultValue':function(){return _0x5331('0x2e');}},'vidaooMetadata':{'type':Sequelize['TEXT'],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0x5331('0x8')],'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 e996f5e..0f9d060 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 _0xdc67=['Start','startRouting','EventManager','offline','files','CmContact','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','server/files/templates/chatOfflineMessage.ejs','utf8','render','toPairs','offlineMessageBody','ChatOfflineMessage','server','attachments','offline-chat','basename','openNewInteraction','Attachment','findOne','Smtp','forwardOffline','service','host','port','secure','authentication','auth','SendMail','sendMail','forwardOfflineAddress','offlineMessageSubject','MailAccountId','subjectOffline','toPairsIn','mapValues','email','Chat','NotifyMailAccount','Could\x20not\x20remove\x20attachment\x20file','addInteraction','getInteractions','Contact','Owner','fullname','internal','Tag','Tags','color','tag','Command','getSnippet','iftime\x20%s,%s','interval','timezone','iftime\x20%s','true','ONLINE','OFFLINE','No\x20timezone','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','inspect','Interval','Intervals','getProactiveActions','virtual','custom','License','chatLicenseExceeded','readFileSync','server/files/chat/iframe.ejs','remote','stringify','x-real-ip','connection','remoteAddress','referer','alignment','textColor','color_button','addApplications','transaction','bulkCreate','findAndCountAll','getApplications','addProactiveActions','chatProactiveAction','omit','ChatProactiveAction','getFields','online','false','offlineForm','onlineForm','items','fromKey','getOfflineMessages','Attachments','addAgents','spread','emit','removeAgents','isArray','userChatWebsite:remove','getAgents','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','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','redis','defaults','localhost','socket.io-emitter','./chatWebsite.socket','register','jayson/promise','client','http','request','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','error','code','message','result','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','get','ChatWebsites','UserProfileResource','stack','name','send','index','Pause','map','ChatWebsite','rawAttributes','fieldName','key','model','filters','intersection','attributes','fields','query','hasOwnProperty','nolimit','sort','where','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','catch','show','params','mandatoryDispositionPause','keys','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','ChatWebsiteId','Disposition','getDispositions','order','pick','rows','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','length','removeAnswers','addLogo','sitepic','file','filename','addAvatar','agentAvatar','addCustomerAvatar','addSystemAvatar','systemAvatar','getLogo','root','server/files/images/logos/default_logo.svg','getLicense','join','server/files/images/logos/','download','getAvatar','server/files/images/avatars/default_avatar.png','isNil','existsSync','server/files/images/avatars/','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','customerAvatar','showCustomerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','notify','user-agent-parser','setUA','headers','no\x20available\x20attributes','createdAt','difference','updatedAt','CompanyId','Sequelize','ValidationError','from\x20is\x20mandatory','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','from','CmList','List','Contacts','DESC','ChatApplication','Applications','applications','list','orderBy','priority','asc','account','ListId','cf-connecting-ip','first','x-forwarded-for','firstName','lastName','x-real-port','browser','version','format','%s\x20%s','device','vendor','%s\x20%s\x20%s','threadId','ChatInteraction','ContactId','interaction','contact','messageId','created','autoclose','push','close','unmanaged','*,*,*,*','ChatMessage','AttachmentId','User','UserId','unshift','agent','waitForTheAssignedAgent','forcedOwnership'];(function(_0x141486,_0x58ed56){var _0x1b5fb9=function(_0x273fc0){while(--_0x273fc0){_0x141486['push'](_0x141486['shift']());}};_0x1b5fb9(++_0x58ed56);}(_0xdc67,0x6c));var _0x7dc6=function(_0x2468b5,_0x506b9e){_0x2468b5=_0x2468b5-0x0;var _0x1056e4=_0xdc67[_0x2468b5];return _0x1056e4;};'use strict';var emlformat=require(_0x7dc6('0x0'));var rimraf=require(_0x7dc6('0x1'));var zipdir=require(_0x7dc6('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7dc6('0x3'));var moment=require(_0x7dc6('0x4'));var BPromise=require(_0x7dc6('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x7dc6('0x6'));var sox=require(_0x7dc6('0x7'));var csv=require('to-csv');var ejs=require(_0x7dc6('0x8'));var fs=require('fs');var fs_extra=require(_0x7dc6('0x9'));var _=require(_0x7dc6('0xa'));var squel=require(_0x7dc6('0xb'));var crypto=require(_0x7dc6('0xc'));var jsforce=require(_0x7dc6('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x7dc6('0xe'));var querystring=require(_0x7dc6('0xf'));var Papa=require(_0x7dc6('0x10'));var Redis=require(_0x7dc6('0x11'));var authService=require(_0x7dc6('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x7dc6('0x13'));var hardwareService=require(_0x7dc6('0x14'));var logger=require(_0x7dc6('0x15'))(_0x7dc6('0x16'));var utils=require(_0x7dc6('0x17'));var config=require(_0x7dc6('0x18'));var licenseUtil=require(_0x7dc6('0x19'));var db=require(_0x7dc6('0x1a'))['db'];config[_0x7dc6('0x1b')]=_[_0x7dc6('0x1c')](config[_0x7dc6('0x1b')],{'host':_0x7dc6('0x1d'),'port':0x18eb});var socket=require(_0x7dc6('0x1e'))(new Redis(config[_0x7dc6('0x1b')]));require(_0x7dc6('0x1f'))[_0x7dc6('0x20')](socket);var jayson=require(_0x7dc6('0x21'));var client=jayson[_0x7dc6('0x22')][_0x7dc6('0x23')]({'port':0x232c});var client9002=jayson['client']['http']({'port':0x232a});var client9003=jayson[_0x7dc6('0x22')][_0x7dc6('0x23')]({'port':0x232b});var client9001=jayson[_0x7dc6('0x22')][_0x7dc6('0x23')]({'port':0x2329});function respondWithRpcPromise(_0x43aaeb,_0x4ea45c,_0x1987fa,_0x5709e2){return new BPromise(function(_0x5a48f8,_0x59faec){var _0x328e14=_0x5709e2||client;return _0x328e14[_0x7dc6('0x24')](_0x43aaeb,_0x1987fa)[_0x7dc6('0x25')](function(_0x59a77c){logger[_0x7dc6('0x26')](_0x7dc6('0x27'),_0x4ea45c,_0x7dc6('0x28'));logger[_0x7dc6('0x29')](_0x7dc6('0x2a'),_0x4ea45c,'request\x20sent',JSON['stringify'](_0x59a77c));if(_0x59a77c[_0x7dc6('0x2b')]){if(_0x59a77c['error'][_0x7dc6('0x2c')]===0x1f4){logger['error'](_0x7dc6('0x27'),_0x4ea45c,_0x59a77c['error'][_0x7dc6('0x2d')]);return _0x59faec(_0x59a77c[_0x7dc6('0x2b')][_0x7dc6('0x2d')]);}logger[_0x7dc6('0x2b')](_0x7dc6('0x27'),_0x4ea45c,_0x59a77c[_0x7dc6('0x2b')][_0x7dc6('0x2d')]);return _0x5a48f8(_0x59a77c[_0x7dc6('0x2b')][_0x7dc6('0x2d')]);}else{logger['info']('ChatWebsite,\x20%s,\x20%s',_0x4ea45c,'request\x20sent');_0x5a48f8(_0x59a77c[_0x7dc6('0x2e')][_0x7dc6('0x2d')]);}})['catch'](function(_0x3edbcb){logger[_0x7dc6('0x2b')](_0x7dc6('0x27'),_0x4ea45c,_0x3edbcb);_0x59faec(_0x3edbcb);});});}function respondWithStatusCode(_0x5c9a2d,_0x6b1fbb){_0x6b1fbb=_0x6b1fbb||0xcc;return function(_0x19083d){if(_0x19083d){return _0x5c9a2d[_0x7dc6('0x2f')](_0x6b1fbb);}return _0x5c9a2d[_0x7dc6('0x30')](_0x6b1fbb)[_0x7dc6('0x31')]();};}function respondWithResult(_0x39b998,_0x24fbe4){_0x24fbe4=_0x24fbe4||0xc8;return function(_0x37bbc0){if(_0x37bbc0){return _0x39b998[_0x7dc6('0x30')](_0x24fbe4)[_0x7dc6('0x32')](_0x37bbc0);}};}function respondWithFilteredResult(_0x17909f,_0x379964){return function(_0x46a4bf){if(_0x46a4bf){var _0x54c7eb=typeof _0x379964[_0x7dc6('0x33')]===_0x7dc6('0x34')&&typeof _0x379964[_0x7dc6('0x35')]==='undefined';var _0x28582d=_0x46a4bf[_0x7dc6('0x36')];var _0x24f033=_0x54c7eb?0x0:_0x379964[_0x7dc6('0x33')];var _0x18d9e8=_0x54c7eb?_0x46a4bf[_0x7dc6('0x36')]:_0x379964[_0x7dc6('0x33')]+_0x379964['limit'];var _0x459ba8;if(_0x18d9e8>=_0x28582d){_0x18d9e8=_0x28582d;_0x459ba8=0xc8;}else{_0x459ba8=0xce;}_0x17909f[_0x7dc6('0x30')](_0x459ba8);return _0x17909f[_0x7dc6('0x37')](_0x7dc6('0x38'),_0x24f033+'-'+_0x18d9e8+'/'+_0x28582d)[_0x7dc6('0x32')](_0x46a4bf);}return null;};}function patchUpdates(_0x5a0a18){return function(_0x18993f){try{jsonpatch[_0x7dc6('0x39')](_0x18993f,_0x5a0a18,!![]);}catch(_0x582fe9){return BPromise[_0x7dc6('0x3a')](_0x582fe9);}return _0x18993f[_0x7dc6('0x3b')]();};}function saveUpdates(_0x320ed6,_0x26e7bc){return function(_0x39686a){if(_0x39686a){return _0x39686a[_0x7dc6('0x3c')](_0x320ed6)[_0x7dc6('0x25')](function(_0x515f2){return _0x515f2;});}return null;};}function removeEntity(_0x29abf1,_0x211f67){return function(_0x1dcb66){if(_0x1dcb66){return _0x1dcb66[_0x7dc6('0x3d')]()[_0x7dc6('0x25')](function(){var _0x38a8b1=_0x1dcb66[_0x7dc6('0x3e')]({'plain':!![]});var _0x5f06d3=_0x7dc6('0x3f');return db[_0x7dc6('0x40')]['destroy']({'where':{'type':_0x5f06d3,'resourceId':_0x38a8b1['id']}})['then'](function(){return _0x1dcb66;});})[_0x7dc6('0x25')](function(){_0x29abf1[_0x7dc6('0x30')](0xcc)[_0x7dc6('0x31')]();});}};}function handleEntityNotFound(_0x4573ad,_0x2f2d11){return function(_0x3bcb95){if(!_0x3bcb95){_0x4573ad['sendStatus'](0x194);}return _0x3bcb95;};}function handleError(_0xdf5762,_0x2c55d6){_0x2c55d6=_0x2c55d6||0x1f4;return function(_0x39723a){logger['error'](_0x39723a[_0x7dc6('0x41')]);if(_0x39723a[_0x7dc6('0x42')]){delete _0x39723a[_0x7dc6('0x42')];}_0xdf5762['status'](_0x2c55d6)[_0x7dc6('0x43')](_0x39723a);};}exports[_0x7dc6('0x44')]=function(_0x2ab6df,_0x5b5dd5){var _0x520596={'include':[{'model':db[_0x7dc6('0x45')],'as':'mandatoryDispositionPause'}]},_0xcfe7af={},_0x2d0032={'count':0x0,'rows':[]};var _0x53ae22=_[_0x7dc6('0x46')](db[_0x7dc6('0x47')][_0x7dc6('0x48')],function(_0x1d48d1){return{'name':_0x1d48d1[_0x7dc6('0x49')],'type':_0x1d48d1['type'][_0x7dc6('0x4a')]};});_0xcfe7af[_0x7dc6('0x4b')]=_[_0x7dc6('0x46')](_0x53ae22,_0x7dc6('0x42'));_0xcfe7af['query']=_['keys'](_0x2ab6df['query']);_0xcfe7af[_0x7dc6('0x4c')]=_[_0x7dc6('0x4d')](_0xcfe7af['model'],_0xcfe7af['query']);_0x520596[_0x7dc6('0x4e')]=_['intersection'](_0xcfe7af[_0x7dc6('0x4b')],qs[_0x7dc6('0x4f')](_0x2ab6df[_0x7dc6('0x50')]['fields']));_0x520596['attributes']=_0x520596[_0x7dc6('0x4e')]['length']?_0x520596[_0x7dc6('0x4e')]:_0xcfe7af[_0x7dc6('0x4b')];if(!_0x2ab6df[_0x7dc6('0x50')][_0x7dc6('0x51')](_0x7dc6('0x52'))){_0x520596[_0x7dc6('0x35')]=qs[_0x7dc6('0x35')](_0x2ab6df['query'][_0x7dc6('0x35')]);_0x520596[_0x7dc6('0x33')]=qs[_0x7dc6('0x33')](_0x2ab6df[_0x7dc6('0x50')]['offset']);}_0x520596['order']=qs[_0x7dc6('0x53')](_0x2ab6df[_0x7dc6('0x50')][_0x7dc6('0x53')]);_0x520596[_0x7dc6('0x54')]=qs['filters'](_['pick'](_0x2ab6df[_0x7dc6('0x50')],_0xcfe7af[_0x7dc6('0x4c')]),_0x53ae22);if(_0x2ab6df[_0x7dc6('0x50')][_0x7dc6('0x55')]){_0x520596[_0x7dc6('0x54')]=_[_0x7dc6('0x56')](_0x520596[_0x7dc6('0x54')],{'$or':_[_0x7dc6('0x46')](_0x53ae22,function(_0x2f9d5d){if(_0x2f9d5d[_0x7dc6('0x57')]!==_0x7dc6('0x58')){var _0x16787a={};_0x16787a[_0x2f9d5d[_0x7dc6('0x42')]]={'$like':'%'+_0x2ab6df['query'][_0x7dc6('0x55')]+'%'};return _0x16787a;}})});}_0x520596=_[_0x7dc6('0x56')]({},_0x520596,_0x2ab6df[_0x7dc6('0x59')]);var _0x2adf58={'where':_0x520596[_0x7dc6('0x54')]};return db['ChatWebsite']['count'](_0x2adf58)[_0x7dc6('0x25')](function(_0x55fff9){_0x2d0032[_0x7dc6('0x36')]=_0x55fff9;if(_0x2ab6df[_0x7dc6('0x50')][_0x7dc6('0x5a')]){_0x520596[_0x7dc6('0x5b')]=[{'all':!![]}];}return db[_0x7dc6('0x47')][_0x7dc6('0x5c')](_0x520596);})[_0x7dc6('0x25')](function(_0x56956e){_0x2d0032['rows']=_0x56956e;return _0x2d0032;})[_0x7dc6('0x25')](respondWithFilteredResult(_0x5b5dd5,_0x520596))[_0x7dc6('0x5d')](handleError(_0x5b5dd5,null));};exports[_0x7dc6('0x5e')]=function(_0xf81cf7,_0x16fee3){var _0x31f9de={'raw':![],'where':{'id':_0xf81cf7[_0x7dc6('0x5f')]['id']},'include':[{'model':db['Pause'],'as':_0x7dc6('0x60')}]},_0x42e19a={};_0x42e19a['model']=_[_0x7dc6('0x61')](db['ChatWebsite'][_0x7dc6('0x48')]);_0x42e19a[_0x7dc6('0x50')]=_[_0x7dc6('0x61')](_0xf81cf7[_0x7dc6('0x50')]);_0x42e19a['filters']=_[_0x7dc6('0x4d')](_0x42e19a[_0x7dc6('0x4b')],_0x42e19a['query']);_0x31f9de[_0x7dc6('0x4e')]=_[_0x7dc6('0x4d')](_0x42e19a['model'],qs[_0x7dc6('0x4f')](_0xf81cf7[_0x7dc6('0x50')][_0x7dc6('0x4f')]));_0x31f9de[_0x7dc6('0x4e')]=_0x31f9de['attributes']['length']?_0x31f9de[_0x7dc6('0x4e')]:_0x42e19a['model'];if(_0xf81cf7[_0x7dc6('0x50')]['includeAll']){_0x31f9de['include']=[{'all':!![]}];}_0x31f9de=_[_0x7dc6('0x56')]({},_0x31f9de,_0xf81cf7[_0x7dc6('0x59')]);return db[_0x7dc6('0x47')][_0x7dc6('0x62')](_0x31f9de)[_0x7dc6('0x25')](handleEntityNotFound(_0x16fee3,null))['then'](respondWithResult(_0x16fee3,null))['catch'](handleError(_0x16fee3,null));};exports['create']=function(_0x3bae4f,_0x101da3){return db[_0x7dc6('0x47')][_0x7dc6('0x63')](_0x3bae4f[_0x7dc6('0x64')],{})[_0x7dc6('0x25')](function(_0x4316a4){var _0x53abfd=_0x3bae4f[_0x7dc6('0x65')][_0x7dc6('0x3e')]({'plain':!![]});if(!_0x53abfd)throw new Error(_0x7dc6('0x66'));if(_0x53abfd['role']===_0x7dc6('0x65')){var _0x37b8db=_0x4316a4[_0x7dc6('0x3e')]({'plain':!![]});var _0x4f6140='ChatWebsites';return db[_0x7dc6('0x67')][_0x7dc6('0x62')]({'where':{'name':_0x4f6140,'userProfileId':_0x53abfd[_0x7dc6('0x68')]},'raw':!![]})[_0x7dc6('0x25')](function(_0x54cf91){if(_0x54cf91&&_0x54cf91[_0x7dc6('0x69')]===0x0){return db[_0x7dc6('0x40')][_0x7dc6('0x63')]({'name':_0x37b8db[_0x7dc6('0x42')],'resourceId':_0x37b8db['id'],'type':_0x54cf91[_0x7dc6('0x42')],'sectionId':_0x54cf91['id']},{})[_0x7dc6('0x25')](function(){return _0x4316a4;});}else{return _0x4316a4;}})[_0x7dc6('0x5d')](function(_0x1ac4c6){logger[_0x7dc6('0x2b')](_0x7dc6('0x6a'),_0x1ac4c6);throw _0x1ac4c6;});}return _0x4316a4;})[_0x7dc6('0x25')](respondWithResult(_0x101da3,0xc9))[_0x7dc6('0x5d')](handleError(_0x101da3,null));};exports[_0x7dc6('0x3c')]=function(_0x465b17,_0x4c69ff){if(_0x465b17['body']['id']){delete _0x465b17[_0x7dc6('0x64')]['id'];}return db['ChatWebsite'][_0x7dc6('0x62')]({'where':{'id':_0x465b17[_0x7dc6('0x5f')]['id']},'include':[{'model':db[_0x7dc6('0x45')],'as':_0x7dc6('0x60')}]})[_0x7dc6('0x25')](handleEntityNotFound(_0x4c69ff,null))['then'](saveUpdates(_0x465b17[_0x7dc6('0x64')],null))[_0x7dc6('0x25')](respondWithResult(_0x4c69ff,null))['catch'](handleError(_0x4c69ff,null));};exports[_0x7dc6('0x3d')]=function(_0x3ca942,_0xa609b9){return db[_0x7dc6('0x47')][_0x7dc6('0x62')]({'where':{'id':_0x3ca942[_0x7dc6('0x5f')]['id']}})[_0x7dc6('0x25')](handleEntityNotFound(_0xa609b9,null))['then'](removeEntity(_0xa609b9,null))[_0x7dc6('0x5d')](handleError(_0xa609b9,null));};exports[_0x7dc6('0x6b')]=function(_0x29dac3,_0x2a190c){return db[_0x7dc6('0x47')][_0x7dc6('0x6b')]()['then'](respondWithResult(_0x2a190c,null))[_0x7dc6('0x5d')](handleError(_0x2a190c,null));};exports[_0x7dc6('0x6c')]=function(_0x10494d,_0xf7f5da,_0xae1243){if(_0x10494d[_0x7dc6('0x64')]['id']){delete _0x10494d[_0x7dc6('0x64')]['id'];}return db[_0x7dc6('0x47')][_0x7dc6('0x62')]({'where':{'id':_0x10494d[_0x7dc6('0x5f')]['id']}})[_0x7dc6('0x25')](handleEntityNotFound(_0xf7f5da,null))[_0x7dc6('0x25')](function(_0x5f4b1c){if(_0x5f4b1c){_0x10494d[_0x7dc6('0x64')][_0x7dc6('0x6d')]=_0x5f4b1c['id'];return db[_0x7dc6('0x6e')][_0x7dc6('0x63')](_0x10494d[_0x7dc6('0x64')]);}})['then'](respondWithResult(_0xf7f5da,null))[_0x7dc6('0x5d')](handleError(_0xf7f5da,null));};exports[_0x7dc6('0x6f')]=function(_0xe4cef4,_0x3014cb,_0x26ffc8){var _0x1f496f={'raw':![],'where':{}};var _0x15fc63={};var _0x225642={'count':0x0,'rows':[]};return db['ChatWebsite']['findOne']({'where':{'id':_0xe4cef4[_0x7dc6('0x5f')]['id']}})['then'](handleEntityNotFound(_0x3014cb,null))[_0x7dc6('0x25')](function(_0x4063ef){if(_0x4063ef){_0x15fc63[_0x7dc6('0x4b')]=_[_0x7dc6('0x61')](db[_0x7dc6('0x6e')]['rawAttributes']);_0x15fc63[_0x7dc6('0x50')]=_[_0x7dc6('0x61')](_0xe4cef4[_0x7dc6('0x50')]);_0x15fc63['filters']=_[_0x7dc6('0x4d')](_0x15fc63['model'],_0x15fc63[_0x7dc6('0x50')]);_0x1f496f[_0x7dc6('0x4e')]=_[_0x7dc6('0x4d')](_0x15fc63['model'],qs['fields'](_0xe4cef4[_0x7dc6('0x50')][_0x7dc6('0x4f')]));_0x1f496f['attributes']=_0x1f496f[_0x7dc6('0x4e')]['length']?_0x1f496f[_0x7dc6('0x4e')]:_0x15fc63[_0x7dc6('0x4b')];if(!_0xe4cef4[_0x7dc6('0x50')][_0x7dc6('0x51')](_0x7dc6('0x52'))){_0x1f496f['limit']=qs[_0x7dc6('0x35')](_0xe4cef4[_0x7dc6('0x50')]['limit']);_0x1f496f[_0x7dc6('0x33')]=qs[_0x7dc6('0x33')](_0xe4cef4[_0x7dc6('0x50')][_0x7dc6('0x33')]);}_0x1f496f[_0x7dc6('0x70')]=qs[_0x7dc6('0x53')](_0xe4cef4[_0x7dc6('0x50')][_0x7dc6('0x53')]);_0x1f496f[_0x7dc6('0x54')]=qs['filters'](_[_0x7dc6('0x71')](_0xe4cef4['query'],_0x15fc63[_0x7dc6('0x4c')]));_0x1f496f['where'][_0x7dc6('0x6d')]=_0x4063ef['id'];if(_0xe4cef4['query'][_0x7dc6('0x55')]){_0x1f496f[_0x7dc6('0x54')]=_[_0x7dc6('0x56')](_0x1f496f[_0x7dc6('0x54')],{'$or':_[_0x7dc6('0x46')](_0x1f496f[_0x7dc6('0x4e')],function(_0x1ce81f){var _0x568f40={};_0x568f40[_0x1ce81f]={'$like':'%'+_0xe4cef4[_0x7dc6('0x50')]['filter']+'%'};return _0x568f40;})});}_0x1f496f=_['merge']({},_0x1f496f,_0xe4cef4[_0x7dc6('0x59')]);return db[_0x7dc6('0x6e')][_0x7dc6('0x36')]({'where':_0x1f496f[_0x7dc6('0x54')]})[_0x7dc6('0x25')](function(_0x11f8a3){_0x225642[_0x7dc6('0x36')]=_0x11f8a3;if(_0xe4cef4['query'][_0x7dc6('0x5a')]){_0x1f496f['include']=[{'all':!![]}];}return db[_0x7dc6('0x6e')][_0x7dc6('0x5c')](_0x1f496f);})[_0x7dc6('0x25')](function(_0x431228){_0x225642[_0x7dc6('0x72')]=_0x431228;return _0x225642;});}})[_0x7dc6('0x25')](respondWithFilteredResult(_0x3014cb,_0x1f496f))['catch'](handleError(_0x3014cb,null));};exports[_0x7dc6('0x73')]=function(_0x35b00b,_0x428901,_0x5d4183){return db[_0x7dc6('0x47')][_0x7dc6('0x62')]({'where':{'id':_0x35b00b[_0x7dc6('0x5f')]['id']}})[_0x7dc6('0x25')](handleEntityNotFound(_0x428901,null))[_0x7dc6('0x25')](function(_0x4cf66a){if(_0x4cf66a){return _0x4cf66a[_0x7dc6('0x73')](_0x35b00b[_0x7dc6('0x50')][_0x7dc6('0x74')]);}})['then'](respondWithStatusCode(_0x428901,null))[_0x7dc6('0x5d')](handleError(_0x428901,null));};exports[_0x7dc6('0x75')]=function(_0x3e1547,_0x4d748a,_0x2d9924){if(_0x3e1547[_0x7dc6('0x64')]['id']){delete _0x3e1547[_0x7dc6('0x64')]['id'];}return db[_0x7dc6('0x47')]['find']({'where':{'id':_0x3e1547[_0x7dc6('0x5f')]['id']}})[_0x7dc6('0x25')](handleEntityNotFound(_0x4d748a,null))[_0x7dc6('0x25')](function(_0xb4e8a8){if(_0xb4e8a8){_0x3e1547['body'][_0x7dc6('0x6d')]=_0xb4e8a8['id'];return db[_0x7dc6('0x76')]['create'](_0x3e1547[_0x7dc6('0x64')]);}})[_0x7dc6('0x25')](respondWithResult(_0x4d748a,null))[_0x7dc6('0x5d')](handleError(_0x4d748a,null));};exports[_0x7dc6('0x77')]=function(_0x416491,_0x5b6381,_0x34dd49){var _0xf9955b={'raw':![],'where':{}};var _0x1ab55c={};var _0x54920d={'count':0x0,'rows':[]};return db['ChatWebsite']['findOne']({'where':{'id':_0x416491['params']['id']}})[_0x7dc6('0x25')](handleEntityNotFound(_0x5b6381,null))[_0x7dc6('0x25')](function(_0x3ebb9a){if(_0x3ebb9a){_0x1ab55c[_0x7dc6('0x4b')]=_[_0x7dc6('0x61')](db[_0x7dc6('0x76')][_0x7dc6('0x48')]);_0x1ab55c[_0x7dc6('0x50')]=_[_0x7dc6('0x61')](_0x416491[_0x7dc6('0x50')]);_0x1ab55c[_0x7dc6('0x4c')]=_['intersection'](_0x1ab55c['model'],_0x1ab55c[_0x7dc6('0x50')]);_0xf9955b[_0x7dc6('0x4e')]=_[_0x7dc6('0x4d')](_0x1ab55c[_0x7dc6('0x4b')],qs['fields'](_0x416491['query']['fields']));_0xf9955b[_0x7dc6('0x4e')]=_0xf9955b['attributes'][_0x7dc6('0x78')]?_0xf9955b[_0x7dc6('0x4e')]:_0x1ab55c['model'];if(!_0x416491['query'][_0x7dc6('0x51')](_0x7dc6('0x52'))){_0xf9955b['limit']=qs[_0x7dc6('0x35')](_0x416491[_0x7dc6('0x50')][_0x7dc6('0x35')]);_0xf9955b[_0x7dc6('0x33')]=qs['offset'](_0x416491[_0x7dc6('0x50')][_0x7dc6('0x33')]);}_0xf9955b[_0x7dc6('0x70')]=qs[_0x7dc6('0x53')](_0x416491[_0x7dc6('0x50')][_0x7dc6('0x53')]);_0xf9955b[_0x7dc6('0x54')]=qs[_0x7dc6('0x4c')](_[_0x7dc6('0x71')](_0x416491[_0x7dc6('0x50')],_0x1ab55c[_0x7dc6('0x4c')]));_0xf9955b['where']['ChatWebsiteId']=_0x3ebb9a['id'];if(_0x416491['query'][_0x7dc6('0x55')]){_0xf9955b[_0x7dc6('0x54')]=_[_0x7dc6('0x56')](_0xf9955b[_0x7dc6('0x54')],{'$or':_['map'](_0xf9955b['attributes'],function(_0xbc7c01){var _0x74b76d={};_0x74b76d[_0xbc7c01]={'$like':'%'+_0x416491[_0x7dc6('0x50')][_0x7dc6('0x55')]+'%'};return _0x74b76d;})});}_0xf9955b=_[_0x7dc6('0x56')]({},_0xf9955b,_0x416491[_0x7dc6('0x59')]);return db[_0x7dc6('0x76')][_0x7dc6('0x36')]({'where':_0xf9955b[_0x7dc6('0x54')]})[_0x7dc6('0x25')](function(_0xb5d6f1){_0x54920d[_0x7dc6('0x36')]=_0xb5d6f1;if(_0x416491[_0x7dc6('0x50')][_0x7dc6('0x5a')]){_0xf9955b[_0x7dc6('0x5b')]=[{'all':!![]}];}return db[_0x7dc6('0x76')][_0x7dc6('0x5c')](_0xf9955b);})[_0x7dc6('0x25')](function(_0x12ff6f){_0x54920d[_0x7dc6('0x72')]=_0x12ff6f;return _0x54920d;});}})[_0x7dc6('0x25')](respondWithFilteredResult(_0x5b6381,_0xf9955b))['catch'](handleError(_0x5b6381,null));};exports[_0x7dc6('0x79')]=function(_0x79c50d,_0x31c948,_0x72438a){return db[_0x7dc6('0x47')][_0x7dc6('0x62')]({'where':{'id':_0x79c50d['params']['id']}})[_0x7dc6('0x25')](handleEntityNotFound(_0x31c948,null))['then'](function(_0x489596){if(_0x489596){return _0x489596['removeAnswers'](_0x79c50d[_0x7dc6('0x50')][_0x7dc6('0x74')]);}})[_0x7dc6('0x25')](respondWithStatusCode(_0x31c948,null))[_0x7dc6('0x5d')](handleError(_0x31c948,null));};exports[_0x7dc6('0x7a')]=function(_0x4836c1,_0x100c66,_0x121507){_0x4836c1[_0x7dc6('0x64')][_0x7dc6('0x7b')]=_0x4836c1[_0x7dc6('0x7c')][_0x7dc6('0x7d')];return db[_0x7dc6('0x47')]['find']({'where':{'id':_0x4836c1[_0x7dc6('0x5f')]['id']}})['then'](handleEntityNotFound(_0x100c66,null))[_0x7dc6('0x25')](saveUpdates(_0x4836c1[_0x7dc6('0x64')],null))[_0x7dc6('0x25')](respondWithResult(_0x100c66,null))[_0x7dc6('0x5d')](handleError(_0x100c66,null));};exports[_0x7dc6('0x7e')]=function(_0x3d79e2,_0x291b2d,_0x19b03d){_0x3d79e2[_0x7dc6('0x64')][_0x7dc6('0x7f')]=_0x3d79e2[_0x7dc6('0x7c')][_0x7dc6('0x7d')];return db[_0x7dc6('0x47')][_0x7dc6('0x62')]({'where':{'id':_0x3d79e2['params']['id']}})['then'](handleEntityNotFound(_0x291b2d,null))['then'](saveUpdates(_0x3d79e2[_0x7dc6('0x64')],null))['then'](respondWithResult(_0x291b2d,null))[_0x7dc6('0x5d')](handleError(_0x291b2d,null));};exports[_0x7dc6('0x80')]=function(_0x37e59c,_0x298f64,_0x3abb82){_0x37e59c[_0x7dc6('0x64')]['customerAvatar']=_0x37e59c[_0x7dc6('0x7c')][_0x7dc6('0x7d')];return db[_0x7dc6('0x47')][_0x7dc6('0x62')]({'where':{'id':_0x37e59c[_0x7dc6('0x5f')]['id']}})[_0x7dc6('0x25')](handleEntityNotFound(_0x298f64,null))[_0x7dc6('0x25')](saveUpdates(_0x37e59c[_0x7dc6('0x64')],null))[_0x7dc6('0x25')](respondWithResult(_0x298f64,null))[_0x7dc6('0x5d')](handleError(_0x298f64,null));};exports[_0x7dc6('0x81')]=function(_0x1696b4,_0x42672b,_0x5192e7){_0x1696b4[_0x7dc6('0x64')][_0x7dc6('0x82')]=_0x1696b4[_0x7dc6('0x7c')][_0x7dc6('0x7d')];return db[_0x7dc6('0x47')][_0x7dc6('0x62')]({'where':{'id':_0x1696b4[_0x7dc6('0x5f')]['id']}})[_0x7dc6('0x25')](handleEntityNotFound(_0x42672b,null))['then'](saveUpdates(_0x1696b4['body'],null))[_0x7dc6('0x25')](respondWithResult(_0x42672b,null))[_0x7dc6('0x5d')](handleError(_0x42672b,null));};exports[_0x7dc6('0x83')]=function(_0xd94e4f,_0x2c5f41,_0x46f64a){var _0x2b7e1d=path['join'](config[_0x7dc6('0x84')],_0x7dc6('0x85'));var _0x34f9a8={'where':{'id':_0xd94e4f['params']['id']},'attributes':['id',_0x7dc6('0x7b')],'raw':!![]};var _0x23ea8e=![];return require(_0x7dc6('0x19'))[_0x7dc6('0x86')]()[_0x7dc6('0x25')](function(_0x1cc98a){if(_0x1cc98a){_0x23ea8e=_0x1cc98a['custom'];}})['then'](function(){return db[_0x7dc6('0x47')][_0x7dc6('0x62')](_0x34f9a8);})[_0x7dc6('0x25')](handleEntityNotFound(_0x2c5f41,null))[_0x7dc6('0x25')](function(_0x280b5a){if(_0x280b5a){if(!_['isNil'](_0x280b5a[_0x7dc6('0x7b')])){if(fs['existsSync'](path[_0x7dc6('0x87')](config[_0x7dc6('0x84')],_0x7dc6('0x88'),_0x280b5a[_0x7dc6('0x7b')]))&&_0x23ea8e){_0x2b7e1d=path[_0x7dc6('0x87')](config[_0x7dc6('0x84')],_0x7dc6('0x88'),_0x280b5a[_0x7dc6('0x7b')]);}}return _0x2c5f41[_0x7dc6('0x89')](_0x2b7e1d);}})[_0x7dc6('0x5d')](handleError(_0x2c5f41,null));};exports[_0x7dc6('0x8a')]=function(_0x3c875d,_0x4bdf6c,_0x508e87){var _0x864e41=path[_0x7dc6('0x87')](config['root'],_0x7dc6('0x8b'));var _0x2782d7={'where':{'id':_0x3c875d['params']['id']},'attributes':['id','agentAvatar'],'raw':!![]};return db[_0x7dc6('0x47')][_0x7dc6('0x62')](_0x2782d7)[_0x7dc6('0x25')](handleEntityNotFound(_0x4bdf6c,null))['then'](function(_0x46ffb8){if(_0x46ffb8){if(!_[_0x7dc6('0x8c')](_0x46ffb8['agentAvatar'])){if(fs[_0x7dc6('0x8d')](path[_0x7dc6('0x87')](config[_0x7dc6('0x84')],_0x7dc6('0x8e'),_0x46ffb8['agentAvatar']))){_0x864e41=path[_0x7dc6('0x87')](config[_0x7dc6('0x84')],_0x7dc6('0x8e'),_0x46ffb8['agentAvatar']);}}return _0x4bdf6c[_0x7dc6('0x89')](_0x864e41);}})[_0x7dc6('0x5d')](handleError(_0x4bdf6c,null));};exports[_0x7dc6('0x8f')]=function(_0x14b336,_0x26aab5,_0x1c8afa){var _0x15422e=path['join'](config[_0x7dc6('0x84')],_0x7dc6('0x90'));var _0x17a99d={'where':{'id':_0x14b336[_0x7dc6('0x5f')]['id']},'attributes':['id',_0x7dc6('0x91'),_0x7dc6('0x92')],'raw':!![]};return db[_0x7dc6('0x47')][_0x7dc6('0x62')](_0x17a99d)['then'](handleEntityNotFound(_0x26aab5,null))[_0x7dc6('0x25')](function(_0x307ba2){if(_0x307ba2){if(!_[_0x7dc6('0x8c')](_0x307ba2[_0x7dc6('0x91')])){if(fs[_0x7dc6('0x8d')](path[_0x7dc6('0x87')](config['root'],_0x7dc6('0x8e'),_0x307ba2[_0x7dc6('0x91')]))&&_0x307ba2['showCustomerAvatar']){_0x15422e=path[_0x7dc6('0x87')](config[_0x7dc6('0x84')],_0x7dc6('0x8e'),_0x307ba2[_0x7dc6('0x91')]);}}return _0x26aab5[_0x7dc6('0x89')](_0x15422e);}})[_0x7dc6('0x5d')](handleError(_0x26aab5,null));};exports[_0x7dc6('0x93')]=function(_0x53956f,_0x2d6803,_0x530285){var _0x56f87b=path[_0x7dc6('0x87')](config[_0x7dc6('0x84')],_0x7dc6('0x94'));var _0x1f454d={'where':{'id':_0x53956f[_0x7dc6('0x5f')]['id']},'attributes':['id',_0x7dc6('0x82')],'raw':!![]};return db[_0x7dc6('0x47')][_0x7dc6('0x62')](_0x1f454d)[_0x7dc6('0x25')](handleEntityNotFound(_0x2d6803,null))['then'](function(_0x3871ab){if(_0x3871ab){if(!_[_0x7dc6('0x8c')](_0x3871ab[_0x7dc6('0x82')])){if(fs['existsSync'](path[_0x7dc6('0x87')](config[_0x7dc6('0x84')],_0x7dc6('0x8e'),_0x3871ab[_0x7dc6('0x82')]))){_0x56f87b=path['join'](config['root'],'server/files/images/avatars/',_0x3871ab['systemAvatar']);}}return _0x2d6803[_0x7dc6('0x89')](_0x56f87b);}})['catch'](handleError(_0x2d6803,null));};exports[_0x7dc6('0x95')]=function(_0x1a79ce,_0x48e22f,_0x5c62f0){var _0x4b7024=require(_0x7dc6('0x96'));var _0x465291=new _0x4b7024();var _0x4323bb=_0x465291[_0x7dc6('0x97')](_0x1a79ce[_0x7dc6('0x98')]['user-agent'])['getResult']();var _0x33fb1a={'body':_0x1a79ce[_0x7dc6('0x64')],'channel':'chat'};var _0x5301c3=[];var _0x21a988=[];var _0xe95c81={};var _0x5ae82c=![];return db['CmContact'][_0x7dc6('0x6b')]()[_0x7dc6('0x25')](function(_0x5d3e1c){if(!_0x5d3e1c){throw new db['Sequelize']['ValidationError'](_0x7dc6('0x99'));}_0x5301c3=_['difference'](_['keys'](_0x5d3e1c),[_0x7dc6('0x9a'),'updatedAt']);_0x21a988=_[_0x7dc6('0x9b')](_[_0x7dc6('0x61')](_0x5d3e1c),[_0x7dc6('0x9a'),_0x7dc6('0x9c'),_0x7dc6('0x9d'),'ListId']);if(_0x1a79ce[_0x7dc6('0x64')]['id']){delete _0x1a79ce[_0x7dc6('0x64')]['id'];}if(_[_0x7dc6('0x8c')](_0x1a79ce[_0x7dc6('0x64')]['from'])){throw new db[(_0x7dc6('0x9e'))][(_0x7dc6('0x9f'))](_0x7dc6('0xa0'));}if(_[_0x7dc6('0x8c')](_0x1a79ce[_0x7dc6('0x64')]['body'])||_0x1a79ce['body'][_0x7dc6('0x64')]===''){throw new db[(_0x7dc6('0x9e'))][(_0x7dc6('0x9f'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_['isNil'](_0x1a79ce[_0x7dc6('0x64')][_0x7dc6('0xa1')])){throw new db['Sequelize'][(_0x7dc6('0x9f'))](_0x7dc6('0xa2')+_0x21a988);}if(!_[_0x7dc6('0xa3')](_0x21a988,_0x1a79ce['body'][_0x7dc6('0xa1')])){throw new db[(_0x7dc6('0x9e'))]['ValidationError'](_0x7dc6('0xa4')+_0x21a988);}_0xe95c81[_0x1a79ce[_0x7dc6('0x64')][_0x7dc6('0xa1')]]=_0x1a79ce[_0x7dc6('0x64')][_0x7dc6('0xa5')];})['then'](function(){return db[_0x7dc6('0x47')][_0x7dc6('0x62')]({'where':{'id':_0x1a79ce[_0x7dc6('0x5f')]['id']},'include':[{'model':db[_0x7dc6('0xa6')],'as':_0x7dc6('0xa7'),'include':[{'model':db['CmContact'],'as':_0x7dc6('0xa8'),'where':_0xe95c81,'limit':0x1,'order':[[_0x7dc6('0x9c'),_0x7dc6('0xa9')]]}]},{'model':db[_0x7dc6('0xaa')],'as':_0x7dc6('0xab')}]});})['then'](handleEntityNotFound(_0x48e22f,null))[_0x7dc6('0x25')](function(_0x29e384){if(_0x29e384&&_0x29e384[_0x7dc6('0xa7')]){_0x33fb1a['account']=_0x29e384;_0x33fb1a[_0x7dc6('0xac')]=_0x29e384[_0x7dc6('0xab')];_0x33fb1a[_0x7dc6('0xad')]=_0x29e384[_0x7dc6('0xa7')];_0x33fb1a[_0x7dc6('0xac')]=_[_0x7dc6('0xae')](_0x33fb1a['applications'],[_0x7dc6('0xaf')],[_0x7dc6('0xb0')]);if(_0x33fb1a[_0x7dc6('0xb1')][_0x7dc6('0xab')]){delete _0x33fb1a[_0x7dc6('0xb1')][_0x7dc6('0xab')];}if(_0x33fb1a[_0x7dc6('0xb1')]['List']&&_0x33fb1a[_0x7dc6('0xb1')][_0x7dc6('0xa7')][_0x7dc6('0xa8')]['length']){return _0x33fb1a[_0x7dc6('0xb1')][_0x7dc6('0xa7')][_0x7dc6('0xa8')][0x0];}var _0x4c5ede=_[_0x7dc6('0x1c')](_0x1a79ce[_0x7dc6('0x64')],{'firstName':_0x1a79ce[_0x7dc6('0x64')][_0x7dc6('0xa5')],'ListId':_0x29e384[_0x7dc6('0xb2')]});_0x4c5ede[_0x1a79ce[_0x7dc6('0x64')][_0x7dc6('0xa1')]]=_0x1a79ce[_0x7dc6('0x64')][_0x7dc6('0xa5')];return db['CmContact'][_0x7dc6('0x63')](_0x4c5ede,{'fields':_0x5301c3,'raw':!![]});}})[_0x7dc6('0x25')](handleEntityNotFound(_0x48e22f,null))[_0x7dc6('0x25')](function(_0x2086cc){_0x33fb1a['contact']=_0x2086cc;var _0xdc88c6=_0x1a79ce[_0x7dc6('0x64')]['customerIp'];if(_0x1a79ce[_0x7dc6('0x98')]['cf-connecting-ip']){_0xdc88c6=_0x1a79ce[_0x7dc6('0x98')][_0x7dc6('0xb3')];}else if(_0x1a79ce[_0x7dc6('0x98')]['x-forwarded-for']){_0xdc88c6=_[_0x7dc6('0xb4')](_0x1a79ce['headers'][_0x7dc6('0xb5')]['split'](','));}if(_0x2086cc){var _0x11baa4={'ContactId':_0x2086cc['id'],'ChatWebsiteId':_0x1a79ce[_0x7dc6('0x5f')]['id'],'from':(_0x2086cc[_0x7dc6('0xb6')]||'')+'\x20'+(_0x2086cc[_0x7dc6('0xb7')]||''),'customerIp':_0xdc88c6,'customerPort':_0x1a79ce[_0x7dc6('0x98')][_0x7dc6('0xb8')]?_0x1a79ce[_0x7dc6('0x98')][_0x7dc6('0xb8')]:null,'referer':_0x1a79ce[_0x7dc6('0x64')]['referer'],'browserName':_0x4323bb[_0x7dc6('0xb9')][_0x7dc6('0x42')]&&_0x4323bb[_0x7dc6('0xb9')][_0x7dc6('0xba')]?util[_0x7dc6('0xbb')](_0x7dc6('0xbc'),_0x4323bb[_0x7dc6('0xb9')]['name'],_0x4323bb[_0x7dc6('0xb9')][_0x7dc6('0xba')]):'unknown','browserVersion':_0x4323bb[_0x7dc6('0xb9')]['version']||'unknown','osName':util[_0x7dc6('0xbb')](_0x7dc6('0xbc'),_0x4323bb['os'][_0x7dc6('0x42')],_0x4323bb['os'][_0x7dc6('0xba')]),'osVersion':_0x4323bb['os'][_0x7dc6('0xba')],'deviceModel':_0x4323bb[_0x7dc6('0xbd')][_0x7dc6('0x4b')]&&_0x4323bb[_0x7dc6('0xbd')][_0x7dc6('0xbe')]?util[_0x7dc6('0xbb')](_0x7dc6('0xbf'),_0x4323bb[_0x7dc6('0xbd')][_0x7dc6('0x4b')],_0x4323bb[_0x7dc6('0xbd')][_0x7dc6('0xbe')],_0x4323bb[_0x7dc6('0xbd')][_0x7dc6('0x57')]):null,'deviceVendor':_0x4323bb[_0x7dc6('0xbd')][_0x7dc6('0xbe')],'deviceType':_0x4323bb[_0x7dc6('0xbd')][_0x7dc6('0x57')],'formData':JSON['stringify'](_0x1a79ce[_0x7dc6('0x64')])};var _0x5165bf={'ChatWebsiteId':_0x1a79ce[_0x7dc6('0x5f')]['id'],'closed':![]};if(_0x1a79ce[_0x7dc6('0x64')]['threadId']){_0x5165bf[_0x7dc6('0xc0')]=_0x1a79ce[_0x7dc6('0x64')][_0x7dc6('0xc0')];return db[_0x7dc6('0xc1')][_0x7dc6('0x62')]({'where':_0x5165bf})[_0x7dc6('0x25')](function(_0x195e13){if(_0x195e13){return[_0x195e13,![]];}_0x11baa4['threadId']=_0x1a79ce[_0x7dc6('0x64')]['threadId'];_0x11baa4['externalUrl']=_0x1a79ce[_0x7dc6('0x64')]['externalUrl'];return db[_0x7dc6('0xc1')][_0x7dc6('0x63')](_0x11baa4)['then'](function(_0x1cbb91){return[_0x1cbb91,!![]];});});}_0x5165bf[_0x7dc6('0xc2')]=_0x2086cc['id'];if(_0x1a79ce['body'][_0x7dc6('0xc3')]&&_0x1a79ce[_0x7dc6('0x64')][_0x7dc6('0xc3')]['id']){_0x5165bf['id']=_0x1a79ce['body']['interaction']['id'];return db['ChatInteraction']['find']({'where':_0x5165bf})[_0x7dc6('0x25')](function(_0x554ac4){if(_0x554ac4){return[_0x554ac4,![]];}return db[_0x7dc6('0xc1')]['create'](_0x11baa4)[_0x7dc6('0x25')](function(_0x214543){return[_0x214543,!![]];});});}return db[_0x7dc6('0xc1')][_0x7dc6('0x63')](_0x11baa4)['then'](function(_0x7d46ba){return[_0x7d46ba,!![]];});}})['spread'](function(_0x384903,_0x382d0a){if(_0x384903){_0x5ae82c=_0x382d0a;if(!_0x382d0a){var _0x4aff7e={'from':(_0x33fb1a[_0x7dc6('0xc4')][_0x7dc6('0xb6')]||'')+'\x20'+(_0x33fb1a[_0x7dc6('0xc4')][_0x7dc6('0xb7')]||'')};if(_0x1a79ce['body'][_0x7dc6('0xc0')]&&_0x1a79ce[_0x7dc6('0x64')][_0x7dc6('0xc5')]&&_0x1a79ce[_0x7dc6('0x64')][_0x7dc6('0xc0')]!=_0x1a79ce['body'][_0x7dc6('0xc5')]){_0x4aff7e[_0x7dc6('0xc0')]=_0x1a79ce['body'][_0x7dc6('0xc5')];}return _0x384903[_0x7dc6('0x3c')](_0x4aff7e);}else{return _0x384903;}}})[_0x7dc6('0x25')](function(_0x1cbec9){_0x33fb1a['interaction']=_0x1cbec9[_0x7dc6('0x3e')]({'plain':!![]});_0x33fb1a[_0x7dc6('0xc3')]['created']=_0x5ae82c;if(_0x33fb1a['interaction'][_0x7dc6('0xc6')]){if(_0x33fb1a[_0x7dc6('0xb1')][_0x7dc6('0xc7')]){_0x33fb1a['applications'][_0x7dc6('0xc8')]({'id':0x0,'priority':_0x33fb1a[_0x7dc6('0xac')][_0x7dc6('0x78')]+0x1,'app':_0x7dc6('0xc9'),'appdata':_0x7dc6('0xca'),'interval':_0x7dc6('0xcb')});}}return db[_0x7dc6('0xcc')][_0x7dc6('0x63')]({'body':_0x1a79ce[_0x7dc6('0x64')][_0x7dc6('0x64')],'ChatWebsiteId':_0x1a79ce[_0x7dc6('0x5f')]['id'],'ChatInteractionId':_0x1cbec9['id'],'direction':'in','ContactId':_0x33fb1a[_0x7dc6('0xc4')]['id'],'AttachmentId':_0x1a79ce['body'][_0x7dc6('0xcd')]});})[_0x7dc6('0x25')](function(_0x11760d){_0x33fb1a[_0x7dc6('0x2d')]=_0x11760d;if(_0x33fb1a[_0x7dc6('0xc3')]['UserId']){return db[_0x7dc6('0xce')][_0x7dc6('0x62')]({'attributes':['id','name'],'where':{'id':_0x33fb1a[_0x7dc6('0xc3')][_0x7dc6('0xcf')]}})['then'](function(_0x2886ee){if(_0x2886ee){_0x33fb1a[_0x7dc6('0xac')][_0x7dc6('0xd0')]({'id':0x0,'priority':0x0,'app':_0x7dc6('0xd1'),'appdata':_0x2886ee[_0x7dc6('0x42')]+','+(_0x33fb1a['account'][_0x7dc6('0xd2')]||0xa),'interval':_0x7dc6('0xcb')});_0x33fb1a[_0x7dc6('0xd3')]=!![];}return respondWithRpcPromise(_0x7dc6('0xd4'),'startRouting',_0x33fb1a);});}return respondWithRpcPromise(_0x7dc6('0xd4'),_0x7dc6('0xd5'),_0x33fb1a);})['then'](function(_0x5f0f86){respondWithRpcPromise(_0x7dc6('0xd6'),_0x7dc6('0xd6'),{'event':_0x7dc6('0x95'),'message':_0x5f0f86},client9002);return _0x5f0f86;})['then'](respondWithResult(_0x48e22f,null))['catch'](handleError(_0x48e22f,null));};exports[_0x7dc6('0xd7')]=function(_0x7e69fe,_0x4ade73,_0x56371c){var _0x1cd68b,_0x3fba97,_0x25404b;var _0x58aa01=[];var _0x886f61=[];var _0xe9db50={};var _0x2bfb5f=_0x7e69fe[_0x7dc6('0xd8')]||[];var _0xa4d879=[];var _0x29cb64;return db[_0x7dc6('0xd9')][_0x7dc6('0x6b')]()[_0x7dc6('0x25')](function(_0xd4cd63){if(!_0xd4cd63){throw new db[(_0x7dc6('0x9e'))][(_0x7dc6('0x9f'))](_0x7dc6('0x99'));}_0x886f61=_['difference'](_['keys'](_0xd4cd63),['createdAt',_0x7dc6('0x9c')]);_0x58aa01=_['difference'](_[_0x7dc6('0x61')](_0xd4cd63),['createdAt',_0x7dc6('0x9c'),_0x7dc6('0x9d'),_0x7dc6('0xb2')]);if(_0x7e69fe[_0x7dc6('0x64')]['id']){delete _0x7e69fe[_0x7dc6('0x64')]['id'];}if(_[_0x7dc6('0x8c')](_0x7e69fe[_0x7dc6('0x64')]['from'])){throw _0x4ade73[_0x7dc6('0x30')](0x1f4)[_0x7dc6('0x43')](new db[(_0x7dc6('0x9e'))][(_0x7dc6('0x9f'))](_0x7dc6('0xa0')));}if(_[_0x7dc6('0x8c')](_0x7e69fe[_0x7dc6('0x64')]['body'])||_0x7e69fe[_0x7dc6('0x64')][_0x7dc6('0x64')]===''){throw _0x4ade73[_0x7dc6('0x30')](0x1f4)[_0x7dc6('0x43')](new db[(_0x7dc6('0x9e'))]['ValidationError'](_0x7dc6('0xda')));}if(_[_0x7dc6('0x8c')](_0x7e69fe['body'][_0x7dc6('0xdb')])){throw _0x4ade73[_0x7dc6('0x30')](0x1f4)['send'](new db[(_0x7dc6('0x9e'))][(_0x7dc6('0x9f'))](_0x7dc6('0xdc')+_0x58aa01));}if(!_['includes'](_0x58aa01,_0x7e69fe[_0x7dc6('0x64')][_0x7dc6('0xdb')])){throw _0x4ade73[_0x7dc6('0x30')](0x1f4)[_0x7dc6('0x43')](new db[(_0x7dc6('0x9e'))][(_0x7dc6('0x9f'))]('mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x58aa01));}_0xe9db50[_0x7e69fe['body'][_0x7dc6('0xdb')]]=_0x7e69fe[_0x7dc6('0x64')][_0x7dc6('0xa5')];})['then'](function(){return db['ChatWebsite'][_0x7dc6('0x62')]({'where':{'id':_0x7e69fe[_0x7dc6('0x5f')]['id']},'include':[{'model':db[_0x7dc6('0xa6')],'as':'List'},{'model':db[_0x7dc6('0xdd')],'as':_0x7dc6('0xdd')}]});})[_0x7dc6('0x25')](handleEntityNotFound(_0x4ade73,null))[_0x7dc6('0x25')](function(_0x2abf0f){if(_0x2abf0f&&_0x2abf0f[_0x7dc6('0xa7')]){_0x3fba97=_0x2abf0f;var _0x16e7f3=_[_0x7dc6('0x1c')](_0x7e69fe['body'],{'firstName':_0x7e69fe['body'][_0x7dc6('0xa5')],'phone':_0x7e69fe[_0x7dc6('0x64')][_0x7dc6('0xa5')],'ListId':_0x2abf0f[_0x7dc6('0xb2')]});_0x16e7f3[_0x7e69fe[_0x7dc6('0x64')][_0x7dc6('0xdb')]]=_0x7e69fe['body'][_0x7dc6('0xa5')];return db[_0x7dc6('0xd9')]['findOrCreate']({'where':_0xe9db50,'defaults':_0x16e7f3});}})['spread'](function(_0x8977a4){if(_0x8977a4){_0x25404b=_0x8977a4;var _0x4d1e16=fs['readFileSync'](path[_0x7dc6('0x87')](config[_0x7dc6('0x84')],_0x7dc6('0xde')),_0x7dc6('0xdf'));var _0x5419a0=ejs[_0x7dc6('0xe0')](_0x4d1e16,{'body':_[_0x7dc6('0xe1')](_0x7e69fe['body'][_0x7dc6('0x64')]),'bodyTitle':_0x3fba97[_0x7dc6('0xe2')]});return db[_0x7dc6('0xe3')]['create']({'body':_0x5419a0,'ContactId':_0x8977a4['id'],'ChatWebsiteId':_0x3fba97['id']});}})[_0x7dc6('0x25')](function(_0x8598ed){_0x29cb64=_0x8598ed;if(_0x2bfb5f[_0x7dc6('0x78')]){var _0x1cc1f6=_0x2bfb5f['map'](function(_0x323733){return{'name':_0x323733['originalname'],'basename':_0x323733[_0x7dc6('0x7d')],'type':_0x323733['mimetype'],'ChatOfflineMessageId':_0x8598ed['id']};});_0xa4d879=_0x1cc1f6[_0x7dc6('0x46')](_0x2941ae=>{var _0x5726a6={'filename':_0x2941ae[_0x7dc6('0x42')],'path':path[_0x7dc6('0x87')](config[_0x7dc6('0x84')],_0x7dc6('0xe4'),_0x7dc6('0xd8'),_0x7dc6('0xe5'),_0x7dc6('0xe6'),_0x2941ae[_0x7dc6('0xe7')])};return _0x5726a6;});if(!_0x3fba97[_0x7dc6('0xe8')]){return db['sequelize']['transaction'](function(_0x4829e9){return db[_0x7dc6('0xe9')]['bulkCreate'](_0x1cc1f6,{'transaction':_0x4829e9});});}}})['then'](function(){if(_0x29cb64){_0x1cd68b=_0x29cb64;return db['MailAccount'][_0x7dc6('0xea')]({'where':{'active':!![]},'include':[{'model':db['MailServerOut'],'as':_0x7dc6('0xeb'),'raw':!![]}]});}})[_0x7dc6('0x25')](function(_0x4b0617){if(_0x4b0617&&_0x4b0617[_0x7dc6('0xeb')]&&_0x3fba97[_0x7dc6('0xec')]&&_0x3fba97['forwardOfflineAddress']){var _0x1d98ae={'tls':{'rejectUnauthorized':![]}};if(_0x4b0617['Smtp'][_0x7dc6('0xed')]){_0x1d98ae['service']=_0x4b0617[_0x7dc6('0xeb')][_0x7dc6('0xed')];}else{_0x1d98ae[_0x7dc6('0xee')]=_0x4b0617[_0x7dc6('0xeb')][_0x7dc6('0xee')];_0x1d98ae['port']=_0x4b0617[_0x7dc6('0xeb')][_0x7dc6('0xef')];_0x1d98ae[_0x7dc6('0xf0')]=_0x4b0617[_0x7dc6('0xeb')][_0x7dc6('0xf0')];}if(_0x4b0617['Smtp'][_0x7dc6('0xf1')]){_0x1d98ae[_0x7dc6('0xf2')]={'user':_0x4b0617[_0x7dc6('0xeb')][_0x7dc6('0x65')],'pass':_0x4b0617['Smtp']['pass']};}return respondWithRpcPromise(_0x7dc6('0xf3'),_0x7dc6('0xf4'),{'account':_0x1d98ae,'message':{'from':util['format']('\x22%s\x22\x20<%s>',_0x4b0617[_0x7dc6('0x42')],_0x4b0617['email']||_0x4b0617[_0x7dc6('0xeb')][_0x7dc6('0x65')]),'to':_0x3fba97[_0x7dc6('0xf5')],'subject':_0x3fba97[_0x7dc6('0xf6')],'html':_0x1cd68b['body'],'attachments':_0xa4d879}},client9003)[_0x7dc6('0x25')](function(){return _0x1cd68b;})[_0x7dc6('0x5d')](function(_0xcaaaf8){console['error'](_0xcaaaf8);});}})[_0x7dc6('0x25')](function(){if(_0x3fba97&&_0x3fba97['openNewInteraction']&&_0x3fba97[_0x7dc6('0xf7')]){var _0x4d818=[];if(_0x2bfb5f['length']){_0x4d818=_0x2bfb5f[_0x7dc6('0x46')](function(_0x1706f4){return{'name':_0x1706f4['originalname'],'basename':_0x1706f4[_0x7dc6('0x7d')],'type':_0x1706f4['mimetype'],'ChatOfflineMessageId':_0x29cb64['id']};});}var _0x2c724f;if(!_[_0x7dc6('0x8c')](_0x3fba97[_0x7dc6('0xf8')])){var _0x51e4cc=_[_0x7dc6('0x46')](_0x7e69fe[_0x7dc6('0x64')],function(_0x270494){return _0x270494;});var _0x4687fd=_[_0x7dc6('0xf9')](_0x51e4cc)[0x0];var _0x406713=_[_0x7dc6('0xfa')](_0x4687fd,function(_0x41c51a){return _0x41c51a;});_0x2c724f=_0x406713[0x1][_0x3fba97['subjectOffline']];}var _0x1c929e={'from':_0x25404b['email'],'firstName':_0x25404b[_0x7dc6('0xb6')],'lastName':_0x25404b[_0x7dc6('0xb7')],'mapKey':_0x7dc6('0xfb'),'message':{'from':_0x25404b[_0x7dc6('0xfb')],'to':_0x3fba97[_0x7dc6('0xdd')][_0x7dc6('0xfb')],'cc':'','subject':_[_0x7dc6('0x8c')](_0x2c724f)?_0x3fba97[_0x7dc6('0xf6')]:_0x2c724f,'messageId':'','sentAt':new Date(),'attach':_0x4d818[_0x7dc6('0x78')],'attachments':_0x4d818,'originChannel':_0x7dc6('0xfc'),'ChatWebsiteId':_0x3fba97['id'],'ChatOfflineMessageId':_0x1cd68b['id'],'originTo':_0x3fba97[_0x7dc6('0xdd')]['email']},'body':_0x1cd68b['body']};var _0x330149={'account':{'id':_0x3fba97[_0x7dc6('0xf7')]},'body':_0x1c929e,'log':_0x7dc6('0xfd')};return respondWithRpcPromise(_0x7dc6('0xfd'),'notifyMail',_0x330149,client9001)[_0x7dc6('0x25')](function(){return _0x1cd68b;})[_0x7dc6('0x5d')](function(_0xcef960){console[_0x7dc6('0x2b')](_0xcef960);});}return;})['then'](function(){if(_0x1cd68b){return _0x1cd68b;}})[_0x7dc6('0x25')](respondWithResult(_0x4ade73,null))[_0x7dc6('0x5d')](function(_0x177783){console[_0x7dc6('0x2b')](_0x7dc6('0x5d'),_0x177783);for(var _0x56e88e of _0x2bfb5f){var _0x5bf1dd=path[_0x7dc6('0x87')](config[_0x7dc6('0x84')],_0x7dc6('0xe4'),_0x7dc6('0xd8'),_0x7dc6('0xe5'),_0x7dc6('0xe6'),_0x56e88e[_0x7dc6('0x7d')]);fs_extra['remove'](_0x5bf1dd)['catch'](function(_0x6f595a){console['error'](_0x7dc6('0xfe'),_0x5bf1dd,_0x6f595a);});}});};exports[_0x7dc6('0xff')]=function(_0xcc02c9,_0x12e4de,_0x4b1cf1){return db[_0x7dc6('0xc1')][_0x7dc6('0x62')]({'where':{'id':_0xcc02c9[_0x7dc6('0x5f')]['id']}})['then'](handleEntityNotFound(_0x12e4de,null))[_0x7dc6('0x25')](function(_0x54e45a){if(_0x54e45a){return _0x54e45a[_0x7dc6('0xff')](_0xcc02c9[_0x7dc6('0x64')]['ids'],_['omit'](_0xcc02c9[_0x7dc6('0x64')],[_0x7dc6('0x74'),'id'])||{});}})[_0x7dc6('0x25')](respondWithResult(_0x12e4de,null))[_0x7dc6('0x5d')](handleError(_0x12e4de,null));};exports[_0x7dc6('0x100')]=function(_0x39e590,_0x1aa6af,_0x580208){var _0x10c640={'raw':![],'where':{}};var _0x21b3ee={};var _0x4e032e={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x7dc6('0xea')]({'where':{'id':_0x39e590[_0x7dc6('0x5f')]['id']}})[_0x7dc6('0x25')](handleEntityNotFound(_0x1aa6af,null))[_0x7dc6('0x25')](function(_0x160293){if(_0x160293){_0x21b3ee['model']=_[_0x7dc6('0x61')](db[_0x7dc6('0xc1')][_0x7dc6('0x48')]);_0x21b3ee[_0x7dc6('0x50')]=_[_0x7dc6('0x61')](_0x39e590[_0x7dc6('0x50')]);_0x21b3ee['filters']=_[_0x7dc6('0x4d')](_0x21b3ee[_0x7dc6('0x4b')],_0x21b3ee[_0x7dc6('0x50')]);_0x10c640[_0x7dc6('0x4e')]=_['intersection'](_0x21b3ee[_0x7dc6('0x4b')],qs[_0x7dc6('0x4f')](_0x39e590['query'][_0x7dc6('0x4f')]));_0x10c640['attributes']=_0x10c640[_0x7dc6('0x4e')][_0x7dc6('0x78')]?_0x10c640[_0x7dc6('0x4e')]:_0x21b3ee['model'];if(!_0x39e590[_0x7dc6('0x50')][_0x7dc6('0x51')](_0x7dc6('0x52'))){_0x10c640[_0x7dc6('0x35')]=qs[_0x7dc6('0x35')](_0x39e590[_0x7dc6('0x50')][_0x7dc6('0x35')]);_0x10c640[_0x7dc6('0x33')]=qs[_0x7dc6('0x33')](_0x39e590[_0x7dc6('0x50')][_0x7dc6('0x33')]);}_0x10c640[_0x7dc6('0x70')]=qs[_0x7dc6('0x53')](_0x39e590['query'][_0x7dc6('0x53')]);_0x10c640[_0x7dc6('0x54')]=qs[_0x7dc6('0x4c')](_[_0x7dc6('0x71')](_0x39e590[_0x7dc6('0x50')],_0x21b3ee[_0x7dc6('0x4c')]));_0x10c640[_0x7dc6('0x54')][_0x7dc6('0x6d')]=_0x160293['id'];if(_0x39e590[_0x7dc6('0x50')][_0x7dc6('0x55')]){_0x10c640[_0x7dc6('0x54')]=_[_0x7dc6('0x56')](_0x10c640[_0x7dc6('0x54')],{'$or':_[_0x7dc6('0x46')](_0x10c640[_0x7dc6('0x4e')],function(_0x267f63){var _0x4a4f2a={};_0x4a4f2a[_0x267f63]={'$like':'%'+_0x39e590[_0x7dc6('0x50')][_0x7dc6('0x55')]+'%'};return _0x4a4f2a;})});}_0x10c640=_[_0x7dc6('0x56')]({},_0x10c640,_0x39e590[_0x7dc6('0x59')]);return db['ChatInteraction'][_0x7dc6('0x36')]({'where':_0x10c640[_0x7dc6('0x54')]})[_0x7dc6('0x25')](function(_0x4aa4e8){_0x4e032e[_0x7dc6('0x36')]=_0x4aa4e8;if(_0x39e590[_0x7dc6('0x50')][_0x7dc6('0x5a')]){_0x10c640[_0x7dc6('0x5b')]=[{'model':db['CmContact'],'as':_0x7dc6('0x101'),'required':![]},{'model':db['User'],'as':_0x7dc6('0x102'),'attributes':[_0x7dc6('0x42'),_0x7dc6('0x103'),_0x7dc6('0x104')],'required':![]},{'model':db[_0x7dc6('0x105')],'as':_0x7dc6('0x106'),'attributes':['id','name',_0x7dc6('0x107')],'where':_0x39e590[_0x7dc6('0x50')][_0x7dc6('0x108')]?{'id':_0x39e590[_0x7dc6('0x50')][_0x7dc6('0x108')]}:undefined,'required':_0x39e590[_0x7dc6('0x50')][_0x7dc6('0x108')]?!![]:![]}];}return db[_0x7dc6('0xc1')]['findAll'](_0x10c640);})['then'](function(_0x5c9211){_0x4e032e[_0x7dc6('0x72')]=_0x5c9211;return _0x4e032e;});}})[_0x7dc6('0x25')](respondWithFilteredResult(_0x1aa6af,_0x10c640))[_0x7dc6('0x5d')](handleError(_0x1aa6af,null));};function iftimePromise(_0x296614,_0xddfd45){return respondWithRpcPromise(_0x7dc6('0x109'),_0x7dc6('0x10a'),{'command':_0xddfd45['timezone']?util['format'](_0x7dc6('0x10b'),_0x296614[_0x7dc6('0x10c')],_0xddfd45[_0x7dc6('0x10d')]):util['format'](_0x7dc6('0x10e'),_0x296614[_0x7dc6('0x10c')])},client9002)[_0x7dc6('0x25')](function(_0x2f9b87){var _0x54c150=_0x2f9b87&&_0x2f9b87['indexOf'](_0x7dc6('0x10f'))>=0x0?!![]:![];logger[_0x7dc6('0x26')]('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0xddfd45['id'],_0x296614['id'],_0x296614['interval'],_0x54c150?_0x7dc6('0x110'):_0x7dc6('0x111'),_0xddfd45[_0x7dc6('0x10d')]?_0xddfd45[_0x7dc6('0x10d')]:_0x7dc6('0x112'));return _0x54c150;})[_0x7dc6('0x5d')](function(_0x273d4c){logger[_0x7dc6('0x2b')](_0x7dc6('0x113'),_0xddfd45['id'],_0x296614['id'],_0x296614[_0x7dc6('0x10c')],util[_0x7dc6('0x114')](_0x273d4c,{'showHidden':![],'depth':null}),_0xddfd45[_0x7dc6('0x10d')]?_0xddfd45[_0x7dc6('0x10d')]:_0x7dc6('0x112'));return![];});}exports['getSnippet']=function(_0x2d4a98,_0x281539,_0xf18bfd){var _0x4bd9b4=0x0;var _0x4101d4=0x0;var _0x1b1b31=![];var _0x2e1ac7;var _0xcf8e48;return db[_0x7dc6('0x47')][_0x7dc6('0x62')]({'where':{'id':_0x2d4a98[_0x7dc6('0x5f')]['id']},'include':[{'model':db[_0x7dc6('0x115')],'as':'Interval','include':[{'model':db[_0x7dc6('0x115')],'as':_0x7dc6('0x116'),'attributes':['id','interval'],'raw':!![]}]}]})[_0x7dc6('0x25')](handleEntityNotFound(_0x281539,null))[_0x7dc6('0x25')](function(_0x57ddd8){if(_0x57ddd8){_0x2e1ac7=_0x57ddd8;return _0x57ddd8[_0x7dc6('0x117')]({'raw':!![]});}})['then'](function(_0x188b91){if(_0x2e1ac7){if(_0x188b91){_0xcf8e48=_0x188b91;}}return require(_0x7dc6('0x19'))[_0x7dc6('0x86')]();})[_0x7dc6('0x25')](function(_0x8e65f8){if(_0x8e65f8){_0x4101d4=_0x8e65f8[_0x7dc6('0x118')];_0x1b1b31=_0x8e65f8[_0x7dc6('0x119')];}})[_0x7dc6('0x25')](function(){return db[_0x7dc6('0xc1')][_0x7dc6('0x36')]({'where':{'closed':![]}});})[_0x7dc6('0x25')](function(_0xdefcc3){_0x4bd9b4=_0xdefcc3;if(_0x4101d4&&_0xdefcc3>_0x4101d4){return db[_0x7dc6('0x11a')][_0x7dc6('0xea')]({'where':{'id':0x1}})[_0x7dc6('0x25')](function(_0x25b1e2){if(_0x25b1e2){_0x25b1e2['increment'](_0x7dc6('0x11b'));}});}})['then'](function(){if(_0x2e1ac7[_0x7dc6('0x115')]&&_0x2e1ac7[_0x7dc6('0x115')][_0x7dc6('0x116')]){var _0x5b1159=[];for(var _0xb93a5f=0x0;_0xb93a5f<_0x2e1ac7['Interval'][_0x7dc6('0x116')][_0x7dc6('0x78')];_0xb93a5f++){var _0x5f42c5=_0x2e1ac7[_0x7dc6('0x115')][_0x7dc6('0x116')][_0xb93a5f][_0x7dc6('0x3e')]({'plain':!![]});_0x5b1159[_0x7dc6('0xc8')](iftimePromise(_0x5f42c5,_0x2e1ac7));}return BPromise['all'](_0x5b1159)[_0x7dc6('0x25')](function(_0x5c431c){return _['some'](_0x5c431c);});}else{return!![];}})[_0x7dc6('0x25')](function(_0x289e74){var _0x3eab75=fs[_0x7dc6('0x11c')](path[_0x7dc6('0x87')](config[_0x7dc6('0x84')],_0x7dc6('0x11d')),_0x7dc6('0xdf'));var _0x2e4365={'remote':_0x2e1ac7[_0x7dc6('0x11e')],'query':querystring[_0x7dc6('0x11f')](_[_0x7dc6('0x56')](_0x2e1ac7[_0x7dc6('0x3e')]({'plain':!![]}),{'customerIp':_0x2d4a98['headers'][_0x7dc6('0xb5')]||_0x2d4a98['headers'][_0x7dc6('0x120')]||_0x2d4a98[_0x7dc6('0x121')][_0x7dc6('0x122')]||_0x2d4a98['ip'],'referer':_0x2d4a98[_0x7dc6('0x98')][_0x7dc6('0x123')],'openedInteractions':_0x4bd9b4,'maxInteractions':_0x4101d4,'virtual':_0x1b1b31[_0x7dc6('0x118')],'online':_0x289e74,'custom':_0x1b1b31}))['replace'](/'/g,'\x5c\x27')};_0x281539[_0x7dc6('0x43')](ejs['render'](Mustache['render'](_0x3eab75,_0x2e4365),{'proactiveActions':_0xcf8e48,'alignment':_0x2e1ac7[_0x7dc6('0x124')],'verticalAlignment':_0x2e1ac7['verticalAlignment'],'div_color':_0x2e1ac7[_0x7dc6('0x107')],'text_color':_0x2e1ac7[_0x7dc6('0x125')],'button_color':_0x2e1ac7[_0x7dc6('0x126')],'background_color':_0x2e1ac7['backgroundColor']}));})[_0x7dc6('0x5d')](handleError(_0x281539,null));};exports[_0x7dc6('0x127')]=function(_0x8663d8,_0x2b66d0,_0x286e1e){return db[_0x7dc6('0x47')][_0x7dc6('0xea')]({'where':{'id':_0x8663d8[_0x7dc6('0x5f')]['id']}})[_0x7dc6('0x25')](handleEntityNotFound(_0x2b66d0,null))[_0x7dc6('0x25')](function(_0x37f921){if(_0x37f921){return db['sequelize'][_0x7dc6('0x128')](function(_0x5ca74d){return db[_0x7dc6('0xaa')][_0x7dc6('0x3d')]({'where':{'ChatWebsiteId':_0x8663d8[_0x7dc6('0x5f')]['id']},'transaction':_0x5ca74d})[_0x7dc6('0x25')](function(_0x570f0f){var _0x250f42=_[_0x7dc6('0x46')](_0x8663d8[_0x7dc6('0x64')],function(_0x48ad3d){_0x48ad3d['ChatWebsiteId']=_0x8663d8[_0x7dc6('0x5f')]['id'];return _0x48ad3d;});return db[_0x7dc6('0xaa')][_0x7dc6('0x129')](_0x250f42,{'transaction':_0x5ca74d});});})[_0x7dc6('0x25')](function(){return db[_0x7dc6('0xaa')][_0x7dc6('0x12a')]({'where':{'ChatWebsiteId':_0x8663d8[_0x7dc6('0x5f')]['id']},'order':_0x7dc6('0xaf')});});}})[_0x7dc6('0x25')](respondWithResult(_0x2b66d0,null))[_0x7dc6('0x5d')](handleError(_0x2b66d0,null));};exports[_0x7dc6('0x12b')]=function(_0x772228,_0x123fb3,_0x474620){var _0x34280e={};var _0x2a7345={};var _0x148867;var _0x5873cf;return db['ChatWebsite'][_0x7dc6('0xea')]({'where':{'id':_0x772228[_0x7dc6('0x5f')]['id']}})[_0x7dc6('0x25')](handleEntityNotFound(_0x123fb3,null))[_0x7dc6('0x25')](function(_0x419569){if(_0x419569){_0x148867=_0x419569;_0x2a7345[_0x7dc6('0x4b')]=_['keys'](db[_0x7dc6('0xaa')]['rawAttributes']);_0x2a7345[_0x7dc6('0x50')]=_[_0x7dc6('0x61')](_0x772228[_0x7dc6('0x50')]);_0x2a7345[_0x7dc6('0x4c')]=_[_0x7dc6('0x4d')](_0x2a7345['model'],_0x2a7345['query']);_0x34280e[_0x7dc6('0x4e')]=_[_0x7dc6('0x4d')](_0x2a7345[_0x7dc6('0x4b')],qs[_0x7dc6('0x4f')](_0x772228[_0x7dc6('0x50')][_0x7dc6('0x4f')]));_0x34280e['attributes']=_0x34280e['attributes'][_0x7dc6('0x78')]?_0x34280e[_0x7dc6('0x4e')]:_0x2a7345[_0x7dc6('0x4b')];_0x34280e[_0x7dc6('0x70')]=qs[_0x7dc6('0x53')](_0x772228[_0x7dc6('0x50')][_0x7dc6('0x53')]);_0x34280e[_0x7dc6('0x54')]=qs[_0x7dc6('0x4c')](_[_0x7dc6('0x71')](_0x772228[_0x7dc6('0x50')],_0x2a7345[_0x7dc6('0x4c')]));if(_0x772228[_0x7dc6('0x50')][_0x7dc6('0x55')]){_0x34280e[_0x7dc6('0x54')]=_['merge'](_0x34280e[_0x7dc6('0x54')],{'$or':_['map'](_0x34280e[_0x7dc6('0x4e')],function(_0x148241){var _0x1cc1f4={};_0x1cc1f4[_0x148241]={'$like':'%'+_0x772228[_0x7dc6('0x50')][_0x7dc6('0x55')]+'%'};return _0x1cc1f4;})});}_0x34280e=_[_0x7dc6('0x56')]({},_0x34280e,_0x772228['options']);return _0x148867['getApplications'](_0x34280e);}})[_0x7dc6('0x25')](function(_0x5c8855){if(_0x5c8855){_0x5873cf=_0x5c8855[_0x7dc6('0x78')];if(!_0x772228[_0x7dc6('0x50')][_0x7dc6('0x51')](_0x7dc6('0x52'))){_0x34280e[_0x7dc6('0x35')]=qs['limit'](_0x772228[_0x7dc6('0x50')]['limit']);_0x34280e[_0x7dc6('0x33')]=qs[_0x7dc6('0x33')](_0x772228[_0x7dc6('0x50')]['offset']);}return _0x148867[_0x7dc6('0x12b')](_0x34280e);}})[_0x7dc6('0x25')](function(_0x45901b){if(_0x45901b){return _0x45901b?{'count':_0x5873cf,'rows':_0x45901b}:null;}})[_0x7dc6('0x25')](respondWithResult(_0x123fb3,null))[_0x7dc6('0x5d')](handleError(_0x123fb3,null));};exports[_0x7dc6('0x12c')]=function(_0x236d9a,_0x3eb47e,_0x3bee2b){return db[_0x7dc6('0x12d')][_0x7dc6('0x62')]({'where':{'id':_0x236d9a[_0x7dc6('0x5f')]['id']}})[_0x7dc6('0x25')](handleEntityNotFound(_0x3eb47e,null))[_0x7dc6('0x25')](function(_0x37dd6a){if(_0x37dd6a){return _0x37dd6a[_0x7dc6('0x12c')](_0x236d9a['body'][_0x7dc6('0x74')],_[_0x7dc6('0x12e')](_0x236d9a[_0x7dc6('0x64')],[_0x7dc6('0x74'),'id'])||{});}})[_0x7dc6('0x25')](respondWithResult(_0x3eb47e,null))[_0x7dc6('0x5d')](handleError(_0x3eb47e,null));};exports['getProactiveActions']=function(_0x793527,_0x43a0b9,_0x5e8e8c){var _0x58c9cb={};var _0xd97948={};var _0x5667d2;var _0x2c0b95;return db[_0x7dc6('0x47')][_0x7dc6('0xea')]({'where':{'id':_0x793527[_0x7dc6('0x5f')]['id']}})[_0x7dc6('0x25')](handleEntityNotFound(_0x43a0b9,null))['then'](function(_0x3db1dc){if(_0x3db1dc){_0x5667d2=_0x3db1dc;_0xd97948[_0x7dc6('0x4b')]=_[_0x7dc6('0x61')](db[_0x7dc6('0x12f')][_0x7dc6('0x48')]);_0xd97948[_0x7dc6('0x50')]=_[_0x7dc6('0x61')](_0x793527['query']);_0xd97948[_0x7dc6('0x4c')]=_[_0x7dc6('0x4d')](_0xd97948['model'],_0xd97948[_0x7dc6('0x50')]);_0x58c9cb['attributes']=_[_0x7dc6('0x4d')](_0xd97948[_0x7dc6('0x4b')],qs[_0x7dc6('0x4f')](_0x793527[_0x7dc6('0x50')]['fields']));_0x58c9cb[_0x7dc6('0x4e')]=_0x58c9cb[_0x7dc6('0x4e')][_0x7dc6('0x78')]?_0x58c9cb[_0x7dc6('0x4e')]:_0xd97948['model'];_0x58c9cb['order']=qs[_0x7dc6('0x53')](_0x793527[_0x7dc6('0x50')][_0x7dc6('0x53')]);_0x58c9cb[_0x7dc6('0x54')]=qs[_0x7dc6('0x4c')](_[_0x7dc6('0x71')](_0x793527[_0x7dc6('0x50')],_0xd97948[_0x7dc6('0x4c')]));if(_0x793527[_0x7dc6('0x50')][_0x7dc6('0x55')]){_0x58c9cb[_0x7dc6('0x54')]=_['merge'](_0x58c9cb[_0x7dc6('0x54')],{'$or':_[_0x7dc6('0x46')](_0x58c9cb['attributes'],function(_0x3f29b1){var _0x12cc4b={};_0x12cc4b[_0x3f29b1]={'$like':'%'+_0x793527[_0x7dc6('0x50')][_0x7dc6('0x55')]+'%'};return _0x12cc4b;})});}_0x58c9cb=_[_0x7dc6('0x56')]({},_0x58c9cb,_0x793527[_0x7dc6('0x59')]);return _0x5667d2[_0x7dc6('0x117')](_0x58c9cb);}})['then'](function(_0x3817ec){if(_0x3817ec){_0x2c0b95=_0x3817ec[_0x7dc6('0x78')];if(!_0x793527['query'][_0x7dc6('0x51')](_0x7dc6('0x52'))){_0x58c9cb[_0x7dc6('0x35')]=qs[_0x7dc6('0x35')](_0x793527[_0x7dc6('0x50')][_0x7dc6('0x35')]);_0x58c9cb[_0x7dc6('0x33')]=qs[_0x7dc6('0x33')](_0x793527[_0x7dc6('0x50')][_0x7dc6('0x33')]);}return _0x5667d2[_0x7dc6('0x117')](_0x58c9cb);}})[_0x7dc6('0x25')](function(_0x404fc2){if(_0x404fc2){return _0x404fc2?{'count':_0x2c0b95,'rows':_0x404fc2}:null;}})[_0x7dc6('0x25')](respondWithResult(_0x43a0b9,null))[_0x7dc6('0x5d')](handleError(_0x43a0b9,null));};exports[_0x7dc6('0x130')]=function(_0x54ea74,_0x31846d,_0x3967e2){var _0x4339d0=_0x54ea74['query'][_0x7dc6('0x131')]===_0x7dc6('0x132')?_0x7dc6('0x133'):_0x7dc6('0x134');return db[_0x7dc6('0x47')]['find']({'attributes':['id',_0x4339d0],'where':{'id':_0x54ea74[_0x7dc6('0x5f')]['id']}})[_0x7dc6('0x25')](handleEntityNotFound(_0x31846d,null))['then'](function(_0x3587a0){if(_0x3587a0){var _0x5969b4=_0x3587a0[_0x4339d0];var _0x2beca3=_0x5969b4&&_0x5969b4[_0x7dc6('0x135')]?_0x5969b4[_0x7dc6('0x135')]:[];_0x31846d[_0x7dc6('0x43')]({'fromKey':_['isNil'](_0x5969b4['fromKey'])?undefined:_0x5969b4[_0x7dc6('0x136')],'count':_0x2beca3[_0x7dc6('0x78')],'rows':_0x2beca3});}})[_0x7dc6('0x5d')](handleError(_0x31846d,null));};exports[_0x7dc6('0x137')]=function(_0x8dd675,_0x21ebc3,_0x1ba786){var _0x17a421={'raw':![],'where':{}};var _0x52e040={};var _0xec3664={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x7dc6('0xea')]({'where':{'id':_0x8dd675['params']['id']}})[_0x7dc6('0x25')](handleEntityNotFound(_0x21ebc3,null))[_0x7dc6('0x25')](function(_0x1b85fd){if(_0x1b85fd){_0x52e040['model']=_[_0x7dc6('0x61')](db[_0x7dc6('0xe3')][_0x7dc6('0x48')]);_0x52e040['query']=_[_0x7dc6('0x61')](_0x8dd675[_0x7dc6('0x50')]);_0x52e040['filters']=_[_0x7dc6('0x4d')](_0x52e040['model'],_0x52e040[_0x7dc6('0x50')]);_0x17a421[_0x7dc6('0x4e')]=_[_0x7dc6('0x4d')](_0x52e040[_0x7dc6('0x4b')],qs['fields'](_0x8dd675['query'][_0x7dc6('0x4f')]));_0x17a421[_0x7dc6('0x4e')]=_0x17a421[_0x7dc6('0x4e')][_0x7dc6('0x78')]?_0x17a421[_0x7dc6('0x4e')]:_0x52e040['model'];if(!_0x8dd675[_0x7dc6('0x50')][_0x7dc6('0x51')](_0x7dc6('0x52'))){_0x17a421[_0x7dc6('0x35')]=qs['limit'](_0x8dd675[_0x7dc6('0x50')][_0x7dc6('0x35')]);_0x17a421[_0x7dc6('0x33')]=qs[_0x7dc6('0x33')](_0x8dd675[_0x7dc6('0x50')]['offset']);}_0x17a421[_0x7dc6('0x70')]=qs[_0x7dc6('0x53')](_0x8dd675[_0x7dc6('0x50')]['sort']);_0x17a421[_0x7dc6('0x54')]=qs['filters'](_['pick'](_0x8dd675[_0x7dc6('0x50')],_0x52e040[_0x7dc6('0x4c')]));_0x17a421['where'][_0x7dc6('0x6d')]=_0x1b85fd['id'];if(_0x8dd675[_0x7dc6('0x50')][_0x7dc6('0x55')]){_0x17a421[_0x7dc6('0x54')]=_[_0x7dc6('0x56')](_0x17a421[_0x7dc6('0x54')],{'$or':_[_0x7dc6('0x46')](_0x17a421['attributes'],function(_0x11d040){var _0x5365b9={};_0x5365b9[_0x11d040]={'$like':'%'+_0x8dd675['query']['filter']+'%'};return _0x5365b9;})});}_0x17a421=_[_0x7dc6('0x56')]({},_0x17a421,_0x8dd675[_0x7dc6('0x59')]);return db['ChatOfflineMessage'][_0x7dc6('0x36')]({'where':_0x17a421[_0x7dc6('0x54')]})[_0x7dc6('0x25')](function(_0x557569){_0xec3664['count']=_0x557569;if(_0x8dd675[_0x7dc6('0x50')][_0x7dc6('0x5a')]){_0x17a421[_0x7dc6('0x5b')]=[{'all':!![]}];}else{_0x17a421[_0x7dc6('0x5b')]=[{'model':db[_0x7dc6('0xd9')],'as':_0x7dc6('0x101'),'required':![]},{'model':db['Attachment'],'as':_0x7dc6('0x138'),'required':![]}];}return db[_0x7dc6('0xe3')][_0x7dc6('0x5c')](_0x17a421);})['then'](function(_0x21c612){_0xec3664[_0x7dc6('0x72')]=_0x21c612;return _0xec3664;});}})[_0x7dc6('0x25')](respondWithFilteredResult(_0x21ebc3,_0x17a421))[_0x7dc6('0x5d')](handleError(_0x21ebc3,null));};exports[_0x7dc6('0x139')]=function(_0x542eb4,_0x24ce94,_0x18bd69){return db['ChatWebsite'][_0x7dc6('0x62')]({'where':{'id':_0x542eb4[_0x7dc6('0x5f')]['id']}})[_0x7dc6('0x25')](handleEntityNotFound(_0x24ce94,null))[_0x7dc6('0x25')](function(_0x2065ae){if(_0x2065ae){return _0x2065ae['addAgents'](_0x542eb4[_0x7dc6('0x64')]['ids'],_[_0x7dc6('0x12e')](_0x542eb4['body'],[_0x7dc6('0x74'),'id'])||{})[_0x7dc6('0x13a')](function(_0x3ea664){for(var _0x5b87ad=0x0;_0x5b87ad<_0x542eb4['body'][_0x7dc6('0x74')]['length'];_0x5b87ad+=0x1){socket[_0x7dc6('0x13b')]('userChatWebsite:save',{'UserId':Number(_0x542eb4[_0x7dc6('0x64')][_0x7dc6('0x74')][_0x5b87ad]),'ChatWebsiteId':Number(_0x542eb4[_0x7dc6('0x5f')]['id'])});}return _0x3ea664;});}})['then'](respondWithResult(_0x24ce94,null))[_0x7dc6('0x5d')](handleError(_0x24ce94,null));};exports[_0x7dc6('0x13c')]=function(_0x47fad7,_0xe62560,_0x4f3695){return db[_0x7dc6('0x47')]['find']({'where':{'id':_0x47fad7['params']['id']}})[_0x7dc6('0x25')](handleEntityNotFound(_0xe62560,null))[_0x7dc6('0x25')](function(_0x1cf85f){if(_0x1cf85f){return _0x1cf85f[_0x7dc6('0x13c')](_0x47fad7['query']['ids'])[_0x7dc6('0x25')](function(){if(_[_0x7dc6('0x13d')](_0x47fad7['query']['ids'])){for(var _0x423731=0x0;_0x423731<_0x47fad7['query'][_0x7dc6('0x74')][_0x7dc6('0x78')];_0x423731+=0x1){socket[_0x7dc6('0x13b')]('userChatWebsite:remove',{'UserId':Number(_0x47fad7[_0x7dc6('0x50')][_0x7dc6('0x74')][_0x423731]),'ChatWebsiteId':Number(_0x47fad7[_0x7dc6('0x5f')]['id'])});}}else{socket['emit'](_0x7dc6('0x13e'),{'UserId':Number(_0x47fad7[_0x7dc6('0x50')][_0x7dc6('0x74')]),'ChatWebsiteId':Number(_0x47fad7[_0x7dc6('0x5f')]['id'])});}});}})[_0x7dc6('0x25')](respondWithStatusCode(_0xe62560,null))['catch'](handleError(_0xe62560,null));};exports[_0x7dc6('0x13f')]=function(_0x1c107f,_0x436169,_0x104b75){var _0x19a8ad={};var _0x50e589={};var _0x552f07;var _0x22c47c;return db[_0x7dc6('0x47')][_0x7dc6('0xea')]({'where':{'id':_0x1c107f[_0x7dc6('0x5f')]['id']}})[_0x7dc6('0x25')](handleEntityNotFound(_0x436169,null))['then'](function(_0x1c0d96){if(_0x1c0d96){_0x552f07=_0x1c0d96;_0x50e589[_0x7dc6('0x4b')]=_['keys'](db[_0x7dc6('0xce')][_0x7dc6('0x48')]);_0x50e589['query']=_[_0x7dc6('0x61')](_0x1c107f['query']);_0x50e589['filters']=_[_0x7dc6('0x4d')](_0x50e589[_0x7dc6('0x4b')],_0x50e589[_0x7dc6('0x50')]);_0x19a8ad[_0x7dc6('0x4e')]=_[_0x7dc6('0x4d')](_0x50e589['model'],qs[_0x7dc6('0x4f')](_0x1c107f[_0x7dc6('0x50')][_0x7dc6('0x4f')]));_0x19a8ad[_0x7dc6('0x4e')]=_0x19a8ad[_0x7dc6('0x4e')][_0x7dc6('0x78')]?_0x19a8ad[_0x7dc6('0x4e')]:_0x50e589['model'];_0x19a8ad[_0x7dc6('0x70')]=qs[_0x7dc6('0x53')](_0x1c107f[_0x7dc6('0x50')][_0x7dc6('0x53')]);_0x19a8ad['where']=qs[_0x7dc6('0x4c')](_['pick'](_0x1c107f[_0x7dc6('0x50')],_0x50e589['filters']));if(_0x1c107f[_0x7dc6('0x50')][_0x7dc6('0x55')]){_0x19a8ad['where']=_[_0x7dc6('0x56')](_0x19a8ad[_0x7dc6('0x54')],{'$or':_[_0x7dc6('0x46')](_0x19a8ad[_0x7dc6('0x4e')],function(_0x2c57be){var _0x5ea0c1={};_0x5ea0c1[_0x2c57be]={'$like':'%'+_0x1c107f['query'][_0x7dc6('0x55')]+'%'};return _0x5ea0c1;})});}_0x19a8ad=_['merge']({},_0x19a8ad,_0x1c107f[_0x7dc6('0x59')]);return _0x552f07[_0x7dc6('0x13f')](_0x19a8ad);}})[_0x7dc6('0x25')](function(_0xf03b01){if(_0xf03b01){_0x22c47c=_0xf03b01[_0x7dc6('0x78')];if(!_0x1c107f['query'][_0x7dc6('0x51')](_0x7dc6('0x52'))){_0x19a8ad[_0x7dc6('0x35')]=qs['limit'](_0x1c107f['query'][_0x7dc6('0x35')]);_0x19a8ad[_0x7dc6('0x33')]=qs[_0x7dc6('0x33')](_0x1c107f[_0x7dc6('0x50')][_0x7dc6('0x33')]);}return _0x552f07[_0x7dc6('0x13f')](_0x19a8ad);}})[_0x7dc6('0x25')](function(_0x35c29c){if(_0x35c29c){return _0x35c29c?{'count':_0x22c47c,'rows':_0x35c29c}:null;}})['then'](respondWithResult(_0x436169,null))[_0x7dc6('0x5d')](handleError(_0x436169,null));}; \ No newline at end of file +var _0x7916=['VIRTUAL','merge','options','includeAll','include','rows','show','mandatoryDispositionPause','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','describe','ChatWebsiteId','Disposition','getDispositions','hasOwnProperty','pick','removeDispositions','ids','addAnswer','CannedAnswer','findAll','removeAnswers','file','addAvatar','filename','addCustomerAvatar','customerAvatar','addSystemAvatar','systemAvatar','getLogo','join','root','server/files/images/logos/default_logo.svg','sitepic','getLicense','custom','isNil','existsSync','server/files/images/logos/','server/files/images/avatars/default_avatar.png','agentAvatar','server/files/images/avatars/','download','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','setUA','headers','user-agent','getResult','CmContact','ValidationError','no\x20available\x20attributes','difference','updatedAt','CompanyId','ListId','Sequelize','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','from','List','Contacts','DESC','ChatApplication','account','list','applications','orderBy','priority','asc','Applications','defaults','contact','customerIp','cf-connecting-ip','x-forwarded-for','split','firstName','lastName','x-real-port','referer','browser','version','format','%s\x20%s','unknown','device','vendor','%s\x20%s\x20%s','threadId','ChatInteraction','externalUrl','ContactId','interaction','messageId','created','autoclose','close','unmanaged','*,*,*,*','ChatMessage','UserId','User','unshift','agent','waitForTheAssignedAgent','forcedOwnership','startRouting','Start','EventManager','notify','offline','files','createdAt','send','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKeyOffline','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','MailAccount','findOrCreate','spread','readFileSync','server/files/templates/chatOfflineMessage.ejs','utf8','render','toPairs','offlineMessageBody','ChatOfflineMessage','originalname','mimetype','server','attachments','offline-chat','basename','openNewInteraction','sequelize','transaction','Attachment','bulkCreate','findOne','MailServerOut','Smtp','forwardOffline','forwardOfflineAddress','service','host','port','secure','authentication','auth','pass','SendMail','sendMail','\x22%s\x22\x20<%s>','email','offlineMessageSubject','MailAccountId','subjectOffline','toPairsIn','Chat','NotifyMailAccount','notifyMail','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','getInteractions','Contact','Owner','internal','Tag','Tags','color','tag','Command','getSnippet','timezone','iftime\x20%s,%s','interval','iftime\x20%s','indexOf','true','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','OFFLINE','No\x20timezone','inspect','Interval','Intervals','virtual','License','push','some','server/files/chat/iframe.ejs','connection','remoteAddress','replace','alignment','verticalAlignment','textColor','color_button','backgroundColor','addApplications','findAndCountAll','getApplications','addProactiveActions','chatProactiveAction','getProactiveActions','getFields','online','false','offlineForm','onlineForm','items','fromKey','getOfflineMessages','Attachments','addAgents','emit','userChatWebsite:save','removeAgents','userChatWebsite:remove','getAgents','eml-format','fast-json-patch','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','crypto','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','./chatWebsite.socket','jayson/promise','client','http','request','then','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatWebsite,\x20%s,\x20%s','message','info','catch','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','destroy','get','sendStatus','name','index','Pause','map','ChatWebsite','rawAttributes','type','key','query','keys','intersection','model','fields','attributes','length','nolimit','order','sort','filters','filter','where'];(function(_0x5465e6,_0x2a8809){var _0x10044e=function(_0x1d5dcd){while(--_0x1d5dcd){_0x5465e6['push'](_0x5465e6['shift']());}};_0x10044e(++_0x2a8809);}(_0x7916,0xee));var _0x6791=function(_0x381cbe,_0x17511b){_0x381cbe=_0x381cbe-0x0;var _0x1a615d=_0x7916[_0x381cbe];return _0x1a615d;};'use strict';var emlformat=require(_0x6791('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x6791('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x6791('0x2'));var Mustache=require(_0x6791('0x3'));var util=require(_0x6791('0x4'));var path=require(_0x6791('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x6791('0x6'));var fs=require('fs');var fs_extra=require(_0x6791('0x7'));var _=require(_0x6791('0x8'));var squel=require(_0x6791('0x9'));var crypto=require(_0x6791('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x6791('0xb'));var Papa=require('papaparse');var Redis=require(_0x6791('0xc'));var authService=require(_0x6791('0xd'));var qs=require(_0x6791('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6791('0xf'));var logger=require(_0x6791('0x10'))(_0x6791('0x11'));var utils=require(_0x6791('0x12'));var config=require(_0x6791('0x13'));var licenseUtil=require(_0x6791('0x14'));var db=require(_0x6791('0x15'))['db'];config[_0x6791('0x16')]=_['defaults'](config[_0x6791('0x16')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x6791('0x16')]));require(_0x6791('0x17'))['register'](socket);var jayson=require(_0x6791('0x18'));var client=jayson[_0x6791('0x19')][_0x6791('0x1a')]({'port':0x232c});var client9002=jayson[_0x6791('0x19')]['http']({'port':0x232a});var client9003=jayson['client'][_0x6791('0x1a')]({'port':0x232b});var client9001=jayson[_0x6791('0x19')][_0x6791('0x1a')]({'port':0x2329});function respondWithRpcPromise(_0xad02a,_0x35fa33,_0x3d8ead,_0x5da32b){return new BPromise(function(_0xe2a68,_0x4670e2){var _0x411d29=_0x5da32b||client;return _0x411d29[_0x6791('0x1b')](_0xad02a,_0x3d8ead)[_0x6791('0x1c')](function(_0x4f30d7){logger['info']('ChatWebsite,\x20%s,\x20%s',_0x35fa33,_0x6791('0x1d'));logger[_0x6791('0x1e')](_0x6791('0x1f'),_0x35fa33,_0x6791('0x1d'),JSON[_0x6791('0x20')](_0x4f30d7));if(_0x4f30d7['error']){if(_0x4f30d7[_0x6791('0x21')][_0x6791('0x22')]===0x1f4){logger[_0x6791('0x21')](_0x6791('0x23'),_0x35fa33,_0x4f30d7[_0x6791('0x21')][_0x6791('0x24')]);return _0x4670e2(_0x4f30d7['error'][_0x6791('0x24')]);}logger[_0x6791('0x21')]('ChatWebsite,\x20%s,\x20%s',_0x35fa33,_0x4f30d7['error'][_0x6791('0x24')]);return _0xe2a68(_0x4f30d7[_0x6791('0x21')][_0x6791('0x24')]);}else{logger[_0x6791('0x25')](_0x6791('0x23'),_0x35fa33,_0x6791('0x1d'));_0xe2a68(_0x4f30d7['result']['message']);}})[_0x6791('0x26')](function(_0x23ffd2){logger[_0x6791('0x21')](_0x6791('0x23'),_0x35fa33,_0x23ffd2);_0x4670e2(_0x23ffd2);});});}function respondWithStatusCode(_0x438d22,_0x198f7e){_0x198f7e=_0x198f7e||0xcc;return function(_0x436e0e){if(_0x436e0e){return _0x438d22['sendStatus'](_0x198f7e);}return _0x438d22[_0x6791('0x27')](_0x198f7e)[_0x6791('0x28')]();};}function respondWithResult(_0x105494,_0x3a6820){_0x3a6820=_0x3a6820||0xc8;return function(_0x35853d){if(_0x35853d){return _0x105494[_0x6791('0x27')](_0x3a6820)[_0x6791('0x29')](_0x35853d);}};}function respondWithFilteredResult(_0x30ae45,_0x1ff006){return function(_0x5a7045){if(_0x5a7045){var _0x450332=typeof _0x1ff006[_0x6791('0x2a')]===_0x6791('0x2b')&&typeof _0x1ff006['limit']===_0x6791('0x2b');var _0x4dca91=_0x5a7045[_0x6791('0x2c')];var _0x34cabb=_0x450332?0x0:_0x1ff006[_0x6791('0x2a')];var _0x4803b2=_0x450332?_0x5a7045['count']:_0x1ff006[_0x6791('0x2a')]+_0x1ff006[_0x6791('0x2d')];var _0xf877c3;if(_0x4803b2>=_0x4dca91){_0x4803b2=_0x4dca91;_0xf877c3=0xc8;}else{_0xf877c3=0xce;}_0x30ae45[_0x6791('0x27')](_0xf877c3);return _0x30ae45[_0x6791('0x2e')](_0x6791('0x2f'),_0x34cabb+'-'+_0x4803b2+'/'+_0x4dca91)[_0x6791('0x29')](_0x5a7045);}return null;};}function patchUpdates(_0x56aba9){return function(_0x39e6ed){try{jsonpatch[_0x6791('0x30')](_0x39e6ed,_0x56aba9,!![]);}catch(_0x2df8aa){return BPromise[_0x6791('0x31')](_0x2df8aa);}return _0x39e6ed['save']();};}function saveUpdates(_0x3e63ae,_0xbfd42d){return function(_0x2841b4){if(_0x2841b4){return _0x2841b4['update'](_0x3e63ae)[_0x6791('0x1c')](function(_0x2b8f54){return _0x2b8f54;});}return null;};}function removeEntity(_0x3ad0ce,_0x112644){return function(_0x3330ac){if(_0x3330ac){return _0x3330ac[_0x6791('0x32')]()[_0x6791('0x1c')](function(){var _0x4e99f7=_0x3330ac[_0x6791('0x33')]({'plain':!![]});var _0x447daf='ChatWebsites';return db['UserProfileResource'][_0x6791('0x32')]({'where':{'type':_0x447daf,'resourceId':_0x4e99f7['id']}})[_0x6791('0x1c')](function(){return _0x3330ac;});})['then'](function(){_0x3ad0ce[_0x6791('0x27')](0xcc)['end']();});}};}function handleEntityNotFound(_0x31ce37,_0x2ee82a){return function(_0x43737b){if(!_0x43737b){_0x31ce37[_0x6791('0x34')](0x194);}return _0x43737b;};}function handleError(_0x5035aa,_0x111ec7){_0x111ec7=_0x111ec7||0x1f4;return function(_0x4ed39b){logger['error'](_0x4ed39b['stack']);if(_0x4ed39b[_0x6791('0x35')]){delete _0x4ed39b[_0x6791('0x35')];}_0x5035aa['status'](_0x111ec7)['send'](_0x4ed39b);};}exports[_0x6791('0x36')]=function(_0x28be61,_0x2caf1c){var _0x32d023={'include':[{'model':db[_0x6791('0x37')],'as':'mandatoryDispositionPause'}]},_0x3defed={},_0x4ac10b={'count':0x0,'rows':[]};var _0x507cfa=_[_0x6791('0x38')](db[_0x6791('0x39')][_0x6791('0x3a')],function(_0x115bad){return{'name':_0x115bad['fieldName'],'type':_0x115bad[_0x6791('0x3b')][_0x6791('0x3c')]};});_0x3defed['model']=_['map'](_0x507cfa,_0x6791('0x35'));_0x3defed[_0x6791('0x3d')]=_[_0x6791('0x3e')](_0x28be61[_0x6791('0x3d')]);_0x3defed['filters']=_[_0x6791('0x3f')](_0x3defed['model'],_0x3defed[_0x6791('0x3d')]);_0x32d023['attributes']=_[_0x6791('0x3f')](_0x3defed[_0x6791('0x40')],qs[_0x6791('0x41')](_0x28be61[_0x6791('0x3d')][_0x6791('0x41')]));_0x32d023[_0x6791('0x42')]=_0x32d023[_0x6791('0x42')][_0x6791('0x43')]?_0x32d023[_0x6791('0x42')]:_0x3defed[_0x6791('0x40')];if(!_0x28be61[_0x6791('0x3d')]['hasOwnProperty'](_0x6791('0x44'))){_0x32d023[_0x6791('0x2d')]=qs[_0x6791('0x2d')](_0x28be61[_0x6791('0x3d')][_0x6791('0x2d')]);_0x32d023[_0x6791('0x2a')]=qs['offset'](_0x28be61[_0x6791('0x3d')][_0x6791('0x2a')]);}_0x32d023[_0x6791('0x45')]=qs['sort'](_0x28be61['query'][_0x6791('0x46')]);_0x32d023['where']=qs['filters'](_['pick'](_0x28be61[_0x6791('0x3d')],_0x3defed[_0x6791('0x47')]),_0x507cfa);if(_0x28be61[_0x6791('0x3d')][_0x6791('0x48')]){_0x32d023[_0x6791('0x49')]=_['merge'](_0x32d023['where'],{'$or':_[_0x6791('0x38')](_0x507cfa,function(_0x5e2072){if(_0x5e2072['type']!==_0x6791('0x4a')){var _0x5063e3={};_0x5063e3[_0x5e2072[_0x6791('0x35')]]={'$like':'%'+_0x28be61['query']['filter']+'%'};return _0x5063e3;}})});}_0x32d023=_[_0x6791('0x4b')]({},_0x32d023,_0x28be61[_0x6791('0x4c')]);var _0xea0f10={'where':_0x32d023['where']};return db['ChatWebsite']['count'](_0xea0f10)[_0x6791('0x1c')](function(_0x3aa365){_0x4ac10b[_0x6791('0x2c')]=_0x3aa365;if(_0x28be61['query'][_0x6791('0x4d')]){_0x32d023[_0x6791('0x4e')]=[{'all':!![]}];}return db[_0x6791('0x39')]['findAll'](_0x32d023);})[_0x6791('0x1c')](function(_0x135e3b){_0x4ac10b[_0x6791('0x4f')]=_0x135e3b;return _0x4ac10b;})[_0x6791('0x1c')](respondWithFilteredResult(_0x2caf1c,_0x32d023))['catch'](handleError(_0x2caf1c,null));};exports[_0x6791('0x50')]=function(_0x222a2f,_0x56db37){var _0x4329e9={'raw':![],'where':{'id':_0x222a2f['params']['id']},'include':[{'model':db[_0x6791('0x37')],'as':_0x6791('0x51')}]},_0x13b1ae={};_0x13b1ae['model']=_[_0x6791('0x3e')](db[_0x6791('0x39')][_0x6791('0x3a')]);_0x13b1ae['query']=_[_0x6791('0x3e')](_0x222a2f[_0x6791('0x3d')]);_0x13b1ae[_0x6791('0x47')]=_[_0x6791('0x3f')](_0x13b1ae[_0x6791('0x40')],_0x13b1ae[_0x6791('0x3d')]);_0x4329e9[_0x6791('0x42')]=_['intersection'](_0x13b1ae[_0x6791('0x40')],qs[_0x6791('0x41')](_0x222a2f[_0x6791('0x3d')]['fields']));_0x4329e9[_0x6791('0x42')]=_0x4329e9[_0x6791('0x42')][_0x6791('0x43')]?_0x4329e9['attributes']:_0x13b1ae['model'];if(_0x222a2f['query'][_0x6791('0x4d')]){_0x4329e9[_0x6791('0x4e')]=[{'all':!![]}];}_0x4329e9=_['merge']({},_0x4329e9,_0x222a2f[_0x6791('0x4c')]);return db['ChatWebsite'][_0x6791('0x52')](_0x4329e9)[_0x6791('0x1c')](handleEntityNotFound(_0x56db37,null))[_0x6791('0x1c')](respondWithResult(_0x56db37,null))['catch'](handleError(_0x56db37,null));};exports[_0x6791('0x53')]=function(_0x4d4a29,_0x2bcfea){return db['ChatWebsite']['create'](_0x4d4a29[_0x6791('0x54')],{})[_0x6791('0x1c')](function(_0x49139b){var _0x55b756=_0x4d4a29[_0x6791('0x55')][_0x6791('0x33')]({'plain':!![]});if(!_0x55b756)throw new Error(_0x6791('0x56'));if(_0x55b756['role']===_0x6791('0x55')){var _0x384e98=_0x49139b[_0x6791('0x33')]({'plain':!![]});var _0x5cbe0b='ChatWebsites';return db['UserProfileSection'][_0x6791('0x52')]({'where':{'name':_0x5cbe0b,'userProfileId':_0x55b756[_0x6791('0x57')]},'raw':!![]})['then'](function(_0x3bf1d8){if(_0x3bf1d8&&_0x3bf1d8[_0x6791('0x58')]===0x0){return db[_0x6791('0x59')]['create']({'name':_0x384e98[_0x6791('0x35')],'resourceId':_0x384e98['id'],'type':_0x3bf1d8[_0x6791('0x35')],'sectionId':_0x3bf1d8['id']},{})['then'](function(){return _0x49139b;});}else{return _0x49139b;}})[_0x6791('0x26')](function(_0x452409){logger['error'](_0x6791('0x5a'),_0x452409);throw _0x452409;});}return _0x49139b;})[_0x6791('0x1c')](respondWithResult(_0x2bcfea,0xc9))['catch'](handleError(_0x2bcfea,null));};exports[_0x6791('0x5b')]=function(_0x44dbdf,_0x1c9a9e){if(_0x44dbdf[_0x6791('0x54')]['id']){delete _0x44dbdf[_0x6791('0x54')]['id'];}return db[_0x6791('0x39')]['find']({'where':{'id':_0x44dbdf[_0x6791('0x5c')]['id']},'include':[{'model':db[_0x6791('0x37')],'as':_0x6791('0x51')}]})[_0x6791('0x1c')](handleEntityNotFound(_0x1c9a9e,null))[_0x6791('0x1c')](saveUpdates(_0x44dbdf['body'],null))[_0x6791('0x1c')](respondWithResult(_0x1c9a9e,null))[_0x6791('0x26')](handleError(_0x1c9a9e,null));};exports[_0x6791('0x32')]=function(_0x1b8f72,_0x44b814){return db[_0x6791('0x39')][_0x6791('0x52')]({'where':{'id':_0x1b8f72['params']['id']}})['then'](handleEntityNotFound(_0x44b814,null))['then'](removeEntity(_0x44b814,null))['catch'](handleError(_0x44b814,null));};exports[_0x6791('0x5d')]=function(_0x4b182c,_0x2d772b){return db[_0x6791('0x39')][_0x6791('0x5d')]()['then'](respondWithResult(_0x2d772b,null))[_0x6791('0x26')](handleError(_0x2d772b,null));};exports['addDisposition']=function(_0x328644,_0x3eafa1,_0x22cfc3){if(_0x328644[_0x6791('0x54')]['id']){delete _0x328644[_0x6791('0x54')]['id'];}return db[_0x6791('0x39')]['find']({'where':{'id':_0x328644[_0x6791('0x5c')]['id']}})['then'](handleEntityNotFound(_0x3eafa1,null))['then'](function(_0x3f142b){if(_0x3f142b){_0x328644['body'][_0x6791('0x5e')]=_0x3f142b['id'];return db[_0x6791('0x5f')][_0x6791('0x53')](_0x328644['body']);}})[_0x6791('0x1c')](respondWithResult(_0x3eafa1,null))[_0x6791('0x26')](handleError(_0x3eafa1,null));};exports[_0x6791('0x60')]=function(_0x2c756e,_0x20dcc1,_0x5d7585){var _0x1e444a={'raw':![],'where':{}};var _0x1617df={};var _0x2d4903={'count':0x0,'rows':[]};return db[_0x6791('0x39')]['findOne']({'where':{'id':_0x2c756e[_0x6791('0x5c')]['id']}})[_0x6791('0x1c')](handleEntityNotFound(_0x20dcc1,null))[_0x6791('0x1c')](function(_0x53914a){if(_0x53914a){_0x1617df[_0x6791('0x40')]=_['keys'](db[_0x6791('0x5f')][_0x6791('0x3a')]);_0x1617df[_0x6791('0x3d')]=_['keys'](_0x2c756e['query']);_0x1617df['filters']=_[_0x6791('0x3f')](_0x1617df[_0x6791('0x40')],_0x1617df['query']);_0x1e444a[_0x6791('0x42')]=_[_0x6791('0x3f')](_0x1617df[_0x6791('0x40')],qs[_0x6791('0x41')](_0x2c756e[_0x6791('0x3d')][_0x6791('0x41')]));_0x1e444a[_0x6791('0x42')]=_0x1e444a['attributes']['length']?_0x1e444a[_0x6791('0x42')]:_0x1617df[_0x6791('0x40')];if(!_0x2c756e[_0x6791('0x3d')][_0x6791('0x61')](_0x6791('0x44'))){_0x1e444a[_0x6791('0x2d')]=qs['limit'](_0x2c756e[_0x6791('0x3d')][_0x6791('0x2d')]);_0x1e444a['offset']=qs[_0x6791('0x2a')](_0x2c756e[_0x6791('0x3d')][_0x6791('0x2a')]);}_0x1e444a[_0x6791('0x45')]=qs[_0x6791('0x46')](_0x2c756e[_0x6791('0x3d')][_0x6791('0x46')]);_0x1e444a[_0x6791('0x49')]=qs[_0x6791('0x47')](_[_0x6791('0x62')](_0x2c756e['query'],_0x1617df[_0x6791('0x47')]));_0x1e444a[_0x6791('0x49')][_0x6791('0x5e')]=_0x53914a['id'];if(_0x2c756e[_0x6791('0x3d')][_0x6791('0x48')]){_0x1e444a[_0x6791('0x49')]=_[_0x6791('0x4b')](_0x1e444a[_0x6791('0x49')],{'$or':_[_0x6791('0x38')](_0x1e444a['attributes'],function(_0x289bb3){var _0x2ca39c={};_0x2ca39c[_0x289bb3]={'$like':'%'+_0x2c756e[_0x6791('0x3d')][_0x6791('0x48')]+'%'};return _0x2ca39c;})});}_0x1e444a=_[_0x6791('0x4b')]({},_0x1e444a,_0x2c756e[_0x6791('0x4c')]);return db[_0x6791('0x5f')][_0x6791('0x2c')]({'where':_0x1e444a[_0x6791('0x49')]})[_0x6791('0x1c')](function(_0x398025){_0x2d4903['count']=_0x398025;if(_0x2c756e['query'][_0x6791('0x4d')]){_0x1e444a['include']=[{'all':!![]}];}return db[_0x6791('0x5f')]['findAll'](_0x1e444a);})[_0x6791('0x1c')](function(_0x2810c5){_0x2d4903[_0x6791('0x4f')]=_0x2810c5;return _0x2d4903;});}})[_0x6791('0x1c')](respondWithFilteredResult(_0x20dcc1,_0x1e444a))['catch'](handleError(_0x20dcc1,null));};exports[_0x6791('0x63')]=function(_0x558c60,_0x48380d,_0x418ea6){return db['ChatWebsite']['find']({'where':{'id':_0x558c60[_0x6791('0x5c')]['id']}})[_0x6791('0x1c')](handleEntityNotFound(_0x48380d,null))[_0x6791('0x1c')](function(_0x26739b){if(_0x26739b){return _0x26739b[_0x6791('0x63')](_0x558c60[_0x6791('0x3d')][_0x6791('0x64')]);}})[_0x6791('0x1c')](respondWithStatusCode(_0x48380d,null))[_0x6791('0x26')](handleError(_0x48380d,null));};exports[_0x6791('0x65')]=function(_0x45218d,_0x4f93dc,_0x50d9f5){if(_0x45218d[_0x6791('0x54')]['id']){delete _0x45218d[_0x6791('0x54')]['id'];}return db[_0x6791('0x39')][_0x6791('0x52')]({'where':{'id':_0x45218d[_0x6791('0x5c')]['id']}})[_0x6791('0x1c')](handleEntityNotFound(_0x4f93dc,null))[_0x6791('0x1c')](function(_0x1b9b91){if(_0x1b9b91){_0x45218d[_0x6791('0x54')][_0x6791('0x5e')]=_0x1b9b91['id'];return db[_0x6791('0x66')]['create'](_0x45218d[_0x6791('0x54')]);}})['then'](respondWithResult(_0x4f93dc,null))['catch'](handleError(_0x4f93dc,null));};exports['getAnswers']=function(_0x474523,_0x21067c,_0xa0878f){var _0x548505={'raw':![],'where':{}};var _0x26c14b={};var _0x441217={'count':0x0,'rows':[]};return db[_0x6791('0x39')]['findOne']({'where':{'id':_0x474523[_0x6791('0x5c')]['id']}})[_0x6791('0x1c')](handleEntityNotFound(_0x21067c,null))[_0x6791('0x1c')](function(_0x138c57){if(_0x138c57){_0x26c14b['model']=_[_0x6791('0x3e')](db['CannedAnswer'][_0x6791('0x3a')]);_0x26c14b[_0x6791('0x3d')]=_[_0x6791('0x3e')](_0x474523['query']);_0x26c14b[_0x6791('0x47')]=_[_0x6791('0x3f')](_0x26c14b['model'],_0x26c14b[_0x6791('0x3d')]);_0x548505[_0x6791('0x42')]=_['intersection'](_0x26c14b[_0x6791('0x40')],qs[_0x6791('0x41')](_0x474523[_0x6791('0x3d')][_0x6791('0x41')]));_0x548505[_0x6791('0x42')]=_0x548505[_0x6791('0x42')][_0x6791('0x43')]?_0x548505[_0x6791('0x42')]:_0x26c14b[_0x6791('0x40')];if(!_0x474523[_0x6791('0x3d')][_0x6791('0x61')]('nolimit')){_0x548505[_0x6791('0x2d')]=qs[_0x6791('0x2d')](_0x474523[_0x6791('0x3d')][_0x6791('0x2d')]);_0x548505[_0x6791('0x2a')]=qs['offset'](_0x474523[_0x6791('0x3d')][_0x6791('0x2a')]);}_0x548505[_0x6791('0x45')]=qs[_0x6791('0x46')](_0x474523[_0x6791('0x3d')][_0x6791('0x46')]);_0x548505['where']=qs['filters'](_[_0x6791('0x62')](_0x474523['query'],_0x26c14b[_0x6791('0x47')]));_0x548505[_0x6791('0x49')][_0x6791('0x5e')]=_0x138c57['id'];if(_0x474523[_0x6791('0x3d')][_0x6791('0x48')]){_0x548505[_0x6791('0x49')]=_[_0x6791('0x4b')](_0x548505[_0x6791('0x49')],{'$or':_[_0x6791('0x38')](_0x548505[_0x6791('0x42')],function(_0x43c436){var _0x28f873={};_0x28f873[_0x43c436]={'$like':'%'+_0x474523[_0x6791('0x3d')][_0x6791('0x48')]+'%'};return _0x28f873;})});}_0x548505=_[_0x6791('0x4b')]({},_0x548505,_0x474523[_0x6791('0x4c')]);return db['CannedAnswer']['count']({'where':_0x548505['where']})['then'](function(_0x1658d9){_0x441217[_0x6791('0x2c')]=_0x1658d9;if(_0x474523[_0x6791('0x3d')]['includeAll']){_0x548505[_0x6791('0x4e')]=[{'all':!![]}];}return db[_0x6791('0x66')][_0x6791('0x67')](_0x548505);})[_0x6791('0x1c')](function(_0x5b01a9){_0x441217[_0x6791('0x4f')]=_0x5b01a9;return _0x441217;});}})['then'](respondWithFilteredResult(_0x21067c,_0x548505))['catch'](handleError(_0x21067c,null));};exports[_0x6791('0x68')]=function(_0x4a8d6f,_0x1bf8ce,_0x3b08b5){return db[_0x6791('0x39')][_0x6791('0x52')]({'where':{'id':_0x4a8d6f[_0x6791('0x5c')]['id']}})[_0x6791('0x1c')](handleEntityNotFound(_0x1bf8ce,null))[_0x6791('0x1c')](function(_0x415bb1){if(_0x415bb1){return _0x415bb1[_0x6791('0x68')](_0x4a8d6f[_0x6791('0x3d')][_0x6791('0x64')]);}})[_0x6791('0x1c')](respondWithStatusCode(_0x1bf8ce,null))[_0x6791('0x26')](handleError(_0x1bf8ce,null));};exports['addLogo']=function(_0x4cb65b,_0x124dbd,_0x3eb49f){_0x4cb65b[_0x6791('0x54')]['sitepic']=_0x4cb65b[_0x6791('0x69')]['filename'];return db[_0x6791('0x39')][_0x6791('0x52')]({'where':{'id':_0x4cb65b[_0x6791('0x5c')]['id']}})['then'](handleEntityNotFound(_0x124dbd,null))[_0x6791('0x1c')](saveUpdates(_0x4cb65b[_0x6791('0x54')],null))[_0x6791('0x1c')](respondWithResult(_0x124dbd,null))[_0x6791('0x26')](handleError(_0x124dbd,null));};exports[_0x6791('0x6a')]=function(_0x2f14bb,_0x456e99,_0x352fb1){_0x2f14bb[_0x6791('0x54')]['agentAvatar']=_0x2f14bb['file'][_0x6791('0x6b')];return db[_0x6791('0x39')][_0x6791('0x52')]({'where':{'id':_0x2f14bb['params']['id']}})[_0x6791('0x1c')](handleEntityNotFound(_0x456e99,null))[_0x6791('0x1c')](saveUpdates(_0x2f14bb[_0x6791('0x54')],null))[_0x6791('0x1c')](respondWithResult(_0x456e99,null))['catch'](handleError(_0x456e99,null));};exports[_0x6791('0x6c')]=function(_0x2e073f,_0x2148e6,_0x287156){_0x2e073f[_0x6791('0x54')][_0x6791('0x6d')]=_0x2e073f[_0x6791('0x69')][_0x6791('0x6b')];return db['ChatWebsite'][_0x6791('0x52')]({'where':{'id':_0x2e073f['params']['id']}})[_0x6791('0x1c')](handleEntityNotFound(_0x2148e6,null))['then'](saveUpdates(_0x2e073f['body'],null))[_0x6791('0x1c')](respondWithResult(_0x2148e6,null))[_0x6791('0x26')](handleError(_0x2148e6,null));};exports[_0x6791('0x6e')]=function(_0x11ff00,_0x2ec864,_0x54774d){_0x11ff00[_0x6791('0x54')][_0x6791('0x6f')]=_0x11ff00[_0x6791('0x69')][_0x6791('0x6b')];return db[_0x6791('0x39')][_0x6791('0x52')]({'where':{'id':_0x11ff00[_0x6791('0x5c')]['id']}})[_0x6791('0x1c')](handleEntityNotFound(_0x2ec864,null))[_0x6791('0x1c')](saveUpdates(_0x11ff00[_0x6791('0x54')],null))[_0x6791('0x1c')](respondWithResult(_0x2ec864,null))['catch'](handleError(_0x2ec864,null));};exports[_0x6791('0x70')]=function(_0x19fa1d,_0x73d32b,_0x363b46){var _0x5b03c0=path[_0x6791('0x71')](config[_0x6791('0x72')],_0x6791('0x73'));var _0x5bbad9={'where':{'id':_0x19fa1d[_0x6791('0x5c')]['id']},'attributes':['id',_0x6791('0x74')],'raw':!![]};var _0x599689=![];return require(_0x6791('0x14'))[_0x6791('0x75')]()[_0x6791('0x1c')](function(_0x227504){if(_0x227504){_0x599689=_0x227504[_0x6791('0x76')];}})[_0x6791('0x1c')](function(){return db['ChatWebsite'][_0x6791('0x52')](_0x5bbad9);})[_0x6791('0x1c')](handleEntityNotFound(_0x73d32b,null))[_0x6791('0x1c')](function(_0x599459){if(_0x599459){if(!_[_0x6791('0x77')](_0x599459[_0x6791('0x74')])){if(fs[_0x6791('0x78')](path[_0x6791('0x71')](config[_0x6791('0x72')],_0x6791('0x79'),_0x599459[_0x6791('0x74')]))&&_0x599689){_0x5b03c0=path[_0x6791('0x71')](config[_0x6791('0x72')],_0x6791('0x79'),_0x599459[_0x6791('0x74')]);}}return _0x73d32b['download'](_0x5b03c0);}})[_0x6791('0x26')](handleError(_0x73d32b,null));};exports['getAvatar']=function(_0x491435,_0x24900b,_0x3e4728){var _0xdcd5b4=path[_0x6791('0x71')](config[_0x6791('0x72')],_0x6791('0x7a'));var _0xc3f181={'where':{'id':_0x491435['params']['id']},'attributes':['id',_0x6791('0x7b')],'raw':!![]};return db['ChatWebsite'][_0x6791('0x52')](_0xc3f181)['then'](handleEntityNotFound(_0x24900b,null))[_0x6791('0x1c')](function(_0x26480a){if(_0x26480a){if(!_[_0x6791('0x77')](_0x26480a[_0x6791('0x7b')])){if(fs['existsSync'](path[_0x6791('0x71')](config['root'],'server/files/images/avatars/',_0x26480a[_0x6791('0x7b')]))){_0xdcd5b4=path[_0x6791('0x71')](config[_0x6791('0x72')],_0x6791('0x7c'),_0x26480a[_0x6791('0x7b')]);}}return _0x24900b[_0x6791('0x7d')](_0xdcd5b4);}})['catch'](handleError(_0x24900b,null));};exports[_0x6791('0x7e')]=function(_0x56dcbf,_0x3fe214,_0x313e06){var _0x18f6c2=path['join'](config[_0x6791('0x72')],_0x6791('0x7f'));var _0x4142a8={'where':{'id':_0x56dcbf[_0x6791('0x5c')]['id']},'attributes':['id',_0x6791('0x6d'),_0x6791('0x80')],'raw':!![]};return db[_0x6791('0x39')][_0x6791('0x52')](_0x4142a8)[_0x6791('0x1c')](handleEntityNotFound(_0x3fe214,null))['then'](function(_0x1c6111){if(_0x1c6111){if(!_[_0x6791('0x77')](_0x1c6111[_0x6791('0x6d')])){if(fs[_0x6791('0x78')](path[_0x6791('0x71')](config['root'],_0x6791('0x7c'),_0x1c6111[_0x6791('0x6d')]))&&_0x1c6111[_0x6791('0x80')]){_0x18f6c2=path['join'](config[_0x6791('0x72')],_0x6791('0x7c'),_0x1c6111[_0x6791('0x6d')]);}}return _0x3fe214[_0x6791('0x7d')](_0x18f6c2);}})[_0x6791('0x26')](handleError(_0x3fe214,null));};exports[_0x6791('0x81')]=function(_0x180573,_0x4a832a,_0x1727ca){var _0x4f3efc=path['join'](config[_0x6791('0x72')],_0x6791('0x82'));var _0x38fc31={'where':{'id':_0x180573['params']['id']},'attributes':['id',_0x6791('0x6f')],'raw':!![]};return db[_0x6791('0x39')][_0x6791('0x52')](_0x38fc31)[_0x6791('0x1c')](handleEntityNotFound(_0x4a832a,null))[_0x6791('0x1c')](function(_0x184d9e){if(_0x184d9e){if(!_[_0x6791('0x77')](_0x184d9e[_0x6791('0x6f')])){if(fs[_0x6791('0x78')](path[_0x6791('0x71')](config[_0x6791('0x72')],'server/files/images/avatars/',_0x184d9e[_0x6791('0x6f')]))){_0x4f3efc=path['join'](config[_0x6791('0x72')],_0x6791('0x7c'),_0x184d9e[_0x6791('0x6f')]);}}return _0x4a832a['download'](_0x4f3efc);}})['catch'](handleError(_0x4a832a,null));};exports['notify']=function(_0x2397e6,_0x3e8fd7,_0x2aa8b0){var _0x4f71c6=require('user-agent-parser');var _0x9f962c=new _0x4f71c6();var _0xa2a2=_0x9f962c[_0x6791('0x83')](_0x2397e6[_0x6791('0x84')][_0x6791('0x85')])[_0x6791('0x86')]();var _0x587171={'body':_0x2397e6[_0x6791('0x54')],'channel':'chat'};var _0x46269f=[];var _0x19cd1b=[];var _0x47c852={};var _0x67b3dd=![];return db[_0x6791('0x87')]['describe']()[_0x6791('0x1c')](function(_0x1ba72a){if(!_0x1ba72a){throw new db['Sequelize'][(_0x6791('0x88'))](_0x6791('0x89'));}_0x46269f=_[_0x6791('0x8a')](_[_0x6791('0x3e')](_0x1ba72a),['createdAt',_0x6791('0x8b')]);_0x19cd1b=_[_0x6791('0x8a')](_[_0x6791('0x3e')](_0x1ba72a),['createdAt',_0x6791('0x8b'),_0x6791('0x8c'),_0x6791('0x8d')]);if(_0x2397e6[_0x6791('0x54')]['id']){delete _0x2397e6[_0x6791('0x54')]['id'];}if(_[_0x6791('0x77')](_0x2397e6['body']['from'])){throw new db[(_0x6791('0x8e'))][(_0x6791('0x88'))]('from\x20is\x20mandatory');}if(_[_0x6791('0x77')](_0x2397e6[_0x6791('0x54')]['body'])||_0x2397e6['body']['body']===''){throw new db[(_0x6791('0x8e'))][(_0x6791('0x88'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x6791('0x77')](_0x2397e6[_0x6791('0x54')][_0x6791('0x8f')])){throw new db[(_0x6791('0x8e'))][(_0x6791('0x88'))](_0x6791('0x90')+_0x19cd1b);}if(!_[_0x6791('0x91')](_0x19cd1b,_0x2397e6[_0x6791('0x54')][_0x6791('0x8f')])){throw new db['Sequelize']['ValidationError']('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x19cd1b);}_0x47c852[_0x2397e6[_0x6791('0x54')][_0x6791('0x8f')]]=_0x2397e6[_0x6791('0x54')][_0x6791('0x92')];})[_0x6791('0x1c')](function(){return db[_0x6791('0x39')]['find']({'where':{'id':_0x2397e6[_0x6791('0x5c')]['id']},'include':[{'model':db['CmList'],'as':_0x6791('0x93'),'include':[{'model':db[_0x6791('0x87')],'as':_0x6791('0x94'),'where':_0x47c852,'limit':0x1,'order':[[_0x6791('0x8b'),_0x6791('0x95')]]}]},{'model':db[_0x6791('0x96')],'as':'Applications'}]});})[_0x6791('0x1c')](handleEntityNotFound(_0x3e8fd7,null))['then'](function(_0x527c67){if(_0x527c67&&_0x527c67['List']){_0x587171[_0x6791('0x97')]=_0x527c67;_0x587171['applications']=_0x527c67['Applications'];_0x587171[_0x6791('0x98')]=_0x527c67[_0x6791('0x93')];_0x587171[_0x6791('0x99')]=_[_0x6791('0x9a')](_0x587171[_0x6791('0x99')],[_0x6791('0x9b')],[_0x6791('0x9c')]);if(_0x587171[_0x6791('0x97')][_0x6791('0x9d')]){delete _0x587171[_0x6791('0x97')][_0x6791('0x9d')];}if(_0x587171[_0x6791('0x97')]['List']&&_0x587171['account'][_0x6791('0x93')][_0x6791('0x94')][_0x6791('0x43')]){return _0x587171[_0x6791('0x97')][_0x6791('0x93')][_0x6791('0x94')][0x0];}var _0x3b05cd=_[_0x6791('0x9e')](_0x2397e6['body'],{'firstName':_0x2397e6[_0x6791('0x54')]['from'],'ListId':_0x527c67[_0x6791('0x8d')]});_0x3b05cd[_0x2397e6['body'][_0x6791('0x8f')]]=_0x2397e6[_0x6791('0x54')][_0x6791('0x92')];return db['CmContact'][_0x6791('0x53')](_0x3b05cd,{'fields':_0x46269f,'raw':!![]});}})['then'](handleEntityNotFound(_0x3e8fd7,null))[_0x6791('0x1c')](function(_0x22f71a){_0x587171[_0x6791('0x9f')]=_0x22f71a;var _0x1a3724=_0x2397e6[_0x6791('0x54')][_0x6791('0xa0')];if(_0x2397e6['headers'][_0x6791('0xa1')]){_0x1a3724=_0x2397e6[_0x6791('0x84')]['cf-connecting-ip'];}else if(_0x2397e6[_0x6791('0x84')]['x-forwarded-for']){_0x1a3724=_['first'](_0x2397e6[_0x6791('0x84')][_0x6791('0xa2')][_0x6791('0xa3')](','));}if(_0x22f71a){var _0x1c7db5={'ContactId':_0x22f71a['id'],'ChatWebsiteId':_0x2397e6[_0x6791('0x5c')]['id'],'from':(_0x22f71a[_0x6791('0xa4')]||'')+'\x20'+(_0x22f71a[_0x6791('0xa5')]||''),'customerIp':_0x1a3724,'customerPort':_0x2397e6[_0x6791('0x84')][_0x6791('0xa6')]?_0x2397e6[_0x6791('0x84')][_0x6791('0xa6')]:null,'referer':_0x2397e6[_0x6791('0x54')][_0x6791('0xa7')],'browserName':_0xa2a2[_0x6791('0xa8')][_0x6791('0x35')]&&_0xa2a2['browser'][_0x6791('0xa9')]?util[_0x6791('0xaa')](_0x6791('0xab'),_0xa2a2['browser'][_0x6791('0x35')],_0xa2a2[_0x6791('0xa8')]['version']):_0x6791('0xac'),'browserVersion':_0xa2a2[_0x6791('0xa8')][_0x6791('0xa9')]||'unknown','osName':util[_0x6791('0xaa')](_0x6791('0xab'),_0xa2a2['os'][_0x6791('0x35')],_0xa2a2['os']['version']),'osVersion':_0xa2a2['os'][_0x6791('0xa9')],'deviceModel':_0xa2a2[_0x6791('0xad')]['model']&&_0xa2a2[_0x6791('0xad')][_0x6791('0xae')]?util[_0x6791('0xaa')](_0x6791('0xaf'),_0xa2a2[_0x6791('0xad')]['model'],_0xa2a2[_0x6791('0xad')][_0x6791('0xae')],_0xa2a2['device'][_0x6791('0x3b')]):null,'deviceVendor':_0xa2a2[_0x6791('0xad')][_0x6791('0xae')],'deviceType':_0xa2a2[_0x6791('0xad')]['type'],'formData':JSON['stringify'](_0x2397e6[_0x6791('0x54')])};var _0x55648d={'ChatWebsiteId':_0x2397e6['params']['id'],'closed':![]};if(_0x2397e6['body']['threadId']){_0x55648d[_0x6791('0xb0')]=_0x2397e6[_0x6791('0x54')][_0x6791('0xb0')];return db[_0x6791('0xb1')][_0x6791('0x52')]({'where':_0x55648d})[_0x6791('0x1c')](function(_0xfb549){if(_0xfb549){return[_0xfb549,![]];}_0x1c7db5[_0x6791('0xb0')]=_0x2397e6[_0x6791('0x54')][_0x6791('0xb0')];_0x1c7db5[_0x6791('0xb2')]=_0x2397e6[_0x6791('0x54')]['externalUrl'];return db[_0x6791('0xb1')]['create'](_0x1c7db5)['then'](function(_0x49d6e7){return[_0x49d6e7,!![]];});});}_0x55648d[_0x6791('0xb3')]=_0x22f71a['id'];if(_0x2397e6[_0x6791('0x54')][_0x6791('0xb4')]&&_0x2397e6['body'][_0x6791('0xb4')]['id']){_0x55648d['id']=_0x2397e6['body']['interaction']['id'];return db[_0x6791('0xb1')][_0x6791('0x52')]({'where':_0x55648d})[_0x6791('0x1c')](function(_0x576a14){if(_0x576a14){return[_0x576a14,![]];}return db[_0x6791('0xb1')]['create'](_0x1c7db5)[_0x6791('0x1c')](function(_0x287a6c){return[_0x287a6c,!![]];});});}return db[_0x6791('0xb1')][_0x6791('0x53')](_0x1c7db5)['then'](function(_0x4b4990){return[_0x4b4990,!![]];});}})['spread'](function(_0xa0de0b,_0x4009b6){if(_0xa0de0b){_0x67b3dd=_0x4009b6;if(!_0x4009b6){var _0x240bcd={'from':(_0x587171[_0x6791('0x9f')][_0x6791('0xa4')]||'')+'\x20'+(_0x587171[_0x6791('0x9f')][_0x6791('0xa5')]||'')};if(_0x2397e6['body'][_0x6791('0xb0')]&&_0x2397e6[_0x6791('0x54')][_0x6791('0xb5')]&&_0x2397e6[_0x6791('0x54')]['threadId']!=_0x2397e6[_0x6791('0x54')][_0x6791('0xb5')]){_0x240bcd['threadId']=_0x2397e6[_0x6791('0x54')][_0x6791('0xb5')];}return _0xa0de0b[_0x6791('0x5b')](_0x240bcd);}else{return _0xa0de0b;}}})[_0x6791('0x1c')](function(_0x32a59d){_0x587171['interaction']=_0x32a59d[_0x6791('0x33')]({'plain':!![]});_0x587171['interaction'][_0x6791('0xb6')]=_0x67b3dd;if(_0x587171[_0x6791('0xb4')]['created']){if(_0x587171['account'][_0x6791('0xb7')]){_0x587171[_0x6791('0x99')]['push']({'id':0x0,'priority':_0x587171['applications'][_0x6791('0x43')]+0x1,'app':_0x6791('0xb8'),'appdata':_0x6791('0xb9'),'interval':_0x6791('0xba')});}}return db[_0x6791('0xbb')]['create']({'body':_0x2397e6[_0x6791('0x54')][_0x6791('0x54')],'ChatWebsiteId':_0x2397e6['params']['id'],'ChatInteractionId':_0x32a59d['id'],'direction':'in','ContactId':_0x587171[_0x6791('0x9f')]['id'],'AttachmentId':_0x2397e6[_0x6791('0x54')]['AttachmentId']});})[_0x6791('0x1c')](function(_0x1e2cc0){_0x587171[_0x6791('0x24')]=_0x1e2cc0;if(_0x587171['interaction'][_0x6791('0xbc')]){return db[_0x6791('0xbd')]['find']({'attributes':['id',_0x6791('0x35')],'where':{'id':_0x587171[_0x6791('0xb4')][_0x6791('0xbc')]}})[_0x6791('0x1c')](function(_0x1ff139){if(_0x1ff139){_0x587171[_0x6791('0x99')][_0x6791('0xbe')]({'id':0x0,'priority':0x0,'app':_0x6791('0xbf'),'appdata':_0x1ff139[_0x6791('0x35')]+','+(_0x587171[_0x6791('0x97')][_0x6791('0xc0')]||0xa),'interval':'*,*,*,*'});_0x587171[_0x6791('0xc1')]=!![];}return respondWithRpcPromise('Start',_0x6791('0xc2'),_0x587171);});}return respondWithRpcPromise(_0x6791('0xc3'),_0x6791('0xc2'),_0x587171);})[_0x6791('0x1c')](function(_0x582d16){respondWithRpcPromise(_0x6791('0xc4'),'EventManager',{'event':_0x6791('0xc5'),'message':_0x582d16},client9002);return _0x582d16;})[_0x6791('0x1c')](respondWithResult(_0x3e8fd7,null))[_0x6791('0x26')](handleError(_0x3e8fd7,null));};exports[_0x6791('0xc6')]=function(_0x40da32,_0x4bbed2,_0x16c9c9){var _0x60c114,_0x4d598f,_0x26acc1;var _0x3efc09=[];var _0x44839a=[];var _0x4c9622={};var _0x4b2f2a=_0x40da32[_0x6791('0xc7')]||[];var _0x3fcfea=[];var _0x4002c8;return db[_0x6791('0x87')][_0x6791('0x5d')]()['then'](function(_0x48b244){if(!_0x48b244){throw new db[(_0x6791('0x8e'))][(_0x6791('0x88'))](_0x6791('0x89'));}_0x44839a=_[_0x6791('0x8a')](_['keys'](_0x48b244),[_0x6791('0xc8'),_0x6791('0x8b')]);_0x3efc09=_[_0x6791('0x8a')](_[_0x6791('0x3e')](_0x48b244),['createdAt',_0x6791('0x8b'),'CompanyId',_0x6791('0x8d')]);if(_0x40da32[_0x6791('0x54')]['id']){delete _0x40da32[_0x6791('0x54')]['id'];}if(_[_0x6791('0x77')](_0x40da32[_0x6791('0x54')][_0x6791('0x92')])){throw _0x4bbed2['status'](0x1f4)[_0x6791('0xc9')](new db[(_0x6791('0x8e'))][(_0x6791('0x88'))](_0x6791('0xca')));}if(_[_0x6791('0x77')](_0x40da32['body']['body'])||_0x40da32['body']['body']===''){throw _0x4bbed2[_0x6791('0x27')](0x1f4)[_0x6791('0xc9')](new db['Sequelize'][(_0x6791('0x88'))](_0x6791('0xcb')));}if(_[_0x6791('0x77')](_0x40da32[_0x6791('0x54')][_0x6791('0xcc')])){throw _0x4bbed2[_0x6791('0x27')](0x1f4)[_0x6791('0xc9')](new db[(_0x6791('0x8e'))][(_0x6791('0x88'))]('mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x3efc09));}if(!_[_0x6791('0x91')](_0x3efc09,_0x40da32[_0x6791('0x54')][_0x6791('0xcc')])){throw _0x4bbed2['status'](0x1f4)[_0x6791('0xc9')](new db[(_0x6791('0x8e'))][(_0x6791('0x88'))](_0x6791('0xcd')+_0x3efc09));}_0x4c9622[_0x40da32[_0x6791('0x54')]['mapKeyOffline']]=_0x40da32[_0x6791('0x54')][_0x6791('0x92')];})['then'](function(){return db[_0x6791('0x39')][_0x6791('0x52')]({'where':{'id':_0x40da32['params']['id']},'include':[{'model':db[_0x6791('0xce')],'as':_0x6791('0x93')},{'model':db['MailAccount'],'as':_0x6791('0xcf')}]});})[_0x6791('0x1c')](handleEntityNotFound(_0x4bbed2,null))[_0x6791('0x1c')](function(_0x54c498){if(_0x54c498&&_0x54c498[_0x6791('0x93')]){_0x4d598f=_0x54c498;var _0x102d46=_['defaults'](_0x40da32[_0x6791('0x54')],{'firstName':_0x40da32[_0x6791('0x54')][_0x6791('0x92')],'phone':_0x40da32['body'][_0x6791('0x92')],'ListId':_0x54c498[_0x6791('0x8d')]});_0x102d46[_0x40da32[_0x6791('0x54')]['mapKeyOffline']]=_0x40da32[_0x6791('0x54')][_0x6791('0x92')];return db['CmContact'][_0x6791('0xd0')]({'where':_0x4c9622,'defaults':_0x102d46});}})[_0x6791('0xd1')](function(_0x1662a5){if(_0x1662a5){_0x26acc1=_0x1662a5;var _0x1eb4a9=fs[_0x6791('0xd2')](path[_0x6791('0x71')](config[_0x6791('0x72')],_0x6791('0xd3')),_0x6791('0xd4'));var _0x20e930=ejs[_0x6791('0xd5')](_0x1eb4a9,{'body':_[_0x6791('0xd6')](_0x40da32[_0x6791('0x54')][_0x6791('0x54')]),'bodyTitle':_0x4d598f[_0x6791('0xd7')]});return db[_0x6791('0xd8')][_0x6791('0x53')]({'body':_0x20e930,'ContactId':_0x1662a5['id'],'ChatWebsiteId':_0x4d598f['id']});}})[_0x6791('0x1c')](function(_0x955bf6){_0x4002c8=_0x955bf6;if(_0x4b2f2a[_0x6791('0x43')]){var _0x11accd=_0x4b2f2a[_0x6791('0x38')](function(_0x246d7f){return{'name':_0x246d7f[_0x6791('0xd9')],'basename':_0x246d7f['filename'],'type':_0x246d7f[_0x6791('0xda')],'ChatOfflineMessageId':_0x955bf6['id']};});_0x3fcfea=_0x11accd[_0x6791('0x38')](_0x26958d=>{var _0x2549f5={'filename':_0x26958d[_0x6791('0x35')],'path':path[_0x6791('0x71')](config[_0x6791('0x72')],_0x6791('0xdb'),_0x6791('0xc7'),_0x6791('0xdc'),_0x6791('0xdd'),_0x26958d[_0x6791('0xde')])};return _0x2549f5;});if(!_0x4d598f[_0x6791('0xdf')]){return db[_0x6791('0xe0')][_0x6791('0xe1')](function(_0x4eb1b3){return db[_0x6791('0xe2')][_0x6791('0xe3')](_0x11accd,{'transaction':_0x4eb1b3});});}}})[_0x6791('0x1c')](function(){if(_0x4002c8){_0x60c114=_0x4002c8;return db[_0x6791('0xcf')][_0x6791('0xe4')]({'where':{'active':!![]},'include':[{'model':db[_0x6791('0xe5')],'as':_0x6791('0xe6'),'raw':!![]}]});}})[_0x6791('0x1c')](function(_0xe78d30){if(_0xe78d30&&_0xe78d30[_0x6791('0xe6')]&&_0x4d598f[_0x6791('0xe7')]&&_0x4d598f[_0x6791('0xe8')]){var _0x36545d={'tls':{'rejectUnauthorized':![]}};if(_0xe78d30[_0x6791('0xe6')]['service']){_0x36545d[_0x6791('0xe9')]=_0xe78d30[_0x6791('0xe6')]['service'];}else{_0x36545d[_0x6791('0xea')]=_0xe78d30['Smtp'][_0x6791('0xea')];_0x36545d[_0x6791('0xeb')]=_0xe78d30['Smtp'][_0x6791('0xeb')];_0x36545d['secure']=_0xe78d30[_0x6791('0xe6')][_0x6791('0xec')];}if(_0xe78d30['Smtp'][_0x6791('0xed')]){_0x36545d[_0x6791('0xee')]={'user':_0xe78d30['Smtp'][_0x6791('0x55')],'pass':_0xe78d30[_0x6791('0xe6')][_0x6791('0xef')]};}return respondWithRpcPromise(_0x6791('0xf0'),_0x6791('0xf1'),{'account':_0x36545d,'message':{'from':util[_0x6791('0xaa')](_0x6791('0xf2'),_0xe78d30[_0x6791('0x35')],_0xe78d30[_0x6791('0xf3')]||_0xe78d30[_0x6791('0xe6')][_0x6791('0x55')]),'to':_0x4d598f[_0x6791('0xe8')],'subject':_0x4d598f[_0x6791('0xf4')],'html':_0x60c114[_0x6791('0x54')],'attachments':_0x3fcfea}},client9003)[_0x6791('0x1c')](function(){return _0x60c114;})[_0x6791('0x26')](function(_0x3ff3ff){console[_0x6791('0x21')](_0x3ff3ff);});}})['then'](function(){if(_0x4d598f&&_0x4d598f[_0x6791('0xdf')]&&_0x4d598f[_0x6791('0xf5')]){var _0x39bc21=[];if(_0x4b2f2a['length']){_0x39bc21=_0x4b2f2a[_0x6791('0x38')](function(_0x20ff2a){return{'name':_0x20ff2a['originalname'],'basename':_0x20ff2a[_0x6791('0x6b')],'type':_0x20ff2a[_0x6791('0xda')],'ChatOfflineMessageId':_0x4002c8['id']};});}var _0x48ed50;if(!_[_0x6791('0x77')](_0x4d598f[_0x6791('0xf6')])){var _0xb343da=_[_0x6791('0x38')](_0x40da32[_0x6791('0x54')],function(_0x21facd){return _0x21facd;});var _0x518eb5=_[_0x6791('0xf7')](_0xb343da)[0x0];var _0x44711a=_['mapValues'](_0x518eb5,function(_0xa7d6bd){return _0xa7d6bd;});_0x48ed50=_0x44711a[0x1][_0x4d598f[_0x6791('0xf6')]];}var _0x4378da={'from':_0x26acc1[_0x6791('0xf3')],'firstName':_0x26acc1[_0x6791('0xa4')],'lastName':_0x26acc1['lastName'],'mapKey':'email','message':{'from':_0x26acc1['email'],'to':_0x4d598f[_0x6791('0xcf')]['email'],'cc':'','subject':_['isNil'](_0x48ed50)?_0x4d598f['offlineMessageSubject']:_0x48ed50,'messageId':'','sentAt':new Date(),'attach':_0x39bc21[_0x6791('0x43')],'attachments':_0x39bc21,'originChannel':_0x6791('0xf8'),'ChatWebsiteId':_0x4d598f['id'],'ChatOfflineMessageId':_0x60c114['id'],'originTo':_0x4d598f[_0x6791('0xcf')]['email']},'body':_0x60c114[_0x6791('0x54')]};var _0x30009a={'account':{'id':_0x4d598f[_0x6791('0xf5')]},'body':_0x4378da,'log':_0x6791('0xf9')};return respondWithRpcPromise(_0x6791('0xf9'),_0x6791('0xfa'),_0x30009a,client9001)[_0x6791('0x1c')](function(){return _0x60c114;})[_0x6791('0x26')](function(_0x3a821d){console[_0x6791('0x21')](_0x3a821d);});}return;})[_0x6791('0x1c')](function(){if(_0x60c114){return _0x60c114;}})[_0x6791('0x1c')](respondWithResult(_0x4bbed2,null))[_0x6791('0x26')](function(_0x5f3fff){console[_0x6791('0x21')](_0x6791('0x26'),_0x5f3fff);for(var _0x321dab of _0x4b2f2a){var _0xdec165=path[_0x6791('0x71')](config[_0x6791('0x72')],_0x6791('0xdb'),'files',_0x6791('0xdc'),_0x6791('0xdd'),_0x321dab[_0x6791('0x6b')]);fs_extra[_0x6791('0xfb')](_0xdec165)[_0x6791('0x26')](function(_0x121cc6){console['error'](_0x6791('0xfc'),_0xdec165,_0x121cc6);});}});};exports[_0x6791('0xfd')]=function(_0x398e61,_0x547924,_0x2b9137){return db[_0x6791('0xb1')][_0x6791('0x52')]({'where':{'id':_0x398e61[_0x6791('0x5c')]['id']}})[_0x6791('0x1c')](handleEntityNotFound(_0x547924,null))[_0x6791('0x1c')](function(_0x380e52){if(_0x380e52){return _0x380e52[_0x6791('0xfd')](_0x398e61[_0x6791('0x54')][_0x6791('0x64')],_[_0x6791('0xfe')](_0x398e61[_0x6791('0x54')],[_0x6791('0x64'),'id'])||{});}})[_0x6791('0x1c')](respondWithResult(_0x547924,null))[_0x6791('0x26')](handleError(_0x547924,null));};exports[_0x6791('0xff')]=function(_0x2d8346,_0x5d8293,_0x2929b3){var _0x279695={'raw':![],'where':{}};var _0x29436d={};var _0x2170ed={'count':0x0,'rows':[]};return db[_0x6791('0x39')][_0x6791('0xe4')]({'where':{'id':_0x2d8346['params']['id']}})[_0x6791('0x1c')](handleEntityNotFound(_0x5d8293,null))[_0x6791('0x1c')](function(_0x539823){if(_0x539823){_0x29436d[_0x6791('0x40')]=_[_0x6791('0x3e')](db[_0x6791('0xb1')]['rawAttributes']);_0x29436d[_0x6791('0x3d')]=_[_0x6791('0x3e')](_0x2d8346[_0x6791('0x3d')]);_0x29436d[_0x6791('0x47')]=_[_0x6791('0x3f')](_0x29436d[_0x6791('0x40')],_0x29436d[_0x6791('0x3d')]);_0x279695[_0x6791('0x42')]=_['intersection'](_0x29436d['model'],qs[_0x6791('0x41')](_0x2d8346[_0x6791('0x3d')][_0x6791('0x41')]));_0x279695[_0x6791('0x42')]=_0x279695[_0x6791('0x42')]['length']?_0x279695[_0x6791('0x42')]:_0x29436d[_0x6791('0x40')];if(!_0x2d8346['query'][_0x6791('0x61')]('nolimit')){_0x279695['limit']=qs[_0x6791('0x2d')](_0x2d8346[_0x6791('0x3d')][_0x6791('0x2d')]);_0x279695['offset']=qs[_0x6791('0x2a')](_0x2d8346[_0x6791('0x3d')][_0x6791('0x2a')]);}_0x279695[_0x6791('0x45')]=qs['sort'](_0x2d8346[_0x6791('0x3d')]['sort']);_0x279695[_0x6791('0x49')]=qs['filters'](_[_0x6791('0x62')](_0x2d8346[_0x6791('0x3d')],_0x29436d['filters']));_0x279695['where']['ChatWebsiteId']=_0x539823['id'];if(_0x2d8346[_0x6791('0x3d')][_0x6791('0x48')]){_0x279695['where']=_[_0x6791('0x4b')](_0x279695[_0x6791('0x49')],{'$or':_[_0x6791('0x38')](_0x279695[_0x6791('0x42')],function(_0x44685c){var _0x1a3153={};_0x1a3153[_0x44685c]={'$like':'%'+_0x2d8346['query'][_0x6791('0x48')]+'%'};return _0x1a3153;})});}_0x279695=_[_0x6791('0x4b')]({},_0x279695,_0x2d8346['options']);return db[_0x6791('0xb1')][_0x6791('0x2c')]({'where':_0x279695[_0x6791('0x49')]})[_0x6791('0x1c')](function(_0xbe8f91){_0x2170ed[_0x6791('0x2c')]=_0xbe8f91;if(_0x2d8346[_0x6791('0x3d')][_0x6791('0x4d')]){_0x279695['include']=[{'model':db[_0x6791('0x87')],'as':_0x6791('0x100'),'required':![]},{'model':db[_0x6791('0xbd')],'as':_0x6791('0x101'),'attributes':[_0x6791('0x35'),'fullname',_0x6791('0x102')],'required':![]},{'model':db[_0x6791('0x103')],'as':_0x6791('0x104'),'attributes':['id',_0x6791('0x35'),_0x6791('0x105')],'where':_0x2d8346[_0x6791('0x3d')][_0x6791('0x106')]?{'id':_0x2d8346[_0x6791('0x3d')][_0x6791('0x106')]}:undefined,'required':_0x2d8346[_0x6791('0x3d')]['tag']?!![]:![]}];}return db[_0x6791('0xb1')][_0x6791('0x67')](_0x279695);})['then'](function(_0x4871e8){_0x2170ed[_0x6791('0x4f')]=_0x4871e8;return _0x2170ed;});}})[_0x6791('0x1c')](respondWithFilteredResult(_0x5d8293,_0x279695))['catch'](handleError(_0x5d8293,null));};function iftimePromise(_0x13506e,_0x3e5e46){return respondWithRpcPromise(_0x6791('0x107'),_0x6791('0x108'),{'command':_0x3e5e46[_0x6791('0x109')]?util[_0x6791('0xaa')](_0x6791('0x10a'),_0x13506e[_0x6791('0x10b')],_0x3e5e46['timezone']):util[_0x6791('0xaa')](_0x6791('0x10c'),_0x13506e[_0x6791('0x10b')])},client9002)[_0x6791('0x1c')](function(_0x404318){var _0x3384c0=_0x404318&&_0x404318[_0x6791('0x10d')](_0x6791('0x10e'))>=0x0?!![]:![];logger[_0x6791('0x25')](_0x6791('0x10f'),_0x3e5e46['id'],_0x13506e['id'],_0x13506e['interval'],_0x3384c0?_0x6791('0x110'):_0x6791('0x111'),_0x3e5e46[_0x6791('0x109')]?_0x3e5e46['timezone']:_0x6791('0x112'));return _0x3384c0;})[_0x6791('0x26')](function(_0x3c41b8){logger[_0x6791('0x21')]('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0x3e5e46['id'],_0x13506e['id'],_0x13506e[_0x6791('0x10b')],util[_0x6791('0x113')](_0x3c41b8,{'showHidden':![],'depth':null}),_0x3e5e46[_0x6791('0x109')]?_0x3e5e46[_0x6791('0x109')]:_0x6791('0x112'));return![];});}exports[_0x6791('0x108')]=function(_0x12ae33,_0x3aafce,_0x3bc7e0){var _0x4399d9=0x0;var _0x115cae=0x0;var _0x35c46a=![];var _0x558a0;var _0x42db38;return db[_0x6791('0x39')][_0x6791('0x52')]({'where':{'id':_0x12ae33['params']['id']},'include':[{'model':db[_0x6791('0x114')],'as':_0x6791('0x114'),'include':[{'model':db[_0x6791('0x114')],'as':_0x6791('0x115'),'attributes':['id','interval'],'raw':!![]}]}]})[_0x6791('0x1c')](handleEntityNotFound(_0x3aafce,null))[_0x6791('0x1c')](function(_0x20da24){if(_0x20da24){_0x558a0=_0x20da24;return _0x20da24['getProactiveActions']({'raw':!![]});}})[_0x6791('0x1c')](function(_0x121513){if(_0x558a0){if(_0x121513){_0x42db38=_0x121513;}}return require(_0x6791('0x14'))['getLicense']();})[_0x6791('0x1c')](function(_0x84208a){if(_0x84208a){_0x115cae=_0x84208a[_0x6791('0x116')];_0x35c46a=_0x84208a[_0x6791('0x76')];}})[_0x6791('0x1c')](function(){return db[_0x6791('0xb1')][_0x6791('0x2c')]({'where':{'closed':![]}});})[_0x6791('0x1c')](function(_0x27751c){_0x4399d9=_0x27751c;if(_0x115cae&&_0x27751c>_0x115cae){return db[_0x6791('0x117')]['findOne']({'where':{'id':0x1}})['then'](function(_0x26e4b4){if(_0x26e4b4){_0x26e4b4['increment']('chatLicenseExceeded');}});}})['then'](function(){if(_0x558a0[_0x6791('0x114')]&&_0x558a0[_0x6791('0x114')][_0x6791('0x115')]){var _0x4aeb97=[];for(var _0x5096b8=0x0;_0x5096b8<_0x558a0[_0x6791('0x114')][_0x6791('0x115')][_0x6791('0x43')];_0x5096b8++){var _0x3f64ab=_0x558a0[_0x6791('0x114')][_0x6791('0x115')][_0x5096b8][_0x6791('0x33')]({'plain':!![]});_0x4aeb97[_0x6791('0x118')](iftimePromise(_0x3f64ab,_0x558a0));}return BPromise['all'](_0x4aeb97)['then'](function(_0x545a9b){return _[_0x6791('0x119')](_0x545a9b);});}else{return!![];}})[_0x6791('0x1c')](function(_0x2862b6){var _0xe4e522=fs['readFileSync'](path[_0x6791('0x71')](config[_0x6791('0x72')],_0x6791('0x11a')),_0x6791('0xd4'));var _0x537718={'remote':_0x558a0['remote'],'query':querystring[_0x6791('0x20')](_['merge'](_0x558a0[_0x6791('0x33')]({'plain':!![]}),{'customerIp':_0x12ae33[_0x6791('0x84')][_0x6791('0xa2')]||_0x12ae33['headers']['x-real-ip']||_0x12ae33[_0x6791('0x11b')][_0x6791('0x11c')]||_0x12ae33['ip'],'referer':_0x12ae33[_0x6791('0x84')][_0x6791('0xa7')],'openedInteractions':_0x4399d9,'maxInteractions':_0x115cae,'virtual':_0x35c46a[_0x6791('0x116')],'online':_0x2862b6,'custom':_0x35c46a}))[_0x6791('0x11d')](/'/g,'\x5c\x27')};_0x3aafce[_0x6791('0xc9')](ejs[_0x6791('0xd5')](Mustache[_0x6791('0xd5')](_0xe4e522,_0x537718),{'proactiveActions':_0x42db38,'alignment':_0x558a0[_0x6791('0x11e')],'verticalAlignment':_0x558a0[_0x6791('0x11f')],'div_color':_0x558a0[_0x6791('0x105')],'text_color':_0x558a0[_0x6791('0x120')],'button_color':_0x558a0[_0x6791('0x121')],'background_color':_0x558a0[_0x6791('0x122')]}));})[_0x6791('0x26')](handleError(_0x3aafce,null));};exports[_0x6791('0x123')]=function(_0x410cbc,_0x3ea426,_0x1f9711){return db[_0x6791('0x39')]['findOne']({'where':{'id':_0x410cbc[_0x6791('0x5c')]['id']}})[_0x6791('0x1c')](handleEntityNotFound(_0x3ea426,null))[_0x6791('0x1c')](function(_0x3c4021){if(_0x3c4021){return db[_0x6791('0xe0')][_0x6791('0xe1')](function(_0x504ba2){return db['ChatApplication'][_0x6791('0x32')]({'where':{'ChatWebsiteId':_0x410cbc[_0x6791('0x5c')]['id']},'transaction':_0x504ba2})[_0x6791('0x1c')](function(_0x3d9eae){var _0x9f7a9=_[_0x6791('0x38')](_0x410cbc[_0x6791('0x54')],function(_0x327f5b){_0x327f5b[_0x6791('0x5e')]=_0x410cbc[_0x6791('0x5c')]['id'];return _0x327f5b;});return db[_0x6791('0x96')][_0x6791('0xe3')](_0x9f7a9,{'transaction':_0x504ba2});});})[_0x6791('0x1c')](function(){return db[_0x6791('0x96')][_0x6791('0x124')]({'where':{'ChatWebsiteId':_0x410cbc[_0x6791('0x5c')]['id']},'order':'priority'});});}})[_0x6791('0x1c')](respondWithResult(_0x3ea426,null))[_0x6791('0x26')](handleError(_0x3ea426,null));};exports['getApplications']=function(_0x449faa,_0x3cff8d,_0x21498c){var _0x49f548={};var _0x5655ac={};var _0x4f6cca;var _0x3d33c1;return db['ChatWebsite'][_0x6791('0xe4')]({'where':{'id':_0x449faa[_0x6791('0x5c')]['id']}})[_0x6791('0x1c')](handleEntityNotFound(_0x3cff8d,null))[_0x6791('0x1c')](function(_0x319811){if(_0x319811){_0x4f6cca=_0x319811;_0x5655ac['model']=_[_0x6791('0x3e')](db['ChatApplication'][_0x6791('0x3a')]);_0x5655ac['query']=_[_0x6791('0x3e')](_0x449faa[_0x6791('0x3d')]);_0x5655ac[_0x6791('0x47')]=_[_0x6791('0x3f')](_0x5655ac['model'],_0x5655ac[_0x6791('0x3d')]);_0x49f548[_0x6791('0x42')]=_[_0x6791('0x3f')](_0x5655ac[_0x6791('0x40')],qs[_0x6791('0x41')](_0x449faa['query'][_0x6791('0x41')]));_0x49f548[_0x6791('0x42')]=_0x49f548[_0x6791('0x42')][_0x6791('0x43')]?_0x49f548['attributes']:_0x5655ac['model'];_0x49f548[_0x6791('0x45')]=qs[_0x6791('0x46')](_0x449faa['query'][_0x6791('0x46')]);_0x49f548['where']=qs[_0x6791('0x47')](_[_0x6791('0x62')](_0x449faa[_0x6791('0x3d')],_0x5655ac['filters']));if(_0x449faa[_0x6791('0x3d')]['filter']){_0x49f548['where']=_['merge'](_0x49f548[_0x6791('0x49')],{'$or':_[_0x6791('0x38')](_0x49f548['attributes'],function(_0x29e173){var _0x24b3db={};_0x24b3db[_0x29e173]={'$like':'%'+_0x449faa[_0x6791('0x3d')][_0x6791('0x48')]+'%'};return _0x24b3db;})});}_0x49f548=_[_0x6791('0x4b')]({},_0x49f548,_0x449faa[_0x6791('0x4c')]);return _0x4f6cca[_0x6791('0x125')](_0x49f548);}})[_0x6791('0x1c')](function(_0x460a97){if(_0x460a97){_0x3d33c1=_0x460a97[_0x6791('0x43')];if(!_0x449faa[_0x6791('0x3d')][_0x6791('0x61')](_0x6791('0x44'))){_0x49f548[_0x6791('0x2d')]=qs[_0x6791('0x2d')](_0x449faa[_0x6791('0x3d')]['limit']);_0x49f548['offset']=qs[_0x6791('0x2a')](_0x449faa[_0x6791('0x3d')][_0x6791('0x2a')]);}return _0x4f6cca[_0x6791('0x125')](_0x49f548);}})[_0x6791('0x1c')](function(_0x49806c){if(_0x49806c){return _0x49806c?{'count':_0x3d33c1,'rows':_0x49806c}:null;}})[_0x6791('0x1c')](respondWithResult(_0x3cff8d,null))[_0x6791('0x26')](handleError(_0x3cff8d,null));};exports[_0x6791('0x126')]=function(_0x1759e5,_0x25556f,_0x575521){return db[_0x6791('0x127')]['find']({'where':{'id':_0x1759e5[_0x6791('0x5c')]['id']}})[_0x6791('0x1c')](handleEntityNotFound(_0x25556f,null))[_0x6791('0x1c')](function(_0x1d01f4){if(_0x1d01f4){return _0x1d01f4[_0x6791('0x126')](_0x1759e5[_0x6791('0x54')][_0x6791('0x64')],_[_0x6791('0xfe')](_0x1759e5['body'],[_0x6791('0x64'),'id'])||{});}})[_0x6791('0x1c')](respondWithResult(_0x25556f,null))[_0x6791('0x26')](handleError(_0x25556f,null));};exports['getProactiveActions']=function(_0x417c92,_0x310161,_0x138755){var _0x2a4859={};var _0x568b51={};var _0x3972b9;var _0x576f12;return db[_0x6791('0x39')][_0x6791('0xe4')]({'where':{'id':_0x417c92[_0x6791('0x5c')]['id']}})[_0x6791('0x1c')](handleEntityNotFound(_0x310161,null))[_0x6791('0x1c')](function(_0x111426){if(_0x111426){_0x3972b9=_0x111426;_0x568b51[_0x6791('0x40')]=_[_0x6791('0x3e')](db['ChatProactiveAction'][_0x6791('0x3a')]);_0x568b51['query']=_[_0x6791('0x3e')](_0x417c92['query']);_0x568b51[_0x6791('0x47')]=_[_0x6791('0x3f')](_0x568b51[_0x6791('0x40')],_0x568b51['query']);_0x2a4859[_0x6791('0x42')]=_[_0x6791('0x3f')](_0x568b51[_0x6791('0x40')],qs[_0x6791('0x41')](_0x417c92[_0x6791('0x3d')]['fields']));_0x2a4859['attributes']=_0x2a4859[_0x6791('0x42')][_0x6791('0x43')]?_0x2a4859[_0x6791('0x42')]:_0x568b51[_0x6791('0x40')];_0x2a4859[_0x6791('0x45')]=qs[_0x6791('0x46')](_0x417c92[_0x6791('0x3d')][_0x6791('0x46')]);_0x2a4859[_0x6791('0x49')]=qs['filters'](_[_0x6791('0x62')](_0x417c92[_0x6791('0x3d')],_0x568b51[_0x6791('0x47')]));if(_0x417c92[_0x6791('0x3d')][_0x6791('0x48')]){_0x2a4859['where']=_[_0x6791('0x4b')](_0x2a4859[_0x6791('0x49')],{'$or':_['map'](_0x2a4859[_0x6791('0x42')],function(_0x167f55){var _0x5cb4f3={};_0x5cb4f3[_0x167f55]={'$like':'%'+_0x417c92['query'][_0x6791('0x48')]+'%'};return _0x5cb4f3;})});}_0x2a4859=_[_0x6791('0x4b')]({},_0x2a4859,_0x417c92[_0x6791('0x4c')]);return _0x3972b9[_0x6791('0x128')](_0x2a4859);}})[_0x6791('0x1c')](function(_0x285826){if(_0x285826){_0x576f12=_0x285826[_0x6791('0x43')];if(!_0x417c92['query'][_0x6791('0x61')](_0x6791('0x44'))){_0x2a4859['limit']=qs['limit'](_0x417c92['query'][_0x6791('0x2d')]);_0x2a4859['offset']=qs['offset'](_0x417c92['query'][_0x6791('0x2a')]);}return _0x3972b9['getProactiveActions'](_0x2a4859);}})[_0x6791('0x1c')](function(_0x3a4656){if(_0x3a4656){return _0x3a4656?{'count':_0x576f12,'rows':_0x3a4656}:null;}})[_0x6791('0x1c')](respondWithResult(_0x310161,null))[_0x6791('0x26')](handleError(_0x310161,null));};exports[_0x6791('0x129')]=function(_0x5d2557,_0x1602ce,_0x5e6cbb){var _0x22a901=_0x5d2557[_0x6791('0x3d')][_0x6791('0x12a')]===_0x6791('0x12b')?_0x6791('0x12c'):_0x6791('0x12d');return db[_0x6791('0x39')][_0x6791('0x52')]({'attributes':['id',_0x22a901],'where':{'id':_0x5d2557['params']['id']}})[_0x6791('0x1c')](handleEntityNotFound(_0x1602ce,null))[_0x6791('0x1c')](function(_0x27287d){if(_0x27287d){var _0x549c78=_0x27287d[_0x22a901];var _0x5a6a4d=_0x549c78&&_0x549c78[_0x6791('0x12e')]?_0x549c78[_0x6791('0x12e')]:[];_0x1602ce['send']({'fromKey':_[_0x6791('0x77')](_0x549c78[_0x6791('0x12f')])?undefined:_0x549c78['fromKey'],'count':_0x5a6a4d['length'],'rows':_0x5a6a4d});}})['catch'](handleError(_0x1602ce,null));};exports[_0x6791('0x130')]=function(_0xcb70ee,_0x2918db,_0x749a9d){var _0x4f97e9={'raw':![],'where':{}};var _0x689602={};var _0x516086={'count':0x0,'rows':[]};return db['ChatWebsite']['findOne']({'where':{'id':_0xcb70ee[_0x6791('0x5c')]['id']}})[_0x6791('0x1c')](handleEntityNotFound(_0x2918db,null))[_0x6791('0x1c')](function(_0x4382f3){if(_0x4382f3){_0x689602['model']=_[_0x6791('0x3e')](db[_0x6791('0xd8')][_0x6791('0x3a')]);_0x689602[_0x6791('0x3d')]=_[_0x6791('0x3e')](_0xcb70ee[_0x6791('0x3d')]);_0x689602['filters']=_[_0x6791('0x3f')](_0x689602[_0x6791('0x40')],_0x689602[_0x6791('0x3d')]);_0x4f97e9[_0x6791('0x42')]=_[_0x6791('0x3f')](_0x689602['model'],qs[_0x6791('0x41')](_0xcb70ee[_0x6791('0x3d')]['fields']));_0x4f97e9[_0x6791('0x42')]=_0x4f97e9[_0x6791('0x42')][_0x6791('0x43')]?_0x4f97e9[_0x6791('0x42')]:_0x689602['model'];if(!_0xcb70ee[_0x6791('0x3d')]['hasOwnProperty'](_0x6791('0x44'))){_0x4f97e9['limit']=qs[_0x6791('0x2d')](_0xcb70ee['query'][_0x6791('0x2d')]);_0x4f97e9[_0x6791('0x2a')]=qs[_0x6791('0x2a')](_0xcb70ee['query']['offset']);}_0x4f97e9['order']=qs[_0x6791('0x46')](_0xcb70ee[_0x6791('0x3d')][_0x6791('0x46')]);_0x4f97e9[_0x6791('0x49')]=qs[_0x6791('0x47')](_[_0x6791('0x62')](_0xcb70ee['query'],_0x689602[_0x6791('0x47')]));_0x4f97e9[_0x6791('0x49')][_0x6791('0x5e')]=_0x4382f3['id'];if(_0xcb70ee['query'][_0x6791('0x48')]){_0x4f97e9[_0x6791('0x49')]=_[_0x6791('0x4b')](_0x4f97e9[_0x6791('0x49')],{'$or':_[_0x6791('0x38')](_0x4f97e9[_0x6791('0x42')],function(_0x3b10d2){var _0x3de1dd={};_0x3de1dd[_0x3b10d2]={'$like':'%'+_0xcb70ee[_0x6791('0x3d')][_0x6791('0x48')]+'%'};return _0x3de1dd;})});}_0x4f97e9=_[_0x6791('0x4b')]({},_0x4f97e9,_0xcb70ee[_0x6791('0x4c')]);return db[_0x6791('0xd8')][_0x6791('0x2c')]({'where':_0x4f97e9['where']})[_0x6791('0x1c')](function(_0x5a58a9){_0x516086['count']=_0x5a58a9;if(_0xcb70ee[_0x6791('0x3d')][_0x6791('0x4d')]){_0x4f97e9['include']=[{'all':!![]}];}else{_0x4f97e9[_0x6791('0x4e')]=[{'model':db[_0x6791('0x87')],'as':_0x6791('0x100'),'required':![]},{'model':db[_0x6791('0xe2')],'as':_0x6791('0x131'),'required':![]}];}return db[_0x6791('0xd8')][_0x6791('0x67')](_0x4f97e9);})[_0x6791('0x1c')](function(_0x315a65){_0x516086[_0x6791('0x4f')]=_0x315a65;return _0x516086;});}})[_0x6791('0x1c')](respondWithFilteredResult(_0x2918db,_0x4f97e9))[_0x6791('0x26')](handleError(_0x2918db,null));};exports[_0x6791('0x132')]=function(_0x3df94a,_0x4ae4f5,_0xc30748){return db[_0x6791('0x39')][_0x6791('0x52')]({'where':{'id':_0x3df94a[_0x6791('0x5c')]['id']}})[_0x6791('0x1c')](handleEntityNotFound(_0x4ae4f5,null))['then'](function(_0x3b4571){if(_0x3b4571){return _0x3b4571[_0x6791('0x132')](_0x3df94a['body'][_0x6791('0x64')],_[_0x6791('0xfe')](_0x3df94a['body'],['ids','id'])||{})['spread'](function(_0xc9ebd2){for(var _0x4153b6=0x0;_0x4153b6<_0x3df94a[_0x6791('0x54')][_0x6791('0x64')]['length'];_0x4153b6+=0x1){socket[_0x6791('0x133')](_0x6791('0x134'),{'UserId':Number(_0x3df94a['body'][_0x6791('0x64')][_0x4153b6]),'ChatWebsiteId':Number(_0x3df94a[_0x6791('0x5c')]['id'])});}return _0xc9ebd2;});}})['then'](respondWithResult(_0x4ae4f5,null))['catch'](handleError(_0x4ae4f5,null));};exports['removeAgents']=function(_0x24c6e5,_0x49cade,_0x51ec8f){return db['ChatWebsite'][_0x6791('0x52')]({'where':{'id':_0x24c6e5[_0x6791('0x5c')]['id']}})['then'](handleEntityNotFound(_0x49cade,null))[_0x6791('0x1c')](function(_0x278a48){if(_0x278a48){return _0x278a48[_0x6791('0x135')](_0x24c6e5[_0x6791('0x3d')][_0x6791('0x64')])[_0x6791('0x1c')](function(){if(_['isArray'](_0x24c6e5[_0x6791('0x3d')][_0x6791('0x64')])){for(var _0x84ad67=0x0;_0x84ad67<_0x24c6e5[_0x6791('0x3d')][_0x6791('0x64')][_0x6791('0x43')];_0x84ad67+=0x1){socket['emit'](_0x6791('0x136'),{'UserId':Number(_0x24c6e5['query'][_0x6791('0x64')][_0x84ad67]),'ChatWebsiteId':Number(_0x24c6e5[_0x6791('0x5c')]['id'])});}}else{socket[_0x6791('0x133')]('userChatWebsite:remove',{'UserId':Number(_0x24c6e5[_0x6791('0x3d')][_0x6791('0x64')]),'ChatWebsiteId':Number(_0x24c6e5[_0x6791('0x5c')]['id'])});}});}})[_0x6791('0x1c')](respondWithStatusCode(_0x49cade,null))[_0x6791('0x26')](handleError(_0x49cade,null));};exports[_0x6791('0x137')]=function(_0x35a85f,_0x1c41f7,_0x21d3b0){var _0x7acfcb={};var _0x22b443={};var _0x3ccfcd;var _0x134038;return db[_0x6791('0x39')][_0x6791('0xe4')]({'where':{'id':_0x35a85f['params']['id']}})['then'](handleEntityNotFound(_0x1c41f7,null))[_0x6791('0x1c')](function(_0x1cbaa6){if(_0x1cbaa6){_0x3ccfcd=_0x1cbaa6;_0x22b443[_0x6791('0x40')]=_[_0x6791('0x3e')](db['User']['rawAttributes']);_0x22b443[_0x6791('0x3d')]=_[_0x6791('0x3e')](_0x35a85f[_0x6791('0x3d')]);_0x22b443[_0x6791('0x47')]=_[_0x6791('0x3f')](_0x22b443[_0x6791('0x40')],_0x22b443[_0x6791('0x3d')]);_0x7acfcb[_0x6791('0x42')]=_[_0x6791('0x3f')](_0x22b443[_0x6791('0x40')],qs[_0x6791('0x41')](_0x35a85f['query']['fields']));_0x7acfcb[_0x6791('0x42')]=_0x7acfcb[_0x6791('0x42')][_0x6791('0x43')]?_0x7acfcb[_0x6791('0x42')]:_0x22b443[_0x6791('0x40')];_0x7acfcb[_0x6791('0x45')]=qs[_0x6791('0x46')](_0x35a85f['query']['sort']);_0x7acfcb[_0x6791('0x49')]=qs['filters'](_[_0x6791('0x62')](_0x35a85f['query'],_0x22b443[_0x6791('0x47')]));if(_0x35a85f['query'][_0x6791('0x48')]){_0x7acfcb[_0x6791('0x49')]=_[_0x6791('0x4b')](_0x7acfcb[_0x6791('0x49')],{'$or':_['map'](_0x7acfcb[_0x6791('0x42')],function(_0x43cee2){var _0x2963bb={};_0x2963bb[_0x43cee2]={'$like':'%'+_0x35a85f[_0x6791('0x3d')][_0x6791('0x48')]+'%'};return _0x2963bb;})});}_0x7acfcb=_[_0x6791('0x4b')]({},_0x7acfcb,_0x35a85f[_0x6791('0x4c')]);return _0x3ccfcd[_0x6791('0x137')](_0x7acfcb);}})[_0x6791('0x1c')](function(_0x5e9a00){if(_0x5e9a00){_0x134038=_0x5e9a00[_0x6791('0x43')];if(!_0x35a85f[_0x6791('0x3d')][_0x6791('0x61')](_0x6791('0x44'))){_0x7acfcb[_0x6791('0x2d')]=qs[_0x6791('0x2d')](_0x35a85f[_0x6791('0x3d')][_0x6791('0x2d')]);_0x7acfcb[_0x6791('0x2a')]=qs[_0x6791('0x2a')](_0x35a85f[_0x6791('0x3d')][_0x6791('0x2a')]);}return _0x3ccfcd[_0x6791('0x137')](_0x7acfcb);}})[_0x6791('0x1c')](function(_0x3b3f46){if(_0x3b3f46){return _0x3b3f46?{'count':_0x134038,'rows':_0x3b3f46}:null;}})[_0x6791('0x1c')](respondWithResult(_0x1c41f7,null))['catch'](handleError(_0x1c41f7,null));}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js index 711227f..5b1793f 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 _0xb717=['remove','emit','hook','exports','events','ChatWebsite','save','update'];(function(_0x358806,_0x322b66){var _0x19fdcb=function(_0xe01b8d){while(--_0xe01b8d){_0x358806['push'](_0x358806['shift']());}};_0x19fdcb(++_0x322b66);}(_0xb717,0x1b4));var _0x7b71=function(_0x1e8e17,_0x15a1dc){_0x1e8e17=_0x1e8e17-0x0;var _0x59faff=_0xb717[_0x1e8e17];return _0x59faff;};'use strict';var EventEmitter=require(_0x7b71('0x0'));var ChatWebsite=require('../../mysqldb')['db'][_0x7b71('0x1')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x7b71('0x2'),'afterUpdate':_0x7b71('0x3'),'afterDestroy':_0x7b71('0x4')};function emitEvent(_0x52c5dd){return function(_0x238319,_0x2e583f,_0x455c08){ChatWebsiteEvents[_0x7b71('0x5')](_0x52c5dd+':'+_0x238319['id'],_0x238319);ChatWebsiteEvents[_0x7b71('0x5')](_0x52c5dd,_0x238319);_0x455c08(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatWebsite[_0x7b71('0x6')](e,emitEvent(event));}}module[_0x7b71('0x7')]=ChatWebsiteEvents; \ No newline at end of file +var _0x2cc1=['update','remove','emit','hook','exports','events','../../mysqldb','ChatWebsite','setMaxListeners','save'];(function(_0x57eba4,_0x51131b){var _0xf50650=function(_0x330e22){while(--_0x330e22){_0x57eba4['push'](_0x57eba4['shift']());}};_0xf50650(++_0x51131b);}(_0x2cc1,0x1bd));var _0x12cc=function(_0x934425,_0x5af72f){_0x934425=_0x934425-0x0;var _0x31d596=_0x2cc1[_0x934425];return _0x31d596;};'use strict';var EventEmitter=require(_0x12cc('0x0'));var ChatWebsite=require(_0x12cc('0x1'))['db'][_0x12cc('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x12cc('0x3')](0x0);var events={'afterCreate':_0x12cc('0x4'),'afterUpdate':_0x12cc('0x5'),'afterDestroy':_0x12cc('0x6')};function emitEvent(_0x4316fc){return function(_0x49436d,_0x587141,_0xfc8836){ChatWebsiteEvents[_0x12cc('0x7')](_0x4316fc+':'+_0x49436d['id'],_0x49436d);ChatWebsiteEvents['emit'](_0x4316fc,_0x49436d);_0xfc8836(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatWebsite[_0x12cc('0x8')](e,emitEvent(event));}}module[_0x12cc('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 2fc2f0b..f114420 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 _0xf267=['../../config/logger','moment','bluebird','request-promise','path','rimraf','./chatWebsite.attributes','exports','define','ChatWebsite','lodash','util'];(function(_0x19568a,_0x211bc9){var _0xebd49d=function(_0x54440a){while(--_0x54440a){_0x19568a['push'](_0x19568a['shift']());}};_0xebd49d(++_0x211bc9);}(_0xf267,0x1de));var _0x7f26=function(_0x355f0b,_0x145e99){_0x355f0b=_0x355f0b-0x0;var _0x5d1a48=_0xf267[_0x355f0b];return _0x5d1a48;};'use strict';var _=require(_0x7f26('0x0'));var util=require(_0x7f26('0x1'));var logger=require(_0x7f26('0x2'))('api');var moment=require(_0x7f26('0x3'));var BPromise=require(_0x7f26('0x4'));var rp=require(_0x7f26('0x5'));var fs=require('fs');var path=require(_0x7f26('0x6'));var rimraf=require(_0x7f26('0x7'));var config=require('../../config/environment');var attributes=require(_0x7f26('0x8'));module[_0x7f26('0x9')]=function(_0x403d89,_0x2b77da){return _0x403d89[_0x7f26('0xa')](_0x7f26('0xb'),attributes,{'tableName':'chat_websites','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9dfc=['rimraf','../../config/environment','./chatWebsite.attributes','define','lodash','util','../../config/logger','moment','bluebird'];(function(_0x11ab36,_0x21ef36){var _0x16eb60=function(_0x503162){while(--_0x503162){_0x11ab36['push'](_0x11ab36['shift']());}};_0x16eb60(++_0x21ef36);}(_0x9dfc,0x15a));var _0xc9df=function(_0x5f2347,_0x4e0e27){_0x5f2347=_0x5f2347-0x0;var _0x2d1195=_0x9dfc[_0x5f2347];return _0x2d1195;};'use strict';var _=require(_0xc9df('0x0'));var util=require(_0xc9df('0x1'));var logger=require(_0xc9df('0x2'))('api');var moment=require(_0xc9df('0x3'));var BPromise=require(_0xc9df('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xc9df('0x5'));var config=require(_0xc9df('0x6'));var attributes=require(_0xc9df('0x7'));module['exports']=function(_0x78948b,_0x461c1b){return _0x78948b[_0xc9df('0x8')]('ChatWebsite',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 392e4f9..0c9d460 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 _0x0d2a=['client','http','redis','defaults','request','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','lodash','util','moment','randomstring','../../config/utils','../../config/environment'];(function(_0x55ee0b,_0x150e7d){var _0x51e4c8=function(_0x337292){while(--_0x337292){_0x55ee0b['push'](_0x55ee0b['shift']());}};_0x51e4c8(++_0x150e7d);}(_0x0d2a,0x174));var _0xa0d2=function(_0x245214,_0x208861){_0x245214=_0x245214-0x0;var _0x5b4dae=_0x0d2a[_0x245214];return _0x5b4dae;};'use strict';var _=require(_0xa0d2('0x0'));var util=require(_0xa0d2('0x1'));var moment=require(_0xa0d2('0x2'));var BPromise=require('bluebird');var rs=require(_0xa0d2('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xa0d2('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0xa0d2('0x5'));var jayson=require('jayson/promise');var client=jayson[_0xa0d2('0x6')][_0xa0d2('0x7')]({'port':0x232a});config[_0xa0d2('0x8')]=_[_0xa0d2('0x9')](config[_0xa0d2('0x8')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa0d2('0x8')]));require('./chatWebsite.socket')['register'](socket);function respondWithRpcPromise(_0x3babaf,_0x13c360,_0x537232){return new BPromise(function(_0x57d27a,_0x451b4f){return client[_0xa0d2('0xa')](_0x3babaf,_0x537232)[_0xa0d2('0xb')](function(_0x1c36b0){logger[_0xa0d2('0xc')](_0xa0d2('0xd'),_0x13c360,_0xa0d2('0xe'));logger[_0xa0d2('0xf')]('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x13c360,'request\x20sent',JSON[_0xa0d2('0x10')](_0x1c36b0));if(_0x1c36b0['error']){if(_0x1c36b0[_0xa0d2('0x11')][_0xa0d2('0x12')]===0x1f4){logger[_0xa0d2('0x11')](_0xa0d2('0xd'),_0x13c360,_0x1c36b0[_0xa0d2('0x11')]['message']);return _0x451b4f(_0x1c36b0[_0xa0d2('0x11')][_0xa0d2('0x13')]);}logger[_0xa0d2('0x11')](_0xa0d2('0xd'),_0x13c360,_0x1c36b0['error']['message']);return _0x57d27a(_0x1c36b0[_0xa0d2('0x11')][_0xa0d2('0x13')]);}else{logger[_0xa0d2('0xc')]('ChatWebsite,\x20%s,\x20%s',_0x13c360,_0xa0d2('0xe'));_0x57d27a(_0x1c36b0[_0xa0d2('0x14')][_0xa0d2('0x13')]);}})['catch'](function(_0x204132){logger['error']('ChatWebsite,\x20%s,\x20%s',_0x13c360,_0x204132);_0x451b4f(_0x204132);});});} \ No newline at end of file +var _0x6c39=['socket.io-emitter','./chatWebsite.socket','register','request','then','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost'];(function(_0x3c11ef,_0x575c8f){var _0x23d75f=function(_0x4f70e0){while(--_0x4f70e0){_0x3c11ef['push'](_0x3c11ef['shift']());}};_0x23d75f(++_0x575c8f);}(_0x6c39,0x1c2));var _0x96c3=function(_0x82129b,_0x484ae9){_0x82129b=_0x82129b-0x0;var _0x2ae5dc=_0x6c39[_0x82129b];return _0x2ae5dc;};'use strict';var _=require(_0x96c3('0x0'));var util=require('util');var moment=require(_0x96c3('0x1'));var BPromise=require(_0x96c3('0x2'));var rs=require(_0x96c3('0x3'));var fs=require('fs');var Redis=require(_0x96c3('0x4'));var db=require(_0x96c3('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x96c3('0x6'))(_0x96c3('0x7'));var config=require(_0x96c3('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x96c3('0x9')][_0x96c3('0xa')]({'port':0x232a});config[_0x96c3('0xb')]=_[_0x96c3('0xc')](config[_0x96c3('0xb')],{'host':_0x96c3('0xd'),'port':0x18eb});var socket=require(_0x96c3('0xe'))(new Redis(config[_0x96c3('0xb')]));require(_0x96c3('0xf'))[_0x96c3('0x10')](socket);function respondWithRpcPromise(_0x257423,_0x26959c,_0x53961e){return new BPromise(function(_0x44d9e2,_0x396519){return client[_0x96c3('0x11')](_0x257423,_0x53961e)[_0x96c3('0x12')](function(_0x2103fd){logger['info'](_0x96c3('0x13'),_0x26959c,_0x96c3('0x14'));logger[_0x96c3('0x15')](_0x96c3('0x16'),_0x26959c,_0x96c3('0x14'),JSON[_0x96c3('0x17')](_0x2103fd));if(_0x2103fd[_0x96c3('0x18')]){if(_0x2103fd[_0x96c3('0x18')][_0x96c3('0x19')]===0x1f4){logger['error']('ChatWebsite,\x20%s,\x20%s',_0x26959c,_0x2103fd[_0x96c3('0x18')][_0x96c3('0x1a')]);return _0x396519(_0x2103fd[_0x96c3('0x18')][_0x96c3('0x1a')]);}logger[_0x96c3('0x18')](_0x96c3('0x13'),_0x26959c,_0x2103fd[_0x96c3('0x18')][_0x96c3('0x1a')]);return _0x44d9e2(_0x2103fd[_0x96c3('0x18')][_0x96c3('0x1a')]);}else{logger[_0x96c3('0x1b')](_0x96c3('0x13'),_0x26959c,_0x96c3('0x14'));_0x44d9e2(_0x2103fd['result'][_0x96c3('0x1a')]);}})[_0x96c3('0x1c')](function(_0x9c6769){logger[_0x96c3('0x18')](_0x96c3('0x13'),_0x26959c,_0x9c6769);_0x396519(_0x9c6769);});});} \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js index 11e5dc2..670b0eb 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 _0x50cb=['remove','update','emit','removeListener','register','chatWebsite:','./chatWebsite.events','save'];(function(_0x5c12ba,_0x229eee){var _0x4ed0fa=function(_0x410943){while(--_0x410943){_0x5c12ba['push'](_0x5c12ba['shift']());}};_0x4ed0fa(++_0x229eee);}(_0x50cb,0x1be));var _0xb50c=function(_0x3c4736,_0x476c32){_0x3c4736=_0x3c4736-0x0;var _0xdae441=_0x50cb[_0x3c4736];return _0xdae441;};'use strict';var ChatWebsiteEvents=require(_0xb50c('0x0'));var events=[_0xb50c('0x1'),_0xb50c('0x2'),_0xb50c('0x3')];function createListener(_0x5aae65,_0x2294e9){return function(_0x575ae0){_0x2294e9[_0xb50c('0x4')](_0x5aae65,_0x575ae0);};}function removeListener(_0xfadcfe,_0x28c854){return function(){ChatWebsiteEvents[_0xb50c('0x5')](_0xfadcfe,_0x28c854);};}exports[_0xb50c('0x6')]=function(_0xa1e82f){for(var _0x466eb3=0x0,_0x2fc6bc=events['length'];_0x466eb3<_0x2fc6bc;_0x466eb3++){var _0x472298=events[_0x466eb3];var _0x242777=createListener(_0xb50c('0x7')+_0x472298,_0xa1e82f);ChatWebsiteEvents['on'](_0x472298,_0x242777);}}; \ No newline at end of file +var _0x3dc1=['length','./chatWebsite.events','save','remove','update','emit','removeListener','register'];(function(_0x3f465f,_0x418cdc){var _0x97cfbb=function(_0x2d9abc){while(--_0x2d9abc){_0x3f465f['push'](_0x3f465f['shift']());}};_0x97cfbb(++_0x418cdc);}(_0x3dc1,0x191));var _0x13dc=function(_0x4ccd69,_0x1349f5){_0x4ccd69=_0x4ccd69-0x0;var _0x50cc89=_0x3dc1[_0x4ccd69];return _0x50cc89;};'use strict';var ChatWebsiteEvents=require(_0x13dc('0x0'));var events=[_0x13dc('0x1'),_0x13dc('0x2'),_0x13dc('0x3')];function createListener(_0x4ee8bb,_0x4c846b){return function(_0x28e37a){_0x4c846b[_0x13dc('0x4')](_0x4ee8bb,_0x28e37a);};}function removeListener(_0xa0fdc3,_0x2be6a7){return function(){ChatWebsiteEvents[_0x13dc('0x5')](_0xa0fdc3,_0x2be6a7);};}exports[_0x13dc('0x6')]=function(_0x299b78){for(var _0x4ca143=0x0,_0xad366d=events[_0x13dc('0x7')];_0x4ca143<_0xad366d;_0x4ca143++){var _0x3bda8f=events[_0x4ca143];var _0x4b1e56=createListener('chatWebsite:'+_0x3bda8f,_0x299b78);ChatWebsiteEvents['on'](_0x3bda8f,_0x4b1e56);}}; \ No newline at end of file diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js index 8e3ace6..717ee94 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 _0x9652=['show','/:id/dispositions','getDispositions','getAnswers','/:id/logo','getLogo','/:id/avatar','getAvatar','/:id/customer_avatar','/:id/system_avatar','getSystemAvatar','/:id/interactions','/:id/snippet','/:id/applications','getApplications','/:id/proactive_actions','getProactiveActions','/:id/offline_messages','getOfflineMessages','/:id/users','getAgents','post','create','addDisposition','/:id/canned_answers','diskStorage','root','server/files/images/logos/','format','%s-%s','originalname','single','file','join','server/files/images/avatars/','now','addAvatar','addCustomerAvatar','addSystemAvatar','notify','attachments','ensureDir','extname','offline','addInteraction','addAgents','update','delete','destroy','removeDispositions','removeAnswers','removeAgents','exports','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./chatWebsite.controller','get','isAuthenticated','index','/describe','describe','/:id'];(function(_0x4f0216,_0xcb1309){var _0x4ffcee=function(_0x1983d5){while(--_0x1983d5){_0x4f0216['push'](_0x4f0216['shift']());}};_0x4ffcee(++_0xcb1309);}(_0x9652,0x1c7));var _0x2965=function(_0x3cb051,_0x3aac86){_0x3cb051=_0x3cb051-0x0;var _0x21dd99=_0x9652[_0x3cb051];return _0x21dd99;};'use strict';var multer=require('multer');var util=require(_0x2965('0x0'));var path=require(_0x2965('0x1'));var timeout=require(_0x2965('0x2'));var express=require(_0x2965('0x3'));var router=express[_0x2965('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x2965('0x5'));var config=require(_0x2965('0x6'));var controller=require(_0x2965('0x7'));router[_0x2965('0x8')]('/',auth[_0x2965('0x9')](),controller[_0x2965('0xa')]);router[_0x2965('0x8')](_0x2965('0xb'),auth['isAuthenticated'](),controller[_0x2965('0xc')]);router['get'](_0x2965('0xd'),auth[_0x2965('0x9')](),controller[_0x2965('0xe')]);router['get'](_0x2965('0xf'),auth[_0x2965('0x9')](),controller[_0x2965('0x10')]);router[_0x2965('0x8')]('/:id/canned_answers',auth[_0x2965('0x9')](),controller[_0x2965('0x11')]);router[_0x2965('0x8')](_0x2965('0x12'),controller[_0x2965('0x13')]);router[_0x2965('0x8')](_0x2965('0x14'),controller[_0x2965('0x15')]);router['get'](_0x2965('0x16'),controller['getCustomerAvatar']);router[_0x2965('0x8')](_0x2965('0x17'),controller[_0x2965('0x18')]);router['get'](_0x2965('0x19'),auth[_0x2965('0x9')](),controller['getInteractions']);router[_0x2965('0x8')](_0x2965('0x1a'),controller['getSnippet']);router[_0x2965('0x8')](_0x2965('0x1b'),auth[_0x2965('0x9')](),controller[_0x2965('0x1c')]);router[_0x2965('0x8')](_0x2965('0x1d'),auth[_0x2965('0x9')](),controller[_0x2965('0x1e')]);router[_0x2965('0x8')]('/:id/fields',controller['getFields']);router[_0x2965('0x8')](_0x2965('0x1f'),auth['isAuthenticated'](),controller[_0x2965('0x20')]);router['get'](_0x2965('0x21'),auth[_0x2965('0x9')](),controller[_0x2965('0x22')]);router[_0x2965('0x23')]('/',auth[_0x2965('0x9')](),controller[_0x2965('0x24')]);router[_0x2965('0x23')](_0x2965('0xf'),auth[_0x2965('0x9')](),controller[_0x2965('0x25')]);router[_0x2965('0x23')](_0x2965('0x26'),auth[_0x2965('0x9')](),controller['addAnswer']);var upload=multer({'storage':multer[_0x2965('0x27')]({'destination':function(_0x53fe6c,_0x2ddcaa,_0x17b3e6){_0x17b3e6(null,path['join'](config[_0x2965('0x28')],_0x2965('0x29')));},'filename':function(_0x3a3638,_0x3367cb,_0x1fcdd5){_0x1fcdd5(null,util[_0x2965('0x2a')](_0x2965('0x2b'),Date['now'](),_0x3367cb[_0x2965('0x2c')]));}})});router[_0x2965('0x23')](_0x2965('0x12'),upload[_0x2965('0x2d')](_0x2965('0x2e')),controller['addLogo']);var upload=multer({'storage':multer[_0x2965('0x27')]({'destination':function(_0x1ada01,_0x9b3368,_0x10ae45){_0x10ae45(null,path[_0x2965('0x2f')](config['root'],_0x2965('0x30')));},'filename':function(_0x5000f4,_0x5759ea,_0x720053){_0x720053(null,util[_0x2965('0x2a')](_0x2965('0x2b'),Date[_0x2965('0x31')](),_0x5759ea[_0x2965('0x2c')]));}})});router[_0x2965('0x23')](_0x2965('0x14'),upload[_0x2965('0x2d')](_0x2965('0x2e')),controller[_0x2965('0x32')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x101ffb,_0x20f392,_0x28e10d){_0x28e10d(null,path[_0x2965('0x2f')](config[_0x2965('0x28')],_0x2965('0x30')));},'filename':function(_0x2b070d,_0x376be2,_0x4ff5e6){_0x4ff5e6(null,util[_0x2965('0x2a')](_0x2965('0x2b'),Date['now'](),_0x376be2[_0x2965('0x2c')]));}})});router['post'](_0x2965('0x16'),upload[_0x2965('0x2d')]('file'),controller[_0x2965('0x33')]);var upload=multer({'storage':multer[_0x2965('0x27')]({'destination':function(_0x128997,_0x35f00f,_0x2531ec){_0x2531ec(null,path[_0x2965('0x2f')](config[_0x2965('0x28')],_0x2965('0x30')));},'filename':function(_0xd31483,_0x5f22c0,_0x48b212){_0x48b212(null,util[_0x2965('0x2a')](_0x2965('0x2b'),Date[_0x2965('0x31')](),_0x5f22c0[_0x2965('0x2c')]));}})});router[_0x2965('0x23')]('/:id/system_avatar',upload['single'](_0x2965('0x2e')),controller[_0x2965('0x34')]);router[_0x2965('0x23')]('/:id/notify',controller[_0x2965('0x35')]);const offlineUploadMulter=multer({'storage':multer[_0x2965('0x27')]({'destination':function(_0x72e79d,_0x2bd660,_0x3fa59d){const _0x194a44=path[_0x2965('0x2f')](config['root'],'server/files',_0x2965('0x36'),'offline-chat');fs_extra[_0x2965('0x37')](_0x194a44,function(){_0x3fa59d(null,_0x194a44);});},'filename':function(_0x24bfd3,_0x3a29dc,_0x4bbe12){const _0x1feb39=_0x3a29dc[_0x2965('0x2c')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x5847dc=path[_0x2965('0x38')](_0x1feb39);const _0x4d5e21=Date[_0x2965('0x31')]()+'-'+_0x1feb39['replace'](_0x5847dc,'')+_0x5847dc;_0x4bbe12(null,_0x4d5e21);}})});router[_0x2965('0x23')]('/:id/offline',offlineUploadMulter['any'](),controller[_0x2965('0x39')]);router[_0x2965('0x23')](_0x2965('0x19'),auth[_0x2965('0x9')](),controller[_0x2965('0x3a')]);router[_0x2965('0x23')](_0x2965('0x1b'),auth[_0x2965('0x9')](),controller['addApplications']);router[_0x2965('0x23')]('/:id/proactive_actions',auth['isAuthenticated'](),controller['addProactiveActions']);router[_0x2965('0x23')](_0x2965('0x21'),auth[_0x2965('0x9')](),controller[_0x2965('0x3b')]);router['put']('/:id',auth[_0x2965('0x9')](),controller[_0x2965('0x3c')]);router[_0x2965('0x3d')](_0x2965('0xd'),auth[_0x2965('0x9')](),controller[_0x2965('0x3e')]);router[_0x2965('0x3d')](_0x2965('0xf'),auth[_0x2965('0x9')](),controller[_0x2965('0x3f')]);router[_0x2965('0x3d')](_0x2965('0x26'),auth[_0x2965('0x9')](),controller[_0x2965('0x40')]);router['delete'](_0x2965('0x21'),auth['isAuthenticated'](),controller[_0x2965('0x41')]);module[_0x2965('0x42')]=router; \ No newline at end of file +var _0x9f27=['/:id/canned_answers','getLogo','getAvatar','/:id/customer_avatar','getCustomerAvatar','/:id/system_avatar','/:id/interactions','getInteractions','getSnippet','/:id/applications','/:id/proactive_actions','getProactiveActions','getFields','/:id/offline_messages','getOfflineMessages','/:id/users','getAgents','post','create','addDisposition','diskStorage','root','server/files/images/logos/','%s-%s','now','originalname','/:id/logo','single','file','addLogo','join','server/files/images/avatars/','/:id/avatar','format','addSystemAvatar','notify','attachments','ensureDir','replace','/:id/offline','offline','addApplications','addProactiveActions','addAgents','update','delete','destroy','/:id/dispositions','removeDispositions','removeAgents','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatWebsite.controller','get','index','isAuthenticated','describe','/:id','show'];(function(_0x19e520,_0x117fef){var _0x400a80=function(_0x3e74c9){while(--_0x3e74c9){_0x19e520['push'](_0x19e520['shift']());}};_0x400a80(++_0x117fef);}(_0x9f27,0x136));var _0x79f2=function(_0x3735d7,_0x3e79e7){_0x3735d7=_0x3735d7-0x0;var _0x2961c4=_0x9f27[_0x3735d7];return _0x2961c4;};'use strict';var multer=require(_0x79f2('0x0'));var util=require(_0x79f2('0x1'));var path=require(_0x79f2('0x2'));var timeout=require(_0x79f2('0x3'));var express=require('express');var router=express[_0x79f2('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x79f2('0x5'));var interaction=require(_0x79f2('0x6'));var config=require(_0x79f2('0x7'));var controller=require(_0x79f2('0x8'));router[_0x79f2('0x9')]('/',auth['isAuthenticated'](),controller[_0x79f2('0xa')]);router[_0x79f2('0x9')]('/describe',auth[_0x79f2('0xb')](),controller[_0x79f2('0xc')]);router[_0x79f2('0x9')](_0x79f2('0xd'),auth[_0x79f2('0xb')](),controller[_0x79f2('0xe')]);router[_0x79f2('0x9')]('/:id/dispositions',auth[_0x79f2('0xb')](),controller['getDispositions']);router[_0x79f2('0x9')](_0x79f2('0xf'),auth['isAuthenticated'](),controller['getAnswers']);router[_0x79f2('0x9')]('/:id/logo',controller[_0x79f2('0x10')]);router[_0x79f2('0x9')]('/:id/avatar',controller[_0x79f2('0x11')]);router[_0x79f2('0x9')](_0x79f2('0x12'),controller[_0x79f2('0x13')]);router[_0x79f2('0x9')](_0x79f2('0x14'),controller['getSystemAvatar']);router[_0x79f2('0x9')](_0x79f2('0x15'),auth[_0x79f2('0xb')](),controller[_0x79f2('0x16')]);router[_0x79f2('0x9')]('/:id/snippet',controller[_0x79f2('0x17')]);router[_0x79f2('0x9')](_0x79f2('0x18'),auth[_0x79f2('0xb')](),controller['getApplications']);router['get'](_0x79f2('0x19'),auth[_0x79f2('0xb')](),controller[_0x79f2('0x1a')]);router[_0x79f2('0x9')]('/:id/fields',controller[_0x79f2('0x1b')]);router[_0x79f2('0x9')](_0x79f2('0x1c'),auth[_0x79f2('0xb')](),controller[_0x79f2('0x1d')]);router[_0x79f2('0x9')](_0x79f2('0x1e'),auth[_0x79f2('0xb')](),controller[_0x79f2('0x1f')]);router[_0x79f2('0x20')]('/',auth['isAuthenticated'](),controller[_0x79f2('0x21')]);router[_0x79f2('0x20')]('/:id/dispositions',auth['isAuthenticated'](),controller[_0x79f2('0x22')]);router[_0x79f2('0x20')](_0x79f2('0xf'),auth[_0x79f2('0xb')](),controller['addAnswer']);var upload=multer({'storage':multer[_0x79f2('0x23')]({'destination':function(_0x4e6e2c,_0x1de61b,_0x2bcfa1){_0x2bcfa1(null,path['join'](config[_0x79f2('0x24')],_0x79f2('0x25')));},'filename':function(_0x1a7229,_0x16fa62,_0xa83a7e){_0xa83a7e(null,util['format'](_0x79f2('0x26'),Date[_0x79f2('0x27')](),_0x16fa62[_0x79f2('0x28')]));}})});router[_0x79f2('0x20')](_0x79f2('0x29'),upload[_0x79f2('0x2a')](_0x79f2('0x2b')),controller[_0x79f2('0x2c')]);var upload=multer({'storage':multer[_0x79f2('0x23')]({'destination':function(_0x6f6395,_0x18e74c,_0xd7ccf3){_0xd7ccf3(null,path[_0x79f2('0x2d')](config[_0x79f2('0x24')],_0x79f2('0x2e')));},'filename':function(_0x125038,_0x210e7c,_0x1d8f07){_0x1d8f07(null,util['format'](_0x79f2('0x26'),Date[_0x79f2('0x27')](),_0x210e7c[_0x79f2('0x28')]));}})});router[_0x79f2('0x20')](_0x79f2('0x2f'),upload[_0x79f2('0x2a')](_0x79f2('0x2b')),controller['addAvatar']);var upload=multer({'storage':multer[_0x79f2('0x23')]({'destination':function(_0x48c8da,_0x5b10bc,_0xd94143){_0xd94143(null,path[_0x79f2('0x2d')](config[_0x79f2('0x24')],_0x79f2('0x2e')));},'filename':function(_0x1eff8b,_0x131d73,_0x186555){_0x186555(null,util[_0x79f2('0x30')](_0x79f2('0x26'),Date['now'](),_0x131d73[_0x79f2('0x28')]));}})});router['post'](_0x79f2('0x12'),upload[_0x79f2('0x2a')](_0x79f2('0x2b')),controller['addCustomerAvatar']);var upload=multer({'storage':multer[_0x79f2('0x23')]({'destination':function(_0x18a7d5,_0x126032,_0x112cd0){_0x112cd0(null,path[_0x79f2('0x2d')](config[_0x79f2('0x24')],_0x79f2('0x2e')));},'filename':function(_0x4dd234,_0x636c61,_0x1f1b0c){_0x1f1b0c(null,util[_0x79f2('0x30')](_0x79f2('0x26'),Date[_0x79f2('0x27')](),_0x636c61[_0x79f2('0x28')]));}})});router[_0x79f2('0x20')](_0x79f2('0x14'),upload['single']('file'),controller[_0x79f2('0x31')]);router[_0x79f2('0x20')]('/:id/notify',controller[_0x79f2('0x32')]);const offlineUploadMulter=multer({'storage':multer[_0x79f2('0x23')]({'destination':function(_0x53d777,_0xe19797,_0xc67906){const _0x3db524=path['join'](config['root'],'server/files',_0x79f2('0x33'),'offline-chat');fs_extra[_0x79f2('0x34')](_0x3db524,function(){_0xc67906(null,_0x3db524);});},'filename':function(_0x5b4967,_0x24c846,_0x7a35d0){const _0x4d21ed=_0x24c846[_0x79f2('0x28')][_0x79f2('0x35')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x2ece97=path['extname'](_0x4d21ed);const _0x525b2b=Date[_0x79f2('0x27')]()+'-'+_0x4d21ed[_0x79f2('0x35')](_0x2ece97,'')+_0x2ece97;_0x7a35d0(null,_0x525b2b);}})});router[_0x79f2('0x20')](_0x79f2('0x36'),offlineUploadMulter['any'](),controller[_0x79f2('0x37')]);router[_0x79f2('0x20')]('/:id/interactions',auth['isAuthenticated'](),controller['addInteraction']);router['post'](_0x79f2('0x18'),auth[_0x79f2('0xb')](),controller[_0x79f2('0x38')]);router[_0x79f2('0x20')](_0x79f2('0x19'),auth[_0x79f2('0xb')](),controller[_0x79f2('0x39')]);router['post'](_0x79f2('0x1e'),auth[_0x79f2('0xb')](),controller[_0x79f2('0x3a')]);router['put'](_0x79f2('0xd'),auth[_0x79f2('0xb')](),controller[_0x79f2('0x3b')]);router[_0x79f2('0x3c')]('/:id',auth[_0x79f2('0xb')](),controller[_0x79f2('0x3d')]);router[_0x79f2('0x3c')](_0x79f2('0x3e'),auth['isAuthenticated'](),controller[_0x79f2('0x3f')]);router[_0x79f2('0x3c')](_0x79f2('0xf'),auth['isAuthenticated'](),controller['removeAnswers']);router[_0x79f2('0x3c')](_0x79f2('0x1e'),auth['isAuthenticated'](),controller[_0x79f2('0x40')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.attributes.js b/server/api/cloudProvider/cloudProvider.attributes.js index 4b4b55a..b543b20 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 _0x8f6b=['Google','sequelize','exports','STRING','AmazonAWS'];(function(_0xb68ae,_0x2bd5e4){var _0x3eb127=function(_0x45736c){while(--_0x45736c){_0xb68ae['push'](_0xb68ae['shift']());}};_0x3eb127(++_0x2bd5e4);}(_0x8f6b,0x146));var _0xb8f6=function(_0x37c22c,_0x28a70d){_0x37c22c=_0x37c22c-0x0;var _0x119d79=_0x8f6b[_0x37c22c];return _0x119d79;};'use strict';var Sequelize=require(_0xb8f6('0x0'));module[_0xb8f6('0x1')]={'name':{'type':Sequelize[_0xb8f6('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize['ENUM'](_0xb8f6('0x3'),_0xb8f6('0x4')),'allowNull':![],'validate':{'notEmpty':!![]}},'data1':{'type':Sequelize['STRING']},'data2':{'type':Sequelize[_0xb8f6('0x2')]}}; \ No newline at end of file +var _0xee55=['STRING','AmazonAWS','sequelize'];(function(_0x1b836a,_0x53e6fe){var _0x3900ea=function(_0x34ec7b){while(--_0x34ec7b){_0x1b836a['push'](_0x1b836a['shift']());}};_0x3900ea(++_0x53e6fe);}(_0xee55,0x1a0));var _0x5ee5=function(_0x44fef1,_0x132cf4){_0x44fef1=_0x44fef1-0x0;var _0x3c3a04=_0xee55[_0x44fef1];return _0x3c3a04;};'use strict';var Sequelize=require(_0x5ee5('0x0'));module['exports']={'name':{'type':Sequelize[_0x5ee5('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize['ENUM'](_0x5ee5('0x2'),'Google'),'allowNull':![],'validate':{'notEmpty':!![]}},'data1':{'type':Sequelize[_0x5ee5('0x1')]},'data2':{'type':Sequelize[_0x5ee5('0x1')]}}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.controller.js b/server/api/cloudProvider/cloudProvider.controller.js index d3c31eb..d83f662 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 _0x5f2f=['end','status','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','stack','name','send','index','CloudProvider','rawAttributes','fieldName','type','map','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','filter','merge','where','options','includeAll','include','findAll','rows','catch','keys','find','body','params','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus'];(function(_0x49ca18,_0x5e6d05){var _0x145d54=function(_0x30b9be){while(--_0x30b9be){_0x49ca18['push'](_0x49ca18['shift']());}};_0x145d54(++_0x5e6d05);}(_0x5f2f,0x73));var _0xf5f2=function(_0x3c28c1,_0x1a47aa){_0x3c28c1=_0x3c28c1-0x0;var _0x41a913=_0x5f2f[_0x3c28c1];return _0x41a913;};'use strict';var emlformat=require(_0xf5f2('0x0'));var rimraf=require(_0xf5f2('0x1'));var zipdir=require(_0xf5f2('0x2'));var jsonpatch=require(_0xf5f2('0x3'));var rp=require(_0xf5f2('0x4'));var moment=require(_0xf5f2('0x5'));var BPromise=require(_0xf5f2('0x6'));var Mustache=require(_0xf5f2('0x7'));var util=require('util');var path=require('path');var sox=require(_0xf5f2('0x8'));var csv=require(_0xf5f2('0x9'));var ejs=require(_0xf5f2('0xa'));var fs=require('fs');var fs_extra=require(_0xf5f2('0xb'));var _=require(_0xf5f2('0xc'));var squel=require(_0xf5f2('0xd'));var crypto=require('crypto');var jsforce=require(_0xf5f2('0xe'));var deskjs=require(_0xf5f2('0xf'));var toCsv=require(_0xf5f2('0x9'));var querystring=require('querystring');var Papa=require(_0xf5f2('0x10'));var Redis=require(_0xf5f2('0x11'));var authService=require(_0xf5f2('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xf5f2('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xf5f2('0x14'));var utils=require(_0xf5f2('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xf5f2('0x16'));var db=require(_0xf5f2('0x17'))['db'];function respondWithStatusCode(_0x331482,_0x3f2997){_0x3f2997=_0x3f2997||0xcc;return function(_0x59bb6c){if(_0x59bb6c){return _0x331482[_0xf5f2('0x18')](_0x3f2997);}return _0x331482['status'](_0x3f2997)[_0xf5f2('0x19')]();};}function respondWithResult(_0xea612c,_0x269909){_0x269909=_0x269909||0xc8;return function(_0x1c1a5c){if(_0x1c1a5c){return _0xea612c[_0xf5f2('0x1a')](_0x269909)['json'](_0x1c1a5c);}};}function respondWithFilteredResult(_0xafe430,_0x286197){return function(_0x17d656){if(_0x17d656){var _0x1b6dd2=typeof _0x286197[_0xf5f2('0x1b')]===_0xf5f2('0x1c')&&typeof _0x286197[_0xf5f2('0x1d')]===_0xf5f2('0x1c');var _0x11f702=_0x17d656[_0xf5f2('0x1e')];var _0x20fccd=_0x1b6dd2?0x0:_0x286197[_0xf5f2('0x1b')];var _0x4ff59b=_0x1b6dd2?_0x17d656[_0xf5f2('0x1e')]:_0x286197[_0xf5f2('0x1b')]+_0x286197[_0xf5f2('0x1d')];var _0x1bf655;if(_0x4ff59b>=_0x11f702){_0x4ff59b=_0x11f702;_0x1bf655=0xc8;}else{_0x1bf655=0xce;}_0xafe430['status'](_0x1bf655);return _0xafe430[_0xf5f2('0x1f')](_0xf5f2('0x20'),_0x20fccd+'-'+_0x4ff59b+'/'+_0x11f702)['json'](_0x17d656);}return null;};}function patchUpdates(_0x47acfc){return function(_0x2d2805){try{jsonpatch[_0xf5f2('0x21')](_0x2d2805,_0x47acfc,!![]);}catch(_0x4ae323){return BPromise[_0xf5f2('0x22')](_0x4ae323);}return _0x2d2805[_0xf5f2('0x23')]();};}function saveUpdates(_0x39e44a,_0x39c024){return function(_0x36f1cb){if(_0x36f1cb){return _0x36f1cb['update'](_0x39e44a)[_0xf5f2('0x24')](function(_0x4669a6){return _0x4669a6;});}return null;};}function removeEntity(_0x4e8bda,_0x2833fe){return function(_0x287ad5){if(_0x287ad5){return _0x287ad5['destroy']()['then'](function(){_0x4e8bda[_0xf5f2('0x1a')](0xcc)[_0xf5f2('0x19')]();});}};}function handleEntityNotFound(_0x13da6f,_0x1a5bb3){return function(_0xf6c58d){if(!_0xf6c58d){_0x13da6f[_0xf5f2('0x18')](0x194);}return _0xf6c58d;};}function handleError(_0x13a3be,_0x281ec8){_0x281ec8=_0x281ec8||0x1f4;return function(_0x294414){logger['error'](_0x294414[_0xf5f2('0x25')]);if(_0x294414[_0xf5f2('0x26')]){delete _0x294414[_0xf5f2('0x26')];}_0x13a3be[_0xf5f2('0x1a')](_0x281ec8)[_0xf5f2('0x27')](_0x294414);};}exports[_0xf5f2('0x28')]=function(_0x5b6672,_0x53cb96){var _0x22c826={},_0x14c829={},_0x11c771={'count':0x0,'rows':[]};var _0x5027ab=_['map'](db[_0xf5f2('0x29')][_0xf5f2('0x2a')],function(_0x17394a){return{'name':_0x17394a[_0xf5f2('0x2b')],'type':_0x17394a[_0xf5f2('0x2c')]['key']};});_0x14c829['model']=_[_0xf5f2('0x2d')](_0x5027ab,'name');_0x14c829[_0xf5f2('0x2e')]=_['keys'](_0x5b6672[_0xf5f2('0x2e')]);_0x14c829[_0xf5f2('0x2f')]=_[_0xf5f2('0x30')](_0x14c829[_0xf5f2('0x31')],_0x14c829[_0xf5f2('0x2e')]);_0x22c826[_0xf5f2('0x32')]=_[_0xf5f2('0x30')](_0x14c829[_0xf5f2('0x31')],qs['fields'](_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x33')]));_0x22c826[_0xf5f2('0x32')]=_0x22c826[_0xf5f2('0x32')][_0xf5f2('0x34')]?_0x22c826[_0xf5f2('0x32')]:_0x14c829[_0xf5f2('0x31')];if(!_0x5b6672['query'][_0xf5f2('0x35')](_0xf5f2('0x36'))){_0x22c826['limit']=qs[_0xf5f2('0x1d')](_0x5b6672['query'][_0xf5f2('0x1d')]);_0x22c826[_0xf5f2('0x1b')]=qs[_0xf5f2('0x1b')](_0x5b6672[_0xf5f2('0x2e')]['offset']);}_0x22c826['order']=qs[_0xf5f2('0x37')](_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x37')]);_0x22c826['where']=qs[_0xf5f2('0x2f')](_['pick'](_0x5b6672[_0xf5f2('0x2e')],_0x14c829['filters']),_0x5027ab);if(_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x38')]){_0x22c826['where']=_[_0xf5f2('0x39')](_0x22c826[_0xf5f2('0x3a')],{'$or':_[_0xf5f2('0x2d')](_0x5027ab,function(_0x35f738){if(_0x35f738['type']!=='VIRTUAL'){var _0x3d328f={};_0x3d328f[_0x35f738[_0xf5f2('0x26')]]={'$like':'%'+_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x38')]+'%'};return _0x3d328f;}})});}_0x22c826=_[_0xf5f2('0x39')]({},_0x22c826,_0x5b6672[_0xf5f2('0x3b')]);var _0x2bc20e={'where':_0x22c826['where']};return db[_0xf5f2('0x29')][_0xf5f2('0x1e')](_0x2bc20e)['then'](function(_0xc6a1ae){_0x11c771[_0xf5f2('0x1e')]=_0xc6a1ae;if(_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x3c')]){_0x22c826[_0xf5f2('0x3d')]=[{'all':!![]}];}return db[_0xf5f2('0x29')][_0xf5f2('0x3e')](_0x22c826);})[_0xf5f2('0x24')](function(_0x574f24){_0x11c771[_0xf5f2('0x3f')]=_0x574f24;return _0x11c771;})[_0xf5f2('0x24')](respondWithFilteredResult(_0x53cb96,_0x22c826))[_0xf5f2('0x40')](handleError(_0x53cb96,null));};exports['show']=function(_0x509dbc,_0x59eb00){var _0x76d21b={'raw':!![],'where':{'id':_0x509dbc['params']['id']}},_0x2ad13c={};_0x2ad13c[_0xf5f2('0x31')]=_[_0xf5f2('0x41')](db[_0xf5f2('0x29')][_0xf5f2('0x2a')]);_0x2ad13c[_0xf5f2('0x2e')]=_[_0xf5f2('0x41')](_0x509dbc[_0xf5f2('0x2e')]);_0x2ad13c[_0xf5f2('0x2f')]=_[_0xf5f2('0x30')](_0x2ad13c[_0xf5f2('0x31')],_0x2ad13c[_0xf5f2('0x2e')]);_0x76d21b[_0xf5f2('0x32')]=_[_0xf5f2('0x30')](_0x2ad13c[_0xf5f2('0x31')],qs['fields'](_0x509dbc[_0xf5f2('0x2e')]['fields']));_0x76d21b[_0xf5f2('0x32')]=_0x76d21b[_0xf5f2('0x32')][_0xf5f2('0x34')]?_0x76d21b[_0xf5f2('0x32')]:_0x2ad13c[_0xf5f2('0x31')];if(_0x509dbc[_0xf5f2('0x2e')]['includeAll']){_0x76d21b[_0xf5f2('0x3d')]=[{'all':!![]}];}_0x76d21b=_[_0xf5f2('0x39')]({},_0x76d21b,_0x509dbc[_0xf5f2('0x3b')]);return db[_0xf5f2('0x29')][_0xf5f2('0x42')](_0x76d21b)[_0xf5f2('0x24')](handleEntityNotFound(_0x59eb00,null))[_0xf5f2('0x24')](respondWithResult(_0x59eb00,null))[_0xf5f2('0x40')](handleError(_0x59eb00,null));};exports['create']=function(_0x35dece,_0x33ec29){return db[_0xf5f2('0x29')]['create'](_0x35dece[_0xf5f2('0x43')],{})[_0xf5f2('0x24')](respondWithResult(_0x33ec29,0xc9))[_0xf5f2('0x40')](handleError(_0x33ec29,null));};exports['update']=function(_0x57a7cb,_0x7bb942){if(_0x57a7cb[_0xf5f2('0x43')]['id']){delete _0x57a7cb['body']['id'];}return db[_0xf5f2('0x29')]['find']({'where':{'id':_0x57a7cb[_0xf5f2('0x44')]['id']}})['then'](handleEntityNotFound(_0x7bb942,null))[_0xf5f2('0x24')](saveUpdates(_0x57a7cb['body'],null))[_0xf5f2('0x24')](respondWithResult(_0x7bb942,null))[_0xf5f2('0x40')](handleError(_0x7bb942,null));};exports[_0xf5f2('0x45')]=function(_0x11a083,_0x4fa738){return db[_0xf5f2('0x29')][_0xf5f2('0x42')]({'where':{'id':_0x11a083['params']['id']}})['then'](handleEntityNotFound(_0x4fa738,null))[_0xf5f2('0x24')](removeEntity(_0x4fa738,null))[_0xf5f2('0x40')](handleError(_0x4fa738,null));}; \ No newline at end of file +var _0x7a54=['offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','CloudProvider','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(_0x1405ac,_0x59be33){var _0x2513d8=function(_0x578fb0){while(--_0x578fb0){_0x1405ac['push'](_0x1405ac['shift']());}};_0x2513d8(++_0x59be33);}(_0x7a54,0x106));var _0x47a5=function(_0x3e651a,_0x585620){_0x3e651a=_0x3e651a-0x0;var _0x4c9918=_0x7a54[_0x3e651a];return _0x4c9918;};'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['CloudProvider'][_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['CloudProvider']['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['CloudProvider']['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 diff --git a/server/api/cloudProvider/cloudProvider.model.js b/server/api/cloudProvider/cloudProvider.model.js index 1f47795..250f74e 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 _0x2f4e=['bluebird','request-promise','path','rimraf','../../config/environment','./cloudProvider.attributes','define','CloudProvider','cloud_providers','lodash','../../config/logger','moment'];(function(_0x3c79e4,_0x2e8c3f){var _0x51417a=function(_0x28f5d4){while(--_0x28f5d4){_0x3c79e4['push'](_0x3c79e4['shift']());}};_0x51417a(++_0x2e8c3f);}(_0x2f4e,0x69));var _0xe2f4=function(_0x359e0d,_0x4c7ce6){_0x359e0d=_0x359e0d-0x0;var _0x19fef8=_0x2f4e[_0x359e0d];return _0x19fef8;};'use strict';var _=require(_0xe2f4('0x0'));var util=require('util');var logger=require(_0xe2f4('0x1'))('api');var moment=require(_0xe2f4('0x2'));var BPromise=require(_0xe2f4('0x3'));var rp=require(_0xe2f4('0x4'));var fs=require('fs');var path=require(_0xe2f4('0x5'));var rimraf=require(_0xe2f4('0x6'));var config=require(_0xe2f4('0x7'));var attributes=require(_0xe2f4('0x8'));module['exports']=function(_0x17570d,_0x29940b){return _0x17570d[_0xe2f4('0x9')](_0xe2f4('0xa'),attributes,{'tableName':_0xe2f4('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x46a2=['bluebird','request-promise','path','../../config/environment','./cloudProvider.attributes','exports','define','CloudProvider','cloud_providers','util','../../config/logger'];(function(_0x1b828b,_0x344400){var _0x98da1a=function(_0x1a0f5b){while(--_0x1a0f5b){_0x1b828b['push'](_0x1b828b['shift']());}};_0x98da1a(++_0x344400);}(_0x46a2,0xda));var _0x246a=function(_0x4914ad,_0x551a18){_0x4914ad=_0x4914ad-0x0;var _0x3cd61f=_0x46a2[_0x4914ad];return _0x3cd61f;};'use strict';var _=require('lodash');var util=require(_0x246a('0x0'));var logger=require(_0x246a('0x1'))('api');var moment=require('moment');var BPromise=require(_0x246a('0x2'));var rp=require(_0x246a('0x3'));var fs=require('fs');var path=require(_0x246a('0x4'));var rimraf=require('rimraf');var config=require(_0x246a('0x5'));var attributes=require(_0x246a('0x6'));module[_0x246a('0x7')]=function(_0x20571b,_0xfbbf96){return _0x20571b[_0x246a('0x8')](_0x246a('0x9'),attributes,{'tableName':_0x246a('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.rpc.js b/server/api/cloudProvider/cloudProvider.rpc.js index b904021..492eb91 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 _0x80e0=['stringify','error','message','result','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','then','info','CloudProvider,\x20%s,\x20%s','request\x20sent'];(function(_0x1db374,_0x586e31){var _0x4dcd71=function(_0x1edb4a){while(--_0x1edb4a){_0x1db374['push'](_0x1db374['shift']());}};_0x4dcd71(++_0x586e31);}(_0x80e0,0x9d));var _0x080e=function(_0x51be24,_0x4fe801){_0x51be24=_0x51be24-0x0;var _0x218890=_0x80e0[_0x51be24];return _0x218890;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x080e('0x0'));var BPromise=require(_0x080e('0x1'));var rs=require(_0x080e('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x080e('0x3'))['db'];var utils=require(_0x080e('0x4'));var logger=require(_0x080e('0x5'))('rpc');var config=require(_0x080e('0x6'));var jayson=require(_0x080e('0x7'));var client=jayson[_0x080e('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4b61b7,_0x5583f7,_0xd00ba7){return new BPromise(function(_0x535ebf,_0x2886dd){return client['request'](_0x4b61b7,_0xd00ba7)[_0x080e('0x9')](function(_0x1241ec){logger[_0x080e('0xa')](_0x080e('0xb'),_0x5583f7,_0x080e('0xc'));logger['debug']('CloudProvider,\x20%s,\x20%s,\x20%s',_0x5583f7,_0x080e('0xc'),JSON[_0x080e('0xd')](_0x1241ec));if(_0x1241ec[_0x080e('0xe')]){if(_0x1241ec[_0x080e('0xe')]['code']===0x1f4){logger['error'](_0x080e('0xb'),_0x5583f7,_0x1241ec[_0x080e('0xe')][_0x080e('0xf')]);return _0x2886dd(_0x1241ec['error'][_0x080e('0xf')]);}logger[_0x080e('0xe')]('CloudProvider,\x20%s,\x20%s',_0x5583f7,_0x1241ec['error']['message']);return _0x535ebf(_0x1241ec['error'][_0x080e('0xf')]);}else{logger[_0x080e('0xa')]('CloudProvider,\x20%s,\x20%s',_0x5583f7,'request\x20sent');_0x535ebf(_0x1241ec[_0x080e('0x10')]['message']);}})['catch'](function(_0x1b87fb){logger['error'](_0x080e('0xb'),_0x5583f7,_0x1b87fb);_0x2886dd(_0x1b87fb);});});} \ No newline at end of file +var _0x86c0=['CloudProvider,\x20%s,\x20%s,\x20%s','stringify','error','code','CloudProvider,\x20%s,\x20%s','message','info','result','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','request\x20sent','debug'];(function(_0x32b542,_0x4512fa){var _0x554d54=function(_0x35cdfc){while(--_0x35cdfc){_0x32b542['push'](_0x32b542['shift']());}};_0x554d54(++_0x4512fa);}(_0x86c0,0x133));var _0x086c=function(_0x34b41b,_0x9ea658){_0x34b41b=_0x34b41b-0x0;var _0x52b590=_0x86c0[_0x34b41b];return _0x52b590;};'use strict';var _=require(_0x086c('0x0'));var util=require('util');var moment=require(_0x086c('0x1'));var BPromise=require(_0x086c('0x2'));var rs=require(_0x086c('0x3'));var fs=require('fs');var Redis=require(_0x086c('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x086c('0x5'));var logger=require(_0x086c('0x6'))(_0x086c('0x7'));var config=require(_0x086c('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x086c('0x9')][_0x086c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2e27a8,_0x387428,_0x117df9){return new BPromise(function(_0x25e437,_0x52b942){return client[_0x086c('0xb')](_0x2e27a8,_0x117df9)[_0x086c('0xc')](function(_0xa1b79a){logger['info']('CloudProvider,\x20%s,\x20%s',_0x387428,_0x086c('0xd'));logger[_0x086c('0xe')](_0x086c('0xf'),_0x387428,_0x086c('0xd'),JSON[_0x086c('0x10')](_0xa1b79a));if(_0xa1b79a['error']){if(_0xa1b79a[_0x086c('0x11')][_0x086c('0x12')]===0x1f4){logger[_0x086c('0x11')](_0x086c('0x13'),_0x387428,_0xa1b79a['error']['message']);return _0x52b942(_0xa1b79a[_0x086c('0x11')]['message']);}logger[_0x086c('0x11')](_0x086c('0x13'),_0x387428,_0xa1b79a['error'][_0x086c('0x14')]);return _0x25e437(_0xa1b79a[_0x086c('0x11')][_0x086c('0x14')]);}else{logger[_0x086c('0x15')]('CloudProvider,\x20%s,\x20%s',_0x387428,_0x086c('0xd'));_0x25e437(_0xa1b79a[_0x086c('0x16')][_0x086c('0x14')]);}})['catch'](function(_0x34e74f){logger[_0x086c('0x11')](_0x086c('0x13'),_0x387428,_0x34e74f);_0x52b942(_0x34e74f);});});} \ No newline at end of file diff --git a/server/api/cloudProvider/index.js b/server/api/cloudProvider/index.js index d302637..1540f77 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 _0x1544=['create','update','delete','exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1544,0x6a));var _0x4154=function(_0x1ecb71,_0x370253){_0x1ecb71=_0x1ecb71-0x0;var _0x402229=_0x1544[_0x1ecb71];return _0x402229;};'use strict';var multer=require(_0x4154('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x4154('0x1'));var express=require(_0x4154('0x2'));var router=express[_0x4154('0x3')]();var fs_extra=require(_0x4154('0x4'));var auth=require(_0x4154('0x5'));var interaction=require(_0x4154('0x6'));var config=require(_0x4154('0x7'));var controller=require('./cloudProvider.controller');router[_0x4154('0x8')]('/',auth[_0x4154('0x9')](),controller[_0x4154('0xa')]);router['get'](_0x4154('0xb'),auth[_0x4154('0x9')](),controller[_0x4154('0xc')]);router['post']('/',auth[_0x4154('0x9')](),controller[_0x4154('0xd')]);router['put'](_0x4154('0xb'),auth[_0x4154('0x9')](),controller[_0x4154('0xe')]);router[_0x4154('0xf')](_0x4154('0xb'),auth['isAuthenticated'](),controller['destroy']);module[_0x4154('0x10')]=router; \ No newline at end of file +var _0x3185=['Router','fs-extra','../../components/auth/service','../../config/environment','./cloudProvider.controller','get','isAuthenticated','/:id','show','post','put','update','delete','destroy','multer','util','path','connect-timeout','express'];(function(_0x2fc012,_0x503e5b){var _0x2891f9=function(_0x295f5e){while(--_0x295f5e){_0x2fc012['push'](_0x2fc012['shift']());}};_0x2891f9(++_0x503e5b);}(_0x3185,0x177));var _0x5318=function(_0x1b641a,_0x24dfaa){_0x1b641a=_0x1b641a-0x0;var _0xa54bf7=_0x3185[_0x1b641a];return _0xa54bf7;};'use strict';var multer=require(_0x5318('0x0'));var util=require(_0x5318('0x1'));var path=require(_0x5318('0x2'));var timeout=require(_0x5318('0x3'));var express=require(_0x5318('0x4'));var router=express[_0x5318('0x5')]();var fs_extra=require(_0x5318('0x6'));var auth=require(_0x5318('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x5318('0x8'));var controller=require(_0x5318('0x9'));router[_0x5318('0xa')]('/',auth[_0x5318('0xb')](),controller['index']);router[_0x5318('0xa')](_0x5318('0xc'),auth['isAuthenticated'](),controller[_0x5318('0xd')]);router[_0x5318('0xe')]('/',auth[_0x5318('0xb')](),controller['create']);router[_0x5318('0xf')](_0x5318('0xc'),auth[_0x5318('0xb')](),controller[_0x5318('0x10')]);router[_0x5318('0x11')](_0x5318('0xc'),auth[_0x5318('0xb')](),controller[_0x5318('0x12')]);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 c2a601d..e065bbd 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 _0x2b43=['name','sequelize','exports','STRING'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x2b43,0x129));var _0x32b4=function(_0x131832,_0x2235db){_0x131832=_0x131832-0x0;var _0x168e2f=_0x2b43[_0x131832];return _0x168e2f;};'use strict';var Sequelize=require(_0x32b4('0x0'));module[_0x32b4('0x1')]={'name':{'type':Sequelize[_0x32b4('0x2')],'unique':_0x32b4('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x32b4('0x2')]},'companyId':{'type':Sequelize[_0x32b4('0x2')]},'website':{'type':Sequelize[_0x32b4('0x2')]},'phone':{'type':Sequelize['STRING']},'fax':{'type':Sequelize['STRING']},'type':{'type':Sequelize['STRING']},'street':{'type':Sequelize[_0x32b4('0x2')]},'postalCode':{'type':Sequelize[_0x32b4('0x2')]},'city':{'type':Sequelize[_0x32b4('0x2')]},'country':{'type':Sequelize[_0x32b4('0x2')]},'email':{'type':Sequelize[_0x32b4('0x2')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize['STRING']},'sStreet':{'type':Sequelize['STRING']},'sPostalCode':{'type':Sequelize[_0x32b4('0x2')]},'sCity':{'type':Sequelize['STRING']},'sCountry':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x32b4('0x2')]}}; \ No newline at end of file +var _0x041a=['name','sequelize','exports','STRING'];(function(_0x2cdec6,_0x39d4c8){var _0xa36703=function(_0x6bb8d4){while(--_0x6bb8d4){_0x2cdec6['push'](_0x2cdec6['shift']());}};_0xa36703(++_0x39d4c8);}(_0x041a,0x135));var _0xa041=function(_0x4de1b1,_0x18c64c){_0x4de1b1=_0x4de1b1-0x0;var _0x639f27=_0x041a[_0x4de1b1];return _0x639f27;};'use strict';var Sequelize=require(_0xa041('0x0'));module[_0xa041('0x1')]={'name':{'type':Sequelize[_0xa041('0x2')],'unique':_0xa041('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0xa041('0x2')]},'companyId':{'type':Sequelize[_0xa041('0x2')]},'website':{'type':Sequelize[_0xa041('0x2')]},'phone':{'type':Sequelize[_0xa041('0x2')]},'fax':{'type':Sequelize[_0xa041('0x2')]},'type':{'type':Sequelize['STRING']},'street':{'type':Sequelize[_0xa041('0x2')]},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0xa041('0x2')]},'country':{'type':Sequelize[_0xa041('0x2')]},'email':{'type':Sequelize[_0xa041('0x2')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0xa041('0x2')]},'sStreet':{'type':Sequelize[_0xa041('0x2')]},'sPostalCode':{'type':Sequelize[_0xa041('0x2')]},'sCity':{'type':Sequelize[_0xa041('0x2')]},'sCountry':{'type':Sequelize[_0xa041('0x2')]},'description':{'type':Sequelize[_0xa041('0x2')]}}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.controller.js b/server/api/cmCompany/cmCompany.controller.js index 9187451..cce9d90 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 _0x61be=['create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','get','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','addContacts','CmContact','ids','omit','findOne','length','map','getContacts','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','to-csv','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','limit','offset','count','set','Content-Range','apply','reject','save','update','then','destroy','Companies','end','stack','name','send','index','CmCompany','describe','model','keys','query','filters','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','include','catch','show','rawAttributes','intersection','includeAll'];(function(_0x2faddb,_0xc18b78){var _0x273c05=function(_0x1a3785){while(--_0x1a3785){_0x2faddb['push'](_0x2faddb['shift']());}};_0x273c05(++_0xc18b78);}(_0x61be,0xc5));var _0xe61b=function(_0xd14903,_0x2034f0){_0xd14903=_0xd14903-0x0;var _0xe52b9a=_0x61be[_0xd14903];return _0xe52b9a;};'use strict';var emlformat=require(_0xe61b('0x0'));var rimraf=require(_0xe61b('0x1'));var zipdir=require(_0xe61b('0x2'));var jsonpatch=require(_0xe61b('0x3'));var rp=require(_0xe61b('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0xe61b('0x5'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe61b('0x6'));var _=require(_0xe61b('0x7'));var squel=require(_0xe61b('0x8'));var crypto=require('crypto');var jsforce=require(_0xe61b('0x9'));var deskjs=require(_0xe61b('0xa'));var toCsv=require(_0xe61b('0x5'));var querystring=require('querystring');var Papa=require(_0xe61b('0xb'));var Redis=require(_0xe61b('0xc'));var authService=require(_0xe61b('0xd'));var qs=require(_0xe61b('0xe'));var as=require(_0xe61b('0xf'));var hardwareService=require(_0xe61b('0x10'));var logger=require(_0xe61b('0x11'))(_0xe61b('0x12'));var utils=require(_0xe61b('0x13'));var config=require(_0xe61b('0x14'));var licenseUtil=require(_0xe61b('0x15'));var db=require(_0xe61b('0x16'))['db'];function respondWithStatusCode(_0x55fe91,_0x4f0119){_0x4f0119=_0x4f0119||0xcc;return function(_0x3a06f1){if(_0x3a06f1){return _0x55fe91[_0xe61b('0x17')](_0x4f0119);}return _0x55fe91[_0xe61b('0x18')](_0x4f0119)['end']();};}function respondWithResult(_0x8ae869,_0x3e08da){_0x3e08da=_0x3e08da||0xc8;return function(_0x4786ec){if(_0x4786ec){return _0x8ae869['status'](_0x3e08da)[_0xe61b('0x19')](_0x4786ec);}};}function respondWithFilteredResult(_0x557086,_0x25bfa9){return function(_0x179692){if(_0x179692){var _0x5be531=typeof _0x25bfa9['offset']===_0xe61b('0x1a')&&typeof _0x25bfa9[_0xe61b('0x1b')]===_0xe61b('0x1a');var _0x4eabca=_0x179692['count'];var _0x5f5380=_0x5be531?0x0:_0x25bfa9[_0xe61b('0x1c')];var _0x378629=_0x5be531?_0x179692[_0xe61b('0x1d')]:_0x25bfa9['offset']+_0x25bfa9['limit'];var _0x9d6b5d;if(_0x378629>=_0x4eabca){_0x378629=_0x4eabca;_0x9d6b5d=0xc8;}else{_0x9d6b5d=0xce;}_0x557086[_0xe61b('0x18')](_0x9d6b5d);return _0x557086[_0xe61b('0x1e')](_0xe61b('0x1f'),_0x5f5380+'-'+_0x378629+'/'+_0x4eabca)[_0xe61b('0x19')](_0x179692);}return null;};}function patchUpdates(_0x3df1fb){return function(_0x9d7821){try{jsonpatch[_0xe61b('0x20')](_0x9d7821,_0x3df1fb,!![]);}catch(_0x5e244f){return BPromise[_0xe61b('0x21')](_0x5e244f);}return _0x9d7821[_0xe61b('0x22')]();};}function saveUpdates(_0x2c30c7,_0x4209d8){return function(_0x758b84){if(_0x758b84){return _0x758b84[_0xe61b('0x23')](_0x2c30c7)[_0xe61b('0x24')](function(_0xa7e4f7){return _0xa7e4f7;});}return null;};}function removeEntity(_0x300570,_0x169026){return function(_0x283494){if(_0x283494){return _0x283494[_0xe61b('0x25')]()[_0xe61b('0x24')](function(){var _0x1e2ec2=_0x283494['get']({'plain':!![]});var _0x20cdba=_0xe61b('0x26');return db['UserProfileResource'][_0xe61b('0x25')]({'where':{'type':_0x20cdba,'resourceId':_0x1e2ec2['id']}})['then'](function(){return _0x283494;});})[_0xe61b('0x24')](function(){_0x300570[_0xe61b('0x18')](0xcc)[_0xe61b('0x27')]();});}};}function handleEntityNotFound(_0x490042,_0x56779a){return function(_0x3b236b){if(!_0x3b236b){_0x490042[_0xe61b('0x17')](0x194);}return _0x3b236b;};}function handleError(_0x28f2db,_0x145942){_0x145942=_0x145942||0x1f4;return function(_0x1e6989){logger['error'](_0x1e6989[_0xe61b('0x28')]);if(_0x1e6989['name']){delete _0x1e6989[_0xe61b('0x29')];}_0x28f2db[_0xe61b('0x18')](_0x145942)[_0xe61b('0x2a')](_0x1e6989);};}exports[_0xe61b('0x2b')]=function(_0x493108,_0x10c7eb){var _0x4310de={},_0x156066={},_0x57d6f7={'count':0x0,'rows':[]};return db[_0xe61b('0x2c')][_0xe61b('0x2d')]()[_0xe61b('0x24')](function(_0x1d6e37){_0x156066[_0xe61b('0x2e')]=_['keys'](_0x1d6e37);_0x156066['query']=_[_0xe61b('0x2f')](_0x493108[_0xe61b('0x30')]);_0x156066[_0xe61b('0x31')]=_['intersection'](_0x156066[_0xe61b('0x2e')],_0x156066['query']);_0x4310de[_0xe61b('0x32')]=_['intersection'](_0x156066[_0xe61b('0x2e')],qs[_0xe61b('0x33')](_0x493108[_0xe61b('0x30')][_0xe61b('0x33')]));_0x4310de['attributes']=_0x4310de['attributes']['length']?_0x4310de[_0xe61b('0x32')]:_0x156066[_0xe61b('0x2e')];if(!_0x493108[_0xe61b('0x30')][_0xe61b('0x34')](_0xe61b('0x35'))){_0x4310de[_0xe61b('0x1b')]=qs[_0xe61b('0x1b')](_0x493108[_0xe61b('0x30')][_0xe61b('0x1b')]);_0x4310de['offset']=qs['offset'](_0x493108[_0xe61b('0x30')][_0xe61b('0x1c')]);}_0x4310de[_0xe61b('0x36')]=qs['sort'](_0x493108['query'][_0xe61b('0x37')]);_0x4310de[_0xe61b('0x38')]=qs[_0xe61b('0x31')](_[_0xe61b('0x39')](_0x493108[_0xe61b('0x30')],_0x156066['filters']),_0x1d6e37);if(_0x493108[_0xe61b('0x30')][_0xe61b('0x3a')]){_0x4310de[_0xe61b('0x38')]=_[_0xe61b('0x3b')](_0x4310de['where'],{'$or':_['map'](_0x4310de['attributes'],function(_0x26a81e){var _0x2fe2b7={};_0x2fe2b7[_0x26a81e]={'$like':'%'+_0x493108[_0xe61b('0x30')][_0xe61b('0x3a')]+'%'};return _0x2fe2b7;})});}_0x4310de=_['merge']({},_0x4310de,_0x493108[_0xe61b('0x3c')]);var _0x135a03={'where':_0x4310de[_0xe61b('0x38')]};return db['CmCompany'][_0xe61b('0x1d')](_0x135a03)[_0xe61b('0x24')](function(_0x271a29){_0x57d6f7[_0xe61b('0x1d')]=_0x271a29;if(_0x493108[_0xe61b('0x30')]['includeAll']){_0x4310de[_0xe61b('0x3d')]=[{'all':!![]}];}return db['CmCompany']['findAll'](_0x4310de);})[_0xe61b('0x24')](function(_0x3582f3){_0x57d6f7['rows']=_0x3582f3;return _0x57d6f7;})['then'](respondWithFilteredResult(_0x10c7eb,_0x4310de))[_0xe61b('0x3e')](handleError(_0x10c7eb,null));})[_0xe61b('0x3e')](handleError(_0x10c7eb,null));};exports[_0xe61b('0x3f')]=function(_0x3f7702,_0x569609){var _0x46b101={'raw':![],'where':{'id':_0x3f7702['params']['id']}},_0x3bd052={};_0x3bd052['model']=_[_0xe61b('0x2f')](db[_0xe61b('0x2c')][_0xe61b('0x40')]);_0x3bd052[_0xe61b('0x30')]=_[_0xe61b('0x2f')](_0x3f7702[_0xe61b('0x30')]);_0x3bd052[_0xe61b('0x31')]=_[_0xe61b('0x41')](_0x3bd052[_0xe61b('0x2e')],_0x3bd052['query']);_0x46b101[_0xe61b('0x32')]=_[_0xe61b('0x41')](_0x3bd052[_0xe61b('0x2e')],qs[_0xe61b('0x33')](_0x3f7702[_0xe61b('0x30')]['fields']));_0x46b101[_0xe61b('0x32')]=_0x46b101[_0xe61b('0x32')]['length']?_0x46b101['attributes']:_0x3bd052[_0xe61b('0x2e')];if(_0x3f7702['query'][_0xe61b('0x42')]){_0x46b101[_0xe61b('0x3d')]=[{'all':!![]}];}_0x46b101=_[_0xe61b('0x3b')]({},_0x46b101,_0x3f7702[_0xe61b('0x3c')]);return db[_0xe61b('0x2c')]['find'](_0x46b101)[_0xe61b('0x24')](handleEntityNotFound(_0x569609,null))[_0xe61b('0x24')](respondWithResult(_0x569609,null))[_0xe61b('0x3e')](handleError(_0x569609,null));};exports[_0xe61b('0x43')]=function(_0x5ee0b9,_0x3fe2d2){return db[_0xe61b('0x2c')][_0xe61b('0x43')](_0x5ee0b9[_0xe61b('0x44')],{})[_0xe61b('0x24')](function(_0x4ab173){var _0x34b7=_0x5ee0b9[_0xe61b('0x45')]['get']({'plain':!![]});if(!_0x34b7)throw new Error(_0xe61b('0x46'));if(_0x34b7['role']===_0xe61b('0x45')){var _0x2e74dd=_0x4ab173[_0xe61b('0x47')]({'plain':!![]});var _0x5dbf7e='Companies';return db[_0xe61b('0x48')][_0xe61b('0x49')]({'where':{'name':_0x5dbf7e,'userProfileId':_0x34b7[_0xe61b('0x4a')]},'raw':!![]})[_0xe61b('0x24')](function(_0x30a2a1){if(_0x30a2a1&&_0x30a2a1[_0xe61b('0x4b')]===0x0){return db[_0xe61b('0x4c')][_0xe61b('0x43')]({'name':_0x2e74dd['name'],'resourceId':_0x2e74dd['id'],'type':_0x30a2a1[_0xe61b('0x29')],'sectionId':_0x30a2a1['id']},{})['then'](function(){return _0x4ab173;});}else{return _0x4ab173;}})[_0xe61b('0x3e')](function(_0x1c72fe){logger[_0xe61b('0x4d')](_0xe61b('0x4e'),_0x1c72fe);throw _0x1c72fe;});}return _0x4ab173;})['then'](respondWithResult(_0x3fe2d2,0xc9))['catch'](handleError(_0x3fe2d2,null));};exports[_0xe61b('0x23')]=function(_0x280375,_0x52f273){if(_0x280375[_0xe61b('0x44')]['id']){delete _0x280375[_0xe61b('0x44')]['id'];}return db[_0xe61b('0x2c')][_0xe61b('0x49')]({'where':{'id':_0x280375['params']['id']}})['then'](handleEntityNotFound(_0x52f273,null))[_0xe61b('0x24')](saveUpdates(_0x280375[_0xe61b('0x44')],null))[_0xe61b('0x24')](respondWithResult(_0x52f273,null))[_0xe61b('0x3e')](handleError(_0x52f273,null));};exports[_0xe61b('0x25')]=function(_0x3fdc6b,_0x59ea47){return db['CmCompany'][_0xe61b('0x49')]({'where':{'id':_0x3fdc6b[_0xe61b('0x4f')]['id']}})[_0xe61b('0x24')](handleEntityNotFound(_0x59ea47,null))[_0xe61b('0x24')](removeEntity(_0x59ea47,null))[_0xe61b('0x3e')](handleError(_0x59ea47,null));};exports[_0xe61b('0x2d')]=function(_0x50d0c1,_0x4ffa12){return db[_0xe61b('0x2c')][_0xe61b('0x2d')]()[_0xe61b('0x24')](respondWithResult(_0x4ffa12,null))[_0xe61b('0x3e')](handleError(_0x4ffa12,null));};exports[_0xe61b('0x50')]=function(_0x46604f,_0x1862c7,_0x32866a){return db[_0xe61b('0x51')][_0xe61b('0x49')]({'where':{'id':_0x46604f[_0xe61b('0x4f')]['id']}})[_0xe61b('0x24')](handleEntityNotFound(_0x1862c7,null))[_0xe61b('0x24')](function(_0x41409c){if(_0x41409c){return _0x41409c['addContacts'](_0x46604f[_0xe61b('0x44')][_0xe61b('0x52')],_[_0xe61b('0x53')](_0x46604f[_0xe61b('0x44')],[_0xe61b('0x52'),'id'])||{});}})[_0xe61b('0x24')](respondWithResult(_0x1862c7,null))['catch'](handleError(_0x1862c7,null));};exports['getContacts']=function(_0x528cb8,_0x14e7ab,_0x53b16f){var _0xa84bc6={};var _0x23231d={};var _0x7ff6e3;var _0x43db30;return db['CmCompany'][_0xe61b('0x54')]({'where':{'id':_0x528cb8[_0xe61b('0x4f')]['id']}})['then'](handleEntityNotFound(_0x14e7ab,null))[_0xe61b('0x24')](function(_0x178191){if(_0x178191){_0x7ff6e3=_0x178191;_0x23231d[_0xe61b('0x2e')]=_['keys'](db[_0xe61b('0x51')][_0xe61b('0x40')]);_0x23231d['query']=_[_0xe61b('0x2f')](_0x528cb8[_0xe61b('0x30')]);_0x23231d[_0xe61b('0x31')]=_[_0xe61b('0x41')](_0x23231d[_0xe61b('0x2e')],_0x23231d[_0xe61b('0x30')]);_0xa84bc6['attributes']=_[_0xe61b('0x41')](_0x23231d[_0xe61b('0x2e')],qs[_0xe61b('0x33')](_0x528cb8[_0xe61b('0x30')][_0xe61b('0x33')]));_0xa84bc6[_0xe61b('0x32')]=_0xa84bc6[_0xe61b('0x32')][_0xe61b('0x55')]?_0xa84bc6[_0xe61b('0x32')]:_0x23231d[_0xe61b('0x2e')];_0xa84bc6[_0xe61b('0x36')]=qs[_0xe61b('0x37')](_0x528cb8['query']['sort']);_0xa84bc6[_0xe61b('0x38')]=qs[_0xe61b('0x31')](_[_0xe61b('0x39')](_0x528cb8[_0xe61b('0x30')],_0x23231d[_0xe61b('0x31')]));if(_0x528cb8[_0xe61b('0x30')][_0xe61b('0x3a')]){_0xa84bc6[_0xe61b('0x38')]=_[_0xe61b('0x3b')](_0xa84bc6[_0xe61b('0x38')],{'$or':_[_0xe61b('0x56')](_0xa84bc6[_0xe61b('0x32')],function(_0x5b05eb){var _0xfa639a={};_0xfa639a[_0x5b05eb]={'$like':'%'+_0x528cb8[_0xe61b('0x30')][_0xe61b('0x3a')]+'%'};return _0xfa639a;})});}_0xa84bc6=_[_0xe61b('0x3b')]({},_0xa84bc6,_0x528cb8['options']);return _0x7ff6e3[_0xe61b('0x57')](_0xa84bc6);}})[_0xe61b('0x24')](function(_0x3ab991){if(_0x3ab991){_0x43db30=_0x3ab991[_0xe61b('0x55')];if(!_0x528cb8['query'][_0xe61b('0x34')](_0xe61b('0x35'))){_0xa84bc6[_0xe61b('0x1b')]=qs[_0xe61b('0x1b')](_0x528cb8[_0xe61b('0x30')]['limit']);_0xa84bc6[_0xe61b('0x1c')]=qs[_0xe61b('0x1c')](_0x528cb8[_0xe61b('0x30')][_0xe61b('0x1c')]);}return _0x7ff6e3[_0xe61b('0x57')](_0xa84bc6);}})[_0xe61b('0x24')](function(_0x3a4bd0){if(_0x3a4bd0){return _0x3a4bd0?{'count':_0x43db30,'rows':_0x3a4bd0}:null;}})['then'](respondWithResult(_0x14e7ab,null))['catch'](handleError(_0x14e7ab,null));}; \ No newline at end of file +var _0xb9ec=['sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','get','Companies','UserProfileResource','error','name','index','CmCompany','describe','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','map','merge','options','includeAll','include','findAll','rows','catch','show','rawAttributes','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','addContacts','ids','omit','getContacts','findOne','CmContact','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path'];(function(_0x350c84,_0x3e402f){var _0x168407=function(_0x3fc04c){while(--_0x3fc04c){_0x350c84['push'](_0x350c84['shift']());}};_0x168407(++_0x3e402f);}(_0xb9ec,0x1ba));var _0xcb9e=function(_0x1da4cc,_0x5a7240){_0x1da4cc=_0x1da4cc-0x0;var _0x2785b4=_0xb9ec[_0x1da4cc];return _0x2785b4;};'use strict';var emlformat=require(_0xcb9e('0x0'));var rimraf=require(_0xcb9e('0x1'));var zipdir=require(_0xcb9e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xcb9e('0x3'));var BPromise=require(_0xcb9e('0x4'));var Mustache=require(_0xcb9e('0x5'));var util=require(_0xcb9e('0x6'));var path=require(_0xcb9e('0x7'));var sox=require(_0xcb9e('0x8'));var csv=require('to-csv');var ejs=require(_0xcb9e('0x9'));var fs=require('fs');var fs_extra=require(_0xcb9e('0xa'));var _=require(_0xcb9e('0xb'));var squel=require(_0xcb9e('0xc'));var crypto=require(_0xcb9e('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xcb9e('0xe'));var toCsv=require(_0xcb9e('0xf'));var querystring=require(_0xcb9e('0x10'));var Papa=require(_0xcb9e('0x11'));var Redis=require(_0xcb9e('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xcb9e('0x13'));var as=require(_0xcb9e('0x14'));var hardwareService=require(_0xcb9e('0x15'));var logger=require('../../config/logger')(_0xcb9e('0x16'));var utils=require(_0xcb9e('0x17'));var config=require(_0xcb9e('0x18'));var licenseUtil=require(_0xcb9e('0x19'));var db=require(_0xcb9e('0x1a'))['db'];function respondWithStatusCode(_0x651559,_0x298cf1){_0x298cf1=_0x298cf1||0xcc;return function(_0x4f7fdf){if(_0x4f7fdf){return _0x651559[_0xcb9e('0x1b')](_0x298cf1);}return _0x651559['status'](_0x298cf1)[_0xcb9e('0x1c')]();};}function respondWithResult(_0x23dd7b,_0x4bf5cd){_0x4bf5cd=_0x4bf5cd||0xc8;return function(_0x4878ed){if(_0x4878ed){return _0x23dd7b[_0xcb9e('0x1d')](_0x4bf5cd)['json'](_0x4878ed);}};}function respondWithFilteredResult(_0xd8737c,_0x265f8d){return function(_0x14c4ea){if(_0x14c4ea){var _0x48815a=typeof _0x265f8d['offset']===_0xcb9e('0x1e')&&typeof _0x265f8d[_0xcb9e('0x1f')]==='undefined';var _0x27f6b8=_0x14c4ea[_0xcb9e('0x20')];var _0x450429=_0x48815a?0x0:_0x265f8d['offset'];var _0x499d24=_0x48815a?_0x14c4ea[_0xcb9e('0x20')]:_0x265f8d[_0xcb9e('0x21')]+_0x265f8d[_0xcb9e('0x1f')];var _0x373dbb;if(_0x499d24>=_0x27f6b8){_0x499d24=_0x27f6b8;_0x373dbb=0xc8;}else{_0x373dbb=0xce;}_0xd8737c[_0xcb9e('0x1d')](_0x373dbb);return _0xd8737c[_0xcb9e('0x22')](_0xcb9e('0x23'),_0x450429+'-'+_0x499d24+'/'+_0x27f6b8)['json'](_0x14c4ea);}return null;};}function patchUpdates(_0x495f52){return function(_0x2c42db){try{jsonpatch[_0xcb9e('0x24')](_0x2c42db,_0x495f52,!![]);}catch(_0x49c0fb){return BPromise[_0xcb9e('0x25')](_0x49c0fb);}return _0x2c42db[_0xcb9e('0x26')]();};}function saveUpdates(_0x38ace1,_0x28c3b7){return function(_0x45a993){if(_0x45a993){return _0x45a993[_0xcb9e('0x27')](_0x38ace1)[_0xcb9e('0x28')](function(_0x5438dc){return _0x5438dc;});}return null;};}function removeEntity(_0x3517bb,_0x53b6e2){return function(_0xfe724b){if(_0xfe724b){return _0xfe724b[_0xcb9e('0x29')]()[_0xcb9e('0x28')](function(){var _0x41188d=_0xfe724b[_0xcb9e('0x2a')]({'plain':!![]});var _0x5c3abe=_0xcb9e('0x2b');return db[_0xcb9e('0x2c')][_0xcb9e('0x29')]({'where':{'type':_0x5c3abe,'resourceId':_0x41188d['id']}})[_0xcb9e('0x28')](function(){return _0xfe724b;});})[_0xcb9e('0x28')](function(){_0x3517bb[_0xcb9e('0x1d')](0xcc)[_0xcb9e('0x1c')]();});}};}function handleEntityNotFound(_0x1f8583,_0x40b7e7){return function(_0x272fd6){if(!_0x272fd6){_0x1f8583[_0xcb9e('0x1b')](0x194);}return _0x272fd6;};}function handleError(_0x5409fa,_0xac856b){_0xac856b=_0xac856b||0x1f4;return function(_0x464313){logger[_0xcb9e('0x2d')](_0x464313['stack']);if(_0x464313[_0xcb9e('0x2e')]){delete _0x464313[_0xcb9e('0x2e')];}_0x5409fa['status'](_0xac856b)['send'](_0x464313);};}exports[_0xcb9e('0x2f')]=function(_0x244063,_0x1a57b6){var _0x4c140c={},_0x1f1c0e={},_0x213332={'count':0x0,'rows':[]};return db[_0xcb9e('0x30')][_0xcb9e('0x31')]()['then'](function(_0x18edc0){_0x1f1c0e[_0xcb9e('0x32')]=_[_0xcb9e('0x33')](_0x18edc0);_0x1f1c0e['query']=_[_0xcb9e('0x33')](_0x244063[_0xcb9e('0x34')]);_0x1f1c0e[_0xcb9e('0x35')]=_[_0xcb9e('0x36')](_0x1f1c0e[_0xcb9e('0x32')],_0x1f1c0e[_0xcb9e('0x34')]);_0x4c140c[_0xcb9e('0x37')]=_['intersection'](_0x1f1c0e[_0xcb9e('0x32')],qs[_0xcb9e('0x38')](_0x244063[_0xcb9e('0x34')][_0xcb9e('0x38')]));_0x4c140c[_0xcb9e('0x37')]=_0x4c140c[_0xcb9e('0x37')][_0xcb9e('0x39')]?_0x4c140c[_0xcb9e('0x37')]:_0x1f1c0e[_0xcb9e('0x32')];if(!_0x244063['query'][_0xcb9e('0x3a')](_0xcb9e('0x3b'))){_0x4c140c[_0xcb9e('0x1f')]=qs[_0xcb9e('0x1f')](_0x244063[_0xcb9e('0x34')][_0xcb9e('0x1f')]);_0x4c140c[_0xcb9e('0x21')]=qs[_0xcb9e('0x21')](_0x244063[_0xcb9e('0x34')][_0xcb9e('0x21')]);}_0x4c140c[_0xcb9e('0x3c')]=qs[_0xcb9e('0x3d')](_0x244063[_0xcb9e('0x34')][_0xcb9e('0x3d')]);_0x4c140c[_0xcb9e('0x3e')]=qs[_0xcb9e('0x35')](_[_0xcb9e('0x3f')](_0x244063['query'],_0x1f1c0e[_0xcb9e('0x35')]),_0x18edc0);if(_0x244063[_0xcb9e('0x34')][_0xcb9e('0x40')]){_0x4c140c['where']=_['merge'](_0x4c140c[_0xcb9e('0x3e')],{'$or':_[_0xcb9e('0x41')](_0x4c140c[_0xcb9e('0x37')],function(_0x1b91ed){var _0x3524fc={};_0x3524fc[_0x1b91ed]={'$like':'%'+_0x244063['query'][_0xcb9e('0x40')]+'%'};return _0x3524fc;})});}_0x4c140c=_[_0xcb9e('0x42')]({},_0x4c140c,_0x244063[_0xcb9e('0x43')]);var _0x44b61c={'where':_0x4c140c['where']};return db[_0xcb9e('0x30')][_0xcb9e('0x20')](_0x44b61c)[_0xcb9e('0x28')](function(_0x4990f7){_0x213332['count']=_0x4990f7;if(_0x244063[_0xcb9e('0x34')][_0xcb9e('0x44')]){_0x4c140c[_0xcb9e('0x45')]=[{'all':!![]}];}return db[_0xcb9e('0x30')][_0xcb9e('0x46')](_0x4c140c);})[_0xcb9e('0x28')](function(_0x584103){_0x213332[_0xcb9e('0x47')]=_0x584103;return _0x213332;})[_0xcb9e('0x28')](respondWithFilteredResult(_0x1a57b6,_0x4c140c))[_0xcb9e('0x48')](handleError(_0x1a57b6,null));})[_0xcb9e('0x48')](handleError(_0x1a57b6,null));};exports[_0xcb9e('0x49')]=function(_0x217467,_0x49d1a6){var _0x3f0caa={'raw':![],'where':{'id':_0x217467['params']['id']}},_0x260f6b={};_0x260f6b[_0xcb9e('0x32')]=_[_0xcb9e('0x33')](db[_0xcb9e('0x30')][_0xcb9e('0x4a')]);_0x260f6b[_0xcb9e('0x34')]=_[_0xcb9e('0x33')](_0x217467[_0xcb9e('0x34')]);_0x260f6b[_0xcb9e('0x35')]=_[_0xcb9e('0x36')](_0x260f6b[_0xcb9e('0x32')],_0x260f6b['query']);_0x3f0caa[_0xcb9e('0x37')]=_[_0xcb9e('0x36')](_0x260f6b[_0xcb9e('0x32')],qs[_0xcb9e('0x38')](_0x217467[_0xcb9e('0x34')][_0xcb9e('0x38')]));_0x3f0caa['attributes']=_0x3f0caa[_0xcb9e('0x37')][_0xcb9e('0x39')]?_0x3f0caa[_0xcb9e('0x37')]:_0x260f6b[_0xcb9e('0x32')];if(_0x217467[_0xcb9e('0x34')][_0xcb9e('0x44')]){_0x3f0caa['include']=[{'all':!![]}];}_0x3f0caa=_[_0xcb9e('0x42')]({},_0x3f0caa,_0x217467[_0xcb9e('0x43')]);return db[_0xcb9e('0x30')][_0xcb9e('0x4b')](_0x3f0caa)[_0xcb9e('0x28')](handleEntityNotFound(_0x49d1a6,null))[_0xcb9e('0x28')](respondWithResult(_0x49d1a6,null))[_0xcb9e('0x48')](handleError(_0x49d1a6,null));};exports[_0xcb9e('0x4c')]=function(_0x84bd53,_0x1d6b66){return db[_0xcb9e('0x30')][_0xcb9e('0x4c')](_0x84bd53[_0xcb9e('0x4d')],{})[_0xcb9e('0x28')](function(_0x3ff90d){var _0x5a2ae6=_0x84bd53[_0xcb9e('0x4e')]['get']({'plain':!![]});if(!_0x5a2ae6)throw new Error(_0xcb9e('0x4f'));if(_0x5a2ae6['role']==='user'){var _0x4dc996=_0x3ff90d['get']({'plain':!![]});var _0x4bb604=_0xcb9e('0x2b');return db[_0xcb9e('0x50')]['find']({'where':{'name':_0x4bb604,'userProfileId':_0x5a2ae6[_0xcb9e('0x51')]},'raw':!![]})['then'](function(_0x146eed){if(_0x146eed&&_0x146eed['autoAssociation']===0x0){return db[_0xcb9e('0x2c')][_0xcb9e('0x4c')]({'name':_0x4dc996[_0xcb9e('0x2e')],'resourceId':_0x4dc996['id'],'type':_0x146eed['name'],'sectionId':_0x146eed['id']},{})[_0xcb9e('0x28')](function(){return _0x3ff90d;});}else{return _0x3ff90d;}})['catch'](function(_0x11f8a4){logger[_0xcb9e('0x2d')](_0xcb9e('0x52'),_0x11f8a4);throw _0x11f8a4;});}return _0x3ff90d;})['then'](respondWithResult(_0x1d6b66,0xc9))[_0xcb9e('0x48')](handleError(_0x1d6b66,null));};exports[_0xcb9e('0x27')]=function(_0x213a0d,_0x1de1eb){if(_0x213a0d[_0xcb9e('0x4d')]['id']){delete _0x213a0d[_0xcb9e('0x4d')]['id'];}return db[_0xcb9e('0x30')]['find']({'where':{'id':_0x213a0d['params']['id']}})[_0xcb9e('0x28')](handleEntityNotFound(_0x1de1eb,null))[_0xcb9e('0x28')](saveUpdates(_0x213a0d[_0xcb9e('0x4d')],null))[_0xcb9e('0x28')](respondWithResult(_0x1de1eb,null))['catch'](handleError(_0x1de1eb,null));};exports[_0xcb9e('0x29')]=function(_0xe702f5,_0xe70bc0){return db[_0xcb9e('0x30')]['find']({'where':{'id':_0xe702f5[_0xcb9e('0x53')]['id']}})[_0xcb9e('0x28')](handleEntityNotFound(_0xe70bc0,null))[_0xcb9e('0x28')](removeEntity(_0xe70bc0,null))[_0xcb9e('0x48')](handleError(_0xe70bc0,null));};exports[_0xcb9e('0x31')]=function(_0x2a5555,_0x42913e){return db['CmCompany'][_0xcb9e('0x31')]()[_0xcb9e('0x28')](respondWithResult(_0x42913e,null))[_0xcb9e('0x48')](handleError(_0x42913e,null));};exports[_0xcb9e('0x54')]=function(_0x30dd5b,_0x2416b8,_0x800e29){return db['CmContact'][_0xcb9e('0x4b')]({'where':{'id':_0x30dd5b['params']['id']}})[_0xcb9e('0x28')](handleEntityNotFound(_0x2416b8,null))[_0xcb9e('0x28')](function(_0x202db5){if(_0x202db5){return _0x202db5['addContacts'](_0x30dd5b[_0xcb9e('0x4d')][_0xcb9e('0x55')],_[_0xcb9e('0x56')](_0x30dd5b[_0xcb9e('0x4d')],['ids','id'])||{});}})['then'](respondWithResult(_0x2416b8,null))['catch'](handleError(_0x2416b8,null));};exports[_0xcb9e('0x57')]=function(_0x45d913,_0x344156,_0x1137b8){var _0x189375={};var _0x152124={};var _0x1e8993;var _0x48f277;return db['CmCompany'][_0xcb9e('0x58')]({'where':{'id':_0x45d913[_0xcb9e('0x53')]['id']}})[_0xcb9e('0x28')](handleEntityNotFound(_0x344156,null))[_0xcb9e('0x28')](function(_0x63fcb2){if(_0x63fcb2){_0x1e8993=_0x63fcb2;_0x152124[_0xcb9e('0x32')]=_[_0xcb9e('0x33')](db[_0xcb9e('0x59')][_0xcb9e('0x4a')]);_0x152124[_0xcb9e('0x34')]=_[_0xcb9e('0x33')](_0x45d913[_0xcb9e('0x34')]);_0x152124[_0xcb9e('0x35')]=_['intersection'](_0x152124[_0xcb9e('0x32')],_0x152124[_0xcb9e('0x34')]);_0x189375[_0xcb9e('0x37')]=_['intersection'](_0x152124[_0xcb9e('0x32')],qs['fields'](_0x45d913[_0xcb9e('0x34')]['fields']));_0x189375[_0xcb9e('0x37')]=_0x189375['attributes']['length']?_0x189375['attributes']:_0x152124['model'];_0x189375[_0xcb9e('0x3c')]=qs[_0xcb9e('0x3d')](_0x45d913[_0xcb9e('0x34')]['sort']);_0x189375['where']=qs[_0xcb9e('0x35')](_[_0xcb9e('0x3f')](_0x45d913[_0xcb9e('0x34')],_0x152124[_0xcb9e('0x35')]));if(_0x45d913[_0xcb9e('0x34')][_0xcb9e('0x40')]){_0x189375[_0xcb9e('0x3e')]=_[_0xcb9e('0x42')](_0x189375['where'],{'$or':_[_0xcb9e('0x41')](_0x189375[_0xcb9e('0x37')],function(_0x5f5890){var _0x48f96e={};_0x48f96e[_0x5f5890]={'$like':'%'+_0x45d913[_0xcb9e('0x34')][_0xcb9e('0x40')]+'%'};return _0x48f96e;})});}_0x189375=_['merge']({},_0x189375,_0x45d913[_0xcb9e('0x43')]);return _0x1e8993['getContacts'](_0x189375);}})['then'](function(_0xd8d5e2){if(_0xd8d5e2){_0x48f277=_0xd8d5e2[_0xcb9e('0x39')];if(!_0x45d913['query'][_0xcb9e('0x3a')](_0xcb9e('0x3b'))){_0x189375[_0xcb9e('0x1f')]=qs[_0xcb9e('0x1f')](_0x45d913['query'][_0xcb9e('0x1f')]);_0x189375['offset']=qs[_0xcb9e('0x21')](_0x45d913[_0xcb9e('0x34')]['offset']);}return _0x1e8993[_0xcb9e('0x57')](_0x189375);}})[_0xcb9e('0x28')](function(_0x245b4a){if(_0x245b4a){return _0x245b4a?{'count':_0x48f277,'rows':_0x245b4a}:null;}})[_0xcb9e('0x28')](respondWithResult(_0x344156,null))[_0xcb9e('0x48')](handleError(_0x344156,null));}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js index ada7c57..59ca711 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 _0xc277=['exports','define','cm_companies','lodash','util','../../config/logger','moment','path','rimraf','../../config/environment','./cmCompany.attributes'];(function(_0x55a508,_0x49b310){var _0x3a1ea9=function(_0x4e6344){while(--_0x4e6344){_0x55a508['push'](_0x55a508['shift']());}};_0x3a1ea9(++_0x49b310);}(_0xc277,0x158));var _0x7c27=function(_0x2690d5,_0x1a51b0){_0x2690d5=_0x2690d5-0x0;var _0x51d98b=_0xc277[_0x2690d5];return _0x51d98b;};'use strict';var _=require(_0x7c27('0x0'));var util=require(_0x7c27('0x1'));var logger=require(_0x7c27('0x2'))('api');var moment=require(_0x7c27('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x7c27('0x4'));var rimraf=require(_0x7c27('0x5'));var config=require(_0x7c27('0x6'));var attributes=require(_0x7c27('0x7'));module[_0x7c27('0x8')]=function(_0x5d11e0,_0x6465e1){return _0x5d11e0[_0x7c27('0x9')]('CmCompany',attributes,{'tableName':_0x7c27('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x74d4=['path','./cmCompany.attributes','exports','CmCompany','lodash','../../config/logger','api','moment','request-promise'];(function(_0x312cfe,_0x4a2f31){var _0x299b30=function(_0x50a6e6){while(--_0x50a6e6){_0x312cfe['push'](_0x312cfe['shift']());}};_0x299b30(++_0x4a2f31);}(_0x74d4,0x112));var _0x474d=function(_0x477c21,_0x5b4ef7){_0x477c21=_0x477c21-0x0;var _0x59ce7c=_0x74d4[_0x477c21];return _0x59ce7c;};'use strict';var _=require(_0x474d('0x0'));var util=require('util');var logger=require(_0x474d('0x1'))(_0x474d('0x2'));var moment=require(_0x474d('0x3'));var BPromise=require('bluebird');var rp=require(_0x474d('0x4'));var fs=require('fs');var path=require(_0x474d('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x474d('0x6'));module[_0x474d('0x7')]=function(_0x12c930,_0x389b86){return _0x12c930['define'](_0x474d('0x8'),attributes,{'tableName':'cm_companies','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.rpc.js b/server/api/cmCompany/cmCompany.rpc.js index 044a0b8..7ac33fc 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 _0x1a46=['request\x20sent','CmCompany,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','CmCompany,\x20%s,\x20%s'];(function(_0x9fc5a2,_0x46c38f){var _0x10a4a8=function(_0x2aeef2){while(--_0x2aeef2){_0x9fc5a2['push'](_0x9fc5a2['shift']());}};_0x10a4a8(++_0x46c38f);}(_0x1a46,0x14a));var _0x61a4=function(_0x15a4bb,_0x3cd119){_0x15a4bb=_0x15a4bb-0x0;var _0x198cd0=_0x1a46[_0x15a4bb];return _0x198cd0;};'use strict';var _=require(_0x61a4('0x0'));var util=require(_0x61a4('0x1'));var moment=require(_0x61a4('0x2'));var BPromise=require(_0x61a4('0x3'));var rs=require(_0x61a4('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x61a4('0x5'))['db'];var utils=require(_0x61a4('0x6'));var logger=require(_0x61a4('0x7'))(_0x61a4('0x8'));var config=require(_0x61a4('0x9'));var jayson=require(_0x61a4('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x145627,_0x31a2d0,_0x977532){return new BPromise(function(_0x5e11e0,_0x215085){return client[_0x61a4('0xb')](_0x145627,_0x977532)[_0x61a4('0xc')](function(_0x46a30f){logger[_0x61a4('0xd')](_0x61a4('0xe'),_0x31a2d0,_0x61a4('0xf'));logger['debug'](_0x61a4('0x10'),_0x31a2d0,_0x61a4('0xf'),JSON[_0x61a4('0x11')](_0x46a30f));if(_0x46a30f[_0x61a4('0x12')]){if(_0x46a30f[_0x61a4('0x12')][_0x61a4('0x13')]===0x1f4){logger[_0x61a4('0x12')](_0x61a4('0xe'),_0x31a2d0,_0x46a30f[_0x61a4('0x12')]['message']);return _0x215085(_0x46a30f[_0x61a4('0x12')]['message']);}logger[_0x61a4('0x12')]('CmCompany,\x20%s,\x20%s',_0x31a2d0,_0x46a30f[_0x61a4('0x12')]['message']);return _0x5e11e0(_0x46a30f['error'][_0x61a4('0x14')]);}else{logger['info']('CmCompany,\x20%s,\x20%s',_0x31a2d0,'request\x20sent');_0x5e11e0(_0x46a30f[_0x61a4('0x15')][_0x61a4('0x14')]);}})[_0x61a4('0x16')](function(_0x5aa8a6){logger['error'](_0x61a4('0xe'),_0x31a2d0,_0x5aa8a6);_0x215085(_0x5aa8a6);});});} \ No newline at end of file +var _0x195c=['../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','CmCompany,\x20%s,\x20%s','request\x20sent','debug','CmCompany,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','moment','randomstring','ioredis'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x195c,0x1f3));var _0xc195=function(_0x521929,_0x479be5){_0x521929=_0x521929-0x0;var _0x632436=_0x195c[_0x521929];return _0x632436;};'use strict';var _=require(_0xc195('0x0'));var util=require(_0xc195('0x1'));var moment=require(_0xc195('0x2'));var BPromise=require('bluebird');var rs=require(_0xc195('0x3'));var fs=require('fs');var Redis=require(_0xc195('0x4'));var db=require(_0xc195('0x5'))['db'];var utils=require(_0xc195('0x6'));var logger=require('../../config/logger')(_0xc195('0x7'));var config=require(_0xc195('0x8'));var jayson=require(_0xc195('0x9'));var client=jayson[_0xc195('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3e4739,_0x7e398b,_0x3d25c0){return new BPromise(function(_0x403237,_0x2aab04){return client[_0xc195('0xb')](_0x3e4739,_0x3d25c0)[_0xc195('0xc')](function(_0xd57609){logger['info'](_0xc195('0xd'),_0x7e398b,_0xc195('0xe'));logger[_0xc195('0xf')](_0xc195('0x10'),_0x7e398b,_0xc195('0xe'),JSON[_0xc195('0x11')](_0xd57609));if(_0xd57609['error']){if(_0xd57609[_0xc195('0x12')][_0xc195('0x13')]===0x1f4){logger['error'](_0xc195('0xd'),_0x7e398b,_0xd57609[_0xc195('0x12')][_0xc195('0x14')]);return _0x2aab04(_0xd57609['error'][_0xc195('0x14')]);}logger[_0xc195('0x12')](_0xc195('0xd'),_0x7e398b,_0xd57609[_0xc195('0x12')]['message']);return _0x403237(_0xd57609[_0xc195('0x12')][_0xc195('0x14')]);}else{logger[_0xc195('0x15')](_0xc195('0xd'),_0x7e398b,_0xc195('0xe'));_0x403237(_0xd57609[_0xc195('0x16')][_0xc195('0x14')]);}})[_0xc195('0x17')](function(_0x567d42){logger[_0xc195('0x12')](_0xc195('0xd'),_0x7e398b,_0x567d42);_0x2aab04(_0x567d42);});});} \ No newline at end of file diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js index ec30549..e0b9637 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 _0xe5b2=['./cmCompany.controller','isAuthenticated','get','/:id','show','/:id/contacts','getContacts','create','post','addContacts','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe5b2,0x6f));var _0x2e5b=function(_0x40d5c8,_0x411c6e){_0x40d5c8=_0x40d5c8-0x0;var _0x5f294f=_0xe5b2[_0x40d5c8];return _0x5f294f;};'use strict';var multer=require(_0x2e5b('0x0'));var util=require(_0x2e5b('0x1'));var path=require(_0x2e5b('0x2'));var timeout=require(_0x2e5b('0x3'));var express=require(_0x2e5b('0x4'));var router=express[_0x2e5b('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x2e5b('0x6'));var interaction=require(_0x2e5b('0x7'));var config=require(_0x2e5b('0x8'));var controller=require(_0x2e5b('0x9'));router['get']('/',auth[_0x2e5b('0xa')](),controller['index']);router[_0x2e5b('0xb')]('/describe',auth['isAuthenticated'](),controller['describe']);router[_0x2e5b('0xb')](_0x2e5b('0xc'),auth['isAuthenticated'](),controller[_0x2e5b('0xd')]);router[_0x2e5b('0xb')](_0x2e5b('0xe'),auth[_0x2e5b('0xa')](),controller[_0x2e5b('0xf')]);router['post']('/',auth[_0x2e5b('0xa')](),controller[_0x2e5b('0x10')]);router[_0x2e5b('0x11')](_0x2e5b('0xe'),auth[_0x2e5b('0xa')](),controller[_0x2e5b('0x12')]);router[_0x2e5b('0x13')](_0x2e5b('0xc'),auth[_0x2e5b('0xa')](),controller[_0x2e5b('0x14')]);router[_0x2e5b('0x15')](_0x2e5b('0xc'),auth[_0x2e5b('0xa')](),controller[_0x2e5b('0x16')]);module[_0x2e5b('0x17')]=router; \ No newline at end of file +var _0xcf10=['/:id','exports','util','Router','fs-extra','../../components/auth/service','./cmCompany.controller','get','isAuthenticated','index','show','/:id/contacts','getContacts','post','addContacts','put'];(function(_0x218abc,_0x5e46c8){var _0x2ae020=function(_0x9c8026){while(--_0x9c8026){_0x218abc['push'](_0x218abc['shift']());}};_0x2ae020(++_0x5e46c8);}(_0xcf10,0x1d2));var _0x0cf1=function(_0x453583,_0x5ca1e8){_0x453583=_0x453583-0x0;var _0x3e9101=_0xcf10[_0x453583];return _0x3e9101;};'use strict';var multer=require('multer');var util=require(_0x0cf1('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0cf1('0x1')]();var fs_extra=require(_0x0cf1('0x2'));var auth=require(_0x0cf1('0x3'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x0cf1('0x4'));router[_0x0cf1('0x5')]('/',auth[_0x0cf1('0x6')](),controller[_0x0cf1('0x7')]);router[_0x0cf1('0x5')]('/describe',auth[_0x0cf1('0x6')](),controller['describe']);router[_0x0cf1('0x5')]('/:id',auth['isAuthenticated'](),controller[_0x0cf1('0x8')]);router[_0x0cf1('0x5')](_0x0cf1('0x9'),auth['isAuthenticated'](),controller[_0x0cf1('0xa')]);router[_0x0cf1('0xb')]('/',auth['isAuthenticated'](),controller['create']);router[_0x0cf1('0xb')]('/:id/contacts',auth[_0x0cf1('0x6')](),controller[_0x0cf1('0xc')]);router[_0x0cf1('0xd')](_0x0cf1('0xe'),auth[_0x0cf1('0x6')](),controller['update']);router['delete']('/:id',auth[_0x0cf1('0x6')](),controller['destroy']);module[_0x0cf1('0xf')]=router; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.attributes.js b/server/api/cmContact/cmContact.attributes.js index dfa295c..0261103 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 _0x0292=['lodash','sequelize','exports','STRING','TEXT','UNSIGNED','NOW'];(function(_0x17b6e3,_0x4522ed){var _0x3906f3=function(_0x430f87){while(--_0x430f87){_0x17b6e3['push'](_0x17b6e3['shift']());}};_0x3906f3(++_0x4522ed);}(_0x0292,0xc4));var _0x2029=function(_0x3a73bc,_0x550aef){_0x3a73bc=_0x3a73bc-0x0;var _0x32891b=_0x0292[_0x3a73bc];return _0x32891b;};'use strict';var _=require(_0x2029('0x0'));var Sequelize=require(_0x2029('0x1'));module[_0x2029('0x2')]={'firstName':{'type':Sequelize[_0x2029('0x3')],'allowNull':![]},'lastName':{'type':Sequelize[_0x2029('0x3')]},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize[_0x2029('0x3')]},'city':{'type':Sequelize[_0x2029('0x3')]},'country':{'type':Sequelize[_0x2029('0x3')]},'dateOfBirth':{'type':Sequelize[_0x2029('0x3')]},'description':{'type':Sequelize[_0x2029('0x4')]},'phone':{'type':Sequelize[_0x2029('0x3')]},'mobile':{'type':Sequelize[_0x2029('0x3')]},'fax':{'type':Sequelize[_0x2029('0x3')]},'email':{'type':Sequelize[_0x2029('0x3')]},'url':{'type':Sequelize['STRING']},'facebook':{'type':Sequelize[_0x2029('0x3')]},'fb_data':{'type':Sequelize[_0x2029('0x3')]},'twitter':{'type':Sequelize[_0x2029('0x3')]},'skype':{'type':Sequelize[_0x2029('0x3')]},'teams':{'type':Sequelize[_0x2029('0x3')]},'viber':{'type':Sequelize[_0x2029('0x3')]},'line':{'type':Sequelize[_0x2029('0x3')]},'wechat':{'type':Sequelize[_0x2029('0x3')]},'telegram':{'type':Sequelize[_0x2029('0x3')]},'UserId':{'type':Sequelize['INTEGER']},'priority':{'type':Sequelize['INTEGER'](0x2)[_0x2029('0x5')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':Sequelize[_0x2029('0x6')]}}; \ No newline at end of file +var _0x088f=['STRING','INTEGER','UNSIGNED','DATE','lodash','exports'];(function(_0xa25342,_0x24522b){var _0x52be43=function(_0x1ea0e9){while(--_0x1ea0e9){_0xa25342['push'](_0xa25342['shift']());}};_0x52be43(++_0x24522b);}(_0x088f,0x124));var _0xf088=function(_0x58b35e,_0x27cd6a){_0x58b35e=_0x58b35e-0x0;var _0x3b7666=_0x088f[_0x58b35e];return _0x3b7666;};'use strict';var _=require(_0xf088('0x0'));var Sequelize=require('sequelize');module[_0xf088('0x1')]={'firstName':{'type':Sequelize[_0xf088('0x2')],'allowNull':![]},'lastName':{'type':Sequelize[_0xf088('0x2')]},'street':{'type':Sequelize[_0xf088('0x2')]},'postalCode':{'type':Sequelize[_0xf088('0x2')]},'city':{'type':Sequelize[_0xf088('0x2')]},'country':{'type':Sequelize['STRING']},'dateOfBirth':{'type':Sequelize[_0xf088('0x2')]},'description':{'type':Sequelize['TEXT']},'phone':{'type':Sequelize[_0xf088('0x2')]},'mobile':{'type':Sequelize[_0xf088('0x2')]},'fax':{'type':Sequelize[_0xf088('0x2')]},'email':{'type':Sequelize[_0xf088('0x2')]},'url':{'type':Sequelize[_0xf088('0x2')]},'facebook':{'type':Sequelize[_0xf088('0x2')]},'fb_data':{'type':Sequelize[_0xf088('0x2')]},'twitter':{'type':Sequelize[_0xf088('0x2')]},'skype':{'type':Sequelize['STRING']},'teams':{'type':Sequelize[_0xf088('0x2')]},'viber':{'type':Sequelize['STRING']},'line':{'type':Sequelize[_0xf088('0x2')]},'wechat':{'type':Sequelize[_0xf088('0x2')]},'telegram':{'type':Sequelize[_0xf088('0x2')]},'UserId':{'type':Sequelize[_0xf088('0x3')]},'priority':{'type':Sequelize['INTEGER'](0x2)[_0xf088('0x4')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0xf088('0x5')],'defaultValue':Sequelize['NOW']}}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js index 568aa45..af7443b 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 _0xb530=['fork','../../components/import/cm/csv','CompanyId','socket_timestamp','send','upload','createReadStream','parse','meta','import','binding','pid','exit','error\x20child\x20process','sms','fax','whatsapp','-createdAt','channel','includes','toLowerCase','range','isValid','Invalid\x20date\x20for\x20range\x20from\x20filter','Invalid\x20date\x20for\x20range\x20to\x20filter','Invalid\x20createdAt\x20filter','voice','uniqueid','source','destination','callerid','starttime','duration','note','createdAt','userDisposition','userSecondDisposition','userThirdDisposition','UserId','findAndCountAll','startCase','chat','Website','Account','closedAt','disposition','secondDisposition','thirdDisposition','key','Owner','fullname','customerIp','customerPort','deviceModel','osName','ratingMessage','ratingType','ratingValue','referer','mail','subject','substatus','externalUrl','threadId','Interaction','flatten','sortBy','slice','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','register','sendStatus','end','status','json','undefined','count','offset','apply','save','update','then','error','stack','name','index','CmContact','describe','keys','length','startsWith','cf_','CmCustomField','trimStart','all','fieldType','model','query','filters','fields','attributes','nolimit','limit','order','sort','pick','field','from','select','cm_contacts','cm_user_has_contacts','left_join','cm_contact_has_tags','where','expr','search','parseSearch','sqlOperator','conditions','find','Tag','value','map','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','User','uc.UserId\x20=\x20?','castTo','buildExpression','type','text','start','hasOwnProperty','filter','isNil','Contact','push','isEmpty','ListId','concat','CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?','\x20=\x20?','isArray','tag','replace','split','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','isNumeric','c.phone\x20LIKE\x20?','c.mobile\x20LIKE\x20?','isEmail','c.email\x20LIKE\x20?','c.firstName\x20LIKE\x20?','c.lastName\x20LIKE\x20?','c.id','QueryTypes','SELECT','clone','DESC','having','resolve','user','role','agent','some','c.ListId\x20IS\x20NULL','c.ListId\x20IN\x20?','sequelize','toString','merge','c.firstName','c.lastName','c.phone','c.mobile','c.fax','c.email','c.createdAt','c.deletedAt','c.CompanyId','GROUP_CONCAT(DISTINCT\x20t.id)','TagIds','Tags','rows','catch','destroy','tags','displayName','findAll','columnName','alias','custom','body','get','mergeWith','join','info','[CmContact][merge]\x20to\x20%s\x20from\x20%s','CmHopperBlack','[CmContact][merge][destroy][CmHopperBlack],\x20%s','ChatInteraction','ChatOfflineMessage','MailMessage','MailInteraction','FaxInteraction','FaxMessage','OpenchannelInteraction','OpenchannelMessage','CmHopperFinal','CmHopperHistory','ReportAgentPreview','VoiceCallReport','MailQueueReport','SmsQueueReport','WhatsappMessage','WhatsappQueueReport','create','each','duplicates','findOrCreate','spread','show','color','$and','omit','cf_%d','params','pickBy','format','table','setFields','id\x20=\x20?','toParam','values','phone','CmHopper','findOne','rawAttributes','intersection','options','getTags','setTags','ids','ContactId','include','includeAll','getHopperFinals','getJscriptySessions','JscriptySessionReport','uploadCsv','No\x20ListId\x20specified','No\x20association\x20keys\x20specified!','binding_values','No\x20association\x20values\x20specified!','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','binding_keys','Incorrect\x20binding\x20parameters\x20passed!','No\x20phone\x20column\x20specified','firstName','No\x20firstName\x20column\x20specified','root','server/files/tmp','file','filename','chmodSync','0777','child_process'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0xb530,0x167));var _0x0b53=function(_0x10efc9,_0x3cd450){_0x10efc9=_0x10efc9-0x0;var _0x2051cd=_0xb530[_0x10efc9];return _0x2051cd;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0b53('0x0'));var zipdir=require(_0x0b53('0x1'));var jsonpatch=require(_0x0b53('0x2'));var rp=require('request-promise');var moment=require(_0x0b53('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x0b53('0x4'));var util=require(_0x0b53('0x5'));var path=require(_0x0b53('0x6'));var sox=require(_0x0b53('0x7'));var csv=require(_0x0b53('0x8'));var ejs=require(_0x0b53('0x9'));var fs=require('fs');var fs_extra=require(_0x0b53('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x0b53('0xb'));var deskjs=require(_0x0b53('0xc'));var toCsv=require(_0x0b53('0x8'));var querystring=require('querystring');var Papa=require(_0x0b53('0xd'));var Redis=require(_0x0b53('0xe'));var authService=require(_0x0b53('0xf'));var qs=require(_0x0b53('0x10'));var as=require(_0x0b53('0x11'));var hardwareService=require(_0x0b53('0x12'));var logger=require(_0x0b53('0x13'))(_0x0b53('0x14'));var utils=require('../../config/utils');var config=require(_0x0b53('0x15'));var licenseUtil=require(_0x0b53('0x16'));var db=require(_0x0b53('0x17'))['db'];config[_0x0b53('0x18')]=_[_0x0b53('0x19')](config[_0x0b53('0x18')],{'host':_0x0b53('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./cmContact.socket')[_0x0b53('0x1b')](socket);function respondWithStatusCode(_0x20a932,_0x434b20){_0x434b20=_0x434b20||0xcc;return function(_0x36bb33){if(_0x36bb33){return _0x20a932[_0x0b53('0x1c')](_0x434b20);}return _0x20a932['status'](_0x434b20)[_0x0b53('0x1d')]();};}function respondWithResult(_0x38493e,_0x4693a3){_0x4693a3=_0x4693a3||0xc8;return function(_0x377663){if(_0x377663){return _0x38493e[_0x0b53('0x1e')](_0x4693a3)[_0x0b53('0x1f')](_0x377663);}};}function respondWithFilteredResult(_0x3eaff1,_0x5747c2){return function(_0x3c3ca4){if(_0x3c3ca4){var _0x3225d1=typeof _0x5747c2['offset']===_0x0b53('0x20')&&typeof _0x5747c2['limit']==='undefined';var _0x1a0a55=_0x3c3ca4[_0x0b53('0x21')];var _0x25ffd0=_0x3225d1?0x0:_0x5747c2[_0x0b53('0x22')];var _0xa1c091=_0x3225d1?_0x3c3ca4['count']:_0x5747c2[_0x0b53('0x22')]+_0x5747c2['limit'];var _0x4f540d;if(_0xa1c091>=_0x1a0a55){_0xa1c091=_0x1a0a55;_0x4f540d=0xc8;}else{_0x4f540d=0xce;}_0x3eaff1[_0x0b53('0x1e')](_0x4f540d);return _0x3eaff1['set']('Content-Range',_0x25ffd0+'-'+_0xa1c091+'/'+_0x1a0a55)[_0x0b53('0x1f')](_0x3c3ca4);}return null;};}function patchUpdates(_0x7f0195){return function(_0x3376af){try{jsonpatch[_0x0b53('0x23')](_0x3376af,_0x7f0195,!![]);}catch(_0xdf77e0){return BPromise['reject'](_0xdf77e0);}return _0x3376af[_0x0b53('0x24')]();};}function saveUpdates(_0x1c15de,_0xf5d1b8){return function(_0x4ea632){if(_0x4ea632){return _0x4ea632[_0x0b53('0x25')](_0x1c15de)[_0x0b53('0x26')](function(_0x51c079){return _0x51c079;});}return null;};}function removeEntity(_0xe5aa10,_0x499227){return function(_0x415486){if(_0x415486){return _0x415486['destroy']()['then'](function(){_0xe5aa10['status'](0xcc)[_0x0b53('0x1d')]();});}};}function handleEntityNotFound(_0x4cc3c7,_0xc53505){return function(_0x2b0214){if(!_0x2b0214){_0x4cc3c7[_0x0b53('0x1c')](0x194);}return _0x2b0214;};}function handleError(_0x3c710e,_0x2ed3a3){_0x2ed3a3=_0x2ed3a3||0x1f4;return function(_0x54220d){logger[_0x0b53('0x27')](_0x54220d[_0x0b53('0x28')]);if(_0x54220d[_0x0b53('0x29')]){delete _0x54220d[_0x0b53('0x29')];}_0x3c710e[_0x0b53('0x1e')](_0x2ed3a3)['send'](_0x54220d);};}exports[_0x0b53('0x2a')]=function(_0x4b6fcc,_0x5b097d){var _0x740c3c={},_0x5f1a46={},_0xbbbf44={'count':0x0,'rows':[]};return db[_0x0b53('0x2b')][_0x0b53('0x2c')]()['then'](function(_0xfe6a4a){var _0x389beb=[];for(var _0x2d6878=0x0;_0x2d68780x1){_0x5a1e37['or'](_0x0b53('0x67'),qs['getFullTextValue'](_0x3a5218),null);}else{if(qs[_0x0b53('0x68')](_0x3a5218)){_0x5a1e37['or']('c.id\x20LIKE\x20?',_0x3a5218+'%');_0x5a1e37['or'](_0x0b53('0x69'),_0x3a5218+'%');_0x5a1e37['or'](_0x0b53('0x6a'),_0x3a5218+'%');_0x5a1e37['or']('c.fax\x20LIKE\x20?',_0x3a5218+'%');}else if(qs[_0x0b53('0x6b')](_0x3a5218)){_0x5a1e37['or'](_0x0b53('0x6c'),_0x3a5218+'%');}else{_0x5a1e37['or'](_0x0b53('0x6d'),'%'+_0x3a5218+'%');_0x5a1e37['or'](_0x0b53('0x6e'),'%'+_0x3a5218+'%');_0x5a1e37['or']('c.email\x20LIKE\x20?','%'+_0x3a5218+'%');}}}}_0x2d486f[_0x0b53('0x46')](_0x5a1e37);_0x2d486f['group'](_0x0b53('0x6f'));var _0x27f887={'type':db['Sequelize'][_0x0b53('0x70')][_0x0b53('0x71')],'raw':!![]};var _0x322d9a=_0x2d486f[_0x0b53('0x72')]()[_0x0b53('0x3f')]('c.id');if(_0x740c3c[_0x0b53('0x3c')]){_0x740c3c[_0x0b53('0x3c')][_0x0b53('0x50')](function(_0x5b19ce){_0x2d486f[_0x0b53('0x3c')]('c.'+_0x5b19ce[0x0],_0x5b19ce[0x1]===_0x0b53('0x73')?![]:!![]);});}if(!_[_0x0b53('0x5e')](_0x2b0d43)){_0x2d486f[_0x0b53('0x74')](_0x2e0a89);_0x322d9a[_0x0b53('0x46')]('t.id\x20IN\x20?',_0x2b0d43);}BPromise[_0x0b53('0x75')]()[_0x0b53('0x26')](function(){if(!_0x56995b)return;if(_0x4b6fcc[_0x0b53('0x76')][_0x0b53('0x77')]!==_0x0b53('0x78'))return;if(!_[_0x0b53('0x79')](_0x56995b['conditions'],[_0x0b53('0x3f'),_0x0b53('0x52')])){return _0x4b6fcc[_0x0b53('0x76')]['getLists']({'attributes':['id'],'raw':!![]})['then'](function(_0x6de013){if(_[_0x0b53('0x5e')](_0x6de013)){_0x322d9a['where'](_0x0b53('0x7a'));_0x2d486f[_0x0b53('0x46')](_0x0b53('0x7a'));}else{_0x322d9a[_0x0b53('0x46')](_0x0b53('0x7b'),_[_0x0b53('0x4f')](_0x6de013,'id'));_0x2d486f['where'](_0x0b53('0x7b'),_[_0x0b53('0x4f')](_0x6de013,'id'));}});}})['then'](function(){if(_0x4b6fcc[_0x0b53('0x76')][_0x0b53('0x77')]===_0x0b53('0x78')&&!_0x56995b&&!_0x4b6fcc['query'][_0x0b53('0x5f')])return[];return db[_0x0b53('0x7c')][_0x0b53('0x36')](_0x322d9a[_0x0b53('0x7d')](),_0x27f887);})['then'](function(_0x35557e){_0xbbbf44[_0x0b53('0x21')]=_0x35557e[_0x0b53('0x2e')];if(_0xbbbf44['count']===0x0)return[];return db[_0x0b53('0x7c')][_0x0b53('0x36')](_0x16813a[_0x0b53('0x7d')](),_0x27f887)[_0x0b53('0x26')](function(_0x260c08){_0x531f73=_['keyBy'](_0x260c08,'id');_0x27f887=_[_0x0b53('0x7e')](_0x27f887,{'model':db[_0x0b53('0x2b')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x4b6fcc[_0x0b53('0x36')][_0x0b53('0x38')]){_0x740c3c['attributes']['forEach'](function(_0x3379bf){_0x2d486f['field']('c.'+_0x3379bf);});}else{_0x2d486f[_0x0b53('0x3f')](_0x0b53('0x6f'));_0x2d486f[_0x0b53('0x3f')](_0x0b53('0x7f'));_0x2d486f['field'](_0x0b53('0x80'));_0x2d486f[_0x0b53('0x3f')](_0x0b53('0x81'));_0x2d486f[_0x0b53('0x3f')](_0x0b53('0x82'));_0x2d486f[_0x0b53('0x3f')](_0x0b53('0x83'));_0x2d486f['field'](_0x0b53('0x84'));_0x2d486f[_0x0b53('0x3f')]('c.ListId');_0x2d486f['field'](_0x0b53('0x85'));_0x2d486f[_0x0b53('0x3f')](_0x0b53('0x86'));_0x2d486f[_0x0b53('0x3f')](_0x0b53('0x87'));_0x2d486f[_0x0b53('0x3f')](_0x0b53('0x88'),_0x0b53('0x89'));}if(_0x740c3c['limit'])_0x2d486f['limit'](_0x740c3c[_0x0b53('0x3b')]);if(_0x740c3c[_0x0b53('0x22')])_0x2d486f['offset'](_0x740c3c[_0x0b53('0x22')]);return db[_0x0b53('0x7c')][_0x0b53('0x36')](_0x2d486f['toString'](),_0x27f887);});})['then'](function(_0x2520ea){_0x2520ea[_0x0b53('0x50')](function(_0xe448f){if(_0xe448f['TagIds']){_0xe448f[_0x0b53('0x8a')]=[];_0xe448f['TagIds'][_0x0b53('0x66')](',')[_0x0b53('0x50')](function(_0x2bc4c9){_0xe448f['Tags']['push'](_0x531f73[_0x2bc4c9]);});}delete _0xe448f[_0x0b53('0x89')];});_0xbbbf44[_0x0b53('0x8b')]=_0x2520ea;return _0xbbbf44;})[_0x0b53('0x26')](respondWithFilteredResult(_0x5b097d,_0x740c3c));})[_0x0b53('0x8c')](handleError(_0x5b097d,null));};exports[_0x0b53('0x8d')]=function(_0x3be32b,_0x234472){return db[_0x0b53('0x2b')][_0x0b53('0x4c')]({'where':{'id':_0x3be32b['params']['id']}})[_0x0b53('0x26')](handleEntityNotFound(_0x234472,null))[_0x0b53('0x26')](removeEntity(_0x234472,null))[_0x0b53('0x8c')](handleError(_0x234472,null));};exports[_0x0b53('0x2c')]=function(_0x32433b,_0x547672){return db['CmContact'][_0x0b53('0x2c')]()[_0x0b53('0x26')](function(_0x55042a){delete _0x55042a[_0x0b53('0x8e')];for(var _0x1141ee=0x0;_0x1141ee=_0x1e1725){_0x2cb958=_0x1e1725;_0x54f56d=0xc8;}else{_0x54f56d=0xce;}_0xe79da5[_0x67a2('0x1d')](_0x54f56d);return _0xe79da5[_0x67a2('0x23')](_0x67a2('0x24'),_0x4c10f3+'-'+_0x2cb958+'/'+_0x1e1725)[_0x67a2('0x25')](_0x45644a);}return null;};}function patchUpdates(_0x2b59b5){return function(_0x4c62b9){try{jsonpatch[_0x67a2('0x26')](_0x4c62b9,_0x2b59b5,!![]);}catch(_0x53ea4b){return BPromise['reject'](_0x53ea4b);}return _0x4c62b9[_0x67a2('0x27')]();};}function saveUpdates(_0x327ee6,_0x3f6585){return function(_0x2dacd0){if(_0x2dacd0){return _0x2dacd0[_0x67a2('0x28')](_0x327ee6)['then'](function(_0x143a90){return _0x143a90;});}return null;};}function removeEntity(_0x1a0783,_0x3a0402){return function(_0x2f362d){if(_0x2f362d){return _0x2f362d[_0x67a2('0x29')]()['then'](function(){_0x1a0783[_0x67a2('0x1d')](0xcc)[_0x67a2('0x1e')]();});}};}function handleEntityNotFound(_0x19d687,_0x49fec7){return function(_0x1b902c){if(!_0x1b902c){_0x19d687[_0x67a2('0x1c')](0x194);}return _0x1b902c;};}function handleError(_0x42c9d1,_0x403844){_0x403844=_0x403844||0x1f4;return function(_0x3bddb4){logger[_0x67a2('0x2a')](_0x3bddb4[_0x67a2('0x2b')]);if(_0x3bddb4[_0x67a2('0x2c')]){delete _0x3bddb4[_0x67a2('0x2c')];}_0x42c9d1[_0x67a2('0x1d')](_0x403844)[_0x67a2('0x2d')](_0x3bddb4);};}exports['index']=function(_0x27097f,_0x336655){var _0x46a057={},_0x5ce6f3={},_0x2676f5={'count':0x0,'rows':[]};return db[_0x67a2('0x2e')]['describe']()[_0x67a2('0x2f')](function(_0x2dd8ee){var _0x177f7c=[];for(var _0x374e96=0x0;_0x374e960x1){_0x15d4c6['or'](_0x67a2('0x6f'),qs[_0x67a2('0x70')](_0x547481),null);}else{if(qs[_0x67a2('0x71')](_0x547481)){_0x15d4c6['or']('c.id\x20LIKE\x20?',_0x547481+'%');_0x15d4c6['or']('c.phone\x20LIKE\x20?',_0x547481+'%');_0x15d4c6['or'](_0x67a2('0x72'),_0x547481+'%');_0x15d4c6['or'](_0x67a2('0x73'),_0x547481+'%');}else if(qs[_0x67a2('0x74')](_0x547481)){_0x15d4c6['or'](_0x67a2('0x75'),_0x547481+'%');}else{_0x15d4c6['or'](_0x67a2('0x76'),'%'+_0x547481+'%');_0x15d4c6['or'](_0x67a2('0x77'),'%'+_0x547481+'%');_0x15d4c6['or'](_0x67a2('0x75'),'%'+_0x547481+'%');}}}}_0x4b4185['where'](_0x15d4c6);_0x4b4185[_0x67a2('0x78')](_0x67a2('0x79'));var _0x52bb68={'type':db['Sequelize'][_0x67a2('0x7a')]['SELECT'],'raw':!![]};var _0x2f18cf=_0x4b4185['clone']()[_0x67a2('0x45')](_0x67a2('0x79'));if(_0x46a057[_0x67a2('0x40')]){_0x46a057[_0x67a2('0x40')][_0x67a2('0x57')](function(_0x7c6576){_0x4b4185[_0x67a2('0x40')]('c.'+_0x7c6576[0x0],_0x7c6576[0x1]===_0x67a2('0x7b')?![]:!![]);});}if(!_['isEmpty'](_0x2f3c40)){_0x4b4185[_0x67a2('0x7c')](_0x5d9f0e);_0x2f18cf[_0x67a2('0x42')](_0x67a2('0x7d'),_0x2f3c40);}BPromise[_0x67a2('0x7e')]()[_0x67a2('0x2f')](function(){if(!_0x4512d0)return;if(_0x27097f['user'][_0x67a2('0x7f')]!==_0x67a2('0x80'))return;if(!_[_0x67a2('0x81')](_0x4512d0['conditions'],['field',_0x67a2('0x82')])){return _0x27097f['user'][_0x67a2('0x83')]({'attributes':['id'],'raw':!![]})[_0x67a2('0x2f')](function(_0x243335){if(_[_0x67a2('0x65')](_0x243335)){_0x2f18cf['where'](_0x67a2('0x84'));_0x4b4185['where'](_0x67a2('0x84'));}else{_0x2f18cf[_0x67a2('0x42')](_0x67a2('0x67'),_[_0x67a2('0x62')](_0x243335,'id'));_0x4b4185[_0x67a2('0x42')](_0x67a2('0x67'),_['map'](_0x243335,'id'));}});}})[_0x67a2('0x2f')](function(){if(_0x27097f[_0x67a2('0x85')][_0x67a2('0x7f')]===_0x67a2('0x80')&&!_0x4512d0&&!_0x27097f[_0x67a2('0x3a')][_0x67a2('0x66')])return[];return db[_0x67a2('0x86')][_0x67a2('0x3a')](_0x2f18cf[_0x67a2('0x87')](),_0x52bb68);})[_0x67a2('0x2f')](function(_0x45bea7){_0x2676f5[_0x67a2('0x22')]=_0x45bea7[_0x67a2('0x31')];if(_0x2676f5[_0x67a2('0x22')]===0x0)return[];return db[_0x67a2('0x86')][_0x67a2('0x3a')](_0x5f3488['toString'](),_0x52bb68)['then'](function(_0x3b13cd){_0x33462e=_[_0x67a2('0x88')](_0x3b13cd,'id');_0x52bb68=_[_0x67a2('0x89')](_0x52bb68,{'model':db[_0x67a2('0x2e')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x27097f[_0x67a2('0x3a')][_0x67a2('0x3d')]){_0x46a057[_0x67a2('0x3e')][_0x67a2('0x57')](function(_0x5c8174){_0x4b4185[_0x67a2('0x45')]('c.'+_0x5c8174);});}else{_0x4b4185[_0x67a2('0x45')](_0x67a2('0x79'));_0x4b4185['field'](_0x67a2('0x8a'));_0x4b4185['field'](_0x67a2('0x8b'));_0x4b4185[_0x67a2('0x45')]('c.phone');_0x4b4185['field'](_0x67a2('0x8c'));_0x4b4185[_0x67a2('0x45')](_0x67a2('0x8d'));_0x4b4185['field'](_0x67a2('0x8e'));_0x4b4185[_0x67a2('0x45')](_0x67a2('0x8f'));_0x4b4185[_0x67a2('0x45')]('c.createdAt');_0x4b4185['field'](_0x67a2('0x90'));_0x4b4185[_0x67a2('0x45')](_0x67a2('0x91'));_0x4b4185['field'](_0x67a2('0x92'),_0x67a2('0x93'));}if(_0x46a057[_0x67a2('0x20')])_0x4b4185[_0x67a2('0x20')](_0x46a057[_0x67a2('0x20')]);if(_0x46a057[_0x67a2('0x1f')])_0x4b4185['offset'](_0x46a057['offset']);return db['sequelize'][_0x67a2('0x3a')](_0x4b4185['toString'](),_0x52bb68);});})[_0x67a2('0x2f')](function(_0x204829){_0x204829[_0x67a2('0x57')](function(_0x43fc41){if(_0x43fc41[_0x67a2('0x93')]){_0x43fc41['Tags']=[];_0x43fc41[_0x67a2('0x93')][_0x67a2('0x56')](',')['forEach'](function(_0x3b5e10){_0x43fc41[_0x67a2('0x94')][_0x67a2('0x34')](_0x33462e[_0x3b5e10]);});}delete _0x43fc41[_0x67a2('0x93')];});_0x2676f5[_0x67a2('0x95')]=_0x204829;return _0x2676f5;})[_0x67a2('0x2f')](respondWithFilteredResult(_0x336655,_0x46a057));})[_0x67a2('0x96')](handleError(_0x336655,null));};exports[_0x67a2('0x29')]=function(_0x13dce9,_0x43cd44){return db[_0x67a2('0x2e')][_0x67a2('0x97')]({'where':{'id':_0x13dce9[_0x67a2('0x98')]['id']}})['then'](handleEntityNotFound(_0x43cd44,null))[_0x67a2('0x2f')](removeEntity(_0x43cd44,null))['catch'](handleError(_0x43cd44,null));};exports['describe']=function(_0x47da82,_0x2c2dc3){return db[_0x67a2('0x2e')][_0x67a2('0x99')]()[_0x67a2('0x2f')](function(_0x189f3d){delete _0x189f3d[_0x67a2('0x9a')];for(var _0x2ad6cb=0x0;_0x2ad6cb{}\s\\|]/g,'-');_0x5bc07a(null,util[_0x8dbe('0x27')](_0x8dbe('0x28'),path[_0x8dbe('0x29')](_0x2548b6[_0x8dbe('0x25')],path['extname'](_0x2548b6[_0x8dbe('0x25')])),Date[_0x8dbe('0x2a')](),path[_0x8dbe('0x2b')](_0x2548b6[_0x8dbe('0x25')])));}})});router[_0x8dbe('0x1e')](_0x8dbe('0x2c'),upload[_0x8dbe('0x2d')]('file'),controller[_0x8dbe('0x2e')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x5050c8,_0x3aef1a,_0x509051){_0x509051(null,path['join'](config[_0x8dbe('0x2f')],_0x8dbe('0x24')));},'filename':function(_0x228d8d,_0x1ddea0,_0x3899c3){_0x1ddea0[_0x8dbe('0x25')]=_0x1ddea0[_0x8dbe('0x25')][_0x8dbe('0x26')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x3899c3(null,util['format'](_0x8dbe('0x28'),path[_0x8dbe('0x29')](_0x1ddea0['originalname'],path[_0x8dbe('0x2b')](_0x1ddea0['originalname'])),Date['now'](),path['extname'](_0x1ddea0['originalname'])));}})});router['post']('/upload',upload[_0x8dbe('0x2d')]('file'),controller['upload']);router[_0x8dbe('0x1e')](_0x8dbe('0x30'),auth[_0x8dbe('0xe')](),controller[_0x8dbe('0x31')]);router[_0x8dbe('0x32')](_0x8dbe('0x10'),auth[_0x8dbe('0xe')](),controller[_0x8dbe('0x33')]);router[_0x8dbe('0x34')](_0x8dbe('0x10'),auth['isAuthenticated'](),controller[_0x8dbe('0x35')]);module[_0x8dbe('0x36')]=router; \ No newline at end of file +var _0xb6ec=['single','uploadCsv','diskStorage','basename','now','/upload','upload','/upload/:id','import','put','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','index','describe','/:id','isAuthenticated','show','getTags','/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','/:id/jscripty_sessions','getJscriptySessions','/:id/journey','getJourney','post','/merge','merge','bulkCreate','/:id/tags','setTags','join','root','server/files/tmp','originalname','replace','format','%s-%s%s','extname','/csv'];(function(_0x8aa16c,_0x18db4c){var _0x5910f2=function(_0x1604ec){while(--_0x1604ec){_0x8aa16c['push'](_0x8aa16c['shift']());}};_0x5910f2(++_0x18db4c);}(_0xb6ec,0xdc));var _0xcb6e=function(_0x578fa7,_0x188156){_0x578fa7=_0x578fa7-0x0;var _0x57e96b=_0xb6ec[_0x578fa7];return _0x57e96b;};'use strict';var multer=require(_0xcb6e('0x0'));var util=require(_0xcb6e('0x1'));var path=require(_0xcb6e('0x2'));var timeout=require(_0xcb6e('0x3'));var express=require(_0xcb6e('0x4'));var router=express[_0xcb6e('0x5')]();var fs_extra=require(_0xcb6e('0x6'));var auth=require(_0xcb6e('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xcb6e('0x8'));var controller=require('./cmContact.controller');router[_0xcb6e('0x9')]('/',auth['isAuthenticated'](),controller[_0xcb6e('0xa')]);router[_0xcb6e('0x9')]('/describe',auth['isAuthenticated'](),controller[_0xcb6e('0xb')]);router['get'](_0xcb6e('0xc'),auth[_0xcb6e('0xd')](),controller[_0xcb6e('0xe')]);router[_0xcb6e('0x9')]('/:id/tags',auth[_0xcb6e('0xd')](),controller[_0xcb6e('0xf')]);router['get'](_0xcb6e('0x10'),auth[_0xcb6e('0xd')](),controller[_0xcb6e('0x11')]);router[_0xcb6e('0x9')](_0xcb6e('0x12'),auth[_0xcb6e('0xd')](),controller[_0xcb6e('0x13')]);router['get'](_0xcb6e('0x14'),auth[_0xcb6e('0xd')](),controller['getHopperFinals']);router[_0xcb6e('0x9')](_0xcb6e('0x15'),auth[_0xcb6e('0xd')](),controller[_0xcb6e('0x16')]);router[_0xcb6e('0x9')](_0xcb6e('0x17'),auth[_0xcb6e('0xd')](),controller[_0xcb6e('0x18')]);router[_0xcb6e('0x19')](_0xcb6e('0x1a'),auth[_0xcb6e('0xd')](),controller[_0xcb6e('0x1b')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0xcb6e('0x19')]('/create_many',auth[_0xcb6e('0xd')](),controller[_0xcb6e('0x1c')]);router[_0xcb6e('0x19')](_0xcb6e('0x1d'),auth[_0xcb6e('0xd')](),controller[_0xcb6e('0x1e')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x25f339,_0x4c37fc,_0x522df4){_0x522df4(null,path[_0xcb6e('0x1f')](config[_0xcb6e('0x20')],_0xcb6e('0x21')));},'filename':function(_0x46cd5a,_0x358474,_0x14a05f){_0x358474[_0xcb6e('0x22')]=_0x358474['originalname'][_0xcb6e('0x23')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x14a05f(null,util[_0xcb6e('0x24')](_0xcb6e('0x25'),path['basename'](_0x358474[_0xcb6e('0x22')],path[_0xcb6e('0x26')](_0x358474[_0xcb6e('0x22')])),Date['now'](),path['extname'](_0x358474[_0xcb6e('0x22')])));}})});router['post'](_0xcb6e('0x27'),upload[_0xcb6e('0x28')]('file'),controller[_0xcb6e('0x29')]);var upload=multer({'storage':multer[_0xcb6e('0x2a')]({'destination':function(_0x280923,_0x3e059c,_0x41f8e5){_0x41f8e5(null,path['join'](config[_0xcb6e('0x20')],_0xcb6e('0x21')));},'filename':function(_0x56fb4e,_0x199cd8,_0x5d1776){_0x199cd8[_0xcb6e('0x22')]=_0x199cd8[_0xcb6e('0x22')][_0xcb6e('0x23')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x5d1776(null,util[_0xcb6e('0x24')](_0xcb6e('0x25'),path[_0xcb6e('0x2b')](_0x199cd8[_0xcb6e('0x22')],path[_0xcb6e('0x26')](_0x199cd8['originalname'])),Date[_0xcb6e('0x2c')](),path['extname'](_0x199cd8[_0xcb6e('0x22')])));}})});router[_0xcb6e('0x19')](_0xcb6e('0x2d'),upload['single']('file'),controller[_0xcb6e('0x2e')]);router[_0xcb6e('0x19')](_0xcb6e('0x2f'),auth[_0xcb6e('0xd')](),controller[_0xcb6e('0x30')]);router[_0xcb6e('0x31')](_0xcb6e('0xc'),auth[_0xcb6e('0xd')](),controller['update']);router[_0xcb6e('0x32')](_0xcb6e('0xc'),auth[_0xcb6e('0xd')](),controller[_0xcb6e('0x33')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.attributes.js b/server/api/cmCustomField/cmCustomField.attributes.js index f6999b1..7689ad5 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 _0xa28c=['STRING','name','long','select','parse','values','isArray','setDataValue','BOOLEAN','ENUM','voice','sequelize','lodash','exports','getDataValue'];(function(_0x2728e8,_0x2cfb6c){var _0x235b11=function(_0x4c4290){while(--_0x4c4290){_0x2728e8['push'](_0x2728e8['shift']());}};_0x235b11(++_0x2cfb6c);}(_0xa28c,0x1af));var _0xca28=function(_0x5608a3,_0x5b33c5){_0x5608a3=_0x5608a3-0x0;var _0x1ed50a=_0xa28c[_0x5608a3];return _0x1ed50a;};'use strict';var Sequelize=require(_0xca28('0x0'));var _=require(_0xca28('0x1'));module[_0xca28('0x2')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x4a261d){return this[_0xca28('0x3')]('alias');}},'alias':{'type':Sequelize[_0xca28('0x4')],'allowNull':![],'set':function(_0x5964cd){this['setDataValue']('alias',_0x5964cd?_0x5964cd:this['getDataValue'](_0xca28('0x5')));}},'type':{'type':Sequelize[_0xca28('0x4')],'allowNull':![]},'values':{'type':Sequelize['TEXT'](_0xca28('0x6')),'get':function(){if(this[_0xca28('0x3')]('type')===_0xca28('0x7')){return JSON[_0xca28('0x8')](this[_0xca28('0x3')]('values'));}else{return this[_0xca28('0x3')](_0xca28('0x9'));}},'set':function(_0x50ab65){if(Array[_0xca28('0xa')](_0x50ab65)){this[_0xca28('0xb')](_0xca28('0x9'),JSON['stringify'](_0x50ab65));}else{this[_0xca28('0xb')](_0xca28('0x9'),_0x50ab65);}}},'required':{'type':Sequelize[_0xca28('0xc')],'defaultValue':![]},'clickToAction':{'type':Sequelize[_0xca28('0xc')],'defaultValue':![]},'actionType':{'type':Sequelize[_0xca28('0xd')](_0xca28('0xe'))}}; \ No newline at end of file +var _0x25af=['isArray','setDataValue','values','stringify','BOOLEAN','ENUM','voice','lodash','VIRTUAL','getDataValue','name','TEXT','type','select','parse'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x25af,0x115));var _0xf25a=function(_0x300bdd,_0x2d3145){_0x300bdd=_0x300bdd-0x0;var _0x26ddc2=_0x25af[_0x300bdd];return _0x26ddc2;};'use strict';var Sequelize=require('sequelize');var _=require(_0xf25a('0x0'));module['exports']={'name':{'type':Sequelize[_0xf25a('0x1')],'get':function(_0x1eaa9c){return this[_0xf25a('0x2')]('alias');}},'alias':{'type':Sequelize['STRING'],'allowNull':![],'set':function(_0xd7808b){this['setDataValue']('alias',_0xd7808b?_0xd7808b:this[_0xf25a('0x2')](_0xf25a('0x3')));}},'type':{'type':Sequelize['STRING'],'allowNull':![]},'values':{'type':Sequelize[_0xf25a('0x4')]('long'),'get':function(){if(this['getDataValue'](_0xf25a('0x5'))===_0xf25a('0x6')){return JSON[_0xf25a('0x7')](this[_0xf25a('0x2')]('values'));}else{return this[_0xf25a('0x2')]('values');}},'set':function(_0x5d4c7d){if(Array[_0xf25a('0x8')](_0x5d4c7d)){this[_0xf25a('0x9')](_0xf25a('0xa'),JSON[_0xf25a('0xb')](_0x5d4c7d));}else{this[_0xf25a('0x9')](_0xf25a('0xa'),_0x5d4c7d);}}},'required':{'type':Sequelize[_0xf25a('0xc')],'defaultValue':![]},'clickToAction':{'type':Sequelize[_0xf25a('0xc')],'defaultValue':![]},'actionType':{'type':Sequelize[_0xf25a('0xd')](_0xf25a('0xe'))}}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.controller.js b/server/api/cmCustomField/cmCustomField.controller.js index 5e3e62a..b86e17d 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 _0xd1c9=['map','query','keys','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','then','include','rows','catch','params','includeAll','find','update','body','destroy','create','text','Sequelize','TEXT','number','INTEGER','defaultValue','sequelize','queryInterface','cm_contacts','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','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','limit','count','set','apply','reject','save','end','error','stack','name','send','CmCustomField','rawAttributes','fieldName','type','key','model','differenceBy'];(function(_0x2a1d71,_0x8b9b0a){var _0x18c69a=function(_0x763cb3){while(--_0x763cb3){_0x2a1d71['push'](_0x2a1d71['shift']());}};_0x18c69a(++_0x8b9b0a);}(_0xd1c9,0x7c));var _0x9d1c=function(_0x25a42a,_0x3d489b){_0x25a42a=_0x25a42a-0x0;var _0x1129b1=_0xd1c9[_0x25a42a];return _0x1129b1;};'use strict';var emlformat=require(_0x9d1c('0x0'));var rimraf=require(_0x9d1c('0x1'));var zipdir=require(_0x9d1c('0x2'));var jsonpatch=require(_0x9d1c('0x3'));var rp=require(_0x9d1c('0x4'));var moment=require(_0x9d1c('0x5'));var BPromise=require(_0x9d1c('0x6'));var Mustache=require(_0x9d1c('0x7'));var util=require(_0x9d1c('0x8'));var path=require(_0x9d1c('0x9'));var sox=require(_0x9d1c('0xa'));var csv=require(_0x9d1c('0xb'));var ejs=require(_0x9d1c('0xc'));var fs=require('fs');var fs_extra=require(_0x9d1c('0xd'));var _=require(_0x9d1c('0xe'));var squel=require(_0x9d1c('0xf'));var crypto=require(_0x9d1c('0x10'));var jsforce=require(_0x9d1c('0x11'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x9d1c('0x12'));var Papa=require('papaparse');var Redis=require(_0x9d1c('0x13'));var authService=require(_0x9d1c('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0x9d1c('0x15'));var hardwareService=require(_0x9d1c('0x16'));var logger=require(_0x9d1c('0x17'))(_0x9d1c('0x18'));var utils=require(_0x9d1c('0x19'));var config=require(_0x9d1c('0x1a'));var licenseUtil=require(_0x9d1c('0x1b'));var db=require(_0x9d1c('0x1c'))['db'];function respondWithStatusCode(_0x36205f,_0x1d265c){_0x1d265c=_0x1d265c||0xcc;return function(_0x3e96ca){if(_0x3e96ca){return _0x36205f[_0x9d1c('0x1d')](_0x1d265c);}return _0x36205f[_0x9d1c('0x1e')](_0x1d265c)['end']();};}function respondWithResult(_0x55428d,_0x2f7245){_0x2f7245=_0x2f7245||0xc8;return function(_0x407aa9){if(_0x407aa9){return _0x55428d[_0x9d1c('0x1e')](_0x2f7245)['json'](_0x407aa9);}};}function respondWithFilteredResult(_0x5141b1,_0x429758){return function(_0x4c0bfe){if(_0x4c0bfe){var _0x233d21=typeof _0x429758[_0x9d1c('0x1f')]==='undefined'&&typeof _0x429758[_0x9d1c('0x20')]==='undefined';var _0x142323=_0x4c0bfe[_0x9d1c('0x21')];var _0x4806a7=_0x233d21?0x0:_0x429758['offset'];var _0x72917d=_0x233d21?_0x4c0bfe[_0x9d1c('0x21')]:_0x429758[_0x9d1c('0x1f')]+_0x429758[_0x9d1c('0x20')];var _0x5e7086;if(_0x72917d>=_0x142323){_0x72917d=_0x142323;_0x5e7086=0xc8;}else{_0x5e7086=0xce;}_0x5141b1[_0x9d1c('0x1e')](_0x5e7086);return _0x5141b1[_0x9d1c('0x22')]('Content-Range',_0x4806a7+'-'+_0x72917d+'/'+_0x142323)['json'](_0x4c0bfe);}return null;};}function patchUpdates(_0x4685b6){return function(_0x167501){try{jsonpatch[_0x9d1c('0x23')](_0x167501,_0x4685b6,!![]);}catch(_0xe99c20){return BPromise[_0x9d1c('0x24')](_0xe99c20);}return _0x167501[_0x9d1c('0x25')]();};}function saveUpdates(_0x2bae44,_0x4f3216){return function(_0x42722e){if(_0x42722e){return _0x42722e['update'](_0x2bae44)['then'](function(_0x1b7c63){return _0x1b7c63;});}return null;};}function removeEntity(_0x58ae90,_0x1956c4){return function(_0x5cf6d8){if(_0x5cf6d8){return _0x5cf6d8['destroy']()['then'](function(){_0x58ae90[_0x9d1c('0x1e')](0xcc)[_0x9d1c('0x26')]();});}};}function handleEntityNotFound(_0x3212b4,_0x2e5197){return function(_0x9e89f5){if(!_0x9e89f5){_0x3212b4[_0x9d1c('0x1d')](0x194);}return _0x9e89f5;};}function handleError(_0x1a9347,_0x1e3ea0){_0x1e3ea0=_0x1e3ea0||0x1f4;return function(_0x5d9625){logger[_0x9d1c('0x27')](_0x5d9625[_0x9d1c('0x28')]);if(_0x5d9625['name']){delete _0x5d9625[_0x9d1c('0x29')];}_0x1a9347['status'](_0x1e3ea0)[_0x9d1c('0x2a')](_0x5d9625);};}exports['index']=function(_0x33437e,_0x5dfd5b){var _0x328977={},_0x5664d2={},_0x15985c={'count':0x0,'rows':[]};var _0x33d531=_['map'](db[_0x9d1c('0x2b')][_0x9d1c('0x2c')],function(_0x271f64){return{'name':_0x271f64[_0x9d1c('0x2d')],'type':_0x271f64[_0x9d1c('0x2e')][_0x9d1c('0x2f')]};});_0x5664d2[_0x9d1c('0x30')]=_[_0x9d1c('0x31')](_[_0x9d1c('0x32')](_0x33d531,_0x9d1c('0x29')),['name']);_0x5664d2[_0x9d1c('0x33')]=_[_0x9d1c('0x34')](_0x33437e[_0x9d1c('0x33')]);_0x5664d2['filters']=_[_0x9d1c('0x35')](_0x5664d2['model'],_0x5664d2[_0x9d1c('0x33')]);_0x328977[_0x9d1c('0x36')]=_[_0x9d1c('0x35')](_0x5664d2[_0x9d1c('0x30')],qs[_0x9d1c('0x37')](_0x33437e[_0x9d1c('0x33')][_0x9d1c('0x37')]));_0x328977[_0x9d1c('0x36')]=_0x328977['attributes'][_0x9d1c('0x38')]?_0x328977[_0x9d1c('0x36')]:_0x5664d2[_0x9d1c('0x30')];if(!_0x33437e[_0x9d1c('0x33')][_0x9d1c('0x39')]('nolimit')){_0x328977[_0x9d1c('0x20')]=qs[_0x9d1c('0x20')](_0x33437e[_0x9d1c('0x33')][_0x9d1c('0x20')]);_0x328977[_0x9d1c('0x1f')]=qs['offset'](_0x33437e[_0x9d1c('0x33')]['offset']);}_0x328977[_0x9d1c('0x3a')]=qs['sort'](_0x33437e['query'][_0x9d1c('0x3b')]);_0x328977[_0x9d1c('0x3c')]=qs[_0x9d1c('0x3d')](_[_0x9d1c('0x3e')](_0x33437e[_0x9d1c('0x33')],_0x5664d2[_0x9d1c('0x3d')]),_0x33d531);if(_0x33437e[_0x9d1c('0x33')][_0x9d1c('0x3f')]){_0x328977[_0x9d1c('0x3c')]=_[_0x9d1c('0x40')](_0x328977[_0x9d1c('0x3c')],{'$or':_[_0x9d1c('0x32')](_0x33d531,function(_0x19f58d){if(_0x19f58d['type']!==_0x9d1c('0x41')){var _0x5da86d={};_0x5da86d[_0x19f58d['name']]={'$like':'%'+_0x33437e[_0x9d1c('0x33')]['filter']+'%'};return _0x5da86d;}})});}_0x328977=_['merge']({},_0x328977,_0x33437e[_0x9d1c('0x42')]);var _0x1ebe09={'where':_0x328977[_0x9d1c('0x3c')]};return db[_0x9d1c('0x2b')][_0x9d1c('0x21')](_0x1ebe09)[_0x9d1c('0x43')](function(_0x5cc523){_0x15985c[_0x9d1c('0x21')]=_0x5cc523;if(_0x33437e['query']['includeAll']){_0x328977[_0x9d1c('0x44')]=[{'all':!![]}];}return db['CmCustomField']['findAll'](_0x328977);})[_0x9d1c('0x43')](function(_0x2c6d19){_0x15985c[_0x9d1c('0x45')]=_0x2c6d19;return _0x15985c;})[_0x9d1c('0x43')](respondWithFilteredResult(_0x5dfd5b,_0x328977))[_0x9d1c('0x46')](handleError(_0x5dfd5b,null));};exports['show']=function(_0x19cf24,_0xed581d){var _0x1c1882={'raw':!![],'where':{'id':_0x19cf24[_0x9d1c('0x47')]['id']}},_0x172666={};_0x172666[_0x9d1c('0x30')]=_[_0x9d1c('0x34')](db[_0x9d1c('0x2b')]['rawAttributes']);_0x172666['query']=_[_0x9d1c('0x34')](_0x19cf24[_0x9d1c('0x33')]);_0x172666['filters']=_['intersection'](_0x172666['model'],_0x172666[_0x9d1c('0x33')]);_0x1c1882[_0x9d1c('0x36')]=_[_0x9d1c('0x35')](_0x172666['model'],qs['fields'](_0x19cf24['query'][_0x9d1c('0x37')]));_0x1c1882['attributes']=_0x1c1882[_0x9d1c('0x36')][_0x9d1c('0x38')]?_0x1c1882[_0x9d1c('0x36')]:_0x172666['model'];if(_0x19cf24[_0x9d1c('0x33')][_0x9d1c('0x48')]){_0x1c1882[_0x9d1c('0x44')]=[{'all':!![]}];}_0x1c1882=_[_0x9d1c('0x40')]({},_0x1c1882,_0x19cf24[_0x9d1c('0x42')]);return db[_0x9d1c('0x2b')][_0x9d1c('0x49')](_0x1c1882)['then'](handleEntityNotFound(_0xed581d,null))[_0x9d1c('0x43')](respondWithResult(_0xed581d,null))[_0x9d1c('0x46')](handleError(_0xed581d,null));};exports[_0x9d1c('0x4a')]=function(_0x2292b5,_0x4a8636){if(_0x2292b5['body']['id']){delete _0x2292b5[_0x9d1c('0x4b')]['id'];}return db['CmCustomField'][_0x9d1c('0x49')]({'where':{'id':_0x2292b5[_0x9d1c('0x47')]['id']}})[_0x9d1c('0x43')](handleEntityNotFound(_0x4a8636,null))[_0x9d1c('0x43')](saveUpdates(_0x2292b5[_0x9d1c('0x4b')],null))[_0x9d1c('0x43')](respondWithResult(_0x4a8636,null))['catch'](handleError(_0x4a8636,null));};exports[_0x9d1c('0x4c')]=function(_0x558707,_0x5040b5){return db[_0x9d1c('0x2b')][_0x9d1c('0x49')]({'where':{'id':_0x558707[_0x9d1c('0x47')]['id']}})[_0x9d1c('0x43')](handleEntityNotFound(_0x5040b5,null))['then'](removeEntity(_0x5040b5,null))[_0x9d1c('0x46')](handleError(_0x5040b5,null));};exports[_0x9d1c('0x4d')]=function(_0x324d4d,_0x16ad77){var _0x59d8ac;return db['sequelize']['transaction'](function(_0x48e72b){return db['CmCustomField'][_0x9d1c('0x4d')](_0x324d4d[_0x9d1c('0x4b')],{'transaction':_0x48e72b})[_0x9d1c('0x43')](function(_0x5bc443){_0x59d8ac=_0x5bc443;var _0x57ded6={'type':db['Sequelize']['TEXT'],'transaction':_0x48e72b};switch(_0x324d4d['body']['type']){case _0x9d1c('0x4e'):_0x57ded6[_0x9d1c('0x2e')]=db[_0x9d1c('0x4f')][_0x9d1c('0x50')];break;case _0x9d1c('0x51'):_0x57ded6[_0x9d1c('0x2e')]=db[_0x9d1c('0x4f')][_0x9d1c('0x52')];break;case'switch':_0x57ded6[_0x9d1c('0x2e')]=db['Sequelize']['BOOLEAN'];_0x57ded6[_0x9d1c('0x53')]=![];break;default:}return db[_0x9d1c('0x54')][_0x9d1c('0x55')]['addColumn'](_0x9d1c('0x56'),util['format']('cf_%d',_0x59d8ac['id']),_0x57ded6);})[_0x9d1c('0x43')](function(){return _0x59d8ac;});})[_0x9d1c('0x43')](respondWithResult(_0x16ad77,0xc9))[_0x9d1c('0x46')](handleError(_0x16ad77,null));}; \ No newline at end of file +var _0x1ef9=['format','cf_%d','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','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','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','save','update','destroy','then','stack','name','send','index','map','CmCustomField','rawAttributes','type','key','model','differenceBy','query','keys','filters','attributes','fields','hasOwnProperty','nolimit','sort','pick','filter','where','VIRTUAL','merge','options','includeAll','include','catch','show','params','intersection','length','find','body','create','transaction','Sequelize','TEXT','text','number','INTEGER','switch','BOOLEAN','defaultValue','sequelize','addColumn'];(function(_0x35124b,_0x5d6083){var _0x310f95=function(_0x53b25f){while(--_0x53b25f){_0x35124b['push'](_0x35124b['shift']());}};_0x310f95(++_0x5d6083);}(_0x1ef9,0x1b5));var _0x91ef=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1ef9[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x91ef('0x0'));var rimraf=require(_0x91ef('0x1'));var zipdir=require(_0x91ef('0x2'));var jsonpatch=require(_0x91ef('0x3'));var rp=require(_0x91ef('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x91ef('0x5'));var util=require(_0x91ef('0x6'));var path=require(_0x91ef('0x7'));var sox=require(_0x91ef('0x8'));var csv=require(_0x91ef('0x9'));var ejs=require(_0x91ef('0xa'));var fs=require('fs');var fs_extra=require(_0x91ef('0xb'));var _=require('lodash');var squel=require(_0x91ef('0xc'));var crypto=require('crypto');var jsforce=require(_0x91ef('0xd'));var deskjs=require(_0x91ef('0xe'));var toCsv=require(_0x91ef('0x9'));var querystring=require(_0x91ef('0xf'));var Papa=require(_0x91ef('0x10'));var Redis=require('ioredis');var authService=require(_0x91ef('0x11'));var qs=require(_0x91ef('0x12'));var as=require(_0x91ef('0x13'));var hardwareService=require(_0x91ef('0x14'));var logger=require('../../config/logger')(_0x91ef('0x15'));var utils=require(_0x91ef('0x16'));var config=require(_0x91ef('0x17'));var licenseUtil=require(_0x91ef('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2533a0,_0x432570){_0x432570=_0x432570||0xcc;return function(_0x563e91){if(_0x563e91){return _0x2533a0[_0x91ef('0x19')](_0x432570);}return _0x2533a0[_0x91ef('0x1a')](_0x432570)[_0x91ef('0x1b')]();};}function respondWithResult(_0x2ede1a,_0x4e6cd4){_0x4e6cd4=_0x4e6cd4||0xc8;return function(_0x2db3df){if(_0x2db3df){return _0x2ede1a[_0x91ef('0x1a')](_0x4e6cd4)[_0x91ef('0x1c')](_0x2db3df);}};}function respondWithFilteredResult(_0x5961fe,_0x21c0e5){return function(_0x331740){if(_0x331740){var _0x209763=typeof _0x21c0e5['offset']===_0x91ef('0x1d')&&typeof _0x21c0e5[_0x91ef('0x1e')]===_0x91ef('0x1d');var _0x285989=_0x331740[_0x91ef('0x1f')];var _0x34dd4e=_0x209763?0x0:_0x21c0e5['offset'];var _0x1eb155=_0x209763?_0x331740['count']:_0x21c0e5[_0x91ef('0x20')]+_0x21c0e5[_0x91ef('0x1e')];var _0x18e794;if(_0x1eb155>=_0x285989){_0x1eb155=_0x285989;_0x18e794=0xc8;}else{_0x18e794=0xce;}_0x5961fe[_0x91ef('0x1a')](_0x18e794);return _0x5961fe[_0x91ef('0x21')](_0x91ef('0x22'),_0x34dd4e+'-'+_0x1eb155+'/'+_0x285989)[_0x91ef('0x1c')](_0x331740);}return null;};}function patchUpdates(_0x215c84){return function(_0x573591){try{jsonpatch['apply'](_0x573591,_0x215c84,!![]);}catch(_0x5d3b99){return BPromise['reject'](_0x5d3b99);}return _0x573591[_0x91ef('0x23')]();};}function saveUpdates(_0x207ff0,_0x3024f4){return function(_0x2b5452){if(_0x2b5452){return _0x2b5452[_0x91ef('0x24')](_0x207ff0)['then'](function(_0x1363f0){return _0x1363f0;});}return null;};}function removeEntity(_0x481ff4,_0x2abde6){return function(_0x57abf6){if(_0x57abf6){return _0x57abf6[_0x91ef('0x25')]()[_0x91ef('0x26')](function(){_0x481ff4[_0x91ef('0x1a')](0xcc)[_0x91ef('0x1b')]();});}};}function handleEntityNotFound(_0x265c13,_0x508631){return function(_0x2fd067){if(!_0x2fd067){_0x265c13[_0x91ef('0x19')](0x194);}return _0x2fd067;};}function handleError(_0x5e8169,_0x1d0a5f){_0x1d0a5f=_0x1d0a5f||0x1f4;return function(_0x462f16){logger['error'](_0x462f16[_0x91ef('0x27')]);if(_0x462f16[_0x91ef('0x28')]){delete _0x462f16[_0x91ef('0x28')];}_0x5e8169['status'](_0x1d0a5f)[_0x91ef('0x29')](_0x462f16);};}exports[_0x91ef('0x2a')]=function(_0x125c32,_0x16f0f7){var _0x28b36e={},_0x14a5d7={},_0x1f47d9={'count':0x0,'rows':[]};var _0x1b10e6=_[_0x91ef('0x2b')](db[_0x91ef('0x2c')][_0x91ef('0x2d')],function(_0xbfae36){return{'name':_0xbfae36['fieldName'],'type':_0xbfae36[_0x91ef('0x2e')][_0x91ef('0x2f')]};});_0x14a5d7[_0x91ef('0x30')]=_[_0x91ef('0x31')](_[_0x91ef('0x2b')](_0x1b10e6,_0x91ef('0x28')),[_0x91ef('0x28')]);_0x14a5d7[_0x91ef('0x32')]=_[_0x91ef('0x33')](_0x125c32[_0x91ef('0x32')]);_0x14a5d7[_0x91ef('0x34')]=_['intersection'](_0x14a5d7[_0x91ef('0x30')],_0x14a5d7[_0x91ef('0x32')]);_0x28b36e[_0x91ef('0x35')]=_['intersection'](_0x14a5d7['model'],qs[_0x91ef('0x36')](_0x125c32[_0x91ef('0x32')][_0x91ef('0x36')]));_0x28b36e[_0x91ef('0x35')]=_0x28b36e[_0x91ef('0x35')]['length']?_0x28b36e[_0x91ef('0x35')]:_0x14a5d7[_0x91ef('0x30')];if(!_0x125c32[_0x91ef('0x32')][_0x91ef('0x37')](_0x91ef('0x38'))){_0x28b36e[_0x91ef('0x1e')]=qs[_0x91ef('0x1e')](_0x125c32['query'][_0x91ef('0x1e')]);_0x28b36e[_0x91ef('0x20')]=qs[_0x91ef('0x20')](_0x125c32[_0x91ef('0x32')][_0x91ef('0x20')]);}_0x28b36e['order']=qs['sort'](_0x125c32[_0x91ef('0x32')][_0x91ef('0x39')]);_0x28b36e['where']=qs[_0x91ef('0x34')](_[_0x91ef('0x3a')](_0x125c32[_0x91ef('0x32')],_0x14a5d7[_0x91ef('0x34')]),_0x1b10e6);if(_0x125c32[_0x91ef('0x32')][_0x91ef('0x3b')]){_0x28b36e['where']=_['merge'](_0x28b36e[_0x91ef('0x3c')],{'$or':_[_0x91ef('0x2b')](_0x1b10e6,function(_0xccc1b1){if(_0xccc1b1['type']!==_0x91ef('0x3d')){var _0x23d827={};_0x23d827[_0xccc1b1[_0x91ef('0x28')]]={'$like':'%'+_0x125c32[_0x91ef('0x32')][_0x91ef('0x3b')]+'%'};return _0x23d827;}})});}_0x28b36e=_[_0x91ef('0x3e')]({},_0x28b36e,_0x125c32[_0x91ef('0x3f')]);var _0x5d3b01={'where':_0x28b36e[_0x91ef('0x3c')]};return db[_0x91ef('0x2c')]['count'](_0x5d3b01)['then'](function(_0x25d029){_0x1f47d9[_0x91ef('0x1f')]=_0x25d029;if(_0x125c32['query'][_0x91ef('0x40')]){_0x28b36e[_0x91ef('0x41')]=[{'all':!![]}];}return db[_0x91ef('0x2c')]['findAll'](_0x28b36e);})[_0x91ef('0x26')](function(_0x3ebeff){_0x1f47d9['rows']=_0x3ebeff;return _0x1f47d9;})[_0x91ef('0x26')](respondWithFilteredResult(_0x16f0f7,_0x28b36e))[_0x91ef('0x42')](handleError(_0x16f0f7,null));};exports[_0x91ef('0x43')]=function(_0x41f10d,_0x1ea9aa){var _0x586ee7={'raw':!![],'where':{'id':_0x41f10d[_0x91ef('0x44')]['id']}},_0x230de1={};_0x230de1[_0x91ef('0x30')]=_[_0x91ef('0x33')](db[_0x91ef('0x2c')][_0x91ef('0x2d')]);_0x230de1[_0x91ef('0x32')]=_[_0x91ef('0x33')](_0x41f10d[_0x91ef('0x32')]);_0x230de1[_0x91ef('0x34')]=_[_0x91ef('0x45')](_0x230de1[_0x91ef('0x30')],_0x230de1[_0x91ef('0x32')]);_0x586ee7[_0x91ef('0x35')]=_[_0x91ef('0x45')](_0x230de1[_0x91ef('0x30')],qs[_0x91ef('0x36')](_0x41f10d[_0x91ef('0x32')][_0x91ef('0x36')]));_0x586ee7['attributes']=_0x586ee7['attributes'][_0x91ef('0x46')]?_0x586ee7['attributes']:_0x230de1[_0x91ef('0x30')];if(_0x41f10d['query'][_0x91ef('0x40')]){_0x586ee7[_0x91ef('0x41')]=[{'all':!![]}];}_0x586ee7=_[_0x91ef('0x3e')]({},_0x586ee7,_0x41f10d[_0x91ef('0x3f')]);return db[_0x91ef('0x2c')][_0x91ef('0x47')](_0x586ee7)[_0x91ef('0x26')](handleEntityNotFound(_0x1ea9aa,null))['then'](respondWithResult(_0x1ea9aa,null))['catch'](handleError(_0x1ea9aa,null));};exports[_0x91ef('0x24')]=function(_0x5def1b,_0x34f6eb){if(_0x5def1b[_0x91ef('0x48')]['id']){delete _0x5def1b[_0x91ef('0x48')]['id'];}return db[_0x91ef('0x2c')]['find']({'where':{'id':_0x5def1b[_0x91ef('0x44')]['id']}})['then'](handleEntityNotFound(_0x34f6eb,null))[_0x91ef('0x26')](saveUpdates(_0x5def1b['body'],null))[_0x91ef('0x26')](respondWithResult(_0x34f6eb,null))[_0x91ef('0x42')](handleError(_0x34f6eb,null));};exports[_0x91ef('0x25')]=function(_0x5385bb,_0x11ca02){return db[_0x91ef('0x2c')]['find']({'where':{'id':_0x5385bb[_0x91ef('0x44')]['id']}})[_0x91ef('0x26')](handleEntityNotFound(_0x11ca02,null))['then'](removeEntity(_0x11ca02,null))[_0x91ef('0x42')](handleError(_0x11ca02,null));};exports[_0x91ef('0x49')]=function(_0x3a7323,_0x50467d){var _0x1cb8d4;return db['sequelize'][_0x91ef('0x4a')](function(_0x283bee){return db[_0x91ef('0x2c')][_0x91ef('0x49')](_0x3a7323[_0x91ef('0x48')],{'transaction':_0x283bee})[_0x91ef('0x26')](function(_0x287d7e){_0x1cb8d4=_0x287d7e;var _0x47ab7b={'type':db[_0x91ef('0x4b')][_0x91ef('0x4c')],'transaction':_0x283bee};switch(_0x3a7323['body'][_0x91ef('0x2e')]){case _0x91ef('0x4d'):_0x47ab7b[_0x91ef('0x2e')]=db[_0x91ef('0x4b')]['TEXT'];break;case _0x91ef('0x4e'):_0x47ab7b[_0x91ef('0x2e')]=db[_0x91ef('0x4b')][_0x91ef('0x4f')];break;case _0x91ef('0x50'):_0x47ab7b[_0x91ef('0x2e')]=db[_0x91ef('0x4b')][_0x91ef('0x51')];_0x47ab7b[_0x91ef('0x52')]=![];break;default:}return db[_0x91ef('0x53')]['queryInterface'][_0x91ef('0x54')]('cm_contacts',util[_0x91ef('0x55')](_0x91ef('0x56'),_0x1cb8d4['id']),_0x47ab7b);})[_0x91ef('0x26')](function(){return _0x1cb8d4;});})[_0x91ef('0x26')](respondWithResult(_0x50467d,0xc9))[_0x91ef('0x42')](handleError(_0x50467d,null));}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.model.js b/server/api/cmCustomField/cmCustomField.model.js index 9c1a416..5998abe 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 _0x361d=['./cmCustomField.attributes','exports','define','cm_custom_fields','lodash','util','api','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x16a7d8,_0x326d5c){var _0xa4b589=function(_0x17add5){while(--_0x17add5){_0x16a7d8['push'](_0x16a7d8['shift']());}};_0xa4b589(++_0x326d5c);}(_0x361d,0xeb));var _0xd361=function(_0x158587,_0x597e47){_0x158587=_0x158587-0x0;var _0x5c4ef1=_0x361d[_0x158587];return _0x5c4ef1;};'use strict';var _=require(_0xd361('0x0'));var util=require(_0xd361('0x1'));var logger=require('../../config/logger')(_0xd361('0x2'));var moment=require('moment');var BPromise=require(_0xd361('0x3'));var rp=require(_0xd361('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd361('0x5'));var config=require(_0xd361('0x6'));var attributes=require(_0xd361('0x7'));module[_0xd361('0x8')]=function(_0x506903,_0xbfb9cc){return _0x506903[_0xd361('0x9')]('CmCustomField',attributes,{'tableName':_0xd361('0xa'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb7bc=['rimraf','../../config/environment','exports','define','CmCustomField','cm_custom_fields','lodash','util','../../config/logger','api','moment','request-promise','path'];(function(_0x134c2e,_0x3573c4){var _0x2825db=function(_0x2a574d){while(--_0x2a574d){_0x134c2e['push'](_0x134c2e['shift']());}};_0x2825db(++_0x3573c4);}(_0xb7bc,0x13e));var _0xcb7b=function(_0x565ed7,_0x398228){_0x565ed7=_0x565ed7-0x0;var _0x183ad7=_0xb7bc[_0x565ed7];return _0x183ad7;};'use strict';var _=require(_0xcb7b('0x0'));var util=require(_0xcb7b('0x1'));var logger=require(_0xcb7b('0x2'))(_0xcb7b('0x3'));var moment=require(_0xcb7b('0x4'));var BPromise=require('bluebird');var rp=require(_0xcb7b('0x5'));var fs=require('fs');var path=require(_0xcb7b('0x6'));var rimraf=require(_0xcb7b('0x7'));var config=require(_0xcb7b('0x8'));var attributes=require('./cmCustomField.attributes');module[_0xcb7b('0x9')]=function(_0x2ead89,_0x3ab9a1){return _0x2ead89[_0xcb7b('0xa')](_0xcb7b('0xb'),attributes,{'tableName':_0xcb7b('0xc'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.rpc.js b/server/api/cmCustomField/cmCustomField.rpc.js index bf247a1..c56cce6 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 _0xa6bd=['message','result','catch','lodash','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','CmCustomField,\x20%s,\x20%s','request\x20sent','debug','stringify','error'];(function(_0x4abe99,_0x440d88){var _0x2450f2=function(_0x3365a3){while(--_0x3365a3){_0x4abe99['push'](_0x4abe99['shift']());}};_0x2450f2(++_0x440d88);}(_0xa6bd,0x153));var _0xda6b=function(_0x2a32e6,_0x46e898){_0x2a32e6=_0x2a32e6-0x0;var _0xf98798=_0xa6bd[_0x2a32e6];return _0xf98798;};'use strict';var _=require(_0xda6b('0x0'));var util=require('util');var moment=require(_0xda6b('0x1'));var BPromise=require(_0xda6b('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xda6b('0x3'))['db'];var utils=require(_0xda6b('0x4'));var logger=require(_0xda6b('0x5'))('rpc');var config=require(_0xda6b('0x6'));var jayson=require(_0xda6b('0x7'));var client=jayson[_0xda6b('0x8')][_0xda6b('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4af492,_0x1035ab,_0x4e95b7){return new BPromise(function(_0x4cb2fc,_0x5a912e){return client[_0xda6b('0xa')](_0x4af492,_0x4e95b7)[_0xda6b('0xb')](function(_0x47e0c0){logger[_0xda6b('0xc')](_0xda6b('0xd'),_0x1035ab,_0xda6b('0xe'));logger[_0xda6b('0xf')]('CmCustomField,\x20%s,\x20%s,\x20%s',_0x1035ab,'request\x20sent',JSON[_0xda6b('0x10')](_0x47e0c0));if(_0x47e0c0[_0xda6b('0x11')]){if(_0x47e0c0['error']['code']===0x1f4){logger[_0xda6b('0x11')](_0xda6b('0xd'),_0x1035ab,_0x47e0c0[_0xda6b('0x11')][_0xda6b('0x12')]);return _0x5a912e(_0x47e0c0[_0xda6b('0x11')]['message']);}logger['error']('CmCustomField,\x20%s,\x20%s',_0x1035ab,_0x47e0c0[_0xda6b('0x11')][_0xda6b('0x12')]);return _0x4cb2fc(_0x47e0c0[_0xda6b('0x11')][_0xda6b('0x12')]);}else{logger[_0xda6b('0xc')](_0xda6b('0xd'),_0x1035ab,_0xda6b('0xe'));_0x4cb2fc(_0x47e0c0[_0xda6b('0x13')][_0xda6b('0x12')]);}})[_0xda6b('0x14')](function(_0x232df2){logger['error'](_0xda6b('0xd'),_0x1035ab,_0x232df2);_0x5a912e(_0x232df2);});});} \ No newline at end of file +var _0x96dd=['info','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','request\x20sent','debug','CmCustomField,\x20%s,\x20%s,\x20%s','stringify','error','code','CmCustomField,\x20%s,\x20%s','message'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x96dd,0x1b7));var _0xd96d=function(_0x23d01e,_0x36c054){_0x23d01e=_0x23d01e-0x0;var _0x3ef870=_0x96dd[_0x23d01e];return _0x3ef870;};'use strict';var _=require('lodash');var util=require(_0xd96d('0x0'));var moment=require(_0xd96d('0x1'));var BPromise=require(_0xd96d('0x2'));var rs=require(_0xd96d('0x3'));var fs=require('fs');var Redis=require(_0xd96d('0x4'));var db=require(_0xd96d('0x5'))['db'];var utils=require(_0xd96d('0x6'));var logger=require(_0xd96d('0x7'))(_0xd96d('0x8'));var config=require(_0xd96d('0x9'));var jayson=require(_0xd96d('0xa'));var client=jayson['client'][_0xd96d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x171dbb,_0x24797d,_0x9dc2cf){return new BPromise(function(_0x589d82,_0x10c2eb){return client[_0xd96d('0xc')](_0x171dbb,_0x9dc2cf)['then'](function(_0x2db341){logger['info']('CmCustomField,\x20%s,\x20%s',_0x24797d,_0xd96d('0xd'));logger[_0xd96d('0xe')](_0xd96d('0xf'),_0x24797d,_0xd96d('0xd'),JSON[_0xd96d('0x10')](_0x2db341));if(_0x2db341['error']){if(_0x2db341[_0xd96d('0x11')][_0xd96d('0x12')]===0x1f4){logger[_0xd96d('0x11')](_0xd96d('0x13'),_0x24797d,_0x2db341[_0xd96d('0x11')][_0xd96d('0x14')]);return _0x10c2eb(_0x2db341[_0xd96d('0x11')]['message']);}logger['error'](_0xd96d('0x13'),_0x24797d,_0x2db341['error'][_0xd96d('0x14')]);return _0x589d82(_0x2db341['error'][_0xd96d('0x14')]);}else{logger[_0xd96d('0x15')]('CmCustomField,\x20%s,\x20%s',_0x24797d,_0xd96d('0xd'));_0x589d82(_0x2db341['result'][_0xd96d('0x14')]);}})[_0xd96d('0x16')](function(_0x18aa97){logger[_0xd96d('0x11')]('CmCustomField,\x20%s,\x20%s',_0x24797d,_0x18aa97);_0x10c2eb(_0x18aa97);});});} \ No newline at end of file diff --git a/server/api/cmCustomField/index.js b/server/api/cmCustomField/index.js index 9b2a2fd..c2c25bb 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 _0x35f5=['exports','multer','path','connect-timeout','express','Router','../../config/environment','./cmCustomField.controller','isAuthenticated','get','/:id','show','create','put','update','delete','destroy'];(function(_0x22a6c4,_0x5423b3){var _0x2680f5=function(_0x4a6fd2){while(--_0x4a6fd2){_0x22a6c4['push'](_0x22a6c4['shift']());}};_0x2680f5(++_0x5423b3);}(_0x35f5,0x100));var _0x535f=function(_0x54defc,_0x627178){_0x54defc=_0x54defc-0x0;var _0x1955d3=_0x35f5[_0x54defc];return _0x1955d3;};'use strict';var multer=require(_0x535f('0x0'));var util=require('util');var path=require(_0x535f('0x1'));var timeout=require(_0x535f('0x2'));var express=require(_0x535f('0x3'));var router=express[_0x535f('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x535f('0x5'));var controller=require(_0x535f('0x6'));router['get']('/',auth[_0x535f('0x7')](),controller['index']);router[_0x535f('0x8')](_0x535f('0x9'),auth['isAuthenticated'](),controller[_0x535f('0xa')]);router['post']('/',auth[_0x535f('0x7')](),controller[_0x535f('0xb')]);router[_0x535f('0xc')](_0x535f('0x9'),auth[_0x535f('0x7')](),controller[_0x535f('0xd')]);router[_0x535f('0xe')](_0x535f('0x9'),auth['isAuthenticated'](),controller[_0x535f('0xf')]);module[_0x535f('0x10')]=router; \ No newline at end of file +var _0xb1fc=['util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCustomField.controller','isAuthenticated','index','get','/:id','show','post','put','delete','destroy','exports','multer'];(function(_0x5a57ba,_0x1bc048){var _0x8cbb2c=function(_0x2af8c8){while(--_0x2af8c8){_0x5a57ba['push'](_0x5a57ba['shift']());}};_0x8cbb2c(++_0x1bc048);}(_0xb1fc,0xb3));var _0xcb1f=function(_0x13ea8b,_0x7afd99){_0x13ea8b=_0x13ea8b-0x0;var _0x433130=_0xb1fc[_0x13ea8b];return _0x433130;};'use strict';var multer=require(_0xcb1f('0x0'));var util=require(_0xcb1f('0x1'));var path=require('path');var timeout=require(_0xcb1f('0x2'));var express=require(_0xcb1f('0x3'));var router=express[_0xcb1f('0x4')]();var fs_extra=require(_0xcb1f('0x5'));var auth=require(_0xcb1f('0x6'));var interaction=require(_0xcb1f('0x7'));var config=require(_0xcb1f('0x8'));var controller=require(_0xcb1f('0x9'));router['get']('/',auth[_0xcb1f('0xa')](),controller[_0xcb1f('0xb')]);router[_0xcb1f('0xc')](_0xcb1f('0xd'),auth[_0xcb1f('0xa')](),controller[_0xcb1f('0xe')]);router[_0xcb1f('0xf')]('/',auth[_0xcb1f('0xa')](),controller['create']);router[_0xcb1f('0x10')]('/:id',auth[_0xcb1f('0xa')](),controller['update']);router[_0xcb1f('0x11')](_0xcb1f('0xd'),auth[_0xcb1f('0xa')](),controller[_0xcb1f('0x12')]);module[_0xcb1f('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 4e491d0..538b838 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 _0x0b5e=['STRING','DATE','format','INTEGER','BOOLEAN','UNSIGNED','contactListQueue','moment','exports'];(function(_0x544010,_0x94a6ce){var _0x15443a=function(_0x316c19){while(--_0x316c19){_0x544010['push'](_0x544010['shift']());}};_0x15443a(++_0x94a6ce);}(_0x0b5e,0xdf));var _0xe0b5=function(_0x58802d,_0x361d45){_0x58802d=_0x58802d-0x0;var _0x35f30f=_0x0b5e[_0x58802d];return _0x35f30f;};'use strict';var moment=require(_0xe0b5('0x0'));var Sequelize=require('sequelize');module[_0xe0b5('0x1')]={'phone':{'type':Sequelize[_0xe0b5('0x2')],'allowNull':![]},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0xe0b5('0x3')],'defaultValue':moment()[_0xe0b5('0x4')]('YYYY-MM-DD\x20HH:mm:ss')},'countbusyretry':{'type':Sequelize[_0xe0b5('0x5')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xe0b5('0x5')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xe0b5('0x5')],'defaultValue':0x0},'callback':{'type':Sequelize[_0xe0b5('0x6')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xe0b5('0x2')],'defaultValue':null},'callbackat':{'type':Sequelize[_0xe0b5('0x3')]},'priority':{'type':Sequelize['INTEGER'](0x2)[_0xe0b5('0x7')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0xe0b5('0x6')],'defaultValue':![]},'ContactId':{'type':Sequelize['INTEGER'],'unique':_0xe0b5('0x8')},'ListId':{'type':Sequelize[_0xe0b5('0x5')],'unique':_0xe0b5('0x8')},'UserId':{'type':Sequelize[_0xe0b5('0x5')]},'VoiceQueueId':{'type':Sequelize[_0xe0b5('0x5')],'unique':_0xe0b5('0x8')},'CampaignId':{'type':Sequelize['INTEGER']},'countnosuchnumberretry':{'type':Sequelize[_0xe0b5('0x5')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xe0b5('0x5')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xe0b5('0x5')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xe0b5('0x5')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xe0b5('0x5')],'defaultValue':0x0}}; \ No newline at end of file +var _0x2d8d=['moment','exports','BOOLEAN','DATE','INTEGER','STRING','UNSIGNED','contactListQueue'];(function(_0x58464f,_0x4918f7){var _0x1d56e=function(_0x21ebd3){while(--_0x21ebd3){_0x58464f['push'](_0x58464f['shift']());}};_0x1d56e(++_0x4918f7);}(_0x2d8d,0x98));var _0xd2d8=function(_0x3e0b8f,_0x1cddeb){_0x3e0b8f=_0x3e0b8f-0x0;var _0x22f742=_0x2d8d[_0x3e0b8f];return _0x22f742;};'use strict';var moment=require(_0xd2d8('0x0'));var Sequelize=require('sequelize');module[_0xd2d8('0x1')]={'phone':{'type':Sequelize['STRING'],'allowNull':![]},'active':{'type':Sequelize[_0xd2d8('0x2')],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0xd2d8('0x3')],'defaultValue':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')},'countbusyretry':{'type':Sequelize[_0xd2d8('0x4')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xd2d8('0x4')],'defaultValue':0x0},'callback':{'type':Sequelize[_0xd2d8('0x2')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xd2d8('0x5')],'defaultValue':null},'callbackat':{'type':Sequelize[_0xd2d8('0x3')]},'priority':{'type':Sequelize[_0xd2d8('0x4')](0x2)[_0xd2d8('0x6')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0xd2d8('0x2')],'defaultValue':![]},'ContactId':{'type':Sequelize[_0xd2d8('0x4')],'unique':_0xd2d8('0x7')},'ListId':{'type':Sequelize[_0xd2d8('0x4')],'unique':_0xd2d8('0x7')},'UserId':{'type':Sequelize[_0xd2d8('0x4')]},'VoiceQueueId':{'type':Sequelize[_0xd2d8('0x4')],'unique':_0xd2d8('0x7')},'CampaignId':{'type':Sequelize['INTEGER']},'countnosuchnumberretry':{'type':Sequelize[_0xd2d8('0x4')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xd2d8('0x4')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xd2d8('0x4')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xd2d8('0x4')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xd2d8('0x4')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.controller.js b/server/api/cmHopper/cmHopper.controller.js index 1a2d49c..d9149ce 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 _0x5ed1=['CampaignId','VoiceQueueId','VoiceQueue','Campaign','omit','dataValues','state','statedesc','deleted','campaign','membername','user','deletedat','format','YYYY-MM-DD\x20HH:mm:ss','calleridnum','phone','campaigntype','queue','CmContact','lastName','isNil','firstName','calleridname','getPreview','outbound','transaction','direction','prev','isEmpty','hopperIds','ASC','DESC','sequelize','literal','COALESCE(CmHopper.UserId,\x200)\x20ASC','priority','scheduledAt','dialOrderByScheduledAt','COALESCE(CmHopper.UserId,\x200)\x20DESC','findOne','scheduledat','LOCK','UPDATE','Contact','CmCompany','Company','CmList','List','Queue','dialActive','preview','isNumber','CmHopper,\x20%s,\x20%s,\x20%s','getOpenContacts','entity\x20not\x20found','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','ejs','squel','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','offset','limit','count','set','apply','save','update','then','destroy','end','error','stack','index','map','CmHopper','rawAttributes','fieldName','model','name','query','keys','filters','concat','$and','$or','$gte','$lt','$ne','$eq','$not','$in','$like','$notLike','$notILike','$contains','intersection','fields','attributes','nolimit','order','sort','where','pick','filter','type','VIRTUAL','merge','includeAll','findAll','rows','catch','show','length','options','create','body','find','params','describe'];(function(_0x269ff5,_0x3b4514){var _0x16b4b4=function(_0x2c6dd7){while(--_0x2c6dd7){_0x269ff5['push'](_0x269ff5['shift']());}};_0x16b4b4(++_0x3b4514);}(_0x5ed1,0x154));var _0x15ed=function(_0x5bfa44,_0x76dacc){_0x5bfa44=_0x5bfa44-0x0;var _0x43815f=_0x5ed1[_0x5bfa44];return _0x43815f;};'use strict';var emlformat=require(_0x15ed('0x0'));var rimraf=require(_0x15ed('0x1'));var zipdir=require(_0x15ed('0x2'));var jsonpatch=require(_0x15ed('0x3'));var rp=require(_0x15ed('0x4'));var moment=require(_0x15ed('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x15ed('0x6'));var util=require('util');var path=require(_0x15ed('0x7'));var sox=require(_0x15ed('0x8'));var csv=require('to-csv');var ejs=require(_0x15ed('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x15ed('0xa'));var crypto=require('crypto');var jsforce=require(_0x15ed('0xb'));var deskjs=require(_0x15ed('0xc'));var toCsv=require(_0x15ed('0xd'));var querystring=require('querystring');var Papa=require(_0x15ed('0xe'));var Redis=require(_0x15ed('0xf'));var authService=require(_0x15ed('0x10'));var qs=require(_0x15ed('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x15ed('0x12'));var logger=require(_0x15ed('0x13'))(_0x15ed('0x14'));var utils=require(_0x15ed('0x15'));var config=require(_0x15ed('0x16'));var licenseUtil=require(_0x15ed('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3e0a8d,_0x2a4327){_0x2a4327=_0x2a4327||0xcc;return function(_0x5b7506){if(_0x5b7506){return _0x3e0a8d[_0x15ed('0x18')](_0x2a4327);}return _0x3e0a8d[_0x15ed('0x19')](_0x2a4327)['end']();};}function respondWithResult(_0xbe0502,_0x287f07){_0x287f07=_0x287f07||0xc8;return function(_0x4f0581){if(_0x4f0581){return _0xbe0502[_0x15ed('0x19')](_0x287f07)[_0x15ed('0x1a')](_0x4f0581);}};}function respondWithFilteredResult(_0x4413cd,_0x4e48ba){return function(_0x20a1bb){if(_0x20a1bb){var _0x55f85c=typeof _0x4e48ba[_0x15ed('0x1b')]==='undefined'&&typeof _0x4e48ba[_0x15ed('0x1c')]==='undefined';var _0x3dd9b5=_0x20a1bb[_0x15ed('0x1d')];var _0x204570=_0x55f85c?0x0:_0x4e48ba[_0x15ed('0x1b')];var _0x30c28d=_0x55f85c?_0x20a1bb[_0x15ed('0x1d')]:_0x4e48ba[_0x15ed('0x1b')]+_0x4e48ba['limit'];var _0x23f970;if(_0x30c28d>=_0x3dd9b5){_0x30c28d=_0x3dd9b5;_0x23f970=0xc8;}else{_0x23f970=0xce;}_0x4413cd[_0x15ed('0x19')](_0x23f970);return _0x4413cd[_0x15ed('0x1e')]('Content-Range',_0x204570+'-'+_0x30c28d+'/'+_0x3dd9b5)[_0x15ed('0x1a')](_0x20a1bb);}return null;};}function patchUpdates(_0x29e443){return function(_0x841a9b){try{jsonpatch[_0x15ed('0x1f')](_0x841a9b,_0x29e443,!![]);}catch(_0x524b7f){return BPromise['reject'](_0x524b7f);}return _0x841a9b[_0x15ed('0x20')]();};}function saveUpdates(_0x34c40a,_0x2dca99){return function(_0x10a916){if(_0x10a916){return _0x10a916[_0x15ed('0x21')](_0x34c40a)[_0x15ed('0x22')](function(_0x228097){return _0x228097;});}return null;};}function removeEntity(_0x2a3494,_0x593bca){return function(_0x2ca734){if(_0x2ca734){return _0x2ca734[_0x15ed('0x23')]()[_0x15ed('0x22')](function(){_0x2a3494[_0x15ed('0x19')](0xcc)[_0x15ed('0x24')]();});}};}function handleEntityNotFound(_0x4f87ce,_0x4be162){return function(_0x3933d3){if(!_0x3933d3){_0x4f87ce['sendStatus'](0x194);}return _0x3933d3;};}function handleError(_0x54a4c4,_0x4a765f){_0x4a765f=_0x4a765f||0x1f4;return function(_0x439725){logger[_0x15ed('0x25')](_0x439725[_0x15ed('0x26')]);if(_0x439725['name']){delete _0x439725['name'];}_0x54a4c4[_0x15ed('0x19')](_0x4a765f)['send'](_0x439725);};}exports[_0x15ed('0x27')]=function(_0x55ab19,_0x5067b2){var _0x318299={},_0x2b9fae={},_0x15d29d={'count':0x0,'rows':[]};var _0x30860d=_[_0x15ed('0x28')](db[_0x15ed('0x29')][_0x15ed('0x2a')],function(_0x61f3a6){return{'name':_0x61f3a6[_0x15ed('0x2b')],'type':_0x61f3a6['type']['key']};});_0x2b9fae[_0x15ed('0x2c')]=_['map'](_0x30860d,_0x15ed('0x2d'));_0x2b9fae[_0x15ed('0x2e')]=_[_0x15ed('0x2f')](_0x55ab19['query']);_0x2b9fae[_0x15ed('0x30')]=_['intersection'](_0x2b9fae['model'],_0x2b9fae[_0x15ed('0x2e')]);_0x2b9fae[_0x15ed('0x30')]=_[_0x15ed('0x31')](_0x2b9fae[_0x15ed('0x30')],[_0x15ed('0x32'),_0x15ed('0x33'),'$gt',_0x15ed('0x34'),_0x15ed('0x35'),'$lte',_0x15ed('0x36'),_0x15ed('0x37'),_0x15ed('0x38'),'$between','$notBetween',_0x15ed('0x39'),'$notIn',_0x15ed('0x3a'),_0x15ed('0x3b'),'$iLike',_0x15ed('0x3c'),_0x15ed('0x3a'),'$overlap',_0x15ed('0x3d'),'$contained','$any']);_0x318299['attributes']=_[_0x15ed('0x3e')](_0x2b9fae[_0x15ed('0x2c')],qs[_0x15ed('0x3f')](_0x55ab19[_0x15ed('0x2e')]['fields']));_0x318299['attributes']=_0x318299['attributes']['length']?_0x318299[_0x15ed('0x40')]:_0x2b9fae['model'];if(!_0x55ab19[_0x15ed('0x2e')]['hasOwnProperty'](_0x15ed('0x41'))){_0x318299[_0x15ed('0x1c')]=qs[_0x15ed('0x1c')](_0x55ab19[_0x15ed('0x2e')][_0x15ed('0x1c')]);_0x318299['offset']=qs['offset'](_0x55ab19[_0x15ed('0x2e')][_0x15ed('0x1b')]);}_0x318299[_0x15ed('0x42')]=qs[_0x15ed('0x43')](_0x55ab19[_0x15ed('0x2e')][_0x15ed('0x43')]);_0x318299[_0x15ed('0x44')]=qs[_0x15ed('0x30')](_[_0x15ed('0x45')](_0x55ab19['query'],_0x2b9fae[_0x15ed('0x30')]),_0x30860d);if(_0x55ab19['query'][_0x15ed('0x46')]){_0x318299[_0x15ed('0x44')]=_['merge'](_0x318299[_0x15ed('0x44')],{'$or':_[_0x15ed('0x28')](_0x30860d,function(_0x230300){if(_0x230300[_0x15ed('0x47')]!==_0x15ed('0x48')){var _0x347a5d={};_0x347a5d[_0x230300['name']]={'$like':'%'+_0x55ab19[_0x15ed('0x2e')]['filter']+'%'};return _0x347a5d;}})});}_0x318299=_[_0x15ed('0x49')]({},_0x318299,_0x55ab19['options']);var _0x512310={'where':_0x318299[_0x15ed('0x44')]};return db[_0x15ed('0x29')][_0x15ed('0x1d')](_0x512310)[_0x15ed('0x22')](function(_0x3fd871){_0x15d29d[_0x15ed('0x1d')]=_0x3fd871;if(_0x55ab19['query'][_0x15ed('0x4a')]){_0x318299['include']=[{'all':!![]}];}return db[_0x15ed('0x29')][_0x15ed('0x4b')](_0x318299);})[_0x15ed('0x22')](function(_0x565e65){_0x15d29d[_0x15ed('0x4c')]=_0x565e65;return _0x15d29d;})[_0x15ed('0x22')](respondWithFilteredResult(_0x5067b2,_0x318299))[_0x15ed('0x4d')](handleError(_0x5067b2,null));};exports[_0x15ed('0x4e')]=function(_0x45b4da,_0x4b99ea){var _0x462a28={'raw':!![],'where':{'id':_0x45b4da['params']['id']}},_0x42c413={};_0x42c413[_0x15ed('0x2c')]=_[_0x15ed('0x2f')](db[_0x15ed('0x29')]['rawAttributes']);_0x42c413['query']=_[_0x15ed('0x2f')](_0x45b4da[_0x15ed('0x2e')]);_0x42c413['filters']=_['intersection'](_0x42c413['model'],_0x42c413[_0x15ed('0x2e')]);_0x462a28['attributes']=_['intersection'](_0x42c413['model'],qs['fields'](_0x45b4da[_0x15ed('0x2e')][_0x15ed('0x3f')]));_0x462a28[_0x15ed('0x40')]=_0x462a28[_0x15ed('0x40')][_0x15ed('0x4f')]?_0x462a28[_0x15ed('0x40')]:_0x42c413[_0x15ed('0x2c')];if(_0x45b4da[_0x15ed('0x2e')][_0x15ed('0x4a')]){_0x462a28['include']=[{'all':!![]}];}_0x462a28=_[_0x15ed('0x49')]({},_0x462a28,_0x45b4da[_0x15ed('0x50')]);return db[_0x15ed('0x29')]['find'](_0x462a28)['then'](handleEntityNotFound(_0x4b99ea,null))[_0x15ed('0x22')](respondWithResult(_0x4b99ea,null))['catch'](handleError(_0x4b99ea,null));};exports[_0x15ed('0x51')]=function(_0x2491a0,_0x259308){return db['CmHopper'][_0x15ed('0x51')](_0x2491a0[_0x15ed('0x52')],{})[_0x15ed('0x22')](respondWithResult(_0x259308,0xc9))['catch'](handleError(_0x259308,null));};exports[_0x15ed('0x21')]=function(_0x156ac8,_0x55d571){if(_0x156ac8[_0x15ed('0x52')]['id']){delete _0x156ac8[_0x15ed('0x52')]['id'];}return db[_0x15ed('0x29')][_0x15ed('0x53')]({'where':{'id':_0x156ac8[_0x15ed('0x54')]['id']}})['then'](handleEntityNotFound(_0x55d571,null))[_0x15ed('0x22')](saveUpdates(_0x156ac8[_0x15ed('0x52')],null))['then'](respondWithResult(_0x55d571,null))['catch'](handleError(_0x55d571,null));};exports['describe']=function(_0x3ddf0,_0x579636){return db[_0x15ed('0x29')][_0x15ed('0x55')]()[_0x15ed('0x22')](respondWithResult(_0x579636,null))[_0x15ed('0x4d')](handleError(_0x579636,null));};exports[_0x15ed('0x23')]=function(_0x324003,_0x4d49bd){var _0x3776f2;return db[_0x15ed('0x29')]['find']({'where':{'id':_0x324003['params']['id']}})[_0x15ed('0x22')](handleEntityNotFound(_0x4d49bd,null))[_0x15ed('0x22')](function(_0x4a3988){if(_0x4a3988){return _0x4a3988[_0x15ed('0x23')]()[_0x15ed('0x22')](function(_0x13f68f){return _0x13f68f;});}})[_0x15ed('0x22')](function(_0x4733d6){_0x3776f2=_0x4733d6;if(_0x4733d6){if(_0x4733d6['VoiceQueueId']||_0x4733d6[_0x15ed('0x56')]){return db[_0x4733d6[_0x15ed('0x57')]?_0x15ed('0x58'):_0x15ed('0x59')][_0x15ed('0x53')]({'where':{'id':_0x4733d6[_0x15ed('0x57')]?_0x4733d6[_0x15ed('0x57')]:_0x4733d6['CampaignId']},'attributes':['id',_0x15ed('0x2d')],'raw':!![]});}}})[_0x15ed('0x22')](function(_0x169313){var _0x1858a1={};if(_0x169313){_[_0x15ed('0x49')](_0x1858a1,_[_0x15ed('0x5a')](_0x3776f2[_0x15ed('0x5b')],['createdAt','updatedAt','id']));_0x1858a1[_0x15ed('0x5c')]=0x15;_0x1858a1[_0x15ed('0x5d')]=_0x15ed('0x5e');_0x1858a1[_0x15ed('0x5f')]=_0x169313[_0x15ed('0x2d')];_0x1858a1[_0x15ed('0x60')]=_0x324003['user']['name'];_0x1858a1['UserId']=_0x324003[_0x15ed('0x61')]['id'];_0x1858a1['deleted']=!![];_0x1858a1[_0x15ed('0x62')]=moment()[_0x15ed('0x63')](_0x15ed('0x64'));_0x1858a1[_0x15ed('0x65')]=_0x3776f2[_0x15ed('0x66')];_0x1858a1[_0x15ed('0x67')]=_0x3776f2[_0x15ed('0x57')]?_0x15ed('0x68'):'ivr';return db[_0x15ed('0x69')]['find']({'where':{'id':_0x1858a1['ContactId']},'attributes':['firstName',_0x15ed('0x6a')]})[_0x15ed('0x22')](function(_0x4b4f8f){if(!_[_0x15ed('0x6b')](_0x4d49bd)&&!_['isNil'](_0x4b4f8f[_0x15ed('0x6c')])){_0x1858a1['calleridname']=_0x4b4f8f[_0x15ed('0x6c')];if(!_[_0x15ed('0x6b')](_0x4b4f8f[_0x15ed('0x6a')])){_0x1858a1[_0x15ed('0x6d')]+='\x20'+_0x4b4f8f[_0x15ed('0x6a')];}}})['finally'](function(){return db['CmHopperFinal'][_0x15ed('0x51')](_0x1858a1);});}})[_0x15ed('0x22')](function(){return _0x4d49bd[_0x15ed('0x19')](0xcc)['end']();})[_0x15ed('0x4d')](handleError(_0x4d49bd,null));};exports[_0x15ed('0x6e')]=function(_0x2a89b2,_0x13902a,_0xb8f881){var _0x389cd1=[];return db[_0x15ed('0x69')]['describe']()['then'](function(_0x29d1d9){_0x389cd1=_['keys'](_0x29d1d9);return _0x2a89b2['user']['getVoiceQueues']({'where':{'type':_0x15ed('0x6f'),'dialActive':!![],'dialMethod':'preview'},'attributes':['id','dialOrderByScheduledAt'],'raw':!![]});})['then'](function(_0x34b6c8){if(_0x34b6c8&&_0x34b6c8[_0x15ed('0x4f')]){return db['sequelize'][_0x15ed('0x70')](function(_0x30b556){var _0x34aa99={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()['format'](_0x15ed('0x64'))},'VoiceQueueId':{'$in':_[_0x15ed('0x28')](_0x34b6c8,'id')},'$or':[{'UserId':null},{'UserId':_0x2a89b2['user']['id']}]};var _0x32b26a=[];if(_0x2a89b2[_0x15ed('0x52')][_0x15ed('0x71')]&&_0x2a89b2[_0x15ed('0x52')][_0x15ed('0x71')]===_0x15ed('0x72')){if(!_[_0x15ed('0x73')](_0x2a89b2[_0x15ed('0x52')][_0x15ed('0x74')])){_0x34aa99['id']={'$in':_0x2a89b2['body'][_0x15ed('0x74')]};}_0x32b26a=[['priority',_0x15ed('0x75')],['scheduledAt',_0x34b6c8[0x0]['dialOrderByScheduledAt']===_0x15ed('0x75')?_0x15ed('0x76'):_0x15ed('0x75')],db[_0x15ed('0x77')][_0x15ed('0x78')](_0x15ed('0x79')),['id',_0x15ed('0x76')]];}else{if(!_['isEmpty'](_0x2a89b2['body'][_0x15ed('0x74')])){_0x34aa99['id']={'$notIn':_0x2a89b2[_0x15ed('0x52')][_0x15ed('0x74')]};}_0x32b26a=[[_0x15ed('0x7a'),_0x15ed('0x76')],[_0x15ed('0x7b'),_0x34b6c8[0x0][_0x15ed('0x7c')]],db[_0x15ed('0x77')][_0x15ed('0x78')](_0x15ed('0x7d')),['id',_0x15ed('0x75')]];}return db[_0x15ed('0x29')][_0x15ed('0x7e')]({'attributes':['id',_0x15ed('0x7f')],'where':_0x34aa99,'order':_0x32b26a,'transaction':_0x30b556,'lock':_0x30b556[_0x15ed('0x80')][_0x15ed('0x81')],'include':[{'model':db[_0x15ed('0x69')],'as':_0x15ed('0x82'),'attributes':_0x389cd1,'include':[{'model':db[_0x15ed('0x83')],'as':_0x15ed('0x84'),'attributes':['id',_0x15ed('0x2d')]}]},{'model':db[_0x15ed('0x85')],'as':_0x15ed('0x86'),'attributes':['id',_0x15ed('0x2d')]},{'model':db[_0x15ed('0x58')],'as':_0x15ed('0x87'),'attributes':['id','name',_0x15ed('0x88')]}]})[_0x15ed('0x22')](function(_0x134a7e){if(_0x134a7e){return _0x134a7e[_0x15ed('0x21')]({'UserId':_0x2a89b2[_0x15ed('0x61')]['id']},{'transaction':_0x30b556});}});});}})['then'](handleEntityNotFound(_0x13902a,null))[_0x15ed('0x22')](respondWithResult(_0x13902a,null))[_0x15ed('0x4d')](handleError(_0x13902a,null));};exports['getOpenContacts']=function(_0x4b551b,_0x2f735d,_0x535f89){return _0x4b551b[_0x15ed('0x61')]['getVoiceQueues']({'where':{'type':_0x15ed('0x6f'),'dialActive':!![],'dialMethod':_0x15ed('0x89')},'attributes':['id'],'raw':!![]})[_0x15ed('0x22')](function(_0x2a107d){if(_0x2a107d&&_0x2a107d[_0x15ed('0x4f')]){return db['CmHopper'][_0x15ed('0x1d')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()['format'](_0x15ed('0x64'))},'VoiceQueueId':{'$in':_[_0x15ed('0x28')](_0x2a107d,'id')},'$or':[{'UserId':null},{'UserId':_0x4b551b[_0x15ed('0x61')]['id']}]}});}return 0x0;})[_0x15ed('0x22')](function(_0x2de98a){if(!_[_0x15ed('0x6b')](_0x2de98a)&&_[_0x15ed('0x8a')](_0x2de98a)){return _0x2f735d['status'](0xc8)[_0x15ed('0x1a')]({'contacts':_0x2de98a});}else{logger['error'](_0x15ed('0x8b'),_0x15ed('0x8c'),0x194,_0x15ed('0x8d'));_0x2f735d[_0x15ed('0x18')](0x194);}})[_0x15ed('0x4d')](handleError(_0x2f735d,null));}; \ No newline at end of file +var _0xa6b8=['catch','describe','VoiceQueueId','CampaignId','VoiceQueue','Campaign','omit','dataValues','createdAt','updatedAt','state','campaign','membername','user','UserId','deleted','deletedat','format','YYYY-MM-DD\x20HH:mm:ss','calleridnum','campaigntype','queue','ivr','CmContact','ContactId','firstName','lastName','isNil','calleridname','finally','CmHopperFinal','getPreview','getVoiceQueues','outbound','preview','dialOrderByScheduledAt','sequelize','transaction','direction','prev','isEmpty','hopperIds','ASC','scheduledAt','literal','COALESCE(CmHopper.UserId,\x200)\x20ASC','DESC','priority','COALESCE(CmHopper.UserId,\x200)\x20DESC','findOne','scheduledat','LOCK','Contact','CmCompany','Company','CmList','List','Queue','dialActive','getOpenContacts','CmHopper,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','save','update','then','destroy','error','stack','name','send','map','CmHopper','rawAttributes','fieldName','model','query','keys','filters','concat','$and','$or','$gt','$gte','$lt','$lte','$ne','$eq','$not','$in','$notIn','$like','$notLike','$iLike','$overlap','$contained','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','type','VIRTUAL','merge','include','rows','params','includeAll','find','create','body'];(function(_0x9dfc10,_0x19c2d5){var _0x4f938a=function(_0x12b1e5){while(--_0x12b1e5){_0x9dfc10['push'](_0x9dfc10['shift']());}};_0x4f938a(++_0x19c2d5);}(_0xa6b8,0xd4));var _0x8a6b=function(_0x5ec580,_0x47e231){_0x5ec580=_0x5ec580-0x0;var _0x24c941=_0xa6b8[_0x5ec580];return _0x24c941;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8a6b('0x0'));var zipdir=require(_0x8a6b('0x1'));var jsonpatch=require(_0x8a6b('0x2'));var rp=require('request-promise');var moment=require(_0x8a6b('0x3'));var BPromise=require(_0x8a6b('0x4'));var Mustache=require(_0x8a6b('0x5'));var util=require(_0x8a6b('0x6'));var path=require(_0x8a6b('0x7'));var sox=require(_0x8a6b('0x8'));var csv=require(_0x8a6b('0x9'));var ejs=require(_0x8a6b('0xa'));var fs=require('fs');var fs_extra=require(_0x8a6b('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x8a6b('0xc'));var jsforce=require(_0x8a6b('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x8a6b('0x9'));var querystring=require(_0x8a6b('0xe'));var Papa=require('papaparse');var Redis=require(_0x8a6b('0xf'));var authService=require(_0x8a6b('0x10'));var qs=require(_0x8a6b('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8a6b('0x12'));var logger=require(_0x8a6b('0x13'))(_0x8a6b('0x14'));var utils=require(_0x8a6b('0x15'));var config=require(_0x8a6b('0x16'));var licenseUtil=require(_0x8a6b('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x58da05,_0xe02334){_0xe02334=_0xe02334||0xcc;return function(_0x332a79){if(_0x332a79){return _0x58da05[_0x8a6b('0x18')](_0xe02334);}return _0x58da05[_0x8a6b('0x19')](_0xe02334)[_0x8a6b('0x1a')]();};}function respondWithResult(_0x39a88a,_0x3f8606){_0x3f8606=_0x3f8606||0xc8;return function(_0x13e791){if(_0x13e791){return _0x39a88a[_0x8a6b('0x19')](_0x3f8606)['json'](_0x13e791);}};}function respondWithFilteredResult(_0x100471,_0xf2112d){return function(_0x402ce7){if(_0x402ce7){var _0x3b573e=typeof _0xf2112d[_0x8a6b('0x1b')]===_0x8a6b('0x1c')&&typeof _0xf2112d[_0x8a6b('0x1d')]===_0x8a6b('0x1c');var _0x4ade95=_0x402ce7[_0x8a6b('0x1e')];var _0x2631a4=_0x3b573e?0x0:_0xf2112d['offset'];var _0x26e942=_0x3b573e?_0x402ce7['count']:_0xf2112d[_0x8a6b('0x1b')]+_0xf2112d['limit'];var _0x20b84a;if(_0x26e942>=_0x4ade95){_0x26e942=_0x4ade95;_0x20b84a=0xc8;}else{_0x20b84a=0xce;}_0x100471[_0x8a6b('0x19')](_0x20b84a);return _0x100471[_0x8a6b('0x1f')](_0x8a6b('0x20'),_0x2631a4+'-'+_0x26e942+'/'+_0x4ade95)[_0x8a6b('0x21')](_0x402ce7);}return null;};}function patchUpdates(_0x39e82e){return function(_0xc6ee43){try{jsonpatch[_0x8a6b('0x22')](_0xc6ee43,_0x39e82e,!![]);}catch(_0x3ece83){return BPromise['reject'](_0x3ece83);}return _0xc6ee43[_0x8a6b('0x23')]();};}function saveUpdates(_0x3f8ca8,_0x558292){return function(_0x594ca0){if(_0x594ca0){return _0x594ca0[_0x8a6b('0x24')](_0x3f8ca8)[_0x8a6b('0x25')](function(_0x4045ad){return _0x4045ad;});}return null;};}function removeEntity(_0x5e4051,_0x4b8487){return function(_0x4dbb49){if(_0x4dbb49){return _0x4dbb49[_0x8a6b('0x26')]()[_0x8a6b('0x25')](function(){_0x5e4051[_0x8a6b('0x19')](0xcc)[_0x8a6b('0x1a')]();});}};}function handleEntityNotFound(_0x4accb9,_0x1d7179){return function(_0x3a0838){if(!_0x3a0838){_0x4accb9[_0x8a6b('0x18')](0x194);}return _0x3a0838;};}function handleError(_0x5ea19a,_0x204468){_0x204468=_0x204468||0x1f4;return function(_0x45bba6){logger[_0x8a6b('0x27')](_0x45bba6[_0x8a6b('0x28')]);if(_0x45bba6[_0x8a6b('0x29')]){delete _0x45bba6[_0x8a6b('0x29')];}_0x5ea19a[_0x8a6b('0x19')](_0x204468)[_0x8a6b('0x2a')](_0x45bba6);};}exports['index']=function(_0x24fa54,_0x28ca11){var _0x2e02de={},_0x1f72ef={},_0x15c0dd={'count':0x0,'rows':[]};var _0x548e3e=_[_0x8a6b('0x2b')](db[_0x8a6b('0x2c')][_0x8a6b('0x2d')],function(_0x3512cf){return{'name':_0x3512cf[_0x8a6b('0x2e')],'type':_0x3512cf['type']['key']};});_0x1f72ef[_0x8a6b('0x2f')]=_[_0x8a6b('0x2b')](_0x548e3e,'name');_0x1f72ef[_0x8a6b('0x30')]=_[_0x8a6b('0x31')](_0x24fa54['query']);_0x1f72ef[_0x8a6b('0x32')]=_['intersection'](_0x1f72ef[_0x8a6b('0x2f')],_0x1f72ef[_0x8a6b('0x30')]);_0x1f72ef[_0x8a6b('0x32')]=_[_0x8a6b('0x33')](_0x1f72ef[_0x8a6b('0x32')],[_0x8a6b('0x34'),_0x8a6b('0x35'),_0x8a6b('0x36'),_0x8a6b('0x37'),_0x8a6b('0x38'),_0x8a6b('0x39'),_0x8a6b('0x3a'),_0x8a6b('0x3b'),_0x8a6b('0x3c'),'$between','$notBetween',_0x8a6b('0x3d'),_0x8a6b('0x3e'),_0x8a6b('0x3f'),_0x8a6b('0x40'),_0x8a6b('0x41'),'$notILike',_0x8a6b('0x3f'),_0x8a6b('0x42'),'$contains',_0x8a6b('0x43'),'$any']);_0x2e02de[_0x8a6b('0x44')]=_[_0x8a6b('0x45')](_0x1f72ef[_0x8a6b('0x2f')],qs[_0x8a6b('0x46')](_0x24fa54[_0x8a6b('0x30')]['fields']));_0x2e02de[_0x8a6b('0x44')]=_0x2e02de['attributes'][_0x8a6b('0x47')]?_0x2e02de[_0x8a6b('0x44')]:_0x1f72ef[_0x8a6b('0x2f')];if(!_0x24fa54[_0x8a6b('0x30')][_0x8a6b('0x48')](_0x8a6b('0x49'))){_0x2e02de[_0x8a6b('0x1d')]=qs[_0x8a6b('0x1d')](_0x24fa54[_0x8a6b('0x30')][_0x8a6b('0x1d')]);_0x2e02de[_0x8a6b('0x1b')]=qs['offset'](_0x24fa54['query'][_0x8a6b('0x1b')]);}_0x2e02de['order']=qs[_0x8a6b('0x4a')](_0x24fa54[_0x8a6b('0x30')][_0x8a6b('0x4a')]);_0x2e02de[_0x8a6b('0x4b')]=qs['filters'](_[_0x8a6b('0x4c')](_0x24fa54['query'],_0x1f72ef[_0x8a6b('0x32')]),_0x548e3e);if(_0x24fa54[_0x8a6b('0x30')][_0x8a6b('0x4d')]){_0x2e02de[_0x8a6b('0x4b')]=_['merge'](_0x2e02de['where'],{'$or':_[_0x8a6b('0x2b')](_0x548e3e,function(_0x113bc7){if(_0x113bc7[_0x8a6b('0x4e')]!==_0x8a6b('0x4f')){var _0x33f8ef={};_0x33f8ef[_0x113bc7[_0x8a6b('0x29')]]={'$like':'%'+_0x24fa54[_0x8a6b('0x30')][_0x8a6b('0x4d')]+'%'};return _0x33f8ef;}})});}_0x2e02de=_[_0x8a6b('0x50')]({},_0x2e02de,_0x24fa54['options']);var _0x1ce28b={'where':_0x2e02de[_0x8a6b('0x4b')]};return db[_0x8a6b('0x2c')]['count'](_0x1ce28b)['then'](function(_0x1f3fc7){_0x15c0dd[_0x8a6b('0x1e')]=_0x1f3fc7;if(_0x24fa54[_0x8a6b('0x30')]['includeAll']){_0x2e02de[_0x8a6b('0x51')]=[{'all':!![]}];}return db[_0x8a6b('0x2c')]['findAll'](_0x2e02de);})[_0x8a6b('0x25')](function(_0x30f71b){_0x15c0dd[_0x8a6b('0x52')]=_0x30f71b;return _0x15c0dd;})[_0x8a6b('0x25')](respondWithFilteredResult(_0x28ca11,_0x2e02de))['catch'](handleError(_0x28ca11,null));};exports['show']=function(_0x12be27,_0x4f290d){var _0x10e0d2={'raw':!![],'where':{'id':_0x12be27[_0x8a6b('0x53')]['id']}},_0x513ec5={};_0x513ec5[_0x8a6b('0x2f')]=_[_0x8a6b('0x31')](db['CmHopper']['rawAttributes']);_0x513ec5[_0x8a6b('0x30')]=_[_0x8a6b('0x31')](_0x12be27[_0x8a6b('0x30')]);_0x513ec5[_0x8a6b('0x32')]=_[_0x8a6b('0x45')](_0x513ec5[_0x8a6b('0x2f')],_0x513ec5[_0x8a6b('0x30')]);_0x10e0d2[_0x8a6b('0x44')]=_['intersection'](_0x513ec5[_0x8a6b('0x2f')],qs[_0x8a6b('0x46')](_0x12be27['query'][_0x8a6b('0x46')]));_0x10e0d2[_0x8a6b('0x44')]=_0x10e0d2['attributes']['length']?_0x10e0d2[_0x8a6b('0x44')]:_0x513ec5['model'];if(_0x12be27[_0x8a6b('0x30')][_0x8a6b('0x54')]){_0x10e0d2[_0x8a6b('0x51')]=[{'all':!![]}];}_0x10e0d2=_[_0x8a6b('0x50')]({},_0x10e0d2,_0x12be27['options']);return db['CmHopper'][_0x8a6b('0x55')](_0x10e0d2)[_0x8a6b('0x25')](handleEntityNotFound(_0x4f290d,null))[_0x8a6b('0x25')](respondWithResult(_0x4f290d,null))['catch'](handleError(_0x4f290d,null));};exports[_0x8a6b('0x56')]=function(_0x17c8ea,_0x263f44){return db[_0x8a6b('0x2c')]['create'](_0x17c8ea[_0x8a6b('0x57')],{})[_0x8a6b('0x25')](respondWithResult(_0x263f44,0xc9))['catch'](handleError(_0x263f44,null));};exports[_0x8a6b('0x24')]=function(_0x523853,_0x1f1d77){if(_0x523853[_0x8a6b('0x57')]['id']){delete _0x523853[_0x8a6b('0x57')]['id'];}return db[_0x8a6b('0x2c')][_0x8a6b('0x55')]({'where':{'id':_0x523853[_0x8a6b('0x53')]['id']}})[_0x8a6b('0x25')](handleEntityNotFound(_0x1f1d77,null))['then'](saveUpdates(_0x523853[_0x8a6b('0x57')],null))[_0x8a6b('0x25')](respondWithResult(_0x1f1d77,null))[_0x8a6b('0x58')](handleError(_0x1f1d77,null));};exports[_0x8a6b('0x59')]=function(_0x531897,_0x5256fc){return db['CmHopper'][_0x8a6b('0x59')]()[_0x8a6b('0x25')](respondWithResult(_0x5256fc,null))[_0x8a6b('0x58')](handleError(_0x5256fc,null));};exports[_0x8a6b('0x26')]=function(_0x2a8418,_0x313f4b){var _0x19d3f3;return db[_0x8a6b('0x2c')][_0x8a6b('0x55')]({'where':{'id':_0x2a8418[_0x8a6b('0x53')]['id']}})[_0x8a6b('0x25')](handleEntityNotFound(_0x313f4b,null))[_0x8a6b('0x25')](function(_0x2aa564){if(_0x2aa564){return _0x2aa564[_0x8a6b('0x26')]()[_0x8a6b('0x25')](function(_0x168040){return _0x168040;});}})[_0x8a6b('0x25')](function(_0x6b0594){_0x19d3f3=_0x6b0594;if(_0x6b0594){if(_0x6b0594[_0x8a6b('0x5a')]||_0x6b0594[_0x8a6b('0x5b')]){return db[_0x6b0594[_0x8a6b('0x5a')]?_0x8a6b('0x5c'):_0x8a6b('0x5d')][_0x8a6b('0x55')]({'where':{'id':_0x6b0594[_0x8a6b('0x5a')]?_0x6b0594[_0x8a6b('0x5a')]:_0x6b0594[_0x8a6b('0x5b')]},'attributes':['id','name'],'raw':!![]});}}})[_0x8a6b('0x25')](function(_0x49bfdc){var _0x8dd026={};if(_0x49bfdc){_['merge'](_0x8dd026,_[_0x8a6b('0x5e')](_0x19d3f3[_0x8a6b('0x5f')],[_0x8a6b('0x60'),_0x8a6b('0x61'),'id']));_0x8dd026[_0x8a6b('0x62')]=0x15;_0x8dd026['statedesc']='deleted';_0x8dd026[_0x8a6b('0x63')]=_0x49bfdc[_0x8a6b('0x29')];_0x8dd026[_0x8a6b('0x64')]=_0x2a8418[_0x8a6b('0x65')][_0x8a6b('0x29')];_0x8dd026[_0x8a6b('0x66')]=_0x2a8418['user']['id'];_0x8dd026[_0x8a6b('0x67')]=!![];_0x8dd026[_0x8a6b('0x68')]=moment()[_0x8a6b('0x69')](_0x8a6b('0x6a'));_0x8dd026[_0x8a6b('0x6b')]=_0x19d3f3['phone'];_0x8dd026[_0x8a6b('0x6c')]=_0x19d3f3['VoiceQueueId']?_0x8a6b('0x6d'):_0x8a6b('0x6e');return db[_0x8a6b('0x6f')][_0x8a6b('0x55')]({'where':{'id':_0x8dd026[_0x8a6b('0x70')]},'attributes':[_0x8a6b('0x71'),_0x8a6b('0x72')]})['then'](function(_0x3ee623){if(!_['isNil'](_0x313f4b)&&!_[_0x8a6b('0x73')](_0x3ee623[_0x8a6b('0x71')])){_0x8dd026[_0x8a6b('0x74')]=_0x3ee623['firstName'];if(!_['isNil'](_0x3ee623['lastName'])){_0x8dd026[_0x8a6b('0x74')]+='\x20'+_0x3ee623[_0x8a6b('0x72')];}}})[_0x8a6b('0x75')](function(){return db[_0x8a6b('0x76')][_0x8a6b('0x56')](_0x8dd026);});}})['then'](function(){return _0x313f4b[_0x8a6b('0x19')](0xcc)[_0x8a6b('0x1a')]();})[_0x8a6b('0x58')](handleError(_0x313f4b,null));};exports[_0x8a6b('0x77')]=function(_0x1e7d39,_0x48756b,_0x3f67f5){var _0x352c16=[];return db[_0x8a6b('0x6f')][_0x8a6b('0x59')]()[_0x8a6b('0x25')](function(_0x55afe6){_0x352c16=_['keys'](_0x55afe6);return _0x1e7d39[_0x8a6b('0x65')][_0x8a6b('0x78')]({'where':{'type':_0x8a6b('0x79'),'dialActive':!![],'dialMethod':_0x8a6b('0x7a')},'attributes':['id',_0x8a6b('0x7b')],'raw':!![]});})[_0x8a6b('0x25')](function(_0x1c256c){if(_0x1c256c&&_0x1c256c[_0x8a6b('0x47')]){return db[_0x8a6b('0x7c')][_0x8a6b('0x7d')](function(_0x301ba4){var _0x1a71f2={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x8a6b('0x69')](_0x8a6b('0x6a'))},'VoiceQueueId':{'$in':_[_0x8a6b('0x2b')](_0x1c256c,'id')},'$or':[{'UserId':null},{'UserId':_0x1e7d39[_0x8a6b('0x65')]['id']}]};var _0x4f7132=[];if(_0x1e7d39[_0x8a6b('0x57')][_0x8a6b('0x7e')]&&_0x1e7d39[_0x8a6b('0x57')][_0x8a6b('0x7e')]===_0x8a6b('0x7f')){if(!_[_0x8a6b('0x80')](_0x1e7d39[_0x8a6b('0x57')][_0x8a6b('0x81')])){_0x1a71f2['id']={'$in':_0x1e7d39[_0x8a6b('0x57')][_0x8a6b('0x81')]};}_0x4f7132=[['priority',_0x8a6b('0x82')],[_0x8a6b('0x83'),_0x1c256c[0x0]['dialOrderByScheduledAt']==='ASC'?'DESC':_0x8a6b('0x82')],db['sequelize'][_0x8a6b('0x84')](_0x8a6b('0x85')),['id',_0x8a6b('0x86')]];}else{if(!_['isEmpty'](_0x1e7d39[_0x8a6b('0x57')][_0x8a6b('0x81')])){_0x1a71f2['id']={'$notIn':_0x1e7d39['body'][_0x8a6b('0x81')]};}_0x4f7132=[[_0x8a6b('0x87'),'DESC'],[_0x8a6b('0x83'),_0x1c256c[0x0][_0x8a6b('0x7b')]],db[_0x8a6b('0x7c')][_0x8a6b('0x84')](_0x8a6b('0x88')),['id',_0x8a6b('0x82')]];}return db['CmHopper'][_0x8a6b('0x89')]({'attributes':['id',_0x8a6b('0x8a')],'where':_0x1a71f2,'order':_0x4f7132,'transaction':_0x301ba4,'lock':_0x301ba4[_0x8a6b('0x8b')]['UPDATE'],'include':[{'model':db[_0x8a6b('0x6f')],'as':_0x8a6b('0x8c'),'attributes':_0x352c16,'include':[{'model':db[_0x8a6b('0x8d')],'as':_0x8a6b('0x8e'),'attributes':['id',_0x8a6b('0x29')]}]},{'model':db[_0x8a6b('0x8f')],'as':_0x8a6b('0x90'),'attributes':['id',_0x8a6b('0x29')]},{'model':db[_0x8a6b('0x5c')],'as':_0x8a6b('0x91'),'attributes':['id',_0x8a6b('0x29'),_0x8a6b('0x92')]}]})['then'](function(_0x16912b){if(_0x16912b){return _0x16912b[_0x8a6b('0x24')]({'UserId':_0x1e7d39[_0x8a6b('0x65')]['id']},{'transaction':_0x301ba4});}});});}})[_0x8a6b('0x25')](handleEntityNotFound(_0x48756b,null))[_0x8a6b('0x25')](respondWithResult(_0x48756b,null))[_0x8a6b('0x58')](handleError(_0x48756b,null));};exports[_0x8a6b('0x93')]=function(_0x518364,_0x50fcb1,_0x6a333){return _0x518364['user'][_0x8a6b('0x78')]({'where':{'type':'outbound','dialActive':!![],'dialMethod':_0x8a6b('0x7a')},'attributes':['id'],'raw':!![]})[_0x8a6b('0x25')](function(_0x34ff62){if(_0x34ff62&&_0x34ff62['length']){return db[_0x8a6b('0x2c')][_0x8a6b('0x1e')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x8a6b('0x69')]('YYYY-MM-DD\x20HH:mm:ss')},'VoiceQueueId':{'$in':_[_0x8a6b('0x2b')](_0x34ff62,'id')},'$or':[{'UserId':null},{'UserId':_0x518364[_0x8a6b('0x65')]['id']}]}});}return 0x0;})[_0x8a6b('0x25')](function(_0xe0578d){if(!_[_0x8a6b('0x73')](_0xe0578d)&&_['isNumber'](_0xe0578d)){return _0x50fcb1[_0x8a6b('0x19')](0xc8)[_0x8a6b('0x21')]({'contacts':_0xe0578d});}else{logger[_0x8a6b('0x27')](_0x8a6b('0x94'),_0x8a6b('0x93'),0x194,_0x8a6b('0x95'));_0x50fcb1[_0x8a6b('0x18')](0x194);}})['catch'](handleError(_0x50fcb1,null));}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.model.js b/server/api/cmHopper/cmHopper.model.js index a141b11..05c63e7 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 _0x187d=['moment','bluebird','request-promise','path','../../config/environment','./cmHopper.attributes','define','CmHopper','cm_hopper','scheduledat','phone','priority','lodash','../../config/logger','api'];(function(_0x37843a,_0xdfe28d){var _0x4e7142=function(_0x498fb9){while(--_0x498fb9){_0x37843a['push'](_0x37843a['shift']());}};_0x4e7142(++_0xdfe28d);}(_0x187d,0x93));var _0xd187=function(_0x9aada2,_0xd2d349){_0x9aada2=_0x9aada2-0x0;var _0x196dff=_0x187d[_0x9aada2];return _0x196dff;};'use strict';var _=require(_0xd187('0x0'));var util=require('util');var logger=require(_0xd187('0x1'))(_0xd187('0x2'));var moment=require(_0xd187('0x3'));var BPromise=require(_0xd187('0x4'));var rp=require(_0xd187('0x5'));var fs=require('fs');var path=require(_0xd187('0x6'));var rimraf=require('rimraf');var config=require(_0xd187('0x7'));var attributes=require(_0xd187('0x8'));module['exports']=function(_0x1d2533,_0x58ee7){return _0x1d2533[_0xd187('0x9')](_0xd187('0xa'),attributes,{'tableName':_0xd187('0xb'),'paranoid':![],'indexes':[{'name':_0xd187('0xc'),'fields':[_0xd187('0xc')]},{'name':_0xd187('0xd'),'fields':['phone']},{'name':_0xd187('0xe'),'fields':[_0xd187('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xd117=['bluebird','request-promise','path','rimraf','../../config/environment','./cmHopper.attributes','exports','define','CmHopper','scheduledat','phone','priority','lodash','util','../../config/logger','api','moment'];(function(_0x2f3848,_0x48564d){var _0x102668=function(_0x5e32ab){while(--_0x5e32ab){_0x2f3848['push'](_0x2f3848['shift']());}};_0x102668(++_0x48564d);}(_0xd117,0x182));var _0x7d11=function(_0x1b8bda,_0x43ad31){_0x1b8bda=_0x1b8bda-0x0;var _0x1f7050=_0xd117[_0x1b8bda];return _0x1f7050;};'use strict';var _=require(_0x7d11('0x0'));var util=require(_0x7d11('0x1'));var logger=require(_0x7d11('0x2'))(_0x7d11('0x3'));var moment=require(_0x7d11('0x4'));var BPromise=require(_0x7d11('0x5'));var rp=require(_0x7d11('0x6'));var fs=require('fs');var path=require(_0x7d11('0x7'));var rimraf=require(_0x7d11('0x8'));var config=require(_0x7d11('0x9'));var attributes=require(_0x7d11('0xa'));module[_0x7d11('0xb')]=function(_0x27d7e8,_0x40c3c4){return _0x27d7e8[_0x7d11('0xc')](_0x7d11('0xd'),attributes,{'tableName':'cm_hopper','paranoid':![],'indexes':[{'name':_0x7d11('0xe'),'fields':[_0x7d11('0xe')]},{'name':_0x7d11('0xf'),'fields':['phone']},{'name':_0x7d11('0x10'),'fields':[_0x7d11('0x10')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.rpc.js b/server/api/cmHopper/cmHopper.rpc.js index fb39a1a..a248b34 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 _0x824c=['push','update','all','MoveContactManagedDialer','CmHopperFinal','destroy','literal','format','YYYY-MM-DD\x20HH:mm:ss','\x20,\x201,\x20null','contactsRescheduled','CountReScheduled','GetContactRecallMe','length','GetCmHopperPreview','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','jayson/promise','http','request','then','info','debug','stringify','error','message','CmHopper,\x20%s,\x20%s','result','catch','CmHopper','findAll','options','raw','where','attributes','limit','map','include','model','GetCmHopper','ShowCmHopper','find','CreateCmHopper','body','UpdateCmHopper','DestroyCmHopper','GetContactDialer','CmContact','describe','sequelize','transaction','order','LOCK','UPDATE','User','name','voicePause','UserId'];(function(_0x45783c,_0x49c56d){var _0x1161da=function(_0x3c5d41){while(--_0x3c5d41){_0x45783c['push'](_0x45783c['shift']());}};_0x1161da(++_0x49c56d);}(_0x824c,0x8b));var _0xc824=function(_0x2cb530,_0x2810fe){_0x2cb530=_0x2cb530-0x0;var _0x2b66a3=_0x824c[_0x2cb530];return _0x2b66a3;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xc824('0x0'));var BPromise=require(_0xc824('0x1'));var rs=require(_0xc824('0x2'));var fs=require('fs');var Redis=require(_0xc824('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xc824('0x4'));var logger=require('../../config/logger')(_0xc824('0x5'));var config=require('../../config/environment');var jayson=require(_0xc824('0x6'));var client=jayson['client'][_0xc824('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x76c500,_0x33bd29,_0xf10554){return new BPromise(function(_0xe1309f,_0x1a570f){return client[_0xc824('0x8')](_0x76c500,_0xf10554)[_0xc824('0x9')](function(_0x30fb4b){logger[_0xc824('0xa')]('CmHopper,\x20%s,\x20%s',_0x33bd29,'request\x20sent');logger[_0xc824('0xb')]('CmHopper,\x20%s,\x20%s,\x20%s',_0x33bd29,'request\x20sent',JSON[_0xc824('0xc')](_0x30fb4b));if(_0x30fb4b['error']){if(_0x30fb4b[_0xc824('0xd')]['code']===0x1f4){logger[_0xc824('0xd')]('CmHopper,\x20%s,\x20%s',_0x33bd29,_0x30fb4b[_0xc824('0xd')][_0xc824('0xe')]);return _0x1a570f(_0x30fb4b['error'][_0xc824('0xe')]);}logger['error'](_0xc824('0xf'),_0x33bd29,_0x30fb4b[_0xc824('0xd')]['message']);return _0xe1309f(_0x30fb4b['error'][_0xc824('0xe')]);}else{logger['info'](_0xc824('0xf'),_0x33bd29,'request\x20sent');_0xe1309f(_0x30fb4b[_0xc824('0x10')][_0xc824('0xe')]);}})[_0xc824('0x11')](function(_0x2a9b0d){logger[_0xc824('0xd')](_0xc824('0xf'),_0x33bd29,_0x2a9b0d);_0x1a570f(_0x2a9b0d);});});}exports['GetCmHopper']=function(_0x36d7e5){var _0x5d9433=this;return new Promise(function(_0x413347,_0x44482e){return db[_0xc824('0x12')][_0xc824('0x13')]({'raw':_0x36d7e5[_0xc824('0x14')]?_0x36d7e5[_0xc824('0x14')][_0xc824('0x15')]===undefined?!![]:![]:!![],'where':_0x36d7e5[_0xc824('0x14')]?_0x36d7e5[_0xc824('0x14')][_0xc824('0x16')]||null:null,'attributes':_0x36d7e5[_0xc824('0x14')]?_0x36d7e5['options'][_0xc824('0x17')]||null:null,'limit':_0x36d7e5[_0xc824('0x14')]?_0x36d7e5[_0xc824('0x14')][_0xc824('0x18')]||null:null,'include':_0x36d7e5[_0xc824('0x14')]?_0x36d7e5[_0xc824('0x14')]['include']?_[_0xc824('0x19')](_0x36d7e5[_0xc824('0x14')][_0xc824('0x1a')],function(_0x41e3dd){return{'model':db[_0x41e3dd[_0xc824('0x1b')]],'as':_0x41e3dd['as'],'attributes':_0x41e3dd[_0xc824('0x17')],'include':_0x41e3dd[_0xc824('0x1a')]?_['map'](_0x41e3dd['include'],function(_0x306f30){return{'model':db[_0x306f30['model']],'as':_0x306f30['as'],'attributes':_0x306f30['attributes'],'include':_0x306f30[_0xc824('0x1a')]?_[_0xc824('0x19')](_0x306f30[_0xc824('0x1a')],function(_0x4189c4){return{'model':db[_0x4189c4['model']],'as':_0x4189c4['as'],'attributes':_0x4189c4[_0xc824('0x17')]};}):[]};}):[]};}):[]:[]})[_0xc824('0x9')](function(_0x43c873){logger['info'](_0xc824('0x1c'),_0x36d7e5);logger[_0xc824('0xb')]('GetCmHopper',_0x36d7e5,JSON[_0xc824('0xc')](_0x43c873));_0x413347(_0x43c873);})['catch'](function(_0x320d63){logger[_0xc824('0xd')]('GetCmHopper',_0x320d63[_0xc824('0xe')],_0x36d7e5);_0x44482e(_0x5d9433['error'](0x1f4,_0x320d63[_0xc824('0xe')]));});});};exports[_0xc824('0x1d')]=function(_0x57f184){var _0x47e6f5=this;return new Promise(function(_0x49a752,_0x412d0f){return db[_0xc824('0x12')][_0xc824('0x1e')]({'raw':_0x57f184['options']?_0x57f184[_0xc824('0x14')][_0xc824('0x15')]===undefined?!![]:![]:!![],'where':_0x57f184[_0xc824('0x14')]?_0x57f184[_0xc824('0x14')][_0xc824('0x16')]||null:null,'attributes':_0x57f184[_0xc824('0x14')]?_0x57f184[_0xc824('0x14')][_0xc824('0x17')]||null:null,'include':_0x57f184['options']?_0x57f184[_0xc824('0x14')][_0xc824('0x1a')]?_[_0xc824('0x19')](_0x57f184['options']['include'],function(_0x4b302a){return{'model':db[_0x4b302a[_0xc824('0x1b')]],'as':_0x4b302a['as'],'attributes':_0x4b302a['attributes'],'include':_0x4b302a[_0xc824('0x1a')]?_['map'](_0x4b302a['include'],function(_0x9b6d8a){return{'model':db[_0x9b6d8a['model']],'as':_0x9b6d8a['as'],'attributes':_0x9b6d8a['attributes'],'include':_0x9b6d8a[_0xc824('0x1a')]?_[_0xc824('0x19')](_0x9b6d8a[_0xc824('0x1a')],function(_0x1b83e6){return{'model':db[_0x1b83e6[_0xc824('0x1b')]],'as':_0x1b83e6['as'],'attributes':_0x1b83e6[_0xc824('0x17')]};}):[]};}):[]};}):[]:[]})[_0xc824('0x9')](function(_0x476d3d){logger['info'](_0xc824('0x1d'),_0x57f184);logger[_0xc824('0xb')](_0xc824('0x1d'),_0x57f184,JSON['stringify'](_0x476d3d));_0x49a752(_0x476d3d);})[_0xc824('0x11')](function(_0x107ff8){logger['error'](_0xc824('0x1d'),_0x107ff8['message'],_0x57f184);_0x412d0f(_0x47e6f5[_0xc824('0xd')](0x1f4,_0x107ff8[_0xc824('0xe')]));});});};exports[_0xc824('0x1f')]=function(_0x3d16b6){var _0x31b6e7=this;return new Promise(function(_0xb7f1f0,_0x26d63a){return db[_0xc824('0x12')]['create'](_0x3d16b6[_0xc824('0x20')],{'raw':_0x3d16b6[_0xc824('0x14')]?_0x3d16b6[_0xc824('0x14')][_0xc824('0x15')]===undefined?!![]:![]:!![]})['then'](function(_0x41b5f6){logger[_0xc824('0xa')](_0xc824('0x1f'),_0x3d16b6);logger[_0xc824('0xb')](_0xc824('0x1f'),_0x3d16b6,JSON[_0xc824('0xc')](_0x41b5f6));_0xb7f1f0(_0x41b5f6);})['catch'](function(_0xc46ce2){logger[_0xc824('0xd')](_0xc824('0x1f'),_0xc46ce2[_0xc824('0xe')],_0x3d16b6);_0x26d63a(_0x31b6e7[_0xc824('0xd')](0x1f4,_0xc46ce2[_0xc824('0xe')]));});});};exports[_0xc824('0x21')]=function(_0x558b1d){var _0x4bb678=this;return new Promise(function(_0xdeefa2,_0x34b255){return db[_0xc824('0x12')]['update'](_0x558b1d[_0xc824('0x20')],{'raw':_0x558b1d[_0xc824('0x14')]?_0x558b1d[_0xc824('0x14')][_0xc824('0x15')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x558b1d[_0xc824('0x14')]?_0x558b1d[_0xc824('0x14')][_0xc824('0x16')]||null:null,'attributes':_0x558b1d[_0xc824('0x14')]?_0x558b1d['options'][_0xc824('0x17')]||null:null,'limit':_0x558b1d[_0xc824('0x14')]?_0x558b1d['options'][_0xc824('0x18')]||null:null})[_0xc824('0x9')](function(_0x15485b){logger['info'](_0xc824('0x21'),_0x558b1d);logger[_0xc824('0xb')]('UpdateCmHopper',_0x558b1d,JSON[_0xc824('0xc')](_0x15485b));_0xdeefa2(_0x15485b);})['catch'](function(_0x18a438){logger['error'](_0xc824('0x21'),_0x18a438[_0xc824('0xe')],_0x558b1d);_0x34b255(_0x4bb678[_0xc824('0xd')](0x1f4,_0x18a438['message']));});});};exports[_0xc824('0x22')]=function(_0xc7647d){var _0x4c213e=this;return new Promise(function(_0x27d242,_0x369131){return db[_0xc824('0x12')]['destroy']({'where':_0xc7647d[_0xc824('0x14')]?_0xc7647d[_0xc824('0x14')][_0xc824('0x16')]||null:null})['then'](function(_0x1a64a2){logger[_0xc824('0xa')]('DestroyCmHopper',_0xc7647d);logger[_0xc824('0xb')](_0xc824('0x22'),_0xc7647d,JSON[_0xc824('0xc')](_0x1a64a2));_0x27d242(_0x1a64a2);})[_0xc824('0x11')](function(_0x1dab2a){logger[_0xc824('0xd')](_0xc824('0x22'),_0x1dab2a[_0xc824('0xe')],_0xc7647d);_0x369131(_0x4c213e['error'](0x1f4,_0x1dab2a[_0xc824('0xe')]));});});};exports[_0xc824('0x23')]=function(_0x5c608c){var _0x3ceaf7=this;return new Promise(function(_0x403921,_0x2e2b32){return db[_0xc824('0x24')][_0xc824('0x25')]()['then'](function(_0xa011aa){return db[_0xc824('0x26')][_0xc824('0x27')](function(_0x4998f3){return db['CmHopper'][_0xc824('0x13')]({'where':_0x5c608c['options']?_0x5c608c[_0xc824('0x14')][_0xc824('0x16')]||null:null,'attributes':_0x5c608c[_0xc824('0x14')]?_0x5c608c['options'][_0xc824('0x17')]||null:null,'limit':_0x5c608c[_0xc824('0x14')]?_0x5c608c[_0xc824('0x14')][_0xc824('0x18')]||null:null,'order':_0x5c608c[_0xc824('0x14')]?_0x5c608c['options'][_0xc824('0x28')]||null:null,'transaction':_0x4998f3,'lock':_0x4998f3[_0xc824('0x29')][_0xc824('0x2a')],'include':[{'model':db[_0xc824('0x24')],'as':'Contact','attributes':_['keys'](_0xa011aa)},{'model':db[_0xc824('0x2b')],'as':'Agent','attributes':['id',_0xc824('0x2c'),_0xc824('0x2d')]}]})[_0xc824('0x9')](function(_0x31bb53){var _0x5bed71=[];var _0x19e11f=[];for(var _0x28abcb=0x0;_0x28abcb<_0x31bb53['length'];_0x28abcb+=0x1){var _0x2b4909=_0x31bb53[_0x28abcb][_0xc824('0x2e')];if(_0x2b4909===null){_0x5bed71[_0xc824('0x2f')](_0x31bb53[_0x28abcb][_0xc824('0x30')](_0x5c608c[_0xc824('0x20')],{'transaction':_0x4998f3}));}else if(!_0x19e11f['includes'](_0x2b4909)){_0x19e11f[_0xc824('0x2f')](_0x2b4909);_0x5bed71[_0xc824('0x2f')](_0x31bb53[_0x28abcb][_0xc824('0x30')](_0x5c608c[_0xc824('0x20')],{'transaction':_0x4998f3}));}}return BPromise[_0xc824('0x31')](_0x5bed71);});})[_0xc824('0x9')](function(_0xc2767e){logger[_0xc824('0xa')]('GetContactDialer',_0x5c608c);logger[_0xc824('0xb')](_0xc824('0x23'),_0x5c608c,JSON[_0xc824('0xc')](_0xc2767e));_0x403921(_0xc2767e);})[_0xc824('0x11')](function(_0x26425c){logger[_0xc824('0xd')]('GetContactDialer',_0x26425c[_0xc824('0xe')],_0x5c608c);_0x2e2b32(_0x3ceaf7[_0xc824('0xd')](0x1f4,_0x26425c[_0xc824('0xe')]));});});});};exports[_0xc824('0x32')]=function(_0x4d7e96){var _0xc1f2df=this;return new Promise(function(_0x37cf94,_0x201fc1){return db[_0xc824('0x26')][_0xc824('0x27')](function(_0x1dc697){return db[_0xc824('0x33')]['create'](_0x4d7e96['body'],{'raw':_0x4d7e96[_0xc824('0x14')]?_0x4d7e96['options'][_0xc824('0x15')]===undefined?!![]:![]:!![],'transaction':_0x1dc697})[_0xc824('0x9')](function(){return db[_0xc824('0x12')][_0xc824('0x34')]({'where':_0x4d7e96[_0xc824('0x14')]?_0x4d7e96[_0xc824('0x14')][_0xc824('0x16')]||null:null,'transaction':_0x1dc697});});})[_0xc824('0x9')](function(_0x38f4b4){logger[_0xc824('0xa')](_0xc824('0x32'),_0x4d7e96);logger['debug']('MoveContactManagedDialer',_0x4d7e96,JSON[_0xc824('0xc')](_0x38f4b4));_0x37cf94(_0x38f4b4);})[_0xc824('0x11')](function(_0x3398cf){logger[_0xc824('0xd')](_0xc824('0x32'),_0x3398cf[_0xc824('0xe')],_0x4d7e96);_0x201fc1(_0xc1f2df[_0xc824('0xd')](0x1f4,_0x3398cf[_0xc824('0xe')]));});});};exports['CountReScheduled']=function(_0x49ddd7){var _0x3e78af=this;return new Promise(function(_0x523d7b,_0xad25e9){return db[_0xc824('0x12')][_0xc824('0x13')]({'raw':_0x49ddd7['options']?_0x49ddd7[_0xc824('0x14')][_0xc824('0x15')]===undefined?!![]:![]:!![],'where':_0x49ddd7['options']?_0x49ddd7[_0xc824('0x14')][_0xc824('0x16')]||null:null,'attributes':[[db['sequelize']['fn']('COUNT',db['sequelize']['fn']('IF',db[_0xc824('0x26')][_0xc824('0x35')]('`scheduledat`\x20>=\x20'+util[_0xc824('0x36')]('\x22%s\x22',moment()[_0xc824('0x36')](_0xc824('0x37')))+_0xc824('0x38')))),_0xc824('0x39')]]})[_0xc824('0x9')](function(_0x2c8afe){logger[_0xc824('0xa')](_0xc824('0x3a'),_0x49ddd7);logger[_0xc824('0xb')](_0xc824('0x3a'),_0x49ddd7,JSON[_0xc824('0xc')](_0x2c8afe));_0x523d7b(_0x2c8afe);})[_0xc824('0x11')](function(_0x4b0038){logger[_0xc824('0xd')](_0xc824('0x3a'),_0x4b0038[_0xc824('0xe')],_0x49ddd7);_0xad25e9(_0x3e78af[_0xc824('0xd')](0x1f4,_0x4b0038[_0xc824('0xe')]));});});};exports[_0xc824('0x3b')]=function(_0x3688b4){var _0x8073d0=this;return new Promise(function(_0x3c1eb2,_0x241950){return db[_0xc824('0x24')][_0xc824('0x25')]()[_0xc824('0x9')](function(_0x12cbed){return db['sequelize']['transaction'](function(_0x518a1e){return db[_0xc824('0x12')][_0xc824('0x13')]({'where':_0x3688b4[_0xc824('0x14')]?_0x3688b4[_0xc824('0x14')]['where']||null:null,'attributes':_0x3688b4[_0xc824('0x14')]?_0x3688b4[_0xc824('0x14')][_0xc824('0x17')]||null:null,'limit':0x1,'order':_0x3688b4[_0xc824('0x14')]?_0x3688b4[_0xc824('0x14')][_0xc824('0x28')]||null:null,'group':db[_0xc824('0x12')][_0xc824('0x2e')],'transaction':_0x518a1e,'lock':_0x518a1e[_0xc824('0x29')][_0xc824('0x2a')],'include':_0x3688b4[_0xc824('0x14')]?_0x3688b4['options'][_0xc824('0x1a')]?_[_0xc824('0x19')](_0x3688b4[_0xc824('0x14')][_0xc824('0x1a')],function(_0x3cd2af){return{'model':db[_0x3cd2af[_0xc824('0x1b')]],'as':_0x3cd2af['as'],'attributes':_0x3cd2af[_0xc824('0x17')],'include':_0x3cd2af[_0xc824('0x1a')]?_[_0xc824('0x19')](_0x3cd2af[_0xc824('0x1a')],function(_0x2e860a){return{'model':db[_0x2e860a['model']],'as':_0x2e860a['as'],'attributes':_0x2e860a[_0xc824('0x17')],'include':_0x2e860a['include']?_['map'](_0x2e860a['include'],function(_0x4b87a7){return{'model':db[_0x4b87a7['model']],'as':_0x4b87a7['as'],'attributes':_0x4b87a7[_0xc824('0x17')]};}):[]};}):[]};}):[]:[]})[_0xc824('0x9')](function(_0x307568){var _0x2096d9=[];for(var _0x754745=0x0;_0x754745<_0x307568[_0xc824('0x3c')];_0x754745+=0x1){_0x2096d9[_0xc824('0x2f')](_0x307568[_0x754745][_0xc824('0x30')](_0x3688b4[_0xc824('0x20')],{'transaction':_0x518a1e}));}return BPromise[_0xc824('0x31')](_0x2096d9);});})[_0xc824('0x9')](function(_0x3247b9){logger['info']('GetContactRecallMe',_0x3688b4);logger[_0xc824('0xb')](_0xc824('0x3b'),_0x3688b4,JSON['stringify'](_0x3247b9));_0x3c1eb2(_0x3247b9);})[_0xc824('0x11')](function(_0x45ef19){logger['error'](_0xc824('0x3b'),_0x45ef19[_0xc824('0xe')],_0x3688b4);_0x241950(_0x8073d0[_0xc824('0xd')](0x1f4,_0x45ef19[_0xc824('0xe')]));});});});};exports[_0xc824('0x3d')]=function(_0x1a02b3){var _0x1f9b3f=this;return new Promise(function(_0x4e65e0,_0x51c165){db[_0xc824('0x24')][_0xc824('0x25')]()[_0xc824('0x9')](function(_0x3f49f3){return db[_0xc824('0x12')]['findAll']({'raw':_0x1a02b3['options']?_0x1a02b3[_0xc824('0x14')][_0xc824('0x15')]===undefined?!![]:![]:!![],'where':_0x1a02b3[_0xc824('0x14')]?_0x1a02b3[_0xc824('0x14')][_0xc824('0x16')]||null:null,'attributes':_0x1a02b3[_0xc824('0x14')]?_0x1a02b3[_0xc824('0x14')]['attributes']||null:null,'limit':_0x1a02b3['options']?_0x1a02b3[_0xc824('0x14')][_0xc824('0x18')]||null:null,'include':_0x1a02b3[_0xc824('0x14')]?_0x1a02b3['options'][_0xc824('0x1a')]?_['map'](_0x1a02b3[_0xc824('0x14')][_0xc824('0x1a')],function(_0x177991){return{'model':db[_0x177991[_0xc824('0x1b')]],'as':_0x177991['as'],'attributes':_0x177991['as']==='Contact'?_['keys'](_0x3f49f3):_0x177991[_0xc824('0x17')],'include':_0x177991[_0xc824('0x1a')]?_[_0xc824('0x19')](_0x177991[_0xc824('0x1a')],function(_0xfd6eb5){return{'model':db[_0xfd6eb5[_0xc824('0x1b')]],'as':_0xfd6eb5['as'],'attributes':_0xfd6eb5[_0xc824('0x17')],'include':_0xfd6eb5['include']?_[_0xc824('0x19')](_0xfd6eb5[_0xc824('0x1a')],function(_0x4c3e5f){return{'model':db[_0x4c3e5f[_0xc824('0x1b')]],'as':_0x4c3e5f['as'],'attributes':_0x4c3e5f['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x18d562){logger[_0xc824('0xa')]('GetCmHopper',_0x1a02b3);logger[_0xc824('0xb')]('GetCmHopper',_0x1a02b3,JSON[_0xc824('0xc')](_0x18d562));_0x4e65e0(_0x18d562);})[_0xc824('0x11')](function(_0x1d4b87){logger[_0xc824('0xd')](_0xc824('0x1c'),_0x1d4b87[_0xc824('0xe')],_0x1a02b3);_0x51c165(_0x1f9b3f[_0xc824('0xd')](0x1f4,_0x1d4b87[_0xc824('0xe')]));});});});}; \ No newline at end of file +var _0xfdaf=['CmHopper,\x20%s,\x20%s','message','result','catch','GetCmHopper','CmHopper','findAll','options','raw','where','attributes','limit','include','map','model','ShowCmHopper','find','CreateCmHopper','create','body','UpdateCmHopper','DestroyCmHopper','destroy','GetContactDialer','CmContact','describe','transaction','LOCK','UPDATE','Contact','keys','User','Agent','name','length','UserId','update','includes','push','all','sequelize','CmHopperFinal','MoveContactManagedDialer','CountReScheduled','literal','`scheduledat`\x20>=\x20','format','\x22%s\x22','YYYY-MM-DD\x20HH:mm:ss','\x20,\x201,\x20null','contactsRescheduled','order','GetContactRecallMe','GetCmHopperPreview','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','info','request\x20sent','debug','CmHopper,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0xe52bd,_0x43345a){var _0x18daa5=function(_0x101b8e){while(--_0x101b8e){_0xe52bd['push'](_0xe52bd['shift']());}};_0x18daa5(++_0x43345a);}(_0xfdaf,0x1ec));var _0xffda=function(_0x48eea1,_0x4498d8){_0x48eea1=_0x48eea1-0x0;var _0x1e6a8b=_0xfdaf[_0x48eea1];return _0x1e6a8b;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xffda('0x0'));var BPromise=require(_0xffda('0x1'));var rs=require(_0xffda('0x2'));var fs=require('fs');var Redis=require(_0xffda('0x3'));var db=require(_0xffda('0x4'))['db'];var utils=require(_0xffda('0x5'));var logger=require(_0xffda('0x6'))(_0xffda('0x7'));var config=require('../../config/environment');var jayson=require(_0xffda('0x8'));var client=jayson[_0xffda('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x14f9e8,_0x440654,_0x58e86e){return new BPromise(function(_0x2bb7ab,_0x315e9a){return client[_0xffda('0xa')](_0x14f9e8,_0x58e86e)[_0xffda('0xb')](function(_0x10782e){logger[_0xffda('0xc')]('CmHopper,\x20%s,\x20%s',_0x440654,_0xffda('0xd'));logger[_0xffda('0xe')](_0xffda('0xf'),_0x440654,_0xffda('0xd'),JSON[_0xffda('0x10')](_0x10782e));if(_0x10782e['error']){if(_0x10782e[_0xffda('0x11')][_0xffda('0x12')]===0x1f4){logger[_0xffda('0x11')](_0xffda('0x13'),_0x440654,_0x10782e[_0xffda('0x11')][_0xffda('0x14')]);return _0x315e9a(_0x10782e[_0xffda('0x11')][_0xffda('0x14')]);}logger[_0xffda('0x11')](_0xffda('0x13'),_0x440654,_0x10782e[_0xffda('0x11')][_0xffda('0x14')]);return _0x2bb7ab(_0x10782e[_0xffda('0x11')][_0xffda('0x14')]);}else{logger[_0xffda('0xc')](_0xffda('0x13'),_0x440654,_0xffda('0xd'));_0x2bb7ab(_0x10782e[_0xffda('0x15')][_0xffda('0x14')]);}})[_0xffda('0x16')](function(_0x350208){logger[_0xffda('0x11')](_0xffda('0x13'),_0x440654,_0x350208);_0x315e9a(_0x350208);});});}exports[_0xffda('0x17')]=function(_0x26859d){var _0x15b044=this;return new Promise(function(_0xc5a046,_0x5ef6e3){return db[_0xffda('0x18')][_0xffda('0x19')]({'raw':_0x26859d[_0xffda('0x1a')]?_0x26859d[_0xffda('0x1a')][_0xffda('0x1b')]===undefined?!![]:![]:!![],'where':_0x26859d[_0xffda('0x1a')]?_0x26859d[_0xffda('0x1a')][_0xffda('0x1c')]||null:null,'attributes':_0x26859d[_0xffda('0x1a')]?_0x26859d[_0xffda('0x1a')][_0xffda('0x1d')]||null:null,'limit':_0x26859d[_0xffda('0x1a')]?_0x26859d[_0xffda('0x1a')][_0xffda('0x1e')]||null:null,'include':_0x26859d[_0xffda('0x1a')]?_0x26859d[_0xffda('0x1a')][_0xffda('0x1f')]?_[_0xffda('0x20')](_0x26859d[_0xffda('0x1a')][_0xffda('0x1f')],function(_0x59d1f3){return{'model':db[_0x59d1f3[_0xffda('0x21')]],'as':_0x59d1f3['as'],'attributes':_0x59d1f3[_0xffda('0x1d')],'include':_0x59d1f3[_0xffda('0x1f')]?_[_0xffda('0x20')](_0x59d1f3[_0xffda('0x1f')],function(_0x5e46dc){return{'model':db[_0x5e46dc[_0xffda('0x21')]],'as':_0x5e46dc['as'],'attributes':_0x5e46dc[_0xffda('0x1d')],'include':_0x5e46dc[_0xffda('0x1f')]?_[_0xffda('0x20')](_0x5e46dc[_0xffda('0x1f')],function(_0x36eeea){return{'model':db[_0x36eeea[_0xffda('0x21')]],'as':_0x36eeea['as'],'attributes':_0x36eeea['attributes']};}):[]};}):[]};}):[]:[]})[_0xffda('0xb')](function(_0x5c965d){logger[_0xffda('0xc')]('GetCmHopper',_0x26859d);logger['debug'](_0xffda('0x17'),_0x26859d,JSON[_0xffda('0x10')](_0x5c965d));_0xc5a046(_0x5c965d);})[_0xffda('0x16')](function(_0x2731a1){logger[_0xffda('0x11')](_0xffda('0x17'),_0x2731a1['message'],_0x26859d);_0x5ef6e3(_0x15b044[_0xffda('0x11')](0x1f4,_0x2731a1['message']));});});};exports[_0xffda('0x22')]=function(_0x1f77fc){var _0x10d2c7=this;return new Promise(function(_0x15d71e,_0x523da7){return db[_0xffda('0x18')][_0xffda('0x23')]({'raw':_0x1f77fc['options']?_0x1f77fc[_0xffda('0x1a')][_0xffda('0x1b')]===undefined?!![]:![]:!![],'where':_0x1f77fc[_0xffda('0x1a')]?_0x1f77fc[_0xffda('0x1a')][_0xffda('0x1c')]||null:null,'attributes':_0x1f77fc[_0xffda('0x1a')]?_0x1f77fc[_0xffda('0x1a')][_0xffda('0x1d')]||null:null,'include':_0x1f77fc['options']?_0x1f77fc[_0xffda('0x1a')][_0xffda('0x1f')]?_['map'](_0x1f77fc['options'][_0xffda('0x1f')],function(_0x1c9828){return{'model':db[_0x1c9828[_0xffda('0x21')]],'as':_0x1c9828['as'],'attributes':_0x1c9828[_0xffda('0x1d')],'include':_0x1c9828[_0xffda('0x1f')]?_[_0xffda('0x20')](_0x1c9828[_0xffda('0x1f')],function(_0x5e2123){return{'model':db[_0x5e2123[_0xffda('0x21')]],'as':_0x5e2123['as'],'attributes':_0x5e2123['attributes'],'include':_0x5e2123[_0xffda('0x1f')]?_[_0xffda('0x20')](_0x5e2123['include'],function(_0x3b4049){return{'model':db[_0x3b4049[_0xffda('0x21')]],'as':_0x3b4049['as'],'attributes':_0x3b4049['attributes']};}):[]};}):[]};}):[]:[]})[_0xffda('0xb')](function(_0x5e9cf5){logger[_0xffda('0xc')](_0xffda('0x22'),_0x1f77fc);logger[_0xffda('0xe')](_0xffda('0x22'),_0x1f77fc,JSON[_0xffda('0x10')](_0x5e9cf5));_0x15d71e(_0x5e9cf5);})[_0xffda('0x16')](function(_0x3e2e77){logger[_0xffda('0x11')](_0xffda('0x22'),_0x3e2e77[_0xffda('0x14')],_0x1f77fc);_0x523da7(_0x10d2c7[_0xffda('0x11')](0x1f4,_0x3e2e77['message']));});});};exports[_0xffda('0x24')]=function(_0x3128f8){var _0xb9e9b4=this;return new Promise(function(_0x3301e8,_0x362534){return db[_0xffda('0x18')][_0xffda('0x25')](_0x3128f8[_0xffda('0x26')],{'raw':_0x3128f8['options']?_0x3128f8['options'][_0xffda('0x1b')]===undefined?!![]:![]:!![]})[_0xffda('0xb')](function(_0x1ed117){logger[_0xffda('0xc')](_0xffda('0x24'),_0x3128f8);logger[_0xffda('0xe')]('CreateCmHopper',_0x3128f8,JSON['stringify'](_0x1ed117));_0x3301e8(_0x1ed117);})[_0xffda('0x16')](function(_0x476e11){logger[_0xffda('0x11')](_0xffda('0x24'),_0x476e11['message'],_0x3128f8);_0x362534(_0xb9e9b4['error'](0x1f4,_0x476e11['message']));});});};exports[_0xffda('0x27')]=function(_0x534464){var _0x21fdd8=this;return new Promise(function(_0x6a6d29,_0x327717){return db[_0xffda('0x18')]['update'](_0x534464[_0xffda('0x26')],{'raw':_0x534464[_0xffda('0x1a')]?_0x534464[_0xffda('0x1a')][_0xffda('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x534464[_0xffda('0x1a')]?_0x534464[_0xffda('0x1a')][_0xffda('0x1c')]||null:null,'attributes':_0x534464['options']?_0x534464[_0xffda('0x1a')][_0xffda('0x1d')]||null:null,'limit':_0x534464['options']?_0x534464[_0xffda('0x1a')][_0xffda('0x1e')]||null:null})[_0xffda('0xb')](function(_0x19b853){logger[_0xffda('0xc')]('UpdateCmHopper',_0x534464);logger[_0xffda('0xe')](_0xffda('0x27'),_0x534464,JSON[_0xffda('0x10')](_0x19b853));_0x6a6d29(_0x19b853);})[_0xffda('0x16')](function(_0x4488d9){logger[_0xffda('0x11')](_0xffda('0x27'),_0x4488d9[_0xffda('0x14')],_0x534464);_0x327717(_0x21fdd8[_0xffda('0x11')](0x1f4,_0x4488d9[_0xffda('0x14')]));});});};exports[_0xffda('0x28')]=function(_0x4df318){var _0x28ac5d=this;return new Promise(function(_0x17103b,_0x889af1){return db['CmHopper'][_0xffda('0x29')]({'where':_0x4df318[_0xffda('0x1a')]?_0x4df318[_0xffda('0x1a')]['where']||null:null})[_0xffda('0xb')](function(_0x579f76){logger[_0xffda('0xc')](_0xffda('0x28'),_0x4df318);logger[_0xffda('0xe')](_0xffda('0x28'),_0x4df318,JSON['stringify'](_0x579f76));_0x17103b(_0x579f76);})[_0xffda('0x16')](function(_0x404c45){logger['error'](_0xffda('0x28'),_0x404c45[_0xffda('0x14')],_0x4df318);_0x889af1(_0x28ac5d['error'](0x1f4,_0x404c45['message']));});});};exports[_0xffda('0x2a')]=function(_0x49dd2a){var _0x573d19=this;return new Promise(function(_0x3f5153,_0x41fd0f){return db[_0xffda('0x2b')][_0xffda('0x2c')]()[_0xffda('0xb')](function(_0x19e778){return db['sequelize'][_0xffda('0x2d')](function(_0xf2330){return db['CmHopper'][_0xffda('0x19')]({'where':_0x49dd2a[_0xffda('0x1a')]?_0x49dd2a[_0xffda('0x1a')]['where']||null:null,'attributes':_0x49dd2a[_0xffda('0x1a')]?_0x49dd2a['options'][_0xffda('0x1d')]||null:null,'limit':_0x49dd2a['options']?_0x49dd2a[_0xffda('0x1a')]['limit']||null:null,'order':_0x49dd2a['options']?_0x49dd2a[_0xffda('0x1a')]['order']||null:null,'transaction':_0xf2330,'lock':_0xf2330[_0xffda('0x2e')][_0xffda('0x2f')],'include':[{'model':db[_0xffda('0x2b')],'as':_0xffda('0x30'),'attributes':_[_0xffda('0x31')](_0x19e778)},{'model':db[_0xffda('0x32')],'as':_0xffda('0x33'),'attributes':['id',_0xffda('0x34'),'voicePause']}]})['then'](function(_0x3afb70){var _0x80bcfa=[];var _0xb4f6b0=[];for(var _0xc27434=0x0;_0xc27434<_0x3afb70[_0xffda('0x35')];_0xc27434+=0x1){var _0x5919f1=_0x3afb70[_0xc27434][_0xffda('0x36')];if(_0x5919f1===null){_0x80bcfa['push'](_0x3afb70[_0xc27434][_0xffda('0x37')](_0x49dd2a[_0xffda('0x26')],{'transaction':_0xf2330}));}else if(!_0xb4f6b0[_0xffda('0x38')](_0x5919f1)){_0xb4f6b0[_0xffda('0x39')](_0x5919f1);_0x80bcfa[_0xffda('0x39')](_0x3afb70[_0xc27434][_0xffda('0x37')](_0x49dd2a[_0xffda('0x26')],{'transaction':_0xf2330}));}}return BPromise[_0xffda('0x3a')](_0x80bcfa);});})['then'](function(_0x3fe020){logger[_0xffda('0xc')]('GetContactDialer',_0x49dd2a);logger[_0xffda('0xe')]('GetContactDialer',_0x49dd2a,JSON[_0xffda('0x10')](_0x3fe020));_0x3f5153(_0x3fe020);})[_0xffda('0x16')](function(_0x2670ea){logger[_0xffda('0x11')](_0xffda('0x2a'),_0x2670ea[_0xffda('0x14')],_0x49dd2a);_0x41fd0f(_0x573d19[_0xffda('0x11')](0x1f4,_0x2670ea[_0xffda('0x14')]));});});});};exports['MoveContactManagedDialer']=function(_0x115a48){var _0x370390=this;return new Promise(function(_0x211ba3,_0x15a73c){return db[_0xffda('0x3b')][_0xffda('0x2d')](function(_0x4fe027){return db[_0xffda('0x3c')]['create'](_0x115a48[_0xffda('0x26')],{'raw':_0x115a48['options']?_0x115a48['options']['raw']===undefined?!![]:![]:!![],'transaction':_0x4fe027})[_0xffda('0xb')](function(){return db[_0xffda('0x18')][_0xffda('0x29')]({'where':_0x115a48['options']?_0x115a48['options'][_0xffda('0x1c')]||null:null,'transaction':_0x4fe027});});})[_0xffda('0xb')](function(_0xb4b665){logger['info'](_0xffda('0x3d'),_0x115a48);logger[_0xffda('0xe')]('MoveContactManagedDialer',_0x115a48,JSON[_0xffda('0x10')](_0xb4b665));_0x211ba3(_0xb4b665);})[_0xffda('0x16')](function(_0x3d64c6){logger[_0xffda('0x11')](_0xffda('0x3d'),_0x3d64c6[_0xffda('0x14')],_0x115a48);_0x15a73c(_0x370390[_0xffda('0x11')](0x1f4,_0x3d64c6[_0xffda('0x14')]));});});};exports[_0xffda('0x3e')]=function(_0x44f9a5){var _0x5401f9=this;return new Promise(function(_0x1a55ee,_0x6f89db){return db[_0xffda('0x18')][_0xffda('0x19')]({'raw':_0x44f9a5['options']?_0x44f9a5[_0xffda('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x44f9a5[_0xffda('0x1a')]?_0x44f9a5['options'][_0xffda('0x1c')]||null:null,'attributes':[[db['sequelize']['fn']('COUNT',db[_0xffda('0x3b')]['fn']('IF',db[_0xffda('0x3b')][_0xffda('0x3f')](_0xffda('0x40')+util[_0xffda('0x41')](_0xffda('0x42'),moment()['format'](_0xffda('0x43')))+_0xffda('0x44')))),_0xffda('0x45')]]})[_0xffda('0xb')](function(_0x3c6ff3){logger[_0xffda('0xc')]('CountReScheduled',_0x44f9a5);logger['debug'](_0xffda('0x3e'),_0x44f9a5,JSON['stringify'](_0x3c6ff3));_0x1a55ee(_0x3c6ff3);})[_0xffda('0x16')](function(_0x40f369){logger[_0xffda('0x11')](_0xffda('0x3e'),_0x40f369[_0xffda('0x14')],_0x44f9a5);_0x6f89db(_0x5401f9[_0xffda('0x11')](0x1f4,_0x40f369[_0xffda('0x14')]));});});};exports['GetContactRecallMe']=function(_0x28af74){var _0x795004=this;return new Promise(function(_0x2fc097,_0xde7873){return db[_0xffda('0x2b')][_0xffda('0x2c')]()[_0xffda('0xb')](function(_0x641c6e){return db[_0xffda('0x3b')][_0xffda('0x2d')](function(_0x27c2a4){return db[_0xffda('0x18')][_0xffda('0x19')]({'where':_0x28af74[_0xffda('0x1a')]?_0x28af74['options'][_0xffda('0x1c')]||null:null,'attributes':_0x28af74[_0xffda('0x1a')]?_0x28af74['options'][_0xffda('0x1d')]||null:null,'limit':0x1,'order':_0x28af74[_0xffda('0x1a')]?_0x28af74['options'][_0xffda('0x46')]||null:null,'group':db['CmHopper'][_0xffda('0x36')],'transaction':_0x27c2a4,'lock':_0x27c2a4[_0xffda('0x2e')][_0xffda('0x2f')],'include':_0x28af74[_0xffda('0x1a')]?_0x28af74[_0xffda('0x1a')][_0xffda('0x1f')]?_[_0xffda('0x20')](_0x28af74[_0xffda('0x1a')][_0xffda('0x1f')],function(_0x4f6481){return{'model':db[_0x4f6481[_0xffda('0x21')]],'as':_0x4f6481['as'],'attributes':_0x4f6481[_0xffda('0x1d')],'include':_0x4f6481[_0xffda('0x1f')]?_[_0xffda('0x20')](_0x4f6481[_0xffda('0x1f')],function(_0x3ff8d9){return{'model':db[_0x3ff8d9['model']],'as':_0x3ff8d9['as'],'attributes':_0x3ff8d9['attributes'],'include':_0x3ff8d9['include']?_['map'](_0x3ff8d9[_0xffda('0x1f')],function(_0x547f7c){return{'model':db[_0x547f7c[_0xffda('0x21')]],'as':_0x547f7c['as'],'attributes':_0x547f7c[_0xffda('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xffda('0xb')](function(_0x2405f8){var _0x6483ea=[];for(var _0x5a513c=0x0;_0x5a513c<_0x2405f8[_0xffda('0x35')];_0x5a513c+=0x1){_0x6483ea['push'](_0x2405f8[_0x5a513c][_0xffda('0x37')](_0x28af74[_0xffda('0x26')],{'transaction':_0x27c2a4}));}return BPromise[_0xffda('0x3a')](_0x6483ea);});})[_0xffda('0xb')](function(_0x5beb18){logger['info']('GetContactRecallMe',_0x28af74);logger[_0xffda('0xe')]('GetContactRecallMe',_0x28af74,JSON[_0xffda('0x10')](_0x5beb18));_0x2fc097(_0x5beb18);})[_0xffda('0x16')](function(_0x553321){logger[_0xffda('0x11')](_0xffda('0x47'),_0x553321[_0xffda('0x14')],_0x28af74);_0xde7873(_0x795004[_0xffda('0x11')](0x1f4,_0x553321[_0xffda('0x14')]));});});});};exports[_0xffda('0x48')]=function(_0x1303f2){var _0xca489e=this;return new Promise(function(_0x3a231b,_0x37685f){db['CmContact']['describe']()[_0xffda('0xb')](function(_0x497bc6){return db[_0xffda('0x18')][_0xffda('0x19')]({'raw':_0x1303f2[_0xffda('0x1a')]?_0x1303f2['options'][_0xffda('0x1b')]===undefined?!![]:![]:!![],'where':_0x1303f2[_0xffda('0x1a')]?_0x1303f2[_0xffda('0x1a')][_0xffda('0x1c')]||null:null,'attributes':_0x1303f2[_0xffda('0x1a')]?_0x1303f2[_0xffda('0x1a')]['attributes']||null:null,'limit':_0x1303f2['options']?_0x1303f2[_0xffda('0x1a')][_0xffda('0x1e')]||null:null,'include':_0x1303f2[_0xffda('0x1a')]?_0x1303f2['options'][_0xffda('0x1f')]?_[_0xffda('0x20')](_0x1303f2[_0xffda('0x1a')][_0xffda('0x1f')],function(_0x257af2){return{'model':db[_0x257af2[_0xffda('0x21')]],'as':_0x257af2['as'],'attributes':_0x257af2['as']==='Contact'?_[_0xffda('0x31')](_0x497bc6):_0x257af2[_0xffda('0x1d')],'include':_0x257af2['include']?_[_0xffda('0x20')](_0x257af2['include'],function(_0x3338f7){return{'model':db[_0x3338f7[_0xffda('0x21')]],'as':_0x3338f7['as'],'attributes':_0x3338f7[_0xffda('0x1d')],'include':_0x3338f7['include']?_[_0xffda('0x20')](_0x3338f7['include'],function(_0x180956){return{'model':db[_0x180956[_0xffda('0x21')]],'as':_0x180956['as'],'attributes':_0x180956[_0xffda('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xffda('0xb')](function(_0x250a28){logger[_0xffda('0xc')](_0xffda('0x17'),_0x1303f2);logger[_0xffda('0xe')](_0xffda('0x17'),_0x1303f2,JSON['stringify'](_0x250a28));_0x3a231b(_0x250a28);})[_0xffda('0x16')](function(_0x3c0760){logger[_0xffda('0x11')](_0xffda('0x17'),_0x3c0760['message'],_0x1303f2);_0x37685f(_0xca489e[_0xffda('0x11')](0x1f4,_0x3c0760[_0xffda('0x14')]));});});});}; \ No newline at end of file diff --git a/server/api/cmHopper/index.js b/server/api/cmHopper/index.js index 47d17db..e654e1d 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 _0x8b7e=['/preview','getPreview','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopper.controller','get','isAuthenticated','index','describe','/opencontacts','getOpenContacts','show','post'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8b7e,0x1c2));var _0xe8b7=function(_0x5eee2e,_0x200d5c){_0x5eee2e=_0x5eee2e-0x0;var _0x3f0baa=_0x8b7e[_0x5eee2e];return _0x3f0baa;};'use strict';var multer=require(_0xe8b7('0x0'));var util=require(_0xe8b7('0x1'));var path=require(_0xe8b7('0x2'));var timeout=require(_0xe8b7('0x3'));var express=require(_0xe8b7('0x4'));var router=express[_0xe8b7('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xe8b7('0x6'));var interaction=require(_0xe8b7('0x7'));var config=require(_0xe8b7('0x8'));var controller=require(_0xe8b7('0x9'));router[_0xe8b7('0xa')]('/',auth[_0xe8b7('0xb')](),controller[_0xe8b7('0xc')]);router['get']('/describe',auth[_0xe8b7('0xb')](),controller[_0xe8b7('0xd')]);router['get'](_0xe8b7('0xe'),auth[_0xe8b7('0xb')](),controller[_0xe8b7('0xf')]);router[_0xe8b7('0xa')]('/:id',auth[_0xe8b7('0xb')](),controller[_0xe8b7('0x10')]);router[_0xe8b7('0x11')]('/',auth[_0xe8b7('0xb')](),controller['create']);router[_0xe8b7('0x11')](_0xe8b7('0x12'),auth[_0xe8b7('0xb')](),controller[_0xe8b7('0x13')]);router[_0xe8b7('0x14')](_0xe8b7('0x15'),auth[_0xe8b7('0xb')](),controller[_0xe8b7('0x16')]);router[_0xe8b7('0x17')](_0xe8b7('0x15'),auth['isAuthenticated'](),controller[_0xe8b7('0x18')]);module[_0xe8b7('0x19')]=router; \ No newline at end of file +var _0xbd19=['index','/describe','getOpenContacts','show','post','create','getPreview','put','/:id','update','delete','destroy','exports','multer','util','connect-timeout','fs-extra','../../components/auth/service','./cmHopper.controller','get','isAuthenticated'];(function(_0x161e4f,_0x32a235){var _0x320c32=function(_0xe4be7b){while(--_0xe4be7b){_0x161e4f['push'](_0x161e4f['shift']());}};_0x320c32(++_0x32a235);}(_0xbd19,0x1f0));var _0x9bd1=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0xbd19[_0x40a045];return _0x1a687c;};'use strict';var multer=require(_0x9bd1('0x0'));var util=require(_0x9bd1('0x1'));var path=require('path');var timeout=require(_0x9bd1('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x9bd1('0x3'));var auth=require(_0x9bd1('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x9bd1('0x5'));router[_0x9bd1('0x6')]('/',auth[_0x9bd1('0x7')](),controller[_0x9bd1('0x8')]);router['get'](_0x9bd1('0x9'),auth['isAuthenticated'](),controller['describe']);router[_0x9bd1('0x6')]('/opencontacts',auth[_0x9bd1('0x7')](),controller[_0x9bd1('0xa')]);router[_0x9bd1('0x6')]('/:id',auth[_0x9bd1('0x7')](),controller[_0x9bd1('0xb')]);router[_0x9bd1('0xc')]('/',auth[_0x9bd1('0x7')](),controller[_0x9bd1('0xd')]);router[_0x9bd1('0xc')]('/preview',auth['isAuthenticated'](),controller[_0x9bd1('0xe')]);router[_0x9bd1('0xf')](_0x9bd1('0x10'),auth[_0x9bd1('0x7')](),controller[_0x9bd1('0x11')]);router[_0x9bd1('0x12')](_0x9bd1('0x10'),auth[_0x9bd1('0x7')](),controller[_0x9bd1('0x13')]);module[_0x9bd1('0x14')]=router; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.attributes.js b/server/api/cmHopperBlack/cmHopperBlack.attributes.js index 923baba..63db724 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 _0x9622=['contactListQueue','moment','sequelize','exports','INTEGER'];(function(_0x98e366,_0xa63fb7){var _0x536d25=function(_0x149112){while(--_0x149112){_0x98e366['push'](_0x98e366['shift']());}};_0x536d25(++_0xa63fb7);}(_0x9622,0x8d));var _0x2962=function(_0x5b791d,_0x49cc81){_0x5b791d=_0x5b791d-0x0;var _0xdd1c36=_0x9622[_0x5b791d];return _0xdd1c36;};'use strict';var moment=require(_0x2962('0x0'));var Sequelize=require(_0x2962('0x1'));module[_0x2962('0x2')]={'phone':{'type':Sequelize['STRING'],'allowNull':![]},'ContactId':{'type':Sequelize[_0x2962('0x3')],'unique':_0x2962('0x4')},'ListId':{'type':Sequelize[_0x2962('0x3')],'unique':'contactListQueue'},'VoiceQueueId':{'type':Sequelize['INTEGER'],'unique':'contactListQueue'}}; \ No newline at end of file +var _0x793b=['moment','exports','STRING','INTEGER','contactListQueue'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x793b,0xf0));var _0xb793=function(_0x5cbc42,_0x6a2fb7){_0x5cbc42=_0x5cbc42-0x0;var _0x35f136=_0x793b[_0x5cbc42];return _0x35f136;};'use strict';var moment=require(_0xb793('0x0'));var Sequelize=require('sequelize');module[_0xb793('0x1')]={'phone':{'type':Sequelize[_0xb793('0x2')],'allowNull':![]},'ContactId':{'type':Sequelize['INTEGER'],'unique':'contactListQueue'},'ListId':{'type':Sequelize[_0xb793('0x3')],'unique':_0xb793('0x4')},'VoiceQueueId':{'type':Sequelize[_0xb793('0x3')],'unique':_0xb793('0x4')}}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.controller.js b/server/api/cmHopperBlack/cmHopperBlack.controller.js index 4d16262..0e71d6b 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 _0x5a1b=['sox','to-csv','fs-extra','lodash','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','map','CmHopperBlack','rawAttributes','fieldName','type','model','keys','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','find','catch','body','describe','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util'];(function(_0x428479,_0x2886ab){var _0x2cab7e=function(_0x5369ab){while(--_0x5369ab){_0x428479['push'](_0x428479['shift']());}};_0x2cab7e(++_0x2886ab);}(_0x5a1b,0xdb));var _0xb5a1=function(_0x4002f4,_0x36d357){_0x4002f4=_0x4002f4-0x0;var _0x348927=_0x5a1b[_0x4002f4];return _0x348927;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb5a1('0x0'));var zipdir=require(_0xb5a1('0x1'));var jsonpatch=require(_0xb5a1('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xb5a1('0x3'));var Mustache=require(_0xb5a1('0x4'));var util=require(_0xb5a1('0x5'));var path=require('path');var sox=require(_0xb5a1('0x6'));var csv=require(_0xb5a1('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb5a1('0x8'));var _=require(_0xb5a1('0x9'));var squel=require('squel');var crypto=require(_0xb5a1('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xb5a1('0xb'));var toCsv=require(_0xb5a1('0x7'));var querystring=require('querystring');var Papa=require(_0xb5a1('0xc'));var Redis=require(_0xb5a1('0xd'));var authService=require(_0xb5a1('0xe'));var qs=require(_0xb5a1('0xf'));var as=require(_0xb5a1('0x10'));var hardwareService=require(_0xb5a1('0x11'));var logger=require(_0xb5a1('0x12'))(_0xb5a1('0x13'));var utils=require(_0xb5a1('0x14'));var config=require(_0xb5a1('0x15'));var licenseUtil=require(_0xb5a1('0x16'));var db=require(_0xb5a1('0x17'))['db'];function respondWithStatusCode(_0x1483d3,_0x18944e){_0x18944e=_0x18944e||0xcc;return function(_0x1fc229){if(_0x1fc229){return _0x1483d3['sendStatus'](_0x18944e);}return _0x1483d3[_0xb5a1('0x18')](_0x18944e)[_0xb5a1('0x19')]();};}function respondWithResult(_0x5713b3,_0x3d138d){_0x3d138d=_0x3d138d||0xc8;return function(_0x457460){if(_0x457460){return _0x5713b3[_0xb5a1('0x18')](_0x3d138d)[_0xb5a1('0x1a')](_0x457460);}};}function respondWithFilteredResult(_0x4b6ef0,_0x2f5190){return function(_0x468b16){if(_0x468b16){var _0x5a7c8e=typeof _0x2f5190[_0xb5a1('0x1b')]===_0xb5a1('0x1c')&&typeof _0x2f5190[_0xb5a1('0x1d')]===_0xb5a1('0x1c');var _0x1ff9b7=_0x468b16[_0xb5a1('0x1e')];var _0x21c7fb=_0x5a7c8e?0x0:_0x2f5190['offset'];var _0x129f49=_0x5a7c8e?_0x468b16['count']:_0x2f5190[_0xb5a1('0x1b')]+_0x2f5190[_0xb5a1('0x1d')];var _0x181cc9;if(_0x129f49>=_0x1ff9b7){_0x129f49=_0x1ff9b7;_0x181cc9=0xc8;}else{_0x181cc9=0xce;}_0x4b6ef0[_0xb5a1('0x18')](_0x181cc9);return _0x4b6ef0[_0xb5a1('0x1f')](_0xb5a1('0x20'),_0x21c7fb+'-'+_0x129f49+'/'+_0x1ff9b7)[_0xb5a1('0x1a')](_0x468b16);}return null;};}function patchUpdates(_0x1fd415){return function(_0x35fe9d){try{jsonpatch[_0xb5a1('0x21')](_0x35fe9d,_0x1fd415,!![]);}catch(_0x184f30){return BPromise[_0xb5a1('0x22')](_0x184f30);}return _0x35fe9d['save']();};}function saveUpdates(_0x21ba91,_0x3445bd){return function(_0x45b0e0){if(_0x45b0e0){return _0x45b0e0[_0xb5a1('0x23')](_0x21ba91)[_0xb5a1('0x24')](function(_0x1d774e){return _0x1d774e;});}return null;};}function removeEntity(_0x15c7dc,_0x3f97ed){return function(_0x3d6f9f){if(_0x3d6f9f){return _0x3d6f9f[_0xb5a1('0x25')]()[_0xb5a1('0x24')](function(){_0x15c7dc[_0xb5a1('0x18')](0xcc)[_0xb5a1('0x19')]();});}};}function handleEntityNotFound(_0x4a47a7,_0x90e44a){return function(_0x80e3de){if(!_0x80e3de){_0x4a47a7['sendStatus'](0x194);}return _0x80e3de;};}function handleError(_0x14be24,_0x181259){_0x181259=_0x181259||0x1f4;return function(_0x3e26c8){logger[_0xb5a1('0x26')](_0x3e26c8[_0xb5a1('0x27')]);if(_0x3e26c8[_0xb5a1('0x28')]){delete _0x3e26c8[_0xb5a1('0x28')];}_0x14be24[_0xb5a1('0x18')](_0x181259)[_0xb5a1('0x29')](_0x3e26c8);};}exports['index']=function(_0x483467,_0x10058d){var _0x12bcda={},_0x5deb6e={},_0x1a6989={'count':0x0,'rows':[]};var _0x1c3fcf=_[_0xb5a1('0x2a')](db[_0xb5a1('0x2b')][_0xb5a1('0x2c')],function(_0x2a939e){return{'name':_0x2a939e[_0xb5a1('0x2d')],'type':_0x2a939e[_0xb5a1('0x2e')]['key']};});_0x5deb6e[_0xb5a1('0x2f')]=_[_0xb5a1('0x2a')](_0x1c3fcf,_0xb5a1('0x28'));_0x5deb6e['query']=_[_0xb5a1('0x30')](_0x483467[_0xb5a1('0x31')]);_0x5deb6e['filters']=_[_0xb5a1('0x32')](_0x5deb6e[_0xb5a1('0x2f')],_0x5deb6e[_0xb5a1('0x31')]);_0x12bcda['attributes']=_['intersection'](_0x5deb6e[_0xb5a1('0x2f')],qs[_0xb5a1('0x33')](_0x483467[_0xb5a1('0x31')][_0xb5a1('0x33')]));_0x12bcda['attributes']=_0x12bcda[_0xb5a1('0x34')][_0xb5a1('0x35')]?_0x12bcda['attributes']:_0x5deb6e['model'];if(!_0x483467[_0xb5a1('0x31')][_0xb5a1('0x36')](_0xb5a1('0x37'))){_0x12bcda[_0xb5a1('0x1d')]=qs['limit'](_0x483467[_0xb5a1('0x31')]['limit']);_0x12bcda[_0xb5a1('0x1b')]=qs[_0xb5a1('0x1b')](_0x483467['query'][_0xb5a1('0x1b')]);}_0x12bcda[_0xb5a1('0x38')]=qs['sort'](_0x483467[_0xb5a1('0x31')][_0xb5a1('0x39')]);_0x12bcda['where']=qs[_0xb5a1('0x3a')](_[_0xb5a1('0x3b')](_0x483467[_0xb5a1('0x31')],_0x5deb6e[_0xb5a1('0x3a')]),_0x1c3fcf);if(_0x483467[_0xb5a1('0x31')][_0xb5a1('0x3c')]){_0x12bcda[_0xb5a1('0x3d')]=_[_0xb5a1('0x3e')](_0x12bcda[_0xb5a1('0x3d')],{'$or':_[_0xb5a1('0x2a')](_0x1c3fcf,function(_0xde3cec){if(_0xde3cec[_0xb5a1('0x2e')]!==_0xb5a1('0x3f')){var _0x318910={};_0x318910[_0xde3cec['name']]={'$like':'%'+_0x483467[_0xb5a1('0x31')][_0xb5a1('0x3c')]+'%'};return _0x318910;}})});}_0x12bcda=_[_0xb5a1('0x3e')]({},_0x12bcda,_0x483467[_0xb5a1('0x40')]);var _0x4edfb0={'where':_0x12bcda[_0xb5a1('0x3d')]};return db[_0xb5a1('0x2b')][_0xb5a1('0x1e')](_0x4edfb0)[_0xb5a1('0x24')](function(_0x46384a){_0x1a6989[_0xb5a1('0x1e')]=_0x46384a;if(_0x483467[_0xb5a1('0x31')][_0xb5a1('0x41')]){_0x12bcda[_0xb5a1('0x42')]=[{'all':!![]}];}return db['CmHopperBlack'][_0xb5a1('0x43')](_0x12bcda);})[_0xb5a1('0x24')](function(_0x2c1425){_0x1a6989[_0xb5a1('0x44')]=_0x2c1425;return _0x1a6989;})[_0xb5a1('0x24')](respondWithFilteredResult(_0x10058d,_0x12bcda))['catch'](handleError(_0x10058d,null));};exports[_0xb5a1('0x45')]=function(_0x12a92a,_0x173a55){var _0x46ecb9={'raw':!![],'where':{'id':_0x12a92a[_0xb5a1('0x46')]['id']}},_0x2a52df={};_0x2a52df[_0xb5a1('0x2f')]=_['keys'](db[_0xb5a1('0x2b')][_0xb5a1('0x2c')]);_0x2a52df[_0xb5a1('0x31')]=_[_0xb5a1('0x30')](_0x12a92a[_0xb5a1('0x31')]);_0x2a52df[_0xb5a1('0x3a')]=_[_0xb5a1('0x32')](_0x2a52df[_0xb5a1('0x2f')],_0x2a52df['query']);_0x46ecb9[_0xb5a1('0x34')]=_[_0xb5a1('0x32')](_0x2a52df['model'],qs['fields'](_0x12a92a[_0xb5a1('0x31')]['fields']));_0x46ecb9[_0xb5a1('0x34')]=_0x46ecb9['attributes']['length']?_0x46ecb9[_0xb5a1('0x34')]:_0x2a52df['model'];if(_0x12a92a[_0xb5a1('0x31')][_0xb5a1('0x41')]){_0x46ecb9[_0xb5a1('0x42')]=[{'all':!![]}];}_0x46ecb9=_['merge']({},_0x46ecb9,_0x12a92a['options']);return db[_0xb5a1('0x2b')][_0xb5a1('0x47')](_0x46ecb9)[_0xb5a1('0x24')](handleEntityNotFound(_0x173a55,null))['then'](respondWithResult(_0x173a55,null))[_0xb5a1('0x48')](handleError(_0x173a55,null));};exports[_0xb5a1('0x23')]=function(_0xfdfa24,_0x4c04f6){if(_0xfdfa24[_0xb5a1('0x49')]['id']){delete _0xfdfa24['body']['id'];}return db['CmHopperBlack'][_0xb5a1('0x47')]({'where':{'id':_0xfdfa24[_0xb5a1('0x46')]['id']}})['then'](handleEntityNotFound(_0x4c04f6,null))[_0xb5a1('0x24')](saveUpdates(_0xfdfa24[_0xb5a1('0x49')],null))[_0xb5a1('0x24')](respondWithResult(_0x4c04f6,null))[_0xb5a1('0x48')](handleError(_0x4c04f6,null));};exports['destroy']=function(_0x1dd3a7,_0x58c5e2){return db[_0xb5a1('0x2b')][_0xb5a1('0x47')]({'where':{'id':_0x1dd3a7[_0xb5a1('0x46')]['id']}})[_0xb5a1('0x24')](handleEntityNotFound(_0x58c5e2,null))[_0xb5a1('0x24')](removeEntity(_0x58c5e2,null))['catch'](handleError(_0x58c5e2,null));};exports[_0xb5a1('0x4a')]=function(_0x23205e,_0x103ec5){return db[_0xb5a1('0x2b')][_0xb5a1('0x4a')]()[_0xb5a1('0x24')](respondWithResult(_0x103ec5,null))['catch'](handleError(_0x103ec5,null));}; \ No newline at end of file +var _0xef73=['nolimit','order','sort','where','filters','filter','merge','options','then','includeAll','include','rows','catch','show','rawAttributes','length','find','body','params','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','crypto','jsforce','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','reject','save','update','destroy','error','stack','name','send','index','map','CmHopperBlack','fieldName','type','model','query','keys','intersection','attributes','fields','hasOwnProperty'];(function(_0x1ac120,_0x3e7e45){var _0x19b703=function(_0x5f32cb){while(--_0x5f32cb){_0x1ac120['push'](_0x1ac120['shift']());}};_0x19b703(++_0x3e7e45);}(_0xef73,0x148));var _0x3ef7=function(_0x51ec61,_0xf9d1e3){_0x51ec61=_0x51ec61-0x0;var _0x223200=_0xef73[_0x51ec61];return _0x223200;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3ef7('0x0'));var zipdir=require(_0x3ef7('0x1'));var jsonpatch=require(_0x3ef7('0x2'));var rp=require(_0x3ef7('0x3'));var moment=require(_0x3ef7('0x4'));var BPromise=require(_0x3ef7('0x5'));var Mustache=require(_0x3ef7('0x6'));var util=require(_0x3ef7('0x7'));var path=require(_0x3ef7('0x8'));var sox=require(_0x3ef7('0x9'));var csv=require('to-csv');var ejs=require(_0x3ef7('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3ef7('0xb'));var squel=require('squel');var crypto=require(_0x3ef7('0xc'));var jsforce=require(_0x3ef7('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x3ef7('0xe'));var querystring=require(_0x3ef7('0xf'));var Papa=require(_0x3ef7('0x10'));var Redis=require('ioredis');var authService=require(_0x3ef7('0x11'));var qs=require(_0x3ef7('0x12'));var as=require(_0x3ef7('0x13'));var hardwareService=require(_0x3ef7('0x14'));var logger=require(_0x3ef7('0x15'))(_0x3ef7('0x16'));var utils=require(_0x3ef7('0x17'));var config=require(_0x3ef7('0x18'));var licenseUtil=require(_0x3ef7('0x19'));var db=require(_0x3ef7('0x1a'))['db'];function respondWithStatusCode(_0x35f3eb,_0x5bcd40){_0x5bcd40=_0x5bcd40||0xcc;return function(_0x1edfc5){if(_0x1edfc5){return _0x35f3eb[_0x3ef7('0x1b')](_0x5bcd40);}return _0x35f3eb[_0x3ef7('0x1c')](_0x5bcd40)[_0x3ef7('0x1d')]();};}function respondWithResult(_0x4ec9c9,_0x40da88){_0x40da88=_0x40da88||0xc8;return function(_0x31fa09){if(_0x31fa09){return _0x4ec9c9['status'](_0x40da88)[_0x3ef7('0x1e')](_0x31fa09);}};}function respondWithFilteredResult(_0x50be39,_0x4eee25){return function(_0x29f6b4){if(_0x29f6b4){var _0x5002d6=typeof _0x4eee25['offset']===_0x3ef7('0x1f')&&typeof _0x4eee25[_0x3ef7('0x20')]===_0x3ef7('0x1f');var _0x52fdef=_0x29f6b4[_0x3ef7('0x21')];var _0x1d3633=_0x5002d6?0x0:_0x4eee25[_0x3ef7('0x22')];var _0x11d093=_0x5002d6?_0x29f6b4[_0x3ef7('0x21')]:_0x4eee25['offset']+_0x4eee25['limit'];var _0x14ca0e;if(_0x11d093>=_0x52fdef){_0x11d093=_0x52fdef;_0x14ca0e=0xc8;}else{_0x14ca0e=0xce;}_0x50be39[_0x3ef7('0x1c')](_0x14ca0e);return _0x50be39[_0x3ef7('0x23')](_0x3ef7('0x24'),_0x1d3633+'-'+_0x11d093+'/'+_0x52fdef)[_0x3ef7('0x1e')](_0x29f6b4);}return null;};}function patchUpdates(_0xc6bab3){return function(_0x104b1c){try{jsonpatch['apply'](_0x104b1c,_0xc6bab3,!![]);}catch(_0x5e00a0){return BPromise[_0x3ef7('0x25')](_0x5e00a0);}return _0x104b1c[_0x3ef7('0x26')]();};}function saveUpdates(_0x3f194e,_0x21943f){return function(_0x5359ea){if(_0x5359ea){return _0x5359ea[_0x3ef7('0x27')](_0x3f194e)['then'](function(_0x32eab8){return _0x32eab8;});}return null;};}function removeEntity(_0x1d2d3c,_0xb98716){return function(_0x5c941e){if(_0x5c941e){return _0x5c941e[_0x3ef7('0x28')]()['then'](function(){_0x1d2d3c[_0x3ef7('0x1c')](0xcc)[_0x3ef7('0x1d')]();});}};}function handleEntityNotFound(_0x40ce7c,_0x2d5d23){return function(_0x144107){if(!_0x144107){_0x40ce7c[_0x3ef7('0x1b')](0x194);}return _0x144107;};}function handleError(_0x271597,_0xa8bc2b){_0xa8bc2b=_0xa8bc2b||0x1f4;return function(_0x507149){logger[_0x3ef7('0x29')](_0x507149[_0x3ef7('0x2a')]);if(_0x507149[_0x3ef7('0x2b')]){delete _0x507149[_0x3ef7('0x2b')];}_0x271597[_0x3ef7('0x1c')](_0xa8bc2b)[_0x3ef7('0x2c')](_0x507149);};}exports[_0x3ef7('0x2d')]=function(_0x3ab2e2,_0x4c2f4f){var _0xa9e101={},_0x3003bf={},_0x309a9b={'count':0x0,'rows':[]};var _0x4359fe=_[_0x3ef7('0x2e')](db[_0x3ef7('0x2f')]['rawAttributes'],function(_0x4fd01a){return{'name':_0x4fd01a[_0x3ef7('0x30')],'type':_0x4fd01a[_0x3ef7('0x31')]['key']};});_0x3003bf[_0x3ef7('0x32')]=_[_0x3ef7('0x2e')](_0x4359fe,_0x3ef7('0x2b'));_0x3003bf[_0x3ef7('0x33')]=_[_0x3ef7('0x34')](_0x3ab2e2['query']);_0x3003bf['filters']=_[_0x3ef7('0x35')](_0x3003bf[_0x3ef7('0x32')],_0x3003bf[_0x3ef7('0x33')]);_0xa9e101[_0x3ef7('0x36')]=_[_0x3ef7('0x35')](_0x3003bf[_0x3ef7('0x32')],qs[_0x3ef7('0x37')](_0x3ab2e2[_0x3ef7('0x33')][_0x3ef7('0x37')]));_0xa9e101['attributes']=_0xa9e101[_0x3ef7('0x36')]['length']?_0xa9e101[_0x3ef7('0x36')]:_0x3003bf[_0x3ef7('0x32')];if(!_0x3ab2e2[_0x3ef7('0x33')][_0x3ef7('0x38')](_0x3ef7('0x39'))){_0xa9e101[_0x3ef7('0x20')]=qs[_0x3ef7('0x20')](_0x3ab2e2[_0x3ef7('0x33')][_0x3ef7('0x20')]);_0xa9e101[_0x3ef7('0x22')]=qs['offset'](_0x3ab2e2[_0x3ef7('0x33')][_0x3ef7('0x22')]);}_0xa9e101[_0x3ef7('0x3a')]=qs['sort'](_0x3ab2e2[_0x3ef7('0x33')][_0x3ef7('0x3b')]);_0xa9e101[_0x3ef7('0x3c')]=qs[_0x3ef7('0x3d')](_['pick'](_0x3ab2e2[_0x3ef7('0x33')],_0x3003bf[_0x3ef7('0x3d')]),_0x4359fe);if(_0x3ab2e2[_0x3ef7('0x33')][_0x3ef7('0x3e')]){_0xa9e101['where']=_[_0x3ef7('0x3f')](_0xa9e101[_0x3ef7('0x3c')],{'$or':_[_0x3ef7('0x2e')](_0x4359fe,function(_0x246b04){if(_0x246b04[_0x3ef7('0x31')]!=='VIRTUAL'){var _0x211a04={};_0x211a04[_0x246b04[_0x3ef7('0x2b')]]={'$like':'%'+_0x3ab2e2[_0x3ef7('0x33')][_0x3ef7('0x3e')]+'%'};return _0x211a04;}})});}_0xa9e101=_[_0x3ef7('0x3f')]({},_0xa9e101,_0x3ab2e2[_0x3ef7('0x40')]);var _0x363d05={'where':_0xa9e101['where']};return db[_0x3ef7('0x2f')][_0x3ef7('0x21')](_0x363d05)[_0x3ef7('0x41')](function(_0x802da2){_0x309a9b[_0x3ef7('0x21')]=_0x802da2;if(_0x3ab2e2[_0x3ef7('0x33')][_0x3ef7('0x42')]){_0xa9e101[_0x3ef7('0x43')]=[{'all':!![]}];}return db[_0x3ef7('0x2f')]['findAll'](_0xa9e101);})[_0x3ef7('0x41')](function(_0xa22197){_0x309a9b[_0x3ef7('0x44')]=_0xa22197;return _0x309a9b;})['then'](respondWithFilteredResult(_0x4c2f4f,_0xa9e101))[_0x3ef7('0x45')](handleError(_0x4c2f4f,null));};exports[_0x3ef7('0x46')]=function(_0x58f82d,_0x32a7f4){var _0x311e7d={'raw':!![],'where':{'id':_0x58f82d['params']['id']}},_0x57e436={};_0x57e436[_0x3ef7('0x32')]=_[_0x3ef7('0x34')](db['CmHopperBlack'][_0x3ef7('0x47')]);_0x57e436['query']=_[_0x3ef7('0x34')](_0x58f82d[_0x3ef7('0x33')]);_0x57e436[_0x3ef7('0x3d')]=_['intersection'](_0x57e436[_0x3ef7('0x32')],_0x57e436['query']);_0x311e7d[_0x3ef7('0x36')]=_[_0x3ef7('0x35')](_0x57e436[_0x3ef7('0x32')],qs['fields'](_0x58f82d[_0x3ef7('0x33')][_0x3ef7('0x37')]));_0x311e7d[_0x3ef7('0x36')]=_0x311e7d[_0x3ef7('0x36')][_0x3ef7('0x48')]?_0x311e7d[_0x3ef7('0x36')]:_0x57e436[_0x3ef7('0x32')];if(_0x58f82d['query'][_0x3ef7('0x42')]){_0x311e7d[_0x3ef7('0x43')]=[{'all':!![]}];}_0x311e7d=_['merge']({},_0x311e7d,_0x58f82d[_0x3ef7('0x40')]);return db['CmHopperBlack'][_0x3ef7('0x49')](_0x311e7d)[_0x3ef7('0x41')](handleEntityNotFound(_0x32a7f4,null))[_0x3ef7('0x41')](respondWithResult(_0x32a7f4,null))[_0x3ef7('0x45')](handleError(_0x32a7f4,null));};exports[_0x3ef7('0x27')]=function(_0x3909fd,_0x26e6e8){if(_0x3909fd[_0x3ef7('0x4a')]['id']){delete _0x3909fd[_0x3ef7('0x4a')]['id'];}return db[_0x3ef7('0x2f')][_0x3ef7('0x49')]({'where':{'id':_0x3909fd[_0x3ef7('0x4b')]['id']}})[_0x3ef7('0x41')](handleEntityNotFound(_0x26e6e8,null))[_0x3ef7('0x41')](saveUpdates(_0x3909fd['body'],null))[_0x3ef7('0x41')](respondWithResult(_0x26e6e8,null))[_0x3ef7('0x45')](handleError(_0x26e6e8,null));};exports[_0x3ef7('0x28')]=function(_0x2f55f6,_0x4e65f3){return db['CmHopperBlack'][_0x3ef7('0x49')]({'where':{'id':_0x2f55f6[_0x3ef7('0x4b')]['id']}})[_0x3ef7('0x41')](handleEntityNotFound(_0x4e65f3,null))['then'](removeEntity(_0x4e65f3,null))['catch'](handleError(_0x4e65f3,null));};exports[_0x3ef7('0x4c')]=function(_0x5920a2,_0x59a4af){return db[_0x3ef7('0x2f')][_0x3ef7('0x4c')]()[_0x3ef7('0x41')](respondWithResult(_0x59a4af,null))['catch'](handleError(_0x59a4af,null));}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.model.js b/server/api/cmHopperBlack/cmHopperBlack.model.js index 6a066e0..c08b669 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 _0x1316=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cmHopperBlack.attributes','exports','define','CmHopperBlack'];(function(_0xa8cd1d,_0x33b894){var _0x15ad57=function(_0x6c7b47){while(--_0x6c7b47){_0xa8cd1d['push'](_0xa8cd1d['shift']());}};_0x15ad57(++_0x33b894);}(_0x1316,0x1ce));var _0x6131=function(_0x5924c3,_0x58c982){_0x5924c3=_0x5924c3-0x0;var _0x2f5b30=_0x1316[_0x5924c3];return _0x2f5b30;};'use strict';var _=require(_0x6131('0x0'));var util=require(_0x6131('0x1'));var logger=require(_0x6131('0x2'))(_0x6131('0x3'));var moment=require(_0x6131('0x4'));var BPromise=require(_0x6131('0x5'));var rp=require(_0x6131('0x6'));var fs=require('fs');var path=require(_0x6131('0x7'));var rimraf=require(_0x6131('0x8'));var config=require(_0x6131('0x9'));var attributes=require(_0x6131('0xa'));module[_0x6131('0xb')]=function(_0x461e1b,_0x587a1d){return _0x461e1b[_0x6131('0xc')](_0x6131('0xd'),attributes,{'tableName':'cm_hopper_black','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xde10=['./cmHopperBlack.attributes','exports','define','CmHopperBlack','lodash','util','../../config/logger','api','moment','path'];(function(_0x1611ef,_0x5e2d05){var _0x20b98b=function(_0x27d37b){while(--_0x27d37b){_0x1611ef['push'](_0x1611ef['shift']());}};_0x20b98b(++_0x5e2d05);}(_0xde10,0x7c));var _0x0de1=function(_0x45a072,_0x17a234){_0x45a072=_0x45a072-0x0;var _0x29efa9=_0xde10[_0x45a072];return _0x29efa9;};'use strict';var _=require(_0x0de1('0x0'));var util=require(_0x0de1('0x1'));var logger=require(_0x0de1('0x2'))(_0x0de1('0x3'));var moment=require(_0x0de1('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x0de1('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x0de1('0x6'));module[_0x0de1('0x7')]=function(_0xd595cb,_0x1adc5d){return _0xd595cb[_0x0de1('0x8')](_0x0de1('0x9'),attributes,{'tableName':'cm_hopper_black','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.rpc.js b/server/api/cmHopperBlack/cmHopperBlack.rpc.js index 6edfe2c..853a157 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 _0x8196=['bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','CmHopperBlack,\x20%s,\x20%s','request\x20sent','debug','CmHopperBlack,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetCmHopperBlack','CmHopperBlack','options','raw','where','attributes','limit','include','map','model','UpdateCmHopperBlack','update','DestroyCmHopperBlack','destroy','util','moment'];(function(_0x46b8e0,_0x46ca4d){var _0xd39740=function(_0xbe0756){while(--_0xbe0756){_0x46b8e0['push'](_0x46b8e0['shift']());}};_0xd39740(++_0x46ca4d);}(_0x8196,0x96));var _0x6819=function(_0x4bf4e4,_0x5bd1ba){_0x4bf4e4=_0x4bf4e4-0x0;var _0x314078=_0x8196[_0x4bf4e4];return _0x314078;};'use strict';var _=require('lodash');var util=require(_0x6819('0x0'));var moment=require(_0x6819('0x1'));var BPromise=require(_0x6819('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6819('0x3'))['db'];var utils=require(_0x6819('0x4'));var logger=require(_0x6819('0x5'))(_0x6819('0x6'));var config=require(_0x6819('0x7'));var jayson=require(_0x6819('0x8'));var client=jayson[_0x6819('0x9')][_0x6819('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xd1434d,_0x55e068,_0x38f52e){return new BPromise(function(_0xe2630,_0x1ef22c){return client[_0x6819('0xb')](_0xd1434d,_0x38f52e)[_0x6819('0xc')](function(_0xd99e0b){logger[_0x6819('0xd')](_0x6819('0xe'),_0x55e068,_0x6819('0xf'));logger[_0x6819('0x10')](_0x6819('0x11'),_0x55e068,_0x6819('0xf'),JSON[_0x6819('0x12')](_0xd99e0b));if(_0xd99e0b[_0x6819('0x13')]){if(_0xd99e0b[_0x6819('0x13')][_0x6819('0x14')]===0x1f4){logger['error'](_0x6819('0xe'),_0x55e068,_0xd99e0b['error']['message']);return _0x1ef22c(_0xd99e0b[_0x6819('0x13')][_0x6819('0x15')]);}logger[_0x6819('0x13')](_0x6819('0xe'),_0x55e068,_0xd99e0b['error'][_0x6819('0x15')]);return _0xe2630(_0xd99e0b[_0x6819('0x13')][_0x6819('0x15')]);}else{logger['info'](_0x6819('0xe'),_0x55e068,_0x6819('0xf'));_0xe2630(_0xd99e0b[_0x6819('0x16')]['message']);}})[_0x6819('0x17')](function(_0x428fc8){logger[_0x6819('0x13')](_0x6819('0xe'),_0x55e068,_0x428fc8);_0x1ef22c(_0x428fc8);});});}exports[_0x6819('0x18')]=function(_0x1ec250){var _0x42b527=this;return new Promise(function(_0x1ef898,_0x4697c5){return db[_0x6819('0x19')]['findAll']({'raw':_0x1ec250[_0x6819('0x1a')]?_0x1ec250[_0x6819('0x1a')][_0x6819('0x1b')]===undefined?!![]:![]:!![],'where':_0x1ec250[_0x6819('0x1a')]?_0x1ec250[_0x6819('0x1a')][_0x6819('0x1c')]||null:null,'attributes':_0x1ec250[_0x6819('0x1a')]?_0x1ec250['options'][_0x6819('0x1d')]||null:null,'limit':_0x1ec250[_0x6819('0x1a')]?_0x1ec250['options'][_0x6819('0x1e')]||null:null,'include':_0x1ec250[_0x6819('0x1a')]?_0x1ec250[_0x6819('0x1a')][_0x6819('0x1f')]?_[_0x6819('0x20')](_0x1ec250['options']['include'],function(_0xb7a399){return{'model':db[_0xb7a399[_0x6819('0x21')]],'as':_0xb7a399['as'],'attributes':_0xb7a399[_0x6819('0x1d')],'include':_0xb7a399['include']?_['map'](_0xb7a399[_0x6819('0x1f')],function(_0x1f3d8a){return{'model':db[_0x1f3d8a['model']],'as':_0x1f3d8a['as'],'attributes':_0x1f3d8a['attributes'],'include':_0x1f3d8a[_0x6819('0x1f')]?_['map'](_0x1f3d8a[_0x6819('0x1f')],function(_0x3c628a){return{'model':db[_0x3c628a['model']],'as':_0x3c628a['as'],'attributes':_0x3c628a[_0x6819('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x11d17e){logger[_0x6819('0xd')](_0x6819('0x18'),_0x1ec250);logger[_0x6819('0x10')](_0x6819('0x18'),_0x1ec250,JSON[_0x6819('0x12')](_0x11d17e));_0x1ef898(_0x11d17e);})['catch'](function(_0x42cda4){logger['error'](_0x6819('0x18'),_0x42cda4[_0x6819('0x15')],_0x1ec250);_0x4697c5(_0x42b527[_0x6819('0x13')](0x1f4,_0x42cda4[_0x6819('0x15')]));});});};exports[_0x6819('0x22')]=function(_0x5f1f06){var _0x1148d0=this;return new Promise(function(_0x3e3ec7,_0x2eee07){return db['CmHopperBlack'][_0x6819('0x23')](_0x5f1f06['body'],{'raw':_0x5f1f06['options']?_0x5f1f06[_0x6819('0x1a')][_0x6819('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5f1f06[_0x6819('0x1a')]?_0x5f1f06[_0x6819('0x1a')][_0x6819('0x1c')]||null:null,'attributes':_0x5f1f06[_0x6819('0x1a')]?_0x5f1f06[_0x6819('0x1a')][_0x6819('0x1d')]||null:null,'limit':_0x5f1f06[_0x6819('0x1a')]?_0x5f1f06[_0x6819('0x1a')]['limit']||null:null})[_0x6819('0xc')](function(_0x85ad9f){logger[_0x6819('0xd')]('UpdateCmHopperBlack',_0x5f1f06);logger[_0x6819('0x10')](_0x6819('0x22'),_0x5f1f06,JSON[_0x6819('0x12')](_0x85ad9f));_0x3e3ec7(_0x85ad9f);})['catch'](function(_0x5626bd){logger[_0x6819('0x13')](_0x6819('0x22'),_0x5626bd[_0x6819('0x15')],_0x5f1f06);_0x2eee07(_0x1148d0['error'](0x1f4,_0x5626bd[_0x6819('0x15')]));});});};exports[_0x6819('0x24')]=function(_0x464838){var _0xa75ec5=this;return new Promise(function(_0x1348de,_0x40ce9b){return db[_0x6819('0x19')][_0x6819('0x25')]({'where':_0x464838[_0x6819('0x1a')]?_0x464838[_0x6819('0x1a')]['where']||null:null})[_0x6819('0xc')](function(_0x3ef31e){logger[_0x6819('0xd')](_0x6819('0x24'),_0x464838);logger[_0x6819('0x10')](_0x6819('0x24'),_0x464838,JSON[_0x6819('0x12')](_0x3ef31e));_0x1348de(_0x3ef31e);})[_0x6819('0x17')](function(_0x13811a){logger['error'](_0x6819('0x24'),_0x13811a['message'],_0x464838);_0x40ce9b(_0xa75ec5['error'](0x1f4,_0x13811a[_0x6819('0x15')]));});});}; \ No newline at end of file +var _0xaa52=['jayson/promise','request','then','info','request\x20sent','debug','CmHopperBlack,\x20%s,\x20%s,\x20%s','stringify','error','message','CmHopperBlack,\x20%s,\x20%s','result','catch','GetCmHopperBlack','CmHopperBlack','findAll','options','raw','where','limit','include','map','attributes','model','UpdateCmHopperBlack','update','body','destroy','DestroyCmHopperBlack','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment'];(function(_0x1db24d,_0x4218d4){var _0x3caac4=function(_0x3ec23a){while(--_0x3ec23a){_0x1db24d['push'](_0x1db24d['shift']());}};_0x3caac4(++_0x4218d4);}(_0xaa52,0x92));var _0x2aa5=function(_0x994cac,_0x560120){_0x994cac=_0x994cac-0x0;var _0x47331a=_0xaa52[_0x994cac];return _0x47331a;};'use strict';var _=require(_0x2aa5('0x0'));var util=require(_0x2aa5('0x1'));var moment=require(_0x2aa5('0x2'));var BPromise=require(_0x2aa5('0x3'));var rs=require(_0x2aa5('0x4'));var fs=require('fs');var Redis=require(_0x2aa5('0x5'));var db=require(_0x2aa5('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x2aa5('0x7'))(_0x2aa5('0x8'));var config=require(_0x2aa5('0x9'));var jayson=require(_0x2aa5('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x582cb4,_0x5d9e0c,_0x135b79){return new BPromise(function(_0xb89096,_0x1f9dc8){return client[_0x2aa5('0xb')](_0x582cb4,_0x135b79)[_0x2aa5('0xc')](function(_0x48a044){logger[_0x2aa5('0xd')]('CmHopperBlack,\x20%s,\x20%s',_0x5d9e0c,_0x2aa5('0xe'));logger[_0x2aa5('0xf')](_0x2aa5('0x10'),_0x5d9e0c,_0x2aa5('0xe'),JSON[_0x2aa5('0x11')](_0x48a044));if(_0x48a044[_0x2aa5('0x12')]){if(_0x48a044[_0x2aa5('0x12')]['code']===0x1f4){logger['error']('CmHopperBlack,\x20%s,\x20%s',_0x5d9e0c,_0x48a044[_0x2aa5('0x12')][_0x2aa5('0x13')]);return _0x1f9dc8(_0x48a044[_0x2aa5('0x12')]['message']);}logger[_0x2aa5('0x12')]('CmHopperBlack,\x20%s,\x20%s',_0x5d9e0c,_0x48a044[_0x2aa5('0x12')][_0x2aa5('0x13')]);return _0xb89096(_0x48a044[_0x2aa5('0x12')][_0x2aa5('0x13')]);}else{logger[_0x2aa5('0xd')](_0x2aa5('0x14'),_0x5d9e0c,_0x2aa5('0xe'));_0xb89096(_0x48a044[_0x2aa5('0x15')]['message']);}})[_0x2aa5('0x16')](function(_0x3ed445){logger[_0x2aa5('0x12')]('CmHopperBlack,\x20%s,\x20%s',_0x5d9e0c,_0x3ed445);_0x1f9dc8(_0x3ed445);});});}exports[_0x2aa5('0x17')]=function(_0x487a35){var _0x355f33=this;return new Promise(function(_0x212fc5,_0x3b791a){return db[_0x2aa5('0x18')][_0x2aa5('0x19')]({'raw':_0x487a35['options']?_0x487a35[_0x2aa5('0x1a')][_0x2aa5('0x1b')]===undefined?!![]:![]:!![],'where':_0x487a35[_0x2aa5('0x1a')]?_0x487a35[_0x2aa5('0x1a')][_0x2aa5('0x1c')]||null:null,'attributes':_0x487a35[_0x2aa5('0x1a')]?_0x487a35[_0x2aa5('0x1a')]['attributes']||null:null,'limit':_0x487a35['options']?_0x487a35[_0x2aa5('0x1a')][_0x2aa5('0x1d')]||null:null,'include':_0x487a35[_0x2aa5('0x1a')]?_0x487a35['options'][_0x2aa5('0x1e')]?_[_0x2aa5('0x1f')](_0x487a35[_0x2aa5('0x1a')][_0x2aa5('0x1e')],function(_0x2a4e76){return{'model':db[_0x2a4e76['model']],'as':_0x2a4e76['as'],'attributes':_0x2a4e76[_0x2aa5('0x20')],'include':_0x2a4e76[_0x2aa5('0x1e')]?_['map'](_0x2a4e76['include'],function(_0x4c77c0){return{'model':db[_0x4c77c0[_0x2aa5('0x21')]],'as':_0x4c77c0['as'],'attributes':_0x4c77c0[_0x2aa5('0x20')],'include':_0x4c77c0[_0x2aa5('0x1e')]?_[_0x2aa5('0x1f')](_0x4c77c0['include'],function(_0x17a696){return{'model':db[_0x17a696[_0x2aa5('0x21')]],'as':_0x17a696['as'],'attributes':_0x17a696[_0x2aa5('0x20')]};}):[]};}):[]};}):[]:[]})[_0x2aa5('0xc')](function(_0x9ee581){logger[_0x2aa5('0xd')]('GetCmHopperBlack',_0x487a35);logger[_0x2aa5('0xf')](_0x2aa5('0x17'),_0x487a35,JSON['stringify'](_0x9ee581));_0x212fc5(_0x9ee581);})[_0x2aa5('0x16')](function(_0x1c7010){logger[_0x2aa5('0x12')](_0x2aa5('0x17'),_0x1c7010[_0x2aa5('0x13')],_0x487a35);_0x3b791a(_0x355f33[_0x2aa5('0x12')](0x1f4,_0x1c7010[_0x2aa5('0x13')]));});});};exports[_0x2aa5('0x22')]=function(_0x3568d6){var _0x5700a9=this;return new Promise(function(_0x5f4980,_0x54ae1f){return db[_0x2aa5('0x18')][_0x2aa5('0x23')](_0x3568d6[_0x2aa5('0x24')],{'raw':_0x3568d6[_0x2aa5('0x1a')]?_0x3568d6[_0x2aa5('0x1a')][_0x2aa5('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3568d6[_0x2aa5('0x1a')]?_0x3568d6[_0x2aa5('0x1a')][_0x2aa5('0x1c')]||null:null,'attributes':_0x3568d6[_0x2aa5('0x1a')]?_0x3568d6[_0x2aa5('0x1a')][_0x2aa5('0x20')]||null:null,'limit':_0x3568d6[_0x2aa5('0x1a')]?_0x3568d6['options'][_0x2aa5('0x1d')]||null:null})[_0x2aa5('0xc')](function(_0x153f8a){logger['info'](_0x2aa5('0x22'),_0x3568d6);logger[_0x2aa5('0xf')](_0x2aa5('0x22'),_0x3568d6,JSON[_0x2aa5('0x11')](_0x153f8a));_0x5f4980(_0x153f8a);})[_0x2aa5('0x16')](function(_0xf25b89){logger[_0x2aa5('0x12')](_0x2aa5('0x22'),_0xf25b89[_0x2aa5('0x13')],_0x3568d6);_0x54ae1f(_0x5700a9['error'](0x1f4,_0xf25b89[_0x2aa5('0x13')]));});});};exports['DestroyCmHopperBlack']=function(_0x3f348c){var _0x4602dc=this;return new Promise(function(_0x24db01,_0x475132){return db[_0x2aa5('0x18')][_0x2aa5('0x25')]({'where':_0x3f348c[_0x2aa5('0x1a')]?_0x3f348c[_0x2aa5('0x1a')][_0x2aa5('0x1c')]||null:null})[_0x2aa5('0xc')](function(_0x1b5333){logger[_0x2aa5('0xd')]('DestroyCmHopperBlack',_0x3f348c);logger['debug'](_0x2aa5('0x26'),_0x3f348c,JSON[_0x2aa5('0x11')](_0x1b5333));_0x24db01(_0x1b5333);})[_0x2aa5('0x16')](function(_0x2aa761){logger[_0x2aa5('0x12')]('DestroyCmHopperBlack',_0x2aa761[_0x2aa5('0x13')],_0x3f348c);_0x475132(_0x4602dc['error'](0x1f4,_0x2aa761[_0x2aa5('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/index.js b/server/api/cmHopperBlack/index.js index e42bed9..1ee3946 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 _0x82c4=['get','/describe','describe','show','put','/:id','update','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./cmHopperBlack.controller','isAuthenticated'];(function(_0x507a5f,_0x3c6743){var _0x4840d7=function(_0x532fb9){while(--_0x532fb9){_0x507a5f['push'](_0x507a5f['shift']());}};_0x4840d7(++_0x3c6743);}(_0x82c4,0x1ca));var _0x482c=function(_0x2ccdb9,_0x3ded46){_0x2ccdb9=_0x2ccdb9-0x0;var _0x4e8120=_0x82c4[_0x2ccdb9];return _0x4e8120;};'use strict';var multer=require(_0x482c('0x0'));var util=require(_0x482c('0x1'));var path=require(_0x482c('0x2'));var timeout=require(_0x482c('0x3'));var express=require(_0x482c('0x4'));var router=express[_0x482c('0x5')]();var fs_extra=require(_0x482c('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x482c('0x7'));var config=require('../../config/environment');var controller=require(_0x482c('0x8'));router['get']('/',auth[_0x482c('0x9')](),controller['index']);router[_0x482c('0xa')](_0x482c('0xb'),auth[_0x482c('0x9')](),controller[_0x482c('0xc')]);router[_0x482c('0xa')]('/:id',auth[_0x482c('0x9')](),controller[_0x482c('0xd')]);router[_0x482c('0xe')](_0x482c('0xf'),auth[_0x482c('0x9')](),controller[_0x482c('0x10')]);router['delete'](_0x482c('0xf'),auth[_0x482c('0x9')](),controller[_0x482c('0x11')]);module['exports']=router; \ No newline at end of file +var _0xd046=['isAuthenticated','destroy','exports','util','path','connect-timeout','Router','../../components/interaction/service','./cmHopperBlack.controller','index','get','describe','show','/:id'];(function(_0x20ef64,_0x4a8fe9){var _0x3707d8=function(_0x5b9a88){while(--_0x5b9a88){_0x20ef64['push'](_0x20ef64['shift']());}};_0x3707d8(++_0x4a8fe9);}(_0xd046,0x129));var _0x6d04=function(_0x295e2e,_0x5c02ba){_0x295e2e=_0x295e2e-0x0;var _0x2619e9=_0xd046[_0x295e2e];return _0x2619e9;};'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['put'](_0x6d04('0xa'),auth['isAuthenticated'](),controller['update']);router['delete'](_0x6d04('0xa'),auth[_0x6d04('0xb')](),controller[_0x6d04('0xc')]);module[_0x6d04('0xd')]=router; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.attributes.js b/server/api/cmHopperFinal/cmHopperFinal.attributes.js index c9d9095..e4ae3c0 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 _0x836a=['endtime','setDataValue','followuptime','diff','seconds','dispositionat','BOOLEAN','sequelize','moment','exports','STRING','DATE','INTEGER','getDataValue'];(function(_0x408f07,_0x455737){var _0x35ce48=function(_0x2a42c4){while(--_0x2a42c4){_0x408f07['push'](_0x408f07['shift']());}};_0x35ce48(++_0x455737);}(_0x836a,0xcb));var _0xa836=function(_0x9dd8ae,_0x1f1c66){_0x9dd8ae=_0x9dd8ae-0x0;var _0x45f3ee=_0x836a[_0x9dd8ae];return _0x45f3ee;};'use strict';var Sequelize=require(_0xa836('0x0'));var moment=require(_0xa836('0x1'));module[_0xa836('0x2')]={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize[_0xa836('0x3')]},'scheduledat':{'type':Sequelize[_0xa836('0x4')]},'countbusyretry':{'type':Sequelize[_0xa836('0x5')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xa836('0x5')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xa836('0x5')],'defaultValue':0x0},'countglobal':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0xa836('0x3')]},'originatecalleridnum':{'type':Sequelize['STRING']},'originatecalleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0xa836('0x3')]},'calleridname':{'type':Sequelize[_0xa836('0x3')]},'starttime':{'type':Sequelize[_0xa836('0x4')]},'responsetime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize[_0xa836('0x4')]},'droptime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0xa836('0x4')]},'ringtime':{'type':Sequelize[_0xa836('0x5')],'defaultValue':0x0},'holdtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'talktime':{'type':Sequelize[_0xa836('0x5')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0xa836('0x5')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0xa836('0x3')]},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0xa836('0x3')]},'reason':{'type':Sequelize[_0xa836('0x3')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0xa836('0x3')]},'thirdDisposition':{'type':Sequelize[_0xa836('0x3')]},'dispositionat':{'type':Sequelize[_0xa836('0x4')],'set':function(_0x33495e){var _0x1bd5ff=this[_0xa836('0x6')](_0xa836('0x7'));if(_0x1bd5ff&&_0x33495e){this[_0xa836('0x8')](_0xa836('0x9'),moment(_0x33495e)[_0xa836('0xa')](moment(_0x1bd5ff),_0xa836('0xb')));}return this[_0xa836('0x8')](_0xa836('0xc'),_0x33495e);}},'amd':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fax':{'type':Sequelize[_0xa836('0xd')],'defaultValue':![]},'blacklist':{'type':Sequelize[_0xa836('0xd')],'defaultValue':![]},'rescheduled':{'type':Sequelize[_0xa836('0xd')],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0xa836('0x4')]},'callback':{'type':Sequelize[_0xa836('0xd')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xa836('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize[_0xa836('0x4')]},'deleted':{'type':Sequelize[_0xa836('0x3')],'defaultValue':null},'deletedat':{'type':Sequelize['DATE']},'recallme':{'type':Sequelize[_0xa836('0xd')],'defaultValue':![]},'agiafterat':{'type':Sequelize[_0xa836('0x4')]},'countnosuchnumberretry':{'type':Sequelize[_0xa836('0x5')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xa836('0x5')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xa836('0x5')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0xb042=['followuptime','diff','seconds','dispositionat','BOOLEAN','sequelize','exports','DATE','INTEGER','STRING','setDataValue'];(function(_0x23d129,_0x28b1d2){var _0x2ce9b7=function(_0x1a07ec){while(--_0x1a07ec){_0x23d129['push'](_0x23d129['shift']());}};_0x2ce9b7(++_0x28b1d2);}(_0xb042,0x9f));var _0x2b04=function(_0x53abe5,_0x33a9e5){_0x53abe5=_0x53abe5-0x0;var _0xc1c37e=_0xb042[_0x53abe5];return _0xc1c37e;};'use strict';var Sequelize=require(_0x2b04('0x0'));var moment=require('moment');module[_0x2b04('0x1')]={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize['STRING']},'scheduledat':{'type':Sequelize[_0x2b04('0x2')]},'countbusyretry':{'type':Sequelize[_0x2b04('0x3')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x2b04('0x3')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x2b04('0x3')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x2b04('0x3')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x2b04('0x4')]},'originatecalleridnum':{'type':Sequelize['STRING']},'originatecalleridname':{'type':Sequelize[_0x2b04('0x4')]},'calleridnum':{'type':Sequelize[_0x2b04('0x4')]},'calleridname':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0x2b04('0x2')]},'responsetime':{'type':Sequelize[_0x2b04('0x2')]},'answertime':{'type':Sequelize[_0x2b04('0x2')]},'droptime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0x2b04('0x2')]},'ringtime':{'type':Sequelize[_0x2b04('0x3')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x2b04('0x3')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x2b04('0x3')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x2b04('0x3')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x2b04('0x4')]},'campaign':{'type':Sequelize[_0x2b04('0x4')]},'campaigntype':{'type':Sequelize[_0x2b04('0x4')]},'membername':{'type':Sequelize[_0x2b04('0x4')]},'reason':{'type':Sequelize[_0x2b04('0x4')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x2b04('0x4')]},'thirdDisposition':{'type':Sequelize[_0x2b04('0x4')]},'dispositionat':{'type':Sequelize[_0x2b04('0x2')],'set':function(_0x1fc102){var _0xb52b8d=this['getDataValue']('endtime');if(_0xb52b8d&&_0x1fc102){this[_0x2b04('0x5')](_0x2b04('0x6'),moment(_0x1fc102)[_0x2b04('0x7')](moment(_0xb52b8d),_0x2b04('0x8')));}return this[_0x2b04('0x5')](_0x2b04('0x9'),_0x1fc102);}},'amd':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fax':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'blacklist':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'rescheduled':{'type':Sequelize[_0x2b04('0xa')],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0x2b04('0x2')]},'callback':{'type':Sequelize[_0x2b04('0xa')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x2b04('0x4')],'defaultValue':null},'callbackat':{'type':Sequelize['DATE']},'deleted':{'type':Sequelize[_0x2b04('0x4')],'defaultValue':null},'deletedat':{'type':Sequelize[_0x2b04('0x2')]},'recallme':{'type':Sequelize[_0x2b04('0xa')],'defaultValue':![]},'agiafterat':{'type':Sequelize[_0x2b04('0x2')]},'countnosuchnumberretry':{'type':Sequelize[_0x2b04('0x3')],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x2b04('0x3')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x2b04('0x3')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.controller.js b/server/api/cmHopperFinal/cmHopperFinal.controller.js index ec96003..a8aa81a 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 _0x687b=['filter','VIRTUAL','options','include','findAll','rows','show','length','includeAll','merge','find','catch','describe','body','uniqueid','params','countContactsQueueCampaignHopperFinal','sequelize','COUNT','literal','`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','`state`\x20=\x200,\x201,\x20null','`state`\x20=\x2010\x20,\x201,\x20null','`state`\x20=\x2019,\x201,\x20null','moveContactsQueueCampaignHopperFinal','into','fromQuery','phone','scheduledAt','ContactId','ListId','VoiceQueueId','createdAt','updatedAt','field','ANY_VALUE(calleridnum)','NOW()','ANY_VALUE(ContactId)','ANY_VALUE(ListId)','ANY_VALUE(VoiceQueueId)','from','VoiceQueueId\x20=\x20?','toString','state','calleridnum\x20IS\x20NOT\x20NULL','calleridnum\x20NOT\x20IN\x20(?)','select','cm_hopper_final','state\x20=\x204','group','Campaign','cm_hopper','CampaignId','CampaignId\x20=\x20?','state\x20=\x20?','calleridnum','checkContactHopper','CmHopper','findOne','eml-format','rimraf','zip-dir','fast-json-patch','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','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','Content-Range','save','update','then','destroy','end','error','stack','name','send','index','map','CmHopperFinal','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where'];(function(_0xe39824,_0xbdf61f){var _0x4bc31e=function(_0x594760){while(--_0x594760){_0xe39824['push'](_0xe39824['shift']());}};_0x4bc31e(++_0xbdf61f);}(_0x687b,0x14a));var _0xb687=function(_0x326e79,_0x33dc91){_0x326e79=_0x326e79-0x0;var _0x37eb89=_0x687b[_0x326e79];return _0x37eb89;};'use strict';var emlformat=require(_0xb687('0x0'));var rimraf=require(_0xb687('0x1'));var zipdir=require(_0xb687('0x2'));var jsonpatch=require(_0xb687('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xb687('0x4'));var Mustache=require(_0xb687('0x5'));var util=require(_0xb687('0x6'));var path=require(_0xb687('0x7'));var sox=require(_0xb687('0x8'));var csv=require(_0xb687('0x9'));var ejs=require(_0xb687('0xa'));var fs=require('fs');var fs_extra=require(_0xb687('0xb'));var _=require(_0xb687('0xc'));var squel=require(_0xb687('0xd'));var crypto=require('crypto');var jsforce=require(_0xb687('0xe'));var deskjs=require(_0xb687('0xf'));var toCsv=require('to-csv');var querystring=require(_0xb687('0x10'));var Papa=require(_0xb687('0x11'));var Redis=require(_0xb687('0x12'));var authService=require(_0xb687('0x13'));var qs=require(_0xb687('0x14'));var as=require(_0xb687('0x15'));var hardwareService=require(_0xb687('0x16'));var logger=require(_0xb687('0x17'))(_0xb687('0x18'));var utils=require('../../config/utils');var config=require(_0xb687('0x19'));var licenseUtil=require(_0xb687('0x1a'));var db=require(_0xb687('0x1b'))['db'];function respondWithStatusCode(_0x12a0be,_0x4f9c19){_0x4f9c19=_0x4f9c19||0xcc;return function(_0x4c97ed){if(_0x4c97ed){return _0x12a0be[_0xb687('0x1c')](_0x4f9c19);}return _0x12a0be[_0xb687('0x1d')](_0x4f9c19)['end']();};}function respondWithResult(_0x108fd0,_0x2f1ac0){_0x2f1ac0=_0x2f1ac0||0xc8;return function(_0x1f1f35){if(_0x1f1f35){return _0x108fd0[_0xb687('0x1d')](_0x2f1ac0)[_0xb687('0x1e')](_0x1f1f35);}};}function respondWithFilteredResult(_0x3ab914,_0x30622f){return function(_0x141375){if(_0x141375){var _0x263085=typeof _0x30622f[_0xb687('0x1f')]===_0xb687('0x20')&&typeof _0x30622f[_0xb687('0x21')]==='undefined';var _0x214b06=_0x141375[_0xb687('0x22')];var _0x30d370=_0x263085?0x0:_0x30622f['offset'];var _0x48958d=_0x263085?_0x141375[_0xb687('0x22')]:_0x30622f[_0xb687('0x1f')]+_0x30622f[_0xb687('0x21')];var _0x4b593b;if(_0x48958d>=_0x214b06){_0x48958d=_0x214b06;_0x4b593b=0xc8;}else{_0x4b593b=0xce;}_0x3ab914[_0xb687('0x1d')](_0x4b593b);return _0x3ab914['set'](_0xb687('0x23'),_0x30d370+'-'+_0x48958d+'/'+_0x214b06)[_0xb687('0x1e')](_0x141375);}return null;};}function patchUpdates(_0x170dc0){return function(_0x44bd0b){try{jsonpatch['apply'](_0x44bd0b,_0x170dc0,!![]);}catch(_0x3a73d5){return BPromise['reject'](_0x3a73d5);}return _0x44bd0b[_0xb687('0x24')]();};}function saveUpdates(_0x90e892,_0x274241){return function(_0x546fde){if(_0x546fde){return _0x546fde[_0xb687('0x25')](_0x90e892)[_0xb687('0x26')](function(_0xa95e91){return _0xa95e91;});}return null;};}function removeEntity(_0x16cdcb,_0xbf6c58){return function(_0x38866c){if(_0x38866c){return _0x38866c[_0xb687('0x27')]()[_0xb687('0x26')](function(){_0x16cdcb['status'](0xcc)[_0xb687('0x28')]();});}};}function handleEntityNotFound(_0x129347,_0x1c1585){return function(_0x1a0261){if(!_0x1a0261){_0x129347[_0xb687('0x1c')](0x194);}return _0x1a0261;};}function handleError(_0x4136c9,_0x17ff2b){_0x17ff2b=_0x17ff2b||0x1f4;return function(_0x3cb2f2){logger[_0xb687('0x29')](_0x3cb2f2[_0xb687('0x2a')]);if(_0x3cb2f2['name']){delete _0x3cb2f2[_0xb687('0x2b')];}_0x4136c9[_0xb687('0x1d')](_0x17ff2b)[_0xb687('0x2c')](_0x3cb2f2);};}exports[_0xb687('0x2d')]=function(_0x2e5c8d,_0x173c58){var _0x4e9a06={},_0x28b69a={},_0x5143af={'count':0x0,'rows':[]};var _0x360429=_[_0xb687('0x2e')](db[_0xb687('0x2f')][_0xb687('0x30')],function(_0x1ad3ef){return{'name':_0x1ad3ef[_0xb687('0x31')],'type':_0x1ad3ef[_0xb687('0x32')]['key']};});_0x28b69a[_0xb687('0x33')]=_[_0xb687('0x2e')](_0x360429,_0xb687('0x2b'));_0x28b69a[_0xb687('0x34')]=_[_0xb687('0x35')](_0x2e5c8d[_0xb687('0x34')]);_0x28b69a[_0xb687('0x36')]=_[_0xb687('0x37')](_0x28b69a[_0xb687('0x33')],_0x28b69a[_0xb687('0x34')]);_0x4e9a06[_0xb687('0x38')]=_['intersection'](_0x28b69a['model'],qs[_0xb687('0x39')](_0x2e5c8d[_0xb687('0x34')][_0xb687('0x39')]));_0x4e9a06[_0xb687('0x38')]=_0x4e9a06['attributes']['length']?_0x4e9a06[_0xb687('0x38')]:_0x28b69a[_0xb687('0x33')];if(!_0x2e5c8d['query'][_0xb687('0x3a')](_0xb687('0x3b'))){_0x4e9a06['limit']=qs[_0xb687('0x21')](_0x2e5c8d['query'][_0xb687('0x21')]);_0x4e9a06[_0xb687('0x1f')]=qs[_0xb687('0x1f')](_0x2e5c8d[_0xb687('0x34')][_0xb687('0x1f')]);}_0x4e9a06[_0xb687('0x3c')]=qs['sort'](_0x2e5c8d[_0xb687('0x34')][_0xb687('0x3d')]);_0x4e9a06[_0xb687('0x3e')]=qs[_0xb687('0x36')](_['pick'](_0x2e5c8d[_0xb687('0x34')],_0x28b69a[_0xb687('0x36')]),_0x360429);if(_0x2e5c8d[_0xb687('0x34')][_0xb687('0x3f')]){_0x4e9a06[_0xb687('0x3e')]=_['merge'](_0x4e9a06[_0xb687('0x3e')],{'$or':_[_0xb687('0x2e')](_0x360429,function(_0x24c013){if(_0x24c013[_0xb687('0x32')]!==_0xb687('0x40')){var _0x29cf09={};_0x29cf09[_0x24c013['name']]={'$like':'%'+_0x2e5c8d['query'][_0xb687('0x3f')]+'%'};return _0x29cf09;}})});}_0x4e9a06=_['merge']({},_0x4e9a06,_0x2e5c8d[_0xb687('0x41')]);var _0x2f4550={'where':_0x4e9a06['where']};return db[_0xb687('0x2f')][_0xb687('0x22')](_0x2f4550)['then'](function(_0x394b56){_0x5143af[_0xb687('0x22')]=_0x394b56;if(_0x2e5c8d[_0xb687('0x34')]['includeAll']){_0x4e9a06[_0xb687('0x42')]=[{'all':!![]}];}return db[_0xb687('0x2f')][_0xb687('0x43')](_0x4e9a06);})[_0xb687('0x26')](function(_0x140388){_0x5143af[_0xb687('0x44')]=_0x140388;return _0x5143af;})[_0xb687('0x26')](respondWithFilteredResult(_0x173c58,_0x4e9a06))['catch'](handleError(_0x173c58,null));};exports[_0xb687('0x45')]=function(_0x4cf6ad,_0x50fdb7){var _0xa3a9e0={'raw':!![],'where':{'id':_0x4cf6ad['params']['id']}},_0x430364={};_0x430364[_0xb687('0x33')]=_['keys'](db[_0xb687('0x2f')][_0xb687('0x30')]);_0x430364['query']=_[_0xb687('0x35')](_0x4cf6ad[_0xb687('0x34')]);_0x430364['filters']=_[_0xb687('0x37')](_0x430364[_0xb687('0x33')],_0x430364[_0xb687('0x34')]);_0xa3a9e0[_0xb687('0x38')]=_[_0xb687('0x37')](_0x430364[_0xb687('0x33')],qs[_0xb687('0x39')](_0x4cf6ad[_0xb687('0x34')][_0xb687('0x39')]));_0xa3a9e0[_0xb687('0x38')]=_0xa3a9e0[_0xb687('0x38')][_0xb687('0x46')]?_0xa3a9e0['attributes']:_0x430364[_0xb687('0x33')];if(_0x4cf6ad['query'][_0xb687('0x47')]){_0xa3a9e0[_0xb687('0x42')]=[{'all':!![]}];}_0xa3a9e0=_[_0xb687('0x48')]({},_0xa3a9e0,_0x4cf6ad[_0xb687('0x41')]);return db[_0xb687('0x2f')][_0xb687('0x49')](_0xa3a9e0)['then'](handleEntityNotFound(_0x50fdb7,null))['then'](respondWithResult(_0x50fdb7,null))[_0xb687('0x4a')](handleError(_0x50fdb7,null));};exports[_0xb687('0x4b')]=function(_0x40558a,_0x4f3069){return db['CmHopperFinal'][_0xb687('0x4b')]()[_0xb687('0x26')](respondWithResult(_0x4f3069,null))[_0xb687('0x4a')](handleError(_0x4f3069,null));};exports[_0xb687('0x25')]=function(_0x535c00,_0x33a0b0){if(_0x535c00[_0xb687('0x4c')][_0xb687('0x4d')]){delete _0x535c00[_0xb687('0x4c')]['uniqueid'];}return db['CmHopperFinal'][_0xb687('0x49')]({'where':{'uniqueid':_0x535c00[_0xb687('0x4e')]['id']}})[_0xb687('0x26')](handleEntityNotFound(_0x33a0b0,null))['then'](saveUpdates(_0x535c00['body'],null))[_0xb687('0x26')](respondWithResult(_0x33a0b0,null))[_0xb687('0x4a')](handleError(_0x33a0b0,null));};exports[_0xb687('0x4f')]=function(_0x22e618,_0x34205d,_0x1fb31a){return db[_0xb687('0x2f')][_0xb687('0x43')]({'raw':![],'where':{'VoiceQueueId':_0x22e618['params']['id']},'attributes':[[db[_0xb687('0x50')]['fn'](_0xb687('0x51'),db[_0xb687('0x50')]['fn']('IF',db['sequelize']['literal']('`state`\x20=\x200,\x201,\x20null'))),'noSuchContacts'],[db[_0xb687('0x50')]['fn'](_0xb687('0x51'),db[_0xb687('0x50')]['fn']('IF',db[_0xb687('0x50')][_0xb687('0x52')](_0xb687('0x53')))),_0xb687('0x54')],[db[_0xb687('0x50')]['fn'](_0xb687('0x51'),db[_0xb687('0x50')]['fn']('IF',db[_0xb687('0x50')][_0xb687('0x52')](_0xb687('0x55')))),_0xb687('0x56')],[db[_0xb687('0x50')]['fn'](_0xb687('0x51'),db[_0xb687('0x50')]['fn']('IF',db['sequelize']['literal'](_0xb687('0x57')))),_0xb687('0x58')],[db[_0xb687('0x50')]['fn'](_0xb687('0x51'),db['sequelize']['fn']('IF',db[_0xb687('0x50')][_0xb687('0x52')]('`state`\x20=\x2010\x20,\x201,\x20null'))),_0xb687('0x59')],[db['sequelize']['fn'](_0xb687('0x51'),db[_0xb687('0x50')]['fn']('IF',db['sequelize']['literal'](_0xb687('0x5a')))),_0xb687('0x5b')],[db['sequelize']['fn'](_0xb687('0x51'),db[_0xb687('0x50')]['fn']('IF',db[_0xb687('0x50')]['literal'](_0xb687('0x5c')))),'reCallContacts'],[db[_0xb687('0x50')]['fn'](_0xb687('0x51'),db[_0xb687('0x50')]['fn']('IF',db[_0xb687('0x50')][_0xb687('0x52')]('`state`\x20=\x2019,\x201,\x20null'))),'answeringMachine']]})[_0xb687('0x26')](handleEntityNotFound(_0x34205d,null))['then'](respondWithResult(_0x34205d,null))['catch'](handleError(_0x34205d,null));};exports['countContactsIvrCampaignHopperFinal']=function(_0x5d266c,_0x1cc507,_0x1db4ca){return db[_0xb687('0x2f')][_0xb687('0x43')]({'raw':![],'where':{'CampaignId':_0x5d266c[_0xb687('0x4e')]['id']},'attributes':[[db[_0xb687('0x50')]['fn'](_0xb687('0x51'),db[_0xb687('0x50')]['fn']('IF',db[_0xb687('0x50')][_0xb687('0x52')](_0xb687('0x5d')))),'noSuchContacts'],[db['sequelize']['fn'](_0xb687('0x51'),db['sequelize']['fn']('IF',db[_0xb687('0x50')][_0xb687('0x52')](_0xb687('0x53')))),_0xb687('0x54')],[db[_0xb687('0x50')]['fn']('COUNT',db[_0xb687('0x50')]['fn']('IF',db['sequelize'][_0xb687('0x52')](_0xb687('0x55')))),_0xb687('0x56')],[db[_0xb687('0x50')]['fn'](_0xb687('0x51'),db[_0xb687('0x50')]['fn']('IF',db[_0xb687('0x50')]['literal'](_0xb687('0x57')))),_0xb687('0x58')],[db[_0xb687('0x50')]['fn'](_0xb687('0x51'),db[_0xb687('0x50')]['fn']('IF',db['sequelize'][_0xb687('0x52')](_0xb687('0x5e')))),_0xb687('0x59')],[db[_0xb687('0x50')]['fn'](_0xb687('0x51'),db[_0xb687('0x50')]['fn']('IF',db[_0xb687('0x50')][_0xb687('0x52')](_0xb687('0x5a')))),_0xb687('0x5b')],[db[_0xb687('0x50')]['fn']('COUNT',db[_0xb687('0x50')]['fn']('IF',db[_0xb687('0x50')][_0xb687('0x52')](_0xb687('0x5c')))),'reCallContacts'],[db[_0xb687('0x50')]['fn'](_0xb687('0x51'),db['sequelize']['fn']('IF',db[_0xb687('0x50')][_0xb687('0x52')](_0xb687('0x5f')))),'answeringMachine']]})[_0xb687('0x26')](handleEntityNotFound(_0x1cc507,null))[_0xb687('0x26')](respondWithResult(_0x1cc507,null))['catch'](handleError(_0x1cc507,null));};exports[_0xb687('0x60')]=function(_0x5449c4,_0x2c2add,_0x431cc5){return db['VoiceQueue'][_0xb687('0x49')]({'where':{'id':_0x5449c4[_0xb687('0x4e')]['id']}})['then'](handleEntityNotFound(_0x2c2add,null))[_0xb687('0x26')](function(_0x1736ef){var _0x52285e;if(_0x1736ef){_0x52285e=squel['insert']()[_0xb687('0x61')]('cm_hopper')[_0xb687('0x62')]([_0xb687('0x63'),_0xb687('0x64'),_0xb687('0x65'),_0xb687('0x66'),_0xb687('0x67'),_0xb687('0x68'),_0xb687('0x69')],squel['select']()[_0xb687('0x6a')](_0xb687('0x6b'),_0xb687('0x63'))[_0xb687('0x6a')](_0xb687('0x6c'),_0xb687('0x64'))['field'](_0xb687('0x6d'),_0xb687('0x65'))['field'](_0xb687('0x6e'),_0xb687('0x66'))[_0xb687('0x6a')](_0xb687('0x6f'),'VoiceQueueId')[_0xb687('0x6a')]('NOW()','createdAt')[_0xb687('0x6a')]('NOW()','updatedAt')[_0xb687('0x70')]('cm_hopper_final')[_0xb687('0x3e')](_0xb687('0x71'),_0x5449c4['params']['id'][_0xb687('0x72')]())[_0xb687('0x3e')]('state\x20=\x20?',_0x5449c4[_0xb687('0x4c')][_0xb687('0x73')][_0xb687('0x72')]())[_0xb687('0x3e')](_0xb687('0x74'))[_0xb687('0x3e')](_0xb687('0x75'),squel[_0xb687('0x76')]()[_0xb687('0x6a')](_0xb687('0x63'))[_0xb687('0x70')]('cm_hopper')[_0xb687('0x3e')]('VoiceQueueId\x20=\x20?',_0x5449c4['params']['id'][_0xb687('0x72')]()))[_0xb687('0x3e')](_0xb687('0x75'),squel[_0xb687('0x76')]()[_0xb687('0x6a')]('calleridnum')['from'](_0xb687('0x77'))[_0xb687('0x3e')](_0xb687('0x71'),_0x5449c4[_0xb687('0x4e')]['id']['toString']())[_0xb687('0x3e')](_0xb687('0x78')))[_0xb687('0x79')](_0xb687('0x65')))[_0xb687('0x72')]();return db[_0xb687('0x50')][_0xb687('0x34')](_0x52285e);}return[];})[_0xb687('0x26')](respondWithResult(_0x2c2add,null))[_0xb687('0x4a')](handleError(_0x2c2add,null));};exports['moveContactsIvrCampaignHopperFinal']=function(_0x25f5c3,_0x33d1fc,_0x207953){return db[_0xb687('0x7a')][_0xb687('0x49')]({'where':{'id':_0x25f5c3['params']['id']}})[_0xb687('0x26')](handleEntityNotFound(_0x33d1fc,null))[_0xb687('0x26')](function(_0x48bbee){var _0x19ac6d;if(_0x48bbee){_0x19ac6d=squel['insert']()[_0xb687('0x61')](_0xb687('0x7b'))['fromQuery']([_0xb687('0x63'),_0xb687('0x64'),'ContactId',_0xb687('0x66'),_0xb687('0x7c'),_0xb687('0x68'),_0xb687('0x69')],squel[_0xb687('0x76')]()[_0xb687('0x6a')]('ANY_VALUE(calleridnum)',_0xb687('0x63'))[_0xb687('0x6a')](_0xb687('0x6c'),_0xb687('0x64'))[_0xb687('0x6a')](_0xb687('0x6d'),_0xb687('0x65'))[_0xb687('0x6a')](_0xb687('0x6e'),_0xb687('0x66'))[_0xb687('0x6a')]('ANY_VALUE(CampaignId)',_0xb687('0x7c'))['field'](_0xb687('0x6c'),_0xb687('0x68'))['field']('NOW()',_0xb687('0x69'))[_0xb687('0x70')](_0xb687('0x77'))[_0xb687('0x3e')](_0xb687('0x7d'),_0x25f5c3[_0xb687('0x4e')]['id'][_0xb687('0x72')]())[_0xb687('0x3e')](_0xb687('0x7e'),_0x25f5c3[_0xb687('0x4c')][_0xb687('0x73')][_0xb687('0x72')]())[_0xb687('0x3e')](_0xb687('0x74'))[_0xb687('0x3e')](_0xb687('0x75'),squel['select']()['field'](_0xb687('0x63'))['from']('cm_hopper')[_0xb687('0x3e')](_0xb687('0x7d'),_0x25f5c3['params']['id'][_0xb687('0x72')]()))[_0xb687('0x3e')]('calleridnum\x20NOT\x20IN\x20(?)',squel[_0xb687('0x76')]()[_0xb687('0x6a')](_0xb687('0x7f'))[_0xb687('0x70')](_0xb687('0x77'))[_0xb687('0x3e')](_0xb687('0x7d'),_0x25f5c3[_0xb687('0x4e')]['id'][_0xb687('0x72')]())['where'](_0xb687('0x78')))[_0xb687('0x79')]('ContactId'))[_0xb687('0x72')]();return db['sequelize'][_0xb687('0x34')](_0x19ac6d);}return[];})[_0xb687('0x26')](respondWithResult(_0x33d1fc,null))['catch'](handleError(_0x33d1fc,null));};exports[_0xb687('0x80')]=function(_0x20e46a,_0x1c389f,_0x45d0ab){return db[_0xb687('0x81')][_0xb687('0x82')]({'where':{'VoiceQueueId':_0x20e46a[_0xb687('0x4c')]['VoiceQueueId'],'CampaignId':_0x20e46a['body'][_0xb687('0x7c')],'ContactId':_0x20e46a['body'][_0xb687('0x65')]}})[_0xb687('0x26')](handleEntityNotFound(_0x1c389f,null))[_0xb687('0x26')](function(_0x312529){if(_0x312529){return _0x312529;}return null;})['then'](respondWithResult(_0x1c389f,null))[_0xb687('0x4a')](handleError(_0x1c389f,null));}; \ No newline at end of file +var _0x687b=['filter','VIRTUAL','options','include','findAll','rows','show','length','includeAll','merge','find','catch','describe','body','uniqueid','params','countContactsQueueCampaignHopperFinal','sequelize','COUNT','literal','`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','`state`\x20=\x200,\x201,\x20null','`state`\x20=\x2010\x20,\x201,\x20null','`state`\x20=\x2019,\x201,\x20null','moveContactsQueueCampaignHopperFinal','into','fromQuery','phone','scheduledAt','ContactId','ListId','VoiceQueueId','createdAt','updatedAt','field','ANY_VALUE(calleridnum)','NOW()','ANY_VALUE(ContactId)','ANY_VALUE(ListId)','ANY_VALUE(VoiceQueueId)','from','VoiceQueueId\x20=\x20?','toString','state','calleridnum\x20IS\x20NOT\x20NULL','calleridnum\x20NOT\x20IN\x20(?)','select','cm_hopper_final','state\x20=\x204','group','Campaign','cm_hopper','CampaignId','CampaignId\x20=\x20?','state\x20=\x20?','calleridnum','checkContactHopper','CmHopper','findOne','eml-format','rimraf','zip-dir','fast-json-patch','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','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','Content-Range','save','update','then','destroy','end','error','stack','name','send','index','map','CmHopperFinal','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where'];(function(_0x5d8631,_0x44944b){var _0x34c15e=function(_0x4448f8){while(--_0x4448f8){_0x5d8631['push'](_0x5d8631['shift']());}};_0x34c15e(++_0x44944b);}(_0x687b,0x14a));var _0xb687=function(_0x5d5d25,_0x3b8c9d){_0x5d5d25=_0x5d5d25-0x0;var _0x4b25ca=_0x687b[_0x5d5d25];return _0x4b25ca;};'use strict';var emlformat=require(_0xb687('0x0'));var rimraf=require(_0xb687('0x1'));var zipdir=require(_0xb687('0x2'));var jsonpatch=require(_0xb687('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xb687('0x4'));var Mustache=require(_0xb687('0x5'));var util=require(_0xb687('0x6'));var path=require(_0xb687('0x7'));var sox=require(_0xb687('0x8'));var csv=require(_0xb687('0x9'));var ejs=require(_0xb687('0xa'));var fs=require('fs');var fs_extra=require(_0xb687('0xb'));var _=require(_0xb687('0xc'));var squel=require(_0xb687('0xd'));var crypto=require('crypto');var jsforce=require(_0xb687('0xe'));var deskjs=require(_0xb687('0xf'));var toCsv=require('to-csv');var querystring=require(_0xb687('0x10'));var Papa=require(_0xb687('0x11'));var Redis=require(_0xb687('0x12'));var authService=require(_0xb687('0x13'));var qs=require(_0xb687('0x14'));var as=require(_0xb687('0x15'));var hardwareService=require(_0xb687('0x16'));var logger=require(_0xb687('0x17'))(_0xb687('0x18'));var utils=require('../../config/utils');var config=require(_0xb687('0x19'));var licenseUtil=require(_0xb687('0x1a'));var db=require(_0xb687('0x1b'))['db'];function respondWithStatusCode(_0x12a0be,_0x4f9c19){_0x4f9c19=_0x4f9c19||0xcc;return function(_0x4c97ed){if(_0x4c97ed){return _0x12a0be[_0xb687('0x1c')](_0x4f9c19);}return _0x12a0be[_0xb687('0x1d')](_0x4f9c19)['end']();};}function respondWithResult(_0x108fd0,_0x2f1ac0){_0x2f1ac0=_0x2f1ac0||0xc8;return function(_0x1f1f35){if(_0x1f1f35){return _0x108fd0[_0xb687('0x1d')](_0x2f1ac0)[_0xb687('0x1e')](_0x1f1f35);}};}function respondWithFilteredResult(_0x3ab914,_0x30622f){return function(_0x141375){if(_0x141375){var _0x263085=typeof _0x30622f[_0xb687('0x1f')]===_0xb687('0x20')&&typeof _0x30622f[_0xb687('0x21')]==='undefined';var _0x214b06=_0x141375[_0xb687('0x22')];var _0x30d370=_0x263085?0x0:_0x30622f['offset'];var _0x48958d=_0x263085?_0x141375[_0xb687('0x22')]:_0x30622f[_0xb687('0x1f')]+_0x30622f[_0xb687('0x21')];var _0x4b593b;if(_0x48958d>=_0x214b06){_0x48958d=_0x214b06;_0x4b593b=0xc8;}else{_0x4b593b=0xce;}_0x3ab914[_0xb687('0x1d')](_0x4b593b);return _0x3ab914['set'](_0xb687('0x23'),_0x30d370+'-'+_0x48958d+'/'+_0x214b06)[_0xb687('0x1e')](_0x141375);}return null;};}function patchUpdates(_0x170dc0){return function(_0x44bd0b){try{jsonpatch['apply'](_0x44bd0b,_0x170dc0,!![]);}catch(_0x3a73d5){return BPromise['reject'](_0x3a73d5);}return _0x44bd0b[_0xb687('0x24')]();};}function saveUpdates(_0x90e892,_0x274241){return function(_0x546fde){if(_0x546fde){return _0x546fde[_0xb687('0x25')](_0x90e892)[_0xb687('0x26')](function(_0xa95e91){return _0xa95e91;});}return null;};}function removeEntity(_0x16cdcb,_0xbf6c58){return function(_0x38866c){if(_0x38866c){return _0x38866c[_0xb687('0x27')]()[_0xb687('0x26')](function(){_0x16cdcb['status'](0xcc)[_0xb687('0x28')]();});}};}function handleEntityNotFound(_0x129347,_0x1c1585){return function(_0x1a0261){if(!_0x1a0261){_0x129347[_0xb687('0x1c')](0x194);}return _0x1a0261;};}function handleError(_0x4136c9,_0x17ff2b){_0x17ff2b=_0x17ff2b||0x1f4;return function(_0x3cb2f2){logger[_0xb687('0x29')](_0x3cb2f2[_0xb687('0x2a')]);if(_0x3cb2f2['name']){delete _0x3cb2f2[_0xb687('0x2b')];}_0x4136c9[_0xb687('0x1d')](_0x17ff2b)[_0xb687('0x2c')](_0x3cb2f2);};}exports[_0xb687('0x2d')]=function(_0x2e5c8d,_0x173c58){var _0x4e9a06={},_0x28b69a={},_0x5143af={'count':0x0,'rows':[]};var _0x360429=_[_0xb687('0x2e')](db[_0xb687('0x2f')][_0xb687('0x30')],function(_0x1ad3ef){return{'name':_0x1ad3ef[_0xb687('0x31')],'type':_0x1ad3ef[_0xb687('0x32')]['key']};});_0x28b69a[_0xb687('0x33')]=_[_0xb687('0x2e')](_0x360429,_0xb687('0x2b'));_0x28b69a[_0xb687('0x34')]=_[_0xb687('0x35')](_0x2e5c8d[_0xb687('0x34')]);_0x28b69a[_0xb687('0x36')]=_[_0xb687('0x37')](_0x28b69a[_0xb687('0x33')],_0x28b69a[_0xb687('0x34')]);_0x4e9a06[_0xb687('0x38')]=_['intersection'](_0x28b69a['model'],qs[_0xb687('0x39')](_0x2e5c8d[_0xb687('0x34')][_0xb687('0x39')]));_0x4e9a06[_0xb687('0x38')]=_0x4e9a06['attributes']['length']?_0x4e9a06[_0xb687('0x38')]:_0x28b69a[_0xb687('0x33')];if(!_0x2e5c8d['query'][_0xb687('0x3a')](_0xb687('0x3b'))){_0x4e9a06['limit']=qs[_0xb687('0x21')](_0x2e5c8d['query'][_0xb687('0x21')]);_0x4e9a06[_0xb687('0x1f')]=qs[_0xb687('0x1f')](_0x2e5c8d[_0xb687('0x34')][_0xb687('0x1f')]);}_0x4e9a06[_0xb687('0x3c')]=qs['sort'](_0x2e5c8d[_0xb687('0x34')][_0xb687('0x3d')]);_0x4e9a06[_0xb687('0x3e')]=qs[_0xb687('0x36')](_['pick'](_0x2e5c8d[_0xb687('0x34')],_0x28b69a[_0xb687('0x36')]),_0x360429);if(_0x2e5c8d[_0xb687('0x34')][_0xb687('0x3f')]){_0x4e9a06[_0xb687('0x3e')]=_['merge'](_0x4e9a06[_0xb687('0x3e')],{'$or':_[_0xb687('0x2e')](_0x360429,function(_0x24c013){if(_0x24c013[_0xb687('0x32')]!==_0xb687('0x40')){var _0x29cf09={};_0x29cf09[_0x24c013['name']]={'$like':'%'+_0x2e5c8d['query'][_0xb687('0x3f')]+'%'};return _0x29cf09;}})});}_0x4e9a06=_['merge']({},_0x4e9a06,_0x2e5c8d[_0xb687('0x41')]);var _0x2f4550={'where':_0x4e9a06['where']};return db[_0xb687('0x2f')][_0xb687('0x22')](_0x2f4550)['then'](function(_0x394b56){_0x5143af[_0xb687('0x22')]=_0x394b56;if(_0x2e5c8d[_0xb687('0x34')]['includeAll']){_0x4e9a06[_0xb687('0x42')]=[{'all':!![]}];}return db[_0xb687('0x2f')][_0xb687('0x43')](_0x4e9a06);})[_0xb687('0x26')](function(_0x140388){_0x5143af[_0xb687('0x44')]=_0x140388;return _0x5143af;})[_0xb687('0x26')](respondWithFilteredResult(_0x173c58,_0x4e9a06))['catch'](handleError(_0x173c58,null));};exports[_0xb687('0x45')]=function(_0x4cf6ad,_0x50fdb7){var _0xa3a9e0={'raw':!![],'where':{'id':_0x4cf6ad['params']['id']}},_0x430364={};_0x430364[_0xb687('0x33')]=_['keys'](db[_0xb687('0x2f')][_0xb687('0x30')]);_0x430364['query']=_[_0xb687('0x35')](_0x4cf6ad[_0xb687('0x34')]);_0x430364['filters']=_[_0xb687('0x37')](_0x430364[_0xb687('0x33')],_0x430364[_0xb687('0x34')]);_0xa3a9e0[_0xb687('0x38')]=_[_0xb687('0x37')](_0x430364[_0xb687('0x33')],qs[_0xb687('0x39')](_0x4cf6ad[_0xb687('0x34')][_0xb687('0x39')]));_0xa3a9e0[_0xb687('0x38')]=_0xa3a9e0[_0xb687('0x38')][_0xb687('0x46')]?_0xa3a9e0['attributes']:_0x430364[_0xb687('0x33')];if(_0x4cf6ad['query'][_0xb687('0x47')]){_0xa3a9e0[_0xb687('0x42')]=[{'all':!![]}];}_0xa3a9e0=_[_0xb687('0x48')]({},_0xa3a9e0,_0x4cf6ad[_0xb687('0x41')]);return db[_0xb687('0x2f')][_0xb687('0x49')](_0xa3a9e0)['then'](handleEntityNotFound(_0x50fdb7,null))['then'](respondWithResult(_0x50fdb7,null))[_0xb687('0x4a')](handleError(_0x50fdb7,null));};exports[_0xb687('0x4b')]=function(_0x40558a,_0x4f3069){return db['CmHopperFinal'][_0xb687('0x4b')]()[_0xb687('0x26')](respondWithResult(_0x4f3069,null))[_0xb687('0x4a')](handleError(_0x4f3069,null));};exports[_0xb687('0x25')]=function(_0x535c00,_0x33a0b0){if(_0x535c00[_0xb687('0x4c')][_0xb687('0x4d')]){delete _0x535c00[_0xb687('0x4c')]['uniqueid'];}return db['CmHopperFinal'][_0xb687('0x49')]({'where':{'uniqueid':_0x535c00[_0xb687('0x4e')]['id']}})[_0xb687('0x26')](handleEntityNotFound(_0x33a0b0,null))['then'](saveUpdates(_0x535c00['body'],null))[_0xb687('0x26')](respondWithResult(_0x33a0b0,null))[_0xb687('0x4a')](handleError(_0x33a0b0,null));};exports[_0xb687('0x4f')]=function(_0x22e618,_0x34205d,_0x1fb31a){return db[_0xb687('0x2f')][_0xb687('0x43')]({'raw':![],'where':{'VoiceQueueId':_0x22e618['params']['id']},'attributes':[[db[_0xb687('0x50')]['fn'](_0xb687('0x51'),db[_0xb687('0x50')]['fn']('IF',db['sequelize']['literal']('`state`\x20=\x200,\x201,\x20null'))),'noSuchContacts'],[db[_0xb687('0x50')]['fn'](_0xb687('0x51'),db[_0xb687('0x50')]['fn']('IF',db[_0xb687('0x50')][_0xb687('0x52')](_0xb687('0x53')))),_0xb687('0x54')],[db[_0xb687('0x50')]['fn'](_0xb687('0x51'),db[_0xb687('0x50')]['fn']('IF',db[_0xb687('0x50')][_0xb687('0x52')](_0xb687('0x55')))),_0xb687('0x56')],[db[_0xb687('0x50')]['fn'](_0xb687('0x51'),db[_0xb687('0x50')]['fn']('IF',db['sequelize']['literal'](_0xb687('0x57')))),_0xb687('0x58')],[db[_0xb687('0x50')]['fn'](_0xb687('0x51'),db['sequelize']['fn']('IF',db[_0xb687('0x50')][_0xb687('0x52')]('`state`\x20=\x2010\x20,\x201,\x20null'))),_0xb687('0x59')],[db['sequelize']['fn'](_0xb687('0x51'),db[_0xb687('0x50')]['fn']('IF',db['sequelize']['literal'](_0xb687('0x5a')))),_0xb687('0x5b')],[db['sequelize']['fn'](_0xb687('0x51'),db[_0xb687('0x50')]['fn']('IF',db[_0xb687('0x50')]['literal'](_0xb687('0x5c')))),'reCallContacts'],[db[_0xb687('0x50')]['fn'](_0xb687('0x51'),db[_0xb687('0x50')]['fn']('IF',db[_0xb687('0x50')][_0xb687('0x52')]('`state`\x20=\x2019,\x201,\x20null'))),'answeringMachine']]})[_0xb687('0x26')](handleEntityNotFound(_0x34205d,null))['then'](respondWithResult(_0x34205d,null))['catch'](handleError(_0x34205d,null));};exports['countContactsIvrCampaignHopperFinal']=function(_0x5d266c,_0x1cc507,_0x1db4ca){return db[_0xb687('0x2f')][_0xb687('0x43')]({'raw':![],'where':{'CampaignId':_0x5d266c[_0xb687('0x4e')]['id']},'attributes':[[db[_0xb687('0x50')]['fn'](_0xb687('0x51'),db[_0xb687('0x50')]['fn']('IF',db[_0xb687('0x50')][_0xb687('0x52')](_0xb687('0x5d')))),'noSuchContacts'],[db['sequelize']['fn'](_0xb687('0x51'),db['sequelize']['fn']('IF',db[_0xb687('0x50')][_0xb687('0x52')](_0xb687('0x53')))),_0xb687('0x54')],[db[_0xb687('0x50')]['fn']('COUNT',db[_0xb687('0x50')]['fn']('IF',db['sequelize'][_0xb687('0x52')](_0xb687('0x55')))),_0xb687('0x56')],[db[_0xb687('0x50')]['fn'](_0xb687('0x51'),db[_0xb687('0x50')]['fn']('IF',db[_0xb687('0x50')]['literal'](_0xb687('0x57')))),_0xb687('0x58')],[db[_0xb687('0x50')]['fn'](_0xb687('0x51'),db[_0xb687('0x50')]['fn']('IF',db['sequelize'][_0xb687('0x52')](_0xb687('0x5e')))),_0xb687('0x59')],[db[_0xb687('0x50')]['fn'](_0xb687('0x51'),db[_0xb687('0x50')]['fn']('IF',db[_0xb687('0x50')][_0xb687('0x52')](_0xb687('0x5a')))),_0xb687('0x5b')],[db[_0xb687('0x50')]['fn']('COUNT',db[_0xb687('0x50')]['fn']('IF',db[_0xb687('0x50')][_0xb687('0x52')](_0xb687('0x5c')))),'reCallContacts'],[db[_0xb687('0x50')]['fn'](_0xb687('0x51'),db['sequelize']['fn']('IF',db[_0xb687('0x50')][_0xb687('0x52')](_0xb687('0x5f')))),'answeringMachine']]})[_0xb687('0x26')](handleEntityNotFound(_0x1cc507,null))[_0xb687('0x26')](respondWithResult(_0x1cc507,null))['catch'](handleError(_0x1cc507,null));};exports[_0xb687('0x60')]=function(_0x5449c4,_0x2c2add,_0x431cc5){return db['VoiceQueue'][_0xb687('0x49')]({'where':{'id':_0x5449c4[_0xb687('0x4e')]['id']}})['then'](handleEntityNotFound(_0x2c2add,null))[_0xb687('0x26')](function(_0x1736ef){var _0x52285e;if(_0x1736ef){_0x52285e=squel['insert']()[_0xb687('0x61')]('cm_hopper')[_0xb687('0x62')]([_0xb687('0x63'),_0xb687('0x64'),_0xb687('0x65'),_0xb687('0x66'),_0xb687('0x67'),_0xb687('0x68'),_0xb687('0x69')],squel['select']()[_0xb687('0x6a')](_0xb687('0x6b'),_0xb687('0x63'))[_0xb687('0x6a')](_0xb687('0x6c'),_0xb687('0x64'))['field'](_0xb687('0x6d'),_0xb687('0x65'))['field'](_0xb687('0x6e'),_0xb687('0x66'))[_0xb687('0x6a')](_0xb687('0x6f'),'VoiceQueueId')[_0xb687('0x6a')]('NOW()','createdAt')[_0xb687('0x6a')]('NOW()','updatedAt')[_0xb687('0x70')]('cm_hopper_final')[_0xb687('0x3e')](_0xb687('0x71'),_0x5449c4['params']['id'][_0xb687('0x72')]())[_0xb687('0x3e')]('state\x20=\x20?',_0x5449c4[_0xb687('0x4c')][_0xb687('0x73')][_0xb687('0x72')]())[_0xb687('0x3e')](_0xb687('0x74'))[_0xb687('0x3e')](_0xb687('0x75'),squel[_0xb687('0x76')]()[_0xb687('0x6a')](_0xb687('0x63'))[_0xb687('0x70')]('cm_hopper')[_0xb687('0x3e')]('VoiceQueueId\x20=\x20?',_0x5449c4['params']['id'][_0xb687('0x72')]()))[_0xb687('0x3e')](_0xb687('0x75'),squel[_0xb687('0x76')]()[_0xb687('0x6a')]('calleridnum')['from'](_0xb687('0x77'))[_0xb687('0x3e')](_0xb687('0x71'),_0x5449c4[_0xb687('0x4e')]['id']['toString']())[_0xb687('0x3e')](_0xb687('0x78')))[_0xb687('0x79')](_0xb687('0x65')))[_0xb687('0x72')]();return db[_0xb687('0x50')][_0xb687('0x34')](_0x52285e);}return[];})[_0xb687('0x26')](respondWithResult(_0x2c2add,null))[_0xb687('0x4a')](handleError(_0x2c2add,null));};exports['moveContactsIvrCampaignHopperFinal']=function(_0x25f5c3,_0x33d1fc,_0x207953){return db[_0xb687('0x7a')][_0xb687('0x49')]({'where':{'id':_0x25f5c3['params']['id']}})[_0xb687('0x26')](handleEntityNotFound(_0x33d1fc,null))[_0xb687('0x26')](function(_0x48bbee){var _0x19ac6d;if(_0x48bbee){_0x19ac6d=squel['insert']()[_0xb687('0x61')](_0xb687('0x7b'))['fromQuery']([_0xb687('0x63'),_0xb687('0x64'),'ContactId',_0xb687('0x66'),_0xb687('0x7c'),_0xb687('0x68'),_0xb687('0x69')],squel[_0xb687('0x76')]()[_0xb687('0x6a')]('ANY_VALUE(calleridnum)',_0xb687('0x63'))[_0xb687('0x6a')](_0xb687('0x6c'),_0xb687('0x64'))[_0xb687('0x6a')](_0xb687('0x6d'),_0xb687('0x65'))[_0xb687('0x6a')](_0xb687('0x6e'),_0xb687('0x66'))[_0xb687('0x6a')]('ANY_VALUE(CampaignId)',_0xb687('0x7c'))['field'](_0xb687('0x6c'),_0xb687('0x68'))['field']('NOW()',_0xb687('0x69'))[_0xb687('0x70')](_0xb687('0x77'))[_0xb687('0x3e')](_0xb687('0x7d'),_0x25f5c3[_0xb687('0x4e')]['id'][_0xb687('0x72')]())[_0xb687('0x3e')](_0xb687('0x7e'),_0x25f5c3[_0xb687('0x4c')][_0xb687('0x73')][_0xb687('0x72')]())[_0xb687('0x3e')](_0xb687('0x74'))[_0xb687('0x3e')](_0xb687('0x75'),squel['select']()['field'](_0xb687('0x63'))['from']('cm_hopper')[_0xb687('0x3e')](_0xb687('0x7d'),_0x25f5c3['params']['id'][_0xb687('0x72')]()))[_0xb687('0x3e')]('calleridnum\x20NOT\x20IN\x20(?)',squel[_0xb687('0x76')]()[_0xb687('0x6a')](_0xb687('0x7f'))[_0xb687('0x70')](_0xb687('0x77'))[_0xb687('0x3e')](_0xb687('0x7d'),_0x25f5c3[_0xb687('0x4e')]['id'][_0xb687('0x72')]())['where'](_0xb687('0x78')))[_0xb687('0x79')]('ContactId'))[_0xb687('0x72')]();return db['sequelize'][_0xb687('0x34')](_0x19ac6d);}return[];})[_0xb687('0x26')](respondWithResult(_0x33d1fc,null))['catch'](handleError(_0x33d1fc,null));};exports[_0xb687('0x80')]=function(_0x20e46a,_0x1c389f,_0x45d0ab){return db[_0xb687('0x81')][_0xb687('0x82')]({'where':{'VoiceQueueId':_0x20e46a[_0xb687('0x4c')]['VoiceQueueId'],'CampaignId':_0x20e46a['body'][_0xb687('0x7c')],'ContactId':_0x20e46a['body'][_0xb687('0x65')]}})[_0xb687('0x26')](handleEntityNotFound(_0x1c389f,null))[_0xb687('0x26')](function(_0x312529){if(_0x312529){return _0x312529;}return null;})['then'](respondWithResult(_0x1c389f,null))[_0xb687('0x4a')](handleError(_0x1c389f,null));}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.model.js b/server/api/cmHopperFinal/cmHopperFinal.model.js index bb45d80..a1fc821 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 _0x77d8=['lodash','util','../../config/logger','api','moment','../../config/environment','./cmHopperFinal.attributes','exports','define','CmHopperFinal','cm_hopper_final','calleridnum','uniqueid'];(function(_0x4fcdce,_0x47c78e){var _0x1ce871=function(_0x5a3d2e){while(--_0x5a3d2e){_0x4fcdce['push'](_0x4fcdce['shift']());}};_0x1ce871(++_0x47c78e);}(_0x77d8,0xdd));var _0x877d=function(_0x496997,_0x5a576c){_0x496997=_0x496997-0x0;var _0x3d16b2=_0x77d8[_0x496997];return _0x3d16b2;};'use strict';var _=require(_0x877d('0x0'));var util=require(_0x877d('0x1'));var logger=require(_0x877d('0x2'))(_0x877d('0x3'));var moment=require(_0x877d('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x877d('0x5'));var attributes=require(_0x877d('0x6'));module[_0x877d('0x7')]=function(_0x14dd08,_0x3b262e){return _0x14dd08[_0x877d('0x8')](_0x877d('0x9'),attributes,{'tableName':_0x877d('0xa'),'paranoid':![],'indexes':[{'name':_0x877d('0xb'),'fields':[_0x877d('0xb')]},{'name':_0x877d('0xc'),'fields':[_0x877d('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x3c28=['request-promise','rimraf','../../config/environment','exports','define','CmHopperFinal','cm_hopper_final','calleridnum','uniqueid','lodash','util','../../config/logger','moment'];(function(_0x45053f,_0x250ff9){var _0x49d643=function(_0x25982c){while(--_0x25982c){_0x45053f['push'](_0x45053f['shift']());}};_0x49d643(++_0x250ff9);}(_0x3c28,0xbf));var _0x83c2=function(_0x494285,_0x44138a){_0x494285=_0x494285-0x0;var _0x31857a=_0x3c28[_0x494285];return _0x31857a;};'use strict';var _=require(_0x83c2('0x0'));var util=require(_0x83c2('0x1'));var logger=require(_0x83c2('0x2'))('api');var moment=require(_0x83c2('0x3'));var BPromise=require('bluebird');var rp=require(_0x83c2('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x83c2('0x5'));var config=require(_0x83c2('0x6'));var attributes=require('./cmHopperFinal.attributes');module[_0x83c2('0x7')]=function(_0x43fceb,_0x128488){return _0x43fceb[_0x83c2('0x8')](_0x83c2('0x9'),attributes,{'tableName':_0x83c2('0xa'),'paranoid':![],'indexes':[{'name':_0x83c2('0xb'),'fields':[_0x83c2('0xb')]},{'name':_0x83c2('0xc'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.rpc.js b/server/api/cmHopperFinal/cmHopperFinal.rpc.js index 1caf02b..99551b8 100644 --- a/server/api/cmHopperFinal/cmHopperFinal.rpc.js +++ b/server/api/cmHopperFinal/cmHopperFinal.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['../../config/environment','jayson/promise','http','info','CmHopperFinal,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','CmHopperFinal','create','body','options','raw','CreateCmHopperFinal','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0x52efac,_0x19ec44){var _0x156b01=function(_0x4c160e){while(--_0x4c160e){_0x52efac['push'](_0x52efac['shift']());}};_0x156b01(++_0x19ec44);}(_0x7a54,0x106));var _0x47a5=function(_0x5748f4,_0x129992){_0x5748f4=_0x5748f4-0x0;var _0x2b8c7f=_0x7a54[_0x5748f4];return _0x2b8c7f;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('CmHopperFinal,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});}exports['CreateCmHopperFinal']=function(_0x5247fd){var _0x423a81=this;return new Promise(function(_0xaf70a6,_0x2ce454){return db[_0x47a5('0x15')][_0x47a5('0x16')](_0x5247fd[_0x47a5('0x17')],{'raw':_0x5247fd[_0x47a5('0x18')]?_0x5247fd[_0x47a5('0x18')][_0x47a5('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x1570bc){logger[_0x47a5('0xb')]('CreateCmHopperFinal',_0x5247fd);logger[_0x47a5('0xd')](_0x47a5('0x1a'),_0x5247fd,JSON[_0x47a5('0xe')](_0x1570bc));_0xaf70a6(_0x1570bc);})['catch'](function(_0xb8ae6c){logger[_0x47a5('0xf')](_0x47a5('0x1a'),_0xb8ae6c[_0x47a5('0x11')],_0x5247fd);_0x2ce454(_0x423a81['error'](0x1f4,_0xb8ae6c[_0x47a5('0x11')]));});});}; \ No newline at end of file +var _0xb10b=['debug','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','CmHopperFinal,\x20%s,\x20%s','CmHopperFinal,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','CreateCmHopperFinal','CmHopperFinal','create','options','raw'];(function(_0x2152e1,_0x566b14){var _0x4b76fb=function(_0x448a5d){while(--_0x448a5d){_0x2152e1['push'](_0x2152e1['shift']());}};_0x4b76fb(++_0x566b14);}(_0xb10b,0x12a));var _0xbb10=function(_0x7d9c0d,_0x165295){_0x7d9c0d=_0x7d9c0d-0x0;var _0x26a3c7=_0xb10b[_0x7d9c0d];return _0x26a3c7;};'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 cf9ca56..6b5043a 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 _0x61e6=['isAuthenticated','index','/describe','describe','/:id','show','/voice/queue/countAttributes/:id','/campaign/countAttributes/:id','countContactsIvrCampaignHopperFinal','post','/voice/queue/moveContacts/:id','moveContactsQueueCampaignHopperFinal','/voice/campaign/moveContacts/:id','checkContactHopper','update','multer','util','connect-timeout','fs-extra','../../components/interaction/service','../../config/environment','./cmHopperFinal.controller','get'];(function(_0xa133a6,_0x386cf8){var _0x51e364=function(_0x630a63){while(--_0x630a63){_0xa133a6['push'](_0xa133a6['shift']());}};_0x51e364(++_0x386cf8);}(_0x61e6,0x10c));var _0x661e=function(_0x14fae3,_0x4b65da){_0x14fae3=_0x14fae3-0x0;var _0x21002=_0x61e6[_0x14fae3];return _0x21002;};'use strict';var multer=require(_0x661e('0x0'));var util=require(_0x661e('0x1'));var path=require('path');var timeout=require(_0x661e('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x661e('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x661e('0x4'));var config=require(_0x661e('0x5'));var controller=require(_0x661e('0x6'));router[_0x661e('0x7')]('/',auth[_0x661e('0x8')](),controller[_0x661e('0x9')]);router[_0x661e('0x7')](_0x661e('0xa'),auth[_0x661e('0x8')](),controller[_0x661e('0xb')]);router['get'](_0x661e('0xc'),auth[_0x661e('0x8')](),controller[_0x661e('0xd')]);router[_0x661e('0x7')](_0x661e('0xe'),auth['isAuthenticated'](),controller['countContactsQueueCampaignHopperFinal']);router[_0x661e('0x7')](_0x661e('0xf'),auth[_0x661e('0x8')](),controller[_0x661e('0x10')]);router[_0x661e('0x11')](_0x661e('0x12'),auth[_0x661e('0x8')](),controller[_0x661e('0x13')]);router[_0x661e('0x11')](_0x661e('0x14'),auth[_0x661e('0x8')](),controller['moveContactsIvrCampaignHopperFinal']);router[_0x661e('0x11')]('/checkContactHopper',auth['isAuthenticated'](),controller[_0x661e('0x15')]);router['put'](_0x661e('0xc'),auth[_0x661e('0x8')](),controller[_0x661e('0x16')]);module['exports']=router; \ No newline at end of file +var _0x2713=['moveContactsIvrCampaignHopperFinal','/checkContactHopper','checkContactHopper','/:id','update','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperFinal.controller','get','isAuthenticated','index','/describe','/voice/queue/countAttributes/:id','countContactsQueueCampaignHopperFinal','/campaign/countAttributes/:id','countContactsIvrCampaignHopperFinal','post','/voice/queue/moveContacts/:id','moveContactsQueueCampaignHopperFinal'];(function(_0x549278,_0x450754){var _0x1ea9a1=function(_0x2e559d){while(--_0x2e559d){_0x549278['push'](_0x549278['shift']());}};_0x1ea9a1(++_0x450754);}(_0x2713,0x164));var _0x3271=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x2713[_0x502c7d];return _0x30b7ed;};'use strict';var multer=require(_0x3271('0x0'));var util=require(_0x3271('0x1'));var path=require(_0x3271('0x2'));var timeout=require(_0x3271('0x3'));var express=require(_0x3271('0x4'));var router=express[_0x3271('0x5')]();var fs_extra=require(_0x3271('0x6'));var auth=require(_0x3271('0x7'));var interaction=require(_0x3271('0x8'));var config=require(_0x3271('0x9'));var controller=require(_0x3271('0xa'));router[_0x3271('0xb')]('/',auth[_0x3271('0xc')](),controller[_0x3271('0xd')]);router[_0x3271('0xb')](_0x3271('0xe'),auth[_0x3271('0xc')](),controller['describe']);router['get']('/:id',auth['isAuthenticated'](),controller['show']);router[_0x3271('0xb')](_0x3271('0xf'),auth[_0x3271('0xc')](),controller[_0x3271('0x10')]);router[_0x3271('0xb')](_0x3271('0x11'),auth[_0x3271('0xc')](),controller[_0x3271('0x12')]);router[_0x3271('0x13')](_0x3271('0x14'),auth[_0x3271('0xc')](),controller[_0x3271('0x15')]);router[_0x3271('0x13')]('/voice/campaign/moveContacts/:id',auth['isAuthenticated'](),controller[_0x3271('0x16')]);router['post'](_0x3271('0x17'),auth[_0x3271('0xc')](),controller[_0x3271('0x18')]);router['put'](_0x3271('0x19'),auth['isAuthenticated'](),controller[_0x3271('0x1a')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.attributes.js b/server/api/cmHopperHistory/cmHopperHistory.attributes.js index 2f44d0b..67a7a8f 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 _0x1d13=['sequelize','exports','INTEGER','DATE','STRING','BOOLEAN'];(function(_0x4b4a19,_0x29e218){var _0x15be64=function(_0x1d54d4){while(--_0x1d54d4){_0x4b4a19['push'](_0x4b4a19['shift']());}};_0x15be64(++_0x29e218);}(_0x1d13,0xde));var _0x31d1=function(_0x2eea00,_0x9b5ba5){_0x2eea00=_0x2eea00-0x0;var _0xcd5f98=_0x1d13[_0x2eea00];return _0xcd5f98;};'use strict';var Sequelize=require(_0x31d1('0x0'));module[_0x31d1('0x1')]={'state':{'type':Sequelize[_0x31d1('0x2')](0x2)},'statedesc':{'type':Sequelize['STRING']},'scheduledat':{'type':Sequelize[_0x31d1('0x3')]},'countbusyretry':{'type':Sequelize[_0x31d1('0x2')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x31d1('0x2')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x31d1('0x2')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x31d1('0x2')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x31d1('0x4')]},'originatecalleridnum':{'type':Sequelize[_0x31d1('0x4')]},'originatecalleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x31d1('0x4')]},'calleridname':{'type':Sequelize[_0x31d1('0x4')]},'starttime':{'type':Sequelize[_0x31d1('0x3')]},'responsetime':{'type':Sequelize[_0x31d1('0x3')]},'answertime':{'type':Sequelize['DATE']},'droptime':{'type':Sequelize[_0x31d1('0x3')]},'endtime':{'type':Sequelize[_0x31d1('0x3')]},'ringtime':{'type':Sequelize[_0x31d1('0x2')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x31d1('0x2')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x31d1('0x2')],'defaultValue':0x0},'followuptime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x31d1('0x4')]},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize[_0x31d1('0x4')]},'membername':{'type':Sequelize['STRING']},'reason':{'type':Sequelize[_0x31d1('0x4')]},'amd':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fax':{'type':Sequelize[_0x31d1('0x5')],'defaultValue':![]},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x31d1('0x4')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x31d1('0x3')]},'recallme':{'type':Sequelize[_0x31d1('0x5')],'defaultValue':![]},'editedat':{'type':Sequelize[_0x31d1('0x3')]},'edited':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize[_0x31d1('0x2')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x31d1('0x2')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x31d1('0x2')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x31d1('0x2')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x31d1('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0xee88=['BOOLEAN','sequelize','exports','INTEGER','STRING','DATE'];(function(_0x81dcac,_0x8ff7db){var _0xc7803b=function(_0x499b29){while(--_0x499b29){_0x81dcac['push'](_0x81dcac['shift']());}};_0xc7803b(++_0x8ff7db);}(_0xee88,0x9d));var _0x8ee8=function(_0x2256ed,_0x4120fa){_0x2256ed=_0x2256ed-0x0;var _0x2a999d=_0xee88[_0x2256ed];return _0x2a999d;};'use strict';var Sequelize=require(_0x8ee8('0x0'));module[_0x8ee8('0x1')]={'state':{'type':Sequelize[_0x8ee8('0x2')](0x2)},'statedesc':{'type':Sequelize[_0x8ee8('0x3')]},'scheduledat':{'type':Sequelize[_0x8ee8('0x4')]},'countbusyretry':{'type':Sequelize[_0x8ee8('0x2')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x8ee8('0x2')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x8ee8('0x2')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x8ee8('0x2')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x8ee8('0x3')]},'originatecalleridnum':{'type':Sequelize['STRING']},'originatecalleridname':{'type':Sequelize[_0x8ee8('0x3')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x8ee8('0x3')]},'starttime':{'type':Sequelize[_0x8ee8('0x4')]},'responsetime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize[_0x8ee8('0x4')]},'droptime':{'type':Sequelize[_0x8ee8('0x4')]},'endtime':{'type':Sequelize[_0x8ee8('0x4')]},'ringtime':{'type':Sequelize[_0x8ee8('0x2')],'defaultValue':0x0},'holdtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x8ee8('0x2')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x8ee8('0x2')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x8ee8('0x3')]},'campaign':{'type':Sequelize[_0x8ee8('0x3')]},'campaigntype':{'type':Sequelize[_0x8ee8('0x3')]},'membername':{'type':Sequelize[_0x8ee8('0x3')]},'reason':{'type':Sequelize[_0x8ee8('0x3')]},'amd':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fax':{'type':Sequelize[_0x8ee8('0x5')],'defaultValue':![]},'callback':{'type':Sequelize[_0x8ee8('0x5')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x8ee8('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x8ee8('0x4')]},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'editedat':{'type':Sequelize['DATE']},'edited':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize[_0x8ee8('0x2')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x8ee8('0x2')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x8ee8('0x2')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x8ee8('0x2')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.controller.js b/server/api/cmHopperHistory/cmHopperHistory.controller.js index 648625e..8198749 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 _0x8072=['../../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','rawAttributes','fieldName','type','key','keys','query','intersection','model','attributes','fields','length','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','include','findAll','catch','show','params','find','create','uniqueid','rimraf','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger'];(function(_0x324595,_0x940b0a){var _0x567497=function(_0x483855){while(--_0x483855){_0x324595['push'](_0x324595['shift']());}};_0x567497(++_0x940b0a);}(_0x8072,0x15f));var _0x2807=function(_0x32d457,_0x1a39c9){_0x32d457=_0x32d457-0x0;var _0x338386=_0x8072[_0x32d457];return _0x338386;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2807('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2807('0x1'));var rp=require(_0x2807('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x2807('0x3'));var util=require(_0x2807('0x4'));var path=require(_0x2807('0x5'));var sox=require(_0x2807('0x6'));var csv=require(_0x2807('0x7'));var ejs=require(_0x2807('0x8'));var fs=require('fs');var fs_extra=require(_0x2807('0x9'));var _=require(_0x2807('0xa'));var squel=require(_0x2807('0xb'));var crypto=require(_0x2807('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x2807('0xd'));var toCsv=require(_0x2807('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x2807('0xe'));var authService=require(_0x2807('0xf'));var qs=require(_0x2807('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2807('0x11'));var logger=require(_0x2807('0x12'))('api');var utils=require(_0x2807('0x13'));var config=require(_0x2807('0x14'));var licenseUtil=require(_0x2807('0x15'));var db=require(_0x2807('0x16'))['db'];function respondWithStatusCode(_0x45037e,_0x2ca4b9){_0x2ca4b9=_0x2ca4b9||0xcc;return function(_0x10a3fe){if(_0x10a3fe){return _0x45037e[_0x2807('0x17')](_0x2ca4b9);}return _0x45037e[_0x2807('0x18')](_0x2ca4b9)[_0x2807('0x19')]();};}function respondWithResult(_0x2b7a21,_0x354e66){_0x354e66=_0x354e66||0xc8;return function(_0x5f0879){if(_0x5f0879){return _0x2b7a21[_0x2807('0x18')](_0x354e66)[_0x2807('0x1a')](_0x5f0879);}};}function respondWithFilteredResult(_0x20abd9,_0x31cd90){return function(_0x14175e){if(_0x14175e){var _0x2f0b38=typeof _0x31cd90[_0x2807('0x1b')]===_0x2807('0x1c')&&typeof _0x31cd90[_0x2807('0x1d')]===_0x2807('0x1c');var _0x17f7fa=_0x14175e['count'];var _0x3f7e27=_0x2f0b38?0x0:_0x31cd90[_0x2807('0x1b')];var _0x321ae9=_0x2f0b38?_0x14175e[_0x2807('0x1e')]:_0x31cd90[_0x2807('0x1b')]+_0x31cd90['limit'];var _0x589648;if(_0x321ae9>=_0x17f7fa){_0x321ae9=_0x17f7fa;_0x589648=0xc8;}else{_0x589648=0xce;}_0x20abd9[_0x2807('0x18')](_0x589648);return _0x20abd9[_0x2807('0x1f')](_0x2807('0x20'),_0x3f7e27+'-'+_0x321ae9+'/'+_0x17f7fa)['json'](_0x14175e);}return null;};}function patchUpdates(_0x2cc9c4){return function(_0x3125d1){try{jsonpatch[_0x2807('0x21')](_0x3125d1,_0x2cc9c4,!![]);}catch(_0x457e8f){return BPromise[_0x2807('0x22')](_0x457e8f);}return _0x3125d1['save']();};}function saveUpdates(_0x14bb18,_0x32b6bd){return function(_0x219d19){if(_0x219d19){return _0x219d19[_0x2807('0x23')](_0x14bb18)[_0x2807('0x24')](function(_0x14b814){return _0x14b814;});}return null;};}function removeEntity(_0x423c5f,_0x5e3c60){return function(_0x57c1e5){if(_0x57c1e5){return _0x57c1e5[_0x2807('0x25')]()[_0x2807('0x24')](function(){_0x423c5f[_0x2807('0x18')](0xcc)[_0x2807('0x19')]();});}};}function handleEntityNotFound(_0x2c0c01,_0x321bed){return function(_0x1c2636){if(!_0x1c2636){_0x2c0c01[_0x2807('0x17')](0x194);}return _0x1c2636;};}function handleError(_0xb6e8fd,_0x43c062){_0x43c062=_0x43c062||0x1f4;return function(_0x174985){logger[_0x2807('0x26')](_0x174985[_0x2807('0x27')]);if(_0x174985[_0x2807('0x28')]){delete _0x174985[_0x2807('0x28')];}_0xb6e8fd[_0x2807('0x18')](_0x43c062)[_0x2807('0x29')](_0x174985);};}exports[_0x2807('0x2a')]=function(_0x40e37a,_0x20aada){var _0xcebc4c={},_0x549ebc={},_0x1826e7={'count':0x0,'rows':[]};var _0x47db8b=_[_0x2807('0x2b')](db[_0x2807('0x2c')][_0x2807('0x2d')],function(_0x470d5c){return{'name':_0x470d5c[_0x2807('0x2e')],'type':_0x470d5c[_0x2807('0x2f')][_0x2807('0x30')]};});_0x549ebc['model']=_['map'](_0x47db8b,_0x2807('0x28'));_0x549ebc['query']=_[_0x2807('0x31')](_0x40e37a[_0x2807('0x32')]);_0x549ebc['filters']=_[_0x2807('0x33')](_0x549ebc[_0x2807('0x34')],_0x549ebc[_0x2807('0x32')]);_0xcebc4c[_0x2807('0x35')]=_[_0x2807('0x33')](_0x549ebc[_0x2807('0x34')],qs[_0x2807('0x36')](_0x40e37a['query'][_0x2807('0x36')]));_0xcebc4c['attributes']=_0xcebc4c[_0x2807('0x35')][_0x2807('0x37')]?_0xcebc4c[_0x2807('0x35')]:_0x549ebc['model'];if(!_0x40e37a['query']['hasOwnProperty'](_0x2807('0x38'))){_0xcebc4c[_0x2807('0x1d')]=qs[_0x2807('0x1d')](_0x40e37a['query']['limit']);_0xcebc4c[_0x2807('0x1b')]=qs['offset'](_0x40e37a[_0x2807('0x32')][_0x2807('0x1b')]);}_0xcebc4c[_0x2807('0x39')]=qs[_0x2807('0x3a')](_0x40e37a[_0x2807('0x32')][_0x2807('0x3a')]);_0xcebc4c[_0x2807('0x3b')]=qs[_0x2807('0x3c')](_[_0x2807('0x3d')](_0x40e37a['query'],_0x549ebc[_0x2807('0x3c')]),_0x47db8b);if(_0x40e37a['query'][_0x2807('0x3e')]){_0xcebc4c[_0x2807('0x3b')]=_[_0x2807('0x3f')](_0xcebc4c[_0x2807('0x3b')],{'$or':_[_0x2807('0x2b')](_0x47db8b,function(_0x2de59c){if(_0x2de59c[_0x2807('0x2f')]!==_0x2807('0x40')){var _0x1bde85={};_0x1bde85[_0x2de59c[_0x2807('0x28')]]={'$like':'%'+_0x40e37a[_0x2807('0x32')][_0x2807('0x3e')]+'%'};return _0x1bde85;}})});}_0xcebc4c=_['merge']({},_0xcebc4c,_0x40e37a[_0x2807('0x41')]);var _0x381aec={'where':_0xcebc4c[_0x2807('0x3b')]};return db[_0x2807('0x2c')][_0x2807('0x1e')](_0x381aec)[_0x2807('0x24')](function(_0x552d22){_0x1826e7[_0x2807('0x1e')]=_0x552d22;if(_0x40e37a[_0x2807('0x32')]['includeAll']){_0xcebc4c[_0x2807('0x42')]=[{'all':!![]}];}return db[_0x2807('0x2c')][_0x2807('0x43')](_0xcebc4c);})['then'](function(_0x3c4680){_0x1826e7['rows']=_0x3c4680;return _0x1826e7;})[_0x2807('0x24')](respondWithFilteredResult(_0x20aada,_0xcebc4c))[_0x2807('0x44')](handleError(_0x20aada,null));};exports[_0x2807('0x45')]=function(_0x5bdbea,_0x268b7d){var _0x1848cd={'raw':!![],'where':{'id':_0x5bdbea[_0x2807('0x46')]['id']}},_0x41381f={};_0x41381f[_0x2807('0x34')]=_[_0x2807('0x31')](db[_0x2807('0x2c')]['rawAttributes']);_0x41381f['query']=_[_0x2807('0x31')](_0x5bdbea[_0x2807('0x32')]);_0x41381f[_0x2807('0x3c')]=_['intersection'](_0x41381f[_0x2807('0x34')],_0x41381f[_0x2807('0x32')]);_0x1848cd[_0x2807('0x35')]=_[_0x2807('0x33')](_0x41381f[_0x2807('0x34')],qs[_0x2807('0x36')](_0x5bdbea[_0x2807('0x32')][_0x2807('0x36')]));_0x1848cd[_0x2807('0x35')]=_0x1848cd[_0x2807('0x35')]['length']?_0x1848cd[_0x2807('0x35')]:_0x41381f['model'];if(_0x5bdbea[_0x2807('0x32')]['includeAll']){_0x1848cd[_0x2807('0x42')]=[{'all':!![]}];}_0x1848cd=_[_0x2807('0x3f')]({},_0x1848cd,_0x5bdbea['options']);return db[_0x2807('0x2c')][_0x2807('0x47')](_0x1848cd)[_0x2807('0x24')](handleEntityNotFound(_0x268b7d,null))[_0x2807('0x24')](respondWithResult(_0x268b7d,null))[_0x2807('0x44')](handleError(_0x268b7d,null));};exports[_0x2807('0x48')]=function(_0x501180,_0x164f4a){return db[_0x2807('0x2c')][_0x2807('0x48')](_0x501180['body'],{})[_0x2807('0x24')](respondWithResult(_0x164f4a,0xc9))[_0x2807('0x44')](handleError(_0x164f4a,null));};exports['describe']=function(_0x2690c3,_0x48ff4f){return db['CmHopperHistory']['describe']()[_0x2807('0x24')](respondWithResult(_0x48ff4f,null))['catch'](handleError(_0x48ff4f,null));};exports[_0x2807('0x23')]=function(_0x52a85d,_0x18c33c){if(_0x52a85d['body']['uniqueid']){delete _0x52a85d['body'][_0x2807('0x49')];}return db[_0x2807('0x2c')][_0x2807('0x47')]({'where':{'uniqueid':_0x52a85d[_0x2807('0x46')]['id']}})['then'](handleEntityNotFound(_0x18c33c,null))[_0x2807('0x24')](saveUpdates(_0x52a85d['body'],null))['then'](respondWithResult(_0x18c33c,null))[_0x2807('0x44')](handleError(_0x18c33c,null));}; \ No newline at end of file +var _0x8958=['zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../mysqldb','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','json','apply','reject','save','update','then','destroy','error','name','send','index','CmHopperHistory','rawAttributes','fieldName','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','filter','merge','map','type','options','includeAll','include','rows','catch','show','find','create','body','describe','uniqueid','params','eml-format'];(function(_0x204191,_0x55d566){var _0x526ccf=function(_0x22427d){while(--_0x22427d){_0x204191['push'](_0x204191['shift']());}};_0x526ccf(++_0x55d566);}(_0x8958,0xda));var _0x8895=function(_0x2209ff,_0x232763){_0x2209ff=_0x2209ff-0x0;var _0x2821f8=_0x8958[_0x2209ff];return _0x2821f8;};'use strict';var emlformat=require(_0x8895('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x8895('0x1'));var jsonpatch=require(_0x8895('0x2'));var rp=require(_0x8895('0x3'));var moment=require('moment');var BPromise=require(_0x8895('0x4'));var Mustache=require(_0x8895('0x5'));var util=require(_0x8895('0x6'));var path=require(_0x8895('0x7'));var sox=require(_0x8895('0x8'));var csv=require(_0x8895('0x9'));var ejs=require(_0x8895('0xa'));var fs=require('fs');var fs_extra=require(_0x8895('0xb'));var _=require(_0x8895('0xc'));var squel=require('squel');var crypto=require(_0x8895('0xd'));var jsforce=require(_0x8895('0xe'));var deskjs=require(_0x8895('0xf'));var toCsv=require(_0x8895('0x9'));var querystring=require(_0x8895('0x10'));var Papa=require(_0x8895('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x8895('0x12'));var as=require(_0x8895('0x13'));var hardwareService=require(_0x8895('0x14'));var logger=require('../../config/logger')(_0x8895('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x8895('0x16'))['db'];function respondWithStatusCode(_0x8ccc83,_0x77847c){_0x77847c=_0x77847c||0xcc;return function(_0x53fd27){if(_0x53fd27){return _0x8ccc83[_0x8895('0x17')](_0x77847c);}return _0x8ccc83[_0x8895('0x18')](_0x77847c)[_0x8895('0x19')]();};}function respondWithResult(_0x3d4eda,_0x56559c){_0x56559c=_0x56559c||0xc8;return function(_0x3124b6){if(_0x3124b6){return _0x3d4eda[_0x8895('0x18')](_0x56559c)['json'](_0x3124b6);}};}function respondWithFilteredResult(_0xdf9c2e,_0x3e38fe){return function(_0xaede14){if(_0xaede14){var _0x31966b=typeof _0x3e38fe[_0x8895('0x1a')]==='undefined'&&typeof _0x3e38fe['limit']===_0x8895('0x1b');var _0x438cd6=_0xaede14[_0x8895('0x1c')];var _0x34cc25=_0x31966b?0x0:_0x3e38fe[_0x8895('0x1a')];var _0x5b7db0=_0x31966b?_0xaede14['count']:_0x3e38fe['offset']+_0x3e38fe[_0x8895('0x1d')];var _0x50e522;if(_0x5b7db0>=_0x438cd6){_0x5b7db0=_0x438cd6;_0x50e522=0xc8;}else{_0x50e522=0xce;}_0xdf9c2e[_0x8895('0x18')](_0x50e522);return _0xdf9c2e[_0x8895('0x1e')](_0x8895('0x1f'),_0x34cc25+'-'+_0x5b7db0+'/'+_0x438cd6)[_0x8895('0x20')](_0xaede14);}return null;};}function patchUpdates(_0x3f1d51){return function(_0x7c2fea){try{jsonpatch[_0x8895('0x21')](_0x7c2fea,_0x3f1d51,!![]);}catch(_0x52903e){return BPromise[_0x8895('0x22')](_0x52903e);}return _0x7c2fea[_0x8895('0x23')]();};}function saveUpdates(_0x1eaba6,_0x53b86a){return function(_0x281ae5){if(_0x281ae5){return _0x281ae5[_0x8895('0x24')](_0x1eaba6)[_0x8895('0x25')](function(_0x34b01c){return _0x34b01c;});}return null;};}function removeEntity(_0x11857f,_0x586c92){return function(_0x1a1a11){if(_0x1a1a11){return _0x1a1a11[_0x8895('0x26')]()['then'](function(){_0x11857f['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0xaf17c8,_0x588390){return function(_0x4e1a28){if(!_0x4e1a28){_0xaf17c8[_0x8895('0x17')](0x194);}return _0x4e1a28;};}function handleError(_0x363c8b,_0x163b7a){_0x163b7a=_0x163b7a||0x1f4;return function(_0x2e08d8){logger[_0x8895('0x27')](_0x2e08d8['stack']);if(_0x2e08d8[_0x8895('0x28')]){delete _0x2e08d8[_0x8895('0x28')];}_0x363c8b['status'](_0x163b7a)[_0x8895('0x29')](_0x2e08d8);};}exports[_0x8895('0x2a')]=function(_0x1d30d8,_0x5cf6b3){var _0x270220={},_0x2bf580={},_0x3743ea={'count':0x0,'rows':[]};var _0x23ac21=_['map'](db[_0x8895('0x2b')][_0x8895('0x2c')],function(_0x5cb107){return{'name':_0x5cb107[_0x8895('0x2d')],'type':_0x5cb107['type']['key']};});_0x2bf580[_0x8895('0x2e')]=_['map'](_0x23ac21,_0x8895('0x28'));_0x2bf580[_0x8895('0x2f')]=_[_0x8895('0x30')](_0x1d30d8[_0x8895('0x2f')]);_0x2bf580[_0x8895('0x31')]=_[_0x8895('0x32')](_0x2bf580[_0x8895('0x2e')],_0x2bf580[_0x8895('0x2f')]);_0x270220[_0x8895('0x33')]=_[_0x8895('0x32')](_0x2bf580[_0x8895('0x2e')],qs[_0x8895('0x34')](_0x1d30d8[_0x8895('0x2f')][_0x8895('0x34')]));_0x270220[_0x8895('0x33')]=_0x270220[_0x8895('0x33')]['length']?_0x270220[_0x8895('0x33')]:_0x2bf580[_0x8895('0x2e')];if(!_0x1d30d8[_0x8895('0x2f')][_0x8895('0x35')]('nolimit')){_0x270220['limit']=qs[_0x8895('0x1d')](_0x1d30d8[_0x8895('0x2f')][_0x8895('0x1d')]);_0x270220[_0x8895('0x1a')]=qs[_0x8895('0x1a')](_0x1d30d8['query'][_0x8895('0x1a')]);}_0x270220[_0x8895('0x36')]=qs['sort'](_0x1d30d8[_0x8895('0x2f')][_0x8895('0x37')]);_0x270220[_0x8895('0x38')]=qs[_0x8895('0x31')](_['pick'](_0x1d30d8[_0x8895('0x2f')],_0x2bf580[_0x8895('0x31')]),_0x23ac21);if(_0x1d30d8[_0x8895('0x2f')][_0x8895('0x39')]){_0x270220['where']=_[_0x8895('0x3a')](_0x270220[_0x8895('0x38')],{'$or':_[_0x8895('0x3b')](_0x23ac21,function(_0x3c2f88){if(_0x3c2f88[_0x8895('0x3c')]!=='VIRTUAL'){var _0x3ffccf={};_0x3ffccf[_0x3c2f88[_0x8895('0x28')]]={'$like':'%'+_0x1d30d8[_0x8895('0x2f')][_0x8895('0x39')]+'%'};return _0x3ffccf;}})});}_0x270220=_[_0x8895('0x3a')]({},_0x270220,_0x1d30d8[_0x8895('0x3d')]);var _0x11dc85={'where':_0x270220['where']};return db[_0x8895('0x2b')][_0x8895('0x1c')](_0x11dc85)['then'](function(_0xf99b10){_0x3743ea[_0x8895('0x1c')]=_0xf99b10;if(_0x1d30d8[_0x8895('0x2f')][_0x8895('0x3e')]){_0x270220[_0x8895('0x3f')]=[{'all':!![]}];}return db['CmHopperHistory']['findAll'](_0x270220);})[_0x8895('0x25')](function(_0x1466c3){_0x3743ea[_0x8895('0x40')]=_0x1466c3;return _0x3743ea;})[_0x8895('0x25')](respondWithFilteredResult(_0x5cf6b3,_0x270220))[_0x8895('0x41')](handleError(_0x5cf6b3,null));};exports[_0x8895('0x42')]=function(_0xb3b118,_0x33cc09){var _0x4ebd7a={'raw':!![],'where':{'id':_0xb3b118['params']['id']}},_0x4ba405={};_0x4ba405[_0x8895('0x2e')]=_[_0x8895('0x30')](db['CmHopperHistory'][_0x8895('0x2c')]);_0x4ba405[_0x8895('0x2f')]=_[_0x8895('0x30')](_0xb3b118['query']);_0x4ba405[_0x8895('0x31')]=_[_0x8895('0x32')](_0x4ba405[_0x8895('0x2e')],_0x4ba405[_0x8895('0x2f')]);_0x4ebd7a[_0x8895('0x33')]=_['intersection'](_0x4ba405[_0x8895('0x2e')],qs[_0x8895('0x34')](_0xb3b118[_0x8895('0x2f')][_0x8895('0x34')]));_0x4ebd7a[_0x8895('0x33')]=_0x4ebd7a[_0x8895('0x33')]['length']?_0x4ebd7a[_0x8895('0x33')]:_0x4ba405[_0x8895('0x2e')];if(_0xb3b118[_0x8895('0x2f')][_0x8895('0x3e')]){_0x4ebd7a['include']=[{'all':!![]}];}_0x4ebd7a=_[_0x8895('0x3a')]({},_0x4ebd7a,_0xb3b118[_0x8895('0x3d')]);return db[_0x8895('0x2b')][_0x8895('0x43')](_0x4ebd7a)['then'](handleEntityNotFound(_0x33cc09,null))['then'](respondWithResult(_0x33cc09,null))[_0x8895('0x41')](handleError(_0x33cc09,null));};exports[_0x8895('0x44')]=function(_0x502e99,_0x447a0e){return db['CmHopperHistory'][_0x8895('0x44')](_0x502e99[_0x8895('0x45')],{})[_0x8895('0x25')](respondWithResult(_0x447a0e,0xc9))[_0x8895('0x41')](handleError(_0x447a0e,null));};exports[_0x8895('0x46')]=function(_0x53a410,_0x51cdd1){return db['CmHopperHistory'][_0x8895('0x46')]()[_0x8895('0x25')](respondWithResult(_0x51cdd1,null))['catch'](handleError(_0x51cdd1,null));};exports[_0x8895('0x24')]=function(_0x2c9fcf,_0x198947){if(_0x2c9fcf[_0x8895('0x45')]['uniqueid']){delete _0x2c9fcf['body'][_0x8895('0x47')];}return db[_0x8895('0x2b')][_0x8895('0x43')]({'where':{'uniqueid':_0x2c9fcf[_0x8895('0x48')]['id']}})[_0x8895('0x25')](handleEntityNotFound(_0x198947,null))[_0x8895('0x25')](saveUpdates(_0x2c9fcf[_0x8895('0x45')],null))[_0x8895('0x25')](respondWithResult(_0x198947,null))['catch'](handleError(_0x198947,null));}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.model.js b/server/api/cmHopperHistory/cmHopperHistory.model.js index 7d063dc..09c596f 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 _0x3d04=['bluebird','request-promise','path','../../config/environment','./cmHopperHistory.attributes','exports','endtime','uniqueid','lodash','util','../../config/logger','api','moment'];(function(_0x34b634,_0x38bb9f){var _0x2616f5=function(_0x466f85){while(--_0x466f85){_0x34b634['push'](_0x34b634['shift']());}};_0x2616f5(++_0x38bb9f);}(_0x3d04,0xbe));var _0x43d0=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x3d04[_0x501510];return _0x1e6ee5;};'use strict';var _=require(_0x43d0('0x0'));var util=require(_0x43d0('0x1'));var logger=require(_0x43d0('0x2'))(_0x43d0('0x3'));var moment=require(_0x43d0('0x4'));var BPromise=require(_0x43d0('0x5'));var rp=require(_0x43d0('0x6'));var fs=require('fs');var path=require(_0x43d0('0x7'));var rimraf=require('rimraf');var config=require(_0x43d0('0x8'));var attributes=require(_0x43d0('0x9'));module[_0x43d0('0xa')]=function(_0x617bf,_0x5e284f){return _0x617bf['define']('CmHopperHistory',attributes,{'tableName':'cm_hopper_history','paranoid':![],'indexes':[{'name':_0x43d0('0xb'),'fields':[_0x43d0('0xb')]},{'name':_0x43d0('0xc'),'fields':[_0x43d0('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x8f4c=['endtime','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','exports','CmHopperHistory'];(function(_0x456fb1,_0x859a1d){var _0x4083d6=function(_0xe1d0f2){while(--_0xe1d0f2){_0x456fb1['push'](_0x456fb1['shift']());}};_0x4083d6(++_0x859a1d);}(_0x8f4c,0x113));var _0xc8f4=function(_0x164609,_0x45890e){_0x164609=_0x164609-0x0;var _0x4a1a05=_0x8f4c[_0x164609];return _0x4a1a05;};'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('./cmHopperHistory.attributes');module[_0xc8f4('0x9')]=function(_0x5208da,_0x4c86f8){return _0x5208da['define'](_0xc8f4('0xa'),attributes,{'tableName':'cm_hopper_history','paranoid':![],'indexes':[{'name':_0xc8f4('0xb'),'fields':[_0xc8f4('0xb')]},{'name':_0xc8f4('0xc'),'fields':[_0xc8f4('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.rpc.js b/server/api/cmHopperHistory/cmHopperHistory.rpc.js index 42aa4a4..3b1d866 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 _0xd41f=['predictiveIntervalDroppedCallsTimeout','`state`\x20=\x2011,\x201,\x20null','predictiveIntervalDroppedCallsCallersExit','AVG','`state`\x20=\x204,\x20`holdtime`,\x20null','predictiveIntervalAvgTalktime','name','`state`\x20=\x200,\x201,\x20null','`state`\x20=\x203,\x201,\x20null','outboundNoAnswerCallsDay','outboundAnswerCallsDay','`state`\x20=\x205,\x201,\x20null','outboundBusyCallsDay','outboundCongestionCallsDay','`state`\x20=\x2010\x20,\x201,\x20null','outboundDropCallsDayTimeout','`state`\x20=\x2011\x20,\x201,\x20null','outboundDropCallsDayCallersExit','`state`\x20=\x2012,\x201,\x20null','outboundUnknownCallsDay','`state`\x20=\x2013,\x201,\x20null','outboundBlacklistCallsDay','`state`\x20=\x2014,\x201,\x20null','outboundRejectCallsDay','`state`\x20=\x2016,\x201,\x20null','outboundAnswerAgiCallsDay','`state`\x20=\x2020,\x201,\x20null','`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null','outboundReCallsDay','campaign','GetVoiceQueueHopperHistory','GetCampaignHopperHistory','`state`\x20=\x204,\x201,\x20null','ivrAnswerCallsDay','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','jayson/promise','http','request','then','info','CmHopperHistory,\x20%s,\x20%s','stringify','code','error','message','request\x20sent','result','catch','CmHopperHistory','create','body','options','raw','debug','CreateCmHopperHistory','AvgHandleTime','findAll','where','sequelize','col','COUNT','literal','predictiveIntervalAnsweredCalls','`state`\x20=\x2010,\x201,\x20null'];(function(_0x362a69,_0x48bdc7){var _0x2169c0=function(_0x16bf6a){while(--_0x16bf6a){_0x362a69['push'](_0x362a69['shift']());}};_0x2169c0(++_0x48bdc7);}(_0xd41f,0xf1));var _0xfd41=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xd41f[_0x321bb2];return _0x9c12ed;};'use strict';var _=require('lodash');var util=require(_0xfd41('0x0'));var moment=require(_0xfd41('0x1'));var BPromise=require('bluebird');var rs=require(_0xfd41('0x2'));var fs=require('fs');var Redis=require(_0xfd41('0x3'));var db=require(_0xfd41('0x4'))['db'];var utils=require(_0xfd41('0x5'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0xfd41('0x6'));var client=jayson['client'][_0xfd41('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x5a1f71,_0x3c4ba2,_0x289c13){return new BPromise(function(_0x5e9bf2,_0x898a79){return client[_0xfd41('0x8')](_0x5a1f71,_0x289c13)[_0xfd41('0x9')](function(_0x4fdd6f){logger[_0xfd41('0xa')](_0xfd41('0xb'),_0x3c4ba2,'request\x20sent');logger['debug']('CmHopperHistory,\x20%s,\x20%s,\x20%s',_0x3c4ba2,'request\x20sent',JSON[_0xfd41('0xc')](_0x4fdd6f));if(_0x4fdd6f['error']){if(_0x4fdd6f['error'][_0xfd41('0xd')]===0x1f4){logger[_0xfd41('0xe')]('CmHopperHistory,\x20%s,\x20%s',_0x3c4ba2,_0x4fdd6f[_0xfd41('0xe')]['message']);return _0x898a79(_0x4fdd6f['error'][_0xfd41('0xf')]);}logger[_0xfd41('0xe')]('CmHopperHistory,\x20%s,\x20%s',_0x3c4ba2,_0x4fdd6f[_0xfd41('0xe')][_0xfd41('0xf')]);return _0x5e9bf2(_0x4fdd6f[_0xfd41('0xe')][_0xfd41('0xf')]);}else{logger[_0xfd41('0xa')](_0xfd41('0xb'),_0x3c4ba2,_0xfd41('0x10'));_0x5e9bf2(_0x4fdd6f[_0xfd41('0x11')][_0xfd41('0xf')]);}})[_0xfd41('0x12')](function(_0x5b9868){logger[_0xfd41('0xe')](_0xfd41('0xb'),_0x3c4ba2,_0x5b9868);_0x898a79(_0x5b9868);});});}exports['CreateCmHopperHistory']=function(_0x471da4){var _0x27c002=this;return new Promise(function(_0x1befad,_0x47f413){return db[_0xfd41('0x13')][_0xfd41('0x14')](_0x471da4[_0xfd41('0x15')],{'raw':_0x471da4[_0xfd41('0x16')]?_0x471da4[_0xfd41('0x16')][_0xfd41('0x17')]===undefined?!![]:![]:!![]})[_0xfd41('0x9')](function(_0x542863){logger[_0xfd41('0xa')]('CreateCmHopperHistory',_0x471da4);logger[_0xfd41('0x18')](_0xfd41('0x19'),_0x471da4,JSON['stringify'](_0x542863));_0x1befad(_0x542863);})[_0xfd41('0x12')](function(_0x281be1){logger[_0xfd41('0xe')](_0xfd41('0x19'),_0x281be1[_0xfd41('0xf')],_0x471da4);_0x47f413(_0x27c002[_0xfd41('0xe')](0x1f4,_0x281be1[_0xfd41('0xf')]));});});};exports[_0xfd41('0x1a')]=function(_0x34c078){var _0x4739c0=this;return new Promise(function(_0x2ea394,_0x18ec63){return db[_0xfd41('0x13')][_0xfd41('0x1b')]({'raw':_0x34c078['options']?_0x34c078['options'][_0xfd41('0x17')]===undefined?!![]:![]:!![],'where':_0x34c078['options']?_0x34c078[_0xfd41('0x16')][_0xfd41('0x1c')]||null:null,'attributes':[[db['sequelize']['fn']('COUNT',db[_0xfd41('0x1d')][_0xfd41('0x1e')]('id')),'predictiveIntervalTotalCalls'],[db['sequelize']['fn'](_0xfd41('0x1f'),db['sequelize']['fn']('IF',db['sequelize'][_0xfd41('0x20')]('`state`\x20=\x204,\x201,\x20null'))),_0xfd41('0x21')],[db['sequelize']['fn'](_0xfd41('0x1f'),db[_0xfd41('0x1d')]['fn']('IF',db['sequelize'][_0xfd41('0x20')](_0xfd41('0x22')))),_0xfd41('0x23')],[db[_0xfd41('0x1d')]['fn']('COUNT',db[_0xfd41('0x1d')]['fn']('IF',db[_0xfd41('0x1d')]['literal'](_0xfd41('0x24')))),_0xfd41('0x25')],[db[_0xfd41('0x1d')]['fn'](_0xfd41('0x26'),db[_0xfd41('0x1d')]['fn']('IF',db['sequelize'][_0xfd41('0x20')](_0xfd41('0x27')))),'predictiveIntervalAvgHoldtime'],[db[_0xfd41('0x1d')]['fn']('AVG',db[_0xfd41('0x1d')]['fn']('IF',db[_0xfd41('0x1d')][_0xfd41('0x20')]('`state`\x20=\x204,\x20`talktime`,\x20null'))),_0xfd41('0x28')]]})[_0xfd41('0x9')](function(_0xb2fd1d){logger[_0xfd41('0xa')](_0xfd41('0x1a'),_0x34c078);logger[_0xfd41('0x18')]('AvgHandleTime',_0x34c078,JSON[_0xfd41('0xc')](_0xb2fd1d));_0x2ea394(_0xb2fd1d);})[_0xfd41('0x12')](function(_0x2da807){logger[_0xfd41('0xe')](_0xfd41('0x1a'),_0x2da807[_0xfd41('0xf')],_0x34c078);_0x18ec63(_0x4739c0[_0xfd41('0xe')](0x1f4,_0x2da807['message']));});});};exports['GetVoiceQueueHopperHistory']=function(_0x53c1af){var _0x1fcc40=this;return new Promise(function(_0x290d7c,_0x5980df){return db[_0xfd41('0x13')][_0xfd41('0x1b')]({'raw':_0x53c1af[_0xfd41('0x16')]?_0x53c1af[_0xfd41('0x16')][_0xfd41('0x17')]===undefined?!![]:![]:!![],'where':_0x53c1af[_0xfd41('0x16')]?_0x53c1af[_0xfd41('0x16')][_0xfd41('0x1c')]||null:null,'attributes':[['campaign',_0xfd41('0x29')],[db[_0xfd41('0x1d')]['fn'](_0xfd41('0x1f'),db[_0xfd41('0x1d')]['fn']('IF',db[_0xfd41('0x1d')][_0xfd41('0x20')](_0xfd41('0x2a')))),'outboundNoSuchCallsDay'],[db[_0xfd41('0x1d')]['fn'](_0xfd41('0x1f'),db[_0xfd41('0x1d')]['fn']('IF',db[_0xfd41('0x1d')][_0xfd41('0x20')](_0xfd41('0x2b')))),_0xfd41('0x2c')],[db[_0xfd41('0x1d')]['fn'](_0xfd41('0x1f'),db[_0xfd41('0x1d')]['fn']('IF',db[_0xfd41('0x1d')][_0xfd41('0x20')]('`state`\x20=\x204,\x201,\x20null'))),_0xfd41('0x2d')],[db['sequelize']['fn'](_0xfd41('0x1f'),db[_0xfd41('0x1d')]['fn']('IF',db[_0xfd41('0x1d')]['literal'](_0xfd41('0x2e')))),_0xfd41('0x2f')],[db[_0xfd41('0x1d')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0xfd41('0x1d')][_0xfd41('0x20')]('`state`\x20=\x208,\x201,\x20null'))),_0xfd41('0x30')],[db[_0xfd41('0x1d')]['fn'](_0xfd41('0x1f'),db[_0xfd41('0x1d')]['fn']('IF',db[_0xfd41('0x1d')][_0xfd41('0x20')](_0xfd41('0x31')))),_0xfd41('0x32')],[db[_0xfd41('0x1d')]['fn'](_0xfd41('0x1f'),db[_0xfd41('0x1d')]['fn']('IF',db['sequelize'][_0xfd41('0x20')](_0xfd41('0x33')))),_0xfd41('0x34')],[db[_0xfd41('0x1d')]['fn'](_0xfd41('0x1f'),db[_0xfd41('0x1d')]['fn']('IF',db[_0xfd41('0x1d')]['literal'](_0xfd41('0x35')))),_0xfd41('0x36')],[db[_0xfd41('0x1d')]['fn'](_0xfd41('0x1f'),db[_0xfd41('0x1d')]['fn']('IF',db[_0xfd41('0x1d')]['literal'](_0xfd41('0x37')))),_0xfd41('0x38')],[db[_0xfd41('0x1d')]['fn']('COUNT',db[_0xfd41('0x1d')]['fn']('IF',db[_0xfd41('0x1d')]['literal'](_0xfd41('0x39')))),'outboundOriginateFailureCallsDay'],[db[_0xfd41('0x1d')]['fn']('COUNT',db[_0xfd41('0x1d')]['fn']('IF',db[_0xfd41('0x1d')][_0xfd41('0x20')]('`state`\x20=\x2018,\x201,\x20null'))),_0xfd41('0x3a')],[db[_0xfd41('0x1d')]['fn'](_0xfd41('0x1f'),db['sequelize']['fn']('IF',db[_0xfd41('0x1d')][_0xfd41('0x20')](_0xfd41('0x3b')))),_0xfd41('0x3c')],[db[_0xfd41('0x1d')]['fn']('COUNT',db[_0xfd41('0x1d')]['fn']('IF',db[_0xfd41('0x1d')][_0xfd41('0x20')](_0xfd41('0x3d')))),'outboundRejectCallsDay'],[db['sequelize']['fn']('COUNT',db[_0xfd41('0x1d')]['fn']('IF',db[_0xfd41('0x1d')][_0xfd41('0x20')](_0xfd41('0x3e')))),_0xfd41('0x3f')]],'group':[_0xfd41('0x40')]})[_0xfd41('0x9')](function(_0x5f0966){logger[_0xfd41('0xa')]('GetVoiceQueueHopperHistory',_0x53c1af);logger[_0xfd41('0x18')](_0xfd41('0x41'),_0x53c1af,JSON[_0xfd41('0xc')](_0x5f0966));_0x290d7c(_0x5f0966);})['catch'](function(_0x4a2c52){logger['error'](_0xfd41('0x41'),_0x4a2c52[_0xfd41('0xf')],_0x53c1af);_0x5980df(_0x1fcc40[_0xfd41('0xe')](0x1f4,_0x4a2c52['message']));});});};exports[_0xfd41('0x42')]=function(_0x46c059){var _0x5adf0e=this;return new Promise(function(_0xea333a,_0x24305b){return db[_0xfd41('0x13')][_0xfd41('0x1b')]({'raw':_0x46c059['options']?_0x46c059[_0xfd41('0x16')][_0xfd41('0x17')]===undefined?!![]:![]:!![],'where':_0x46c059['options']?_0x46c059[_0xfd41('0x16')][_0xfd41('0x1c')]||null:null,'attributes':[[_0xfd41('0x40'),_0xfd41('0x29')],[db[_0xfd41('0x1d')]['fn'](_0xfd41('0x1f'),db[_0xfd41('0x1d')][_0xfd41('0x1e')]('id')),'ivrTotalCallsDays'],[db[_0xfd41('0x1d')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0xfd41('0x1d')]['literal'](_0xfd41('0x43')))),_0xfd41('0x44')]],'group':[_0xfd41('0x40')]})['then'](function(_0x39bb59){logger[_0xfd41('0xa')](_0xfd41('0x42'),_0x46c059);logger[_0xfd41('0x18')](_0xfd41('0x42'),_0x46c059,JSON['stringify'](_0x39bb59));_0xea333a(_0x39bb59);})[_0xfd41('0x12')](function(_0x484383){logger['error'](_0xfd41('0x42'),_0x484383[_0xfd41('0xf')],_0x46c059);_0x24305b(_0x5adf0e[_0xfd41('0xe')](0x1f4,_0x484383[_0xfd41('0xf')]));});});}; \ No newline at end of file +var _0x9d11=['options','raw','then','findAll','where','sequelize','COUNT','col','predictiveIntervalTotalCalls','`state`\x20=\x204,\x201,\x20null','predictiveIntervalAnsweredCalls','literal','`state`\x20=\x2010,\x201,\x20null','`state`\x20=\x2011,\x201,\x20null','predictiveIntervalDroppedCallsCallersExit','AVG','`state`\x20=\x204,\x20`holdtime`,\x20null','`state`\x20=\x204,\x20`talktime`,\x20null','predictiveIntervalAvgTalktime','AvgHandleTime','stringify','GetVoiceQueueHopperHistory','campaign','name','`state`\x20=\x200,\x201,\x20null','outboundNoSuchCallsDay','`state`\x20=\x203,\x201,\x20null','`state`\x20=\x205,\x201,\x20null','outboundBusyCallsDay','`state`\x20=\x208,\x201,\x20null','`state`\x20=\x2010\x20,\x201,\x20null','outboundDropCallsDayTimeout','outboundDropCallsDayCallersExit','outboundUnknownCallsDay','`state`\x20=\x2013,\x201,\x20null','`state`\x20=\x2014,\x201,\x20null','outboundOriginateFailureCallsDay','`state`\x20=\x2018,\x201,\x20null','`state`\x20=\x2016,\x201,\x20null','outboundAnswerAgiCallsDay','`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null','outboundReCallsDay','GetCampaignHopperHistory','ivrTotalCallsDays','ivrAnswerCallsDay','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','info','request\x20sent','debug','CmHopperHistory,\x20%s,\x20%s,\x20%s','error','code','CmHopperHistory,\x20%s,\x20%s','message','result','catch','CreateCmHopperHistory','CmHopperHistory'];(function(_0x51c52b,_0x147712){var _0x581ce3=function(_0x2e61a0){while(--_0x2e61a0){_0x51c52b['push'](_0x51c52b['shift']());}};_0x581ce3(++_0x147712);}(_0x9d11,0xb7));var _0x19d1=function(_0x12833b,_0x26c1d2){_0x12833b=_0x12833b-0x0;var _0x3acad3=_0x9d11[_0x12833b];return _0x3acad3;};'use strict';var _=require(_0x19d1('0x0'));var util=require(_0x19d1('0x1'));var moment=require(_0x19d1('0x2'));var BPromise=require(_0x19d1('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x19d1('0x4'));var db=require(_0x19d1('0x5'))['db'];var utils=require(_0x19d1('0x6'));var logger=require(_0x19d1('0x7'))(_0x19d1('0x8'));var config=require(_0x19d1('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x19d1('0xa')][_0x19d1('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4b624c,_0x16eaf9,_0x3dbe9f){return new BPromise(function(_0x2d9f9e,_0x3e2181){return client['request'](_0x4b624c,_0x3dbe9f)['then'](function(_0xc947ce){logger[_0x19d1('0xc')]('CmHopperHistory,\x20%s,\x20%s',_0x16eaf9,_0x19d1('0xd'));logger[_0x19d1('0xe')](_0x19d1('0xf'),_0x16eaf9,'request\x20sent',JSON['stringify'](_0xc947ce));if(_0xc947ce['error']){if(_0xc947ce[_0x19d1('0x10')][_0x19d1('0x11')]===0x1f4){logger[_0x19d1('0x10')](_0x19d1('0x12'),_0x16eaf9,_0xc947ce['error']['message']);return _0x3e2181(_0xc947ce[_0x19d1('0x10')]['message']);}logger['error'](_0x19d1('0x12'),_0x16eaf9,_0xc947ce[_0x19d1('0x10')][_0x19d1('0x13')]);return _0x2d9f9e(_0xc947ce[_0x19d1('0x10')][_0x19d1('0x13')]);}else{logger[_0x19d1('0xc')](_0x19d1('0x12'),_0x16eaf9,'request\x20sent');_0x2d9f9e(_0xc947ce[_0x19d1('0x14')][_0x19d1('0x13')]);}})[_0x19d1('0x15')](function(_0x5b5c4c){logger[_0x19d1('0x10')](_0x19d1('0x12'),_0x16eaf9,_0x5b5c4c);_0x3e2181(_0x5b5c4c);});});}exports[_0x19d1('0x16')]=function(_0x3df779){var _0x3144eb=this;return new Promise(function(_0xae72c5,_0x5c92bc){return db[_0x19d1('0x17')]['create'](_0x3df779['body'],{'raw':_0x3df779[_0x19d1('0x18')]?_0x3df779[_0x19d1('0x18')][_0x19d1('0x19')]===undefined?!![]:![]:!![]})[_0x19d1('0x1a')](function(_0x120a1c){logger['info']('CreateCmHopperHistory',_0x3df779);logger[_0x19d1('0xe')](_0x19d1('0x16'),_0x3df779,JSON['stringify'](_0x120a1c));_0xae72c5(_0x120a1c);})['catch'](function(_0x3cfd8a){logger[_0x19d1('0x10')](_0x19d1('0x16'),_0x3cfd8a[_0x19d1('0x13')],_0x3df779);_0x5c92bc(_0x3144eb[_0x19d1('0x10')](0x1f4,_0x3cfd8a[_0x19d1('0x13')]));});});};exports['AvgHandleTime']=function(_0x19f04d){var _0x226a66=this;return new Promise(function(_0x1e8de8,_0x597508){return db[_0x19d1('0x17')][_0x19d1('0x1b')]({'raw':_0x19f04d[_0x19d1('0x18')]?_0x19f04d[_0x19d1('0x18')][_0x19d1('0x19')]===undefined?!![]:![]:!![],'where':_0x19f04d[_0x19d1('0x18')]?_0x19f04d[_0x19d1('0x18')][_0x19d1('0x1c')]||null:null,'attributes':[[db[_0x19d1('0x1d')]['fn'](_0x19d1('0x1e'),db[_0x19d1('0x1d')][_0x19d1('0x1f')]('id')),_0x19d1('0x20')],[db[_0x19d1('0x1d')]['fn'](_0x19d1('0x1e'),db[_0x19d1('0x1d')]['fn']('IF',db[_0x19d1('0x1d')]['literal'](_0x19d1('0x21')))),_0x19d1('0x22')],[db[_0x19d1('0x1d')]['fn'](_0x19d1('0x1e'),db[_0x19d1('0x1d')]['fn']('IF',db[_0x19d1('0x1d')][_0x19d1('0x23')](_0x19d1('0x24')))),'predictiveIntervalDroppedCallsTimeout'],[db[_0x19d1('0x1d')]['fn'](_0x19d1('0x1e'),db[_0x19d1('0x1d')]['fn']('IF',db[_0x19d1('0x1d')]['literal'](_0x19d1('0x25')))),_0x19d1('0x26')],[db[_0x19d1('0x1d')]['fn'](_0x19d1('0x27'),db[_0x19d1('0x1d')]['fn']('IF',db[_0x19d1('0x1d')]['literal'](_0x19d1('0x28')))),'predictiveIntervalAvgHoldtime'],[db[_0x19d1('0x1d')]['fn'](_0x19d1('0x27'),db['sequelize']['fn']('IF',db[_0x19d1('0x1d')][_0x19d1('0x23')](_0x19d1('0x29')))),_0x19d1('0x2a')]]})['then'](function(_0x2d2fe7){logger['info'](_0x19d1('0x2b'),_0x19f04d);logger[_0x19d1('0xe')](_0x19d1('0x2b'),_0x19f04d,JSON[_0x19d1('0x2c')](_0x2d2fe7));_0x1e8de8(_0x2d2fe7);})['catch'](function(_0x5ded04){logger[_0x19d1('0x10')](_0x19d1('0x2b'),_0x5ded04[_0x19d1('0x13')],_0x19f04d);_0x597508(_0x226a66['error'](0x1f4,_0x5ded04[_0x19d1('0x13')]));});});};exports[_0x19d1('0x2d')]=function(_0x2dcb4f){var _0x4e841a=this;return new Promise(function(_0x261960,_0x539efa){return db[_0x19d1('0x17')][_0x19d1('0x1b')]({'raw':_0x2dcb4f[_0x19d1('0x18')]?_0x2dcb4f[_0x19d1('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x2dcb4f[_0x19d1('0x18')]?_0x2dcb4f['options'][_0x19d1('0x1c')]||null:null,'attributes':[[_0x19d1('0x2e'),_0x19d1('0x2f')],[db[_0x19d1('0x1d')]['fn']('COUNT',db[_0x19d1('0x1d')]['fn']('IF',db[_0x19d1('0x1d')][_0x19d1('0x23')](_0x19d1('0x30')))),_0x19d1('0x31')],[db[_0x19d1('0x1d')]['fn'](_0x19d1('0x1e'),db[_0x19d1('0x1d')]['fn']('IF',db['sequelize'][_0x19d1('0x23')](_0x19d1('0x32')))),'outboundNoAnswerCallsDay'],[db[_0x19d1('0x1d')]['fn'](_0x19d1('0x1e'),db[_0x19d1('0x1d')]['fn']('IF',db[_0x19d1('0x1d')]['literal']('`state`\x20=\x204,\x201,\x20null'))),'outboundAnswerCallsDay'],[db['sequelize']['fn'](_0x19d1('0x1e'),db['sequelize']['fn']('IF',db['sequelize'][_0x19d1('0x23')](_0x19d1('0x33')))),_0x19d1('0x34')],[db['sequelize']['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x19d1('0x1d')][_0x19d1('0x23')](_0x19d1('0x35')))),'outboundCongestionCallsDay'],[db['sequelize']['fn'](_0x19d1('0x1e'),db[_0x19d1('0x1d')]['fn']('IF',db[_0x19d1('0x1d')]['literal'](_0x19d1('0x36')))),_0x19d1('0x37')],[db[_0x19d1('0x1d')]['fn']('COUNT',db[_0x19d1('0x1d')]['fn']('IF',db[_0x19d1('0x1d')][_0x19d1('0x23')]('`state`\x20=\x2011\x20,\x201,\x20null'))),_0x19d1('0x38')],[db[_0x19d1('0x1d')]['fn'](_0x19d1('0x1e'),db['sequelize']['fn']('IF',db[_0x19d1('0x1d')]['literal']('`state`\x20=\x2012,\x201,\x20null'))),_0x19d1('0x39')],[db[_0x19d1('0x1d')]['fn'](_0x19d1('0x1e'),db[_0x19d1('0x1d')]['fn']('IF',db['sequelize'][_0x19d1('0x23')](_0x19d1('0x3a')))),'outboundBlacklistCallsDay'],[db[_0x19d1('0x1d')]['fn'](_0x19d1('0x1e'),db['sequelize']['fn']('IF',db[_0x19d1('0x1d')][_0x19d1('0x23')](_0x19d1('0x3b')))),_0x19d1('0x3c')],[db['sequelize']['fn'](_0x19d1('0x1e'),db[_0x19d1('0x1d')]['fn']('IF',db[_0x19d1('0x1d')][_0x19d1('0x23')](_0x19d1('0x3d')))),'outboundRejectCallsDay'],[db['sequelize']['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x19d1('0x1d')][_0x19d1('0x23')](_0x19d1('0x3e')))),_0x19d1('0x3f')],[db['sequelize']['fn'](_0x19d1('0x1e'),db[_0x19d1('0x1d')]['fn']('IF',db[_0x19d1('0x1d')][_0x19d1('0x23')]('`state`\x20=\x2020,\x201,\x20null'))),'outboundRejectCallsDay'],[db[_0x19d1('0x1d')]['fn'](_0x19d1('0x1e'),db[_0x19d1('0x1d')]['fn']('IF',db[_0x19d1('0x1d')][_0x19d1('0x23')](_0x19d1('0x40')))),_0x19d1('0x41')]],'group':['campaign']})[_0x19d1('0x1a')](function(_0x5114ab){logger[_0x19d1('0xc')]('GetVoiceQueueHopperHistory',_0x2dcb4f);logger[_0x19d1('0xe')](_0x19d1('0x2d'),_0x2dcb4f,JSON[_0x19d1('0x2c')](_0x5114ab));_0x261960(_0x5114ab);})[_0x19d1('0x15')](function(_0x3804db){logger['error']('GetVoiceQueueHopperHistory',_0x3804db['message'],_0x2dcb4f);_0x539efa(_0x4e841a[_0x19d1('0x10')](0x1f4,_0x3804db[_0x19d1('0x13')]));});});};exports[_0x19d1('0x42')]=function(_0x3f405e){var _0x48a06a=this;return new Promise(function(_0x1d5118,_0x198882){return db[_0x19d1('0x17')][_0x19d1('0x1b')]({'raw':_0x3f405e[_0x19d1('0x18')]?_0x3f405e[_0x19d1('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x3f405e['options']?_0x3f405e[_0x19d1('0x18')][_0x19d1('0x1c')]||null:null,'attributes':[[_0x19d1('0x2e'),'name'],[db[_0x19d1('0x1d')]['fn']('COUNT',db[_0x19d1('0x1d')][_0x19d1('0x1f')]('id')),_0x19d1('0x43')],[db[_0x19d1('0x1d')]['fn']('COUNT',db[_0x19d1('0x1d')]['fn']('IF',db[_0x19d1('0x1d')][_0x19d1('0x23')]('`state`\x20=\x204,\x201,\x20null'))),_0x19d1('0x44')]],'group':[_0x19d1('0x2e')]})[_0x19d1('0x1a')](function(_0xebd340){logger['info'](_0x19d1('0x42'),_0x3f405e);logger[_0x19d1('0xe')]('GetCampaignHopperHistory',_0x3f405e,JSON[_0x19d1('0x2c')](_0xebd340));_0x1d5118(_0xebd340);})[_0x19d1('0x15')](function(_0x11ea3b){logger[_0x19d1('0x10')](_0x19d1('0x42'),_0x11ea3b[_0x19d1('0x13')],_0x3f405e);_0x198882(_0x48a06a[_0x19d1('0x10')](0x1f4,_0x11ea3b[_0x19d1('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/index.js b/server/api/cmHopperHistory/index.js index 5a69b16..276e22d 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 _0x910b=['/:id','post','create','put','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperHistory.controller','isAuthenticated','/describe','get'];(function(_0x1f55f9,_0xf5c554){var _0x885614=function(_0x9747d3){while(--_0x9747d3){_0x1f55f9['push'](_0x1f55f9['shift']());}};_0x885614(++_0xf5c554);}(_0x910b,0x191));var _0xb910=function(_0x1f699c,_0x4fdfb8){_0x1f699c=_0x1f699c-0x0;var _0x20bf91=_0x910b[_0x1f699c];return _0x20bf91;};'use strict';var multer=require(_0xb910('0x0'));var util=require(_0xb910('0x1'));var path=require(_0xb910('0x2'));var timeout=require('connect-timeout');var express=require(_0xb910('0x3'));var router=express[_0xb910('0x4')]();var fs_extra=require(_0xb910('0x5'));var auth=require(_0xb910('0x6'));var interaction=require(_0xb910('0x7'));var config=require(_0xb910('0x8'));var controller=require(_0xb910('0x9'));router['get']('/',auth[_0xb910('0xa')](),controller['index']);router['get'](_0xb910('0xb'),auth[_0xb910('0xa')](),controller['describe']);router[_0xb910('0xc')](_0xb910('0xd'),auth[_0xb910('0xa')](),controller['show']);router[_0xb910('0xe')]('/',auth[_0xb910('0xa')](),controller[_0xb910('0xf')]);router[_0xb910('0x10')](_0xb910('0xd'),auth['isAuthenticated'](),controller['update']);module[_0xb910('0x11')]=router; \ No newline at end of file +var _0x815e=['/:id','show','post','create','put','update','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','describe'];(function(_0x36ad38,_0x4f9808){var _0x14b9f3=function(_0x1186ea){while(--_0x1186ea){_0x36ad38['push'](_0x36ad38['shift']());}};_0x14b9f3(++_0x4f9808);}(_0x815e,0xd2));var _0xe815=function(_0x41111d,_0x34b744){_0x41111d=_0x41111d-0x0;var _0x431009=_0x815e[_0x41111d];return _0x431009;};'use strict';var multer=require(_0xe815('0x0'));var util=require(_0xe815('0x1'));var path=require(_0xe815('0x2'));var timeout=require('connect-timeout');var express=require(_0xe815('0x3'));var router=express[_0xe815('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xe815('0x5'));var interaction=require(_0xe815('0x6'));var config=require(_0xe815('0x7'));var controller=require('./cmHopperHistory.controller');router[_0xe815('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0xe815('0x8')]('/describe',auth[_0xe815('0x9')](),controller[_0xe815('0xa')]);router[_0xe815('0x8')](_0xe815('0xb'),auth['isAuthenticated'](),controller[_0xe815('0xc')]);router[_0xe815('0xd')]('/',auth['isAuthenticated'](),controller[_0xe815('0xe')]);router[_0xe815('0xf')](_0xe815('0xb'),auth[_0xe815('0x9')](),controller[_0xe815('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/cmList/cmList.attributes.js b/server/api/cmList/cmList.attributes.js index ae4b162..5cc12dd 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 _0x4ce6=['sequelize','STRING','name'];(function(_0x322649,_0x38162e){var _0x44a7d2=function(_0x2293c4){while(--_0x2293c4){_0x322649['push'](_0x322649['shift']());}};_0x44a7d2(++_0x38162e);}(_0x4ce6,0x108));var _0x64ce=function(_0x205e5a,_0x5c19fb){_0x205e5a=_0x205e5a-0x0;var _0x10da58=_0x4ce6[_0x205e5a];return _0x10da58;};'use strict';var Sequelize=require(_0x64ce('0x0'));module['exports']={'name':{'type':Sequelize[_0x64ce('0x1')],'unique':_0x64ce('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x64ce('0x1')]},'dialPrefix':{'type':Sequelize[_0x64ce('0x1')]}}; \ No newline at end of file +var _0x7b27=['sequelize','STRING','name'];(function(_0x3479a3,_0x44a0f3){var _0x381248=function(_0x573eac){while(--_0x573eac){_0x3479a3['push'](_0x3479a3['shift']());}};_0x381248(++_0x44a0f3);}(_0x7b27,0x186));var _0x77b2=function(_0x2fb25f,_0x4e3ee1){_0x2fb25f=_0x2fb25f-0x0;var _0x27d838=_0x7b27[_0x2fb25f];return _0x27d838;};'use strict';var Sequelize=require(_0x77b2('0x0'));module['exports']={'name':{'type':Sequelize[_0x77b2('0x1')],'unique':_0x77b2('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x77b2('0x1')]},'dialPrefix':{'type':Sequelize[_0x77b2('0x1')]}}; \ No newline at end of file diff --git a/server/api/cmList/cmList.controller.js b/server/api/cmList/cmList.controller.js index c25ae5a..df3b150 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 _0x2f27=['addAgents','spread','emit','userCmList:save','removeAgents','userCmList:remove','User','getAgents','eml-format','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./cmList.socket','status','end','json','offset','undefined','count','set','Content-Range','reject','save','update','then','get','Lists','UserProfileResource','destroy','error','stack','name','index','CmList','type','key','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','order','where','pick','filter','merge','VIRTUAL','includeAll','findAll','rows','catch','show','rawAttributes','include','options','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','ListId','Disposition','findOne','sort','removeDispositions','ids','addContacts','CmContact','tags','isArray','join','push','each','omit','success','dataValues','message','getContacts','CmCustomField','format','raw','getContactsCsv','concat','CustomFields','cf_%d','isEmpty','writeFileSync','/tmp/list_%d_%s.csv','Content-disposition','attachment;\x20filename=','setHeader','Content-type','download','sendStatus','addCustomField','sequelize','transaction','addCustomFields','Sequelize','TEXT','INTEGER','switch','defaultValue','addColumn','cm_contacts','cf_%s','getCustomFields','findAndCountAll'];(function(_0x491a7f,_0x28bb80){var _0x3d8f44=function(_0xdaa716){while(--_0xdaa716){_0x491a7f['push'](_0x491a7f['shift']());}};_0x3d8f44(++_0x28bb80);}(_0x2f27,0x126));var _0x72f2=function(_0x3b1f3c,_0x5dd8a2){_0x3b1f3c=_0x3b1f3c-0x0;var _0x43e1df=_0x2f27[_0x3b1f3c];return _0x43e1df;};'use strict';var emlformat=require(_0x72f2('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x72f2('0x1'));var moment=require(_0x72f2('0x2'));var BPromise=require(_0x72f2('0x3'));var Mustache=require(_0x72f2('0x4'));var util=require(_0x72f2('0x5'));var path=require(_0x72f2('0x6'));var sox=require(_0x72f2('0x7'));var csv=require(_0x72f2('0x8'));var ejs=require(_0x72f2('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x72f2('0xa'));var squel=require(_0x72f2('0xb'));var crypto=require(_0x72f2('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x72f2('0xd'));var toCsv=require(_0x72f2('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x72f2('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x72f2('0xf'));var hardwareService=require(_0x72f2('0x10'));var logger=require(_0x72f2('0x11'))(_0x72f2('0x12'));var utils=require('../../config/utils');var config=require(_0x72f2('0x13'));var licenseUtil=require(_0x72f2('0x14'));var db=require(_0x72f2('0x15'))['db'];config[_0x72f2('0x16')]=_[_0x72f2('0x17')](config['redis'],{'host':_0x72f2('0x18'),'port':0x18eb});var socket=require(_0x72f2('0x19'))(new Redis(config['redis']));require(_0x72f2('0x1a'))['register'](socket);function respondWithStatusCode(_0x494eda,_0x16934d){_0x16934d=_0x16934d||0xcc;return function(_0x493d0b){if(_0x493d0b){return _0x494eda['sendStatus'](_0x16934d);}return _0x494eda[_0x72f2('0x1b')](_0x16934d)[_0x72f2('0x1c')]();};}function respondWithResult(_0x1c1c50,_0x709d11){_0x709d11=_0x709d11||0xc8;return function(_0x5b3f46){if(_0x5b3f46){return _0x1c1c50[_0x72f2('0x1b')](_0x709d11)[_0x72f2('0x1d')](_0x5b3f46);}};}function respondWithFilteredResult(_0x155847,_0x3c008f){return function(_0x1ba6dd){if(_0x1ba6dd){var _0x330370=typeof _0x3c008f[_0x72f2('0x1e')]===_0x72f2('0x1f')&&typeof _0x3c008f['limit']===_0x72f2('0x1f');var _0x36708e=_0x1ba6dd[_0x72f2('0x20')];var _0x1e9802=_0x330370?0x0:_0x3c008f[_0x72f2('0x1e')];var _0x2324f2=_0x330370?_0x1ba6dd[_0x72f2('0x20')]:_0x3c008f[_0x72f2('0x1e')]+_0x3c008f['limit'];var _0x4edd2d;if(_0x2324f2>=_0x36708e){_0x2324f2=_0x36708e;_0x4edd2d=0xc8;}else{_0x4edd2d=0xce;}_0x155847[_0x72f2('0x1b')](_0x4edd2d);return _0x155847[_0x72f2('0x21')](_0x72f2('0x22'),_0x1e9802+'-'+_0x2324f2+'/'+_0x36708e)[_0x72f2('0x1d')](_0x1ba6dd);}return null;};}function patchUpdates(_0x4357aa){return function(_0x721ee4){try{jsonpatch['apply'](_0x721ee4,_0x4357aa,!![]);}catch(_0x51f35f){return BPromise[_0x72f2('0x23')](_0x51f35f);}return _0x721ee4[_0x72f2('0x24')]();};}function saveUpdates(_0xbc298f,_0x5a07e3){return function(_0x49d690){if(_0x49d690){return _0x49d690[_0x72f2('0x25')](_0xbc298f)[_0x72f2('0x26')](function(_0x5c3831){return _0x5c3831;});}return null;};}function removeEntity(_0x209087,_0x1b2805){return function(_0x21b6c1){if(_0x21b6c1){return _0x21b6c1['destroy']()['then'](function(){var _0x21ce35=_0x21b6c1[_0x72f2('0x27')]({'plain':!![]});var _0x370b3c=_0x72f2('0x28');return db[_0x72f2('0x29')][_0x72f2('0x2a')]({'where':{'type':_0x370b3c,'resourceId':_0x21ce35['id']}})[_0x72f2('0x26')](function(){return _0x21b6c1;});})[_0x72f2('0x26')](function(){_0x209087[_0x72f2('0x1b')](0xcc)[_0x72f2('0x1c')]();});}};}function handleEntityNotFound(_0x2945f8,_0x29b586){return function(_0x375eaf){if(!_0x375eaf){_0x2945f8['sendStatus'](0x194);}return _0x375eaf;};}function handleError(_0x5e111e,_0x313b10){_0x313b10=_0x313b10||0x1f4;return function(_0x44e2f8){logger[_0x72f2('0x2b')](_0x44e2f8[_0x72f2('0x2c')]);if(_0x44e2f8[_0x72f2('0x2d')]){delete _0x44e2f8[_0x72f2('0x2d')];}_0x5e111e[_0x72f2('0x1b')](_0x313b10)['send'](_0x44e2f8);};}exports[_0x72f2('0x2e')]=function(_0x296891,_0x235ee0){var _0x213d2d={},_0x211857={},_0x5c795c={'count':0x0,'rows':[]};var _0x3c1c29=_['map'](db[_0x72f2('0x2f')]['rawAttributes'],function(_0x37d17e){return{'name':_0x37d17e['fieldName'],'type':_0x37d17e[_0x72f2('0x30')][_0x72f2('0x31')]};});_0x211857[_0x72f2('0x32')]=_[_0x72f2('0x33')](_0x3c1c29,_0x72f2('0x2d'));_0x211857[_0x72f2('0x34')]=_[_0x72f2('0x35')](_0x296891['query']);_0x211857[_0x72f2('0x36')]=_[_0x72f2('0x37')](_0x211857[_0x72f2('0x32')],_0x211857['query']);_0x213d2d['attributes']=_['intersection'](_0x211857[_0x72f2('0x32')],qs[_0x72f2('0x38')](_0x296891[_0x72f2('0x34')]['fields']));_0x213d2d[_0x72f2('0x39')]=_0x213d2d['attributes'][_0x72f2('0x3a')]?_0x213d2d[_0x72f2('0x39')]:_0x211857['model'];if(!_0x296891['query'][_0x72f2('0x3b')](_0x72f2('0x3c'))){_0x213d2d[_0x72f2('0x3d')]=qs[_0x72f2('0x3d')](_0x296891['query'][_0x72f2('0x3d')]);_0x213d2d[_0x72f2('0x1e')]=qs[_0x72f2('0x1e')](_0x296891[_0x72f2('0x34')]['offset']);}_0x213d2d[_0x72f2('0x3e')]=qs['sort'](_0x296891[_0x72f2('0x34')]['sort']);_0x213d2d[_0x72f2('0x3f')]=qs[_0x72f2('0x36')](_[_0x72f2('0x40')](_0x296891['query'],_0x211857['filters']),_0x3c1c29);if(_0x296891[_0x72f2('0x34')][_0x72f2('0x41')]){_0x213d2d[_0x72f2('0x3f')]=_[_0x72f2('0x42')](_0x213d2d[_0x72f2('0x3f')],{'$or':_[_0x72f2('0x33')](_0x3c1c29,function(_0x1986d7){if(_0x1986d7['type']!==_0x72f2('0x43')){var _0x15ae22={};_0x15ae22[_0x1986d7[_0x72f2('0x2d')]]={'$like':'%'+_0x296891['query'][_0x72f2('0x41')]+'%'};return _0x15ae22;}})});}_0x213d2d=_[_0x72f2('0x42')]({},_0x213d2d,_0x296891['options']);var _0x5d82e7={'where':_0x213d2d['where']};return db['CmList'][_0x72f2('0x20')](_0x5d82e7)[_0x72f2('0x26')](function(_0x54affc){_0x5c795c[_0x72f2('0x20')]=_0x54affc;if(_0x296891[_0x72f2('0x34')][_0x72f2('0x44')]){_0x213d2d['include']=[{'all':!![]}];}return db[_0x72f2('0x2f')][_0x72f2('0x45')](_0x213d2d);})['then'](function(_0x49a99c){_0x5c795c[_0x72f2('0x46')]=_0x49a99c;return _0x5c795c;})['then'](respondWithFilteredResult(_0x235ee0,_0x213d2d))[_0x72f2('0x47')](handleError(_0x235ee0,null));};exports[_0x72f2('0x48')]=function(_0xd1a681,_0x17737c){var _0x9c5094={'raw':![],'where':{'id':_0xd1a681['params']['id']}},_0x214282={};_0x214282[_0x72f2('0x32')]=_[_0x72f2('0x35')](db[_0x72f2('0x2f')][_0x72f2('0x49')]);_0x214282[_0x72f2('0x34')]=_[_0x72f2('0x35')](_0xd1a681['query']);_0x214282[_0x72f2('0x36')]=_[_0x72f2('0x37')](_0x214282[_0x72f2('0x32')],_0x214282['query']);_0x9c5094['attributes']=_[_0x72f2('0x37')](_0x214282[_0x72f2('0x32')],qs[_0x72f2('0x38')](_0xd1a681['query'][_0x72f2('0x38')]));_0x9c5094[_0x72f2('0x39')]=_0x9c5094[_0x72f2('0x39')][_0x72f2('0x3a')]?_0x9c5094['attributes']:_0x214282['model'];if(_0xd1a681[_0x72f2('0x34')][_0x72f2('0x44')]){_0x9c5094[_0x72f2('0x4a')]=[{'all':!![]}];}_0x9c5094=_[_0x72f2('0x42')]({},_0x9c5094,_0xd1a681[_0x72f2('0x4b')]);return db[_0x72f2('0x2f')]['find'](_0x9c5094)['then'](handleEntityNotFound(_0x17737c,null))['then'](respondWithResult(_0x17737c,null))['catch'](handleError(_0x17737c,null));};exports[_0x72f2('0x4c')]=function(_0x446481,_0x468ca0){return db['CmList'][_0x72f2('0x4c')](_0x446481[_0x72f2('0x4d')],{})[_0x72f2('0x26')](function(_0x26b927){var _0x31e79f=_0x446481[_0x72f2('0x4e')][_0x72f2('0x27')]({'plain':!![]});if(!_0x31e79f)throw new Error(_0x72f2('0x4f'));if(_0x31e79f[_0x72f2('0x50')]===_0x72f2('0x4e')){var _0x25737c=_0x26b927[_0x72f2('0x27')]({'plain':!![]});var _0x3f8b53=_0x72f2('0x28');return db[_0x72f2('0x51')][_0x72f2('0x52')]({'where':{'name':_0x3f8b53,'userProfileId':_0x31e79f[_0x72f2('0x53')]},'raw':!![]})['then'](function(_0x551471){if(_0x551471&&_0x551471['autoAssociation']===0x0){return db[_0x72f2('0x29')][_0x72f2('0x4c')]({'name':_0x25737c['name'],'resourceId':_0x25737c['id'],'type':_0x551471[_0x72f2('0x2d')],'sectionId':_0x551471['id']},{})[_0x72f2('0x26')](function(){return _0x26b927;});}else{return _0x26b927;}})[_0x72f2('0x47')](function(_0x26dcf5){logger['error'](_0x72f2('0x54'),_0x26dcf5);throw _0x26dcf5;});}return _0x26b927;})[_0x72f2('0x26')](respondWithResult(_0x468ca0,0xc9))['catch'](handleError(_0x468ca0,null));};exports[_0x72f2('0x25')]=function(_0xca50de,_0x376151){if(_0xca50de[_0x72f2('0x4d')]['id']){delete _0xca50de[_0x72f2('0x4d')]['id'];}return db['CmList'][_0x72f2('0x52')]({'where':{'id':_0xca50de[_0x72f2('0x55')]['id']}})[_0x72f2('0x26')](handleEntityNotFound(_0x376151,null))['then'](saveUpdates(_0xca50de[_0x72f2('0x4d')],null))[_0x72f2('0x26')](respondWithResult(_0x376151,null))[_0x72f2('0x47')](handleError(_0x376151,null));};exports[_0x72f2('0x2a')]=function(_0x11f484,_0x60751a){return db[_0x72f2('0x2f')]['find']({'where':{'id':_0x11f484[_0x72f2('0x55')]['id']}})[_0x72f2('0x26')](handleEntityNotFound(_0x60751a,null))[_0x72f2('0x26')](removeEntity(_0x60751a,null))[_0x72f2('0x47')](handleError(_0x60751a,null));};exports[_0x72f2('0x56')]=function(_0x3588f1,_0x6ca98){return db[_0x72f2('0x2f')][_0x72f2('0x56')]()['then'](respondWithResult(_0x6ca98,null))[_0x72f2('0x47')](handleError(_0x6ca98,null));};exports['addDisposition']=function(_0x1397cd,_0x2d7749,_0x2a098c){if(_0x1397cd[_0x72f2('0x4d')]['id']){delete _0x1397cd['body']['id'];}return db[_0x72f2('0x2f')][_0x72f2('0x52')]({'where':{'id':_0x1397cd['params']['id']}})[_0x72f2('0x26')](handleEntityNotFound(_0x2d7749,null))['then'](function(_0x3c281e){if(_0x3c281e){_0x1397cd[_0x72f2('0x4d')][_0x72f2('0x57')]=_0x3c281e['id'];return db[_0x72f2('0x58')][_0x72f2('0x4c')](_0x1397cd['body']);}})[_0x72f2('0x26')](respondWithResult(_0x2d7749,null))[_0x72f2('0x47')](handleError(_0x2d7749,null));};exports['getDispositions']=function(_0x40f97d,_0x13371c,_0x5b40e9){var _0x55f3a1={'raw':![],'where':{}};var _0x45f42c={};var _0x3e07cf={'count':0x0,'rows':[]};return db[_0x72f2('0x2f')][_0x72f2('0x59')]({'where':{'id':_0x40f97d['params']['id']}})[_0x72f2('0x26')](handleEntityNotFound(_0x13371c,null))['then'](function(_0x422b43){if(_0x422b43){_0x45f42c[_0x72f2('0x32')]=_['keys'](db['Disposition'][_0x72f2('0x49')]);_0x45f42c[_0x72f2('0x34')]=_[_0x72f2('0x35')](_0x40f97d[_0x72f2('0x34')]);_0x45f42c['filters']=_[_0x72f2('0x37')](_0x45f42c[_0x72f2('0x32')],_0x45f42c[_0x72f2('0x34')]);_0x55f3a1[_0x72f2('0x39')]=_[_0x72f2('0x37')](_0x45f42c[_0x72f2('0x32')],qs[_0x72f2('0x38')](_0x40f97d['query'][_0x72f2('0x38')]));_0x55f3a1[_0x72f2('0x39')]=_0x55f3a1[_0x72f2('0x39')][_0x72f2('0x3a')]?_0x55f3a1['attributes']:_0x45f42c[_0x72f2('0x32')];if(!_0x40f97d[_0x72f2('0x34')][_0x72f2('0x3b')](_0x72f2('0x3c'))){_0x55f3a1[_0x72f2('0x3d')]=qs[_0x72f2('0x3d')](_0x40f97d['query'][_0x72f2('0x3d')]);_0x55f3a1[_0x72f2('0x1e')]=qs['offset'](_0x40f97d['query'][_0x72f2('0x1e')]);}_0x55f3a1[_0x72f2('0x3e')]=qs[_0x72f2('0x5a')](_0x40f97d['query']['sort']);_0x55f3a1[_0x72f2('0x3f')]=qs[_0x72f2('0x36')](_[_0x72f2('0x40')](_0x40f97d[_0x72f2('0x34')],_0x45f42c[_0x72f2('0x36')]));_0x55f3a1['where']['ListId']=_0x422b43['id'];if(_0x40f97d[_0x72f2('0x34')][_0x72f2('0x41')]){_0x55f3a1[_0x72f2('0x3f')]=_[_0x72f2('0x42')](_0x55f3a1[_0x72f2('0x3f')],{'$or':_['map'](_0x55f3a1[_0x72f2('0x39')],function(_0x253bb5){var _0x4a3d07={};_0x4a3d07[_0x253bb5]={'$like':'%'+_0x40f97d[_0x72f2('0x34')][_0x72f2('0x41')]+'%'};return _0x4a3d07;})});}_0x55f3a1=_[_0x72f2('0x42')]({},_0x55f3a1,_0x40f97d[_0x72f2('0x4b')]);return db[_0x72f2('0x58')][_0x72f2('0x20')]({'where':_0x55f3a1[_0x72f2('0x3f')]})[_0x72f2('0x26')](function(_0x2b17d0){_0x3e07cf[_0x72f2('0x20')]=_0x2b17d0;if(_0x40f97d[_0x72f2('0x34')][_0x72f2('0x44')]){_0x55f3a1[_0x72f2('0x4a')]=[{'all':!![]}];}return db[_0x72f2('0x58')][_0x72f2('0x45')](_0x55f3a1);})[_0x72f2('0x26')](function(_0x7e76dd){_0x3e07cf['rows']=_0x7e76dd;return _0x3e07cf;});}})['then'](respondWithFilteredResult(_0x13371c,_0x55f3a1))[_0x72f2('0x47')](handleError(_0x13371c,null));};exports[_0x72f2('0x5b')]=function(_0x342f34,_0xc401d2,_0x4a7a6e){return db[_0x72f2('0x2f')][_0x72f2('0x52')]({'where':{'id':_0x342f34[_0x72f2('0x55')]['id']}})[_0x72f2('0x26')](handleEntityNotFound(_0xc401d2,null))[_0x72f2('0x26')](function(_0x52d834){if(_0x52d834){return _0x52d834[_0x72f2('0x5b')](_0x342f34[_0x72f2('0x34')][_0x72f2('0x5c')]);}})['then'](respondWithStatusCode(_0xc401d2,null))[_0x72f2('0x47')](handleError(_0xc401d2,null));};exports[_0x72f2('0x5d')]=function(_0x3efcaa,_0x5a5e5e,_0x5b8c87){return db[_0x72f2('0x2f')][_0x72f2('0x52')]({'where':{'id':_0x3efcaa[_0x72f2('0x55')]['id']}})[_0x72f2('0x26')](handleEntityNotFound(_0x5a5e5e,null))[_0x72f2('0x26')](function(_0x2b8fb1){if(_0x2b8fb1){var _0x8ae708=[];var _0x521225={'success':[],'errors':[]};return db[_0x72f2('0x5e')][_0x72f2('0x56')]()[_0x72f2('0x26')](function(_0x3864e2){if(_0x3efcaa[_0x72f2('0x4d')][_0x72f2('0x5f')]&&_[_0x72f2('0x60')](_0x3efcaa[_0x72f2('0x4d')][_0x72f2('0x5f')])){if(_0x3efcaa[_0x72f2('0x4d')][_0x72f2('0x5f')][_0x72f2('0x3a')]){_0x3efcaa[_0x72f2('0x4d')]['tags']=_0x3efcaa[_0x72f2('0x4d')][_0x72f2('0x5f')][_0x72f2('0x61')](';')+';';}else{_0x3efcaa[_0x72f2('0x4d')][_0x72f2('0x5f')]=null;}}else{_0x3efcaa['body'][_0x72f2('0x5f')]=null;}if(_0x3efcaa[_0x72f2('0x4d')]&&_[_0x72f2('0x60')](_0x3efcaa[_0x72f2('0x4d')])){for(var _0x325bae=0x0;_0x325bae<_0x3efcaa[_0x72f2('0x4d')][_0x72f2('0x3a')];_0x325bae+=0x1){_0x3efcaa[_0x72f2('0x4d')][_0x325bae][_0x72f2('0x57')]=_0x3efcaa[_0x72f2('0x55')]['id'];_0x8ae708[_0x72f2('0x62')](_0x3efcaa['body'][_0x325bae]);}return BPromise[_0x72f2('0x63')](_0x8ae708,function(_0x4b5b6b){return db[_0x72f2('0x5e')][_0x72f2('0x4c')](_[_0x72f2('0x64')](_0x4b5b6b,['ids','id'])||{},{'fields':_['keys'](_0x3864e2),'raw':!![]})['then'](function(_0x2a0ba3){_0x521225[_0x72f2('0x65')]['push'](_0x2a0ba3[_0x72f2('0x66')]);})[_0x72f2('0x47')](function(_0x1c1d57){_0x521225['errors'][_0x72f2('0x62')]({'data':_0x4b5b6b,'error':_0x1c1d57[_0x72f2('0x67')]});});})[_0x72f2('0x26')](function(_0x3f451a){return _0x521225;})['catch'](function(_0x48a193){return _0x48a193;});}else{_0x5a5e5e[_0x72f2('0x1b')](0x190)[_0x72f2('0x1d')]({'message':'Malformed\x20request\x20syntax'});}});}})[_0x72f2('0x26')](respondWithResult(_0x5a5e5e,null))['catch'](handleError(_0x5a5e5e,null));};exports[_0x72f2('0x68')]=function(_0x10ebac,_0x2ea8d7,_0xf6d8cd){var _0x57290f;return db[_0x72f2('0x2f')][_0x72f2('0x52')]({'where':{'id':_0x10ebac[_0x72f2('0x55')]['id']},'include':[{'model':db[_0x72f2('0x69')],'as':'CustomFields'}]})[_0x72f2('0x26')](handleEntityNotFound(_0x2ea8d7,null))[_0x72f2('0x26')](function(_0x51bf55){if(_0x51bf55){_0x57290f=_0x51bf55;return db['CmContact']['rawAttributes'];}})[_0x72f2('0x26')](function(_0x3f2628){if(_0x3f2628){var _0x382c2e={};var _0x59fb37={};_0x59fb37['model']=_['concat'](_[_0x72f2('0x35')](_0x3f2628),_[_0x72f2('0x33')](_0x57290f['CustomFields'],function(_0x3ca02c){return util[_0x72f2('0x6a')]('cf_%d',_0x3ca02c['id']);}));_0x59fb37['query']=_['keys'](_0x10ebac[_0x72f2('0x34')]);_0x59fb37[_0x72f2('0x36')]=_['intersection'](_0x59fb37['model'],_0x59fb37[_0x72f2('0x34')]);_0x382c2e['attributes']=_[_0x72f2('0x37')](_0x59fb37['model'],qs[_0x72f2('0x38')](_0x10ebac[_0x72f2('0x34')][_0x72f2('0x38')]));_0x382c2e['attributes']=_0x382c2e['attributes'][_0x72f2('0x3a')]?_0x382c2e[_0x72f2('0x39')]:_0x59fb37[_0x72f2('0x32')];if(!_0x10ebac['query'][_0x72f2('0x3b')]('nolimit')){_0x382c2e[_0x72f2('0x3d')]=qs['limit'](_0x10ebac[_0x72f2('0x34')][_0x72f2('0x3d')]);_0x382c2e[_0x72f2('0x1e')]=qs[_0x72f2('0x1e')](_0x10ebac[_0x72f2('0x34')][_0x72f2('0x1e')]);}_0x382c2e[_0x72f2('0x3e')]=qs[_0x72f2('0x5a')](_0x10ebac['query'][_0x72f2('0x5a')]);_0x382c2e[_0x72f2('0x3f')]=qs['filters'](_[_0x72f2('0x40')](_0x10ebac[_0x72f2('0x34')],_0x59fb37[_0x72f2('0x36')]));_0x382c2e[_0x72f2('0x6b')]=!![];if(_0x10ebac[_0x72f2('0x34')][_0x72f2('0x41')]){_0x382c2e[_0x72f2('0x3f')]=_[_0x72f2('0x42')](_0x382c2e[_0x72f2('0x3f')],{'$or':_['map'](_0x382c2e['attributes'],function(_0x16d911){var _0x21699c={};_0x21699c[_0x16d911]={'$like':'%'+_0x10ebac[_0x72f2('0x34')][_0x72f2('0x41')]+'%'};return _0x21699c;})});}_0x382c2e=_['merge']({},_0x382c2e,_0x10ebac[_0x72f2('0x4b')]);return _0x57290f[_0x72f2('0x68')](_0x382c2e);}})[_0x72f2('0x26')](respondWithResult(_0x2ea8d7,null))[_0x72f2('0x47')](handleError(_0x2ea8d7,null));};exports[_0x72f2('0x6c')]=function(_0x41adb4,_0x247850,_0x5bb632){var _0x4627ae;return db[_0x72f2('0x2f')][_0x72f2('0x52')]({'where':{'id':_0x41adb4[_0x72f2('0x55')]['id']},'include':[{'model':db[_0x72f2('0x69')],'as':'CustomFields'}]})[_0x72f2('0x26')](handleEntityNotFound(_0x247850,null))[_0x72f2('0x26')](function(_0x2911c2){if(_0x2911c2){_0x4627ae=_0x2911c2;return db[_0x72f2('0x5e')][_0x72f2('0x49')];}})[_0x72f2('0x26')](function(_0x485054){if(_0x485054){var _0x140b96={};var _0x44eb83={};_0x44eb83['model']=_[_0x72f2('0x6d')](_[_0x72f2('0x35')](_0x485054),_['map'](_0x4627ae[_0x72f2('0x6e')],function(_0x40f0f2){return util[_0x72f2('0x6a')](_0x72f2('0x6f'),_0x40f0f2['id']);}));_0x44eb83[_0x72f2('0x34')]=_[_0x72f2('0x35')](_0x41adb4[_0x72f2('0x34')]);_0x44eb83[_0x72f2('0x36')]=_[_0x72f2('0x37')](_0x44eb83[_0x72f2('0x32')],_0x44eb83['query']);_0x140b96[_0x72f2('0x39')]=_[_0x72f2('0x37')](_0x44eb83[_0x72f2('0x32')],qs[_0x72f2('0x38')](_0x41adb4[_0x72f2('0x34')]['fields']));_0x140b96[_0x72f2('0x39')]=_0x140b96[_0x72f2('0x39')][_0x72f2('0x3a')]?_0x140b96[_0x72f2('0x39')]:_0x44eb83[_0x72f2('0x32')];if(!_0x41adb4[_0x72f2('0x34')]['hasOwnProperty'](_0x72f2('0x3c'))){_0x140b96[_0x72f2('0x3d')]=qs[_0x72f2('0x3d')](_0x41adb4[_0x72f2('0x34')][_0x72f2('0x3d')]);_0x140b96['offset']=qs[_0x72f2('0x1e')](_0x41adb4[_0x72f2('0x34')][_0x72f2('0x1e')]);}_0x140b96['order']=qs[_0x72f2('0x5a')](_0x41adb4['query'][_0x72f2('0x5a')]);_0x140b96['where']=qs[_0x72f2('0x36')](_['pick'](_0x41adb4[_0x72f2('0x34')],_0x44eb83[_0x72f2('0x36')]));_0x140b96[_0x72f2('0x6b')]=!![];if(_0x41adb4[_0x72f2('0x34')]['filter']){_0x140b96[_0x72f2('0x3f')]=_['merge'](_0x140b96[_0x72f2('0x3f')],{'$or':_[_0x72f2('0x33')](_0x140b96['attributes'],function(_0x245d3c){var _0x3c661d={};_0x3c661d[_0x245d3c]={'$like':'%'+_0x41adb4['query']['filter']+'%'};return _0x3c661d;})});}_0x140b96=_[_0x72f2('0x42')]({},_0x140b96,_0x41adb4[_0x72f2('0x4b')]);return _0x4627ae[_0x72f2('0x68')](_0x140b96);}})[_0x72f2('0x26')](function(_0x56d7cc){if(!_[_0x72f2('0x70')](_0x56d7cc)){var _0x46d1d1=toCsv(_0x56d7cc);var _0x6a046d=Date['now']();fs[_0x72f2('0x71')](util[_0x72f2('0x6a')](_0x72f2('0x72'),_0x4627ae['id'],_0x6a046d),_0x46d1d1);_0x247850['setHeader'](_0x72f2('0x73'),_0x72f2('0x74')+util[_0x72f2('0x6a')]('list_%d_%s.csv',_0x4627ae['id'],_0x6a046d));_0x247850[_0x72f2('0x75')](_0x72f2('0x76'),'text/csv');return _0x247850[_0x72f2('0x77')](util[_0x72f2('0x6a')]('/tmp/list_%d_%s.csv',_0x4627ae['id'],_0x6a046d));}else{return _0x247850[_0x72f2('0x78')](0xcc);}})['catch'](handleError(_0x247850,null));};exports[_0x72f2('0x79')]=function(_0x142257,_0x32f6d5,_0x6d3a59){var _0x43c70f;delete _0x142257['body']['id'];return db[_0x72f2('0x2f')][_0x72f2('0x59')]({'where':{'id':_0x142257[_0x72f2('0x55')]['id']}})[_0x72f2('0x26')](handleEntityNotFound(_0x32f6d5,null))[_0x72f2('0x26')](function(_0x1e7718){if(_0x1e7718){return db[_0x72f2('0x7a')][_0x72f2('0x7b')](function(_0x179c96){return db[_0x72f2('0x69')]['create'](_0x142257[_0x72f2('0x4d')],{'transaction':_0x179c96})[_0x72f2('0x26')](function(_0x2c09e5){_0x43c70f=_0x2c09e5;return _0x1e7718[_0x72f2('0x7c')](_0x2c09e5,{'transaction':_0x179c96});})[_0x72f2('0x26')](function(){var _0x419461={'type':db[_0x72f2('0x7d')][_0x72f2('0x7e')],'transaction':_0x179c96};switch(_0x142257['body'][_0x72f2('0x30')]){case'text':_0x419461[_0x72f2('0x30')]=db[_0x72f2('0x7d')]['TEXT'];break;case'number':_0x419461[_0x72f2('0x30')]=db[_0x72f2('0x7d')][_0x72f2('0x7f')];break;case _0x72f2('0x80'):_0x419461['type']=db[_0x72f2('0x7d')]['BOOLEAN'];_0x419461[_0x72f2('0x81')]=![];break;default:}return db[_0x72f2('0x7a')]['queryInterface'][_0x72f2('0x82')](_0x72f2('0x83'),util[_0x72f2('0x6a')](_0x72f2('0x84'),_0x43c70f['id']),_0x419461);})['then'](function(){return _0x43c70f;});});}})[_0x72f2('0x26')](respondWithResult(_0x32f6d5,null))[_0x72f2('0x47')](handleError(_0x32f6d5,null));};exports[_0x72f2('0x85')]=function(_0x5cde56,_0x53d9ef,_0x3ed897){var _0x5d145f={};var _0x38e9d6={};var _0x47dc1a;var _0x2a4131;return db['CmList'][_0x72f2('0x59')]({'where':{'id':_0x5cde56[_0x72f2('0x55')]['id']}})['then'](handleEntityNotFound(_0x53d9ef,null))[_0x72f2('0x26')](function(_0x9154fd){if(_0x9154fd){_0x47dc1a=_0x9154fd;_0x38e9d6[_0x72f2('0x32')]=_['keys'](db[_0x72f2('0x69')][_0x72f2('0x49')]);_0x38e9d6['query']=_[_0x72f2('0x35')](_0x5cde56['query']);_0x38e9d6[_0x72f2('0x36')]=_[_0x72f2('0x37')](_0x38e9d6['model'],_0x38e9d6[_0x72f2('0x34')]);_0x5d145f['attributes']=_[_0x72f2('0x37')](_0x38e9d6['model'],qs['fields'](_0x5cde56[_0x72f2('0x34')]['fields']));_0x5d145f[_0x72f2('0x39')]=_0x5d145f[_0x72f2('0x39')][_0x72f2('0x3a')]?_0x5d145f[_0x72f2('0x39')]:_0x38e9d6[_0x72f2('0x32')];_0x5d145f[_0x72f2('0x3e')]=qs[_0x72f2('0x5a')](_0x5cde56[_0x72f2('0x34')][_0x72f2('0x5a')]);_0x5d145f[_0x72f2('0x3f')]=qs[_0x72f2('0x36')](_['pick'](_0x5cde56['query'],_0x38e9d6[_0x72f2('0x36')]));_0x5d145f[_0x72f2('0x3f')]=_[_0x72f2('0x42')](_0x5d145f[_0x72f2('0x3f')],{'$or':[{'ListId':_0x9154fd['id']},{'ListId':null}]});if(_0x5cde56[_0x72f2('0x34')][_0x72f2('0x41')]){_0x5d145f['where']=_[_0x72f2('0x42')](_0x5d145f['where'],{'$or':_[_0x72f2('0x33')](_0x5d145f[_0x72f2('0x39')],function(_0xea048a){var _0x20d743={};_0x20d743[_0xea048a]={'$like':'%'+_0x5cde56[_0x72f2('0x34')][_0x72f2('0x41')]+'%'};return _0x20d743;})});}_0x5d145f=_[_0x72f2('0x42')]({},_0x5d145f,_0x5cde56[_0x72f2('0x4b')]);return db[_0x72f2('0x69')][_0x72f2('0x86')](_0x5d145f);}})['then'](respondWithResult(_0x53d9ef,null))['catch'](handleError(_0x53d9ef,null));};exports[_0x72f2('0x87')]=function(_0x125fad,_0x591476,_0x4d1599){return db[_0x72f2('0x2f')][_0x72f2('0x52')]({'where':{'id':_0x125fad['params']['id']}})[_0x72f2('0x26')](handleEntityNotFound(_0x591476,null))[_0x72f2('0x26')](function(_0xa72f3a){if(_0xa72f3a){return _0xa72f3a[_0x72f2('0x87')](_0x125fad[_0x72f2('0x4d')][_0x72f2('0x5c')],_['omit'](_0x125fad[_0x72f2('0x4d')],[_0x72f2('0x5c'),'id'])||{})[_0x72f2('0x88')](function(_0x1daa73){for(var _0x368cb7=0x0;_0x368cb7<_0x125fad[_0x72f2('0x4d')]['ids'][_0x72f2('0x3a')];_0x368cb7+=0x1){socket[_0x72f2('0x89')](_0x72f2('0x8a'),{'UserId':Number(_0x125fad['body']['ids'][_0x368cb7]),'CmListId':Number(_0x125fad['params']['id'])});}return _0x1daa73;});}})[_0x72f2('0x26')](respondWithResult(_0x591476,null))['catch'](handleError(_0x591476,null));};exports[_0x72f2('0x8b')]=function(_0x387282,_0x59c2b3,_0x2d6fac){return db[_0x72f2('0x2f')][_0x72f2('0x52')]({'where':{'id':_0x387282['params']['id']}})['then'](handleEntityNotFound(_0x59c2b3,null))[_0x72f2('0x26')](function(_0x17fe08){if(_0x17fe08){return _0x17fe08['removeAgents'](_0x387282[_0x72f2('0x34')]['ids'])['then'](function(){if(_[_0x72f2('0x60')](_0x387282[_0x72f2('0x34')]['ids'])){for(var _0x15415b=0x0;_0x15415b<_0x387282[_0x72f2('0x34')][_0x72f2('0x5c')][_0x72f2('0x3a')];_0x15415b+=0x1){socket[_0x72f2('0x89')](_0x72f2('0x8c'),{'UserId':Number(_0x387282[_0x72f2('0x34')][_0x72f2('0x5c')][_0x15415b]),'CmListId':Number(_0x387282[_0x72f2('0x55')]['id'])});}}else{socket[_0x72f2('0x89')](_0x72f2('0x8c'),{'UserId':Number(_0x387282[_0x72f2('0x34')]['ids']),'CmListId':Number(_0x387282[_0x72f2('0x55')]['id'])});}});}})[_0x72f2('0x26')](respondWithStatusCode(_0x59c2b3,null))[_0x72f2('0x47')](handleError(_0x59c2b3,null));};exports['getAgents']=function(_0x5d0267,_0x48f825,_0x15225e){var _0x268b13={};var _0x1259e5={};var _0x2b97cb;var _0x58ace5;return db['CmList'][_0x72f2('0x59')]({'where':{'id':_0x5d0267[_0x72f2('0x55')]['id']}})[_0x72f2('0x26')](handleEntityNotFound(_0x48f825,null))['then'](function(_0x2910e7){if(_0x2910e7){_0x2b97cb=_0x2910e7;_0x1259e5[_0x72f2('0x32')]=_['keys'](db[_0x72f2('0x8d')][_0x72f2('0x49')]);_0x1259e5['query']=_[_0x72f2('0x35')](_0x5d0267[_0x72f2('0x34')]);_0x1259e5[_0x72f2('0x36')]=_[_0x72f2('0x37')](_0x1259e5[_0x72f2('0x32')],_0x1259e5[_0x72f2('0x34')]);_0x268b13[_0x72f2('0x39')]=_[_0x72f2('0x37')](_0x1259e5[_0x72f2('0x32')],qs[_0x72f2('0x38')](_0x5d0267[_0x72f2('0x34')][_0x72f2('0x38')]));_0x268b13[_0x72f2('0x39')]=_0x268b13['attributes'][_0x72f2('0x3a')]?_0x268b13[_0x72f2('0x39')]:_0x1259e5[_0x72f2('0x32')];_0x268b13['order']=qs['sort'](_0x5d0267[_0x72f2('0x34')][_0x72f2('0x5a')]);_0x268b13[_0x72f2('0x3f')]=qs['filters'](_[_0x72f2('0x40')](_0x5d0267['query'],_0x1259e5[_0x72f2('0x36')]));if(_0x5d0267['query'][_0x72f2('0x41')]){_0x268b13[_0x72f2('0x3f')]=_['merge'](_0x268b13['where'],{'$or':_[_0x72f2('0x33')](_0x268b13[_0x72f2('0x39')],function(_0x3886d9){var _0x5b3222={};_0x5b3222[_0x3886d9]={'$like':'%'+_0x5d0267[_0x72f2('0x34')]['filter']+'%'};return _0x5b3222;})});}_0x268b13=_['merge']({},_0x268b13,_0x5d0267[_0x72f2('0x4b')]);return _0x2b97cb[_0x72f2('0x8e')](_0x268b13);}})[_0x72f2('0x26')](function(_0x6eaf56){if(_0x6eaf56){_0x58ace5=_0x6eaf56[_0x72f2('0x3a')];if(!_0x5d0267['query'][_0x72f2('0x3b')](_0x72f2('0x3c'))){_0x268b13['limit']=qs[_0x72f2('0x3d')](_0x5d0267['query'][_0x72f2('0x3d')]);_0x268b13['offset']=qs[_0x72f2('0x1e')](_0x5d0267['query'][_0x72f2('0x1e')]);}return _0x2b97cb['getAgents'](_0x268b13);}})['then'](function(_0x599ba7){if(_0x599ba7){return _0x599ba7?{'count':_0x58ace5,'rows':_0x599ba7}:null;}})[_0x72f2('0x26')](respondWithResult(_0x48f825,null))['catch'](handleError(_0x48f825,null));}; \ No newline at end of file +var _0x24ac=['zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','defaults','localhost','redis','./cmList.socket','register','sendStatus','status','end','offset','limit','undefined','count','set','json','apply','reject','save','update','then','destroy','get','Lists','UserProfileResource','error','stack','name','index','map','CmList','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','includeAll','include','catch','params','keys','rawAttributes','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','body','addDisposition','ListId','Disposition','getDispositions','findOne','pick','options','findAll','rows','removeDispositions','ids','addContacts','describe','isArray','tags','join','push','each','CmContact','success','Malformed\x20request\x20syntax','CmCustomField','CustomFields','concat','format','raw','getContacts','isEmpty','now','writeFileSync','/tmp/list_%d_%s.csv','setHeader','Content-disposition','attachment;\x20filename=','text/csv','download','addCustomField','sequelize','transaction','addCustomFields','TEXT','text','number','Sequelize','INTEGER','switch','BOOLEAN','queryInterface','addColumn','cf_%s','getCustomFields','addAgents','spread','emit','userCmList:save','removeAgents','userCmList:remove','getAgents','User','eml-format','rimraf'];(function(_0x2160a9,_0x3cbd9e){var _0xa88cf7=function(_0x51ab6f){while(--_0x51ab6f){_0x2160a9['push'](_0x2160a9['shift']());}};_0xa88cf7(++_0x3cbd9e);}(_0x24ac,0x120));var _0xc24a=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x24ac[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xc24a('0x0'));var rimraf=require(_0xc24a('0x1'));var zipdir=require(_0xc24a('0x2'));var jsonpatch=require(_0xc24a('0x3'));var rp=require(_0xc24a('0x4'));var moment=require(_0xc24a('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xc24a('0x6'));var util=require(_0xc24a('0x7'));var path=require(_0xc24a('0x8'));var sox=require(_0xc24a('0x9'));var csv=require(_0xc24a('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc24a('0xb'));var _=require(_0xc24a('0xc'));var squel=require(_0xc24a('0xd'));var crypto=require(_0xc24a('0xe'));var jsforce=require(_0xc24a('0xf'));var deskjs=require(_0xc24a('0x10'));var toCsv=require(_0xc24a('0xa'));var querystring=require('querystring');var Papa=require(_0xc24a('0x11'));var Redis=require(_0xc24a('0x12'));var authService=require(_0xc24a('0x13'));var qs=require(_0xc24a('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xc24a('0x15'))(_0xc24a('0x16'));var utils=require('../../config/utils');var config=require(_0xc24a('0x17'));var licenseUtil=require(_0xc24a('0x18'));var db=require(_0xc24a('0x19'))['db'];config['redis']=_[_0xc24a('0x1a')](config['redis'],{'host':_0xc24a('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xc24a('0x1c')]));require(_0xc24a('0x1d'))[_0xc24a('0x1e')](socket);function respondWithStatusCode(_0x5cde6f,_0x23cbff){_0x23cbff=_0x23cbff||0xcc;return function(_0x705bde){if(_0x705bde){return _0x5cde6f[_0xc24a('0x1f')](_0x23cbff);}return _0x5cde6f[_0xc24a('0x20')](_0x23cbff)[_0xc24a('0x21')]();};}function respondWithResult(_0x42652e,_0x498b44){_0x498b44=_0x498b44||0xc8;return function(_0x4e0c2f){if(_0x4e0c2f){return _0x42652e[_0xc24a('0x20')](_0x498b44)['json'](_0x4e0c2f);}};}function respondWithFilteredResult(_0x24a10f,_0x6c89fd){return function(_0x34a2db){if(_0x34a2db){var _0x10f405=typeof _0x6c89fd[_0xc24a('0x22')]==='undefined'&&typeof _0x6c89fd[_0xc24a('0x23')]===_0xc24a('0x24');var _0x2dba24=_0x34a2db[_0xc24a('0x25')];var _0x32daf6=_0x10f405?0x0:_0x6c89fd[_0xc24a('0x22')];var _0x27a6bf=_0x10f405?_0x34a2db[_0xc24a('0x25')]:_0x6c89fd['offset']+_0x6c89fd[_0xc24a('0x23')];var _0x5a6ea2;if(_0x27a6bf>=_0x2dba24){_0x27a6bf=_0x2dba24;_0x5a6ea2=0xc8;}else{_0x5a6ea2=0xce;}_0x24a10f['status'](_0x5a6ea2);return _0x24a10f[_0xc24a('0x26')]('Content-Range',_0x32daf6+'-'+_0x27a6bf+'/'+_0x2dba24)[_0xc24a('0x27')](_0x34a2db);}return null;};}function patchUpdates(_0x32f1de){return function(_0x4236b2){try{jsonpatch[_0xc24a('0x28')](_0x4236b2,_0x32f1de,!![]);}catch(_0x107e5b){return BPromise[_0xc24a('0x29')](_0x107e5b);}return _0x4236b2[_0xc24a('0x2a')]();};}function saveUpdates(_0x37f57c,_0x4f0549){return function(_0x8155e7){if(_0x8155e7){return _0x8155e7[_0xc24a('0x2b')](_0x37f57c)[_0xc24a('0x2c')](function(_0x42e597){return _0x42e597;});}return null;};}function removeEntity(_0x29fb19,_0x16796d){return function(_0x8b59de){if(_0x8b59de){return _0x8b59de[_0xc24a('0x2d')]()[_0xc24a('0x2c')](function(){var _0x401ada=_0x8b59de[_0xc24a('0x2e')]({'plain':!![]});var _0x41862d=_0xc24a('0x2f');return db[_0xc24a('0x30')][_0xc24a('0x2d')]({'where':{'type':_0x41862d,'resourceId':_0x401ada['id']}})['then'](function(){return _0x8b59de;});})[_0xc24a('0x2c')](function(){_0x29fb19[_0xc24a('0x20')](0xcc)['end']();});}};}function handleEntityNotFound(_0x51314c,_0x5984f2){return function(_0x1fc49a){if(!_0x1fc49a){_0x51314c[_0xc24a('0x1f')](0x194);}return _0x1fc49a;};}function handleError(_0x2a051a,_0x530e8b){_0x530e8b=_0x530e8b||0x1f4;return function(_0x988315){logger[_0xc24a('0x31')](_0x988315[_0xc24a('0x32')]);if(_0x988315['name']){delete _0x988315[_0xc24a('0x33')];}_0x2a051a[_0xc24a('0x20')](_0x530e8b)['send'](_0x988315);};}exports[_0xc24a('0x34')]=function(_0x59ca8c,_0x128649){var _0x2e16a5={},_0x801dfc={},_0x1a1903={'count':0x0,'rows':[]};var _0x2966ef=_[_0xc24a('0x35')](db[_0xc24a('0x36')]['rawAttributes'],function(_0x3293c8){return{'name':_0x3293c8[_0xc24a('0x37')],'type':_0x3293c8[_0xc24a('0x38')][_0xc24a('0x39')]};});_0x801dfc[_0xc24a('0x3a')]=_[_0xc24a('0x35')](_0x2966ef,_0xc24a('0x33'));_0x801dfc[_0xc24a('0x3b')]=_['keys'](_0x59ca8c[_0xc24a('0x3b')]);_0x801dfc[_0xc24a('0x3c')]=_[_0xc24a('0x3d')](_0x801dfc[_0xc24a('0x3a')],_0x801dfc[_0xc24a('0x3b')]);_0x2e16a5[_0xc24a('0x3e')]=_[_0xc24a('0x3d')](_0x801dfc[_0xc24a('0x3a')],qs[_0xc24a('0x3f')](_0x59ca8c[_0xc24a('0x3b')][_0xc24a('0x3f')]));_0x2e16a5[_0xc24a('0x3e')]=_0x2e16a5[_0xc24a('0x3e')][_0xc24a('0x40')]?_0x2e16a5[_0xc24a('0x3e')]:_0x801dfc['model'];if(!_0x59ca8c[_0xc24a('0x3b')][_0xc24a('0x41')](_0xc24a('0x42'))){_0x2e16a5[_0xc24a('0x23')]=qs[_0xc24a('0x23')](_0x59ca8c[_0xc24a('0x3b')][_0xc24a('0x23')]);_0x2e16a5[_0xc24a('0x22')]=qs[_0xc24a('0x22')](_0x59ca8c['query']['offset']);}_0x2e16a5[_0xc24a('0x43')]=qs[_0xc24a('0x44')](_0x59ca8c['query'][_0xc24a('0x44')]);_0x2e16a5[_0xc24a('0x45')]=qs[_0xc24a('0x3c')](_['pick'](_0x59ca8c[_0xc24a('0x3b')],_0x801dfc[_0xc24a('0x3c')]),_0x2966ef);if(_0x59ca8c[_0xc24a('0x3b')][_0xc24a('0x46')]){_0x2e16a5[_0xc24a('0x45')]=_[_0xc24a('0x47')](_0x2e16a5['where'],{'$or':_[_0xc24a('0x35')](_0x2966ef,function(_0x3e8276){if(_0x3e8276[_0xc24a('0x38')]!==_0xc24a('0x48')){var _0xa222af={};_0xa222af[_0x3e8276[_0xc24a('0x33')]]={'$like':'%'+_0x59ca8c[_0xc24a('0x3b')][_0xc24a('0x46')]+'%'};return _0xa222af;}})});}_0x2e16a5=_[_0xc24a('0x47')]({},_0x2e16a5,_0x59ca8c['options']);var _0x13c80d={'where':_0x2e16a5['where']};return db[_0xc24a('0x36')][_0xc24a('0x25')](_0x13c80d)[_0xc24a('0x2c')](function(_0xa302da){_0x1a1903['count']=_0xa302da;if(_0x59ca8c[_0xc24a('0x3b')][_0xc24a('0x49')]){_0x2e16a5[_0xc24a('0x4a')]=[{'all':!![]}];}return db[_0xc24a('0x36')]['findAll'](_0x2e16a5);})[_0xc24a('0x2c')](function(_0x219b77){_0x1a1903['rows']=_0x219b77;return _0x1a1903;})[_0xc24a('0x2c')](respondWithFilteredResult(_0x128649,_0x2e16a5))[_0xc24a('0x4b')](handleError(_0x128649,null));};exports['show']=function(_0x4b4e3c,_0x4ae7c7){var _0x521e7f={'raw':![],'where':{'id':_0x4b4e3c[_0xc24a('0x4c')]['id']}},_0x39f3d9={};_0x39f3d9[_0xc24a('0x3a')]=_[_0xc24a('0x4d')](db['CmList'][_0xc24a('0x4e')]);_0x39f3d9['query']=_[_0xc24a('0x4d')](_0x4b4e3c['query']);_0x39f3d9[_0xc24a('0x3c')]=_[_0xc24a('0x3d')](_0x39f3d9[_0xc24a('0x3a')],_0x39f3d9[_0xc24a('0x3b')]);_0x521e7f['attributes']=_[_0xc24a('0x3d')](_0x39f3d9['model'],qs['fields'](_0x4b4e3c['query'][_0xc24a('0x3f')]));_0x521e7f[_0xc24a('0x3e')]=_0x521e7f[_0xc24a('0x3e')]['length']?_0x521e7f[_0xc24a('0x3e')]:_0x39f3d9[_0xc24a('0x3a')];if(_0x4b4e3c[_0xc24a('0x3b')][_0xc24a('0x49')]){_0x521e7f['include']=[{'all':!![]}];}_0x521e7f=_[_0xc24a('0x47')]({},_0x521e7f,_0x4b4e3c['options']);return db[_0xc24a('0x36')][_0xc24a('0x4f')](_0x521e7f)['then'](handleEntityNotFound(_0x4ae7c7,null))[_0xc24a('0x2c')](respondWithResult(_0x4ae7c7,null))[_0xc24a('0x4b')](handleError(_0x4ae7c7,null));};exports[_0xc24a('0x50')]=function(_0x20f00c,_0x6a24e4){return db[_0xc24a('0x36')][_0xc24a('0x50')](_0x20f00c['body'],{})[_0xc24a('0x2c')](function(_0x4a4aa3){var _0x245388=_0x20f00c[_0xc24a('0x51')][_0xc24a('0x2e')]({'plain':!![]});if(!_0x245388)throw new Error(_0xc24a('0x52'));if(_0x245388['role']===_0xc24a('0x51')){var _0xc0b643=_0x4a4aa3[_0xc24a('0x2e')]({'plain':!![]});var _0x6893e6=_0xc24a('0x2f');return db[_0xc24a('0x53')][_0xc24a('0x4f')]({'where':{'name':_0x6893e6,'userProfileId':_0x245388[_0xc24a('0x54')]},'raw':!![]})['then'](function(_0xd9ad7c){if(_0xd9ad7c&&_0xd9ad7c['autoAssociation']===0x0){return db[_0xc24a('0x30')][_0xc24a('0x50')]({'name':_0xc0b643[_0xc24a('0x33')],'resourceId':_0xc0b643['id'],'type':_0xd9ad7c[_0xc24a('0x33')],'sectionId':_0xd9ad7c['id']},{})[_0xc24a('0x2c')](function(){return _0x4a4aa3;});}else{return _0x4a4aa3;}})['catch'](function(_0x1ac350){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1ac350);throw _0x1ac350;});}return _0x4a4aa3;})[_0xc24a('0x2c')](respondWithResult(_0x6a24e4,0xc9))['catch'](handleError(_0x6a24e4,null));};exports[_0xc24a('0x2b')]=function(_0x4d3e0a,_0x555bc1){if(_0x4d3e0a[_0xc24a('0x55')]['id']){delete _0x4d3e0a[_0xc24a('0x55')]['id'];}return db['CmList'][_0xc24a('0x4f')]({'where':{'id':_0x4d3e0a[_0xc24a('0x4c')]['id']}})['then'](handleEntityNotFound(_0x555bc1,null))['then'](saveUpdates(_0x4d3e0a[_0xc24a('0x55')],null))[_0xc24a('0x2c')](respondWithResult(_0x555bc1,null))[_0xc24a('0x4b')](handleError(_0x555bc1,null));};exports[_0xc24a('0x2d')]=function(_0x516c2b,_0xd23730){return db[_0xc24a('0x36')]['find']({'where':{'id':_0x516c2b[_0xc24a('0x4c')]['id']}})[_0xc24a('0x2c')](handleEntityNotFound(_0xd23730,null))[_0xc24a('0x2c')](removeEntity(_0xd23730,null))[_0xc24a('0x4b')](handleError(_0xd23730,null));};exports['describe']=function(_0x42edda,_0x266463){return db['CmList']['describe']()[_0xc24a('0x2c')](respondWithResult(_0x266463,null))['catch'](handleError(_0x266463,null));};exports[_0xc24a('0x56')]=function(_0x10337d,_0x86b9b2,_0x440f00){if(_0x10337d[_0xc24a('0x55')]['id']){delete _0x10337d['body']['id'];}return db[_0xc24a('0x36')][_0xc24a('0x4f')]({'where':{'id':_0x10337d[_0xc24a('0x4c')]['id']}})[_0xc24a('0x2c')](handleEntityNotFound(_0x86b9b2,null))[_0xc24a('0x2c')](function(_0x96c12a){if(_0x96c12a){_0x10337d[_0xc24a('0x55')][_0xc24a('0x57')]=_0x96c12a['id'];return db[_0xc24a('0x58')][_0xc24a('0x50')](_0x10337d[_0xc24a('0x55')]);}})[_0xc24a('0x2c')](respondWithResult(_0x86b9b2,null))['catch'](handleError(_0x86b9b2,null));};exports[_0xc24a('0x59')]=function(_0x253e6a,_0x1d19da,_0x464680){var _0x523fbc={'raw':![],'where':{}};var _0x2f9443={};var _0xc83d71={'count':0x0,'rows':[]};return db[_0xc24a('0x36')][_0xc24a('0x5a')]({'where':{'id':_0x253e6a['params']['id']}})[_0xc24a('0x2c')](handleEntityNotFound(_0x1d19da,null))['then'](function(_0x37edf9){if(_0x37edf9){_0x2f9443[_0xc24a('0x3a')]=_[_0xc24a('0x4d')](db[_0xc24a('0x58')][_0xc24a('0x4e')]);_0x2f9443[_0xc24a('0x3b')]=_[_0xc24a('0x4d')](_0x253e6a['query']);_0x2f9443[_0xc24a('0x3c')]=_['intersection'](_0x2f9443[_0xc24a('0x3a')],_0x2f9443['query']);_0x523fbc['attributes']=_['intersection'](_0x2f9443['model'],qs[_0xc24a('0x3f')](_0x253e6a[_0xc24a('0x3b')][_0xc24a('0x3f')]));_0x523fbc['attributes']=_0x523fbc[_0xc24a('0x3e')][_0xc24a('0x40')]?_0x523fbc[_0xc24a('0x3e')]:_0x2f9443[_0xc24a('0x3a')];if(!_0x253e6a[_0xc24a('0x3b')][_0xc24a('0x41')](_0xc24a('0x42'))){_0x523fbc[_0xc24a('0x23')]=qs[_0xc24a('0x23')](_0x253e6a['query']['limit']);_0x523fbc[_0xc24a('0x22')]=qs['offset'](_0x253e6a[_0xc24a('0x3b')][_0xc24a('0x22')]);}_0x523fbc[_0xc24a('0x43')]=qs[_0xc24a('0x44')](_0x253e6a[_0xc24a('0x3b')][_0xc24a('0x44')]);_0x523fbc[_0xc24a('0x45')]=qs[_0xc24a('0x3c')](_[_0xc24a('0x5b')](_0x253e6a[_0xc24a('0x3b')],_0x2f9443['filters']));_0x523fbc[_0xc24a('0x45')][_0xc24a('0x57')]=_0x37edf9['id'];if(_0x253e6a[_0xc24a('0x3b')][_0xc24a('0x46')]){_0x523fbc['where']=_[_0xc24a('0x47')](_0x523fbc[_0xc24a('0x45')],{'$or':_['map'](_0x523fbc[_0xc24a('0x3e')],function(_0x23a9bf){var _0x3da010={};_0x3da010[_0x23a9bf]={'$like':'%'+_0x253e6a[_0xc24a('0x3b')][_0xc24a('0x46')]+'%'};return _0x3da010;})});}_0x523fbc=_[_0xc24a('0x47')]({},_0x523fbc,_0x253e6a[_0xc24a('0x5c')]);return db[_0xc24a('0x58')][_0xc24a('0x25')]({'where':_0x523fbc[_0xc24a('0x45')]})[_0xc24a('0x2c')](function(_0x4fa844){_0xc83d71[_0xc24a('0x25')]=_0x4fa844;if(_0x253e6a[_0xc24a('0x3b')][_0xc24a('0x49')]){_0x523fbc[_0xc24a('0x4a')]=[{'all':!![]}];}return db[_0xc24a('0x58')][_0xc24a('0x5d')](_0x523fbc);})['then'](function(_0x2ccc82){_0xc83d71[_0xc24a('0x5e')]=_0x2ccc82;return _0xc83d71;});}})['then'](respondWithFilteredResult(_0x1d19da,_0x523fbc))[_0xc24a('0x4b')](handleError(_0x1d19da,null));};exports[_0xc24a('0x5f')]=function(_0x3a9f09,_0x2a9592,_0x4af533){return db[_0xc24a('0x36')]['find']({'where':{'id':_0x3a9f09['params']['id']}})['then'](handleEntityNotFound(_0x2a9592,null))[_0xc24a('0x2c')](function(_0x3e807c){if(_0x3e807c){return _0x3e807c[_0xc24a('0x5f')](_0x3a9f09[_0xc24a('0x3b')][_0xc24a('0x60')]);}})[_0xc24a('0x2c')](respondWithStatusCode(_0x2a9592,null))[_0xc24a('0x4b')](handleError(_0x2a9592,null));};exports[_0xc24a('0x61')]=function(_0x3cbd1b,_0x4ce470,_0x47aab1){return db[_0xc24a('0x36')][_0xc24a('0x4f')]({'where':{'id':_0x3cbd1b[_0xc24a('0x4c')]['id']}})[_0xc24a('0x2c')](handleEntityNotFound(_0x4ce470,null))[_0xc24a('0x2c')](function(_0x227a95){if(_0x227a95){var _0x4fac17=[];var _0x38a114={'success':[],'errors':[]};return db['CmContact'][_0xc24a('0x62')]()[_0xc24a('0x2c')](function(_0x571ebd){if(_0x3cbd1b[_0xc24a('0x55')]['tags']&&_[_0xc24a('0x63')](_0x3cbd1b[_0xc24a('0x55')][_0xc24a('0x64')])){if(_0x3cbd1b[_0xc24a('0x55')][_0xc24a('0x64')][_0xc24a('0x40')]){_0x3cbd1b[_0xc24a('0x55')][_0xc24a('0x64')]=_0x3cbd1b[_0xc24a('0x55')][_0xc24a('0x64')][_0xc24a('0x65')](';')+';';}else{_0x3cbd1b[_0xc24a('0x55')][_0xc24a('0x64')]=null;}}else{_0x3cbd1b[_0xc24a('0x55')][_0xc24a('0x64')]=null;}if(_0x3cbd1b['body']&&_[_0xc24a('0x63')](_0x3cbd1b[_0xc24a('0x55')])){for(var _0x2a527a=0x0;_0x2a527a<_0x3cbd1b[_0xc24a('0x55')][_0xc24a('0x40')];_0x2a527a+=0x1){_0x3cbd1b[_0xc24a('0x55')][_0x2a527a][_0xc24a('0x57')]=_0x3cbd1b[_0xc24a('0x4c')]['id'];_0x4fac17[_0xc24a('0x66')](_0x3cbd1b[_0xc24a('0x55')][_0x2a527a]);}return BPromise[_0xc24a('0x67')](_0x4fac17,function(_0x5ba70e){return db[_0xc24a('0x68')][_0xc24a('0x50')](_['omit'](_0x5ba70e,['ids','id'])||{},{'fields':_[_0xc24a('0x4d')](_0x571ebd),'raw':!![]})[_0xc24a('0x2c')](function(_0x28d467){_0x38a114[_0xc24a('0x69')][_0xc24a('0x66')](_0x28d467['dataValues']);})['catch'](function(_0x560322){_0x38a114['errors'][_0xc24a('0x66')]({'data':_0x5ba70e,'error':_0x560322['message']});});})['then'](function(_0xbc5335){return _0x38a114;})[_0xc24a('0x4b')](function(_0x21764f){return _0x21764f;});}else{_0x4ce470[_0xc24a('0x20')](0x190)['json']({'message':_0xc24a('0x6a')});}});}})[_0xc24a('0x2c')](respondWithResult(_0x4ce470,null))[_0xc24a('0x4b')](handleError(_0x4ce470,null));};exports['getContacts']=function(_0xf8d854,_0x2c4fc6,_0x29db1a){var _0x7753c9;return db[_0xc24a('0x36')]['find']({'where':{'id':_0xf8d854[_0xc24a('0x4c')]['id']},'include':[{'model':db[_0xc24a('0x6b')],'as':_0xc24a('0x6c')}]})['then'](handleEntityNotFound(_0x2c4fc6,null))[_0xc24a('0x2c')](function(_0x38ce57){if(_0x38ce57){_0x7753c9=_0x38ce57;return db[_0xc24a('0x68')][_0xc24a('0x4e')];}})['then'](function(_0x3ef841){if(_0x3ef841){var _0x242482={};var _0x3531c1={};_0x3531c1[_0xc24a('0x3a')]=_[_0xc24a('0x6d')](_['keys'](_0x3ef841),_[_0xc24a('0x35')](_0x7753c9['CustomFields'],function(_0x2c965d){return util[_0xc24a('0x6e')]('cf_%d',_0x2c965d['id']);}));_0x3531c1[_0xc24a('0x3b')]=_[_0xc24a('0x4d')](_0xf8d854['query']);_0x3531c1[_0xc24a('0x3c')]=_[_0xc24a('0x3d')](_0x3531c1['model'],_0x3531c1['query']);_0x242482[_0xc24a('0x3e')]=_[_0xc24a('0x3d')](_0x3531c1['model'],qs[_0xc24a('0x3f')](_0xf8d854[_0xc24a('0x3b')]['fields']));_0x242482[_0xc24a('0x3e')]=_0x242482[_0xc24a('0x3e')][_0xc24a('0x40')]?_0x242482[_0xc24a('0x3e')]:_0x3531c1[_0xc24a('0x3a')];if(!_0xf8d854[_0xc24a('0x3b')][_0xc24a('0x41')]('nolimit')){_0x242482['limit']=qs[_0xc24a('0x23')](_0xf8d854[_0xc24a('0x3b')]['limit']);_0x242482[_0xc24a('0x22')]=qs[_0xc24a('0x22')](_0xf8d854['query'][_0xc24a('0x22')]);}_0x242482[_0xc24a('0x43')]=qs[_0xc24a('0x44')](_0xf8d854['query'][_0xc24a('0x44')]);_0x242482[_0xc24a('0x45')]=qs['filters'](_[_0xc24a('0x5b')](_0xf8d854[_0xc24a('0x3b')],_0x3531c1[_0xc24a('0x3c')]));_0x242482[_0xc24a('0x6f')]=!![];if(_0xf8d854['query'][_0xc24a('0x46')]){_0x242482[_0xc24a('0x45')]=_[_0xc24a('0x47')](_0x242482['where'],{'$or':_[_0xc24a('0x35')](_0x242482[_0xc24a('0x3e')],function(_0x75940e){var _0x4664c5={};_0x4664c5[_0x75940e]={'$like':'%'+_0xf8d854[_0xc24a('0x3b')]['filter']+'%'};return _0x4664c5;})});}_0x242482=_[_0xc24a('0x47')]({},_0x242482,_0xf8d854[_0xc24a('0x5c')]);return _0x7753c9[_0xc24a('0x70')](_0x242482);}})[_0xc24a('0x2c')](respondWithResult(_0x2c4fc6,null))['catch'](handleError(_0x2c4fc6,null));};exports['getContactsCsv']=function(_0x12a81c,_0x24fd63,_0x3d968e){var _0x1b47c5;return db[_0xc24a('0x36')][_0xc24a('0x4f')]({'where':{'id':_0x12a81c[_0xc24a('0x4c')]['id']},'include':[{'model':db['CmCustomField'],'as':_0xc24a('0x6c')}]})[_0xc24a('0x2c')](handleEntityNotFound(_0x24fd63,null))[_0xc24a('0x2c')](function(_0x3c8f3b){if(_0x3c8f3b){_0x1b47c5=_0x3c8f3b;return db[_0xc24a('0x68')][_0xc24a('0x4e')];}})['then'](function(_0x512411){if(_0x512411){var _0x94c77b={};var _0x45479a={};_0x45479a['model']=_[_0xc24a('0x6d')](_[_0xc24a('0x4d')](_0x512411),_[_0xc24a('0x35')](_0x1b47c5[_0xc24a('0x6c')],function(_0xb23ce1){return util[_0xc24a('0x6e')]('cf_%d',_0xb23ce1['id']);}));_0x45479a['query']=_[_0xc24a('0x4d')](_0x12a81c[_0xc24a('0x3b')]);_0x45479a['filters']=_[_0xc24a('0x3d')](_0x45479a['model'],_0x45479a[_0xc24a('0x3b')]);_0x94c77b[_0xc24a('0x3e')]=_['intersection'](_0x45479a[_0xc24a('0x3a')],qs[_0xc24a('0x3f')](_0x12a81c[_0xc24a('0x3b')][_0xc24a('0x3f')]));_0x94c77b[_0xc24a('0x3e')]=_0x94c77b[_0xc24a('0x3e')]['length']?_0x94c77b['attributes']:_0x45479a[_0xc24a('0x3a')];if(!_0x12a81c['query']['hasOwnProperty'](_0xc24a('0x42'))){_0x94c77b[_0xc24a('0x23')]=qs[_0xc24a('0x23')](_0x12a81c['query'][_0xc24a('0x23')]);_0x94c77b[_0xc24a('0x22')]=qs[_0xc24a('0x22')](_0x12a81c['query'][_0xc24a('0x22')]);}_0x94c77b['order']=qs[_0xc24a('0x44')](_0x12a81c[_0xc24a('0x3b')]['sort']);_0x94c77b[_0xc24a('0x45')]=qs[_0xc24a('0x3c')](_[_0xc24a('0x5b')](_0x12a81c[_0xc24a('0x3b')],_0x45479a[_0xc24a('0x3c')]));_0x94c77b['raw']=!![];if(_0x12a81c[_0xc24a('0x3b')][_0xc24a('0x46')]){_0x94c77b[_0xc24a('0x45')]=_[_0xc24a('0x47')](_0x94c77b[_0xc24a('0x45')],{'$or':_[_0xc24a('0x35')](_0x94c77b[_0xc24a('0x3e')],function(_0x641a46){var _0x5ca5df={};_0x5ca5df[_0x641a46]={'$like':'%'+_0x12a81c[_0xc24a('0x3b')][_0xc24a('0x46')]+'%'};return _0x5ca5df;})});}_0x94c77b=_['merge']({},_0x94c77b,_0x12a81c['options']);return _0x1b47c5[_0xc24a('0x70')](_0x94c77b);}})[_0xc24a('0x2c')](function(_0x35954e){if(!_[_0xc24a('0x71')](_0x35954e)){var _0x280459=toCsv(_0x35954e);var _0x43c253=Date[_0xc24a('0x72')]();fs[_0xc24a('0x73')](util['format'](_0xc24a('0x74'),_0x1b47c5['id'],_0x43c253),_0x280459);_0x24fd63[_0xc24a('0x75')](_0xc24a('0x76'),_0xc24a('0x77')+util[_0xc24a('0x6e')]('list_%d_%s.csv',_0x1b47c5['id'],_0x43c253));_0x24fd63[_0xc24a('0x75')]('Content-type',_0xc24a('0x78'));return _0x24fd63[_0xc24a('0x79')](util['format'](_0xc24a('0x74'),_0x1b47c5['id'],_0x43c253));}else{return _0x24fd63[_0xc24a('0x1f')](0xcc);}})[_0xc24a('0x4b')](handleError(_0x24fd63,null));};exports[_0xc24a('0x7a')]=function(_0x573c69,_0x50e604,_0x179dcd){var _0x9eefb9;delete _0x573c69[_0xc24a('0x55')]['id'];return db[_0xc24a('0x36')][_0xc24a('0x5a')]({'where':{'id':_0x573c69[_0xc24a('0x4c')]['id']}})[_0xc24a('0x2c')](handleEntityNotFound(_0x50e604,null))['then'](function(_0x5543fe){if(_0x5543fe){return db[_0xc24a('0x7b')][_0xc24a('0x7c')](function(_0x3d078d){return db[_0xc24a('0x6b')]['create'](_0x573c69['body'],{'transaction':_0x3d078d})[_0xc24a('0x2c')](function(_0x36704b){_0x9eefb9=_0x36704b;return _0x5543fe[_0xc24a('0x7d')](_0x36704b,{'transaction':_0x3d078d});})[_0xc24a('0x2c')](function(){var _0x16a560={'type':db['Sequelize'][_0xc24a('0x7e')],'transaction':_0x3d078d};switch(_0x573c69[_0xc24a('0x55')][_0xc24a('0x38')]){case _0xc24a('0x7f'):_0x16a560[_0xc24a('0x38')]=db['Sequelize'][_0xc24a('0x7e')];break;case _0xc24a('0x80'):_0x16a560[_0xc24a('0x38')]=db[_0xc24a('0x81')][_0xc24a('0x82')];break;case _0xc24a('0x83'):_0x16a560[_0xc24a('0x38')]=db['Sequelize'][_0xc24a('0x84')];_0x16a560['defaultValue']=![];break;default:}return db[_0xc24a('0x7b')][_0xc24a('0x85')][_0xc24a('0x86')]('cm_contacts',util['format'](_0xc24a('0x87'),_0x9eefb9['id']),_0x16a560);})[_0xc24a('0x2c')](function(){return _0x9eefb9;});});}})[_0xc24a('0x2c')](respondWithResult(_0x50e604,null))['catch'](handleError(_0x50e604,null));};exports[_0xc24a('0x88')]=function(_0x15774d,_0x43ce40,_0x5ca9eb){var _0x5dca7d={};var _0x25faa7={};var _0x17fa26;var _0x3e1d1f;return db[_0xc24a('0x36')][_0xc24a('0x5a')]({'where':{'id':_0x15774d[_0xc24a('0x4c')]['id']}})[_0xc24a('0x2c')](handleEntityNotFound(_0x43ce40,null))[_0xc24a('0x2c')](function(_0x1a6f94){if(_0x1a6f94){_0x17fa26=_0x1a6f94;_0x25faa7[_0xc24a('0x3a')]=_[_0xc24a('0x4d')](db['CmCustomField']['rawAttributes']);_0x25faa7[_0xc24a('0x3b')]=_[_0xc24a('0x4d')](_0x15774d[_0xc24a('0x3b')]);_0x25faa7['filters']=_[_0xc24a('0x3d')](_0x25faa7['model'],_0x25faa7['query']);_0x5dca7d[_0xc24a('0x3e')]=_[_0xc24a('0x3d')](_0x25faa7[_0xc24a('0x3a')],qs[_0xc24a('0x3f')](_0x15774d[_0xc24a('0x3b')][_0xc24a('0x3f')]));_0x5dca7d[_0xc24a('0x3e')]=_0x5dca7d[_0xc24a('0x3e')][_0xc24a('0x40')]?_0x5dca7d[_0xc24a('0x3e')]:_0x25faa7['model'];_0x5dca7d[_0xc24a('0x43')]=qs['sort'](_0x15774d['query'][_0xc24a('0x44')]);_0x5dca7d['where']=qs['filters'](_['pick'](_0x15774d['query'],_0x25faa7[_0xc24a('0x3c')]));_0x5dca7d['where']=_[_0xc24a('0x47')](_0x5dca7d[_0xc24a('0x45')],{'$or':[{'ListId':_0x1a6f94['id']},{'ListId':null}]});if(_0x15774d['query']['filter']){_0x5dca7d[_0xc24a('0x45')]=_[_0xc24a('0x47')](_0x5dca7d[_0xc24a('0x45')],{'$or':_[_0xc24a('0x35')](_0x5dca7d[_0xc24a('0x3e')],function(_0x5813cd){var _0x4984a5={};_0x4984a5[_0x5813cd]={'$like':'%'+_0x15774d[_0xc24a('0x3b')][_0xc24a('0x46')]+'%'};return _0x4984a5;})});}_0x5dca7d=_[_0xc24a('0x47')]({},_0x5dca7d,_0x15774d[_0xc24a('0x5c')]);return db[_0xc24a('0x6b')]['findAndCountAll'](_0x5dca7d);}})[_0xc24a('0x2c')](respondWithResult(_0x43ce40,null))[_0xc24a('0x4b')](handleError(_0x43ce40,null));};exports['addAgents']=function(_0x172277,_0x40269d,_0x2fad00){return db['CmList'][_0xc24a('0x4f')]({'where':{'id':_0x172277['params']['id']}})[_0xc24a('0x2c')](handleEntityNotFound(_0x40269d,null))['then'](function(_0x8cebd2){if(_0x8cebd2){return _0x8cebd2[_0xc24a('0x89')](_0x172277[_0xc24a('0x55')][_0xc24a('0x60')],_['omit'](_0x172277['body'],[_0xc24a('0x60'),'id'])||{})[_0xc24a('0x8a')](function(_0x3c8e34){for(var _0x4c9d65=0x0;_0x4c9d65<_0x172277['body'][_0xc24a('0x60')][_0xc24a('0x40')];_0x4c9d65+=0x1){socket[_0xc24a('0x8b')](_0xc24a('0x8c'),{'UserId':Number(_0x172277[_0xc24a('0x55')][_0xc24a('0x60')][_0x4c9d65]),'CmListId':Number(_0x172277[_0xc24a('0x4c')]['id'])});}return _0x3c8e34;});}})[_0xc24a('0x2c')](respondWithResult(_0x40269d,null))[_0xc24a('0x4b')](handleError(_0x40269d,null));};exports[_0xc24a('0x8d')]=function(_0x54e798,_0xca11e5,_0x534fe2){return db[_0xc24a('0x36')][_0xc24a('0x4f')]({'where':{'id':_0x54e798[_0xc24a('0x4c')]['id']}})[_0xc24a('0x2c')](handleEntityNotFound(_0xca11e5,null))[_0xc24a('0x2c')](function(_0x199112){if(_0x199112){return _0x199112['removeAgents'](_0x54e798[_0xc24a('0x3b')][_0xc24a('0x60')])[_0xc24a('0x2c')](function(){if(_[_0xc24a('0x63')](_0x54e798[_0xc24a('0x3b')][_0xc24a('0x60')])){for(var _0x477bc3=0x0;_0x477bc3<_0x54e798['query'][_0xc24a('0x60')][_0xc24a('0x40')];_0x477bc3+=0x1){socket['emit'](_0xc24a('0x8e'),{'UserId':Number(_0x54e798[_0xc24a('0x3b')][_0xc24a('0x60')][_0x477bc3]),'CmListId':Number(_0x54e798[_0xc24a('0x4c')]['id'])});}}else{socket[_0xc24a('0x8b')](_0xc24a('0x8e'),{'UserId':Number(_0x54e798[_0xc24a('0x3b')][_0xc24a('0x60')]),'CmListId':Number(_0x54e798[_0xc24a('0x4c')]['id'])});}});}})[_0xc24a('0x2c')](respondWithStatusCode(_0xca11e5,null))[_0xc24a('0x4b')](handleError(_0xca11e5,null));};exports[_0xc24a('0x8f')]=function(_0x42e086,_0x1dacbb,_0x8b4cb){var _0x4f9610={};var _0x23115f={};var _0x220fbf;var _0x311a86;return db[_0xc24a('0x36')][_0xc24a('0x5a')]({'where':{'id':_0x42e086[_0xc24a('0x4c')]['id']}})[_0xc24a('0x2c')](handleEntityNotFound(_0x1dacbb,null))[_0xc24a('0x2c')](function(_0xcec3b8){if(_0xcec3b8){_0x220fbf=_0xcec3b8;_0x23115f[_0xc24a('0x3a')]=_[_0xc24a('0x4d')](db[_0xc24a('0x90')][_0xc24a('0x4e')]);_0x23115f['query']=_[_0xc24a('0x4d')](_0x42e086[_0xc24a('0x3b')]);_0x23115f['filters']=_['intersection'](_0x23115f[_0xc24a('0x3a')],_0x23115f['query']);_0x4f9610[_0xc24a('0x3e')]=_[_0xc24a('0x3d')](_0x23115f[_0xc24a('0x3a')],qs['fields'](_0x42e086[_0xc24a('0x3b')]['fields']));_0x4f9610['attributes']=_0x4f9610['attributes'][_0xc24a('0x40')]?_0x4f9610['attributes']:_0x23115f[_0xc24a('0x3a')];_0x4f9610[_0xc24a('0x43')]=qs[_0xc24a('0x44')](_0x42e086[_0xc24a('0x3b')][_0xc24a('0x44')]);_0x4f9610[_0xc24a('0x45')]=qs[_0xc24a('0x3c')](_['pick'](_0x42e086[_0xc24a('0x3b')],_0x23115f[_0xc24a('0x3c')]));if(_0x42e086[_0xc24a('0x3b')]['filter']){_0x4f9610[_0xc24a('0x45')]=_[_0xc24a('0x47')](_0x4f9610['where'],{'$or':_[_0xc24a('0x35')](_0x4f9610[_0xc24a('0x3e')],function(_0x7db8c6){var _0x460654={};_0x460654[_0x7db8c6]={'$like':'%'+_0x42e086['query'][_0xc24a('0x46')]+'%'};return _0x460654;})});}_0x4f9610=_[_0xc24a('0x47')]({},_0x4f9610,_0x42e086[_0xc24a('0x5c')]);return _0x220fbf[_0xc24a('0x8f')](_0x4f9610);}})[_0xc24a('0x2c')](function(_0x47ca78){if(_0x47ca78){_0x311a86=_0x47ca78[_0xc24a('0x40')];if(!_0x42e086[_0xc24a('0x3b')][_0xc24a('0x41')]('nolimit')){_0x4f9610[_0xc24a('0x23')]=qs[_0xc24a('0x23')](_0x42e086[_0xc24a('0x3b')][_0xc24a('0x23')]);_0x4f9610[_0xc24a('0x22')]=qs['offset'](_0x42e086[_0xc24a('0x3b')]['offset']);}return _0x220fbf['getAgents'](_0x4f9610);}})[_0xc24a('0x2c')](function(_0x334820){if(_0x334820){return _0x334820?{'count':_0x311a86,'rows':_0x334820}:null;}})[_0xc24a('0x2c')](respondWithResult(_0x1dacbb,null))['catch'](handleError(_0x1dacbb,null));}; \ No newline at end of file diff --git a/server/api/cmList/cmList.events.js b/server/api/cmList/cmList.events.js index cf2a84a..3f16b0a 100644 --- a/server/api/cmList/cmList.events.js +++ b/server/api/cmList/cmList.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['setMaxListeners','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','CmList'];(function(_0x192de8,_0x3c6e3d){var _0x41d3c7=function(_0x2b1c2c){while(--_0x2b1c2c){_0x192de8['push'](_0x192de8['shift']());}};_0x41d3c7(++_0x3c6e3d);}(_0x9957,0x93));var _0x7995=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x9957[_0x2dafbe];return _0x58a45a;};'use strict';var EventEmitter=require(_0x7995('0x0'));var CmList=require(_0x7995('0x1'))['db'][_0x7995('0x2')];var CmListEvents=new EventEmitter();CmListEvents[_0x7995('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x7995('0x4'),'afterDestroy':_0x7995('0x5')};function emitEvent(_0x1902b4){return function(_0x462a03,_0x576d89,_0x744bea){CmListEvents[_0x7995('0x6')](_0x1902b4+':'+_0x462a03['id'],_0x462a03);CmListEvents[_0x7995('0x6')](_0x1902b4,_0x462a03);_0x744bea(null);};}for(var e in events){if(events[_0x7995('0x7')](e)){var event=events[e];CmList[_0x7995('0x8')](e,emitEvent(event));}}module[_0x7995('0x9')]=CmListEvents; \ No newline at end of file +var _0x55ca=['events','../../mysqldb','update','remove','emit','hasOwnProperty','hook'];(function(_0x1992f1,_0x5c61f0){var _0x413dfe=function(_0x2136e5){while(--_0x2136e5){_0x1992f1['push'](_0x1992f1['shift']());}};_0x413dfe(++_0x5c61f0);}(_0x55ca,0x126));var _0xa55c=function(_0x4206f5,_0x21f338){_0x4206f5=_0x4206f5-0x0;var _0xa29cf3=_0x55ca[_0x4206f5];return _0xa29cf3;};'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 daba0d6..dbe5f37 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 _0x22fb=['define','CmList','../../config/logger','moment','bluebird','request-promise','path','rimraf','./cmList.attributes','exports'];(function(_0x332869,_0xd16b84){var _0x59717d=function(_0x1b12d7){while(--_0x1b12d7){_0x332869['push'](_0x332869['shift']());}};_0x59717d(++_0xd16b84);}(_0x22fb,0x192));var _0xb22f=function(_0x56baf8,_0x38d082){_0x56baf8=_0x56baf8-0x0;var _0x5c2714=_0x22fb[_0x56baf8];return _0x5c2714;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xb22f('0x0'))('api');var moment=require(_0xb22f('0x1'));var BPromise=require(_0xb22f('0x2'));var rp=require(_0xb22f('0x3'));var fs=require('fs');var path=require(_0xb22f('0x4'));var rimraf=require(_0xb22f('0x5'));var config=require('../../config/environment');var attributes=require(_0xb22f('0x6'));module[_0xb22f('0x7')]=function(_0x2d1fb3,_0xc3ffcc){return _0x2d1fb3[_0xb22f('0x8')](_0xb22f('0x9'),attributes,{'tableName':'cm_lists','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2dae=['lodash','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./cmList.attributes','exports','define','CmList','cm_lists'];(function(_0x3b3a51,_0x37cbaf){var _0x4a93ea=function(_0x212675){while(--_0x212675){_0x3b3a51['push'](_0x3b3a51['shift']());}};_0x4a93ea(++_0x37cbaf);}(_0x2dae,0xc3));var _0xe2da=function(_0x3ccdf8,_0x584ceb){_0x3ccdf8=_0x3ccdf8-0x0;var _0x243dab=_0x2dae[_0x3ccdf8];return _0x243dab;};'use strict';var _=require(_0xe2da('0x0'));var util=require('util');var logger=require(_0xe2da('0x1'))(_0xe2da('0x2'));var moment=require(_0xe2da('0x3'));var BPromise=require(_0xe2da('0x4'));var rp=require(_0xe2da('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe2da('0x6'));var config=require(_0xe2da('0x7'));var attributes=require(_0xe2da('0x8'));module[_0xe2da('0x9')]=function(_0x523c60,_0x3e3e25){return _0x523c60[_0xe2da('0xa')](_0xe2da('0xb'),attributes,{'tableName':_0xe2da('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmList/cmList.rpc.js b/server/api/cmList/cmList.rpc.js index 098c42a..6ccdf16 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 _0x3c31=['localhost','socket.io-emitter','./cmList.socket','then','info','request\x20sent','CmList,\x20%s,\x20%s,\x20%s','stringify','error','code','CmList,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','defaults','redis'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x3c31,0x142));var _0x13c3=function(_0x5309cd,_0x5efab8){_0x5309cd=_0x5309cd-0x0;var _0x5e4092=_0x3c31[_0x5309cd];return _0x5e4092;};'use strict';var _=require(_0x13c3('0x0'));var util=require(_0x13c3('0x1'));var moment=require(_0x13c3('0x2'));var BPromise=require(_0x13c3('0x3'));var rs=require(_0x13c3('0x4'));var fs=require('fs');var Redis=require(_0x13c3('0x5'));var db=require(_0x13c3('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x13c3('0x7'))(_0x13c3('0x8'));var config=require(_0x13c3('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x13c3('0xa')][_0x13c3('0xb')]({'port':0x232a});config['redis']=_[_0x13c3('0xc')](config[_0x13c3('0xd')],{'host':_0x13c3('0xe'),'port':0x18eb});var socket=require(_0x13c3('0xf'))(new Redis(config['redis']));require(_0x13c3('0x10'))['register'](socket);function respondWithRpcPromise(_0x4e1aaf,_0x382e11,_0xd22a22){return new BPromise(function(_0x30316f,_0x5b447f){return client['request'](_0x4e1aaf,_0xd22a22)[_0x13c3('0x11')](function(_0x271f15){logger[_0x13c3('0x12')]('CmList,\x20%s,\x20%s',_0x382e11,_0x13c3('0x13'));logger['debug'](_0x13c3('0x14'),_0x382e11,'request\x20sent',JSON[_0x13c3('0x15')](_0x271f15));if(_0x271f15['error']){if(_0x271f15[_0x13c3('0x16')][_0x13c3('0x17')]===0x1f4){logger['error'](_0x13c3('0x18'),_0x382e11,_0x271f15['error'][_0x13c3('0x19')]);return _0x5b447f(_0x271f15[_0x13c3('0x16')]['message']);}logger[_0x13c3('0x16')](_0x13c3('0x18'),_0x382e11,_0x271f15[_0x13c3('0x16')][_0x13c3('0x19')]);return _0x30316f(_0x271f15[_0x13c3('0x16')]['message']);}else{logger[_0x13c3('0x12')](_0x13c3('0x18'),_0x382e11,'request\x20sent');_0x30316f(_0x271f15[_0x13c3('0x1a')][_0x13c3('0x19')]);}})[_0x13c3('0x1b')](function(_0x4bed8f){logger[_0x13c3('0x16')]('CmList,\x20%s,\x20%s',_0x382e11,_0x4bed8f);_0x5b447f(_0x4bed8f);});});} \ No newline at end of file +var _0xb8c3=['request','then','info','CmList,\x20%s,\x20%s','request\x20sent','CmList,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','bluebird','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','./cmList.socket'];(function(_0x28509b,_0x5831ff){var _0x1e0b6=function(_0x37d8a2){while(--_0x37d8a2){_0x28509b['push'](_0x28509b['shift']());}};_0x1e0b6(++_0x5831ff);}(_0xb8c3,0x16a));var _0x3b8c=function(_0xb24b6d,_0x49f15e){_0xb24b6d=_0xb24b6d-0x0;var _0xc88ebd=_0xb8c3[_0xb24b6d];return _0xc88ebd;};'use strict';var _=require('lodash');var util=require(_0x3b8c('0x0'));var moment=require(_0x3b8c('0x1'));var BPromise=require(_0x3b8c('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3b8c('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x3b8c('0x4'))(_0x3b8c('0x5'));var config=require(_0x3b8c('0x6'));var jayson=require(_0x3b8c('0x7'));var client=jayson[_0x3b8c('0x8')][_0x3b8c('0x9')]({'port':0x232a});config['redis']=_[_0x3b8c('0xa')](config[_0x3b8c('0xb')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x3b8c('0xb')]));require(_0x3b8c('0xc'))['register'](socket);function respondWithRpcPromise(_0x1658cc,_0x55c6dd,_0x297ac6){return new BPromise(function(_0x13a657,_0x42a130){return client[_0x3b8c('0xd')](_0x1658cc,_0x297ac6)[_0x3b8c('0xe')](function(_0x2d781e){logger[_0x3b8c('0xf')](_0x3b8c('0x10'),_0x55c6dd,_0x3b8c('0x11'));logger['debug'](_0x3b8c('0x12'),_0x55c6dd,_0x3b8c('0x11'),JSON[_0x3b8c('0x13')](_0x2d781e));if(_0x2d781e[_0x3b8c('0x14')]){if(_0x2d781e[_0x3b8c('0x14')][_0x3b8c('0x15')]===0x1f4){logger[_0x3b8c('0x14')](_0x3b8c('0x10'),_0x55c6dd,_0x2d781e[_0x3b8c('0x14')][_0x3b8c('0x16')]);return _0x42a130(_0x2d781e[_0x3b8c('0x14')]['message']);}logger['error'](_0x3b8c('0x10'),_0x55c6dd,_0x2d781e[_0x3b8c('0x14')][_0x3b8c('0x16')]);return _0x13a657(_0x2d781e[_0x3b8c('0x14')][_0x3b8c('0x16')]);}else{logger['info'](_0x3b8c('0x10'),_0x55c6dd,'request\x20sent');_0x13a657(_0x2d781e[_0x3b8c('0x17')][_0x3b8c('0x16')]);}})[_0x3b8c('0x18')](function(_0x2331ce){logger[_0x3b8c('0x14')](_0x3b8c('0x10'),_0x55c6dd,_0x2331ce);_0x42a130(_0x2331ce);});});} \ No newline at end of file diff --git a/server/api/cmList/cmList.socket.js b/server/api/cmList/cmList.socket.js index 3bec8a7..1e6f8cb 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 _0x05de=['length','./cmList.events','save','remove','update','emit','removeListener'];(function(_0x3fc66a,_0x472fc8){var _0xb1301b=function(_0x169ba1){while(--_0x169ba1){_0x3fc66a['push'](_0x3fc66a['shift']());}};_0xb1301b(++_0x472fc8);}(_0x05de,0x135));var _0xe05d=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x05de[_0x20a584];return _0x4b41a8;};'use strict';var CmListEvents=require(_0xe05d('0x0'));var events=[_0xe05d('0x1'),_0xe05d('0x2'),_0xe05d('0x3')];function createListener(_0x114259,_0x43b175){return function(_0x4ba461){_0x43b175[_0xe05d('0x4')](_0x114259,_0x4ba461);};}function removeListener(_0x14147e,_0x3d3c99){return function(){CmListEvents[_0xe05d('0x5')](_0x14147e,_0x3d3c99);};}exports['register']=function(_0x12053d){for(var _0x5de41d=0x0,_0x54f04b=events[_0xe05d('0x6')];_0x5de41d<_0x54f04b;_0x5de41d++){var _0xd2146f=events[_0x5de41d];var _0x3300cc=createListener('cmList:'+_0xd2146f,_0x12053d);CmListEvents['on'](_0xd2146f,_0x3300cc);}}; \ No newline at end of file +var _0x132d=['cmList:','./cmList.events','save','update','emit','removeListener','length'];(function(_0x13877c,_0x5f37e3){var _0x18fba4=function(_0x2a80e8){while(--_0x2a80e8){_0x13877c['push'](_0x13877c['shift']());}};_0x18fba4(++_0x5f37e3);}(_0x132d,0xa9));var _0xd132=function(_0x1b46e1,_0x441fd6){_0x1b46e1=_0x1b46e1-0x0;var _0x594ad1=_0x132d[_0x1b46e1];return _0x594ad1;};'use strict';var CmListEvents=require(_0xd132('0x0'));var events=[_0xd132('0x1'),'remove',_0xd132('0x2')];function createListener(_0x1c5db2,_0x5880ad){return function(_0x357de4){_0x5880ad[_0xd132('0x3')](_0x1c5db2,_0x357de4);};}function removeListener(_0x44f6cb,_0x19b96a){return function(){CmListEvents[_0xd132('0x4')](_0x44f6cb,_0x19b96a);};}exports['register']=function(_0x58303a){for(var _0x15510a=0x0,_0x2c931c=events[_0xd132('0x5')];_0x15510a<_0x2c931c;_0x15510a++){var _0x188084=events[_0x15510a];var _0x5cf99b=createListener(_0xd132('0x6')+_0x188084,_0x58303a);CmListEvents['on'](_0x188084,_0x5cf99b);}}; \ No newline at end of file diff --git a/server/api/cmList/index.js b/server/api/cmList/index.js index 18ecba0..0a717bd 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 _0xd557=['../../config/environment','./cmList.controller','get','/describe','/:id','show','/:id/dispositions','isAuthenticated','/:id/contacts','/:id/contacts/csv','getContactsCsv','/:id/fields','getCustomFields','/:id/users','post','create','addContacts','addCustomField','addAgents','update','delete','destroy','removeDispositions','removeAgents','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x5d1aea,_0x2a2fb8){var _0x1a91b6=function(_0x5609ec){while(--_0x5609ec){_0x5d1aea['push'](_0x5d1aea['shift']());}};_0x1a91b6(++_0x2a2fb8);}(_0xd557,0x7b));var _0x7d55=function(_0x31f5f4,_0x31de78){_0x31f5f4=_0x31f5f4-0x0;var _0x343f28=_0xd557[_0x31f5f4];return _0x343f28;};'use strict';var multer=require(_0x7d55('0x0'));var util=require(_0x7d55('0x1'));var path=require(_0x7d55('0x2'));var timeout=require(_0x7d55('0x3'));var express=require(_0x7d55('0x4'));var router=express[_0x7d55('0x5')]();var fs_extra=require(_0x7d55('0x6'));var auth=require(_0x7d55('0x7'));var interaction=require(_0x7d55('0x8'));var config=require(_0x7d55('0x9'));var controller=require(_0x7d55('0xa'));router[_0x7d55('0xb')]('/',auth['isAuthenticated'](),controller['index']);router[_0x7d55('0xb')](_0x7d55('0xc'),auth['isAuthenticated'](),controller['describe']);router[_0x7d55('0xb')](_0x7d55('0xd'),auth['isAuthenticated'](),controller[_0x7d55('0xe')]);router[_0x7d55('0xb')](_0x7d55('0xf'),auth[_0x7d55('0x10')](),controller['getDispositions']);router[_0x7d55('0xb')](_0x7d55('0x11'),auth[_0x7d55('0x10')](),controller['getContacts']);router['get'](_0x7d55('0x12'),auth[_0x7d55('0x10')](),controller[_0x7d55('0x13')]);router[_0x7d55('0xb')](_0x7d55('0x14'),auth['isAuthenticated'](),controller[_0x7d55('0x15')]);router[_0x7d55('0xb')](_0x7d55('0x16'),auth[_0x7d55('0x10')](),controller['getAgents']);router[_0x7d55('0x17')]('/',auth['isAuthenticated'](),controller[_0x7d55('0x18')]);router[_0x7d55('0x17')]('/:id/dispositions',auth['isAuthenticated'](),controller['addDisposition']);router[_0x7d55('0x17')](_0x7d55('0x11'),auth['isAuthenticated'](),controller[_0x7d55('0x19')]);router[_0x7d55('0x17')](_0x7d55('0x14'),auth['isAuthenticated'](),controller[_0x7d55('0x1a')]);router[_0x7d55('0x17')](_0x7d55('0x16'),auth[_0x7d55('0x10')](),controller[_0x7d55('0x1b')]);router['put'](_0x7d55('0xd'),auth['isAuthenticated'](),controller[_0x7d55('0x1c')]);router[_0x7d55('0x1d')](_0x7d55('0xd'),auth[_0x7d55('0x10')](),controller[_0x7d55('0x1e')]);router['delete'](_0x7d55('0xf'),auth[_0x7d55('0x10')](),controller[_0x7d55('0x1f')]);router['delete'](_0x7d55('0x16'),auth['isAuthenticated'](),controller[_0x7d55('0x20')]);module['exports']=router; \ No newline at end of file +var _0x5767=['getAgents','post','create','addDisposition','addContacts','addCustomField','addAgents','update','delete','removeDispositions','removeAgents','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmList.controller','get','/describe','/:id','show','/:id/dispositions','isAuthenticated','/:id/contacts','getContacts','/:id/contacts/csv','getContactsCsv','/:id/fields'];(function(_0x5218b6,_0x21f0b2){var _0x317763=function(_0xb9522e){while(--_0xb9522e){_0x5218b6['push'](_0x5218b6['shift']());}};_0x317763(++_0x21f0b2);}(_0x5767,0x176));var _0x7576=function(_0x6f7157,_0x50ad62){_0x6f7157=_0x6f7157-0x0;var _0x1cc8fa=_0x5767[_0x6f7157];return _0x1cc8fa;};'use strict';var multer=require(_0x7576('0x0'));var util=require(_0x7576('0x1'));var path=require(_0x7576('0x2'));var timeout=require(_0x7576('0x3'));var express=require(_0x7576('0x4'));var router=express[_0x7576('0x5')]();var fs_extra=require(_0x7576('0x6'));var auth=require(_0x7576('0x7'));var interaction=require(_0x7576('0x8'));var config=require(_0x7576('0x9'));var controller=require(_0x7576('0xa'));router[_0x7576('0xb')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x7576('0xc'),auth['isAuthenticated'](),controller['describe']);router[_0x7576('0xb')](_0x7576('0xd'),auth['isAuthenticated'](),controller[_0x7576('0xe')]);router['get'](_0x7576('0xf'),auth[_0x7576('0x10')](),controller['getDispositions']);router[_0x7576('0xb')](_0x7576('0x11'),auth[_0x7576('0x10')](),controller[_0x7576('0x12')]);router['get'](_0x7576('0x13'),auth[_0x7576('0x10')](),controller[_0x7576('0x14')]);router[_0x7576('0xb')](_0x7576('0x15'),auth[_0x7576('0x10')](),controller['getCustomFields']);router[_0x7576('0xb')]('/:id/users',auth[_0x7576('0x10')](),controller[_0x7576('0x16')]);router[_0x7576('0x17')]('/',auth[_0x7576('0x10')](),controller[_0x7576('0x18')]);router[_0x7576('0x17')](_0x7576('0xf'),auth[_0x7576('0x10')](),controller[_0x7576('0x19')]);router['post'](_0x7576('0x11'),auth[_0x7576('0x10')](),controller[_0x7576('0x1a')]);router['post']('/:id/fields',auth[_0x7576('0x10')](),controller[_0x7576('0x1b')]);router[_0x7576('0x17')]('/:id/users',auth[_0x7576('0x10')](),controller[_0x7576('0x1c')]);router['put'](_0x7576('0xd'),auth['isAuthenticated'](),controller[_0x7576('0x1d')]);router[_0x7576('0x1e')]('/:id',auth['isAuthenticated'](),controller['destroy']);router['delete'](_0x7576('0xf'),auth[_0x7576('0x10')](),controller[_0x7576('0x1f')]);router[_0x7576('0x1e')]('/:id/users',auth[_0x7576('0x10')](),controller[_0x7576('0x20')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/condition/condition.attributes.js b/server/api/condition/condition.attributes.js index 3205046..8945bb5 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 _0xecea=['field','STRING','exports','VIRTUAL'];(function(_0x12bcf7,_0xc11103){var _0x2825a=function(_0x4452ba){while(--_0x4452ba){_0x12bcf7['push'](_0x12bcf7['shift']());}};_0x2825a(++_0xc11103);}(_0xecea,0x156));var _0xaece=function(_0x4d8592,_0x3d6170){_0x4d8592=_0x4d8592-0x0;var _0x4d9a58=_0xecea[_0x4d8592];return _0x4d9a58;};'use strict';var Sequelize=require('sequelize');module[_0xaece('0x0')]={'name':{'type':Sequelize[_0xaece('0x1')],'get':function(_0x1276f0){return this['getDataValue'](_0xaece('0x2'));}},'field':{'type':Sequelize['STRING'],'allowNull':![]},'operator':{'type':Sequelize['STRING'],'allowNull':![]},'value':{'type':Sequelize[_0xaece('0x3')],'allowNull':![]}}; \ No newline at end of file +var _0x1403=['exports','VIRTUAL','getDataValue','field','STRING'];(function(_0x162f9f,_0x4f5e53){var _0x2bf199=function(_0x368cfa){while(--_0x368cfa){_0x162f9f['push'](_0x162f9f['shift']());}};_0x2bf199(++_0x4f5e53);}(_0x1403,0x1b3));var _0x3140=function(_0x1cb808,_0x5b7ba1){_0x1cb808=_0x1cb808-0x0;var _0x40eadf=_0x1403[_0x1cb808];return _0x40eadf;};'use strict';var Sequelize=require('sequelize');module[_0x3140('0x0')]={'name':{'type':Sequelize[_0x3140('0x1')],'get':function(_0x1303f3){return this[_0x3140('0x2')](_0x3140('0x3'));}},'field':{'type':Sequelize[_0x3140('0x4')],'allowNull':![]},'operator':{'type':Sequelize['STRING'],'allowNull':![]},'value':{'type':Sequelize[_0x3140('0x4')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/condition/condition.controller.js b/server/api/condition/condition.controller.js index d1c2fe3..a968f7f 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(_0x1316e8,_0x58fd0d){var _0xd69ea=function(_0x312d09){while(--_0x312d09){_0x1316e8['push'](_0x1316e8['shift']());}};_0xd69ea(++_0x58fd0d);}(_0x7a54,0x106));var _0x47a5=function(_0xd0287a,_0x4b9a6e){_0xd0287a=_0xd0287a-0x0;var _0x480eef=_0x7a54[_0xd0287a];return _0x480eef;};'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 _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(_0x3f5c4c,_0x1d3c7c){var _0x5abc04=function(_0x28a55b){while(--_0x28a55b){_0x3f5c4c['push'](_0x3f5c4c['shift']());}};_0x5abc04(++_0x1d3c7c);}(_0x7a54,0x106));var _0x47a5=function(_0x363bf2,_0x11910d){_0x363bf2=_0x363bf2-0x0;var _0x2d56a4=_0x7a54[_0x363bf2];return _0x2d56a4;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x22')]=function(_0x136b14,_0x16631f){if(_0x136b14[_0x47a5('0x29')]['id']){delete _0x136b14[_0x47a5('0x29')]['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x2b')]({'where':{'id':_0x136b14['params']['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x16631f,null))['then'](saveUpdates(_0x136b14[_0x47a5('0x29')],null))[_0x47a5('0x23')](respondWithResult(_0x16631f,null))[_0x47a5('0x2c')](handleError(_0x16631f,null));};exports['destroy']=function(_0x256650,_0x625952){return db[_0x47a5('0x2a')][_0x47a5('0x2b')]({'where':{'id':_0x256650['params']['id']}})['then'](handleEntityNotFound(_0x625952,null))[_0x47a5('0x23')](removeEntity(_0x625952,null))[_0x47a5('0x2c')](handleError(_0x625952,null));}; \ No newline at end of file diff --git a/server/api/condition/condition.model.js b/server/api/condition/condition.model.js index 757a45c..58063b1 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 _0xe6d7=['../../config/environment','./condition.attributes','Condition','tools_conditions','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x33dc29,_0x3638af){var _0x2c4f8b=function(_0x7d9b5b){while(--_0x7d9b5b){_0x33dc29['push'](_0x33dc29['shift']());}};_0x2c4f8b(++_0x3638af);}(_0xe6d7,0x7d));var _0x7e6d=function(_0x56139c,_0x28b962){_0x56139c=_0x56139c-0x0;var _0x40b9d5=_0xe6d7[_0x56139c];return _0x40b9d5;};'use strict';var _=require(_0x7e6d('0x0'));var util=require(_0x7e6d('0x1'));var logger=require(_0x7e6d('0x2'))(_0x7e6d('0x3'));var moment=require(_0x7e6d('0x4'));var BPromise=require(_0x7e6d('0x5'));var rp=require(_0x7e6d('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x7e6d('0x7'));var attributes=require(_0x7e6d('0x8'));module['exports']=function(_0x29e835,_0x1d99c6){return _0x29e835['define'](_0x7e6d('0x9'),attributes,{'tableName':_0x7e6d('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbd7f=['api','moment','bluebird','path','rimraf','../../config/environment','./condition.attributes','define','Condition','tools_conditions','lodash'];(function(_0xcf98f0,_0x908bd){var _0x48d365=function(_0x3eeec0){while(--_0x3eeec0){_0xcf98f0['push'](_0xcf98f0['shift']());}};_0x48d365(++_0x908bd);}(_0xbd7f,0x1e3));var _0xfbd7=function(_0x37f012,_0x1ace30){_0x37f012=_0x37f012-0x0;var _0x3d6091=_0xbd7f[_0x37f012];return _0x3d6091;};'use strict';var _=require(_0xfbd7('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xfbd7('0x1'));var moment=require(_0xfbd7('0x2'));var BPromise=require(_0xfbd7('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xfbd7('0x4'));var rimraf=require(_0xfbd7('0x5'));var config=require(_0xfbd7('0x6'));var attributes=require(_0xfbd7('0x7'));module['exports']=function(_0x2642d9,_0x285a06){return _0x2642d9[_0xfbd7('0x8')](_0xfbd7('0x9'),attributes,{'tableName':_0xfbd7('0xa'),'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 2a2f843..62acb0e 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 _0x6762=['message','result','lodash','util','moment','bluebird','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','Condition,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0x385ff8,_0x3e40c9){var _0x3ef85b=function(_0x42a166){while(--_0x42a166){_0x385ff8['push'](_0x385ff8['shift']());}};_0x3ef85b(++_0x3e40c9);}(_0x6762,0x1ce));var _0x2676=function(_0x158235,_0x2bcade){_0x158235=_0x158235-0x0;var _0x22b7b1=_0x6762[_0x158235];return _0x22b7b1;};'use strict';var _=require(_0x2676('0x0'));var util=require(_0x2676('0x1'));var moment=require(_0x2676('0x2'));var BPromise=require(_0x2676('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2676('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x2676('0x5'))('rpc');var config=require(_0x2676('0x6'));var jayson=require(_0x2676('0x7'));var client=jayson[_0x2676('0x8')][_0x2676('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xad47ac,_0x25671d,_0x8c5234){return new BPromise(function(_0x122c80,_0x475948){return client[_0x2676('0xa')](_0xad47ac,_0x8c5234)[_0x2676('0xb')](function(_0xf73093){logger[_0x2676('0xc')](_0x2676('0xd'),_0x25671d,'request\x20sent');logger['debug']('Condition,\x20%s,\x20%s,\x20%s',_0x25671d,_0x2676('0xe'),JSON[_0x2676('0xf')](_0xf73093));if(_0xf73093[_0x2676('0x10')]){if(_0xf73093[_0x2676('0x10')][_0x2676('0x11')]===0x1f4){logger[_0x2676('0x10')](_0x2676('0xd'),_0x25671d,_0xf73093['error'][_0x2676('0x12')]);return _0x475948(_0xf73093['error']['message']);}logger[_0x2676('0x10')]('Condition,\x20%s,\x20%s',_0x25671d,_0xf73093['error']['message']);return _0x122c80(_0xf73093['error'][_0x2676('0x12')]);}else{logger[_0x2676('0xc')](_0x2676('0xd'),_0x25671d,'request\x20sent');_0x122c80(_0xf73093[_0x2676('0x13')][_0x2676('0x12')]);}})['catch'](function(_0x2222de){logger['error'](_0x2676('0xd'),_0x25671d,_0x2222de);_0x475948(_0x2222de);});});} \ No newline at end of file +var _0x5f4a=['jayson/promise','client','then','info','Condition,\x20%s,\x20%s','request\x20sent','debug','Condition,\x20%s,\x20%s,\x20%s','error','message','result','catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment'];(function(_0x2ef6eb,_0x1f09c4){var _0x5135c9=function(_0x3f878b){while(--_0x3f878b){_0x2ef6eb['push'](_0x2ef6eb['shift']());}};_0x5135c9(++_0x1f09c4);}(_0x5f4a,0x70));var _0xa5f4=function(_0x50b749,_0x287ffc){_0x50b749=_0x50b749-0x0;var _0x6f64b3=_0x5f4a[_0x50b749];return _0x6f64b3;};'use strict';var _=require('lodash');var util=require(_0xa5f4('0x0'));var moment=require(_0xa5f4('0x1'));var BPromise=require(_0xa5f4('0x2'));var rs=require(_0xa5f4('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa5f4('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xa5f4('0x5'))(_0xa5f4('0x6'));var config=require(_0xa5f4('0x7'));var jayson=require(_0xa5f4('0x8'));var client=jayson[_0xa5f4('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5d2c7c,_0xf2c699,_0x4eee3c){return new BPromise(function(_0x506de2,_0x25336c){return client['request'](_0x5d2c7c,_0x4eee3c)[_0xa5f4('0xa')](function(_0x48194a){logger[_0xa5f4('0xb')](_0xa5f4('0xc'),_0xf2c699,_0xa5f4('0xd'));logger[_0xa5f4('0xe')](_0xa5f4('0xf'),_0xf2c699,_0xa5f4('0xd'),JSON['stringify'](_0x48194a));if(_0x48194a[_0xa5f4('0x10')]){if(_0x48194a[_0xa5f4('0x10')]['code']===0x1f4){logger['error'](_0xa5f4('0xc'),_0xf2c699,_0x48194a[_0xa5f4('0x10')]['message']);return _0x25336c(_0x48194a[_0xa5f4('0x10')][_0xa5f4('0x11')]);}logger[_0xa5f4('0x10')](_0xa5f4('0xc'),_0xf2c699,_0x48194a[_0xa5f4('0x10')][_0xa5f4('0x11')]);return _0x506de2(_0x48194a[_0xa5f4('0x10')][_0xa5f4('0x11')]);}else{logger[_0xa5f4('0xb')]('Condition,\x20%s,\x20%s',_0xf2c699,'request\x20sent');_0x506de2(_0x48194a[_0xa5f4('0x12')][_0xa5f4('0x11')]);}})[_0xa5f4('0x13')](function(_0x25c14d){logger[_0xa5f4('0x10')](_0xa5f4('0xc'),_0xf2c699,_0x25c14d);_0x25336c(_0x25c14d);});});} \ No newline at end of file diff --git a/server/api/condition/index.js b/server/api/condition/index.js index eecf8f9..aa242c5 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 _0x9ab8=['delete','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','./condition.controller','put','/:id','isAuthenticated','update'];(function(_0x21a18a,_0x38b275){var _0x3554b7=function(_0x159c2e){while(--_0x159c2e){_0x21a18a['push'](_0x21a18a['shift']());}};_0x3554b7(++_0x38b275);}(_0x9ab8,0x81));var _0x89ab=function(_0x4a3e46,_0x538944){_0x4a3e46=_0x4a3e46-0x0;var _0x9e0c8b=_0x9ab8[_0x4a3e46];return _0x9e0c8b;};'use strict';var multer=require(_0x89ab('0x0'));var util=require(_0x89ab('0x1'));var path=require(_0x89ab('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x89ab('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x89ab('0x4'));var interaction=require(_0x89ab('0x5'));var config=require('../../config/environment');var controller=require(_0x89ab('0x6'));router[_0x89ab('0x7')](_0x89ab('0x8'),auth[_0x89ab('0x9')](),controller[_0x89ab('0xa')]);router[_0x89ab('0xb')](_0x89ab('0x8'),auth[_0x89ab('0x9')](),controller[_0x89ab('0xc')]);module[_0x89ab('0xd')]=router; \ No newline at end of file +var _0x8ece=['../../components/auth/service','../../components/interaction/service','../../config/environment','./condition.controller','update','/:id','isAuthenticated','destroy','exports','multer','util','path','express','Router','fs-extra'];(function(_0x233bc3,_0x41a388){var _0x52f89e=function(_0x467eb5){while(--_0x467eb5){_0x233bc3['push'](_0x233bc3['shift']());}};_0x52f89e(++_0x41a388);}(_0x8ece,0xbd));var _0xe8ec=function(_0x1f6154,_0x91c64e){_0x1f6154=_0x1f6154-0x0;var _0x8326c6=_0x8ece[_0x1f6154];return _0x8326c6;};'use strict';var multer=require(_0xe8ec('0x0'));var util=require(_0xe8ec('0x1'));var path=require(_0xe8ec('0x2'));var timeout=require('connect-timeout');var express=require(_0xe8ec('0x3'));var router=express[_0xe8ec('0x4')]();var fs_extra=require(_0xe8ec('0x5'));var auth=require(_0xe8ec('0x6'));var interaction=require(_0xe8ec('0x7'));var config=require(_0xe8ec('0x8'));var controller=require(_0xe8ec('0x9'));router['put']('/:id',auth['isAuthenticated'](),controller[_0xe8ec('0xa')]);router['delete'](_0xe8ec('0xb'),auth[_0xe8ec('0xc')](),controller[_0xe8ec('0xd')]);module[_0xe8ec('0xe')]=router; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.attributes.js b/server/api/dashboard/dashboard.attributes.js index 4fff56a..3d991ee 100644 --- a/server/api/dashboard/dashboard.attributes.js +++ b/server/api/dashboard/dashboard.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2032=['name','exports','STRING'];(function(_0x2920ee,_0x4368e9){var _0x6b3822=function(_0x4e6fce){while(--_0x4e6fce){_0x2920ee['push'](_0x2920ee['shift']());}};_0x6b3822(++_0x4368e9);}(_0x2032,0xd9));var _0x2203=function(_0x2924b3,_0xb88d01){_0x2924b3=_0x2924b3-0x0;var _0x26861c=_0x2032[_0x2924b3];return _0x26861c;};'use strict';var Sequelize=require('sequelize');module[_0x2203('0x0')]={'name':{'type':Sequelize[_0x2203('0x1')],'allowNull':![],'unique':_0x2203('0x2')},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x757a=['exports','STRING'];(function(_0x5e1d89,_0x460282){var _0x48c7a8=function(_0x58aae2){while(--_0x58aae2){_0x5e1d89['push'](_0x5e1d89['shift']());}};_0x48c7a8(++_0x460282);}(_0x757a,0xde));var _0xa757=function(_0x260908,_0x4dc816){_0x260908=_0x260908-0x0;var _0x416fe6=_0x757a[_0x260908];return _0x416fe6;};'use strict';var Sequelize=require('sequelize');module[_0xa757('0x0')]={'name':{'type':Sequelize[_0xa757('0x1')],'allowNull':![],'unique':'name'},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.controller.js b/server/api/dashboard/dashboard.controller.js index 0bedbf7..6dad320 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 _0x9725=['index','Dashboard','rawAttributes','fieldName','type','key','map','query','keys','filters','intersection','model','attributes','fields','length','order','sort','where','pick','merge','VIRTUAL','include','findAll','rows','catch','params','includeAll','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','get','UserProfileSection','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','updatedAt','userProfileId','update','attrUrl','attrs','value','custom','attrPath','clock','attrHourFormat','attrTimezone','0.00','attrFontSize','attrMetric','total','attrVoiceQueues','multibar-chart','pie-chart','attrSerie1','attrSerie2','attrSerie3','web-report','attrReport','widgetAttributes:\x20%s','stringify','addItem','DashboardId','DashboardItem','findOne','filter','getItems','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','fs-extra','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./dashboard.socket','register','status','end','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','CustomDashboards','UserProfileResource','sendStatus','name','send'];(function(_0x14a513,_0x3239f){var _0x47236c=function(_0x394191){while(--_0x394191){_0x14a513['push'](_0x14a513['shift']());}};_0x47236c(++_0x3239f);}(_0x9725,0xbe));var _0x5972=function(_0x47dde3,_0xbdd88b){_0x47dde3=_0x47dde3-0x0;var _0x3e6484=_0x9725[_0x47dde3];return _0x3e6484;};'use strict';var emlformat=require(_0x5972('0x0'));var rimraf=require(_0x5972('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5972('0x2'));var rp=require(_0x5972('0x3'));var moment=require(_0x5972('0x4'));var BPromise=require(_0x5972('0x5'));var Mustache=require(_0x5972('0x6'));var util=require(_0x5972('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x5972('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5972('0x9'));var _=require(_0x5972('0xa'));var squel=require(_0x5972('0xb'));var crypto=require(_0x5972('0xc'));var jsforce=require(_0x5972('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x5972('0x8'));var querystring=require('querystring');var Papa=require(_0x5972('0xe'));var Redis=require(_0x5972('0xf'));var authService=require(_0x5972('0x10'));var qs=require(_0x5972('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x5972('0x12'))(_0x5972('0x13'));var utils=require(_0x5972('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x5972('0x15'));var db=require(_0x5972('0x16'))['db'];config[_0x5972('0x17')]=_[_0x5972('0x18')](config[_0x5972('0x17')],{'host':'localhost','port':0x18eb});var socket=require(_0x5972('0x19'))(new Redis(config[_0x5972('0x17')]));require(_0x5972('0x1a'))[_0x5972('0x1b')](socket);function respondWithStatusCode(_0x3be2ca,_0x151ecf){_0x151ecf=_0x151ecf||0xcc;return function(_0x130bc4){if(_0x130bc4){return _0x3be2ca['sendStatus'](_0x151ecf);}return _0x3be2ca[_0x5972('0x1c')](_0x151ecf)[_0x5972('0x1d')]();};}function respondWithResult(_0x5878c1,_0x39d22f){_0x39d22f=_0x39d22f||0xc8;return function(_0x2f5f13){if(_0x2f5f13){return _0x5878c1[_0x5972('0x1c')](_0x39d22f)['json'](_0x2f5f13);}};}function respondWithFilteredResult(_0x1d3e32,_0x2a0340){return function(_0x1fe487){if(_0x1fe487){var _0x21a099=typeof _0x2a0340[_0x5972('0x1e')]===_0x5972('0x1f')&&typeof _0x2a0340[_0x5972('0x20')]===_0x5972('0x1f');var _0x3e7206=_0x1fe487[_0x5972('0x21')];var _0xbea076=_0x21a099?0x0:_0x2a0340[_0x5972('0x1e')];var _0x3d5d37=_0x21a099?_0x1fe487[_0x5972('0x21')]:_0x2a0340[_0x5972('0x1e')]+_0x2a0340[_0x5972('0x20')];var _0x18aa13;if(_0x3d5d37>=_0x3e7206){_0x3d5d37=_0x3e7206;_0x18aa13=0xc8;}else{_0x18aa13=0xce;}_0x1d3e32[_0x5972('0x1c')](_0x18aa13);return _0x1d3e32[_0x5972('0x22')](_0x5972('0x23'),_0xbea076+'-'+_0x3d5d37+'/'+_0x3e7206)['json'](_0x1fe487);}return null;};}function patchUpdates(_0x2e84c0){return function(_0x4fc7dd){try{jsonpatch[_0x5972('0x24')](_0x4fc7dd,_0x2e84c0,!![]);}catch(_0x42ca69){return BPromise[_0x5972('0x25')](_0x42ca69);}return _0x4fc7dd[_0x5972('0x26')]();};}function saveUpdates(_0x5ca892,_0x33e5ea){return function(_0x5963d4){if(_0x5963d4){return _0x5963d4['update'](_0x5ca892)[_0x5972('0x27')](function(_0x304515){return _0x304515;});}return null;};}function removeEntity(_0x323ca9,_0x24e50b){return function(_0x12e994){if(_0x12e994){return _0x12e994[_0x5972('0x28')]()['then'](function(){var _0x4e8e35=_0x12e994['get']({'plain':!![]});var _0x514c7a=_0x5972('0x29');return db[_0x5972('0x2a')][_0x5972('0x28')]({'where':{'type':_0x514c7a,'resourceId':_0x4e8e35['id']}})[_0x5972('0x27')](function(){return _0x12e994;});})[_0x5972('0x27')](function(){_0x323ca9[_0x5972('0x1c')](0xcc)[_0x5972('0x1d')]();});}};}function handleEntityNotFound(_0x41895e,_0x1a65c1){return function(_0x5f1bfb){if(!_0x5f1bfb){_0x41895e[_0x5972('0x2b')](0x194);}return _0x5f1bfb;};}function handleError(_0x137a9a,_0x6cdce0){_0x6cdce0=_0x6cdce0||0x1f4;return function(_0xfe7013){logger['error'](_0xfe7013['stack']);if(_0xfe7013['name']){delete _0xfe7013[_0x5972('0x2c')];}_0x137a9a[_0x5972('0x1c')](_0x6cdce0)[_0x5972('0x2d')](_0xfe7013);};}exports[_0x5972('0x2e')]=function(_0x1654bb,_0x224066){var _0x531234={},_0x4b4a23={},_0x9cb96e={'count':0x0,'rows':[]};var _0x14e503=_['map'](db[_0x5972('0x2f')][_0x5972('0x30')],function(_0x27d54a){return{'name':_0x27d54a[_0x5972('0x31')],'type':_0x27d54a[_0x5972('0x32')][_0x5972('0x33')]};});_0x4b4a23['model']=_[_0x5972('0x34')](_0x14e503,_0x5972('0x2c'));_0x4b4a23[_0x5972('0x35')]=_[_0x5972('0x36')](_0x1654bb['query']);_0x4b4a23[_0x5972('0x37')]=_[_0x5972('0x38')](_0x4b4a23[_0x5972('0x39')],_0x4b4a23[_0x5972('0x35')]);_0x531234[_0x5972('0x3a')]=_[_0x5972('0x38')](_0x4b4a23[_0x5972('0x39')],qs[_0x5972('0x3b')](_0x1654bb[_0x5972('0x35')][_0x5972('0x3b')]));_0x531234['attributes']=_0x531234['attributes'][_0x5972('0x3c')]?_0x531234[_0x5972('0x3a')]:_0x4b4a23['model'];if(!_0x1654bb[_0x5972('0x35')]['hasOwnProperty']('nolimit')){_0x531234['limit']=qs[_0x5972('0x20')](_0x1654bb[_0x5972('0x35')][_0x5972('0x20')]);_0x531234[_0x5972('0x1e')]=qs['offset'](_0x1654bb[_0x5972('0x35')][_0x5972('0x1e')]);}_0x531234[_0x5972('0x3d')]=qs[_0x5972('0x3e')](_0x1654bb[_0x5972('0x35')][_0x5972('0x3e')]);_0x531234[_0x5972('0x3f')]=qs[_0x5972('0x37')](_[_0x5972('0x40')](_0x1654bb[_0x5972('0x35')],_0x4b4a23['filters']),_0x14e503);if(_0x1654bb[_0x5972('0x35')]['filter']){_0x531234[_0x5972('0x3f')]=_[_0x5972('0x41')](_0x531234[_0x5972('0x3f')],{'$or':_[_0x5972('0x34')](_0x14e503,function(_0x881753){if(_0x881753['type']!==_0x5972('0x42')){var _0x3c6e12={};_0x3c6e12[_0x881753[_0x5972('0x2c')]]={'$like':'%'+_0x1654bb[_0x5972('0x35')]['filter']+'%'};return _0x3c6e12;}})});}_0x531234=_[_0x5972('0x41')]({},_0x531234,_0x1654bb['options']);var _0x48c182={'where':_0x531234[_0x5972('0x3f')]};return db[_0x5972('0x2f')][_0x5972('0x21')](_0x48c182)[_0x5972('0x27')](function(_0x11e57a){_0x9cb96e[_0x5972('0x21')]=_0x11e57a;if(_0x1654bb[_0x5972('0x35')]['includeAll']){_0x531234[_0x5972('0x43')]=[{'all':!![]}];}return db[_0x5972('0x2f')][_0x5972('0x44')](_0x531234);})[_0x5972('0x27')](function(_0x8c8c52){_0x9cb96e[_0x5972('0x45')]=_0x8c8c52;return _0x9cb96e;})[_0x5972('0x27')](respondWithFilteredResult(_0x224066,_0x531234))[_0x5972('0x46')](handleError(_0x224066,null));};exports['show']=function(_0x3bf231,_0x89bdd){var _0x56d591={'raw':![],'where':{'id':_0x3bf231[_0x5972('0x47')]['id']}},_0xaf8e1e={};_0xaf8e1e[_0x5972('0x39')]=_[_0x5972('0x36')](db[_0x5972('0x2f')][_0x5972('0x30')]);_0xaf8e1e[_0x5972('0x35')]=_[_0x5972('0x36')](_0x3bf231['query']);_0xaf8e1e[_0x5972('0x37')]=_['intersection'](_0xaf8e1e[_0x5972('0x39')],_0xaf8e1e[_0x5972('0x35')]);_0x56d591[_0x5972('0x3a')]=_[_0x5972('0x38')](_0xaf8e1e['model'],qs[_0x5972('0x3b')](_0x3bf231['query'][_0x5972('0x3b')]));_0x56d591[_0x5972('0x3a')]=_0x56d591[_0x5972('0x3a')]['length']?_0x56d591[_0x5972('0x3a')]:_0xaf8e1e['model'];if(_0x3bf231[_0x5972('0x35')][_0x5972('0x48')]){_0x56d591[_0x5972('0x43')]=[{'all':!![]}];}_0x56d591=_[_0x5972('0x41')]({},_0x56d591,_0x3bf231[_0x5972('0x49')]);return db[_0x5972('0x2f')][_0x5972('0x4a')](_0x56d591)[_0x5972('0x27')](handleEntityNotFound(_0x89bdd,null))[_0x5972('0x27')](respondWithResult(_0x89bdd,null))[_0x5972('0x46')](handleError(_0x89bdd,null));};exports[_0x5972('0x4b')]=function(_0x4d6b87,_0x583761){return db['Dashboard'][_0x5972('0x4b')](_0x4d6b87[_0x5972('0x4c')],{})[_0x5972('0x27')](function(_0x42867d){var _0x4f29bc=_0x4d6b87[_0x5972('0x4d')]['get']({'plain':!![]});if(!_0x4f29bc)throw new Error(_0x5972('0x4e'));if(_0x4f29bc['role']==='user'){var _0x2f5d82=_0x42867d[_0x5972('0x4f')]({'plain':!![]});var _0x356754=_0x5972('0x29');return db[_0x5972('0x50')][_0x5972('0x4a')]({'where':{'name':_0x356754,'userProfileId':_0x4f29bc['userProfileId']},'raw':!![]})['then'](function(_0x20757e){if(_0x20757e&&_0x20757e[_0x5972('0x51')]===0x0){return db[_0x5972('0x2a')][_0x5972('0x4b')]({'name':_0x2f5d82[_0x5972('0x2c')],'resourceId':_0x2f5d82['id'],'type':_0x20757e[_0x5972('0x2c')],'sectionId':_0x20757e['id']},{})[_0x5972('0x27')](function(){return _0x42867d;});}else{return _0x42867d;}})[_0x5972('0x46')](function(_0x544d01){logger[_0x5972('0x52')](_0x5972('0x53'),_0x544d01);throw _0x544d01;});}return _0x42867d;})[_0x5972('0x27')](respondWithResult(_0x583761,0xc9))[_0x5972('0x46')](handleError(_0x583761,null));};exports[_0x5972('0x54')]=function(_0x259985,_0x42c72f){var _0x24f9d5={'where':{'id':_0x259985['params']['id']}},_0x5cdf59={};_0x5cdf59[_0x5972('0x39')]=_[_0x5972('0x36')](db[_0x5972('0x2f')]['rawAttributes']);_0x24f9d5['attributes']=_['intersection'](_0x5cdf59[_0x5972('0x39')],qs[_0x5972('0x3b')](_0x259985[_0x5972('0x35')][_0x5972('0x3b')]));_0x24f9d5['attributes']=_0x24f9d5['attributes'][_0x5972('0x3c')]?_0x24f9d5['attributes']:_0x5cdf59['model'];if(_0x259985['query'][_0x5972('0x48')]){_0x24f9d5[_0x5972('0x43')]=[{'all':!![]}];}_0x24f9d5=_[_0x5972('0x41')]({},_0x24f9d5,_0x259985[_0x5972('0x49')]);return db['Dashboard']['find'](_0x24f9d5)[_0x5972('0x27')](handleEntityNotFound(_0x42c72f,null))[_0x5972('0x27')](function(_0x2c2c70){if(_0x2c2c70){var _0x5205f7=_0x2c2c70[_0x5972('0x4f')]({'plain':!![]});_0x5205f7=qs[_0x5972('0x55')](_0x5205f7,['id',_0x5972('0x56'),'updatedAt']);_0x259985[_0x5972('0x4c')]=_[_0x5972('0x55')](_0x259985[_0x5972('0x4c')],['id',_0x5972('0x56'),_0x5972('0x57')]);return db[_0x5972('0x2f')][_0x5972('0x4b')](_[_0x5972('0x41')](_0x5205f7,_0x259985[_0x5972('0x4c')]),{'include':_0x259985[_0x5972('0x35')]['includeAll']?[{'all':!![]}]:undefined})[_0x5972('0x27')](function(_0x5e1632){var _0x269cdd=_0x259985[_0x5972('0x4d')]['get']({'plain':!![]});if(!_0x269cdd)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x269cdd['role']===_0x5972('0x4d')){var _0x30ccaf=_0x5e1632[_0x5972('0x4f')]({'plain':!![]});var _0x1ac650=_0x5972('0x29');return db[_0x5972('0x50')]['find']({'where':{'name':_0x1ac650,'userProfileId':_0x269cdd[_0x5972('0x58')]},'raw':!![]})['then'](function(_0x2057ec){if(_0x2057ec&&_0x2057ec[_0x5972('0x51')]===0x0){return db[_0x5972('0x2a')][_0x5972('0x4b')]({'name':_0x30ccaf[_0x5972('0x2c')],'resourceId':_0x30ccaf['id'],'type':_0x2057ec[_0x5972('0x2c')],'sectionId':_0x2057ec['id']},{})[_0x5972('0x27')](function(){return _0x5e1632;});}else{return _0x5e1632;}})[_0x5972('0x46')](function(_0xb5ccef){logger['error'](_0x5972('0x53'),_0xb5ccef);throw _0xb5ccef;});}return _0x5e1632;});}})['then'](respondWithResult(_0x42c72f,0xc9))[_0x5972('0x46')](handleError(_0x42c72f,null));};exports[_0x5972('0x59')]=function(_0x462cd2,_0x1d77eb){if(_0x462cd2[_0x5972('0x4c')]['id']){delete _0x462cd2[_0x5972('0x4c')]['id'];}return db[_0x5972('0x2f')][_0x5972('0x4a')]({'where':{'id':_0x462cd2[_0x5972('0x47')]['id']}})[_0x5972('0x27')](handleEntityNotFound(_0x1d77eb,null))['then'](saveUpdates(_0x462cd2['body'],null))[_0x5972('0x27')](respondWithResult(_0x1d77eb,null))[_0x5972('0x46')](handleError(_0x1d77eb,null));};exports[_0x5972('0x28')]=function(_0x570420,_0xbbcb3c){return db['Dashboard']['find']({'where':{'id':_0x570420['params']['id']}})[_0x5972('0x27')](handleEntityNotFound(_0xbbcb3c,null))[_0x5972('0x27')](removeEntity(_0xbbcb3c,null))['catch'](handleError(_0xbbcb3c,null));};function widgetAttributes(_0x133199){try{switch(_0x133199['type']){case'iframe':return[{'name':_0x5972('0x5a'),'value':_0x133199[_0x5972('0x5a')]||(_0x133199[_0x5972('0x5b')]&&_0x133199[_0x5972('0x5b')][0x0]?_0x133199['attrs'][0x0][_0x5972('0x5c')]:undefined)||'https://'}];case _0x5972('0x5d'):return[{'name':_0x5972('0x5e'),'value':_0x133199[_0x5972('0x5e')]||(_0x133199[_0x5972('0x5b')]&&_0x133199[_0x5972('0x5b')][0x0]?_0x133199['attrs'][0x0][_0x5972('0x5c')]:undefined)||''}];case _0x5972('0x5f'):return[{'name':_0x5972('0x60'),'value':_0x133199[_0x5972('0x60')]||(_0x133199[_0x5972('0x5b')]&&_0x133199['attrs'][0x0]?_0x133199[_0x5972('0x5b')][0x0][_0x5972('0x5c')]:undefined)||'HH:mm:ss'},{'name':'attrTimezone','value':_0x133199[_0x5972('0x61')]||(_0x133199[_0x5972('0x5b')]&&_0x133199[_0x5972('0x5b')][0x1]?_0x133199[_0x5972('0x5b')][0x1]['value']:undefined)||_0x5972('0x62')},{'name':_0x5972('0x63'),'value':_0x133199[_0x5972('0x63')]||(_0x133199[_0x5972('0x5b')]&&_0x133199[_0x5972('0x5b')][0x2]?_0x133199[_0x5972('0x5b')][0x2]['value']:undefined)||0xc}];case'counter':return[{'name':_0x5972('0x64'),'value':_0x133199[_0x5972('0x64')]||(_0x133199[_0x5972('0x5b')]&&_0x133199[_0x5972('0x5b')][0x0]?_0x133199['attrs'][0x0]['value']:undefined)||_0x5972('0x65')},{'name':_0x5972('0x66'),'value':_0x133199[_0x5972('0x66')]||(_0x133199[_0x5972('0x5b')]&&_0x133199[_0x5972('0x5b')][0x1]?_0x133199[_0x5972('0x5b')][0x1][_0x5972('0x5c')]:undefined)||[]},{'name':_0x5972('0x63'),'value':_0x133199[_0x5972('0x63')]||(_0x133199['attrs']&&_0x133199[_0x5972('0x5b')][0x2]?_0x133199[_0x5972('0x5b')][0x2][_0x5972('0x5c')]:undefined)||0x14}];case _0x5972('0x67'):case _0x5972('0x68'):return[{'name':_0x5972('0x69'),'value':_0x133199['attrSerie1']||(_0x133199[_0x5972('0x5b')]&&_0x133199[_0x5972('0x5b')][0x0]?_0x133199[_0x5972('0x5b')][0x0][_0x5972('0x5c')]:undefined)||_0x5972('0x65')},{'name':'attrSerie2','value':_0x133199[_0x5972('0x6a')]||(_0x133199[_0x5972('0x5b')]&&_0x133199['attrs'][0x1]?_0x133199[_0x5972('0x5b')][0x1][_0x5972('0x5c')]:undefined)||null},{'name':_0x5972('0x6b'),'value':_0x133199[_0x5972('0x6b')]||(_0x133199['attrs']&&_0x133199[_0x5972('0x5b')][0x2]?_0x133199[_0x5972('0x5b')][0x2][_0x5972('0x5c')]:undefined)||null},{'name':'attrVoiceQueues','value':_0x133199['attrVoiceQueues']||(_0x133199[_0x5972('0x5b')]&&_0x133199['attrs'][0x3]?_0x133199[_0x5972('0x5b')][0x3][_0x5972('0x5c')]:undefined)||[]}];case _0x5972('0x6c'):return[{'name':_0x5972('0x6d'),'type':_0x133199['reportType']||(_0x133199[_0x5972('0x5b')]&&_0x133199[_0x5972('0x5b')][0x0]?_0x133199['attrs'][0x0]['type']:undefined)||null,'value':_0x133199[_0x5972('0x6d')]||(_0x133199[_0x5972('0x5b')]&&_0x133199[_0x5972('0x5b')][0x0]?_0x133199[_0x5972('0x5b')][0x0][_0x5972('0x5c')]:undefined)||null},{'name':'attrRefresh','value':_0x133199['attrRefresh']||(_0x133199[_0x5972('0x5b')]&&_0x133199[_0x5972('0x5b')][0x1]?_0x133199[_0x5972('0x5b')][0x1][_0x5972('0x5c')]:undefined)||0x0}];default:return[];}}catch(_0x16cd06){logger[_0x5972('0x52')](_0x5972('0x6e'),JSON[_0x5972('0x6f')](_0x16cd06));return[];}}exports[_0x5972('0x70')]=function(_0x55b7b7,_0x3a0ed1,_0x7bcc90){if(_0x55b7b7[_0x5972('0x4c')]['id']){delete _0x55b7b7[_0x5972('0x4c')]['id'];}return db[_0x5972('0x2f')]['find']({'where':{'id':_0x55b7b7[_0x5972('0x47')]['id']}})[_0x5972('0x27')](handleEntityNotFound(_0x3a0ed1,null))['then'](function(_0x269bf7){if(_0x269bf7){_0x55b7b7[_0x5972('0x4c')][_0x5972('0x71')]=_0x269bf7['id'];_0x55b7b7[_0x5972('0x4c')][_0x5972('0x5b')]=widgetAttributes(_0x55b7b7[_0x5972('0x4c')]);return db[_0x5972('0x72')]['create'](_0x55b7b7['body']);}})[_0x5972('0x27')](respondWithResult(_0x3a0ed1,null))[_0x5972('0x46')](handleError(_0x3a0ed1,null));};exports['getItems']=function(_0xdd2904,_0x3ca8e0,_0x2bebf6){var _0x2701fb={};var _0x4b94da={};var _0x233df3;var _0x24c97c;return db[_0x5972('0x2f')][_0x5972('0x73')]({'where':{'id':_0xdd2904[_0x5972('0x47')]['id']}})[_0x5972('0x27')](handleEntityNotFound(_0x3ca8e0,null))[_0x5972('0x27')](function(_0x4cc93c){if(_0x4cc93c){_0x233df3=_0x4cc93c;_0x4b94da[_0x5972('0x39')]=_[_0x5972('0x36')](db[_0x5972('0x72')][_0x5972('0x30')]);_0x4b94da['query']=_[_0x5972('0x36')](_0xdd2904[_0x5972('0x35')]);_0x4b94da[_0x5972('0x37')]=_['intersection'](_0x4b94da['model'],_0x4b94da[_0x5972('0x35')]);_0x2701fb[_0x5972('0x3a')]=_[_0x5972('0x38')](_0x4b94da['model'],qs[_0x5972('0x3b')](_0xdd2904['query']['fields']));_0x2701fb['attributes']=_0x2701fb[_0x5972('0x3a')][_0x5972('0x3c')]?_0x2701fb[_0x5972('0x3a')]:_0x4b94da[_0x5972('0x39')];_0x2701fb['order']=qs[_0x5972('0x3e')](_0xdd2904['query'][_0x5972('0x3e')]);_0x2701fb[_0x5972('0x3f')]=qs[_0x5972('0x37')](_['pick'](_0xdd2904[_0x5972('0x35')],_0x4b94da[_0x5972('0x37')]));if(_0xdd2904[_0x5972('0x35')][_0x5972('0x74')]){_0x2701fb[_0x5972('0x3f')]=_[_0x5972('0x41')](_0x2701fb[_0x5972('0x3f')],{'$or':_['map'](_0x2701fb[_0x5972('0x3a')],function(_0x5dee28){var _0x5aa947={};_0x5aa947[_0x5dee28]={'$like':'%'+_0xdd2904[_0x5972('0x35')]['filter']+'%'};return _0x5aa947;})});}_0x2701fb=_['merge']({},_0x2701fb,_0xdd2904['options']);return _0x233df3['getItems'](_0x2701fb);}})['then'](function(_0x34fa5c){if(_0x34fa5c){_0x24c97c=_0x34fa5c['length'];if(!_0xdd2904[_0x5972('0x35')]['hasOwnProperty']('nolimit')){_0x2701fb[_0x5972('0x20')]=qs['limit'](_0xdd2904[_0x5972('0x35')]['limit']);_0x2701fb[_0x5972('0x1e')]=qs[_0x5972('0x1e')](_0xdd2904[_0x5972('0x35')][_0x5972('0x1e')]);}return _0x233df3[_0x5972('0x75')](_0x2701fb);}})[_0x5972('0x27')](function(_0x1472de){if(_0x1472de){return _0x1472de?{'count':_0x24c97c,'rows':_0x1472de}:null;}})[_0x5972('0x27')](respondWithResult(_0x3ca8e0,null))[_0x5972('0x46')](handleError(_0x3ca8e0,null));}; \ No newline at end of file +var _0xd5a1=['crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./dashboard.socket','register','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','destroy','then','get','CustomDashboards','UserProfileResource','end','stack','name','send','map','Dashboard','rawAttributes','fieldName','type','key','keys','query','intersection','attributes','model','fields','length','hasOwnProperty','order','sort','where','filters','filter','options','includeAll','include','findAll','rows','catch','merge','find','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','userProfileId','create','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','updatedAt','role','UserProfileSection','autoAssociation','params','iframe','attrUrl','value','https://','custom','attrPath','attrs','clock','attrHourFormat','attrTimezone','0.00','attrFontSize','counter','attrMetric','total','attrVoiceQueues','multibar-chart','pie-chart','attrSerie1','attrSerie2','web-report','attrReport','widgetAttributes:\x20%s','addItem','DashboardId','DashboardItem','getItems','findOne','nolimit','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','sox','to-csv','fs-extra','lodash'];(function(_0x459b74,_0x5773bd){var _0x46cb16=function(_0x97867f){while(--_0x97867f){_0x459b74['push'](_0x459b74['shift']());}};_0x46cb16(++_0x5773bd);}(_0xd5a1,0xe6));var _0x1d5a=function(_0x34fbf9,_0x4b0a7b){_0x34fbf9=_0x34fbf9-0x0;var _0x17bb6a=_0xd5a1[_0x34fbf9];return _0x17bb6a;};'use strict';var emlformat=require(_0x1d5a('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1d5a('0x1'));var jsonpatch=require(_0x1d5a('0x2'));var rp=require(_0x1d5a('0x3'));var moment=require(_0x1d5a('0x4'));var BPromise=require(_0x1d5a('0x5'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x1d5a('0x6'));var csv=require(_0x1d5a('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1d5a('0x8'));var _=require(_0x1d5a('0x9'));var squel=require('squel');var crypto=require(_0x1d5a('0xa'));var jsforce=require(_0x1d5a('0xb'));var deskjs=require(_0x1d5a('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x1d5a('0xd'));var authService=require(_0x1d5a('0xe'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1d5a('0xf'));var logger=require(_0x1d5a('0x10'))(_0x1d5a('0x11'));var utils=require(_0x1d5a('0x12'));var config=require(_0x1d5a('0x13'));var licenseUtil=require(_0x1d5a('0x14'));var db=require(_0x1d5a('0x15'))['db'];config[_0x1d5a('0x16')]=_[_0x1d5a('0x17')](config[_0x1d5a('0x16')],{'host':_0x1d5a('0x18'),'port':0x18eb});var socket=require(_0x1d5a('0x19'))(new Redis(config[_0x1d5a('0x16')]));require(_0x1d5a('0x1a'))[_0x1d5a('0x1b')](socket);function respondWithStatusCode(_0x371b08,_0x549847){_0x549847=_0x549847||0xcc;return function(_0x4ec90a){if(_0x4ec90a){return _0x371b08[_0x1d5a('0x1c')](_0x549847);}return _0x371b08[_0x1d5a('0x1d')](_0x549847)['end']();};}function respondWithResult(_0x1cac2e,_0x156e52){_0x156e52=_0x156e52||0xc8;return function(_0x1f26a3){if(_0x1f26a3){return _0x1cac2e[_0x1d5a('0x1d')](_0x156e52)[_0x1d5a('0x1e')](_0x1f26a3);}};}function respondWithFilteredResult(_0x2acba2,_0x268535){return function(_0x2bcc9f){if(_0x2bcc9f){var _0x46573e=typeof _0x268535[_0x1d5a('0x1f')]===_0x1d5a('0x20')&&typeof _0x268535[_0x1d5a('0x21')]===_0x1d5a('0x20');var _0x5e1917=_0x2bcc9f[_0x1d5a('0x22')];var _0x5d534f=_0x46573e?0x0:_0x268535['offset'];var _0x2967f2=_0x46573e?_0x2bcc9f[_0x1d5a('0x22')]:_0x268535[_0x1d5a('0x1f')]+_0x268535[_0x1d5a('0x21')];var _0x4cf27e;if(_0x2967f2>=_0x5e1917){_0x2967f2=_0x5e1917;_0x4cf27e=0xc8;}else{_0x4cf27e=0xce;}_0x2acba2[_0x1d5a('0x1d')](_0x4cf27e);return _0x2acba2[_0x1d5a('0x23')](_0x1d5a('0x24'),_0x5d534f+'-'+_0x2967f2+'/'+_0x5e1917)[_0x1d5a('0x1e')](_0x2bcc9f);}return null;};}function patchUpdates(_0x42b636){return function(_0x162077){try{jsonpatch['apply'](_0x162077,_0x42b636,!![]);}catch(_0x14bbb0){return BPromise[_0x1d5a('0x25')](_0x14bbb0);}return _0x162077[_0x1d5a('0x26')]();};}function saveUpdates(_0x325066,_0x643565){return function(_0x5ee71e){if(_0x5ee71e){return _0x5ee71e[_0x1d5a('0x27')](_0x325066)['then'](function(_0x16b0bc){return _0x16b0bc;});}return null;};}function removeEntity(_0x15990b,_0x6d9a74){return function(_0x2a2c02){if(_0x2a2c02){return _0x2a2c02[_0x1d5a('0x28')]()[_0x1d5a('0x29')](function(){var _0x222f59=_0x2a2c02[_0x1d5a('0x2a')]({'plain':!![]});var _0x1ef075=_0x1d5a('0x2b');return db[_0x1d5a('0x2c')]['destroy']({'where':{'type':_0x1ef075,'resourceId':_0x222f59['id']}})[_0x1d5a('0x29')](function(){return _0x2a2c02;});})['then'](function(){_0x15990b[_0x1d5a('0x1d')](0xcc)[_0x1d5a('0x2d')]();});}};}function handleEntityNotFound(_0x167819,_0x708936){return function(_0x2f4a99){if(!_0x2f4a99){_0x167819['sendStatus'](0x194);}return _0x2f4a99;};}function handleError(_0x4812a6,_0x224d83){_0x224d83=_0x224d83||0x1f4;return function(_0x1375b0){logger['error'](_0x1375b0[_0x1d5a('0x2e')]);if(_0x1375b0[_0x1d5a('0x2f')]){delete _0x1375b0[_0x1d5a('0x2f')];}_0x4812a6[_0x1d5a('0x1d')](_0x224d83)[_0x1d5a('0x30')](_0x1375b0);};}exports['index']=function(_0x588688,_0x2fb2cd){var _0xb68e89={},_0x4ec0d9={},_0x548a48={'count':0x0,'rows':[]};var _0x27ac69=_[_0x1d5a('0x31')](db[_0x1d5a('0x32')][_0x1d5a('0x33')],function(_0x5c268f){return{'name':_0x5c268f[_0x1d5a('0x34')],'type':_0x5c268f[_0x1d5a('0x35')][_0x1d5a('0x36')]};});_0x4ec0d9['model']=_['map'](_0x27ac69,'name');_0x4ec0d9['query']=_[_0x1d5a('0x37')](_0x588688[_0x1d5a('0x38')]);_0x4ec0d9['filters']=_[_0x1d5a('0x39')](_0x4ec0d9['model'],_0x4ec0d9[_0x1d5a('0x38')]);_0xb68e89[_0x1d5a('0x3a')]=_[_0x1d5a('0x39')](_0x4ec0d9[_0x1d5a('0x3b')],qs[_0x1d5a('0x3c')](_0x588688['query'][_0x1d5a('0x3c')]));_0xb68e89[_0x1d5a('0x3a')]=_0xb68e89[_0x1d5a('0x3a')][_0x1d5a('0x3d')]?_0xb68e89['attributes']:_0x4ec0d9[_0x1d5a('0x3b')];if(!_0x588688[_0x1d5a('0x38')][_0x1d5a('0x3e')]('nolimit')){_0xb68e89['limit']=qs['limit'](_0x588688[_0x1d5a('0x38')]['limit']);_0xb68e89[_0x1d5a('0x1f')]=qs['offset'](_0x588688[_0x1d5a('0x38')][_0x1d5a('0x1f')]);}_0xb68e89[_0x1d5a('0x3f')]=qs[_0x1d5a('0x40')](_0x588688['query']['sort']);_0xb68e89[_0x1d5a('0x41')]=qs[_0x1d5a('0x42')](_['pick'](_0x588688[_0x1d5a('0x38')],_0x4ec0d9[_0x1d5a('0x42')]),_0x27ac69);if(_0x588688[_0x1d5a('0x38')][_0x1d5a('0x43')]){_0xb68e89['where']=_['merge'](_0xb68e89[_0x1d5a('0x41')],{'$or':_['map'](_0x27ac69,function(_0x11b0b4){if(_0x11b0b4[_0x1d5a('0x35')]!=='VIRTUAL'){var _0x7817da={};_0x7817da[_0x11b0b4['name']]={'$like':'%'+_0x588688[_0x1d5a('0x38')][_0x1d5a('0x43')]+'%'};return _0x7817da;}})});}_0xb68e89=_['merge']({},_0xb68e89,_0x588688[_0x1d5a('0x44')]);var _0x1136f0={'where':_0xb68e89[_0x1d5a('0x41')]};return db['Dashboard']['count'](_0x1136f0)[_0x1d5a('0x29')](function(_0x570535){_0x548a48[_0x1d5a('0x22')]=_0x570535;if(_0x588688['query'][_0x1d5a('0x45')]){_0xb68e89[_0x1d5a('0x46')]=[{'all':!![]}];}return db[_0x1d5a('0x32')][_0x1d5a('0x47')](_0xb68e89);})[_0x1d5a('0x29')](function(_0x448c03){_0x548a48[_0x1d5a('0x48')]=_0x448c03;return _0x548a48;})[_0x1d5a('0x29')](respondWithFilteredResult(_0x2fb2cd,_0xb68e89))[_0x1d5a('0x49')](handleError(_0x2fb2cd,null));};exports['show']=function(_0x5b51b9,_0x115d6e){var _0x430be0={'raw':![],'where':{'id':_0x5b51b9['params']['id']}},_0x173f89={};_0x173f89[_0x1d5a('0x3b')]=_[_0x1d5a('0x37')](db[_0x1d5a('0x32')]['rawAttributes']);_0x173f89[_0x1d5a('0x38')]=_['keys'](_0x5b51b9[_0x1d5a('0x38')]);_0x173f89['filters']=_[_0x1d5a('0x39')](_0x173f89['model'],_0x173f89['query']);_0x430be0[_0x1d5a('0x3a')]=_['intersection'](_0x173f89[_0x1d5a('0x3b')],qs[_0x1d5a('0x3c')](_0x5b51b9['query'][_0x1d5a('0x3c')]));_0x430be0['attributes']=_0x430be0[_0x1d5a('0x3a')][_0x1d5a('0x3d')]?_0x430be0[_0x1d5a('0x3a')]:_0x173f89[_0x1d5a('0x3b')];if(_0x5b51b9[_0x1d5a('0x38')][_0x1d5a('0x45')]){_0x430be0[_0x1d5a('0x46')]=[{'all':!![]}];}_0x430be0=_[_0x1d5a('0x4a')]({},_0x430be0,_0x5b51b9['options']);return db['Dashboard'][_0x1d5a('0x4b')](_0x430be0)[_0x1d5a('0x29')](handleEntityNotFound(_0x115d6e,null))[_0x1d5a('0x29')](respondWithResult(_0x115d6e,null))['catch'](handleError(_0x115d6e,null));};exports['create']=function(_0x2633ae,_0x904e7d){return db['Dashboard']['create'](_0x2633ae[_0x1d5a('0x4c')],{})['then'](function(_0x140a41){var _0x36a6f0=_0x2633ae['user'][_0x1d5a('0x2a')]({'plain':!![]});if(!_0x36a6f0)throw new Error(_0x1d5a('0x4d'));if(_0x36a6f0['role']===_0x1d5a('0x4e')){var _0x2545b2=_0x140a41[_0x1d5a('0x2a')]({'plain':!![]});var _0x20ed67=_0x1d5a('0x2b');return db['UserProfileSection'][_0x1d5a('0x4b')]({'where':{'name':_0x20ed67,'userProfileId':_0x36a6f0[_0x1d5a('0x4f')]},'raw':!![]})[_0x1d5a('0x29')](function(_0x4dc76a){if(_0x4dc76a&&_0x4dc76a['autoAssociation']===0x0){return db[_0x1d5a('0x2c')][_0x1d5a('0x50')]({'name':_0x2545b2[_0x1d5a('0x2f')],'resourceId':_0x2545b2['id'],'type':_0x4dc76a['name'],'sectionId':_0x4dc76a['id']},{})[_0x1d5a('0x29')](function(){return _0x140a41;});}else{return _0x140a41;}})[_0x1d5a('0x49')](function(_0x33023f){logger[_0x1d5a('0x51')](_0x1d5a('0x52'),_0x33023f);throw _0x33023f;});}return _0x140a41;})['then'](respondWithResult(_0x904e7d,0xc9))[_0x1d5a('0x49')](handleError(_0x904e7d,null));};exports[_0x1d5a('0x53')]=function(_0x14b00e,_0x388d65){var _0x1cbd95={'where':{'id':_0x14b00e['params']['id']}},_0x164d30={};_0x164d30[_0x1d5a('0x3b')]=_[_0x1d5a('0x37')](db['Dashboard'][_0x1d5a('0x33')]);_0x1cbd95['attributes']=_['intersection'](_0x164d30[_0x1d5a('0x3b')],qs[_0x1d5a('0x3c')](_0x14b00e[_0x1d5a('0x38')][_0x1d5a('0x3c')]));_0x1cbd95[_0x1d5a('0x3a')]=_0x1cbd95[_0x1d5a('0x3a')][_0x1d5a('0x3d')]?_0x1cbd95[_0x1d5a('0x3a')]:_0x164d30[_0x1d5a('0x3b')];if(_0x14b00e[_0x1d5a('0x38')][_0x1d5a('0x45')]){_0x1cbd95[_0x1d5a('0x46')]=[{'all':!![]}];}_0x1cbd95=_[_0x1d5a('0x4a')]({},_0x1cbd95,_0x14b00e[_0x1d5a('0x44')]);return db['Dashboard'][_0x1d5a('0x4b')](_0x1cbd95)[_0x1d5a('0x29')](handleEntityNotFound(_0x388d65,null))[_0x1d5a('0x29')](function(_0x5be734){if(_0x5be734){var _0x208384=_0x5be734['get']({'plain':!![]});_0x208384=qs[_0x1d5a('0x54')](_0x208384,['id',_0x1d5a('0x55'),_0x1d5a('0x56')]);_0x14b00e[_0x1d5a('0x4c')]=_['omit'](_0x14b00e[_0x1d5a('0x4c')],['id','createdAt',_0x1d5a('0x56')]);return db[_0x1d5a('0x32')][_0x1d5a('0x50')](_[_0x1d5a('0x4a')](_0x208384,_0x14b00e[_0x1d5a('0x4c')]),{'include':_0x14b00e['query'][_0x1d5a('0x45')]?[{'all':!![]}]:undefined})[_0x1d5a('0x29')](function(_0x39dbd8){var _0x4d87af=_0x14b00e['user']['get']({'plain':!![]});if(!_0x4d87af)throw new Error(_0x1d5a('0x4d'));if(_0x4d87af[_0x1d5a('0x57')]===_0x1d5a('0x4e')){var _0x2296be=_0x39dbd8[_0x1d5a('0x2a')]({'plain':!![]});var _0xaef19c='CustomDashboards';return db[_0x1d5a('0x58')][_0x1d5a('0x4b')]({'where':{'name':_0xaef19c,'userProfileId':_0x4d87af['userProfileId']},'raw':!![]})[_0x1d5a('0x29')](function(_0x4ba8f1){if(_0x4ba8f1&&_0x4ba8f1[_0x1d5a('0x59')]===0x0){return db[_0x1d5a('0x2c')][_0x1d5a('0x50')]({'name':_0x2296be[_0x1d5a('0x2f')],'resourceId':_0x2296be['id'],'type':_0x4ba8f1[_0x1d5a('0x2f')],'sectionId':_0x4ba8f1['id']},{})[_0x1d5a('0x29')](function(){return _0x39dbd8;});}else{return _0x39dbd8;}})[_0x1d5a('0x49')](function(_0x5f0005){logger[_0x1d5a('0x51')](_0x1d5a('0x52'),_0x5f0005);throw _0x5f0005;});}return _0x39dbd8;});}})['then'](respondWithResult(_0x388d65,0xc9))[_0x1d5a('0x49')](handleError(_0x388d65,null));};exports[_0x1d5a('0x27')]=function(_0x4778f0,_0x5b28b3){if(_0x4778f0[_0x1d5a('0x4c')]['id']){delete _0x4778f0['body']['id'];}return db['Dashboard'][_0x1d5a('0x4b')]({'where':{'id':_0x4778f0[_0x1d5a('0x5a')]['id']}})[_0x1d5a('0x29')](handleEntityNotFound(_0x5b28b3,null))[_0x1d5a('0x29')](saveUpdates(_0x4778f0[_0x1d5a('0x4c')],null))[_0x1d5a('0x29')](respondWithResult(_0x5b28b3,null))[_0x1d5a('0x49')](handleError(_0x5b28b3,null));};exports['destroy']=function(_0x2e4a29,_0x4c17ac){return db['Dashboard']['find']({'where':{'id':_0x2e4a29[_0x1d5a('0x5a')]['id']}})[_0x1d5a('0x29')](handleEntityNotFound(_0x4c17ac,null))[_0x1d5a('0x29')](removeEntity(_0x4c17ac,null))[_0x1d5a('0x49')](handleError(_0x4c17ac,null));};function widgetAttributes(_0x43e51a){try{switch(_0x43e51a[_0x1d5a('0x35')]){case _0x1d5a('0x5b'):return[{'name':'attrUrl','value':_0x43e51a[_0x1d5a('0x5c')]||(_0x43e51a['attrs']&&_0x43e51a['attrs'][0x0]?_0x43e51a['attrs'][0x0][_0x1d5a('0x5d')]:undefined)||_0x1d5a('0x5e')}];case _0x1d5a('0x5f'):return[{'name':_0x1d5a('0x60'),'value':_0x43e51a[_0x1d5a('0x60')]||(_0x43e51a[_0x1d5a('0x61')]&&_0x43e51a['attrs'][0x0]?_0x43e51a['attrs'][0x0][_0x1d5a('0x5d')]:undefined)||''}];case _0x1d5a('0x62'):return[{'name':_0x1d5a('0x63'),'value':_0x43e51a[_0x1d5a('0x63')]||(_0x43e51a[_0x1d5a('0x61')]&&_0x43e51a[_0x1d5a('0x61')][0x0]?_0x43e51a[_0x1d5a('0x61')][0x0][_0x1d5a('0x5d')]:undefined)||'HH:mm:ss'},{'name':_0x1d5a('0x64'),'value':_0x43e51a['attrTimezone']||(_0x43e51a[_0x1d5a('0x61')]&&_0x43e51a[_0x1d5a('0x61')][0x1]?_0x43e51a[_0x1d5a('0x61')][0x1][_0x1d5a('0x5d')]:undefined)||_0x1d5a('0x65')},{'name':_0x1d5a('0x66'),'value':_0x43e51a[_0x1d5a('0x66')]||(_0x43e51a[_0x1d5a('0x61')]&&_0x43e51a[_0x1d5a('0x61')][0x2]?_0x43e51a[_0x1d5a('0x61')][0x2][_0x1d5a('0x5d')]:undefined)||0xc}];case _0x1d5a('0x67'):return[{'name':'attrMetric','value':_0x43e51a[_0x1d5a('0x68')]||(_0x43e51a[_0x1d5a('0x61')]&&_0x43e51a[_0x1d5a('0x61')][0x0]?_0x43e51a['attrs'][0x0][_0x1d5a('0x5d')]:undefined)||_0x1d5a('0x69')},{'name':_0x1d5a('0x6a'),'value':_0x43e51a[_0x1d5a('0x6a')]||(_0x43e51a[_0x1d5a('0x61')]&&_0x43e51a[_0x1d5a('0x61')][0x1]?_0x43e51a[_0x1d5a('0x61')][0x1][_0x1d5a('0x5d')]:undefined)||[]},{'name':_0x1d5a('0x66'),'value':_0x43e51a[_0x1d5a('0x66')]||(_0x43e51a['attrs']&&_0x43e51a['attrs'][0x2]?_0x43e51a[_0x1d5a('0x61')][0x2]['value']:undefined)||0x14}];case _0x1d5a('0x6b'):case _0x1d5a('0x6c'):return[{'name':_0x1d5a('0x6d'),'value':_0x43e51a[_0x1d5a('0x6d')]||(_0x43e51a[_0x1d5a('0x61')]&&_0x43e51a[_0x1d5a('0x61')][0x0]?_0x43e51a['attrs'][0x0][_0x1d5a('0x5d')]:undefined)||_0x1d5a('0x69')},{'name':_0x1d5a('0x6e'),'value':_0x43e51a[_0x1d5a('0x6e')]||(_0x43e51a['attrs']&&_0x43e51a[_0x1d5a('0x61')][0x1]?_0x43e51a[_0x1d5a('0x61')][0x1][_0x1d5a('0x5d')]:undefined)||null},{'name':'attrSerie3','value':_0x43e51a['attrSerie3']||(_0x43e51a[_0x1d5a('0x61')]&&_0x43e51a[_0x1d5a('0x61')][0x2]?_0x43e51a[_0x1d5a('0x61')][0x2][_0x1d5a('0x5d')]:undefined)||null},{'name':_0x1d5a('0x6a'),'value':_0x43e51a[_0x1d5a('0x6a')]||(_0x43e51a[_0x1d5a('0x61')]&&_0x43e51a[_0x1d5a('0x61')][0x3]?_0x43e51a[_0x1d5a('0x61')][0x3][_0x1d5a('0x5d')]:undefined)||[]}];case _0x1d5a('0x6f'):return[{'name':_0x1d5a('0x70'),'type':_0x43e51a['reportType']||(_0x43e51a['attrs']&&_0x43e51a['attrs'][0x0]?_0x43e51a[_0x1d5a('0x61')][0x0]['type']:undefined)||null,'value':_0x43e51a['attrReport']||(_0x43e51a['attrs']&&_0x43e51a[_0x1d5a('0x61')][0x0]?_0x43e51a['attrs'][0x0][_0x1d5a('0x5d')]:undefined)||null},{'name':'attrRefresh','value':_0x43e51a['attrRefresh']||(_0x43e51a[_0x1d5a('0x61')]&&_0x43e51a['attrs'][0x1]?_0x43e51a[_0x1d5a('0x61')][0x1][_0x1d5a('0x5d')]:undefined)||0x0}];default:return[];}}catch(_0x5d4cee){logger[_0x1d5a('0x51')](_0x1d5a('0x71'),JSON['stringify'](_0x5d4cee));return[];}}exports[_0x1d5a('0x72')]=function(_0x270a8b,_0x5e4f3e,_0x57158c){if(_0x270a8b[_0x1d5a('0x4c')]['id']){delete _0x270a8b[_0x1d5a('0x4c')]['id'];}return db[_0x1d5a('0x32')][_0x1d5a('0x4b')]({'where':{'id':_0x270a8b[_0x1d5a('0x5a')]['id']}})[_0x1d5a('0x29')](handleEntityNotFound(_0x5e4f3e,null))['then'](function(_0x12f08e){if(_0x12f08e){_0x270a8b['body'][_0x1d5a('0x73')]=_0x12f08e['id'];_0x270a8b[_0x1d5a('0x4c')][_0x1d5a('0x61')]=widgetAttributes(_0x270a8b[_0x1d5a('0x4c')]);return db[_0x1d5a('0x74')][_0x1d5a('0x50')](_0x270a8b[_0x1d5a('0x4c')]);}})[_0x1d5a('0x29')](respondWithResult(_0x5e4f3e,null))['catch'](handleError(_0x5e4f3e,null));};exports[_0x1d5a('0x75')]=function(_0x4223f4,_0x5109bd,_0x2efde8){var _0x5cf08f={};var _0x1abd7d={};var _0x334e20;var _0x48e035;return db[_0x1d5a('0x32')][_0x1d5a('0x76')]({'where':{'id':_0x4223f4[_0x1d5a('0x5a')]['id']}})[_0x1d5a('0x29')](handleEntityNotFound(_0x5109bd,null))[_0x1d5a('0x29')](function(_0x110b08){if(_0x110b08){_0x334e20=_0x110b08;_0x1abd7d[_0x1d5a('0x3b')]=_[_0x1d5a('0x37')](db[_0x1d5a('0x74')]['rawAttributes']);_0x1abd7d['query']=_['keys'](_0x4223f4[_0x1d5a('0x38')]);_0x1abd7d[_0x1d5a('0x42')]=_[_0x1d5a('0x39')](_0x1abd7d[_0x1d5a('0x3b')],_0x1abd7d['query']);_0x5cf08f['attributes']=_[_0x1d5a('0x39')](_0x1abd7d[_0x1d5a('0x3b')],qs[_0x1d5a('0x3c')](_0x4223f4[_0x1d5a('0x38')][_0x1d5a('0x3c')]));_0x5cf08f[_0x1d5a('0x3a')]=_0x5cf08f[_0x1d5a('0x3a')]['length']?_0x5cf08f['attributes']:_0x1abd7d[_0x1d5a('0x3b')];_0x5cf08f[_0x1d5a('0x3f')]=qs[_0x1d5a('0x40')](_0x4223f4[_0x1d5a('0x38')][_0x1d5a('0x40')]);_0x5cf08f[_0x1d5a('0x41')]=qs[_0x1d5a('0x42')](_['pick'](_0x4223f4[_0x1d5a('0x38')],_0x1abd7d[_0x1d5a('0x42')]));if(_0x4223f4[_0x1d5a('0x38')][_0x1d5a('0x43')]){_0x5cf08f[_0x1d5a('0x41')]=_[_0x1d5a('0x4a')](_0x5cf08f[_0x1d5a('0x41')],{'$or':_[_0x1d5a('0x31')](_0x5cf08f['attributes'],function(_0x1461d4){var _0x2dcc2e={};_0x2dcc2e[_0x1461d4]={'$like':'%'+_0x4223f4[_0x1d5a('0x38')][_0x1d5a('0x43')]+'%'};return _0x2dcc2e;})});}_0x5cf08f=_[_0x1d5a('0x4a')]({},_0x5cf08f,_0x4223f4[_0x1d5a('0x44')]);return _0x334e20[_0x1d5a('0x75')](_0x5cf08f);}})[_0x1d5a('0x29')](function(_0x549cd4){if(_0x549cd4){_0x48e035=_0x549cd4[_0x1d5a('0x3d')];if(!_0x4223f4[_0x1d5a('0x38')][_0x1d5a('0x3e')](_0x1d5a('0x77'))){_0x5cf08f[_0x1d5a('0x21')]=qs[_0x1d5a('0x21')](_0x4223f4[_0x1d5a('0x38')][_0x1d5a('0x21')]);_0x5cf08f[_0x1d5a('0x1f')]=qs['offset'](_0x4223f4[_0x1d5a('0x38')]['offset']);}return _0x334e20['getItems'](_0x5cf08f);}})['then'](function(_0x18a23c){if(_0x18a23c){return _0x18a23c?{'count':_0x48e035,'rows':_0x18a23c}:null;}})[_0x1d5a('0x29')](respondWithResult(_0x5109bd,null))['catch'](handleError(_0x5109bd,null));}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.events.js b/server/api/dashboard/dashboard.events.js index a64c622..06d844e 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 _0x3d3c=['hook','exports','events','../../mysqldb','Dashboard','setMaxListeners','save','update','emit','hasOwnProperty'];(function(_0x101628,_0x2cfb10){var _0x574889=function(_0x2df2fa){while(--_0x2df2fa){_0x101628['push'](_0x101628['shift']());}};_0x574889(++_0x2cfb10);}(_0x3d3c,0x98));var _0xc3d3=function(_0x24237f,_0x4cf32c){_0x24237f=_0x24237f-0x0;var _0x48298e=_0x3d3c[_0x24237f];return _0x48298e;};'use strict';var EventEmitter=require(_0xc3d3('0x0'));var Dashboard=require(_0xc3d3('0x1'))['db'][_0xc3d3('0x2')];var DashboardEvents=new EventEmitter();DashboardEvents[_0xc3d3('0x3')](0x0);var events={'afterCreate':_0xc3d3('0x4'),'afterUpdate':_0xc3d3('0x5'),'afterDestroy':'remove'};function emitEvent(_0x5116b4){return function(_0x5de982,_0x1e6e66,_0x4efade){DashboardEvents[_0xc3d3('0x6')](_0x5116b4+':'+_0x5de982['id'],_0x5de982);DashboardEvents[_0xc3d3('0x6')](_0x5116b4,_0x5de982);_0x4efade(null);};}for(var e in events){if(events[_0xc3d3('0x7')](e)){var event=events[e];Dashboard[_0xc3d3('0x8')](e,emitEvent(event));}}module[_0xc3d3('0x9')]=DashboardEvents; \ No newline at end of file +var _0x9f02=['save','update','remove','emit','hasOwnProperty','hook','events'];(function(_0x3d1c95,_0x10ced8){var _0x2c17c5=function(_0x3d7415){while(--_0x3d7415){_0x3d1c95['push'](_0x3d1c95['shift']());}};_0x2c17c5(++_0x10ced8);}(_0x9f02,0x68));var _0x29f0=function(_0x3ff70b,_0x4e550d){_0x3ff70b=_0x3ff70b-0x0;var _0xc02fe4=_0x9f02[_0x3ff70b];return _0xc02fe4;};'use strict';var EventEmitter=require(_0x29f0('0x0'));var Dashboard=require('../../mysqldb')['db']['Dashboard'];var DashboardEvents=new EventEmitter();DashboardEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x29f0('0x1'),'afterUpdate':_0x29f0('0x2'),'afterDestroy':_0x29f0('0x3')};function emitEvent(_0x24792b){return function(_0x1a49c1,_0x47e569,_0x204fc4){DashboardEvents['emit'](_0x24792b+':'+_0x1a49c1['id'],_0x1a49c1);DashboardEvents[_0x29f0('0x4')](_0x24792b,_0x1a49c1);_0x204fc4(null);};}for(var e in events){if(events[_0x29f0('0x5')](e)){var event=events[e];Dashboard[_0x29f0('0x6')](e,emitEvent(event));}}module['exports']=DashboardEvents; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.model.js b/server/api/dashboard/dashboard.model.js index 4a597ee..be8fd31 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 _0xeb34=['moment','request-promise','path','../../config/environment','./dashboard.attributes','exports','define','Dashboard','dashboards','lodash','util','api'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0xeb34,0xc9));var _0x4eb3=function(_0x3c40f4,_0x500b8a){_0x3c40f4=_0x3c40f4-0x0;var _0x1209d=_0xeb34[_0x3c40f4];return _0x1209d;};'use strict';var _=require(_0x4eb3('0x0'));var util=require(_0x4eb3('0x1'));var logger=require('../../config/logger')(_0x4eb3('0x2'));var moment=require(_0x4eb3('0x3'));var BPromise=require('bluebird');var rp=require(_0x4eb3('0x4'));var fs=require('fs');var path=require(_0x4eb3('0x5'));var rimraf=require('rimraf');var config=require(_0x4eb3('0x6'));var attributes=require(_0x4eb3('0x7'));module[_0x4eb3('0x8')]=function(_0xa57c51,_0x1ba6ff){return _0xa57c51[_0x4eb3('0x9')](_0x4eb3('0xa'),attributes,{'tableName':_0x4eb3('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xdfc8=['path','rimraf','../../config/environment','./dashboard.attributes','exports','define','Dashboard','lodash','util','api','moment','bluebird'];(function(_0x4e4ece,_0x10bb56){var _0x2cdc7a=function(_0xf72919){while(--_0xf72919){_0x4e4ece['push'](_0x4e4ece['shift']());}};_0x2cdc7a(++_0x10bb56);}(_0xdfc8,0x127));var _0x8dfc=function(_0x1fdf99,_0x2fad49){_0x1fdf99=_0x1fdf99-0x0;var _0x4306fc=_0xdfc8[_0x1fdf99];return _0x4306fc;};'use strict';var _=require(_0x8dfc('0x0'));var util=require(_0x8dfc('0x1'));var logger=require('../../config/logger')(_0x8dfc('0x2'));var moment=require(_0x8dfc('0x3'));var BPromise=require(_0x8dfc('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8dfc('0x5'));var rimraf=require(_0x8dfc('0x6'));var config=require(_0x8dfc('0x7'));var attributes=require(_0x8dfc('0x8'));module[_0x8dfc('0x9')]=function(_0x15b128,_0x2f547a){return _0x15b128[_0x8dfc('0xa')](_0x8dfc('0xb'),attributes,{'tableName':'dashboards','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.rpc.js b/server/api/dashboard/dashboard.rpc.js index f0a7400..f6ff971 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 _0xb4bf=['../../config/logger','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./dashboard.socket','request','then','info','debug','Dashboard,\x20%s,\x20%s,\x20%s','stringify','error','code','message','Dashboard,\x20%s,\x20%s','request\x20sent','lodash','util','moment','ioredis','../../mysqldb'];(function(_0x2800f4,_0x4d92a6){var _0x1701a2=function(_0x35701b){while(--_0x35701b){_0x2800f4['push'](_0x2800f4['shift']());}};_0x1701a2(++_0x4d92a6);}(_0xb4bf,0x91));var _0xfb4b=function(_0x2aec52,_0x59d962){_0x2aec52=_0x2aec52-0x0;var _0x3b8835=_0xb4bf[_0x2aec52];return _0x3b8835;};'use strict';var _=require(_0xfb4b('0x0'));var util=require(_0xfb4b('0x1'));var moment=require(_0xfb4b('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xfb4b('0x3'));var db=require(_0xfb4b('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xfb4b('0x5'))('rpc');var config=require(_0xfb4b('0x6'));var jayson=require(_0xfb4b('0x7'));var client=jayson['client'][_0xfb4b('0x8')]({'port':0x232a});config[_0xfb4b('0x9')]=_[_0xfb4b('0xa')](config[_0xfb4b('0x9')],{'host':_0xfb4b('0xb'),'port':0x18eb});var socket=require(_0xfb4b('0xc'))(new Redis(config[_0xfb4b('0x9')]));require(_0xfb4b('0xd'))['register'](socket);function respondWithRpcPromise(_0x4cd39d,_0x59e16e,_0x1a2eee){return new BPromise(function(_0x113317,_0x36c785){return client[_0xfb4b('0xe')](_0x4cd39d,_0x1a2eee)[_0xfb4b('0xf')](function(_0x27d9c2){logger[_0xfb4b('0x10')]('Dashboard,\x20%s,\x20%s',_0x59e16e,'request\x20sent');logger[_0xfb4b('0x11')](_0xfb4b('0x12'),_0x59e16e,'request\x20sent',JSON[_0xfb4b('0x13')](_0x27d9c2));if(_0x27d9c2['error']){if(_0x27d9c2[_0xfb4b('0x14')][_0xfb4b('0x15')]===0x1f4){logger['error']('Dashboard,\x20%s,\x20%s',_0x59e16e,_0x27d9c2['error'][_0xfb4b('0x16')]);return _0x36c785(_0x27d9c2['error'][_0xfb4b('0x16')]);}logger[_0xfb4b('0x14')](_0xfb4b('0x17'),_0x59e16e,_0x27d9c2[_0xfb4b('0x14')][_0xfb4b('0x16')]);return _0x113317(_0x27d9c2[_0xfb4b('0x14')]['message']);}else{logger['info'](_0xfb4b('0x17'),_0x59e16e,_0xfb4b('0x18'));_0x113317(_0x27d9c2['result'][_0xfb4b('0x16')]);}})['catch'](function(_0x577ea8){logger[_0xfb4b('0x14')](_0xfb4b('0x17'),_0x59e16e,_0x577ea8);_0x36c785(_0x577ea8);});});} \ No newline at end of file +var _0xd0a4=['randomstring','ioredis','../../mysqldb','../../config/logger','rpc','http','redis','./dashboard.socket','register','request','then','info','Dashboard,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','moment','bluebird'];(function(_0x319da4,_0x586fce){var _0x5a0e4a=function(_0x5c55ed){while(--_0x5c55ed){_0x319da4['push'](_0x319da4['shift']());}};_0x5a0e4a(++_0x586fce);}(_0xd0a4,0x13e));var _0x4d0a=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd0a4[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x4d0a('0x0'));var util=require(_0x4d0a('0x1'));var moment=require(_0x4d0a('0x2'));var BPromise=require(_0x4d0a('0x3'));var rs=require(_0x4d0a('0x4'));var fs=require('fs');var Redis=require(_0x4d0a('0x5'));var db=require(_0x4d0a('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x4d0a('0x7'))(_0x4d0a('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x4d0a('0x9')]({'port':0x232a});config[_0x4d0a('0xa')]=_['defaults'](config[_0x4d0a('0xa')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x4d0a('0xa')]));require(_0x4d0a('0xb'))[_0x4d0a('0xc')](socket);function respondWithRpcPromise(_0x4adc33,_0x10b7c7,_0x1b05da){return new BPromise(function(_0x29d5ff,_0x3be4ea){return client[_0x4d0a('0xd')](_0x4adc33,_0x1b05da)[_0x4d0a('0xe')](function(_0x1b7c41){logger[_0x4d0a('0xf')](_0x4d0a('0x10'),_0x10b7c7,_0x4d0a('0x11'));logger['debug']('Dashboard,\x20%s,\x20%s,\x20%s',_0x10b7c7,_0x4d0a('0x11'),JSON[_0x4d0a('0x12')](_0x1b7c41));if(_0x1b7c41[_0x4d0a('0x13')]){if(_0x1b7c41[_0x4d0a('0x13')][_0x4d0a('0x14')]===0x1f4){logger['error']('Dashboard,\x20%s,\x20%s',_0x10b7c7,_0x1b7c41[_0x4d0a('0x13')]['message']);return _0x3be4ea(_0x1b7c41[_0x4d0a('0x13')][_0x4d0a('0x15')]);}logger[_0x4d0a('0x13')](_0x4d0a('0x10'),_0x10b7c7,_0x1b7c41[_0x4d0a('0x13')][_0x4d0a('0x15')]);return _0x29d5ff(_0x1b7c41[_0x4d0a('0x13')][_0x4d0a('0x15')]);}else{logger[_0x4d0a('0xf')]('Dashboard,\x20%s,\x20%s',_0x10b7c7,_0x4d0a('0x11'));_0x29d5ff(_0x1b7c41['result']['message']);}})[_0x4d0a('0x16')](function(_0x3aa85b){logger[_0x4d0a('0x13')]('Dashboard,\x20%s,\x20%s',_0x10b7c7,_0x3aa85b);_0x3be4ea(_0x3aa85b);});});} \ No newline at end of file diff --git a/server/api/dashboard/dashboard.socket.js b/server/api/dashboard/dashboard.socket.js index f2694c6..6cc4ba3 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 _0xd211=['length','dashboard:','./dashboard.events','save','update','emit','removeListener','register'];(function(_0x41ff02,_0x325736){var _0x58a4c3=function(_0x519c27){while(--_0x519c27){_0x41ff02['push'](_0x41ff02['shift']());}};_0x58a4c3(++_0x325736);}(_0xd211,0xba));var _0x1d21=function(_0x4e0ba6,_0x51dc1e){_0x4e0ba6=_0x4e0ba6-0x0;var _0xd5fe2a=_0xd211[_0x4e0ba6];return _0xd5fe2a;};'use strict';var DashboardEvents=require(_0x1d21('0x0'));var events=[_0x1d21('0x1'),'remove',_0x1d21('0x2')];function createListener(_0x52e074,_0x4652b4){return function(_0x10dee4){_0x4652b4[_0x1d21('0x3')](_0x52e074,_0x10dee4);};}function removeListener(_0x66e256,_0x2914bc){return function(){DashboardEvents[_0x1d21('0x4')](_0x66e256,_0x2914bc);};}exports[_0x1d21('0x5')]=function(_0x50af00){for(var _0xe9f35f=0x0,_0xed4b3c=events[_0x1d21('0x6')];_0xe9f35f<_0xed4b3c;_0xe9f35f++){var _0x4ae586=events[_0xe9f35f];var _0x3c0e2e=createListener(_0x1d21('0x7')+_0x4ae586,_0x50af00);DashboardEvents['on'](_0x4ae586,_0x3c0e2e);}}; \ No newline at end of file +var _0xba0d=['length','./dashboard.events','remove','update','emit','removeListener'];(function(_0x57dc3a,_0x222de7){var _0x498cb1=function(_0x311c97){while(--_0x311c97){_0x57dc3a['push'](_0x57dc3a['shift']());}};_0x498cb1(++_0x222de7);}(_0xba0d,0x79));var _0xdba0=function(_0x438e10,_0x146fc2){_0x438e10=_0x438e10-0x0;var _0xabc963=_0xba0d[_0x438e10];return _0xabc963;};'use strict';var DashboardEvents=require(_0xdba0('0x0'));var events=['save',_0xdba0('0x1'),_0xdba0('0x2')];function createListener(_0x4b940f,_0x3554ab){return function(_0x1800df){_0x3554ab[_0xdba0('0x3')](_0x4b940f,_0x1800df);};}function removeListener(_0xb4e447,_0x430aea){return function(){DashboardEvents[_0xdba0('0x4')](_0xb4e447,_0x430aea);};}exports['register']=function(_0x1d17bc){for(var _0x4b2396=0x0,_0x5168b3=events[_0xdba0('0x5')];_0x4b2396<_0x5168b3;_0x4b2396++){var _0x52dee2=events[_0x4b2396];var _0x80c13a=createListener('dashboard:'+_0x52dee2,_0x1d17bc);DashboardEvents['on'](_0x52dee2,_0x80c13a);}}; \ No newline at end of file diff --git a/server/api/dashboard/index.js b/server/api/dashboard/index.js index 6e61a0d..62b4ebb 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 _0xe00b=['Router','../../components/auth/service','../../config/environment','get','index','show','/:id/items','isAuthenticated','getItems','post','create','/:id/clone','addItem','/:id','update','delete','destroy','multer','util','path','connect-timeout','express'];(function(_0x234cdb,_0x28750b){var _0x1d18bb=function(_0x42c67e){while(--_0x42c67e){_0x234cdb['push'](_0x234cdb['shift']());}};_0x1d18bb(++_0x28750b);}(_0xe00b,0x95));var _0xbe00=function(_0x2b1ed6,_0x52152a){_0x2b1ed6=_0x2b1ed6-0x0;var _0x35fed4=_0xe00b[_0x2b1ed6];return _0x35fed4;};'use strict';var multer=require(_0xbe00('0x0'));var util=require(_0xbe00('0x1'));var path=require(_0xbe00('0x2'));var timeout=require(_0xbe00('0x3'));var express=require(_0xbe00('0x4'));var router=express[_0xbe00('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xbe00('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xbe00('0x7'));var controller=require('./dashboard.controller');router[_0xbe00('0x8')]('/',auth['isAuthenticated'](),controller[_0xbe00('0x9')]);router[_0xbe00('0x8')]('/:id',auth['isAuthenticated'](),controller[_0xbe00('0xa')]);router['get'](_0xbe00('0xb'),auth[_0xbe00('0xc')](),controller[_0xbe00('0xd')]);router[_0xbe00('0xe')]('/',auth[_0xbe00('0xc')](),controller[_0xbe00('0xf')]);router['post'](_0xbe00('0x10'),auth['isAuthenticated'](),controller['clone']);router[_0xbe00('0xe')](_0xbe00('0xb'),auth['isAuthenticated'](),controller[_0xbe00('0x11')]);router['put'](_0xbe00('0x12'),auth[_0xbe00('0xc')](),controller[_0xbe00('0x13')]);router[_0xbe00('0x14')](_0xbe00('0x12'),auth[_0xbe00('0xc')](),controller[_0xbe00('0x15')]);module['exports']=router; \ No newline at end of file +var _0x63c9=['getItems','post','create','/:id/clone','addItem','put','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./dashboard.controller','isAuthenticated','index','/:id','show','/:id/items'];(function(_0x163040,_0x38a58c){var _0x364667=function(_0x3b104f){while(--_0x3b104f){_0x163040['push'](_0x163040['shift']());}};_0x364667(++_0x38a58c);}(_0x63c9,0x1a1));var _0x963c=function(_0x9dfc10,_0x19c2d5){_0x9dfc10=_0x9dfc10-0x0;var _0x4f938a=_0x63c9[_0x9dfc10];return _0x4f938a;};'use strict';var multer=require(_0x963c('0x0'));var util=require(_0x963c('0x1'));var path=require(_0x963c('0x2'));var timeout=require(_0x963c('0x3'));var express=require('express');var router=express[_0x963c('0x4')]();var fs_extra=require(_0x963c('0x5'));var auth=require(_0x963c('0x6'));var interaction=require(_0x963c('0x7'));var config=require(_0x963c('0x8'));var controller=require(_0x963c('0x9'));router['get']('/',auth[_0x963c('0xa')](),controller[_0x963c('0xb')]);router['get'](_0x963c('0xc'),auth[_0x963c('0xa')](),controller[_0x963c('0xd')]);router['get'](_0x963c('0xe'),auth[_0x963c('0xa')](),controller[_0x963c('0xf')]);router[_0x963c('0x10')]('/',auth[_0x963c('0xa')](),controller[_0x963c('0x11')]);router[_0x963c('0x10')](_0x963c('0x12'),auth[_0x963c('0xa')](),controller['clone']);router[_0x963c('0x10')]('/:id/items',auth[_0x963c('0xa')](),controller[_0x963c('0x13')]);router[_0x963c('0x14')](_0x963c('0xc'),auth[_0x963c('0xa')](),controller['update']);router[_0x963c('0x15')]('/:id',auth[_0x963c('0xa')](),controller[_0x963c('0x16')]);module[_0x963c('0x17')]=router; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.attributes.js b/server/api/dashboardItem/dashboardItem.attributes.js index e6dfc85..e06740b 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 _0xabce=['squel','lodash','exports','STRING','long','parse','getDataValue','attrs','setDataValue','INTEGER','#ffffff','#2196f3','sequelize'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xabce,0x103));var _0xeabc=function(_0x543084,_0x4337f5){_0x543084=_0x543084-0x0;var _0x306a57=_0xabce[_0x543084];return _0x306a57;};'use strict';var Sequelize=require(_0xeabc('0x0'));var squel=require(_0xeabc('0x1'));var _=require(_0xeabc('0x2'));module[_0xeabc('0x3')]={'title':{'type':Sequelize[_0xeabc('0x4')],'allowNull':![]},'type':{'type':Sequelize['STRING'](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize['TEXT'](_0xeabc('0x5')),'get':function(){try{return JSON[_0xeabc('0x6')](this[_0xeabc('0x7')]('attrs'));}catch(_0x54e4a8){return[];}},'set':function(_0x1b07a8){try{this['setDataValue'](_0xeabc('0x8'),JSON['stringify'](_0x1b07a8));}catch(_0x3bdc29){this[_0xeabc('0x9')](_0xeabc('0x8'),JSON['stringify']([]));}}},'sizeX':{'type':Sequelize[_0xeabc('0xa')],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize[_0xeabc('0xa')],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize[_0xeabc('0xa')]},'col':{'type':Sequelize[_0xeabc('0xa')]},'background':{'type':Sequelize[_0xeabc('0x4')],'allowNull':![],'defaultValue':_0xeabc('0xb'),'validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize[_0xeabc('0x4')],'allowNull':![],'defaultValue':_0xeabc('0xc'),'validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0xeabc('0x4')]},'titleFontSize':{'type':Sequelize[_0xeabc('0xa')],'defaultValue':0xc}}; \ No newline at end of file +var _0x1623=['attrs','setDataValue','stringify','INTEGER','#ffffff','#2196f3','sequelize','exports','STRING','TEXT','long'];(function(_0x46111d,_0x5d286b){var _0xe82586=function(_0x39551b){while(--_0x39551b){_0x46111d['push'](_0x46111d['shift']());}};_0xe82586(++_0x5d286b);}(_0x1623,0xab));var _0x3162=function(_0x2d9a77,_0x333e60){_0x2d9a77=_0x2d9a77-0x0;var _0x36e470=_0x1623[_0x2d9a77];return _0x36e470;};'use strict';var Sequelize=require(_0x3162('0x0'));var squel=require('squel');var _=require('lodash');module[_0x3162('0x1')]={'title':{'type':Sequelize[_0x3162('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x3162('0x2')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize[_0x3162('0x3')](_0x3162('0x4')),'get':function(){try{return JSON['parse'](this['getDataValue'](_0x3162('0x5')));}catch(_0x4b77c4){return[];}},'set':function(_0x1b55f2){try{this[_0x3162('0x6')]('attrs',JSON[_0x3162('0x7')](_0x1b55f2));}catch(_0x2dc07e){this[_0x3162('0x6')](_0x3162('0x5'),JSON[_0x3162('0x7')]([]));}}},'sizeX':{'type':Sequelize[_0x3162('0x8')],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize[_0x3162('0x8')],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize[_0x3162('0x8')]},'col':{'type':Sequelize['INTEGER']},'background':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x3162('0x9'),'validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize[_0x3162('0x2')],'allowNull':![],'defaultValue':_0x3162('0xa'),'validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0x3162('0x2')]},'titleFontSize':{'type':Sequelize[_0x3162('0x8')],'defaultValue':0xc}}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.controller.js b/server/api/dashboardItem/dashboardItem.controller.js index 09e14ee..10d849e 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 _0x4d65=['multibar-chart','attrSerie1','total','attrSerie2','attrSerie3','web-report','attrReport','reportType','attrRefresh','widgetAttributes:\x20%s','stringify','create','body','update','eml-format','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./dashboardItem.socket','register','sendStatus','end','status','json','offset','undefined','Content-Range','apply','save','then','error','stack','name','send','show','keys','DashboardItem','rawAttributes','query','filters','intersection','model','attributes','fields','length','includeAll','include','merge','find','catch','destroy','params','type','attrUrl','attrs','custom','attrPath','attrHourFormat','value','HH:mm:ss','attrTimezone','0.00','attrFontSize','counter','attrMetric','attrVoiceQueues'];(function(_0x465e1c,_0xdff365){var _0xb35dda=function(_0x496535){while(--_0x496535){_0x465e1c['push'](_0x465e1c['shift']());}};_0xb35dda(++_0xdff365);}(_0x4d65,0xc0));var _0x54d6=function(_0x411add,_0x1aed38){_0x411add=_0x411add-0x0;var _0x238242=_0x4d65[_0x411add];return _0x238242;};'use strict';var emlformat=require(_0x54d6('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x54d6('0x1'));var moment=require('moment');var BPromise=require(_0x54d6('0x2'));var Mustache=require(_0x54d6('0x3'));var util=require(_0x54d6('0x4'));var path=require(_0x54d6('0x5'));var sox=require(_0x54d6('0x6'));var csv=require(_0x54d6('0x7'));var ejs=require(_0x54d6('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x54d6('0x9'));var squel=require(_0x54d6('0xa'));var crypto=require(_0x54d6('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x54d6('0xc'));var toCsv=require(_0x54d6('0x7'));var querystring=require(_0x54d6('0xd'));var Papa=require(_0x54d6('0xe'));var Redis=require(_0x54d6('0xf'));var authService=require(_0x54d6('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x54d6('0x11'));var hardwareService=require(_0x54d6('0x12'));var logger=require(_0x54d6('0x13'))(_0x54d6('0x14'));var utils=require(_0x54d6('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x54d6('0x16'))['db'];config[_0x54d6('0x17')]=_[_0x54d6('0x18')](config[_0x54d6('0x17')],{'host':_0x54d6('0x19'),'port':0x18eb});var socket=require(_0x54d6('0x1a'))(new Redis(config[_0x54d6('0x17')]));require(_0x54d6('0x1b'))[_0x54d6('0x1c')](socket);function respondWithStatusCode(_0x24eab6,_0x573571){_0x573571=_0x573571||0xcc;return function(_0x2edce8){if(_0x2edce8){return _0x24eab6[_0x54d6('0x1d')](_0x573571);}return _0x24eab6['status'](_0x573571)[_0x54d6('0x1e')]();};}function respondWithResult(_0x441e74,_0x3f8d0c){_0x3f8d0c=_0x3f8d0c||0xc8;return function(_0x344d6d){if(_0x344d6d){return _0x441e74[_0x54d6('0x1f')](_0x3f8d0c)[_0x54d6('0x20')](_0x344d6d);}};}function respondWithFilteredResult(_0x1e6f59,_0x551464){return function(_0x5cc7df){if(_0x5cc7df){var _0x3c395d=typeof _0x551464[_0x54d6('0x21')]==='undefined'&&typeof _0x551464['limit']===_0x54d6('0x22');var _0x4d7e55=_0x5cc7df['count'];var _0x28375a=_0x3c395d?0x0:_0x551464[_0x54d6('0x21')];var _0x850b29=_0x3c395d?_0x5cc7df['count']:_0x551464['offset']+_0x551464['limit'];var _0x273a2f;if(_0x850b29>=_0x4d7e55){_0x850b29=_0x4d7e55;_0x273a2f=0xc8;}else{_0x273a2f=0xce;}_0x1e6f59[_0x54d6('0x1f')](_0x273a2f);return _0x1e6f59['set'](_0x54d6('0x23'),_0x28375a+'-'+_0x850b29+'/'+_0x4d7e55)[_0x54d6('0x20')](_0x5cc7df);}return null;};}function patchUpdates(_0x247ab8){return function(_0x1edfd2){try{jsonpatch[_0x54d6('0x24')](_0x1edfd2,_0x247ab8,!![]);}catch(_0x469992){return BPromise['reject'](_0x469992);}return _0x1edfd2[_0x54d6('0x25')]();};}function saveUpdates(_0x54fbfe,_0xb701e0){return function(_0x2a6af7){if(_0x2a6af7){return _0x2a6af7['update'](_0x54fbfe)['then'](function(_0x377a32){return _0x377a32;});}return null;};}function removeEntity(_0x4d4c59,_0x4ecfde){return function(_0x3dbbcf){if(_0x3dbbcf){return _0x3dbbcf['destroy']()[_0x54d6('0x26')](function(){_0x4d4c59[_0x54d6('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2f87cd,_0x362417){return function(_0x27d76b){if(!_0x27d76b){_0x2f87cd[_0x54d6('0x1d')](0x194);}return _0x27d76b;};}function handleError(_0x40f32a,_0x2d1c1e){_0x2d1c1e=_0x2d1c1e||0x1f4;return function(_0x4e5df0){logger[_0x54d6('0x27')](_0x4e5df0[_0x54d6('0x28')]);if(_0x4e5df0[_0x54d6('0x29')]){delete _0x4e5df0[_0x54d6('0x29')];}_0x40f32a[_0x54d6('0x1f')](_0x2d1c1e)[_0x54d6('0x2a')](_0x4e5df0);};}exports[_0x54d6('0x2b')]=function(_0xeeafde,_0x4224c1){var _0x21522d={'raw':![],'where':{'id':_0xeeafde['params']['id']}},_0x5e40d1={};_0x5e40d1['model']=_[_0x54d6('0x2c')](db[_0x54d6('0x2d')][_0x54d6('0x2e')]);_0x5e40d1[_0x54d6('0x2f')]=_[_0x54d6('0x2c')](_0xeeafde[_0x54d6('0x2f')]);_0x5e40d1[_0x54d6('0x30')]=_[_0x54d6('0x31')](_0x5e40d1[_0x54d6('0x32')],_0x5e40d1[_0x54d6('0x2f')]);_0x21522d[_0x54d6('0x33')]=_[_0x54d6('0x31')](_0x5e40d1[_0x54d6('0x32')],qs[_0x54d6('0x34')](_0xeeafde[_0x54d6('0x2f')][_0x54d6('0x34')]));_0x21522d[_0x54d6('0x33')]=_0x21522d[_0x54d6('0x33')][_0x54d6('0x35')]?_0x21522d[_0x54d6('0x33')]:_0x5e40d1[_0x54d6('0x32')];if(_0xeeafde['query'][_0x54d6('0x36')]){_0x21522d[_0x54d6('0x37')]=[{'all':!![]}];}_0x21522d=_[_0x54d6('0x38')]({},_0x21522d,_0xeeafde['options']);return db[_0x54d6('0x2d')][_0x54d6('0x39')](_0x21522d)[_0x54d6('0x26')](handleEntityNotFound(_0x4224c1,null))[_0x54d6('0x26')](respondWithResult(_0x4224c1,null))[_0x54d6('0x3a')](handleError(_0x4224c1,null));};exports[_0x54d6('0x3b')]=function(_0x3c2d9a,_0x508168){return db[_0x54d6('0x2d')][_0x54d6('0x39')]({'where':{'id':_0x3c2d9a[_0x54d6('0x3c')]['id']}})[_0x54d6('0x26')](handleEntityNotFound(_0x508168,null))[_0x54d6('0x26')](removeEntity(_0x508168,null))[_0x54d6('0x3a')](handleError(_0x508168,null));};function widgetAttributes(_0x5716a3){try{switch(_0x5716a3[_0x54d6('0x3d')]){case'iframe':return[{'name':_0x54d6('0x3e'),'value':_0x5716a3[_0x54d6('0x3e')]||(_0x5716a3['attrs']&&_0x5716a3[_0x54d6('0x3f')][0x0]?_0x5716a3[_0x54d6('0x3f')][0x0]['value']:undefined)||'https://'}];case _0x54d6('0x40'):return[{'name':_0x54d6('0x41'),'value':_0x5716a3['attrPath']||(_0x5716a3[_0x54d6('0x3f')]&&_0x5716a3[_0x54d6('0x3f')][0x0]?_0x5716a3[_0x54d6('0x3f')][0x0]['value']:undefined)||''}];case'clock':return[{'name':_0x54d6('0x42'),'value':_0x5716a3[_0x54d6('0x42')]||(_0x5716a3['attrs']&&_0x5716a3['attrs'][0x0]?_0x5716a3[_0x54d6('0x3f')][0x0][_0x54d6('0x43')]:undefined)||_0x54d6('0x44')},{'name':_0x54d6('0x45'),'value':_0x5716a3['attrTimezone']||(_0x5716a3[_0x54d6('0x3f')]&&_0x5716a3['attrs'][0x1]?_0x5716a3[_0x54d6('0x3f')][0x1][_0x54d6('0x43')]:undefined)||_0x54d6('0x46')},{'name':_0x54d6('0x47'),'value':_0x5716a3[_0x54d6('0x47')]||(_0x5716a3[_0x54d6('0x3f')]&&_0x5716a3[_0x54d6('0x3f')][0x2]?_0x5716a3[_0x54d6('0x3f')][0x2][_0x54d6('0x43')]:undefined)||0xc}];case _0x54d6('0x48'):return[{'name':'attrMetric','value':_0x5716a3[_0x54d6('0x49')]||(_0x5716a3[_0x54d6('0x3f')]&&_0x5716a3[_0x54d6('0x3f')][0x0]?_0x5716a3[_0x54d6('0x3f')][0x0][_0x54d6('0x43')]:undefined)||'total'},{'name':_0x54d6('0x4a'),'value':_0x5716a3['attrVoiceQueues']||(_0x5716a3['attrs']&&_0x5716a3['attrs'][0x1]?_0x5716a3[_0x54d6('0x3f')][0x1][_0x54d6('0x43')]:undefined)||[]},{'name':_0x54d6('0x47'),'value':_0x5716a3[_0x54d6('0x47')]||(_0x5716a3['attrs']&&_0x5716a3['attrs'][0x2]?_0x5716a3[_0x54d6('0x3f')][0x2][_0x54d6('0x43')]:undefined)||0x14}];case _0x54d6('0x4b'):case'pie-chart':return[{'name':_0x54d6('0x4c'),'value':_0x5716a3[_0x54d6('0x4c')]||(_0x5716a3[_0x54d6('0x3f')]&&_0x5716a3[_0x54d6('0x3f')][0x0]?_0x5716a3[_0x54d6('0x3f')][0x0][_0x54d6('0x43')]:undefined)||_0x54d6('0x4d')},{'name':_0x54d6('0x4e'),'value':_0x5716a3[_0x54d6('0x4e')]||(_0x5716a3[_0x54d6('0x3f')]&&_0x5716a3[_0x54d6('0x3f')][0x1]?_0x5716a3[_0x54d6('0x3f')][0x1][_0x54d6('0x43')]:undefined)||null},{'name':_0x54d6('0x4f'),'value':_0x5716a3['attrSerie3']||(_0x5716a3[_0x54d6('0x3f')]&&_0x5716a3[_0x54d6('0x3f')][0x2]?_0x5716a3[_0x54d6('0x3f')][0x2]['value']:undefined)||null},{'name':_0x54d6('0x4a'),'value':_0x5716a3[_0x54d6('0x4a')]||(_0x5716a3[_0x54d6('0x3f')]&&_0x5716a3[_0x54d6('0x3f')][0x3]?_0x5716a3['attrs'][0x3][_0x54d6('0x43')]:undefined)||[]}];case _0x54d6('0x50'):return[{'name':_0x54d6('0x51'),'type':_0x5716a3[_0x54d6('0x52')]||(_0x5716a3['attrs']&&_0x5716a3[_0x54d6('0x3f')][0x0]?_0x5716a3[_0x54d6('0x3f')][0x0][_0x54d6('0x3d')]:undefined)||null,'value':_0x5716a3[_0x54d6('0x51')]||(_0x5716a3[_0x54d6('0x3f')]&&_0x5716a3[_0x54d6('0x3f')][0x0]?_0x5716a3['attrs'][0x0][_0x54d6('0x43')]:undefined)||null},{'name':_0x54d6('0x53'),'value':_0x5716a3['attrRefresh']||(_0x5716a3[_0x54d6('0x3f')]&&_0x5716a3[_0x54d6('0x3f')][0x1]?_0x5716a3[_0x54d6('0x3f')][0x1]['value']:undefined)||0x0}];default:return[];}}catch(_0x2745ce){logger[_0x54d6('0x27')](_0x54d6('0x54'),JSON[_0x54d6('0x55')](_0x2745ce));return[];}}exports[_0x54d6('0x56')]=function(_0x5a35b9,_0x34405){if(_0x5a35b9['body']){_0x5a35b9['body'][_0x54d6('0x3f')]=widgetAttributes(_0x5a35b9['body']);}return db[_0x54d6('0x2d')]['create'](_0x5a35b9[_0x54d6('0x57')],{})['then'](respondWithResult(_0x34405,0xc9))[_0x54d6('0x3a')](handleError(_0x34405,null));};exports[_0x54d6('0x58')]=function(_0x527a1e,_0x408145){if(_0x527a1e[_0x54d6('0x57')]['id']){delete _0x527a1e['body']['id'];}_0x527a1e[_0x54d6('0x57')][_0x54d6('0x3f')]=widgetAttributes(_0x527a1e[_0x54d6('0x57')]);return db['DashboardItem'][_0x54d6('0x39')]({'where':{'id':_0x527a1e[_0x54d6('0x3c')]['id']}})[_0x54d6('0x26')](handleEntityNotFound(_0x408145,null))[_0x54d6('0x26')](saveUpdates(_0x527a1e[_0x54d6('0x57')],null))[_0x54d6('0x26')](respondWithResult(_0x408145,null))['catch'](handleError(_0x408145,null));}; \ No newline at end of file +var _0x8a00=['query','attributes','intersection','model','fields','length','includeAll','merge','options','find','catch','type','attrUrl','attrs','value','https://','custom','attrPath','clock','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','counter','attrMetric','attrVoiceQueues','multibar-chart','pie-chart','attrSerie1','total','attrSerie2','attrSerie3','web-report','attrRefresh','widgetAttributes:\x20%s','stringify','body','create','update','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','./dashboardItem.socket','register','sendStatus','end','status','offset','limit','undefined','count','json','apply','reject','then','destroy','error','name','params','keys','DashboardItem','rawAttributes'];(function(_0x3a8954,_0x354033){var _0x1ed819=function(_0x2b75c3){while(--_0x2b75c3){_0x3a8954['push'](_0x3a8954['shift']());}};_0x1ed819(++_0x354033);}(_0x8a00,0x1ef));var _0x08a0=function(_0x3510f1,_0x5c5f61){_0x3510f1=_0x3510f1-0x0;var _0x7f9da=_0x8a00[_0x3510f1];return _0x7f9da;};'use strict';var emlformat=require(_0x08a0('0x0'));var rimraf=require(_0x08a0('0x1'));var zipdir=require(_0x08a0('0x2'));var jsonpatch=require(_0x08a0('0x3'));var rp=require(_0x08a0('0x4'));var moment=require(_0x08a0('0x5'));var BPromise=require(_0x08a0('0x6'));var Mustache=require(_0x08a0('0x7'));var util=require(_0x08a0('0x8'));var path=require(_0x08a0('0x9'));var sox=require(_0x08a0('0xa'));var csv=require(_0x08a0('0xb'));var ejs=require(_0x08a0('0xc'));var fs=require('fs');var fs_extra=require(_0x08a0('0xd'));var _=require('lodash');var squel=require(_0x08a0('0xe'));var crypto=require(_0x08a0('0xf'));var jsforce=require(_0x08a0('0x10'));var deskjs=require(_0x08a0('0x11'));var toCsv=require(_0x08a0('0xb'));var querystring=require(_0x08a0('0x12'));var Papa=require(_0x08a0('0x13'));var Redis=require(_0x08a0('0x14'));var authService=require(_0x08a0('0x15'));var qs=require(_0x08a0('0x16'));var as=require(_0x08a0('0x17'));var hardwareService=require(_0x08a0('0x18'));var logger=require(_0x08a0('0x19'))('api');var utils=require(_0x08a0('0x1a'));var config=require('../../config/environment');var licenseUtil=require(_0x08a0('0x1b'));var db=require(_0x08a0('0x1c'))['db'];config[_0x08a0('0x1d')]=_[_0x08a0('0x1e')](config[_0x08a0('0x1d')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x08a0('0x1d')]));require(_0x08a0('0x1f'))[_0x08a0('0x20')](socket);function respondWithStatusCode(_0x182a5c,_0x11cd4b){_0x11cd4b=_0x11cd4b||0xcc;return function(_0x4a010e){if(_0x4a010e){return _0x182a5c[_0x08a0('0x21')](_0x11cd4b);}return _0x182a5c['status'](_0x11cd4b)[_0x08a0('0x22')]();};}function respondWithResult(_0x112b05,_0x522c5a){_0x522c5a=_0x522c5a||0xc8;return function(_0x21b628){if(_0x21b628){return _0x112b05[_0x08a0('0x23')](_0x522c5a)['json'](_0x21b628);}};}function respondWithFilteredResult(_0x8a8999,_0x5760eb){return function(_0x352fb9){if(_0x352fb9){var _0x3685c8=typeof _0x5760eb[_0x08a0('0x24')]==='undefined'&&typeof _0x5760eb[_0x08a0('0x25')]===_0x08a0('0x26');var _0x413b95=_0x352fb9[_0x08a0('0x27')];var _0x12ab6d=_0x3685c8?0x0:_0x5760eb[_0x08a0('0x24')];var _0x241ffb=_0x3685c8?_0x352fb9['count']:_0x5760eb[_0x08a0('0x24')]+_0x5760eb[_0x08a0('0x25')];var _0x512ee2;if(_0x241ffb>=_0x413b95){_0x241ffb=_0x413b95;_0x512ee2=0xc8;}else{_0x512ee2=0xce;}_0x8a8999[_0x08a0('0x23')](_0x512ee2);return _0x8a8999['set']('Content-Range',_0x12ab6d+'-'+_0x241ffb+'/'+_0x413b95)[_0x08a0('0x28')](_0x352fb9);}return null;};}function patchUpdates(_0xfe5f5d){return function(_0x561629){try{jsonpatch[_0x08a0('0x29')](_0x561629,_0xfe5f5d,!![]);}catch(_0x8f9c79){return BPromise[_0x08a0('0x2a')](_0x8f9c79);}return _0x561629['save']();};}function saveUpdates(_0x38579c,_0x42ff8b){return function(_0x38172e){if(_0x38172e){return _0x38172e['update'](_0x38579c)[_0x08a0('0x2b')](function(_0x6e0d1c){return _0x6e0d1c;});}return null;};}function removeEntity(_0x1c2952,_0x3ce063){return function(_0xf18810){if(_0xf18810){return _0xf18810[_0x08a0('0x2c')]()[_0x08a0('0x2b')](function(){_0x1c2952['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3e0fc2,_0x1cbc9c){return function(_0xb17174){if(!_0xb17174){_0x3e0fc2[_0x08a0('0x21')](0x194);}return _0xb17174;};}function handleError(_0x134a4d,_0x17d1a4){_0x17d1a4=_0x17d1a4||0x1f4;return function(_0x525061){logger[_0x08a0('0x2d')](_0x525061['stack']);if(_0x525061['name']){delete _0x525061[_0x08a0('0x2e')];}_0x134a4d[_0x08a0('0x23')](_0x17d1a4)['send'](_0x525061);};}exports['show']=function(_0x8c7314,_0x91360c){var _0x12e475={'raw':![],'where':{'id':_0x8c7314[_0x08a0('0x2f')]['id']}},_0x6812b4={};_0x6812b4['model']=_[_0x08a0('0x30')](db[_0x08a0('0x31')][_0x08a0('0x32')]);_0x6812b4[_0x08a0('0x33')]=_[_0x08a0('0x30')](_0x8c7314[_0x08a0('0x33')]);_0x6812b4['filters']=_['intersection'](_0x6812b4['model'],_0x6812b4[_0x08a0('0x33')]);_0x12e475[_0x08a0('0x34')]=_[_0x08a0('0x35')](_0x6812b4[_0x08a0('0x36')],qs['fields'](_0x8c7314[_0x08a0('0x33')][_0x08a0('0x37')]));_0x12e475[_0x08a0('0x34')]=_0x12e475[_0x08a0('0x34')][_0x08a0('0x38')]?_0x12e475[_0x08a0('0x34')]:_0x6812b4[_0x08a0('0x36')];if(_0x8c7314[_0x08a0('0x33')][_0x08a0('0x39')]){_0x12e475['include']=[{'all':!![]}];}_0x12e475=_[_0x08a0('0x3a')]({},_0x12e475,_0x8c7314[_0x08a0('0x3b')]);return db[_0x08a0('0x31')][_0x08a0('0x3c')](_0x12e475)[_0x08a0('0x2b')](handleEntityNotFound(_0x91360c,null))[_0x08a0('0x2b')](respondWithResult(_0x91360c,null))[_0x08a0('0x3d')](handleError(_0x91360c,null));};exports[_0x08a0('0x2c')]=function(_0x12f9ad,_0x400bfa){return db[_0x08a0('0x31')][_0x08a0('0x3c')]({'where':{'id':_0x12f9ad[_0x08a0('0x2f')]['id']}})[_0x08a0('0x2b')](handleEntityNotFound(_0x400bfa,null))[_0x08a0('0x2b')](removeEntity(_0x400bfa,null))['catch'](handleError(_0x400bfa,null));};function widgetAttributes(_0x1bb571){try{switch(_0x1bb571[_0x08a0('0x3e')]){case'iframe':return[{'name':_0x08a0('0x3f'),'value':_0x1bb571[_0x08a0('0x3f')]||(_0x1bb571[_0x08a0('0x40')]&&_0x1bb571[_0x08a0('0x40')][0x0]?_0x1bb571[_0x08a0('0x40')][0x0][_0x08a0('0x41')]:undefined)||_0x08a0('0x42')}];case _0x08a0('0x43'):return[{'name':_0x08a0('0x44'),'value':_0x1bb571[_0x08a0('0x44')]||(_0x1bb571[_0x08a0('0x40')]&&_0x1bb571[_0x08a0('0x40')][0x0]?_0x1bb571[_0x08a0('0x40')][0x0][_0x08a0('0x41')]:undefined)||''}];case _0x08a0('0x45'):return[{'name':_0x08a0('0x46'),'value':_0x1bb571[_0x08a0('0x46')]||(_0x1bb571[_0x08a0('0x40')]&&_0x1bb571['attrs'][0x0]?_0x1bb571[_0x08a0('0x40')][0x0][_0x08a0('0x41')]:undefined)||_0x08a0('0x47')},{'name':_0x08a0('0x48'),'value':_0x1bb571['attrTimezone']||(_0x1bb571[_0x08a0('0x40')]&&_0x1bb571[_0x08a0('0x40')][0x1]?_0x1bb571['attrs'][0x1][_0x08a0('0x41')]:undefined)||_0x08a0('0x49')},{'name':_0x08a0('0x4a'),'value':_0x1bb571[_0x08a0('0x4a')]||(_0x1bb571[_0x08a0('0x40')]&&_0x1bb571[_0x08a0('0x40')][0x2]?_0x1bb571[_0x08a0('0x40')][0x2][_0x08a0('0x41')]:undefined)||0xc}];case _0x08a0('0x4b'):return[{'name':_0x08a0('0x4c'),'value':_0x1bb571[_0x08a0('0x4c')]||(_0x1bb571[_0x08a0('0x40')]&&_0x1bb571[_0x08a0('0x40')][0x0]?_0x1bb571[_0x08a0('0x40')][0x0]['value']:undefined)||'total'},{'name':'attrVoiceQueues','value':_0x1bb571[_0x08a0('0x4d')]||(_0x1bb571[_0x08a0('0x40')]&&_0x1bb571[_0x08a0('0x40')][0x1]?_0x1bb571[_0x08a0('0x40')][0x1][_0x08a0('0x41')]:undefined)||[]},{'name':_0x08a0('0x4a'),'value':_0x1bb571[_0x08a0('0x4a')]||(_0x1bb571[_0x08a0('0x40')]&&_0x1bb571['attrs'][0x2]?_0x1bb571[_0x08a0('0x40')][0x2][_0x08a0('0x41')]:undefined)||0x14}];case _0x08a0('0x4e'):case _0x08a0('0x4f'):return[{'name':'attrSerie1','value':_0x1bb571[_0x08a0('0x50')]||(_0x1bb571['attrs']&&_0x1bb571[_0x08a0('0x40')][0x0]?_0x1bb571['attrs'][0x0][_0x08a0('0x41')]:undefined)||_0x08a0('0x51')},{'name':'attrSerie2','value':_0x1bb571[_0x08a0('0x52')]||(_0x1bb571['attrs']&&_0x1bb571[_0x08a0('0x40')][0x1]?_0x1bb571[_0x08a0('0x40')][0x1][_0x08a0('0x41')]:undefined)||null},{'name':_0x08a0('0x53'),'value':_0x1bb571['attrSerie3']||(_0x1bb571['attrs']&&_0x1bb571[_0x08a0('0x40')][0x2]?_0x1bb571[_0x08a0('0x40')][0x2][_0x08a0('0x41')]:undefined)||null},{'name':_0x08a0('0x4d'),'value':_0x1bb571['attrVoiceQueues']||(_0x1bb571[_0x08a0('0x40')]&&_0x1bb571[_0x08a0('0x40')][0x3]?_0x1bb571[_0x08a0('0x40')][0x3][_0x08a0('0x41')]:undefined)||[]}];case _0x08a0('0x54'):return[{'name':'attrReport','type':_0x1bb571['reportType']||(_0x1bb571[_0x08a0('0x40')]&&_0x1bb571[_0x08a0('0x40')][0x0]?_0x1bb571[_0x08a0('0x40')][0x0]['type']:undefined)||null,'value':_0x1bb571['attrReport']||(_0x1bb571[_0x08a0('0x40')]&&_0x1bb571[_0x08a0('0x40')][0x0]?_0x1bb571[_0x08a0('0x40')][0x0][_0x08a0('0x41')]:undefined)||null},{'name':'attrRefresh','value':_0x1bb571[_0x08a0('0x55')]||(_0x1bb571[_0x08a0('0x40')]&&_0x1bb571[_0x08a0('0x40')][0x1]?_0x1bb571['attrs'][0x1][_0x08a0('0x41')]:undefined)||0x0}];default:return[];}}catch(_0xe42c79){logger[_0x08a0('0x2d')](_0x08a0('0x56'),JSON[_0x08a0('0x57')](_0xe42c79));return[];}}exports['create']=function(_0x15d18b,_0x3c5f53){if(_0x15d18b[_0x08a0('0x58')]){_0x15d18b[_0x08a0('0x58')][_0x08a0('0x40')]=widgetAttributes(_0x15d18b['body']);}return db[_0x08a0('0x31')][_0x08a0('0x59')](_0x15d18b[_0x08a0('0x58')],{})[_0x08a0('0x2b')](respondWithResult(_0x3c5f53,0xc9))[_0x08a0('0x3d')](handleError(_0x3c5f53,null));};exports[_0x08a0('0x5a')]=function(_0x22a421,_0xa11e02){if(_0x22a421[_0x08a0('0x58')]['id']){delete _0x22a421['body']['id'];}_0x22a421['body'][_0x08a0('0x40')]=widgetAttributes(_0x22a421[_0x08a0('0x58')]);return db['DashboardItem'][_0x08a0('0x3c')]({'where':{'id':_0x22a421[_0x08a0('0x2f')]['id']}})[_0x08a0('0x2b')](handleEntityNotFound(_0xa11e02,null))[_0x08a0('0x2b')](saveUpdates(_0x22a421['body'],null))[_0x08a0('0x2b')](respondWithResult(_0xa11e02,null))[_0x08a0('0x3d')](handleError(_0xa11e02,null));}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.events.js b/server/api/dashboardItem/dashboardItem.events.js index 42c763a..b61a446 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 _0x0278=['update','emit','hasOwnProperty','exports','DashboardItem','setMaxListeners','save'];(function(_0x4c6d6f,_0x291557){var _0x2d4478=function(_0x106946){while(--_0x106946){_0x4c6d6f['push'](_0x4c6d6f['shift']());}};_0x2d4478(++_0x291557);}(_0x0278,0x18c));var _0x8027=function(_0x2b10c6,_0x185590){_0x2b10c6=_0x2b10c6-0x0;var _0x3789d2=_0x0278[_0x2b10c6];return _0x3789d2;};'use strict';var EventEmitter=require('events');var DashboardItem=require('../../mysqldb')['db'][_0x8027('0x0')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0x8027('0x1')](0x0);var events={'afterCreate':_0x8027('0x2'),'afterUpdate':_0x8027('0x3'),'afterDestroy':'remove'};function emitEvent(_0x28b572){return function(_0x569cae,_0x11f4e4,_0x5620e4){DashboardItemEvents[_0x8027('0x4')](_0x28b572+':'+_0x569cae['id'],_0x569cae);DashboardItemEvents[_0x8027('0x4')](_0x28b572,_0x569cae);_0x5620e4(null);};}for(var e in events){if(events[_0x8027('0x5')](e)){var event=events[e];DashboardItem['hook'](e,emitEvent(event));}}module[_0x8027('0x6')]=DashboardItemEvents; \ No newline at end of file +var _0xc22d=['../../mysqldb','DashboardItem','setMaxListeners','update','emit','exports','events'];(function(_0x17b42c,_0x2ff54a){var _0x274144=function(_0x10b017){while(--_0x10b017){_0x17b42c['push'](_0x17b42c['shift']());}};_0x274144(++_0x2ff54a);}(_0xc22d,0x172));var _0xdc22=function(_0x57c7f9,_0x2904af){_0x57c7f9=_0x57c7f9-0x0;var _0x39f72c=_0xc22d[_0x57c7f9];return _0x39f72c;};'use strict';var EventEmitter=require(_0xdc22('0x0'));var DashboardItem=require(_0xdc22('0x1'))['db'][_0xdc22('0x2')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0xdc22('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xdc22('0x4'),'afterDestroy':'remove'};function emitEvent(_0x526335){return function(_0x1a91f5,_0x44431e,_0x1d1f89){DashboardItemEvents[_0xdc22('0x5')](_0x526335+':'+_0x1a91f5['id'],_0x1a91f5);DashboardItemEvents['emit'](_0x526335,_0x1a91f5);_0x1d1f89(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];DashboardItem['hook'](e,emitEvent(event));}}module[_0xdc22('0x6')]=DashboardItemEvents; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.model.js b/server/api/dashboardItem/dashboardItem.model.js index 0ab0088..df41f1a 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 _0xb82a=['../../config/logger','api','request-promise','path','rimraf','../../config/environment','exports','define','DashboardItem','dashboard_items','lodash','util'];(function(_0x5466e0,_0x586206){var _0xf32c89=function(_0x68e0e9){while(--_0x68e0e9){_0x5466e0['push'](_0x5466e0['shift']());}};_0xf32c89(++_0x586206);}(_0xb82a,0x82));var _0xab82=function(_0x3611be,_0x375473){_0x3611be=_0x3611be-0x0;var _0x54087e=_0xb82a[_0x3611be];return _0x54087e;};'use strict';var _=require(_0xab82('0x0'));var util=require(_0xab82('0x1'));var logger=require(_0xab82('0x2'))(_0xab82('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xab82('0x4'));var fs=require('fs');var path=require(_0xab82('0x5'));var rimraf=require(_0xab82('0x6'));var config=require(_0xab82('0x7'));var attributes=require('./dashboardItem.attributes');module[_0xab82('0x8')]=function(_0x192052,_0x7d9653){return _0x192052[_0xab82('0x9')](_0xab82('0xa'),attributes,{'tableName':_0xab82('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4683=['lodash','../../config/logger','moment','path','rimraf','../../config/environment','./dashboardItem.attributes','exports','DashboardItem','dashboard_items'];(function(_0xf09fc7,_0x53f393){var _0x19b988=function(_0x472529){while(--_0x472529){_0xf09fc7['push'](_0xf09fc7['shift']());}};_0x19b988(++_0x53f393);}(_0x4683,0x12c));var _0x3468=function(_0x42382f,_0x185258){_0x42382f=_0x42382f-0x0;var _0x41ae53=_0x4683[_0x42382f];return _0x41ae53;};'use strict';var _=require(_0x3468('0x0'));var util=require('util');var logger=require(_0x3468('0x1'))('api');var moment=require(_0x3468('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x3468('0x3'));var rimraf=require(_0x3468('0x4'));var config=require(_0x3468('0x5'));var attributes=require(_0x3468('0x6'));module[_0x3468('0x7')]=function(_0x4310fe,_0x435eff){return _0x4310fe['define'](_0x3468('0x8'),attributes,{'tableName':_0x3468('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.rpc.js b/server/api/dashboardItem/dashboardItem.rpc.js index 8239f7c..9f6d4a1 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 _0x4412=['message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','request','then','info','DashboardItem,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code'];(function(_0x24f31b,_0x44b8f3){var _0x488401=function(_0x204caf){while(--_0x204caf){_0x24f31b['push'](_0x24f31b['shift']());}};_0x488401(++_0x44b8f3);}(_0x4412,0x111));var _0x2441=function(_0x54aca1,_0x3798ea){_0x54aca1=_0x54aca1-0x0;var _0x2eccc7=_0x4412[_0x54aca1];return _0x2eccc7;};'use strict';var _=require(_0x2441('0x0'));var util=require(_0x2441('0x1'));var moment=require(_0x2441('0x2'));var BPromise=require(_0x2441('0x3'));var rs=require(_0x2441('0x4'));var fs=require('fs');var Redis=require(_0x2441('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x2441('0x6'));var logger=require(_0x2441('0x7'))('rpc');var config=require(_0x2441('0x8'));var jayson=require(_0x2441('0x9'));var client=jayson[_0x2441('0xa')][_0x2441('0xb')]({'port':0x232a});config[_0x2441('0xc')]=_[_0x2441('0xd')](config[_0x2441('0xc')],{'host':_0x2441('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./dashboardItem.socket')['register'](socket);function respondWithRpcPromise(_0x237116,_0x1f239f,_0x5cfc39){return new BPromise(function(_0x37315f,_0x3fc139){return client[_0x2441('0xf')](_0x237116,_0x5cfc39)[_0x2441('0x10')](function(_0x2443c4){logger[_0x2441('0x11')](_0x2441('0x12'),_0x1f239f,_0x2441('0x13'));logger[_0x2441('0x14')]('DashboardItem,\x20%s,\x20%s,\x20%s',_0x1f239f,_0x2441('0x13'),JSON[_0x2441('0x15')](_0x2443c4));if(_0x2443c4[_0x2441('0x16')]){if(_0x2443c4[_0x2441('0x16')][_0x2441('0x17')]===0x1f4){logger[_0x2441('0x16')](_0x2441('0x12'),_0x1f239f,_0x2443c4[_0x2441('0x16')][_0x2441('0x18')]);return _0x3fc139(_0x2443c4['error'][_0x2441('0x18')]);}logger[_0x2441('0x16')](_0x2441('0x12'),_0x1f239f,_0x2443c4[_0x2441('0x16')][_0x2441('0x18')]);return _0x37315f(_0x2443c4[_0x2441('0x16')][_0x2441('0x18')]);}else{logger[_0x2441('0x11')](_0x2441('0x12'),_0x1f239f,_0x2441('0x13'));_0x37315f(_0x2443c4[_0x2441('0x19')][_0x2441('0x18')]);}})[_0x2441('0x1a')](function(_0x5b1cda){logger[_0x2441('0x16')]('DashboardItem,\x20%s,\x20%s',_0x1f239f,_0x5b1cda);_0x3fc139(_0x5b1cda);});});} \ No newline at end of file +var _0xa5f9=['info','DashboardItem,\x20%s,\x20%s','request\x20sent','debug','DashboardItem,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','util','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','localhost','socket.io-emitter','redis','request','then'];(function(_0x561102,_0xb249e){var _0x5d56e0=function(_0x179fae){while(--_0x179fae){_0x561102['push'](_0x561102['shift']());}};_0x5d56e0(++_0xb249e);}(_0xa5f9,0x14f));var _0x9a5f=function(_0x47a899,_0x436724){_0x47a899=_0x47a899-0x0;var _0x13aeeb=_0xa5f9[_0x47a899];return _0x13aeeb;};'use strict';var _=require('lodash');var util=require(_0x9a5f('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x9a5f('0x1'));var fs=require('fs');var Redis=require(_0x9a5f('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x9a5f('0x3'))(_0x9a5f('0x4'));var config=require(_0x9a5f('0x5'));var jayson=require(_0x9a5f('0x6'));var client=jayson[_0x9a5f('0x7')][_0x9a5f('0x8')]({'port':0x232a});config['redis']=_[_0x9a5f('0x9')](config['redis'],{'host':_0x9a5f('0xa'),'port':0x18eb});var socket=require(_0x9a5f('0xb'))(new Redis(config[_0x9a5f('0xc')]));require('./dashboardItem.socket')['register'](socket);function respondWithRpcPromise(_0x41d57a,_0x3c71a1,_0x2ff492){return new BPromise(function(_0x1d8a61,_0x5dd66a){return client[_0x9a5f('0xd')](_0x41d57a,_0x2ff492)[_0x9a5f('0xe')](function(_0x396f42){logger[_0x9a5f('0xf')](_0x9a5f('0x10'),_0x3c71a1,_0x9a5f('0x11'));logger[_0x9a5f('0x12')](_0x9a5f('0x13'),_0x3c71a1,_0x9a5f('0x11'),JSON[_0x9a5f('0x14')](_0x396f42));if(_0x396f42['error']){if(_0x396f42['error'][_0x9a5f('0x15')]===0x1f4){logger[_0x9a5f('0x16')]('DashboardItem,\x20%s,\x20%s',_0x3c71a1,_0x396f42['error'][_0x9a5f('0x17')]);return _0x5dd66a(_0x396f42[_0x9a5f('0x16')][_0x9a5f('0x17')]);}logger['error'](_0x9a5f('0x10'),_0x3c71a1,_0x396f42[_0x9a5f('0x16')][_0x9a5f('0x17')]);return _0x1d8a61(_0x396f42[_0x9a5f('0x16')][_0x9a5f('0x17')]);}else{logger[_0x9a5f('0xf')](_0x9a5f('0x10'),_0x3c71a1,_0x9a5f('0x11'));_0x1d8a61(_0x396f42[_0x9a5f('0x18')][_0x9a5f('0x17')]);}})['catch'](function(_0x4ba3a2){logger[_0x9a5f('0x16')](_0x9a5f('0x10'),_0x3c71a1,_0x4ba3a2);_0x5dd66a(_0x4ba3a2);});});} \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.socket.js b/server/api/dashboardItem/dashboardItem.socket.js index f2fb85e..32347ca 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 _0x8b30=['dashboardItem:','save','remove','update','register'];(function(_0x5d8fc3,_0x327551){var _0x2aa5b4=function(_0x5aadae){while(--_0x5aadae){_0x5d8fc3['push'](_0x5d8fc3['shift']());}};_0x2aa5b4(++_0x327551);}(_0x8b30,0x1d7));var _0x08b3=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x8b30[_0x502c7d];return _0x30b7ed;};'use strict';var DashboardItemEvents=require('./dashboardItem.events');var events=[_0x08b3('0x0'),_0x08b3('0x1'),_0x08b3('0x2')];function createListener(_0x511c85,_0x4a5548){return function(_0x19d52c){_0x4a5548['emit'](_0x511c85,_0x19d52c);};}function removeListener(_0x6eb00b,_0x301501){return function(){DashboardItemEvents['removeListener'](_0x6eb00b,_0x301501);};}exports[_0x08b3('0x3')]=function(_0x478154){for(var _0x5e9e3e=0x0,_0x55b53d=events['length'];_0x5e9e3e<_0x55b53d;_0x5e9e3e++){var _0x42bc43=events[_0x5e9e3e];var _0x20c2ea=createListener(_0x08b3('0x4')+_0x42bc43,_0x478154);DashboardItemEvents['on'](_0x42bc43,_0x20c2ea);}}; \ No newline at end of file +var _0xdd42=['length','dashboardItem:','save','remove','update','removeListener'];(function(_0x25629f,_0x3efafb){var _0x2c3171=function(_0x226ee2){while(--_0x226ee2){_0x25629f['push'](_0x25629f['shift']());}};_0x2c3171(++_0x3efafb);}(_0xdd42,0x10a));var _0x2dd4=function(_0x4ef461,_0x49fb0a){_0x4ef461=_0x4ef461-0x0;var _0x6fa6b3=_0xdd42[_0x4ef461];return _0x6fa6b3;};'use strict';var DashboardItemEvents=require('./dashboardItem.events');var events=[_0x2dd4('0x0'),_0x2dd4('0x1'),_0x2dd4('0x2')];function createListener(_0x1841cb,_0x29abd6){return function(_0x4e8e4f){_0x29abd6['emit'](_0x1841cb,_0x4e8e4f);};}function removeListener(_0x13484c,_0x59361c){return function(){DashboardItemEvents[_0x2dd4('0x3')](_0x13484c,_0x59361c);};}exports['register']=function(_0x93598a){for(var _0x2c0875=0x0,_0x4caba5=events[_0x2dd4('0x4')];_0x2c0875<_0x4caba5;_0x2c0875++){var _0x2a4844=events[_0x2c0875];var _0x361e0f=createListener(_0x2dd4('0x5')+_0x2a4844,_0x93598a);DashboardItemEvents['on'](_0x2a4844,_0x361e0f);}}; \ No newline at end of file diff --git a/server/api/dashboardItem/index.js b/server/api/dashboardItem/index.js index bf09c53..2573cc9 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 _0xbf12=['connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./dashboardItem.controller','/:id','isAuthenticated','post','create','delete','destroy','util'];(function(_0x5e6ebe,_0x373752){var _0x5d80a0=function(_0x145677){while(--_0x145677){_0x5e6ebe['push'](_0x5e6ebe['shift']());}};_0x5d80a0(++_0x373752);}(_0xbf12,0x9b));var _0x2bf1=function(_0x1c520b,_0x4002c7){_0x1c520b=_0x1c520b-0x0;var _0x33278d=_0xbf12[_0x1c520b];return _0x33278d;};'use strict';var multer=require('multer');var util=require(_0x2bf1('0x0'));var path=require('path');var timeout=require(_0x2bf1('0x1'));var express=require(_0x2bf1('0x2'));var router=express[_0x2bf1('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x2bf1('0x4'));var config=require(_0x2bf1('0x5'));var controller=require(_0x2bf1('0x6'));router['get'](_0x2bf1('0x7'),auth[_0x2bf1('0x8')](),controller['show']);router[_0x2bf1('0x9')]('/',auth['isAuthenticated'](),controller[_0x2bf1('0xa')]);router['put']('/:id',auth[_0x2bf1('0x8')](),controller['update']);router[_0x2bf1('0xb')](_0x2bf1('0x7'),auth[_0x2bf1('0x8')](),controller[_0x2bf1('0xc')]);module['exports']=router; \ No newline at end of file +var _0xbf21=['create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./dashboardItem.controller','get','/:id','isAuthenticated','show','post'];(function(_0x4bb66f,_0x3cd682){var _0xf2772f=function(_0x2e3698){while(--_0x2e3698){_0x4bb66f['push'](_0x4bb66f['shift']());}};_0xf2772f(++_0x3cd682);}(_0xbf21,0xba));var _0x1bf2=function(_0x3845bb,_0x82c561){_0x3845bb=_0x3845bb-0x0;var _0x5b1424=_0xbf21[_0x3845bb];return _0x5b1424;};'use strict';var multer=require(_0x1bf2('0x0'));var util=require(_0x1bf2('0x1'));var path=require(_0x1bf2('0x2'));var timeout=require(_0x1bf2('0x3'));var express=require(_0x1bf2('0x4'));var router=express['Router']();var fs_extra=require(_0x1bf2('0x5'));var auth=require(_0x1bf2('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x1bf2('0x7'));var controller=require(_0x1bf2('0x8'));router[_0x1bf2('0x9')](_0x1bf2('0xa'),auth[_0x1bf2('0xb')](),controller[_0x1bf2('0xc')]);router[_0x1bf2('0xd')]('/',auth[_0x1bf2('0xb')](),controller[_0x1bf2('0xe')]);router[_0x1bf2('0xf')](_0x1bf2('0xa'),auth[_0x1bf2('0xb')](),controller[_0x1bf2('0x10')]);router[_0x1bf2('0x11')]('/:id',auth[_0x1bf2('0xb')](),controller[_0x1bf2('0x12')]);module[_0x1bf2('0x13')]=router; \ No newline at end of file diff --git a/server/api/disposition/disposition.attributes.js b/server/api/disposition/disposition.attributes.js index 5823c8a..3c98ffe 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 _0x790a=['sequelize','exports','STRING','ENUM','first'];(function(_0x37beb3,_0x4e247f){var _0x5555b0=function(_0x35c1b5){while(--_0x35c1b5){_0x37beb3['push'](_0x37beb3['shift']());}};_0x5555b0(++_0x4e247f);}(_0x790a,0x13b));var _0xa790=function(_0x18e7a5,_0x5eb8fb){_0x18e7a5=_0x18e7a5-0x0;var _0x26f113=_0x790a[_0x18e7a5];return _0x26f113;};'use strict';var Sequelize=require(_0xa790('0x0'));module[_0xa790('0x1')]={'name':{'type':Sequelize[_0xa790('0x2')],'allowNull':![]},'level':{'type':Sequelize[_0xa790('0x3')]('first','second','third'),'allowNull':![],'defaultValue':_0xa790('0x4')},'description':{'type':Sequelize[_0xa790('0x2')]}}; \ No newline at end of file +var _0xa254=['first','second','third','sequelize','exports'];(function(_0x2a7b8e,_0x50ffce){var _0x29b5c8=function(_0x131fe0){while(--_0x131fe0){_0x2a7b8e['push'](_0x2a7b8e['shift']());}};_0x29b5c8(++_0x50ffce);}(_0xa254,0x1ca));var _0x4a25=function(_0x2d7a4b,_0xa36b04){_0x2d7a4b=_0x2d7a4b-0x0;var _0x603707=_0xa254[_0x2d7a4b];return _0x603707;};'use strict';var Sequelize=require(_0x4a25('0x0'));module[_0x4a25('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'level':{'type':Sequelize['ENUM'](_0x4a25('0x2'),_0x4a25('0x3'),_0x4a25('0x4')),'allowNull':![],'defaultValue':_0x4a25('0x2')},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/disposition/disposition.controller.js b/server/api/disposition/disposition.controller.js index 6cc96dd..ea82a9f 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 _0x90b5=['crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','set','apply','reject','then','destroy','error','stack','name','index','map','Disposition','rawAttributes','fieldName','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','limit','order','sort','pick','where','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','show','params','keys','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','catch','eml-format','zip-dir','fast-json-patch','request-promise','moment','util','path','to-csv','ejs','fs-extra','squel'];(function(_0x2dadb9,_0x42cfe6){var _0x2f0097=function(_0x21163f){while(--_0x21163f){_0x2dadb9['push'](_0x2dadb9['shift']());}};_0x2f0097(++_0x42cfe6);}(_0x90b5,0x139));var _0x590b=function(_0x4e402d,_0x2bd9f1){_0x4e402d=_0x4e402d-0x0;var _0x7a2680=_0x90b5[_0x4e402d];return _0x7a2680;};'use strict';var emlformat=require(_0x590b('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x590b('0x1'));var jsonpatch=require(_0x590b('0x2'));var rp=require(_0x590b('0x3'));var moment=require(_0x590b('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x590b('0x5'));var path=require(_0x590b('0x6'));var sox=require('sox');var csv=require(_0x590b('0x7'));var ejs=require(_0x590b('0x8'));var fs=require('fs');var fs_extra=require(_0x590b('0x9'));var _=require('lodash');var squel=require(_0x590b('0xa'));var crypto=require(_0x590b('0xb'));var jsforce=require(_0x590b('0xc'));var deskjs=require(_0x590b('0xd'));var toCsv=require(_0x590b('0x7'));var querystring=require(_0x590b('0xe'));var Papa=require(_0x590b('0xf'));var Redis=require(_0x590b('0x10'));var authService=require(_0x590b('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x590b('0x12'));var hardwareService=require(_0x590b('0x13'));var logger=require('../../config/logger')(_0x590b('0x14'));var utils=require('../../config/utils');var config=require(_0x590b('0x15'));var licenseUtil=require(_0x590b('0x16'));var db=require(_0x590b('0x17'))['db'];function respondWithStatusCode(_0x477069,_0x527487){_0x527487=_0x527487||0xcc;return function(_0xb0ca22){if(_0xb0ca22){return _0x477069[_0x590b('0x18')](_0x527487);}return _0x477069[_0x590b('0x19')](_0x527487)[_0x590b('0x1a')]();};}function respondWithResult(_0x2e85b1,_0x6ad7e7){_0x6ad7e7=_0x6ad7e7||0xc8;return function(_0x45ac04){if(_0x45ac04){return _0x2e85b1[_0x590b('0x19')](_0x6ad7e7)[_0x590b('0x1b')](_0x45ac04);}};}function respondWithFilteredResult(_0x1fbc84,_0x3fc5ca){return function(_0x260f47){if(_0x260f47){var _0x3e4723=typeof _0x3fc5ca[_0x590b('0x1c')]===_0x590b('0x1d')&&typeof _0x3fc5ca['limit']===_0x590b('0x1d');var _0x530e24=_0x260f47[_0x590b('0x1e')];var _0x115309=_0x3e4723?0x0:_0x3fc5ca[_0x590b('0x1c')];var _0x53337c=_0x3e4723?_0x260f47['count']:_0x3fc5ca[_0x590b('0x1c')]+_0x3fc5ca['limit'];var _0x21e771;if(_0x53337c>=_0x530e24){_0x53337c=_0x530e24;_0x21e771=0xc8;}else{_0x21e771=0xce;}_0x1fbc84[_0x590b('0x19')](_0x21e771);return _0x1fbc84[_0x590b('0x1f')]('Content-Range',_0x115309+'-'+_0x53337c+'/'+_0x530e24)[_0x590b('0x1b')](_0x260f47);}return null;};}function patchUpdates(_0x8ab843){return function(_0x2b8ea0){try{jsonpatch[_0x590b('0x20')](_0x2b8ea0,_0x8ab843,!![]);}catch(_0x4990ba){return BPromise[_0x590b('0x21')](_0x4990ba);}return _0x2b8ea0['save']();};}function saveUpdates(_0x10a339,_0x30dc9f){return function(_0x5bdaba){if(_0x5bdaba){return _0x5bdaba['update'](_0x10a339)[_0x590b('0x22')](function(_0x2bcfca){return _0x2bcfca;});}return null;};}function removeEntity(_0x52bdad,_0x21638c){return function(_0x1045d5){if(_0x1045d5){return _0x1045d5['destroy']()['then'](function(){var _0x26f073=_0x1045d5['get']({'plain':!![]});var _0x39fead='Dispositions';return db['UserProfileResource'][_0x590b('0x23')]({'where':{'type':_0x39fead,'resourceId':_0x26f073['id']}})[_0x590b('0x22')](function(){return _0x1045d5;});})['then'](function(){_0x52bdad[_0x590b('0x19')](0xcc)[_0x590b('0x1a')]();});}};}function handleEntityNotFound(_0x91e491,_0x2914dd){return function(_0x320a45){if(!_0x320a45){_0x91e491['sendStatus'](0x194);}return _0x320a45;};}function handleError(_0x32d355,_0xd96ca3){_0xd96ca3=_0xd96ca3||0x1f4;return function(_0x333af8){logger[_0x590b('0x24')](_0x333af8[_0x590b('0x25')]);if(_0x333af8[_0x590b('0x26')]){delete _0x333af8['name'];}_0x32d355[_0x590b('0x19')](_0xd96ca3)['send'](_0x333af8);};}exports[_0x590b('0x27')]=function(_0x3f9fd0,_0x448ab3){var _0x33931e={},_0x53a751={},_0x1041e5={'count':0x0,'rows':[]};var _0x4ef071=_[_0x590b('0x28')](db[_0x590b('0x29')][_0x590b('0x2a')],function(_0x1da455){return{'name':_0x1da455[_0x590b('0x2b')],'type':_0x1da455['type'][_0x590b('0x2c')]};});_0x53a751[_0x590b('0x2d')]=_[_0x590b('0x28')](_0x4ef071,_0x590b('0x26'));_0x53a751['query']=_['keys'](_0x3f9fd0[_0x590b('0x2e')]);_0x53a751[_0x590b('0x2f')]=_[_0x590b('0x30')](_0x53a751[_0x590b('0x2d')],_0x53a751['query']);_0x33931e['attributes']=_[_0x590b('0x30')](_0x53a751['model'],qs[_0x590b('0x31')](_0x3f9fd0[_0x590b('0x2e')][_0x590b('0x31')]));_0x33931e[_0x590b('0x32')]=_0x33931e[_0x590b('0x32')][_0x590b('0x33')]?_0x33931e[_0x590b('0x32')]:_0x53a751[_0x590b('0x2d')];if(!_0x3f9fd0[_0x590b('0x2e')][_0x590b('0x34')]('nolimit')){_0x33931e['limit']=qs[_0x590b('0x35')](_0x3f9fd0[_0x590b('0x2e')][_0x590b('0x35')]);_0x33931e[_0x590b('0x1c')]=qs[_0x590b('0x1c')](_0x3f9fd0['query'][_0x590b('0x1c')]);}_0x33931e[_0x590b('0x36')]=qs[_0x590b('0x37')](_0x3f9fd0[_0x590b('0x2e')][_0x590b('0x37')]);_0x33931e['where']=qs[_0x590b('0x2f')](_[_0x590b('0x38')](_0x3f9fd0['query'],_0x53a751['filters']),_0x4ef071);if(_0x3f9fd0[_0x590b('0x2e')]['filter']){_0x33931e[_0x590b('0x39')]=_[_0x590b('0x3a')](_0x33931e[_0x590b('0x39')],{'$or':_[_0x590b('0x28')](_0x4ef071,function(_0x210af8){if(_0x210af8[_0x590b('0x3b')]!==_0x590b('0x3c')){var _0x40075b={};_0x40075b[_0x210af8[_0x590b('0x26')]]={'$like':'%'+_0x3f9fd0[_0x590b('0x2e')]['filter']+'%'};return _0x40075b;}})});}_0x33931e=_[_0x590b('0x3a')]({},_0x33931e,_0x3f9fd0[_0x590b('0x3d')]);var _0x2efaab={'where':_0x33931e['where']};return db[_0x590b('0x29')][_0x590b('0x1e')](_0x2efaab)[_0x590b('0x22')](function(_0x114bbe){_0x1041e5[_0x590b('0x1e')]=_0x114bbe;if(_0x3f9fd0[_0x590b('0x2e')][_0x590b('0x3e')]){_0x33931e[_0x590b('0x3f')]=[{'all':!![]}];}return db['Disposition'][_0x590b('0x40')](_0x33931e);})['then'](function(_0xb345c0){_0x1041e5[_0x590b('0x41')]=_0xb345c0;return _0x1041e5;})[_0x590b('0x22')](respondWithFilteredResult(_0x448ab3,_0x33931e))['catch'](handleError(_0x448ab3,null));};exports[_0x590b('0x42')]=function(_0xc22a10,_0x1a839b){var _0x374f0f={'raw':!![],'where':{'id':_0xc22a10[_0x590b('0x43')]['id']}},_0x4fd5ca={};_0x4fd5ca[_0x590b('0x2d')]=_['keys'](db['Disposition']['rawAttributes']);_0x4fd5ca[_0x590b('0x2e')]=_[_0x590b('0x44')](_0xc22a10[_0x590b('0x2e')]);_0x4fd5ca['filters']=_['intersection'](_0x4fd5ca[_0x590b('0x2d')],_0x4fd5ca[_0x590b('0x2e')]);_0x374f0f['attributes']=_[_0x590b('0x30')](_0x4fd5ca[_0x590b('0x2d')],qs[_0x590b('0x31')](_0xc22a10[_0x590b('0x2e')][_0x590b('0x31')]));_0x374f0f[_0x590b('0x32')]=_0x374f0f[_0x590b('0x32')][_0x590b('0x33')]?_0x374f0f[_0x590b('0x32')]:_0x4fd5ca[_0x590b('0x2d')];if(_0xc22a10[_0x590b('0x2e')][_0x590b('0x3e')]){_0x374f0f[_0x590b('0x3f')]=[{'all':!![]}];}_0x374f0f=_['merge']({},_0x374f0f,_0xc22a10['options']);return db[_0x590b('0x29')][_0x590b('0x45')](_0x374f0f)[_0x590b('0x22')](handleEntityNotFound(_0x1a839b,null))[_0x590b('0x22')](respondWithResult(_0x1a839b,null))['catch'](handleError(_0x1a839b,null));};exports[_0x590b('0x46')]=function(_0x11bb48,_0x2f492a){return db['Disposition'][_0x590b('0x46')](_0x11bb48[_0x590b('0x47')],{})['then'](function(_0x4a9a8c){var _0x321369=_0x11bb48[_0x590b('0x48')]['get']({'plain':!![]});if(!_0x321369)throw new Error(_0x590b('0x49'));if(_0x321369[_0x590b('0x4a')]==='user'){var _0x67ee4f=_0x4a9a8c[_0x590b('0x4b')]({'plain':!![]});var _0x446910='Dispositions';return db['UserProfileSection'][_0x590b('0x45')]({'where':{'name':_0x446910,'userProfileId':_0x321369[_0x590b('0x4c')]},'raw':!![]})['then'](function(_0x29d8c2){if(_0x29d8c2&&_0x29d8c2[_0x590b('0x4d')]===0x0){return db[_0x590b('0x4e')][_0x590b('0x46')]({'name':_0x67ee4f[_0x590b('0x26')],'resourceId':_0x67ee4f['id'],'type':_0x29d8c2[_0x590b('0x26')],'sectionId':_0x29d8c2['id']},{})[_0x590b('0x22')](function(){return _0x4a9a8c;});}else{return _0x4a9a8c;}})['catch'](function(_0x8deea8){logger['error'](_0x590b('0x4f'),_0x8deea8);throw _0x8deea8;});}return _0x4a9a8c;})[_0x590b('0x22')](respondWithResult(_0x2f492a,0xc9))[_0x590b('0x50')](handleError(_0x2f492a,null));};exports['update']=function(_0x5b4e91,_0x670ce6){if(_0x5b4e91[_0x590b('0x47')]['id']){delete _0x5b4e91[_0x590b('0x47')]['id'];}return db[_0x590b('0x29')]['find']({'where':{'id':_0x5b4e91[_0x590b('0x43')]['id']}})['then'](handleEntityNotFound(_0x670ce6,null))['then'](saveUpdates(_0x5b4e91[_0x590b('0x47')],null))['then'](respondWithResult(_0x670ce6,null))[_0x590b('0x50')](handleError(_0x670ce6,null));};exports['destroy']=function(_0x153aca,_0x5d6c9b){return db[_0x590b('0x29')][_0x590b('0x45')]({'where':{'id':_0x153aca[_0x590b('0x43')]['id']}})[_0x590b('0x22')](handleEntityNotFound(_0x5d6c9b,null))[_0x590b('0x22')](removeEntity(_0x5d6c9b,null))[_0x590b('0x50')](handleError(_0x5d6c9b,null));}; \ No newline at end of file +var _0x5c0e=['include','options','create','body','user','get','role','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','apply','reject','update','destroy','then','Dispositions','UserProfileResource','error','stack','name','send','index','map','Disposition','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','rows','catch','show','params'];(function(_0x95f0fc,_0x151455){var _0x1d6cdd=function(_0x507f35){while(--_0x507f35){_0x95f0fc['push'](_0x95f0fc['shift']());}};_0x1d6cdd(++_0x151455);}(_0x5c0e,0x160));var _0xe5c0=function(_0x5e2cb4,_0x592c64){_0x5e2cb4=_0x5e2cb4-0x0;var _0x282902=_0x5c0e[_0x5e2cb4];return _0x282902;};'use strict';var emlformat=require(_0xe5c0('0x0'));var rimraf=require(_0xe5c0('0x1'));var zipdir=require(_0xe5c0('0x2'));var jsonpatch=require(_0xe5c0('0x3'));var rp=require(_0xe5c0('0x4'));var moment=require(_0xe5c0('0x5'));var BPromise=require(_0xe5c0('0x6'));var Mustache=require('mustache');var util=require(_0xe5c0('0x7'));var path=require('path');var sox=require(_0xe5c0('0x8'));var csv=require(_0xe5c0('0x9'));var ejs=require(_0xe5c0('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe5c0('0xb'));var squel=require(_0xe5c0('0xc'));var crypto=require(_0xe5c0('0xd'));var jsforce=require(_0xe5c0('0xe'));var deskjs=require(_0xe5c0('0xf'));var toCsv=require(_0xe5c0('0x9'));var querystring=require(_0xe5c0('0x10'));var Papa=require('papaparse');var Redis=require(_0xe5c0('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xe5c0('0x12'));var as=require(_0xe5c0('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xe5c0('0x14'))(_0xe5c0('0x15'));var utils=require(_0xe5c0('0x16'));var config=require(_0xe5c0('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xe5c0('0x18'))['db'];function respondWithStatusCode(_0x5bedb7,_0x9afa6f){_0x9afa6f=_0x9afa6f||0xcc;return function(_0x25b01f){if(_0x25b01f){return _0x5bedb7[_0xe5c0('0x19')](_0x9afa6f);}return _0x5bedb7['status'](_0x9afa6f)[_0xe5c0('0x1a')]();};}function respondWithResult(_0x5e68de,_0x2548c){_0x2548c=_0x2548c||0xc8;return function(_0xf0c926){if(_0xf0c926){return _0x5e68de[_0xe5c0('0x1b')](_0x2548c)[_0xe5c0('0x1c')](_0xf0c926);}};}function respondWithFilteredResult(_0x2f5d74,_0x4aa82b){return function(_0x4aac0e){if(_0x4aac0e){var _0x128cea=typeof _0x4aa82b[_0xe5c0('0x1d')]===_0xe5c0('0x1e')&&typeof _0x4aa82b[_0xe5c0('0x1f')]===_0xe5c0('0x1e');var _0x453728=_0x4aac0e[_0xe5c0('0x20')];var _0x42e62a=_0x128cea?0x0:_0x4aa82b['offset'];var _0x340b65=_0x128cea?_0x4aac0e['count']:_0x4aa82b['offset']+_0x4aa82b['limit'];var _0x44f8b8;if(_0x340b65>=_0x453728){_0x340b65=_0x453728;_0x44f8b8=0xc8;}else{_0x44f8b8=0xce;}_0x2f5d74[_0xe5c0('0x1b')](_0x44f8b8);return _0x2f5d74[_0xe5c0('0x21')]('Content-Range',_0x42e62a+'-'+_0x340b65+'/'+_0x453728)[_0xe5c0('0x1c')](_0x4aac0e);}return null;};}function patchUpdates(_0x4d123e){return function(_0x88b8b4){try{jsonpatch[_0xe5c0('0x22')](_0x88b8b4,_0x4d123e,!![]);}catch(_0x2f54db){return BPromise[_0xe5c0('0x23')](_0x2f54db);}return _0x88b8b4['save']();};}function saveUpdates(_0x10e25c,_0x35458e){return function(_0x4b6c77){if(_0x4b6c77){return _0x4b6c77[_0xe5c0('0x24')](_0x10e25c)['then'](function(_0x435b28){return _0x435b28;});}return null;};}function removeEntity(_0x139513,_0x351dc2){return function(_0x3451af){if(_0x3451af){return _0x3451af[_0xe5c0('0x25')]()[_0xe5c0('0x26')](function(){var _0x1f731f=_0x3451af['get']({'plain':!![]});var _0x1d0f15=_0xe5c0('0x27');return db[_0xe5c0('0x28')]['destroy']({'where':{'type':_0x1d0f15,'resourceId':_0x1f731f['id']}})[_0xe5c0('0x26')](function(){return _0x3451af;});})['then'](function(){_0x139513[_0xe5c0('0x1b')](0xcc)[_0xe5c0('0x1a')]();});}};}function handleEntityNotFound(_0x7a4dbe,_0x2a0155){return function(_0x55765b){if(!_0x55765b){_0x7a4dbe[_0xe5c0('0x19')](0x194);}return _0x55765b;};}function handleError(_0x555f62,_0xa4f628){_0xa4f628=_0xa4f628||0x1f4;return function(_0x5accfa){logger[_0xe5c0('0x29')](_0x5accfa[_0xe5c0('0x2a')]);if(_0x5accfa[_0xe5c0('0x2b')]){delete _0x5accfa[_0xe5c0('0x2b')];}_0x555f62['status'](_0xa4f628)[_0xe5c0('0x2c')](_0x5accfa);};}exports[_0xe5c0('0x2d')]=function(_0x1ca89f,_0x4d1262){var _0x4f1d91={},_0x4a7744={},_0x192ee2={'count':0x0,'rows':[]};var _0x3e3877=_[_0xe5c0('0x2e')](db[_0xe5c0('0x2f')][_0xe5c0('0x30')],function(_0x35406e){return{'name':_0x35406e[_0xe5c0('0x31')],'type':_0x35406e[_0xe5c0('0x32')][_0xe5c0('0x33')]};});_0x4a7744[_0xe5c0('0x34')]=_[_0xe5c0('0x2e')](_0x3e3877,_0xe5c0('0x2b'));_0x4a7744['query']=_[_0xe5c0('0x35')](_0x1ca89f[_0xe5c0('0x36')]);_0x4a7744[_0xe5c0('0x37')]=_[_0xe5c0('0x38')](_0x4a7744[_0xe5c0('0x34')],_0x4a7744[_0xe5c0('0x36')]);_0x4f1d91[_0xe5c0('0x39')]=_['intersection'](_0x4a7744[_0xe5c0('0x34')],qs[_0xe5c0('0x3a')](_0x1ca89f[_0xe5c0('0x36')][_0xe5c0('0x3a')]));_0x4f1d91[_0xe5c0('0x39')]=_0x4f1d91[_0xe5c0('0x39')][_0xe5c0('0x3b')]?_0x4f1d91[_0xe5c0('0x39')]:_0x4a7744['model'];if(!_0x1ca89f[_0xe5c0('0x36')]['hasOwnProperty'](_0xe5c0('0x3c'))){_0x4f1d91[_0xe5c0('0x1f')]=qs[_0xe5c0('0x1f')](_0x1ca89f[_0xe5c0('0x36')][_0xe5c0('0x1f')]);_0x4f1d91['offset']=qs[_0xe5c0('0x1d')](_0x1ca89f[_0xe5c0('0x36')][_0xe5c0('0x1d')]);}_0x4f1d91[_0xe5c0('0x3d')]=qs[_0xe5c0('0x3e')](_0x1ca89f[_0xe5c0('0x36')][_0xe5c0('0x3e')]);_0x4f1d91[_0xe5c0('0x3f')]=qs[_0xe5c0('0x37')](_[_0xe5c0('0x40')](_0x1ca89f[_0xe5c0('0x36')],_0x4a7744[_0xe5c0('0x37')]),_0x3e3877);if(_0x1ca89f[_0xe5c0('0x36')][_0xe5c0('0x41')]){_0x4f1d91[_0xe5c0('0x3f')]=_[_0xe5c0('0x42')](_0x4f1d91[_0xe5c0('0x3f')],{'$or':_[_0xe5c0('0x2e')](_0x3e3877,function(_0x8ac1b9){if(_0x8ac1b9[_0xe5c0('0x32')]!==_0xe5c0('0x43')){var _0x1c6546={};_0x1c6546[_0x8ac1b9[_0xe5c0('0x2b')]]={'$like':'%'+_0x1ca89f['query']['filter']+'%'};return _0x1c6546;}})});}_0x4f1d91=_[_0xe5c0('0x42')]({},_0x4f1d91,_0x1ca89f['options']);var _0x24145b={'where':_0x4f1d91[_0xe5c0('0x3f')]};return db[_0xe5c0('0x2f')][_0xe5c0('0x20')](_0x24145b)['then'](function(_0x62965f){_0x192ee2[_0xe5c0('0x20')]=_0x62965f;if(_0x1ca89f[_0xe5c0('0x36')][_0xe5c0('0x44')]){_0x4f1d91['include']=[{'all':!![]}];}return db[_0xe5c0('0x2f')]['findAll'](_0x4f1d91);})['then'](function(_0x3d83fd){_0x192ee2[_0xe5c0('0x45')]=_0x3d83fd;return _0x192ee2;})[_0xe5c0('0x26')](respondWithFilteredResult(_0x4d1262,_0x4f1d91))[_0xe5c0('0x46')](handleError(_0x4d1262,null));};exports[_0xe5c0('0x47')]=function(_0xe467dc,_0x40c139){var _0x479875={'raw':!![],'where':{'id':_0xe467dc[_0xe5c0('0x48')]['id']}},_0x5c1218={};_0x5c1218[_0xe5c0('0x34')]=_['keys'](db[_0xe5c0('0x2f')]['rawAttributes']);_0x5c1218[_0xe5c0('0x36')]=_[_0xe5c0('0x35')](_0xe467dc[_0xe5c0('0x36')]);_0x5c1218[_0xe5c0('0x37')]=_[_0xe5c0('0x38')](_0x5c1218['model'],_0x5c1218[_0xe5c0('0x36')]);_0x479875[_0xe5c0('0x39')]=_['intersection'](_0x5c1218[_0xe5c0('0x34')],qs['fields'](_0xe467dc[_0xe5c0('0x36')][_0xe5c0('0x3a')]));_0x479875[_0xe5c0('0x39')]=_0x479875[_0xe5c0('0x39')][_0xe5c0('0x3b')]?_0x479875['attributes']:_0x5c1218['model'];if(_0xe467dc['query'][_0xe5c0('0x44')]){_0x479875[_0xe5c0('0x49')]=[{'all':!![]}];}_0x479875=_[_0xe5c0('0x42')]({},_0x479875,_0xe467dc[_0xe5c0('0x4a')]);return db['Disposition']['find'](_0x479875)[_0xe5c0('0x26')](handleEntityNotFound(_0x40c139,null))[_0xe5c0('0x26')](respondWithResult(_0x40c139,null))[_0xe5c0('0x46')](handleError(_0x40c139,null));};exports[_0xe5c0('0x4b')]=function(_0x1c85e5,_0x5db208){return db[_0xe5c0('0x2f')][_0xe5c0('0x4b')](_0x1c85e5[_0xe5c0('0x4c')],{})[_0xe5c0('0x26')](function(_0x4ba7aa){var _0x596398=_0x1c85e5[_0xe5c0('0x4d')][_0xe5c0('0x4e')]({'plain':!![]});if(!_0x596398)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x596398[_0xe5c0('0x4f')]===_0xe5c0('0x4d')){var _0x5f4f61=_0x4ba7aa[_0xe5c0('0x4e')]({'plain':!![]});var _0x11acfd=_0xe5c0('0x27');return db[_0xe5c0('0x50')][_0xe5c0('0x51')]({'where':{'name':_0x11acfd,'userProfileId':_0x596398[_0xe5c0('0x52')]},'raw':!![]})[_0xe5c0('0x26')](function(_0x1a1c12){if(_0x1a1c12&&_0x1a1c12[_0xe5c0('0x53')]===0x0){return db[_0xe5c0('0x28')]['create']({'name':_0x5f4f61[_0xe5c0('0x2b')],'resourceId':_0x5f4f61['id'],'type':_0x1a1c12['name'],'sectionId':_0x1a1c12['id']},{})[_0xe5c0('0x26')](function(){return _0x4ba7aa;});}else{return _0x4ba7aa;}})[_0xe5c0('0x46')](function(_0x2bee40){logger[_0xe5c0('0x29')](_0xe5c0('0x54'),_0x2bee40);throw _0x2bee40;});}return _0x4ba7aa;})[_0xe5c0('0x26')](respondWithResult(_0x5db208,0xc9))['catch'](handleError(_0x5db208,null));};exports[_0xe5c0('0x24')]=function(_0x15e1b5,_0x2850be){if(_0x15e1b5[_0xe5c0('0x4c')]['id']){delete _0x15e1b5[_0xe5c0('0x4c')]['id'];}return db[_0xe5c0('0x2f')]['find']({'where':{'id':_0x15e1b5[_0xe5c0('0x48')]['id']}})[_0xe5c0('0x26')](handleEntityNotFound(_0x2850be,null))[_0xe5c0('0x26')](saveUpdates(_0x15e1b5[_0xe5c0('0x4c')],null))[_0xe5c0('0x26')](respondWithResult(_0x2850be,null))[_0xe5c0('0x46')](handleError(_0x2850be,null));};exports[_0xe5c0('0x25')]=function(_0x27e2e9,_0x48fab4){return db['Disposition']['find']({'where':{'id':_0x27e2e9[_0xe5c0('0x48')]['id']}})[_0xe5c0('0x26')](handleEntityNotFound(_0x48fab4,null))[_0xe5c0('0x26')](removeEntity(_0x48fab4,null))[_0xe5c0('0x46')](handleError(_0x48fab4,null));}; \ No newline at end of file diff --git a/server/api/disposition/disposition.model.js b/server/api/disposition/disposition.model.js index ff63292..89accee 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 _0xaba3=['name_whatsapp','WhatsappAccountId','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./disposition.attributes','define','Disposition','tools_dispositions','name_voice','name','ListId','name_chat','ChatWebsiteId','name_mail','MailAccountId','name_sms','SmsAccountId','FaxAccountId','name_openchannel','OpenchannelAccountId'];(function(_0x3103e7,_0x3e4940){var _0x591724=function(_0x538560){while(--_0x538560){_0x3103e7['push'](_0x3103e7['shift']());}};_0x591724(++_0x3e4940);}(_0xaba3,0xda));var _0x3aba=function(_0x3adb8e,_0x247ca2){_0x3adb8e=_0x3adb8e-0x0;var _0x3eacdb=_0xaba3[_0x3adb8e];return _0x3eacdb;};'use strict';var _=require(_0x3aba('0x0'));var util=require(_0x3aba('0x1'));var logger=require(_0x3aba('0x2'))(_0x3aba('0x3'));var moment=require(_0x3aba('0x4'));var BPromise=require('bluebird');var rp=require(_0x3aba('0x5'));var fs=require('fs');var path=require(_0x3aba('0x6'));var rimraf=require(_0x3aba('0x7'));var config=require(_0x3aba('0x8'));var attributes=require(_0x3aba('0x9'));module['exports']=function(_0x3b3b2b,_0x17d85f){return _0x3b3b2b[_0x3aba('0xa')](_0x3aba('0xb'),attributes,{'tableName':_0x3aba('0xc'),'paranoid':![],'indexes':[{'unique':!![],'name':_0x3aba('0xd'),'fields':[_0x3aba('0xe'),_0x3aba('0xf')]},{'unique':!![],'name':_0x3aba('0x10'),'fields':['name',_0x3aba('0x11')]},{'unique':!![],'name':_0x3aba('0x12'),'fields':[_0x3aba('0xe'),_0x3aba('0x13')]},{'unique':!![],'name':_0x3aba('0x14'),'fields':['name',_0x3aba('0x15')]},{'unique':!![],'name':'name_fax','fields':[_0x3aba('0xe'),_0x3aba('0x16')]},{'unique':!![],'name':_0x3aba('0x17'),'fields':['name',_0x3aba('0x18')]},{'unique':!![],'name':_0x3aba('0x19'),'fields':[_0x3aba('0xe'),_0x3aba('0x1a')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xf4c8=['lodash','util','api','moment','bluebird','request-promise','rimraf','../../config/environment','exports','define','Disposition','tools_dispositions','name_voice','ListId','name_chat','ChatWebsiteId','name_mail','name','MailAccountId','name_sms','SmsAccountId','name_fax','FaxAccountId','OpenchannelAccountId','WhatsappAccountId'];(function(_0x4d7952,_0x36b179){var _0x1b595a=function(_0x3d94da){while(--_0x3d94da){_0x4d7952['push'](_0x4d7952['shift']());}};_0x1b595a(++_0x36b179);}(_0xf4c8,0x190));var _0x8f4c=function(_0x2576d7,_0x167624){_0x2576d7=_0x2576d7-0x0;var _0x16a08c=_0xf4c8[_0x2576d7];return _0x16a08c;};'use strict';var _=require(_0x8f4c('0x0'));var util=require(_0x8f4c('0x1'));var logger=require('../../config/logger')(_0x8f4c('0x2'));var moment=require(_0x8f4c('0x3'));var BPromise=require(_0x8f4c('0x4'));var rp=require(_0x8f4c('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8f4c('0x6'));var config=require(_0x8f4c('0x7'));var attributes=require('./disposition.attributes');module[_0x8f4c('0x8')]=function(_0x177439,_0x30372b){return _0x177439[_0x8f4c('0x9')](_0x8f4c('0xa'),attributes,{'tableName':_0x8f4c('0xb'),'paranoid':![],'indexes':[{'unique':!![],'name':_0x8f4c('0xc'),'fields':['name',_0x8f4c('0xd')]},{'unique':!![],'name':_0x8f4c('0xe'),'fields':['name',_0x8f4c('0xf')]},{'unique':!![],'name':_0x8f4c('0x10'),'fields':[_0x8f4c('0x11'),_0x8f4c('0x12')]},{'unique':!![],'name':_0x8f4c('0x13'),'fields':['name',_0x8f4c('0x14')]},{'unique':!![],'name':_0x8f4c('0x15'),'fields':['name',_0x8f4c('0x16')]},{'unique':!![],'name':'name_openchannel','fields':[_0x8f4c('0x11'),_0x8f4c('0x17')]},{'unique':!![],'name':'name_whatsapp','fields':['name',_0x8f4c('0x18')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/disposition/disposition.rpc.js b/server/api/disposition/disposition.rpc.js index 38796a5..b5fc7ee 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(_0x26bec6,_0x5b5243){var _0x350f88=function(_0xacd29d){while(--_0xacd29d){_0x26bec6['push'](_0x26bec6['shift']());}};_0x350f88(++_0x5b5243);}(_0xa9e0,0x123));var _0x0a9e=function(_0x45e98e,_0x169b60){_0x45e98e=_0x45e98e-0x0;var _0x374dba=_0xa9e0[_0x45e98e];return _0x374dba;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});} \ 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(_0x2f8380,_0x294725){var _0x340cbe=function(_0x11965d){while(--_0x11965d){_0x2f8380['push'](_0x2f8380['shift']());}};_0x340cbe(++_0x294725);}(_0xa9e0,0x123));var _0x0a9e=function(_0xa1e3e3,_0x29fe0e){_0xa1e3e3=_0xa1e3e3-0x0;var _0xc980e9=_0xa9e0[_0xa1e3e3];return _0xc980e9;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var 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 f0d4444..e6be250 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 _0xb53e=['show','create','put','isAuthenticated','delete','destroy','exports','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./disposition.controller','index','get','/:id'];(function(_0x34c0bf,_0x3b8460){var _0x315559=function(_0x42f409){while(--_0x42f409){_0x34c0bf['push'](_0x34c0bf['shift']());}};_0x315559(++_0x3b8460);}(_0xb53e,0xa9));var _0xeb53=function(_0x42fdd9,_0x39fc89){_0x42fdd9=_0x42fdd9-0x0;var _0x2e4140=_0xb53e[_0x42fdd9];return _0x2e4140;};'use strict';var multer=require(_0xeb53('0x0'));var util=require(_0xeb53('0x1'));var path=require('path');var timeout=require(_0xeb53('0x2'));var express=require(_0xeb53('0x3'));var router=express['Router']();var fs_extra=require(_0xeb53('0x4'));var auth=require(_0xeb53('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xeb53('0x6'));var controller=require(_0xeb53('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0xeb53('0x8')]);router[_0xeb53('0x9')](_0xeb53('0xa'),auth['isAuthenticated'](),controller[_0xeb53('0xb')]);router['post']('/',auth['isAuthenticated'](),controller[_0xeb53('0xc')]);router[_0xeb53('0xd')](_0xeb53('0xa'),auth[_0xeb53('0xe')](),controller['update']);router[_0xeb53('0xf')](_0xeb53('0xa'),auth[_0xeb53('0xe')](),controller[_0xeb53('0x10')]);module[_0xeb53('0x11')]=router; \ No newline at end of file +var _0x26b1=['util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./disposition.controller','get','isAuthenticated','index','show','post','create','put','/:id','destroy','multer'];(function(_0x33080e,_0x1c600a){var _0x407395=function(_0x5b62fd){while(--_0x5b62fd){_0x33080e['push'](_0x33080e['shift']());}};_0x407395(++_0x1c600a);}(_0x26b1,0x11f));var _0x126b=function(_0x341d59,_0x2815ae){_0x341d59=_0x341d59-0x0;var _0x50727a=_0x26b1[_0x341d59];return _0x50727a;};'use strict';var multer=require(_0x126b('0x0'));var util=require(_0x126b('0x1'));var path=require(_0x126b('0x2'));var timeout=require(_0x126b('0x3'));var express=require(_0x126b('0x4'));var router=express['Router']();var fs_extra=require(_0x126b('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x126b('0x6'));var config=require(_0x126b('0x7'));var controller=require(_0x126b('0x8'));router[_0x126b('0x9')]('/',auth[_0x126b('0xa')](),controller[_0x126b('0xb')]);router[_0x126b('0x9')]('/:id',auth[_0x126b('0xa')](),controller[_0x126b('0xc')]);router[_0x126b('0xd')]('/',auth[_0x126b('0xa')](),controller[_0x126b('0xe')]);router[_0x126b('0xf')]('/:id',auth['isAuthenticated'](),controller['update']);router['delete'](_0x126b('0x10'),auth[_0x126b('0xa')](),controller[_0x126b('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.attributes.js b/server/api/faxAccount/faxAccount.attributes.js index d5c76ab..68a9fdf 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 _0x0cf1=['ENUM','yes','xCALLY\x20Motion\x20Fax','localstationid','2400','4800','7200','9600','12000','14400','INTEGER','IAX','DADHI','KHOMP','TEXT','BOOLEAN','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','exports','STRING'];(function(_0x1302cf,_0x388178){var _0x39729a=function(_0x39af6a){while(--_0x39af6a){_0x1302cf['push'](_0x1302cf['shift']());}};_0x39729a(++_0x388178);}(_0x0cf1,0xb6));var _0x10cf=function(_0x45940c,_0x515880){_0x45940c=_0x45940c-0x0;var _0x492673=_0x0cf1[_0x45940c];return _0x492673;};'use strict';var Sequelize=require('sequelize');module[_0x10cf('0x0')]={'name':{'type':Sequelize[_0x10cf('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']},'ecm':{'type':Sequelize[_0x10cf('0x2')](_0x10cf('0x3'),'no'),'defaultValue':_0x10cf('0x3')},'headerinfo':{'type':Sequelize['STRING'],'defaultValue':_0x10cf('0x4')},'localstationid':{'type':Sequelize[_0x10cf('0x1')],'unique':_0x10cf('0x5')},'minrate':{'type':Sequelize['ENUM'](_0x10cf('0x6'),_0x10cf('0x7'),_0x10cf('0x8'),_0x10cf('0x9'),_0x10cf('0xa'),'14400'),'defaultValue':_0x10cf('0x7')},'maxrate':{'type':Sequelize[_0x10cf('0x2')](_0x10cf('0x6'),_0x10cf('0x7'),'7200',_0x10cf('0x9'),_0x10cf('0xa'),_0x10cf('0xb')),'defaultValue':_0x10cf('0xb')},'modem':{'type':Sequelize[_0x10cf('0x1')],'defaultValue':'v17,v27,v29'},'gateway':{'type':Sequelize[_0x10cf('0x1')],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0x10cf('0x1')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize[_0x10cf('0xc')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize[_0x10cf('0x2')]('SIP',_0x10cf('0xd'),_0x10cf('0xe'),_0x10cf('0xf')),'defaultValue':'SIP'},'key':{'type':Sequelize[_0x10cf('0x1')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x10cf('0x10')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0x10cf('0x11')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x10cf('0x11')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x10cf('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x10cf('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x10cf('0x11')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x10cf('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x10cf('0xc')],'allowNull':!![],'defaultValue':null,'comment':_0x10cf('0x12')},'mandatoryDisposition':{'type':Sequelize[_0x10cf('0x11')],'defaultValue':![],'comment':_0x10cf('0x13'),'set':function(_0x354a43){if(!_0x354a43)this[_0x10cf('0x14')](_0x10cf('0x15'),null);this['setDataValue'](_0x10cf('0x16'),_0x354a43);}}}; \ No newline at end of file +var _0xfbf4=['14400','v17,v27,v29','SIP','IAX','DADHI','KHOMP','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','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','exports','ENUM','yes','STRING','xCALLY\x20Motion\x20Fax','localstationid','4800','7200','9600','12000','2400'];(function(_0x25e369,_0x415aae){var _0x2fb554=function(_0x3e9fbe){while(--_0x3e9fbe){_0x25e369['push'](_0x25e369['shift']());}};_0x2fb554(++_0x415aae);}(_0xfbf4,0x12c));var _0x4fbf=function(_0x4a4ebd,_0x243a60){_0x4a4ebd=_0x4a4ebd-0x0;var _0x246c14=_0xfbf4[_0x4a4ebd];return _0x246c14;};'use strict';var Sequelize=require(_0x4fbf('0x0'));module[_0x4fbf('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']},'ecm':{'type':Sequelize[_0x4fbf('0x2')]('yes','no'),'defaultValue':_0x4fbf('0x3')},'headerinfo':{'type':Sequelize[_0x4fbf('0x4')],'defaultValue':_0x4fbf('0x5')},'localstationid':{'type':Sequelize[_0x4fbf('0x4')],'unique':_0x4fbf('0x6')},'minrate':{'type':Sequelize['ENUM']('2400',_0x4fbf('0x7'),_0x4fbf('0x8'),_0x4fbf('0x9'),_0x4fbf('0xa'),'14400'),'defaultValue':'4800'},'maxrate':{'type':Sequelize['ENUM'](_0x4fbf('0xb'),_0x4fbf('0x7'),'7200','9600',_0x4fbf('0xa'),'14400'),'defaultValue':_0x4fbf('0xc')},'modem':{'type':Sequelize['STRING'],'defaultValue':_0x4fbf('0xd')},'gateway':{'type':Sequelize[_0x4fbf('0x4')],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize['STRING'],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize['INTEGER'],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize['ENUM'](_0x4fbf('0xe'),_0x4fbf('0xf'),_0x4fbf('0x10'),_0x4fbf('0x11')),'defaultValue':'SIP'},'key':{'type':Sequelize[_0x4fbf('0x4')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x4fbf('0x12')],'defaultValue':function(){return _0x4fbf('0x13');}},'notificationSound':{'type':Sequelize[_0x4fbf('0x14')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x4fbf('0x14')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x4fbf('0x15')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x4fbf('0x14')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x4fbf('0x15')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x4fbf('0x15')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x4fbf('0x15')],'allowNull':!![],'defaultValue':null,'comment':_0x4fbf('0x16')},'mandatoryDisposition':{'type':Sequelize[_0x4fbf('0x14')],'defaultValue':![],'comment':_0x4fbf('0x17'),'set':function(_0x1f7024){if(!_0x1f7024)this['setDataValue'](_0x4fbf('0x18'),null);this['setDataValue'](_0x4fbf('0x19'),_0x1f7024);}}}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.controller.js b/server/api/faxAccount/faxAccount.controller.js index bee39b6..6555729 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 _0xf895=['stringify','error','code','message','result','catch','sendStatus','end','status','json','offset','undefined','limit','count','set','save','update','destroy','get','FaxAccounts','stack','name','send','Pause','mandatoryDispositionPause','map','FaxAccount','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','sort','where','pick','filter','merge','options','include','findAll','show','params','includeAll','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','addDisposition','FaxAccountId','Disposition','getDispositions','findOne','nolimit','order','rows','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','addInteraction','FaxInteraction','omit','getInteractions','CmContact','Contact','User','Owner','fullname','internal','Tag','tag','addApplications','sequelize','transaction','FaxApplication','bulkCreate','findAndCountAll','priority','getApplications','context','exten','localstationid','app','system','description','Fax\x20Extension','push','Answer','CDR(type)=inbound-fax','Set','faxdetect','headerinfo','maxrate','minrate','modem','FAXOPT(','Wait','ReceiveFax','addAccountApplications','updateAccountApplications','VoiceExtension','tech','updatedAt','TrunkId','ListId','findById','getMessages','FaxMessage','$gte','format','YYYY-MM-DD\x20HH:mm:ss','List','DESC','attachments','join','root','server/files/attachments','basename','CheckAfterSend','isNil','from','fax','Contacts','defaults','List\x20not\x20found','Send\x20Fax\x20failed','filename','Messages','out','ContactId','dataValues','SendFax','SendFaxRpc,\x20%s','info','addAgents','spread','emit','removeAgents','isArray','userFaxAccount:remove','getAgents','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/utils','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./faxAccount.socket','register','client','http','request','then','FaxAccount,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x527372,_0x173b25){var _0x4f88b2=function(_0x1d0bb6){while(--_0x1d0bb6){_0x527372['push'](_0x527372['shift']());}};_0x4f88b2(++_0x173b25);}(_0xf895,0x15d));var _0x5f89=function(_0x4d493f,_0x2a093b){_0x4d493f=_0x4d493f-0x0;var _0x2ba541=_0xf895[_0x4d493f];return _0x2ba541;};'use strict';var emlformat=require(_0x5f89('0x0'));var rimraf=require(_0x5f89('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5f89('0x2'));var rp=require(_0x5f89('0x3'));var moment=require(_0x5f89('0x4'));var BPromise=require(_0x5f89('0x5'));var Mustache=require(_0x5f89('0x6'));var util=require('util');var path=require(_0x5f89('0x7'));var sox=require(_0x5f89('0x8'));var csv=require(_0x5f89('0x9'));var ejs=require(_0x5f89('0xa'));var fs=require('fs');var fs_extra=require(_0x5f89('0xb'));var _=require(_0x5f89('0xc'));var squel=require(_0x5f89('0xd'));var crypto=require(_0x5f89('0xe'));var jsforce=require(_0x5f89('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x5f89('0x9'));var querystring=require(_0x5f89('0x10'));var Papa=require(_0x5f89('0x11'));var Redis=require('ioredis');var authService=require(_0x5f89('0x12'));var qs=require(_0x5f89('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x5f89('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x5f89('0x15'));var db=require(_0x5f89('0x16'))['db'];config[_0x5f89('0x17')]=_['defaults'](config[_0x5f89('0x17')],{'host':_0x5f89('0x18'),'port':0x18eb});var socket=require(_0x5f89('0x19'))(new Redis(config[_0x5f89('0x17')]));require(_0x5f89('0x1a'))[_0x5f89('0x1b')](socket);var jayson=require('jayson/promise');var client=jayson[_0x5f89('0x1c')][_0x5f89('0x1d')]({'port':0x232c});var client9002=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x11fe6d,_0x545896,_0x413f52,_0x3dad26){return new BPromise(function(_0xd37231,_0x4bba49){var _0x4f7374=_0x3dad26||client;return _0x4f7374[_0x5f89('0x1e')](_0x11fe6d,_0x413f52)[_0x5f89('0x1f')](function(_0x145e41){logger['info'](_0x5f89('0x20'),_0x545896,_0x5f89('0x21'));logger[_0x5f89('0x22')]('FaxAccount,\x20%s,\x20%s,\x20%s',_0x545896,_0x5f89('0x21'),JSON[_0x5f89('0x23')](_0x145e41));if(_0x145e41[_0x5f89('0x24')]){if(_0x145e41[_0x5f89('0x24')][_0x5f89('0x25')]===0x1f4){logger['error']('FaxAccount,\x20%s,\x20%s',_0x545896,_0x145e41[_0x5f89('0x24')][_0x5f89('0x26')]);return _0x4bba49(_0x145e41[_0x5f89('0x24')][_0x5f89('0x26')]);}logger[_0x5f89('0x24')]('FaxAccount,\x20%s,\x20%s',_0x545896,_0x145e41[_0x5f89('0x24')][_0x5f89('0x26')]);return _0xd37231(_0x145e41[_0x5f89('0x24')]['message']);}else{logger['info'](_0x5f89('0x20'),_0x545896,'request\x20sent');_0xd37231(_0x145e41[_0x5f89('0x27')][_0x5f89('0x26')]);}})[_0x5f89('0x28')](function(_0x4b4a75){logger[_0x5f89('0x24')](_0x5f89('0x20'),_0x545896,_0x4b4a75);_0x4bba49(_0x4b4a75);});});}function respondWithStatusCode(_0x2a6167,_0x1015c9){_0x1015c9=_0x1015c9||0xcc;return function(_0x4a1ac0){if(_0x4a1ac0){return _0x2a6167[_0x5f89('0x29')](_0x1015c9);}return _0x2a6167['status'](_0x1015c9)[_0x5f89('0x2a')]();};}function respondWithResult(_0x263b4e,_0xe31624){_0xe31624=_0xe31624||0xc8;return function(_0x16f24c){if(_0x16f24c){return _0x263b4e[_0x5f89('0x2b')](_0xe31624)[_0x5f89('0x2c')](_0x16f24c);}};}function respondWithFilteredResult(_0xc0829a,_0x1f37c8){return function(_0x48be79){if(_0x48be79){var _0x69f44=typeof _0x1f37c8[_0x5f89('0x2d')]===_0x5f89('0x2e')&&typeof _0x1f37c8[_0x5f89('0x2f')]==='undefined';var _0x1bb911=_0x48be79[_0x5f89('0x30')];var _0x3c6429=_0x69f44?0x0:_0x1f37c8[_0x5f89('0x2d')];var _0x4c4fd0=_0x69f44?_0x48be79[_0x5f89('0x30')]:_0x1f37c8['offset']+_0x1f37c8[_0x5f89('0x2f')];var _0xf17584;if(_0x4c4fd0>=_0x1bb911){_0x4c4fd0=_0x1bb911;_0xf17584=0xc8;}else{_0xf17584=0xce;}_0xc0829a[_0x5f89('0x2b')](_0xf17584);return _0xc0829a[_0x5f89('0x31')]('Content-Range',_0x3c6429+'-'+_0x4c4fd0+'/'+_0x1bb911)[_0x5f89('0x2c')](_0x48be79);}return null;};}function patchUpdates(_0x5e0664){return function(_0x3d956b){try{jsonpatch['apply'](_0x3d956b,_0x5e0664,!![]);}catch(_0xd92607){return BPromise['reject'](_0xd92607);}return _0x3d956b[_0x5f89('0x32')]();};}function saveUpdates(_0x3701c9,_0x368841){return function(_0x7bf6e7){if(_0x7bf6e7){return _0x7bf6e7[_0x5f89('0x33')](_0x3701c9)['then'](function(_0x3ea366){return _0x3ea366;});}return null;};}function removeEntity(_0x4a9745,_0xf4d09e){return function(_0x23277f){if(_0x23277f){return _0x23277f[_0x5f89('0x34')]()[_0x5f89('0x1f')](function(){var _0xcd5714=_0x23277f[_0x5f89('0x35')]({'plain':!![]});var _0x2e44f=_0x5f89('0x36');return db['UserProfileResource'][_0x5f89('0x34')]({'where':{'type':_0x2e44f,'resourceId':_0xcd5714['id']}})['then'](function(){return _0x23277f;});})[_0x5f89('0x1f')](function(){_0x4a9745['status'](0xcc)[_0x5f89('0x2a')]();});}};}function handleEntityNotFound(_0x5b6dd1,_0x44a381){return function(_0x3135bd){if(!_0x3135bd){_0x5b6dd1[_0x5f89('0x29')](0x194);}return _0x3135bd;};}function handleError(_0x31c270,_0x5a8735){_0x5a8735=_0x5a8735||0x1f4;return function(_0x17ec49){logger['error'](_0x17ec49[_0x5f89('0x37')]);if(_0x17ec49[_0x5f89('0x38')]){delete _0x17ec49[_0x5f89('0x38')];}_0x31c270[_0x5f89('0x2b')](_0x5a8735)[_0x5f89('0x39')](_0x17ec49);};}exports['index']=function(_0x4a9dfc,_0x62693){var _0x598fef={'include':[{'model':db[_0x5f89('0x3a')],'as':_0x5f89('0x3b')}]},_0x56d020={},_0x5cecd4={'count':0x0,'rows':[]};var _0x507d5e=_[_0x5f89('0x3c')](db[_0x5f89('0x3d')][_0x5f89('0x3e')],function(_0x440373){return{'name':_0x440373[_0x5f89('0x3f')],'type':_0x440373[_0x5f89('0x40')][_0x5f89('0x41')]};});_0x56d020[_0x5f89('0x42')]=_[_0x5f89('0x3c')](_0x507d5e,'name');_0x56d020[_0x5f89('0x43')]=_[_0x5f89('0x44')](_0x4a9dfc[_0x5f89('0x43')]);_0x56d020[_0x5f89('0x45')]=_['intersection'](_0x56d020[_0x5f89('0x42')],_0x56d020[_0x5f89('0x43')]);_0x598fef[_0x5f89('0x46')]=_[_0x5f89('0x47')](_0x56d020[_0x5f89('0x42')],qs[_0x5f89('0x48')](_0x4a9dfc[_0x5f89('0x43')]['fields']));_0x598fef[_0x5f89('0x46')]=_0x598fef[_0x5f89('0x46')][_0x5f89('0x49')]?_0x598fef['attributes']:_0x56d020[_0x5f89('0x42')];if(!_0x4a9dfc[_0x5f89('0x43')][_0x5f89('0x4a')]('nolimit')){_0x598fef[_0x5f89('0x2f')]=qs['limit'](_0x4a9dfc[_0x5f89('0x43')][_0x5f89('0x2f')]);_0x598fef['offset']=qs[_0x5f89('0x2d')](_0x4a9dfc[_0x5f89('0x43')][_0x5f89('0x2d')]);}_0x598fef['order']=qs['sort'](_0x4a9dfc[_0x5f89('0x43')][_0x5f89('0x4b')]);_0x598fef[_0x5f89('0x4c')]=qs['filters'](_[_0x5f89('0x4d')](_0x4a9dfc[_0x5f89('0x43')],_0x56d020['filters']),_0x507d5e);if(_0x4a9dfc['query'][_0x5f89('0x4e')]){_0x598fef[_0x5f89('0x4c')]=_[_0x5f89('0x4f')](_0x598fef['where'],{'$or':_[_0x5f89('0x3c')](_0x507d5e,function(_0xb78940){if(_0xb78940[_0x5f89('0x40')]!=='VIRTUAL'){var _0x1f416b={};_0x1f416b[_0xb78940[_0x5f89('0x38')]]={'$like':'%'+_0x4a9dfc[_0x5f89('0x43')]['filter']+'%'};return _0x1f416b;}})});}_0x598fef=_[_0x5f89('0x4f')]({},_0x598fef,_0x4a9dfc[_0x5f89('0x50')]);var _0x2a9898={'where':_0x598fef[_0x5f89('0x4c')]};return db['FaxAccount']['count'](_0x2a9898)[_0x5f89('0x1f')](function(_0x473913){_0x5cecd4[_0x5f89('0x30')]=_0x473913;if(_0x4a9dfc[_0x5f89('0x43')]['includeAll']){_0x598fef[_0x5f89('0x51')]=[{'all':!![]}];}return db[_0x5f89('0x3d')][_0x5f89('0x52')](_0x598fef);})[_0x5f89('0x1f')](function(_0x4b9220){_0x5cecd4['rows']=_0x4b9220;return _0x5cecd4;})[_0x5f89('0x1f')](respondWithFilteredResult(_0x62693,_0x598fef))['catch'](handleError(_0x62693,null));};exports[_0x5f89('0x53')]=function(_0x413370,_0x183e4b){var _0x2b2adb={'raw':![],'where':{'id':_0x413370[_0x5f89('0x54')]['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x5edf19={};_0x5edf19[_0x5f89('0x42')]=_['keys'](db[_0x5f89('0x3d')][_0x5f89('0x3e')]);_0x5edf19[_0x5f89('0x43')]=_['keys'](_0x413370[_0x5f89('0x43')]);_0x5edf19[_0x5f89('0x45')]=_[_0x5f89('0x47')](_0x5edf19[_0x5f89('0x42')],_0x5edf19[_0x5f89('0x43')]);_0x2b2adb[_0x5f89('0x46')]=_['intersection'](_0x5edf19['model'],qs['fields'](_0x413370[_0x5f89('0x43')][_0x5f89('0x48')]));_0x2b2adb[_0x5f89('0x46')]=_0x2b2adb['attributes'][_0x5f89('0x49')]?_0x2b2adb[_0x5f89('0x46')]:_0x5edf19[_0x5f89('0x42')];if(_0x413370[_0x5f89('0x43')][_0x5f89('0x55')]){_0x2b2adb[_0x5f89('0x51')]=[{'all':!![]}];}_0x2b2adb=_[_0x5f89('0x4f')]({},_0x2b2adb,_0x413370[_0x5f89('0x50')]);return db[_0x5f89('0x3d')][_0x5f89('0x56')](_0x2b2adb)['then'](handleEntityNotFound(_0x183e4b,null))['then'](respondWithResult(_0x183e4b,null))['catch'](handleError(_0x183e4b,null));};exports[_0x5f89('0x57')]=function(_0x4a6cb5,_0x124c88){return db['FaxAccount'][_0x5f89('0x57')](_0x4a6cb5['body'],{})['then'](function(_0x4a0cdc){var _0x34a8ff=_0x4a6cb5[_0x5f89('0x58')][_0x5f89('0x35')]({'plain':!![]});if(!_0x34a8ff)throw new Error(_0x5f89('0x59'));if(_0x34a8ff['role']===_0x5f89('0x58')){var _0x25f0b6=_0x4a0cdc['get']({'plain':!![]});var _0x51554c='FaxAccounts';return db['UserProfileSection'][_0x5f89('0x56')]({'where':{'name':_0x51554c,'userProfileId':_0x34a8ff[_0x5f89('0x5a')]},'raw':!![]})[_0x5f89('0x1f')](function(_0x4a3b1c){if(_0x4a3b1c&&_0x4a3b1c[_0x5f89('0x5b')]===0x0){return db[_0x5f89('0x5c')][_0x5f89('0x57')]({'name':_0x25f0b6['name'],'resourceId':_0x25f0b6['id'],'type':_0x4a3b1c[_0x5f89('0x38')],'sectionId':_0x4a3b1c['id']},{})[_0x5f89('0x1f')](function(){return _0x4a0cdc;});}else{return _0x4a0cdc;}})['catch'](function(_0x18f2b7){logger[_0x5f89('0x24')](_0x5f89('0x5d'),_0x18f2b7);throw _0x18f2b7;});}return _0x4a0cdc;})['then'](respondWithResult(_0x124c88,0xc9))[_0x5f89('0x28')](handleError(_0x124c88,null));};exports[_0x5f89('0x33')]=function(_0x4cd0bf,_0x5c7e32){if(_0x4cd0bf[_0x5f89('0x5e')]['id']){delete _0x4cd0bf['body']['id'];}return db[_0x5f89('0x3d')][_0x5f89('0x56')]({'where':{'id':_0x4cd0bf[_0x5f89('0x54')]['id']},'include':[{'model':db[_0x5f89('0x3a')],'as':_0x5f89('0x3b')}]})[_0x5f89('0x1f')](handleEntityNotFound(_0x5c7e32,null))[_0x5f89('0x1f')](saveUpdates(_0x4cd0bf[_0x5f89('0x5e')],null))[_0x5f89('0x1f')](respondWithResult(_0x5c7e32,null))[_0x5f89('0x28')](handleError(_0x5c7e32,null));};exports[_0x5f89('0x34')]=function(_0x5b1d7b,_0x50f95e){return db[_0x5f89('0x3d')]['find']({'where':{'id':_0x5b1d7b[_0x5f89('0x54')]['id']}})['then'](handleEntityNotFound(_0x50f95e,null))[_0x5f89('0x1f')](removeEntity(_0x50f95e,null))[_0x5f89('0x28')](handleError(_0x50f95e,null));};exports[_0x5f89('0x5f')]=function(_0x5e5f0c,_0x41ea7f){return db['FaxAccount'][_0x5f89('0x5f')]()[_0x5f89('0x1f')](respondWithResult(_0x41ea7f,null))[_0x5f89('0x28')](handleError(_0x41ea7f,null));};exports[_0x5f89('0x60')]=function(_0x40d808,_0x204bc8,_0x38314b){if(_0x40d808[_0x5f89('0x5e')]['id']){delete _0x40d808[_0x5f89('0x5e')]['id'];}return db[_0x5f89('0x3d')]['find']({'where':{'id':_0x40d808['params']['id']}})[_0x5f89('0x1f')](handleEntityNotFound(_0x204bc8,null))[_0x5f89('0x1f')](function(_0x1c8cbe){if(_0x1c8cbe){_0x40d808['body'][_0x5f89('0x61')]=_0x1c8cbe['id'];return db[_0x5f89('0x62')][_0x5f89('0x57')](_0x40d808[_0x5f89('0x5e')]);}})['then'](respondWithResult(_0x204bc8,null))['catch'](handleError(_0x204bc8,null));};exports[_0x5f89('0x63')]=function(_0x1363fc,_0x2f0226,_0x5b07ec){var _0x50baa8={'raw':![],'where':{}};var _0x3b1dd5={};var _0x22acd0={'count':0x0,'rows':[]};return db[_0x5f89('0x3d')][_0x5f89('0x64')]({'where':{'id':_0x1363fc['params']['id']}})[_0x5f89('0x1f')](handleEntityNotFound(_0x2f0226,null))[_0x5f89('0x1f')](function(_0x41ca11){if(_0x41ca11){_0x3b1dd5[_0x5f89('0x42')]=_[_0x5f89('0x44')](db['Disposition'][_0x5f89('0x3e')]);_0x3b1dd5[_0x5f89('0x43')]=_[_0x5f89('0x44')](_0x1363fc['query']);_0x3b1dd5[_0x5f89('0x45')]=_[_0x5f89('0x47')](_0x3b1dd5[_0x5f89('0x42')],_0x3b1dd5['query']);_0x50baa8['attributes']=_[_0x5f89('0x47')](_0x3b1dd5['model'],qs[_0x5f89('0x48')](_0x1363fc['query']['fields']));_0x50baa8[_0x5f89('0x46')]=_0x50baa8[_0x5f89('0x46')][_0x5f89('0x49')]?_0x50baa8['attributes']:_0x3b1dd5[_0x5f89('0x42')];if(!_0x1363fc[_0x5f89('0x43')][_0x5f89('0x4a')](_0x5f89('0x65'))){_0x50baa8[_0x5f89('0x2f')]=qs[_0x5f89('0x2f')](_0x1363fc[_0x5f89('0x43')]['limit']);_0x50baa8[_0x5f89('0x2d')]=qs[_0x5f89('0x2d')](_0x1363fc[_0x5f89('0x43')][_0x5f89('0x2d')]);}_0x50baa8[_0x5f89('0x66')]=qs[_0x5f89('0x4b')](_0x1363fc['query'][_0x5f89('0x4b')]);_0x50baa8[_0x5f89('0x4c')]=qs[_0x5f89('0x45')](_[_0x5f89('0x4d')](_0x1363fc[_0x5f89('0x43')],_0x3b1dd5[_0x5f89('0x45')]));_0x50baa8['where'][_0x5f89('0x61')]=_0x41ca11['id'];if(_0x1363fc['query'][_0x5f89('0x4e')]){_0x50baa8[_0x5f89('0x4c')]=_[_0x5f89('0x4f')](_0x50baa8[_0x5f89('0x4c')],{'$or':_['map'](_0x50baa8[_0x5f89('0x46')],function(_0x12c119){var _0x207f93={};_0x207f93[_0x12c119]={'$like':'%'+_0x1363fc[_0x5f89('0x43')]['filter']+'%'};return _0x207f93;})});}_0x50baa8=_[_0x5f89('0x4f')]({},_0x50baa8,_0x1363fc['options']);return db[_0x5f89('0x62')][_0x5f89('0x30')]({'where':_0x50baa8['where']})[_0x5f89('0x1f')](function(_0x3cd2d6){_0x22acd0[_0x5f89('0x30')]=_0x3cd2d6;if(_0x1363fc[_0x5f89('0x43')][_0x5f89('0x55')]){_0x50baa8[_0x5f89('0x51')]=[{'all':!![]}];}return db[_0x5f89('0x62')]['findAll'](_0x50baa8);})[_0x5f89('0x1f')](function(_0x4ef783){_0x22acd0[_0x5f89('0x67')]=_0x4ef783;return _0x22acd0;});}})['then'](respondWithFilteredResult(_0x2f0226,_0x50baa8))[_0x5f89('0x28')](handleError(_0x2f0226,null));};exports[_0x5f89('0x68')]=function(_0xe2150f,_0x292fea,_0xecb058){return db[_0x5f89('0x3d')][_0x5f89('0x56')]({'where':{'id':_0xe2150f[_0x5f89('0x54')]['id']}})['then'](handleEntityNotFound(_0x292fea,null))[_0x5f89('0x1f')](function(_0x24f33a){if(_0x24f33a){return _0x24f33a['removeDispositions'](_0xe2150f['query'][_0x5f89('0x69')]);}})[_0x5f89('0x1f')](respondWithStatusCode(_0x292fea,null))[_0x5f89('0x28')](handleError(_0x292fea,null));};exports[_0x5f89('0x6a')]=function(_0x36256e,_0x329c3e,_0x84f709){if(_0x36256e[_0x5f89('0x5e')]['id']){delete _0x36256e['body']['id'];}return db[_0x5f89('0x3d')][_0x5f89('0x56')]({'where':{'id':_0x36256e[_0x5f89('0x54')]['id']}})[_0x5f89('0x1f')](handleEntityNotFound(_0x329c3e,null))[_0x5f89('0x1f')](function(_0x561c5f){if(_0x561c5f){_0x36256e[_0x5f89('0x5e')][_0x5f89('0x61')]=_0x561c5f['id'];return db[_0x5f89('0x6b')]['create'](_0x36256e[_0x5f89('0x5e')]);}})['then'](respondWithResult(_0x329c3e,null))[_0x5f89('0x28')](handleError(_0x329c3e,null));};exports[_0x5f89('0x6c')]=function(_0x39b16e,_0x44f712,_0xfcfe8d){var _0x507b0c={'raw':![],'where':{}};var _0x102ed2={};var _0x34e12c={'count':0x0,'rows':[]};return db[_0x5f89('0x3d')]['findOne']({'where':{'id':_0x39b16e[_0x5f89('0x54')]['id']}})[_0x5f89('0x1f')](handleEntityNotFound(_0x44f712,null))[_0x5f89('0x1f')](function(_0x5ca31e){if(_0x5ca31e){_0x102ed2[_0x5f89('0x42')]=_[_0x5f89('0x44')](db[_0x5f89('0x6b')][_0x5f89('0x3e')]);_0x102ed2[_0x5f89('0x43')]=_[_0x5f89('0x44')](_0x39b16e[_0x5f89('0x43')]);_0x102ed2[_0x5f89('0x45')]=_[_0x5f89('0x47')](_0x102ed2[_0x5f89('0x42')],_0x102ed2[_0x5f89('0x43')]);_0x507b0c[_0x5f89('0x46')]=_['intersection'](_0x102ed2['model'],qs[_0x5f89('0x48')](_0x39b16e[_0x5f89('0x43')][_0x5f89('0x48')]));_0x507b0c['attributes']=_0x507b0c[_0x5f89('0x46')][_0x5f89('0x49')]?_0x507b0c[_0x5f89('0x46')]:_0x102ed2['model'];if(!_0x39b16e[_0x5f89('0x43')]['hasOwnProperty'](_0x5f89('0x65'))){_0x507b0c[_0x5f89('0x2f')]=qs['limit'](_0x39b16e[_0x5f89('0x43')][_0x5f89('0x2f')]);_0x507b0c[_0x5f89('0x2d')]=qs[_0x5f89('0x2d')](_0x39b16e[_0x5f89('0x43')][_0x5f89('0x2d')]);}_0x507b0c['order']=qs[_0x5f89('0x4b')](_0x39b16e[_0x5f89('0x43')][_0x5f89('0x4b')]);_0x507b0c['where']=qs[_0x5f89('0x45')](_[_0x5f89('0x4d')](_0x39b16e[_0x5f89('0x43')],_0x102ed2[_0x5f89('0x45')]));_0x507b0c[_0x5f89('0x4c')][_0x5f89('0x61')]=_0x5ca31e['id'];if(_0x39b16e[_0x5f89('0x43')][_0x5f89('0x4e')]){_0x507b0c[_0x5f89('0x4c')]=_[_0x5f89('0x4f')](_0x507b0c['where'],{'$or':_[_0x5f89('0x3c')](_0x507b0c['attributes'],function(_0x4bb875){var _0x1d0452={};_0x1d0452[_0x4bb875]={'$like':'%'+_0x39b16e[_0x5f89('0x43')]['filter']+'%'};return _0x1d0452;})});}_0x507b0c=_[_0x5f89('0x4f')]({},_0x507b0c,_0x39b16e[_0x5f89('0x50')]);return db['CannedAnswer']['count']({'where':_0x507b0c[_0x5f89('0x4c')]})[_0x5f89('0x1f')](function(_0x431142){_0x34e12c['count']=_0x431142;if(_0x39b16e[_0x5f89('0x43')][_0x5f89('0x55')]){_0x507b0c[_0x5f89('0x51')]=[{'all':!![]}];}return db[_0x5f89('0x6b')]['findAll'](_0x507b0c);})[_0x5f89('0x1f')](function(_0x13e76f){_0x34e12c[_0x5f89('0x67')]=_0x13e76f;return _0x34e12c;});}})[_0x5f89('0x1f')](respondWithFilteredResult(_0x44f712,_0x507b0c))[_0x5f89('0x28')](handleError(_0x44f712,null));};exports['removeAnswers']=function(_0x59b359,_0x56f2a6,_0x15b455){return db['FaxAccount'][_0x5f89('0x56')]({'where':{'id':_0x59b359[_0x5f89('0x54')]['id']}})[_0x5f89('0x1f')](handleEntityNotFound(_0x56f2a6,null))['then'](function(_0x2ec4f5){if(_0x2ec4f5){return _0x2ec4f5[_0x5f89('0x6d')](_0x59b359[_0x5f89('0x43')]['ids']);}})['then'](respondWithStatusCode(_0x56f2a6,null))[_0x5f89('0x28')](handleError(_0x56f2a6,null));};exports[_0x5f89('0x6e')]=function(_0x181b63,_0x1e3965,_0x5184e2){return db[_0x5f89('0x6f')][_0x5f89('0x56')]({'where':{'id':_0x181b63[_0x5f89('0x54')]['id']}})['then'](handleEntityNotFound(_0x1e3965,null))[_0x5f89('0x1f')](function(_0x40c238){if(_0x40c238){return _0x40c238[_0x5f89('0x6e')](_0x181b63[_0x5f89('0x5e')][_0x5f89('0x69')],_[_0x5f89('0x70')](_0x181b63[_0x5f89('0x5e')],['ids','id'])||{});}})[_0x5f89('0x1f')](respondWithResult(_0x1e3965,null))[_0x5f89('0x28')](handleError(_0x1e3965,null));};exports[_0x5f89('0x71')]=function(_0xed5726,_0x17a9ef,_0x411435){var _0x42b10e={'raw':![],'where':{}};var _0x8b2364={};var _0x3b9296={'count':0x0,'rows':[]};return db[_0x5f89('0x3d')][_0x5f89('0x64')]({'where':{'id':_0xed5726['params']['id']}})[_0x5f89('0x1f')](handleEntityNotFound(_0x17a9ef,null))['then'](function(_0x93df8){if(_0x93df8){_0x8b2364['model']=_[_0x5f89('0x44')](db['FaxInteraction'][_0x5f89('0x3e')]);_0x8b2364[_0x5f89('0x43')]=_['keys'](_0xed5726['query']);_0x8b2364['filters']=_[_0x5f89('0x47')](_0x8b2364['model'],_0x8b2364[_0x5f89('0x43')]);_0x42b10e[_0x5f89('0x46')]=_[_0x5f89('0x47')](_0x8b2364[_0x5f89('0x42')],qs[_0x5f89('0x48')](_0xed5726[_0x5f89('0x43')]['fields']));_0x42b10e[_0x5f89('0x46')]=_0x42b10e[_0x5f89('0x46')][_0x5f89('0x49')]?_0x42b10e[_0x5f89('0x46')]:_0x8b2364['model'];if(!_0xed5726[_0x5f89('0x43')]['hasOwnProperty']('nolimit')){_0x42b10e[_0x5f89('0x2f')]=qs[_0x5f89('0x2f')](_0xed5726['query'][_0x5f89('0x2f')]);_0x42b10e[_0x5f89('0x2d')]=qs[_0x5f89('0x2d')](_0xed5726[_0x5f89('0x43')][_0x5f89('0x2d')]);}_0x42b10e[_0x5f89('0x66')]=qs[_0x5f89('0x4b')](_0xed5726[_0x5f89('0x43')]['sort']);_0x42b10e[_0x5f89('0x4c')]=qs['filters'](_[_0x5f89('0x4d')](_0xed5726[_0x5f89('0x43')],_0x8b2364['filters']));_0x42b10e[_0x5f89('0x4c')][_0x5f89('0x61')]=_0x93df8['id'];if(_0xed5726[_0x5f89('0x43')][_0x5f89('0x4e')]){_0x42b10e['where']=_[_0x5f89('0x4f')](_0x42b10e[_0x5f89('0x4c')],{'$or':_[_0x5f89('0x3c')](_0x42b10e['attributes'],function(_0xa4bfac){var _0x41f3e8={};_0x41f3e8[_0xa4bfac]={'$like':'%'+_0xed5726[_0x5f89('0x43')][_0x5f89('0x4e')]+'%'};return _0x41f3e8;})});}_0x42b10e=_['merge']({},_0x42b10e,_0xed5726['options']);return db[_0x5f89('0x6f')][_0x5f89('0x30')]({'where':_0x42b10e[_0x5f89('0x4c')]})['then'](function(_0x47eecc){_0x3b9296['count']=_0x47eecc;if(_0xed5726['query'][_0x5f89('0x55')]){_0x42b10e[_0x5f89('0x51')]=[{'model':db[_0x5f89('0x72')],'as':_0x5f89('0x73'),'required':![]},{'model':db[_0x5f89('0x74')],'as':_0x5f89('0x75'),'attributes':['name',_0x5f89('0x76'),_0x5f89('0x77')],'required':![]},{'model':db[_0x5f89('0x78')],'as':'Tags','attributes':['id',_0x5f89('0x38'),'color'],'where':_0xed5726[_0x5f89('0x43')][_0x5f89('0x79')]?{'id':_0xed5726[_0x5f89('0x43')][_0x5f89('0x79')]}:undefined,'required':_0xed5726[_0x5f89('0x43')][_0x5f89('0x79')]?!![]:![]}];}return db[_0x5f89('0x6f')]['findAll'](_0x42b10e);})['then'](function(_0x48913f){_0x3b9296['rows']=_0x48913f;return _0x3b9296;});}})[_0x5f89('0x1f')](respondWithFilteredResult(_0x17a9ef,_0x42b10e))[_0x5f89('0x28')](handleError(_0x17a9ef,null));};exports[_0x5f89('0x7a')]=function(_0x368641,_0x4ed955,_0x244214){return db[_0x5f89('0x3d')][_0x5f89('0x64')]({'where':{'id':_0x368641[_0x5f89('0x54')]['id']}})[_0x5f89('0x1f')](handleEntityNotFound(_0x4ed955,null))[_0x5f89('0x1f')](function(_0xbf8b1a){if(_0xbf8b1a){return db[_0x5f89('0x7b')][_0x5f89('0x7c')](function(_0x4882b9){return db[_0x5f89('0x7d')]['destroy']({'where':{'FaxAccountId':_0x368641['params']['id']},'transaction':_0x4882b9})['then'](function(_0x471f5e){var _0x259c26=_[_0x5f89('0x3c')](_0x368641[_0x5f89('0x5e')],function(_0x262f70){_0x262f70[_0x5f89('0x61')]=_0x368641[_0x5f89('0x54')]['id'];return _0x262f70;});return db[_0x5f89('0x7d')][_0x5f89('0x7e')](_0x259c26,{'transaction':_0x4882b9});});})['then'](function(){return db[_0x5f89('0x7d')][_0x5f89('0x7f')]({'where':{'FaxAccountId':_0x368641['params']['id']},'order':_0x5f89('0x80')});});}})['then'](respondWithResult(_0x4ed955,null))[_0x5f89('0x28')](handleError(_0x4ed955,null));};exports[_0x5f89('0x81')]=function(_0x39fd08,_0x59e35d,_0x2d9b76){var _0x3f02b8={};var _0x531146={};var _0x5531c6;var _0x3513d0;return db[_0x5f89('0x3d')]['findOne']({'where':{'id':_0x39fd08['params']['id']}})[_0x5f89('0x1f')](handleEntityNotFound(_0x59e35d,null))[_0x5f89('0x1f')](function(_0x2c49d3){if(_0x2c49d3){_0x5531c6=_0x2c49d3;_0x531146[_0x5f89('0x42')]=_['keys'](db[_0x5f89('0x7d')][_0x5f89('0x3e')]);_0x531146['query']=_['keys'](_0x39fd08['query']);_0x531146[_0x5f89('0x45')]=_[_0x5f89('0x47')](_0x531146[_0x5f89('0x42')],_0x531146[_0x5f89('0x43')]);_0x3f02b8[_0x5f89('0x46')]=_[_0x5f89('0x47')](_0x531146['model'],qs[_0x5f89('0x48')](_0x39fd08[_0x5f89('0x43')][_0x5f89('0x48')]));_0x3f02b8['attributes']=_0x3f02b8['attributes'][_0x5f89('0x49')]?_0x3f02b8[_0x5f89('0x46')]:_0x531146[_0x5f89('0x42')];_0x3f02b8['order']=qs['sort'](_0x39fd08[_0x5f89('0x43')][_0x5f89('0x4b')]);_0x3f02b8[_0x5f89('0x4c')]=qs[_0x5f89('0x45')](_[_0x5f89('0x4d')](_0x39fd08['query'],_0x531146[_0x5f89('0x45')]));if(_0x39fd08[_0x5f89('0x43')][_0x5f89('0x4e')]){_0x3f02b8[_0x5f89('0x4c')]=_[_0x5f89('0x4f')](_0x3f02b8[_0x5f89('0x4c')],{'$or':_[_0x5f89('0x3c')](_0x3f02b8[_0x5f89('0x46')],function(_0x226c87){var _0x7f6d63={};_0x7f6d63[_0x226c87]={'$like':'%'+_0x39fd08[_0x5f89('0x43')][_0x5f89('0x4e')]+'%'};return _0x7f6d63;})});}_0x3f02b8=_['merge']({},_0x3f02b8,_0x39fd08['options']);return _0x5531c6['getApplications'](_0x3f02b8);}})[_0x5f89('0x1f')](function(_0x268902){if(_0x268902){_0x3513d0=_0x268902[_0x5f89('0x49')];if(!_0x39fd08[_0x5f89('0x43')]['hasOwnProperty']('nolimit')){_0x3f02b8[_0x5f89('0x2f')]=qs['limit'](_0x39fd08[_0x5f89('0x43')][_0x5f89('0x2f')]);_0x3f02b8[_0x5f89('0x2d')]=qs[_0x5f89('0x2d')](_0x39fd08[_0x5f89('0x43')][_0x5f89('0x2d')]);}return _0x5531c6[_0x5f89('0x81')](_0x3f02b8);}})[_0x5f89('0x1f')](function(_0x24f648){if(_0x24f648){return _0x24f648?{'count':_0x3513d0,'rows':_0x24f648}:null;}})['then'](respondWithResult(_0x59e35d,null))[_0x5f89('0x28')](handleError(_0x59e35d,null));};function Extension(_0x55968b,_0x4c6e81,_0x41657c,_0x559cdd){this[_0x5f89('0x82')]='from-voip-provider';this[_0x5f89('0x83')]=_0x55968b[_0x5f89('0x84')];this[_0x5f89('0x85')]=_0x559cdd;this[_0x5f89('0x40')]=_0x5f89('0x86');this[_0x5f89('0x87')]=_0x5f89('0x88');this[_0x5f89('0x61')]=_0x55968b['id'];this['priority']=_0x4c6e81;this['appdata']=_0x41657c;}function createExtensionsReciveFax(_0x3cf638){var _0x367479=0x1;var _0xce929e=[];_0xce929e[_0x5f89('0x89')](new Extension(_0x3cf638,_0x367479,'',_0x5f89('0x8a')));_0x367479+=0x1;_0xce929e[_0x5f89('0x89')](new Extension(_0x3cf638,_0x367479,_0x5f89('0x8b'),_0x5f89('0x8c')));_0x367479+=0x1;for(var _0x535baf in _0x3cf638){if(_0x3cf638[_0x5f89('0x4a')](_0x535baf)&&(_0x535baf==='ecm'||_0x535baf==='localstationid'||_0x535baf==='gateway'||_0x535baf===_0x5f89('0x8d')||_0x535baf===_0x5f89('0x8e')||_0x535baf===_0x5f89('0x8f')||_0x535baf===_0x5f89('0x90')||_0x535baf===_0x5f89('0x91')||_0x535baf==='t38timeout')){_0xce929e[_0x5f89('0x89')](new Extension(_0x3cf638,_0x367479,_0x5f89('0x92')+_0x535baf+')='+_0x3cf638[_0x535baf],_0x5f89('0x8c')));_0x367479+=0x1;}}_0xce929e[_0x5f89('0x89')](new Extension(_0x3cf638,_0x367479,'6',_0x5f89('0x93')));_0x367479+=0x1;_0xce929e[_0x5f89('0x89')](new Extension(_0x3cf638,_0x367479,'/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',_0x5f89('0x94')));_0x367479=0x0;return _0xce929e;}exports[_0x5f89('0x95')]=function(_0x26fc12,_0x225aaf,_0x55ba80){var _0x587aae;return db['sequelize'][_0x5f89('0x7c')](function(_0x56d475){return db[_0x5f89('0x3d')][_0x5f89('0x57')](_0x26fc12[_0x5f89('0x5e')],{'transaction':_0x56d475})[_0x5f89('0x1f')](function(_0x4136d6){_0x587aae=_0x4136d6[_0x5f89('0x35')]({'plain':!![]});return db['VoiceExtension'][_0x5f89('0x7e')](createExtensionsReciveFax(_0x587aae),{'transaction':_0x56d475});});})[_0x5f89('0x1f')](function(){return _0x587aae;})[_0x5f89('0x1f')](respondWithResult(_0x225aaf,null))[_0x5f89('0x28')](handleError(_0x225aaf,null));};exports[_0x5f89('0x96')]=function(_0x5842b4,_0x2d42aa,_0x4f3497){var _0x20399c;return db[_0x5f89('0x7b')][_0x5f89('0x7c')](function(_0x2a7509){return db[_0x5f89('0x3d')][_0x5f89('0x33')](_0x5842b4[_0x5f89('0x5e')],{'where':{'id':_0x5842b4[_0x5f89('0x5e')]['id']},'transaction':_0x2a7509})[_0x5f89('0x1f')](function(_0x51fcee){return db[_0x5f89('0x97')][_0x5f89('0x34')]({'where':{'FaxAccountId':_0x5842b4['body']['id']},'transaction':_0x2a7509})['then'](function(_0x285a7e){return db[_0x5f89('0x97')][_0x5f89('0x7e')](createExtensionsReciveFax(_['omit'](_0x5842b4[_0x5f89('0x5e')],[_0x5f89('0x98'),'key','createdAt',_0x5f89('0x99'),_0x5f89('0x9a'),_0x5f89('0x9b')])),{'transaction':_0x2a7509});});});})[_0x5f89('0x1f')](function(){return db[_0x5f89('0x3d')][_0x5f89('0x9c')](_0x5842b4[_0x5f89('0x5e')]['id']);})['then'](respondWithResult(_0x2d42aa,null))[_0x5f89('0x28')](handleError(_0x2d42aa,null));};exports[_0x5f89('0x9d')]=function(_0x6a02b7,_0x4fe53b,_0x481960){var _0x4628c9={'raw':!![],'where':{}};var _0x1ebb1d={};var _0x124a9a={'count':0x0,'rows':[]};return db[_0x5f89('0x3d')][_0x5f89('0x64')]({'where':{'id':_0x6a02b7[_0x5f89('0x54')]['id']}})[_0x5f89('0x1f')](handleEntityNotFound(_0x4fe53b,null))[_0x5f89('0x1f')](function(_0xdd6789){if(_0xdd6789){_0x1ebb1d['model']=_[_0x5f89('0x44')](db[_0x5f89('0x9e')]['rawAttributes']);_0x1ebb1d['query']=_[_0x5f89('0x44')](_0x6a02b7['query']);_0x1ebb1d[_0x5f89('0x45')]=_[_0x5f89('0x47')](_0x1ebb1d[_0x5f89('0x42')],_0x1ebb1d[_0x5f89('0x43')]);_0x4628c9[_0x5f89('0x46')]=_[_0x5f89('0x47')](_0x1ebb1d[_0x5f89('0x42')],qs[_0x5f89('0x48')](_0x6a02b7[_0x5f89('0x43')][_0x5f89('0x48')]));_0x4628c9[_0x5f89('0x46')]=_0x4628c9[_0x5f89('0x46')][_0x5f89('0x49')]?_0x4628c9['attributes']:_0x1ebb1d[_0x5f89('0x42')];if(!_0x6a02b7['query'][_0x5f89('0x4a')](_0x5f89('0x65'))){_0x4628c9[_0x5f89('0x2f')]=qs[_0x5f89('0x2f')](_0x6a02b7[_0x5f89('0x43')][_0x5f89('0x2f')]);_0x4628c9['offset']=qs[_0x5f89('0x2d')](_0x6a02b7[_0x5f89('0x43')][_0x5f89('0x2d')]);}_0x4628c9[_0x5f89('0x66')]=qs[_0x5f89('0x4b')](_0x6a02b7[_0x5f89('0x43')][_0x5f89('0x4b')]);_0x4628c9[_0x5f89('0x4c')]=qs['filters'](_[_0x5f89('0x4d')](_0x6a02b7[_0x5f89('0x43')],_0x1ebb1d[_0x5f89('0x45')]));_0x4628c9[_0x5f89('0x4c')][_0x5f89('0x61')]=_0xdd6789['id'];if(_0x6a02b7[_0x5f89('0x43')][_0x5f89('0x4e')]){_0x4628c9[_0x5f89('0x4c')]=_[_0x5f89('0x4f')](_0x4628c9[_0x5f89('0x4c')],{'$or':_[_0x5f89('0x3c')](_0x4628c9['attributes'],function(_0x916127){var _0x340814={};_0x340814[_0x916127]={'$like':'%'+_0x6a02b7[_0x5f89('0x43')][_0x5f89('0x4e')]+'%'};return _0x340814;})});}if(_0x6a02b7[_0x5f89('0x43')]['$gte']){var _0x158e5b=_0x6a02b7[_0x5f89('0x43')][_0x5f89('0x9f')]['split'](',');var _0x557550={};_0x557550[_0x158e5b[0x0]]={'$gte':moment(_0x158e5b[0x1])[_0x5f89('0xa0')](_0x5f89('0xa1'))};_0x4628c9['where']=_['merge'](_0x4628c9[_0x5f89('0x4c')],_0x557550);}_0x4628c9=_[_0x5f89('0x4f')]({},_0x4628c9,_0x6a02b7[_0x5f89('0x50')]);return db[_0x5f89('0x9e')][_0x5f89('0x30')]({'where':_0x4628c9['where']})['then'](function(_0x3b60a6){_0x124a9a['count']=_0x3b60a6;if(_0x6a02b7[_0x5f89('0x43')][_0x5f89('0x55')]){_0x4628c9['include']=[{'all':!![]}];}return db[_0x5f89('0x9e')][_0x5f89('0x52')](_0x4628c9);})['then'](function(_0xdb3fbc){_0x124a9a[_0x5f89('0x67')]=_0xdb3fbc;return _0x124a9a;});}})[_0x5f89('0x1f')](respondWithFilteredResult(_0x4fe53b,_0x4628c9))['catch'](handleError(_0x4fe53b,null));};exports[_0x5f89('0x39')]=function(_0x515c4f,_0x4cf072,_0x418008){var _0x628755,_0x3b2c5d={},_0x3aed08;if(_0x515c4f['body']['to']){_0x3aed08=_0x515c4f[_0x5f89('0x5e')]['to'][0x0];}return db[_0x5f89('0x3d')][_0x5f89('0x56')]({'where':{'id':_0x515c4f[_0x5f89('0x54')]['id']},'include':[{'model':db['CmList'],'as':_0x5f89('0xa2'),'include':[{'model':db[_0x5f89('0x72')],'as':'Contacts','where':{'fax':_0x3aed08},'limit':0x1,'order':[[_0x5f89('0x99'),_0x5f89('0xa3')]]}]}]})['then'](handleEntityNotFound(_0x4cf072,null))[_0x5f89('0x1f')](function(_0x11c7da){_0x628755=_0x11c7da;if(_0x515c4f['body'][_0x5f89('0xa4')]&&_0x515c4f['body']['attachments'][_0x5f89('0x49')]){for(var _0x3888b1=0x0;_0x3888b1<_0x515c4f[_0x5f89('0x5e')][_0x5f89('0xa4')][_0x5f89('0x49')];_0x3888b1+=0x1){_0x515c4f['body']['attachments'][_0x3888b1]={'filename':_0x515c4f['body']['attachments'][_0x3888b1][_0x5f89('0x38')],'id':_0x515c4f[_0x5f89('0x5e')][_0x5f89('0xa4')][_0x3888b1]['id'],'path':path[_0x5f89('0xa5')](config[_0x5f89('0xa6')],_0x5f89('0xa7'),_0x515c4f[_0x5f89('0x5e')][_0x5f89('0xa4')][_0x3888b1][_0x5f89('0xa8')])};}}return respondWithRpcPromise(_0x5f89('0xa9'),'CheckAfterSend',{'FaxAccountId':_['isNil'](_0x515c4f[_0x5f89('0x54')]['id'])?undefined:_0x515c4f['params']['id'],'path':_[_0x5f89('0xaa')](_0x515c4f[_0x5f89('0x5e')]['attachments'][0x0][_0x5f89('0x7')])?undefined:_0x515c4f[_0x5f89('0x5e')][_0x5f89('0xa4')][0x0][_0x5f89('0x7')],'fax':_[_0x5f89('0xaa')](_0x515c4f[_0x5f89('0x5e')]['to'][0x0])?undefined:_0x515c4f['body']['to'][0x0]},client9002);})[_0x5f89('0x1f')](function(){if(_0x628755){if(_['isNil'](_0x515c4f[_0x5f89('0x5e')][_0x5f89('0xab')])){_0x515c4f[_0x5f89('0x5e')][_0x5f89('0xab')]=util['format']('\x22%s\x22\x20<%s>',_0x628755[_0x5f89('0x38')],_0x628755[_0x5f89('0xac')]);}if(_0x628755['List']){if(_0x628755[_0x5f89('0xa2')]['Contacts'][_0x5f89('0x49')]){return _0x628755[_0x5f89('0xa2')][_0x5f89('0xad')][0x0];}else{return db['CmContact'][_0x5f89('0x57')](_[_0x5f89('0xae')](_0x515c4f['body'],{'firstName':_0x515c4f[_0x5f89('0x5e')]['to'][0x0],'phone':_0x515c4f[_0x5f89('0x5e')]['to'][0x0],'fax':_0x515c4f['body']['to'][0x0],'ListId':_0x628755['ListId']}));}}else{throw new Error(_0x5f89('0xaf'));}}else{throw new Error(_0x5f89('0xb0'));}})[_0x5f89('0x1f')](function(_0xabd29e){if(_0xabd29e){return db[_0x5f89('0x6f')]['find']({'where':{'ContactId':_0xabd29e['id'],'closed':![],'FaxAccountId':_0x628755['id']}})['then'](function(_0x43bc19){if(_0x43bc19){return[_0x43bc19,![]];}return db['FaxInteraction']['create']({'UserId':_0x515c4f[_0x5f89('0x58')]['id'],'ContactId':_0xabd29e['id'],'FaxAccountId':_0x628755['id'],'fax':_0x515c4f['body']['to'][0x0],'firstMsgDirection':'out','Messages':[_['merge'](_0x515c4f[_0x5f89('0x5e')],{'read':![],'body':_0x515c4f['body']['attachments'][0x0][_0x5f89('0xb1')],'FaxAccountId':_0x628755['id'],'UserId':_0x515c4f[_0x5f89('0x58')]['id'],'ContactId':_0xabd29e['id'],'AttachmentId':_0x515c4f[_0x5f89('0x5e')][_0x5f89('0xa4')][0x0]['id']})]},{'include':[{'model':db[_0x5f89('0x9e')],'as':_0x5f89('0xb2')}]})[_0x5f89('0x1f')](function(_0x336e5){return[_0x336e5,!![]];});});}else{throw new Error('Contact\x20not\x20found');}})['spread'](function(_0x2835bc,_0x30841c){if(_0x30841c){return _0x2835bc;}return db[_0x5f89('0x9e')][_0x5f89('0x57')]({'direction':_0x5f89('0xb3'),'read':![],'body':_0x515c4f[_0x5f89('0x5e')][_0x5f89('0xa4')][0x0][_0x5f89('0xb1')],'FaxAccountId':_0x628755['id'],'FaxInteractionId':_0x2835bc['id'],'UserId':_0x515c4f[_0x5f89('0x58')]['id'],'ContactId':_0x2835bc[_0x5f89('0xb4')],'AttachmentId':_0x515c4f[_0x5f89('0x5e')]['attachments'][0x0]['id']})[_0x5f89('0x1f')](function(_0x485ee8){_0x2835bc['dataValues'][_0x5f89('0xb2')]=[];_0x2835bc[_0x5f89('0xb5')][_0x5f89('0xb2')][_0x5f89('0x89')](_0x485ee8[_0x5f89('0xb5')]);return _0x2835bc;});})[_0x5f89('0x1f')](function(_0x184359){respondWithRpcPromise('SendFax',_0x5f89('0xb6'),{'FaxAccountId':_[_0x5f89('0xaa')](_0x515c4f[_0x5f89('0x54')]['id'])?undefined:_0x515c4f[_0x5f89('0x54')]['id'],'path':_[_0x5f89('0xaa')](_0x515c4f['body']['attachments'][0x0]['path'])?undefined:_0x515c4f[_0x5f89('0x5e')][_0x5f89('0xa4')][0x0]['path'],'fax':_['isNil'](_0x515c4f[_0x5f89('0x5e')]['to'][0x0])?undefined:_0x515c4f[_0x5f89('0x5e')]['to'][0x0],'AttachmentId':_0x515c4f['body']['attachments'][0x0]['id']},client9002)[_0x5f89('0x1f')](function(_0x12ab3e){logger['info'](_0x5f89('0xb7'),_0x12ab3e);})['catch'](function(_0x3adc08){logger[_0x5f89('0xb8')](_0x5f89('0xb7'),_0x3adc08);});return _0x184359;})[_0x5f89('0x1f')](respondWithResult(_0x4cf072,null))[_0x5f89('0x28')](handleError(_0x4cf072,null));};exports[_0x5f89('0xb9')]=function(_0x138846,_0x1bd06d,_0x4de00a){return db[_0x5f89('0x3d')][_0x5f89('0x56')]({'where':{'id':_0x138846[_0x5f89('0x54')]['id']}})['then'](handleEntityNotFound(_0x1bd06d,null))[_0x5f89('0x1f')](function(_0x295ab3){if(_0x295ab3){return _0x295ab3[_0x5f89('0xb9')](_0x138846['body'][_0x5f89('0x69')],_[_0x5f89('0x70')](_0x138846['body'],[_0x5f89('0x69'),'id'])||{})[_0x5f89('0xba')](function(_0x41ad67){for(var _0x4270a3=0x0;_0x4270a3<_0x138846['body'][_0x5f89('0x69')][_0x5f89('0x49')];_0x4270a3+=0x1){socket[_0x5f89('0xbb')]('userFaxAccount:save',{'UserId':Number(_0x138846[_0x5f89('0x5e')][_0x5f89('0x69')][_0x4270a3]),'FaxAccountId':Number(_0x138846[_0x5f89('0x54')]['id'])});}return _0x41ad67;});}})['then'](respondWithResult(_0x1bd06d,null))[_0x5f89('0x28')](handleError(_0x1bd06d,null));};exports['removeAgents']=function(_0x2133d1,_0x2f9b0a,_0x112935){return db[_0x5f89('0x3d')][_0x5f89('0x56')]({'where':{'id':_0x2133d1['params']['id']}})[_0x5f89('0x1f')](handleEntityNotFound(_0x2f9b0a,null))['then'](function(_0x315711){if(_0x315711){return _0x315711[_0x5f89('0xbc')](_0x2133d1[_0x5f89('0x43')][_0x5f89('0x69')])[_0x5f89('0x1f')](function(){if(_[_0x5f89('0xbd')](_0x2133d1[_0x5f89('0x43')][_0x5f89('0x69')])){for(var _0x2fc10c=0x0;_0x2fc10c<_0x2133d1[_0x5f89('0x43')]['ids'][_0x5f89('0x49')];_0x2fc10c+=0x1){socket[_0x5f89('0xbb')](_0x5f89('0xbe'),{'UserId':Number(_0x2133d1['query'][_0x5f89('0x69')][_0x2fc10c]),'FaxAccountId':Number(_0x2133d1[_0x5f89('0x54')]['id'])});}}else{socket[_0x5f89('0xbb')](_0x5f89('0xbe'),{'UserId':Number(_0x2133d1[_0x5f89('0x43')][_0x5f89('0x69')]),'FaxAccountId':Number(_0x2133d1['params']['id'])});}});}})[_0x5f89('0x1f')](respondWithStatusCode(_0x2f9b0a,null))[_0x5f89('0x28')](handleError(_0x2f9b0a,null));};exports['getAgents']=function(_0x28ee1f,_0x498fe9,_0x533d1c){var _0x3beae9={};var _0x465055={};var _0x530373;var _0x33ed22;return db['FaxAccount'][_0x5f89('0x64')]({'where':{'id':_0x28ee1f[_0x5f89('0x54')]['id']}})[_0x5f89('0x1f')](handleEntityNotFound(_0x498fe9,null))['then'](function(_0x298c59){if(_0x298c59){_0x530373=_0x298c59;_0x465055[_0x5f89('0x42')]=_['keys'](db[_0x5f89('0x74')]['rawAttributes']);_0x465055[_0x5f89('0x43')]=_['keys'](_0x28ee1f[_0x5f89('0x43')]);_0x465055[_0x5f89('0x45')]=_[_0x5f89('0x47')](_0x465055[_0x5f89('0x42')],_0x465055[_0x5f89('0x43')]);_0x3beae9[_0x5f89('0x46')]=_[_0x5f89('0x47')](_0x465055[_0x5f89('0x42')],qs[_0x5f89('0x48')](_0x28ee1f[_0x5f89('0x43')]['fields']));_0x3beae9['attributes']=_0x3beae9['attributes']['length']?_0x3beae9[_0x5f89('0x46')]:_0x465055[_0x5f89('0x42')];_0x3beae9['order']=qs[_0x5f89('0x4b')](_0x28ee1f[_0x5f89('0x43')][_0x5f89('0x4b')]);_0x3beae9[_0x5f89('0x4c')]=qs[_0x5f89('0x45')](_[_0x5f89('0x4d')](_0x28ee1f[_0x5f89('0x43')],_0x465055[_0x5f89('0x45')]));if(_0x28ee1f[_0x5f89('0x43')][_0x5f89('0x4e')]){_0x3beae9[_0x5f89('0x4c')]=_['merge'](_0x3beae9['where'],{'$or':_['map'](_0x3beae9['attributes'],function(_0x5859b7){var _0xbc4a55={};_0xbc4a55[_0x5859b7]={'$like':'%'+_0x28ee1f[_0x5f89('0x43')][_0x5f89('0x4e')]+'%'};return _0xbc4a55;})});}_0x3beae9=_[_0x5f89('0x4f')]({},_0x3beae9,_0x28ee1f[_0x5f89('0x50')]);return _0x530373[_0x5f89('0xbf')](_0x3beae9);}})[_0x5f89('0x1f')](function(_0x14decf){if(_0x14decf){_0x33ed22=_0x14decf[_0x5f89('0x49')];if(!_0x28ee1f[_0x5f89('0x43')][_0x5f89('0x4a')]('nolimit')){_0x3beae9[_0x5f89('0x2f')]=qs[_0x5f89('0x2f')](_0x28ee1f[_0x5f89('0x43')]['limit']);_0x3beae9[_0x5f89('0x2d')]=qs[_0x5f89('0x2d')](_0x28ee1f['query'][_0x5f89('0x2d')]);}return _0x530373['getAgents'](_0x3beae9);}})[_0x5f89('0x1f')](function(_0x2bdf4f){if(_0x2bdf4f){return _0x2bdf4f?{'count':_0x33ed22,'rows':_0x2bdf4f}:null;}})[_0x5f89('0x1f')](respondWithResult(_0x498fe9,null))[_0x5f89('0x28')](handleError(_0x498fe9,null));}; \ No newline at end of file +var _0x5e72=['stringify','error','code','message','info','result','catch','status','offset','undefined','count','limit','set','json','reject','save','update','destroy','get','FaxAccounts','name','send','index','Pause','mandatoryDispositionPause','map','rawAttributes','fieldName','type','model','query','keys','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','VIRTUAL','filter','options','FaxAccount','includeAll','findAll','rows','show','params','intersection','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','Disposition','getDispositions','findOne','FaxAccountId','include','removeDispositions','CannedAnswer','getAnswers','removeAnswers','ids','addInteraction','FaxInteraction','omit','getInteractions','CmContact','Contact','fullname','internal','Tag','Tags','color','tag','sequelize','transaction','FaxApplication','bulkCreate','findAndCountAll','priority','getApplications','context','from-voip-provider','exten','localstationid','app','system','Fax\x20Extension','Answer','push','CDR(type)=inbound-fax','ecm','gateway','faxdetect','headerinfo','minrate','modem','t38timeout','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','addAccountApplications','VoiceExtension','updateAccountApplications','tech','key','createdAt','TrunkId','ListId','findById','getMessages','FaxMessage','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','CmList','List','Contacts','updatedAt','DESC','attachments','join','root','server/files/attachments','basename','CheckAfterSend','isNil','from','List\x20not\x20found','Send\x20Fax\x20failed','out','filename','Messages','Contact\x20not\x20found','spread','ContactId','dataValues','SendFax','SendFaxRpc,\x20%s','addAgents','emit','userFaxAccount:save','removeAgents','isArray','userFaxAccount:remove','getAgents','User','eml-format','rimraf','fast-json-patch','request-promise','util','path','to-csv','ejs','lodash','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','socket.io-emitter','redis','./faxAccount.socket','register','jayson/promise','http','client','then','FaxAccount,\x20%s,\x20%s','request\x20sent','FaxAccount,\x20%s,\x20%s,\x20%s'];(function(_0x173441,_0x26b0d9){var _0x2423a8=function(_0x4d96c2){while(--_0x4d96c2){_0x173441['push'](_0x173441['shift']());}};_0x2423a8(++_0x26b0d9);}(_0x5e72,0xa0));var _0x25e7=function(_0x2468b2,_0x3ac75f){_0x2468b2=_0x2468b2-0x0;var _0x1da24d=_0x5e72[_0x2468b2];return _0x1da24d;};'use strict';var emlformat=require(_0x25e7('0x0'));var rimraf=require(_0x25e7('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x25e7('0x2'));var rp=require(_0x25e7('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x25e7('0x4'));var path=require(_0x25e7('0x5'));var sox=require('sox');var csv=require(_0x25e7('0x6'));var ejs=require(_0x25e7('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x25e7('0x8'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x25e7('0x9'));var deskjs=require(_0x25e7('0xa'));var toCsv=require(_0x25e7('0x6'));var querystring=require(_0x25e7('0xb'));var Papa=require('papaparse');var Redis=require(_0x25e7('0xc'));var authService=require(_0x25e7('0xd'));var qs=require('../../components/parsers/qs');var as=require(_0x25e7('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x25e7('0xf'));var utils=require(_0x25e7('0x10'));var config=require(_0x25e7('0x11'));var licenseUtil=require(_0x25e7('0x12'));var db=require(_0x25e7('0x13'))['db'];config['redis']=_[_0x25e7('0x14')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x25e7('0x15'))(new Redis(config[_0x25e7('0x16')]));require(_0x25e7('0x17'))[_0x25e7('0x18')](socket);var jayson=require(_0x25e7('0x19'));var client=jayson['client'][_0x25e7('0x1a')]({'port':0x232c});var client9002=jayson[_0x25e7('0x1b')][_0x25e7('0x1a')]({'port':0x232a});function respondWithRpcPromise(_0x137632,_0x328860,_0x3aee9f,_0x10f279){return new BPromise(function(_0x2a58bd,_0x52d27d){var _0xc03278=_0x10f279||client;return _0xc03278['request'](_0x137632,_0x3aee9f)[_0x25e7('0x1c')](function(_0x23364d){logger['info'](_0x25e7('0x1d'),_0x328860,_0x25e7('0x1e'));logger['debug'](_0x25e7('0x1f'),_0x328860,_0x25e7('0x1e'),JSON[_0x25e7('0x20')](_0x23364d));if(_0x23364d[_0x25e7('0x21')]){if(_0x23364d[_0x25e7('0x21')][_0x25e7('0x22')]===0x1f4){logger[_0x25e7('0x21')](_0x25e7('0x1d'),_0x328860,_0x23364d[_0x25e7('0x21')][_0x25e7('0x23')]);return _0x52d27d(_0x23364d[_0x25e7('0x21')]['message']);}logger['error']('FaxAccount,\x20%s,\x20%s',_0x328860,_0x23364d['error']['message']);return _0x2a58bd(_0x23364d[_0x25e7('0x21')][_0x25e7('0x23')]);}else{logger[_0x25e7('0x24')](_0x25e7('0x1d'),_0x328860,'request\x20sent');_0x2a58bd(_0x23364d[_0x25e7('0x25')][_0x25e7('0x23')]);}})[_0x25e7('0x26')](function(_0x48a049){logger[_0x25e7('0x21')](_0x25e7('0x1d'),_0x328860,_0x48a049);_0x52d27d(_0x48a049);});});}function respondWithStatusCode(_0x9ca590,_0x2f248d){_0x2f248d=_0x2f248d||0xcc;return function(_0x36aad2){if(_0x36aad2){return _0x9ca590['sendStatus'](_0x2f248d);}return _0x9ca590[_0x25e7('0x27')](_0x2f248d)['end']();};}function respondWithResult(_0x17972e,_0x189b01){_0x189b01=_0x189b01||0xc8;return function(_0x3568bb){if(_0x3568bb){return _0x17972e[_0x25e7('0x27')](_0x189b01)['json'](_0x3568bb);}};}function respondWithFilteredResult(_0x41c45a,_0x58ee18){return function(_0x39da58){if(_0x39da58){var _0x12ebe0=typeof _0x58ee18[_0x25e7('0x28')]===_0x25e7('0x29')&&typeof _0x58ee18['limit']==='undefined';var _0x52797d=_0x39da58['count'];var _0x25b172=_0x12ebe0?0x0:_0x58ee18[_0x25e7('0x28')];var _0x4edb1e=_0x12ebe0?_0x39da58[_0x25e7('0x2a')]:_0x58ee18['offset']+_0x58ee18[_0x25e7('0x2b')];var _0x14b296;if(_0x4edb1e>=_0x52797d){_0x4edb1e=_0x52797d;_0x14b296=0xc8;}else{_0x14b296=0xce;}_0x41c45a['status'](_0x14b296);return _0x41c45a[_0x25e7('0x2c')]('Content-Range',_0x25b172+'-'+_0x4edb1e+'/'+_0x52797d)[_0x25e7('0x2d')](_0x39da58);}return null;};}function patchUpdates(_0x5e55e5){return function(_0x5ca155){try{jsonpatch['apply'](_0x5ca155,_0x5e55e5,!![]);}catch(_0x34b5cf){return BPromise[_0x25e7('0x2e')](_0x34b5cf);}return _0x5ca155[_0x25e7('0x2f')]();};}function saveUpdates(_0x5409f1,_0x77d9e0){return function(_0x255b26){if(_0x255b26){return _0x255b26[_0x25e7('0x30')](_0x5409f1)[_0x25e7('0x1c')](function(_0x81104a){return _0x81104a;});}return null;};}function removeEntity(_0x78b1a5,_0x5a4315){return function(_0x2e933a){if(_0x2e933a){return _0x2e933a[_0x25e7('0x31')]()['then'](function(){var _0x52b95e=_0x2e933a[_0x25e7('0x32')]({'plain':!![]});var _0x181c2e=_0x25e7('0x33');return db['UserProfileResource'][_0x25e7('0x31')]({'where':{'type':_0x181c2e,'resourceId':_0x52b95e['id']}})[_0x25e7('0x1c')](function(){return _0x2e933a;});})['then'](function(){_0x78b1a5['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1f4068,_0x2909fb){return function(_0x4dfe94){if(!_0x4dfe94){_0x1f4068['sendStatus'](0x194);}return _0x4dfe94;};}function handleError(_0xb7c564,_0x55eeaf){_0x55eeaf=_0x55eeaf||0x1f4;return function(_0x2a832d){logger[_0x25e7('0x21')](_0x2a832d['stack']);if(_0x2a832d['name']){delete _0x2a832d[_0x25e7('0x34')];}_0xb7c564[_0x25e7('0x27')](_0x55eeaf)[_0x25e7('0x35')](_0x2a832d);};}exports[_0x25e7('0x36')]=function(_0x26a605,_0x899a7b){var _0x8774cc={'include':[{'model':db[_0x25e7('0x37')],'as':_0x25e7('0x38')}]},_0x1ed8cc={},_0x34107a={'count':0x0,'rows':[]};var _0x496a79=_[_0x25e7('0x39')](db['FaxAccount'][_0x25e7('0x3a')],function(_0xe2dd7){return{'name':_0xe2dd7[_0x25e7('0x3b')],'type':_0xe2dd7[_0x25e7('0x3c')]['key']};});_0x1ed8cc[_0x25e7('0x3d')]=_[_0x25e7('0x39')](_0x496a79,_0x25e7('0x34'));_0x1ed8cc[_0x25e7('0x3e')]=_[_0x25e7('0x3f')](_0x26a605[_0x25e7('0x3e')]);_0x1ed8cc['filters']=_['intersection'](_0x1ed8cc[_0x25e7('0x3d')],_0x1ed8cc[_0x25e7('0x3e')]);_0x8774cc[_0x25e7('0x40')]=_['intersection'](_0x1ed8cc['model'],qs['fields'](_0x26a605[_0x25e7('0x3e')][_0x25e7('0x41')]));_0x8774cc[_0x25e7('0x40')]=_0x8774cc[_0x25e7('0x40')][_0x25e7('0x42')]?_0x8774cc[_0x25e7('0x40')]:_0x1ed8cc[_0x25e7('0x3d')];if(!_0x26a605[_0x25e7('0x3e')][_0x25e7('0x43')](_0x25e7('0x44'))){_0x8774cc['limit']=qs['limit'](_0x26a605[_0x25e7('0x3e')][_0x25e7('0x2b')]);_0x8774cc[_0x25e7('0x28')]=qs[_0x25e7('0x28')](_0x26a605['query'][_0x25e7('0x28')]);}_0x8774cc[_0x25e7('0x45')]=qs[_0x25e7('0x46')](_0x26a605[_0x25e7('0x3e')][_0x25e7('0x46')]);_0x8774cc[_0x25e7('0x47')]=qs[_0x25e7('0x48')](_[_0x25e7('0x49')](_0x26a605[_0x25e7('0x3e')],_0x1ed8cc[_0x25e7('0x48')]),_0x496a79);if(_0x26a605['query']['filter']){_0x8774cc[_0x25e7('0x47')]=_[_0x25e7('0x4a')](_0x8774cc[_0x25e7('0x47')],{'$or':_['map'](_0x496a79,function(_0x2f2465){if(_0x2f2465[_0x25e7('0x3c')]!==_0x25e7('0x4b')){var _0xc8183f={};_0xc8183f[_0x2f2465['name']]={'$like':'%'+_0x26a605[_0x25e7('0x3e')][_0x25e7('0x4c')]+'%'};return _0xc8183f;}})});}_0x8774cc=_[_0x25e7('0x4a')]({},_0x8774cc,_0x26a605[_0x25e7('0x4d')]);var _0x2f6826={'where':_0x8774cc[_0x25e7('0x47')]};return db[_0x25e7('0x4e')]['count'](_0x2f6826)[_0x25e7('0x1c')](function(_0x5068ae){_0x34107a[_0x25e7('0x2a')]=_0x5068ae;if(_0x26a605[_0x25e7('0x3e')][_0x25e7('0x4f')]){_0x8774cc['include']=[{'all':!![]}];}return db[_0x25e7('0x4e')][_0x25e7('0x50')](_0x8774cc);})[_0x25e7('0x1c')](function(_0xc68dd1){_0x34107a[_0x25e7('0x51')]=_0xc68dd1;return _0x34107a;})[_0x25e7('0x1c')](respondWithFilteredResult(_0x899a7b,_0x8774cc))[_0x25e7('0x26')](handleError(_0x899a7b,null));};exports[_0x25e7('0x52')]=function(_0x1fa739,_0xfe0e1b){var _0x4658fc={'raw':![],'where':{'id':_0x1fa739[_0x25e7('0x53')]['id']},'include':[{'model':db[_0x25e7('0x37')],'as':_0x25e7('0x38')}]},_0x41ed31={};_0x41ed31[_0x25e7('0x3d')]=_[_0x25e7('0x3f')](db[_0x25e7('0x4e')][_0x25e7('0x3a')]);_0x41ed31[_0x25e7('0x3e')]=_[_0x25e7('0x3f')](_0x1fa739['query']);_0x41ed31[_0x25e7('0x48')]=_[_0x25e7('0x54')](_0x41ed31['model'],_0x41ed31[_0x25e7('0x3e')]);_0x4658fc[_0x25e7('0x40')]=_['intersection'](_0x41ed31[_0x25e7('0x3d')],qs[_0x25e7('0x41')](_0x1fa739[_0x25e7('0x3e')]['fields']));_0x4658fc[_0x25e7('0x40')]=_0x4658fc[_0x25e7('0x40')][_0x25e7('0x42')]?_0x4658fc[_0x25e7('0x40')]:_0x41ed31[_0x25e7('0x3d')];if(_0x1fa739[_0x25e7('0x3e')][_0x25e7('0x4f')]){_0x4658fc['include']=[{'all':!![]}];}_0x4658fc=_['merge']({},_0x4658fc,_0x1fa739['options']);return db[_0x25e7('0x4e')]['find'](_0x4658fc)['then'](handleEntityNotFound(_0xfe0e1b,null))[_0x25e7('0x1c')](respondWithResult(_0xfe0e1b,null))[_0x25e7('0x26')](handleError(_0xfe0e1b,null));};exports[_0x25e7('0x55')]=function(_0x465de4,_0x4e0e70){return db[_0x25e7('0x4e')]['create'](_0x465de4['body'],{})[_0x25e7('0x1c')](function(_0x4f4545){var _0x75398=_0x465de4[_0x25e7('0x56')]['get']({'plain':!![]});if(!_0x75398)throw new Error(_0x25e7('0x57'));if(_0x75398[_0x25e7('0x58')]===_0x25e7('0x56')){var _0x51f41f=_0x4f4545[_0x25e7('0x32')]({'plain':!![]});var _0x1e0e9c=_0x25e7('0x33');return db[_0x25e7('0x59')][_0x25e7('0x5a')]({'where':{'name':_0x1e0e9c,'userProfileId':_0x75398[_0x25e7('0x5b')]},'raw':!![]})[_0x25e7('0x1c')](function(_0x541706){if(_0x541706&&_0x541706['autoAssociation']===0x0){return db[_0x25e7('0x5c')]['create']({'name':_0x51f41f[_0x25e7('0x34')],'resourceId':_0x51f41f['id'],'type':_0x541706['name'],'sectionId':_0x541706['id']},{})[_0x25e7('0x1c')](function(){return _0x4f4545;});}else{return _0x4f4545;}})[_0x25e7('0x26')](function(_0x4986c6){logger[_0x25e7('0x21')](_0x25e7('0x5d'),_0x4986c6);throw _0x4986c6;});}return _0x4f4545;})[_0x25e7('0x1c')](respondWithResult(_0x4e0e70,0xc9))[_0x25e7('0x26')](handleError(_0x4e0e70,null));};exports[_0x25e7('0x30')]=function(_0x23c860,_0x21d15c){if(_0x23c860[_0x25e7('0x5e')]['id']){delete _0x23c860[_0x25e7('0x5e')]['id'];}return db['FaxAccount'][_0x25e7('0x5a')]({'where':{'id':_0x23c860[_0x25e7('0x53')]['id']},'include':[{'model':db['Pause'],'as':_0x25e7('0x38')}]})[_0x25e7('0x1c')](handleEntityNotFound(_0x21d15c,null))['then'](saveUpdates(_0x23c860[_0x25e7('0x5e')],null))[_0x25e7('0x1c')](respondWithResult(_0x21d15c,null))[_0x25e7('0x26')](handleError(_0x21d15c,null));};exports[_0x25e7('0x31')]=function(_0x35feab,_0x3d47ec){return db[_0x25e7('0x4e')]['find']({'where':{'id':_0x35feab[_0x25e7('0x53')]['id']}})[_0x25e7('0x1c')](handleEntityNotFound(_0x3d47ec,null))[_0x25e7('0x1c')](removeEntity(_0x3d47ec,null))['catch'](handleError(_0x3d47ec,null));};exports[_0x25e7('0x5f')]=function(_0x414bbf,_0x4ad845){return db['FaxAccount'][_0x25e7('0x5f')]()['then'](respondWithResult(_0x4ad845,null))[_0x25e7('0x26')](handleError(_0x4ad845,null));};exports['addDisposition']=function(_0x5e3799,_0x4a7a8c,_0x1e7571){if(_0x5e3799[_0x25e7('0x5e')]['id']){delete _0x5e3799[_0x25e7('0x5e')]['id'];}return db['FaxAccount']['find']({'where':{'id':_0x5e3799[_0x25e7('0x53')]['id']}})[_0x25e7('0x1c')](handleEntityNotFound(_0x4a7a8c,null))[_0x25e7('0x1c')](function(_0xa507b1){if(_0xa507b1){_0x5e3799[_0x25e7('0x5e')]['FaxAccountId']=_0xa507b1['id'];return db[_0x25e7('0x60')]['create'](_0x5e3799['body']);}})[_0x25e7('0x1c')](respondWithResult(_0x4a7a8c,null))[_0x25e7('0x26')](handleError(_0x4a7a8c,null));};exports[_0x25e7('0x61')]=function(_0x57ee7c,_0x10be5a,_0x4c407c){var _0x4d9d0d={'raw':![],'where':{}};var _0x4f4d97={};var _0xbf1e39={'count':0x0,'rows':[]};return db[_0x25e7('0x4e')][_0x25e7('0x62')]({'where':{'id':_0x57ee7c[_0x25e7('0x53')]['id']}})[_0x25e7('0x1c')](handleEntityNotFound(_0x10be5a,null))['then'](function(_0x2ddf3a){if(_0x2ddf3a){_0x4f4d97['model']=_[_0x25e7('0x3f')](db[_0x25e7('0x60')]['rawAttributes']);_0x4f4d97['query']=_[_0x25e7('0x3f')](_0x57ee7c[_0x25e7('0x3e')]);_0x4f4d97[_0x25e7('0x48')]=_[_0x25e7('0x54')](_0x4f4d97[_0x25e7('0x3d')],_0x4f4d97[_0x25e7('0x3e')]);_0x4d9d0d[_0x25e7('0x40')]=_[_0x25e7('0x54')](_0x4f4d97['model'],qs[_0x25e7('0x41')](_0x57ee7c[_0x25e7('0x3e')][_0x25e7('0x41')]));_0x4d9d0d[_0x25e7('0x40')]=_0x4d9d0d['attributes'][_0x25e7('0x42')]?_0x4d9d0d['attributes']:_0x4f4d97[_0x25e7('0x3d')];if(!_0x57ee7c[_0x25e7('0x3e')][_0x25e7('0x43')](_0x25e7('0x44'))){_0x4d9d0d[_0x25e7('0x2b')]=qs[_0x25e7('0x2b')](_0x57ee7c['query'][_0x25e7('0x2b')]);_0x4d9d0d[_0x25e7('0x28')]=qs['offset'](_0x57ee7c['query'][_0x25e7('0x28')]);}_0x4d9d0d[_0x25e7('0x45')]=qs[_0x25e7('0x46')](_0x57ee7c[_0x25e7('0x3e')][_0x25e7('0x46')]);_0x4d9d0d['where']=qs['filters'](_[_0x25e7('0x49')](_0x57ee7c[_0x25e7('0x3e')],_0x4f4d97[_0x25e7('0x48')]));_0x4d9d0d['where'][_0x25e7('0x63')]=_0x2ddf3a['id'];if(_0x57ee7c['query']['filter']){_0x4d9d0d['where']=_[_0x25e7('0x4a')](_0x4d9d0d['where'],{'$or':_['map'](_0x4d9d0d[_0x25e7('0x40')],function(_0x96d61b){var _0x10ea7e={};_0x10ea7e[_0x96d61b]={'$like':'%'+_0x57ee7c[_0x25e7('0x3e')][_0x25e7('0x4c')]+'%'};return _0x10ea7e;})});}_0x4d9d0d=_['merge']({},_0x4d9d0d,_0x57ee7c[_0x25e7('0x4d')]);return db[_0x25e7('0x60')][_0x25e7('0x2a')]({'where':_0x4d9d0d[_0x25e7('0x47')]})[_0x25e7('0x1c')](function(_0x132243){_0xbf1e39['count']=_0x132243;if(_0x57ee7c[_0x25e7('0x3e')][_0x25e7('0x4f')]){_0x4d9d0d[_0x25e7('0x64')]=[{'all':!![]}];}return db['Disposition'][_0x25e7('0x50')](_0x4d9d0d);})[_0x25e7('0x1c')](function(_0x4e888a){_0xbf1e39[_0x25e7('0x51')]=_0x4e888a;return _0xbf1e39;});}})[_0x25e7('0x1c')](respondWithFilteredResult(_0x10be5a,_0x4d9d0d))[_0x25e7('0x26')](handleError(_0x10be5a,null));};exports['removeDispositions']=function(_0x52a23a,_0x2b6ae7,_0x3599ea){return db[_0x25e7('0x4e')]['find']({'where':{'id':_0x52a23a[_0x25e7('0x53')]['id']}})[_0x25e7('0x1c')](handleEntityNotFound(_0x2b6ae7,null))[_0x25e7('0x1c')](function(_0x391baf){if(_0x391baf){return _0x391baf[_0x25e7('0x65')](_0x52a23a[_0x25e7('0x3e')]['ids']);}})[_0x25e7('0x1c')](respondWithStatusCode(_0x2b6ae7,null))['catch'](handleError(_0x2b6ae7,null));};exports['addAnswer']=function(_0x36658e,_0x55cea9,_0x9c18b7){if(_0x36658e[_0x25e7('0x5e')]['id']){delete _0x36658e[_0x25e7('0x5e')]['id'];}return db[_0x25e7('0x4e')][_0x25e7('0x5a')]({'where':{'id':_0x36658e[_0x25e7('0x53')]['id']}})[_0x25e7('0x1c')](handleEntityNotFound(_0x55cea9,null))[_0x25e7('0x1c')](function(_0x4a4a5f){if(_0x4a4a5f){_0x36658e[_0x25e7('0x5e')][_0x25e7('0x63')]=_0x4a4a5f['id'];return db[_0x25e7('0x66')][_0x25e7('0x55')](_0x36658e[_0x25e7('0x5e')]);}})[_0x25e7('0x1c')](respondWithResult(_0x55cea9,null))['catch'](handleError(_0x55cea9,null));};exports[_0x25e7('0x67')]=function(_0x4a359d,_0x4695da,_0x406499){var _0x430a31={'raw':![],'where':{}};var _0x15d30a={};var _0x446d51={'count':0x0,'rows':[]};return db['FaxAccount'][_0x25e7('0x62')]({'where':{'id':_0x4a359d['params']['id']}})[_0x25e7('0x1c')](handleEntityNotFound(_0x4695da,null))[_0x25e7('0x1c')](function(_0x379032){if(_0x379032){_0x15d30a[_0x25e7('0x3d')]=_['keys'](db[_0x25e7('0x66')][_0x25e7('0x3a')]);_0x15d30a['query']=_[_0x25e7('0x3f')](_0x4a359d['query']);_0x15d30a[_0x25e7('0x48')]=_[_0x25e7('0x54')](_0x15d30a[_0x25e7('0x3d')],_0x15d30a[_0x25e7('0x3e')]);_0x430a31[_0x25e7('0x40')]=_[_0x25e7('0x54')](_0x15d30a['model'],qs[_0x25e7('0x41')](_0x4a359d[_0x25e7('0x3e')][_0x25e7('0x41')]));_0x430a31['attributes']=_0x430a31[_0x25e7('0x40')]['length']?_0x430a31['attributes']:_0x15d30a['model'];if(!_0x4a359d['query'][_0x25e7('0x43')](_0x25e7('0x44'))){_0x430a31['limit']=qs[_0x25e7('0x2b')](_0x4a359d['query']['limit']);_0x430a31['offset']=qs['offset'](_0x4a359d[_0x25e7('0x3e')][_0x25e7('0x28')]);}_0x430a31[_0x25e7('0x45')]=qs['sort'](_0x4a359d['query']['sort']);_0x430a31['where']=qs[_0x25e7('0x48')](_[_0x25e7('0x49')](_0x4a359d['query'],_0x15d30a['filters']));_0x430a31[_0x25e7('0x47')]['FaxAccountId']=_0x379032['id'];if(_0x4a359d['query'][_0x25e7('0x4c')]){_0x430a31['where']=_[_0x25e7('0x4a')](_0x430a31[_0x25e7('0x47')],{'$or':_[_0x25e7('0x39')](_0x430a31[_0x25e7('0x40')],function(_0x13bacc){var _0x130cc3={};_0x130cc3[_0x13bacc]={'$like':'%'+_0x4a359d[_0x25e7('0x3e')][_0x25e7('0x4c')]+'%'};return _0x130cc3;})});}_0x430a31=_[_0x25e7('0x4a')]({},_0x430a31,_0x4a359d['options']);return db[_0x25e7('0x66')][_0x25e7('0x2a')]({'where':_0x430a31['where']})[_0x25e7('0x1c')](function(_0x555eff){_0x446d51['count']=_0x555eff;if(_0x4a359d[_0x25e7('0x3e')]['includeAll']){_0x430a31['include']=[{'all':!![]}];}return db[_0x25e7('0x66')]['findAll'](_0x430a31);})['then'](function(_0x2e7c04){_0x446d51[_0x25e7('0x51')]=_0x2e7c04;return _0x446d51;});}})[_0x25e7('0x1c')](respondWithFilteredResult(_0x4695da,_0x430a31))[_0x25e7('0x26')](handleError(_0x4695da,null));};exports['removeAnswers']=function(_0x1bdf7a,_0x331697,_0x3ab34c){return db['FaxAccount'][_0x25e7('0x5a')]({'where':{'id':_0x1bdf7a[_0x25e7('0x53')]['id']}})[_0x25e7('0x1c')](handleEntityNotFound(_0x331697,null))['then'](function(_0x51be95){if(_0x51be95){return _0x51be95[_0x25e7('0x68')](_0x1bdf7a[_0x25e7('0x3e')][_0x25e7('0x69')]);}})['then'](respondWithStatusCode(_0x331697,null))[_0x25e7('0x26')](handleError(_0x331697,null));};exports[_0x25e7('0x6a')]=function(_0x52ad48,_0x41b41c,_0x57da6c){return db[_0x25e7('0x6b')][_0x25e7('0x5a')]({'where':{'id':_0x52ad48[_0x25e7('0x53')]['id']}})[_0x25e7('0x1c')](handleEntityNotFound(_0x41b41c,null))[_0x25e7('0x1c')](function(_0x5d92c6){if(_0x5d92c6){return _0x5d92c6[_0x25e7('0x6a')](_0x52ad48[_0x25e7('0x5e')]['ids'],_[_0x25e7('0x6c')](_0x52ad48[_0x25e7('0x5e')],[_0x25e7('0x69'),'id'])||{});}})[_0x25e7('0x1c')](respondWithResult(_0x41b41c,null))[_0x25e7('0x26')](handleError(_0x41b41c,null));};exports[_0x25e7('0x6d')]=function(_0x51c6fc,_0x264f7e,_0x1ff84f){var _0x77d5a8={'raw':![],'where':{}};var _0x4d7978={};var _0x1384e2={'count':0x0,'rows':[]};return db[_0x25e7('0x4e')]['findOne']({'where':{'id':_0x51c6fc[_0x25e7('0x53')]['id']}})[_0x25e7('0x1c')](handleEntityNotFound(_0x264f7e,null))[_0x25e7('0x1c')](function(_0x150194){if(_0x150194){_0x4d7978[_0x25e7('0x3d')]=_[_0x25e7('0x3f')](db[_0x25e7('0x6b')][_0x25e7('0x3a')]);_0x4d7978[_0x25e7('0x3e')]=_[_0x25e7('0x3f')](_0x51c6fc[_0x25e7('0x3e')]);_0x4d7978['filters']=_[_0x25e7('0x54')](_0x4d7978['model'],_0x4d7978['query']);_0x77d5a8[_0x25e7('0x40')]=_[_0x25e7('0x54')](_0x4d7978[_0x25e7('0x3d')],qs[_0x25e7('0x41')](_0x51c6fc[_0x25e7('0x3e')]['fields']));_0x77d5a8[_0x25e7('0x40')]=_0x77d5a8[_0x25e7('0x40')][_0x25e7('0x42')]?_0x77d5a8[_0x25e7('0x40')]:_0x4d7978['model'];if(!_0x51c6fc['query'][_0x25e7('0x43')](_0x25e7('0x44'))){_0x77d5a8['limit']=qs['limit'](_0x51c6fc[_0x25e7('0x3e')]['limit']);_0x77d5a8[_0x25e7('0x28')]=qs[_0x25e7('0x28')](_0x51c6fc['query'][_0x25e7('0x28')]);}_0x77d5a8[_0x25e7('0x45')]=qs['sort'](_0x51c6fc['query'][_0x25e7('0x46')]);_0x77d5a8[_0x25e7('0x47')]=qs[_0x25e7('0x48')](_['pick'](_0x51c6fc[_0x25e7('0x3e')],_0x4d7978[_0x25e7('0x48')]));_0x77d5a8['where'][_0x25e7('0x63')]=_0x150194['id'];if(_0x51c6fc['query'][_0x25e7('0x4c')]){_0x77d5a8[_0x25e7('0x47')]=_['merge'](_0x77d5a8['where'],{'$or':_['map'](_0x77d5a8['attributes'],function(_0x5c6035){var _0xb0dd74={};_0xb0dd74[_0x5c6035]={'$like':'%'+_0x51c6fc['query'][_0x25e7('0x4c')]+'%'};return _0xb0dd74;})});}_0x77d5a8=_[_0x25e7('0x4a')]({},_0x77d5a8,_0x51c6fc[_0x25e7('0x4d')]);return db['FaxInteraction'][_0x25e7('0x2a')]({'where':_0x77d5a8[_0x25e7('0x47')]})[_0x25e7('0x1c')](function(_0x2235cb){_0x1384e2[_0x25e7('0x2a')]=_0x2235cb;if(_0x51c6fc[_0x25e7('0x3e')][_0x25e7('0x4f')]){_0x77d5a8[_0x25e7('0x64')]=[{'model':db[_0x25e7('0x6e')],'as':_0x25e7('0x6f'),'required':![]},{'model':db['User'],'as':'Owner','attributes':['name',_0x25e7('0x70'),_0x25e7('0x71')],'required':![]},{'model':db[_0x25e7('0x72')],'as':_0x25e7('0x73'),'attributes':['id','name',_0x25e7('0x74')],'where':_0x51c6fc[_0x25e7('0x3e')][_0x25e7('0x75')]?{'id':_0x51c6fc[_0x25e7('0x3e')][_0x25e7('0x75')]}:undefined,'required':_0x51c6fc[_0x25e7('0x3e')]['tag']?!![]:![]}];}return db[_0x25e7('0x6b')][_0x25e7('0x50')](_0x77d5a8);})['then'](function(_0x110898){_0x1384e2['rows']=_0x110898;return _0x1384e2;});}})['then'](respondWithFilteredResult(_0x264f7e,_0x77d5a8))[_0x25e7('0x26')](handleError(_0x264f7e,null));};exports['addApplications']=function(_0x7feae6,_0x5a4441,_0x5f825c){return db[_0x25e7('0x4e')][_0x25e7('0x62')]({'where':{'id':_0x7feae6['params']['id']}})[_0x25e7('0x1c')](handleEntityNotFound(_0x5a4441,null))[_0x25e7('0x1c')](function(_0x2c5ec6){if(_0x2c5ec6){return db[_0x25e7('0x76')][_0x25e7('0x77')](function(_0x140c6e){return db[_0x25e7('0x78')][_0x25e7('0x31')]({'where':{'FaxAccountId':_0x7feae6[_0x25e7('0x53')]['id']},'transaction':_0x140c6e})[_0x25e7('0x1c')](function(_0x4dff9e){var _0x2447b1=_[_0x25e7('0x39')](_0x7feae6[_0x25e7('0x5e')],function(_0x26983a){_0x26983a[_0x25e7('0x63')]=_0x7feae6[_0x25e7('0x53')]['id'];return _0x26983a;});return db[_0x25e7('0x78')][_0x25e7('0x79')](_0x2447b1,{'transaction':_0x140c6e});});})[_0x25e7('0x1c')](function(){return db[_0x25e7('0x78')][_0x25e7('0x7a')]({'where':{'FaxAccountId':_0x7feae6[_0x25e7('0x53')]['id']},'order':_0x25e7('0x7b')});});}})[_0x25e7('0x1c')](respondWithResult(_0x5a4441,null))[_0x25e7('0x26')](handleError(_0x5a4441,null));};exports[_0x25e7('0x7c')]=function(_0x3a50b7,_0x1b5a7c,_0x498919){var _0x2cde80={};var _0x2ad065={};var _0x2d5647;var _0x23002b;return db['FaxAccount']['findOne']({'where':{'id':_0x3a50b7[_0x25e7('0x53')]['id']}})[_0x25e7('0x1c')](handleEntityNotFound(_0x1b5a7c,null))['then'](function(_0x37d833){if(_0x37d833){_0x2d5647=_0x37d833;_0x2ad065[_0x25e7('0x3d')]=_[_0x25e7('0x3f')](db['FaxApplication'][_0x25e7('0x3a')]);_0x2ad065[_0x25e7('0x3e')]=_[_0x25e7('0x3f')](_0x3a50b7[_0x25e7('0x3e')]);_0x2ad065[_0x25e7('0x48')]=_[_0x25e7('0x54')](_0x2ad065[_0x25e7('0x3d')],_0x2ad065[_0x25e7('0x3e')]);_0x2cde80[_0x25e7('0x40')]=_[_0x25e7('0x54')](_0x2ad065['model'],qs[_0x25e7('0x41')](_0x3a50b7['query'][_0x25e7('0x41')]));_0x2cde80[_0x25e7('0x40')]=_0x2cde80[_0x25e7('0x40')][_0x25e7('0x42')]?_0x2cde80['attributes']:_0x2ad065['model'];_0x2cde80[_0x25e7('0x45')]=qs[_0x25e7('0x46')](_0x3a50b7[_0x25e7('0x3e')][_0x25e7('0x46')]);_0x2cde80[_0x25e7('0x47')]=qs[_0x25e7('0x48')](_[_0x25e7('0x49')](_0x3a50b7[_0x25e7('0x3e')],_0x2ad065[_0x25e7('0x48')]));if(_0x3a50b7[_0x25e7('0x3e')]['filter']){_0x2cde80[_0x25e7('0x47')]=_['merge'](_0x2cde80[_0x25e7('0x47')],{'$or':_[_0x25e7('0x39')](_0x2cde80['attributes'],function(_0x52d6b2){var _0xd5b3e5={};_0xd5b3e5[_0x52d6b2]={'$like':'%'+_0x3a50b7[_0x25e7('0x3e')][_0x25e7('0x4c')]+'%'};return _0xd5b3e5;})});}_0x2cde80=_[_0x25e7('0x4a')]({},_0x2cde80,_0x3a50b7['options']);return _0x2d5647[_0x25e7('0x7c')](_0x2cde80);}})['then'](function(_0x3ce257){if(_0x3ce257){_0x23002b=_0x3ce257[_0x25e7('0x42')];if(!_0x3a50b7[_0x25e7('0x3e')]['hasOwnProperty'](_0x25e7('0x44'))){_0x2cde80[_0x25e7('0x2b')]=qs['limit'](_0x3a50b7[_0x25e7('0x3e')][_0x25e7('0x2b')]);_0x2cde80[_0x25e7('0x28')]=qs[_0x25e7('0x28')](_0x3a50b7['query'][_0x25e7('0x28')]);}return _0x2d5647[_0x25e7('0x7c')](_0x2cde80);}})[_0x25e7('0x1c')](function(_0x42dadb){if(_0x42dadb){return _0x42dadb?{'count':_0x23002b,'rows':_0x42dadb}:null;}})[_0x25e7('0x1c')](respondWithResult(_0x1b5a7c,null))[_0x25e7('0x26')](handleError(_0x1b5a7c,null));};function Extension(_0x991bf5,_0x3fa973,_0x4e4aec,_0x1a64dd){this[_0x25e7('0x7d')]=_0x25e7('0x7e');this[_0x25e7('0x7f')]=_0x991bf5[_0x25e7('0x80')];this[_0x25e7('0x81')]=_0x1a64dd;this[_0x25e7('0x3c')]=_0x25e7('0x82');this['description']=_0x25e7('0x83');this[_0x25e7('0x63')]=_0x991bf5['id'];this['priority']=_0x3fa973;this['appdata']=_0x4e4aec;}function createExtensionsReciveFax(_0x2b1c80){var _0x418946=0x1;var _0x17851a=[];_0x17851a['push'](new Extension(_0x2b1c80,_0x418946,'',_0x25e7('0x84')));_0x418946+=0x1;_0x17851a[_0x25e7('0x85')](new Extension(_0x2b1c80,_0x418946,_0x25e7('0x86'),'Set'));_0x418946+=0x1;for(var _0x1cbdc8 in _0x2b1c80){if(_0x2b1c80[_0x25e7('0x43')](_0x1cbdc8)&&(_0x1cbdc8===_0x25e7('0x87')||_0x1cbdc8===_0x25e7('0x80')||_0x1cbdc8===_0x25e7('0x88')||_0x1cbdc8===_0x25e7('0x89')||_0x1cbdc8===_0x25e7('0x8a')||_0x1cbdc8==='maxrate'||_0x1cbdc8===_0x25e7('0x8b')||_0x1cbdc8===_0x25e7('0x8c')||_0x1cbdc8===_0x25e7('0x8d'))){_0x17851a[_0x25e7('0x85')](new Extension(_0x2b1c80,_0x418946,_0x25e7('0x8e')+_0x1cbdc8+')='+_0x2b1c80[_0x1cbdc8],'Set'));_0x418946+=0x1;}}_0x17851a['push'](new Extension(_0x2b1c80,_0x418946,'6',_0x25e7('0x8f')));_0x418946+=0x1;_0x17851a[_0x25e7('0x85')](new Extension(_0x2b1c80,_0x418946,_0x25e7('0x90'),'ReceiveFax'));_0x418946=0x0;return _0x17851a;}exports[_0x25e7('0x91')]=function(_0x3657da,_0x2b4727,_0x5e7fb0){var _0x1fc5cc;return db[_0x25e7('0x76')][_0x25e7('0x77')](function(_0x351f03){return db[_0x25e7('0x4e')][_0x25e7('0x55')](_0x3657da['body'],{'transaction':_0x351f03})[_0x25e7('0x1c')](function(_0x43021d){_0x1fc5cc=_0x43021d[_0x25e7('0x32')]({'plain':!![]});return db[_0x25e7('0x92')]['bulkCreate'](createExtensionsReciveFax(_0x1fc5cc),{'transaction':_0x351f03});});})[_0x25e7('0x1c')](function(){return _0x1fc5cc;})[_0x25e7('0x1c')](respondWithResult(_0x2b4727,null))['catch'](handleError(_0x2b4727,null));};exports[_0x25e7('0x93')]=function(_0x7d2c2c,_0x57713b,_0x46b7e6){var _0x502a30;return db[_0x25e7('0x76')][_0x25e7('0x77')](function(_0x1f2b1c){return db[_0x25e7('0x4e')][_0x25e7('0x30')](_0x7d2c2c['body'],{'where':{'id':_0x7d2c2c[_0x25e7('0x5e')]['id']},'transaction':_0x1f2b1c})[_0x25e7('0x1c')](function(_0x122f3d){return db[_0x25e7('0x92')][_0x25e7('0x31')]({'where':{'FaxAccountId':_0x7d2c2c[_0x25e7('0x5e')]['id']},'transaction':_0x1f2b1c})[_0x25e7('0x1c')](function(_0xe1e5dd){return db[_0x25e7('0x92')][_0x25e7('0x79')](createExtensionsReciveFax(_['omit'](_0x7d2c2c[_0x25e7('0x5e')],[_0x25e7('0x94'),_0x25e7('0x95'),_0x25e7('0x96'),'updatedAt',_0x25e7('0x97'),_0x25e7('0x98')])),{'transaction':_0x1f2b1c});});});})[_0x25e7('0x1c')](function(){return db[_0x25e7('0x4e')][_0x25e7('0x99')](_0x7d2c2c[_0x25e7('0x5e')]['id']);})[_0x25e7('0x1c')](respondWithResult(_0x57713b,null))[_0x25e7('0x26')](handleError(_0x57713b,null));};exports[_0x25e7('0x9a')]=function(_0x3646e3,_0x4eae5f,_0x5217f8){var _0x1ce882={'raw':!![],'where':{}};var _0x5c22b7={};var _0x476337={'count':0x0,'rows':[]};return db[_0x25e7('0x4e')][_0x25e7('0x62')]({'where':{'id':_0x3646e3[_0x25e7('0x53')]['id']}})['then'](handleEntityNotFound(_0x4eae5f,null))[_0x25e7('0x1c')](function(_0x4e742d){if(_0x4e742d){_0x5c22b7[_0x25e7('0x3d')]=_[_0x25e7('0x3f')](db[_0x25e7('0x9b')][_0x25e7('0x3a')]);_0x5c22b7[_0x25e7('0x3e')]=_[_0x25e7('0x3f')](_0x3646e3[_0x25e7('0x3e')]);_0x5c22b7[_0x25e7('0x48')]=_['intersection'](_0x5c22b7[_0x25e7('0x3d')],_0x5c22b7[_0x25e7('0x3e')]);_0x1ce882[_0x25e7('0x40')]=_['intersection'](_0x5c22b7[_0x25e7('0x3d')],qs[_0x25e7('0x41')](_0x3646e3[_0x25e7('0x3e')]['fields']));_0x1ce882['attributes']=_0x1ce882[_0x25e7('0x40')][_0x25e7('0x42')]?_0x1ce882[_0x25e7('0x40')]:_0x5c22b7[_0x25e7('0x3d')];if(!_0x3646e3[_0x25e7('0x3e')][_0x25e7('0x43')]('nolimit')){_0x1ce882[_0x25e7('0x2b')]=qs[_0x25e7('0x2b')](_0x3646e3['query']['limit']);_0x1ce882[_0x25e7('0x28')]=qs[_0x25e7('0x28')](_0x3646e3['query'][_0x25e7('0x28')]);}_0x1ce882[_0x25e7('0x45')]=qs[_0x25e7('0x46')](_0x3646e3[_0x25e7('0x3e')][_0x25e7('0x46')]);_0x1ce882[_0x25e7('0x47')]=qs[_0x25e7('0x48')](_[_0x25e7('0x49')](_0x3646e3[_0x25e7('0x3e')],_0x5c22b7[_0x25e7('0x48')]));_0x1ce882[_0x25e7('0x47')][_0x25e7('0x63')]=_0x4e742d['id'];if(_0x3646e3[_0x25e7('0x3e')][_0x25e7('0x4c')]){_0x1ce882[_0x25e7('0x47')]=_[_0x25e7('0x4a')](_0x1ce882[_0x25e7('0x47')],{'$or':_['map'](_0x1ce882[_0x25e7('0x40')],function(_0x3ccfba){var _0x1384a0={};_0x1384a0[_0x3ccfba]={'$like':'%'+_0x3646e3[_0x25e7('0x3e')][_0x25e7('0x4c')]+'%'};return _0x1384a0;})});}if(_0x3646e3['query'][_0x25e7('0x9c')]){var _0xf3bdfe=_0x3646e3[_0x25e7('0x3e')][_0x25e7('0x9c')][_0x25e7('0x9d')](',');var _0x536c4b={};_0x536c4b[_0xf3bdfe[0x0]]={'$gte':moment(_0xf3bdfe[0x1])[_0x25e7('0x9e')](_0x25e7('0x9f'))};_0x1ce882[_0x25e7('0x47')]=_[_0x25e7('0x4a')](_0x1ce882['where'],_0x536c4b);}_0x1ce882=_[_0x25e7('0x4a')]({},_0x1ce882,_0x3646e3['options']);return db['FaxMessage'][_0x25e7('0x2a')]({'where':_0x1ce882[_0x25e7('0x47')]})[_0x25e7('0x1c')](function(_0x1859ba){_0x476337[_0x25e7('0x2a')]=_0x1859ba;if(_0x3646e3['query'][_0x25e7('0x4f')]){_0x1ce882[_0x25e7('0x64')]=[{'all':!![]}];}return db['FaxMessage']['findAll'](_0x1ce882);})['then'](function(_0x5cec2d){_0x476337['rows']=_0x5cec2d;return _0x476337;});}})['then'](respondWithFilteredResult(_0x4eae5f,_0x1ce882))['catch'](handleError(_0x4eae5f,null));};exports['send']=function(_0x23db7b,_0x289a32,_0x47305e){var _0x8e14a0,_0x33dc7a={},_0x30528b;if(_0x23db7b[_0x25e7('0x5e')]['to']){_0x30528b=_0x23db7b[_0x25e7('0x5e')]['to'][0x0];}return db[_0x25e7('0x4e')]['find']({'where':{'id':_0x23db7b[_0x25e7('0x53')]['id']},'include':[{'model':db[_0x25e7('0xa0')],'as':_0x25e7('0xa1'),'include':[{'model':db[_0x25e7('0x6e')],'as':_0x25e7('0xa2'),'where':{'fax':_0x30528b},'limit':0x1,'order':[[_0x25e7('0xa3'),_0x25e7('0xa4')]]}]}]})[_0x25e7('0x1c')](handleEntityNotFound(_0x289a32,null))['then'](function(_0x9b7d5b){_0x8e14a0=_0x9b7d5b;if(_0x23db7b[_0x25e7('0x5e')][_0x25e7('0xa5')]&&_0x23db7b['body']['attachments'][_0x25e7('0x42')]){for(var _0x5736d8=0x0;_0x5736d8<_0x23db7b[_0x25e7('0x5e')][_0x25e7('0xa5')]['length'];_0x5736d8+=0x1){_0x23db7b[_0x25e7('0x5e')][_0x25e7('0xa5')][_0x5736d8]={'filename':_0x23db7b[_0x25e7('0x5e')]['attachments'][_0x5736d8][_0x25e7('0x34')],'id':_0x23db7b[_0x25e7('0x5e')][_0x25e7('0xa5')][_0x5736d8]['id'],'path':path[_0x25e7('0xa6')](config[_0x25e7('0xa7')],_0x25e7('0xa8'),_0x23db7b['body'][_0x25e7('0xa5')][_0x5736d8][_0x25e7('0xa9')])};}}return respondWithRpcPromise(_0x25e7('0xaa'),_0x25e7('0xaa'),{'FaxAccountId':_[_0x25e7('0xab')](_0x23db7b[_0x25e7('0x53')]['id'])?undefined:_0x23db7b[_0x25e7('0x53')]['id'],'path':_[_0x25e7('0xab')](_0x23db7b[_0x25e7('0x5e')][_0x25e7('0xa5')][0x0]['path'])?undefined:_0x23db7b['body']['attachments'][0x0]['path'],'fax':_[_0x25e7('0xab')](_0x23db7b[_0x25e7('0x5e')]['to'][0x0])?undefined:_0x23db7b['body']['to'][0x0]},client9002);})[_0x25e7('0x1c')](function(){if(_0x8e14a0){if(_[_0x25e7('0xab')](_0x23db7b[_0x25e7('0x5e')][_0x25e7('0xac')])){_0x23db7b[_0x25e7('0x5e')]['from']=util[_0x25e7('0x9e')]('\x22%s\x22\x20<%s>',_0x8e14a0[_0x25e7('0x34')],_0x8e14a0['fax']);}if(_0x8e14a0['List']){if(_0x8e14a0[_0x25e7('0xa1')][_0x25e7('0xa2')]['length']){return _0x8e14a0[_0x25e7('0xa1')][_0x25e7('0xa2')][0x0];}else{return db[_0x25e7('0x6e')][_0x25e7('0x55')](_[_0x25e7('0x14')](_0x23db7b[_0x25e7('0x5e')],{'firstName':_0x23db7b['body']['to'][0x0],'phone':_0x23db7b[_0x25e7('0x5e')]['to'][0x0],'fax':_0x23db7b[_0x25e7('0x5e')]['to'][0x0],'ListId':_0x8e14a0[_0x25e7('0x98')]}));}}else{throw new Error(_0x25e7('0xad'));}}else{throw new Error(_0x25e7('0xae'));}})[_0x25e7('0x1c')](function(_0x40d9aa){if(_0x40d9aa){return db[_0x25e7('0x6b')]['find']({'where':{'ContactId':_0x40d9aa['id'],'closed':![],'FaxAccountId':_0x8e14a0['id']}})[_0x25e7('0x1c')](function(_0x31a43f){if(_0x31a43f){return[_0x31a43f,![]];}return db[_0x25e7('0x6b')][_0x25e7('0x55')]({'UserId':_0x23db7b[_0x25e7('0x56')]['id'],'ContactId':_0x40d9aa['id'],'FaxAccountId':_0x8e14a0['id'],'fax':_0x23db7b[_0x25e7('0x5e')]['to'][0x0],'firstMsgDirection':_0x25e7('0xaf'),'Messages':[_[_0x25e7('0x4a')](_0x23db7b[_0x25e7('0x5e')],{'read':![],'body':_0x23db7b[_0x25e7('0x5e')][_0x25e7('0xa5')][0x0][_0x25e7('0xb0')],'FaxAccountId':_0x8e14a0['id'],'UserId':_0x23db7b[_0x25e7('0x56')]['id'],'ContactId':_0x40d9aa['id'],'AttachmentId':_0x23db7b['body'][_0x25e7('0xa5')][0x0]['id']})]},{'include':[{'model':db[_0x25e7('0x9b')],'as':_0x25e7('0xb1')}]})[_0x25e7('0x1c')](function(_0x4fe862){return[_0x4fe862,!![]];});});}else{throw new Error(_0x25e7('0xb2'));}})[_0x25e7('0xb3')](function(_0x4b436e,_0x1cb039){if(_0x1cb039){return _0x4b436e;}return db['FaxMessage'][_0x25e7('0x55')]({'direction':_0x25e7('0xaf'),'read':![],'body':_0x23db7b['body'][_0x25e7('0xa5')][0x0]['filename'],'FaxAccountId':_0x8e14a0['id'],'FaxInteractionId':_0x4b436e['id'],'UserId':_0x23db7b[_0x25e7('0x56')]['id'],'ContactId':_0x4b436e[_0x25e7('0xb4')],'AttachmentId':_0x23db7b[_0x25e7('0x5e')][_0x25e7('0xa5')][0x0]['id']})['then'](function(_0x3d7d68){_0x4b436e[_0x25e7('0xb5')][_0x25e7('0xb1')]=[];_0x4b436e[_0x25e7('0xb5')][_0x25e7('0xb1')]['push'](_0x3d7d68[_0x25e7('0xb5')]);return _0x4b436e;});})['then'](function(_0x27810a){respondWithRpcPromise(_0x25e7('0xb6'),'SendFax',{'FaxAccountId':_[_0x25e7('0xab')](_0x23db7b[_0x25e7('0x53')]['id'])?undefined:_0x23db7b[_0x25e7('0x53')]['id'],'path':_[_0x25e7('0xab')](_0x23db7b[_0x25e7('0x5e')]['attachments'][0x0][_0x25e7('0x5')])?undefined:_0x23db7b[_0x25e7('0x5e')][_0x25e7('0xa5')][0x0]['path'],'fax':_['isNil'](_0x23db7b[_0x25e7('0x5e')]['to'][0x0])?undefined:_0x23db7b[_0x25e7('0x5e')]['to'][0x0],'AttachmentId':_0x23db7b[_0x25e7('0x5e')]['attachments'][0x0]['id']},client9002)[_0x25e7('0x1c')](function(_0x340c6b){logger[_0x25e7('0x24')]('SendFaxRpc,\x20%s',_0x340c6b);})[_0x25e7('0x26')](function(_0x4cdeb7){logger[_0x25e7('0x24')](_0x25e7('0xb7'),_0x4cdeb7);});return _0x27810a;})[_0x25e7('0x1c')](respondWithResult(_0x289a32,null))[_0x25e7('0x26')](handleError(_0x289a32,null));};exports[_0x25e7('0xb8')]=function(_0x9934ac,_0x20699f,_0x1cb3d4){return db['FaxAccount'][_0x25e7('0x5a')]({'where':{'id':_0x9934ac[_0x25e7('0x53')]['id']}})[_0x25e7('0x1c')](handleEntityNotFound(_0x20699f,null))[_0x25e7('0x1c')](function(_0x625827){if(_0x625827){return _0x625827[_0x25e7('0xb8')](_0x9934ac[_0x25e7('0x5e')][_0x25e7('0x69')],_['omit'](_0x9934ac[_0x25e7('0x5e')],[_0x25e7('0x69'),'id'])||{})['spread'](function(_0x3aa9b7){for(var _0x58f3fe=0x0;_0x58f3fe<_0x9934ac[_0x25e7('0x5e')][_0x25e7('0x69')][_0x25e7('0x42')];_0x58f3fe+=0x1){socket[_0x25e7('0xb9')](_0x25e7('0xba'),{'UserId':Number(_0x9934ac['body'][_0x25e7('0x69')][_0x58f3fe]),'FaxAccountId':Number(_0x9934ac[_0x25e7('0x53')]['id'])});}return _0x3aa9b7;});}})[_0x25e7('0x1c')](respondWithResult(_0x20699f,null))[_0x25e7('0x26')](handleError(_0x20699f,null));};exports[_0x25e7('0xbb')]=function(_0x229e34,_0x49ee25,_0x527eab){return db[_0x25e7('0x4e')][_0x25e7('0x5a')]({'where':{'id':_0x229e34[_0x25e7('0x53')]['id']}})[_0x25e7('0x1c')](handleEntityNotFound(_0x49ee25,null))['then'](function(_0x54b79c){if(_0x54b79c){return _0x54b79c[_0x25e7('0xbb')](_0x229e34['query'][_0x25e7('0x69')])[_0x25e7('0x1c')](function(){if(_[_0x25e7('0xbc')](_0x229e34[_0x25e7('0x3e')][_0x25e7('0x69')])){for(var _0x1344b8=0x0;_0x1344b8<_0x229e34[_0x25e7('0x3e')]['ids']['length'];_0x1344b8+=0x1){socket[_0x25e7('0xb9')](_0x25e7('0xbd'),{'UserId':Number(_0x229e34['query'][_0x25e7('0x69')][_0x1344b8]),'FaxAccountId':Number(_0x229e34[_0x25e7('0x53')]['id'])});}}else{socket[_0x25e7('0xb9')](_0x25e7('0xbd'),{'UserId':Number(_0x229e34[_0x25e7('0x3e')]['ids']),'FaxAccountId':Number(_0x229e34[_0x25e7('0x53')]['id'])});}});}})[_0x25e7('0x1c')](respondWithStatusCode(_0x49ee25,null))[_0x25e7('0x26')](handleError(_0x49ee25,null));};exports[_0x25e7('0xbe')]=function(_0x39421b,_0x44953a,_0x36825f){var _0x1949a2={};var _0x91214a={};var _0x5a3680;var _0x2260a8;return db['FaxAccount'][_0x25e7('0x62')]({'where':{'id':_0x39421b[_0x25e7('0x53')]['id']}})['then'](handleEntityNotFound(_0x44953a,null))[_0x25e7('0x1c')](function(_0x1c02d2){if(_0x1c02d2){_0x5a3680=_0x1c02d2;_0x91214a[_0x25e7('0x3d')]=_[_0x25e7('0x3f')](db[_0x25e7('0xbf')][_0x25e7('0x3a')]);_0x91214a[_0x25e7('0x3e')]=_[_0x25e7('0x3f')](_0x39421b[_0x25e7('0x3e')]);_0x91214a[_0x25e7('0x48')]=_[_0x25e7('0x54')](_0x91214a[_0x25e7('0x3d')],_0x91214a[_0x25e7('0x3e')]);_0x1949a2[_0x25e7('0x40')]=_[_0x25e7('0x54')](_0x91214a[_0x25e7('0x3d')],qs[_0x25e7('0x41')](_0x39421b['query'][_0x25e7('0x41')]));_0x1949a2[_0x25e7('0x40')]=_0x1949a2[_0x25e7('0x40')]['length']?_0x1949a2[_0x25e7('0x40')]:_0x91214a[_0x25e7('0x3d')];_0x1949a2['order']=qs[_0x25e7('0x46')](_0x39421b[_0x25e7('0x3e')][_0x25e7('0x46')]);_0x1949a2[_0x25e7('0x47')]=qs[_0x25e7('0x48')](_[_0x25e7('0x49')](_0x39421b['query'],_0x91214a[_0x25e7('0x48')]));if(_0x39421b[_0x25e7('0x3e')]['filter']){_0x1949a2[_0x25e7('0x47')]=_[_0x25e7('0x4a')](_0x1949a2[_0x25e7('0x47')],{'$or':_['map'](_0x1949a2[_0x25e7('0x40')],function(_0x744412){var _0x478dd7={};_0x478dd7[_0x744412]={'$like':'%'+_0x39421b[_0x25e7('0x3e')][_0x25e7('0x4c')]+'%'};return _0x478dd7;})});}_0x1949a2=_[_0x25e7('0x4a')]({},_0x1949a2,_0x39421b['options']);return _0x5a3680[_0x25e7('0xbe')](_0x1949a2);}})[_0x25e7('0x1c')](function(_0xbd632c){if(_0xbd632c){_0x2260a8=_0xbd632c[_0x25e7('0x42')];if(!_0x39421b[_0x25e7('0x3e')][_0x25e7('0x43')](_0x25e7('0x44'))){_0x1949a2['limit']=qs['limit'](_0x39421b['query'][_0x25e7('0x2b')]);_0x1949a2[_0x25e7('0x28')]=qs[_0x25e7('0x28')](_0x39421b[_0x25e7('0x3e')]['offset']);}return _0x5a3680[_0x25e7('0xbe')](_0x1949a2);}})[_0x25e7('0x1c')](function(_0x5660e2){if(_0x5660e2){return _0x5660e2?{'count':_0x2260a8,'rows':_0x5660e2}:null;}})[_0x25e7('0x1c')](respondWithResult(_0x44953a,null))['catch'](handleError(_0x44953a,null));}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.events.js b/server/api/faxAccount/faxAccount.events.js index bf4448a..6342192 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 _0xf6b4=['FaxAccount','setMaxListeners','save','update','remove','emit','hasOwnProperty','exports','events','../../mysqldb'];(function(_0x2962b4,_0x4b0786){var _0x411b7d=function(_0x363aad){while(--_0x363aad){_0x2962b4['push'](_0x2962b4['shift']());}};_0x411b7d(++_0x4b0786);}(_0xf6b4,0x1b6));var _0x4f6b=function(_0x5e8295,_0x4fcee0){_0x5e8295=_0x5e8295-0x0;var _0x2b08aa=_0xf6b4[_0x5e8295];return _0x2b08aa;};'use strict';var EventEmitter=require(_0x4f6b('0x0'));var FaxAccount=require(_0x4f6b('0x1'))['db'][_0x4f6b('0x2')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0x4f6b('0x3')](0x0);var events={'afterCreate':_0x4f6b('0x4'),'afterUpdate':_0x4f6b('0x5'),'afterDestroy':_0x4f6b('0x6')};function emitEvent(_0x302c7a){return function(_0x2efeed,_0x5c3227,_0x1c101d){FaxAccountEvents[_0x4f6b('0x7')](_0x302c7a+':'+_0x2efeed['id'],_0x2efeed);FaxAccountEvents[_0x4f6b('0x7')](_0x302c7a,_0x2efeed);_0x1c101d(null);};}for(var e in events){if(events[_0x4f6b('0x8')](e)){var event=events[e];FaxAccount['hook'](e,emitEvent(event));}}module[_0x4f6b('0x9')]=FaxAccountEvents; \ No newline at end of file +var _0xf05c=['emit','hasOwnProperty','events','../../mysqldb','FaxAccount','setMaxListeners','save','remove'];(function(_0x20380d,_0x3c4b27){var _0x20e36b=function(_0x3377bd){while(--_0x3377bd){_0x20380d['push'](_0x20380d['shift']());}};_0x20e36b(++_0x3c4b27);}(_0xf05c,0x122));var _0xcf05=function(_0x490df7,_0x1744bc){_0x490df7=_0x490df7-0x0;var _0x4b3ebc=_0xf05c[_0x490df7];return _0x4b3ebc;};'use strict';var EventEmitter=require(_0xcf05('0x0'));var FaxAccount=require(_0xcf05('0x1'))['db'][_0xcf05('0x2')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0xcf05('0x3')](0x0);var events={'afterCreate':_0xcf05('0x4'),'afterUpdate':'update','afterDestroy':_0xcf05('0x5')};function emitEvent(_0x47f198){return function(_0x5d4796,_0x439414,_0x468d1c){FaxAccountEvents[_0xcf05('0x6')](_0x47f198+':'+_0x5d4796['id'],_0x5d4796);FaxAccountEvents['emit'](_0x47f198,_0x5d4796);_0x468d1c(null);};}for(var e in events){if(events[_0xcf05('0x7')](e)){var event=events[e];FaxAccount['hook'](e,emitEvent(event));}}module['exports']=FaxAccountEvents; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.model.js b/server/api/faxAccount/faxAccount.model.js index 2a83653..ecb5c69 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 _0xefc2=['../../config/environment','define','FaxAccount','lodash','util','../../config/logger','moment','request-promise','rimraf'];(function(_0x12c17e,_0x36bd60){var _0x5de4d0=function(_0x5d60ab){while(--_0x5d60ab){_0x12c17e['push'](_0x12c17e['shift']());}};_0x5de4d0(++_0x36bd60);}(_0xefc2,0xc0));var _0x2efc=function(_0x122494,_0x49b26d){_0x122494=_0x122494-0x0;var _0x54f2e7=_0xefc2[_0x122494];return _0x54f2e7;};'use strict';var _=require(_0x2efc('0x0'));var util=require(_0x2efc('0x1'));var logger=require(_0x2efc('0x2'))('api');var moment=require(_0x2efc('0x3'));var BPromise=require('bluebird');var rp=require(_0x2efc('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2efc('0x5'));var config=require(_0x2efc('0x6'));var attributes=require('./faxAccount.attributes');module['exports']=function(_0x15ccd2,_0x43c529){return _0x15ccd2[_0x2efc('0x7')](_0x2efc('0x8'),attributes,{'tableName':'fax_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd165=['bluebird','request-promise','path','rimraf','../../config/environment','define','FaxAccount','fax_accounts','lodash','util','../../config/logger','moment'];(function(_0x2a6c0d,_0x596838){var _0x4c9f43=function(_0x5a30b9){while(--_0x5a30b9){_0x2a6c0d['push'](_0x2a6c0d['shift']());}};_0x4c9f43(++_0x596838);}(_0xd165,0x128));var _0x5d16=function(_0x2dd2d9,_0x59790f){_0x2dd2d9=_0x2dd2d9-0x0;var _0x11905d=_0xd165[_0x2dd2d9];return _0x11905d;};'use strict';var _=require(_0x5d16('0x0'));var util=require(_0x5d16('0x1'));var logger=require(_0x5d16('0x2'))('api');var moment=require(_0x5d16('0x3'));var BPromise=require(_0x5d16('0x4'));var rp=require(_0x5d16('0x5'));var fs=require('fs');var path=require(_0x5d16('0x6'));var rimraf=require(_0x5d16('0x7'));var config=require(_0x5d16('0x8'));var attributes=require('./faxAccount.attributes');module['exports']=function(_0x1d2b0d,_0x485fd7){return _0x1d2b0d[_0x5d16('0x9')](_0x5d16('0xa'),attributes,{'tableName':_0x5d16('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 61d0a7d..664f0d0 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 _0xf6c5=['code','message','result','catch','FaxAccount','findAll','options','raw','where','limit','map','include','model','attributes','GetFaxAccount','NotifyFaxAccount','body','fax','describe','Sequelize','ValidationError','difference','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','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','account','List','CmContact','Contacts','FaxApplication','Applications','get','list','applications','orderBy','priority','asc','length','ListId','create','contact','FaxInteraction','find','Contact\x20not\x20found','autoclose','push','close','unmanaged','*,*,*,*','created','FaxMessage','ContactId','AttachmentId','interaction','UserId','User','name','unshift','agent','waitForTheAssignedAgent','startRouting','Start','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./faxAccount.socket','register','request','then','info','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x7082b1,_0x42cd87){var _0x4a41ca=function(_0x1acc3f){while(--_0x1acc3f){_0x7082b1['push'](_0x7082b1['shift']());}};_0x4a41ca(++_0x42cd87);}(_0xf6c5,0x10b));var _0x5f6c=function(_0x522050,_0x3d6191){_0x522050=_0x522050-0x0;var _0x5a65ec=_0xf6c5[_0x522050];return _0x5a65ec;};'use strict';var _=require(_0x5f6c('0x0'));var util=require(_0x5f6c('0x1'));var moment=require(_0x5f6c('0x2'));var BPromise=require(_0x5f6c('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5f6c('0x4'));var db=require(_0x5f6c('0x5'))['db'];var utils=require(_0x5f6c('0x6'));var logger=require(_0x5f6c('0x7'))(_0x5f6c('0x8'));var config=require(_0x5f6c('0x9'));var jayson=require(_0x5f6c('0xa'));var client=jayson[_0x5f6c('0xb')]['http']({'port':0x232c});config[_0x5f6c('0xc')]=_[_0x5f6c('0xd')](config[_0x5f6c('0xc')],{'host':_0x5f6c('0xe'),'port':0x18eb});var socket=require(_0x5f6c('0xf'))(new Redis(config[_0x5f6c('0xc')]));require(_0x5f6c('0x10'))[_0x5f6c('0x11')](socket);function respondWithRpcPromise(_0x1e7253,_0x13e9b9,_0x6521c9){return new BPromise(function(_0x309506,_0x3b1c5f){return client[_0x5f6c('0x12')](_0x1e7253,_0x6521c9)[_0x5f6c('0x13')](function(_0x349c4e){logger[_0x5f6c('0x14')](_0x5f6c('0x15'),_0x13e9b9,_0x5f6c('0x16'));logger[_0x5f6c('0x17')](_0x5f6c('0x18'),_0x13e9b9,_0x5f6c('0x16'),JSON[_0x5f6c('0x19')](_0x349c4e));if(_0x349c4e[_0x5f6c('0x1a')]){if(_0x349c4e[_0x5f6c('0x1a')][_0x5f6c('0x1b')]===0x1f4){logger[_0x5f6c('0x1a')](_0x5f6c('0x15'),_0x13e9b9,_0x349c4e[_0x5f6c('0x1a')]['message']);return _0x3b1c5f(_0x349c4e['error'][_0x5f6c('0x1c')]);}logger[_0x5f6c('0x1a')](_0x5f6c('0x15'),_0x13e9b9,_0x349c4e['error'][_0x5f6c('0x1c')]);return _0x309506(_0x349c4e[_0x5f6c('0x1a')]['message']);}else{logger[_0x5f6c('0x14')]('FaxAccount,\x20%s,\x20%s',_0x13e9b9,_0x5f6c('0x16'));_0x309506(_0x349c4e[_0x5f6c('0x1d')]['message']);}})[_0x5f6c('0x1e')](function(_0x429d56){logger[_0x5f6c('0x1a')](_0x5f6c('0x15'),_0x13e9b9,_0x429d56);_0x3b1c5f(_0x429d56);});});}exports['GetFaxAccount']=function(_0x30003f){var _0x1d6f30=this;return new Promise(function(_0x2bd0e8,_0x31df4d){return db[_0x5f6c('0x1f')][_0x5f6c('0x20')]({'raw':_0x30003f['options']?_0x30003f[_0x5f6c('0x21')][_0x5f6c('0x22')]===undefined?!![]:![]:!![],'where':_0x30003f[_0x5f6c('0x21')]?_0x30003f[_0x5f6c('0x21')][_0x5f6c('0x23')]||null:null,'attributes':_0x30003f[_0x5f6c('0x21')]?_0x30003f[_0x5f6c('0x21')]['attributes']||null:null,'limit':_0x30003f[_0x5f6c('0x21')]?_0x30003f['options'][_0x5f6c('0x24')]||null:null,'include':_0x30003f[_0x5f6c('0x21')]?_0x30003f[_0x5f6c('0x21')]['include']?_[_0x5f6c('0x25')](_0x30003f[_0x5f6c('0x21')][_0x5f6c('0x26')],function(_0x50e9df){return{'model':db[_0x50e9df[_0x5f6c('0x27')]],'as':_0x50e9df['as'],'attributes':_0x50e9df[_0x5f6c('0x28')],'include':_0x50e9df[_0x5f6c('0x26')]?_['map'](_0x50e9df['include'],function(_0x4bd517){return{'model':db[_0x4bd517[_0x5f6c('0x27')]],'as':_0x4bd517['as'],'attributes':_0x4bd517[_0x5f6c('0x28')],'include':_0x4bd517[_0x5f6c('0x26')]?_['map'](_0x4bd517[_0x5f6c('0x26')],function(_0x163a29){return{'model':db[_0x163a29['model']],'as':_0x163a29['as'],'attributes':_0x163a29[_0x5f6c('0x28')]};}):[]};}):[]};}):[]:[]})[_0x5f6c('0x13')](function(_0x57df0d){logger[_0x5f6c('0x14')](_0x5f6c('0x29'),_0x30003f);logger[_0x5f6c('0x17')](_0x5f6c('0x29'),_0x30003f,JSON[_0x5f6c('0x19')](_0x57df0d));_0x2bd0e8(_0x57df0d);})[_0x5f6c('0x1e')](function(_0x434f2b){logger['error']('GetFaxAccount',_0x434f2b[_0x5f6c('0x1c')],_0x30003f);_0x31df4d(_0x1d6f30[_0x5f6c('0x1a')](0x1f4,_0x434f2b['message']));});});};exports[_0x5f6c('0x2a')]=function(_0x23a55f,_0x240d0b,_0x2bfb16){var _0x372f26=this;return new Promise(function(_0x34a998,_0x101871){var _0x17fbc4={'body':_0x23a55f[_0x5f6c('0x2b')],'channel':_0x5f6c('0x2c')};var _0x3232ee=[];var _0x51dfe5=[];var _0x22cb59={};return db['CmContact'][_0x5f6c('0x2d')]()[_0x5f6c('0x13')](function(_0xb87394){if(!_0xb87394){throw new db[(_0x5f6c('0x2e'))][(_0x5f6c('0x2f'))]('no\x20available\x20attributes');}_0x3232ee=_[_0x5f6c('0x30')](_[_0x5f6c('0x31')](_0xb87394),[_0x5f6c('0x32'),_0x5f6c('0x33')]);_0x51dfe5=_['difference'](_[_0x5f6c('0x31')](_0xb87394),[_0x5f6c('0x32'),_0x5f6c('0x33'),_0x5f6c('0x34'),'ListId']);if(_0x23a55f['body']['id']){delete _0x23a55f[_0x5f6c('0x2b')]['id'];}if(_['isNil'](_0x23a55f[_0x5f6c('0x2b')][_0x5f6c('0x35')])){throw new db[(_0x5f6c('0x2e'))][(_0x5f6c('0x2f'))](_0x5f6c('0x36'));}if(_[_0x5f6c('0x37')](_0x23a55f[_0x5f6c('0x2b')]['body'])||_0x23a55f[_0x5f6c('0x2b')][_0x5f6c('0x2b')]===''){throw new db[(_0x5f6c('0x2e'))][(_0x5f6c('0x2f'))](_0x5f6c('0x38'));}if(_[_0x5f6c('0x37')](_0x23a55f[_0x5f6c('0x2b')][_0x5f6c('0x39')])){throw new db[(_0x5f6c('0x2e'))][(_0x5f6c('0x2f'))](_0x5f6c('0x3a')+_0x51dfe5);}if(!_[_0x5f6c('0x3b')](_0x51dfe5,_0x23a55f['body'][_0x5f6c('0x39')])){throw new db['Sequelize'][(_0x5f6c('0x2f'))](_0x5f6c('0x3c')+_0x51dfe5);}_0x22cb59[_0x23a55f['body'][_0x5f6c('0x39')]]=_0x23a55f[_0x5f6c('0x2b')][_0x5f6c('0x35')];})[_0x5f6c('0x13')](function(){return db['FaxAccount']['find']({'where':{'id':_0x23a55f[_0x5f6c('0x3d')]['id']},'include':[{'model':db['CmList'],'as':_0x5f6c('0x3e'),'include':[{'model':db[_0x5f6c('0x3f')],'as':_0x5f6c('0x40'),'where':_0x22cb59,'limit':0x1,'order':[[_0x5f6c('0x33'),'DESC']]}]},{'model':db[_0x5f6c('0x41')],'as':_0x5f6c('0x42')}]});})['then'](function(_0x1bec27){if(_0x1bec27&&_0x1bec27[_0x5f6c('0x3e')]){var _0x519e5a=_0x1bec27[_0x5f6c('0x43')]({'plain':!![]});_0x17fbc4[_0x5f6c('0x3d')]=_0x519e5a;_0x17fbc4['applications']=_0x519e5a['Applications'];_0x17fbc4[_0x5f6c('0x44')]=_0x519e5a[_0x5f6c('0x3e')];_0x17fbc4[_0x5f6c('0x45')]=_[_0x5f6c('0x46')](_0x17fbc4['applications'],[_0x5f6c('0x47')],[_0x5f6c('0x48')]);if(_0x17fbc4[_0x5f6c('0x3d')][_0x5f6c('0x42')]){delete _0x17fbc4[_0x5f6c('0x3d')][_0x5f6c('0x42')];}if(_0x17fbc4[_0x5f6c('0x3d')][_0x5f6c('0x3e')]&&_0x17fbc4[_0x5f6c('0x3d')]['List'][_0x5f6c('0x40')][_0x5f6c('0x49')]){return _0x17fbc4[_0x5f6c('0x3d')][_0x5f6c('0x3e')]['Contacts'][0x0];}var _0x5f4470=_['defaults'](_0x23a55f[_0x5f6c('0x2b')],{'firstName':_0x23a55f[_0x5f6c('0x2b')]['from'],'ListId':_0x519e5a[_0x5f6c('0x4a')]});_0x5f4470[_0x23a55f[_0x5f6c('0x2b')][_0x5f6c('0x39')]]=_0x23a55f[_0x5f6c('0x2b')][_0x5f6c('0x35')];return db[_0x5f6c('0x3f')][_0x5f6c('0x4b')](_0x5f4470,{'fields':_0x3232ee,'raw':!![]});}})[_0x5f6c('0x13')](function(_0x39bea0){_0x17fbc4[_0x5f6c('0x4c')]=_0x39bea0;if(_0x39bea0){var _0x335084={'ContactId':_0x39bea0['id'],'FaxAccountId':_0x23a55f[_0x5f6c('0x3d')]['id'],'fax':_0x39bea0[_0x5f6c('0x2c')]};return db[_0x5f6c('0x4d')][_0x5f6c('0x4e')]({'where':{'ContactId':_0x39bea0['id'],'closed':![],'FaxAccountId':_0x23a55f[_0x5f6c('0x3d')]['id']}})['then'](function(_0x3271ee){if(_0x3271ee){return[_0x3271ee,![]];}return db[_0x5f6c('0x4d')][_0x5f6c('0x4b')](_0x335084)['then'](function(_0x41cdc9){return[_0x41cdc9,!![]];});});}else{throw new Error(_0x5f6c('0x4f'));}})['spread'](function(_0x1a6f42,_0x566e58){var _0x42e43e=_0x1a6f42[_0x5f6c('0x43')]({'plain':!![]});if(_0x566e58){if(_0x17fbc4[_0x5f6c('0x3d')][_0x5f6c('0x50')]){_0x17fbc4[_0x5f6c('0x45')][_0x5f6c('0x51')]({'id':0x0,'priority':_0x17fbc4[_0x5f6c('0x45')][_0x5f6c('0x49')]+0x1,'app':_0x5f6c('0x52'),'appdata':_0x5f6c('0x53'),'interval':_0x5f6c('0x54')});}_0x42e43e[_0x5f6c('0x55')]=!![];}else{_0x42e43e[_0x5f6c('0x55')]=![];}_0x17fbc4['interaction']=_0x42e43e;return db[_0x5f6c('0x56')][_0x5f6c('0x4b')]({'body':_0x23a55f['body'][_0x5f6c('0x2b')],'FaxAccountId':_0x23a55f[_0x5f6c('0x3d')]['id'],'FaxInteractionId':_0x1a6f42['id'],'direction':'in','ContactId':_0x1a6f42[_0x5f6c('0x57')],'AttachmentId':_0x23a55f[_0x5f6c('0x2b')][_0x5f6c('0x58')]});})['then'](function(_0x113396){_0x17fbc4['message']=_0x113396;if(_0x17fbc4[_0x5f6c('0x59')][_0x5f6c('0x5a')]){return db[_0x5f6c('0x5b')]['find']({'attributes':['id',_0x5f6c('0x5c')],'where':{'id':_0x17fbc4[_0x5f6c('0x59')][_0x5f6c('0x5a')]}})[_0x5f6c('0x13')](function(_0x49f87d){if(_0x49f87d){_0x17fbc4[_0x5f6c('0x45')][_0x5f6c('0x5d')]({'id':0x0,'priority':0x0,'app':_0x5f6c('0x5e'),'appdata':_0x49f87d['name']+','+(_0x17fbc4[_0x5f6c('0x3d')][_0x5f6c('0x5f')]||0xa),'interval':_0x5f6c('0x54')});}return respondWithRpcPromise('Start',_0x5f6c('0x60'),_0x17fbc4);});}return respondWithRpcPromise(_0x5f6c('0x61'),'startRouting',_0x17fbc4);})[_0x5f6c('0x13')](function(_0x4914f4){_0x34a998(_0x4914f4);})[_0x5f6c('0x1e')](function(_0x5aaea4){_0x101871(_0x372f26['error'](0x1f4,_0x5aaea4[_0x5f6c('0x1c')]));});});}; \ No newline at end of file +var _0x3b16=['ValidationError','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','find','CmList','List','Contacts','DESC','Applications','get','account','applications','priority','create','contact','FaxInteraction','spread','autoclose','push','length','close','unmanaged','*,*,*,*','created','interaction','FaxMessage','AttachmentId','User','UserId','name','Start','startRouting','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./faxAccount.socket','register','request','then','info','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','error','code','message','catch','FaxAccount','options','raw','attributes','limit','include','map','model','GetFaxAccount','NotifyFaxAccount','body','CmContact','describe','Sequelize','no\x20available\x20attributes','difference','keys','createdAt','updatedAt','CompanyId','ListId','isNil','from'];(function(_0x3ef97b,_0x525c0a){var _0x2ec2d0=function(_0x137e32){while(--_0x137e32){_0x3ef97b['push'](_0x3ef97b['shift']());}};_0x2ec2d0(++_0x525c0a);}(_0x3b16,0x128));var _0x63b1=function(_0x4243a3,_0x447337){_0x4243a3=_0x4243a3-0x0;var _0x1b2a33=_0x3b16[_0x4243a3];return _0x1b2a33;};'use strict';var _=require('lodash');var util=require(_0x63b1('0x0'));var moment=require(_0x63b1('0x1'));var BPromise=require(_0x63b1('0x2'));var rs=require(_0x63b1('0x3'));var fs=require('fs');var Redis=require(_0x63b1('0x4'));var db=require(_0x63b1('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x63b1('0x6'))(_0x63b1('0x7'));var config=require(_0x63b1('0x8'));var jayson=require(_0x63b1('0x9'));var client=jayson[_0x63b1('0xa')][_0x63b1('0xb')]({'port':0x232c});config[_0x63b1('0xc')]=_[_0x63b1('0xd')](config[_0x63b1('0xc')],{'host':_0x63b1('0xe'),'port':0x18eb});var socket=require(_0x63b1('0xf'))(new Redis(config[_0x63b1('0xc')]));require(_0x63b1('0x10'))[_0x63b1('0x11')](socket);function respondWithRpcPromise(_0x3ec2ad,_0x37cc93,_0x8eeff6){return new BPromise(function(_0x13b778,_0xec8971){return client[_0x63b1('0x12')](_0x3ec2ad,_0x8eeff6)[_0x63b1('0x13')](function(_0x2476b6){logger[_0x63b1('0x14')](_0x63b1('0x15'),_0x37cc93,_0x63b1('0x16'));logger[_0x63b1('0x17')](_0x63b1('0x18'),_0x37cc93,_0x63b1('0x16'),JSON['stringify'](_0x2476b6));if(_0x2476b6['error']){if(_0x2476b6[_0x63b1('0x19')][_0x63b1('0x1a')]===0x1f4){logger[_0x63b1('0x19')](_0x63b1('0x15'),_0x37cc93,_0x2476b6['error']['message']);return _0xec8971(_0x2476b6[_0x63b1('0x19')]['message']);}logger['error'](_0x63b1('0x15'),_0x37cc93,_0x2476b6[_0x63b1('0x19')][_0x63b1('0x1b')]);return _0x13b778(_0x2476b6[_0x63b1('0x19')][_0x63b1('0x1b')]);}else{logger[_0x63b1('0x14')](_0x63b1('0x15'),_0x37cc93,_0x63b1('0x16'));_0x13b778(_0x2476b6['result'][_0x63b1('0x1b')]);}})[_0x63b1('0x1c')](function(_0x1f8da8){logger[_0x63b1('0x19')](_0x63b1('0x15'),_0x37cc93,_0x1f8da8);_0xec8971(_0x1f8da8);});});}exports['GetFaxAccount']=function(_0x18ca45){var _0x585f27=this;return new Promise(function(_0x2c93d6,_0xf34155){return db[_0x63b1('0x1d')]['findAll']({'raw':_0x18ca45[_0x63b1('0x1e')]?_0x18ca45['options'][_0x63b1('0x1f')]===undefined?!![]:![]:!![],'where':_0x18ca45[_0x63b1('0x1e')]?_0x18ca45['options']['where']||null:null,'attributes':_0x18ca45['options']?_0x18ca45[_0x63b1('0x1e')][_0x63b1('0x20')]||null:null,'limit':_0x18ca45[_0x63b1('0x1e')]?_0x18ca45[_0x63b1('0x1e')][_0x63b1('0x21')]||null:null,'include':_0x18ca45['options']?_0x18ca45[_0x63b1('0x1e')][_0x63b1('0x22')]?_[_0x63b1('0x23')](_0x18ca45[_0x63b1('0x1e')][_0x63b1('0x22')],function(_0x19db61){return{'model':db[_0x19db61[_0x63b1('0x24')]],'as':_0x19db61['as'],'attributes':_0x19db61['attributes'],'include':_0x19db61[_0x63b1('0x22')]?_[_0x63b1('0x23')](_0x19db61[_0x63b1('0x22')],function(_0x21f727){return{'model':db[_0x21f727[_0x63b1('0x24')]],'as':_0x21f727['as'],'attributes':_0x21f727[_0x63b1('0x20')],'include':_0x21f727[_0x63b1('0x22')]?_[_0x63b1('0x23')](_0x21f727[_0x63b1('0x22')],function(_0x104706){return{'model':db[_0x104706['model']],'as':_0x104706['as'],'attributes':_0x104706[_0x63b1('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4a2605){logger['info']('GetFaxAccount',_0x18ca45);logger[_0x63b1('0x17')](_0x63b1('0x25'),_0x18ca45,JSON['stringify'](_0x4a2605));_0x2c93d6(_0x4a2605);})[_0x63b1('0x1c')](function(_0x542ac0){logger[_0x63b1('0x19')](_0x63b1('0x25'),_0x542ac0[_0x63b1('0x1b')],_0x18ca45);_0xf34155(_0x585f27[_0x63b1('0x19')](0x1f4,_0x542ac0['message']));});});};exports[_0x63b1('0x26')]=function(_0x436bbe,_0x385c80,_0x26d817){var _0xd53392=this;return new Promise(function(_0x33c530,_0x29e100){var _0x5d7f38={'body':_0x436bbe[_0x63b1('0x27')],'channel':'fax'};var _0x27f2ca=[];var _0x271385=[];var _0x68aab1={};return db[_0x63b1('0x28')][_0x63b1('0x29')]()[_0x63b1('0x13')](function(_0x383645){if(!_0x383645){throw new db[(_0x63b1('0x2a'))]['ValidationError'](_0x63b1('0x2b'));}_0x27f2ca=_[_0x63b1('0x2c')](_[_0x63b1('0x2d')](_0x383645),[_0x63b1('0x2e'),_0x63b1('0x2f')]);_0x271385=_[_0x63b1('0x2c')](_[_0x63b1('0x2d')](_0x383645),[_0x63b1('0x2e'),'updatedAt',_0x63b1('0x30'),_0x63b1('0x31')]);if(_0x436bbe['body']['id']){delete _0x436bbe['body']['id'];}if(_[_0x63b1('0x32')](_0x436bbe['body'][_0x63b1('0x33')])){throw new db[(_0x63b1('0x2a'))][(_0x63b1('0x34'))](_0x63b1('0x35'));}if(_[_0x63b1('0x32')](_0x436bbe['body'][_0x63b1('0x27')])||_0x436bbe['body'][_0x63b1('0x27')]===''){throw new db[(_0x63b1('0x2a'))]['ValidationError'](_0x63b1('0x36'));}if(_[_0x63b1('0x32')](_0x436bbe['body'][_0x63b1('0x37')])){throw new db[(_0x63b1('0x2a'))][(_0x63b1('0x34'))](_0x63b1('0x38')+_0x271385);}if(!_[_0x63b1('0x39')](_0x271385,_0x436bbe['body']['mapKey'])){throw new db[(_0x63b1('0x2a'))][(_0x63b1('0x34'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x271385);}_0x68aab1[_0x436bbe[_0x63b1('0x27')][_0x63b1('0x37')]]=_0x436bbe['body']['from'];})['then'](function(){return db[_0x63b1('0x1d')][_0x63b1('0x3a')]({'where':{'id':_0x436bbe['account']['id']},'include':[{'model':db[_0x63b1('0x3b')],'as':_0x63b1('0x3c'),'include':[{'model':db[_0x63b1('0x28')],'as':_0x63b1('0x3d'),'where':_0x68aab1,'limit':0x1,'order':[[_0x63b1('0x2f'),_0x63b1('0x3e')]]}]},{'model':db['FaxApplication'],'as':_0x63b1('0x3f')}]});})[_0x63b1('0x13')](function(_0x37d7a2){if(_0x37d7a2&&_0x37d7a2['List']){var _0x2c9c4a=_0x37d7a2[_0x63b1('0x40')]({'plain':!![]});_0x5d7f38[_0x63b1('0x41')]=_0x2c9c4a;_0x5d7f38[_0x63b1('0x42')]=_0x2c9c4a['Applications'];_0x5d7f38['list']=_0x2c9c4a[_0x63b1('0x3c')];_0x5d7f38[_0x63b1('0x42')]=_['orderBy'](_0x5d7f38['applications'],[_0x63b1('0x43')],['asc']);if(_0x5d7f38['account'][_0x63b1('0x3f')]){delete _0x5d7f38[_0x63b1('0x41')][_0x63b1('0x3f')];}if(_0x5d7f38['account'][_0x63b1('0x3c')]&&_0x5d7f38[_0x63b1('0x41')]['List']['Contacts']['length']){return _0x5d7f38[_0x63b1('0x41')][_0x63b1('0x3c')][_0x63b1('0x3d')][0x0];}var _0x3a14a9=_[_0x63b1('0xd')](_0x436bbe['body'],{'firstName':_0x436bbe[_0x63b1('0x27')][_0x63b1('0x33')],'ListId':_0x2c9c4a[_0x63b1('0x31')]});_0x3a14a9[_0x436bbe['body'][_0x63b1('0x37')]]=_0x436bbe[_0x63b1('0x27')][_0x63b1('0x33')];return db[_0x63b1('0x28')][_0x63b1('0x44')](_0x3a14a9,{'fields':_0x27f2ca,'raw':!![]});}})['then'](function(_0x865d67){_0x5d7f38[_0x63b1('0x45')]=_0x865d67;if(_0x865d67){var _0x5707ef={'ContactId':_0x865d67['id'],'FaxAccountId':_0x436bbe['account']['id'],'fax':_0x865d67['fax']};return db[_0x63b1('0x46')]['find']({'where':{'ContactId':_0x865d67['id'],'closed':![],'FaxAccountId':_0x436bbe[_0x63b1('0x41')]['id']}})['then'](function(_0x2a842a){if(_0x2a842a){return[_0x2a842a,![]];}return db[_0x63b1('0x46')][_0x63b1('0x44')](_0x5707ef)[_0x63b1('0x13')](function(_0x4a1199){return[_0x4a1199,!![]];});});}else{throw new Error('Contact\x20not\x20found');}})[_0x63b1('0x47')](function(_0x2e96fe,_0x3f4f3e){var _0x2c1161=_0x2e96fe['get']({'plain':!![]});if(_0x3f4f3e){if(_0x5d7f38[_0x63b1('0x41')][_0x63b1('0x48')]){_0x5d7f38[_0x63b1('0x42')][_0x63b1('0x49')]({'id':0x0,'priority':_0x5d7f38[_0x63b1('0x42')][_0x63b1('0x4a')]+0x1,'app':_0x63b1('0x4b'),'appdata':_0x63b1('0x4c'),'interval':_0x63b1('0x4d')});}_0x2c1161[_0x63b1('0x4e')]=!![];}else{_0x2c1161[_0x63b1('0x4e')]=![];}_0x5d7f38[_0x63b1('0x4f')]=_0x2c1161;return db[_0x63b1('0x50')][_0x63b1('0x44')]({'body':_0x436bbe[_0x63b1('0x27')]['body'],'FaxAccountId':_0x436bbe[_0x63b1('0x41')]['id'],'FaxInteractionId':_0x2e96fe['id'],'direction':'in','ContactId':_0x2e96fe['ContactId'],'AttachmentId':_0x436bbe[_0x63b1('0x27')][_0x63b1('0x51')]});})[_0x63b1('0x13')](function(_0x5bde27){_0x5d7f38['message']=_0x5bde27;if(_0x5d7f38[_0x63b1('0x4f')]['UserId']){return db[_0x63b1('0x52')][_0x63b1('0x3a')]({'attributes':['id','name'],'where':{'id':_0x5d7f38[_0x63b1('0x4f')][_0x63b1('0x53')]}})['then'](function(_0x49c8d6){if(_0x49c8d6){_0x5d7f38[_0x63b1('0x42')]['unshift']({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x49c8d6[_0x63b1('0x54')]+','+(_0x5d7f38[_0x63b1('0x41')]['waitForTheAssignedAgent']||0xa),'interval':_0x63b1('0x4d')});}return respondWithRpcPromise(_0x63b1('0x55'),_0x63b1('0x56'),_0x5d7f38);});}return respondWithRpcPromise(_0x63b1('0x55'),'startRouting',_0x5d7f38);})['then'](function(_0xa4d54a){_0x33c530(_0xa4d54a);})[_0x63b1('0x1c')](function(_0x427777){_0x29e100(_0xd53392['error'](0x1f4,_0x427777[_0x63b1('0x1b')]));});});}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.socket.js b/server/api/faxAccount/faxAccount.socket.js index 3075d32..c7e0b40 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 _0xa955=['length','faxAccount:','save','emit','removeListener','register'];(function(_0x5d0d4a,_0x215dca){var _0xcabd37=function(_0x13e1a0){while(--_0x13e1a0){_0x5d0d4a['push'](_0x5d0d4a['shift']());}};_0xcabd37(++_0x215dca);}(_0xa955,0x6e));var _0x5a95=function(_0x543a8c,_0x376a61){_0x543a8c=_0x543a8c-0x0;var _0x510d8d=_0xa955[_0x543a8c];return _0x510d8d;};'use strict';var FaxAccountEvents=require('./faxAccount.events');var events=[_0x5a95('0x0'),'remove','update'];function createListener(_0x4db9e1,_0xeb960e){return function(_0x1df130){_0xeb960e[_0x5a95('0x1')](_0x4db9e1,_0x1df130);};}function removeListener(_0x59e259,_0x3c2185){return function(){FaxAccountEvents[_0x5a95('0x2')](_0x59e259,_0x3c2185);};}exports[_0x5a95('0x3')]=function(_0x16b37a){for(var _0x40ded4=0x0,_0x4aa4cc=events[_0x5a95('0x4')];_0x40ded4<_0x4aa4cc;_0x40ded4++){var _0x1c7db8=events[_0x40ded4];var _0x335e92=createListener(_0x5a95('0x5')+_0x1c7db8,_0x16b37a);FaxAccountEvents['on'](_0x1c7db8,_0x335e92);}}; \ No newline at end of file +var _0x8eb1=['removeListener','register','faxAccount:','./faxAccount.events','save','remove','update'];(function(_0x399056,_0x2672b4){var _0xea2e6d=function(_0x40a52e){while(--_0x40a52e){_0x399056['push'](_0x399056['shift']());}};_0xea2e6d(++_0x2672b4);}(_0x8eb1,0x192));var _0x18eb=function(_0x28956f,_0x503f2c){_0x28956f=_0x28956f-0x0;var _0x317c70=_0x8eb1[_0x28956f];return _0x317c70;};'use strict';var FaxAccountEvents=require(_0x18eb('0x0'));var events=[_0x18eb('0x1'),_0x18eb('0x2'),_0x18eb('0x3')];function createListener(_0x42044a,_0x47e961){return function(_0xd8195){_0x47e961['emit'](_0x42044a,_0xd8195);};}function removeListener(_0x5851cb,_0x18b425){return function(){FaxAccountEvents[_0x18eb('0x4')](_0x5851cb,_0x18b425);};}exports[_0x18eb('0x5')]=function(_0x3f00ba){for(var _0xa64e7f=0x0,_0x1724b8=events['length'];_0xa64e7f<_0x1724b8;_0xa64e7f++){var _0x23c814=events[_0xa64e7f];var _0x1e15dd=createListener(_0x18eb('0x6')+_0x23c814,_0x3f00ba);FaxAccountEvents['on'](_0x23c814,_0x1e15dd);}}; \ No newline at end of file diff --git a/server/api/faxAccount/index.js b/server/api/faxAccount/index.js index 2065a54..e1f9833 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(_0x53d393,_0x1f627b){var _0x4da19d=function(_0x585a3c){while(--_0x585a3c){_0x53d393['push'](_0x53d393['shift']());}};_0x4da19d(++_0x1f627b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x298ed3,_0x4ab5e1){_0x298ed3=_0x298ed3-0x0;var _0x5aad28=_0xa9e0[_0x298ed3];return _0x5aad28;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['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(_0x446375,_0x20b208){var _0x209267=function(_0x33b9db){while(--_0x33b9db){_0x446375['push'](_0x446375['shift']());}};_0x209267(++_0x20b208);}(_0xa9e0,0x123));var _0x0a9e=function(_0x481bf7,_0x437f69){_0x481bf7=_0x481bf7-0x0;var _0x461787=_0xa9e0[_0x481bf7];return _0x461787;};'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 19d648d..249a2f3 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 _0x6ffe=['sequelize','INTEGER','STRING','noop'];(function(_0x354ca7,_0x3a8120){var _0x1e1a3d=function(_0x402e4b){while(--_0x402e4b){_0x354ca7['push'](_0x354ca7['shift']());}};_0x1e1a3d(++_0x3a8120);}(_0x6ffe,0x1b0));var _0xe6ff=function(_0x14ec75,_0x56a3d4){_0x14ec75=_0x14ec75-0x0;var _0x40b9e9=_0x6ffe[_0x14ec75];return _0x40b9e9;};'use strict';var Sequelize=require(_0xe6ff('0x0'));module['exports']={'priority':{'type':Sequelize[_0xe6ff('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0xe6ff('0x2')],'allowNull':![],'defaultValue':_0xe6ff('0x3')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0xe6ff('0x2')]},'interval':{'type':Sequelize[_0xe6ff('0x2')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file +var _0x6420=['INTEGER','noop','TEXT','STRING','sequelize','exports'];(function(_0x29acbd,_0x56ebf4){var _0x253ca5=function(_0x5d9434){while(--_0x5d9434){_0x29acbd['push'](_0x29acbd['shift']());}};_0x253ca5(++_0x56ebf4);}(_0x6420,0xe8));var _0x0642=function(_0x277107,_0x3420dc){_0x277107=_0x277107-0x0;var _0x1da046=_0x6420[_0x277107];return _0x1da046;};'use strict';var Sequelize=require(_0x0642('0x0'));module[_0x0642('0x1')]={'priority':{'type':Sequelize[_0x0642('0x2')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x0642('0x3')},'appdata':{'type':Sequelize[_0x0642('0x4')]()},'description':{'type':Sequelize[_0x0642('0x5')]},'interval':{'type':Sequelize[_0x0642('0x5')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.controller.js b/server/api/faxApplication/faxApplication.controller.js index 5be45d0..9a1536e 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 _0x0d85=['length','hasOwnProperty','order','sort','where','pick','filter','merge','options','includeAll','include','rows','catch','intersection','find','create','body','params','eml-format','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','sendStatus','status','end','json','offset','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','name','index','FaxApplication','rawAttributes','fieldName','type','key','map','query','keys','filters','model','attributes','fields'];(function(_0x16b8e6,_0xce24fe){var _0xf5bab2=function(_0x5d21e2){while(--_0x5d21e2){_0x16b8e6['push'](_0x16b8e6['shift']());}};_0xf5bab2(++_0xce24fe);}(_0x0d85,0x132));var _0x50d8=function(_0x18e1ef,_0x2a380d){_0x18e1ef=_0x18e1ef-0x0;var _0x5e120b=_0x0d85[_0x18e1ef];return _0x5e120b;};'use strict';var emlformat=require(_0x50d8('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x50d8('0x1'));var jsonpatch=require(_0x50d8('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x50d8('0x3'));var Mustache=require(_0x50d8('0x4'));var util=require(_0x50d8('0x5'));var path=require(_0x50d8('0x6'));var sox=require(_0x50d8('0x7'));var csv=require(_0x50d8('0x8'));var ejs=require(_0x50d8('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x50d8('0xa'));var squel=require(_0x50d8('0xb'));var crypto=require(_0x50d8('0xc'));var jsforce=require(_0x50d8('0xd'));var deskjs=require(_0x50d8('0xe'));var toCsv=require(_0x50d8('0x8'));var querystring=require(_0x50d8('0xf'));var Papa=require(_0x50d8('0x10'));var Redis=require(_0x50d8('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x50d8('0x12'));var as=require(_0x50d8('0x13'));var hardwareService=require(_0x50d8('0x14'));var logger=require(_0x50d8('0x15'))(_0x50d8('0x16'));var utils=require('../../config/utils');var config=require(_0x50d8('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5f2dae,_0x22d8b7){_0x22d8b7=_0x22d8b7||0xcc;return function(_0x30287a){if(_0x30287a){return _0x5f2dae[_0x50d8('0x18')](_0x22d8b7);}return _0x5f2dae[_0x50d8('0x19')](_0x22d8b7)[_0x50d8('0x1a')]();};}function respondWithResult(_0xf0ad48,_0x124207){_0x124207=_0x124207||0xc8;return function(_0x5092a0){if(_0x5092a0){return _0xf0ad48['status'](_0x124207)[_0x50d8('0x1b')](_0x5092a0);}};}function respondWithFilteredResult(_0x3cb2d9,_0x38015a){return function(_0x1c682c){if(_0x1c682c){var _0x342b6e=typeof _0x38015a[_0x50d8('0x1c')]==='undefined'&&typeof _0x38015a['limit']==='undefined';var _0x478fbe=_0x1c682c[_0x50d8('0x1d')];var _0x114842=_0x342b6e?0x0:_0x38015a['offset'];var _0x558c7e=_0x342b6e?_0x1c682c[_0x50d8('0x1d')]:_0x38015a['offset']+_0x38015a[_0x50d8('0x1e')];var _0x2304ae;if(_0x558c7e>=_0x478fbe){_0x558c7e=_0x478fbe;_0x2304ae=0xc8;}else{_0x2304ae=0xce;}_0x3cb2d9[_0x50d8('0x19')](_0x2304ae);return _0x3cb2d9[_0x50d8('0x1f')](_0x50d8('0x20'),_0x114842+'-'+_0x558c7e+'/'+_0x478fbe)['json'](_0x1c682c);}return null;};}function patchUpdates(_0xf07d4e){return function(_0x40a46c){try{jsonpatch[_0x50d8('0x21')](_0x40a46c,_0xf07d4e,!![]);}catch(_0x1698d5){return BPromise[_0x50d8('0x22')](_0x1698d5);}return _0x40a46c[_0x50d8('0x23')]();};}function saveUpdates(_0x13eab9,_0x20db95){return function(_0x2d4243){if(_0x2d4243){return _0x2d4243[_0x50d8('0x24')](_0x13eab9)[_0x50d8('0x25')](function(_0x16e120){return _0x16e120;});}return null;};}function removeEntity(_0x593007,_0x5e057a){return function(_0x43e3c9){if(_0x43e3c9){return _0x43e3c9[_0x50d8('0x26')]()[_0x50d8('0x25')](function(){_0x593007[_0x50d8('0x19')](0xcc)[_0x50d8('0x1a')]();});}};}function handleEntityNotFound(_0x5e8df1,_0x1a791b){return function(_0x4d9a86){if(!_0x4d9a86){_0x5e8df1[_0x50d8('0x18')](0x194);}return _0x4d9a86;};}function handleError(_0xf524e0,_0x57c857){_0x57c857=_0x57c857||0x1f4;return function(_0x5b6044){logger[_0x50d8('0x27')](_0x5b6044['stack']);if(_0x5b6044[_0x50d8('0x28')]){delete _0x5b6044[_0x50d8('0x28')];}_0xf524e0[_0x50d8('0x19')](_0x57c857)['send'](_0x5b6044);};}exports[_0x50d8('0x29')]=function(_0xbc8cca,_0x5e5e23){var _0x522ea1={},_0x16e111={},_0x1a05c7={'count':0x0,'rows':[]};var _0x18b7b0=_['map'](db[_0x50d8('0x2a')][_0x50d8('0x2b')],function(_0x13e11a){return{'name':_0x13e11a[_0x50d8('0x2c')],'type':_0x13e11a[_0x50d8('0x2d')][_0x50d8('0x2e')]};});_0x16e111['model']=_[_0x50d8('0x2f')](_0x18b7b0,_0x50d8('0x28'));_0x16e111[_0x50d8('0x30')]=_[_0x50d8('0x31')](_0xbc8cca['query']);_0x16e111[_0x50d8('0x32')]=_['intersection'](_0x16e111[_0x50d8('0x33')],_0x16e111[_0x50d8('0x30')]);_0x522ea1[_0x50d8('0x34')]=_['intersection'](_0x16e111[_0x50d8('0x33')],qs['fields'](_0xbc8cca[_0x50d8('0x30')][_0x50d8('0x35')]));_0x522ea1[_0x50d8('0x34')]=_0x522ea1['attributes'][_0x50d8('0x36')]?_0x522ea1['attributes']:_0x16e111['model'];if(!_0xbc8cca['query'][_0x50d8('0x37')]('nolimit')){_0x522ea1['limit']=qs[_0x50d8('0x1e')](_0xbc8cca[_0x50d8('0x30')][_0x50d8('0x1e')]);_0x522ea1['offset']=qs[_0x50d8('0x1c')](_0xbc8cca[_0x50d8('0x30')][_0x50d8('0x1c')]);}_0x522ea1[_0x50d8('0x38')]=qs[_0x50d8('0x39')](_0xbc8cca[_0x50d8('0x30')]['sort']);_0x522ea1[_0x50d8('0x3a')]=qs[_0x50d8('0x32')](_[_0x50d8('0x3b')](_0xbc8cca[_0x50d8('0x30')],_0x16e111[_0x50d8('0x32')]),_0x18b7b0);if(_0xbc8cca[_0x50d8('0x30')][_0x50d8('0x3c')]){_0x522ea1[_0x50d8('0x3a')]=_[_0x50d8('0x3d')](_0x522ea1['where'],{'$or':_['map'](_0x18b7b0,function(_0x41c387){if(_0x41c387[_0x50d8('0x2d')]!=='VIRTUAL'){var _0x3fdb4b={};_0x3fdb4b[_0x41c387[_0x50d8('0x28')]]={'$like':'%'+_0xbc8cca[_0x50d8('0x30')][_0x50d8('0x3c')]+'%'};return _0x3fdb4b;}})});}_0x522ea1=_['merge']({},_0x522ea1,_0xbc8cca[_0x50d8('0x3e')]);var _0x2ddb2b={'where':_0x522ea1['where']};return db['FaxApplication'][_0x50d8('0x1d')](_0x2ddb2b)['then'](function(_0x575307){_0x1a05c7[_0x50d8('0x1d')]=_0x575307;if(_0xbc8cca[_0x50d8('0x30')][_0x50d8('0x3f')]){_0x522ea1[_0x50d8('0x40')]=[{'all':!![]}];}return db[_0x50d8('0x2a')]['findAll'](_0x522ea1);})[_0x50d8('0x25')](function(_0x44dc9c){_0x1a05c7[_0x50d8('0x41')]=_0x44dc9c;return _0x1a05c7;})['then'](respondWithFilteredResult(_0x5e5e23,_0x522ea1))[_0x50d8('0x42')](handleError(_0x5e5e23,null));};exports['show']=function(_0xda8b54,_0x318a5b){var _0x1be10d={'raw':!![],'where':{'id':_0xda8b54['params']['id']}},_0x2df5bb={};_0x2df5bb[_0x50d8('0x33')]=_[_0x50d8('0x31')](db[_0x50d8('0x2a')][_0x50d8('0x2b')]);_0x2df5bb['query']=_[_0x50d8('0x31')](_0xda8b54['query']);_0x2df5bb[_0x50d8('0x32')]=_[_0x50d8('0x43')](_0x2df5bb[_0x50d8('0x33')],_0x2df5bb[_0x50d8('0x30')]);_0x1be10d[_0x50d8('0x34')]=_[_0x50d8('0x43')](_0x2df5bb[_0x50d8('0x33')],qs[_0x50d8('0x35')](_0xda8b54[_0x50d8('0x30')][_0x50d8('0x35')]));_0x1be10d[_0x50d8('0x34')]=_0x1be10d[_0x50d8('0x34')][_0x50d8('0x36')]?_0x1be10d[_0x50d8('0x34')]:_0x2df5bb[_0x50d8('0x33')];if(_0xda8b54['query'][_0x50d8('0x3f')]){_0x1be10d[_0x50d8('0x40')]=[{'all':!![]}];}_0x1be10d=_['merge']({},_0x1be10d,_0xda8b54[_0x50d8('0x3e')]);return db['FaxApplication'][_0x50d8('0x44')](_0x1be10d)[_0x50d8('0x25')](handleEntityNotFound(_0x318a5b,null))[_0x50d8('0x25')](respondWithResult(_0x318a5b,null))[_0x50d8('0x42')](handleError(_0x318a5b,null));};exports[_0x50d8('0x45')]=function(_0x45d242,_0x5749e3){return db[_0x50d8('0x2a')]['create'](_0x45d242[_0x50d8('0x46')],{})[_0x50d8('0x25')](respondWithResult(_0x5749e3,0xc9))[_0x50d8('0x42')](handleError(_0x5749e3,null));};exports[_0x50d8('0x24')]=function(_0x4e6731,_0x2b3555){if(_0x4e6731['body']['id']){delete _0x4e6731[_0x50d8('0x46')]['id'];}return db['FaxApplication'][_0x50d8('0x44')]({'where':{'id':_0x4e6731[_0x50d8('0x47')]['id']}})['then'](handleEntityNotFound(_0x2b3555,null))[_0x50d8('0x25')](saveUpdates(_0x4e6731[_0x50d8('0x46')],null))['then'](respondWithResult(_0x2b3555,null))[_0x50d8('0x42')](handleError(_0x2b3555,null));};exports['destroy']=function(_0x42b036,_0x47ce8d){return db[_0x50d8('0x2a')][_0x50d8('0x44')]({'where':{'id':_0x42b036[_0x50d8('0x47')]['id']}})[_0x50d8('0x25')](handleEntityNotFound(_0x47ce8d,null))['then'](removeEntity(_0x47ce8d,null))[_0x50d8('0x42')](handleError(_0x47ce8d,null));}; \ No newline at end of file +var _0x3ded=['then','destroy','end','error','name','send','index','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','fields','attributes','nolimit','order','sort','where','pick','filter','merge','options','includeAll','findAll','rows','catch','show','FaxApplication','keys','length','find','create','body','params','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','crypto','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','limit','undefined','count','apply','save','update'];(function(_0x27a399,_0x5860a8){var _0x5cfafc=function(_0x595a58){while(--_0x595a58){_0x27a399['push'](_0x27a399['shift']());}};_0x5cfafc(++_0x5860a8);}(_0x3ded,0x14a));var _0xd3de=function(_0x24237f,_0x4cf32c){_0x24237f=_0x24237f-0x0;var _0x48298e=_0x3ded[_0x24237f];return _0x48298e;};'use strict';var emlformat=require(_0xd3de('0x0'));var rimraf=require(_0xd3de('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd3de('0x2'));var rp=require(_0xd3de('0x3'));var moment=require(_0xd3de('0x4'));var BPromise=require(_0xd3de('0x5'));var Mustache=require(_0xd3de('0x6'));var util=require(_0xd3de('0x7'));var path=require(_0xd3de('0x8'));var sox=require(_0xd3de('0x9'));var csv=require('to-csv');var ejs=require(_0xd3de('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0xd3de('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xd3de('0xc'));var toCsv=require(_0xd3de('0xd'));var querystring=require(_0xd3de('0xe'));var Papa=require(_0xd3de('0xf'));var Redis=require('ioredis');var authService=require(_0xd3de('0x10'));var qs=require(_0xd3de('0x11'));var as=require(_0xd3de('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd3de('0x13'))(_0xd3de('0x14'));var utils=require(_0xd3de('0x15'));var config=require(_0xd3de('0x16'));var licenseUtil=require(_0xd3de('0x17'));var db=require(_0xd3de('0x18'))['db'];function respondWithStatusCode(_0x20abe7,_0x3395c6){_0x3395c6=_0x3395c6||0xcc;return function(_0x437ecb){if(_0x437ecb){return _0x20abe7[_0xd3de('0x19')](_0x3395c6);}return _0x20abe7[_0xd3de('0x1a')](_0x3395c6)['end']();};}function respondWithResult(_0x29a568,_0x180393){_0x180393=_0x180393||0xc8;return function(_0x3e6489){if(_0x3e6489){return _0x29a568['status'](_0x180393)[_0xd3de('0x1b')](_0x3e6489);}};}function respondWithFilteredResult(_0x10cb08,_0x4b4514){return function(_0x1e41eb){if(_0x1e41eb){var _0x1eb149=typeof _0x4b4514[_0xd3de('0x1c')]==='undefined'&&typeof _0x4b4514[_0xd3de('0x1d')]===_0xd3de('0x1e');var _0x19d545=_0x1e41eb[_0xd3de('0x1f')];var _0x11b6f5=_0x1eb149?0x0:_0x4b4514['offset'];var _0x3acb91=_0x1eb149?_0x1e41eb[_0xd3de('0x1f')]:_0x4b4514['offset']+_0x4b4514[_0xd3de('0x1d')];var _0x5387e5;if(_0x3acb91>=_0x19d545){_0x3acb91=_0x19d545;_0x5387e5=0xc8;}else{_0x5387e5=0xce;}_0x10cb08[_0xd3de('0x1a')](_0x5387e5);return _0x10cb08['set']('Content-Range',_0x11b6f5+'-'+_0x3acb91+'/'+_0x19d545)[_0xd3de('0x1b')](_0x1e41eb);}return null;};}function patchUpdates(_0x41599f){return function(_0x2401a8){try{jsonpatch[_0xd3de('0x20')](_0x2401a8,_0x41599f,!![]);}catch(_0x4f15f7){return BPromise['reject'](_0x4f15f7);}return _0x2401a8[_0xd3de('0x21')]();};}function saveUpdates(_0x5e2437,_0x1e789a){return function(_0x30ac91){if(_0x30ac91){return _0x30ac91[_0xd3de('0x22')](_0x5e2437)[_0xd3de('0x23')](function(_0x5b9e73){return _0x5b9e73;});}return null;};}function removeEntity(_0x16458d,_0xe7ad3e){return function(_0x47885e){if(_0x47885e){return _0x47885e[_0xd3de('0x24')]()[_0xd3de('0x23')](function(){_0x16458d[_0xd3de('0x1a')](0xcc)[_0xd3de('0x25')]();});}};}function handleEntityNotFound(_0x3422c0,_0x1f93b3){return function(_0x5a6c2b){if(!_0x5a6c2b){_0x3422c0[_0xd3de('0x19')](0x194);}return _0x5a6c2b;};}function handleError(_0x30a155,_0x701b44){_0x701b44=_0x701b44||0x1f4;return function(_0x3fa761){logger[_0xd3de('0x26')](_0x3fa761['stack']);if(_0x3fa761['name']){delete _0x3fa761[_0xd3de('0x27')];}_0x30a155[_0xd3de('0x1a')](_0x701b44)[_0xd3de('0x28')](_0x3fa761);};}exports[_0xd3de('0x29')]=function(_0x489bc2,_0x4d1c5b){var _0x2d51bc={},_0x469b0d={},_0x103557={'count':0x0,'rows':[]};var _0xa1ac36=_['map'](db['FaxApplication'][_0xd3de('0x2a')],function(_0x57c7fa){return{'name':_0x57c7fa[_0xd3de('0x2b')],'type':_0x57c7fa[_0xd3de('0x2c')][_0xd3de('0x2d')]};});_0x469b0d[_0xd3de('0x2e')]=_[_0xd3de('0x2f')](_0xa1ac36,_0xd3de('0x27'));_0x469b0d[_0xd3de('0x30')]=_['keys'](_0x489bc2[_0xd3de('0x30')]);_0x469b0d[_0xd3de('0x31')]=_['intersection'](_0x469b0d['model'],_0x469b0d[_0xd3de('0x30')]);_0x2d51bc['attributes']=_[_0xd3de('0x32')](_0x469b0d[_0xd3de('0x2e')],qs[_0xd3de('0x33')](_0x489bc2['query'][_0xd3de('0x33')]));_0x2d51bc['attributes']=_0x2d51bc[_0xd3de('0x34')]['length']?_0x2d51bc[_0xd3de('0x34')]:_0x469b0d['model'];if(!_0x489bc2[_0xd3de('0x30')]['hasOwnProperty'](_0xd3de('0x35'))){_0x2d51bc['limit']=qs[_0xd3de('0x1d')](_0x489bc2[_0xd3de('0x30')]['limit']);_0x2d51bc[_0xd3de('0x1c')]=qs[_0xd3de('0x1c')](_0x489bc2['query'][_0xd3de('0x1c')]);}_0x2d51bc[_0xd3de('0x36')]=qs[_0xd3de('0x37')](_0x489bc2[_0xd3de('0x30')][_0xd3de('0x37')]);_0x2d51bc[_0xd3de('0x38')]=qs[_0xd3de('0x31')](_[_0xd3de('0x39')](_0x489bc2[_0xd3de('0x30')],_0x469b0d[_0xd3de('0x31')]),_0xa1ac36);if(_0x489bc2[_0xd3de('0x30')][_0xd3de('0x3a')]){_0x2d51bc[_0xd3de('0x38')]=_[_0xd3de('0x3b')](_0x2d51bc[_0xd3de('0x38')],{'$or':_[_0xd3de('0x2f')](_0xa1ac36,function(_0x567369){if(_0x567369[_0xd3de('0x2c')]!=='VIRTUAL'){var _0x42d68c={};_0x42d68c[_0x567369[_0xd3de('0x27')]]={'$like':'%'+_0x489bc2[_0xd3de('0x30')]['filter']+'%'};return _0x42d68c;}})});}_0x2d51bc=_[_0xd3de('0x3b')]({},_0x2d51bc,_0x489bc2[_0xd3de('0x3c')]);var _0x585372={'where':_0x2d51bc[_0xd3de('0x38')]};return db['FaxApplication'][_0xd3de('0x1f')](_0x585372)['then'](function(_0x14cd69){_0x103557[_0xd3de('0x1f')]=_0x14cd69;if(_0x489bc2[_0xd3de('0x30')][_0xd3de('0x3d')]){_0x2d51bc['include']=[{'all':!![]}];}return db['FaxApplication'][_0xd3de('0x3e')](_0x2d51bc);})[_0xd3de('0x23')](function(_0x560397){_0x103557[_0xd3de('0x3f')]=_0x560397;return _0x103557;})[_0xd3de('0x23')](respondWithFilteredResult(_0x4d1c5b,_0x2d51bc))[_0xd3de('0x40')](handleError(_0x4d1c5b,null));};exports[_0xd3de('0x41')]=function(_0x5d1199,_0x3e2569){var _0x3a839d={'raw':!![],'where':{'id':_0x5d1199['params']['id']}},_0xdad7e2={};_0xdad7e2[_0xd3de('0x2e')]=_['keys'](db[_0xd3de('0x42')][_0xd3de('0x2a')]);_0xdad7e2[_0xd3de('0x30')]=_[_0xd3de('0x43')](_0x5d1199[_0xd3de('0x30')]);_0xdad7e2['filters']=_[_0xd3de('0x32')](_0xdad7e2[_0xd3de('0x2e')],_0xdad7e2[_0xd3de('0x30')]);_0x3a839d[_0xd3de('0x34')]=_[_0xd3de('0x32')](_0xdad7e2[_0xd3de('0x2e')],qs['fields'](_0x5d1199[_0xd3de('0x30')][_0xd3de('0x33')]));_0x3a839d[_0xd3de('0x34')]=_0x3a839d[_0xd3de('0x34')][_0xd3de('0x44')]?_0x3a839d[_0xd3de('0x34')]:_0xdad7e2[_0xd3de('0x2e')];if(_0x5d1199['query']['includeAll']){_0x3a839d['include']=[{'all':!![]}];}_0x3a839d=_['merge']({},_0x3a839d,_0x5d1199[_0xd3de('0x3c')]);return db['FaxApplication'][_0xd3de('0x45')](_0x3a839d)[_0xd3de('0x23')](handleEntityNotFound(_0x3e2569,null))['then'](respondWithResult(_0x3e2569,null))[_0xd3de('0x40')](handleError(_0x3e2569,null));};exports[_0xd3de('0x46')]=function(_0x50e50e,_0x90efe9){return db['FaxApplication']['create'](_0x50e50e[_0xd3de('0x47')],{})[_0xd3de('0x23')](respondWithResult(_0x90efe9,0xc9))[_0xd3de('0x40')](handleError(_0x90efe9,null));};exports[_0xd3de('0x22')]=function(_0x3fc6f6,_0x342ac4){if(_0x3fc6f6[_0xd3de('0x47')]['id']){delete _0x3fc6f6['body']['id'];}return db[_0xd3de('0x42')]['find']({'where':{'id':_0x3fc6f6['params']['id']}})['then'](handleEntityNotFound(_0x342ac4,null))['then'](saveUpdates(_0x3fc6f6[_0xd3de('0x47')],null))[_0xd3de('0x23')](respondWithResult(_0x342ac4,null))[_0xd3de('0x40')](handleError(_0x342ac4,null));};exports['destroy']=function(_0x563920,_0x145bc4){return db[_0xd3de('0x42')][_0xd3de('0x45')]({'where':{'id':_0x563920[_0xd3de('0x48')]['id']}})[_0xd3de('0x23')](handleEntityNotFound(_0x145bc4,null))[_0xd3de('0x23')](removeEntity(_0x145bc4,null))[_0xd3de('0x40')](handleError(_0x145bc4,null));}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.model.js b/server/api/faxApplication/faxApplication.model.js index 6bc4a8d..bfe6e64 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 _0xdfdd=['path','../../config/environment','exports','fax_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','bluebird'];(function(_0x4e5552,_0x19ec4e){var _0x60a338=function(_0x40c70e){while(--_0x40c70e){_0x4e5552['push'](_0x4e5552['shift']());}};_0x60a338(++_0x19ec4e);}(_0xdfdd,0x1b3));var _0xddfd=function(_0x5a656b,_0x501130){_0x5a656b=_0x5a656b-0x0;var _0x2c61cf=_0xdfdd[_0x5a656b];return _0x2c61cf;};'use strict';var _=require(_0xddfd('0x0'));var util=require(_0xddfd('0x1'));var logger=require(_0xddfd('0x2'))('api');var moment=require(_0xddfd('0x3'));var BPromise=require(_0xddfd('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xddfd('0x5'));var rimraf=require('rimraf');var config=require(_0xddfd('0x6'));var attributes=require('./faxApplication.attributes');module[_0xddfd('0x7')]=function(_0x3dbd7e,_0x371f8a){return _0x3dbd7e['define']('FaxApplication',attributes,{'tableName':_0xddfd('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xddfd('0x9'),'collate':_0xddfd('0xa')});}; \ No newline at end of file +var _0xb778=['define','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports'];(function(_0x184d15,_0x156b5d){var _0x4989da=function(_0x5ea4f0){while(--_0x5ea4f0){_0x184d15['push'](_0x184d15['shift']());}};_0x4989da(++_0x156b5d);}(_0xb778,0x147));var _0x8b77=function(_0x1cf870,_0x5f172d){_0x1cf870=_0x1cf870-0x0;var _0x439018=_0xb778[_0x1cf870];return _0x439018;};'use strict';var _=require(_0x8b77('0x0'));var util=require('util');var logger=require(_0x8b77('0x1'))('api');var moment=require(_0x8b77('0x2'));var BPromise=require(_0x8b77('0x3'));var rp=require(_0x8b77('0x4'));var fs=require('fs');var path=require(_0x8b77('0x5'));var rimraf=require(_0x8b77('0x6'));var config=require(_0x8b77('0x7'));var attributes=require('./faxApplication.attributes');module[_0x8b77('0x8')]=function(_0x96ba55,_0x50ee9c){return _0x96ba55[_0x8b77('0x9')]('FaxApplication',attributes,{'tableName':'fax_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x8b77('0xa'),'collate':_0x8b77('0xb')});}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.rpc.js b/server/api/faxApplication/faxApplication.rpc.js index de79415..3dd9891 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 _0xea4a=['FaxApplication,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','FaxApplication','update','body','options','raw','where','UpdateFaxApplication','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/environment','jayson/promise','client','http','then','info','FaxApplication,\x20%s,\x20%s','debug'];(function(_0x3fbbdf,_0x168c77){var _0x5677df=function(_0x5110ab){while(--_0x5110ab){_0x3fbbdf['push'](_0x3fbbdf['shift']());}};_0x5677df(++_0x168c77);}(_0xea4a,0x10a));var _0xaea4=function(_0x44e7d1,_0x1948bd){_0x44e7d1=_0x44e7d1-0x0;var _0x1ba29d=_0xea4a[_0x44e7d1];return _0x1ba29d;};'use strict';var _=require(_0xaea4('0x0'));var util=require(_0xaea4('0x1'));var moment=require(_0xaea4('0x2'));var BPromise=require('bluebird');var rs=require(_0xaea4('0x3'));var fs=require('fs');var Redis=require(_0xaea4('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xaea4('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0xaea4('0x6'));var jayson=require(_0xaea4('0x7'));var client=jayson[_0xaea4('0x8')][_0xaea4('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x25b822,_0x113876,_0x9423e0){return new BPromise(function(_0x51088c,_0x14917c){return client['request'](_0x25b822,_0x9423e0)[_0xaea4('0xa')](function(_0x3397d5){logger[_0xaea4('0xb')](_0xaea4('0xc'),_0x113876,'request\x20sent');logger[_0xaea4('0xd')](_0xaea4('0xe'),_0x113876,_0xaea4('0xf'),JSON[_0xaea4('0x10')](_0x3397d5));if(_0x3397d5[_0xaea4('0x11')]){if(_0x3397d5[_0xaea4('0x11')][_0xaea4('0x12')]===0x1f4){logger[_0xaea4('0x11')](_0xaea4('0xc'),_0x113876,_0x3397d5[_0xaea4('0x11')][_0xaea4('0x13')]);return _0x14917c(_0x3397d5[_0xaea4('0x11')]['message']);}logger[_0xaea4('0x11')](_0xaea4('0xc'),_0x113876,_0x3397d5['error']['message']);return _0x51088c(_0x3397d5[_0xaea4('0x11')][_0xaea4('0x13')]);}else{logger[_0xaea4('0xb')](_0xaea4('0xc'),_0x113876,_0xaea4('0xf'));_0x51088c(_0x3397d5['result'][_0xaea4('0x13')]);}})['catch'](function(_0x3dd46f){logger[_0xaea4('0x11')](_0xaea4('0xc'),_0x113876,_0x3dd46f);_0x14917c(_0x3dd46f);});});}exports['UpdateFaxApplication']=function(_0x55b45a){var _0xa3ba71=this;return new Promise(function(_0xff801d,_0x44e03c){return db[_0xaea4('0x14')][_0xaea4('0x15')](_0x55b45a[_0xaea4('0x16')],{'raw':_0x55b45a['options']?_0x55b45a[_0xaea4('0x17')][_0xaea4('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x55b45a[_0xaea4('0x17')]?_0x55b45a['options'][_0xaea4('0x19')]||null:null,'attributes':_0x55b45a[_0xaea4('0x17')]?_0x55b45a[_0xaea4('0x17')]['attributes']||null:null,'limit':_0x55b45a[_0xaea4('0x17')]?_0x55b45a['options']['limit']||null:null})['then'](function(_0x4fed76){logger[_0xaea4('0xb')]('UpdateFaxApplication',_0x55b45a);logger['debug'](_0xaea4('0x1a'),_0x55b45a,JSON[_0xaea4('0x10')](_0x4fed76));_0xff801d(_0x4fed76);})[_0xaea4('0x1b')](function(_0x23df55){logger['error'](_0xaea4('0x1a'),_0x23df55[_0xaea4('0x13')],_0x55b45a);_0x44e03c(_0xa3ba71[_0xaea4('0x11')](0x1f4,_0x23df55['message']));});});}; \ No newline at end of file +var _0xc439=['info','request\x20sent','FaxApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','FaxApplication,\x20%s,\x20%s','result','catch','FaxApplication','body','options','raw','where','attributes','limit','then','UpdateFaxApplication','debug','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','request'];(function(_0xe97226,_0x10c7b0){var _0xa2a9ca=function(_0x32f97c){while(--_0x32f97c){_0xe97226['push'](_0xe97226['shift']());}};_0xa2a9ca(++_0x10c7b0);}(_0xc439,0x174));var _0x9c43=function(_0x31d117,_0x227b9b){_0x31d117=_0x31d117-0x0;var _0x123310=_0xc439[_0x31d117];return _0x123310;};'use strict';var _=require(_0x9c43('0x0'));var util=require(_0x9c43('0x1'));var moment=require(_0x9c43('0x2'));var BPromise=require(_0x9c43('0x3'));var rs=require(_0x9c43('0x4'));var fs=require('fs');var Redis=require(_0x9c43('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x9c43('0x6'))(_0x9c43('0x7'));var config=require(_0x9c43('0x8'));var jayson=require(_0x9c43('0x9'));var client=jayson[_0x9c43('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x302ca1,_0xdb81c1,_0x456ee4){return new BPromise(function(_0x22f007,_0x3d334a){return client[_0x9c43('0xb')](_0x302ca1,_0x456ee4)['then'](function(_0x329571){logger[_0x9c43('0xc')]('FaxApplication,\x20%s,\x20%s',_0xdb81c1,_0x9c43('0xd'));logger['debug'](_0x9c43('0xe'),_0xdb81c1,_0x9c43('0xd'),JSON[_0x9c43('0xf')](_0x329571));if(_0x329571[_0x9c43('0x10')]){if(_0x329571['error'][_0x9c43('0x11')]===0x1f4){logger[_0x9c43('0x10')]('FaxApplication,\x20%s,\x20%s',_0xdb81c1,_0x329571['error'][_0x9c43('0x12')]);return _0x3d334a(_0x329571[_0x9c43('0x10')][_0x9c43('0x12')]);}logger[_0x9c43('0x10')](_0x9c43('0x13'),_0xdb81c1,_0x329571[_0x9c43('0x10')][_0x9c43('0x12')]);return _0x22f007(_0x329571['error']['message']);}else{logger[_0x9c43('0xc')](_0x9c43('0x13'),_0xdb81c1,_0x9c43('0xd'));_0x22f007(_0x329571[_0x9c43('0x14')]['message']);}})[_0x9c43('0x15')](function(_0x21a3b4){logger[_0x9c43('0x10')](_0x9c43('0x13'),_0xdb81c1,_0x21a3b4);_0x3d334a(_0x21a3b4);});});}exports['UpdateFaxApplication']=function(_0x2544d1){var _0x1337cb=this;return new Promise(function(_0x51caee,_0x120b7c){return db[_0x9c43('0x16')]['update'](_0x2544d1[_0x9c43('0x17')],{'raw':_0x2544d1[_0x9c43('0x18')]?_0x2544d1[_0x9c43('0x18')][_0x9c43('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2544d1[_0x9c43('0x18')]?_0x2544d1[_0x9c43('0x18')][_0x9c43('0x1a')]||null:null,'attributes':_0x2544d1[_0x9c43('0x18')]?_0x2544d1[_0x9c43('0x18')][_0x9c43('0x1b')]||null:null,'limit':_0x2544d1[_0x9c43('0x18')]?_0x2544d1[_0x9c43('0x18')][_0x9c43('0x1c')]||null:null})[_0x9c43('0x1d')](function(_0x1c56e7){logger[_0x9c43('0xc')](_0x9c43('0x1e'),_0x2544d1);logger[_0x9c43('0x1f')](_0x9c43('0x1e'),_0x2544d1,JSON['stringify'](_0x1c56e7));_0x51caee(_0x1c56e7);})[_0x9c43('0x15')](function(_0x2dd1bc){logger['error'](_0x9c43('0x1e'),_0x2dd1bc['message'],_0x2544d1);_0x120b7c(_0x1337cb[_0x9c43('0x10')](0x1f4,_0x2dd1bc[_0x9c43('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/faxApplication/index.js b/server/api/faxApplication/index.js index d437992..0803149 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 _0x14a0=['get','isAuthenticated','/:id','show','create','delete','destroy','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./faxApplication.controller'];(function(_0x265d8d,_0x2ef29f){var _0x210a0a=function(_0x5480f9){while(--_0x5480f9){_0x265d8d['push'](_0x265d8d['shift']());}};_0x210a0a(++_0x2ef29f);}(_0x14a0,0x8e));var _0x014a=function(_0x2f8530,_0x5cbd67){_0x2f8530=_0x2f8530-0x0;var _0x5e814e=_0x14a0[_0x2f8530];return _0x5e814e;};'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['post']('/',auth['isAuthenticated'](),controller[_0x014a('0xc')]);router['put']('/:id',auth['isAuthenticated'](),controller['update']);router[_0x014a('0xd')]('/:id',auth[_0x014a('0x9')](),controller[_0x014a('0xe')]);module['exports']=router; \ No newline at end of file +var _0xf7b4=['express','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxApplication.controller','get','isAuthenticated','index','/:id','show','post','put','update','delete','destroy','multer','connect-timeout'];(function(_0x24618a,_0x2cd0f4){var _0x2e3d64=function(_0x28c59c){while(--_0x28c59c){_0x24618a['push'](_0x24618a['shift']());}};_0x2e3d64(++_0x2cd0f4);}(_0xf7b4,0x152));var _0x4f7b=function(_0xe62d5,_0x35cbb4){_0xe62d5=_0xe62d5-0x0;var _0x2973ae=_0xf7b4[_0xe62d5];return _0x2973ae;};'use strict';var multer=require(_0x4f7b('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x4f7b('0x1'));var express=require(_0x4f7b('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x4f7b('0x3'));var interaction=require(_0x4f7b('0x4'));var config=require(_0x4f7b('0x5'));var controller=require(_0x4f7b('0x6'));router[_0x4f7b('0x7')]('/',auth[_0x4f7b('0x8')](),controller[_0x4f7b('0x9')]);router[_0x4f7b('0x7')](_0x4f7b('0xa'),auth[_0x4f7b('0x8')](),controller[_0x4f7b('0xb')]);router[_0x4f7b('0xc')]('/',auth[_0x4f7b('0x8')](),controller['create']);router[_0x4f7b('0xd')](_0x4f7b('0xa'),auth['isAuthenticated'](),controller[_0x4f7b('0xe')]);router[_0x4f7b('0xf')](_0x4f7b('0xa'),auth[_0x4f7b('0x8')](),controller[_0x4f7b('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 920db6e..3708f1a 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 _0x5152=['sequelize','exports','BOOLEAN','STRING','DATE','out','ENUM'];(function(_0x44a784,_0x479da0){var _0x70d93a=function(_0x2774b8){while(--_0x2774b8){_0x44a784['push'](_0x44a784['shift']());}};_0x70d93a(++_0x479da0);}(_0x5152,0xe7));var _0x2515=function(_0x336ca2,_0x1a813a){_0x336ca2=_0x336ca2-0x0;var _0xda59a6=_0x5152[_0x336ca2];return _0xda59a6;};'use strict';var Sequelize=require(_0x2515('0x0'));module[_0x2515('0x1')]={'closed':{'type':Sequelize[_0x2515('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x2515('0x3')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x2515('0x3')]},'note':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0x2515('0x4')]},'fax':{'type':Sequelize[_0x2515('0x3')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0x2515('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x2515('0x4')]},'lastMsgDirection':{'type':Sequelize[_0x2515('0x6')]('in',_0x2515('0x5')),'defaultValue':'in','allowNull':![]}}; \ No newline at end of file +var _0x7bab=['ENUM','out','sequelize','exports','BOOLEAN','STRING','DATE'];(function(_0x2a41f3,_0x5bf151){var _0x284df2=function(_0x315784){while(--_0x315784){_0x2a41f3['push'](_0x2a41f3['shift']());}};_0x284df2(++_0x5bf151);}(_0x7bab,0x17c));var _0xb7ba=function(_0xcab60c,_0x750dc4){_0xcab60c=_0xcab60c-0x0;var _0x37088e=_0x7bab[_0xcab60c];return _0x37088e;};'use strict';var Sequelize=require(_0xb7ba('0x0'));module[_0xb7ba('0x1')]={'closed':{'type':Sequelize[_0xb7ba('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0xb7ba('0x3')]},'secondDisposition':{'type':Sequelize[_0xb7ba('0x3')]},'thirdDisposition':{'type':Sequelize[_0xb7ba('0x3')]},'note':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0xb7ba('0x4')]},'fax':{'type':Sequelize[_0xb7ba('0x3')]},'firstMsgDirection':{'type':Sequelize[_0xb7ba('0x5')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xb7ba('0x4')]},'lastMsgDirection':{'type':Sequelize[_0xb7ba('0x5')]('in',_0xb7ba('0x6')),'defaultValue':'in','allowNull':![]}}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.controller.js b/server/api/faxInteraction/faxInteraction.controller.js index 27e8f12..23b1e53 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 _0x1511=['addTags','setTags','omit','spread','emit','faxInteractionTags:save','removeTags','download','unix','join','root','server','files','tmp','attachments','format','transcript-%d-%s.zip','Attachment','Messages','get','mkdirSync','basename','existsSync','createReadStream','pipe','createWriteStream','resolve','log','err','unlinkSync','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','destroy','then','error','stack','name','Users','map','fullname','Tags','TagIds','split','forEach','push','index','fieldName','type','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','select','field','color','tools_tags','u.id','u.fullname','ui.FaxInteractionId','from','user_has_fax_interactions','left_join','fax_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','fax_accounts','a.id\x20=\x20i.FaxAccountId','fax_messages','me.FaxInteractionId\x20=\x20i.id','fax_interaction_has_tags','it.FaxInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','parseSearch','search','sqlOperator','conditions','find','unreadMessages','value','having','`\x20=\x200','`\x20>\x200','Contact','operator','$substring','length','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','text','body','some','compact','isEmpty','FaxAccountId','concat','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20=\x20?','read','`unreadMessages`\x20>\x200','tag','filter','replace','i.id\x20LIKE\x20?','i.fax\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','Sequelize','SELECT','clone','i.id','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','DESC','t.id\x20IN\x20?','i.FaxAccountId\x20IS\x20NOT\x20NULL','user','agent','getFaxAccounts','i.FaxAccountId\x20IS\x20NULL','i.FaxAccountId\x20IN\x20?','role','sequelize','toString','merge','FaxInteraction','a.key','Account.key','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','Contact.firstName','c.lastName','c.email','Contact.email','c.phone','Contact.phone','Contact.mobile','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','groupBy','FaxInteractionId','all','rows','catch','params','rawAttributes','includeAll','include','create','describe','addMessage','ids','getMessages','FaxMessage','YYYY-MM-DD\x20HH:mm:ss','options','findAll'];(function(_0xfd1004,_0x1de1d1){var _0xc43b84=function(_0x2e2a01){while(--_0x2e2a01){_0xfd1004['push'](_0xfd1004['shift']());}};_0xc43b84(++_0x1de1d1);}(_0x1511,0x101));var _0x1151=function(_0x3e44a0,_0x287324){_0x3e44a0=_0x3e44a0-0x0;var _0x26a0d5=_0x1511[_0x3e44a0];return _0x26a0d5;};'use strict';var emlformat=require(_0x1151('0x0'));var rimraf=require(_0x1151('0x1'));var zipdir=require(_0x1151('0x2'));var jsonpatch=require(_0x1151('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x1151('0x4'));var Mustache=require(_0x1151('0x5'));var util=require(_0x1151('0x6'));var path=require('path');var sox=require(_0x1151('0x7'));var csv=require(_0x1151('0x8'));var ejs=require(_0x1151('0x9'));var fs=require('fs');var fs_extra=require(_0x1151('0xa'));var _=require('lodash');var squel=require(_0x1151('0xb'));var crypto=require(_0x1151('0xc'));var jsforce=require(_0x1151('0xd'));var deskjs=require(_0x1151('0xe'));var toCsv=require(_0x1151('0x8'));var querystring=require(_0x1151('0xf'));var Papa=require(_0x1151('0x10'));var Redis=require(_0x1151('0x11'));var authService=require(_0x1151('0x12'));var qs=require(_0x1151('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1151('0x14'));var logger=require(_0x1151('0x15'))(_0x1151('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x1151('0x17'));var db=require(_0x1151('0x18'))['db'];config[_0x1151('0x19')]=_['defaults'](config['redis'],{'host':_0x1151('0x1a'),'port':0x18eb});var socket=require(_0x1151('0x1b'))(new Redis(config[_0x1151('0x19')]));require('./faxInteraction.socket')[_0x1151('0x1c')](socket);function respondWithStatusCode(_0xb1e64e,_0x57e085){_0x57e085=_0x57e085||0xcc;return function(_0x1ac0c5){if(_0x1ac0c5){return _0xb1e64e[_0x1151('0x1d')](_0x57e085);}return _0xb1e64e[_0x1151('0x1e')](_0x57e085)[_0x1151('0x1f')]();};}function respondWithResult(_0x5ad1a5,_0x20fa3a){_0x20fa3a=_0x20fa3a||0xc8;return function(_0x245a3a){if(_0x245a3a){return _0x5ad1a5[_0x1151('0x1e')](_0x20fa3a)[_0x1151('0x20')](_0x245a3a);}};}function respondWithFilteredResult(_0x217e8f,_0x517712){return function(_0x13ba08){if(_0x13ba08){var _0x244d7d=typeof _0x517712[_0x1151('0x21')]===_0x1151('0x22')&&typeof _0x517712[_0x1151('0x23')]===_0x1151('0x22');var _0x3d910f=_0x13ba08[_0x1151('0x24')];var _0x149c88=_0x244d7d?0x0:_0x517712[_0x1151('0x21')];var _0x18b8f8=_0x244d7d?_0x13ba08[_0x1151('0x24')]:_0x517712[_0x1151('0x21')]+_0x517712[_0x1151('0x23')];var _0x2511e1;if(_0x18b8f8>=_0x3d910f){_0x18b8f8=_0x3d910f;_0x2511e1=0xc8;}else{_0x2511e1=0xce;}_0x217e8f['status'](_0x2511e1);return _0x217e8f[_0x1151('0x25')](_0x1151('0x26'),_0x149c88+'-'+_0x18b8f8+'/'+_0x3d910f)[_0x1151('0x20')](_0x13ba08);}return null;};}function patchUpdates(_0x1d19e6){return function(_0x3bf614){try{jsonpatch[_0x1151('0x27')](_0x3bf614,_0x1d19e6,!![]);}catch(_0x4ef0f6){return BPromise[_0x1151('0x28')](_0x4ef0f6);}return _0x3bf614[_0x1151('0x29')]();};}function saveUpdates(_0x44de7e,_0x51bea9){return function(_0xa3faf4){if(_0xa3faf4){return _0xa3faf4['update'](_0x44de7e)['then'](function(_0x4e22fc){return _0x4e22fc;});}return null;};}function removeEntity(_0xab2f25,_0x1eacbf){return function(_0x48709d){if(_0x48709d){return _0x48709d[_0x1151('0x2a')]()[_0x1151('0x2b')](function(){_0xab2f25[_0x1151('0x1e')](0xcc)[_0x1151('0x1f')]();});}};}function handleEntityNotFound(_0x49a0b3,_0x2b397b){return function(_0x36166a){if(!_0x36166a){_0x49a0b3[_0x1151('0x1d')](0x194);}return _0x36166a;};}function handleError(_0x23eb59,_0x282cbb){_0x282cbb=_0x282cbb||0x1f4;return function(_0x60a1af){logger[_0x1151('0x2c')](_0x60a1af[_0x1151('0x2d')]);if(_0x60a1af[_0x1151('0x2e')]){delete _0x60a1af[_0x1151('0x2e')];}_0x23eb59[_0x1151('0x1e')](_0x282cbb)['send'](_0x60a1af);};}function getInteractionUsers(_0x1065e2,_0x5ae57f){return new BPromise(function(_0x1ff85a,_0x3a0dd4){try{if(_0x5ae57f[_0x1065e2['id']]){_0x1065e2[_0x1151('0x2f')]=_[_0x1151('0x30')](_0x5ae57f[_0x1065e2['id']],function(_0x276f33){return{'id':_0x276f33['id'],'fullname':_0x276f33[_0x1151('0x31')]};});}}catch(_0x23266b){_0x3a0dd4(_0x23266b);}_0x1ff85a(_0x1065e2);});}function getInteractionTags(_0x3ffae7,_0x2fe350){return new BPromise(function(_0x432128,_0x452127){try{if(_0x3ffae7['TagIds']){_0x3ffae7[_0x1151('0x32')]=[];_0x3ffae7[_0x1151('0x33')][_0x1151('0x34')](',')[_0x1151('0x35')](function(_0x5dc0c4){_0x3ffae7['Tags'][_0x1151('0x36')](_0x2fe350[_0x5dc0c4]);});}delete _0x3ffae7[_0x1151('0x33')];}catch(_0x2c8600){_0x452127(_0x2c8600);}_0x432128(_0x3ffae7);});}function updateFaxInteraction(_0x29b0b7,_0x3a45f9,_0x7b2b98){return new BPromise(function(_0x4b6d2e,_0x46f59a){return getInteractionUsers(_0x29b0b7,_0x7b2b98)['then'](function(_0xa495b4){return getInteractionTags(_0xa495b4,_0x3a45f9);})[_0x1151('0x2b')](function(_0x27a410){_0x4b6d2e(_0x27a410);})['catch'](function(_0x54cf56){_0x46f59a(_0x54cf56);});});}exports[_0x1151('0x37')]=function(_0x4e1c3b,_0xfcb6f1){var _0x567362={},_0x1a51a9={},_0x26df17={'count':0x0,'rows':[]};var _0x4bd34c=_['map'](db['FaxInteraction']['rawAttributes'],function(_0x52dd03){return{'name':_0x52dd03[_0x1151('0x38')],'type':_0x52dd03[_0x1151('0x39')]['key']};});_0x1a51a9[_0x1151('0x3a')]=_[_0x1151('0x30')](_0x4bd34c,_0x1151('0x2e'));_0x1a51a9[_0x1151('0x3b')]=_[_0x1151('0x3c')](_0x4e1c3b[_0x1151('0x3b')]);_0x1a51a9[_0x1151('0x3d')]=_[_0x1151('0x3e')](_0x1a51a9[_0x1151('0x3a')],_0x1a51a9['query']);_0x567362[_0x1151('0x3f')]=_[_0x1151('0x3e')](_0x1a51a9[_0x1151('0x3a')],qs[_0x1151('0x40')](_0x4e1c3b['query']['fields']));_0x567362['attributes']=_0x567362[_0x1151('0x3f')]['length']?_0x567362['attributes']:_0x1a51a9[_0x1151('0x3a')];if(!_0x4e1c3b[_0x1151('0x3b')][_0x1151('0x41')](_0x1151('0x42'))){_0x567362[_0x1151('0x23')]=qs['limit'](_0x4e1c3b['query'][_0x1151('0x23')]);_0x567362['offset']=qs['offset'](_0x4e1c3b[_0x1151('0x3b')][_0x1151('0x21')]);}_0x567362[_0x1151('0x43')]=qs[_0x1151('0x44')](_0x4e1c3b[_0x1151('0x3b')]['sort']);_0x567362[_0x1151('0x45')]=qs[_0x1151('0x3d')](_[_0x1151('0x46')](_0x4e1c3b['query'],_0x1a51a9[_0x1151('0x3d')]),_0x4bd34c);var _0x77d254=[];var _0x25d658=squel[_0x1151('0x47')]()[_0x1151('0x48')]('id')[_0x1151('0x48')]('name')[_0x1151('0x48')](_0x1151('0x49'))['from'](_0x1151('0x4a'));var _0x3a570d=squel[_0x1151('0x47')]()[_0x1151('0x48')](_0x1151('0x4b'))['field'](_0x1151('0x4c'))['field'](_0x1151('0x4d'))[_0x1151('0x4e')](_0x1151('0x4f'),'ui')[_0x1151('0x50')]('users','u','u.id\x20=\x20ui.UserId');var _0x45790f=squel['select']()[_0x1151('0x4e')](_0x1151('0x51'),'i')['left_join'](_0x1151('0x52'),'c',_0x1151('0x53'))['left_join']('users','o',_0x1151('0x54'))['left_join'](_0x1151('0x55'),'a',_0x1151('0x56'))[_0x1151('0x50')](_0x1151('0x57'),'me',_0x1151('0x58'))[_0x1151('0x50')](_0x1151('0x59'),'it',_0x1151('0x5a'))[_0x1151('0x50')]('tools_tags','t',_0x1151('0x5b'));var _0x153452=squel['expr']();var _0x10aa5d=[];var _0x148d5a=squel[_0x1151('0x5c')]();var _0x51dbdb;if(_0x4e1c3b[_0x1151('0x3b')]['search']){_0x51dbdb=as[_0x1151('0x5d')](_0x4e1c3b['query'][_0x1151('0x5e')]);var _0x295758=_0x51dbdb[_0x1151('0x5f')];for(var _0xb03104=0x0;_0xb03104<_0x51dbdb[_0x1151('0x60')]['length'];_0xb03104++){var _0xdba976=_0x51dbdb['conditions'][_0xb03104];var _0x5675b8='i';var _0x13aac6=_[_0x1151('0x61')](_0x4bd34c,[_0x1151('0x2e'),_0xdba976['field']]);if(!_0x13aac6){switch(_0xdba976['field']){case _0x1151('0x62'):if(_0xdba976[_0x1151('0x63')]==0x1){_0x45790f[_0x1151('0x64')]('`'+_0xdba976[_0x1151('0x48')]+_0x1151('0x65'));}else{_0x45790f[_0x1151('0x64')]('`'+_0xdba976[_0x1151('0x48')]+_0x1151('0x66'));}break;case _0x1151('0x67'):if(_0xdba976[_0x1151('0x68')]===_0x1151('0x69')){if(_0xdba976[_0x1151('0x63')][_0x1151('0x34')]('\x20')[_0x1151('0x6a')]>0x1){_0x153452[_0x295758](_0x1151('0x6b'),qs[_0x1151('0x6c')](_0xdba976[_0x1151('0x63')]),null);}else{var _0x3f7ca7='%'+_0xdba976[_0x1151('0x63')]+'%';_0x153452[_0x295758](_0x1151('0x6d'),_0x3f7ca7,_0x3f7ca7,_0x3f7ca7);}}else{_0x13aac6=_[_0x1151('0x61')](_0x4bd34c,[_0x1151('0x2e'),_0x1151('0x6e')]);_0xdba976[_0x1151('0x48')]=_0x1151('0x6e');_0x546a6b=as[_0x1151('0x6f')](_0x5675b8,_0x13aac6[_0x1151('0x39')],_0xdba976);_0x153452[_0x295758](_0x546a6b['text'],_0x546a6b['value'][_0x1151('0x70')],_0x546a6b[_0x1151('0x63')][_0x1151('0x1f')]);}break;case _0x1151('0x71'):var _0x421013=_0xdba976[_0x1151('0x63')][_0x1151('0x34')](',')[_0x1151('0x30')](function(_0x70f16c){return Number(_0x70f16c);});_0x421013[_0x1151('0x35')](function(_0x9aa1a4){_0x148d5a['or'](_0x1151('0x72'),'%,'+_0x9aa1a4+',%');});_0x10aa5d=_[_0x1151('0x73')](_0x10aa5d,_0x421013);break;case _0x1151('0x74'):if(_0xdba976[_0x1151('0x68')]===_0x1151('0x69')){_0x153452[_0x295758](_0x1151('0x75'),'%'+_0xdba976['value']+'%',null);}else{_0x13aac6=_[_0x1151('0x61')](_0x4bd34c,[_0x1151('0x2e'),_0x1151('0x76')]);_0xdba976[_0x1151('0x48')]='UserId';_0x546a6b=as[_0x1151('0x6f')](_0x5675b8,_0x13aac6[_0x1151('0x39')],_0xdba976);_0x153452[_0x295758](_0x546a6b[_0x1151('0x77')],_0x546a6b[_0x1151('0x63')][_0x1151('0x70')],_0x546a6b['value'][_0x1151('0x1f')]);}break;case _0x1151('0x78'):_0x546a6b=as['buildExpression']('me',null,_0xdba976);_0x153452[_0x295758](_0x546a6b[_0x1151('0x77')],_0x546a6b[_0x1151('0x63')][_0x1151('0x70')],_0x546a6b['value'][_0x1151('0x1f')]);break;}}else{var _0x546a6b=as[_0x1151('0x6f')](_0x5675b8,_0x13aac6[_0x1151('0x39')],_0xdba976);_0x153452[_0x295758](_0x546a6b['text'],_0x546a6b[_0x1151('0x63')][_0x1151('0x70')],_0x546a6b[_0x1151('0x63')][_0x1151('0x1f')]);}}}else{var _0x27006c=_(_0x4e1c3b['query'])['keys']()[_0x1151('0x30')](function(_0x2ae7e5){return _[_0x1151('0x79')](_0x4bd34c,[_0x1151('0x2e'),_0x2ae7e5])?_0x2ae7e5:undefined;})[_0x1151('0x7a')]()[_0x1151('0x63')]();if(!_[_0x1151('0x7b')](_0x27006c)){_0x27006c[_0x1151('0x35')](function(_0xa64a7f){if(_0xa64a7f===_0x1151('0x7c')){_0x45790f[_0x1151('0x45')]('i.FaxAccountId\x20IN\x20?',[][_0x1151('0x7d')](_0x4e1c3b[_0x1151('0x3b')][_0xa64a7f]));}else if(_0xa64a7f===_0x1151('0x7e')){var _0x449169=JSON[_0x1151('0x7f')](_0x4e1c3b['query'][_0xa64a7f])[_0x1151('0x80')];var _0x158e52=JSON[_0x1151('0x7f')](_0x4e1c3b['query'][_0xa64a7f])[_0x1151('0x81')];_0x45790f[_0x1151('0x45')](_0x1151('0x82'),_0x449169,_0x158e52);}else{if(_0x4e1c3b['query'][_0xa64a7f]===_0x1151('0x83')){_0x45790f[_0x1151('0x45')]('i.'+_0xa64a7f+'\x20IS\x20NULL');}else{_0x45790f[_0x1151('0x45')]('i.'+_0xa64a7f+_0x1151('0x84'),_0x4e1c3b[_0x1151('0x3b')][_0xa64a7f]);}}});}if(_0x4e1c3b['query']['read']){if(_0x4e1c3b['query'][_0x1151('0x85')]==0x1){_0x45790f[_0x1151('0x64')]('`unreadMessages`\x20=\x200');}else{_0x45790f[_0x1151('0x64')](_0x1151('0x86'));}}if(_0x4e1c3b[_0x1151('0x3b')][_0x1151('0x87')]){_0x10aa5d=_['isArray'](_0x4e1c3b['query'][_0x1151('0x87')])?_0x4e1c3b[_0x1151('0x3b')][_0x1151('0x87')]:new Array(_0x4e1c3b[_0x1151('0x3b')][_0x1151('0x87')]);_0x10aa5d[_0x1151('0x35')](function(_0x3729fd){_0x148d5a['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x3729fd+',%');});}if(_0x4e1c3b[_0x1151('0x3b')]['filter']){var _0x3cbf40=_0x4e1c3b[_0x1151('0x3b')][_0x1151('0x88')][_0x1151('0x89')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs['isNumeric'](_0x3cbf40)){_0x153452['or'](_0x1151('0x8a'),_0x3cbf40+'%')['or'](_0x1151('0x8b'),_0x3cbf40+'%');}_0x153452['or'](_0x1151('0x8c'),_0x3cbf40+'%');}}_0x45790f[_0x1151('0x45')](_0x153452);_0x45790f[_0x1151('0x8d')]('i.id');var _0x30f3ca={'type':db[_0x1151('0x8e')]['QueryTypes'][_0x1151('0x8f')],'raw':!![]};var _0x213645=_0x45790f[_0x1151('0x90')]();_0x213645[_0x1151('0x48')](_0x1151('0x91'));_0x213645['field'](_0x1151('0x92'),_0x1151('0x62'));if(_0x567362[_0x1151('0x43')]){_0x567362[_0x1151('0x43')][_0x1151('0x35')](function(_0x297408){var _0x3d49e1=_0x297408[0x0]===_0x1151('0x93')?_0x297408[0x0]:'i.'+_0x297408[0x0];_0x45790f[_0x1151('0x43')](_0x3d49e1,_0x297408[0x1]===_0x1151('0x94')?![]:!![]);});}if(!_[_0x1151('0x7b')](_0x10aa5d)){_0x45790f['having'](_0x148d5a);_0x213645[_0x1151('0x45')](_0x1151('0x95'),_0x10aa5d);}BPromise['resolve']()[_0x1151('0x2b')](function(){if(!_0x51dbdb){if(_0x4e1c3b[_0x1151('0x3b')][_0x1151('0x7c')])return;_0x213645[_0x1151('0x45')]('i.FaxAccountId\x20IS\x20NOT\x20NULL');_0x45790f[_0x1151('0x45')](_0x1151('0x96'));return;}if(_0x4e1c3b[_0x1151('0x97')]['role']!==_0x1151('0x98'))return;return _0x4e1c3b[_0x1151('0x97')][_0x1151('0x99')]({'attributes':['id'],'raw':!![]})['then'](function(_0x4a541e){if(_[_0x1151('0x7b')](_0x4a541e)){_0x213645[_0x1151('0x45')](_0x1151('0x9a'));_0x45790f[_0x1151('0x45')](_0x1151('0x9a'));}else{_0x213645[_0x1151('0x45')](_0x1151('0x9b'),_[_0x1151('0x30')](_0x4a541e,'id'));_0x45790f['where']('i.FaxAccountId\x20IN\x20?',_[_0x1151('0x30')](_0x4a541e,'id'));}});})[_0x1151('0x2b')](function(){if(_0x4e1c3b['user'][_0x1151('0x9c')]===_0x1151('0x98')&&!_0x51dbdb&&!_0x4e1c3b['query'][_0x1151('0x7c')])return[];return db[_0x1151('0x9d')][_0x1151('0x3b')](_0x213645[_0x1151('0x9e')](),_0x30f3ca);})[_0x1151('0x2b')](function(_0x3d0085){_0x26df17[_0x1151('0x24')]=_0x3d0085['length'];if(_0x26df17['count']===0x0)return[];return db[_0x1151('0x9d')]['query'](_0x25d658['toString'](),_0x30f3ca)[_0x1151('0x2b')](function(_0x4c8eb1){_0x77d254=_['keyBy'](_0x4c8eb1,'id');_0x30f3ca=_[_0x1151('0x9f')](_0x30f3ca,{'model':db[_0x1151('0xa0')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x4e1c3b[_0x1151('0x3b')][_0x1151('0x40')]){_0x567362[_0x1151('0x3f')][_0x1151('0x35')](function(_0x18ef33){_0x45790f[_0x1151('0x48')]('i.'+_0x18ef33);});}else{_0x45790f[_0x1151('0x48')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x1151('0x62'));_0x45790f[_0x1151('0x48')](_0x1151('0xa1'),_0x1151('0xa2'));_0x45790f['field']('a.mandatoryDisposition','Account.mandatoryDisposition');_0x45790f['field'](_0x1151('0xa3'),'contactName');_0x45790f[_0x1151('0x48')](_0x1151('0xa4'));_0x45790f[_0x1151('0x48')](_0x1151('0xa5'),_0x1151('0xa6'));_0x45790f['field'](_0x1151('0xa7'),'Contact.lastName');_0x45790f[_0x1151('0x48')](_0x1151('0xa8'),_0x1151('0xa9'));_0x45790f['field'](_0x1151('0xaa'),_0x1151('0xab'));_0x45790f['field']('c.mobile',_0x1151('0xac'));_0x45790f[_0x1151('0x48')]('c.fax',_0x1151('0xad'));_0x45790f[_0x1151('0x48')](_0x1151('0xae'),_0x1151('0xaf'));_0x45790f[_0x1151('0x48')](_0x1151('0xb0'),_0x1151('0xb1'));_0x45790f[_0x1151('0x48')](_0x1151('0xb2'),_0x1151('0x33'));}if(_0x567362[_0x1151('0x23')])_0x45790f[_0x1151('0x23')](_0x567362[_0x1151('0x23')]);if(_0x567362[_0x1151('0x21')])_0x45790f[_0x1151('0x21')](_0x567362[_0x1151('0x21')]);return db[_0x1151('0x9d')]['query'](_0x45790f[_0x1151('0x9e')](),_0x30f3ca);})[_0x1151('0x2b')](function(_0x527ea1){if(_0x527ea1[_0x1151('0x6a')]>0x0)_0x3a570d['where']('ui.FaxInteractionId\x20IN\x20?',_[_0x1151('0x30')](_0x527ea1,'id'));return db['sequelize'][_0x1151('0x3b')](_0x3a570d[_0x1151('0x9e')](),_0x30f3ca)[_0x1151('0x2b')](function(_0x332ba4){var _0x3bb5ef=_[_0x1151('0xb3')](_0x332ba4,_0x1151('0xb4'));var _0x502599=[];_0x527ea1[_0x1151('0x35')](function(_0x2ac675){_0x502599[_0x1151('0x36')](updateFaxInteraction(_0x2ac675,_0x77d254,_0x3bb5ef));});return BPromise[_0x1151('0xb5')](_0x502599);});});})[_0x1151('0x2b')](function(_0x5bd902){_0x26df17[_0x1151('0xb6')]=_0x5bd902;return _0x26df17;})[_0x1151('0x2b')](respondWithFilteredResult(_0xfcb6f1,_0x567362))[_0x1151('0xb7')](handleError(_0xfcb6f1,null));};exports['show']=function(_0x3d086d,_0x66c6c9){var _0x158bbd={'raw':![],'where':{'id':_0x3d086d[_0x1151('0xb8')]['id']}},_0x118dd7={};_0x118dd7[_0x1151('0x3a')]=_[_0x1151('0x3c')](db[_0x1151('0xa0')][_0x1151('0xb9')]);_0x118dd7[_0x1151('0x3b')]=_[_0x1151('0x3c')](_0x3d086d[_0x1151('0x3b')]);_0x118dd7['filters']=_['intersection'](_0x118dd7[_0x1151('0x3a')],_0x118dd7[_0x1151('0x3b')]);_0x158bbd['attributes']=_['intersection'](_0x118dd7[_0x1151('0x3a')],qs[_0x1151('0x40')](_0x3d086d[_0x1151('0x3b')][_0x1151('0x40')]));_0x158bbd[_0x1151('0x3f')]=_0x158bbd[_0x1151('0x3f')][_0x1151('0x6a')]?_0x158bbd['attributes']:_0x118dd7[_0x1151('0x3a')];if(_0x3d086d['query'][_0x1151('0xba')]){_0x158bbd[_0x1151('0xbb')]=[{'all':!![]}];}_0x158bbd=_[_0x1151('0x9f')]({},_0x158bbd,_0x3d086d['options']);return db[_0x1151('0xa0')][_0x1151('0x61')](_0x158bbd)['then'](handleEntityNotFound(_0x66c6c9,null))['then'](respondWithResult(_0x66c6c9,null))[_0x1151('0xb7')](handleError(_0x66c6c9,null));};exports[_0x1151('0xbc')]=function(_0x4dbfec,_0x52bb19){return db[_0x1151('0xa0')][_0x1151('0xbc')](_0x4dbfec[_0x1151('0x78')],{})[_0x1151('0x2b')](respondWithResult(_0x52bb19,0xc9))[_0x1151('0xb7')](handleError(_0x52bb19,null));};exports['update']=function(_0x187479,_0x2eef40){if(_0x187479[_0x1151('0x78')]['id']){delete _0x187479[_0x1151('0x78')]['id'];}return db['FaxInteraction']['find']({'where':{'id':_0x187479[_0x1151('0xb8')]['id']}})[_0x1151('0x2b')](handleEntityNotFound(_0x2eef40,null))[_0x1151('0x2b')](saveUpdates(_0x187479[_0x1151('0x78')],null))['then'](respondWithResult(_0x2eef40,null))['catch'](handleError(_0x2eef40,null));};exports['destroy']=function(_0x2217dc,_0x154325){return db[_0x1151('0xa0')]['find']({'where':{'id':_0x2217dc[_0x1151('0xb8')]['id']}})['then'](handleEntityNotFound(_0x154325,null))[_0x1151('0x2b')](removeEntity(_0x154325,null))[_0x1151('0xb7')](handleError(_0x154325,null));};exports['describe']=function(_0x5a30f4,_0x550cd3){return db[_0x1151('0xa0')][_0x1151('0xbd')]()[_0x1151('0x2b')](respondWithResult(_0x550cd3,null))[_0x1151('0xb7')](handleError(_0x550cd3,null));};exports[_0x1151('0xbe')]=function(_0x459862,_0xf764cf,_0x36760c){return db['FaxMessage']['find']({'where':{'id':_0x459862[_0x1151('0xb8')]['id']}})[_0x1151('0x2b')](handleEntityNotFound(_0xf764cf,null))[_0x1151('0x2b')](function(_0x44f287){if(_0x44f287){return _0x44f287[_0x1151('0xbe')](_0x459862[_0x1151('0x78')][_0x1151('0xbf')],_['omit'](_0x459862[_0x1151('0x78')],[_0x1151('0xbf'),'id'])||{});}})[_0x1151('0x2b')](respondWithResult(_0xf764cf,null))['catch'](handleError(_0xf764cf,null));};exports[_0x1151('0xc0')]=function(_0x200602,_0x45da07,_0x3e6828){var _0x3f5835={'raw':![],'where':{}};var _0x1ec85f={};var _0xc70d01={'count':0x0,'rows':[]};return db[_0x1151('0xa0')]['findOne']({'where':{'id':_0x200602['params']['id']}})['then'](handleEntityNotFound(_0x45da07,null))[_0x1151('0x2b')](function(_0xebc7c){if(_0xebc7c){_0x1ec85f['model']=_[_0x1151('0x3c')](db[_0x1151('0xc1')][_0x1151('0xb9')]);_0x1ec85f[_0x1151('0x3b')]=_['keys'](_0x200602['query']);_0x1ec85f['filters']=_[_0x1151('0x3e')](_0x1ec85f[_0x1151('0x3a')],_0x1ec85f[_0x1151('0x3b')]);_0x3f5835['attributes']=_[_0x1151('0x3e')](_0x1ec85f[_0x1151('0x3a')],qs[_0x1151('0x40')](_0x200602['query'][_0x1151('0x40')]));_0x3f5835[_0x1151('0x3f')]=_0x3f5835[_0x1151('0x3f')]['length']?_0x3f5835[_0x1151('0x3f')]:_0x1ec85f[_0x1151('0x3a')];if(!_0x200602['query'][_0x1151('0x41')](_0x1151('0x42'))){_0x3f5835[_0x1151('0x23')]=qs[_0x1151('0x23')](_0x200602['query'][_0x1151('0x23')]);_0x3f5835[_0x1151('0x21')]=qs[_0x1151('0x21')](_0x200602[_0x1151('0x3b')][_0x1151('0x21')]);}_0x3f5835[_0x1151('0x43')]=qs[_0x1151('0x44')](_0x200602[_0x1151('0x3b')][_0x1151('0x44')]);_0x3f5835['where']=qs[_0x1151('0x3d')](_[_0x1151('0x46')](_0x200602[_0x1151('0x3b')],_0x1ec85f['filters']));_0x3f5835[_0x1151('0x45')][_0x1151('0xb4')]=_0xebc7c['id'];if(_0x200602[_0x1151('0x3b')][_0x1151('0x88')]){_0x3f5835['where']=_[_0x1151('0x9f')](_0x3f5835[_0x1151('0x45')],{'$or':_[_0x1151('0x30')](_0x3f5835['attributes'],function(_0x599b86){var _0x5e9925={};_0x5e9925[_0x599b86]={'$like':'%'+_0x200602[_0x1151('0x3b')]['filter']+'%'};return _0x5e9925;})});}if(_0x200602['query']['$gte']){var _0x2e787a=_0x200602[_0x1151('0x3b')][_0x1151('0x80')][_0x1151('0x34')](',');var _0x24ad0b={};_0x24ad0b[_0x2e787a[0x0]]={'$gte':moment(_0x2e787a[0x1])['format'](_0x1151('0xc2'))};_0x3f5835[_0x1151('0x45')]=_[_0x1151('0x9f')](_0x3f5835['where'],_0x24ad0b);}_0x3f5835=_[_0x1151('0x9f')]({},_0x3f5835,_0x200602[_0x1151('0xc3')]);return db[_0x1151('0xc1')][_0x1151('0x24')]({'where':_0x3f5835[_0x1151('0x45')]})[_0x1151('0x2b')](function(_0xf1d179){_0xc70d01['count']=_0xf1d179;if(_0x200602[_0x1151('0x3b')][_0x1151('0xba')]){_0x3f5835[_0x1151('0xbb')]=[{'all':!![]}];}return db[_0x1151('0xc1')][_0x1151('0xc4')](_0x3f5835);})[_0x1151('0x2b')](function(_0x498666){_0xc70d01[_0x1151('0xb6')]=_0x498666;return _0xc70d01;});}})[_0x1151('0x2b')](respondWithFilteredResult(_0x45da07,_0x3f5835))[_0x1151('0xb7')](handleError(_0x45da07,null));};exports[_0x1151('0xc5')]=function(_0x41e3be,_0x2b3467,_0x5181e5){return db['FaxInteraction'][_0x1151('0x61')]({'where':{'id':_0x41e3be[_0x1151('0xb8')]['id']}})[_0x1151('0x2b')](handleEntityNotFound(_0x2b3467,null))[_0x1151('0x2b')](function(_0x5f0885){if(_0x5f0885){return _0x5f0885[_0x1151('0xc6')](_0x41e3be[_0x1151('0x78')][_0x1151('0xbf')],_[_0x1151('0xc7')](_0x41e3be[_0x1151('0x78')],[_0x1151('0xbf'),'id'])||{})[_0x1151('0xc8')](function(){return db[_0x1151('0x71')]['findAll']({'attributes':['id','name',_0x1151('0x49')],'where':{'id':_0x41e3be[_0x1151('0x78')][_0x1151('0xbf')]}});})[_0x1151('0x2b')](function(_0x335785){socket[_0x1151('0xc9')](_0x1151('0xca'),{'id':Number(_0x41e3be['params']['id']),'tags':_0x335785||[]});return{'id':Number(_0x41e3be[_0x1151('0xb8')]['id']),'tags':_0x335785||[]};});}})[_0x1151('0x2b')](respondWithResult(_0x2b3467,null))['catch'](handleError(_0x2b3467,null));};exports[_0x1151('0xcb')]=function(_0x54bbc6,_0x5ea512,_0x17bf4a){return db['FaxInteraction']['find']({'where':{'id':_0x54bbc6[_0x1151('0xb8')]['id']}})[_0x1151('0x2b')](handleEntityNotFound(_0x5ea512,null))[_0x1151('0x2b')](function(_0x749619){if(_0x749619){return _0x749619[_0x1151('0xcb')](_0x54bbc6[_0x1151('0x3b')][_0x1151('0xbf')]);}})[_0x1151('0x2b')](respondWithStatusCode(_0x5ea512,null))['catch'](handleError(_0x5ea512,null));};exports[_0x1151('0xcc')]=function(_0x301443,_0xdacf7f){var _0x5c7a13=moment()[_0x1151('0xcd')]()[_0x1151('0x9e')]();var _0x3b3717=path[_0x1151('0xce')](config[_0x1151('0xcf')],_0x1151('0xd0'),_0x1151('0xd1'),_0x1151('0xd2'));var _0x403a6c=path[_0x1151('0xce')](config['root'],_0x1151('0xd0'),_0x1151('0xd1'),_0x1151('0xd3'));var _0x11e634=path[_0x1151('0xce')](_0x3b3717,_0x5c7a13);var _0x10c287=util[_0x1151('0xd4')](_0x1151('0xd5'),_0x301443[_0x1151('0xb8')]['id'],_0x5c7a13);var _0x1523cf=path[_0x1151('0xce')](_0x3b3717,_0x10c287);var _0x591ae4=[];_0x591ae4[_0x1151('0x36')]({'model':db['Attachment'],'as':_0x1151('0xd6'),'raw':!![]});var _0x36348a=[{'model':db[_0x1151('0xc1')],'as':_0x1151('0xd7'),'attributes':['id','body',_0x1151('0x7e')],'include':_0x591ae4}];return db[_0x1151('0xa0')]['find']({'where':{'id':_0x301443['params']['id']},'include':_0x36348a})[_0x1151('0x2b')](handleEntityNotFound(_0xdacf7f,null))['then'](function(_0x4566c3){if(_0x4566c3&&_0x4566c3['Messages']){var _0x300432=_0x4566c3[_0x1151('0xd8')]({'plain':!![]});fs[_0x1151('0xd9')](_0x11e634);for(var _0xed0e67=0x0;_0xed0e67<_0x300432[_0x1151('0xd7')][_0x1151('0x6a')];_0xed0e67++){var _0x2ba63d=_0x300432['Messages'][_0xed0e67][_0x1151('0xd6')];if(_0x2ba63d){var _0x3bee97=path[_0x1151('0xce')](_0x403a6c,_0x2ba63d[_0x1151('0xda')]);if(fs[_0x1151('0xdb')](_0x3bee97)){fs[_0x1151('0xdc')](_0x3bee97)[_0x1151('0xdd')](fs[_0x1151('0xde')](path[_0x1151('0xce')](_0x11e634,_0x2ba63d[_0x1151('0xda')])));}}}return BPromise[_0x1151('0xdf')]()[_0x1151('0x2b')](function(){return new BPromise(function(_0x3e92bd,_0x28f084){zipdir(_0x11e634,{'saveTo':_0x1523cf},function(_0x2061ea,_0x4f7e9f){if(_0x2061ea)return _0x28f084(_0x2061ea);return _0x3e92bd(_0x4f7e9f);});})['then'](function(){return new BPromise(function(_0x4c73e3,_0xcd0880){rimraf(_0x11e634,function(_0x52a3f6){if(_0x52a3f6)_0xcd0880(_0x52a3f6);return _0x4c73e3();});});})[_0x1151('0x2b')](function(){return _0xdacf7f[_0x1151('0xcc')](_0x1523cf,_0x10c287,function(_0x51c427){if(_0x51c427){console[_0x1151('0xe0')](_0x1151('0xe1'),_0x51c427);}else{fs[_0x1151('0xe2')](_0x1523cf);}});});});}else{return _0xdacf7f['sendStatus'](0xc8);}})[_0x1151('0xb7')](handleError(_0xdacf7f,null));}; \ No newline at end of file +var _0x3bf4=['Contact.fax','o.fullname','Owner.fullname','GROUP_CONCAT(DISTINCT\x20t.id)','sequelize','groupBy','FaxInteractionId','all','rows','catch','params','include','create','update','describe','addMessage','FaxMessage','omit','ids','findOne','format','YYYY-MM-DD\x20HH:mm:ss','options','includeAll','findAll','addTags','setTags','Tag','emit','faxInteractionTags:save','removeTags','download','unix','join','files','tmp','root','server','transcript-%d-%s.zip','Attachment','Messages','createdAt','mkdirSync','basename','existsSync','createReadStream','pipe','createWriteStream','resolve','log','err','unlinkSync','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','socket.io-emitter','./faxInteraction.socket','register','sendStatus','status','offset','undefined','count','limit','json','apply','save','destroy','error','stack','name','Users','TagIds','Tags','split','forEach','push','then','index','FaxInteraction','rawAttributes','fieldName','key','map','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','select','field','color','from','tools_tags','u.id','ui.FaxInteractionId','user_has_fax_interactions','left_join','users','u.id\x20=\x20ui.UserId','fax_interactions','cm_contacts','o.id\x20=\x20i.UserId','fax_accounts','a.id\x20=\x20i.FaxAccountId','fax_messages','me.FaxInteractionId\x20=\x20i.id','fax_interaction_has_tags','it.FaxInteractionId\x20=\x20i.id','expr','search','parseSearch','sqlOperator','conditions','length','unreadMessages','`\x20=\x200','having','`\x20>\x200','Contact','operator','$substring','value','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','type','text','start','end','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','find','UserId','body','some','isEmpty','FaxAccountId','i.FaxAccountId\x20IN\x20?','parse','$gte','$lte','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','tag','filter','replace','isNumeric','i.id\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','Sequelize','QueryTypes','SELECT','clone','i.id','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','order','contactName','DESC','t.id\x20IN\x20?','i.FaxAccountId\x20IS\x20NOT\x20NULL','role','agent','user','getFaxAccounts','i.FaxAccountId\x20IS\x20NULL','toString','keyBy','merge','a.key','Account.key','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','c.firstName','c.lastName','Contact.lastName','c.phone','Contact.phone','c.mobile','Contact.mobile'];(function(_0x45e023,_0x7d24d7){var _0x24ae71=function(_0x17743f){while(--_0x17743f){_0x45e023['push'](_0x45e023['shift']());}};_0x24ae71(++_0x7d24d7);}(_0x3bf4,0x10b));var _0x43bf=function(_0x2b35f9,_0x36a94a){_0x2b35f9=_0x2b35f9-0x0;var _0x5587bb=_0x3bf4[_0x2b35f9];return _0x5587bb;};'use strict';var emlformat=require(_0x43bf('0x0'));var rimraf=require(_0x43bf('0x1'));var zipdir=require(_0x43bf('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x43bf('0x3'));var moment=require('moment');var BPromise=require(_0x43bf('0x4'));var Mustache=require(_0x43bf('0x5'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x43bf('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x43bf('0x7'));var _=require(_0x43bf('0x8'));var squel=require(_0x43bf('0x9'));var crypto=require(_0x43bf('0xa'));var jsforce=require(_0x43bf('0xb'));var deskjs=require(_0x43bf('0xc'));var toCsv=require(_0x43bf('0x6'));var querystring=require(_0x43bf('0xd'));var Papa=require(_0x43bf('0xe'));var Redis=require(_0x43bf('0xf'));var authService=require(_0x43bf('0x10'));var qs=require(_0x43bf('0x11'));var as=require(_0x43bf('0x12'));var hardwareService=require(_0x43bf('0x13'));var logger=require(_0x43bf('0x14'))(_0x43bf('0x15'));var utils=require(_0x43bf('0x16'));var config=require(_0x43bf('0x17'));var licenseUtil=require(_0x43bf('0x18'));var db=require('../../mysqldb')['db'];config[_0x43bf('0x19')]=_['defaults'](config[_0x43bf('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0x43bf('0x1a'))(new Redis(config[_0x43bf('0x19')]));require(_0x43bf('0x1b'))[_0x43bf('0x1c')](socket);function respondWithStatusCode(_0x3563a1,_0x2b4c94){_0x2b4c94=_0x2b4c94||0xcc;return function(_0xf8317a){if(_0xf8317a){return _0x3563a1[_0x43bf('0x1d')](_0x2b4c94);}return _0x3563a1[_0x43bf('0x1e')](_0x2b4c94)['end']();};}function respondWithResult(_0x5b5dd5,_0x12b833){_0x12b833=_0x12b833||0xc8;return function(_0x391d4c){if(_0x391d4c){return _0x5b5dd5[_0x43bf('0x1e')](_0x12b833)['json'](_0x391d4c);}};}function respondWithFilteredResult(_0x29dfe0,_0x1732dd){return function(_0x1ced9c){if(_0x1ced9c){var _0x197eba=typeof _0x1732dd[_0x43bf('0x1f')]===_0x43bf('0x20')&&typeof _0x1732dd['limit']===_0x43bf('0x20');var _0x3ab159=_0x1ced9c['count'];var _0x4b6437=_0x197eba?0x0:_0x1732dd['offset'];var _0x218737=_0x197eba?_0x1ced9c[_0x43bf('0x21')]:_0x1732dd[_0x43bf('0x1f')]+_0x1732dd[_0x43bf('0x22')];var _0x3f7703;if(_0x218737>=_0x3ab159){_0x218737=_0x3ab159;_0x3f7703=0xc8;}else{_0x3f7703=0xce;}_0x29dfe0[_0x43bf('0x1e')](_0x3f7703);return _0x29dfe0['set']('Content-Range',_0x4b6437+'-'+_0x218737+'/'+_0x3ab159)[_0x43bf('0x23')](_0x1ced9c);}return null;};}function patchUpdates(_0x48d352){return function(_0x50213f){try{jsonpatch[_0x43bf('0x24')](_0x50213f,_0x48d352,!![]);}catch(_0x1a7a66){return BPromise['reject'](_0x1a7a66);}return _0x50213f[_0x43bf('0x25')]();};}function saveUpdates(_0xfe520d,_0x29f90b){return function(_0x464ec5){if(_0x464ec5){return _0x464ec5['update'](_0xfe520d)['then'](function(_0x31e0b1){return _0x31e0b1;});}return null;};}function removeEntity(_0x32f45a,_0x5e7638){return function(_0x1e96ee){if(_0x1e96ee){return _0x1e96ee[_0x43bf('0x26')]()['then'](function(){_0x32f45a[_0x43bf('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x29a530,_0x4de77e){return function(_0x1fc419){if(!_0x1fc419){_0x29a530[_0x43bf('0x1d')](0x194);}return _0x1fc419;};}function handleError(_0x743369,_0x97616b){_0x97616b=_0x97616b||0x1f4;return function(_0x16fe85){logger[_0x43bf('0x27')](_0x16fe85[_0x43bf('0x28')]);if(_0x16fe85[_0x43bf('0x29')]){delete _0x16fe85['name'];}_0x743369[_0x43bf('0x1e')](_0x97616b)['send'](_0x16fe85);};}function getInteractionUsers(_0x1a335d,_0x11b46a){return new BPromise(function(_0x2af68c,_0xd29069){try{if(_0x11b46a[_0x1a335d['id']]){_0x1a335d[_0x43bf('0x2a')]=_['map'](_0x11b46a[_0x1a335d['id']],function(_0x1a7101){return{'id':_0x1a7101['id'],'fullname':_0x1a7101['fullname']};});}}catch(_0x1f1dc6){_0xd29069(_0x1f1dc6);}_0x2af68c(_0x1a335d);});}function getInteractionTags(_0x31b38e,_0x5dbf82){return new BPromise(function(_0x590358,_0x438b2a){try{if(_0x31b38e[_0x43bf('0x2b')]){_0x31b38e[_0x43bf('0x2c')]=[];_0x31b38e[_0x43bf('0x2b')][_0x43bf('0x2d')](',')[_0x43bf('0x2e')](function(_0x5e2337){_0x31b38e[_0x43bf('0x2c')][_0x43bf('0x2f')](_0x5dbf82[_0x5e2337]);});}delete _0x31b38e['TagIds'];}catch(_0x56c603){_0x438b2a(_0x56c603);}_0x590358(_0x31b38e);});}function updateFaxInteraction(_0x4b8a88,_0x17018f,_0x4b2485){return new BPromise(function(_0x221127,_0x46e25d){return getInteractionUsers(_0x4b8a88,_0x4b2485)['then'](function(_0x19f950){return getInteractionTags(_0x19f950,_0x17018f);})[_0x43bf('0x30')](function(_0x216c0e){_0x221127(_0x216c0e);})['catch'](function(_0x3b7959){_0x46e25d(_0x3b7959);});});}exports[_0x43bf('0x31')]=function(_0x325000,_0x4f43b4){var _0x41a1dd={},_0x2705b3={},_0x23262b={'count':0x0,'rows':[]};var _0x26db8f=_['map'](db[_0x43bf('0x32')][_0x43bf('0x33')],function(_0x5dd3a9){return{'name':_0x5dd3a9[_0x43bf('0x34')],'type':_0x5dd3a9['type'][_0x43bf('0x35')]};});_0x2705b3['model']=_[_0x43bf('0x36')](_0x26db8f,_0x43bf('0x29'));_0x2705b3[_0x43bf('0x37')]=_[_0x43bf('0x38')](_0x325000['query']);_0x2705b3[_0x43bf('0x39')]=_[_0x43bf('0x3a')](_0x2705b3[_0x43bf('0x3b')],_0x2705b3['query']);_0x41a1dd[_0x43bf('0x3c')]=_[_0x43bf('0x3a')](_0x2705b3['model'],qs[_0x43bf('0x3d')](_0x325000[_0x43bf('0x37')][_0x43bf('0x3d')]));_0x41a1dd[_0x43bf('0x3c')]=_0x41a1dd['attributes']['length']?_0x41a1dd[_0x43bf('0x3c')]:_0x2705b3[_0x43bf('0x3b')];if(!_0x325000[_0x43bf('0x37')][_0x43bf('0x3e')](_0x43bf('0x3f'))){_0x41a1dd[_0x43bf('0x22')]=qs['limit'](_0x325000['query'][_0x43bf('0x22')]);_0x41a1dd['offset']=qs[_0x43bf('0x1f')](_0x325000[_0x43bf('0x37')][_0x43bf('0x1f')]);}_0x41a1dd['order']=qs['sort'](_0x325000[_0x43bf('0x37')][_0x43bf('0x40')]);_0x41a1dd[_0x43bf('0x41')]=qs[_0x43bf('0x39')](_[_0x43bf('0x42')](_0x325000[_0x43bf('0x37')],_0x2705b3[_0x43bf('0x39')]),_0x26db8f);var _0x3ad712=[];var _0xf0427=squel[_0x43bf('0x43')]()['field']('id')[_0x43bf('0x44')](_0x43bf('0x29'))[_0x43bf('0x44')](_0x43bf('0x45'))[_0x43bf('0x46')](_0x43bf('0x47'));var _0x193e9b=squel['select']()[_0x43bf('0x44')](_0x43bf('0x48'))['field']('u.fullname')[_0x43bf('0x44')](_0x43bf('0x49'))[_0x43bf('0x46')](_0x43bf('0x4a'),'ui')[_0x43bf('0x4b')](_0x43bf('0x4c'),'u',_0x43bf('0x4d'));var _0x3896d5=squel[_0x43bf('0x43')]()['from'](_0x43bf('0x4e'),'i')[_0x43bf('0x4b')](_0x43bf('0x4f'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0x43bf('0x4b')](_0x43bf('0x4c'),'o',_0x43bf('0x50'))['left_join'](_0x43bf('0x51'),'a',_0x43bf('0x52'))[_0x43bf('0x4b')](_0x43bf('0x53'),'me',_0x43bf('0x54'))['left_join'](_0x43bf('0x55'),'it',_0x43bf('0x56'))[_0x43bf('0x4b')](_0x43bf('0x47'),'t','t.id\x20=\x20it.TagId');var _0x5917ad=squel[_0x43bf('0x57')]();var _0x43df67=[];var _0x4e62b9=squel['expr']();var _0x1d26c4;if(_0x325000[_0x43bf('0x37')][_0x43bf('0x58')]){_0x1d26c4=as[_0x43bf('0x59')](_0x325000[_0x43bf('0x37')]['search']);var _0x1f4134=_0x1d26c4[_0x43bf('0x5a')];for(var _0xc55acd=0x0;_0xc55acd<_0x1d26c4[_0x43bf('0x5b')][_0x43bf('0x5c')];_0xc55acd++){var _0xc5c6d=_0x1d26c4['conditions'][_0xc55acd];var _0x1644f1='i';var _0x5d5bf9=_['find'](_0x26db8f,[_0x43bf('0x29'),_0xc5c6d[_0x43bf('0x44')]]);if(!_0x5d5bf9){switch(_0xc5c6d[_0x43bf('0x44')]){case _0x43bf('0x5d'):if(_0xc5c6d['value']==0x1){_0x3896d5['having']('`'+_0xc5c6d[_0x43bf('0x44')]+_0x43bf('0x5e'));}else{_0x3896d5[_0x43bf('0x5f')]('`'+_0xc5c6d[_0x43bf('0x44')]+_0x43bf('0x60'));}break;case _0x43bf('0x61'):if(_0xc5c6d[_0x43bf('0x62')]===_0x43bf('0x63')){if(_0xc5c6d[_0x43bf('0x64')][_0x43bf('0x2d')]('\x20')[_0x43bf('0x5c')]>0x1){_0x5917ad[_0x1f4134](_0x43bf('0x65'),qs[_0x43bf('0x66')](_0xc5c6d[_0x43bf('0x64')]),null);}else{var _0x2e4231='%'+_0xc5c6d[_0x43bf('0x64')]+'%';_0x5917ad[_0x1f4134](_0x43bf('0x67'),_0x2e4231,_0x2e4231,_0x2e4231);}}else{_0x5d5bf9=_['find'](_0x26db8f,[_0x43bf('0x29'),_0x43bf('0x68')]);_0xc5c6d[_0x43bf('0x44')]=_0x43bf('0x68');_0x4b360e=as[_0x43bf('0x69')](_0x1644f1,_0x5d5bf9[_0x43bf('0x6a')],_0xc5c6d);_0x5917ad[_0x1f4134](_0x4b360e[_0x43bf('0x6b')],_0x4b360e[_0x43bf('0x64')][_0x43bf('0x6c')],_0x4b360e[_0x43bf('0x64')][_0x43bf('0x6d')]);}break;case'Tag':var _0x4612fa=_0xc5c6d[_0x43bf('0x64')]['split'](',')['map'](function(_0x39fe0b){return Number(_0x39fe0b);});_0x4612fa[_0x43bf('0x2e')](function(_0x238743){_0x4e62b9['or'](_0x43bf('0x6e'),'%,'+_0x238743+',%');});_0x43df67=_[_0x43bf('0x6f')](_0x43df67,_0x4612fa);break;case'User':if(_0xc5c6d['operator']===_0x43bf('0x63')){_0x5917ad[_0x1f4134](_0x43bf('0x70'),'%'+_0xc5c6d['value']+'%',null);}else{_0x5d5bf9=_[_0x43bf('0x71')](_0x26db8f,[_0x43bf('0x29'),_0x43bf('0x72')]);_0xc5c6d[_0x43bf('0x44')]='UserId';_0x4b360e=as[_0x43bf('0x69')](_0x1644f1,_0x5d5bf9['type'],_0xc5c6d);_0x5917ad[_0x1f4134](_0x4b360e[_0x43bf('0x6b')],_0x4b360e[_0x43bf('0x64')][_0x43bf('0x6c')],_0x4b360e['value'][_0x43bf('0x6d')]);}break;case _0x43bf('0x73'):_0x4b360e=as[_0x43bf('0x69')]('me',null,_0xc5c6d);_0x5917ad[_0x1f4134](_0x4b360e[_0x43bf('0x6b')],_0x4b360e[_0x43bf('0x64')][_0x43bf('0x6c')],_0x4b360e[_0x43bf('0x64')]['end']);break;}}else{var _0x4b360e=as['buildExpression'](_0x1644f1,_0x5d5bf9['type'],_0xc5c6d);_0x5917ad[_0x1f4134](_0x4b360e['text'],_0x4b360e[_0x43bf('0x64')]['start'],_0x4b360e['value'][_0x43bf('0x6d')]);}}}else{var _0x214bbd=_(_0x325000[_0x43bf('0x37')])[_0x43bf('0x38')]()[_0x43bf('0x36')](function(_0x2af649){return _[_0x43bf('0x74')](_0x26db8f,[_0x43bf('0x29'),_0x2af649])?_0x2af649:undefined;})['compact']()['value']();if(!_[_0x43bf('0x75')](_0x214bbd)){_0x214bbd[_0x43bf('0x2e')](function(_0x1bb8c2){if(_0x1bb8c2===_0x43bf('0x76')){_0x3896d5[_0x43bf('0x41')](_0x43bf('0x77'),[]['concat'](_0x325000[_0x43bf('0x37')][_0x1bb8c2]));}else if(_0x1bb8c2==='createdAt'){var _0x2a8e46=JSON[_0x43bf('0x78')](_0x325000[_0x43bf('0x37')][_0x1bb8c2])[_0x43bf('0x79')];var _0x4aebc6=JSON['parse'](_0x325000['query'][_0x1bb8c2])[_0x43bf('0x7a')];_0x3896d5[_0x43bf('0x41')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x2a8e46,_0x4aebc6);}else{if(_0x325000[_0x43bf('0x37')][_0x1bb8c2]==='null'){_0x3896d5[_0x43bf('0x41')]('i.'+_0x1bb8c2+_0x43bf('0x7b'));}else{_0x3896d5['where']('i.'+_0x1bb8c2+_0x43bf('0x7c'),_0x325000[_0x43bf('0x37')][_0x1bb8c2]);}}});}if(_0x325000['query'][_0x43bf('0x7d')]){if(_0x325000[_0x43bf('0x37')]['read']==0x1){_0x3896d5['having'](_0x43bf('0x7e'));}else{_0x3896d5[_0x43bf('0x5f')]('`unreadMessages`\x20>\x200');}}if(_0x325000['query'][_0x43bf('0x7f')]){_0x43df67=_['isArray'](_0x325000[_0x43bf('0x37')]['tag'])?_0x325000['query']['tag']:new Array(_0x325000[_0x43bf('0x37')]['tag']);_0x43df67['forEach'](function(_0x3a7826){_0x4e62b9['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x3a7826+',%');});}if(_0x325000[_0x43bf('0x37')][_0x43bf('0x80')]){var _0x356116=_0x325000['query'][_0x43bf('0x80')]['replace']('\x5c','\x5c\x5c')[_0x43bf('0x81')](/'/g,'\x27\x27');if(qs[_0x43bf('0x82')](_0x356116)){_0x5917ad['or'](_0x43bf('0x83'),_0x356116+'%')['or']('i.fax\x20LIKE\x20?',_0x356116+'%');}_0x5917ad['or'](_0x43bf('0x84'),_0x356116+'%');}}_0x3896d5[_0x43bf('0x41')](_0x5917ad);_0x3896d5['group']('i.id');var _0x42c4c8={'type':db[_0x43bf('0x85')][_0x43bf('0x86')][_0x43bf('0x87')],'raw':!![]};var _0x4f3fbd=_0x3896d5[_0x43bf('0x88')]();_0x4f3fbd[_0x43bf('0x44')](_0x43bf('0x89'));_0x4f3fbd[_0x43bf('0x44')](_0x43bf('0x8a'),_0x43bf('0x5d'));if(_0x41a1dd[_0x43bf('0x8b')]){_0x41a1dd[_0x43bf('0x8b')]['forEach'](function(_0x1d00e6){var _0x1a7dad=_0x1d00e6[0x0]===_0x43bf('0x8c')?_0x1d00e6[0x0]:'i.'+_0x1d00e6[0x0];_0x3896d5[_0x43bf('0x8b')](_0x1a7dad,_0x1d00e6[0x1]===_0x43bf('0x8d')?![]:!![]);});}if(!_[_0x43bf('0x75')](_0x43df67)){_0x3896d5[_0x43bf('0x5f')](_0x4e62b9);_0x4f3fbd[_0x43bf('0x41')](_0x43bf('0x8e'),_0x43df67);}BPromise['resolve']()[_0x43bf('0x30')](function(){if(!_0x1d26c4){if(_0x325000['query'][_0x43bf('0x76')])return;_0x4f3fbd[_0x43bf('0x41')](_0x43bf('0x8f'));_0x3896d5[_0x43bf('0x41')](_0x43bf('0x8f'));return;}if(_0x325000['user'][_0x43bf('0x90')]!==_0x43bf('0x91'))return;return _0x325000[_0x43bf('0x92')][_0x43bf('0x93')]({'attributes':['id'],'raw':!![]})[_0x43bf('0x30')](function(_0x3d13a6){if(_[_0x43bf('0x75')](_0x3d13a6)){_0x4f3fbd[_0x43bf('0x41')]('i.FaxAccountId\x20IS\x20NULL');_0x3896d5[_0x43bf('0x41')](_0x43bf('0x94'));}else{_0x4f3fbd['where'](_0x43bf('0x77'),_[_0x43bf('0x36')](_0x3d13a6,'id'));_0x3896d5[_0x43bf('0x41')](_0x43bf('0x77'),_[_0x43bf('0x36')](_0x3d13a6,'id'));}});})[_0x43bf('0x30')](function(){if(_0x325000[_0x43bf('0x92')][_0x43bf('0x90')]===_0x43bf('0x91')&&!_0x1d26c4&&!_0x325000[_0x43bf('0x37')]['FaxAccountId'])return[];return db['sequelize']['query'](_0x4f3fbd[_0x43bf('0x95')](),_0x42c4c8);})[_0x43bf('0x30')](function(_0x5c7dd6){_0x23262b[_0x43bf('0x21')]=_0x5c7dd6[_0x43bf('0x5c')];if(_0x23262b[_0x43bf('0x21')]===0x0)return[];return db['sequelize'][_0x43bf('0x37')](_0xf0427[_0x43bf('0x95')](),_0x42c4c8)[_0x43bf('0x30')](function(_0x224830){_0x3ad712=_[_0x43bf('0x96')](_0x224830,'id');_0x42c4c8=_[_0x43bf('0x97')](_0x42c4c8,{'model':db['FaxInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x325000['query'][_0x43bf('0x3d')]){_0x41a1dd[_0x43bf('0x3c')][_0x43bf('0x2e')](function(_0xb19800){_0x3896d5[_0x43bf('0x44')]('i.'+_0xb19800);});}else{_0x3896d5[_0x43bf('0x44')](_0x43bf('0x8a'),'unreadMessages');_0x3896d5[_0x43bf('0x44')](_0x43bf('0x98'),_0x43bf('0x99'));_0x3896d5['field']('a.mandatoryDisposition',_0x43bf('0x9a'));_0x3896d5[_0x43bf('0x44')](_0x43bf('0x9b'),_0x43bf('0x8c'));_0x3896d5[_0x43bf('0x44')]('i.*');_0x3896d5[_0x43bf('0x44')](_0x43bf('0x9c'),'Contact.firstName');_0x3896d5[_0x43bf('0x44')](_0x43bf('0x9d'),_0x43bf('0x9e'));_0x3896d5['field']('c.email','Contact.email');_0x3896d5['field'](_0x43bf('0x9f'),_0x43bf('0xa0'));_0x3896d5[_0x43bf('0x44')](_0x43bf('0xa1'),_0x43bf('0xa2'));_0x3896d5[_0x43bf('0x44')]('c.fax',_0x43bf('0xa3'));_0x3896d5[_0x43bf('0x44')](_0x43bf('0xa4'),_0x43bf('0xa5'));_0x3896d5[_0x43bf('0x44')]('o.internal','Owner.internal');_0x3896d5[_0x43bf('0x44')](_0x43bf('0xa6'),_0x43bf('0x2b'));}if(_0x41a1dd['limit'])_0x3896d5[_0x43bf('0x22')](_0x41a1dd['limit']);if(_0x41a1dd[_0x43bf('0x1f')])_0x3896d5[_0x43bf('0x1f')](_0x41a1dd[_0x43bf('0x1f')]);return db[_0x43bf('0xa7')][_0x43bf('0x37')](_0x3896d5['toString'](),_0x42c4c8);})['then'](function(_0x3c3282){if(_0x3c3282[_0x43bf('0x5c')]>0x0)_0x193e9b[_0x43bf('0x41')]('ui.FaxInteractionId\x20IN\x20?',_['map'](_0x3c3282,'id'));return db[_0x43bf('0xa7')][_0x43bf('0x37')](_0x193e9b['toString'](),_0x42c4c8)[_0x43bf('0x30')](function(_0x221701){var _0x3c32b9=_[_0x43bf('0xa8')](_0x221701,_0x43bf('0xa9'));var _0x4e2ebf=[];_0x3c3282['forEach'](function(_0x256561){_0x4e2ebf[_0x43bf('0x2f')](updateFaxInteraction(_0x256561,_0x3ad712,_0x3c32b9));});return BPromise[_0x43bf('0xaa')](_0x4e2ebf);});});})[_0x43bf('0x30')](function(_0x1ee408){_0x23262b[_0x43bf('0xab')]=_0x1ee408;return _0x23262b;})[_0x43bf('0x30')](respondWithFilteredResult(_0x4f43b4,_0x41a1dd))[_0x43bf('0xac')](handleError(_0x4f43b4,null));};exports['show']=function(_0x50c6ef,_0x5c2d6f){var _0x38c969={'raw':![],'where':{'id':_0x50c6ef[_0x43bf('0xad')]['id']}},_0x31b719={};_0x31b719['model']=_[_0x43bf('0x38')](db[_0x43bf('0x32')][_0x43bf('0x33')]);_0x31b719['query']=_[_0x43bf('0x38')](_0x50c6ef[_0x43bf('0x37')]);_0x31b719[_0x43bf('0x39')]=_['intersection'](_0x31b719[_0x43bf('0x3b')],_0x31b719['query']);_0x38c969[_0x43bf('0x3c')]=_['intersection'](_0x31b719[_0x43bf('0x3b')],qs[_0x43bf('0x3d')](_0x50c6ef[_0x43bf('0x37')][_0x43bf('0x3d')]));_0x38c969[_0x43bf('0x3c')]=_0x38c969[_0x43bf('0x3c')]['length']?_0x38c969[_0x43bf('0x3c')]:_0x31b719['model'];if(_0x50c6ef[_0x43bf('0x37')]['includeAll']){_0x38c969[_0x43bf('0xae')]=[{'all':!![]}];}_0x38c969=_[_0x43bf('0x97')]({},_0x38c969,_0x50c6ef['options']);return db['FaxInteraction'][_0x43bf('0x71')](_0x38c969)['then'](handleEntityNotFound(_0x5c2d6f,null))['then'](respondWithResult(_0x5c2d6f,null))['catch'](handleError(_0x5c2d6f,null));};exports[_0x43bf('0xaf')]=function(_0xfde139,_0x4aa0df){return db[_0x43bf('0x32')][_0x43bf('0xaf')](_0xfde139['body'],{})['then'](respondWithResult(_0x4aa0df,0xc9))['catch'](handleError(_0x4aa0df,null));};exports[_0x43bf('0xb0')]=function(_0x5834d4,_0x107665){if(_0x5834d4[_0x43bf('0x73')]['id']){delete _0x5834d4['body']['id'];}return db['FaxInteraction'][_0x43bf('0x71')]({'where':{'id':_0x5834d4[_0x43bf('0xad')]['id']}})['then'](handleEntityNotFound(_0x107665,null))[_0x43bf('0x30')](saveUpdates(_0x5834d4[_0x43bf('0x73')],null))[_0x43bf('0x30')](respondWithResult(_0x107665,null))[_0x43bf('0xac')](handleError(_0x107665,null));};exports[_0x43bf('0x26')]=function(_0x3315c9,_0x4d9ccd){return db[_0x43bf('0x32')]['find']({'where':{'id':_0x3315c9['params']['id']}})['then'](handleEntityNotFound(_0x4d9ccd,null))['then'](removeEntity(_0x4d9ccd,null))[_0x43bf('0xac')](handleError(_0x4d9ccd,null));};exports[_0x43bf('0xb1')]=function(_0x5c01c5,_0x5c2154){return db['FaxInteraction'][_0x43bf('0xb1')]()[_0x43bf('0x30')](respondWithResult(_0x5c2154,null))[_0x43bf('0xac')](handleError(_0x5c2154,null));};exports[_0x43bf('0xb2')]=function(_0xbf668a,_0x5481e3,_0x4cc0bc){return db[_0x43bf('0xb3')][_0x43bf('0x71')]({'where':{'id':_0xbf668a['params']['id']}})[_0x43bf('0x30')](handleEntityNotFound(_0x5481e3,null))['then'](function(_0x454273){if(_0x454273){return _0x454273['addMessage'](_0xbf668a[_0x43bf('0x73')]['ids'],_[_0x43bf('0xb4')](_0xbf668a[_0x43bf('0x73')],[_0x43bf('0xb5'),'id'])||{});}})[_0x43bf('0x30')](respondWithResult(_0x5481e3,null))[_0x43bf('0xac')](handleError(_0x5481e3,null));};exports['getMessages']=function(_0x44d87a,_0x585b2f,_0x4e06dd){var _0x1f70d8={'raw':![],'where':{}};var _0x2ba72e={};var _0x384ec6={'count':0x0,'rows':[]};return db[_0x43bf('0x32')][_0x43bf('0xb6')]({'where':{'id':_0x44d87a[_0x43bf('0xad')]['id']}})[_0x43bf('0x30')](handleEntityNotFound(_0x585b2f,null))[_0x43bf('0x30')](function(_0x2c8ffa){if(_0x2c8ffa){_0x2ba72e[_0x43bf('0x3b')]=_['keys'](db[_0x43bf('0xb3')][_0x43bf('0x33')]);_0x2ba72e[_0x43bf('0x37')]=_[_0x43bf('0x38')](_0x44d87a[_0x43bf('0x37')]);_0x2ba72e[_0x43bf('0x39')]=_[_0x43bf('0x3a')](_0x2ba72e[_0x43bf('0x3b')],_0x2ba72e['query']);_0x1f70d8[_0x43bf('0x3c')]=_[_0x43bf('0x3a')](_0x2ba72e['model'],qs[_0x43bf('0x3d')](_0x44d87a[_0x43bf('0x37')][_0x43bf('0x3d')]));_0x1f70d8[_0x43bf('0x3c')]=_0x1f70d8[_0x43bf('0x3c')][_0x43bf('0x5c')]?_0x1f70d8[_0x43bf('0x3c')]:_0x2ba72e[_0x43bf('0x3b')];if(!_0x44d87a[_0x43bf('0x37')]['hasOwnProperty']('nolimit')){_0x1f70d8[_0x43bf('0x22')]=qs[_0x43bf('0x22')](_0x44d87a[_0x43bf('0x37')][_0x43bf('0x22')]);_0x1f70d8[_0x43bf('0x1f')]=qs[_0x43bf('0x1f')](_0x44d87a['query']['offset']);}_0x1f70d8['order']=qs[_0x43bf('0x40')](_0x44d87a[_0x43bf('0x37')]['sort']);_0x1f70d8[_0x43bf('0x41')]=qs[_0x43bf('0x39')](_['pick'](_0x44d87a[_0x43bf('0x37')],_0x2ba72e[_0x43bf('0x39')]));_0x1f70d8[_0x43bf('0x41')][_0x43bf('0xa9')]=_0x2c8ffa['id'];if(_0x44d87a[_0x43bf('0x37')][_0x43bf('0x80')]){_0x1f70d8[_0x43bf('0x41')]=_[_0x43bf('0x97')](_0x1f70d8[_0x43bf('0x41')],{'$or':_[_0x43bf('0x36')](_0x1f70d8[_0x43bf('0x3c')],function(_0x458ee6){var _0x49d7ef={};_0x49d7ef[_0x458ee6]={'$like':'%'+_0x44d87a[_0x43bf('0x37')]['filter']+'%'};return _0x49d7ef;})});}if(_0x44d87a[_0x43bf('0x37')][_0x43bf('0x79')]){var _0x213061=_0x44d87a['query']['$gte'][_0x43bf('0x2d')](',');var _0x35b98b={};_0x35b98b[_0x213061[0x0]]={'$gte':moment(_0x213061[0x1])[_0x43bf('0xb7')](_0x43bf('0xb8'))};_0x1f70d8['where']=_[_0x43bf('0x97')](_0x1f70d8[_0x43bf('0x41')],_0x35b98b);}_0x1f70d8=_[_0x43bf('0x97')]({},_0x1f70d8,_0x44d87a[_0x43bf('0xb9')]);return db[_0x43bf('0xb3')][_0x43bf('0x21')]({'where':_0x1f70d8[_0x43bf('0x41')]})[_0x43bf('0x30')](function(_0x306faf){_0x384ec6[_0x43bf('0x21')]=_0x306faf;if(_0x44d87a[_0x43bf('0x37')][_0x43bf('0xba')]){_0x1f70d8['include']=[{'all':!![]}];}return db[_0x43bf('0xb3')][_0x43bf('0xbb')](_0x1f70d8);})['then'](function(_0x29771d){_0x384ec6[_0x43bf('0xab')]=_0x29771d;return _0x384ec6;});}})['then'](respondWithFilteredResult(_0x585b2f,_0x1f70d8))[_0x43bf('0xac')](handleError(_0x585b2f,null));};exports[_0x43bf('0xbc')]=function(_0x358fc8,_0x2c4d75,_0x39e68f){return db[_0x43bf('0x32')]['find']({'where':{'id':_0x358fc8[_0x43bf('0xad')]['id']}})[_0x43bf('0x30')](handleEntityNotFound(_0x2c4d75,null))[_0x43bf('0x30')](function(_0x5d25bf){if(_0x5d25bf){return _0x5d25bf[_0x43bf('0xbd')](_0x358fc8[_0x43bf('0x73')][_0x43bf('0xb5')],_[_0x43bf('0xb4')](_0x358fc8[_0x43bf('0x73')],[_0x43bf('0xb5'),'id'])||{})['spread'](function(){return db[_0x43bf('0xbe')][_0x43bf('0xbb')]({'attributes':['id',_0x43bf('0x29'),_0x43bf('0x45')],'where':{'id':_0x358fc8['body'][_0x43bf('0xb5')]}});})[_0x43bf('0x30')](function(_0x20a4b6){socket[_0x43bf('0xbf')](_0x43bf('0xc0'),{'id':Number(_0x358fc8['params']['id']),'tags':_0x20a4b6||[]});return{'id':Number(_0x358fc8[_0x43bf('0xad')]['id']),'tags':_0x20a4b6||[]};});}})[_0x43bf('0x30')](respondWithResult(_0x2c4d75,null))[_0x43bf('0xac')](handleError(_0x2c4d75,null));};exports[_0x43bf('0xc1')]=function(_0x30870d,_0x2415e4,_0x43d52d){return db[_0x43bf('0x32')][_0x43bf('0x71')]({'where':{'id':_0x30870d[_0x43bf('0xad')]['id']}})[_0x43bf('0x30')](handleEntityNotFound(_0x2415e4,null))[_0x43bf('0x30')](function(_0x2fdc4e){if(_0x2fdc4e){return _0x2fdc4e[_0x43bf('0xc1')](_0x30870d[_0x43bf('0x37')][_0x43bf('0xb5')]);}})[_0x43bf('0x30')](respondWithStatusCode(_0x2415e4,null))[_0x43bf('0xac')](handleError(_0x2415e4,null));};exports[_0x43bf('0xc2')]=function(_0x226870,_0x1d5bf4){var _0x6da467=moment()[_0x43bf('0xc3')]()[_0x43bf('0x95')]();var _0x10fe21=path[_0x43bf('0xc4')](config['root'],'server',_0x43bf('0xc5'),_0x43bf('0xc6'));var _0xcf49a1=path[_0x43bf('0xc4')](config[_0x43bf('0xc7')],_0x43bf('0xc8'),'files','attachments');var _0x847706=path[_0x43bf('0xc4')](_0x10fe21,_0x6da467);var _0x5df8b4=util[_0x43bf('0xb7')](_0x43bf('0xc9'),_0x226870[_0x43bf('0xad')]['id'],_0x6da467);var _0x37e4a9=path['join'](_0x10fe21,_0x5df8b4);var _0x16e150=[];_0x16e150['push']({'model':db['Attachment'],'as':_0x43bf('0xca'),'raw':!![]});var _0x22cebe=[{'model':db[_0x43bf('0xb3')],'as':_0x43bf('0xcb'),'attributes':['id','body',_0x43bf('0xcc')],'include':_0x16e150}];return db[_0x43bf('0x32')]['find']({'where':{'id':_0x226870[_0x43bf('0xad')]['id']},'include':_0x22cebe})[_0x43bf('0x30')](handleEntityNotFound(_0x1d5bf4,null))[_0x43bf('0x30')](function(_0x8939bf){if(_0x8939bf&&_0x8939bf[_0x43bf('0xcb')]){var _0x62c5e9=_0x8939bf['get']({'plain':!![]});fs[_0x43bf('0xcd')](_0x847706);for(var _0x59dcf0=0x0;_0x59dcf0<_0x62c5e9['Messages']['length'];_0x59dcf0++){var _0xce7c3f=_0x62c5e9[_0x43bf('0xcb')][_0x59dcf0][_0x43bf('0xca')];if(_0xce7c3f){var _0x50b38d=path['join'](_0xcf49a1,_0xce7c3f[_0x43bf('0xce')]);if(fs[_0x43bf('0xcf')](_0x50b38d)){fs[_0x43bf('0xd0')](_0x50b38d)[_0x43bf('0xd1')](fs[_0x43bf('0xd2')](path['join'](_0x847706,_0xce7c3f[_0x43bf('0xce')])));}}}return BPromise[_0x43bf('0xd3')]()[_0x43bf('0x30')](function(){return new BPromise(function(_0x19360e,_0x55a086){zipdir(_0x847706,{'saveTo':_0x37e4a9},function(_0x3fd5b0,_0x3a2deb){if(_0x3fd5b0)return _0x55a086(_0x3fd5b0);return _0x19360e(_0x3a2deb);});})[_0x43bf('0x30')](function(){return new BPromise(function(_0x2898a4,_0xc48007){rimraf(_0x847706,function(_0x48d401){if(_0x48d401)_0xc48007(_0x48d401);return _0x2898a4();});});})[_0x43bf('0x30')](function(){return _0x1d5bf4[_0x43bf('0xc2')](_0x37e4a9,_0x5df8b4,function(_0x25d2db){if(_0x25d2db){console[_0x43bf('0xd4')](_0x43bf('0xd5'),_0x25d2db);}else{fs[_0x43bf('0xd6')](_0x37e4a9);}});});});}else{return _0x1d5bf4[_0x43bf('0x1d')](0xc8);}})[_0x43bf('0xac')](handleError(_0x1d5bf4,null));}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.events.js b/server/api/faxInteraction/faxInteraction.events.js index d277c13..bc98ea7 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 _0x7308=['unreadMessages','length','emit','catch','hasOwnProperty','hook','exports','events','../../mysqldb','FaxInteraction','update','getUsers','setDataValue','Users','map'];(function(_0x57bf1c,_0x594653){var _0x1da3d4=function(_0x5c8138){while(--_0x5c8138){_0x57bf1c['push'](_0x57bf1c['shift']());}};_0x1da3d4(++_0x594653);}(_0x7308,0x124));var _0x8730=function(_0x1367fb,_0x42b7b3){_0x1367fb=_0x1367fb-0x0;var _0x9ccc92=_0x7308[_0x1367fb];return _0x9ccc92;};'use strict';var EventEmitter=require(_0x8730('0x0'));var FaxInteraction=require(_0x8730('0x1'))['db'][_0x8730('0x2')];var FaxMessage=require(_0x8730('0x1'))['db']['FaxMessage'];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x8730('0x3'),'afterDestroy':'remove'};function emitEvent(_0x25de79){return function(_0x120cf0,_0x105e7f,_0x2ec5e4){_0x120cf0[_0x8730('0x4')]({'attributes':['id'],'raw':!![]})['then'](function(_0x9a8666){_0x120cf0[_0x8730('0x5')](_0x8730('0x6'),_0x9a8666[_0x8730('0x7')](function(_0x24ed07){return{'id':_0x24ed07['id']};}));return FaxMessage['findAll']({'where':{'FaxInteractionId':_0x120cf0['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0xf9742b){_0x120cf0[_0x8730('0x5')](_0x8730('0x8'),_0xf9742b[_0x8730('0x9')]);FaxInteractionEvents['emit'](_0x25de79+':'+_0x120cf0['id'],_0x120cf0);FaxInteractionEvents[_0x8730('0xa')](_0x25de79,_0x120cf0);_0x2ec5e4(null);})[_0x8730('0xb')](_0x2ec5e4(null));};}for(var e in events){if(events[_0x8730('0xc')](e)){var event=events[e];FaxInteraction[_0x8730('0xd')](e,emitEvent(event));}}module[_0x8730('0xe')]=FaxInteractionEvents; \ No newline at end of file +var _0xcf04=['then','setDataValue','Users','map','length','emit','hasOwnProperty','hook','exports','events','../../mysqldb','FaxInteraction','FaxMessage','setMaxListeners','save','update','remove','getUsers'];(function(_0x3f5706,_0x49e0f5){var _0x2b480f=function(_0x48cc4f){while(--_0x48cc4f){_0x3f5706['push'](_0x3f5706['shift']());}};_0x2b480f(++_0x49e0f5);}(_0xcf04,0x1cb));var _0x4cf0=function(_0x3737de,_0xe7d352){_0x3737de=_0x3737de-0x0;var _0xcea1ef=_0xcf04[_0x3737de];return _0xcea1ef;};'use strict';var EventEmitter=require(_0x4cf0('0x0'));var FaxInteraction=require(_0x4cf0('0x1'))['db'][_0x4cf0('0x2')];var FaxMessage=require(_0x4cf0('0x1'))['db'][_0x4cf0('0x3')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0x4cf0('0x4')](0x0);var events={'afterCreate':_0x4cf0('0x5'),'afterUpdate':_0x4cf0('0x6'),'afterDestroy':_0x4cf0('0x7')};function emitEvent(_0x325997){return function(_0x5414cf,_0xd83001,_0x5eca8c){_0x5414cf[_0x4cf0('0x8')]({'attributes':['id'],'raw':!![]})[_0x4cf0('0x9')](function(_0x294031){_0x5414cf[_0x4cf0('0xa')](_0x4cf0('0xb'),_0x294031[_0x4cf0('0xc')](function(_0x16a95a){return{'id':_0x16a95a['id']};}));return FaxMessage['findAll']({'where':{'FaxInteractionId':_0x5414cf['id'],'direction':'in','read':![]},'raw':!![]});})[_0x4cf0('0x9')](function(_0x3aa418){_0x5414cf[_0x4cf0('0xa')]('unreadMessages',_0x3aa418[_0x4cf0('0xd')]);FaxInteractionEvents[_0x4cf0('0xe')](_0x325997+':'+_0x5414cf['id'],_0x5414cf);FaxInteractionEvents['emit'](_0x325997,_0x5414cf);_0x5eca8c(null);})['catch'](_0x5eca8c(null));};}for(var e in events){if(events[_0x4cf0('0xf')](e)){var event=events[e];FaxInteraction[_0x4cf0('0x10')](e,emitEvent(event));}}module[_0x4cf0('0x11')]=FaxInteractionEvents; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.model.js b/server/api/faxInteraction/faxInteraction.model.js index 3400ca6..8bef7ea 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 _0x1324=['request-promise','path','../../config/environment','./faxInteraction.attributes','exports','define','changed','closedAt','YYYY-MM-DD\x20HH:mm:ss','lodash','api','moment','bluebird'];(function(_0x21df09,_0xa54ebc){var _0x58c3ec=function(_0x17de19){while(--_0x17de19){_0x21df09['push'](_0x21df09['shift']());}};_0x58c3ec(++_0xa54ebc);}(_0x1324,0x1c3));var _0x4132=function(_0x38b817,_0x14f0c3){_0x38b817=_0x38b817-0x0;var _0x207922=_0x1324[_0x38b817];return _0x207922;};'use strict';var _=require(_0x4132('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x4132('0x1'));var moment=require(_0x4132('0x2'));var BPromise=require(_0x4132('0x3'));var rp=require(_0x4132('0x4'));var fs=require('fs');var path=require(_0x4132('0x5'));var rimraf=require('rimraf');var config=require(_0x4132('0x6'));var attributes=require(_0x4132('0x7'));module[_0x4132('0x8')]=function(_0x1cda67,_0x50466d){return _0x1cda67[_0x4132('0x9')]('FaxInteraction',attributes,{'tableName':'fax_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x280cdd,_0x5cf34a,_0x1c5d03){if(_0x280cdd[_0x4132('0xa')]('closed')){_0x280cdd[_0x4132('0xb')]=moment()['format'](_0x4132('0xc'));}_0x1c5d03(null,_0x280cdd);}}});}; \ No newline at end of file +var _0x3c6a=['rimraf','../../config/environment','./faxInteraction.attributes','exports','define','FaxInteraction','fax_interactions','changed','closed','closedAt','format','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x1d50f2,_0x3c3ec6){var _0x3769b8=function(_0x50926a){while(--_0x50926a){_0x1d50f2['push'](_0x1d50f2['shift']());}};_0x3769b8(++_0x3c3ec6);}(_0x3c6a,0xd1));var _0xa3c6=function(_0x255d5b,_0x4f6f35){_0x255d5b=_0x255d5b-0x0;var _0x3e141a=_0x3c6a[_0x255d5b];return _0x3e141a;};'use strict';var _=require('lodash');var util=require(_0xa3c6('0x0'));var logger=require(_0xa3c6('0x1'))(_0xa3c6('0x2'));var moment=require(_0xa3c6('0x3'));var BPromise=require(_0xa3c6('0x4'));var rp=require(_0xa3c6('0x5'));var fs=require('fs');var path=require(_0xa3c6('0x6'));var rimraf=require(_0xa3c6('0x7'));var config=require(_0xa3c6('0x8'));var attributes=require(_0xa3c6('0x9'));module[_0xa3c6('0xa')]=function(_0x5a8931,_0x25f92d){return _0x5a8931[_0xa3c6('0xb')](_0xa3c6('0xc'),attributes,{'tableName':_0xa3c6('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x43c5c0,_0xa4d22,_0x3eb474){if(_0x43c5c0[_0xa3c6('0xe')](_0xa3c6('0xf'))){_0x43c5c0[_0xa3c6('0x10')]=moment()[_0xa3c6('0x11')]('YYYY-MM-DD\x20HH:mm:ss');}_0x3eb474(null,_0x43c5c0);}}});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.rpc.js b/server/api/faxInteraction/faxInteraction.rpc.js index 290a4f7..a3ecdef 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 _0x3d60=['AddTagsToFaxInteraction','find','addTags','ids','omit','AddTags','stringify','lodash','util','ioredis','../../mysqldb','../../config/utils','../../config/environment','http','redis','defaults','register','request','then','info','FaxInteraction,\x20%s,\x20%s','FaxInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','UpdateFaxInteraction','FaxInteraction','update','body','options','where','attributes','limit','debug','catch'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x3d60,0x9b));var _0x03d6=function(_0x2df4b5,_0x38c2ab){_0x2df4b5=_0x2df4b5-0x0;var _0x43f2b5=_0x3d60[_0x2df4b5];return _0x43f2b5;};'use strict';var _=require(_0x03d6('0x0'));var util=require(_0x03d6('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x03d6('0x2'));var db=require(_0x03d6('0x3'))['db'];var utils=require(_0x03d6('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0x03d6('0x5'));var jayson=require('jayson/promise');var client=jayson['client'][_0x03d6('0x6')]({'port':0x232a});config[_0x03d6('0x7')]=_[_0x03d6('0x8')](config[_0x03d6('0x7')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x03d6('0x7')]));require('./faxInteraction.socket')[_0x03d6('0x9')](socket);function respondWithRpcPromise(_0x182729,_0x3a77da,_0x5aa04b){return new BPromise(function(_0x4d6a3c,_0x1dfb08){return client[_0x03d6('0xa')](_0x182729,_0x5aa04b)[_0x03d6('0xb')](function(_0x576f38){logger[_0x03d6('0xc')](_0x03d6('0xd'),_0x3a77da,'request\x20sent');logger['debug'](_0x03d6('0xe'),_0x3a77da,_0x03d6('0xf'),JSON['stringify'](_0x576f38));if(_0x576f38[_0x03d6('0x10')]){if(_0x576f38[_0x03d6('0x10')][_0x03d6('0x11')]===0x1f4){logger['error'](_0x03d6('0xd'),_0x3a77da,_0x576f38['error'][_0x03d6('0x12')]);return _0x1dfb08(_0x576f38[_0x03d6('0x10')][_0x03d6('0x12')]);}logger[_0x03d6('0x10')](_0x03d6('0xd'),_0x3a77da,_0x576f38[_0x03d6('0x10')][_0x03d6('0x12')]);return _0x4d6a3c(_0x576f38['error'][_0x03d6('0x12')]);}else{logger[_0x03d6('0xc')]('FaxInteraction,\x20%s,\x20%s',_0x3a77da,'request\x20sent');_0x4d6a3c(_0x576f38[_0x03d6('0x13')][_0x03d6('0x12')]);}})['catch'](function(_0x594ca1){logger[_0x03d6('0x10')](_0x03d6('0xd'),_0x3a77da,_0x594ca1);_0x1dfb08(_0x594ca1);});});}exports[_0x03d6('0x14')]=function(_0x2d2dc3){var _0x5c746a=this;return new Promise(function(_0x4cb22d,_0x280304){return db[_0x03d6('0x15')][_0x03d6('0x16')](_0x2d2dc3[_0x03d6('0x17')],{'raw':_0x2d2dc3[_0x03d6('0x18')]?_0x2d2dc3['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2d2dc3[_0x03d6('0x18')]?_0x2d2dc3[_0x03d6('0x18')][_0x03d6('0x19')]||null:null,'attributes':_0x2d2dc3['options']?_0x2d2dc3[_0x03d6('0x18')][_0x03d6('0x1a')]||null:null,'limit':_0x2d2dc3[_0x03d6('0x18')]?_0x2d2dc3[_0x03d6('0x18')][_0x03d6('0x1b')]||null:null})[_0x03d6('0xb')](function(_0x40e818){logger['info'](_0x03d6('0x14'),_0x2d2dc3);logger[_0x03d6('0x1c')](_0x03d6('0x14'),_0x2d2dc3,JSON['stringify'](_0x40e818));_0x4cb22d(_0x40e818);})[_0x03d6('0x1d')](function(_0x120db4){logger[_0x03d6('0x10')](_0x03d6('0x14'),_0x120db4['message'],_0x2d2dc3);_0x280304(_0x5c746a[_0x03d6('0x10')](0x1f4,_0x120db4[_0x03d6('0x12')]));});});};exports[_0x03d6('0x1e')]=function(_0x2b1af3){return new Promise(function(_0x288594,_0x199c8c){return db[_0x03d6('0x15')][_0x03d6('0x1f')]({'where':_0x2b1af3[_0x03d6('0x18')]?_0x2b1af3['options'][_0x03d6('0x19')]||null:null})[_0x03d6('0xb')](function(_0x3eeb93){if(_0x3eeb93){return _0x3eeb93[_0x03d6('0x20')](_0x2b1af3[_0x03d6('0x17')][_0x03d6('0x21')],_[_0x03d6('0x22')](_0x2b1af3[_0x03d6('0x17')],[_0x03d6('0x21'),'id'])||{});}})['spread'](function(_0x2079e9){logger[_0x03d6('0xc')](_0x03d6('0x23'),_0x2b1af3);logger[_0x03d6('0x1c')](_0x03d6('0x23'),_0x2b1af3,JSON[_0x03d6('0x24')](_0x2079e9));_0x288594(_0x2079e9);})['catch'](function(_0x59865e){logger['error']('AddTags',_0x59865e[_0x03d6('0x12')],_0x2b1af3);_0x199c8c(_this[_0x03d6('0x10')](0x1f4,_0x59865e[_0x03d6('0x12')]));});});}; \ No newline at end of file +var _0x8575=['../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./faxInteraction.socket','register','request','then','info','FaxInteraction,\x20%s,\x20%s','request\x20sent','debug','FaxInteraction,\x20%s,\x20%s,\x20%s','error','message','result','FaxInteraction','body','options','raw','attributes','UpdateFaxInteraction','stringify','catch','find','where','addTags','ids','spread','AddTags','util','bluebird','randomstring'];(function(_0x35e75a,_0x5ed225){var _0xb23c7f=function(_0x2fa40c){while(--_0x2fa40c){_0x35e75a['push'](_0x35e75a['shift']());}};_0xb23c7f(++_0x5ed225);}(_0x8575,0x13d));var _0x5857=function(_0x5b9a26,_0xc97bca){_0x5b9a26=_0x5b9a26-0x0;var _0x18b15d=_0x8575[_0x5b9a26];return _0x18b15d;};'use strict';var _=require('lodash');var util=require(_0x5857('0x0'));var moment=require('moment');var BPromise=require(_0x5857('0x1'));var rs=require(_0x5857('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5857('0x3'))['db'];var utils=require(_0x5857('0x4'));var logger=require(_0x5857('0x5'))('rpc');var config=require(_0x5857('0x6'));var jayson=require(_0x5857('0x7'));var client=jayson[_0x5857('0x8')][_0x5857('0x9')]({'port':0x232a});config[_0x5857('0xa')]=_[_0x5857('0xb')](config[_0x5857('0xa')],{'host':_0x5857('0xc'),'port':0x18eb});var socket=require(_0x5857('0xd'))(new Redis(config[_0x5857('0xa')]));require(_0x5857('0xe'))[_0x5857('0xf')](socket);function respondWithRpcPromise(_0x50b81a,_0x2d49de,_0x580f89){return new BPromise(function(_0x6d4216,_0x4a87d6){return client[_0x5857('0x10')](_0x50b81a,_0x580f89)[_0x5857('0x11')](function(_0x1344e){logger[_0x5857('0x12')](_0x5857('0x13'),_0x2d49de,_0x5857('0x14'));logger[_0x5857('0x15')](_0x5857('0x16'),_0x2d49de,_0x5857('0x14'),JSON['stringify'](_0x1344e));if(_0x1344e[_0x5857('0x17')]){if(_0x1344e[_0x5857('0x17')]['code']===0x1f4){logger['error'](_0x5857('0x13'),_0x2d49de,_0x1344e[_0x5857('0x17')][_0x5857('0x18')]);return _0x4a87d6(_0x1344e[_0x5857('0x17')][_0x5857('0x18')]);}logger['error'](_0x5857('0x13'),_0x2d49de,_0x1344e['error']['message']);return _0x6d4216(_0x1344e['error'][_0x5857('0x18')]);}else{logger[_0x5857('0x12')](_0x5857('0x13'),_0x2d49de,'request\x20sent');_0x6d4216(_0x1344e[_0x5857('0x19')][_0x5857('0x18')]);}})['catch'](function(_0x312e3f){logger[_0x5857('0x17')](_0x5857('0x13'),_0x2d49de,_0x312e3f);_0x4a87d6(_0x312e3f);});});}exports['UpdateFaxInteraction']=function(_0x19f1b5){var _0x44e5fb=this;return new Promise(function(_0x41ecc2,_0x37c15c){return db[_0x5857('0x1a')]['update'](_0x19f1b5[_0x5857('0x1b')],{'raw':_0x19f1b5[_0x5857('0x1c')]?_0x19f1b5[_0x5857('0x1c')][_0x5857('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x19f1b5[_0x5857('0x1c')]?_0x19f1b5[_0x5857('0x1c')]['where']||null:null,'attributes':_0x19f1b5[_0x5857('0x1c')]?_0x19f1b5[_0x5857('0x1c')][_0x5857('0x1e')]||null:null,'limit':_0x19f1b5[_0x5857('0x1c')]?_0x19f1b5['options']['limit']||null:null})['then'](function(_0x48ed85){logger[_0x5857('0x12')]('UpdateFaxInteraction',_0x19f1b5);logger[_0x5857('0x15')](_0x5857('0x1f'),_0x19f1b5,JSON[_0x5857('0x20')](_0x48ed85));_0x41ecc2(_0x48ed85);})[_0x5857('0x21')](function(_0xcfb279){logger['error'](_0x5857('0x1f'),_0xcfb279[_0x5857('0x18')],_0x19f1b5);_0x37c15c(_0x44e5fb[_0x5857('0x17')](0x1f4,_0xcfb279[_0x5857('0x18')]));});});};exports['AddTagsToFaxInteraction']=function(_0x4a7683){return new Promise(function(_0x37259a,_0x5c438d){return db[_0x5857('0x1a')][_0x5857('0x22')]({'where':_0x4a7683[_0x5857('0x1c')]?_0x4a7683[_0x5857('0x1c')][_0x5857('0x23')]||null:null})[_0x5857('0x11')](function(_0x28ffd3){if(_0x28ffd3){return _0x28ffd3[_0x5857('0x24')](_0x4a7683[_0x5857('0x1b')][_0x5857('0x25')],_['omit'](_0x4a7683[_0x5857('0x1b')],[_0x5857('0x25'),'id'])||{});}})[_0x5857('0x26')](function(_0x4984f2){logger[_0x5857('0x12')](_0x5857('0x27'),_0x4a7683);logger[_0x5857('0x15')]('AddTags',_0x4a7683,JSON[_0x5857('0x20')](_0x4984f2));_0x37259a(_0x4984f2);})[_0x5857('0x21')](function(_0x3da8cb){logger[_0x5857('0x17')]('AddTags',_0x3da8cb[_0x5857('0x18')],_0x4a7683);_0x5c438d(_this[_0x5857('0x17')](0x1f4,_0x3da8cb[_0x5857('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.socket.js b/server/api/faxInteraction/faxInteraction.socket.js index 2f30630..ddc5004 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 _0x12fa=['removeListener','register','length','faxInteraction:','save','remove','update','emit'];(function(_0x19ac89,_0x2613cb){var _0x416ecb=function(_0x3a96fd){while(--_0x3a96fd){_0x19ac89['push'](_0x19ac89['shift']());}};_0x416ecb(++_0x2613cb);}(_0x12fa,0x1a4));var _0xa12f=function(_0x100f24,_0x1e46df){_0x100f24=_0x100f24-0x0;var _0x42d93c=_0x12fa[_0x100f24];return _0x42d93c;};'use strict';var FaxInteractionEvents=require('./faxInteraction.events');var events=[_0xa12f('0x0'),_0xa12f('0x1'),_0xa12f('0x2')];function createListener(_0x16d7b8,_0x5e3ea5){return function(_0x160952){_0x5e3ea5[_0xa12f('0x3')](_0x16d7b8,_0x160952);};}function removeListener(_0x4258d8,_0x249f8f){return function(){FaxInteractionEvents[_0xa12f('0x4')](_0x4258d8,_0x249f8f);};}exports[_0xa12f('0x5')]=function(_0x595234){for(var _0x2ff198=0x0,_0x2a89f9=events[_0xa12f('0x6')];_0x2ff198<_0x2a89f9;_0x2ff198++){var _0x43b425=events[_0x2ff198];var _0x4afdc8=createListener(_0xa12f('0x7')+_0x43b425,_0x595234);FaxInteractionEvents['on'](_0x43b425,_0x4afdc8);}}; \ No newline at end of file +var _0x4e0f=['removeListener','register','length','faxInteraction:','./faxInteraction.events','save','remove','update','emit'];(function(_0x31e4f8,_0xd118e1){var _0x113885=function(_0x24b8dd){while(--_0x24b8dd){_0x31e4f8['push'](_0x31e4f8['shift']());}};_0x113885(++_0xd118e1);}(_0x4e0f,0x17e));var _0xf4e0=function(_0x7eb3ad,_0x571c4e){_0x7eb3ad=_0x7eb3ad-0x0;var _0x19816b=_0x4e0f[_0x7eb3ad];return _0x19816b;};'use strict';var FaxInteractionEvents=require(_0xf4e0('0x0'));var events=[_0xf4e0('0x1'),_0xf4e0('0x2'),_0xf4e0('0x3')];function createListener(_0x47bf8f,_0x1ea696){return function(_0x5b57b2){_0x1ea696[_0xf4e0('0x4')](_0x47bf8f,_0x5b57b2);};}function removeListener(_0x48d9b4,_0x30dc21){return function(){FaxInteractionEvents[_0xf4e0('0x5')](_0x48d9b4,_0x30dc21);};}exports[_0xf4e0('0x6')]=function(_0x25e51a){for(var _0x1932a7=0x0,_0x1e4ac6=events[_0xf4e0('0x7')];_0x1932a7<_0x1e4ac6;_0x1932a7++){var _0x14077b=events[_0x1932a7];var _0x365472=createListener(_0xf4e0('0x8')+_0x14077b,_0x25e51a);FaxInteractionEvents['on'](_0x14077b,_0x365472);}}; \ No newline at end of file diff --git a/server/api/faxInteraction/index.js b/server/api/faxInteraction/index.js index 3030182..2da09d2 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 _0x074a=['index','/describe','describe','/:id','show','/:id/messages','getMessages','/:id/download','download','post','create','addMessage','/:id/tags','tracked','fax','addTags','put','faxinteraction:update','delete','faxinteraction:destroy','destroy','removeTags','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','./faxInteraction.controller','get','isAuthenticated'];(function(_0x18e870,_0x2f11fd){var _0x57a3de=function(_0x2a7b10){while(--_0x2a7b10){_0x18e870['push'](_0x18e870['shift']());}};_0x57a3de(++_0x2f11fd);}(_0x074a,0x97));var _0xa074=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x074a[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0xa074('0x0'));var util=require(_0xa074('0x1'));var path=require(_0xa074('0x2'));var timeout=require(_0xa074('0x3'));var express=require('express');var router=express[_0xa074('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xa074('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xa074('0x6'));router[_0xa074('0x7')]('/',auth[_0xa074('0x8')](),controller[_0xa074('0x9')]);router[_0xa074('0x7')](_0xa074('0xa'),auth[_0xa074('0x8')](),controller[_0xa074('0xb')]);router[_0xa074('0x7')](_0xa074('0xc'),auth[_0xa074('0x8')](),controller[_0xa074('0xd')]);router[_0xa074('0x7')](_0xa074('0xe'),auth[_0xa074('0x8')](),controller[_0xa074('0xf')]);router[_0xa074('0x7')](_0xa074('0x10'),auth[_0xa074('0x8')](),controller[_0xa074('0x11')]);router[_0xa074('0x12')]('/',auth[_0xa074('0x8')](),controller[_0xa074('0x13')]);router[_0xa074('0x12')](_0xa074('0xe'),auth[_0xa074('0x8')](),controller[_0xa074('0x14')]);router[_0xa074('0x12')](_0xa074('0x15'),auth[_0xa074('0x8')](),interaction[_0xa074('0x16')](_0xa074('0x17'),'faxinteraction:addtags'),controller[_0xa074('0x18')]);router[_0xa074('0x19')](_0xa074('0xc'),auth[_0xa074('0x8')](),interaction[_0xa074('0x16')](_0xa074('0x17'),_0xa074('0x1a')),controller['update']);router[_0xa074('0x1b')]('/:id',auth[_0xa074('0x8')](),interaction['tracked'](_0xa074('0x17'),_0xa074('0x1c')),controller[_0xa074('0x1d')]);router[_0xa074('0x1b')](_0xa074('0x15'),auth[_0xa074('0x8')](),controller[_0xa074('0x1e')]);module[_0xa074('0x1f')]=router; \ No newline at end of file +var _0x5814=['faxinteraction:destroy','destroy','removeTags','multer','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','describe','get','/:id/messages','getMessages','/:id/download','create','addMessage','post','/:id/tags','tracked','fax','faxinteraction:addtags','put','delete','/:id'];(function(_0x868b7c,_0xfa438b){var _0x21683c=function(_0x21bc66){while(--_0x21bc66){_0x868b7c['push'](_0x868b7c['shift']());}};_0x21683c(++_0xfa438b);}(_0x5814,0x6f));var _0x4581=function(_0x429b34,_0xd8f339){_0x429b34=_0x429b34-0x0;var _0xe27599=_0x5814[_0x429b34];return _0xe27599;};'use strict';var multer=require(_0x4581('0x0'));var util=require('util');var path=require(_0x4581('0x1'));var timeout=require('connect-timeout');var express=require(_0x4581('0x2'));var router=express[_0x4581('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x4581('0x4'));var interaction=require(_0x4581('0x5'));var config=require(_0x4581('0x6'));var controller=require('./faxInteraction.controller');router['get']('/',auth[_0x4581('0x7')](),controller[_0x4581('0x8')]);router['get']('/describe',auth['isAuthenticated'](),controller[_0x4581('0x9')]);router['get']('/:id',auth[_0x4581('0x7')](),controller['show']);router[_0x4581('0xa')](_0x4581('0xb'),auth['isAuthenticated'](),controller[_0x4581('0xc')]);router[_0x4581('0xa')](_0x4581('0xd'),auth[_0x4581('0x7')](),controller['download']);router['post']('/',auth[_0x4581('0x7')](),controller[_0x4581('0xe')]);router['post'](_0x4581('0xb'),auth[_0x4581('0x7')](),controller[_0x4581('0xf')]);router[_0x4581('0x10')](_0x4581('0x11'),auth[_0x4581('0x7')](),interaction[_0x4581('0x12')](_0x4581('0x13'),_0x4581('0x14')),controller['addTags']);router[_0x4581('0x15')]('/:id',auth[_0x4581('0x7')](),interaction[_0x4581('0x12')](_0x4581('0x13'),'faxinteraction:update'),controller['update']);router[_0x4581('0x16')](_0x4581('0x17'),auth[_0x4581('0x7')](),interaction[_0x4581('0x12')](_0x4581('0x13'),_0x4581('0x18')),controller[_0x4581('0x19')]);router[_0x4581('0x16')](_0x4581('0x11'),auth[_0x4581('0x7')](),controller[_0x4581('0x1a')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.attributes.js b/server/api/faxMessage/faxMessage.attributes.js index 6ca142d..52aa8a8 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 _0x0487=['exports','TEXT','medium','BOOLEAN','ENUM','out','DATE','sequelize'];(function(_0x712738,_0x7e0d04){var _0x2b898d=function(_0x1a2dcb){while(--_0x1a2dcb){_0x712738['push'](_0x712738['shift']());}};_0x2b898d(++_0x7e0d04);}(_0x0487,0x14f));var _0x7048=function(_0x4d82ea,_0x4d459f){_0x4d82ea=_0x4d82ea-0x0;var _0x257f4a=_0x0487[_0x4d82ea];return _0x257f4a;};'use strict';var Sequelize=require(_0x7048('0x0'));module[_0x7048('0x1')]={'body':{'type':Sequelize[_0x7048('0x2')](_0x7048('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x7048('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0x7048('0x5')]('in','out'),'defaultValue':_0x7048('0x6'),'allowNull':![]},'failMessage':{'type':Sequelize['TEXT'],'defaultValue':null},'readAt':{'type':Sequelize[_0x7048('0x7')]}}; \ No newline at end of file +var _0xf452=['out','TEXT','DATE','sequelize','exports','medium','BOOLEAN','ENUM'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0xf452,0x13b));var _0x2f45=function(_0x6716a6,_0x4784a1){_0x6716a6=_0x6716a6-0x0;var _0x431323=_0xf452[_0x6716a6];return _0x431323;};'use strict';var Sequelize=require(_0x2f45('0x0'));module[_0x2f45('0x1')]={'body':{'type':Sequelize['TEXT'](_0x2f45('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x2f45('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x2f45('0x4')]('in',_0x2f45('0x5')),'defaultValue':_0x2f45('0x5'),'allowNull':![]},'failMessage':{'type':Sequelize[_0x2f45('0x6')],'defaultValue':null},'readAt':{'type':Sequelize[_0x2f45('0x7')]}}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.controller.js b/server/api/faxMessage/faxMessage.controller.js index b102789..6866575 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 _0x3e2d=['fax-interactions','accept','fax','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','get','FaxInteraction','FaxInteractionId','isNil','read1stAt','[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','interaction','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','Sequelize','SELECT','contact','agent','fullname','email','internal','manual','interface','channel','motionChannel','event','EventManager','acceptmessage','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','RejectMessage','rejectMessage','ContactId','User','create','CmContact','Attachment','findOne','AttachmentId','SendFax','FaxAccountId','/var/opt/motion2/server/files/attachments/%s','basename','download','join','server','files','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','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','redis','localhost','socket.io-emitter','register','jayson/promise','http','client','request','then','info','FaxMessage,\x20%s,\x20%s','debug','request\x20sent','error','code','message','result','catch','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','name','index','rawAttributes','fieldName','key','model','map','query','keys','attributes','intersection','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','type','VIRTUAL','FaxMessage','includeAll','findAll','rows','show','params','fields','include','merge','options','body','find','describe'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3e2d,0x160));var _0xd3e2=function(_0x8c43de,_0x90ff31){_0x8c43de=_0x8c43de-0x0;var _0xa6591b=_0x3e2d[_0x8c43de];return _0xa6591b;};'use strict';var emlformat=require(_0xd3e2('0x0'));var rimraf=require(_0xd3e2('0x1'));var zipdir=require(_0xd3e2('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xd3e2('0x3'));var moment=require(_0xd3e2('0x4'));var BPromise=require(_0xd3e2('0x5'));var Mustache=require(_0xd3e2('0x6'));var util=require(_0xd3e2('0x7'));var path=require(_0xd3e2('0x8'));var sox=require(_0xd3e2('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd3e2('0xa'));var _=require(_0xd3e2('0xb'));var squel=require(_0xd3e2('0xc'));var crypto=require('crypto');var jsforce=require(_0xd3e2('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xd3e2('0xe'));var querystring=require(_0xd3e2('0xf'));var Papa=require(_0xd3e2('0x10'));var Redis=require(_0xd3e2('0x11'));var authService=require(_0xd3e2('0x12'));var qs=require(_0xd3e2('0x13'));var as=require(_0xd3e2('0x14'));var hardwareService=require(_0xd3e2('0x15'));var logger=require(_0xd3e2('0x16'))(_0xd3e2('0x17'));var utils=require(_0xd3e2('0x18'));var config=require(_0xd3e2('0x19'));var licenseUtil=require(_0xd3e2('0x1a'));var db=require(_0xd3e2('0x1b'))['db'];config['redis']=_['defaults'](config[_0xd3e2('0x1c')],{'host':_0xd3e2('0x1d'),'port':0x18eb});var socket=require(_0xd3e2('0x1e'))(new Redis(config[_0xd3e2('0x1c')]));require('./faxMessage.socket')[_0xd3e2('0x1f')](socket);var jayson=require(_0xd3e2('0x20'));var client=jayson['client'][_0xd3e2('0x21')]({'port':0x232c});var client9002=jayson[_0xd3e2('0x22')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1524c0,_0x35115e,_0x5b963f,_0xbb305f){return new BPromise(function(_0x337016,_0x410fae){var _0x4f3ba8=_0xbb305f||client;return _0x4f3ba8[_0xd3e2('0x23')](_0x1524c0,_0x5b963f)[_0xd3e2('0x24')](function(_0x3fb3a8){logger[_0xd3e2('0x25')](_0xd3e2('0x26'),_0x35115e,'request\x20sent');logger[_0xd3e2('0x27')]('FaxMessage,\x20%s,\x20%s,\x20%s',_0x35115e,_0xd3e2('0x28'),JSON['stringify'](_0x3fb3a8));if(_0x3fb3a8[_0xd3e2('0x29')]){if(_0x3fb3a8[_0xd3e2('0x29')][_0xd3e2('0x2a')]===0x1f4){logger[_0xd3e2('0x29')](_0xd3e2('0x26'),_0x35115e,_0x3fb3a8['error'][_0xd3e2('0x2b')]);return _0x410fae(_0x3fb3a8[_0xd3e2('0x29')][_0xd3e2('0x2b')]);}logger['error'](_0xd3e2('0x26'),_0x35115e,_0x3fb3a8[_0xd3e2('0x29')]['message']);return _0x337016(_0x3fb3a8['error'][_0xd3e2('0x2b')]);}else{logger[_0xd3e2('0x25')]('FaxMessage,\x20%s,\x20%s',_0x35115e,_0xd3e2('0x28'));_0x337016(_0x3fb3a8[_0xd3e2('0x2c')][_0xd3e2('0x2b')]);}})[_0xd3e2('0x2d')](function(_0x470d92){logger['error'](_0xd3e2('0x26'),_0x35115e,_0x470d92);_0x410fae(_0x470d92);});});}function respondWithStatusCode(_0x2ae0d4,_0x4a22fd){_0x4a22fd=_0x4a22fd||0xcc;return function(_0x57db42){if(_0x57db42){return _0x2ae0d4[_0xd3e2('0x2e')](_0x4a22fd);}return _0x2ae0d4['status'](_0x4a22fd)[_0xd3e2('0x2f')]();};}function respondWithResult(_0x34870a,_0x39f79e){_0x39f79e=_0x39f79e||0xc8;return function(_0x2279be){if(_0x2279be){return _0x34870a[_0xd3e2('0x30')](_0x39f79e)[_0xd3e2('0x31')](_0x2279be);}};}function respondWithFilteredResult(_0x9d60ff,_0x3f92f2){return function(_0x2e0175){if(_0x2e0175){var _0x31675f=typeof _0x3f92f2[_0xd3e2('0x32')]===_0xd3e2('0x33')&&typeof _0x3f92f2[_0xd3e2('0x34')]===_0xd3e2('0x33');var _0x1e8614=_0x2e0175[_0xd3e2('0x35')];var _0x286452=_0x31675f?0x0:_0x3f92f2[_0xd3e2('0x32')];var _0x28ec2e=_0x31675f?_0x2e0175[_0xd3e2('0x35')]:_0x3f92f2[_0xd3e2('0x32')]+_0x3f92f2[_0xd3e2('0x34')];var _0x1d43a6;if(_0x28ec2e>=_0x1e8614){_0x28ec2e=_0x1e8614;_0x1d43a6=0xc8;}else{_0x1d43a6=0xce;}_0x9d60ff['status'](_0x1d43a6);return _0x9d60ff[_0xd3e2('0x36')](_0xd3e2('0x37'),_0x286452+'-'+_0x28ec2e+'/'+_0x1e8614)[_0xd3e2('0x31')](_0x2e0175);}return null;};}function patchUpdates(_0x347449){return function(_0x109cc6){try{jsonpatch[_0xd3e2('0x38')](_0x109cc6,_0x347449,!![]);}catch(_0x7f66f0){return BPromise[_0xd3e2('0x39')](_0x7f66f0);}return _0x109cc6[_0xd3e2('0x3a')]();};}function saveUpdates(_0x515740,_0x112099){return function(_0x12143a){if(_0x12143a){return _0x12143a[_0xd3e2('0x3b')](_0x515740)[_0xd3e2('0x24')](function(_0x3c2f9a){return _0x3c2f9a;});}return null;};}function removeEntity(_0x1b7076,_0x1fc6ea){return function(_0xd8ee8d){if(_0xd8ee8d){return _0xd8ee8d['destroy']()[_0xd3e2('0x24')](function(){_0x1b7076[_0xd3e2('0x30')](0xcc)['end']();});}};}function handleEntityNotFound(_0x296136,_0x5416f4){return function(_0x42aa73){if(!_0x42aa73){_0x296136[_0xd3e2('0x2e')](0x194);}return _0x42aa73;};}function handleError(_0x313445,_0x4f6164){_0x4f6164=_0x4f6164||0x1f4;return function(_0x39a60d){logger['error'](_0x39a60d['stack']);if(_0x39a60d[_0xd3e2('0x3c')]){delete _0x39a60d[_0xd3e2('0x3c')];}_0x313445[_0xd3e2('0x30')](_0x4f6164)['send'](_0x39a60d);};}exports[_0xd3e2('0x3d')]=function(_0x141d4f,_0x250c0a){var _0x164628={},_0x53c818={},_0x35e5d8={'count':0x0,'rows':[]};var _0x4c79e8=_['map'](db['FaxMessage'][_0xd3e2('0x3e')],function(_0x65b88d){return{'name':_0x65b88d[_0xd3e2('0x3f')],'type':_0x65b88d['type'][_0xd3e2('0x40')]};});_0x53c818[_0xd3e2('0x41')]=_[_0xd3e2('0x42')](_0x4c79e8,_0xd3e2('0x3c'));_0x53c818[_0xd3e2('0x43')]=_[_0xd3e2('0x44')](_0x141d4f[_0xd3e2('0x43')]);_0x53c818['filters']=_['intersection'](_0x53c818[_0xd3e2('0x41')],_0x53c818[_0xd3e2('0x43')]);_0x164628[_0xd3e2('0x45')]=_[_0xd3e2('0x46')](_0x53c818[_0xd3e2('0x41')],qs['fields'](_0x141d4f[_0xd3e2('0x43')]['fields']));_0x164628['attributes']=_0x164628['attributes'][_0xd3e2('0x47')]?_0x164628[_0xd3e2('0x45')]:_0x53c818[_0xd3e2('0x41')];if(!_0x141d4f[_0xd3e2('0x43')][_0xd3e2('0x48')](_0xd3e2('0x49'))){_0x164628[_0xd3e2('0x34')]=qs[_0xd3e2('0x34')](_0x141d4f[_0xd3e2('0x43')]['limit']);_0x164628['offset']=qs[_0xd3e2('0x32')](_0x141d4f[_0xd3e2('0x43')][_0xd3e2('0x32')]);}_0x164628[_0xd3e2('0x4a')]=qs[_0xd3e2('0x4b')](_0x141d4f[_0xd3e2('0x43')][_0xd3e2('0x4b')]);_0x164628[_0xd3e2('0x4c')]=qs[_0xd3e2('0x4d')](_[_0xd3e2('0x4e')](_0x141d4f[_0xd3e2('0x43')],_0x53c818[_0xd3e2('0x4d')]),_0x4c79e8);if(_0x141d4f[_0xd3e2('0x43')][_0xd3e2('0x4f')]){_0x164628[_0xd3e2('0x4c')]=_['merge'](_0x164628[_0xd3e2('0x4c')],{'$or':_['map'](_0x4c79e8,function(_0x1c8496){if(_0x1c8496[_0xd3e2('0x50')]!==_0xd3e2('0x51')){var _0x3c11ad={};_0x3c11ad[_0x1c8496['name']]={'$like':'%'+_0x141d4f[_0xd3e2('0x43')][_0xd3e2('0x4f')]+'%'};return _0x3c11ad;}})});}_0x164628=_['merge']({},_0x164628,_0x141d4f['options']);var _0x6b4ed0={'where':_0x164628[_0xd3e2('0x4c')]};return db[_0xd3e2('0x52')][_0xd3e2('0x35')](_0x6b4ed0)[_0xd3e2('0x24')](function(_0x666db8){_0x35e5d8['count']=_0x666db8;if(_0x141d4f['query'][_0xd3e2('0x53')]){_0x164628['include']=[{'all':!![]}];}return db[_0xd3e2('0x52')][_0xd3e2('0x54')](_0x164628);})[_0xd3e2('0x24')](function(_0x1345e1){_0x35e5d8[_0xd3e2('0x55')]=_0x1345e1;return _0x35e5d8;})[_0xd3e2('0x24')](respondWithFilteredResult(_0x250c0a,_0x164628))[_0xd3e2('0x2d')](handleError(_0x250c0a,null));};exports[_0xd3e2('0x56')]=function(_0x4b365d,_0x5eab98){var _0x40c109={'raw':!![],'where':{'id':_0x4b365d[_0xd3e2('0x57')]['id']}},_0x2893b2={};_0x2893b2[_0xd3e2('0x41')]=_['keys'](db['FaxMessage'][_0xd3e2('0x3e')]);_0x2893b2[_0xd3e2('0x43')]=_['keys'](_0x4b365d[_0xd3e2('0x43')]);_0x2893b2['filters']=_[_0xd3e2('0x46')](_0x2893b2[_0xd3e2('0x41')],_0x2893b2['query']);_0x40c109[_0xd3e2('0x45')]=_[_0xd3e2('0x46')](_0x2893b2[_0xd3e2('0x41')],qs[_0xd3e2('0x58')](_0x4b365d[_0xd3e2('0x43')]['fields']));_0x40c109[_0xd3e2('0x45')]=_0x40c109[_0xd3e2('0x45')][_0xd3e2('0x47')]?_0x40c109[_0xd3e2('0x45')]:_0x2893b2['model'];if(_0x4b365d[_0xd3e2('0x43')][_0xd3e2('0x53')]){_0x40c109[_0xd3e2('0x59')]=[{'all':!![]}];}_0x40c109=_[_0xd3e2('0x5a')]({},_0x40c109,_0x4b365d[_0xd3e2('0x5b')]);return db[_0xd3e2('0x52')]['find'](_0x40c109)[_0xd3e2('0x24')](handleEntityNotFound(_0x5eab98,null))[_0xd3e2('0x24')](respondWithResult(_0x5eab98,null))[_0xd3e2('0x2d')](handleError(_0x5eab98,null));};exports[_0xd3e2('0x3b')]=function(_0x45cfbe,_0x5e73ba){if(_0x45cfbe[_0xd3e2('0x5c')]['id']){delete _0x45cfbe[_0xd3e2('0x5c')]['id'];}return db['FaxMessage'][_0xd3e2('0x5d')]({'where':{'id':_0x45cfbe[_0xd3e2('0x57')]['id']}})[_0xd3e2('0x24')](handleEntityNotFound(_0x5e73ba,null))[_0xd3e2('0x24')](saveUpdates(_0x45cfbe[_0xd3e2('0x5c')],null))[_0xd3e2('0x24')](respondWithResult(_0x5e73ba,null))[_0xd3e2('0x2d')](handleError(_0x5e73ba,null));};exports['destroy']=function(_0x17039a,_0xbe2485){return db['FaxMessage'][_0xd3e2('0x5d')]({'where':{'id':_0x17039a['params']['id']}})[_0xd3e2('0x24')](handleEntityNotFound(_0xbe2485,null))[_0xd3e2('0x24')](removeEntity(_0xbe2485,null))[_0xd3e2('0x2d')](handleError(_0xbe2485,null));};exports['describe']=function(_0xddeba3,_0xab16e2){return db['FaxMessage'][_0xd3e2('0x5e')]()['then'](respondWithResult(_0xab16e2,null))[_0xd3e2('0x2d')](handleError(_0xab16e2,null));};var interaction_log=require(_0xd3e2('0x16'))(_0xd3e2('0x5f'));exports[_0xd3e2('0x60')]=function(_0x4b574e,_0x29f1d2,_0x3bbc2b){var _0x233f94={'agent':{},'channel':_0xd3e2('0x61')};if(_0x4b574e['body']['id']){delete _0x4b574e[_0xd3e2('0x5c')]['id'];}_0x4b574e['body'][_0xd3e2('0x62')]=!![];_0x4b574e[_0xd3e2('0x5c')][_0xd3e2('0x63')]=moment()[_0xd3e2('0x64')](_0xd3e2('0x65'));_0x4b574e[_0xd3e2('0x5c')][_0xd3e2('0x66')]=_0x4b574e['body'][_0xd3e2('0x66')]||_0x4b574e[_0xd3e2('0x67')]['id'];_0x233f94['agent']['id']=_0x4b574e[_0xd3e2('0x5c')][_0xd3e2('0x66')];return db['FaxMessage']['find']({'where':{'id':_0x4b574e['params']['id'],'UserId':null}})[_0xd3e2('0x24')](handleEntityNotFound(_0x29f1d2,null))[_0xd3e2('0x24')](saveUpdates(_0x4b574e[_0xd3e2('0x5c')],null))[_0xd3e2('0x24')](function(_0x49f76f){if(_0x49f76f){_0x233f94[_0xd3e2('0x2b')]=_0x49f76f[_0xd3e2('0x68')]({'plain':!![]});return db[_0xd3e2('0x69')][_0xd3e2('0x5d')]({'where':{'id':_0x49f76f[_0xd3e2('0x6a')]}});}return null;})['then'](handleEntityNotFound(_0x29f1d2,null))['then'](function(_0x492201){if(_0x492201){return _0x492201[_0xd3e2('0x3b')]({'UserId':_0x4b574e[_0xd3e2('0x5c')]['UserId'],'read1stAt':_[_0xd3e2('0x6b')](_0x492201[_0xd3e2('0x6c')])?moment()[_0xd3e2('0x64')](_0xd3e2('0x65')):undefined});}return null;})[_0xd3e2('0x24')](function(_0x1d977b){if(_0x1d977b){_0x233f94['interaction']=_0x1d977b['get']({'plain':!![]});interaction_log[_0xd3e2('0x25')](_0xd3e2('0x6d'),_0x4b574e[_0xd3e2('0x67')]['id'],_0x4b574e[_0xd3e2('0x67')][_0xd3e2('0x3c')],_0x4b574e[_0xd3e2('0x67')][_0xd3e2('0x6e')],_0x233f94[_0xd3e2('0x6f')]['id'],_0x4b574e[_0xd3e2('0x5c')]?JSON['stringify'](_0x4b574e[_0xd3e2('0x5c')]):'null');return respondWithRpcPromise(_0xd3e2('0x70'),_0xd3e2('0x71'),_0x233f94);}return null;})[_0xd3e2('0x24')](function(_0x338f2e){var _0x449173=_0xd3e2('0x72')+_0x338f2e['message']['ContactId'];return db[_0xd3e2('0x73')][_0xd3e2('0x43')](_0x449173,{'type':db[_0xd3e2('0x74')]['QueryTypes'][_0xd3e2('0x75')],'raw':!![]})['then'](function(_0x25e678){return _0x25e678;});})[_0xd3e2('0x24')](function(_0x248e41){if(_0x248e41){_0x233f94[_0xd3e2('0x2b')][_0xd3e2('0x76')]=_0x248e41[0x0];if(!_0x4b574e['body']['UserId'])return;return db['User'][_0xd3e2('0x5d')]({'where':{'id':_0x4b574e[_0xd3e2('0x5c')][_0xd3e2('0x66')],'role':_0xd3e2('0x77')},'attributes':['id',_0xd3e2('0x3c'),_0xd3e2('0x78'),_0xd3e2('0x79'),_0xd3e2('0x7a')],'raw':!![]});}return null;})[_0xd3e2('0x24')](function(_0x2a5609){if(!_0x2a5609)return null;_0x233f94[_0xd3e2('0x2b')][_0xd3e2('0x77')]=_0x2a5609;return _0x233f94;})[_0xd3e2('0x24')](function(_0x12d225){if(_0x12d225){if(_0x4b574e[_0xd3e2('0x5c')][_0xd3e2('0x7b')]){_0x233f94[_0xd3e2('0x2b')][_0xd3e2('0x7c')]=util[_0xd3e2('0x64')]('SIP/%s',_0x4b574e[_0xd3e2('0x67')][_0xd3e2('0x3c')]);_0x233f94['message'][_0xd3e2('0x7d')]=_0x233f94['channel'];_0x233f94[_0xd3e2('0x2b')][_0xd3e2('0x7e')]=_0x233f94['channel'];_0x233f94[_0xd3e2('0x2b')][_0xd3e2('0x7f')]=_0xd3e2('0x60');return respondWithRpcPromise(_0xd3e2('0x80'),_0xd3e2('0x80'),{'event':_0xd3e2('0x81'),'message':_0x233f94[_0xd3e2('0x2b')]},client9002)['then'](function(){return _0x233f94;});}return _0x233f94;}return null;})[_0xd3e2('0x24')](respondWithResult(_0x29f1d2,null))[_0xd3e2('0x2d')](handleError(_0x29f1d2,null));};var interaction_log=require(_0xd3e2('0x16'))(_0xd3e2('0x5f'));exports[_0xd3e2('0x39')]=function(_0xcd0db3,_0xcbcdd7,_0x5d481e){var _0x1b731e={'agent':{},'channel':_0xd3e2('0x61')};if(_0xcd0db3[_0xd3e2('0x5c')]['id']){delete _0xcd0db3[_0xd3e2('0x5c')]['id'];}_0xcd0db3[_0xd3e2('0x5c')][_0xd3e2('0x66')]=_0xcd0db3[_0xd3e2('0x5c')][_0xd3e2('0x66')]||_0xcd0db3[_0xd3e2('0x67')]['id'];_0x1b731e[_0xd3e2('0x77')]['id']=_0xcd0db3[_0xd3e2('0x5c')]['UserId'];return db[_0xd3e2('0x52')][_0xd3e2('0x5d')]({'where':{'id':_0xcd0db3[_0xd3e2('0x57')]['id'],'UserId':null}})[_0xd3e2('0x24')](handleEntityNotFound(_0xcbcdd7,null))[_0xd3e2('0x24')](function(_0x121a63){if(_0x121a63){_0x1b731e[_0xd3e2('0x2b')]=_0x121a63[_0xd3e2('0x68')]({'plain':!![]});return db[_0xd3e2('0x69')][_0xd3e2('0x5d')]({'where':{'id':_0x121a63[_0xd3e2('0x6a')]}});}return null;})[_0xd3e2('0x24')](handleEntityNotFound(_0xcbcdd7,null))[_0xd3e2('0x24')](function(_0x5b947c){if(_0x5b947c){_0x1b731e[_0xd3e2('0x6f')]=_0x5b947c[_0xd3e2('0x68')]({'plain':!![]});interaction_log['info'](_0xd3e2('0x82'),_0xcd0db3['user']['id'],_0xcd0db3['user']['name'],_0xcd0db3[_0xd3e2('0x67')][_0xd3e2('0x6e')],_0x1b731e[_0xd3e2('0x6f')]['id'],_0xcd0db3['body']?JSON['stringify'](_0xcd0db3[_0xd3e2('0x5c')]):_0xd3e2('0x83'));return respondWithRpcPromise(_0xd3e2('0x84'),_0xd3e2('0x85'),_0x1b731e);}return null;})['then'](function(_0x495baf){var _0x32f7cb=_0xd3e2('0x72')+_0x495baf[_0xd3e2('0x2b')][_0xd3e2('0x86')];return db[_0xd3e2('0x73')][_0xd3e2('0x43')](_0x32f7cb,{'type':db[_0xd3e2('0x74')]['QueryTypes'][_0xd3e2('0x75')],'raw':!![]})[_0xd3e2('0x24')](function(_0x3cd2fb){return _0x3cd2fb;});})['then'](function(_0x356d4a){if(_0x356d4a){_0x1b731e[_0xd3e2('0x2b')][_0xd3e2('0x76')]=_0x356d4a[0x0];if(!_0xcd0db3[_0xd3e2('0x5c')][_0xd3e2('0x66')])return;return db[_0xd3e2('0x87')][_0xd3e2('0x5d')]({'where':{'id':_0xcd0db3[_0xd3e2('0x5c')][_0xd3e2('0x66')],'role':_0xd3e2('0x77')},'attributes':['id',_0xd3e2('0x3c'),'fullname',_0xd3e2('0x79'),_0xd3e2('0x7a')],'raw':!![]});}return null;})[_0xd3e2('0x24')](function(_0x11d40f){if(!_0x11d40f)return null;_0x1b731e[_0xd3e2('0x2b')]['agent']=_0x11d40f;return _0x1b731e;})[_0xd3e2('0x24')](function(_0x3154ad){if(_0x3154ad){_0x3154ad[_0xd3e2('0x2b')][_0xd3e2('0x7c')]=util[_0xd3e2('0x64')]('SIP/%s',_0xcd0db3[_0xd3e2('0x67')][_0xd3e2('0x3c')]);_0x3154ad[_0xd3e2('0x2b')][_0xd3e2('0x7d')]=_0x1b731e[_0xd3e2('0x7d')];_0x3154ad['message'][_0xd3e2('0x7e')]=_0x1b731e[_0xd3e2('0x7d')];_0x3154ad[_0xd3e2('0x2b')]['event']='reject';respondWithRpcPromise('EventManager',_0xd3e2('0x80'),{'event':'rejectmessage','message':_0x3154ad['message']},client9002);return _0x1b731e;}return null;})['then'](respondWithResult(_0xcbcdd7,null))[_0xd3e2('0x2d')](handleError(_0xcbcdd7,null));};exports[_0xd3e2('0x88')]=function(_0x16a5c8,_0x2a6046){var _0x3b2ac1;return db[_0xd3e2('0x52')][_0xd3e2('0x88')](_0x16a5c8[_0xd3e2('0x5c')],{})[_0xd3e2('0x24')](function(_0x1bff4c){_0x3b2ac1=_0x1bff4c;return db[_0xd3e2('0x89')]['findOne']({'where':{'id':_0x3b2ac1[_0xd3e2('0x86')]}});})[_0xd3e2('0x24')](function(_0x1179a8){if(_[_0xd3e2('0x6b')](_0x1179a8)){return;}else{_0x3b2ac1[_0xd3e2('0x61')]=_0x1179a8[_0xd3e2('0x61')];return db[_0xd3e2('0x8a')][_0xd3e2('0x8b')]({'where':{'id':_0x3b2ac1[_0xd3e2('0x8c')]}});}})[_0xd3e2('0x24')](function(_0x9131b6){return respondWithRpcPromise('SendFax',_0xd3e2('0x8d'),{'FaxAccountId':_[_0xd3e2('0x6b')](_0x16a5c8[_0xd3e2('0x5c')])?undefined:_0x16a5c8[_0xd3e2('0x5c')][_0xd3e2('0x8e')],'path':_[_0xd3e2('0x6b')](_0x9131b6)?undefined:util[_0xd3e2('0x64')](_0xd3e2('0x8f'),_0x9131b6[_0xd3e2('0x90')]),'fax':_[_0xd3e2('0x6b')](_0x3b2ac1[_0xd3e2('0x61')])?undefined:_0x3b2ac1[_0xd3e2('0x61')],'AttachmentId':_0x3b2ac1[_0xd3e2('0x8c')]},client9002);})[_0xd3e2('0x24')](respondWithResult(_0x2a6046,0xc9))['catch'](handleError(_0x2a6046,null));};exports[_0xd3e2('0x91')]=function(_0x548a6e,_0x5e4902){var _0x30acae=path[_0xd3e2('0x92')](config['root'],_0xd3e2('0x93'),_0xd3e2('0x94'),'attachments');return db['FaxMessage'][_0xd3e2('0x5d')]({'where':{'id':_0x548a6e[_0xd3e2('0x57')]['id']},'include':[{'model':db[_0xd3e2('0x8a')],'as':_0xd3e2('0x8a')}]})[_0xd3e2('0x24')](handleEntityNotFound(_0x5e4902,null))[_0xd3e2('0x24')](function(_0x1162b2){if(_0x1162b2){return _0x5e4902['download'](path[_0xd3e2('0x92')](_0x30acae,_0x1162b2['Attachment'][_0xd3e2('0x90')]));}})[_0xd3e2('0x2d')](handleError(_0x5e4902,null));}; \ No newline at end of file +var _0xb8be=['intersection','options','body','find','destroy','describe','fax-interactions','accept','read','format','YYYY-MM-DD\x20HH:mm:ss','UserId','agent','get','FaxInteraction','isNil','read1stAt','[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','email','internal','manual','interface','channel','motionChannel','EventManager','acceptmessage','fax','FaxInteractionId','interaction','role','rejectMessage','User','SIP/%s','event','create','CmContact','findOne','Attachment','AttachmentId','SendFax','FaxAccountId','/var/opt/motion2/server/files/attachments/%s','basename','download','join','server','files','attachments','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','../../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','register','client','http','request','then','info','FaxMessage,\x20%s,\x20%s','request\x20sent','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','offset','undefined','count','set','Content-Range','json','reject','save','update','stack','name','send','map','FaxMessage','rawAttributes','type','key','model','keys','query','filters','attributes','fields','length','nolimit','limit','order','sort','where','pick','filter','VIRTUAL','merge','includeAll','include','rows','show','params'];(function(_0x2d7972,_0x57f968){var _0x296318=function(_0x126bc9){while(--_0x126bc9){_0x2d7972['push'](_0x2d7972['shift']());}};_0x296318(++_0x57f968);}(_0xb8be,0x1ee));var _0xeb8b=function(_0x5a187b,_0x1f64fe){_0x5a187b=_0x5a187b-0x0;var _0x14d601=_0xb8be[_0x5a187b];return _0x14d601;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xeb8b('0x0'));var zipdir=require(_0xeb8b('0x1'));var jsonpatch=require(_0xeb8b('0x2'));var rp=require(_0xeb8b('0x3'));var moment=require(_0xeb8b('0x4'));var BPromise=require(_0xeb8b('0x5'));var Mustache=require(_0xeb8b('0x6'));var util=require(_0xeb8b('0x7'));var path=require(_0xeb8b('0x8'));var sox=require(_0xeb8b('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xeb8b('0xa'));var _=require(_0xeb8b('0xb'));var squel=require(_0xeb8b('0xc'));var crypto=require(_0xeb8b('0xd'));var jsforce=require(_0xeb8b('0xe'));var deskjs=require(_0xeb8b('0xf'));var toCsv=require(_0xeb8b('0x10'));var querystring=require('querystring');var Papa=require(_0xeb8b('0x11'));var Redis=require('ioredis');var authService=require(_0xeb8b('0x12'));var qs=require(_0xeb8b('0x13'));var as=require(_0xeb8b('0x14'));var hardwareService=require(_0xeb8b('0x15'));var logger=require(_0xeb8b('0x16'))(_0xeb8b('0x17'));var utils=require(_0xeb8b('0x18'));var config=require(_0xeb8b('0x19'));var licenseUtil=require(_0xeb8b('0x1a'));var db=require('../../mysqldb')['db'];config[_0xeb8b('0x1b')]=_[_0xeb8b('0x1c')](config[_0xeb8b('0x1b')],{'host':_0xeb8b('0x1d'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./faxMessage.socket')[_0xeb8b('0x1e')](socket);var jayson=require('jayson/promise');var client=jayson[_0xeb8b('0x1f')][_0xeb8b('0x20')]({'port':0x232c});var client9002=jayson['client'][_0xeb8b('0x20')]({'port':0x232a});function respondWithRpcPromise(_0x429f43,_0x5e697f,_0x31dc85,_0x53bd3b){return new BPromise(function(_0x206bcb,_0xe51eef){var _0x46e05b=_0x53bd3b||client;return _0x46e05b[_0xeb8b('0x21')](_0x429f43,_0x31dc85)[_0xeb8b('0x22')](function(_0x8a41d1){logger[_0xeb8b('0x23')](_0xeb8b('0x24'),_0x5e697f,_0xeb8b('0x25'));logger['debug'](_0xeb8b('0x26'),_0x5e697f,'request\x20sent',JSON[_0xeb8b('0x27')](_0x8a41d1));if(_0x8a41d1[_0xeb8b('0x28')]){if(_0x8a41d1['error'][_0xeb8b('0x29')]===0x1f4){logger[_0xeb8b('0x28')](_0xeb8b('0x24'),_0x5e697f,_0x8a41d1[_0xeb8b('0x28')][_0xeb8b('0x2a')]);return _0xe51eef(_0x8a41d1[_0xeb8b('0x28')][_0xeb8b('0x2a')]);}logger[_0xeb8b('0x28')](_0xeb8b('0x24'),_0x5e697f,_0x8a41d1[_0xeb8b('0x28')][_0xeb8b('0x2a')]);return _0x206bcb(_0x8a41d1[_0xeb8b('0x28')][_0xeb8b('0x2a')]);}else{logger['info']('FaxMessage,\x20%s,\x20%s',_0x5e697f,_0xeb8b('0x25'));_0x206bcb(_0x8a41d1[_0xeb8b('0x2b')][_0xeb8b('0x2a')]);}})[_0xeb8b('0x2c')](function(_0xf134c6){logger[_0xeb8b('0x28')](_0xeb8b('0x24'),_0x5e697f,_0xf134c6);_0xe51eef(_0xf134c6);});});}function respondWithStatusCode(_0x7ab93,_0x44f278){_0x44f278=_0x44f278||0xcc;return function(_0x87fd28){if(_0x87fd28){return _0x7ab93[_0xeb8b('0x2d')](_0x44f278);}return _0x7ab93[_0xeb8b('0x2e')](_0x44f278)[_0xeb8b('0x2f')]();};}function respondWithResult(_0x4f2aa5,_0x74cd84){_0x74cd84=_0x74cd84||0xc8;return function(_0x199cc3){if(_0x199cc3){return _0x4f2aa5[_0xeb8b('0x2e')](_0x74cd84)['json'](_0x199cc3);}};}function respondWithFilteredResult(_0x27f94d,_0x5ac4ee){return function(_0x16d064){if(_0x16d064){var _0x1c926c=typeof _0x5ac4ee[_0xeb8b('0x30')]==='undefined'&&typeof _0x5ac4ee['limit']===_0xeb8b('0x31');var _0x392c4a=_0x16d064['count'];var _0xe82c25=_0x1c926c?0x0:_0x5ac4ee[_0xeb8b('0x30')];var _0x43617b=_0x1c926c?_0x16d064[_0xeb8b('0x32')]:_0x5ac4ee[_0xeb8b('0x30')]+_0x5ac4ee['limit'];var _0x4db38b;if(_0x43617b>=_0x392c4a){_0x43617b=_0x392c4a;_0x4db38b=0xc8;}else{_0x4db38b=0xce;}_0x27f94d[_0xeb8b('0x2e')](_0x4db38b);return _0x27f94d[_0xeb8b('0x33')](_0xeb8b('0x34'),_0xe82c25+'-'+_0x43617b+'/'+_0x392c4a)[_0xeb8b('0x35')](_0x16d064);}return null;};}function patchUpdates(_0x2108dd){return function(_0x500b9b){try{jsonpatch['apply'](_0x500b9b,_0x2108dd,!![]);}catch(_0xddc6af){return BPromise[_0xeb8b('0x36')](_0xddc6af);}return _0x500b9b[_0xeb8b('0x37')]();};}function saveUpdates(_0x45db48,_0x2ef781){return function(_0x395ac6){if(_0x395ac6){return _0x395ac6[_0xeb8b('0x38')](_0x45db48)[_0xeb8b('0x22')](function(_0x5aaddb){return _0x5aaddb;});}return null;};}function removeEntity(_0x3e6efe,_0x2da6c3){return function(_0xddae9c){if(_0xddae9c){return _0xddae9c['destroy']()['then'](function(){_0x3e6efe['status'](0xcc)[_0xeb8b('0x2f')]();});}};}function handleEntityNotFound(_0x1122eb,_0x3fef87){return function(_0x594a8b){if(!_0x594a8b){_0x1122eb[_0xeb8b('0x2d')](0x194);}return _0x594a8b;};}function handleError(_0x465223,_0xde4d53){_0xde4d53=_0xde4d53||0x1f4;return function(_0xd189a8){logger[_0xeb8b('0x28')](_0xd189a8[_0xeb8b('0x39')]);if(_0xd189a8[_0xeb8b('0x3a')]){delete _0xd189a8['name'];}_0x465223[_0xeb8b('0x2e')](_0xde4d53)[_0xeb8b('0x3b')](_0xd189a8);};}exports['index']=function(_0x84c45,_0x22dd89){var _0xd09332={},_0x3b5d4e={},_0x5e7f21={'count':0x0,'rows':[]};var _0x2d4111=_[_0xeb8b('0x3c')](db[_0xeb8b('0x3d')][_0xeb8b('0x3e')],function(_0x7ee4c0){return{'name':_0x7ee4c0['fieldName'],'type':_0x7ee4c0[_0xeb8b('0x3f')][_0xeb8b('0x40')]};});_0x3b5d4e[_0xeb8b('0x41')]=_[_0xeb8b('0x3c')](_0x2d4111,_0xeb8b('0x3a'));_0x3b5d4e['query']=_[_0xeb8b('0x42')](_0x84c45[_0xeb8b('0x43')]);_0x3b5d4e[_0xeb8b('0x44')]=_['intersection'](_0x3b5d4e[_0xeb8b('0x41')],_0x3b5d4e[_0xeb8b('0x43')]);_0xd09332[_0xeb8b('0x45')]=_['intersection'](_0x3b5d4e[_0xeb8b('0x41')],qs[_0xeb8b('0x46')](_0x84c45['query'][_0xeb8b('0x46')]));_0xd09332[_0xeb8b('0x45')]=_0xd09332['attributes'][_0xeb8b('0x47')]?_0xd09332[_0xeb8b('0x45')]:_0x3b5d4e[_0xeb8b('0x41')];if(!_0x84c45[_0xeb8b('0x43')]['hasOwnProperty'](_0xeb8b('0x48'))){_0xd09332[_0xeb8b('0x49')]=qs['limit'](_0x84c45[_0xeb8b('0x43')]['limit']);_0xd09332['offset']=qs[_0xeb8b('0x30')](_0x84c45[_0xeb8b('0x43')][_0xeb8b('0x30')]);}_0xd09332[_0xeb8b('0x4a')]=qs[_0xeb8b('0x4b')](_0x84c45[_0xeb8b('0x43')][_0xeb8b('0x4b')]);_0xd09332[_0xeb8b('0x4c')]=qs[_0xeb8b('0x44')](_[_0xeb8b('0x4d')](_0x84c45[_0xeb8b('0x43')],_0x3b5d4e[_0xeb8b('0x44')]),_0x2d4111);if(_0x84c45[_0xeb8b('0x43')][_0xeb8b('0x4e')]){_0xd09332[_0xeb8b('0x4c')]=_['merge'](_0xd09332[_0xeb8b('0x4c')],{'$or':_[_0xeb8b('0x3c')](_0x2d4111,function(_0x15d8b0){if(_0x15d8b0['type']!==_0xeb8b('0x4f')){var _0xa3b87c={};_0xa3b87c[_0x15d8b0[_0xeb8b('0x3a')]]={'$like':'%'+_0x84c45['query'][_0xeb8b('0x4e')]+'%'};return _0xa3b87c;}})});}_0xd09332=_[_0xeb8b('0x50')]({},_0xd09332,_0x84c45['options']);var _0xf03362={'where':_0xd09332['where']};return db[_0xeb8b('0x3d')][_0xeb8b('0x32')](_0xf03362)[_0xeb8b('0x22')](function(_0x7b1412){_0x5e7f21[_0xeb8b('0x32')]=_0x7b1412;if(_0x84c45['query'][_0xeb8b('0x51')]){_0xd09332[_0xeb8b('0x52')]=[{'all':!![]}];}return db[_0xeb8b('0x3d')]['findAll'](_0xd09332);})[_0xeb8b('0x22')](function(_0x4624f8){_0x5e7f21[_0xeb8b('0x53')]=_0x4624f8;return _0x5e7f21;})[_0xeb8b('0x22')](respondWithFilteredResult(_0x22dd89,_0xd09332))[_0xeb8b('0x2c')](handleError(_0x22dd89,null));};exports[_0xeb8b('0x54')]=function(_0x2fd157,_0x4e9561){var _0x8a9df={'raw':!![],'where':{'id':_0x2fd157[_0xeb8b('0x55')]['id']}},_0x5d5e49={};_0x5d5e49[_0xeb8b('0x41')]=_[_0xeb8b('0x42')](db[_0xeb8b('0x3d')][_0xeb8b('0x3e')]);_0x5d5e49[_0xeb8b('0x43')]=_[_0xeb8b('0x42')](_0x2fd157['query']);_0x5d5e49['filters']=_[_0xeb8b('0x56')](_0x5d5e49[_0xeb8b('0x41')],_0x5d5e49[_0xeb8b('0x43')]);_0x8a9df[_0xeb8b('0x45')]=_['intersection'](_0x5d5e49[_0xeb8b('0x41')],qs[_0xeb8b('0x46')](_0x2fd157['query'][_0xeb8b('0x46')]));_0x8a9df[_0xeb8b('0x45')]=_0x8a9df[_0xeb8b('0x45')][_0xeb8b('0x47')]?_0x8a9df[_0xeb8b('0x45')]:_0x5d5e49[_0xeb8b('0x41')];if(_0x2fd157['query'][_0xeb8b('0x51')]){_0x8a9df[_0xeb8b('0x52')]=[{'all':!![]}];}_0x8a9df=_['merge']({},_0x8a9df,_0x2fd157[_0xeb8b('0x57')]);return db['FaxMessage']['find'](_0x8a9df)['then'](handleEntityNotFound(_0x4e9561,null))[_0xeb8b('0x22')](respondWithResult(_0x4e9561,null))[_0xeb8b('0x2c')](handleError(_0x4e9561,null));};exports[_0xeb8b('0x38')]=function(_0x21aaba,_0x30bebf){if(_0x21aaba['body']['id']){delete _0x21aaba[_0xeb8b('0x58')]['id'];}return db['FaxMessage'][_0xeb8b('0x59')]({'where':{'id':_0x21aaba[_0xeb8b('0x55')]['id']}})[_0xeb8b('0x22')](handleEntityNotFound(_0x30bebf,null))[_0xeb8b('0x22')](saveUpdates(_0x21aaba[_0xeb8b('0x58')],null))[_0xeb8b('0x22')](respondWithResult(_0x30bebf,null))['catch'](handleError(_0x30bebf,null));};exports[_0xeb8b('0x5a')]=function(_0xfff7d2,_0x4786bc){return db[_0xeb8b('0x3d')]['find']({'where':{'id':_0xfff7d2[_0xeb8b('0x55')]['id']}})['then'](handleEntityNotFound(_0x4786bc,null))[_0xeb8b('0x22')](removeEntity(_0x4786bc,null))[_0xeb8b('0x2c')](handleError(_0x4786bc,null));};exports[_0xeb8b('0x5b')]=function(_0xeeef1a,_0x1038a4){return db[_0xeb8b('0x3d')][_0xeb8b('0x5b')]()[_0xeb8b('0x22')](respondWithResult(_0x1038a4,null))['catch'](handleError(_0x1038a4,null));};var interaction_log=require('../../config/logger')(_0xeb8b('0x5c'));exports[_0xeb8b('0x5d')]=function(_0x421c6f,_0x2775b2,_0x15c951){var _0x46153a={'agent':{},'channel':'fax'};if(_0x421c6f[_0xeb8b('0x58')]['id']){delete _0x421c6f[_0xeb8b('0x58')]['id'];}_0x421c6f[_0xeb8b('0x58')][_0xeb8b('0x5e')]=!![];_0x421c6f[_0xeb8b('0x58')]['readAt']=moment()[_0xeb8b('0x5f')](_0xeb8b('0x60'));_0x421c6f[_0xeb8b('0x58')][_0xeb8b('0x61')]=_0x421c6f['body'][_0xeb8b('0x61')]||_0x421c6f['user']['id'];_0x46153a[_0xeb8b('0x62')]['id']=_0x421c6f[_0xeb8b('0x58')][_0xeb8b('0x61')];return db[_0xeb8b('0x3d')][_0xeb8b('0x59')]({'where':{'id':_0x421c6f['params']['id'],'UserId':null}})['then'](handleEntityNotFound(_0x2775b2,null))[_0xeb8b('0x22')](saveUpdates(_0x421c6f['body'],null))['then'](function(_0x4c726e){if(_0x4c726e){_0x46153a[_0xeb8b('0x2a')]=_0x4c726e[_0xeb8b('0x63')]({'plain':!![]});return db[_0xeb8b('0x64')][_0xeb8b('0x59')]({'where':{'id':_0x4c726e['FaxInteractionId']}});}return null;})['then'](handleEntityNotFound(_0x2775b2,null))['then'](function(_0x141d7a){if(_0x141d7a){return _0x141d7a[_0xeb8b('0x38')]({'UserId':_0x421c6f['body']['UserId'],'read1stAt':_[_0xeb8b('0x65')](_0x141d7a[_0xeb8b('0x66')])?moment()[_0xeb8b('0x5f')](_0xeb8b('0x60')):undefined});}return null;})[_0xeb8b('0x22')](function(_0x45a0){if(_0x45a0){_0x46153a['interaction']=_0x45a0[_0xeb8b('0x63')]({'plain':!![]});interaction_log[_0xeb8b('0x23')](_0xeb8b('0x67'),_0x421c6f[_0xeb8b('0x68')]['id'],_0x421c6f[_0xeb8b('0x68')][_0xeb8b('0x3a')],_0x421c6f[_0xeb8b('0x68')]['role'],_0x46153a['interaction']['id'],_0x421c6f['body']?JSON[_0xeb8b('0x27')](_0x421c6f[_0xeb8b('0x58')]):_0xeb8b('0x69'));return respondWithRpcPromise(_0xeb8b('0x6a'),_0xeb8b('0x6b'),_0x46153a);}return null;})[_0xeb8b('0x22')](function(_0x42dc2b){var _0x32e3e9=_0xeb8b('0x6c')+_0x42dc2b[_0xeb8b('0x2a')][_0xeb8b('0x6d')];return db[_0xeb8b('0x6e')][_0xeb8b('0x43')](_0x32e3e9,{'type':db[_0xeb8b('0x6f')][_0xeb8b('0x70')][_0xeb8b('0x71')],'raw':!![]})[_0xeb8b('0x22')](function(_0x1502a7){return _0x1502a7;});})[_0xeb8b('0x22')](function(_0x497084){if(_0x497084){_0x46153a['message'][_0xeb8b('0x72')]=_0x497084[0x0];if(!_0x421c6f[_0xeb8b('0x58')]['UserId'])return;return db['User'][_0xeb8b('0x59')]({'where':{'id':_0x421c6f[_0xeb8b('0x58')][_0xeb8b('0x61')],'role':_0xeb8b('0x62')},'attributes':['id',_0xeb8b('0x3a'),'fullname',_0xeb8b('0x73'),_0xeb8b('0x74')],'raw':!![]});}return null;})['then'](function(_0x36eeb9){if(!_0x36eeb9)return null;_0x46153a['message'][_0xeb8b('0x62')]=_0x36eeb9;return _0x46153a;})[_0xeb8b('0x22')](function(_0xe616e2){if(_0xe616e2){if(_0x421c6f['body'][_0xeb8b('0x75')]){_0x46153a[_0xeb8b('0x2a')][_0xeb8b('0x76')]=util[_0xeb8b('0x5f')]('SIP/%s',_0x421c6f[_0xeb8b('0x68')][_0xeb8b('0x3a')]);_0x46153a[_0xeb8b('0x2a')]['channel']=_0x46153a[_0xeb8b('0x77')];_0x46153a['message'][_0xeb8b('0x78')]=_0x46153a['channel'];_0x46153a[_0xeb8b('0x2a')]['event']=_0xeb8b('0x5d');return respondWithRpcPromise('EventManager',_0xeb8b('0x79'),{'event':_0xeb8b('0x7a'),'message':_0x46153a[_0xeb8b('0x2a')]},client9002)['then'](function(){return _0x46153a;});}return _0x46153a;}return null;})[_0xeb8b('0x22')](respondWithResult(_0x2775b2,null))[_0xeb8b('0x2c')](handleError(_0x2775b2,null));};var interaction_log=require('../../config/logger')(_0xeb8b('0x5c'));exports['reject']=function(_0x11284b,_0x5188ad,_0x52d75c){var _0x58f612={'agent':{},'channel':_0xeb8b('0x7b')};if(_0x11284b[_0xeb8b('0x58')]['id']){delete _0x11284b[_0xeb8b('0x58')]['id'];}_0x11284b[_0xeb8b('0x58')][_0xeb8b('0x61')]=_0x11284b['body'][_0xeb8b('0x61')]||_0x11284b['user']['id'];_0x58f612[_0xeb8b('0x62')]['id']=_0x11284b[_0xeb8b('0x58')][_0xeb8b('0x61')];return db['FaxMessage'][_0xeb8b('0x59')]({'where':{'id':_0x11284b[_0xeb8b('0x55')]['id'],'UserId':null}})[_0xeb8b('0x22')](handleEntityNotFound(_0x5188ad,null))[_0xeb8b('0x22')](function(_0x1fd905){if(_0x1fd905){_0x58f612[_0xeb8b('0x2a')]=_0x1fd905[_0xeb8b('0x63')]({'plain':!![]});return db['FaxInteraction'][_0xeb8b('0x59')]({'where':{'id':_0x1fd905[_0xeb8b('0x7c')]}});}return null;})[_0xeb8b('0x22')](handleEntityNotFound(_0x5188ad,null))['then'](function(_0x31bbc4){if(_0x31bbc4){_0x58f612[_0xeb8b('0x7d')]=_0x31bbc4[_0xeb8b('0x63')]({'plain':!![]});interaction_log[_0xeb8b('0x23')]('[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x11284b[_0xeb8b('0x68')]['id'],_0x11284b[_0xeb8b('0x68')][_0xeb8b('0x3a')],_0x11284b[_0xeb8b('0x68')][_0xeb8b('0x7e')],_0x58f612[_0xeb8b('0x7d')]['id'],_0x11284b['body']?JSON['stringify'](_0x11284b[_0xeb8b('0x58')]):'null');return respondWithRpcPromise('RejectMessage',_0xeb8b('0x7f'),_0x58f612);}return null;})[_0xeb8b('0x22')](function(_0x3baafe){var _0x31a7ea=_0xeb8b('0x6c')+_0x3baafe[_0xeb8b('0x2a')][_0xeb8b('0x6d')];return db[_0xeb8b('0x6e')][_0xeb8b('0x43')](_0x31a7ea,{'type':db[_0xeb8b('0x6f')][_0xeb8b('0x70')][_0xeb8b('0x71')],'raw':!![]})[_0xeb8b('0x22')](function(_0x59b5c0){return _0x59b5c0;});})[_0xeb8b('0x22')](function(_0x2562d3){if(_0x2562d3){_0x58f612[_0xeb8b('0x2a')]['contact']=_0x2562d3[0x0];if(!_0x11284b[_0xeb8b('0x58')]['UserId'])return;return db[_0xeb8b('0x80')]['find']({'where':{'id':_0x11284b[_0xeb8b('0x58')][_0xeb8b('0x61')],'role':'agent'},'attributes':['id',_0xeb8b('0x3a'),'fullname',_0xeb8b('0x73'),_0xeb8b('0x74')],'raw':!![]});}return null;})[_0xeb8b('0x22')](function(_0x5879bd){if(!_0x5879bd)return null;_0x58f612['message'][_0xeb8b('0x62')]=_0x5879bd;return _0x58f612;})['then'](function(_0x19fc59){if(_0x19fc59){_0x19fc59[_0xeb8b('0x2a')][_0xeb8b('0x76')]=util[_0xeb8b('0x5f')](_0xeb8b('0x81'),_0x11284b['user'][_0xeb8b('0x3a')]);_0x19fc59[_0xeb8b('0x2a')][_0xeb8b('0x77')]=_0x58f612[_0xeb8b('0x77')];_0x19fc59[_0xeb8b('0x2a')][_0xeb8b('0x78')]=_0x58f612[_0xeb8b('0x77')];_0x19fc59[_0xeb8b('0x2a')][_0xeb8b('0x82')]='reject';respondWithRpcPromise(_0xeb8b('0x79'),'EventManager',{'event':'rejectmessage','message':_0x19fc59[_0xeb8b('0x2a')]},client9002);return _0x58f612;}return null;})[_0xeb8b('0x22')](respondWithResult(_0x5188ad,null))['catch'](handleError(_0x5188ad,null));};exports[_0xeb8b('0x83')]=function(_0x3bdc06,_0x609dd1){var _0x47b323;return db[_0xeb8b('0x3d')]['create'](_0x3bdc06[_0xeb8b('0x58')],{})[_0xeb8b('0x22')](function(_0x4271dc){_0x47b323=_0x4271dc;return db[_0xeb8b('0x84')][_0xeb8b('0x85')]({'where':{'id':_0x47b323[_0xeb8b('0x6d')]}});})['then'](function(_0x7884d4){if(_[_0xeb8b('0x65')](_0x7884d4)){return;}else{_0x47b323['fax']=_0x7884d4[_0xeb8b('0x7b')];return db[_0xeb8b('0x86')][_0xeb8b('0x85')]({'where':{'id':_0x47b323[_0xeb8b('0x87')]}});}})['then'](function(_0x19c5f3){return respondWithRpcPromise(_0xeb8b('0x88'),_0xeb8b('0x88'),{'FaxAccountId':_[_0xeb8b('0x65')](_0x3bdc06['body'])?undefined:_0x3bdc06[_0xeb8b('0x58')][_0xeb8b('0x89')],'path':_[_0xeb8b('0x65')](_0x19c5f3)?undefined:util[_0xeb8b('0x5f')](_0xeb8b('0x8a'),_0x19c5f3[_0xeb8b('0x8b')]),'fax':_[_0xeb8b('0x65')](_0x47b323['fax'])?undefined:_0x47b323[_0xeb8b('0x7b')],'AttachmentId':_0x47b323[_0xeb8b('0x87')]},client9002);})[_0xeb8b('0x22')](respondWithResult(_0x609dd1,0xc9))[_0xeb8b('0x2c')](handleError(_0x609dd1,null));};exports[_0xeb8b('0x8c')]=function(_0x338e4e,_0x51fed5){var _0x2d2798=path[_0xeb8b('0x8d')](config['root'],_0xeb8b('0x8e'),_0xeb8b('0x8f'),_0xeb8b('0x90'));return db['FaxMessage']['find']({'where':{'id':_0x338e4e['params']['id']},'include':[{'model':db[_0xeb8b('0x86')],'as':_0xeb8b('0x86')}]})['then'](handleEntityNotFound(_0x51fed5,null))[_0xeb8b('0x22')](function(_0x2ffaee){if(_0x2ffaee){return _0x51fed5[_0xeb8b('0x8c')](path['join'](_0x2d2798,_0x2ffaee[_0xeb8b('0x86')][_0xeb8b('0x8b')]));}})[_0xeb8b('0x2c')](handleError(_0x51fed5,null));}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.events.js b/server/api/faxMessage/faxMessage.events.js index ed343d0..65ffc15 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 _0x0ef4=['hasOwnProperty','hook','exports','../../mysqldb','FaxMessage','setMaxListeners','remove'];(function(_0x5c619e,_0x1bccdf){var _0x445cf8=function(_0x2eaa64){while(--_0x2eaa64){_0x5c619e['push'](_0x5c619e['shift']());}};_0x445cf8(++_0x1bccdf);}(_0x0ef4,0xc7));var _0x40ef=function(_0xab9f3d,_0xb336fa){_0xab9f3d=_0xab9f3d-0x0;var _0x5283bf=_0x0ef4[_0xab9f3d];return _0x5283bf;};'use strict';var EventEmitter=require('events');var FaxMessage=require(_0x40ef('0x0'))['db'][_0x40ef('0x1')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0x40ef('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x40ef('0x3')};function emitEvent(_0xf78dc1){return function(_0x85ee1d,_0x4a5798,_0x16fef9){FaxMessageEvents['emit'](_0xf78dc1+':'+_0x85ee1d['id'],_0x85ee1d);FaxMessageEvents['emit'](_0xf78dc1,_0x85ee1d);_0x16fef9(null);};}for(var e in events){if(events[_0x40ef('0x4')](e)){var event=events[e];FaxMessage[_0x40ef('0x5')](e,emitEvent(event));}}module[_0x40ef('0x6')]=FaxMessageEvents; \ No newline at end of file +var _0x187d=['save','update','remove','emit','hasOwnProperty','hook','exports','events','FaxMessage','setMaxListeners'];(function(_0x136eba,_0x206120){var _0x435b45=function(_0x3a38bb){while(--_0x3a38bb){_0x136eba['push'](_0x136eba['shift']());}};_0x435b45(++_0x206120);}(_0x187d,0x93));var _0xd187=function(_0x24237f,_0x4cf32c){_0x24237f=_0x24237f-0x0;var _0x48298e=_0x187d[_0x24237f];return _0x48298e;};'use strict';var EventEmitter=require(_0xd187('0x0'));var FaxMessage=require('../../mysqldb')['db'][_0xd187('0x1')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0xd187('0x2')](0x0);var events={'afterCreate':_0xd187('0x3'),'afterUpdate':_0xd187('0x4'),'afterDestroy':_0xd187('0x5')};function emitEvent(_0x201b79){return function(_0x58622a,_0x28fa0b,_0x163807){FaxMessageEvents['emit'](_0x201b79+':'+_0x58622a['id'],_0x58622a);FaxMessageEvents[_0xd187('0x6')](_0x201b79,_0x58622a);_0x163807(null);};}for(var e in events){if(events[_0xd187('0x7')](e)){var event=events[e];FaxMessage[_0xd187('0x8')](e,emitEvent(event));}}module[_0xd187('0x9')]=FaxMessageEvents; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.model.js b/server/api/faxMessage/faxMessage.model.js index ddd13b7..9aad2c5 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 _0xfab5=['then','update','createdAt','error','utf8mb4','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxMessage.attributes','exports','FaxMessage','fax_messages','fti_fax_messages','body','FULLTEXT','get','direction','toLowerCase','secret','isNil','UserId','FaxInteraction','findOne','FaxInteractionId'];(function(_0x476bf4,_0x2a3755){var _0x788ffe=function(_0x13fa11){while(--_0x13fa11){_0x476bf4['push'](_0x476bf4['shift']());}};_0x788ffe(++_0x2a3755);}(_0xfab5,0xfd));var _0x5fab=function(_0x4e7600,_0x48966d){_0x4e7600=_0x4e7600-0x0;var _0x40d38f=_0xfab5[_0x4e7600];return _0x40d38f;};'use strict';var _=require(_0x5fab('0x0'));var util=require(_0x5fab('0x1'));var logger=require(_0x5fab('0x2'))(_0x5fab('0x3'));var moment=require(_0x5fab('0x4'));var BPromise=require(_0x5fab('0x5'));var rp=require(_0x5fab('0x6'));var fs=require('fs');var path=require(_0x5fab('0x7'));var rimraf=require(_0x5fab('0x8'));var config=require(_0x5fab('0x9'));var attributes=require(_0x5fab('0xa'));module[_0x5fab('0xb')]=function(_0x4eb02d,_0x46c7b8){return _0x4eb02d['define'](_0x5fab('0xc'),attributes,{'tableName':_0x5fab('0xd'),'paranoid':![],'indexes':[{'name':_0x5fab('0xe'),'fields':[_0x5fab('0xf')],'type':_0x5fab('0x10')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x34088b,_0xb78a9a,_0x198736){var _0x3800ef=_0x4eb02d['models'];var _0x28f189=_0x34088b[_0x5fab('0x11')]({'plain':!![]});if(_0x28f189[_0x5fab('0x12')][_0x5fab('0x13')]()==='in'||_0x28f189[_0x5fab('0x12')][_0x5fab('0x13')]()==='out'&&!_0x28f189[_0x5fab('0x14')]&&!_[_0x5fab('0x15')](_0x28f189[_0x5fab('0x16')])){_0x3800ef[_0x5fab('0x17')][_0x5fab('0x18')]({'where':{'id':_0x28f189[_0x5fab('0x19')]}})[_0x5fab('0x1a')](function(_0x226617){if(_0x226617){_0x226617[_0x5fab('0x1b')]({'lastMsgAt':_0x28f189[_0x5fab('0x1c')],'lastMsgDirection':_0x28f189[_0x5fab('0x12')]['toLowerCase']()});}})['catch'](function(_0x1868cf){console[_0x5fab('0x1d')](_0x1868cf);});}_0x198736();}},'charset':_0x5fab('0x1e'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0xe0fc=['utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./faxMessage.attributes','exports','define','FaxMessage','fax_messages','fti_fax_messages','body','FULLTEXT','models','get','direction','toLowerCase','out','secret','isNil','UserId','FaxInteraction','findOne','FaxInteractionId','then','update','catch','error','utf8mb4'];(function(_0x57f2d4,_0x32fef1){var _0x243649=function(_0x289159){while(--_0x289159){_0x57f2d4['push'](_0x57f2d4['shift']());}};_0x243649(++_0x32fef1);}(_0xe0fc,0x1dd));var _0xce0f=function(_0x5ac81b,_0x5b2f34){_0x5ac81b=_0x5ac81b-0x0;var _0x286915=_0xe0fc[_0x5ac81b];return _0x286915;};'use strict';var _=require(_0xce0f('0x0'));var util=require(_0xce0f('0x1'));var logger=require(_0xce0f('0x2'))(_0xce0f('0x3'));var moment=require(_0xce0f('0x4'));var BPromise=require(_0xce0f('0x5'));var rp=require(_0xce0f('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xce0f('0x7'));var config=require(_0xce0f('0x8'));var attributes=require(_0xce0f('0x9'));module[_0xce0f('0xa')]=function(_0x12665a,_0x42f3d3){return _0x12665a[_0xce0f('0xb')](_0xce0f('0xc'),attributes,{'tableName':_0xce0f('0xd'),'paranoid':![],'indexes':[{'name':_0xce0f('0xe'),'fields':[_0xce0f('0xf')],'type':_0xce0f('0x10')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x502aea,_0x17b2a8,_0x2310d8){var _0x2ae196=_0x12665a[_0xce0f('0x11')];var _0x23a85e=_0x502aea[_0xce0f('0x12')]({'plain':!![]});if(_0x23a85e[_0xce0f('0x13')]['toLowerCase']()==='in'||_0x23a85e[_0xce0f('0x13')][_0xce0f('0x14')]()===_0xce0f('0x15')&&!_0x23a85e[_0xce0f('0x16')]&&!_[_0xce0f('0x17')](_0x23a85e[_0xce0f('0x18')])){_0x2ae196[_0xce0f('0x19')][_0xce0f('0x1a')]({'where':{'id':_0x23a85e[_0xce0f('0x1b')]}})[_0xce0f('0x1c')](function(_0x4b7e63){if(_0x4b7e63){_0x4b7e63[_0xce0f('0x1d')]({'lastMsgAt':_0x23a85e['createdAt'],'lastMsgDirection':_0x23a85e[_0xce0f('0x13')][_0xce0f('0x14')]()});}})[_0xce0f('0x1e')](function(_0xa32a7c){console[_0xce0f('0x1f')](_0xa32a7c);});}_0x2310d8();}},'charset':_0xce0f('0x20'),'collate':_0xce0f('0x21')});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.rpc.js b/server/api/faxMessage/faxMessage.rpc.js index c8ae321..6dd569d 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 _0x668b=['./faxMessage.socket','register','then','info','FaxMessage,\x20%s,\x20%s','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','CreateFaxMessage','FaxMessage','create','body','raw','UpdateFaxMessage','update','options','where','attributes','limit','lodash','util','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost'];(function(_0x402edc,_0x430857){var _0x4b990c=function(_0xdb4c3a){while(--_0xdb4c3a){_0x402edc['push'](_0x402edc['shift']());}};_0x4b990c(++_0x430857);}(_0x668b,0x140));var _0xb668=function(_0x55c1f0,_0x4f574f){_0x55c1f0=_0x55c1f0-0x0;var _0x1530fa=_0x668b[_0x55c1f0];return _0x1530fa;};'use strict';var _=require(_0xb668('0x0'));var util=require(_0xb668('0x1'));var moment=require('moment');var BPromise=require(_0xb668('0x2'));var rs=require(_0xb668('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb668('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xb668('0x5'))(_0xb668('0x6'));var config=require(_0xb668('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xb668('0x8')][_0xb668('0x9')]({'port':0x232a});config[_0xb668('0xa')]=_[_0xb668('0xb')](config[_0xb668('0xa')],{'host':_0xb668('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xb668('0xa')]));require(_0xb668('0xd'))[_0xb668('0xe')](socket);function respondWithRpcPromise(_0x16d50d,_0x39b79c,_0x3606a7){return new BPromise(function(_0x45bc39,_0x3616e9){return client['request'](_0x16d50d,_0x3606a7)[_0xb668('0xf')](function(_0x27dbf7){logger[_0xb668('0x10')](_0xb668('0x11'),_0x39b79c,_0xb668('0x12'));logger[_0xb668('0x13')](_0xb668('0x14'),_0x39b79c,_0xb668('0x12'),JSON[_0xb668('0x15')](_0x27dbf7));if(_0x27dbf7[_0xb668('0x16')]){if(_0x27dbf7[_0xb668('0x16')][_0xb668('0x17')]===0x1f4){logger[_0xb668('0x16')](_0xb668('0x11'),_0x39b79c,_0x27dbf7[_0xb668('0x16')][_0xb668('0x18')]);return _0x3616e9(_0x27dbf7[_0xb668('0x16')][_0xb668('0x18')]);}logger[_0xb668('0x16')](_0xb668('0x11'),_0x39b79c,_0x27dbf7[_0xb668('0x16')][_0xb668('0x18')]);return _0x45bc39(_0x27dbf7['error'][_0xb668('0x18')]);}else{logger['info'](_0xb668('0x11'),_0x39b79c,_0xb668('0x12'));_0x45bc39(_0x27dbf7['result'][_0xb668('0x18')]);}})[_0xb668('0x19')](function(_0x53ff78){logger[_0xb668('0x16')]('FaxMessage,\x20%s,\x20%s',_0x39b79c,_0x53ff78);_0x3616e9(_0x53ff78);});});}exports[_0xb668('0x1a')]=function(_0x178a5d){var _0x253ba5=this;return new Promise(function(_0x12805a,_0x5d33ae){return db[_0xb668('0x1b')][_0xb668('0x1c')](_0x178a5d[_0xb668('0x1d')],{'raw':_0x178a5d['options']?_0x178a5d['options'][_0xb668('0x1e')]===undefined?!![]:![]:!![]})[_0xb668('0xf')](function(_0x517eee){logger[_0xb668('0x10')]('CreateFaxMessage',_0x178a5d);logger[_0xb668('0x13')]('CreateFaxMessage',_0x178a5d,JSON[_0xb668('0x15')](_0x517eee));_0x12805a(_0x517eee);})[_0xb668('0x19')](function(_0x3f84c7){logger[_0xb668('0x16')](_0xb668('0x1a'),_0x3f84c7[_0xb668('0x18')],_0x178a5d);_0x5d33ae(_0x253ba5['error'](0x1f4,_0x3f84c7[_0xb668('0x18')]));});});};exports[_0xb668('0x1f')]=function(_0x2ab8c2){var _0x49abfd=this;return new Promise(function(_0x5e0cee,_0xe62fce){return db[_0xb668('0x1b')][_0xb668('0x20')](_0x2ab8c2['body'],{'raw':_0x2ab8c2[_0xb668('0x21')]?_0x2ab8c2[_0xb668('0x21')][_0xb668('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2ab8c2['options']?_0x2ab8c2['options'][_0xb668('0x22')]||null:null,'attributes':_0x2ab8c2[_0xb668('0x21')]?_0x2ab8c2['options'][_0xb668('0x23')]||null:null,'limit':_0x2ab8c2[_0xb668('0x21')]?_0x2ab8c2[_0xb668('0x21')][_0xb668('0x24')]||null:null})[_0xb668('0xf')](function(_0x5f36b5){logger[_0xb668('0x10')](_0xb668('0x1f'),_0x2ab8c2);logger['debug'](_0xb668('0x1f'),_0x2ab8c2,JSON['stringify'](_0x5f36b5));_0x5e0cee(_0x5f36b5);})[_0xb668('0x19')](function(_0x406cc5){logger[_0xb668('0x16')](_0xb668('0x1f'),_0x406cc5[_0xb668('0x18')],_0x2ab8c2);_0xe62fce(_0x49abfd[_0xb668('0x16')](0x1f4,_0x406cc5[_0xb668('0x18')]));});});}; \ No newline at end of file +var _0xed1f=['jayson/promise','client','http','redis','defaults','localhost','./faxMessage.socket','request','then','FaxMessage,\x20%s,\x20%s','request\x20sent','FaxMessage,\x20%s,\x20%s,\x20%s','error','message','CreateFaxMessage','FaxMessage','create','body','options','raw','info','catch','UpdateFaxMessage','update','attributes','limit','debug','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0xed1f,0x6a));var _0xfed1=function(_0x599f41,_0x4db732){_0x599f41=_0x599f41-0x0;var _0x2e4d58=_0xed1f[_0x599f41];return _0x2e4d58;};'use strict';var _=require(_0xfed1('0x0'));var util=require(_0xfed1('0x1'));var moment=require(_0xfed1('0x2'));var BPromise=require(_0xfed1('0x3'));var rs=require(_0xfed1('0x4'));var fs=require('fs');var Redis=require(_0xfed1('0x5'));var db=require(_0xfed1('0x6'))['db'];var utils=require(_0xfed1('0x7'));var logger=require(_0xfed1('0x8'))(_0xfed1('0x9'));var config=require(_0xfed1('0xa'));var jayson=require(_0xfed1('0xb'));var client=jayson[_0xfed1('0xc')][_0xfed1('0xd')]({'port':0x232a});config[_0xfed1('0xe')]=_[_0xfed1('0xf')](config[_0xfed1('0xe')],{'host':_0xfed1('0x10'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xfed1('0xe')]));require(_0xfed1('0x11'))['register'](socket);function respondWithRpcPromise(_0x1414be,_0x7bf48c,_0x4a564e){return new BPromise(function(_0x3ce017,_0x48c338){return client[_0xfed1('0x12')](_0x1414be,_0x4a564e)[_0xfed1('0x13')](function(_0x4a8369){logger['info'](_0xfed1('0x14'),_0x7bf48c,_0xfed1('0x15'));logger['debug'](_0xfed1('0x16'),_0x7bf48c,'request\x20sent',JSON['stringify'](_0x4a8369));if(_0x4a8369[_0xfed1('0x17')]){if(_0x4a8369[_0xfed1('0x17')]['code']===0x1f4){logger[_0xfed1('0x17')]('FaxMessage,\x20%s,\x20%s',_0x7bf48c,_0x4a8369['error'][_0xfed1('0x18')]);return _0x48c338(_0x4a8369[_0xfed1('0x17')][_0xfed1('0x18')]);}logger[_0xfed1('0x17')]('FaxMessage,\x20%s,\x20%s',_0x7bf48c,_0x4a8369[_0xfed1('0x17')]['message']);return _0x3ce017(_0x4a8369[_0xfed1('0x17')][_0xfed1('0x18')]);}else{logger['info'](_0xfed1('0x14'),_0x7bf48c,_0xfed1('0x15'));_0x3ce017(_0x4a8369['result']['message']);}})['catch'](function(_0x1e5afb){logger['error'](_0xfed1('0x14'),_0x7bf48c,_0x1e5afb);_0x48c338(_0x1e5afb);});});}exports[_0xfed1('0x19')]=function(_0x51a860){var _0x94cb84=this;return new Promise(function(_0x65f14b,_0x59ee9d){return db[_0xfed1('0x1a')][_0xfed1('0x1b')](_0x51a860[_0xfed1('0x1c')],{'raw':_0x51a860[_0xfed1('0x1d')]?_0x51a860['options'][_0xfed1('0x1e')]===undefined?!![]:![]:!![]})['then'](function(_0x446558){logger[_0xfed1('0x1f')](_0xfed1('0x19'),_0x51a860);logger['debug'](_0xfed1('0x19'),_0x51a860,JSON['stringify'](_0x446558));_0x65f14b(_0x446558);})[_0xfed1('0x20')](function(_0x2793b7){logger[_0xfed1('0x17')](_0xfed1('0x19'),_0x2793b7[_0xfed1('0x18')],_0x51a860);_0x59ee9d(_0x94cb84[_0xfed1('0x17')](0x1f4,_0x2793b7['message']));});});};exports[_0xfed1('0x21')]=function(_0xcb1cdc){var _0x49072b=this;return new Promise(function(_0x1d6c72,_0x2b9dd2){return db[_0xfed1('0x1a')][_0xfed1('0x22')](_0xcb1cdc[_0xfed1('0x1c')],{'raw':_0xcb1cdc[_0xfed1('0x1d')]?_0xcb1cdc['options'][_0xfed1('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xcb1cdc['options']?_0xcb1cdc[_0xfed1('0x1d')]['where']||null:null,'attributes':_0xcb1cdc['options']?_0xcb1cdc[_0xfed1('0x1d')][_0xfed1('0x23')]||null:null,'limit':_0xcb1cdc[_0xfed1('0x1d')]?_0xcb1cdc['options'][_0xfed1('0x24')]||null:null})[_0xfed1('0x13')](function(_0x13f414){logger[_0xfed1('0x1f')](_0xfed1('0x21'),_0xcb1cdc);logger[_0xfed1('0x25')]('UpdateFaxMessage',_0xcb1cdc,JSON[_0xfed1('0x26')](_0x13f414));_0x1d6c72(_0x13f414);})[_0xfed1('0x20')](function(_0x4fc309){logger['error'](_0xfed1('0x21'),_0x4fc309[_0xfed1('0x18')],_0xcb1cdc);_0x2b9dd2(_0x49072b[_0xfed1('0x17')](0x1f4,_0x4fc309[_0xfed1('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.socket.js b/server/api/faxMessage/faxMessage.socket.js index 0deabef..c26711d 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 _0xdf0e=['./faxMessage.events','save','remove','update','emit','removeListener','register','length'];(function(_0xd511d,_0x3546b9){var _0x3f148e=function(_0x51f35f){while(--_0x51f35f){_0xd511d['push'](_0xd511d['shift']());}};_0x3f148e(++_0x3546b9);}(_0xdf0e,0x98));var _0xedf0=function(_0x157712,_0xc29e01){_0x157712=_0x157712-0x0;var _0x23e9d9=_0xdf0e[_0x157712];return _0x23e9d9;};'use strict';var FaxMessageEvents=require(_0xedf0('0x0'));var events=[_0xedf0('0x1'),_0xedf0('0x2'),_0xedf0('0x3')];function createListener(_0x3d3cf3,_0x3f3d65){return function(_0x3c5d56){_0x3f3d65[_0xedf0('0x4')](_0x3d3cf3,_0x3c5d56);};}function removeListener(_0x5be5a7,_0xaf3ea9){return function(){FaxMessageEvents[_0xedf0('0x5')](_0x5be5a7,_0xaf3ea9);};}exports[_0xedf0('0x6')]=function(_0x305939){for(var _0x420b73=0x0,_0x3e2fb6=events[_0xedf0('0x7')];_0x420b73<_0x3e2fb6;_0x420b73++){var _0x1452e=events[_0x420b73];var _0x4b1254=createListener('faxMessage:'+_0x1452e,_0x305939);FaxMessageEvents['on'](_0x1452e,_0x4b1254);}}; \ No newline at end of file +var _0xf92a=['save','removeListener','faxMessage:','./faxMessage.events'];(function(_0x531d36,_0x1d0564){var _0xecfedf=function(_0x4a23b7){while(--_0x4a23b7){_0x531d36['push'](_0x531d36['shift']());}};_0xecfedf(++_0x1d0564);}(_0xf92a,0x15f));var _0xaf92=function(_0x770f4,_0x3896bc){_0x770f4=_0x770f4-0x0;var _0x1cdaef=_0xf92a[_0x770f4];return _0x1cdaef;};'use strict';var FaxMessageEvents=require(_0xaf92('0x0'));var events=[_0xaf92('0x1'),'remove','update'];function createListener(_0x4e3ba5,_0x5dc094){return function(_0x22e64b){_0x5dc094['emit'](_0x4e3ba5,_0x22e64b);};}function removeListener(_0x53565e,_0x497ac2){return function(){FaxMessageEvents[_0xaf92('0x2')](_0x53565e,_0x497ac2);};}exports['register']=function(_0x1f0cc5){for(var _0x529cd6=0x0,_0xed7999=events['length'];_0x529cd6<_0xed7999;_0x529cd6++){var _0x206c51=events[_0x529cd6];var _0x5d5b4d=createListener(_0xaf92('0x3')+_0x206c51,_0x1f0cc5);FaxMessageEvents['on'](_0x206c51,_0x5d5b4d);}}; \ No newline at end of file diff --git a/server/api/faxMessage/index.js b/server/api/faxMessage/index.js index 27632be..a00861f 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 _0xb43b=['update','/:id/reject','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxMessage.controller','index','/describe','isAuthenticated','describe','get','/:id','show','download','post','tracked','fax','create','put'];(function(_0x1240bd,_0xc41601){var _0x1883af=function(_0x491f6a){while(--_0x491f6a){_0x1240bd['push'](_0x1240bd['shift']());}};_0x1883af(++_0xc41601);}(_0xb43b,0x1b2));var _0xbb43=function(_0x50b8d7,_0x4abf42){_0x50b8d7=_0x50b8d7-0x0;var _0x1534ba=_0xb43b[_0x50b8d7];return _0x1534ba;};'use strict';var multer=require(_0xbb43('0x0'));var util=require(_0xbb43('0x1'));var path=require('path');var timeout=require(_0xbb43('0x2'));var express=require(_0xbb43('0x3'));var router=express[_0xbb43('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xbb43('0x5'));var interaction=require(_0xbb43('0x6'));var config=require(_0xbb43('0x7'));var controller=require(_0xbb43('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0xbb43('0x9')]);router['get'](_0xbb43('0xa'),auth[_0xbb43('0xb')](),controller[_0xbb43('0xc')]);router[_0xbb43('0xd')](_0xbb43('0xe'),auth['isAuthenticated'](),controller[_0xbb43('0xf')]);router[_0xbb43('0xd')]('/:id/download',auth[_0xbb43('0xb')](),controller[_0xbb43('0x10')]);router[_0xbb43('0x11')]('/',auth[_0xbb43('0xb')](),interaction[_0xbb43('0x12')](_0xbb43('0x13'),'faxmessage:create'),controller[_0xbb43('0x14')]);router[_0xbb43('0x15')]('/:id',auth['isAuthenticated'](),controller[_0xbb43('0x16')]);router['put']('/:id/accept',auth[_0xbb43('0xb')](),controller['accept']);router[_0xbb43('0x15')](_0xbb43('0x17'),auth['isAuthenticated'](),controller['reject']);router['delete'](_0xbb43('0xe'),auth[_0xbb43('0xb')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xfe57=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxMessage.controller','get','isAuthenticated','index','/describe','show','download','faxmessage:create','create','put','/:id','update','/:id/reject','reject','destroy','exports','multer','util','express'];(function(_0x1073ad,_0x44bf0b){var _0x528474=function(_0x3450f7){while(--_0x3450f7){_0x1073ad['push'](_0x1073ad['shift']());}};_0x528474(++_0x44bf0b);}(_0xfe57,0x195));var _0x7fe5=function(_0x166742,_0x55520c){_0x166742=_0x166742-0x0;var _0xb7814a=_0xfe57[_0x166742];return _0xb7814a;};'use strict';var multer=require(_0x7fe5('0x0'));var util=require(_0x7fe5('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x7fe5('0x2'));var router=express[_0x7fe5('0x3')]();var fs_extra=require(_0x7fe5('0x4'));var auth=require(_0x7fe5('0x5'));var interaction=require(_0x7fe5('0x6'));var config=require(_0x7fe5('0x7'));var controller=require(_0x7fe5('0x8'));router[_0x7fe5('0x9')]('/',auth[_0x7fe5('0xa')](),controller[_0x7fe5('0xb')]);router[_0x7fe5('0x9')](_0x7fe5('0xc'),auth[_0x7fe5('0xa')](),controller['describe']);router[_0x7fe5('0x9')]('/:id',auth[_0x7fe5('0xa')](),controller[_0x7fe5('0xd')]);router['get']('/:id/download',auth[_0x7fe5('0xa')](),controller[_0x7fe5('0xe')]);router['post']('/',auth[_0x7fe5('0xa')](),interaction['tracked']('fax',_0x7fe5('0xf')),controller[_0x7fe5('0x10')]);router[_0x7fe5('0x11')](_0x7fe5('0x12'),auth['isAuthenticated'](),controller[_0x7fe5('0x13')]);router[_0x7fe5('0x11')]('/:id/accept',auth[_0x7fe5('0xa')](),controller['accept']);router[_0x7fe5('0x11')](_0x7fe5('0x14'),auth['isAuthenticated'](),controller[_0x7fe5('0x15')]);router['delete'](_0x7fe5('0x12'),auth[_0x7fe5('0xa')](),controller[_0x7fe5('0x16')]);module[_0x7fe5('0x17')]=router; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.attributes.js b/server/api/faxQueue/faxQueue.attributes.js index 1a71add..1060da0 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 _0xd7a3=['name','STRING','INTEGER','ENUM','rrmemory','roundrobin','sequelize'];(function(_0x43d11d,_0xccff91){var _0x38cd08=function(_0x131ae2){while(--_0x131ae2){_0x43d11d['push'](_0x43d11d['shift']());}};_0x38cd08(++_0xccff91);}(_0xd7a3,0xf4));var _0x3d7a=function(_0x4fc9e6,_0xc51915){_0x4fc9e6=_0x4fc9e6-0x0;var _0x551d28=_0xd7a3[_0x4fc9e6];return _0x551d28;};'use strict';var Sequelize=require(_0x3d7a('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0x3d7a('0x1'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x3d7a('0x2')]},'timeout':{'type':Sequelize[_0x3d7a('0x3')],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x3d7a('0x4')](_0x3d7a('0x5'),'beepall',_0x3d7a('0x6')),'allowNull':![]},'lastAgent':{'type':Sequelize[_0x3d7a('0x3')],'defaultValue':0x0}}; \ No newline at end of file +var _0x9cb4=['roundrobin','sequelize','exports','STRING','rrmemory','beepall'];(function(_0x3e5fae,_0x5ecf61){var _0x1f65f1=function(_0x3d6c77){while(--_0x3d6c77){_0x3e5fae['push'](_0x3e5fae['shift']());}};_0x1f65f1(++_0x5ecf61);}(_0x9cb4,0x12d));var _0x49cb=function(_0x6c9c79,_0x5cad80){_0x6c9c79=_0x6c9c79-0x0;var _0x5ba93c=_0x9cb4[_0x6c9c79];return _0x5ba93c;};'use strict';var Sequelize=require(_0x49cb('0x0'));module[_0x49cb('0x1')]={'name':{'type':Sequelize[_0x49cb('0x2')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize['INTEGER'],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x49cb('0x3'),_0x49cb('0x4'),_0x49cb('0x5')),'allowNull':![]},'lastAgent':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.controller.js b/server/api/faxQueue/faxQueue.controller.js index a6c105b..f7e8e0c 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 _0x2a41=['from','team_has_fax_queues','join','ut.TeamId\x20=\x20tq.TeamId','ut.UserId\x20=\x20?','push','toString','TeamId','includes','all','union','compact','isEmpty','addAgents','omit','spread','removeAgents','userFaxQueue:remove','getAgents','User','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','register','sendStatus','status','undefined','limit','count','offset','Content-Range','apply','reject','save','then','get','FaxQueues','end','error','stack','name','send','index','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','sort','where','filter','merge','map','VIRTUAL','options','FaxQueue','includeAll','include','findAll','rows','catch','keys','length','find','create','body','user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','params','describe','getMembers','findOne','UserFaxQueue','nolimit','order','pick','FaxQueueId','agent','faxPause','updatedAt','createdAt','format','%s/%s','SIP','Team','getTeams','ids','Agents','online','voicePause','interface','sequelize','transaction','addTeams','each','findOrCreate','forEach','emit','userFaxQueue:save','removeTeams','field','tq.TeamId'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2a41,0x98));var _0x12a4=function(_0x196982,_0x4ba1e7){_0x196982=_0x196982-0x0;var _0x4d8b33=_0x2a41[_0x196982];return _0x4d8b33;};'use strict';var emlformat=require(_0x12a4('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x12a4('0x1'));var jsonpatch=require(_0x12a4('0x2'));var rp=require(_0x12a4('0x3'));var moment=require('moment');var BPromise=require(_0x12a4('0x4'));var Mustache=require(_0x12a4('0x5'));var util=require(_0x12a4('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x12a4('0x7'));var ejs=require(_0x12a4('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x12a4('0x9'));var squel=require('squel');var crypto=require(_0x12a4('0xa'));var jsforce=require(_0x12a4('0xb'));var deskjs=require(_0x12a4('0xc'));var toCsv=require(_0x12a4('0x7'));var querystring=require(_0x12a4('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x12a4('0xe'));var as=require(_0x12a4('0xf'));var hardwareService=require(_0x12a4('0x10'));var logger=require('../../config/logger')(_0x12a4('0x11'));var utils=require('../../config/utils');var config=require(_0x12a4('0x12'));var licenseUtil=require(_0x12a4('0x13'));var db=require(_0x12a4('0x14'))['db'];config['redis']=_[_0x12a4('0x15')](config[_0x12a4('0x16')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x12a4('0x16')]));require('./faxQueue.socket')[_0x12a4('0x17')](socket);function respondWithStatusCode(_0x539448,_0xd4bdbc){_0xd4bdbc=_0xd4bdbc||0xcc;return function(_0x35d032){if(_0x35d032){return _0x539448[_0x12a4('0x18')](_0xd4bdbc);}return _0x539448['status'](_0xd4bdbc)['end']();};}function respondWithResult(_0x57dccf,_0x289828){_0x289828=_0x289828||0xc8;return function(_0x3d28ab){if(_0x3d28ab){return _0x57dccf[_0x12a4('0x19')](_0x289828)['json'](_0x3d28ab);}};}function respondWithFilteredResult(_0x19a6bf,_0x451cdb){return function(_0x19d990){if(_0x19d990){var _0x3b2e31=typeof _0x451cdb['offset']===_0x12a4('0x1a')&&typeof _0x451cdb[_0x12a4('0x1b')]===_0x12a4('0x1a');var _0xb7a52d=_0x19d990[_0x12a4('0x1c')];var _0x37b694=_0x3b2e31?0x0:_0x451cdb[_0x12a4('0x1d')];var _0x599d4c=_0x3b2e31?_0x19d990[_0x12a4('0x1c')]:_0x451cdb[_0x12a4('0x1d')]+_0x451cdb['limit'];var _0x51bb41;if(_0x599d4c>=_0xb7a52d){_0x599d4c=_0xb7a52d;_0x51bb41=0xc8;}else{_0x51bb41=0xce;}_0x19a6bf['status'](_0x51bb41);return _0x19a6bf['set'](_0x12a4('0x1e'),_0x37b694+'-'+_0x599d4c+'/'+_0xb7a52d)['json'](_0x19d990);}return null;};}function patchUpdates(_0x497f16){return function(_0x58907d){try{jsonpatch[_0x12a4('0x1f')](_0x58907d,_0x497f16,!![]);}catch(_0x59781f){return BPromise[_0x12a4('0x20')](_0x59781f);}return _0x58907d[_0x12a4('0x21')]();};}function saveUpdates(_0x1e28b2,_0x446caf){return function(_0x50354f){if(_0x50354f){return _0x50354f['update'](_0x1e28b2)[_0x12a4('0x22')](function(_0x5c9968){return _0x5c9968;});}return null;};}function removeEntity(_0x4be7b3,_0x3988c6){return function(_0x522ede){if(_0x522ede){return _0x522ede['destroy']()[_0x12a4('0x22')](function(){var _0x425874=_0x522ede[_0x12a4('0x23')]({'plain':!![]});var _0x213eca=_0x12a4('0x24');return db['UserProfileResource']['destroy']({'where':{'type':_0x213eca,'resourceId':_0x425874['id']}})[_0x12a4('0x22')](function(){return _0x522ede;});})['then'](function(){_0x4be7b3[_0x12a4('0x19')](0xcc)[_0x12a4('0x25')]();});}};}function handleEntityNotFound(_0x1c1bb3,_0x2cc0a8){return function(_0x53b9ec){if(!_0x53b9ec){_0x1c1bb3[_0x12a4('0x18')](0x194);}return _0x53b9ec;};}function handleError(_0x1f9a4a,_0xe92947){_0xe92947=_0xe92947||0x1f4;return function(_0x39adf6){logger[_0x12a4('0x26')](_0x39adf6[_0x12a4('0x27')]);if(_0x39adf6[_0x12a4('0x28')]){delete _0x39adf6[_0x12a4('0x28')];}_0x1f9a4a[_0x12a4('0x19')](_0xe92947)[_0x12a4('0x29')](_0x39adf6);};}exports[_0x12a4('0x2a')]=function(_0x166138,_0x53a3d5){var _0x5c38e7={},_0x3a928d={},_0x3adacc={'count':0x0,'rows':[]};var _0x4da7ed=_['map'](db['FaxQueue'][_0x12a4('0x2b')],function(_0x47783c){return{'name':_0x47783c[_0x12a4('0x2c')],'type':_0x47783c[_0x12a4('0x2d')][_0x12a4('0x2e')]};});_0x3a928d[_0x12a4('0x2f')]=_['map'](_0x4da7ed,_0x12a4('0x28'));_0x3a928d[_0x12a4('0x30')]=_['keys'](_0x166138[_0x12a4('0x30')]);_0x3a928d[_0x12a4('0x31')]=_[_0x12a4('0x32')](_0x3a928d[_0x12a4('0x2f')],_0x3a928d[_0x12a4('0x30')]);_0x5c38e7[_0x12a4('0x33')]=_[_0x12a4('0x32')](_0x3a928d[_0x12a4('0x2f')],qs[_0x12a4('0x34')](_0x166138['query'][_0x12a4('0x34')]));_0x5c38e7[_0x12a4('0x33')]=_0x5c38e7[_0x12a4('0x33')]['length']?_0x5c38e7[_0x12a4('0x33')]:_0x3a928d[_0x12a4('0x2f')];if(!_0x166138['query'][_0x12a4('0x35')]('nolimit')){_0x5c38e7['limit']=qs[_0x12a4('0x1b')](_0x166138[_0x12a4('0x30')]['limit']);_0x5c38e7[_0x12a4('0x1d')]=qs[_0x12a4('0x1d')](_0x166138[_0x12a4('0x30')]['offset']);}_0x5c38e7['order']=qs[_0x12a4('0x36')](_0x166138[_0x12a4('0x30')][_0x12a4('0x36')]);_0x5c38e7[_0x12a4('0x37')]=qs[_0x12a4('0x31')](_['pick'](_0x166138[_0x12a4('0x30')],_0x3a928d[_0x12a4('0x31')]),_0x4da7ed);if(_0x166138[_0x12a4('0x30')][_0x12a4('0x38')]){_0x5c38e7[_0x12a4('0x37')]=_[_0x12a4('0x39')](_0x5c38e7[_0x12a4('0x37')],{'$or':_[_0x12a4('0x3a')](_0x4da7ed,function(_0x528f64){if(_0x528f64['type']!==_0x12a4('0x3b')){var _0x4fdef2={};_0x4fdef2[_0x528f64['name']]={'$like':'%'+_0x166138['query']['filter']+'%'};return _0x4fdef2;}})});}_0x5c38e7=_[_0x12a4('0x39')]({},_0x5c38e7,_0x166138[_0x12a4('0x3c')]);var _0x558d56={'where':_0x5c38e7[_0x12a4('0x37')]};return db[_0x12a4('0x3d')][_0x12a4('0x1c')](_0x558d56)[_0x12a4('0x22')](function(_0x4519c6){_0x3adacc[_0x12a4('0x1c')]=_0x4519c6;if(_0x166138['query'][_0x12a4('0x3e')]){_0x5c38e7[_0x12a4('0x3f')]=[{'all':!![]}];}return db[_0x12a4('0x3d')][_0x12a4('0x40')](_0x5c38e7);})[_0x12a4('0x22')](function(_0x54a57b){_0x3adacc[_0x12a4('0x41')]=_0x54a57b;return _0x3adacc;})[_0x12a4('0x22')](respondWithFilteredResult(_0x53a3d5,_0x5c38e7))[_0x12a4('0x42')](handleError(_0x53a3d5,null));};exports['show']=function(_0x31df2d,_0x29960a){var _0x5489ec={'raw':!![],'where':{'id':_0x31df2d['params']['id']}},_0x36049c={};_0x36049c[_0x12a4('0x2f')]=_[_0x12a4('0x43')](db[_0x12a4('0x3d')][_0x12a4('0x2b')]);_0x36049c[_0x12a4('0x30')]=_[_0x12a4('0x43')](_0x31df2d[_0x12a4('0x30')]);_0x36049c[_0x12a4('0x31')]=_[_0x12a4('0x32')](_0x36049c['model'],_0x36049c[_0x12a4('0x30')]);_0x5489ec[_0x12a4('0x33')]=_[_0x12a4('0x32')](_0x36049c[_0x12a4('0x2f')],qs[_0x12a4('0x34')](_0x31df2d[_0x12a4('0x30')]['fields']));_0x5489ec[_0x12a4('0x33')]=_0x5489ec['attributes'][_0x12a4('0x44')]?_0x5489ec[_0x12a4('0x33')]:_0x36049c['model'];if(_0x31df2d[_0x12a4('0x30')][_0x12a4('0x3e')]){_0x5489ec[_0x12a4('0x3f')]=[{'all':!![]}];}_0x5489ec=_[_0x12a4('0x39')]({},_0x5489ec,_0x31df2d[_0x12a4('0x3c')]);return db[_0x12a4('0x3d')][_0x12a4('0x45')](_0x5489ec)[_0x12a4('0x22')](handleEntityNotFound(_0x29960a,null))['then'](respondWithResult(_0x29960a,null))[_0x12a4('0x42')](handleError(_0x29960a,null));};exports[_0x12a4('0x46')]=function(_0x3539b9,_0x597da1){return db[_0x12a4('0x3d')]['create'](_0x3539b9[_0x12a4('0x47')],{})[_0x12a4('0x22')](function(_0xe27733){var _0x4bd56b=_0x3539b9[_0x12a4('0x48')][_0x12a4('0x23')]({'plain':!![]});if(!_0x4bd56b)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4bd56b[_0x12a4('0x49')]===_0x12a4('0x48')){var _0x55cc93=_0xe27733[_0x12a4('0x23')]({'plain':!![]});var _0x42891f=_0x12a4('0x24');return db[_0x12a4('0x4a')][_0x12a4('0x45')]({'where':{'name':_0x42891f,'userProfileId':_0x4bd56b[_0x12a4('0x4b')]},'raw':!![]})[_0x12a4('0x22')](function(_0x52387e){if(_0x52387e&&_0x52387e[_0x12a4('0x4c')]===0x0){return db[_0x12a4('0x4d')][_0x12a4('0x46')]({'name':_0x55cc93[_0x12a4('0x28')],'resourceId':_0x55cc93['id'],'type':_0x52387e['name'],'sectionId':_0x52387e['id']},{})[_0x12a4('0x22')](function(){return _0xe27733;});}else{return _0xe27733;}})['catch'](function(_0x5e86e7){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5e86e7);throw _0x5e86e7;});}return _0xe27733;})[_0x12a4('0x22')](respondWithResult(_0x597da1,0xc9))[_0x12a4('0x42')](handleError(_0x597da1,null));};exports['update']=function(_0x2c0dde,_0x33dfb1){if(_0x2c0dde[_0x12a4('0x47')]['id']){delete _0x2c0dde[_0x12a4('0x47')]['id'];}return db['FaxQueue'][_0x12a4('0x45')]({'where':{'id':_0x2c0dde[_0x12a4('0x4e')]['id']}})['then'](handleEntityNotFound(_0x33dfb1,null))[_0x12a4('0x22')](saveUpdates(_0x2c0dde['body'],null))[_0x12a4('0x22')](respondWithResult(_0x33dfb1,null))[_0x12a4('0x42')](handleError(_0x33dfb1,null));};exports['destroy']=function(_0x1b5210,_0x33b0b5){return db['FaxQueue'][_0x12a4('0x45')]({'where':{'id':_0x1b5210[_0x12a4('0x4e')]['id']}})[_0x12a4('0x22')](handleEntityNotFound(_0x33b0b5,null))[_0x12a4('0x22')](removeEntity(_0x33b0b5,null))[_0x12a4('0x42')](handleError(_0x33b0b5,null));};exports[_0x12a4('0x4f')]=function(_0x1cc4cd,_0x352c52){return db[_0x12a4('0x3d')][_0x12a4('0x4f')]()[_0x12a4('0x22')](respondWithResult(_0x352c52,null))[_0x12a4('0x42')](handleError(_0x352c52,null));};exports[_0x12a4('0x50')]=function(_0xab2542,_0x30e4be,_0x1a87f1){var _0x850798={'raw':!![],'where':{}},_0x38342e={},_0x16e3f9;return db[_0x12a4('0x3d')][_0x12a4('0x51')]({'where':{'id':_0xab2542['params']['id']}})[_0x12a4('0x22')](handleEntityNotFound(_0x30e4be,null))['then'](function(_0x544a81){if(_0x544a81){_0x16e3f9=_0x544a81[_0x12a4('0x23')]({'plain':!![]});_0x38342e['model']=_[_0x12a4('0x43')](db[_0x12a4('0x52')]['rawAttributes']);_0x38342e[_0x12a4('0x30')]=_[_0x12a4('0x43')](_0xab2542[_0x12a4('0x30')]);_0x38342e['filters']=_[_0x12a4('0x32')](_0x38342e['model'],_0x38342e[_0x12a4('0x30')]);_0x850798[_0x12a4('0x33')]=_[_0x12a4('0x32')](_0x38342e['model'],qs[_0x12a4('0x34')](_0xab2542[_0x12a4('0x30')][_0x12a4('0x34')]));_0x850798[_0x12a4('0x33')]=_0x850798[_0x12a4('0x33')]['length']?_0x850798['attributes']:_0x38342e[_0x12a4('0x2f')];if(!_0xab2542['query'][_0x12a4('0x35')](_0x12a4('0x53'))){_0x850798['limit']=qs[_0x12a4('0x1b')](_0xab2542['query'][_0x12a4('0x1b')]);_0x850798['offset']=qs[_0x12a4('0x1d')](_0xab2542[_0x12a4('0x30')]['offset']);}_0x850798[_0x12a4('0x54')]=qs['sort'](_0xab2542[_0x12a4('0x30')]['sort']);_0x850798['where']=qs['filters'](_[_0x12a4('0x55')](_0xab2542[_0x12a4('0x30')],_0x38342e[_0x12a4('0x31')]));_0x850798['where'][_0x12a4('0x56')]=_0x544a81['id'];if(_0xab2542[_0x12a4('0x30')]['filter']){_0x850798['where']=_[_0x12a4('0x39')](_0x850798[_0x12a4('0x37')],{'$or':_[_0x12a4('0x3a')](_0x850798[_0x12a4('0x33')],function(_0x32e3b3){var _0x17f755={};_0x17f755[_0x32e3b3]={'$like':'%'+_0xab2542[_0x12a4('0x30')][_0x12a4('0x38')]+'%'};return _0x17f755;})});}_0x850798=_[_0x12a4('0x39')]({},_0x850798,_0xab2542['options']);return db['UserFaxQueue'][_0x12a4('0x40')](_0x850798);}})[_0x12a4('0x22')](function(_0xe07378){if(_0xe07378){return db['User']['findAndCountAll']({'where':{'id':_[_0x12a4('0x3a')](_0xe07378,'UserId'),'role':_0x12a4('0x57')},'attributes':['id',_0x12a4('0x28'),_0x12a4('0x58'),_0x12a4('0x59'),_0x12a4('0x5a')]});}})[_0x12a4('0x22')](function(_0x5588e2){if(_0x5588e2){return{'count':_0x5588e2[_0x12a4('0x1c')],'rows':_[_0x12a4('0x3a')](_0x5588e2[_0x12a4('0x41')],function(_0x38f5e0){return{'membername':_0x38f5e0['name'],'UserId':_0x38f5e0['id'],'queue_name':_0x16e3f9[_0x12a4('0x28')],'FaxQueueId':_0x16e3f9['id'],'interface':util[_0x12a4('0x5b')](_0x12a4('0x5c'),_0x12a4('0x5d'),_0x38f5e0['name']),'penalty':0x0,'paused':_0x38f5e0[_0x12a4('0x58')],'createdAt':_0x38f5e0['createdAt'],'updatedAt':_0x38f5e0['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x12a4('0x22')](respondWithFilteredResult(_0x30e4be,_0x850798))['catch'](handleError(_0x30e4be,null));};exports['getTeams']=function(_0x20b0cb,_0x185042,_0x3b1f90){var _0x482f4b={};var _0x33ba4d={};var _0x4da545;var _0x36bc1c;return db[_0x12a4('0x3d')][_0x12a4('0x51')]({'where':{'id':_0x20b0cb[_0x12a4('0x4e')]['id']}})[_0x12a4('0x22')](handleEntityNotFound(_0x185042,null))[_0x12a4('0x22')](function(_0x38e000){if(_0x38e000){_0x4da545=_0x38e000;_0x33ba4d[_0x12a4('0x2f')]=_[_0x12a4('0x43')](db[_0x12a4('0x5e')][_0x12a4('0x2b')]);_0x33ba4d['query']=_[_0x12a4('0x43')](_0x20b0cb[_0x12a4('0x30')]);_0x33ba4d[_0x12a4('0x31')]=_['intersection'](_0x33ba4d[_0x12a4('0x2f')],_0x33ba4d[_0x12a4('0x30')]);_0x482f4b['attributes']=_[_0x12a4('0x32')](_0x33ba4d[_0x12a4('0x2f')],qs[_0x12a4('0x34')](_0x20b0cb[_0x12a4('0x30')][_0x12a4('0x34')]));_0x482f4b['attributes']=_0x482f4b['attributes'][_0x12a4('0x44')]?_0x482f4b['attributes']:_0x33ba4d[_0x12a4('0x2f')];_0x482f4b[_0x12a4('0x54')]=qs[_0x12a4('0x36')](_0x20b0cb[_0x12a4('0x30')]['sort']);_0x482f4b[_0x12a4('0x37')]=qs[_0x12a4('0x31')](_[_0x12a4('0x55')](_0x20b0cb[_0x12a4('0x30')],_0x33ba4d['filters']));if(_0x20b0cb[_0x12a4('0x30')][_0x12a4('0x38')]){_0x482f4b[_0x12a4('0x37')]=_[_0x12a4('0x39')](_0x482f4b['where'],{'$or':_[_0x12a4('0x3a')](_0x482f4b[_0x12a4('0x33')],function(_0x108d75){var _0x57862d={};_0x57862d[_0x108d75]={'$like':'%'+_0x20b0cb[_0x12a4('0x30')]['filter']+'%'};return _0x57862d;})});}_0x482f4b=_[_0x12a4('0x39')]({},_0x482f4b,_0x20b0cb[_0x12a4('0x3c')]);return _0x4da545['getTeams'](_0x482f4b);}})[_0x12a4('0x22')](function(_0xae5b21){if(_0xae5b21){_0x36bc1c=_0xae5b21[_0x12a4('0x44')];if(!_0x20b0cb[_0x12a4('0x30')][_0x12a4('0x35')](_0x12a4('0x53'))){_0x482f4b[_0x12a4('0x1b')]=qs[_0x12a4('0x1b')](_0x20b0cb[_0x12a4('0x30')][_0x12a4('0x1b')]);_0x482f4b['offset']=qs[_0x12a4('0x1d')](_0x20b0cb[_0x12a4('0x30')][_0x12a4('0x1d')]);}return _0x4da545[_0x12a4('0x5f')](_0x482f4b);}})[_0x12a4('0x22')](function(_0x9b9c1f){if(_0x9b9c1f){return _0x9b9c1f?{'count':_0x36bc1c,'rows':_0x9b9c1f}:null;}})[_0x12a4('0x22')](respondWithResult(_0x185042,null))[_0x12a4('0x42')](handleError(_0x185042,null));};exports['addTeams']=function(_0x535081,_0x481d6d,_0x3b7cf4){var _0xc6bd99=_0x535081[_0x12a4('0x47')][_0x12a4('0x60')];return db[_0x12a4('0x5e')]['findAll']({'where':{'id':_0xc6bd99},'attributes':['id'],'include':[{'model':db['User'],'as':_0x12a4('0x61'),'attributes':['id',_0x12a4('0x28'),_0x12a4('0x62'),_0x12a4('0x63'),_0x12a4('0x64')],'raw':!![]}]})[_0x12a4('0x22')](function(_0x5b1558){if(_0x5b1558){var _0x414ba4=_['flatMap'](_0x5b1558,function(_0x2a325d){var _0x42b3e3=_0x2a325d['get']({'plain':!![]});return _0x42b3e3[_0x12a4('0x61')];});return db[_0x12a4('0x3d')][_0x12a4('0x45')]({'where':{'id':_0x535081[_0x12a4('0x4e')]['id']}})[_0x12a4('0x22')](function(_0x442a38){return db[_0x12a4('0x65')][_0x12a4('0x66')](function(_0x19649a){return _0x442a38[_0x12a4('0x67')](_0xc6bd99,{'transaction':_0x19649a})['then'](function(){return BPromise[_0x12a4('0x68')](_0x414ba4,function(_0x5682b6){return db[_0x12a4('0x52')][_0x12a4('0x69')]({'where':{'UserId':_0x5682b6['id'],'FaxQueueId':_0x535081[_0x12a4('0x4e')]['id']},'transaction':_0x19649a});});})[_0x12a4('0x22')](function(){_0x414ba4[_0x12a4('0x6a')](function(_0x3e1d33){socket[_0x12a4('0x6b')](_0x12a4('0x6c'),{'UserId':_0x3e1d33['id'],'FaxQueueId':_0x442a38['id']});});});});});}})[_0x12a4('0x22')](respondWithStatusCode(_0x481d6d,null))[_0x12a4('0x42')](handleError(_0x481d6d,null));};exports[_0x12a4('0x6d')]=function(_0x2d02b2,_0x4304a7,_0x3a7411){return db[_0x12a4('0x5e')][_0x12a4('0x40')]({'where':{'id':_0x2d02b2[_0x12a4('0x30')][_0x12a4('0x60')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0x12a4('0x61'),'attributes':['id'],'raw':!![]}]})[_0x12a4('0x22')](handleEntityNotFound(_0x4304a7,null))[_0x12a4('0x22')](function(_0x5cb603){var _0x2a81e0=_[_0x12a4('0x3a')](_0x5cb603,'id');var _0x30a678=[];var _0x11c8c9=[];var _0x5afede=squel['select']();_0x5afede[_0x12a4('0x6e')](_0x12a4('0x6f'))[_0x12a4('0x70')](_0x12a4('0x71'),'tq')[_0x12a4('0x72')]('user_has_teams','ut',_0x12a4('0x73'))[_0x12a4('0x37')]('FaxQueueId\x20=\x20?',_0x2d02b2['params']['id']);for(var _0x372fa1=0x0;_0x372fa1<_0x5cb603['length'];_0x372fa1+=0x1){let _0x2de44f=_0x5cb603[_0x372fa1];for(var _0x43c6bd=0x0;_0x43c6bd<_0x2de44f['Agents'][_0x12a4('0x44')];_0x43c6bd+=0x1){let _0xaedad7=_0x2de44f[_0x12a4('0x61')][_0x43c6bd];var _0x2c5c89=_0x5afede['clone']();_0x2c5c89[_0x12a4('0x37')](_0x12a4('0x74'),_0xaedad7['id']);_0x11c8c9[_0x12a4('0x75')](db['sequelize'][_0x12a4('0x30')](_0x2c5c89[_0x12a4('0x76')](),{'type':db[_0x12a4('0x65')]['QueryTypes']['SELECT']})[_0x12a4('0x22')](function(_0x5682ad){if(_0x5682ad[_0x12a4('0x44')]===0x1){return _0xaedad7['id'];}else{var _0x44b3ce=_['every'](_[_0x12a4('0x3a')](_0x5682ad,_0x12a4('0x77')),function(_0x2be068){return _[_0x12a4('0x78')](_0x2a81e0,_0x2be068);});if(_0x44b3ce){return _0xaedad7['id'];}}}));}}return BPromise[_0x12a4('0x79')](_0x11c8c9)[_0x12a4('0x22')](function(_0x28841c){_0x30a678=_(_0x30a678)[_0x12a4('0x7a')](_0x28841c)[_0x12a4('0x7b')]()['value']();return db[_0x12a4('0x3d')][_0x12a4('0x45')]({'where':{'id':_0x2d02b2['params']['id']}})[_0x12a4('0x22')](function(_0xd4d7a5){return db[_0x12a4('0x65')][_0x12a4('0x66')](function(_0x1e0d94){return _0xd4d7a5[_0x12a4('0x6d')](_0x2d02b2[_0x12a4('0x30')]['ids'],{'transaction':_0x1e0d94})['then'](function(){if(!_[_0x12a4('0x7c')](_0x30a678)){return _0xd4d7a5['removeAgents'](_0x30a678,{'transaction':_0x1e0d94});}})[_0x12a4('0x22')](function(){_0x30a678[_0x12a4('0x6a')](function(_0x3c2348){socket[_0x12a4('0x6b')]('userFaxQueue:remove',{'UserId':_0x3c2348,'FaxQueueId':_0xd4d7a5['id']});});});});});});})['then'](respondWithStatusCode(_0x4304a7,null))[_0x12a4('0x42')](handleError(_0x4304a7,null));};exports[_0x12a4('0x7d')]=function(_0xf02622,_0x49cd84,_0x5ee4c9){return db[_0x12a4('0x3d')]['find']({'where':{'id':_0xf02622['params']['id']}})[_0x12a4('0x22')](handleEntityNotFound(_0x49cd84,null))[_0x12a4('0x22')](function(_0x9346e){if(_0x9346e){return _0x9346e['addAgents'](_0xf02622['body'][_0x12a4('0x60')],_[_0x12a4('0x7e')](_0xf02622[_0x12a4('0x47')],[_0x12a4('0x60'),'id'])||{})[_0x12a4('0x7f')](function(_0x4e2a53){for(var _0x49cc19=0x0;_0x49cc19<_0xf02622[_0x12a4('0x47')][_0x12a4('0x60')][_0x12a4('0x44')];_0x49cc19+=0x1){socket[_0x12a4('0x6b')](_0x12a4('0x6c'),{'UserId':Number(_0xf02622[_0x12a4('0x47')]['ids'][_0x49cc19]),'FaxQueueId':Number(_0xf02622[_0x12a4('0x4e')]['id'])});}return _0x4e2a53;});}})[_0x12a4('0x22')](respondWithResult(_0x49cd84,null))[_0x12a4('0x42')](handleError(_0x49cd84,null));};exports[_0x12a4('0x80')]=function(_0x5b5c0a,_0x5f077e,_0x1d49e2){return db[_0x12a4('0x3d')][_0x12a4('0x45')]({'where':{'id':_0x5b5c0a[_0x12a4('0x4e')]['id']}})[_0x12a4('0x22')](handleEntityNotFound(_0x5f077e,null))['then'](function(_0x1a615f){if(_0x1a615f){return _0x1a615f[_0x12a4('0x80')](_0x5b5c0a['query'][_0x12a4('0x60')])[_0x12a4('0x22')](function(){if(_['isArray'](_0x5b5c0a[_0x12a4('0x30')][_0x12a4('0x60')])){for(var _0x2db4e7=0x0;_0x2db4e7<_0x5b5c0a[_0x12a4('0x30')]['ids'][_0x12a4('0x44')];_0x2db4e7+=0x1){socket[_0x12a4('0x6b')]('userFaxQueue:remove',{'UserId':Number(_0x5b5c0a[_0x12a4('0x30')][_0x12a4('0x60')][_0x2db4e7]),'FaxQueueId':Number(_0x5b5c0a[_0x12a4('0x4e')]['id'])});}}else{socket['emit'](_0x12a4('0x81'),{'UserId':Number(_0x5b5c0a[_0x12a4('0x30')][_0x12a4('0x60')]),'FaxQueueId':Number(_0x5b5c0a[_0x12a4('0x4e')]['id'])});}});}})[_0x12a4('0x22')](respondWithStatusCode(_0x5f077e,null))['catch'](handleError(_0x5f077e,null));};exports[_0x12a4('0x82')]=function(_0x4eb50b,_0x405afe,_0x1bb07d){var _0xe4dcd4={};var _0x1d8c1d={};var _0x4781f8;var _0x7493bb;return db[_0x12a4('0x3d')]['findOne']({'where':{'id':_0x4eb50b[_0x12a4('0x4e')]['id']}})[_0x12a4('0x22')](handleEntityNotFound(_0x405afe,null))[_0x12a4('0x22')](function(_0x5dde0e){if(_0x5dde0e){_0x4781f8=_0x5dde0e;_0x1d8c1d[_0x12a4('0x2f')]=_[_0x12a4('0x43')](db[_0x12a4('0x83')][_0x12a4('0x2b')]);_0x1d8c1d[_0x12a4('0x30')]=_['keys'](_0x4eb50b[_0x12a4('0x30')]);_0x1d8c1d[_0x12a4('0x31')]=_[_0x12a4('0x32')](_0x1d8c1d[_0x12a4('0x2f')],_0x1d8c1d[_0x12a4('0x30')]);_0xe4dcd4[_0x12a4('0x33')]=_[_0x12a4('0x32')](_0x1d8c1d[_0x12a4('0x2f')],qs[_0x12a4('0x34')](_0x4eb50b[_0x12a4('0x30')][_0x12a4('0x34')]));_0xe4dcd4[_0x12a4('0x33')]=_0xe4dcd4[_0x12a4('0x33')][_0x12a4('0x44')]?_0xe4dcd4[_0x12a4('0x33')]:_0x1d8c1d[_0x12a4('0x2f')];_0xe4dcd4['order']=qs[_0x12a4('0x36')](_0x4eb50b[_0x12a4('0x30')][_0x12a4('0x36')]);_0xe4dcd4[_0x12a4('0x37')]=qs['filters'](_[_0x12a4('0x55')](_0x4eb50b[_0x12a4('0x30')],_0x1d8c1d['filters']));if(_0x4eb50b[_0x12a4('0x30')]['filter']){_0xe4dcd4['where']=_['merge'](_0xe4dcd4['where'],{'$or':_['map'](_0xe4dcd4['attributes'],function(_0x1a2ac6){var _0x40a2f7={};_0x40a2f7[_0x1a2ac6]={'$like':'%'+_0x4eb50b['query']['filter']+'%'};return _0x40a2f7;})});}_0xe4dcd4=_[_0x12a4('0x39')]({},_0xe4dcd4,_0x4eb50b[_0x12a4('0x3c')]);return _0x4781f8[_0x12a4('0x82')](_0xe4dcd4);}})[_0x12a4('0x22')](function(_0xc42b58){if(_0xc42b58){_0x7493bb=_0xc42b58['length'];if(!_0x4eb50b[_0x12a4('0x30')][_0x12a4('0x35')](_0x12a4('0x53'))){_0xe4dcd4[_0x12a4('0x1b')]=qs[_0x12a4('0x1b')](_0x4eb50b[_0x12a4('0x30')]['limit']);_0xe4dcd4[_0x12a4('0x1d')]=qs[_0x12a4('0x1d')](_0x4eb50b['query'][_0x12a4('0x1d')]);}return _0x4781f8[_0x12a4('0x82')](_0xe4dcd4);}})[_0x12a4('0x22')](function(_0xbf705c){if(_0xbf705c){return _0xbf705c?{'count':_0x7493bb,'rows':_0xbf705c}:null;}})['then'](respondWithResult(_0x405afe,null))['catch'](handleError(_0x405afe,null));}; \ No newline at end of file +var _0x6a70=['intersection','query','attributes','fields','nolimit','order','sort','filters','filter','where','merge','options','findAll','rows','catch','show','params','rawAttributes','length','includeAll','include','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','find','describe','getMembers','UserFaxQueue','hasOwnProperty','pick','FaxQueueId','findAndCountAll','agent','faxPause','updatedAt','createdAt','format','%s/%s','SIP','getTeams','findOne','Team','addTeams','User','Agents','online','voicePause','flatMap','transaction','each','findOrCreate','forEach','userFaxQueue:save','removeTeams','ids','field','tq.TeamId','from','team_has_fax_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','FaxQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','sequelize','QueryTypes','SELECT','every','TeamId','includes','all','union','compact','value','isEmpty','removeAgents','emit','userFaxQueue:remove','addAgents','spread','isArray','getAgents','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','fs-extra','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./faxQueue.socket','register','sendStatus','status','end','json','limit','count','offset','set','Content-Range','apply','then','destroy','get','FaxQueues','UserProfileResource','stack','name','send','index','map','FaxQueue','fieldName','type','key','model','keys'];(function(_0x3a392d,_0x15cd42){var _0x34b227=function(_0xb8a7c9){while(--_0xb8a7c9){_0x3a392d['push'](_0x3a392d['shift']());}};_0x34b227(++_0x15cd42);}(_0x6a70,0xe5));var _0x06a7=function(_0x1198a2,_0x42826a){_0x1198a2=_0x1198a2-0x0;var _0x454495=_0x6a70[_0x1198a2];return _0x454495;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x06a7('0x0'));var zipdir=require(_0x06a7('0x1'));var jsonpatch=require(_0x06a7('0x2'));var rp=require(_0x06a7('0x3'));var moment=require(_0x06a7('0x4'));var BPromise=require(_0x06a7('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x06a7('0x6'));var sox=require(_0x06a7('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x06a7('0x8'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x06a7('0x9'));var toCsv=require(_0x06a7('0xa'));var querystring=require(_0x06a7('0xb'));var Papa=require(_0x06a7('0xc'));var Redis=require('ioredis');var authService=require(_0x06a7('0xd'));var qs=require(_0x06a7('0xe'));var as=require(_0x06a7('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x06a7('0x10'))(_0x06a7('0x11'));var utils=require(_0x06a7('0x12'));var config=require(_0x06a7('0x13'));var licenseUtil=require(_0x06a7('0x14'));var db=require(_0x06a7('0x15'))['db'];config['redis']=_['defaults'](config[_0x06a7('0x16')],{'host':_0x06a7('0x17'),'port':0x18eb});var socket=require(_0x06a7('0x18'))(new Redis(config['redis']));require(_0x06a7('0x19'))[_0x06a7('0x1a')](socket);function respondWithStatusCode(_0x39877f,_0x3b35be){_0x3b35be=_0x3b35be||0xcc;return function(_0x5d58e6){if(_0x5d58e6){return _0x39877f[_0x06a7('0x1b')](_0x3b35be);}return _0x39877f[_0x06a7('0x1c')](_0x3b35be)[_0x06a7('0x1d')]();};}function respondWithResult(_0x275884,_0x59b26e){_0x59b26e=_0x59b26e||0xc8;return function(_0x413360){if(_0x413360){return _0x275884[_0x06a7('0x1c')](_0x59b26e)[_0x06a7('0x1e')](_0x413360);}};}function respondWithFilteredResult(_0x3377ed,_0x5a4d5f){return function(_0x2138df){if(_0x2138df){var _0x16e9be=typeof _0x5a4d5f['offset']==='undefined'&&typeof _0x5a4d5f[_0x06a7('0x1f')]==='undefined';var _0x42016b=_0x2138df[_0x06a7('0x20')];var _0x5ac19e=_0x16e9be?0x0:_0x5a4d5f[_0x06a7('0x21')];var _0x15f3e4=_0x16e9be?_0x2138df['count']:_0x5a4d5f[_0x06a7('0x21')]+_0x5a4d5f[_0x06a7('0x1f')];var _0x39dc3e;if(_0x15f3e4>=_0x42016b){_0x15f3e4=_0x42016b;_0x39dc3e=0xc8;}else{_0x39dc3e=0xce;}_0x3377ed[_0x06a7('0x1c')](_0x39dc3e);return _0x3377ed[_0x06a7('0x22')](_0x06a7('0x23'),_0x5ac19e+'-'+_0x15f3e4+'/'+_0x42016b)[_0x06a7('0x1e')](_0x2138df);}return null;};}function patchUpdates(_0x3c28ea){return function(_0x3cff76){try{jsonpatch[_0x06a7('0x24')](_0x3cff76,_0x3c28ea,!![]);}catch(_0x5710c5){return BPromise['reject'](_0x5710c5);}return _0x3cff76['save']();};}function saveUpdates(_0x2aa7a8,_0x17cc9b){return function(_0x2f22f4){if(_0x2f22f4){return _0x2f22f4['update'](_0x2aa7a8)[_0x06a7('0x25')](function(_0x48a7e2){return _0x48a7e2;});}return null;};}function removeEntity(_0xd178bc,_0x502871){return function(_0x28646a){if(_0x28646a){return _0x28646a[_0x06a7('0x26')]()[_0x06a7('0x25')](function(){var _0xbc2c9e=_0x28646a[_0x06a7('0x27')]({'plain':!![]});var _0x41ced3=_0x06a7('0x28');return db[_0x06a7('0x29')][_0x06a7('0x26')]({'where':{'type':_0x41ced3,'resourceId':_0xbc2c9e['id']}})[_0x06a7('0x25')](function(){return _0x28646a;});})[_0x06a7('0x25')](function(){_0xd178bc[_0x06a7('0x1c')](0xcc)[_0x06a7('0x1d')]();});}};}function handleEntityNotFound(_0x37750a,_0x44420a){return function(_0x2ccfc7){if(!_0x2ccfc7){_0x37750a[_0x06a7('0x1b')](0x194);}return _0x2ccfc7;};}function handleError(_0x167452,_0x53b29d){_0x53b29d=_0x53b29d||0x1f4;return function(_0x3e2651){logger['error'](_0x3e2651[_0x06a7('0x2a')]);if(_0x3e2651[_0x06a7('0x2b')]){delete _0x3e2651[_0x06a7('0x2b')];}_0x167452['status'](_0x53b29d)[_0x06a7('0x2c')](_0x3e2651);};}exports[_0x06a7('0x2d')]=function(_0x86ae07,_0x465ee2){var _0x51da3e={},_0xee81db={},_0x5ddcff={'count':0x0,'rows':[]};var _0x2c3876=_[_0x06a7('0x2e')](db[_0x06a7('0x2f')]['rawAttributes'],function(_0x138a86){return{'name':_0x138a86[_0x06a7('0x30')],'type':_0x138a86[_0x06a7('0x31')][_0x06a7('0x32')]};});_0xee81db[_0x06a7('0x33')]=_[_0x06a7('0x2e')](_0x2c3876,_0x06a7('0x2b'));_0xee81db['query']=_[_0x06a7('0x34')](_0x86ae07['query']);_0xee81db['filters']=_[_0x06a7('0x35')](_0xee81db[_0x06a7('0x33')],_0xee81db[_0x06a7('0x36')]);_0x51da3e[_0x06a7('0x37')]=_[_0x06a7('0x35')](_0xee81db[_0x06a7('0x33')],qs[_0x06a7('0x38')](_0x86ae07[_0x06a7('0x36')][_0x06a7('0x38')]));_0x51da3e[_0x06a7('0x37')]=_0x51da3e[_0x06a7('0x37')]['length']?_0x51da3e[_0x06a7('0x37')]:_0xee81db['model'];if(!_0x86ae07[_0x06a7('0x36')]['hasOwnProperty'](_0x06a7('0x39'))){_0x51da3e[_0x06a7('0x1f')]=qs[_0x06a7('0x1f')](_0x86ae07['query'][_0x06a7('0x1f')]);_0x51da3e['offset']=qs[_0x06a7('0x21')](_0x86ae07[_0x06a7('0x36')]['offset']);}_0x51da3e[_0x06a7('0x3a')]=qs['sort'](_0x86ae07['query'][_0x06a7('0x3b')]);_0x51da3e['where']=qs[_0x06a7('0x3c')](_['pick'](_0x86ae07[_0x06a7('0x36')],_0xee81db[_0x06a7('0x3c')]),_0x2c3876);if(_0x86ae07[_0x06a7('0x36')][_0x06a7('0x3d')]){_0x51da3e[_0x06a7('0x3e')]=_[_0x06a7('0x3f')](_0x51da3e[_0x06a7('0x3e')],{'$or':_[_0x06a7('0x2e')](_0x2c3876,function(_0x1d4e8f){if(_0x1d4e8f[_0x06a7('0x31')]!=='VIRTUAL'){var _0x94d822={};_0x94d822[_0x1d4e8f[_0x06a7('0x2b')]]={'$like':'%'+_0x86ae07[_0x06a7('0x36')][_0x06a7('0x3d')]+'%'};return _0x94d822;}})});}_0x51da3e=_[_0x06a7('0x3f')]({},_0x51da3e,_0x86ae07[_0x06a7('0x40')]);var _0x3e4afb={'where':_0x51da3e[_0x06a7('0x3e')]};return db[_0x06a7('0x2f')][_0x06a7('0x20')](_0x3e4afb)[_0x06a7('0x25')](function(_0x619a0c){_0x5ddcff[_0x06a7('0x20')]=_0x619a0c;if(_0x86ae07['query']['includeAll']){_0x51da3e['include']=[{'all':!![]}];}return db['FaxQueue'][_0x06a7('0x41')](_0x51da3e);})[_0x06a7('0x25')](function(_0x238937){_0x5ddcff[_0x06a7('0x42')]=_0x238937;return _0x5ddcff;})[_0x06a7('0x25')](respondWithFilteredResult(_0x465ee2,_0x51da3e))[_0x06a7('0x43')](handleError(_0x465ee2,null));};exports[_0x06a7('0x44')]=function(_0x2e9714,_0x59166e){var _0x648121={'raw':!![],'where':{'id':_0x2e9714[_0x06a7('0x45')]['id']}},_0x4b18f5={};_0x4b18f5['model']=_[_0x06a7('0x34')](db[_0x06a7('0x2f')][_0x06a7('0x46')]);_0x4b18f5['query']=_[_0x06a7('0x34')](_0x2e9714['query']);_0x4b18f5['filters']=_[_0x06a7('0x35')](_0x4b18f5['model'],_0x4b18f5[_0x06a7('0x36')]);_0x648121['attributes']=_[_0x06a7('0x35')](_0x4b18f5[_0x06a7('0x33')],qs[_0x06a7('0x38')](_0x2e9714['query'][_0x06a7('0x38')]));_0x648121[_0x06a7('0x37')]=_0x648121[_0x06a7('0x37')][_0x06a7('0x47')]?_0x648121[_0x06a7('0x37')]:_0x4b18f5[_0x06a7('0x33')];if(_0x2e9714[_0x06a7('0x36')][_0x06a7('0x48')]){_0x648121[_0x06a7('0x49')]=[{'all':!![]}];}_0x648121=_[_0x06a7('0x3f')]({},_0x648121,_0x2e9714[_0x06a7('0x40')]);return db[_0x06a7('0x2f')]['find'](_0x648121)[_0x06a7('0x25')](handleEntityNotFound(_0x59166e,null))['then'](respondWithResult(_0x59166e,null))['catch'](handleError(_0x59166e,null));};exports[_0x06a7('0x4a')]=function(_0x4ac8ea,_0x26b91f){return db[_0x06a7('0x2f')][_0x06a7('0x4a')](_0x4ac8ea['body'],{})['then'](function(_0x1307e8){var _0x184a75=_0x4ac8ea[_0x06a7('0x4b')]['get']({'plain':!![]});if(!_0x184a75)throw new Error(_0x06a7('0x4c'));if(_0x184a75['role']===_0x06a7('0x4b')){var _0x486124=_0x1307e8[_0x06a7('0x27')]({'plain':!![]});var _0xb30d18=_0x06a7('0x28');return db['UserProfileSection']['find']({'where':{'name':_0xb30d18,'userProfileId':_0x184a75[_0x06a7('0x4d')]},'raw':!![]})[_0x06a7('0x25')](function(_0x275ade){if(_0x275ade&&_0x275ade['autoAssociation']===0x0){return db[_0x06a7('0x29')][_0x06a7('0x4a')]({'name':_0x486124['name'],'resourceId':_0x486124['id'],'type':_0x275ade[_0x06a7('0x2b')],'sectionId':_0x275ade['id']},{})[_0x06a7('0x25')](function(){return _0x1307e8;});}else{return _0x1307e8;}})['catch'](function(_0x12873d){logger['error'](_0x06a7('0x4e'),_0x12873d);throw _0x12873d;});}return _0x1307e8;})['then'](respondWithResult(_0x26b91f,0xc9))['catch'](handleError(_0x26b91f,null));};exports['update']=function(_0x1176e2,_0x183c17){if(_0x1176e2[_0x06a7('0x4f')]['id']){delete _0x1176e2[_0x06a7('0x4f')]['id'];}return db[_0x06a7('0x2f')][_0x06a7('0x50')]({'where':{'id':_0x1176e2[_0x06a7('0x45')]['id']}})[_0x06a7('0x25')](handleEntityNotFound(_0x183c17,null))[_0x06a7('0x25')](saveUpdates(_0x1176e2['body'],null))['then'](respondWithResult(_0x183c17,null))[_0x06a7('0x43')](handleError(_0x183c17,null));};exports[_0x06a7('0x26')]=function(_0x2e0262,_0x3acde2){return db[_0x06a7('0x2f')][_0x06a7('0x50')]({'where':{'id':_0x2e0262['params']['id']}})[_0x06a7('0x25')](handleEntityNotFound(_0x3acde2,null))[_0x06a7('0x25')](removeEntity(_0x3acde2,null))[_0x06a7('0x43')](handleError(_0x3acde2,null));};exports[_0x06a7('0x51')]=function(_0xa6dd2,_0x5040ea){return db[_0x06a7('0x2f')]['describe']()[_0x06a7('0x25')](respondWithResult(_0x5040ea,null))[_0x06a7('0x43')](handleError(_0x5040ea,null));};exports[_0x06a7('0x52')]=function(_0x2c2baa,_0x3a7eb8,_0x3d6ddf){var _0x2222b7={'raw':!![],'where':{}},_0x33bfb1={},_0x4318bf;return db['FaxQueue']['findOne']({'where':{'id':_0x2c2baa[_0x06a7('0x45')]['id']}})['then'](handleEntityNotFound(_0x3a7eb8,null))[_0x06a7('0x25')](function(_0x5b9a71){if(_0x5b9a71){_0x4318bf=_0x5b9a71['get']({'plain':!![]});_0x33bfb1['model']=_[_0x06a7('0x34')](db[_0x06a7('0x53')][_0x06a7('0x46')]);_0x33bfb1['query']=_[_0x06a7('0x34')](_0x2c2baa[_0x06a7('0x36')]);_0x33bfb1[_0x06a7('0x3c')]=_[_0x06a7('0x35')](_0x33bfb1[_0x06a7('0x33')],_0x33bfb1['query']);_0x2222b7[_0x06a7('0x37')]=_[_0x06a7('0x35')](_0x33bfb1[_0x06a7('0x33')],qs['fields'](_0x2c2baa[_0x06a7('0x36')][_0x06a7('0x38')]));_0x2222b7['attributes']=_0x2222b7[_0x06a7('0x37')]['length']?_0x2222b7['attributes']:_0x33bfb1[_0x06a7('0x33')];if(!_0x2c2baa[_0x06a7('0x36')][_0x06a7('0x54')](_0x06a7('0x39'))){_0x2222b7['limit']=qs[_0x06a7('0x1f')](_0x2c2baa[_0x06a7('0x36')]['limit']);_0x2222b7[_0x06a7('0x21')]=qs[_0x06a7('0x21')](_0x2c2baa[_0x06a7('0x36')][_0x06a7('0x21')]);}_0x2222b7['order']=qs[_0x06a7('0x3b')](_0x2c2baa['query']['sort']);_0x2222b7[_0x06a7('0x3e')]=qs['filters'](_[_0x06a7('0x55')](_0x2c2baa[_0x06a7('0x36')],_0x33bfb1[_0x06a7('0x3c')]));_0x2222b7[_0x06a7('0x3e')][_0x06a7('0x56')]=_0x5b9a71['id'];if(_0x2c2baa[_0x06a7('0x36')]['filter']){_0x2222b7[_0x06a7('0x3e')]=_[_0x06a7('0x3f')](_0x2222b7['where'],{'$or':_[_0x06a7('0x2e')](_0x2222b7[_0x06a7('0x37')],function(_0x5623a4){var _0x1c6fb6={};_0x1c6fb6[_0x5623a4]={'$like':'%'+_0x2c2baa['query'][_0x06a7('0x3d')]+'%'};return _0x1c6fb6;})});}_0x2222b7=_[_0x06a7('0x3f')]({},_0x2222b7,_0x2c2baa[_0x06a7('0x40')]);return db[_0x06a7('0x53')][_0x06a7('0x41')](_0x2222b7);}})['then'](function(_0x927b81){if(_0x927b81){return db['User'][_0x06a7('0x57')]({'where':{'id':_['map'](_0x927b81,'UserId'),'role':_0x06a7('0x58')},'attributes':['id',_0x06a7('0x2b'),_0x06a7('0x59'),_0x06a7('0x5a'),_0x06a7('0x5b')]});}})['then'](function(_0x385d74){if(_0x385d74){return{'count':_0x385d74[_0x06a7('0x20')],'rows':_[_0x06a7('0x2e')](_0x385d74[_0x06a7('0x42')],function(_0x4f5245){return{'membername':_0x4f5245[_0x06a7('0x2b')],'UserId':_0x4f5245['id'],'queue_name':_0x4318bf[_0x06a7('0x2b')],'FaxQueueId':_0x4318bf['id'],'interface':util[_0x06a7('0x5c')](_0x06a7('0x5d'),_0x06a7('0x5e'),_0x4f5245['name']),'penalty':0x0,'paused':_0x4f5245['faxPause'],'createdAt':_0x4f5245[_0x06a7('0x5b')],'updatedAt':_0x4f5245['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x06a7('0x25')](respondWithFilteredResult(_0x3a7eb8,_0x2222b7))['catch'](handleError(_0x3a7eb8,null));};exports[_0x06a7('0x5f')]=function(_0x33edec,_0xa0a9e7,_0x3e15af){var _0x5bbc35={};var _0x231a0a={};var _0x3427ab;var _0x127d58;return db['FaxQueue'][_0x06a7('0x60')]({'where':{'id':_0x33edec['params']['id']}})['then'](handleEntityNotFound(_0xa0a9e7,null))[_0x06a7('0x25')](function(_0x4b46d1){if(_0x4b46d1){_0x3427ab=_0x4b46d1;_0x231a0a[_0x06a7('0x33')]=_[_0x06a7('0x34')](db[_0x06a7('0x61')]['rawAttributes']);_0x231a0a[_0x06a7('0x36')]=_[_0x06a7('0x34')](_0x33edec[_0x06a7('0x36')]);_0x231a0a[_0x06a7('0x3c')]=_[_0x06a7('0x35')](_0x231a0a[_0x06a7('0x33')],_0x231a0a[_0x06a7('0x36')]);_0x5bbc35[_0x06a7('0x37')]=_[_0x06a7('0x35')](_0x231a0a[_0x06a7('0x33')],qs[_0x06a7('0x38')](_0x33edec[_0x06a7('0x36')][_0x06a7('0x38')]));_0x5bbc35[_0x06a7('0x37')]=_0x5bbc35[_0x06a7('0x37')][_0x06a7('0x47')]?_0x5bbc35[_0x06a7('0x37')]:_0x231a0a[_0x06a7('0x33')];_0x5bbc35[_0x06a7('0x3a')]=qs[_0x06a7('0x3b')](_0x33edec['query']['sort']);_0x5bbc35[_0x06a7('0x3e')]=qs[_0x06a7('0x3c')](_[_0x06a7('0x55')](_0x33edec[_0x06a7('0x36')],_0x231a0a[_0x06a7('0x3c')]));if(_0x33edec[_0x06a7('0x36')][_0x06a7('0x3d')]){_0x5bbc35['where']=_[_0x06a7('0x3f')](_0x5bbc35[_0x06a7('0x3e')],{'$or':_[_0x06a7('0x2e')](_0x5bbc35[_0x06a7('0x37')],function(_0x46602f){var _0x557ad9={};_0x557ad9[_0x46602f]={'$like':'%'+_0x33edec[_0x06a7('0x36')]['filter']+'%'};return _0x557ad9;})});}_0x5bbc35=_[_0x06a7('0x3f')]({},_0x5bbc35,_0x33edec[_0x06a7('0x40')]);return _0x3427ab[_0x06a7('0x5f')](_0x5bbc35);}})[_0x06a7('0x25')](function(_0x4ba9bc){if(_0x4ba9bc){_0x127d58=_0x4ba9bc[_0x06a7('0x47')];if(!_0x33edec[_0x06a7('0x36')][_0x06a7('0x54')](_0x06a7('0x39'))){_0x5bbc35[_0x06a7('0x1f')]=qs[_0x06a7('0x1f')](_0x33edec[_0x06a7('0x36')]['limit']);_0x5bbc35[_0x06a7('0x21')]=qs[_0x06a7('0x21')](_0x33edec[_0x06a7('0x36')][_0x06a7('0x21')]);}return _0x3427ab[_0x06a7('0x5f')](_0x5bbc35);}})[_0x06a7('0x25')](function(_0x9e17eb){if(_0x9e17eb){return _0x9e17eb?{'count':_0x127d58,'rows':_0x9e17eb}:null;}})['then'](respondWithResult(_0xa0a9e7,null))['catch'](handleError(_0xa0a9e7,null));};exports[_0x06a7('0x62')]=function(_0x188feb,_0x4ffd6a,_0x589ce1){var _0x150831=_0x188feb[_0x06a7('0x4f')]['ids'];return db[_0x06a7('0x61')][_0x06a7('0x41')]({'where':{'id':_0x150831},'attributes':['id'],'include':[{'model':db[_0x06a7('0x63')],'as':_0x06a7('0x64'),'attributes':['id','name',_0x06a7('0x65'),_0x06a7('0x66'),'interface'],'raw':!![]}]})[_0x06a7('0x25')](function(_0x259200){if(_0x259200){var _0x27abf8=_[_0x06a7('0x67')](_0x259200,function(_0x256e32){var _0x49c86b=_0x256e32[_0x06a7('0x27')]({'plain':!![]});return _0x49c86b[_0x06a7('0x64')];});return db[_0x06a7('0x2f')][_0x06a7('0x50')]({'where':{'id':_0x188feb[_0x06a7('0x45')]['id']}})['then'](function(_0x7a33de){return db['sequelize'][_0x06a7('0x68')](function(_0x2eab29){return _0x7a33de[_0x06a7('0x62')](_0x150831,{'transaction':_0x2eab29})['then'](function(){return BPromise[_0x06a7('0x69')](_0x27abf8,function(_0x1b7b3b){return db[_0x06a7('0x53')][_0x06a7('0x6a')]({'where':{'UserId':_0x1b7b3b['id'],'FaxQueueId':_0x188feb[_0x06a7('0x45')]['id']},'transaction':_0x2eab29});});})[_0x06a7('0x25')](function(){_0x27abf8[_0x06a7('0x6b')](function(_0x1458f2){socket['emit'](_0x06a7('0x6c'),{'UserId':_0x1458f2['id'],'FaxQueueId':_0x7a33de['id']});});});});});}})[_0x06a7('0x25')](respondWithStatusCode(_0x4ffd6a,null))[_0x06a7('0x43')](handleError(_0x4ffd6a,null));};exports[_0x06a7('0x6d')]=function(_0x15d452,_0xdf2b25,_0x4a13a5){return db[_0x06a7('0x61')]['findAll']({'where':{'id':_0x15d452[_0x06a7('0x36')][_0x06a7('0x6e')]},'attributes':['id'],'include':[{'model':db[_0x06a7('0x63')],'as':'Agents','attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0xdf2b25,null))[_0x06a7('0x25')](function(_0xd67c53){var _0x3c7f2f=_[_0x06a7('0x2e')](_0xd67c53,'id');var _0x594411=[];var _0x1232d5=[];var _0x1788f1=squel['select']();_0x1788f1[_0x06a7('0x6f')](_0x06a7('0x70'))[_0x06a7('0x71')](_0x06a7('0x72'),'tq')[_0x06a7('0x73')](_0x06a7('0x74'),'ut',_0x06a7('0x75'))[_0x06a7('0x3e')](_0x06a7('0x76'),_0x15d452['params']['id']);for(var _0x1c8797=0x0;_0x1c8797<_0xd67c53[_0x06a7('0x47')];_0x1c8797+=0x1){let _0x544e26=_0xd67c53[_0x1c8797];for(var _0x4248d1=0x0;_0x4248d1<_0x544e26[_0x06a7('0x64')][_0x06a7('0x47')];_0x4248d1+=0x1){let _0x437507=_0x544e26['Agents'][_0x4248d1];var _0x844cfa=_0x1788f1[_0x06a7('0x77')]();_0x844cfa[_0x06a7('0x3e')](_0x06a7('0x78'),_0x437507['id']);_0x1232d5[_0x06a7('0x79')](db['sequelize'][_0x06a7('0x36')](_0x844cfa[_0x06a7('0x7a')](),{'type':db[_0x06a7('0x7b')][_0x06a7('0x7c')][_0x06a7('0x7d')]})[_0x06a7('0x25')](function(_0x2febfc){if(_0x2febfc[_0x06a7('0x47')]===0x1){return _0x437507['id'];}else{var _0x21dcc6=_[_0x06a7('0x7e')](_[_0x06a7('0x2e')](_0x2febfc,_0x06a7('0x7f')),function(_0x40742d){return _[_0x06a7('0x80')](_0x3c7f2f,_0x40742d);});if(_0x21dcc6){return _0x437507['id'];}}}));}}return BPromise[_0x06a7('0x81')](_0x1232d5)[_0x06a7('0x25')](function(_0x583ec5){_0x594411=_(_0x594411)[_0x06a7('0x82')](_0x583ec5)[_0x06a7('0x83')]()[_0x06a7('0x84')]();return db['FaxQueue'][_0x06a7('0x50')]({'where':{'id':_0x15d452[_0x06a7('0x45')]['id']}})[_0x06a7('0x25')](function(_0x1f7b5b){return db[_0x06a7('0x7b')][_0x06a7('0x68')](function(_0x3ed4f2){return _0x1f7b5b[_0x06a7('0x6d')](_0x15d452[_0x06a7('0x36')][_0x06a7('0x6e')],{'transaction':_0x3ed4f2})[_0x06a7('0x25')](function(){if(!_[_0x06a7('0x85')](_0x594411)){return _0x1f7b5b[_0x06a7('0x86')](_0x594411,{'transaction':_0x3ed4f2});}})['then'](function(){_0x594411['forEach'](function(_0x16d047){socket[_0x06a7('0x87')](_0x06a7('0x88'),{'UserId':_0x16d047,'FaxQueueId':_0x1f7b5b['id']});});});});});});})[_0x06a7('0x25')](respondWithStatusCode(_0xdf2b25,null))[_0x06a7('0x43')](handleError(_0xdf2b25,null));};exports[_0x06a7('0x89')]=function(_0x5085db,_0x504ed9,_0x551733){return db[_0x06a7('0x2f')][_0x06a7('0x50')]({'where':{'id':_0x5085db[_0x06a7('0x45')]['id']}})[_0x06a7('0x25')](handleEntityNotFound(_0x504ed9,null))[_0x06a7('0x25')](function(_0x1110bc){if(_0x1110bc){return _0x1110bc[_0x06a7('0x89')](_0x5085db[_0x06a7('0x4f')][_0x06a7('0x6e')],_['omit'](_0x5085db[_0x06a7('0x4f')],[_0x06a7('0x6e'),'id'])||{})[_0x06a7('0x8a')](function(_0x37d68a){for(var _0x264edc=0x0;_0x264edc<_0x5085db['body'][_0x06a7('0x6e')]['length'];_0x264edc+=0x1){socket[_0x06a7('0x87')](_0x06a7('0x6c'),{'UserId':Number(_0x5085db['body']['ids'][_0x264edc]),'FaxQueueId':Number(_0x5085db[_0x06a7('0x45')]['id'])});}return _0x37d68a;});}})['then'](respondWithResult(_0x504ed9,null))[_0x06a7('0x43')](handleError(_0x504ed9,null));};exports['removeAgents']=function(_0x5aa12c,_0x9712d,_0x26783c){return db['FaxQueue'][_0x06a7('0x50')]({'where':{'id':_0x5aa12c[_0x06a7('0x45')]['id']}})[_0x06a7('0x25')](handleEntityNotFound(_0x9712d,null))[_0x06a7('0x25')](function(_0x197d24){if(_0x197d24){return _0x197d24[_0x06a7('0x86')](_0x5aa12c[_0x06a7('0x36')][_0x06a7('0x6e')])[_0x06a7('0x25')](function(){if(_[_0x06a7('0x8b')](_0x5aa12c[_0x06a7('0x36')][_0x06a7('0x6e')])){for(var _0x25c245=0x0;_0x25c245<_0x5aa12c[_0x06a7('0x36')][_0x06a7('0x6e')]['length'];_0x25c245+=0x1){socket[_0x06a7('0x87')](_0x06a7('0x88'),{'UserId':Number(_0x5aa12c[_0x06a7('0x36')][_0x06a7('0x6e')][_0x25c245]),'FaxQueueId':Number(_0x5aa12c['params']['id'])});}}else{socket[_0x06a7('0x87')](_0x06a7('0x88'),{'UserId':Number(_0x5aa12c[_0x06a7('0x36')][_0x06a7('0x6e')]),'FaxQueueId':Number(_0x5aa12c[_0x06a7('0x45')]['id'])});}});}})[_0x06a7('0x25')](respondWithStatusCode(_0x9712d,null))[_0x06a7('0x43')](handleError(_0x9712d,null));};exports['getAgents']=function(_0x47f939,_0x217d5a,_0x117a71){var _0x41b1fc={};var _0x2ba84f={};var _0x19d0e9;var _0x166d11;return db[_0x06a7('0x2f')][_0x06a7('0x60')]({'where':{'id':_0x47f939[_0x06a7('0x45')]['id']}})[_0x06a7('0x25')](handleEntityNotFound(_0x217d5a,null))['then'](function(_0x216149){if(_0x216149){_0x19d0e9=_0x216149;_0x2ba84f[_0x06a7('0x33')]=_[_0x06a7('0x34')](db[_0x06a7('0x63')]['rawAttributes']);_0x2ba84f[_0x06a7('0x36')]=_[_0x06a7('0x34')](_0x47f939['query']);_0x2ba84f[_0x06a7('0x3c')]=_[_0x06a7('0x35')](_0x2ba84f['model'],_0x2ba84f[_0x06a7('0x36')]);_0x41b1fc['attributes']=_['intersection'](_0x2ba84f[_0x06a7('0x33')],qs[_0x06a7('0x38')](_0x47f939[_0x06a7('0x36')][_0x06a7('0x38')]));_0x41b1fc[_0x06a7('0x37')]=_0x41b1fc[_0x06a7('0x37')][_0x06a7('0x47')]?_0x41b1fc[_0x06a7('0x37')]:_0x2ba84f[_0x06a7('0x33')];_0x41b1fc[_0x06a7('0x3a')]=qs[_0x06a7('0x3b')](_0x47f939[_0x06a7('0x36')]['sort']);_0x41b1fc[_0x06a7('0x3e')]=qs[_0x06a7('0x3c')](_[_0x06a7('0x55')](_0x47f939['query'],_0x2ba84f[_0x06a7('0x3c')]));if(_0x47f939[_0x06a7('0x36')][_0x06a7('0x3d')]){_0x41b1fc[_0x06a7('0x3e')]=_['merge'](_0x41b1fc[_0x06a7('0x3e')],{'$or':_['map'](_0x41b1fc[_0x06a7('0x37')],function(_0x293aab){var _0xab6ee3={};_0xab6ee3[_0x293aab]={'$like':'%'+_0x47f939[_0x06a7('0x36')][_0x06a7('0x3d')]+'%'};return _0xab6ee3;})});}_0x41b1fc=_['merge']({},_0x41b1fc,_0x47f939['options']);return _0x19d0e9[_0x06a7('0x8c')](_0x41b1fc);}})['then'](function(_0x1063a0){if(_0x1063a0){_0x166d11=_0x1063a0['length'];if(!_0x47f939[_0x06a7('0x36')][_0x06a7('0x54')]('nolimit')){_0x41b1fc[_0x06a7('0x1f')]=qs['limit'](_0x47f939[_0x06a7('0x36')][_0x06a7('0x1f')]);_0x41b1fc[_0x06a7('0x21')]=qs[_0x06a7('0x21')](_0x47f939['query']['offset']);}return _0x19d0e9[_0x06a7('0x8c')](_0x41b1fc);}})[_0x06a7('0x25')](function(_0x2631d6){if(_0x2631d6){return _0x2631d6?{'count':_0x166d11,'rows':_0x2631d6}:null;}})[_0x06a7('0x25')](respondWithResult(_0x217d5a,null))[_0x06a7('0x43')](handleError(_0x217d5a,null));}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.events.js b/server/api/faxQueue/faxQueue.events.js index f04ba35..811a42f 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 _0x606d=['save','update','remove','emit','hasOwnProperty','hook','exports','events','FaxQueue'];(function(_0x4056fc,_0x230d63){var _0x57594e=function(_0xc342){while(--_0xc342){_0x4056fc['push'](_0x4056fc['shift']());}};_0x57594e(++_0x230d63);}(_0x606d,0x1ae));var _0xd606=function(_0x47ee34,_0x3658e6){_0x47ee34=_0x47ee34-0x0;var _0x1d54a9=_0x606d[_0x47ee34];return _0x1d54a9;};'use strict';var EventEmitter=require(_0xd606('0x0'));var FaxQueue=require('../../mysqldb')['db'][_0xd606('0x1')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xd606('0x2'),'afterUpdate':_0xd606('0x3'),'afterDestroy':_0xd606('0x4')};function emitEvent(_0x49f6c4){return function(_0x34754c,_0x75f62f,_0x51e87a){FaxQueueEvents[_0xd606('0x5')](_0x49f6c4+':'+_0x34754c['id'],_0x34754c);FaxQueueEvents[_0xd606('0x5')](_0x49f6c4,_0x34754c);_0x51e87a(null);};}for(var e in events){if(events[_0xd606('0x6')](e)){var event=events[e];FaxQueue[_0xd606('0x7')](e,emitEvent(event));}}module[_0xd606('0x8')]=FaxQueueEvents; \ No newline at end of file +var _0xb45c=['events','setMaxListeners','save','emit','hasOwnProperty','hook'];(function(_0x140931,_0x2ffeba){var _0x4718ab=function(_0x1f08f7){while(--_0x1f08f7){_0x140931['push'](_0x140931['shift']());}};_0x4718ab(++_0x2ffeba);}(_0xb45c,0x1c8));var _0xcb45=function(_0x372a27,_0x2b0fa4){_0x372a27=_0x372a27-0x0;var _0x361364=_0xb45c[_0x372a27];return _0x361364;};'use strict';var EventEmitter=require(_0xcb45('0x0'));var FaxQueue=require('../../mysqldb')['db']['FaxQueue'];var FaxQueueEvents=new EventEmitter();FaxQueueEvents[_0xcb45('0x1')](0x0);var events={'afterCreate':_0xcb45('0x2'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x5ab00a){return function(_0x4a801c,_0x4f8d61,_0x35bfe8){FaxQueueEvents[_0xcb45('0x3')](_0x5ab00a+':'+_0x4a801c['id'],_0x4a801c);FaxQueueEvents[_0xcb45('0x3')](_0x5ab00a,_0x4a801c);_0x35bfe8(null);};}for(var e in events){if(events[_0xcb45('0x4')](e)){var event=events[e];FaxQueue[_0xcb45('0x5')](e,emitEvent(event));}}module['exports']=FaxQueueEvents; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.model.js b/server/api/faxQueue/faxQueue.model.js index 2ad571b..eb13552 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 _0xdf44=['../../config/environment','./faxQueue.attributes','exports','define','FaxQueue','fax_queues','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x217987,_0x107a11){var _0x3bd9f1=function(_0x476378){while(--_0x476378){_0x217987['push'](_0x217987['shift']());}};_0x3bd9f1(++_0x107a11);}(_0xdf44,0x1f0));var _0x4df4=function(_0x9cd4c3,_0x1c9b2c){_0x9cd4c3=_0x9cd4c3-0x0;var _0x4c9025=_0xdf44[_0x9cd4c3];return _0x4c9025;};'use strict';var _=require(_0x4df4('0x0'));var util=require(_0x4df4('0x1'));var logger=require(_0x4df4('0x2'))(_0x4df4('0x3'));var moment=require(_0x4df4('0x4'));var BPromise=require(_0x4df4('0x5'));var rp=require(_0x4df4('0x6'));var fs=require('fs');var path=require(_0x4df4('0x7'));var rimraf=require('rimraf');var config=require(_0x4df4('0x8'));var attributes=require(_0x4df4('0x9'));module[_0x4df4('0xa')]=function(_0x7aaa66,_0x2b1cf2){return _0x7aaa66[_0x4df4('0xb')](_0x4df4('0xc'),attributes,{'tableName':_0x4df4('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xfc97=['./faxQueue.attributes','exports','define','FaxQueue','fax_queues','lodash','../../config/logger','bluebird','path','rimraf','../../config/environment'];(function(_0x24679e,_0x22d9d7){var _0x291f21=function(_0x329529){while(--_0x329529){_0x24679e['push'](_0x24679e['shift']());}};_0x291f21(++_0x22d9d7);}(_0xfc97,0x12e));var _0x7fc9=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xfc97[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0x7fc9('0x0'));var util=require('util');var logger=require(_0x7fc9('0x1'))('api');var moment=require('moment');var BPromise=require(_0x7fc9('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7fc9('0x3'));var rimraf=require(_0x7fc9('0x4'));var config=require(_0x7fc9('0x5'));var attributes=require(_0x7fc9('0x6'));module[_0x7fc9('0x7')]=function(_0x19ddbf,_0x397311){return _0x19ddbf[_0x7fc9('0x8')](_0x7fc9('0x9'),attributes,{'tableName':_0x7fc9('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 f4fcd2d..e0ca04c 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 _0xcf87=['rpc','../../config/environment','jayson/promise','client','http','redis','localhost','register','request','then','info','FaxQueue,\x20%s,\x20%s','FaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','catch','GetFaxQueue','FaxQueue','options','raw','include','model','map','attributes','debug','find','where','ShowFaxQueue','lodash','moment','bluebird','randomstring','ioredis','../../config/utils'];(function(_0x588a9c,_0x434e22){var _0x32ab03=function(_0x4928e5){while(--_0x4928e5){_0x588a9c['push'](_0x588a9c['shift']());}};_0x32ab03(++_0x434e22);}(_0xcf87,0x16c));var _0x7cf8=function(_0x60cdd3,_0x2c2932){_0x60cdd3=_0x60cdd3-0x0;var _0x5a3520=_0xcf87[_0x60cdd3];return _0x5a3520;};'use strict';var _=require(_0x7cf8('0x0'));var util=require('util');var moment=require(_0x7cf8('0x1'));var BPromise=require(_0x7cf8('0x2'));var rs=require(_0x7cf8('0x3'));var fs=require('fs');var Redis=require(_0x7cf8('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x7cf8('0x5'));var logger=require('../../config/logger')(_0x7cf8('0x6'));var config=require(_0x7cf8('0x7'));var jayson=require(_0x7cf8('0x8'));var client=jayson[_0x7cf8('0x9')][_0x7cf8('0xa')]({'port':0x232a});config['redis']=_['defaults'](config[_0x7cf8('0xb')],{'host':_0x7cf8('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./faxQueue.socket')[_0x7cf8('0xd')](socket);function respondWithRpcPromise(_0x250597,_0x452c75,_0x921c38){return new BPromise(function(_0x523260,_0xd6b1aa){return client[_0x7cf8('0xe')](_0x250597,_0x921c38)[_0x7cf8('0xf')](function(_0x194fc1){logger[_0x7cf8('0x10')](_0x7cf8('0x11'),_0x452c75,'request\x20sent');logger['debug'](_0x7cf8('0x12'),_0x452c75,'request\x20sent',JSON[_0x7cf8('0x13')](_0x194fc1));if(_0x194fc1[_0x7cf8('0x14')]){if(_0x194fc1[_0x7cf8('0x14')][_0x7cf8('0x15')]===0x1f4){logger[_0x7cf8('0x14')](_0x7cf8('0x11'),_0x452c75,_0x194fc1[_0x7cf8('0x14')][_0x7cf8('0x16')]);return _0xd6b1aa(_0x194fc1[_0x7cf8('0x14')]['message']);}logger[_0x7cf8('0x14')](_0x7cf8('0x11'),_0x452c75,_0x194fc1[_0x7cf8('0x14')][_0x7cf8('0x16')]);return _0x523260(_0x194fc1[_0x7cf8('0x14')][_0x7cf8('0x16')]);}else{logger['info'](_0x7cf8('0x11'),_0x452c75,_0x7cf8('0x17'));_0x523260(_0x194fc1['result'][_0x7cf8('0x16')]);}})[_0x7cf8('0x18')](function(_0x3f8259){logger[_0x7cf8('0x14')](_0x7cf8('0x11'),_0x452c75,_0x3f8259);_0xd6b1aa(_0x3f8259);});});}exports[_0x7cf8('0x19')]=function(_0x4b3452){var _0x43fa1f=this;return new Promise(function(_0x58095f,_0x236eaf){return db[_0x7cf8('0x1a')]['findAll']({'raw':_0x4b3452[_0x7cf8('0x1b')]?_0x4b3452['options'][_0x7cf8('0x1c')]===undefined?!![]:![]:!![],'where':_0x4b3452[_0x7cf8('0x1b')]?_0x4b3452[_0x7cf8('0x1b')]['where']||null:null,'attributes':_0x4b3452[_0x7cf8('0x1b')]?_0x4b3452['options']['attributes']||null:null,'limit':_0x4b3452[_0x7cf8('0x1b')]?_0x4b3452['options']['limit']||null:null,'include':_0x4b3452['options']?_0x4b3452[_0x7cf8('0x1b')][_0x7cf8('0x1d')]?_['map'](_0x4b3452['options']['include'],function(_0x1b64d3){return{'model':db[_0x1b64d3[_0x7cf8('0x1e')]],'as':_0x1b64d3['as'],'attributes':_0x1b64d3['attributes'],'include':_0x1b64d3[_0x7cf8('0x1d')]?_[_0x7cf8('0x1f')](_0x1b64d3[_0x7cf8('0x1d')],function(_0x47a320){return{'model':db[_0x47a320[_0x7cf8('0x1e')]],'as':_0x47a320['as'],'attributes':_0x47a320[_0x7cf8('0x20')],'include':_0x47a320['include']?_[_0x7cf8('0x1f')](_0x47a320['include'],function(_0x516dba){return{'model':db[_0x516dba['model']],'as':_0x516dba['as'],'attributes':_0x516dba['attributes']};}):[]};}):[]};}):[]:[]})[_0x7cf8('0xf')](function(_0x2e421e){logger[_0x7cf8('0x10')](_0x7cf8('0x19'),_0x4b3452);logger[_0x7cf8('0x21')](_0x7cf8('0x19'),_0x4b3452,JSON[_0x7cf8('0x13')](_0x2e421e));_0x58095f(_0x2e421e);})[_0x7cf8('0x18')](function(_0x3cb76e){logger[_0x7cf8('0x14')]('GetFaxQueue',_0x3cb76e[_0x7cf8('0x16')],_0x4b3452);_0x236eaf(_0x43fa1f[_0x7cf8('0x14')](0x1f4,_0x3cb76e[_0x7cf8('0x16')]));});});};exports['ShowFaxQueue']=function(_0x11cfc1){var _0x40a52f=this;return new Promise(function(_0x3a4b36,_0xb2c1e4){return db[_0x7cf8('0x1a')][_0x7cf8('0x22')]({'raw':_0x11cfc1['options']?_0x11cfc1['options'][_0x7cf8('0x1c')]===undefined?!![]:![]:!![],'where':_0x11cfc1[_0x7cf8('0x1b')]?_0x11cfc1['options'][_0x7cf8('0x23')]||null:null,'attributes':_0x11cfc1[_0x7cf8('0x1b')]?_0x11cfc1['options'][_0x7cf8('0x20')]||null:null,'include':_0x11cfc1[_0x7cf8('0x1b')]?_0x11cfc1['options']['include']?_[_0x7cf8('0x1f')](_0x11cfc1[_0x7cf8('0x1b')][_0x7cf8('0x1d')],function(_0x532c4d){return{'model':db[_0x532c4d[_0x7cf8('0x1e')]],'as':_0x532c4d['as'],'attributes':_0x532c4d[_0x7cf8('0x20')],'include':_0x532c4d[_0x7cf8('0x1d')]?_[_0x7cf8('0x1f')](_0x532c4d[_0x7cf8('0x1d')],function(_0x1b2f18){return{'model':db[_0x1b2f18[_0x7cf8('0x1e')]],'as':_0x1b2f18['as'],'attributes':_0x1b2f18[_0x7cf8('0x20')],'include':_0x1b2f18[_0x7cf8('0x1d')]?_['map'](_0x1b2f18[_0x7cf8('0x1d')],function(_0x3cb71d){return{'model':db[_0x3cb71d[_0x7cf8('0x1e')]],'as':_0x3cb71d['as'],'attributes':_0x3cb71d['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x590491){logger[_0x7cf8('0x10')]('ShowFaxQueue',_0x11cfc1);logger[_0x7cf8('0x21')](_0x7cf8('0x24'),_0x11cfc1,JSON['stringify'](_0x590491));_0x3a4b36(_0x590491);})[_0x7cf8('0x18')](function(_0x395806){logger[_0x7cf8('0x14')](_0x7cf8('0x24'),_0x395806[_0x7cf8('0x16')],_0x11cfc1);_0xb2c1e4(_0x40a52f[_0x7cf8('0x14')](0x1f4,_0x395806[_0x7cf8('0x16')]));});});}; \ No newline at end of file +var _0x0a85=['message','info','catch','FaxQueue','options','raw','where','attributes','limit','include','map','model','GetFaxQueue','ShowFaxQueue','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','jayson/promise','client','redis','defaults','localhost','./faxQueue.socket','request','then','FaxQueue,\x20%s,\x20%s','request\x20sent','debug','FaxQueue,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x155b5b,_0x12508e){var _0x4d570a=function(_0x3a10a9){while(--_0x3a10a9){_0x155b5b['push'](_0x155b5b['shift']());}};_0x4d570a(++_0x12508e);}(_0x0a85,0x10a));var _0x50a8=function(_0x28b544,_0x56568a){_0x28b544=_0x28b544-0x0;var _0x4773b3=_0x0a85[_0x28b544];return _0x4773b3;};'use strict';var _=require(_0x50a8('0x0'));var util=require(_0x50a8('0x1'));var moment=require(_0x50a8('0x2'));var BPromise=require(_0x50a8('0x3'));var rs=require(_0x50a8('0x4'));var fs=require('fs');var Redis=require(_0x50a8('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x50a8('0x6'));var logger=require(_0x50a8('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x50a8('0x8'));var client=jayson[_0x50a8('0x9')]['http']({'port':0x232a});config[_0x50a8('0xa')]=_[_0x50a8('0xb')](config[_0x50a8('0xa')],{'host':_0x50a8('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x50a8('0xa')]));require(_0x50a8('0xd'))['register'](socket);function respondWithRpcPromise(_0x56c46c,_0x18a182,_0x17b427){return new BPromise(function(_0x275a4d,_0x327e02){return client[_0x50a8('0xe')](_0x56c46c,_0x17b427)[_0x50a8('0xf')](function(_0x5f5378){logger['info'](_0x50a8('0x10'),_0x18a182,_0x50a8('0x11'));logger[_0x50a8('0x12')](_0x50a8('0x13'),_0x18a182,_0x50a8('0x11'),JSON[_0x50a8('0x14')](_0x5f5378));if(_0x5f5378[_0x50a8('0x15')]){if(_0x5f5378['error']['code']===0x1f4){logger[_0x50a8('0x15')](_0x50a8('0x10'),_0x18a182,_0x5f5378[_0x50a8('0x15')][_0x50a8('0x16')]);return _0x327e02(_0x5f5378[_0x50a8('0x15')][_0x50a8('0x16')]);}logger[_0x50a8('0x15')]('FaxQueue,\x20%s,\x20%s',_0x18a182,_0x5f5378[_0x50a8('0x15')][_0x50a8('0x16')]);return _0x275a4d(_0x5f5378['error']['message']);}else{logger[_0x50a8('0x17')]('FaxQueue,\x20%s,\x20%s',_0x18a182,_0x50a8('0x11'));_0x275a4d(_0x5f5378['result'][_0x50a8('0x16')]);}})[_0x50a8('0x18')](function(_0x1fdce2){logger[_0x50a8('0x15')](_0x50a8('0x10'),_0x18a182,_0x1fdce2);_0x327e02(_0x1fdce2);});});}exports['GetFaxQueue']=function(_0x3671e9){var _0x2dbc6c=this;return new Promise(function(_0x2d1045,_0x2a4457){return db[_0x50a8('0x19')]['findAll']({'raw':_0x3671e9['options']?_0x3671e9[_0x50a8('0x1a')][_0x50a8('0x1b')]===undefined?!![]:![]:!![],'where':_0x3671e9[_0x50a8('0x1a')]?_0x3671e9[_0x50a8('0x1a')][_0x50a8('0x1c')]||null:null,'attributes':_0x3671e9[_0x50a8('0x1a')]?_0x3671e9['options'][_0x50a8('0x1d')]||null:null,'limit':_0x3671e9['options']?_0x3671e9['options'][_0x50a8('0x1e')]||null:null,'include':_0x3671e9[_0x50a8('0x1a')]?_0x3671e9['options'][_0x50a8('0x1f')]?_[_0x50a8('0x20')](_0x3671e9['options'][_0x50a8('0x1f')],function(_0x57a4d1){return{'model':db[_0x57a4d1[_0x50a8('0x21')]],'as':_0x57a4d1['as'],'attributes':_0x57a4d1[_0x50a8('0x1d')],'include':_0x57a4d1[_0x50a8('0x1f')]?_[_0x50a8('0x20')](_0x57a4d1[_0x50a8('0x1f')],function(_0x54ae0c){return{'model':db[_0x54ae0c[_0x50a8('0x21')]],'as':_0x54ae0c['as'],'attributes':_0x54ae0c[_0x50a8('0x1d')],'include':_0x54ae0c['include']?_[_0x50a8('0x20')](_0x54ae0c[_0x50a8('0x1f')],function(_0x5d803d){return{'model':db[_0x5d803d[_0x50a8('0x21')]],'as':_0x5d803d['as'],'attributes':_0x5d803d[_0x50a8('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x50a8('0xf')](function(_0x57fa3b){logger[_0x50a8('0x17')](_0x50a8('0x22'),_0x3671e9);logger['debug'](_0x50a8('0x22'),_0x3671e9,JSON[_0x50a8('0x14')](_0x57fa3b));_0x2d1045(_0x57fa3b);})[_0x50a8('0x18')](function(_0x2ecd2a){logger[_0x50a8('0x15')](_0x50a8('0x22'),_0x2ecd2a['message'],_0x3671e9);_0x2a4457(_0x2dbc6c[_0x50a8('0x15')](0x1f4,_0x2ecd2a[_0x50a8('0x16')]));});});};exports[_0x50a8('0x23')]=function(_0x28f14a){var _0xfd13a=this;return new Promise(function(_0x1c2782,_0x19a4a9){return db['FaxQueue']['find']({'raw':_0x28f14a[_0x50a8('0x1a')]?_0x28f14a[_0x50a8('0x1a')][_0x50a8('0x1b')]===undefined?!![]:![]:!![],'where':_0x28f14a[_0x50a8('0x1a')]?_0x28f14a[_0x50a8('0x1a')][_0x50a8('0x1c')]||null:null,'attributes':_0x28f14a[_0x50a8('0x1a')]?_0x28f14a['options'][_0x50a8('0x1d')]||null:null,'include':_0x28f14a[_0x50a8('0x1a')]?_0x28f14a[_0x50a8('0x1a')][_0x50a8('0x1f')]?_[_0x50a8('0x20')](_0x28f14a[_0x50a8('0x1a')][_0x50a8('0x1f')],function(_0x8db04){return{'model':db[_0x8db04[_0x50a8('0x21')]],'as':_0x8db04['as'],'attributes':_0x8db04[_0x50a8('0x1d')],'include':_0x8db04[_0x50a8('0x1f')]?_[_0x50a8('0x20')](_0x8db04[_0x50a8('0x1f')],function(_0x431b2f){return{'model':db[_0x431b2f[_0x50a8('0x21')]],'as':_0x431b2f['as'],'attributes':_0x431b2f[_0x50a8('0x1d')],'include':_0x431b2f['include']?_[_0x50a8('0x20')](_0x431b2f['include'],function(_0x50421c){return{'model':db[_0x50421c[_0x50a8('0x21')]],'as':_0x50421c['as'],'attributes':_0x50421c[_0x50a8('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x50a8('0xf')](function(_0x347607){logger[_0x50a8('0x17')]('ShowFaxQueue',_0x28f14a);logger[_0x50a8('0x12')](_0x50a8('0x23'),_0x28f14a,JSON[_0x50a8('0x14')](_0x347607));_0x1c2782(_0x347607);})[_0x50a8('0x18')](function(_0x10728a){logger[_0x50a8('0x15')]('ShowFaxQueue',_0x10728a[_0x50a8('0x16')],_0x28f14a);_0x19a4a9(_0xfd13a[_0x50a8('0x15')](0x1f4,_0x10728a[_0x50a8('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.socket.js b/server/api/faxQueue/faxQueue.socket.js index dd8593c..b8fdbf7 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 _0x919e=['save','remove','emit','removeListener','register','length','faxQueue:','./faxQueue.events'];(function(_0x448f35,_0x34b240){var _0x559eaa=function(_0x5c938f){while(--_0x5c938f){_0x448f35['push'](_0x448f35['shift']());}};_0x559eaa(++_0x34b240);}(_0x919e,0x1d7));var _0xe919=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x919e[_0x3dd15e];return _0x231fd0;};'use strict';var FaxQueueEvents=require(_0xe919('0x0'));var events=[_0xe919('0x1'),_0xe919('0x2'),'update'];function createListener(_0x115b01,_0x55cc54){return function(_0x4f9fcd){_0x55cc54[_0xe919('0x3')](_0x115b01,_0x4f9fcd);};}function removeListener(_0x3a1192,_0x2bf552){return function(){FaxQueueEvents[_0xe919('0x4')](_0x3a1192,_0x2bf552);};}exports[_0xe919('0x5')]=function(_0x5a27ad){for(var _0x1225a5=0x0,_0x493b47=events[_0xe919('0x6')];_0x1225a5<_0x493b47;_0x1225a5++){var _0x2ceb41=events[_0x1225a5];var _0x57c3fe=createListener(_0xe919('0x7')+_0x2ceb41,_0x5a27ad);FaxQueueEvents['on'](_0x2ceb41,_0x57c3fe);}}; \ No newline at end of file +var _0x7c1e=['removeListener','register','length','faxQueue:','./faxQueue.events','emit'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x7c1e,0x112));var _0xe7c1=function(_0x1c4554,_0x8341f2){_0x1c4554=_0x1c4554-0x0;var _0x2624f0=_0x7c1e[_0x1c4554];return _0x2624f0;};'use strict';var FaxQueueEvents=require(_0xe7c1('0x0'));var events=['save','remove','update'];function createListener(_0x167766,_0x430797){return function(_0x2b681f){_0x430797[_0xe7c1('0x1')](_0x167766,_0x2b681f);};}function removeListener(_0x2b91ba,_0x459c5c){return function(){FaxQueueEvents[_0xe7c1('0x2')](_0x2b91ba,_0x459c5c);};}exports[_0xe7c1('0x3')]=function(_0x2a15c7){for(var _0x4ee50f=0x0,_0x1108b9=events[_0xe7c1('0x4')];_0x4ee50f<_0x1108b9;_0x4ee50f++){var _0x57b0b8=events[_0x4ee50f];var _0x2e1a06=createListener(_0xe7c1('0x5')+_0x57b0b8,_0x2a15c7);FaxQueueEvents['on'](_0x57b0b8,_0x2e1a06);}}; \ No newline at end of file diff --git a/server/api/faxQueue/index.js b/server/api/faxQueue/index.js index 4c1fc92..b2e56d3 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 _0xe3da=['/:id/users','getAgents','create','post','/:id/teams','addTeams','addAgents','put','/:id','update','destroy','removeAgents','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxQueue.controller','get','isAuthenticated','index','/describe','describe','show','/:id/members','getMembers'];(function(_0xf9a79e,_0x493943){var _0x15cc64=function(_0x3f66da){while(--_0x3f66da){_0xf9a79e['push'](_0xf9a79e['shift']());}};_0x15cc64(++_0x493943);}(_0xe3da,0x1cd));var _0xae3d=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xe3da[_0x2641f9];return _0x585741;};'use strict';var multer=require(_0xae3d('0x0'));var util=require(_0xae3d('0x1'));var path=require(_0xae3d('0x2'));var timeout=require(_0xae3d('0x3'));var express=require(_0xae3d('0x4'));var router=express[_0xae3d('0x5')]();var fs_extra=require(_0xae3d('0x6'));var auth=require(_0xae3d('0x7'));var interaction=require(_0xae3d('0x8'));var config=require(_0xae3d('0x9'));var controller=require(_0xae3d('0xa'));router[_0xae3d('0xb')]('/',auth[_0xae3d('0xc')](),controller[_0xae3d('0xd')]);router[_0xae3d('0xb')](_0xae3d('0xe'),auth['isAuthenticated'](),controller[_0xae3d('0xf')]);router[_0xae3d('0xb')]('/:id',auth['isAuthenticated'](),controller[_0xae3d('0x10')]);router[_0xae3d('0xb')](_0xae3d('0x11'),auth[_0xae3d('0xc')](),controller[_0xae3d('0x12')]);router[_0xae3d('0xb')]('/:id/teams',auth[_0xae3d('0xc')](),controller['getTeams']);router[_0xae3d('0xb')](_0xae3d('0x13'),auth[_0xae3d('0xc')](),controller[_0xae3d('0x14')]);router['post']('/',auth[_0xae3d('0xc')](),controller[_0xae3d('0x15')]);router[_0xae3d('0x16')](_0xae3d('0x17'),auth[_0xae3d('0xc')](),controller[_0xae3d('0x18')]);router[_0xae3d('0x16')]('/:id/users',auth[_0xae3d('0xc')](),controller[_0xae3d('0x19')]);router[_0xae3d('0x1a')](_0xae3d('0x1b'),auth[_0xae3d('0xc')](),controller[_0xae3d('0x1c')]);router['delete'](_0xae3d('0x1b'),auth[_0xae3d('0xc')](),controller[_0xae3d('0x1d')]);router['delete'](_0xae3d('0x17'),auth[_0xae3d('0xc')](),controller['removeTeams']);router['delete'](_0xae3d('0x13'),auth[_0xae3d('0xc')](),controller[_0xae3d('0x1e')]);module[_0xae3d('0x1f')]=router; \ No newline at end of file +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(_0x407147,_0x2b5b58){var _0x5e3a42=function(_0x4132c5){while(--_0x4132c5){_0x407147['push'](_0x407147['shift']());}};_0x5e3a42(++_0x2b5b58);}(_0xd046,0x129));var _0x6d04=function(_0x293ced,_0x5347b6){_0x293ced=_0x293ced-0x0;var _0x5e7315=_0xd046[_0x293ced];return _0x5e7315;};'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 diff --git a/server/api/faxQueueReport/faxQueueReport.attributes.js b/server/api/faxQueueReport/faxQueueReport.attributes.js index 1a57a3b..79926ef 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 _0xccba=['exports','STRING','DATE','moment','sequelize'];(function(_0x3304a4,_0x4ad5b1){var _0x1b0266=function(_0x1c0de4){while(--_0x1c0de4){_0x3304a4['push'](_0x3304a4['shift']());}};_0x1b0266(++_0x4ad5b1);}(_0xccba,0x120));var _0xaccb=function(_0x5e3b04,_0xbb6795){_0x5e3b04=_0x5e3b04-0x0;var _0x1fc44d=_0xccba[_0x5e3b04];return _0x1fc44d;};'use strict';var moment=require(_0xaccb('0x0'));var Sequelize=require(_0xaccb('0x1'));module[_0xaccb('0x2')]={'uniqueid':{'type':Sequelize[_0xaccb('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0xaccb('0x3')]},'joinAt':{'type':Sequelize[_0xaccb('0x4')]},'leaveAt':{'type':Sequelize[_0xaccb('0x4')]},'acceptAt':{'type':Sequelize[_0xaccb('0x4')]},'exitAt':{'type':Sequelize[_0xaccb('0x4')]},'reason':{'type':Sequelize[_0xaccb('0x3')]}}; \ No newline at end of file +var _0x86db=['moment','sequelize','STRING','DATE'];(function(_0x513337,_0x3fa228){var _0x5c09fc=function(_0x24fd49){while(--_0x24fd49){_0x513337['push'](_0x513337['shift']());}};_0x5c09fc(++_0x3fa228);}(_0x86db,0xf4));var _0xb86d=function(_0x2eade5,_0x5593b8){_0x2eade5=_0x2eade5-0x0;var _0x1e9966=_0x86db[_0x2eade5];return _0x1e9966;};'use strict';var moment=require(_0xb86d('0x0'));var Sequelize=require(_0xb86d('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0xb86d('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0xb86d('0x2')]},'joinAt':{'type':Sequelize[_0xb86d('0x3')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0xb86d('0x3')]},'reason':{'type':Sequelize[_0xb86d('0x2')]}}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.controller.js b/server/api/faxQueueReport/faxQueueReport.controller.js index d88e01d..29ab098 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 _0xbe31=['../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','index','map','fieldName','type','key','model','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','sort','filter','where','merge','VIRTUAL','FaxQueueReport','includeAll','include','findAll','catch','show','keys','options','find','create','body','params','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils'];(function(_0x348b87,_0x4cf8f6){var _0x53464d=function(_0x47b9eb){while(--_0x47b9eb){_0x348b87['push'](_0x348b87['shift']());}};_0x53464d(++_0x4cf8f6);}(_0xbe31,0x83));var _0x1be3=function(_0x38f517,_0x444548){_0x38f517=_0x38f517-0x0;var _0x5e370b=_0xbe31[_0x38f517];return _0x5e370b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1be3('0x0'));var zipdir=require(_0x1be3('0x1'));var jsonpatch=require(_0x1be3('0x2'));var rp=require(_0x1be3('0x3'));var moment=require(_0x1be3('0x4'));var BPromise=require(_0x1be3('0x5'));var Mustache=require(_0x1be3('0x6'));var util=require(_0x1be3('0x7'));var path=require(_0x1be3('0x8'));var sox=require('sox');var csv=require(_0x1be3('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1be3('0xa'));var _=require(_0x1be3('0xb'));var squel=require(_0x1be3('0xc'));var crypto=require(_0x1be3('0xd'));var jsforce=require(_0x1be3('0xe'));var deskjs=require(_0x1be3('0xf'));var toCsv=require(_0x1be3('0x9'));var querystring=require(_0x1be3('0x10'));var Papa=require(_0x1be3('0x11'));var Redis=require(_0x1be3('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x1be3('0x13'));var as=require(_0x1be3('0x14'));var hardwareService=require(_0x1be3('0x15'));var logger=require(_0x1be3('0x16'))(_0x1be3('0x17'));var utils=require(_0x1be3('0x18'));var config=require(_0x1be3('0x19'));var licenseUtil=require(_0x1be3('0x1a'));var db=require(_0x1be3('0x1b'))['db'];function respondWithStatusCode(_0x50552d,_0x3601f7){_0x3601f7=_0x3601f7||0xcc;return function(_0x492f66){if(_0x492f66){return _0x50552d[_0x1be3('0x1c')](_0x3601f7);}return _0x50552d[_0x1be3('0x1d')](_0x3601f7)['end']();};}function respondWithResult(_0x26f888,_0x573684){_0x573684=_0x573684||0xc8;return function(_0xc7cc3){if(_0xc7cc3){return _0x26f888[_0x1be3('0x1d')](_0x573684)[_0x1be3('0x1e')](_0xc7cc3);}};}function respondWithFilteredResult(_0xd30cd,_0x1156bc){return function(_0x269ac3){if(_0x269ac3){var _0x567919=typeof _0x1156bc['offset']==='undefined'&&typeof _0x1156bc['limit']===_0x1be3('0x1f');var _0x4ebba6=_0x269ac3[_0x1be3('0x20')];var _0x6b7edf=_0x567919?0x0:_0x1156bc[_0x1be3('0x21')];var _0x1d0c2b=_0x567919?_0x269ac3[_0x1be3('0x20')]:_0x1156bc[_0x1be3('0x21')]+_0x1156bc[_0x1be3('0x22')];var _0x41c2af;if(_0x1d0c2b>=_0x4ebba6){_0x1d0c2b=_0x4ebba6;_0x41c2af=0xc8;}else{_0x41c2af=0xce;}_0xd30cd[_0x1be3('0x1d')](_0x41c2af);return _0xd30cd[_0x1be3('0x23')](_0x1be3('0x24'),_0x6b7edf+'-'+_0x1d0c2b+'/'+_0x4ebba6)[_0x1be3('0x1e')](_0x269ac3);}return null;};}function patchUpdates(_0x57c78c){return function(_0x49123f){try{jsonpatch[_0x1be3('0x25')](_0x49123f,_0x57c78c,!![]);}catch(_0x4cacb9){return BPromise[_0x1be3('0x26')](_0x4cacb9);}return _0x49123f[_0x1be3('0x27')]();};}function saveUpdates(_0x4366e8,_0x3bd167){return function(_0x3c0564){if(_0x3c0564){return _0x3c0564[_0x1be3('0x28')](_0x4366e8)[_0x1be3('0x29')](function(_0x57c192){return _0x57c192;});}return null;};}function removeEntity(_0x186b8a,_0x48862c){return function(_0x237a6c){if(_0x237a6c){return _0x237a6c[_0x1be3('0x2a')]()['then'](function(){_0x186b8a[_0x1be3('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x134d79,_0x12023d){return function(_0x393f98){if(!_0x393f98){_0x134d79[_0x1be3('0x1c')](0x194);}return _0x393f98;};}function handleError(_0x4ce12f,_0x1e2943){_0x1e2943=_0x1e2943||0x1f4;return function(_0x8d1f58){logger['error'](_0x8d1f58[_0x1be3('0x2b')]);if(_0x8d1f58[_0x1be3('0x2c')]){delete _0x8d1f58[_0x1be3('0x2c')];}_0x4ce12f[_0x1be3('0x1d')](_0x1e2943)[_0x1be3('0x2d')](_0x8d1f58);};}exports[_0x1be3('0x2e')]=function(_0x5d35cf,_0x5bb993){var _0x49f0e0={},_0x25ed26={},_0x4be26f={'count':0x0,'rows':[]};var _0x28dd78=_[_0x1be3('0x2f')](db['FaxQueueReport']['rawAttributes'],function(_0x49f780){return{'name':_0x49f780[_0x1be3('0x30')],'type':_0x49f780[_0x1be3('0x31')][_0x1be3('0x32')]};});_0x25ed26[_0x1be3('0x33')]=_[_0x1be3('0x2f')](_0x28dd78,'name');_0x25ed26['query']=_['keys'](_0x5d35cf['query']);_0x25ed26[_0x1be3('0x34')]=_[_0x1be3('0x35')](_0x25ed26[_0x1be3('0x33')],_0x25ed26[_0x1be3('0x36')]);_0x49f0e0[_0x1be3('0x37')]=_[_0x1be3('0x35')](_0x25ed26[_0x1be3('0x33')],qs['fields'](_0x5d35cf[_0x1be3('0x36')][_0x1be3('0x38')]));_0x49f0e0[_0x1be3('0x37')]=_0x49f0e0[_0x1be3('0x37')][_0x1be3('0x39')]?_0x49f0e0[_0x1be3('0x37')]:_0x25ed26[_0x1be3('0x33')];if(!_0x5d35cf['query'][_0x1be3('0x3a')](_0x1be3('0x3b'))){_0x49f0e0[_0x1be3('0x22')]=qs['limit'](_0x5d35cf['query'][_0x1be3('0x22')]);_0x49f0e0[_0x1be3('0x21')]=qs[_0x1be3('0x21')](_0x5d35cf['query']['offset']);}_0x49f0e0['order']=qs[_0x1be3('0x3c')](_0x5d35cf[_0x1be3('0x36')][_0x1be3('0x3c')]);_0x49f0e0['where']=qs[_0x1be3('0x34')](_['pick'](_0x5d35cf[_0x1be3('0x36')],_0x25ed26[_0x1be3('0x34')]),_0x28dd78);if(_0x5d35cf['query'][_0x1be3('0x3d')]){_0x49f0e0[_0x1be3('0x3e')]=_[_0x1be3('0x3f')](_0x49f0e0[_0x1be3('0x3e')],{'$or':_[_0x1be3('0x2f')](_0x28dd78,function(_0x525ace){if(_0x525ace[_0x1be3('0x31')]!==_0x1be3('0x40')){var _0x39b8d9={};_0x39b8d9[_0x525ace['name']]={'$like':'%'+_0x5d35cf['query'][_0x1be3('0x3d')]+'%'};return _0x39b8d9;}})});}_0x49f0e0=_[_0x1be3('0x3f')]({},_0x49f0e0,_0x5d35cf['options']);var _0x40b38e={'where':_0x49f0e0['where']};return db[_0x1be3('0x41')][_0x1be3('0x20')](_0x40b38e)['then'](function(_0x55948b){_0x4be26f['count']=_0x55948b;if(_0x5d35cf[_0x1be3('0x36')][_0x1be3('0x42')]){_0x49f0e0[_0x1be3('0x43')]=[{'all':!![]}];}return db[_0x1be3('0x41')][_0x1be3('0x44')](_0x49f0e0);})['then'](function(_0x43b89d){_0x4be26f['rows']=_0x43b89d;return _0x4be26f;})[_0x1be3('0x29')](respondWithFilteredResult(_0x5bb993,_0x49f0e0))[_0x1be3('0x45')](handleError(_0x5bb993,null));};exports[_0x1be3('0x46')]=function(_0x3e8bd2,_0x371659){var _0x51da91={'raw':!![],'where':{'id':_0x3e8bd2['params']['id']}},_0x31ad7e={};_0x31ad7e[_0x1be3('0x33')]=_[_0x1be3('0x47')](db[_0x1be3('0x41')]['rawAttributes']);_0x31ad7e[_0x1be3('0x36')]=_[_0x1be3('0x47')](_0x3e8bd2[_0x1be3('0x36')]);_0x31ad7e[_0x1be3('0x34')]=_['intersection'](_0x31ad7e['model'],_0x31ad7e[_0x1be3('0x36')]);_0x51da91[_0x1be3('0x37')]=_[_0x1be3('0x35')](_0x31ad7e[_0x1be3('0x33')],qs[_0x1be3('0x38')](_0x3e8bd2['query'][_0x1be3('0x38')]));_0x51da91['attributes']=_0x51da91[_0x1be3('0x37')][_0x1be3('0x39')]?_0x51da91['attributes']:_0x31ad7e['model'];if(_0x3e8bd2[_0x1be3('0x36')]['includeAll']){_0x51da91['include']=[{'all':!![]}];}_0x51da91=_[_0x1be3('0x3f')]({},_0x51da91,_0x3e8bd2[_0x1be3('0x48')]);return db[_0x1be3('0x41')][_0x1be3('0x49')](_0x51da91)[_0x1be3('0x29')](handleEntityNotFound(_0x371659,null))['then'](respondWithResult(_0x371659,null))[_0x1be3('0x45')](handleError(_0x371659,null));};exports[_0x1be3('0x4a')]=function(_0x36475a,_0x584617){return db[_0x1be3('0x41')][_0x1be3('0x4a')](_0x36475a[_0x1be3('0x4b')],{})['then'](respondWithResult(_0x584617,0xc9))[_0x1be3('0x45')](handleError(_0x584617,null));};exports[_0x1be3('0x28')]=function(_0x5160b2,_0x495d2b){if(_0x5160b2['body']['id']){delete _0x5160b2['body']['id'];}return db[_0x1be3('0x41')][_0x1be3('0x49')]({'where':{'id':_0x5160b2[_0x1be3('0x4c')]['id']}})[_0x1be3('0x29')](handleEntityNotFound(_0x495d2b,null))[_0x1be3('0x29')](saveUpdates(_0x5160b2[_0x1be3('0x4b')],null))[_0x1be3('0x29')](respondWithResult(_0x495d2b,null))[_0x1be3('0x45')](handleError(_0x495d2b,null));};exports[_0x1be3('0x2a')]=function(_0x116c44,_0x55514e){return db[_0x1be3('0x41')][_0x1be3('0x49')]({'where':{'id':_0x116c44[_0x1be3('0x4c')]['id']}})[_0x1be3('0x29')](handleEntityNotFound(_0x55514e,null))[_0x1be3('0x29')](removeEntity(_0x55514e,null))[_0x1be3('0x45')](handleError(_0x55514e,null));};exports['describe']=function(_0x43ce9e,_0x50a137){return db[_0x1be3('0x41')][_0x1be3('0x4d')]()[_0x1be3('0x29')](respondWithResult(_0x50a137,null))[_0x1be3('0x45')](handleError(_0x50a137,null));}; \ No newline at end of file +var _0xf323=['merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','keys','length','find','catch','create','body','describe','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','limit','undefined','offset','count','set','Content-Range','json','reject','update','destroy','then','end','error','stack','name','index','map','FaxQueueReport','rawAttributes','type','key','model','query','filters','intersection','attributes','fields','order','sort','where','pick'];(function(_0x55b238,_0x83f467){var _0x2e4af0=function(_0x104a83){while(--_0x104a83){_0x55b238['push'](_0x55b238['shift']());}};_0x2e4af0(++_0x83f467);}(_0xf323,0x1c6));var _0x3f32=function(_0xd4967e,_0x48b5e3){_0xd4967e=_0xd4967e-0x0;var _0x331d13=_0xf323[_0xd4967e];return _0x331d13;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x3f32('0x0'));var jsonpatch=require(_0x3f32('0x1'));var rp=require('request-promise');var moment=require(_0x3f32('0x2'));var BPromise=require(_0x3f32('0x3'));var Mustache=require(_0x3f32('0x4'));var util=require(_0x3f32('0x5'));var path=require(_0x3f32('0x6'));var sox=require('sox');var csv=require(_0x3f32('0x7'));var ejs=require(_0x3f32('0x8'));var fs=require('fs');var fs_extra=require(_0x3f32('0x9'));var _=require(_0x3f32('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x3f32('0xb'));var deskjs=require(_0x3f32('0xc'));var toCsv=require(_0x3f32('0x7'));var querystring=require(_0x3f32('0xd'));var Papa=require(_0x3f32('0xe'));var Redis=require(_0x3f32('0xf'));var authService=require(_0x3f32('0x10'));var qs=require(_0x3f32('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3f32('0x12'));var logger=require(_0x3f32('0x13'))(_0x3f32('0x14'));var utils=require('../../config/utils');var config=require(_0x3f32('0x15'));var licenseUtil=require(_0x3f32('0x16'));var db=require(_0x3f32('0x17'))['db'];function respondWithStatusCode(_0x2b1aa3,_0x5c876b){_0x5c876b=_0x5c876b||0xcc;return function(_0x4d7e41){if(_0x4d7e41){return _0x2b1aa3[_0x3f32('0x18')](_0x5c876b);}return _0x2b1aa3[_0x3f32('0x19')](_0x5c876b)['end']();};}function respondWithResult(_0x4097b4,_0x22b00){_0x22b00=_0x22b00||0xc8;return function(_0xc68dd5){if(_0xc68dd5){return _0x4097b4['status'](_0x22b00)['json'](_0xc68dd5);}};}function respondWithFilteredResult(_0x360b1b,_0x1de24c){return function(_0x1adaa5){if(_0x1adaa5){var _0x219d91=typeof _0x1de24c['offset']==='undefined'&&typeof _0x1de24c[_0x3f32('0x1a')]===_0x3f32('0x1b');var _0x3a8e7b=_0x1adaa5['count'];var _0x5c36d9=_0x219d91?0x0:_0x1de24c[_0x3f32('0x1c')];var _0x19ec90=_0x219d91?_0x1adaa5[_0x3f32('0x1d')]:_0x1de24c[_0x3f32('0x1c')]+_0x1de24c[_0x3f32('0x1a')];var _0x517e49;if(_0x19ec90>=_0x3a8e7b){_0x19ec90=_0x3a8e7b;_0x517e49=0xc8;}else{_0x517e49=0xce;}_0x360b1b[_0x3f32('0x19')](_0x517e49);return _0x360b1b[_0x3f32('0x1e')](_0x3f32('0x1f'),_0x5c36d9+'-'+_0x19ec90+'/'+_0x3a8e7b)[_0x3f32('0x20')](_0x1adaa5);}return null;};}function patchUpdates(_0xbc366b){return function(_0x2e698a){try{jsonpatch['apply'](_0x2e698a,_0xbc366b,!![]);}catch(_0x1e2d85){return BPromise[_0x3f32('0x21')](_0x1e2d85);}return _0x2e698a['save']();};}function saveUpdates(_0x1874e4,_0x21cf2e){return function(_0x3ddf25){if(_0x3ddf25){return _0x3ddf25[_0x3f32('0x22')](_0x1874e4)['then'](function(_0x1ea58b){return _0x1ea58b;});}return null;};}function removeEntity(_0x20f7d1,_0x4eb2ad){return function(_0x416015){if(_0x416015){return _0x416015[_0x3f32('0x23')]()[_0x3f32('0x24')](function(){_0x20f7d1[_0x3f32('0x19')](0xcc)[_0x3f32('0x25')]();});}};}function handleEntityNotFound(_0x11f4ab,_0x28bff4){return function(_0x38de66){if(!_0x38de66){_0x11f4ab[_0x3f32('0x18')](0x194);}return _0x38de66;};}function handleError(_0x3130de,_0x30ef37){_0x30ef37=_0x30ef37||0x1f4;return function(_0x5b5e9d){logger[_0x3f32('0x26')](_0x5b5e9d[_0x3f32('0x27')]);if(_0x5b5e9d['name']){delete _0x5b5e9d[_0x3f32('0x28')];}_0x3130de['status'](_0x30ef37)['send'](_0x5b5e9d);};}exports[_0x3f32('0x29')]=function(_0x785270,_0x1ee79e){var _0x320972={},_0x20b333={},_0x36623c={'count':0x0,'rows':[]};var _0x293c05=_[_0x3f32('0x2a')](db[_0x3f32('0x2b')][_0x3f32('0x2c')],function(_0x448bf7){return{'name':_0x448bf7['fieldName'],'type':_0x448bf7[_0x3f32('0x2d')][_0x3f32('0x2e')]};});_0x20b333[_0x3f32('0x2f')]=_[_0x3f32('0x2a')](_0x293c05,'name');_0x20b333['query']=_['keys'](_0x785270[_0x3f32('0x30')]);_0x20b333[_0x3f32('0x31')]=_[_0x3f32('0x32')](_0x20b333[_0x3f32('0x2f')],_0x20b333[_0x3f32('0x30')]);_0x320972[_0x3f32('0x33')]=_[_0x3f32('0x32')](_0x20b333[_0x3f32('0x2f')],qs[_0x3f32('0x34')](_0x785270['query'][_0x3f32('0x34')]));_0x320972[_0x3f32('0x33')]=_0x320972['attributes']['length']?_0x320972[_0x3f32('0x33')]:_0x20b333[_0x3f32('0x2f')];if(!_0x785270[_0x3f32('0x30')]['hasOwnProperty']('nolimit')){_0x320972[_0x3f32('0x1a')]=qs[_0x3f32('0x1a')](_0x785270[_0x3f32('0x30')][_0x3f32('0x1a')]);_0x320972['offset']=qs[_0x3f32('0x1c')](_0x785270['query'][_0x3f32('0x1c')]);}_0x320972[_0x3f32('0x35')]=qs['sort'](_0x785270[_0x3f32('0x30')][_0x3f32('0x36')]);_0x320972[_0x3f32('0x37')]=qs[_0x3f32('0x31')](_[_0x3f32('0x38')](_0x785270[_0x3f32('0x30')],_0x20b333[_0x3f32('0x31')]),_0x293c05);if(_0x785270[_0x3f32('0x30')]['filter']){_0x320972['where']=_[_0x3f32('0x39')](_0x320972[_0x3f32('0x37')],{'$or':_[_0x3f32('0x2a')](_0x293c05,function(_0x1e0e9a){if(_0x1e0e9a[_0x3f32('0x2d')]!==_0x3f32('0x3a')){var _0x28bd51={};_0x28bd51[_0x1e0e9a[_0x3f32('0x28')]]={'$like':'%'+_0x785270[_0x3f32('0x30')]['filter']+'%'};return _0x28bd51;}})});}_0x320972=_[_0x3f32('0x39')]({},_0x320972,_0x785270[_0x3f32('0x3b')]);var _0x3210a5={'where':_0x320972['where']};return db[_0x3f32('0x2b')][_0x3f32('0x1d')](_0x3210a5)['then'](function(_0xfaed17){_0x36623c[_0x3f32('0x1d')]=_0xfaed17;if(_0x785270[_0x3f32('0x30')][_0x3f32('0x3c')]){_0x320972[_0x3f32('0x3d')]=[{'all':!![]}];}return db[_0x3f32('0x2b')][_0x3f32('0x3e')](_0x320972);})['then'](function(_0x5831fe){_0x36623c[_0x3f32('0x3f')]=_0x5831fe;return _0x36623c;})[_0x3f32('0x24')](respondWithFilteredResult(_0x1ee79e,_0x320972))['catch'](handleError(_0x1ee79e,null));};exports[_0x3f32('0x40')]=function(_0x35701f,_0x25a4ce){var _0x23b773={'raw':!![],'where':{'id':_0x35701f[_0x3f32('0x41')]['id']}},_0x21a803={};_0x21a803[_0x3f32('0x2f')]=_['keys'](db[_0x3f32('0x2b')][_0x3f32('0x2c')]);_0x21a803[_0x3f32('0x30')]=_[_0x3f32('0x42')](_0x35701f[_0x3f32('0x30')]);_0x21a803[_0x3f32('0x31')]=_[_0x3f32('0x32')](_0x21a803[_0x3f32('0x2f')],_0x21a803[_0x3f32('0x30')]);_0x23b773['attributes']=_[_0x3f32('0x32')](_0x21a803[_0x3f32('0x2f')],qs[_0x3f32('0x34')](_0x35701f[_0x3f32('0x30')][_0x3f32('0x34')]));_0x23b773['attributes']=_0x23b773['attributes'][_0x3f32('0x43')]?_0x23b773[_0x3f32('0x33')]:_0x21a803[_0x3f32('0x2f')];if(_0x35701f['query'][_0x3f32('0x3c')]){_0x23b773['include']=[{'all':!![]}];}_0x23b773=_[_0x3f32('0x39')]({},_0x23b773,_0x35701f[_0x3f32('0x3b')]);return db[_0x3f32('0x2b')][_0x3f32('0x44')](_0x23b773)[_0x3f32('0x24')](handleEntityNotFound(_0x25a4ce,null))['then'](respondWithResult(_0x25a4ce,null))[_0x3f32('0x45')](handleError(_0x25a4ce,null));};exports[_0x3f32('0x46')]=function(_0x2158c2,_0x4a0870){return db['FaxQueueReport'][_0x3f32('0x46')](_0x2158c2['body'],{})[_0x3f32('0x24')](respondWithResult(_0x4a0870,0xc9))[_0x3f32('0x45')](handleError(_0x4a0870,null));};exports[_0x3f32('0x22')]=function(_0x2753eb,_0x80bffd){if(_0x2753eb['body']['id']){delete _0x2753eb[_0x3f32('0x47')]['id'];}return db[_0x3f32('0x2b')][_0x3f32('0x44')]({'where':{'id':_0x2753eb[_0x3f32('0x41')]['id']}})[_0x3f32('0x24')](handleEntityNotFound(_0x80bffd,null))['then'](saveUpdates(_0x2753eb[_0x3f32('0x47')],null))[_0x3f32('0x24')](respondWithResult(_0x80bffd,null))['catch'](handleError(_0x80bffd,null));};exports[_0x3f32('0x23')]=function(_0x422da0,_0x2c6160){return db[_0x3f32('0x2b')]['find']({'where':{'id':_0x422da0[_0x3f32('0x41')]['id']}})[_0x3f32('0x24')](handleEntityNotFound(_0x2c6160,null))[_0x3f32('0x24')](removeEntity(_0x2c6160,null))[_0x3f32('0x45')](handleError(_0x2c6160,null));};exports[_0x3f32('0x48')]=function(_0x38107f,_0x9f14d8){return db['FaxQueueReport']['describe']()[_0x3f32('0x24')](respondWithResult(_0x9f14d8,null))[_0x3f32('0x45')](handleError(_0x9f14d8,null));}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.model.js b/server/api/faxQueueReport/faxQueueReport.model.js index 33021ef..0688a27 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 _0x7fbe=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxQueueReport.attributes','exports','define','FaxQueueReport','uniqueid','../../config/logger','api'];(function(_0x32da16,_0x22ffd1){var _0x56611f=function(_0x87b9cc){while(--_0x87b9cc){_0x32da16['push'](_0x32da16['shift']());}};_0x56611f(++_0x22ffd1);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0x14e4cf,_0x5ab1da){_0x14e4cf=_0x14e4cf-0x0;var _0x2770b=_0x7fbe[_0x14e4cf];return _0x2770b;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xe7fb('0x0'))(_0xe7fb('0x1'));var moment=require(_0xe7fb('0x2'));var BPromise=require(_0xe7fb('0x3'));var rp=require(_0xe7fb('0x4'));var fs=require('fs');var path=require(_0xe7fb('0x5'));var rimraf=require(_0xe7fb('0x6'));var config=require(_0xe7fb('0x7'));var attributes=require(_0xe7fb('0x8'));module[_0xe7fb('0x9')]=function(_0x290172,_0x12d1b0){return _0x290172[_0xe7fb('0xa')](_0xe7fb('0xb'),attributes,{'tableName':'report_fax_queue','paranoid':![],'indexes':[{'name':_0xe7fb('0xc'),'fields':[_0xe7fb('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x7fbe=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxQueueReport.attributes','exports','define','FaxQueueReport','uniqueid','../../config/logger','api'];(function(_0x254aea,_0x4ac60c){var _0x54e9cf=function(_0x26323e){while(--_0x26323e){_0x254aea['push'](_0x254aea['shift']());}};_0x54e9cf(++_0x4ac60c);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0x48a73e,_0x39f1ac){_0x48a73e=_0x48a73e-0x0;var _0x390c0b=_0x7fbe[_0x48a73e];return _0x390c0b;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xe7fb('0x0'))(_0xe7fb('0x1'));var moment=require(_0xe7fb('0x2'));var BPromise=require(_0xe7fb('0x3'));var rp=require(_0xe7fb('0x4'));var fs=require('fs');var path=require(_0xe7fb('0x5'));var rimraf=require(_0xe7fb('0x6'));var config=require(_0xe7fb('0x7'));var attributes=require(_0xe7fb('0x8'));module[_0xe7fb('0x9')]=function(_0x290172,_0x12d1b0){return _0x290172[_0xe7fb('0xa')](_0xe7fb('0xb'),attributes,{'tableName':'report_fax_queue','paranoid':![],'indexes':[{'name':_0xe7fb('0xc'),'fields':[_0xe7fb('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 1f94eb1..fde61ef 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 _0x8abe=['info','CreateFaxQueueReport','create','options','raw','debug','catch','update','body','where','attributes','limit','UpdateFaxQueueReport','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','FaxQueueReport,\x20%s,\x20%s','request\x20sent','FaxQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x7d6eca,_0x59d54a){var _0x128263=function(_0x4019d6){while(--_0x4019d6){_0x7d6eca['push'](_0x7d6eca['shift']());}};_0x128263(++_0x59d54a);}(_0x8abe,0x178));var _0xe8ab=function(_0x191b1a,_0x48e0e6){_0x191b1a=_0x191b1a-0x0;var _0x283089=_0x8abe[_0x191b1a];return _0x283089;};'use strict';var _=require(_0xe8ab('0x0'));var util=require(_0xe8ab('0x1'));var moment=require('moment');var BPromise=require(_0xe8ab('0x2'));var rs=require(_0xe8ab('0x3'));var fs=require('fs');var Redis=require(_0xe8ab('0x4'));var db=require(_0xe8ab('0x5'))['db'];var utils=require(_0xe8ab('0x6'));var logger=require(_0xe8ab('0x7'))(_0xe8ab('0x8'));var config=require(_0xe8ab('0x9'));var jayson=require(_0xe8ab('0xa'));var client=jayson[_0xe8ab('0xb')][_0xe8ab('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x46a0d2,_0x244e51,_0x5bd4ad){return new BPromise(function(_0x286ae6,_0x38b1f2){return client['request'](_0x46a0d2,_0x5bd4ad)['then'](function(_0x278ba3){logger['info'](_0xe8ab('0xd'),_0x244e51,_0xe8ab('0xe'));logger['debug'](_0xe8ab('0xf'),_0x244e51,_0xe8ab('0xe'),JSON[_0xe8ab('0x10')](_0x278ba3));if(_0x278ba3[_0xe8ab('0x11')]){if(_0x278ba3[_0xe8ab('0x11')][_0xe8ab('0x12')]===0x1f4){logger[_0xe8ab('0x11')](_0xe8ab('0xd'),_0x244e51,_0x278ba3[_0xe8ab('0x11')][_0xe8ab('0x13')]);return _0x38b1f2(_0x278ba3['error'][_0xe8ab('0x13')]);}logger[_0xe8ab('0x11')](_0xe8ab('0xd'),_0x244e51,_0x278ba3['error']['message']);return _0x286ae6(_0x278ba3['error'][_0xe8ab('0x13')]);}else{logger[_0xe8ab('0x14')](_0xe8ab('0xd'),_0x244e51,'request\x20sent');_0x286ae6(_0x278ba3['result']['message']);}})['catch'](function(_0x3d512e){logger['error'](_0xe8ab('0xd'),_0x244e51,_0x3d512e);_0x38b1f2(_0x3d512e);});});}exports[_0xe8ab('0x15')]=function(_0x5af81b){var _0xe92f2c=this;return new Promise(function(_0x4be019,_0x5b2103){return db['FaxQueueReport'][_0xe8ab('0x16')](_0x5af81b['body'],{'raw':_0x5af81b[_0xe8ab('0x17')]?_0x5af81b['options'][_0xe8ab('0x18')]===undefined?!![]:![]:!![]})['then'](function(_0x30b4df){logger[_0xe8ab('0x14')](_0xe8ab('0x15'),_0x5af81b);logger[_0xe8ab('0x19')]('CreateFaxQueueReport',_0x5af81b,JSON[_0xe8ab('0x10')](_0x30b4df));_0x4be019(_0x30b4df);})[_0xe8ab('0x1a')](function(_0x2c424d){logger[_0xe8ab('0x11')](_0xe8ab('0x15'),_0x2c424d[_0xe8ab('0x13')],_0x5af81b);_0x5b2103(_0xe92f2c['error'](0x1f4,_0x2c424d[_0xe8ab('0x13')]));});});};exports['UpdateFaxQueueReport']=function(_0x5d7223){var _0x738cd8=this;return new Promise(function(_0x43c707,_0x10f6aa){return db['FaxQueueReport'][_0xe8ab('0x1b')](_0x5d7223[_0xe8ab('0x1c')],{'raw':_0x5d7223[_0xe8ab('0x17')]?_0x5d7223[_0xe8ab('0x17')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5d7223['options']?_0x5d7223[_0xe8ab('0x17')][_0xe8ab('0x1d')]||null:null,'attributes':_0x5d7223[_0xe8ab('0x17')]?_0x5d7223['options'][_0xe8ab('0x1e')]||null:null,'limit':_0x5d7223[_0xe8ab('0x17')]?_0x5d7223[_0xe8ab('0x17')][_0xe8ab('0x1f')]||null:null})['then'](function(_0x40abed){logger['info']('UpdateFaxQueueReport',_0x5d7223);logger[_0xe8ab('0x19')]('UpdateFaxQueueReport',_0x5d7223,JSON[_0xe8ab('0x10')](_0x40abed));_0x43c707(_0x40abed);})['catch'](function(_0x2ef888){logger[_0xe8ab('0x11')](_0xe8ab('0x20'),_0x2ef888['message'],_0x5d7223);_0x10f6aa(_0x738cd8[_0xe8ab('0x11')](0x1f4,_0x2ef888[_0xe8ab('0x13')]));});});}; \ No newline at end of file +var _0x38dc=['attributes','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','then','info','FaxQueueReport,\x20%s,\x20%s','request\x20sent','FaxQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','CreateFaxQueueReport','FaxQueueReport','options','raw','debug','UpdateFaxQueueReport','update','body','where'];(function(_0x27ba7a,_0x2b525a){var _0x316156=function(_0x5491d9){while(--_0x5491d9){_0x27ba7a['push'](_0x27ba7a['shift']());}};_0x316156(++_0x2b525a);}(_0x38dc,0x187));var _0xc38d=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x38dc[_0x3ab51d];return _0x29a04e;};'use strict';var _=require(_0xc38d('0x0'));var util=require(_0xc38d('0x1'));var moment=require(_0xc38d('0x2'));var BPromise=require('bluebird');var rs=require(_0xc38d('0x3'));var fs=require('fs');var Redis=require(_0xc38d('0x4'));var db=require(_0xc38d('0x5'))['db'];var utils=require(_0xc38d('0x6'));var logger=require('../../config/logger')(_0xc38d('0x7'));var config=require('../../config/environment');var jayson=require(_0xc38d('0x8'));var client=jayson[_0xc38d('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x383569,_0x40e0f1,_0x58f7f1){return new BPromise(function(_0x16cb66,_0x1d9f81){return client['request'](_0x383569,_0x58f7f1)[_0xc38d('0xa')](function(_0x179578){logger[_0xc38d('0xb')](_0xc38d('0xc'),_0x40e0f1,_0xc38d('0xd'));logger['debug'](_0xc38d('0xe'),_0x40e0f1,_0xc38d('0xd'),JSON[_0xc38d('0xf')](_0x179578));if(_0x179578['error']){if(_0x179578[_0xc38d('0x10')]['code']===0x1f4){logger[_0xc38d('0x10')](_0xc38d('0xc'),_0x40e0f1,_0x179578[_0xc38d('0x10')][_0xc38d('0x11')]);return _0x1d9f81(_0x179578[_0xc38d('0x10')][_0xc38d('0x11')]);}logger[_0xc38d('0x10')](_0xc38d('0xc'),_0x40e0f1,_0x179578[_0xc38d('0x10')]['message']);return _0x16cb66(_0x179578['error'][_0xc38d('0x11')]);}else{logger['info']('FaxQueueReport,\x20%s,\x20%s',_0x40e0f1,_0xc38d('0xd'));_0x16cb66(_0x179578[_0xc38d('0x12')][_0xc38d('0x11')]);}})[_0xc38d('0x13')](function(_0x14bf6c){logger['error'](_0xc38d('0xc'),_0x40e0f1,_0x14bf6c);_0x1d9f81(_0x14bf6c);});});}exports[_0xc38d('0x14')]=function(_0x1203e9){var _0x3f8357=this;return new Promise(function(_0x5f3b2c,_0x44c73a){return db[_0xc38d('0x15')]['create'](_0x1203e9['body'],{'raw':_0x1203e9[_0xc38d('0x16')]?_0x1203e9['options'][_0xc38d('0x17')]===undefined?!![]:![]:!![]})[_0xc38d('0xa')](function(_0x4b7a5d){logger[_0xc38d('0xb')](_0xc38d('0x14'),_0x1203e9);logger[_0xc38d('0x18')]('CreateFaxQueueReport',_0x1203e9,JSON[_0xc38d('0xf')](_0x4b7a5d));_0x5f3b2c(_0x4b7a5d);})[_0xc38d('0x13')](function(_0x32b1e5){logger[_0xc38d('0x10')](_0xc38d('0x14'),_0x32b1e5[_0xc38d('0x11')],_0x1203e9);_0x44c73a(_0x3f8357[_0xc38d('0x10')](0x1f4,_0x32b1e5[_0xc38d('0x11')]));});});};exports[_0xc38d('0x19')]=function(_0x4e4f4a){var _0x2fb191=this;return new Promise(function(_0x1e2ec5,_0x5dbfd6){return db[_0xc38d('0x15')][_0xc38d('0x1a')](_0x4e4f4a[_0xc38d('0x1b')],{'raw':_0x4e4f4a['options']?_0x4e4f4a['options'][_0xc38d('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4e4f4a['options']?_0x4e4f4a[_0xc38d('0x16')][_0xc38d('0x1c')]||null:null,'attributes':_0x4e4f4a['options']?_0x4e4f4a[_0xc38d('0x16')][_0xc38d('0x1d')]||null:null,'limit':_0x4e4f4a[_0xc38d('0x16')]?_0x4e4f4a[_0xc38d('0x16')]['limit']||null:null})[_0xc38d('0xa')](function(_0x445d8f){logger[_0xc38d('0xb')]('UpdateFaxQueueReport',_0x4e4f4a);logger['debug'](_0xc38d('0x19'),_0x4e4f4a,JSON[_0xc38d('0xf')](_0x445d8f));_0x1e2ec5(_0x445d8f);})[_0xc38d('0x13')](function(_0x1a5f3f){logger[_0xc38d('0x10')](_0xc38d('0x19'),_0x1a5f3f[_0xc38d('0x11')],_0x4e4f4a);_0x5dbfd6(_0x2fb191[_0xc38d('0x10')](0x1f4,_0x1a5f3f[_0xc38d('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/faxQueueReport/index.js b/server/api/faxQueueReport/index.js index 3341bf7..23c7d6c 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 _0x3313=['connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxQueueReport.controller','get','index','/describe','isAuthenticated','/:id','show','post','create','put','update','destroy','exports','multer','util'];(function(_0x57ab26,_0x244ee4){var _0x5e8789=function(_0x2f4afe){while(--_0x2f4afe){_0x57ab26['push'](_0x57ab26['shift']());}};_0x5e8789(++_0x244ee4);}(_0x3313,0x1a2));var _0x3331=function(_0xbc0862,_0x564508){_0xbc0862=_0xbc0862-0x0;var _0x2c787c=_0x3313[_0xbc0862];return _0x2c787c;};'use strict';var multer=require(_0x3331('0x0'));var util=require(_0x3331('0x1'));var path=require('path');var timeout=require(_0x3331('0x2'));var express=require('express');var router=express[_0x3331('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x3331('0x4'));var interaction=require(_0x3331('0x5'));var config=require(_0x3331('0x6'));var controller=require(_0x3331('0x7'));router[_0x3331('0x8')]('/',auth['isAuthenticated'](),controller[_0x3331('0x9')]);router['get'](_0x3331('0xa'),auth[_0x3331('0xb')](),controller['describe']);router[_0x3331('0x8')](_0x3331('0xc'),auth[_0x3331('0xb')](),controller[_0x3331('0xd')]);router[_0x3331('0xe')]('/',auth[_0x3331('0xb')](),controller[_0x3331('0xf')]);router[_0x3331('0x10')](_0x3331('0xc'),auth[_0x3331('0xb')](),controller[_0x3331('0x11')]);router['delete'](_0x3331('0xc'),auth[_0x3331('0xb')](),controller[_0x3331('0x12')]);module[_0x3331('0x13')]=router; \ No newline at end of file +var _0x14a1=['../../components/auth/service','../../components/interaction/service','../../config/environment','./faxQueueReport.controller','get','isAuthenticated','index','/:id','show','post','put','update','delete','exports','multer','util','path','connect-timeout','Router','fs-extra'];(function(_0x4f7edb,_0x43b96b){var _0x35967d=function(_0x591313){while(--_0x591313){_0x4f7edb['push'](_0x4f7edb['shift']());}};_0x35967d(++_0x43b96b);}(_0x14a1,0x18a));var _0x114a=function(_0x59de69,_0xc26bde){_0x59de69=_0x59de69-0x0;var _0x25c89e=_0x14a1[_0x59de69];return _0x25c89e;};'use strict';var multer=require(_0x114a('0x0'));var util=require(_0x114a('0x1'));var path=require(_0x114a('0x2'));var timeout=require(_0x114a('0x3'));var express=require('express');var router=express[_0x114a('0x4')]();var fs_extra=require(_0x114a('0x5'));var auth=require(_0x114a('0x6'));var interaction=require(_0x114a('0x7'));var config=require(_0x114a('0x8'));var controller=require(_0x114a('0x9'));router[_0x114a('0xa')]('/',auth[_0x114a('0xb')](),controller[_0x114a('0xc')]);router[_0x114a('0xa')]('/describe',auth[_0x114a('0xb')](),controller['describe']);router[_0x114a('0xa')](_0x114a('0xd'),auth[_0x114a('0xb')](),controller[_0x114a('0xe')]);router[_0x114a('0xf')]('/',auth['isAuthenticated'](),controller['create']);router[_0x114a('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x114a('0x11')]);router[_0x114a('0x12')]('/:id',auth[_0x114a('0xb')](),controller['destroy']);module[_0x114a('0x13')]=router; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.attributes.js b/server/api/faxTransferReport/faxTransferReport.attributes.js index 0dcd61e..4e8f911 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 _0x34e8=['queue','DATE','NOW','moment','sequelize','exports','STRING','account','agent'];(function(_0x45806b,_0x53eeae){var _0x3e228e=function(_0x3ee031){while(--_0x3ee031){_0x45806b['push'](_0x45806b['shift']());}};_0x3e228e(++_0x53eeae);}(_0x34e8,0x12c));var _0x834e=function(_0x4fd914,_0x32b17d){_0x4fd914=_0x4fd914-0x0;var _0x4a9b55=_0x34e8[_0x4fd914];return _0x4a9b55;};'use strict';var moment=require(_0x834e('0x0'));var Sequelize=require(_0x834e('0x1'));module[_0x834e('0x2')]={'uniqueid':{'type':Sequelize[_0x834e('0x3')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x834e('0x4'),_0x834e('0x5'),_0x834e('0x6')),'allowNull':![],'defaultValue':_0x834e('0x6')},'transferredAt':{'type':Sequelize[_0x834e('0x7')],'allowNull':![],'defaultValue':Sequelize[_0x834e('0x8')]}}; \ No newline at end of file +var _0xf4eb=['NOW','moment','account','queue','DATE'];(function(_0x2046e6,_0x838d31){var _0x12beee=function(_0x5cb8c0){while(--_0x5cb8c0){_0x2046e6['push'](_0x2046e6['shift']());}};_0x12beee(++_0x838d31);}(_0xf4eb,0xec));var _0xbf4e=function(_0x1f4528,_0x1c2107){_0x1f4528=_0x1f4528-0x0;var _0x5f22ec=_0xf4eb[_0x1f4528];return _0x5f22ec;};'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/faxTransferReport/faxTransferReport.controller.js b/server/api/faxTransferReport/faxTransferReport.controller.js index 295963b..6ad3447 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 _0xa26a=['reject','update','then','error','name','send','index','map','FaxTransferReport','rawAttributes','fieldName','type','model','keys','query','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','VIRTUAL','filter','merge','options','includeAll','include','findAll','rows','catch','params','find','create','body','describe','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','ejs','lodash','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','undefined','limit','count','offset','set','apply'];(function(_0x46fa70,_0x3f0e5a){var _0x41047f=function(_0x2abbbb){while(--_0x2abbbb){_0x46fa70['push'](_0x46fa70['shift']());}};_0x41047f(++_0x3f0e5a);}(_0xa26a,0x147));var _0xaa26=function(_0x1177ac,_0x338be6){_0x1177ac=_0x1177ac-0x0;var _0x11fd63=_0xa26a[_0x1177ac];return _0x11fd63;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xaa26('0x0'));var zipdir=require(_0xaa26('0x1'));var jsonpatch=require(_0xaa26('0x2'));var rp=require('request-promise');var moment=require(_0xaa26('0x3'));var BPromise=require(_0xaa26('0x4'));var Mustache=require(_0xaa26('0x5'));var util=require(_0xaa26('0x6'));var path=require('path');var sox=require(_0xaa26('0x7'));var csv=require('to-csv');var ejs=require(_0xaa26('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xaa26('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xaa26('0xa'));var deskjs=require(_0xaa26('0xb'));var toCsv=require(_0xaa26('0xc'));var querystring=require(_0xaa26('0xd'));var Papa=require(_0xaa26('0xe'));var Redis=require(_0xaa26('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xaa26('0x10'));var as=require(_0xaa26('0x11'));var hardwareService=require(_0xaa26('0x12'));var logger=require('../../config/logger')(_0xaa26('0x13'));var utils=require(_0xaa26('0x14'));var config=require(_0xaa26('0x15'));var licenseUtil=require(_0xaa26('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x56c746,_0x14eb3f){_0x14eb3f=_0x14eb3f||0xcc;return function(_0x428dbd){if(_0x428dbd){return _0x56c746[_0xaa26('0x17')](_0x14eb3f);}return _0x56c746[_0xaa26('0x18')](_0x14eb3f)[_0xaa26('0x19')]();};}function respondWithResult(_0x5079e2,_0xf1ce2){_0xf1ce2=_0xf1ce2||0xc8;return function(_0x4b7d8c){if(_0x4b7d8c){return _0x5079e2[_0xaa26('0x18')](_0xf1ce2)[_0xaa26('0x1a')](_0x4b7d8c);}};}function respondWithFilteredResult(_0x56ee6a,_0x44a210){return function(_0x42648e){if(_0x42648e){var _0x542ea7=typeof _0x44a210['offset']===_0xaa26('0x1b')&&typeof _0x44a210[_0xaa26('0x1c')]===_0xaa26('0x1b');var _0x4ad5b3=_0x42648e[_0xaa26('0x1d')];var _0x12c35a=_0x542ea7?0x0:_0x44a210[_0xaa26('0x1e')];var _0x1055cd=_0x542ea7?_0x42648e[_0xaa26('0x1d')]:_0x44a210[_0xaa26('0x1e')]+_0x44a210['limit'];var _0x232219;if(_0x1055cd>=_0x4ad5b3){_0x1055cd=_0x4ad5b3;_0x232219=0xc8;}else{_0x232219=0xce;}_0x56ee6a[_0xaa26('0x18')](_0x232219);return _0x56ee6a[_0xaa26('0x1f')]('Content-Range',_0x12c35a+'-'+_0x1055cd+'/'+_0x4ad5b3)['json'](_0x42648e);}return null;};}function patchUpdates(_0x523053){return function(_0x4c473f){try{jsonpatch[_0xaa26('0x20')](_0x4c473f,_0x523053,!![]);}catch(_0x32ee66){return BPromise[_0xaa26('0x21')](_0x32ee66);}return _0x4c473f['save']();};}function saveUpdates(_0x4f2d30,_0x440927){return function(_0x4b3c81){if(_0x4b3c81){return _0x4b3c81[_0xaa26('0x22')](_0x4f2d30)[_0xaa26('0x23')](function(_0x2009db){return _0x2009db;});}return null;};}function removeEntity(_0x43b813,_0x54ffd6){return function(_0x30b6ab){if(_0x30b6ab){return _0x30b6ab['destroy']()[_0xaa26('0x23')](function(){_0x43b813[_0xaa26('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x587efa,_0xd5d5fe){return function(_0x34b268){if(!_0x34b268){_0x587efa[_0xaa26('0x17')](0x194);}return _0x34b268;};}function handleError(_0x236c5b,_0x2b7d0b){_0x2b7d0b=_0x2b7d0b||0x1f4;return function(_0xebf4e9){logger[_0xaa26('0x24')](_0xebf4e9['stack']);if(_0xebf4e9[_0xaa26('0x25')]){delete _0xebf4e9[_0xaa26('0x25')];}_0x236c5b['status'](_0x2b7d0b)[_0xaa26('0x26')](_0xebf4e9);};}exports[_0xaa26('0x27')]=function(_0x56a365,_0x5cb238){var _0x39ff67={},_0x161cb3={},_0x1963c5={'count':0x0,'rows':[]};var _0x5090a5=_[_0xaa26('0x28')](db[_0xaa26('0x29')][_0xaa26('0x2a')],function(_0x4c82c5){return{'name':_0x4c82c5[_0xaa26('0x2b')],'type':_0x4c82c5[_0xaa26('0x2c')]['key']};});_0x161cb3[_0xaa26('0x2d')]=_[_0xaa26('0x28')](_0x5090a5,'name');_0x161cb3['query']=_[_0xaa26('0x2e')](_0x56a365[_0xaa26('0x2f')]);_0x161cb3['filters']=_[_0xaa26('0x30')](_0x161cb3[_0xaa26('0x2d')],_0x161cb3[_0xaa26('0x2f')]);_0x39ff67[_0xaa26('0x31')]=_[_0xaa26('0x30')](_0x161cb3['model'],qs[_0xaa26('0x32')](_0x56a365['query'][_0xaa26('0x32')]));_0x39ff67['attributes']=_0x39ff67['attributes']['length']?_0x39ff67[_0xaa26('0x31')]:_0x161cb3[_0xaa26('0x2d')];if(!_0x56a365[_0xaa26('0x2f')][_0xaa26('0x33')](_0xaa26('0x34'))){_0x39ff67[_0xaa26('0x1c')]=qs['limit'](_0x56a365['query'][_0xaa26('0x1c')]);_0x39ff67[_0xaa26('0x1e')]=qs[_0xaa26('0x1e')](_0x56a365['query'][_0xaa26('0x1e')]);}_0x39ff67[_0xaa26('0x35')]=qs[_0xaa26('0x36')](_0x56a365[_0xaa26('0x2f')][_0xaa26('0x36')]);_0x39ff67[_0xaa26('0x37')]=qs[_0xaa26('0x38')](_[_0xaa26('0x39')](_0x56a365[_0xaa26('0x2f')],_0x161cb3['filters']),_0x5090a5);if(_0x56a365['query']['filter']){_0x39ff67[_0xaa26('0x37')]=_['merge'](_0x39ff67[_0xaa26('0x37')],{'$or':_[_0xaa26('0x28')](_0x5090a5,function(_0x1fc7e5){if(_0x1fc7e5['type']!==_0xaa26('0x3a')){var _0xbcec93={};_0xbcec93[_0x1fc7e5[_0xaa26('0x25')]]={'$like':'%'+_0x56a365['query'][_0xaa26('0x3b')]+'%'};return _0xbcec93;}})});}_0x39ff67=_[_0xaa26('0x3c')]({},_0x39ff67,_0x56a365[_0xaa26('0x3d')]);var _0x1cb6a5={'where':_0x39ff67[_0xaa26('0x37')]};return db['FaxTransferReport']['count'](_0x1cb6a5)[_0xaa26('0x23')](function(_0x4a1faf){_0x1963c5[_0xaa26('0x1d')]=_0x4a1faf;if(_0x56a365[_0xaa26('0x2f')][_0xaa26('0x3e')]){_0x39ff67[_0xaa26('0x3f')]=[{'all':!![]}];}return db[_0xaa26('0x29')][_0xaa26('0x40')](_0x39ff67);})[_0xaa26('0x23')](function(_0x3353f6){_0x1963c5[_0xaa26('0x41')]=_0x3353f6;return _0x1963c5;})['then'](respondWithFilteredResult(_0x5cb238,_0x39ff67))[_0xaa26('0x42')](handleError(_0x5cb238,null));};exports['show']=function(_0x199dde,_0x187d9f){var _0x2b87be={'raw':!![],'where':{'id':_0x199dde[_0xaa26('0x43')]['id']}},_0x114413={};_0x114413[_0xaa26('0x2d')]=_['keys'](db['FaxTransferReport'][_0xaa26('0x2a')]);_0x114413['query']=_[_0xaa26('0x2e')](_0x199dde[_0xaa26('0x2f')]);_0x114413[_0xaa26('0x38')]=_[_0xaa26('0x30')](_0x114413[_0xaa26('0x2d')],_0x114413['query']);_0x2b87be[_0xaa26('0x31')]=_[_0xaa26('0x30')](_0x114413[_0xaa26('0x2d')],qs[_0xaa26('0x32')](_0x199dde[_0xaa26('0x2f')][_0xaa26('0x32')]));_0x2b87be['attributes']=_0x2b87be['attributes']['length']?_0x2b87be[_0xaa26('0x31')]:_0x114413[_0xaa26('0x2d')];if(_0x199dde[_0xaa26('0x2f')][_0xaa26('0x3e')]){_0x2b87be[_0xaa26('0x3f')]=[{'all':!![]}];}_0x2b87be=_[_0xaa26('0x3c')]({},_0x2b87be,_0x199dde[_0xaa26('0x3d')]);return db[_0xaa26('0x29')][_0xaa26('0x44')](_0x2b87be)[_0xaa26('0x23')](handleEntityNotFound(_0x187d9f,null))[_0xaa26('0x23')](respondWithResult(_0x187d9f,null))[_0xaa26('0x42')](handleError(_0x187d9f,null));};exports[_0xaa26('0x45')]=function(_0x316351,_0x29e749){return db[_0xaa26('0x29')][_0xaa26('0x45')](_0x316351[_0xaa26('0x46')],{})[_0xaa26('0x23')](respondWithResult(_0x29e749,0xc9))[_0xaa26('0x42')](handleError(_0x29e749,null));};exports[_0xaa26('0x22')]=function(_0xc9c2a4,_0x1d99de){if(_0xc9c2a4['body']['id']){delete _0xc9c2a4[_0xaa26('0x46')]['id'];}return db['FaxTransferReport'][_0xaa26('0x44')]({'where':{'id':_0xc9c2a4[_0xaa26('0x43')]['id']}})[_0xaa26('0x23')](handleEntityNotFound(_0x1d99de,null))[_0xaa26('0x23')](saveUpdates(_0xc9c2a4[_0xaa26('0x46')],null))[_0xaa26('0x23')](respondWithResult(_0x1d99de,null))[_0xaa26('0x42')](handleError(_0x1d99de,null));};exports['destroy']=function(_0x20d5e5,_0x5b5f3d){return db[_0xaa26('0x29')][_0xaa26('0x44')]({'where':{'id':_0x20d5e5[_0xaa26('0x43')]['id']}})[_0xaa26('0x23')](handleEntityNotFound(_0x5b5f3d,null))[_0xaa26('0x23')](removeEntity(_0x5b5f3d,null))[_0xaa26('0x42')](handleError(_0x5b5f3d,null));};exports[_0xaa26('0x47')]=function(_0x1cc54f,_0x5cbea9){return db['FaxTransferReport']['describe']()[_0xaa26('0x23')](respondWithResult(_0x5cbea9,null))[_0xaa26('0x42')](handleError(_0x5cbea9,null));}; \ No newline at end of file +var _0x2077=['papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','offset','undefined','count','limit','set','Content-Range','json','apply','reject','save','then','destroy','end','error','stack','name','send','index','map','FaxTransferReport','rawAttributes','fieldName','key','model','keys','query','filters','attributes','intersection','fields','nolimit','order','where','pick','filter','merge','type','VIRTUAL','options','includeAll','findAll','show','params','length','include','find','catch','create','body','describe','request-promise','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','squel','jsforce'];(function(_0xceaf3e,_0x215fa1){var _0x27fd65=function(_0x2c361c){while(--_0x2c361c){_0xceaf3e['push'](_0xceaf3e['shift']());}};_0x27fd65(++_0x215fa1);}(_0x2077,0xcb));var _0x7207=function(_0x4357de,_0xafade7){_0x4357de=_0x4357de-0x0;var _0x150888=_0x2077[_0x4357de];return _0x150888;};'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(_0x7207('0x0'));var moment=require('moment');var BPromise=require(_0x7207('0x1'));var Mustache=require(_0x7207('0x2'));var util=require('util');var path=require(_0x7207('0x3'));var sox=require(_0x7207('0x4'));var csv=require(_0x7207('0x5'));var ejs=require(_0x7207('0x6'));var fs=require('fs');var fs_extra=require(_0x7207('0x7'));var _=require('lodash');var squel=require(_0x7207('0x8'));var crypto=require('crypto');var jsforce=require(_0x7207('0x9'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x7207('0xa'));var Redis=require('ioredis');var authService=require(_0x7207('0xb'));var qs=require(_0x7207('0xc'));var as=require(_0x7207('0xd'));var hardwareService=require(_0x7207('0xe'));var logger=require(_0x7207('0xf'))(_0x7207('0x10'));var utils=require(_0x7207('0x11'));var config=require(_0x7207('0x12'));var licenseUtil=require(_0x7207('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4d7784,_0x8fbaf5){_0x8fbaf5=_0x8fbaf5||0xcc;return function(_0x2cc460){if(_0x2cc460){return _0x4d7784['sendStatus'](_0x8fbaf5);}return _0x4d7784[_0x7207('0x14')](_0x8fbaf5)['end']();};}function respondWithResult(_0x17892f,_0x27b1dd){_0x27b1dd=_0x27b1dd||0xc8;return function(_0x87ecd1){if(_0x87ecd1){return _0x17892f[_0x7207('0x14')](_0x27b1dd)['json'](_0x87ecd1);}};}function respondWithFilteredResult(_0x7f843b,_0x5ae516){return function(_0xe6bb90){if(_0xe6bb90){var _0x20cc30=typeof _0x5ae516[_0x7207('0x15')]===_0x7207('0x16')&&typeof _0x5ae516['limit']===_0x7207('0x16');var _0x171ab8=_0xe6bb90[_0x7207('0x17')];var _0x57bcd4=_0x20cc30?0x0:_0x5ae516[_0x7207('0x15')];var _0x19f0a0=_0x20cc30?_0xe6bb90[_0x7207('0x17')]:_0x5ae516[_0x7207('0x15')]+_0x5ae516[_0x7207('0x18')];var _0x379816;if(_0x19f0a0>=_0x171ab8){_0x19f0a0=_0x171ab8;_0x379816=0xc8;}else{_0x379816=0xce;}_0x7f843b[_0x7207('0x14')](_0x379816);return _0x7f843b[_0x7207('0x19')](_0x7207('0x1a'),_0x57bcd4+'-'+_0x19f0a0+'/'+_0x171ab8)[_0x7207('0x1b')](_0xe6bb90);}return null;};}function patchUpdates(_0x355b79){return function(_0x5b7163){try{jsonpatch[_0x7207('0x1c')](_0x5b7163,_0x355b79,!![]);}catch(_0xbe844a){return BPromise[_0x7207('0x1d')](_0xbe844a);}return _0x5b7163[_0x7207('0x1e')]();};}function saveUpdates(_0x184117,_0x2f71ec){return function(_0x52e2a0){if(_0x52e2a0){return _0x52e2a0['update'](_0x184117)[_0x7207('0x1f')](function(_0x1251d9){return _0x1251d9;});}return null;};}function removeEntity(_0x3690ad,_0x1a0f4e){return function(_0x548def){if(_0x548def){return _0x548def[_0x7207('0x20')]()[_0x7207('0x1f')](function(){_0x3690ad[_0x7207('0x14')](0xcc)[_0x7207('0x21')]();});}};}function handleEntityNotFound(_0x1cd11d,_0x3dfafe){return function(_0x18080b){if(!_0x18080b){_0x1cd11d['sendStatus'](0x194);}return _0x18080b;};}function handleError(_0x43dfa3,_0x433e26){_0x433e26=_0x433e26||0x1f4;return function(_0x273983){logger[_0x7207('0x22')](_0x273983[_0x7207('0x23')]);if(_0x273983[_0x7207('0x24')]){delete _0x273983[_0x7207('0x24')];}_0x43dfa3[_0x7207('0x14')](_0x433e26)[_0x7207('0x25')](_0x273983);};}exports[_0x7207('0x26')]=function(_0x1a9871,_0x131cdf){var _0x26d735={},_0x4e35ef={},_0xd6e26e={'count':0x0,'rows':[]};var _0x4c17c7=_[_0x7207('0x27')](db[_0x7207('0x28')][_0x7207('0x29')],function(_0x10ce1d){return{'name':_0x10ce1d[_0x7207('0x2a')],'type':_0x10ce1d['type'][_0x7207('0x2b')]};});_0x4e35ef[_0x7207('0x2c')]=_['map'](_0x4c17c7,_0x7207('0x24'));_0x4e35ef['query']=_[_0x7207('0x2d')](_0x1a9871[_0x7207('0x2e')]);_0x4e35ef[_0x7207('0x2f')]=_['intersection'](_0x4e35ef[_0x7207('0x2c')],_0x4e35ef['query']);_0x26d735[_0x7207('0x30')]=_[_0x7207('0x31')](_0x4e35ef['model'],qs[_0x7207('0x32')](_0x1a9871[_0x7207('0x2e')][_0x7207('0x32')]));_0x26d735['attributes']=_0x26d735[_0x7207('0x30')]['length']?_0x26d735[_0x7207('0x30')]:_0x4e35ef[_0x7207('0x2c')];if(!_0x1a9871[_0x7207('0x2e')]['hasOwnProperty'](_0x7207('0x33'))){_0x26d735[_0x7207('0x18')]=qs['limit'](_0x1a9871[_0x7207('0x2e')]['limit']);_0x26d735[_0x7207('0x15')]=qs[_0x7207('0x15')](_0x1a9871[_0x7207('0x2e')][_0x7207('0x15')]);}_0x26d735[_0x7207('0x34')]=qs['sort'](_0x1a9871[_0x7207('0x2e')]['sort']);_0x26d735[_0x7207('0x35')]=qs[_0x7207('0x2f')](_[_0x7207('0x36')](_0x1a9871[_0x7207('0x2e')],_0x4e35ef[_0x7207('0x2f')]),_0x4c17c7);if(_0x1a9871[_0x7207('0x2e')][_0x7207('0x37')]){_0x26d735['where']=_[_0x7207('0x38')](_0x26d735[_0x7207('0x35')],{'$or':_[_0x7207('0x27')](_0x4c17c7,function(_0x149bac){if(_0x149bac[_0x7207('0x39')]!==_0x7207('0x3a')){var _0xadab01={};_0xadab01[_0x149bac[_0x7207('0x24')]]={'$like':'%'+_0x1a9871[_0x7207('0x2e')]['filter']+'%'};return _0xadab01;}})});}_0x26d735=_[_0x7207('0x38')]({},_0x26d735,_0x1a9871[_0x7207('0x3b')]);var _0x3a3e68={'where':_0x26d735[_0x7207('0x35')]};return db['FaxTransferReport']['count'](_0x3a3e68)[_0x7207('0x1f')](function(_0x3ffc02){_0xd6e26e['count']=_0x3ffc02;if(_0x1a9871[_0x7207('0x2e')][_0x7207('0x3c')]){_0x26d735['include']=[{'all':!![]}];}return db['FaxTransferReport'][_0x7207('0x3d')](_0x26d735);})[_0x7207('0x1f')](function(_0x4504f6){_0xd6e26e['rows']=_0x4504f6;return _0xd6e26e;})[_0x7207('0x1f')](respondWithFilteredResult(_0x131cdf,_0x26d735))['catch'](handleError(_0x131cdf,null));};exports[_0x7207('0x3e')]=function(_0x3b0754,_0x5c3a73){var _0x5efbe3={'raw':!![],'where':{'id':_0x3b0754[_0x7207('0x3f')]['id']}},_0x5c71ff={};_0x5c71ff[_0x7207('0x2c')]=_[_0x7207('0x2d')](db[_0x7207('0x28')][_0x7207('0x29')]);_0x5c71ff[_0x7207('0x2e')]=_[_0x7207('0x2d')](_0x3b0754['query']);_0x5c71ff[_0x7207('0x2f')]=_['intersection'](_0x5c71ff[_0x7207('0x2c')],_0x5c71ff['query']);_0x5efbe3[_0x7207('0x30')]=_[_0x7207('0x31')](_0x5c71ff[_0x7207('0x2c')],qs['fields'](_0x3b0754['query'][_0x7207('0x32')]));_0x5efbe3[_0x7207('0x30')]=_0x5efbe3[_0x7207('0x30')][_0x7207('0x40')]?_0x5efbe3[_0x7207('0x30')]:_0x5c71ff[_0x7207('0x2c')];if(_0x3b0754[_0x7207('0x2e')][_0x7207('0x3c')]){_0x5efbe3[_0x7207('0x41')]=[{'all':!![]}];}_0x5efbe3=_[_0x7207('0x38')]({},_0x5efbe3,_0x3b0754[_0x7207('0x3b')]);return db[_0x7207('0x28')][_0x7207('0x42')](_0x5efbe3)[_0x7207('0x1f')](handleEntityNotFound(_0x5c3a73,null))[_0x7207('0x1f')](respondWithResult(_0x5c3a73,null))[_0x7207('0x43')](handleError(_0x5c3a73,null));};exports['create']=function(_0x99f8ce,_0x5d3ffc){return db[_0x7207('0x28')][_0x7207('0x44')](_0x99f8ce[_0x7207('0x45')],{})['then'](respondWithResult(_0x5d3ffc,0xc9))['catch'](handleError(_0x5d3ffc,null));};exports['update']=function(_0x55333a,_0x1e985a){if(_0x55333a[_0x7207('0x45')]['id']){delete _0x55333a[_0x7207('0x45')]['id'];}return db[_0x7207('0x28')]['find']({'where':{'id':_0x55333a['params']['id']}})[_0x7207('0x1f')](handleEntityNotFound(_0x1e985a,null))['then'](saveUpdates(_0x55333a['body'],null))[_0x7207('0x1f')](respondWithResult(_0x1e985a,null))[_0x7207('0x43')](handleError(_0x1e985a,null));};exports[_0x7207('0x20')]=function(_0x54c964,_0x5e974e){return db[_0x7207('0x28')]['find']({'where':{'id':_0x54c964[_0x7207('0x3f')]['id']}})[_0x7207('0x1f')](handleEntityNotFound(_0x5e974e,null))[_0x7207('0x1f')](removeEntity(_0x5e974e,null))['catch'](handleError(_0x5e974e,null));};exports[_0x7207('0x46')]=function(_0x4f9b35,_0x4779b7){return db[_0x7207('0x28')][_0x7207('0x46')]()['then'](respondWithResult(_0x4779b7,null))['catch'](handleError(_0x4779b7,null));}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.model.js b/server/api/faxTransferReport/faxTransferReport.model.js index 3290e59..1acd76c 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 _0x86bc=['./faxTransferReport.attributes','FaxTransferReport','report_fax_transfer','uniqueid','lodash','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x38b54a,_0x2ad269){var _0x23e4d7=function(_0x35c172){while(--_0x35c172){_0x38b54a['push'](_0x38b54a['shift']());}};_0x23e4d7(++_0x2ad269);}(_0x86bc,0x1b1));var _0xc86b=function(_0x31b8f4,_0x37503d){_0x31b8f4=_0x31b8f4-0x0;var _0x3ae503=_0x86bc[_0x31b8f4];return _0x3ae503;};'use strict';var _=require(_0xc86b('0x0'));var util=require('util');var logger=require(_0xc86b('0x1'))(_0xc86b('0x2'));var moment=require(_0xc86b('0x3'));var BPromise=require(_0xc86b('0x4'));var rp=require(_0xc86b('0x5'));var fs=require('fs');var path=require(_0xc86b('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xc86b('0x7'));module['exports']=function(_0x31fa18,_0x4fc10a){return _0x31fa18['define'](_0xc86b('0x8'),attributes,{'tableName':_0xc86b('0x9'),'paranoid':![],'indexes':[{'name':_0xc86b('0xa'),'fields':[_0xc86b('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xbfcf=['exports','define','FaxTransferReport','report_fax_transfer','uniqueid','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','./faxTransferReport.attributes'];(function(_0x32fa62,_0x5bda6c){var _0x4ea736=function(_0x6451f3){while(--_0x6451f3){_0x32fa62['push'](_0x32fa62['shift']());}};_0x4ea736(++_0x5bda6c);}(_0xbfcf,0x1a9));var _0xfbfc=function(_0x30c649,_0x2ebbac){_0x30c649=_0x30c649-0x0;var _0x3edfb9=_0xbfcf[_0x30c649];return _0x3edfb9;};'use strict';var _=require(_0xfbfc('0x0'));var util=require(_0xfbfc('0x1'));var logger=require(_0xfbfc('0x2'))(_0xfbfc('0x3'));var moment=require(_0xfbfc('0x4'));var BPromise=require('bluebird');var rp=require(_0xfbfc('0x5'));var fs=require('fs');var path=require(_0xfbfc('0x6'));var rimraf=require(_0xfbfc('0x7'));var config=require('../../config/environment');var attributes=require(_0xfbfc('0x8'));module[_0xfbfc('0x9')]=function(_0x16d76f,_0x18e501){return _0x16d76f[_0xfbfc('0xa')](_0xfbfc('0xb'),attributes,{'tableName':_0xfbfc('0xc'),'paranoid':![],'indexes':[{'name':_0xfbfc('0xd'),'fields':[_0xfbfc('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.rpc.js b/server/api/faxTransferReport/faxTransferReport.rpc.js index a0fbf77..ad6139e 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 _0xb719=['http','request','info','FaxTransferReport,\x20%s,\x20%s','request\x20sent','debug','FaxTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client'];(function(_0x2601b4,_0x315e78){var _0x3e3661=function(_0x13b45b){while(--_0x13b45b){_0x2601b4['push'](_0x2601b4['shift']());}};_0x3e3661(++_0x315e78);}(_0xb719,0x1ef));var _0x9b71=function(_0x580b15,_0x28afa4){_0x580b15=_0x580b15-0x0;var _0x1adb1b=_0xb719[_0x580b15];return _0x1adb1b;};'use strict';var _=require(_0x9b71('0x0'));var util=require(_0x9b71('0x1'));var moment=require(_0x9b71('0x2'));var BPromise=require(_0x9b71('0x3'));var rs=require(_0x9b71('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9b71('0x5'))['db'];var utils=require(_0x9b71('0x6'));var logger=require(_0x9b71('0x7'))(_0x9b71('0x8'));var config=require('../../config/environment');var jayson=require(_0x9b71('0x9'));var client=jayson[_0x9b71('0xa')][_0x9b71('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x344205,_0x494a27,_0x3e24fc){return new BPromise(function(_0xfd9b2,_0x20bc32){return client[_0x9b71('0xc')](_0x344205,_0x3e24fc)['then'](function(_0x6c4af7){logger[_0x9b71('0xd')](_0x9b71('0xe'),_0x494a27,_0x9b71('0xf'));logger[_0x9b71('0x10')](_0x9b71('0x11'),_0x494a27,_0x9b71('0xf'),JSON[_0x9b71('0x12')](_0x6c4af7));if(_0x6c4af7[_0x9b71('0x13')]){if(_0x6c4af7['error'][_0x9b71('0x14')]===0x1f4){logger[_0x9b71('0x13')]('FaxTransferReport,\x20%s,\x20%s',_0x494a27,_0x6c4af7[_0x9b71('0x13')][_0x9b71('0x15')]);return _0x20bc32(_0x6c4af7[_0x9b71('0x13')]['message']);}logger[_0x9b71('0x13')](_0x9b71('0xe'),_0x494a27,_0x6c4af7['error'][_0x9b71('0x15')]);return _0xfd9b2(_0x6c4af7[_0x9b71('0x13')]['message']);}else{logger[_0x9b71('0xd')](_0x9b71('0xe'),_0x494a27,'request\x20sent');_0xfd9b2(_0x6c4af7[_0x9b71('0x16')]['message']);}})['catch'](function(_0x34cfe2){logger['error'](_0x9b71('0xe'),_0x494a27,_0x34cfe2);_0x20bc32(_0x34cfe2);});});} \ No newline at end of file +var _0x22f5=['catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request','then','info','request\x20sent','FaxTransferReport,\x20%s,\x20%s,\x20%s','error','FaxTransferReport,\x20%s,\x20%s','message'];(function(_0x1894ba,_0x42ccd4){var _0x589dd8=function(_0x47995e){while(--_0x47995e){_0x1894ba['push'](_0x1894ba['shift']());}};_0x589dd8(++_0x42ccd4);}(_0x22f5,0x1e1));var _0x522f=function(_0xb59a2a,_0x388f8d){_0xb59a2a=_0xb59a2a-0x0;var _0x49325b=_0x22f5[_0xb59a2a];return _0x49325b;};'use strict';var _=require(_0x522f('0x0'));var util=require('util');var moment=require(_0x522f('0x1'));var BPromise=require(_0x522f('0x2'));var rs=require(_0x522f('0x3'));var fs=require('fs');var Redis=require(_0x522f('0x4'));var db=require(_0x522f('0x5'))['db'];var utils=require(_0x522f('0x6'));var logger=require(_0x522f('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x522f('0x8'));var client=jayson[_0x522f('0x9')][_0x522f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xc13d9f,_0x48ed6e,_0x28645c){return new BPromise(function(_0x52c2f6,_0x4e0234){return client[_0x522f('0xb')](_0xc13d9f,_0x28645c)[_0x522f('0xc')](function(_0x209324){logger[_0x522f('0xd')]('FaxTransferReport,\x20%s,\x20%s',_0x48ed6e,_0x522f('0xe'));logger['debug'](_0x522f('0xf'),_0x48ed6e,_0x522f('0xe'),JSON['stringify'](_0x209324));if(_0x209324[_0x522f('0x10')]){if(_0x209324[_0x522f('0x10')]['code']===0x1f4){logger['error'](_0x522f('0x11'),_0x48ed6e,_0x209324[_0x522f('0x10')][_0x522f('0x12')]);return _0x4e0234(_0x209324['error'][_0x522f('0x12')]);}logger['error'](_0x522f('0x11'),_0x48ed6e,_0x209324[_0x522f('0x10')][_0x522f('0x12')]);return _0x52c2f6(_0x209324[_0x522f('0x10')][_0x522f('0x12')]);}else{logger['info'](_0x522f('0x11'),_0x48ed6e,'request\x20sent');_0x52c2f6(_0x209324['result'][_0x522f('0x12')]);}})[_0x522f('0x13')](function(_0x38fde0){logger['error']('FaxTransferReport,\x20%s,\x20%s',_0x48ed6e,_0x38fde0);_0x4e0234(_0x38fde0);});});} \ No newline at end of file diff --git a/server/api/faxTransferReport/index.js b/server/api/faxTransferReport/index.js index 68374ac..3e1258a 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 _0x7d69=['show','post','create','delete','exports','multer','util','path','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id'];(function(_0x5b3950,_0x4e5556){var _0x41e436=function(_0x139e30){while(--_0x139e30){_0x5b3950['push'](_0x5b3950['shift']());}};_0x41e436(++_0x4e5556);}(_0x7d69,0x16e));var _0x97d6=function(_0x1e1eb5,_0xfe6f6d){_0x1e1eb5=_0x1e1eb5-0x0;var _0x4abf44=_0x7d69[_0x1e1eb5];return _0x4abf44;};'use strict';var multer=require(_0x97d6('0x0'));var util=require(_0x97d6('0x1'));var path=require(_0x97d6('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x97d6('0x3'));var auth=require(_0x97d6('0x4'));var interaction=require(_0x97d6('0x5'));var config=require(_0x97d6('0x6'));var controller=require(_0x97d6('0x7'));router[_0x97d6('0x8')]('/',auth[_0x97d6('0x9')](),controller[_0x97d6('0xa')]);router[_0x97d6('0x8')](_0x97d6('0xb'),auth['isAuthenticated'](),controller[_0x97d6('0xc')]);router[_0x97d6('0x8')](_0x97d6('0xd'),auth[_0x97d6('0x9')](),controller[_0x97d6('0xe')]);router[_0x97d6('0xf')]('/',auth[_0x97d6('0x9')](),controller[_0x97d6('0x10')]);router['put'](_0x97d6('0xd'),auth[_0x97d6('0x9')](),controller['update']);router[_0x97d6('0x11')](_0x97d6('0xd'),auth[_0x97d6('0x9')](),controller['destroy']);module[_0x97d6('0x12')]=router; \ No newline at end of file +var _0xaf58=['connect-timeout','express','Router','fs-extra','../../components/interaction/service','./faxTransferReport.controller','get','isAuthenticated','/describe','describe','/:id','post','create','put','update','delete','exports','util','path'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xaf58,0x154));var _0x8af5=function(_0x10d77a,_0xe783e9){_0x10d77a=_0x10d77a-0x0;var _0x198b7b=_0xaf58[_0x10d77a];return _0x198b7b;};'use strict';var multer=require('multer');var util=require(_0x8af5('0x0'));var path=require(_0x8af5('0x1'));var timeout=require(_0x8af5('0x2'));var express=require(_0x8af5('0x3'));var router=express[_0x8af5('0x4')]();var fs_extra=require(_0x8af5('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x8af5('0x6'));var config=require('../../config/environment');var controller=require(_0x8af5('0x7'));router[_0x8af5('0x8')]('/',auth[_0x8af5('0x9')](),controller['index']);router[_0x8af5('0x8')](_0x8af5('0xa'),auth[_0x8af5('0x9')](),controller[_0x8af5('0xb')]);router[_0x8af5('0x8')](_0x8af5('0xc'),auth[_0x8af5('0x9')](),controller['show']);router[_0x8af5('0xd')]('/',auth[_0x8af5('0x9')](),controller[_0x8af5('0xe')]);router[_0x8af5('0xf')](_0x8af5('0xc'),auth[_0x8af5('0x9')](),controller[_0x8af5('0x10')]);router[_0x8af5('0x11')](_0x8af5('0xc'),auth['isAuthenticated'](),controller['destroy']);module[_0x8af5('0x12')]=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/index.js b/server/api/intDeskAccount/index.js index b5db8bb..a4e99c8 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 _0x6d53=['delete','destroy','exports','multer','path','connect-timeout','Router','fs-extra','../../config/environment','isAuthenticated','index','/:id','show','getConfigurations','get','getFields','create','post','/:id/configurations','put','update'];(function(_0x710981,_0x2bd33c){var _0x428fb7=function(_0x52598a){while(--_0x52598a){_0x710981['push'](_0x710981['shift']());}};_0x428fb7(++_0x2bd33c);}(_0x6d53,0x168));var _0x36d5=function(_0x4e1abb,_0x37b03a){_0x4e1abb=_0x4e1abb-0x0;var _0x559051=_0x6d53[_0x4e1abb];return _0x559051;};'use strict';var multer=require(_0x36d5('0x0'));var util=require('util');var path=require(_0x36d5('0x1'));var timeout=require(_0x36d5('0x2'));var express=require('express');var router=express[_0x36d5('0x3')]();var fs_extra=require(_0x36d5('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x36d5('0x5'));var controller=require('./intDeskAccount.controller');router['get']('/',auth[_0x36d5('0x6')](),controller[_0x36d5('0x7')]);router['get'](_0x36d5('0x8'),auth[_0x36d5('0x6')](),controller[_0x36d5('0x9')]);router['get']('/:id/configurations',auth[_0x36d5('0x6')](),controller[_0x36d5('0xa')]);router[_0x36d5('0xb')]('/:id/fields',auth['isAuthenticated'](),controller[_0x36d5('0xc')]);router['post']('/',auth[_0x36d5('0x6')](),controller[_0x36d5('0xd')]);router[_0x36d5('0xe')](_0x36d5('0xf'),auth['isAuthenticated'](),controller['addConfiguration']);router[_0x36d5('0x10')](_0x36d5('0x8'),auth['isAuthenticated'](),controller[_0x36d5('0x11')]);router[_0x36d5('0x12')]('/:id',auth[_0x36d5('0x6')](),controller[_0x36d5('0x13')]);module[_0x36d5('0x14')]=router; \ No newline at end of file +var _0x7ca7=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDeskAccount.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','/:id/fields','create','post','update','delete','exports','util','connect-timeout','Router'];(function(_0x1776cd,_0x3e73e6){var _0x2ec24d=function(_0x385309){while(--_0x385309){_0x1776cd['push'](_0x1776cd['shift']());}};_0x2ec24d(++_0x3e73e6);}(_0x7ca7,0x75));var _0x77ca=function(_0x4e0026,_0x2b52b6){_0x4e0026=_0x4e0026-0x0;var _0x3f8ee7=_0x7ca7[_0x4e0026];return _0x3f8ee7;};'use strict';var multer=require('multer');var util=require(_0x77ca('0x0'));var path=require('path');var timeout=require(_0x77ca('0x1'));var express=require('express');var router=express[_0x77ca('0x2')]();var fs_extra=require(_0x77ca('0x3'));var auth=require(_0x77ca('0x4'));var interaction=require(_0x77ca('0x5'));var config=require(_0x77ca('0x6'));var controller=require(_0x77ca('0x7'));router[_0x77ca('0x8')]('/',auth[_0x77ca('0x9')](),controller[_0x77ca('0xa')]);router['get'](_0x77ca('0xb'),auth[_0x77ca('0x9')](),controller[_0x77ca('0xc')]);router['get'](_0x77ca('0xd'),auth[_0x77ca('0x9')](),controller['getConfigurations']);router[_0x77ca('0x8')](_0x77ca('0xe'),auth[_0x77ca('0x9')](),controller['getFields']);router['post']('/',auth[_0x77ca('0x9')](),controller[_0x77ca('0xf')]);router[_0x77ca('0x10')]('/:id/configurations',auth[_0x77ca('0x9')](),controller['addConfiguration']);router['put'](_0x77ca('0xb'),auth[_0x77ca('0x9')](),controller[_0x77ca('0x11')]);router[_0x77ca('0x12')](_0x77ca('0xb'),auth[_0x77ca('0x9')](),controller['destroy']);module[_0x77ca('0x13')]=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.attributes.js b/server/api/intDeskAccount/intDeskAccount.attributes.js index 612730f..c790ac1 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 _0x9e6b=['sequelize','exports','STRING','ENUM','basic','integrationTab','newTab'];(function(_0x178e48,_0x3c9509){var _0x440d7e=function(_0xc2f8a0){while(--_0xc2f8a0){_0x178e48['push'](_0x178e48['shift']());}};_0x440d7e(++_0x3c9509);}(_0x9e6b,0x1dc));var _0xb9e6=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x9e6b[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require(_0xb9e6('0x0'));module[_0xb9e6('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0xb9e6('0x2')]},'remoteUri':{'type':Sequelize[_0xb9e6('0x2')]},'authType':{'type':Sequelize[_0xb9e6('0x3')](_0xb9e6('0x4')),'defaultValue':_0xb9e6('0x4')},'password':{'type':Sequelize[_0xb9e6('0x2')]},'consumerKey':{'type':Sequelize[_0xb9e6('0x2')]},'consumerSecret':{'type':Sequelize['STRING']},'token':{'type':Sequelize[_0xb9e6('0x2')]},'tokenSecret':{'type':Sequelize[_0xb9e6('0x2')]},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xb9e6('0x3')](_0xb9e6('0x5'),_0xb9e6('0x6')),'defaultValue':'integrationTab'}}; \ No newline at end of file +var _0xf5d3=['basic','integrationTab','sequelize','STRING','ENUM'];(function(_0xc6ea98,_0x1f0fe7){var _0x154999=function(_0x5c0555){while(--_0x5c0555){_0xc6ea98['push'](_0xc6ea98['shift']());}};_0x154999(++_0x1f0fe7);}(_0xf5d3,0xc5));var _0x3f5d=function(_0x255d5b,_0x4f6f35){_0x255d5b=_0x255d5b-0x0;var _0x3e141a=_0xf5d3[_0x255d5b];return _0x3e141a;};'use strict';var Sequelize=require(_0x3f5d('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x3f5d('0x1')]},'username':{'type':Sequelize[_0x3f5d('0x1')]},'remoteUri':{'type':Sequelize[_0x3f5d('0x1')]},'authType':{'type':Sequelize[_0x3f5d('0x2')](_0x3f5d('0x3')),'defaultValue':_0x3f5d('0x3')},'password':{'type':Sequelize[_0x3f5d('0x1')]},'consumerKey':{'type':Sequelize[_0x3f5d('0x1')]},'consumerSecret':{'type':Sequelize[_0x3f5d('0x1')]},'token':{'type':Sequelize[_0x3f5d('0x1')]},'tokenSecret':{'type':Sequelize[_0x3f5d('0x1')]},'serverUrl':{'type':Sequelize[_0x3f5d('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x3f5d('0x2')]('integrationTab','newTab'),'defaultValue':_0x3f5d('0x4')}}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.controller.js b/server/api/intDeskAccount/intDeskAccount.controller.js index 6cf0de0..1129b50 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 _0x513b=['channel','Descriptions','getDescriptions','DeskField','priority','remoteUri','username','password','consumerKey','consumerSecret','token','tokenSecret','slice','lastIndexOf','GET','format','application/json','authType','basic','headers','toString','base64','_embedded','entries','active','label','test','statusCode','error','getFields,\x20%s,\x20%s,\x20%s','getFields','stringify','Wrong\x20credentials','eml-format','rimraf','zip-dir','request-promise','moment','mustache','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','sendStatus','end','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','name','send','index','map','DeskAccount','rawAttributes','fieldName','type','key','keys','query','filters','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','options','include','findAll','catch','show','params','intersection','includeAll','create','body','find','findOne','DeskConfiguration','pick','getConfigurations','addConfiguration','Subjects','getSubjects'];(function(_0x491a7f,_0x28bb80){var _0x3d8f44=function(_0xdaa716){while(--_0xdaa716){_0x491a7f['push'](_0x491a7f['shift']());}};_0x3d8f44(++_0x28bb80);}(_0x513b,0x93));var _0xb513=function(_0x12860f,_0x128706){_0x12860f=_0x12860f-0x0;var _0x1f98e5=_0x513b[_0x12860f];return _0x1f98e5;};'use strict';var emlformat=require(_0xb513('0x0'));var rimraf=require(_0xb513('0x1'));var zipdir=require(_0xb513('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb513('0x3'));var moment=require(_0xb513('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xb513('0x5'));var util=require('util');var path=require(_0xb513('0x6'));var sox=require(_0xb513('0x7'));var csv=require(_0xb513('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb513('0x9'));var _=require(_0xb513('0xa'));var squel=require(_0xb513('0xb'));var crypto=require(_0xb513('0xc'));var jsforce=require(_0xb513('0xd'));var deskjs=require(_0xb513('0xe'));var toCsv=require(_0xb513('0x8'));var querystring=require(_0xb513('0xf'));var Papa=require(_0xb513('0x10'));var Redis=require(_0xb513('0x11'));var authService=require(_0xb513('0x12'));var qs=require(_0xb513('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb513('0x14'));var logger=require(_0xb513('0x15'))('api');var utils=require(_0xb513('0x16'));var config=require(_0xb513('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x3d5b5e,_0x1e0e04){_0x1e0e04=_0x1e0e04||0xcc;return function(_0x3a6404){if(_0x3a6404){return _0x3d5b5e[_0xb513('0x18')](_0x1e0e04);}return _0x3d5b5e['status'](_0x1e0e04)[_0xb513('0x19')]();};}function respondWithResult(_0x74cbde,_0xcdd0d7){_0xcdd0d7=_0xcdd0d7||0xc8;return function(_0x866ac9){if(_0x866ac9){return _0x74cbde[_0xb513('0x1a')](_0xcdd0d7)[_0xb513('0x1b')](_0x866ac9);}};}function respondWithFilteredResult(_0x2ee1ba,_0x37ee32){return function(_0x5a1a85){if(_0x5a1a85){var _0x114b72=typeof _0x37ee32[_0xb513('0x1c')]==='undefined'&&typeof _0x37ee32[_0xb513('0x1d')]===_0xb513('0x1e');var _0x2beb17=_0x5a1a85[_0xb513('0x1f')];var _0x352fff=_0x114b72?0x0:_0x37ee32[_0xb513('0x1c')];var _0x593a9d=_0x114b72?_0x5a1a85['count']:_0x37ee32[_0xb513('0x1c')]+_0x37ee32['limit'];var _0x3f545b;if(_0x593a9d>=_0x2beb17){_0x593a9d=_0x2beb17;_0x3f545b=0xc8;}else{_0x3f545b=0xce;}_0x2ee1ba[_0xb513('0x1a')](_0x3f545b);return _0x2ee1ba[_0xb513('0x20')](_0xb513('0x21'),_0x352fff+'-'+_0x593a9d+'/'+_0x2beb17)[_0xb513('0x1b')](_0x5a1a85);}return null;};}function patchUpdates(_0x400a44){return function(_0x5e1a16){try{jsonpatch[_0xb513('0x22')](_0x5e1a16,_0x400a44,!![]);}catch(_0x278e0d){return BPromise[_0xb513('0x23')](_0x278e0d);}return _0x5e1a16[_0xb513('0x24')]();};}function saveUpdates(_0x5422a1,_0x388861){return function(_0x5c4a25){if(_0x5c4a25){return _0x5c4a25[_0xb513('0x25')](_0x5422a1)[_0xb513('0x26')](function(_0x3fbf93){return _0x3fbf93;});}return null;};}function removeEntity(_0x138f3a,_0x128a7a){return function(_0x4e3d1a){if(_0x4e3d1a){return _0x4e3d1a[_0xb513('0x27')]()[_0xb513('0x26')](function(){_0x138f3a['status'](0xcc)[_0xb513('0x19')]();});}};}function handleEntityNotFound(_0x256d08,_0x1b317f){return function(_0x1a6fa5){if(!_0x1a6fa5){_0x256d08[_0xb513('0x18')](0x194);}return _0x1a6fa5;};}function handleError(_0x1fb413,_0x2abd87){_0x2abd87=_0x2abd87||0x1f4;return function(_0x424b30){logger['error'](_0x424b30['stack']);if(_0x424b30[_0xb513('0x28')]){delete _0x424b30[_0xb513('0x28')];}_0x1fb413[_0xb513('0x1a')](_0x2abd87)[_0xb513('0x29')](_0x424b30);};}exports[_0xb513('0x2a')]=function(_0x502e00,_0x40525e){var _0x19db1d={},_0x175def={},_0x56f301={'count':0x0,'rows':[]};var _0x2c033d=_[_0xb513('0x2b')](db[_0xb513('0x2c')][_0xb513('0x2d')],function(_0x231bdc){return{'name':_0x231bdc[_0xb513('0x2e')],'type':_0x231bdc[_0xb513('0x2f')][_0xb513('0x30')]};});_0x175def['model']=_['map'](_0x2c033d,'name');_0x175def['query']=_[_0xb513('0x31')](_0x502e00[_0xb513('0x32')]);_0x175def[_0xb513('0x33')]=_['intersection'](_0x175def[_0xb513('0x34')],_0x175def['query']);_0x19db1d[_0xb513('0x35')]=_['intersection'](_0x175def[_0xb513('0x34')],qs[_0xb513('0x36')](_0x502e00[_0xb513('0x32')][_0xb513('0x36')]));_0x19db1d[_0xb513('0x35')]=_0x19db1d[_0xb513('0x35')][_0xb513('0x37')]?_0x19db1d[_0xb513('0x35')]:_0x175def[_0xb513('0x34')];if(!_0x502e00['query'][_0xb513('0x38')](_0xb513('0x39'))){_0x19db1d[_0xb513('0x1d')]=qs[_0xb513('0x1d')](_0x502e00[_0xb513('0x32')][_0xb513('0x1d')]);_0x19db1d[_0xb513('0x1c')]=qs['offset'](_0x502e00['query'][_0xb513('0x1c')]);}_0x19db1d[_0xb513('0x3a')]=qs[_0xb513('0x3b')](_0x502e00[_0xb513('0x32')][_0xb513('0x3b')]);_0x19db1d[_0xb513('0x3c')]=qs[_0xb513('0x33')](_['pick'](_0x502e00[_0xb513('0x32')],_0x175def[_0xb513('0x33')]),_0x2c033d);if(_0x502e00[_0xb513('0x32')][_0xb513('0x3d')]){_0x19db1d[_0xb513('0x3c')]=_[_0xb513('0x3e')](_0x19db1d[_0xb513('0x3c')],{'$or':_[_0xb513('0x2b')](_0x2c033d,function(_0x1ad83f){if(_0x1ad83f[_0xb513('0x2f')]!=='VIRTUAL'){var _0x403c1={};_0x403c1[_0x1ad83f['name']]={'$like':'%'+_0x502e00['query'][_0xb513('0x3d')]+'%'};return _0x403c1;}})});}_0x19db1d=_[_0xb513('0x3e')]({},_0x19db1d,_0x502e00[_0xb513('0x3f')]);var _0x43d0b2={'where':_0x19db1d[_0xb513('0x3c')]};return db['DeskAccount'][_0xb513('0x1f')](_0x43d0b2)[_0xb513('0x26')](function(_0x275f41){_0x56f301[_0xb513('0x1f')]=_0x275f41;if(_0x502e00['query']['includeAll']){_0x19db1d[_0xb513('0x40')]=[{'all':!![]}];}return db['DeskAccount'][_0xb513('0x41')](_0x19db1d);})[_0xb513('0x26')](function(_0xf64a4c){_0x56f301['rows']=_0xf64a4c;return _0x56f301;})[_0xb513('0x26')](respondWithFilteredResult(_0x40525e,_0x19db1d))[_0xb513('0x42')](handleError(_0x40525e,null));};exports[_0xb513('0x43')]=function(_0x4ce37e,_0x3aeab0){var _0x28fc84={'raw':![],'where':{'id':_0x4ce37e[_0xb513('0x44')]['id']}},_0x4ae2f8={};_0x4ae2f8[_0xb513('0x34')]=_['keys'](db[_0xb513('0x2c')][_0xb513('0x2d')]);_0x4ae2f8['query']=_[_0xb513('0x31')](_0x4ce37e[_0xb513('0x32')]);_0x4ae2f8[_0xb513('0x33')]=_['intersection'](_0x4ae2f8[_0xb513('0x34')],_0x4ae2f8[_0xb513('0x32')]);_0x28fc84[_0xb513('0x35')]=_[_0xb513('0x45')](_0x4ae2f8['model'],qs[_0xb513('0x36')](_0x4ce37e[_0xb513('0x32')][_0xb513('0x36')]));_0x28fc84['attributes']=_0x28fc84[_0xb513('0x35')][_0xb513('0x37')]?_0x28fc84['attributes']:_0x4ae2f8[_0xb513('0x34')];if(_0x4ce37e[_0xb513('0x32')][_0xb513('0x46')]){_0x28fc84[_0xb513('0x40')]=[{'all':!![]}];}_0x28fc84=_[_0xb513('0x3e')]({},_0x28fc84,_0x4ce37e['options']);return db[_0xb513('0x2c')]['find'](_0x28fc84)[_0xb513('0x26')](handleEntityNotFound(_0x3aeab0,null))[_0xb513('0x26')](respondWithResult(_0x3aeab0,null))[_0xb513('0x42')](handleError(_0x3aeab0,null));};exports['create']=function(_0x223855,_0x17e79d){return db[_0xb513('0x2c')][_0xb513('0x47')](_0x223855[_0xb513('0x48')],{})['then'](respondWithResult(_0x17e79d,0xc9))[_0xb513('0x42')](handleError(_0x17e79d,null));};exports['update']=function(_0x31aad5,_0x1a3f15){if(_0x31aad5[_0xb513('0x48')]['id']){delete _0x31aad5[_0xb513('0x48')]['id'];}return db[_0xb513('0x2c')][_0xb513('0x49')]({'where':{'id':_0x31aad5[_0xb513('0x44')]['id']}})[_0xb513('0x26')](handleEntityNotFound(_0x1a3f15,null))['then'](saveUpdates(_0x31aad5['body'],null))[_0xb513('0x26')](respondWithResult(_0x1a3f15,null))['catch'](handleError(_0x1a3f15,null));};exports['destroy']=function(_0x403f1b,_0x2bd6b6){return db['DeskAccount'][_0xb513('0x49')]({'where':{'id':_0x403f1b[_0xb513('0x44')]['id']}})['then'](handleEntityNotFound(_0x2bd6b6,null))[_0xb513('0x26')](removeEntity(_0x2bd6b6,null))[_0xb513('0x42')](handleError(_0x2bd6b6,null));};exports['getConfigurations']=function(_0x56c568,_0x5bd258,_0x1f5084){var _0x3af401={};var _0x16ac52={};var _0x4b6b34;var _0x23504d;return db[_0xb513('0x2c')][_0xb513('0x4a')]({'where':{'id':_0x56c568['params']['id']}})['then'](handleEntityNotFound(_0x5bd258,null))[_0xb513('0x26')](function(_0x2cc80d){if(_0x2cc80d){_0x4b6b34=_0x2cc80d;_0x16ac52[_0xb513('0x34')]=_['keys'](db[_0xb513('0x4b')][_0xb513('0x2d')]);_0x16ac52['query']=_['keys'](_0x56c568[_0xb513('0x32')]);_0x16ac52[_0xb513('0x33')]=_['intersection'](_0x16ac52[_0xb513('0x34')],_0x16ac52[_0xb513('0x32')]);_0x3af401[_0xb513('0x35')]=_[_0xb513('0x45')](_0x16ac52[_0xb513('0x34')],qs[_0xb513('0x36')](_0x56c568[_0xb513('0x32')][_0xb513('0x36')]));_0x3af401[_0xb513('0x35')]=_0x3af401[_0xb513('0x35')]['length']?_0x3af401[_0xb513('0x35')]:_0x16ac52[_0xb513('0x34')];_0x3af401[_0xb513('0x3a')]=qs['sort'](_0x56c568[_0xb513('0x32')][_0xb513('0x3b')]);_0x3af401[_0xb513('0x3c')]=qs['filters'](_[_0xb513('0x4c')](_0x56c568[_0xb513('0x32')],_0x16ac52[_0xb513('0x33')]));if(_0x56c568[_0xb513('0x32')][_0xb513('0x3d')]){_0x3af401[_0xb513('0x3c')]=_[_0xb513('0x3e')](_0x3af401[_0xb513('0x3c')],{'$or':_[_0xb513('0x2b')](_0x3af401['attributes'],function(_0x1bf48c){var _0xad620a={};_0xad620a[_0x1bf48c]={'$like':'%'+_0x56c568[_0xb513('0x32')][_0xb513('0x3d')]+'%'};return _0xad620a;})});}_0x3af401=_[_0xb513('0x3e')]({},_0x3af401,_0x56c568[_0xb513('0x3f')]);return _0x4b6b34[_0xb513('0x4d')](_0x3af401);}})[_0xb513('0x26')](function(_0x291a55){if(_0x291a55){_0x23504d=_0x291a55['length'];if(!_0x56c568[_0xb513('0x32')][_0xb513('0x38')]('nolimit')){_0x3af401[_0xb513('0x1d')]=qs[_0xb513('0x1d')](_0x56c568[_0xb513('0x32')][_0xb513('0x1d')]);_0x3af401[_0xb513('0x1c')]=qs['offset'](_0x56c568[_0xb513('0x32')][_0xb513('0x1c')]);}return _0x4b6b34[_0xb513('0x4d')](_0x3af401);}})['then'](function(_0xfd5b4d){if(_0xfd5b4d){return _0xfd5b4d?{'count':_0x23504d,'rows':_0xfd5b4d}:null;}})[_0xb513('0x26')](respondWithResult(_0x5bd258,null))[_0xb513('0x42')](handleError(_0x5bd258,null));};exports[_0xb513('0x4e')]=function(_0x479c5c,_0x45e72a,_0x3cd4e1){if(_0x479c5c[_0xb513('0x48')]['id']){delete _0x479c5c[_0xb513('0x48')]['id'];}return db['DeskAccount'][_0xb513('0x4a')]({'where':{'id':_0x479c5c[_0xb513('0x44')]['id']}})[_0xb513('0x26')](handleEntityNotFound(_0x45e72a,null))[_0xb513('0x26')](function(_0x2d53fc){if(_0x2d53fc){_0x479c5c[_0xb513('0x48')]['AccountId']=_0x2d53fc['id'];_0x479c5c['body'][_0xb513('0x4f')]=integrations[_0xb513('0x50')](_0x479c5c['body'][_0xb513('0x51')],_0x479c5c[_0xb513('0x48')][_0xb513('0x2f')]);_0x479c5c['body'][_0xb513('0x52')]=integrations[_0xb513('0x53')](_0x479c5c['body'][_0xb513('0x51')],_0x479c5c[_0xb513('0x48')][_0xb513('0x2f')]);return db[_0xb513('0x4b')][_0xb513('0x47')](_0x479c5c[_0xb513('0x48')],{'include':[{'model':db[_0xb513('0x54')],'as':_0xb513('0x4f')},{'model':db['DeskField'],'as':'Descriptions'}]});}return null;})[_0xb513('0x26')](respondWithResult(_0x45e72a,null))[_0xb513('0x42')](handleError(_0x45e72a,null));};exports['getFields']=function(_0x4d3e6e,_0x5c68cf,_0x364a56){var _0x3b92df=[{'name':'priority','label':_0xb513('0x55'),'custom':![],'options':[{'name':0x1,'value':0x1},{'name':0x2,'value':0x2},{'name':0x3,'value':0x3},{'name':0x4,'value':0x4},{'name':0x5,'value':0x5},{'name':0x6,'value':0x6},{'name':0x7,'value':0x7},{'name':0x8,'value':0x8},{'name':0x9,'value':0x9},{'name':0xa,'value':0xa}]}];var _0x579eff='';return db[_0xb513('0x2c')][_0xb513('0x4a')]({'where':{'id':_0x4d3e6e['params']['id']},'attributes':['id',_0xb513('0x56'),'authType',_0xb513('0x57'),_0xb513('0x58'),_0xb513('0x59'),_0xb513('0x5a'),_0xb513('0x5b'),_0xb513('0x5c')]})[_0xb513('0x26')](handleEntityNotFound(_0x5c68cf,null))[_0xb513('0x26')](function(_0x2131c7){if(_0x2131c7){_0x579eff=_0x2131c7[_0xb513('0x56')];var _0x195306=_0x579eff[_0xb513('0x5d')](-0x1);if(_0x195306==='/'){_0x579eff=_0x579eff['substring'](0x0,_0x579eff[_0xb513('0x5e')](_0x195306));}var _0x4a22f2={'method':_0xb513('0x5f'),'uri':util[_0xb513('0x60')]('%s/custom_fields',_0x579eff),'headers':{'Content-Type':_0xb513('0x61'),'Accept':'application/json'},'json':!![]};if(_0x2131c7[_0xb513('0x62')]===_0xb513('0x63')){_0x4a22f2[_0xb513('0x64')]['Authorization']=util['format']('Basic\x20%s',new Buffer(util[_0xb513('0x60')]('%s:%s',_0x2131c7['username'],_0x2131c7[_0xb513('0x58')]))[_0xb513('0x65')](_0xb513('0x66')));}return rp(_0x4a22f2)[_0xb513('0x26')](function(_0x1b9ca9){return _0x3b92df['concat'](_['map'](_0x1b9ca9[_0xb513('0x67')][_0xb513('0x68')],function(_0x3b4616){return{'id':_0x3b4616['name'],'name':_0x3b4616['name'],'type':_0x3b4616['type'],'active':_0x3b4616[_0xb513('0x69')],'label':_0x3b4616[_0xb513('0x6a')],'custom':!![]};}));});}})[_0xb513('0x26')](function(_0x1af9e9){return{'count':_0x1af9e9[_0xb513('0x37')],'rows':_0x1af9e9};})['then'](respondWithResult(_0x5c68cf,null))[_0xb513('0x42')](function(_0x367230){var _0xf422a5=_0x4d3e6e[_0xb513('0x32')][_0xb513('0x6b')]?0x1f4:_0x367230[_0xb513('0x6c')]||0x1f4;logger[_0xb513('0x6d')](_0xb513('0x6e'),_0xb513('0x6f'),_0xf422a5,JSON[_0xb513('0x70')](_0x367230));delete _0x367230[_0xb513('0x28')];if(_0xf422a5===0x191){_0xf422a5=0x190;}_0x5c68cf[_0xb513('0x1a')](_0xf422a5)[_0xb513('0x29')](_0x4d3e6e['query'][_0xb513('0x6b')]?{'message':_0xb513('0x71'),'statusCode':_0x367230[_0xb513('0x6c')]}:_0x367230);});}; \ No newline at end of file +var _0xd497=['fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','type','VIRTUAL','merge','includeAll','include','catch','show','params','create','body','find','getConfigurations','findOne','DeskConfiguration','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','DeskField','getFields','priority','username','consumerKey','token','tokenSecret','remoteUri','slice','%s/custom_fields','application/json','headers','Authorization','Basic\x20%s','format','%s:%s','password','toString','base64','_embedded','entries','active','label','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','send','Wrong\x20credentials','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','crypto','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','status','end','json','limit','undefined','count','offset','set','Content-Range','reject','save','then','destroy','error','stack','name','index','map','DeskAccount','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes'];(function(_0x364390,_0x46b408){var _0x3cf60d=function(_0x551d05){while(--_0x551d05){_0x364390['push'](_0x364390['shift']());}};_0x3cf60d(++_0x46b408);}(_0xd497,0x117));var _0x7d49=function(_0x9fc5e9,_0x492d2a){_0x9fc5e9=_0x9fc5e9-0x0;var _0x4a4cdb=_0xd497[_0x9fc5e9];return _0x4a4cdb;};'use strict';var emlformat=require(_0x7d49('0x0'));var rimraf=require(_0x7d49('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x7d49('0x2'));var rp=require(_0x7d49('0x3'));var moment=require('moment');var BPromise=require(_0x7d49('0x4'));var Mustache=require(_0x7d49('0x5'));var util=require('util');var path=require(_0x7d49('0x6'));var sox=require(_0x7d49('0x7'));var csv=require(_0x7d49('0x8'));var ejs=require(_0x7d49('0x9'));var fs=require('fs');var fs_extra=require(_0x7d49('0xa'));var _=require(_0x7d49('0xb'));var squel=require('squel');var crypto=require(_0x7d49('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x7d49('0x8'));var querystring=require('querystring');var Papa=require(_0x7d49('0xd'));var Redis=require('ioredis');var authService=require(_0x7d49('0xe'));var qs=require(_0x7d49('0xf'));var as=require(_0x7d49('0x10'));var hardwareService=require(_0x7d49('0x11'));var logger=require(_0x7d49('0x12'))('api');var utils=require(_0x7d49('0x13'));var config=require(_0x7d49('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x7d49('0x15'))['db'];var integrations=require(_0x7d49('0x16'));function respondWithStatusCode(_0x70dc6e,_0x46569a){_0x46569a=_0x46569a||0xcc;return function(_0x35d51a){if(_0x35d51a){return _0x70dc6e['sendStatus'](_0x46569a);}return _0x70dc6e[_0x7d49('0x17')](_0x46569a)[_0x7d49('0x18')]();};}function respondWithResult(_0x240cb8,_0x1d9921){_0x1d9921=_0x1d9921||0xc8;return function(_0x3428d7){if(_0x3428d7){return _0x240cb8[_0x7d49('0x17')](_0x1d9921)[_0x7d49('0x19')](_0x3428d7);}};}function respondWithFilteredResult(_0x18e9da,_0x366ea6){return function(_0x2c95f7){if(_0x2c95f7){var _0x34aae3=typeof _0x366ea6['offset']==='undefined'&&typeof _0x366ea6[_0x7d49('0x1a')]===_0x7d49('0x1b');var _0x3b0534=_0x2c95f7[_0x7d49('0x1c')];var _0x5090c8=_0x34aae3?0x0:_0x366ea6[_0x7d49('0x1d')];var _0x3148ff=_0x34aae3?_0x2c95f7[_0x7d49('0x1c')]:_0x366ea6[_0x7d49('0x1d')]+_0x366ea6[_0x7d49('0x1a')];var _0x1afa06;if(_0x3148ff>=_0x3b0534){_0x3148ff=_0x3b0534;_0x1afa06=0xc8;}else{_0x1afa06=0xce;}_0x18e9da[_0x7d49('0x17')](_0x1afa06);return _0x18e9da[_0x7d49('0x1e')](_0x7d49('0x1f'),_0x5090c8+'-'+_0x3148ff+'/'+_0x3b0534)['json'](_0x2c95f7);}return null;};}function patchUpdates(_0x577d29){return function(_0x3dfaa8){try{jsonpatch['apply'](_0x3dfaa8,_0x577d29,!![]);}catch(_0x2c8257){return BPromise[_0x7d49('0x20')](_0x2c8257);}return _0x3dfaa8[_0x7d49('0x21')]();};}function saveUpdates(_0x1b223d,_0xd89209){return function(_0x583299){if(_0x583299){return _0x583299['update'](_0x1b223d)[_0x7d49('0x22')](function(_0x2550b7){return _0x2550b7;});}return null;};}function removeEntity(_0x29d9e2,_0x426ff3){return function(_0x1ae187){if(_0x1ae187){return _0x1ae187[_0x7d49('0x23')]()['then'](function(){_0x29d9e2[_0x7d49('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3a3801,_0x1eed0e){return function(_0x920f9a){if(!_0x920f9a){_0x3a3801['sendStatus'](0x194);}return _0x920f9a;};}function handleError(_0x519b2e,_0x5746c4){_0x5746c4=_0x5746c4||0x1f4;return function(_0x4fc634){logger[_0x7d49('0x24')](_0x4fc634[_0x7d49('0x25')]);if(_0x4fc634[_0x7d49('0x26')]){delete _0x4fc634['name'];}_0x519b2e[_0x7d49('0x17')](_0x5746c4)['send'](_0x4fc634);};}exports[_0x7d49('0x27')]=function(_0x33a9c5,_0x2747a3){var _0x4f649f={},_0x4944ec={},_0x22b88a={'count':0x0,'rows':[]};var _0x1d48e6=_[_0x7d49('0x28')](db[_0x7d49('0x29')][_0x7d49('0x2a')],function(_0x25e0f2){return{'name':_0x25e0f2[_0x7d49('0x2b')],'type':_0x25e0f2['type'][_0x7d49('0x2c')]};});_0x4944ec[_0x7d49('0x2d')]=_['map'](_0x1d48e6,'name');_0x4944ec[_0x7d49('0x2e')]=_[_0x7d49('0x2f')](_0x33a9c5[_0x7d49('0x2e')]);_0x4944ec[_0x7d49('0x30')]=_[_0x7d49('0x31')](_0x4944ec[_0x7d49('0x2d')],_0x4944ec[_0x7d49('0x2e')]);_0x4f649f[_0x7d49('0x32')]=_['intersection'](_0x4944ec[_0x7d49('0x2d')],qs[_0x7d49('0x33')](_0x33a9c5['query'][_0x7d49('0x33')]));_0x4f649f[_0x7d49('0x32')]=_0x4f649f[_0x7d49('0x32')][_0x7d49('0x34')]?_0x4f649f['attributes']:_0x4944ec[_0x7d49('0x2d')];if(!_0x33a9c5[_0x7d49('0x2e')][_0x7d49('0x35')](_0x7d49('0x36'))){_0x4f649f[_0x7d49('0x1a')]=qs[_0x7d49('0x1a')](_0x33a9c5[_0x7d49('0x2e')][_0x7d49('0x1a')]);_0x4f649f['offset']=qs[_0x7d49('0x1d')](_0x33a9c5['query'][_0x7d49('0x1d')]);}_0x4f649f[_0x7d49('0x37')]=qs[_0x7d49('0x38')](_0x33a9c5[_0x7d49('0x2e')][_0x7d49('0x38')]);_0x4f649f[_0x7d49('0x39')]=qs[_0x7d49('0x30')](_[_0x7d49('0x3a')](_0x33a9c5[_0x7d49('0x2e')],_0x4944ec[_0x7d49('0x30')]),_0x1d48e6);if(_0x33a9c5['query'][_0x7d49('0x3b')]){_0x4f649f[_0x7d49('0x39')]=_['merge'](_0x4f649f[_0x7d49('0x39')],{'$or':_[_0x7d49('0x28')](_0x1d48e6,function(_0x274c61){if(_0x274c61[_0x7d49('0x3c')]!==_0x7d49('0x3d')){var _0x291571={};_0x291571[_0x274c61['name']]={'$like':'%'+_0x33a9c5[_0x7d49('0x2e')][_0x7d49('0x3b')]+'%'};return _0x291571;}})});}_0x4f649f=_[_0x7d49('0x3e')]({},_0x4f649f,_0x33a9c5['options']);var _0x43e7a6={'where':_0x4f649f[_0x7d49('0x39')]};return db[_0x7d49('0x29')][_0x7d49('0x1c')](_0x43e7a6)[_0x7d49('0x22')](function(_0x2e4809){_0x22b88a['count']=_0x2e4809;if(_0x33a9c5[_0x7d49('0x2e')][_0x7d49('0x3f')]){_0x4f649f[_0x7d49('0x40')]=[{'all':!![]}];}return db['DeskAccount']['findAll'](_0x4f649f);})['then'](function(_0x2cfc20){_0x22b88a['rows']=_0x2cfc20;return _0x22b88a;})['then'](respondWithFilteredResult(_0x2747a3,_0x4f649f))[_0x7d49('0x41')](handleError(_0x2747a3,null));};exports[_0x7d49('0x42')]=function(_0x3d810b,_0x48591e){var _0x55dc2c={'raw':![],'where':{'id':_0x3d810b[_0x7d49('0x43')]['id']}},_0x317d7b={};_0x317d7b[_0x7d49('0x2d')]=_[_0x7d49('0x2f')](db[_0x7d49('0x29')][_0x7d49('0x2a')]);_0x317d7b[_0x7d49('0x2e')]=_[_0x7d49('0x2f')](_0x3d810b[_0x7d49('0x2e')]);_0x317d7b[_0x7d49('0x30')]=_['intersection'](_0x317d7b[_0x7d49('0x2d')],_0x317d7b[_0x7d49('0x2e')]);_0x55dc2c[_0x7d49('0x32')]=_[_0x7d49('0x31')](_0x317d7b[_0x7d49('0x2d')],qs[_0x7d49('0x33')](_0x3d810b['query']['fields']));_0x55dc2c[_0x7d49('0x32')]=_0x55dc2c[_0x7d49('0x32')][_0x7d49('0x34')]?_0x55dc2c[_0x7d49('0x32')]:_0x317d7b[_0x7d49('0x2d')];if(_0x3d810b['query'][_0x7d49('0x3f')]){_0x55dc2c[_0x7d49('0x40')]=[{'all':!![]}];}_0x55dc2c=_[_0x7d49('0x3e')]({},_0x55dc2c,_0x3d810b['options']);return db[_0x7d49('0x29')]['find'](_0x55dc2c)[_0x7d49('0x22')](handleEntityNotFound(_0x48591e,null))[_0x7d49('0x22')](respondWithResult(_0x48591e,null))['catch'](handleError(_0x48591e,null));};exports[_0x7d49('0x44')]=function(_0x4d09df,_0x48a4a8){return db[_0x7d49('0x29')]['create'](_0x4d09df['body'],{})['then'](respondWithResult(_0x48a4a8,0xc9))[_0x7d49('0x41')](handleError(_0x48a4a8,null));};exports['update']=function(_0x31bd2c,_0x4ddcee){if(_0x31bd2c[_0x7d49('0x45')]['id']){delete _0x31bd2c[_0x7d49('0x45')]['id'];}return db[_0x7d49('0x29')][_0x7d49('0x46')]({'where':{'id':_0x31bd2c[_0x7d49('0x43')]['id']}})[_0x7d49('0x22')](handleEntityNotFound(_0x4ddcee,null))[_0x7d49('0x22')](saveUpdates(_0x31bd2c[_0x7d49('0x45')],null))[_0x7d49('0x22')](respondWithResult(_0x4ddcee,null))[_0x7d49('0x41')](handleError(_0x4ddcee,null));};exports[_0x7d49('0x23')]=function(_0x53e727,_0x2cb68f){return db['DeskAccount'][_0x7d49('0x46')]({'where':{'id':_0x53e727[_0x7d49('0x43')]['id']}})[_0x7d49('0x22')](handleEntityNotFound(_0x2cb68f,null))[_0x7d49('0x22')](removeEntity(_0x2cb68f,null))[_0x7d49('0x41')](handleError(_0x2cb68f,null));};exports[_0x7d49('0x47')]=function(_0x77e107,_0x175e97,_0x2ffd32){var _0x24ec8c={};var _0x151e77={};var _0x5a625d;var _0x153b02;return db[_0x7d49('0x29')][_0x7d49('0x48')]({'where':{'id':_0x77e107[_0x7d49('0x43')]['id']}})['then'](handleEntityNotFound(_0x175e97,null))[_0x7d49('0x22')](function(_0x1412f7){if(_0x1412f7){_0x5a625d=_0x1412f7;_0x151e77['model']=_[_0x7d49('0x2f')](db[_0x7d49('0x49')]['rawAttributes']);_0x151e77[_0x7d49('0x2e')]=_[_0x7d49('0x2f')](_0x77e107[_0x7d49('0x2e')]);_0x151e77[_0x7d49('0x30')]=_[_0x7d49('0x31')](_0x151e77[_0x7d49('0x2d')],_0x151e77['query']);_0x24ec8c[_0x7d49('0x32')]=_[_0x7d49('0x31')](_0x151e77['model'],qs[_0x7d49('0x33')](_0x77e107[_0x7d49('0x2e')][_0x7d49('0x33')]));_0x24ec8c[_0x7d49('0x32')]=_0x24ec8c[_0x7d49('0x32')][_0x7d49('0x34')]?_0x24ec8c['attributes']:_0x151e77['model'];_0x24ec8c[_0x7d49('0x37')]=qs[_0x7d49('0x38')](_0x77e107[_0x7d49('0x2e')][_0x7d49('0x38')]);_0x24ec8c[_0x7d49('0x39')]=qs[_0x7d49('0x30')](_[_0x7d49('0x3a')](_0x77e107['query'],_0x151e77['filters']));if(_0x77e107[_0x7d49('0x2e')][_0x7d49('0x3b')]){_0x24ec8c[_0x7d49('0x39')]=_[_0x7d49('0x3e')](_0x24ec8c[_0x7d49('0x39')],{'$or':_[_0x7d49('0x28')](_0x24ec8c['attributes'],function(_0x4a29ca){var _0xc35c51={};_0xc35c51[_0x4a29ca]={'$like':'%'+_0x77e107[_0x7d49('0x2e')][_0x7d49('0x3b')]+'%'};return _0xc35c51;})});}_0x24ec8c=_[_0x7d49('0x3e')]({},_0x24ec8c,_0x77e107['options']);return _0x5a625d['getConfigurations'](_0x24ec8c);}})[_0x7d49('0x22')](function(_0x4d5ab6){if(_0x4d5ab6){_0x153b02=_0x4d5ab6['length'];if(!_0x77e107['query'][_0x7d49('0x35')](_0x7d49('0x36'))){_0x24ec8c[_0x7d49('0x1a')]=qs['limit'](_0x77e107['query']['limit']);_0x24ec8c['offset']=qs[_0x7d49('0x1d')](_0x77e107[_0x7d49('0x2e')][_0x7d49('0x1d')]);}return _0x5a625d['getConfigurations'](_0x24ec8c);}})[_0x7d49('0x22')](function(_0x2f03c1){if(_0x2f03c1){return _0x2f03c1?{'count':_0x153b02,'rows':_0x2f03c1}:null;}})[_0x7d49('0x22')](respondWithResult(_0x175e97,null))[_0x7d49('0x41')](handleError(_0x175e97,null));};exports[_0x7d49('0x4a')]=function(_0x8c2341,_0x270ec9,_0x1b02a8){if(_0x8c2341[_0x7d49('0x45')]['id']){delete _0x8c2341['body']['id'];}return db[_0x7d49('0x29')][_0x7d49('0x48')]({'where':{'id':_0x8c2341[_0x7d49('0x43')]['id']}})[_0x7d49('0x22')](handleEntityNotFound(_0x270ec9,null))[_0x7d49('0x22')](function(_0x2635ee){if(_0x2635ee){_0x8c2341['body'][_0x7d49('0x4b')]=_0x2635ee['id'];_0x8c2341[_0x7d49('0x45')][_0x7d49('0x4c')]=integrations[_0x7d49('0x4d')](_0x8c2341['body'][_0x7d49('0x4e')],_0x8c2341[_0x7d49('0x45')][_0x7d49('0x3c')]);_0x8c2341['body'][_0x7d49('0x4f')]=integrations[_0x7d49('0x50')](_0x8c2341['body'][_0x7d49('0x4e')],_0x8c2341['body'][_0x7d49('0x3c')]);return db[_0x7d49('0x49')][_0x7d49('0x44')](_0x8c2341[_0x7d49('0x45')],{'include':[{'model':db[_0x7d49('0x51')],'as':_0x7d49('0x4c')},{'model':db[_0x7d49('0x51')],'as':_0x7d49('0x4f')}]});}return null;})['then'](respondWithResult(_0x270ec9,null))['catch'](handleError(_0x270ec9,null));};exports[_0x7d49('0x52')]=function(_0x323ef8,_0x1cd764,_0x1f873c){var _0x3bbcce=[{'name':_0x7d49('0x53'),'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 _0x484e0b='';return db['DeskAccount']['findOne']({'where':{'id':_0x323ef8[_0x7d49('0x43')]['id']},'attributes':['id','remoteUri','authType',_0x7d49('0x54'),'password',_0x7d49('0x55'),'consumerSecret',_0x7d49('0x56'),_0x7d49('0x57')]})[_0x7d49('0x22')](handleEntityNotFound(_0x1cd764,null))['then'](function(_0x22277b){if(_0x22277b){_0x484e0b=_0x22277b[_0x7d49('0x58')];var _0x7cdf7b=_0x484e0b[_0x7d49('0x59')](-0x1);if(_0x7cdf7b==='/'){_0x484e0b=_0x484e0b['substring'](0x0,_0x484e0b['lastIndexOf'](_0x7cdf7b));}var _0x3ee299={'method':'GET','uri':util['format'](_0x7d49('0x5a'),_0x484e0b),'headers':{'Content-Type':'application/json','Accept':_0x7d49('0x5b')},'json':!![]};if(_0x22277b['authType']==='basic'){_0x3ee299[_0x7d49('0x5c')][_0x7d49('0x5d')]=util['format'](_0x7d49('0x5e'),new Buffer(util[_0x7d49('0x5f')](_0x7d49('0x60'),_0x22277b[_0x7d49('0x54')],_0x22277b[_0x7d49('0x61')]))[_0x7d49('0x62')](_0x7d49('0x63')));}return rp(_0x3ee299)[_0x7d49('0x22')](function(_0x53ad86){return _0x3bbcce['concat'](_[_0x7d49('0x28')](_0x53ad86[_0x7d49('0x64')][_0x7d49('0x65')],function(_0x34eabe){return{'id':_0x34eabe[_0x7d49('0x26')],'name':_0x34eabe[_0x7d49('0x26')],'type':_0x34eabe[_0x7d49('0x3c')],'active':_0x34eabe[_0x7d49('0x66')],'label':_0x34eabe[_0x7d49('0x67')],'custom':!![]};}));});}})['then'](function(_0x1b1171){return{'count':_0x1b1171[_0x7d49('0x34')],'rows':_0x1b1171};})[_0x7d49('0x22')](respondWithResult(_0x1cd764,null))[_0x7d49('0x41')](function(_0x406de6){var _0x3bd12f=_0x323ef8[_0x7d49('0x2e')][_0x7d49('0x68')]?0x1f4:_0x406de6[_0x7d49('0x69')]||0x1f4;logger['error'](_0x7d49('0x6a'),'getFields',_0x3bd12f,JSON[_0x7d49('0x6b')](_0x406de6));delete _0x406de6[_0x7d49('0x26')];if(_0x3bd12f===0x191){_0x3bd12f=0x190;}_0x1cd764['status'](_0x3bd12f)[_0x7d49('0x6c')](_0x323ef8[_0x7d49('0x2e')][_0x7d49('0x68')]?{'message':_0x7d49('0x6d'),'statusCode':_0x406de6[_0x7d49('0x69')]}:_0x406de6);});}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.model.js b/server/api/intDeskAccount/intDeskAccount.model.js index d162186..aea09f9 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 _0x1dba=['define','lodash','util','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','../../components/integrations/configuration','exports'];(function(_0x9cd4c3,_0x1c9b2c){var _0x4c9025=function(_0x25b3c6){while(--_0x25b3c6){_0x9cd4c3['push'](_0x9cd4c3['shift']());}};_0x4c9025(++_0x1c9b2c);}(_0x1dba,0x9b));var _0xa1db=function(_0xfc9d45,_0x211060){_0xfc9d45=_0xfc9d45-0x0;var _0x557197=_0x1dba[_0xfc9d45];return _0x557197;};'use strict';var _=require(_0xa1db('0x0'));var util=require(_0xa1db('0x1'));var logger=require(_0xa1db('0x2'))(_0xa1db('0x3'));var moment=require(_0xa1db('0x4'));var BPromise=require('bluebird');var rp=require(_0xa1db('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa1db('0x6'));var config=require(_0xa1db('0x7'));var attributes=require('./intDeskAccount.attributes');var integrations=require(_0xa1db('0x8'));module[_0xa1db('0x9')]=function(_0x37b8a9,_0x3f160d){return _0x37b8a9[_0xa1db('0xa')]('DeskAccount',attributes,{'tableName':'int_desk_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2d4d=['./intDeskAccount.attributes','../../components/integrations/configuration','exports','define','DeskAccount','int_desk_accounts','lodash','util','api','moment','request-promise','path','rimraf','../../config/environment'];(function(_0x39204a,_0x55286f){var _0x129eef=function(_0x65022e){while(--_0x65022e){_0x39204a['push'](_0x39204a['shift']());}};_0x129eef(++_0x55286f);}(_0x2d4d,0x68));var _0xd2d4=function(_0x4b20e2,_0x1ac35f){_0x4b20e2=_0x4b20e2-0x0;var _0x2ae303=_0x2d4d[_0x4b20e2];return _0x2ae303;};'use strict';var _=require(_0xd2d4('0x0'));var util=require(_0xd2d4('0x1'));var logger=require('../../config/logger')(_0xd2d4('0x2'));var moment=require(_0xd2d4('0x3'));var BPromise=require('bluebird');var rp=require(_0xd2d4('0x4'));var fs=require('fs');var path=require(_0xd2d4('0x5'));var rimraf=require(_0xd2d4('0x6'));var config=require(_0xd2d4('0x7'));var attributes=require(_0xd2d4('0x8'));var integrations=require(_0xd2d4('0x9'));module[_0xd2d4('0xa')]=function(_0x417943,_0x304137){return _0x417943[_0xd2d4('0xb')](_0xd2d4('0xc'),attributes,{'tableName':_0xd2d4('0xd'),'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 d61cbd8..52ac65d 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 _0x5d1c=['include','map','model','stringify','ShowDeskAccount','find','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','DeskAccount,\x20%s,\x20%s','request\x20sent','debug','DeskAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetDeskAccount','DeskAccount','findAll','options','where','attributes','limit'];(function(_0x1ac804,_0x9777cd){var _0x6d9d1d=function(_0x330c20){while(--_0x330c20){_0x1ac804['push'](_0x1ac804['shift']());}};_0x6d9d1d(++_0x9777cd);}(_0x5d1c,0x110));var _0xc5d1=function(_0x4adf3a,_0x5f41e2){_0x4adf3a=_0x4adf3a-0x0;var _0x24dd3f=_0x5d1c[_0x4adf3a];return _0x24dd3f;};'use strict';var _=require(_0xc5d1('0x0'));var util=require(_0xc5d1('0x1'));var moment=require(_0xc5d1('0x2'));var BPromise=require(_0xc5d1('0x3'));var rs=require(_0xc5d1('0x4'));var fs=require('fs');var Redis=require(_0xc5d1('0x5'));var db=require(_0xc5d1('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xc5d1('0x7'))(_0xc5d1('0x8'));var config=require(_0xc5d1('0x9'));var jayson=require(_0xc5d1('0xa'));var client=jayson[_0xc5d1('0xb')][_0xc5d1('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x369b44,_0x39a2db,_0x4d6b6b){return new BPromise(function(_0x27e419,_0xe62bea){return client[_0xc5d1('0xd')](_0x369b44,_0x4d6b6b)[_0xc5d1('0xe')](function(_0x33a0eb){logger[_0xc5d1('0xf')](_0xc5d1('0x10'),_0x39a2db,_0xc5d1('0x11'));logger[_0xc5d1('0x12')](_0xc5d1('0x13'),_0x39a2db,_0xc5d1('0x11'),JSON['stringify'](_0x33a0eb));if(_0x33a0eb[_0xc5d1('0x14')]){if(_0x33a0eb[_0xc5d1('0x14')][_0xc5d1('0x15')]===0x1f4){logger[_0xc5d1('0x14')]('DeskAccount,\x20%s,\x20%s',_0x39a2db,_0x33a0eb[_0xc5d1('0x14')][_0xc5d1('0x16')]);return _0xe62bea(_0x33a0eb[_0xc5d1('0x14')][_0xc5d1('0x16')]);}logger[_0xc5d1('0x14')](_0xc5d1('0x10'),_0x39a2db,_0x33a0eb['error']['message']);return _0x27e419(_0x33a0eb[_0xc5d1('0x14')][_0xc5d1('0x16')]);}else{logger['info'](_0xc5d1('0x10'),_0x39a2db,'request\x20sent');_0x27e419(_0x33a0eb[_0xc5d1('0x17')][_0xc5d1('0x16')]);}})[_0xc5d1('0x18')](function(_0x111e9e){logger[_0xc5d1('0x14')](_0xc5d1('0x10'),_0x39a2db,_0x111e9e);_0xe62bea(_0x111e9e);});});}exports[_0xc5d1('0x19')]=function(_0x553343){var _0x1400fb=this;return new Promise(function(_0x299fef,_0x5d5bb4){return db[_0xc5d1('0x1a')][_0xc5d1('0x1b')]({'raw':_0x553343[_0xc5d1('0x1c')]?_0x553343[_0xc5d1('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x553343[_0xc5d1('0x1c')]?_0x553343[_0xc5d1('0x1c')][_0xc5d1('0x1d')]||null:null,'attributes':_0x553343[_0xc5d1('0x1c')]?_0x553343[_0xc5d1('0x1c')][_0xc5d1('0x1e')]||null:null,'limit':_0x553343['options']?_0x553343['options'][_0xc5d1('0x1f')]||null:null,'include':_0x553343[_0xc5d1('0x1c')]?_0x553343[_0xc5d1('0x1c')][_0xc5d1('0x20')]?_[_0xc5d1('0x21')](_0x553343[_0xc5d1('0x1c')][_0xc5d1('0x20')],function(_0x433d64){return{'model':db[_0x433d64['model']],'as':_0x433d64['as'],'attributes':_0x433d64[_0xc5d1('0x1e')],'include':_0x433d64[_0xc5d1('0x20')]?_['map'](_0x433d64['include'],function(_0x321387){return{'model':db[_0x321387[_0xc5d1('0x22')]],'as':_0x321387['as'],'attributes':_0x321387[_0xc5d1('0x1e')],'include':_0x321387[_0xc5d1('0x20')]?_[_0xc5d1('0x21')](_0x321387[_0xc5d1('0x20')],function(_0x543a60){return{'model':db[_0x543a60[_0xc5d1('0x22')]],'as':_0x543a60['as'],'attributes':_0x543a60[_0xc5d1('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xc5d1('0xe')](function(_0x39732f){logger[_0xc5d1('0xf')](_0xc5d1('0x19'),_0x553343);logger[_0xc5d1('0x12')](_0xc5d1('0x19'),_0x553343,JSON[_0xc5d1('0x23')](_0x39732f));_0x299fef(_0x39732f);})[_0xc5d1('0x18')](function(_0x13ace0){logger['error']('GetDeskAccount',_0x13ace0[_0xc5d1('0x16')],_0x553343);_0x5d5bb4(_0x1400fb[_0xc5d1('0x14')](0x1f4,_0x13ace0[_0xc5d1('0x16')]));});});};exports[_0xc5d1('0x24')]=function(_0xe68d42){var _0x2e0581=this;return new Promise(function(_0x17b608,_0x4a1c17){return db['DeskAccount'][_0xc5d1('0x25')]({'raw':_0xe68d42[_0xc5d1('0x1c')]?_0xe68d42['options']['raw']===undefined?!![]:![]:!![],'where':_0xe68d42['options']?_0xe68d42[_0xc5d1('0x1c')][_0xc5d1('0x1d')]||null:null,'attributes':_0xe68d42[_0xc5d1('0x1c')]?_0xe68d42[_0xc5d1('0x1c')]['attributes']||null:null,'include':_0xe68d42[_0xc5d1('0x1c')]?_0xe68d42['options'][_0xc5d1('0x20')]?_[_0xc5d1('0x21')](_0xe68d42['options'][_0xc5d1('0x20')],function(_0x4f8059){return{'model':db[_0x4f8059[_0xc5d1('0x22')]],'as':_0x4f8059['as'],'attributes':_0x4f8059[_0xc5d1('0x1e')],'include':_0x4f8059['include']?_[_0xc5d1('0x21')](_0x4f8059[_0xc5d1('0x20')],function(_0x1f4a56){return{'model':db[_0x1f4a56[_0xc5d1('0x22')]],'as':_0x1f4a56['as'],'attributes':_0x1f4a56['attributes'],'include':_0x1f4a56['include']?_[_0xc5d1('0x21')](_0x1f4a56[_0xc5d1('0x20')],function(_0x528867){return{'model':db[_0x528867[_0xc5d1('0x22')]],'as':_0x528867['as'],'attributes':_0x528867[_0xc5d1('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xc5d1('0xe')](function(_0x5f1794){logger['info'](_0xc5d1('0x24'),_0xe68d42);logger[_0xc5d1('0x12')](_0xc5d1('0x24'),_0xe68d42,JSON[_0xc5d1('0x23')](_0x5f1794));_0x17b608(_0x5f1794);})[_0xc5d1('0x18')](function(_0x3b59f0){logger['error'](_0xc5d1('0x24'),_0x3b59f0[_0xc5d1('0x16')],_0xe68d42);_0x4a1c17(_0x2e0581['error'](0x1f4,_0x3b59f0[_0xc5d1('0x16')]));});});}; \ No newline at end of file +var _0x70bc=['DeskAccount','find','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','DeskAccount,\x20%s,\x20%s','request\x20sent','debug','DeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','GetDeskAccount','options','raw','attributes','limit','include','map','model','catch','ShowDeskAccount'];(function(_0x228a58,_0xad85c1){var _0x54c9b8=function(_0x956daa){while(--_0x956daa){_0x228a58['push'](_0x228a58['shift']());}};_0x54c9b8(++_0xad85c1);}(_0x70bc,0x1de));var _0xc70b=function(_0x5a988a,_0x49c65b){_0x5a988a=_0x5a988a-0x0;var _0x58ef6b=_0x70bc[_0x5a988a];return _0x58ef6b;};'use strict';var _=require(_0xc70b('0x0'));var util=require(_0xc70b('0x1'));var moment=require('moment');var BPromise=require(_0xc70b('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc70b('0x3'));var db=require(_0xc70b('0x4'))['db'];var utils=require(_0xc70b('0x5'));var logger=require(_0xc70b('0x6'))(_0xc70b('0x7'));var config=require('../../config/environment');var jayson=require(_0xc70b('0x8'));var client=jayson[_0xc70b('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5572d7,_0x567bf7,_0x5c9f57){return new BPromise(function(_0x49d394,_0x5a201c){return client[_0xc70b('0xa')](_0x5572d7,_0x5c9f57)[_0xc70b('0xb')](function(_0x1675d2){logger['info'](_0xc70b('0xc'),_0x567bf7,_0xc70b('0xd'));logger[_0xc70b('0xe')](_0xc70b('0xf'),_0x567bf7,_0xc70b('0xd'),JSON[_0xc70b('0x10')](_0x1675d2));if(_0x1675d2[_0xc70b('0x11')]){if(_0x1675d2[_0xc70b('0x11')][_0xc70b('0x12')]===0x1f4){logger['error'](_0xc70b('0xc'),_0x567bf7,_0x1675d2[_0xc70b('0x11')][_0xc70b('0x13')]);return _0x5a201c(_0x1675d2[_0xc70b('0x11')]['message']);}logger[_0xc70b('0x11')](_0xc70b('0xc'),_0x567bf7,_0x1675d2[_0xc70b('0x11')][_0xc70b('0x13')]);return _0x49d394(_0x1675d2[_0xc70b('0x11')][_0xc70b('0x13')]);}else{logger[_0xc70b('0x14')](_0xc70b('0xc'),_0x567bf7,_0xc70b('0xd'));_0x49d394(_0x1675d2[_0xc70b('0x15')][_0xc70b('0x13')]);}})['catch'](function(_0x56cc06){logger['error'](_0xc70b('0xc'),_0x567bf7,_0x56cc06);_0x5a201c(_0x56cc06);});});}exports[_0xc70b('0x16')]=function(_0x3d04c9){var _0x58409a=this;return new Promise(function(_0x1bbdfc,_0xd01878){return db['DeskAccount']['findAll']({'raw':_0x3d04c9[_0xc70b('0x17')]?_0x3d04c9[_0xc70b('0x17')][_0xc70b('0x18')]===undefined?!![]:![]:!![],'where':_0x3d04c9[_0xc70b('0x17')]?_0x3d04c9[_0xc70b('0x17')]['where']||null:null,'attributes':_0x3d04c9['options']?_0x3d04c9[_0xc70b('0x17')][_0xc70b('0x19')]||null:null,'limit':_0x3d04c9[_0xc70b('0x17')]?_0x3d04c9[_0xc70b('0x17')][_0xc70b('0x1a')]||null:null,'include':_0x3d04c9[_0xc70b('0x17')]?_0x3d04c9['options'][_0xc70b('0x1b')]?_[_0xc70b('0x1c')](_0x3d04c9['options'][_0xc70b('0x1b')],function(_0x159921){return{'model':db[_0x159921[_0xc70b('0x1d')]],'as':_0x159921['as'],'attributes':_0x159921[_0xc70b('0x19')],'include':_0x159921[_0xc70b('0x1b')]?_['map'](_0x159921['include'],function(_0x2d5239){return{'model':db[_0x2d5239['model']],'as':_0x2d5239['as'],'attributes':_0x2d5239[_0xc70b('0x19')],'include':_0x2d5239['include']?_[_0xc70b('0x1c')](_0x2d5239[_0xc70b('0x1b')],function(_0x4c1823){return{'model':db[_0x4c1823[_0xc70b('0x1d')]],'as':_0x4c1823['as'],'attributes':_0x4c1823[_0xc70b('0x19')]};}):[]};}):[]};}):[]:[]})[_0xc70b('0xb')](function(_0x223e54){logger['info']('GetDeskAccount',_0x3d04c9);logger['debug']('GetDeskAccount',_0x3d04c9,JSON['stringify'](_0x223e54));_0x1bbdfc(_0x223e54);})[_0xc70b('0x1e')](function(_0x3a720f){logger[_0xc70b('0x11')](_0xc70b('0x16'),_0x3a720f[_0xc70b('0x13')],_0x3d04c9);_0xd01878(_0x58409a['error'](0x1f4,_0x3a720f[_0xc70b('0x13')]));});});};exports[_0xc70b('0x1f')]=function(_0x5138cc){var _0x286df9=this;return new Promise(function(_0x568bac,_0xa31769){return db[_0xc70b('0x20')][_0xc70b('0x21')]({'raw':_0x5138cc[_0xc70b('0x17')]?_0x5138cc[_0xc70b('0x17')][_0xc70b('0x18')]===undefined?!![]:![]:!![],'where':_0x5138cc[_0xc70b('0x17')]?_0x5138cc[_0xc70b('0x17')]['where']||null:null,'attributes':_0x5138cc[_0xc70b('0x17')]?_0x5138cc[_0xc70b('0x17')]['attributes']||null:null,'include':_0x5138cc['options']?_0x5138cc[_0xc70b('0x17')]['include']?_['map'](_0x5138cc[_0xc70b('0x17')][_0xc70b('0x1b')],function(_0x45b558){return{'model':db[_0x45b558[_0xc70b('0x1d')]],'as':_0x45b558['as'],'attributes':_0x45b558[_0xc70b('0x19')],'include':_0x45b558[_0xc70b('0x1b')]?_[_0xc70b('0x1c')](_0x45b558[_0xc70b('0x1b')],function(_0x7ec641){return{'model':db[_0x7ec641[_0xc70b('0x1d')]],'as':_0x7ec641['as'],'attributes':_0x7ec641[_0xc70b('0x19')],'include':_0x7ec641['include']?_[_0xc70b('0x1c')](_0x7ec641[_0xc70b('0x1b')],function(_0x4bdd01){return{'model':db[_0x4bdd01['model']],'as':_0x4bdd01['as'],'attributes':_0x4bdd01['attributes']};}):[]};}):[]};}):[]:[]})[_0xc70b('0xb')](function(_0x4d780b){logger[_0xc70b('0x14')]('ShowDeskAccount',_0x5138cc);logger['debug']('ShowDeskAccount',_0x5138cc,JSON['stringify'](_0x4d780b));_0x568bac(_0x4d780b);})[_0xc70b('0x1e')](function(_0x28bbca){logger[_0xc70b('0x11')](_0xc70b('0x1f'),_0x28bbca[_0xc70b('0x13')],_0x5138cc);_0xa31769(_0x286df9[_0xc70b('0x11')](0x1f4,_0x28bbca[_0xc70b('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/index.js b/server/api/intDeskConfiguration/index.js index 61fe05c..6cb3405 100644 --- a/server/api/intDeskConfiguration/index.js +++ b/server/api/intDeskConfiguration/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3e74=['show','/:id/fields','getFields','getSubjects','/:id/descriptions','getDescriptions','getTags','post','/:id/tags','setTags','update','delete','exports','multer','path','connect-timeout','express','../../components/auth/service','../../config/environment','./intDeskConfiguration.controller','get','isAuthenticated','index','/:id'];(function(_0x14fdf3,_0x5e0e71){var _0x2a872d=function(_0xfbed92){while(--_0xfbed92){_0x14fdf3['push'](_0x14fdf3['shift']());}};_0x2a872d(++_0x5e0e71);}(_0x3e74,0x175));var _0x43e7=function(_0xe6c4c2,_0x320170){_0xe6c4c2=_0xe6c4c2-0x0;var _0x452c2f=_0x3e74[_0xe6c4c2];return _0x452c2f;};'use strict';var multer=require(_0x43e7('0x0'));var util=require('util');var path=require(_0x43e7('0x1'));var timeout=require(_0x43e7('0x2'));var express=require(_0x43e7('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x43e7('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x43e7('0x5'));var controller=require(_0x43e7('0x6'));router[_0x43e7('0x7')]('/',auth[_0x43e7('0x8')](),controller[_0x43e7('0x9')]);router['get'](_0x43e7('0xa'),auth[_0x43e7('0x8')](),controller[_0x43e7('0xb')]);router[_0x43e7('0x7')](_0x43e7('0xc'),auth['isAuthenticated'](),controller[_0x43e7('0xd')]);router['get']('/:id/subjects',auth[_0x43e7('0x8')](),controller[_0x43e7('0xe')]);router['get'](_0x43e7('0xf'),auth['isAuthenticated'](),controller[_0x43e7('0x10')]);router[_0x43e7('0x7')]('/:id/tags',auth[_0x43e7('0x8')](),controller[_0x43e7('0x11')]);router[_0x43e7('0x12')]('/',auth[_0x43e7('0x8')](),controller['create']);router['post'](_0x43e7('0x13'),auth[_0x43e7('0x8')](),controller[_0x43e7('0x14')]);router['put']('/:id',auth[_0x43e7('0x8')](),controller[_0x43e7('0x15')]);router[_0x43e7('0x16')](_0x43e7('0xa'),auth['isAuthenticated'](),controller['destroy']);module[_0x43e7('0x17')]=router; \ No newline at end of file +var _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(_0x493c8c,_0x470567){var _0x17344b=function(_0x47aee7){while(--_0x47aee7){_0x493c8c['push'](_0x493c8c['shift']());}};_0x17344b(++_0x470567);}(_0x55ca,0x126));var _0xa55c=function(_0xa9671b,_0x11378d){_0xa9671b=_0xa9671b-0x0;var _0x205591=_0x55ca[_0xa9671b];return _0x205591;};'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 915072c..d52399f 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 _0xa1f4=['STRING'];(function(_0x2c29c1,_0x44e05e){var _0x23ab89=function(_0x31ae89){while(--_0x31ae89){_0x2c29c1['push'](_0x2c29c1['shift']());}};_0x23ab89(++_0x44e05e);}(_0xa1f4,0x193));var _0x4a1f=function(_0x5535ef,_0x2759fc){_0x5535ef=_0x5535ef-0x0;var _0x3bceea=_0xa1f4[_0x5535ef];return _0x3bceea;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x4a1f('0x0')]},'description':{'type':Sequelize[_0x4a1f('0x0')]}}; \ No newline at end of file +var _0x30e8=['exports','STRING','sequelize'];(function(_0x1d7e08,_0xdbd667){var _0x5c0fb3=function(_0x190ce6){while(--_0x190ce6){_0x1d7e08['push'](_0x1d7e08['shift']());}};_0x5c0fb3(++_0xdbd667);}(_0x30e8,0xc2));var _0x830e=function(_0x405e2a,_0x1cbb5c){_0x405e2a=_0x405e2a-0x0;var _0x43e13e=_0x30e8[_0x405e2a];return _0x43e13e;};'use strict';var Sequelize=require(_0x830e('0x0'));module[_0x830e('0x1')]={'name':{'type':Sequelize[_0x830e('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.controller.js b/server/api/intDeskConfiguration/intDeskConfiguration.controller.js index 324c45e..5fd4824 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 _0xc292=['attributes','nolimit','sort','where','pick','type','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','fields','find','create','body','getFields','findOne','DeskField','order','filter','length','hasOwnProperty','getSubjects','getDescriptions','getTags','Tag','setTags','ids','eml-format','rimraf','fast-json-patch','mustache','util','path','sox','to-csv','ejs','fs-extra','crypto','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','undefined','limit','count','offset','set','Content-Range','apply','update','destroy','then','sendStatus','error','stack','name','send','map','DeskConfiguration','rawAttributes','key','model','query','keys','filters','intersection'];(function(_0x199aa7,_0x4e92cc){var _0x495dcc=function(_0x3b324f){while(--_0x3b324f){_0x199aa7['push'](_0x199aa7['shift']());}};_0x495dcc(++_0x4e92cc);}(_0xc292,0xc3));var _0x2c29=function(_0x215dc8,_0x52c245){_0x215dc8=_0x215dc8-0x0;var _0x583ea3=_0xc292[_0x215dc8];return _0x583ea3;};'use strict';var emlformat=require(_0x2c29('0x0'));var rimraf=require(_0x2c29('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2c29('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x2c29('0x3'));var util=require(_0x2c29('0x4'));var path=require(_0x2c29('0x5'));var sox=require(_0x2c29('0x6'));var csv=require(_0x2c29('0x7'));var ejs=require(_0x2c29('0x8'));var fs=require('fs');var fs_extra=require(_0x2c29('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x2c29('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x2c29('0xb'));var Redis=require(_0x2c29('0xc'));var authService=require(_0x2c29('0xd'));var qs=require(_0x2c29('0xe'));var as=require(_0x2c29('0xf'));var hardwareService=require(_0x2c29('0x10'));var logger=require('../../config/logger')(_0x2c29('0x11'));var utils=require('../../config/utils');var config=require(_0x2c29('0x12'));var licenseUtil=require(_0x2c29('0x13'));var db=require(_0x2c29('0x14'))['db'];function respondWithStatusCode(_0x44e18c,_0x31d334){_0x31d334=_0x31d334||0xcc;return function(_0x2fee79){if(_0x2fee79){return _0x44e18c['sendStatus'](_0x31d334);}return _0x44e18c['status'](_0x31d334)[_0x2c29('0x15')]();};}function respondWithResult(_0x431c13,_0x224240){_0x224240=_0x224240||0xc8;return function(_0x4a3157){if(_0x4a3157){return _0x431c13[_0x2c29('0x16')](_0x224240)[_0x2c29('0x17')](_0x4a3157);}};}function respondWithFilteredResult(_0x158f65,_0x168200){return function(_0x45569d){if(_0x45569d){var _0x57c128=typeof _0x168200['offset']===_0x2c29('0x18')&&typeof _0x168200[_0x2c29('0x19')]===_0x2c29('0x18');var _0xda5409=_0x45569d[_0x2c29('0x1a')];var _0xc59338=_0x57c128?0x0:_0x168200['offset'];var _0x36a6b9=_0x57c128?_0x45569d[_0x2c29('0x1a')]:_0x168200[_0x2c29('0x1b')]+_0x168200[_0x2c29('0x19')];var _0x5dbce8;if(_0x36a6b9>=_0xda5409){_0x36a6b9=_0xda5409;_0x5dbce8=0xc8;}else{_0x5dbce8=0xce;}_0x158f65['status'](_0x5dbce8);return _0x158f65[_0x2c29('0x1c')](_0x2c29('0x1d'),_0xc59338+'-'+_0x36a6b9+'/'+_0xda5409)[_0x2c29('0x17')](_0x45569d);}return null;};}function patchUpdates(_0x51e878){return function(_0x1f5046){try{jsonpatch[_0x2c29('0x1e')](_0x1f5046,_0x51e878,!![]);}catch(_0x5da554){return BPromise['reject'](_0x5da554);}return _0x1f5046['save']();};}function saveUpdates(_0x51f6c0,_0x34bac7){return function(_0x27e884){if(_0x27e884){return _0x27e884[_0x2c29('0x1f')](_0x51f6c0)['then'](function(_0x3f3617){return _0x3f3617;});}return null;};}function removeEntity(_0x416627,_0x85ef6d){return function(_0x4d537){if(_0x4d537){return _0x4d537[_0x2c29('0x20')]()[_0x2c29('0x21')](function(){_0x416627[_0x2c29('0x16')](0xcc)[_0x2c29('0x15')]();});}};}function handleEntityNotFound(_0x29d585,_0x142233){return function(_0x249be9){if(!_0x249be9){_0x29d585[_0x2c29('0x22')](0x194);}return _0x249be9;};}function handleError(_0x2cf9b1,_0x1ff890){_0x1ff890=_0x1ff890||0x1f4;return function(_0x45ffcb){logger[_0x2c29('0x23')](_0x45ffcb[_0x2c29('0x24')]);if(_0x45ffcb['name']){delete _0x45ffcb[_0x2c29('0x25')];}_0x2cf9b1[_0x2c29('0x16')](_0x1ff890)[_0x2c29('0x26')](_0x45ffcb);};}exports['index']=function(_0x3ace28,_0x1b05e9){var _0x33023b={},_0x47c395={},_0x470666={'count':0x0,'rows':[]};var _0x1783fe=_[_0x2c29('0x27')](db[_0x2c29('0x28')][_0x2c29('0x29')],function(_0x185c1a){return{'name':_0x185c1a['fieldName'],'type':_0x185c1a['type'][_0x2c29('0x2a')]};});_0x47c395[_0x2c29('0x2b')]=_[_0x2c29('0x27')](_0x1783fe,'name');_0x47c395[_0x2c29('0x2c')]=_[_0x2c29('0x2d')](_0x3ace28[_0x2c29('0x2c')]);_0x47c395[_0x2c29('0x2e')]=_[_0x2c29('0x2f')](_0x47c395[_0x2c29('0x2b')],_0x47c395[_0x2c29('0x2c')]);_0x33023b['attributes']=_[_0x2c29('0x2f')](_0x47c395[_0x2c29('0x2b')],qs['fields'](_0x3ace28[_0x2c29('0x2c')]['fields']));_0x33023b[_0x2c29('0x30')]=_0x33023b['attributes']['length']?_0x33023b[_0x2c29('0x30')]:_0x47c395['model'];if(!_0x3ace28[_0x2c29('0x2c')]['hasOwnProperty'](_0x2c29('0x31'))){_0x33023b[_0x2c29('0x19')]=qs[_0x2c29('0x19')](_0x3ace28[_0x2c29('0x2c')]['limit']);_0x33023b[_0x2c29('0x1b')]=qs[_0x2c29('0x1b')](_0x3ace28['query']['offset']);}_0x33023b['order']=qs[_0x2c29('0x32')](_0x3ace28[_0x2c29('0x2c')][_0x2c29('0x32')]);_0x33023b[_0x2c29('0x33')]=qs[_0x2c29('0x2e')](_[_0x2c29('0x34')](_0x3ace28[_0x2c29('0x2c')],_0x47c395['filters']),_0x1783fe);if(_0x3ace28[_0x2c29('0x2c')]['filter']){_0x33023b[_0x2c29('0x33')]=_['merge'](_0x33023b[_0x2c29('0x33')],{'$or':_[_0x2c29('0x27')](_0x1783fe,function(_0x3d46e6){if(_0x3d46e6[_0x2c29('0x35')]!==_0x2c29('0x36')){var _0x3a4c73={};_0x3a4c73[_0x3d46e6[_0x2c29('0x25')]]={'$like':'%'+_0x3ace28['query']['filter']+'%'};return _0x3a4c73;}})});}_0x33023b=_[_0x2c29('0x37')]({},_0x33023b,_0x3ace28[_0x2c29('0x38')]);var _0xda4d16={'where':_0x33023b[_0x2c29('0x33')]};return db[_0x2c29('0x28')][_0x2c29('0x1a')](_0xda4d16)[_0x2c29('0x21')](function(_0x26a936){_0x470666[_0x2c29('0x1a')]=_0x26a936;if(_0x3ace28[_0x2c29('0x2c')][_0x2c29('0x39')]){_0x33023b[_0x2c29('0x3a')]=[{'all':!![]}];}return db[_0x2c29('0x28')][_0x2c29('0x3b')](_0x33023b);})['then'](function(_0x42abb4){_0x470666[_0x2c29('0x3c')]=_0x42abb4;return _0x470666;})[_0x2c29('0x21')](respondWithFilteredResult(_0x1b05e9,_0x33023b))[_0x2c29('0x3d')](handleError(_0x1b05e9,null));};exports[_0x2c29('0x3e')]=function(_0x512845,_0x32ebfb){var _0x50be1a={'raw':![],'where':{'id':_0x512845[_0x2c29('0x3f')]['id']}},_0x4da784={};_0x4da784[_0x2c29('0x2b')]=_[_0x2c29('0x2d')](db['DeskConfiguration'][_0x2c29('0x29')]);_0x4da784['query']=_[_0x2c29('0x2d')](_0x512845[_0x2c29('0x2c')]);_0x4da784[_0x2c29('0x2e')]=_[_0x2c29('0x2f')](_0x4da784[_0x2c29('0x2b')],_0x4da784['query']);_0x50be1a[_0x2c29('0x30')]=_[_0x2c29('0x2f')](_0x4da784['model'],qs[_0x2c29('0x40')](_0x512845[_0x2c29('0x2c')]['fields']));_0x50be1a[_0x2c29('0x30')]=_0x50be1a[_0x2c29('0x30')]['length']?_0x50be1a[_0x2c29('0x30')]:_0x4da784[_0x2c29('0x2b')];if(_0x512845[_0x2c29('0x2c')][_0x2c29('0x39')]){_0x50be1a[_0x2c29('0x3a')]=[{'all':!![]}];}_0x50be1a=_[_0x2c29('0x37')]({},_0x50be1a,_0x512845[_0x2c29('0x38')]);return db[_0x2c29('0x28')][_0x2c29('0x41')](_0x50be1a)['then'](handleEntityNotFound(_0x32ebfb,null))[_0x2c29('0x21')](respondWithResult(_0x32ebfb,null))['catch'](handleError(_0x32ebfb,null));};exports[_0x2c29('0x42')]=function(_0xf34713,_0x1c53eb){return db[_0x2c29('0x28')]['create'](_0xf34713[_0x2c29('0x43')],{})[_0x2c29('0x21')](respondWithResult(_0x1c53eb,0xc9))['catch'](handleError(_0x1c53eb,null));};exports[_0x2c29('0x1f')]=function(_0x3dedd0,_0x5a2554){if(_0x3dedd0[_0x2c29('0x43')]['id']){delete _0x3dedd0[_0x2c29('0x43')]['id'];}return db[_0x2c29('0x28')]['find']({'where':{'id':_0x3dedd0[_0x2c29('0x3f')]['id']}})[_0x2c29('0x21')](handleEntityNotFound(_0x5a2554,null))[_0x2c29('0x21')](saveUpdates(_0x3dedd0[_0x2c29('0x43')],null))['then'](respondWithResult(_0x5a2554,null))['catch'](handleError(_0x5a2554,null));};exports[_0x2c29('0x20')]=function(_0x2abc1a,_0x5b62e0){return db['DeskConfiguration'][_0x2c29('0x41')]({'where':{'id':_0x2abc1a[_0x2c29('0x3f')]['id']}})[_0x2c29('0x21')](handleEntityNotFound(_0x5b62e0,null))[_0x2c29('0x21')](removeEntity(_0x5b62e0,null))['catch'](handleError(_0x5b62e0,null));};exports[_0x2c29('0x44')]=function(_0x1fce3d,_0x9f335c,_0x96d2c0){var _0xab5194={};var _0x4063b5={};var _0x5426fc;var _0x32b19b;return db[_0x2c29('0x28')][_0x2c29('0x45')]({'where':{'id':_0x1fce3d[_0x2c29('0x3f')]['id']}})[_0x2c29('0x21')](handleEntityNotFound(_0x9f335c,null))[_0x2c29('0x21')](function(_0x5c3725){if(_0x5c3725){_0x5426fc=_0x5c3725;_0x4063b5[_0x2c29('0x2b')]=_[_0x2c29('0x2d')](db[_0x2c29('0x46')][_0x2c29('0x29')]);_0x4063b5[_0x2c29('0x2c')]=_[_0x2c29('0x2d')](_0x1fce3d[_0x2c29('0x2c')]);_0x4063b5[_0x2c29('0x2e')]=_[_0x2c29('0x2f')](_0x4063b5['model'],_0x4063b5[_0x2c29('0x2c')]);_0xab5194['attributes']=_[_0x2c29('0x2f')](_0x4063b5[_0x2c29('0x2b')],qs['fields'](_0x1fce3d['query'][_0x2c29('0x40')]));_0xab5194[_0x2c29('0x30')]=_0xab5194[_0x2c29('0x30')]['length']?_0xab5194[_0x2c29('0x30')]:_0x4063b5[_0x2c29('0x2b')];_0xab5194[_0x2c29('0x47')]=qs[_0x2c29('0x32')](_0x1fce3d['query'][_0x2c29('0x32')]);_0xab5194[_0x2c29('0x33')]=qs['filters'](_[_0x2c29('0x34')](_0x1fce3d[_0x2c29('0x2c')],_0x4063b5[_0x2c29('0x2e')]));if(_0x1fce3d[_0x2c29('0x2c')][_0x2c29('0x48')]){_0xab5194[_0x2c29('0x33')]=_['merge'](_0xab5194['where'],{'$or':_[_0x2c29('0x27')](_0xab5194[_0x2c29('0x30')],function(_0x5acbb9){var _0x52ca38={};_0x52ca38[_0x5acbb9]={'$like':'%'+_0x1fce3d['query']['filter']+'%'};return _0x52ca38;})});}_0xab5194=_['merge']({},_0xab5194,_0x1fce3d[_0x2c29('0x38')]);return _0x5426fc['getFields'](_0xab5194);}})['then'](function(_0x499e3c){if(_0x499e3c){_0x32b19b=_0x499e3c[_0x2c29('0x49')];if(!_0x1fce3d['query'][_0x2c29('0x4a')](_0x2c29('0x31'))){_0xab5194['limit']=qs[_0x2c29('0x19')](_0x1fce3d[_0x2c29('0x2c')]['limit']);_0xab5194[_0x2c29('0x1b')]=qs[_0x2c29('0x1b')](_0x1fce3d[_0x2c29('0x2c')][_0x2c29('0x1b')]);}return _0x5426fc[_0x2c29('0x44')](_0xab5194);}})[_0x2c29('0x21')](function(_0x3ba8ef){if(_0x3ba8ef){return _0x3ba8ef?{'count':_0x32b19b,'rows':_0x3ba8ef}:null;}})[_0x2c29('0x21')](respondWithResult(_0x9f335c,null))[_0x2c29('0x3d')](handleError(_0x9f335c,null));};exports[_0x2c29('0x4b')]=function(_0x1de9e2,_0x2f368e,_0x1e0a78){var _0x12a62b={};var _0x59eb78={};var _0x310956;var _0x556317;return db['DeskConfiguration'][_0x2c29('0x45')]({'where':{'id':_0x1de9e2[_0x2c29('0x3f')]['id']}})[_0x2c29('0x21')](handleEntityNotFound(_0x2f368e,null))[_0x2c29('0x21')](function(_0x40605c){if(_0x40605c){_0x310956=_0x40605c;_0x59eb78[_0x2c29('0x2b')]=_[_0x2c29('0x2d')](db[_0x2c29('0x46')][_0x2c29('0x29')]);_0x59eb78[_0x2c29('0x2c')]=_['keys'](_0x1de9e2['query']);_0x59eb78[_0x2c29('0x2e')]=_[_0x2c29('0x2f')](_0x59eb78['model'],_0x59eb78[_0x2c29('0x2c')]);_0x12a62b['attributes']=_['intersection'](_0x59eb78['model'],qs[_0x2c29('0x40')](_0x1de9e2[_0x2c29('0x2c')][_0x2c29('0x40')]));_0x12a62b[_0x2c29('0x30')]=_0x12a62b[_0x2c29('0x30')]['length']?_0x12a62b['attributes']:_0x59eb78['model'];_0x12a62b[_0x2c29('0x47')]=qs['sort'](_0x1de9e2[_0x2c29('0x2c')][_0x2c29('0x32')]);_0x12a62b['where']=qs['filters'](_['pick'](_0x1de9e2['query'],_0x59eb78[_0x2c29('0x2e')]));if(_0x1de9e2[_0x2c29('0x2c')][_0x2c29('0x48')]){_0x12a62b[_0x2c29('0x33')]=_[_0x2c29('0x37')](_0x12a62b['where'],{'$or':_[_0x2c29('0x27')](_0x12a62b[_0x2c29('0x30')],function(_0xd455cb){var _0x587948={};_0x587948[_0xd455cb]={'$like':'%'+_0x1de9e2[_0x2c29('0x2c')][_0x2c29('0x48')]+'%'};return _0x587948;})});}_0x12a62b=_[_0x2c29('0x37')]({},_0x12a62b,_0x1de9e2[_0x2c29('0x38')]);return _0x310956[_0x2c29('0x4b')](_0x12a62b);}})[_0x2c29('0x21')](function(_0x54be19){if(_0x54be19){_0x556317=_0x54be19['length'];if(!_0x1de9e2[_0x2c29('0x2c')]['hasOwnProperty']('nolimit')){_0x12a62b[_0x2c29('0x19')]=qs['limit'](_0x1de9e2[_0x2c29('0x2c')]['limit']);_0x12a62b[_0x2c29('0x1b')]=qs[_0x2c29('0x1b')](_0x1de9e2['query'][_0x2c29('0x1b')]);}return _0x310956[_0x2c29('0x4b')](_0x12a62b);}})[_0x2c29('0x21')](function(_0x316337){if(_0x316337){return _0x316337?{'count':_0x556317,'rows':_0x316337}:null;}})[_0x2c29('0x21')](respondWithResult(_0x2f368e,null))[_0x2c29('0x3d')](handleError(_0x2f368e,null));};exports[_0x2c29('0x4c')]=function(_0x19e540,_0x10701f,_0x306a07){var _0x2afb99={};var _0x4eee24={};var _0x33d162;var _0x41fb13;return db['DeskConfiguration']['findOne']({'where':{'id':_0x19e540['params']['id']}})[_0x2c29('0x21')](handleEntityNotFound(_0x10701f,null))[_0x2c29('0x21')](function(_0x1b6d79){if(_0x1b6d79){_0x33d162=_0x1b6d79;_0x4eee24['model']=_[_0x2c29('0x2d')](db[_0x2c29('0x46')][_0x2c29('0x29')]);_0x4eee24['query']=_[_0x2c29('0x2d')](_0x19e540[_0x2c29('0x2c')]);_0x4eee24['filters']=_[_0x2c29('0x2f')](_0x4eee24[_0x2c29('0x2b')],_0x4eee24[_0x2c29('0x2c')]);_0x2afb99[_0x2c29('0x30')]=_[_0x2c29('0x2f')](_0x4eee24[_0x2c29('0x2b')],qs[_0x2c29('0x40')](_0x19e540[_0x2c29('0x2c')][_0x2c29('0x40')]));_0x2afb99['attributes']=_0x2afb99[_0x2c29('0x30')][_0x2c29('0x49')]?_0x2afb99[_0x2c29('0x30')]:_0x4eee24[_0x2c29('0x2b')];_0x2afb99[_0x2c29('0x47')]=qs[_0x2c29('0x32')](_0x19e540[_0x2c29('0x2c')][_0x2c29('0x32')]);_0x2afb99[_0x2c29('0x33')]=qs[_0x2c29('0x2e')](_['pick'](_0x19e540[_0x2c29('0x2c')],_0x4eee24[_0x2c29('0x2e')]));if(_0x19e540[_0x2c29('0x2c')]['filter']){_0x2afb99[_0x2c29('0x33')]=_[_0x2c29('0x37')](_0x2afb99[_0x2c29('0x33')],{'$or':_[_0x2c29('0x27')](_0x2afb99['attributes'],function(_0x2d86a0){var _0x4043b4={};_0x4043b4[_0x2d86a0]={'$like':'%'+_0x19e540[_0x2c29('0x2c')][_0x2c29('0x48')]+'%'};return _0x4043b4;})});}_0x2afb99=_[_0x2c29('0x37')]({},_0x2afb99,_0x19e540['options']);return _0x33d162['getDescriptions'](_0x2afb99);}})[_0x2c29('0x21')](function(_0x270911){if(_0x270911){_0x41fb13=_0x270911[_0x2c29('0x49')];if(!_0x19e540[_0x2c29('0x2c')][_0x2c29('0x4a')](_0x2c29('0x31'))){_0x2afb99['limit']=qs['limit'](_0x19e540[_0x2c29('0x2c')][_0x2c29('0x19')]);_0x2afb99[_0x2c29('0x1b')]=qs[_0x2c29('0x1b')](_0x19e540['query'][_0x2c29('0x1b')]);}return _0x33d162['getDescriptions'](_0x2afb99);}})['then'](function(_0x4c9ca5){if(_0x4c9ca5){return _0x4c9ca5?{'count':_0x41fb13,'rows':_0x4c9ca5}:null;}})[_0x2c29('0x21')](respondWithResult(_0x10701f,null))[_0x2c29('0x3d')](handleError(_0x10701f,null));};exports[_0x2c29('0x4d')]=function(_0x20f1cf,_0x518e73,_0x17a1d2){var _0xc79352={};var _0x1b4cd4={};var _0x42d0e4;var _0x187550;return db[_0x2c29('0x28')][_0x2c29('0x45')]({'where':{'id':_0x20f1cf[_0x2c29('0x3f')]['id']}})[_0x2c29('0x21')](handleEntityNotFound(_0x518e73,null))[_0x2c29('0x21')](function(_0x349c06){if(_0x349c06){_0x42d0e4=_0x349c06;_0x1b4cd4['model']=_[_0x2c29('0x2d')](db[_0x2c29('0x4e')][_0x2c29('0x29')]);_0x1b4cd4[_0x2c29('0x2c')]=_[_0x2c29('0x2d')](_0x20f1cf[_0x2c29('0x2c')]);_0x1b4cd4[_0x2c29('0x2e')]=_['intersection'](_0x1b4cd4[_0x2c29('0x2b')],_0x1b4cd4['query']);_0xc79352[_0x2c29('0x30')]=_[_0x2c29('0x2f')](_0x1b4cd4[_0x2c29('0x2b')],qs[_0x2c29('0x40')](_0x20f1cf[_0x2c29('0x2c')][_0x2c29('0x40')]));_0xc79352[_0x2c29('0x30')]=_0xc79352['attributes']['length']?_0xc79352[_0x2c29('0x30')]:_0x1b4cd4[_0x2c29('0x2b')];_0xc79352[_0x2c29('0x47')]=qs['sort'](_0x20f1cf[_0x2c29('0x2c')][_0x2c29('0x32')]);_0xc79352[_0x2c29('0x33')]=qs[_0x2c29('0x2e')](_[_0x2c29('0x34')](_0x20f1cf[_0x2c29('0x2c')],_0x1b4cd4[_0x2c29('0x2e')]));if(_0x20f1cf[_0x2c29('0x2c')]['filter']){_0xc79352[_0x2c29('0x33')]=_[_0x2c29('0x37')](_0xc79352[_0x2c29('0x33')],{'$or':_[_0x2c29('0x27')](_0xc79352[_0x2c29('0x30')],function(_0x52434a){var _0x1193ba={};_0x1193ba[_0x52434a]={'$like':'%'+_0x20f1cf[_0x2c29('0x2c')][_0x2c29('0x48')]+'%'};return _0x1193ba;})});}_0xc79352=_['merge']({},_0xc79352,_0x20f1cf[_0x2c29('0x38')]);return _0x42d0e4['getTags'](_0xc79352);}})[_0x2c29('0x21')](function(_0x8b1ffb){if(_0x8b1ffb){_0x187550=_0x8b1ffb['length'];if(!_0x20f1cf[_0x2c29('0x2c')][_0x2c29('0x4a')](_0x2c29('0x31'))){_0xc79352[_0x2c29('0x19')]=qs[_0x2c29('0x19')](_0x20f1cf[_0x2c29('0x2c')][_0x2c29('0x19')]);_0xc79352[_0x2c29('0x1b')]=qs[_0x2c29('0x1b')](_0x20f1cf[_0x2c29('0x2c')][_0x2c29('0x1b')]);}return _0x42d0e4['getTags'](_0xc79352);}})[_0x2c29('0x21')](function(_0x53ac24){if(_0x53ac24){return _0x53ac24?{'count':_0x187550,'rows':_0x53ac24}:null;}})[_0x2c29('0x21')](respondWithResult(_0x518e73,null))[_0x2c29('0x3d')](handleError(_0x518e73,null));};exports[_0x2c29('0x4f')]=function(_0xa209ab,_0x406f3d,_0xe671bd){if(_0xa209ab['body']['id']){delete _0xa209ab[_0x2c29('0x43')]['id'];}return db[_0x2c29('0x28')][_0x2c29('0x45')]({'where':{'id':_0xa209ab[_0x2c29('0x3f')]['id']}})[_0x2c29('0x21')](handleEntityNotFound(_0x406f3d,null))[_0x2c29('0x21')](function(_0x4f13ce){if(_0x4f13ce){return _0x4f13ce['setTags'](_0xa209ab['body'][_0x2c29('0x50')]||[]);}return null;})[_0x2c29('0x21')](respondWithResult(_0x406f3d,null))[_0x2c29('0x3d')](handleError(_0x406f3d,null));}; \ No newline at end of file +var _0x7981=['setTags','ids','eml-format','rimraf','request-promise','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','undefined','count','offset','set','Content-Range','reject','save','update','then','destroy','end','sendStatus','error','stack','name','send','index','map','DeskConfiguration','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','limit','order','sort','pick','where','VIRTUAL','filter','merge','options','includeAll','include','findAll','rows','catch','params','keys','find','create','body','findOne','DeskField','getFields','getSubjects','nolimit','getDescriptions','getTags','Tag'];(function(_0x1a597c,_0x36ee1c){var _0x8cd5d3=function(_0x41905e){while(--_0x41905e){_0x1a597c['push'](_0x1a597c['shift']());}};_0x8cd5d3(++_0x36ee1c);}(_0x7981,0x162));var _0x1798=function(_0x5a4971,_0x1ee9d5){_0x5a4971=_0x5a4971-0x0;var _0x380cf5=_0x7981[_0x5a4971];return _0x380cf5;};'use strict';var emlformat=require(_0x1798('0x0'));var rimraf=require(_0x1798('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x1798('0x2'));var moment=require(_0x1798('0x3'));var BPromise=require(_0x1798('0x4'));var Mustache=require(_0x1798('0x5'));var util=require('util');var path=require(_0x1798('0x6'));var sox=require(_0x1798('0x7'));var csv=require('to-csv');var ejs=require(_0x1798('0x8'));var fs=require('fs');var fs_extra=require(_0x1798('0x9'));var _=require(_0x1798('0xa'));var squel=require(_0x1798('0xb'));var crypto=require('crypto');var jsforce=require(_0x1798('0xc'));var deskjs=require(_0x1798('0xd'));var toCsv=require('to-csv');var querystring=require(_0x1798('0xe'));var Papa=require(_0x1798('0xf'));var Redis=require('ioredis');var authService=require(_0x1798('0x10'));var qs=require(_0x1798('0x11'));var as=require(_0x1798('0x12'));var hardwareService=require(_0x1798('0x13'));var logger=require(_0x1798('0x14'))(_0x1798('0x15'));var utils=require(_0x1798('0x16'));var config=require(_0x1798('0x17'));var licenseUtil=require(_0x1798('0x18'));var db=require(_0x1798('0x19'))['db'];function respondWithStatusCode(_0x48987f,_0x46fcd2){_0x46fcd2=_0x46fcd2||0xcc;return function(_0xceee48){if(_0xceee48){return _0x48987f['sendStatus'](_0x46fcd2);}return _0x48987f[_0x1798('0x1a')](_0x46fcd2)['end']();};}function respondWithResult(_0x3f742c,_0x17fa99){_0x17fa99=_0x17fa99||0xc8;return function(_0x4d8a2c){if(_0x4d8a2c){return _0x3f742c['status'](_0x17fa99)[_0x1798('0x1b')](_0x4d8a2c);}};}function respondWithFilteredResult(_0x1f93b4,_0x1c1562){return function(_0x350ed7){if(_0x350ed7){var _0x244c16=typeof _0x1c1562['offset']===_0x1798('0x1c')&&typeof _0x1c1562['limit']===_0x1798('0x1c');var _0xdbe3c3=_0x350ed7[_0x1798('0x1d')];var _0x3b5535=_0x244c16?0x0:_0x1c1562[_0x1798('0x1e')];var _0x52cde0=_0x244c16?_0x350ed7[_0x1798('0x1d')]:_0x1c1562[_0x1798('0x1e')]+_0x1c1562['limit'];var _0x35255b;if(_0x52cde0>=_0xdbe3c3){_0x52cde0=_0xdbe3c3;_0x35255b=0xc8;}else{_0x35255b=0xce;}_0x1f93b4[_0x1798('0x1a')](_0x35255b);return _0x1f93b4[_0x1798('0x1f')](_0x1798('0x20'),_0x3b5535+'-'+_0x52cde0+'/'+_0xdbe3c3)[_0x1798('0x1b')](_0x350ed7);}return null;};}function patchUpdates(_0x52fcad){return function(_0x22a709){try{jsonpatch['apply'](_0x22a709,_0x52fcad,!![]);}catch(_0xf7df24){return BPromise[_0x1798('0x21')](_0xf7df24);}return _0x22a709[_0x1798('0x22')]();};}function saveUpdates(_0x3db7af,_0x1bf8ce){return function(_0x3787bf){if(_0x3787bf){return _0x3787bf[_0x1798('0x23')](_0x3db7af)[_0x1798('0x24')](function(_0x1d0383){return _0x1d0383;});}return null;};}function removeEntity(_0x346a36,_0xc914db){return function(_0x24d6ba){if(_0x24d6ba){return _0x24d6ba[_0x1798('0x25')]()['then'](function(){_0x346a36[_0x1798('0x1a')](0xcc)[_0x1798('0x26')]();});}};}function handleEntityNotFound(_0x4c32e6,_0x537a99){return function(_0x276656){if(!_0x276656){_0x4c32e6[_0x1798('0x27')](0x194);}return _0x276656;};}function handleError(_0x599f73,_0x139863){_0x139863=_0x139863||0x1f4;return function(_0x2e683b){logger[_0x1798('0x28')](_0x2e683b[_0x1798('0x29')]);if(_0x2e683b['name']){delete _0x2e683b[_0x1798('0x2a')];}_0x599f73[_0x1798('0x1a')](_0x139863)[_0x1798('0x2b')](_0x2e683b);};}exports[_0x1798('0x2c')]=function(_0x1758e1,_0x4f640a){var _0x3c9c7e={},_0x2c9da7={},_0x38147e={'count':0x0,'rows':[]};var _0x466c15=_[_0x1798('0x2d')](db[_0x1798('0x2e')][_0x1798('0x2f')],function(_0xceb433){return{'name':_0xceb433[_0x1798('0x30')],'type':_0xceb433[_0x1798('0x31')][_0x1798('0x32')]};});_0x2c9da7[_0x1798('0x33')]=_[_0x1798('0x2d')](_0x466c15,_0x1798('0x2a'));_0x2c9da7[_0x1798('0x34')]=_['keys'](_0x1758e1[_0x1798('0x34')]);_0x2c9da7[_0x1798('0x35')]=_[_0x1798('0x36')](_0x2c9da7[_0x1798('0x33')],_0x2c9da7['query']);_0x3c9c7e['attributes']=_[_0x1798('0x36')](_0x2c9da7[_0x1798('0x33')],qs[_0x1798('0x37')](_0x1758e1['query'][_0x1798('0x37')]));_0x3c9c7e[_0x1798('0x38')]=_0x3c9c7e[_0x1798('0x38')][_0x1798('0x39')]?_0x3c9c7e[_0x1798('0x38')]:_0x2c9da7[_0x1798('0x33')];if(!_0x1758e1[_0x1798('0x34')][_0x1798('0x3a')]('nolimit')){_0x3c9c7e[_0x1798('0x3b')]=qs[_0x1798('0x3b')](_0x1758e1[_0x1798('0x34')][_0x1798('0x3b')]);_0x3c9c7e[_0x1798('0x1e')]=qs['offset'](_0x1758e1['query'][_0x1798('0x1e')]);}_0x3c9c7e[_0x1798('0x3c')]=qs['sort'](_0x1758e1['query'][_0x1798('0x3d')]);_0x3c9c7e['where']=qs[_0x1798('0x35')](_[_0x1798('0x3e')](_0x1758e1[_0x1798('0x34')],_0x2c9da7[_0x1798('0x35')]),_0x466c15);if(_0x1758e1[_0x1798('0x34')]['filter']){_0x3c9c7e[_0x1798('0x3f')]=_['merge'](_0x3c9c7e[_0x1798('0x3f')],{'$or':_[_0x1798('0x2d')](_0x466c15,function(_0x5a002e){if(_0x5a002e[_0x1798('0x31')]!==_0x1798('0x40')){var _0x407b57={};_0x407b57[_0x5a002e[_0x1798('0x2a')]]={'$like':'%'+_0x1758e1['query'][_0x1798('0x41')]+'%'};return _0x407b57;}})});}_0x3c9c7e=_[_0x1798('0x42')]({},_0x3c9c7e,_0x1758e1[_0x1798('0x43')]);var _0x266423={'where':_0x3c9c7e['where']};return db[_0x1798('0x2e')][_0x1798('0x1d')](_0x266423)[_0x1798('0x24')](function(_0x4ab8e7){_0x38147e[_0x1798('0x1d')]=_0x4ab8e7;if(_0x1758e1[_0x1798('0x34')][_0x1798('0x44')]){_0x3c9c7e[_0x1798('0x45')]=[{'all':!![]}];}return db[_0x1798('0x2e')][_0x1798('0x46')](_0x3c9c7e);})[_0x1798('0x24')](function(_0xd922d5){_0x38147e[_0x1798('0x47')]=_0xd922d5;return _0x38147e;})[_0x1798('0x24')](respondWithFilteredResult(_0x4f640a,_0x3c9c7e))[_0x1798('0x48')](handleError(_0x4f640a,null));};exports['show']=function(_0x1f346a,_0x4448ae){var _0x38a0b5={'raw':![],'where':{'id':_0x1f346a[_0x1798('0x49')]['id']}},_0x56cf37={};_0x56cf37['model']=_[_0x1798('0x4a')](db['DeskConfiguration'][_0x1798('0x2f')]);_0x56cf37[_0x1798('0x34')]=_[_0x1798('0x4a')](_0x1f346a[_0x1798('0x34')]);_0x56cf37[_0x1798('0x35')]=_[_0x1798('0x36')](_0x56cf37[_0x1798('0x33')],_0x56cf37[_0x1798('0x34')]);_0x38a0b5[_0x1798('0x38')]=_['intersection'](_0x56cf37['model'],qs[_0x1798('0x37')](_0x1f346a[_0x1798('0x34')][_0x1798('0x37')]));_0x38a0b5[_0x1798('0x38')]=_0x38a0b5[_0x1798('0x38')][_0x1798('0x39')]?_0x38a0b5[_0x1798('0x38')]:_0x56cf37[_0x1798('0x33')];if(_0x1f346a[_0x1798('0x34')][_0x1798('0x44')]){_0x38a0b5[_0x1798('0x45')]=[{'all':!![]}];}_0x38a0b5=_['merge']({},_0x38a0b5,_0x1f346a[_0x1798('0x43')]);return db[_0x1798('0x2e')][_0x1798('0x4b')](_0x38a0b5)[_0x1798('0x24')](handleEntityNotFound(_0x4448ae,null))[_0x1798('0x24')](respondWithResult(_0x4448ae,null))[_0x1798('0x48')](handleError(_0x4448ae,null));};exports[_0x1798('0x4c')]=function(_0x25a192,_0x2cc80b){return db['DeskConfiguration'][_0x1798('0x4c')](_0x25a192[_0x1798('0x4d')],{})[_0x1798('0x24')](respondWithResult(_0x2cc80b,0xc9))['catch'](handleError(_0x2cc80b,null));};exports[_0x1798('0x23')]=function(_0x570f89,_0x4ddb9a){if(_0x570f89[_0x1798('0x4d')]['id']){delete _0x570f89[_0x1798('0x4d')]['id'];}return db['DeskConfiguration'][_0x1798('0x4b')]({'where':{'id':_0x570f89[_0x1798('0x49')]['id']}})[_0x1798('0x24')](handleEntityNotFound(_0x4ddb9a,null))['then'](saveUpdates(_0x570f89[_0x1798('0x4d')],null))[_0x1798('0x24')](respondWithResult(_0x4ddb9a,null))[_0x1798('0x48')](handleError(_0x4ddb9a,null));};exports['destroy']=function(_0x254a16,_0x342c9a){return db['DeskConfiguration'][_0x1798('0x4b')]({'where':{'id':_0x254a16[_0x1798('0x49')]['id']}})[_0x1798('0x24')](handleEntityNotFound(_0x342c9a,null))[_0x1798('0x24')](removeEntity(_0x342c9a,null))['catch'](handleError(_0x342c9a,null));};exports['getFields']=function(_0x136c2c,_0x5ceb6a,_0x5d8e6a){var _0x4622d2={};var _0x455f92={};var _0x27e245;var _0x11c661;return db[_0x1798('0x2e')][_0x1798('0x4e')]({'where':{'id':_0x136c2c[_0x1798('0x49')]['id']}})[_0x1798('0x24')](handleEntityNotFound(_0x5ceb6a,null))[_0x1798('0x24')](function(_0x269e61){if(_0x269e61){_0x27e245=_0x269e61;_0x455f92[_0x1798('0x33')]=_[_0x1798('0x4a')](db[_0x1798('0x4f')]['rawAttributes']);_0x455f92[_0x1798('0x34')]=_[_0x1798('0x4a')](_0x136c2c[_0x1798('0x34')]);_0x455f92[_0x1798('0x35')]=_['intersection'](_0x455f92[_0x1798('0x33')],_0x455f92[_0x1798('0x34')]);_0x4622d2[_0x1798('0x38')]=_['intersection'](_0x455f92['model'],qs[_0x1798('0x37')](_0x136c2c[_0x1798('0x34')][_0x1798('0x37')]));_0x4622d2['attributes']=_0x4622d2[_0x1798('0x38')]['length']?_0x4622d2[_0x1798('0x38')]:_0x455f92[_0x1798('0x33')];_0x4622d2[_0x1798('0x3c')]=qs[_0x1798('0x3d')](_0x136c2c[_0x1798('0x34')][_0x1798('0x3d')]);_0x4622d2[_0x1798('0x3f')]=qs[_0x1798('0x35')](_[_0x1798('0x3e')](_0x136c2c[_0x1798('0x34')],_0x455f92['filters']));if(_0x136c2c['query'][_0x1798('0x41')]){_0x4622d2['where']=_['merge'](_0x4622d2['where'],{'$or':_[_0x1798('0x2d')](_0x4622d2[_0x1798('0x38')],function(_0x34742d){var _0xa9d6e7={};_0xa9d6e7[_0x34742d]={'$like':'%'+_0x136c2c[_0x1798('0x34')][_0x1798('0x41')]+'%'};return _0xa9d6e7;})});}_0x4622d2=_[_0x1798('0x42')]({},_0x4622d2,_0x136c2c['options']);return _0x27e245[_0x1798('0x50')](_0x4622d2);}})['then'](function(_0x59844a){if(_0x59844a){_0x11c661=_0x59844a['length'];if(!_0x136c2c[_0x1798('0x34')][_0x1798('0x3a')]('nolimit')){_0x4622d2[_0x1798('0x3b')]=qs[_0x1798('0x3b')](_0x136c2c['query'][_0x1798('0x3b')]);_0x4622d2[_0x1798('0x1e')]=qs[_0x1798('0x1e')](_0x136c2c['query'][_0x1798('0x1e')]);}return _0x27e245[_0x1798('0x50')](_0x4622d2);}})[_0x1798('0x24')](function(_0x4e1886){if(_0x4e1886){return _0x4e1886?{'count':_0x11c661,'rows':_0x4e1886}:null;}})['then'](respondWithResult(_0x5ceb6a,null))[_0x1798('0x48')](handleError(_0x5ceb6a,null));};exports['getSubjects']=function(_0x2e7751,_0x50c2bd,_0x182dde){var _0x3d3285={};var _0x2f57b3={};var _0x5d06f1;var _0x2302a9;return db['DeskConfiguration'][_0x1798('0x4e')]({'where':{'id':_0x2e7751['params']['id']}})[_0x1798('0x24')](handleEntityNotFound(_0x50c2bd,null))[_0x1798('0x24')](function(_0x5993ce){if(_0x5993ce){_0x5d06f1=_0x5993ce;_0x2f57b3[_0x1798('0x33')]=_[_0x1798('0x4a')](db['DeskField'][_0x1798('0x2f')]);_0x2f57b3[_0x1798('0x34')]=_[_0x1798('0x4a')](_0x2e7751[_0x1798('0x34')]);_0x2f57b3[_0x1798('0x35')]=_[_0x1798('0x36')](_0x2f57b3[_0x1798('0x33')],_0x2f57b3['query']);_0x3d3285[_0x1798('0x38')]=_['intersection'](_0x2f57b3['model'],qs[_0x1798('0x37')](_0x2e7751['query'][_0x1798('0x37')]));_0x3d3285[_0x1798('0x38')]=_0x3d3285['attributes'][_0x1798('0x39')]?_0x3d3285[_0x1798('0x38')]:_0x2f57b3[_0x1798('0x33')];_0x3d3285[_0x1798('0x3c')]=qs[_0x1798('0x3d')](_0x2e7751[_0x1798('0x34')][_0x1798('0x3d')]);_0x3d3285[_0x1798('0x3f')]=qs[_0x1798('0x35')](_[_0x1798('0x3e')](_0x2e7751[_0x1798('0x34')],_0x2f57b3[_0x1798('0x35')]));if(_0x2e7751['query'][_0x1798('0x41')]){_0x3d3285['where']=_['merge'](_0x3d3285[_0x1798('0x3f')],{'$or':_[_0x1798('0x2d')](_0x3d3285[_0x1798('0x38')],function(_0x2a1645){var _0x26c566={};_0x26c566[_0x2a1645]={'$like':'%'+_0x2e7751[_0x1798('0x34')][_0x1798('0x41')]+'%'};return _0x26c566;})});}_0x3d3285=_[_0x1798('0x42')]({},_0x3d3285,_0x2e7751[_0x1798('0x43')]);return _0x5d06f1[_0x1798('0x51')](_0x3d3285);}})[_0x1798('0x24')](function(_0x2e8767){if(_0x2e8767){_0x2302a9=_0x2e8767['length'];if(!_0x2e7751[_0x1798('0x34')]['hasOwnProperty'](_0x1798('0x52'))){_0x3d3285['limit']=qs[_0x1798('0x3b')](_0x2e7751[_0x1798('0x34')][_0x1798('0x3b')]);_0x3d3285['offset']=qs[_0x1798('0x1e')](_0x2e7751[_0x1798('0x34')][_0x1798('0x1e')]);}return _0x5d06f1[_0x1798('0x51')](_0x3d3285);}})[_0x1798('0x24')](function(_0x5f14c3){if(_0x5f14c3){return _0x5f14c3?{'count':_0x2302a9,'rows':_0x5f14c3}:null;}})['then'](respondWithResult(_0x50c2bd,null))[_0x1798('0x48')](handleError(_0x50c2bd,null));};exports[_0x1798('0x53')]=function(_0x749b11,_0x5b833b,_0x1cbfee){var _0x34bc18={};var _0x55f533={};var _0xaa1473;var _0x3ccf72;return db['DeskConfiguration']['findOne']({'where':{'id':_0x749b11[_0x1798('0x49')]['id']}})[_0x1798('0x24')](handleEntityNotFound(_0x5b833b,null))[_0x1798('0x24')](function(_0xba9904){if(_0xba9904){_0xaa1473=_0xba9904;_0x55f533[_0x1798('0x33')]=_['keys'](db[_0x1798('0x4f')]['rawAttributes']);_0x55f533['query']=_[_0x1798('0x4a')](_0x749b11[_0x1798('0x34')]);_0x55f533['filters']=_[_0x1798('0x36')](_0x55f533['model'],_0x55f533[_0x1798('0x34')]);_0x34bc18[_0x1798('0x38')]=_[_0x1798('0x36')](_0x55f533[_0x1798('0x33')],qs[_0x1798('0x37')](_0x749b11[_0x1798('0x34')][_0x1798('0x37')]));_0x34bc18['attributes']=_0x34bc18[_0x1798('0x38')][_0x1798('0x39')]?_0x34bc18['attributes']:_0x55f533['model'];_0x34bc18[_0x1798('0x3c')]=qs[_0x1798('0x3d')](_0x749b11[_0x1798('0x34')][_0x1798('0x3d')]);_0x34bc18['where']=qs[_0x1798('0x35')](_['pick'](_0x749b11['query'],_0x55f533[_0x1798('0x35')]));if(_0x749b11['query'][_0x1798('0x41')]){_0x34bc18['where']=_[_0x1798('0x42')](_0x34bc18[_0x1798('0x3f')],{'$or':_['map'](_0x34bc18[_0x1798('0x38')],function(_0x2a22ca){var _0x38e69f={};_0x38e69f[_0x2a22ca]={'$like':'%'+_0x749b11[_0x1798('0x34')]['filter']+'%'};return _0x38e69f;})});}_0x34bc18=_[_0x1798('0x42')]({},_0x34bc18,_0x749b11['options']);return _0xaa1473[_0x1798('0x53')](_0x34bc18);}})[_0x1798('0x24')](function(_0x191452){if(_0x191452){_0x3ccf72=_0x191452['length'];if(!_0x749b11[_0x1798('0x34')]['hasOwnProperty']('nolimit')){_0x34bc18[_0x1798('0x3b')]=qs['limit'](_0x749b11[_0x1798('0x34')]['limit']);_0x34bc18[_0x1798('0x1e')]=qs[_0x1798('0x1e')](_0x749b11['query']['offset']);}return _0xaa1473[_0x1798('0x53')](_0x34bc18);}})[_0x1798('0x24')](function(_0x5d3746){if(_0x5d3746){return _0x5d3746?{'count':_0x3ccf72,'rows':_0x5d3746}:null;}})[_0x1798('0x24')](respondWithResult(_0x5b833b,null))[_0x1798('0x48')](handleError(_0x5b833b,null));};exports[_0x1798('0x54')]=function(_0x4b3f9d,_0x193a70,_0x501459){var _0x1a5c48={};var _0x33b059={};var _0x320726;var _0x2bc089;return db[_0x1798('0x2e')][_0x1798('0x4e')]({'where':{'id':_0x4b3f9d['params']['id']}})[_0x1798('0x24')](handleEntityNotFound(_0x193a70,null))[_0x1798('0x24')](function(_0x541470){if(_0x541470){_0x320726=_0x541470;_0x33b059[_0x1798('0x33')]=_['keys'](db[_0x1798('0x55')][_0x1798('0x2f')]);_0x33b059[_0x1798('0x34')]=_['keys'](_0x4b3f9d['query']);_0x33b059['filters']=_[_0x1798('0x36')](_0x33b059['model'],_0x33b059[_0x1798('0x34')]);_0x1a5c48[_0x1798('0x38')]=_[_0x1798('0x36')](_0x33b059['model'],qs[_0x1798('0x37')](_0x4b3f9d[_0x1798('0x34')][_0x1798('0x37')]));_0x1a5c48['attributes']=_0x1a5c48[_0x1798('0x38')]['length']?_0x1a5c48['attributes']:_0x33b059[_0x1798('0x33')];_0x1a5c48[_0x1798('0x3c')]=qs[_0x1798('0x3d')](_0x4b3f9d[_0x1798('0x34')][_0x1798('0x3d')]);_0x1a5c48['where']=qs['filters'](_[_0x1798('0x3e')](_0x4b3f9d[_0x1798('0x34')],_0x33b059[_0x1798('0x35')]));if(_0x4b3f9d[_0x1798('0x34')]['filter']){_0x1a5c48[_0x1798('0x3f')]=_['merge'](_0x1a5c48[_0x1798('0x3f')],{'$or':_[_0x1798('0x2d')](_0x1a5c48['attributes'],function(_0x515a36){var _0x4e563b={};_0x4e563b[_0x515a36]={'$like':'%'+_0x4b3f9d['query']['filter']+'%'};return _0x4e563b;})});}_0x1a5c48=_[_0x1798('0x42')]({},_0x1a5c48,_0x4b3f9d['options']);return _0x320726['getTags'](_0x1a5c48);}})[_0x1798('0x24')](function(_0x7526d2){if(_0x7526d2){_0x2bc089=_0x7526d2[_0x1798('0x39')];if(!_0x4b3f9d[_0x1798('0x34')][_0x1798('0x3a')](_0x1798('0x52'))){_0x1a5c48['limit']=qs[_0x1798('0x3b')](_0x4b3f9d[_0x1798('0x34')][_0x1798('0x3b')]);_0x1a5c48[_0x1798('0x1e')]=qs[_0x1798('0x1e')](_0x4b3f9d['query']['offset']);}return _0x320726[_0x1798('0x54')](_0x1a5c48);}})[_0x1798('0x24')](function(_0xc31889){if(_0xc31889){return _0xc31889?{'count':_0x2bc089,'rows':_0xc31889}:null;}})[_0x1798('0x24')](respondWithResult(_0x193a70,null))['catch'](handleError(_0x193a70,null));};exports[_0x1798('0x56')]=function(_0x34de4d,_0x4dba7a,_0x1a21ae){if(_0x34de4d[_0x1798('0x4d')]['id']){delete _0x34de4d[_0x1798('0x4d')]['id'];}return db[_0x1798('0x2e')]['findOne']({'where':{'id':_0x34de4d[_0x1798('0x49')]['id']}})[_0x1798('0x24')](handleEntityNotFound(_0x4dba7a,null))['then'](function(_0xc7838f){if(_0xc7838f){return _0xc7838f['setTags'](_0x34de4d[_0x1798('0x4d')][_0x1798('0x57')]||[]);}return null;})['then'](respondWithResult(_0x4dba7a,null))[_0x1798('0x48')](handleError(_0x4dba7a,null));}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.model.js b/server/api/intDeskConfiguration/intDeskConfiguration.model.js index 8aefbfe..947ff38 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 _0x1beb=['moment','bluebird','path','rimraf','./intDeskConfiguration.attributes','exports','define','DeskConfiguration','int_desk_configurations','lodash','util','api'];(function(_0x19ef53,_0x3639b1){var _0x4dcfd0=function(_0x2f0a91){while(--_0x2f0a91){_0x19ef53['push'](_0x19ef53['shift']());}};_0x4dcfd0(++_0x3639b1);}(_0x1beb,0x165));var _0xb1be=function(_0x1dbaa7,_0x30073b){_0x1dbaa7=_0x1dbaa7-0x0;var _0x5224a6=_0x1beb[_0x1dbaa7];return _0x5224a6;};'use strict';var _=require(_0xb1be('0x0'));var util=require(_0xb1be('0x1'));var logger=require('../../config/logger')(_0xb1be('0x2'));var moment=require(_0xb1be('0x3'));var BPromise=require(_0xb1be('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb1be('0x5'));var rimraf=require(_0xb1be('0x6'));var config=require('../../config/environment');var attributes=require(_0xb1be('0x7'));module[_0xb1be('0x8')]=function(_0x116394,_0xe36555){return _0x116394[_0xb1be('0x9')](_0xb1be('0xa'),attributes,{'tableName':_0xb1be('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x90b2=['moment','bluebird','request-promise','../../config/environment','./intDeskConfiguration.attributes','exports','define','int_desk_configurations','lodash'];(function(_0x37c636,_0x44bc89){var _0x13bbb3=function(_0xfd5754){while(--_0xfd5754){_0x37c636['push'](_0x37c636['shift']());}};_0x13bbb3(++_0x44bc89);}(_0x90b2,0x14c));var _0x290b=function(_0x5a42b8,_0x2013d4){_0x5a42b8=_0x5a42b8-0x0;var _0x129e90=_0x90b2[_0x5a42b8];return _0x129e90;};'use strict';var _=require(_0x290b('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x290b('0x1'));var BPromise=require(_0x290b('0x2'));var rp=require(_0x290b('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x290b('0x4'));var attributes=require(_0x290b('0x5'));module[_0x290b('0x6')]=function(_0x41cfa4,_0xc2eb63){return _0x41cfa4[_0x290b('0x7')]('DeskConfiguration',attributes,{'tableName':_0x290b('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.rpc.js b/server/api/intDeskConfiguration/intDeskConfiguration.rpc.js index ff359bc..2d4021a 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 _0xc429=['catch','lodash','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then','info','request\x20sent','DeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','DeskConfiguration,\x20%s,\x20%s','message','result'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc429,0x1ba));var _0x9c42=function(_0x616290,_0x280b7f){_0x616290=_0x616290-0x0;var _0x453879=_0xc429[_0x616290];return _0x453879;};'use strict';var _=require(_0x9c42('0x0'));var util=require('util');var moment=require(_0x9c42('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9c42('0x2'));var db=require(_0x9c42('0x3'))['db'];var utils=require(_0x9c42('0x4'));var logger=require(_0x9c42('0x5'))(_0x9c42('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x9c42('0x7')][_0x9c42('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xc663bb,_0x36c7e0,_0xcf40c2){return new BPromise(function(_0x28d46e,_0x61614){return client[_0x9c42('0x9')](_0xc663bb,_0xcf40c2)[_0x9c42('0xa')](function(_0x2541a2){logger[_0x9c42('0xb')]('DeskConfiguration,\x20%s,\x20%s',_0x36c7e0,_0x9c42('0xc'));logger['debug'](_0x9c42('0xd'),_0x36c7e0,'request\x20sent',JSON[_0x9c42('0xe')](_0x2541a2));if(_0x2541a2[_0x9c42('0xf')]){if(_0x2541a2['error'][_0x9c42('0x10')]===0x1f4){logger[_0x9c42('0xf')](_0x9c42('0x11'),_0x36c7e0,_0x2541a2['error'][_0x9c42('0x12')]);return _0x61614(_0x2541a2[_0x9c42('0xf')][_0x9c42('0x12')]);}logger['error'](_0x9c42('0x11'),_0x36c7e0,_0x2541a2['error']['message']);return _0x28d46e(_0x2541a2[_0x9c42('0xf')][_0x9c42('0x12')]);}else{logger['info'](_0x9c42('0x11'),_0x36c7e0,_0x9c42('0xc'));_0x28d46e(_0x2541a2[_0x9c42('0x13')][_0x9c42('0x12')]);}})[_0x9c42('0x14')](function(_0x24a809){logger[_0x9c42('0xf')]('DeskConfiguration,\x20%s,\x20%s',_0x36c7e0,_0x24a809);_0x61614(_0x24a809);});});} \ No newline at end of file +var _0xe02a=['result','message','catch','lodash','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','DeskConfiguration,\x20%s,\x20%s','request\x20sent','DeskConfiguration,\x20%s,\x20%s,\x20%s','error'];(function(_0xf8600,_0x460bd9){var _0xd5f2ea=function(_0x464360){while(--_0x464360){_0xf8600['push'](_0xf8600['shift']());}};_0xd5f2ea(++_0x460bd9);}(_0xe02a,0xa3));var _0xae02=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0xe02a[_0x17d9e3];return _0x14192d;};'use strict';var _=require(_0xae02('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xae02('0x1'));var db=require(_0xae02('0x2'))['db'];var utils=require(_0xae02('0x3'));var logger=require(_0xae02('0x4'))(_0xae02('0x5'));var config=require(_0xae02('0x6'));var jayson=require(_0xae02('0x7'));var client=jayson[_0xae02('0x8')][_0xae02('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3ffda6,_0x1da455,_0x3e5ab1){return new BPromise(function(_0x24befe,_0x244971){return client[_0xae02('0xa')](_0x3ffda6,_0x3e5ab1)[_0xae02('0xb')](function(_0x3e0a15){logger[_0xae02('0xc')](_0xae02('0xd'),_0x1da455,_0xae02('0xe'));logger['debug'](_0xae02('0xf'),_0x1da455,'request\x20sent',JSON['stringify'](_0x3e0a15));if(_0x3e0a15[_0xae02('0x10')]){if(_0x3e0a15[_0xae02('0x10')]['code']===0x1f4){logger[_0xae02('0x10')](_0xae02('0xd'),_0x1da455,_0x3e0a15[_0xae02('0x10')]['message']);return _0x244971(_0x3e0a15[_0xae02('0x10')]['message']);}logger[_0xae02('0x10')](_0xae02('0xd'),_0x1da455,_0x3e0a15[_0xae02('0x10')]['message']);return _0x24befe(_0x3e0a15[_0xae02('0x10')]['message']);}else{logger[_0xae02('0xc')](_0xae02('0xd'),_0x1da455,_0xae02('0xe'));_0x24befe(_0x3e0a15[_0xae02('0x11')][_0xae02('0x12')]);}})[_0xae02('0x13')](function(_0x24dead){logger[_0xae02('0x10')](_0xae02('0xd'),_0x1da455,_0x24dead);_0x244971(_0x24dead);});});} \ No newline at end of file diff --git a/server/api/intDeskField/index.js b/server/api/intDeskField/index.js index 0faa882..2eab293 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 _0x9329=['isAuthenticated','/:id','create','put','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./intDeskField.controller','get'];(function(_0x257291,_0x4d5175){var _0x5a011f=function(_0x156813){while(--_0x156813){_0x257291['push'](_0x257291['shift']());}};_0x5a011f(++_0x4d5175);}(_0x9329,0x18c));var _0x9932=function(_0xebbbeb,_0x1fb714){_0xebbbeb=_0xebbbeb-0x0;var _0xdd04dc=_0x9329[_0xebbbeb];return _0xdd04dc;};'use strict';var multer=require(_0x9932('0x0'));var util=require(_0x9932('0x1'));var path=require(_0x9932('0x2'));var timeout=require(_0x9932('0x3'));var express=require(_0x9932('0x4'));var router=express[_0x9932('0x5')]();var fs_extra=require(_0x9932('0x6'));var auth=require(_0x9932('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x9932('0x8'));router[_0x9932('0x9')]('/',auth[_0x9932('0xa')](),controller['index']);router['get'](_0x9932('0xb'),auth[_0x9932('0xa')](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0x9932('0xc')]);router[_0x9932('0xd')](_0x9932('0xb'),auth[_0x9932('0xa')](),controller['update']);router['delete']('/:id',auth[_0x9932('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x0787=['isAuthenticated','/:id','update','destroy','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intDeskField.controller'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0787,0x156));var _0x7078=function(_0x51c819,_0xd812db){_0x51c819=_0x51c819-0x0;var _0x15c5d2=_0x0787[_0x51c819];return _0x15c5d2;};'use strict';var multer=require(_0x7078('0x0'));var util=require(_0x7078('0x1'));var path=require('path');var timeout=require(_0x7078('0x2'));var express=require(_0x7078('0x3'));var router=express[_0x7078('0x4')]();var fs_extra=require(_0x7078('0x5'));var auth=require(_0x7078('0x6'));var interaction=require(_0x7078('0x7'));var config=require('../../config/environment');var controller=require(_0x7078('0x8'));router['get']('/',auth[_0x7078('0x9')](),controller['index']);router['get'](_0x7078('0xa'),auth[_0x7078('0x9')](),controller['show']);router['post']('/',auth[_0x7078('0x9')](),controller['create']);router['put'](_0x7078('0xa'),auth['isAuthenticated'](),controller[_0x7078('0xb')]);router['delete'](_0x7078('0xa'),auth[_0x7078('0x9')](),controller[_0x7078('0xc')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.attributes.js b/server/api/intDeskField/intDeskField.attributes.js index 3d5408a..c129f0f 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 _0xff0c=['exports','string','variable','customVariable','keyValue','STRING','ENUM','sequelize'];(function(_0x4fdda9,_0x388021){var _0x4e71e9=function(_0x217d48){while(--_0x217d48){_0x4fdda9['push'](_0x4fdda9['shift']());}};_0x4e71e9(++_0x388021);}(_0xff0c,0xaf));var _0xcff0=function(_0x26a818,_0x40708a){_0x26a818=_0x26a818-0x0;var _0x5d8ca0=_0xff0c[_0x26a818];return _0x5d8ca0;};'use strict';var Sequelize=require(_0xcff0('0x0'));module[_0xcff0('0x1')]={'type':{'type':Sequelize['ENUM'](_0xcff0('0x2'),_0xcff0('0x3'),_0xcff0('0x4'),_0xcff0('0x5'),'picklist'),'defaultValue':_0xcff0('0x2')},'content':{'type':Sequelize[_0xcff0('0x6')]},'key':{'type':Sequelize[_0xcff0('0x6')]},'keyType':{'type':Sequelize[_0xcff0('0x7')](_0xcff0('0x2'),'variable',_0xcff0('0x4'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0xcff0('0x6')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x7ed9=['BOOLEAN','sequelize','exports','string','variable','keyValue','picklist','STRING','ENUM','customVariable'];(function(_0x5dd12d,_0x2689a7){var _0x1b3136=function(_0x2797ad){while(--_0x2797ad){_0x5dd12d['push'](_0x5dd12d['shift']());}};_0x1b3136(++_0x2689a7);}(_0x7ed9,0x1d7));var _0x97ed=function(_0xa98ecf,_0x58c777){_0xa98ecf=_0xa98ecf-0x0;var _0x309607=_0x7ed9[_0xa98ecf];return _0x309607;};'use strict';var Sequelize=require(_0x97ed('0x0'));module[_0x97ed('0x1')]={'type':{'type':Sequelize['ENUM'](_0x97ed('0x2'),_0x97ed('0x3'),'customVariable',_0x97ed('0x4'),_0x97ed('0x5')),'defaultValue':'string'},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x97ed('0x6')]},'keyType':{'type':Sequelize[_0x97ed('0x7')](_0x97ed('0x2'),'variable',_0x97ed('0x8'))},'keyContent':{'type':Sequelize[_0x97ed('0x6')]},'idField':{'type':Sequelize[_0x97ed('0x6')]},'nameField':{'type':Sequelize[_0x97ed('0x6')]},'customField':{'type':Sequelize[_0x97ed('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x97ed('0x6')]}}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.controller.js b/server/api/intDeskField/intDeskField.controller.js index 79563fb..dbea3d5 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 _0x2525=['../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','count','set','Content-Range','apply','reject','save','update','destroy','error','stack','index','map','rawAttributes','fieldName','type','key','model','name','keys','filters','intersection','attributes','fields','query','nolimit','limit','order','sort','where','merge','filter','DeskField','then','includeAll','show','params','length','include','options','find','catch','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api'];(function(_0x226f6c,_0x78a1ab){var _0x127845=function(_0x24972a){while(--_0x24972a){_0x226f6c['push'](_0x226f6c['shift']());}};_0x127845(++_0x78a1ab);}(_0x2525,0x1f0));var _0x5252=function(_0x34bf97,_0xc60f9d){_0x34bf97=_0x34bf97-0x0;var _0x292719=_0x2525[_0x34bf97];return _0x292719;};'use strict';var emlformat=require(_0x5252('0x0'));var rimraf=require(_0x5252('0x1'));var zipdir=require(_0x5252('0x2'));var jsonpatch=require(_0x5252('0x3'));var rp=require(_0x5252('0x4'));var moment=require(_0x5252('0x5'));var BPromise=require(_0x5252('0x6'));var Mustache=require(_0x5252('0x7'));var util=require(_0x5252('0x8'));var path=require('path');var sox=require('sox');var csv=require(_0x5252('0x9'));var ejs=require(_0x5252('0xa'));var fs=require('fs');var fs_extra=require(_0x5252('0xb'));var _=require(_0x5252('0xc'));var squel=require(_0x5252('0xd'));var crypto=require(_0x5252('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x5252('0xf'));var toCsv=require('to-csv');var querystring=require(_0x5252('0x10'));var Papa=require(_0x5252('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x5252('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5252('0x13'));var logger=require(_0x5252('0x14'))(_0x5252('0x15'));var utils=require(_0x5252('0x16'));var config=require(_0x5252('0x17'));var licenseUtil=require(_0x5252('0x18'));var db=require(_0x5252('0x19'))['db'];function respondWithStatusCode(_0x37ae98,_0x2a739a){_0x2a739a=_0x2a739a||0xcc;return function(_0x42074d){if(_0x42074d){return _0x37ae98[_0x5252('0x1a')](_0x2a739a);}return _0x37ae98[_0x5252('0x1b')](_0x2a739a)[_0x5252('0x1c')]();};}function respondWithResult(_0x586698,_0x58c4bd){_0x58c4bd=_0x58c4bd||0xc8;return function(_0x55598f){if(_0x55598f){return _0x586698[_0x5252('0x1b')](_0x58c4bd)[_0x5252('0x1d')](_0x55598f);}};}function respondWithFilteredResult(_0x240900,_0x9ddda){return function(_0x399a71){if(_0x399a71){var _0x3e54d1=typeof _0x9ddda[_0x5252('0x1e')]==='undefined'&&typeof _0x9ddda['limit']==='undefined';var _0xa24f14=_0x399a71[_0x5252('0x1f')];var _0x2ef8ec=_0x3e54d1?0x0:_0x9ddda[_0x5252('0x1e')];var _0x4034d2=_0x3e54d1?_0x399a71[_0x5252('0x1f')]:_0x9ddda[_0x5252('0x1e')]+_0x9ddda['limit'];var _0x26faf5;if(_0x4034d2>=_0xa24f14){_0x4034d2=_0xa24f14;_0x26faf5=0xc8;}else{_0x26faf5=0xce;}_0x240900[_0x5252('0x1b')](_0x26faf5);return _0x240900[_0x5252('0x20')](_0x5252('0x21'),_0x2ef8ec+'-'+_0x4034d2+'/'+_0xa24f14)[_0x5252('0x1d')](_0x399a71);}return null;};}function patchUpdates(_0x571f4d){return function(_0x3f76e2){try{jsonpatch[_0x5252('0x22')](_0x3f76e2,_0x571f4d,!![]);}catch(_0x3f77ff){return BPromise[_0x5252('0x23')](_0x3f77ff);}return _0x3f76e2[_0x5252('0x24')]();};}function saveUpdates(_0x156591,_0x54190a){return function(_0x2ad4fb){if(_0x2ad4fb){return _0x2ad4fb[_0x5252('0x25')](_0x156591)['then'](function(_0x5377b0){return _0x5377b0;});}return null;};}function removeEntity(_0x531417,_0x509055){return function(_0x217039){if(_0x217039){return _0x217039[_0x5252('0x26')]()['then'](function(){_0x531417[_0x5252('0x1b')](0xcc)[_0x5252('0x1c')]();});}};}function handleEntityNotFound(_0x5976e5,_0x5ad231){return function(_0x3b6f4b){if(!_0x3b6f4b){_0x5976e5['sendStatus'](0x194);}return _0x3b6f4b;};}function handleError(_0x2d74af,_0xc7f144){_0xc7f144=_0xc7f144||0x1f4;return function(_0x117a01){logger[_0x5252('0x27')](_0x117a01[_0x5252('0x28')]);if(_0x117a01['name']){delete _0x117a01['name'];}_0x2d74af[_0x5252('0x1b')](_0xc7f144)['send'](_0x117a01);};}exports[_0x5252('0x29')]=function(_0x5abb6a,_0x4a7d0b){var _0x4fb047={},_0x4ac8b8={},_0x47864d={'count':0x0,'rows':[]};var _0x2890f2=_[_0x5252('0x2a')](db['DeskField'][_0x5252('0x2b')],function(_0x1de3d5){return{'name':_0x1de3d5[_0x5252('0x2c')],'type':_0x1de3d5[_0x5252('0x2d')][_0x5252('0x2e')]};});_0x4ac8b8[_0x5252('0x2f')]=_[_0x5252('0x2a')](_0x2890f2,_0x5252('0x30'));_0x4ac8b8['query']=_[_0x5252('0x31')](_0x5abb6a['query']);_0x4ac8b8[_0x5252('0x32')]=_[_0x5252('0x33')](_0x4ac8b8[_0x5252('0x2f')],_0x4ac8b8['query']);_0x4fb047[_0x5252('0x34')]=_['intersection'](_0x4ac8b8[_0x5252('0x2f')],qs[_0x5252('0x35')](_0x5abb6a[_0x5252('0x36')][_0x5252('0x35')]));_0x4fb047['attributes']=_0x4fb047[_0x5252('0x34')]['length']?_0x4fb047['attributes']:_0x4ac8b8['model'];if(!_0x5abb6a[_0x5252('0x36')]['hasOwnProperty'](_0x5252('0x37'))){_0x4fb047[_0x5252('0x38')]=qs[_0x5252('0x38')](_0x5abb6a[_0x5252('0x36')]['limit']);_0x4fb047['offset']=qs['offset'](_0x5abb6a['query'][_0x5252('0x1e')]);}_0x4fb047[_0x5252('0x39')]=qs[_0x5252('0x3a')](_0x5abb6a[_0x5252('0x36')]['sort']);_0x4fb047[_0x5252('0x3b')]=qs[_0x5252('0x32')](_['pick'](_0x5abb6a[_0x5252('0x36')],_0x4ac8b8[_0x5252('0x32')]),_0x2890f2);if(_0x5abb6a[_0x5252('0x36')]['filter']){_0x4fb047['where']=_[_0x5252('0x3c')](_0x4fb047[_0x5252('0x3b')],{'$or':_[_0x5252('0x2a')](_0x2890f2,function(_0xbabe27){if(_0xbabe27[_0x5252('0x2d')]!=='VIRTUAL'){var _0x2e7a13={};_0x2e7a13[_0xbabe27[_0x5252('0x30')]]={'$like':'%'+_0x5abb6a['query'][_0x5252('0x3d')]+'%'};return _0x2e7a13;}})});}_0x4fb047=_[_0x5252('0x3c')]({},_0x4fb047,_0x5abb6a['options']);var _0x212e84={'where':_0x4fb047[_0x5252('0x3b')]};return db[_0x5252('0x3e')][_0x5252('0x1f')](_0x212e84)[_0x5252('0x3f')](function(_0x31e161){_0x47864d['count']=_0x31e161;if(_0x5abb6a['query'][_0x5252('0x40')]){_0x4fb047['include']=[{'all':!![]}];}return db[_0x5252('0x3e')]['findAll'](_0x4fb047);})[_0x5252('0x3f')](function(_0x200357){_0x47864d['rows']=_0x200357;return _0x47864d;})[_0x5252('0x3f')](respondWithFilteredResult(_0x4a7d0b,_0x4fb047))['catch'](handleError(_0x4a7d0b,null));};exports[_0x5252('0x41')]=function(_0x7dc15e,_0x536ce2){var _0x442301={'raw':!![],'where':{'id':_0x7dc15e[_0x5252('0x42')]['id']}},_0x244374={};_0x244374['model']=_['keys'](db[_0x5252('0x3e')][_0x5252('0x2b')]);_0x244374[_0x5252('0x36')]=_[_0x5252('0x31')](_0x7dc15e['query']);_0x244374['filters']=_[_0x5252('0x33')](_0x244374[_0x5252('0x2f')],_0x244374[_0x5252('0x36')]);_0x442301['attributes']=_[_0x5252('0x33')](_0x244374[_0x5252('0x2f')],qs['fields'](_0x7dc15e[_0x5252('0x36')][_0x5252('0x35')]));_0x442301[_0x5252('0x34')]=_0x442301['attributes'][_0x5252('0x43')]?_0x442301[_0x5252('0x34')]:_0x244374['model'];if(_0x7dc15e[_0x5252('0x36')]['includeAll']){_0x442301[_0x5252('0x44')]=[{'all':!![]}];}_0x442301=_['merge']({},_0x442301,_0x7dc15e[_0x5252('0x45')]);return db['DeskField'][_0x5252('0x46')](_0x442301)[_0x5252('0x3f')](handleEntityNotFound(_0x536ce2,null))[_0x5252('0x3f')](respondWithResult(_0x536ce2,null))[_0x5252('0x47')](handleError(_0x536ce2,null));};exports[_0x5252('0x48')]=function(_0x3d9e73,_0x5460a9){return db[_0x5252('0x3e')]['create'](_0x3d9e73[_0x5252('0x49')],{})[_0x5252('0x3f')](respondWithResult(_0x5460a9,0xc9))[_0x5252('0x47')](handleError(_0x5460a9,null));};exports['update']=function(_0x5098c6,_0x2124ef){if(_0x5098c6['body']['id']){delete _0x5098c6[_0x5252('0x49')]['id'];}return db['DeskField'][_0x5252('0x46')]({'where':{'id':_0x5098c6[_0x5252('0x42')]['id']}})[_0x5252('0x3f')](handleEntityNotFound(_0x2124ef,null))['then'](saveUpdates(_0x5098c6[_0x5252('0x49')],null))[_0x5252('0x3f')](respondWithResult(_0x2124ef,null))['catch'](handleError(_0x2124ef,null));};exports['destroy']=function(_0x5abd50,_0x50e529){return db[_0x5252('0x3e')][_0x5252('0x46')]({'where':{'id':_0x5abd50['params']['id']}})['then'](handleEntityNotFound(_0x50e529,null))['then'](removeEntity(_0x50e529,null))[_0x5252('0x47')](handleError(_0x50e529,null));}; \ No newline at end of file +var _0xf40b=['nolimit','limit','sort','pick','filter','where','merge','VIRTUAL','options','include','findAll','rows','show','params','rawAttributes','includeAll','find','catch','create','body','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','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','end','json','offset','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','index','map','DeskField','type','key','model','query','keys','filters','intersection','attributes','fields'];(function(_0x38ed1e,_0x17c77a){var _0x1e660e=function(_0x38be62){while(--_0x38be62){_0x38ed1e['push'](_0x38ed1e['shift']());}};_0x1e660e(++_0x17c77a);}(_0xf40b,0xb0));var _0xbf40=function(_0x2b27a0,_0x2ee33){_0x2b27a0=_0x2b27a0-0x0;var _0x44ec6b=_0xf40b[_0x2b27a0];return _0x44ec6b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xbf40('0x0'));var zipdir=require(_0xbf40('0x1'));var jsonpatch=require(_0xbf40('0x2'));var rp=require(_0xbf40('0x3'));var moment=require('moment');var BPromise=require(_0xbf40('0x4'));var Mustache=require(_0xbf40('0x5'));var util=require(_0xbf40('0x6'));var path=require(_0xbf40('0x7'));var sox=require(_0xbf40('0x8'));var csv=require('to-csv');var ejs=require(_0xbf40('0x9'));var fs=require('fs');var fs_extra=require(_0xbf40('0xa'));var _=require(_0xbf40('0xb'));var squel=require(_0xbf40('0xc'));var crypto=require(_0xbf40('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xbf40('0xe'));var toCsv=require(_0xbf40('0xf'));var querystring=require(_0xbf40('0x10'));var Papa=require(_0xbf40('0x11'));var Redis=require(_0xbf40('0x12'));var authService=require(_0xbf40('0x13'));var qs=require(_0xbf40('0x14'));var as=require(_0xbf40('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xbf40('0x16'))(_0xbf40('0x17'));var utils=require(_0xbf40('0x18'));var config=require(_0xbf40('0x19'));var licenseUtil=require(_0xbf40('0x1a'));var db=require(_0xbf40('0x1b'))['db'];function respondWithStatusCode(_0x2417ae,_0x46e5a5){_0x46e5a5=_0x46e5a5||0xcc;return function(_0x52c58c){if(_0x52c58c){return _0x2417ae['sendStatus'](_0x46e5a5);}return _0x2417ae[_0xbf40('0x1c')](_0x46e5a5)[_0xbf40('0x1d')]();};}function respondWithResult(_0x2cecca,_0x106e68){_0x106e68=_0x106e68||0xc8;return function(_0x562346){if(_0x562346){return _0x2cecca[_0xbf40('0x1c')](_0x106e68)[_0xbf40('0x1e')](_0x562346);}};}function respondWithFilteredResult(_0x3965f6,_0x347473){return function(_0x39a323){if(_0x39a323){var _0x203056=typeof _0x347473[_0xbf40('0x1f')]===_0xbf40('0x20')&&typeof _0x347473['limit']===_0xbf40('0x20');var _0xe9cc90=_0x39a323[_0xbf40('0x21')];var _0x1e50f9=_0x203056?0x0:_0x347473[_0xbf40('0x1f')];var _0x414123=_0x203056?_0x39a323[_0xbf40('0x21')]:_0x347473[_0xbf40('0x1f')]+_0x347473['limit'];var _0x2c8af5;if(_0x414123>=_0xe9cc90){_0x414123=_0xe9cc90;_0x2c8af5=0xc8;}else{_0x2c8af5=0xce;}_0x3965f6[_0xbf40('0x1c')](_0x2c8af5);return _0x3965f6[_0xbf40('0x22')](_0xbf40('0x23'),_0x1e50f9+'-'+_0x414123+'/'+_0xe9cc90)['json'](_0x39a323);}return null;};}function patchUpdates(_0x46a864){return function(_0x2a4ec7){try{jsonpatch[_0xbf40('0x24')](_0x2a4ec7,_0x46a864,!![]);}catch(_0x1922c8){return BPromise[_0xbf40('0x25')](_0x1922c8);}return _0x2a4ec7[_0xbf40('0x26')]();};}function saveUpdates(_0x275ff1,_0x36aef3){return function(_0x558e1f){if(_0x558e1f){return _0x558e1f[_0xbf40('0x27')](_0x275ff1)[_0xbf40('0x28')](function(_0x1487d0){return _0x1487d0;});}return null;};}function removeEntity(_0x17fa9a,_0x1471ee){return function(_0x2ead11){if(_0x2ead11){return _0x2ead11[_0xbf40('0x29')]()['then'](function(){_0x17fa9a[_0xbf40('0x1c')](0xcc)[_0xbf40('0x1d')]();});}};}function handleEntityNotFound(_0x2890e7,_0xb9adcd){return function(_0x2d3936){if(!_0x2d3936){_0x2890e7[_0xbf40('0x2a')](0x194);}return _0x2d3936;};}function handleError(_0x2464d9,_0x1ceb97){_0x1ceb97=_0x1ceb97||0x1f4;return function(_0x40f563){logger[_0xbf40('0x2b')](_0x40f563[_0xbf40('0x2c')]);if(_0x40f563[_0xbf40('0x2d')]){delete _0x40f563[_0xbf40('0x2d')];}_0x2464d9[_0xbf40('0x1c')](_0x1ceb97)['send'](_0x40f563);};}exports[_0xbf40('0x2e')]=function(_0x5bc1cb,_0x342f3d){var _0x3db8bc={},_0x1b7870={},_0x53c252={'count':0x0,'rows':[]};var _0x2f8730=_[_0xbf40('0x2f')](db[_0xbf40('0x30')]['rawAttributes'],function(_0xda9b8c){return{'name':_0xda9b8c['fieldName'],'type':_0xda9b8c[_0xbf40('0x31')][_0xbf40('0x32')]};});_0x1b7870[_0xbf40('0x33')]=_['map'](_0x2f8730,_0xbf40('0x2d'));_0x1b7870[_0xbf40('0x34')]=_[_0xbf40('0x35')](_0x5bc1cb[_0xbf40('0x34')]);_0x1b7870[_0xbf40('0x36')]=_[_0xbf40('0x37')](_0x1b7870[_0xbf40('0x33')],_0x1b7870[_0xbf40('0x34')]);_0x3db8bc[_0xbf40('0x38')]=_['intersection'](_0x1b7870[_0xbf40('0x33')],qs[_0xbf40('0x39')](_0x5bc1cb[_0xbf40('0x34')][_0xbf40('0x39')]));_0x3db8bc['attributes']=_0x3db8bc[_0xbf40('0x38')]['length']?_0x3db8bc[_0xbf40('0x38')]:_0x1b7870[_0xbf40('0x33')];if(!_0x5bc1cb[_0xbf40('0x34')]['hasOwnProperty'](_0xbf40('0x3a'))){_0x3db8bc[_0xbf40('0x3b')]=qs[_0xbf40('0x3b')](_0x5bc1cb[_0xbf40('0x34')][_0xbf40('0x3b')]);_0x3db8bc['offset']=qs[_0xbf40('0x1f')](_0x5bc1cb[_0xbf40('0x34')][_0xbf40('0x1f')]);}_0x3db8bc['order']=qs[_0xbf40('0x3c')](_0x5bc1cb[_0xbf40('0x34')][_0xbf40('0x3c')]);_0x3db8bc['where']=qs[_0xbf40('0x36')](_[_0xbf40('0x3d')](_0x5bc1cb[_0xbf40('0x34')],_0x1b7870[_0xbf40('0x36')]),_0x2f8730);if(_0x5bc1cb[_0xbf40('0x34')][_0xbf40('0x3e')]){_0x3db8bc[_0xbf40('0x3f')]=_[_0xbf40('0x40')](_0x3db8bc[_0xbf40('0x3f')],{'$or':_[_0xbf40('0x2f')](_0x2f8730,function(_0x173ff8){if(_0x173ff8[_0xbf40('0x31')]!==_0xbf40('0x41')){var _0x356bdc={};_0x356bdc[_0x173ff8['name']]={'$like':'%'+_0x5bc1cb[_0xbf40('0x34')]['filter']+'%'};return _0x356bdc;}})});}_0x3db8bc=_[_0xbf40('0x40')]({},_0x3db8bc,_0x5bc1cb[_0xbf40('0x42')]);var _0x322c32={'where':_0x3db8bc[_0xbf40('0x3f')]};return db[_0xbf40('0x30')]['count'](_0x322c32)[_0xbf40('0x28')](function(_0xfd6710){_0x53c252['count']=_0xfd6710;if(_0x5bc1cb[_0xbf40('0x34')]['includeAll']){_0x3db8bc[_0xbf40('0x43')]=[{'all':!![]}];}return db[_0xbf40('0x30')][_0xbf40('0x44')](_0x3db8bc);})[_0xbf40('0x28')](function(_0x761b55){_0x53c252[_0xbf40('0x45')]=_0x761b55;return _0x53c252;})[_0xbf40('0x28')](respondWithFilteredResult(_0x342f3d,_0x3db8bc))['catch'](handleError(_0x342f3d,null));};exports[_0xbf40('0x46')]=function(_0x36e38a,_0xdd2a0){var _0xaf4311={'raw':!![],'where':{'id':_0x36e38a[_0xbf40('0x47')]['id']}},_0x1aa935={};_0x1aa935[_0xbf40('0x33')]=_[_0xbf40('0x35')](db['DeskField'][_0xbf40('0x48')]);_0x1aa935['query']=_[_0xbf40('0x35')](_0x36e38a[_0xbf40('0x34')]);_0x1aa935[_0xbf40('0x36')]=_[_0xbf40('0x37')](_0x1aa935['model'],_0x1aa935['query']);_0xaf4311[_0xbf40('0x38')]=_[_0xbf40('0x37')](_0x1aa935[_0xbf40('0x33')],qs['fields'](_0x36e38a['query'][_0xbf40('0x39')]));_0xaf4311['attributes']=_0xaf4311[_0xbf40('0x38')]['length']?_0xaf4311[_0xbf40('0x38')]:_0x1aa935[_0xbf40('0x33')];if(_0x36e38a['query'][_0xbf40('0x49')]){_0xaf4311[_0xbf40('0x43')]=[{'all':!![]}];}_0xaf4311=_['merge']({},_0xaf4311,_0x36e38a['options']);return db[_0xbf40('0x30')][_0xbf40('0x4a')](_0xaf4311)['then'](handleEntityNotFound(_0xdd2a0,null))[_0xbf40('0x28')](respondWithResult(_0xdd2a0,null))[_0xbf40('0x4b')](handleError(_0xdd2a0,null));};exports[_0xbf40('0x4c')]=function(_0x379977,_0x4a24dc){return db['DeskField'][_0xbf40('0x4c')](_0x379977[_0xbf40('0x4d')],{})[_0xbf40('0x28')](respondWithResult(_0x4a24dc,0xc9))[_0xbf40('0x4b')](handleError(_0x4a24dc,null));};exports[_0xbf40('0x27')]=function(_0x105387,_0x2d0a27){if(_0x105387['body']['id']){delete _0x105387['body']['id'];}return db[_0xbf40('0x30')][_0xbf40('0x4a')]({'where':{'id':_0x105387['params']['id']}})[_0xbf40('0x28')](handleEntityNotFound(_0x2d0a27,null))[_0xbf40('0x28')](saveUpdates(_0x105387[_0xbf40('0x4d')],null))['then'](respondWithResult(_0x2d0a27,null))[_0xbf40('0x4b')](handleError(_0x2d0a27,null));};exports[_0xbf40('0x29')]=function(_0x468a44,_0x4880b8){return db[_0xbf40('0x30')]['find']({'where':{'id':_0x468a44[_0xbf40('0x47')]['id']}})['then'](handleEntityNotFound(_0x4880b8,null))[_0xbf40('0x28')](removeEntity(_0x4880b8,null))['catch'](handleError(_0x4880b8,null));}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.model.js b/server/api/intDeskField/intDeskField.model.js index d9eb149..15368c8 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 _0x7c18=['util','../../config/logger','api','moment','bluebird','request-promise','./intDeskField.attributes','exports','DeskField','int_desk_fields','desk_unique_index','idField','FieldId'];(function(_0x5950f0,_0x1d133b){var _0x4a5f0e=function(_0x27e6d5){while(--_0x27e6d5){_0x5950f0['push'](_0x5950f0['shift']());}};_0x4a5f0e(++_0x1d133b);}(_0x7c18,0x12b));var _0x87c1=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x7c18[_0x14add3];return _0x4a174f;};'use strict';var _=require('lodash');var util=require(_0x87c1('0x0'));var logger=require(_0x87c1('0x1'))(_0x87c1('0x2'));var moment=require(_0x87c1('0x3'));var BPromise=require(_0x87c1('0x4'));var rp=require(_0x87c1('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x87c1('0x6'));module[_0x87c1('0x7')]=function(_0x1bd337,_0x2eeeae){return _0x1bd337['define'](_0x87c1('0x8'),attributes,{'tableName':_0x87c1('0x9'),'paranoid':![],'indexes':[{'name':_0x87c1('0xa'),'fields':[_0x87c1('0xb'),_0x87c1('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xc01c=['DeskField','int_desk_fields','desk_unique_index','idField','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./intDeskField.attributes','define'];(function(_0x55087d,_0x501857){var _0x171119=function(_0x13a42d){while(--_0x13a42d){_0x55087d['push'](_0x55087d['shift']());}};_0x171119(++_0x501857);}(_0xc01c,0xd6));var _0xcc01=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc01c[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xcc01('0x0'));var util=require(_0xcc01('0x1'));var logger=require(_0xcc01('0x2'))(_0xcc01('0x3'));var moment=require(_0xcc01('0x4'));var BPromise=require(_0xcc01('0x5'));var rp=require(_0xcc01('0x6'));var fs=require('fs');var path=require(_0xcc01('0x7'));var rimraf=require(_0xcc01('0x8'));var config=require('../../config/environment');var attributes=require(_0xcc01('0x9'));module['exports']=function(_0x37a2e9,_0x48d3bd){return _0x37a2e9[_0xcc01('0xa')](_0xcc01('0xb'),attributes,{'tableName':_0xcc01('0xc'),'paranoid':![],'indexes':[{'name':_0xcc01('0xd'),'fields':[_0xcc01('0xe'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.rpc.js b/server/api/intDeskField/intDeskField.rpc.js index babf2a5..f3e36c9 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 _0x0fbf=['request\x20sent','debug','DeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request','then','DeskField,\x20%s,\x20%s'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x0fbf,0x81));var _0xf0fb=function(_0x52d801,_0x1f30b9){_0x52d801=_0x52d801-0x0;var _0x2a1b0e=_0x0fbf[_0x52d801];return _0x2a1b0e;};'use strict';var _=require(_0xf0fb('0x0'));var util=require(_0xf0fb('0x1'));var moment=require(_0xf0fb('0x2'));var BPromise=require(_0xf0fb('0x3'));var rs=require(_0xf0fb('0x4'));var fs=require('fs');var Redis=require(_0xf0fb('0x5'));var db=require(_0xf0fb('0x6'))['db'];var utils=require(_0xf0fb('0x7'));var logger=require(_0xf0fb('0x8'))('rpc');var config=require('../../config/environment');var jayson=require(_0xf0fb('0x9'));var client=jayson[_0xf0fb('0xa')][_0xf0fb('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5da877,_0x27f384,_0x129f72){return new BPromise(function(_0x552627,_0x55bd25){return client[_0xf0fb('0xc')](_0x5da877,_0x129f72)[_0xf0fb('0xd')](function(_0x3ae903){logger['info'](_0xf0fb('0xe'),_0x27f384,_0xf0fb('0xf'));logger[_0xf0fb('0x10')](_0xf0fb('0x11'),_0x27f384,_0xf0fb('0xf'),JSON[_0xf0fb('0x12')](_0x3ae903));if(_0x3ae903['error']){if(_0x3ae903[_0xf0fb('0x13')][_0xf0fb('0x14')]===0x1f4){logger[_0xf0fb('0x13')](_0xf0fb('0xe'),_0x27f384,_0x3ae903['error'][_0xf0fb('0x15')]);return _0x55bd25(_0x3ae903[_0xf0fb('0x13')][_0xf0fb('0x15')]);}logger[_0xf0fb('0x13')](_0xf0fb('0xe'),_0x27f384,_0x3ae903[_0xf0fb('0x13')][_0xf0fb('0x15')]);return _0x552627(_0x3ae903[_0xf0fb('0x13')][_0xf0fb('0x15')]);}else{logger[_0xf0fb('0x16')](_0xf0fb('0xe'),_0x27f384,'request\x20sent');_0x552627(_0x3ae903['result'][_0xf0fb('0x15')]);}})[_0xf0fb('0x17')](function(_0x3bd849){logger['error'](_0xf0fb('0xe'),_0x27f384,_0x3bd849);_0x55bd25(_0x3bd849);});});} \ No newline at end of file +var _0x2ee4=['ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','info','request\x20sent','DeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','DeskField,\x20%s,\x20%s','result','lodash','moment','bluebird','randomstring'];(function(_0x2ee738,_0x51f028){var _0x1672e6=function(_0x181042){while(--_0x181042){_0x2ee738['push'](_0x2ee738['shift']());}};_0x1672e6(++_0x51f028);}(_0x2ee4,0x1ca));var _0x42ee=function(_0x477f1a,_0x4999d3){_0x477f1a=_0x477f1a-0x0;var _0x1cf352=_0x2ee4[_0x477f1a];return _0x1cf352;};'use strict';var _=require(_0x42ee('0x0'));var util=require('util');var moment=require(_0x42ee('0x1'));var BPromise=require(_0x42ee('0x2'));var rs=require(_0x42ee('0x3'));var fs=require('fs');var Redis=require(_0x42ee('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x42ee('0x5'));var logger=require(_0x42ee('0x6'))(_0x42ee('0x7'));var config=require('../../config/environment');var jayson=require(_0x42ee('0x8'));var client=jayson[_0x42ee('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2d9237,_0x586a84,_0x235ad1){return new BPromise(function(_0x578679,_0x55286c){return client[_0x42ee('0xa')](_0x2d9237,_0x235ad1)[_0x42ee('0xb')](function(_0x44d796){logger[_0x42ee('0xc')]('DeskField,\x20%s,\x20%s',_0x586a84,_0x42ee('0xd'));logger['debug'](_0x42ee('0xe'),_0x586a84,_0x42ee('0xd'),JSON[_0x42ee('0xf')](_0x44d796));if(_0x44d796[_0x42ee('0x10')]){if(_0x44d796[_0x42ee('0x10')][_0x42ee('0x11')]===0x1f4){logger['error']('DeskField,\x20%s,\x20%s',_0x586a84,_0x44d796[_0x42ee('0x10')][_0x42ee('0x12')]);return _0x55286c(_0x44d796['error'][_0x42ee('0x12')]);}logger['error'](_0x42ee('0x13'),_0x586a84,_0x44d796[_0x42ee('0x10')]['message']);return _0x578679(_0x44d796[_0x42ee('0x10')]['message']);}else{logger[_0x42ee('0xc')]('DeskField,\x20%s,\x20%s',_0x586a84,_0x42ee('0xd'));_0x578679(_0x44d796[_0x42ee('0x14')][_0x42ee('0x12')]);}})['catch'](function(_0x489a11){logger[_0x42ee('0x10')]('DeskField,\x20%s,\x20%s',_0x586a84,_0x489a11);_0x55286c(_0x489a11);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/index.js b/server/api/intDynamics365Account/index.js index edde88a..4fae005 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 _0x64e9=['connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/:id','show','/:id/configurations','/:id/fields','getFields','post','create','addConfiguration','update','delete','destroy','exports','multer','util'];(function(_0x5f835c,_0x18686c){var _0x259f14=function(_0x438505){while(--_0x438505){_0x5f835c['push'](_0x5f835c['shift']());}};_0x259f14(++_0x18686c);}(_0x64e9,0x71));var _0x964e=function(_0x114bdf,_0x119ada){_0x114bdf=_0x114bdf-0x0;var _0x5658f6=_0x64e9[_0x114bdf];return _0x5658f6;};'use strict';var multer=require(_0x964e('0x0'));var util=require(_0x964e('0x1'));var path=require('path');var timeout=require(_0x964e('0x2'));var express=require(_0x964e('0x3'));var router=express['Router']();var fs_extra=require(_0x964e('0x4'));var auth=require(_0x964e('0x5'));var interaction=require(_0x964e('0x6'));var config=require(_0x964e('0x7'));var controller=require('./intDynamics365Account.controller');router['get']('/',auth[_0x964e('0x8')](),controller[_0x964e('0x9')]);router[_0x964e('0xa')](_0x964e('0xb'),auth['isAuthenticated'](),controller[_0x964e('0xc')]);router[_0x964e('0xa')](_0x964e('0xd'),auth[_0x964e('0x8')](),controller['getConfigurations']);router[_0x964e('0xa')](_0x964e('0xe'),auth['isAuthenticated'](),controller[_0x964e('0xf')]);router[_0x964e('0x10')]('/',auth[_0x964e('0x8')](),controller[_0x964e('0x11')]);router[_0x964e('0x10')](_0x964e('0xd'),auth['isAuthenticated'](),controller[_0x964e('0x12')]);router['put'](_0x964e('0xb'),auth[_0x964e('0x8')](),controller[_0x964e('0x13')]);router[_0x964e('0x14')](_0x964e('0xb'),auth[_0x964e('0x8')](),controller[_0x964e('0x15')]);module[_0x964e('0x16')]=router; \ No newline at end of file +var _0x575e=['connect-timeout','express','Router','../../components/auth/service','../../config/environment','./intDynamics365Account.controller','isAuthenticated','get','/:id','/:id/configurations','getConfigurations','/:id/fields','create','addConfiguration','put','destroy','multer'];(function(_0x1bfcfc,_0x140f5b){var _0x1041ff=function(_0x2d48fc){while(--_0x2d48fc){_0x1bfcfc['push'](_0x1bfcfc['shift']());}};_0x1041ff(++_0x140f5b);}(_0x575e,0x197));var _0xe575=function(_0x383d7d,_0x3a0199){_0x383d7d=_0x383d7d-0x0;var _0x15565c=_0x575e[_0x383d7d];return _0x15565c;};'use strict';var multer=require(_0xe575('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xe575('0x1'));var express=require(_0xe575('0x2'));var router=express[_0xe575('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xe575('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xe575('0x5'));var controller=require(_0xe575('0x6'));router['get']('/',auth[_0xe575('0x7')](),controller['index']);router[_0xe575('0x8')](_0xe575('0x9'),auth[_0xe575('0x7')](),controller['show']);router['get'](_0xe575('0xa'),auth['isAuthenticated'](),controller[_0xe575('0xb')]);router[_0xe575('0x8')](_0xe575('0xc'),auth['isAuthenticated'](),controller['getFields']);router['post']('/',auth[_0xe575('0x7')](),controller[_0xe575('0xd')]);router['post'](_0xe575('0xa'),auth[_0xe575('0x7')](),controller[_0xe575('0xe')]);router[_0xe575('0xf')](_0xe575('0x9'),auth[_0xe575('0x7')](),controller['update']);router['delete'](_0xe575('0x9'),auth[_0xe575('0x7')](),controller[_0xe575('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.attributes.js b/server/api/intDynamics365Account/intDynamics365Account.attributes.js index 0163223..0e632e3 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 _0x9e96=['exports','STRING','sequelize'];(function(_0x2af84b,_0x18be67){var _0x5eaee2=function(_0x963836){while(--_0x963836){_0x2af84b['push'](_0x2af84b['shift']());}};_0x5eaee2(++_0x18be67);}(_0x9e96,0xa7));var _0x69e9=function(_0x250732,_0x254fa7){_0x250732=_0x250732-0x0;var _0xa4923f=_0x9e96[_0x250732];return _0xa4923f;};'use strict';var Sequelize=require(_0x69e9('0x0'));module[_0x69e9('0x1')]={'name':{'type':Sequelize[_0x69e9('0x2')]},'username':{'type':Sequelize['STRING']},'password':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x69e9('0x2')]},'tenantId':{'type':Sequelize[_0x69e9('0x2')]},'clientId':{'type':Sequelize[_0x69e9('0x2')]},'clientSecret':{'type':Sequelize[_0x69e9('0x2')]},'serverUrl':{'type':Sequelize[_0x69e9('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x48a0=['sequelize','exports','STRING'];(function(_0xaa347b,_0x5db22d){var _0x56f792=function(_0x33b93c){while(--_0x33b93c){_0xaa347b['push'](_0xaa347b['shift']());}};_0x56f792(++_0x5db22d);}(_0x48a0,0x1e3));var _0x048a=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x48a0[_0x57b54c];return _0x59cc19;};'use strict';var Sequelize=require(_0x048a('0x0'));module[_0x048a('0x1')]={'name':{'type':Sequelize[_0x048a('0x2')]},'username':{'type':Sequelize[_0x048a('0x2')]},'password':{'type':Sequelize[_0x048a('0x2')]},'remoteUri':{'type':Sequelize[_0x048a('0x2')]},'tenantId':{'type':Sequelize['STRING']},'clientId':{'type':Sequelize['STRING']},'clientSecret':{'type':Sequelize[_0x048a('0x2')]},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.controller.js b/server/api/intDynamics365Account/intDynamics365Account.controller.js index ba99856..61e2467 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 _0x1b69=['../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','save','update','then','destroy','error','stack','name','send','map','Dynamics365Account','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','params','find','create','body','getConfigurations','findOne','Dynamics365Configuration','order','addConfiguration','AccountId','Subjects','getSubjects','Descriptions','getDescriptions','Dynamics365Field','getFields','ticketType','incident','Incident','PhoneCall','title','description','customerid','ownerid','caseorigincode','subject','phonenumber','regardingobjectid','directioncode','accountidname','accountidyominame','contactidname','contactidyominame','contractdetailidname','contractidname','createdbyexternalpartyname','createdbyexternalpartyyominame','createdbyname','createdbyyominame','createdon','createdonbehalfbyyominame','customeridyominame','emailaddress','entitlementidname','entityimage_timestamp','entityimage_url','escalatedon','exchangerate','firstresponsebykpiidname','importsequencenumber','influencescore','kbarticleidname','masteridname','modifiedbyexternalpartyname','modifiedon','modifiedonbehalfbyname','modifiedonbehalfbyyominame','msdyn_incidenttypename','msdyn_iotalertname','numberofchildincidents','onholdtime','overriddencreatedon','owneridname','owneridtype','owneridyominame','parentcaseidname','primarycontactidyominame','productidname','productserialnumber','resolvebykpiidname','responseby','responsiblecontactidname','responsiblecontactidyominame','slaname','socialprofileidname','statuscode','ticketnumber','timezoneruleversionnumber','utcconversiontimezonecode','versionnumber','concat','username','password','remoteUri','tenantId','clientId','clientSecret','slice','lastIndexOf','format','%s/api/data/v9.0/','POST','https://login.microsoftonline.com/','/oauth2/token','access_token','GET','Bearer\x20','value','EntityDefinitions(',')?$select=LogicalName&$expand=Attributes($select=LogicalName)','4.0','Attributes','remove','LogicalName','forEach','@odata.type','substring','push','MetadataId','all','isNil','BooleanAttributeMetadata','StringAttributeMetadata','DoubleAttributeMetadata','IntegerAttributeMetadata','MemoAttributeMetadata','DateTimeAttributeMetadata','EntityNameAttributeMetadata','StateAttributeMetadata','DecimalAttributeMetadata','test','statusCode','Wrong\x20credentials',')/Attributes(',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','OptionSet','Options','UserLocalizedLabel','Label','Value','DisplayName',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','TrueOption','true','FalseOption',')/Microsoft.Dynamics.CRM.','?$select=DisplayName,LogicalName','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring'];(function(_0x4eeb9f,_0x1fb313){var _0x68b108=function(_0x162a93){while(--_0x162a93){_0x4eeb9f['push'](_0x4eeb9f['shift']());}};_0x68b108(++_0x1fb313);}(_0x1b69,0x190));var _0x91b6=function(_0x456fb1,_0x859a1d){_0x456fb1=_0x456fb1-0x0;var _0x4083d6=_0x1b69[_0x456fb1];return _0x4083d6;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x91b6('0x0'));var rp=require(_0x91b6('0x1'));var moment=require(_0x91b6('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x91b6('0x3'));var util=require(_0x91b6('0x4'));var path=require(_0x91b6('0x5'));var sox=require(_0x91b6('0x6'));var csv=require(_0x91b6('0x7'));var ejs=require(_0x91b6('0x8'));var fs=require('fs');var fs_extra=require(_0x91b6('0x9'));var _=require(_0x91b6('0xa'));var squel=require(_0x91b6('0xb'));var crypto=require(_0x91b6('0xc'));var jsforce=require(_0x91b6('0xd'));var deskjs=require(_0x91b6('0xe'));var toCsv=require(_0x91b6('0x7'));var querystring=require(_0x91b6('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x91b6('0x10'));var qs=require(_0x91b6('0x11'));var as=require(_0x91b6('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x91b6('0x13'))(_0x91b6('0x14'));var utils=require(_0x91b6('0x15'));var config=require(_0x91b6('0x16'));var licenseUtil=require(_0x91b6('0x17'));var db=require(_0x91b6('0x18'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x322317,_0x572a5f){_0x572a5f=_0x572a5f||0xcc;return function(_0x104fe4){if(_0x104fe4){return _0x322317[_0x91b6('0x19')](_0x572a5f);}return _0x322317[_0x91b6('0x1a')](_0x572a5f)[_0x91b6('0x1b')]();};}function respondWithResult(_0x4c65e5,_0x8ce679){_0x8ce679=_0x8ce679||0xc8;return function(_0x239286){if(_0x239286){return _0x4c65e5[_0x91b6('0x1a')](_0x8ce679)[_0x91b6('0x1c')](_0x239286);}};}function respondWithFilteredResult(_0x43acc5,_0x5162ee){return function(_0x29841d){if(_0x29841d){var _0xd18122=typeof _0x5162ee[_0x91b6('0x1d')]===_0x91b6('0x1e')&&typeof _0x5162ee['limit']==='undefined';var _0x4749ac=_0x29841d[_0x91b6('0x1f')];var _0x191b17=_0xd18122?0x0:_0x5162ee[_0x91b6('0x1d')];var _0xcb408d=_0xd18122?_0x29841d[_0x91b6('0x1f')]:_0x5162ee['offset']+_0x5162ee[_0x91b6('0x20')];var _0x5ae546;if(_0xcb408d>=_0x4749ac){_0xcb408d=_0x4749ac;_0x5ae546=0xc8;}else{_0x5ae546=0xce;}_0x43acc5[_0x91b6('0x1a')](_0x5ae546);return _0x43acc5[_0x91b6('0x21')](_0x91b6('0x22'),_0x191b17+'-'+_0xcb408d+'/'+_0x4749ac)[_0x91b6('0x1c')](_0x29841d);}return null;};}function patchUpdates(_0x46e684){return function(_0x115db5){try{jsonpatch[_0x91b6('0x23')](_0x115db5,_0x46e684,!![]);}catch(_0x2d5610){return BPromise['reject'](_0x2d5610);}return _0x115db5[_0x91b6('0x24')]();};}function saveUpdates(_0x1b877e,_0xe34dc0){return function(_0x560c07){if(_0x560c07){return _0x560c07[_0x91b6('0x25')](_0x1b877e)[_0x91b6('0x26')](function(_0x4e1e2c){return _0x4e1e2c;});}return null;};}function removeEntity(_0x53675b,_0x2b5e5c){return function(_0x499f8c){if(_0x499f8c){return _0x499f8c[_0x91b6('0x27')]()[_0x91b6('0x26')](function(){_0x53675b[_0x91b6('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x28e36a,_0x2f4197){return function(_0x582450){if(!_0x582450){_0x28e36a[_0x91b6('0x19')](0x194);}return _0x582450;};}function handleError(_0x410f0f,_0x27a485){_0x27a485=_0x27a485||0x1f4;return function(_0x331a18){logger[_0x91b6('0x28')](_0x331a18[_0x91b6('0x29')]);if(_0x331a18[_0x91b6('0x2a')]){delete _0x331a18[_0x91b6('0x2a')];}_0x410f0f[_0x91b6('0x1a')](_0x27a485)[_0x91b6('0x2b')](_0x331a18);};}exports['index']=function(_0x52c8f0,_0x1c3595){var _0x2993ba={},_0xe6d076={},_0x41895e={'count':0x0,'rows':[]};var _0x3dd225=_[_0x91b6('0x2c')](db[_0x91b6('0x2d')][_0x91b6('0x2e')],function(_0x2c5804){return{'name':_0x2c5804[_0x91b6('0x2f')],'type':_0x2c5804[_0x91b6('0x30')][_0x91b6('0x31')]};});_0xe6d076[_0x91b6('0x32')]=_[_0x91b6('0x2c')](_0x3dd225,_0x91b6('0x2a'));_0xe6d076[_0x91b6('0x33')]=_[_0x91b6('0x34')](_0x52c8f0[_0x91b6('0x33')]);_0xe6d076[_0x91b6('0x35')]=_[_0x91b6('0x36')](_0xe6d076[_0x91b6('0x32')],_0xe6d076['query']);_0x2993ba[_0x91b6('0x37')]=_[_0x91b6('0x36')](_0xe6d076[_0x91b6('0x32')],qs[_0x91b6('0x38')](_0x52c8f0['query']['fields']));_0x2993ba[_0x91b6('0x37')]=_0x2993ba['attributes'][_0x91b6('0x39')]?_0x2993ba[_0x91b6('0x37')]:_0xe6d076['model'];if(!_0x52c8f0['query'][_0x91b6('0x3a')](_0x91b6('0x3b'))){_0x2993ba['limit']=qs[_0x91b6('0x20')](_0x52c8f0[_0x91b6('0x33')][_0x91b6('0x20')]);_0x2993ba['offset']=qs[_0x91b6('0x1d')](_0x52c8f0[_0x91b6('0x33')][_0x91b6('0x1d')]);}_0x2993ba['order']=qs[_0x91b6('0x3c')](_0x52c8f0[_0x91b6('0x33')][_0x91b6('0x3c')]);_0x2993ba[_0x91b6('0x3d')]=qs[_0x91b6('0x35')](_[_0x91b6('0x3e')](_0x52c8f0[_0x91b6('0x33')],_0xe6d076[_0x91b6('0x35')]),_0x3dd225);if(_0x52c8f0[_0x91b6('0x33')][_0x91b6('0x3f')]){_0x2993ba[_0x91b6('0x3d')]=_[_0x91b6('0x40')](_0x2993ba[_0x91b6('0x3d')],{'$or':_['map'](_0x3dd225,function(_0x56e581){if(_0x56e581[_0x91b6('0x30')]!=='VIRTUAL'){var _0x26e9d1={};_0x26e9d1[_0x56e581[_0x91b6('0x2a')]]={'$like':'%'+_0x52c8f0[_0x91b6('0x33')][_0x91b6('0x3f')]+'%'};return _0x26e9d1;}})});}_0x2993ba=_[_0x91b6('0x40')]({},_0x2993ba,_0x52c8f0[_0x91b6('0x41')]);var _0x48e6d0={'where':_0x2993ba[_0x91b6('0x3d')]};return db[_0x91b6('0x2d')]['count'](_0x48e6d0)[_0x91b6('0x26')](function(_0x319d21){_0x41895e['count']=_0x319d21;if(_0x52c8f0['query'][_0x91b6('0x42')]){_0x2993ba[_0x91b6('0x43')]=[{'all':!![]}];}return db[_0x91b6('0x2d')][_0x91b6('0x44')](_0x2993ba);})[_0x91b6('0x26')](function(_0x5433a1){_0x41895e[_0x91b6('0x45')]=_0x5433a1;return _0x41895e;})[_0x91b6('0x26')](respondWithFilteredResult(_0x1c3595,_0x2993ba))[_0x91b6('0x46')](handleError(_0x1c3595,null));};exports['show']=function(_0x3c406b,_0x36bfb5){var _0x4bd575={'raw':![],'where':{'id':_0x3c406b[_0x91b6('0x47')]['id']}},_0x171a21={};_0x171a21[_0x91b6('0x32')]=_['keys'](db[_0x91b6('0x2d')][_0x91b6('0x2e')]);_0x171a21[_0x91b6('0x33')]=_[_0x91b6('0x34')](_0x3c406b[_0x91b6('0x33')]);_0x171a21['filters']=_[_0x91b6('0x36')](_0x171a21[_0x91b6('0x32')],_0x171a21['query']);_0x4bd575['attributes']=_['intersection'](_0x171a21[_0x91b6('0x32')],qs[_0x91b6('0x38')](_0x3c406b[_0x91b6('0x33')][_0x91b6('0x38')]));_0x4bd575['attributes']=_0x4bd575['attributes'][_0x91b6('0x39')]?_0x4bd575[_0x91b6('0x37')]:_0x171a21[_0x91b6('0x32')];if(_0x3c406b[_0x91b6('0x33')][_0x91b6('0x42')]){_0x4bd575['include']=[{'all':!![]}];}_0x4bd575=_[_0x91b6('0x40')]({},_0x4bd575,_0x3c406b[_0x91b6('0x41')]);return db[_0x91b6('0x2d')][_0x91b6('0x48')](_0x4bd575)['then'](handleEntityNotFound(_0x36bfb5,null))[_0x91b6('0x26')](respondWithResult(_0x36bfb5,null))['catch'](handleError(_0x36bfb5,null));};exports[_0x91b6('0x49')]=function(_0x53a489,_0x43a632){return db[_0x91b6('0x2d')]['create'](_0x53a489[_0x91b6('0x4a')],{})[_0x91b6('0x26')](respondWithResult(_0x43a632,0xc9))[_0x91b6('0x46')](handleError(_0x43a632,null));};exports['update']=function(_0x54dc6c,_0x93ad8b){if(_0x54dc6c['body']['id']){delete _0x54dc6c[_0x91b6('0x4a')]['id'];}return db['Dynamics365Account']['find']({'where':{'id':_0x54dc6c['params']['id']}})[_0x91b6('0x26')](handleEntityNotFound(_0x93ad8b,null))[_0x91b6('0x26')](saveUpdates(_0x54dc6c[_0x91b6('0x4a')],null))[_0x91b6('0x26')](respondWithResult(_0x93ad8b,null))[_0x91b6('0x46')](handleError(_0x93ad8b,null));};exports[_0x91b6('0x27')]=function(_0x2c92a9,_0x5a9d24){return db[_0x91b6('0x2d')][_0x91b6('0x48')]({'where':{'id':_0x2c92a9[_0x91b6('0x47')]['id']}})['then'](handleEntityNotFound(_0x5a9d24,null))['then'](removeEntity(_0x5a9d24,null))[_0x91b6('0x46')](handleError(_0x5a9d24,null));};exports[_0x91b6('0x4b')]=function(_0x4a5ce1,_0x19b40e,_0x660450){var _0x1e5a5b={};var _0x3b0540={};var _0x138f9c;var _0x54cb80;return db[_0x91b6('0x2d')][_0x91b6('0x4c')]({'where':{'id':_0x4a5ce1[_0x91b6('0x47')]['id']}})[_0x91b6('0x26')](handleEntityNotFound(_0x19b40e,null))[_0x91b6('0x26')](function(_0x3b2e29){if(_0x3b2e29){_0x138f9c=_0x3b2e29;_0x3b0540[_0x91b6('0x32')]=_['keys'](db[_0x91b6('0x4d')]['rawAttributes']);_0x3b0540[_0x91b6('0x33')]=_[_0x91b6('0x34')](_0x4a5ce1[_0x91b6('0x33')]);_0x3b0540[_0x91b6('0x35')]=_[_0x91b6('0x36')](_0x3b0540[_0x91b6('0x32')],_0x3b0540['query']);_0x1e5a5b[_0x91b6('0x37')]=_[_0x91b6('0x36')](_0x3b0540[_0x91b6('0x32')],qs[_0x91b6('0x38')](_0x4a5ce1['query'][_0x91b6('0x38')]));_0x1e5a5b[_0x91b6('0x37')]=_0x1e5a5b[_0x91b6('0x37')][_0x91b6('0x39')]?_0x1e5a5b['attributes']:_0x3b0540[_0x91b6('0x32')];_0x1e5a5b[_0x91b6('0x4e')]=qs['sort'](_0x4a5ce1[_0x91b6('0x33')][_0x91b6('0x3c')]);_0x1e5a5b[_0x91b6('0x3d')]=qs['filters'](_['pick'](_0x4a5ce1[_0x91b6('0x33')],_0x3b0540[_0x91b6('0x35')]));if(_0x4a5ce1[_0x91b6('0x33')][_0x91b6('0x3f')]){_0x1e5a5b[_0x91b6('0x3d')]=_[_0x91b6('0x40')](_0x1e5a5b[_0x91b6('0x3d')],{'$or':_[_0x91b6('0x2c')](_0x1e5a5b[_0x91b6('0x37')],function(_0x11d35b){var _0x14297e={};_0x14297e[_0x11d35b]={'$like':'%'+_0x4a5ce1[_0x91b6('0x33')][_0x91b6('0x3f')]+'%'};return _0x14297e;})});}_0x1e5a5b=_[_0x91b6('0x40')]({},_0x1e5a5b,_0x4a5ce1[_0x91b6('0x41')]);return _0x138f9c[_0x91b6('0x4b')](_0x1e5a5b);}})['then'](function(_0x1eaa86){if(_0x1eaa86){_0x54cb80=_0x1eaa86['length'];if(!_0x4a5ce1['query'][_0x91b6('0x3a')](_0x91b6('0x3b'))){_0x1e5a5b[_0x91b6('0x20')]=qs[_0x91b6('0x20')](_0x4a5ce1[_0x91b6('0x33')][_0x91b6('0x20')]);_0x1e5a5b[_0x91b6('0x1d')]=qs[_0x91b6('0x1d')](_0x4a5ce1[_0x91b6('0x33')][_0x91b6('0x1d')]);}return _0x138f9c['getConfigurations'](_0x1e5a5b);}})[_0x91b6('0x26')](function(_0x4e537d){if(_0x4e537d){return _0x4e537d?{'count':_0x54cb80,'rows':_0x4e537d}:null;}})[_0x91b6('0x26')](respondWithResult(_0x19b40e,null))['catch'](handleError(_0x19b40e,null));};exports[_0x91b6('0x4f')]=function(_0x6f9b6b,_0x294b56,_0x81f8b0){if(_0x6f9b6b['body']['id']){delete _0x6f9b6b['body']['id'];}return db[_0x91b6('0x2d')][_0x91b6('0x4c')]({'where':{'id':_0x6f9b6b[_0x91b6('0x47')]['id']}})['then'](handleEntityNotFound(_0x294b56,null))['then'](function(_0x21fd80){if(_0x21fd80){_0x6f9b6b[_0x91b6('0x4a')][_0x91b6('0x50')]=_0x21fd80['id'];_0x6f9b6b['body'][_0x91b6('0x51')]=integrations[_0x91b6('0x52')](_0x6f9b6b[_0x91b6('0x4a')]['channel'],_0x6f9b6b[_0x91b6('0x4a')][_0x91b6('0x30')]);_0x6f9b6b[_0x91b6('0x4a')][_0x91b6('0x53')]=integrations[_0x91b6('0x54')](_0x6f9b6b[_0x91b6('0x4a')]['channel'],_0x6f9b6b[_0x91b6('0x4a')][_0x91b6('0x30')]);return db[_0x91b6('0x4d')][_0x91b6('0x49')](_0x6f9b6b[_0x91b6('0x4a')],{'include':[{'model':db[_0x91b6('0x55')],'as':'Subjects'},{'model':db['Dynamics365Field'],'as':_0x91b6('0x53')}]});}return null;})[_0x91b6('0x26')](respondWithResult(_0x294b56,null))[_0x91b6('0x46')](handleError(_0x294b56,null));};exports[_0x91b6('0x56')]=function(_0x3d14c9,_0x1cfa1b,_0x258a43){var _0x4af920=_0x3d14c9[_0x91b6('0x33')][_0x91b6('0x57')];var _0x382733=_0x4af920===_0x91b6('0x58')?_0x91b6('0x59'):_0x91b6('0x5a');var _0x25082c='';var _0x51acd2='';var _0x57aca9='';var _0x404383='';var _0x34608f='';var _0x576c1b='';var _0x2523eb='';var _0x25b49a='';var _0x45ae02=[_0x91b6('0x5b'),_0x91b6('0x5c'),_0x91b6('0x5d'),_0x91b6('0x5e'),_0x91b6('0x5f'),_0x91b6('0x60'),_0x91b6('0x61'),_0x91b6('0x62'),_0x91b6('0x63'),'phonecall_activity_parties'];var _0x2ad408=[_0x91b6('0x64'),_0x91b6('0x65'),'actualserviceunits','billedserviceunits',_0x91b6('0x66'),_0x91b6('0x67'),_0x91b6('0x68'),_0x91b6('0x69'),_0x91b6('0x6a'),_0x91b6('0x6b'),_0x91b6('0x6c'),_0x91b6('0x6d'),_0x91b6('0x6e'),'createdonbehalfbyname',_0x91b6('0x6f'),'customeridname','customeridtype',_0x91b6('0x70'),_0x91b6('0x71'),_0x91b6('0x72'),_0x91b6('0x73'),_0x91b6('0x74'),_0x91b6('0x75'),_0x91b6('0x76'),_0x91b6('0x77'),'followupby',_0x91b6('0x78'),_0x91b6('0x79'),_0x91b6('0x7a'),'lastonholdtime',_0x91b6('0x7b'),_0x91b6('0x7c'),'modifiedbyexternalpartyyominame','modifiedbyname','modifiedbyyominame',_0x91b6('0x7d'),_0x91b6('0x7e'),_0x91b6('0x7f'),_0x91b6('0x80'),_0x91b6('0x81'),_0x91b6('0x82'),_0x91b6('0x83'),_0x91b6('0x84'),_0x91b6('0x85'),_0x91b6('0x86'),_0x91b6('0x87'),_0x91b6('0x88'),'primarycontactidname',_0x91b6('0x89'),'prioritycodename',_0x91b6('0x8a'),_0x91b6('0x8b'),'resolveby',_0x91b6('0x8c'),_0x91b6('0x8d'),_0x91b6('0x8e'),_0x91b6('0x8f'),'sentimentvalue','slainvokedidname',_0x91b6('0x90'),_0x91b6('0x91'),'statecode',_0x91b6('0x92'),'subjectidname',_0x91b6('0x93'),_0x91b6('0x94'),'transactioncurrencyidname','traversedpath',_0x91b6('0x95'),_0x91b6('0x96')];var _0x507c93=_0x45ae02[_0x91b6('0x97')](_0x2ad408);return db[_0x91b6('0x2d')][_0x91b6('0x4c')]({'where':{'id':_0x3d14c9[_0x91b6('0x47')]['id']},'attributes':['id',_0x91b6('0x98'),_0x91b6('0x99'),_0x91b6('0x9a'),_0x91b6('0x9b'),_0x91b6('0x9c'),_0x91b6('0x9d')]})['then'](handleEntityNotFound(_0x1cfa1b,null))['then'](function(_0x5712d4){if(_0x5712d4){_0x25b49a=_0x5712d4[_0x91b6('0x9a')];var _0x126086=_0x25b49a[_0x91b6('0x9e')](-0x1);if(_0x126086==='/'){_0x25b49a=_0x25b49a['substring'](0x0,_0x25b49a[_0x91b6('0x9f')](_0x126086));}_0x2523eb=util[_0x91b6('0xa0')](_0x91b6('0xa1'),_0x25b49a);var _0xe64510={'method':_0x91b6('0xa2'),'uri':_0x91b6('0xa3')+_0x5712d4['tenantId']+_0x91b6('0xa4'),'form':{'client_id':_0x5712d4[_0x91b6('0x9c')],'resource':_0x25b49a,'username':_0x5712d4[_0x91b6('0x98')],'password':_0x5712d4[_0x91b6('0x99')],'grant_type':_0x91b6('0x99'),'client_secret':_0x5712d4[_0x91b6('0x9d')]},'json':!![]};return rp(_0xe64510);}})[_0x91b6('0x26')](function(_0x54dae8){_0x576c1b=_0x54dae8[_0x91b6('0xa5')];var _0x106b6e={'method':_0x91b6('0xa6'),'uri':encodeURI(_0x2523eb+'EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27'+_0x382733+'\x27'),'headers':{'Authorization':_0x91b6('0xa7')+_0x576c1b,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x106b6e);})[_0x91b6('0x26')](function(_0x3f9dda){var _0xee843=_0x3f9dda[_0x91b6('0xa8')][0x0];var _0x4510b6=_0xee843['MetadataId'];var _0x51162c={'method':_0x91b6('0xa6'),'uri':_0x2523eb+_0x91b6('0xa9')+_0x4510b6+_0x91b6('0xaa'),'headers':{'Authorization':_0x91b6('0xa7')+_0x576c1b,'If-None-Match':null,'OData-Version':_0x91b6('0xab')},'json':!![]};return rp(_0x51162c);})[_0x91b6('0x26')](function(_0x8c676e){_0x25082c=_0x8c676e;_0x51acd2=_0x25082c[_0x91b6('0xac')];_0x51acd2=_[_0x91b6('0xad')](_0x51acd2,function(_0x45c9ec){return!_0x507c93['includes'](_0x45c9ec[_0x91b6('0xae')]);});var _0xc8159c=[];var _0x40fef8=[];_0x51acd2[_0x91b6('0xaf')](function(_0x2b7c84){if(_0x2b7c84['@odata.type']){var _0x368e08=_0x2b7c84[_0x91b6('0xb0')][_0x91b6('0xb1')](_0x2b7c84[_0x91b6('0xb0')][_0x91b6('0x9f')]('.')+0x1);if(_0x368e08==='PicklistAttributeMetadata'){_0xc8159c[_0x91b6('0xb2')](getSelectList(_0x2523eb,_0x4af920,_0x40fef8,_0x25082c[_0x91b6('0xb3')],_0x2b7c84[_0x91b6('0xb3')],_0x576c1b));}}});return Promise[_0x91b6('0xb4')](_0xc8159c);})[_0x91b6('0x26')](function(_0x8df06b){_0x57aca9=_0x8df06b[0x0];var _0x2eb244=[];var _0x2aa2d5=[];_0x51acd2[_0x91b6('0xaf')](function(_0x14daa){if(!_[_0x91b6('0xb5')](_0x14daa['@odata.type'])){var _0x1097c9=_0x14daa['@odata.type'][_0x91b6('0xb1')](_0x14daa[_0x91b6('0xb0')][_0x91b6('0x9f')]('.')+0x1);if(_0x1097c9===_0x91b6('0xb6')){_0x2eb244[_0x91b6('0xb2')](getBooleanList(_0x2523eb,_0x4af920,_0x2aa2d5,_0x25082c[_0x91b6('0xb3')],_0x14daa[_0x91b6('0xb3')],_0x576c1b));}}});return Promise['all'](_0x2eb244);})[_0x91b6('0x26')](function(_0x5ab2e5){_0x404383=_0x5ab2e5[0x0];var _0x303672=[];var _0x1bb2db=[];_0x51acd2['forEach'](function(_0x436482){if(_0x436482['@odata.type']){var _0x24bdba=_0x436482[_0x91b6('0xb0')]['substring'](_0x436482[_0x91b6('0xb0')][_0x91b6('0x9f')]('.')+0x1);if(_0x24bdba===_0x91b6('0xb7')||_0x24bdba===_0x91b6('0xb8')||_0x24bdba==='BigIntAttributeMetadata'||_0x24bdba===_0x91b6('0xb9')||_0x24bdba===_0x91b6('0xba')||_0x24bdba===_0x91b6('0xbb')||_0x24bdba==='StatusAttributeMetadata'||_0x24bdba===_0x91b6('0xbc')||_0x24bdba===_0x91b6('0xbd')||_0x24bdba===_0x91b6('0xbe')){_0x303672['push'](getInputList(_0x2523eb,_0x4af920,_0x24bdba,_0x1bb2db,_0x25082c['MetadataId'],_0x436482[_0x91b6('0xb3')],_0x576c1b));}}});return Promise[_0x91b6('0xb4')](_0x303672);})[_0x91b6('0x26')](function(_0x254a94){_0x34608f=_0x254a94[0x0];var _0x29e946=_0x57aca9['concat'](_0x404383)['concat'](_0x34608f);var _0x5419d9={'count':_0x29e946[_0x91b6('0x39')],'rows':_0x29e946};return _0x5419d9;})['then'](respondWithResult(_0x1cfa1b,null))[_0x91b6('0x46')](function(_0x5eea6e){var _0x28aed6=_0x3d14c9['query'][_0x91b6('0xbf')]?0x1f4:_0x5eea6e[_0x91b6('0xc0')]||0x1f4;logger['error'](_0x5eea6e[_0x91b6('0x29')]);delete _0x5eea6e[_0x91b6('0x2a')];if(_0x28aed6===0x191){_0x28aed6=0x190;}_0x1cfa1b[_0x91b6('0x1a')](_0x28aed6)['send'](_0x3d14c9['query'][_0x91b6('0xbf')]?{'message':_0x91b6('0xc1'),'statusCode':_0x5eea6e[_0x91b6('0xc0')]}:_0x5eea6e);});};function getSelectList(_0x1c92d1,_0x16dbfd,_0x214d87,_0x47d260,_0x27b991,_0x958c44){var _0x381f16={'method':'GET','uri':_0x1c92d1+_0x91b6('0xa9')+_0x47d260+_0x91b6('0xc2')+_0x27b991+_0x91b6('0xc3')+'$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','headers':{'Authorization':_0x91b6('0xa7')+_0x958c44,'If-None-Match':null,'OData-Version':_0x91b6('0xab')},'json':!![]};return rp(_0x381f16)[_0x91b6('0x26')](function(_0x287f39){var _0x373fee=[];var _0x22242f=_0x287f39[_0x91b6('0xc4')][_0x91b6('0xc5')];_0x22242f[_0x91b6('0xaf')](function(_0x4e3695){_0x373fee[_0x91b6('0xb2')]({'name':_0x4e3695['Label'][_0x91b6('0xc6')][_0x91b6('0xc7')],'value':String(_0x4e3695[_0x91b6('0xc8')])});});var _0x467499={'id':_0x16dbfd+'_'+_0x287f39[_0x91b6('0xae')],'name':_0x287f39[_0x91b6('0xc9')][_0x91b6('0xc6')][_0x91b6('0xc7')],'custom':![],'options':_0x373fee};_0x214d87[_0x91b6('0xb2')](_0x467499);return _0x214d87;});}function getBooleanList(_0x1c6e3e,_0x262372,_0x2059c8,_0x33d498,_0x13c33c,_0x39a5fd){var _0x410b84={'method':_0x91b6('0xa6'),'uri':_0x1c6e3e+_0x91b6('0xa9')+_0x33d498+_0x91b6('0xc2')+_0x13c33c+_0x91b6('0xca'),'headers':{'Authorization':_0x91b6('0xa7')+_0x39a5fd,'If-None-Match':null,'OData-Version':_0x91b6('0xab')},'json':!![]};return rp(_0x410b84)['then'](function(_0x513411){var _0x860849=[];_0x860849[_0x91b6('0xb2')]({'name':_0x513411[_0x91b6('0xc4')][_0x91b6('0xcb')][_0x91b6('0xc7')][_0x91b6('0xc6')][_0x91b6('0xc7')],'value':_0x91b6('0xcc')},{'name':_0x513411['OptionSet'][_0x91b6('0xcd')]['Label']['UserLocalizedLabel'][_0x91b6('0xc7')],'value':'false'});var _0x57f41f={'id':_0x262372+'_'+_0x513411[_0x91b6('0xae')],'name':_0x513411[_0x91b6('0xc9')]['UserLocalizedLabel'][_0x91b6('0xc7')],'custom':![],'options':_0x860849};_0x2059c8[_0x91b6('0xb2')](_0x57f41f);return _0x2059c8;});}function getInputList(_0x258e9e,_0x426066,_0x2ee666,_0x3494d8,_0x180831,_0x28da87,_0xb94ceb){var _0x26eb51={'method':'GET','uri':_0x258e9e+_0x91b6('0xa9')+_0x180831+_0x91b6('0xc2')+_0x28da87+_0x91b6('0xce')+_0x2ee666+_0x91b6('0xcf'),'headers':{'Authorization':_0x91b6('0xa7')+_0xb94ceb,'If-None-Match':null,'OData-Version':_0x91b6('0xab')},'json':!![]};return rp(_0x26eb51)['then'](function(_0x37066d){var _0x41c2ab={'id':_0x426066+'_'+_0x37066d[_0x91b6('0xae')],'name':_0x37066d[_0x91b6('0xc9')][_0x91b6('0xc6')]?_0x37066d[_0x91b6('0xc9')][_0x91b6('0xc6')]['Label']:_0x37066d[_0x91b6('0xae')],'custom':![],'options':[]};_0x3494d8[_0x91b6('0xb2')](_0x41c2ab);return _0x3494d8;});} \ No newline at end of file +var _0xe4b8=['squel','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','apply','save','update','destroy','end','stack','name','index','map','Dynamics365Account','rawAttributes','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','filter','options','then','includeAll','findAll','catch','show','params','filters','include','find','create','body','getConfigurations','findOne','Dynamics365Configuration','addConfiguration','Subjects','channel','Dynamics365Field','Descriptions','getFields','ticketType','incident','description','customerid','phonenumber','actualserviceunits','billedserviceunits','contactidyominame','contractdetailidname','contractidname','createdbyexternalpartyname','createdbyexternalpartyyominame','createdbyname','createdon','createdonbehalfbyyominame','customeridname','customeridtype','customeridyominame','entitlementidname','escalatedon','exchangerate','firstresponsebykpiidname','followupby','importsequencenumber','influencescore','kbarticleidname','lastonholdtime','masteridname','modifiedbyexternalpartyyominame','modifiedbyname','modifiedon','modifiedonbehalfbyname','msdyn_iotalertname','numberofchildincidents','onholdtime','overriddencreatedon','owneridname','owneridtype','owneridyominame','primarycontactidname','primarycontactidyominame','prioritycodename','productidname','productserialnumber','resolvebykpiidname','responseby','responsiblecontactidyominame','sentimentvalue','slainvokedidname','socialprofileidname','statecode','statuscode','subjectidname','ticketnumber','timezoneruleversionnumber','utcconversiontimezonecode','versionnumber','concat','username','password','remoteUri','clientId','clientSecret','format','%s/api/data/v9.0/','POST','https://login.microsoftonline.com/','tenantId','/oauth2/token','access_token','GET','EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27','4.0','MetadataId',')?$select=LogicalName&$expand=Attributes($select=LogicalName)','Bearer\x20','Attributes','remove','LogicalName','forEach','@odata.type','substring','lastIndexOf','PicklistAttributeMetadata','push','all','DoubleAttributeMetadata','BigIntAttributeMetadata','IntegerAttributeMetadata','MemoAttributeMetadata','DateTimeAttributeMetadata','StatusAttributeMetadata','StateAttributeMetadata','DecimalAttributeMetadata','test','statusCode','error','send','Wrong\x20credentials','EntityDefinitions(',')/Attributes(',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','Options','Label','UserLocalizedLabel','DisplayName','TrueOption','true','OptionSet','FalseOption','false',')/Microsoft.Dynamics.CRM.','?$select=DisplayName,LogicalName','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','fs-extra'];(function(_0x244a43,_0x4f7222){var _0x4d1769=function(_0x5e3f7f){while(--_0x5e3f7f){_0x244a43['push'](_0x244a43['shift']());}};_0x4d1769(++_0x4f7222);}(_0xe4b8,0x179));var _0x8e4b=function(_0x243b59,_0x3f9495){_0x243b59=_0x243b59-0x0;var _0x3e1676=_0xe4b8[_0x243b59];return _0x3e1676;};'use strict';var emlformat=require(_0x8e4b('0x0'));var rimraf=require(_0x8e4b('0x1'));var zipdir=require(_0x8e4b('0x2'));var jsonpatch=require(_0x8e4b('0x3'));var rp=require(_0x8e4b('0x4'));var moment=require(_0x8e4b('0x5'));var BPromise=require(_0x8e4b('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0x8e4b('0x7'));var sox=require(_0x8e4b('0x8'));var csv=require(_0x8e4b('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8e4b('0xa'));var _=require('lodash');var squel=require(_0x8e4b('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x8e4b('0xc'));var Redis=require('ioredis');var authService=require(_0x8e4b('0xd'));var qs=require(_0x8e4b('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8e4b('0xf'));var logger=require(_0x8e4b('0x10'))(_0x8e4b('0x11'));var utils=require('../../config/utils');var config=require(_0x8e4b('0x12'));var licenseUtil=require(_0x8e4b('0x13'));var db=require(_0x8e4b('0x14'))['db'];var integrations=require(_0x8e4b('0x15'));function respondWithStatusCode(_0x30b1c8,_0x30d9d1){_0x30d9d1=_0x30d9d1||0xcc;return function(_0x55be2c){if(_0x55be2c){return _0x30b1c8[_0x8e4b('0x16')](_0x30d9d1);}return _0x30b1c8['status'](_0x30d9d1)['end']();};}function respondWithResult(_0x2e8e71,_0x261e76){_0x261e76=_0x261e76||0xc8;return function(_0x19e83d){if(_0x19e83d){return _0x2e8e71[_0x8e4b('0x17')](_0x261e76)[_0x8e4b('0x18')](_0x19e83d);}};}function respondWithFilteredResult(_0x4d10fd,_0x4b0197){return function(_0xfff6b){if(_0xfff6b){var _0x526cdb=typeof _0x4b0197['offset']===_0x8e4b('0x19')&&typeof _0x4b0197['limit']===_0x8e4b('0x19');var _0x512c2a=_0xfff6b[_0x8e4b('0x1a')];var _0x139118=_0x526cdb?0x0:_0x4b0197['offset'];var _0x5639f4=_0x526cdb?_0xfff6b[_0x8e4b('0x1a')]:_0x4b0197[_0x8e4b('0x1b')]+_0x4b0197[_0x8e4b('0x1c')];var _0x349a24;if(_0x5639f4>=_0x512c2a){_0x5639f4=_0x512c2a;_0x349a24=0xc8;}else{_0x349a24=0xce;}_0x4d10fd[_0x8e4b('0x17')](_0x349a24);return _0x4d10fd[_0x8e4b('0x1d')](_0x8e4b('0x1e'),_0x139118+'-'+_0x5639f4+'/'+_0x512c2a)[_0x8e4b('0x18')](_0xfff6b);}return null;};}function patchUpdates(_0x9eeb68){return function(_0x26b6b6){try{jsonpatch[_0x8e4b('0x1f')](_0x26b6b6,_0x9eeb68,!![]);}catch(_0xaae343){return BPromise['reject'](_0xaae343);}return _0x26b6b6[_0x8e4b('0x20')]();};}function saveUpdates(_0x16ff18,_0x5f3043){return function(_0x1f49c8){if(_0x1f49c8){return _0x1f49c8[_0x8e4b('0x21')](_0x16ff18)['then'](function(_0x2bd4e7){return _0x2bd4e7;});}return null;};}function removeEntity(_0x719300,_0x5e8915){return function(_0x10828b){if(_0x10828b){return _0x10828b[_0x8e4b('0x22')]()['then'](function(){_0x719300[_0x8e4b('0x17')](0xcc)[_0x8e4b('0x23')]();});}};}function handleEntityNotFound(_0xbd7008,_0x376202){return function(_0x25a240){if(!_0x25a240){_0xbd7008[_0x8e4b('0x16')](0x194);}return _0x25a240;};}function handleError(_0x535f71,_0x395927){_0x395927=_0x395927||0x1f4;return function(_0x51e17a){logger['error'](_0x51e17a[_0x8e4b('0x24')]);if(_0x51e17a[_0x8e4b('0x25')]){delete _0x51e17a['name'];}_0x535f71[_0x8e4b('0x17')](_0x395927)['send'](_0x51e17a);};}exports[_0x8e4b('0x26')]=function(_0x5c5c34,_0x2fd8da){var _0xe991c2={},_0x1b2759={},_0x36d657={'count':0x0,'rows':[]};var _0x32ceb7=_[_0x8e4b('0x27')](db[_0x8e4b('0x28')][_0x8e4b('0x29')],function(_0x4f823c){return{'name':_0x4f823c['fieldName'],'type':_0x4f823c[_0x8e4b('0x2a')][_0x8e4b('0x2b')]};});_0x1b2759[_0x8e4b('0x2c')]=_[_0x8e4b('0x27')](_0x32ceb7,_0x8e4b('0x25'));_0x1b2759[_0x8e4b('0x2d')]=_[_0x8e4b('0x2e')](_0x5c5c34[_0x8e4b('0x2d')]);_0x1b2759['filters']=_[_0x8e4b('0x2f')](_0x1b2759[_0x8e4b('0x2c')],_0x1b2759[_0x8e4b('0x2d')]);_0xe991c2[_0x8e4b('0x30')]=_[_0x8e4b('0x2f')](_0x1b2759['model'],qs[_0x8e4b('0x31')](_0x5c5c34[_0x8e4b('0x2d')][_0x8e4b('0x31')]));_0xe991c2[_0x8e4b('0x30')]=_0xe991c2[_0x8e4b('0x30')][_0x8e4b('0x32')]?_0xe991c2[_0x8e4b('0x30')]:_0x1b2759[_0x8e4b('0x2c')];if(!_0x5c5c34['query'][_0x8e4b('0x33')](_0x8e4b('0x34'))){_0xe991c2[_0x8e4b('0x1c')]=qs[_0x8e4b('0x1c')](_0x5c5c34[_0x8e4b('0x2d')][_0x8e4b('0x1c')]);_0xe991c2[_0x8e4b('0x1b')]=qs[_0x8e4b('0x1b')](_0x5c5c34[_0x8e4b('0x2d')][_0x8e4b('0x1b')]);}_0xe991c2[_0x8e4b('0x35')]=qs[_0x8e4b('0x36')](_0x5c5c34[_0x8e4b('0x2d')]['sort']);_0xe991c2[_0x8e4b('0x37')]=qs['filters'](_[_0x8e4b('0x38')](_0x5c5c34[_0x8e4b('0x2d')],_0x1b2759['filters']),_0x32ceb7);if(_0x5c5c34[_0x8e4b('0x2d')]['filter']){_0xe991c2[_0x8e4b('0x37')]=_[_0x8e4b('0x39')](_0xe991c2[_0x8e4b('0x37')],{'$or':_[_0x8e4b('0x27')](_0x32ceb7,function(_0x3bde13){if(_0x3bde13['type']!=='VIRTUAL'){var _0x1acb2b={};_0x1acb2b[_0x3bde13[_0x8e4b('0x25')]]={'$like':'%'+_0x5c5c34[_0x8e4b('0x2d')][_0x8e4b('0x3a')]+'%'};return _0x1acb2b;}})});}_0xe991c2=_[_0x8e4b('0x39')]({},_0xe991c2,_0x5c5c34[_0x8e4b('0x3b')]);var _0x3b3d52={'where':_0xe991c2['where']};return db[_0x8e4b('0x28')]['count'](_0x3b3d52)[_0x8e4b('0x3c')](function(_0x595bfc){_0x36d657[_0x8e4b('0x1a')]=_0x595bfc;if(_0x5c5c34['query'][_0x8e4b('0x3d')]){_0xe991c2['include']=[{'all':!![]}];}return db[_0x8e4b('0x28')][_0x8e4b('0x3e')](_0xe991c2);})[_0x8e4b('0x3c')](function(_0xeaf785){_0x36d657['rows']=_0xeaf785;return _0x36d657;})[_0x8e4b('0x3c')](respondWithFilteredResult(_0x2fd8da,_0xe991c2))[_0x8e4b('0x3f')](handleError(_0x2fd8da,null));};exports[_0x8e4b('0x40')]=function(_0x38574d,_0x27fafa){var _0x2a850f={'raw':![],'where':{'id':_0x38574d[_0x8e4b('0x41')]['id']}},_0x1b8493={};_0x1b8493[_0x8e4b('0x2c')]=_[_0x8e4b('0x2e')](db[_0x8e4b('0x28')]['rawAttributes']);_0x1b8493[_0x8e4b('0x2d')]=_[_0x8e4b('0x2e')](_0x38574d[_0x8e4b('0x2d')]);_0x1b8493[_0x8e4b('0x42')]=_[_0x8e4b('0x2f')](_0x1b8493[_0x8e4b('0x2c')],_0x1b8493[_0x8e4b('0x2d')]);_0x2a850f['attributes']=_[_0x8e4b('0x2f')](_0x1b8493[_0x8e4b('0x2c')],qs[_0x8e4b('0x31')](_0x38574d[_0x8e4b('0x2d')][_0x8e4b('0x31')]));_0x2a850f[_0x8e4b('0x30')]=_0x2a850f[_0x8e4b('0x30')][_0x8e4b('0x32')]?_0x2a850f[_0x8e4b('0x30')]:_0x1b8493[_0x8e4b('0x2c')];if(_0x38574d[_0x8e4b('0x2d')][_0x8e4b('0x3d')]){_0x2a850f[_0x8e4b('0x43')]=[{'all':!![]}];}_0x2a850f=_[_0x8e4b('0x39')]({},_0x2a850f,_0x38574d[_0x8e4b('0x3b')]);return db[_0x8e4b('0x28')][_0x8e4b('0x44')](_0x2a850f)[_0x8e4b('0x3c')](handleEntityNotFound(_0x27fafa,null))[_0x8e4b('0x3c')](respondWithResult(_0x27fafa,null))[_0x8e4b('0x3f')](handleError(_0x27fafa,null));};exports[_0x8e4b('0x45')]=function(_0x460653,_0x587a4d){return db[_0x8e4b('0x28')][_0x8e4b('0x45')](_0x460653[_0x8e4b('0x46')],{})[_0x8e4b('0x3c')](respondWithResult(_0x587a4d,0xc9))[_0x8e4b('0x3f')](handleError(_0x587a4d,null));};exports[_0x8e4b('0x21')]=function(_0x3b7447,_0x36a554){if(_0x3b7447[_0x8e4b('0x46')]['id']){delete _0x3b7447[_0x8e4b('0x46')]['id'];}return db[_0x8e4b('0x28')][_0x8e4b('0x44')]({'where':{'id':_0x3b7447['params']['id']}})[_0x8e4b('0x3c')](handleEntityNotFound(_0x36a554,null))[_0x8e4b('0x3c')](saveUpdates(_0x3b7447[_0x8e4b('0x46')],null))[_0x8e4b('0x3c')](respondWithResult(_0x36a554,null))['catch'](handleError(_0x36a554,null));};exports[_0x8e4b('0x22')]=function(_0x89059a,_0x2de321){return db['Dynamics365Account'][_0x8e4b('0x44')]({'where':{'id':_0x89059a[_0x8e4b('0x41')]['id']}})[_0x8e4b('0x3c')](handleEntityNotFound(_0x2de321,null))[_0x8e4b('0x3c')](removeEntity(_0x2de321,null))[_0x8e4b('0x3f')](handleError(_0x2de321,null));};exports[_0x8e4b('0x47')]=function(_0x20aa6a,_0x5eea7c,_0x2e35a8){var _0x17da38={};var _0x3e694c={};var _0x22a3f8;var _0x212a45;return db[_0x8e4b('0x28')][_0x8e4b('0x48')]({'where':{'id':_0x20aa6a['params']['id']}})[_0x8e4b('0x3c')](handleEntityNotFound(_0x5eea7c,null))[_0x8e4b('0x3c')](function(_0x18c7ab){if(_0x18c7ab){_0x22a3f8=_0x18c7ab;_0x3e694c[_0x8e4b('0x2c')]=_[_0x8e4b('0x2e')](db[_0x8e4b('0x49')]['rawAttributes']);_0x3e694c['query']=_['keys'](_0x20aa6a['query']);_0x3e694c[_0x8e4b('0x42')]=_[_0x8e4b('0x2f')](_0x3e694c[_0x8e4b('0x2c')],_0x3e694c[_0x8e4b('0x2d')]);_0x17da38['attributes']=_['intersection'](_0x3e694c[_0x8e4b('0x2c')],qs[_0x8e4b('0x31')](_0x20aa6a[_0x8e4b('0x2d')][_0x8e4b('0x31')]));_0x17da38[_0x8e4b('0x30')]=_0x17da38['attributes'][_0x8e4b('0x32')]?_0x17da38['attributes']:_0x3e694c['model'];_0x17da38['order']=qs['sort'](_0x20aa6a[_0x8e4b('0x2d')][_0x8e4b('0x36')]);_0x17da38[_0x8e4b('0x37')]=qs[_0x8e4b('0x42')](_[_0x8e4b('0x38')](_0x20aa6a['query'],_0x3e694c[_0x8e4b('0x42')]));if(_0x20aa6a['query'][_0x8e4b('0x3a')]){_0x17da38[_0x8e4b('0x37')]=_[_0x8e4b('0x39')](_0x17da38[_0x8e4b('0x37')],{'$or':_['map'](_0x17da38['attributes'],function(_0x3ded9a){var _0x54fe1f={};_0x54fe1f[_0x3ded9a]={'$like':'%'+_0x20aa6a[_0x8e4b('0x2d')][_0x8e4b('0x3a')]+'%'};return _0x54fe1f;})});}_0x17da38=_['merge']({},_0x17da38,_0x20aa6a[_0x8e4b('0x3b')]);return _0x22a3f8[_0x8e4b('0x47')](_0x17da38);}})[_0x8e4b('0x3c')](function(_0x60e626){if(_0x60e626){_0x212a45=_0x60e626[_0x8e4b('0x32')];if(!_0x20aa6a[_0x8e4b('0x2d')][_0x8e4b('0x33')](_0x8e4b('0x34'))){_0x17da38[_0x8e4b('0x1c')]=qs[_0x8e4b('0x1c')](_0x20aa6a[_0x8e4b('0x2d')][_0x8e4b('0x1c')]);_0x17da38['offset']=qs[_0x8e4b('0x1b')](_0x20aa6a['query']['offset']);}return _0x22a3f8[_0x8e4b('0x47')](_0x17da38);}})['then'](function(_0x55d367){if(_0x55d367){return _0x55d367?{'count':_0x212a45,'rows':_0x55d367}:null;}})[_0x8e4b('0x3c')](respondWithResult(_0x5eea7c,null))['catch'](handleError(_0x5eea7c,null));};exports[_0x8e4b('0x4a')]=function(_0x3cb072,_0x16e0f9,_0x30bee6){if(_0x3cb072[_0x8e4b('0x46')]['id']){delete _0x3cb072['body']['id'];}return db['Dynamics365Account'][_0x8e4b('0x48')]({'where':{'id':_0x3cb072[_0x8e4b('0x41')]['id']}})['then'](handleEntityNotFound(_0x16e0f9,null))[_0x8e4b('0x3c')](function(_0xc853f0){if(_0xc853f0){_0x3cb072[_0x8e4b('0x46')]['AccountId']=_0xc853f0['id'];_0x3cb072[_0x8e4b('0x46')][_0x8e4b('0x4b')]=integrations['getSubjects'](_0x3cb072[_0x8e4b('0x46')][_0x8e4b('0x4c')],_0x3cb072[_0x8e4b('0x46')][_0x8e4b('0x2a')]);_0x3cb072[_0x8e4b('0x46')]['Descriptions']=integrations['getDescriptions'](_0x3cb072[_0x8e4b('0x46')]['channel'],_0x3cb072[_0x8e4b('0x46')]['type']);return db[_0x8e4b('0x49')]['create'](_0x3cb072[_0x8e4b('0x46')],{'include':[{'model':db[_0x8e4b('0x4d')],'as':_0x8e4b('0x4b')},{'model':db['Dynamics365Field'],'as':_0x8e4b('0x4e')}]});}return null;})[_0x8e4b('0x3c')](respondWithResult(_0x16e0f9,null))[_0x8e4b('0x3f')](handleError(_0x16e0f9,null));};exports[_0x8e4b('0x4f')]=function(_0xc4c880,_0x2d8c08,_0x34977a){var _0x15a274=_0xc4c880[_0x8e4b('0x2d')][_0x8e4b('0x50')];var _0xa3ed6e=_0x15a274===_0x8e4b('0x51')?'Incident':'PhoneCall';var _0x51dc8c='';var _0x1e908a='';var _0x5b6c55='';var _0x32c515='';var _0x2f421d='';var _0x216aa3='';var _0x135f55='';var _0x3c7cee='';var _0x8eb135=['title',_0x8e4b('0x52'),_0x8e4b('0x53'),'ownerid','caseorigincode','subject',_0x8e4b('0x54'),'regardingobjectid','directioncode','phonecall_activity_parties'];var _0x1717dd=['accountidname','accountidyominame',_0x8e4b('0x55'),_0x8e4b('0x56'),'contactidname',_0x8e4b('0x57'),_0x8e4b('0x58'),_0x8e4b('0x59'),_0x8e4b('0x5a'),_0x8e4b('0x5b'),_0x8e4b('0x5c'),'createdbyyominame',_0x8e4b('0x5d'),'createdonbehalfbyname',_0x8e4b('0x5e'),_0x8e4b('0x5f'),_0x8e4b('0x60'),_0x8e4b('0x61'),'emailaddress',_0x8e4b('0x62'),'entityimage_timestamp','entityimage_url',_0x8e4b('0x63'),_0x8e4b('0x64'),_0x8e4b('0x65'),_0x8e4b('0x66'),_0x8e4b('0x67'),_0x8e4b('0x68'),_0x8e4b('0x69'),_0x8e4b('0x6a'),_0x8e4b('0x6b'),'modifiedbyexternalpartyname',_0x8e4b('0x6c'),_0x8e4b('0x6d'),'modifiedbyyominame',_0x8e4b('0x6e'),_0x8e4b('0x6f'),'modifiedonbehalfbyyominame','msdyn_incidenttypename',_0x8e4b('0x70'),_0x8e4b('0x71'),_0x8e4b('0x72'),_0x8e4b('0x73'),_0x8e4b('0x74'),_0x8e4b('0x75'),_0x8e4b('0x76'),'parentcaseidname',_0x8e4b('0x77'),_0x8e4b('0x78'),_0x8e4b('0x79'),_0x8e4b('0x7a'),_0x8e4b('0x7b'),'resolveby',_0x8e4b('0x7c'),_0x8e4b('0x7d'),'responsiblecontactidname',_0x8e4b('0x7e'),_0x8e4b('0x7f'),_0x8e4b('0x80'),'slaname',_0x8e4b('0x81'),_0x8e4b('0x82'),_0x8e4b('0x83'),_0x8e4b('0x84'),_0x8e4b('0x85'),_0x8e4b('0x86'),'transactioncurrencyidname','traversedpath',_0x8e4b('0x87'),_0x8e4b('0x88')];var _0x46234e=_0x8eb135[_0x8e4b('0x89')](_0x1717dd);return db['Dynamics365Account'][_0x8e4b('0x48')]({'where':{'id':_0xc4c880['params']['id']},'attributes':['id',_0x8e4b('0x8a'),_0x8e4b('0x8b'),_0x8e4b('0x8c'),'tenantId',_0x8e4b('0x8d'),_0x8e4b('0x8e')]})[_0x8e4b('0x3c')](handleEntityNotFound(_0x2d8c08,null))[_0x8e4b('0x3c')](function(_0x12fbce){if(_0x12fbce){_0x3c7cee=_0x12fbce['remoteUri'];var _0x5f1767=_0x3c7cee['slice'](-0x1);if(_0x5f1767==='/'){_0x3c7cee=_0x3c7cee['substring'](0x0,_0x3c7cee['lastIndexOf'](_0x5f1767));}_0x135f55=util[_0x8e4b('0x8f')](_0x8e4b('0x90'),_0x3c7cee);var _0xb8379f={'method':_0x8e4b('0x91'),'uri':_0x8e4b('0x92')+_0x12fbce[_0x8e4b('0x93')]+_0x8e4b('0x94'),'form':{'client_id':_0x12fbce['clientId'],'resource':_0x3c7cee,'username':_0x12fbce[_0x8e4b('0x8a')],'password':_0x12fbce[_0x8e4b('0x8b')],'grant_type':_0x8e4b('0x8b'),'client_secret':_0x12fbce[_0x8e4b('0x8e')]},'json':!![]};return rp(_0xb8379f);}})[_0x8e4b('0x3c')](function(_0x22aa1b){_0x216aa3=_0x22aa1b[_0x8e4b('0x95')];var _0x22a9ff={'method':_0x8e4b('0x96'),'uri':encodeURI(_0x135f55+_0x8e4b('0x97')+_0xa3ed6e+'\x27'),'headers':{'Authorization':'Bearer\x20'+_0x216aa3,'If-None-Match':null,'OData-Version':_0x8e4b('0x98')},'json':!![]};return rp(_0x22a9ff);})[_0x8e4b('0x3c')](function(_0x483841){var _0x47c53c=_0x483841['value'][0x0];var _0x2fac98=_0x47c53c[_0x8e4b('0x99')];var _0x26e445={'method':_0x8e4b('0x96'),'uri':_0x135f55+'EntityDefinitions('+_0x2fac98+_0x8e4b('0x9a'),'headers':{'Authorization':_0x8e4b('0x9b')+_0x216aa3,'If-None-Match':null,'OData-Version':_0x8e4b('0x98')},'json':!![]};return rp(_0x26e445);})[_0x8e4b('0x3c')](function(_0x18151b){_0x51dc8c=_0x18151b;_0x1e908a=_0x51dc8c[_0x8e4b('0x9c')];_0x1e908a=_[_0x8e4b('0x9d')](_0x1e908a,function(_0x409669){return!_0x46234e['includes'](_0x409669[_0x8e4b('0x9e')]);});var _0x5e271a=[];var _0x4cfdac=[];_0x1e908a[_0x8e4b('0x9f')](function(_0x31a75b){if(_0x31a75b['@odata.type']){var _0x90f1d5=_0x31a75b[_0x8e4b('0xa0')][_0x8e4b('0xa1')](_0x31a75b[_0x8e4b('0xa0')][_0x8e4b('0xa2')]('.')+0x1);if(_0x90f1d5===_0x8e4b('0xa3')){_0x5e271a[_0x8e4b('0xa4')](getSelectList(_0x135f55,_0x15a274,_0x4cfdac,_0x51dc8c[_0x8e4b('0x99')],_0x31a75b[_0x8e4b('0x99')],_0x216aa3));}}});return Promise[_0x8e4b('0xa5')](_0x5e271a);})[_0x8e4b('0x3c')](function(_0x5ab9db){_0x5b6c55=_0x5ab9db[0x0];var _0x2bc6ef=[];var _0x4f1217=[];_0x1e908a['forEach'](function(_0x480075){if(!_['isNil'](_0x480075[_0x8e4b('0xa0')])){var _0x3816e5=_0x480075[_0x8e4b('0xa0')][_0x8e4b('0xa1')](_0x480075[_0x8e4b('0xa0')][_0x8e4b('0xa2')]('.')+0x1);if(_0x3816e5==='BooleanAttributeMetadata'){_0x2bc6ef[_0x8e4b('0xa4')](getBooleanList(_0x135f55,_0x15a274,_0x4f1217,_0x51dc8c['MetadataId'],_0x480075['MetadataId'],_0x216aa3));}}});return Promise[_0x8e4b('0xa5')](_0x2bc6ef);})[_0x8e4b('0x3c')](function(_0x18cc29){_0x32c515=_0x18cc29[0x0];var _0x1f199e=[];var _0x4cd79c=[];_0x1e908a[_0x8e4b('0x9f')](function(_0xebf807){if(_0xebf807[_0x8e4b('0xa0')]){var _0x22dc66=_0xebf807['@odata.type'][_0x8e4b('0xa1')](_0xebf807[_0x8e4b('0xa0')][_0x8e4b('0xa2')]('.')+0x1);if(_0x22dc66==='StringAttributeMetadata'||_0x22dc66===_0x8e4b('0xa6')||_0x22dc66===_0x8e4b('0xa7')||_0x22dc66===_0x8e4b('0xa8')||_0x22dc66===_0x8e4b('0xa9')||_0x22dc66===_0x8e4b('0xaa')||_0x22dc66===_0x8e4b('0xab')||_0x22dc66==='EntityNameAttributeMetadata'||_0x22dc66===_0x8e4b('0xac')||_0x22dc66===_0x8e4b('0xad')){_0x1f199e[_0x8e4b('0xa4')](getInputList(_0x135f55,_0x15a274,_0x22dc66,_0x4cd79c,_0x51dc8c[_0x8e4b('0x99')],_0xebf807[_0x8e4b('0x99')],_0x216aa3));}}});return Promise[_0x8e4b('0xa5')](_0x1f199e);})[_0x8e4b('0x3c')](function(_0x590df9){_0x2f421d=_0x590df9[0x0];var _0x1d4784=_0x5b6c55[_0x8e4b('0x89')](_0x32c515)[_0x8e4b('0x89')](_0x2f421d);var _0x1132cb={'count':_0x1d4784[_0x8e4b('0x32')],'rows':_0x1d4784};return _0x1132cb;})[_0x8e4b('0x3c')](respondWithResult(_0x2d8c08,null))[_0x8e4b('0x3f')](function(_0x2042c7){var _0x501e04=_0xc4c880[_0x8e4b('0x2d')][_0x8e4b('0xae')]?0x1f4:_0x2042c7[_0x8e4b('0xaf')]||0x1f4;logger[_0x8e4b('0xb0')](_0x2042c7[_0x8e4b('0x24')]);delete _0x2042c7[_0x8e4b('0x25')];if(_0x501e04===0x191){_0x501e04=0x190;}_0x2d8c08[_0x8e4b('0x17')](_0x501e04)[_0x8e4b('0xb1')](_0xc4c880[_0x8e4b('0x2d')][_0x8e4b('0xae')]?{'message':_0x8e4b('0xb2'),'statusCode':_0x2042c7[_0x8e4b('0xaf')]}:_0x2042c7);});};function getSelectList(_0x3651ce,_0x499990,_0xc51f7d,_0x2a4e67,_0x3dc3fe,_0x574812){var _0x4b5b24={'method':_0x8e4b('0x96'),'uri':_0x3651ce+_0x8e4b('0xb3')+_0x2a4e67+_0x8e4b('0xb4')+_0x3dc3fe+_0x8e4b('0xb5')+_0x8e4b('0xb6'),'headers':{'Authorization':_0x8e4b('0x9b')+_0x574812,'If-None-Match':null,'OData-Version':_0x8e4b('0x98')},'json':!![]};return rp(_0x4b5b24)[_0x8e4b('0x3c')](function(_0x3fe26c){var _0x55b546=[];var _0x2885c1=_0x3fe26c['OptionSet'][_0x8e4b('0xb7')];_0x2885c1['forEach'](function(_0x456247){_0x55b546[_0x8e4b('0xa4')]({'name':_0x456247[_0x8e4b('0xb8')][_0x8e4b('0xb9')][_0x8e4b('0xb8')],'value':String(_0x456247['Value'])});});var _0x5780fe={'id':_0x499990+'_'+_0x3fe26c[_0x8e4b('0x9e')],'name':_0x3fe26c[_0x8e4b('0xba')][_0x8e4b('0xb9')][_0x8e4b('0xb8')],'custom':![],'options':_0x55b546};_0xc51f7d[_0x8e4b('0xa4')](_0x5780fe);return _0xc51f7d;});}function getBooleanList(_0x124201,_0x85aba4,_0x5440fb,_0x58a5f6,_0x151acc,_0x4b95c9){var _0x70d1cf={'method':'GET','uri':_0x124201+_0x8e4b('0xb3')+_0x58a5f6+_0x8e4b('0xb4')+_0x151acc+')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','headers':{'Authorization':_0x8e4b('0x9b')+_0x4b95c9,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x70d1cf)[_0x8e4b('0x3c')](function(_0x503fcb){var _0x3a649f=[];_0x3a649f[_0x8e4b('0xa4')]({'name':_0x503fcb['OptionSet'][_0x8e4b('0xbb')][_0x8e4b('0xb8')][_0x8e4b('0xb9')][_0x8e4b('0xb8')],'value':_0x8e4b('0xbc')},{'name':_0x503fcb[_0x8e4b('0xbd')][_0x8e4b('0xbe')][_0x8e4b('0xb8')][_0x8e4b('0xb9')]['Label'],'value':_0x8e4b('0xbf')});var _0x5f216e={'id':_0x85aba4+'_'+_0x503fcb['LogicalName'],'name':_0x503fcb[_0x8e4b('0xba')]['UserLocalizedLabel'][_0x8e4b('0xb8')],'custom':![],'options':_0x3a649f};_0x5440fb[_0x8e4b('0xa4')](_0x5f216e);return _0x5440fb;});}function getInputList(_0x47db5a,_0x2a9cfe,_0x1d10d9,_0x4c1b12,_0x3ee951,_0x14add5,_0x344868){var _0x471942={'method':'GET','uri':_0x47db5a+'EntityDefinitions('+_0x3ee951+_0x8e4b('0xb4')+_0x14add5+_0x8e4b('0xc0')+_0x1d10d9+_0x8e4b('0xc1'),'headers':{'Authorization':'Bearer\x20'+_0x344868,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x471942)[_0x8e4b('0x3c')](function(_0x383f1d){var _0x3793df={'id':_0x2a9cfe+'_'+_0x383f1d[_0x8e4b('0x9e')],'name':_0x383f1d[_0x8e4b('0xba')][_0x8e4b('0xb9')]?_0x383f1d[_0x8e4b('0xba')][_0x8e4b('0xb9')][_0x8e4b('0xb8')]:_0x383f1d['LogicalName'],'custom':![],'options':[]};_0x4c1b12[_0x8e4b('0xa4')](_0x3793df);return _0x4c1b12;});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.model.js b/server/api/intDynamics365Account/intDynamics365Account.model.js index 44c8294..05ee610 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 _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(_0x13d5b9,_0x418c84){var _0x3a8133=function(_0x482bd3){while(--_0x482bd3){_0x13d5b9['push'](_0x13d5b9['shift']());}};_0x3a8133(++_0x418c84);}(_0xe706,0xa3));var _0x6e70=function(_0x33ab79,_0x4f7c50){_0x33ab79=_0x33ab79-0x0;var _0x10ac00=_0xe706[_0x33ab79];return _0x10ac00;};'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 +var _0xb7e7=['int_dynamics365_accounts','lodash','../../config/logger','moment','request-promise','rimraf','../../config/environment','./intDynamics365Account.attributes','define'];(function(_0x12e1a6,_0x83993f){var _0x5b0ac5=function(_0x571b89){while(--_0x571b89){_0x12e1a6['push'](_0x12e1a6['shift']());}};_0x5b0ac5(++_0x83993f);}(_0xb7e7,0x121));var _0x7b7e=function(_0x2a6809,_0x44edde){_0x2a6809=_0x2a6809-0x0;var _0x11c371=_0xb7e7[_0x2a6809];return _0x11c371;};'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 diff --git a/server/api/intDynamics365Account/intDynamics365Account.rpc.js b/server/api/intDynamics365Account/intDynamics365Account.rpc.js index e5ff38c..7239cf0 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 _0xe552=['Dynamics365Account','findAll','options','raw','where','attributes','limit','map','include','model','GetDynamics365Account','find','ShowDynamics365Account','debug','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','Dynamics365Account,\x20%s,\x20%s','Dynamics365Account,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch'];(function(_0x14c960,_0x547c8a){var _0x2b9fc2=function(_0x43d33c){while(--_0x43d33c){_0x14c960['push'](_0x14c960['shift']());}};_0x2b9fc2(++_0x547c8a);}(_0xe552,0x12e));var _0x2e55=function(_0x1d669e,_0x4921c9){_0x1d669e=_0x1d669e-0x0;var _0x1d1ec7=_0xe552[_0x1d669e];return _0x1d1ec7;};'use strict';var _=require('lodash');var util=require(_0x2e55('0x0'));var moment=require(_0x2e55('0x1'));var BPromise=require(_0x2e55('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2e55('0x3'));var db=require(_0x2e55('0x4'))['db'];var utils=require(_0x2e55('0x5'));var logger=require(_0x2e55('0x6'))(_0x2e55('0x7'));var config=require(_0x2e55('0x8'));var jayson=require(_0x2e55('0x9'));var client=jayson[_0x2e55('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x281eff,_0x25a8f1,_0x2226b4){return new BPromise(function(_0x233d00,_0x4f7a17){return client[_0x2e55('0xb')](_0x281eff,_0x2226b4)[_0x2e55('0xc')](function(_0x324042){logger[_0x2e55('0xd')](_0x2e55('0xe'),_0x25a8f1,'request\x20sent');logger['debug'](_0x2e55('0xf'),_0x25a8f1,_0x2e55('0x10'),JSON[_0x2e55('0x11')](_0x324042));if(_0x324042[_0x2e55('0x12')]){if(_0x324042[_0x2e55('0x12')][_0x2e55('0x13')]===0x1f4){logger[_0x2e55('0x12')](_0x2e55('0xe'),_0x25a8f1,_0x324042[_0x2e55('0x12')][_0x2e55('0x14')]);return _0x4f7a17(_0x324042[_0x2e55('0x12')][_0x2e55('0x14')]);}logger[_0x2e55('0x12')]('Dynamics365Account,\x20%s,\x20%s',_0x25a8f1,_0x324042[_0x2e55('0x12')][_0x2e55('0x14')]);return _0x233d00(_0x324042[_0x2e55('0x12')][_0x2e55('0x14')]);}else{logger['info'](_0x2e55('0xe'),_0x25a8f1,'request\x20sent');_0x233d00(_0x324042['result'][_0x2e55('0x14')]);}})[_0x2e55('0x15')](function(_0x1d7470){logger[_0x2e55('0x12')]('Dynamics365Account,\x20%s,\x20%s',_0x25a8f1,_0x1d7470);_0x4f7a17(_0x1d7470);});});}exports['GetDynamics365Account']=function(_0x12fcf0){var _0x119b25=this;return new Promise(function(_0x1a731d,_0x3a5de4){return db[_0x2e55('0x16')][_0x2e55('0x17')]({'raw':_0x12fcf0[_0x2e55('0x18')]?_0x12fcf0[_0x2e55('0x18')][_0x2e55('0x19')]===undefined?!![]:![]:!![],'where':_0x12fcf0['options']?_0x12fcf0[_0x2e55('0x18')][_0x2e55('0x1a')]||null:null,'attributes':_0x12fcf0[_0x2e55('0x18')]?_0x12fcf0[_0x2e55('0x18')][_0x2e55('0x1b')]||null:null,'limit':_0x12fcf0[_0x2e55('0x18')]?_0x12fcf0['options'][_0x2e55('0x1c')]||null:null,'include':_0x12fcf0[_0x2e55('0x18')]?_0x12fcf0[_0x2e55('0x18')]['include']?_[_0x2e55('0x1d')](_0x12fcf0[_0x2e55('0x18')][_0x2e55('0x1e')],function(_0x520f4a){return{'model':db[_0x520f4a['model']],'as':_0x520f4a['as'],'attributes':_0x520f4a[_0x2e55('0x1b')],'include':_0x520f4a[_0x2e55('0x1e')]?_['map'](_0x520f4a['include'],function(_0x1ab052){return{'model':db[_0x1ab052[_0x2e55('0x1f')]],'as':_0x1ab052['as'],'attributes':_0x1ab052[_0x2e55('0x1b')],'include':_0x1ab052[_0x2e55('0x1e')]?_[_0x2e55('0x1d')](_0x1ab052[_0x2e55('0x1e')],function(_0x1397cd){return{'model':db[_0x1397cd['model']],'as':_0x1397cd['as'],'attributes':_0x1397cd[_0x2e55('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x2e55('0xc')](function(_0x420273){logger[_0x2e55('0xd')](_0x2e55('0x20'),_0x12fcf0);logger['debug'](_0x2e55('0x20'),_0x12fcf0,JSON[_0x2e55('0x11')](_0x420273));_0x1a731d(_0x420273);})[_0x2e55('0x15')](function(_0x32e195){logger[_0x2e55('0x12')](_0x2e55('0x20'),_0x32e195['message'],_0x12fcf0);_0x3a5de4(_0x119b25['error'](0x1f4,_0x32e195[_0x2e55('0x14')]));});});};exports['ShowDynamics365Account']=function(_0x572e3b){var _0x4f0b62=this;return new Promise(function(_0x157164,_0x236072){return db['Dynamics365Account'][_0x2e55('0x21')]({'raw':_0x572e3b[_0x2e55('0x18')]?_0x572e3b['options'][_0x2e55('0x19')]===undefined?!![]:![]:!![],'where':_0x572e3b[_0x2e55('0x18')]?_0x572e3b[_0x2e55('0x18')]['where']||null:null,'attributes':_0x572e3b[_0x2e55('0x18')]?_0x572e3b[_0x2e55('0x18')][_0x2e55('0x1b')]||null:null,'include':_0x572e3b[_0x2e55('0x18')]?_0x572e3b[_0x2e55('0x18')][_0x2e55('0x1e')]?_['map'](_0x572e3b[_0x2e55('0x18')][_0x2e55('0x1e')],function(_0x9feaef){return{'model':db[_0x9feaef[_0x2e55('0x1f')]],'as':_0x9feaef['as'],'attributes':_0x9feaef[_0x2e55('0x1b')],'include':_0x9feaef[_0x2e55('0x1e')]?_[_0x2e55('0x1d')](_0x9feaef['include'],function(_0x186676){return{'model':db[_0x186676[_0x2e55('0x1f')]],'as':_0x186676['as'],'attributes':_0x186676['attributes'],'include':_0x186676[_0x2e55('0x1e')]?_[_0x2e55('0x1d')](_0x186676[_0x2e55('0x1e')],function(_0x20fbb8){return{'model':db[_0x20fbb8['model']],'as':_0x20fbb8['as'],'attributes':_0x20fbb8[_0x2e55('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3d3eae){logger[_0x2e55('0xd')](_0x2e55('0x22'),_0x572e3b);logger[_0x2e55('0x23')](_0x2e55('0x22'),_0x572e3b,JSON['stringify'](_0x3d3eae));_0x157164(_0x3d3eae);})[_0x2e55('0x15')](function(_0x266c5d){logger[_0x2e55('0x12')]('ShowDynamics365Account',_0x266c5d[_0x2e55('0x14')],_0x572e3b);_0x236072(_0x4f0b62[_0x2e55('0x12')](0x1f4,_0x266c5d[_0x2e55('0x14')]));});});}; \ No newline at end of file +var _0x6e1a=['ShowDynamics365Account','Dynamics365Account','find','moment','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','request','info','Dynamics365Account,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Account,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','GetDynamics365Account','findAll','options','raw','where','attributes','limit','include','map','model','then'];(function(_0x5ec3e5,_0x44fcf2){var _0x4dcc38=function(_0x11769d){while(--_0x11769d){_0x5ec3e5['push'](_0x5ec3e5['shift']());}};_0x4dcc38(++_0x44fcf2);}(_0x6e1a,0x1e3));var _0xa6e1=function(_0x98f515,_0x319b08){_0x98f515=_0x98f515-0x0;var _0x5106c3=_0x6e1a[_0x98f515];return _0x5106c3;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xa6e1('0x0'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa6e1('0x1'));var db=require(_0xa6e1('0x2'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xa6e1('0x3'));var config=require(_0xa6e1('0x4'));var jayson=require(_0xa6e1('0x5'));var client=jayson[_0xa6e1('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4c9b47,_0x262d3b,_0x11de87){return new BPromise(function(_0x3ec1e6,_0x2058fb){return client[_0xa6e1('0x7')](_0x4c9b47,_0x11de87)['then'](function(_0x1a9ee8){logger[_0xa6e1('0x8')](_0xa6e1('0x9'),_0x262d3b,_0xa6e1('0xa'));logger[_0xa6e1('0xb')](_0xa6e1('0xc'),_0x262d3b,_0xa6e1('0xa'),JSON[_0xa6e1('0xd')](_0x1a9ee8));if(_0x1a9ee8[_0xa6e1('0xe')]){if(_0x1a9ee8[_0xa6e1('0xe')]['code']===0x1f4){logger['error'](_0xa6e1('0x9'),_0x262d3b,_0x1a9ee8['error'][_0xa6e1('0xf')]);return _0x2058fb(_0x1a9ee8['error'][_0xa6e1('0xf')]);}logger[_0xa6e1('0xe')](_0xa6e1('0x9'),_0x262d3b,_0x1a9ee8[_0xa6e1('0xe')][_0xa6e1('0xf')]);return _0x3ec1e6(_0x1a9ee8['error'][_0xa6e1('0xf')]);}else{logger[_0xa6e1('0x8')](_0xa6e1('0x9'),_0x262d3b,'request\x20sent');_0x3ec1e6(_0x1a9ee8[_0xa6e1('0x10')][_0xa6e1('0xf')]);}})[_0xa6e1('0x11')](function(_0x456d8a){logger[_0xa6e1('0xe')](_0xa6e1('0x9'),_0x262d3b,_0x456d8a);_0x2058fb(_0x456d8a);});});}exports[_0xa6e1('0x12')]=function(_0x2dd85a){var _0x377c78=this;return new Promise(function(_0x249c11,_0x4eb1cf){return db['Dynamics365Account'][_0xa6e1('0x13')]({'raw':_0x2dd85a[_0xa6e1('0x14')]?_0x2dd85a[_0xa6e1('0x14')][_0xa6e1('0x15')]===undefined?!![]:![]:!![],'where':_0x2dd85a[_0xa6e1('0x14')]?_0x2dd85a['options'][_0xa6e1('0x16')]||null:null,'attributes':_0x2dd85a['options']?_0x2dd85a['options'][_0xa6e1('0x17')]||null:null,'limit':_0x2dd85a[_0xa6e1('0x14')]?_0x2dd85a[_0xa6e1('0x14')][_0xa6e1('0x18')]||null:null,'include':_0x2dd85a[_0xa6e1('0x14')]?_0x2dd85a['options'][_0xa6e1('0x19')]?_['map'](_0x2dd85a['options']['include'],function(_0x3a1d27){return{'model':db[_0x3a1d27['model']],'as':_0x3a1d27['as'],'attributes':_0x3a1d27['attributes'],'include':_0x3a1d27[_0xa6e1('0x19')]?_[_0xa6e1('0x1a')](_0x3a1d27[_0xa6e1('0x19')],function(_0x32d840){return{'model':db[_0x32d840[_0xa6e1('0x1b')]],'as':_0x32d840['as'],'attributes':_0x32d840[_0xa6e1('0x17')],'include':_0x32d840[_0xa6e1('0x19')]?_['map'](_0x32d840[_0xa6e1('0x19')],function(_0xdb1e0f){return{'model':db[_0xdb1e0f[_0xa6e1('0x1b')]],'as':_0xdb1e0f['as'],'attributes':_0xdb1e0f[_0xa6e1('0x17')]};}):[]};}):[]};}):[]:[]})[_0xa6e1('0x1c')](function(_0x4b4854){logger[_0xa6e1('0x8')](_0xa6e1('0x12'),_0x2dd85a);logger[_0xa6e1('0xb')](_0xa6e1('0x12'),_0x2dd85a,JSON['stringify'](_0x4b4854));_0x249c11(_0x4b4854);})[_0xa6e1('0x11')](function(_0x2ab0ac){logger[_0xa6e1('0xe')](_0xa6e1('0x12'),_0x2ab0ac[_0xa6e1('0xf')],_0x2dd85a);_0x4eb1cf(_0x377c78['error'](0x1f4,_0x2ab0ac[_0xa6e1('0xf')]));});});};exports[_0xa6e1('0x1d')]=function(_0x2c696d){var _0x589ea6=this;return new Promise(function(_0x316f9e,_0x1d7d5c){return db[_0xa6e1('0x1e')][_0xa6e1('0x1f')]({'raw':_0x2c696d[_0xa6e1('0x14')]?_0x2c696d[_0xa6e1('0x14')]['raw']===undefined?!![]:![]:!![],'where':_0x2c696d[_0xa6e1('0x14')]?_0x2c696d['options']['where']||null:null,'attributes':_0x2c696d[_0xa6e1('0x14')]?_0x2c696d[_0xa6e1('0x14')][_0xa6e1('0x17')]||null:null,'include':_0x2c696d[_0xa6e1('0x14')]?_0x2c696d['options'][_0xa6e1('0x19')]?_[_0xa6e1('0x1a')](_0x2c696d[_0xa6e1('0x14')][_0xa6e1('0x19')],function(_0x9e784b){return{'model':db[_0x9e784b[_0xa6e1('0x1b')]],'as':_0x9e784b['as'],'attributes':_0x9e784b[_0xa6e1('0x17')],'include':_0x9e784b[_0xa6e1('0x19')]?_[_0xa6e1('0x1a')](_0x9e784b[_0xa6e1('0x19')],function(_0x473388){return{'model':db[_0x473388[_0xa6e1('0x1b')]],'as':_0x473388['as'],'attributes':_0x473388[_0xa6e1('0x17')],'include':_0x473388[_0xa6e1('0x19')]?_[_0xa6e1('0x1a')](_0x473388[_0xa6e1('0x19')],function(_0x231bf5){return{'model':db[_0x231bf5[_0xa6e1('0x1b')]],'as':_0x231bf5['as'],'attributes':_0x231bf5[_0xa6e1('0x17')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x24c371){logger[_0xa6e1('0x8')](_0xa6e1('0x1d'),_0x2c696d);logger[_0xa6e1('0xb')](_0xa6e1('0x1d'),_0x2c696d,JSON[_0xa6e1('0xd')](_0x24c371));_0x316f9e(_0x24c371);})['catch'](function(_0x1bd8a4){logger[_0xa6e1('0xe')](_0xa6e1('0x1d'),_0x1bd8a4[_0xa6e1('0xf')],_0x2c696d);_0x1d7d5c(_0x589ea6[_0xa6e1('0xe')](0x1f4,_0x1bd8a4[_0xa6e1('0xf')]));});});}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/index.js b/server/api/intDynamics365Configuration/index.js index dbb0873..d9d7838 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 _0xd7fa=['/:id/descriptions','getDescriptions','post','create','update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Configuration.controller','get','isAuthenticated','index','/:id','show','/:id/subjects'];(function(_0x32c924,_0xfb8f3f){var _0x255e14=function(_0xe5ad95){while(--_0xe5ad95){_0x32c924['push'](_0x32c924['shift']());}};_0x255e14(++_0xfb8f3f);}(_0xd7fa,0x127));var _0xad7f=function(_0x549307,_0x4a7ec6){_0x549307=_0x549307-0x0;var _0xc6d288=_0xd7fa[_0x549307];return _0xc6d288;};'use strict';var multer=require(_0xad7f('0x0'));var util=require(_0xad7f('0x1'));var path=require(_0xad7f('0x2'));var timeout=require(_0xad7f('0x3'));var express=require(_0xad7f('0x4'));var router=express[_0xad7f('0x5')]();var fs_extra=require(_0xad7f('0x6'));var auth=require(_0xad7f('0x7'));var interaction=require(_0xad7f('0x8'));var config=require(_0xad7f('0x9'));var controller=require(_0xad7f('0xa'));router[_0xad7f('0xb')]('/',auth[_0xad7f('0xc')](),controller[_0xad7f('0xd')]);router['get'](_0xad7f('0xe'),auth['isAuthenticated'](),controller[_0xad7f('0xf')]);router['get']('/:id/fields',auth['isAuthenticated'](),controller['getFields']);router['get'](_0xad7f('0x10'),auth[_0xad7f('0xc')](),controller['getSubjects']);router[_0xad7f('0xb')](_0xad7f('0x11'),auth[_0xad7f('0xc')](),controller[_0xad7f('0x12')]);router[_0xad7f('0x13')]('/',auth['isAuthenticated'](),controller[_0xad7f('0x14')]);router['put'](_0xad7f('0xe'),auth['isAuthenticated'](),controller[_0xad7f('0x15')]);router[_0xad7f('0x16')]('/:id',auth['isAuthenticated'](),controller[_0xad7f('0x17')]);module['exports']=router; \ No newline at end of file +var _0x8127=['/:id/subjects','getSubjects','/:id/descriptions','post','create','put','update','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intDynamics365Configuration.controller','index','/:id','isAuthenticated','get','/:id/fields','getFields'];(function(_0xdeac17,_0x19ad66){var _0x33aabd=function(_0x558a9e){while(--_0x558a9e){_0xdeac17['push'](_0xdeac17['shift']());}};_0x33aabd(++_0x19ad66);}(_0x8127,0x1d1));var _0x7812=function(_0x30f81b,_0x5c3f24){_0x30f81b=_0x30f81b-0x0;var _0x12723e=_0x8127[_0x30f81b];return _0x12723e;};'use strict';var multer=require('multer');var util=require(_0x7812('0x0'));var path=require(_0x7812('0x1'));var timeout=require(_0x7812('0x2'));var express=require(_0x7812('0x3'));var router=express[_0x7812('0x4')]();var fs_extra=require(_0x7812('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x7812('0x6'));var config=require(_0x7812('0x7'));var controller=require(_0x7812('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x7812('0x9')]);router['get'](_0x7812('0xa'),auth[_0x7812('0xb')](),controller['show']);router[_0x7812('0xc')](_0x7812('0xd'),auth[_0x7812('0xb')](),controller[_0x7812('0xe')]);router['get'](_0x7812('0xf'),auth[_0x7812('0xb')](),controller[_0x7812('0x10')]);router['get'](_0x7812('0x11'),auth[_0x7812('0xb')](),controller['getDescriptions']);router[_0x7812('0x12')]('/',auth[_0x7812('0xb')](),controller[_0x7812('0x13')]);router[_0x7812('0x14')](_0x7812('0xa'),auth[_0x7812('0xb')](),controller[_0x7812('0x15')]);router['delete'](_0x7812('0xa'),auth['isAuthenticated'](),controller[_0x7812('0x16')]);module[_0x7812('0x17')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js index 3f1923e..7a407f7 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 _0xa3a2=['STRING','ENUM','incident','phonecall','sequelize','exports'];(function(_0x46a88f,_0x55646b){var _0x25d917=function(_0xa8d5ca){while(--_0xa8d5ca){_0x46a88f['push'](_0x46a88f['shift']());}};_0x25d917(++_0x55646b);}(_0xa3a2,0x12a));var _0x2a3a=function(_0x27def7,_0x3f0835){_0x27def7=_0x27def7-0x0;var _0x581cbc=_0xa3a2[_0x27def7];return _0x581cbc;};'use strict';var Sequelize=require(_0x2a3a('0x0'));module[_0x2a3a('0x1')]={'name':{'type':Sequelize[_0x2a3a('0x2')]},'description':{'type':Sequelize['STRING']},'ticketType':{'type':Sequelize[_0x2a3a('0x3')](_0x2a3a('0x4'),_0x2a3a('0x5')),'defaultValue':'incident'}}; \ No newline at end of file +var _0x3fc8=['phonecall','incident','exports','STRING','ENUM'];(function(_0x1fcaf1,_0x21c3c2){var _0x55f464=function(_0x348eb3){while(--_0x348eb3){_0x1fcaf1['push'](_0x1fcaf1['shift']());}};_0x55f464(++_0x21c3c2);}(_0x3fc8,0x188));var _0x83fc=function(_0xa1e3e3,_0x29fe0e){_0xa1e3e3=_0xa1e3e3-0x0;var _0xc980e9=_0x3fc8[_0xa1e3e3];return _0xc980e9;};'use strict';var Sequelize=require('sequelize');module[_0x83fc('0x0')]={'name':{'type':Sequelize[_0x83fc('0x1')]},'description':{'type':Sequelize[_0x83fc('0x1')]},'ticketType':{'type':Sequelize[_0x83fc('0x2')]('incident',_0x83fc('0x3')),'defaultValue':_0x83fc('0x4')}}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js index 2ea6e4b..906b53f 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 _0xf1a2=['undefined','limit','count','set','Content-Range','apply','reject','update','then','end','stack','map','Dynamics365Configuration','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','VIRTUAL','merge','options','includeAll','include','rows','catch','show','params','find','create','body','destroy','getFields','findOne','Dynamics365Field','pick','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset'];(function(_0x2ce872,_0x10ec32){var _0x7cd744=function(_0x1a0fca){while(--_0x1a0fca){_0x2ce872['push'](_0x2ce872['shift']());}};_0x7cd744(++_0x10ec32);}(_0xf1a2,0x1c1));var _0x2f1a=function(_0x305c2f,_0x534f42){_0x305c2f=_0x305c2f-0x0;var _0x598f70=_0xf1a2[_0x305c2f];return _0x598f70;};'use strict';var emlformat=require(_0x2f1a('0x0'));var rimraf=require(_0x2f1a('0x1'));var zipdir=require(_0x2f1a('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2f1a('0x3'));var moment=require(_0x2f1a('0x4'));var BPromise=require(_0x2f1a('0x5'));var Mustache=require(_0x2f1a('0x6'));var util=require(_0x2f1a('0x7'));var path=require(_0x2f1a('0x8'));var sox=require(_0x2f1a('0x9'));var csv=require('to-csv');var ejs=require(_0x2f1a('0xa'));var fs=require('fs');var fs_extra=require(_0x2f1a('0xb'));var _=require(_0x2f1a('0xc'));var squel=require('squel');var crypto=require(_0x2f1a('0xd'));var jsforce=require(_0x2f1a('0xe'));var deskjs=require(_0x2f1a('0xf'));var toCsv=require(_0x2f1a('0x10'));var querystring=require(_0x2f1a('0x11'));var Papa=require(_0x2f1a('0x12'));var Redis=require(_0x2f1a('0x13'));var authService=require(_0x2f1a('0x14'));var qs=require(_0x2f1a('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2f1a('0x16'));var logger=require('../../config/logger')(_0x2f1a('0x17'));var utils=require(_0x2f1a('0x18'));var config=require(_0x2f1a('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0x2f1a('0x1a'))['db'];function respondWithStatusCode(_0x56da38,_0x25d4e1){_0x25d4e1=_0x25d4e1||0xcc;return function(_0x1a875d){if(_0x1a875d){return _0x56da38[_0x2f1a('0x1b')](_0x25d4e1);}return _0x56da38[_0x2f1a('0x1c')](_0x25d4e1)['end']();};}function respondWithResult(_0x22f6e9,_0x598d75){_0x598d75=_0x598d75||0xc8;return function(_0x3ae152){if(_0x3ae152){return _0x22f6e9[_0x2f1a('0x1c')](_0x598d75)[_0x2f1a('0x1d')](_0x3ae152);}};}function respondWithFilteredResult(_0x56b475,_0x590981){return function(_0x486758){if(_0x486758){var _0x5aa040=typeof _0x590981[_0x2f1a('0x1e')]===_0x2f1a('0x1f')&&typeof _0x590981[_0x2f1a('0x20')]===_0x2f1a('0x1f');var _0x304ba9=_0x486758[_0x2f1a('0x21')];var _0x518058=_0x5aa040?0x0:_0x590981[_0x2f1a('0x1e')];var _0x121761=_0x5aa040?_0x486758['count']:_0x590981[_0x2f1a('0x1e')]+_0x590981[_0x2f1a('0x20')];var _0x2fbd72;if(_0x121761>=_0x304ba9){_0x121761=_0x304ba9;_0x2fbd72=0xc8;}else{_0x2fbd72=0xce;}_0x56b475[_0x2f1a('0x1c')](_0x2fbd72);return _0x56b475[_0x2f1a('0x22')](_0x2f1a('0x23'),_0x518058+'-'+_0x121761+'/'+_0x304ba9)['json'](_0x486758);}return null;};}function patchUpdates(_0x9fb9d5){return function(_0x592709){try{jsonpatch[_0x2f1a('0x24')](_0x592709,_0x9fb9d5,!![]);}catch(_0x262a5b){return BPromise[_0x2f1a('0x25')](_0x262a5b);}return _0x592709['save']();};}function saveUpdates(_0x491ba9,_0x1cb8fc){return function(_0xb262f4){if(_0xb262f4){return _0xb262f4[_0x2f1a('0x26')](_0x491ba9)[_0x2f1a('0x27')](function(_0x38b3a8){return _0x38b3a8;});}return null;};}function removeEntity(_0x4d68fb,_0x1aa7c6){return function(_0x3f83fc){if(_0x3f83fc){return _0x3f83fc['destroy']()[_0x2f1a('0x27')](function(){_0x4d68fb[_0x2f1a('0x1c')](0xcc)[_0x2f1a('0x28')]();});}};}function handleEntityNotFound(_0x17a877,_0xdff9ce){return function(_0x33d3f8){if(!_0x33d3f8){_0x17a877[_0x2f1a('0x1b')](0x194);}return _0x33d3f8;};}function handleError(_0x523767,_0x4094c3){_0x4094c3=_0x4094c3||0x1f4;return function(_0xc55a05){logger['error'](_0xc55a05[_0x2f1a('0x29')]);if(_0xc55a05['name']){delete _0xc55a05['name'];}_0x523767[_0x2f1a('0x1c')](_0x4094c3)['send'](_0xc55a05);};}exports['index']=function(_0x1c2b82,_0x1b15e8){var _0x43f544={},_0x6be04c={},_0x215360={'count':0x0,'rows':[]};var _0xf4f226=_[_0x2f1a('0x2a')](db[_0x2f1a('0x2b')][_0x2f1a('0x2c')],function(_0x2b245f){return{'name':_0x2b245f[_0x2f1a('0x2d')],'type':_0x2b245f[_0x2f1a('0x2e')]['key']};});_0x6be04c[_0x2f1a('0x2f')]=_[_0x2f1a('0x2a')](_0xf4f226,'name');_0x6be04c[_0x2f1a('0x30')]=_[_0x2f1a('0x31')](_0x1c2b82[_0x2f1a('0x30')]);_0x6be04c[_0x2f1a('0x32')]=_[_0x2f1a('0x33')](_0x6be04c[_0x2f1a('0x2f')],_0x6be04c[_0x2f1a('0x30')]);_0x43f544[_0x2f1a('0x34')]=_[_0x2f1a('0x33')](_0x6be04c[_0x2f1a('0x2f')],qs['fields'](_0x1c2b82[_0x2f1a('0x30')][_0x2f1a('0x35')]));_0x43f544['attributes']=_0x43f544['attributes'][_0x2f1a('0x36')]?_0x43f544[_0x2f1a('0x34')]:_0x6be04c['model'];if(!_0x1c2b82[_0x2f1a('0x30')][_0x2f1a('0x37')](_0x2f1a('0x38'))){_0x43f544[_0x2f1a('0x20')]=qs['limit'](_0x1c2b82[_0x2f1a('0x30')][_0x2f1a('0x20')]);_0x43f544['offset']=qs[_0x2f1a('0x1e')](_0x1c2b82['query']['offset']);}_0x43f544[_0x2f1a('0x39')]=qs['sort'](_0x1c2b82[_0x2f1a('0x30')][_0x2f1a('0x3a')]);_0x43f544[_0x2f1a('0x3b')]=qs['filters'](_['pick'](_0x1c2b82[_0x2f1a('0x30')],_0x6be04c[_0x2f1a('0x32')]),_0xf4f226);if(_0x1c2b82[_0x2f1a('0x30')][_0x2f1a('0x3c')]){_0x43f544[_0x2f1a('0x3b')]=_['merge'](_0x43f544['where'],{'$or':_[_0x2f1a('0x2a')](_0xf4f226,function(_0x225537){if(_0x225537['type']!==_0x2f1a('0x3d')){var _0x3e0de6={};_0x3e0de6[_0x225537['name']]={'$like':'%'+_0x1c2b82[_0x2f1a('0x30')][_0x2f1a('0x3c')]+'%'};return _0x3e0de6;}})});}_0x43f544=_[_0x2f1a('0x3e')]({},_0x43f544,_0x1c2b82[_0x2f1a('0x3f')]);var _0x541f5a={'where':_0x43f544[_0x2f1a('0x3b')]};return db['Dynamics365Configuration'][_0x2f1a('0x21')](_0x541f5a)['then'](function(_0x4e04b5){_0x215360[_0x2f1a('0x21')]=_0x4e04b5;if(_0x1c2b82['query'][_0x2f1a('0x40')]){_0x43f544[_0x2f1a('0x41')]=[{'all':!![]}];}return db['Dynamics365Configuration']['findAll'](_0x43f544);})[_0x2f1a('0x27')](function(_0x56a3ab){_0x215360[_0x2f1a('0x42')]=_0x56a3ab;return _0x215360;})[_0x2f1a('0x27')](respondWithFilteredResult(_0x1b15e8,_0x43f544))[_0x2f1a('0x43')](handleError(_0x1b15e8,null));};exports[_0x2f1a('0x44')]=function(_0x37711e,_0x509828){var _0x18f5be={'raw':![],'where':{'id':_0x37711e[_0x2f1a('0x45')]['id']}},_0x5d63f8={};_0x5d63f8['model']=_[_0x2f1a('0x31')](db[_0x2f1a('0x2b')][_0x2f1a('0x2c')]);_0x5d63f8['query']=_[_0x2f1a('0x31')](_0x37711e[_0x2f1a('0x30')]);_0x5d63f8[_0x2f1a('0x32')]=_[_0x2f1a('0x33')](_0x5d63f8[_0x2f1a('0x2f')],_0x5d63f8[_0x2f1a('0x30')]);_0x18f5be['attributes']=_[_0x2f1a('0x33')](_0x5d63f8[_0x2f1a('0x2f')],qs[_0x2f1a('0x35')](_0x37711e['query'][_0x2f1a('0x35')]));_0x18f5be[_0x2f1a('0x34')]=_0x18f5be['attributes'][_0x2f1a('0x36')]?_0x18f5be[_0x2f1a('0x34')]:_0x5d63f8[_0x2f1a('0x2f')];if(_0x37711e[_0x2f1a('0x30')][_0x2f1a('0x40')]){_0x18f5be['include']=[{'all':!![]}];}_0x18f5be=_['merge']({},_0x18f5be,_0x37711e['options']);return db[_0x2f1a('0x2b')][_0x2f1a('0x46')](_0x18f5be)[_0x2f1a('0x27')](handleEntityNotFound(_0x509828,null))[_0x2f1a('0x27')](respondWithResult(_0x509828,null))[_0x2f1a('0x43')](handleError(_0x509828,null));};exports[_0x2f1a('0x47')]=function(_0x2164b7,_0x1a4404){return db[_0x2f1a('0x2b')][_0x2f1a('0x47')](_0x2164b7[_0x2f1a('0x48')],{})['then'](respondWithResult(_0x1a4404,0xc9))['catch'](handleError(_0x1a4404,null));};exports[_0x2f1a('0x26')]=function(_0x54c708,_0x1a2e15){if(_0x54c708[_0x2f1a('0x48')]['id']){delete _0x54c708[_0x2f1a('0x48')]['id'];}return db[_0x2f1a('0x2b')]['find']({'where':{'id':_0x54c708[_0x2f1a('0x45')]['id']}})[_0x2f1a('0x27')](handleEntityNotFound(_0x1a2e15,null))[_0x2f1a('0x27')](saveUpdates(_0x54c708[_0x2f1a('0x48')],null))[_0x2f1a('0x27')](respondWithResult(_0x1a2e15,null))[_0x2f1a('0x43')](handleError(_0x1a2e15,null));};exports[_0x2f1a('0x49')]=function(_0x17f91b,_0x24b29d){return db[_0x2f1a('0x2b')]['find']({'where':{'id':_0x17f91b[_0x2f1a('0x45')]['id']}})[_0x2f1a('0x27')](handleEntityNotFound(_0x24b29d,null))[_0x2f1a('0x27')](removeEntity(_0x24b29d,null))[_0x2f1a('0x43')](handleError(_0x24b29d,null));};exports[_0x2f1a('0x4a')]=function(_0x2d7bdb,_0x1f09ff,_0x5de1c1){var _0x5ca449={};var _0x2d3aca={};var _0x12182f;var _0x5a831e;return db[_0x2f1a('0x2b')]['findOne']({'where':{'id':_0x2d7bdb[_0x2f1a('0x45')]['id']}})[_0x2f1a('0x27')](handleEntityNotFound(_0x1f09ff,null))[_0x2f1a('0x27')](function(_0x3dab3a){if(_0x3dab3a){_0x12182f=_0x3dab3a;_0x2d3aca[_0x2f1a('0x2f')]=_[_0x2f1a('0x31')](db['Dynamics365Field'][_0x2f1a('0x2c')]);_0x2d3aca['query']=_[_0x2f1a('0x31')](_0x2d7bdb[_0x2f1a('0x30')]);_0x2d3aca[_0x2f1a('0x32')]=_[_0x2f1a('0x33')](_0x2d3aca[_0x2f1a('0x2f')],_0x2d3aca['query']);_0x5ca449['attributes']=_['intersection'](_0x2d3aca[_0x2f1a('0x2f')],qs[_0x2f1a('0x35')](_0x2d7bdb['query']['fields']));_0x5ca449[_0x2f1a('0x34')]=_0x5ca449['attributes']['length']?_0x5ca449['attributes']:_0x2d3aca['model'];_0x5ca449[_0x2f1a('0x39')]=qs[_0x2f1a('0x3a')](_0x2d7bdb[_0x2f1a('0x30')]['sort']);_0x5ca449[_0x2f1a('0x3b')]=qs[_0x2f1a('0x32')](_['pick'](_0x2d7bdb['query'],_0x2d3aca[_0x2f1a('0x32')]));if(_0x2d7bdb[_0x2f1a('0x30')][_0x2f1a('0x3c')]){_0x5ca449[_0x2f1a('0x3b')]=_[_0x2f1a('0x3e')](_0x5ca449[_0x2f1a('0x3b')],{'$or':_[_0x2f1a('0x2a')](_0x5ca449['attributes'],function(_0x5abb1e){var _0xf12b83={};_0xf12b83[_0x5abb1e]={'$like':'%'+_0x2d7bdb['query'][_0x2f1a('0x3c')]+'%'};return _0xf12b83;})});}_0x5ca449=_[_0x2f1a('0x3e')]({},_0x5ca449,_0x2d7bdb['options']);return _0x12182f[_0x2f1a('0x4a')](_0x5ca449);}})['then'](function(_0x54974b){if(_0x54974b){_0x5a831e=_0x54974b['length'];if(!_0x2d7bdb[_0x2f1a('0x30')]['hasOwnProperty'](_0x2f1a('0x38'))){_0x5ca449['limit']=qs['limit'](_0x2d7bdb[_0x2f1a('0x30')][_0x2f1a('0x20')]);_0x5ca449[_0x2f1a('0x1e')]=qs['offset'](_0x2d7bdb[_0x2f1a('0x30')][_0x2f1a('0x1e')]);}return _0x12182f[_0x2f1a('0x4a')](_0x5ca449);}})[_0x2f1a('0x27')](function(_0x54cfed){if(_0x54cfed){return _0x54cfed?{'count':_0x5a831e,'rows':_0x54cfed}:null;}})[_0x2f1a('0x27')](respondWithResult(_0x1f09ff,null))['catch'](handleError(_0x1f09ff,null));};exports['getSubjects']=function(_0x5ee122,_0x546333,_0x5ed2ac){var _0x57ed92={};var _0x11e3e5={};var _0x58b846;var _0xe7aad9;return db[_0x2f1a('0x2b')][_0x2f1a('0x4b')]({'where':{'id':_0x5ee122[_0x2f1a('0x45')]['id']}})[_0x2f1a('0x27')](handleEntityNotFound(_0x546333,null))['then'](function(_0x3a0257){if(_0x3a0257){_0x58b846=_0x3a0257;_0x11e3e5[_0x2f1a('0x2f')]=_[_0x2f1a('0x31')](db[_0x2f1a('0x4c')][_0x2f1a('0x2c')]);_0x11e3e5[_0x2f1a('0x30')]=_[_0x2f1a('0x31')](_0x5ee122['query']);_0x11e3e5[_0x2f1a('0x32')]=_[_0x2f1a('0x33')](_0x11e3e5['model'],_0x11e3e5['query']);_0x57ed92['attributes']=_['intersection'](_0x11e3e5['model'],qs[_0x2f1a('0x35')](_0x5ee122['query'][_0x2f1a('0x35')]));_0x57ed92['attributes']=_0x57ed92[_0x2f1a('0x34')][_0x2f1a('0x36')]?_0x57ed92['attributes']:_0x11e3e5['model'];_0x57ed92['order']=qs[_0x2f1a('0x3a')](_0x5ee122[_0x2f1a('0x30')][_0x2f1a('0x3a')]);_0x57ed92['where']=qs[_0x2f1a('0x32')](_[_0x2f1a('0x4d')](_0x5ee122[_0x2f1a('0x30')],_0x11e3e5[_0x2f1a('0x32')]));if(_0x5ee122[_0x2f1a('0x30')][_0x2f1a('0x3c')]){_0x57ed92[_0x2f1a('0x3b')]=_[_0x2f1a('0x3e')](_0x57ed92[_0x2f1a('0x3b')],{'$or':_[_0x2f1a('0x2a')](_0x57ed92[_0x2f1a('0x34')],function(_0x4ef61b){var _0x316693={};_0x316693[_0x4ef61b]={'$like':'%'+_0x5ee122[_0x2f1a('0x30')][_0x2f1a('0x3c')]+'%'};return _0x316693;})});}_0x57ed92=_[_0x2f1a('0x3e')]({},_0x57ed92,_0x5ee122[_0x2f1a('0x3f')]);return _0x58b846['getSubjects'](_0x57ed92);}})[_0x2f1a('0x27')](function(_0x1c6824){if(_0x1c6824){_0xe7aad9=_0x1c6824[_0x2f1a('0x36')];if(!_0x5ee122[_0x2f1a('0x30')][_0x2f1a('0x37')]('nolimit')){_0x57ed92[_0x2f1a('0x20')]=qs[_0x2f1a('0x20')](_0x5ee122[_0x2f1a('0x30')][_0x2f1a('0x20')]);_0x57ed92[_0x2f1a('0x1e')]=qs[_0x2f1a('0x1e')](_0x5ee122[_0x2f1a('0x30')][_0x2f1a('0x1e')]);}return _0x58b846[_0x2f1a('0x4e')](_0x57ed92);}})[_0x2f1a('0x27')](function(_0x48b920){if(_0x48b920){return _0x48b920?{'count':_0xe7aad9,'rows':_0x48b920}:null;}})[_0x2f1a('0x27')](respondWithResult(_0x546333,null))[_0x2f1a('0x43')](handleError(_0x546333,null));};exports[_0x2f1a('0x4f')]=function(_0x2d3d24,_0x310b91,_0x31e398){var _0x23e3a0={};var _0x108f6d={};var _0x253358;var _0x378ad1;return db[_0x2f1a('0x2b')][_0x2f1a('0x4b')]({'where':{'id':_0x2d3d24[_0x2f1a('0x45')]['id']}})[_0x2f1a('0x27')](handleEntityNotFound(_0x310b91,null))[_0x2f1a('0x27')](function(_0x3dc07b){if(_0x3dc07b){_0x253358=_0x3dc07b;_0x108f6d[_0x2f1a('0x2f')]=_[_0x2f1a('0x31')](db[_0x2f1a('0x4c')][_0x2f1a('0x2c')]);_0x108f6d[_0x2f1a('0x30')]=_[_0x2f1a('0x31')](_0x2d3d24[_0x2f1a('0x30')]);_0x108f6d[_0x2f1a('0x32')]=_[_0x2f1a('0x33')](_0x108f6d[_0x2f1a('0x2f')],_0x108f6d[_0x2f1a('0x30')]);_0x23e3a0[_0x2f1a('0x34')]=_['intersection'](_0x108f6d[_0x2f1a('0x2f')],qs[_0x2f1a('0x35')](_0x2d3d24[_0x2f1a('0x30')]['fields']));_0x23e3a0[_0x2f1a('0x34')]=_0x23e3a0[_0x2f1a('0x34')][_0x2f1a('0x36')]?_0x23e3a0[_0x2f1a('0x34')]:_0x108f6d[_0x2f1a('0x2f')];_0x23e3a0[_0x2f1a('0x39')]=qs[_0x2f1a('0x3a')](_0x2d3d24['query'][_0x2f1a('0x3a')]);_0x23e3a0[_0x2f1a('0x3b')]=qs[_0x2f1a('0x32')](_[_0x2f1a('0x4d')](_0x2d3d24[_0x2f1a('0x30')],_0x108f6d[_0x2f1a('0x32')]));if(_0x2d3d24[_0x2f1a('0x30')]['filter']){_0x23e3a0[_0x2f1a('0x3b')]=_[_0x2f1a('0x3e')](_0x23e3a0[_0x2f1a('0x3b')],{'$or':_[_0x2f1a('0x2a')](_0x23e3a0[_0x2f1a('0x34')],function(_0x2d7116){var _0x4e8951={};_0x4e8951[_0x2d7116]={'$like':'%'+_0x2d3d24[_0x2f1a('0x30')][_0x2f1a('0x3c')]+'%'};return _0x4e8951;})});}_0x23e3a0=_[_0x2f1a('0x3e')]({},_0x23e3a0,_0x2d3d24[_0x2f1a('0x3f')]);return _0x253358['getDescriptions'](_0x23e3a0);}})['then'](function(_0xc1067e){if(_0xc1067e){_0x378ad1=_0xc1067e[_0x2f1a('0x36')];if(!_0x2d3d24[_0x2f1a('0x30')][_0x2f1a('0x37')]('nolimit')){_0x23e3a0[_0x2f1a('0x20')]=qs[_0x2f1a('0x20')](_0x2d3d24[_0x2f1a('0x30')][_0x2f1a('0x20')]);_0x23e3a0[_0x2f1a('0x1e')]=qs[_0x2f1a('0x1e')](_0x2d3d24['query'][_0x2f1a('0x1e')]);}return _0x253358['getDescriptions'](_0x23e3a0);}})['then'](function(_0x2a4017){if(_0x2a4017){return _0x2a4017?{'count':_0x378ad1,'rows':_0x2a4017}:null;}})['then'](respondWithResult(_0x310b91,null))[_0x2f1a('0x43')](handleError(_0x310b91,null));}; \ No newline at end of file +var _0x55f5=['filter','where','type','VIRTUAL','merge','options','include','findAll','rows','catch','show','includeAll','find','create','body','params','getFields','findOne','pick','Dynamics365Field','getDescriptions','zip-dir','fast-json-patch','request-promise','moment','mustache','sox','to-csv','ejs','fs-extra','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','stack','name','send','index','map','Dynamics365Configuration','rawAttributes','fieldName','key','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','filters'];(function(_0x52ab8a,_0xee034b){var _0x5d6ddc=function(_0x283fa6){while(--_0x283fa6){_0x52ab8a['push'](_0x52ab8a['shift']());}};_0x5d6ddc(++_0xee034b);}(_0x55f5,0x1e3));var _0x555f=function(_0x1a215e,_0x16ee97){_0x1a215e=_0x1a215e-0x0;var _0x46c945=_0x55f5[_0x1a215e];return _0x46c945;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x555f('0x0'));var jsonpatch=require(_0x555f('0x1'));var rp=require(_0x555f('0x2'));var moment=require(_0x555f('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x555f('0x4'));var util=require('util');var path=require('path');var sox=require(_0x555f('0x5'));var csv=require(_0x555f('0x6'));var ejs=require(_0x555f('0x7'));var fs=require('fs');var fs_extra=require(_0x555f('0x8'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x555f('0x9'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x555f('0x6'));var querystring=require(_0x555f('0xa'));var Papa=require(_0x555f('0xb'));var Redis=require(_0x555f('0xc'));var authService=require(_0x555f('0xd'));var qs=require(_0x555f('0xe'));var as=require(_0x555f('0xf'));var hardwareService=require(_0x555f('0x10'));var logger=require(_0x555f('0x11'))(_0x555f('0x12'));var utils=require(_0x555f('0x13'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4cbc34,_0x2e804d){_0x2e804d=_0x2e804d||0xcc;return function(_0x10e822){if(_0x10e822){return _0x4cbc34[_0x555f('0x14')](_0x2e804d);}return _0x4cbc34[_0x555f('0x15')](_0x2e804d)[_0x555f('0x16')]();};}function respondWithResult(_0x19f032,_0x39a2c6){_0x39a2c6=_0x39a2c6||0xc8;return function(_0x457b7d){if(_0x457b7d){return _0x19f032['status'](_0x39a2c6)[_0x555f('0x17')](_0x457b7d);}};}function respondWithFilteredResult(_0x31bb78,_0x429ce3){return function(_0x468a88){if(_0x468a88){var _0x1cdd36=typeof _0x429ce3[_0x555f('0x18')]===_0x555f('0x19')&&typeof _0x429ce3[_0x555f('0x1a')]===_0x555f('0x19');var _0x179176=_0x468a88[_0x555f('0x1b')];var _0x51ac7e=_0x1cdd36?0x0:_0x429ce3[_0x555f('0x18')];var _0x1bdb5b=_0x1cdd36?_0x468a88[_0x555f('0x1b')]:_0x429ce3['offset']+_0x429ce3[_0x555f('0x1a')];var _0x1b2709;if(_0x1bdb5b>=_0x179176){_0x1bdb5b=_0x179176;_0x1b2709=0xc8;}else{_0x1b2709=0xce;}_0x31bb78['status'](_0x1b2709);return _0x31bb78[_0x555f('0x1c')]('Content-Range',_0x51ac7e+'-'+_0x1bdb5b+'/'+_0x179176)['json'](_0x468a88);}return null;};}function patchUpdates(_0x42577f){return function(_0x441abf){try{jsonpatch[_0x555f('0x1d')](_0x441abf,_0x42577f,!![]);}catch(_0xd1408a){return BPromise[_0x555f('0x1e')](_0xd1408a);}return _0x441abf[_0x555f('0x1f')]();};}function saveUpdates(_0x45c219,_0x3ef710){return function(_0x598910){if(_0x598910){return _0x598910[_0x555f('0x20')](_0x45c219)[_0x555f('0x21')](function(_0x4efd28){return _0x4efd28;});}return null;};}function removeEntity(_0x231d2c,_0x16fd93){return function(_0x3ce951){if(_0x3ce951){return _0x3ce951[_0x555f('0x22')]()[_0x555f('0x21')](function(){_0x231d2c[_0x555f('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0xa9c70e,_0x7eafa9){return function(_0x5194f8){if(!_0x5194f8){_0xa9c70e[_0x555f('0x14')](0x194);}return _0x5194f8;};}function handleError(_0x5248ff,_0x422783){_0x422783=_0x422783||0x1f4;return function(_0x1f39a2){logger['error'](_0x1f39a2[_0x555f('0x23')]);if(_0x1f39a2['name']){delete _0x1f39a2[_0x555f('0x24')];}_0x5248ff[_0x555f('0x15')](_0x422783)[_0x555f('0x25')](_0x1f39a2);};}exports[_0x555f('0x26')]=function(_0x1bc568,_0x5344e6){var _0x19f96c={},_0x1e7b9a={},_0x58545c={'count':0x0,'rows':[]};var _0x360d94=_[_0x555f('0x27')](db[_0x555f('0x28')][_0x555f('0x29')],function(_0x4495dc){return{'name':_0x4495dc[_0x555f('0x2a')],'type':_0x4495dc['type'][_0x555f('0x2b')]};});_0x1e7b9a[_0x555f('0x2c')]=_[_0x555f('0x27')](_0x360d94,_0x555f('0x24'));_0x1e7b9a[_0x555f('0x2d')]=_[_0x555f('0x2e')](_0x1bc568[_0x555f('0x2d')]);_0x1e7b9a['filters']=_['intersection'](_0x1e7b9a[_0x555f('0x2c')],_0x1e7b9a[_0x555f('0x2d')]);_0x19f96c[_0x555f('0x2f')]=_[_0x555f('0x30')](_0x1e7b9a[_0x555f('0x2c')],qs[_0x555f('0x31')](_0x1bc568['query'][_0x555f('0x31')]));_0x19f96c['attributes']=_0x19f96c[_0x555f('0x2f')][_0x555f('0x32')]?_0x19f96c[_0x555f('0x2f')]:_0x1e7b9a[_0x555f('0x2c')];if(!_0x1bc568[_0x555f('0x2d')][_0x555f('0x33')](_0x555f('0x34'))){_0x19f96c[_0x555f('0x1a')]=qs[_0x555f('0x1a')](_0x1bc568[_0x555f('0x2d')]['limit']);_0x19f96c[_0x555f('0x18')]=qs['offset'](_0x1bc568[_0x555f('0x2d')][_0x555f('0x18')]);}_0x19f96c[_0x555f('0x35')]=qs[_0x555f('0x36')](_0x1bc568[_0x555f('0x2d')][_0x555f('0x36')]);_0x19f96c['where']=qs[_0x555f('0x37')](_['pick'](_0x1bc568['query'],_0x1e7b9a[_0x555f('0x37')]),_0x360d94);if(_0x1bc568[_0x555f('0x2d')][_0x555f('0x38')]){_0x19f96c[_0x555f('0x39')]=_['merge'](_0x19f96c[_0x555f('0x39')],{'$or':_[_0x555f('0x27')](_0x360d94,function(_0x45d365){if(_0x45d365[_0x555f('0x3a')]!==_0x555f('0x3b')){var _0x402bd8={};_0x402bd8[_0x45d365[_0x555f('0x24')]]={'$like':'%'+_0x1bc568[_0x555f('0x2d')]['filter']+'%'};return _0x402bd8;}})});}_0x19f96c=_[_0x555f('0x3c')]({},_0x19f96c,_0x1bc568[_0x555f('0x3d')]);var _0x147625={'where':_0x19f96c[_0x555f('0x39')]};return db['Dynamics365Configuration'][_0x555f('0x1b')](_0x147625)[_0x555f('0x21')](function(_0x475b0e){_0x58545c['count']=_0x475b0e;if(_0x1bc568['query']['includeAll']){_0x19f96c[_0x555f('0x3e')]=[{'all':!![]}];}return db[_0x555f('0x28')][_0x555f('0x3f')](_0x19f96c);})[_0x555f('0x21')](function(_0x24aaf2){_0x58545c[_0x555f('0x40')]=_0x24aaf2;return _0x58545c;})[_0x555f('0x21')](respondWithFilteredResult(_0x5344e6,_0x19f96c))[_0x555f('0x41')](handleError(_0x5344e6,null));};exports[_0x555f('0x42')]=function(_0x3e0da6,_0x36b18d){var _0x1aa5e6={'raw':![],'where':{'id':_0x3e0da6['params']['id']}},_0x2a06d8={};_0x2a06d8[_0x555f('0x2c')]=_['keys'](db['Dynamics365Configuration'][_0x555f('0x29')]);_0x2a06d8[_0x555f('0x2d')]=_['keys'](_0x3e0da6[_0x555f('0x2d')]);_0x2a06d8['filters']=_[_0x555f('0x30')](_0x2a06d8[_0x555f('0x2c')],_0x2a06d8[_0x555f('0x2d')]);_0x1aa5e6[_0x555f('0x2f')]=_[_0x555f('0x30')](_0x2a06d8[_0x555f('0x2c')],qs[_0x555f('0x31')](_0x3e0da6[_0x555f('0x2d')]['fields']));_0x1aa5e6[_0x555f('0x2f')]=_0x1aa5e6[_0x555f('0x2f')][_0x555f('0x32')]?_0x1aa5e6[_0x555f('0x2f')]:_0x2a06d8[_0x555f('0x2c')];if(_0x3e0da6[_0x555f('0x2d')][_0x555f('0x43')]){_0x1aa5e6[_0x555f('0x3e')]=[{'all':!![]}];}_0x1aa5e6=_[_0x555f('0x3c')]({},_0x1aa5e6,_0x3e0da6[_0x555f('0x3d')]);return db[_0x555f('0x28')][_0x555f('0x44')](_0x1aa5e6)[_0x555f('0x21')](handleEntityNotFound(_0x36b18d,null))[_0x555f('0x21')](respondWithResult(_0x36b18d,null))[_0x555f('0x41')](handleError(_0x36b18d,null));};exports['create']=function(_0x6a4d6e,_0x303f11){return db[_0x555f('0x28')][_0x555f('0x45')](_0x6a4d6e[_0x555f('0x46')],{})[_0x555f('0x21')](respondWithResult(_0x303f11,0xc9))[_0x555f('0x41')](handleError(_0x303f11,null));};exports[_0x555f('0x20')]=function(_0x3cac91,_0x41a752){if(_0x3cac91[_0x555f('0x46')]['id']){delete _0x3cac91[_0x555f('0x46')]['id'];}return db[_0x555f('0x28')][_0x555f('0x44')]({'where':{'id':_0x3cac91['params']['id']}})[_0x555f('0x21')](handleEntityNotFound(_0x41a752,null))[_0x555f('0x21')](saveUpdates(_0x3cac91[_0x555f('0x46')],null))['then'](respondWithResult(_0x41a752,null))['catch'](handleError(_0x41a752,null));};exports[_0x555f('0x22')]=function(_0x43bb6e,_0x32d745){return db[_0x555f('0x28')][_0x555f('0x44')]({'where':{'id':_0x43bb6e[_0x555f('0x47')]['id']}})['then'](handleEntityNotFound(_0x32d745,null))['then'](removeEntity(_0x32d745,null))['catch'](handleError(_0x32d745,null));};exports[_0x555f('0x48')]=function(_0x34f497,_0x4a5da4,_0x19d9ea){var _0x45f814={};var _0x21c596={};var _0x4055ab;var _0xe88707;return db[_0x555f('0x28')][_0x555f('0x49')]({'where':{'id':_0x34f497[_0x555f('0x47')]['id']}})[_0x555f('0x21')](handleEntityNotFound(_0x4a5da4,null))[_0x555f('0x21')](function(_0x31aa97){if(_0x31aa97){_0x4055ab=_0x31aa97;_0x21c596[_0x555f('0x2c')]=_[_0x555f('0x2e')](db['Dynamics365Field'][_0x555f('0x29')]);_0x21c596[_0x555f('0x2d')]=_['keys'](_0x34f497[_0x555f('0x2d')]);_0x21c596['filters']=_[_0x555f('0x30')](_0x21c596[_0x555f('0x2c')],_0x21c596[_0x555f('0x2d')]);_0x45f814['attributes']=_[_0x555f('0x30')](_0x21c596['model'],qs[_0x555f('0x31')](_0x34f497['query'][_0x555f('0x31')]));_0x45f814['attributes']=_0x45f814[_0x555f('0x2f')][_0x555f('0x32')]?_0x45f814[_0x555f('0x2f')]:_0x21c596['model'];_0x45f814['order']=qs[_0x555f('0x36')](_0x34f497[_0x555f('0x2d')]['sort']);_0x45f814['where']=qs[_0x555f('0x37')](_[_0x555f('0x4a')](_0x34f497[_0x555f('0x2d')],_0x21c596['filters']));if(_0x34f497[_0x555f('0x2d')][_0x555f('0x38')]){_0x45f814[_0x555f('0x39')]=_[_0x555f('0x3c')](_0x45f814['where'],{'$or':_[_0x555f('0x27')](_0x45f814[_0x555f('0x2f')],function(_0x372083){var _0x31e38b={};_0x31e38b[_0x372083]={'$like':'%'+_0x34f497['query'][_0x555f('0x38')]+'%'};return _0x31e38b;})});}_0x45f814=_[_0x555f('0x3c')]({},_0x45f814,_0x34f497[_0x555f('0x3d')]);return _0x4055ab['getFields'](_0x45f814);}})[_0x555f('0x21')](function(_0x120068){if(_0x120068){_0xe88707=_0x120068[_0x555f('0x32')];if(!_0x34f497['query']['hasOwnProperty'](_0x555f('0x34'))){_0x45f814[_0x555f('0x1a')]=qs['limit'](_0x34f497[_0x555f('0x2d')][_0x555f('0x1a')]);_0x45f814[_0x555f('0x18')]=qs[_0x555f('0x18')](_0x34f497['query'][_0x555f('0x18')]);}return _0x4055ab[_0x555f('0x48')](_0x45f814);}})[_0x555f('0x21')](function(_0x26e2f6){if(_0x26e2f6){return _0x26e2f6?{'count':_0xe88707,'rows':_0x26e2f6}:null;}})[_0x555f('0x21')](respondWithResult(_0x4a5da4,null))[_0x555f('0x41')](handleError(_0x4a5da4,null));};exports['getSubjects']=function(_0x209efd,_0x5505e9,_0x53cd58){var _0x9a8cec={};var _0x1ddefc={};var _0xdd7ddb;var _0x213884;return db[_0x555f('0x28')][_0x555f('0x49')]({'where':{'id':_0x209efd['params']['id']}})['then'](handleEntityNotFound(_0x5505e9,null))[_0x555f('0x21')](function(_0x3d6f0d){if(_0x3d6f0d){_0xdd7ddb=_0x3d6f0d;_0x1ddefc['model']=_[_0x555f('0x2e')](db[_0x555f('0x4b')]['rawAttributes']);_0x1ddefc[_0x555f('0x2d')]=_['keys'](_0x209efd[_0x555f('0x2d')]);_0x1ddefc['filters']=_[_0x555f('0x30')](_0x1ddefc['model'],_0x1ddefc[_0x555f('0x2d')]);_0x9a8cec[_0x555f('0x2f')]=_[_0x555f('0x30')](_0x1ddefc[_0x555f('0x2c')],qs[_0x555f('0x31')](_0x209efd[_0x555f('0x2d')]['fields']));_0x9a8cec['attributes']=_0x9a8cec[_0x555f('0x2f')][_0x555f('0x32')]?_0x9a8cec[_0x555f('0x2f')]:_0x1ddefc[_0x555f('0x2c')];_0x9a8cec[_0x555f('0x35')]=qs[_0x555f('0x36')](_0x209efd[_0x555f('0x2d')][_0x555f('0x36')]);_0x9a8cec['where']=qs['filters'](_[_0x555f('0x4a')](_0x209efd[_0x555f('0x2d')],_0x1ddefc[_0x555f('0x37')]));if(_0x209efd[_0x555f('0x2d')][_0x555f('0x38')]){_0x9a8cec[_0x555f('0x39')]=_[_0x555f('0x3c')](_0x9a8cec['where'],{'$or':_[_0x555f('0x27')](_0x9a8cec[_0x555f('0x2f')],function(_0x42229e){var _0x21f5c4={};_0x21f5c4[_0x42229e]={'$like':'%'+_0x209efd[_0x555f('0x2d')][_0x555f('0x38')]+'%'};return _0x21f5c4;})});}_0x9a8cec=_['merge']({},_0x9a8cec,_0x209efd[_0x555f('0x3d')]);return _0xdd7ddb['getSubjects'](_0x9a8cec);}})['then'](function(_0x507bc9){if(_0x507bc9){_0x213884=_0x507bc9['length'];if(!_0x209efd[_0x555f('0x2d')][_0x555f('0x33')](_0x555f('0x34'))){_0x9a8cec[_0x555f('0x1a')]=qs[_0x555f('0x1a')](_0x209efd[_0x555f('0x2d')][_0x555f('0x1a')]);_0x9a8cec['offset']=qs[_0x555f('0x18')](_0x209efd['query'][_0x555f('0x18')]);}return _0xdd7ddb['getSubjects'](_0x9a8cec);}})['then'](function(_0x41bd83){if(_0x41bd83){return _0x41bd83?{'count':_0x213884,'rows':_0x41bd83}:null;}})[_0x555f('0x21')](respondWithResult(_0x5505e9,null))[_0x555f('0x41')](handleError(_0x5505e9,null));};exports[_0x555f('0x4c')]=function(_0x84eeab,_0x518aca,_0x592fde){var _0x2f455e={};var _0x3b87c5={};var _0x23390b;var _0x48ac37;return db[_0x555f('0x28')]['findOne']({'where':{'id':_0x84eeab[_0x555f('0x47')]['id']}})[_0x555f('0x21')](handleEntityNotFound(_0x518aca,null))[_0x555f('0x21')](function(_0x35448b){if(_0x35448b){_0x23390b=_0x35448b;_0x3b87c5[_0x555f('0x2c')]=_[_0x555f('0x2e')](db['Dynamics365Field'][_0x555f('0x29')]);_0x3b87c5['query']=_[_0x555f('0x2e')](_0x84eeab[_0x555f('0x2d')]);_0x3b87c5[_0x555f('0x37')]=_[_0x555f('0x30')](_0x3b87c5[_0x555f('0x2c')],_0x3b87c5[_0x555f('0x2d')]);_0x2f455e[_0x555f('0x2f')]=_['intersection'](_0x3b87c5['model'],qs['fields'](_0x84eeab[_0x555f('0x2d')]['fields']));_0x2f455e['attributes']=_0x2f455e['attributes'][_0x555f('0x32')]?_0x2f455e[_0x555f('0x2f')]:_0x3b87c5[_0x555f('0x2c')];_0x2f455e[_0x555f('0x35')]=qs[_0x555f('0x36')](_0x84eeab[_0x555f('0x2d')][_0x555f('0x36')]);_0x2f455e['where']=qs[_0x555f('0x37')](_[_0x555f('0x4a')](_0x84eeab[_0x555f('0x2d')],_0x3b87c5[_0x555f('0x37')]));if(_0x84eeab[_0x555f('0x2d')]['filter']){_0x2f455e[_0x555f('0x39')]=_['merge'](_0x2f455e[_0x555f('0x39')],{'$or':_[_0x555f('0x27')](_0x2f455e[_0x555f('0x2f')],function(_0x52d2bd){var _0x293bfc={};_0x293bfc[_0x52d2bd]={'$like':'%'+_0x84eeab[_0x555f('0x2d')][_0x555f('0x38')]+'%'};return _0x293bfc;})});}_0x2f455e=_['merge']({},_0x2f455e,_0x84eeab[_0x555f('0x3d')]);return _0x23390b[_0x555f('0x4c')](_0x2f455e);}})[_0x555f('0x21')](function(_0x29197c){if(_0x29197c){_0x48ac37=_0x29197c[_0x555f('0x32')];if(!_0x84eeab[_0x555f('0x2d')][_0x555f('0x33')](_0x555f('0x34'))){_0x2f455e[_0x555f('0x1a')]=qs['limit'](_0x84eeab['query'][_0x555f('0x1a')]);_0x2f455e['offset']=qs[_0x555f('0x18')](_0x84eeab['query'][_0x555f('0x18')]);}return _0x23390b[_0x555f('0x4c')](_0x2f455e);}})['then'](function(_0x10df51){if(_0x10df51){return _0x10df51?{'count':_0x48ac37,'rows':_0x10df51}:null;}})[_0x555f('0x21')](respondWithResult(_0x518aca,null))[_0x555f('0x41')](handleError(_0x518aca,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js index c0b67f0..1548d84 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 _0xb4e6=['path','rimraf','./intDynamics365Configuration.attributes','exports','define','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x44be5d,_0x3be750){var _0x12dc84=function(_0x88122a){while(--_0x88122a){_0x44be5d['push'](_0x44be5d['shift']());}};_0x12dc84(++_0x3be750);}(_0xb4e6,0x1f4));var _0x6b4e=function(_0x52e0ee,_0x52f7c1){_0x52e0ee=_0x52e0ee-0x0;var _0x32534c=_0xb4e6[_0x52e0ee];return _0x32534c;};'use strict';var _=require(_0x6b4e('0x0'));var util=require('util');var logger=require(_0x6b4e('0x1'))(_0x6b4e('0x2'));var moment=require(_0x6b4e('0x3'));var BPromise=require(_0x6b4e('0x4'));var rp=require(_0x6b4e('0x5'));var fs=require('fs');var path=require(_0x6b4e('0x6'));var rimraf=require(_0x6b4e('0x7'));var config=require('../../config/environment');var attributes=require(_0x6b4e('0x8'));module[_0x6b4e('0x9')]=function(_0x1f67a2,_0x49de51){return _0x1f67a2[_0x6b4e('0xa')]('Dynamics365Configuration',attributes,{'tableName':'int_dynamics365_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6f0d=['./intDynamics365Configuration.attributes','define','Dynamics365Configuration','int_dynamics365_configurations','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment'];(function(_0x178e48,_0x3c9509){var _0x440d7e=function(_0xc2f8a0){while(--_0xc2f8a0){_0x178e48['push'](_0x178e48['shift']());}};_0x440d7e(++_0x3c9509);}(_0x6f0d,0x16c));var _0xd6f0=function(_0x40e590,_0x22d302){_0x40e590=_0x40e590-0x0;var _0x557a35=_0x6f0d[_0x40e590];return _0x557a35;};'use strict';var _=require('lodash');var util=require(_0xd6f0('0x0'));var logger=require(_0xd6f0('0x1'))(_0xd6f0('0x2'));var moment=require(_0xd6f0('0x3'));var BPromise=require('bluebird');var rp=require(_0xd6f0('0x4'));var fs=require('fs');var path=require(_0xd6f0('0x5'));var rimraf=require(_0xd6f0('0x6'));var config=require(_0xd6f0('0x7'));var attributes=require(_0xd6f0('0x8'));module['exports']=function(_0x2d2ce6,_0x4a8b0c){return _0x2d2ce6[_0xd6f0('0x9')](_0xd6f0('0xa'),attributes,{'tableName':_0xd6f0('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.rpc.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.rpc.js index a6e5ec9..0e5fd62 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 _0x5a17=['result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','stringify','error','code','Dynamics365Configuration,\x20%s,\x20%s','message'];(function(_0x1e393b,_0x355f6b){var _0x3d0bfe=function(_0x320830){while(--_0x320830){_0x1e393b['push'](_0x1e393b['shift']());}};_0x3d0bfe(++_0x355f6b);}(_0x5a17,0x120));var _0x75a1=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5a17[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x75a1('0x0'));var util=require(_0x75a1('0x1'));var moment=require(_0x75a1('0x2'));var BPromise=require(_0x75a1('0x3'));var rs=require(_0x75a1('0x4'));var fs=require('fs');var Redis=require(_0x75a1('0x5'));var db=require(_0x75a1('0x6'))['db'];var utils=require(_0x75a1('0x7'));var logger=require(_0x75a1('0x8'))('rpc');var config=require(_0x75a1('0x9'));var jayson=require(_0x75a1('0xa'));var client=jayson[_0x75a1('0xb')][_0x75a1('0xc')]({'port':0x232a});function respondWithRpcPromise(_0xd78913,_0x581ac4,_0x20c9c1){return new BPromise(function(_0x275c02,_0x1b0cb3){return client[_0x75a1('0xd')](_0xd78913,_0x20c9c1)[_0x75a1('0xe')](function(_0x2d4bd4){logger[_0x75a1('0xf')]('Dynamics365Configuration,\x20%s,\x20%s',_0x581ac4,_0x75a1('0x10'));logger[_0x75a1('0x11')](_0x75a1('0x12'),_0x581ac4,_0x75a1('0x10'),JSON[_0x75a1('0x13')](_0x2d4bd4));if(_0x2d4bd4[_0x75a1('0x14')]){if(_0x2d4bd4[_0x75a1('0x14')][_0x75a1('0x15')]===0x1f4){logger[_0x75a1('0x14')](_0x75a1('0x16'),_0x581ac4,_0x2d4bd4[_0x75a1('0x14')][_0x75a1('0x17')]);return _0x1b0cb3(_0x2d4bd4[_0x75a1('0x14')][_0x75a1('0x17')]);}logger['error'](_0x75a1('0x16'),_0x581ac4,_0x2d4bd4[_0x75a1('0x14')]['message']);return _0x275c02(_0x2d4bd4[_0x75a1('0x14')][_0x75a1('0x17')]);}else{logger[_0x75a1('0xf')](_0x75a1('0x16'),_0x581ac4,_0x75a1('0x10'));_0x275c02(_0x2d4bd4[_0x75a1('0x18')][_0x75a1('0x17')]);}})[_0x75a1('0x19')](function(_0x577fec){logger['error']('Dynamics365Configuration,\x20%s,\x20%s',_0x581ac4,_0x577fec);_0x1b0cb3(_0x577fec);});});} \ No newline at end of file +var _0xef31=['../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','Dynamics365Configuration,\x20%s,\x20%s','debug','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','util','bluebird','ioredis'];(function(_0x49b93a,_0x1dd1e4){var _0x110531=function(_0x57e046){while(--_0x57e046){_0x49b93a['push'](_0x49b93a['shift']());}};_0x110531(++_0x1dd1e4);}(_0xef31,0x90));var _0x1ef3=function(_0x2ddf02,_0x4f7625){_0x2ddf02=_0x2ddf02-0x0;var _0xaf614e=_0xef31[_0x2ddf02];return _0xaf614e;};'use strict';var _=require('lodash');var util=require(_0x1ef3('0x0'));var moment=require('moment');var BPromise=require(_0x1ef3('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1ef3('0x2'));var db=require(_0x1ef3('0x3'))['db'];var utils=require(_0x1ef3('0x4'));var logger=require('../../config/logger')(_0x1ef3('0x5'));var config=require(_0x1ef3('0x6'));var jayson=require(_0x1ef3('0x7'));var client=jayson[_0x1ef3('0x8')][_0x1ef3('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x415458,_0x39ac88,_0x1fa7b0){return new BPromise(function(_0x30911a,_0x542436){return client[_0x1ef3('0xa')](_0x415458,_0x1fa7b0)[_0x1ef3('0xb')](function(_0x37a3f2){logger['info'](_0x1ef3('0xc'),_0x39ac88,'request\x20sent');logger[_0x1ef3('0xd')](_0x1ef3('0xe'),_0x39ac88,_0x1ef3('0xf'),JSON[_0x1ef3('0x10')](_0x37a3f2));if(_0x37a3f2['error']){if(_0x37a3f2[_0x1ef3('0x11')][_0x1ef3('0x12')]===0x1f4){logger['error']('Dynamics365Configuration,\x20%s,\x20%s',_0x39ac88,_0x37a3f2['error'][_0x1ef3('0x13')]);return _0x542436(_0x37a3f2[_0x1ef3('0x11')][_0x1ef3('0x13')]);}logger[_0x1ef3('0x11')](_0x1ef3('0xc'),_0x39ac88,_0x37a3f2['error']['message']);return _0x30911a(_0x37a3f2['error'][_0x1ef3('0x13')]);}else{logger['info'](_0x1ef3('0xc'),_0x39ac88,_0x1ef3('0xf'));_0x30911a(_0x37a3f2['result'][_0x1ef3('0x13')]);}})[_0x1ef3('0x14')](function(_0x174274){logger[_0x1ef3('0x11')]('Dynamics365Configuration,\x20%s,\x20%s',_0x39ac88,_0x174274);_0x542436(_0x174274);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Field/index.js b/server/api/intDynamics365Field/index.js index 5c365ac..88b3241 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 _0x5e6b=['path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Field.controller','get','/:id','isAuthenticated','show','post','create','exports','multer','util'];(function(_0x166d82,_0x3c2401){var _0x4db1cf=function(_0x51b86f){while(--_0x51b86f){_0x166d82['push'](_0x166d82['shift']());}};_0x4db1cf(++_0x3c2401);}(_0x5e6b,0x10e));var _0xb5e6=function(_0x1b6186,_0x1ec7f2){_0x1b6186=_0x1b6186-0x0;var _0x186121=_0x5e6b[_0x1b6186];return _0x186121;};'use strict';var multer=require(_0xb5e6('0x0'));var util=require(_0xb5e6('0x1'));var path=require(_0xb5e6('0x2'));var timeout=require('connect-timeout');var express=require(_0xb5e6('0x3'));var router=express[_0xb5e6('0x4')]();var fs_extra=require(_0xb5e6('0x5'));var auth=require(_0xb5e6('0x6'));var interaction=require(_0xb5e6('0x7'));var config=require(_0xb5e6('0x8'));var controller=require(_0xb5e6('0x9'));router[_0xb5e6('0xa')]('/',auth['isAuthenticated'](),controller['index']);router[_0xb5e6('0xa')](_0xb5e6('0xb'),auth[_0xb5e6('0xc')](),controller[_0xb5e6('0xd')]);router[_0xb5e6('0xe')]('/',auth[_0xb5e6('0xc')](),controller[_0xb5e6('0xf')]);router['put']('/:id',auth[_0xb5e6('0xc')](),controller['update']);router['delete']('/:id',auth[_0xb5e6('0xc')](),controller['destroy']);module[_0xb5e6('0x10')]=router; \ No newline at end of file +var _0xacaf=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','/:id','isAuthenticated','show','update','delete','destroy','multer','util','path','connect-timeout','Router'];(function(_0x1694f5,_0x49b7c3){var _0x5b4321=function(_0x58c183){while(--_0x58c183){_0x1694f5['push'](_0x1694f5['shift']());}};_0x5b4321(++_0x49b7c3);}(_0xacaf,0x9b));var _0xfaca=function(_0x3fe393,_0x234a3a){_0x3fe393=_0x3fe393-0x0;var _0x534d14=_0xacaf[_0x3fe393];return _0x534d14;};'use strict';var multer=require(_0xfaca('0x0'));var util=require(_0xfaca('0x1'));var path=require(_0xfaca('0x2'));var timeout=require(_0xfaca('0x3'));var express=require('express');var router=express[_0xfaca('0x4')]();var fs_extra=require(_0xfaca('0x5'));var auth=require(_0xfaca('0x6'));var interaction=require(_0xfaca('0x7'));var config=require(_0xfaca('0x8'));var controller=require('./intDynamics365Field.controller');router[_0xfaca('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0xfaca('0x9')](_0xfaca('0xa'),auth[_0xfaca('0xb')](),controller[_0xfaca('0xc')]);router['post']('/',auth[_0xfaca('0xb')](),controller['create']);router['put'](_0xfaca('0xa'),auth['isAuthenticated'](),controller[_0xfaca('0xd')]);router[_0xfaca('0xe')]('/:id',auth[_0xfaca('0xb')](),controller[_0xfaca('0xf')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.attributes.js b/server/api/intDynamics365Field/intDynamics365Field.attributes.js index d452459..8389209 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 _0x7590=['keyValue','STRING','BOOLEAN','exports','ENUM','string','variable','customVariable'];(function(_0x5a98a5,_0x30bc7e){var _0x569df1=function(_0x2cd77d){while(--_0x2cd77d){_0x5a98a5['push'](_0x5a98a5['shift']());}};_0x569df1(++_0x30bc7e);}(_0x7590,0x73));var _0x0759=function(_0x381372,_0xf0a5a){_0x381372=_0x381372-0x0;var _0x4e959a=_0x7590[_0x381372];return _0x4e959a;};'use strict';var Sequelize=require('sequelize');module[_0x0759('0x0')]={'type':{'type':Sequelize[_0x0759('0x1')](_0x0759('0x2'),_0x0759('0x3'),_0x0759('0x4'),_0x0759('0x5'),'picklist'),'defaultValue':_0x0759('0x2')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x0759('0x1')](_0x0759('0x2'),_0x0759('0x3'),_0x0759('0x4'))},'keyContent':{'type':Sequelize[_0x0759('0x6')]},'idField':{'type':Sequelize[_0x0759('0x6')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x0759('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x448c=['variable','keyValue','picklist','STRING','customVariable','BOOLEAN','ENUM','string'];(function(_0x3916a1,_0x37de95){var _0x20e92a=function(_0x1c3a11){while(--_0x1c3a11){_0x3916a1['push'](_0x3916a1['shift']());}};_0x20e92a(++_0x37de95);}(_0x448c,0x1de));var _0xc448=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x448c[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize[_0xc448('0x0')](_0xc448('0x1'),_0xc448('0x2'),'customVariable',_0xc448('0x3'),_0xc448('0x4')),'defaultValue':_0xc448('0x1')},'content':{'type':Sequelize[_0xc448('0x5')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0xc448('0x0')]('string','variable',_0xc448('0x6'))},'keyContent':{'type':Sequelize[_0xc448('0x5')]},'idField':{'type':Sequelize[_0xc448('0x5')]},'nameField':{'type':Sequelize[_0xc448('0x5')]},'customField':{'type':Sequelize[_0xc448('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xc448('0x5')]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.controller.js b/server/api/intDynamics365Field/intDynamics365Field.controller.js index 1eacafe..854368e 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 _0x13fe=['path','sox','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','limit','count','set','Content-Range','json','apply','reject','then','stack','name','send','index','map','Dynamics365Field','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','where','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','keys','find','create','update','body','params','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util'];(function(_0x35d2d6,_0x14e944){var _0x1637d5=function(_0x327b04){while(--_0x327b04){_0x35d2d6['push'](_0x35d2d6['shift']());}};_0x1637d5(++_0x14e944);}(_0x13fe,0xdd));var _0xe13f=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x13fe[_0x2f5ac5];return _0x37c9a8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe13f('0x0'));var zipdir=require(_0xe13f('0x1'));var jsonpatch=require(_0xe13f('0x2'));var rp=require(_0xe13f('0x3'));var moment=require('moment');var BPromise=require(_0xe13f('0x4'));var Mustache=require(_0xe13f('0x5'));var util=require(_0xe13f('0x6'));var path=require(_0xe13f('0x7'));var sox=require(_0xe13f('0x8'));var csv=require('to-csv');var ejs=require(_0xe13f('0x9'));var fs=require('fs');var fs_extra=require(_0xe13f('0xa'));var _=require(_0xe13f('0xb'));var squel=require(_0xe13f('0xc'));var crypto=require(_0xe13f('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xe13f('0xe'));var Papa=require(_0xe13f('0xf'));var Redis=require(_0xe13f('0x10'));var authService=require(_0xe13f('0x11'));var qs=require(_0xe13f('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe13f('0x13'));var logger=require(_0xe13f('0x14'))('api');var utils=require(_0xe13f('0x15'));var config=require(_0xe13f('0x16'));var licenseUtil=require(_0xe13f('0x17'));var db=require(_0xe13f('0x18'))['db'];function respondWithStatusCode(_0x3b1b0c,_0xb1a55a){_0xb1a55a=_0xb1a55a||0xcc;return function(_0x5727c2){if(_0x5727c2){return _0x3b1b0c[_0xe13f('0x19')](_0xb1a55a);}return _0x3b1b0c[_0xe13f('0x1a')](_0xb1a55a)[_0xe13f('0x1b')]();};}function respondWithResult(_0x4492bb,_0x51bb8d){_0x51bb8d=_0x51bb8d||0xc8;return function(_0x3b5f8b){if(_0x3b5f8b){return _0x4492bb[_0xe13f('0x1a')](_0x51bb8d)['json'](_0x3b5f8b);}};}function respondWithFilteredResult(_0x186b2e,_0x12a6dd){return function(_0x5d5639){if(_0x5d5639){var _0x20cf34=typeof _0x12a6dd[_0xe13f('0x1c')]==='undefined'&&typeof _0x12a6dd[_0xe13f('0x1d')]==='undefined';var _0x1cf4d0=_0x5d5639[_0xe13f('0x1e')];var _0x42cf61=_0x20cf34?0x0:_0x12a6dd[_0xe13f('0x1c')];var _0x2fd3d0=_0x20cf34?_0x5d5639['count']:_0x12a6dd[_0xe13f('0x1c')]+_0x12a6dd[_0xe13f('0x1d')];var _0x1c5566;if(_0x2fd3d0>=_0x1cf4d0){_0x2fd3d0=_0x1cf4d0;_0x1c5566=0xc8;}else{_0x1c5566=0xce;}_0x186b2e[_0xe13f('0x1a')](_0x1c5566);return _0x186b2e[_0xe13f('0x1f')](_0xe13f('0x20'),_0x42cf61+'-'+_0x2fd3d0+'/'+_0x1cf4d0)[_0xe13f('0x21')](_0x5d5639);}return null;};}function patchUpdates(_0x2bb4f3){return function(_0x5dcbf3){try{jsonpatch[_0xe13f('0x22')](_0x5dcbf3,_0x2bb4f3,!![]);}catch(_0x4180f3){return BPromise[_0xe13f('0x23')](_0x4180f3);}return _0x5dcbf3['save']();};}function saveUpdates(_0x304b3e,_0x4bbfbb){return function(_0x251c5f){if(_0x251c5f){return _0x251c5f['update'](_0x304b3e)[_0xe13f('0x24')](function(_0x4b8550){return _0x4b8550;});}return null;};}function removeEntity(_0x4fa72a,_0x25f703){return function(_0x24a155){if(_0x24a155){return _0x24a155['destroy']()[_0xe13f('0x24')](function(){_0x4fa72a[_0xe13f('0x1a')](0xcc)[_0xe13f('0x1b')]();});}};}function handleEntityNotFound(_0x483f65,_0x9a27a3){return function(_0x2e9954){if(!_0x2e9954){_0x483f65[_0xe13f('0x19')](0x194);}return _0x2e9954;};}function handleError(_0x515b72,_0x158cc1){_0x158cc1=_0x158cc1||0x1f4;return function(_0x517619){logger['error'](_0x517619[_0xe13f('0x25')]);if(_0x517619[_0xe13f('0x26')]){delete _0x517619['name'];}_0x515b72['status'](_0x158cc1)[_0xe13f('0x27')](_0x517619);};}exports[_0xe13f('0x28')]=function(_0x196218,_0x4b050d){var _0x4c36be={},_0x4f39ec={},_0x2855ca={'count':0x0,'rows':[]};var _0x5b2149=_[_0xe13f('0x29')](db[_0xe13f('0x2a')][_0xe13f('0x2b')],function(_0x173701){return{'name':_0x173701[_0xe13f('0x2c')],'type':_0x173701[_0xe13f('0x2d')][_0xe13f('0x2e')]};});_0x4f39ec[_0xe13f('0x2f')]=_[_0xe13f('0x29')](_0x5b2149,_0xe13f('0x26'));_0x4f39ec[_0xe13f('0x30')]=_['keys'](_0x196218[_0xe13f('0x30')]);_0x4f39ec[_0xe13f('0x31')]=_[_0xe13f('0x32')](_0x4f39ec[_0xe13f('0x2f')],_0x4f39ec[_0xe13f('0x30')]);_0x4c36be['attributes']=_[_0xe13f('0x32')](_0x4f39ec['model'],qs[_0xe13f('0x33')](_0x196218[_0xe13f('0x30')][_0xe13f('0x33')]));_0x4c36be[_0xe13f('0x34')]=_0x4c36be[_0xe13f('0x34')][_0xe13f('0x35')]?_0x4c36be[_0xe13f('0x34')]:_0x4f39ec['model'];if(!_0x196218[_0xe13f('0x30')][_0xe13f('0x36')](_0xe13f('0x37'))){_0x4c36be[_0xe13f('0x1d')]=qs['limit'](_0x196218[_0xe13f('0x30')][_0xe13f('0x1d')]);_0x4c36be['offset']=qs[_0xe13f('0x1c')](_0x196218[_0xe13f('0x30')][_0xe13f('0x1c')]);}_0x4c36be[_0xe13f('0x38')]=qs[_0xe13f('0x39')](_0x196218[_0xe13f('0x30')]['sort']);_0x4c36be['where']=qs[_0xe13f('0x31')](_[_0xe13f('0x3a')](_0x196218[_0xe13f('0x30')],_0x4f39ec['filters']),_0x5b2149);if(_0x196218[_0xe13f('0x30')]['filter']){_0x4c36be[_0xe13f('0x3b')]=_[_0xe13f('0x3c')](_0x4c36be[_0xe13f('0x3b')],{'$or':_['map'](_0x5b2149,function(_0x240186){if(_0x240186['type']!==_0xe13f('0x3d')){var _0x220290={};_0x220290[_0x240186[_0xe13f('0x26')]]={'$like':'%'+_0x196218[_0xe13f('0x30')][_0xe13f('0x3e')]+'%'};return _0x220290;}})});}_0x4c36be=_[_0xe13f('0x3c')]({},_0x4c36be,_0x196218[_0xe13f('0x3f')]);var _0x438f19={'where':_0x4c36be[_0xe13f('0x3b')]};return db[_0xe13f('0x2a')][_0xe13f('0x1e')](_0x438f19)[_0xe13f('0x24')](function(_0x2b4101){_0x2855ca[_0xe13f('0x1e')]=_0x2b4101;if(_0x196218[_0xe13f('0x30')][_0xe13f('0x40')]){_0x4c36be[_0xe13f('0x41')]=[{'all':!![]}];}return db[_0xe13f('0x2a')][_0xe13f('0x42')](_0x4c36be);})['then'](function(_0xd8af0d){_0x2855ca[_0xe13f('0x43')]=_0xd8af0d;return _0x2855ca;})[_0xe13f('0x24')](respondWithFilteredResult(_0x4b050d,_0x4c36be))[_0xe13f('0x44')](handleError(_0x4b050d,null));};exports[_0xe13f('0x45')]=function(_0x1eed4e,_0x4a7e85){var _0x1195f3={'raw':!![],'where':{'id':_0x1eed4e['params']['id']}},_0x3af535={};_0x3af535[_0xe13f('0x2f')]=_[_0xe13f('0x46')](db['Dynamics365Field'][_0xe13f('0x2b')]);_0x3af535[_0xe13f('0x30')]=_[_0xe13f('0x46')](_0x1eed4e[_0xe13f('0x30')]);_0x3af535[_0xe13f('0x31')]=_[_0xe13f('0x32')](_0x3af535[_0xe13f('0x2f')],_0x3af535[_0xe13f('0x30')]);_0x1195f3[_0xe13f('0x34')]=_[_0xe13f('0x32')](_0x3af535[_0xe13f('0x2f')],qs[_0xe13f('0x33')](_0x1eed4e[_0xe13f('0x30')][_0xe13f('0x33')]));_0x1195f3[_0xe13f('0x34')]=_0x1195f3[_0xe13f('0x34')][_0xe13f('0x35')]?_0x1195f3[_0xe13f('0x34')]:_0x3af535[_0xe13f('0x2f')];if(_0x1eed4e[_0xe13f('0x30')]['includeAll']){_0x1195f3[_0xe13f('0x41')]=[{'all':!![]}];}_0x1195f3=_[_0xe13f('0x3c')]({},_0x1195f3,_0x1eed4e[_0xe13f('0x3f')]);return db[_0xe13f('0x2a')][_0xe13f('0x47')](_0x1195f3)[_0xe13f('0x24')](handleEntityNotFound(_0x4a7e85,null))[_0xe13f('0x24')](respondWithResult(_0x4a7e85,null))[_0xe13f('0x44')](handleError(_0x4a7e85,null));};exports[_0xe13f('0x48')]=function(_0x1e1c1c,_0x44cfac){return db['Dynamics365Field'][_0xe13f('0x48')](_0x1e1c1c['body'],{})['then'](respondWithResult(_0x44cfac,0xc9))[_0xe13f('0x44')](handleError(_0x44cfac,null));};exports[_0xe13f('0x49')]=function(_0x257558,_0x10bd00){if(_0x257558[_0xe13f('0x4a')]['id']){delete _0x257558[_0xe13f('0x4a')]['id'];}return db['Dynamics365Field']['find']({'where':{'id':_0x257558['params']['id']}})[_0xe13f('0x24')](handleEntityNotFound(_0x10bd00,null))[_0xe13f('0x24')](saveUpdates(_0x257558[_0xe13f('0x4a')],null))[_0xe13f('0x24')](respondWithResult(_0x10bd00,null))[_0xe13f('0x44')](handleError(_0x10bd00,null));};exports['destroy']=function(_0x2de5dd,_0x1bf18c){return db[_0xe13f('0x2a')][_0xe13f('0x47')]({'where':{'id':_0x2de5dd[_0xe13f('0x4b')]['id']}})[_0xe13f('0x24')](handleEntityNotFound(_0x1bf18c,null))[_0xe13f('0x24')](removeEntity(_0x1bf18c,null))[_0xe13f('0x44')](handleError(_0x1bf18c,null));}; \ No newline at end of file +var _0x1a73=['querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','Dynamics365Field','rawAttributes','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','VIRTUAL','filter','merge','options','includeAll','include','findAll','rows','catch','params','create','body','find','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','crypto','jsforce'];(function(_0x2b4411,_0x2625ed){var _0x8e41ef=function(_0x2aa8c1){while(--_0x2aa8c1){_0x2b4411['push'](_0x2b4411['shift']());}};_0x8e41ef(++_0x2625ed);}(_0x1a73,0x1ae));var _0x31a7=function(_0x54da77,_0x3cc6f3){_0x54da77=_0x54da77-0x0;var _0x1cda6f=_0x1a73[_0x54da77];return _0x1cda6f;};'use strict';var emlformat=require(_0x31a7('0x0'));var rimraf=require(_0x31a7('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x31a7('0x2'));var rp=require(_0x31a7('0x3'));var moment=require(_0x31a7('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x31a7('0x5'));var util=require(_0x31a7('0x6'));var path=require(_0x31a7('0x7'));var sox=require(_0x31a7('0x8'));var csv=require(_0x31a7('0x9'));var ejs=require(_0x31a7('0xa'));var fs=require('fs');var fs_extra=require(_0x31a7('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x31a7('0xc'));var jsforce=require(_0x31a7('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x31a7('0xe'));var Papa=require('papaparse');var Redis=require(_0x31a7('0xf'));var authService=require(_0x31a7('0x10'));var qs=require(_0x31a7('0x11'));var as=require(_0x31a7('0x12'));var hardwareService=require(_0x31a7('0x13'));var logger=require(_0x31a7('0x14'))('api');var utils=require(_0x31a7('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x31a7('0x16'))['db'];function respondWithStatusCode(_0x4558f3,_0x55e884){_0x55e884=_0x55e884||0xcc;return function(_0x5c7e6a){if(_0x5c7e6a){return _0x4558f3[_0x31a7('0x17')](_0x55e884);}return _0x4558f3[_0x31a7('0x18')](_0x55e884)[_0x31a7('0x19')]();};}function respondWithResult(_0x786fe4,_0x1bd949){_0x1bd949=_0x1bd949||0xc8;return function(_0x2e0b1d){if(_0x2e0b1d){return _0x786fe4['status'](_0x1bd949)[_0x31a7('0x1a')](_0x2e0b1d);}};}function respondWithFilteredResult(_0x516c98,_0x54ef40){return function(_0x2610ea){if(_0x2610ea){var _0x47a7eb=typeof _0x54ef40[_0x31a7('0x1b')]===_0x31a7('0x1c')&&typeof _0x54ef40[_0x31a7('0x1d')]===_0x31a7('0x1c');var _0x54a7b0=_0x2610ea[_0x31a7('0x1e')];var _0x165530=_0x47a7eb?0x0:_0x54ef40[_0x31a7('0x1b')];var _0xd600d1=_0x47a7eb?_0x2610ea[_0x31a7('0x1e')]:_0x54ef40[_0x31a7('0x1b')]+_0x54ef40[_0x31a7('0x1d')];var _0x47e0d6;if(_0xd600d1>=_0x54a7b0){_0xd600d1=_0x54a7b0;_0x47e0d6=0xc8;}else{_0x47e0d6=0xce;}_0x516c98[_0x31a7('0x18')](_0x47e0d6);return _0x516c98[_0x31a7('0x1f')]('Content-Range',_0x165530+'-'+_0xd600d1+'/'+_0x54a7b0)['json'](_0x2610ea);}return null;};}function patchUpdates(_0x4cb0e5){return function(_0x2ab0c5){try{jsonpatch[_0x31a7('0x20')](_0x2ab0c5,_0x4cb0e5,!![]);}catch(_0x460d94){return BPromise[_0x31a7('0x21')](_0x460d94);}return _0x2ab0c5[_0x31a7('0x22')]();};}function saveUpdates(_0x785b87,_0x2d8895){return function(_0x12b7bb){if(_0x12b7bb){return _0x12b7bb[_0x31a7('0x23')](_0x785b87)[_0x31a7('0x24')](function(_0x100416){return _0x100416;});}return null;};}function removeEntity(_0x2fa29c,_0x949dfa){return function(_0x3e857e){if(_0x3e857e){return _0x3e857e[_0x31a7('0x25')]()['then'](function(){_0x2fa29c[_0x31a7('0x18')](0xcc)[_0x31a7('0x19')]();});}};}function handleEntityNotFound(_0x4780a1,_0x129966){return function(_0x2f030c){if(!_0x2f030c){_0x4780a1[_0x31a7('0x17')](0x194);}return _0x2f030c;};}function handleError(_0x1a6fe5,_0x4c8826){_0x4c8826=_0x4c8826||0x1f4;return function(_0x30fbea){logger[_0x31a7('0x26')](_0x30fbea[_0x31a7('0x27')]);if(_0x30fbea['name']){delete _0x30fbea[_0x31a7('0x28')];}_0x1a6fe5[_0x31a7('0x18')](_0x4c8826)[_0x31a7('0x29')](_0x30fbea);};}exports[_0x31a7('0x2a')]=function(_0x386dde,_0x462a47){var _0x552d04={},_0x4c081d={},_0x23c12f={'count':0x0,'rows':[]};var _0x26da52=_[_0x31a7('0x2b')](db[_0x31a7('0x2c')][_0x31a7('0x2d')],function(_0x39fb15){return{'name':_0x39fb15['fieldName'],'type':_0x39fb15[_0x31a7('0x2e')][_0x31a7('0x2f')]};});_0x4c081d[_0x31a7('0x30')]=_['map'](_0x26da52,_0x31a7('0x28'));_0x4c081d[_0x31a7('0x31')]=_[_0x31a7('0x32')](_0x386dde[_0x31a7('0x31')]);_0x4c081d['filters']=_[_0x31a7('0x33')](_0x4c081d[_0x31a7('0x30')],_0x4c081d[_0x31a7('0x31')]);_0x552d04[_0x31a7('0x34')]=_[_0x31a7('0x33')](_0x4c081d[_0x31a7('0x30')],qs[_0x31a7('0x35')](_0x386dde[_0x31a7('0x31')]['fields']));_0x552d04[_0x31a7('0x34')]=_0x552d04[_0x31a7('0x34')][_0x31a7('0x36')]?_0x552d04[_0x31a7('0x34')]:_0x4c081d['model'];if(!_0x386dde[_0x31a7('0x31')][_0x31a7('0x37')](_0x31a7('0x38'))){_0x552d04[_0x31a7('0x1d')]=qs['limit'](_0x386dde[_0x31a7('0x31')][_0x31a7('0x1d')]);_0x552d04[_0x31a7('0x1b')]=qs[_0x31a7('0x1b')](_0x386dde[_0x31a7('0x31')][_0x31a7('0x1b')]);}_0x552d04[_0x31a7('0x39')]=qs[_0x31a7('0x3a')](_0x386dde[_0x31a7('0x31')][_0x31a7('0x3a')]);_0x552d04[_0x31a7('0x3b')]=qs[_0x31a7('0x3c')](_['pick'](_0x386dde[_0x31a7('0x31')],_0x4c081d[_0x31a7('0x3c')]),_0x26da52);if(_0x386dde[_0x31a7('0x31')]['filter']){_0x552d04[_0x31a7('0x3b')]=_['merge'](_0x552d04[_0x31a7('0x3b')],{'$or':_[_0x31a7('0x2b')](_0x26da52,function(_0x401d61){if(_0x401d61['type']!==_0x31a7('0x3d')){var _0x7d6636={};_0x7d6636[_0x401d61['name']]={'$like':'%'+_0x386dde[_0x31a7('0x31')][_0x31a7('0x3e')]+'%'};return _0x7d6636;}})});}_0x552d04=_[_0x31a7('0x3f')]({},_0x552d04,_0x386dde[_0x31a7('0x40')]);var _0x414c16={'where':_0x552d04[_0x31a7('0x3b')]};return db[_0x31a7('0x2c')][_0x31a7('0x1e')](_0x414c16)[_0x31a7('0x24')](function(_0x2f7a09){_0x23c12f['count']=_0x2f7a09;if(_0x386dde['query'][_0x31a7('0x41')]){_0x552d04[_0x31a7('0x42')]=[{'all':!![]}];}return db[_0x31a7('0x2c')][_0x31a7('0x43')](_0x552d04);})[_0x31a7('0x24')](function(_0x2dfa9d){_0x23c12f[_0x31a7('0x44')]=_0x2dfa9d;return _0x23c12f;})['then'](respondWithFilteredResult(_0x462a47,_0x552d04))[_0x31a7('0x45')](handleError(_0x462a47,null));};exports['show']=function(_0x2df920,_0x560333){var _0x5be7e3={'raw':!![],'where':{'id':_0x2df920[_0x31a7('0x46')]['id']}},_0xd8082f={};_0xd8082f[_0x31a7('0x30')]=_[_0x31a7('0x32')](db['Dynamics365Field'][_0x31a7('0x2d')]);_0xd8082f[_0x31a7('0x31')]=_[_0x31a7('0x32')](_0x2df920[_0x31a7('0x31')]);_0xd8082f[_0x31a7('0x3c')]=_['intersection'](_0xd8082f[_0x31a7('0x30')],_0xd8082f['query']);_0x5be7e3[_0x31a7('0x34')]=_[_0x31a7('0x33')](_0xd8082f[_0x31a7('0x30')],qs[_0x31a7('0x35')](_0x2df920[_0x31a7('0x31')][_0x31a7('0x35')]));_0x5be7e3['attributes']=_0x5be7e3[_0x31a7('0x34')][_0x31a7('0x36')]?_0x5be7e3[_0x31a7('0x34')]:_0xd8082f[_0x31a7('0x30')];if(_0x2df920[_0x31a7('0x31')][_0x31a7('0x41')]){_0x5be7e3['include']=[{'all':!![]}];}_0x5be7e3=_['merge']({},_0x5be7e3,_0x2df920[_0x31a7('0x40')]);return db['Dynamics365Field']['find'](_0x5be7e3)['then'](handleEntityNotFound(_0x560333,null))[_0x31a7('0x24')](respondWithResult(_0x560333,null))[_0x31a7('0x45')](handleError(_0x560333,null));};exports[_0x31a7('0x47')]=function(_0x2d0d6d,_0x5a6ad4){return db[_0x31a7('0x2c')][_0x31a7('0x47')](_0x2d0d6d[_0x31a7('0x48')],{})[_0x31a7('0x24')](respondWithResult(_0x5a6ad4,0xc9))[_0x31a7('0x45')](handleError(_0x5a6ad4,null));};exports['update']=function(_0x461054,_0x498dea){if(_0x461054[_0x31a7('0x48')]['id']){delete _0x461054['body']['id'];}return db[_0x31a7('0x2c')]['find']({'where':{'id':_0x461054[_0x31a7('0x46')]['id']}})['then'](handleEntityNotFound(_0x498dea,null))[_0x31a7('0x24')](saveUpdates(_0x461054[_0x31a7('0x48')],null))[_0x31a7('0x24')](respondWithResult(_0x498dea,null))[_0x31a7('0x45')](handleError(_0x498dea,null));};exports[_0x31a7('0x25')]=function(_0x101c7f,_0x4e4709){return db[_0x31a7('0x2c')][_0x31a7('0x49')]({'where':{'id':_0x101c7f[_0x31a7('0x46')]['id']}})[_0x31a7('0x24')](handleEntityNotFound(_0x4e4709,null))[_0x31a7('0x24')](removeEntity(_0x4e4709,null))[_0x31a7('0x45')](handleError(_0x4e4709,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.model.js b/server/api/intDynamics365Field/intDynamics365Field.model.js index 788be66..167f1e1 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 _0xc285=['idField','FieldId','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./intDynamics365Field.attributes','define','Dynamics365Field','int_dynamics365_fields'];(function(_0x4029d4,_0x5a9d6c){var _0x344b1c=function(_0x1c2c8f){while(--_0x1c2c8f){_0x4029d4['push'](_0x4029d4['shift']());}};_0x344b1c(++_0x5a9d6c);}(_0xc285,0x17c));var _0x5c28=function(_0x216f28,_0x4a6bb6){_0x216f28=_0x216f28-0x0;var _0x529289=_0xc285[_0x216f28];return _0x529289;};'use strict';var _=require('lodash');var util=require(_0x5c28('0x0'));var logger=require(_0x5c28('0x1'))(_0x5c28('0x2'));var moment=require(_0x5c28('0x3'));var BPromise=require(_0x5c28('0x4'));var rp=require(_0x5c28('0x5'));var fs=require('fs');var path=require(_0x5c28('0x6'));var rimraf=require('rimraf');var config=require(_0x5c28('0x7'));var attributes=require(_0x5c28('0x8'));module['exports']=function(_0x1bcd78,_0x6c342a){return _0x1bcd78[_0x5c28('0x9')](_0x5c28('0xa'),attributes,{'tableName':_0x5c28('0xb'),'paranoid':![],'indexes':[{'name':'dynamics365_unique_index','fields':[_0x5c28('0xc'),_0x5c28('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x2b0f=['rimraf','../../config/environment','./intDynamics365Field.attributes','exports','define','Dynamics365Field','int_dynamics365_fields','dynamics365_unique_index','idField','FieldId','util','moment','path'];(function(_0x1ba1d3,_0x2e5da9){var _0x379716=function(_0x58079e){while(--_0x58079e){_0x1ba1d3['push'](_0x1ba1d3['shift']());}};_0x379716(++_0x2e5da9);}(_0x2b0f,0x99));var _0xf2b0=function(_0x39c352,_0x4989d5){_0x39c352=_0x39c352-0x0;var _0x582c90=_0x2b0f[_0x39c352];return _0x582c90;};'use strict';var _=require('lodash');var util=require(_0xf2b0('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0xf2b0('0x1'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xf2b0('0x2'));var rimraf=require(_0xf2b0('0x3'));var config=require(_0xf2b0('0x4'));var attributes=require(_0xf2b0('0x5'));module[_0xf2b0('0x6')]=function(_0x57d527,_0x1e1f77){return _0x57d527[_0xf2b0('0x7')](_0xf2b0('0x8'),attributes,{'tableName':_0xf2b0('0x9'),'paranoid':![],'indexes':[{'name':_0xf2b0('0xa'),'fields':[_0xf2b0('0xb'),_0xf2b0('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 ced803c..961607e 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 _0xa497=['info','request\x20sent','debug','stringify','error','code','message','Dynamics365Field,\x20%s,\x20%s','result','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','then'];(function(_0x2fe188,_0x447bf4){var _0x41ee01=function(_0x5dd74c){while(--_0x5dd74c){_0x2fe188['push'](_0x2fe188['shift']());}};_0x41ee01(++_0x447bf4);}(_0xa497,0x72));var _0x7a49=function(_0x521198,_0x530ecc){_0x521198=_0x521198-0x0;var _0x378d25=_0xa497[_0x521198];return _0x378d25;};'use strict';var _=require(_0x7a49('0x0'));var util=require(_0x7a49('0x1'));var moment=require(_0x7a49('0x2'));var BPromise=require(_0x7a49('0x3'));var rs=require(_0x7a49('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x7a49('0x5'));var logger=require(_0x7a49('0x6'))(_0x7a49('0x7'));var config=require('../../config/environment');var jayson=require(_0x7a49('0x8'));var client=jayson[_0x7a49('0x9')][_0x7a49('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xda5c0b,_0x3fb0dc,_0xa7f9fb){return new BPromise(function(_0x324ada,_0x13930f){return client['request'](_0xda5c0b,_0xa7f9fb)[_0x7a49('0xb')](function(_0x1a4ed8){logger[_0x7a49('0xc')]('Dynamics365Field,\x20%s,\x20%s',_0x3fb0dc,_0x7a49('0xd'));logger[_0x7a49('0xe')]('Dynamics365Field,\x20%s,\x20%s,\x20%s',_0x3fb0dc,'request\x20sent',JSON[_0x7a49('0xf')](_0x1a4ed8));if(_0x1a4ed8[_0x7a49('0x10')]){if(_0x1a4ed8[_0x7a49('0x10')][_0x7a49('0x11')]===0x1f4){logger['error']('Dynamics365Field,\x20%s,\x20%s',_0x3fb0dc,_0x1a4ed8['error'][_0x7a49('0x12')]);return _0x13930f(_0x1a4ed8[_0x7a49('0x10')]['message']);}logger['error'](_0x7a49('0x13'),_0x3fb0dc,_0x1a4ed8[_0x7a49('0x10')][_0x7a49('0x12')]);return _0x324ada(_0x1a4ed8[_0x7a49('0x10')][_0x7a49('0x12')]);}else{logger[_0x7a49('0xc')](_0x7a49('0x13'),_0x3fb0dc,_0x7a49('0xd'));_0x324ada(_0x1a4ed8[_0x7a49('0x14')]['message']);}})['catch'](function(_0x1b7ad7){logger['error']('Dynamics365Field,\x20%s,\x20%s',_0x3fb0dc,_0x1b7ad7);_0x13930f(_0x1b7ad7);});});} \ No newline at end of file +var _0xf81f=['lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','jayson/promise','client','request','then','info','Dynamics365Field,\x20%s,\x20%s','request\x20sent','Dynamics365Field,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result'];(function(_0x2144f0,_0x152b4a){var _0x5c3cd9=function(_0xe528d3){while(--_0xe528d3){_0x2144f0['push'](_0x2144f0['shift']());}};_0x5c3cd9(++_0x152b4a);}(_0xf81f,0x93));var _0xff81=function(_0x39538a,_0x3aa7e8){_0x39538a=_0x39538a-0x0;var _0x129452=_0xf81f[_0x39538a];return _0x129452;};'use strict';var _=require(_0xff81('0x0'));var util=require(_0xff81('0x1'));var moment=require(_0xff81('0x2'));var BPromise=require(_0xff81('0x3'));var rs=require(_0xff81('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xff81('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xff81('0x6'))(_0xff81('0x7'));var config=require('../../config/environment');var jayson=require(_0xff81('0x8'));var client=jayson[_0xff81('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4e1049,_0x36be54,_0x19ed5e){return new BPromise(function(_0x394e92,_0x1b8e4d){return client[_0xff81('0xa')](_0x4e1049,_0x19ed5e)[_0xff81('0xb')](function(_0x149d89){logger[_0xff81('0xc')](_0xff81('0xd'),_0x36be54,_0xff81('0xe'));logger['debug'](_0xff81('0xf'),_0x36be54,'request\x20sent',JSON[_0xff81('0x10')](_0x149d89));if(_0x149d89['error']){if(_0x149d89['error'][_0xff81('0x11')]===0x1f4){logger['error'](_0xff81('0xd'),_0x36be54,_0x149d89[_0xff81('0x12')][_0xff81('0x13')]);return _0x1b8e4d(_0x149d89[_0xff81('0x12')][_0xff81('0x13')]);}logger[_0xff81('0x12')](_0xff81('0xd'),_0x36be54,_0x149d89['error']['message']);return _0x394e92(_0x149d89['error'][_0xff81('0x13')]);}else{logger[_0xff81('0xc')]('Dynamics365Field,\x20%s,\x20%s',_0x36be54,_0xff81('0xe'));_0x394e92(_0x149d89[_0xff81('0x14')][_0xff81('0x13')]);}})['catch'](function(_0x34ad62){logger['error']('Dynamics365Field,\x20%s,\x20%s',_0x36be54,_0x34ad62);_0x1b8e4d(_0x34ad62);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/index.js b/server/api/intFreshdeskAccount/index.js index b07b596..6712946 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 _0xe2bd=['post','create','put','update','destroy','exports','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskAccount.controller','isAuthenticated','index','get','/:id','show','/:id/configurations','getConfigurations','getFields'];(function(_0x318dae,_0x466e26){var _0x1f70ed=function(_0x280b26){while(--_0x280b26){_0x318dae['push'](_0x318dae['shift']());}};_0x1f70ed(++_0x466e26);}(_0xe2bd,0x1a4));var _0xde2b=function(_0x49675a,_0x3250b3){_0x49675a=_0x49675a-0x0;var _0xa8517f=_0xe2bd[_0x49675a];return _0xa8517f;};'use strict';var multer=require('multer');var util=require(_0xde2b('0x0'));var path=require(_0xde2b('0x1'));var timeout=require('connect-timeout');var express=require(_0xde2b('0x2'));var router=express[_0xde2b('0x3')]();var fs_extra=require(_0xde2b('0x4'));var auth=require(_0xde2b('0x5'));var interaction=require(_0xde2b('0x6'));var config=require(_0xde2b('0x7'));var controller=require(_0xde2b('0x8'));router['get']('/',auth[_0xde2b('0x9')](),controller[_0xde2b('0xa')]);router[_0xde2b('0xb')](_0xde2b('0xc'),auth[_0xde2b('0x9')](),controller[_0xde2b('0xd')]);router[_0xde2b('0xb')](_0xde2b('0xe'),auth[_0xde2b('0x9')](),controller[_0xde2b('0xf')]);router[_0xde2b('0xb')]('/:id/fields',auth[_0xde2b('0x9')](),controller[_0xde2b('0x10')]);router[_0xde2b('0x11')]('/',auth[_0xde2b('0x9')](),controller[_0xde2b('0x12')]);router[_0xde2b('0x11')](_0xde2b('0xe'),auth[_0xde2b('0x9')](),controller['addConfiguration']);router[_0xde2b('0x13')](_0xde2b('0xc'),auth['isAuthenticated'](),controller[_0xde2b('0x14')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xde2b('0x15')]);module[_0xde2b('0x16')]=router; \ No newline at end of file +var _0x26d0=['getConfigurations','/:id/fields','getFields','post','addConfiguration','put','update','exports','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskAccount.controller','index','get','/:id','isAuthenticated','show','/:id/configurations'];(function(_0x53e19d,_0x604957){var _0x5ba332=function(_0x34f66e){while(--_0x34f66e){_0x53e19d['push'](_0x53e19d['shift']());}};_0x5ba332(++_0x604957);}(_0x26d0,0x1aa));var _0x026d=function(_0x4711f4,_0x150948){_0x4711f4=_0x4711f4-0x0;var _0x14522d=_0x26d0[_0x4711f4];return _0x14522d;};'use strict';var multer=require('multer');var util=require(_0x026d('0x0'));var path=require(_0x026d('0x1'));var timeout=require(_0x026d('0x2'));var express=require('express');var router=express[_0x026d('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x026d('0x4'));var interaction=require(_0x026d('0x5'));var config=require(_0x026d('0x6'));var controller=require(_0x026d('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x026d('0x8')]);router[_0x026d('0x9')](_0x026d('0xa'),auth[_0x026d('0xb')](),controller[_0x026d('0xc')]);router[_0x026d('0x9')](_0x026d('0xd'),auth['isAuthenticated'](),controller[_0x026d('0xe')]);router[_0x026d('0x9')](_0x026d('0xf'),auth['isAuthenticated'](),controller[_0x026d('0x10')]);router[_0x026d('0x11')]('/',auth[_0x026d('0xb')](),controller['create']);router[_0x026d('0x11')](_0x026d('0xd'),auth[_0x026d('0xb')](),controller[_0x026d('0x12')]);router[_0x026d('0x13')]('/:id',auth['isAuthenticated'](),controller[_0x026d('0x14')]);router['delete'](_0x026d('0xa'),auth['isAuthenticated'](),controller['destroy']);module[_0x026d('0x15')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js index 37aa68b..eb77729 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 _0x4bd3=['sequelize','STRING','remoteUri'];(function(_0x4c4df3,_0x82a06f){var _0x356c8b=function(_0xe27241){while(--_0xe27241){_0x4c4df3['push'](_0x4c4df3['shift']());}};_0x356c8b(++_0x82a06f);}(_0x4bd3,0x174));var _0x34bd=function(_0x228ca4,_0x55488c){_0x228ca4=_0x228ca4-0x0;var _0x4916bd=_0x4bd3[_0x228ca4];return _0x4916bd;};'use strict';var Sequelize=require(_0x34bd('0x0'));module['exports']={'name':{'type':Sequelize[_0x34bd('0x1')]},'description':{'type':Sequelize[_0x34bd('0x1')]},'username':{'type':Sequelize['STRING'],'unique':'username'},'apiKey':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x34bd('0x1')],'unique':_0x34bd('0x2')},'serverUrl':{'type':Sequelize[_0x34bd('0x1')],'allowNull':![]}}; \ No newline at end of file +var _0xb145=['STRING','username','remoteUri','exports'];(function(_0x3de873,_0x174b5f){var _0x380b8c=function(_0x313dea){while(--_0x313dea){_0x3de873['push'](_0x3de873['shift']());}};_0x380b8c(++_0x174b5f);}(_0xb145,0xa3));var _0x5b14=function(_0x35d041,_0x2a6332){_0x35d041=_0x35d041-0x0;var _0x193712=_0xb145[_0x35d041];return _0x193712;};'use strict';var Sequelize=require('sequelize');module[_0x5b14('0x0')]={'name':{'type':Sequelize[_0x5b14('0x1')]},'description':{'type':Sequelize[_0x5b14('0x1')]},'username':{'type':Sequelize[_0x5b14('0x1')],'unique':_0x5b14('0x2')},'apiKey':{'type':Sequelize[_0x5b14('0x1')]},'remoteUri':{'type':Sequelize[_0x5b14('0x1')],'unique':_0x5b14('0x3')},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js index a6118f2..df59d1c 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 _0x9189=['undefined','limit','count','status','set','Content-Range','apply','save','update','then','destroy','error','stack','name','map','fieldName','type','key','model','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filter','where','VIRTUAL','merge','options','FreshdeskAccount','includeAll','findAll','show','params','rawAttributes','intersection','include','catch','create','body','find','findOne','getConfigurations','addConfiguration','AccountId','Subjects','getSubjects','channel','getDescriptions','FreshdeskConfiguration','FreshdeskField','Descriptions','getFields','apiKey','remoteUri','slice','substring','lastIndexOf','GET','format','Basic\x20%s','%s:X','toString','base64','requester','agent','description','priority','group','source','company','remove','includes','default','custom_text','custom_dropdown','label','choices','capitalize','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','send','Wrong\x20credentials','zip-dir','fast-json-patch','request-promise','moment','mustache','sox','to-csv','fs-extra','lodash','squel','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','end','json','offset'];(function(_0x2ed3a2,_0x5cc62a){var _0xf11bbc=function(_0x241d9d){while(--_0x241d9d){_0x2ed3a2['push'](_0x2ed3a2['shift']());}};_0xf11bbc(++_0x5cc62a);}(_0x9189,0x1b0));var _0x9918=function(_0x67a3b7,_0x237812){_0x67a3b7=_0x67a3b7-0x0;var _0x4da4b6=_0x9189[_0x67a3b7];return _0x4da4b6;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x9918('0x0'));var jsonpatch=require(_0x9918('0x1'));var rp=require(_0x9918('0x2'));var moment=require(_0x9918('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x9918('0x4'));var util=require('util');var path=require('path');var sox=require(_0x9918('0x5'));var csv=require(_0x9918('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9918('0x7'));var _=require(_0x9918('0x8'));var squel=require(_0x9918('0x9'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x9918('0x6'));var querystring=require(_0x9918('0xa'));var Papa=require('papaparse');var Redis=require(_0x9918('0xb'));var authService=require('../../components/auth/service');var qs=require(_0x9918('0xc'));var as=require(_0x9918('0xd'));var hardwareService=require(_0x9918('0xe'));var logger=require(_0x9918('0xf'))(_0x9918('0x10'));var utils=require(_0x9918('0x11'));var config=require(_0x9918('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0x9918('0x13'))['db'];var integrations=require(_0x9918('0x14'));function respondWithStatusCode(_0x548f67,_0x511a2c){_0x511a2c=_0x511a2c||0xcc;return function(_0x43fc75){if(_0x43fc75){return _0x548f67['sendStatus'](_0x511a2c);}return _0x548f67['status'](_0x511a2c)[_0x9918('0x15')]();};}function respondWithResult(_0x38f36a,_0x53e3e9){_0x53e3e9=_0x53e3e9||0xc8;return function(_0x2d6c1c){if(_0x2d6c1c){return _0x38f36a['status'](_0x53e3e9)[_0x9918('0x16')](_0x2d6c1c);}};}function respondWithFilteredResult(_0x27fbe7,_0x2a2347){return function(_0x420db0){if(_0x420db0){var _0x90a6cc=typeof _0x2a2347[_0x9918('0x17')]===_0x9918('0x18')&&typeof _0x2a2347[_0x9918('0x19')]===_0x9918('0x18');var _0x4dea8c=_0x420db0[_0x9918('0x1a')];var _0x2a915c=_0x90a6cc?0x0:_0x2a2347[_0x9918('0x17')];var _0x132c22=_0x90a6cc?_0x420db0[_0x9918('0x1a')]:_0x2a2347[_0x9918('0x17')]+_0x2a2347[_0x9918('0x19')];var _0x11e949;if(_0x132c22>=_0x4dea8c){_0x132c22=_0x4dea8c;_0x11e949=0xc8;}else{_0x11e949=0xce;}_0x27fbe7[_0x9918('0x1b')](_0x11e949);return _0x27fbe7[_0x9918('0x1c')](_0x9918('0x1d'),_0x2a915c+'-'+_0x132c22+'/'+_0x4dea8c)[_0x9918('0x16')](_0x420db0);}return null;};}function patchUpdates(_0x1af6cf){return function(_0x45e23d){try{jsonpatch[_0x9918('0x1e')](_0x45e23d,_0x1af6cf,!![]);}catch(_0x10e513){return BPromise['reject'](_0x10e513);}return _0x45e23d[_0x9918('0x1f')]();};}function saveUpdates(_0x1f0bca,_0x24ff02){return function(_0x4dd16f){if(_0x4dd16f){return _0x4dd16f[_0x9918('0x20')](_0x1f0bca)[_0x9918('0x21')](function(_0x44893d){return _0x44893d;});}return null;};}function removeEntity(_0x4562aa,_0x44691e){return function(_0x19f897){if(_0x19f897){return _0x19f897[_0x9918('0x22')]()[_0x9918('0x21')](function(){_0x4562aa[_0x9918('0x1b')](0xcc)[_0x9918('0x15')]();});}};}function handleEntityNotFound(_0xfd8814,_0x22f7aa){return function(_0x217785){if(!_0x217785){_0xfd8814['sendStatus'](0x194);}return _0x217785;};}function handleError(_0x12064f,_0x345dfb){_0x345dfb=_0x345dfb||0x1f4;return function(_0x21c275){logger[_0x9918('0x23')](_0x21c275[_0x9918('0x24')]);if(_0x21c275[_0x9918('0x25')]){delete _0x21c275[_0x9918('0x25')];}_0x12064f[_0x9918('0x1b')](_0x345dfb)['send'](_0x21c275);};}exports['index']=function(_0x1736b3,_0x4fb6e6){var _0x541d4e={},_0x753ecc={},_0x4b07d4={'count':0x0,'rows':[]};var _0x2ddec9=_[_0x9918('0x26')](db['FreshdeskAccount']['rawAttributes'],function(_0x321f6d){return{'name':_0x321f6d[_0x9918('0x27')],'type':_0x321f6d[_0x9918('0x28')][_0x9918('0x29')]};});_0x753ecc[_0x9918('0x2a')]=_['map'](_0x2ddec9,_0x9918('0x25'));_0x753ecc[_0x9918('0x2b')]=_[_0x9918('0x2c')](_0x1736b3[_0x9918('0x2b')]);_0x753ecc[_0x9918('0x2d')]=_['intersection'](_0x753ecc[_0x9918('0x2a')],_0x753ecc['query']);_0x541d4e[_0x9918('0x2e')]=_['intersection'](_0x753ecc[_0x9918('0x2a')],qs[_0x9918('0x2f')](_0x1736b3[_0x9918('0x2b')][_0x9918('0x2f')]));_0x541d4e[_0x9918('0x2e')]=_0x541d4e[_0x9918('0x2e')][_0x9918('0x30')]?_0x541d4e[_0x9918('0x2e')]:_0x753ecc[_0x9918('0x2a')];if(!_0x1736b3['query'][_0x9918('0x31')](_0x9918('0x32'))){_0x541d4e[_0x9918('0x19')]=qs[_0x9918('0x19')](_0x1736b3[_0x9918('0x2b')][_0x9918('0x19')]);_0x541d4e[_0x9918('0x17')]=qs[_0x9918('0x17')](_0x1736b3['query']['offset']);}_0x541d4e[_0x9918('0x33')]=qs[_0x9918('0x34')](_0x1736b3[_0x9918('0x2b')][_0x9918('0x34')]);_0x541d4e['where']=qs[_0x9918('0x2d')](_['pick'](_0x1736b3[_0x9918('0x2b')],_0x753ecc[_0x9918('0x2d')]),_0x2ddec9);if(_0x1736b3[_0x9918('0x2b')][_0x9918('0x35')]){_0x541d4e['where']=_['merge'](_0x541d4e[_0x9918('0x36')],{'$or':_[_0x9918('0x26')](_0x2ddec9,function(_0x4c9106){if(_0x4c9106[_0x9918('0x28')]!==_0x9918('0x37')){var _0x3aaeec={};_0x3aaeec[_0x4c9106[_0x9918('0x25')]]={'$like':'%'+_0x1736b3[_0x9918('0x2b')]['filter']+'%'};return _0x3aaeec;}})});}_0x541d4e=_[_0x9918('0x38')]({},_0x541d4e,_0x1736b3[_0x9918('0x39')]);var _0x3a2e9b={'where':_0x541d4e[_0x9918('0x36')]};return db[_0x9918('0x3a')][_0x9918('0x1a')](_0x3a2e9b)['then'](function(_0x10577f){_0x4b07d4[_0x9918('0x1a')]=_0x10577f;if(_0x1736b3[_0x9918('0x2b')][_0x9918('0x3b')]){_0x541d4e['include']=[{'all':!![]}];}return db[_0x9918('0x3a')][_0x9918('0x3c')](_0x541d4e);})[_0x9918('0x21')](function(_0x18e6db){_0x4b07d4['rows']=_0x18e6db;return _0x4b07d4;})[_0x9918('0x21')](respondWithFilteredResult(_0x4fb6e6,_0x541d4e))['catch'](handleError(_0x4fb6e6,null));};exports[_0x9918('0x3d')]=function(_0x4d9fb2,_0x169e41){var _0x33c787={'raw':![],'where':{'id':_0x4d9fb2[_0x9918('0x3e')]['id']}},_0x4b55d6={};_0x4b55d6['model']=_[_0x9918('0x2c')](db[_0x9918('0x3a')][_0x9918('0x3f')]);_0x4b55d6[_0x9918('0x2b')]=_[_0x9918('0x2c')](_0x4d9fb2[_0x9918('0x2b')]);_0x4b55d6['filters']=_[_0x9918('0x40')](_0x4b55d6[_0x9918('0x2a')],_0x4b55d6['query']);_0x33c787[_0x9918('0x2e')]=_[_0x9918('0x40')](_0x4b55d6[_0x9918('0x2a')],qs[_0x9918('0x2f')](_0x4d9fb2[_0x9918('0x2b')]['fields']));_0x33c787[_0x9918('0x2e')]=_0x33c787[_0x9918('0x2e')][_0x9918('0x30')]?_0x33c787[_0x9918('0x2e')]:_0x4b55d6[_0x9918('0x2a')];if(_0x4d9fb2[_0x9918('0x2b')][_0x9918('0x3b')]){_0x33c787[_0x9918('0x41')]=[{'all':!![]}];}_0x33c787=_['merge']({},_0x33c787,_0x4d9fb2[_0x9918('0x39')]);return db[_0x9918('0x3a')]['find'](_0x33c787)['then'](handleEntityNotFound(_0x169e41,null))['then'](respondWithResult(_0x169e41,null))[_0x9918('0x42')](handleError(_0x169e41,null));};exports[_0x9918('0x43')]=function(_0x43780a,_0x496717){return db[_0x9918('0x3a')]['create'](_0x43780a['body'],{})[_0x9918('0x21')](respondWithResult(_0x496717,0xc9))['catch'](handleError(_0x496717,null));};exports['update']=function(_0x7f211a,_0x483426){if(_0x7f211a['body']['id']){delete _0x7f211a[_0x9918('0x44')]['id'];}return db[_0x9918('0x3a')][_0x9918('0x45')]({'where':{'id':_0x7f211a['params']['id']}})['then'](handleEntityNotFound(_0x483426,null))['then'](saveUpdates(_0x7f211a[_0x9918('0x44')],null))[_0x9918('0x21')](respondWithResult(_0x483426,null))[_0x9918('0x42')](handleError(_0x483426,null));};exports[_0x9918('0x22')]=function(_0x20dd51,_0x6861a3){return db[_0x9918('0x3a')][_0x9918('0x45')]({'where':{'id':_0x20dd51[_0x9918('0x3e')]['id']}})[_0x9918('0x21')](handleEntityNotFound(_0x6861a3,null))[_0x9918('0x21')](removeEntity(_0x6861a3,null))[_0x9918('0x42')](handleError(_0x6861a3,null));};exports['getConfigurations']=function(_0x43d7ac,_0x354fde,_0xccb305){var _0x5ca491={};var _0x410112={};var _0x4353ed;var _0x458c00;return db[_0x9918('0x3a')][_0x9918('0x46')]({'where':{'id':_0x43d7ac[_0x9918('0x3e')]['id']}})[_0x9918('0x21')](handleEntityNotFound(_0x354fde,null))['then'](function(_0x567430){if(_0x567430){_0x4353ed=_0x567430;_0x410112[_0x9918('0x2a')]=_[_0x9918('0x2c')](db['FreshdeskConfiguration'][_0x9918('0x3f')]);_0x410112[_0x9918('0x2b')]=_[_0x9918('0x2c')](_0x43d7ac['query']);_0x410112[_0x9918('0x2d')]=_[_0x9918('0x40')](_0x410112[_0x9918('0x2a')],_0x410112[_0x9918('0x2b')]);_0x5ca491['attributes']=_[_0x9918('0x40')](_0x410112[_0x9918('0x2a')],qs[_0x9918('0x2f')](_0x43d7ac[_0x9918('0x2b')][_0x9918('0x2f')]));_0x5ca491[_0x9918('0x2e')]=_0x5ca491[_0x9918('0x2e')][_0x9918('0x30')]?_0x5ca491[_0x9918('0x2e')]:_0x410112[_0x9918('0x2a')];_0x5ca491[_0x9918('0x33')]=qs[_0x9918('0x34')](_0x43d7ac[_0x9918('0x2b')]['sort']);_0x5ca491['where']=qs[_0x9918('0x2d')](_['pick'](_0x43d7ac[_0x9918('0x2b')],_0x410112[_0x9918('0x2d')]));if(_0x43d7ac[_0x9918('0x2b')][_0x9918('0x35')]){_0x5ca491['where']=_[_0x9918('0x38')](_0x5ca491[_0x9918('0x36')],{'$or':_[_0x9918('0x26')](_0x5ca491['attributes'],function(_0x2179b7){var _0x583028={};_0x583028[_0x2179b7]={'$like':'%'+_0x43d7ac[_0x9918('0x2b')]['filter']+'%'};return _0x583028;})});}_0x5ca491=_['merge']({},_0x5ca491,_0x43d7ac[_0x9918('0x39')]);return _0x4353ed[_0x9918('0x47')](_0x5ca491);}})[_0x9918('0x21')](function(_0x2be017){if(_0x2be017){_0x458c00=_0x2be017[_0x9918('0x30')];if(!_0x43d7ac[_0x9918('0x2b')][_0x9918('0x31')](_0x9918('0x32'))){_0x5ca491[_0x9918('0x19')]=qs[_0x9918('0x19')](_0x43d7ac[_0x9918('0x2b')][_0x9918('0x19')]);_0x5ca491['offset']=qs[_0x9918('0x17')](_0x43d7ac['query'][_0x9918('0x17')]);}return _0x4353ed[_0x9918('0x47')](_0x5ca491);}})['then'](function(_0x3836a7){if(_0x3836a7){return _0x3836a7?{'count':_0x458c00,'rows':_0x3836a7}:null;}})[_0x9918('0x21')](respondWithResult(_0x354fde,null))[_0x9918('0x42')](handleError(_0x354fde,null));};exports[_0x9918('0x48')]=function(_0x22ec8b,_0x1b2277,_0x58bd74){if(_0x22ec8b['body']['id']){delete _0x22ec8b[_0x9918('0x44')]['id'];}return db[_0x9918('0x3a')]['findOne']({'where':{'id':_0x22ec8b[_0x9918('0x3e')]['id']}})['then'](handleEntityNotFound(_0x1b2277,null))[_0x9918('0x21')](function(_0x31f4eb){if(_0x31f4eb){_0x22ec8b['body'][_0x9918('0x49')]=_0x31f4eb['id'];_0x22ec8b['body'][_0x9918('0x4a')]=integrations[_0x9918('0x4b')](_0x22ec8b[_0x9918('0x44')][_0x9918('0x4c')],_0x22ec8b[_0x9918('0x44')][_0x9918('0x28')]);_0x22ec8b[_0x9918('0x44')]['Descriptions']=integrations[_0x9918('0x4d')](_0x22ec8b[_0x9918('0x44')][_0x9918('0x4c')],_0x22ec8b[_0x9918('0x44')][_0x9918('0x28')]);return db[_0x9918('0x4e')][_0x9918('0x43')](_0x22ec8b[_0x9918('0x44')],{'include':[{'model':db[_0x9918('0x4f')],'as':_0x9918('0x4a')},{'model':db['FreshdeskField'],'as':_0x9918('0x50')}]});}return null;})[_0x9918('0x21')](respondWithResult(_0x1b2277,null))[_0x9918('0x42')](handleError(_0x1b2277,null));};exports[_0x9918('0x51')]=function(_0x430589,_0x5988c6,_0x3719e7){var _0x507f6c='';return db[_0x9918('0x3a')][_0x9918('0x46')]({'where':{'id':_0x430589[_0x9918('0x3e')]['id']},'attributes':['id','remoteUri',_0x9918('0x52')]})[_0x9918('0x21')](handleEntityNotFound(_0x5988c6,null))['then'](function(_0x5191c3){if(_0x5191c3){_0x507f6c=_0x5191c3[_0x9918('0x53')];var _0x4f66f2=_0x507f6c[_0x9918('0x54')](-0x1);if(_0x4f66f2==='/'){_0x507f6c=_0x507f6c[_0x9918('0x55')](0x0,_0x507f6c[_0x9918('0x56')](_0x4f66f2));}return rp({'method':_0x9918('0x57'),'uri':util['format']('%s/%s',_0x507f6c,'api/v2/ticket_fields'),'headers':{'Authorization':util[_0x9918('0x58')](_0x9918('0x59'),new Buffer(util['format'](_0x9918('0x5a'),_0x5191c3[_0x9918('0x52')]))[_0x9918('0x5b')](_0x9918('0x5c')))},'json':!![]});}})['then'](function(_0x477b57){if(_0x477b57){var _0x4efbf7=[_0x9918('0x5d'),'subject',_0x9918('0x5e'),_0x9918('0x5f'),'status',_0x9918('0x60'),_0x9918('0x61'),_0x9918('0x62'),'ticket_type','group',_0x9918('0x63')];_[_0x9918('0x64')](_0x477b57,function(_0x452548){return _0x4efbf7[_0x9918('0x65')](_0x452548[_0x9918('0x25')])||!_0x452548[_0x9918('0x66')]&&_0x452548[_0x9918('0x28')]!==_0x9918('0x67')&&_0x452548[_0x9918('0x28')]!==_0x9918('0x68');});return{'count':_0x477b57['length'],'rows':_[_0x9918('0x26')](_0x477b57,function(_0x293f42){return{'id':_0x293f42[_0x9918('0x25')],'name':_0x293f42[_0x9918('0x69')],'custom':!_0x293f42['default'],'options':_0x293f42[_0x9918('0x6a')]?_['map'](_0x293f42[_0x9918('0x6a')],function(_0xe35051){return{'name':_[_0x9918('0x6b')](_0xe35051),'value':_0xe35051};}):[]};})};}})[_0x9918('0x21')](respondWithResult(_0x5988c6,null))['catch'](function(_0x1cb551){var _0x2815eb=_0x430589[_0x9918('0x2b')][_0x9918('0x6c')]?0x1f4:_0x1cb551[_0x9918('0x6d')]||0x1f4;logger['error'](_0x9918('0x6e'),_0x9918('0x51'),_0x2815eb,JSON[_0x9918('0x6f')](_0x1cb551));delete _0x1cb551['name'];if(_0x2815eb===0x191){_0x2815eb=0x190;}_0x5988c6['status'](_0x2815eb)[_0x9918('0x70')](_0x430589[_0x9918('0x2b')][_0x9918('0x6c')]?{'message':_0x9918('0x71'),'statusCode':_0x1cb551[_0x9918('0x6d')]}:_0x1cb551);});}; \ No newline at end of file +var _0x2572=['getDescriptions','FreshdeskConfiguration','FreshdeskField','Subjects','getFields','remoteUri','apiKey','slice','substring','lastIndexOf','GET','format','%s/%s','api/v2/ticket_fields','toString','subject','description','priority','group','source','remove','includes','default','custom_text','custom_dropdown','choices','capitalize','test','error','getFields,\x20%s,\x20%s,\x20%s','stringify','send','Wrong\x20credentials','statusCode','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','undefined','count','offset','limit','set','Content-Range','apply','save','update','then','destroy','stack','name','index','map','FreshdeskAccount','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','type','VIRTUAL','options','includeAll','include','rows','catch','show','params','create','body','find','getConfigurations','findOne','order','pick','addConfiguration','AccountId','channel','Descriptions'];(function(_0x12e80e,_0x3254de){var _0x1b33d3=function(_0x473219){while(--_0x473219){_0x12e80e['push'](_0x12e80e['shift']());}};_0x1b33d3(++_0x3254de);}(_0x2572,0x110));var _0x2257=function(_0x2763f2,_0x416af8){_0x2763f2=_0x2763f2-0x0;var _0x3ef471=_0x2572[_0x2763f2];return _0x3ef471;};'use strict';var emlformat=require(_0x2257('0x0'));var rimraf=require(_0x2257('0x1'));var zipdir=require(_0x2257('0x2'));var jsonpatch=require(_0x2257('0x3'));var rp=require(_0x2257('0x4'));var moment=require(_0x2257('0x5'));var BPromise=require(_0x2257('0x6'));var Mustache=require(_0x2257('0x7'));var util=require(_0x2257('0x8'));var path=require('path');var sox=require(_0x2257('0x9'));var csv=require(_0x2257('0xa'));var ejs=require(_0x2257('0xb'));var fs=require('fs');var fs_extra=require(_0x2257('0xc'));var _=require(_0x2257('0xd'));var squel=require(_0x2257('0xe'));var crypto=require(_0x2257('0xf'));var jsforce=require(_0x2257('0x10'));var deskjs=require(_0x2257('0x11'));var toCsv=require('to-csv');var querystring=require(_0x2257('0x12'));var Papa=require(_0x2257('0x13'));var Redis=require('ioredis');var authService=require(_0x2257('0x14'));var qs=require(_0x2257('0x15'));var as=require(_0x2257('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2257('0x17'))(_0x2257('0x18'));var utils=require(_0x2257('0x19'));var config=require(_0x2257('0x1a'));var licenseUtil=require('../../config/license/util');var db=require(_0x2257('0x1b'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x578d2f,_0x7f8b71){_0x7f8b71=_0x7f8b71||0xcc;return function(_0x4537d2){if(_0x4537d2){return _0x578d2f[_0x2257('0x1c')](_0x7f8b71);}return _0x578d2f[_0x2257('0x1d')](_0x7f8b71)[_0x2257('0x1e')]();};}function respondWithResult(_0x32fdfe,_0x1738a3){_0x1738a3=_0x1738a3||0xc8;return function(_0x4c13fe){if(_0x4c13fe){return _0x32fdfe['status'](_0x1738a3)[_0x2257('0x1f')](_0x4c13fe);}};}function respondWithFilteredResult(_0x45efee,_0x2b4102){return function(_0x156d68){if(_0x156d68){var _0x591021=typeof _0x2b4102['offset']===_0x2257('0x20')&&typeof _0x2b4102['limit']==='undefined';var _0x5c8153=_0x156d68[_0x2257('0x21')];var _0x2d51e7=_0x591021?0x0:_0x2b4102[_0x2257('0x22')];var _0x2c3c79=_0x591021?_0x156d68[_0x2257('0x21')]:_0x2b4102[_0x2257('0x22')]+_0x2b4102[_0x2257('0x23')];var _0x3f3c83;if(_0x2c3c79>=_0x5c8153){_0x2c3c79=_0x5c8153;_0x3f3c83=0xc8;}else{_0x3f3c83=0xce;}_0x45efee[_0x2257('0x1d')](_0x3f3c83);return _0x45efee[_0x2257('0x24')](_0x2257('0x25'),_0x2d51e7+'-'+_0x2c3c79+'/'+_0x5c8153)[_0x2257('0x1f')](_0x156d68);}return null;};}function patchUpdates(_0x482240){return function(_0xe08b33){try{jsonpatch[_0x2257('0x26')](_0xe08b33,_0x482240,!![]);}catch(_0x5a62a3){return BPromise['reject'](_0x5a62a3);}return _0xe08b33[_0x2257('0x27')]();};}function saveUpdates(_0x5ae577,_0x31cd98){return function(_0x44a2da){if(_0x44a2da){return _0x44a2da[_0x2257('0x28')](_0x5ae577)[_0x2257('0x29')](function(_0x137d53){return _0x137d53;});}return null;};}function removeEntity(_0x1e220c,_0x1549aa){return function(_0x18fec2){if(_0x18fec2){return _0x18fec2[_0x2257('0x2a')]()[_0x2257('0x29')](function(){_0x1e220c['status'](0xcc)[_0x2257('0x1e')]();});}};}function handleEntityNotFound(_0x227155,_0x58e30d){return function(_0x37caa6){if(!_0x37caa6){_0x227155[_0x2257('0x1c')](0x194);}return _0x37caa6;};}function handleError(_0x4e0eaf,_0x1c1a76){_0x1c1a76=_0x1c1a76||0x1f4;return function(_0x1fdd82){logger['error'](_0x1fdd82[_0x2257('0x2b')]);if(_0x1fdd82[_0x2257('0x2c')]){delete _0x1fdd82[_0x2257('0x2c')];}_0x4e0eaf[_0x2257('0x1d')](_0x1c1a76)['send'](_0x1fdd82);};}exports[_0x2257('0x2d')]=function(_0x8952ad,_0x508cad){var _0x38e581={},_0x1c19c6={},_0x28403e={'count':0x0,'rows':[]};var _0x21931d=_[_0x2257('0x2e')](db[_0x2257('0x2f')][_0x2257('0x30')],function(_0x43f0b2){return{'name':_0x43f0b2[_0x2257('0x31')],'type':_0x43f0b2['type'][_0x2257('0x32')]};});_0x1c19c6[_0x2257('0x33')]=_['map'](_0x21931d,'name');_0x1c19c6[_0x2257('0x34')]=_[_0x2257('0x35')](_0x8952ad[_0x2257('0x34')]);_0x1c19c6[_0x2257('0x36')]=_[_0x2257('0x37')](_0x1c19c6[_0x2257('0x33')],_0x1c19c6['query']);_0x38e581[_0x2257('0x38')]=_[_0x2257('0x37')](_0x1c19c6[_0x2257('0x33')],qs[_0x2257('0x39')](_0x8952ad['query'][_0x2257('0x39')]));_0x38e581['attributes']=_0x38e581['attributes'][_0x2257('0x3a')]?_0x38e581[_0x2257('0x38')]:_0x1c19c6[_0x2257('0x33')];if(!_0x8952ad[_0x2257('0x34')][_0x2257('0x3b')](_0x2257('0x3c'))){_0x38e581[_0x2257('0x23')]=qs[_0x2257('0x23')](_0x8952ad[_0x2257('0x34')][_0x2257('0x23')]);_0x38e581[_0x2257('0x22')]=qs[_0x2257('0x22')](_0x8952ad[_0x2257('0x34')][_0x2257('0x22')]);}_0x38e581['order']=qs[_0x2257('0x3d')](_0x8952ad[_0x2257('0x34')][_0x2257('0x3d')]);_0x38e581[_0x2257('0x3e')]=qs[_0x2257('0x36')](_['pick'](_0x8952ad[_0x2257('0x34')],_0x1c19c6[_0x2257('0x36')]),_0x21931d);if(_0x8952ad[_0x2257('0x34')][_0x2257('0x3f')]){_0x38e581[_0x2257('0x3e')]=_[_0x2257('0x40')](_0x38e581[_0x2257('0x3e')],{'$or':_[_0x2257('0x2e')](_0x21931d,function(_0x33adbf){if(_0x33adbf[_0x2257('0x41')]!==_0x2257('0x42')){var _0x392104={};_0x392104[_0x33adbf[_0x2257('0x2c')]]={'$like':'%'+_0x8952ad['query'][_0x2257('0x3f')]+'%'};return _0x392104;}})});}_0x38e581=_[_0x2257('0x40')]({},_0x38e581,_0x8952ad[_0x2257('0x43')]);var _0x1e4541={'where':_0x38e581[_0x2257('0x3e')]};return db[_0x2257('0x2f')][_0x2257('0x21')](_0x1e4541)[_0x2257('0x29')](function(_0x41db20){_0x28403e[_0x2257('0x21')]=_0x41db20;if(_0x8952ad['query'][_0x2257('0x44')]){_0x38e581[_0x2257('0x45')]=[{'all':!![]}];}return db[_0x2257('0x2f')]['findAll'](_0x38e581);})[_0x2257('0x29')](function(_0x907312){_0x28403e[_0x2257('0x46')]=_0x907312;return _0x28403e;})[_0x2257('0x29')](respondWithFilteredResult(_0x508cad,_0x38e581))[_0x2257('0x47')](handleError(_0x508cad,null));};exports[_0x2257('0x48')]=function(_0x5d010c,_0x2fc24b){var _0x2be2ee={'raw':![],'where':{'id':_0x5d010c[_0x2257('0x49')]['id']}},_0x3ef686={};_0x3ef686['model']=_['keys'](db['FreshdeskAccount']['rawAttributes']);_0x3ef686[_0x2257('0x34')]=_['keys'](_0x5d010c['query']);_0x3ef686[_0x2257('0x36')]=_['intersection'](_0x3ef686['model'],_0x3ef686['query']);_0x2be2ee[_0x2257('0x38')]=_[_0x2257('0x37')](_0x3ef686[_0x2257('0x33')],qs[_0x2257('0x39')](_0x5d010c[_0x2257('0x34')][_0x2257('0x39')]));_0x2be2ee[_0x2257('0x38')]=_0x2be2ee['attributes'][_0x2257('0x3a')]?_0x2be2ee['attributes']:_0x3ef686[_0x2257('0x33')];if(_0x5d010c[_0x2257('0x34')][_0x2257('0x44')]){_0x2be2ee[_0x2257('0x45')]=[{'all':!![]}];}_0x2be2ee=_[_0x2257('0x40')]({},_0x2be2ee,_0x5d010c[_0x2257('0x43')]);return db[_0x2257('0x2f')]['find'](_0x2be2ee)[_0x2257('0x29')](handleEntityNotFound(_0x2fc24b,null))[_0x2257('0x29')](respondWithResult(_0x2fc24b,null))['catch'](handleError(_0x2fc24b,null));};exports[_0x2257('0x4a')]=function(_0x496696,_0x10d8b2){return db[_0x2257('0x2f')][_0x2257('0x4a')](_0x496696[_0x2257('0x4b')],{})[_0x2257('0x29')](respondWithResult(_0x10d8b2,0xc9))[_0x2257('0x47')](handleError(_0x10d8b2,null));};exports[_0x2257('0x28')]=function(_0x50c5cb,_0x404e8c){if(_0x50c5cb[_0x2257('0x4b')]['id']){delete _0x50c5cb['body']['id'];}return db[_0x2257('0x2f')]['find']({'where':{'id':_0x50c5cb[_0x2257('0x49')]['id']}})[_0x2257('0x29')](handleEntityNotFound(_0x404e8c,null))[_0x2257('0x29')](saveUpdates(_0x50c5cb[_0x2257('0x4b')],null))['then'](respondWithResult(_0x404e8c,null))[_0x2257('0x47')](handleError(_0x404e8c,null));};exports['destroy']=function(_0x456020,_0x53644a){return db[_0x2257('0x2f')][_0x2257('0x4c')]({'where':{'id':_0x456020[_0x2257('0x49')]['id']}})[_0x2257('0x29')](handleEntityNotFound(_0x53644a,null))[_0x2257('0x29')](removeEntity(_0x53644a,null))[_0x2257('0x47')](handleError(_0x53644a,null));};exports[_0x2257('0x4d')]=function(_0x3cd031,_0x5e8a15,_0x17343c){var _0x117a8c={};var _0x3a8600={};var _0x333638;var _0x3ae279;return db[_0x2257('0x2f')][_0x2257('0x4e')]({'where':{'id':_0x3cd031[_0x2257('0x49')]['id']}})[_0x2257('0x29')](handleEntityNotFound(_0x5e8a15,null))[_0x2257('0x29')](function(_0x194d90){if(_0x194d90){_0x333638=_0x194d90;_0x3a8600[_0x2257('0x33')]=_[_0x2257('0x35')](db['FreshdeskConfiguration'][_0x2257('0x30')]);_0x3a8600[_0x2257('0x34')]=_[_0x2257('0x35')](_0x3cd031['query']);_0x3a8600[_0x2257('0x36')]=_[_0x2257('0x37')](_0x3a8600[_0x2257('0x33')],_0x3a8600['query']);_0x117a8c[_0x2257('0x38')]=_[_0x2257('0x37')](_0x3a8600[_0x2257('0x33')],qs[_0x2257('0x39')](_0x3cd031[_0x2257('0x34')][_0x2257('0x39')]));_0x117a8c['attributes']=_0x117a8c['attributes'][_0x2257('0x3a')]?_0x117a8c[_0x2257('0x38')]:_0x3a8600[_0x2257('0x33')];_0x117a8c[_0x2257('0x4f')]=qs[_0x2257('0x3d')](_0x3cd031[_0x2257('0x34')][_0x2257('0x3d')]);_0x117a8c[_0x2257('0x3e')]=qs[_0x2257('0x36')](_[_0x2257('0x50')](_0x3cd031[_0x2257('0x34')],_0x3a8600[_0x2257('0x36')]));if(_0x3cd031[_0x2257('0x34')][_0x2257('0x3f')]){_0x117a8c[_0x2257('0x3e')]=_[_0x2257('0x40')](_0x117a8c[_0x2257('0x3e')],{'$or':_[_0x2257('0x2e')](_0x117a8c[_0x2257('0x38')],function(_0x4bf731){var _0x5f4965={};_0x5f4965[_0x4bf731]={'$like':'%'+_0x3cd031['query'][_0x2257('0x3f')]+'%'};return _0x5f4965;})});}_0x117a8c=_[_0x2257('0x40')]({},_0x117a8c,_0x3cd031[_0x2257('0x43')]);return _0x333638[_0x2257('0x4d')](_0x117a8c);}})[_0x2257('0x29')](function(_0x412efa){if(_0x412efa){_0x3ae279=_0x412efa[_0x2257('0x3a')];if(!_0x3cd031[_0x2257('0x34')]['hasOwnProperty']('nolimit')){_0x117a8c[_0x2257('0x23')]=qs['limit'](_0x3cd031[_0x2257('0x34')]['limit']);_0x117a8c[_0x2257('0x22')]=qs['offset'](_0x3cd031[_0x2257('0x34')][_0x2257('0x22')]);}return _0x333638[_0x2257('0x4d')](_0x117a8c);}})[_0x2257('0x29')](function(_0x22c4ea){if(_0x22c4ea){return _0x22c4ea?{'count':_0x3ae279,'rows':_0x22c4ea}:null;}})[_0x2257('0x29')](respondWithResult(_0x5e8a15,null))[_0x2257('0x47')](handleError(_0x5e8a15,null));};exports[_0x2257('0x51')]=function(_0x553947,_0x3b2da6,_0x28f948){if(_0x553947[_0x2257('0x4b')]['id']){delete _0x553947[_0x2257('0x4b')]['id'];}return db[_0x2257('0x2f')][_0x2257('0x4e')]({'where':{'id':_0x553947[_0x2257('0x49')]['id']}})['then'](handleEntityNotFound(_0x3b2da6,null))[_0x2257('0x29')](function(_0xa07de9){if(_0xa07de9){_0x553947[_0x2257('0x4b')][_0x2257('0x52')]=_0xa07de9['id'];_0x553947[_0x2257('0x4b')]['Subjects']=integrations['getSubjects'](_0x553947['body'][_0x2257('0x53')],_0x553947[_0x2257('0x4b')][_0x2257('0x41')]);_0x553947[_0x2257('0x4b')][_0x2257('0x54')]=integrations[_0x2257('0x55')](_0x553947[_0x2257('0x4b')][_0x2257('0x53')],_0x553947['body'][_0x2257('0x41')]);return db[_0x2257('0x56')]['create'](_0x553947[_0x2257('0x4b')],{'include':[{'model':db[_0x2257('0x57')],'as':_0x2257('0x58')},{'model':db[_0x2257('0x57')],'as':_0x2257('0x54')}]});}return null;})[_0x2257('0x29')](respondWithResult(_0x3b2da6,null))[_0x2257('0x47')](handleError(_0x3b2da6,null));};exports[_0x2257('0x59')]=function(_0x5b1972,_0x46c88e,_0x375a2b){var _0x56b1d0='';return db[_0x2257('0x2f')]['findOne']({'where':{'id':_0x5b1972[_0x2257('0x49')]['id']},'attributes':['id',_0x2257('0x5a'),_0x2257('0x5b')]})[_0x2257('0x29')](handleEntityNotFound(_0x46c88e,null))[_0x2257('0x29')](function(_0x2005e1){if(_0x2005e1){_0x56b1d0=_0x2005e1['remoteUri'];var _0x498f1f=_0x56b1d0[_0x2257('0x5c')](-0x1);if(_0x498f1f==='/'){_0x56b1d0=_0x56b1d0[_0x2257('0x5d')](0x0,_0x56b1d0[_0x2257('0x5e')](_0x498f1f));}return rp({'method':_0x2257('0x5f'),'uri':util[_0x2257('0x60')](_0x2257('0x61'),_0x56b1d0,_0x2257('0x62')),'headers':{'Authorization':util['format']('Basic\x20%s',new Buffer(util['format']('%s:X',_0x2005e1[_0x2257('0x5b')]))[_0x2257('0x63')]('base64'))},'json':!![]});}})[_0x2257('0x29')](function(_0x1dd412){if(_0x1dd412){var _0x3aafa1=['requester',_0x2257('0x64'),'agent',_0x2257('0x65'),_0x2257('0x1d'),_0x2257('0x66'),_0x2257('0x67'),_0x2257('0x68'),'ticket_type',_0x2257('0x67'),'company'];_[_0x2257('0x69')](_0x1dd412,function(_0x4c5ad0){return _0x3aafa1[_0x2257('0x6a')](_0x4c5ad0[_0x2257('0x2c')])||!_0x4c5ad0[_0x2257('0x6b')]&&_0x4c5ad0[_0x2257('0x41')]!==_0x2257('0x6c')&&_0x4c5ad0[_0x2257('0x41')]!==_0x2257('0x6d');});return{'count':_0x1dd412[_0x2257('0x3a')],'rows':_[_0x2257('0x2e')](_0x1dd412,function(_0x495705){return{'id':_0x495705[_0x2257('0x2c')],'name':_0x495705['label'],'custom':!_0x495705[_0x2257('0x6b')],'options':_0x495705[_0x2257('0x6e')]?_[_0x2257('0x2e')](_0x495705[_0x2257('0x6e')],function(_0x45cb75){return{'name':_[_0x2257('0x6f')](_0x45cb75),'value':_0x45cb75};}):[]};})};}})[_0x2257('0x29')](respondWithResult(_0x46c88e,null))['catch'](function(_0x4b26ba){var _0x4684a0=_0x5b1972[_0x2257('0x34')][_0x2257('0x70')]?0x1f4:_0x4b26ba['statusCode']||0x1f4;logger[_0x2257('0x71')](_0x2257('0x72'),_0x2257('0x59'),_0x4684a0,JSON[_0x2257('0x73')](_0x4b26ba));delete _0x4b26ba['name'];if(_0x4684a0===0x191){_0x4684a0=0x190;}_0x46c88e[_0x2257('0x1d')](_0x4684a0)[_0x2257('0x74')](_0x5b1972[_0x2257('0x34')][_0x2257('0x70')]?{'message':_0x2257('0x75'),'statusCode':_0x4b26ba[_0x2257('0x76')]}:_0x4b26ba);});}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js index e7271f5..b9a5ff3 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 _0x92a5=['../../config/environment','./intFreshdeskAccount.attributes','../../components/integrations/configuration','exports','define','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x92a5,0x144));var _0x592a=function(_0x1d366b,_0x3d8e42){_0x1d366b=_0x1d366b-0x0;var _0x1c5045=_0x92a5[_0x1d366b];return _0x1c5045;};'use strict';var _=require(_0x592a('0x0'));var util=require(_0x592a('0x1'));var logger=require(_0x592a('0x2'))(_0x592a('0x3'));var moment=require(_0x592a('0x4'));var BPromise=require(_0x592a('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x592a('0x6'));var attributes=require(_0x592a('0x7'));var integrations=require(_0x592a('0x8'));module[_0x592a('0x9')]=function(_0x3e077c,_0x1b8d25){return _0x3e077c[_0x592a('0xa')]('FreshdeskAccount',attributes,{'tableName':'int_freshdesk_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2e11=['define','FreshdeskAccount','int_freshdesk_accounts','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intFreshdeskAccount.attributes'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2e11,0x8f));var _0x12e1=function(_0x426cff,_0x4a4f1a){_0x426cff=_0x426cff-0x0;var _0x3f00be=_0x2e11[_0x426cff];return _0x3f00be;};'use strict';var _=require(_0x12e1('0x0'));var util=require(_0x12e1('0x1'));var logger=require(_0x12e1('0x2'))(_0x12e1('0x3'));var moment=require(_0x12e1('0x4'));var BPromise=require(_0x12e1('0x5'));var rp=require(_0x12e1('0x6'));var fs=require('fs');var path=require(_0x12e1('0x7'));var rimraf=require(_0x12e1('0x8'));var config=require(_0x12e1('0x9'));var attributes=require(_0x12e1('0xa'));var integrations=require('../../components/integrations/configuration');module['exports']=function(_0x3720ba,_0x31de6c){return _0x3720ba[_0x12e1('0xb')](_0x12e1('0xc'),attributes,{'tableName':_0x12e1('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.rpc.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.rpc.js index 3272f8c..19ef929 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 _0xdb06=['../../config/logger','../../config/environment','jayson/promise','client','request','FreshdeskAccount,\x20%s,\x20%s','request\x20sent','debug','FreshdeskAccount,\x20%s,\x20%s,\x20%s','error','code','message','info','result','FreshdeskAccount','findAll','options','raw','where','limit','include','map','model','attributes','then','GetFreshdeskAccount','find','ShowFreshdeskAccount','catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils'];(function(_0x1da8fc,_0x2bd351){var _0x1c3a89=function(_0x58d625){while(--_0x58d625){_0x1da8fc['push'](_0x1da8fc['shift']());}};_0x1c3a89(++_0x2bd351);}(_0xdb06,0x1e4));var _0x6db0=function(_0x1c13c2,_0x3cf4cb){_0x1c13c2=_0x1c13c2-0x0;var _0x5cad47=_0xdb06[_0x1c13c2];return _0x5cad47;};'use strict';var _=require('lodash');var util=require(_0x6db0('0x0'));var moment=require(_0x6db0('0x1'));var BPromise=require(_0x6db0('0x2'));var rs=require(_0x6db0('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6db0('0x4'))['db'];var utils=require(_0x6db0('0x5'));var logger=require(_0x6db0('0x6'))('rpc');var config=require(_0x6db0('0x7'));var jayson=require(_0x6db0('0x8'));var client=jayson[_0x6db0('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3ab0d2,_0x32be63,_0x1fbd18){return new BPromise(function(_0x2b3bc9,_0x5eed6d){return client[_0x6db0('0xa')](_0x3ab0d2,_0x1fbd18)['then'](function(_0x15bfa1){logger['info'](_0x6db0('0xb'),_0x32be63,_0x6db0('0xc'));logger[_0x6db0('0xd')](_0x6db0('0xe'),_0x32be63,_0x6db0('0xc'),JSON['stringify'](_0x15bfa1));if(_0x15bfa1[_0x6db0('0xf')]){if(_0x15bfa1[_0x6db0('0xf')][_0x6db0('0x10')]===0x1f4){logger[_0x6db0('0xf')](_0x6db0('0xb'),_0x32be63,_0x15bfa1[_0x6db0('0xf')][_0x6db0('0x11')]);return _0x5eed6d(_0x15bfa1['error']['message']);}logger[_0x6db0('0xf')]('FreshdeskAccount,\x20%s,\x20%s',_0x32be63,_0x15bfa1[_0x6db0('0xf')]['message']);return _0x2b3bc9(_0x15bfa1[_0x6db0('0xf')][_0x6db0('0x11')]);}else{logger[_0x6db0('0x12')]('FreshdeskAccount,\x20%s,\x20%s',_0x32be63,_0x6db0('0xc'));_0x2b3bc9(_0x15bfa1[_0x6db0('0x13')]['message']);}})['catch'](function(_0x5262e0){logger[_0x6db0('0xf')](_0x6db0('0xb'),_0x32be63,_0x5262e0);_0x5eed6d(_0x5262e0);});});}exports['GetFreshdeskAccount']=function(_0x429467){var _0x2ef4ef=this;return new Promise(function(_0x4266bf,_0x1287c4){return db[_0x6db0('0x14')][_0x6db0('0x15')]({'raw':_0x429467[_0x6db0('0x16')]?_0x429467[_0x6db0('0x16')][_0x6db0('0x17')]===undefined?!![]:![]:!![],'where':_0x429467[_0x6db0('0x16')]?_0x429467['options'][_0x6db0('0x18')]||null:null,'attributes':_0x429467[_0x6db0('0x16')]?_0x429467[_0x6db0('0x16')]['attributes']||null:null,'limit':_0x429467['options']?_0x429467[_0x6db0('0x16')][_0x6db0('0x19')]||null:null,'include':_0x429467[_0x6db0('0x16')]?_0x429467['options'][_0x6db0('0x1a')]?_[_0x6db0('0x1b')](_0x429467[_0x6db0('0x16')][_0x6db0('0x1a')],function(_0x50940d){return{'model':db[_0x50940d[_0x6db0('0x1c')]],'as':_0x50940d['as'],'attributes':_0x50940d['attributes'],'include':_0x50940d['include']?_[_0x6db0('0x1b')](_0x50940d[_0x6db0('0x1a')],function(_0x1c673f){return{'model':db[_0x1c673f[_0x6db0('0x1c')]],'as':_0x1c673f['as'],'attributes':_0x1c673f['attributes'],'include':_0x1c673f[_0x6db0('0x1a')]?_[_0x6db0('0x1b')](_0x1c673f[_0x6db0('0x1a')],function(_0x4305dc){return{'model':db[_0x4305dc[_0x6db0('0x1c')]],'as':_0x4305dc['as'],'attributes':_0x4305dc[_0x6db0('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x6db0('0x1e')](function(_0x52c2c5){logger[_0x6db0('0x12')](_0x6db0('0x1f'),_0x429467);logger[_0x6db0('0xd')](_0x6db0('0x1f'),_0x429467,JSON['stringify'](_0x52c2c5));_0x4266bf(_0x52c2c5);})['catch'](function(_0x3435e4){logger[_0x6db0('0xf')](_0x6db0('0x1f'),_0x3435e4[_0x6db0('0x11')],_0x429467);_0x1287c4(_0x2ef4ef['error'](0x1f4,_0x3435e4[_0x6db0('0x11')]));});});};exports['ShowFreshdeskAccount']=function(_0x39681e){var _0x526d43=this;return new Promise(function(_0x14878a,_0x1f2b9b){return db[_0x6db0('0x14')][_0x6db0('0x20')]({'raw':_0x39681e[_0x6db0('0x16')]?_0x39681e[_0x6db0('0x16')][_0x6db0('0x17')]===undefined?!![]:![]:!![],'where':_0x39681e[_0x6db0('0x16')]?_0x39681e[_0x6db0('0x16')][_0x6db0('0x18')]||null:null,'attributes':_0x39681e[_0x6db0('0x16')]?_0x39681e[_0x6db0('0x16')][_0x6db0('0x1d')]||null:null,'include':_0x39681e[_0x6db0('0x16')]?_0x39681e[_0x6db0('0x16')][_0x6db0('0x1a')]?_[_0x6db0('0x1b')](_0x39681e[_0x6db0('0x16')][_0x6db0('0x1a')],function(_0x41ee95){return{'model':db[_0x41ee95[_0x6db0('0x1c')]],'as':_0x41ee95['as'],'attributes':_0x41ee95[_0x6db0('0x1d')],'include':_0x41ee95[_0x6db0('0x1a')]?_[_0x6db0('0x1b')](_0x41ee95[_0x6db0('0x1a')],function(_0x5353dc){return{'model':db[_0x5353dc[_0x6db0('0x1c')]],'as':_0x5353dc['as'],'attributes':_0x5353dc[_0x6db0('0x1d')],'include':_0x5353dc[_0x6db0('0x1a')]?_[_0x6db0('0x1b')](_0x5353dc[_0x6db0('0x1a')],function(_0x1cdd26){return{'model':db[_0x1cdd26[_0x6db0('0x1c')]],'as':_0x1cdd26['as'],'attributes':_0x1cdd26[_0x6db0('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x264c3b){logger[_0x6db0('0x12')](_0x6db0('0x21'),_0x39681e);logger['debug'](_0x6db0('0x21'),_0x39681e,JSON['stringify'](_0x264c3b));_0x14878a(_0x264c3b);})[_0x6db0('0x22')](function(_0xe9997f){logger[_0x6db0('0xf')](_0x6db0('0x21'),_0xe9997f['message'],_0x39681e);_0x1f2b9b(_0x526d43['error'](0x1f4,_0xe9997f[_0x6db0('0x11')]));});});}; \ No newline at end of file +var _0x4ac0=['lodash','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','info','FreshdeskAccount,\x20%s,\x20%s','request\x20sent','FreshdeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','GetFreshdeskAccount','FreshdeskAccount','options','raw','where','limit','include','map','model','attributes','debug','catch','ShowFreshdeskAccount'];(function(_0x4dae00,_0x15b194){var _0x16bf42=function(_0x5f2a9a){while(--_0x5f2a9a){_0x4dae00['push'](_0x4dae00['shift']());}};_0x16bf42(++_0x15b194);}(_0x4ac0,0xa0));var _0x04ac=function(_0x3ff085,_0x27c92e){_0x3ff085=_0x3ff085-0x0;var _0x2b68c3=_0x4ac0[_0x3ff085];return _0x2b68c3;};'use strict';var _=require(_0x04ac('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x04ac('0x1'));var fs=require('fs');var Redis=require(_0x04ac('0x2'));var db=require(_0x04ac('0x3'))['db'];var utils=require(_0x04ac('0x4'));var logger=require(_0x04ac('0x5'))(_0x04ac('0x6'));var config=require('../../config/environment');var jayson=require(_0x04ac('0x7'));var client=jayson['client'][_0x04ac('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5020a2,_0x1b3b2a,_0x229171){return new BPromise(function(_0x51c524,_0x68d656){return client[_0x04ac('0x9')](_0x5020a2,_0x229171)[_0x04ac('0xa')](function(_0xdb1162){logger[_0x04ac('0xb')](_0x04ac('0xc'),_0x1b3b2a,_0x04ac('0xd'));logger['debug'](_0x04ac('0xe'),_0x1b3b2a,'request\x20sent',JSON[_0x04ac('0xf')](_0xdb1162));if(_0xdb1162[_0x04ac('0x10')]){if(_0xdb1162['error'][_0x04ac('0x11')]===0x1f4){logger[_0x04ac('0x10')](_0x04ac('0xc'),_0x1b3b2a,_0xdb1162['error'][_0x04ac('0x12')]);return _0x68d656(_0xdb1162[_0x04ac('0x10')][_0x04ac('0x12')]);}logger[_0x04ac('0x10')]('FreshdeskAccount,\x20%s,\x20%s',_0x1b3b2a,_0xdb1162[_0x04ac('0x10')][_0x04ac('0x12')]);return _0x51c524(_0xdb1162[_0x04ac('0x10')]['message']);}else{logger[_0x04ac('0xb')](_0x04ac('0xc'),_0x1b3b2a,'request\x20sent');_0x51c524(_0xdb1162['result'][_0x04ac('0x12')]);}})['catch'](function(_0x1da147){logger[_0x04ac('0x10')](_0x04ac('0xc'),_0x1b3b2a,_0x1da147);_0x68d656(_0x1da147);});});}exports[_0x04ac('0x13')]=function(_0x30a78b){var _0x58535a=this;return new Promise(function(_0x154e66,_0x1f213d){return db[_0x04ac('0x14')]['findAll']({'raw':_0x30a78b[_0x04ac('0x15')]?_0x30a78b['options'][_0x04ac('0x16')]===undefined?!![]:![]:!![],'where':_0x30a78b[_0x04ac('0x15')]?_0x30a78b[_0x04ac('0x15')][_0x04ac('0x17')]||null:null,'attributes':_0x30a78b['options']?_0x30a78b[_0x04ac('0x15')]['attributes']||null:null,'limit':_0x30a78b[_0x04ac('0x15')]?_0x30a78b[_0x04ac('0x15')][_0x04ac('0x18')]||null:null,'include':_0x30a78b['options']?_0x30a78b[_0x04ac('0x15')][_0x04ac('0x19')]?_[_0x04ac('0x1a')](_0x30a78b['options'][_0x04ac('0x19')],function(_0x19594d){return{'model':db[_0x19594d[_0x04ac('0x1b')]],'as':_0x19594d['as'],'attributes':_0x19594d['attributes'],'include':_0x19594d[_0x04ac('0x19')]?_[_0x04ac('0x1a')](_0x19594d[_0x04ac('0x19')],function(_0x22c18c){return{'model':db[_0x22c18c['model']],'as':_0x22c18c['as'],'attributes':_0x22c18c['attributes'],'include':_0x22c18c[_0x04ac('0x19')]?_['map'](_0x22c18c[_0x04ac('0x19')],function(_0x27bafa){return{'model':db[_0x27bafa[_0x04ac('0x1b')]],'as':_0x27bafa['as'],'attributes':_0x27bafa[_0x04ac('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x04ac('0xa')](function(_0x487ec8){logger['info']('GetFreshdeskAccount',_0x30a78b);logger[_0x04ac('0x1d')](_0x04ac('0x13'),_0x30a78b,JSON[_0x04ac('0xf')](_0x487ec8));_0x154e66(_0x487ec8);})[_0x04ac('0x1e')](function(_0x524a8b){logger[_0x04ac('0x10')]('GetFreshdeskAccount',_0x524a8b[_0x04ac('0x12')],_0x30a78b);_0x1f213d(_0x58535a[_0x04ac('0x10')](0x1f4,_0x524a8b[_0x04ac('0x12')]));});});};exports[_0x04ac('0x1f')]=function(_0x1de5a9){var _0x3df8ed=this;return new Promise(function(_0x1b467e,_0x4dbf44){return db[_0x04ac('0x14')]['find']({'raw':_0x1de5a9[_0x04ac('0x15')]?_0x1de5a9[_0x04ac('0x15')][_0x04ac('0x16')]===undefined?!![]:![]:!![],'where':_0x1de5a9[_0x04ac('0x15')]?_0x1de5a9[_0x04ac('0x15')]['where']||null:null,'attributes':_0x1de5a9['options']?_0x1de5a9['options'][_0x04ac('0x1c')]||null:null,'include':_0x1de5a9[_0x04ac('0x15')]?_0x1de5a9[_0x04ac('0x15')][_0x04ac('0x19')]?_[_0x04ac('0x1a')](_0x1de5a9['options']['include'],function(_0x628909){return{'model':db[_0x628909['model']],'as':_0x628909['as'],'attributes':_0x628909[_0x04ac('0x1c')],'include':_0x628909['include']?_[_0x04ac('0x1a')](_0x628909[_0x04ac('0x19')],function(_0x1b63c0){return{'model':db[_0x1b63c0[_0x04ac('0x1b')]],'as':_0x1b63c0['as'],'attributes':_0x1b63c0[_0x04ac('0x1c')],'include':_0x1b63c0['include']?_[_0x04ac('0x1a')](_0x1b63c0['include'],function(_0x2b343c){return{'model':db[_0x2b343c[_0x04ac('0x1b')]],'as':_0x2b343c['as'],'attributes':_0x2b343c[_0x04ac('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x04ac('0xa')](function(_0x3c84b9){logger['info'](_0x04ac('0x1f'),_0x1de5a9);logger[_0x04ac('0x1d')](_0x04ac('0x1f'),_0x1de5a9,JSON[_0x04ac('0xf')](_0x3c84b9));_0x1b467e(_0x3c84b9);})['catch'](function(_0x428449){logger[_0x04ac('0x10')]('ShowFreshdeskAccount',_0x428449[_0x04ac('0x12')],_0x1de5a9);_0x4dbf44(_0x3df8ed[_0x04ac('0x10')](0x1f4,_0x428449[_0x04ac('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/index.js b/server/api/intFreshdeskConfiguration/index.js index 3b5f512..204e231 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 _0xf06e=['/:id/tags','getTags','post','create','setTags','put','update','delete','destroy','exports','multer','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/fields','/:id/subjects'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xf06e,0xb2));var _0xef06=function(_0x3cd8ce,_0x4b797e){_0x3cd8ce=_0x3cd8ce-0x0;var _0x149ea6=_0xf06e[_0x3cd8ce];return _0x149ea6;};'use strict';var multer=require(_0xef06('0x0'));var util=require('util');var path=require(_0xef06('0x1'));var timeout=require(_0xef06('0x2'));var express=require('express');var router=express[_0xef06('0x3')]();var fs_extra=require(_0xef06('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xef06('0x5'));var config=require(_0xef06('0x6'));var controller=require('./intFreshdeskConfiguration.controller');router[_0xef06('0x7')]('/',auth[_0xef06('0x8')](),controller[_0xef06('0x9')]);router[_0xef06('0x7')](_0xef06('0xa'),auth['isAuthenticated'](),controller[_0xef06('0xb')]);router[_0xef06('0x7')](_0xef06('0xc'),auth[_0xef06('0x8')](),controller['getFields']);router['get'](_0xef06('0xd'),auth[_0xef06('0x8')](),controller['getSubjects']);router['get']('/:id/descriptions',auth['isAuthenticated'](),controller['getDescriptions']);router['get'](_0xef06('0xe'),auth[_0xef06('0x8')](),controller[_0xef06('0xf')]);router[_0xef06('0x10')]('/',auth[_0xef06('0x8')](),controller[_0xef06('0x11')]);router[_0xef06('0x10')](_0xef06('0xe'),auth['isAuthenticated'](),controller[_0xef06('0x12')]);router[_0xef06('0x13')]('/:id',auth[_0xef06('0x8')](),controller[_0xef06('0x14')]);router[_0xef06('0x15')](_0xef06('0xa'),auth[_0xef06('0x8')](),controller[_0xef06('0x16')]);module[_0xef06('0x17')]=router; \ No newline at end of file +var _0xfa67=['create','setTags','update','delete','destroy','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intFreshdeskConfiguration.controller','get','index','/:id','isAuthenticated','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','/:id/tags','getTags','post'];(function(_0x588690,_0x4a4620){var _0x23d533=function(_0x483df6){while(--_0x483df6){_0x588690['push'](_0x588690['shift']());}};_0x23d533(++_0x4a4620);}(_0xfa67,0x1d9));var _0x7fa6=function(_0x3d2a0f,_0x4212f3){_0x3d2a0f=_0x3d2a0f-0x0;var _0x19d3db=_0xfa67[_0x3d2a0f];return _0x19d3db;};'use strict';var multer=require(_0x7fa6('0x0'));var util=require(_0x7fa6('0x1'));var path=require(_0x7fa6('0x2'));var timeout=require(_0x7fa6('0x3'));var express=require('express');var router=express[_0x7fa6('0x4')]();var fs_extra=require(_0x7fa6('0x5'));var auth=require(_0x7fa6('0x6'));var interaction=require(_0x7fa6('0x7'));var config=require('../../config/environment');var controller=require(_0x7fa6('0x8'));router[_0x7fa6('0x9')]('/',auth['isAuthenticated'](),controller[_0x7fa6('0xa')]);router[_0x7fa6('0x9')](_0x7fa6('0xb'),auth[_0x7fa6('0xc')](),controller['show']);router[_0x7fa6('0x9')](_0x7fa6('0xd'),auth[_0x7fa6('0xc')](),controller[_0x7fa6('0xe')]);router['get'](_0x7fa6('0xf'),auth[_0x7fa6('0xc')](),controller[_0x7fa6('0x10')]);router[_0x7fa6('0x9')](_0x7fa6('0x11'),auth['isAuthenticated'](),controller['getDescriptions']);router[_0x7fa6('0x9')](_0x7fa6('0x12'),auth[_0x7fa6('0xc')](),controller[_0x7fa6('0x13')]);router[_0x7fa6('0x14')]('/',auth[_0x7fa6('0xc')](),controller[_0x7fa6('0x15')]);router[_0x7fa6('0x14')](_0x7fa6('0x12'),auth[_0x7fa6('0xc')](),controller[_0x7fa6('0x16')]);router['put'](_0x7fa6('0xb'),auth[_0x7fa6('0xc')](),controller[_0x7fa6('0x17')]);router[_0x7fa6('0x18')](_0x7fa6('0xb'),auth[_0x7fa6('0xc')](),controller[_0x7fa6('0x19')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js index c30f04d..95951f1 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 _0xa0e0=['STRING'];(function(_0x1f833c,_0x48f64b){var _0x4d6055=function(_0x3cb6fb){while(--_0x3cb6fb){_0x1f833c['push'](_0x1f833c['shift']());}};_0x4d6055(++_0x48f64b);}(_0xa0e0,0xeb));var _0x0a0e=function(_0x46fcf8,_0x1999e2){_0x46fcf8=_0x46fcf8-0x0;var _0x507fb9=_0xa0e0[_0x46fcf8];return _0x507fb9;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x0a0e('0x0')]},'description':{'type':Sequelize[_0x0a0e('0x0')]}}; \ No newline at end of file +var _0x9190=['exports','STRING'];(function(_0x446ba0,_0x184669){var _0xff06ed=function(_0x3d0476){while(--_0x3d0476){_0x446ba0['push'](_0x446ba0['shift']());}};_0xff06ed(++_0x184669);}(_0x9190,0x140));var _0x0919=function(_0x39ac6c,_0xa016a9){_0x39ac6c=_0x39ac6c-0x0;var _0x2e1a4c=_0x9190[_0x39ac6c];return _0x2e1a4c;};'use strict';var Sequelize=require('sequelize');module[_0x0919('0x0')]={'name':{'type':Sequelize[_0x0919('0x1')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js index afb647b..67175fa 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 _0x791c=['moment','bluebird','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','destroy','then','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','options','FreshdeskConfiguration','includeAll','include','findAll','catch','show','params','find','create','update','body','getFields','filter','getSubjects','findOne','FreshdeskField','getDescriptions','getTags','Tag','setTags','eml-format','zip-dir','fast-json-patch','request-promise'];(function(_0x52f15e,_0x23b9d0){var _0x5caabe=function(_0x341545){while(--_0x341545){_0x52f15e['push'](_0x52f15e['shift']());}};_0x5caabe(++_0x23b9d0);}(_0x791c,0x148));var _0xc791=function(_0x49f67f,_0x4113a4){_0x49f67f=_0x49f67f-0x0;var _0x4779a1=_0x791c[_0x49f67f];return _0x4779a1;};'use strict';var emlformat=require(_0xc791('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xc791('0x1'));var jsonpatch=require(_0xc791('0x2'));var rp=require(_0xc791('0x3'));var moment=require(_0xc791('0x4'));var BPromise=require(_0xc791('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0xc791('0x6'));var sox=require(_0xc791('0x7'));var csv=require(_0xc791('0x8'));var ejs=require(_0xc791('0x9'));var fs=require('fs');var fs_extra=require(_0xc791('0xa'));var _=require('lodash');var squel=require(_0xc791('0xb'));var crypto=require(_0xc791('0xc'));var jsforce=require(_0xc791('0xd'));var deskjs=require(_0xc791('0xe'));var toCsv=require(_0xc791('0x8'));var querystring=require(_0xc791('0xf'));var Papa=require('papaparse');var Redis=require(_0xc791('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xc791('0x11'));var hardwareService=require(_0xc791('0x12'));var logger=require(_0xc791('0x13'))('api');var utils=require('../../config/utils');var config=require(_0xc791('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0xc791('0x15'))['db'];function respondWithStatusCode(_0x4d7605,_0x10da87){_0x10da87=_0x10da87||0xcc;return function(_0x5d0583){if(_0x5d0583){return _0x4d7605[_0xc791('0x16')](_0x10da87);}return _0x4d7605[_0xc791('0x17')](_0x10da87)[_0xc791('0x18')]();};}function respondWithResult(_0x4c97b4,_0x36327b){_0x36327b=_0x36327b||0xc8;return function(_0x28476f){if(_0x28476f){return _0x4c97b4[_0xc791('0x17')](_0x36327b)[_0xc791('0x19')](_0x28476f);}};}function respondWithFilteredResult(_0x405d78,_0x4a3d95){return function(_0x56d821){if(_0x56d821){var _0x464a29=typeof _0x4a3d95[_0xc791('0x1a')]===_0xc791('0x1b')&&typeof _0x4a3d95[_0xc791('0x1c')]===_0xc791('0x1b');var _0x1d94c6=_0x56d821[_0xc791('0x1d')];var _0x27c772=_0x464a29?0x0:_0x4a3d95['offset'];var _0x212281=_0x464a29?_0x56d821[_0xc791('0x1d')]:_0x4a3d95[_0xc791('0x1a')]+_0x4a3d95[_0xc791('0x1c')];var _0x2cd0f1;if(_0x212281>=_0x1d94c6){_0x212281=_0x1d94c6;_0x2cd0f1=0xc8;}else{_0x2cd0f1=0xce;}_0x405d78[_0xc791('0x17')](_0x2cd0f1);return _0x405d78[_0xc791('0x1e')](_0xc791('0x1f'),_0x27c772+'-'+_0x212281+'/'+_0x1d94c6)[_0xc791('0x19')](_0x56d821);}return null;};}function patchUpdates(_0x4ddcdc){return function(_0x365fd1){try{jsonpatch['apply'](_0x365fd1,_0x4ddcdc,!![]);}catch(_0x3f3ecb){return BPromise[_0xc791('0x20')](_0x3f3ecb);}return _0x365fd1[_0xc791('0x21')]();};}function saveUpdates(_0x329ba2,_0x497384){return function(_0xc2a7a3){if(_0xc2a7a3){return _0xc2a7a3['update'](_0x329ba2)['then'](function(_0x23e5dc){return _0x23e5dc;});}return null;};}function removeEntity(_0x1e6ad8,_0x18840d){return function(_0x58b3af){if(_0x58b3af){return _0x58b3af[_0xc791('0x22')]()[_0xc791('0x23')](function(){_0x1e6ad8[_0xc791('0x17')](0xcc)[_0xc791('0x18')]();});}};}function handleEntityNotFound(_0x55cced,_0x537f1e){return function(_0xb6a692){if(!_0xb6a692){_0x55cced[_0xc791('0x16')](0x194);}return _0xb6a692;};}function handleError(_0x3172fe,_0x4f2de2){_0x4f2de2=_0x4f2de2||0x1f4;return function(_0x517095){logger[_0xc791('0x24')](_0x517095[_0xc791('0x25')]);if(_0x517095['name']){delete _0x517095[_0xc791('0x26')];}_0x3172fe[_0xc791('0x17')](_0x4f2de2)[_0xc791('0x27')](_0x517095);};}exports[_0xc791('0x28')]=function(_0x226eb5,_0x5ce3ff){var _0xd383d9={},_0xe0538e={},_0x58d3ec={'count':0x0,'rows':[]};var _0x1657dc=_[_0xc791('0x29')](db['FreshdeskConfiguration'][_0xc791('0x2a')],function(_0xa5780a){return{'name':_0xa5780a[_0xc791('0x2b')],'type':_0xa5780a[_0xc791('0x2c')][_0xc791('0x2d')]};});_0xe0538e[_0xc791('0x2e')]=_[_0xc791('0x29')](_0x1657dc,_0xc791('0x26'));_0xe0538e[_0xc791('0x2f')]=_[_0xc791('0x30')](_0x226eb5[_0xc791('0x2f')]);_0xe0538e[_0xc791('0x31')]=_['intersection'](_0xe0538e[_0xc791('0x2e')],_0xe0538e[_0xc791('0x2f')]);_0xd383d9[_0xc791('0x32')]=_[_0xc791('0x33')](_0xe0538e['model'],qs[_0xc791('0x34')](_0x226eb5['query']['fields']));_0xd383d9[_0xc791('0x32')]=_0xd383d9[_0xc791('0x32')][_0xc791('0x35')]?_0xd383d9[_0xc791('0x32')]:_0xe0538e['model'];if(!_0x226eb5[_0xc791('0x2f')][_0xc791('0x36')](_0xc791('0x37'))){_0xd383d9[_0xc791('0x1c')]=qs[_0xc791('0x1c')](_0x226eb5[_0xc791('0x2f')][_0xc791('0x1c')]);_0xd383d9[_0xc791('0x1a')]=qs['offset'](_0x226eb5[_0xc791('0x2f')][_0xc791('0x1a')]);}_0xd383d9[_0xc791('0x38')]=qs[_0xc791('0x39')](_0x226eb5[_0xc791('0x2f')][_0xc791('0x39')]);_0xd383d9[_0xc791('0x3a')]=qs[_0xc791('0x31')](_[_0xc791('0x3b')](_0x226eb5[_0xc791('0x2f')],_0xe0538e['filters']),_0x1657dc);if(_0x226eb5['query']['filter']){_0xd383d9['where']=_[_0xc791('0x3c')](_0xd383d9[_0xc791('0x3a')],{'$or':_[_0xc791('0x29')](_0x1657dc,function(_0x1efda9){if(_0x1efda9[_0xc791('0x2c')]!==_0xc791('0x3d')){var _0x3bcaf8={};_0x3bcaf8[_0x1efda9[_0xc791('0x26')]]={'$like':'%'+_0x226eb5[_0xc791('0x2f')]['filter']+'%'};return _0x3bcaf8;}})});}_0xd383d9=_[_0xc791('0x3c')]({},_0xd383d9,_0x226eb5[_0xc791('0x3e')]);var _0x4d5482={'where':_0xd383d9['where']};return db[_0xc791('0x3f')]['count'](_0x4d5482)['then'](function(_0x559b3e){_0x58d3ec['count']=_0x559b3e;if(_0x226eb5[_0xc791('0x2f')][_0xc791('0x40')]){_0xd383d9[_0xc791('0x41')]=[{'all':!![]}];}return db[_0xc791('0x3f')][_0xc791('0x42')](_0xd383d9);})[_0xc791('0x23')](function(_0x3e85cd){_0x58d3ec['rows']=_0x3e85cd;return _0x58d3ec;})[_0xc791('0x23')](respondWithFilteredResult(_0x5ce3ff,_0xd383d9))[_0xc791('0x43')](handleError(_0x5ce3ff,null));};exports[_0xc791('0x44')]=function(_0x2ae00a,_0x3afb30){var _0x1f1876={'raw':![],'where':{'id':_0x2ae00a[_0xc791('0x45')]['id']}},_0x1f8857={};_0x1f8857['model']=_['keys'](db[_0xc791('0x3f')][_0xc791('0x2a')]);_0x1f8857[_0xc791('0x2f')]=_['keys'](_0x2ae00a['query']);_0x1f8857['filters']=_[_0xc791('0x33')](_0x1f8857['model'],_0x1f8857[_0xc791('0x2f')]);_0x1f1876[_0xc791('0x32')]=_[_0xc791('0x33')](_0x1f8857['model'],qs['fields'](_0x2ae00a[_0xc791('0x2f')][_0xc791('0x34')]));_0x1f1876['attributes']=_0x1f1876[_0xc791('0x32')][_0xc791('0x35')]?_0x1f1876[_0xc791('0x32')]:_0x1f8857[_0xc791('0x2e')];if(_0x2ae00a[_0xc791('0x2f')]['includeAll']){_0x1f1876[_0xc791('0x41')]=[{'all':!![]}];}_0x1f1876=_[_0xc791('0x3c')]({},_0x1f1876,_0x2ae00a[_0xc791('0x3e')]);return db[_0xc791('0x3f')][_0xc791('0x46')](_0x1f1876)['then'](handleEntityNotFound(_0x3afb30,null))[_0xc791('0x23')](respondWithResult(_0x3afb30,null))['catch'](handleError(_0x3afb30,null));};exports['create']=function(_0x2d6b91,_0x30d237){return db['FreshdeskConfiguration'][_0xc791('0x47')](_0x2d6b91['body'],{})[_0xc791('0x23')](respondWithResult(_0x30d237,0xc9))[_0xc791('0x43')](handleError(_0x30d237,null));};exports[_0xc791('0x48')]=function(_0x54be0d,_0x14fbb0){if(_0x54be0d[_0xc791('0x49')]['id']){delete _0x54be0d[_0xc791('0x49')]['id'];}return db['FreshdeskConfiguration'][_0xc791('0x46')]({'where':{'id':_0x54be0d[_0xc791('0x45')]['id']}})['then'](handleEntityNotFound(_0x14fbb0,null))['then'](saveUpdates(_0x54be0d[_0xc791('0x49')],null))[_0xc791('0x23')](respondWithResult(_0x14fbb0,null))['catch'](handleError(_0x14fbb0,null));};exports['destroy']=function(_0x556ec8,_0x151a43){return db[_0xc791('0x3f')][_0xc791('0x46')]({'where':{'id':_0x556ec8['params']['id']}})[_0xc791('0x23')](handleEntityNotFound(_0x151a43,null))[_0xc791('0x23')](removeEntity(_0x151a43,null))[_0xc791('0x43')](handleError(_0x151a43,null));};exports[_0xc791('0x4a')]=function(_0x3b4d40,_0x29061a,_0xe01f5f){var _0x1d84f0={};var _0x3a9d11={};var _0x82e230;var _0x6e386b;return db[_0xc791('0x3f')]['findOne']({'where':{'id':_0x3b4d40['params']['id']}})[_0xc791('0x23')](handleEntityNotFound(_0x29061a,null))[_0xc791('0x23')](function(_0x2f14e4){if(_0x2f14e4){_0x82e230=_0x2f14e4;_0x3a9d11[_0xc791('0x2e')]=_['keys'](db['FreshdeskField'][_0xc791('0x2a')]);_0x3a9d11['query']=_[_0xc791('0x30')](_0x3b4d40[_0xc791('0x2f')]);_0x3a9d11[_0xc791('0x31')]=_[_0xc791('0x33')](_0x3a9d11[_0xc791('0x2e')],_0x3a9d11[_0xc791('0x2f')]);_0x1d84f0[_0xc791('0x32')]=_[_0xc791('0x33')](_0x3a9d11[_0xc791('0x2e')],qs['fields'](_0x3b4d40[_0xc791('0x2f')][_0xc791('0x34')]));_0x1d84f0[_0xc791('0x32')]=_0x1d84f0[_0xc791('0x32')][_0xc791('0x35')]?_0x1d84f0['attributes']:_0x3a9d11[_0xc791('0x2e')];_0x1d84f0[_0xc791('0x38')]=qs['sort'](_0x3b4d40['query'][_0xc791('0x39')]);_0x1d84f0[_0xc791('0x3a')]=qs[_0xc791('0x31')](_[_0xc791('0x3b')](_0x3b4d40[_0xc791('0x2f')],_0x3a9d11[_0xc791('0x31')]));if(_0x3b4d40[_0xc791('0x2f')][_0xc791('0x4b')]){_0x1d84f0[_0xc791('0x3a')]=_[_0xc791('0x3c')](_0x1d84f0[_0xc791('0x3a')],{'$or':_[_0xc791('0x29')](_0x1d84f0[_0xc791('0x32')],function(_0xe7bb0e){var _0x2b2e44={};_0x2b2e44[_0xe7bb0e]={'$like':'%'+_0x3b4d40[_0xc791('0x2f')]['filter']+'%'};return _0x2b2e44;})});}_0x1d84f0=_[_0xc791('0x3c')]({},_0x1d84f0,_0x3b4d40['options']);return _0x82e230[_0xc791('0x4a')](_0x1d84f0);}})[_0xc791('0x23')](function(_0x2fd021){if(_0x2fd021){_0x6e386b=_0x2fd021[_0xc791('0x35')];if(!_0x3b4d40[_0xc791('0x2f')][_0xc791('0x36')]('nolimit')){_0x1d84f0['limit']=qs['limit'](_0x3b4d40[_0xc791('0x2f')]['limit']);_0x1d84f0[_0xc791('0x1a')]=qs[_0xc791('0x1a')](_0x3b4d40['query']['offset']);}return _0x82e230['getFields'](_0x1d84f0);}})[_0xc791('0x23')](function(_0x16209f){if(_0x16209f){return _0x16209f?{'count':_0x6e386b,'rows':_0x16209f}:null;}})[_0xc791('0x23')](respondWithResult(_0x29061a,null))['catch'](handleError(_0x29061a,null));};exports[_0xc791('0x4c')]=function(_0x1a9275,_0x54ab3a,_0x3fd078){var _0x49f859={};var _0xfe8cc2={};var _0x4ab5cc;var _0x10a4ed;return db[_0xc791('0x3f')][_0xc791('0x4d')]({'where':{'id':_0x1a9275[_0xc791('0x45')]['id']}})[_0xc791('0x23')](handleEntityNotFound(_0x54ab3a,null))[_0xc791('0x23')](function(_0x4de6a8){if(_0x4de6a8){_0x4ab5cc=_0x4de6a8;_0xfe8cc2[_0xc791('0x2e')]=_[_0xc791('0x30')](db[_0xc791('0x4e')][_0xc791('0x2a')]);_0xfe8cc2[_0xc791('0x2f')]=_[_0xc791('0x30')](_0x1a9275[_0xc791('0x2f')]);_0xfe8cc2[_0xc791('0x31')]=_[_0xc791('0x33')](_0xfe8cc2[_0xc791('0x2e')],_0xfe8cc2['query']);_0x49f859[_0xc791('0x32')]=_[_0xc791('0x33')](_0xfe8cc2['model'],qs['fields'](_0x1a9275['query'][_0xc791('0x34')]));_0x49f859[_0xc791('0x32')]=_0x49f859[_0xc791('0x32')][_0xc791('0x35')]?_0x49f859[_0xc791('0x32')]:_0xfe8cc2[_0xc791('0x2e')];_0x49f859['order']=qs[_0xc791('0x39')](_0x1a9275[_0xc791('0x2f')][_0xc791('0x39')]);_0x49f859[_0xc791('0x3a')]=qs[_0xc791('0x31')](_[_0xc791('0x3b')](_0x1a9275[_0xc791('0x2f')],_0xfe8cc2[_0xc791('0x31')]));if(_0x1a9275[_0xc791('0x2f')][_0xc791('0x4b')]){_0x49f859[_0xc791('0x3a')]=_['merge'](_0x49f859[_0xc791('0x3a')],{'$or':_['map'](_0x49f859[_0xc791('0x32')],function(_0x43f14a){var _0x391db3={};_0x391db3[_0x43f14a]={'$like':'%'+_0x1a9275[_0xc791('0x2f')][_0xc791('0x4b')]+'%'};return _0x391db3;})});}_0x49f859=_[_0xc791('0x3c')]({},_0x49f859,_0x1a9275[_0xc791('0x3e')]);return _0x4ab5cc['getSubjects'](_0x49f859);}})[_0xc791('0x23')](function(_0x46caad){if(_0x46caad){_0x10a4ed=_0x46caad[_0xc791('0x35')];if(!_0x1a9275['query'][_0xc791('0x36')]('nolimit')){_0x49f859[_0xc791('0x1c')]=qs[_0xc791('0x1c')](_0x1a9275[_0xc791('0x2f')][_0xc791('0x1c')]);_0x49f859[_0xc791('0x1a')]=qs['offset'](_0x1a9275[_0xc791('0x2f')][_0xc791('0x1a')]);}return _0x4ab5cc[_0xc791('0x4c')](_0x49f859);}})[_0xc791('0x23')](function(_0xb46205){if(_0xb46205){return _0xb46205?{'count':_0x10a4ed,'rows':_0xb46205}:null;}})['then'](respondWithResult(_0x54ab3a,null))[_0xc791('0x43')](handleError(_0x54ab3a,null));};exports[_0xc791('0x4f')]=function(_0x218aad,_0x4708d4,_0x296547){var _0x38130c={};var _0x2a3487={};var _0x4281de;var _0x272eed;return db[_0xc791('0x3f')][_0xc791('0x4d')]({'where':{'id':_0x218aad['params']['id']}})[_0xc791('0x23')](handleEntityNotFound(_0x4708d4,null))[_0xc791('0x23')](function(_0x2a955d){if(_0x2a955d){_0x4281de=_0x2a955d;_0x2a3487[_0xc791('0x2e')]=_['keys'](db[_0xc791('0x4e')][_0xc791('0x2a')]);_0x2a3487[_0xc791('0x2f')]=_[_0xc791('0x30')](_0x218aad['query']);_0x2a3487[_0xc791('0x31')]=_[_0xc791('0x33')](_0x2a3487[_0xc791('0x2e')],_0x2a3487['query']);_0x38130c[_0xc791('0x32')]=_[_0xc791('0x33')](_0x2a3487[_0xc791('0x2e')],qs[_0xc791('0x34')](_0x218aad[_0xc791('0x2f')][_0xc791('0x34')]));_0x38130c[_0xc791('0x32')]=_0x38130c[_0xc791('0x32')][_0xc791('0x35')]?_0x38130c[_0xc791('0x32')]:_0x2a3487[_0xc791('0x2e')];_0x38130c['order']=qs['sort'](_0x218aad[_0xc791('0x2f')][_0xc791('0x39')]);_0x38130c[_0xc791('0x3a')]=qs[_0xc791('0x31')](_[_0xc791('0x3b')](_0x218aad[_0xc791('0x2f')],_0x2a3487[_0xc791('0x31')]));if(_0x218aad['query'][_0xc791('0x4b')]){_0x38130c[_0xc791('0x3a')]=_[_0xc791('0x3c')](_0x38130c[_0xc791('0x3a')],{'$or':_[_0xc791('0x29')](_0x38130c[_0xc791('0x32')],function(_0x522bdf){var _0x1a010d={};_0x1a010d[_0x522bdf]={'$like':'%'+_0x218aad[_0xc791('0x2f')][_0xc791('0x4b')]+'%'};return _0x1a010d;})});}_0x38130c=_[_0xc791('0x3c')]({},_0x38130c,_0x218aad['options']);return _0x4281de[_0xc791('0x4f')](_0x38130c);}})['then'](function(_0x3dc6ea){if(_0x3dc6ea){_0x272eed=_0x3dc6ea['length'];if(!_0x218aad[_0xc791('0x2f')]['hasOwnProperty'](_0xc791('0x37'))){_0x38130c[_0xc791('0x1c')]=qs[_0xc791('0x1c')](_0x218aad[_0xc791('0x2f')][_0xc791('0x1c')]);_0x38130c[_0xc791('0x1a')]=qs[_0xc791('0x1a')](_0x218aad['query'][_0xc791('0x1a')]);}return _0x4281de['getDescriptions'](_0x38130c);}})[_0xc791('0x23')](function(_0x5b1be2){if(_0x5b1be2){return _0x5b1be2?{'count':_0x272eed,'rows':_0x5b1be2}:null;}})['then'](respondWithResult(_0x4708d4,null))['catch'](handleError(_0x4708d4,null));};exports[_0xc791('0x50')]=function(_0x402a80,_0x170506,_0x74678c){var _0x29e1e2={};var _0x1e783b={};var _0x2e633b;var _0x406069;return db[_0xc791('0x3f')][_0xc791('0x4d')]({'where':{'id':_0x402a80[_0xc791('0x45')]['id']}})['then'](handleEntityNotFound(_0x170506,null))[_0xc791('0x23')](function(_0x316590){if(_0x316590){_0x2e633b=_0x316590;_0x1e783b[_0xc791('0x2e')]=_['keys'](db[_0xc791('0x51')]['rawAttributes']);_0x1e783b[_0xc791('0x2f')]=_[_0xc791('0x30')](_0x402a80[_0xc791('0x2f')]);_0x1e783b['filters']=_[_0xc791('0x33')](_0x1e783b['model'],_0x1e783b[_0xc791('0x2f')]);_0x29e1e2['attributes']=_[_0xc791('0x33')](_0x1e783b[_0xc791('0x2e')],qs[_0xc791('0x34')](_0x402a80['query'][_0xc791('0x34')]));_0x29e1e2[_0xc791('0x32')]=_0x29e1e2['attributes'][_0xc791('0x35')]?_0x29e1e2[_0xc791('0x32')]:_0x1e783b[_0xc791('0x2e')];_0x29e1e2[_0xc791('0x38')]=qs[_0xc791('0x39')](_0x402a80[_0xc791('0x2f')][_0xc791('0x39')]);_0x29e1e2[_0xc791('0x3a')]=qs[_0xc791('0x31')](_[_0xc791('0x3b')](_0x402a80[_0xc791('0x2f')],_0x1e783b['filters']));if(_0x402a80[_0xc791('0x2f')][_0xc791('0x4b')]){_0x29e1e2[_0xc791('0x3a')]=_[_0xc791('0x3c')](_0x29e1e2[_0xc791('0x3a')],{'$or':_[_0xc791('0x29')](_0x29e1e2[_0xc791('0x32')],function(_0xbfedb0){var _0x4c06e3={};_0x4c06e3[_0xbfedb0]={'$like':'%'+_0x402a80[_0xc791('0x2f')][_0xc791('0x4b')]+'%'};return _0x4c06e3;})});}_0x29e1e2=_['merge']({},_0x29e1e2,_0x402a80['options']);return _0x2e633b[_0xc791('0x50')](_0x29e1e2);}})['then'](function(_0x2bc883){if(_0x2bc883){_0x406069=_0x2bc883['length'];if(!_0x402a80[_0xc791('0x2f')]['hasOwnProperty'](_0xc791('0x37'))){_0x29e1e2['limit']=qs[_0xc791('0x1c')](_0x402a80[_0xc791('0x2f')][_0xc791('0x1c')]);_0x29e1e2[_0xc791('0x1a')]=qs[_0xc791('0x1a')](_0x402a80[_0xc791('0x2f')][_0xc791('0x1a')]);}return _0x2e633b['getTags'](_0x29e1e2);}})['then'](function(_0x4feb68){if(_0x4feb68){return _0x4feb68?{'count':_0x406069,'rows':_0x4feb68}:null;}})[_0xc791('0x23')](respondWithResult(_0x170506,null))['catch'](handleError(_0x170506,null));};exports[_0xc791('0x52')]=function(_0xbd2801,_0x4fece8,_0xc52378){if(_0xbd2801[_0xc791('0x49')]['id']){delete _0xbd2801[_0xc791('0x49')]['id'];}return db[_0xc791('0x3f')][_0xc791('0x4d')]({'where':{'id':_0xbd2801[_0xc791('0x45')]['id']}})[_0xc791('0x23')](handleEntityNotFound(_0x4fece8,null))['then'](function(_0x119388){if(_0x119388){return _0x119388[_0xc791('0x52')](_0xbd2801[_0xc791('0x49')]['ids']||[]);}return null;})['then'](respondWithResult(_0x4fece8,null))[_0xc791('0x43')](handleError(_0x4fece8,null));}; \ No newline at end of file +var _0xfc70=['count','set','apply','reject','save','destroy','then','stack','name','send','index','map','FreshdeskConfiguration','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','params','find','create','body','catch','update','getFields','FreshdeskField','getSubjects','findOne','hasOwnProperty','getDescriptions','Tag','getTags','setTags','ids','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined'];(function(_0x1721f5,_0x43e6f2){var _0x14e9a2=function(_0x44986e){while(--_0x44986e){_0x1721f5['push'](_0x1721f5['shift']());}};_0x14e9a2(++_0x43e6f2);}(_0xfc70,0x8c));var _0x0fc7=function(_0x2e4303,_0x3bca1a){_0x2e4303=_0x2e4303-0x0;var _0x54cf0e=_0xfc70[_0x2e4303];return _0x54cf0e;};'use strict';var emlformat=require(_0x0fc7('0x0'));var rimraf=require(_0x0fc7('0x1'));var zipdir=require(_0x0fc7('0x2'));var jsonpatch=require(_0x0fc7('0x3'));var rp=require(_0x0fc7('0x4'));var moment=require('moment');var BPromise=require(_0x0fc7('0x5'));var Mustache=require(_0x0fc7('0x6'));var util=require('util');var path=require(_0x0fc7('0x7'));var sox=require(_0x0fc7('0x8'));var csv=require(_0x0fc7('0x9'));var ejs=require(_0x0fc7('0xa'));var fs=require('fs');var fs_extra=require(_0x0fc7('0xb'));var _=require(_0x0fc7('0xc'));var squel=require(_0x0fc7('0xd'));var crypto=require(_0x0fc7('0xe'));var jsforce=require(_0x0fc7('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x0fc7('0x9'));var querystring=require(_0x0fc7('0x10'));var Papa=require(_0x0fc7('0x11'));var Redis=require(_0x0fc7('0x12'));var authService=require(_0x0fc7('0x13'));var qs=require(_0x0fc7('0x14'));var as=require(_0x0fc7('0x15'));var hardwareService=require(_0x0fc7('0x16'));var logger=require(_0x0fc7('0x17'))('api');var utils=require(_0x0fc7('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x0fc7('0x19'));var db=require(_0x0fc7('0x1a'))['db'];function respondWithStatusCode(_0x5632c,_0x4e7e08){_0x4e7e08=_0x4e7e08||0xcc;return function(_0x16640e){if(_0x16640e){return _0x5632c[_0x0fc7('0x1b')](_0x4e7e08);}return _0x5632c[_0x0fc7('0x1c')](_0x4e7e08)[_0x0fc7('0x1d')]();};}function respondWithResult(_0x32f97f,_0x561d65){_0x561d65=_0x561d65||0xc8;return function(_0x159ff1){if(_0x159ff1){return _0x32f97f[_0x0fc7('0x1c')](_0x561d65)[_0x0fc7('0x1e')](_0x159ff1);}};}function respondWithFilteredResult(_0x5e3cf9,_0xb1dfaf){return function(_0x31f6c5){if(_0x31f6c5){var _0x4a53e3=typeof _0xb1dfaf[_0x0fc7('0x1f')]==='undefined'&&typeof _0xb1dfaf[_0x0fc7('0x20')]===_0x0fc7('0x21');var _0x2c5c24=_0x31f6c5[_0x0fc7('0x22')];var _0x41701e=_0x4a53e3?0x0:_0xb1dfaf[_0x0fc7('0x1f')];var _0x2221b4=_0x4a53e3?_0x31f6c5['count']:_0xb1dfaf[_0x0fc7('0x1f')]+_0xb1dfaf[_0x0fc7('0x20')];var _0x3d2d63;if(_0x2221b4>=_0x2c5c24){_0x2221b4=_0x2c5c24;_0x3d2d63=0xc8;}else{_0x3d2d63=0xce;}_0x5e3cf9[_0x0fc7('0x1c')](_0x3d2d63);return _0x5e3cf9[_0x0fc7('0x23')]('Content-Range',_0x41701e+'-'+_0x2221b4+'/'+_0x2c5c24)[_0x0fc7('0x1e')](_0x31f6c5);}return null;};}function patchUpdates(_0x2a602c){return function(_0x1018f5){try{jsonpatch[_0x0fc7('0x24')](_0x1018f5,_0x2a602c,!![]);}catch(_0x5b7691){return BPromise[_0x0fc7('0x25')](_0x5b7691);}return _0x1018f5[_0x0fc7('0x26')]();};}function saveUpdates(_0x5642e5,_0x1b4cb3){return function(_0x3fa40c){if(_0x3fa40c){return _0x3fa40c['update'](_0x5642e5)['then'](function(_0x129d9f){return _0x129d9f;});}return null;};}function removeEntity(_0x2ee435,_0x535bf4){return function(_0x131ec1){if(_0x131ec1){return _0x131ec1[_0x0fc7('0x27')]()[_0x0fc7('0x28')](function(){_0x2ee435[_0x0fc7('0x1c')](0xcc)[_0x0fc7('0x1d')]();});}};}function handleEntityNotFound(_0x554451,_0x483e0e){return function(_0x57cbe8){if(!_0x57cbe8){_0x554451[_0x0fc7('0x1b')](0x194);}return _0x57cbe8;};}function handleError(_0x21a4a8,_0x277ea){_0x277ea=_0x277ea||0x1f4;return function(_0x349ad0){logger['error'](_0x349ad0[_0x0fc7('0x29')]);if(_0x349ad0[_0x0fc7('0x2a')]){delete _0x349ad0[_0x0fc7('0x2a')];}_0x21a4a8[_0x0fc7('0x1c')](_0x277ea)[_0x0fc7('0x2b')](_0x349ad0);};}exports[_0x0fc7('0x2c')]=function(_0x567a35,_0x5745f0){var _0x286bda={},_0x4e665f={},_0x50f3a7={'count':0x0,'rows':[]};var _0xb5c422=_[_0x0fc7('0x2d')](db[_0x0fc7('0x2e')][_0x0fc7('0x2f')],function(_0x23af97){return{'name':_0x23af97[_0x0fc7('0x30')],'type':_0x23af97[_0x0fc7('0x31')][_0x0fc7('0x32')]};});_0x4e665f[_0x0fc7('0x33')]=_['map'](_0xb5c422,_0x0fc7('0x2a'));_0x4e665f[_0x0fc7('0x34')]=_[_0x0fc7('0x35')](_0x567a35[_0x0fc7('0x34')]);_0x4e665f[_0x0fc7('0x36')]=_[_0x0fc7('0x37')](_0x4e665f[_0x0fc7('0x33')],_0x4e665f['query']);_0x286bda[_0x0fc7('0x38')]=_[_0x0fc7('0x37')](_0x4e665f[_0x0fc7('0x33')],qs[_0x0fc7('0x39')](_0x567a35[_0x0fc7('0x34')][_0x0fc7('0x39')]));_0x286bda['attributes']=_0x286bda[_0x0fc7('0x38')][_0x0fc7('0x3a')]?_0x286bda['attributes']:_0x4e665f[_0x0fc7('0x33')];if(!_0x567a35[_0x0fc7('0x34')]['hasOwnProperty'](_0x0fc7('0x3b'))){_0x286bda['limit']=qs[_0x0fc7('0x20')](_0x567a35['query'][_0x0fc7('0x20')]);_0x286bda[_0x0fc7('0x1f')]=qs['offset'](_0x567a35[_0x0fc7('0x34')][_0x0fc7('0x1f')]);}_0x286bda[_0x0fc7('0x3c')]=qs[_0x0fc7('0x3d')](_0x567a35[_0x0fc7('0x34')][_0x0fc7('0x3d')]);_0x286bda[_0x0fc7('0x3e')]=qs['filters'](_[_0x0fc7('0x3f')](_0x567a35['query'],_0x4e665f['filters']),_0xb5c422);if(_0x567a35[_0x0fc7('0x34')][_0x0fc7('0x40')]){_0x286bda[_0x0fc7('0x3e')]=_['merge'](_0x286bda[_0x0fc7('0x3e')],{'$or':_['map'](_0xb5c422,function(_0x3cbd69){if(_0x3cbd69[_0x0fc7('0x31')]!==_0x0fc7('0x41')){var _0xb67e15={};_0xb67e15[_0x3cbd69[_0x0fc7('0x2a')]]={'$like':'%'+_0x567a35[_0x0fc7('0x34')][_0x0fc7('0x40')]+'%'};return _0xb67e15;}})});}_0x286bda=_[_0x0fc7('0x42')]({},_0x286bda,_0x567a35[_0x0fc7('0x43')]);var _0x2e5d74={'where':_0x286bda[_0x0fc7('0x3e')]};return db[_0x0fc7('0x2e')][_0x0fc7('0x22')](_0x2e5d74)['then'](function(_0xb1a9ac){_0x50f3a7['count']=_0xb1a9ac;if(_0x567a35['query'][_0x0fc7('0x44')]){_0x286bda[_0x0fc7('0x45')]=[{'all':!![]}];}return db[_0x0fc7('0x2e')][_0x0fc7('0x46')](_0x286bda);})['then'](function(_0x149440){_0x50f3a7['rows']=_0x149440;return _0x50f3a7;})[_0x0fc7('0x28')](respondWithFilteredResult(_0x5745f0,_0x286bda))['catch'](handleError(_0x5745f0,null));};exports['show']=function(_0x20f028,_0x1e1d26){var _0x4e87c6={'raw':![],'where':{'id':_0x20f028[_0x0fc7('0x47')]['id']}},_0x51c2e2={};_0x51c2e2[_0x0fc7('0x33')]=_[_0x0fc7('0x35')](db[_0x0fc7('0x2e')][_0x0fc7('0x2f')]);_0x51c2e2['query']=_[_0x0fc7('0x35')](_0x20f028['query']);_0x51c2e2[_0x0fc7('0x36')]=_[_0x0fc7('0x37')](_0x51c2e2['model'],_0x51c2e2[_0x0fc7('0x34')]);_0x4e87c6[_0x0fc7('0x38')]=_[_0x0fc7('0x37')](_0x51c2e2[_0x0fc7('0x33')],qs['fields'](_0x20f028[_0x0fc7('0x34')]['fields']));_0x4e87c6[_0x0fc7('0x38')]=_0x4e87c6[_0x0fc7('0x38')][_0x0fc7('0x3a')]?_0x4e87c6[_0x0fc7('0x38')]:_0x51c2e2[_0x0fc7('0x33')];if(_0x20f028[_0x0fc7('0x34')][_0x0fc7('0x44')]){_0x4e87c6[_0x0fc7('0x45')]=[{'all':!![]}];}_0x4e87c6=_['merge']({},_0x4e87c6,_0x20f028[_0x0fc7('0x43')]);return db[_0x0fc7('0x2e')][_0x0fc7('0x48')](_0x4e87c6)[_0x0fc7('0x28')](handleEntityNotFound(_0x1e1d26,null))[_0x0fc7('0x28')](respondWithResult(_0x1e1d26,null))['catch'](handleError(_0x1e1d26,null));};exports['create']=function(_0x4c6279,_0xe5fc42){return db['FreshdeskConfiguration'][_0x0fc7('0x49')](_0x4c6279[_0x0fc7('0x4a')],{})['then'](respondWithResult(_0xe5fc42,0xc9))[_0x0fc7('0x4b')](handleError(_0xe5fc42,null));};exports[_0x0fc7('0x4c')]=function(_0x392fa4,_0x237550){if(_0x392fa4[_0x0fc7('0x4a')]['id']){delete _0x392fa4['body']['id'];}return db[_0x0fc7('0x2e')][_0x0fc7('0x48')]({'where':{'id':_0x392fa4[_0x0fc7('0x47')]['id']}})[_0x0fc7('0x28')](handleEntityNotFound(_0x237550,null))[_0x0fc7('0x28')](saveUpdates(_0x392fa4[_0x0fc7('0x4a')],null))[_0x0fc7('0x28')](respondWithResult(_0x237550,null))[_0x0fc7('0x4b')](handleError(_0x237550,null));};exports['destroy']=function(_0x2d5f85,_0x3e5556){return db['FreshdeskConfiguration'][_0x0fc7('0x48')]({'where':{'id':_0x2d5f85[_0x0fc7('0x47')]['id']}})[_0x0fc7('0x28')](handleEntityNotFound(_0x3e5556,null))[_0x0fc7('0x28')](removeEntity(_0x3e5556,null))[_0x0fc7('0x4b')](handleError(_0x3e5556,null));};exports[_0x0fc7('0x4d')]=function(_0x3341c1,_0xc154c8,_0x304f67){var _0x2a7aa4={};var _0x4b556a={};var _0x5cb657;var _0x4468fa;return db[_0x0fc7('0x2e')]['findOne']({'where':{'id':_0x3341c1[_0x0fc7('0x47')]['id']}})[_0x0fc7('0x28')](handleEntityNotFound(_0xc154c8,null))['then'](function(_0x2bba1d){if(_0x2bba1d){_0x5cb657=_0x2bba1d;_0x4b556a[_0x0fc7('0x33')]=_[_0x0fc7('0x35')](db[_0x0fc7('0x4e')][_0x0fc7('0x2f')]);_0x4b556a[_0x0fc7('0x34')]=_[_0x0fc7('0x35')](_0x3341c1[_0x0fc7('0x34')]);_0x4b556a['filters']=_['intersection'](_0x4b556a[_0x0fc7('0x33')],_0x4b556a['query']);_0x2a7aa4[_0x0fc7('0x38')]=_[_0x0fc7('0x37')](_0x4b556a[_0x0fc7('0x33')],qs[_0x0fc7('0x39')](_0x3341c1[_0x0fc7('0x34')]['fields']));_0x2a7aa4['attributes']=_0x2a7aa4[_0x0fc7('0x38')][_0x0fc7('0x3a')]?_0x2a7aa4[_0x0fc7('0x38')]:_0x4b556a[_0x0fc7('0x33')];_0x2a7aa4[_0x0fc7('0x3c')]=qs[_0x0fc7('0x3d')](_0x3341c1['query'][_0x0fc7('0x3d')]);_0x2a7aa4[_0x0fc7('0x3e')]=qs[_0x0fc7('0x36')](_['pick'](_0x3341c1[_0x0fc7('0x34')],_0x4b556a[_0x0fc7('0x36')]));if(_0x3341c1[_0x0fc7('0x34')]['filter']){_0x2a7aa4['where']=_[_0x0fc7('0x42')](_0x2a7aa4[_0x0fc7('0x3e')],{'$or':_[_0x0fc7('0x2d')](_0x2a7aa4[_0x0fc7('0x38')],function(_0x2a4c5e){var _0x57a635={};_0x57a635[_0x2a4c5e]={'$like':'%'+_0x3341c1[_0x0fc7('0x34')][_0x0fc7('0x40')]+'%'};return _0x57a635;})});}_0x2a7aa4=_[_0x0fc7('0x42')]({},_0x2a7aa4,_0x3341c1[_0x0fc7('0x43')]);return _0x5cb657[_0x0fc7('0x4d')](_0x2a7aa4);}})[_0x0fc7('0x28')](function(_0x3b8e8e){if(_0x3b8e8e){_0x4468fa=_0x3b8e8e[_0x0fc7('0x3a')];if(!_0x3341c1[_0x0fc7('0x34')]['hasOwnProperty'](_0x0fc7('0x3b'))){_0x2a7aa4[_0x0fc7('0x20')]=qs[_0x0fc7('0x20')](_0x3341c1['query'][_0x0fc7('0x20')]);_0x2a7aa4[_0x0fc7('0x1f')]=qs[_0x0fc7('0x1f')](_0x3341c1[_0x0fc7('0x34')][_0x0fc7('0x1f')]);}return _0x5cb657['getFields'](_0x2a7aa4);}})[_0x0fc7('0x28')](function(_0x1a16fc){if(_0x1a16fc){return _0x1a16fc?{'count':_0x4468fa,'rows':_0x1a16fc}:null;}})['then'](respondWithResult(_0xc154c8,null))[_0x0fc7('0x4b')](handleError(_0xc154c8,null));};exports[_0x0fc7('0x4f')]=function(_0x1d44bc,_0x1bb12c,_0x5b1a21){var _0x1d3beb={};var _0x3899b7={};var _0x31d0c7;var _0x4dacbf;return db[_0x0fc7('0x2e')][_0x0fc7('0x50')]({'where':{'id':_0x1d44bc['params']['id']}})['then'](handleEntityNotFound(_0x1bb12c,null))[_0x0fc7('0x28')](function(_0x35827c){if(_0x35827c){_0x31d0c7=_0x35827c;_0x3899b7[_0x0fc7('0x33')]=_[_0x0fc7('0x35')](db[_0x0fc7('0x4e')][_0x0fc7('0x2f')]);_0x3899b7[_0x0fc7('0x34')]=_[_0x0fc7('0x35')](_0x1d44bc['query']);_0x3899b7[_0x0fc7('0x36')]=_[_0x0fc7('0x37')](_0x3899b7[_0x0fc7('0x33')],_0x3899b7[_0x0fc7('0x34')]);_0x1d3beb[_0x0fc7('0x38')]=_[_0x0fc7('0x37')](_0x3899b7[_0x0fc7('0x33')],qs[_0x0fc7('0x39')](_0x1d44bc['query']['fields']));_0x1d3beb[_0x0fc7('0x38')]=_0x1d3beb[_0x0fc7('0x38')][_0x0fc7('0x3a')]?_0x1d3beb[_0x0fc7('0x38')]:_0x3899b7[_0x0fc7('0x33')];_0x1d3beb[_0x0fc7('0x3c')]=qs[_0x0fc7('0x3d')](_0x1d44bc[_0x0fc7('0x34')][_0x0fc7('0x3d')]);_0x1d3beb['where']=qs[_0x0fc7('0x36')](_['pick'](_0x1d44bc['query'],_0x3899b7['filters']));if(_0x1d44bc[_0x0fc7('0x34')]['filter']){_0x1d3beb['where']=_['merge'](_0x1d3beb[_0x0fc7('0x3e')],{'$or':_[_0x0fc7('0x2d')](_0x1d3beb[_0x0fc7('0x38')],function(_0x293c80){var _0x5f355f={};_0x5f355f[_0x293c80]={'$like':'%'+_0x1d44bc[_0x0fc7('0x34')]['filter']+'%'};return _0x5f355f;})});}_0x1d3beb=_['merge']({},_0x1d3beb,_0x1d44bc[_0x0fc7('0x43')]);return _0x31d0c7[_0x0fc7('0x4f')](_0x1d3beb);}})['then'](function(_0x40ed50){if(_0x40ed50){_0x4dacbf=_0x40ed50[_0x0fc7('0x3a')];if(!_0x1d44bc[_0x0fc7('0x34')][_0x0fc7('0x51')](_0x0fc7('0x3b'))){_0x1d3beb['limit']=qs[_0x0fc7('0x20')](_0x1d44bc[_0x0fc7('0x34')][_0x0fc7('0x20')]);_0x1d3beb[_0x0fc7('0x1f')]=qs[_0x0fc7('0x1f')](_0x1d44bc[_0x0fc7('0x34')][_0x0fc7('0x1f')]);}return _0x31d0c7[_0x0fc7('0x4f')](_0x1d3beb);}})[_0x0fc7('0x28')](function(_0x501493){if(_0x501493){return _0x501493?{'count':_0x4dacbf,'rows':_0x501493}:null;}})[_0x0fc7('0x28')](respondWithResult(_0x1bb12c,null))[_0x0fc7('0x4b')](handleError(_0x1bb12c,null));};exports[_0x0fc7('0x52')]=function(_0x375116,_0x5a39b4,_0x58a125){var _0x29d652={};var _0xf338ad={};var _0x1cec79;var _0x480987;return db[_0x0fc7('0x2e')]['findOne']({'where':{'id':_0x375116[_0x0fc7('0x47')]['id']}})[_0x0fc7('0x28')](handleEntityNotFound(_0x5a39b4,null))['then'](function(_0x512bd9){if(_0x512bd9){_0x1cec79=_0x512bd9;_0xf338ad[_0x0fc7('0x33')]=_[_0x0fc7('0x35')](db[_0x0fc7('0x4e')][_0x0fc7('0x2f')]);_0xf338ad['query']=_[_0x0fc7('0x35')](_0x375116[_0x0fc7('0x34')]);_0xf338ad['filters']=_[_0x0fc7('0x37')](_0xf338ad[_0x0fc7('0x33')],_0xf338ad[_0x0fc7('0x34')]);_0x29d652[_0x0fc7('0x38')]=_['intersection'](_0xf338ad[_0x0fc7('0x33')],qs['fields'](_0x375116[_0x0fc7('0x34')][_0x0fc7('0x39')]));_0x29d652[_0x0fc7('0x38')]=_0x29d652[_0x0fc7('0x38')]['length']?_0x29d652[_0x0fc7('0x38')]:_0xf338ad[_0x0fc7('0x33')];_0x29d652[_0x0fc7('0x3c')]=qs[_0x0fc7('0x3d')](_0x375116[_0x0fc7('0x34')][_0x0fc7('0x3d')]);_0x29d652[_0x0fc7('0x3e')]=qs[_0x0fc7('0x36')](_[_0x0fc7('0x3f')](_0x375116['query'],_0xf338ad[_0x0fc7('0x36')]));if(_0x375116[_0x0fc7('0x34')][_0x0fc7('0x40')]){_0x29d652[_0x0fc7('0x3e')]=_[_0x0fc7('0x42')](_0x29d652[_0x0fc7('0x3e')],{'$or':_[_0x0fc7('0x2d')](_0x29d652[_0x0fc7('0x38')],function(_0x16c3be){var _0x583bbf={};_0x583bbf[_0x16c3be]={'$like':'%'+_0x375116[_0x0fc7('0x34')][_0x0fc7('0x40')]+'%'};return _0x583bbf;})});}_0x29d652=_['merge']({},_0x29d652,_0x375116['options']);return _0x1cec79[_0x0fc7('0x52')](_0x29d652);}})[_0x0fc7('0x28')](function(_0x5b337b){if(_0x5b337b){_0x480987=_0x5b337b[_0x0fc7('0x3a')];if(!_0x375116[_0x0fc7('0x34')][_0x0fc7('0x51')]('nolimit')){_0x29d652[_0x0fc7('0x20')]=qs[_0x0fc7('0x20')](_0x375116[_0x0fc7('0x34')][_0x0fc7('0x20')]);_0x29d652['offset']=qs[_0x0fc7('0x1f')](_0x375116[_0x0fc7('0x34')][_0x0fc7('0x1f')]);}return _0x1cec79['getDescriptions'](_0x29d652);}})[_0x0fc7('0x28')](function(_0x23f5b5){if(_0x23f5b5){return _0x23f5b5?{'count':_0x480987,'rows':_0x23f5b5}:null;}})[_0x0fc7('0x28')](respondWithResult(_0x5a39b4,null))['catch'](handleError(_0x5a39b4,null));};exports['getTags']=function(_0x539839,_0x340db1,_0xbc2ce8){var _0x1ded52={};var _0x2b6317={};var _0x1e0052;var _0x2e7ab9;return db[_0x0fc7('0x2e')]['findOne']({'where':{'id':_0x539839['params']['id']}})['then'](handleEntityNotFound(_0x340db1,null))['then'](function(_0x545e9a){if(_0x545e9a){_0x1e0052=_0x545e9a;_0x2b6317[_0x0fc7('0x33')]=_[_0x0fc7('0x35')](db[_0x0fc7('0x53')]['rawAttributes']);_0x2b6317['query']=_['keys'](_0x539839[_0x0fc7('0x34')]);_0x2b6317[_0x0fc7('0x36')]=_['intersection'](_0x2b6317[_0x0fc7('0x33')],_0x2b6317[_0x0fc7('0x34')]);_0x1ded52[_0x0fc7('0x38')]=_['intersection'](_0x2b6317[_0x0fc7('0x33')],qs[_0x0fc7('0x39')](_0x539839[_0x0fc7('0x34')][_0x0fc7('0x39')]));_0x1ded52[_0x0fc7('0x38')]=_0x1ded52[_0x0fc7('0x38')]['length']?_0x1ded52[_0x0fc7('0x38')]:_0x2b6317[_0x0fc7('0x33')];_0x1ded52[_0x0fc7('0x3c')]=qs[_0x0fc7('0x3d')](_0x539839['query'][_0x0fc7('0x3d')]);_0x1ded52[_0x0fc7('0x3e')]=qs[_0x0fc7('0x36')](_[_0x0fc7('0x3f')](_0x539839[_0x0fc7('0x34')],_0x2b6317['filters']));if(_0x539839[_0x0fc7('0x34')][_0x0fc7('0x40')]){_0x1ded52[_0x0fc7('0x3e')]=_['merge'](_0x1ded52[_0x0fc7('0x3e')],{'$or':_[_0x0fc7('0x2d')](_0x1ded52[_0x0fc7('0x38')],function(_0x4151d4){var _0xedcec={};_0xedcec[_0x4151d4]={'$like':'%'+_0x539839['query'][_0x0fc7('0x40')]+'%'};return _0xedcec;})});}_0x1ded52=_[_0x0fc7('0x42')]({},_0x1ded52,_0x539839[_0x0fc7('0x43')]);return _0x1e0052[_0x0fc7('0x54')](_0x1ded52);}})[_0x0fc7('0x28')](function(_0x5c727d){if(_0x5c727d){_0x2e7ab9=_0x5c727d[_0x0fc7('0x3a')];if(!_0x539839['query']['hasOwnProperty'](_0x0fc7('0x3b'))){_0x1ded52[_0x0fc7('0x20')]=qs[_0x0fc7('0x20')](_0x539839[_0x0fc7('0x34')][_0x0fc7('0x20')]);_0x1ded52['offset']=qs[_0x0fc7('0x1f')](_0x539839[_0x0fc7('0x34')][_0x0fc7('0x1f')]);}return _0x1e0052[_0x0fc7('0x54')](_0x1ded52);}})[_0x0fc7('0x28')](function(_0x2f2900){if(_0x2f2900){return _0x2f2900?{'count':_0x2e7ab9,'rows':_0x2f2900}:null;}})[_0x0fc7('0x28')](respondWithResult(_0x340db1,null))['catch'](handleError(_0x340db1,null));};exports['setTags']=function(_0x3dd6f4,_0x15e2d2,_0x16c2d5){if(_0x3dd6f4[_0x0fc7('0x4a')]['id']){delete _0x3dd6f4[_0x0fc7('0x4a')]['id'];}return db[_0x0fc7('0x2e')][_0x0fc7('0x50')]({'where':{'id':_0x3dd6f4[_0x0fc7('0x47')]['id']}})[_0x0fc7('0x28')](handleEntityNotFound(_0x15e2d2,null))[_0x0fc7('0x28')](function(_0x3dc1f8){if(_0x3dc1f8){return _0x3dc1f8[_0x0fc7('0x55')](_0x3dd6f4[_0x0fc7('0x4a')][_0x0fc7('0x56')]||[]);}return null;})[_0x0fc7('0x28')](respondWithResult(_0x15e2d2,null))[_0x0fc7('0x4b')](handleError(_0x15e2d2,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js index 8d36e9f..d23777d 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 _0xd85e=['define','FreshdeskConfiguration','int_freshdesk_configurations','util','api','moment','request-promise','path','rimraf','../../config/environment','exports'];(function(_0x391b99,_0x50709c){var _0x2a2d7d=function(_0x5697e9){while(--_0x5697e9){_0x391b99['push'](_0x391b99['shift']());}};_0x2a2d7d(++_0x50709c);}(_0xd85e,0xa8));var _0xed85=function(_0x4ae3a9,_0x4f18c6){_0x4ae3a9=_0x4ae3a9-0x0;var _0x26a3d0=_0xd85e[_0x4ae3a9];return _0x26a3d0;};'use strict';var _=require('lodash');var util=require(_0xed85('0x0'));var logger=require('../../config/logger')(_0xed85('0x1'));var moment=require(_0xed85('0x2'));var BPromise=require('bluebird');var rp=require(_0xed85('0x3'));var fs=require('fs');var path=require(_0xed85('0x4'));var rimraf=require(_0xed85('0x5'));var config=require(_0xed85('0x6'));var attributes=require('./intFreshdeskConfiguration.attributes');module[_0xed85('0x7')]=function(_0x573f82,_0x23344d){return _0x573f82[_0xed85('0x8')](_0xed85('0x9'),attributes,{'tableName':_0xed85('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x32d0=['path','rimraf','../../config/environment','./intFreshdeskConfiguration.attributes','define','FreshdeskConfiguration','int_freshdesk_configurations','util','../../config/logger','api','bluebird','request-promise'];(function(_0x378b4,_0x5ca7fa){var _0x11d07b=function(_0x35d420){while(--_0x35d420){_0x378b4['push'](_0x378b4['shift']());}};_0x11d07b(++_0x5ca7fa);}(_0x32d0,0x1b7));var _0x032d=function(_0x427877,_0x38645d){_0x427877=_0x427877-0x0;var _0x2e0cb2=_0x32d0[_0x427877];return _0x2e0cb2;};'use strict';var _=require('lodash');var util=require(_0x032d('0x0'));var logger=require(_0x032d('0x1'))(_0x032d('0x2'));var moment=require('moment');var BPromise=require(_0x032d('0x3'));var rp=require(_0x032d('0x4'));var fs=require('fs');var path=require(_0x032d('0x5'));var rimraf=require(_0x032d('0x6'));var config=require(_0x032d('0x7'));var attributes=require(_0x032d('0x8'));module['exports']=function(_0x57b32c,_0x137996){return _0x57b32c[_0x032d('0x9')](_0x032d('0xa'),attributes,{'tableName':_0x032d('0xb'),'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 4d63254..44ae9d7 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 _0x09fd=['request','FreshdeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','error','message','info','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','http'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x09fd,0x1d1));var _0xd09f=function(_0x1c9562,_0x58b78b){_0x1c9562=_0x1c9562-0x0;var _0x47cbe8=_0x09fd[_0x1c9562];return _0x47cbe8;};'use strict';var _=require(_0xd09f('0x0'));var util=require('util');var moment=require(_0xd09f('0x1'));var BPromise=require(_0xd09f('0x2'));var rs=require(_0xd09f('0x3'));var fs=require('fs');var Redis=require(_0xd09f('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xd09f('0x5'));var logger=require(_0xd09f('0x6'))(_0xd09f('0x7'));var config=require('../../config/environment');var jayson=require(_0xd09f('0x8'));var client=jayson['client'][_0xd09f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x536000,_0x263a8f,_0x3e30d5){return new BPromise(function(_0x4e1aea,_0x3c23db){return client[_0xd09f('0xa')](_0x536000,_0x3e30d5)['then'](function(_0x37140d){logger['info'](_0xd09f('0xb'),_0x263a8f,_0xd09f('0xc'));logger[_0xd09f('0xd')]('FreshdeskConfiguration,\x20%s,\x20%s,\x20%s',_0x263a8f,'request\x20sent',JSON['stringify'](_0x37140d));if(_0x37140d[_0xd09f('0xe')]){if(_0x37140d[_0xd09f('0xe')]['code']===0x1f4){logger[_0xd09f('0xe')](_0xd09f('0xb'),_0x263a8f,_0x37140d[_0xd09f('0xe')][_0xd09f('0xf')]);return _0x3c23db(_0x37140d[_0xd09f('0xe')][_0xd09f('0xf')]);}logger[_0xd09f('0xe')](_0xd09f('0xb'),_0x263a8f,_0x37140d[_0xd09f('0xe')][_0xd09f('0xf')]);return _0x4e1aea(_0x37140d[_0xd09f('0xe')][_0xd09f('0xf')]);}else{logger[_0xd09f('0x10')](_0xd09f('0xb'),_0x263a8f,_0xd09f('0xc'));_0x4e1aea(_0x37140d[_0xd09f('0x11')][_0xd09f('0xf')]);}})[_0xd09f('0x12')](function(_0x25d15d){logger['error'](_0xd09f('0xb'),_0x263a8f,_0x25d15d);_0x3c23db(_0x25d15d);});});} \ No newline at end of file +var _0xc2aa=['request\x20sent','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','FreshdeskConfiguration,\x20%s,\x20%s','message','result','catch','lodash','util','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x4828b1,_0x5c8cf3){var _0x1fec1b=function(_0x3f2e5a){while(--_0x3f2e5a){_0x4828b1['push'](_0x4828b1['shift']());}};_0x1fec1b(++_0x5c8cf3);}(_0xc2aa,0x93));var _0xac2a=function(_0x5705cd,_0x350347){_0x5705cd=_0x5705cd-0x0;var _0x4597b4=_0xc2aa[_0x5705cd];return _0x4597b4;};'use strict';var _=require(_0xac2a('0x0'));var util=require(_0xac2a('0x1'));var moment=require('moment');var BPromise=require(_0xac2a('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xac2a('0x3'));var db=require(_0xac2a('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xac2a('0x5'))(_0xac2a('0x6'));var config=require(_0xac2a('0x7'));var jayson=require(_0xac2a('0x8'));var client=jayson[_0xac2a('0x9')][_0xac2a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x574862,_0x507051,_0x24584c){return new BPromise(function(_0x255147,_0x400d65){return client[_0xac2a('0xb')](_0x574862,_0x24584c)[_0xac2a('0xc')](function(_0x10f387){logger[_0xac2a('0xd')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x507051,_0xac2a('0xe'));logger['debug'](_0xac2a('0xf'),_0x507051,'request\x20sent',JSON[_0xac2a('0x10')](_0x10f387));if(_0x10f387[_0xac2a('0x11')]){if(_0x10f387[_0xac2a('0x11')][_0xac2a('0x12')]===0x1f4){logger[_0xac2a('0x11')](_0xac2a('0x13'),_0x507051,_0x10f387[_0xac2a('0x11')][_0xac2a('0x14')]);return _0x400d65(_0x10f387[_0xac2a('0x11')]['message']);}logger[_0xac2a('0x11')](_0xac2a('0x13'),_0x507051,_0x10f387[_0xac2a('0x11')]['message']);return _0x255147(_0x10f387[_0xac2a('0x11')][_0xac2a('0x14')]);}else{logger['info'](_0xac2a('0x13'),_0x507051,_0xac2a('0xe'));_0x255147(_0x10f387[_0xac2a('0x15')][_0xac2a('0x14')]);}})[_0xac2a('0x16')](function(_0x1edb9c){logger[_0xac2a('0x11')](_0xac2a('0x13'),_0x507051,_0x1edb9c);_0x400d65(_0x1edb9c);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskField/index.js b/server/api/intFreshdeskField/index.js index 3bd188c..5f046e9 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 _0xb177=['../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskField.controller','get','isAuthenticated','index','/:id','show','post','create','put','delete','destroy','multer','util','path','express','Router','fs-extra'];(function(_0x32cf9a,_0x3d9190){var _0x5530a5=function(_0x4d1016){while(--_0x4d1016){_0x32cf9a['push'](_0x32cf9a['shift']());}};_0x5530a5(++_0x3d9190);}(_0xb177,0xfe));var _0x7b17=function(_0x57ebdf,_0x43f9dc){_0x57ebdf=_0x57ebdf-0x0;var _0x59909a=_0xb177[_0x57ebdf];return _0x59909a;};'use strict';var multer=require(_0x7b17('0x0'));var util=require(_0x7b17('0x1'));var path=require(_0x7b17('0x2'));var timeout=require('connect-timeout');var express=require(_0x7b17('0x3'));var router=express[_0x7b17('0x4')]();var fs_extra=require(_0x7b17('0x5'));var auth=require(_0x7b17('0x6'));var interaction=require(_0x7b17('0x7'));var config=require(_0x7b17('0x8'));var controller=require(_0x7b17('0x9'));router[_0x7b17('0xa')]('/',auth[_0x7b17('0xb')](),controller[_0x7b17('0xc')]);router[_0x7b17('0xa')](_0x7b17('0xd'),auth[_0x7b17('0xb')](),controller[_0x7b17('0xe')]);router[_0x7b17('0xf')]('/',auth[_0x7b17('0xb')](),controller[_0x7b17('0x10')]);router[_0x7b17('0x11')](_0x7b17('0xd'),auth[_0x7b17('0xb')](),controller['update']);router[_0x7b17('0x12')]('/:id',auth['isAuthenticated'](),controller[_0x7b17('0x13')]);module['exports']=router; \ No newline at end of file +var _0xacc1=['destroy','exports','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','/:id','show','put','update'];(function(_0x1b81bc,_0x6557c7){var _0xdbd059=function(_0x5063f6){while(--_0x5063f6){_0x1b81bc['push'](_0x1b81bc['shift']());}};_0xdbd059(++_0x6557c7);}(_0xacc1,0x1f1));var _0x1acc=function(_0x520d9b,_0x336417){_0x520d9b=_0x520d9b-0x0;var _0x3d86f1=_0xacc1[_0x520d9b];return _0x3d86f1;};'use strict';var multer=require(_0x1acc('0x0'));var util=require(_0x1acc('0x1'));var path=require('path');var timeout=require(_0x1acc('0x2'));var express=require(_0x1acc('0x3'));var router=express['Router']();var fs_extra=require(_0x1acc('0x4'));var auth=require(_0x1acc('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x1acc('0x6'));var controller=require('./intFreshdeskField.controller');router[_0x1acc('0x7')]('/',auth[_0x1acc('0x8')](),controller['index']);router[_0x1acc('0x7')](_0x1acc('0x9'),auth[_0x1acc('0x8')](),controller[_0x1acc('0xa')]);router['post']('/',auth[_0x1acc('0x8')](),controller['create']);router[_0x1acc('0xb')](_0x1acc('0x9'),auth[_0x1acc('0x8')](),controller[_0x1acc('0xc')]);router['delete'](_0x1acc('0x9'),auth[_0x1acc('0x8')](),controller[_0x1acc('0xd')]);module[_0x1acc('0xe')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.attributes.js b/server/api/intFreshdeskField/intFreshdeskField.attributes.js index 7483070..4134826 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 _0x356d=['STRING','string','exports','ENUM','variable','customVariable','keyValue','picklist'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x356d,0x9a));var _0xd356=function(_0x36d45b,_0x417426){_0x36d45b=_0x36d45b-0x0;var _0x3dc01c=_0x356d[_0x36d45b];return _0x3dc01c;};'use strict';var Sequelize=require('sequelize');module[_0xd356('0x0')]={'type':{'type':Sequelize[_0xd356('0x1')]('string',_0xd356('0x2'),_0xd356('0x3'),_0xd356('0x4'),_0xd356('0x5')),'defaultValue':'string'},'content':{'type':Sequelize[_0xd356('0x6')]},'key':{'type':Sequelize[_0xd356('0x6')]},'keyType':{'type':Sequelize['ENUM'](_0xd356('0x7'),_0xd356('0x2'),_0xd356('0x3'))},'keyContent':{'type':Sequelize[_0xd356('0x6')]},'idField':{'type':Sequelize[_0xd356('0x6')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xd356('0x6')]}}; \ No newline at end of file +var _0x1d03=['sequelize','string','variable','customVariable','keyValue','picklist','STRING','BOOLEAN'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x1d03,0x100));var _0x31d0=function(_0x445721,_0x59dca6){_0x445721=_0x445721-0x0;var _0x5063b8=_0x1d03[_0x445721];return _0x5063b8;};'use strict';var Sequelize=require(_0x31d0('0x0'));module['exports']={'type':{'type':Sequelize['ENUM'](_0x31d0('0x1'),_0x31d0('0x2'),_0x31d0('0x3'),_0x31d0('0x4'),_0x31d0('0x5')),'defaultValue':_0x31d0('0x1')},'content':{'type':Sequelize[_0x31d0('0x6')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize['ENUM']('string',_0x31d0('0x2'),_0x31d0('0x3'))},'keyContent':{'type':Sequelize[_0x31d0('0x6')]},'idField':{'type':Sequelize[_0x31d0('0x6')]},'nameField':{'type':Sequelize[_0x31d0('0x6')]},'customField':{'type':Sequelize[_0x31d0('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.controller.js b/server/api/intFreshdeskField/intFreshdeskField.controller.js index 335825f..c12053c 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 _0xad8a=['hasOwnProperty','offset','sort','where','pick','filter','merge','VIRTUAL','options','FreshdeskField','findAll','rows','show','params','length','includeAll','include','find','body','catch','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields'];(function(_0x125ff8,_0x41925f){var _0x2d9ef=function(_0x4ef34c){while(--_0x4ef34c){_0x125ff8['push'](_0x125ff8['shift']());}};_0x2d9ef(++_0x41925f);}(_0xad8a,0xb0));var _0xaad8=function(_0x3e1ee9,_0x29d28c){_0x3e1ee9=_0x3e1ee9-0x0;var _0x1f7c18=_0xad8a[_0x3e1ee9];return _0x1f7c18;};'use strict';var emlformat=require(_0xaad8('0x0'));var rimraf=require(_0xaad8('0x1'));var zipdir=require(_0xaad8('0x2'));var jsonpatch=require(_0xaad8('0x3'));var rp=require(_0xaad8('0x4'));var moment=require('moment');var BPromise=require(_0xaad8('0x5'));var Mustache=require(_0xaad8('0x6'));var util=require(_0xaad8('0x7'));var path=require('path');var sox=require(_0xaad8('0x8'));var csv=require(_0xaad8('0x9'));var ejs=require(_0xaad8('0xa'));var fs=require('fs');var fs_extra=require(_0xaad8('0xb'));var _=require(_0xaad8('0xc'));var squel=require(_0xaad8('0xd'));var crypto=require(_0xaad8('0xe'));var jsforce=require(_0xaad8('0xf'));var deskjs=require(_0xaad8('0x10'));var toCsv=require(_0xaad8('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xaad8('0x11'));var authService=require(_0xaad8('0x12'));var qs=require(_0xaad8('0x13'));var as=require(_0xaad8('0x14'));var hardwareService=require(_0xaad8('0x15'));var logger=require(_0xaad8('0x16'))(_0xaad8('0x17'));var utils=require(_0xaad8('0x18'));var config=require(_0xaad8('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0xaad8('0x1a'))['db'];function respondWithStatusCode(_0x2a13fb,_0xed6744){_0xed6744=_0xed6744||0xcc;return function(_0x456b77){if(_0x456b77){return _0x2a13fb[_0xaad8('0x1b')](_0xed6744);}return _0x2a13fb[_0xaad8('0x1c')](_0xed6744)[_0xaad8('0x1d')]();};}function respondWithResult(_0x357bf6,_0x1c70d3){_0x1c70d3=_0x1c70d3||0xc8;return function(_0x4372fc){if(_0x4372fc){return _0x357bf6[_0xaad8('0x1c')](_0x1c70d3)[_0xaad8('0x1e')](_0x4372fc);}};}function respondWithFilteredResult(_0x28bf95,_0x5e4fbb){return function(_0x334c4d){if(_0x334c4d){var _0xb63cb3=typeof _0x5e4fbb['offset']===_0xaad8('0x1f')&&typeof _0x5e4fbb[_0xaad8('0x20')]===_0xaad8('0x1f');var _0xc17ada=_0x334c4d[_0xaad8('0x21')];var _0x3895e2=_0xb63cb3?0x0:_0x5e4fbb['offset'];var _0xfd8b0a=_0xb63cb3?_0x334c4d[_0xaad8('0x21')]:_0x5e4fbb['offset']+_0x5e4fbb[_0xaad8('0x20')];var _0x4c681e;if(_0xfd8b0a>=_0xc17ada){_0xfd8b0a=_0xc17ada;_0x4c681e=0xc8;}else{_0x4c681e=0xce;}_0x28bf95[_0xaad8('0x1c')](_0x4c681e);return _0x28bf95[_0xaad8('0x22')](_0xaad8('0x23'),_0x3895e2+'-'+_0xfd8b0a+'/'+_0xc17ada)[_0xaad8('0x1e')](_0x334c4d);}return null;};}function patchUpdates(_0x5cb39b){return function(_0x18b856){try{jsonpatch[_0xaad8('0x24')](_0x18b856,_0x5cb39b,!![]);}catch(_0x594681){return BPromise[_0xaad8('0x25')](_0x594681);}return _0x18b856[_0xaad8('0x26')]();};}function saveUpdates(_0x262e57,_0x5b4b61){return function(_0x5ba0fb){if(_0x5ba0fb){return _0x5ba0fb[_0xaad8('0x27')](_0x262e57)[_0xaad8('0x28')](function(_0x3930f0){return _0x3930f0;});}return null;};}function removeEntity(_0x15e0c6,_0x29ba69){return function(_0x1daacf){if(_0x1daacf){return _0x1daacf[_0xaad8('0x29')]()[_0xaad8('0x28')](function(){_0x15e0c6[_0xaad8('0x1c')](0xcc)[_0xaad8('0x1d')]();});}};}function handleEntityNotFound(_0x1bbac4,_0x217bfc){return function(_0x4193cb){if(!_0x4193cb){_0x1bbac4[_0xaad8('0x1b')](0x194);}return _0x4193cb;};}function handleError(_0x4485c3,_0x492a4a){_0x492a4a=_0x492a4a||0x1f4;return function(_0x3d254e){logger[_0xaad8('0x2a')](_0x3d254e[_0xaad8('0x2b')]);if(_0x3d254e['name']){delete _0x3d254e[_0xaad8('0x2c')];}_0x4485c3[_0xaad8('0x1c')](_0x492a4a)[_0xaad8('0x2d')](_0x3d254e);};}exports[_0xaad8('0x2e')]=function(_0x24c01d,_0x5434a9){var _0xafb149={},_0x43c489={},_0x1e253f={'count':0x0,'rows':[]};var _0x31ad19=_[_0xaad8('0x2f')](db['FreshdeskField'][_0xaad8('0x30')],function(_0x4030ea){return{'name':_0x4030ea[_0xaad8('0x31')],'type':_0x4030ea[_0xaad8('0x32')]['key']};});_0x43c489[_0xaad8('0x33')]=_[_0xaad8('0x2f')](_0x31ad19,_0xaad8('0x2c'));_0x43c489[_0xaad8('0x34')]=_[_0xaad8('0x35')](_0x24c01d['query']);_0x43c489[_0xaad8('0x36')]=_[_0xaad8('0x37')](_0x43c489['model'],_0x43c489['query']);_0xafb149[_0xaad8('0x38')]=_[_0xaad8('0x37')](_0x43c489[_0xaad8('0x33')],qs[_0xaad8('0x39')](_0x24c01d['query'][_0xaad8('0x39')]));_0xafb149[_0xaad8('0x38')]=_0xafb149['attributes']['length']?_0xafb149[_0xaad8('0x38')]:_0x43c489[_0xaad8('0x33')];if(!_0x24c01d['query'][_0xaad8('0x3a')]('nolimit')){_0xafb149['limit']=qs[_0xaad8('0x20')](_0x24c01d[_0xaad8('0x34')]['limit']);_0xafb149[_0xaad8('0x3b')]=qs[_0xaad8('0x3b')](_0x24c01d[_0xaad8('0x34')][_0xaad8('0x3b')]);}_0xafb149['order']=qs[_0xaad8('0x3c')](_0x24c01d[_0xaad8('0x34')][_0xaad8('0x3c')]);_0xafb149[_0xaad8('0x3d')]=qs[_0xaad8('0x36')](_[_0xaad8('0x3e')](_0x24c01d['query'],_0x43c489[_0xaad8('0x36')]),_0x31ad19);if(_0x24c01d[_0xaad8('0x34')][_0xaad8('0x3f')]){_0xafb149['where']=_[_0xaad8('0x40')](_0xafb149[_0xaad8('0x3d')],{'$or':_[_0xaad8('0x2f')](_0x31ad19,function(_0x2864c4){if(_0x2864c4[_0xaad8('0x32')]!==_0xaad8('0x41')){var _0x3c699c={};_0x3c699c[_0x2864c4['name']]={'$like':'%'+_0x24c01d[_0xaad8('0x34')][_0xaad8('0x3f')]+'%'};return _0x3c699c;}})});}_0xafb149=_[_0xaad8('0x40')]({},_0xafb149,_0x24c01d[_0xaad8('0x42')]);var _0x3cb8ea={'where':_0xafb149[_0xaad8('0x3d')]};return db['FreshdeskField'][_0xaad8('0x21')](_0x3cb8ea)[_0xaad8('0x28')](function(_0x3ea87e){_0x1e253f[_0xaad8('0x21')]=_0x3ea87e;if(_0x24c01d['query']['includeAll']){_0xafb149['include']=[{'all':!![]}];}return db[_0xaad8('0x43')][_0xaad8('0x44')](_0xafb149);})[_0xaad8('0x28')](function(_0x5bb668){_0x1e253f[_0xaad8('0x45')]=_0x5bb668;return _0x1e253f;})[_0xaad8('0x28')](respondWithFilteredResult(_0x5434a9,_0xafb149))['catch'](handleError(_0x5434a9,null));};exports[_0xaad8('0x46')]=function(_0x11e67e,_0x2fd56a){var _0x292d4e={'raw':!![],'where':{'id':_0x11e67e[_0xaad8('0x47')]['id']}},_0x3933ac={};_0x3933ac[_0xaad8('0x33')]=_[_0xaad8('0x35')](db[_0xaad8('0x43')][_0xaad8('0x30')]);_0x3933ac[_0xaad8('0x34')]=_[_0xaad8('0x35')](_0x11e67e['query']);_0x3933ac['filters']=_['intersection'](_0x3933ac[_0xaad8('0x33')],_0x3933ac['query']);_0x292d4e[_0xaad8('0x38')]=_['intersection'](_0x3933ac['model'],qs[_0xaad8('0x39')](_0x11e67e['query'][_0xaad8('0x39')]));_0x292d4e[_0xaad8('0x38')]=_0x292d4e[_0xaad8('0x38')][_0xaad8('0x48')]?_0x292d4e[_0xaad8('0x38')]:_0x3933ac[_0xaad8('0x33')];if(_0x11e67e[_0xaad8('0x34')][_0xaad8('0x49')]){_0x292d4e[_0xaad8('0x4a')]=[{'all':!![]}];}_0x292d4e=_[_0xaad8('0x40')]({},_0x292d4e,_0x11e67e[_0xaad8('0x42')]);return db[_0xaad8('0x43')][_0xaad8('0x4b')](_0x292d4e)[_0xaad8('0x28')](handleEntityNotFound(_0x2fd56a,null))[_0xaad8('0x28')](respondWithResult(_0x2fd56a,null))['catch'](handleError(_0x2fd56a,null));};exports['create']=function(_0x46bf2a,_0x42cfa4){return db[_0xaad8('0x43')]['create'](_0x46bf2a['body'],{})[_0xaad8('0x28')](respondWithResult(_0x42cfa4,0xc9))['catch'](handleError(_0x42cfa4,null));};exports[_0xaad8('0x27')]=function(_0x1560ef,_0x313824){if(_0x1560ef[_0xaad8('0x4c')]['id']){delete _0x1560ef[_0xaad8('0x4c')]['id'];}return db[_0xaad8('0x43')][_0xaad8('0x4b')]({'where':{'id':_0x1560ef[_0xaad8('0x47')]['id']}})[_0xaad8('0x28')](handleEntityNotFound(_0x313824,null))['then'](saveUpdates(_0x1560ef[_0xaad8('0x4c')],null))[_0xaad8('0x28')](respondWithResult(_0x313824,null))['catch'](handleError(_0x313824,null));};exports[_0xaad8('0x29')]=function(_0x5e5ef1,_0x2a2542){return db[_0xaad8('0x43')][_0xaad8('0x4b')]({'where':{'id':_0x5e5ef1[_0xaad8('0x47')]['id']}})[_0xaad8('0x28')](handleEntityNotFound(_0x2a2542,null))[_0xaad8('0x28')](removeEntity(_0x2a2542,null))[_0xaad8('0x4d')](handleError(_0x2a2542,null));}; \ No newline at end of file +var _0x049e=['moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','limit','undefined','count','Content-Range','json','reject','save','update','then','error','stack','index','map','FreshdeskField','rawAttributes','fieldName','type','key','model','query','keys','attributes','intersection','fields','length','nolimit','order','sort','filters','pick','filter','where','merge','VIRTUAL','name','options','includeAll','findAll','rows','catch','show','params','include','find','create','body','destroy','eml-format','rimraf','fast-json-patch'];(function(_0x37c22c,_0x28a70d){var _0x119d79=function(_0x243a13){while(--_0x243a13){_0x37c22c['push'](_0x37c22c['shift']());}};_0x119d79(++_0x28a70d);}(_0x049e,0x16a));var _0xe049=function(_0x490be3,_0xf0fca3){_0x490be3=_0x490be3-0x0;var _0x3f5140=_0x049e[_0x490be3];return _0x3f5140;};'use strict';var emlformat=require(_0xe049('0x0'));var rimraf=require(_0xe049('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe049('0x2'));var rp=require('request-promise');var moment=require(_0xe049('0x3'));var BPromise=require(_0xe049('0x4'));var Mustache=require(_0xe049('0x5'));var util=require(_0xe049('0x6'));var path=require(_0xe049('0x7'));var sox=require('sox');var csv=require(_0xe049('0x8'));var ejs=require(_0xe049('0x9'));var fs=require('fs');var fs_extra=require(_0xe049('0xa'));var _=require(_0xe049('0xb'));var squel=require(_0xe049('0xc'));var crypto=require(_0xe049('0xd'));var jsforce=require(_0xe049('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xe049('0x8'));var querystring=require(_0xe049('0xf'));var Papa=require(_0xe049('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xe049('0x11'));var as=require(_0xe049('0x12'));var hardwareService=require(_0xe049('0x13'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0xe049('0x14'));var licenseUtil=require(_0xe049('0x15'));var db=require(_0xe049('0x16'))['db'];function respondWithStatusCode(_0x359931,_0x301c7e){_0x301c7e=_0x301c7e||0xcc;return function(_0x1021e7){if(_0x1021e7){return _0x359931[_0xe049('0x17')](_0x301c7e);}return _0x359931[_0xe049('0x18')](_0x301c7e)['end']();};}function respondWithResult(_0x20c286,_0x3f4a57){_0x3f4a57=_0x3f4a57||0xc8;return function(_0x3924a4){if(_0x3924a4){return _0x20c286[_0xe049('0x18')](_0x3f4a57)['json'](_0x3924a4);}};}function respondWithFilteredResult(_0x3a539b,_0xcc35b6){return function(_0x5c90fd){if(_0x5c90fd){var _0x388be0=typeof _0xcc35b6[_0xe049('0x19')]==='undefined'&&typeof _0xcc35b6[_0xe049('0x1a')]===_0xe049('0x1b');var _0x5d435b=_0x5c90fd[_0xe049('0x1c')];var _0x54c303=_0x388be0?0x0:_0xcc35b6['offset'];var _0x3cbbeb=_0x388be0?_0x5c90fd['count']:_0xcc35b6['offset']+_0xcc35b6[_0xe049('0x1a')];var _0x1092ec;if(_0x3cbbeb>=_0x5d435b){_0x3cbbeb=_0x5d435b;_0x1092ec=0xc8;}else{_0x1092ec=0xce;}_0x3a539b['status'](_0x1092ec);return _0x3a539b['set'](_0xe049('0x1d'),_0x54c303+'-'+_0x3cbbeb+'/'+_0x5d435b)[_0xe049('0x1e')](_0x5c90fd);}return null;};}function patchUpdates(_0x1d2f5b){return function(_0x430421){try{jsonpatch['apply'](_0x430421,_0x1d2f5b,!![]);}catch(_0x572f29){return BPromise[_0xe049('0x1f')](_0x572f29);}return _0x430421[_0xe049('0x20')]();};}function saveUpdates(_0x572a80,_0x36a03b){return function(_0x3f14eb){if(_0x3f14eb){return _0x3f14eb[_0xe049('0x21')](_0x572a80)['then'](function(_0x197358){return _0x197358;});}return null;};}function removeEntity(_0x3b0f54,_0x4c7492){return function(_0x4848c9){if(_0x4848c9){return _0x4848c9['destroy']()[_0xe049('0x22')](function(){_0x3b0f54['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1aafd1,_0x1efbbe){return function(_0x53620b){if(!_0x53620b){_0x1aafd1[_0xe049('0x17')](0x194);}return _0x53620b;};}function handleError(_0x181432,_0x3e5c7f){_0x3e5c7f=_0x3e5c7f||0x1f4;return function(_0x423ba4){logger[_0xe049('0x23')](_0x423ba4[_0xe049('0x24')]);if(_0x423ba4['name']){delete _0x423ba4['name'];}_0x181432[_0xe049('0x18')](_0x3e5c7f)['send'](_0x423ba4);};}exports[_0xe049('0x25')]=function(_0x495d33,_0x3c50c3){var _0x2b79dc={},_0x5adcd6={},_0x432a6e={'count':0x0,'rows':[]};var _0x364630=_[_0xe049('0x26')](db[_0xe049('0x27')][_0xe049('0x28')],function(_0x4055fc){return{'name':_0x4055fc[_0xe049('0x29')],'type':_0x4055fc[_0xe049('0x2a')][_0xe049('0x2b')]};});_0x5adcd6[_0xe049('0x2c')]=_[_0xe049('0x26')](_0x364630,'name');_0x5adcd6[_0xe049('0x2d')]=_[_0xe049('0x2e')](_0x495d33['query']);_0x5adcd6['filters']=_['intersection'](_0x5adcd6['model'],_0x5adcd6[_0xe049('0x2d')]);_0x2b79dc[_0xe049('0x2f')]=_[_0xe049('0x30')](_0x5adcd6[_0xe049('0x2c')],qs[_0xe049('0x31')](_0x495d33['query'][_0xe049('0x31')]));_0x2b79dc[_0xe049('0x2f')]=_0x2b79dc[_0xe049('0x2f')][_0xe049('0x32')]?_0x2b79dc[_0xe049('0x2f')]:_0x5adcd6['model'];if(!_0x495d33[_0xe049('0x2d')]['hasOwnProperty'](_0xe049('0x33'))){_0x2b79dc['limit']=qs[_0xe049('0x1a')](_0x495d33[_0xe049('0x2d')][_0xe049('0x1a')]);_0x2b79dc[_0xe049('0x19')]=qs[_0xe049('0x19')](_0x495d33[_0xe049('0x2d')][_0xe049('0x19')]);}_0x2b79dc[_0xe049('0x34')]=qs[_0xe049('0x35')](_0x495d33[_0xe049('0x2d')][_0xe049('0x35')]);_0x2b79dc['where']=qs[_0xe049('0x36')](_[_0xe049('0x37')](_0x495d33[_0xe049('0x2d')],_0x5adcd6[_0xe049('0x36')]),_0x364630);if(_0x495d33[_0xe049('0x2d')][_0xe049('0x38')]){_0x2b79dc[_0xe049('0x39')]=_[_0xe049('0x3a')](_0x2b79dc['where'],{'$or':_[_0xe049('0x26')](_0x364630,function(_0x14bea3){if(_0x14bea3[_0xe049('0x2a')]!==_0xe049('0x3b')){var _0x5e9613={};_0x5e9613[_0x14bea3[_0xe049('0x3c')]]={'$like':'%'+_0x495d33[_0xe049('0x2d')][_0xe049('0x38')]+'%'};return _0x5e9613;}})});}_0x2b79dc=_[_0xe049('0x3a')]({},_0x2b79dc,_0x495d33[_0xe049('0x3d')]);var _0x54d5dd={'where':_0x2b79dc[_0xe049('0x39')]};return db[_0xe049('0x27')][_0xe049('0x1c')](_0x54d5dd)['then'](function(_0x28ae88){_0x432a6e['count']=_0x28ae88;if(_0x495d33['query'][_0xe049('0x3e')]){_0x2b79dc['include']=[{'all':!![]}];}return db[_0xe049('0x27')][_0xe049('0x3f')](_0x2b79dc);})[_0xe049('0x22')](function(_0xe4f184){_0x432a6e[_0xe049('0x40')]=_0xe4f184;return _0x432a6e;})['then'](respondWithFilteredResult(_0x3c50c3,_0x2b79dc))[_0xe049('0x41')](handleError(_0x3c50c3,null));};exports[_0xe049('0x42')]=function(_0x5e2374,_0x546137){var _0x29915f={'raw':!![],'where':{'id':_0x5e2374[_0xe049('0x43')]['id']}},_0x20d264={};_0x20d264[_0xe049('0x2c')]=_[_0xe049('0x2e')](db[_0xe049('0x27')]['rawAttributes']);_0x20d264[_0xe049('0x2d')]=_[_0xe049('0x2e')](_0x5e2374['query']);_0x20d264[_0xe049('0x36')]=_[_0xe049('0x30')](_0x20d264[_0xe049('0x2c')],_0x20d264[_0xe049('0x2d')]);_0x29915f[_0xe049('0x2f')]=_['intersection'](_0x20d264['model'],qs[_0xe049('0x31')](_0x5e2374[_0xe049('0x2d')][_0xe049('0x31')]));_0x29915f[_0xe049('0x2f')]=_0x29915f[_0xe049('0x2f')][_0xe049('0x32')]?_0x29915f['attributes']:_0x20d264[_0xe049('0x2c')];if(_0x5e2374[_0xe049('0x2d')]['includeAll']){_0x29915f[_0xe049('0x44')]=[{'all':!![]}];}_0x29915f=_['merge']({},_0x29915f,_0x5e2374[_0xe049('0x3d')]);return db['FreshdeskField'][_0xe049('0x45')](_0x29915f)['then'](handleEntityNotFound(_0x546137,null))[_0xe049('0x22')](respondWithResult(_0x546137,null))[_0xe049('0x41')](handleError(_0x546137,null));};exports[_0xe049('0x46')]=function(_0x1e3daf,_0x22eeb1){return db['FreshdeskField'][_0xe049('0x46')](_0x1e3daf[_0xe049('0x47')],{})[_0xe049('0x22')](respondWithResult(_0x22eeb1,0xc9))[_0xe049('0x41')](handleError(_0x22eeb1,null));};exports[_0xe049('0x21')]=function(_0x3c15a2,_0x12f9b8){if(_0x3c15a2[_0xe049('0x47')]['id']){delete _0x3c15a2[_0xe049('0x47')]['id'];}return db['FreshdeskField']['find']({'where':{'id':_0x3c15a2[_0xe049('0x43')]['id']}})[_0xe049('0x22')](handleEntityNotFound(_0x12f9b8,null))[_0xe049('0x22')](saveUpdates(_0x3c15a2[_0xe049('0x47')],null))[_0xe049('0x22')](respondWithResult(_0x12f9b8,null))[_0xe049('0x41')](handleError(_0x12f9b8,null));};exports[_0xe049('0x48')]=function(_0x2e4dce,_0x23692f){return db[_0xe049('0x27')][_0xe049('0x45')]({'where':{'id':_0x2e4dce['params']['id']}})[_0xe049('0x22')](handleEntityNotFound(_0x23692f,null))[_0xe049('0x22')](removeEntity(_0x23692f,null))[_0xe049('0x41')](handleError(_0x23692f,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.model.js b/server/api/intFreshdeskField/intFreshdeskField.model.js index 493a01f..6c6d915 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 _0xa101=['lodash','util','api','moment','request-promise','path','../../config/environment','./intFreshdeskField.attributes','exports','define','freshdesk_unique_index','idField','FieldId'];(function(_0x46d0c9,_0x526bfa){var _0x174506=function(_0x654bc6){while(--_0x654bc6){_0x46d0c9['push'](_0x46d0c9['shift']());}};_0x174506(++_0x526bfa);}(_0xa101,0x15f));var _0x1a10=function(_0x2543d6,_0x3a5e78){_0x2543d6=_0x2543d6-0x0;var _0x55213c=_0xa101[_0x2543d6];return _0x55213c;};'use strict';var _=require(_0x1a10('0x0'));var util=require(_0x1a10('0x1'));var logger=require('../../config/logger')(_0x1a10('0x2'));var moment=require(_0x1a10('0x3'));var BPromise=require('bluebird');var rp=require(_0x1a10('0x4'));var fs=require('fs');var path=require(_0x1a10('0x5'));var rimraf=require('rimraf');var config=require(_0x1a10('0x6'));var attributes=require(_0x1a10('0x7'));module[_0x1a10('0x8')]=function(_0x1a9d22,_0x2eb3c8){return _0x1a9d22[_0x1a10('0x9')]('FreshdeskField',attributes,{'tableName':'int_freshdesk_fields','paranoid':![],'indexes':[{'name':_0x1a10('0xa'),'fields':[_0x1a10('0xb'),_0x1a10('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xf44c=['request-promise','rimraf','../../config/environment','./intFreshdeskField.attributes','exports','define','FreshdeskField','int_freshdesk_fields','idField','lodash','util','../../config/logger','api','bluebird'];(function(_0x19d8c5,_0x229d81){var _0x366a4d=function(_0x4057c5){while(--_0x4057c5){_0x19d8c5['push'](_0x19d8c5['shift']());}};_0x366a4d(++_0x229d81);}(_0xf44c,0x1c9));var _0xcf44=function(_0x194cce,_0x349dac){_0x194cce=_0x194cce-0x0;var _0x4b6b2c=_0xf44c[_0x194cce];return _0x4b6b2c;};'use strict';var _=require(_0xcf44('0x0'));var util=require(_0xcf44('0x1'));var logger=require(_0xcf44('0x2'))(_0xcf44('0x3'));var moment=require('moment');var BPromise=require(_0xcf44('0x4'));var rp=require(_0xcf44('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xcf44('0x6'));var config=require(_0xcf44('0x7'));var attributes=require(_0xcf44('0x8'));module[_0xcf44('0x9')]=function(_0x125b64,_0xb1e39d){return _0x125b64[_0xcf44('0xa')](_0xcf44('0xb'),attributes,{'tableName':_0xcf44('0xc'),'paranoid':![],'indexes':[{'name':'freshdesk_unique_index','fields':[_0xcf44('0xd'),'FieldId'],'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 f35b06b..984e0d0 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 _0x0a49=['debug','FreshdeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','FreshdeskField,\x20%s,\x20%s','request\x20sent'];(function(_0x465a0c,_0x19d4d5){var _0x1e202e=function(_0x27bd8a){while(--_0x27bd8a){_0x465a0c['push'](_0x465a0c['shift']());}};_0x1e202e(++_0x19d4d5);}(_0x0a49,0x131));var _0x90a4=function(_0x4b7b69,_0x3ab075){_0x4b7b69=_0x4b7b69-0x0;var _0x173b4c=_0x0a49[_0x4b7b69];return _0x173b4c;};'use strict';var _=require(_0x90a4('0x0'));var util=require('util');var moment=require(_0x90a4('0x1'));var BPromise=require(_0x90a4('0x2'));var rs=require(_0x90a4('0x3'));var fs=require('fs');var Redis=require(_0x90a4('0x4'));var db=require(_0x90a4('0x5'))['db'];var utils=require(_0x90a4('0x6'));var logger=require(_0x90a4('0x7'))(_0x90a4('0x8'));var config=require(_0x90a4('0x9'));var jayson=require(_0x90a4('0xa'));var client=jayson[_0x90a4('0xb')][_0x90a4('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x4f2040,_0x1aea96,_0x541c69){return new BPromise(function(_0x239bef,_0x4210d3){return client[_0x90a4('0xd')](_0x4f2040,_0x541c69)[_0x90a4('0xe')](function(_0x498244){logger['info'](_0x90a4('0xf'),_0x1aea96,_0x90a4('0x10'));logger[_0x90a4('0x11')](_0x90a4('0x12'),_0x1aea96,_0x90a4('0x10'),JSON[_0x90a4('0x13')](_0x498244));if(_0x498244[_0x90a4('0x14')]){if(_0x498244['error'][_0x90a4('0x15')]===0x1f4){logger[_0x90a4('0x14')](_0x90a4('0xf'),_0x1aea96,_0x498244[_0x90a4('0x14')][_0x90a4('0x16')]);return _0x4210d3(_0x498244[_0x90a4('0x14')][_0x90a4('0x16')]);}logger[_0x90a4('0x14')](_0x90a4('0xf'),_0x1aea96,_0x498244['error']['message']);return _0x239bef(_0x498244[_0x90a4('0x14')]['message']);}else{logger['info'](_0x90a4('0xf'),_0x1aea96,'request\x20sent');_0x239bef(_0x498244['result'][_0x90a4('0x16')]);}})['catch'](function(_0x55e8bc){logger[_0x90a4('0x14')](_0x90a4('0xf'),_0x1aea96,_0x55e8bc);_0x4210d3(_0x55e8bc);});});} \ No newline at end of file +var _0xaccf=['../../config/utils','../../config/logger','rpc','../../config/environment','request','then','FreshdeskField,\x20%s,\x20%s','request\x20sent','FreshdeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','../../mysqldb'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xaccf,0x174));var _0xfacc=function(_0x11021a,_0x4112ee){_0x11021a=_0x11021a-0x0;var _0xe1bc5a=_0xaccf[_0x11021a];return _0xe1bc5a;};'use strict';var _=require('lodash');var util=require(_0xfacc('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xfacc('0x1'))['db'];var utils=require(_0xfacc('0x2'));var logger=require(_0xfacc('0x3'))(_0xfacc('0x4'));var config=require(_0xfacc('0x5'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x36e422,_0x55624e,_0x1b6225){return new BPromise(function(_0x2deba2,_0x228d01){return client[_0xfacc('0x6')](_0x36e422,_0x1b6225)[_0xfacc('0x7')](function(_0x516623){logger['info'](_0xfacc('0x8'),_0x55624e,_0xfacc('0x9'));logger['debug'](_0xfacc('0xa'),_0x55624e,_0xfacc('0x9'),JSON[_0xfacc('0xb')](_0x516623));if(_0x516623[_0xfacc('0xc')]){if(_0x516623[_0xfacc('0xc')][_0xfacc('0xd')]===0x1f4){logger[_0xfacc('0xc')](_0xfacc('0x8'),_0x55624e,_0x516623[_0xfacc('0xc')][_0xfacc('0xe')]);return _0x228d01(_0x516623[_0xfacc('0xc')]['message']);}logger[_0xfacc('0xc')]('FreshdeskField,\x20%s,\x20%s',_0x55624e,_0x516623['error'][_0xfacc('0xe')]);return _0x2deba2(_0x516623['error']['message']);}else{logger['info'](_0xfacc('0x8'),_0x55624e,_0xfacc('0x9'));_0x2deba2(_0x516623[_0xfacc('0xf')][_0xfacc('0xe')]);}})[_0xfacc('0x10')](function(_0x4d08a6){logger['error'](_0xfacc('0x8'),_0x55624e,_0x4d08a6);_0x228d01(_0x4d08a6);});});} \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/index.js b/server/api/intFreshsalesAccount/index.js index d53e462..0a67400 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 _0x9ffd=['../../components/auth/service','../../config/environment','./intFreshsalesAccount.controller','isAuthenticated','index','get','/:id','show','/:id/configurations','getFields','post','create','addConfiguration','update','delete','exports','multer','util','path','express','Router','fs-extra'];(function(_0x102b0c,_0x33dee4){var _0x9b15ca=function(_0x42d504){while(--_0x42d504){_0x102b0c['push'](_0x102b0c['shift']());}};_0x9b15ca(++_0x33dee4);}(_0x9ffd,0xaa));var _0xd9ff=function(_0x248926,_0x2f82d2){_0x248926=_0x248926-0x0;var _0x1ce579=_0x9ffd[_0x248926];return _0x1ce579;};'use strict';var multer=require(_0xd9ff('0x0'));var util=require(_0xd9ff('0x1'));var path=require(_0xd9ff('0x2'));var timeout=require('connect-timeout');var express=require(_0xd9ff('0x3'));var router=express[_0xd9ff('0x4')]();var fs_extra=require(_0xd9ff('0x5'));var auth=require(_0xd9ff('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xd9ff('0x7'));var controller=require(_0xd9ff('0x8'));router['get']('/',auth[_0xd9ff('0x9')](),controller[_0xd9ff('0xa')]);router[_0xd9ff('0xb')](_0xd9ff('0xc'),auth[_0xd9ff('0x9')](),controller[_0xd9ff('0xd')]);router[_0xd9ff('0xb')](_0xd9ff('0xe'),auth[_0xd9ff('0x9')](),controller['getConfigurations']);router['get']('/:id/fields',auth['isAuthenticated'](),controller[_0xd9ff('0xf')]);router[_0xd9ff('0x10')]('/',auth[_0xd9ff('0x9')](),controller[_0xd9ff('0x11')]);router[_0xd9ff('0x10')](_0xd9ff('0xe'),auth[_0xd9ff('0x9')](),controller[_0xd9ff('0x12')]);router['put']('/:id',auth[_0xd9ff('0x9')](),controller[_0xd9ff('0x13')]);router[_0xd9ff('0x14')](_0xd9ff('0xc'),auth[_0xd9ff('0x9')](),controller['destroy']);module[_0xd9ff('0x15')]=router; \ No newline at end of file +var _0x1d2d=['multer','util','path','connect-timeout','express','fs-extra','../../config/environment','./intFreshsalesAccount.controller','get','isAuthenticated','index','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','/:id','update','delete','exports'];(function(_0x22bb94,_0x5ef4bb){var _0x2f68ba=function(_0x1fd4cf){while(--_0x1fd4cf){_0x22bb94['push'](_0x22bb94['shift']());}};_0x2f68ba(++_0x5ef4bb);}(_0x1d2d,0xf0));var _0xd1d2=function(_0x596ebf,_0x4fd08d){_0x596ebf=_0x596ebf-0x0;var _0x45c8c4=_0x1d2d[_0x596ebf];return _0x45c8c4;};'use strict';var multer=require(_0xd1d2('0x0'));var util=require(_0xd1d2('0x1'));var path=require(_0xd1d2('0x2'));var timeout=require(_0xd1d2('0x3'));var express=require(_0xd1d2('0x4'));var router=express['Router']();var fs_extra=require(_0xd1d2('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xd1d2('0x6'));var controller=require(_0xd1d2('0x7'));router[_0xd1d2('0x8')]('/',auth[_0xd1d2('0x9')](),controller[_0xd1d2('0xa')]);router[_0xd1d2('0x8')]('/:id',auth[_0xd1d2('0x9')](),controller[_0xd1d2('0xb')]);router[_0xd1d2('0x8')](_0xd1d2('0xc'),auth[_0xd1d2('0x9')](),controller[_0xd1d2('0xd')]);router[_0xd1d2('0x8')](_0xd1d2('0xe'),auth[_0xd1d2('0x9')](),controller[_0xd1d2('0xf')]);router[_0xd1d2('0x10')]('/',auth[_0xd1d2('0x9')](),controller[_0xd1d2('0x11')]);router['post'](_0xd1d2('0xc'),auth[_0xd1d2('0x9')](),controller[_0xd1d2('0x12')]);router[_0xd1d2('0x13')](_0xd1d2('0x14'),auth[_0xd1d2('0x9')](),controller[_0xd1d2('0x15')]);router[_0xd1d2('0x16')](_0xd1d2('0x14'),auth[_0xd1d2('0x9')](),controller['destroy']);module[_0xd1d2('0x17')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js index fc00fd9..4cc7e38 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 _0x8f4c=['sequelize','exports','STRING','username','remoteUri'];(function(_0x49b207,_0x408ade){var _0x2dc8fa=function(_0x150975){while(--_0x150975){_0x49b207['push'](_0x49b207['shift']());}};_0x2dc8fa(++_0x408ade);}(_0x8f4c,0x113));var _0xc8f4=function(_0x450f20,_0x159bb3){_0x450f20=_0x450f20-0x0;var _0x15bd66=_0x8f4c[_0x450f20];return _0x15bd66;};'use strict';var Sequelize=require(_0xc8f4('0x0'));module[_0xc8f4('0x1')]={'name':{'type':Sequelize[_0xc8f4('0x2')]},'description':{'type':Sequelize[_0xc8f4('0x2')]},'username':{'type':Sequelize[_0xc8f4('0x2')],'unique':_0xc8f4('0x3')},'apiKey':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0xc8f4('0x2')],'unique':_0xc8f4('0x4')},'serverUrl':{'type':Sequelize[_0xc8f4('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0x2a07=['sequelize','exports','STRING','remoteUri'];(function(_0x3e4566,_0x1e02e2){var _0x2eb60f=function(_0x202454){while(--_0x202454){_0x3e4566['push'](_0x3e4566['shift']());}};_0x2eb60f(++_0x1e02e2);}(_0x2a07,0x74));var _0x72a0=function(_0x28876c,_0x2ea5cc){_0x28876c=_0x28876c-0x0;var _0x48e273=_0x2a07[_0x28876c];return _0x48e273;};'use strict';var Sequelize=require(_0x72a0('0x0'));module[_0x72a0('0x1')]={'name':{'type':Sequelize[_0x72a0('0x2')]},'description':{'type':Sequelize[_0x72a0('0x2')]},'username':{'type':Sequelize[_0x72a0('0x2')],'unique':'username'},'apiKey':{'type':Sequelize[_0x72a0('0x2')]},'remoteUri':{'type':Sequelize[_0x72a0('0x2')],'unique':_0x72a0('0x3')},'serverUrl':{'type':Sequelize[_0x72a0('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 23e3e4c..6cd6a41 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 _0x0ad8=['../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','limit','undefined','offset','count','set','Content-Range','apply','reject','save','update','error','name','send','index','map','FreshsalesAccount','type','key','model','keys','query','filters','intersection','fields','attributes','hasOwnProperty','sort','pick','filter','where','merge','VIRTUAL','options','then','include','findAll','rows','catch','params','rawAttributes','includeAll','find','create','body','destroy','findOne','getConfigurations','length','getSubjects','channel','getDescriptions','FreshsalesConfiguration','FreshsalesField','Subjects','Descriptions','getFields','username','apiKey','remoteUri','slice','substring','lastIndexOf','GET','format','Token\x20token=','users','email','Requested\x20Resource\x20not\x20Found','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','papaparse','ioredis'];(function(_0x2fe108,_0x2995fd){var _0x4439c5=function(_0x2ef8ec){while(--_0x2ef8ec){_0x2fe108['push'](_0x2fe108['shift']());}};_0x4439c5(++_0x2995fd);}(_0x0ad8,0x11e));var _0x80ad=function(_0x3deb57,_0x35aa64){_0x3deb57=_0x3deb57-0x0;var _0x2907af=_0x0ad8[_0x3deb57];return _0x2907af;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x80ad('0x0'));var jsonpatch=require(_0x80ad('0x1'));var rp=require(_0x80ad('0x2'));var moment=require(_0x80ad('0x3'));var BPromise=require(_0x80ad('0x4'));var Mustache=require(_0x80ad('0x5'));var util=require(_0x80ad('0x6'));var path=require(_0x80ad('0x7'));var sox=require(_0x80ad('0x8'));var csv=require(_0x80ad('0x9'));var ejs=require(_0x80ad('0xa'));var fs=require('fs');var fs_extra=require(_0x80ad('0xb'));var _=require('lodash');var squel=require(_0x80ad('0xc'));var crypto=require(_0x80ad('0xd'));var jsforce=require(_0x80ad('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x80ad('0x9'));var querystring=require('querystring');var Papa=require(_0x80ad('0xf'));var Redis=require(_0x80ad('0x10'));var authService=require(_0x80ad('0x11'));var qs=require(_0x80ad('0x12'));var as=require(_0x80ad('0x13'));var hardwareService=require(_0x80ad('0x14'));var logger=require(_0x80ad('0x15'))('api');var utils=require(_0x80ad('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x80ad('0x17'));var db=require(_0x80ad('0x18'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x1dcac5,_0x3f2b16){_0x3f2b16=_0x3f2b16||0xcc;return function(_0x4bf139){if(_0x4bf139){return _0x1dcac5[_0x80ad('0x19')](_0x3f2b16);}return _0x1dcac5[_0x80ad('0x1a')](_0x3f2b16)[_0x80ad('0x1b')]();};}function respondWithResult(_0x4572c7,_0x1cd3a9){_0x1cd3a9=_0x1cd3a9||0xc8;return function(_0x1042de){if(_0x1042de){return _0x4572c7[_0x80ad('0x1a')](_0x1cd3a9)[_0x80ad('0x1c')](_0x1042de);}};}function respondWithFilteredResult(_0x5d9fdf,_0x11e062){return function(_0x81fc73){if(_0x81fc73){var _0x323f3f=typeof _0x11e062['offset']==='undefined'&&typeof _0x11e062[_0x80ad('0x1d')]===_0x80ad('0x1e');var _0x36ecf7=_0x81fc73['count'];var _0x3fd092=_0x323f3f?0x0:_0x11e062[_0x80ad('0x1f')];var _0x7af123=_0x323f3f?_0x81fc73[_0x80ad('0x20')]:_0x11e062[_0x80ad('0x1f')]+_0x11e062['limit'];var _0xeea5b9;if(_0x7af123>=_0x36ecf7){_0x7af123=_0x36ecf7;_0xeea5b9=0xc8;}else{_0xeea5b9=0xce;}_0x5d9fdf[_0x80ad('0x1a')](_0xeea5b9);return _0x5d9fdf[_0x80ad('0x21')](_0x80ad('0x22'),_0x3fd092+'-'+_0x7af123+'/'+_0x36ecf7)[_0x80ad('0x1c')](_0x81fc73);}return null;};}function patchUpdates(_0x16a5a4){return function(_0x474945){try{jsonpatch[_0x80ad('0x23')](_0x474945,_0x16a5a4,!![]);}catch(_0x36e6a2){return BPromise[_0x80ad('0x24')](_0x36e6a2);}return _0x474945[_0x80ad('0x25')]();};}function saveUpdates(_0x120682,_0x313931){return function(_0x20b2ef){if(_0x20b2ef){return _0x20b2ef[_0x80ad('0x26')](_0x120682)['then'](function(_0xfece7f){return _0xfece7f;});}return null;};}function removeEntity(_0x13b55f,_0x13b560){return function(_0x15df6a){if(_0x15df6a){return _0x15df6a['destroy']()['then'](function(){_0x13b55f['status'](0xcc)[_0x80ad('0x1b')]();});}};}function handleEntityNotFound(_0x41169b,_0x18ceba){return function(_0x49fe5a){if(!_0x49fe5a){_0x41169b[_0x80ad('0x19')](0x194);}return _0x49fe5a;};}function handleError(_0x50cd8f,_0x4d4d9d){_0x4d4d9d=_0x4d4d9d||0x1f4;return function(_0x1e28b7){logger[_0x80ad('0x27')](_0x1e28b7['stack']);if(_0x1e28b7[_0x80ad('0x28')]){delete _0x1e28b7['name'];}_0x50cd8f[_0x80ad('0x1a')](_0x4d4d9d)[_0x80ad('0x29')](_0x1e28b7);};}exports[_0x80ad('0x2a')]=function(_0x426094,_0x4a3ab0){var _0x2bbbb4={},_0x658fbd={},_0x153674={'count':0x0,'rows':[]};var _0x5dc59f=_[_0x80ad('0x2b')](db[_0x80ad('0x2c')]['rawAttributes'],function(_0xadffc1){return{'name':_0xadffc1['fieldName'],'type':_0xadffc1[_0x80ad('0x2d')][_0x80ad('0x2e')]};});_0x658fbd[_0x80ad('0x2f')]=_['map'](_0x5dc59f,_0x80ad('0x28'));_0x658fbd['query']=_[_0x80ad('0x30')](_0x426094[_0x80ad('0x31')]);_0x658fbd[_0x80ad('0x32')]=_['intersection'](_0x658fbd[_0x80ad('0x2f')],_0x658fbd['query']);_0x2bbbb4['attributes']=_[_0x80ad('0x33')](_0x658fbd['model'],qs[_0x80ad('0x34')](_0x426094[_0x80ad('0x31')]['fields']));_0x2bbbb4[_0x80ad('0x35')]=_0x2bbbb4[_0x80ad('0x35')]['length']?_0x2bbbb4[_0x80ad('0x35')]:_0x658fbd[_0x80ad('0x2f')];if(!_0x426094['query'][_0x80ad('0x36')]('nolimit')){_0x2bbbb4[_0x80ad('0x1d')]=qs['limit'](_0x426094[_0x80ad('0x31')][_0x80ad('0x1d')]);_0x2bbbb4[_0x80ad('0x1f')]=qs['offset'](_0x426094['query'][_0x80ad('0x1f')]);}_0x2bbbb4['order']=qs['sort'](_0x426094[_0x80ad('0x31')][_0x80ad('0x37')]);_0x2bbbb4['where']=qs[_0x80ad('0x32')](_[_0x80ad('0x38')](_0x426094[_0x80ad('0x31')],_0x658fbd[_0x80ad('0x32')]),_0x5dc59f);if(_0x426094[_0x80ad('0x31')][_0x80ad('0x39')]){_0x2bbbb4[_0x80ad('0x3a')]=_[_0x80ad('0x3b')](_0x2bbbb4[_0x80ad('0x3a')],{'$or':_[_0x80ad('0x2b')](_0x5dc59f,function(_0x1f87c1){if(_0x1f87c1[_0x80ad('0x2d')]!==_0x80ad('0x3c')){var _0x47fe7d={};_0x47fe7d[_0x1f87c1[_0x80ad('0x28')]]={'$like':'%'+_0x426094[_0x80ad('0x31')]['filter']+'%'};return _0x47fe7d;}})});}_0x2bbbb4=_[_0x80ad('0x3b')]({},_0x2bbbb4,_0x426094[_0x80ad('0x3d')]);var _0x5954c2={'where':_0x2bbbb4[_0x80ad('0x3a')]};return db[_0x80ad('0x2c')]['count'](_0x5954c2)[_0x80ad('0x3e')](function(_0x3aa804){_0x153674[_0x80ad('0x20')]=_0x3aa804;if(_0x426094[_0x80ad('0x31')]['includeAll']){_0x2bbbb4[_0x80ad('0x3f')]=[{'all':!![]}];}return db[_0x80ad('0x2c')][_0x80ad('0x40')](_0x2bbbb4);})[_0x80ad('0x3e')](function(_0x48fb81){_0x153674[_0x80ad('0x41')]=_0x48fb81;return _0x153674;})['then'](respondWithFilteredResult(_0x4a3ab0,_0x2bbbb4))[_0x80ad('0x42')](handleError(_0x4a3ab0,null));};exports['show']=function(_0xd5a788,_0x1abfdf){var _0x58bf07={'raw':![],'where':{'id':_0xd5a788[_0x80ad('0x43')]['id']}},_0x8d5ac2={};_0x8d5ac2[_0x80ad('0x2f')]=_[_0x80ad('0x30')](db[_0x80ad('0x2c')][_0x80ad('0x44')]);_0x8d5ac2[_0x80ad('0x31')]=_['keys'](_0xd5a788[_0x80ad('0x31')]);_0x8d5ac2[_0x80ad('0x32')]=_[_0x80ad('0x33')](_0x8d5ac2[_0x80ad('0x2f')],_0x8d5ac2[_0x80ad('0x31')]);_0x58bf07['attributes']=_[_0x80ad('0x33')](_0x8d5ac2[_0x80ad('0x2f')],qs['fields'](_0xd5a788['query']['fields']));_0x58bf07[_0x80ad('0x35')]=_0x58bf07[_0x80ad('0x35')]['length']?_0x58bf07['attributes']:_0x8d5ac2['model'];if(_0xd5a788[_0x80ad('0x31')][_0x80ad('0x45')]){_0x58bf07['include']=[{'all':!![]}];}_0x58bf07=_[_0x80ad('0x3b')]({},_0x58bf07,_0xd5a788[_0x80ad('0x3d')]);return db[_0x80ad('0x2c')][_0x80ad('0x46')](_0x58bf07)[_0x80ad('0x3e')](handleEntityNotFound(_0x1abfdf,null))[_0x80ad('0x3e')](respondWithResult(_0x1abfdf,null))[_0x80ad('0x42')](handleError(_0x1abfdf,null));};exports[_0x80ad('0x47')]=function(_0x3611ea,_0x2e73ef){return db[_0x80ad('0x2c')][_0x80ad('0x47')](_0x3611ea[_0x80ad('0x48')],{})[_0x80ad('0x3e')](respondWithResult(_0x2e73ef,0xc9))[_0x80ad('0x42')](handleError(_0x2e73ef,null));};exports['update']=function(_0x5a398d,_0x51e106){if(_0x5a398d[_0x80ad('0x48')]['id']){delete _0x5a398d['body']['id'];}return db[_0x80ad('0x2c')][_0x80ad('0x46')]({'where':{'id':_0x5a398d[_0x80ad('0x43')]['id']}})[_0x80ad('0x3e')](handleEntityNotFound(_0x51e106,null))[_0x80ad('0x3e')](saveUpdates(_0x5a398d['body'],null))[_0x80ad('0x3e')](respondWithResult(_0x51e106,null))[_0x80ad('0x42')](handleError(_0x51e106,null));};exports[_0x80ad('0x49')]=function(_0x13a096,_0x5b081e){return db[_0x80ad('0x2c')][_0x80ad('0x46')]({'where':{'id':_0x13a096[_0x80ad('0x43')]['id']}})[_0x80ad('0x3e')](handleEntityNotFound(_0x5b081e,null))[_0x80ad('0x3e')](removeEntity(_0x5b081e,null))['catch'](handleError(_0x5b081e,null));};exports['getConfigurations']=function(_0x2c9f66,_0x1064ca,_0x28914a){var _0x5178aa={};var _0x219afc={};var _0x29d15b;var _0x190a93;return db[_0x80ad('0x2c')][_0x80ad('0x4a')]({'where':{'id':_0x2c9f66[_0x80ad('0x43')]['id']}})[_0x80ad('0x3e')](handleEntityNotFound(_0x1064ca,null))[_0x80ad('0x3e')](function(_0x3f8126){if(_0x3f8126){_0x29d15b=_0x3f8126;_0x219afc[_0x80ad('0x2f')]=_[_0x80ad('0x30')](db['FreshsalesConfiguration'][_0x80ad('0x44')]);_0x219afc[_0x80ad('0x31')]=_[_0x80ad('0x30')](_0x2c9f66['query']);_0x219afc[_0x80ad('0x32')]=_[_0x80ad('0x33')](_0x219afc[_0x80ad('0x2f')],_0x219afc['query']);_0x5178aa['attributes']=_[_0x80ad('0x33')](_0x219afc[_0x80ad('0x2f')],qs[_0x80ad('0x34')](_0x2c9f66[_0x80ad('0x31')][_0x80ad('0x34')]));_0x5178aa[_0x80ad('0x35')]=_0x5178aa[_0x80ad('0x35')]['length']?_0x5178aa[_0x80ad('0x35')]:_0x219afc[_0x80ad('0x2f')];_0x5178aa['order']=qs[_0x80ad('0x37')](_0x2c9f66['query']['sort']);_0x5178aa[_0x80ad('0x3a')]=qs[_0x80ad('0x32')](_['pick'](_0x2c9f66['query'],_0x219afc[_0x80ad('0x32')]));if(_0x2c9f66[_0x80ad('0x31')][_0x80ad('0x39')]){_0x5178aa[_0x80ad('0x3a')]=_[_0x80ad('0x3b')](_0x5178aa['where'],{'$or':_[_0x80ad('0x2b')](_0x5178aa['attributes'],function(_0x2a3965){var _0xfad9e7={};_0xfad9e7[_0x2a3965]={'$like':'%'+_0x2c9f66['query'][_0x80ad('0x39')]+'%'};return _0xfad9e7;})});}_0x5178aa=_[_0x80ad('0x3b')]({},_0x5178aa,_0x2c9f66['options']);return _0x29d15b[_0x80ad('0x4b')](_0x5178aa);}})['then'](function(_0x28c008){if(_0x28c008){_0x190a93=_0x28c008[_0x80ad('0x4c')];if(!_0x2c9f66['query'][_0x80ad('0x36')]('nolimit')){_0x5178aa[_0x80ad('0x1d')]=qs[_0x80ad('0x1d')](_0x2c9f66['query'][_0x80ad('0x1d')]);_0x5178aa['offset']=qs['offset'](_0x2c9f66[_0x80ad('0x31')]['offset']);}return _0x29d15b[_0x80ad('0x4b')](_0x5178aa);}})['then'](function(_0x1adda7){if(_0x1adda7){return _0x1adda7?{'count':_0x190a93,'rows':_0x1adda7}:null;}})[_0x80ad('0x3e')](respondWithResult(_0x1064ca,null))['catch'](handleError(_0x1064ca,null));};exports['addConfiguration']=function(_0x4af9c5,_0x25390c,_0x67214b){if(_0x4af9c5['body']['id']){delete _0x4af9c5[_0x80ad('0x48')]['id'];}return db[_0x80ad('0x2c')]['findOne']({'where':{'id':_0x4af9c5['params']['id']}})['then'](handleEntityNotFound(_0x25390c,null))['then'](function(_0x3d445c){if(_0x3d445c){_0x4af9c5[_0x80ad('0x48')]['AccountId']=_0x3d445c['id'];_0x4af9c5[_0x80ad('0x48')]['Subjects']=integrations[_0x80ad('0x4d')](_0x4af9c5[_0x80ad('0x48')][_0x80ad('0x4e')],_0x4af9c5['body']['type']);_0x4af9c5[_0x80ad('0x48')]['Descriptions']=integrations[_0x80ad('0x4f')](_0x4af9c5[_0x80ad('0x48')][_0x80ad('0x4e')],_0x4af9c5[_0x80ad('0x48')][_0x80ad('0x2d')]);return db[_0x80ad('0x50')]['create'](_0x4af9c5[_0x80ad('0x48')],{'include':[{'model':db[_0x80ad('0x51')],'as':_0x80ad('0x52')},{'model':db[_0x80ad('0x51')],'as':_0x80ad('0x53')}]});}return null;})[_0x80ad('0x3e')](respondWithResult(_0x25390c,null))[_0x80ad('0x42')](handleError(_0x25390c,null));};exports[_0x80ad('0x54')]=function(_0x10b95f,_0x23767b,_0x5839a8){var _0x1a9e36='';var _0x2b26fc='';return db['FreshsalesAccount'][_0x80ad('0x4a')]({'where':{'id':_0x10b95f[_0x80ad('0x43')]['id']},'attributes':['id',_0x80ad('0x55'),'remoteUri',_0x80ad('0x56')]})[_0x80ad('0x3e')](handleEntityNotFound(_0x23767b,null))[_0x80ad('0x3e')](function(_0x6b34b9){if(_0x6b34b9){_0x2b26fc=_0x6b34b9[_0x80ad('0x55')];_0x1a9e36=_0x6b34b9[_0x80ad('0x57')];var _0x5e86b1=_0x6b34b9[_0x80ad('0x57')][_0x80ad('0x58')](-0x1);if(_0x5e86b1==='/'){_0x1a9e36=_0x1a9e36[_0x80ad('0x59')](0x0,_0x1a9e36[_0x80ad('0x5a')](_0x5e86b1));}return rp({'method':_0x80ad('0x5b'),'uri':util[_0x80ad('0x5c')]('%s%s',_0x1a9e36,'/api/selector/owners'),'headers':{'Authorization':_0x80ad('0x5d')+_0x6b34b9[_0x80ad('0x56')]},'json':!![]});}})[_0x80ad('0x3e')](function(_0x27d7ba){if(_0x27d7ba){var _0x33688e=_0x27d7ba[_0x80ad('0x5e')];var _0x17c26f=![];var _0x59ab23=null;for(_0x59ab23=0x0;_0x59ab23<_0x33688e['length'];_0x59ab23++){if(_0x33688e[_0x59ab23][_0x80ad('0x5f')]===_0x2b26fc){_0x17c26f=!![];}}if(_0x17c26f){return!![];}else{throw new Error({'statusCode':0x194,'message':_0x80ad('0x60')});}}})[_0x80ad('0x3e')](respondWithResult(_0x23767b,null))[_0x80ad('0x42')](function(_0xc257cc){var _0xa5adaf=_0x10b95f[_0x80ad('0x31')]['test']?0x1f4:_0xc257cc[_0x80ad('0x61')]||0x1f4;logger['error'](_0x80ad('0x62'),_0x80ad('0x54'),_0xa5adaf,JSON[_0x80ad('0x63')](_0xc257cc));delete _0xc257cc[_0x80ad('0x28')];if(_0xa5adaf===0x191){_0xa5adaf=0x190;}_0x23767b['status'](_0xa5adaf)['send'](_0x10b95f[_0x80ad('0x31')]['test']?{'message':_0x80ad('0x64'),'statusCode':_0xc257cc[_0x80ad('0x61')]}:_0xc257cc);});}; \ No newline at end of file +var _0xec37=['index','map','FreshsalesAccount','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','VIRTUAL','merge','options','findAll','rows','catch','show','params','includeAll','find','create','body','destroy','getConfigurations','FreshsalesConfiguration','pick','filter','addConfiguration','findOne','AccountId','Subjects','getSubjects','channel','getDescriptions','FreshsalesField','Descriptions','username','remoteUri','slice','substring','lastIndexOf','%s%s','/api/selector/owners','Token\x20token=','email','Requested\x20Resource\x20not\x20Found','test','statusCode','error','getFields,\x20%s,\x20%s,\x20%s','getFields','stringify','Wrong\x20credentials','rimraf','zip-dir','request-promise','moment','mustache','util','ejs','fs-extra','lodash','squel','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','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','update','then','stack','name','send'];(function(_0x111763,_0x33321a){var _0x5ab5b5=function(_0x2a0d22){while(--_0x2a0d22){_0x111763['push'](_0x111763['shift']());}};_0x5ab5b5(++_0x33321a);}(_0xec37,0xa1));var _0x7ec3=function(_0x1780f8,_0x11ba93){_0x1780f8=_0x1780f8-0x0;var _0x33a410=_0xec37[_0x1780f8];return _0x33a410;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7ec3('0x0'));var zipdir=require(_0x7ec3('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7ec3('0x2'));var moment=require(_0x7ec3('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x7ec3('0x4'));var util=require(_0x7ec3('0x5'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x7ec3('0x6'));var fs=require('fs');var fs_extra=require(_0x7ec3('0x7'));var _=require(_0x7ec3('0x8'));var squel=require(_0x7ec3('0x9'));var crypto=require('crypto');var jsforce=require(_0x7ec3('0xa'));var deskjs=require(_0x7ec3('0xb'));var toCsv=require(_0x7ec3('0xc'));var querystring=require(_0x7ec3('0xd'));var Papa=require('papaparse');var Redis=require(_0x7ec3('0xe'));var authService=require(_0x7ec3('0xf'));var qs=require(_0x7ec3('0x10'));var as=require(_0x7ec3('0x11'));var hardwareService=require(_0x7ec3('0x12'));var logger=require(_0x7ec3('0x13'))(_0x7ec3('0x14'));var utils=require(_0x7ec3('0x15'));var config=require(_0x7ec3('0x16'));var licenseUtil=require(_0x7ec3('0x17'));var db=require('../../mysqldb')['db'];var integrations=require(_0x7ec3('0x18'));function respondWithStatusCode(_0x37a2e1,_0x49b896){_0x49b896=_0x49b896||0xcc;return function(_0x152ecf){if(_0x152ecf){return _0x37a2e1[_0x7ec3('0x19')](_0x49b896);}return _0x37a2e1[_0x7ec3('0x1a')](_0x49b896)[_0x7ec3('0x1b')]();};}function respondWithResult(_0x2ffd99,_0x1f37d8){_0x1f37d8=_0x1f37d8||0xc8;return function(_0x171eb7){if(_0x171eb7){return _0x2ffd99[_0x7ec3('0x1a')](_0x1f37d8)[_0x7ec3('0x1c')](_0x171eb7);}};}function respondWithFilteredResult(_0x288adb,_0x3841fe){return function(_0x4e8add){if(_0x4e8add){var _0x56435c=typeof _0x3841fe[_0x7ec3('0x1d')]===_0x7ec3('0x1e')&&typeof _0x3841fe[_0x7ec3('0x1f')]===_0x7ec3('0x1e');var _0x2a9cb3=_0x4e8add[_0x7ec3('0x20')];var _0x50329a=_0x56435c?0x0:_0x3841fe['offset'];var _0x25cdb2=_0x56435c?_0x4e8add['count']:_0x3841fe[_0x7ec3('0x1d')]+_0x3841fe[_0x7ec3('0x1f')];var _0x4e66fe;if(_0x25cdb2>=_0x2a9cb3){_0x25cdb2=_0x2a9cb3;_0x4e66fe=0xc8;}else{_0x4e66fe=0xce;}_0x288adb['status'](_0x4e66fe);return _0x288adb['set'](_0x7ec3('0x21'),_0x50329a+'-'+_0x25cdb2+'/'+_0x2a9cb3)[_0x7ec3('0x1c')](_0x4e8add);}return null;};}function patchUpdates(_0x194c8d){return function(_0x41f9cf){try{jsonpatch[_0x7ec3('0x22')](_0x41f9cf,_0x194c8d,!![]);}catch(_0x6a51e1){return BPromise[_0x7ec3('0x23')](_0x6a51e1);}return _0x41f9cf['save']();};}function saveUpdates(_0x2dfed8,_0x43a614){return function(_0xcbdf5e){if(_0xcbdf5e){return _0xcbdf5e[_0x7ec3('0x24')](_0x2dfed8)['then'](function(_0x1cd3ec){return _0x1cd3ec;});}return null;};}function removeEntity(_0x4c1cc5,_0x2540f3){return function(_0x1de9bc){if(_0x1de9bc){return _0x1de9bc['destroy']()[_0x7ec3('0x25')](function(){_0x4c1cc5[_0x7ec3('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x443c0e,_0x5f4e90){return function(_0x5913c7){if(!_0x5913c7){_0x443c0e[_0x7ec3('0x19')](0x194);}return _0x5913c7;};}function handleError(_0x18eeb2,_0x3b613b){_0x3b613b=_0x3b613b||0x1f4;return function(_0x4c5b5b){logger['error'](_0x4c5b5b[_0x7ec3('0x26')]);if(_0x4c5b5b[_0x7ec3('0x27')]){delete _0x4c5b5b['name'];}_0x18eeb2[_0x7ec3('0x1a')](_0x3b613b)[_0x7ec3('0x28')](_0x4c5b5b);};}exports[_0x7ec3('0x29')]=function(_0x408525,_0x5af4f7){var _0x34aaae={},_0x36cbd0={},_0xe50636={'count':0x0,'rows':[]};var _0x2d2d75=_[_0x7ec3('0x2a')](db[_0x7ec3('0x2b')]['rawAttributes'],function(_0x154b5e){return{'name':_0x154b5e['fieldName'],'type':_0x154b5e[_0x7ec3('0x2c')]['key']};});_0x36cbd0[_0x7ec3('0x2d')]=_[_0x7ec3('0x2a')](_0x2d2d75,_0x7ec3('0x27'));_0x36cbd0[_0x7ec3('0x2e')]=_[_0x7ec3('0x2f')](_0x408525[_0x7ec3('0x2e')]);_0x36cbd0[_0x7ec3('0x30')]=_[_0x7ec3('0x31')](_0x36cbd0[_0x7ec3('0x2d')],_0x36cbd0[_0x7ec3('0x2e')]);_0x34aaae[_0x7ec3('0x32')]=_[_0x7ec3('0x31')](_0x36cbd0['model'],qs[_0x7ec3('0x33')](_0x408525['query']['fields']));_0x34aaae[_0x7ec3('0x32')]=_0x34aaae[_0x7ec3('0x32')][_0x7ec3('0x34')]?_0x34aaae[_0x7ec3('0x32')]:_0x36cbd0[_0x7ec3('0x2d')];if(!_0x408525[_0x7ec3('0x2e')][_0x7ec3('0x35')](_0x7ec3('0x36'))){_0x34aaae[_0x7ec3('0x1f')]=qs[_0x7ec3('0x1f')](_0x408525[_0x7ec3('0x2e')][_0x7ec3('0x1f')]);_0x34aaae[_0x7ec3('0x1d')]=qs[_0x7ec3('0x1d')](_0x408525[_0x7ec3('0x2e')][_0x7ec3('0x1d')]);}_0x34aaae[_0x7ec3('0x37')]=qs[_0x7ec3('0x38')](_0x408525[_0x7ec3('0x2e')]['sort']);_0x34aaae['where']=qs[_0x7ec3('0x30')](_['pick'](_0x408525[_0x7ec3('0x2e')],_0x36cbd0[_0x7ec3('0x30')]),_0x2d2d75);if(_0x408525[_0x7ec3('0x2e')]['filter']){_0x34aaae[_0x7ec3('0x39')]=_['merge'](_0x34aaae[_0x7ec3('0x39')],{'$or':_['map'](_0x2d2d75,function(_0x1bdbca){if(_0x1bdbca[_0x7ec3('0x2c')]!==_0x7ec3('0x3a')){var _0x1cfe5e={};_0x1cfe5e[_0x1bdbca[_0x7ec3('0x27')]]={'$like':'%'+_0x408525[_0x7ec3('0x2e')]['filter']+'%'};return _0x1cfe5e;}})});}_0x34aaae=_[_0x7ec3('0x3b')]({},_0x34aaae,_0x408525[_0x7ec3('0x3c')]);var _0x4237d7={'where':_0x34aaae[_0x7ec3('0x39')]};return db[_0x7ec3('0x2b')][_0x7ec3('0x20')](_0x4237d7)['then'](function(_0x555a1e){_0xe50636['count']=_0x555a1e;if(_0x408525[_0x7ec3('0x2e')]['includeAll']){_0x34aaae['include']=[{'all':!![]}];}return db[_0x7ec3('0x2b')][_0x7ec3('0x3d')](_0x34aaae);})[_0x7ec3('0x25')](function(_0x2a0f3e){_0xe50636[_0x7ec3('0x3e')]=_0x2a0f3e;return _0xe50636;})[_0x7ec3('0x25')](respondWithFilteredResult(_0x5af4f7,_0x34aaae))[_0x7ec3('0x3f')](handleError(_0x5af4f7,null));};exports[_0x7ec3('0x40')]=function(_0x38f85e,_0x42bbf6){var _0x2e5555={'raw':![],'where':{'id':_0x38f85e[_0x7ec3('0x41')]['id']}},_0x44088b={};_0x44088b[_0x7ec3('0x2d')]=_['keys'](db['FreshsalesAccount']['rawAttributes']);_0x44088b['query']=_['keys'](_0x38f85e[_0x7ec3('0x2e')]);_0x44088b[_0x7ec3('0x30')]=_['intersection'](_0x44088b['model'],_0x44088b[_0x7ec3('0x2e')]);_0x2e5555[_0x7ec3('0x32')]=_[_0x7ec3('0x31')](_0x44088b['model'],qs[_0x7ec3('0x33')](_0x38f85e['query'][_0x7ec3('0x33')]));_0x2e5555['attributes']=_0x2e5555[_0x7ec3('0x32')][_0x7ec3('0x34')]?_0x2e5555[_0x7ec3('0x32')]:_0x44088b['model'];if(_0x38f85e['query'][_0x7ec3('0x42')]){_0x2e5555['include']=[{'all':!![]}];}_0x2e5555=_['merge']({},_0x2e5555,_0x38f85e[_0x7ec3('0x3c')]);return db['FreshsalesAccount'][_0x7ec3('0x43')](_0x2e5555)['then'](handleEntityNotFound(_0x42bbf6,null))['then'](respondWithResult(_0x42bbf6,null))['catch'](handleError(_0x42bbf6,null));};exports[_0x7ec3('0x44')]=function(_0xb1108b,_0x263fe1){return db[_0x7ec3('0x2b')]['create'](_0xb1108b['body'],{})[_0x7ec3('0x25')](respondWithResult(_0x263fe1,0xc9))[_0x7ec3('0x3f')](handleError(_0x263fe1,null));};exports[_0x7ec3('0x24')]=function(_0x4a44d1,_0xa06b49){if(_0x4a44d1[_0x7ec3('0x45')]['id']){delete _0x4a44d1[_0x7ec3('0x45')]['id'];}return db[_0x7ec3('0x2b')][_0x7ec3('0x43')]({'where':{'id':_0x4a44d1[_0x7ec3('0x41')]['id']}})[_0x7ec3('0x25')](handleEntityNotFound(_0xa06b49,null))[_0x7ec3('0x25')](saveUpdates(_0x4a44d1[_0x7ec3('0x45')],null))[_0x7ec3('0x25')](respondWithResult(_0xa06b49,null))[_0x7ec3('0x3f')](handleError(_0xa06b49,null));};exports[_0x7ec3('0x46')]=function(_0x25dcaf,_0x53ec5a){return db[_0x7ec3('0x2b')][_0x7ec3('0x43')]({'where':{'id':_0x25dcaf[_0x7ec3('0x41')]['id']}})[_0x7ec3('0x25')](handleEntityNotFound(_0x53ec5a,null))[_0x7ec3('0x25')](removeEntity(_0x53ec5a,null))[_0x7ec3('0x3f')](handleError(_0x53ec5a,null));};exports[_0x7ec3('0x47')]=function(_0xa9d4a,_0x5377e3,_0x3afbe3){var _0x56731b={};var _0x4fb992={};var _0x2998e7;var _0x1db4c8;return db[_0x7ec3('0x2b')]['findOne']({'where':{'id':_0xa9d4a[_0x7ec3('0x41')]['id']}})[_0x7ec3('0x25')](handleEntityNotFound(_0x5377e3,null))['then'](function(_0x47ec4b){if(_0x47ec4b){_0x2998e7=_0x47ec4b;_0x4fb992[_0x7ec3('0x2d')]=_[_0x7ec3('0x2f')](db[_0x7ec3('0x48')]['rawAttributes']);_0x4fb992[_0x7ec3('0x2e')]=_[_0x7ec3('0x2f')](_0xa9d4a[_0x7ec3('0x2e')]);_0x4fb992[_0x7ec3('0x30')]=_['intersection'](_0x4fb992[_0x7ec3('0x2d')],_0x4fb992[_0x7ec3('0x2e')]);_0x56731b[_0x7ec3('0x32')]=_[_0x7ec3('0x31')](_0x4fb992[_0x7ec3('0x2d')],qs[_0x7ec3('0x33')](_0xa9d4a['query'][_0x7ec3('0x33')]));_0x56731b[_0x7ec3('0x32')]=_0x56731b['attributes'][_0x7ec3('0x34')]?_0x56731b[_0x7ec3('0x32')]:_0x4fb992[_0x7ec3('0x2d')];_0x56731b['order']=qs[_0x7ec3('0x38')](_0xa9d4a[_0x7ec3('0x2e')][_0x7ec3('0x38')]);_0x56731b[_0x7ec3('0x39')]=qs[_0x7ec3('0x30')](_[_0x7ec3('0x49')](_0xa9d4a['query'],_0x4fb992[_0x7ec3('0x30')]));if(_0xa9d4a[_0x7ec3('0x2e')][_0x7ec3('0x4a')]){_0x56731b[_0x7ec3('0x39')]=_[_0x7ec3('0x3b')](_0x56731b[_0x7ec3('0x39')],{'$or':_[_0x7ec3('0x2a')](_0x56731b[_0x7ec3('0x32')],function(_0x4681cd){var _0x556b75={};_0x556b75[_0x4681cd]={'$like':'%'+_0xa9d4a['query'][_0x7ec3('0x4a')]+'%'};return _0x556b75;})});}_0x56731b=_[_0x7ec3('0x3b')]({},_0x56731b,_0xa9d4a['options']);return _0x2998e7[_0x7ec3('0x47')](_0x56731b);}})[_0x7ec3('0x25')](function(_0x3da2c5){if(_0x3da2c5){_0x1db4c8=_0x3da2c5['length'];if(!_0xa9d4a['query'][_0x7ec3('0x35')](_0x7ec3('0x36'))){_0x56731b[_0x7ec3('0x1f')]=qs['limit'](_0xa9d4a[_0x7ec3('0x2e')]['limit']);_0x56731b[_0x7ec3('0x1d')]=qs[_0x7ec3('0x1d')](_0xa9d4a[_0x7ec3('0x2e')][_0x7ec3('0x1d')]);}return _0x2998e7[_0x7ec3('0x47')](_0x56731b);}})[_0x7ec3('0x25')](function(_0x25780b){if(_0x25780b){return _0x25780b?{'count':_0x1db4c8,'rows':_0x25780b}:null;}})[_0x7ec3('0x25')](respondWithResult(_0x5377e3,null))[_0x7ec3('0x3f')](handleError(_0x5377e3,null));};exports[_0x7ec3('0x4b')]=function(_0x2c6edc,_0x562750,_0x19f3b8){if(_0x2c6edc[_0x7ec3('0x45')]['id']){delete _0x2c6edc[_0x7ec3('0x45')]['id'];}return db[_0x7ec3('0x2b')][_0x7ec3('0x4c')]({'where':{'id':_0x2c6edc[_0x7ec3('0x41')]['id']}})[_0x7ec3('0x25')](handleEntityNotFound(_0x562750,null))['then'](function(_0x30e2dd){if(_0x30e2dd){_0x2c6edc[_0x7ec3('0x45')][_0x7ec3('0x4d')]=_0x30e2dd['id'];_0x2c6edc[_0x7ec3('0x45')][_0x7ec3('0x4e')]=integrations[_0x7ec3('0x4f')](_0x2c6edc[_0x7ec3('0x45')][_0x7ec3('0x50')],_0x2c6edc[_0x7ec3('0x45')]['type']);_0x2c6edc[_0x7ec3('0x45')]['Descriptions']=integrations[_0x7ec3('0x51')](_0x2c6edc['body'][_0x7ec3('0x50')],_0x2c6edc[_0x7ec3('0x45')][_0x7ec3('0x2c')]);return db[_0x7ec3('0x48')][_0x7ec3('0x44')](_0x2c6edc[_0x7ec3('0x45')],{'include':[{'model':db[_0x7ec3('0x52')],'as':_0x7ec3('0x4e')},{'model':db[_0x7ec3('0x52')],'as':_0x7ec3('0x53')}]});}return null;})[_0x7ec3('0x25')](respondWithResult(_0x562750,null))['catch'](handleError(_0x562750,null));};exports['getFields']=function(_0x55f007,_0x5512e6,_0x2c7d1d){var _0x4d609c='';var _0x5026b8='';return db['FreshsalesAccount']['findOne']({'where':{'id':_0x55f007[_0x7ec3('0x41')]['id']},'attributes':['id',_0x7ec3('0x54'),_0x7ec3('0x55'),'apiKey']})[_0x7ec3('0x25')](handleEntityNotFound(_0x5512e6,null))['then'](function(_0x16dd86){if(_0x16dd86){_0x5026b8=_0x16dd86['username'];_0x4d609c=_0x16dd86[_0x7ec3('0x55')];var _0x33f55f=_0x16dd86[_0x7ec3('0x55')][_0x7ec3('0x56')](-0x1);if(_0x33f55f==='/'){_0x4d609c=_0x4d609c[_0x7ec3('0x57')](0x0,_0x4d609c[_0x7ec3('0x58')](_0x33f55f));}return rp({'method':'GET','uri':util['format'](_0x7ec3('0x59'),_0x4d609c,_0x7ec3('0x5a')),'headers':{'Authorization':_0x7ec3('0x5b')+_0x16dd86['apiKey']},'json':!![]});}})[_0x7ec3('0x25')](function(_0x1858dd){if(_0x1858dd){var _0x399be8=_0x1858dd['users'];var _0x560b55=![];var _0x11d73f=null;for(_0x11d73f=0x0;_0x11d73f<_0x399be8['length'];_0x11d73f++){if(_0x399be8[_0x11d73f][_0x7ec3('0x5c')]===_0x5026b8){_0x560b55=!![];}}if(_0x560b55){return!![];}else{throw new Error({'statusCode':0x194,'message':_0x7ec3('0x5d')});}}})[_0x7ec3('0x25')](respondWithResult(_0x5512e6,null))[_0x7ec3('0x3f')](function(_0x32a6dd){var _0x46934b=_0x55f007['query'][_0x7ec3('0x5e')]?0x1f4:_0x32a6dd[_0x7ec3('0x5f')]||0x1f4;logger[_0x7ec3('0x60')](_0x7ec3('0x61'),_0x7ec3('0x62'),_0x46934b,JSON[_0x7ec3('0x63')](_0x32a6dd));delete _0x32a6dd[_0x7ec3('0x27')];if(_0x46934b===0x191){_0x46934b=0x190;}_0x5512e6[_0x7ec3('0x1a')](_0x46934b)[_0x7ec3('0x28')](_0x55f007[_0x7ec3('0x2e')][_0x7ec3('0x5e')]?{'message':_0x7ec3('0x64'),'statusCode':_0x32a6dd['statusCode']}:_0x32a6dd);});}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js index 871a261..54f5599 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 _0x1967=['rimraf','../../config/environment','./intFreshsalesAccount.attributes','exports','define','FreshsalesAccount','int_freshsales_accounts','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x5e1e25,_0xdc1421){var _0x548e5f=function(_0x576360){while(--_0x576360){_0x5e1e25['push'](_0x5e1e25['shift']());}};_0x548e5f(++_0xdc1421);}(_0x1967,0x173));var _0x7196=function(_0x364441,_0x565692){_0x364441=_0x364441-0x0;var _0x424d72=_0x1967[_0x364441];return _0x424d72;};'use strict';var _=require('lodash');var util=require(_0x7196('0x0'));var logger=require(_0x7196('0x1'))(_0x7196('0x2'));var moment=require(_0x7196('0x3'));var BPromise=require(_0x7196('0x4'));var rp=require(_0x7196('0x5'));var fs=require('fs');var path=require(_0x7196('0x6'));var rimraf=require(_0x7196('0x7'));var config=require(_0x7196('0x8'));var attributes=require(_0x7196('0x9'));var integrations=require('../../components/integrations/configuration');module[_0x7196('0xa')]=function(_0x186175,_0x194746){return _0x186175[_0x7196('0xb')](_0x7196('0xc'),attributes,{'tableName':_0x7196('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x27a0=['int_freshsales_accounts','util','../../config/logger','api','moment','bluebird','./intFreshsalesAccount.attributes','../../components/integrations/configuration','exports','define'];(function(_0xebfb85,_0x4cc1a0){var _0x33ba9d=function(_0x4920e6){while(--_0x4920e6){_0xebfb85['push'](_0xebfb85['shift']());}};_0x33ba9d(++_0x4cc1a0);}(_0x27a0,0xbf));var _0x027a=function(_0x2d5e81,_0x1aeaff){_0x2d5e81=_0x2d5e81-0x0;var _0x2ae709=_0x27a0[_0x2d5e81];return _0x2ae709;};'use strict';var _=require('lodash');var util=require(_0x027a('0x0'));var logger=require(_0x027a('0x1'))(_0x027a('0x2'));var moment=require(_0x027a('0x3'));var BPromise=require(_0x027a('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(_0x027a('0x5'));var integrations=require(_0x027a('0x6'));module[_0x027a('0x7')]=function(_0x639bec,_0xe233ed){return _0x639bec[_0x027a('0x8')]('FreshsalesAccount',attributes,{'tableName':_0x027a('0x9'),'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 d893eec..7a1f643 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 _0x0598=['map','model','then','ShowFreshsalesAccount','find','where','lodash','util','bluebird','../../mysqldb','../../config/utils','jayson/promise','client','info','FreshsalesAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','catch','GetFreshsalesAccount','FreshsalesAccount','options','raw','attributes','limit','include'];(function(_0x50d285,_0x8f2995){var _0x3cdc18=function(_0x3e7bb0){while(--_0x3e7bb0){_0x50d285['push'](_0x50d285['shift']());}};_0x3cdc18(++_0x8f2995);}(_0x0598,0x92));var _0x8059=function(_0x4f62f3,_0x4b7cbe){_0x4f62f3=_0x4f62f3-0x0;var _0xb6f5c6=_0x0598[_0x4f62f3];return _0xb6f5c6;};'use strict';var _=require(_0x8059('0x0'));var util=require(_0x8059('0x1'));var moment=require('moment');var BPromise=require(_0x8059('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8059('0x3'))['db'];var utils=require(_0x8059('0x4'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x8059('0x5'));var client=jayson[_0x8059('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5996d7,_0x248273,_0x347f1b){return new BPromise(function(_0x4610d2,_0x116946){return client['request'](_0x5996d7,_0x347f1b)['then'](function(_0x89dda1){logger[_0x8059('0x7')](_0x8059('0x8'),_0x248273,_0x8059('0x9'));logger[_0x8059('0xa')]('FreshsalesAccount,\x20%s,\x20%s,\x20%s',_0x248273,'request\x20sent',JSON[_0x8059('0xb')](_0x89dda1));if(_0x89dda1[_0x8059('0xc')]){if(_0x89dda1['error']['code']===0x1f4){logger['error'](_0x8059('0x8'),_0x248273,_0x89dda1[_0x8059('0xc')][_0x8059('0xd')]);return _0x116946(_0x89dda1[_0x8059('0xc')][_0x8059('0xd')]);}logger['error'](_0x8059('0x8'),_0x248273,_0x89dda1['error'][_0x8059('0xd')]);return _0x4610d2(_0x89dda1['error'][_0x8059('0xd')]);}else{logger[_0x8059('0x7')](_0x8059('0x8'),_0x248273,'request\x20sent');_0x4610d2(_0x89dda1['result']['message']);}})[_0x8059('0xe')](function(_0x239195){logger[_0x8059('0xc')](_0x8059('0x8'),_0x248273,_0x239195);_0x116946(_0x239195);});});}exports[_0x8059('0xf')]=function(_0x4b6d55){var _0x10ad98=this;return new Promise(function(_0x2bb670,_0x37e926){return db[_0x8059('0x10')]['findAll']({'raw':_0x4b6d55[_0x8059('0x11')]?_0x4b6d55['options'][_0x8059('0x12')]===undefined?!![]:![]:!![],'where':_0x4b6d55['options']?_0x4b6d55[_0x8059('0x11')]['where']||null:null,'attributes':_0x4b6d55[_0x8059('0x11')]?_0x4b6d55[_0x8059('0x11')][_0x8059('0x13')]||null:null,'limit':_0x4b6d55['options']?_0x4b6d55['options'][_0x8059('0x14')]||null:null,'include':_0x4b6d55[_0x8059('0x11')]?_0x4b6d55[_0x8059('0x11')][_0x8059('0x15')]?_['map'](_0x4b6d55[_0x8059('0x11')][_0x8059('0x15')],function(_0x3da080){return{'model':db[_0x3da080['model']],'as':_0x3da080['as'],'attributes':_0x3da080[_0x8059('0x13')],'include':_0x3da080[_0x8059('0x15')]?_[_0x8059('0x16')](_0x3da080[_0x8059('0x15')],function(_0x59d3a6){return{'model':db[_0x59d3a6[_0x8059('0x17')]],'as':_0x59d3a6['as'],'attributes':_0x59d3a6[_0x8059('0x13')],'include':_0x59d3a6[_0x8059('0x15')]?_[_0x8059('0x16')](_0x59d3a6[_0x8059('0x15')],function(_0x54b88b){return{'model':db[_0x54b88b[_0x8059('0x17')]],'as':_0x54b88b['as'],'attributes':_0x54b88b[_0x8059('0x13')]};}):[]};}):[]};}):[]:[]})[_0x8059('0x18')](function(_0x4a294f){logger['info']('GetFreshsalesAccount',_0x4b6d55);logger[_0x8059('0xa')](_0x8059('0xf'),_0x4b6d55,JSON[_0x8059('0xb')](_0x4a294f));_0x2bb670(_0x4a294f);})[_0x8059('0xe')](function(_0x59abe9){logger[_0x8059('0xc')]('GetFreshsalesAccount',_0x59abe9[_0x8059('0xd')],_0x4b6d55);_0x37e926(_0x10ad98[_0x8059('0xc')](0x1f4,_0x59abe9['message']));});});};exports[_0x8059('0x19')]=function(_0x1aead2){var _0x30aac2=this;return new Promise(function(_0x260ba8,_0x2799b7){return db[_0x8059('0x10')][_0x8059('0x1a')]({'raw':_0x1aead2[_0x8059('0x11')]?_0x1aead2['options'][_0x8059('0x12')]===undefined?!![]:![]:!![],'where':_0x1aead2[_0x8059('0x11')]?_0x1aead2[_0x8059('0x11')][_0x8059('0x1b')]||null:null,'attributes':_0x1aead2[_0x8059('0x11')]?_0x1aead2['options'][_0x8059('0x13')]||null:null,'include':_0x1aead2[_0x8059('0x11')]?_0x1aead2[_0x8059('0x11')][_0x8059('0x15')]?_[_0x8059('0x16')](_0x1aead2[_0x8059('0x11')][_0x8059('0x15')],function(_0x175d57){return{'model':db[_0x175d57[_0x8059('0x17')]],'as':_0x175d57['as'],'attributes':_0x175d57[_0x8059('0x13')],'include':_0x175d57['include']?_[_0x8059('0x16')](_0x175d57['include'],function(_0x24194d){return{'model':db[_0x24194d['model']],'as':_0x24194d['as'],'attributes':_0x24194d['attributes'],'include':_0x24194d[_0x8059('0x15')]?_['map'](_0x24194d[_0x8059('0x15')],function(_0x50c745){return{'model':db[_0x50c745[_0x8059('0x17')]],'as':_0x50c745['as'],'attributes':_0x50c745['attributes']};}):[]};}):[]};}):[]:[]})[_0x8059('0x18')](function(_0x5c4aa0){logger['info'](_0x8059('0x19'),_0x1aead2);logger[_0x8059('0xa')](_0x8059('0x19'),_0x1aead2,JSON['stringify'](_0x5c4aa0));_0x260ba8(_0x5c4aa0);})[_0x8059('0xe')](function(_0x4927c9){logger[_0x8059('0xc')]('ShowFreshsalesAccount',_0x4927c9[_0x8059('0xd')],_0x1aead2);_0x2799b7(_0x30aac2[_0x8059('0xc')](0x1f4,_0x4927c9[_0x8059('0xd')]));});});}; \ No newline at end of file +var _0x0424=['info','result','catch','GetFreshsalesAccount','FreshsalesAccount','options','raw','where','attributes','limit','include','model','map','ShowFreshsalesAccount','find','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','FreshsalesAccount,\x20%s,\x20%s','request\x20sent','debug','FreshsalesAccount,\x20%s,\x20%s,\x20%s','stringify','error','message'];(function(_0x4b12fb,_0x4d7b05){var _0xf5713c=function(_0x4f94ac){while(--_0x4f94ac){_0x4b12fb['push'](_0x4b12fb['shift']());}};_0xf5713c(++_0x4d7b05);}(_0x0424,0x159));var _0x4042=function(_0x4709c8,_0x3384ca){_0x4709c8=_0x4709c8-0x0;var _0x478cdd=_0x0424[_0x4709c8];return _0x478cdd;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x4042('0x0'));var BPromise=require(_0x4042('0x1'));var rs=require(_0x4042('0x2'));var fs=require('fs');var Redis=require(_0x4042('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x4042('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0x4042('0x5'));var jayson=require(_0x4042('0x6'));var client=jayson[_0x4042('0x7')][_0x4042('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3abaf1,_0xa5310f,_0x10ec07){return new BPromise(function(_0x5d11bf,_0x509772){return client[_0x4042('0x9')](_0x3abaf1,_0x10ec07)[_0x4042('0xa')](function(_0x103e4a){logger['info'](_0x4042('0xb'),_0xa5310f,_0x4042('0xc'));logger[_0x4042('0xd')](_0x4042('0xe'),_0xa5310f,_0x4042('0xc'),JSON[_0x4042('0xf')](_0x103e4a));if(_0x103e4a[_0x4042('0x10')]){if(_0x103e4a[_0x4042('0x10')]['code']===0x1f4){logger[_0x4042('0x10')](_0x4042('0xb'),_0xa5310f,_0x103e4a['error'][_0x4042('0x11')]);return _0x509772(_0x103e4a[_0x4042('0x10')][_0x4042('0x11')]);}logger[_0x4042('0x10')](_0x4042('0xb'),_0xa5310f,_0x103e4a[_0x4042('0x10')][_0x4042('0x11')]);return _0x5d11bf(_0x103e4a['error'][_0x4042('0x11')]);}else{logger[_0x4042('0x12')]('FreshsalesAccount,\x20%s,\x20%s',_0xa5310f,_0x4042('0xc'));_0x5d11bf(_0x103e4a[_0x4042('0x13')][_0x4042('0x11')]);}})[_0x4042('0x14')](function(_0x31e765){logger[_0x4042('0x10')](_0x4042('0xb'),_0xa5310f,_0x31e765);_0x509772(_0x31e765);});});}exports[_0x4042('0x15')]=function(_0x466077){var _0x4b02d4=this;return new Promise(function(_0xe5c1ec,_0x4fe024){return db[_0x4042('0x16')]['findAll']({'raw':_0x466077[_0x4042('0x17')]?_0x466077[_0x4042('0x17')][_0x4042('0x18')]===undefined?!![]:![]:!![],'where':_0x466077[_0x4042('0x17')]?_0x466077['options'][_0x4042('0x19')]||null:null,'attributes':_0x466077[_0x4042('0x17')]?_0x466077[_0x4042('0x17')][_0x4042('0x1a')]||null:null,'limit':_0x466077['options']?_0x466077[_0x4042('0x17')][_0x4042('0x1b')]||null:null,'include':_0x466077[_0x4042('0x17')]?_0x466077[_0x4042('0x17')][_0x4042('0x1c')]?_['map'](_0x466077[_0x4042('0x17')][_0x4042('0x1c')],function(_0x519f2c){return{'model':db[_0x519f2c[_0x4042('0x1d')]],'as':_0x519f2c['as'],'attributes':_0x519f2c['attributes'],'include':_0x519f2c[_0x4042('0x1c')]?_[_0x4042('0x1e')](_0x519f2c[_0x4042('0x1c')],function(_0x5d5c6d){return{'model':db[_0x5d5c6d[_0x4042('0x1d')]],'as':_0x5d5c6d['as'],'attributes':_0x5d5c6d[_0x4042('0x1a')],'include':_0x5d5c6d[_0x4042('0x1c')]?_[_0x4042('0x1e')](_0x5d5c6d[_0x4042('0x1c')],function(_0x52e575){return{'model':db[_0x52e575['model']],'as':_0x52e575['as'],'attributes':_0x52e575[_0x4042('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x4042('0xa')](function(_0x26542c){logger[_0x4042('0x12')](_0x4042('0x15'),_0x466077);logger[_0x4042('0xd')]('GetFreshsalesAccount',_0x466077,JSON[_0x4042('0xf')](_0x26542c));_0xe5c1ec(_0x26542c);})[_0x4042('0x14')](function(_0x4a6a6e){logger[_0x4042('0x10')](_0x4042('0x15'),_0x4a6a6e[_0x4042('0x11')],_0x466077);_0x4fe024(_0x4b02d4['error'](0x1f4,_0x4a6a6e['message']));});});};exports[_0x4042('0x1f')]=function(_0x43bd1c){var _0x59773f=this;return new Promise(function(_0x3e9304,_0xc42d70){return db[_0x4042('0x16')][_0x4042('0x20')]({'raw':_0x43bd1c[_0x4042('0x17')]?_0x43bd1c[_0x4042('0x17')][_0x4042('0x18')]===undefined?!![]:![]:!![],'where':_0x43bd1c[_0x4042('0x17')]?_0x43bd1c[_0x4042('0x17')]['where']||null:null,'attributes':_0x43bd1c[_0x4042('0x17')]?_0x43bd1c[_0x4042('0x17')]['attributes']||null:null,'include':_0x43bd1c[_0x4042('0x17')]?_0x43bd1c[_0x4042('0x17')]['include']?_[_0x4042('0x1e')](_0x43bd1c[_0x4042('0x17')][_0x4042('0x1c')],function(_0xaa7c99){return{'model':db[_0xaa7c99[_0x4042('0x1d')]],'as':_0xaa7c99['as'],'attributes':_0xaa7c99[_0x4042('0x1a')],'include':_0xaa7c99[_0x4042('0x1c')]?_[_0x4042('0x1e')](_0xaa7c99[_0x4042('0x1c')],function(_0x37195b){return{'model':db[_0x37195b[_0x4042('0x1d')]],'as':_0x37195b['as'],'attributes':_0x37195b[_0x4042('0x1a')],'include':_0x37195b[_0x4042('0x1c')]?_[_0x4042('0x1e')](_0x37195b[_0x4042('0x1c')],function(_0x2b5f5e){return{'model':db[_0x2b5f5e[_0x4042('0x1d')]],'as':_0x2b5f5e['as'],'attributes':_0x2b5f5e[_0x4042('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x4042('0xa')](function(_0x26b7b0){logger[_0x4042('0x12')]('ShowFreshsalesAccount',_0x43bd1c);logger[_0x4042('0xd')](_0x4042('0x1f'),_0x43bd1c,JSON[_0x4042('0xf')](_0x26b7b0));_0x3e9304(_0x26b7b0);})[_0x4042('0x14')](function(_0x588932){logger[_0x4042('0x10')](_0x4042('0x1f'),_0x588932[_0x4042('0x11')],_0x43bd1c);_0xc42d70(_0x59773f[_0x4042('0x10')](0x1f4,_0x588932[_0x4042('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/index.js b/server/api/intFreshsalesConfiguration/index.js index 0285142..5f47a56 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 _0xc0a9=['connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./intFreshsalesConfiguration.controller','get','index','/:id','show','/:id/subjects','isAuthenticated','getSubjects','getDescriptions','post','update','delete','destroy','exports','multer','util','path'];(function(_0x160e76,_0x162e97){var _0x5c9fb5=function(_0x482f9b){while(--_0x482f9b){_0x160e76['push'](_0x160e76['shift']());}};_0x5c9fb5(++_0x162e97);}(_0xc0a9,0x1cb));var _0x9c0a=function(_0x1b6186,_0x1ec7f2){_0x1b6186=_0x1b6186-0x0;var _0x186121=_0xc0a9[_0x1b6186];return _0x186121;};'use strict';var multer=require(_0x9c0a('0x0'));var util=require(_0x9c0a('0x1'));var path=require(_0x9c0a('0x2'));var timeout=require(_0x9c0a('0x3'));var express=require(_0x9c0a('0x4'));var router=express['Router']();var fs_extra=require(_0x9c0a('0x5'));var auth=require(_0x9c0a('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x9c0a('0x7'));var controller=require(_0x9c0a('0x8'));router[_0x9c0a('0x9')]('/',auth['isAuthenticated'](),controller[_0x9c0a('0xa')]);router[_0x9c0a('0x9')](_0x9c0a('0xb'),auth['isAuthenticated'](),controller[_0x9c0a('0xc')]);router['get'](_0x9c0a('0xd'),auth[_0x9c0a('0xe')](),controller[_0x9c0a('0xf')]);router['get']('/:id/descriptions',auth['isAuthenticated'](),controller[_0x9c0a('0x10')]);router[_0x9c0a('0x9')]('/:id/fields',auth[_0x9c0a('0xe')](),controller['getFields']);router[_0x9c0a('0x11')]('/',auth[_0x9c0a('0xe')](),controller['create']);router['put'](_0x9c0a('0xb'),auth['isAuthenticated'](),controller[_0x9c0a('0x12')]);router[_0x9c0a('0x13')](_0x9c0a('0xb'),auth[_0x9c0a('0xe')](),controller[_0x9c0a('0x14')]);module[_0x9c0a('0x15')]=router; \ No newline at end of file +var _0x94eb=['update','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','show','/:id/subjects','getDescriptions','/:id/fields','getFields','post','create','put'];(function(_0x1f3f57,_0x45494c){var _0x21b127=function(_0x5b6e21){while(--_0x5b6e21){_0x1f3f57['push'](_0x1f3f57['shift']());}};_0x21b127(++_0x45494c);}(_0x94eb,0xbc));var _0xb94e=function(_0x466974,_0x5a999d){_0x466974=_0x466974-0x0;var _0x3a79fa=_0x94eb[_0x466974];return _0x3a79fa;};'use strict';var multer=require(_0xb94e('0x0'));var util=require(_0xb94e('0x1'));var path=require(_0xb94e('0x2'));var timeout=require('connect-timeout');var express=require(_0xb94e('0x3'));var router=express[_0xb94e('0x4')]();var fs_extra=require(_0xb94e('0x5'));var auth=require(_0xb94e('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xb94e('0x7'));var controller=require('./intFreshsalesConfiguration.controller');router[_0xb94e('0x8')]('/',auth[_0xb94e('0x9')](),controller[_0xb94e('0xa')]);router[_0xb94e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0xb94e('0xb')]);router[_0xb94e('0x8')](_0xb94e('0xc'),auth['isAuthenticated'](),controller['getSubjects']);router[_0xb94e('0x8')]('/:id/descriptions',auth['isAuthenticated'](),controller[_0xb94e('0xd')]);router[_0xb94e('0x8')](_0xb94e('0xe'),auth['isAuthenticated'](),controller[_0xb94e('0xf')]);router[_0xb94e('0x10')]('/',auth[_0xb94e('0x9')](),controller[_0xb94e('0x11')]);router[_0xb94e('0x12')]('/:id',auth['isAuthenticated'](),controller[_0xb94e('0x13')]);router[_0xb94e('0x14')]('/:id',auth[_0xb94e('0x9')](),controller[_0xb94e('0x15')]);module[_0xb94e('0x16')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js index 2c7f1b8..c035dae 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 _0x5734=['STRING','exports'];(function(_0x13b8f3,_0x442821){var _0x1a6d06=function(_0x5126f2){while(--_0x5126f2){_0x13b8f3['push'](_0x13b8f3['shift']());}};_0x1a6d06(++_0x442821);}(_0x5734,0xcb));var _0x4573=function(_0xb08125,_0x561acb){_0xb08125=_0xb08125-0x0;var _0x2ace23=_0x5734[_0xb08125];return _0x2ace23;};'use strict';var Sequelize=require('sequelize');module[_0x4573('0x0')]={'name':{'type':Sequelize[_0x4573('0x1')]},'description':{'type':Sequelize[_0x4573('0x1')]}}; \ No newline at end of file +var _0xced4=['sequelize','exports','STRING'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xced4,0x18f));var _0x4ced=function(_0x31c5e9,_0x30e373){_0x31c5e9=_0x31c5e9-0x0;var _0x517a8d=_0xced4[_0x31c5e9];return _0x517a8d;};'use strict';var Sequelize=require(_0x4ced('0x0'));module[_0x4ced('0x1')]={'name':{'type':Sequelize[_0x4ced('0x2')]},'description':{'type':Sequelize[_0x4ced('0x2')]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js index a38a056..d47e070 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 _0x6ff8=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','limit','undefined','offset','count','apply','reject','save','then','error','stack','send','index','FreshsalesConfiguration','rawAttributes','fieldName','type','key','model','map','name','query','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filters','filter','merge','VIRTUAL','options','includeAll','include','show','catch','create','body','update','params','destroy','getSubjects','keys','nolimit','getDescriptions','FreshsalesField','pick','getFields','findOne','eml-format','rimraf','zip-dir','moment','bluebird','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service'];(function(_0x2ef35b,_0x2885b6){var _0x4c5879=function(_0x197ac9){while(--_0x197ac9){_0x2ef35b['push'](_0x2ef35b['shift']());}};_0x4c5879(++_0x2885b6);}(_0x6ff8,0x125));var _0x86ff=function(_0x5b6cf1,_0x32fdcd){_0x5b6cf1=_0x5b6cf1-0x0;var _0x46278c=_0x6ff8[_0x5b6cf1];return _0x46278c;};'use strict';var emlformat=require(_0x86ff('0x0'));var rimraf=require(_0x86ff('0x1'));var zipdir=require(_0x86ff('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x86ff('0x3'));var BPromise=require(_0x86ff('0x4'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x86ff('0x5'));var ejs=require(_0x86ff('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x86ff('0x7'));var squel=require(_0x86ff('0x8'));var crypto=require(_0x86ff('0x9'));var jsforce=require(_0x86ff('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x86ff('0x5'));var querystring=require(_0x86ff('0xb'));var Papa=require(_0x86ff('0xc'));var Redis=require(_0x86ff('0xd'));var authService=require(_0x86ff('0xe'));var qs=require(_0x86ff('0xf'));var as=require(_0x86ff('0x10'));var hardwareService=require(_0x86ff('0x11'));var logger=require('../../config/logger')(_0x86ff('0x12'));var utils=require(_0x86ff('0x13'));var config=require(_0x86ff('0x14'));var licenseUtil=require(_0x86ff('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3c920f,_0x192376){_0x192376=_0x192376||0xcc;return function(_0x3abb4){if(_0x3abb4){return _0x3c920f[_0x86ff('0x16')](_0x192376);}return _0x3c920f[_0x86ff('0x17')](_0x192376)[_0x86ff('0x18')]();};}function respondWithResult(_0x329e8d,_0x42131f){_0x42131f=_0x42131f||0xc8;return function(_0x32cd37){if(_0x32cd37){return _0x329e8d['status'](_0x42131f)[_0x86ff('0x19')](_0x32cd37);}};}function respondWithFilteredResult(_0x2ad0f6,_0x363339){return function(_0x218c71){if(_0x218c71){var _0x2c3253=typeof _0x363339['offset']==='undefined'&&typeof _0x363339[_0x86ff('0x1a')]===_0x86ff('0x1b');var _0x2e5f28=_0x218c71['count'];var _0x294c8a=_0x2c3253?0x0:_0x363339[_0x86ff('0x1c')];var _0x4e22e9=_0x2c3253?_0x218c71[_0x86ff('0x1d')]:_0x363339['offset']+_0x363339['limit'];var _0x4dd65c;if(_0x4e22e9>=_0x2e5f28){_0x4e22e9=_0x2e5f28;_0x4dd65c=0xc8;}else{_0x4dd65c=0xce;}_0x2ad0f6[_0x86ff('0x17')](_0x4dd65c);return _0x2ad0f6['set']('Content-Range',_0x294c8a+'-'+_0x4e22e9+'/'+_0x2e5f28)[_0x86ff('0x19')](_0x218c71);}return null;};}function patchUpdates(_0x1db604){return function(_0x5ef619){try{jsonpatch[_0x86ff('0x1e')](_0x5ef619,_0x1db604,!![]);}catch(_0x12647c){return BPromise[_0x86ff('0x1f')](_0x12647c);}return _0x5ef619[_0x86ff('0x20')]();};}function saveUpdates(_0x14045c,_0x488812){return function(_0x1a89a7){if(_0x1a89a7){return _0x1a89a7['update'](_0x14045c)[_0x86ff('0x21')](function(_0x3c8455){return _0x3c8455;});}return null;};}function removeEntity(_0x1ae5ca,_0x34e5fe){return function(_0x3fcf07){if(_0x3fcf07){return _0x3fcf07['destroy']()[_0x86ff('0x21')](function(){_0x1ae5ca['status'](0xcc)[_0x86ff('0x18')]();});}};}function handleEntityNotFound(_0x3b9145,_0x375aea){return function(_0x44e48e){if(!_0x44e48e){_0x3b9145[_0x86ff('0x16')](0x194);}return _0x44e48e;};}function handleError(_0x212869,_0x5ae310){_0x5ae310=_0x5ae310||0x1f4;return function(_0x3417c1){logger[_0x86ff('0x22')](_0x3417c1[_0x86ff('0x23')]);if(_0x3417c1['name']){delete _0x3417c1['name'];}_0x212869['status'](_0x5ae310)[_0x86ff('0x24')](_0x3417c1);};}exports[_0x86ff('0x25')]=function(_0xfa02fd,_0x41560f){var _0x396cb0={},_0x64f011={},_0x3806f4={'count':0x0,'rows':[]};var _0x571081=_['map'](db[_0x86ff('0x26')][_0x86ff('0x27')],function(_0x5e6169){return{'name':_0x5e6169[_0x86ff('0x28')],'type':_0x5e6169[_0x86ff('0x29')][_0x86ff('0x2a')]};});_0x64f011[_0x86ff('0x2b')]=_[_0x86ff('0x2c')](_0x571081,_0x86ff('0x2d'));_0x64f011[_0x86ff('0x2e')]=_['keys'](_0xfa02fd['query']);_0x64f011['filters']=_[_0x86ff('0x2f')](_0x64f011[_0x86ff('0x2b')],_0x64f011[_0x86ff('0x2e')]);_0x396cb0[_0x86ff('0x30')]=_['intersection'](_0x64f011[_0x86ff('0x2b')],qs['fields'](_0xfa02fd[_0x86ff('0x2e')][_0x86ff('0x31')]));_0x396cb0[_0x86ff('0x30')]=_0x396cb0[_0x86ff('0x30')][_0x86ff('0x32')]?_0x396cb0['attributes']:_0x64f011[_0x86ff('0x2b')];if(!_0xfa02fd['query'][_0x86ff('0x33')]('nolimit')){_0x396cb0[_0x86ff('0x1a')]=qs[_0x86ff('0x1a')](_0xfa02fd[_0x86ff('0x2e')][_0x86ff('0x1a')]);_0x396cb0[_0x86ff('0x1c')]=qs['offset'](_0xfa02fd[_0x86ff('0x2e')][_0x86ff('0x1c')]);}_0x396cb0[_0x86ff('0x34')]=qs[_0x86ff('0x35')](_0xfa02fd['query']['sort']);_0x396cb0[_0x86ff('0x36')]=qs[_0x86ff('0x37')](_['pick'](_0xfa02fd[_0x86ff('0x2e')],_0x64f011['filters']),_0x571081);if(_0xfa02fd[_0x86ff('0x2e')][_0x86ff('0x38')]){_0x396cb0[_0x86ff('0x36')]=_[_0x86ff('0x39')](_0x396cb0['where'],{'$or':_[_0x86ff('0x2c')](_0x571081,function(_0x3e4ae0){if(_0x3e4ae0[_0x86ff('0x29')]!==_0x86ff('0x3a')){var _0x3c53f9={};_0x3c53f9[_0x3e4ae0[_0x86ff('0x2d')]]={'$like':'%'+_0xfa02fd[_0x86ff('0x2e')]['filter']+'%'};return _0x3c53f9;}})});}_0x396cb0=_[_0x86ff('0x39')]({},_0x396cb0,_0xfa02fd[_0x86ff('0x3b')]);var _0x37a558={'where':_0x396cb0['where']};return db[_0x86ff('0x26')][_0x86ff('0x1d')](_0x37a558)[_0x86ff('0x21')](function(_0x51dce3){_0x3806f4[_0x86ff('0x1d')]=_0x51dce3;if(_0xfa02fd[_0x86ff('0x2e')][_0x86ff('0x3c')]){_0x396cb0[_0x86ff('0x3d')]=[{'all':!![]}];}return db[_0x86ff('0x26')]['findAll'](_0x396cb0);})[_0x86ff('0x21')](function(_0x555700){_0x3806f4['rows']=_0x555700;return _0x3806f4;})[_0x86ff('0x21')](respondWithFilteredResult(_0x41560f,_0x396cb0))['catch'](handleError(_0x41560f,null));};exports[_0x86ff('0x3e')]=function(_0x4c9e3c,_0x45fb27){var _0xb12d14={'raw':![],'where':{'id':_0x4c9e3c['params']['id']}},_0x422155={};_0x422155[_0x86ff('0x2b')]=_['keys'](db[_0x86ff('0x26')][_0x86ff('0x27')]);_0x422155[_0x86ff('0x2e')]=_['keys'](_0x4c9e3c['query']);_0x422155[_0x86ff('0x37')]=_[_0x86ff('0x2f')](_0x422155['model'],_0x422155['query']);_0xb12d14[_0x86ff('0x30')]=_[_0x86ff('0x2f')](_0x422155[_0x86ff('0x2b')],qs[_0x86ff('0x31')](_0x4c9e3c[_0x86ff('0x2e')][_0x86ff('0x31')]));_0xb12d14[_0x86ff('0x30')]=_0xb12d14[_0x86ff('0x30')][_0x86ff('0x32')]?_0xb12d14[_0x86ff('0x30')]:_0x422155[_0x86ff('0x2b')];if(_0x4c9e3c[_0x86ff('0x2e')][_0x86ff('0x3c')]){_0xb12d14['include']=[{'all':!![]}];}_0xb12d14=_['merge']({},_0xb12d14,_0x4c9e3c[_0x86ff('0x3b')]);return db[_0x86ff('0x26')]['find'](_0xb12d14)[_0x86ff('0x21')](handleEntityNotFound(_0x45fb27,null))[_0x86ff('0x21')](respondWithResult(_0x45fb27,null))[_0x86ff('0x3f')](handleError(_0x45fb27,null));};exports['create']=function(_0x2ba4b0,_0x3d8d22){return db[_0x86ff('0x26')][_0x86ff('0x40')](_0x2ba4b0[_0x86ff('0x41')],{})[_0x86ff('0x21')](respondWithResult(_0x3d8d22,0xc9))['catch'](handleError(_0x3d8d22,null));};exports[_0x86ff('0x42')]=function(_0x119cf8,_0x6011fb){if(_0x119cf8[_0x86ff('0x41')]['id']){delete _0x119cf8[_0x86ff('0x41')]['id'];}return db['FreshsalesConfiguration']['find']({'where':{'id':_0x119cf8[_0x86ff('0x43')]['id']}})['then'](handleEntityNotFound(_0x6011fb,null))[_0x86ff('0x21')](saveUpdates(_0x119cf8[_0x86ff('0x41')],null))['then'](respondWithResult(_0x6011fb,null))['catch'](handleError(_0x6011fb,null));};exports[_0x86ff('0x44')]=function(_0x230f51,_0x4b97b4){return db[_0x86ff('0x26')]['find']({'where':{'id':_0x230f51[_0x86ff('0x43')]['id']}})[_0x86ff('0x21')](handleEntityNotFound(_0x4b97b4,null))['then'](removeEntity(_0x4b97b4,null))[_0x86ff('0x3f')](handleError(_0x4b97b4,null));};exports[_0x86ff('0x45')]=function(_0x9f93b2,_0x3a6702,_0x5d489d){var _0x938018={};var _0x9080a7={};var _0x3157b3;var _0x56e838;return db['FreshsalesConfiguration']['findOne']({'where':{'id':_0x9f93b2[_0x86ff('0x43')]['id']}})[_0x86ff('0x21')](handleEntityNotFound(_0x3a6702,null))[_0x86ff('0x21')](function(_0x3bfe70){if(_0x3bfe70){_0x3157b3=_0x3bfe70;_0x9080a7[_0x86ff('0x2b')]=_['keys'](db['FreshsalesField'][_0x86ff('0x27')]);_0x9080a7[_0x86ff('0x2e')]=_[_0x86ff('0x46')](_0x9f93b2[_0x86ff('0x2e')]);_0x9080a7[_0x86ff('0x37')]=_['intersection'](_0x9080a7[_0x86ff('0x2b')],_0x9080a7[_0x86ff('0x2e')]);_0x938018[_0x86ff('0x30')]=_[_0x86ff('0x2f')](_0x9080a7['model'],qs[_0x86ff('0x31')](_0x9f93b2[_0x86ff('0x2e')]['fields']));_0x938018['attributes']=_0x938018['attributes']['length']?_0x938018[_0x86ff('0x30')]:_0x9080a7['model'];_0x938018[_0x86ff('0x34')]=qs[_0x86ff('0x35')](_0x9f93b2['query'][_0x86ff('0x35')]);_0x938018[_0x86ff('0x36')]=qs[_0x86ff('0x37')](_['pick'](_0x9f93b2[_0x86ff('0x2e')],_0x9080a7[_0x86ff('0x37')]));if(_0x9f93b2[_0x86ff('0x2e')][_0x86ff('0x38')]){_0x938018['where']=_[_0x86ff('0x39')](_0x938018[_0x86ff('0x36')],{'$or':_[_0x86ff('0x2c')](_0x938018['attributes'],function(_0x43235a){var _0x55f729={};_0x55f729[_0x43235a]={'$like':'%'+_0x9f93b2['query'][_0x86ff('0x38')]+'%'};return _0x55f729;})});}_0x938018=_['merge']({},_0x938018,_0x9f93b2[_0x86ff('0x3b')]);return _0x3157b3['getSubjects'](_0x938018);}})[_0x86ff('0x21')](function(_0x47aafd){if(_0x47aafd){_0x56e838=_0x47aafd['length'];if(!_0x9f93b2['query'][_0x86ff('0x33')](_0x86ff('0x47'))){_0x938018[_0x86ff('0x1a')]=qs[_0x86ff('0x1a')](_0x9f93b2['query'][_0x86ff('0x1a')]);_0x938018[_0x86ff('0x1c')]=qs[_0x86ff('0x1c')](_0x9f93b2['query'][_0x86ff('0x1c')]);}return _0x3157b3['getSubjects'](_0x938018);}})[_0x86ff('0x21')](function(_0x35eb2c){if(_0x35eb2c){return _0x35eb2c?{'count':_0x56e838,'rows':_0x35eb2c}:null;}})[_0x86ff('0x21')](respondWithResult(_0x3a6702,null))[_0x86ff('0x3f')](handleError(_0x3a6702,null));};exports[_0x86ff('0x48')]=function(_0x593ddc,_0x449373,_0x21d209){var _0x3954b={};var _0x1f805f={};var _0x38fd68;var _0x4014c5;return db[_0x86ff('0x26')]['findOne']({'where':{'id':_0x593ddc[_0x86ff('0x43')]['id']}})[_0x86ff('0x21')](handleEntityNotFound(_0x449373,null))[_0x86ff('0x21')](function(_0x358ae5){if(_0x358ae5){_0x38fd68=_0x358ae5;_0x1f805f['model']=_[_0x86ff('0x46')](db[_0x86ff('0x49')][_0x86ff('0x27')]);_0x1f805f[_0x86ff('0x2e')]=_['keys'](_0x593ddc[_0x86ff('0x2e')]);_0x1f805f[_0x86ff('0x37')]=_[_0x86ff('0x2f')](_0x1f805f[_0x86ff('0x2b')],_0x1f805f[_0x86ff('0x2e')]);_0x3954b[_0x86ff('0x30')]=_[_0x86ff('0x2f')](_0x1f805f['model'],qs[_0x86ff('0x31')](_0x593ddc['query']['fields']));_0x3954b[_0x86ff('0x30')]=_0x3954b['attributes']['length']?_0x3954b[_0x86ff('0x30')]:_0x1f805f['model'];_0x3954b[_0x86ff('0x34')]=qs[_0x86ff('0x35')](_0x593ddc[_0x86ff('0x2e')]['sort']);_0x3954b[_0x86ff('0x36')]=qs[_0x86ff('0x37')](_[_0x86ff('0x4a')](_0x593ddc['query'],_0x1f805f[_0x86ff('0x37')]));if(_0x593ddc[_0x86ff('0x2e')][_0x86ff('0x38')]){_0x3954b[_0x86ff('0x36')]=_[_0x86ff('0x39')](_0x3954b[_0x86ff('0x36')],{'$or':_[_0x86ff('0x2c')](_0x3954b[_0x86ff('0x30')],function(_0x381061){var _0x4a529f={};_0x4a529f[_0x381061]={'$like':'%'+_0x593ddc[_0x86ff('0x2e')][_0x86ff('0x38')]+'%'};return _0x4a529f;})});}_0x3954b=_[_0x86ff('0x39')]({},_0x3954b,_0x593ddc[_0x86ff('0x3b')]);return _0x38fd68[_0x86ff('0x48')](_0x3954b);}})['then'](function(_0x47449f){if(_0x47449f){_0x4014c5=_0x47449f[_0x86ff('0x32')];if(!_0x593ddc['query']['hasOwnProperty'](_0x86ff('0x47'))){_0x3954b['limit']=qs[_0x86ff('0x1a')](_0x593ddc[_0x86ff('0x2e')][_0x86ff('0x1a')]);_0x3954b[_0x86ff('0x1c')]=qs['offset'](_0x593ddc[_0x86ff('0x2e')][_0x86ff('0x1c')]);}return _0x38fd68[_0x86ff('0x48')](_0x3954b);}})[_0x86ff('0x21')](function(_0x225586){if(_0x225586){return _0x225586?{'count':_0x4014c5,'rows':_0x225586}:null;}})[_0x86ff('0x21')](respondWithResult(_0x449373,null))[_0x86ff('0x3f')](handleError(_0x449373,null));};exports[_0x86ff('0x4b')]=function(_0x2c80d2,_0x95be9e,_0x2711e3){var _0x5a10d1={};var _0x3f75e2={};var _0x38596c;var _0x32e9d2;return db['FreshsalesConfiguration'][_0x86ff('0x4c')]({'where':{'id':_0x2c80d2['params']['id']}})[_0x86ff('0x21')](handleEntityNotFound(_0x95be9e,null))['then'](function(_0x35b883){if(_0x35b883){_0x38596c=_0x35b883;_0x3f75e2[_0x86ff('0x2b')]=_[_0x86ff('0x46')](db[_0x86ff('0x49')]['rawAttributes']);_0x3f75e2[_0x86ff('0x2e')]=_[_0x86ff('0x46')](_0x2c80d2['query']);_0x3f75e2['filters']=_['intersection'](_0x3f75e2[_0x86ff('0x2b')],_0x3f75e2[_0x86ff('0x2e')]);_0x5a10d1['attributes']=_[_0x86ff('0x2f')](_0x3f75e2['model'],qs['fields'](_0x2c80d2['query'][_0x86ff('0x31')]));_0x5a10d1['attributes']=_0x5a10d1[_0x86ff('0x30')][_0x86ff('0x32')]?_0x5a10d1['attributes']:_0x3f75e2[_0x86ff('0x2b')];_0x5a10d1[_0x86ff('0x34')]=qs['sort'](_0x2c80d2[_0x86ff('0x2e')][_0x86ff('0x35')]);_0x5a10d1['where']=qs['filters'](_['pick'](_0x2c80d2['query'],_0x3f75e2[_0x86ff('0x37')]));if(_0x2c80d2[_0x86ff('0x2e')][_0x86ff('0x38')]){_0x5a10d1[_0x86ff('0x36')]=_[_0x86ff('0x39')](_0x5a10d1[_0x86ff('0x36')],{'$or':_[_0x86ff('0x2c')](_0x5a10d1[_0x86ff('0x30')],function(_0x4d0b7f){var _0x598d4a={};_0x598d4a[_0x4d0b7f]={'$like':'%'+_0x2c80d2[_0x86ff('0x2e')][_0x86ff('0x38')]+'%'};return _0x598d4a;})});}_0x5a10d1=_[_0x86ff('0x39')]({},_0x5a10d1,_0x2c80d2['options']);return _0x38596c[_0x86ff('0x4b')](_0x5a10d1);}})[_0x86ff('0x21')](function(_0x52b57f){if(_0x52b57f){_0x32e9d2=_0x52b57f[_0x86ff('0x32')];if(!_0x2c80d2['query'][_0x86ff('0x33')](_0x86ff('0x47'))){_0x5a10d1[_0x86ff('0x1a')]=qs[_0x86ff('0x1a')](_0x2c80d2[_0x86ff('0x2e')][_0x86ff('0x1a')]);_0x5a10d1[_0x86ff('0x1c')]=qs[_0x86ff('0x1c')](_0x2c80d2['query'][_0x86ff('0x1c')]);}return _0x38596c[_0x86ff('0x4b')](_0x5a10d1);}})[_0x86ff('0x21')](function(_0x264a15){if(_0x264a15){return _0x264a15?{'count':_0x32e9d2,'rows':_0x264a15}:null;}})['then'](respondWithResult(_0x95be9e,null))[_0x86ff('0x3f')](handleError(_0x95be9e,null));}; \ No newline at end of file +var _0x693c=['length','find','create','body','getSubjects','findOne','FreshsalesField','pick','nolimit','getDescriptions','getFields','eml-format','rimraf','zip-dir','request-promise','moment','util','path','sox','ejs','fs-extra','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','FreshsalesConfiguration','fieldName','key','model','map','query','keys','filters','intersection','fields','attributes','hasOwnProperty','order','sort','where','filter','type','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes'];(function(_0x2f6cc9,_0x1e2bbe){var _0x4769f4=function(_0x50c711){while(--_0x50c711){_0x2f6cc9['push'](_0x2f6cc9['shift']());}};_0x4769f4(++_0x1e2bbe);}(_0x693c,0xaf));var _0xc693=function(_0x45e7d7,_0x27a087){_0x45e7d7=_0x45e7d7-0x0;var _0x55b8ad=_0x693c[_0x45e7d7];return _0x55b8ad;};'use strict';var emlformat=require(_0xc693('0x0'));var rimraf=require(_0xc693('0x1'));var zipdir=require(_0xc693('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xc693('0x3'));var moment=require(_0xc693('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xc693('0x5'));var path=require(_0xc693('0x6'));var sox=require(_0xc693('0x7'));var csv=require('to-csv');var ejs=require(_0xc693('0x8'));var fs=require('fs');var fs_extra=require(_0xc693('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xc693('0xa'));var jsforce=require(_0xc693('0xb'));var deskjs=require(_0xc693('0xc'));var toCsv=require(_0xc693('0xd'));var querystring=require(_0xc693('0xe'));var Papa=require(_0xc693('0xf'));var Redis=require(_0xc693('0x10'));var authService=require(_0xc693('0x11'));var qs=require(_0xc693('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc693('0x13'));var logger=require(_0xc693('0x14'))('api');var utils=require(_0xc693('0x15'));var config=require(_0xc693('0x16'));var licenseUtil=require(_0xc693('0x17'));var db=require(_0xc693('0x18'))['db'];function respondWithStatusCode(_0x3eb8d7,_0x121af3){_0x121af3=_0x121af3||0xcc;return function(_0x3e2134){if(_0x3e2134){return _0x3eb8d7[_0xc693('0x19')](_0x121af3);}return _0x3eb8d7[_0xc693('0x1a')](_0x121af3)[_0xc693('0x1b')]();};}function respondWithResult(_0x4a6f24,_0x4fdbaf){_0x4fdbaf=_0x4fdbaf||0xc8;return function(_0x867713){if(_0x867713){return _0x4a6f24[_0xc693('0x1a')](_0x4fdbaf)[_0xc693('0x1c')](_0x867713);}};}function respondWithFilteredResult(_0x1a6d66,_0x110a88){return function(_0xfeeae9){if(_0xfeeae9){var _0x312cf4=typeof _0x110a88['offset']===_0xc693('0x1d')&&typeof _0x110a88[_0xc693('0x1e')]===_0xc693('0x1d');var _0xbd787e=_0xfeeae9[_0xc693('0x1f')];var _0x4406b0=_0x312cf4?0x0:_0x110a88[_0xc693('0x20')];var _0x42c06=_0x312cf4?_0xfeeae9[_0xc693('0x1f')]:_0x110a88[_0xc693('0x20')]+_0x110a88['limit'];var _0x15f6ef;if(_0x42c06>=_0xbd787e){_0x42c06=_0xbd787e;_0x15f6ef=0xc8;}else{_0x15f6ef=0xce;}_0x1a6d66[_0xc693('0x1a')](_0x15f6ef);return _0x1a6d66[_0xc693('0x21')](_0xc693('0x22'),_0x4406b0+'-'+_0x42c06+'/'+_0xbd787e)[_0xc693('0x1c')](_0xfeeae9);}return null;};}function patchUpdates(_0x19cc20){return function(_0x51555f){try{jsonpatch[_0xc693('0x23')](_0x51555f,_0x19cc20,!![]);}catch(_0x4145e4){return BPromise[_0xc693('0x24')](_0x4145e4);}return _0x51555f[_0xc693('0x25')]();};}function saveUpdates(_0x5c6fba,_0x359e2b){return function(_0x6f2f93){if(_0x6f2f93){return _0x6f2f93['update'](_0x5c6fba)[_0xc693('0x26')](function(_0x14dee2){return _0x14dee2;});}return null;};}function removeEntity(_0x53e283,_0x14fa5b){return function(_0x298876){if(_0x298876){return _0x298876[_0xc693('0x27')]()[_0xc693('0x26')](function(){_0x53e283['status'](0xcc)[_0xc693('0x1b')]();});}};}function handleEntityNotFound(_0xee0c16,_0x5bbfe3){return function(_0x1a9165){if(!_0x1a9165){_0xee0c16[_0xc693('0x19')](0x194);}return _0x1a9165;};}function handleError(_0x597ee7,_0x216192){_0x216192=_0x216192||0x1f4;return function(_0x223a5f){logger[_0xc693('0x28')](_0x223a5f[_0xc693('0x29')]);if(_0x223a5f[_0xc693('0x2a')]){delete _0x223a5f[_0xc693('0x2a')];}_0x597ee7[_0xc693('0x1a')](_0x216192)['send'](_0x223a5f);};}exports['index']=function(_0x4b4d95,_0x517ae9){var _0x504559={},_0x27f3f9={},_0x177486={'count':0x0,'rows':[]};var _0x4d5488=_['map'](db[_0xc693('0x2b')]['rawAttributes'],function(_0x750ff3){return{'name':_0x750ff3[_0xc693('0x2c')],'type':_0x750ff3['type'][_0xc693('0x2d')]};});_0x27f3f9[_0xc693('0x2e')]=_[_0xc693('0x2f')](_0x4d5488,_0xc693('0x2a'));_0x27f3f9[_0xc693('0x30')]=_[_0xc693('0x31')](_0x4b4d95[_0xc693('0x30')]);_0x27f3f9[_0xc693('0x32')]=_['intersection'](_0x27f3f9['model'],_0x27f3f9[_0xc693('0x30')]);_0x504559['attributes']=_[_0xc693('0x33')](_0x27f3f9[_0xc693('0x2e')],qs['fields'](_0x4b4d95[_0xc693('0x30')][_0xc693('0x34')]));_0x504559[_0xc693('0x35')]=_0x504559[_0xc693('0x35')]['length']?_0x504559[_0xc693('0x35')]:_0x27f3f9[_0xc693('0x2e')];if(!_0x4b4d95[_0xc693('0x30')][_0xc693('0x36')]('nolimit')){_0x504559[_0xc693('0x1e')]=qs[_0xc693('0x1e')](_0x4b4d95[_0xc693('0x30')][_0xc693('0x1e')]);_0x504559[_0xc693('0x20')]=qs[_0xc693('0x20')](_0x4b4d95['query'][_0xc693('0x20')]);}_0x504559[_0xc693('0x37')]=qs[_0xc693('0x38')](_0x4b4d95[_0xc693('0x30')]['sort']);_0x504559[_0xc693('0x39')]=qs[_0xc693('0x32')](_['pick'](_0x4b4d95[_0xc693('0x30')],_0x27f3f9['filters']),_0x4d5488);if(_0x4b4d95[_0xc693('0x30')][_0xc693('0x3a')]){_0x504559[_0xc693('0x39')]=_['merge'](_0x504559[_0xc693('0x39')],{'$or':_['map'](_0x4d5488,function(_0x4dc34a){if(_0x4dc34a[_0xc693('0x3b')]!==_0xc693('0x3c')){var _0x559de7={};_0x559de7[_0x4dc34a[_0xc693('0x2a')]]={'$like':'%'+_0x4b4d95['query']['filter']+'%'};return _0x559de7;}})});}_0x504559=_[_0xc693('0x3d')]({},_0x504559,_0x4b4d95[_0xc693('0x3e')]);var _0x3975b9={'where':_0x504559['where']};return db[_0xc693('0x2b')][_0xc693('0x1f')](_0x3975b9)[_0xc693('0x26')](function(_0x1e201c){_0x177486[_0xc693('0x1f')]=_0x1e201c;if(_0x4b4d95[_0xc693('0x30')][_0xc693('0x3f')]){_0x504559[_0xc693('0x40')]=[{'all':!![]}];}return db[_0xc693('0x2b')][_0xc693('0x41')](_0x504559);})[_0xc693('0x26')](function(_0x34559e){_0x177486[_0xc693('0x42')]=_0x34559e;return _0x177486;})[_0xc693('0x26')](respondWithFilteredResult(_0x517ae9,_0x504559))[_0xc693('0x43')](handleError(_0x517ae9,null));};exports[_0xc693('0x44')]=function(_0x5f92b0,_0x21e5d2){var _0x54fc17={'raw':![],'where':{'id':_0x5f92b0[_0xc693('0x45')]['id']}},_0x164f56={};_0x164f56['model']=_[_0xc693('0x31')](db['FreshsalesConfiguration'][_0xc693('0x46')]);_0x164f56['query']=_[_0xc693('0x31')](_0x5f92b0['query']);_0x164f56[_0xc693('0x32')]=_[_0xc693('0x33')](_0x164f56['model'],_0x164f56[_0xc693('0x30')]);_0x54fc17[_0xc693('0x35')]=_[_0xc693('0x33')](_0x164f56['model'],qs[_0xc693('0x34')](_0x5f92b0['query'][_0xc693('0x34')]));_0x54fc17[_0xc693('0x35')]=_0x54fc17[_0xc693('0x35')][_0xc693('0x47')]?_0x54fc17[_0xc693('0x35')]:_0x164f56[_0xc693('0x2e')];if(_0x5f92b0['query'][_0xc693('0x3f')]){_0x54fc17[_0xc693('0x40')]=[{'all':!![]}];}_0x54fc17=_[_0xc693('0x3d')]({},_0x54fc17,_0x5f92b0['options']);return db[_0xc693('0x2b')][_0xc693('0x48')](_0x54fc17)[_0xc693('0x26')](handleEntityNotFound(_0x21e5d2,null))[_0xc693('0x26')](respondWithResult(_0x21e5d2,null))[_0xc693('0x43')](handleError(_0x21e5d2,null));};exports[_0xc693('0x49')]=function(_0x20a85d,_0x1d37d1){return db[_0xc693('0x2b')]['create'](_0x20a85d[_0xc693('0x4a')],{})[_0xc693('0x26')](respondWithResult(_0x1d37d1,0xc9))[_0xc693('0x43')](handleError(_0x1d37d1,null));};exports['update']=function(_0x1e9cee,_0x3a6311){if(_0x1e9cee['body']['id']){delete _0x1e9cee['body']['id'];}return db[_0xc693('0x2b')][_0xc693('0x48')]({'where':{'id':_0x1e9cee[_0xc693('0x45')]['id']}})[_0xc693('0x26')](handleEntityNotFound(_0x3a6311,null))[_0xc693('0x26')](saveUpdates(_0x1e9cee[_0xc693('0x4a')],null))[_0xc693('0x26')](respondWithResult(_0x3a6311,null))[_0xc693('0x43')](handleError(_0x3a6311,null));};exports[_0xc693('0x27')]=function(_0x53f06b,_0x272778){return db[_0xc693('0x2b')]['find']({'where':{'id':_0x53f06b[_0xc693('0x45')]['id']}})['then'](handleEntityNotFound(_0x272778,null))[_0xc693('0x26')](removeEntity(_0x272778,null))[_0xc693('0x43')](handleError(_0x272778,null));};exports[_0xc693('0x4b')]=function(_0x4c7c2f,_0x62515c,_0x308822){var _0x220f5f={};var _0x156928={};var _0x599ab6;var _0x2bb928;return db[_0xc693('0x2b')][_0xc693('0x4c')]({'where':{'id':_0x4c7c2f[_0xc693('0x45')]['id']}})[_0xc693('0x26')](handleEntityNotFound(_0x62515c,null))[_0xc693('0x26')](function(_0x3ab230){if(_0x3ab230){_0x599ab6=_0x3ab230;_0x156928[_0xc693('0x2e')]=_[_0xc693('0x31')](db[_0xc693('0x4d')][_0xc693('0x46')]);_0x156928[_0xc693('0x30')]=_[_0xc693('0x31')](_0x4c7c2f['query']);_0x156928['filters']=_[_0xc693('0x33')](_0x156928[_0xc693('0x2e')],_0x156928[_0xc693('0x30')]);_0x220f5f[_0xc693('0x35')]=_[_0xc693('0x33')](_0x156928[_0xc693('0x2e')],qs[_0xc693('0x34')](_0x4c7c2f[_0xc693('0x30')][_0xc693('0x34')]));_0x220f5f['attributes']=_0x220f5f['attributes'][_0xc693('0x47')]?_0x220f5f[_0xc693('0x35')]:_0x156928['model'];_0x220f5f[_0xc693('0x37')]=qs['sort'](_0x4c7c2f[_0xc693('0x30')][_0xc693('0x38')]);_0x220f5f[_0xc693('0x39')]=qs['filters'](_[_0xc693('0x4e')](_0x4c7c2f[_0xc693('0x30')],_0x156928[_0xc693('0x32')]));if(_0x4c7c2f[_0xc693('0x30')][_0xc693('0x3a')]){_0x220f5f[_0xc693('0x39')]=_[_0xc693('0x3d')](_0x220f5f[_0xc693('0x39')],{'$or':_[_0xc693('0x2f')](_0x220f5f[_0xc693('0x35')],function(_0x12a090){var _0x40c146={};_0x40c146[_0x12a090]={'$like':'%'+_0x4c7c2f[_0xc693('0x30')][_0xc693('0x3a')]+'%'};return _0x40c146;})});}_0x220f5f=_[_0xc693('0x3d')]({},_0x220f5f,_0x4c7c2f[_0xc693('0x3e')]);return _0x599ab6['getSubjects'](_0x220f5f);}})[_0xc693('0x26')](function(_0x5cfbb2){if(_0x5cfbb2){_0x2bb928=_0x5cfbb2['length'];if(!_0x4c7c2f[_0xc693('0x30')]['hasOwnProperty'](_0xc693('0x4f'))){_0x220f5f[_0xc693('0x1e')]=qs[_0xc693('0x1e')](_0x4c7c2f[_0xc693('0x30')][_0xc693('0x1e')]);_0x220f5f[_0xc693('0x20')]=qs['offset'](_0x4c7c2f[_0xc693('0x30')][_0xc693('0x20')]);}return _0x599ab6[_0xc693('0x4b')](_0x220f5f);}})['then'](function(_0x28ea67){if(_0x28ea67){return _0x28ea67?{'count':_0x2bb928,'rows':_0x28ea67}:null;}})['then'](respondWithResult(_0x62515c,null))[_0xc693('0x43')](handleError(_0x62515c,null));};exports[_0xc693('0x50')]=function(_0x1ed205,_0xda0116,_0x113228){var _0x2af60f={};var _0x26b35e={};var _0x424a8b;var _0x46591a;return db[_0xc693('0x2b')][_0xc693('0x4c')]({'where':{'id':_0x1ed205[_0xc693('0x45')]['id']}})[_0xc693('0x26')](handleEntityNotFound(_0xda0116,null))[_0xc693('0x26')](function(_0x5dc0d8){if(_0x5dc0d8){_0x424a8b=_0x5dc0d8;_0x26b35e[_0xc693('0x2e')]=_['keys'](db[_0xc693('0x4d')][_0xc693('0x46')]);_0x26b35e[_0xc693('0x30')]=_[_0xc693('0x31')](_0x1ed205[_0xc693('0x30')]);_0x26b35e['filters']=_[_0xc693('0x33')](_0x26b35e[_0xc693('0x2e')],_0x26b35e[_0xc693('0x30')]);_0x2af60f['attributes']=_[_0xc693('0x33')](_0x26b35e['model'],qs[_0xc693('0x34')](_0x1ed205[_0xc693('0x30')][_0xc693('0x34')]));_0x2af60f[_0xc693('0x35')]=_0x2af60f[_0xc693('0x35')][_0xc693('0x47')]?_0x2af60f[_0xc693('0x35')]:_0x26b35e[_0xc693('0x2e')];_0x2af60f[_0xc693('0x37')]=qs[_0xc693('0x38')](_0x1ed205['query'][_0xc693('0x38')]);_0x2af60f[_0xc693('0x39')]=qs[_0xc693('0x32')](_['pick'](_0x1ed205[_0xc693('0x30')],_0x26b35e[_0xc693('0x32')]));if(_0x1ed205[_0xc693('0x30')]['filter']){_0x2af60f[_0xc693('0x39')]=_[_0xc693('0x3d')](_0x2af60f[_0xc693('0x39')],{'$or':_[_0xc693('0x2f')](_0x2af60f[_0xc693('0x35')],function(_0x39ba50){var _0x2924c3={};_0x2924c3[_0x39ba50]={'$like':'%'+_0x1ed205[_0xc693('0x30')][_0xc693('0x3a')]+'%'};return _0x2924c3;})});}_0x2af60f=_['merge']({},_0x2af60f,_0x1ed205[_0xc693('0x3e')]);return _0x424a8b[_0xc693('0x50')](_0x2af60f);}})[_0xc693('0x26')](function(_0x15a156){if(_0x15a156){_0x46591a=_0x15a156[_0xc693('0x47')];if(!_0x1ed205[_0xc693('0x30')][_0xc693('0x36')](_0xc693('0x4f'))){_0x2af60f['limit']=qs[_0xc693('0x1e')](_0x1ed205[_0xc693('0x30')]['limit']);_0x2af60f[_0xc693('0x20')]=qs[_0xc693('0x20')](_0x1ed205[_0xc693('0x30')][_0xc693('0x20')]);}return _0x424a8b[_0xc693('0x50')](_0x2af60f);}})[_0xc693('0x26')](function(_0x12838b){if(_0x12838b){return _0x12838b?{'count':_0x46591a,'rows':_0x12838b}:null;}})[_0xc693('0x26')](respondWithResult(_0xda0116,null))['catch'](handleError(_0xda0116,null));};exports[_0xc693('0x51')]=function(_0x5b2225,_0x1419d1,_0x5e0c8d){var _0x459a7e={};var _0xc6a743={};var _0x1ba181;var _0x2bd85d;return db[_0xc693('0x2b')][_0xc693('0x4c')]({'where':{'id':_0x5b2225['params']['id']}})[_0xc693('0x26')](handleEntityNotFound(_0x1419d1,null))[_0xc693('0x26')](function(_0x177cf8){if(_0x177cf8){_0x1ba181=_0x177cf8;_0xc6a743[_0xc693('0x2e')]=_[_0xc693('0x31')](db['FreshsalesField'][_0xc693('0x46')]);_0xc6a743[_0xc693('0x30')]=_[_0xc693('0x31')](_0x5b2225[_0xc693('0x30')]);_0xc6a743[_0xc693('0x32')]=_['intersection'](_0xc6a743[_0xc693('0x2e')],_0xc6a743[_0xc693('0x30')]);_0x459a7e['attributes']=_[_0xc693('0x33')](_0xc6a743[_0xc693('0x2e')],qs[_0xc693('0x34')](_0x5b2225[_0xc693('0x30')][_0xc693('0x34')]));_0x459a7e['attributes']=_0x459a7e[_0xc693('0x35')][_0xc693('0x47')]?_0x459a7e[_0xc693('0x35')]:_0xc6a743['model'];_0x459a7e[_0xc693('0x37')]=qs[_0xc693('0x38')](_0x5b2225[_0xc693('0x30')]['sort']);_0x459a7e[_0xc693('0x39')]=qs[_0xc693('0x32')](_[_0xc693('0x4e')](_0x5b2225[_0xc693('0x30')],_0xc6a743['filters']));if(_0x5b2225[_0xc693('0x30')]['filter']){_0x459a7e[_0xc693('0x39')]=_[_0xc693('0x3d')](_0x459a7e['where'],{'$or':_[_0xc693('0x2f')](_0x459a7e[_0xc693('0x35')],function(_0x406106){var _0x4cab64={};_0x4cab64[_0x406106]={'$like':'%'+_0x5b2225['query'][_0xc693('0x3a')]+'%'};return _0x4cab64;})});}_0x459a7e=_['merge']({},_0x459a7e,_0x5b2225[_0xc693('0x3e')]);return _0x1ba181[_0xc693('0x51')](_0x459a7e);}})[_0xc693('0x26')](function(_0x5ef404){if(_0x5ef404){_0x2bd85d=_0x5ef404['length'];if(!_0x5b2225['query'][_0xc693('0x36')](_0xc693('0x4f'))){_0x459a7e['limit']=qs[_0xc693('0x1e')](_0x5b2225[_0xc693('0x30')]['limit']);_0x459a7e[_0xc693('0x20')]=qs[_0xc693('0x20')](_0x5b2225[_0xc693('0x30')][_0xc693('0x20')]);}return _0x1ba181[_0xc693('0x51')](_0x459a7e);}})[_0xc693('0x26')](function(_0x441765){if(_0x441765){return _0x441765?{'count':_0x2bd85d,'rows':_0x441765}:null;}})[_0xc693('0x26')](respondWithResult(_0x1419d1,null))['catch'](handleError(_0x1419d1,null));}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js index 1c28618..c28aa87 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 _0x56a6=['./intFreshsalesConfiguration.attributes','exports','define','FreshsalesConfiguration','int_freshsales_configurations','lodash','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x44268d,_0xad8443){var _0x4be92d=function(_0x8a57ff){while(--_0x8a57ff){_0x44268d['push'](_0x44268d['shift']());}};_0x4be92d(++_0xad8443);}(_0x56a6,0x171));var _0x656a=function(_0x2b352e,_0x14076f){_0x2b352e=_0x2b352e-0x0;var _0x4610d7=_0x56a6[_0x2b352e];return _0x4610d7;};'use strict';var _=require(_0x656a('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x656a('0x1'));var moment=require(_0x656a('0x2'));var BPromise=require(_0x656a('0x3'));var rp=require(_0x656a('0x4'));var fs=require('fs');var path=require(_0x656a('0x5'));var rimraf=require(_0x656a('0x6'));var config=require(_0x656a('0x7'));var attributes=require(_0x656a('0x8'));module[_0x656a('0x9')]=function(_0xa990d4,_0x3ab9f4){return _0xa990d4[_0x656a('0xa')](_0x656a('0xb'),attributes,{'tableName':_0x656a('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xdd8d=['bluebird','request-promise','path','rimraf','./intFreshsalesConfiguration.attributes','exports','define','lodash','util','../../config/logger','api'];(function(_0x537ef5,_0x440d81){var _0x33dcaa=function(_0x572d9e){while(--_0x572d9e){_0x537ef5['push'](_0x537ef5['shift']());}};_0x33dcaa(++_0x440d81);}(_0xdd8d,0x10f));var _0xddd8=function(_0x1c1820,_0x18bb79){_0x1c1820=_0x1c1820-0x0;var _0x6690e6=_0xdd8d[_0x1c1820];return _0x6690e6;};'use strict';var _=require(_0xddd8('0x0'));var util=require(_0xddd8('0x1'));var logger=require(_0xddd8('0x2'))(_0xddd8('0x3'));var moment=require('moment');var BPromise=require(_0xddd8('0x4'));var rp=require(_0xddd8('0x5'));var fs=require('fs');var path=require(_0xddd8('0x6'));var rimraf=require(_0xddd8('0x7'));var config=require('../../config/environment');var attributes=require(_0xddd8('0x8'));module[_0xddd8('0x9')]=function(_0x3c3850,_0x2b5fd8){return _0x3c3850[_0xddd8('0xa')]('FreshsalesConfiguration',attributes,{'tableName':'int_freshsales_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.rpc.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.rpc.js index 023377d..a2a7130 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 _0x874c=['client','http','request','then','FreshsalesConfiguration,\x20%s,\x20%s','debug','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','info','request\x20sent','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise'];(function(_0x28b877,_0x186ce7){var _0x16fd7d=function(_0x27a9b0){while(--_0x27a9b0){_0x28b877['push'](_0x28b877['shift']());}};_0x16fd7d(++_0x186ce7);}(_0x874c,0x12d));var _0xc874=function(_0x363a34,_0x280362){_0x363a34=_0x363a34-0x0;var _0x38f78d=_0x874c[_0x363a34];return _0x38f78d;};'use strict';var _=require(_0xc874('0x0'));var util=require(_0xc874('0x1'));var moment=require(_0xc874('0x2'));var BPromise=require(_0xc874('0x3'));var rs=require(_0xc874('0x4'));var fs=require('fs');var Redis=require(_0xc874('0x5'));var db=require(_0xc874('0x6'))['db'];var utils=require(_0xc874('0x7'));var logger=require(_0xc874('0x8'))('rpc');var config=require(_0xc874('0x9'));var jayson=require(_0xc874('0xa'));var client=jayson[_0xc874('0xb')][_0xc874('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x16cefa,_0x2b7911,_0x25c320){return new BPromise(function(_0x456fc7,_0x2c4699){return client[_0xc874('0xd')](_0x16cefa,_0x25c320)[_0xc874('0xe')](function(_0x24fb2f){logger['info'](_0xc874('0xf'),_0x2b7911,'request\x20sent');logger[_0xc874('0x10')](_0xc874('0x11'),_0x2b7911,'request\x20sent',JSON[_0xc874('0x12')](_0x24fb2f));if(_0x24fb2f[_0xc874('0x13')]){if(_0x24fb2f[_0xc874('0x13')]['code']===0x1f4){logger[_0xc874('0x13')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x2b7911,_0x24fb2f[_0xc874('0x13')][_0xc874('0x14')]);return _0x2c4699(_0x24fb2f['error'][_0xc874('0x14')]);}logger[_0xc874('0x13')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x2b7911,_0x24fb2f['error'][_0xc874('0x14')]);return _0x456fc7(_0x24fb2f[_0xc874('0x13')][_0xc874('0x14')]);}else{logger[_0xc874('0x15')](_0xc874('0xf'),_0x2b7911,_0xc874('0x16'));_0x456fc7(_0x24fb2f['result'][_0xc874('0x14')]);}})[_0xc874('0x17')](function(_0x57675d){logger[_0xc874('0x13')](_0xc874('0xf'),_0x2b7911,_0x57675d);_0x2c4699(_0x57675d);});});} \ No newline at end of file +var _0xa905=['request\x20sent','debug','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','jayson/promise','http','request','info','FreshsalesConfiguration,\x20%s,\x20%s'];(function(_0x28cbc0,_0x203516){var _0x4b3cf5=function(_0x2a15c6){while(--_0x2a15c6){_0x28cbc0['push'](_0x28cbc0['shift']());}};_0x4b3cf5(++_0x203516);}(_0xa905,0x1cf));var _0x5a90=function(_0x1b558b,_0x82f953){_0x1b558b=_0x1b558b-0x0;var _0x54ce8d=_0xa905[_0x1b558b];return _0x54ce8d;};'use strict';var _=require(_0x5a90('0x0'));var util=require('util');var moment=require(_0x5a90('0x1'));var BPromise=require(_0x5a90('0x2'));var rs=require(_0x5a90('0x3'));var fs=require('fs');var Redis=require(_0x5a90('0x4'));var db=require(_0x5a90('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x5a90('0x6'));var config=require('../../config/environment');var jayson=require(_0x5a90('0x7'));var client=jayson['client'][_0x5a90('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1b8db6,_0x1b3f79,_0x4a4b65){return new BPromise(function(_0x46a78e,_0x9a929e){return client[_0x5a90('0x9')](_0x1b8db6,_0x4a4b65)['then'](function(_0x26532c){logger[_0x5a90('0xa')](_0x5a90('0xb'),_0x1b3f79,_0x5a90('0xc'));logger[_0x5a90('0xd')]('FreshsalesConfiguration,\x20%s,\x20%s,\x20%s',_0x1b3f79,_0x5a90('0xc'),JSON['stringify'](_0x26532c));if(_0x26532c['error']){if(_0x26532c[_0x5a90('0xe')][_0x5a90('0xf')]===0x1f4){logger[_0x5a90('0xe')](_0x5a90('0xb'),_0x1b3f79,_0x26532c['error'][_0x5a90('0x10')]);return _0x9a929e(_0x26532c[_0x5a90('0xe')][_0x5a90('0x10')]);}logger['error'](_0x5a90('0xb'),_0x1b3f79,_0x26532c[_0x5a90('0xe')][_0x5a90('0x10')]);return _0x46a78e(_0x26532c[_0x5a90('0xe')][_0x5a90('0x10')]);}else{logger[_0x5a90('0xa')](_0x5a90('0xb'),_0x1b3f79,_0x5a90('0xc'));_0x46a78e(_0x26532c[_0x5a90('0x11')][_0x5a90('0x10')]);}})[_0x5a90('0x12')](function(_0xb64165){logger[_0x5a90('0xe')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x1b3f79,_0xb64165);_0x9a929e(_0xb64165);});});} \ No newline at end of file diff --git a/server/api/intFreshsalesField/index.js b/server/api/intFreshsalesField/index.js index 7e77305..fd7589a 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 _0x25ad=['get','/:id','show','post','isAuthenticated','create','put','delete','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshsalesField.controller'];(function(_0x5bd426,_0x4878e5){var _0x23a7eb=function(_0x594b42){while(--_0x594b42){_0x5bd426['push'](_0x5bd426['shift']());}};_0x23a7eb(++_0x4878e5);}(_0x25ad,0x1b1));var _0xd25a=function(_0x17e411,_0x56449d){_0x17e411=_0x17e411-0x0;var _0x30b83d=_0x25ad[_0x17e411];return _0x30b83d;};'use strict';var multer=require(_0xd25a('0x0'));var util=require('util');var path=require(_0xd25a('0x1'));var timeout=require(_0xd25a('0x2'));var express=require(_0xd25a('0x3'));var router=express['Router']();var fs_extra=require(_0xd25a('0x4'));var auth=require(_0xd25a('0x5'));var interaction=require(_0xd25a('0x6'));var config=require(_0xd25a('0x7'));var controller=require(_0xd25a('0x8'));router[_0xd25a('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0xd25a('0x9')](_0xd25a('0xa'),auth['isAuthenticated'](),controller[_0xd25a('0xb')]);router[_0xd25a('0xc')]('/',auth[_0xd25a('0xd')](),controller[_0xd25a('0xe')]);router[_0xd25a('0xf')](_0xd25a('0xa'),auth[_0xd25a('0xd')](),controller['update']);router[_0xd25a('0x10')]('/:id',auth[_0xd25a('0xd')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xa1fd=['create','put','delete','destroy','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','post'];(function(_0x2698a3,_0x2f2e2d){var _0x32fd1b=function(_0x341d95){while(--_0x341d95){_0x2698a3['push'](_0x2698a3['shift']());}};_0x32fd1b(++_0x2f2e2d);}(_0xa1fd,0x1b9));var _0xda1f=function(_0xf30651,_0x964c8){_0xf30651=_0xf30651-0x0;var _0x5382a0=_0xa1fd[_0xf30651];return _0x5382a0;};'use strict';var multer=require(_0xda1f('0x0'));var util=require(_0xda1f('0x1'));var path=require(_0xda1f('0x2'));var timeout=require(_0xda1f('0x3'));var express=require('express');var router=express[_0xda1f('0x4')]();var fs_extra=require(_0xda1f('0x5'));var auth=require(_0xda1f('0x6'));var interaction=require(_0xda1f('0x7'));var config=require(_0xda1f('0x8'));var controller=require('./intFreshsalesField.controller');router[_0xda1f('0x9')]('/',auth[_0xda1f('0xa')](),controller[_0xda1f('0xb')]);router['get'](_0xda1f('0xc'),auth[_0xda1f('0xa')](),controller[_0xda1f('0xd')]);router[_0xda1f('0xe')]('/',auth[_0xda1f('0xa')](),controller[_0xda1f('0xf')]);router[_0xda1f('0x10')](_0xda1f('0xc'),auth[_0xda1f('0xa')](),controller['update']);router[_0xda1f('0x11')](_0xda1f('0xc'),auth[_0xda1f('0xa')](),controller[_0xda1f('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.attributes.js b/server/api/intFreshsalesField/intFreshsalesField.attributes.js index 6cb5a77..6ba83c8 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 _0xca1d=['keyValue','picklist','STRING','BOOLEAN','sequelize','ENUM','string','variable','customVariable'];(function(_0x264f53,_0x33db5f){var _0x490668=function(_0xc3a7d4){while(--_0xc3a7d4){_0x264f53['push'](_0x264f53['shift']());}};_0x490668(++_0x33db5f);}(_0xca1d,0x94));var _0xdca1=function(_0x50c81b,_0x369f5f){_0x50c81b=_0x50c81b-0x0;var _0x5312b0=_0xca1d[_0x50c81b];return _0x5312b0;};'use strict';var Sequelize=require(_0xdca1('0x0'));module['exports']={'type':{'type':Sequelize[_0xdca1('0x1')](_0xdca1('0x2'),_0xdca1('0x3'),_0xdca1('0x4'),_0xdca1('0x5'),_0xdca1('0x6')),'defaultValue':'string'},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0xdca1('0x7')]},'keyType':{'type':Sequelize[_0xdca1('0x1')](_0xdca1('0x2'),_0xdca1('0x3'),_0xdca1('0x4'))},'keyContent':{'type':Sequelize[_0xdca1('0x7')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0xdca1('0x7')]},'customField':{'type':Sequelize[_0xdca1('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x68c0=['sequelize','exports','customVariable','string','STRING','ENUM','variable','BOOLEAN'];(function(_0x35cc4e,_0xd4671c){var _0xa6c15e=function(_0x53dff2){while(--_0x53dff2){_0x35cc4e['push'](_0x35cc4e['shift']());}};_0xa6c15e(++_0xd4671c);}(_0x68c0,0x98));var _0x068c=function(_0x43a1bf,_0xa35554){_0x43a1bf=_0x43a1bf-0x0;var _0x153633=_0x68c0[_0x43a1bf];return _0x153633;};'use strict';var Sequelize=require(_0x068c('0x0'));module[_0x068c('0x1')]={'type':{'type':Sequelize['ENUM']('string','variable',_0x068c('0x2'),'keyValue','picklist'),'defaultValue':_0x068c('0x3')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x068c('0x4')]},'keyType':{'type':Sequelize[_0x068c('0x5')](_0x068c('0x3'),_0x068c('0x6'),_0x068c('0x2'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x068c('0x4')]},'customField':{'type':Sequelize[_0x068c('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x068c('0x4')]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.controller.js b/server/api/intFreshsalesField/intFreshsalesField.controller.js index 89b91cc..9fb2bf0 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 _0x6835=['where','filter','merge','VIRTUAL','options','FreshsalesField','count','include','findAll','catch','show','params','includeAll','find','create','body','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','sendStatus','status','end','offset','limit','undefined','set','json','apply','reject','update','then','destroy','error','stack','name','index','map','rawAttributes','fieldName','type','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort'];(function(_0x5bbef4,_0x3c1593){var _0x1a95f6=function(_0x41b594){while(--_0x41b594){_0x5bbef4['push'](_0x5bbef4['shift']());}};_0x1a95f6(++_0x3c1593);}(_0x6835,0x12c));var _0x5683=function(_0x386d3e,_0x20991c){_0x386d3e=_0x386d3e-0x0;var _0x18d553=_0x6835[_0x386d3e];return _0x18d553;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5683('0x0'));var zipdir=require(_0x5683('0x1'));var jsonpatch=require(_0x5683('0x2'));var rp=require(_0x5683('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x5683('0x4'));var util=require(_0x5683('0x5'));var path=require('path');var sox=require(_0x5683('0x6'));var csv=require(_0x5683('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5683('0x8'));var _=require('lodash');var squel=require(_0x5683('0x9'));var crypto=require(_0x5683('0xa'));var jsforce=require(_0x5683('0xb'));var deskjs=require(_0x5683('0xc'));var toCsv=require(_0x5683('0x7'));var querystring=require(_0x5683('0xd'));var Papa=require(_0x5683('0xe'));var Redis=require(_0x5683('0xf'));var authService=require(_0x5683('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x5683('0x11'));var hardwareService=require(_0x5683('0x12'));var logger=require(_0x5683('0x13'))('api');var utils=require('../../config/utils');var config=require(_0x5683('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x5683('0x15'))['db'];function respondWithStatusCode(_0x321ab0,_0x2767be){_0x2767be=_0x2767be||0xcc;return function(_0x3eb054){if(_0x3eb054){return _0x321ab0[_0x5683('0x16')](_0x2767be);}return _0x321ab0[_0x5683('0x17')](_0x2767be)[_0x5683('0x18')]();};}function respondWithResult(_0x50080a,_0x43ed6d){_0x43ed6d=_0x43ed6d||0xc8;return function(_0x4cb436){if(_0x4cb436){return _0x50080a[_0x5683('0x17')](_0x43ed6d)['json'](_0x4cb436);}};}function respondWithFilteredResult(_0x5768b7,_0x189456){return function(_0x3098c3){if(_0x3098c3){var _0x1396e1=typeof _0x189456[_0x5683('0x19')]==='undefined'&&typeof _0x189456[_0x5683('0x1a')]===_0x5683('0x1b');var _0x42f101=_0x3098c3['count'];var _0x1b2928=_0x1396e1?0x0:_0x189456[_0x5683('0x19')];var _0x2b6a7d=_0x1396e1?_0x3098c3['count']:_0x189456[_0x5683('0x19')]+_0x189456[_0x5683('0x1a')];var _0x33948;if(_0x2b6a7d>=_0x42f101){_0x2b6a7d=_0x42f101;_0x33948=0xc8;}else{_0x33948=0xce;}_0x5768b7[_0x5683('0x17')](_0x33948);return _0x5768b7[_0x5683('0x1c')]('Content-Range',_0x1b2928+'-'+_0x2b6a7d+'/'+_0x42f101)[_0x5683('0x1d')](_0x3098c3);}return null;};}function patchUpdates(_0x53a8a9){return function(_0x2ac579){try{jsonpatch[_0x5683('0x1e')](_0x2ac579,_0x53a8a9,!![]);}catch(_0x2cd73b){return BPromise[_0x5683('0x1f')](_0x2cd73b);}return _0x2ac579['save']();};}function saveUpdates(_0x2a28ee,_0x45c3c6){return function(_0x1debe3){if(_0x1debe3){return _0x1debe3[_0x5683('0x20')](_0x2a28ee)[_0x5683('0x21')](function(_0x346dc5){return _0x346dc5;});}return null;};}function removeEntity(_0x25a6bd,_0xe6ba64){return function(_0x2ee816){if(_0x2ee816){return _0x2ee816[_0x5683('0x22')]()[_0x5683('0x21')](function(){_0x25a6bd[_0x5683('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x356a49,_0x443f1d){return function(_0x4277e7){if(!_0x4277e7){_0x356a49['sendStatus'](0x194);}return _0x4277e7;};}function handleError(_0x4b1f3f,_0x11a19f){_0x11a19f=_0x11a19f||0x1f4;return function(_0x1b18d0){logger[_0x5683('0x23')](_0x1b18d0[_0x5683('0x24')]);if(_0x1b18d0[_0x5683('0x25')]){delete _0x1b18d0[_0x5683('0x25')];}_0x4b1f3f[_0x5683('0x17')](_0x11a19f)['send'](_0x1b18d0);};}exports[_0x5683('0x26')]=function(_0x4dd5fa,_0xea80ba){var _0x408cc5={},_0xb3aa6d={},_0x3edddc={'count':0x0,'rows':[]};var _0x2d6de7=_[_0x5683('0x27')](db['FreshsalesField'][_0x5683('0x28')],function(_0x40b763){return{'name':_0x40b763[_0x5683('0x29')],'type':_0x40b763[_0x5683('0x2a')]['key']};});_0xb3aa6d[_0x5683('0x2b')]=_[_0x5683('0x27')](_0x2d6de7,_0x5683('0x25'));_0xb3aa6d['query']=_[_0x5683('0x2c')](_0x4dd5fa[_0x5683('0x2d')]);_0xb3aa6d[_0x5683('0x2e')]=_[_0x5683('0x2f')](_0xb3aa6d[_0x5683('0x2b')],_0xb3aa6d[_0x5683('0x2d')]);_0x408cc5[_0x5683('0x30')]=_[_0x5683('0x2f')](_0xb3aa6d[_0x5683('0x2b')],qs[_0x5683('0x31')](_0x4dd5fa[_0x5683('0x2d')]['fields']));_0x408cc5[_0x5683('0x30')]=_0x408cc5['attributes'][_0x5683('0x32')]?_0x408cc5[_0x5683('0x30')]:_0xb3aa6d[_0x5683('0x2b')];if(!_0x4dd5fa[_0x5683('0x2d')][_0x5683('0x33')](_0x5683('0x34'))){_0x408cc5[_0x5683('0x1a')]=qs['limit'](_0x4dd5fa['query'][_0x5683('0x1a')]);_0x408cc5[_0x5683('0x19')]=qs[_0x5683('0x19')](_0x4dd5fa[_0x5683('0x2d')][_0x5683('0x19')]);}_0x408cc5[_0x5683('0x35')]=qs[_0x5683('0x36')](_0x4dd5fa[_0x5683('0x2d')][_0x5683('0x36')]);_0x408cc5[_0x5683('0x37')]=qs['filters'](_['pick'](_0x4dd5fa[_0x5683('0x2d')],_0xb3aa6d[_0x5683('0x2e')]),_0x2d6de7);if(_0x4dd5fa[_0x5683('0x2d')][_0x5683('0x38')]){_0x408cc5[_0x5683('0x37')]=_[_0x5683('0x39')](_0x408cc5[_0x5683('0x37')],{'$or':_[_0x5683('0x27')](_0x2d6de7,function(_0x17cd2b){if(_0x17cd2b[_0x5683('0x2a')]!==_0x5683('0x3a')){var _0x3df284={};_0x3df284[_0x17cd2b[_0x5683('0x25')]]={'$like':'%'+_0x4dd5fa[_0x5683('0x2d')][_0x5683('0x38')]+'%'};return _0x3df284;}})});}_0x408cc5=_[_0x5683('0x39')]({},_0x408cc5,_0x4dd5fa[_0x5683('0x3b')]);var _0x598e51={'where':_0x408cc5[_0x5683('0x37')]};return db[_0x5683('0x3c')]['count'](_0x598e51)[_0x5683('0x21')](function(_0x22d0d0){_0x3edddc[_0x5683('0x3d')]=_0x22d0d0;if(_0x4dd5fa[_0x5683('0x2d')]['includeAll']){_0x408cc5[_0x5683('0x3e')]=[{'all':!![]}];}return db[_0x5683('0x3c')][_0x5683('0x3f')](_0x408cc5);})[_0x5683('0x21')](function(_0x7fd87e){_0x3edddc['rows']=_0x7fd87e;return _0x3edddc;})[_0x5683('0x21')](respondWithFilteredResult(_0xea80ba,_0x408cc5))[_0x5683('0x40')](handleError(_0xea80ba,null));};exports[_0x5683('0x41')]=function(_0x5b7288,_0x2c3c23){var _0x9c1c63={'raw':!![],'where':{'id':_0x5b7288[_0x5683('0x42')]['id']}},_0x153417={};_0x153417[_0x5683('0x2b')]=_[_0x5683('0x2c')](db[_0x5683('0x3c')][_0x5683('0x28')]);_0x153417[_0x5683('0x2d')]=_[_0x5683('0x2c')](_0x5b7288[_0x5683('0x2d')]);_0x153417[_0x5683('0x2e')]=_[_0x5683('0x2f')](_0x153417[_0x5683('0x2b')],_0x153417[_0x5683('0x2d')]);_0x9c1c63['attributes']=_[_0x5683('0x2f')](_0x153417['model'],qs[_0x5683('0x31')](_0x5b7288[_0x5683('0x2d')][_0x5683('0x31')]));_0x9c1c63['attributes']=_0x9c1c63[_0x5683('0x30')][_0x5683('0x32')]?_0x9c1c63['attributes']:_0x153417['model'];if(_0x5b7288[_0x5683('0x2d')][_0x5683('0x43')]){_0x9c1c63[_0x5683('0x3e')]=[{'all':!![]}];}_0x9c1c63=_[_0x5683('0x39')]({},_0x9c1c63,_0x5b7288[_0x5683('0x3b')]);return db['FreshsalesField'][_0x5683('0x44')](_0x9c1c63)[_0x5683('0x21')](handleEntityNotFound(_0x2c3c23,null))['then'](respondWithResult(_0x2c3c23,null))[_0x5683('0x40')](handleError(_0x2c3c23,null));};exports[_0x5683('0x45')]=function(_0x403ca8,_0x539097){return db['FreshsalesField'][_0x5683('0x45')](_0x403ca8['body'],{})[_0x5683('0x21')](respondWithResult(_0x539097,0xc9))[_0x5683('0x40')](handleError(_0x539097,null));};exports[_0x5683('0x20')]=function(_0x212c07,_0xa8ba7){if(_0x212c07['body']['id']){delete _0x212c07[_0x5683('0x46')]['id'];}return db['FreshsalesField'][_0x5683('0x44')]({'where':{'id':_0x212c07[_0x5683('0x42')]['id']}})[_0x5683('0x21')](handleEntityNotFound(_0xa8ba7,null))[_0x5683('0x21')](saveUpdates(_0x212c07[_0x5683('0x46')],null))[_0x5683('0x21')](respondWithResult(_0xa8ba7,null))['catch'](handleError(_0xa8ba7,null));};exports['destroy']=function(_0x400678,_0x2c5ca3){return db['FreshsalesField']['find']({'where':{'id':_0x400678[_0x5683('0x42')]['id']}})[_0x5683('0x21')](handleEntityNotFound(_0x2c5ca3,null))[_0x5683('0x21')](removeEntity(_0x2c5ca3,null))[_0x5683('0x40')](handleError(_0x2c5ca3,null));}; \ No newline at end of file +var _0x3fa1=['moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','save','destroy','error','stack','name','index','map','FreshsalesField','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','options','then','includeAll','include','catch','show','find','create','body','update','params','eml-format','rimraf','request-promise'];(function(_0x55ef8b,_0x5deb5e){var _0x359c84=function(_0x437673){while(--_0x437673){_0x55ef8b['push'](_0x55ef8b['shift']());}};_0x359c84(++_0x5deb5e);}(_0x3fa1,0x8b));var _0x13fa=function(_0x5d1ec8,_0x2a6044){_0x5d1ec8=_0x5d1ec8-0x0;var _0x509638=_0x3fa1[_0x5d1ec8];return _0x509638;};'use strict';var emlformat=require(_0x13fa('0x0'));var rimraf=require(_0x13fa('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x13fa('0x2'));var moment=require(_0x13fa('0x3'));var BPromise=require(_0x13fa('0x4'));var Mustache=require(_0x13fa('0x5'));var util=require(_0x13fa('0x6'));var path=require(_0x13fa('0x7'));var sox=require('sox');var csv=require(_0x13fa('0x8'));var ejs=require(_0x13fa('0x9'));var fs=require('fs');var fs_extra=require(_0x13fa('0xa'));var _=require(_0x13fa('0xb'));var squel=require('squel');var crypto=require(_0x13fa('0xc'));var jsforce=require(_0x13fa('0xd'));var deskjs=require(_0x13fa('0xe'));var toCsv=require(_0x13fa('0x8'));var querystring=require(_0x13fa('0xf'));var Papa=require(_0x13fa('0x10'));var Redis=require(_0x13fa('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x13fa('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x13fa('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0x13fa('0x14'));var config=require(_0x13fa('0x15'));var licenseUtil=require(_0x13fa('0x16'));var db=require(_0x13fa('0x17'))['db'];function respondWithStatusCode(_0x4058e7,_0x2cf26c){_0x2cf26c=_0x2cf26c||0xcc;return function(_0x2e51fd){if(_0x2e51fd){return _0x4058e7[_0x13fa('0x18')](_0x2cf26c);}return _0x4058e7[_0x13fa('0x19')](_0x2cf26c)[_0x13fa('0x1a')]();};}function respondWithResult(_0x5b9343,_0x4ddb12){_0x4ddb12=_0x4ddb12||0xc8;return function(_0x15a15e){if(_0x15a15e){return _0x5b9343[_0x13fa('0x19')](_0x4ddb12)[_0x13fa('0x1b')](_0x15a15e);}};}function respondWithFilteredResult(_0x104d63,_0x1d23f4){return function(_0x39739a){if(_0x39739a){var _0x2f5a87=typeof _0x1d23f4[_0x13fa('0x1c')]===_0x13fa('0x1d')&&typeof _0x1d23f4[_0x13fa('0x1e')]===_0x13fa('0x1d');var _0x471254=_0x39739a[_0x13fa('0x1f')];var _0x1fd698=_0x2f5a87?0x0:_0x1d23f4['offset'];var _0x4fea9f=_0x2f5a87?_0x39739a[_0x13fa('0x1f')]:_0x1d23f4[_0x13fa('0x1c')]+_0x1d23f4[_0x13fa('0x1e')];var _0x4fbeb5;if(_0x4fea9f>=_0x471254){_0x4fea9f=_0x471254;_0x4fbeb5=0xc8;}else{_0x4fbeb5=0xce;}_0x104d63[_0x13fa('0x19')](_0x4fbeb5);return _0x104d63['set'](_0x13fa('0x20'),_0x1fd698+'-'+_0x4fea9f+'/'+_0x471254)[_0x13fa('0x1b')](_0x39739a);}return null;};}function patchUpdates(_0x221653){return function(_0x5e5746){try{jsonpatch[_0x13fa('0x21')](_0x5e5746,_0x221653,!![]);}catch(_0x335782){return BPromise['reject'](_0x335782);}return _0x5e5746[_0x13fa('0x22')]();};}function saveUpdates(_0x437e,_0x3cd756){return function(_0x5521d6){if(_0x5521d6){return _0x5521d6['update'](_0x437e)['then'](function(_0x296a52){return _0x296a52;});}return null;};}function removeEntity(_0x1f913a,_0xf316b2){return function(_0x240d43){if(_0x240d43){return _0x240d43[_0x13fa('0x23')]()['then'](function(){_0x1f913a[_0x13fa('0x19')](0xcc)[_0x13fa('0x1a')]();});}};}function handleEntityNotFound(_0x29da24,_0x9d4452){return function(_0x36b643){if(!_0x36b643){_0x29da24['sendStatus'](0x194);}return _0x36b643;};}function handleError(_0x18e21c,_0x516b82){_0x516b82=_0x516b82||0x1f4;return function(_0x3f6f60){logger[_0x13fa('0x24')](_0x3f6f60[_0x13fa('0x25')]);if(_0x3f6f60[_0x13fa('0x26')]){delete _0x3f6f60[_0x13fa('0x26')];}_0x18e21c[_0x13fa('0x19')](_0x516b82)['send'](_0x3f6f60);};}exports[_0x13fa('0x27')]=function(_0x23e2b7,_0x1a3010){var _0x14bd92={},_0x558a92={},_0x936f4c={'count':0x0,'rows':[]};var _0x2de47e=_[_0x13fa('0x28')](db[_0x13fa('0x29')]['rawAttributes'],function(_0x123ca8){return{'name':_0x123ca8[_0x13fa('0x2a')],'type':_0x123ca8[_0x13fa('0x2b')][_0x13fa('0x2c')]};});_0x558a92[_0x13fa('0x2d')]=_[_0x13fa('0x28')](_0x2de47e,_0x13fa('0x26'));_0x558a92[_0x13fa('0x2e')]=_[_0x13fa('0x2f')](_0x23e2b7[_0x13fa('0x2e')]);_0x558a92[_0x13fa('0x30')]=_[_0x13fa('0x31')](_0x558a92[_0x13fa('0x2d')],_0x558a92[_0x13fa('0x2e')]);_0x14bd92['attributes']=_['intersection'](_0x558a92[_0x13fa('0x2d')],qs[_0x13fa('0x32')](_0x23e2b7[_0x13fa('0x2e')][_0x13fa('0x32')]));_0x14bd92[_0x13fa('0x33')]=_0x14bd92[_0x13fa('0x33')][_0x13fa('0x34')]?_0x14bd92[_0x13fa('0x33')]:_0x558a92[_0x13fa('0x2d')];if(!_0x23e2b7[_0x13fa('0x2e')][_0x13fa('0x35')]('nolimit')){_0x14bd92['limit']=qs[_0x13fa('0x1e')](_0x23e2b7[_0x13fa('0x2e')][_0x13fa('0x1e')]);_0x14bd92['offset']=qs[_0x13fa('0x1c')](_0x23e2b7[_0x13fa('0x2e')][_0x13fa('0x1c')]);}_0x14bd92['order']=qs['sort'](_0x23e2b7['query'][_0x13fa('0x36')]);_0x14bd92[_0x13fa('0x37')]=qs['filters'](_[_0x13fa('0x38')](_0x23e2b7['query'],_0x558a92[_0x13fa('0x30')]),_0x2de47e);if(_0x23e2b7[_0x13fa('0x2e')][_0x13fa('0x39')]){_0x14bd92[_0x13fa('0x37')]=_[_0x13fa('0x3a')](_0x14bd92['where'],{'$or':_['map'](_0x2de47e,function(_0xb86dfc){if(_0xb86dfc[_0x13fa('0x2b')]!==_0x13fa('0x3b')){var _0x43008d={};_0x43008d[_0xb86dfc['name']]={'$like':'%'+_0x23e2b7[_0x13fa('0x2e')][_0x13fa('0x39')]+'%'};return _0x43008d;}})});}_0x14bd92=_[_0x13fa('0x3a')]({},_0x14bd92,_0x23e2b7[_0x13fa('0x3c')]);var _0x799b4d={'where':_0x14bd92['where']};return db[_0x13fa('0x29')]['count'](_0x799b4d)[_0x13fa('0x3d')](function(_0x46d15b){_0x936f4c['count']=_0x46d15b;if(_0x23e2b7[_0x13fa('0x2e')][_0x13fa('0x3e')]){_0x14bd92[_0x13fa('0x3f')]=[{'all':!![]}];}return db['FreshsalesField']['findAll'](_0x14bd92);})[_0x13fa('0x3d')](function(_0x548ee5){_0x936f4c['rows']=_0x548ee5;return _0x936f4c;})[_0x13fa('0x3d')](respondWithFilteredResult(_0x1a3010,_0x14bd92))[_0x13fa('0x40')](handleError(_0x1a3010,null));};exports[_0x13fa('0x41')]=function(_0x19ad43,_0x4a63f3){var _0x3fae04={'raw':!![],'where':{'id':_0x19ad43['params']['id']}},_0x2833ae={};_0x2833ae[_0x13fa('0x2d')]=_[_0x13fa('0x2f')](db['FreshsalesField']['rawAttributes']);_0x2833ae[_0x13fa('0x2e')]=_[_0x13fa('0x2f')](_0x19ad43[_0x13fa('0x2e')]);_0x2833ae[_0x13fa('0x30')]=_['intersection'](_0x2833ae[_0x13fa('0x2d')],_0x2833ae[_0x13fa('0x2e')]);_0x3fae04[_0x13fa('0x33')]=_[_0x13fa('0x31')](_0x2833ae[_0x13fa('0x2d')],qs['fields'](_0x19ad43[_0x13fa('0x2e')][_0x13fa('0x32')]));_0x3fae04[_0x13fa('0x33')]=_0x3fae04['attributes'][_0x13fa('0x34')]?_0x3fae04['attributes']:_0x2833ae[_0x13fa('0x2d')];if(_0x19ad43[_0x13fa('0x2e')][_0x13fa('0x3e')]){_0x3fae04['include']=[{'all':!![]}];}_0x3fae04=_[_0x13fa('0x3a')]({},_0x3fae04,_0x19ad43[_0x13fa('0x3c')]);return db[_0x13fa('0x29')][_0x13fa('0x42')](_0x3fae04)[_0x13fa('0x3d')](handleEntityNotFound(_0x4a63f3,null))[_0x13fa('0x3d')](respondWithResult(_0x4a63f3,null))[_0x13fa('0x40')](handleError(_0x4a63f3,null));};exports[_0x13fa('0x43')]=function(_0x5e60e3,_0x5610a4){return db[_0x13fa('0x29')][_0x13fa('0x43')](_0x5e60e3[_0x13fa('0x44')],{})[_0x13fa('0x3d')](respondWithResult(_0x5610a4,0xc9))[_0x13fa('0x40')](handleError(_0x5610a4,null));};exports[_0x13fa('0x45')]=function(_0x5bf80a,_0x33dede){if(_0x5bf80a[_0x13fa('0x44')]['id']){delete _0x5bf80a[_0x13fa('0x44')]['id'];}return db[_0x13fa('0x29')][_0x13fa('0x42')]({'where':{'id':_0x5bf80a[_0x13fa('0x46')]['id']}})['then'](handleEntityNotFound(_0x33dede,null))['then'](saveUpdates(_0x5bf80a[_0x13fa('0x44')],null))['then'](respondWithResult(_0x33dede,null))[_0x13fa('0x40')](handleError(_0x33dede,null));};exports[_0x13fa('0x23')]=function(_0x1ac856,_0x5699c2){return db[_0x13fa('0x29')]['find']({'where':{'id':_0x1ac856[_0x13fa('0x46')]['id']}})[_0x13fa('0x3d')](handleEntityNotFound(_0x5699c2,null))['then'](removeEntity(_0x5699c2,null))[_0x13fa('0x40')](handleError(_0x5699c2,null));}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.model.js b/server/api/intFreshsalesField/intFreshsalesField.model.js index 62430a6..0e37d2d 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 _0x81b7=['define','freshsales_unique_index','idField','FieldId','util','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./intFreshsalesField.attributes','exports'];(function(_0x3e73ba,_0x1d24df){var _0x137d2f=function(_0x153b90){while(--_0x153b90){_0x3e73ba['push'](_0x3e73ba['shift']());}};_0x137d2f(++_0x1d24df);}(_0x81b7,0x1f2));var _0x781b=function(_0x3369a2,_0x267f09){_0x3369a2=_0x3369a2-0x0;var _0x1f92e4=_0x81b7[_0x3369a2];return _0x1f92e4;};'use strict';var _=require('lodash');var util=require(_0x781b('0x0'));var logger=require(_0x781b('0x1'))(_0x781b('0x2'));var moment=require(_0x781b('0x3'));var BPromise=require('bluebird');var rp=require(_0x781b('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x781b('0x5'));var config=require(_0x781b('0x6'));var attributes=require(_0x781b('0x7'));module[_0x781b('0x8')]=function(_0x5eed8e,_0x3d9d36){return _0x5eed8e[_0x781b('0x9')]('FreshsalesField',attributes,{'tableName':'int_freshsales_fields','paranoid':![],'indexes':[{'name':_0x781b('0xa'),'fields':[_0x781b('0xb'),_0x781b('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xa30a=['define','FreshsalesField','int_freshsales_fields','idField','FieldId','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intFreshsalesField.attributes'];(function(_0x1d6c32,_0x5e9108){var _0x1cad3f=function(_0x38956a){while(--_0x38956a){_0x1d6c32['push'](_0x1d6c32['shift']());}};_0x1cad3f(++_0x5e9108);}(_0xa30a,0xd7));var _0xaa30=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xa30a[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0xaa30('0x0'));var util=require(_0xaa30('0x1'));var logger=require(_0xaa30('0x2'))('api');var moment=require(_0xaa30('0x3'));var BPromise=require(_0xaa30('0x4'));var rp=require(_0xaa30('0x5'));var fs=require('fs');var path=require(_0xaa30('0x6'));var rimraf=require(_0xaa30('0x7'));var config=require(_0xaa30('0x8'));var attributes=require(_0xaa30('0x9'));module['exports']=function(_0x347cd5,_0x4efe89){return _0x347cd5[_0xaa30('0xa')](_0xaa30('0xb'),attributes,{'tableName':_0xaa30('0xc'),'paranoid':![],'indexes':[{'name':'freshsales_unique_index','fields':[_0xaa30('0xd'),_0xaa30('0xe')],'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 3c1c270..4ece136 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 _0x7c09=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','then','info','FreshsalesField,\x20%s,\x20%s','FreshsalesField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','util','moment'];(function(_0x2160a9,_0x3cbd9e){var _0xa88cf7=function(_0x51ab6f){while(--_0x51ab6f){_0x2160a9['push'](_0x2160a9['shift']());}};_0xa88cf7(++_0x3cbd9e);}(_0x7c09,0x102));var _0x97c0=function(_0xf606e4,_0x46f965){_0xf606e4=_0xf606e4-0x0;var _0x4ab6ce=_0x7c09[_0xf606e4];return _0x4ab6ce;};'use strict';var _=require('lodash');var util=require(_0x97c0('0x0'));var moment=require(_0x97c0('0x1'));var BPromise=require('bluebird');var rs=require(_0x97c0('0x2'));var fs=require('fs');var Redis=require(_0x97c0('0x3'));var db=require(_0x97c0('0x4'))['db'];var utils=require(_0x97c0('0x5'));var logger=require(_0x97c0('0x6'))(_0x97c0('0x7'));var config=require(_0x97c0('0x8'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x46fdd9,_0x42c6c7,_0x2c19fa){return new BPromise(function(_0x109bc8,_0x293785){return client['request'](_0x46fdd9,_0x2c19fa)[_0x97c0('0x9')](function(_0x4ac5f1){logger[_0x97c0('0xa')](_0x97c0('0xb'),_0x42c6c7,'request\x20sent');logger['debug'](_0x97c0('0xc'),_0x42c6c7,_0x97c0('0xd'),JSON[_0x97c0('0xe')](_0x4ac5f1));if(_0x4ac5f1[_0x97c0('0xf')]){if(_0x4ac5f1[_0x97c0('0xf')][_0x97c0('0x10')]===0x1f4){logger[_0x97c0('0xf')](_0x97c0('0xb'),_0x42c6c7,_0x4ac5f1[_0x97c0('0xf')][_0x97c0('0x11')]);return _0x293785(_0x4ac5f1[_0x97c0('0xf')][_0x97c0('0x11')]);}logger[_0x97c0('0xf')]('FreshsalesField,\x20%s,\x20%s',_0x42c6c7,_0x4ac5f1[_0x97c0('0xf')][_0x97c0('0x11')]);return _0x109bc8(_0x4ac5f1[_0x97c0('0xf')]['message']);}else{logger[_0x97c0('0xa')](_0x97c0('0xb'),_0x42c6c7,_0x97c0('0xd'));_0x109bc8(_0x4ac5f1[_0x97c0('0x12')][_0x97c0('0x11')]);}})[_0x97c0('0x13')](function(_0x49c0d9){logger[_0x97c0('0xf')](_0x97c0('0xb'),_0x42c6c7,_0x49c0d9);_0x293785(_0x49c0d9);});});} \ No newline at end of file +var _0x01d9=['../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','FreshsalesField,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils'];(function(_0x26c875,_0x4de5e4){var _0x229377=function(_0x47ecf5){while(--_0x47ecf5){_0x26c875['push'](_0x26c875['shift']());}};_0x229377(++_0x4de5e4);}(_0x01d9,0x6c));var _0x901d=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x01d9[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x901d('0x0'));var util=require(_0x901d('0x1'));var moment=require(_0x901d('0x2'));var BPromise=require(_0x901d('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x901d('0x4'));var db=require(_0x901d('0x5'))['db'];var utils=require(_0x901d('0x6'));var logger=require(_0x901d('0x7'))(_0x901d('0x8'));var config=require(_0x901d('0x9'));var jayson=require(_0x901d('0xa'));var client=jayson['client'][_0x901d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x6c9ac8,_0x21e1d7,_0x12c39f){return new BPromise(function(_0x313f85,_0x39fc94){return client[_0x901d('0xc')](_0x6c9ac8,_0x12c39f)[_0x901d('0xd')](function(_0x15076e){logger[_0x901d('0xe')](_0x901d('0xf'),_0x21e1d7,_0x901d('0x10'));logger[_0x901d('0x11')]('FreshsalesField,\x20%s,\x20%s,\x20%s',_0x21e1d7,_0x901d('0x10'),JSON['stringify'](_0x15076e));if(_0x15076e[_0x901d('0x12')]){if(_0x15076e[_0x901d('0x12')][_0x901d('0x13')]===0x1f4){logger[_0x901d('0x12')](_0x901d('0xf'),_0x21e1d7,_0x15076e['error'][_0x901d('0x14')]);return _0x39fc94(_0x15076e[_0x901d('0x12')][_0x901d('0x14')]);}logger[_0x901d('0x12')](_0x901d('0xf'),_0x21e1d7,_0x15076e[_0x901d('0x12')]['message']);return _0x313f85(_0x15076e[_0x901d('0x12')][_0x901d('0x14')]);}else{logger[_0x901d('0xe')](_0x901d('0xf'),_0x21e1d7,_0x901d('0x10'));_0x313f85(_0x15076e[_0x901d('0x15')][_0x901d('0x14')]);}})[_0x901d('0x16')](function(_0x3368fc){logger[_0x901d('0x12')](_0x901d('0xf'),_0x21e1d7,_0x3368fc);_0x39fc94(_0x3368fc);});});} \ No newline at end of file diff --git a/server/api/intSalesforceAccount/index.js b/server/api/intSalesforceAccount/index.js index 78ce062..b2f1aa1 100644 --- a/server/api/intSalesforceAccount/index.js +++ b/server/api/intSalesforceAccount/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intSalesforceAccount.controller','get','isAuthenticated','index','/:id','show','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','destroy','exports','multer','util','path'];(function(_0x7787a5,_0x4cfad0){var _0x4dbe55=function(_0x8f90bc){while(--_0x8f90bc){_0x7787a5['push'](_0x7787a5['shift']());}};_0x4dbe55(++_0x4cfad0);}(_0x9957,0x93));var _0x7995=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x9957[_0x2dafbe];return _0x58a45a;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x11')]('/',auth['isAuthenticated'](),controller[_0x7995('0x12')]);router[_0x7995('0x11')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x7995('0x17')]);module[_0x7995('0x18')]=router; \ No newline at end of file +var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSalesforceAccount.controller','get','index','/:id','getConfigurations','/:id/fields','isAuthenticated','getFields','post','addConfiguration','put','update','destroy','exports','multer','util','path'];(function(_0x15598c,_0x240e3e){var _0x44e583=function(_0x55e48e){while(--_0x55e48e){_0x15598c['push'](_0x15598c['shift']());}};_0x44e583(++_0x240e3e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x37bd26,_0x5ad346){_0x37bd26=_0x37bd26-0x0;var _0xe83dc4=_0xa9e0[_0x37bd26];return _0xe83dc4;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/configurations',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x11')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x12')]);router['delete'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);module[_0x0a9e('0x14')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.attributes.js b/server/api/intSalesforceAccount/intSalesforceAccount.attributes.js index ef974b9..c3dbb27 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 _0xf970=['STRING','username','ENUM','integrationTab','newTab','sequelize'];(function(_0x44bcb0,_0x235aa9){var _0xfaf881=function(_0x25d81d){while(--_0x25d81d){_0x44bcb0['push'](_0x44bcb0['shift']());}};_0xfaf881(++_0x235aa9);}(_0xf970,0x1d9));var _0x0f97=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xf970[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require(_0x0f97('0x0'));module['exports']={'name':{'type':Sequelize[_0x0f97('0x1')]},'description':{'type':Sequelize[_0x0f97('0x1')]},'username':{'type':Sequelize[_0x0f97('0x1')],'unique':_0x0f97('0x2')},'remoteUri':{'type':Sequelize[_0x0f97('0x1')]},'password':{'type':Sequelize[_0x0f97('0x1')]},'clientId':{'type':Sequelize[_0x0f97('0x1')]},'clientSecret':{'type':Sequelize['STRING']},'securityToken':{'type':Sequelize[_0x0f97('0x1')]},'serverUrl':{'type':Sequelize[_0x0f97('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x0f97('0x3')](_0x0f97('0x4'),_0x0f97('0x5')),'defaultValue':_0x0f97('0x4')}}; \ No newline at end of file +var _0x099f=['username','integrationTab','sequelize','exports','STRING'];(function(_0x457d47,_0x357fea){var _0x406deb=function(_0x5e8e0f){while(--_0x5e8e0f){_0x457d47['push'](_0x457d47['shift']());}};_0x406deb(++_0x357fea);}(_0x099f,0x133));var _0xf099=function(_0x18fb40,_0xbb3644){_0x18fb40=_0x18fb40-0x0;var _0x55b3c4=_0x099f[_0x18fb40];return _0x55b3c4;};'use strict';var Sequelize=require(_0xf099('0x0'));module[_0xf099('0x1')]={'name':{'type':Sequelize[_0xf099('0x2')]},'description':{'type':Sequelize[_0xf099('0x2')]},'username':{'type':Sequelize['STRING'],'unique':_0xf099('0x3')},'remoteUri':{'type':Sequelize[_0xf099('0x2')]},'password':{'type':Sequelize[_0xf099('0x2')]},'clientId':{'type':Sequelize[_0xf099('0x2')]},'clientSecret':{'type':Sequelize[_0xf099('0x2')]},'securityToken':{'type':Sequelize[_0xf099('0x2')]},'serverUrl':{'type':Sequelize[_0xf099('0x2')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xf099('0x4'),'newTab'),'defaultValue':_0xf099('0x4')}}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.controller.js b/server/api/intSalesforceAccount/intSalesforceAccount.controller.js index 8fe3d55..1b6ea1e 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 _0xf756=['moment','bluebird','util','path','sox','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','offset','limit','undefined','count','set','Content-Range','json','apply','reject','update','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','options','includeAll','include','SalesforceAccount','rows','catch','find','body','params','getConfigurations','findOne','AccountId','Subjects','channel','Descriptions','getDescriptions','SalesforceConfiguration','create','SalesforceField','getFields','Task','remoteUri','clientId','username','password','securityToken','substring','login','isNil','ticketType','OwnerId','ActivityDate','IsRecurrence','Subject','string','int','picklist','boolean','email','textarea','phone','remove','includes','label','custom','picklistValues','value','True','true','false','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','test','Wrong\x20credentials','rimraf','zip-dir','request-promise'];(function(_0x34357e,_0x5af72a){var _0x488189=function(_0xa54a00){while(--_0xa54a00){_0x34357e['push'](_0x34357e['shift']());}};_0x488189(++_0x5af72a);}(_0xf756,0x76));var _0x6f75=function(_0x30ae5e,_0x391fc4){_0x30ae5e=_0x30ae5e-0x0;var _0x1f2e93=_0xf756[_0x30ae5e];return _0x1f2e93;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6f75('0x0'));var zipdir=require(_0x6f75('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6f75('0x2'));var moment=require(_0x6f75('0x3'));var BPromise=require(_0x6f75('0x4'));var Mustache=require('mustache');var util=require(_0x6f75('0x5'));var path=require(_0x6f75('0x6'));var sox=require(_0x6f75('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6f75('0x8'));var _=require(_0x6f75('0x9'));var squel=require('squel');var crypto=require(_0x6f75('0xa'));var jsforce=require(_0x6f75('0xb'));var deskjs=require(_0x6f75('0xc'));var toCsv=require(_0x6f75('0xd'));var querystring=require('querystring');var Papa=require(_0x6f75('0xe'));var Redis=require(_0x6f75('0xf'));var authService=require(_0x6f75('0x10'));var qs=require(_0x6f75('0x11'));var as=require(_0x6f75('0x12'));var hardwareService=require(_0x6f75('0x13'));var logger=require('../../config/logger')(_0x6f75('0x14'));var utils=require(_0x6f75('0x15'));var config=require(_0x6f75('0x16'));var licenseUtil=require(_0x6f75('0x17'));var db=require(_0x6f75('0x18'))['db'];var integrations=require(_0x6f75('0x19'));function respondWithStatusCode(_0x5a6407,_0x3af6f6){_0x3af6f6=_0x3af6f6||0xcc;return function(_0x1bbcb4){if(_0x1bbcb4){return _0x5a6407[_0x6f75('0x1a')](_0x3af6f6);}return _0x5a6407[_0x6f75('0x1b')](_0x3af6f6)[_0x6f75('0x1c')]();};}function respondWithResult(_0x2625b6,_0x117004){_0x117004=_0x117004||0xc8;return function(_0xf8c6c3){if(_0xf8c6c3){return _0x2625b6[_0x6f75('0x1b')](_0x117004)['json'](_0xf8c6c3);}};}function respondWithFilteredResult(_0xc1cf1,_0x4900d0){return function(_0x2ef40f){if(_0x2ef40f){var _0x29bfe7=typeof _0x4900d0[_0x6f75('0x1d')]==='undefined'&&typeof _0x4900d0[_0x6f75('0x1e')]===_0x6f75('0x1f');var _0x2cfac1=_0x2ef40f[_0x6f75('0x20')];var _0x4f385b=_0x29bfe7?0x0:_0x4900d0[_0x6f75('0x1d')];var _0x5eedd8=_0x29bfe7?_0x2ef40f[_0x6f75('0x20')]:_0x4900d0['offset']+_0x4900d0[_0x6f75('0x1e')];var _0xd89a7e;if(_0x5eedd8>=_0x2cfac1){_0x5eedd8=_0x2cfac1;_0xd89a7e=0xc8;}else{_0xd89a7e=0xce;}_0xc1cf1[_0x6f75('0x1b')](_0xd89a7e);return _0xc1cf1[_0x6f75('0x21')](_0x6f75('0x22'),_0x4f385b+'-'+_0x5eedd8+'/'+_0x2cfac1)[_0x6f75('0x23')](_0x2ef40f);}return null;};}function patchUpdates(_0x34645d){return function(_0x286bba){try{jsonpatch[_0x6f75('0x24')](_0x286bba,_0x34645d,!![]);}catch(_0x4d2998){return BPromise[_0x6f75('0x25')](_0x4d2998);}return _0x286bba['save']();};}function saveUpdates(_0x464105,_0x5f250a){return function(_0x3e9cc7){if(_0x3e9cc7){return _0x3e9cc7[_0x6f75('0x26')](_0x464105)[_0x6f75('0x27')](function(_0x544b54){return _0x544b54;});}return null;};}function removeEntity(_0x4cd446,_0x4526f5){return function(_0x50e707){if(_0x50e707){return _0x50e707[_0x6f75('0x28')]()[_0x6f75('0x27')](function(){_0x4cd446[_0x6f75('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x11e148,_0x152e45){return function(_0x51cb65){if(!_0x51cb65){_0x11e148[_0x6f75('0x1a')](0x194);}return _0x51cb65;};}function handleError(_0x20be2c,_0xce91ad){_0xce91ad=_0xce91ad||0x1f4;return function(_0x53053a){logger[_0x6f75('0x29')](_0x53053a[_0x6f75('0x2a')]);if(_0x53053a[_0x6f75('0x2b')]){delete _0x53053a[_0x6f75('0x2b')];}_0x20be2c[_0x6f75('0x1b')](_0xce91ad)[_0x6f75('0x2c')](_0x53053a);};}exports[_0x6f75('0x2d')]=function(_0x16354d,_0x1e6915){var _0x4fa7bc={},_0x38cb19={},_0x18b766={'count':0x0,'rows':[]};var _0x4ff434=_[_0x6f75('0x2e')](db['SalesforceAccount'][_0x6f75('0x2f')],function(_0xde6e3){return{'name':_0xde6e3[_0x6f75('0x30')],'type':_0xde6e3[_0x6f75('0x31')][_0x6f75('0x32')]};});_0x38cb19[_0x6f75('0x33')]=_['map'](_0x4ff434,_0x6f75('0x2b'));_0x38cb19[_0x6f75('0x34')]=_[_0x6f75('0x35')](_0x16354d[_0x6f75('0x34')]);_0x38cb19[_0x6f75('0x36')]=_[_0x6f75('0x37')](_0x38cb19[_0x6f75('0x33')],_0x38cb19[_0x6f75('0x34')]);_0x4fa7bc[_0x6f75('0x38')]=_[_0x6f75('0x37')](_0x38cb19['model'],qs[_0x6f75('0x39')](_0x16354d[_0x6f75('0x34')][_0x6f75('0x39')]));_0x4fa7bc[_0x6f75('0x38')]=_0x4fa7bc[_0x6f75('0x38')][_0x6f75('0x3a')]?_0x4fa7bc[_0x6f75('0x38')]:_0x38cb19[_0x6f75('0x33')];if(!_0x16354d[_0x6f75('0x34')][_0x6f75('0x3b')](_0x6f75('0x3c'))){_0x4fa7bc[_0x6f75('0x1e')]=qs[_0x6f75('0x1e')](_0x16354d[_0x6f75('0x34')]['limit']);_0x4fa7bc[_0x6f75('0x1d')]=qs[_0x6f75('0x1d')](_0x16354d[_0x6f75('0x34')][_0x6f75('0x1d')]);}_0x4fa7bc[_0x6f75('0x3d')]=qs[_0x6f75('0x3e')](_0x16354d[_0x6f75('0x34')][_0x6f75('0x3e')]);_0x4fa7bc[_0x6f75('0x3f')]=qs['filters'](_['pick'](_0x16354d['query'],_0x38cb19[_0x6f75('0x36')]),_0x4ff434);if(_0x16354d['query'][_0x6f75('0x40')]){_0x4fa7bc[_0x6f75('0x3f')]=_[_0x6f75('0x41')](_0x4fa7bc['where'],{'$or':_[_0x6f75('0x2e')](_0x4ff434,function(_0x397a76){if(_0x397a76[_0x6f75('0x31')]!=='VIRTUAL'){var _0xd39c9c={};_0xd39c9c[_0x397a76[_0x6f75('0x2b')]]={'$like':'%'+_0x16354d[_0x6f75('0x34')][_0x6f75('0x40')]+'%'};return _0xd39c9c;}})});}_0x4fa7bc=_[_0x6f75('0x41')]({},_0x4fa7bc,_0x16354d[_0x6f75('0x42')]);var _0x4c0a2c={'where':_0x4fa7bc['where']};return db['SalesforceAccount'][_0x6f75('0x20')](_0x4c0a2c)[_0x6f75('0x27')](function(_0x17bb8a){_0x18b766[_0x6f75('0x20')]=_0x17bb8a;if(_0x16354d['query'][_0x6f75('0x43')]){_0x4fa7bc[_0x6f75('0x44')]=[{'all':!![]}];}return db[_0x6f75('0x45')]['findAll'](_0x4fa7bc);})[_0x6f75('0x27')](function(_0x1b8df3){_0x18b766[_0x6f75('0x46')]=_0x1b8df3;return _0x18b766;})['then'](respondWithFilteredResult(_0x1e6915,_0x4fa7bc))[_0x6f75('0x47')](handleError(_0x1e6915,null));};exports['show']=function(_0x20105a,_0x106582){var _0x4aeb5d={'raw':![],'where':{'id':_0x20105a['params']['id']}},_0x4c5b64={};_0x4c5b64[_0x6f75('0x33')]=_[_0x6f75('0x35')](db[_0x6f75('0x45')][_0x6f75('0x2f')]);_0x4c5b64[_0x6f75('0x34')]=_[_0x6f75('0x35')](_0x20105a[_0x6f75('0x34')]);_0x4c5b64['filters']=_[_0x6f75('0x37')](_0x4c5b64['model'],_0x4c5b64['query']);_0x4aeb5d[_0x6f75('0x38')]=_['intersection'](_0x4c5b64['model'],qs[_0x6f75('0x39')](_0x20105a[_0x6f75('0x34')][_0x6f75('0x39')]));_0x4aeb5d['attributes']=_0x4aeb5d[_0x6f75('0x38')][_0x6f75('0x3a')]?_0x4aeb5d[_0x6f75('0x38')]:_0x4c5b64[_0x6f75('0x33')];if(_0x20105a[_0x6f75('0x34')][_0x6f75('0x43')]){_0x4aeb5d[_0x6f75('0x44')]=[{'all':!![]}];}_0x4aeb5d=_[_0x6f75('0x41')]({},_0x4aeb5d,_0x20105a[_0x6f75('0x42')]);return db['SalesforceAccount'][_0x6f75('0x48')](_0x4aeb5d)[_0x6f75('0x27')](handleEntityNotFound(_0x106582,null))[_0x6f75('0x27')](respondWithResult(_0x106582,null))[_0x6f75('0x47')](handleError(_0x106582,null));};exports['create']=function(_0x249984,_0xd2c708){return db['SalesforceAccount']['create'](_0x249984['body'],{})['then'](respondWithResult(_0xd2c708,0xc9))[_0x6f75('0x47')](handleError(_0xd2c708,null));};exports[_0x6f75('0x26')]=function(_0x82c095,_0x2e62e7){if(_0x82c095['body']['id']){delete _0x82c095[_0x6f75('0x49')]['id'];}return db[_0x6f75('0x45')][_0x6f75('0x48')]({'where':{'id':_0x82c095[_0x6f75('0x4a')]['id']}})[_0x6f75('0x27')](handleEntityNotFound(_0x2e62e7,null))['then'](saveUpdates(_0x82c095['body'],null))[_0x6f75('0x27')](respondWithResult(_0x2e62e7,null))[_0x6f75('0x47')](handleError(_0x2e62e7,null));};exports['destroy']=function(_0x5c1c2d,_0x8bb673){return db['SalesforceAccount'][_0x6f75('0x48')]({'where':{'id':_0x5c1c2d[_0x6f75('0x4a')]['id']}})[_0x6f75('0x27')](handleEntityNotFound(_0x8bb673,null))[_0x6f75('0x27')](removeEntity(_0x8bb673,null))[_0x6f75('0x47')](handleError(_0x8bb673,null));};exports[_0x6f75('0x4b')]=function(_0x4ce08d,_0x2fb87d,_0x4608c5){var _0x18ba47={};var _0xf54507={};var _0x4b7745;var _0x48bf76;return db['SalesforceAccount'][_0x6f75('0x4c')]({'where':{'id':_0x4ce08d['params']['id']}})['then'](handleEntityNotFound(_0x2fb87d,null))[_0x6f75('0x27')](function(_0x273112){if(_0x273112){_0x4b7745=_0x273112;_0xf54507[_0x6f75('0x33')]=_[_0x6f75('0x35')](db['SalesforceConfiguration'][_0x6f75('0x2f')]);_0xf54507['query']=_[_0x6f75('0x35')](_0x4ce08d['query']);_0xf54507[_0x6f75('0x36')]=_[_0x6f75('0x37')](_0xf54507[_0x6f75('0x33')],_0xf54507['query']);_0x18ba47[_0x6f75('0x38')]=_['intersection'](_0xf54507['model'],qs[_0x6f75('0x39')](_0x4ce08d[_0x6f75('0x34')][_0x6f75('0x39')]));_0x18ba47[_0x6f75('0x38')]=_0x18ba47[_0x6f75('0x38')]['length']?_0x18ba47[_0x6f75('0x38')]:_0xf54507[_0x6f75('0x33')];_0x18ba47[_0x6f75('0x3d')]=qs[_0x6f75('0x3e')](_0x4ce08d[_0x6f75('0x34')][_0x6f75('0x3e')]);_0x18ba47['where']=qs[_0x6f75('0x36')](_['pick'](_0x4ce08d[_0x6f75('0x34')],_0xf54507[_0x6f75('0x36')]));if(_0x4ce08d[_0x6f75('0x34')][_0x6f75('0x40')]){_0x18ba47['where']=_[_0x6f75('0x41')](_0x18ba47[_0x6f75('0x3f')],{'$or':_['map'](_0x18ba47[_0x6f75('0x38')],function(_0x140d99){var _0x26ba10={};_0x26ba10[_0x140d99]={'$like':'%'+_0x4ce08d[_0x6f75('0x34')][_0x6f75('0x40')]+'%'};return _0x26ba10;})});}_0x18ba47=_['merge']({},_0x18ba47,_0x4ce08d[_0x6f75('0x42')]);return _0x4b7745[_0x6f75('0x4b')](_0x18ba47);}})[_0x6f75('0x27')](function(_0x4841ae){if(_0x4841ae){_0x48bf76=_0x4841ae[_0x6f75('0x3a')];if(!_0x4ce08d[_0x6f75('0x34')][_0x6f75('0x3b')](_0x6f75('0x3c'))){_0x18ba47['limit']=qs[_0x6f75('0x1e')](_0x4ce08d[_0x6f75('0x34')][_0x6f75('0x1e')]);_0x18ba47[_0x6f75('0x1d')]=qs['offset'](_0x4ce08d[_0x6f75('0x34')][_0x6f75('0x1d')]);}return _0x4b7745[_0x6f75('0x4b')](_0x18ba47);}})['then'](function(_0x4e52b5){if(_0x4e52b5){return _0x4e52b5?{'count':_0x48bf76,'rows':_0x4e52b5}:null;}})[_0x6f75('0x27')](respondWithResult(_0x2fb87d,null))['catch'](handleError(_0x2fb87d,null));};exports['addConfiguration']=function(_0x3386a9,_0x2838c1,_0x48238a){if(_0x3386a9[_0x6f75('0x49')]['id']){delete _0x3386a9[_0x6f75('0x49')]['id'];}return db[_0x6f75('0x45')][_0x6f75('0x4c')]({'where':{'id':_0x3386a9[_0x6f75('0x4a')]['id']}})[_0x6f75('0x27')](handleEntityNotFound(_0x2838c1,null))[_0x6f75('0x27')](function(_0x25a960){if(_0x25a960){_0x3386a9[_0x6f75('0x49')][_0x6f75('0x4d')]=_0x25a960['id'];_0x3386a9['body'][_0x6f75('0x4e')]=integrations['getSubjects'](_0x3386a9[_0x6f75('0x49')][_0x6f75('0x4f')],_0x3386a9[_0x6f75('0x49')][_0x6f75('0x31')]);_0x3386a9[_0x6f75('0x49')][_0x6f75('0x50')]=integrations[_0x6f75('0x51')](_0x3386a9[_0x6f75('0x49')]['channel'],_0x3386a9[_0x6f75('0x49')]['type']);return db[_0x6f75('0x52')][_0x6f75('0x53')](_0x3386a9['body'],{'include':[{'model':db[_0x6f75('0x54')],'as':'Subjects'},{'model':db[_0x6f75('0x54')],'as':_0x6f75('0x50')}]});}return null;})[_0x6f75('0x27')](respondWithResult(_0x2838c1,null))[_0x6f75('0x47')](handleError(_0x2838c1,null));};exports[_0x6f75('0x55')]=function(_0x12fe93,_0x5452b0,_0x16150d){var _0x207dc5;var _0x33e326='';var _0x496d80=_0x6f75('0x56');return db['SalesforceAccount'][_0x6f75('0x4c')]({'where':{'id':_0x12fe93['params']['id']},'attributes':['id',_0x6f75('0x57'),_0x6f75('0x58'),'clientSecret',_0x6f75('0x59'),_0x6f75('0x5a'),_0x6f75('0x5b')]})[_0x6f75('0x27')](handleEntityNotFound(_0x5452b0,null))[_0x6f75('0x27')](function(_0x17d1d6){if(_0x17d1d6){_0x33e326=_0x17d1d6['remoteUri'];var _0x93f167=_0x33e326['slice'](-0x1);if(_0x93f167==='/'){_0x33e326=_0x33e326[_0x6f75('0x5c')](0x0,_0x33e326['lastIndexOf'](_0x93f167));}_0x207dc5=new jsforce['Connection']({'oauth2':{'loginUrl':_0x33e326,'clientId':_0x17d1d6['clientId'],'clientSecret':_0x17d1d6['clientSecret']}});return _0x207dc5[_0x6f75('0x5d')](_0x17d1d6[_0x6f75('0x59')],_0x17d1d6[_0x6f75('0x5a')]['concat'](_0x17d1d6['securityToken']));}})[_0x6f75('0x27')](function(_0x21f507){if(_0x21f507){if(!_[_0x6f75('0x5e')](_0x12fe93[_0x6f75('0x34')][_0x6f75('0x5f')])){_0x496d80=_0x12fe93[_0x6f75('0x34')][_0x6f75('0x5f')];}return _0x207dc5['sobject'](_0x496d80)['describe']();}})['then'](function(_0x410aaf){var _0x1b5fc5=[_0x6f75('0x60'),_0x6f75('0x61'),'IsReminderSet',_0x6f75('0x62'),_0x6f75('0x63'),'Description'];var _0x13a533=[_0x6f75('0x64'),_0x6f75('0x65'),_0x6f75('0x66'),_0x6f75('0x67'),_0x6f75('0x68'),_0x6f75('0x69'),_0x6f75('0x6a')];if(_0x410aaf){_[_0x6f75('0x6b')](_0x410aaf[_0x6f75('0x39')],function(_0x172c04){return _0x1b5fc5[_0x6f75('0x6c')](_0x172c04[_0x6f75('0x2b')])||!_0x13a533[_0x6f75('0x6c')](_0x172c04[_0x6f75('0x31')]);});return{'count':_0x410aaf['fields'][_0x6f75('0x3a')],'rows':_[_0x6f75('0x2e')](_0x410aaf[_0x6f75('0x39')],function(_0x28e59d){return{'id':_0x28e59d[_0x6f75('0x2b')],'name':_0x28e59d[_0x6f75('0x6d')],'custom':_0x28e59d[_0x6f75('0x6e')],'options':_0x28e59d[_0x6f75('0x6f')][_0x6f75('0x3a')]>0x0?_[_0x6f75('0x2e')](_0x28e59d[_0x6f75('0x6f')],function(_0x15fcfe){return{'name':_0x15fcfe[_0x6f75('0x6d')],'value':_0x15fcfe[_0x6f75('0x70')]};}):_0x28e59d[_0x6f75('0x31')]=='boolean'?[{'name':_0x6f75('0x71'),'value':_0x6f75('0x72')},{'name':'False','value':_0x6f75('0x73')}]:[]};})};}})[_0x6f75('0x27')](respondWithResult(_0x5452b0,null))[_0x6f75('0x47')](function(_0x5d6caf){var _0x651ca1=_0x12fe93['query']['test']?0x1f4:_0x5d6caf[_0x6f75('0x74')]||0x1f4;logger['error'](_0x6f75('0x75'),_0x6f75('0x55'),_0x651ca1,JSON[_0x6f75('0x76')](_0x5d6caf));delete _0x5d6caf[_0x6f75('0x2b')];if(_0x651ca1===0x191){_0x651ca1=0x190;}_0x5452b0[_0x6f75('0x1b')](_0x651ca1)[_0x6f75('0x2c')](_0x12fe93[_0x6f75('0x34')][_0x6f75('0x77')]?{'message':_0x6f75('0x78'),'statusCode':_0x5d6caf[_0x6f75('0x74')]}:_0x5d6caf);});}; \ No newline at end of file +var _0x9bf0=['remoteUri','clientId','clientSecret','username','password','securityToken','slice','Connection','concat','isNil','ticketType','sobject','describe','ActivityDate','IsRecurrence','Subject','string','int','picklist','boolean','email','phone','remove','includes','label','custom','picklistValues','value','true','false','statusCode','error','getFields,\x20%s,\x20%s,\x20%s','stringify','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','index','map','SalesforceAccount','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','include','findAll','rows','catch','show','params','create','body','find','getConfigurations','findOne','SalesforceConfiguration','addConfiguration','Subjects','Descriptions','getDescriptions','channel','SalesforceField','getFields','Task'];(function(_0x2330a1,_0x4bb8d3){var _0x32c0a6=function(_0xba8ada){while(--_0xba8ada){_0x2330a1['push'](_0x2330a1['shift']());}};_0x32c0a6(++_0x4bb8d3);}(_0x9bf0,0x18a));var _0x09bf=function(_0x1e3c16,_0x372caa){_0x1e3c16=_0x1e3c16-0x0;var _0x47a0c9=_0x9bf0[_0x1e3c16];return _0x47a0c9;};'use strict';var emlformat=require(_0x09bf('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x09bf('0x1'));var jsonpatch=require(_0x09bf('0x2'));var rp=require(_0x09bf('0x3'));var moment=require(_0x09bf('0x4'));var BPromise=require(_0x09bf('0x5'));var Mustache=require(_0x09bf('0x6'));var util=require(_0x09bf('0x7'));var path=require('path');var sox=require(_0x09bf('0x8'));var csv=require('to-csv');var ejs=require(_0x09bf('0x9'));var fs=require('fs');var fs_extra=require(_0x09bf('0xa'));var _=require(_0x09bf('0xb'));var squel=require(_0x09bf('0xc'));var crypto=require(_0x09bf('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x09bf('0xe'));var toCsv=require(_0x09bf('0xf'));var querystring=require(_0x09bf('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x09bf('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x09bf('0x12'));var logger=require(_0x09bf('0x13'))(_0x09bf('0x14'));var utils=require('../../config/utils');var config=require(_0x09bf('0x15'));var licenseUtil=require(_0x09bf('0x16'));var db=require(_0x09bf('0x17'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x4d311f,_0xa22eb5){_0xa22eb5=_0xa22eb5||0xcc;return function(_0x54b2af){if(_0x54b2af){return _0x4d311f[_0x09bf('0x18')](_0xa22eb5);}return _0x4d311f[_0x09bf('0x19')](_0xa22eb5)[_0x09bf('0x1a')]();};}function respondWithResult(_0x10b84e,_0x3f4eb3){_0x3f4eb3=_0x3f4eb3||0xc8;return function(_0x4796e4){if(_0x4796e4){return _0x10b84e[_0x09bf('0x19')](_0x3f4eb3)[_0x09bf('0x1b')](_0x4796e4);}};}function respondWithFilteredResult(_0x46f081,_0x3dc7bf){return function(_0x145ef2){if(_0x145ef2){var _0x30db4b=typeof _0x3dc7bf[_0x09bf('0x1c')]==='undefined'&&typeof _0x3dc7bf['limit']===_0x09bf('0x1d');var _0x5dd15b=_0x145ef2[_0x09bf('0x1e')];var _0x412c2a=_0x30db4b?0x0:_0x3dc7bf[_0x09bf('0x1c')];var _0x431e89=_0x30db4b?_0x145ef2[_0x09bf('0x1e')]:_0x3dc7bf['offset']+_0x3dc7bf[_0x09bf('0x1f')];var _0x138adc;if(_0x431e89>=_0x5dd15b){_0x431e89=_0x5dd15b;_0x138adc=0xc8;}else{_0x138adc=0xce;}_0x46f081[_0x09bf('0x19')](_0x138adc);return _0x46f081[_0x09bf('0x20')](_0x09bf('0x21'),_0x412c2a+'-'+_0x431e89+'/'+_0x5dd15b)[_0x09bf('0x1b')](_0x145ef2);}return null;};}function patchUpdates(_0x365e1c){return function(_0x3fdc0e){try{jsonpatch[_0x09bf('0x22')](_0x3fdc0e,_0x365e1c,!![]);}catch(_0x5aab09){return BPromise[_0x09bf('0x23')](_0x5aab09);}return _0x3fdc0e[_0x09bf('0x24')]();};}function saveUpdates(_0x31d164,_0x160b48){return function(_0x42199e){if(_0x42199e){return _0x42199e[_0x09bf('0x25')](_0x31d164)[_0x09bf('0x26')](function(_0x1f65ba){return _0x1f65ba;});}return null;};}function removeEntity(_0x2b60ee,_0x1df136){return function(_0x2cfcec){if(_0x2cfcec){return _0x2cfcec[_0x09bf('0x27')]()['then'](function(){_0x2b60ee[_0x09bf('0x19')](0xcc)[_0x09bf('0x1a')]();});}};}function handleEntityNotFound(_0x1c1db8,_0x4d29ad){return function(_0x355ce8){if(!_0x355ce8){_0x1c1db8['sendStatus'](0x194);}return _0x355ce8;};}function handleError(_0x4a6dc4,_0x532cc1){_0x532cc1=_0x532cc1||0x1f4;return function(_0x59463b){logger['error'](_0x59463b[_0x09bf('0x28')]);if(_0x59463b[_0x09bf('0x29')]){delete _0x59463b[_0x09bf('0x29')];}_0x4a6dc4[_0x09bf('0x19')](_0x532cc1)[_0x09bf('0x2a')](_0x59463b);};}exports[_0x09bf('0x2b')]=function(_0x2ad01b,_0x265b37){var _0x1e2147={},_0x5eb1b4={},_0x14a057={'count':0x0,'rows':[]};var _0xc89dc6=_[_0x09bf('0x2c')](db[_0x09bf('0x2d')][_0x09bf('0x2e')],function(_0x40c182){return{'name':_0x40c182[_0x09bf('0x2f')],'type':_0x40c182[_0x09bf('0x30')][_0x09bf('0x31')]};});_0x5eb1b4[_0x09bf('0x32')]=_['map'](_0xc89dc6,_0x09bf('0x29'));_0x5eb1b4[_0x09bf('0x33')]=_[_0x09bf('0x34')](_0x2ad01b[_0x09bf('0x33')]);_0x5eb1b4[_0x09bf('0x35')]=_['intersection'](_0x5eb1b4[_0x09bf('0x32')],_0x5eb1b4['query']);_0x1e2147[_0x09bf('0x36')]=_[_0x09bf('0x37')](_0x5eb1b4[_0x09bf('0x32')],qs[_0x09bf('0x38')](_0x2ad01b[_0x09bf('0x33')][_0x09bf('0x38')]));_0x1e2147[_0x09bf('0x36')]=_0x1e2147['attributes'][_0x09bf('0x39')]?_0x1e2147['attributes']:_0x5eb1b4[_0x09bf('0x32')];if(!_0x2ad01b[_0x09bf('0x33')][_0x09bf('0x3a')](_0x09bf('0x3b'))){_0x1e2147['limit']=qs[_0x09bf('0x1f')](_0x2ad01b[_0x09bf('0x33')][_0x09bf('0x1f')]);_0x1e2147[_0x09bf('0x1c')]=qs[_0x09bf('0x1c')](_0x2ad01b[_0x09bf('0x33')][_0x09bf('0x1c')]);}_0x1e2147['order']=qs['sort'](_0x2ad01b['query'][_0x09bf('0x3c')]);_0x1e2147[_0x09bf('0x3d')]=qs[_0x09bf('0x35')](_[_0x09bf('0x3e')](_0x2ad01b['query'],_0x5eb1b4['filters']),_0xc89dc6);if(_0x2ad01b[_0x09bf('0x33')][_0x09bf('0x3f')]){_0x1e2147[_0x09bf('0x3d')]=_[_0x09bf('0x40')](_0x1e2147[_0x09bf('0x3d')],{'$or':_['map'](_0xc89dc6,function(_0x1820d2){if(_0x1820d2[_0x09bf('0x30')]!==_0x09bf('0x41')){var _0x47b2ae={};_0x47b2ae[_0x1820d2[_0x09bf('0x29')]]={'$like':'%'+_0x2ad01b[_0x09bf('0x33')][_0x09bf('0x3f')]+'%'};return _0x47b2ae;}})});}_0x1e2147=_[_0x09bf('0x40')]({},_0x1e2147,_0x2ad01b['options']);var _0x17f7eb={'where':_0x1e2147[_0x09bf('0x3d')]};return db[_0x09bf('0x2d')]['count'](_0x17f7eb)[_0x09bf('0x26')](function(_0x54bbb2){_0x14a057[_0x09bf('0x1e')]=_0x54bbb2;if(_0x2ad01b[_0x09bf('0x33')]['includeAll']){_0x1e2147[_0x09bf('0x42')]=[{'all':!![]}];}return db[_0x09bf('0x2d')][_0x09bf('0x43')](_0x1e2147);})[_0x09bf('0x26')](function(_0x4e6b57){_0x14a057[_0x09bf('0x44')]=_0x4e6b57;return _0x14a057;})['then'](respondWithFilteredResult(_0x265b37,_0x1e2147))[_0x09bf('0x45')](handleError(_0x265b37,null));};exports[_0x09bf('0x46')]=function(_0x34f7ec,_0x983874){var _0x2018f7={'raw':![],'where':{'id':_0x34f7ec[_0x09bf('0x47')]['id']}},_0x165b83={};_0x165b83[_0x09bf('0x32')]=_['keys'](db[_0x09bf('0x2d')]['rawAttributes']);_0x165b83[_0x09bf('0x33')]=_[_0x09bf('0x34')](_0x34f7ec[_0x09bf('0x33')]);_0x165b83[_0x09bf('0x35')]=_[_0x09bf('0x37')](_0x165b83['model'],_0x165b83['query']);_0x2018f7[_0x09bf('0x36')]=_['intersection'](_0x165b83['model'],qs[_0x09bf('0x38')](_0x34f7ec[_0x09bf('0x33')][_0x09bf('0x38')]));_0x2018f7['attributes']=_0x2018f7['attributes'][_0x09bf('0x39')]?_0x2018f7[_0x09bf('0x36')]:_0x165b83['model'];if(_0x34f7ec[_0x09bf('0x33')]['includeAll']){_0x2018f7[_0x09bf('0x42')]=[{'all':!![]}];}_0x2018f7=_['merge']({},_0x2018f7,_0x34f7ec['options']);return db[_0x09bf('0x2d')]['find'](_0x2018f7)[_0x09bf('0x26')](handleEntityNotFound(_0x983874,null))[_0x09bf('0x26')](respondWithResult(_0x983874,null))['catch'](handleError(_0x983874,null));};exports[_0x09bf('0x48')]=function(_0x45c284,_0x386099){return db[_0x09bf('0x2d')]['create'](_0x45c284[_0x09bf('0x49')],{})['then'](respondWithResult(_0x386099,0xc9))[_0x09bf('0x45')](handleError(_0x386099,null));};exports[_0x09bf('0x25')]=function(_0x2a5a10,_0x75f124){if(_0x2a5a10[_0x09bf('0x49')]['id']){delete _0x2a5a10['body']['id'];}return db[_0x09bf('0x2d')][_0x09bf('0x4a')]({'where':{'id':_0x2a5a10[_0x09bf('0x47')]['id']}})[_0x09bf('0x26')](handleEntityNotFound(_0x75f124,null))['then'](saveUpdates(_0x2a5a10[_0x09bf('0x49')],null))[_0x09bf('0x26')](respondWithResult(_0x75f124,null))[_0x09bf('0x45')](handleError(_0x75f124,null));};exports['destroy']=function(_0x4ae2d8,_0x154145){return db[_0x09bf('0x2d')][_0x09bf('0x4a')]({'where':{'id':_0x4ae2d8[_0x09bf('0x47')]['id']}})[_0x09bf('0x26')](handleEntityNotFound(_0x154145,null))['then'](removeEntity(_0x154145,null))[_0x09bf('0x45')](handleError(_0x154145,null));};exports[_0x09bf('0x4b')]=function(_0x9c7e59,_0xfca1e3,_0x57d3b0){var _0x30149d={};var _0x19c5f9={};var _0x5c046e;var _0x58684b;return db[_0x09bf('0x2d')][_0x09bf('0x4c')]({'where':{'id':_0x9c7e59[_0x09bf('0x47')]['id']}})[_0x09bf('0x26')](handleEntityNotFound(_0xfca1e3,null))[_0x09bf('0x26')](function(_0x5e159c){if(_0x5e159c){_0x5c046e=_0x5e159c;_0x19c5f9['model']=_[_0x09bf('0x34')](db[_0x09bf('0x4d')][_0x09bf('0x2e')]);_0x19c5f9[_0x09bf('0x33')]=_[_0x09bf('0x34')](_0x9c7e59['query']);_0x19c5f9['filters']=_[_0x09bf('0x37')](_0x19c5f9['model'],_0x19c5f9[_0x09bf('0x33')]);_0x30149d[_0x09bf('0x36')]=_[_0x09bf('0x37')](_0x19c5f9['model'],qs[_0x09bf('0x38')](_0x9c7e59[_0x09bf('0x33')][_0x09bf('0x38')]));_0x30149d[_0x09bf('0x36')]=_0x30149d[_0x09bf('0x36')]['length']?_0x30149d[_0x09bf('0x36')]:_0x19c5f9['model'];_0x30149d['order']=qs['sort'](_0x9c7e59[_0x09bf('0x33')][_0x09bf('0x3c')]);_0x30149d[_0x09bf('0x3d')]=qs['filters'](_['pick'](_0x9c7e59['query'],_0x19c5f9[_0x09bf('0x35')]));if(_0x9c7e59['query'][_0x09bf('0x3f')]){_0x30149d['where']=_['merge'](_0x30149d[_0x09bf('0x3d')],{'$or':_[_0x09bf('0x2c')](_0x30149d['attributes'],function(_0xadc40b){var _0x5b3f76={};_0x5b3f76[_0xadc40b]={'$like':'%'+_0x9c7e59[_0x09bf('0x33')][_0x09bf('0x3f')]+'%'};return _0x5b3f76;})});}_0x30149d=_['merge']({},_0x30149d,_0x9c7e59['options']);return _0x5c046e['getConfigurations'](_0x30149d);}})[_0x09bf('0x26')](function(_0x20422b){if(_0x20422b){_0x58684b=_0x20422b[_0x09bf('0x39')];if(!_0x9c7e59[_0x09bf('0x33')][_0x09bf('0x3a')](_0x09bf('0x3b'))){_0x30149d[_0x09bf('0x1f')]=qs['limit'](_0x9c7e59[_0x09bf('0x33')][_0x09bf('0x1f')]);_0x30149d['offset']=qs[_0x09bf('0x1c')](_0x9c7e59[_0x09bf('0x33')]['offset']);}return _0x5c046e[_0x09bf('0x4b')](_0x30149d);}})[_0x09bf('0x26')](function(_0x598a27){if(_0x598a27){return _0x598a27?{'count':_0x58684b,'rows':_0x598a27}:null;}})[_0x09bf('0x26')](respondWithResult(_0xfca1e3,null))[_0x09bf('0x45')](handleError(_0xfca1e3,null));};exports[_0x09bf('0x4e')]=function(_0x1621ac,_0x583f66,_0x557c6e){if(_0x1621ac[_0x09bf('0x49')]['id']){delete _0x1621ac[_0x09bf('0x49')]['id'];}return db['SalesforceAccount']['findOne']({'where':{'id':_0x1621ac[_0x09bf('0x47')]['id']}})['then'](handleEntityNotFound(_0x583f66,null))[_0x09bf('0x26')](function(_0x2e1471){if(_0x2e1471){_0x1621ac[_0x09bf('0x49')]['AccountId']=_0x2e1471['id'];_0x1621ac[_0x09bf('0x49')][_0x09bf('0x4f')]=integrations['getSubjects'](_0x1621ac[_0x09bf('0x49')]['channel'],_0x1621ac[_0x09bf('0x49')][_0x09bf('0x30')]);_0x1621ac['body'][_0x09bf('0x50')]=integrations[_0x09bf('0x51')](_0x1621ac[_0x09bf('0x49')][_0x09bf('0x52')],_0x1621ac['body']['type']);return db['SalesforceConfiguration'][_0x09bf('0x48')](_0x1621ac['body'],{'include':[{'model':db['SalesforceField'],'as':_0x09bf('0x4f')},{'model':db[_0x09bf('0x53')],'as':_0x09bf('0x50')}]});}return null;})[_0x09bf('0x26')](respondWithResult(_0x583f66,null))[_0x09bf('0x45')](handleError(_0x583f66,null));};exports[_0x09bf('0x54')]=function(_0x2607be,_0x44d09d,_0x2d2d22){var _0x5ab276;var _0x26fa6b='';var _0x307306=_0x09bf('0x55');return db[_0x09bf('0x2d')]['findOne']({'where':{'id':_0x2607be[_0x09bf('0x47')]['id']},'attributes':['id',_0x09bf('0x56'),_0x09bf('0x57'),_0x09bf('0x58'),_0x09bf('0x59'),_0x09bf('0x5a'),_0x09bf('0x5b')]})[_0x09bf('0x26')](handleEntityNotFound(_0x44d09d,null))[_0x09bf('0x26')](function(_0x449b75){if(_0x449b75){_0x26fa6b=_0x449b75[_0x09bf('0x56')];var _0x4da59e=_0x26fa6b[_0x09bf('0x5c')](-0x1);if(_0x4da59e==='/'){_0x26fa6b=_0x26fa6b['substring'](0x0,_0x26fa6b['lastIndexOf'](_0x4da59e));}_0x5ab276=new jsforce[(_0x09bf('0x5d'))]({'oauth2':{'loginUrl':_0x26fa6b,'clientId':_0x449b75[_0x09bf('0x57')],'clientSecret':_0x449b75[_0x09bf('0x58')]}});return _0x5ab276['login'](_0x449b75[_0x09bf('0x59')],_0x449b75['password'][_0x09bf('0x5e')](_0x449b75[_0x09bf('0x5b')]));}})['then'](function(_0x39e39f){if(_0x39e39f){if(!_[_0x09bf('0x5f')](_0x2607be[_0x09bf('0x33')][_0x09bf('0x60')])){_0x307306=_0x2607be[_0x09bf('0x33')][_0x09bf('0x60')];}return _0x5ab276[_0x09bf('0x61')](_0x307306)[_0x09bf('0x62')]();}})[_0x09bf('0x26')](function(_0x2f35e3){var _0xb1d000=['OwnerId',_0x09bf('0x63'),'IsReminderSet',_0x09bf('0x64'),_0x09bf('0x65'),'Description'];var _0xd9498e=[_0x09bf('0x66'),_0x09bf('0x67'),_0x09bf('0x68'),_0x09bf('0x69'),_0x09bf('0x6a'),'textarea',_0x09bf('0x6b')];if(_0x2f35e3){_[_0x09bf('0x6c')](_0x2f35e3[_0x09bf('0x38')],function(_0xc43dd8){return _0xb1d000[_0x09bf('0x6d')](_0xc43dd8[_0x09bf('0x29')])||!_0xd9498e[_0x09bf('0x6d')](_0xc43dd8[_0x09bf('0x30')]);});return{'count':_0x2f35e3[_0x09bf('0x38')]['length'],'rows':_['map'](_0x2f35e3['fields'],function(_0x4ff5c6){return{'id':_0x4ff5c6[_0x09bf('0x29')],'name':_0x4ff5c6[_0x09bf('0x6e')],'custom':_0x4ff5c6[_0x09bf('0x6f')],'options':_0x4ff5c6[_0x09bf('0x70')]['length']>0x0?_['map'](_0x4ff5c6[_0x09bf('0x70')],function(_0x586e89){return{'name':_0x586e89['label'],'value':_0x586e89[_0x09bf('0x71')]};}):_0x4ff5c6['type']=='boolean'?[{'name':'True','value':_0x09bf('0x72')},{'name':'False','value':_0x09bf('0x73')}]:[]};})};}})[_0x09bf('0x26')](respondWithResult(_0x44d09d,null))[_0x09bf('0x45')](function(_0x4b3585){var _0x5475e8=_0x2607be[_0x09bf('0x33')]['test']?0x1f4:_0x4b3585[_0x09bf('0x74')]||0x1f4;logger[_0x09bf('0x75')](_0x09bf('0x76'),_0x09bf('0x54'),_0x5475e8,JSON[_0x09bf('0x77')](_0x4b3585));delete _0x4b3585[_0x09bf('0x29')];if(_0x5475e8===0x191){_0x5475e8=0x190;}_0x44d09d['status'](_0x5475e8)[_0x09bf('0x2a')](_0x2607be[_0x09bf('0x33')]['test']?{'message':'Wrong\x20credentials','statusCode':_0x4b3585[_0x09bf('0x74')]}:_0x4b3585);});}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.model.js b/server/api/intSalesforceAccount/intSalesforceAccount.model.js index 5bcd1f8..ab8f84d 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 _0xb95e=['bluebird','request-promise','rimraf','../../config/environment','./intSalesforceAccount.attributes','../../components/integrations/configuration','define','int_salesforce_accounts','lodash','../../config/logger','api','moment'];(function(_0x1146f7,_0x475356){var _0x2e5725=function(_0x44f2a2){while(--_0x44f2a2){_0x1146f7['push'](_0x1146f7['shift']());}};_0x2e5725(++_0x475356);}(_0xb95e,0x128));var _0xeb95=function(_0x22d25f,_0x4457ec){_0x22d25f=_0x22d25f-0x0;var _0x3c21ed=_0xb95e[_0x22d25f];return _0x3c21ed;};'use strict';var _=require(_0xeb95('0x0'));var util=require('util');var logger=require(_0xeb95('0x1'))(_0xeb95('0x2'));var moment=require(_0xeb95('0x3'));var BPromise=require(_0xeb95('0x4'));var rp=require(_0xeb95('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xeb95('0x6'));var config=require(_0xeb95('0x7'));var attributes=require(_0xeb95('0x8'));var integrations=require(_0xeb95('0x9'));module['exports']=function(_0x2db59f,_0x121b7e){return _0x2db59f[_0xeb95('0xa')]('SalesforceAccount',attributes,{'tableName':_0xeb95('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3c31=['request-promise','path','rimraf','../../config/environment','./intSalesforceAccount.attributes','../../components/integrations/configuration','exports','define','SalesforceAccount','lodash','util','../../config/logger','api','bluebird'];(function(_0x1c1e61,_0x322be4){var _0x321888=function(_0x5a0bce){while(--_0x5a0bce){_0x1c1e61['push'](_0x1c1e61['shift']());}};_0x321888(++_0x322be4);}(_0x3c31,0xb1));var _0x13c3=function(_0x261fd1,_0x4e85cb){_0x261fd1=_0x261fd1-0x0;var _0x1e77fb=_0x3c31[_0x261fd1];return _0x1e77fb;};'use strict';var _=require(_0x13c3('0x0'));var util=require(_0x13c3('0x1'));var logger=require(_0x13c3('0x2'))(_0x13c3('0x3'));var moment=require('moment');var BPromise=require(_0x13c3('0x4'));var rp=require(_0x13c3('0x5'));var fs=require('fs');var path=require(_0x13c3('0x6'));var rimraf=require(_0x13c3('0x7'));var config=require(_0x13c3('0x8'));var attributes=require(_0x13c3('0x9'));var integrations=require(_0x13c3('0xa'));module[_0x13c3('0xb')]=function(_0x178bb8,_0x3c217d){return _0x178bb8[_0x13c3('0xc')](_0x13c3('0xd'),attributes,{'tableName':'int_salesforce_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.rpc.js b/server/api/intSalesforceAccount/intSalesforceAccount.rpc.js index 12dfe2e..fab799d 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 _0x59a1=['attributes','limit','include','map','model','debug','stringify','ShowSalesforceAccount','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','SalesforceAccount,\x20%s,\x20%s,\x20%s','error','SalesforceAccount,\x20%s,\x20%s','message','result','catch','GetSalesforceAccount','SalesforceAccount','findAll','options','raw','where'];(function(_0x38a9e8,_0x1cbb65){var _0x7623f5=function(_0x288fa6){while(--_0x288fa6){_0x38a9e8['push'](_0x38a9e8['shift']());}};_0x7623f5(++_0x1cbb65);}(_0x59a1,0xb7));var _0x159a=function(_0x4d2ea6,_0x11a559){_0x4d2ea6=_0x4d2ea6-0x0;var _0x1f10c3=_0x59a1[_0x4d2ea6];return _0x1f10c3;};'use strict';var _=require(_0x159a('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x159a('0x1'));var rs=require(_0x159a('0x2'));var fs=require('fs');var Redis=require(_0x159a('0x3'));var db=require(_0x159a('0x4'))['db'];var utils=require(_0x159a('0x5'));var logger=require('../../config/logger')(_0x159a('0x6'));var config=require(_0x159a('0x7'));var jayson=require(_0x159a('0x8'));var client=jayson[_0x159a('0x9')][_0x159a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xe736ee,_0x5cedd9,_0x36d24f){return new BPromise(function(_0x42400d,_0x4c44a0){return client[_0x159a('0xb')](_0xe736ee,_0x36d24f)[_0x159a('0xc')](function(_0x14f8f0){logger[_0x159a('0xd')]('SalesforceAccount,\x20%s,\x20%s',_0x5cedd9,_0x159a('0xe'));logger['debug'](_0x159a('0xf'),_0x5cedd9,'request\x20sent',JSON['stringify'](_0x14f8f0));if(_0x14f8f0[_0x159a('0x10')]){if(_0x14f8f0[_0x159a('0x10')]['code']===0x1f4){logger[_0x159a('0x10')](_0x159a('0x11'),_0x5cedd9,_0x14f8f0['error'][_0x159a('0x12')]);return _0x4c44a0(_0x14f8f0['error'][_0x159a('0x12')]);}logger[_0x159a('0x10')](_0x159a('0x11'),_0x5cedd9,_0x14f8f0[_0x159a('0x10')]['message']);return _0x42400d(_0x14f8f0[_0x159a('0x10')][_0x159a('0x12')]);}else{logger[_0x159a('0xd')](_0x159a('0x11'),_0x5cedd9,_0x159a('0xe'));_0x42400d(_0x14f8f0[_0x159a('0x13')][_0x159a('0x12')]);}})[_0x159a('0x14')](function(_0x526307){logger[_0x159a('0x10')](_0x159a('0x11'),_0x5cedd9,_0x526307);_0x4c44a0(_0x526307);});});}exports[_0x159a('0x15')]=function(_0x41a600){var _0xe9ca8d=this;return new Promise(function(_0x441c09,_0x223d2b){return db[_0x159a('0x16')][_0x159a('0x17')]({'raw':_0x41a600[_0x159a('0x18')]?_0x41a600['options'][_0x159a('0x19')]===undefined?!![]:![]:!![],'where':_0x41a600[_0x159a('0x18')]?_0x41a600['options'][_0x159a('0x1a')]||null:null,'attributes':_0x41a600[_0x159a('0x18')]?_0x41a600['options'][_0x159a('0x1b')]||null:null,'limit':_0x41a600['options']?_0x41a600[_0x159a('0x18')][_0x159a('0x1c')]||null:null,'include':_0x41a600[_0x159a('0x18')]?_0x41a600[_0x159a('0x18')][_0x159a('0x1d')]?_[_0x159a('0x1e')](_0x41a600[_0x159a('0x18')][_0x159a('0x1d')],function(_0xbe33eb){return{'model':db[_0xbe33eb[_0x159a('0x1f')]],'as':_0xbe33eb['as'],'attributes':_0xbe33eb['attributes'],'include':_0xbe33eb[_0x159a('0x1d')]?_[_0x159a('0x1e')](_0xbe33eb[_0x159a('0x1d')],function(_0xd8b0e1){return{'model':db[_0xd8b0e1[_0x159a('0x1f')]],'as':_0xd8b0e1['as'],'attributes':_0xd8b0e1[_0x159a('0x1b')],'include':_0xd8b0e1[_0x159a('0x1d')]?_[_0x159a('0x1e')](_0xd8b0e1[_0x159a('0x1d')],function(_0x43c814){return{'model':db[_0x43c814[_0x159a('0x1f')]],'as':_0x43c814['as'],'attributes':_0x43c814[_0x159a('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x159a('0xc')](function(_0x261e49){logger[_0x159a('0xd')](_0x159a('0x15'),_0x41a600);logger[_0x159a('0x20')](_0x159a('0x15'),_0x41a600,JSON[_0x159a('0x21')](_0x261e49));_0x441c09(_0x261e49);})[_0x159a('0x14')](function(_0x210a19){logger[_0x159a('0x10')]('GetSalesforceAccount',_0x210a19[_0x159a('0x12')],_0x41a600);_0x223d2b(_0xe9ca8d[_0x159a('0x10')](0x1f4,_0x210a19[_0x159a('0x12')]));});});};exports[_0x159a('0x22')]=function(_0x19fa1d){var _0xa11899=this;return new Promise(function(_0x1c8902,_0x1bc1b8){return db[_0x159a('0x16')]['find']({'raw':_0x19fa1d[_0x159a('0x18')]?_0x19fa1d[_0x159a('0x18')][_0x159a('0x19')]===undefined?!![]:![]:!![],'where':_0x19fa1d['options']?_0x19fa1d[_0x159a('0x18')][_0x159a('0x1a')]||null:null,'attributes':_0x19fa1d[_0x159a('0x18')]?_0x19fa1d[_0x159a('0x18')][_0x159a('0x1b')]||null:null,'include':_0x19fa1d[_0x159a('0x18')]?_0x19fa1d[_0x159a('0x18')][_0x159a('0x1d')]?_['map'](_0x19fa1d[_0x159a('0x18')][_0x159a('0x1d')],function(_0x3d4764){return{'model':db[_0x3d4764[_0x159a('0x1f')]],'as':_0x3d4764['as'],'attributes':_0x3d4764[_0x159a('0x1b')],'include':_0x3d4764[_0x159a('0x1d')]?_['map'](_0x3d4764['include'],function(_0x32fe87){return{'model':db[_0x32fe87['model']],'as':_0x32fe87['as'],'attributes':_0x32fe87[_0x159a('0x1b')],'include':_0x32fe87[_0x159a('0x1d')]?_['map'](_0x32fe87[_0x159a('0x1d')],function(_0x16bab6){return{'model':db[_0x16bab6[_0x159a('0x1f')]],'as':_0x16bab6['as'],'attributes':_0x16bab6[_0x159a('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x159a('0xc')](function(_0x539e48){logger['info'](_0x159a('0x22'),_0x19fa1d);logger[_0x159a('0x20')](_0x159a('0x22'),_0x19fa1d,JSON[_0x159a('0x21')](_0x539e48));_0x1c8902(_0x539e48);})['catch'](function(_0x4986b2){logger[_0x159a('0x10')](_0x159a('0x22'),_0x4986b2[_0x159a('0x12')],_0x19fa1d);_0x1bc1b8(_0xa11899[_0x159a('0x10')](0x1f4,_0x4986b2[_0x159a('0x12')]));});});}; \ No newline at end of file +var _0xac1e=['message','SalesforceAccount,\x20%s,\x20%s','result','catch','GetSalesforceAccount','SalesforceAccount','findAll','options','raw','attributes','limit','include','map','stringify','ShowSalesforceAccount','find','where','model','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request','then','info','request\x20sent','debug','error'];(function(_0xd511d,_0x3546b9){var _0x3f148e=function(_0x51f35f){while(--_0x51f35f){_0xd511d['push'](_0xd511d['shift']());}};_0x3f148e(++_0x3546b9);}(_0xac1e,0x10e));var _0xeac1=function(_0x3d037c,_0x17b0df){_0x3d037c=_0x3d037c-0x0;var _0x369daf=_0xac1e[_0x3d037c];return _0x369daf;};'use strict';var _=require(_0xeac1('0x0'));var util=require(_0xeac1('0x1'));var moment=require(_0xeac1('0x2'));var BPromise=require(_0xeac1('0x3'));var rs=require(_0xeac1('0x4'));var fs=require('fs');var Redis=require(_0xeac1('0x5'));var db=require(_0xeac1('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xeac1('0x7'))(_0xeac1('0x8'));var config=require('../../config/environment');var jayson=require(_0xeac1('0x9'));var client=jayson[_0xeac1('0xa')][_0xeac1('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2b0531,_0x852cef,_0x53d9ca){return new BPromise(function(_0x1fc033,_0x244faf){return client[_0xeac1('0xc')](_0x2b0531,_0x53d9ca)[_0xeac1('0xd')](function(_0x19bfb4){logger[_0xeac1('0xe')]('SalesforceAccount,\x20%s,\x20%s',_0x852cef,_0xeac1('0xf'));logger[_0xeac1('0x10')]('SalesforceAccount,\x20%s,\x20%s,\x20%s',_0x852cef,_0xeac1('0xf'),JSON['stringify'](_0x19bfb4));if(_0x19bfb4[_0xeac1('0x11')]){if(_0x19bfb4[_0xeac1('0x11')]['code']===0x1f4){logger['error']('SalesforceAccount,\x20%s,\x20%s',_0x852cef,_0x19bfb4[_0xeac1('0x11')]['message']);return _0x244faf(_0x19bfb4['error'][_0xeac1('0x12')]);}logger[_0xeac1('0x11')](_0xeac1('0x13'),_0x852cef,_0x19bfb4[_0xeac1('0x11')][_0xeac1('0x12')]);return _0x1fc033(_0x19bfb4[_0xeac1('0x11')][_0xeac1('0x12')]);}else{logger['info']('SalesforceAccount,\x20%s,\x20%s',_0x852cef,_0xeac1('0xf'));_0x1fc033(_0x19bfb4[_0xeac1('0x14')][_0xeac1('0x12')]);}})[_0xeac1('0x15')](function(_0x5b4f17){logger['error'](_0xeac1('0x13'),_0x852cef,_0x5b4f17);_0x244faf(_0x5b4f17);});});}exports[_0xeac1('0x16')]=function(_0x1ccaaa){var _0x411e7a=this;return new Promise(function(_0x34ca3b,_0x2ea0fb){return db[_0xeac1('0x17')][_0xeac1('0x18')]({'raw':_0x1ccaaa[_0xeac1('0x19')]?_0x1ccaaa[_0xeac1('0x19')][_0xeac1('0x1a')]===undefined?!![]:![]:!![],'where':_0x1ccaaa['options']?_0x1ccaaa[_0xeac1('0x19')]['where']||null:null,'attributes':_0x1ccaaa['options']?_0x1ccaaa['options'][_0xeac1('0x1b')]||null:null,'limit':_0x1ccaaa[_0xeac1('0x19')]?_0x1ccaaa[_0xeac1('0x19')][_0xeac1('0x1c')]||null:null,'include':_0x1ccaaa[_0xeac1('0x19')]?_0x1ccaaa['options'][_0xeac1('0x1d')]?_[_0xeac1('0x1e')](_0x1ccaaa['options'][_0xeac1('0x1d')],function(_0x43d0f7){return{'model':db[_0x43d0f7['model']],'as':_0x43d0f7['as'],'attributes':_0x43d0f7[_0xeac1('0x1b')],'include':_0x43d0f7[_0xeac1('0x1d')]?_[_0xeac1('0x1e')](_0x43d0f7[_0xeac1('0x1d')],function(_0x2818b0){return{'model':db[_0x2818b0['model']],'as':_0x2818b0['as'],'attributes':_0x2818b0[_0xeac1('0x1b')],'include':_0x2818b0[_0xeac1('0x1d')]?_[_0xeac1('0x1e')](_0x2818b0['include'],function(_0x485891){return{'model':db[_0x485891['model']],'as':_0x485891['as'],'attributes':_0x485891['attributes']};}):[]};}):[]};}):[]:[]})[_0xeac1('0xd')](function(_0x1eb31e){logger[_0xeac1('0xe')](_0xeac1('0x16'),_0x1ccaaa);logger[_0xeac1('0x10')](_0xeac1('0x16'),_0x1ccaaa,JSON[_0xeac1('0x1f')](_0x1eb31e));_0x34ca3b(_0x1eb31e);})[_0xeac1('0x15')](function(_0x33a806){logger[_0xeac1('0x11')](_0xeac1('0x16'),_0x33a806['message'],_0x1ccaaa);_0x2ea0fb(_0x411e7a[_0xeac1('0x11')](0x1f4,_0x33a806[_0xeac1('0x12')]));});});};exports[_0xeac1('0x20')]=function(_0x411a32){var _0x45744f=this;return new Promise(function(_0xa0926f,_0x465265){return db[_0xeac1('0x17')][_0xeac1('0x21')]({'raw':_0x411a32[_0xeac1('0x19')]?_0x411a32['options'][_0xeac1('0x1a')]===undefined?!![]:![]:!![],'where':_0x411a32['options']?_0x411a32[_0xeac1('0x19')][_0xeac1('0x22')]||null:null,'attributes':_0x411a32[_0xeac1('0x19')]?_0x411a32['options'][_0xeac1('0x1b')]||null:null,'include':_0x411a32[_0xeac1('0x19')]?_0x411a32['options'][_0xeac1('0x1d')]?_['map'](_0x411a32[_0xeac1('0x19')][_0xeac1('0x1d')],function(_0x3d4e38){return{'model':db[_0x3d4e38[_0xeac1('0x23')]],'as':_0x3d4e38['as'],'attributes':_0x3d4e38[_0xeac1('0x1b')],'include':_0x3d4e38[_0xeac1('0x1d')]?_['map'](_0x3d4e38['include'],function(_0x1a945b){return{'model':db[_0x1a945b['model']],'as':_0x1a945b['as'],'attributes':_0x1a945b[_0xeac1('0x1b')],'include':_0x1a945b[_0xeac1('0x1d')]?_[_0xeac1('0x1e')](_0x1a945b[_0xeac1('0x1d')],function(_0x166a24){return{'model':db[_0x166a24['model']],'as':_0x166a24['as'],'attributes':_0x166a24[_0xeac1('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xeac1('0xd')](function(_0x4b3c37){logger[_0xeac1('0xe')](_0xeac1('0x20'),_0x411a32);logger[_0xeac1('0x10')](_0xeac1('0x20'),_0x411a32,JSON[_0xeac1('0x1f')](_0x4b3c37));_0xa0926f(_0x4b3c37);})[_0xeac1('0x15')](function(_0x363bdb){logger[_0xeac1('0x11')]('ShowSalesforceAccount',_0x363bdb[_0xeac1('0x12')],_0x411a32);_0x465265(_0x45744f[_0xeac1('0x11')](0x1f4,_0x363bdb[_0xeac1('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/index.js b/server/api/intSalesforceConfiguration/index.js index 25b0e2d..eae74dd 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 _0xdb28=['path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','post','create','put','delete','destroy','exports','multer','util'];(function(_0x243b59,_0x3f9495){var _0x3e1676=function(_0x354052){while(--_0x354052){_0x243b59['push'](_0x243b59['shift']());}};_0x3e1676(++_0x3f9495);}(_0xdb28,0x106));var _0x8db2=function(_0x561d0e,_0xa3f21){_0x561d0e=_0x561d0e-0x0;var _0x53cfc9=_0xdb28[_0x561d0e];return _0x53cfc9;};'use strict';var multer=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var path=require(_0x8db2('0x2'));var timeout=require(_0x8db2('0x3'));var express=require('express');var router=express[_0x8db2('0x4')]();var fs_extra=require(_0x8db2('0x5'));var auth=require(_0x8db2('0x6'));var interaction=require(_0x8db2('0x7'));var config=require(_0x8db2('0x8'));var controller=require('./intSalesforceConfiguration.controller');router[_0x8db2('0x9')]('/',auth[_0x8db2('0xa')](),controller['index']);router['get'](_0x8db2('0xb'),auth[_0x8db2('0xa')](),controller[_0x8db2('0xc')]);router[_0x8db2('0x9')](_0x8db2('0xd'),auth[_0x8db2('0xa')](),controller[_0x8db2('0xe')]);router['get'](_0x8db2('0xf'),auth[_0x8db2('0xa')](),controller[_0x8db2('0x10')]);router['get'](_0x8db2('0x11'),auth[_0x8db2('0xa')](),controller['getDescriptions']);router[_0x8db2('0x12')]('/',auth[_0x8db2('0xa')](),controller[_0x8db2('0x13')]);router[_0x8db2('0x14')](_0x8db2('0xb'),auth['isAuthenticated'](),controller['update']);router[_0x8db2('0x15')](_0x8db2('0xb'),auth[_0x8db2('0xa')](),controller[_0x8db2('0x16')]);module[_0x8db2('0x17')]=router; \ No newline at end of file +var _0x0b0e=['post','create','put','/:id','update','destroy','exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSalesforceConfiguration.controller','get','isAuthenticated','index','show','/:id/fields','/:id/subjects','getSubjects','getDescriptions'];(function(_0x541ea6,_0x51cab6){var _0x3c3e84=function(_0xc06bed){while(--_0xc06bed){_0x541ea6['push'](_0x541ea6['shift']());}};_0x3c3e84(++_0x51cab6);}(_0x0b0e,0x187));var _0xe0b0=function(_0x4ff09b,_0x53f67d){_0x4ff09b=_0x4ff09b-0x0;var _0x3f5c2e=_0x0b0e[_0x4ff09b];return _0x3f5c2e;};'use strict';var multer=require(_0xe0b0('0x0'));var util=require('util');var path=require(_0xe0b0('0x1'));var timeout=require('connect-timeout');var express=require(_0xe0b0('0x2'));var router=express[_0xe0b0('0x3')]();var fs_extra=require(_0xe0b0('0x4'));var auth=require(_0xe0b0('0x5'));var interaction=require(_0xe0b0('0x6'));var config=require(_0xe0b0('0x7'));var controller=require(_0xe0b0('0x8'));router[_0xe0b0('0x9')]('/',auth[_0xe0b0('0xa')](),controller[_0xe0b0('0xb')]);router[_0xe0b0('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xe0b0('0xc')]);router[_0xe0b0('0x9')](_0xe0b0('0xd'),auth[_0xe0b0('0xa')](),controller['getFields']);router[_0xe0b0('0x9')](_0xe0b0('0xe'),auth['isAuthenticated'](),controller[_0xe0b0('0xf')]);router[_0xe0b0('0x9')]('/:id/descriptions',auth[_0xe0b0('0xa')](),controller[_0xe0b0('0x10')]);router[_0xe0b0('0x11')]('/',auth['isAuthenticated'](),controller[_0xe0b0('0x12')]);router[_0xe0b0('0x13')](_0xe0b0('0x14'),auth[_0xe0b0('0xa')](),controller[_0xe0b0('0x15')]);router['delete'](_0xe0b0('0x14'),auth[_0xe0b0('0xa')](),controller[_0xe0b0('0x16')]);module[_0xe0b0('0x17')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js index 1b8102d..a161e48 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 _0x235a=['ENUM','Case','Task','contact_lead','contact','lead','account_contact_lead','account','sequelize','STRING'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x235a,0x1d4));var _0xa235=function(_0x7705e6,_0x49e592){_0x7705e6=_0x7705e6-0x0;var _0x3a797d=_0x235a[_0x7705e6];return _0x3a797d;};'use strict';var Sequelize=require(_0xa235('0x0'));module['exports']={'name':{'type':Sequelize[_0xa235('0x1')]},'description':{'type':Sequelize['STRING']},'ticketType':{'type':Sequelize[_0xa235('0x2')]('Task',_0xa235('0x3')),'defaultValue':_0xa235('0x4')},'moduleSearch':{'type':Sequelize['ENUM'](_0xa235('0x5'),_0xa235('0x6'),_0xa235('0x7'),_0xa235('0x8'),_0xa235('0x9')),'defaultValue':_0xa235('0x5')},'moduleCreate':{'type':Sequelize['ENUM']('nothing',_0xa235('0x6'),'lead',_0xa235('0x9')),'defaultValue':'lead'},'leadId':{'type':Sequelize[_0xa235('0x1')]},'additionalSearchAccount':{'type':Sequelize[_0xa235('0x1')]},'additionalSearchContact':{'type':Sequelize[_0xa235('0x1')]},'additionalSearchLead':{'type':Sequelize[_0xa235('0x1')]}}; \ No newline at end of file +var _0xec64=['account_contact_lead','account','contact_lead','nothing','sequelize','STRING','ENUM','Task','Case','contact','lead'];(function(_0x57a6e5,_0x57d7e9){var _0x540d07=function(_0x5d216b){while(--_0x5d216b){_0x57a6e5['push'](_0x57a6e5['shift']());}};_0x540d07(++_0x57d7e9);}(_0xec64,0x88));var _0x4ec6=function(_0x2064e5,_0x4f6fa2){_0x2064e5=_0x2064e5-0x0;var _0x21a233=_0xec64[_0x2064e5];return _0x21a233;};'use strict';var Sequelize=require(_0x4ec6('0x0'));module['exports']={'name':{'type':Sequelize[_0x4ec6('0x1')]},'description':{'type':Sequelize[_0x4ec6('0x1')]},'ticketType':{'type':Sequelize[_0x4ec6('0x2')](_0x4ec6('0x3'),_0x4ec6('0x4')),'defaultValue':_0x4ec6('0x3')},'moduleSearch':{'type':Sequelize[_0x4ec6('0x2')]('contact_lead',_0x4ec6('0x5'),_0x4ec6('0x6'),_0x4ec6('0x7'),_0x4ec6('0x8')),'defaultValue':_0x4ec6('0x9')},'moduleCreate':{'type':Sequelize[_0x4ec6('0x2')](_0x4ec6('0xa'),_0x4ec6('0x5'),'lead',_0x4ec6('0x8')),'defaultValue':_0x4ec6('0x6')},'leadId':{'type':Sequelize['STRING']},'additionalSearchAccount':{'type':Sequelize[_0x4ec6('0x1')]},'additionalSearchContact':{'type':Sequelize['STRING']},'additionalSearchLead':{'type':Sequelize[_0x4ec6('0x1')]}}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js index 02c9a67..a046bc2 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 _0x4f05=['eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','sox','ejs','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','end','status','json','limit','count','offset','set','Content-Range','apply','reject','destroy','then','error','stack','name','index','map','SalesforceConfiguration','rawAttributes','fieldName','type','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','VIRTUAL','filter','merge','includeAll','include','findAll','catch','show','params','keys','options','create','body','find','getFields','findOne','SalesforceField','order','getSubjects','getDescriptions'];(function(_0x3cdb09,_0x176579){var _0x21479e=function(_0x531a89){while(--_0x531a89){_0x3cdb09['push'](_0x3cdb09['shift']());}};_0x21479e(++_0x176579);}(_0x4f05,0x138));var _0x54f0=function(_0x465a0c,_0x19d4d5){_0x465a0c=_0x465a0c-0x0;var _0x1e202e=_0x4f05[_0x465a0c];return _0x1e202e;};'use strict';var emlformat=require(_0x54f0('0x0'));var rimraf=require(_0x54f0('0x1'));var zipdir=require(_0x54f0('0x2'));var jsonpatch=require(_0x54f0('0x3'));var rp=require(_0x54f0('0x4'));var moment=require('moment');var BPromise=require(_0x54f0('0x5'));var Mustache=require('mustache');var util=require(_0x54f0('0x6'));var path=require('path');var sox=require(_0x54f0('0x7'));var csv=require('to-csv');var ejs=require(_0x54f0('0x8'));var fs=require('fs');var fs_extra=require(_0x54f0('0x9'));var _=require(_0x54f0('0xa'));var squel=require('squel');var crypto=require(_0x54f0('0xb'));var jsforce=require(_0x54f0('0xc'));var deskjs=require(_0x54f0('0xd'));var toCsv=require(_0x54f0('0xe'));var querystring=require(_0x54f0('0xf'));var Papa=require(_0x54f0('0x10'));var Redis=require('ioredis');var authService=require(_0x54f0('0x11'));var qs=require(_0x54f0('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x54f0('0x13'));var logger=require(_0x54f0('0x14'))(_0x54f0('0x15'));var utils=require(_0x54f0('0x16'));var config=require(_0x54f0('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3eaaaf,_0x1d2e7d){_0x1d2e7d=_0x1d2e7d||0xcc;return function(_0xe4549b){if(_0xe4549b){return _0x3eaaaf[_0x54f0('0x18')](_0x1d2e7d);}return _0x3eaaaf['status'](_0x1d2e7d)[_0x54f0('0x19')]();};}function respondWithResult(_0x35bc43,_0x430878){_0x430878=_0x430878||0xc8;return function(_0x14204c){if(_0x14204c){return _0x35bc43[_0x54f0('0x1a')](_0x430878)[_0x54f0('0x1b')](_0x14204c);}};}function respondWithFilteredResult(_0x3cbca3,_0x304af4){return function(_0x750aac){if(_0x750aac){var _0x48c133=typeof _0x304af4['offset']==='undefined'&&typeof _0x304af4[_0x54f0('0x1c')]==='undefined';var _0x224758=_0x750aac[_0x54f0('0x1d')];var _0x58fc7e=_0x48c133?0x0:_0x304af4[_0x54f0('0x1e')];var _0x580c81=_0x48c133?_0x750aac[_0x54f0('0x1d')]:_0x304af4[_0x54f0('0x1e')]+_0x304af4['limit'];var _0x548a6e;if(_0x580c81>=_0x224758){_0x580c81=_0x224758;_0x548a6e=0xc8;}else{_0x548a6e=0xce;}_0x3cbca3['status'](_0x548a6e);return _0x3cbca3[_0x54f0('0x1f')](_0x54f0('0x20'),_0x58fc7e+'-'+_0x580c81+'/'+_0x224758)[_0x54f0('0x1b')](_0x750aac);}return null;};}function patchUpdates(_0x24cfc9){return function(_0x527d4f){try{jsonpatch[_0x54f0('0x21')](_0x527d4f,_0x24cfc9,!![]);}catch(_0x45bb5b){return BPromise[_0x54f0('0x22')](_0x45bb5b);}return _0x527d4f['save']();};}function saveUpdates(_0x26ae20,_0x4a2cf3){return function(_0xd3562d){if(_0xd3562d){return _0xd3562d['update'](_0x26ae20)['then'](function(_0x471ae5){return _0x471ae5;});}return null;};}function removeEntity(_0x342ad2,_0xb70533){return function(_0x4855a9){if(_0x4855a9){return _0x4855a9[_0x54f0('0x23')]()[_0x54f0('0x24')](function(){_0x342ad2[_0x54f0('0x1a')](0xcc)[_0x54f0('0x19')]();});}};}function handleEntityNotFound(_0x1b7422,_0x432eac){return function(_0x4a8e38){if(!_0x4a8e38){_0x1b7422[_0x54f0('0x18')](0x194);}return _0x4a8e38;};}function handleError(_0x130894,_0x499754){_0x499754=_0x499754||0x1f4;return function(_0x41fef3){logger[_0x54f0('0x25')](_0x41fef3[_0x54f0('0x26')]);if(_0x41fef3['name']){delete _0x41fef3[_0x54f0('0x27')];}_0x130894[_0x54f0('0x1a')](_0x499754)['send'](_0x41fef3);};}exports[_0x54f0('0x28')]=function(_0x50382a,_0x582e74){var _0x5abd89={},_0x4aa2e1={},_0x3ff28d={'count':0x0,'rows':[]};var _0x1fee51=_[_0x54f0('0x29')](db[_0x54f0('0x2a')][_0x54f0('0x2b')],function(_0xb8439b){return{'name':_0xb8439b[_0x54f0('0x2c')],'type':_0xb8439b[_0x54f0('0x2d')]['key']};});_0x4aa2e1[_0x54f0('0x2e')]=_['map'](_0x1fee51,_0x54f0('0x27'));_0x4aa2e1[_0x54f0('0x2f')]=_['keys'](_0x50382a[_0x54f0('0x2f')]);_0x4aa2e1[_0x54f0('0x30')]=_[_0x54f0('0x31')](_0x4aa2e1[_0x54f0('0x2e')],_0x4aa2e1[_0x54f0('0x2f')]);_0x5abd89[_0x54f0('0x32')]=_[_0x54f0('0x31')](_0x4aa2e1['model'],qs['fields'](_0x50382a['query'][_0x54f0('0x33')]));_0x5abd89['attributes']=_0x5abd89[_0x54f0('0x32')][_0x54f0('0x34')]?_0x5abd89['attributes']:_0x4aa2e1[_0x54f0('0x2e')];if(!_0x50382a[_0x54f0('0x2f')][_0x54f0('0x35')](_0x54f0('0x36'))){_0x5abd89[_0x54f0('0x1c')]=qs[_0x54f0('0x1c')](_0x50382a[_0x54f0('0x2f')][_0x54f0('0x1c')]);_0x5abd89[_0x54f0('0x1e')]=qs[_0x54f0('0x1e')](_0x50382a[_0x54f0('0x2f')][_0x54f0('0x1e')]);}_0x5abd89['order']=qs['sort'](_0x50382a[_0x54f0('0x2f')][_0x54f0('0x37')]);_0x5abd89[_0x54f0('0x38')]=qs[_0x54f0('0x30')](_[_0x54f0('0x39')](_0x50382a['query'],_0x4aa2e1[_0x54f0('0x30')]),_0x1fee51);if(_0x50382a[_0x54f0('0x2f')]['filter']){_0x5abd89[_0x54f0('0x38')]=_['merge'](_0x5abd89[_0x54f0('0x38')],{'$or':_['map'](_0x1fee51,function(_0x98c5c4){if(_0x98c5c4[_0x54f0('0x2d')]!==_0x54f0('0x3a')){var _0x41bc3f={};_0x41bc3f[_0x98c5c4[_0x54f0('0x27')]]={'$like':'%'+_0x50382a[_0x54f0('0x2f')][_0x54f0('0x3b')]+'%'};return _0x41bc3f;}})});}_0x5abd89=_[_0x54f0('0x3c')]({},_0x5abd89,_0x50382a['options']);var _0x4aecef={'where':_0x5abd89['where']};return db['SalesforceConfiguration'][_0x54f0('0x1d')](_0x4aecef)[_0x54f0('0x24')](function(_0x48324b){_0x3ff28d[_0x54f0('0x1d')]=_0x48324b;if(_0x50382a['query'][_0x54f0('0x3d')]){_0x5abd89[_0x54f0('0x3e')]=[{'all':!![]}];}return db['SalesforceConfiguration'][_0x54f0('0x3f')](_0x5abd89);})[_0x54f0('0x24')](function(_0x5ad9ee){_0x3ff28d['rows']=_0x5ad9ee;return _0x3ff28d;})['then'](respondWithFilteredResult(_0x582e74,_0x5abd89))[_0x54f0('0x40')](handleError(_0x582e74,null));};exports[_0x54f0('0x41')]=function(_0x4a2f94,_0x2d6486){var _0x52cebc={'raw':![],'where':{'id':_0x4a2f94[_0x54f0('0x42')]['id']}},_0x211b98={};_0x211b98[_0x54f0('0x2e')]=_[_0x54f0('0x43')](db['SalesforceConfiguration'][_0x54f0('0x2b')]);_0x211b98[_0x54f0('0x2f')]=_['keys'](_0x4a2f94['query']);_0x211b98['filters']=_['intersection'](_0x211b98[_0x54f0('0x2e')],_0x211b98[_0x54f0('0x2f')]);_0x52cebc['attributes']=_['intersection'](_0x211b98[_0x54f0('0x2e')],qs['fields'](_0x4a2f94[_0x54f0('0x2f')]['fields']));_0x52cebc['attributes']=_0x52cebc[_0x54f0('0x32')][_0x54f0('0x34')]?_0x52cebc[_0x54f0('0x32')]:_0x211b98[_0x54f0('0x2e')];if(_0x4a2f94[_0x54f0('0x2f')][_0x54f0('0x3d')]){_0x52cebc['include']=[{'all':!![]}];}_0x52cebc=_[_0x54f0('0x3c')]({},_0x52cebc,_0x4a2f94[_0x54f0('0x44')]);return db['SalesforceConfiguration']['find'](_0x52cebc)['then'](handleEntityNotFound(_0x2d6486,null))['then'](respondWithResult(_0x2d6486,null))[_0x54f0('0x40')](handleError(_0x2d6486,null));};exports[_0x54f0('0x45')]=function(_0x11ae70,_0x48d997){return db[_0x54f0('0x2a')][_0x54f0('0x45')](_0x11ae70[_0x54f0('0x46')],{})[_0x54f0('0x24')](respondWithResult(_0x48d997,0xc9))[_0x54f0('0x40')](handleError(_0x48d997,null));};exports['update']=function(_0x564bf5,_0x19dc2e){if(_0x564bf5['body']['id']){delete _0x564bf5['body']['id'];}return db[_0x54f0('0x2a')]['find']({'where':{'id':_0x564bf5[_0x54f0('0x42')]['id']}})[_0x54f0('0x24')](handleEntityNotFound(_0x19dc2e,null))[_0x54f0('0x24')](saveUpdates(_0x564bf5['body'],null))[_0x54f0('0x24')](respondWithResult(_0x19dc2e,null))[_0x54f0('0x40')](handleError(_0x19dc2e,null));};exports[_0x54f0('0x23')]=function(_0xc785db,_0x29da11){return db[_0x54f0('0x2a')][_0x54f0('0x47')]({'where':{'id':_0xc785db[_0x54f0('0x42')]['id']}})[_0x54f0('0x24')](handleEntityNotFound(_0x29da11,null))['then'](removeEntity(_0x29da11,null))[_0x54f0('0x40')](handleError(_0x29da11,null));};exports[_0x54f0('0x48')]=function(_0x5e7442,_0xdd2541,_0x1ec05a){var _0x4a6763={};var _0x360034={};var _0x2d6bf0;var _0x539d8f;return db['SalesforceConfiguration'][_0x54f0('0x49')]({'where':{'id':_0x5e7442[_0x54f0('0x42')]['id']}})['then'](handleEntityNotFound(_0xdd2541,null))['then'](function(_0x27b000){if(_0x27b000){_0x2d6bf0=_0x27b000;_0x360034['model']=_[_0x54f0('0x43')](db[_0x54f0('0x4a')][_0x54f0('0x2b')]);_0x360034[_0x54f0('0x2f')]=_[_0x54f0('0x43')](_0x5e7442[_0x54f0('0x2f')]);_0x360034[_0x54f0('0x30')]=_[_0x54f0('0x31')](_0x360034[_0x54f0('0x2e')],_0x360034[_0x54f0('0x2f')]);_0x4a6763[_0x54f0('0x32')]=_[_0x54f0('0x31')](_0x360034[_0x54f0('0x2e')],qs[_0x54f0('0x33')](_0x5e7442[_0x54f0('0x2f')][_0x54f0('0x33')]));_0x4a6763[_0x54f0('0x32')]=_0x4a6763['attributes'][_0x54f0('0x34')]?_0x4a6763['attributes']:_0x360034[_0x54f0('0x2e')];_0x4a6763[_0x54f0('0x4b')]=qs[_0x54f0('0x37')](_0x5e7442['query'][_0x54f0('0x37')]);_0x4a6763['where']=qs[_0x54f0('0x30')](_['pick'](_0x5e7442['query'],_0x360034[_0x54f0('0x30')]));if(_0x5e7442['query'][_0x54f0('0x3b')]){_0x4a6763[_0x54f0('0x38')]=_[_0x54f0('0x3c')](_0x4a6763[_0x54f0('0x38')],{'$or':_['map'](_0x4a6763[_0x54f0('0x32')],function(_0x17c700){var _0x255200={};_0x255200[_0x17c700]={'$like':'%'+_0x5e7442[_0x54f0('0x2f')][_0x54f0('0x3b')]+'%'};return _0x255200;})});}_0x4a6763=_[_0x54f0('0x3c')]({},_0x4a6763,_0x5e7442[_0x54f0('0x44')]);return _0x2d6bf0[_0x54f0('0x48')](_0x4a6763);}})[_0x54f0('0x24')](function(_0x2bc6be){if(_0x2bc6be){_0x539d8f=_0x2bc6be[_0x54f0('0x34')];if(!_0x5e7442[_0x54f0('0x2f')]['hasOwnProperty'](_0x54f0('0x36'))){_0x4a6763[_0x54f0('0x1c')]=qs['limit'](_0x5e7442[_0x54f0('0x2f')]['limit']);_0x4a6763[_0x54f0('0x1e')]=qs[_0x54f0('0x1e')](_0x5e7442['query'][_0x54f0('0x1e')]);}return _0x2d6bf0[_0x54f0('0x48')](_0x4a6763);}})['then'](function(_0x71926b){if(_0x71926b){return _0x71926b?{'count':_0x539d8f,'rows':_0x71926b}:null;}})['then'](respondWithResult(_0xdd2541,null))[_0x54f0('0x40')](handleError(_0xdd2541,null));};exports['getSubjects']=function(_0x13223a,_0x50f6d3,_0x254b41){var _0x59c3fa={};var _0x3ae109={};var _0x6e808e;var _0x27dd9a;return db[_0x54f0('0x2a')]['findOne']({'where':{'id':_0x13223a[_0x54f0('0x42')]['id']}})['then'](handleEntityNotFound(_0x50f6d3,null))[_0x54f0('0x24')](function(_0x237092){if(_0x237092){_0x6e808e=_0x237092;_0x3ae109[_0x54f0('0x2e')]=_[_0x54f0('0x43')](db[_0x54f0('0x4a')]['rawAttributes']);_0x3ae109['query']=_['keys'](_0x13223a['query']);_0x3ae109[_0x54f0('0x30')]=_[_0x54f0('0x31')](_0x3ae109[_0x54f0('0x2e')],_0x3ae109[_0x54f0('0x2f')]);_0x59c3fa[_0x54f0('0x32')]=_['intersection'](_0x3ae109['model'],qs['fields'](_0x13223a['query'][_0x54f0('0x33')]));_0x59c3fa[_0x54f0('0x32')]=_0x59c3fa['attributes']['length']?_0x59c3fa['attributes']:_0x3ae109[_0x54f0('0x2e')];_0x59c3fa[_0x54f0('0x4b')]=qs[_0x54f0('0x37')](_0x13223a[_0x54f0('0x2f')][_0x54f0('0x37')]);_0x59c3fa[_0x54f0('0x38')]=qs[_0x54f0('0x30')](_[_0x54f0('0x39')](_0x13223a[_0x54f0('0x2f')],_0x3ae109[_0x54f0('0x30')]));if(_0x13223a[_0x54f0('0x2f')][_0x54f0('0x3b')]){_0x59c3fa[_0x54f0('0x38')]=_['merge'](_0x59c3fa['where'],{'$or':_[_0x54f0('0x29')](_0x59c3fa[_0x54f0('0x32')],function(_0x6fc343){var _0x26eed6={};_0x26eed6[_0x6fc343]={'$like':'%'+_0x13223a['query'][_0x54f0('0x3b')]+'%'};return _0x26eed6;})});}_0x59c3fa=_[_0x54f0('0x3c')]({},_0x59c3fa,_0x13223a[_0x54f0('0x44')]);return _0x6e808e[_0x54f0('0x4c')](_0x59c3fa);}})[_0x54f0('0x24')](function(_0x5c4276){if(_0x5c4276){_0x27dd9a=_0x5c4276[_0x54f0('0x34')];if(!_0x13223a[_0x54f0('0x2f')][_0x54f0('0x35')]('nolimit')){_0x59c3fa[_0x54f0('0x1c')]=qs[_0x54f0('0x1c')](_0x13223a['query'][_0x54f0('0x1c')]);_0x59c3fa[_0x54f0('0x1e')]=qs[_0x54f0('0x1e')](_0x13223a[_0x54f0('0x2f')]['offset']);}return _0x6e808e[_0x54f0('0x4c')](_0x59c3fa);}})[_0x54f0('0x24')](function(_0x1c6cc7){if(_0x1c6cc7){return _0x1c6cc7?{'count':_0x27dd9a,'rows':_0x1c6cc7}:null;}})[_0x54f0('0x24')](respondWithResult(_0x50f6d3,null))[_0x54f0('0x40')](handleError(_0x50f6d3,null));};exports[_0x54f0('0x4d')]=function(_0x2c8c3e,_0x3bb72d,_0x13f62d){var _0x5cea29={};var _0x53abcf={};var _0x3a3bcb;var _0x1aae40;return db['SalesforceConfiguration'][_0x54f0('0x49')]({'where':{'id':_0x2c8c3e[_0x54f0('0x42')]['id']}})[_0x54f0('0x24')](handleEntityNotFound(_0x3bb72d,null))[_0x54f0('0x24')](function(_0x1eea6f){if(_0x1eea6f){_0x3a3bcb=_0x1eea6f;_0x53abcf[_0x54f0('0x2e')]=_['keys'](db[_0x54f0('0x4a')][_0x54f0('0x2b')]);_0x53abcf['query']=_[_0x54f0('0x43')](_0x2c8c3e[_0x54f0('0x2f')]);_0x53abcf[_0x54f0('0x30')]=_[_0x54f0('0x31')](_0x53abcf['model'],_0x53abcf[_0x54f0('0x2f')]);_0x5cea29['attributes']=_['intersection'](_0x53abcf['model'],qs[_0x54f0('0x33')](_0x2c8c3e[_0x54f0('0x2f')]['fields']));_0x5cea29[_0x54f0('0x32')]=_0x5cea29[_0x54f0('0x32')][_0x54f0('0x34')]?_0x5cea29[_0x54f0('0x32')]:_0x53abcf[_0x54f0('0x2e')];_0x5cea29[_0x54f0('0x4b')]=qs[_0x54f0('0x37')](_0x2c8c3e[_0x54f0('0x2f')][_0x54f0('0x37')]);_0x5cea29['where']=qs[_0x54f0('0x30')](_[_0x54f0('0x39')](_0x2c8c3e[_0x54f0('0x2f')],_0x53abcf[_0x54f0('0x30')]));if(_0x2c8c3e[_0x54f0('0x2f')]['filter']){_0x5cea29[_0x54f0('0x38')]=_[_0x54f0('0x3c')](_0x5cea29[_0x54f0('0x38')],{'$or':_[_0x54f0('0x29')](_0x5cea29['attributes'],function(_0x109a78){var _0x4fdfae={};_0x4fdfae[_0x109a78]={'$like':'%'+_0x2c8c3e[_0x54f0('0x2f')][_0x54f0('0x3b')]+'%'};return _0x4fdfae;})});}_0x5cea29=_[_0x54f0('0x3c')]({},_0x5cea29,_0x2c8c3e[_0x54f0('0x44')]);return _0x3a3bcb['getDescriptions'](_0x5cea29);}})[_0x54f0('0x24')](function(_0x3ef5ed){if(_0x3ef5ed){_0x1aae40=_0x3ef5ed[_0x54f0('0x34')];if(!_0x2c8c3e['query'][_0x54f0('0x35')](_0x54f0('0x36'))){_0x5cea29['limit']=qs['limit'](_0x2c8c3e[_0x54f0('0x2f')]['limit']);_0x5cea29['offset']=qs['offset'](_0x2c8c3e[_0x54f0('0x2f')]['offset']);}return _0x3a3bcb[_0x54f0('0x4d')](_0x5cea29);}})[_0x54f0('0x24')](function(_0x5d89a8){if(_0x5d89a8){return _0x5d89a8?{'count':_0x1aae40,'rows':_0x5d89a8}:null;}})[_0x54f0('0x24')](respondWithResult(_0x3bb72d,null))['catch'](handleError(_0x3bb72d,null));}; \ No newline at end of file +var _0xac8b=['intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','includeAll','include','findAll','rows','catch','show','params','options','find','create','body','update','getFields','findOne','keys','SalesforceField','getSubjects','getDescriptions','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','Content-Range','apply','reject','save','then','destroy','stack','name','send','index','map','SalesforceConfiguration','rawAttributes','fieldName','type','key','model','query','filters','attributes'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xac8b,0x1c2));var _0xbac8=function(_0x38a7ac,_0x45514b){_0x38a7ac=_0x38a7ac-0x0;var _0x53061a=_0xac8b[_0x38a7ac];return _0x53061a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xbac8('0x0'));var zipdir=require(_0xbac8('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xbac8('0x2'));var moment=require(_0xbac8('0x3'));var BPromise=require(_0xbac8('0x4'));var Mustache=require(_0xbac8('0x5'));var util=require(_0xbac8('0x6'));var path=require(_0xbac8('0x7'));var sox=require(_0xbac8('0x8'));var csv=require(_0xbac8('0x9'));var ejs=require(_0xbac8('0xa'));var fs=require('fs');var fs_extra=require(_0xbac8('0xb'));var _=require(_0xbac8('0xc'));var squel=require(_0xbac8('0xd'));var crypto=require(_0xbac8('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xbac8('0xf'));var toCsv=require(_0xbac8('0x9'));var querystring=require(_0xbac8('0x10'));var Papa=require(_0xbac8('0x11'));var Redis=require(_0xbac8('0x12'));var authService=require(_0xbac8('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbac8('0x14'));var logger=require('../../config/logger')(_0xbac8('0x15'));var utils=require(_0xbac8('0x16'));var config=require(_0xbac8('0x17'));var licenseUtil=require(_0xbac8('0x18'));var db=require(_0xbac8('0x19'))['db'];function respondWithStatusCode(_0x468463,_0xdce793){_0xdce793=_0xdce793||0xcc;return function(_0x378ff2){if(_0x378ff2){return _0x468463[_0xbac8('0x1a')](_0xdce793);}return _0x468463[_0xbac8('0x1b')](_0xdce793)[_0xbac8('0x1c')]();};}function respondWithResult(_0x1720aa,_0x10ad73){_0x10ad73=_0x10ad73||0xc8;return function(_0x425728){if(_0x425728){return _0x1720aa[_0xbac8('0x1b')](_0x10ad73)[_0xbac8('0x1d')](_0x425728);}};}function respondWithFilteredResult(_0x4f3c1a,_0x57225b){return function(_0x5084e1){if(_0x5084e1){var _0x3cdeaf=typeof _0x57225b[_0xbac8('0x1e')]==='undefined'&&typeof _0x57225b[_0xbac8('0x1f')]===_0xbac8('0x20');var _0x564b83=_0x5084e1[_0xbac8('0x21')];var _0x3724dc=_0x3cdeaf?0x0:_0x57225b[_0xbac8('0x1e')];var _0x58f311=_0x3cdeaf?_0x5084e1[_0xbac8('0x21')]:_0x57225b['offset']+_0x57225b[_0xbac8('0x1f')];var _0x209e41;if(_0x58f311>=_0x564b83){_0x58f311=_0x564b83;_0x209e41=0xc8;}else{_0x209e41=0xce;}_0x4f3c1a[_0xbac8('0x1b')](_0x209e41);return _0x4f3c1a['set'](_0xbac8('0x22'),_0x3724dc+'-'+_0x58f311+'/'+_0x564b83)[_0xbac8('0x1d')](_0x5084e1);}return null;};}function patchUpdates(_0x4afed3){return function(_0x1d812d){try{jsonpatch[_0xbac8('0x23')](_0x1d812d,_0x4afed3,!![]);}catch(_0x2fe2fd){return BPromise[_0xbac8('0x24')](_0x2fe2fd);}return _0x1d812d[_0xbac8('0x25')]();};}function saveUpdates(_0x58215b,_0x427fe3){return function(_0x54ec7d){if(_0x54ec7d){return _0x54ec7d['update'](_0x58215b)[_0xbac8('0x26')](function(_0x3b168b){return _0x3b168b;});}return null;};}function removeEntity(_0x3bb198,_0x15ab73){return function(_0x2eb3a5){if(_0x2eb3a5){return _0x2eb3a5[_0xbac8('0x27')]()[_0xbac8('0x26')](function(){_0x3bb198['status'](0xcc)[_0xbac8('0x1c')]();});}};}function handleEntityNotFound(_0x22e677,_0xa664cb){return function(_0x46693b){if(!_0x46693b){_0x22e677[_0xbac8('0x1a')](0x194);}return _0x46693b;};}function handleError(_0x22c67f,_0x6eb99c){_0x6eb99c=_0x6eb99c||0x1f4;return function(_0x2a16df){logger['error'](_0x2a16df[_0xbac8('0x28')]);if(_0x2a16df[_0xbac8('0x29')]){delete _0x2a16df[_0xbac8('0x29')];}_0x22c67f[_0xbac8('0x1b')](_0x6eb99c)[_0xbac8('0x2a')](_0x2a16df);};}exports[_0xbac8('0x2b')]=function(_0x12fcbe,_0x4e7688){var _0x18cb11={},_0x1218cb={},_0x45fdc5={'count':0x0,'rows':[]};var _0x48fb78=_[_0xbac8('0x2c')](db[_0xbac8('0x2d')][_0xbac8('0x2e')],function(_0x5b4de2){return{'name':_0x5b4de2[_0xbac8('0x2f')],'type':_0x5b4de2[_0xbac8('0x30')][_0xbac8('0x31')]};});_0x1218cb[_0xbac8('0x32')]=_[_0xbac8('0x2c')](_0x48fb78,'name');_0x1218cb[_0xbac8('0x33')]=_['keys'](_0x12fcbe[_0xbac8('0x33')]);_0x1218cb[_0xbac8('0x34')]=_['intersection'](_0x1218cb[_0xbac8('0x32')],_0x1218cb[_0xbac8('0x33')]);_0x18cb11[_0xbac8('0x35')]=_[_0xbac8('0x36')](_0x1218cb[_0xbac8('0x32')],qs[_0xbac8('0x37')](_0x12fcbe[_0xbac8('0x33')]['fields']));_0x18cb11[_0xbac8('0x35')]=_0x18cb11[_0xbac8('0x35')][_0xbac8('0x38')]?_0x18cb11[_0xbac8('0x35')]:_0x1218cb[_0xbac8('0x32')];if(!_0x12fcbe[_0xbac8('0x33')][_0xbac8('0x39')](_0xbac8('0x3a'))){_0x18cb11[_0xbac8('0x1f')]=qs[_0xbac8('0x1f')](_0x12fcbe['query'][_0xbac8('0x1f')]);_0x18cb11[_0xbac8('0x1e')]=qs[_0xbac8('0x1e')](_0x12fcbe[_0xbac8('0x33')]['offset']);}_0x18cb11[_0xbac8('0x3b')]=qs[_0xbac8('0x3c')](_0x12fcbe[_0xbac8('0x33')]['sort']);_0x18cb11[_0xbac8('0x3d')]=qs[_0xbac8('0x34')](_[_0xbac8('0x3e')](_0x12fcbe[_0xbac8('0x33')],_0x1218cb[_0xbac8('0x34')]),_0x48fb78);if(_0x12fcbe[_0xbac8('0x33')][_0xbac8('0x3f')]){_0x18cb11[_0xbac8('0x3d')]=_['merge'](_0x18cb11[_0xbac8('0x3d')],{'$or':_[_0xbac8('0x2c')](_0x48fb78,function(_0x5788bd){if(_0x5788bd[_0xbac8('0x30')]!==_0xbac8('0x40')){var _0x342eee={};_0x342eee[_0x5788bd[_0xbac8('0x29')]]={'$like':'%'+_0x12fcbe[_0xbac8('0x33')]['filter']+'%'};return _0x342eee;}})});}_0x18cb11=_[_0xbac8('0x41')]({},_0x18cb11,_0x12fcbe['options']);var _0x34c633={'where':_0x18cb11[_0xbac8('0x3d')]};return db['SalesforceConfiguration'][_0xbac8('0x21')](_0x34c633)[_0xbac8('0x26')](function(_0x130eda){_0x45fdc5['count']=_0x130eda;if(_0x12fcbe[_0xbac8('0x33')][_0xbac8('0x42')]){_0x18cb11[_0xbac8('0x43')]=[{'all':!![]}];}return db[_0xbac8('0x2d')][_0xbac8('0x44')](_0x18cb11);})[_0xbac8('0x26')](function(_0x16ccb3){_0x45fdc5[_0xbac8('0x45')]=_0x16ccb3;return _0x45fdc5;})['then'](respondWithFilteredResult(_0x4e7688,_0x18cb11))[_0xbac8('0x46')](handleError(_0x4e7688,null));};exports[_0xbac8('0x47')]=function(_0x3ade97,_0x5f1456){var _0xf6ac31={'raw':![],'where':{'id':_0x3ade97[_0xbac8('0x48')]['id']}},_0x194f2f={};_0x194f2f[_0xbac8('0x32')]=_['keys'](db[_0xbac8('0x2d')][_0xbac8('0x2e')]);_0x194f2f['query']=_['keys'](_0x3ade97[_0xbac8('0x33')]);_0x194f2f['filters']=_[_0xbac8('0x36')](_0x194f2f[_0xbac8('0x32')],_0x194f2f[_0xbac8('0x33')]);_0xf6ac31[_0xbac8('0x35')]=_['intersection'](_0x194f2f[_0xbac8('0x32')],qs[_0xbac8('0x37')](_0x3ade97[_0xbac8('0x33')][_0xbac8('0x37')]));_0xf6ac31[_0xbac8('0x35')]=_0xf6ac31['attributes'][_0xbac8('0x38')]?_0xf6ac31[_0xbac8('0x35')]:_0x194f2f[_0xbac8('0x32')];if(_0x3ade97[_0xbac8('0x33')][_0xbac8('0x42')]){_0xf6ac31[_0xbac8('0x43')]=[{'all':!![]}];}_0xf6ac31=_[_0xbac8('0x41')]({},_0xf6ac31,_0x3ade97[_0xbac8('0x49')]);return db[_0xbac8('0x2d')][_0xbac8('0x4a')](_0xf6ac31)[_0xbac8('0x26')](handleEntityNotFound(_0x5f1456,null))[_0xbac8('0x26')](respondWithResult(_0x5f1456,null))[_0xbac8('0x46')](handleError(_0x5f1456,null));};exports[_0xbac8('0x4b')]=function(_0x289984,_0xd41f4){return db[_0xbac8('0x2d')][_0xbac8('0x4b')](_0x289984[_0xbac8('0x4c')],{})[_0xbac8('0x26')](respondWithResult(_0xd41f4,0xc9))[_0xbac8('0x46')](handleError(_0xd41f4,null));};exports[_0xbac8('0x4d')]=function(_0x22d901,_0x97854d){if(_0x22d901['body']['id']){delete _0x22d901[_0xbac8('0x4c')]['id'];}return db[_0xbac8('0x2d')][_0xbac8('0x4a')]({'where':{'id':_0x22d901[_0xbac8('0x48')]['id']}})['then'](handleEntityNotFound(_0x97854d,null))['then'](saveUpdates(_0x22d901[_0xbac8('0x4c')],null))[_0xbac8('0x26')](respondWithResult(_0x97854d,null))[_0xbac8('0x46')](handleError(_0x97854d,null));};exports[_0xbac8('0x27')]=function(_0x411e3b,_0x291496){return db[_0xbac8('0x2d')]['find']({'where':{'id':_0x411e3b['params']['id']}})['then'](handleEntityNotFound(_0x291496,null))['then'](removeEntity(_0x291496,null))[_0xbac8('0x46')](handleError(_0x291496,null));};exports[_0xbac8('0x4e')]=function(_0x46a610,_0x4bddf5,_0x1f9354){var _0x4179e1={};var _0x5a4694={};var _0x4822e4;var _0x4bb899;return db[_0xbac8('0x2d')][_0xbac8('0x4f')]({'where':{'id':_0x46a610['params']['id']}})[_0xbac8('0x26')](handleEntityNotFound(_0x4bddf5,null))[_0xbac8('0x26')](function(_0x14b43c){if(_0x14b43c){_0x4822e4=_0x14b43c;_0x5a4694[_0xbac8('0x32')]=_[_0xbac8('0x50')](db['SalesforceField'][_0xbac8('0x2e')]);_0x5a4694['query']=_[_0xbac8('0x50')](_0x46a610[_0xbac8('0x33')]);_0x5a4694['filters']=_[_0xbac8('0x36')](_0x5a4694['model'],_0x5a4694[_0xbac8('0x33')]);_0x4179e1[_0xbac8('0x35')]=_['intersection'](_0x5a4694[_0xbac8('0x32')],qs[_0xbac8('0x37')](_0x46a610[_0xbac8('0x33')]['fields']));_0x4179e1['attributes']=_0x4179e1[_0xbac8('0x35')][_0xbac8('0x38')]?_0x4179e1['attributes']:_0x5a4694[_0xbac8('0x32')];_0x4179e1[_0xbac8('0x3b')]=qs[_0xbac8('0x3c')](_0x46a610[_0xbac8('0x33')][_0xbac8('0x3c')]);_0x4179e1[_0xbac8('0x3d')]=qs[_0xbac8('0x34')](_[_0xbac8('0x3e')](_0x46a610[_0xbac8('0x33')],_0x5a4694[_0xbac8('0x34')]));if(_0x46a610[_0xbac8('0x33')][_0xbac8('0x3f')]){_0x4179e1[_0xbac8('0x3d')]=_[_0xbac8('0x41')](_0x4179e1['where'],{'$or':_[_0xbac8('0x2c')](_0x4179e1['attributes'],function(_0x1dda06){var _0x37bb2b={};_0x37bb2b[_0x1dda06]={'$like':'%'+_0x46a610[_0xbac8('0x33')][_0xbac8('0x3f')]+'%'};return _0x37bb2b;})});}_0x4179e1=_['merge']({},_0x4179e1,_0x46a610[_0xbac8('0x49')]);return _0x4822e4[_0xbac8('0x4e')](_0x4179e1);}})['then'](function(_0x52e05d){if(_0x52e05d){_0x4bb899=_0x52e05d[_0xbac8('0x38')];if(!_0x46a610[_0xbac8('0x33')][_0xbac8('0x39')](_0xbac8('0x3a'))){_0x4179e1['limit']=qs[_0xbac8('0x1f')](_0x46a610[_0xbac8('0x33')]['limit']);_0x4179e1[_0xbac8('0x1e')]=qs[_0xbac8('0x1e')](_0x46a610[_0xbac8('0x33')]['offset']);}return _0x4822e4[_0xbac8('0x4e')](_0x4179e1);}})[_0xbac8('0x26')](function(_0x154afc){if(_0x154afc){return _0x154afc?{'count':_0x4bb899,'rows':_0x154afc}:null;}})[_0xbac8('0x26')](respondWithResult(_0x4bddf5,null))[_0xbac8('0x46')](handleError(_0x4bddf5,null));};exports['getSubjects']=function(_0x53a72b,_0x2b226b,_0x5745e8){var _0x31f601={};var _0x497ada={};var _0x13666c;var _0x136d20;return db[_0xbac8('0x2d')][_0xbac8('0x4f')]({'where':{'id':_0x53a72b[_0xbac8('0x48')]['id']}})[_0xbac8('0x26')](handleEntityNotFound(_0x2b226b,null))[_0xbac8('0x26')](function(_0x39e30e){if(_0x39e30e){_0x13666c=_0x39e30e;_0x497ada[_0xbac8('0x32')]=_['keys'](db[_0xbac8('0x51')][_0xbac8('0x2e')]);_0x497ada[_0xbac8('0x33')]=_[_0xbac8('0x50')](_0x53a72b[_0xbac8('0x33')]);_0x497ada[_0xbac8('0x34')]=_[_0xbac8('0x36')](_0x497ada['model'],_0x497ada[_0xbac8('0x33')]);_0x31f601[_0xbac8('0x35')]=_[_0xbac8('0x36')](_0x497ada[_0xbac8('0x32')],qs[_0xbac8('0x37')](_0x53a72b[_0xbac8('0x33')][_0xbac8('0x37')]));_0x31f601[_0xbac8('0x35')]=_0x31f601[_0xbac8('0x35')][_0xbac8('0x38')]?_0x31f601[_0xbac8('0x35')]:_0x497ada[_0xbac8('0x32')];_0x31f601['order']=qs[_0xbac8('0x3c')](_0x53a72b[_0xbac8('0x33')]['sort']);_0x31f601[_0xbac8('0x3d')]=qs[_0xbac8('0x34')](_['pick'](_0x53a72b[_0xbac8('0x33')],_0x497ada[_0xbac8('0x34')]));if(_0x53a72b[_0xbac8('0x33')][_0xbac8('0x3f')]){_0x31f601[_0xbac8('0x3d')]=_[_0xbac8('0x41')](_0x31f601[_0xbac8('0x3d')],{'$or':_[_0xbac8('0x2c')](_0x31f601[_0xbac8('0x35')],function(_0x386d09){var _0x37187d={};_0x37187d[_0x386d09]={'$like':'%'+_0x53a72b[_0xbac8('0x33')]['filter']+'%'};return _0x37187d;})});}_0x31f601=_[_0xbac8('0x41')]({},_0x31f601,_0x53a72b[_0xbac8('0x49')]);return _0x13666c[_0xbac8('0x52')](_0x31f601);}})[_0xbac8('0x26')](function(_0x3ad1c2){if(_0x3ad1c2){_0x136d20=_0x3ad1c2[_0xbac8('0x38')];if(!_0x53a72b[_0xbac8('0x33')]['hasOwnProperty']('nolimit')){_0x31f601[_0xbac8('0x1f')]=qs[_0xbac8('0x1f')](_0x53a72b[_0xbac8('0x33')][_0xbac8('0x1f')]);_0x31f601['offset']=qs[_0xbac8('0x1e')](_0x53a72b[_0xbac8('0x33')][_0xbac8('0x1e')]);}return _0x13666c[_0xbac8('0x52')](_0x31f601);}})[_0xbac8('0x26')](function(_0x2918f9){if(_0x2918f9){return _0x2918f9?{'count':_0x136d20,'rows':_0x2918f9}:null;}})['then'](respondWithResult(_0x2b226b,null))[_0xbac8('0x46')](handleError(_0x2b226b,null));};exports[_0xbac8('0x53')]=function(_0x246398,_0x244e9f,_0x374c84){var _0x2d423a={};var _0x518ef6={};var _0x68196a;var _0x560411;return db['SalesforceConfiguration'][_0xbac8('0x4f')]({'where':{'id':_0x246398[_0xbac8('0x48')]['id']}})[_0xbac8('0x26')](handleEntityNotFound(_0x244e9f,null))[_0xbac8('0x26')](function(_0x443fde){if(_0x443fde){_0x68196a=_0x443fde;_0x518ef6[_0xbac8('0x32')]=_[_0xbac8('0x50')](db[_0xbac8('0x51')][_0xbac8('0x2e')]);_0x518ef6[_0xbac8('0x33')]=_[_0xbac8('0x50')](_0x246398[_0xbac8('0x33')]);_0x518ef6['filters']=_[_0xbac8('0x36')](_0x518ef6['model'],_0x518ef6[_0xbac8('0x33')]);_0x2d423a[_0xbac8('0x35')]=_[_0xbac8('0x36')](_0x518ef6[_0xbac8('0x32')],qs['fields'](_0x246398['query'][_0xbac8('0x37')]));_0x2d423a['attributes']=_0x2d423a['attributes'][_0xbac8('0x38')]?_0x2d423a['attributes']:_0x518ef6[_0xbac8('0x32')];_0x2d423a[_0xbac8('0x3b')]=qs[_0xbac8('0x3c')](_0x246398[_0xbac8('0x33')][_0xbac8('0x3c')]);_0x2d423a[_0xbac8('0x3d')]=qs[_0xbac8('0x34')](_[_0xbac8('0x3e')](_0x246398[_0xbac8('0x33')],_0x518ef6[_0xbac8('0x34')]));if(_0x246398[_0xbac8('0x33')][_0xbac8('0x3f')]){_0x2d423a[_0xbac8('0x3d')]=_[_0xbac8('0x41')](_0x2d423a[_0xbac8('0x3d')],{'$or':_[_0xbac8('0x2c')](_0x2d423a[_0xbac8('0x35')],function(_0x111aec){var _0x3ee1b7={};_0x3ee1b7[_0x111aec]={'$like':'%'+_0x246398['query'][_0xbac8('0x3f')]+'%'};return _0x3ee1b7;})});}_0x2d423a=_['merge']({},_0x2d423a,_0x246398[_0xbac8('0x49')]);return _0x68196a['getDescriptions'](_0x2d423a);}})[_0xbac8('0x26')](function(_0xc2fed3){if(_0xc2fed3){_0x560411=_0xc2fed3[_0xbac8('0x38')];if(!_0x246398[_0xbac8('0x33')][_0xbac8('0x39')](_0xbac8('0x3a'))){_0x2d423a['limit']=qs[_0xbac8('0x1f')](_0x246398[_0xbac8('0x33')][_0xbac8('0x1f')]);_0x2d423a['offset']=qs['offset'](_0x246398[_0xbac8('0x33')][_0xbac8('0x1e')]);}return _0x68196a[_0xbac8('0x53')](_0x2d423a);}})[_0xbac8('0x26')](function(_0x5ccc91){if(_0x5ccc91){return _0x5ccc91?{'count':_0x560411,'rows':_0x5ccc91}:null;}})['then'](respondWithResult(_0x244e9f,null))[_0xbac8('0x46')](handleError(_0x244e9f,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js index 17fb64e..512ecb2 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 _0x9895=['path','rimraf','exports','SalesforceConfiguration','int_salesforce_configurations','lodash','util','../../config/logger','bluebird','request-promise'];(function(_0x509e30,_0x58b0d8){var _0x1371ca=function(_0x22b5f1){while(--_0x22b5f1){_0x509e30['push'](_0x509e30['shift']());}};_0x1371ca(++_0x58b0d8);}(_0x9895,0x131));var _0x5989=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x9895[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x5989('0x0'));var util=require(_0x5989('0x1'));var logger=require(_0x5989('0x2'))('api');var moment=require('moment');var BPromise=require(_0x5989('0x3'));var rp=require(_0x5989('0x4'));var fs=require('fs');var path=require(_0x5989('0x5'));var rimraf=require(_0x5989('0x6'));var config=require('../../config/environment');var attributes=require('./intSalesforceConfiguration.attributes');module[_0x5989('0x7')]=function(_0x5e4b4d,_0x4849d7){return _0x5e4b4d['define'](_0x5989('0x8'),attributes,{'tableName':_0x5989('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9b0a=['./intSalesforceConfiguration.attributes','exports','SalesforceConfiguration','int_salesforce_configurations','lodash','util','api','moment','bluebird','request-promise','path','../../config/environment'];(function(_0x7e2eb0,_0x17cd58){var _0xd92de4=function(_0x5d005b){while(--_0x5d005b){_0x7e2eb0['push'](_0x7e2eb0['shift']());}};_0xd92de4(++_0x17cd58);}(_0x9b0a,0xf4));var _0xa9b0=function(_0x4f497f,_0x3d2544){_0x4f497f=_0x4f497f-0x0;var _0x4e8bc4=_0x9b0a[_0x4f497f];return _0x4e8bc4;};'use strict';var _=require(_0xa9b0('0x0'));var util=require(_0xa9b0('0x1'));var logger=require('../../config/logger')(_0xa9b0('0x2'));var moment=require(_0xa9b0('0x3'));var BPromise=require(_0xa9b0('0x4'));var rp=require(_0xa9b0('0x5'));var fs=require('fs');var path=require(_0xa9b0('0x6'));var rimraf=require('rimraf');var config=require(_0xa9b0('0x7'));var attributes=require(_0xa9b0('0x8'));module[_0xa9b0('0x9')]=function(_0x23be62,_0x323204){return _0x23be62['define'](_0xa9b0('0xa'),attributes,{'tableName':_0xa9b0('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.rpc.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.rpc.js index 80cae01..c3bbb50 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 _0xdbea=['SalesforceConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','info','catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','SalesforceConfiguration,\x20%s,\x20%s','request\x20sent'];(function(_0x1fb4e1,_0x3d4ce6){var _0x22d1b0=function(_0x553822){while(--_0x553822){_0x1fb4e1['push'](_0x1fb4e1['shift']());}};_0x22d1b0(++_0x3d4ce6);}(_0xdbea,0xae));var _0xadbe=function(_0xe91ee2,_0x241e08){_0xe91ee2=_0xe91ee2-0x0;var _0x191be2=_0xdbea[_0xe91ee2];return _0x191be2;};'use strict';var _=require('lodash');var util=require(_0xadbe('0x0'));var moment=require(_0xadbe('0x1'));var BPromise=require(_0xadbe('0x2'));var rs=require(_0xadbe('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xadbe('0x4'))['db'];var utils=require(_0xadbe('0x5'));var logger=require(_0xadbe('0x6'))('rpc');var config=require(_0xadbe('0x7'));var jayson=require(_0xadbe('0x8'));var client=jayson[_0xadbe('0x9')][_0xadbe('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x54a64,_0x3d3985,_0x29ff0c){return new BPromise(function(_0x549fb0,_0x5a2fd3){return client[_0xadbe('0xb')](_0x54a64,_0x29ff0c)[_0xadbe('0xc')](function(_0x15bd96){logger['info'](_0xadbe('0xd'),_0x3d3985,_0xadbe('0xe'));logger['debug'](_0xadbe('0xf'),_0x3d3985,'request\x20sent',JSON[_0xadbe('0x10')](_0x15bd96));if(_0x15bd96[_0xadbe('0x11')]){if(_0x15bd96['error']['code']===0x1f4){logger[_0xadbe('0x11')](_0xadbe('0xd'),_0x3d3985,_0x15bd96[_0xadbe('0x11')]['message']);return _0x5a2fd3(_0x15bd96[_0xadbe('0x11')][_0xadbe('0x12')]);}logger[_0xadbe('0x11')]('SalesforceConfiguration,\x20%s,\x20%s',_0x3d3985,_0x15bd96['error'][_0xadbe('0x12')]);return _0x549fb0(_0x15bd96[_0xadbe('0x11')][_0xadbe('0x12')]);}else{logger[_0xadbe('0x13')](_0xadbe('0xd'),_0x3d3985,_0xadbe('0xe'));_0x549fb0(_0x15bd96['result'][_0xadbe('0x12')]);}})[_0xadbe('0x14')](function(_0x420a2d){logger[_0xadbe('0x11')](_0xadbe('0xd'),_0x3d3985,_0x420a2d);_0x5a2fd3(_0x420a2d);});});} \ No newline at end of file +var _0xfbc7=['then','info','SalesforceConfiguration,\x20%s,\x20%s','debug','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','request'];(function(_0x9fc5a2,_0x46c38f){var _0x10a4a8=function(_0x2aeef2){while(--_0x2aeef2){_0x9fc5a2['push'](_0x9fc5a2['shift']());}};_0x10a4a8(++_0x46c38f);}(_0xfbc7,0x197));var _0x7fbc=function(_0x3cdb8d,_0x116582){_0x3cdb8d=_0x3cdb8d-0x0;var _0x4cbfe6=_0xfbc7[_0x3cdb8d];return _0x4cbfe6;};'use strict';var _=require(_0x7fbc('0x0'));var util=require('util');var moment=require(_0x7fbc('0x1'));var BPromise=require(_0x7fbc('0x2'));var rs=require(_0x7fbc('0x3'));var fs=require('fs');var Redis=require(_0x7fbc('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x7fbc('0x5'));var logger=require(_0x7fbc('0x6'))(_0x7fbc('0x7'));var config=require(_0x7fbc('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x7fbc('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0xda7b86,_0x3f279b,_0x48be16){return new BPromise(function(_0x45a174,_0x360a2a){return client[_0x7fbc('0xa')](_0xda7b86,_0x48be16)[_0x7fbc('0xb')](function(_0x46ab94){logger[_0x7fbc('0xc')](_0x7fbc('0xd'),_0x3f279b,'request\x20sent');logger[_0x7fbc('0xe')](_0x7fbc('0xf'),_0x3f279b,_0x7fbc('0x10'),JSON[_0x7fbc('0x11')](_0x46ab94));if(_0x46ab94[_0x7fbc('0x12')]){if(_0x46ab94[_0x7fbc('0x12')][_0x7fbc('0x13')]===0x1f4){logger[_0x7fbc('0x12')]('SalesforceConfiguration,\x20%s,\x20%s',_0x3f279b,_0x46ab94[_0x7fbc('0x12')]['message']);return _0x360a2a(_0x46ab94[_0x7fbc('0x12')][_0x7fbc('0x14')]);}logger['error']('SalesforceConfiguration,\x20%s,\x20%s',_0x3f279b,_0x46ab94[_0x7fbc('0x12')]['message']);return _0x45a174(_0x46ab94[_0x7fbc('0x12')]['message']);}else{logger['info'](_0x7fbc('0xd'),_0x3f279b,'request\x20sent');_0x45a174(_0x46ab94[_0x7fbc('0x15')]['message']);}})['catch'](function(_0x5b43f9){logger[_0x7fbc('0x12')]('SalesforceConfiguration,\x20%s,\x20%s',_0x3f279b,_0x5b43f9);_0x360a2a(_0x5b43f9);});});} \ No newline at end of file diff --git a/server/api/intSalesforceField/index.js b/server/api/intSalesforceField/index.js index 28c4696..fdfcf84 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 _0x1c62=['multer','util','path','Router','fs-extra','../../config/environment','./intSalesforceField.controller','get','isAuthenticated','index','/:id','post','put','update','delete','destroy','exports'];(function(_0x1e8494,_0x36f724){var _0x4e0fcd=function(_0xf1b30f){while(--_0xf1b30f){_0x1e8494['push'](_0x1e8494['shift']());}};_0x4e0fcd(++_0x36f724);}(_0x1c62,0x198));var _0x21c6=function(_0x487496,_0x249683){_0x487496=_0x487496-0x0;var _0x539dc8=_0x1c62[_0x487496];return _0x539dc8;};'use strict';var multer=require(_0x21c6('0x0'));var util=require(_0x21c6('0x1'));var path=require(_0x21c6('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x21c6('0x3')]();var fs_extra=require(_0x21c6('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x21c6('0x5'));var controller=require(_0x21c6('0x6'));router[_0x21c6('0x7')]('/',auth[_0x21c6('0x8')](),controller[_0x21c6('0x9')]);router[_0x21c6('0x7')](_0x21c6('0xa'),auth[_0x21c6('0x8')](),controller['show']);router[_0x21c6('0xb')]('/',auth[_0x21c6('0x8')](),controller['create']);router[_0x21c6('0xc')](_0x21c6('0xa'),auth['isAuthenticated'](),controller[_0x21c6('0xd')]);router[_0x21c6('0xe')]('/:id',auth[_0x21c6('0x8')](),controller[_0x21c6('0xf')]);module[_0x21c6('0x10')]=router; \ No newline at end of file +var _0xe402=['get','isAuthenticated','index','/:id','post','create','put','update','delete','destroy','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x2a81cb,_0xa8c94a){var _0xe02861=function(_0x642309){while(--_0x642309){_0x2a81cb['push'](_0x2a81cb['shift']());}};_0xe02861(++_0xa8c94a);}(_0xe402,0x199));var _0x2e40=function(_0xb79c47,_0x15ab56){_0xb79c47=_0xb79c47-0x0;var _0x3fe6b5=_0xe402[_0xb79c47];return _0x3fe6b5;};'use strict';var multer=require(_0x2e40('0x0'));var util=require(_0x2e40('0x1'));var path=require(_0x2e40('0x2'));var timeout=require(_0x2e40('0x3'));var express=require(_0x2e40('0x4'));var router=express[_0x2e40('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x2e40('0x6'));var interaction=require(_0x2e40('0x7'));var config=require(_0x2e40('0x8'));var controller=require('./intSalesforceField.controller');router[_0x2e40('0x9')]('/',auth[_0x2e40('0xa')](),controller[_0x2e40('0xb')]);router['get'](_0x2e40('0xc'),auth[_0x2e40('0xa')](),controller['show']);router[_0x2e40('0xd')]('/',auth['isAuthenticated'](),controller[_0x2e40('0xe')]);router[_0x2e40('0xf')](_0x2e40('0xc'),auth[_0x2e40('0xa')](),controller[_0x2e40('0x10')]);router[_0x2e40('0x11')]('/:id',auth['isAuthenticated'](),controller[_0x2e40('0x12')]);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 a35df0f..1c042e1 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 _0xb0db=['picklist','STRING','variable','customVariable','sequelize','exports','ENUM','string'];(function(_0x4c5f1b,_0x588280){var _0x2bfc00=function(_0x4785be){while(--_0x4785be){_0x4c5f1b['push'](_0x4c5f1b['shift']());}};_0x2bfc00(++_0x588280);}(_0xb0db,0x104));var _0xbb0d=function(_0x4b500d,_0x2dc980){_0x4b500d=_0x4b500d-0x0;var _0x165684=_0xb0db[_0x4b500d];return _0x165684;};'use strict';var Sequelize=require(_0xbb0d('0x0'));module[_0xbb0d('0x1')]={'type':{'type':Sequelize[_0xbb0d('0x2')](_0xbb0d('0x3'),'variable','customVariable','keyValue',_0xbb0d('0x4')),'defaultValue':'string'},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0xbb0d('0x5')]},'keyType':{'type':Sequelize[_0xbb0d('0x2')](_0xbb0d('0x3'),_0xbb0d('0x6'),_0xbb0d('0x7'))},'keyContent':{'type':Sequelize[_0xbb0d('0x5')]},'idField':{'type':Sequelize[_0xbb0d('0x5')]},'variableName':{'type':Sequelize[_0xbb0d('0x5')]}}; \ No newline at end of file +var _0xfc0d=['ENUM','string','variable','keyValue','picklist','STRING','customVariable','sequelize','exports'];(function(_0x237da8,_0x37b77a){var _0x558825=function(_0x45d7f1){while(--_0x45d7f1){_0x237da8['push'](_0x237da8['shift']());}};_0x558825(++_0x37b77a);}(_0xfc0d,0xbb));var _0xdfc0=function(_0x3d9839,_0x5690a5){_0x3d9839=_0x3d9839-0x0;var _0x42ec18=_0xfc0d[_0x3d9839];return _0x42ec18;};'use strict';var Sequelize=require(_0xdfc0('0x0'));module[_0xdfc0('0x1')]={'type':{'type':Sequelize[_0xdfc0('0x2')](_0xdfc0('0x3'),_0xdfc0('0x4'),'customVariable',_0xdfc0('0x5'),_0xdfc0('0x6')),'defaultValue':'string'},'content':{'type':Sequelize[_0xdfc0('0x7')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0xdfc0('0x2')](_0xdfc0('0x3'),_0xdfc0('0x4'),_0xdfc0('0x8'))},'keyContent':{'type':Sequelize[_0xdfc0('0x7')]},'idField':{'type':Sequelize[_0xdfc0('0x7')]},'variableName':{'type':Sequelize[_0xdfc0('0x7')]}}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.controller.js b/server/api/intSalesforceField/intSalesforceField.controller.js index a3e429d..2b197ca 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 _0x9c20=['eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','stack','name','send','map','SalesforceField','rawAttributes','fieldName','type','key','query','keys','intersection','model','attributes','fields','length','nolimit','order','sort','where','filters','pick','filter','merge','options','then','includeAll','include','rows','catch','show','params','create','body','find'];(function(_0x154b8a,_0x21a824){var _0x1b540e=function(_0x310934){while(--_0x310934){_0x154b8a['push'](_0x154b8a['shift']());}};_0x1b540e(++_0x21a824);}(_0x9c20,0x128));var _0x09c2=function(_0x11190c,_0xb7b323){_0x11190c=_0x11190c-0x0;var _0x126dd1=_0x9c20[_0x11190c];return _0x126dd1;};'use strict';var emlformat=require(_0x09c2('0x0'));var rimraf=require(_0x09c2('0x1'));var zipdir=require(_0x09c2('0x2'));var jsonpatch=require(_0x09c2('0x3'));var rp=require(_0x09c2('0x4'));var moment=require(_0x09c2('0x5'));var BPromise=require(_0x09c2('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0x09c2('0x7'));var sox=require(_0x09c2('0x8'));var csv=require(_0x09c2('0x9'));var ejs=require(_0x09c2('0xa'));var fs=require('fs');var fs_extra=require(_0x09c2('0xb'));var _=require(_0x09c2('0xc'));var squel=require(_0x09c2('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x09c2('0xe'));var toCsv=require(_0x09c2('0x9'));var querystring=require(_0x09c2('0xf'));var Papa=require(_0x09c2('0x10'));var Redis=require(_0x09c2('0x11'));var authService=require(_0x09c2('0x12'));var qs=require(_0x09c2('0x13'));var as=require(_0x09c2('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x09c2('0x15'))(_0x09c2('0x16'));var utils=require(_0x09c2('0x17'));var config=require(_0x09c2('0x18'));var licenseUtil=require(_0x09c2('0x19'));var db=require(_0x09c2('0x1a'))['db'];function respondWithStatusCode(_0x3090b6,_0xc5458e){_0xc5458e=_0xc5458e||0xcc;return function(_0x1f88c5){if(_0x1f88c5){return _0x3090b6[_0x09c2('0x1b')](_0xc5458e);}return _0x3090b6[_0x09c2('0x1c')](_0xc5458e)[_0x09c2('0x1d')]();};}function respondWithResult(_0xbd89f4,_0x31a691){_0x31a691=_0x31a691||0xc8;return function(_0x57ebe2){if(_0x57ebe2){return _0xbd89f4[_0x09c2('0x1c')](_0x31a691)[_0x09c2('0x1e')](_0x57ebe2);}};}function respondWithFilteredResult(_0x6d2775,_0x21412b){return function(_0xd7380d){if(_0xd7380d){var _0x4e5deb=typeof _0x21412b[_0x09c2('0x1f')]===_0x09c2('0x20')&&typeof _0x21412b[_0x09c2('0x21')]==='undefined';var _0x8d43b7=_0xd7380d[_0x09c2('0x22')];var _0x3c4ceb=_0x4e5deb?0x0:_0x21412b[_0x09c2('0x1f')];var _0x4dfb77=_0x4e5deb?_0xd7380d[_0x09c2('0x22')]:_0x21412b[_0x09c2('0x1f')]+_0x21412b[_0x09c2('0x21')];var _0x1a73b8;if(_0x4dfb77>=_0x8d43b7){_0x4dfb77=_0x8d43b7;_0x1a73b8=0xc8;}else{_0x1a73b8=0xce;}_0x6d2775['status'](_0x1a73b8);return _0x6d2775[_0x09c2('0x23')](_0x09c2('0x24'),_0x3c4ceb+'-'+_0x4dfb77+'/'+_0x8d43b7)[_0x09c2('0x1e')](_0xd7380d);}return null;};}function patchUpdates(_0x40a512){return function(_0x1a1e4a){try{jsonpatch['apply'](_0x1a1e4a,_0x40a512,!![]);}catch(_0x4817a5){return BPromise[_0x09c2('0x25')](_0x4817a5);}return _0x1a1e4a[_0x09c2('0x26')]();};}function saveUpdates(_0xefa0bd,_0x1161ee){return function(_0x148fc2){if(_0x148fc2){return _0x148fc2['update'](_0xefa0bd)['then'](function(_0x3a78f8){return _0x3a78f8;});}return null;};}function removeEntity(_0x3bf52b,_0x1294e1){return function(_0x51f76e){if(_0x51f76e){return _0x51f76e['destroy']()['then'](function(){_0x3bf52b[_0x09c2('0x1c')](0xcc)[_0x09c2('0x1d')]();});}};}function handleEntityNotFound(_0x1a9892,_0x39cc8a){return function(_0x5fc2cf){if(!_0x5fc2cf){_0x1a9892[_0x09c2('0x1b')](0x194);}return _0x5fc2cf;};}function handleError(_0x3940ba,_0x409020){_0x409020=_0x409020||0x1f4;return function(_0x36e3f7){logger['error'](_0x36e3f7[_0x09c2('0x27')]);if(_0x36e3f7[_0x09c2('0x28')]){delete _0x36e3f7[_0x09c2('0x28')];}_0x3940ba[_0x09c2('0x1c')](_0x409020)[_0x09c2('0x29')](_0x36e3f7);};}exports['index']=function(_0x4ce36c,_0x37edb9){var _0x4e8de9={},_0x533e5b={},_0x5cb4de={'count':0x0,'rows':[]};var _0x32b5a9=_[_0x09c2('0x2a')](db[_0x09c2('0x2b')][_0x09c2('0x2c')],function(_0x54aa5c){return{'name':_0x54aa5c[_0x09c2('0x2d')],'type':_0x54aa5c[_0x09c2('0x2e')][_0x09c2('0x2f')]};});_0x533e5b['model']=_[_0x09c2('0x2a')](_0x32b5a9,'name');_0x533e5b[_0x09c2('0x30')]=_[_0x09c2('0x31')](_0x4ce36c[_0x09c2('0x30')]);_0x533e5b['filters']=_[_0x09c2('0x32')](_0x533e5b[_0x09c2('0x33')],_0x533e5b[_0x09c2('0x30')]);_0x4e8de9[_0x09c2('0x34')]=_[_0x09c2('0x32')](_0x533e5b['model'],qs[_0x09c2('0x35')](_0x4ce36c['query'][_0x09c2('0x35')]));_0x4e8de9[_0x09c2('0x34')]=_0x4e8de9[_0x09c2('0x34')][_0x09c2('0x36')]?_0x4e8de9['attributes']:_0x533e5b[_0x09c2('0x33')];if(!_0x4ce36c[_0x09c2('0x30')]['hasOwnProperty'](_0x09c2('0x37'))){_0x4e8de9[_0x09c2('0x21')]=qs[_0x09c2('0x21')](_0x4ce36c[_0x09c2('0x30')][_0x09c2('0x21')]);_0x4e8de9[_0x09c2('0x1f')]=qs['offset'](_0x4ce36c[_0x09c2('0x30')][_0x09c2('0x1f')]);}_0x4e8de9[_0x09c2('0x38')]=qs[_0x09c2('0x39')](_0x4ce36c[_0x09c2('0x30')]['sort']);_0x4e8de9[_0x09c2('0x3a')]=qs[_0x09c2('0x3b')](_[_0x09c2('0x3c')](_0x4ce36c[_0x09c2('0x30')],_0x533e5b[_0x09c2('0x3b')]),_0x32b5a9);if(_0x4ce36c[_0x09c2('0x30')]['filter']){_0x4e8de9['where']=_['merge'](_0x4e8de9[_0x09c2('0x3a')],{'$or':_[_0x09c2('0x2a')](_0x32b5a9,function(_0x6fdc2f){if(_0x6fdc2f['type']!=='VIRTUAL'){var _0x460292={};_0x460292[_0x6fdc2f[_0x09c2('0x28')]]={'$like':'%'+_0x4ce36c[_0x09c2('0x30')][_0x09c2('0x3d')]+'%'};return _0x460292;}})});}_0x4e8de9=_[_0x09c2('0x3e')]({},_0x4e8de9,_0x4ce36c[_0x09c2('0x3f')]);var _0xa58eb1={'where':_0x4e8de9[_0x09c2('0x3a')]};return db[_0x09c2('0x2b')]['count'](_0xa58eb1)[_0x09c2('0x40')](function(_0x991beb){_0x5cb4de[_0x09c2('0x22')]=_0x991beb;if(_0x4ce36c[_0x09c2('0x30')][_0x09c2('0x41')]){_0x4e8de9[_0x09c2('0x42')]=[{'all':!![]}];}return db[_0x09c2('0x2b')]['findAll'](_0x4e8de9);})['then'](function(_0x188f23){_0x5cb4de[_0x09c2('0x43')]=_0x188f23;return _0x5cb4de;})[_0x09c2('0x40')](respondWithFilteredResult(_0x37edb9,_0x4e8de9))[_0x09c2('0x44')](handleError(_0x37edb9,null));};exports[_0x09c2('0x45')]=function(_0x2a8d0f,_0x1becb1){var _0x5826fe={'raw':!![],'where':{'id':_0x2a8d0f[_0x09c2('0x46')]['id']}},_0xdcd2fc={};_0xdcd2fc['model']=_[_0x09c2('0x31')](db[_0x09c2('0x2b')][_0x09c2('0x2c')]);_0xdcd2fc[_0x09c2('0x30')]=_[_0x09c2('0x31')](_0x2a8d0f[_0x09c2('0x30')]);_0xdcd2fc[_0x09c2('0x3b')]=_[_0x09c2('0x32')](_0xdcd2fc['model'],_0xdcd2fc[_0x09c2('0x30')]);_0x5826fe[_0x09c2('0x34')]=_[_0x09c2('0x32')](_0xdcd2fc[_0x09c2('0x33')],qs[_0x09c2('0x35')](_0x2a8d0f[_0x09c2('0x30')][_0x09c2('0x35')]));_0x5826fe['attributes']=_0x5826fe[_0x09c2('0x34')][_0x09c2('0x36')]?_0x5826fe[_0x09c2('0x34')]:_0xdcd2fc[_0x09c2('0x33')];if(_0x2a8d0f['query']['includeAll']){_0x5826fe[_0x09c2('0x42')]=[{'all':!![]}];}_0x5826fe=_[_0x09c2('0x3e')]({},_0x5826fe,_0x2a8d0f[_0x09c2('0x3f')]);return db[_0x09c2('0x2b')]['find'](_0x5826fe)['then'](handleEntityNotFound(_0x1becb1,null))['then'](respondWithResult(_0x1becb1,null))[_0x09c2('0x44')](handleError(_0x1becb1,null));};exports['create']=function(_0x58e0af,_0x8da1f8){return db[_0x09c2('0x2b')][_0x09c2('0x47')](_0x58e0af[_0x09c2('0x48')],{})[_0x09c2('0x40')](respondWithResult(_0x8da1f8,0xc9))[_0x09c2('0x44')](handleError(_0x8da1f8,null));};exports['update']=function(_0x1c0984,_0x289775){if(_0x1c0984[_0x09c2('0x48')]['id']){delete _0x1c0984[_0x09c2('0x48')]['id'];}return db['SalesforceField'][_0x09c2('0x49')]({'where':{'id':_0x1c0984[_0x09c2('0x46')]['id']}})[_0x09c2('0x40')](handleEntityNotFound(_0x289775,null))[_0x09c2('0x40')](saveUpdates(_0x1c0984[_0x09c2('0x48')],null))['then'](respondWithResult(_0x289775,null))['catch'](handleError(_0x289775,null));};exports['destroy']=function(_0xb4af27,_0x1e08aa){return db['SalesforceField'][_0x09c2('0x49')]({'where':{'id':_0xb4af27[_0x09c2('0x46')]['id']}})[_0x09c2('0x40')](handleEntityNotFound(_0x1e08aa,null))[_0x09c2('0x40')](removeEntity(_0x1e08aa,null))['catch'](handleError(_0x1e08aa,null));}; \ No newline at end of file +var _0x5d2a=['request-promise','bluebird','util','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','destroy','name','send','rawAttributes','fieldName','type','model','map','query','keys','filters','intersection','fields','attributes','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','rows','catch','show','params','SalesforceField','include','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch'];(function(_0x5f1391,_0x19c132){var _0x50ebe3=function(_0x3d00a3){while(--_0x3d00a3){_0x5f1391['push'](_0x5f1391['shift']());}};_0x50ebe3(++_0x19c132);}(_0x5d2a,0xce));var _0xa5d2=function(_0x1fff36,_0xff455d){_0x1fff36=_0x1fff36-0x0;var _0x2af595=_0x5d2a[_0x1fff36];return _0x2af595;};'use strict';var emlformat=require(_0xa5d2('0x0'));var rimraf=require(_0xa5d2('0x1'));var zipdir=require(_0xa5d2('0x2'));var jsonpatch=require(_0xa5d2('0x3'));var rp=require(_0xa5d2('0x4'));var moment=require('moment');var BPromise=require(_0xa5d2('0x5'));var Mustache=require('mustache');var util=require(_0xa5d2('0x6'));var path=require('path');var sox=require(_0xa5d2('0x7'));var csv=require(_0xa5d2('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa5d2('0x9'));var squel=require(_0xa5d2('0xa'));var crypto=require(_0xa5d2('0xb'));var jsforce=require(_0xa5d2('0xc'));var deskjs=require(_0xa5d2('0xd'));var toCsv=require('to-csv');var querystring=require(_0xa5d2('0xe'));var Papa=require(_0xa5d2('0xf'));var Redis=require(_0xa5d2('0x10'));var authService=require(_0xa5d2('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xa5d2('0x12'))(_0xa5d2('0x13'));var utils=require(_0xa5d2('0x14'));var config=require(_0xa5d2('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xa5d2('0x16'))['db'];function respondWithStatusCode(_0x4c6cb5,_0x579ce2){_0x579ce2=_0x579ce2||0xcc;return function(_0x17f4af){if(_0x17f4af){return _0x4c6cb5[_0xa5d2('0x17')](_0x579ce2);}return _0x4c6cb5[_0xa5d2('0x18')](_0x579ce2)[_0xa5d2('0x19')]();};}function respondWithResult(_0x288722,_0xe2b7cb){_0xe2b7cb=_0xe2b7cb||0xc8;return function(_0x4e27bb){if(_0x4e27bb){return _0x288722[_0xa5d2('0x18')](_0xe2b7cb)['json'](_0x4e27bb);}};}function respondWithFilteredResult(_0x230f10,_0x2905da){return function(_0x3101df){if(_0x3101df){var _0x48b2b0=typeof _0x2905da[_0xa5d2('0x1a')]===_0xa5d2('0x1b')&&typeof _0x2905da[_0xa5d2('0x1c')]==='undefined';var _0x35f737=_0x3101df[_0xa5d2('0x1d')];var _0x2328c4=_0x48b2b0?0x0:_0x2905da[_0xa5d2('0x1a')];var _0x21d26c=_0x48b2b0?_0x3101df[_0xa5d2('0x1d')]:_0x2905da[_0xa5d2('0x1a')]+_0x2905da[_0xa5d2('0x1c')];var _0xd4ceae;if(_0x21d26c>=_0x35f737){_0x21d26c=_0x35f737;_0xd4ceae=0xc8;}else{_0xd4ceae=0xce;}_0x230f10['status'](_0xd4ceae);return _0x230f10[_0xa5d2('0x1e')](_0xa5d2('0x1f'),_0x2328c4+'-'+_0x21d26c+'/'+_0x35f737)[_0xa5d2('0x20')](_0x3101df);}return null;};}function patchUpdates(_0x5c70d0){return function(_0x155740){try{jsonpatch[_0xa5d2('0x21')](_0x155740,_0x5c70d0,!![]);}catch(_0x388392){return BPromise[_0xa5d2('0x22')](_0x388392);}return _0x155740[_0xa5d2('0x23')]();};}function saveUpdates(_0x64bd69,_0x3f0bcb){return function(_0x2be2f4){if(_0x2be2f4){return _0x2be2f4[_0xa5d2('0x24')](_0x64bd69)[_0xa5d2('0x25')](function(_0x4d59e8){return _0x4d59e8;});}return null;};}function removeEntity(_0x2820ab,_0x2f392d){return function(_0x2d3d77){if(_0x2d3d77){return _0x2d3d77[_0xa5d2('0x26')]()[_0xa5d2('0x25')](function(){_0x2820ab[_0xa5d2('0x18')](0xcc)[_0xa5d2('0x19')]();});}};}function handleEntityNotFound(_0x352045,_0x45146f){return function(_0xc644cc){if(!_0xc644cc){_0x352045['sendStatus'](0x194);}return _0xc644cc;};}function handleError(_0x3727c8,_0x446758){_0x446758=_0x446758||0x1f4;return function(_0x159d35){logger['error'](_0x159d35['stack']);if(_0x159d35['name']){delete _0x159d35[_0xa5d2('0x27')];}_0x3727c8['status'](_0x446758)[_0xa5d2('0x28')](_0x159d35);};}exports['index']=function(_0x1c9fb4,_0x57a421){var _0x15fe5f={},_0x52095a={},_0x3e83b4={'count':0x0,'rows':[]};var _0x49bee6=_['map'](db['SalesforceField'][_0xa5d2('0x29')],function(_0xd1bf9f){return{'name':_0xd1bf9f[_0xa5d2('0x2a')],'type':_0xd1bf9f[_0xa5d2('0x2b')]['key']};});_0x52095a[_0xa5d2('0x2c')]=_[_0xa5d2('0x2d')](_0x49bee6,_0xa5d2('0x27'));_0x52095a[_0xa5d2('0x2e')]=_[_0xa5d2('0x2f')](_0x1c9fb4[_0xa5d2('0x2e')]);_0x52095a[_0xa5d2('0x30')]=_[_0xa5d2('0x31')](_0x52095a[_0xa5d2('0x2c')],_0x52095a[_0xa5d2('0x2e')]);_0x15fe5f['attributes']=_['intersection'](_0x52095a[_0xa5d2('0x2c')],qs[_0xa5d2('0x32')](_0x1c9fb4[_0xa5d2('0x2e')][_0xa5d2('0x32')]));_0x15fe5f[_0xa5d2('0x33')]=_0x15fe5f[_0xa5d2('0x33')]['length']?_0x15fe5f[_0xa5d2('0x33')]:_0x52095a[_0xa5d2('0x2c')];if(!_0x1c9fb4[_0xa5d2('0x2e')]['hasOwnProperty']('nolimit')){_0x15fe5f[_0xa5d2('0x1c')]=qs[_0xa5d2('0x1c')](_0x1c9fb4[_0xa5d2('0x2e')][_0xa5d2('0x1c')]);_0x15fe5f['offset']=qs['offset'](_0x1c9fb4['query'][_0xa5d2('0x1a')]);}_0x15fe5f[_0xa5d2('0x34')]=qs[_0xa5d2('0x35')](_0x1c9fb4['query'][_0xa5d2('0x35')]);_0x15fe5f[_0xa5d2('0x36')]=qs['filters'](_[_0xa5d2('0x37')](_0x1c9fb4[_0xa5d2('0x2e')],_0x52095a['filters']),_0x49bee6);if(_0x1c9fb4[_0xa5d2('0x2e')]['filter']){_0x15fe5f[_0xa5d2('0x36')]=_[_0xa5d2('0x38')](_0x15fe5f[_0xa5d2('0x36')],{'$or':_[_0xa5d2('0x2d')](_0x49bee6,function(_0x476dc7){if(_0x476dc7[_0xa5d2('0x2b')]!==_0xa5d2('0x39')){var _0x2a5afe={};_0x2a5afe[_0x476dc7[_0xa5d2('0x27')]]={'$like':'%'+_0x1c9fb4['query'][_0xa5d2('0x3a')]+'%'};return _0x2a5afe;}})});}_0x15fe5f=_[_0xa5d2('0x38')]({},_0x15fe5f,_0x1c9fb4[_0xa5d2('0x3b')]);var _0x6c1d02={'where':_0x15fe5f[_0xa5d2('0x36')]};return db['SalesforceField'][_0xa5d2('0x1d')](_0x6c1d02)['then'](function(_0x3b0701){_0x3e83b4['count']=_0x3b0701;if(_0x1c9fb4[_0xa5d2('0x2e')][_0xa5d2('0x3c')]){_0x15fe5f['include']=[{'all':!![]}];}return db['SalesforceField']['findAll'](_0x15fe5f);})[_0xa5d2('0x25')](function(_0x4cbcf9){_0x3e83b4[_0xa5d2('0x3d')]=_0x4cbcf9;return _0x3e83b4;})[_0xa5d2('0x25')](respondWithFilteredResult(_0x57a421,_0x15fe5f))[_0xa5d2('0x3e')](handleError(_0x57a421,null));};exports[_0xa5d2('0x3f')]=function(_0x11284c,_0x3e5514){var _0x393b95={'raw':!![],'where':{'id':_0x11284c[_0xa5d2('0x40')]['id']}},_0x2babdb={};_0x2babdb[_0xa5d2('0x2c')]=_[_0xa5d2('0x2f')](db[_0xa5d2('0x41')][_0xa5d2('0x29')]);_0x2babdb['query']=_[_0xa5d2('0x2f')](_0x11284c[_0xa5d2('0x2e')]);_0x2babdb[_0xa5d2('0x30')]=_[_0xa5d2('0x31')](_0x2babdb[_0xa5d2('0x2c')],_0x2babdb[_0xa5d2('0x2e')]);_0x393b95['attributes']=_['intersection'](_0x2babdb[_0xa5d2('0x2c')],qs[_0xa5d2('0x32')](_0x11284c[_0xa5d2('0x2e')]['fields']));_0x393b95['attributes']=_0x393b95['attributes']['length']?_0x393b95[_0xa5d2('0x33')]:_0x2babdb[_0xa5d2('0x2c')];if(_0x11284c[_0xa5d2('0x2e')][_0xa5d2('0x3c')]){_0x393b95[_0xa5d2('0x42')]=[{'all':!![]}];}_0x393b95=_[_0xa5d2('0x38')]({},_0x393b95,_0x11284c['options']);return db[_0xa5d2('0x41')][_0xa5d2('0x43')](_0x393b95)[_0xa5d2('0x25')](handleEntityNotFound(_0x3e5514,null))['then'](respondWithResult(_0x3e5514,null))['catch'](handleError(_0x3e5514,null));};exports[_0xa5d2('0x44')]=function(_0x5d47a2,_0xf2a53d){return db['SalesforceField'][_0xa5d2('0x44')](_0x5d47a2['body'],{})[_0xa5d2('0x25')](respondWithResult(_0xf2a53d,0xc9))[_0xa5d2('0x3e')](handleError(_0xf2a53d,null));};exports[_0xa5d2('0x24')]=function(_0x3c4b71,_0x2d9c30){if(_0x3c4b71[_0xa5d2('0x45')]['id']){delete _0x3c4b71[_0xa5d2('0x45')]['id'];}return db[_0xa5d2('0x41')][_0xa5d2('0x43')]({'where':{'id':_0x3c4b71['params']['id']}})['then'](handleEntityNotFound(_0x2d9c30,null))['then'](saveUpdates(_0x3c4b71[_0xa5d2('0x45')],null))[_0xa5d2('0x25')](respondWithResult(_0x2d9c30,null))['catch'](handleError(_0x2d9c30,null));};exports[_0xa5d2('0x26')]=function(_0x19946c,_0x1ce3c8){return db[_0xa5d2('0x41')][_0xa5d2('0x43')]({'where':{'id':_0x19946c[_0xa5d2('0x40')]['id']}})[_0xa5d2('0x25')](handleEntityNotFound(_0x1ce3c8,null))['then'](removeEntity(_0x1ce3c8,null))[_0xa5d2('0x3e')](handleError(_0x1ce3c8,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.model.js b/server/api/intSalesforceField/intSalesforceField.model.js index 8b8b7a0..756dd64 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 _0x6934=['api','moment','request-promise','path','rimraf','../../config/environment','./intSalesforceField.attributes','exports','define','SalesforceField','salesforce_unique_index','idField','util','../../config/logger'];(function(_0x2f8140,_0x37076b){var _0x21bd12=function(_0x179e41){while(--_0x179e41){_0x2f8140['push'](_0x2f8140['shift']());}};_0x21bd12(++_0x37076b);}(_0x6934,0x1da));var _0x4693=function(_0x2c10f6,_0x2a6843){_0x2c10f6=_0x2c10f6-0x0;var _0x23430c=_0x6934[_0x2c10f6];return _0x23430c;};'use strict';var _=require('lodash');var util=require(_0x4693('0x0'));var logger=require(_0x4693('0x1'))(_0x4693('0x2'));var moment=require(_0x4693('0x3'));var BPromise=require('bluebird');var rp=require(_0x4693('0x4'));var fs=require('fs');var path=require(_0x4693('0x5'));var rimraf=require(_0x4693('0x6'));var config=require(_0x4693('0x7'));var attributes=require(_0x4693('0x8'));module[_0x4693('0x9')]=function(_0x2bb4c,_0x4d877c){return _0x2bb4c[_0x4693('0xa')](_0x4693('0xb'),attributes,{'tableName':'int_salesforce_fields','paranoid':![],'indexes':[{'name':_0x4693('0xc'),'fields':[_0x4693('0xd'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x120e=['rimraf','../../config/environment','./intSalesforceField.attributes','exports','define','SalesforceField','int_salesforce_fields','idField','lodash','util','../../config/logger','api','bluebird','path'];(function(_0x286f6f,_0x47d641){var _0x4e4b0c=function(_0x3fe8c5){while(--_0x3fe8c5){_0x286f6f['push'](_0x286f6f['shift']());}};_0x4e4b0c(++_0x47d641);}(_0x120e,0x120));var _0xe120=function(_0x5b955b,_0x186322){_0x5b955b=_0x5b955b-0x0;var _0xe75cb=_0x120e[_0x5b955b];return _0xe75cb;};'use strict';var _=require(_0xe120('0x0'));var util=require(_0xe120('0x1'));var logger=require(_0xe120('0x2'))(_0xe120('0x3'));var moment=require('moment');var BPromise=require(_0xe120('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe120('0x5'));var rimraf=require(_0xe120('0x6'));var config=require(_0xe120('0x7'));var attributes=require(_0xe120('0x8'));module[_0xe120('0x9')]=function(_0xdb7af7,_0x2ca2b0){return _0xdb7af7[_0xe120('0xa')](_0xe120('0xb'),attributes,{'tableName':_0xe120('0xc'),'paranoid':![],'indexes':[{'name':'salesforce_unique_index','fields':[_0xe120('0xd'),'FieldId'],'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 c5b00cf..9f932dd 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 _0x25e9=['http','request','then','info','SalesforceField,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x2431d6,_0x25189a){var _0x4d0f9b=function(_0x52cd84){while(--_0x52cd84){_0x2431d6['push'](_0x2431d6['shift']());}};_0x4d0f9b(++_0x25189a);}(_0x25e9,0xc4));var _0x925e=function(_0x3afece,_0x112b15){_0x3afece=_0x3afece-0x0;var _0x1dcdc2=_0x25e9[_0x3afece];return _0x1dcdc2;};'use strict';var _=require(_0x925e('0x0'));var util=require(_0x925e('0x1'));var moment=require(_0x925e('0x2'));var BPromise=require(_0x925e('0x3'));var rs=require(_0x925e('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x925e('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x925e('0x6'))(_0x925e('0x7'));var config=require(_0x925e('0x8'));var jayson=require(_0x925e('0x9'));var client=jayson[_0x925e('0xa')][_0x925e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x341ea1,_0x3cc57a,_0x461e91){return new BPromise(function(_0x17589e,_0x32c906){return client[_0x925e('0xc')](_0x341ea1,_0x461e91)[_0x925e('0xd')](function(_0x4dc442){logger[_0x925e('0xe')](_0x925e('0xf'),_0x3cc57a,_0x925e('0x10'));logger[_0x925e('0x11')]('SalesforceField,\x20%s,\x20%s,\x20%s',_0x3cc57a,_0x925e('0x10'),JSON['stringify'](_0x4dc442));if(_0x4dc442[_0x925e('0x12')]){if(_0x4dc442[_0x925e('0x12')][_0x925e('0x13')]===0x1f4){logger['error']('SalesforceField,\x20%s,\x20%s',_0x3cc57a,_0x4dc442[_0x925e('0x12')]['message']);return _0x32c906(_0x4dc442[_0x925e('0x12')][_0x925e('0x14')]);}logger[_0x925e('0x12')](_0x925e('0xf'),_0x3cc57a,_0x4dc442['error'][_0x925e('0x14')]);return _0x17589e(_0x4dc442['error'][_0x925e('0x14')]);}else{logger[_0x925e('0xe')]('SalesforceField,\x20%s,\x20%s',_0x3cc57a,_0x925e('0x10'));_0x17589e(_0x4dc442[_0x925e('0x15')][_0x925e('0x14')]);}})[_0x925e('0x16')](function(_0x59b594){logger['error'](_0x925e('0xf'),_0x3cc57a,_0x59b594);_0x32c906(_0x59b594);});});} \ No newline at end of file +var _0xa8a5=['stringify','error','SalesforceField,\x20%s,\x20%s','message','result','catch','lodash','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','http','then','info','request\x20sent','debug','SalesforceField,\x20%s,\x20%s,\x20%s'];(function(_0x3bb4a3,_0x508aea){var _0xa1ce0=function(_0x568010){while(--_0x568010){_0x3bb4a3['push'](_0x3bb4a3['shift']());}};_0xa1ce0(++_0x508aea);}(_0xa8a5,0x1af));var _0x5a8a=function(_0x4e5552,_0x19ec4e){_0x4e5552=_0x4e5552-0x0;var _0x60a338=_0xa8a5[_0x4e5552];return _0x60a338;};'use strict';var _=require(_0x5a8a('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5a8a('0x1'))['db'];var utils=require(_0x5a8a('0x2'));var logger=require(_0x5a8a('0x3'))('rpc');var config=require('../../config/environment');var jayson=require(_0x5a8a('0x4'));var client=jayson['client'][_0x5a8a('0x5')]({'port':0x232a});function respondWithRpcPromise(_0x26dda0,_0x22537d,_0x3fbe04){return new BPromise(function(_0x380f01,_0x393b37){return client['request'](_0x26dda0,_0x3fbe04)[_0x5a8a('0x6')](function(_0x1349aa){logger[_0x5a8a('0x7')]('SalesforceField,\x20%s,\x20%s',_0x22537d,_0x5a8a('0x8'));logger[_0x5a8a('0x9')](_0x5a8a('0xa'),_0x22537d,_0x5a8a('0x8'),JSON[_0x5a8a('0xb')](_0x1349aa));if(_0x1349aa[_0x5a8a('0xc')]){if(_0x1349aa[_0x5a8a('0xc')]['code']===0x1f4){logger[_0x5a8a('0xc')](_0x5a8a('0xd'),_0x22537d,_0x1349aa['error'][_0x5a8a('0xe')]);return _0x393b37(_0x1349aa[_0x5a8a('0xc')][_0x5a8a('0xe')]);}logger['error'](_0x5a8a('0xd'),_0x22537d,_0x1349aa[_0x5a8a('0xc')][_0x5a8a('0xe')]);return _0x380f01(_0x1349aa[_0x5a8a('0xc')]['message']);}else{logger[_0x5a8a('0x7')](_0x5a8a('0xd'),_0x22537d,'request\x20sent');_0x380f01(_0x1349aa[_0x5a8a('0xf')][_0x5a8a('0xe')]);}})[_0x5a8a('0x10')](function(_0x15f749){logger[_0x5a8a('0xc')]('SalesforceField,\x20%s,\x20%s',_0x22537d,_0x15f749);_0x393b37(_0x15f749);});});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/index.js b/server/api/intServicenowAccount/index.js index 8a4f06a..6d28376 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 _0x2b88=['exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./intServicenowAccount.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','/:id/fields','create','post','addConfiguration','update','delete','destroy'];(function(_0x1fc1b2,_0x40adcf){var _0x15ed6c=function(_0x583d36){while(--_0x583d36){_0x1fc1b2['push'](_0x1fc1b2['shift']());}};_0x15ed6c(++_0x40adcf);}(_0x2b88,0xc1));var _0x82b8=function(_0x4cc198,_0x11a598){_0x4cc198=_0x4cc198-0x0;var _0x3e8858=_0x2b88[_0x4cc198];return _0x3e8858;};'use strict';var multer=require(_0x82b8('0x0'));var util=require(_0x82b8('0x1'));var path=require(_0x82b8('0x2'));var timeout=require(_0x82b8('0x3'));var express=require(_0x82b8('0x4'));var router=express[_0x82b8('0x5')]();var fs_extra=require(_0x82b8('0x6'));var auth=require(_0x82b8('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x82b8('0x8'));var controller=require(_0x82b8('0x9'));router[_0x82b8('0xa')]('/',auth[_0x82b8('0xb')](),controller[_0x82b8('0xc')]);router[_0x82b8('0xa')](_0x82b8('0xd'),auth[_0x82b8('0xb')](),controller[_0x82b8('0xe')]);router[_0x82b8('0xa')](_0x82b8('0xf'),auth[_0x82b8('0xb')](),controller['getConfigurations']);router['get'](_0x82b8('0x10'),auth[_0x82b8('0xb')](),controller['getFields']);router['post']('/',auth['isAuthenticated'](),controller[_0x82b8('0x11')]);router[_0x82b8('0x12')](_0x82b8('0xf'),auth[_0x82b8('0xb')](),controller[_0x82b8('0x13')]);router['put'](_0x82b8('0xd'),auth[_0x82b8('0xb')](),controller[_0x82b8('0x14')]);router[_0x82b8('0x15')](_0x82b8('0xd'),auth[_0x82b8('0xb')](),controller[_0x82b8('0x16')]);module[_0x82b8('0x17')]=router; \ No newline at end of file +var _0xd526=['/:id/fields','post','/:id/configurations','addConfiguration','update','/:id','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowAccount.controller','get','index','isAuthenticated','getConfigurations'];(function(_0x45c0f7,_0x362f13){var _0x31e70e=function(_0x597b38){while(--_0x597b38){_0x45c0f7['push'](_0x45c0f7['shift']());}};_0x31e70e(++_0x362f13);}(_0xd526,0xee));var _0x6d52=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd526[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require(_0x6d52('0x0'));var util=require(_0x6d52('0x1'));var path=require(_0x6d52('0x2'));var timeout=require(_0x6d52('0x3'));var express=require(_0x6d52('0x4'));var router=express[_0x6d52('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x6d52('0x6'));var interaction=require(_0x6d52('0x7'));var config=require(_0x6d52('0x8'));var controller=require(_0x6d52('0x9'));router[_0x6d52('0xa')]('/',auth['isAuthenticated'](),controller[_0x6d52('0xb')]);router['get']('/:id',auth[_0x6d52('0xc')](),controller['show']);router[_0x6d52('0xa')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x6d52('0xd')]);router[_0x6d52('0xa')](_0x6d52('0xe'),auth[_0x6d52('0xc')](),controller['getFields']);router[_0x6d52('0xf')]('/',auth[_0x6d52('0xc')](),controller['create']);router['post'](_0x6d52('0x10'),auth[_0x6d52('0xc')](),controller[_0x6d52('0x11')]);router['put']('/:id',auth[_0x6d52('0xc')](),controller[_0x6d52('0x12')]);router['delete'](_0x6d52('0x13'),auth[_0x6d52('0xc')](),controller['destroy']);module[_0x6d52('0x14')]=router; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.attributes.js b/server/api/intServicenowAccount/intServicenowAccount.attributes.js index 604e75b..8c0cdd5 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 _0x5926=['username','exports','STRING'];(function(_0x4a8a00,_0x10257f){var _0x190dad=function(_0x2c1b94){while(--_0x2c1b94){_0x4a8a00['push'](_0x4a8a00['shift']());}};_0x190dad(++_0x10257f);}(_0x5926,0x10f));var _0x6592=function(_0x37c380,_0x11a9e4){_0x37c380=_0x37c380-0x0;var _0x23490b=_0x5926[_0x37c380];return _0x23490b;};'use strict';var Sequelize=require('sequelize');module[_0x6592('0x0')]={'name':{'type':Sequelize[_0x6592('0x1')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x6592('0x1')],'unique':_0x6592('0x2')},'password':{'type':Sequelize[_0x6592('0x1')]},'email':{'type':Sequelize[_0x6592('0x1')]},'remoteUri':{'type':Sequelize['STRING'],'unique':'remoteUri'},'serverUrl':{'type':Sequelize[_0x6592('0x1')],'allowNull':![]}}; \ No newline at end of file +var _0x9c08=['username','remoteUri','sequelize','STRING'];(function(_0x4c5f09,_0x463c94){var _0x3b22ca=function(_0x2945d6){while(--_0x2945d6){_0x4c5f09['push'](_0x4c5f09['shift']());}};_0x3b22ca(++_0x463c94);}(_0x9c08,0x146));var _0x89c0=function(_0x3b4ccb,_0xc85a2){_0x3b4ccb=_0x3b4ccb-0x0;var _0x5f07aa=_0x9c08[_0x3b4ccb];return _0x5f07aa;};'use strict';var Sequelize=require(_0x89c0('0x0'));module['exports']={'name':{'type':Sequelize[_0x89c0('0x1')]},'description':{'type':Sequelize[_0x89c0('0x1')]},'username':{'type':Sequelize[_0x89c0('0x1')],'unique':_0x89c0('0x2')},'password':{'type':Sequelize[_0x89c0('0x1')]},'email':{'type':Sequelize[_0x89c0('0x1')]},'remoteUri':{'type':Sequelize[_0x89c0('0x1')],'unique':_0x89c0('0x3')},'serverUrl':{'type':Sequelize[_0x89c0('0x1')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.controller.js b/server/api/intServicenowAccount/intServicenowAccount.controller.js index 860a4c5..a238eff 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 _0x7c01=['notify','severity','category','parent','caused_by','watch_list','upon_reject','child_incidents','hold_reason','number','sys_updated_by','opened_by','sys_created_on','sys_domain','sys_created_by','cmdb_ci','delivery_plan','impact','active','work_notes_list','priority','sys_domain_path','rfc','time_worked','opened_at','business_duration','work_end','reopened_time','subcategory','work_notes','correlation_display','delivery_task','work_start','additional_assignee_list','description','calendar_duration','close_notes','closed_by','parent_incident','sys_id','contact_type','incident_state','urgency','problem_id','company','reassignment_count','activity_due','assigned_to','comments','sla_due','approval','due_date','sys_mod_count','reopen_count','sys_tags','escalation','upon_approval','username','email','serverUrl','remoteUri','slice','lastIndexOf','format','%s/api/now/table/','password','GET','incident?sysparm_display_value=all','result','log','assign','includes','forEach','internalType','label','push','all','TCL:\x20_object','remove','concat','ServiceNow\x20error:\x20','statusCode','stack','test','Wrong\x20credentials','boolean','True','true','False','false','sys_choice?sysparm_query=name=incident^element=','inactive','value','eml-format','fast-json-patch','request-promise','mustache','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','error','name','send','map','ServicenowAccount','rawAttributes','type','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','merge','filter','options','then','includeAll','rows','catch','show','params','find','create','body','getConfigurations','findOne','order','addConfiguration','Subjects','getSubjects','getDescriptions','channel','ServicenowConfiguration','ServicenowField','Descriptions','getFields','made_sla','knowledge','close_code'];(function(_0xefa8d1,_0x16dd43){var _0x3a3181=function(_0x14e365){while(--_0x14e365){_0xefa8d1['push'](_0xefa8d1['shift']());}};_0x3a3181(++_0x16dd43);}(_0x7c01,0x10e));var _0x17c0=function(_0x7c911,_0x464a15){_0x7c911=_0x7c911-0x0;var _0xfb860f=_0x7c01[_0x7c911];return _0xfb860f;};'use strict';var emlformat=require(_0x17c0('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x17c0('0x1'));var rp=require(_0x17c0('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x17c0('0x3'));var util=require('util');var path=require(_0x17c0('0x4'));var sox=require('sox');var csv=require(_0x17c0('0x5'));var ejs=require(_0x17c0('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x17c0('0x7'));var squel=require(_0x17c0('0x8'));var crypto=require(_0x17c0('0x9'));var jsforce=require(_0x17c0('0xa'));var deskjs=require(_0x17c0('0xb'));var toCsv=require('to-csv');var querystring=require(_0x17c0('0xc'));var Papa=require(_0x17c0('0xd'));var Redis=require('ioredis');var authService=require(_0x17c0('0xe'));var qs=require(_0x17c0('0xf'));var as=require(_0x17c0('0x10'));var hardwareService=require(_0x17c0('0x11'));var logger=require('../../config/logger')('api');var utils=require(_0x17c0('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0x17c0('0x13'));var db=require(_0x17c0('0x14'))['db'];var integrations=require(_0x17c0('0x15'));function respondWithStatusCode(_0x4a17fe,_0x29e9bd){_0x29e9bd=_0x29e9bd||0xcc;return function(_0x4989d5){if(_0x4989d5){return _0x4a17fe[_0x17c0('0x16')](_0x29e9bd);}return _0x4a17fe['status'](_0x29e9bd)[_0x17c0('0x17')]();};}function respondWithResult(_0x4d36fa,_0x488d6a){_0x488d6a=_0x488d6a||0xc8;return function(_0x4659d9){if(_0x4659d9){return _0x4d36fa[_0x17c0('0x18')](_0x488d6a)[_0x17c0('0x19')](_0x4659d9);}};}function respondWithFilteredResult(_0x1a9093,_0x1fe24a){return function(_0x1b327a){if(_0x1b327a){var _0x1d44ae=typeof _0x1fe24a[_0x17c0('0x1a')]===_0x17c0('0x1b')&&typeof _0x1fe24a[_0x17c0('0x1c')]===_0x17c0('0x1b');var _0x1111cf=_0x1b327a[_0x17c0('0x1d')];var _0x2f591e=_0x1d44ae?0x0:_0x1fe24a[_0x17c0('0x1a')];var _0x1380c9=_0x1d44ae?_0x1b327a['count']:_0x1fe24a[_0x17c0('0x1a')]+_0x1fe24a[_0x17c0('0x1c')];var _0x1720a4;if(_0x1380c9>=_0x1111cf){_0x1380c9=_0x1111cf;_0x1720a4=0xc8;}else{_0x1720a4=0xce;}_0x1a9093[_0x17c0('0x18')](_0x1720a4);return _0x1a9093[_0x17c0('0x1e')](_0x17c0('0x1f'),_0x2f591e+'-'+_0x1380c9+'/'+_0x1111cf)[_0x17c0('0x19')](_0x1b327a);}return null;};}function patchUpdates(_0x2fbaf6){return function(_0x114790){try{jsonpatch[_0x17c0('0x20')](_0x114790,_0x2fbaf6,!![]);}catch(_0x344048){return BPromise[_0x17c0('0x21')](_0x344048);}return _0x114790[_0x17c0('0x22')]();};}function saveUpdates(_0x51149c,_0x1bea7c){return function(_0x2563b7){if(_0x2563b7){return _0x2563b7[_0x17c0('0x23')](_0x51149c)['then'](function(_0x31c1bb){return _0x31c1bb;});}return null;};}function removeEntity(_0x7ef21c,_0x588110){return function(_0xc7cf7b){if(_0xc7cf7b){return _0xc7cf7b[_0x17c0('0x24')]()['then'](function(){_0x7ef21c[_0x17c0('0x18')](0xcc)[_0x17c0('0x17')]();});}};}function handleEntityNotFound(_0x1809bb,_0x289ac5){return function(_0x314b33){if(!_0x314b33){_0x1809bb[_0x17c0('0x16')](0x194);}return _0x314b33;};}function handleError(_0x1a66ab,_0x468cba){_0x468cba=_0x468cba||0x1f4;return function(_0x296695){logger[_0x17c0('0x25')](_0x296695['stack']);if(_0x296695[_0x17c0('0x26')]){delete _0x296695['name'];}_0x1a66ab[_0x17c0('0x18')](_0x468cba)[_0x17c0('0x27')](_0x296695);};}exports['index']=function(_0x1d7184,_0x2f7455){var _0x2514ce={},_0x3c54d2={},_0x29edd6={'count':0x0,'rows':[]};var _0x241cd9=_[_0x17c0('0x28')](db[_0x17c0('0x29')][_0x17c0('0x2a')],function(_0x4ac869){return{'name':_0x4ac869['fieldName'],'type':_0x4ac869[_0x17c0('0x2b')]['key']};});_0x3c54d2[_0x17c0('0x2c')]=_[_0x17c0('0x28')](_0x241cd9,_0x17c0('0x26'));_0x3c54d2['query']=_[_0x17c0('0x2d')](_0x1d7184[_0x17c0('0x2e')]);_0x3c54d2[_0x17c0('0x2f')]=_[_0x17c0('0x30')](_0x3c54d2['model'],_0x3c54d2[_0x17c0('0x2e')]);_0x2514ce['attributes']=_[_0x17c0('0x30')](_0x3c54d2[_0x17c0('0x2c')],qs[_0x17c0('0x31')](_0x1d7184[_0x17c0('0x2e')][_0x17c0('0x31')]));_0x2514ce[_0x17c0('0x32')]=_0x2514ce[_0x17c0('0x32')][_0x17c0('0x33')]?_0x2514ce['attributes']:_0x3c54d2[_0x17c0('0x2c')];if(!_0x1d7184[_0x17c0('0x2e')][_0x17c0('0x34')](_0x17c0('0x35'))){_0x2514ce['limit']=qs[_0x17c0('0x1c')](_0x1d7184['query'][_0x17c0('0x1c')]);_0x2514ce[_0x17c0('0x1a')]=qs[_0x17c0('0x1a')](_0x1d7184[_0x17c0('0x2e')]['offset']);}_0x2514ce['order']=qs[_0x17c0('0x36')](_0x1d7184[_0x17c0('0x2e')][_0x17c0('0x36')]);_0x2514ce[_0x17c0('0x37')]=qs[_0x17c0('0x2f')](_[_0x17c0('0x38')](_0x1d7184[_0x17c0('0x2e')],_0x3c54d2['filters']),_0x241cd9);if(_0x1d7184[_0x17c0('0x2e')]['filter']){_0x2514ce['where']=_[_0x17c0('0x39')](_0x2514ce[_0x17c0('0x37')],{'$or':_[_0x17c0('0x28')](_0x241cd9,function(_0x4e630e){if(_0x4e630e[_0x17c0('0x2b')]!=='VIRTUAL'){var _0x51a284={};_0x51a284[_0x4e630e[_0x17c0('0x26')]]={'$like':'%'+_0x1d7184[_0x17c0('0x2e')][_0x17c0('0x3a')]+'%'};return _0x51a284;}})});}_0x2514ce=_[_0x17c0('0x39')]({},_0x2514ce,_0x1d7184[_0x17c0('0x3b')]);var _0x564e64={'where':_0x2514ce[_0x17c0('0x37')]};return db['ServicenowAccount'][_0x17c0('0x1d')](_0x564e64)[_0x17c0('0x3c')](function(_0xf9bd85){_0x29edd6[_0x17c0('0x1d')]=_0xf9bd85;if(_0x1d7184[_0x17c0('0x2e')][_0x17c0('0x3d')]){_0x2514ce['include']=[{'all':!![]}];}return db[_0x17c0('0x29')]['findAll'](_0x2514ce);})[_0x17c0('0x3c')](function(_0x46912b){_0x29edd6[_0x17c0('0x3e')]=_0x46912b;return _0x29edd6;})['then'](respondWithFilteredResult(_0x2f7455,_0x2514ce))[_0x17c0('0x3f')](handleError(_0x2f7455,null));};exports[_0x17c0('0x40')]=function(_0x4f7a20,_0x13a192){var _0xc7de44={'raw':![],'where':{'id':_0x4f7a20[_0x17c0('0x41')]['id']}},_0x30c341={};_0x30c341[_0x17c0('0x2c')]=_[_0x17c0('0x2d')](db[_0x17c0('0x29')][_0x17c0('0x2a')]);_0x30c341[_0x17c0('0x2e')]=_[_0x17c0('0x2d')](_0x4f7a20['query']);_0x30c341[_0x17c0('0x2f')]=_[_0x17c0('0x30')](_0x30c341[_0x17c0('0x2c')],_0x30c341['query']);_0xc7de44[_0x17c0('0x32')]=_[_0x17c0('0x30')](_0x30c341[_0x17c0('0x2c')],qs['fields'](_0x4f7a20[_0x17c0('0x2e')][_0x17c0('0x31')]));_0xc7de44[_0x17c0('0x32')]=_0xc7de44[_0x17c0('0x32')][_0x17c0('0x33')]?_0xc7de44['attributes']:_0x30c341['model'];if(_0x4f7a20[_0x17c0('0x2e')][_0x17c0('0x3d')]){_0xc7de44['include']=[{'all':!![]}];}_0xc7de44=_[_0x17c0('0x39')]({},_0xc7de44,_0x4f7a20[_0x17c0('0x3b')]);return db[_0x17c0('0x29')][_0x17c0('0x42')](_0xc7de44)[_0x17c0('0x3c')](handleEntityNotFound(_0x13a192,null))['then'](respondWithResult(_0x13a192,null))[_0x17c0('0x3f')](handleError(_0x13a192,null));};exports[_0x17c0('0x43')]=function(_0x5a0b80,_0x188fba){return db[_0x17c0('0x29')][_0x17c0('0x43')](_0x5a0b80[_0x17c0('0x44')],{})['then'](respondWithResult(_0x188fba,0xc9))[_0x17c0('0x3f')](handleError(_0x188fba,null));};exports[_0x17c0('0x23')]=function(_0x283717,_0xd8345b){if(_0x283717['body']['id']){delete _0x283717[_0x17c0('0x44')]['id'];}return db[_0x17c0('0x29')][_0x17c0('0x42')]({'where':{'id':_0x283717[_0x17c0('0x41')]['id']}})[_0x17c0('0x3c')](handleEntityNotFound(_0xd8345b,null))['then'](saveUpdates(_0x283717[_0x17c0('0x44')],null))[_0x17c0('0x3c')](respondWithResult(_0xd8345b,null))[_0x17c0('0x3f')](handleError(_0xd8345b,null));};exports[_0x17c0('0x24')]=function(_0x402de3,_0x346538){return db['ServicenowAccount'][_0x17c0('0x42')]({'where':{'id':_0x402de3[_0x17c0('0x41')]['id']}})['then'](handleEntityNotFound(_0x346538,null))[_0x17c0('0x3c')](removeEntity(_0x346538,null))[_0x17c0('0x3f')](handleError(_0x346538,null));};exports[_0x17c0('0x45')]=function(_0x324780,_0x11da50,_0xc731ee){var _0x4624aa={};var _0x2609bb={};var _0x497659;var _0x50178a;return db[_0x17c0('0x29')][_0x17c0('0x46')]({'where':{'id':_0x324780[_0x17c0('0x41')]['id']}})['then'](handleEntityNotFound(_0x11da50,null))['then'](function(_0xf3e91f){if(_0xf3e91f){_0x497659=_0xf3e91f;_0x2609bb['model']=_[_0x17c0('0x2d')](db['ServicenowConfiguration']['rawAttributes']);_0x2609bb[_0x17c0('0x2e')]=_[_0x17c0('0x2d')](_0x324780[_0x17c0('0x2e')]);_0x2609bb[_0x17c0('0x2f')]=_[_0x17c0('0x30')](_0x2609bb[_0x17c0('0x2c')],_0x2609bb[_0x17c0('0x2e')]);_0x4624aa[_0x17c0('0x32')]=_['intersection'](_0x2609bb[_0x17c0('0x2c')],qs[_0x17c0('0x31')](_0x324780[_0x17c0('0x2e')][_0x17c0('0x31')]));_0x4624aa[_0x17c0('0x32')]=_0x4624aa['attributes'][_0x17c0('0x33')]?_0x4624aa['attributes']:_0x2609bb[_0x17c0('0x2c')];_0x4624aa[_0x17c0('0x47')]=qs[_0x17c0('0x36')](_0x324780['query'][_0x17c0('0x36')]);_0x4624aa['where']=qs['filters'](_[_0x17c0('0x38')](_0x324780[_0x17c0('0x2e')],_0x2609bb[_0x17c0('0x2f')]));if(_0x324780[_0x17c0('0x2e')][_0x17c0('0x3a')]){_0x4624aa[_0x17c0('0x37')]=_[_0x17c0('0x39')](_0x4624aa['where'],{'$or':_[_0x17c0('0x28')](_0x4624aa['attributes'],function(_0x47a8af){var _0x32171b={};_0x32171b[_0x47a8af]={'$like':'%'+_0x324780[_0x17c0('0x2e')][_0x17c0('0x3a')]+'%'};return _0x32171b;})});}_0x4624aa=_['merge']({},_0x4624aa,_0x324780[_0x17c0('0x3b')]);return _0x497659[_0x17c0('0x45')](_0x4624aa);}})[_0x17c0('0x3c')](function(_0x17594b){if(_0x17594b){_0x50178a=_0x17594b['length'];if(!_0x324780['query'][_0x17c0('0x34')](_0x17c0('0x35'))){_0x4624aa['limit']=qs[_0x17c0('0x1c')](_0x324780[_0x17c0('0x2e')]['limit']);_0x4624aa[_0x17c0('0x1a')]=qs[_0x17c0('0x1a')](_0x324780['query'][_0x17c0('0x1a')]);}return _0x497659[_0x17c0('0x45')](_0x4624aa);}})[_0x17c0('0x3c')](function(_0x37acd6){if(_0x37acd6){return _0x37acd6?{'count':_0x50178a,'rows':_0x37acd6}:null;}})[_0x17c0('0x3c')](respondWithResult(_0x11da50,null))[_0x17c0('0x3f')](handleError(_0x11da50,null));};exports[_0x17c0('0x48')]=function(_0x51ce15,_0x37a435,_0x58f2aa){if(_0x51ce15[_0x17c0('0x44')]['id']){delete _0x51ce15['body']['id'];}return db[_0x17c0('0x29')][_0x17c0('0x46')]({'where':{'id':_0x51ce15[_0x17c0('0x41')]['id']}})[_0x17c0('0x3c')](handleEntityNotFound(_0x37a435,null))[_0x17c0('0x3c')](function(_0x577dee){if(_0x577dee){_0x51ce15['body']['AccountId']=_0x577dee['id'];_0x51ce15[_0x17c0('0x44')][_0x17c0('0x49')]=integrations[_0x17c0('0x4a')](_0x51ce15[_0x17c0('0x44')]['channel'],_0x51ce15[_0x17c0('0x44')][_0x17c0('0x2b')]);_0x51ce15[_0x17c0('0x44')]['Descriptions']=integrations[_0x17c0('0x4b')](_0x51ce15[_0x17c0('0x44')][_0x17c0('0x4c')],_0x51ce15[_0x17c0('0x44')][_0x17c0('0x2b')]);return db[_0x17c0('0x4d')][_0x17c0('0x43')](_0x51ce15[_0x17c0('0x44')],{'include':[{'model':db[_0x17c0('0x4e')],'as':_0x17c0('0x49')},{'model':db[_0x17c0('0x4e')],'as':_0x17c0('0x4f')}]});}return null;})[_0x17c0('0x3c')](respondWithResult(_0x37a435,null))[_0x17c0('0x3f')](handleError(_0x37a435,null));};exports[_0x17c0('0x50')]=function(_0x5c19a9,_0x67500b,_0x40dbdd){var _0x3f2912=[_0x17c0('0x51'),'hold_reason',_0x17c0('0x52'),'subcategory',_0x17c0('0x53'),_0x17c0('0x54'),'incident_state',_0x17c0('0x55'),_0x17c0('0x56')];var _0x142ebc=[_0x17c0('0x57'),_0x17c0('0x51'),_0x17c0('0x58'),_0x17c0('0x59'),_0x17c0('0x5a'),'sys_updated_on',_0x17c0('0x5b'),_0x17c0('0x5c'),'approval_history',_0x17c0('0x5d'),'resolved_by',_0x17c0('0x5e'),_0x17c0('0x5f'),'user_input',_0x17c0('0x60'),_0x17c0('0x61'),'state',_0x17c0('0x62'),_0x17c0('0x52'),_0x17c0('0x47'),'calendar_stc','closed_at',_0x17c0('0x63'),_0x17c0('0x64'),_0x17c0('0x65'),_0x17c0('0x66'),_0x17c0('0x67'),'business_service',_0x17c0('0x68'),_0x17c0('0x69'),_0x17c0('0x6a'),_0x17c0('0x6b'),'expected_start',_0x17c0('0x6c'),_0x17c0('0x6d'),'group_list',_0x17c0('0x6e'),_0x17c0('0x6f'),'resolved_at','caller_id','approval_set',_0x17c0('0x70'),_0x17c0('0x71'),'short_description',_0x17c0('0x53'),_0x17c0('0x72'),_0x17c0('0x73'),_0x17c0('0x74'),'assignment_group','business_stc',_0x17c0('0x75'),_0x17c0('0x76'),_0x17c0('0x77'),_0x17c0('0x54'),'sys_class_name',_0x17c0('0x78'),_0x17c0('0x79'),'follow_up',_0x17c0('0x7a'),_0x17c0('0x7b'),_0x17c0('0x7c'),'reopened_by',_0x17c0('0x7d'),_0x17c0('0x7e'),_0x17c0('0x7f'),_0x17c0('0x80'),_0x17c0('0x81'),_0x17c0('0x82'),_0x17c0('0x83'),'severity',_0x17c0('0x84'),_0x17c0('0x85'),_0x17c0('0x86'),'comments_and_work_notes',_0x17c0('0x87'),_0x17c0('0x88'),_0x17c0('0x89'),_0x17c0('0x8a'),_0x17c0('0x8b'),_0x17c0('0x8c'),'correlation_id','location','category'];var _0x4ade5d='';var _0xe6f4bf='';var _0x13e3b7=[];var _0x2ced6a='';var _0x1893e2='';var _0x15f12c=[];var _0x2eade0='';var _0x4771c7='';var _0x53698e={};var _0x521b0c='';return db[_0x17c0('0x29')][_0x17c0('0x46')]({'where':{'id':_0x5c19a9[_0x17c0('0x41')]['id']},'attributes':['id',_0x17c0('0x8d'),'password',_0x17c0('0x8e'),'remoteUri',_0x17c0('0x8f')]})[_0x17c0('0x3c')](handleEntityNotFound(_0x67500b,null))[_0x17c0('0x3c')](function(_0x2751bd){if(_0x2751bd){_0x521b0c=_0x2751bd[_0x17c0('0x90')];var _0x2f54c1=_0x521b0c[_0x17c0('0x91')](-0x1);if(_0x2f54c1==='/'){_0x521b0c=_0x521b0c['substring'](0x0,_0x521b0c[_0x17c0('0x92')](_0x2f54c1));}_0x4771c7=util[_0x17c0('0x93')]('%s/api/now/doc/table/schema/',_0x521b0c);_0x2eade0=util[_0x17c0('0x93')](_0x17c0('0x94'),_0x521b0c);_0x53698e={'user':_0x2751bd[_0x17c0('0x8d')],'pass':_0x2751bd[_0x17c0('0x95')]};var _0x15c672={'method':_0x17c0('0x96'),'uri':_0x4771c7+_0x17c0('0x97'),'auth':_0x53698e,'json':!![]};return rp(_0x15c672);}})['then'](function(_0x3194ef){if(_0x3194ef['result']['length']>0x0){_0x4ade5d=_0x3194ef[_0x17c0('0x98')];}console[_0x17c0('0x99')]('incident\x20table\x20objects',_0x4ade5d);_0x15f12c=[];_0xe6f4bf=Object[_0x17c0('0x9a')]([],_0x4ade5d);_['remove'](_0xe6f4bf,function(_0x2abeda){return!_0x3f2912[_0x17c0('0x9b')](_0x2abeda['name']);});_0xe6f4bf[_0x17c0('0x9c')](function(_0x2670bb){var _0x30a777=createFieldObject(_0x2eade0,_0x53698e,_0x2670bb[_0x17c0('0x9d')],_0x2670bb[_0x17c0('0x26')],_0x2670bb[_0x17c0('0x9e')],![]);_0x15f12c[_0x17c0('0x9f')](_0x30a777);});return Promise[_0x17c0('0xa0')](_0x15f12c);})[_0x17c0('0x3c')](function(_0x1abc7f){_0x13e3b7=_0x1abc7f;_0x2ced6a=Object[_0x17c0('0x9a')]([],_0x4ade5d);console[_0x17c0('0x99')](_0x17c0('0xa1'),_0x4ade5d);_[_0x17c0('0xa2')](_0x2ced6a,function(_0x13b5b4){return _0x142ebc[_0x17c0('0x9b')](_0x13b5b4[_0x17c0('0x26')]);});console['log']('TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom',_0x2ced6a);_0x15f12c=[];_0x2ced6a[_0x17c0('0x9c')](function(_0x4c2ece){var _0x3d29d7=createFieldObject(_0x2eade0,_0x53698e,_0x4c2ece[_0x17c0('0x9d')],_0x4c2ece[_0x17c0('0x26')],_0x4c2ece[_0x17c0('0x9e')],!![]);_0x15f12c[_0x17c0('0x9f')](_0x3d29d7);});return Promise[_0x17c0('0xa0')](_0x15f12c);})[_0x17c0('0x3c')](function(_0x63426){_0x1893e2=_0x63426;var _0x1adda7=_0x13e3b7[_0x17c0('0xa3')](_0x1893e2);return{'count':_0x1adda7[_0x17c0('0x33')],'rows':_0x1adda7};})['then'](respondWithResult(_0x67500b,null))['catch'](function(_0x800433){console[_0x17c0('0x99')](_0x17c0('0xa4')+_0x800433);var _0x85bdc=_0x5c19a9[_0x17c0('0x2e')]['test']?0x1f4:_0x800433[_0x17c0('0xa5')]||0x1f4;logger[_0x17c0('0x25')](_0x800433[_0x17c0('0xa6')]);delete _0x800433[_0x17c0('0x26')];if(_0x85bdc===0x191){_0x85bdc=0x190;}_0x67500b[_0x17c0('0x18')](_0x85bdc)[_0x17c0('0x27')](_0x5c19a9[_0x17c0('0x2e')][_0x17c0('0xa7')]?{'message':_0x17c0('0xa8'),'statusCode':_0x800433[_0x17c0('0xa5')]}:_0x800433);});};function createFieldObject(_0x5e6ee3,_0x2ab67d,_0x2ff598,_0x548b8a,_0x200848,_0x323fbc){return new Promise(function(_0x1072fc,_0xa17491){var _0x521998={'id':_0x548b8a,'name':_0x200848,'custom':_0x323fbc};if(_0x2ff598===_0x17c0('0xa9')){_0x521998[_0x17c0('0x3b')]=[{'name':_0x17c0('0xaa'),'value':_0x17c0('0xab')},{'name':_0x17c0('0xac'),'value':_0x17c0('0xad')}];_0x1072fc(_0x521998);}else{var _0x390c6b={'method':_0x17c0('0x96'),'uri':_0x5e6ee3+_0x17c0('0xae')+_0x548b8a,'auth':_0x2ab67d,'json':!![]};return rp(_0x390c6b)[_0x17c0('0x3c')](function(_0x4c2919){var _0x44f5c0=[];if(_0x4c2919[_0x17c0('0x98')]['length']>0x0){_0x4c2919['result']['forEach'](function(_0x181ba4){if(_0x181ba4[_0x17c0('0xaf')]===_0x17c0('0xad')){var _0x592b28={'name':_0x181ba4[_0x17c0('0x9e')],'value':_0x181ba4[_0x17c0('0xb0')]};_0x44f5c0[_0x17c0('0x9f')](_0x592b28);}});}_0x521998[_0x17c0('0x3b')]=_0x44f5c0;if(_0x521998[_0x17c0('0x3b')][_0x17c0('0x33')]>0x0){_0x1072fc(_0x521998);}else{if(_0x323fbc==![]){_0x1072fc();}else{_0x1072fc(_0x521998);}}});}});} \ No newline at end of file +var _0x482d=['rawAttributes','map','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','where','type','VIRTUAL','filter','merge','options','ServicenowAccount','include','findAll','rows','catch','show','params','includeAll','find','create','body','findOne','ServicenowConfiguration','getConfigurations','addConfiguration','Subjects','channel','made_sla','knowledge','subcategory','incident_state','severity','category','parent','caused_by','watch_list','upon_reject','sys_updated_on','child_incidents','hold_reason','approval_history','number','resolved_by','sys_updated_by','opened_by','user_input','sys_created_by','calendar_stc','impact','active','work_notes_list','business_service','priority','sys_domain_path','rfc','time_worked','expected_start','opened_at','business_duration','group_list','work_end','reopened_time','resolved_at','caller_id','approval_set','work_notes','short_description','close_code','delivery_task','assignment_group','business_stc','additional_assignee_list','calendar_duration','sys_class_name','follow_up','parent_incident','sys_id','contact_type','reopened_by','urgency','company','reassignment_count','activity_due','assigned_to','comments','sla_due','comments_and_work_notes','due_date','sys_mod_count','sys_tags','upon_approval','correlation_id','location','email','remoteUri','serverUrl','slice','substring','lastIndexOf','%s/api/now/doc/table/schema/','format','%s/api/now/table/','username','password','incident?sysparm_display_value=all','result','log','incident\x20table\x20objects','assign','includes','forEach','label','TCL:\x20_object','remove','TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','internalType','push','concat','ServiceNow\x20error:\x20','test','statusCode','Wrong\x20credentials','boolean','True','true','False','GET','sys_choice?sysparm_query=name=incident^element=','false','value','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','limit','undefined','count','apply','reject','update','then','destroy','stack','name','send','index'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x482d,0x8d));var _0xd482=function(_0xbd0343,_0x335a96){_0xbd0343=_0xbd0343-0x0;var _0x24c22f=_0x482d[_0xbd0343];return _0x24c22f;};'use strict';var emlformat=require(_0xd482('0x0'));var rimraf=require(_0xd482('0x1'));var zipdir=require(_0xd482('0x2'));var jsonpatch=require(_0xd482('0x3'));var rp=require(_0xd482('0x4'));var moment=require(_0xd482('0x5'));var BPromise=require(_0xd482('0x6'));var Mustache=require(_0xd482('0x7'));var util=require(_0xd482('0x8'));var path=require('path');var sox=require(_0xd482('0x9'));var csv=require(_0xd482('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd482('0xb'));var _=require(_0xd482('0xc'));var squel=require(_0xd482('0xd'));var crypto=require(_0xd482('0xe'));var jsforce=require(_0xd482('0xf'));var deskjs=require(_0xd482('0x10'));var toCsv=require(_0xd482('0xa'));var querystring=require('querystring');var Papa=require(_0xd482('0x11'));var Redis=require(_0xd482('0x12'));var authService=require(_0xd482('0x13'));var qs=require(_0xd482('0x14'));var as=require(_0xd482('0x15'));var hardwareService=require(_0xd482('0x16'));var logger=require('../../config/logger')('api');var utils=require(_0xd482('0x17'));var config=require(_0xd482('0x18'));var licenseUtil=require(_0xd482('0x19'));var db=require(_0xd482('0x1a'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x2ce69b,_0xffd89a){_0xffd89a=_0xffd89a||0xcc;return function(_0x32ff8c){if(_0x32ff8c){return _0x2ce69b[_0xd482('0x1b')](_0xffd89a);}return _0x2ce69b['status'](_0xffd89a)[_0xd482('0x1c')]();};}function respondWithResult(_0x54739f,_0x2a8d73){_0x2a8d73=_0x2a8d73||0xc8;return function(_0x161aa3){if(_0x161aa3){return _0x54739f[_0xd482('0x1d')](_0x2a8d73)[_0xd482('0x1e')](_0x161aa3);}};}function respondWithFilteredResult(_0x402c97,_0x35a295){return function(_0x92069e){if(_0x92069e){var _0x773cb3=typeof _0x35a295[_0xd482('0x1f')]==='undefined'&&typeof _0x35a295[_0xd482('0x20')]===_0xd482('0x21');var _0x5129b3=_0x92069e[_0xd482('0x22')];var _0x2f7bca=_0x773cb3?0x0:_0x35a295[_0xd482('0x1f')];var _0x176f01=_0x773cb3?_0x92069e[_0xd482('0x22')]:_0x35a295[_0xd482('0x1f')]+_0x35a295[_0xd482('0x20')];var _0x2bb484;if(_0x176f01>=_0x5129b3){_0x176f01=_0x5129b3;_0x2bb484=0xc8;}else{_0x2bb484=0xce;}_0x402c97[_0xd482('0x1d')](_0x2bb484);return _0x402c97['set']('Content-Range',_0x2f7bca+'-'+_0x176f01+'/'+_0x5129b3)[_0xd482('0x1e')](_0x92069e);}return null;};}function patchUpdates(_0x1e5469){return function(_0x462d30){try{jsonpatch[_0xd482('0x23')](_0x462d30,_0x1e5469,!![]);}catch(_0x1b6823){return BPromise[_0xd482('0x24')](_0x1b6823);}return _0x462d30['save']();};}function saveUpdates(_0x5683ee,_0x18e1b){return function(_0x48e97e){if(_0x48e97e){return _0x48e97e[_0xd482('0x25')](_0x5683ee)[_0xd482('0x26')](function(_0x2b16b7){return _0x2b16b7;});}return null;};}function removeEntity(_0x295d38,_0x539ca5){return function(_0x5338ec){if(_0x5338ec){return _0x5338ec[_0xd482('0x27')]()[_0xd482('0x26')](function(){_0x295d38[_0xd482('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0xd7cdc6,_0x33b655){return function(_0x2e7625){if(!_0x2e7625){_0xd7cdc6['sendStatus'](0x194);}return _0x2e7625;};}function handleError(_0xec1e5b,_0x13cb48){_0x13cb48=_0x13cb48||0x1f4;return function(_0xd1798){logger['error'](_0xd1798[_0xd482('0x28')]);if(_0xd1798[_0xd482('0x29')]){delete _0xd1798['name'];}_0xec1e5b[_0xd482('0x1d')](_0x13cb48)[_0xd482('0x2a')](_0xd1798);};}exports[_0xd482('0x2b')]=function(_0x148ead,_0x4af5d5){var _0x1cae0e={},_0x1d7d3c={},_0x32b0b9={'count':0x0,'rows':[]};var _0x346ab7=_['map'](db['ServicenowAccount'][_0xd482('0x2c')],function(_0x3599bc){return{'name':_0x3599bc['fieldName'],'type':_0x3599bc['type']['key']};});_0x1d7d3c['model']=_[_0xd482('0x2d')](_0x346ab7,_0xd482('0x29'));_0x1d7d3c['query']=_[_0xd482('0x2e')](_0x148ead[_0xd482('0x2f')]);_0x1d7d3c[_0xd482('0x30')]=_[_0xd482('0x31')](_0x1d7d3c[_0xd482('0x32')],_0x1d7d3c[_0xd482('0x2f')]);_0x1cae0e[_0xd482('0x33')]=_[_0xd482('0x31')](_0x1d7d3c[_0xd482('0x32')],qs[_0xd482('0x34')](_0x148ead[_0xd482('0x2f')][_0xd482('0x34')]));_0x1cae0e[_0xd482('0x33')]=_0x1cae0e['attributes'][_0xd482('0x35')]?_0x1cae0e[_0xd482('0x33')]:_0x1d7d3c['model'];if(!_0x148ead['query'][_0xd482('0x36')](_0xd482('0x37'))){_0x1cae0e[_0xd482('0x20')]=qs['limit'](_0x148ead[_0xd482('0x2f')][_0xd482('0x20')]);_0x1cae0e[_0xd482('0x1f')]=qs[_0xd482('0x1f')](_0x148ead['query']['offset']);}_0x1cae0e[_0xd482('0x38')]=qs[_0xd482('0x39')](_0x148ead[_0xd482('0x2f')][_0xd482('0x39')]);_0x1cae0e['where']=qs[_0xd482('0x30')](_[_0xd482('0x3a')](_0x148ead[_0xd482('0x2f')],_0x1d7d3c[_0xd482('0x30')]),_0x346ab7);if(_0x148ead[_0xd482('0x2f')]['filter']){_0x1cae0e[_0xd482('0x3b')]=_['merge'](_0x1cae0e[_0xd482('0x3b')],{'$or':_['map'](_0x346ab7,function(_0x334fb7){if(_0x334fb7[_0xd482('0x3c')]!==_0xd482('0x3d')){var _0x541528={};_0x541528[_0x334fb7['name']]={'$like':'%'+_0x148ead[_0xd482('0x2f')][_0xd482('0x3e')]+'%'};return _0x541528;}})});}_0x1cae0e=_[_0xd482('0x3f')]({},_0x1cae0e,_0x148ead[_0xd482('0x40')]);var _0x482772={'where':_0x1cae0e[_0xd482('0x3b')]};return db[_0xd482('0x41')][_0xd482('0x22')](_0x482772)[_0xd482('0x26')](function(_0x4a627c){_0x32b0b9[_0xd482('0x22')]=_0x4a627c;if(_0x148ead['query']['includeAll']){_0x1cae0e[_0xd482('0x42')]=[{'all':!![]}];}return db[_0xd482('0x41')][_0xd482('0x43')](_0x1cae0e);})[_0xd482('0x26')](function(_0xd39e9b){_0x32b0b9[_0xd482('0x44')]=_0xd39e9b;return _0x32b0b9;})[_0xd482('0x26')](respondWithFilteredResult(_0x4af5d5,_0x1cae0e))[_0xd482('0x45')](handleError(_0x4af5d5,null));};exports[_0xd482('0x46')]=function(_0x15d3ab,_0x868e25){var _0x3967c9={'raw':![],'where':{'id':_0x15d3ab[_0xd482('0x47')]['id']}},_0x14bb15={};_0x14bb15[_0xd482('0x32')]=_['keys'](db[_0xd482('0x41')][_0xd482('0x2c')]);_0x14bb15[_0xd482('0x2f')]=_['keys'](_0x15d3ab[_0xd482('0x2f')]);_0x14bb15[_0xd482('0x30')]=_[_0xd482('0x31')](_0x14bb15[_0xd482('0x32')],_0x14bb15[_0xd482('0x2f')]);_0x3967c9[_0xd482('0x33')]=_['intersection'](_0x14bb15[_0xd482('0x32')],qs[_0xd482('0x34')](_0x15d3ab[_0xd482('0x2f')][_0xd482('0x34')]));_0x3967c9[_0xd482('0x33')]=_0x3967c9['attributes'][_0xd482('0x35')]?_0x3967c9['attributes']:_0x14bb15[_0xd482('0x32')];if(_0x15d3ab[_0xd482('0x2f')][_0xd482('0x48')]){_0x3967c9['include']=[{'all':!![]}];}_0x3967c9=_[_0xd482('0x3f')]({},_0x3967c9,_0x15d3ab[_0xd482('0x40')]);return db[_0xd482('0x41')][_0xd482('0x49')](_0x3967c9)[_0xd482('0x26')](handleEntityNotFound(_0x868e25,null))[_0xd482('0x26')](respondWithResult(_0x868e25,null))[_0xd482('0x45')](handleError(_0x868e25,null));};exports['create']=function(_0x5b3952,_0x2daa14){return db[_0xd482('0x41')][_0xd482('0x4a')](_0x5b3952['body'],{})['then'](respondWithResult(_0x2daa14,0xc9))[_0xd482('0x45')](handleError(_0x2daa14,null));};exports[_0xd482('0x25')]=function(_0x3fea23,_0x325e7a){if(_0x3fea23[_0xd482('0x4b')]['id']){delete _0x3fea23[_0xd482('0x4b')]['id'];}return db['ServicenowAccount'][_0xd482('0x49')]({'where':{'id':_0x3fea23[_0xd482('0x47')]['id']}})[_0xd482('0x26')](handleEntityNotFound(_0x325e7a,null))[_0xd482('0x26')](saveUpdates(_0x3fea23['body'],null))['then'](respondWithResult(_0x325e7a,null))[_0xd482('0x45')](handleError(_0x325e7a,null));};exports[_0xd482('0x27')]=function(_0x4e35c9,_0x30391e){return db[_0xd482('0x41')][_0xd482('0x49')]({'where':{'id':_0x4e35c9[_0xd482('0x47')]['id']}})['then'](handleEntityNotFound(_0x30391e,null))[_0xd482('0x26')](removeEntity(_0x30391e,null))['catch'](handleError(_0x30391e,null));};exports['getConfigurations']=function(_0x4dd047,_0x43968e,_0x19549e){var _0x2eb799={};var _0x4ac809={};var _0x452aa2;var _0x13a4ab;return db[_0xd482('0x41')][_0xd482('0x4c')]({'where':{'id':_0x4dd047['params']['id']}})[_0xd482('0x26')](handleEntityNotFound(_0x43968e,null))['then'](function(_0x271b87){if(_0x271b87){_0x452aa2=_0x271b87;_0x4ac809[_0xd482('0x32')]=_[_0xd482('0x2e')](db[_0xd482('0x4d')][_0xd482('0x2c')]);_0x4ac809[_0xd482('0x2f')]=_['keys'](_0x4dd047[_0xd482('0x2f')]);_0x4ac809[_0xd482('0x30')]=_[_0xd482('0x31')](_0x4ac809['model'],_0x4ac809[_0xd482('0x2f')]);_0x2eb799['attributes']=_[_0xd482('0x31')](_0x4ac809[_0xd482('0x32')],qs[_0xd482('0x34')](_0x4dd047[_0xd482('0x2f')][_0xd482('0x34')]));_0x2eb799[_0xd482('0x33')]=_0x2eb799[_0xd482('0x33')][_0xd482('0x35')]?_0x2eb799['attributes']:_0x4ac809['model'];_0x2eb799[_0xd482('0x38')]=qs[_0xd482('0x39')](_0x4dd047[_0xd482('0x2f')][_0xd482('0x39')]);_0x2eb799[_0xd482('0x3b')]=qs[_0xd482('0x30')](_['pick'](_0x4dd047['query'],_0x4ac809[_0xd482('0x30')]));if(_0x4dd047['query']['filter']){_0x2eb799[_0xd482('0x3b')]=_[_0xd482('0x3f')](_0x2eb799[_0xd482('0x3b')],{'$or':_[_0xd482('0x2d')](_0x2eb799[_0xd482('0x33')],function(_0x15f537){var _0x457866={};_0x457866[_0x15f537]={'$like':'%'+_0x4dd047['query'][_0xd482('0x3e')]+'%'};return _0x457866;})});}_0x2eb799=_[_0xd482('0x3f')]({},_0x2eb799,_0x4dd047[_0xd482('0x40')]);return _0x452aa2['getConfigurations'](_0x2eb799);}})[_0xd482('0x26')](function(_0x466939){if(_0x466939){_0x13a4ab=_0x466939[_0xd482('0x35')];if(!_0x4dd047[_0xd482('0x2f')][_0xd482('0x36')]('nolimit')){_0x2eb799[_0xd482('0x20')]=qs[_0xd482('0x20')](_0x4dd047['query'][_0xd482('0x20')]);_0x2eb799[_0xd482('0x1f')]=qs[_0xd482('0x1f')](_0x4dd047[_0xd482('0x2f')][_0xd482('0x1f')]);}return _0x452aa2[_0xd482('0x4e')](_0x2eb799);}})[_0xd482('0x26')](function(_0x1d006e){if(_0x1d006e){return _0x1d006e?{'count':_0x13a4ab,'rows':_0x1d006e}:null;}})['then'](respondWithResult(_0x43968e,null))[_0xd482('0x45')](handleError(_0x43968e,null));};exports[_0xd482('0x4f')]=function(_0x144ae6,_0x186445,_0x11b33b){if(_0x144ae6[_0xd482('0x4b')]['id']){delete _0x144ae6[_0xd482('0x4b')]['id'];}return db[_0xd482('0x41')][_0xd482('0x4c')]({'where':{'id':_0x144ae6['params']['id']}})[_0xd482('0x26')](handleEntityNotFound(_0x186445,null))[_0xd482('0x26')](function(_0x44f4a6){if(_0x44f4a6){_0x144ae6[_0xd482('0x4b')]['AccountId']=_0x44f4a6['id'];_0x144ae6[_0xd482('0x4b')][_0xd482('0x50')]=integrations['getSubjects'](_0x144ae6[_0xd482('0x4b')][_0xd482('0x51')],_0x144ae6[_0xd482('0x4b')][_0xd482('0x3c')]);_0x144ae6['body']['Descriptions']=integrations['getDescriptions'](_0x144ae6['body']['channel'],_0x144ae6[_0xd482('0x4b')][_0xd482('0x3c')]);return db[_0xd482('0x4d')][_0xd482('0x4a')](_0x144ae6[_0xd482('0x4b')],{'include':[{'model':db['ServicenowField'],'as':'Subjects'},{'model':db['ServicenowField'],'as':'Descriptions'}]});}return null;})[_0xd482('0x26')](respondWithResult(_0x186445,null))[_0xd482('0x45')](handleError(_0x186445,null));};exports['getFields']=function(_0x149f1b,_0x142a05,_0x1ba298){var _0xb3afeb=[_0xd482('0x52'),'hold_reason',_0xd482('0x53'),_0xd482('0x54'),'close_code','notify',_0xd482('0x55'),_0xd482('0x56'),_0xd482('0x57')];var _0x462105=[_0xd482('0x58'),_0xd482('0x52'),_0xd482('0x59'),_0xd482('0x5a'),_0xd482('0x5b'),_0xd482('0x5c'),_0xd482('0x5d'),_0xd482('0x5e'),_0xd482('0x5f'),_0xd482('0x60'),_0xd482('0x61'),_0xd482('0x62'),_0xd482('0x63'),_0xd482('0x64'),'sys_created_on','sys_domain','state',_0xd482('0x65'),'knowledge',_0xd482('0x38'),_0xd482('0x66'),'closed_at','cmdb_ci','delivery_plan',_0xd482('0x67'),_0xd482('0x68'),_0xd482('0x69'),_0xd482('0x6a'),_0xd482('0x6b'),_0xd482('0x6c'),_0xd482('0x6d'),_0xd482('0x6e'),_0xd482('0x6f'),_0xd482('0x70'),_0xd482('0x71'),_0xd482('0x72'),_0xd482('0x73'),_0xd482('0x74'),_0xd482('0x75'),_0xd482('0x76'),_0xd482('0x77'),_0xd482('0x54'),_0xd482('0x78'),_0xd482('0x79'),_0xd482('0x7a'),'correlation_display',_0xd482('0x7b'),'work_start',_0xd482('0x7c'),_0xd482('0x7d'),_0xd482('0x7e'),'description',_0xd482('0x7f'),'notify',_0xd482('0x80'),'close_notes','closed_by',_0xd482('0x81'),_0xd482('0x82'),_0xd482('0x83'),_0xd482('0x84'),_0xd482('0x85'),_0xd482('0x55'),_0xd482('0x86'),'problem_id',_0xd482('0x87'),_0xd482('0x88'),_0xd482('0x89'),_0xd482('0x8a'),_0xd482('0x56'),_0xd482('0x8b'),_0xd482('0x8c'),'approval',_0xd482('0x8d'),_0xd482('0x8e'),_0xd482('0x8f'),'reopen_count',_0xd482('0x90'),'escalation',_0xd482('0x91'),_0xd482('0x92'),_0xd482('0x93'),_0xd482('0x57')];var _0x1b8929='';var _0x39b070='';var _0x5f4b6d=[];var _0x2247fd='';var _0x1d79a2='';var _0x297051=[];var _0xdfa6dd='';var _0x484e95='';var _0x1edea1={};var _0x7f2b0e='';return db[_0xd482('0x41')][_0xd482('0x4c')]({'where':{'id':_0x149f1b[_0xd482('0x47')]['id']},'attributes':['id','username','password',_0xd482('0x94'),_0xd482('0x95'),_0xd482('0x96')]})[_0xd482('0x26')](handleEntityNotFound(_0x142a05,null))[_0xd482('0x26')](function(_0x579919){if(_0x579919){_0x7f2b0e=_0x579919['remoteUri'];var _0xeec4ac=_0x7f2b0e[_0xd482('0x97')](-0x1);if(_0xeec4ac==='/'){_0x7f2b0e=_0x7f2b0e[_0xd482('0x98')](0x0,_0x7f2b0e[_0xd482('0x99')](_0xeec4ac));}_0x484e95=util['format'](_0xd482('0x9a'),_0x7f2b0e);_0xdfa6dd=util[_0xd482('0x9b')](_0xd482('0x9c'),_0x7f2b0e);_0x1edea1={'user':_0x579919[_0xd482('0x9d')],'pass':_0x579919[_0xd482('0x9e')]};var _0x1db3be={'method':'GET','uri':_0x484e95+_0xd482('0x9f'),'auth':_0x1edea1,'json':!![]};return rp(_0x1db3be);}})[_0xd482('0x26')](function(_0xf72fc7){if(_0xf72fc7[_0xd482('0xa0')]['length']>0x0){_0x1b8929=_0xf72fc7[_0xd482('0xa0')];}console[_0xd482('0xa1')](_0xd482('0xa2'),_0x1b8929);_0x297051=[];_0x39b070=Object[_0xd482('0xa3')]([],_0x1b8929);_['remove'](_0x39b070,function(_0x465452){return!_0xb3afeb[_0xd482('0xa4')](_0x465452['name']);});_0x39b070[_0xd482('0xa5')](function(_0x256a2e){var _0x878829=createFieldObject(_0xdfa6dd,_0x1edea1,_0x256a2e['internalType'],_0x256a2e[_0xd482('0x29')],_0x256a2e[_0xd482('0xa6')],![]);_0x297051['push'](_0x878829);});return Promise['all'](_0x297051);})[_0xd482('0x26')](function(_0x4b09cb){_0x5f4b6d=_0x4b09cb;_0x2247fd=Object[_0xd482('0xa3')]([],_0x1b8929);console[_0xd482('0xa1')](_0xd482('0xa7'),_0x1b8929);_[_0xd482('0xa8')](_0x2247fd,function(_0x362311){return _0x462105[_0xd482('0xa4')](_0x362311[_0xd482('0x29')]);});console[_0xd482('0xa1')](_0xd482('0xa9'),_0x2247fd);_0x297051=[];_0x2247fd[_0xd482('0xa5')](function(_0x48b808){var _0x317dbb=createFieldObject(_0xdfa6dd,_0x1edea1,_0x48b808[_0xd482('0xaa')],_0x48b808['name'],_0x48b808['label'],!![]);_0x297051[_0xd482('0xab')](_0x317dbb);});return Promise['all'](_0x297051);})[_0xd482('0x26')](function(_0x42a89a){_0x1d79a2=_0x42a89a;var _0x3ad096=_0x5f4b6d[_0xd482('0xac')](_0x1d79a2);return{'count':_0x3ad096[_0xd482('0x35')],'rows':_0x3ad096};})['then'](respondWithResult(_0x142a05,null))[_0xd482('0x45')](function(_0x5cc157){console[_0xd482('0xa1')](_0xd482('0xad')+_0x5cc157);var _0x1ba2e6=_0x149f1b[_0xd482('0x2f')][_0xd482('0xae')]?0x1f4:_0x5cc157[_0xd482('0xaf')]||0x1f4;logger['error'](_0x5cc157[_0xd482('0x28')]);delete _0x5cc157[_0xd482('0x29')];if(_0x1ba2e6===0x191){_0x1ba2e6=0x190;}_0x142a05[_0xd482('0x1d')](_0x1ba2e6)['send'](_0x149f1b['query'][_0xd482('0xae')]?{'message':_0xd482('0xb0'),'statusCode':_0x5cc157[_0xd482('0xaf')]}:_0x5cc157);});};function createFieldObject(_0x59675c,_0x3e6054,_0x40c4e6,_0x1bac26,_0xf71ccb,_0x1b6870){return new Promise(function(_0x4d36ca,_0x40fc20){var _0x282c25={'id':_0x1bac26,'name':_0xf71ccb,'custom':_0x1b6870};if(_0x40c4e6===_0xd482('0xb1')){_0x282c25['options']=[{'name':_0xd482('0xb2'),'value':_0xd482('0xb3')},{'name':_0xd482('0xb4'),'value':'false'}];_0x4d36ca(_0x282c25);}else{var _0x23b3c6={'method':_0xd482('0xb5'),'uri':_0x59675c+_0xd482('0xb6')+_0x1bac26,'auth':_0x3e6054,'json':!![]};return rp(_0x23b3c6)['then'](function(_0x1b9ca0){var _0x283733=[];if(_0x1b9ca0[_0xd482('0xa0')]['length']>0x0){_0x1b9ca0[_0xd482('0xa0')][_0xd482('0xa5')](function(_0x298893){if(_0x298893['inactive']===_0xd482('0xb7')){var _0xcfd05b={'name':_0x298893[_0xd482('0xa6')],'value':_0x298893[_0xd482('0xb8')]};_0x283733['push'](_0xcfd05b);}});}_0x282c25[_0xd482('0x40')]=_0x283733;if(_0x282c25[_0xd482('0x40')][_0xd482('0x35')]>0x0){_0x4d36ca(_0x282c25);}else{if(_0x1b6870==![]){_0x4d36ca();}else{_0x4d36ca(_0x282c25);}}});}});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.model.js b/server/api/intServicenowAccount/intServicenowAccount.model.js index 5c071b3..097377c 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 _0xf2ca=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','../../components/integrations/configuration','exports','ServicenowAccount','int_servicenow_accounts','lodash','util'];(function(_0x18abd2,_0x22d4b3){var _0x1dcad6=function(_0xcc08c4){while(--_0xcc08c4){_0x18abd2['push'](_0x18abd2['shift']());}};_0x1dcad6(++_0x22d4b3);}(_0xf2ca,0x16a));var _0xaf2c=function(_0x271060,_0x3f86b1){_0x271060=_0x271060-0x0;var _0x40540b=_0xf2ca[_0x271060];return _0x40540b;};'use strict';var _=require(_0xaf2c('0x0'));var util=require(_0xaf2c('0x1'));var logger=require(_0xaf2c('0x2'))('api');var moment=require(_0xaf2c('0x3'));var BPromise=require(_0xaf2c('0x4'));var rp=require(_0xaf2c('0x5'));var fs=require('fs');var path=require(_0xaf2c('0x6'));var rimraf=require(_0xaf2c('0x7'));var config=require(_0xaf2c('0x8'));var attributes=require('./intServicenowAccount.attributes');var integrations=require(_0xaf2c('0x9'));module[_0xaf2c('0xa')]=function(_0x297740,_0x1f9531){return _0x297740['define'](_0xaf2c('0xb'),attributes,{'tableName':_0xaf2c('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6f47=['../../config/logger','moment','request-promise','rimraf','../../config/environment','./intServicenowAccount.attributes','../../components/integrations/configuration','define','int_servicenow_accounts','util'];(function(_0x6be9d9,_0x153d7e){var _0x43858f=function(_0x10bc51){while(--_0x10bc51){_0x6be9d9['push'](_0x6be9d9['shift']());}};_0x43858f(++_0x153d7e);}(_0x6f47,0xc7));var _0x76f4=function(_0x46d0c9,_0x526bfa){_0x46d0c9=_0x46d0c9-0x0;var _0x174506=_0x6f47[_0x46d0c9];return _0x174506;};'use strict';var _=require('lodash');var util=require(_0x76f4('0x0'));var logger=require(_0x76f4('0x1'))('api');var moment=require(_0x76f4('0x2'));var BPromise=require('bluebird');var rp=require(_0x76f4('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x76f4('0x4'));var config=require(_0x76f4('0x5'));var attributes=require(_0x76f4('0x6'));var integrations=require(_0x76f4('0x7'));module['exports']=function(_0x35602f,_0xfc2405){return _0x35602f[_0x76f4('0x8')]('ServicenowAccount',attributes,{'tableName':_0x76f4('0x9'),'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 cdbd106..84b2019 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 _0x4baf=['http','then','info','ServicenowAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','code','error','message','result','catch','GetServicenowAccount','ServicenowAccount','findAll','options','raw','where','attributes','include','model','map','ShowServicenowAccount','find','util','moment','bluebird','randomstring','ioredis','../../config/logger','../../config/environment','jayson/promise','client'];(function(_0x49afc9,_0x2a4f31){var _0x371b12=function(_0x5b03b1){while(--_0x5b03b1){_0x49afc9['push'](_0x49afc9['shift']());}};_0x371b12(++_0x2a4f31);}(_0x4baf,0x120));var _0xf4ba=function(_0x3debe2,_0x5332aa){_0x3debe2=_0x3debe2-0x0;var _0x180481=_0x4baf[_0x3debe2];return _0x180481;};'use strict';var _=require('lodash');var util=require(_0xf4ba('0x0'));var moment=require(_0xf4ba('0x1'));var BPromise=require(_0xf4ba('0x2'));var rs=require(_0xf4ba('0x3'));var fs=require('fs');var Redis=require(_0xf4ba('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xf4ba('0x5'))('rpc');var config=require(_0xf4ba('0x6'));var jayson=require(_0xf4ba('0x7'));var client=jayson[_0xf4ba('0x8')][_0xf4ba('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5a7e3b,_0x2f316c,_0x58f9f7){return new BPromise(function(_0x3a4df1,_0x553c9e){return client['request'](_0x5a7e3b,_0x58f9f7)[_0xf4ba('0xa')](function(_0x41a2fd){logger[_0xf4ba('0xb')](_0xf4ba('0xc'),_0x2f316c,_0xf4ba('0xd'));logger[_0xf4ba('0xe')]('ServicenowAccount,\x20%s,\x20%s,\x20%s',_0x2f316c,'request\x20sent',JSON[_0xf4ba('0xf')](_0x41a2fd));if(_0x41a2fd['error']){if(_0x41a2fd['error'][_0xf4ba('0x10')]===0x1f4){logger[_0xf4ba('0x11')](_0xf4ba('0xc'),_0x2f316c,_0x41a2fd['error'][_0xf4ba('0x12')]);return _0x553c9e(_0x41a2fd['error'][_0xf4ba('0x12')]);}logger[_0xf4ba('0x11')](_0xf4ba('0xc'),_0x2f316c,_0x41a2fd[_0xf4ba('0x11')][_0xf4ba('0x12')]);return _0x3a4df1(_0x41a2fd[_0xf4ba('0x11')]['message']);}else{logger[_0xf4ba('0xb')](_0xf4ba('0xc'),_0x2f316c,_0xf4ba('0xd'));_0x3a4df1(_0x41a2fd[_0xf4ba('0x13')]['message']);}})[_0xf4ba('0x14')](function(_0x40adba){logger['error'](_0xf4ba('0xc'),_0x2f316c,_0x40adba);_0x553c9e(_0x40adba);});});}exports[_0xf4ba('0x15')]=function(_0x1569cf){var _0x6d702d=this;return new Promise(function(_0x44f1d0,_0x56a9bb){return db[_0xf4ba('0x16')][_0xf4ba('0x17')]({'raw':_0x1569cf[_0xf4ba('0x18')]?_0x1569cf[_0xf4ba('0x18')][_0xf4ba('0x19')]===undefined?!![]:![]:!![],'where':_0x1569cf['options']?_0x1569cf['options'][_0xf4ba('0x1a')]||null:null,'attributes':_0x1569cf[_0xf4ba('0x18')]?_0x1569cf[_0xf4ba('0x18')][_0xf4ba('0x1b')]||null:null,'limit':_0x1569cf['options']?_0x1569cf[_0xf4ba('0x18')]['limit']||null:null,'include':_0x1569cf[_0xf4ba('0x18')]?_0x1569cf[_0xf4ba('0x18')][_0xf4ba('0x1c')]?_['map'](_0x1569cf[_0xf4ba('0x18')][_0xf4ba('0x1c')],function(_0x529b90){return{'model':db[_0x529b90['model']],'as':_0x529b90['as'],'attributes':_0x529b90[_0xf4ba('0x1b')],'include':_0x529b90[_0xf4ba('0x1c')]?_['map'](_0x529b90[_0xf4ba('0x1c')],function(_0x37d353){return{'model':db[_0x37d353[_0xf4ba('0x1d')]],'as':_0x37d353['as'],'attributes':_0x37d353[_0xf4ba('0x1b')],'include':_0x37d353[_0xf4ba('0x1c')]?_[_0xf4ba('0x1e')](_0x37d353[_0xf4ba('0x1c')],function(_0x39d883){return{'model':db[_0x39d883[_0xf4ba('0x1d')]],'as':_0x39d883['as'],'attributes':_0x39d883[_0xf4ba('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xf4ba('0xa')](function(_0x10fa53){logger[_0xf4ba('0xb')](_0xf4ba('0x15'),_0x1569cf);logger[_0xf4ba('0xe')]('GetServicenowAccount',_0x1569cf,JSON['stringify'](_0x10fa53));_0x44f1d0(_0x10fa53);})['catch'](function(_0x1acb0d){logger['error']('GetServicenowAccount',_0x1acb0d[_0xf4ba('0x12')],_0x1569cf);_0x56a9bb(_0x6d702d[_0xf4ba('0x11')](0x1f4,_0x1acb0d[_0xf4ba('0x12')]));});});};exports[_0xf4ba('0x1f')]=function(_0x1d7bdb){var _0x226918=this;return new Promise(function(_0x1e1062,_0x511935){return db[_0xf4ba('0x16')][_0xf4ba('0x20')]({'raw':_0x1d7bdb[_0xf4ba('0x18')]?_0x1d7bdb[_0xf4ba('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x1d7bdb['options']?_0x1d7bdb[_0xf4ba('0x18')][_0xf4ba('0x1a')]||null:null,'attributes':_0x1d7bdb[_0xf4ba('0x18')]?_0x1d7bdb[_0xf4ba('0x18')]['attributes']||null:null,'include':_0x1d7bdb[_0xf4ba('0x18')]?_0x1d7bdb[_0xf4ba('0x18')][_0xf4ba('0x1c')]?_[_0xf4ba('0x1e')](_0x1d7bdb[_0xf4ba('0x18')]['include'],function(_0x2ff99c){return{'model':db[_0x2ff99c[_0xf4ba('0x1d')]],'as':_0x2ff99c['as'],'attributes':_0x2ff99c['attributes'],'include':_0x2ff99c['include']?_['map'](_0x2ff99c[_0xf4ba('0x1c')],function(_0x22480c){return{'model':db[_0x22480c[_0xf4ba('0x1d')]],'as':_0x22480c['as'],'attributes':_0x22480c[_0xf4ba('0x1b')],'include':_0x22480c[_0xf4ba('0x1c')]?_[_0xf4ba('0x1e')](_0x22480c[_0xf4ba('0x1c')],function(_0x4fbce5){return{'model':db[_0x4fbce5[_0xf4ba('0x1d')]],'as':_0x4fbce5['as'],'attributes':_0x4fbce5['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x2d4148){logger[_0xf4ba('0xb')](_0xf4ba('0x1f'),_0x1d7bdb);logger[_0xf4ba('0xe')](_0xf4ba('0x1f'),_0x1d7bdb,JSON[_0xf4ba('0xf')](_0x2d4148));_0x1e1062(_0x2d4148);})[_0xf4ba('0x14')](function(_0x59b504){logger[_0xf4ba('0x11')](_0xf4ba('0x1f'),_0x59b504[_0xf4ba('0x12')],_0x1d7bdb);_0x511935(_0x226918[_0xf4ba('0x11')](0x1f4,_0x59b504['message']));});});}; \ No newline at end of file +var _0xd92d=['map','model','then','ShowServicenowAccount','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','client','http','request','info','ServicenowAccount,\x20%s,\x20%s','request\x20sent','debug','ServicenowAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetServicenowAccount','ServicenowAccount','findAll','options','raw','where','attributes','limit','include'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xd92d,0xa9));var _0xdd92=function(_0x247dc6,_0x2356a7){_0x247dc6=_0x247dc6-0x0;var _0x3b0b80=_0xd92d[_0x247dc6];return _0x3b0b80;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xdd92('0x0'));var BPromise=require(_0xdd92('0x1'));var rs=require(_0xdd92('0x2'));var fs=require('fs');var Redis=require(_0xdd92('0x3'));var db=require(_0xdd92('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xdd92('0x5'))('rpc');var config=require(_0xdd92('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xdd92('0x7')][_0xdd92('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1c2237,_0x26ba22,_0x10578c){return new BPromise(function(_0x4079f2,_0x14dd0e){return client[_0xdd92('0x9')](_0x1c2237,_0x10578c)['then'](function(_0x4478b7){logger[_0xdd92('0xa')](_0xdd92('0xb'),_0x26ba22,_0xdd92('0xc'));logger[_0xdd92('0xd')](_0xdd92('0xe'),_0x26ba22,_0xdd92('0xc'),JSON[_0xdd92('0xf')](_0x4478b7));if(_0x4478b7[_0xdd92('0x10')]){if(_0x4478b7['error'][_0xdd92('0x11')]===0x1f4){logger[_0xdd92('0x10')](_0xdd92('0xb'),_0x26ba22,_0x4478b7[_0xdd92('0x10')][_0xdd92('0x12')]);return _0x14dd0e(_0x4478b7['error']['message']);}logger[_0xdd92('0x10')](_0xdd92('0xb'),_0x26ba22,_0x4478b7['error'][_0xdd92('0x12')]);return _0x4079f2(_0x4478b7[_0xdd92('0x10')][_0xdd92('0x12')]);}else{logger[_0xdd92('0xa')](_0xdd92('0xb'),_0x26ba22,_0xdd92('0xc'));_0x4079f2(_0x4478b7['result'][_0xdd92('0x12')]);}})[_0xdd92('0x13')](function(_0x1c9a21){logger[_0xdd92('0x10')]('ServicenowAccount,\x20%s,\x20%s',_0x26ba22,_0x1c9a21);_0x14dd0e(_0x1c9a21);});});}exports[_0xdd92('0x14')]=function(_0x3bd009){var _0x3fac2e=this;return new Promise(function(_0x157e0a,_0x49e508){return db[_0xdd92('0x15')][_0xdd92('0x16')]({'raw':_0x3bd009[_0xdd92('0x17')]?_0x3bd009[_0xdd92('0x17')][_0xdd92('0x18')]===undefined?!![]:![]:!![],'where':_0x3bd009[_0xdd92('0x17')]?_0x3bd009[_0xdd92('0x17')][_0xdd92('0x19')]||null:null,'attributes':_0x3bd009['options']?_0x3bd009[_0xdd92('0x17')][_0xdd92('0x1a')]||null:null,'limit':_0x3bd009[_0xdd92('0x17')]?_0x3bd009[_0xdd92('0x17')][_0xdd92('0x1b')]||null:null,'include':_0x3bd009[_0xdd92('0x17')]?_0x3bd009[_0xdd92('0x17')][_0xdd92('0x1c')]?_['map'](_0x3bd009['options'][_0xdd92('0x1c')],function(_0x1a31dd){return{'model':db[_0x1a31dd['model']],'as':_0x1a31dd['as'],'attributes':_0x1a31dd[_0xdd92('0x1a')],'include':_0x1a31dd[_0xdd92('0x1c')]?_[_0xdd92('0x1d')](_0x1a31dd[_0xdd92('0x1c')],function(_0x4cd740){return{'model':db[_0x4cd740[_0xdd92('0x1e')]],'as':_0x4cd740['as'],'attributes':_0x4cd740[_0xdd92('0x1a')],'include':_0x4cd740['include']?_['map'](_0x4cd740['include'],function(_0x30c155){return{'model':db[_0x30c155[_0xdd92('0x1e')]],'as':_0x30c155['as'],'attributes':_0x30c155[_0xdd92('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xdd92('0x1f')](function(_0x3a13f5){logger['info'](_0xdd92('0x14'),_0x3bd009);logger[_0xdd92('0xd')](_0xdd92('0x14'),_0x3bd009,JSON['stringify'](_0x3a13f5));_0x157e0a(_0x3a13f5);})[_0xdd92('0x13')](function(_0x3a5c2b){logger['error'](_0xdd92('0x14'),_0x3a5c2b['message'],_0x3bd009);_0x49e508(_0x3fac2e['error'](0x1f4,_0x3a5c2b[_0xdd92('0x12')]));});});};exports['ShowServicenowAccount']=function(_0x1422f5){var _0x5865ca=this;return new Promise(function(_0x4f1b9d,_0x3ecec2){return db[_0xdd92('0x15')]['find']({'raw':_0x1422f5[_0xdd92('0x17')]?_0x1422f5[_0xdd92('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x1422f5[_0xdd92('0x17')]?_0x1422f5[_0xdd92('0x17')][_0xdd92('0x19')]||null:null,'attributes':_0x1422f5['options']?_0x1422f5['options'][_0xdd92('0x1a')]||null:null,'include':_0x1422f5[_0xdd92('0x17')]?_0x1422f5[_0xdd92('0x17')][_0xdd92('0x1c')]?_[_0xdd92('0x1d')](_0x1422f5[_0xdd92('0x17')]['include'],function(_0x381012){return{'model':db[_0x381012['model']],'as':_0x381012['as'],'attributes':_0x381012[_0xdd92('0x1a')],'include':_0x381012[_0xdd92('0x1c')]?_[_0xdd92('0x1d')](_0x381012[_0xdd92('0x1c')],function(_0x10dd81){return{'model':db[_0x10dd81[_0xdd92('0x1e')]],'as':_0x10dd81['as'],'attributes':_0x10dd81['attributes'],'include':_0x10dd81[_0xdd92('0x1c')]?_[_0xdd92('0x1d')](_0x10dd81[_0xdd92('0x1c')],function(_0x483797){return{'model':db[_0x483797[_0xdd92('0x1e')]],'as':_0x483797['as'],'attributes':_0x483797['attributes']};}):[]};}):[]};}):[]:[]})[_0xdd92('0x1f')](function(_0x9c771c){logger[_0xdd92('0xa')]('ShowServicenowAccount',_0x1422f5);logger[_0xdd92('0xd')](_0xdd92('0x20'),_0x1422f5,JSON[_0xdd92('0xf')](_0x9c771c));_0x4f1b9d(_0x9c771c);})[_0xdd92('0x13')](function(_0x4ced11){logger['error'](_0xdd92('0x20'),_0x4ced11[_0xdd92('0x12')],_0x1422f5);_0x3ecec2(_0x5865ca['error'](0x1f4,_0x4ced11['message']));});});}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/index.js b/server/api/intServicenowConfiguration/index.js index b001756..f7faa02 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 _0x4148=['../../components/interaction/service','./intServicenowConfiguration.controller','get','isAuthenticated','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','post','put','exports','multer','path','connect-timeout','express','Router'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4148,0x1f3));var _0x8414=function(_0x39fb6a,_0x8b07ae){_0x39fb6a=_0x39fb6a-0x0;var _0x1452a1=_0x4148[_0x39fb6a];return _0x1452a1;};'use strict';var multer=require(_0x8414('0x0'));var util=require('util');var path=require(_0x8414('0x1'));var timeout=require(_0x8414('0x2'));var express=require(_0x8414('0x3'));var router=express[_0x8414('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x8414('0x5'));var config=require('../../config/environment');var controller=require(_0x8414('0x6'));router[_0x8414('0x7')]('/',auth[_0x8414('0x8')](),controller['index']);router[_0x8414('0x7')](_0x8414('0x9'),auth['isAuthenticated'](),controller[_0x8414('0xa')]);router['get'](_0x8414('0xb'),auth[_0x8414('0x8')](),controller[_0x8414('0xc')]);router['get'](_0x8414('0xd'),auth[_0x8414('0x8')](),controller[_0x8414('0xe')]);router[_0x8414('0x7')]('/:id/descriptions',auth[_0x8414('0x8')](),controller['getDescriptions']);router[_0x8414('0xf')]('/',auth[_0x8414('0x8')](),controller['create']);router[_0x8414('0x10')](_0x8414('0x9'),auth[_0x8414('0x8')](),controller['update']);router['delete'](_0x8414('0x9'),auth[_0x8414('0x8')](),controller['destroy']);module[_0x8414('0x11')]=router; \ No newline at end of file +var _0x3b1a=['get','index','/:id','/:id/fields','isAuthenticated','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create','put','update','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment'];(function(_0x12a8bf,_0x46f7c0){var _0x23af5d=function(_0x4826fa){while(--_0x4826fa){_0x12a8bf['push'](_0x12a8bf['shift']());}};_0x23af5d(++_0x46f7c0);}(_0x3b1a,0xe7));var _0xa3b1=function(_0x262baa,_0x283058){_0x262baa=_0x262baa-0x0;var _0x4f2257=_0x3b1a[_0x262baa];return _0x4f2257;};'use strict';var multer=require(_0xa3b1('0x0'));var util=require(_0xa3b1('0x1'));var path=require(_0xa3b1('0x2'));var timeout=require(_0xa3b1('0x3'));var express=require(_0xa3b1('0x4'));var router=express[_0xa3b1('0x5')]();var fs_extra=require(_0xa3b1('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xa3b1('0x7'));var config=require(_0xa3b1('0x8'));var controller=require('./intServicenowConfiguration.controller');router[_0xa3b1('0x9')]('/',auth['isAuthenticated'](),controller[_0xa3b1('0xa')]);router[_0xa3b1('0x9')](_0xa3b1('0xb'),auth['isAuthenticated'](),controller['show']);router[_0xa3b1('0x9')](_0xa3b1('0xc'),auth[_0xa3b1('0xd')](),controller[_0xa3b1('0xe')]);router[_0xa3b1('0x9')](_0xa3b1('0xf'),auth[_0xa3b1('0xd')](),controller[_0xa3b1('0x10')]);router['get'](_0xa3b1('0x11'),auth[_0xa3b1('0xd')](),controller[_0xa3b1('0x12')]);router[_0xa3b1('0x13')]('/',auth[_0xa3b1('0xd')](),controller[_0xa3b1('0x14')]);router[_0xa3b1('0x15')](_0xa3b1('0xb'),auth[_0xa3b1('0xd')](),controller[_0xa3b1('0x16')]);router['delete'](_0xa3b1('0xb'),auth[_0xa3b1('0xd')](),controller['destroy']);module[_0xa3b1('0x17')]=router; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js index ebbacf1..35d2aa9 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 _0x5a0e=['sequelize','exports','STRING'];(function(_0x536283,_0x510fc4){var _0xb4aa9=function(_0x35a716){while(--_0x35a716){_0x536283['push'](_0x536283['shift']());}};_0xb4aa9(++_0x510fc4);}(_0x5a0e,0x117));var _0xe5a0=function(_0x212960,_0x520f14){_0x212960=_0x212960-0x0;var _0x4f5a8a=_0x5a0e[_0x212960];return _0x4f5a8a;};'use strict';var Sequelize=require(_0xe5a0('0x0'));module[_0xe5a0('0x1')]={'name':{'type':Sequelize[_0xe5a0('0x2')]},'description':{'type':Sequelize[_0xe5a0('0x2')]}}; \ No newline at end of file +var _0x6367=['exports','STRING'];(function(_0x760a06,_0x1b8f10){var _0x2c1bc3=function(_0x3e8965){while(--_0x3e8965){_0x760a06['push'](_0x760a06['shift']());}};_0x2c1bc3(++_0x1b8f10);}(_0x6367,0xc4));var _0x7636=function(_0x375492,_0x4ed149){_0x375492=_0x375492-0x0;var _0x18ba5b=_0x6367[_0x375492];return _0x18ba5b;};'use strict';var Sequelize=require('sequelize');module[_0x7636('0x0')]={'name':{'type':Sequelize[_0x7636('0x1')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js index 3d7809f..0811b76 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 _0x4b6f=['rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','keys','create','body','update','find','getFields','findOne','ServicenowField','pick','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','end','offset','undefined','count','limit','set','Content-Range','json','reject','save','then','destroy','status','sendStatus','error','stack','name','index','map','ServicenowConfiguration'];(function(_0x2adbeb,_0x5581be){var _0x5e18a6=function(_0x84e42b){while(--_0x84e42b){_0x2adbeb['push'](_0x2adbeb['shift']());}};_0x5e18a6(++_0x5581be);}(_0x4b6f,0x1ca));var _0xf4b6=function(_0x18ab2a,_0x4debcd){_0x18ab2a=_0x18ab2a-0x0;var _0x16dcee=_0x4b6f[_0x18ab2a];return _0x16dcee;};'use strict';var emlformat=require(_0xf4b6('0x0'));var rimraf=require(_0xf4b6('0x1'));var zipdir=require(_0xf4b6('0x2'));var jsonpatch=require(_0xf4b6('0x3'));var rp=require(_0xf4b6('0x4'));var moment=require(_0xf4b6('0x5'));var BPromise=require(_0xf4b6('0x6'));var Mustache=require(_0xf4b6('0x7'));var util=require(_0xf4b6('0x8'));var path=require(_0xf4b6('0x9'));var sox=require(_0xf4b6('0xa'));var csv=require(_0xf4b6('0xb'));var ejs=require(_0xf4b6('0xc'));var fs=require('fs');var fs_extra=require(_0xf4b6('0xd'));var _=require('lodash');var squel=require(_0xf4b6('0xe'));var crypto=require(_0xf4b6('0xf'));var jsforce=require(_0xf4b6('0x10'));var deskjs=require(_0xf4b6('0x11'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xf4b6('0x12'));var qs=require(_0xf4b6('0x13'));var as=require(_0xf4b6('0x14'));var hardwareService=require(_0xf4b6('0x15'));var logger=require(_0xf4b6('0x16'))(_0xf4b6('0x17'));var utils=require('../../config/utils');var config=require(_0xf4b6('0x18'));var licenseUtil=require(_0xf4b6('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x546ce3,_0x2f0900){_0x2f0900=_0x2f0900||0xcc;return function(_0x2fa9ea){if(_0x2fa9ea){return _0x546ce3['sendStatus'](_0x2f0900);}return _0x546ce3['status'](_0x2f0900)[_0xf4b6('0x1a')]();};}function respondWithResult(_0x45b1f4,_0x447d5a){_0x447d5a=_0x447d5a||0xc8;return function(_0x509bdb){if(_0x509bdb){return _0x45b1f4['status'](_0x447d5a)['json'](_0x509bdb);}};}function respondWithFilteredResult(_0x19592f,_0x268591){return function(_0x20b8b4){if(_0x20b8b4){var _0x4e96d0=typeof _0x268591[_0xf4b6('0x1b')]===_0xf4b6('0x1c')&&typeof _0x268591['limit']===_0xf4b6('0x1c');var _0x1140b5=_0x20b8b4[_0xf4b6('0x1d')];var _0x3eaa56=_0x4e96d0?0x0:_0x268591[_0xf4b6('0x1b')];var _0x422b2c=_0x4e96d0?_0x20b8b4['count']:_0x268591[_0xf4b6('0x1b')]+_0x268591[_0xf4b6('0x1e')];var _0xc7e2ad;if(_0x422b2c>=_0x1140b5){_0x422b2c=_0x1140b5;_0xc7e2ad=0xc8;}else{_0xc7e2ad=0xce;}_0x19592f['status'](_0xc7e2ad);return _0x19592f[_0xf4b6('0x1f')](_0xf4b6('0x20'),_0x3eaa56+'-'+_0x422b2c+'/'+_0x1140b5)[_0xf4b6('0x21')](_0x20b8b4);}return null;};}function patchUpdates(_0x48cf70){return function(_0x3b5340){try{jsonpatch['apply'](_0x3b5340,_0x48cf70,!![]);}catch(_0x534755){return BPromise[_0xf4b6('0x22')](_0x534755);}return _0x3b5340[_0xf4b6('0x23')]();};}function saveUpdates(_0x80b8f5,_0x165e94){return function(_0x3d062d){if(_0x3d062d){return _0x3d062d['update'](_0x80b8f5)[_0xf4b6('0x24')](function(_0x3e811a){return _0x3e811a;});}return null;};}function removeEntity(_0x24795d,_0x1dbfbf){return function(_0x50de04){if(_0x50de04){return _0x50de04[_0xf4b6('0x25')]()[_0xf4b6('0x24')](function(){_0x24795d[_0xf4b6('0x26')](0xcc)[_0xf4b6('0x1a')]();});}};}function handleEntityNotFound(_0x5f1857,_0x275280){return function(_0x23ec6c){if(!_0x23ec6c){_0x5f1857[_0xf4b6('0x27')](0x194);}return _0x23ec6c;};}function handleError(_0x30c896,_0x2251c0){_0x2251c0=_0x2251c0||0x1f4;return function(_0x20a957){logger[_0xf4b6('0x28')](_0x20a957[_0xf4b6('0x29')]);if(_0x20a957['name']){delete _0x20a957[_0xf4b6('0x2a')];}_0x30c896['status'](_0x2251c0)['send'](_0x20a957);};}exports[_0xf4b6('0x2b')]=function(_0x40fa51,_0x16f996){var _0x48cca1={},_0xe6f5c9={},_0x3128e4={'count':0x0,'rows':[]};var _0x45f0a6=_[_0xf4b6('0x2c')](db[_0xf4b6('0x2d')][_0xf4b6('0x2e')],function(_0x40c41c){return{'name':_0x40c41c[_0xf4b6('0x2f')],'type':_0x40c41c[_0xf4b6('0x30')][_0xf4b6('0x31')]};});_0xe6f5c9[_0xf4b6('0x32')]=_[_0xf4b6('0x2c')](_0x45f0a6,_0xf4b6('0x2a'));_0xe6f5c9[_0xf4b6('0x33')]=_['keys'](_0x40fa51[_0xf4b6('0x33')]);_0xe6f5c9[_0xf4b6('0x34')]=_['intersection'](_0xe6f5c9[_0xf4b6('0x32')],_0xe6f5c9[_0xf4b6('0x33')]);_0x48cca1['attributes']=_[_0xf4b6('0x35')](_0xe6f5c9['model'],qs[_0xf4b6('0x36')](_0x40fa51['query'][_0xf4b6('0x36')]));_0x48cca1[_0xf4b6('0x37')]=_0x48cca1['attributes'][_0xf4b6('0x38')]?_0x48cca1[_0xf4b6('0x37')]:_0xe6f5c9[_0xf4b6('0x32')];if(!_0x40fa51[_0xf4b6('0x33')][_0xf4b6('0x39')](_0xf4b6('0x3a'))){_0x48cca1[_0xf4b6('0x1e')]=qs['limit'](_0x40fa51[_0xf4b6('0x33')][_0xf4b6('0x1e')]);_0x48cca1[_0xf4b6('0x1b')]=qs[_0xf4b6('0x1b')](_0x40fa51[_0xf4b6('0x33')][_0xf4b6('0x1b')]);}_0x48cca1[_0xf4b6('0x3b')]=qs[_0xf4b6('0x3c')](_0x40fa51[_0xf4b6('0x33')][_0xf4b6('0x3c')]);_0x48cca1[_0xf4b6('0x3d')]=qs[_0xf4b6('0x34')](_['pick'](_0x40fa51['query'],_0xe6f5c9[_0xf4b6('0x34')]),_0x45f0a6);if(_0x40fa51['query']['filter']){_0x48cca1[_0xf4b6('0x3d')]=_[_0xf4b6('0x3e')](_0x48cca1[_0xf4b6('0x3d')],{'$or':_[_0xf4b6('0x2c')](_0x45f0a6,function(_0x3a8a30){if(_0x3a8a30[_0xf4b6('0x30')]!==_0xf4b6('0x3f')){var _0x114de7={};_0x114de7[_0x3a8a30['name']]={'$like':'%'+_0x40fa51[_0xf4b6('0x33')][_0xf4b6('0x40')]+'%'};return _0x114de7;}})});}_0x48cca1=_[_0xf4b6('0x3e')]({},_0x48cca1,_0x40fa51[_0xf4b6('0x41')]);var _0x54f23d={'where':_0x48cca1[_0xf4b6('0x3d')]};return db[_0xf4b6('0x2d')][_0xf4b6('0x1d')](_0x54f23d)[_0xf4b6('0x24')](function(_0x4302ac){_0x3128e4['count']=_0x4302ac;if(_0x40fa51[_0xf4b6('0x33')][_0xf4b6('0x42')]){_0x48cca1[_0xf4b6('0x43')]=[{'all':!![]}];}return db[_0xf4b6('0x2d')][_0xf4b6('0x44')](_0x48cca1);})['then'](function(_0x2fa953){_0x3128e4[_0xf4b6('0x45')]=_0x2fa953;return _0x3128e4;})[_0xf4b6('0x24')](respondWithFilteredResult(_0x16f996,_0x48cca1))[_0xf4b6('0x46')](handleError(_0x16f996,null));};exports[_0xf4b6('0x47')]=function(_0x1eeb8e,_0x26f5c9){var _0x274e12={'raw':![],'where':{'id':_0x1eeb8e[_0xf4b6('0x48')]['id']}},_0x5bef47={};_0x5bef47['model']=_[_0xf4b6('0x49')](db['ServicenowConfiguration'][_0xf4b6('0x2e')]);_0x5bef47[_0xf4b6('0x33')]=_['keys'](_0x1eeb8e[_0xf4b6('0x33')]);_0x5bef47[_0xf4b6('0x34')]=_['intersection'](_0x5bef47[_0xf4b6('0x32')],_0x5bef47['query']);_0x274e12[_0xf4b6('0x37')]=_[_0xf4b6('0x35')](_0x5bef47[_0xf4b6('0x32')],qs[_0xf4b6('0x36')](_0x1eeb8e['query'][_0xf4b6('0x36')]));_0x274e12[_0xf4b6('0x37')]=_0x274e12[_0xf4b6('0x37')][_0xf4b6('0x38')]?_0x274e12[_0xf4b6('0x37')]:_0x5bef47[_0xf4b6('0x32')];if(_0x1eeb8e['query'][_0xf4b6('0x42')]){_0x274e12[_0xf4b6('0x43')]=[{'all':!![]}];}_0x274e12=_['merge']({},_0x274e12,_0x1eeb8e['options']);return db[_0xf4b6('0x2d')]['find'](_0x274e12)[_0xf4b6('0x24')](handleEntityNotFound(_0x26f5c9,null))[_0xf4b6('0x24')](respondWithResult(_0x26f5c9,null))[_0xf4b6('0x46')](handleError(_0x26f5c9,null));};exports[_0xf4b6('0x4a')]=function(_0x1dbc42,_0x1cff0a){return db[_0xf4b6('0x2d')][_0xf4b6('0x4a')](_0x1dbc42[_0xf4b6('0x4b')],{})[_0xf4b6('0x24')](respondWithResult(_0x1cff0a,0xc9))[_0xf4b6('0x46')](handleError(_0x1cff0a,null));};exports[_0xf4b6('0x4c')]=function(_0x174530,_0xc53675){if(_0x174530['body']['id']){delete _0x174530[_0xf4b6('0x4b')]['id'];}return db['ServicenowConfiguration'][_0xf4b6('0x4d')]({'where':{'id':_0x174530[_0xf4b6('0x48')]['id']}})['then'](handleEntityNotFound(_0xc53675,null))['then'](saveUpdates(_0x174530['body'],null))[_0xf4b6('0x24')](respondWithResult(_0xc53675,null))[_0xf4b6('0x46')](handleError(_0xc53675,null));};exports['destroy']=function(_0x431dea,_0x481f29){return db[_0xf4b6('0x2d')][_0xf4b6('0x4d')]({'where':{'id':_0x431dea['params']['id']}})[_0xf4b6('0x24')](handleEntityNotFound(_0x481f29,null))[_0xf4b6('0x24')](removeEntity(_0x481f29,null))[_0xf4b6('0x46')](handleError(_0x481f29,null));};exports[_0xf4b6('0x4e')]=function(_0x482c0a,_0x185d07,_0x3245fe){var _0x5592cc={};var _0x3c0ac3={};var _0x20832a;var _0x4b8e5f;return db[_0xf4b6('0x2d')][_0xf4b6('0x4f')]({'where':{'id':_0x482c0a['params']['id']}})[_0xf4b6('0x24')](handleEntityNotFound(_0x185d07,null))[_0xf4b6('0x24')](function(_0x244dbe){if(_0x244dbe){_0x20832a=_0x244dbe;_0x3c0ac3[_0xf4b6('0x32')]=_[_0xf4b6('0x49')](db[_0xf4b6('0x50')][_0xf4b6('0x2e')]);_0x3c0ac3[_0xf4b6('0x33')]=_[_0xf4b6('0x49')](_0x482c0a['query']);_0x3c0ac3[_0xf4b6('0x34')]=_[_0xf4b6('0x35')](_0x3c0ac3[_0xf4b6('0x32')],_0x3c0ac3[_0xf4b6('0x33')]);_0x5592cc['attributes']=_[_0xf4b6('0x35')](_0x3c0ac3['model'],qs[_0xf4b6('0x36')](_0x482c0a['query']['fields']));_0x5592cc[_0xf4b6('0x37')]=_0x5592cc[_0xf4b6('0x37')]['length']?_0x5592cc[_0xf4b6('0x37')]:_0x3c0ac3[_0xf4b6('0x32')];_0x5592cc[_0xf4b6('0x3b')]=qs[_0xf4b6('0x3c')](_0x482c0a[_0xf4b6('0x33')][_0xf4b6('0x3c')]);_0x5592cc['where']=qs[_0xf4b6('0x34')](_[_0xf4b6('0x51')](_0x482c0a['query'],_0x3c0ac3[_0xf4b6('0x34')]));if(_0x482c0a[_0xf4b6('0x33')][_0xf4b6('0x40')]){_0x5592cc[_0xf4b6('0x3d')]=_[_0xf4b6('0x3e')](_0x5592cc[_0xf4b6('0x3d')],{'$or':_[_0xf4b6('0x2c')](_0x5592cc[_0xf4b6('0x37')],function(_0x229f67){var _0x2d6647={};_0x2d6647[_0x229f67]={'$like':'%'+_0x482c0a['query'][_0xf4b6('0x40')]+'%'};return _0x2d6647;})});}_0x5592cc=_['merge']({},_0x5592cc,_0x482c0a[_0xf4b6('0x41')]);return _0x20832a[_0xf4b6('0x4e')](_0x5592cc);}})[_0xf4b6('0x24')](function(_0xb38b9){if(_0xb38b9){_0x4b8e5f=_0xb38b9['length'];if(!_0x482c0a['query']['hasOwnProperty'](_0xf4b6('0x3a'))){_0x5592cc['limit']=qs[_0xf4b6('0x1e')](_0x482c0a['query'][_0xf4b6('0x1e')]);_0x5592cc[_0xf4b6('0x1b')]=qs[_0xf4b6('0x1b')](_0x482c0a['query'][_0xf4b6('0x1b')]);}return _0x20832a[_0xf4b6('0x4e')](_0x5592cc);}})[_0xf4b6('0x24')](function(_0x11b6a4){if(_0x11b6a4){return _0x11b6a4?{'count':_0x4b8e5f,'rows':_0x11b6a4}:null;}})['then'](respondWithResult(_0x185d07,null))[_0xf4b6('0x46')](handleError(_0x185d07,null));};exports[_0xf4b6('0x52')]=function(_0x162314,_0x368725,_0x421adf){var _0x36add5={};var _0x369038={};var _0x1eece9;var _0x5826d5;return db[_0xf4b6('0x2d')][_0xf4b6('0x4f')]({'where':{'id':_0x162314[_0xf4b6('0x48')]['id']}})[_0xf4b6('0x24')](handleEntityNotFound(_0x368725,null))['then'](function(_0x155f3f){if(_0x155f3f){_0x1eece9=_0x155f3f;_0x369038[_0xf4b6('0x32')]=_['keys'](db[_0xf4b6('0x50')]['rawAttributes']);_0x369038[_0xf4b6('0x33')]=_['keys'](_0x162314[_0xf4b6('0x33')]);_0x369038['filters']=_[_0xf4b6('0x35')](_0x369038[_0xf4b6('0x32')],_0x369038[_0xf4b6('0x33')]);_0x36add5['attributes']=_[_0xf4b6('0x35')](_0x369038[_0xf4b6('0x32')],qs[_0xf4b6('0x36')](_0x162314[_0xf4b6('0x33')][_0xf4b6('0x36')]));_0x36add5['attributes']=_0x36add5['attributes'][_0xf4b6('0x38')]?_0x36add5['attributes']:_0x369038[_0xf4b6('0x32')];_0x36add5[_0xf4b6('0x3b')]=qs[_0xf4b6('0x3c')](_0x162314['query']['sort']);_0x36add5[_0xf4b6('0x3d')]=qs[_0xf4b6('0x34')](_[_0xf4b6('0x51')](_0x162314[_0xf4b6('0x33')],_0x369038['filters']));if(_0x162314['query'][_0xf4b6('0x40')]){_0x36add5[_0xf4b6('0x3d')]=_[_0xf4b6('0x3e')](_0x36add5['where'],{'$or':_[_0xf4b6('0x2c')](_0x36add5[_0xf4b6('0x37')],function(_0xdb6eae){var _0x5c7dec={};_0x5c7dec[_0xdb6eae]={'$like':'%'+_0x162314['query'][_0xf4b6('0x40')]+'%'};return _0x5c7dec;})});}_0x36add5=_[_0xf4b6('0x3e')]({},_0x36add5,_0x162314[_0xf4b6('0x41')]);return _0x1eece9['getSubjects'](_0x36add5);}})[_0xf4b6('0x24')](function(_0x17461a){if(_0x17461a){_0x5826d5=_0x17461a['length'];if(!_0x162314[_0xf4b6('0x33')][_0xf4b6('0x39')](_0xf4b6('0x3a'))){_0x36add5[_0xf4b6('0x1e')]=qs[_0xf4b6('0x1e')](_0x162314[_0xf4b6('0x33')][_0xf4b6('0x1e')]);_0x36add5['offset']=qs[_0xf4b6('0x1b')](_0x162314['query'][_0xf4b6('0x1b')]);}return _0x1eece9['getSubjects'](_0x36add5);}})[_0xf4b6('0x24')](function(_0x466ae5){if(_0x466ae5){return _0x466ae5?{'count':_0x5826d5,'rows':_0x466ae5}:null;}})[_0xf4b6('0x24')](respondWithResult(_0x368725,null))[_0xf4b6('0x46')](handleError(_0x368725,null));};exports['getDescriptions']=function(_0x4acc63,_0x53a154,_0x2a5d68){var _0x5e3f72={};var _0x26b260={};var _0x111736;var _0x5609a0;return db[_0xf4b6('0x2d')]['findOne']({'where':{'id':_0x4acc63[_0xf4b6('0x48')]['id']}})[_0xf4b6('0x24')](handleEntityNotFound(_0x53a154,null))[_0xf4b6('0x24')](function(_0x50b737){if(_0x50b737){_0x111736=_0x50b737;_0x26b260[_0xf4b6('0x32')]=_[_0xf4b6('0x49')](db[_0xf4b6('0x50')][_0xf4b6('0x2e')]);_0x26b260[_0xf4b6('0x33')]=_[_0xf4b6('0x49')](_0x4acc63['query']);_0x26b260['filters']=_[_0xf4b6('0x35')](_0x26b260[_0xf4b6('0x32')],_0x26b260[_0xf4b6('0x33')]);_0x5e3f72[_0xf4b6('0x37')]=_['intersection'](_0x26b260['model'],qs[_0xf4b6('0x36')](_0x4acc63[_0xf4b6('0x33')][_0xf4b6('0x36')]));_0x5e3f72[_0xf4b6('0x37')]=_0x5e3f72[_0xf4b6('0x37')][_0xf4b6('0x38')]?_0x5e3f72[_0xf4b6('0x37')]:_0x26b260[_0xf4b6('0x32')];_0x5e3f72['order']=qs['sort'](_0x4acc63[_0xf4b6('0x33')]['sort']);_0x5e3f72[_0xf4b6('0x3d')]=qs['filters'](_[_0xf4b6('0x51')](_0x4acc63[_0xf4b6('0x33')],_0x26b260['filters']));if(_0x4acc63[_0xf4b6('0x33')]['filter']){_0x5e3f72['where']=_[_0xf4b6('0x3e')](_0x5e3f72[_0xf4b6('0x3d')],{'$or':_['map'](_0x5e3f72[_0xf4b6('0x37')],function(_0xf1159d){var _0x55ad17={};_0x55ad17[_0xf1159d]={'$like':'%'+_0x4acc63[_0xf4b6('0x33')][_0xf4b6('0x40')]+'%'};return _0x55ad17;})});}_0x5e3f72=_['merge']({},_0x5e3f72,_0x4acc63[_0xf4b6('0x41')]);return _0x111736['getDescriptions'](_0x5e3f72);}})[_0xf4b6('0x24')](function(_0x584f4b){if(_0x584f4b){_0x5609a0=_0x584f4b[_0xf4b6('0x38')];if(!_0x4acc63[_0xf4b6('0x33')][_0xf4b6('0x39')]('nolimit')){_0x5e3f72[_0xf4b6('0x1e')]=qs[_0xf4b6('0x1e')](_0x4acc63['query']['limit']);_0x5e3f72['offset']=qs[_0xf4b6('0x1b')](_0x4acc63[_0xf4b6('0x33')][_0xf4b6('0x1b')]);}return _0x111736[_0xf4b6('0x53')](_0x5e3f72);}})[_0xf4b6('0x24')](function(_0x462736){if(_0x462736){return _0x462736?{'count':_0x5609a0,'rows':_0x462736}:null;}})[_0xf4b6('0x24')](respondWithResult(_0x53a154,null))[_0xf4b6('0x46')](handleError(_0x53a154,null));}; \ No newline at end of file +var _0xfe1f=['api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','limit','undefined','offset','Content-Range','json','apply','reject','update','then','error','stack','name','send','index','map','rawAttributes','fieldName','key','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','ServicenowConfiguration','count','includeAll','include','findAll','rows','catch','show','params','length','find','create','body','destroy','getFields','ServicenowField','getSubjects','getDescriptions','findOne','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','ejs','fs-extra','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger'];(function(_0x412e27,_0x20a978){var _0x53da42=function(_0x43cae5){while(--_0x43cae5){_0x412e27['push'](_0x412e27['shift']());}};_0x53da42(++_0x20a978);}(_0xfe1f,0x12d));var _0xffe1=function(_0x4147ff,_0x154530){_0x4147ff=_0x4147ff-0x0;var _0x1e71e6=_0xfe1f[_0x4147ff];return _0x1e71e6;};'use strict';var emlformat=require(_0xffe1('0x0'));var rimraf=require(_0xffe1('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xffe1('0x2'));var rp=require(_0xffe1('0x3'));var moment=require(_0xffe1('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xffe1('0x5'));var util=require(_0xffe1('0x6'));var path=require(_0xffe1('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xffe1('0x8'));var fs=require('fs');var fs_extra=require(_0xffe1('0x9'));var _=require('lodash');var squel=require(_0xffe1('0xa'));var crypto=require('crypto');var jsforce=require(_0xffe1('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xffe1('0xc'));var Papa=require(_0xffe1('0xd'));var Redis=require(_0xffe1('0xe'));var authService=require(_0xffe1('0xf'));var qs=require(_0xffe1('0x10'));var as=require(_0xffe1('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xffe1('0x12'))(_0xffe1('0x13'));var utils=require(_0xffe1('0x14'));var config=require(_0xffe1('0x15'));var licenseUtil=require(_0xffe1('0x16'));var db=require(_0xffe1('0x17'))['db'];function respondWithStatusCode(_0x503336,_0x3e7ff4){_0x3e7ff4=_0x3e7ff4||0xcc;return function(_0x281c67){if(_0x281c67){return _0x503336[_0xffe1('0x18')](_0x3e7ff4);}return _0x503336[_0xffe1('0x19')](_0x3e7ff4)[_0xffe1('0x1a')]();};}function respondWithResult(_0x40a4e2,_0x50a63c){_0x50a63c=_0x50a63c||0xc8;return function(_0x118ae0){if(_0x118ae0){return _0x40a4e2[_0xffe1('0x19')](_0x50a63c)['json'](_0x118ae0);}};}function respondWithFilteredResult(_0xd37991,_0x17a630){return function(_0xef2d3b){if(_0xef2d3b){var _0x5ed5b4=typeof _0x17a630['offset']==='undefined'&&typeof _0x17a630[_0xffe1('0x1b')]===_0xffe1('0x1c');var _0x5c8292=_0xef2d3b['count'];var _0x51a134=_0x5ed5b4?0x0:_0x17a630[_0xffe1('0x1d')];var _0x23004f=_0x5ed5b4?_0xef2d3b['count']:_0x17a630[_0xffe1('0x1d')]+_0x17a630[_0xffe1('0x1b')];var _0x48351d;if(_0x23004f>=_0x5c8292){_0x23004f=_0x5c8292;_0x48351d=0xc8;}else{_0x48351d=0xce;}_0xd37991['status'](_0x48351d);return _0xd37991['set'](_0xffe1('0x1e'),_0x51a134+'-'+_0x23004f+'/'+_0x5c8292)[_0xffe1('0x1f')](_0xef2d3b);}return null;};}function patchUpdates(_0x591f2e){return function(_0x42d207){try{jsonpatch[_0xffe1('0x20')](_0x42d207,_0x591f2e,!![]);}catch(_0x386f0b){return BPromise[_0xffe1('0x21')](_0x386f0b);}return _0x42d207['save']();};}function saveUpdates(_0x5069a4,_0xa29a97){return function(_0x13dd25){if(_0x13dd25){return _0x13dd25[_0xffe1('0x22')](_0x5069a4)[_0xffe1('0x23')](function(_0x263fde){return _0x263fde;});}return null;};}function removeEntity(_0x51a39b,_0x116822){return function(_0x3c2b50){if(_0x3c2b50){return _0x3c2b50['destroy']()[_0xffe1('0x23')](function(){_0x51a39b[_0xffe1('0x19')](0xcc)[_0xffe1('0x1a')]();});}};}function handleEntityNotFound(_0x336f41,_0x16fd8b){return function(_0x1d52a4){if(!_0x1d52a4){_0x336f41[_0xffe1('0x18')](0x194);}return _0x1d52a4;};}function handleError(_0x244803,_0x5fc793){_0x5fc793=_0x5fc793||0x1f4;return function(_0x1dc8dc){logger[_0xffe1('0x24')](_0x1dc8dc[_0xffe1('0x25')]);if(_0x1dc8dc['name']){delete _0x1dc8dc[_0xffe1('0x26')];}_0x244803[_0xffe1('0x19')](_0x5fc793)[_0xffe1('0x27')](_0x1dc8dc);};}exports[_0xffe1('0x28')]=function(_0x346463,_0x267059){var _0x3d56eb={},_0x2f6460={},_0xde05d9={'count':0x0,'rows':[]};var _0x59c9c7=_[_0xffe1('0x29')](db['ServicenowConfiguration'][_0xffe1('0x2a')],function(_0x1839b3){return{'name':_0x1839b3[_0xffe1('0x2b')],'type':_0x1839b3['type'][_0xffe1('0x2c')]};});_0x2f6460[_0xffe1('0x2d')]=_[_0xffe1('0x29')](_0x59c9c7,_0xffe1('0x26'));_0x2f6460['query']=_[_0xffe1('0x2e')](_0x346463[_0xffe1('0x2f')]);_0x2f6460[_0xffe1('0x30')]=_[_0xffe1('0x31')](_0x2f6460['model'],_0x2f6460[_0xffe1('0x2f')]);_0x3d56eb[_0xffe1('0x32')]=_[_0xffe1('0x31')](_0x2f6460['model'],qs['fields'](_0x346463[_0xffe1('0x2f')][_0xffe1('0x33')]));_0x3d56eb['attributes']=_0x3d56eb[_0xffe1('0x32')]['length']?_0x3d56eb[_0xffe1('0x32')]:_0x2f6460[_0xffe1('0x2d')];if(!_0x346463[_0xffe1('0x2f')][_0xffe1('0x34')](_0xffe1('0x35'))){_0x3d56eb[_0xffe1('0x1b')]=qs[_0xffe1('0x1b')](_0x346463[_0xffe1('0x2f')][_0xffe1('0x1b')]);_0x3d56eb[_0xffe1('0x1d')]=qs['offset'](_0x346463[_0xffe1('0x2f')][_0xffe1('0x1d')]);}_0x3d56eb[_0xffe1('0x36')]=qs[_0xffe1('0x37')](_0x346463['query']['sort']);_0x3d56eb[_0xffe1('0x38')]=qs[_0xffe1('0x30')](_[_0xffe1('0x39')](_0x346463[_0xffe1('0x2f')],_0x2f6460[_0xffe1('0x30')]),_0x59c9c7);if(_0x346463['query'][_0xffe1('0x3a')]){_0x3d56eb[_0xffe1('0x38')]=_[_0xffe1('0x3b')](_0x3d56eb[_0xffe1('0x38')],{'$or':_[_0xffe1('0x29')](_0x59c9c7,function(_0x1c35dc){if(_0x1c35dc['type']!=='VIRTUAL'){var _0x35132c={};_0x35132c[_0x1c35dc[_0xffe1('0x26')]]={'$like':'%'+_0x346463[_0xffe1('0x2f')]['filter']+'%'};return _0x35132c;}})});}_0x3d56eb=_[_0xffe1('0x3b')]({},_0x3d56eb,_0x346463[_0xffe1('0x3c')]);var _0x3c1459={'where':_0x3d56eb[_0xffe1('0x38')]};return db[_0xffe1('0x3d')][_0xffe1('0x3e')](_0x3c1459)[_0xffe1('0x23')](function(_0x5173d2){_0xde05d9[_0xffe1('0x3e')]=_0x5173d2;if(_0x346463['query'][_0xffe1('0x3f')]){_0x3d56eb[_0xffe1('0x40')]=[{'all':!![]}];}return db['ServicenowConfiguration'][_0xffe1('0x41')](_0x3d56eb);})[_0xffe1('0x23')](function(_0x4d0b07){_0xde05d9[_0xffe1('0x42')]=_0x4d0b07;return _0xde05d9;})[_0xffe1('0x23')](respondWithFilteredResult(_0x267059,_0x3d56eb))[_0xffe1('0x43')](handleError(_0x267059,null));};exports[_0xffe1('0x44')]=function(_0x20cfa8,_0x1298b9){var _0x59287d={'raw':![],'where':{'id':_0x20cfa8[_0xffe1('0x45')]['id']}},_0x5eef9b={};_0x5eef9b[_0xffe1('0x2d')]=_[_0xffe1('0x2e')](db[_0xffe1('0x3d')][_0xffe1('0x2a')]);_0x5eef9b['query']=_[_0xffe1('0x2e')](_0x20cfa8[_0xffe1('0x2f')]);_0x5eef9b[_0xffe1('0x30')]=_[_0xffe1('0x31')](_0x5eef9b[_0xffe1('0x2d')],_0x5eef9b['query']);_0x59287d[_0xffe1('0x32')]=_[_0xffe1('0x31')](_0x5eef9b['model'],qs[_0xffe1('0x33')](_0x20cfa8[_0xffe1('0x2f')][_0xffe1('0x33')]));_0x59287d[_0xffe1('0x32')]=_0x59287d[_0xffe1('0x32')][_0xffe1('0x46')]?_0x59287d[_0xffe1('0x32')]:_0x5eef9b[_0xffe1('0x2d')];if(_0x20cfa8[_0xffe1('0x2f')][_0xffe1('0x3f')]){_0x59287d['include']=[{'all':!![]}];}_0x59287d=_[_0xffe1('0x3b')]({},_0x59287d,_0x20cfa8[_0xffe1('0x3c')]);return db[_0xffe1('0x3d')][_0xffe1('0x47')](_0x59287d)[_0xffe1('0x23')](handleEntityNotFound(_0x1298b9,null))[_0xffe1('0x23')](respondWithResult(_0x1298b9,null))[_0xffe1('0x43')](handleError(_0x1298b9,null));};exports[_0xffe1('0x48')]=function(_0x991e28,_0x1989db){return db[_0xffe1('0x3d')][_0xffe1('0x48')](_0x991e28[_0xffe1('0x49')],{})[_0xffe1('0x23')](respondWithResult(_0x1989db,0xc9))[_0xffe1('0x43')](handleError(_0x1989db,null));};exports[_0xffe1('0x22')]=function(_0x312574,_0x1aae04){if(_0x312574[_0xffe1('0x49')]['id']){delete _0x312574['body']['id'];}return db[_0xffe1('0x3d')]['find']({'where':{'id':_0x312574[_0xffe1('0x45')]['id']}})['then'](handleEntityNotFound(_0x1aae04,null))[_0xffe1('0x23')](saveUpdates(_0x312574['body'],null))['then'](respondWithResult(_0x1aae04,null))[_0xffe1('0x43')](handleError(_0x1aae04,null));};exports[_0xffe1('0x4a')]=function(_0x3b6832,_0x5643cb){return db[_0xffe1('0x3d')][_0xffe1('0x47')]({'where':{'id':_0x3b6832['params']['id']}})[_0xffe1('0x23')](handleEntityNotFound(_0x5643cb,null))['then'](removeEntity(_0x5643cb,null))[_0xffe1('0x43')](handleError(_0x5643cb,null));};exports[_0xffe1('0x4b')]=function(_0xa27ead,_0x18c7ca,_0x4cb2ab){var _0x5a6b79={};var _0x52b0bc={};var _0x253534;var _0x1bf270;return db['ServicenowConfiguration']['findOne']({'where':{'id':_0xa27ead[_0xffe1('0x45')]['id']}})['then'](handleEntityNotFound(_0x18c7ca,null))[_0xffe1('0x23')](function(_0x435baf){if(_0x435baf){_0x253534=_0x435baf;_0x52b0bc['model']=_[_0xffe1('0x2e')](db[_0xffe1('0x4c')][_0xffe1('0x2a')]);_0x52b0bc['query']=_[_0xffe1('0x2e')](_0xa27ead['query']);_0x52b0bc[_0xffe1('0x30')]=_[_0xffe1('0x31')](_0x52b0bc[_0xffe1('0x2d')],_0x52b0bc[_0xffe1('0x2f')]);_0x5a6b79[_0xffe1('0x32')]=_[_0xffe1('0x31')](_0x52b0bc[_0xffe1('0x2d')],qs[_0xffe1('0x33')](_0xa27ead[_0xffe1('0x2f')][_0xffe1('0x33')]));_0x5a6b79['attributes']=_0x5a6b79['attributes'][_0xffe1('0x46')]?_0x5a6b79['attributes']:_0x52b0bc['model'];_0x5a6b79[_0xffe1('0x36')]=qs[_0xffe1('0x37')](_0xa27ead[_0xffe1('0x2f')][_0xffe1('0x37')]);_0x5a6b79['where']=qs[_0xffe1('0x30')](_[_0xffe1('0x39')](_0xa27ead[_0xffe1('0x2f')],_0x52b0bc[_0xffe1('0x30')]));if(_0xa27ead[_0xffe1('0x2f')][_0xffe1('0x3a')]){_0x5a6b79['where']=_[_0xffe1('0x3b')](_0x5a6b79['where'],{'$or':_['map'](_0x5a6b79[_0xffe1('0x32')],function(_0x47cd92){var _0x217f22={};_0x217f22[_0x47cd92]={'$like':'%'+_0xa27ead[_0xffe1('0x2f')][_0xffe1('0x3a')]+'%'};return _0x217f22;})});}_0x5a6b79=_[_0xffe1('0x3b')]({},_0x5a6b79,_0xa27ead['options']);return _0x253534[_0xffe1('0x4b')](_0x5a6b79);}})[_0xffe1('0x23')](function(_0x30ae31){if(_0x30ae31){_0x1bf270=_0x30ae31[_0xffe1('0x46')];if(!_0xa27ead[_0xffe1('0x2f')][_0xffe1('0x34')](_0xffe1('0x35'))){_0x5a6b79[_0xffe1('0x1b')]=qs[_0xffe1('0x1b')](_0xa27ead[_0xffe1('0x2f')][_0xffe1('0x1b')]);_0x5a6b79[_0xffe1('0x1d')]=qs[_0xffe1('0x1d')](_0xa27ead[_0xffe1('0x2f')][_0xffe1('0x1d')]);}return _0x253534[_0xffe1('0x4b')](_0x5a6b79);}})[_0xffe1('0x23')](function(_0x4cb9e3){if(_0x4cb9e3){return _0x4cb9e3?{'count':_0x1bf270,'rows':_0x4cb9e3}:null;}})[_0xffe1('0x23')](respondWithResult(_0x18c7ca,null))[_0xffe1('0x43')](handleError(_0x18c7ca,null));};exports[_0xffe1('0x4d')]=function(_0x1a135a,_0x40f377,_0x29ee0f){var _0x96d168={};var _0x2b3793={};var _0x200a4c;var _0x14fc95;return db[_0xffe1('0x3d')]['findOne']({'where':{'id':_0x1a135a['params']['id']}})['then'](handleEntityNotFound(_0x40f377,null))[_0xffe1('0x23')](function(_0x105334){if(_0x105334){_0x200a4c=_0x105334;_0x2b3793[_0xffe1('0x2d')]=_[_0xffe1('0x2e')](db[_0xffe1('0x4c')]['rawAttributes']);_0x2b3793[_0xffe1('0x2f')]=_[_0xffe1('0x2e')](_0x1a135a[_0xffe1('0x2f')]);_0x2b3793[_0xffe1('0x30')]=_[_0xffe1('0x31')](_0x2b3793[_0xffe1('0x2d')],_0x2b3793[_0xffe1('0x2f')]);_0x96d168[_0xffe1('0x32')]=_[_0xffe1('0x31')](_0x2b3793[_0xffe1('0x2d')],qs[_0xffe1('0x33')](_0x1a135a[_0xffe1('0x2f')][_0xffe1('0x33')]));_0x96d168['attributes']=_0x96d168[_0xffe1('0x32')][_0xffe1('0x46')]?_0x96d168[_0xffe1('0x32')]:_0x2b3793['model'];_0x96d168[_0xffe1('0x36')]=qs[_0xffe1('0x37')](_0x1a135a[_0xffe1('0x2f')]['sort']);_0x96d168['where']=qs[_0xffe1('0x30')](_[_0xffe1('0x39')](_0x1a135a[_0xffe1('0x2f')],_0x2b3793[_0xffe1('0x30')]));if(_0x1a135a[_0xffe1('0x2f')][_0xffe1('0x3a')]){_0x96d168[_0xffe1('0x38')]=_['merge'](_0x96d168[_0xffe1('0x38')],{'$or':_[_0xffe1('0x29')](_0x96d168[_0xffe1('0x32')],function(_0x3a7c9d){var _0x16c2e1={};_0x16c2e1[_0x3a7c9d]={'$like':'%'+_0x1a135a[_0xffe1('0x2f')]['filter']+'%'};return _0x16c2e1;})});}_0x96d168=_['merge']({},_0x96d168,_0x1a135a[_0xffe1('0x3c')]);return _0x200a4c[_0xffe1('0x4d')](_0x96d168);}})['then'](function(_0x37c373){if(_0x37c373){_0x14fc95=_0x37c373['length'];if(!_0x1a135a['query'][_0xffe1('0x34')](_0xffe1('0x35'))){_0x96d168[_0xffe1('0x1b')]=qs[_0xffe1('0x1b')](_0x1a135a[_0xffe1('0x2f')][_0xffe1('0x1b')]);_0x96d168[_0xffe1('0x1d')]=qs[_0xffe1('0x1d')](_0x1a135a[_0xffe1('0x2f')][_0xffe1('0x1d')]);}return _0x200a4c['getSubjects'](_0x96d168);}})['then'](function(_0x455999){if(_0x455999){return _0x455999?{'count':_0x14fc95,'rows':_0x455999}:null;}})[_0xffe1('0x23')](respondWithResult(_0x40f377,null))['catch'](handleError(_0x40f377,null));};exports[_0xffe1('0x4e')]=function(_0x1b0595,_0xd7bf76,_0x13b95e){var _0x58508d={};var _0x37a4fc={};var _0x576b16;var _0x2197ff;return db[_0xffe1('0x3d')][_0xffe1('0x4f')]({'where':{'id':_0x1b0595[_0xffe1('0x45')]['id']}})[_0xffe1('0x23')](handleEntityNotFound(_0xd7bf76,null))[_0xffe1('0x23')](function(_0x4487c3){if(_0x4487c3){_0x576b16=_0x4487c3;_0x37a4fc['model']=_[_0xffe1('0x2e')](db[_0xffe1('0x4c')][_0xffe1('0x2a')]);_0x37a4fc['query']=_[_0xffe1('0x2e')](_0x1b0595[_0xffe1('0x2f')]);_0x37a4fc[_0xffe1('0x30')]=_[_0xffe1('0x31')](_0x37a4fc[_0xffe1('0x2d')],_0x37a4fc[_0xffe1('0x2f')]);_0x58508d[_0xffe1('0x32')]=_[_0xffe1('0x31')](_0x37a4fc['model'],qs[_0xffe1('0x33')](_0x1b0595[_0xffe1('0x2f')]['fields']));_0x58508d[_0xffe1('0x32')]=_0x58508d[_0xffe1('0x32')][_0xffe1('0x46')]?_0x58508d['attributes']:_0x37a4fc[_0xffe1('0x2d')];_0x58508d['order']=qs[_0xffe1('0x37')](_0x1b0595[_0xffe1('0x2f')][_0xffe1('0x37')]);_0x58508d[_0xffe1('0x38')]=qs[_0xffe1('0x30')](_[_0xffe1('0x39')](_0x1b0595[_0xffe1('0x2f')],_0x37a4fc[_0xffe1('0x30')]));if(_0x1b0595['query'][_0xffe1('0x3a')]){_0x58508d[_0xffe1('0x38')]=_['merge'](_0x58508d['where'],{'$or':_[_0xffe1('0x29')](_0x58508d[_0xffe1('0x32')],function(_0x49aaa0){var _0x44e35f={};_0x44e35f[_0x49aaa0]={'$like':'%'+_0x1b0595[_0xffe1('0x2f')][_0xffe1('0x3a')]+'%'};return _0x44e35f;})});}_0x58508d=_[_0xffe1('0x3b')]({},_0x58508d,_0x1b0595[_0xffe1('0x3c')]);return _0x576b16[_0xffe1('0x4e')](_0x58508d);}})[_0xffe1('0x23')](function(_0x32fab6){if(_0x32fab6){_0x2197ff=_0x32fab6[_0xffe1('0x46')];if(!_0x1b0595[_0xffe1('0x2f')][_0xffe1('0x34')](_0xffe1('0x35'))){_0x58508d['limit']=qs[_0xffe1('0x1b')](_0x1b0595[_0xffe1('0x2f')][_0xffe1('0x1b')]);_0x58508d[_0xffe1('0x1d')]=qs[_0xffe1('0x1d')](_0x1b0595[_0xffe1('0x2f')][_0xffe1('0x1d')]);}return _0x576b16['getDescriptions'](_0x58508d);}})['then'](function(_0x36fa10){if(_0x36fa10){return _0x36fa10?{'count':_0x2197ff,'rows':_0x36fa10}:null;}})[_0xffe1('0x23')](respondWithResult(_0xd7bf76,null))[_0xffe1('0x43')](handleError(_0xd7bf76,null));}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js index 32ff460..dee3905 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 _0x0ac0=['bluebird','request-promise','path','rimraf','../../config/environment','./intServicenowConfiguration.attributes','exports','define','ServicenowConfiguration','int_servicenow_configurations','lodash','util','../../config/logger','moment'];(function(_0x7ac88c,_0x2a9083){var _0x1e8a7d=function(_0x36f770){while(--_0x36f770){_0x7ac88c['push'](_0x7ac88c['shift']());}};_0x1e8a7d(++_0x2a9083);}(_0x0ac0,0x130));var _0x00ac=function(_0x2bb3f6,_0x25fde0){_0x2bb3f6=_0x2bb3f6-0x0;var _0x62b339=_0x0ac0[_0x2bb3f6];return _0x62b339;};'use strict';var _=require(_0x00ac('0x0'));var util=require(_0x00ac('0x1'));var logger=require(_0x00ac('0x2'))('api');var moment=require(_0x00ac('0x3'));var BPromise=require(_0x00ac('0x4'));var rp=require(_0x00ac('0x5'));var fs=require('fs');var path=require(_0x00ac('0x6'));var rimraf=require(_0x00ac('0x7'));var config=require(_0x00ac('0x8'));var attributes=require(_0x00ac('0x9'));module[_0x00ac('0xa')]=function(_0x4caaa8,_0x464817){return _0x4caaa8[_0x00ac('0xb')](_0x00ac('0xc'),attributes,{'tableName':_0x00ac('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xfb71=['define','ServicenowConfiguration','int_servicenow_configurations','lodash','util','../../config/logger','api','moment','path','rimraf','../../config/environment','exports'];(function(_0xc33d42,_0x1acfbc){var _0x286a83=function(_0x4b1762){while(--_0x4b1762){_0xc33d42['push'](_0xc33d42['shift']());}};_0x286a83(++_0x1acfbc);}(_0xfb71,0x1ef));var _0x1fb7=function(_0x3b3777,_0x2d66c2){_0x3b3777=_0x3b3777-0x0;var _0x46b6e7=_0xfb71[_0x3b3777];return _0x46b6e7;};'use strict';var _=require(_0x1fb7('0x0'));var util=require(_0x1fb7('0x1'));var logger=require(_0x1fb7('0x2'))(_0x1fb7('0x3'));var moment=require(_0x1fb7('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x1fb7('0x5'));var rimraf=require(_0x1fb7('0x6'));var config=require(_0x1fb7('0x7'));var attributes=require('./intServicenowConfiguration.attributes');module[_0x1fb7('0x8')]=function(_0x29532a,_0x2babe0){return _0x29532a[_0x1fb7('0x9')](_0x1fb7('0xa'),attributes,{'tableName':_0x1fb7('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.rpc.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.rpc.js index 8e3fd2b..26f1919 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 _0x6c99=['jayson/promise','http','then','info','request\x20sent','debug','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','error','code','ServicenowConfiguration,\x20%s,\x20%s','message','lodash','moment','../../config/logger','rpc','../../config/environment'];(function(_0x5dba83,_0x1c841e){var _0x428130=function(_0x30c175){while(--_0x30c175){_0x5dba83['push'](_0x5dba83['shift']());}};_0x428130(++_0x1c841e);}(_0x6c99,0x9b));var _0x96c9=function(_0x2d364e,_0x301c5e){_0x2d364e=_0x2d364e-0x0;var _0x1b9312=_0x6c99[_0x2d364e];return _0x1b9312;};'use strict';var _=require(_0x96c9('0x0'));var util=require('util');var moment=require(_0x96c9('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(_0x96c9('0x2'))(_0x96c9('0x3'));var config=require(_0x96c9('0x4'));var jayson=require(_0x96c9('0x5'));var client=jayson['client'][_0x96c9('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x1a30b2,_0x4323be,_0x31d79e){return new BPromise(function(_0x1a1dd0,_0x5a3e2f){return client['request'](_0x1a30b2,_0x31d79e)[_0x96c9('0x7')](function(_0x55bf5c){logger[_0x96c9('0x8')]('ServicenowConfiguration,\x20%s,\x20%s',_0x4323be,_0x96c9('0x9'));logger[_0x96c9('0xa')](_0x96c9('0xb'),_0x4323be,_0x96c9('0x9'),JSON['stringify'](_0x55bf5c));if(_0x55bf5c[_0x96c9('0xc')]){if(_0x55bf5c[_0x96c9('0xc')][_0x96c9('0xd')]===0x1f4){logger[_0x96c9('0xc')](_0x96c9('0xe'),_0x4323be,_0x55bf5c['error'][_0x96c9('0xf')]);return _0x5a3e2f(_0x55bf5c[_0x96c9('0xc')][_0x96c9('0xf')]);}logger[_0x96c9('0xc')]('ServicenowConfiguration,\x20%s,\x20%s',_0x4323be,_0x55bf5c['error'][_0x96c9('0xf')]);return _0x1a1dd0(_0x55bf5c[_0x96c9('0xc')][_0x96c9('0xf')]);}else{logger[_0x96c9('0x8')]('ServicenowConfiguration,\x20%s,\x20%s',_0x4323be,'request\x20sent');_0x1a1dd0(_0x55bf5c['result'][_0x96c9('0xf')]);}})['catch'](function(_0x348f74){logger['error'](_0x96c9('0xe'),_0x4323be,_0x348f74);_0x5a3e2f(_0x348f74);});});} \ No newline at end of file +var _0x544f=['debug','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','then','info','ServicenowConfiguration,\x20%s,\x20%s','request\x20sent'];(function(_0x29677e,_0x799790){var _0x2dd5a7=function(_0x96fc7a){while(--_0x96fc7a){_0x29677e['push'](_0x29677e['shift']());}};_0x2dd5a7(++_0x799790);}(_0x544f,0x104));var _0xf544=function(_0x307d86,_0x9264f2){_0x307d86=_0x307d86-0x0;var _0x361745=_0x544f[_0x307d86];return _0x361745;};'use strict';var _=require('lodash');var util=require(_0xf544('0x0'));var moment=require('moment');var BPromise=require(_0xf544('0x1'));var rs=require(_0xf544('0x2'));var fs=require('fs');var Redis=require(_0xf544('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xf544('0x4'));var logger=require(_0xf544('0x5'))(_0xf544('0x6'));var config=require('../../config/environment');var jayson=require(_0xf544('0x7'));var client=jayson[_0xf544('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5ef09f,_0x56bc50,_0x12824a){return new BPromise(function(_0x17dd2b,_0x13cbea){return client['request'](_0x5ef09f,_0x12824a)[_0xf544('0x9')](function(_0x1a5ac3){logger[_0xf544('0xa')](_0xf544('0xb'),_0x56bc50,_0xf544('0xc'));logger[_0xf544('0xd')](_0xf544('0xe'),_0x56bc50,_0xf544('0xc'),JSON[_0xf544('0xf')](_0x1a5ac3));if(_0x1a5ac3[_0xf544('0x10')]){if(_0x1a5ac3[_0xf544('0x10')][_0xf544('0x11')]===0x1f4){logger[_0xf544('0x10')](_0xf544('0xb'),_0x56bc50,_0x1a5ac3[_0xf544('0x10')][_0xf544('0x12')]);return _0x13cbea(_0x1a5ac3[_0xf544('0x10')][_0xf544('0x12')]);}logger[_0xf544('0x10')](_0xf544('0xb'),_0x56bc50,_0x1a5ac3[_0xf544('0x10')]['message']);return _0x17dd2b(_0x1a5ac3['error'][_0xf544('0x12')]);}else{logger['info']('ServicenowConfiguration,\x20%s,\x20%s',_0x56bc50,_0xf544('0xc'));_0x17dd2b(_0x1a5ac3[_0xf544('0x13')]['message']);}})[_0xf544('0x14')](function(_0x438b93){logger[_0xf544('0x10')](_0xf544('0xb'),_0x56bc50,_0x438b93);_0x13cbea(_0x438b93);});});} \ No newline at end of file diff --git a/server/api/intServicenowField/index.js b/server/api/intServicenowField/index.js index f3a9d93..0de6e10 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 _0xe093=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./intServicenowField.controller','/:id','isAuthenticated','show','post','put','update','delete','exports','multer','util'];(function(_0x4191af,_0x5783da){var _0x27bebf=function(_0x355be7){while(--_0x355be7){_0x4191af['push'](_0x4191af['shift']());}};_0x27bebf(++_0x5783da);}(_0xe093,0x130));var _0x3e09=function(_0x4d8ed9,_0x2ae284){_0x4d8ed9=_0x4d8ed9-0x0;var _0x1e2140=_0xe093[_0x4d8ed9];return _0x1e2140;};'use strict';var multer=require(_0x3e09('0x0'));var util=require(_0x3e09('0x1'));var path=require(_0x3e09('0x2'));var timeout=require(_0x3e09('0x3'));var express=require(_0x3e09('0x4'));var router=express[_0x3e09('0x5')]();var fs_extra=require(_0x3e09('0x6'));var auth=require(_0x3e09('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x3e09('0x8'));var controller=require(_0x3e09('0x9'));router['get']('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x3e09('0xa'),auth[_0x3e09('0xb')](),controller[_0x3e09('0xc')]);router[_0x3e09('0xd')]('/',auth[_0x3e09('0xb')](),controller['create']);router[_0x3e09('0xe')](_0x3e09('0xa'),auth[_0x3e09('0xb')](),controller[_0x3e09('0xf')]);router[_0x3e09('0x10')](_0x3e09('0xa'),auth[_0x3e09('0xb')](),controller['destroy']);module[_0x3e09('0x11')]=router; \ No newline at end of file +var _0xc546=['path','express','Router','fs-extra','../../components/auth/service','../../config/environment','isAuthenticated','index','get','/:id','show','post','create','put','delete','destroy','util'];(function(_0x4d01a2,_0x16db23){var _0x38b0f7=function(_0x1711a3){while(--_0x1711a3){_0x4d01a2['push'](_0x4d01a2['shift']());}};_0x38b0f7(++_0x16db23);}(_0xc546,0x186));var _0x6c54=function(_0x1cea03,_0x150538){_0x1cea03=_0x1cea03-0x0;var _0xce416b=_0xc546[_0x1cea03];return _0xce416b;};'use strict';var multer=require('multer');var util=require(_0x6c54('0x0'));var path=require(_0x6c54('0x1'));var timeout=require('connect-timeout');var express=require(_0x6c54('0x2'));var router=express[_0x6c54('0x3')]();var fs_extra=require(_0x6c54('0x4'));var auth=require(_0x6c54('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x6c54('0x6'));var controller=require('./intServicenowField.controller');router['get']('/',auth[_0x6c54('0x7')](),controller[_0x6c54('0x8')]);router[_0x6c54('0x9')](_0x6c54('0xa'),auth[_0x6c54('0x7')](),controller[_0x6c54('0xb')]);router[_0x6c54('0xc')]('/',auth[_0x6c54('0x7')](),controller[_0x6c54('0xd')]);router[_0x6c54('0xe')](_0x6c54('0xa'),auth[_0x6c54('0x7')](),controller['update']);router[_0x6c54('0xf')]('/:id',auth[_0x6c54('0x7')](),controller[_0x6c54('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.attributes.js b/server/api/intServicenowField/intServicenowField.attributes.js index 2008312..f635e5a 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 _0xb272=['exports','ENUM','string','variable','customVariable','picklist','STRING','BOOLEAN'];(function(_0x48ebe8,_0x300832){var _0x5c65fb=function(_0x55a95b){while(--_0x55a95b){_0x48ebe8['push'](_0x48ebe8['shift']());}};_0x5c65fb(++_0x300832);}(_0xb272,0x1d8));var _0x2b27=function(_0x106466,_0xe55a0){_0x106466=_0x106466-0x0;var _0x4ae2aa=_0xb272[_0x106466];return _0x4ae2aa;};'use strict';var Sequelize=require('sequelize');module[_0x2b27('0x0')]={'type':{'type':Sequelize[_0x2b27('0x1')](_0x2b27('0x2'),_0x2b27('0x3'),_0x2b27('0x4'),'keyValue',_0x2b27('0x5')),'defaultValue':_0x2b27('0x2')},'content':{'type':Sequelize[_0x2b27('0x6')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x2b27('0x1')](_0x2b27('0x2'),'variable',_0x2b27('0x4'))},'keyContent':{'type':Sequelize[_0x2b27('0x6')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x2b27('0x6')]},'customField':{'type':Sequelize[_0x2b27('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x2b27('0x6')]}}; \ No newline at end of file +var _0xa215=['exports','ENUM','string','variable','customVariable','keyValue','STRING','BOOLEAN','sequelize'];(function(_0x48a2d8,_0x256eaf){var _0x47a160=function(_0x5197ad){while(--_0x5197ad){_0x48a2d8['push'](_0x48a2d8['shift']());}};_0x47a160(++_0x256eaf);}(_0xa215,0x194));var _0x5a21=function(_0x3ecf95,_0x559a2c){_0x3ecf95=_0x3ecf95-0x0;var _0x3f1e72=_0xa215[_0x3ecf95];return _0x3f1e72;};'use strict';var Sequelize=require(_0x5a21('0x0'));module[_0x5a21('0x1')]={'type':{'type':Sequelize[_0x5a21('0x2')](_0x5a21('0x3'),_0x5a21('0x4'),_0x5a21('0x5'),_0x5a21('0x6'),'picklist'),'defaultValue':_0x5a21('0x3')},'content':{'type':Sequelize[_0x5a21('0x7')]},'key':{'type':Sequelize[_0x5a21('0x7')]},'keyType':{'type':Sequelize[_0x5a21('0x2')](_0x5a21('0x3'),_0x5a21('0x4'),'customVariable')},'keyContent':{'type':Sequelize[_0x5a21('0x7')]},'idField':{'type':Sequelize[_0x5a21('0x7')]},'nameField':{'type':Sequelize[_0x5a21('0x7')]},'customField':{'type':Sequelize[_0x5a21('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x5a21('0x7')]}}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.controller.js b/server/api/intServicenowField/intServicenowField.controller.js index 8910098..8b70f21 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 _0xc7cc=['name','send','index','map','fieldName','key','model','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','merge','where','type','VIRTUAL','filter','ServicenowField','includeAll','findAll','rows','params','keys','rawAttributes','length','include','catch','create','body','find','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','lodash','crypto','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','reject','save','update','then','destroy','error','stack'];(function(_0x3635ce,_0x33a6f9){var _0x97ecd0=function(_0x123d98){while(--_0x123d98){_0x3635ce['push'](_0x3635ce['shift']());}};_0x97ecd0(++_0x33a6f9);}(_0xc7cc,0xf1));var _0xcc7c=function(_0x17d41f,_0x28284f){_0x17d41f=_0x17d41f-0x0;var _0x71753b=_0xc7cc[_0x17d41f];return _0x71753b;};'use strict';var emlformat=require(_0xcc7c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xcc7c('0x1'));var jsonpatch=require(_0xcc7c('0x2'));var rp=require(_0xcc7c('0x3'));var moment=require(_0xcc7c('0x4'));var BPromise=require(_0xcc7c('0x5'));var Mustache=require('mustache');var util=require(_0xcc7c('0x6'));var path=require('path');var sox=require(_0xcc7c('0x7'));var csv=require(_0xcc7c('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xcc7c('0x9'));var squel=require('squel');var crypto=require(_0xcc7c('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xcc7c('0x8'));var querystring=require(_0xcc7c('0xb'));var Papa=require(_0xcc7c('0xc'));var Redis=require('ioredis');var authService=require(_0xcc7c('0xd'));var qs=require(_0xcc7c('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xcc7c('0xf'));var logger=require('../../config/logger')(_0xcc7c('0x10'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xcc7c('0x11'));var db=require(_0xcc7c('0x12'))['db'];function respondWithStatusCode(_0x13677c,_0x26419d){_0x26419d=_0x26419d||0xcc;return function(_0x116789){if(_0x116789){return _0x13677c[_0xcc7c('0x13')](_0x26419d);}return _0x13677c['status'](_0x26419d)[_0xcc7c('0x14')]();};}function respondWithResult(_0x146825,_0x5ef787){_0x5ef787=_0x5ef787||0xc8;return function(_0x3103bc){if(_0x3103bc){return _0x146825[_0xcc7c('0x15')](_0x5ef787)[_0xcc7c('0x16')](_0x3103bc);}};}function respondWithFilteredResult(_0x47384d,_0x5c658b){return function(_0x3e95e1){if(_0x3e95e1){var _0x390ab9=typeof _0x5c658b[_0xcc7c('0x17')]===_0xcc7c('0x18')&&typeof _0x5c658b[_0xcc7c('0x19')]===_0xcc7c('0x18');var _0x36aed2=_0x3e95e1[_0xcc7c('0x1a')];var _0x24b7ce=_0x390ab9?0x0:_0x5c658b[_0xcc7c('0x17')];var _0x24766f=_0x390ab9?_0x3e95e1[_0xcc7c('0x1a')]:_0x5c658b['offset']+_0x5c658b['limit'];var _0x4f4da5;if(_0x24766f>=_0x36aed2){_0x24766f=_0x36aed2;_0x4f4da5=0xc8;}else{_0x4f4da5=0xce;}_0x47384d[_0xcc7c('0x15')](_0x4f4da5);return _0x47384d[_0xcc7c('0x1b')]('Content-Range',_0x24b7ce+'-'+_0x24766f+'/'+_0x36aed2)[_0xcc7c('0x16')](_0x3e95e1);}return null;};}function patchUpdates(_0x5b4127){return function(_0x4869d4){try{jsonpatch['apply'](_0x4869d4,_0x5b4127,!![]);}catch(_0x20df7d){return BPromise[_0xcc7c('0x1c')](_0x20df7d);}return _0x4869d4[_0xcc7c('0x1d')]();};}function saveUpdates(_0x7374a,_0x35f10e){return function(_0x3b91de){if(_0x3b91de){return _0x3b91de[_0xcc7c('0x1e')](_0x7374a)[_0xcc7c('0x1f')](function(_0xce2151){return _0xce2151;});}return null;};}function removeEntity(_0x118497,_0x3bc3c5){return function(_0x461d9f){if(_0x461d9f){return _0x461d9f[_0xcc7c('0x20')]()[_0xcc7c('0x1f')](function(){_0x118497[_0xcc7c('0x15')](0xcc)[_0xcc7c('0x14')]();});}};}function handleEntityNotFound(_0x4f99d7,_0x343864){return function(_0x516c81){if(!_0x516c81){_0x4f99d7[_0xcc7c('0x13')](0x194);}return _0x516c81;};}function handleError(_0x124821,_0x4e1d9c){_0x4e1d9c=_0x4e1d9c||0x1f4;return function(_0x349f6e){logger[_0xcc7c('0x21')](_0x349f6e[_0xcc7c('0x22')]);if(_0x349f6e[_0xcc7c('0x23')]){delete _0x349f6e[_0xcc7c('0x23')];}_0x124821[_0xcc7c('0x15')](_0x4e1d9c)[_0xcc7c('0x24')](_0x349f6e);};}exports[_0xcc7c('0x25')]=function(_0x24a15a,_0x16cbaf){var _0x5e38f7={},_0x44c90f={},_0x5af8f0={'count':0x0,'rows':[]};var _0x52ac93=_[_0xcc7c('0x26')](db['ServicenowField']['rawAttributes'],function(_0x682383){return{'name':_0x682383[_0xcc7c('0x27')],'type':_0x682383['type'][_0xcc7c('0x28')]};});_0x44c90f[_0xcc7c('0x29')]=_[_0xcc7c('0x26')](_0x52ac93,_0xcc7c('0x23'));_0x44c90f[_0xcc7c('0x2a')]=_['keys'](_0x24a15a[_0xcc7c('0x2a')]);_0x44c90f[_0xcc7c('0x2b')]=_[_0xcc7c('0x2c')](_0x44c90f['model'],_0x44c90f[_0xcc7c('0x2a')]);_0x5e38f7['attributes']=_['intersection'](_0x44c90f[_0xcc7c('0x29')],qs[_0xcc7c('0x2d')](_0x24a15a[_0xcc7c('0x2a')][_0xcc7c('0x2d')]));_0x5e38f7[_0xcc7c('0x2e')]=_0x5e38f7[_0xcc7c('0x2e')]['length']?_0x5e38f7['attributes']:_0x44c90f[_0xcc7c('0x29')];if(!_0x24a15a[_0xcc7c('0x2a')][_0xcc7c('0x2f')](_0xcc7c('0x30'))){_0x5e38f7['limit']=qs[_0xcc7c('0x19')](_0x24a15a[_0xcc7c('0x2a')][_0xcc7c('0x19')]);_0x5e38f7[_0xcc7c('0x17')]=qs['offset'](_0x24a15a[_0xcc7c('0x2a')]['offset']);}_0x5e38f7[_0xcc7c('0x31')]=qs[_0xcc7c('0x32')](_0x24a15a[_0xcc7c('0x2a')][_0xcc7c('0x32')]);_0x5e38f7['where']=qs[_0xcc7c('0x2b')](_['pick'](_0x24a15a[_0xcc7c('0x2a')],_0x44c90f[_0xcc7c('0x2b')]),_0x52ac93);if(_0x24a15a[_0xcc7c('0x2a')]['filter']){_0x5e38f7['where']=_[_0xcc7c('0x33')](_0x5e38f7[_0xcc7c('0x34')],{'$or':_[_0xcc7c('0x26')](_0x52ac93,function(_0x561f9a){if(_0x561f9a[_0xcc7c('0x35')]!==_0xcc7c('0x36')){var _0x18facd={};_0x18facd[_0x561f9a[_0xcc7c('0x23')]]={'$like':'%'+_0x24a15a[_0xcc7c('0x2a')][_0xcc7c('0x37')]+'%'};return _0x18facd;}})});}_0x5e38f7=_[_0xcc7c('0x33')]({},_0x5e38f7,_0x24a15a['options']);var _0x26ab59={'where':_0x5e38f7[_0xcc7c('0x34')]};return db[_0xcc7c('0x38')][_0xcc7c('0x1a')](_0x26ab59)[_0xcc7c('0x1f')](function(_0x12b514){_0x5af8f0['count']=_0x12b514;if(_0x24a15a[_0xcc7c('0x2a')][_0xcc7c('0x39')]){_0x5e38f7['include']=[{'all':!![]}];}return db[_0xcc7c('0x38')][_0xcc7c('0x3a')](_0x5e38f7);})['then'](function(_0x1badef){_0x5af8f0[_0xcc7c('0x3b')]=_0x1badef;return _0x5af8f0;})[_0xcc7c('0x1f')](respondWithFilteredResult(_0x16cbaf,_0x5e38f7))['catch'](handleError(_0x16cbaf,null));};exports['show']=function(_0x459431,_0xf62269){var _0x27cb22={'raw':!![],'where':{'id':_0x459431[_0xcc7c('0x3c')]['id']}},_0x213970={};_0x213970[_0xcc7c('0x29')]=_[_0xcc7c('0x3d')](db[_0xcc7c('0x38')][_0xcc7c('0x3e')]);_0x213970[_0xcc7c('0x2a')]=_['keys'](_0x459431[_0xcc7c('0x2a')]);_0x213970['filters']=_['intersection'](_0x213970[_0xcc7c('0x29')],_0x213970['query']);_0x27cb22[_0xcc7c('0x2e')]=_[_0xcc7c('0x2c')](_0x213970[_0xcc7c('0x29')],qs[_0xcc7c('0x2d')](_0x459431['query'][_0xcc7c('0x2d')]));_0x27cb22['attributes']=_0x27cb22[_0xcc7c('0x2e')][_0xcc7c('0x3f')]?_0x27cb22[_0xcc7c('0x2e')]:_0x213970[_0xcc7c('0x29')];if(_0x459431['query'][_0xcc7c('0x39')]){_0x27cb22[_0xcc7c('0x40')]=[{'all':!![]}];}_0x27cb22=_[_0xcc7c('0x33')]({},_0x27cb22,_0x459431['options']);return db[_0xcc7c('0x38')]['find'](_0x27cb22)['then'](handleEntityNotFound(_0xf62269,null))[_0xcc7c('0x1f')](respondWithResult(_0xf62269,null))[_0xcc7c('0x41')](handleError(_0xf62269,null));};exports[_0xcc7c('0x42')]=function(_0x2b4492,_0x16410b){return db['ServicenowField'][_0xcc7c('0x42')](_0x2b4492[_0xcc7c('0x43')],{})[_0xcc7c('0x1f')](respondWithResult(_0x16410b,0xc9))[_0xcc7c('0x41')](handleError(_0x16410b,null));};exports[_0xcc7c('0x1e')]=function(_0x25a3b2,_0x411177){if(_0x25a3b2[_0xcc7c('0x43')]['id']){delete _0x25a3b2[_0xcc7c('0x43')]['id'];}return db[_0xcc7c('0x38')][_0xcc7c('0x44')]({'where':{'id':_0x25a3b2['params']['id']}})[_0xcc7c('0x1f')](handleEntityNotFound(_0x411177,null))['then'](saveUpdates(_0x25a3b2['body'],null))['then'](respondWithResult(_0x411177,null))['catch'](handleError(_0x411177,null));};exports['destroy']=function(_0x6774f9,_0x19517c){return db['ServicenowField'][_0xcc7c('0x44')]({'where':{'id':_0x6774f9[_0xcc7c('0x3c')]['id']}})[_0xcc7c('0x1f')](handleEntityNotFound(_0x19517c,null))[_0xcc7c('0x1f')](removeEntity(_0x19517c,null))['catch'](handleError(_0x19517c,null));}; \ No newline at end of file +var _0x7ae0=['key','model','query','filters','intersection','attributes','fields','hasOwnProperty','order','sort','filter','where','VIRTUAL','merge','options','ServicenowField','include','findAll','catch','keys','length','includeAll','find','create','body','params','eml-format','rimraf','moment','bluebird','mustache','util','path','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../config/license/hardware','../../config/logger','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','limit','count','Content-Range','json','apply','reject','save','update','then','destroy','end','error','stack','name','send','index','map','rawAttributes','type'];(function(_0x476078,_0x5d842f){var _0xc30950=function(_0x10055b){while(--_0x10055b){_0x476078['push'](_0x476078['shift']());}};_0xc30950(++_0x5d842f);}(_0x7ae0,0xe9));var _0x07ae=function(_0xede441,_0x285c54){_0xede441=_0xede441-0x0;var _0x51c99f=_0x7ae0[_0xede441];return _0x51c99f;};'use strict';var emlformat=require(_0x07ae('0x0'));var rimraf=require(_0x07ae('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x07ae('0x2'));var BPromise=require(_0x07ae('0x3'));var Mustache=require(_0x07ae('0x4'));var util=require(_0x07ae('0x5'));var path=require(_0x07ae('0x6'));var sox=require('sox');var csv=require(_0x07ae('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x07ae('0x8'));var _=require(_0x07ae('0x9'));var squel=require('squel');var crypto=require(_0x07ae('0xa'));var jsforce=require(_0x07ae('0xb'));var deskjs=require(_0x07ae('0xc'));var toCsv=require(_0x07ae('0x7'));var querystring=require(_0x07ae('0xd'));var Papa=require(_0x07ae('0xe'));var Redis=require(_0x07ae('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x07ae('0x10'));var logger=require(_0x07ae('0x11'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x07ae('0x12'));var db=require(_0x07ae('0x13'))['db'];function respondWithStatusCode(_0x1c4ed9,_0x1c7966){_0x1c7966=_0x1c7966||0xcc;return function(_0x49ca11){if(_0x49ca11){return _0x1c4ed9[_0x07ae('0x14')](_0x1c7966);}return _0x1c4ed9[_0x07ae('0x15')](_0x1c7966)['end']();};}function respondWithResult(_0x27e0df,_0x44f693){_0x44f693=_0x44f693||0xc8;return function(_0x53e764){if(_0x53e764){return _0x27e0df[_0x07ae('0x15')](_0x44f693)['json'](_0x53e764);}};}function respondWithFilteredResult(_0x38d58a,_0x5bcf85){return function(_0x572aa3){if(_0x572aa3){var _0x1c9083=typeof _0x5bcf85[_0x07ae('0x16')]===_0x07ae('0x17')&&typeof _0x5bcf85[_0x07ae('0x18')]===_0x07ae('0x17');var _0x439de1=_0x572aa3[_0x07ae('0x19')];var _0xa96d97=_0x1c9083?0x0:_0x5bcf85[_0x07ae('0x16')];var _0x3fa9f8=_0x1c9083?_0x572aa3[_0x07ae('0x19')]:_0x5bcf85[_0x07ae('0x16')]+_0x5bcf85[_0x07ae('0x18')];var _0x2ee3b6;if(_0x3fa9f8>=_0x439de1){_0x3fa9f8=_0x439de1;_0x2ee3b6=0xc8;}else{_0x2ee3b6=0xce;}_0x38d58a[_0x07ae('0x15')](_0x2ee3b6);return _0x38d58a['set'](_0x07ae('0x1a'),_0xa96d97+'-'+_0x3fa9f8+'/'+_0x439de1)[_0x07ae('0x1b')](_0x572aa3);}return null;};}function patchUpdates(_0x46024c){return function(_0x4d2fb2){try{jsonpatch[_0x07ae('0x1c')](_0x4d2fb2,_0x46024c,!![]);}catch(_0x555633){return BPromise[_0x07ae('0x1d')](_0x555633);}return _0x4d2fb2[_0x07ae('0x1e')]();};}function saveUpdates(_0x4a2eaf,_0x46698a){return function(_0x4b3e13){if(_0x4b3e13){return _0x4b3e13[_0x07ae('0x1f')](_0x4a2eaf)[_0x07ae('0x20')](function(_0x180b7f){return _0x180b7f;});}return null;};}function removeEntity(_0x2bf3a9,_0x4c1b2f){return function(_0x5bb54d){if(_0x5bb54d){return _0x5bb54d[_0x07ae('0x21')]()[_0x07ae('0x20')](function(){_0x2bf3a9['status'](0xcc)[_0x07ae('0x22')]();});}};}function handleEntityNotFound(_0x581a1e,_0x5720e9){return function(_0x1b104d){if(!_0x1b104d){_0x581a1e['sendStatus'](0x194);}return _0x1b104d;};}function handleError(_0x2f8d0d,_0x242d33){_0x242d33=_0x242d33||0x1f4;return function(_0x2068fd){logger[_0x07ae('0x23')](_0x2068fd[_0x07ae('0x24')]);if(_0x2068fd[_0x07ae('0x25')]){delete _0x2068fd[_0x07ae('0x25')];}_0x2f8d0d['status'](_0x242d33)[_0x07ae('0x26')](_0x2068fd);};}exports[_0x07ae('0x27')]=function(_0x3a9328,_0x4c2f4a){var _0x53434f={},_0x20f1cf={},_0x2a9048={'count':0x0,'rows':[]};var _0x71d767=_[_0x07ae('0x28')](db['ServicenowField'][_0x07ae('0x29')],function(_0x4994dc){return{'name':_0x4994dc['fieldName'],'type':_0x4994dc[_0x07ae('0x2a')][_0x07ae('0x2b')]};});_0x20f1cf[_0x07ae('0x2c')]=_[_0x07ae('0x28')](_0x71d767,'name');_0x20f1cf['query']=_['keys'](_0x3a9328[_0x07ae('0x2d')]);_0x20f1cf[_0x07ae('0x2e')]=_[_0x07ae('0x2f')](_0x20f1cf[_0x07ae('0x2c')],_0x20f1cf[_0x07ae('0x2d')]);_0x53434f[_0x07ae('0x30')]=_['intersection'](_0x20f1cf[_0x07ae('0x2c')],qs[_0x07ae('0x31')](_0x3a9328[_0x07ae('0x2d')][_0x07ae('0x31')]));_0x53434f['attributes']=_0x53434f[_0x07ae('0x30')]['length']?_0x53434f[_0x07ae('0x30')]:_0x20f1cf['model'];if(!_0x3a9328[_0x07ae('0x2d')][_0x07ae('0x32')]('nolimit')){_0x53434f['limit']=qs[_0x07ae('0x18')](_0x3a9328['query']['limit']);_0x53434f['offset']=qs[_0x07ae('0x16')](_0x3a9328['query']['offset']);}_0x53434f[_0x07ae('0x33')]=qs[_0x07ae('0x34')](_0x3a9328[_0x07ae('0x2d')][_0x07ae('0x34')]);_0x53434f['where']=qs[_0x07ae('0x2e')](_['pick'](_0x3a9328[_0x07ae('0x2d')],_0x20f1cf[_0x07ae('0x2e')]),_0x71d767);if(_0x3a9328[_0x07ae('0x2d')][_0x07ae('0x35')]){_0x53434f[_0x07ae('0x36')]=_['merge'](_0x53434f[_0x07ae('0x36')],{'$or':_[_0x07ae('0x28')](_0x71d767,function(_0x1afc11){if(_0x1afc11[_0x07ae('0x2a')]!==_0x07ae('0x37')){var _0x5307ba={};_0x5307ba[_0x1afc11['name']]={'$like':'%'+_0x3a9328[_0x07ae('0x2d')][_0x07ae('0x35')]+'%'};return _0x5307ba;}})});}_0x53434f=_[_0x07ae('0x38')]({},_0x53434f,_0x3a9328[_0x07ae('0x39')]);var _0x3e94a2={'where':_0x53434f[_0x07ae('0x36')]};return db[_0x07ae('0x3a')][_0x07ae('0x19')](_0x3e94a2)[_0x07ae('0x20')](function(_0x58b547){_0x2a9048[_0x07ae('0x19')]=_0x58b547;if(_0x3a9328[_0x07ae('0x2d')]['includeAll']){_0x53434f[_0x07ae('0x3b')]=[{'all':!![]}];}return db[_0x07ae('0x3a')][_0x07ae('0x3c')](_0x53434f);})[_0x07ae('0x20')](function(_0x364871){_0x2a9048['rows']=_0x364871;return _0x2a9048;})[_0x07ae('0x20')](respondWithFilteredResult(_0x4c2f4a,_0x53434f))[_0x07ae('0x3d')](handleError(_0x4c2f4a,null));};exports['show']=function(_0x47b504,_0x15e34b){var _0x89b605={'raw':!![],'where':{'id':_0x47b504['params']['id']}},_0x4d25b4={};_0x4d25b4['model']=_[_0x07ae('0x3e')](db[_0x07ae('0x3a')][_0x07ae('0x29')]);_0x4d25b4[_0x07ae('0x2d')]=_[_0x07ae('0x3e')](_0x47b504[_0x07ae('0x2d')]);_0x4d25b4[_0x07ae('0x2e')]=_[_0x07ae('0x2f')](_0x4d25b4['model'],_0x4d25b4[_0x07ae('0x2d')]);_0x89b605[_0x07ae('0x30')]=_[_0x07ae('0x2f')](_0x4d25b4[_0x07ae('0x2c')],qs[_0x07ae('0x31')](_0x47b504[_0x07ae('0x2d')][_0x07ae('0x31')]));_0x89b605[_0x07ae('0x30')]=_0x89b605[_0x07ae('0x30')][_0x07ae('0x3f')]?_0x89b605[_0x07ae('0x30')]:_0x4d25b4[_0x07ae('0x2c')];if(_0x47b504[_0x07ae('0x2d')][_0x07ae('0x40')]){_0x89b605[_0x07ae('0x3b')]=[{'all':!![]}];}_0x89b605=_[_0x07ae('0x38')]({},_0x89b605,_0x47b504[_0x07ae('0x39')]);return db[_0x07ae('0x3a')][_0x07ae('0x41')](_0x89b605)[_0x07ae('0x20')](handleEntityNotFound(_0x15e34b,null))[_0x07ae('0x20')](respondWithResult(_0x15e34b,null))['catch'](handleError(_0x15e34b,null));};exports[_0x07ae('0x42')]=function(_0x3a37a4,_0x3c4719){return db[_0x07ae('0x3a')][_0x07ae('0x42')](_0x3a37a4[_0x07ae('0x43')],{})[_0x07ae('0x20')](respondWithResult(_0x3c4719,0xc9))['catch'](handleError(_0x3c4719,null));};exports['update']=function(_0xe6e63e,_0x57ca50){if(_0xe6e63e[_0x07ae('0x43')]['id']){delete _0xe6e63e['body']['id'];}return db['ServicenowField']['find']({'where':{'id':_0xe6e63e['params']['id']}})[_0x07ae('0x20')](handleEntityNotFound(_0x57ca50,null))[_0x07ae('0x20')](saveUpdates(_0xe6e63e[_0x07ae('0x43')],null))[_0x07ae('0x20')](respondWithResult(_0x57ca50,null))[_0x07ae('0x3d')](handleError(_0x57ca50,null));};exports['destroy']=function(_0x1f88a5,_0x405381){return db[_0x07ae('0x3a')][_0x07ae('0x41')]({'where':{'id':_0x1f88a5[_0x07ae('0x44')]['id']}})[_0x07ae('0x20')](handleEntityNotFound(_0x405381,null))[_0x07ae('0x20')](removeEntity(_0x405381,null))[_0x07ae('0x3d')](handleError(_0x405381,null));}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.model.js b/server/api/intServicenowField/intServicenowField.model.js index 80ba84f..0765f3c 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 _0x2d73=['bluebird','request-promise','path','rimraf','../../config/environment','define','ServicenowField','int_servicenow_fields','servicenow_unique_index','idField','FieldId','lodash','util','moment'];(function(_0x1ab180,_0x382b2c){var _0xfb2c2d=function(_0x1c5fd3){while(--_0x1c5fd3){_0x1ab180['push'](_0x1ab180['shift']());}};_0xfb2c2d(++_0x382b2c);}(_0x2d73,0x185));var _0x32d7=function(_0x39157f,_0x3d8c1e){_0x39157f=_0x39157f-0x0;var _0x1ae4e2=_0x2d73[_0x39157f];return _0x1ae4e2;};'use strict';var _=require(_0x32d7('0x0'));var util=require(_0x32d7('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x32d7('0x2'));var BPromise=require(_0x32d7('0x3'));var rp=require(_0x32d7('0x4'));var fs=require('fs');var path=require(_0x32d7('0x5'));var rimraf=require(_0x32d7('0x6'));var config=require(_0x32d7('0x7'));var attributes=require('./intServicenowField.attributes');module['exports']=function(_0x1e03de,_0x215b32){return _0x1e03de[_0x32d7('0x8')](_0x32d7('0x9'),attributes,{'tableName':_0x32d7('0xa'),'paranoid':![],'indexes':[{'name':_0x32d7('0xb'),'fields':[_0x32d7('0xc'),_0x32d7('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x2149=['../../config/environment','./intServicenowField.attributes','exports','define','int_servicenow_fields','servicenow_unique_index','FieldId','lodash','util','../../config/logger','api','moment','request-promise','path'];(function(_0x1f5e97,_0x2ca1f8){var _0xe95fd4=function(_0x556ab8){while(--_0x556ab8){_0x1f5e97['push'](_0x1f5e97['shift']());}};_0xe95fd4(++_0x2ca1f8);}(_0x2149,0x1e3));var _0x9214=function(_0x5ea03c,_0x30ce5a){_0x5ea03c=_0x5ea03c-0x0;var _0x59105e=_0x2149[_0x5ea03c];return _0x59105e;};'use strict';var _=require(_0x9214('0x0'));var util=require(_0x9214('0x1'));var logger=require(_0x9214('0x2'))(_0x9214('0x3'));var moment=require(_0x9214('0x4'));var BPromise=require('bluebird');var rp=require(_0x9214('0x5'));var fs=require('fs');var path=require(_0x9214('0x6'));var rimraf=require('rimraf');var config=require(_0x9214('0x7'));var attributes=require(_0x9214('0x8'));module[_0x9214('0x9')]=function(_0x4259ca,_0x514733){return _0x4259ca[_0x9214('0xa')]('ServicenowField',attributes,{'tableName':_0x9214('0xb'),'paranoid':![],'indexes':[{'name':_0x9214('0xc'),'fields':['idField',_0x9214('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 942231e..f829b61 100644 --- a/server/api/intServicenowField/intServicenowField.rpc.js +++ b/server/api/intServicenowField/intServicenowField.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xac4a=['ServicenowField,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','client','then','info','debug','ServicenowField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x2d7f0e,_0x3e6fbd){var _0x110b07=function(_0x557b00){while(--_0x557b00){_0x2d7f0e['push'](_0x2d7f0e['shift']());}};_0x110b07(++_0x3e6fbd);}(_0xac4a,0x13f));var _0xaac4=function(_0x290501,_0x1c8e10){_0x290501=_0x290501-0x0;var _0x151537=_0xac4a[_0x290501];return _0x151537;};'use strict';var _=require(_0xaac4('0x0'));var util=require(_0xaac4('0x1'));var moment=require(_0xaac4('0x2'));var BPromise=require(_0xaac4('0x3'));var rs=require(_0xaac4('0x4'));var fs=require('fs');var Redis=require(_0xaac4('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xaac4('0x6'))(_0xaac4('0x7'));var config=require(_0xaac4('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xaac4('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1cdfc5,_0x5870e8,_0x1e4283){return new BPromise(function(_0x27354c,_0x567295){return client['request'](_0x1cdfc5,_0x1e4283)[_0xaac4('0xa')](function(_0x50d114){logger[_0xaac4('0xb')]('ServicenowField,\x20%s,\x20%s',_0x5870e8,'request\x20sent');logger[_0xaac4('0xc')](_0xaac4('0xd'),_0x5870e8,_0xaac4('0xe'),JSON[_0xaac4('0xf')](_0x50d114));if(_0x50d114[_0xaac4('0x10')]){if(_0x50d114['error']['code']===0x1f4){logger[_0xaac4('0x10')](_0xaac4('0x11'),_0x5870e8,_0x50d114[_0xaac4('0x10')]['message']);return _0x567295(_0x50d114[_0xaac4('0x10')][_0xaac4('0x12')]);}logger['error'](_0xaac4('0x11'),_0x5870e8,_0x50d114[_0xaac4('0x10')][_0xaac4('0x12')]);return _0x27354c(_0x50d114[_0xaac4('0x10')][_0xaac4('0x12')]);}else{logger[_0xaac4('0xb')](_0xaac4('0x11'),_0x5870e8,_0xaac4('0xe'));_0x27354c(_0x50d114[_0xaac4('0x13')][_0xaac4('0x12')]);}})[_0xaac4('0x14')](function(_0x1766c2){logger[_0xaac4('0x10')]('ServicenowField,\x20%s,\x20%s',_0x5870e8,_0x1766c2);_0x567295(_0x1766c2);});});} \ No newline at end of file +var _0xb43b=['rpc','../../config/environment','http','request','info','request\x20sent','debug','ServicenowField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','ServicenowField,\x20%s,\x20%s','catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger'];(function(_0x10db95,_0x37f940){var _0x2ecf43=function(_0x3ad0e0){while(--_0x3ad0e0){_0x10db95['push'](_0x10db95['shift']());}};_0x2ecf43(++_0x37f940);}(_0xb43b,0x1b2));var _0xbb43=function(_0x30f167,_0x3b9e32){_0x30f167=_0x30f167-0x0;var _0x4fbd05=_0xb43b[_0x30f167];return _0x4fbd05;};'use strict';var _=require(_0xbb43('0x0'));var util=require(_0xbb43('0x1'));var moment=require('moment');var BPromise=require(_0xbb43('0x2'));var rs=require(_0xbb43('0x3'));var fs=require('fs');var Redis=require(_0xbb43('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xbb43('0x5'));var logger=require(_0xbb43('0x6'))(_0xbb43('0x7'));var config=require(_0xbb43('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0xbb43('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x553520,_0x80fe61,_0x1ccd49){return new BPromise(function(_0x2a2f11,_0x29ae1a){return client[_0xbb43('0xa')](_0x553520,_0x1ccd49)['then'](function(_0x208c2b){logger[_0xbb43('0xb')]('ServicenowField,\x20%s,\x20%s',_0x80fe61,_0xbb43('0xc'));logger[_0xbb43('0xd')](_0xbb43('0xe'),_0x80fe61,_0xbb43('0xc'),JSON[_0xbb43('0xf')](_0x208c2b));if(_0x208c2b[_0xbb43('0x10')]){if(_0x208c2b['error'][_0xbb43('0x11')]===0x1f4){logger[_0xbb43('0x10')]('ServicenowField,\x20%s,\x20%s',_0x80fe61,_0x208c2b['error'][_0xbb43('0x12')]);return _0x29ae1a(_0x208c2b['error']['message']);}logger[_0xbb43('0x10')]('ServicenowField,\x20%s,\x20%s',_0x80fe61,_0x208c2b[_0xbb43('0x10')][_0xbb43('0x12')]);return _0x2a2f11(_0x208c2b['error']['message']);}else{logger['info'](_0xbb43('0x13'),_0x80fe61,_0xbb43('0xc'));_0x2a2f11(_0x208c2b['result']['message']);}})[_0xbb43('0x14')](function(_0x563ce1){logger['error'](_0xbb43('0x13'),_0x80fe61,_0x563ce1);_0x29ae1a(_0x563ce1);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/index.js b/server/api/intSugarcrmAccount/index.js index 86b617b..748ad72 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(_0x430dd8,_0x189b2b){var _0x48eaec=function(_0x2e0190){while(--_0x2e0190){_0x430dd8['push'](_0x430dd8['shift']());}};_0x48eaec(++_0x189b2b);}(_0x9957,0x93));var _0x7995=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x9957[_0x1facfa];return _0x9ec701;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x11')]('/',auth['isAuthenticated'](),controller[_0x7995('0x12')]);router[_0x7995('0x11')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x7995('0x17')]);module[_0x7995('0x18')]=router; \ No newline at end of file +var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmAccount.controller','get','index','/:id','getConfigurations','/:id/fields','isAuthenticated','getFields','post','addConfiguration','put','update','destroy','exports','multer','util','path'];(function(_0x5c3b99,_0x3a24d0){var _0x2b174c=function(_0x43bcca){while(--_0x43bcca){_0x5c3b99['push'](_0x5c3b99['shift']());}};_0x2b174c(++_0x3a24d0);}(_0xa9e0,0x123));var _0x0a9e=function(_0x45e98e,_0x169b60){_0x45e98e=_0x45e98e-0x0;var _0x374dba=_0xa9e0[_0x45e98e];return _0x374dba;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/configurations',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x11')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x12')]);router['delete'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);module[_0x0a9e('0x14')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.attributes.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.attributes.js index 098d752..407d54a 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(_0x5a2ccb,_0x4f737f){var _0x1fdec3=function(_0x97b7b6){while(--_0x97b7b6){_0x5a2ccb['push'](_0x5a2ccb['shift']());}};_0x1fdec3(++_0x4f737f);}(_0xa9e0,0x123));var _0x0a9e=function(_0xbe200f,_0x4b50eb){_0xbe200f=_0xbe200f-0x0;var _0x192597=_0xa9e0[_0xbe200f];return _0x192597;};'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(_0x5e1e5d,_0x304efc){var _0x50c1d7=function(_0x434b00){while(--_0x434b00){_0x5e1e5d['push'](_0x5e1e5d['shift']());}};_0x50c1d7(++_0x304efc);}(_0xa9e0,0x123));var _0x0a9e=function(_0x9aada2,_0xd2d349){_0x9aada2=_0x9aada2-0x0;var _0x196dff=_0xa9e0[_0x9aada2];return _0x196dff;};'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 20d85a8..7cebbd2 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 _0xb7be=['values','remove','includes','label','value','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','send','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','status','end','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','name','map','rawAttributes','fieldName','type','key','query','keys','filters','intersection','attributes','fields','model','order','sort','where','pick','filter','merge','options','SugarcrmAccount','includeAll','include','rows','catch','show','params','length','create','body','find','getConfigurations','findOne','SugarcrmConfiguration','hasOwnProperty','nolimit','addConfiguration','AccountId','Subjects','getSubjects','Descriptions','channel','SugarcrmField','getFields','assigned_user_id','created_by','description','date_start','parent_id','parent_name','username','password','remoteUri','slice','substring','POST','format','%s%s','/service/v4_1/rest.php','login','JSON','PLAIN','xCALLY\x20Motion\x20Integration','Invalid\x20Login','Password\x20Expired','get_module_fields','stringify','Calls'];(function(_0x413e05,_0x54bd10){var _0x1c1b1e=function(_0x4f1485){while(--_0x4f1485){_0x413e05['push'](_0x413e05['shift']());}};_0x1c1b1e(++_0x54bd10);}(_0xb7be,0x16f));var _0xeb7b=function(_0x56206c,_0x3cb817){_0x56206c=_0x56206c-0x0;var _0x39a8f0=_0xb7be[_0x56206c];return _0x39a8f0;};'use strict';var emlformat=require(_0xeb7b('0x0'));var rimraf=require(_0xeb7b('0x1'));var zipdir=require(_0xeb7b('0x2'));var jsonpatch=require(_0xeb7b('0x3'));var rp=require(_0xeb7b('0x4'));var moment=require(_0xeb7b('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xeb7b('0x6'));var util=require('util');var path=require('path');var sox=require(_0xeb7b('0x7'));var csv=require(_0xeb7b('0x8'));var ejs=require(_0xeb7b('0x9'));var fs=require('fs');var fs_extra=require(_0xeb7b('0xa'));var _=require(_0xeb7b('0xb'));var squel=require(_0xeb7b('0xc'));var crypto=require(_0xeb7b('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xeb7b('0xe'));var Papa=require(_0xeb7b('0xf'));var Redis=require(_0xeb7b('0x10'));var authService=require(_0xeb7b('0x11'));var qs=require(_0xeb7b('0x12'));var as=require(_0xeb7b('0x13'));var hardwareService=require(_0xeb7b('0x14'));var logger=require('../../config/logger')(_0xeb7b('0x15'));var utils=require(_0xeb7b('0x16'));var config=require(_0xeb7b('0x17'));var licenseUtil=require(_0xeb7b('0x18'));var db=require('../../mysqldb')['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x326cbe,_0xa894d5){_0xa894d5=_0xa894d5||0xcc;return function(_0x10c46e){if(_0x10c46e){return _0x326cbe['sendStatus'](_0xa894d5);}return _0x326cbe[_0xeb7b('0x19')](_0xa894d5)[_0xeb7b('0x1a')]();};}function respondWithResult(_0x2e555a,_0x30b2dd){_0x30b2dd=_0x30b2dd||0xc8;return function(_0x42f5b1){if(_0x42f5b1){return _0x2e555a['status'](_0x30b2dd)['json'](_0x42f5b1);}};}function respondWithFilteredResult(_0x39e1e7,_0x2ba627){return function(_0x5e6673){if(_0x5e6673){var _0x580ed8=typeof _0x2ba627[_0xeb7b('0x1b')]===_0xeb7b('0x1c')&&typeof _0x2ba627[_0xeb7b('0x1d')]==='undefined';var _0x2b4c93=_0x5e6673[_0xeb7b('0x1e')];var _0x345016=_0x580ed8?0x0:_0x2ba627[_0xeb7b('0x1b')];var _0x597998=_0x580ed8?_0x5e6673['count']:_0x2ba627[_0xeb7b('0x1b')]+_0x2ba627[_0xeb7b('0x1d')];var _0x3414b0;if(_0x597998>=_0x2b4c93){_0x597998=_0x2b4c93;_0x3414b0=0xc8;}else{_0x3414b0=0xce;}_0x39e1e7[_0xeb7b('0x19')](_0x3414b0);return _0x39e1e7[_0xeb7b('0x1f')](_0xeb7b('0x20'),_0x345016+'-'+_0x597998+'/'+_0x2b4c93)['json'](_0x5e6673);}return null;};}function patchUpdates(_0x1ffbed){return function(_0x38ac78){try{jsonpatch[_0xeb7b('0x21')](_0x38ac78,_0x1ffbed,!![]);}catch(_0x778583){return BPromise[_0xeb7b('0x22')](_0x778583);}return _0x38ac78[_0xeb7b('0x23')]();};}function saveUpdates(_0x2f2520,_0x37323c){return function(_0x42a54d){if(_0x42a54d){return _0x42a54d[_0xeb7b('0x24')](_0x2f2520)[_0xeb7b('0x25')](function(_0x17fb24){return _0x17fb24;});}return null;};}function removeEntity(_0x393aa3,_0x12c1b7){return function(_0x427a2c){if(_0x427a2c){return _0x427a2c[_0xeb7b('0x26')]()['then'](function(){_0x393aa3[_0xeb7b('0x19')](0xcc)[_0xeb7b('0x1a')]();});}};}function handleEntityNotFound(_0x8ee659,_0x4ad6f5){return function(_0x2b8123){if(!_0x2b8123){_0x8ee659[_0xeb7b('0x27')](0x194);}return _0x2b8123;};}function handleError(_0x1275ad,_0x416073){_0x416073=_0x416073||0x1f4;return function(_0xb8e6a6){logger[_0xeb7b('0x28')](_0xb8e6a6['stack']);if(_0xb8e6a6[_0xeb7b('0x29')]){delete _0xb8e6a6['name'];}_0x1275ad['status'](_0x416073)['send'](_0xb8e6a6);};}exports['index']=function(_0x159d69,_0x5a0179){var _0x58b9a3={},_0x35ac19={},_0x1785c2={'count':0x0,'rows':[]};var _0x155a9c=_[_0xeb7b('0x2a')](db['SugarcrmAccount'][_0xeb7b('0x2b')],function(_0xa78667){return{'name':_0xa78667[_0xeb7b('0x2c')],'type':_0xa78667[_0xeb7b('0x2d')][_0xeb7b('0x2e')]};});_0x35ac19['model']=_[_0xeb7b('0x2a')](_0x155a9c,_0xeb7b('0x29'));_0x35ac19[_0xeb7b('0x2f')]=_[_0xeb7b('0x30')](_0x159d69[_0xeb7b('0x2f')]);_0x35ac19[_0xeb7b('0x31')]=_[_0xeb7b('0x32')](_0x35ac19['model'],_0x35ac19[_0xeb7b('0x2f')]);_0x58b9a3[_0xeb7b('0x33')]=_[_0xeb7b('0x32')](_0x35ac19['model'],qs[_0xeb7b('0x34')](_0x159d69['query'][_0xeb7b('0x34')]));_0x58b9a3[_0xeb7b('0x33')]=_0x58b9a3['attributes']['length']?_0x58b9a3[_0xeb7b('0x33')]:_0x35ac19[_0xeb7b('0x35')];if(!_0x159d69['query']['hasOwnProperty']('nolimit')){_0x58b9a3[_0xeb7b('0x1d')]=qs[_0xeb7b('0x1d')](_0x159d69[_0xeb7b('0x2f')][_0xeb7b('0x1d')]);_0x58b9a3['offset']=qs[_0xeb7b('0x1b')](_0x159d69['query'][_0xeb7b('0x1b')]);}_0x58b9a3[_0xeb7b('0x36')]=qs[_0xeb7b('0x37')](_0x159d69[_0xeb7b('0x2f')][_0xeb7b('0x37')]);_0x58b9a3[_0xeb7b('0x38')]=qs['filters'](_[_0xeb7b('0x39')](_0x159d69['query'],_0x35ac19[_0xeb7b('0x31')]),_0x155a9c);if(_0x159d69[_0xeb7b('0x2f')][_0xeb7b('0x3a')]){_0x58b9a3[_0xeb7b('0x38')]=_['merge'](_0x58b9a3[_0xeb7b('0x38')],{'$or':_[_0xeb7b('0x2a')](_0x155a9c,function(_0x159e1a){if(_0x159e1a[_0xeb7b('0x2d')]!=='VIRTUAL'){var _0x40a94f={};_0x40a94f[_0x159e1a[_0xeb7b('0x29')]]={'$like':'%'+_0x159d69[_0xeb7b('0x2f')][_0xeb7b('0x3a')]+'%'};return _0x40a94f;}})});}_0x58b9a3=_[_0xeb7b('0x3b')]({},_0x58b9a3,_0x159d69[_0xeb7b('0x3c')]);var _0x35365f={'where':_0x58b9a3[_0xeb7b('0x38')]};return db[_0xeb7b('0x3d')][_0xeb7b('0x1e')](_0x35365f)[_0xeb7b('0x25')](function(_0x252a25){_0x1785c2['count']=_0x252a25;if(_0x159d69[_0xeb7b('0x2f')][_0xeb7b('0x3e')]){_0x58b9a3[_0xeb7b('0x3f')]=[{'all':!![]}];}return db['SugarcrmAccount']['findAll'](_0x58b9a3);})[_0xeb7b('0x25')](function(_0x10f1f1){_0x1785c2[_0xeb7b('0x40')]=_0x10f1f1;return _0x1785c2;})[_0xeb7b('0x25')](respondWithFilteredResult(_0x5a0179,_0x58b9a3))[_0xeb7b('0x41')](handleError(_0x5a0179,null));};exports[_0xeb7b('0x42')]=function(_0x90c1e3,_0x3b2660){var _0x143ac9={'raw':![],'where':{'id':_0x90c1e3[_0xeb7b('0x43')]['id']}},_0x486e01={};_0x486e01[_0xeb7b('0x35')]=_[_0xeb7b('0x30')](db[_0xeb7b('0x3d')][_0xeb7b('0x2b')]);_0x486e01['query']=_[_0xeb7b('0x30')](_0x90c1e3[_0xeb7b('0x2f')]);_0x486e01['filters']=_[_0xeb7b('0x32')](_0x486e01[_0xeb7b('0x35')],_0x486e01[_0xeb7b('0x2f')]);_0x143ac9['attributes']=_[_0xeb7b('0x32')](_0x486e01['model'],qs['fields'](_0x90c1e3['query'][_0xeb7b('0x34')]));_0x143ac9['attributes']=_0x143ac9[_0xeb7b('0x33')][_0xeb7b('0x44')]?_0x143ac9[_0xeb7b('0x33')]:_0x486e01[_0xeb7b('0x35')];if(_0x90c1e3[_0xeb7b('0x2f')][_0xeb7b('0x3e')]){_0x143ac9[_0xeb7b('0x3f')]=[{'all':!![]}];}_0x143ac9=_[_0xeb7b('0x3b')]({},_0x143ac9,_0x90c1e3[_0xeb7b('0x3c')]);return db['SugarcrmAccount']['find'](_0x143ac9)[_0xeb7b('0x25')](handleEntityNotFound(_0x3b2660,null))[_0xeb7b('0x25')](respondWithResult(_0x3b2660,null))['catch'](handleError(_0x3b2660,null));};exports[_0xeb7b('0x45')]=function(_0x5b2f59,_0x12fa34){return db['SugarcrmAccount'][_0xeb7b('0x45')](_0x5b2f59[_0xeb7b('0x46')],{})['then'](respondWithResult(_0x12fa34,0xc9))[_0xeb7b('0x41')](handleError(_0x12fa34,null));};exports[_0xeb7b('0x24')]=function(_0x41c83e,_0x5736ff){if(_0x41c83e[_0xeb7b('0x46')]['id']){delete _0x41c83e[_0xeb7b('0x46')]['id'];}return db[_0xeb7b('0x3d')][_0xeb7b('0x47')]({'where':{'id':_0x41c83e['params']['id']}})['then'](handleEntityNotFound(_0x5736ff,null))['then'](saveUpdates(_0x41c83e['body'],null))[_0xeb7b('0x25')](respondWithResult(_0x5736ff,null))[_0xeb7b('0x41')](handleError(_0x5736ff,null));};exports['destroy']=function(_0x59f7ca,_0x2320e3){return db[_0xeb7b('0x3d')]['find']({'where':{'id':_0x59f7ca[_0xeb7b('0x43')]['id']}})['then'](handleEntityNotFound(_0x2320e3,null))[_0xeb7b('0x25')](removeEntity(_0x2320e3,null))[_0xeb7b('0x41')](handleError(_0x2320e3,null));};exports[_0xeb7b('0x48')]=function(_0x2cd147,_0x58454b,_0x5ce29c){var _0x24f621={};var _0x243d44={};var _0x316436;var _0x5b4bac;return db['SugarcrmAccount'][_0xeb7b('0x49')]({'where':{'id':_0x2cd147['params']['id']}})['then'](handleEntityNotFound(_0x58454b,null))[_0xeb7b('0x25')](function(_0x1303f9){if(_0x1303f9){_0x316436=_0x1303f9;_0x243d44[_0xeb7b('0x35')]=_[_0xeb7b('0x30')](db[_0xeb7b('0x4a')][_0xeb7b('0x2b')]);_0x243d44[_0xeb7b('0x2f')]=_[_0xeb7b('0x30')](_0x2cd147[_0xeb7b('0x2f')]);_0x243d44[_0xeb7b('0x31')]=_[_0xeb7b('0x32')](_0x243d44['model'],_0x243d44[_0xeb7b('0x2f')]);_0x24f621[_0xeb7b('0x33')]=_[_0xeb7b('0x32')](_0x243d44[_0xeb7b('0x35')],qs[_0xeb7b('0x34')](_0x2cd147[_0xeb7b('0x2f')][_0xeb7b('0x34')]));_0x24f621[_0xeb7b('0x33')]=_0x24f621[_0xeb7b('0x33')][_0xeb7b('0x44')]?_0x24f621[_0xeb7b('0x33')]:_0x243d44[_0xeb7b('0x35')];_0x24f621[_0xeb7b('0x36')]=qs[_0xeb7b('0x37')](_0x2cd147[_0xeb7b('0x2f')][_0xeb7b('0x37')]);_0x24f621[_0xeb7b('0x38')]=qs[_0xeb7b('0x31')](_[_0xeb7b('0x39')](_0x2cd147[_0xeb7b('0x2f')],_0x243d44[_0xeb7b('0x31')]));if(_0x2cd147['query'][_0xeb7b('0x3a')]){_0x24f621['where']=_['merge'](_0x24f621[_0xeb7b('0x38')],{'$or':_[_0xeb7b('0x2a')](_0x24f621[_0xeb7b('0x33')],function(_0xf2dfbe){var _0x2db3f4={};_0x2db3f4[_0xf2dfbe]={'$like':'%'+_0x2cd147['query'][_0xeb7b('0x3a')]+'%'};return _0x2db3f4;})});}_0x24f621=_[_0xeb7b('0x3b')]({},_0x24f621,_0x2cd147[_0xeb7b('0x3c')]);return _0x316436['getConfigurations'](_0x24f621);}})['then'](function(_0x1a3eea){if(_0x1a3eea){_0x5b4bac=_0x1a3eea['length'];if(!_0x2cd147['query'][_0xeb7b('0x4b')](_0xeb7b('0x4c'))){_0x24f621[_0xeb7b('0x1d')]=qs[_0xeb7b('0x1d')](_0x2cd147[_0xeb7b('0x2f')]['limit']);_0x24f621[_0xeb7b('0x1b')]=qs[_0xeb7b('0x1b')](_0x2cd147['query'][_0xeb7b('0x1b')]);}return _0x316436['getConfigurations'](_0x24f621);}})['then'](function(_0x5e211e){if(_0x5e211e){return _0x5e211e?{'count':_0x5b4bac,'rows':_0x5e211e}:null;}})[_0xeb7b('0x25')](respondWithResult(_0x58454b,null))[_0xeb7b('0x41')](handleError(_0x58454b,null));};exports[_0xeb7b('0x4d')]=function(_0x13747f,_0x407f97,_0x5b5a0){if(_0x13747f['body']['id']){delete _0x13747f['body']['id'];}return db[_0xeb7b('0x3d')]['findOne']({'where':{'id':_0x13747f[_0xeb7b('0x43')]['id']}})['then'](handleEntityNotFound(_0x407f97,null))[_0xeb7b('0x25')](function(_0x570bc9){if(_0x570bc9){_0x13747f[_0xeb7b('0x46')][_0xeb7b('0x4e')]=_0x570bc9['id'];_0x13747f[_0xeb7b('0x46')][_0xeb7b('0x4f')]=integrations[_0xeb7b('0x50')](_0x13747f[_0xeb7b('0x46')]['channel'],_0x13747f[_0xeb7b('0x46')]['type']);_0x13747f[_0xeb7b('0x46')][_0xeb7b('0x51')]=integrations['getDescriptions'](_0x13747f[_0xeb7b('0x46')][_0xeb7b('0x52')],_0x13747f[_0xeb7b('0x46')][_0xeb7b('0x2d')]);return db[_0xeb7b('0x4a')]['create'](_0x13747f[_0xeb7b('0x46')],{'include':[{'model':db['SugarcrmField'],'as':'Subjects'},{'model':db[_0xeb7b('0x53')],'as':_0xeb7b('0x51')}]});}return null;})[_0xeb7b('0x25')](respondWithResult(_0x407f97,null))[_0xeb7b('0x41')](handleError(_0x407f97,null));};exports[_0xeb7b('0x54')]=function(_0x2f3bb4,_0xea4b73,_0x34beba){var _0xa543f6='';var _0x847693=['id',_0xeb7b('0x29'),_0xeb7b('0x55'),_0xeb7b('0x56'),_0xeb7b('0x57'),_0xeb7b('0x58'),'duration_hours','duration_minutes',_0xeb7b('0x59'),'parent_type',_0xeb7b('0x5a'),'direction'];return db[_0xeb7b('0x3d')]['findOne']({'where':{'id':_0x2f3bb4[_0xeb7b('0x43')]['id']},'attributes':['id',_0xeb7b('0x5b'),_0xeb7b('0x5c'),_0xeb7b('0x5d')]})[_0xeb7b('0x25')](handleEntityNotFound(_0xea4b73,null))[_0xeb7b('0x25')](function(_0x1c30e8){if(_0x1c30e8){_0xa543f6=_0x1c30e8['remoteUri'];var _0x1481d8=_0xa543f6[_0xeb7b('0x5e')](-0x1);if(_0x1481d8==='/'){_0xa543f6=_0xa543f6[_0xeb7b('0x5f')](0x0,_0xa543f6['lastIndexOf'](_0x1481d8));}return rp({'method':_0xeb7b('0x60'),'uri':util[_0xeb7b('0x61')](_0xeb7b('0x62'),_0xa543f6,_0xeb7b('0x63')),'json':!![],'form':{'method':_0xeb7b('0x64'),'input_type':_0xeb7b('0x65'),'response_type':_0xeb7b('0x65'),'rest_data':JSON['stringify']({'user_auth':{'user_name':_0x1c30e8[_0xeb7b('0x5b')],'password':_0x1c30e8[_0xeb7b('0x5c')],'encryption':_0xeb7b('0x66')},'application':_0xeb7b('0x67')})}});}})[_0xeb7b('0x25')](function(_0x2443b3){if(_0x2443b3&&_0x2443b3['name']!==_0xeb7b('0x68')&&_0x2443b3[_0xeb7b('0x29')]!==_0xeb7b('0x69')){return rp({'method':_0xeb7b('0x60'),'uri':util[_0xeb7b('0x61')](_0xeb7b('0x62'),_0xa543f6,_0xeb7b('0x63')),'json':!![],'form':{'method':_0xeb7b('0x6a'),'input_type':_0xeb7b('0x65'),'response_type':_0xeb7b('0x65'),'rest_data':JSON[_0xeb7b('0x6b')]({'session':_0x2443b3['id'],'module_name':_0xeb7b('0x6c')})}})['then'](function(_0x23ce02){if(_0x23ce02){var _0x3763df=_[_0xeb7b('0x6d')](_0x23ce02['module_fields']);_[_0xeb7b('0x6e')](_0x3763df,function(_0x267f0a){return _0x847693[_0xeb7b('0x6f')](_0x267f0a[_0xeb7b('0x29')]);});return{'count':_0x3763df[_0xeb7b('0x44')],'rows':_['map'](_0x3763df,function(_0x1df448){return{'id':_0x1df448['name'],'name':_0x1df448[_0xeb7b('0x70')],'custom':_['endsWith'](_0x1df448[_0xeb7b('0x29')],'_c')?!![]:![],'options':_0x1df448[_0xeb7b('0x3c')]?_['map'](_[_0xeb7b('0x6d')](_0x1df448[_0xeb7b('0x3c')]),function(_0x251900){return{'name':_0x251900[_0xeb7b('0x71')],'value':_0x251900['name']};}):[]};})};}})[_0xeb7b('0x25')](respondWithResult(_0xea4b73,null))[_0xeb7b('0x41')](function(_0x556c7e){var _0x587ea9=_0x2f3bb4[_0xeb7b('0x2f')][_0xeb7b('0x72')]?0x1f4:_0x556c7e[_0xeb7b('0x73')]||0x1f4;logger[_0xeb7b('0x28')](_0xeb7b('0x74'),_0xeb7b('0x54'),_0x587ea9,JSON[_0xeb7b('0x6b')](_0x556c7e));delete _0x556c7e[_0xeb7b('0x29')];if(_0x587ea9===0x191){_0x587ea9=0x190;}_0xea4b73[_0xeb7b('0x19')](_0x587ea9)[_0xeb7b('0x75')](_0x2f3bb4['query'][_0xeb7b('0x72')]?{'message':_0xeb7b('0x76'),'statusCode':_0x556c7e['statusCode']}:_0x556c7e);});}else{var _0x31eb06=0x1f4;_0xea4b73['status'](_0x31eb06)[_0xeb7b('0x75')]({'message':'Wrong\x20credentials','statusCode':0x190});}});}; \ No newline at end of file +var _0xfa33=['zip-dir','fast-json-patch','request-promise','util','path','sox','ejs','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../components/integrations/configuration','status','end','json','offset','limit','undefined','count','Content-Range','apply','save','update','then','sendStatus','error','name','index','map','SugarcrmAccount','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filter','merge','includeAll','include','findAll','rows','catch','show','params','options','find','create','body','destroy','getConfigurations','findOne','nolimit','AccountId','getSubjects','channel','SugarcrmConfiguration','SugarcrmField','Subjects','Descriptions','assigned_user_id','description','date_start','duration_hours','duration_minutes','parent_type','direction','username','remoteUri','slice','%s%s','login','JSON','password','xCALLY\x20Motion\x20Integration','Invalid\x20Login','Password\x20Expired','POST','/service/v4_1/rest.php','get_module_fields','stringify','Calls','module_fields','includes','label','endsWith','values','value','send','test','statusCode','Wrong\x20credentials','eml-format','rimraf'];(function(_0x194d1c,_0x496df0){var _0x5c399b=function(_0x58c738){while(--_0x58c738){_0x194d1c['push'](_0x194d1c['shift']());}};_0x5c399b(++_0x496df0);}(_0xfa33,0x73));var _0x3fa3=function(_0xd580e2,_0x109182){_0xd580e2=_0xd580e2-0x0;var _0x4d955f=_0xfa33[_0xd580e2];return _0x4d955f;};'use strict';var emlformat=require(_0x3fa3('0x0'));var rimraf=require(_0x3fa3('0x1'));var zipdir=require(_0x3fa3('0x2'));var jsonpatch=require(_0x3fa3('0x3'));var rp=require(_0x3fa3('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x3fa3('0x5'));var path=require(_0x3fa3('0x6'));var sox=require(_0x3fa3('0x7'));var csv=require('to-csv');var ejs=require(_0x3fa3('0x8'));var fs=require('fs');var fs_extra=require(_0x3fa3('0x9'));var _=require(_0x3fa3('0xa'));var squel=require('squel');var crypto=require(_0x3fa3('0xb'));var jsforce=require(_0x3fa3('0xc'));var deskjs=require(_0x3fa3('0xd'));var toCsv=require(_0x3fa3('0xe'));var querystring=require(_0x3fa3('0xf'));var Papa=require('papaparse');var Redis=require(_0x3fa3('0x10'));var authService=require(_0x3fa3('0x11'));var qs=require(_0x3fa3('0x12'));var as=require(_0x3fa3('0x13'));var hardwareService=require(_0x3fa3('0x14'));var logger=require(_0x3fa3('0x15'))(_0x3fa3('0x16'));var utils=require(_0x3fa3('0x17'));var config=require(_0x3fa3('0x18'));var licenseUtil=require(_0x3fa3('0x19'));var db=require('../../mysqldb')['db'];var integrations=require(_0x3fa3('0x1a'));function respondWithStatusCode(_0x3f4b15,_0x285924){_0x285924=_0x285924||0xcc;return function(_0xa1dff1){if(_0xa1dff1){return _0x3f4b15['sendStatus'](_0x285924);}return _0x3f4b15[_0x3fa3('0x1b')](_0x285924)[_0x3fa3('0x1c')]();};}function respondWithResult(_0x19e11b,_0x2f4168){_0x2f4168=_0x2f4168||0xc8;return function(_0x3f7406){if(_0x3f7406){return _0x19e11b[_0x3fa3('0x1b')](_0x2f4168)[_0x3fa3('0x1d')](_0x3f7406);}};}function respondWithFilteredResult(_0x92a356,_0x41338b){return function(_0x3ef9fb){if(_0x3ef9fb){var _0x1e98fd=typeof _0x41338b[_0x3fa3('0x1e')]==='undefined'&&typeof _0x41338b[_0x3fa3('0x1f')]===_0x3fa3('0x20');var _0x173349=_0x3ef9fb['count'];var _0x401bfe=_0x1e98fd?0x0:_0x41338b['offset'];var _0x5def39=_0x1e98fd?_0x3ef9fb[_0x3fa3('0x21')]:_0x41338b['offset']+_0x41338b[_0x3fa3('0x1f')];var _0x3a7942;if(_0x5def39>=_0x173349){_0x5def39=_0x173349;_0x3a7942=0xc8;}else{_0x3a7942=0xce;}_0x92a356[_0x3fa3('0x1b')](_0x3a7942);return _0x92a356['set'](_0x3fa3('0x22'),_0x401bfe+'-'+_0x5def39+'/'+_0x173349)['json'](_0x3ef9fb);}return null;};}function patchUpdates(_0x22b4b0){return function(_0x5d348a){try{jsonpatch[_0x3fa3('0x23')](_0x5d348a,_0x22b4b0,!![]);}catch(_0x484701){return BPromise['reject'](_0x484701);}return _0x5d348a[_0x3fa3('0x24')]();};}function saveUpdates(_0x28169c,_0x4e111f){return function(_0x11412f){if(_0x11412f){return _0x11412f[_0x3fa3('0x25')](_0x28169c)[_0x3fa3('0x26')](function(_0x5b6b10){return _0x5b6b10;});}return null;};}function removeEntity(_0xcf63e0,_0x3b87c7){return function(_0xd95e4f){if(_0xd95e4f){return _0xd95e4f['destroy']()['then'](function(){_0xcf63e0[_0x3fa3('0x1b')](0xcc)[_0x3fa3('0x1c')]();});}};}function handleEntityNotFound(_0x22f8c0,_0x582f6b){return function(_0x3c695d){if(!_0x3c695d){_0x22f8c0[_0x3fa3('0x27')](0x194);}return _0x3c695d;};}function handleError(_0x4e6566,_0x14299b){_0x14299b=_0x14299b||0x1f4;return function(_0x5f4a97){logger[_0x3fa3('0x28')](_0x5f4a97['stack']);if(_0x5f4a97[_0x3fa3('0x29')]){delete _0x5f4a97[_0x3fa3('0x29')];}_0x4e6566[_0x3fa3('0x1b')](_0x14299b)['send'](_0x5f4a97);};}exports[_0x3fa3('0x2a')]=function(_0x37bde0,_0x10315f){var _0x3639fc={},_0x3cd916={},_0x5d7434={'count':0x0,'rows':[]};var _0x406f5a=_[_0x3fa3('0x2b')](db[_0x3fa3('0x2c')][_0x3fa3('0x2d')],function(_0x1d9b3b){return{'name':_0x1d9b3b[_0x3fa3('0x2e')],'type':_0x1d9b3b[_0x3fa3('0x2f')][_0x3fa3('0x30')]};});_0x3cd916[_0x3fa3('0x31')]=_[_0x3fa3('0x2b')](_0x406f5a,_0x3fa3('0x29'));_0x3cd916[_0x3fa3('0x32')]=_[_0x3fa3('0x33')](_0x37bde0['query']);_0x3cd916[_0x3fa3('0x34')]=_[_0x3fa3('0x35')](_0x3cd916[_0x3fa3('0x31')],_0x3cd916[_0x3fa3('0x32')]);_0x3639fc[_0x3fa3('0x36')]=_['intersection'](_0x3cd916[_0x3fa3('0x31')],qs['fields'](_0x37bde0[_0x3fa3('0x32')][_0x3fa3('0x37')]));_0x3639fc[_0x3fa3('0x36')]=_0x3639fc[_0x3fa3('0x36')][_0x3fa3('0x38')]?_0x3639fc['attributes']:_0x3cd916[_0x3fa3('0x31')];if(!_0x37bde0[_0x3fa3('0x32')][_0x3fa3('0x39')]('nolimit')){_0x3639fc[_0x3fa3('0x1f')]=qs[_0x3fa3('0x1f')](_0x37bde0[_0x3fa3('0x32')][_0x3fa3('0x1f')]);_0x3639fc['offset']=qs[_0x3fa3('0x1e')](_0x37bde0[_0x3fa3('0x32')][_0x3fa3('0x1e')]);}_0x3639fc[_0x3fa3('0x3a')]=qs[_0x3fa3('0x3b')](_0x37bde0['query'][_0x3fa3('0x3b')]);_0x3639fc[_0x3fa3('0x3c')]=qs['filters'](_['pick'](_0x37bde0[_0x3fa3('0x32')],_0x3cd916['filters']),_0x406f5a);if(_0x37bde0['query'][_0x3fa3('0x3d')]){_0x3639fc['where']=_[_0x3fa3('0x3e')](_0x3639fc[_0x3fa3('0x3c')],{'$or':_['map'](_0x406f5a,function(_0x3e33ba){if(_0x3e33ba['type']!=='VIRTUAL'){var _0x3aaf66={};_0x3aaf66[_0x3e33ba[_0x3fa3('0x29')]]={'$like':'%'+_0x37bde0[_0x3fa3('0x32')][_0x3fa3('0x3d')]+'%'};return _0x3aaf66;}})});}_0x3639fc=_['merge']({},_0x3639fc,_0x37bde0['options']);var _0x1181a9={'where':_0x3639fc[_0x3fa3('0x3c')]};return db[_0x3fa3('0x2c')][_0x3fa3('0x21')](_0x1181a9)[_0x3fa3('0x26')](function(_0x331157){_0x5d7434[_0x3fa3('0x21')]=_0x331157;if(_0x37bde0[_0x3fa3('0x32')][_0x3fa3('0x3f')]){_0x3639fc[_0x3fa3('0x40')]=[{'all':!![]}];}return db[_0x3fa3('0x2c')][_0x3fa3('0x41')](_0x3639fc);})[_0x3fa3('0x26')](function(_0x10f4e7){_0x5d7434[_0x3fa3('0x42')]=_0x10f4e7;return _0x5d7434;})['then'](respondWithFilteredResult(_0x10315f,_0x3639fc))[_0x3fa3('0x43')](handleError(_0x10315f,null));};exports[_0x3fa3('0x44')]=function(_0xe1a89d,_0x5b9b48){var _0x36b037={'raw':![],'where':{'id':_0xe1a89d[_0x3fa3('0x45')]['id']}},_0x425f9a={};_0x425f9a[_0x3fa3('0x31')]=_[_0x3fa3('0x33')](db[_0x3fa3('0x2c')][_0x3fa3('0x2d')]);_0x425f9a['query']=_[_0x3fa3('0x33')](_0xe1a89d[_0x3fa3('0x32')]);_0x425f9a[_0x3fa3('0x34')]=_[_0x3fa3('0x35')](_0x425f9a[_0x3fa3('0x31')],_0x425f9a[_0x3fa3('0x32')]);_0x36b037[_0x3fa3('0x36')]=_['intersection'](_0x425f9a[_0x3fa3('0x31')],qs[_0x3fa3('0x37')](_0xe1a89d[_0x3fa3('0x32')][_0x3fa3('0x37')]));_0x36b037['attributes']=_0x36b037[_0x3fa3('0x36')]['length']?_0x36b037[_0x3fa3('0x36')]:_0x425f9a[_0x3fa3('0x31')];if(_0xe1a89d[_0x3fa3('0x32')][_0x3fa3('0x3f')]){_0x36b037[_0x3fa3('0x40')]=[{'all':!![]}];}_0x36b037=_[_0x3fa3('0x3e')]({},_0x36b037,_0xe1a89d[_0x3fa3('0x46')]);return db['SugarcrmAccount'][_0x3fa3('0x47')](_0x36b037)[_0x3fa3('0x26')](handleEntityNotFound(_0x5b9b48,null))[_0x3fa3('0x26')](respondWithResult(_0x5b9b48,null))['catch'](handleError(_0x5b9b48,null));};exports[_0x3fa3('0x48')]=function(_0x43ed9a,_0x1094e7){return db[_0x3fa3('0x2c')][_0x3fa3('0x48')](_0x43ed9a[_0x3fa3('0x49')],{})['then'](respondWithResult(_0x1094e7,0xc9))[_0x3fa3('0x43')](handleError(_0x1094e7,null));};exports[_0x3fa3('0x25')]=function(_0x17b2d4,_0x51421c){if(_0x17b2d4[_0x3fa3('0x49')]['id']){delete _0x17b2d4[_0x3fa3('0x49')]['id'];}return db[_0x3fa3('0x2c')][_0x3fa3('0x47')]({'where':{'id':_0x17b2d4[_0x3fa3('0x45')]['id']}})['then'](handleEntityNotFound(_0x51421c,null))['then'](saveUpdates(_0x17b2d4[_0x3fa3('0x49')],null))[_0x3fa3('0x26')](respondWithResult(_0x51421c,null))[_0x3fa3('0x43')](handleError(_0x51421c,null));};exports[_0x3fa3('0x4a')]=function(_0x1e972a,_0x22a70c){return db[_0x3fa3('0x2c')]['find']({'where':{'id':_0x1e972a[_0x3fa3('0x45')]['id']}})[_0x3fa3('0x26')](handleEntityNotFound(_0x22a70c,null))['then'](removeEntity(_0x22a70c,null))['catch'](handleError(_0x22a70c,null));};exports[_0x3fa3('0x4b')]=function(_0x3c5b4c,_0x5c5c80,_0x12a59e){var _0x2f1102={};var _0x4314dc={};var _0x543308;var _0x11b7ff;return db[_0x3fa3('0x2c')][_0x3fa3('0x4c')]({'where':{'id':_0x3c5b4c[_0x3fa3('0x45')]['id']}})[_0x3fa3('0x26')](handleEntityNotFound(_0x5c5c80,null))['then'](function(_0x4c3c0c){if(_0x4c3c0c){_0x543308=_0x4c3c0c;_0x4314dc[_0x3fa3('0x31')]=_[_0x3fa3('0x33')](db['SugarcrmConfiguration'][_0x3fa3('0x2d')]);_0x4314dc[_0x3fa3('0x32')]=_[_0x3fa3('0x33')](_0x3c5b4c[_0x3fa3('0x32')]);_0x4314dc[_0x3fa3('0x34')]=_[_0x3fa3('0x35')](_0x4314dc[_0x3fa3('0x31')],_0x4314dc[_0x3fa3('0x32')]);_0x2f1102[_0x3fa3('0x36')]=_[_0x3fa3('0x35')](_0x4314dc[_0x3fa3('0x31')],qs[_0x3fa3('0x37')](_0x3c5b4c[_0x3fa3('0x32')]['fields']));_0x2f1102['attributes']=_0x2f1102[_0x3fa3('0x36')][_0x3fa3('0x38')]?_0x2f1102[_0x3fa3('0x36')]:_0x4314dc['model'];_0x2f1102['order']=qs[_0x3fa3('0x3b')](_0x3c5b4c[_0x3fa3('0x32')][_0x3fa3('0x3b')]);_0x2f1102['where']=qs[_0x3fa3('0x34')](_['pick'](_0x3c5b4c[_0x3fa3('0x32')],_0x4314dc['filters']));if(_0x3c5b4c['query'][_0x3fa3('0x3d')]){_0x2f1102[_0x3fa3('0x3c')]=_['merge'](_0x2f1102[_0x3fa3('0x3c')],{'$or':_['map'](_0x2f1102[_0x3fa3('0x36')],function(_0x5f4e84){var _0x1b5129={};_0x1b5129[_0x5f4e84]={'$like':'%'+_0x3c5b4c[_0x3fa3('0x32')]['filter']+'%'};return _0x1b5129;})});}_0x2f1102=_[_0x3fa3('0x3e')]({},_0x2f1102,_0x3c5b4c['options']);return _0x543308[_0x3fa3('0x4b')](_0x2f1102);}})[_0x3fa3('0x26')](function(_0x295f65){if(_0x295f65){_0x11b7ff=_0x295f65[_0x3fa3('0x38')];if(!_0x3c5b4c[_0x3fa3('0x32')]['hasOwnProperty'](_0x3fa3('0x4d'))){_0x2f1102[_0x3fa3('0x1f')]=qs['limit'](_0x3c5b4c[_0x3fa3('0x32')][_0x3fa3('0x1f')]);_0x2f1102['offset']=qs[_0x3fa3('0x1e')](_0x3c5b4c[_0x3fa3('0x32')][_0x3fa3('0x1e')]);}return _0x543308[_0x3fa3('0x4b')](_0x2f1102);}})[_0x3fa3('0x26')](function(_0x4a7a43){if(_0x4a7a43){return _0x4a7a43?{'count':_0x11b7ff,'rows':_0x4a7a43}:null;}})[_0x3fa3('0x26')](respondWithResult(_0x5c5c80,null))[_0x3fa3('0x43')](handleError(_0x5c5c80,null));};exports['addConfiguration']=function(_0x130316,_0x4dbeee,_0x4726c1){if(_0x130316[_0x3fa3('0x49')]['id']){delete _0x130316[_0x3fa3('0x49')]['id'];}return db[_0x3fa3('0x2c')][_0x3fa3('0x4c')]({'where':{'id':_0x130316['params']['id']}})[_0x3fa3('0x26')](handleEntityNotFound(_0x4dbeee,null))[_0x3fa3('0x26')](function(_0x1bf798){if(_0x1bf798){_0x130316['body'][_0x3fa3('0x4e')]=_0x1bf798['id'];_0x130316[_0x3fa3('0x49')]['Subjects']=integrations[_0x3fa3('0x4f')](_0x130316[_0x3fa3('0x49')]['channel'],_0x130316[_0x3fa3('0x49')]['type']);_0x130316[_0x3fa3('0x49')]['Descriptions']=integrations['getDescriptions'](_0x130316[_0x3fa3('0x49')][_0x3fa3('0x50')],_0x130316['body'][_0x3fa3('0x2f')]);return db[_0x3fa3('0x51')]['create'](_0x130316['body'],{'include':[{'model':db[_0x3fa3('0x52')],'as':_0x3fa3('0x53')},{'model':db[_0x3fa3('0x52')],'as':_0x3fa3('0x54')}]});}return null;})[_0x3fa3('0x26')](respondWithResult(_0x4dbeee,null))[_0x3fa3('0x43')](handleError(_0x4dbeee,null));};exports['getFields']=function(_0x321b5c,_0x133719,_0x10e085){var _0x2286f8='';var _0xbde5c8=['id',_0x3fa3('0x29'),_0x3fa3('0x55'),'created_by',_0x3fa3('0x56'),_0x3fa3('0x57'),_0x3fa3('0x58'),_0x3fa3('0x59'),'parent_id',_0x3fa3('0x5a'),'parent_name',_0x3fa3('0x5b')];return db[_0x3fa3('0x2c')][_0x3fa3('0x4c')]({'where':{'id':_0x321b5c[_0x3fa3('0x45')]['id']},'attributes':['id',_0x3fa3('0x5c'),'password',_0x3fa3('0x5d')]})['then'](handleEntityNotFound(_0x133719,null))[_0x3fa3('0x26')](function(_0x5848b7){if(_0x5848b7){_0x2286f8=_0x5848b7['remoteUri'];var _0x49cc40=_0x2286f8[_0x3fa3('0x5e')](-0x1);if(_0x49cc40==='/'){_0x2286f8=_0x2286f8['substring'](0x0,_0x2286f8['lastIndexOf'](_0x49cc40));}return rp({'method':'POST','uri':util['format'](_0x3fa3('0x5f'),_0x2286f8,'/service/v4_1/rest.php'),'json':!![],'form':{'method':_0x3fa3('0x60'),'input_type':_0x3fa3('0x61'),'response_type':_0x3fa3('0x61'),'rest_data':JSON['stringify']({'user_auth':{'user_name':_0x5848b7[_0x3fa3('0x5c')],'password':_0x5848b7[_0x3fa3('0x62')],'encryption':'PLAIN'},'application':_0x3fa3('0x63')})}});}})['then'](function(_0x8c32d5){if(_0x8c32d5&&_0x8c32d5['name']!==_0x3fa3('0x64')&&_0x8c32d5[_0x3fa3('0x29')]!==_0x3fa3('0x65')){return rp({'method':_0x3fa3('0x66'),'uri':util['format'](_0x3fa3('0x5f'),_0x2286f8,_0x3fa3('0x67')),'json':!![],'form':{'method':_0x3fa3('0x68'),'input_type':_0x3fa3('0x61'),'response_type':'JSON','rest_data':JSON[_0x3fa3('0x69')]({'session':_0x8c32d5['id'],'module_name':_0x3fa3('0x6a')})}})['then'](function(_0x401cdb){if(_0x401cdb){var _0x4846d2=_['values'](_0x401cdb[_0x3fa3('0x6b')]);_['remove'](_0x4846d2,function(_0x5ec2fd){return _0xbde5c8[_0x3fa3('0x6c')](_0x5ec2fd[_0x3fa3('0x29')]);});return{'count':_0x4846d2['length'],'rows':_['map'](_0x4846d2,function(_0x73d283){return{'id':_0x73d283[_0x3fa3('0x29')],'name':_0x73d283[_0x3fa3('0x6d')],'custom':_[_0x3fa3('0x6e')](_0x73d283[_0x3fa3('0x29')],'_c')?!![]:![],'options':_0x73d283[_0x3fa3('0x46')]?_[_0x3fa3('0x2b')](_[_0x3fa3('0x6f')](_0x73d283[_0x3fa3('0x46')]),function(_0x1db344){return{'name':_0x1db344[_0x3fa3('0x70')],'value':_0x1db344['name']};}):[]};})};}})[_0x3fa3('0x26')](respondWithResult(_0x133719,null))[_0x3fa3('0x43')](function(_0x248d08){var _0x486d9f=_0x321b5c[_0x3fa3('0x32')]['test']?0x1f4:_0x248d08['statusCode']||0x1f4;logger[_0x3fa3('0x28')]('getFields,\x20%s,\x20%s,\x20%s','getFields',_0x486d9f,JSON['stringify'](_0x248d08));delete _0x248d08[_0x3fa3('0x29')];if(_0x486d9f===0x191){_0x486d9f=0x190;}_0x133719['status'](_0x486d9f)[_0x3fa3('0x71')](_0x321b5c['query'][_0x3fa3('0x72')]?{'message':'Wrong\x20credentials','statusCode':_0x248d08[_0x3fa3('0x73')]}:_0x248d08);});}else{var _0xe0f084=0x1f4;_0x133719[_0x3fa3('0x1b')](_0xe0f084)[_0x3fa3('0x71')]({'message':_0x3fa3('0x74'),'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 a1843bb..4718c59 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 _0x33cd=['./intSugarcrmAccount.attributes','../../components/integrations/configuration','exports','define','SugarcrmAccount','int_sugarcrm_accounts','lodash','util','../../config/logger','api','moment','bluebird','rimraf','../../config/environment'];(function(_0x2d34d6,_0x397ff9){var _0x1d3d12=function(_0x558800){while(--_0x558800){_0x2d34d6['push'](_0x2d34d6['shift']());}};_0x1d3d12(++_0x397ff9);}(_0x33cd,0x180));var _0xd33c=function(_0x46f2c8,_0x95ae32){_0x46f2c8=_0x46f2c8-0x0;var _0x4e5be4=_0x33cd[_0x46f2c8];return _0x4e5be4;};'use strict';var _=require(_0xd33c('0x0'));var util=require(_0xd33c('0x1'));var logger=require(_0xd33c('0x2'))(_0xd33c('0x3'));var moment=require(_0xd33c('0x4'));var BPromise=require(_0xd33c('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xd33c('0x6'));var config=require(_0xd33c('0x7'));var attributes=require(_0xd33c('0x8'));var integrations=require(_0xd33c('0x9'));module[_0xd33c('0xa')]=function(_0x273ad3,_0xb90a48){return _0x273ad3[_0xd33c('0xb')](_0xd33c('0xc'),attributes,{'tableName':_0xd33c('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x347a=['define','SugarcrmAccount','int_sugarcrm_accounts','lodash','util','api','bluebird','request-promise','path','rimraf','../../config/environment','./intSugarcrmAccount.attributes','../../components/integrations/configuration','exports'];(function(_0x559bbd,_0x55c0db){var _0x4f46fc=function(_0x557e9e){while(--_0x557e9e){_0x559bbd['push'](_0x559bbd['shift']());}};_0x4f46fc(++_0x55c0db);}(_0x347a,0x153));var _0xa347=function(_0x56e063,_0x453233){_0x56e063=_0x56e063-0x0;var _0x766fcf=_0x347a[_0x56e063];return _0x766fcf;};'use strict';var _=require(_0xa347('0x0'));var util=require(_0xa347('0x1'));var logger=require('../../config/logger')(_0xa347('0x2'));var moment=require('moment');var BPromise=require(_0xa347('0x3'));var rp=require(_0xa347('0x4'));var fs=require('fs');var path=require(_0xa347('0x5'));var rimraf=require(_0xa347('0x6'));var config=require(_0xa347('0x7'));var attributes=require(_0xa347('0x8'));var integrations=require(_0xa347('0x9'));module[_0xa347('0xa')]=function(_0x19ac84,_0x3191f2){return _0x19ac84[_0xa347('0xb')](_0xa347('0xc'),attributes,{'tableName':_0xa347('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 3e576ad..29894ce 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 _0xf196=['findAll','options','raw','where','attributes','limit','include','model','map','then','ShowSugarcrmAccount','find','lodash','util','moment','randomstring','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','http','request','info','SugarcrmAccount,\x20%s,\x20%s','debug','SugarcrmAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','GetSugarcrmAccount','SugarcrmAccount'];(function(_0x3cf417,_0x36fd16){var _0x24dca4=function(_0x1d721c){while(--_0x1d721c){_0x3cf417['push'](_0x3cf417['shift']());}};_0x24dca4(++_0x36fd16);}(_0xf196,0xbb));var _0x6f19=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0xf196[_0x40a045];return _0x1a687c;};'use strict';var _=require(_0x6f19('0x0'));var util=require(_0x6f19('0x1'));var moment=require(_0x6f19('0x2'));var BPromise=require('bluebird');var rs=require(_0x6f19('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6f19('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x6f19('0x5'))('rpc');var config=require(_0x6f19('0x6'));var jayson=require(_0x6f19('0x7'));var client=jayson['client'][_0x6f19('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x42f86a,_0x5b34fe,_0x3bce91){return new BPromise(function(_0x54fb67,_0x3a0173){return client[_0x6f19('0x9')](_0x42f86a,_0x3bce91)['then'](function(_0x590c4c){logger[_0x6f19('0xa')](_0x6f19('0xb'),_0x5b34fe,'request\x20sent');logger[_0x6f19('0xc')](_0x6f19('0xd'),_0x5b34fe,_0x6f19('0xe'),JSON[_0x6f19('0xf')](_0x590c4c));if(_0x590c4c['error']){if(_0x590c4c[_0x6f19('0x10')][_0x6f19('0x11')]===0x1f4){logger[_0x6f19('0x10')](_0x6f19('0xb'),_0x5b34fe,_0x590c4c[_0x6f19('0x10')][_0x6f19('0x12')]);return _0x3a0173(_0x590c4c['error'][_0x6f19('0x12')]);}logger[_0x6f19('0x10')](_0x6f19('0xb'),_0x5b34fe,_0x590c4c[_0x6f19('0x10')][_0x6f19('0x12')]);return _0x54fb67(_0x590c4c[_0x6f19('0x10')][_0x6f19('0x12')]);}else{logger[_0x6f19('0xa')](_0x6f19('0xb'),_0x5b34fe,_0x6f19('0xe'));_0x54fb67(_0x590c4c[_0x6f19('0x13')][_0x6f19('0x12')]);}})[_0x6f19('0x14')](function(_0x155056){logger[_0x6f19('0x10')](_0x6f19('0xb'),_0x5b34fe,_0x155056);_0x3a0173(_0x155056);});});}exports[_0x6f19('0x15')]=function(_0x4ade6b){var _0x6c3e8b=this;return new Promise(function(_0x54f0cb,_0x3ce3f7){return db[_0x6f19('0x16')][_0x6f19('0x17')]({'raw':_0x4ade6b[_0x6f19('0x18')]?_0x4ade6b[_0x6f19('0x18')][_0x6f19('0x19')]===undefined?!![]:![]:!![],'where':_0x4ade6b[_0x6f19('0x18')]?_0x4ade6b[_0x6f19('0x18')][_0x6f19('0x1a')]||null:null,'attributes':_0x4ade6b[_0x6f19('0x18')]?_0x4ade6b[_0x6f19('0x18')][_0x6f19('0x1b')]||null:null,'limit':_0x4ade6b[_0x6f19('0x18')]?_0x4ade6b[_0x6f19('0x18')][_0x6f19('0x1c')]||null:null,'include':_0x4ade6b[_0x6f19('0x18')]?_0x4ade6b[_0x6f19('0x18')]['include']?_['map'](_0x4ade6b[_0x6f19('0x18')][_0x6f19('0x1d')],function(_0x170e60){return{'model':db[_0x170e60[_0x6f19('0x1e')]],'as':_0x170e60['as'],'attributes':_0x170e60[_0x6f19('0x1b')],'include':_0x170e60['include']?_['map'](_0x170e60[_0x6f19('0x1d')],function(_0x50b951){return{'model':db[_0x50b951[_0x6f19('0x1e')]],'as':_0x50b951['as'],'attributes':_0x50b951[_0x6f19('0x1b')],'include':_0x50b951['include']?_[_0x6f19('0x1f')](_0x50b951[_0x6f19('0x1d')],function(_0x46950d){return{'model':db[_0x46950d[_0x6f19('0x1e')]],'as':_0x46950d['as'],'attributes':_0x46950d[_0x6f19('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x6f19('0x20')](function(_0x376cc1){logger['info'](_0x6f19('0x15'),_0x4ade6b);logger['debug'](_0x6f19('0x15'),_0x4ade6b,JSON[_0x6f19('0xf')](_0x376cc1));_0x54f0cb(_0x376cc1);})['catch'](function(_0x2845b6){logger[_0x6f19('0x10')](_0x6f19('0x15'),_0x2845b6[_0x6f19('0x12')],_0x4ade6b);_0x3ce3f7(_0x6c3e8b[_0x6f19('0x10')](0x1f4,_0x2845b6[_0x6f19('0x12')]));});});};exports[_0x6f19('0x21')]=function(_0x82319){var _0x3de5eb=this;return new Promise(function(_0x446680,_0x3d9272){return db['SugarcrmAccount'][_0x6f19('0x22')]({'raw':_0x82319[_0x6f19('0x18')]?_0x82319['options']['raw']===undefined?!![]:![]:!![],'where':_0x82319[_0x6f19('0x18')]?_0x82319['options']['where']||null:null,'attributes':_0x82319[_0x6f19('0x18')]?_0x82319[_0x6f19('0x18')][_0x6f19('0x1b')]||null:null,'include':_0x82319[_0x6f19('0x18')]?_0x82319['options'][_0x6f19('0x1d')]?_['map'](_0x82319['options'][_0x6f19('0x1d')],function(_0x2796bc){return{'model':db[_0x2796bc[_0x6f19('0x1e')]],'as':_0x2796bc['as'],'attributes':_0x2796bc['attributes'],'include':_0x2796bc[_0x6f19('0x1d')]?_[_0x6f19('0x1f')](_0x2796bc[_0x6f19('0x1d')],function(_0x218748){return{'model':db[_0x218748[_0x6f19('0x1e')]],'as':_0x218748['as'],'attributes':_0x218748[_0x6f19('0x1b')],'include':_0x218748['include']?_['map'](_0x218748[_0x6f19('0x1d')],function(_0x237635){return{'model':db[_0x237635[_0x6f19('0x1e')]],'as':_0x237635['as'],'attributes':_0x237635[_0x6f19('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x13ad91){logger[_0x6f19('0xa')](_0x6f19('0x21'),_0x82319);logger[_0x6f19('0xc')](_0x6f19('0x21'),_0x82319,JSON[_0x6f19('0xf')](_0x13ad91));_0x446680(_0x13ad91);})[_0x6f19('0x14')](function(_0x1a956b){logger[_0x6f19('0x10')](_0x6f19('0x21'),_0x1a956b[_0x6f19('0x12')],_0x82319);_0x3d9272(_0x3de5eb[_0x6f19('0x10')](0x1f4,_0x1a956b[_0x6f19('0x12')]));});});}; \ No newline at end of file +var _0x8351=['jayson/promise','client','SugarcrmAccount,\x20%s,\x20%s','debug','request\x20sent','error','code','message','result','catch','GetSugarcrmAccount','SugarcrmAccount','findAll','options','raw','attributes','limit','include','map','model','then','ShowSugarcrmAccount','find','where','info','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment'];(function(_0x13239e,_0x1ff4d4){var _0x558aef=function(_0x4f73ad){while(--_0x4f73ad){_0x13239e['push'](_0x13239e['shift']());}};_0x558aef(++_0x1ff4d4);}(_0x8351,0x1e1));var _0x1835=function(_0x19fab3,_0x2379c7){_0x19fab3=_0x19fab3-0x0;var _0x3ed5f7=_0x8351[_0x19fab3];return _0x3ed5f7;};'use strict';var _=require(_0x1835('0x0'));var util=require(_0x1835('0x1'));var moment=require(_0x1835('0x2'));var BPromise=require(_0x1835('0x3'));var rs=require(_0x1835('0x4'));var fs=require('fs');var Redis=require(_0x1835('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x1835('0x6'))(_0x1835('0x7'));var config=require(_0x1835('0x8'));var jayson=require(_0x1835('0x9'));var client=jayson[_0x1835('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4779fb,_0x4bb611,_0x1e6d9){return new BPromise(function(_0x2f751a,_0x5b194e){return client['request'](_0x4779fb,_0x1e6d9)['then'](function(_0x298481){logger['info'](_0x1835('0xb'),_0x4bb611,'request\x20sent');logger[_0x1835('0xc')]('SugarcrmAccount,\x20%s,\x20%s,\x20%s',_0x4bb611,_0x1835('0xd'),JSON['stringify'](_0x298481));if(_0x298481[_0x1835('0xe')]){if(_0x298481[_0x1835('0xe')][_0x1835('0xf')]===0x1f4){logger[_0x1835('0xe')](_0x1835('0xb'),_0x4bb611,_0x298481[_0x1835('0xe')][_0x1835('0x10')]);return _0x5b194e(_0x298481[_0x1835('0xe')][_0x1835('0x10')]);}logger[_0x1835('0xe')](_0x1835('0xb'),_0x4bb611,_0x298481['error'][_0x1835('0x10')]);return _0x2f751a(_0x298481[_0x1835('0xe')][_0x1835('0x10')]);}else{logger['info'](_0x1835('0xb'),_0x4bb611,_0x1835('0xd'));_0x2f751a(_0x298481[_0x1835('0x11')][_0x1835('0x10')]);}})[_0x1835('0x12')](function(_0x3371b4){logger['error']('SugarcrmAccount,\x20%s,\x20%s',_0x4bb611,_0x3371b4);_0x5b194e(_0x3371b4);});});}exports[_0x1835('0x13')]=function(_0xb7d9dd){var _0x205cce=this;return new Promise(function(_0x130b61,_0x4ef651){return db[_0x1835('0x14')][_0x1835('0x15')]({'raw':_0xb7d9dd['options']?_0xb7d9dd[_0x1835('0x16')][_0x1835('0x17')]===undefined?!![]:![]:!![],'where':_0xb7d9dd[_0x1835('0x16')]?_0xb7d9dd['options']['where']||null:null,'attributes':_0xb7d9dd[_0x1835('0x16')]?_0xb7d9dd[_0x1835('0x16')][_0x1835('0x18')]||null:null,'limit':_0xb7d9dd[_0x1835('0x16')]?_0xb7d9dd[_0x1835('0x16')][_0x1835('0x19')]||null:null,'include':_0xb7d9dd[_0x1835('0x16')]?_0xb7d9dd['options'][_0x1835('0x1a')]?_[_0x1835('0x1b')](_0xb7d9dd['options']['include'],function(_0x320cef){return{'model':db[_0x320cef[_0x1835('0x1c')]],'as':_0x320cef['as'],'attributes':_0x320cef[_0x1835('0x18')],'include':_0x320cef[_0x1835('0x1a')]?_[_0x1835('0x1b')](_0x320cef[_0x1835('0x1a')],function(_0x575ed6){return{'model':db[_0x575ed6[_0x1835('0x1c')]],'as':_0x575ed6['as'],'attributes':_0x575ed6[_0x1835('0x18')],'include':_0x575ed6[_0x1835('0x1a')]?_[_0x1835('0x1b')](_0x575ed6[_0x1835('0x1a')],function(_0x12cf7b){return{'model':db[_0x12cf7b[_0x1835('0x1c')]],'as':_0x12cf7b['as'],'attributes':_0x12cf7b[_0x1835('0x18')]};}):[]};}):[]};}):[]:[]})[_0x1835('0x1d')](function(_0x2dbc82){logger['info']('GetSugarcrmAccount',_0xb7d9dd);logger[_0x1835('0xc')]('GetSugarcrmAccount',_0xb7d9dd,JSON['stringify'](_0x2dbc82));_0x130b61(_0x2dbc82);})[_0x1835('0x12')](function(_0x221dee){logger[_0x1835('0xe')](_0x1835('0x13'),_0x221dee[_0x1835('0x10')],_0xb7d9dd);_0x4ef651(_0x205cce[_0x1835('0xe')](0x1f4,_0x221dee[_0x1835('0x10')]));});});};exports[_0x1835('0x1e')]=function(_0x18883b){var _0x14c716=this;return new Promise(function(_0x58f997,_0x44106e){return db[_0x1835('0x14')][_0x1835('0x1f')]({'raw':_0x18883b[_0x1835('0x16')]?_0x18883b[_0x1835('0x16')][_0x1835('0x17')]===undefined?!![]:![]:!![],'where':_0x18883b['options']?_0x18883b['options'][_0x1835('0x20')]||null:null,'attributes':_0x18883b[_0x1835('0x16')]?_0x18883b[_0x1835('0x16')]['attributes']||null:null,'include':_0x18883b[_0x1835('0x16')]?_0x18883b[_0x1835('0x16')]['include']?_[_0x1835('0x1b')](_0x18883b[_0x1835('0x16')]['include'],function(_0x7de619){return{'model':db[_0x7de619[_0x1835('0x1c')]],'as':_0x7de619['as'],'attributes':_0x7de619[_0x1835('0x18')],'include':_0x7de619['include']?_[_0x1835('0x1b')](_0x7de619['include'],function(_0x368b3c){return{'model':db[_0x368b3c[_0x1835('0x1c')]],'as':_0x368b3c['as'],'attributes':_0x368b3c[_0x1835('0x18')],'include':_0x368b3c[_0x1835('0x1a')]?_[_0x1835('0x1b')](_0x368b3c[_0x1835('0x1a')],function(_0x30e31f){return{'model':db[_0x30e31f['model']],'as':_0x30e31f['as'],'attributes':_0x30e31f[_0x1835('0x18')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x29001e){logger[_0x1835('0x21')](_0x1835('0x1e'),_0x18883b);logger[_0x1835('0xc')](_0x1835('0x1e'),_0x18883b,JSON[_0x1835('0x22')](_0x29001e));_0x58f997(_0x29001e);})[_0x1835('0x12')](function(_0x3c3e3e){logger[_0x1835('0xe')](_0x1835('0x1e'),_0x3c3e3e[_0x1835('0x10')],_0x18883b);_0x44106e(_0x14c716[_0x1835('0xe')](0x1f4,_0x3c3e3e[_0x1835('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/index.js b/server/api/intSugarcrmConfiguration/index.js index 76b9a47..e37d72c 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 _0x0d14=['Router','fs-extra','../../components/auth/service','../../config/environment','./intSugarcrmConfiguration.controller','get','isAuthenticated','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create','put','/:id','update','delete','exports','multer','path','connect-timeout','express'];(function(_0x1b2ff7,_0x12a034){var _0x31656a=function(_0x1165a5){while(--_0x1165a5){_0x1b2ff7['push'](_0x1b2ff7['shift']());}};_0x31656a(++_0x12a034);}(_0x0d14,0x1d7));var _0x40d1=function(_0x4dd4c1,_0x5d6185){_0x4dd4c1=_0x4dd4c1-0x0;var _0x53e3df=_0x0d14[_0x4dd4c1];return _0x53e3df;};'use strict';var multer=require(_0x40d1('0x0'));var util=require('util');var path=require(_0x40d1('0x1'));var timeout=require(_0x40d1('0x2'));var express=require(_0x40d1('0x3'));var router=express[_0x40d1('0x4')]();var fs_extra=require(_0x40d1('0x5'));var auth=require(_0x40d1('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x40d1('0x7'));var controller=require(_0x40d1('0x8'));router[_0x40d1('0x9')]('/',auth[_0x40d1('0xa')](),controller['index']);router['get']('/:id',auth[_0x40d1('0xa')](),controller[_0x40d1('0xb')]);router[_0x40d1('0x9')](_0x40d1('0xc'),auth[_0x40d1('0xa')](),controller[_0x40d1('0xd')]);router[_0x40d1('0x9')](_0x40d1('0xe'),auth[_0x40d1('0xa')](),controller[_0x40d1('0xf')]);router['get'](_0x40d1('0x10'),auth['isAuthenticated'](),controller[_0x40d1('0x11')]);router[_0x40d1('0x12')]('/',auth[_0x40d1('0xa')](),controller[_0x40d1('0x13')]);router[_0x40d1('0x14')](_0x40d1('0x15'),auth[_0x40d1('0xa')](),controller[_0x40d1('0x16')]);router[_0x40d1('0x17')](_0x40d1('0x15'),auth[_0x40d1('0xa')](),controller['destroy']);module[_0x40d1('0x18')]=router; \ No newline at end of file +var _0x8c46=['/:id','isAuthenticated','show','/:id/fields','getFields','/:id/subjects','getDescriptions','post','put','destroy','exports','multer','path','express','Router','fs-extra','../../components/interaction/service','./intSugarcrmConfiguration.controller','get','index'];(function(_0x1f79bf,_0x3b1c6){var _0xc73f8b=function(_0x4418b6){while(--_0x4418b6){_0x1f79bf['push'](_0x1f79bf['shift']());}};_0xc73f8b(++_0x3b1c6);}(_0x8c46,0xab));var _0x68c4=function(_0x1c1f17,_0x1cc243){_0x1c1f17=_0x1c1f17-0x0;var _0x41aa9f=_0x8c46[_0x1c1f17];return _0x41aa9f;};'use strict';var multer=require(_0x68c4('0x0'));var util=require('util');var path=require(_0x68c4('0x1'));var timeout=require('connect-timeout');var express=require(_0x68c4('0x2'));var router=express[_0x68c4('0x3')]();var fs_extra=require(_0x68c4('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x68c4('0x5'));var config=require('../../config/environment');var controller=require(_0x68c4('0x6'));router[_0x68c4('0x7')]('/',auth['isAuthenticated'](),controller[_0x68c4('0x8')]);router[_0x68c4('0x7')](_0x68c4('0x9'),auth[_0x68c4('0xa')](),controller[_0x68c4('0xb')]);router[_0x68c4('0x7')](_0x68c4('0xc'),auth[_0x68c4('0xa')](),controller[_0x68c4('0xd')]);router[_0x68c4('0x7')](_0x68c4('0xe'),auth['isAuthenticated'](),controller['getSubjects']);router[_0x68c4('0x7')]('/:id/descriptions',auth[_0x68c4('0xa')](),controller[_0x68c4('0xf')]);router[_0x68c4('0x10')]('/',auth['isAuthenticated'](),controller['create']);router[_0x68c4('0x11')](_0x68c4('0x9'),auth[_0x68c4('0xa')](),controller['update']);router['delete'](_0x68c4('0x9'),auth[_0x68c4('0xa')](),controller[_0x68c4('0x12')]);module[_0x68c4('0x13')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js index 9e8f77b..117decd 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 _0x1020=['STRING','sequelize','exports'];(function(_0x767c00,_0x3ea4e8){var _0x505ad3=function(_0x338a8){while(--_0x338a8){_0x767c00['push'](_0x767c00['shift']());}};_0x505ad3(++_0x3ea4e8);}(_0x1020,0x148));var _0x0102=function(_0x2b4448,_0x5bcc69){_0x2b4448=_0x2b4448-0x0;var _0xb4b465=_0x1020[_0x2b4448];return _0xb4b465;};'use strict';var Sequelize=require(_0x0102('0x0'));module[_0x0102('0x1')]={'name':{'type':Sequelize[_0x0102('0x2')]},'description':{'type':Sequelize[_0x0102('0x2')]}}; \ No newline at end of file +var _0xcba6=['STRING','sequelize','exports'];(function(_0x35670b,_0x15dabe){var _0x1317ad=function(_0x5cabb0){while(--_0x5cabb0){_0x35670b['push'](_0x35670b['shift']());}};_0x1317ad(++_0x15dabe);}(_0xcba6,0x12d));var _0x6cba=function(_0x413feb,_0x10477f){_0x413feb=_0x413feb-0x0;var _0x40ee88=_0xcba6[_0x413feb];return _0x40ee88;};'use strict';var Sequelize=require(_0x6cba('0x0'));module[_0x6cba('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x6cba('0x2')]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js index dea0549..8378111 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 _0xf18f=['keys','query','filters','intersection','fields','attributes','length','nolimit','order','sort','where','pick','merge','filter','options','includeAll','include','SugarcrmConfiguration','findAll','catch','params','find','create','body','findOne','getFields','SugarcrmField','getSubjects','hasOwnProperty','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','set','apply','update','then','destroy','end','error','stack','name','send','rawAttributes','type','key','model','map'];(function(_0x364040,_0x2661d5){var _0x4328dc=function(_0x29a477){while(--_0x29a477){_0x364040['push'](_0x364040['shift']());}};_0x4328dc(++_0x2661d5);}(_0xf18f,0xb8));var _0xff18=function(_0x3520ac,_0x36ad3c){_0x3520ac=_0x3520ac-0x0;var _0x1001e4=_0xf18f[_0x3520ac];return _0x1001e4;};'use strict';var emlformat=require(_0xff18('0x0'));var rimraf=require(_0xff18('0x1'));var zipdir=require(_0xff18('0x2'));var jsonpatch=require(_0xff18('0x3'));var rp=require('request-promise');var moment=require(_0xff18('0x4'));var BPromise=require(_0xff18('0x5'));var Mustache=require(_0xff18('0x6'));var util=require('util');var path=require(_0xff18('0x7'));var sox=require(_0xff18('0x8'));var csv=require(_0xff18('0x9'));var ejs=require(_0xff18('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xff18('0xb'));var squel=require('squel');var crypto=require(_0xff18('0xc'));var jsforce=require(_0xff18('0xd'));var deskjs=require(_0xff18('0xe'));var toCsv=require(_0xff18('0x9'));var querystring=require(_0xff18('0xf'));var Papa=require(_0xff18('0x10'));var Redis=require(_0xff18('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xff18('0x12'));var as=require(_0xff18('0x13'));var hardwareService=require(_0xff18('0x14'));var logger=require('../../config/logger')(_0xff18('0x15'));var utils=require(_0xff18('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xff18('0x17'));var db=require(_0xff18('0x18'))['db'];function respondWithStatusCode(_0x2ec5b0,_0xa89173){_0xa89173=_0xa89173||0xcc;return function(_0x3ba46a){if(_0x3ba46a){return _0x2ec5b0[_0xff18('0x19')](_0xa89173);}return _0x2ec5b0[_0xff18('0x1a')](_0xa89173)['end']();};}function respondWithResult(_0x15ac09,_0x3b5f2e){_0x3b5f2e=_0x3b5f2e||0xc8;return function(_0xfbf1dc){if(_0xfbf1dc){return _0x15ac09[_0xff18('0x1a')](_0x3b5f2e)[_0xff18('0x1b')](_0xfbf1dc);}};}function respondWithFilteredResult(_0x1b2756,_0x408c92){return function(_0x508241){if(_0x508241){var _0x7c986=typeof _0x408c92[_0xff18('0x1c')]===_0xff18('0x1d')&&typeof _0x408c92['limit']===_0xff18('0x1d');var _0x2d64d9=_0x508241[_0xff18('0x1e')];var _0x15aa3c=_0x7c986?0x0:_0x408c92[_0xff18('0x1c')];var _0x45180b=_0x7c986?_0x508241[_0xff18('0x1e')]:_0x408c92[_0xff18('0x1c')]+_0x408c92[_0xff18('0x1f')];var _0x29167b;if(_0x45180b>=_0x2d64d9){_0x45180b=_0x2d64d9;_0x29167b=0xc8;}else{_0x29167b=0xce;}_0x1b2756[_0xff18('0x1a')](_0x29167b);return _0x1b2756[_0xff18('0x20')]('Content-Range',_0x15aa3c+'-'+_0x45180b+'/'+_0x2d64d9)[_0xff18('0x1b')](_0x508241);}return null;};}function patchUpdates(_0x444d3b){return function(_0x47beb4){try{jsonpatch[_0xff18('0x21')](_0x47beb4,_0x444d3b,!![]);}catch(_0xc24aea){return BPromise['reject'](_0xc24aea);}return _0x47beb4['save']();};}function saveUpdates(_0x24dbda,_0x31228a){return function(_0x580411){if(_0x580411){return _0x580411[_0xff18('0x22')](_0x24dbda)[_0xff18('0x23')](function(_0x581ce9){return _0x581ce9;});}return null;};}function removeEntity(_0x56347f,_0x2e2738){return function(_0x41d223){if(_0x41d223){return _0x41d223[_0xff18('0x24')]()[_0xff18('0x23')](function(){_0x56347f[_0xff18('0x1a')](0xcc)[_0xff18('0x25')]();});}};}function handleEntityNotFound(_0x4de303,_0x43806f){return function(_0x4ca9b7){if(!_0x4ca9b7){_0x4de303['sendStatus'](0x194);}return _0x4ca9b7;};}function handleError(_0x1255a7,_0x5aa1d0){_0x5aa1d0=_0x5aa1d0||0x1f4;return function(_0x209ca0){logger[_0xff18('0x26')](_0x209ca0[_0xff18('0x27')]);if(_0x209ca0[_0xff18('0x28')]){delete _0x209ca0[_0xff18('0x28')];}_0x1255a7[_0xff18('0x1a')](_0x5aa1d0)[_0xff18('0x29')](_0x209ca0);};}exports['index']=function(_0xc1acfa,_0x542158){var _0xc84591={},_0x5803dd={},_0xa7692={'count':0x0,'rows':[]};var _0x4de0c1=_['map'](db['SugarcrmConfiguration'][_0xff18('0x2a')],function(_0x526e63){return{'name':_0x526e63['fieldName'],'type':_0x526e63[_0xff18('0x2b')][_0xff18('0x2c')]};});_0x5803dd[_0xff18('0x2d')]=_[_0xff18('0x2e')](_0x4de0c1,_0xff18('0x28'));_0x5803dd['query']=_[_0xff18('0x2f')](_0xc1acfa[_0xff18('0x30')]);_0x5803dd[_0xff18('0x31')]=_[_0xff18('0x32')](_0x5803dd['model'],_0x5803dd['query']);_0xc84591['attributes']=_['intersection'](_0x5803dd['model'],qs['fields'](_0xc1acfa[_0xff18('0x30')][_0xff18('0x33')]));_0xc84591['attributes']=_0xc84591[_0xff18('0x34')][_0xff18('0x35')]?_0xc84591['attributes']:_0x5803dd[_0xff18('0x2d')];if(!_0xc1acfa['query']['hasOwnProperty'](_0xff18('0x36'))){_0xc84591[_0xff18('0x1f')]=qs[_0xff18('0x1f')](_0xc1acfa[_0xff18('0x30')][_0xff18('0x1f')]);_0xc84591[_0xff18('0x1c')]=qs['offset'](_0xc1acfa[_0xff18('0x30')][_0xff18('0x1c')]);}_0xc84591[_0xff18('0x37')]=qs['sort'](_0xc1acfa['query'][_0xff18('0x38')]);_0xc84591[_0xff18('0x39')]=qs[_0xff18('0x31')](_[_0xff18('0x3a')](_0xc1acfa[_0xff18('0x30')],_0x5803dd[_0xff18('0x31')]),_0x4de0c1);if(_0xc1acfa[_0xff18('0x30')]['filter']){_0xc84591['where']=_[_0xff18('0x3b')](_0xc84591[_0xff18('0x39')],{'$or':_[_0xff18('0x2e')](_0x4de0c1,function(_0x3fec78){if(_0x3fec78[_0xff18('0x2b')]!=='VIRTUAL'){var _0x161dcf={};_0x161dcf[_0x3fec78['name']]={'$like':'%'+_0xc1acfa['query'][_0xff18('0x3c')]+'%'};return _0x161dcf;}})});}_0xc84591=_['merge']({},_0xc84591,_0xc1acfa[_0xff18('0x3d')]);var _0x2dad82={'where':_0xc84591[_0xff18('0x39')]};return db['SugarcrmConfiguration'][_0xff18('0x1e')](_0x2dad82)[_0xff18('0x23')](function(_0x114a0b){_0xa7692[_0xff18('0x1e')]=_0x114a0b;if(_0xc1acfa['query'][_0xff18('0x3e')]){_0xc84591[_0xff18('0x3f')]=[{'all':!![]}];}return db[_0xff18('0x40')][_0xff18('0x41')](_0xc84591);})['then'](function(_0x421d68){_0xa7692['rows']=_0x421d68;return _0xa7692;})[_0xff18('0x23')](respondWithFilteredResult(_0x542158,_0xc84591))[_0xff18('0x42')](handleError(_0x542158,null));};exports['show']=function(_0x47d7c1,_0x3ff33c){var _0x25c316={'raw':![],'where':{'id':_0x47d7c1[_0xff18('0x43')]['id']}},_0x33e710={};_0x33e710[_0xff18('0x2d')]=_[_0xff18('0x2f')](db[_0xff18('0x40')][_0xff18('0x2a')]);_0x33e710[_0xff18('0x30')]=_[_0xff18('0x2f')](_0x47d7c1[_0xff18('0x30')]);_0x33e710['filters']=_[_0xff18('0x32')](_0x33e710[_0xff18('0x2d')],_0x33e710[_0xff18('0x30')]);_0x25c316[_0xff18('0x34')]=_['intersection'](_0x33e710[_0xff18('0x2d')],qs[_0xff18('0x33')](_0x47d7c1[_0xff18('0x30')][_0xff18('0x33')]));_0x25c316[_0xff18('0x34')]=_0x25c316[_0xff18('0x34')][_0xff18('0x35')]?_0x25c316[_0xff18('0x34')]:_0x33e710[_0xff18('0x2d')];if(_0x47d7c1[_0xff18('0x30')][_0xff18('0x3e')]){_0x25c316[_0xff18('0x3f')]=[{'all':!![]}];}_0x25c316=_[_0xff18('0x3b')]({},_0x25c316,_0x47d7c1[_0xff18('0x3d')]);return db[_0xff18('0x40')][_0xff18('0x44')](_0x25c316)[_0xff18('0x23')](handleEntityNotFound(_0x3ff33c,null))['then'](respondWithResult(_0x3ff33c,null))[_0xff18('0x42')](handleError(_0x3ff33c,null));};exports[_0xff18('0x45')]=function(_0x56f372,_0x29f3dd){return db['SugarcrmConfiguration'][_0xff18('0x45')](_0x56f372['body'],{})[_0xff18('0x23')](respondWithResult(_0x29f3dd,0xc9))[_0xff18('0x42')](handleError(_0x29f3dd,null));};exports['update']=function(_0x1eb5d4,_0x3fbded){if(_0x1eb5d4[_0xff18('0x46')]['id']){delete _0x1eb5d4[_0xff18('0x46')]['id'];}return db[_0xff18('0x40')]['find']({'where':{'id':_0x1eb5d4[_0xff18('0x43')]['id']}})[_0xff18('0x23')](handleEntityNotFound(_0x3fbded,null))[_0xff18('0x23')](saveUpdates(_0x1eb5d4['body'],null))[_0xff18('0x23')](respondWithResult(_0x3fbded,null))[_0xff18('0x42')](handleError(_0x3fbded,null));};exports[_0xff18('0x24')]=function(_0x22e39a,_0x60df21){return db[_0xff18('0x40')][_0xff18('0x44')]({'where':{'id':_0x22e39a[_0xff18('0x43')]['id']}})[_0xff18('0x23')](handleEntityNotFound(_0x60df21,null))['then'](removeEntity(_0x60df21,null))[_0xff18('0x42')](handleError(_0x60df21,null));};exports['getFields']=function(_0x1e2f80,_0x57f0f2,_0x42e5ac){var _0x547322={};var _0xaac10a={};var _0xa5ac38;var _0x415359;return db['SugarcrmConfiguration'][_0xff18('0x47')]({'where':{'id':_0x1e2f80[_0xff18('0x43')]['id']}})['then'](handleEntityNotFound(_0x57f0f2,null))[_0xff18('0x23')](function(_0xf31f3){if(_0xf31f3){_0xa5ac38=_0xf31f3;_0xaac10a[_0xff18('0x2d')]=_[_0xff18('0x2f')](db['SugarcrmField'][_0xff18('0x2a')]);_0xaac10a[_0xff18('0x30')]=_[_0xff18('0x2f')](_0x1e2f80['query']);_0xaac10a[_0xff18('0x31')]=_[_0xff18('0x32')](_0xaac10a[_0xff18('0x2d')],_0xaac10a['query']);_0x547322[_0xff18('0x34')]=_[_0xff18('0x32')](_0xaac10a['model'],qs[_0xff18('0x33')](_0x1e2f80['query'][_0xff18('0x33')]));_0x547322['attributes']=_0x547322[_0xff18('0x34')]['length']?_0x547322[_0xff18('0x34')]:_0xaac10a['model'];_0x547322[_0xff18('0x37')]=qs['sort'](_0x1e2f80[_0xff18('0x30')][_0xff18('0x38')]);_0x547322['where']=qs[_0xff18('0x31')](_[_0xff18('0x3a')](_0x1e2f80[_0xff18('0x30')],_0xaac10a[_0xff18('0x31')]));if(_0x1e2f80['query']['filter']){_0x547322['where']=_[_0xff18('0x3b')](_0x547322[_0xff18('0x39')],{'$or':_[_0xff18('0x2e')](_0x547322[_0xff18('0x34')],function(_0x20744b){var _0x5a3865={};_0x5a3865[_0x20744b]={'$like':'%'+_0x1e2f80['query'][_0xff18('0x3c')]+'%'};return _0x5a3865;})});}_0x547322=_[_0xff18('0x3b')]({},_0x547322,_0x1e2f80[_0xff18('0x3d')]);return _0xa5ac38[_0xff18('0x48')](_0x547322);}})[_0xff18('0x23')](function(_0x35c583){if(_0x35c583){_0x415359=_0x35c583[_0xff18('0x35')];if(!_0x1e2f80['query']['hasOwnProperty'](_0xff18('0x36'))){_0x547322[_0xff18('0x1f')]=qs[_0xff18('0x1f')](_0x1e2f80[_0xff18('0x30')]['limit']);_0x547322[_0xff18('0x1c')]=qs[_0xff18('0x1c')](_0x1e2f80[_0xff18('0x30')][_0xff18('0x1c')]);}return _0xa5ac38[_0xff18('0x48')](_0x547322);}})[_0xff18('0x23')](function(_0x2d15e8){if(_0x2d15e8){return _0x2d15e8?{'count':_0x415359,'rows':_0x2d15e8}:null;}})[_0xff18('0x23')](respondWithResult(_0x57f0f2,null))[_0xff18('0x42')](handleError(_0x57f0f2,null));};exports['getSubjects']=function(_0x3b9da5,_0x1ac58e,_0x12080b){var _0x33ed96={};var _0x34ed45={};var _0x4d69f3;var _0x255b18;return db['SugarcrmConfiguration']['findOne']({'where':{'id':_0x3b9da5[_0xff18('0x43')]['id']}})[_0xff18('0x23')](handleEntityNotFound(_0x1ac58e,null))['then'](function(_0x4a5ce3){if(_0x4a5ce3){_0x4d69f3=_0x4a5ce3;_0x34ed45['model']=_['keys'](db[_0xff18('0x49')][_0xff18('0x2a')]);_0x34ed45[_0xff18('0x30')]=_[_0xff18('0x2f')](_0x3b9da5['query']);_0x34ed45['filters']=_[_0xff18('0x32')](_0x34ed45['model'],_0x34ed45['query']);_0x33ed96['attributes']=_[_0xff18('0x32')](_0x34ed45[_0xff18('0x2d')],qs[_0xff18('0x33')](_0x3b9da5[_0xff18('0x30')]['fields']));_0x33ed96['attributes']=_0x33ed96[_0xff18('0x34')]['length']?_0x33ed96['attributes']:_0x34ed45[_0xff18('0x2d')];_0x33ed96[_0xff18('0x37')]=qs[_0xff18('0x38')](_0x3b9da5[_0xff18('0x30')][_0xff18('0x38')]);_0x33ed96['where']=qs[_0xff18('0x31')](_[_0xff18('0x3a')](_0x3b9da5[_0xff18('0x30')],_0x34ed45[_0xff18('0x31')]));if(_0x3b9da5[_0xff18('0x30')][_0xff18('0x3c')]){_0x33ed96['where']=_[_0xff18('0x3b')](_0x33ed96[_0xff18('0x39')],{'$or':_[_0xff18('0x2e')](_0x33ed96[_0xff18('0x34')],function(_0xabd9d7){var _0x4da1a7={};_0x4da1a7[_0xabd9d7]={'$like':'%'+_0x3b9da5[_0xff18('0x30')]['filter']+'%'};return _0x4da1a7;})});}_0x33ed96=_['merge']({},_0x33ed96,_0x3b9da5[_0xff18('0x3d')]);return _0x4d69f3[_0xff18('0x4a')](_0x33ed96);}})[_0xff18('0x23')](function(_0x3514b0){if(_0x3514b0){_0x255b18=_0x3514b0['length'];if(!_0x3b9da5[_0xff18('0x30')][_0xff18('0x4b')]('nolimit')){_0x33ed96['limit']=qs[_0xff18('0x1f')](_0x3b9da5[_0xff18('0x30')]['limit']);_0x33ed96[_0xff18('0x1c')]=qs[_0xff18('0x1c')](_0x3b9da5[_0xff18('0x30')][_0xff18('0x1c')]);}return _0x4d69f3[_0xff18('0x4a')](_0x33ed96);}})['then'](function(_0x15f513){if(_0x15f513){return _0x15f513?{'count':_0x255b18,'rows':_0x15f513}:null;}})[_0xff18('0x23')](respondWithResult(_0x1ac58e,null))[_0xff18('0x42')](handleError(_0x1ac58e,null));};exports[_0xff18('0x4c')]=function(_0x587884,_0x1e4d1c,_0x1b9db3){var _0xd0abfd={};var _0x4fd561={};var _0x22ee5b;var _0x205394;return db[_0xff18('0x40')][_0xff18('0x47')]({'where':{'id':_0x587884[_0xff18('0x43')]['id']}})[_0xff18('0x23')](handleEntityNotFound(_0x1e4d1c,null))[_0xff18('0x23')](function(_0x31f75a){if(_0x31f75a){_0x22ee5b=_0x31f75a;_0x4fd561['model']=_[_0xff18('0x2f')](db[_0xff18('0x49')]['rawAttributes']);_0x4fd561[_0xff18('0x30')]=_[_0xff18('0x2f')](_0x587884['query']);_0x4fd561[_0xff18('0x31')]=_['intersection'](_0x4fd561['model'],_0x4fd561[_0xff18('0x30')]);_0xd0abfd[_0xff18('0x34')]=_[_0xff18('0x32')](_0x4fd561['model'],qs[_0xff18('0x33')](_0x587884['query'][_0xff18('0x33')]));_0xd0abfd[_0xff18('0x34')]=_0xd0abfd[_0xff18('0x34')][_0xff18('0x35')]?_0xd0abfd[_0xff18('0x34')]:_0x4fd561[_0xff18('0x2d')];_0xd0abfd['order']=qs['sort'](_0x587884['query'][_0xff18('0x38')]);_0xd0abfd[_0xff18('0x39')]=qs['filters'](_[_0xff18('0x3a')](_0x587884[_0xff18('0x30')],_0x4fd561[_0xff18('0x31')]));if(_0x587884[_0xff18('0x30')][_0xff18('0x3c')]){_0xd0abfd[_0xff18('0x39')]=_[_0xff18('0x3b')](_0xd0abfd[_0xff18('0x39')],{'$or':_['map'](_0xd0abfd['attributes'],function(_0x45ec78){var _0xbf2ac8={};_0xbf2ac8[_0x45ec78]={'$like':'%'+_0x587884[_0xff18('0x30')][_0xff18('0x3c')]+'%'};return _0xbf2ac8;})});}_0xd0abfd=_[_0xff18('0x3b')]({},_0xd0abfd,_0x587884[_0xff18('0x3d')]);return _0x22ee5b['getDescriptions'](_0xd0abfd);}})[_0xff18('0x23')](function(_0x111695){if(_0x111695){_0x205394=_0x111695[_0xff18('0x35')];if(!_0x587884[_0xff18('0x30')][_0xff18('0x4b')]('nolimit')){_0xd0abfd[_0xff18('0x1f')]=qs[_0xff18('0x1f')](_0x587884['query'][_0xff18('0x1f')]);_0xd0abfd[_0xff18('0x1c')]=qs[_0xff18('0x1c')](_0x587884[_0xff18('0x30')][_0xff18('0x1c')]);}return _0x22ee5b[_0xff18('0x4c')](_0xd0abfd);}})[_0xff18('0x23')](function(_0x2891d4){if(_0x2891d4){return _0x2891d4?{'count':_0x205394,'rows':_0x2891d4}:null;}})[_0xff18('0x23')](respondWithResult(_0x1e4d1c,null))[_0xff18('0x42')](handleError(_0x1e4d1c,null));}; \ No newline at end of file +var _0xccbc=['rawAttributes','keys','find','create','body','SugarcrmField','filter','getFields','findOne','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','moment','bluebird','util','path','to-csv','fs-extra','lodash','squel','crypto','desk.js','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','update','destroy','then','error','stack','name','send','SugarcrmConfiguration','fieldName','type','key','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','options','includeAll','include','rows','catch','params'];(function(_0x8067a0,_0x4f8784){var _0x5e965f=function(_0x3b0620){while(--_0x3b0620){_0x8067a0['push'](_0x8067a0['shift']());}};_0x5e965f(++_0x4f8784);}(_0xccbc,0xe9));var _0xcccb=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0xccbc[_0x40a045];return _0x1a687c;};'use strict';var emlformat=require(_0xcccb('0x0'));var rimraf=require(_0xcccb('0x1'));var zipdir=require(_0xcccb('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xcccb('0x3'));var BPromise=require(_0xcccb('0x4'));var Mustache=require('mustache');var util=require(_0xcccb('0x5'));var path=require(_0xcccb('0x6'));var sox=require('sox');var csv=require(_0xcccb('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xcccb('0x8'));var _=require(_0xcccb('0x9'));var squel=require(_0xcccb('0xa'));var crypto=require(_0xcccb('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xcccb('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xcccb('0xd'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xcccb('0xe'));var as=require(_0xcccb('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xcccb('0x10'));var utils=require(_0xcccb('0x11'));var config=require('../../config/environment');var licenseUtil=require(_0xcccb('0x12'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2e260b,_0x4af5c5){_0x4af5c5=_0x4af5c5||0xcc;return function(_0xb70b24){if(_0xb70b24){return _0x2e260b[_0xcccb('0x13')](_0x4af5c5);}return _0x2e260b[_0xcccb('0x14')](_0x4af5c5)[_0xcccb('0x15')]();};}function respondWithResult(_0x2b8b66,_0x323ecc){_0x323ecc=_0x323ecc||0xc8;return function(_0x1067bd){if(_0x1067bd){return _0x2b8b66[_0xcccb('0x14')](_0x323ecc)[_0xcccb('0x16')](_0x1067bd);}};}function respondWithFilteredResult(_0x4b5ccd,_0x2ba709){return function(_0x163d58){if(_0x163d58){var _0x59096e=typeof _0x2ba709[_0xcccb('0x17')]===_0xcccb('0x18')&&typeof _0x2ba709[_0xcccb('0x19')]==='undefined';var _0x421eaa=_0x163d58[_0xcccb('0x1a')];var _0xcf44f4=_0x59096e?0x0:_0x2ba709[_0xcccb('0x17')];var _0x45c88e=_0x59096e?_0x163d58['count']:_0x2ba709[_0xcccb('0x17')]+_0x2ba709['limit'];var _0x6f7a8a;if(_0x45c88e>=_0x421eaa){_0x45c88e=_0x421eaa;_0x6f7a8a=0xc8;}else{_0x6f7a8a=0xce;}_0x4b5ccd['status'](_0x6f7a8a);return _0x4b5ccd[_0xcccb('0x1b')](_0xcccb('0x1c'),_0xcf44f4+'-'+_0x45c88e+'/'+_0x421eaa)[_0xcccb('0x16')](_0x163d58);}return null;};}function patchUpdates(_0x41f623){return function(_0x57071f){try{jsonpatch[_0xcccb('0x1d')](_0x57071f,_0x41f623,!![]);}catch(_0x54f693){return BPromise['reject'](_0x54f693);}return _0x57071f['save']();};}function saveUpdates(_0x49172f,_0x5d98ac){return function(_0x41bd60){if(_0x41bd60){return _0x41bd60[_0xcccb('0x1e')](_0x49172f)['then'](function(_0x57f23f){return _0x57f23f;});}return null;};}function removeEntity(_0x568754,_0x5e7bca){return function(_0x724857){if(_0x724857){return _0x724857[_0xcccb('0x1f')]()[_0xcccb('0x20')](function(){_0x568754[_0xcccb('0x14')](0xcc)[_0xcccb('0x15')]();});}};}function handleEntityNotFound(_0x3874c5,_0x97eaa1){return function(_0x5f5a10){if(!_0x5f5a10){_0x3874c5[_0xcccb('0x13')](0x194);}return _0x5f5a10;};}function handleError(_0x2a6ef4,_0x44bd2a){_0x44bd2a=_0x44bd2a||0x1f4;return function(_0x5cb1af){logger[_0xcccb('0x21')](_0x5cb1af[_0xcccb('0x22')]);if(_0x5cb1af[_0xcccb('0x23')]){delete _0x5cb1af[_0xcccb('0x23')];}_0x2a6ef4[_0xcccb('0x14')](_0x44bd2a)[_0xcccb('0x24')](_0x5cb1af);};}exports['index']=function(_0x3c44c6,_0x50e07e){var _0x40b5bb={},_0x5bede5={},_0x51639b={'count':0x0,'rows':[]};var _0x2b3379=_['map'](db[_0xcccb('0x25')]['rawAttributes'],function(_0xd5c583){return{'name':_0xd5c583[_0xcccb('0x26')],'type':_0xd5c583[_0xcccb('0x27')][_0xcccb('0x28')]};});_0x5bede5[_0xcccb('0x29')]=_[_0xcccb('0x2a')](_0x2b3379,'name');_0x5bede5[_0xcccb('0x2b')]=_['keys'](_0x3c44c6[_0xcccb('0x2b')]);_0x5bede5[_0xcccb('0x2c')]=_[_0xcccb('0x2d')](_0x5bede5['model'],_0x5bede5['query']);_0x40b5bb[_0xcccb('0x2e')]=_[_0xcccb('0x2d')](_0x5bede5[_0xcccb('0x29')],qs[_0xcccb('0x2f')](_0x3c44c6[_0xcccb('0x2b')][_0xcccb('0x2f')]));_0x40b5bb[_0xcccb('0x2e')]=_0x40b5bb['attributes'][_0xcccb('0x30')]?_0x40b5bb[_0xcccb('0x2e')]:_0x5bede5[_0xcccb('0x29')];if(!_0x3c44c6[_0xcccb('0x2b')][_0xcccb('0x31')](_0xcccb('0x32'))){_0x40b5bb['limit']=qs[_0xcccb('0x19')](_0x3c44c6[_0xcccb('0x2b')][_0xcccb('0x19')]);_0x40b5bb[_0xcccb('0x17')]=qs['offset'](_0x3c44c6['query']['offset']);}_0x40b5bb[_0xcccb('0x33')]=qs[_0xcccb('0x34')](_0x3c44c6[_0xcccb('0x2b')][_0xcccb('0x34')]);_0x40b5bb[_0xcccb('0x35')]=qs['filters'](_[_0xcccb('0x36')](_0x3c44c6['query'],_0x5bede5[_0xcccb('0x2c')]),_0x2b3379);if(_0x3c44c6['query']['filter']){_0x40b5bb[_0xcccb('0x35')]=_[_0xcccb('0x37')](_0x40b5bb[_0xcccb('0x35')],{'$or':_['map'](_0x2b3379,function(_0x55b4ba){if(_0x55b4ba[_0xcccb('0x27')]!==_0xcccb('0x38')){var _0x5ec989={};_0x5ec989[_0x55b4ba[_0xcccb('0x23')]]={'$like':'%'+_0x3c44c6[_0xcccb('0x2b')]['filter']+'%'};return _0x5ec989;}})});}_0x40b5bb=_[_0xcccb('0x37')]({},_0x40b5bb,_0x3c44c6[_0xcccb('0x39')]);var _0x42e9d1={'where':_0x40b5bb[_0xcccb('0x35')]};return db[_0xcccb('0x25')][_0xcccb('0x1a')](_0x42e9d1)[_0xcccb('0x20')](function(_0xb1a3f2){_0x51639b[_0xcccb('0x1a')]=_0xb1a3f2;if(_0x3c44c6[_0xcccb('0x2b')][_0xcccb('0x3a')]){_0x40b5bb[_0xcccb('0x3b')]=[{'all':!![]}];}return db[_0xcccb('0x25')]['findAll'](_0x40b5bb);})[_0xcccb('0x20')](function(_0x308480){_0x51639b[_0xcccb('0x3c')]=_0x308480;return _0x51639b;})[_0xcccb('0x20')](respondWithFilteredResult(_0x50e07e,_0x40b5bb))[_0xcccb('0x3d')](handleError(_0x50e07e,null));};exports['show']=function(_0x4d1709,_0x2e9eea){var _0x37227a={'raw':![],'where':{'id':_0x4d1709[_0xcccb('0x3e')]['id']}},_0x2e61b6={};_0x2e61b6[_0xcccb('0x29')]=_['keys'](db[_0xcccb('0x25')][_0xcccb('0x3f')]);_0x2e61b6[_0xcccb('0x2b')]=_[_0xcccb('0x40')](_0x4d1709[_0xcccb('0x2b')]);_0x2e61b6[_0xcccb('0x2c')]=_[_0xcccb('0x2d')](_0x2e61b6[_0xcccb('0x29')],_0x2e61b6[_0xcccb('0x2b')]);_0x37227a[_0xcccb('0x2e')]=_[_0xcccb('0x2d')](_0x2e61b6['model'],qs[_0xcccb('0x2f')](_0x4d1709[_0xcccb('0x2b')][_0xcccb('0x2f')]));_0x37227a[_0xcccb('0x2e')]=_0x37227a[_0xcccb('0x2e')][_0xcccb('0x30')]?_0x37227a[_0xcccb('0x2e')]:_0x2e61b6[_0xcccb('0x29')];if(_0x4d1709['query']['includeAll']){_0x37227a[_0xcccb('0x3b')]=[{'all':!![]}];}_0x37227a=_[_0xcccb('0x37')]({},_0x37227a,_0x4d1709[_0xcccb('0x39')]);return db[_0xcccb('0x25')][_0xcccb('0x41')](_0x37227a)[_0xcccb('0x20')](handleEntityNotFound(_0x2e9eea,null))['then'](respondWithResult(_0x2e9eea,null))['catch'](handleError(_0x2e9eea,null));};exports[_0xcccb('0x42')]=function(_0x32317c,_0x5a26d0){return db[_0xcccb('0x25')][_0xcccb('0x42')](_0x32317c[_0xcccb('0x43')],{})['then'](respondWithResult(_0x5a26d0,0xc9))['catch'](handleError(_0x5a26d0,null));};exports[_0xcccb('0x1e')]=function(_0x5f5b78,_0x1907a3){if(_0x5f5b78[_0xcccb('0x43')]['id']){delete _0x5f5b78[_0xcccb('0x43')]['id'];}return db[_0xcccb('0x25')][_0xcccb('0x41')]({'where':{'id':_0x5f5b78[_0xcccb('0x3e')]['id']}})['then'](handleEntityNotFound(_0x1907a3,null))[_0xcccb('0x20')](saveUpdates(_0x5f5b78[_0xcccb('0x43')],null))[_0xcccb('0x20')](respondWithResult(_0x1907a3,null))[_0xcccb('0x3d')](handleError(_0x1907a3,null));};exports['destroy']=function(_0x30831d,_0x19c08a){return db[_0xcccb('0x25')][_0xcccb('0x41')]({'where':{'id':_0x30831d[_0xcccb('0x3e')]['id']}})[_0xcccb('0x20')](handleEntityNotFound(_0x19c08a,null))['then'](removeEntity(_0x19c08a,null))[_0xcccb('0x3d')](handleError(_0x19c08a,null));};exports['getFields']=function(_0x1dc00e,_0x1c8eca,_0x2cea91){var _0x4c62a6={};var _0x4afc1a={};var _0x23934a;var _0x179cd5;return db[_0xcccb('0x25')]['findOne']({'where':{'id':_0x1dc00e[_0xcccb('0x3e')]['id']}})[_0xcccb('0x20')](handleEntityNotFound(_0x1c8eca,null))[_0xcccb('0x20')](function(_0x63df7b){if(_0x63df7b){_0x23934a=_0x63df7b;_0x4afc1a[_0xcccb('0x29')]=_[_0xcccb('0x40')](db[_0xcccb('0x44')][_0xcccb('0x3f')]);_0x4afc1a['query']=_[_0xcccb('0x40')](_0x1dc00e['query']);_0x4afc1a[_0xcccb('0x2c')]=_[_0xcccb('0x2d')](_0x4afc1a[_0xcccb('0x29')],_0x4afc1a[_0xcccb('0x2b')]);_0x4c62a6[_0xcccb('0x2e')]=_[_0xcccb('0x2d')](_0x4afc1a['model'],qs[_0xcccb('0x2f')](_0x1dc00e[_0xcccb('0x2b')][_0xcccb('0x2f')]));_0x4c62a6[_0xcccb('0x2e')]=_0x4c62a6[_0xcccb('0x2e')][_0xcccb('0x30')]?_0x4c62a6['attributes']:_0x4afc1a[_0xcccb('0x29')];_0x4c62a6[_0xcccb('0x33')]=qs['sort'](_0x1dc00e[_0xcccb('0x2b')][_0xcccb('0x34')]);_0x4c62a6[_0xcccb('0x35')]=qs[_0xcccb('0x2c')](_[_0xcccb('0x36')](_0x1dc00e[_0xcccb('0x2b')],_0x4afc1a[_0xcccb('0x2c')]));if(_0x1dc00e[_0xcccb('0x2b')][_0xcccb('0x45')]){_0x4c62a6[_0xcccb('0x35')]=_[_0xcccb('0x37')](_0x4c62a6[_0xcccb('0x35')],{'$or':_['map'](_0x4c62a6[_0xcccb('0x2e')],function(_0x495f04){var _0x3b0030={};_0x3b0030[_0x495f04]={'$like':'%'+_0x1dc00e[_0xcccb('0x2b')][_0xcccb('0x45')]+'%'};return _0x3b0030;})});}_0x4c62a6=_['merge']({},_0x4c62a6,_0x1dc00e[_0xcccb('0x39')]);return _0x23934a[_0xcccb('0x46')](_0x4c62a6);}})['then'](function(_0x39ebe1){if(_0x39ebe1){_0x179cd5=_0x39ebe1[_0xcccb('0x30')];if(!_0x1dc00e[_0xcccb('0x2b')][_0xcccb('0x31')]('nolimit')){_0x4c62a6[_0xcccb('0x19')]=qs[_0xcccb('0x19')](_0x1dc00e[_0xcccb('0x2b')][_0xcccb('0x19')]);_0x4c62a6['offset']=qs[_0xcccb('0x17')](_0x1dc00e[_0xcccb('0x2b')]['offset']);}return _0x23934a['getFields'](_0x4c62a6);}})[_0xcccb('0x20')](function(_0x34b488){if(_0x34b488){return _0x34b488?{'count':_0x179cd5,'rows':_0x34b488}:null;}})[_0xcccb('0x20')](respondWithResult(_0x1c8eca,null))[_0xcccb('0x3d')](handleError(_0x1c8eca,null));};exports['getSubjects']=function(_0x1d072b,_0x1f292f,_0x2ffbda){var _0x1154ca={};var _0x3bfbe9={};var _0x390c7a;var _0x68a382;return db[_0xcccb('0x25')][_0xcccb('0x47')]({'where':{'id':_0x1d072b['params']['id']}})[_0xcccb('0x20')](handleEntityNotFound(_0x1f292f,null))['then'](function(_0x314f2d){if(_0x314f2d){_0x390c7a=_0x314f2d;_0x3bfbe9['model']=_[_0xcccb('0x40')](db[_0xcccb('0x44')][_0xcccb('0x3f')]);_0x3bfbe9['query']=_['keys'](_0x1d072b[_0xcccb('0x2b')]);_0x3bfbe9['filters']=_[_0xcccb('0x2d')](_0x3bfbe9['model'],_0x3bfbe9[_0xcccb('0x2b')]);_0x1154ca['attributes']=_[_0xcccb('0x2d')](_0x3bfbe9[_0xcccb('0x29')],qs[_0xcccb('0x2f')](_0x1d072b[_0xcccb('0x2b')]['fields']));_0x1154ca[_0xcccb('0x2e')]=_0x1154ca[_0xcccb('0x2e')]['length']?_0x1154ca['attributes']:_0x3bfbe9[_0xcccb('0x29')];_0x1154ca[_0xcccb('0x33')]=qs[_0xcccb('0x34')](_0x1d072b[_0xcccb('0x2b')]['sort']);_0x1154ca['where']=qs[_0xcccb('0x2c')](_['pick'](_0x1d072b[_0xcccb('0x2b')],_0x3bfbe9['filters']));if(_0x1d072b[_0xcccb('0x2b')]['filter']){_0x1154ca['where']=_[_0xcccb('0x37')](_0x1154ca[_0xcccb('0x35')],{'$or':_[_0xcccb('0x2a')](_0x1154ca[_0xcccb('0x2e')],function(_0x4330e0){var _0x5b1f64={};_0x5b1f64[_0x4330e0]={'$like':'%'+_0x1d072b[_0xcccb('0x2b')][_0xcccb('0x45')]+'%'};return _0x5b1f64;})});}_0x1154ca=_['merge']({},_0x1154ca,_0x1d072b[_0xcccb('0x39')]);return _0x390c7a[_0xcccb('0x48')](_0x1154ca);}})[_0xcccb('0x20')](function(_0x1a27f8){if(_0x1a27f8){_0x68a382=_0x1a27f8[_0xcccb('0x30')];if(!_0x1d072b['query']['hasOwnProperty'](_0xcccb('0x32'))){_0x1154ca[_0xcccb('0x19')]=qs[_0xcccb('0x19')](_0x1d072b[_0xcccb('0x2b')]['limit']);_0x1154ca[_0xcccb('0x17')]=qs[_0xcccb('0x17')](_0x1d072b[_0xcccb('0x2b')]['offset']);}return _0x390c7a[_0xcccb('0x48')](_0x1154ca);}})[_0xcccb('0x20')](function(_0x1f2e55){if(_0x1f2e55){return _0x1f2e55?{'count':_0x68a382,'rows':_0x1f2e55}:null;}})[_0xcccb('0x20')](respondWithResult(_0x1f292f,null))[_0xcccb('0x3d')](handleError(_0x1f292f,null));};exports[_0xcccb('0x49')]=function(_0x33f29e,_0x51948e,_0xed3c8c){var _0x1881d9={};var _0x33e3f9={};var _0x5111e8;var _0x426837;return db[_0xcccb('0x25')]['findOne']({'where':{'id':_0x33f29e['params']['id']}})[_0xcccb('0x20')](handleEntityNotFound(_0x51948e,null))[_0xcccb('0x20')](function(_0x35adc6){if(_0x35adc6){_0x5111e8=_0x35adc6;_0x33e3f9[_0xcccb('0x29')]=_['keys'](db[_0xcccb('0x44')]['rawAttributes']);_0x33e3f9[_0xcccb('0x2b')]=_[_0xcccb('0x40')](_0x33f29e[_0xcccb('0x2b')]);_0x33e3f9[_0xcccb('0x2c')]=_[_0xcccb('0x2d')](_0x33e3f9[_0xcccb('0x29')],_0x33e3f9[_0xcccb('0x2b')]);_0x1881d9[_0xcccb('0x2e')]=_['intersection'](_0x33e3f9[_0xcccb('0x29')],qs[_0xcccb('0x2f')](_0x33f29e['query'][_0xcccb('0x2f')]));_0x1881d9[_0xcccb('0x2e')]=_0x1881d9[_0xcccb('0x2e')]['length']?_0x1881d9[_0xcccb('0x2e')]:_0x33e3f9[_0xcccb('0x29')];_0x1881d9['order']=qs[_0xcccb('0x34')](_0x33f29e[_0xcccb('0x2b')][_0xcccb('0x34')]);_0x1881d9['where']=qs[_0xcccb('0x2c')](_['pick'](_0x33f29e[_0xcccb('0x2b')],_0x33e3f9[_0xcccb('0x2c')]));if(_0x33f29e[_0xcccb('0x2b')][_0xcccb('0x45')]){_0x1881d9[_0xcccb('0x35')]=_['merge'](_0x1881d9[_0xcccb('0x35')],{'$or':_[_0xcccb('0x2a')](_0x1881d9[_0xcccb('0x2e')],function(_0x2af171){var _0x567f11={};_0x567f11[_0x2af171]={'$like':'%'+_0x33f29e[_0xcccb('0x2b')]['filter']+'%'};return _0x567f11;})});}_0x1881d9=_['merge']({},_0x1881d9,_0x33f29e[_0xcccb('0x39')]);return _0x5111e8[_0xcccb('0x49')](_0x1881d9);}})[_0xcccb('0x20')](function(_0x2a1a7f){if(_0x2a1a7f){_0x426837=_0x2a1a7f[_0xcccb('0x30')];if(!_0x33f29e[_0xcccb('0x2b')][_0xcccb('0x31')](_0xcccb('0x32'))){_0x1881d9[_0xcccb('0x19')]=qs[_0xcccb('0x19')](_0x33f29e[_0xcccb('0x2b')][_0xcccb('0x19')]);_0x1881d9[_0xcccb('0x17')]=qs[_0xcccb('0x17')](_0x33f29e[_0xcccb('0x2b')]['offset']);}return _0x5111e8['getDescriptions'](_0x1881d9);}})[_0xcccb('0x20')](function(_0x457730){if(_0x457730){return _0x457730?{'count':_0x426837,'rows':_0x457730}:null;}})[_0xcccb('0x20')](respondWithResult(_0x51948e,null))[_0xcccb('0x3d')](handleError(_0x51948e,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js index 6cef692..432a8f3 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 _0x99d3=['../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./intSugarcrmConfiguration.attributes','exports','SugarcrmConfiguration','int_sugarcrm_configurations','util'];(function(_0x17d44e,_0x5d9760){var _0x494485=function(_0x112212){while(--_0x112212){_0x17d44e['push'](_0x17d44e['shift']());}};_0x494485(++_0x5d9760);}(_0x99d3,0x15b));var _0x399d=function(_0x2b4c9e,_0x182ffe){_0x2b4c9e=_0x2b4c9e-0x0;var _0x259b7a=_0x99d3[_0x2b4c9e];return _0x259b7a;};'use strict';var _=require('lodash');var util=require(_0x399d('0x0'));var logger=require(_0x399d('0x1'))(_0x399d('0x2'));var moment=require('moment');var BPromise=require(_0x399d('0x3'));var rp=require(_0x399d('0x4'));var fs=require('fs');var path=require(_0x399d('0x5'));var rimraf=require(_0x399d('0x6'));var config=require(_0x399d('0x7'));var attributes=require(_0x399d('0x8'));module[_0x399d('0x9')]=function(_0x15fdfe,_0x320fde){return _0x15fdfe['define'](_0x399d('0xa'),attributes,{'tableName':_0x399d('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6f10=['rimraf','../../config/environment','define','SugarcrmConfiguration','lodash','util','../../config/logger','api','bluebird','request-promise','path'];(function(_0xbd08b4,_0x4790ed){var _0x314f1e=function(_0x161589){while(--_0x161589){_0xbd08b4['push'](_0xbd08b4['shift']());}};_0x314f1e(++_0x4790ed);}(_0x6f10,0x72));var _0x06f1=function(_0x354d5b,_0x11a3ee){_0x354d5b=_0x354d5b-0x0;var _0xdb403c=_0x6f10[_0x354d5b];return _0xdb403c;};'use strict';var _=require(_0x06f1('0x0'));var util=require(_0x06f1('0x1'));var logger=require(_0x06f1('0x2'))(_0x06f1('0x3'));var moment=require('moment');var BPromise=require(_0x06f1('0x4'));var rp=require(_0x06f1('0x5'));var fs=require('fs');var path=require(_0x06f1('0x6'));var rimraf=require(_0x06f1('0x7'));var config=require(_0x06f1('0x8'));var attributes=require('./intSugarcrmConfiguration.attributes');module['exports']=function(_0x458627,_0x469efa){return _0x458627[_0x06f1('0x9')](_0x06f1('0xa'),attributes,{'tableName':'int_sugarcrm_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.rpc.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.rpc.js index 94085c9..6ca361c 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 _0x8f95=['stringify','error','code','message','info','request\x20sent','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','SugarcrmConfiguration,\x20%s,\x20%s'];(function(_0x5515a7,_0x2c4af1){var _0x43f4bf=function(_0x3d519d){while(--_0x3d519d){_0x5515a7['push'](_0x5515a7['shift']());}};_0x43f4bf(++_0x2c4af1);}(_0x8f95,0xa9));var _0x58f9=function(_0x4c331e,_0x1735b4){_0x4c331e=_0x4c331e-0x0;var _0x404b61=_0x8f95[_0x4c331e];return _0x404b61;};'use strict';var _=require(_0x58f9('0x0'));var util=require(_0x58f9('0x1'));var moment=require(_0x58f9('0x2'));var BPromise=require('bluebird');var rs=require(_0x58f9('0x3'));var fs=require('fs');var Redis=require(_0x58f9('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x58f9('0x5'));var logger=require(_0x58f9('0x6'))(_0x58f9('0x7'));var config=require(_0x58f9('0x8'));var jayson=require(_0x58f9('0x9'));var client=jayson[_0x58f9('0xa')][_0x58f9('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xfe9aa4,_0x4f0b65,_0x303392){return new BPromise(function(_0x1f10c8,_0xfdf639){return client[_0x58f9('0xc')](_0xfe9aa4,_0x303392)[_0x58f9('0xd')](function(_0x2bf9aa){logger['info'](_0x58f9('0xe'),_0x4f0b65,'request\x20sent');logger['debug']('SugarcrmConfiguration,\x20%s,\x20%s,\x20%s',_0x4f0b65,'request\x20sent',JSON[_0x58f9('0xf')](_0x2bf9aa));if(_0x2bf9aa['error']){if(_0x2bf9aa[_0x58f9('0x10')][_0x58f9('0x11')]===0x1f4){logger['error']('SugarcrmConfiguration,\x20%s,\x20%s',_0x4f0b65,_0x2bf9aa[_0x58f9('0x10')][_0x58f9('0x12')]);return _0xfdf639(_0x2bf9aa[_0x58f9('0x10')][_0x58f9('0x12')]);}logger[_0x58f9('0x10')](_0x58f9('0xe'),_0x4f0b65,_0x2bf9aa[_0x58f9('0x10')][_0x58f9('0x12')]);return _0x1f10c8(_0x2bf9aa[_0x58f9('0x10')][_0x58f9('0x12')]);}else{logger[_0x58f9('0x13')](_0x58f9('0xe'),_0x4f0b65,_0x58f9('0x14'));_0x1f10c8(_0x2bf9aa[_0x58f9('0x15')][_0x58f9('0x12')]);}})[_0x58f9('0x16')](function(_0x1fd818){logger[_0x58f9('0x10')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x4f0b65,_0x1fd818);_0xfdf639(_0x1fd818);});});} \ No newline at end of file +var _0xb78a=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','SugarcrmConfiguration,\x20%s,\x20%s','request\x20sent','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash'];(function(_0x39784c,_0x6d88f9){var _0x31c2e0=function(_0x24d359){while(--_0x24d359){_0x39784c['push'](_0x39784c['shift']());}};_0x31c2e0(++_0x6d88f9);}(_0xb78a,0x17f));var _0xab78=function(_0x3428b3,_0x4396cc){_0x3428b3=_0x3428b3-0x0;var _0x4474ad=_0xb78a[_0x3428b3];return _0x4474ad;};'use strict';var _=require(_0xab78('0x0'));var util=require('util');var moment=require(_0xab78('0x1'));var BPromise=require(_0xab78('0x2'));var rs=require(_0xab78('0x3'));var fs=require('fs');var Redis=require(_0xab78('0x4'));var db=require(_0xab78('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xab78('0x6'))(_0xab78('0x7'));var config=require(_0xab78('0x8'));var jayson=require(_0xab78('0x9'));var client=jayson[_0xab78('0xa')][_0xab78('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x16aada,_0x55b061,_0xde04f3){return new BPromise(function(_0x1b2612,_0x200cdf){return client[_0xab78('0xc')](_0x16aada,_0xde04f3)[_0xab78('0xd')](function(_0x4041ea){logger['info'](_0xab78('0xe'),_0x55b061,_0xab78('0xf'));logger['debug'](_0xab78('0x10'),_0x55b061,_0xab78('0xf'),JSON[_0xab78('0x11')](_0x4041ea));if(_0x4041ea[_0xab78('0x12')]){if(_0x4041ea[_0xab78('0x12')][_0xab78('0x13')]===0x1f4){logger['error'](_0xab78('0xe'),_0x55b061,_0x4041ea[_0xab78('0x12')][_0xab78('0x14')]);return _0x200cdf(_0x4041ea[_0xab78('0x12')][_0xab78('0x14')]);}logger['error'](_0xab78('0xe'),_0x55b061,_0x4041ea[_0xab78('0x12')][_0xab78('0x14')]);return _0x1b2612(_0x4041ea['error'][_0xab78('0x14')]);}else{logger[_0xab78('0x15')](_0xab78('0xe'),_0x55b061,_0xab78('0xf'));_0x1b2612(_0x4041ea[_0xab78('0x16')][_0xab78('0x14')]);}})[_0xab78('0x17')](function(_0x1e9839){logger[_0xab78('0x12')](_0xab78('0xe'),_0x55b061,_0x1e9839);_0x200cdf(_0x1e9839);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmField/index.js b/server/api/intSugarcrmField/index.js index 91bddf7..2f0f8ca 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 _0x9796=['create','put','update','delete','destroy','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmField.controller','get','index','/:id','isAuthenticated','show'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x9796,0xf5));var _0x6979=function(_0x4a94c6,_0x926215){_0x4a94c6=_0x4a94c6-0x0;var _0x32e6ae=_0x9796[_0x4a94c6];return _0x32e6ae;};'use strict';var multer=require(_0x6979('0x0'));var util=require(_0x6979('0x1'));var path=require('path');var timeout=require(_0x6979('0x2'));var express=require(_0x6979('0x3'));var router=express[_0x6979('0x4')]();var fs_extra=require(_0x6979('0x5'));var auth=require(_0x6979('0x6'));var interaction=require(_0x6979('0x7'));var config=require(_0x6979('0x8'));var controller=require(_0x6979('0x9'));router[_0x6979('0xa')]('/',auth['isAuthenticated'](),controller[_0x6979('0xb')]);router[_0x6979('0xa')](_0x6979('0xc'),auth[_0x6979('0xd')](),controller[_0x6979('0xe')]);router['post']('/',auth[_0x6979('0xd')](),controller[_0x6979('0xf')]);router[_0x6979('0x10')](_0x6979('0xc'),auth[_0x6979('0xd')](),controller[_0x6979('0x11')]);router[_0x6979('0x12')](_0x6979('0xc'),auth[_0x6979('0xd')](),controller[_0x6979('0x13')]);module['exports']=router; \ No newline at end of file +var _0x6837=['destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmField.controller','get','isAuthenticated','index','post','create','put','/:id','update','delete'];(function(_0xf2bef5,_0x418f91){var _0x3a3fcb=function(_0x43e4ae){while(--_0x43e4ae){_0xf2bef5['push'](_0xf2bef5['shift']());}};_0x3a3fcb(++_0x418f91);}(_0x6837,0x1e5));var _0x7683=function(_0x1dd315,_0x22afb1){_0x1dd315=_0x1dd315-0x0;var _0x505f14=_0x6837[_0x1dd315];return _0x505f14;};'use strict';var multer=require(_0x7683('0x0'));var util=require(_0x7683('0x1'));var path=require(_0x7683('0x2'));var timeout=require(_0x7683('0x3'));var express=require(_0x7683('0x4'));var router=express['Router']();var fs_extra=require(_0x7683('0x5'));var auth=require(_0x7683('0x6'));var interaction=require(_0x7683('0x7'));var config=require(_0x7683('0x8'));var controller=require(_0x7683('0x9'));router[_0x7683('0xa')]('/',auth[_0x7683('0xb')](),controller[_0x7683('0xc')]);router[_0x7683('0xa')]('/:id',auth[_0x7683('0xb')](),controller['show']);router[_0x7683('0xd')]('/',auth['isAuthenticated'](),controller[_0x7683('0xe')]);router[_0x7683('0xf')](_0x7683('0x10'),auth[_0x7683('0xb')](),controller[_0x7683('0x11')]);router[_0x7683('0x12')](_0x7683('0x10'),auth[_0x7683('0xb')](),controller[_0x7683('0x13')]);module[_0x7683('0x14')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.attributes.js b/server/api/intSugarcrmField/intSugarcrmField.attributes.js index d61845f..f172569 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 _0x973c=['BOOLEAN','sequelize','ENUM','string','variable','customVariable','keyValue','picklist','STRING'];(function(_0x3e61d4,_0x224d2d){var _0x40bd4e=function(_0x21432f){while(--_0x21432f){_0x3e61d4['push'](_0x3e61d4['shift']());}};_0x40bd4e(++_0x224d2d);}(_0x973c,0x14e));var _0xc973=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x973c[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xc973('0x0'));module['exports']={'type':{'type':Sequelize[_0xc973('0x1')](_0xc973('0x2'),_0xc973('0x3'),_0xc973('0x4'),_0xc973('0x5'),_0xc973('0x6')),'defaultValue':_0xc973('0x2')},'content':{'type':Sequelize[_0xc973('0x7')]},'key':{'type':Sequelize[_0xc973('0x7')]},'keyType':{'type':Sequelize[_0xc973('0x1')]('string',_0xc973('0x3'),_0xc973('0x4'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0xc973('0x7')]},'nameField':{'type':Sequelize[_0xc973('0x7')]},'customField':{'type':Sequelize[_0xc973('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xc973('0x7')]}}; \ No newline at end of file +var _0x75a9=['keyValue','picklist','string','variable','STRING','sequelize','exports','ENUM','customVariable'];(function(_0x204eb7,_0x4974c3){var _0x37e444=function(_0x390613){while(--_0x390613){_0x204eb7['push'](_0x204eb7['shift']());}};_0x37e444(++_0x4974c3);}(_0x75a9,0x1e2));var _0x975a=function(_0x17ef31,_0x5858a6){_0x17ef31=_0x17ef31-0x0;var _0x3a1394=_0x75a9[_0x17ef31];return _0x3a1394;};'use strict';var Sequelize=require(_0x975a('0x0'));module[_0x975a('0x1')]={'type':{'type':Sequelize[_0x975a('0x2')]('string','variable',_0x975a('0x3'),_0x975a('0x4'),_0x975a('0x5')),'defaultValue':_0x975a('0x6')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize['ENUM'](_0x975a('0x6'),_0x975a('0x7'),_0x975a('0x3'))},'keyContent':{'type':Sequelize[_0x975a('0x8')]},'idField':{'type':Sequelize[_0x975a('0x8')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.controller.js b/server/api/intSugarcrmField/intSugarcrmField.controller.js index a6b18a8..91a3d34 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 _0xe019=['catch','create','body','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','name','index','SugarcrmField','rawAttributes','fieldName','type','key','map','keys','query','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','options','includeAll','findAll','rows','params','include','find'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe019,0x11f));var _0x9e01=function(_0x47b19f,_0x77c99f){_0x47b19f=_0x47b19f-0x0;var _0x1fd067=_0xe019[_0x47b19f];return _0x1fd067;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9e01('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9e01('0x1'));var rp=require(_0x9e01('0x2'));var moment=require(_0x9e01('0x3'));var BPromise=require(_0x9e01('0x4'));var Mustache=require(_0x9e01('0x5'));var util=require('util');var path=require('path');var sox=require(_0x9e01('0x6'));var csv=require(_0x9e01('0x7'));var ejs=require(_0x9e01('0x8'));var fs=require('fs');var fs_extra=require(_0x9e01('0x9'));var _=require(_0x9e01('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x9e01('0xb'));var toCsv=require('to-csv');var querystring=require(_0x9e01('0xc'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x9e01('0xd'));var qs=require(_0x9e01('0xe'));var as=require(_0x9e01('0xf'));var hardwareService=require(_0x9e01('0x10'));var logger=require('../../config/logger')(_0x9e01('0x11'));var utils=require(_0x9e01('0x12'));var config=require(_0x9e01('0x13'));var licenseUtil=require(_0x9e01('0x14'));var db=require(_0x9e01('0x15'))['db'];function respondWithStatusCode(_0x12a788,_0xed4e73){_0xed4e73=_0xed4e73||0xcc;return function(_0x1e4157){if(_0x1e4157){return _0x12a788[_0x9e01('0x16')](_0xed4e73);}return _0x12a788['status'](_0xed4e73)[_0x9e01('0x17')]();};}function respondWithResult(_0x353b75,_0x20beaa){_0x20beaa=_0x20beaa||0xc8;return function(_0x283147){if(_0x283147){return _0x353b75[_0x9e01('0x18')](_0x20beaa)[_0x9e01('0x19')](_0x283147);}};}function respondWithFilteredResult(_0x4b1c86,_0x3262ff){return function(_0x1ff175){if(_0x1ff175){var _0x4088ca=typeof _0x3262ff[_0x9e01('0x1a')]===_0x9e01('0x1b')&&typeof _0x3262ff[_0x9e01('0x1c')]===_0x9e01('0x1b');var _0x1a1bb2=_0x1ff175[_0x9e01('0x1d')];var _0x1649ce=_0x4088ca?0x0:_0x3262ff[_0x9e01('0x1a')];var _0x267e8d=_0x4088ca?_0x1ff175[_0x9e01('0x1d')]:_0x3262ff[_0x9e01('0x1a')]+_0x3262ff[_0x9e01('0x1c')];var _0x41271d;if(_0x267e8d>=_0x1a1bb2){_0x267e8d=_0x1a1bb2;_0x41271d=0xc8;}else{_0x41271d=0xce;}_0x4b1c86['status'](_0x41271d);return _0x4b1c86[_0x9e01('0x1e')](_0x9e01('0x1f'),_0x1649ce+'-'+_0x267e8d+'/'+_0x1a1bb2)['json'](_0x1ff175);}return null;};}function patchUpdates(_0x4d52d2){return function(_0x30776b){try{jsonpatch[_0x9e01('0x20')](_0x30776b,_0x4d52d2,!![]);}catch(_0x47e4b0){return BPromise[_0x9e01('0x21')](_0x47e4b0);}return _0x30776b['save']();};}function saveUpdates(_0x15be39,_0x807065){return function(_0x115a04){if(_0x115a04){return _0x115a04[_0x9e01('0x22')](_0x15be39)[_0x9e01('0x23')](function(_0x5c86b6){return _0x5c86b6;});}return null;};}function removeEntity(_0x48c940,_0x4f664b){return function(_0x514117){if(_0x514117){return _0x514117[_0x9e01('0x24')]()[_0x9e01('0x23')](function(){_0x48c940['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x51287f,_0x3c7bf8){return function(_0x50fdd2){if(!_0x50fdd2){_0x51287f[_0x9e01('0x16')](0x194);}return _0x50fdd2;};}function handleError(_0x1d6466,_0x4107a9){_0x4107a9=_0x4107a9||0x1f4;return function(_0x2ea08d){logger['error'](_0x2ea08d['stack']);if(_0x2ea08d[_0x9e01('0x25')]){delete _0x2ea08d['name'];}_0x1d6466['status'](_0x4107a9)['send'](_0x2ea08d);};}exports[_0x9e01('0x26')]=function(_0x5e577e,_0x3882d2){var _0x23ff41={},_0x3c7b97={},_0x439f02={'count':0x0,'rows':[]};var _0x3adf8e=_['map'](db[_0x9e01('0x27')][_0x9e01('0x28')],function(_0x3d36f6){return{'name':_0x3d36f6[_0x9e01('0x29')],'type':_0x3d36f6[_0x9e01('0x2a')][_0x9e01('0x2b')]};});_0x3c7b97['model']=_[_0x9e01('0x2c')](_0x3adf8e,_0x9e01('0x25'));_0x3c7b97['query']=_[_0x9e01('0x2d')](_0x5e577e[_0x9e01('0x2e')]);_0x3c7b97[_0x9e01('0x2f')]=_[_0x9e01('0x30')](_0x3c7b97['model'],_0x3c7b97['query']);_0x23ff41[_0x9e01('0x31')]=_[_0x9e01('0x30')](_0x3c7b97[_0x9e01('0x32')],qs[_0x9e01('0x33')](_0x5e577e[_0x9e01('0x2e')]['fields']));_0x23ff41['attributes']=_0x23ff41['attributes'][_0x9e01('0x34')]?_0x23ff41[_0x9e01('0x31')]:_0x3c7b97[_0x9e01('0x32')];if(!_0x5e577e['query'][_0x9e01('0x35')](_0x9e01('0x36'))){_0x23ff41[_0x9e01('0x1c')]=qs[_0x9e01('0x1c')](_0x5e577e[_0x9e01('0x2e')][_0x9e01('0x1c')]);_0x23ff41[_0x9e01('0x1a')]=qs[_0x9e01('0x1a')](_0x5e577e['query']['offset']);}_0x23ff41[_0x9e01('0x37')]=qs[_0x9e01('0x38')](_0x5e577e['query'][_0x9e01('0x38')]);_0x23ff41[_0x9e01('0x39')]=qs['filters'](_[_0x9e01('0x3a')](_0x5e577e[_0x9e01('0x2e')],_0x3c7b97[_0x9e01('0x2f')]),_0x3adf8e);if(_0x5e577e[_0x9e01('0x2e')]['filter']){_0x23ff41[_0x9e01('0x39')]=_[_0x9e01('0x3b')](_0x23ff41[_0x9e01('0x39')],{'$or':_[_0x9e01('0x2c')](_0x3adf8e,function(_0x4f0e1c){if(_0x4f0e1c[_0x9e01('0x2a')]!==_0x9e01('0x3c')){var _0x19b356={};_0x19b356[_0x4f0e1c[_0x9e01('0x25')]]={'$like':'%'+_0x5e577e[_0x9e01('0x2e')]['filter']+'%'};return _0x19b356;}})});}_0x23ff41=_[_0x9e01('0x3b')]({},_0x23ff41,_0x5e577e[_0x9e01('0x3d')]);var _0x5e0666={'where':_0x23ff41[_0x9e01('0x39')]};return db[_0x9e01('0x27')][_0x9e01('0x1d')](_0x5e0666)[_0x9e01('0x23')](function(_0x418c1b){_0x439f02[_0x9e01('0x1d')]=_0x418c1b;if(_0x5e577e[_0x9e01('0x2e')][_0x9e01('0x3e')]){_0x23ff41['include']=[{'all':!![]}];}return db[_0x9e01('0x27')][_0x9e01('0x3f')](_0x23ff41);})[_0x9e01('0x23')](function(_0x47a43a){_0x439f02[_0x9e01('0x40')]=_0x47a43a;return _0x439f02;})['then'](respondWithFilteredResult(_0x3882d2,_0x23ff41))['catch'](handleError(_0x3882d2,null));};exports['show']=function(_0x52e6a9,_0x46b4d0){var _0x359a97={'raw':!![],'where':{'id':_0x52e6a9[_0x9e01('0x41')]['id']}},_0x269b0b={};_0x269b0b['model']=_[_0x9e01('0x2d')](db[_0x9e01('0x27')][_0x9e01('0x28')]);_0x269b0b[_0x9e01('0x2e')]=_[_0x9e01('0x2d')](_0x52e6a9[_0x9e01('0x2e')]);_0x269b0b[_0x9e01('0x2f')]=_[_0x9e01('0x30')](_0x269b0b['model'],_0x269b0b[_0x9e01('0x2e')]);_0x359a97[_0x9e01('0x31')]=_[_0x9e01('0x30')](_0x269b0b[_0x9e01('0x32')],qs[_0x9e01('0x33')](_0x52e6a9['query'][_0x9e01('0x33')]));_0x359a97[_0x9e01('0x31')]=_0x359a97[_0x9e01('0x31')][_0x9e01('0x34')]?_0x359a97[_0x9e01('0x31')]:_0x269b0b['model'];if(_0x52e6a9[_0x9e01('0x2e')]['includeAll']){_0x359a97[_0x9e01('0x42')]=[{'all':!![]}];}_0x359a97=_[_0x9e01('0x3b')]({},_0x359a97,_0x52e6a9[_0x9e01('0x3d')]);return db[_0x9e01('0x27')][_0x9e01('0x43')](_0x359a97)['then'](handleEntityNotFound(_0x46b4d0,null))['then'](respondWithResult(_0x46b4d0,null))[_0x9e01('0x44')](handleError(_0x46b4d0,null));};exports['create']=function(_0xaa1034,_0x31131e){return db[_0x9e01('0x27')][_0x9e01('0x45')](_0xaa1034[_0x9e01('0x46')],{})['then'](respondWithResult(_0x31131e,0xc9))[_0x9e01('0x44')](handleError(_0x31131e,null));};exports[_0x9e01('0x22')]=function(_0x4737d9,_0x3ec8d3){if(_0x4737d9[_0x9e01('0x46')]['id']){delete _0x4737d9[_0x9e01('0x46')]['id'];}return db[_0x9e01('0x27')][_0x9e01('0x43')]({'where':{'id':_0x4737d9['params']['id']}})['then'](handleEntityNotFound(_0x3ec8d3,null))[_0x9e01('0x23')](saveUpdates(_0x4737d9[_0x9e01('0x46')],null))[_0x9e01('0x23')](respondWithResult(_0x3ec8d3,null))[_0x9e01('0x44')](handleError(_0x3ec8d3,null));};exports[_0x9e01('0x24')]=function(_0x30a2bd,_0x4821a3){return db['SugarcrmField'][_0x9e01('0x43')]({'where':{'id':_0x30a2bd['params']['id']}})['then'](handleEntityNotFound(_0x4821a3,null))[_0x9e01('0x23')](removeEntity(_0x4821a3,null))['catch'](handleError(_0x4821a3,null));}; \ No newline at end of file +var _0xd9df=['undefined','limit','count','Content-Range','save','update','destroy','then','end','error','stack','name','index','map','SugarcrmField','rawAttributes','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','pick','merge','VIRTUAL','options','includeAll','include','findAll','rows','params','find','catch','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','to-csv','ejs','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','../../mysqldb','sendStatus','status','json','offset'];(function(_0x537c37,_0x536e74){var _0x241f84=function(_0x3fe709){while(--_0x3fe709){_0x537c37['push'](_0x537c37['shift']());}};_0x241f84(++_0x536e74);}(_0xd9df,0xbf));var _0xfd9d=function(_0x836058,_0x3f2590){_0x836058=_0x836058-0x0;var _0x22dc0d=_0xd9df[_0x836058];return _0x22dc0d;};'use strict';var emlformat=require(_0xfd9d('0x0'));var rimraf=require(_0xfd9d('0x1'));var zipdir=require(_0xfd9d('0x2'));var jsonpatch=require(_0xfd9d('0x3'));var rp=require(_0xfd9d('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xfd9d('0x5'));var util=require(_0xfd9d('0x6'));var path=require(_0xfd9d('0x7'));var sox=require('sox');var csv=require(_0xfd9d('0x8'));var ejs=require(_0xfd9d('0x9'));var fs=require('fs');var fs_extra=require(_0xfd9d('0xa'));var _=require('lodash');var squel=require(_0xfd9d('0xb'));var crypto=require(_0xfd9d('0xc'));var jsforce=require(_0xfd9d('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xfd9d('0xe'));var Papa=require(_0xfd9d('0xf'));var Redis=require(_0xfd9d('0x10'));var authService=require(_0xfd9d('0x11'));var qs=require(_0xfd9d('0x12'));var as=require(_0xfd9d('0x13'));var hardwareService=require(_0xfd9d('0x14'));var logger=require(_0xfd9d('0x15'))(_0xfd9d('0x16'));var utils=require(_0xfd9d('0x17'));var config=require(_0xfd9d('0x18'));var licenseUtil=require(_0xfd9d('0x19'));var db=require(_0xfd9d('0x1a'))['db'];function respondWithStatusCode(_0x184671,_0x53b682){_0x53b682=_0x53b682||0xcc;return function(_0x1ca2eb){if(_0x1ca2eb){return _0x184671[_0xfd9d('0x1b')](_0x53b682);}return _0x184671[_0xfd9d('0x1c')](_0x53b682)['end']();};}function respondWithResult(_0x3b02ba,_0x13501f){_0x13501f=_0x13501f||0xc8;return function(_0x17712e){if(_0x17712e){return _0x3b02ba[_0xfd9d('0x1c')](_0x13501f)[_0xfd9d('0x1d')](_0x17712e);}};}function respondWithFilteredResult(_0x109e9d,_0x542456){return function(_0x4f6eb4){if(_0x4f6eb4){var _0x169699=typeof _0x542456[_0xfd9d('0x1e')]===_0xfd9d('0x1f')&&typeof _0x542456[_0xfd9d('0x20')]===_0xfd9d('0x1f');var _0x3cb84a=_0x4f6eb4['count'];var _0x4d1af4=_0x169699?0x0:_0x542456[_0xfd9d('0x1e')];var _0x3e89eb=_0x169699?_0x4f6eb4[_0xfd9d('0x21')]:_0x542456[_0xfd9d('0x1e')]+_0x542456[_0xfd9d('0x20')];var _0x8cdb8f;if(_0x3e89eb>=_0x3cb84a){_0x3e89eb=_0x3cb84a;_0x8cdb8f=0xc8;}else{_0x8cdb8f=0xce;}_0x109e9d['status'](_0x8cdb8f);return _0x109e9d['set'](_0xfd9d('0x22'),_0x4d1af4+'-'+_0x3e89eb+'/'+_0x3cb84a)[_0xfd9d('0x1d')](_0x4f6eb4);}return null;};}function patchUpdates(_0x137ad2){return function(_0x36343a){try{jsonpatch['apply'](_0x36343a,_0x137ad2,!![]);}catch(_0xf5b222){return BPromise['reject'](_0xf5b222);}return _0x36343a[_0xfd9d('0x23')]();};}function saveUpdates(_0x3ce2d3,_0x576bd2){return function(_0xc207d4){if(_0xc207d4){return _0xc207d4[_0xfd9d('0x24')](_0x3ce2d3)['then'](function(_0x45faf9){return _0x45faf9;});}return null;};}function removeEntity(_0x2e6275,_0x3f73e6){return function(_0x5cdd98){if(_0x5cdd98){return _0x5cdd98[_0xfd9d('0x25')]()[_0xfd9d('0x26')](function(){_0x2e6275[_0xfd9d('0x1c')](0xcc)[_0xfd9d('0x27')]();});}};}function handleEntityNotFound(_0x52eff8,_0x369ac0){return function(_0x3f32a0){if(!_0x3f32a0){_0x52eff8[_0xfd9d('0x1b')](0x194);}return _0x3f32a0;};}function handleError(_0x43fe57,_0x318c35){_0x318c35=_0x318c35||0x1f4;return function(_0x4d2c9d){logger[_0xfd9d('0x28')](_0x4d2c9d[_0xfd9d('0x29')]);if(_0x4d2c9d[_0xfd9d('0x2a')]){delete _0x4d2c9d[_0xfd9d('0x2a')];}_0x43fe57[_0xfd9d('0x1c')](_0x318c35)['send'](_0x4d2c9d);};}exports[_0xfd9d('0x2b')]=function(_0x138a3d,_0x4bd5f3){var _0x17a431={},_0x47584a={},_0x512576={'count':0x0,'rows':[]};var _0x59968c=_[_0xfd9d('0x2c')](db[_0xfd9d('0x2d')][_0xfd9d('0x2e')],function(_0x39800f){return{'name':_0x39800f['fieldName'],'type':_0x39800f[_0xfd9d('0x2f')][_0xfd9d('0x30')]};});_0x47584a[_0xfd9d('0x31')]=_[_0xfd9d('0x2c')](_0x59968c,'name');_0x47584a[_0xfd9d('0x32')]=_[_0xfd9d('0x33')](_0x138a3d[_0xfd9d('0x32')]);_0x47584a[_0xfd9d('0x34')]=_['intersection'](_0x47584a['model'],_0x47584a[_0xfd9d('0x32')]);_0x17a431[_0xfd9d('0x35')]=_[_0xfd9d('0x36')](_0x47584a[_0xfd9d('0x31')],qs[_0xfd9d('0x37')](_0x138a3d[_0xfd9d('0x32')][_0xfd9d('0x37')]));_0x17a431['attributes']=_0x17a431[_0xfd9d('0x35')][_0xfd9d('0x38')]?_0x17a431[_0xfd9d('0x35')]:_0x47584a[_0xfd9d('0x31')];if(!_0x138a3d['query'][_0xfd9d('0x39')]('nolimit')){_0x17a431['limit']=qs[_0xfd9d('0x20')](_0x138a3d[_0xfd9d('0x32')][_0xfd9d('0x20')]);_0x17a431[_0xfd9d('0x1e')]=qs['offset'](_0x138a3d[_0xfd9d('0x32')]['offset']);}_0x17a431[_0xfd9d('0x3a')]=qs[_0xfd9d('0x3b')](_0x138a3d[_0xfd9d('0x32')][_0xfd9d('0x3b')]);_0x17a431[_0xfd9d('0x3c')]=qs[_0xfd9d('0x34')](_[_0xfd9d('0x3d')](_0x138a3d['query'],_0x47584a[_0xfd9d('0x34')]),_0x59968c);if(_0x138a3d[_0xfd9d('0x32')]['filter']){_0x17a431[_0xfd9d('0x3c')]=_[_0xfd9d('0x3e')](_0x17a431['where'],{'$or':_['map'](_0x59968c,function(_0x34c9e8){if(_0x34c9e8[_0xfd9d('0x2f')]!==_0xfd9d('0x3f')){var _0x58a55b={};_0x58a55b[_0x34c9e8[_0xfd9d('0x2a')]]={'$like':'%'+_0x138a3d['query']['filter']+'%'};return _0x58a55b;}})});}_0x17a431=_[_0xfd9d('0x3e')]({},_0x17a431,_0x138a3d[_0xfd9d('0x40')]);var _0x53d572={'where':_0x17a431[_0xfd9d('0x3c')]};return db['SugarcrmField'][_0xfd9d('0x21')](_0x53d572)[_0xfd9d('0x26')](function(_0x20af09){_0x512576['count']=_0x20af09;if(_0x138a3d['query'][_0xfd9d('0x41')]){_0x17a431[_0xfd9d('0x42')]=[{'all':!![]}];}return db[_0xfd9d('0x2d')][_0xfd9d('0x43')](_0x17a431);})[_0xfd9d('0x26')](function(_0x551929){_0x512576[_0xfd9d('0x44')]=_0x551929;return _0x512576;})['then'](respondWithFilteredResult(_0x4bd5f3,_0x17a431))['catch'](handleError(_0x4bd5f3,null));};exports['show']=function(_0x1f86b3,_0x38f5d8){var _0x28c2dc={'raw':!![],'where':{'id':_0x1f86b3[_0xfd9d('0x45')]['id']}},_0x5c18b8={};_0x5c18b8[_0xfd9d('0x31')]=_[_0xfd9d('0x33')](db[_0xfd9d('0x2d')][_0xfd9d('0x2e')]);_0x5c18b8[_0xfd9d('0x32')]=_[_0xfd9d('0x33')](_0x1f86b3[_0xfd9d('0x32')]);_0x5c18b8[_0xfd9d('0x34')]=_['intersection'](_0x5c18b8[_0xfd9d('0x31')],_0x5c18b8['query']);_0x28c2dc[_0xfd9d('0x35')]=_[_0xfd9d('0x36')](_0x5c18b8['model'],qs['fields'](_0x1f86b3[_0xfd9d('0x32')][_0xfd9d('0x37')]));_0x28c2dc[_0xfd9d('0x35')]=_0x28c2dc[_0xfd9d('0x35')][_0xfd9d('0x38')]?_0x28c2dc[_0xfd9d('0x35')]:_0x5c18b8[_0xfd9d('0x31')];if(_0x1f86b3['query'][_0xfd9d('0x41')]){_0x28c2dc[_0xfd9d('0x42')]=[{'all':!![]}];}_0x28c2dc=_[_0xfd9d('0x3e')]({},_0x28c2dc,_0x1f86b3[_0xfd9d('0x40')]);return db['SugarcrmField'][_0xfd9d('0x46')](_0x28c2dc)['then'](handleEntityNotFound(_0x38f5d8,null))['then'](respondWithResult(_0x38f5d8,null))[_0xfd9d('0x47')](handleError(_0x38f5d8,null));};exports['create']=function(_0x2d76a6,_0x19f5ee){return db[_0xfd9d('0x2d')][_0xfd9d('0x48')](_0x2d76a6[_0xfd9d('0x49')],{})['then'](respondWithResult(_0x19f5ee,0xc9))['catch'](handleError(_0x19f5ee,null));};exports[_0xfd9d('0x24')]=function(_0x5b7c96,_0x43f92e){if(_0x5b7c96[_0xfd9d('0x49')]['id']){delete _0x5b7c96[_0xfd9d('0x49')]['id'];}return db[_0xfd9d('0x2d')][_0xfd9d('0x46')]({'where':{'id':_0x5b7c96[_0xfd9d('0x45')]['id']}})[_0xfd9d('0x26')](handleEntityNotFound(_0x43f92e,null))['then'](saveUpdates(_0x5b7c96['body'],null))[_0xfd9d('0x26')](respondWithResult(_0x43f92e,null))['catch'](handleError(_0x43f92e,null));};exports[_0xfd9d('0x25')]=function(_0x4a5948,_0xc80f35){return db[_0xfd9d('0x2d')][_0xfd9d('0x46')]({'where':{'id':_0x4a5948['params']['id']}})[_0xfd9d('0x26')](handleEntityNotFound(_0xc80f35,null))[_0xfd9d('0x26')](removeEntity(_0xc80f35,null))['catch'](handleError(_0xc80f35,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.model.js b/server/api/intSugarcrmField/intSugarcrmField.model.js index 6c39d1b..7f39032 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 _0xfc23=['../../config/logger','moment','bluebird','request-promise','../../config/environment','./intSugarcrmField.attributes','exports','SugarcrmField','int_sugarcrm_fields','sugarcrm_unique_index','idField','FieldId','lodash'];(function(_0xaa2d11,_0x216a8c){var _0x5898ca=function(_0x381d27){while(--_0x381d27){_0xaa2d11['push'](_0xaa2d11['shift']());}};_0x5898ca(++_0x216a8c);}(_0xfc23,0x15e));var _0x3fc2=function(_0x48feff,_0x1d5629){_0x48feff=_0x48feff-0x0;var _0x2c61d0=_0xfc23[_0x48feff];return _0x2c61d0;};'use strict';var _=require(_0x3fc2('0x0'));var util=require('util');var logger=require(_0x3fc2('0x1'))('api');var moment=require(_0x3fc2('0x2'));var BPromise=require(_0x3fc2('0x3'));var rp=require(_0x3fc2('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x3fc2('0x5'));var attributes=require(_0x3fc2('0x6'));module[_0x3fc2('0x7')]=function(_0x3938c5,_0x27d408){return _0x3938c5['define'](_0x3fc2('0x8'),attributes,{'tableName':_0x3fc2('0x9'),'paranoid':![],'indexes':[{'name':_0x3fc2('0xa'),'fields':[_0x3fc2('0xb'),_0x3fc2('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x9946=['SugarcrmField','int_sugarcrm_fields','sugarcrm_unique_index','idField','FieldId','lodash','util','bluebird','request-promise','path','rimraf','../../config/environment','./intSugarcrmField.attributes','exports'];(function(_0x249361,_0x2a1e89){var _0x4ebc4a=function(_0x40f8c3){while(--_0x40f8c3){_0x249361['push'](_0x249361['shift']());}};_0x4ebc4a(++_0x2a1e89);}(_0x9946,0x18d));var _0x6994=function(_0x42503c,_0x3d2aa1){_0x42503c=_0x42503c-0x0;var _0x37ab06=_0x9946[_0x42503c];return _0x37ab06;};'use strict';var _=require(_0x6994('0x0'));var util=require(_0x6994('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x6994('0x2'));var rp=require(_0x6994('0x3'));var fs=require('fs');var path=require(_0x6994('0x4'));var rimraf=require(_0x6994('0x5'));var config=require(_0x6994('0x6'));var attributes=require(_0x6994('0x7'));module[_0x6994('0x8')]=function(_0x521d32,_0x868fad){return _0x521d32['define'](_0x6994('0x9'),attributes,{'tableName':_0x6994('0xa'),'paranoid':![],'indexes':[{'name':_0x6994('0xb'),'fields':[_0x6994('0xc'),_0x6994('0xd')],'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 b619976..8a73dd5 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 _0x0aa0=['SugarcrmField,\x20%s,\x20%s,\x20%s','stringify','error','code','SugarcrmField,\x20%s,\x20%s','message','result','catch','lodash','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','request','then','info','request\x20sent'];(function(_0x46ce21,_0x254327){var _0x4901ba=function(_0x528f1c){while(--_0x528f1c){_0x46ce21['push'](_0x46ce21['shift']());}};_0x4901ba(++_0x254327);}(_0x0aa0,0x1e8));var _0x00aa=function(_0xc9a806,_0x4dbaeb){_0xc9a806=_0xc9a806-0x0;var _0x2ecbc7=_0x0aa0[_0xc9a806];return _0x2ecbc7;};'use strict';var _=require(_0x00aa('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x00aa('0x1'));var fs=require('fs');var Redis=require(_0x00aa('0x2'));var db=require(_0x00aa('0x3'))['db'];var utils=require(_0x00aa('0x4'));var logger=require(_0x00aa('0x5'))(_0x00aa('0x6'));var config=require(_0x00aa('0x7'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0xcbed46,_0x5183ce,_0x93fa){return new BPromise(function(_0x416255,_0x374c28){return client[_0x00aa('0x8')](_0xcbed46,_0x93fa)[_0x00aa('0x9')](function(_0xeed76){logger[_0x00aa('0xa')]('SugarcrmField,\x20%s,\x20%s',_0x5183ce,_0x00aa('0xb'));logger['debug'](_0x00aa('0xc'),_0x5183ce,_0x00aa('0xb'),JSON[_0x00aa('0xd')](_0xeed76));if(_0xeed76[_0x00aa('0xe')]){if(_0xeed76[_0x00aa('0xe')][_0x00aa('0xf')]===0x1f4){logger[_0x00aa('0xe')](_0x00aa('0x10'),_0x5183ce,_0xeed76[_0x00aa('0xe')][_0x00aa('0x11')]);return _0x374c28(_0xeed76[_0x00aa('0xe')]['message']);}logger[_0x00aa('0xe')]('SugarcrmField,\x20%s,\x20%s',_0x5183ce,_0xeed76['error'][_0x00aa('0x11')]);return _0x416255(_0xeed76[_0x00aa('0xe')]['message']);}else{logger[_0x00aa('0xa')]('SugarcrmField,\x20%s,\x20%s',_0x5183ce,_0x00aa('0xb'));_0x416255(_0xeed76[_0x00aa('0x12')][_0x00aa('0x11')]);}})[_0x00aa('0x13')](function(_0x4ea6de){logger[_0x00aa('0xe')](_0x00aa('0x10'),_0x5183ce,_0x4ea6de);_0x374c28(_0x4ea6de);});});} \ No newline at end of file +var _0xfbba=['error','code','message','result','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','request','info','SugarcrmField,\x20%s,\x20%s','request\x20sent','SugarcrmField,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x590b63,_0x14debb){var _0x3c9380=function(_0x58fc67){while(--_0x58fc67){_0x590b63['push'](_0x590b63['shift']());}};_0x3c9380(++_0x14debb);}(_0xfbba,0xdc));var _0xafbb=function(_0x5baba0,_0x333d88){_0x5baba0=_0x5baba0-0x0;var _0x2c86e0=_0xfbba[_0x5baba0];return _0x2c86e0;};'use strict';var _=require(_0xafbb('0x0'));var util=require('util');var moment=require(_0xafbb('0x1'));var BPromise=require(_0xafbb('0x2'));var rs=require(_0xafbb('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xafbb('0x4'))['db'];var utils=require(_0xafbb('0x5'));var logger=require(_0xafbb('0x6'))('rpc');var config=require(_0xafbb('0x7'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2ada76,_0x373a81,_0x267601){return new BPromise(function(_0x2cbecd,_0x4a2577){return client[_0xafbb('0x8')](_0x2ada76,_0x267601)['then'](function(_0x479d6b){logger[_0xafbb('0x9')](_0xafbb('0xa'),_0x373a81,_0xafbb('0xb'));logger['debug'](_0xafbb('0xc'),_0x373a81,'request\x20sent',JSON[_0xafbb('0xd')](_0x479d6b));if(_0x479d6b[_0xafbb('0xe')]){if(_0x479d6b[_0xafbb('0xe')][_0xafbb('0xf')]===0x1f4){logger[_0xafbb('0xe')](_0xafbb('0xa'),_0x373a81,_0x479d6b['error'][_0xafbb('0x10')]);return _0x4a2577(_0x479d6b[_0xafbb('0xe')][_0xafbb('0x10')]);}logger['error'](_0xafbb('0xa'),_0x373a81,_0x479d6b[_0xafbb('0xe')][_0xafbb('0x10')]);return _0x2cbecd(_0x479d6b[_0xafbb('0xe')][_0xafbb('0x10')]);}else{logger['info'](_0xafbb('0xa'),_0x373a81,_0xafbb('0xb'));_0x2cbecd(_0x479d6b[_0xafbb('0x11')][_0xafbb('0x10')]);}})['catch'](function(_0x217c52){logger['error'](_0xafbb('0xa'),_0x373a81,_0x217c52);_0x4a2577(_0x217c52);});});} \ No newline at end of file diff --git a/server/api/intVtigerAccount/index.js b/server/api/intVtigerAccount/index.js index 15e951a..5a8ef5f 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 _0xe638=['post','/:id/configurations','addConfiguration','put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../config/environment','get','isAuthenticated','index','/:id','show','getConfigurations','/:id/fields','getFields'];(function(_0x57120e,_0x427d2d){var _0x1539f5=function(_0x5864ed){while(--_0x5864ed){_0x57120e['push'](_0x57120e['shift']());}};_0x1539f5(++_0x427d2d);}(_0xe638,0x92));var _0x8e63=function(_0x589780,_0x4c01f4){_0x589780=_0x589780-0x0;var _0x8715c8=_0xe638[_0x589780];return _0x8715c8;};'use strict';var multer=require(_0x8e63('0x0'));var util=require(_0x8e63('0x1'));var path=require(_0x8e63('0x2'));var timeout=require(_0x8e63('0x3'));var express=require('express');var router=express[_0x8e63('0x4')]();var fs_extra=require(_0x8e63('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x8e63('0x6'));var controller=require('./intVtigerAccount.controller');router[_0x8e63('0x7')]('/',auth[_0x8e63('0x8')](),controller[_0x8e63('0x9')]);router['get'](_0x8e63('0xa'),auth[_0x8e63('0x8')](),controller[_0x8e63('0xb')]);router[_0x8e63('0x7')]('/:id/configurations',auth[_0x8e63('0x8')](),controller[_0x8e63('0xc')]);router[_0x8e63('0x7')](_0x8e63('0xd'),auth[_0x8e63('0x8')](),controller[_0x8e63('0xe')]);router[_0x8e63('0xf')]('/',auth[_0x8e63('0x8')](),controller['create']);router[_0x8e63('0xf')](_0x8e63('0x10'),auth[_0x8e63('0x8')](),controller[_0x8e63('0x11')]);router[_0x8e63('0x12')](_0x8e63('0xa'),auth['isAuthenticated'](),controller[_0x8e63('0x13')]);router[_0x8e63('0x14')]('/:id',auth['isAuthenticated'](),controller[_0x8e63('0x15')]);module[_0x8e63('0x16')]=router; \ No newline at end of file +var _0x117d=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intVtigerAccount.controller','get','isAuthenticated','index','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','/:id','delete','destroy','exports','multer','util','path'];(function(_0x1443eb,_0x203408){var _0x2b8810=function(_0x48bc4e){while(--_0x48bc4e){_0x1443eb['push'](_0x1443eb['shift']());}};_0x2b8810(++_0x203408);}(_0x117d,0xac));var _0xd117=function(_0x5c6244,_0x112ab8){_0x5c6244=_0x5c6244-0x0;var _0x5800ce=_0x117d[_0x5c6244];return _0x5800ce;};'use strict';var multer=require(_0xd117('0x0'));var util=require(_0xd117('0x1'));var path=require(_0xd117('0x2'));var timeout=require('connect-timeout');var express=require(_0xd117('0x3'));var router=express[_0xd117('0x4')]();var fs_extra=require(_0xd117('0x5'));var auth=require(_0xd117('0x6'));var interaction=require(_0xd117('0x7'));var config=require('../../config/environment');var controller=require(_0xd117('0x8'));router[_0xd117('0x9')]('/',auth[_0xd117('0xa')](),controller[_0xd117('0xb')]);router['get']('/:id',auth[_0xd117('0xa')](),controller[_0xd117('0xc')]);router[_0xd117('0x9')](_0xd117('0xd'),auth[_0xd117('0xa')](),controller[_0xd117('0xe')]);router[_0xd117('0x9')](_0xd117('0xf'),auth[_0xd117('0xa')](),controller[_0xd117('0x10')]);router[_0xd117('0x11')]('/',auth[_0xd117('0xa')](),controller[_0xd117('0x12')]);router['post'](_0xd117('0xd'),auth[_0xd117('0xa')](),controller[_0xd117('0x13')]);router[_0xd117('0x14')](_0xd117('0x15'),auth['isAuthenticated'](),controller['update']);router[_0xd117('0x16')]('/:id',auth[_0xd117('0xa')](),controller[_0xd117('0x17')]);module[_0xd117('0x18')]=router; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.attributes.js b/server/api/intVtigerAccount/intVtigerAccount.attributes.js index 62c28c7..76c37ae 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 _0x48ac=['HelpDesk','STRING'];(function(_0x5305f2,_0x180334){var _0x59a8f7=function(_0x30b5d8){while(--_0x30b5d8){_0x5305f2['push'](_0x5305f2['shift']());}};_0x59a8f7(++_0x180334);}(_0x48ac,0x97));var _0xc48a=function(_0x30b9e8,_0x169ec0){_0x30b9e8=_0x30b9e8-0x0;var _0x367bb2=_0x48ac[_0x30b9e8];return _0x367bb2;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xc48a('0x0')],'allowNull':![]},'description':{'type':Sequelize[_0xc48a('0x0')]},'username':{'type':Sequelize[_0xc48a('0x0')],'allowNull':![]},'moduleName':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xc48a('0x1')},'remoteUri':{'type':Sequelize[_0xc48a('0x0')],'allowNull':![]},'serverUrl':{'type':Sequelize[_0xc48a('0x0')],'allowNull':![]},'accessKey':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file +var _0xee2d=['STRING','HelpDesk','sequelize','exports'];(function(_0x818500,_0xe7620c){var _0x342023=function(_0x17c939){while(--_0x17c939){_0x818500['push'](_0x818500['shift']());}};_0x342023(++_0xe7620c);}(_0xee2d,0x1b6));var _0xdee2=function(_0x27a55c,_0x4f9782){_0x27a55c=_0x27a55c-0x0;var _0x164e0=_0xee2d[_0x27a55c];return _0x164e0;};'use strict';var Sequelize=require(_0xdee2('0x0'));module[_0xdee2('0x1')]={'name':{'type':Sequelize[_0xdee2('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xdee2('0x2')]},'username':{'type':Sequelize[_0xdee2('0x2')],'allowNull':![]},'moduleName':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xdee2('0x3')},'remoteUri':{'type':Sequelize[_0xdee2('0x2')],'allowNull':![]},'serverUrl':{'type':Sequelize[_0xdee2('0x2')],'allowNull':![]},'accessKey':{'type':Sequelize[_0xdee2('0x2')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.controller.js b/server/api/intVtigerAccount/intVtigerAccount.controller.js index 4abd806..41a9b18 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 _0xef46=['bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','papaparse','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../components/integrations/configuration','sendStatus','status','json','undefined','count','offset','set','apply','reject','save','then','end','error','name','send','index','map','VtigerAccount','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','VIRTUAL','merge','include','findAll','rows','catch','show','params','includeAll','options','find','create','body','update','destroy','getConfigurations','findOne','VtigerConfiguration','addConfiguration','AccountId','Subjects','getSubjects','Descriptions','channel','md5','getFields','username','description','moduleName','remoteUri','accessKey','slice','substring','lastIndexOf','format','%s/webservice.php','GET','getchallenge','success','POST','login','result','token','describe','sessionName','autogenerated','owner','includes','remove','editable','false','startsWith','cf_','picklist','picklistValues','label','vTiger\x20error:\x20','test','statusCode','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment'];(function(_0x56cdef,_0x39baa8){var _0x356f9a=function(_0x4cf9ac){while(--_0x4cf9ac){_0x56cdef['push'](_0x56cdef['shift']());}};_0x356f9a(++_0x39baa8);}(_0xef46,0x73));var _0x6ef4=function(_0x42245d,_0x51758f){_0x42245d=_0x42245d-0x0;var _0x4b211a=_0xef46[_0x42245d];return _0x4b211a;};'use strict';var emlformat=require(_0x6ef4('0x0'));var rimraf=require(_0x6ef4('0x1'));var zipdir=require(_0x6ef4('0x2'));var jsonpatch=require(_0x6ef4('0x3'));var rp=require(_0x6ef4('0x4'));var moment=require(_0x6ef4('0x5'));var BPromise=require(_0x6ef4('0x6'));var Mustache=require(_0x6ef4('0x7'));var util=require(_0x6ef4('0x8'));var path=require(_0x6ef4('0x9'));var sox=require(_0x6ef4('0xa'));var csv=require(_0x6ef4('0xb'));var ejs=require(_0x6ef4('0xc'));var fs=require('fs');var fs_extra=require(_0x6ef4('0xd'));var _=require('lodash');var squel=require(_0x6ef4('0xe'));var crypto=require('crypto');var jsforce=require(_0x6ef4('0xf'));var deskjs=require(_0x6ef4('0x10'));var toCsv=require(_0x6ef4('0xb'));var querystring=require('querystring');var Papa=require(_0x6ef4('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x6ef4('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6ef4('0x13'));var logger=require(_0x6ef4('0x14'))('api');var utils=require(_0x6ef4('0x15'));var config=require(_0x6ef4('0x16'));var licenseUtil=require(_0x6ef4('0x17'));var db=require('../../mysqldb')['db'];var integrations=require(_0x6ef4('0x18'));function respondWithStatusCode(_0x3aa8ad,_0x3d741e){_0x3d741e=_0x3d741e||0xcc;return function(_0x4e3f5c){if(_0x4e3f5c){return _0x3aa8ad[_0x6ef4('0x19')](_0x3d741e);}return _0x3aa8ad[_0x6ef4('0x1a')](_0x3d741e)['end']();};}function respondWithResult(_0x1510a5,_0x2a20e9){_0x2a20e9=_0x2a20e9||0xc8;return function(_0x1f93cd){if(_0x1f93cd){return _0x1510a5['status'](_0x2a20e9)[_0x6ef4('0x1b')](_0x1f93cd);}};}function respondWithFilteredResult(_0x3f7071,_0x4c1745){return function(_0xa035f7){if(_0xa035f7){var _0x4be657=typeof _0x4c1745['offset']===_0x6ef4('0x1c')&&typeof _0x4c1745['limit']===_0x6ef4('0x1c');var _0x4031cf=_0xa035f7[_0x6ef4('0x1d')];var _0x17ca1a=_0x4be657?0x0:_0x4c1745[_0x6ef4('0x1e')];var _0x4fe7bf=_0x4be657?_0xa035f7[_0x6ef4('0x1d')]:_0x4c1745[_0x6ef4('0x1e')]+_0x4c1745['limit'];var _0x44a63e;if(_0x4fe7bf>=_0x4031cf){_0x4fe7bf=_0x4031cf;_0x44a63e=0xc8;}else{_0x44a63e=0xce;}_0x3f7071['status'](_0x44a63e);return _0x3f7071[_0x6ef4('0x1f')]('Content-Range',_0x17ca1a+'-'+_0x4fe7bf+'/'+_0x4031cf)[_0x6ef4('0x1b')](_0xa035f7);}return null;};}function patchUpdates(_0x1cf93e){return function(_0xdec38e){try{jsonpatch[_0x6ef4('0x20')](_0xdec38e,_0x1cf93e,!![]);}catch(_0xe31b38){return BPromise[_0x6ef4('0x21')](_0xe31b38);}return _0xdec38e[_0x6ef4('0x22')]();};}function saveUpdates(_0x334538,_0x50372a){return function(_0x522413){if(_0x522413){return _0x522413['update'](_0x334538)['then'](function(_0xe45fb4){return _0xe45fb4;});}return null;};}function removeEntity(_0x44cd5c,_0x1474d0){return function(_0x4602b6){if(_0x4602b6){return _0x4602b6['destroy']()[_0x6ef4('0x23')](function(){_0x44cd5c[_0x6ef4('0x1a')](0xcc)[_0x6ef4('0x24')]();});}};}function handleEntityNotFound(_0x14c5c1,_0x266132){return function(_0x50b898){if(!_0x50b898){_0x14c5c1[_0x6ef4('0x19')](0x194);}return _0x50b898;};}function handleError(_0x4a8fec,_0x4530c6){_0x4530c6=_0x4530c6||0x1f4;return function(_0x11d758){logger[_0x6ef4('0x25')](_0x11d758['stack']);if(_0x11d758[_0x6ef4('0x26')]){delete _0x11d758[_0x6ef4('0x26')];}_0x4a8fec[_0x6ef4('0x1a')](_0x4530c6)[_0x6ef4('0x27')](_0x11d758);};}exports[_0x6ef4('0x28')]=function(_0x15e94a,_0x7bbd53){var _0x4c67c6={},_0x5104f0={},_0x22b272={'count':0x0,'rows':[]};var _0x1ab76e=_[_0x6ef4('0x29')](db[_0x6ef4('0x2a')][_0x6ef4('0x2b')],function(_0x12ecb1){return{'name':_0x12ecb1[_0x6ef4('0x2c')],'type':_0x12ecb1[_0x6ef4('0x2d')]['key']};});_0x5104f0[_0x6ef4('0x2e')]=_[_0x6ef4('0x29')](_0x1ab76e,_0x6ef4('0x26'));_0x5104f0[_0x6ef4('0x2f')]=_[_0x6ef4('0x30')](_0x15e94a['query']);_0x5104f0[_0x6ef4('0x31')]=_[_0x6ef4('0x32')](_0x5104f0[_0x6ef4('0x2e')],_0x5104f0[_0x6ef4('0x2f')]);_0x4c67c6['attributes']=_[_0x6ef4('0x32')](_0x5104f0[_0x6ef4('0x2e')],qs[_0x6ef4('0x33')](_0x15e94a[_0x6ef4('0x2f')]['fields']));_0x4c67c6[_0x6ef4('0x34')]=_0x4c67c6[_0x6ef4('0x34')][_0x6ef4('0x35')]?_0x4c67c6[_0x6ef4('0x34')]:_0x5104f0[_0x6ef4('0x2e')];if(!_0x15e94a[_0x6ef4('0x2f')][_0x6ef4('0x36')](_0x6ef4('0x37'))){_0x4c67c6[_0x6ef4('0x38')]=qs[_0x6ef4('0x38')](_0x15e94a[_0x6ef4('0x2f')]['limit']);_0x4c67c6[_0x6ef4('0x1e')]=qs['offset'](_0x15e94a[_0x6ef4('0x2f')]['offset']);}_0x4c67c6[_0x6ef4('0x39')]=qs[_0x6ef4('0x3a')](_0x15e94a[_0x6ef4('0x2f')][_0x6ef4('0x3a')]);_0x4c67c6[_0x6ef4('0x3b')]=qs['filters'](_[_0x6ef4('0x3c')](_0x15e94a[_0x6ef4('0x2f')],_0x5104f0[_0x6ef4('0x31')]),_0x1ab76e);if(_0x15e94a[_0x6ef4('0x2f')][_0x6ef4('0x3d')]){_0x4c67c6['where']=_['merge'](_0x4c67c6[_0x6ef4('0x3b')],{'$or':_['map'](_0x1ab76e,function(_0x3752e1){if(_0x3752e1[_0x6ef4('0x2d')]!==_0x6ef4('0x3e')){var _0x50abf0={};_0x50abf0[_0x3752e1[_0x6ef4('0x26')]]={'$like':'%'+_0x15e94a[_0x6ef4('0x2f')]['filter']+'%'};return _0x50abf0;}})});}_0x4c67c6=_[_0x6ef4('0x3f')]({},_0x4c67c6,_0x15e94a['options']);var _0x15f683={'where':_0x4c67c6[_0x6ef4('0x3b')]};return db[_0x6ef4('0x2a')][_0x6ef4('0x1d')](_0x15f683)['then'](function(_0x3cf522){_0x22b272[_0x6ef4('0x1d')]=_0x3cf522;if(_0x15e94a[_0x6ef4('0x2f')]['includeAll']){_0x4c67c6[_0x6ef4('0x40')]=[{'all':!![]}];}return db[_0x6ef4('0x2a')][_0x6ef4('0x41')](_0x4c67c6);})[_0x6ef4('0x23')](function(_0x154c80){_0x22b272[_0x6ef4('0x42')]=_0x154c80;return _0x22b272;})['then'](respondWithFilteredResult(_0x7bbd53,_0x4c67c6))[_0x6ef4('0x43')](handleError(_0x7bbd53,null));};exports[_0x6ef4('0x44')]=function(_0x151618,_0x179db3){var _0x20705f={'raw':![],'where':{'id':_0x151618[_0x6ef4('0x45')]['id']}},_0x5eda84={};_0x5eda84[_0x6ef4('0x2e')]=_['keys'](db[_0x6ef4('0x2a')][_0x6ef4('0x2b')]);_0x5eda84[_0x6ef4('0x2f')]=_[_0x6ef4('0x30')](_0x151618[_0x6ef4('0x2f')]);_0x5eda84['filters']=_[_0x6ef4('0x32')](_0x5eda84[_0x6ef4('0x2e')],_0x5eda84[_0x6ef4('0x2f')]);_0x20705f[_0x6ef4('0x34')]=_['intersection'](_0x5eda84[_0x6ef4('0x2e')],qs[_0x6ef4('0x33')](_0x151618[_0x6ef4('0x2f')][_0x6ef4('0x33')]));_0x20705f[_0x6ef4('0x34')]=_0x20705f[_0x6ef4('0x34')]['length']?_0x20705f[_0x6ef4('0x34')]:_0x5eda84[_0x6ef4('0x2e')];if(_0x151618[_0x6ef4('0x2f')][_0x6ef4('0x46')]){_0x20705f[_0x6ef4('0x40')]=[{'all':!![]}];}_0x20705f=_[_0x6ef4('0x3f')]({},_0x20705f,_0x151618[_0x6ef4('0x47')]);return db[_0x6ef4('0x2a')][_0x6ef4('0x48')](_0x20705f)[_0x6ef4('0x23')](handleEntityNotFound(_0x179db3,null))['then'](respondWithResult(_0x179db3,null))[_0x6ef4('0x43')](handleError(_0x179db3,null));};exports[_0x6ef4('0x49')]=function(_0x40dda8,_0x271d22){return db['VtigerAccount'][_0x6ef4('0x49')](_0x40dda8[_0x6ef4('0x4a')],{})[_0x6ef4('0x23')](respondWithResult(_0x271d22,0xc9))['catch'](handleError(_0x271d22,null));};exports[_0x6ef4('0x4b')]=function(_0xf76fa9,_0x3aa5cd){if(_0xf76fa9[_0x6ef4('0x4a')]['id']){delete _0xf76fa9[_0x6ef4('0x4a')]['id'];}return db[_0x6ef4('0x2a')][_0x6ef4('0x48')]({'where':{'id':_0xf76fa9[_0x6ef4('0x45')]['id']}})['then'](handleEntityNotFound(_0x3aa5cd,null))[_0x6ef4('0x23')](saveUpdates(_0xf76fa9[_0x6ef4('0x4a')],null))[_0x6ef4('0x23')](respondWithResult(_0x3aa5cd,null))[_0x6ef4('0x43')](handleError(_0x3aa5cd,null));};exports[_0x6ef4('0x4c')]=function(_0x49d196,_0xe1f0b4){return db[_0x6ef4('0x2a')][_0x6ef4('0x48')]({'where':{'id':_0x49d196[_0x6ef4('0x45')]['id']}})[_0x6ef4('0x23')](handleEntityNotFound(_0xe1f0b4,null))['then'](removeEntity(_0xe1f0b4,null))['catch'](handleError(_0xe1f0b4,null));};exports[_0x6ef4('0x4d')]=function(_0x2146a2,_0x2113a3,_0x1ed3e4){var _0x44dc1c={};var _0x15b191={};var _0x2a5dc3;var _0x27b78b;return db[_0x6ef4('0x2a')][_0x6ef4('0x4e')]({'where':{'id':_0x2146a2[_0x6ef4('0x45')]['id']}})[_0x6ef4('0x23')](handleEntityNotFound(_0x2113a3,null))[_0x6ef4('0x23')](function(_0x1fa8c7){if(_0x1fa8c7){_0x2a5dc3=_0x1fa8c7;_0x15b191['model']=_[_0x6ef4('0x30')](db[_0x6ef4('0x4f')]['rawAttributes']);_0x15b191[_0x6ef4('0x2f')]=_[_0x6ef4('0x30')](_0x2146a2[_0x6ef4('0x2f')]);_0x15b191[_0x6ef4('0x31')]=_[_0x6ef4('0x32')](_0x15b191[_0x6ef4('0x2e')],_0x15b191['query']);_0x44dc1c[_0x6ef4('0x34')]=_['intersection'](_0x15b191[_0x6ef4('0x2e')],qs[_0x6ef4('0x33')](_0x2146a2[_0x6ef4('0x2f')]['fields']));_0x44dc1c[_0x6ef4('0x34')]=_0x44dc1c['attributes'][_0x6ef4('0x35')]?_0x44dc1c['attributes']:_0x15b191[_0x6ef4('0x2e')];_0x44dc1c[_0x6ef4('0x39')]=qs[_0x6ef4('0x3a')](_0x2146a2[_0x6ef4('0x2f')][_0x6ef4('0x3a')]);_0x44dc1c['where']=qs[_0x6ef4('0x31')](_[_0x6ef4('0x3c')](_0x2146a2['query'],_0x15b191[_0x6ef4('0x31')]));if(_0x2146a2[_0x6ef4('0x2f')][_0x6ef4('0x3d')]){_0x44dc1c[_0x6ef4('0x3b')]=_['merge'](_0x44dc1c[_0x6ef4('0x3b')],{'$or':_['map'](_0x44dc1c['attributes'],function(_0x3a6181){var _0x382282={};_0x382282[_0x3a6181]={'$like':'%'+_0x2146a2[_0x6ef4('0x2f')][_0x6ef4('0x3d')]+'%'};return _0x382282;})});}_0x44dc1c=_[_0x6ef4('0x3f')]({},_0x44dc1c,_0x2146a2[_0x6ef4('0x47')]);return _0x2a5dc3[_0x6ef4('0x4d')](_0x44dc1c);}})['then'](function(_0x158780){if(_0x158780){_0x27b78b=_0x158780['length'];if(!_0x2146a2[_0x6ef4('0x2f')]['hasOwnProperty'](_0x6ef4('0x37'))){_0x44dc1c[_0x6ef4('0x38')]=qs[_0x6ef4('0x38')](_0x2146a2[_0x6ef4('0x2f')][_0x6ef4('0x38')]);_0x44dc1c[_0x6ef4('0x1e')]=qs[_0x6ef4('0x1e')](_0x2146a2[_0x6ef4('0x2f')]['offset']);}return _0x2a5dc3[_0x6ef4('0x4d')](_0x44dc1c);}})[_0x6ef4('0x23')](function(_0x3712cb){if(_0x3712cb){return _0x3712cb?{'count':_0x27b78b,'rows':_0x3712cb}:null;}})[_0x6ef4('0x23')](respondWithResult(_0x2113a3,null))[_0x6ef4('0x43')](handleError(_0x2113a3,null));};exports[_0x6ef4('0x50')]=function(_0x30a61a,_0x253905,_0x39daed){if(_0x30a61a[_0x6ef4('0x4a')]['id']){delete _0x30a61a[_0x6ef4('0x4a')]['id'];}return db[_0x6ef4('0x2a')][_0x6ef4('0x4e')]({'where':{'id':_0x30a61a['params']['id']}})[_0x6ef4('0x23')](handleEntityNotFound(_0x253905,null))[_0x6ef4('0x23')](function(_0x19e841){if(_0x19e841){_0x30a61a['body'][_0x6ef4('0x51')]=_0x19e841['id'];_0x30a61a[_0x6ef4('0x4a')][_0x6ef4('0x52')]=integrations[_0x6ef4('0x53')](_0x30a61a[_0x6ef4('0x4a')]['channel'],_0x30a61a['body'][_0x6ef4('0x2d')]);_0x30a61a['body'][_0x6ef4('0x54')]=integrations['getDescriptions'](_0x30a61a[_0x6ef4('0x4a')][_0x6ef4('0x55')],_0x30a61a['body'][_0x6ef4('0x2d')]);return db[_0x6ef4('0x4f')]['create'](_0x30a61a[_0x6ef4('0x4a')],{'include':[{'model':db['VtigerField'],'as':'Subjects'},{'model':db['VtigerField'],'as':_0x6ef4('0x54')}]});}return null;})['then'](respondWithResult(_0x253905,null))[_0x6ef4('0x43')](handleError(_0x253905,null));};var md5=require(_0x6ef4('0x56'));exports[_0x6ef4('0x57')]=function(_0x490fc5,_0x372a82,_0x35f0da){var _0x40529e=null;var _0x330fd6=null;var _0x281dff=null;var _0x115174=null;var _0x18bc46='';return db[_0x6ef4('0x2a')]['findOne']({'where':{'id':_0x490fc5['params']['id']},'attributes':['id',_0x6ef4('0x26'),_0x6ef4('0x58'),_0x6ef4('0x59'),_0x6ef4('0x5a'),_0x6ef4('0x5b'),'serverUrl','accessKey']})[_0x6ef4('0x23')](handleEntityNotFound(_0x372a82,null))['then'](function(_0xc49ea3){if(_0xc49ea3){_0x40529e=_0xc49ea3['username'];_0x330fd6=_0xc49ea3[_0x6ef4('0x5c')];_0x281dff=_0xc49ea3[_0x6ef4('0x5a')];_0x18bc46=_0xc49ea3['remoteUri'];var _0x2fa0bf=_0x18bc46[_0x6ef4('0x5d')](-0x1);if(_0x2fa0bf==='/'){_0x18bc46=_0x18bc46[_0x6ef4('0x5e')](0x0,_0x18bc46[_0x6ef4('0x5f')](_0x2fa0bf));}_0x115174=util[_0x6ef4('0x60')](_0x6ef4('0x61'),_0x18bc46);var _0x52465b={'method':_0x6ef4('0x62'),'uri':_0x115174,'qs':{'operation':_0x6ef4('0x63'),'username':_0xc49ea3[_0x6ef4('0x58')]},'json':!![]};return rp(_0x52465b);}})[_0x6ef4('0x23')](function(_0x27d596){if(_0x27d596[_0x6ef4('0x64')]){var _0x2f0e1e={'method':_0x6ef4('0x65'),'uri':_0x115174,'form':{'operation':_0x6ef4('0x66'),'username':_0x40529e,'accessKey':md5(_0x27d596[_0x6ef4('0x67')][_0x6ef4('0x68')]+_0x330fd6)},'json':!![]};return rp(_0x2f0e1e);}})[_0x6ef4('0x23')](function(_0xd98fbf){if(_0xd98fbf['success']){var _0x16f375={'method':_0x6ef4('0x62'),'uri':_0x115174,'qs':{'operation':_0x6ef4('0x69'),'username':_0x40529e,'sessionName':_0xd98fbf[_0x6ef4('0x67')][_0x6ef4('0x6a')],'elementType':_0x281dff},'json':!![]};return rp(_0x16f375);}})[_0x6ef4('0x23')](function(_0x555346){if(_0x555346['success']){var _0x57ee18=[_0x6ef4('0x6b'),'reference',_0x6ef4('0x6c')];_['remove'](_0x555346[_0x6ef4('0x67')][_0x6ef4('0x33')],function(_0x1a2450){return _0x57ee18[_0x6ef4('0x6d')](_0x1a2450['type'][_0x6ef4('0x26')]);});_[_0x6ef4('0x6e')](_0x555346['result'][_0x6ef4('0x33')],function(_0x20d087){return _0x20d087[_0x6ef4('0x6f')]===_0x6ef4('0x70');});return{'count':_0x555346[_0x6ef4('0x67')][_0x6ef4('0x33')][_0x6ef4('0x35')],'rows':_['map'](_0x555346['result']['fields'],function(_0x4bef89){return{'id':_0x4bef89[_0x6ef4('0x26')],'name':_0x4bef89['label'],'custom':_[_0x6ef4('0x71')](_0x4bef89[_0x6ef4('0x26')],_0x6ef4('0x72'))?!![]:![],'options':_0x4bef89[_0x6ef4('0x2d')][_0x6ef4('0x26')]===_0x6ef4('0x73')&&_0x4bef89[_0x6ef4('0x2d')][_0x6ef4('0x74')][_0x6ef4('0x35')]>0x0?_[_0x6ef4('0x29')](_0x4bef89['type'][_0x6ef4('0x74')],function(_0x305517){return{'name':_0x305517[_0x6ef4('0x75')],'value':_0x305517['value']};}):[]};})};}})[_0x6ef4('0x23')](respondWithResult(_0x372a82,null))[_0x6ef4('0x43')](function(_0x2bcd92){console['log'](_0x6ef4('0x76')+_0x2bcd92);var _0x527515=_0x490fc5[_0x6ef4('0x2f')][_0x6ef4('0x77')]?0x1f4:_0x2bcd92[_0x6ef4('0x78')]||0x1f4;logger[_0x6ef4('0x25')]('getFields,\x20%s,\x20%s,\x20%s','getFields',_0x527515,JSON['stringify'](_0x2bcd92));delete _0x2bcd92[_0x6ef4('0x26')];if(_0x527515===0x191){_0x527515=0x190;}_0x372a82[_0x6ef4('0x1a')](_0x527515)[_0x6ef4('0x27')](_0x490fc5[_0x6ef4('0x2f')][_0x6ef4('0x77')]?{'message':'Wrong\x20credentials','statusCode':_0x2bcd92[_0x6ef4('0x78')]}:_0x2bcd92);});}; \ No newline at end of file +var _0x2f5c=['../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','count','set','Content-Range','json','save','update','destroy','then','error','stack','name','send','map','VtigerAccount','rawAttributes','fieldName','type','key','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','pick','filter','where','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','getConfigurations','findOne','VtigerConfiguration','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','VtigerField','md5','getFields','username','description','moduleName','remoteUri','serverUrl','accessKey','substring','%s/webservice.php','GET','getchallenge','success','login','token','describe','result','sessionName','reference','owner','includes','editable','label','startsWith','cf_','picklist','picklistValues','value','log','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','fs-extra','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs'];(function(_0x457ebf,_0x44f4ef){var _0x2b382b=function(_0x80ce3d){while(--_0x80ce3d){_0x457ebf['push'](_0x457ebf['shift']());}};_0x2b382b(++_0x44f4ef);}(_0x2f5c,0x1d2));var _0xc2f5=function(_0x2790d2,_0x3db342){_0x2790d2=_0x2790d2-0x0;var _0x513857=_0x2f5c[_0x2790d2];return _0x513857;};'use strict';var emlformat=require(_0xc2f5('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xc2f5('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xc2f5('0x2'));var moment=require(_0xc2f5('0x3'));var BPromise=require(_0xc2f5('0x4'));var Mustache=require(_0xc2f5('0x5'));var util=require(_0xc2f5('0x6'));var path=require('path');var sox=require(_0xc2f5('0x7'));var csv=require(_0xc2f5('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc2f5('0x9'));var _=require('lodash');var squel=require(_0xc2f5('0xa'));var crypto=require('crypto');var jsforce=require(_0xc2f5('0xb'));var deskjs=require(_0xc2f5('0xc'));var toCsv=require(_0xc2f5('0x8'));var querystring=require(_0xc2f5('0xd'));var Papa=require(_0xc2f5('0xe'));var Redis=require(_0xc2f5('0xf'));var authService=require(_0xc2f5('0x10'));var qs=require(_0xc2f5('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc2f5('0x12'));var logger=require('../../config/logger')(_0xc2f5('0x13'));var utils=require(_0xc2f5('0x14'));var config=require(_0xc2f5('0x15'));var licenseUtil=require(_0xc2f5('0x16'));var db=require(_0xc2f5('0x17'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x1b7c9a,_0x5f3a3c){_0x5f3a3c=_0x5f3a3c||0xcc;return function(_0x5bf3b0){if(_0x5bf3b0){return _0x1b7c9a[_0xc2f5('0x18')](_0x5f3a3c);}return _0x1b7c9a[_0xc2f5('0x19')](_0x5f3a3c)[_0xc2f5('0x1a')]();};}function respondWithResult(_0x7515ae,_0x10a791){_0x10a791=_0x10a791||0xc8;return function(_0x121f38){if(_0x121f38){return _0x7515ae['status'](_0x10a791)['json'](_0x121f38);}};}function respondWithFilteredResult(_0x76ca35,_0x269ae6){return function(_0x2ec8cf){if(_0x2ec8cf){var _0xeeef54=typeof _0x269ae6[_0xc2f5('0x1b')]===_0xc2f5('0x1c')&&typeof _0x269ae6['limit']===_0xc2f5('0x1c');var _0x4ff636=_0x2ec8cf[_0xc2f5('0x1d')];var _0x4684b6=_0xeeef54?0x0:_0x269ae6[_0xc2f5('0x1b')];var _0x5e48a2=_0xeeef54?_0x2ec8cf[_0xc2f5('0x1d')]:_0x269ae6['offset']+_0x269ae6['limit'];var _0x56c68c;if(_0x5e48a2>=_0x4ff636){_0x5e48a2=_0x4ff636;_0x56c68c=0xc8;}else{_0x56c68c=0xce;}_0x76ca35['status'](_0x56c68c);return _0x76ca35[_0xc2f5('0x1e')](_0xc2f5('0x1f'),_0x4684b6+'-'+_0x5e48a2+'/'+_0x4ff636)[_0xc2f5('0x20')](_0x2ec8cf);}return null;};}function patchUpdates(_0x353397){return function(_0x189d0d){try{jsonpatch['apply'](_0x189d0d,_0x353397,!![]);}catch(_0x22215e){return BPromise['reject'](_0x22215e);}return _0x189d0d[_0xc2f5('0x21')]();};}function saveUpdates(_0x4f4528,_0x1ef1ba){return function(_0x19c65c){if(_0x19c65c){return _0x19c65c[_0xc2f5('0x22')](_0x4f4528)['then'](function(_0x5059b2){return _0x5059b2;});}return null;};}function removeEntity(_0x88863b,_0x220c50){return function(_0x1a120a){if(_0x1a120a){return _0x1a120a[_0xc2f5('0x23')]()[_0xc2f5('0x24')](function(){_0x88863b['status'](0xcc)[_0xc2f5('0x1a')]();});}};}function handleEntityNotFound(_0x1b3e47,_0x30d209){return function(_0x236c34){if(!_0x236c34){_0x1b3e47[_0xc2f5('0x18')](0x194);}return _0x236c34;};}function handleError(_0x4a2d87,_0x3dd3c0){_0x3dd3c0=_0x3dd3c0||0x1f4;return function(_0x21c966){logger[_0xc2f5('0x25')](_0x21c966[_0xc2f5('0x26')]);if(_0x21c966[_0xc2f5('0x27')]){delete _0x21c966[_0xc2f5('0x27')];}_0x4a2d87[_0xc2f5('0x19')](_0x3dd3c0)[_0xc2f5('0x28')](_0x21c966);};}exports['index']=function(_0x25e23f,_0x2a259f){var _0x331073={},_0x4ff320={},_0x343005={'count':0x0,'rows':[]};var _0x22a7b1=_[_0xc2f5('0x29')](db[_0xc2f5('0x2a')][_0xc2f5('0x2b')],function(_0x121af1){return{'name':_0x121af1[_0xc2f5('0x2c')],'type':_0x121af1[_0xc2f5('0x2d')][_0xc2f5('0x2e')]};});_0x4ff320['model']=_['map'](_0x22a7b1,_0xc2f5('0x27'));_0x4ff320['query']=_[_0xc2f5('0x2f')](_0x25e23f[_0xc2f5('0x30')]);_0x4ff320[_0xc2f5('0x31')]=_[_0xc2f5('0x32')](_0x4ff320[_0xc2f5('0x33')],_0x4ff320[_0xc2f5('0x30')]);_0x331073[_0xc2f5('0x34')]=_['intersection'](_0x4ff320[_0xc2f5('0x33')],qs[_0xc2f5('0x35')](_0x25e23f[_0xc2f5('0x30')]['fields']));_0x331073[_0xc2f5('0x34')]=_0x331073[_0xc2f5('0x34')][_0xc2f5('0x36')]?_0x331073[_0xc2f5('0x34')]:_0x4ff320[_0xc2f5('0x33')];if(!_0x25e23f[_0xc2f5('0x30')][_0xc2f5('0x37')](_0xc2f5('0x38'))){_0x331073[_0xc2f5('0x39')]=qs[_0xc2f5('0x39')](_0x25e23f['query'][_0xc2f5('0x39')]);_0x331073[_0xc2f5('0x1b')]=qs[_0xc2f5('0x1b')](_0x25e23f[_0xc2f5('0x30')][_0xc2f5('0x1b')]);}_0x331073[_0xc2f5('0x3a')]=qs[_0xc2f5('0x3b')](_0x25e23f[_0xc2f5('0x30')][_0xc2f5('0x3b')]);_0x331073['where']=qs[_0xc2f5('0x31')](_[_0xc2f5('0x3c')](_0x25e23f[_0xc2f5('0x30')],_0x4ff320[_0xc2f5('0x31')]),_0x22a7b1);if(_0x25e23f[_0xc2f5('0x30')][_0xc2f5('0x3d')]){_0x331073[_0xc2f5('0x3e')]=_['merge'](_0x331073[_0xc2f5('0x3e')],{'$or':_[_0xc2f5('0x29')](_0x22a7b1,function(_0x268c72){if(_0x268c72[_0xc2f5('0x2d')]!==_0xc2f5('0x3f')){var _0x460784={};_0x460784[_0x268c72[_0xc2f5('0x27')]]={'$like':'%'+_0x25e23f[_0xc2f5('0x30')][_0xc2f5('0x3d')]+'%'};return _0x460784;}})});}_0x331073=_[_0xc2f5('0x40')]({},_0x331073,_0x25e23f[_0xc2f5('0x41')]);var _0xe2d941={'where':_0x331073[_0xc2f5('0x3e')]};return db['VtigerAccount'][_0xc2f5('0x1d')](_0xe2d941)[_0xc2f5('0x24')](function(_0x2bab85){_0x343005[_0xc2f5('0x1d')]=_0x2bab85;if(_0x25e23f['query'][_0xc2f5('0x42')]){_0x331073[_0xc2f5('0x43')]=[{'all':!![]}];}return db[_0xc2f5('0x2a')][_0xc2f5('0x44')](_0x331073);})[_0xc2f5('0x24')](function(_0x27d2f7){_0x343005[_0xc2f5('0x45')]=_0x27d2f7;return _0x343005;})[_0xc2f5('0x24')](respondWithFilteredResult(_0x2a259f,_0x331073))[_0xc2f5('0x46')](handleError(_0x2a259f,null));};exports[_0xc2f5('0x47')]=function(_0x44c981,_0x507708){var _0x63e8a1={'raw':![],'where':{'id':_0x44c981[_0xc2f5('0x48')]['id']}},_0x255192={};_0x255192[_0xc2f5('0x33')]=_[_0xc2f5('0x2f')](db['VtigerAccount']['rawAttributes']);_0x255192[_0xc2f5('0x30')]=_[_0xc2f5('0x2f')](_0x44c981[_0xc2f5('0x30')]);_0x255192[_0xc2f5('0x31')]=_[_0xc2f5('0x32')](_0x255192[_0xc2f5('0x33')],_0x255192['query']);_0x63e8a1[_0xc2f5('0x34')]=_[_0xc2f5('0x32')](_0x255192[_0xc2f5('0x33')],qs[_0xc2f5('0x35')](_0x44c981[_0xc2f5('0x30')][_0xc2f5('0x35')]));_0x63e8a1['attributes']=_0x63e8a1[_0xc2f5('0x34')]['length']?_0x63e8a1['attributes']:_0x255192['model'];if(_0x44c981['query'][_0xc2f5('0x42')]){_0x63e8a1[_0xc2f5('0x43')]=[{'all':!![]}];}_0x63e8a1=_[_0xc2f5('0x40')]({},_0x63e8a1,_0x44c981[_0xc2f5('0x41')]);return db[_0xc2f5('0x2a')][_0xc2f5('0x49')](_0x63e8a1)[_0xc2f5('0x24')](handleEntityNotFound(_0x507708,null))[_0xc2f5('0x24')](respondWithResult(_0x507708,null))[_0xc2f5('0x46')](handleError(_0x507708,null));};exports[_0xc2f5('0x4a')]=function(_0x4ff8d9,_0x3cb40e){return db[_0xc2f5('0x2a')]['create'](_0x4ff8d9[_0xc2f5('0x4b')],{})[_0xc2f5('0x24')](respondWithResult(_0x3cb40e,0xc9))[_0xc2f5('0x46')](handleError(_0x3cb40e,null));};exports[_0xc2f5('0x22')]=function(_0x4614be,_0x5f1a3e){if(_0x4614be[_0xc2f5('0x4b')]['id']){delete _0x4614be[_0xc2f5('0x4b')]['id'];}return db[_0xc2f5('0x2a')][_0xc2f5('0x49')]({'where':{'id':_0x4614be[_0xc2f5('0x48')]['id']}})[_0xc2f5('0x24')](handleEntityNotFound(_0x5f1a3e,null))[_0xc2f5('0x24')](saveUpdates(_0x4614be[_0xc2f5('0x4b')],null))[_0xc2f5('0x24')](respondWithResult(_0x5f1a3e,null))[_0xc2f5('0x46')](handleError(_0x5f1a3e,null));};exports[_0xc2f5('0x23')]=function(_0x4cca42,_0x3034d7){return db[_0xc2f5('0x2a')][_0xc2f5('0x49')]({'where':{'id':_0x4cca42[_0xc2f5('0x48')]['id']}})['then'](handleEntityNotFound(_0x3034d7,null))[_0xc2f5('0x24')](removeEntity(_0x3034d7,null))['catch'](handleError(_0x3034d7,null));};exports[_0xc2f5('0x4c')]=function(_0x18e19d,_0x4c6057,_0x3adef4){var _0x281f5c={};var _0x3431a4={};var _0x336c1c;var _0x28ce95;return db[_0xc2f5('0x2a')][_0xc2f5('0x4d')]({'where':{'id':_0x18e19d[_0xc2f5('0x48')]['id']}})[_0xc2f5('0x24')](handleEntityNotFound(_0x4c6057,null))[_0xc2f5('0x24')](function(_0x2e802e){if(_0x2e802e){_0x336c1c=_0x2e802e;_0x3431a4[_0xc2f5('0x33')]=_[_0xc2f5('0x2f')](db[_0xc2f5('0x4e')][_0xc2f5('0x2b')]);_0x3431a4[_0xc2f5('0x30')]=_[_0xc2f5('0x2f')](_0x18e19d['query']);_0x3431a4[_0xc2f5('0x31')]=_['intersection'](_0x3431a4[_0xc2f5('0x33')],_0x3431a4['query']);_0x281f5c['attributes']=_[_0xc2f5('0x32')](_0x3431a4[_0xc2f5('0x33')],qs[_0xc2f5('0x35')](_0x18e19d['query'][_0xc2f5('0x35')]));_0x281f5c[_0xc2f5('0x34')]=_0x281f5c[_0xc2f5('0x34')][_0xc2f5('0x36')]?_0x281f5c['attributes']:_0x3431a4[_0xc2f5('0x33')];_0x281f5c['order']=qs['sort'](_0x18e19d[_0xc2f5('0x30')][_0xc2f5('0x3b')]);_0x281f5c[_0xc2f5('0x3e')]=qs[_0xc2f5('0x31')](_['pick'](_0x18e19d[_0xc2f5('0x30')],_0x3431a4[_0xc2f5('0x31')]));if(_0x18e19d[_0xc2f5('0x30')]['filter']){_0x281f5c[_0xc2f5('0x3e')]=_['merge'](_0x281f5c['where'],{'$or':_[_0xc2f5('0x29')](_0x281f5c[_0xc2f5('0x34')],function(_0x187543){var _0x335fda={};_0x335fda[_0x187543]={'$like':'%'+_0x18e19d[_0xc2f5('0x30')][_0xc2f5('0x3d')]+'%'};return _0x335fda;})});}_0x281f5c=_[_0xc2f5('0x40')]({},_0x281f5c,_0x18e19d[_0xc2f5('0x41')]);return _0x336c1c[_0xc2f5('0x4c')](_0x281f5c);}})[_0xc2f5('0x24')](function(_0x3d6564){if(_0x3d6564){_0x28ce95=_0x3d6564[_0xc2f5('0x36')];if(!_0x18e19d[_0xc2f5('0x30')][_0xc2f5('0x37')](_0xc2f5('0x38'))){_0x281f5c[_0xc2f5('0x39')]=qs[_0xc2f5('0x39')](_0x18e19d[_0xc2f5('0x30')]['limit']);_0x281f5c[_0xc2f5('0x1b')]=qs[_0xc2f5('0x1b')](_0x18e19d[_0xc2f5('0x30')][_0xc2f5('0x1b')]);}return _0x336c1c['getConfigurations'](_0x281f5c);}})[_0xc2f5('0x24')](function(_0x3368cf){if(_0x3368cf){return _0x3368cf?{'count':_0x28ce95,'rows':_0x3368cf}:null;}})['then'](respondWithResult(_0x4c6057,null))[_0xc2f5('0x46')](handleError(_0x4c6057,null));};exports[_0xc2f5('0x4f')]=function(_0x2ef921,_0x2d2db9,_0x1d0faf){if(_0x2ef921[_0xc2f5('0x4b')]['id']){delete _0x2ef921[_0xc2f5('0x4b')]['id'];}return db[_0xc2f5('0x2a')]['findOne']({'where':{'id':_0x2ef921['params']['id']}})[_0xc2f5('0x24')](handleEntityNotFound(_0x2d2db9,null))['then'](function(_0x2103b4){if(_0x2103b4){_0x2ef921[_0xc2f5('0x4b')][_0xc2f5('0x50')]=_0x2103b4['id'];_0x2ef921[_0xc2f5('0x4b')][_0xc2f5('0x51')]=integrations[_0xc2f5('0x52')](_0x2ef921[_0xc2f5('0x4b')][_0xc2f5('0x53')],_0x2ef921[_0xc2f5('0x4b')][_0xc2f5('0x2d')]);_0x2ef921[_0xc2f5('0x4b')][_0xc2f5('0x54')]=integrations[_0xc2f5('0x55')](_0x2ef921[_0xc2f5('0x4b')][_0xc2f5('0x53')],_0x2ef921['body'][_0xc2f5('0x2d')]);return db[_0xc2f5('0x4e')]['create'](_0x2ef921[_0xc2f5('0x4b')],{'include':[{'model':db[_0xc2f5('0x56')],'as':_0xc2f5('0x51')},{'model':db[_0xc2f5('0x56')],'as':_0xc2f5('0x54')}]});}return null;})[_0xc2f5('0x24')](respondWithResult(_0x2d2db9,null))[_0xc2f5('0x46')](handleError(_0x2d2db9,null));};var md5=require(_0xc2f5('0x57'));exports[_0xc2f5('0x58')]=function(_0x1476fc,_0x383a2d,_0x8c8bab){var _0x4dafde=null;var _0x537636=null;var _0x1c78a4=null;var _0x5bc008=null;var _0x41859a='';return db[_0xc2f5('0x2a')][_0xc2f5('0x4d')]({'where':{'id':_0x1476fc[_0xc2f5('0x48')]['id']},'attributes':['id',_0xc2f5('0x27'),_0xc2f5('0x59'),_0xc2f5('0x5a'),_0xc2f5('0x5b'),_0xc2f5('0x5c'),_0xc2f5('0x5d'),_0xc2f5('0x5e')]})[_0xc2f5('0x24')](handleEntityNotFound(_0x383a2d,null))[_0xc2f5('0x24')](function(_0x1a842a){if(_0x1a842a){_0x4dafde=_0x1a842a[_0xc2f5('0x59')];_0x537636=_0x1a842a['accessKey'];_0x1c78a4=_0x1a842a['moduleName'];_0x41859a=_0x1a842a[_0xc2f5('0x5c')];var _0xe4122a=_0x41859a['slice'](-0x1);if(_0xe4122a==='/'){_0x41859a=_0x41859a[_0xc2f5('0x5f')](0x0,_0x41859a['lastIndexOf'](_0xe4122a));}_0x5bc008=util['format'](_0xc2f5('0x60'),_0x41859a);var _0x5a9e00={'method':_0xc2f5('0x61'),'uri':_0x5bc008,'qs':{'operation':_0xc2f5('0x62'),'username':_0x1a842a['username']},'json':!![]};return rp(_0x5a9e00);}})[_0xc2f5('0x24')](function(_0x208858){if(_0x208858[_0xc2f5('0x63')]){var _0x2ac98d={'method':'POST','uri':_0x5bc008,'form':{'operation':_0xc2f5('0x64'),'username':_0x4dafde,'accessKey':md5(_0x208858['result'][_0xc2f5('0x65')]+_0x537636)},'json':!![]};return rp(_0x2ac98d);}})[_0xc2f5('0x24')](function(_0x209cb9){if(_0x209cb9[_0xc2f5('0x63')]){var _0x15a25f={'method':'GET','uri':_0x5bc008,'qs':{'operation':_0xc2f5('0x66'),'username':_0x4dafde,'sessionName':_0x209cb9[_0xc2f5('0x67')][_0xc2f5('0x68')],'elementType':_0x1c78a4},'json':!![]};return rp(_0x15a25f);}})['then'](function(_0x1080e1){if(_0x1080e1[_0xc2f5('0x63')]){var _0x2147db=['autogenerated',_0xc2f5('0x69'),_0xc2f5('0x6a')];_['remove'](_0x1080e1[_0xc2f5('0x67')][_0xc2f5('0x35')],function(_0x2bf2a2){return _0x2147db[_0xc2f5('0x6b')](_0x2bf2a2[_0xc2f5('0x2d')]['name']);});_['remove'](_0x1080e1[_0xc2f5('0x67')]['fields'],function(_0x2c6c9a){return _0x2c6c9a[_0xc2f5('0x6c')]==='false';});return{'count':_0x1080e1[_0xc2f5('0x67')][_0xc2f5('0x35')][_0xc2f5('0x36')],'rows':_[_0xc2f5('0x29')](_0x1080e1[_0xc2f5('0x67')][_0xc2f5('0x35')],function(_0x610c01){return{'id':_0x610c01[_0xc2f5('0x27')],'name':_0x610c01[_0xc2f5('0x6d')],'custom':_[_0xc2f5('0x6e')](_0x610c01[_0xc2f5('0x27')],_0xc2f5('0x6f'))?!![]:![],'options':_0x610c01['type'][_0xc2f5('0x27')]===_0xc2f5('0x70')&&_0x610c01[_0xc2f5('0x2d')][_0xc2f5('0x71')][_0xc2f5('0x36')]>0x0?_[_0xc2f5('0x29')](_0x610c01[_0xc2f5('0x2d')][_0xc2f5('0x71')],function(_0x166775){return{'name':_0x166775['label'],'value':_0x166775[_0xc2f5('0x72')]};}):[]};})};}})[_0xc2f5('0x24')](respondWithResult(_0x383a2d,null))[_0xc2f5('0x46')](function(_0x334648){console[_0xc2f5('0x73')]('vTiger\x20error:\x20'+_0x334648);var _0x5967b6=_0x1476fc['query'][_0xc2f5('0x74')]?0x1f4:_0x334648[_0xc2f5('0x75')]||0x1f4;logger[_0xc2f5('0x25')](_0xc2f5('0x76'),_0xc2f5('0x58'),_0x5967b6,JSON[_0xc2f5('0x77')](_0x334648));delete _0x334648[_0xc2f5('0x27')];if(_0x5967b6===0x191){_0x5967b6=0x190;}_0x383a2d[_0xc2f5('0x19')](_0x5967b6)[_0xc2f5('0x28')](_0x1476fc['query'][_0xc2f5('0x74')]?{'message':_0xc2f5('0x78'),'statusCode':_0x334648[_0xc2f5('0x75')]}:_0x334648);});}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.model.js b/server/api/intVtigerAccount/intVtigerAccount.model.js index f5479dd..3c39604 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 _0xd200=['request-promise','path','rimraf','./intVtigerAccount.attributes','exports','define','int_vtiger_accounts','util','../../config/logger','api','moment'];(function(_0x417774,_0x1b95e6){var _0x10015d=function(_0x2526b3){while(--_0x2526b3){_0x417774['push'](_0x417774['shift']());}};_0x10015d(++_0x1b95e6);}(_0xd200,0x1b4));var _0x0d20=function(_0x279d37,_0x14de3f){_0x279d37=_0x279d37-0x0;var _0x530173=_0xd200[_0x279d37];return _0x530173;};'use strict';var _=require('lodash');var util=require(_0x0d20('0x0'));var logger=require(_0x0d20('0x1'))(_0x0d20('0x2'));var moment=require(_0x0d20('0x3'));var BPromise=require('bluebird');var rp=require(_0x0d20('0x4'));var fs=require('fs');var path=require(_0x0d20('0x5'));var rimraf=require(_0x0d20('0x6'));var config=require('../../config/environment');var attributes=require(_0x0d20('0x7'));var integrations=require('../../components/integrations/configuration');module[_0x0d20('0x8')]=function(_0x11efe9,_0x30b9b4){return _0x11efe9[_0x0d20('0x9')]('VtigerAccount',attributes,{'tableName':_0x0d20('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1751=['../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./intVtigerAccount.attributes','../../components/integrations/configuration','exports','define','VtigerAccount','int_vtiger_accounts','lodash','util'];(function(_0x2bc3f4,_0x470b26){var _0x14ac53=function(_0x5121bd){while(--_0x5121bd){_0x2bc3f4['push'](_0x2bc3f4['shift']());}};_0x14ac53(++_0x470b26);}(_0x1751,0x76));var _0x1175=function(_0x1ba47e,_0x34d0cb){_0x1ba47e=_0x1ba47e-0x0;var _0x31085c=_0x1751[_0x1ba47e];return _0x31085c;};'use strict';var _=require(_0x1175('0x0'));var util=require(_0x1175('0x1'));var logger=require(_0x1175('0x2'))(_0x1175('0x3'));var moment=require('moment');var BPromise=require(_0x1175('0x4'));var rp=require(_0x1175('0x5'));var fs=require('fs');var path=require(_0x1175('0x6'));var rimraf=require(_0x1175('0x7'));var config=require(_0x1175('0x8'));var attributes=require(_0x1175('0x9'));var integrations=require(_0x1175('0xa'));module[_0x1175('0xb')]=function(_0x3f99ca,_0x3300e9){return _0x3f99ca[_0x1175('0xc')](_0x1175('0xd'),attributes,{'tableName':_0x1175('0xe'),'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 915593b..b53783c 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 _0x39cb=['request','then','info','VtigerAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','VtigerAccount,\x20%s,\x20%s','message','result','catch','GetVtigerAccount','VtigerAccount','findAll','options','attributes','limit','map','include','model','debug','ShowVtigerAccount','raw','where','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x4bc251,_0x2d1977){var _0x271c53=function(_0x43627c){while(--_0x43627c){_0x4bc251['push'](_0x4bc251['shift']());}};_0x271c53(++_0x2d1977);}(_0x39cb,0x1bd));var _0xb39c=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x39cb[_0xfae23b];return _0x200640;};'use strict';var _=require('lodash');var util=require(_0xb39c('0x0'));var moment=require(_0xb39c('0x1'));var BPromise=require('bluebird');var rs=require(_0xb39c('0x2'));var fs=require('fs');var Redis=require(_0xb39c('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xb39c('0x4'));var logger=require(_0xb39c('0x5'))(_0xb39c('0x6'));var config=require(_0xb39c('0x7'));var jayson=require(_0xb39c('0x8'));var client=jayson['client'][_0xb39c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2fc868,_0x40112f,_0x3f2fbe){return new BPromise(function(_0x47d6d7,_0x5ae14a){return client[_0xb39c('0xa')](_0x2fc868,_0x3f2fbe)[_0xb39c('0xb')](function(_0x3ffb94){logger[_0xb39c('0xc')]('VtigerAccount,\x20%s,\x20%s',_0x40112f,'request\x20sent');logger['debug'](_0xb39c('0xd'),_0x40112f,_0xb39c('0xe'),JSON[_0xb39c('0xf')](_0x3ffb94));if(_0x3ffb94[_0xb39c('0x10')]){if(_0x3ffb94[_0xb39c('0x10')][_0xb39c('0x11')]===0x1f4){logger[_0xb39c('0x10')](_0xb39c('0x12'),_0x40112f,_0x3ffb94['error'][_0xb39c('0x13')]);return _0x5ae14a(_0x3ffb94[_0xb39c('0x10')][_0xb39c('0x13')]);}logger['error'](_0xb39c('0x12'),_0x40112f,_0x3ffb94[_0xb39c('0x10')][_0xb39c('0x13')]);return _0x47d6d7(_0x3ffb94[_0xb39c('0x10')][_0xb39c('0x13')]);}else{logger[_0xb39c('0xc')](_0xb39c('0x12'),_0x40112f,'request\x20sent');_0x47d6d7(_0x3ffb94[_0xb39c('0x14')][_0xb39c('0x13')]);}})[_0xb39c('0x15')](function(_0x1c2c5f){logger[_0xb39c('0x10')](_0xb39c('0x12'),_0x40112f,_0x1c2c5f);_0x5ae14a(_0x1c2c5f);});});}exports[_0xb39c('0x16')]=function(_0x4e02cf){var _0x35dade=this;return new Promise(function(_0x2eeae6,_0x559ad6){return db[_0xb39c('0x17')][_0xb39c('0x18')]({'raw':_0x4e02cf[_0xb39c('0x19')]?_0x4e02cf[_0xb39c('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x4e02cf[_0xb39c('0x19')]?_0x4e02cf[_0xb39c('0x19')]['where']||null:null,'attributes':_0x4e02cf[_0xb39c('0x19')]?_0x4e02cf[_0xb39c('0x19')][_0xb39c('0x1a')]||null:null,'limit':_0x4e02cf['options']?_0x4e02cf['options'][_0xb39c('0x1b')]||null:null,'include':_0x4e02cf[_0xb39c('0x19')]?_0x4e02cf[_0xb39c('0x19')]['include']?_[_0xb39c('0x1c')](_0x4e02cf[_0xb39c('0x19')][_0xb39c('0x1d')],function(_0x16f3b0){return{'model':db[_0x16f3b0[_0xb39c('0x1e')]],'as':_0x16f3b0['as'],'attributes':_0x16f3b0['attributes'],'include':_0x16f3b0[_0xb39c('0x1d')]?_[_0xb39c('0x1c')](_0x16f3b0['include'],function(_0x1fd145){return{'model':db[_0x1fd145[_0xb39c('0x1e')]],'as':_0x1fd145['as'],'attributes':_0x1fd145[_0xb39c('0x1a')],'include':_0x1fd145[_0xb39c('0x1d')]?_[_0xb39c('0x1c')](_0x1fd145['include'],function(_0x23a2f1){return{'model':db[_0x23a2f1[_0xb39c('0x1e')]],'as':_0x23a2f1['as'],'attributes':_0x23a2f1[_0xb39c('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x41fff2){logger[_0xb39c('0xc')]('GetVtigerAccount',_0x4e02cf);logger[_0xb39c('0x1f')](_0xb39c('0x16'),_0x4e02cf,JSON[_0xb39c('0xf')](_0x41fff2));_0x2eeae6(_0x41fff2);})['catch'](function(_0x714d20){logger[_0xb39c('0x10')]('GetVtigerAccount',_0x714d20[_0xb39c('0x13')],_0x4e02cf);_0x559ad6(_0x35dade['error'](0x1f4,_0x714d20[_0xb39c('0x13')]));});});};exports[_0xb39c('0x20')]=function(_0x309697){var _0x7339b4=this;return new Promise(function(_0x17eb7b,_0x52e642){return db[_0xb39c('0x17')]['find']({'raw':_0x309697[_0xb39c('0x19')]?_0x309697['options'][_0xb39c('0x21')]===undefined?!![]:![]:!![],'where':_0x309697[_0xb39c('0x19')]?_0x309697[_0xb39c('0x19')][_0xb39c('0x22')]||null:null,'attributes':_0x309697['options']?_0x309697['options'][_0xb39c('0x1a')]||null:null,'include':_0x309697[_0xb39c('0x19')]?_0x309697['options'][_0xb39c('0x1d')]?_[_0xb39c('0x1c')](_0x309697[_0xb39c('0x19')][_0xb39c('0x1d')],function(_0x14a92f){return{'model':db[_0x14a92f[_0xb39c('0x1e')]],'as':_0x14a92f['as'],'attributes':_0x14a92f[_0xb39c('0x1a')],'include':_0x14a92f[_0xb39c('0x1d')]?_[_0xb39c('0x1c')](_0x14a92f[_0xb39c('0x1d')],function(_0x15882d){return{'model':db[_0x15882d[_0xb39c('0x1e')]],'as':_0x15882d['as'],'attributes':_0x15882d[_0xb39c('0x1a')],'include':_0x15882d[_0xb39c('0x1d')]?_[_0xb39c('0x1c')](_0x15882d[_0xb39c('0x1d')],function(_0x8e5a74){return{'model':db[_0x8e5a74[_0xb39c('0x1e')]],'as':_0x8e5a74['as'],'attributes':_0x8e5a74[_0xb39c('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2c2b40){logger[_0xb39c('0xc')]('ShowVtigerAccount',_0x309697);logger['debug']('ShowVtigerAccount',_0x309697,JSON[_0xb39c('0xf')](_0x2c2b40));_0x17eb7b(_0x2c2b40);})[_0xb39c('0x15')](function(_0xe6bc2e){logger['error'](_0xb39c('0x20'),_0xe6bc2e[_0xb39c('0x13')],_0x309697);_0x52e642(_0x7339b4[_0xb39c('0x10')](0x1f4,_0xe6bc2e[_0xb39c('0x13')]));});});}; \ No newline at end of file +var _0xe1e3=['result','GetVtigerAccount','options','raw','where','attributes','limit','include','model','map','debug','catch','find','ShowVtigerAccount','lodash','util','bluebird','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','request\x20sent','VtigerAccount,\x20%s,\x20%s,\x20%s','stringify','error','VtigerAccount,\x20%s,\x20%s','message','info'];(function(_0x1dce81,_0x1201de){var _0x720aef=function(_0x18ae02){while(--_0x18ae02){_0x1dce81['push'](_0x1dce81['shift']());}};_0x720aef(++_0x1201de);}(_0xe1e3,0x1bb));var _0x3e1e=function(_0x5ecad9,_0x132eb4){_0x5ecad9=_0x5ecad9-0x0;var _0x42c048=_0xe1e3[_0x5ecad9];return _0x42c048;};'use strict';var _=require(_0x3e1e('0x0'));var util=require(_0x3e1e('0x1'));var moment=require('moment');var BPromise=require(_0x3e1e('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3e1e('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x3e1e('0x4'))(_0x3e1e('0x5'));var config=require(_0x3e1e('0x6'));var jayson=require(_0x3e1e('0x7'));var client=jayson[_0x3e1e('0x8')][_0x3e1e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x55cfba,_0x1574e5,_0x13926d){return new BPromise(function(_0x2f0e12,_0xa67e35){return client[_0x3e1e('0xa')](_0x55cfba,_0x13926d)[_0x3e1e('0xb')](function(_0x5e7d1f){logger['info']('VtigerAccount,\x20%s,\x20%s',_0x1574e5,_0x3e1e('0xc'));logger['debug'](_0x3e1e('0xd'),_0x1574e5,_0x3e1e('0xc'),JSON[_0x3e1e('0xe')](_0x5e7d1f));if(_0x5e7d1f['error']){if(_0x5e7d1f[_0x3e1e('0xf')]['code']===0x1f4){logger['error']('VtigerAccount,\x20%s,\x20%s',_0x1574e5,_0x5e7d1f['error']['message']);return _0xa67e35(_0x5e7d1f[_0x3e1e('0xf')]['message']);}logger['error'](_0x3e1e('0x10'),_0x1574e5,_0x5e7d1f[_0x3e1e('0xf')][_0x3e1e('0x11')]);return _0x2f0e12(_0x5e7d1f['error']['message']);}else{logger[_0x3e1e('0x12')](_0x3e1e('0x10'),_0x1574e5,'request\x20sent');_0x2f0e12(_0x5e7d1f[_0x3e1e('0x13')][_0x3e1e('0x11')]);}})['catch'](function(_0x11c07f){logger['error'](_0x3e1e('0x10'),_0x1574e5,_0x11c07f);_0xa67e35(_0x11c07f);});});}exports[_0x3e1e('0x14')]=function(_0x1d786c){var _0x39eaa7=this;return new Promise(function(_0x791ed8,_0x1c181b){return db['VtigerAccount']['findAll']({'raw':_0x1d786c['options']?_0x1d786c[_0x3e1e('0x15')][_0x3e1e('0x16')]===undefined?!![]:![]:!![],'where':_0x1d786c[_0x3e1e('0x15')]?_0x1d786c['options'][_0x3e1e('0x17')]||null:null,'attributes':_0x1d786c['options']?_0x1d786c[_0x3e1e('0x15')][_0x3e1e('0x18')]||null:null,'limit':_0x1d786c[_0x3e1e('0x15')]?_0x1d786c['options'][_0x3e1e('0x19')]||null:null,'include':_0x1d786c[_0x3e1e('0x15')]?_0x1d786c[_0x3e1e('0x15')]['include']?_['map'](_0x1d786c[_0x3e1e('0x15')][_0x3e1e('0x1a')],function(_0x488f9f){return{'model':db[_0x488f9f[_0x3e1e('0x1b')]],'as':_0x488f9f['as'],'attributes':_0x488f9f[_0x3e1e('0x18')],'include':_0x488f9f[_0x3e1e('0x1a')]?_[_0x3e1e('0x1c')](_0x488f9f[_0x3e1e('0x1a')],function(_0x159212){return{'model':db[_0x159212[_0x3e1e('0x1b')]],'as':_0x159212['as'],'attributes':_0x159212[_0x3e1e('0x18')],'include':_0x159212['include']?_['map'](_0x159212[_0x3e1e('0x1a')],function(_0x541ef1){return{'model':db[_0x541ef1['model']],'as':_0x541ef1['as'],'attributes':_0x541ef1['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x1a33bb){logger[_0x3e1e('0x12')]('GetVtigerAccount',_0x1d786c);logger[_0x3e1e('0x1d')]('GetVtigerAccount',_0x1d786c,JSON[_0x3e1e('0xe')](_0x1a33bb));_0x791ed8(_0x1a33bb);})[_0x3e1e('0x1e')](function(_0x53a6ff){logger[_0x3e1e('0xf')](_0x3e1e('0x14'),_0x53a6ff[_0x3e1e('0x11')],_0x1d786c);_0x1c181b(_0x39eaa7['error'](0x1f4,_0x53a6ff[_0x3e1e('0x11')]));});});};exports['ShowVtigerAccount']=function(_0x591c36){var _0x494c75=this;return new Promise(function(_0x39da8d,_0x5b8f95){return db['VtigerAccount'][_0x3e1e('0x1f')]({'raw':_0x591c36[_0x3e1e('0x15')]?_0x591c36[_0x3e1e('0x15')][_0x3e1e('0x16')]===undefined?!![]:![]:!![],'where':_0x591c36[_0x3e1e('0x15')]?_0x591c36['options']['where']||null:null,'attributes':_0x591c36['options']?_0x591c36['options'][_0x3e1e('0x18')]||null:null,'include':_0x591c36[_0x3e1e('0x15')]?_0x591c36[_0x3e1e('0x15')][_0x3e1e('0x1a')]?_[_0x3e1e('0x1c')](_0x591c36[_0x3e1e('0x15')][_0x3e1e('0x1a')],function(_0x431bd5){return{'model':db[_0x431bd5['model']],'as':_0x431bd5['as'],'attributes':_0x431bd5[_0x3e1e('0x18')],'include':_0x431bd5[_0x3e1e('0x1a')]?_['map'](_0x431bd5[_0x3e1e('0x1a')],function(_0x3f4ef3){return{'model':db[_0x3f4ef3[_0x3e1e('0x1b')]],'as':_0x3f4ef3['as'],'attributes':_0x3f4ef3[_0x3e1e('0x18')],'include':_0x3f4ef3['include']?_['map'](_0x3f4ef3[_0x3e1e('0x1a')],function(_0x332f1e){return{'model':db[_0x332f1e['model']],'as':_0x332f1e['as'],'attributes':_0x332f1e[_0x3e1e('0x18')]};}):[]};}):[]};}):[]:[]})[_0x3e1e('0xb')](function(_0x4e9acd){logger[_0x3e1e('0x12')](_0x3e1e('0x20'),_0x591c36);logger[_0x3e1e('0x1d')](_0x3e1e('0x20'),_0x591c36,JSON[_0x3e1e('0xe')](_0x4e9acd));_0x39da8d(_0x4e9acd);})['catch'](function(_0x1da527){logger[_0x3e1e('0xf')](_0x3e1e('0x20'),_0x1da527[_0x3e1e('0x11')],_0x591c36);_0x5b8f95(_0x494c75['error'](0x1f4,_0x1da527[_0x3e1e('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/index.js b/server/api/intVtigerConfiguration/index.js index d3f9231..f554ef7 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 _0x9cff=['fs-extra','../../config/environment','./intVtigerConfiguration.controller','isAuthenticated','index','get','show','/:id/subjects','getSubjects','getDescriptions','post','put','/:id','update','delete','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x22e47a,_0x4ea10c){var _0x15a12a=function(_0x4a097f){while(--_0x4a097f){_0x22e47a['push'](_0x22e47a['shift']());}};_0x15a12a(++_0x4ea10c);}(_0x9cff,0xc0));var _0xf9cf=function(_0x1ee996,_0x2c6998){_0x1ee996=_0x1ee996-0x0;var _0x168bed=_0x9cff[_0x1ee996];return _0x168bed;};'use strict';var multer=require(_0xf9cf('0x0'));var util=require(_0xf9cf('0x1'));var path=require(_0xf9cf('0x2'));var timeout=require(_0xf9cf('0x3'));var express=require(_0xf9cf('0x4'));var router=express[_0xf9cf('0x5')]();var fs_extra=require(_0xf9cf('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xf9cf('0x7'));var controller=require(_0xf9cf('0x8'));router['get']('/',auth[_0xf9cf('0x9')](),controller[_0xf9cf('0xa')]);router[_0xf9cf('0xb')]('/:id',auth[_0xf9cf('0x9')](),controller[_0xf9cf('0xc')]);router[_0xf9cf('0xb')]('/:id/fields',auth[_0xf9cf('0x9')](),controller['getFields']);router[_0xf9cf('0xb')](_0xf9cf('0xd'),auth[_0xf9cf('0x9')](),controller[_0xf9cf('0xe')]);router[_0xf9cf('0xb')]('/:id/descriptions',auth[_0xf9cf('0x9')](),controller[_0xf9cf('0xf')]);router[_0xf9cf('0x10')]('/',auth['isAuthenticated'](),controller['create']);router[_0xf9cf('0x11')](_0xf9cf('0x12'),auth['isAuthenticated'](),controller[_0xf9cf('0x13')]);router[_0xf9cf('0x14')](_0xf9cf('0x12'),auth['isAuthenticated'](),controller['destroy']);module[_0xf9cf('0x15')]=router; \ No newline at end of file +var _0xc1b4=['getDescriptions','post','create','put','update','delete','destroy','exports','multer','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','/:id','get','getFields','/:id/subjects'];(function(_0x1a72f3,_0x217011){var _0x57ef47=function(_0x20123d){while(--_0x20123d){_0x1a72f3['push'](_0x1a72f3['shift']());}};_0x57ef47(++_0x217011);}(_0xc1b4,0xd0));var _0x4c1b=function(_0xd5718d,_0x290e1c){_0xd5718d=_0xd5718d-0x0;var _0x39b1df=_0xc1b4[_0xd5718d];return _0x39b1df;};'use strict';var multer=require(_0x4c1b('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x4c1b('0x1'));var router=express['Router']();var fs_extra=require(_0x4c1b('0x2'));var auth=require(_0x4c1b('0x3'));var interaction=require(_0x4c1b('0x4'));var config=require(_0x4c1b('0x5'));var controller=require('./intVtigerConfiguration.controller');router['get']('/',auth[_0x4c1b('0x6')](),controller[_0x4c1b('0x7')]);router['get'](_0x4c1b('0x8'),auth[_0x4c1b('0x6')](),controller['show']);router[_0x4c1b('0x9')]('/:id/fields',auth[_0x4c1b('0x6')](),controller[_0x4c1b('0xa')]);router[_0x4c1b('0x9')](_0x4c1b('0xb'),auth[_0x4c1b('0x6')](),controller['getSubjects']);router[_0x4c1b('0x9')]('/:id/descriptions',auth[_0x4c1b('0x6')](),controller[_0x4c1b('0xc')]);router[_0x4c1b('0xd')]('/',auth['isAuthenticated'](),controller[_0x4c1b('0xe')]);router[_0x4c1b('0xf')](_0x4c1b('0x8'),auth['isAuthenticated'](),controller[_0x4c1b('0x10')]);router[_0x4c1b('0x11')](_0x4c1b('0x8'),auth['isAuthenticated'](),controller[_0x4c1b('0x12')]);module[_0x4c1b('0x13')]=router; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js index c6751d1..1494367 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 _0xbeae=['exports','STRING','sequelize'];(function(_0x2da2ae,_0x579c83){var _0x29aae1=function(_0x321e46){while(--_0x321e46){_0x2da2ae['push'](_0x2da2ae['shift']());}};_0x29aae1(++_0x579c83);}(_0xbeae,0x1b5));var _0xebea=function(_0x4b0830,_0x2e3b0a){_0x4b0830=_0x4b0830-0x0;var _0x1f53a7=_0xbeae[_0x4b0830];return _0x1f53a7;};'use strict';var Sequelize=require(_0xebea('0x0'));module[_0xebea('0x1')]={'name':{'type':Sequelize[_0xebea('0x2')]},'description':{'type':Sequelize[_0xebea('0x2')]}}; \ No newline at end of file +var _0xf51e=['STRING'];(function(_0x1054fd,_0x693937){var _0x5c2053=function(_0x195db0){while(--_0x195db0){_0x1054fd['push'](_0x1054fd['shift']());}};_0x5c2053(++_0x693937);}(_0xf51e,0xc4));var _0xef51=function(_0x3be9f6,_0x6bf1ac){_0x3be9f6=_0x3be9f6-0x0;var _0x410963=_0xf51e[_0x3be9f6];return _0x410963;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xef51('0x0')]},'description':{'type':Sequelize[_0xef51('0x0')]}}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js index 246958c..4e4bf72 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 _0x10ca=['body','destroy','findOne','VtigerField','order','getFields','getSubjects','getDescriptions','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','limit','count','offset','set','Content-Range','json','save','then','error','stack','name','send','index','map','VtigerConfiguration','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','type','VIRTUAL','merge','options','include','findAll','rows','catch','show','params','find','create'];(function(_0x2f2ff5,_0x453923){var _0x58d4ec=function(_0x1cb114){while(--_0x1cb114){_0x2f2ff5['push'](_0x2f2ff5['shift']());}};_0x58d4ec(++_0x453923);}(_0x10ca,0x1a7));var _0xa10c=function(_0x2f6e1c,_0x41ee8d){_0x2f6e1c=_0x2f6e1c-0x0;var _0x117af8=_0x10ca[_0x2f6e1c];return _0x117af8;};'use strict';var emlformat=require(_0xa10c('0x0'));var rimraf=require(_0xa10c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa10c('0x2'));var rp=require(_0xa10c('0x3'));var moment=require('moment');var BPromise=require(_0xa10c('0x4'));var Mustache=require(_0xa10c('0x5'));var util=require(_0xa10c('0x6'));var path=require(_0xa10c('0x7'));var sox=require(_0xa10c('0x8'));var csv=require(_0xa10c('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa10c('0xa'));var _=require(_0xa10c('0xb'));var squel=require(_0xa10c('0xc'));var crypto=require(_0xa10c('0xd'));var jsforce=require(_0xa10c('0xe'));var deskjs=require(_0xa10c('0xf'));var toCsv=require(_0xa10c('0x9'));var querystring=require(_0xa10c('0x10'));var Papa=require(_0xa10c('0x11'));var Redis=require(_0xa10c('0x12'));var authService=require(_0xa10c('0x13'));var qs=require(_0xa10c('0x14'));var as=require(_0xa10c('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa10c('0x16'))('api');var utils=require(_0xa10c('0x17'));var config=require(_0xa10c('0x18'));var licenseUtil=require(_0xa10c('0x19'));var db=require(_0xa10c('0x1a'))['db'];function respondWithStatusCode(_0x5927f8,_0x521991){_0x521991=_0x521991||0xcc;return function(_0x40d91a){if(_0x40d91a){return _0x5927f8[_0xa10c('0x1b')](_0x521991);}return _0x5927f8[_0xa10c('0x1c')](_0x521991)[_0xa10c('0x1d')]();};}function respondWithResult(_0x5a06e2,_0x741664){_0x741664=_0x741664||0xc8;return function(_0x50fba5){if(_0x50fba5){return _0x5a06e2[_0xa10c('0x1c')](_0x741664)['json'](_0x50fba5);}};}function respondWithFilteredResult(_0x2ef6ba,_0xf3ac9e){return function(_0xa07a08){if(_0xa07a08){var _0x969bd9=typeof _0xf3ac9e['offset']===_0xa10c('0x1e')&&typeof _0xf3ac9e[_0xa10c('0x1f')]==='undefined';var _0x1814c2=_0xa07a08[_0xa10c('0x20')];var _0x1b552b=_0x969bd9?0x0:_0xf3ac9e['offset'];var _0x2af1fa=_0x969bd9?_0xa07a08[_0xa10c('0x20')]:_0xf3ac9e[_0xa10c('0x21')]+_0xf3ac9e[_0xa10c('0x1f')];var _0x1ca56f;if(_0x2af1fa>=_0x1814c2){_0x2af1fa=_0x1814c2;_0x1ca56f=0xc8;}else{_0x1ca56f=0xce;}_0x2ef6ba[_0xa10c('0x1c')](_0x1ca56f);return _0x2ef6ba[_0xa10c('0x22')](_0xa10c('0x23'),_0x1b552b+'-'+_0x2af1fa+'/'+_0x1814c2)[_0xa10c('0x24')](_0xa07a08);}return null;};}function patchUpdates(_0x48b5eb){return function(_0x3cedf7){try{jsonpatch['apply'](_0x3cedf7,_0x48b5eb,!![]);}catch(_0x37497f){return BPromise['reject'](_0x37497f);}return _0x3cedf7[_0xa10c('0x25')]();};}function saveUpdates(_0x34b439,_0x1dbe3d){return function(_0x57d39a){if(_0x57d39a){return _0x57d39a['update'](_0x34b439)[_0xa10c('0x26')](function(_0x24117c){return _0x24117c;});}return null;};}function removeEntity(_0x56ea7c,_0x3cb9fb){return function(_0x43b1c0){if(_0x43b1c0){return _0x43b1c0['destroy']()[_0xa10c('0x26')](function(){_0x56ea7c[_0xa10c('0x1c')](0xcc)[_0xa10c('0x1d')]();});}};}function handleEntityNotFound(_0x50765d,_0x4f5208){return function(_0x5d939e){if(!_0x5d939e){_0x50765d[_0xa10c('0x1b')](0x194);}return _0x5d939e;};}function handleError(_0x42a52b,_0x420baf){_0x420baf=_0x420baf||0x1f4;return function(_0x34a9dc){logger[_0xa10c('0x27')](_0x34a9dc[_0xa10c('0x28')]);if(_0x34a9dc[_0xa10c('0x29')]){delete _0x34a9dc['name'];}_0x42a52b[_0xa10c('0x1c')](_0x420baf)[_0xa10c('0x2a')](_0x34a9dc);};}exports[_0xa10c('0x2b')]=function(_0x5b4c7e,_0x1b990c){var _0x10b3a4={},_0x54642f={},_0x2cdb7f={'count':0x0,'rows':[]};var _0x367f03=_[_0xa10c('0x2c')](db[_0xa10c('0x2d')][_0xa10c('0x2e')],function(_0x4af802){return{'name':_0x4af802[_0xa10c('0x2f')],'type':_0x4af802['type'][_0xa10c('0x30')]};});_0x54642f[_0xa10c('0x31')]=_[_0xa10c('0x2c')](_0x367f03,_0xa10c('0x29'));_0x54642f[_0xa10c('0x32')]=_[_0xa10c('0x33')](_0x5b4c7e[_0xa10c('0x32')]);_0x54642f[_0xa10c('0x34')]=_[_0xa10c('0x35')](_0x54642f[_0xa10c('0x31')],_0x54642f[_0xa10c('0x32')]);_0x10b3a4[_0xa10c('0x36')]=_[_0xa10c('0x35')](_0x54642f[_0xa10c('0x31')],qs[_0xa10c('0x37')](_0x5b4c7e['query']['fields']));_0x10b3a4[_0xa10c('0x36')]=_0x10b3a4[_0xa10c('0x36')][_0xa10c('0x38')]?_0x10b3a4[_0xa10c('0x36')]:_0x54642f[_0xa10c('0x31')];if(!_0x5b4c7e[_0xa10c('0x32')][_0xa10c('0x39')](_0xa10c('0x3a'))){_0x10b3a4[_0xa10c('0x1f')]=qs['limit'](_0x5b4c7e[_0xa10c('0x32')][_0xa10c('0x1f')]);_0x10b3a4[_0xa10c('0x21')]=qs[_0xa10c('0x21')](_0x5b4c7e[_0xa10c('0x32')]['offset']);}_0x10b3a4['order']=qs['sort'](_0x5b4c7e[_0xa10c('0x32')][_0xa10c('0x3b')]);_0x10b3a4[_0xa10c('0x3c')]=qs[_0xa10c('0x34')](_[_0xa10c('0x3d')](_0x5b4c7e[_0xa10c('0x32')],_0x54642f['filters']),_0x367f03);if(_0x5b4c7e[_0xa10c('0x32')][_0xa10c('0x3e')]){_0x10b3a4[_0xa10c('0x3c')]=_['merge'](_0x10b3a4[_0xa10c('0x3c')],{'$or':_[_0xa10c('0x2c')](_0x367f03,function(_0x5b2331){if(_0x5b2331[_0xa10c('0x3f')]!==_0xa10c('0x40')){var _0x4ee9e4={};_0x4ee9e4[_0x5b2331[_0xa10c('0x29')]]={'$like':'%'+_0x5b4c7e[_0xa10c('0x32')][_0xa10c('0x3e')]+'%'};return _0x4ee9e4;}})});}_0x10b3a4=_[_0xa10c('0x41')]({},_0x10b3a4,_0x5b4c7e[_0xa10c('0x42')]);var _0x1f3a25={'where':_0x10b3a4[_0xa10c('0x3c')]};return db[_0xa10c('0x2d')][_0xa10c('0x20')](_0x1f3a25)[_0xa10c('0x26')](function(_0x480b75){_0x2cdb7f[_0xa10c('0x20')]=_0x480b75;if(_0x5b4c7e[_0xa10c('0x32')]['includeAll']){_0x10b3a4[_0xa10c('0x43')]=[{'all':!![]}];}return db[_0xa10c('0x2d')][_0xa10c('0x44')](_0x10b3a4);})['then'](function(_0x835f31){_0x2cdb7f[_0xa10c('0x45')]=_0x835f31;return _0x2cdb7f;})['then'](respondWithFilteredResult(_0x1b990c,_0x10b3a4))[_0xa10c('0x46')](handleError(_0x1b990c,null));};exports[_0xa10c('0x47')]=function(_0x27259f,_0x5e3b41){var _0x5534b7={'raw':![],'where':{'id':_0x27259f[_0xa10c('0x48')]['id']}},_0x39920c={};_0x39920c[_0xa10c('0x31')]=_[_0xa10c('0x33')](db[_0xa10c('0x2d')][_0xa10c('0x2e')]);_0x39920c[_0xa10c('0x32')]=_[_0xa10c('0x33')](_0x27259f['query']);_0x39920c[_0xa10c('0x34')]=_[_0xa10c('0x35')](_0x39920c[_0xa10c('0x31')],_0x39920c[_0xa10c('0x32')]);_0x5534b7[_0xa10c('0x36')]=_[_0xa10c('0x35')](_0x39920c[_0xa10c('0x31')],qs[_0xa10c('0x37')](_0x27259f[_0xa10c('0x32')]['fields']));_0x5534b7['attributes']=_0x5534b7['attributes']['length']?_0x5534b7['attributes']:_0x39920c['model'];if(_0x27259f[_0xa10c('0x32')]['includeAll']){_0x5534b7[_0xa10c('0x43')]=[{'all':!![]}];}_0x5534b7=_[_0xa10c('0x41')]({},_0x5534b7,_0x27259f[_0xa10c('0x42')]);return db[_0xa10c('0x2d')][_0xa10c('0x49')](_0x5534b7)[_0xa10c('0x26')](handleEntityNotFound(_0x5e3b41,null))['then'](respondWithResult(_0x5e3b41,null))[_0xa10c('0x46')](handleError(_0x5e3b41,null));};exports[_0xa10c('0x4a')]=function(_0x175ca4,_0x1d2dd4){return db[_0xa10c('0x2d')][_0xa10c('0x4a')](_0x175ca4['body'],{})[_0xa10c('0x26')](respondWithResult(_0x1d2dd4,0xc9))[_0xa10c('0x46')](handleError(_0x1d2dd4,null));};exports['update']=function(_0x167d80,_0x184da8){if(_0x167d80[_0xa10c('0x4b')]['id']){delete _0x167d80[_0xa10c('0x4b')]['id'];}return db[_0xa10c('0x2d')][_0xa10c('0x49')]({'where':{'id':_0x167d80[_0xa10c('0x48')]['id']}})[_0xa10c('0x26')](handleEntityNotFound(_0x184da8,null))['then'](saveUpdates(_0x167d80[_0xa10c('0x4b')],null))[_0xa10c('0x26')](respondWithResult(_0x184da8,null))[_0xa10c('0x46')](handleError(_0x184da8,null));};exports[_0xa10c('0x4c')]=function(_0x1baa9a,_0x168072){return db[_0xa10c('0x2d')][_0xa10c('0x49')]({'where':{'id':_0x1baa9a[_0xa10c('0x48')]['id']}})[_0xa10c('0x26')](handleEntityNotFound(_0x168072,null))[_0xa10c('0x26')](removeEntity(_0x168072,null))[_0xa10c('0x46')](handleError(_0x168072,null));};exports['getFields']=function(_0x450911,_0x19dccc,_0x4fede0){var _0x4bb0ea={};var _0x45531c={};var _0x1d1fc2;var _0x69731e;return db[_0xa10c('0x2d')][_0xa10c('0x4d')]({'where':{'id':_0x450911[_0xa10c('0x48')]['id']}})[_0xa10c('0x26')](handleEntityNotFound(_0x19dccc,null))['then'](function(_0xd81217){if(_0xd81217){_0x1d1fc2=_0xd81217;_0x45531c[_0xa10c('0x31')]=_[_0xa10c('0x33')](db[_0xa10c('0x4e')][_0xa10c('0x2e')]);_0x45531c[_0xa10c('0x32')]=_[_0xa10c('0x33')](_0x450911[_0xa10c('0x32')]);_0x45531c[_0xa10c('0x34')]=_['intersection'](_0x45531c['model'],_0x45531c['query']);_0x4bb0ea['attributes']=_['intersection'](_0x45531c['model'],qs[_0xa10c('0x37')](_0x450911[_0xa10c('0x32')]['fields']));_0x4bb0ea['attributes']=_0x4bb0ea['attributes'][_0xa10c('0x38')]?_0x4bb0ea[_0xa10c('0x36')]:_0x45531c[_0xa10c('0x31')];_0x4bb0ea[_0xa10c('0x4f')]=qs[_0xa10c('0x3b')](_0x450911[_0xa10c('0x32')][_0xa10c('0x3b')]);_0x4bb0ea[_0xa10c('0x3c')]=qs[_0xa10c('0x34')](_['pick'](_0x450911[_0xa10c('0x32')],_0x45531c['filters']));if(_0x450911[_0xa10c('0x32')][_0xa10c('0x3e')]){_0x4bb0ea[_0xa10c('0x3c')]=_['merge'](_0x4bb0ea[_0xa10c('0x3c')],{'$or':_[_0xa10c('0x2c')](_0x4bb0ea[_0xa10c('0x36')],function(_0x2be051){var _0x54ab7f={};_0x54ab7f[_0x2be051]={'$like':'%'+_0x450911[_0xa10c('0x32')][_0xa10c('0x3e')]+'%'};return _0x54ab7f;})});}_0x4bb0ea=_[_0xa10c('0x41')]({},_0x4bb0ea,_0x450911[_0xa10c('0x42')]);return _0x1d1fc2[_0xa10c('0x50')](_0x4bb0ea);}})[_0xa10c('0x26')](function(_0x2b06df){if(_0x2b06df){_0x69731e=_0x2b06df[_0xa10c('0x38')];if(!_0x450911[_0xa10c('0x32')][_0xa10c('0x39')](_0xa10c('0x3a'))){_0x4bb0ea[_0xa10c('0x1f')]=qs['limit'](_0x450911[_0xa10c('0x32')][_0xa10c('0x1f')]);_0x4bb0ea[_0xa10c('0x21')]=qs[_0xa10c('0x21')](_0x450911[_0xa10c('0x32')][_0xa10c('0x21')]);}return _0x1d1fc2['getFields'](_0x4bb0ea);}})[_0xa10c('0x26')](function(_0x488dc8){if(_0x488dc8){return _0x488dc8?{'count':_0x69731e,'rows':_0x488dc8}:null;}})[_0xa10c('0x26')](respondWithResult(_0x19dccc,null))[_0xa10c('0x46')](handleError(_0x19dccc,null));};exports[_0xa10c('0x51')]=function(_0x38c2b8,_0x156637,_0x335ff9){var _0x56c334={};var _0x1216b5={};var _0x106863;var _0xb3b855;return db[_0xa10c('0x2d')][_0xa10c('0x4d')]({'where':{'id':_0x38c2b8['params']['id']}})[_0xa10c('0x26')](handleEntityNotFound(_0x156637,null))[_0xa10c('0x26')](function(_0x145e7f){if(_0x145e7f){_0x106863=_0x145e7f;_0x1216b5[_0xa10c('0x31')]=_[_0xa10c('0x33')](db[_0xa10c('0x4e')][_0xa10c('0x2e')]);_0x1216b5[_0xa10c('0x32')]=_[_0xa10c('0x33')](_0x38c2b8[_0xa10c('0x32')]);_0x1216b5[_0xa10c('0x34')]=_[_0xa10c('0x35')](_0x1216b5['model'],_0x1216b5[_0xa10c('0x32')]);_0x56c334[_0xa10c('0x36')]=_['intersection'](_0x1216b5[_0xa10c('0x31')],qs[_0xa10c('0x37')](_0x38c2b8['query'][_0xa10c('0x37')]));_0x56c334['attributes']=_0x56c334[_0xa10c('0x36')][_0xa10c('0x38')]?_0x56c334[_0xa10c('0x36')]:_0x1216b5[_0xa10c('0x31')];_0x56c334[_0xa10c('0x4f')]=qs[_0xa10c('0x3b')](_0x38c2b8[_0xa10c('0x32')][_0xa10c('0x3b')]);_0x56c334['where']=qs[_0xa10c('0x34')](_[_0xa10c('0x3d')](_0x38c2b8[_0xa10c('0x32')],_0x1216b5['filters']));if(_0x38c2b8[_0xa10c('0x32')][_0xa10c('0x3e')]){_0x56c334[_0xa10c('0x3c')]=_[_0xa10c('0x41')](_0x56c334['where'],{'$or':_[_0xa10c('0x2c')](_0x56c334[_0xa10c('0x36')],function(_0x3b8552){var _0x3011fe={};_0x3011fe[_0x3b8552]={'$like':'%'+_0x38c2b8[_0xa10c('0x32')][_0xa10c('0x3e')]+'%'};return _0x3011fe;})});}_0x56c334=_[_0xa10c('0x41')]({},_0x56c334,_0x38c2b8['options']);return _0x106863[_0xa10c('0x51')](_0x56c334);}})['then'](function(_0x536462){if(_0x536462){_0xb3b855=_0x536462['length'];if(!_0x38c2b8[_0xa10c('0x32')]['hasOwnProperty'](_0xa10c('0x3a'))){_0x56c334[_0xa10c('0x1f')]=qs['limit'](_0x38c2b8[_0xa10c('0x32')][_0xa10c('0x1f')]);_0x56c334[_0xa10c('0x21')]=qs[_0xa10c('0x21')](_0x38c2b8[_0xa10c('0x32')][_0xa10c('0x21')]);}return _0x106863[_0xa10c('0x51')](_0x56c334);}})[_0xa10c('0x26')](function(_0x2b0671){if(_0x2b0671){return _0x2b0671?{'count':_0xb3b855,'rows':_0x2b0671}:null;}})[_0xa10c('0x26')](respondWithResult(_0x156637,null))['catch'](handleError(_0x156637,null));};exports[_0xa10c('0x52')]=function(_0x93f45b,_0x835add,_0x5e8f4f){var _0x3f5df8={};var _0x25c1a3={};var _0x4cf6fe;var _0x51960b;return db[_0xa10c('0x2d')][_0xa10c('0x4d')]({'where':{'id':_0x93f45b[_0xa10c('0x48')]['id']}})['then'](handleEntityNotFound(_0x835add,null))[_0xa10c('0x26')](function(_0x2bc2fa){if(_0x2bc2fa){_0x4cf6fe=_0x2bc2fa;_0x25c1a3['model']=_[_0xa10c('0x33')](db['VtigerField']['rawAttributes']);_0x25c1a3[_0xa10c('0x32')]=_[_0xa10c('0x33')](_0x93f45b[_0xa10c('0x32')]);_0x25c1a3[_0xa10c('0x34')]=_['intersection'](_0x25c1a3[_0xa10c('0x31')],_0x25c1a3[_0xa10c('0x32')]);_0x3f5df8[_0xa10c('0x36')]=_[_0xa10c('0x35')](_0x25c1a3[_0xa10c('0x31')],qs[_0xa10c('0x37')](_0x93f45b['query'][_0xa10c('0x37')]));_0x3f5df8[_0xa10c('0x36')]=_0x3f5df8[_0xa10c('0x36')][_0xa10c('0x38')]?_0x3f5df8[_0xa10c('0x36')]:_0x25c1a3[_0xa10c('0x31')];_0x3f5df8[_0xa10c('0x4f')]=qs[_0xa10c('0x3b')](_0x93f45b[_0xa10c('0x32')][_0xa10c('0x3b')]);_0x3f5df8[_0xa10c('0x3c')]=qs[_0xa10c('0x34')](_[_0xa10c('0x3d')](_0x93f45b[_0xa10c('0x32')],_0x25c1a3[_0xa10c('0x34')]));if(_0x93f45b[_0xa10c('0x32')][_0xa10c('0x3e')]){_0x3f5df8[_0xa10c('0x3c')]=_[_0xa10c('0x41')](_0x3f5df8[_0xa10c('0x3c')],{'$or':_[_0xa10c('0x2c')](_0x3f5df8[_0xa10c('0x36')],function(_0x34ecc6){var _0x58767a={};_0x58767a[_0x34ecc6]={'$like':'%'+_0x93f45b[_0xa10c('0x32')][_0xa10c('0x3e')]+'%'};return _0x58767a;})});}_0x3f5df8=_[_0xa10c('0x41')]({},_0x3f5df8,_0x93f45b[_0xa10c('0x42')]);return _0x4cf6fe['getDescriptions'](_0x3f5df8);}})['then'](function(_0x48d662){if(_0x48d662){_0x51960b=_0x48d662['length'];if(!_0x93f45b['query'][_0xa10c('0x39')](_0xa10c('0x3a'))){_0x3f5df8[_0xa10c('0x1f')]=qs[_0xa10c('0x1f')](_0x93f45b[_0xa10c('0x32')][_0xa10c('0x1f')]);_0x3f5df8[_0xa10c('0x21')]=qs[_0xa10c('0x21')](_0x93f45b[_0xa10c('0x32')][_0xa10c('0x21')]);}return _0x4cf6fe[_0xa10c('0x52')](_0x3f5df8);}})['then'](function(_0x1aea8e){if(_0x1aea8e){return _0x1aea8e?{'count':_0x51960b,'rows':_0x1aea8e}:null;}})[_0xa10c('0x26')](respondWithResult(_0x835add,null))[_0xa10c('0x46')](handleError(_0x835add,null));}; \ No newline at end of file +var _0x03bc=['count','includeAll','include','findAll','catch','show','params','keys','options','find','create','body','getFields','findOne','VtigerField','hasOwnProperty','nolimit','getSubjects','getDescriptions','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','json','undefined','limit','offset','Content-Range','reject','save','update','then','destroy','status','error','stack','name','index','VtigerConfiguration','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','attributes','fields','length','order','sort','pick','where','merge','VIRTUAL','filter'];(function(_0x179961,_0x3f6411){var _0x2a883d=function(_0x2a5193){while(--_0x2a5193){_0x179961['push'](_0x179961['shift']());}};_0x2a883d(++_0x3f6411);}(_0x03bc,0x1a8));var _0xc03b=function(_0x23c2da,_0x91d2b4){_0x23c2da=_0x23c2da-0x0;var _0x2af7b1=_0x03bc[_0x23c2da];return _0x2af7b1;};'use strict';var emlformat=require(_0xc03b('0x0'));var rimraf=require(_0xc03b('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc03b('0x2'));var rp=require(_0xc03b('0x3'));var moment=require(_0xc03b('0x4'));var BPromise=require(_0xc03b('0x5'));var Mustache=require(_0xc03b('0x6'));var util=require(_0xc03b('0x7'));var path=require('path');var sox=require(_0xc03b('0x8'));var csv=require(_0xc03b('0x9'));var ejs=require(_0xc03b('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc03b('0xb'));var squel=require(_0xc03b('0xc'));var crypto=require('crypto');var jsforce=require(_0xc03b('0xd'));var deskjs=require(_0xc03b('0xe'));var toCsv=require(_0xc03b('0x9'));var querystring=require('querystring');var Papa=require(_0xc03b('0xf'));var Redis=require(_0xc03b('0x10'));var authService=require(_0xc03b('0x11'));var qs=require(_0xc03b('0x12'));var as=require(_0xc03b('0x13'));var hardwareService=require(_0xc03b('0x14'));var logger=require(_0xc03b('0x15'))(_0xc03b('0x16'));var utils=require(_0xc03b('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xc03b('0x18'));var db=require(_0xc03b('0x19'))['db'];function respondWithStatusCode(_0x37b952,_0x51de59){_0x51de59=_0x51de59||0xcc;return function(_0x553559){if(_0x553559){return _0x37b952[_0xc03b('0x1a')](_0x51de59);}return _0x37b952['status'](_0x51de59)['end']();};}function respondWithResult(_0x424e1d,_0x1e716e){_0x1e716e=_0x1e716e||0xc8;return function(_0x4c4a67){if(_0x4c4a67){return _0x424e1d['status'](_0x1e716e)[_0xc03b('0x1b')](_0x4c4a67);}};}function respondWithFilteredResult(_0x49b416,_0x3edfe5){return function(_0x2a643d){if(_0x2a643d){var _0x2ee316=typeof _0x3edfe5['offset']===_0xc03b('0x1c')&&typeof _0x3edfe5[_0xc03b('0x1d')]===_0xc03b('0x1c');var _0x5c9914=_0x2a643d['count'];var _0xad6f2d=_0x2ee316?0x0:_0x3edfe5[_0xc03b('0x1e')];var _0x547f1a=_0x2ee316?_0x2a643d['count']:_0x3edfe5[_0xc03b('0x1e')]+_0x3edfe5['limit'];var _0x2364b0;if(_0x547f1a>=_0x5c9914){_0x547f1a=_0x5c9914;_0x2364b0=0xc8;}else{_0x2364b0=0xce;}_0x49b416['status'](_0x2364b0);return _0x49b416['set'](_0xc03b('0x1f'),_0xad6f2d+'-'+_0x547f1a+'/'+_0x5c9914)[_0xc03b('0x1b')](_0x2a643d);}return null;};}function patchUpdates(_0x366e2f){return function(_0xbb3b55){try{jsonpatch['apply'](_0xbb3b55,_0x366e2f,!![]);}catch(_0x2520dc){return BPromise[_0xc03b('0x20')](_0x2520dc);}return _0xbb3b55[_0xc03b('0x21')]();};}function saveUpdates(_0x2c4ee4,_0x13ff29){return function(_0x5dedda){if(_0x5dedda){return _0x5dedda[_0xc03b('0x22')](_0x2c4ee4)[_0xc03b('0x23')](function(_0x1f648d){return _0x1f648d;});}return null;};}function removeEntity(_0x53f55c,_0x3cc386){return function(_0x2b22e2){if(_0x2b22e2){return _0x2b22e2[_0xc03b('0x24')]()[_0xc03b('0x23')](function(){_0x53f55c[_0xc03b('0x25')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2f7bbe,_0x3e361c){return function(_0x5f00b8){if(!_0x5f00b8){_0x2f7bbe[_0xc03b('0x1a')](0x194);}return _0x5f00b8;};}function handleError(_0x5482a6,_0x200dc9){_0x200dc9=_0x200dc9||0x1f4;return function(_0x32eb2e){logger[_0xc03b('0x26')](_0x32eb2e[_0xc03b('0x27')]);if(_0x32eb2e[_0xc03b('0x28')]){delete _0x32eb2e['name'];}_0x5482a6['status'](_0x200dc9)['send'](_0x32eb2e);};}exports[_0xc03b('0x29')]=function(_0x53c105,_0x28520c){var _0x489e19={},_0x136e23={},_0x2fd22b={'count':0x0,'rows':[]};var _0x36445f=_['map'](db[_0xc03b('0x2a')][_0xc03b('0x2b')],function(_0x137e7c){return{'name':_0x137e7c[_0xc03b('0x2c')],'type':_0x137e7c[_0xc03b('0x2d')][_0xc03b('0x2e')]};});_0x136e23[_0xc03b('0x2f')]=_[_0xc03b('0x30')](_0x36445f,_0xc03b('0x28'));_0x136e23[_0xc03b('0x31')]=_['keys'](_0x53c105[_0xc03b('0x31')]);_0x136e23[_0xc03b('0x32')]=_[_0xc03b('0x33')](_0x136e23[_0xc03b('0x2f')],_0x136e23[_0xc03b('0x31')]);_0x489e19[_0xc03b('0x34')]=_['intersection'](_0x136e23[_0xc03b('0x2f')],qs[_0xc03b('0x35')](_0x53c105['query'][_0xc03b('0x35')]));_0x489e19[_0xc03b('0x34')]=_0x489e19['attributes'][_0xc03b('0x36')]?_0x489e19[_0xc03b('0x34')]:_0x136e23[_0xc03b('0x2f')];if(!_0x53c105[_0xc03b('0x31')]['hasOwnProperty']('nolimit')){_0x489e19[_0xc03b('0x1d')]=qs[_0xc03b('0x1d')](_0x53c105['query'][_0xc03b('0x1d')]);_0x489e19['offset']=qs[_0xc03b('0x1e')](_0x53c105[_0xc03b('0x31')][_0xc03b('0x1e')]);}_0x489e19[_0xc03b('0x37')]=qs[_0xc03b('0x38')](_0x53c105[_0xc03b('0x31')][_0xc03b('0x38')]);_0x489e19['where']=qs[_0xc03b('0x32')](_[_0xc03b('0x39')](_0x53c105[_0xc03b('0x31')],_0x136e23[_0xc03b('0x32')]),_0x36445f);if(_0x53c105[_0xc03b('0x31')]['filter']){_0x489e19[_0xc03b('0x3a')]=_[_0xc03b('0x3b')](_0x489e19['where'],{'$or':_[_0xc03b('0x30')](_0x36445f,function(_0x4a9c13){if(_0x4a9c13[_0xc03b('0x2d')]!==_0xc03b('0x3c')){var _0x574a48={};_0x574a48[_0x4a9c13[_0xc03b('0x28')]]={'$like':'%'+_0x53c105[_0xc03b('0x31')][_0xc03b('0x3d')]+'%'};return _0x574a48;}})});}_0x489e19=_[_0xc03b('0x3b')]({},_0x489e19,_0x53c105['options']);var _0x3f4f6c={'where':_0x489e19[_0xc03b('0x3a')]};return db[_0xc03b('0x2a')][_0xc03b('0x3e')](_0x3f4f6c)[_0xc03b('0x23')](function(_0x3c0842){_0x2fd22b[_0xc03b('0x3e')]=_0x3c0842;if(_0x53c105[_0xc03b('0x31')][_0xc03b('0x3f')]){_0x489e19[_0xc03b('0x40')]=[{'all':!![]}];}return db['VtigerConfiguration'][_0xc03b('0x41')](_0x489e19);})[_0xc03b('0x23')](function(_0x2a7045){_0x2fd22b['rows']=_0x2a7045;return _0x2fd22b;})[_0xc03b('0x23')](respondWithFilteredResult(_0x28520c,_0x489e19))[_0xc03b('0x42')](handleError(_0x28520c,null));};exports[_0xc03b('0x43')]=function(_0x86e8e3,_0x245d8f){var _0xf03542={'raw':![],'where':{'id':_0x86e8e3[_0xc03b('0x44')]['id']}},_0x1c9b15={};_0x1c9b15['model']=_['keys'](db[_0xc03b('0x2a')]['rawAttributes']);_0x1c9b15[_0xc03b('0x31')]=_[_0xc03b('0x45')](_0x86e8e3['query']);_0x1c9b15[_0xc03b('0x32')]=_[_0xc03b('0x33')](_0x1c9b15[_0xc03b('0x2f')],_0x1c9b15['query']);_0xf03542[_0xc03b('0x34')]=_[_0xc03b('0x33')](_0x1c9b15[_0xc03b('0x2f')],qs[_0xc03b('0x35')](_0x86e8e3[_0xc03b('0x31')][_0xc03b('0x35')]));_0xf03542['attributes']=_0xf03542[_0xc03b('0x34')][_0xc03b('0x36')]?_0xf03542['attributes']:_0x1c9b15[_0xc03b('0x2f')];if(_0x86e8e3[_0xc03b('0x31')][_0xc03b('0x3f')]){_0xf03542[_0xc03b('0x40')]=[{'all':!![]}];}_0xf03542=_[_0xc03b('0x3b')]({},_0xf03542,_0x86e8e3[_0xc03b('0x46')]);return db[_0xc03b('0x2a')][_0xc03b('0x47')](_0xf03542)['then'](handleEntityNotFound(_0x245d8f,null))[_0xc03b('0x23')](respondWithResult(_0x245d8f,null))[_0xc03b('0x42')](handleError(_0x245d8f,null));};exports[_0xc03b('0x48')]=function(_0x5f27b9,_0x15abcf){return db[_0xc03b('0x2a')][_0xc03b('0x48')](_0x5f27b9[_0xc03b('0x49')],{})['then'](respondWithResult(_0x15abcf,0xc9))[_0xc03b('0x42')](handleError(_0x15abcf,null));};exports[_0xc03b('0x22')]=function(_0x195a96,_0x2f869e){if(_0x195a96[_0xc03b('0x49')]['id']){delete _0x195a96['body']['id'];}return db[_0xc03b('0x2a')][_0xc03b('0x47')]({'where':{'id':_0x195a96[_0xc03b('0x44')]['id']}})['then'](handleEntityNotFound(_0x2f869e,null))[_0xc03b('0x23')](saveUpdates(_0x195a96['body'],null))[_0xc03b('0x23')](respondWithResult(_0x2f869e,null))[_0xc03b('0x42')](handleError(_0x2f869e,null));};exports['destroy']=function(_0xfb659a,_0x8743b0){return db[_0xc03b('0x2a')][_0xc03b('0x47')]({'where':{'id':_0xfb659a['params']['id']}})[_0xc03b('0x23')](handleEntityNotFound(_0x8743b0,null))[_0xc03b('0x23')](removeEntity(_0x8743b0,null))['catch'](handleError(_0x8743b0,null));};exports[_0xc03b('0x4a')]=function(_0x248815,_0x4bc068,_0x26e548){var _0x467f66={};var _0x270fac={};var _0x4638cb;var _0x54d87e;return db[_0xc03b('0x2a')][_0xc03b('0x4b')]({'where':{'id':_0x248815['params']['id']}})['then'](handleEntityNotFound(_0x4bc068,null))['then'](function(_0x339290){if(_0x339290){_0x4638cb=_0x339290;_0x270fac[_0xc03b('0x2f')]=_[_0xc03b('0x45')](db[_0xc03b('0x4c')][_0xc03b('0x2b')]);_0x270fac[_0xc03b('0x31')]=_[_0xc03b('0x45')](_0x248815[_0xc03b('0x31')]);_0x270fac[_0xc03b('0x32')]=_[_0xc03b('0x33')](_0x270fac[_0xc03b('0x2f')],_0x270fac[_0xc03b('0x31')]);_0x467f66[_0xc03b('0x34')]=_['intersection'](_0x270fac['model'],qs['fields'](_0x248815[_0xc03b('0x31')][_0xc03b('0x35')]));_0x467f66['attributes']=_0x467f66[_0xc03b('0x34')]['length']?_0x467f66[_0xc03b('0x34')]:_0x270fac[_0xc03b('0x2f')];_0x467f66[_0xc03b('0x37')]=qs[_0xc03b('0x38')](_0x248815[_0xc03b('0x31')][_0xc03b('0x38')]);_0x467f66['where']=qs['filters'](_[_0xc03b('0x39')](_0x248815[_0xc03b('0x31')],_0x270fac[_0xc03b('0x32')]));if(_0x248815[_0xc03b('0x31')]['filter']){_0x467f66['where']=_[_0xc03b('0x3b')](_0x467f66['where'],{'$or':_[_0xc03b('0x30')](_0x467f66[_0xc03b('0x34')],function(_0x5c1309){var _0x139049={};_0x139049[_0x5c1309]={'$like':'%'+_0x248815[_0xc03b('0x31')][_0xc03b('0x3d')]+'%'};return _0x139049;})});}_0x467f66=_['merge']({},_0x467f66,_0x248815[_0xc03b('0x46')]);return _0x4638cb['getFields'](_0x467f66);}})[_0xc03b('0x23')](function(_0x3a5403){if(_0x3a5403){_0x54d87e=_0x3a5403[_0xc03b('0x36')];if(!_0x248815['query'][_0xc03b('0x4d')](_0xc03b('0x4e'))){_0x467f66[_0xc03b('0x1d')]=qs['limit'](_0x248815[_0xc03b('0x31')][_0xc03b('0x1d')]);_0x467f66['offset']=qs[_0xc03b('0x1e')](_0x248815[_0xc03b('0x31')]['offset']);}return _0x4638cb[_0xc03b('0x4a')](_0x467f66);}})[_0xc03b('0x23')](function(_0x5e2526){if(_0x5e2526){return _0x5e2526?{'count':_0x54d87e,'rows':_0x5e2526}:null;}})[_0xc03b('0x23')](respondWithResult(_0x4bc068,null))[_0xc03b('0x42')](handleError(_0x4bc068,null));};exports[_0xc03b('0x4f')]=function(_0x487078,_0x36cb38,_0xe0301){var _0x3feab9={};var _0x615b93={};var _0x5a1675;var _0x2b61a3;return db[_0xc03b('0x2a')][_0xc03b('0x4b')]({'where':{'id':_0x487078['params']['id']}})[_0xc03b('0x23')](handleEntityNotFound(_0x36cb38,null))[_0xc03b('0x23')](function(_0x2518a0){if(_0x2518a0){_0x5a1675=_0x2518a0;_0x615b93[_0xc03b('0x2f')]=_[_0xc03b('0x45')](db[_0xc03b('0x4c')]['rawAttributes']);_0x615b93[_0xc03b('0x31')]=_[_0xc03b('0x45')](_0x487078[_0xc03b('0x31')]);_0x615b93[_0xc03b('0x32')]=_[_0xc03b('0x33')](_0x615b93['model'],_0x615b93[_0xc03b('0x31')]);_0x3feab9[_0xc03b('0x34')]=_[_0xc03b('0x33')](_0x615b93[_0xc03b('0x2f')],qs[_0xc03b('0x35')](_0x487078[_0xc03b('0x31')]['fields']));_0x3feab9[_0xc03b('0x34')]=_0x3feab9[_0xc03b('0x34')][_0xc03b('0x36')]?_0x3feab9[_0xc03b('0x34')]:_0x615b93[_0xc03b('0x2f')];_0x3feab9['order']=qs[_0xc03b('0x38')](_0x487078[_0xc03b('0x31')][_0xc03b('0x38')]);_0x3feab9[_0xc03b('0x3a')]=qs[_0xc03b('0x32')](_['pick'](_0x487078[_0xc03b('0x31')],_0x615b93['filters']));if(_0x487078[_0xc03b('0x31')][_0xc03b('0x3d')]){_0x3feab9['where']=_[_0xc03b('0x3b')](_0x3feab9[_0xc03b('0x3a')],{'$or':_[_0xc03b('0x30')](_0x3feab9['attributes'],function(_0x35fb3d){var _0x1bcf07={};_0x1bcf07[_0x35fb3d]={'$like':'%'+_0x487078['query'][_0xc03b('0x3d')]+'%'};return _0x1bcf07;})});}_0x3feab9=_[_0xc03b('0x3b')]({},_0x3feab9,_0x487078[_0xc03b('0x46')]);return _0x5a1675[_0xc03b('0x4f')](_0x3feab9);}})['then'](function(_0x23a2b6){if(_0x23a2b6){_0x2b61a3=_0x23a2b6[_0xc03b('0x36')];if(!_0x487078['query'][_0xc03b('0x4d')](_0xc03b('0x4e'))){_0x3feab9[_0xc03b('0x1d')]=qs['limit'](_0x487078[_0xc03b('0x31')][_0xc03b('0x1d')]);_0x3feab9['offset']=qs[_0xc03b('0x1e')](_0x487078[_0xc03b('0x31')][_0xc03b('0x1e')]);}return _0x5a1675[_0xc03b('0x4f')](_0x3feab9);}})[_0xc03b('0x23')](function(_0x4a3697){if(_0x4a3697){return _0x4a3697?{'count':_0x2b61a3,'rows':_0x4a3697}:null;}})[_0xc03b('0x23')](respondWithResult(_0x36cb38,null))[_0xc03b('0x42')](handleError(_0x36cb38,null));};exports[_0xc03b('0x50')]=function(_0x16f51c,_0x1059c6,_0x3a7cbe){var _0x179b0c={};var _0x7d0b9={};var _0x5609de;var _0x38dc19;return db[_0xc03b('0x2a')][_0xc03b('0x4b')]({'where':{'id':_0x16f51c[_0xc03b('0x44')]['id']}})[_0xc03b('0x23')](handleEntityNotFound(_0x1059c6,null))['then'](function(_0x2f851a){if(_0x2f851a){_0x5609de=_0x2f851a;_0x7d0b9[_0xc03b('0x2f')]=_['keys'](db['VtigerField'][_0xc03b('0x2b')]);_0x7d0b9[_0xc03b('0x31')]=_[_0xc03b('0x45')](_0x16f51c['query']);_0x7d0b9[_0xc03b('0x32')]=_[_0xc03b('0x33')](_0x7d0b9[_0xc03b('0x2f')],_0x7d0b9[_0xc03b('0x31')]);_0x179b0c[_0xc03b('0x34')]=_[_0xc03b('0x33')](_0x7d0b9[_0xc03b('0x2f')],qs[_0xc03b('0x35')](_0x16f51c[_0xc03b('0x31')][_0xc03b('0x35')]));_0x179b0c[_0xc03b('0x34')]=_0x179b0c[_0xc03b('0x34')][_0xc03b('0x36')]?_0x179b0c[_0xc03b('0x34')]:_0x7d0b9[_0xc03b('0x2f')];_0x179b0c['order']=qs[_0xc03b('0x38')](_0x16f51c[_0xc03b('0x31')][_0xc03b('0x38')]);_0x179b0c[_0xc03b('0x3a')]=qs[_0xc03b('0x32')](_[_0xc03b('0x39')](_0x16f51c[_0xc03b('0x31')],_0x7d0b9[_0xc03b('0x32')]));if(_0x16f51c[_0xc03b('0x31')][_0xc03b('0x3d')]){_0x179b0c[_0xc03b('0x3a')]=_['merge'](_0x179b0c[_0xc03b('0x3a')],{'$or':_[_0xc03b('0x30')](_0x179b0c['attributes'],function(_0xb35a1d){var _0xfa0254={};_0xfa0254[_0xb35a1d]={'$like':'%'+_0x16f51c[_0xc03b('0x31')][_0xc03b('0x3d')]+'%'};return _0xfa0254;})});}_0x179b0c=_[_0xc03b('0x3b')]({},_0x179b0c,_0x16f51c[_0xc03b('0x46')]);return _0x5609de[_0xc03b('0x50')](_0x179b0c);}})[_0xc03b('0x23')](function(_0xdaf737){if(_0xdaf737){_0x38dc19=_0xdaf737['length'];if(!_0x16f51c['query'][_0xc03b('0x4d')](_0xc03b('0x4e'))){_0x179b0c[_0xc03b('0x1d')]=qs[_0xc03b('0x1d')](_0x16f51c[_0xc03b('0x31')][_0xc03b('0x1d')]);_0x179b0c[_0xc03b('0x1e')]=qs[_0xc03b('0x1e')](_0x16f51c[_0xc03b('0x31')][_0xc03b('0x1e')]);}return _0x5609de[_0xc03b('0x50')](_0x179b0c);}})['then'](function(_0x454684){if(_0x454684){return _0x454684?{'count':_0x38dc19,'rows':_0x454684}:null;}})[_0xc03b('0x23')](respondWithResult(_0x1059c6,null))['catch'](handleError(_0x1059c6,null));}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js index a2d86d4..15cfbbe 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 _0x5298=['../../config/environment','./intVtigerConfiguration.attributes','exports','define','VtigerConfiguration','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x47b58b,_0x41a189){var _0x46bebe=function(_0x22bbfa){while(--_0x22bbfa){_0x47b58b['push'](_0x47b58b['shift']());}};_0x46bebe(++_0x41a189);}(_0x5298,0x13d));var _0x8529=function(_0x3c6e0c,_0x2b07d5){_0x3c6e0c=_0x3c6e0c-0x0;var _0x59672b=_0x5298[_0x3c6e0c];return _0x59672b;};'use strict';var _=require(_0x8529('0x0'));var util=require(_0x8529('0x1'));var logger=require(_0x8529('0x2'))(_0x8529('0x3'));var moment=require(_0x8529('0x4'));var BPromise=require(_0x8529('0x5'));var rp=require(_0x8529('0x6'));var fs=require('fs');var path=require(_0x8529('0x7'));var rimraf=require('rimraf');var config=require(_0x8529('0x8'));var attributes=require(_0x8529('0x9'));module[_0x8529('0xa')]=function(_0x44d597,_0xff4643){return _0x44d597[_0x8529('0xb')](_0x8529('0xc'),attributes,{'tableName':'int_vtiger_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbc5b=['api','request-promise','path','./intVtigerConfiguration.attributes','exports','VtigerConfiguration','int_vtiger_configurations','lodash','util'];(function(_0xb2c6b9,_0x2be6ea){var _0x2b1e0e=function(_0x378d9c){while(--_0x378d9c){_0xb2c6b9['push'](_0xb2c6b9['shift']());}};_0x2b1e0e(++_0x2be6ea);}(_0xbc5b,0x130));var _0xbbc5=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0xbc5b[_0x21a9d9];return _0x46adce;};'use strict';var _=require(_0xbbc5('0x0'));var util=require(_0xbbc5('0x1'));var logger=require('../../config/logger')(_0xbbc5('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xbbc5('0x3'));var fs=require('fs');var path=require(_0xbbc5('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xbbc5('0x5'));module[_0xbbc5('0x6')]=function(_0x30f1e6,_0xdd6397){return _0x30f1e6['define'](_0xbbc5('0x7'),attributes,{'tableName':_0xbbc5('0x8'),'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 e799803..4637068 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 _0x8005=['info','request\x20sent','debug','VtigerConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','VtigerConfiguration,\x20%s,\x20%s','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x93b2c4,_0x5cbcad){var _0x391ee1=function(_0x4cf587){while(--_0x4cf587){_0x93b2c4['push'](_0x93b2c4['shift']());}};_0x391ee1(++_0x5cbcad);}(_0x8005,0x19b));var _0x5800=function(_0x4a8bad,_0x4bfb2f){_0x4a8bad=_0x4a8bad-0x0;var _0x30cf32=_0x8005[_0x4a8bad];return _0x30cf32;};'use strict';var _=require(_0x5800('0x0'));var util=require(_0x5800('0x1'));var moment=require('moment');var BPromise=require(_0x5800('0x2'));var rs=require(_0x5800('0x3'));var fs=require('fs');var Redis=require(_0x5800('0x4'));var db=require(_0x5800('0x5'))['db'];var utils=require(_0x5800('0x6'));var logger=require('../../config/logger')(_0x5800('0x7'));var config=require(_0x5800('0x8'));var jayson=require(_0x5800('0x9'));var client=jayson[_0x5800('0xa')][_0x5800('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2a2a8d,_0xd7df52,_0x38cf10){return new BPromise(function(_0x223fde,_0x860154){return client[_0x5800('0xc')](_0x2a2a8d,_0x38cf10)[_0x5800('0xd')](function(_0x3c2eef){logger[_0x5800('0xe')]('VtigerConfiguration,\x20%s,\x20%s',_0xd7df52,_0x5800('0xf'));logger[_0x5800('0x10')](_0x5800('0x11'),_0xd7df52,_0x5800('0xf'),JSON[_0x5800('0x12')](_0x3c2eef));if(_0x3c2eef[_0x5800('0x13')]){if(_0x3c2eef['error'][_0x5800('0x14')]===0x1f4){logger[_0x5800('0x13')](_0x5800('0x15'),_0xd7df52,_0x3c2eef[_0x5800('0x13')][_0x5800('0x16')]);return _0x860154(_0x3c2eef['error'][_0x5800('0x16')]);}logger[_0x5800('0x13')]('VtigerConfiguration,\x20%s,\x20%s',_0xd7df52,_0x3c2eef['error']['message']);return _0x223fde(_0x3c2eef['error'][_0x5800('0x16')]);}else{logger[_0x5800('0xe')](_0x5800('0x15'),_0xd7df52,_0x5800('0xf'));_0x223fde(_0x3c2eef[_0x5800('0x17')][_0x5800('0x16')]);}})[_0x5800('0x18')](function(_0x4713c2){logger[_0x5800('0x13')](_0x5800('0x15'),_0xd7df52,_0x4713c2);_0x860154(_0x4713c2);});});} \ No newline at end of file +var _0x1878=['util','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','request\x20sent','debug','VtigerConfiguration,\x20%s,\x20%s,\x20%s','error','code','VtigerConfiguration,\x20%s,\x20%s','message','catch'];(function(_0x433a86,_0x175b5c){var _0x23000c=function(_0x4b1fa0){while(--_0x4b1fa0){_0x433a86['push'](_0x433a86['shift']());}};_0x23000c(++_0x175b5c);}(_0x1878,0x8c));var _0x8187=function(_0x40d291,_0x5c4273){_0x40d291=_0x40d291-0x0;var _0x387421=_0x1878[_0x40d291];return _0x387421;};'use strict';var _=require('lodash');var util=require(_0x8187('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x8187('0x1'));var fs=require('fs');var Redis=require(_0x8187('0x2'));var db=require(_0x8187('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x8187('0x4'))(_0x8187('0x5'));var config=require(_0x8187('0x6'));var jayson=require(_0x8187('0x7'));var client=jayson[_0x8187('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0xb95ae9,_0x1db70b,_0x522939){return new BPromise(function(_0x34e148,_0x1b33f8){return client[_0x8187('0x9')](_0xb95ae9,_0x522939)[_0x8187('0xa')](function(_0x40efb0){logger[_0x8187('0xb')]('VtigerConfiguration,\x20%s,\x20%s',_0x1db70b,_0x8187('0xc'));logger[_0x8187('0xd')](_0x8187('0xe'),_0x1db70b,'request\x20sent',JSON['stringify'](_0x40efb0));if(_0x40efb0[_0x8187('0xf')]){if(_0x40efb0['error'][_0x8187('0x10')]===0x1f4){logger['error'](_0x8187('0x11'),_0x1db70b,_0x40efb0[_0x8187('0xf')][_0x8187('0x12')]);return _0x1b33f8(_0x40efb0[_0x8187('0xf')][_0x8187('0x12')]);}logger[_0x8187('0xf')](_0x8187('0x11'),_0x1db70b,_0x40efb0[_0x8187('0xf')][_0x8187('0x12')]);return _0x34e148(_0x40efb0[_0x8187('0xf')][_0x8187('0x12')]);}else{logger[_0x8187('0xb')](_0x8187('0x11'),_0x1db70b,_0x8187('0xc'));_0x34e148(_0x40efb0['result']['message']);}})[_0x8187('0x13')](function(_0x5a2213){logger[_0x8187('0xf')](_0x8187('0x11'),_0x1db70b,_0x5a2213);_0x1b33f8(_0x5a2213);});});} \ No newline at end of file diff --git a/server/api/intVtigerField/index.js b/server/api/intVtigerField/index.js index 27f35d6..42ed116 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 _0xb6ea=['express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerField.controller','get','isAuthenticated','index','/:id','post','create','put','update','delete','exports','multer','util','path','connect-timeout'];(function(_0x3ab9ee,_0x4a74b8){var _0x82ee88=function(_0x6ccc7e){while(--_0x6ccc7e){_0x3ab9ee['push'](_0x3ab9ee['shift']());}};_0x82ee88(++_0x4a74b8);}(_0xb6ea,0x1f0));var _0xab6e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb6ea[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xab6e('0x0'));var util=require(_0xab6e('0x1'));var path=require(_0xab6e('0x2'));var timeout=require(_0xab6e('0x3'));var express=require(_0xab6e('0x4'));var router=express[_0xab6e('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xab6e('0x6'));var interaction=require(_0xab6e('0x7'));var config=require(_0xab6e('0x8'));var controller=require(_0xab6e('0x9'));router[_0xab6e('0xa')]('/',auth[_0xab6e('0xb')](),controller[_0xab6e('0xc')]);router[_0xab6e('0xa')](_0xab6e('0xd'),auth['isAuthenticated'](),controller['show']);router[_0xab6e('0xe')]('/',auth['isAuthenticated'](),controller[_0xab6e('0xf')]);router[_0xab6e('0x10')](_0xab6e('0xd'),auth[_0xab6e('0xb')](),controller[_0xab6e('0x11')]);router[_0xab6e('0x12')](_0xab6e('0xd'),auth[_0xab6e('0xb')](),controller['destroy']);module[_0xab6e('0x13')]=router; \ No newline at end of file +var _0x209e=['fs-extra','../../config/environment','./intVtigerField.controller','get','isAuthenticated','index','create','put','/:id','update','destroy','multer','util','connect-timeout','express','Router'];(function(_0x340af0,_0x4032bb){var _0x1c4313=function(_0x272718){while(--_0x272718){_0x340af0['push'](_0x340af0['shift']());}};_0x1c4313(++_0x4032bb);}(_0x209e,0x17b));var _0xe209=function(_0xe91f18,_0x6ed6a0){_0xe91f18=_0xe91f18-0x0;var _0x1bf40f=_0x209e[_0xe91f18];return _0x1bf40f;};'use strict';var multer=require(_0xe209('0x0'));var util=require(_0xe209('0x1'));var path=require('path');var timeout=require(_0xe209('0x2'));var express=require(_0xe209('0x3'));var router=express[_0xe209('0x4')]();var fs_extra=require(_0xe209('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xe209('0x6'));var controller=require(_0xe209('0x7'));router[_0xe209('0x8')]('/',auth[_0xe209('0x9')](),controller[_0xe209('0xa')]);router[_0xe209('0x8')]('/:id',auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0xe209('0x9')](),controller[_0xe209('0xb')]);router[_0xe209('0xc')](_0xe209('0xd'),auth[_0xe209('0x9')](),controller[_0xe209('0xe')]);router['delete'](_0xe209('0xd'),auth[_0xe209('0x9')](),controller[_0xe209('0xf')]);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 fe81305..a3d442b 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 _0x4e56=['picklist','STRING','BOOLEAN','sequelize','exports','ENUM','string','variable','customVariable','keyValue'];(function(_0x1abdce,_0x31d74f){var _0x13de01=function(_0xb08787){while(--_0xb08787){_0x1abdce['push'](_0x1abdce['shift']());}};_0x13de01(++_0x31d74f);}(_0x4e56,0x85));var _0x64e5=function(_0x53df31,_0xb09d47){_0x53df31=_0x53df31-0x0;var _0x191379=_0x4e56[_0x53df31];return _0x191379;};'use strict';var Sequelize=require(_0x64e5('0x0'));module[_0x64e5('0x1')]={'type':{'type':Sequelize[_0x64e5('0x2')](_0x64e5('0x3'),_0x64e5('0x4'),_0x64e5('0x5'),_0x64e5('0x6'),_0x64e5('0x7')),'defaultValue':_0x64e5('0x3')},'content':{'type':Sequelize[_0x64e5('0x8')]},'key':{'type':Sequelize[_0x64e5('0x8')]},'keyType':{'type':Sequelize[_0x64e5('0x2')](_0x64e5('0x3'),'variable','customVariable')},'keyContent':{'type':Sequelize[_0x64e5('0x8')]},'idField':{'type':Sequelize[_0x64e5('0x8')]},'nameField':{'type':Sequelize[_0x64e5('0x8')]},'customField':{'type':Sequelize[_0x64e5('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xd9e6=['ENUM','string','variable','keyValue','STRING','customVariable','BOOLEAN','exports'];(function(_0xf166de,_0x335fa7){var _0x4434f7=function(_0x1c5121){while(--_0x1c5121){_0xf166de['push'](_0xf166de['shift']());}};_0x4434f7(++_0x335fa7);}(_0xd9e6,0x147));var _0x6d9e=function(_0x17a2a9,_0x5872d9){_0x17a2a9=_0x17a2a9-0x0;var _0x71d12b=_0xd9e6[_0x17a2a9];return _0x71d12b;};'use strict';var Sequelize=require('sequelize');module[_0x6d9e('0x0')]={'type':{'type':Sequelize[_0x6d9e('0x1')](_0x6d9e('0x2'),_0x6d9e('0x3'),'customVariable',_0x6d9e('0x4'),'picklist'),'defaultValue':'string'},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x6d9e('0x5')]},'keyType':{'type':Sequelize[_0x6d9e('0x1')](_0x6d9e('0x2'),_0x6d9e('0x3'),_0x6d9e('0x6'))},'keyContent':{'type':Sequelize[_0x6d9e('0x5')]},'idField':{'type':Sequelize[_0x6d9e('0x5')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x6d9e('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x6d9e('0x5')]}}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.controller.js b/server/api/intVtigerField/intVtigerField.controller.js index a3f3f00..893ec6f 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 _0x08b5=['zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','save','update','destroy','then','name','send','index','type','key','model','map','query','filters','intersection','fields','attributes','length','order','sort','where','pick','filter','merge','VIRTUAL','options','VtigerField','includeAll','include','findAll','rows','catch','show','params','keys','rawAttributes','find','create','body','eml-format'];(function(_0x5a04fe,_0xade30a){var _0x1c9a00=function(_0x39f82f){while(--_0x39f82f){_0x5a04fe['push'](_0x5a04fe['shift']());}};_0x1c9a00(++_0xade30a);}(_0x08b5,0x11b));var _0x508b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x08b5[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x508b('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x508b('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x508b('0x2'));var moment=require('moment');var BPromise=require(_0x508b('0x3'));var Mustache=require(_0x508b('0x4'));var util=require(_0x508b('0x5'));var path=require(_0x508b('0x6'));var sox=require(_0x508b('0x7'));var csv=require(_0x508b('0x8'));var ejs=require(_0x508b('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x508b('0xa'));var squel=require(_0x508b('0xb'));var crypto=require(_0x508b('0xc'));var jsforce=require(_0x508b('0xd'));var deskjs=require(_0x508b('0xe'));var toCsv=require(_0x508b('0x8'));var querystring=require('querystring');var Papa=require(_0x508b('0xf'));var Redis=require(_0x508b('0x10'));var authService=require(_0x508b('0x11'));var qs=require(_0x508b('0x12'));var as=require(_0x508b('0x13'));var hardwareService=require(_0x508b('0x14'));var logger=require('../../config/logger')(_0x508b('0x15'));var utils=require('../../config/utils');var config=require(_0x508b('0x16'));var licenseUtil=require(_0x508b('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x26d098,_0x58a5a2){_0x58a5a2=_0x58a5a2||0xcc;return function(_0x1be7e3){if(_0x1be7e3){return _0x26d098[_0x508b('0x18')](_0x58a5a2);}return _0x26d098[_0x508b('0x19')](_0x58a5a2)[_0x508b('0x1a')]();};}function respondWithResult(_0x350f73,_0xe9057e){_0xe9057e=_0xe9057e||0xc8;return function(_0x503c0c){if(_0x503c0c){return _0x350f73[_0x508b('0x19')](_0xe9057e)['json'](_0x503c0c);}};}function respondWithFilteredResult(_0x3dafe3,_0xb0885b){return function(_0x17e607){if(_0x17e607){var _0x475e8e=typeof _0xb0885b[_0x508b('0x1b')]===_0x508b('0x1c')&&typeof _0xb0885b[_0x508b('0x1d')]===_0x508b('0x1c');var _0x20b926=_0x17e607[_0x508b('0x1e')];var _0x1e25c5=_0x475e8e?0x0:_0xb0885b[_0x508b('0x1b')];var _0x113770=_0x475e8e?_0x17e607[_0x508b('0x1e')]:_0xb0885b[_0x508b('0x1b')]+_0xb0885b[_0x508b('0x1d')];var _0x237fe7;if(_0x113770>=_0x20b926){_0x113770=_0x20b926;_0x237fe7=0xc8;}else{_0x237fe7=0xce;}_0x3dafe3[_0x508b('0x19')](_0x237fe7);return _0x3dafe3['set'](_0x508b('0x1f'),_0x1e25c5+'-'+_0x113770+'/'+_0x20b926)[_0x508b('0x20')](_0x17e607);}return null;};}function patchUpdates(_0x4a78e2){return function(_0x3bb2de){try{jsonpatch['apply'](_0x3bb2de,_0x4a78e2,!![]);}catch(_0x48ed64){return BPromise['reject'](_0x48ed64);}return _0x3bb2de[_0x508b('0x21')]();};}function saveUpdates(_0x544fa0,_0x5a2b27){return function(_0x453dc2){if(_0x453dc2){return _0x453dc2[_0x508b('0x22')](_0x544fa0)['then'](function(_0x3a79d2){return _0x3a79d2;});}return null;};}function removeEntity(_0x207bf1,_0x5898b6){return function(_0x5850a3){if(_0x5850a3){return _0x5850a3[_0x508b('0x23')]()[_0x508b('0x24')](function(){_0x207bf1['status'](0xcc)[_0x508b('0x1a')]();});}};}function handleEntityNotFound(_0x30f4a2,_0x1800c7){return function(_0x13587d){if(!_0x13587d){_0x30f4a2[_0x508b('0x18')](0x194);}return _0x13587d;};}function handleError(_0x270988,_0x52738e){_0x52738e=_0x52738e||0x1f4;return function(_0x29fdc1){logger['error'](_0x29fdc1['stack']);if(_0x29fdc1['name']){delete _0x29fdc1[_0x508b('0x25')];}_0x270988['status'](_0x52738e)[_0x508b('0x26')](_0x29fdc1);};}exports[_0x508b('0x27')]=function(_0x470111,_0x52f2a5){var _0x490611={},_0x50e059={},_0x43537c={'count':0x0,'rows':[]};var _0x4cf622=_['map'](db['VtigerField']['rawAttributes'],function(_0x1d1a77){return{'name':_0x1d1a77['fieldName'],'type':_0x1d1a77[_0x508b('0x28')][_0x508b('0x29')]};});_0x50e059[_0x508b('0x2a')]=_[_0x508b('0x2b')](_0x4cf622,'name');_0x50e059[_0x508b('0x2c')]=_['keys'](_0x470111[_0x508b('0x2c')]);_0x50e059[_0x508b('0x2d')]=_[_0x508b('0x2e')](_0x50e059[_0x508b('0x2a')],_0x50e059[_0x508b('0x2c')]);_0x490611['attributes']=_['intersection'](_0x50e059[_0x508b('0x2a')],qs[_0x508b('0x2f')](_0x470111[_0x508b('0x2c')][_0x508b('0x2f')]));_0x490611[_0x508b('0x30')]=_0x490611[_0x508b('0x30')][_0x508b('0x31')]?_0x490611['attributes']:_0x50e059[_0x508b('0x2a')];if(!_0x470111[_0x508b('0x2c')]['hasOwnProperty']('nolimit')){_0x490611[_0x508b('0x1d')]=qs[_0x508b('0x1d')](_0x470111[_0x508b('0x2c')][_0x508b('0x1d')]);_0x490611[_0x508b('0x1b')]=qs['offset'](_0x470111[_0x508b('0x2c')][_0x508b('0x1b')]);}_0x490611[_0x508b('0x32')]=qs[_0x508b('0x33')](_0x470111['query'][_0x508b('0x33')]);_0x490611[_0x508b('0x34')]=qs['filters'](_[_0x508b('0x35')](_0x470111[_0x508b('0x2c')],_0x50e059[_0x508b('0x2d')]),_0x4cf622);if(_0x470111[_0x508b('0x2c')][_0x508b('0x36')]){_0x490611[_0x508b('0x34')]=_[_0x508b('0x37')](_0x490611['where'],{'$or':_[_0x508b('0x2b')](_0x4cf622,function(_0x58019f){if(_0x58019f[_0x508b('0x28')]!==_0x508b('0x38')){var _0x3786f9={};_0x3786f9[_0x58019f[_0x508b('0x25')]]={'$like':'%'+_0x470111[_0x508b('0x2c')]['filter']+'%'};return _0x3786f9;}})});}_0x490611=_['merge']({},_0x490611,_0x470111[_0x508b('0x39')]);var _0x37913c={'where':_0x490611[_0x508b('0x34')]};return db[_0x508b('0x3a')]['count'](_0x37913c)[_0x508b('0x24')](function(_0x4559ef){_0x43537c[_0x508b('0x1e')]=_0x4559ef;if(_0x470111[_0x508b('0x2c')][_0x508b('0x3b')]){_0x490611[_0x508b('0x3c')]=[{'all':!![]}];}return db[_0x508b('0x3a')][_0x508b('0x3d')](_0x490611);})[_0x508b('0x24')](function(_0x16360a){_0x43537c[_0x508b('0x3e')]=_0x16360a;return _0x43537c;})[_0x508b('0x24')](respondWithFilteredResult(_0x52f2a5,_0x490611))[_0x508b('0x3f')](handleError(_0x52f2a5,null));};exports[_0x508b('0x40')]=function(_0x3acda5,_0x154cc6){var _0x1f2db8={'raw':!![],'where':{'id':_0x3acda5[_0x508b('0x41')]['id']}},_0x240bc2={};_0x240bc2[_0x508b('0x2a')]=_[_0x508b('0x42')](db[_0x508b('0x3a')][_0x508b('0x43')]);_0x240bc2[_0x508b('0x2c')]=_[_0x508b('0x42')](_0x3acda5[_0x508b('0x2c')]);_0x240bc2[_0x508b('0x2d')]=_[_0x508b('0x2e')](_0x240bc2['model'],_0x240bc2['query']);_0x1f2db8['attributes']=_['intersection'](_0x240bc2['model'],qs[_0x508b('0x2f')](_0x3acda5['query'][_0x508b('0x2f')]));_0x1f2db8['attributes']=_0x1f2db8[_0x508b('0x30')]['length']?_0x1f2db8[_0x508b('0x30')]:_0x240bc2['model'];if(_0x3acda5[_0x508b('0x2c')][_0x508b('0x3b')]){_0x1f2db8[_0x508b('0x3c')]=[{'all':!![]}];}_0x1f2db8=_[_0x508b('0x37')]({},_0x1f2db8,_0x3acda5[_0x508b('0x39')]);return db['VtigerField'][_0x508b('0x44')](_0x1f2db8)[_0x508b('0x24')](handleEntityNotFound(_0x154cc6,null))[_0x508b('0x24')](respondWithResult(_0x154cc6,null))['catch'](handleError(_0x154cc6,null));};exports[_0x508b('0x45')]=function(_0x3c3b67,_0x58cfd8){return db[_0x508b('0x3a')][_0x508b('0x45')](_0x3c3b67['body'],{})['then'](respondWithResult(_0x58cfd8,0xc9))[_0x508b('0x3f')](handleError(_0x58cfd8,null));};exports['update']=function(_0x4e11b1,_0x1af29d){if(_0x4e11b1[_0x508b('0x46')]['id']){delete _0x4e11b1['body']['id'];}return db[_0x508b('0x3a')][_0x508b('0x44')]({'where':{'id':_0x4e11b1[_0x508b('0x41')]['id']}})[_0x508b('0x24')](handleEntityNotFound(_0x1af29d,null))[_0x508b('0x24')](saveUpdates(_0x4e11b1[_0x508b('0x46')],null))[_0x508b('0x24')](respondWithResult(_0x1af29d,null))['catch'](handleError(_0x1af29d,null));};exports[_0x508b('0x23')]=function(_0x3293df,_0x330f78){return db[_0x508b('0x3a')][_0x508b('0x44')]({'where':{'id':_0x3293df[_0x508b('0x41')]['id']}})['then'](handleEntityNotFound(_0x330f78,null))[_0x508b('0x24')](removeEntity(_0x330f78,null))[_0x508b('0x3f')](handleError(_0x330f78,null));}; \ No newline at end of file +var _0x50b5=['length','merge','find','create','body','params','destroy','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','reject','update','then','error','name','send','map','rawAttributes','type','key','model','query','filters','fields','attributes','hasOwnProperty','nolimit','order','sort','pick','where','options','VtigerField','includeAll','include','findAll','rows','catch','show','keys','intersection'];(function(_0x1c6c6d,_0x2c28ec){var _0x183acd=function(_0x20d802){while(--_0x20d802){_0x1c6c6d['push'](_0x1c6c6d['shift']());}};_0x183acd(++_0x2c28ec);}(_0x50b5,0xdc));var _0x550b=function(_0x28947d,_0x4cc9c6){_0x28947d=_0x28947d-0x0;var _0x12d2ee=_0x50b5[_0x28947d];return _0x12d2ee;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x550b('0x0'));var jsonpatch=require(_0x550b('0x1'));var rp=require(_0x550b('0x2'));var moment=require('moment');var BPromise=require(_0x550b('0x3'));var Mustache=require(_0x550b('0x4'));var util=require(_0x550b('0x5'));var path=require(_0x550b('0x6'));var sox=require(_0x550b('0x7'));var csv=require(_0x550b('0x8'));var ejs=require(_0x550b('0x9'));var fs=require('fs');var fs_extra=require(_0x550b('0xa'));var _=require('lodash');var squel=require(_0x550b('0xb'));var crypto=require(_0x550b('0xc'));var jsforce=require(_0x550b('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x550b('0x8'));var querystring=require(_0x550b('0xe'));var Papa=require(_0x550b('0xf'));var Redis=require(_0x550b('0x10'));var authService=require(_0x550b('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x550b('0x12'));var hardwareService=require(_0x550b('0x13'));var logger=require('../../config/logger')(_0x550b('0x14'));var utils=require('../../config/utils');var config=require(_0x550b('0x15'));var licenseUtil=require(_0x550b('0x16'));var db=require(_0x550b('0x17'))['db'];function respondWithStatusCode(_0x22e079,_0x37ea70){_0x37ea70=_0x37ea70||0xcc;return function(_0x43ec97){if(_0x43ec97){return _0x22e079[_0x550b('0x18')](_0x37ea70);}return _0x22e079[_0x550b('0x19')](_0x37ea70)[_0x550b('0x1a')]();};}function respondWithResult(_0x4d9ad8,_0x2ae9cb){_0x2ae9cb=_0x2ae9cb||0xc8;return function(_0x3ff0b0){if(_0x3ff0b0){return _0x4d9ad8[_0x550b('0x19')](_0x2ae9cb)['json'](_0x3ff0b0);}};}function respondWithFilteredResult(_0xf67648,_0x33bfb6){return function(_0x5bc307){if(_0x5bc307){var _0x367309=typeof _0x33bfb6[_0x550b('0x1b')]===_0x550b('0x1c')&&typeof _0x33bfb6[_0x550b('0x1d')]==='undefined';var _0x31580f=_0x5bc307['count'];var _0x54c6de=_0x367309?0x0:_0x33bfb6[_0x550b('0x1b')];var _0xf1a64=_0x367309?_0x5bc307[_0x550b('0x1e')]:_0x33bfb6[_0x550b('0x1b')]+_0x33bfb6[_0x550b('0x1d')];var _0x14237c;if(_0xf1a64>=_0x31580f){_0xf1a64=_0x31580f;_0x14237c=0xc8;}else{_0x14237c=0xce;}_0xf67648[_0x550b('0x19')](_0x14237c);return _0xf67648['set'](_0x550b('0x1f'),_0x54c6de+'-'+_0xf1a64+'/'+_0x31580f)[_0x550b('0x20')](_0x5bc307);}return null;};}function patchUpdates(_0x378cf2){return function(_0x563b89){try{jsonpatch['apply'](_0x563b89,_0x378cf2,!![]);}catch(_0x190548){return BPromise[_0x550b('0x21')](_0x190548);}return _0x563b89['save']();};}function saveUpdates(_0x3dd297,_0x28faff){return function(_0x3bb2b4){if(_0x3bb2b4){return _0x3bb2b4[_0x550b('0x22')](_0x3dd297)['then'](function(_0x4d34ed){return _0x4d34ed;});}return null;};}function removeEntity(_0x16ff4f,_0x533f94){return function(_0x30ff52){if(_0x30ff52){return _0x30ff52['destroy']()[_0x550b('0x23')](function(){_0x16ff4f[_0x550b('0x19')](0xcc)[_0x550b('0x1a')]();});}};}function handleEntityNotFound(_0x466e59,_0x3beee4){return function(_0x3cd93e){if(!_0x3cd93e){_0x466e59[_0x550b('0x18')](0x194);}return _0x3cd93e;};}function handleError(_0x388e0b,_0x1dd145){_0x1dd145=_0x1dd145||0x1f4;return function(_0x5ea6eb){logger[_0x550b('0x24')](_0x5ea6eb['stack']);if(_0x5ea6eb['name']){delete _0x5ea6eb[_0x550b('0x25')];}_0x388e0b[_0x550b('0x19')](_0x1dd145)[_0x550b('0x26')](_0x5ea6eb);};}exports['index']=function(_0x3236f3,_0x56ef6a){var _0x43df1d={},_0x5d6367={},_0x370f11={'count':0x0,'rows':[]};var _0xae8104=_[_0x550b('0x27')](db['VtigerField'][_0x550b('0x28')],function(_0x3286a6){return{'name':_0x3286a6['fieldName'],'type':_0x3286a6[_0x550b('0x29')][_0x550b('0x2a')]};});_0x5d6367[_0x550b('0x2b')]=_['map'](_0xae8104,_0x550b('0x25'));_0x5d6367[_0x550b('0x2c')]=_['keys'](_0x3236f3[_0x550b('0x2c')]);_0x5d6367[_0x550b('0x2d')]=_['intersection'](_0x5d6367[_0x550b('0x2b')],_0x5d6367[_0x550b('0x2c')]);_0x43df1d['attributes']=_['intersection'](_0x5d6367['model'],qs[_0x550b('0x2e')](_0x3236f3['query'][_0x550b('0x2e')]));_0x43df1d[_0x550b('0x2f')]=_0x43df1d[_0x550b('0x2f')]['length']?_0x43df1d[_0x550b('0x2f')]:_0x5d6367[_0x550b('0x2b')];if(!_0x3236f3[_0x550b('0x2c')][_0x550b('0x30')](_0x550b('0x31'))){_0x43df1d[_0x550b('0x1d')]=qs[_0x550b('0x1d')](_0x3236f3['query'][_0x550b('0x1d')]);_0x43df1d[_0x550b('0x1b')]=qs[_0x550b('0x1b')](_0x3236f3[_0x550b('0x2c')][_0x550b('0x1b')]);}_0x43df1d[_0x550b('0x32')]=qs[_0x550b('0x33')](_0x3236f3[_0x550b('0x2c')]['sort']);_0x43df1d['where']=qs['filters'](_[_0x550b('0x34')](_0x3236f3[_0x550b('0x2c')],_0x5d6367[_0x550b('0x2d')]),_0xae8104);if(_0x3236f3[_0x550b('0x2c')]['filter']){_0x43df1d[_0x550b('0x35')]=_['merge'](_0x43df1d[_0x550b('0x35')],{'$or':_[_0x550b('0x27')](_0xae8104,function(_0x3d121b){if(_0x3d121b[_0x550b('0x29')]!=='VIRTUAL'){var _0x6d2fec={};_0x6d2fec[_0x3d121b[_0x550b('0x25')]]={'$like':'%'+_0x3236f3[_0x550b('0x2c')]['filter']+'%'};return _0x6d2fec;}})});}_0x43df1d=_['merge']({},_0x43df1d,_0x3236f3[_0x550b('0x36')]);var _0x471dd4={'where':_0x43df1d[_0x550b('0x35')]};return db[_0x550b('0x37')][_0x550b('0x1e')](_0x471dd4)['then'](function(_0x2a2227){_0x370f11[_0x550b('0x1e')]=_0x2a2227;if(_0x3236f3[_0x550b('0x2c')][_0x550b('0x38')]){_0x43df1d[_0x550b('0x39')]=[{'all':!![]}];}return db[_0x550b('0x37')][_0x550b('0x3a')](_0x43df1d);})[_0x550b('0x23')](function(_0x12b423){_0x370f11[_0x550b('0x3b')]=_0x12b423;return _0x370f11;})[_0x550b('0x23')](respondWithFilteredResult(_0x56ef6a,_0x43df1d))[_0x550b('0x3c')](handleError(_0x56ef6a,null));};exports[_0x550b('0x3d')]=function(_0x4cda14,_0x3dad20){var _0x53e80f={'raw':!![],'where':{'id':_0x4cda14['params']['id']}},_0x490f14={};_0x490f14[_0x550b('0x2b')]=_['keys'](db['VtigerField'][_0x550b('0x28')]);_0x490f14[_0x550b('0x2c')]=_[_0x550b('0x3e')](_0x4cda14[_0x550b('0x2c')]);_0x490f14['filters']=_[_0x550b('0x3f')](_0x490f14[_0x550b('0x2b')],_0x490f14[_0x550b('0x2c')]);_0x53e80f[_0x550b('0x2f')]=_[_0x550b('0x3f')](_0x490f14['model'],qs[_0x550b('0x2e')](_0x4cda14[_0x550b('0x2c')][_0x550b('0x2e')]));_0x53e80f[_0x550b('0x2f')]=_0x53e80f[_0x550b('0x2f')][_0x550b('0x40')]?_0x53e80f[_0x550b('0x2f')]:_0x490f14[_0x550b('0x2b')];if(_0x4cda14[_0x550b('0x2c')][_0x550b('0x38')]){_0x53e80f[_0x550b('0x39')]=[{'all':!![]}];}_0x53e80f=_[_0x550b('0x41')]({},_0x53e80f,_0x4cda14[_0x550b('0x36')]);return db['VtigerField'][_0x550b('0x42')](_0x53e80f)[_0x550b('0x23')](handleEntityNotFound(_0x3dad20,null))[_0x550b('0x23')](respondWithResult(_0x3dad20,null))['catch'](handleError(_0x3dad20,null));};exports['create']=function(_0xe6436b,_0x40928d){return db[_0x550b('0x37')][_0x550b('0x43')](_0xe6436b['body'],{})[_0x550b('0x23')](respondWithResult(_0x40928d,0xc9))[_0x550b('0x3c')](handleError(_0x40928d,null));};exports[_0x550b('0x22')]=function(_0x568cbd,_0x30c32b){if(_0x568cbd['body']['id']){delete _0x568cbd[_0x550b('0x44')]['id'];}return db[_0x550b('0x37')][_0x550b('0x42')]({'where':{'id':_0x568cbd[_0x550b('0x45')]['id']}})[_0x550b('0x23')](handleEntityNotFound(_0x30c32b,null))['then'](saveUpdates(_0x568cbd[_0x550b('0x44')],null))['then'](respondWithResult(_0x30c32b,null))[_0x550b('0x3c')](handleError(_0x30c32b,null));};exports[_0x550b('0x46')]=function(_0x187c29,_0x21102f){return db[_0x550b('0x37')][_0x550b('0x42')]({'where':{'id':_0x187c29[_0x550b('0x45')]['id']}})[_0x550b('0x23')](handleEntityNotFound(_0x21102f,null))[_0x550b('0x23')](removeEntity(_0x21102f,null))[_0x550b('0x3c')](handleError(_0x21102f,null));}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.model.js b/server/api/intVtigerField/intVtigerField.model.js index 2d06de0..89690de 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 _0xf50b=['idField','lodash','util','../../config/logger','api','moment','rimraf','../../config/environment','./intVtigerField.attributes','define','VtigerField','int_vtiger_fields','vtiger_unique_index'];(function(_0x418249,_0x368c95){var _0x452517=function(_0x541c5c){while(--_0x541c5c){_0x418249['push'](_0x418249['shift']());}};_0x452517(++_0x368c95);}(_0xf50b,0x194));var _0xbf50=function(_0x3393d0,_0xb16760){_0x3393d0=_0x3393d0-0x0;var _0x30be72=_0xf50b[_0x3393d0];return _0x30be72;};'use strict';var _=require(_0xbf50('0x0'));var util=require(_0xbf50('0x1'));var logger=require(_0xbf50('0x2'))(_0xbf50('0x3'));var moment=require(_0xbf50('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xbf50('0x5'));var config=require(_0xbf50('0x6'));var attributes=require(_0xbf50('0x7'));module['exports']=function(_0x11983b,_0x2cd64f){return _0x11983b[_0xbf50('0x8')](_0xbf50('0x9'),attributes,{'tableName':_0xbf50('0xa'),'paranoid':![],'indexes':[{'name':_0xbf50('0xb'),'fields':[_0xbf50('0xc'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xea5d=['vtiger_unique_index','idField','FieldId','lodash','util','../../config/logger','bluebird','request-promise','rimraf','./intVtigerField.attributes','exports','define','VtigerField','int_vtiger_fields'];(function(_0x2cfbe0,_0x58e7dd){var _0x44c727=function(_0x466cc6){while(--_0x466cc6){_0x2cfbe0['push'](_0x2cfbe0['shift']());}};_0x44c727(++_0x58e7dd);}(_0xea5d,0x17d));var _0xdea5=function(_0x4507f5,_0x1d62a8){_0x4507f5=_0x4507f5-0x0;var _0x3e63f8=_0xea5d[_0x4507f5];return _0x3e63f8;};'use strict';var _=require(_0xdea5('0x0'));var util=require(_0xdea5('0x1'));var logger=require(_0xdea5('0x2'))('api');var moment=require('moment');var BPromise=require(_0xdea5('0x3'));var rp=require(_0xdea5('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xdea5('0x5'));var config=require('../../config/environment');var attributes=require(_0xdea5('0x6'));module[_0xdea5('0x7')]=function(_0x5f2fcf,_0x358539){return _0x5f2fcf[_0xdea5('0x8')](_0xdea5('0x9'),attributes,{'tableName':_0xdea5('0xa'),'paranoid':![],'indexes':[{'name':_0xdea5('0xb'),'fields':[_0xdea5('0xc'),_0xdea5('0xd')],'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 67df1a3..9753aaf 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 _0x6205=['request','then','request\x20sent','debug','VtigerField,\x20%s,\x20%s,\x20%s','error','code','message','VtigerField,\x20%s,\x20%s','info','result','catch','util','bluebird','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x81bcc0,_0x320e61){var _0x3bad3f=function(_0x381a51){while(--_0x381a51){_0x81bcc0['push'](_0x81bcc0['shift']());}};_0x3bad3f(++_0x320e61);}(_0x6205,0x160));var _0x5620=function(_0x16d10f,_0x2ba2d5){_0x16d10f=_0x16d10f-0x0;var _0x50c823=_0x6205[_0x16d10f];return _0x50c823;};'use strict';var _=require('lodash');var util=require(_0x5620('0x0'));var moment=require('moment');var BPromise=require(_0x5620('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5620('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0x5620('0x3'))(_0x5620('0x4'));var config=require(_0x5620('0x5'));var jayson=require(_0x5620('0x6'));var client=jayson[_0x5620('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x15b9c8,_0x5cc09e,_0x28c6c7){return new BPromise(function(_0x1a577c,_0x344ef4){return client[_0x5620('0x8')](_0x15b9c8,_0x28c6c7)[_0x5620('0x9')](function(_0x31dacc){logger['info']('VtigerField,\x20%s,\x20%s',_0x5cc09e,_0x5620('0xa'));logger[_0x5620('0xb')](_0x5620('0xc'),_0x5cc09e,'request\x20sent',JSON['stringify'](_0x31dacc));if(_0x31dacc[_0x5620('0xd')]){if(_0x31dacc[_0x5620('0xd')][_0x5620('0xe')]===0x1f4){logger[_0x5620('0xd')]('VtigerField,\x20%s,\x20%s',_0x5cc09e,_0x31dacc['error'][_0x5620('0xf')]);return _0x344ef4(_0x31dacc['error'][_0x5620('0xf')]);}logger[_0x5620('0xd')](_0x5620('0x10'),_0x5cc09e,_0x31dacc[_0x5620('0xd')][_0x5620('0xf')]);return _0x1a577c(_0x31dacc['error'][_0x5620('0xf')]);}else{logger[_0x5620('0x11')](_0x5620('0x10'),_0x5cc09e,_0x5620('0xa'));_0x1a577c(_0x31dacc[_0x5620('0x12')]['message']);}})[_0x5620('0x13')](function(_0x7ca319){logger[_0x5620('0xd')]('VtigerField,\x20%s,\x20%s',_0x5cc09e,_0x7ca319);_0x344ef4(_0x7ca319);});});} \ No newline at end of file +var _0xbb1e=['client','http','request','then','info','VtigerField,\x20%s,\x20%s','request\x20sent','debug','VtigerField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x2060f6,_0x47502b){var _0x5202e8=function(_0xdecaa7){while(--_0xdecaa7){_0x2060f6['push'](_0x2060f6['shift']());}};_0x5202e8(++_0x47502b);}(_0xbb1e,0x1ee));var _0xebb1=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0xbb1e[_0x3b380d];return _0x54502b;};'use strict';var _=require(_0xebb1('0x0'));var util=require(_0xebb1('0x1'));var moment=require('moment');var BPromise=require(_0xebb1('0x2'));var rs=require(_0xebb1('0x3'));var fs=require('fs');var Redis=require(_0xebb1('0x4'));var db=require(_0xebb1('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xebb1('0x6'))(_0xebb1('0x7'));var config=require(_0xebb1('0x8'));var jayson=require(_0xebb1('0x9'));var client=jayson[_0xebb1('0xa')][_0xebb1('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2ef4d3,_0x27a1d0,_0xfaaeb4){return new BPromise(function(_0x2f127c,_0x343335){return client[_0xebb1('0xc')](_0x2ef4d3,_0xfaaeb4)[_0xebb1('0xd')](function(_0xa0dddf){logger[_0xebb1('0xe')](_0xebb1('0xf'),_0x27a1d0,_0xebb1('0x10'));logger[_0xebb1('0x11')](_0xebb1('0x12'),_0x27a1d0,_0xebb1('0x10'),JSON[_0xebb1('0x13')](_0xa0dddf));if(_0xa0dddf[_0xebb1('0x14')]){if(_0xa0dddf[_0xebb1('0x14')][_0xebb1('0x15')]===0x1f4){logger['error']('VtigerField,\x20%s,\x20%s',_0x27a1d0,_0xa0dddf[_0xebb1('0x14')][_0xebb1('0x16')]);return _0x343335(_0xa0dddf[_0xebb1('0x14')]['message']);}logger[_0xebb1('0x14')](_0xebb1('0xf'),_0x27a1d0,_0xa0dddf[_0xebb1('0x14')][_0xebb1('0x16')]);return _0x2f127c(_0xa0dddf[_0xebb1('0x14')][_0xebb1('0x16')]);}else{logger[_0xebb1('0xe')](_0xebb1('0xf'),_0x27a1d0,'request\x20sent');_0x2f127c(_0xa0dddf['result'][_0xebb1('0x16')]);}})[_0xebb1('0x17')](function(_0x4cae7e){logger[_0xebb1('0x14')]('VtigerField,\x20%s,\x20%s',_0x27a1d0,_0x4cae7e);_0x343335(_0x4cae7e);});});} \ No newline at end of file diff --git a/server/api/intZendeskAccount/index.js b/server/api/intZendeskAccount/index.js index 3576777..b3f82d4 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 _0x982b=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskAccount.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','post','create','/:id/configurations','addConfiguration','update','destroy','multer','util','path'];(function(_0x5da901,_0x12374d){var _0x288641=function(_0x31f05b){while(--_0x31f05b){_0x5da901['push'](_0x5da901['shift']());}};_0x288641(++_0x12374d);}(_0x982b,0xfa));var _0xb982=function(_0x53199f,_0x1dac3a){_0x53199f=_0x53199f-0x0;var _0x1f9609=_0x982b[_0x53199f];return _0x1f9609;};'use strict';var multer=require(_0xb982('0x0'));var util=require(_0xb982('0x1'));var path=require(_0xb982('0x2'));var timeout=require(_0xb982('0x3'));var express=require('express');var router=express[_0xb982('0x4')]();var fs_extra=require(_0xb982('0x5'));var auth=require(_0xb982('0x6'));var interaction=require(_0xb982('0x7'));var config=require(_0xb982('0x8'));var controller=require(_0xb982('0x9'));router[_0xb982('0xa')]('/',auth[_0xb982('0xb')](),controller[_0xb982('0xc')]);router[_0xb982('0xa')](_0xb982('0xd'),auth[_0xb982('0xb')](),controller[_0xb982('0xe')]);router[_0xb982('0xa')]('/:id/configurations',auth[_0xb982('0xb')](),controller['getConfigurations']);router[_0xb982('0xa')](_0xb982('0xf'),auth[_0xb982('0xb')](),controller[_0xb982('0x10')]);router[_0xb982('0x11')]('/',auth[_0xb982('0xb')](),controller[_0xb982('0x12')]);router[_0xb982('0x11')](_0xb982('0x13'),auth[_0xb982('0xb')](),controller[_0xb982('0x14')]);router['put'](_0xb982('0xd'),auth[_0xb982('0xb')](),controller[_0xb982('0x15')]);router['delete'](_0xb982('0xd'),auth[_0xb982('0xb')](),controller[_0xb982('0x16')]);module['exports']=router; \ No newline at end of file +var _0x0cc2=['fs-extra','../../components/auth/service','../../config/environment','./intZendeskAccount.controller','get','isAuthenticated','index','/:id','show','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','destroy','exports','multer','util','connect-timeout','express'];(function(_0x66e2cf,_0x58eae6){var _0x2c7c91=function(_0x998579){while(--_0x998579){_0x66e2cf['push'](_0x66e2cf['shift']());}};_0x2c7c91(++_0x58eae6);}(_0x0cc2,0x110));var _0x20cc=function(_0x4f36ce,_0x269dd4){_0x4f36ce=_0x4f36ce-0x0;var _0x5021a3=_0x0cc2[_0x4f36ce];return _0x5021a3;};'use strict';var multer=require(_0x20cc('0x0'));var util=require(_0x20cc('0x1'));var path=require('path');var timeout=require(_0x20cc('0x2'));var express=require(_0x20cc('0x3'));var router=express['Router']();var fs_extra=require(_0x20cc('0x4'));var auth=require(_0x20cc('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x20cc('0x6'));var controller=require(_0x20cc('0x7'));router[_0x20cc('0x8')]('/',auth[_0x20cc('0x9')](),controller[_0x20cc('0xa')]);router['get'](_0x20cc('0xb'),auth[_0x20cc('0x9')](),controller[_0x20cc('0xc')]);router['get']('/:id/configurations',auth[_0x20cc('0x9')](),controller[_0x20cc('0xd')]);router['get'](_0x20cc('0xe'),auth[_0x20cc('0x9')](),controller[_0x20cc('0xf')]);router[_0x20cc('0x10')]('/',auth[_0x20cc('0x9')](),controller[_0x20cc('0x11')]);router['post']('/:id/configurations',auth[_0x20cc('0x9')](),controller[_0x20cc('0x12')]);router[_0x20cc('0x13')](_0x20cc('0xb'),auth[_0x20cc('0x9')](),controller[_0x20cc('0x14')]);router['delete'](_0x20cc('0xb'),auth[_0x20cc('0x9')](),controller[_0x20cc('0x15')]);module[_0x20cc('0x16')]=router; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.attributes.js b/server/api/intZendeskAccount/intZendeskAccount.attributes.js index 8d4968f..5b3fcf2 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 _0x44c2=['sequelize','exports','STRING','username','remoteUri','ENUM','password','integrationTab'];(function(_0x58f48c,_0x4de8ef){var _0x3df8d5=function(_0x44a9b8){while(--_0x44a9b8){_0x58f48c['push'](_0x58f48c['shift']());}};_0x3df8d5(++_0x4de8ef);}(_0x44c2,0x100));var _0x244c=function(_0x586fa2,_0x1a45bc){_0x586fa2=_0x586fa2-0x0;var _0x515be9=_0x44c2[_0x586fa2];return _0x515be9;};'use strict';var Sequelize=require(_0x244c('0x0'));module[_0x244c('0x1')]={'name':{'type':Sequelize[_0x244c('0x2')]},'description':{'type':Sequelize[_0x244c('0x2')]},'username':{'type':Sequelize['STRING'],'unique':_0x244c('0x3')},'password':{'type':Sequelize[_0x244c('0x2')]},'token':{'type':Sequelize[_0x244c('0x2')]},'remoteUri':{'type':Sequelize[_0x244c('0x2')],'unique':_0x244c('0x4')},'authType':{'type':Sequelize[_0x244c('0x5')]('password','token'),'defaultValue':_0x244c('0x6')},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x244c('0x5')]('integrationTab','newTab'),'defaultValue':_0x244c('0x7')}}; \ No newline at end of file +var _0x4813=['password','token','newTab','integrationTab','sequelize','exports','STRING','username','remoteUri','ENUM'];(function(_0x229174,_0x5d02da){var _0x17f7a4=function(_0x4aae5f){while(--_0x4aae5f){_0x229174['push'](_0x229174['shift']());}};_0x17f7a4(++_0x5d02da);}(_0x4813,0x14e));var _0x3481=function(_0x1b4ddc,_0x17a627){_0x1b4ddc=_0x1b4ddc-0x0;var _0x5932e9=_0x4813[_0x1b4ddc];return _0x5932e9;};'use strict';var Sequelize=require(_0x3481('0x0'));module[_0x3481('0x1')]={'name':{'type':Sequelize[_0x3481('0x2')]},'description':{'type':Sequelize[_0x3481('0x2')]},'username':{'type':Sequelize[_0x3481('0x2')],'unique':_0x3481('0x3')},'password':{'type':Sequelize[_0x3481('0x2')]},'token':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x3481('0x2')],'unique':_0x3481('0x4')},'authType':{'type':Sequelize[_0x3481('0x5')](_0x3481('0x6'),_0x3481('0x7')),'defaultValue':'password'},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x3481('0x5')]('integrationTab',_0x3481('0x8')),'defaultValue':_0x3481('0x9')}}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.controller.js b/server/api/intZendeskAccount/intZendeskAccount.controller.js index 450a6fc..7299131 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 _0x91a7=['includes','position','system_field_options','custom_field_options','test','getFields,\x20%s,\x20%s,\x20%s','statusCode','rimraf','zip-dir','fast-json-patch','moment','mustache','sox','to-csv','fs-extra','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','limit','set','apply','reject','save','update','then','sendStatus','error','name','send','index','map','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','ZendeskAccount','count','include','rows','params','keys','includeAll','find','catch','create','body','destroy','getConfigurations','ZendeskConfiguration','hasOwnProperty','AccountId','Subjects','getSubjects','channel','ZendeskField','Descriptions','getFields','findOne','username','password','token','authType','remoteUri','slice','substring','lastIndexOf','GET','format','%s/%s','Basic\x20%s','headers','toString','base64','Sequelize','ValidationError','subject','description','group','assignee','remove','ticket_fields'];(function(_0xd97a40,_0x416f76){var _0x32c227=function(_0x6ebf4b){while(--_0x6ebf4b){_0xd97a40['push'](_0xd97a40['shift']());}};_0x32c227(++_0x416f76);}(_0x91a7,0xe7));var _0x791a=function(_0xf47991,_0x1ffef7){_0xf47991=_0xf47991-0x0;var _0x8447bc=_0x91a7[_0xf47991];return _0x8447bc;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x791a('0x0'));var zipdir=require(_0x791a('0x1'));var jsonpatch=require(_0x791a('0x2'));var rp=require('request-promise');var moment=require(_0x791a('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x791a('0x4'));var util=require('util');var path=require('path');var sox=require(_0x791a('0x5'));var csv=require(_0x791a('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x791a('0x7'));var _=require('lodash');var squel=require(_0x791a('0x8'));var crypto=require(_0x791a('0x9'));var jsforce=require('jsforce');var deskjs=require(_0x791a('0xa'));var toCsv=require(_0x791a('0x6'));var querystring=require(_0x791a('0xb'));var Papa=require(_0x791a('0xc'));var Redis=require(_0x791a('0xd'));var authService=require('../../components/auth/service');var qs=require(_0x791a('0xe'));var as=require(_0x791a('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x791a('0x10'))(_0x791a('0x11'));var utils=require(_0x791a('0x12'));var config=require(_0x791a('0x13'));var licenseUtil=require(_0x791a('0x14'));var db=require(_0x791a('0x15'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x5daecd,_0xc92016){_0xc92016=_0xc92016||0xcc;return function(_0x2f2d8d){if(_0x2f2d8d){return _0x5daecd['sendStatus'](_0xc92016);}return _0x5daecd[_0x791a('0x16')](_0xc92016)[_0x791a('0x17')]();};}function respondWithResult(_0x5d5b11,_0x2887f0){_0x2887f0=_0x2887f0||0xc8;return function(_0x31b86d){if(_0x31b86d){return _0x5d5b11[_0x791a('0x16')](_0x2887f0)[_0x791a('0x18')](_0x31b86d);}};}function respondWithFilteredResult(_0x55e845,_0x2ce2e0){return function(_0x575d11){if(_0x575d11){var _0x43dea6=typeof _0x2ce2e0[_0x791a('0x19')]==='undefined'&&typeof _0x2ce2e0[_0x791a('0x1a')]==='undefined';var _0x35fe48=_0x575d11['count'];var _0x4a84ee=_0x43dea6?0x0:_0x2ce2e0['offset'];var _0x40f0d3=_0x43dea6?_0x575d11['count']:_0x2ce2e0['offset']+_0x2ce2e0[_0x791a('0x1a')];var _0x5a702e;if(_0x40f0d3>=_0x35fe48){_0x40f0d3=_0x35fe48;_0x5a702e=0xc8;}else{_0x5a702e=0xce;}_0x55e845[_0x791a('0x16')](_0x5a702e);return _0x55e845[_0x791a('0x1b')]('Content-Range',_0x4a84ee+'-'+_0x40f0d3+'/'+_0x35fe48)[_0x791a('0x18')](_0x575d11);}return null;};}function patchUpdates(_0xcb5e66){return function(_0x234514){try{jsonpatch[_0x791a('0x1c')](_0x234514,_0xcb5e66,!![]);}catch(_0x530e32){return BPromise[_0x791a('0x1d')](_0x530e32);}return _0x234514[_0x791a('0x1e')]();};}function saveUpdates(_0x25bae5,_0x9e17b5){return function(_0x3200dd){if(_0x3200dd){return _0x3200dd[_0x791a('0x1f')](_0x25bae5)[_0x791a('0x20')](function(_0x45a67d){return _0x45a67d;});}return null;};}function removeEntity(_0x323c6a,_0xe8e452){return function(_0x137992){if(_0x137992){return _0x137992['destroy']()[_0x791a('0x20')](function(){_0x323c6a[_0x791a('0x16')](0xcc)[_0x791a('0x17')]();});}};}function handleEntityNotFound(_0x2966b8,_0x4d748a){return function(_0x456480){if(!_0x456480){_0x2966b8[_0x791a('0x21')](0x194);}return _0x456480;};}function handleError(_0x51dcca,_0xdfa84f){_0xdfa84f=_0xdfa84f||0x1f4;return function(_0x1785f5){logger[_0x791a('0x22')](_0x1785f5['stack']);if(_0x1785f5[_0x791a('0x23')]){delete _0x1785f5[_0x791a('0x23')];}_0x51dcca[_0x791a('0x16')](_0xdfa84f)[_0x791a('0x24')](_0x1785f5);};}exports[_0x791a('0x25')]=function(_0x1a9c6b,_0x628816){var _0x889534={},_0x58bbc0={},_0xbc3436={'count':0x0,'rows':[]};var _0x9e9332=_[_0x791a('0x26')](db['ZendeskAccount'][_0x791a('0x27')],function(_0x5df656){return{'name':_0x5df656[_0x791a('0x28')],'type':_0x5df656[_0x791a('0x29')][_0x791a('0x2a')]};});_0x58bbc0[_0x791a('0x2b')]=_[_0x791a('0x26')](_0x9e9332,_0x791a('0x23'));_0x58bbc0[_0x791a('0x2c')]=_['keys'](_0x1a9c6b[_0x791a('0x2c')]);_0x58bbc0[_0x791a('0x2d')]=_[_0x791a('0x2e')](_0x58bbc0[_0x791a('0x2b')],_0x58bbc0[_0x791a('0x2c')]);_0x889534['attributes']=_[_0x791a('0x2e')](_0x58bbc0[_0x791a('0x2b')],qs[_0x791a('0x2f')](_0x1a9c6b[_0x791a('0x2c')][_0x791a('0x2f')]));_0x889534['attributes']=_0x889534[_0x791a('0x30')][_0x791a('0x31')]?_0x889534[_0x791a('0x30')]:_0x58bbc0[_0x791a('0x2b')];if(!_0x1a9c6b[_0x791a('0x2c')]['hasOwnProperty'](_0x791a('0x32'))){_0x889534['limit']=qs[_0x791a('0x1a')](_0x1a9c6b['query']['limit']);_0x889534[_0x791a('0x19')]=qs[_0x791a('0x19')](_0x1a9c6b[_0x791a('0x2c')][_0x791a('0x19')]);}_0x889534[_0x791a('0x33')]=qs[_0x791a('0x34')](_0x1a9c6b[_0x791a('0x2c')]['sort']);_0x889534[_0x791a('0x35')]=qs['filters'](_[_0x791a('0x36')](_0x1a9c6b['query'],_0x58bbc0[_0x791a('0x2d')]),_0x9e9332);if(_0x1a9c6b[_0x791a('0x2c')]['filter']){_0x889534[_0x791a('0x35')]=_[_0x791a('0x37')](_0x889534['where'],{'$or':_[_0x791a('0x26')](_0x9e9332,function(_0x165e2b){if(_0x165e2b[_0x791a('0x29')]!==_0x791a('0x38')){var _0x29d267={};_0x29d267[_0x165e2b[_0x791a('0x23')]]={'$like':'%'+_0x1a9c6b[_0x791a('0x2c')][_0x791a('0x39')]+'%'};return _0x29d267;}})});}_0x889534=_[_0x791a('0x37')]({},_0x889534,_0x1a9c6b[_0x791a('0x3a')]);var _0x587481={'where':_0x889534[_0x791a('0x35')]};return db[_0x791a('0x3b')][_0x791a('0x3c')](_0x587481)['then'](function(_0xf4e2fa){_0xbc3436['count']=_0xf4e2fa;if(_0x1a9c6b['query']['includeAll']){_0x889534[_0x791a('0x3d')]=[{'all':!![]}];}return db[_0x791a('0x3b')]['findAll'](_0x889534);})[_0x791a('0x20')](function(_0x2d1692){_0xbc3436[_0x791a('0x3e')]=_0x2d1692;return _0xbc3436;})[_0x791a('0x20')](respondWithFilteredResult(_0x628816,_0x889534))['catch'](handleError(_0x628816,null));};exports['show']=function(_0x57b9ba,_0x2f0395){var _0x216dd3={'raw':![],'where':{'id':_0x57b9ba[_0x791a('0x3f')]['id']}},_0x4e0191={};_0x4e0191[_0x791a('0x2b')]=_[_0x791a('0x40')](db[_0x791a('0x3b')]['rawAttributes']);_0x4e0191[_0x791a('0x2c')]=_['keys'](_0x57b9ba[_0x791a('0x2c')]);_0x4e0191[_0x791a('0x2d')]=_[_0x791a('0x2e')](_0x4e0191[_0x791a('0x2b')],_0x4e0191[_0x791a('0x2c')]);_0x216dd3['attributes']=_[_0x791a('0x2e')](_0x4e0191[_0x791a('0x2b')],qs[_0x791a('0x2f')](_0x57b9ba[_0x791a('0x2c')][_0x791a('0x2f')]));_0x216dd3['attributes']=_0x216dd3[_0x791a('0x30')][_0x791a('0x31')]?_0x216dd3['attributes']:_0x4e0191['model'];if(_0x57b9ba[_0x791a('0x2c')][_0x791a('0x41')]){_0x216dd3[_0x791a('0x3d')]=[{'all':!![]}];}_0x216dd3=_['merge']({},_0x216dd3,_0x57b9ba['options']);return db[_0x791a('0x3b')][_0x791a('0x42')](_0x216dd3)['then'](handleEntityNotFound(_0x2f0395,null))[_0x791a('0x20')](respondWithResult(_0x2f0395,null))[_0x791a('0x43')](handleError(_0x2f0395,null));};exports[_0x791a('0x44')]=function(_0x549980,_0x5a30a6){return db[_0x791a('0x3b')][_0x791a('0x44')](_0x549980[_0x791a('0x45')],{})[_0x791a('0x20')](respondWithResult(_0x5a30a6,0xc9))['catch'](handleError(_0x5a30a6,null));};exports[_0x791a('0x1f')]=function(_0x9f768a,_0x4e6d0d){if(_0x9f768a[_0x791a('0x45')]['id']){delete _0x9f768a['body']['id'];}return db[_0x791a('0x3b')][_0x791a('0x42')]({'where':{'id':_0x9f768a[_0x791a('0x3f')]['id']}})[_0x791a('0x20')](handleEntityNotFound(_0x4e6d0d,null))[_0x791a('0x20')](saveUpdates(_0x9f768a[_0x791a('0x45')],null))[_0x791a('0x20')](respondWithResult(_0x4e6d0d,null))['catch'](handleError(_0x4e6d0d,null));};exports[_0x791a('0x46')]=function(_0x1fd826,_0x4bffa6){return db[_0x791a('0x3b')][_0x791a('0x42')]({'where':{'id':_0x1fd826['params']['id']}})[_0x791a('0x20')](handleEntityNotFound(_0x4bffa6,null))[_0x791a('0x20')](removeEntity(_0x4bffa6,null))[_0x791a('0x43')](handleError(_0x4bffa6,null));};exports[_0x791a('0x47')]=function(_0xd5ec90,_0x4d82eb,_0x4ab42f){var _0x5a616f={};var _0x305033={};var _0x51b556;var _0x4c7555;return db[_0x791a('0x3b')]['findOne']({'where':{'id':_0xd5ec90[_0x791a('0x3f')]['id']}})[_0x791a('0x20')](handleEntityNotFound(_0x4d82eb,null))['then'](function(_0x5166b5){if(_0x5166b5){_0x51b556=_0x5166b5;_0x305033[_0x791a('0x2b')]=_['keys'](db[_0x791a('0x48')][_0x791a('0x27')]);_0x305033[_0x791a('0x2c')]=_['keys'](_0xd5ec90[_0x791a('0x2c')]);_0x305033[_0x791a('0x2d')]=_['intersection'](_0x305033[_0x791a('0x2b')],_0x305033[_0x791a('0x2c')]);_0x5a616f[_0x791a('0x30')]=_[_0x791a('0x2e')](_0x305033[_0x791a('0x2b')],qs[_0x791a('0x2f')](_0xd5ec90['query']['fields']));_0x5a616f[_0x791a('0x30')]=_0x5a616f['attributes'][_0x791a('0x31')]?_0x5a616f[_0x791a('0x30')]:_0x305033[_0x791a('0x2b')];_0x5a616f[_0x791a('0x33')]=qs[_0x791a('0x34')](_0xd5ec90[_0x791a('0x2c')][_0x791a('0x34')]);_0x5a616f['where']=qs[_0x791a('0x2d')](_[_0x791a('0x36')](_0xd5ec90[_0x791a('0x2c')],_0x305033[_0x791a('0x2d')]));if(_0xd5ec90[_0x791a('0x2c')][_0x791a('0x39')]){_0x5a616f[_0x791a('0x35')]=_['merge'](_0x5a616f[_0x791a('0x35')],{'$or':_['map'](_0x5a616f['attributes'],function(_0x1cc240){var _0x3c81e2={};_0x3c81e2[_0x1cc240]={'$like':'%'+_0xd5ec90[_0x791a('0x2c')][_0x791a('0x39')]+'%'};return _0x3c81e2;})});}_0x5a616f=_[_0x791a('0x37')]({},_0x5a616f,_0xd5ec90[_0x791a('0x3a')]);return _0x51b556[_0x791a('0x47')](_0x5a616f);}})[_0x791a('0x20')](function(_0x2bfb66){if(_0x2bfb66){_0x4c7555=_0x2bfb66[_0x791a('0x31')];if(!_0xd5ec90[_0x791a('0x2c')][_0x791a('0x49')](_0x791a('0x32'))){_0x5a616f[_0x791a('0x1a')]=qs[_0x791a('0x1a')](_0xd5ec90[_0x791a('0x2c')][_0x791a('0x1a')]);_0x5a616f[_0x791a('0x19')]=qs[_0x791a('0x19')](_0xd5ec90[_0x791a('0x2c')]['offset']);}return _0x51b556[_0x791a('0x47')](_0x5a616f);}})[_0x791a('0x20')](function(_0x380087){if(_0x380087){return _0x380087?{'count':_0x4c7555,'rows':_0x380087}:null;}})[_0x791a('0x20')](respondWithResult(_0x4d82eb,null))[_0x791a('0x43')](handleError(_0x4d82eb,null));};exports['addConfiguration']=function(_0x42ce59,_0x3d24bd,_0x277774){if(_0x42ce59[_0x791a('0x45')]['id']){delete _0x42ce59['body']['id'];}return db[_0x791a('0x3b')]['findOne']({'where':{'id':_0x42ce59['params']['id']}})['then'](handleEntityNotFound(_0x3d24bd,null))['then'](function(_0x22aaf2){if(_0x22aaf2){_0x42ce59[_0x791a('0x45')][_0x791a('0x4a')]=_0x22aaf2['id'];_0x42ce59[_0x791a('0x45')][_0x791a('0x4b')]=integrations[_0x791a('0x4c')](_0x42ce59[_0x791a('0x45')]['channel'],_0x42ce59['body'][_0x791a('0x29')]);_0x42ce59[_0x791a('0x45')]['Descriptions']=integrations['getDescriptions'](_0x42ce59[_0x791a('0x45')][_0x791a('0x4d')],_0x42ce59['body'][_0x791a('0x29')]);return db[_0x791a('0x48')][_0x791a('0x44')](_0x42ce59[_0x791a('0x45')],{'include':[{'model':db['ZendeskField'],'as':'Subjects'},{'model':db[_0x791a('0x4e')],'as':_0x791a('0x4f')}]});}return null;})['then'](respondWithResult(_0x3d24bd,null))[_0x791a('0x43')](handleError(_0x3d24bd,null));};exports[_0x791a('0x50')]=function(_0x10b51f,_0x3838c4,_0x565c83){var _0x24efc2='';return db[_0x791a('0x3b')][_0x791a('0x51')]({'where':{'id':_0x10b51f[_0x791a('0x3f')]['id']},'attributes':['id',_0x791a('0x52'),_0x791a('0x53'),_0x791a('0x54'),_0x791a('0x55'),'remoteUri']})['then'](handleEntityNotFound(_0x3838c4,null))['then'](function(_0xf8ac72){if(_0xf8ac72){_0x24efc2=_0xf8ac72[_0x791a('0x56')];var _0x1118a8=_0x24efc2[_0x791a('0x57')](-0x1);if(_0x1118a8==='/'){_0x24efc2=_0x24efc2[_0x791a('0x58')](0x0,_0x24efc2[_0x791a('0x59')](_0x1118a8));}var _0x348e54={'method':_0x791a('0x5a'),'uri':util[_0x791a('0x5b')](_0x791a('0x5c'),_0x24efc2,'ticket_fields'),'json':!![]};switch(_0xf8ac72[_0x791a('0x55')]){case _0x791a('0x53'):_0x348e54['headers']={'Authorization':util[_0x791a('0x5b')](_0x791a('0x5d'),new Buffer(util['format']('%s:%s',_0xf8ac72[_0x791a('0x52')],_0xf8ac72[_0x791a('0x53')]))['toString']('base64'))};break;case _0x791a('0x54'):_0x348e54[_0x791a('0x5e')]={'Authorization':util[_0x791a('0x5b')]('Basic\x20%s',new Buffer(util[_0x791a('0x5b')]('%s/token:%s',_0xf8ac72[_0x791a('0x52')],_0xf8ac72[_0x791a('0x54')]))[_0x791a('0x5f')](_0x791a('0x60')))};break;default:throw new db[(_0x791a('0x61'))][(_0x791a('0x62'))]('Unknown\x20authentication\x20type');}return rp(_0x348e54);}})[_0x791a('0x20')](function(_0x2e666e){if(_0x2e666e){var _0x41d1a5=[_0x791a('0x63'),_0x791a('0x64'),_0x791a('0x65'),_0x791a('0x66')];_[_0x791a('0x67')](_0x2e666e[_0x791a('0x68')],function(_0x203fc5){return _0x41d1a5[_0x791a('0x69')](_0x203fc5[_0x791a('0x29')]);});return{'count':_0x2e666e[_0x791a('0x68')][_0x791a('0x31')],'rows':_[_0x791a('0x26')](_0x2e666e[_0x791a('0x68')],function(_0x3272c0){return{'id':_0x3272c0['id'],'name':_0x3272c0[_0x791a('0x6a')]>0x7?_0x3272c0['title']:_0x3272c0[_0x791a('0x29')],'custom':_0x3272c0[_0x791a('0x6a')]>0x7?!![]:![],'options':_0x3272c0[_0x791a('0x6b')]?_0x3272c0[_0x791a('0x6b')]:_0x3272c0[_0x791a('0x6c')]?_0x3272c0['custom_field_options']:[]};})};}})[_0x791a('0x20')](respondWithResult(_0x3838c4,null))['catch'](function(_0x467d65){var _0x48b8dc=_0x10b51f[_0x791a('0x2c')][_0x791a('0x6d')]?0x1f4:_0x467d65['statusCode']||0x1f4;logger[_0x791a('0x22')](_0x791a('0x6e'),_0x791a('0x50'),_0x48b8dc,JSON['stringify'](_0x467d65));delete _0x467d65[_0x791a('0x23')];if(_0x48b8dc===0x191){_0x48b8dc=0x190;}_0x3838c4['status'](_0x48b8dc)[_0x791a('0x24')](_0x10b51f['query']['test']?{'message':'Wrong\x20credentials','statusCode':_0x467d65[_0x791a('0x6f')]}:_0x467d65);});}; \ No newline at end of file +var _0x16d2=['where','VIRTUAL','options','includeAll','findAll','rows','show','include','find','create','catch','body','params','ZendeskConfiguration','getConfigurations','addConfiguration','findOne','AccountId','Subjects','getSubjects','channel','Descriptions','ZendeskField','getFields','password','authType','remoteUri','slice','substring','GET','%s/%s','ticket_fields','headers','format','%s:%s','toString','base64','Basic\x20%s','%s/token:%s','username','Sequelize','subject','description','assignee','remove','position','title','system_field_options','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','send','test','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','offset','undefined','limit','count','Content-Range','json','reject','save','update','then','destroy','error','stack','index','map','ZendeskAccount','rawAttributes','fieldName','type','model','name','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','merge'];(function(_0x3869c8,_0x2ff137){var _0x4caf60=function(_0x224384){while(--_0x224384){_0x3869c8['push'](_0x3869c8['shift']());}};_0x4caf60(++_0x2ff137);}(_0x16d2,0x123));var _0x216d=function(_0x28e78c,_0x1819c1){_0x28e78c=_0x28e78c-0x0;var _0x164e5c=_0x16d2[_0x28e78c];return _0x164e5c;};'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'];var integrations=require(_0x216d('0x1c'));function respondWithStatusCode(_0x4c92d9,_0xb36a43){_0xb36a43=_0xb36a43||0xcc;return function(_0x4c07d0){if(_0x4c07d0){return _0x4c92d9[_0x216d('0x1d')](_0xb36a43);}return _0x4c92d9[_0x216d('0x1e')](_0xb36a43)['end']();};}function respondWithResult(_0x165c19,_0x322e4b){_0x322e4b=_0x322e4b||0xc8;return function(_0x54a816){if(_0x54a816){return _0x165c19[_0x216d('0x1e')](_0x322e4b)['json'](_0x54a816);}};}function respondWithFilteredResult(_0x448c0d,_0xf571a4){return function(_0x4631b0){if(_0x4631b0){var _0x23ff86=typeof _0xf571a4[_0x216d('0x1f')]===_0x216d('0x20')&&typeof _0xf571a4[_0x216d('0x21')]===_0x216d('0x20');var _0x19fdac=_0x4631b0['count'];var _0x3b60dd=_0x23ff86?0x0:_0xf571a4['offset'];var _0x4ddc51=_0x23ff86?_0x4631b0[_0x216d('0x22')]:_0xf571a4[_0x216d('0x1f')]+_0xf571a4['limit'];var _0x3f32e0;if(_0x4ddc51>=_0x19fdac){_0x4ddc51=_0x19fdac;_0x3f32e0=0xc8;}else{_0x3f32e0=0xce;}_0x448c0d[_0x216d('0x1e')](_0x3f32e0);return _0x448c0d['set'](_0x216d('0x23'),_0x3b60dd+'-'+_0x4ddc51+'/'+_0x19fdac)[_0x216d('0x24')](_0x4631b0);}return null;};}function patchUpdates(_0x430e81){return function(_0x3e9818){try{jsonpatch['apply'](_0x3e9818,_0x430e81,!![]);}catch(_0x20ee7c){return BPromise[_0x216d('0x25')](_0x20ee7c);}return _0x3e9818[_0x216d('0x26')]();};}function saveUpdates(_0x438981,_0x206782){return function(_0x57cfbd){if(_0x57cfbd){return _0x57cfbd[_0x216d('0x27')](_0x438981)[_0x216d('0x28')](function(_0x188494){return _0x188494;});}return null;};}function removeEntity(_0x2880c6,_0x6fa4b3){return function(_0x54d96f){if(_0x54d96f){return _0x54d96f[_0x216d('0x29')]()[_0x216d('0x28')](function(){_0x2880c6[_0x216d('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4ec8a7,_0x56460f){return function(_0x4c792e){if(!_0x4c792e){_0x4ec8a7['sendStatus'](0x194);}return _0x4c792e;};}function handleError(_0x32f240,_0x470d8a){_0x470d8a=_0x470d8a||0x1f4;return function(_0x189413){logger[_0x216d('0x2a')](_0x189413[_0x216d('0x2b')]);if(_0x189413['name']){delete _0x189413['name'];}_0x32f240[_0x216d('0x1e')](_0x470d8a)['send'](_0x189413);};}exports[_0x216d('0x2c')]=function(_0x42abbe,_0x10f7c6){var _0x20bc16={},_0x307f2b={},_0x12bcab={'count':0x0,'rows':[]};var _0x28fcc2=_[_0x216d('0x2d')](db[_0x216d('0x2e')][_0x216d('0x2f')],function(_0x11be90){return{'name':_0x11be90[_0x216d('0x30')],'type':_0x11be90[_0x216d('0x31')]['key']};});_0x307f2b[_0x216d('0x32')]=_[_0x216d('0x2d')](_0x28fcc2,_0x216d('0x33'));_0x307f2b['query']=_[_0x216d('0x34')](_0x42abbe[_0x216d('0x35')]);_0x307f2b[_0x216d('0x36')]=_[_0x216d('0x37')](_0x307f2b['model'],_0x307f2b[_0x216d('0x35')]);_0x20bc16[_0x216d('0x38')]=_[_0x216d('0x37')](_0x307f2b[_0x216d('0x32')],qs[_0x216d('0x39')](_0x42abbe[_0x216d('0x35')][_0x216d('0x39')]));_0x20bc16[_0x216d('0x38')]=_0x20bc16[_0x216d('0x38')][_0x216d('0x3a')]?_0x20bc16[_0x216d('0x38')]:_0x307f2b['model'];if(!_0x42abbe[_0x216d('0x35')][_0x216d('0x3b')](_0x216d('0x3c'))){_0x20bc16['limit']=qs[_0x216d('0x21')](_0x42abbe[_0x216d('0x35')]['limit']);_0x20bc16[_0x216d('0x1f')]=qs['offset'](_0x42abbe['query'][_0x216d('0x1f')]);}_0x20bc16[_0x216d('0x3d')]=qs[_0x216d('0x3e')](_0x42abbe[_0x216d('0x35')]['sort']);_0x20bc16['where']=qs['filters'](_[_0x216d('0x3f')](_0x42abbe[_0x216d('0x35')],_0x307f2b['filters']),_0x28fcc2);if(_0x42abbe[_0x216d('0x35')][_0x216d('0x40')]){_0x20bc16['where']=_[_0x216d('0x41')](_0x20bc16[_0x216d('0x42')],{'$or':_[_0x216d('0x2d')](_0x28fcc2,function(_0x474fab){if(_0x474fab[_0x216d('0x31')]!==_0x216d('0x43')){var _0x35cb6e={};_0x35cb6e[_0x474fab[_0x216d('0x33')]]={'$like':'%'+_0x42abbe['query']['filter']+'%'};return _0x35cb6e;}})});}_0x20bc16=_[_0x216d('0x41')]({},_0x20bc16,_0x42abbe[_0x216d('0x44')]);var _0x504a34={'where':_0x20bc16[_0x216d('0x42')]};return db[_0x216d('0x2e')][_0x216d('0x22')](_0x504a34)['then'](function(_0x2c3e44){_0x12bcab[_0x216d('0x22')]=_0x2c3e44;if(_0x42abbe[_0x216d('0x35')][_0x216d('0x45')]){_0x20bc16['include']=[{'all':!![]}];}return db[_0x216d('0x2e')][_0x216d('0x46')](_0x20bc16);})['then'](function(_0x37bf4a){_0x12bcab[_0x216d('0x47')]=_0x37bf4a;return _0x12bcab;})['then'](respondWithFilteredResult(_0x10f7c6,_0x20bc16))['catch'](handleError(_0x10f7c6,null));};exports[_0x216d('0x48')]=function(_0x440bc9,_0x3c491e){var _0x498efe={'raw':![],'where':{'id':_0x440bc9['params']['id']}},_0x3e361a={};_0x3e361a['model']=_[_0x216d('0x34')](db[_0x216d('0x2e')][_0x216d('0x2f')]);_0x3e361a['query']=_[_0x216d('0x34')](_0x440bc9['query']);_0x3e361a[_0x216d('0x36')]=_[_0x216d('0x37')](_0x3e361a[_0x216d('0x32')],_0x3e361a['query']);_0x498efe[_0x216d('0x38')]=_[_0x216d('0x37')](_0x3e361a[_0x216d('0x32')],qs[_0x216d('0x39')](_0x440bc9['query']['fields']));_0x498efe['attributes']=_0x498efe[_0x216d('0x38')][_0x216d('0x3a')]?_0x498efe[_0x216d('0x38')]:_0x3e361a[_0x216d('0x32')];if(_0x440bc9[_0x216d('0x35')][_0x216d('0x45')]){_0x498efe[_0x216d('0x49')]=[{'all':!![]}];}_0x498efe=_[_0x216d('0x41')]({},_0x498efe,_0x440bc9['options']);return db[_0x216d('0x2e')][_0x216d('0x4a')](_0x498efe)[_0x216d('0x28')](handleEntityNotFound(_0x3c491e,null))[_0x216d('0x28')](respondWithResult(_0x3c491e,null))['catch'](handleError(_0x3c491e,null));};exports[_0x216d('0x4b')]=function(_0x542e1b,_0x1f2fa5){return db[_0x216d('0x2e')][_0x216d('0x4b')](_0x542e1b['body'],{})['then'](respondWithResult(_0x1f2fa5,0xc9))[_0x216d('0x4c')](handleError(_0x1f2fa5,null));};exports[_0x216d('0x27')]=function(_0x3932a3,_0x1340fe){if(_0x3932a3[_0x216d('0x4d')]['id']){delete _0x3932a3[_0x216d('0x4d')]['id'];}return db['ZendeskAccount']['find']({'where':{'id':_0x3932a3[_0x216d('0x4e')]['id']}})['then'](handleEntityNotFound(_0x1340fe,null))[_0x216d('0x28')](saveUpdates(_0x3932a3[_0x216d('0x4d')],null))['then'](respondWithResult(_0x1340fe,null))['catch'](handleError(_0x1340fe,null));};exports['destroy']=function(_0x4bac14,_0x1ae9b7){return db[_0x216d('0x2e')][_0x216d('0x4a')]({'where':{'id':_0x4bac14[_0x216d('0x4e')]['id']}})[_0x216d('0x28')](handleEntityNotFound(_0x1ae9b7,null))[_0x216d('0x28')](removeEntity(_0x1ae9b7,null))[_0x216d('0x4c')](handleError(_0x1ae9b7,null));};exports['getConfigurations']=function(_0x3f70c9,_0x34cdb9,_0x119b12){var _0x54dd49={};var _0x1e1caf={};var _0x10fe2e;var _0x2c7c67;return db[_0x216d('0x2e')]['findOne']({'where':{'id':_0x3f70c9[_0x216d('0x4e')]['id']}})[_0x216d('0x28')](handleEntityNotFound(_0x34cdb9,null))[_0x216d('0x28')](function(_0x1a4761){if(_0x1a4761){_0x10fe2e=_0x1a4761;_0x1e1caf['model']=_[_0x216d('0x34')](db[_0x216d('0x4f')]['rawAttributes']);_0x1e1caf[_0x216d('0x35')]=_['keys'](_0x3f70c9[_0x216d('0x35')]);_0x1e1caf[_0x216d('0x36')]=_[_0x216d('0x37')](_0x1e1caf[_0x216d('0x32')],_0x1e1caf[_0x216d('0x35')]);_0x54dd49[_0x216d('0x38')]=_[_0x216d('0x37')](_0x1e1caf[_0x216d('0x32')],qs[_0x216d('0x39')](_0x3f70c9['query'][_0x216d('0x39')]));_0x54dd49[_0x216d('0x38')]=_0x54dd49['attributes'][_0x216d('0x3a')]?_0x54dd49[_0x216d('0x38')]:_0x1e1caf['model'];_0x54dd49['order']=qs[_0x216d('0x3e')](_0x3f70c9['query'][_0x216d('0x3e')]);_0x54dd49[_0x216d('0x42')]=qs[_0x216d('0x36')](_['pick'](_0x3f70c9[_0x216d('0x35')],_0x1e1caf['filters']));if(_0x3f70c9['query'][_0x216d('0x40')]){_0x54dd49[_0x216d('0x42')]=_['merge'](_0x54dd49[_0x216d('0x42')],{'$or':_[_0x216d('0x2d')](_0x54dd49[_0x216d('0x38')],function(_0x3f9097){var _0x2ae667={};_0x2ae667[_0x3f9097]={'$like':'%'+_0x3f70c9[_0x216d('0x35')]['filter']+'%'};return _0x2ae667;})});}_0x54dd49=_['merge']({},_0x54dd49,_0x3f70c9[_0x216d('0x44')]);return _0x10fe2e[_0x216d('0x50')](_0x54dd49);}})[_0x216d('0x28')](function(_0x1551b6){if(_0x1551b6){_0x2c7c67=_0x1551b6[_0x216d('0x3a')];if(!_0x3f70c9[_0x216d('0x35')][_0x216d('0x3b')](_0x216d('0x3c'))){_0x54dd49[_0x216d('0x21')]=qs[_0x216d('0x21')](_0x3f70c9[_0x216d('0x35')][_0x216d('0x21')]);_0x54dd49['offset']=qs['offset'](_0x3f70c9[_0x216d('0x35')][_0x216d('0x1f')]);}return _0x10fe2e['getConfigurations'](_0x54dd49);}})[_0x216d('0x28')](function(_0x5eb684){if(_0x5eb684){return _0x5eb684?{'count':_0x2c7c67,'rows':_0x5eb684}:null;}})['then'](respondWithResult(_0x34cdb9,null))[_0x216d('0x4c')](handleError(_0x34cdb9,null));};exports[_0x216d('0x51')]=function(_0x20806e,_0x17ce26,_0x1d404c){if(_0x20806e[_0x216d('0x4d')]['id']){delete _0x20806e[_0x216d('0x4d')]['id'];}return db[_0x216d('0x2e')][_0x216d('0x52')]({'where':{'id':_0x20806e[_0x216d('0x4e')]['id']}})[_0x216d('0x28')](handleEntityNotFound(_0x17ce26,null))[_0x216d('0x28')](function(_0x19c7cf){if(_0x19c7cf){_0x20806e[_0x216d('0x4d')][_0x216d('0x53')]=_0x19c7cf['id'];_0x20806e[_0x216d('0x4d')][_0x216d('0x54')]=integrations[_0x216d('0x55')](_0x20806e[_0x216d('0x4d')][_0x216d('0x56')],_0x20806e[_0x216d('0x4d')][_0x216d('0x31')]);_0x20806e['body'][_0x216d('0x57')]=integrations['getDescriptions'](_0x20806e[_0x216d('0x4d')]['channel'],_0x20806e[_0x216d('0x4d')][_0x216d('0x31')]);return db['ZendeskConfiguration'][_0x216d('0x4b')](_0x20806e[_0x216d('0x4d')],{'include':[{'model':db[_0x216d('0x58')],'as':_0x216d('0x54')},{'model':db[_0x216d('0x58')],'as':_0x216d('0x57')}]});}return null;})[_0x216d('0x28')](respondWithResult(_0x17ce26,null))[_0x216d('0x4c')](handleError(_0x17ce26,null));};exports[_0x216d('0x59')]=function(_0x5acc44,_0x120f8a,_0x299cc7){var _0x16cf09='';return db['ZendeskAccount']['findOne']({'where':{'id':_0x5acc44['params']['id']},'attributes':['id','username',_0x216d('0x5a'),'token',_0x216d('0x5b'),_0x216d('0x5c')]})[_0x216d('0x28')](handleEntityNotFound(_0x120f8a,null))[_0x216d('0x28')](function(_0x431014){if(_0x431014){_0x16cf09=_0x431014[_0x216d('0x5c')];var _0x3a2e7c=_0x16cf09[_0x216d('0x5d')](-0x1);if(_0x3a2e7c==='/'){_0x16cf09=_0x16cf09[_0x216d('0x5e')](0x0,_0x16cf09['lastIndexOf'](_0x3a2e7c));}var _0x4e4e1a={'method':_0x216d('0x5f'),'uri':util['format'](_0x216d('0x60'),_0x16cf09,_0x216d('0x61')),'json':!![]};switch(_0x431014[_0x216d('0x5b')]){case _0x216d('0x5a'):_0x4e4e1a[_0x216d('0x62')]={'Authorization':util[_0x216d('0x63')]('Basic\x20%s',new Buffer(util['format'](_0x216d('0x64'),_0x431014['username'],_0x431014[_0x216d('0x5a')]))[_0x216d('0x65')](_0x216d('0x66')))};break;case'token':_0x4e4e1a['headers']={'Authorization':util['format'](_0x216d('0x67'),new Buffer(util[_0x216d('0x63')](_0x216d('0x68'),_0x431014[_0x216d('0x69')],_0x431014['token']))[_0x216d('0x65')](_0x216d('0x66')))};break;default:throw new db[(_0x216d('0x6a'))]['ValidationError']('Unknown\x20authentication\x20type');}return rp(_0x4e4e1a);}})[_0x216d('0x28')](function(_0x87511b){if(_0x87511b){var _0x273d11=[_0x216d('0x6b'),_0x216d('0x6c'),'group',_0x216d('0x6d')];_[_0x216d('0x6e')](_0x87511b[_0x216d('0x61')],function(_0x325bd8){return _0x273d11['includes'](_0x325bd8[_0x216d('0x31')]);});return{'count':_0x87511b['ticket_fields'][_0x216d('0x3a')],'rows':_['map'](_0x87511b[_0x216d('0x61')],function(_0x3ae6df){return{'id':_0x3ae6df['id'],'name':_0x3ae6df[_0x216d('0x6f')]>0x7?_0x3ae6df[_0x216d('0x70')]:_0x3ae6df[_0x216d('0x31')],'custom':_0x3ae6df['position']>0x7?!![]:![],'options':_0x3ae6df[_0x216d('0x71')]?_0x3ae6df['system_field_options']:_0x3ae6df['custom_field_options']?_0x3ae6df['custom_field_options']:[]};})};}})['then'](respondWithResult(_0x120f8a,null))[_0x216d('0x4c')](function(_0x38e7d7){var _0xa1594b=_0x5acc44['query']['test']?0x1f4:_0x38e7d7[_0x216d('0x72')]||0x1f4;logger[_0x216d('0x2a')](_0x216d('0x73'),_0x216d('0x59'),_0xa1594b,JSON[_0x216d('0x74')](_0x38e7d7));delete _0x38e7d7['name'];if(_0xa1594b===0x191){_0xa1594b=0x190;}_0x120f8a['status'](_0xa1594b)[_0x216d('0x75')](_0x5acc44['query'][_0x216d('0x76')]?{'message':'Wrong\x20credentials','statusCode':_0x38e7d7[_0x216d('0x72')]}:_0x38e7d7);});}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.model.js b/server/api/intZendeskAccount/intZendeskAccount.model.js index adc4d1a..b3d25aa 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 _0x2b76=['lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','../../components/integrations/configuration','define','ZendeskAccount','int_zendesk_accounts'];(function(_0x3ab9ee,_0x4a74b8){var _0x82ee88=function(_0x6ccc7e){while(--_0x6ccc7e){_0x3ab9ee['push'](_0x3ab9ee['shift']());}};_0x82ee88(++_0x4a74b8);}(_0x2b76,0xc3));var _0x62b7=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x2b76[_0x4b369d];return _0x571a98;};'use strict';var _=require(_0x62b7('0x0'));var util=require(_0x62b7('0x1'));var logger=require(_0x62b7('0x2'))(_0x62b7('0x3'));var moment=require(_0x62b7('0x4'));var BPromise=require('bluebird');var rp=require(_0x62b7('0x5'));var fs=require('fs');var path=require(_0x62b7('0x6'));var rimraf=require(_0x62b7('0x7'));var config=require(_0x62b7('0x8'));var attributes=require('./intZendeskAccount.attributes');var integrations=require(_0x62b7('0x9'));module['exports']=function(_0x543735,_0x19bf91){return _0x543735[_0x62b7('0xa')](_0x62b7('0xb'),attributes,{'tableName':_0x62b7('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe210=['ZendeskAccount','int_zendesk_accounts','lodash','util','api','moment','bluebird','request-promise','path','rimraf','./intZendeskAccount.attributes','../../components/integrations/configuration','exports','define'];(function(_0x4c4ecf,_0x59c18d){var _0x2a6ed5=function(_0x3177e6){while(--_0x3177e6){_0x4c4ecf['push'](_0x4c4ecf['shift']());}};_0x2a6ed5(++_0x59c18d);}(_0xe210,0xfe));var _0x0e21=function(_0xf71120,_0x25b7f9){_0xf71120=_0xf71120-0x0;var _0xbe2fd3=_0xe210[_0xf71120];return _0xbe2fd3;};'use strict';var _=require(_0x0e21('0x0'));var util=require(_0x0e21('0x1'));var logger=require('../../config/logger')(_0x0e21('0x2'));var moment=require(_0x0e21('0x3'));var BPromise=require(_0x0e21('0x4'));var rp=require(_0x0e21('0x5'));var fs=require('fs');var path=require(_0x0e21('0x6'));var rimraf=require(_0x0e21('0x7'));var config=require('../../config/environment');var attributes=require(_0x0e21('0x8'));var integrations=require(_0x0e21('0x9'));module[_0x0e21('0xa')]=function(_0x3372c8,_0x388afd){return _0x3372c8[_0x0e21('0xb')](_0x0e21('0xc'),attributes,{'tableName':_0x0e21('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.rpc.js b/server/api/intZendeskAccount/intZendeskAccount.rpc.js index 7f509bf..ff7714a 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 _0xeadc=['moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ZendeskAccount,\x20%s,\x20%s','request\x20sent','debug','ZendeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetZendeskAccount','ZendeskAccount','options','limit','include','model','attributes','map','ShowZendeskAccount','find','raw','where','lodash'];(function(_0x474bc0,_0x26989c){var _0x4b24cf=function(_0x4be866){while(--_0x4be866){_0x474bc0['push'](_0x474bc0['shift']());}};_0x4b24cf(++_0x26989c);}(_0xeadc,0x143));var _0xcead=function(_0x41a8d9,_0x4bce33){_0x41a8d9=_0x41a8d9-0x0;var _0x3e29d5=_0xeadc[_0x41a8d9];return _0x3e29d5;};'use strict';var _=require(_0xcead('0x0'));var util=require('util');var moment=require(_0xcead('0x1'));var BPromise=require(_0xcead('0x2'));var rs=require(_0xcead('0x3'));var fs=require('fs');var Redis=require(_0xcead('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xcead('0x5'));var logger=require('../../config/logger')(_0xcead('0x6'));var config=require(_0xcead('0x7'));var jayson=require(_0xcead('0x8'));var client=jayson[_0xcead('0x9')][_0xcead('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x10c165,_0x168a11,_0x145024){return new BPromise(function(_0x1c2f86,_0x349e12){return client[_0xcead('0xb')](_0x10c165,_0x145024)[_0xcead('0xc')](function(_0x572501){logger[_0xcead('0xd')](_0xcead('0xe'),_0x168a11,_0xcead('0xf'));logger[_0xcead('0x10')](_0xcead('0x11'),_0x168a11,_0xcead('0xf'),JSON[_0xcead('0x12')](_0x572501));if(_0x572501['error']){if(_0x572501[_0xcead('0x13')][_0xcead('0x14')]===0x1f4){logger[_0xcead('0x13')](_0xcead('0xe'),_0x168a11,_0x572501['error'][_0xcead('0x15')]);return _0x349e12(_0x572501['error']['message']);}logger[_0xcead('0x13')](_0xcead('0xe'),_0x168a11,_0x572501[_0xcead('0x13')][_0xcead('0x15')]);return _0x1c2f86(_0x572501[_0xcead('0x13')]['message']);}else{logger['info'](_0xcead('0xe'),_0x168a11,_0xcead('0xf'));_0x1c2f86(_0x572501[_0xcead('0x16')][_0xcead('0x15')]);}})[_0xcead('0x17')](function(_0x4aa811){logger[_0xcead('0x13')]('ZendeskAccount,\x20%s,\x20%s',_0x168a11,_0x4aa811);_0x349e12(_0x4aa811);});});}exports[_0xcead('0x18')]=function(_0x3489f1){var _0x442bd4=this;return new Promise(function(_0x437955,_0x2d9354){return db[_0xcead('0x19')]['findAll']({'raw':_0x3489f1[_0xcead('0x1a')]?_0x3489f1[_0xcead('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x3489f1[_0xcead('0x1a')]?_0x3489f1[_0xcead('0x1a')]['where']||null:null,'attributes':_0x3489f1[_0xcead('0x1a')]?_0x3489f1[_0xcead('0x1a')]['attributes']||null:null,'limit':_0x3489f1[_0xcead('0x1a')]?_0x3489f1[_0xcead('0x1a')][_0xcead('0x1b')]||null:null,'include':_0x3489f1[_0xcead('0x1a')]?_0x3489f1[_0xcead('0x1a')][_0xcead('0x1c')]?_['map'](_0x3489f1['options']['include'],function(_0x37389d){return{'model':db[_0x37389d[_0xcead('0x1d')]],'as':_0x37389d['as'],'attributes':_0x37389d[_0xcead('0x1e')],'include':_0x37389d[_0xcead('0x1c')]?_[_0xcead('0x1f')](_0x37389d['include'],function(_0x46fda8){return{'model':db[_0x46fda8[_0xcead('0x1d')]],'as':_0x46fda8['as'],'attributes':_0x46fda8[_0xcead('0x1e')],'include':_0x46fda8['include']?_['map'](_0x46fda8[_0xcead('0x1c')],function(_0x516619){return{'model':db[_0x516619[_0xcead('0x1d')]],'as':_0x516619['as'],'attributes':_0x516619[_0xcead('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2288c3){logger['info']('GetZendeskAccount',_0x3489f1);logger[_0xcead('0x10')](_0xcead('0x18'),_0x3489f1,JSON[_0xcead('0x12')](_0x2288c3));_0x437955(_0x2288c3);})['catch'](function(_0x2d2b08){logger['error'](_0xcead('0x18'),_0x2d2b08[_0xcead('0x15')],_0x3489f1);_0x2d9354(_0x442bd4[_0xcead('0x13')](0x1f4,_0x2d2b08[_0xcead('0x15')]));});});};exports[_0xcead('0x20')]=function(_0x3a5721){var _0xd1529b=this;return new Promise(function(_0x447889,_0x5fdddd){return db[_0xcead('0x19')][_0xcead('0x21')]({'raw':_0x3a5721[_0xcead('0x1a')]?_0x3a5721['options'][_0xcead('0x22')]===undefined?!![]:![]:!![],'where':_0x3a5721[_0xcead('0x1a')]?_0x3a5721[_0xcead('0x1a')][_0xcead('0x23')]||null:null,'attributes':_0x3a5721[_0xcead('0x1a')]?_0x3a5721[_0xcead('0x1a')][_0xcead('0x1e')]||null:null,'include':_0x3a5721[_0xcead('0x1a')]?_0x3a5721[_0xcead('0x1a')][_0xcead('0x1c')]?_[_0xcead('0x1f')](_0x3a5721[_0xcead('0x1a')][_0xcead('0x1c')],function(_0x3d5802){return{'model':db[_0x3d5802['model']],'as':_0x3d5802['as'],'attributes':_0x3d5802['attributes'],'include':_0x3d5802[_0xcead('0x1c')]?_['map'](_0x3d5802[_0xcead('0x1c')],function(_0x4d0a20){return{'model':db[_0x4d0a20[_0xcead('0x1d')]],'as':_0x4d0a20['as'],'attributes':_0x4d0a20[_0xcead('0x1e')],'include':_0x4d0a20[_0xcead('0x1c')]?_[_0xcead('0x1f')](_0x4d0a20[_0xcead('0x1c')],function(_0x357279){return{'model':db[_0x357279['model']],'as':_0x357279['as'],'attributes':_0x357279[_0xcead('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xcead('0xc')](function(_0x477462){logger[_0xcead('0xd')]('ShowZendeskAccount',_0x3a5721);logger[_0xcead('0x10')](_0xcead('0x20'),_0x3a5721,JSON[_0xcead('0x12')](_0x477462));_0x447889(_0x477462);})[_0xcead('0x17')](function(_0x43707e){logger[_0xcead('0x13')](_0xcead('0x20'),_0x43707e[_0xcead('0x15')],_0x3a5721);_0x5fdddd(_0xd1529b[_0xcead('0x13')](0x1f4,_0x43707e[_0xcead('0x15')]));});});}; \ No newline at end of file +var _0x261a=['stringify','error','code','ZendeskAccount,\x20%s,\x20%s','message','result','catch','ZendeskAccount','findAll','options','raw','where','attributes','include','model','map','GetZendeskAccount','ShowZendeskAccount','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','request\x20sent','debug','ZendeskAccount,\x20%s,\x20%s,\x20%s'];(function(_0x4f3056,_0xe685f6){var _0x2b8af0=function(_0x3e04c2){while(--_0x3e04c2){_0x4f3056['push'](_0x4f3056['shift']());}};_0x2b8af0(++_0xe685f6);}(_0x261a,0x1e6));var _0xa261=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x261a[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xa261('0x0'));var util=require(_0xa261('0x1'));var moment=require('moment');var BPromise=require(_0xa261('0x2'));var rs=require(_0xa261('0x3'));var fs=require('fs');var Redis=require(_0xa261('0x4'));var db=require(_0xa261('0x5'))['db'];var utils=require(_0xa261('0x6'));var logger=require(_0xa261('0x7'))(_0xa261('0x8'));var config=require(_0xa261('0x9'));var jayson=require(_0xa261('0xa'));var client=jayson['client'][_0xa261('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2357f4,_0x58dea0,_0x3b0544){return new BPromise(function(_0x2f0a41,_0x11835a){return client[_0xa261('0xc')](_0x2357f4,_0x3b0544)[_0xa261('0xd')](function(_0x2516c6){logger[_0xa261('0xe')]('ZendeskAccount,\x20%s,\x20%s',_0x58dea0,_0xa261('0xf'));logger[_0xa261('0x10')](_0xa261('0x11'),_0x58dea0,_0xa261('0xf'),JSON[_0xa261('0x12')](_0x2516c6));if(_0x2516c6[_0xa261('0x13')]){if(_0x2516c6[_0xa261('0x13')][_0xa261('0x14')]===0x1f4){logger[_0xa261('0x13')](_0xa261('0x15'),_0x58dea0,_0x2516c6[_0xa261('0x13')][_0xa261('0x16')]);return _0x11835a(_0x2516c6[_0xa261('0x13')][_0xa261('0x16')]);}logger[_0xa261('0x13')](_0xa261('0x15'),_0x58dea0,_0x2516c6['error'][_0xa261('0x16')]);return _0x2f0a41(_0x2516c6[_0xa261('0x13')][_0xa261('0x16')]);}else{logger[_0xa261('0xe')](_0xa261('0x15'),_0x58dea0,_0xa261('0xf'));_0x2f0a41(_0x2516c6[_0xa261('0x17')][_0xa261('0x16')]);}})[_0xa261('0x18')](function(_0x36c926){logger[_0xa261('0x13')](_0xa261('0x15'),_0x58dea0,_0x36c926);_0x11835a(_0x36c926);});});}exports['GetZendeskAccount']=function(_0x3e00de){var _0x5a1ba0=this;return new Promise(function(_0x356692,_0x31d66f){return db[_0xa261('0x19')][_0xa261('0x1a')]({'raw':_0x3e00de[_0xa261('0x1b')]?_0x3e00de['options'][_0xa261('0x1c')]===undefined?!![]:![]:!![],'where':_0x3e00de[_0xa261('0x1b')]?_0x3e00de[_0xa261('0x1b')][_0xa261('0x1d')]||null:null,'attributes':_0x3e00de['options']?_0x3e00de['options'][_0xa261('0x1e')]||null:null,'limit':_0x3e00de[_0xa261('0x1b')]?_0x3e00de[_0xa261('0x1b')]['limit']||null:null,'include':_0x3e00de[_0xa261('0x1b')]?_0x3e00de[_0xa261('0x1b')][_0xa261('0x1f')]?_['map'](_0x3e00de[_0xa261('0x1b')][_0xa261('0x1f')],function(_0x274802){return{'model':db[_0x274802[_0xa261('0x20')]],'as':_0x274802['as'],'attributes':_0x274802['attributes'],'include':_0x274802[_0xa261('0x1f')]?_[_0xa261('0x21')](_0x274802[_0xa261('0x1f')],function(_0x2c6f53){return{'model':db[_0x2c6f53[_0xa261('0x20')]],'as':_0x2c6f53['as'],'attributes':_0x2c6f53[_0xa261('0x1e')],'include':_0x2c6f53['include']?_[_0xa261('0x21')](_0x2c6f53[_0xa261('0x1f')],function(_0x363fb0){return{'model':db[_0x363fb0[_0xa261('0x20')]],'as':_0x363fb0['as'],'attributes':_0x363fb0[_0xa261('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xa261('0xd')](function(_0x5a9cfe){logger[_0xa261('0xe')]('GetZendeskAccount',_0x3e00de);logger[_0xa261('0x10')](_0xa261('0x22'),_0x3e00de,JSON[_0xa261('0x12')](_0x5a9cfe));_0x356692(_0x5a9cfe);})[_0xa261('0x18')](function(_0x51b733){logger[_0xa261('0x13')](_0xa261('0x22'),_0x51b733[_0xa261('0x16')],_0x3e00de);_0x31d66f(_0x5a1ba0['error'](0x1f4,_0x51b733[_0xa261('0x16')]));});});};exports['ShowZendeskAccount']=function(_0x50a34c){var _0x43a32a=this;return new Promise(function(_0x24cb93,_0x5a6b79){return db[_0xa261('0x19')]['find']({'raw':_0x50a34c[_0xa261('0x1b')]?_0x50a34c['options'][_0xa261('0x1c')]===undefined?!![]:![]:!![],'where':_0x50a34c[_0xa261('0x1b')]?_0x50a34c[_0xa261('0x1b')][_0xa261('0x1d')]||null:null,'attributes':_0x50a34c['options']?_0x50a34c[_0xa261('0x1b')]['attributes']||null:null,'include':_0x50a34c[_0xa261('0x1b')]?_0x50a34c['options']['include']?_[_0xa261('0x21')](_0x50a34c['options'][_0xa261('0x1f')],function(_0x2e3f79){return{'model':db[_0x2e3f79[_0xa261('0x20')]],'as':_0x2e3f79['as'],'attributes':_0x2e3f79[_0xa261('0x1e')],'include':_0x2e3f79[_0xa261('0x1f')]?_[_0xa261('0x21')](_0x2e3f79['include'],function(_0x5dc36c){return{'model':db[_0x5dc36c['model']],'as':_0x5dc36c['as'],'attributes':_0x5dc36c[_0xa261('0x1e')],'include':_0x5dc36c[_0xa261('0x1f')]?_[_0xa261('0x21')](_0x5dc36c[_0xa261('0x1f')],function(_0x4436d7){return{'model':db[_0x4436d7[_0xa261('0x20')]],'as':_0x4436d7['as'],'attributes':_0x4436d7['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x49b073){logger[_0xa261('0xe')](_0xa261('0x23'),_0x50a34c);logger[_0xa261('0x10')](_0xa261('0x23'),_0x50a34c,JSON[_0xa261('0x12')](_0x49b073));_0x24cb93(_0x49b073);})[_0xa261('0x18')](function(_0x3b8058){logger['error'](_0xa261('0x23'),_0x3b8058[_0xa261('0x16')],_0x50a34c);_0x5a6b79(_0x43a32a[_0xa261('0x13')](0x1f4,_0x3b8058[_0xa261('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/index.js b/server/api/intZendeskConfiguration/index.js index de03d88..482dfa6 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 _0x91a7=['util','path','connect-timeout','Router','../../components/auth/service','./intZendeskConfiguration.controller','get','index','/:id','isAuthenticated','/:id/fields','getFields','getSubjects','/:id/descriptions','getDescriptions','/:id/tags','create','put','update','destroy','exports'];(function(_0x54a64e,_0x3e182a){var _0x505c8c=function(_0x42f1d3){while(--_0x42f1d3){_0x54a64e['push'](_0x54a64e['shift']());}};_0x505c8c(++_0x3e182a);}(_0x91a7,0xe7));var _0x791a=function(_0x2cc076,_0xf89cda){_0x2cc076=_0x2cc076-0x0;var _0x5b6ab4=_0x91a7[_0x2cc076];return _0x5b6ab4;};'use strict';var multer=require('multer');var util=require(_0x791a('0x0'));var path=require(_0x791a('0x1'));var timeout=require(_0x791a('0x2'));var express=require('express');var router=express[_0x791a('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x791a('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x791a('0x5'));router[_0x791a('0x6')]('/',auth['isAuthenticated'](),controller[_0x791a('0x7')]);router['get'](_0x791a('0x8'),auth[_0x791a('0x9')](),controller['show']);router[_0x791a('0x6')](_0x791a('0xa'),auth[_0x791a('0x9')](),controller[_0x791a('0xb')]);router[_0x791a('0x6')]('/:id/subjects',auth[_0x791a('0x9')](),controller[_0x791a('0xc')]);router['get'](_0x791a('0xd'),auth[_0x791a('0x9')](),controller[_0x791a('0xe')]);router[_0x791a('0x6')](_0x791a('0xf'),auth[_0x791a('0x9')](),controller['getTags']);router['post']('/',auth[_0x791a('0x9')](),controller[_0x791a('0x10')]);router['post'](_0x791a('0xf'),auth[_0x791a('0x9')](),controller['setTags']);router[_0x791a('0x11')](_0x791a('0x8'),auth[_0x791a('0x9')](),controller[_0x791a('0x12')]);router['delete'](_0x791a('0x8'),auth['isAuthenticated'](),controller[_0x791a('0x13')]);module[_0x791a('0x14')]=router; \ No newline at end of file +var _0x087b=['getSubjects','/:id/descriptions','getDescriptions','getTags','post','create','/:id/tags','setTags','put','update','delete','destroy','multer','util','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields'];(function(_0x3301a9,_0x626c35){var _0x36cad6=function(_0x3059ba){while(--_0x3059ba){_0x3301a9['push'](_0x3301a9['shift']());}};_0x36cad6(++_0x626c35);}(_0x087b,0x11a));var _0xb087=function(_0x4a3898,_0x4c9853){_0x4a3898=_0x4a3898-0x0;var _0x25ceb0=_0x087b[_0x4a3898];return _0x25ceb0;};'use strict';var multer=require(_0xb087('0x0'));var util=require(_0xb087('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xb087('0x2'));var router=express['Router']();var fs_extra=require(_0xb087('0x3'));var auth=require(_0xb087('0x4'));var interaction=require(_0xb087('0x5'));var config=require(_0xb087('0x6'));var controller=require(_0xb087('0x7'));router[_0xb087('0x8')]('/',auth[_0xb087('0x9')](),controller[_0xb087('0xa')]);router[_0xb087('0x8')](_0xb087('0xb'),auth[_0xb087('0x9')](),controller[_0xb087('0xc')]);router[_0xb087('0x8')](_0xb087('0xd'),auth[_0xb087('0x9')](),controller[_0xb087('0xe')]);router[_0xb087('0x8')]('/:id/subjects',auth[_0xb087('0x9')](),controller[_0xb087('0xf')]);router[_0xb087('0x8')](_0xb087('0x10'),auth[_0xb087('0x9')](),controller[_0xb087('0x11')]);router[_0xb087('0x8')]('/:id/tags',auth[_0xb087('0x9')](),controller[_0xb087('0x12')]);router[_0xb087('0x13')]('/',auth['isAuthenticated'](),controller[_0xb087('0x14')]);router[_0xb087('0x13')](_0xb087('0x15'),auth[_0xb087('0x9')](),controller[_0xb087('0x16')]);router[_0xb087('0x17')](_0xb087('0xb'),auth[_0xb087('0x9')](),controller[_0xb087('0x18')]);router[_0xb087('0x19')]('/:id',auth[_0xb087('0x9')](),controller[_0xb087('0x1a')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js index 1dbef70..15b08e7 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 _0x0c51=['STRING'];(function(_0x5b05d5,_0x3c5f4d){var _0x3422b7=function(_0x147ecc){while(--_0x147ecc){_0x5b05d5['push'](_0x5b05d5['shift']());}};_0x3422b7(++_0x3c5f4d);}(_0x0c51,0x8f));var _0x10c5=function(_0x22a0d2,_0x410186){_0x22a0d2=_0x22a0d2-0x0;var _0x402e55=_0x0c51[_0x22a0d2];return _0x402e55;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x10c5('0x0')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x2dbc=['STRING','exports'];(function(_0x3e4f3c,_0x34406f){var _0x133314=function(_0x1de99e){while(--_0x1de99e){_0x3e4f3c['push'](_0x3e4f3c['shift']());}};_0x133314(++_0x34406f);}(_0x2dbc,0xc7));var _0xc2db=function(_0x13187a,_0x2fcec4){_0x13187a=_0x13187a-0x0;var _0x65b85f=_0x2dbc[_0x13187a];return _0x65b85f;};'use strict';var Sequelize=require('sequelize');module[_0xc2db('0x0')]={'name':{'type':Sequelize[_0xc2db('0x1')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js index c88a6ca..dc10724 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 _0xa82a=['then','destroy','error','stack','name','send','index','map','ZendeskConfiguration','rawAttributes','fieldName','type','key','query','filters','intersection','model','attributes','fields','length','order','sort','where','pick','filter','merge','VIRTUAL','options','include','rows','catch','show','params','keys','includeAll','find','create','body','getFields','findOne','ZendeskField','hasOwnProperty','nolimit','getSubjects','getDescriptions','Tag','getTags','setTags','ids','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end','offset','undefined','limit','count','Content-Range','apply','reject','save','update'];(function(_0x4ce028,_0x526d4b){var _0x583d0c=function(_0x874178){while(--_0x874178){_0x4ce028['push'](_0x4ce028['shift']());}};_0x583d0c(++_0x526d4b);}(_0xa82a,0x189));var _0xaa82=function(_0x47024a,_0x392b86){_0x47024a=_0x47024a-0x0;var _0x5f45a2=_0xa82a[_0x47024a];return _0x5f45a2;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xaa82('0x0'));var zipdir=require(_0xaa82('0x1'));var jsonpatch=require(_0xaa82('0x2'));var rp=require('request-promise');var moment=require(_0xaa82('0x3'));var BPromise=require(_0xaa82('0x4'));var Mustache=require('mustache');var util=require(_0xaa82('0x5'));var path=require(_0xaa82('0x6'));var sox=require('sox');var csv=require(_0xaa82('0x7'));var ejs=require(_0xaa82('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xaa82('0x9'));var squel=require(_0xaa82('0xa'));var crypto=require(_0xaa82('0xb'));var jsforce=require(_0xaa82('0xc'));var deskjs=require(_0xaa82('0xd'));var toCsv=require(_0xaa82('0x7'));var querystring=require(_0xaa82('0xe'));var Papa=require(_0xaa82('0xf'));var Redis=require(_0xaa82('0x10'));var authService=require(_0xaa82('0x11'));var qs=require(_0xaa82('0x12'));var as=require(_0xaa82('0x13'));var hardwareService=require(_0xaa82('0x14'));var logger=require(_0xaa82('0x15'))(_0xaa82('0x16'));var utils=require('../../config/utils');var config=require(_0xaa82('0x17'));var licenseUtil=require(_0xaa82('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x6e3e16,_0x2e14a7){_0x2e14a7=_0x2e14a7||0xcc;return function(_0x2f27f0){if(_0x2f27f0){return _0x6e3e16[_0xaa82('0x19')](_0x2e14a7);}return _0x6e3e16[_0xaa82('0x1a')](_0x2e14a7)[_0xaa82('0x1b')]();};}function respondWithResult(_0x8a3a0c,_0x4efcd9){_0x4efcd9=_0x4efcd9||0xc8;return function(_0x3b62bf){if(_0x3b62bf){return _0x8a3a0c[_0xaa82('0x1a')](_0x4efcd9)['json'](_0x3b62bf);}};}function respondWithFilteredResult(_0x1894c1,_0x4c6cfa){return function(_0x2eff50){if(_0x2eff50){var _0x53f051=typeof _0x4c6cfa[_0xaa82('0x1c')]===_0xaa82('0x1d')&&typeof _0x4c6cfa[_0xaa82('0x1e')]===_0xaa82('0x1d');var _0x547cc6=_0x2eff50[_0xaa82('0x1f')];var _0xff4639=_0x53f051?0x0:_0x4c6cfa[_0xaa82('0x1c')];var _0x540e18=_0x53f051?_0x2eff50['count']:_0x4c6cfa[_0xaa82('0x1c')]+_0x4c6cfa[_0xaa82('0x1e')];var _0x311dce;if(_0x540e18>=_0x547cc6){_0x540e18=_0x547cc6;_0x311dce=0xc8;}else{_0x311dce=0xce;}_0x1894c1[_0xaa82('0x1a')](_0x311dce);return _0x1894c1['set'](_0xaa82('0x20'),_0xff4639+'-'+_0x540e18+'/'+_0x547cc6)['json'](_0x2eff50);}return null;};}function patchUpdates(_0xceb3d2){return function(_0x35385d){try{jsonpatch[_0xaa82('0x21')](_0x35385d,_0xceb3d2,!![]);}catch(_0xdbbcc3){return BPromise[_0xaa82('0x22')](_0xdbbcc3);}return _0x35385d[_0xaa82('0x23')]();};}function saveUpdates(_0x40e547,_0x40e8dd){return function(_0x10ac40){if(_0x10ac40){return _0x10ac40[_0xaa82('0x24')](_0x40e547)[_0xaa82('0x25')](function(_0x39b4d2){return _0x39b4d2;});}return null;};}function removeEntity(_0x17145f,_0x414b19){return function(_0x324c67){if(_0x324c67){return _0x324c67[_0xaa82('0x26')]()[_0xaa82('0x25')](function(){_0x17145f['status'](0xcc)[_0xaa82('0x1b')]();});}};}function handleEntityNotFound(_0x402113,_0xb0bf2c){return function(_0x5ed468){if(!_0x5ed468){_0x402113[_0xaa82('0x19')](0x194);}return _0x5ed468;};}function handleError(_0x5bcafb,_0x35731f){_0x35731f=_0x35731f||0x1f4;return function(_0x4125e7){logger[_0xaa82('0x27')](_0x4125e7[_0xaa82('0x28')]);if(_0x4125e7['name']){delete _0x4125e7[_0xaa82('0x29')];}_0x5bcafb[_0xaa82('0x1a')](_0x35731f)[_0xaa82('0x2a')](_0x4125e7);};}exports[_0xaa82('0x2b')]=function(_0x244865,_0x4af5fd){var _0x5ea4fb={},_0x5ef934={},_0x3147d2={'count':0x0,'rows':[]};var _0x229f1a=_[_0xaa82('0x2c')](db[_0xaa82('0x2d')][_0xaa82('0x2e')],function(_0x2a3791){return{'name':_0x2a3791[_0xaa82('0x2f')],'type':_0x2a3791[_0xaa82('0x30')][_0xaa82('0x31')]};});_0x5ef934['model']=_[_0xaa82('0x2c')](_0x229f1a,_0xaa82('0x29'));_0x5ef934[_0xaa82('0x32')]=_['keys'](_0x244865[_0xaa82('0x32')]);_0x5ef934[_0xaa82('0x33')]=_[_0xaa82('0x34')](_0x5ef934[_0xaa82('0x35')],_0x5ef934[_0xaa82('0x32')]);_0x5ea4fb[_0xaa82('0x36')]=_[_0xaa82('0x34')](_0x5ef934[_0xaa82('0x35')],qs[_0xaa82('0x37')](_0x244865[_0xaa82('0x32')]['fields']));_0x5ea4fb[_0xaa82('0x36')]=_0x5ea4fb[_0xaa82('0x36')][_0xaa82('0x38')]?_0x5ea4fb[_0xaa82('0x36')]:_0x5ef934[_0xaa82('0x35')];if(!_0x244865['query']['hasOwnProperty']('nolimit')){_0x5ea4fb[_0xaa82('0x1e')]=qs[_0xaa82('0x1e')](_0x244865[_0xaa82('0x32')]['limit']);_0x5ea4fb[_0xaa82('0x1c')]=qs[_0xaa82('0x1c')](_0x244865[_0xaa82('0x32')][_0xaa82('0x1c')]);}_0x5ea4fb[_0xaa82('0x39')]=qs[_0xaa82('0x3a')](_0x244865['query']['sort']);_0x5ea4fb[_0xaa82('0x3b')]=qs[_0xaa82('0x33')](_[_0xaa82('0x3c')](_0x244865[_0xaa82('0x32')],_0x5ef934[_0xaa82('0x33')]),_0x229f1a);if(_0x244865[_0xaa82('0x32')][_0xaa82('0x3d')]){_0x5ea4fb[_0xaa82('0x3b')]=_[_0xaa82('0x3e')](_0x5ea4fb['where'],{'$or':_[_0xaa82('0x2c')](_0x229f1a,function(_0x16f031){if(_0x16f031[_0xaa82('0x30')]!==_0xaa82('0x3f')){var _0x2558f6={};_0x2558f6[_0x16f031[_0xaa82('0x29')]]={'$like':'%'+_0x244865[_0xaa82('0x32')][_0xaa82('0x3d')]+'%'};return _0x2558f6;}})});}_0x5ea4fb=_[_0xaa82('0x3e')]({},_0x5ea4fb,_0x244865[_0xaa82('0x40')]);var _0xf094d4={'where':_0x5ea4fb[_0xaa82('0x3b')]};return db[_0xaa82('0x2d')][_0xaa82('0x1f')](_0xf094d4)[_0xaa82('0x25')](function(_0x2d8bfb){_0x3147d2[_0xaa82('0x1f')]=_0x2d8bfb;if(_0x244865[_0xaa82('0x32')]['includeAll']){_0x5ea4fb[_0xaa82('0x41')]=[{'all':!![]}];}return db[_0xaa82('0x2d')]['findAll'](_0x5ea4fb);})[_0xaa82('0x25')](function(_0x349a3c){_0x3147d2[_0xaa82('0x42')]=_0x349a3c;return _0x3147d2;})[_0xaa82('0x25')](respondWithFilteredResult(_0x4af5fd,_0x5ea4fb))[_0xaa82('0x43')](handleError(_0x4af5fd,null));};exports[_0xaa82('0x44')]=function(_0x47ec40,_0x37efbc){var _0x1651bf={'raw':![],'where':{'id':_0x47ec40[_0xaa82('0x45')]['id']}},_0x2e8fe9={};_0x2e8fe9[_0xaa82('0x35')]=_[_0xaa82('0x46')](db['ZendeskConfiguration'][_0xaa82('0x2e')]);_0x2e8fe9['query']=_[_0xaa82('0x46')](_0x47ec40[_0xaa82('0x32')]);_0x2e8fe9[_0xaa82('0x33')]=_[_0xaa82('0x34')](_0x2e8fe9[_0xaa82('0x35')],_0x2e8fe9[_0xaa82('0x32')]);_0x1651bf['attributes']=_[_0xaa82('0x34')](_0x2e8fe9['model'],qs[_0xaa82('0x37')](_0x47ec40[_0xaa82('0x32')][_0xaa82('0x37')]));_0x1651bf[_0xaa82('0x36')]=_0x1651bf[_0xaa82('0x36')][_0xaa82('0x38')]?_0x1651bf['attributes']:_0x2e8fe9['model'];if(_0x47ec40[_0xaa82('0x32')][_0xaa82('0x47')]){_0x1651bf[_0xaa82('0x41')]=[{'all':!![]}];}_0x1651bf=_[_0xaa82('0x3e')]({},_0x1651bf,_0x47ec40[_0xaa82('0x40')]);return db['ZendeskConfiguration'][_0xaa82('0x48')](_0x1651bf)[_0xaa82('0x25')](handleEntityNotFound(_0x37efbc,null))[_0xaa82('0x25')](respondWithResult(_0x37efbc,null))['catch'](handleError(_0x37efbc,null));};exports[_0xaa82('0x49')]=function(_0x2cab45,_0x9054b1){return db[_0xaa82('0x2d')][_0xaa82('0x49')](_0x2cab45[_0xaa82('0x4a')],{})[_0xaa82('0x25')](respondWithResult(_0x9054b1,0xc9))[_0xaa82('0x43')](handleError(_0x9054b1,null));};exports[_0xaa82('0x24')]=function(_0x293f80,_0x23d222){if(_0x293f80[_0xaa82('0x4a')]['id']){delete _0x293f80[_0xaa82('0x4a')]['id'];}return db[_0xaa82('0x2d')][_0xaa82('0x48')]({'where':{'id':_0x293f80['params']['id']}})['then'](handleEntityNotFound(_0x23d222,null))[_0xaa82('0x25')](saveUpdates(_0x293f80[_0xaa82('0x4a')],null))[_0xaa82('0x25')](respondWithResult(_0x23d222,null))[_0xaa82('0x43')](handleError(_0x23d222,null));};exports['destroy']=function(_0x4bb4dc,_0x1b7203){return db[_0xaa82('0x2d')][_0xaa82('0x48')]({'where':{'id':_0x4bb4dc[_0xaa82('0x45')]['id']}})[_0xaa82('0x25')](handleEntityNotFound(_0x1b7203,null))[_0xaa82('0x25')](removeEntity(_0x1b7203,null))[_0xaa82('0x43')](handleError(_0x1b7203,null));};exports[_0xaa82('0x4b')]=function(_0x7fe7ce,_0x3eca24,_0x36b79e){var _0x68156d={};var _0x3a6782={};var _0x594619;var _0x5e9702;return db[_0xaa82('0x2d')][_0xaa82('0x4c')]({'where':{'id':_0x7fe7ce[_0xaa82('0x45')]['id']}})[_0xaa82('0x25')](handleEntityNotFound(_0x3eca24,null))['then'](function(_0x2ddf14){if(_0x2ddf14){_0x594619=_0x2ddf14;_0x3a6782[_0xaa82('0x35')]=_[_0xaa82('0x46')](db[_0xaa82('0x4d')][_0xaa82('0x2e')]);_0x3a6782['query']=_[_0xaa82('0x46')](_0x7fe7ce[_0xaa82('0x32')]);_0x3a6782['filters']=_[_0xaa82('0x34')](_0x3a6782[_0xaa82('0x35')],_0x3a6782[_0xaa82('0x32')]);_0x68156d['attributes']=_[_0xaa82('0x34')](_0x3a6782[_0xaa82('0x35')],qs[_0xaa82('0x37')](_0x7fe7ce[_0xaa82('0x32')]['fields']));_0x68156d[_0xaa82('0x36')]=_0x68156d['attributes']['length']?_0x68156d[_0xaa82('0x36')]:_0x3a6782[_0xaa82('0x35')];_0x68156d[_0xaa82('0x39')]=qs[_0xaa82('0x3a')](_0x7fe7ce[_0xaa82('0x32')][_0xaa82('0x3a')]);_0x68156d[_0xaa82('0x3b')]=qs[_0xaa82('0x33')](_[_0xaa82('0x3c')](_0x7fe7ce[_0xaa82('0x32')],_0x3a6782['filters']));if(_0x7fe7ce[_0xaa82('0x32')][_0xaa82('0x3d')]){_0x68156d['where']=_[_0xaa82('0x3e')](_0x68156d[_0xaa82('0x3b')],{'$or':_['map'](_0x68156d[_0xaa82('0x36')],function(_0x4428ab){var _0x49c9fa={};_0x49c9fa[_0x4428ab]={'$like':'%'+_0x7fe7ce['query']['filter']+'%'};return _0x49c9fa;})});}_0x68156d=_['merge']({},_0x68156d,_0x7fe7ce[_0xaa82('0x40')]);return _0x594619[_0xaa82('0x4b')](_0x68156d);}})['then'](function(_0x2dea47){if(_0x2dea47){_0x5e9702=_0x2dea47[_0xaa82('0x38')];if(!_0x7fe7ce[_0xaa82('0x32')][_0xaa82('0x4e')](_0xaa82('0x4f'))){_0x68156d['limit']=qs[_0xaa82('0x1e')](_0x7fe7ce[_0xaa82('0x32')][_0xaa82('0x1e')]);_0x68156d[_0xaa82('0x1c')]=qs[_0xaa82('0x1c')](_0x7fe7ce['query']['offset']);}return _0x594619[_0xaa82('0x4b')](_0x68156d);}})[_0xaa82('0x25')](function(_0x4b1418){if(_0x4b1418){return _0x4b1418?{'count':_0x5e9702,'rows':_0x4b1418}:null;}})['then'](respondWithResult(_0x3eca24,null))['catch'](handleError(_0x3eca24,null));};exports[_0xaa82('0x50')]=function(_0x52c678,_0x22a180,_0x46f799){var _0x5715ca={};var _0x2e80ff={};var _0x176b5e;var _0x2efdf4;return db[_0xaa82('0x2d')][_0xaa82('0x4c')]({'where':{'id':_0x52c678[_0xaa82('0x45')]['id']}})[_0xaa82('0x25')](handleEntityNotFound(_0x22a180,null))[_0xaa82('0x25')](function(_0x110b08){if(_0x110b08){_0x176b5e=_0x110b08;_0x2e80ff[_0xaa82('0x35')]=_[_0xaa82('0x46')](db[_0xaa82('0x4d')][_0xaa82('0x2e')]);_0x2e80ff[_0xaa82('0x32')]=_['keys'](_0x52c678[_0xaa82('0x32')]);_0x2e80ff[_0xaa82('0x33')]=_[_0xaa82('0x34')](_0x2e80ff[_0xaa82('0x35')],_0x2e80ff[_0xaa82('0x32')]);_0x5715ca['attributes']=_[_0xaa82('0x34')](_0x2e80ff[_0xaa82('0x35')],qs['fields'](_0x52c678[_0xaa82('0x32')]['fields']));_0x5715ca[_0xaa82('0x36')]=_0x5715ca['attributes']['length']?_0x5715ca[_0xaa82('0x36')]:_0x2e80ff[_0xaa82('0x35')];_0x5715ca[_0xaa82('0x39')]=qs[_0xaa82('0x3a')](_0x52c678[_0xaa82('0x32')][_0xaa82('0x3a')]);_0x5715ca[_0xaa82('0x3b')]=qs[_0xaa82('0x33')](_[_0xaa82('0x3c')](_0x52c678[_0xaa82('0x32')],_0x2e80ff[_0xaa82('0x33')]));if(_0x52c678[_0xaa82('0x32')]['filter']){_0x5715ca[_0xaa82('0x3b')]=_[_0xaa82('0x3e')](_0x5715ca[_0xaa82('0x3b')],{'$or':_['map'](_0x5715ca[_0xaa82('0x36')],function(_0x3e9178){var _0x538d30={};_0x538d30[_0x3e9178]={'$like':'%'+_0x52c678[_0xaa82('0x32')][_0xaa82('0x3d')]+'%'};return _0x538d30;})});}_0x5715ca=_[_0xaa82('0x3e')]({},_0x5715ca,_0x52c678['options']);return _0x176b5e[_0xaa82('0x50')](_0x5715ca);}})[_0xaa82('0x25')](function(_0x538437){if(_0x538437){_0x2efdf4=_0x538437['length'];if(!_0x52c678[_0xaa82('0x32')]['hasOwnProperty'](_0xaa82('0x4f'))){_0x5715ca[_0xaa82('0x1e')]=qs[_0xaa82('0x1e')](_0x52c678['query'][_0xaa82('0x1e')]);_0x5715ca[_0xaa82('0x1c')]=qs[_0xaa82('0x1c')](_0x52c678[_0xaa82('0x32')][_0xaa82('0x1c')]);}return _0x176b5e['getSubjects'](_0x5715ca);}})[_0xaa82('0x25')](function(_0x222d4d){if(_0x222d4d){return _0x222d4d?{'count':_0x2efdf4,'rows':_0x222d4d}:null;}})[_0xaa82('0x25')](respondWithResult(_0x22a180,null))[_0xaa82('0x43')](handleError(_0x22a180,null));};exports[_0xaa82('0x51')]=function(_0x3a4657,_0x597147,_0x387074){var _0x2481fa={};var _0x1ddef3={};var _0x5178d6;var _0x51f74c;return db[_0xaa82('0x2d')][_0xaa82('0x4c')]({'where':{'id':_0x3a4657['params']['id']}})[_0xaa82('0x25')](handleEntityNotFound(_0x597147,null))[_0xaa82('0x25')](function(_0x340370){if(_0x340370){_0x5178d6=_0x340370;_0x1ddef3['model']=_['keys'](db[_0xaa82('0x4d')][_0xaa82('0x2e')]);_0x1ddef3[_0xaa82('0x32')]=_[_0xaa82('0x46')](_0x3a4657[_0xaa82('0x32')]);_0x1ddef3[_0xaa82('0x33')]=_[_0xaa82('0x34')](_0x1ddef3['model'],_0x1ddef3[_0xaa82('0x32')]);_0x2481fa[_0xaa82('0x36')]=_[_0xaa82('0x34')](_0x1ddef3[_0xaa82('0x35')],qs[_0xaa82('0x37')](_0x3a4657[_0xaa82('0x32')][_0xaa82('0x37')]));_0x2481fa['attributes']=_0x2481fa[_0xaa82('0x36')][_0xaa82('0x38')]?_0x2481fa['attributes']:_0x1ddef3[_0xaa82('0x35')];_0x2481fa[_0xaa82('0x39')]=qs[_0xaa82('0x3a')](_0x3a4657['query'][_0xaa82('0x3a')]);_0x2481fa[_0xaa82('0x3b')]=qs['filters'](_[_0xaa82('0x3c')](_0x3a4657[_0xaa82('0x32')],_0x1ddef3[_0xaa82('0x33')]));if(_0x3a4657[_0xaa82('0x32')]['filter']){_0x2481fa['where']=_[_0xaa82('0x3e')](_0x2481fa[_0xaa82('0x3b')],{'$or':_[_0xaa82('0x2c')](_0x2481fa[_0xaa82('0x36')],function(_0x51852a){var _0x44380a={};_0x44380a[_0x51852a]={'$like':'%'+_0x3a4657['query'][_0xaa82('0x3d')]+'%'};return _0x44380a;})});}_0x2481fa=_['merge']({},_0x2481fa,_0x3a4657[_0xaa82('0x40')]);return _0x5178d6[_0xaa82('0x51')](_0x2481fa);}})[_0xaa82('0x25')](function(_0x6bbdd){if(_0x6bbdd){_0x51f74c=_0x6bbdd[_0xaa82('0x38')];if(!_0x3a4657[_0xaa82('0x32')][_0xaa82('0x4e')](_0xaa82('0x4f'))){_0x2481fa[_0xaa82('0x1e')]=qs[_0xaa82('0x1e')](_0x3a4657[_0xaa82('0x32')][_0xaa82('0x1e')]);_0x2481fa[_0xaa82('0x1c')]=qs[_0xaa82('0x1c')](_0x3a4657[_0xaa82('0x32')][_0xaa82('0x1c')]);}return _0x5178d6[_0xaa82('0x51')](_0x2481fa);}})[_0xaa82('0x25')](function(_0x148462){if(_0x148462){return _0x148462?{'count':_0x51f74c,'rows':_0x148462}:null;}})[_0xaa82('0x25')](respondWithResult(_0x597147,null))[_0xaa82('0x43')](handleError(_0x597147,null));};exports['getTags']=function(_0x181f42,_0x1a2229,_0x16db41){var _0x1f48a6={};var _0x10965c={};var _0x427833;var _0x10ef97;return db[_0xaa82('0x2d')][_0xaa82('0x4c')]({'where':{'id':_0x181f42[_0xaa82('0x45')]['id']}})['then'](handleEntityNotFound(_0x1a2229,null))[_0xaa82('0x25')](function(_0x2a90a5){if(_0x2a90a5){_0x427833=_0x2a90a5;_0x10965c[_0xaa82('0x35')]=_['keys'](db[_0xaa82('0x52')]['rawAttributes']);_0x10965c[_0xaa82('0x32')]=_['keys'](_0x181f42[_0xaa82('0x32')]);_0x10965c[_0xaa82('0x33')]=_['intersection'](_0x10965c[_0xaa82('0x35')],_0x10965c[_0xaa82('0x32')]);_0x1f48a6[_0xaa82('0x36')]=_[_0xaa82('0x34')](_0x10965c['model'],qs[_0xaa82('0x37')](_0x181f42[_0xaa82('0x32')][_0xaa82('0x37')]));_0x1f48a6['attributes']=_0x1f48a6[_0xaa82('0x36')][_0xaa82('0x38')]?_0x1f48a6[_0xaa82('0x36')]:_0x10965c[_0xaa82('0x35')];_0x1f48a6[_0xaa82('0x39')]=qs['sort'](_0x181f42[_0xaa82('0x32')][_0xaa82('0x3a')]);_0x1f48a6[_0xaa82('0x3b')]=qs['filters'](_[_0xaa82('0x3c')](_0x181f42[_0xaa82('0x32')],_0x10965c[_0xaa82('0x33')]));if(_0x181f42[_0xaa82('0x32')][_0xaa82('0x3d')]){_0x1f48a6[_0xaa82('0x3b')]=_[_0xaa82('0x3e')](_0x1f48a6[_0xaa82('0x3b')],{'$or':_[_0xaa82('0x2c')](_0x1f48a6[_0xaa82('0x36')],function(_0x524ef9){var _0x1d0c08={};_0x1d0c08[_0x524ef9]={'$like':'%'+_0x181f42['query'][_0xaa82('0x3d')]+'%'};return _0x1d0c08;})});}_0x1f48a6=_[_0xaa82('0x3e')]({},_0x1f48a6,_0x181f42[_0xaa82('0x40')]);return _0x427833[_0xaa82('0x53')](_0x1f48a6);}})['then'](function(_0x16fb93){if(_0x16fb93){_0x10ef97=_0x16fb93[_0xaa82('0x38')];if(!_0x181f42['query'][_0xaa82('0x4e')](_0xaa82('0x4f'))){_0x1f48a6[_0xaa82('0x1e')]=qs[_0xaa82('0x1e')](_0x181f42[_0xaa82('0x32')]['limit']);_0x1f48a6[_0xaa82('0x1c')]=qs[_0xaa82('0x1c')](_0x181f42['query']['offset']);}return _0x427833[_0xaa82('0x53')](_0x1f48a6);}})[_0xaa82('0x25')](function(_0x4d4122){if(_0x4d4122){return _0x4d4122?{'count':_0x10ef97,'rows':_0x4d4122}:null;}})['then'](respondWithResult(_0x1a2229,null))[_0xaa82('0x43')](handleError(_0x1a2229,null));};exports[_0xaa82('0x54')]=function(_0x3895ab,_0x1cc9fd,_0x292f7d){if(_0x3895ab[_0xaa82('0x4a')]['id']){delete _0x3895ab[_0xaa82('0x4a')]['id'];}return db[_0xaa82('0x2d')][_0xaa82('0x4c')]({'where':{'id':_0x3895ab['params']['id']}})[_0xaa82('0x25')](handleEntityNotFound(_0x1cc9fd,null))['then'](function(_0x4ae0a5){if(_0x4ae0a5){return _0x4ae0a5[_0xaa82('0x54')](_0x3895ab['body'][_0xaa82('0x55')]||[]);}return null;})['then'](respondWithResult(_0x1cc9fd,null))[_0xaa82('0x43')](handleError(_0x1cc9fd,null));}; \ No newline at end of file +var _0xa96e=['pick','where','merge','VIRTUAL','options','ZendeskConfiguration','includeAll','catch','show','params','keys','length','find','create','body','findOne','ZendeskField','filter','getFields','getSubjects','getDescriptions','getTags','ids','eml-format','zip-dir','request-promise','bluebird','util','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','json','reject','save','update','then','destroy','error','stack','name','index','map','rawAttributes','fieldName','type','key','query','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort'];(function(_0x2ec7c3,_0x48d68){var _0x2f0c5b=function(_0x1ca13f){while(--_0x1ca13f){_0x2ec7c3['push'](_0x2ec7c3['shift']());}};_0x2f0c5b(++_0x48d68);}(_0xa96e,0xb9));var _0xea96=function(_0x2af813,_0x39cb5e){_0x2af813=_0x2af813-0x0;var _0x2eb6a3=_0xa96e[_0x2af813];return _0x2eb6a3;};'use strict';var emlformat=require(_0xea96('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xea96('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xea96('0x2'));var moment=require('moment');var BPromise=require(_0xea96('0x3'));var Mustache=require('mustache');var util=require(_0xea96('0x4'));var path=require(_0xea96('0x5'));var sox=require(_0xea96('0x6'));var csv=require(_0xea96('0x7'));var ejs=require(_0xea96('0x8'));var fs=require('fs');var fs_extra=require(_0xea96('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xea96('0xa'));var jsforce=require(_0xea96('0xb'));var deskjs=require(_0xea96('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xea96('0xd'));var Redis=require(_0xea96('0xe'));var authService=require(_0xea96('0xf'));var qs=require(_0xea96('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xea96('0x11'));var logger=require(_0xea96('0x12'))(_0xea96('0x13'));var utils=require(_0xea96('0x14'));var config=require(_0xea96('0x15'));var licenseUtil=require(_0xea96('0x16'));var db=require(_0xea96('0x17'))['db'];function respondWithStatusCode(_0x1be22a,_0x57771f){_0x57771f=_0x57771f||0xcc;return function(_0x171f0c){if(_0x171f0c){return _0x1be22a[_0xea96('0x18')](_0x57771f);}return _0x1be22a[_0xea96('0x19')](_0x57771f)[_0xea96('0x1a')]();};}function respondWithResult(_0x5ddb8b,_0x4b88c9){_0x4b88c9=_0x4b88c9||0xc8;return function(_0x317ffa){if(_0x317ffa){return _0x5ddb8b[_0xea96('0x19')](_0x4b88c9)['json'](_0x317ffa);}};}function respondWithFilteredResult(_0x2fa65,_0x47dd1c){return function(_0x11b2a7){if(_0x11b2a7){var _0x85ce36=typeof _0x47dd1c[_0xea96('0x1b')]===_0xea96('0x1c')&&typeof _0x47dd1c['limit']===_0xea96('0x1c');var _0x56fca8=_0x11b2a7[_0xea96('0x1d')];var _0x29166a=_0x85ce36?0x0:_0x47dd1c[_0xea96('0x1b')];var _0x6d54e9=_0x85ce36?_0x11b2a7[_0xea96('0x1d')]:_0x47dd1c[_0xea96('0x1b')]+_0x47dd1c[_0xea96('0x1e')];var _0x5e2b9d;if(_0x6d54e9>=_0x56fca8){_0x6d54e9=_0x56fca8;_0x5e2b9d=0xc8;}else{_0x5e2b9d=0xce;}_0x2fa65[_0xea96('0x19')](_0x5e2b9d);return _0x2fa65[_0xea96('0x1f')](_0xea96('0x20'),_0x29166a+'-'+_0x6d54e9+'/'+_0x56fca8)[_0xea96('0x21')](_0x11b2a7);}return null;};}function patchUpdates(_0x277bf0){return function(_0x6ac51f){try{jsonpatch['apply'](_0x6ac51f,_0x277bf0,!![]);}catch(_0x301c6d){return BPromise[_0xea96('0x22')](_0x301c6d);}return _0x6ac51f[_0xea96('0x23')]();};}function saveUpdates(_0x2aea15,_0x221939){return function(_0x590299){if(_0x590299){return _0x590299[_0xea96('0x24')](_0x2aea15)[_0xea96('0x25')](function(_0x5f2035){return _0x5f2035;});}return null;};}function removeEntity(_0xfc0d81,_0x230ef7){return function(_0x280a5d){if(_0x280a5d){return _0x280a5d[_0xea96('0x26')]()[_0xea96('0x25')](function(){_0xfc0d81[_0xea96('0x19')](0xcc)[_0xea96('0x1a')]();});}};}function handleEntityNotFound(_0x589ca0,_0x2b7333){return function(_0x180620){if(!_0x180620){_0x589ca0[_0xea96('0x18')](0x194);}return _0x180620;};}function handleError(_0x1fd0a6,_0x383683){_0x383683=_0x383683||0x1f4;return function(_0x33e059){logger[_0xea96('0x27')](_0x33e059[_0xea96('0x28')]);if(_0x33e059['name']){delete _0x33e059[_0xea96('0x29')];}_0x1fd0a6[_0xea96('0x19')](_0x383683)['send'](_0x33e059);};}exports[_0xea96('0x2a')]=function(_0x57d071,_0xe48fd6){var _0x4a8073={},_0x235a1b={},_0x236ce0={'count':0x0,'rows':[]};var _0x33251b=_[_0xea96('0x2b')](db['ZendeskConfiguration'][_0xea96('0x2c')],function(_0x26a823){return{'name':_0x26a823[_0xea96('0x2d')],'type':_0x26a823[_0xea96('0x2e')][_0xea96('0x2f')]};});_0x235a1b['model']=_[_0xea96('0x2b')](_0x33251b,'name');_0x235a1b['query']=_['keys'](_0x57d071[_0xea96('0x30')]);_0x235a1b[_0xea96('0x31')]=_[_0xea96('0x32')](_0x235a1b[_0xea96('0x33')],_0x235a1b[_0xea96('0x30')]);_0x4a8073[_0xea96('0x34')]=_[_0xea96('0x32')](_0x235a1b[_0xea96('0x33')],qs[_0xea96('0x35')](_0x57d071[_0xea96('0x30')][_0xea96('0x35')]));_0x4a8073[_0xea96('0x34')]=_0x4a8073[_0xea96('0x34')]['length']?_0x4a8073[_0xea96('0x34')]:_0x235a1b[_0xea96('0x33')];if(!_0x57d071[_0xea96('0x30')][_0xea96('0x36')](_0xea96('0x37'))){_0x4a8073['limit']=qs[_0xea96('0x1e')](_0x57d071['query'][_0xea96('0x1e')]);_0x4a8073[_0xea96('0x1b')]=qs[_0xea96('0x1b')](_0x57d071[_0xea96('0x30')]['offset']);}_0x4a8073[_0xea96('0x38')]=qs[_0xea96('0x39')](_0x57d071['query'][_0xea96('0x39')]);_0x4a8073['where']=qs[_0xea96('0x31')](_[_0xea96('0x3a')](_0x57d071[_0xea96('0x30')],_0x235a1b[_0xea96('0x31')]),_0x33251b);if(_0x57d071[_0xea96('0x30')]['filter']){_0x4a8073[_0xea96('0x3b')]=_[_0xea96('0x3c')](_0x4a8073[_0xea96('0x3b')],{'$or':_[_0xea96('0x2b')](_0x33251b,function(_0x3a9778){if(_0x3a9778[_0xea96('0x2e')]!==_0xea96('0x3d')){var _0x37755e={};_0x37755e[_0x3a9778[_0xea96('0x29')]]={'$like':'%'+_0x57d071[_0xea96('0x30')]['filter']+'%'};return _0x37755e;}})});}_0x4a8073=_[_0xea96('0x3c')]({},_0x4a8073,_0x57d071[_0xea96('0x3e')]);var _0x41ca5e={'where':_0x4a8073[_0xea96('0x3b')]};return db[_0xea96('0x3f')][_0xea96('0x1d')](_0x41ca5e)[_0xea96('0x25')](function(_0x5c9026){_0x236ce0[_0xea96('0x1d')]=_0x5c9026;if(_0x57d071[_0xea96('0x30')][_0xea96('0x40')]){_0x4a8073['include']=[{'all':!![]}];}return db[_0xea96('0x3f')]['findAll'](_0x4a8073);})[_0xea96('0x25')](function(_0x5d8a9c){_0x236ce0['rows']=_0x5d8a9c;return _0x236ce0;})['then'](respondWithFilteredResult(_0xe48fd6,_0x4a8073))[_0xea96('0x41')](handleError(_0xe48fd6,null));};exports[_0xea96('0x42')]=function(_0x30702c,_0x1a7764){var _0x3548be={'raw':![],'where':{'id':_0x30702c[_0xea96('0x43')]['id']}},_0x36ee4d={};_0x36ee4d['model']=_['keys'](db['ZendeskConfiguration'][_0xea96('0x2c')]);_0x36ee4d[_0xea96('0x30')]=_[_0xea96('0x44')](_0x30702c[_0xea96('0x30')]);_0x36ee4d[_0xea96('0x31')]=_['intersection'](_0x36ee4d[_0xea96('0x33')],_0x36ee4d[_0xea96('0x30')]);_0x3548be[_0xea96('0x34')]=_['intersection'](_0x36ee4d[_0xea96('0x33')],qs[_0xea96('0x35')](_0x30702c[_0xea96('0x30')][_0xea96('0x35')]));_0x3548be[_0xea96('0x34')]=_0x3548be['attributes'][_0xea96('0x45')]?_0x3548be['attributes']:_0x36ee4d[_0xea96('0x33')];if(_0x30702c[_0xea96('0x30')][_0xea96('0x40')]){_0x3548be['include']=[{'all':!![]}];}_0x3548be=_[_0xea96('0x3c')]({},_0x3548be,_0x30702c[_0xea96('0x3e')]);return db[_0xea96('0x3f')][_0xea96('0x46')](_0x3548be)[_0xea96('0x25')](handleEntityNotFound(_0x1a7764,null))[_0xea96('0x25')](respondWithResult(_0x1a7764,null))[_0xea96('0x41')](handleError(_0x1a7764,null));};exports[_0xea96('0x47')]=function(_0x50e326,_0x22385b){return db[_0xea96('0x3f')][_0xea96('0x47')](_0x50e326[_0xea96('0x48')],{})[_0xea96('0x25')](respondWithResult(_0x22385b,0xc9))[_0xea96('0x41')](handleError(_0x22385b,null));};exports[_0xea96('0x24')]=function(_0x530ccd,_0x5b505b){if(_0x530ccd[_0xea96('0x48')]['id']){delete _0x530ccd[_0xea96('0x48')]['id'];}return db['ZendeskConfiguration']['find']({'where':{'id':_0x530ccd[_0xea96('0x43')]['id']}})[_0xea96('0x25')](handleEntityNotFound(_0x5b505b,null))[_0xea96('0x25')](saveUpdates(_0x530ccd['body'],null))[_0xea96('0x25')](respondWithResult(_0x5b505b,null))[_0xea96('0x41')](handleError(_0x5b505b,null));};exports[_0xea96('0x26')]=function(_0x43bd49,_0x113215){return db[_0xea96('0x3f')][_0xea96('0x46')]({'where':{'id':_0x43bd49['params']['id']}})[_0xea96('0x25')](handleEntityNotFound(_0x113215,null))['then'](removeEntity(_0x113215,null))[_0xea96('0x41')](handleError(_0x113215,null));};exports['getFields']=function(_0x23d8db,_0x1509a4,_0x5d5e8c){var _0x4949c2={};var _0x3e9952={};var _0x2912e2;var _0x5124e3;return db['ZendeskConfiguration'][_0xea96('0x49')]({'where':{'id':_0x23d8db[_0xea96('0x43')]['id']}})[_0xea96('0x25')](handleEntityNotFound(_0x1509a4,null))[_0xea96('0x25')](function(_0x1ed0de){if(_0x1ed0de){_0x2912e2=_0x1ed0de;_0x3e9952['model']=_[_0xea96('0x44')](db[_0xea96('0x4a')]['rawAttributes']);_0x3e9952[_0xea96('0x30')]=_['keys'](_0x23d8db['query']);_0x3e9952[_0xea96('0x31')]=_[_0xea96('0x32')](_0x3e9952[_0xea96('0x33')],_0x3e9952[_0xea96('0x30')]);_0x4949c2[_0xea96('0x34')]=_[_0xea96('0x32')](_0x3e9952[_0xea96('0x33')],qs[_0xea96('0x35')](_0x23d8db[_0xea96('0x30')][_0xea96('0x35')]));_0x4949c2[_0xea96('0x34')]=_0x4949c2['attributes']['length']?_0x4949c2[_0xea96('0x34')]:_0x3e9952[_0xea96('0x33')];_0x4949c2['order']=qs['sort'](_0x23d8db[_0xea96('0x30')][_0xea96('0x39')]);_0x4949c2[_0xea96('0x3b')]=qs[_0xea96('0x31')](_[_0xea96('0x3a')](_0x23d8db[_0xea96('0x30')],_0x3e9952['filters']));if(_0x23d8db['query'][_0xea96('0x4b')]){_0x4949c2[_0xea96('0x3b')]=_[_0xea96('0x3c')](_0x4949c2[_0xea96('0x3b')],{'$or':_[_0xea96('0x2b')](_0x4949c2['attributes'],function(_0x1669c3){var _0x3af052={};_0x3af052[_0x1669c3]={'$like':'%'+_0x23d8db[_0xea96('0x30')][_0xea96('0x4b')]+'%'};return _0x3af052;})});}_0x4949c2=_['merge']({},_0x4949c2,_0x23d8db[_0xea96('0x3e')]);return _0x2912e2[_0xea96('0x4c')](_0x4949c2);}})[_0xea96('0x25')](function(_0x5bcef9){if(_0x5bcef9){_0x5124e3=_0x5bcef9[_0xea96('0x45')];if(!_0x23d8db['query']['hasOwnProperty'](_0xea96('0x37'))){_0x4949c2[_0xea96('0x1e')]=qs[_0xea96('0x1e')](_0x23d8db['query'][_0xea96('0x1e')]);_0x4949c2[_0xea96('0x1b')]=qs[_0xea96('0x1b')](_0x23d8db[_0xea96('0x30')][_0xea96('0x1b')]);}return _0x2912e2['getFields'](_0x4949c2);}})[_0xea96('0x25')](function(_0x59861f){if(_0x59861f){return _0x59861f?{'count':_0x5124e3,'rows':_0x59861f}:null;}})[_0xea96('0x25')](respondWithResult(_0x1509a4,null))[_0xea96('0x41')](handleError(_0x1509a4,null));};exports[_0xea96('0x4d')]=function(_0x53d5c8,_0x3fdda9,_0x1105b3){var _0x377b0f={};var _0x481a3f={};var _0x3439b7;var _0x3b6bf3;return db['ZendeskConfiguration'][_0xea96('0x49')]({'where':{'id':_0x53d5c8['params']['id']}})[_0xea96('0x25')](handleEntityNotFound(_0x3fdda9,null))['then'](function(_0x17a23a){if(_0x17a23a){_0x3439b7=_0x17a23a;_0x481a3f['model']=_[_0xea96('0x44')](db[_0xea96('0x4a')][_0xea96('0x2c')]);_0x481a3f['query']=_[_0xea96('0x44')](_0x53d5c8[_0xea96('0x30')]);_0x481a3f[_0xea96('0x31')]=_[_0xea96('0x32')](_0x481a3f[_0xea96('0x33')],_0x481a3f['query']);_0x377b0f['attributes']=_['intersection'](_0x481a3f[_0xea96('0x33')],qs[_0xea96('0x35')](_0x53d5c8[_0xea96('0x30')]['fields']));_0x377b0f[_0xea96('0x34')]=_0x377b0f[_0xea96('0x34')][_0xea96('0x45')]?_0x377b0f[_0xea96('0x34')]:_0x481a3f['model'];_0x377b0f['order']=qs['sort'](_0x53d5c8[_0xea96('0x30')][_0xea96('0x39')]);_0x377b0f[_0xea96('0x3b')]=qs[_0xea96('0x31')](_[_0xea96('0x3a')](_0x53d5c8[_0xea96('0x30')],_0x481a3f[_0xea96('0x31')]));if(_0x53d5c8[_0xea96('0x30')][_0xea96('0x4b')]){_0x377b0f[_0xea96('0x3b')]=_[_0xea96('0x3c')](_0x377b0f[_0xea96('0x3b')],{'$or':_[_0xea96('0x2b')](_0x377b0f[_0xea96('0x34')],function(_0xbb5a92){var _0x90cf84={};_0x90cf84[_0xbb5a92]={'$like':'%'+_0x53d5c8['query']['filter']+'%'};return _0x90cf84;})});}_0x377b0f=_[_0xea96('0x3c')]({},_0x377b0f,_0x53d5c8[_0xea96('0x3e')]);return _0x3439b7[_0xea96('0x4d')](_0x377b0f);}})[_0xea96('0x25')](function(_0x37bc90){if(_0x37bc90){_0x3b6bf3=_0x37bc90['length'];if(!_0x53d5c8[_0xea96('0x30')][_0xea96('0x36')](_0xea96('0x37'))){_0x377b0f['limit']=qs[_0xea96('0x1e')](_0x53d5c8[_0xea96('0x30')][_0xea96('0x1e')]);_0x377b0f[_0xea96('0x1b')]=qs[_0xea96('0x1b')](_0x53d5c8[_0xea96('0x30')]['offset']);}return _0x3439b7[_0xea96('0x4d')](_0x377b0f);}})[_0xea96('0x25')](function(_0x144f56){if(_0x144f56){return _0x144f56?{'count':_0x3b6bf3,'rows':_0x144f56}:null;}})['then'](respondWithResult(_0x3fdda9,null))[_0xea96('0x41')](handleError(_0x3fdda9,null));};exports[_0xea96('0x4e')]=function(_0x50dd15,_0x57ecf9,_0x318aea){var _0x2dc7dc={};var _0x4b69bb={};var _0x137976;var _0x19642a;return db[_0xea96('0x3f')][_0xea96('0x49')]({'where':{'id':_0x50dd15['params']['id']}})['then'](handleEntityNotFound(_0x57ecf9,null))[_0xea96('0x25')](function(_0x2cd95c){if(_0x2cd95c){_0x137976=_0x2cd95c;_0x4b69bb[_0xea96('0x33')]=_['keys'](db[_0xea96('0x4a')][_0xea96('0x2c')]);_0x4b69bb[_0xea96('0x30')]=_[_0xea96('0x44')](_0x50dd15[_0xea96('0x30')]);_0x4b69bb[_0xea96('0x31')]=_['intersection'](_0x4b69bb[_0xea96('0x33')],_0x4b69bb['query']);_0x2dc7dc[_0xea96('0x34')]=_[_0xea96('0x32')](_0x4b69bb[_0xea96('0x33')],qs[_0xea96('0x35')](_0x50dd15[_0xea96('0x30')][_0xea96('0x35')]));_0x2dc7dc[_0xea96('0x34')]=_0x2dc7dc['attributes'][_0xea96('0x45')]?_0x2dc7dc['attributes']:_0x4b69bb[_0xea96('0x33')];_0x2dc7dc[_0xea96('0x38')]=qs[_0xea96('0x39')](_0x50dd15[_0xea96('0x30')][_0xea96('0x39')]);_0x2dc7dc[_0xea96('0x3b')]=qs['filters'](_[_0xea96('0x3a')](_0x50dd15['query'],_0x4b69bb[_0xea96('0x31')]));if(_0x50dd15['query'][_0xea96('0x4b')]){_0x2dc7dc[_0xea96('0x3b')]=_[_0xea96('0x3c')](_0x2dc7dc[_0xea96('0x3b')],{'$or':_['map'](_0x2dc7dc['attributes'],function(_0x222b42){var _0x3eaaf5={};_0x3eaaf5[_0x222b42]={'$like':'%'+_0x50dd15[_0xea96('0x30')][_0xea96('0x4b')]+'%'};return _0x3eaaf5;})});}_0x2dc7dc=_[_0xea96('0x3c')]({},_0x2dc7dc,_0x50dd15[_0xea96('0x3e')]);return _0x137976['getDescriptions'](_0x2dc7dc);}})['then'](function(_0x327ef6){if(_0x327ef6){_0x19642a=_0x327ef6[_0xea96('0x45')];if(!_0x50dd15[_0xea96('0x30')][_0xea96('0x36')](_0xea96('0x37'))){_0x2dc7dc['limit']=qs[_0xea96('0x1e')](_0x50dd15['query'][_0xea96('0x1e')]);_0x2dc7dc[_0xea96('0x1b')]=qs[_0xea96('0x1b')](_0x50dd15[_0xea96('0x30')][_0xea96('0x1b')]);}return _0x137976[_0xea96('0x4e')](_0x2dc7dc);}})[_0xea96('0x25')](function(_0x221925){if(_0x221925){return _0x221925?{'count':_0x19642a,'rows':_0x221925}:null;}})[_0xea96('0x25')](respondWithResult(_0x57ecf9,null))[_0xea96('0x41')](handleError(_0x57ecf9,null));};exports['getTags']=function(_0x342df2,_0x16d21b,_0x114ea7){var _0x2726fa={};var _0x4f62e2={};var _0x47f0d8;var _0x10c8fc;return db[_0xea96('0x3f')]['findOne']({'where':{'id':_0x342df2['params']['id']}})[_0xea96('0x25')](handleEntityNotFound(_0x16d21b,null))[_0xea96('0x25')](function(_0x4aed9e){if(_0x4aed9e){_0x47f0d8=_0x4aed9e;_0x4f62e2['model']=_['keys'](db['Tag'][_0xea96('0x2c')]);_0x4f62e2['query']=_[_0xea96('0x44')](_0x342df2['query']);_0x4f62e2[_0xea96('0x31')]=_[_0xea96('0x32')](_0x4f62e2[_0xea96('0x33')],_0x4f62e2[_0xea96('0x30')]);_0x2726fa[_0xea96('0x34')]=_['intersection'](_0x4f62e2[_0xea96('0x33')],qs[_0xea96('0x35')](_0x342df2[_0xea96('0x30')][_0xea96('0x35')]));_0x2726fa['attributes']=_0x2726fa['attributes'][_0xea96('0x45')]?_0x2726fa['attributes']:_0x4f62e2[_0xea96('0x33')];_0x2726fa[_0xea96('0x38')]=qs[_0xea96('0x39')](_0x342df2[_0xea96('0x30')][_0xea96('0x39')]);_0x2726fa[_0xea96('0x3b')]=qs[_0xea96('0x31')](_[_0xea96('0x3a')](_0x342df2[_0xea96('0x30')],_0x4f62e2[_0xea96('0x31')]));if(_0x342df2[_0xea96('0x30')][_0xea96('0x4b')]){_0x2726fa[_0xea96('0x3b')]=_['merge'](_0x2726fa[_0xea96('0x3b')],{'$or':_['map'](_0x2726fa[_0xea96('0x34')],function(_0x3c1544){var _0x42aada={};_0x42aada[_0x3c1544]={'$like':'%'+_0x342df2['query'][_0xea96('0x4b')]+'%'};return _0x42aada;})});}_0x2726fa=_[_0xea96('0x3c')]({},_0x2726fa,_0x342df2[_0xea96('0x3e')]);return _0x47f0d8[_0xea96('0x4f')](_0x2726fa);}})[_0xea96('0x25')](function(_0x26e6fb){if(_0x26e6fb){_0x10c8fc=_0x26e6fb[_0xea96('0x45')];if(!_0x342df2[_0xea96('0x30')][_0xea96('0x36')](_0xea96('0x37'))){_0x2726fa[_0xea96('0x1e')]=qs[_0xea96('0x1e')](_0x342df2['query'][_0xea96('0x1e')]);_0x2726fa[_0xea96('0x1b')]=qs[_0xea96('0x1b')](_0x342df2[_0xea96('0x30')][_0xea96('0x1b')]);}return _0x47f0d8['getTags'](_0x2726fa);}})['then'](function(_0xf30131){if(_0xf30131){return _0xf30131?{'count':_0x10c8fc,'rows':_0xf30131}:null;}})[_0xea96('0x25')](respondWithResult(_0x16d21b,null))[_0xea96('0x41')](handleError(_0x16d21b,null));};exports['setTags']=function(_0x19430e,_0x440468,_0x57925f){if(_0x19430e['body']['id']){delete _0x19430e[_0xea96('0x48')]['id'];}return db[_0xea96('0x3f')][_0xea96('0x49')]({'where':{'id':_0x19430e[_0xea96('0x43')]['id']}})[_0xea96('0x25')](handleEntityNotFound(_0x440468,null))['then'](function(_0xe6b151){if(_0xe6b151){return _0xe6b151['setTags'](_0x19430e[_0xea96('0x48')][_0xea96('0x50')]||[]);}return null;})['then'](respondWithResult(_0x440468,null))[_0xea96('0x41')](handleError(_0x440468,null));}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js index 131f981..33e6564 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 _0x6cb4=['bluebird','request-promise','path','rimraf','./intZendeskConfiguration.attributes','define','ZendeskConfiguration','int_zendesk_configurations','lodash','util','../../config/logger','api','moment'];(function(_0x2dd023,_0xcffa82){var _0x21ab85=function(_0x3570f6){while(--_0x3570f6){_0x2dd023['push'](_0x2dd023['shift']());}};_0x21ab85(++_0xcffa82);}(_0x6cb4,0xff));var _0x46cb=function(_0x4dfbf9,_0x1ea2cd){_0x4dfbf9=_0x4dfbf9-0x0;var _0x545a30=_0x6cb4[_0x4dfbf9];return _0x545a30;};'use strict';var _=require(_0x46cb('0x0'));var util=require(_0x46cb('0x1'));var logger=require(_0x46cb('0x2'))(_0x46cb('0x3'));var moment=require(_0x46cb('0x4'));var BPromise=require(_0x46cb('0x5'));var rp=require(_0x46cb('0x6'));var fs=require('fs');var path=require(_0x46cb('0x7'));var rimraf=require(_0x46cb('0x8'));var config=require('../../config/environment');var attributes=require(_0x46cb('0x9'));module['exports']=function(_0x3d9d3c,_0x4d9f1d){return _0x3d9d3c[_0x46cb('0xa')](_0x46cb('0xb'),attributes,{'tableName':_0x46cb('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb44a=['../../config/logger','moment','path','../../config/environment','./intZendeskConfiguration.attributes','exports','define','ZendeskConfiguration','int_zendesk_configurations'];(function(_0x3c7795,_0x5320f6){var _0x5de1c8=function(_0x12e556){while(--_0x12e556){_0x3c7795['push'](_0x3c7795['shift']());}};_0x5de1c8(++_0x5320f6);}(_0xb44a,0x1c2));var _0xab44=function(_0x2fcf18,_0x10009a){_0x2fcf18=_0x2fcf18-0x0;var _0x4c68cc=_0xb44a[_0x2fcf18];return _0x4c68cc;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xab44('0x0'))('api');var moment=require(_0xab44('0x1'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xab44('0x2'));var rimraf=require('rimraf');var config=require(_0xab44('0x3'));var attributes=require(_0xab44('0x4'));module[_0xab44('0x5')]=function(_0x28681a,_0x2f3948){return _0x28681a[_0xab44('0x6')](_0xab44('0x7'),attributes,{'tableName':_0xab44('0x8'),'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 af2f6ea..95e577f 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 _0xfc10=['../../config/utils','rpc','jayson/promise','client','request','then','info','ZendeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','lodash','moment','randomstring'];(function(_0x1d4789,_0x5cf40e){var _0xf9e921=function(_0x467c74){while(--_0x467c74){_0x1d4789['push'](_0x1d4789['shift']());}};_0xf9e921(++_0x5cf40e);}(_0xfc10,0xe7));var _0x0fc1=function(_0x22903f,_0x53048f){_0x22903f=_0x22903f-0x0;var _0x1ba5a5=_0xfc10[_0x22903f];return _0x1ba5a5;};'use strict';var _=require(_0x0fc1('0x0'));var util=require('util');var moment=require(_0x0fc1('0x1'));var BPromise=require('bluebird');var rs=require(_0x0fc1('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x0fc1('0x3'));var logger=require('../../config/logger')(_0x0fc1('0x4'));var config=require('../../config/environment');var jayson=require(_0x0fc1('0x5'));var client=jayson[_0x0fc1('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x41fd7e,_0x4c2730,_0x4a70bb){return new BPromise(function(_0x19b152,_0x1933a9){return client[_0x0fc1('0x7')](_0x41fd7e,_0x4a70bb)[_0x0fc1('0x8')](function(_0x3bc9b6){logger[_0x0fc1('0x9')](_0x0fc1('0xa'),_0x4c2730,_0x0fc1('0xb'));logger[_0x0fc1('0xc')]('ZendeskConfiguration,\x20%s,\x20%s,\x20%s',_0x4c2730,_0x0fc1('0xb'),JSON['stringify'](_0x3bc9b6));if(_0x3bc9b6[_0x0fc1('0xd')]){if(_0x3bc9b6[_0x0fc1('0xd')][_0x0fc1('0xe')]===0x1f4){logger[_0x0fc1('0xd')]('ZendeskConfiguration,\x20%s,\x20%s',_0x4c2730,_0x3bc9b6[_0x0fc1('0xd')][_0x0fc1('0xf')]);return _0x1933a9(_0x3bc9b6[_0x0fc1('0xd')][_0x0fc1('0xf')]);}logger[_0x0fc1('0xd')](_0x0fc1('0xa'),_0x4c2730,_0x3bc9b6['error'][_0x0fc1('0xf')]);return _0x19b152(_0x3bc9b6['error'][_0x0fc1('0xf')]);}else{logger[_0x0fc1('0x9')](_0x0fc1('0xa'),_0x4c2730,_0x0fc1('0xb'));_0x19b152(_0x3bc9b6[_0x0fc1('0x10')][_0x0fc1('0xf')]);}})[_0x0fc1('0x11')](function(_0x7c1adc){logger[_0x0fc1('0xd')]('ZendeskConfiguration,\x20%s,\x20%s',_0x4c2730,_0x7c1adc);_0x1933a9(_0x7c1adc);});});} \ No newline at end of file +var _0xe264=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','info','ZendeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','lodash','util'];(function(_0x50007c,_0x1cbf11){var _0x5c1ec7=function(_0x52d038){while(--_0x52d038){_0x50007c['push'](_0x50007c['shift']());}};_0x5c1ec7(++_0x1cbf11);}(_0xe264,0x11c));var _0x4e26=function(_0x7b484,_0x195ad4){_0x7b484=_0x7b484-0x0;var _0x2ae1cf=_0xe264[_0x7b484];return _0x2ae1cf;};'use strict';var _=require(_0x4e26('0x0'));var util=require(_0x4e26('0x1'));var moment=require(_0x4e26('0x2'));var BPromise=require(_0x4e26('0x3'));var rs=require(_0x4e26('0x4'));var fs=require('fs');var Redis=require(_0x4e26('0x5'));var db=require(_0x4e26('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x4e26('0x7'))(_0x4e26('0x8'));var config=require(_0x4e26('0x9'));var jayson=require(_0x4e26('0xa'));var client=jayson[_0x4e26('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x315bc1,_0x2eaaac,_0x297adf){return new BPromise(function(_0xb837f2,_0x5bead2){return client['request'](_0x315bc1,_0x297adf)[_0x4e26('0xc')](function(_0x1bb1a2){logger[_0x4e26('0xd')](_0x4e26('0xe'),_0x2eaaac,_0x4e26('0xf'));logger[_0x4e26('0x10')]('ZendeskConfiguration,\x20%s,\x20%s,\x20%s',_0x2eaaac,_0x4e26('0xf'),JSON['stringify'](_0x1bb1a2));if(_0x1bb1a2[_0x4e26('0x11')]){if(_0x1bb1a2[_0x4e26('0x11')][_0x4e26('0x12')]===0x1f4){logger[_0x4e26('0x11')](_0x4e26('0xe'),_0x2eaaac,_0x1bb1a2[_0x4e26('0x11')][_0x4e26('0x13')]);return _0x5bead2(_0x1bb1a2[_0x4e26('0x11')][_0x4e26('0x13')]);}logger[_0x4e26('0x11')](_0x4e26('0xe'),_0x2eaaac,_0x1bb1a2['error']['message']);return _0xb837f2(_0x1bb1a2[_0x4e26('0x11')]['message']);}else{logger[_0x4e26('0xd')](_0x4e26('0xe'),_0x2eaaac,_0x4e26('0xf'));_0xb837f2(_0x1bb1a2[_0x4e26('0x14')][_0x4e26('0x13')]);}})[_0x4e26('0x15')](function(_0x305f05){logger[_0x4e26('0x11')](_0x4e26('0xe'),_0x2eaaac,_0x305f05);_0x5bead2(_0x305f05);});});} \ No newline at end of file diff --git a/server/api/intZendeskField/index.js b/server/api/intZendeskField/index.js index d67a9be..ee7be9d 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 _0x94a6=['isAuthenticated','index','show','post','create','put','/:id','delete','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskField.controller','get'];(function(_0x56fb33,_0x37be08){var _0x435ee4=function(_0xa80804){while(--_0xa80804){_0x56fb33['push'](_0x56fb33['shift']());}};_0x435ee4(++_0x37be08);}(_0x94a6,0x136));var _0x694a=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x94a6[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x694a('0x0'));var util=require(_0x694a('0x1'));var path=require(_0x694a('0x2'));var timeout=require(_0x694a('0x3'));var express=require('express');var router=express[_0x694a('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x694a('0x5'));var interaction=require(_0x694a('0x6'));var config=require(_0x694a('0x7'));var controller=require(_0x694a('0x8'));router[_0x694a('0x9')]('/',auth[_0x694a('0xa')](),controller[_0x694a('0xb')]);router['get']('/:id',auth[_0x694a('0xa')](),controller[_0x694a('0xc')]);router[_0x694a('0xd')]('/',auth[_0x694a('0xa')](),controller[_0x694a('0xe')]);router[_0x694a('0xf')](_0x694a('0x10'),auth[_0x694a('0xa')](),controller['update']);router[_0x694a('0x11')]('/:id',auth[_0x694a('0xa')](),controller[_0x694a('0x12')]);module[_0x694a('0x13')]=router; \ No newline at end of file +var _0xd220=['post','create','/:id','update','delete','destroy','exports','multer','path','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskField.controller','isAuthenticated','get'];(function(_0x2b737c,_0x274adf){var _0x466ed5=function(_0x593124){while(--_0x593124){_0x2b737c['push'](_0x2b737c['shift']());}};_0x466ed5(++_0x274adf);}(_0xd220,0xd7));var _0x0d22=function(_0x5a249e,_0x488a09){_0x5a249e=_0x5a249e-0x0;var _0x4b571c=_0xd220[_0x5a249e];return _0x4b571c;};'use strict';var multer=require(_0x0d22('0x0'));var util=require('util');var path=require(_0x0d22('0x1'));var timeout=require('connect-timeout');var express=require(_0x0d22('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x0d22('0x3'));var interaction=require(_0x0d22('0x4'));var config=require(_0x0d22('0x5'));var controller=require(_0x0d22('0x6'));router['get']('/',auth[_0x0d22('0x7')](),controller['index']);router[_0x0d22('0x8')]('/:id',auth[_0x0d22('0x7')](),controller['show']);router[_0x0d22('0x9')]('/',auth[_0x0d22('0x7')](),controller[_0x0d22('0xa')]);router['put'](_0x0d22('0xb'),auth[_0x0d22('0x7')](),controller[_0x0d22('0xc')]);router[_0x0d22('0xd')](_0x0d22('0xb'),auth[_0x0d22('0x7')](),controller[_0x0d22('0xe')]);module[_0x0d22('0xf')]=router; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.attributes.js b/server/api/intZendeskField/intZendeskField.attributes.js index 560b17e..f5048e4 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 _0xea61=['BOOLEAN','exports','ENUM','string','variable','customVariable','keyValue','STRING'];(function(_0x16af5c,_0x4de41e){var _0x1be697=function(_0xeccbc4){while(--_0xeccbc4){_0x16af5c['push'](_0x16af5c['shift']());}};_0x1be697(++_0x4de41e);}(_0xea61,0x1f1));var _0x1ea6=function(_0x4ab850,_0xeda755){_0x4ab850=_0x4ab850-0x0;var _0x10eea4=_0xea61[_0x4ab850];return _0x10eea4;};'use strict';var Sequelize=require('sequelize');module[_0x1ea6('0x0')]={'type':{'type':Sequelize[_0x1ea6('0x1')](_0x1ea6('0x2'),_0x1ea6('0x3'),_0x1ea6('0x4'),_0x1ea6('0x5'),'picklist'),'defaultValue':_0x1ea6('0x2')},'content':{'type':Sequelize[_0x1ea6('0x6')]},'key':{'type':Sequelize[_0x1ea6('0x6')]},'keyType':{'type':Sequelize[_0x1ea6('0x1')]('string',_0x1ea6('0x3'),'customVariable')},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x1ea6('0x6')]},'nameField':{'type':Sequelize[_0x1ea6('0x6')]},'customField':{'type':Sequelize[_0x1ea6('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xc0d8=['sequelize','ENUM','string','variable','picklist','STRING','customVariable','BOOLEAN'];(function(_0x3987a1,_0x447793){var _0xe2596e=function(_0x546925){while(--_0x546925){_0x3987a1['push'](_0x3987a1['shift']());}};_0xe2596e(++_0x447793);}(_0xc0d8,0x1c0));var _0x8c0d=function(_0x293926,_0x278f6e){_0x293926=_0x293926-0x0;var _0x5550ce=_0xc0d8[_0x293926];return _0x5550ce;};'use strict';var Sequelize=require(_0x8c0d('0x0'));module['exports']={'type':{'type':Sequelize[_0x8c0d('0x1')](_0x8c0d('0x2'),_0x8c0d('0x3'),'customVariable','keyValue',_0x8c0d('0x4')),'defaultValue':'string'},'content':{'type':Sequelize[_0x8c0d('0x5')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize['ENUM'](_0x8c0d('0x2'),_0x8c0d('0x3'),_0x8c0d('0x6'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x8c0d('0x5')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x8c0d('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x8c0d('0x5')]}}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.controller.js b/server/api/intZendeskField/intZendeskField.controller.js index 2b39060..61bfb16 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 _0x2d19=['hasOwnProperty','sort','filters','filter','merge','where','VIRTUAL','options','include','findAll','rows','params','fields','find','create','body','catch','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','update','then','destroy','stack','name','index','map','ZendeskField','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','length'];(function(_0x3fa972,_0x3f4a79){var _0x4101ec=function(_0x5f5864){while(--_0x5f5864){_0x3fa972['push'](_0x3fa972['shift']());}};_0x4101ec(++_0x3f4a79);}(_0x2d19,0x1b5));var _0x92d1=function(_0x12d6c2,_0x409bc8){_0x12d6c2=_0x12d6c2-0x0;var _0x1c9825=_0x2d19[_0x12d6c2];return _0x1c9825;};'use strict';var emlformat=require(_0x92d1('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x92d1('0x1'));var jsonpatch=require(_0x92d1('0x2'));var rp=require(_0x92d1('0x3'));var moment=require('moment');var BPromise=require(_0x92d1('0x4'));var Mustache=require(_0x92d1('0x5'));var util=require('util');var path=require(_0x92d1('0x6'));var sox=require(_0x92d1('0x7'));var csv=require(_0x92d1('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x92d1('0x9'));var _=require(_0x92d1('0xa'));var squel=require(_0x92d1('0xb'));var crypto=require(_0x92d1('0xc'));var jsforce=require(_0x92d1('0xd'));var deskjs=require(_0x92d1('0xe'));var toCsv=require(_0x92d1('0x8'));var querystring=require(_0x92d1('0xf'));var Papa=require(_0x92d1('0x10'));var Redis=require(_0x92d1('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x92d1('0x12'));var as=require(_0x92d1('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x92d1('0x14'));var config=require(_0x92d1('0x15'));var licenseUtil=require(_0x92d1('0x16'));var db=require(_0x92d1('0x17'))['db'];function respondWithStatusCode(_0x1fb817,_0x254c9b){_0x254c9b=_0x254c9b||0xcc;return function(_0x56d715){if(_0x56d715){return _0x1fb817[_0x92d1('0x18')](_0x254c9b);}return _0x1fb817[_0x92d1('0x19')](_0x254c9b)[_0x92d1('0x1a')]();};}function respondWithResult(_0x129f0e,_0x4198d0){_0x4198d0=_0x4198d0||0xc8;return function(_0x231147){if(_0x231147){return _0x129f0e[_0x92d1('0x19')](_0x4198d0)[_0x92d1('0x1b')](_0x231147);}};}function respondWithFilteredResult(_0x2401fc,_0x39625d){return function(_0x53395a){if(_0x53395a){var _0x140ec1=typeof _0x39625d[_0x92d1('0x1c')]===_0x92d1('0x1d')&&typeof _0x39625d[_0x92d1('0x1e')]===_0x92d1('0x1d');var _0x351b8d=_0x53395a[_0x92d1('0x1f')];var _0x15fc29=_0x140ec1?0x0:_0x39625d[_0x92d1('0x1c')];var _0x1b53d0=_0x140ec1?_0x53395a[_0x92d1('0x1f')]:_0x39625d[_0x92d1('0x1c')]+_0x39625d['limit'];var _0x34b709;if(_0x1b53d0>=_0x351b8d){_0x1b53d0=_0x351b8d;_0x34b709=0xc8;}else{_0x34b709=0xce;}_0x2401fc[_0x92d1('0x19')](_0x34b709);return _0x2401fc[_0x92d1('0x20')](_0x92d1('0x21'),_0x15fc29+'-'+_0x1b53d0+'/'+_0x351b8d)[_0x92d1('0x1b')](_0x53395a);}return null;};}function patchUpdates(_0x150fa2){return function(_0x3f64a3){try{jsonpatch['apply'](_0x3f64a3,_0x150fa2,!![]);}catch(_0x303820){return BPromise[_0x92d1('0x22')](_0x303820);}return _0x3f64a3['save']();};}function saveUpdates(_0x3eb8a5,_0x160f8e){return function(_0xd72da8){if(_0xd72da8){return _0xd72da8[_0x92d1('0x23')](_0x3eb8a5)[_0x92d1('0x24')](function(_0x49ab57){return _0x49ab57;});}return null;};}function removeEntity(_0x4356aa,_0x2d6241){return function(_0x3a81a5){if(_0x3a81a5){return _0x3a81a5[_0x92d1('0x25')]()[_0x92d1('0x24')](function(){_0x4356aa[_0x92d1('0x19')](0xcc)[_0x92d1('0x1a')]();});}};}function handleEntityNotFound(_0x2a7f60,_0x388960){return function(_0x298e79){if(!_0x298e79){_0x2a7f60[_0x92d1('0x18')](0x194);}return _0x298e79;};}function handleError(_0x4be738,_0x41c695){_0x41c695=_0x41c695||0x1f4;return function(_0x3315d5){logger['error'](_0x3315d5[_0x92d1('0x26')]);if(_0x3315d5[_0x92d1('0x27')]){delete _0x3315d5['name'];}_0x4be738[_0x92d1('0x19')](_0x41c695)['send'](_0x3315d5);};}exports[_0x92d1('0x28')]=function(_0xe3a2d5,_0x2686fa){var _0xd0e307={},_0x207449={},_0xb659fd={'count':0x0,'rows':[]};var _0x128878=_[_0x92d1('0x29')](db[_0x92d1('0x2a')][_0x92d1('0x2b')],function(_0x33dfe0){return{'name':_0x33dfe0[_0x92d1('0x2c')],'type':_0x33dfe0[_0x92d1('0x2d')][_0x92d1('0x2e')]};});_0x207449[_0x92d1('0x2f')]=_[_0x92d1('0x29')](_0x128878,'name');_0x207449[_0x92d1('0x30')]=_[_0x92d1('0x31')](_0xe3a2d5[_0x92d1('0x30')]);_0x207449['filters']=_[_0x92d1('0x32')](_0x207449[_0x92d1('0x2f')],_0x207449['query']);_0xd0e307[_0x92d1('0x33')]=_['intersection'](_0x207449[_0x92d1('0x2f')],qs['fields'](_0xe3a2d5['query']['fields']));_0xd0e307[_0x92d1('0x33')]=_0xd0e307[_0x92d1('0x33')][_0x92d1('0x34')]?_0xd0e307['attributes']:_0x207449[_0x92d1('0x2f')];if(!_0xe3a2d5[_0x92d1('0x30')][_0x92d1('0x35')]('nolimit')){_0xd0e307['limit']=qs[_0x92d1('0x1e')](_0xe3a2d5[_0x92d1('0x30')][_0x92d1('0x1e')]);_0xd0e307[_0x92d1('0x1c')]=qs[_0x92d1('0x1c')](_0xe3a2d5[_0x92d1('0x30')][_0x92d1('0x1c')]);}_0xd0e307['order']=qs[_0x92d1('0x36')](_0xe3a2d5[_0x92d1('0x30')][_0x92d1('0x36')]);_0xd0e307['where']=qs[_0x92d1('0x37')](_['pick'](_0xe3a2d5[_0x92d1('0x30')],_0x207449[_0x92d1('0x37')]),_0x128878);if(_0xe3a2d5['query'][_0x92d1('0x38')]){_0xd0e307['where']=_[_0x92d1('0x39')](_0xd0e307[_0x92d1('0x3a')],{'$or':_[_0x92d1('0x29')](_0x128878,function(_0x4cf22f){if(_0x4cf22f[_0x92d1('0x2d')]!==_0x92d1('0x3b')){var _0x3509f4={};_0x3509f4[_0x4cf22f[_0x92d1('0x27')]]={'$like':'%'+_0xe3a2d5[_0x92d1('0x30')][_0x92d1('0x38')]+'%'};return _0x3509f4;}})});}_0xd0e307=_[_0x92d1('0x39')]({},_0xd0e307,_0xe3a2d5[_0x92d1('0x3c')]);var _0x541935={'where':_0xd0e307[_0x92d1('0x3a')]};return db[_0x92d1('0x2a')][_0x92d1('0x1f')](_0x541935)['then'](function(_0x297d99){_0xb659fd['count']=_0x297d99;if(_0xe3a2d5[_0x92d1('0x30')]['includeAll']){_0xd0e307[_0x92d1('0x3d')]=[{'all':!![]}];}return db[_0x92d1('0x2a')][_0x92d1('0x3e')](_0xd0e307);})[_0x92d1('0x24')](function(_0x4a176f){_0xb659fd[_0x92d1('0x3f')]=_0x4a176f;return _0xb659fd;})[_0x92d1('0x24')](respondWithFilteredResult(_0x2686fa,_0xd0e307))['catch'](handleError(_0x2686fa,null));};exports['show']=function(_0x1a30ff,_0x2e2467){var _0x58cedf={'raw':!![],'where':{'id':_0x1a30ff[_0x92d1('0x40')]['id']}},_0x2cecd5={};_0x2cecd5[_0x92d1('0x2f')]=_[_0x92d1('0x31')](db[_0x92d1('0x2a')][_0x92d1('0x2b')]);_0x2cecd5[_0x92d1('0x30')]=_[_0x92d1('0x31')](_0x1a30ff[_0x92d1('0x30')]);_0x2cecd5[_0x92d1('0x37')]=_['intersection'](_0x2cecd5[_0x92d1('0x2f')],_0x2cecd5[_0x92d1('0x30')]);_0x58cedf[_0x92d1('0x33')]=_[_0x92d1('0x32')](_0x2cecd5[_0x92d1('0x2f')],qs[_0x92d1('0x41')](_0x1a30ff[_0x92d1('0x30')]['fields']));_0x58cedf['attributes']=_0x58cedf[_0x92d1('0x33')][_0x92d1('0x34')]?_0x58cedf[_0x92d1('0x33')]:_0x2cecd5['model'];if(_0x1a30ff['query']['includeAll']){_0x58cedf[_0x92d1('0x3d')]=[{'all':!![]}];}_0x58cedf=_[_0x92d1('0x39')]({},_0x58cedf,_0x1a30ff['options']);return db[_0x92d1('0x2a')][_0x92d1('0x42')](_0x58cedf)[_0x92d1('0x24')](handleEntityNotFound(_0x2e2467,null))[_0x92d1('0x24')](respondWithResult(_0x2e2467,null))['catch'](handleError(_0x2e2467,null));};exports[_0x92d1('0x43')]=function(_0x1eec2d,_0x1a36d8){return db[_0x92d1('0x2a')][_0x92d1('0x43')](_0x1eec2d['body'],{})['then'](respondWithResult(_0x1a36d8,0xc9))['catch'](handleError(_0x1a36d8,null));};exports[_0x92d1('0x23')]=function(_0x2978f5,_0x5a7751){if(_0x2978f5['body']['id']){delete _0x2978f5[_0x92d1('0x44')]['id'];}return db['ZendeskField'][_0x92d1('0x42')]({'where':{'id':_0x2978f5[_0x92d1('0x40')]['id']}})[_0x92d1('0x24')](handleEntityNotFound(_0x5a7751,null))['then'](saveUpdates(_0x2978f5[_0x92d1('0x44')],null))[_0x92d1('0x24')](respondWithResult(_0x5a7751,null))[_0x92d1('0x45')](handleError(_0x5a7751,null));};exports[_0x92d1('0x25')]=function(_0x214b32,_0xd79a2){return db[_0x92d1('0x2a')][_0x92d1('0x42')]({'where':{'id':_0x214b32[_0x92d1('0x40')]['id']}})[_0x92d1('0x24')](handleEntityNotFound(_0xd79a2,null))[_0x92d1('0x24')](removeEntity(_0xd79a2,null))[_0x92d1('0x45')](handleError(_0xd79a2,null));}; \ No newline at end of file +var _0xc577=['then','destroy','end','sendStatus','error','name','send','ZendeskField','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','find','create','body','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','undefined','limit','count','offset','set','Content-Range','apply'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0xc577,0x172));var _0x7c57=function(_0x3a2fe5,_0x4f3adf){_0x3a2fe5=_0x3a2fe5-0x0;var _0x5aacd1=_0xc577[_0x3a2fe5];return _0x5aacd1;};'use strict';var emlformat=require(_0x7c57('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x7c57('0x1'));var rp=require(_0x7c57('0x2'));var moment=require(_0x7c57('0x3'));var BPromise=require(_0x7c57('0x4'));var Mustache=require(_0x7c57('0x5'));var util=require(_0x7c57('0x6'));var path=require(_0x7c57('0x7'));var sox=require('sox');var csv=require(_0x7c57('0x8'));var ejs=require(_0x7c57('0x9'));var fs=require('fs');var fs_extra=require(_0x7c57('0xa'));var _=require(_0x7c57('0xb'));var squel=require(_0x7c57('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x7c57('0x8'));var querystring=require('querystring');var Papa=require(_0x7c57('0xd'));var Redis=require(_0x7c57('0xe'));var authService=require(_0x7c57('0xf'));var qs=require(_0x7c57('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7c57('0x11'));var logger=require(_0x7c57('0x12'))('api');var utils=require(_0x7c57('0x13'));var config=require(_0x7c57('0x14'));var licenseUtil=require(_0x7c57('0x15'));var db=require(_0x7c57('0x16'))['db'];function respondWithStatusCode(_0xbd2172,_0x10a675){_0x10a675=_0x10a675||0xcc;return function(_0x296cef){if(_0x296cef){return _0xbd2172['sendStatus'](_0x10a675);}return _0xbd2172['status'](_0x10a675)['end']();};}function respondWithResult(_0x46cae6,_0x373a4b){_0x373a4b=_0x373a4b||0xc8;return function(_0x4c5af2){if(_0x4c5af2){return _0x46cae6[_0x7c57('0x17')](_0x373a4b)[_0x7c57('0x18')](_0x4c5af2);}};}function respondWithFilteredResult(_0x11903b,_0x1ba2d0){return function(_0x14ce67){if(_0x14ce67){var _0x517d8a=typeof _0x1ba2d0['offset']===_0x7c57('0x19')&&typeof _0x1ba2d0[_0x7c57('0x1a')]===_0x7c57('0x19');var _0x3c40d3=_0x14ce67[_0x7c57('0x1b')];var _0x48cf4f=_0x517d8a?0x0:_0x1ba2d0[_0x7c57('0x1c')];var _0x30f5b1=_0x517d8a?_0x14ce67[_0x7c57('0x1b')]:_0x1ba2d0[_0x7c57('0x1c')]+_0x1ba2d0[_0x7c57('0x1a')];var _0x3e2dc0;if(_0x30f5b1>=_0x3c40d3){_0x30f5b1=_0x3c40d3;_0x3e2dc0=0xc8;}else{_0x3e2dc0=0xce;}_0x11903b[_0x7c57('0x17')](_0x3e2dc0);return _0x11903b[_0x7c57('0x1d')](_0x7c57('0x1e'),_0x48cf4f+'-'+_0x30f5b1+'/'+_0x3c40d3)['json'](_0x14ce67);}return null;};}function patchUpdates(_0x45221e){return function(_0x3472b8){try{jsonpatch[_0x7c57('0x1f')](_0x3472b8,_0x45221e,!![]);}catch(_0x373b5b){return BPromise['reject'](_0x373b5b);}return _0x3472b8['save']();};}function saveUpdates(_0x4c4140,_0x140376){return function(_0x368bb6){if(_0x368bb6){return _0x368bb6['update'](_0x4c4140)[_0x7c57('0x20')](function(_0x13f696){return _0x13f696;});}return null;};}function removeEntity(_0x260d58,_0xfb0f2e){return function(_0x4734de){if(_0x4734de){return _0x4734de[_0x7c57('0x21')]()[_0x7c57('0x20')](function(){_0x260d58['status'](0xcc)[_0x7c57('0x22')]();});}};}function handleEntityNotFound(_0x3232f8,_0x16a517){return function(_0x1641f1){if(!_0x1641f1){_0x3232f8[_0x7c57('0x23')](0x194);}return _0x1641f1;};}function handleError(_0x984924,_0x41125b){_0x41125b=_0x41125b||0x1f4;return function(_0x1219f2){logger[_0x7c57('0x24')](_0x1219f2['stack']);if(_0x1219f2['name']){delete _0x1219f2[_0x7c57('0x25')];}_0x984924[_0x7c57('0x17')](_0x41125b)[_0x7c57('0x26')](_0x1219f2);};}exports['index']=function(_0x9b9d1f,_0x59ae2f){var _0x5acc20={},_0x5ad979={},_0x1d5b54={'count':0x0,'rows':[]};var _0x50c5fa=_['map'](db[_0x7c57('0x27')][_0x7c57('0x28')],function(_0x1ce1fd){return{'name':_0x1ce1fd['fieldName'],'type':_0x1ce1fd[_0x7c57('0x29')][_0x7c57('0x2a')]};});_0x5ad979[_0x7c57('0x2b')]=_['map'](_0x50c5fa,_0x7c57('0x25'));_0x5ad979[_0x7c57('0x2c')]=_[_0x7c57('0x2d')](_0x9b9d1f[_0x7c57('0x2c')]);_0x5ad979[_0x7c57('0x2e')]=_[_0x7c57('0x2f')](_0x5ad979[_0x7c57('0x2b')],_0x5ad979[_0x7c57('0x2c')]);_0x5acc20[_0x7c57('0x30')]=_[_0x7c57('0x2f')](_0x5ad979['model'],qs[_0x7c57('0x31')](_0x9b9d1f[_0x7c57('0x2c')]['fields']));_0x5acc20[_0x7c57('0x30')]=_0x5acc20[_0x7c57('0x30')][_0x7c57('0x32')]?_0x5acc20['attributes']:_0x5ad979[_0x7c57('0x2b')];if(!_0x9b9d1f[_0x7c57('0x2c')]['hasOwnProperty'](_0x7c57('0x33'))){_0x5acc20[_0x7c57('0x1a')]=qs['limit'](_0x9b9d1f[_0x7c57('0x2c')][_0x7c57('0x1a')]);_0x5acc20[_0x7c57('0x1c')]=qs[_0x7c57('0x1c')](_0x9b9d1f['query'][_0x7c57('0x1c')]);}_0x5acc20['order']=qs['sort'](_0x9b9d1f[_0x7c57('0x2c')][_0x7c57('0x34')]);_0x5acc20[_0x7c57('0x35')]=qs[_0x7c57('0x2e')](_['pick'](_0x9b9d1f[_0x7c57('0x2c')],_0x5ad979[_0x7c57('0x2e')]),_0x50c5fa);if(_0x9b9d1f[_0x7c57('0x2c')][_0x7c57('0x36')]){_0x5acc20[_0x7c57('0x35')]=_[_0x7c57('0x37')](_0x5acc20[_0x7c57('0x35')],{'$or':_['map'](_0x50c5fa,function(_0x3cbdc7){if(_0x3cbdc7[_0x7c57('0x29')]!==_0x7c57('0x38')){var _0x35377a={};_0x35377a[_0x3cbdc7['name']]={'$like':'%'+_0x9b9d1f[_0x7c57('0x2c')][_0x7c57('0x36')]+'%'};return _0x35377a;}})});}_0x5acc20=_[_0x7c57('0x37')]({},_0x5acc20,_0x9b9d1f[_0x7c57('0x39')]);var _0x4ebbec={'where':_0x5acc20[_0x7c57('0x35')]};return db[_0x7c57('0x27')][_0x7c57('0x1b')](_0x4ebbec)[_0x7c57('0x20')](function(_0xae3f4c){_0x1d5b54[_0x7c57('0x1b')]=_0xae3f4c;if(_0x9b9d1f[_0x7c57('0x2c')][_0x7c57('0x3a')]){_0x5acc20[_0x7c57('0x3b')]=[{'all':!![]}];}return db['ZendeskField'][_0x7c57('0x3c')](_0x5acc20);})['then'](function(_0x27cca7){_0x1d5b54[_0x7c57('0x3d')]=_0x27cca7;return _0x1d5b54;})[_0x7c57('0x20')](respondWithFilteredResult(_0x59ae2f,_0x5acc20))[_0x7c57('0x3e')](handleError(_0x59ae2f,null));};exports['show']=function(_0x5d99bf,_0x54982b){var _0x286cd2={'raw':!![],'where':{'id':_0x5d99bf[_0x7c57('0x3f')]['id']}},_0x2f59c0={};_0x2f59c0[_0x7c57('0x2b')]=_[_0x7c57('0x2d')](db[_0x7c57('0x27')][_0x7c57('0x28')]);_0x2f59c0['query']=_[_0x7c57('0x2d')](_0x5d99bf[_0x7c57('0x2c')]);_0x2f59c0['filters']=_[_0x7c57('0x2f')](_0x2f59c0['model'],_0x2f59c0[_0x7c57('0x2c')]);_0x286cd2[_0x7c57('0x30')]=_[_0x7c57('0x2f')](_0x2f59c0['model'],qs[_0x7c57('0x31')](_0x5d99bf[_0x7c57('0x2c')]['fields']));_0x286cd2[_0x7c57('0x30')]=_0x286cd2['attributes']['length']?_0x286cd2[_0x7c57('0x30')]:_0x2f59c0[_0x7c57('0x2b')];if(_0x5d99bf[_0x7c57('0x2c')]['includeAll']){_0x286cd2[_0x7c57('0x3b')]=[{'all':!![]}];}_0x286cd2=_[_0x7c57('0x37')]({},_0x286cd2,_0x5d99bf[_0x7c57('0x39')]);return db['ZendeskField'][_0x7c57('0x40')](_0x286cd2)[_0x7c57('0x20')](handleEntityNotFound(_0x54982b,null))[_0x7c57('0x20')](respondWithResult(_0x54982b,null))['catch'](handleError(_0x54982b,null));};exports[_0x7c57('0x41')]=function(_0x2bb4d2,_0x1d2ed4){return db[_0x7c57('0x27')]['create'](_0x2bb4d2[_0x7c57('0x42')],{})[_0x7c57('0x20')](respondWithResult(_0x1d2ed4,0xc9))[_0x7c57('0x3e')](handleError(_0x1d2ed4,null));};exports['update']=function(_0x236ae5,_0x35b350){if(_0x236ae5[_0x7c57('0x42')]['id']){delete _0x236ae5[_0x7c57('0x42')]['id'];}return db['ZendeskField'][_0x7c57('0x40')]({'where':{'id':_0x236ae5['params']['id']}})[_0x7c57('0x20')](handleEntityNotFound(_0x35b350,null))[_0x7c57('0x20')](saveUpdates(_0x236ae5[_0x7c57('0x42')],null))[_0x7c57('0x20')](respondWithResult(_0x35b350,null))[_0x7c57('0x3e')](handleError(_0x35b350,null));};exports['destroy']=function(_0x2a953e,_0x4f6d05){return db['ZendeskField'][_0x7c57('0x40')]({'where':{'id':_0x2a953e[_0x7c57('0x3f')]['id']}})['then'](handleEntityNotFound(_0x4f6d05,null))[_0x7c57('0x20')](removeEntity(_0x4f6d05,null))['catch'](handleError(_0x4f6d05,null));}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.model.js b/server/api/intZendeskField/intZendeskField.model.js index 357c764..4c324da 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 _0xf580=['request-promise','path','../../config/environment','./intZendeskField.attributes','define','ZendeskField','int_zendesk_fields','zendesk_unique_index','FieldId','lodash','../../config/logger','api','moment','bluebird'];(function(_0x18d5d7,_0x19074b){var _0x30a9ea=function(_0x514f3f){while(--_0x514f3f){_0x18d5d7['push'](_0x18d5d7['shift']());}};_0x30a9ea(++_0x19074b);}(_0xf580,0x87));var _0x0f58=function(_0x43a3bb,_0x41aa50){_0x43a3bb=_0x43a3bb-0x0;var _0x55baf7=_0xf580[_0x43a3bb];return _0x55baf7;};'use strict';var _=require(_0x0f58('0x0'));var util=require('util');var logger=require(_0x0f58('0x1'))(_0x0f58('0x2'));var moment=require(_0x0f58('0x3'));var BPromise=require(_0x0f58('0x4'));var rp=require(_0x0f58('0x5'));var fs=require('fs');var path=require(_0x0f58('0x6'));var rimraf=require('rimraf');var config=require(_0x0f58('0x7'));var attributes=require(_0x0f58('0x8'));module['exports']=function(_0x5685dc,_0x32afba){return _0x5685dc[_0x0f58('0x9')](_0x0f58('0xa'),attributes,{'tableName':_0x0f58('0xb'),'paranoid':![],'indexes':[{'name':_0x0f58('0xc'),'fields':['idField',_0x0f58('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xf4fa=['ZendeskField','int_zendesk_fields','idField','lodash','util','../../config/logger','bluebird','request-promise','path','../../config/environment','exports'];(function(_0x21a2da,_0x9f4c2b){var _0x3ff5da=function(_0x216564){while(--_0x216564){_0x21a2da['push'](_0x21a2da['shift']());}};_0x3ff5da(++_0x9f4c2b);}(_0xf4fa,0x1d1));var _0xaf4f=function(_0x4fa821,_0x76b65f){_0x4fa821=_0x4fa821-0x0;var _0x1da928=_0xf4fa[_0x4fa821];return _0x1da928;};'use strict';var _=require(_0xaf4f('0x0'));var util=require(_0xaf4f('0x1'));var logger=require(_0xaf4f('0x2'))('api');var moment=require('moment');var BPromise=require(_0xaf4f('0x3'));var rp=require(_0xaf4f('0x4'));var fs=require('fs');var path=require(_0xaf4f('0x5'));var rimraf=require('rimraf');var config=require(_0xaf4f('0x6'));var attributes=require('./intZendeskField.attributes');module[_0xaf4f('0x7')]=function(_0x83b2d3,_0x5cf15e){return _0x83b2d3['define'](_0xaf4f('0x8'),attributes,{'tableName':_0xaf4f('0x9'),'paranoid':![],'indexes':[{'name':'zendesk_unique_index','fields':[_0xaf4f('0xa'),'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 919f7c8..84bae54 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 _0x1d3d=['catch','lodash','util','moment','randomstring','ioredis','../../config/logger','rpc','../../config/environment','client','request','then','info','ZendeskField,\x20%s,\x20%s','debug','ZendeskField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result'];(function(_0x5caecf,_0x3e8fde){var _0x46d5f1=function(_0x23d35f){while(--_0x23d35f){_0x5caecf['push'](_0x5caecf['shift']());}};_0x46d5f1(++_0x3e8fde);}(_0x1d3d,0x161));var _0xd1d3=function(_0x3dfe71,_0x95bb47){_0x3dfe71=_0x3dfe71-0x0;var _0x113f38=_0x1d3d[_0x3dfe71];return _0x113f38;};'use strict';var _=require(_0xd1d3('0x0'));var util=require(_0xd1d3('0x1'));var moment=require(_0xd1d3('0x2'));var BPromise=require('bluebird');var rs=require(_0xd1d3('0x3'));var fs=require('fs');var Redis=require(_0xd1d3('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xd1d3('0x5'))(_0xd1d3('0x6'));var config=require(_0xd1d3('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xd1d3('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3d37a,_0x1931cb,_0x5cdbe2){return new BPromise(function(_0x3df9a0,_0x53dd08){return client[_0xd1d3('0x9')](_0x3d37a,_0x5cdbe2)[_0xd1d3('0xa')](function(_0x3b5526){logger[_0xd1d3('0xb')](_0xd1d3('0xc'),_0x1931cb,'request\x20sent');logger[_0xd1d3('0xd')](_0xd1d3('0xe'),_0x1931cb,_0xd1d3('0xf'),JSON[_0xd1d3('0x10')](_0x3b5526));if(_0x3b5526['error']){if(_0x3b5526[_0xd1d3('0x11')][_0xd1d3('0x12')]===0x1f4){logger[_0xd1d3('0x11')](_0xd1d3('0xc'),_0x1931cb,_0x3b5526['error']['message']);return _0x53dd08(_0x3b5526[_0xd1d3('0x11')][_0xd1d3('0x13')]);}logger[_0xd1d3('0x11')](_0xd1d3('0xc'),_0x1931cb,_0x3b5526[_0xd1d3('0x11')]['message']);return _0x3df9a0(_0x3b5526['error'][_0xd1d3('0x13')]);}else{logger[_0xd1d3('0xb')](_0xd1d3('0xc'),_0x1931cb,_0xd1d3('0xf'));_0x3df9a0(_0x3b5526[_0xd1d3('0x14')][_0xd1d3('0x13')]);}})[_0xd1d3('0x15')](function(_0x4b479f){logger[_0xd1d3('0x11')](_0xd1d3('0xc'),_0x1931cb,_0x4b479f);_0x53dd08(_0x4b479f);});});} \ No newline at end of file +var _0x7bd5=['error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request','then','info','ZendeskField,\x20%s,\x20%s','request\x20sent','debug','ZendeskField,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x45596a,_0x54e805){var _0x2abb8e=function(_0x1d018c){while(--_0x1d018c){_0x45596a['push'](_0x45596a['shift']());}};_0x2abb8e(++_0x54e805);}(_0x7bd5,0x17c));var _0x57bd=function(_0x47cb72,_0x3233cd){_0x47cb72=_0x47cb72-0x0;var _0x19ade5=_0x7bd5[_0x47cb72];return _0x19ade5;};'use strict';var _=require(_0x57bd('0x0'));var util=require(_0x57bd('0x1'));var moment=require(_0x57bd('0x2'));var BPromise=require(_0x57bd('0x3'));var rs=require(_0x57bd('0x4'));var fs=require('fs');var Redis=require(_0x57bd('0x5'));var db=require(_0x57bd('0x6'))['db'];var utils=require(_0x57bd('0x7'));var logger=require(_0x57bd('0x8'))('rpc');var config=require(_0x57bd('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x57bd('0xa')][_0x57bd('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5dadb2,_0x5f009a,_0x586195){return new BPromise(function(_0x4e4de1,_0x1e10ff){return client[_0x57bd('0xc')](_0x5dadb2,_0x586195)[_0x57bd('0xd')](function(_0x2b2394){logger[_0x57bd('0xe')](_0x57bd('0xf'),_0x5f009a,_0x57bd('0x10'));logger[_0x57bd('0x11')](_0x57bd('0x12'),_0x5f009a,'request\x20sent',JSON[_0x57bd('0x13')](_0x2b2394));if(_0x2b2394[_0x57bd('0x14')]){if(_0x2b2394[_0x57bd('0x14')][_0x57bd('0x15')]===0x1f4){logger['error'](_0x57bd('0xf'),_0x5f009a,_0x2b2394[_0x57bd('0x14')][_0x57bd('0x16')]);return _0x1e10ff(_0x2b2394['error']['message']);}logger['error']('ZendeskField,\x20%s,\x20%s',_0x5f009a,_0x2b2394[_0x57bd('0x14')][_0x57bd('0x16')]);return _0x4e4de1(_0x2b2394[_0x57bd('0x14')][_0x57bd('0x16')]);}else{logger[_0x57bd('0xe')](_0x57bd('0xf'),_0x5f009a,_0x57bd('0x10'));_0x4e4de1(_0x2b2394[_0x57bd('0x17')]['message']);}})[_0x57bd('0x18')](function(_0x3459c1){logger['error'](_0x57bd('0xf'),_0x5f009a,_0x3459c1);_0x1e10ff(_0x3459c1);});});} \ No newline at end of file diff --git a/server/api/intZohoAccount/index.js b/server/api/intZohoAccount/index.js index 962fea3..690c157 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 _0xa5b1=['../../components/auth/service','../../config/environment','./intZohoAccount.controller','index','get','/:id','isAuthenticated','getConfigurations','/:id/fields','getFields','post','create','/:id/configurations','put','update','delete','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x41f252,_0x36bc6e){var _0x2c08e4=function(_0x8f9990){while(--_0x8f9990){_0x41f252['push'](_0x41f252['shift']());}};_0x2c08e4(++_0x36bc6e);}(_0xa5b1,0xe0));var _0x1a5b=function(_0x51e916,_0x549682){_0x51e916=_0x51e916-0x0;var _0x2f718d=_0xa5b1[_0x51e916];return _0x2f718d;};'use strict';var multer=require(_0x1a5b('0x0'));var util=require(_0x1a5b('0x1'));var path=require(_0x1a5b('0x2'));var timeout=require(_0x1a5b('0x3'));var express=require(_0x1a5b('0x4'));var router=express[_0x1a5b('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x1a5b('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x1a5b('0x7'));var controller=require(_0x1a5b('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x1a5b('0x9')]);router[_0x1a5b('0xa')](_0x1a5b('0xb'),auth['isAuthenticated'](),controller['show']);router[_0x1a5b('0xa')]('/:id/configurations',auth[_0x1a5b('0xc')](),controller[_0x1a5b('0xd')]);router[_0x1a5b('0xa')](_0x1a5b('0xe'),auth[_0x1a5b('0xc')](),controller[_0x1a5b('0xf')]);router[_0x1a5b('0x10')]('/',auth[_0x1a5b('0xc')](),controller[_0x1a5b('0x11')]);router['post'](_0x1a5b('0x12'),auth[_0x1a5b('0xc')](),controller['addConfiguration']);router[_0x1a5b('0x13')](_0x1a5b('0xb'),auth[_0x1a5b('0xc')](),controller[_0x1a5b('0x14')]);router[_0x1a5b('0x15')](_0x1a5b('0xb'),auth[_0x1a5b('0xc')](),controller['destroy']);module[_0x1a5b('0x16')]=router; \ No newline at end of file +var _0x5763=['delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intZohoAccount.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','post','/:id/configurations','addConfiguration','put','update'];(function(_0x1ef8ae,_0x59b68d){var _0xbdca32=function(_0x4e34fe){while(--_0x4e34fe){_0x1ef8ae['push'](_0x1ef8ae['shift']());}};_0xbdca32(++_0x59b68d);}(_0x5763,0xfd));var _0x3576=function(_0x1ee879,_0x3bfed2){_0x1ee879=_0x1ee879-0x0;var _0x672a7a=_0x5763[_0x1ee879];return _0x672a7a;};'use strict';var multer=require(_0x3576('0x0'));var util=require(_0x3576('0x1'));var path=require(_0x3576('0x2'));var timeout=require(_0x3576('0x3'));var express=require(_0x3576('0x4'));var router=express[_0x3576('0x5')]();var fs_extra=require(_0x3576('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x3576('0x7'));var config=require(_0x3576('0x8'));var controller=require(_0x3576('0x9'));router[_0x3576('0xa')]('/',auth[_0x3576('0xb')](),controller[_0x3576('0xc')]);router[_0x3576('0xa')](_0x3576('0xd'),auth[_0x3576('0xb')](),controller[_0x3576('0xe')]);router[_0x3576('0xa')]('/:id/configurations',auth[_0x3576('0xb')](),controller['getConfigurations']);router[_0x3576('0xa')](_0x3576('0xf'),auth[_0x3576('0xb')](),controller[_0x3576('0x10')]);router[_0x3576('0x11')]('/',auth[_0x3576('0xb')](),controller['create']);router['post'](_0x3576('0x12'),auth['isAuthenticated'](),controller[_0x3576('0x13')]);router[_0x3576('0x14')](_0x3576('0xd'),auth[_0x3576('0xb')](),controller[_0x3576('0x15')]);router[_0x3576('0x16')](_0x3576('0xd'),auth[_0x3576('0xb')](),controller[_0x3576('0x17')]);module[_0x3576('0x18')]=router; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.attributes.js b/server/api/intZohoAccount/intZohoAccount.attributes.js index ecfd89e..f4cc683 100644 --- a/server/api/intZohoAccount/intZohoAccount.attributes.js +++ b/server/api/intZohoAccount/intZohoAccount.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x41bb=['exports','STRING','sequelize'];(function(_0x188c88,_0x210793){var _0x4e4c38=function(_0x3d9e41){while(--_0x3d9e41){_0x188c88['push'](_0x188c88['shift']());}};_0x4e4c38(++_0x210793);}(_0x41bb,0xc5));var _0xb41b=function(_0x4dafab,_0x20f927){_0x4dafab=_0x4dafab-0x0;var _0x4969af=_0x41bb[_0x4dafab];return _0x4969af;};'use strict';var Sequelize=require(_0xb41b('0x0'));module[_0xb41b('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xb41b('0x2')]},'host':{'type':Sequelize['STRING']},'zone':{'type':Sequelize[_0xb41b('0x2')]},'clientId':{'type':Sequelize[_0xb41b('0x2')]},'clientSecret':{'type':Sequelize[_0xb41b('0x2')]},'serverUrl':{'type':Sequelize[_0xb41b('0x2')],'allowNull':![]},'code':{'type':Sequelize['STRING']},'refreshToken':{'type':Sequelize[_0xb41b('0x2')]}}; \ No newline at end of file +var _0xbd50=['STRING','sequelize','exports'];(function(_0x212bf5,_0x165cbd){var _0xfcad21=function(_0x4a4e6e){while(--_0x4a4e6e){_0x212bf5['push'](_0x212bf5['shift']());}};_0xfcad21(++_0x165cbd);}(_0xbd50,0x196));var _0x0bd5=function(_0x3c139d,_0x4d1918){_0x3c139d=_0x3c139d-0x0;var _0x357bb3=_0xbd50[_0x3c139d];return _0x357bb3;};'use strict';var Sequelize=require(_0x0bd5('0x0'));module[_0x0bd5('0x1')]={'name':{'type':Sequelize[_0x0bd5('0x2')]},'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize[_0x0bd5('0x2')]},'zone':{'type':Sequelize[_0x0bd5('0x2')]},'clientId':{'type':Sequelize[_0x0bd5('0x2')]},'clientSecret':{'type':Sequelize[_0x0bd5('0x2')]},'serverUrl':{'type':Sequelize[_0x0bd5('0x2')],'allowNull':![]},'code':{'type':Sequelize['STRING']},'refreshToken':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.controller.js b/server/api/intZohoAccount/intZohoAccount.controller.js index ffe0363..faf6b5d 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 _0x483c=['filters','intersection','fields','attributes','length','hasOwnProperty','sort','where','pick','filter','map','VIRTUAL','merge','options','includeAll','include','findAll','catch','show','create','body','find','params','getConfigurations','findOne','order','nolimit','addConfiguration','AccountId','Subjects','getSubjects','channel','getDescriptions','ZohoConfiguration','ZohoField','Descriptions','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.com.cn','https://accounts.zoho.eu','POST','/oauth/v2/token','refreshToken','clientId','clientSecret','refresh_token','access_token','getFields','host','serverUrl','code','zoho.eu','com','slice','substring','Refresh\x20Token\x20not\x20available\x20for\x20the\x20account','GET','format','https://www.zohoapis.%s/crm/v2/settings/fields','Calls','Zoho-oauthtoken\x20','response','Owner','Subject','Description','WhoId','Call_Duration','Call_Result','Call_Start_Time','Call_Type','remove','includes','api_name','system_mandatory','push','display_label','data_type','picklist','pick_list_values','send','test','Wrong\x20credentials','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','name','ZohoAccount','rawAttributes','type','key','model','query','keys'];(function(_0x518524,_0xc20f43){var _0x2c2dae=function(_0x4a9383){while(--_0x4a9383){_0x518524['push'](_0x518524['shift']());}};_0x2c2dae(++_0xc20f43);}(_0x483c,0x159));var _0xc483=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x483c[_0x3b380d];return _0x54502b;};'use strict';var emlformat=require(_0xc483('0x0'));var rimraf=require(_0xc483('0x1'));var zipdir=require(_0xc483('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xc483('0x3'));var moment=require(_0xc483('0x4'));var BPromise=require(_0xc483('0x5'));var Mustache=require(_0xc483('0x6'));var util=require('util');var path=require(_0xc483('0x7'));var sox=require(_0xc483('0x8'));var csv=require(_0xc483('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc483('0xa'));var squel=require(_0xc483('0xb'));var crypto=require(_0xc483('0xc'));var jsforce=require(_0xc483('0xd'));var deskjs=require(_0xc483('0xe'));var toCsv=require(_0xc483('0x9'));var querystring=require(_0xc483('0xf'));var Papa=require(_0xc483('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc483('0x11'));var logger=require('../../config/logger')(_0xc483('0x12'));var utils=require(_0xc483('0x13'));var config=require(_0xc483('0x14'));var licenseUtil=require(_0xc483('0x15'));var db=require('../../mysqldb')['db'];var integrations=require(_0xc483('0x16'));function respondWithStatusCode(_0x5a679e,_0x29820d){_0x29820d=_0x29820d||0xcc;return function(_0x502f32){if(_0x502f32){return _0x5a679e[_0xc483('0x17')](_0x29820d);}return _0x5a679e[_0xc483('0x18')](_0x29820d)[_0xc483('0x19')]();};}function respondWithResult(_0x236487,_0x49d5bd){_0x49d5bd=_0x49d5bd||0xc8;return function(_0x1a9124){if(_0x1a9124){return _0x236487[_0xc483('0x18')](_0x49d5bd)[_0xc483('0x1a')](_0x1a9124);}};}function respondWithFilteredResult(_0x5af69d,_0x102b98){return function(_0x2adb38){if(_0x2adb38){var _0x325aab=typeof _0x102b98[_0xc483('0x1b')]===_0xc483('0x1c')&&typeof _0x102b98[_0xc483('0x1d')]===_0xc483('0x1c');var _0x1f871f=_0x2adb38[_0xc483('0x1e')];var _0x548e03=_0x325aab?0x0:_0x102b98[_0xc483('0x1b')];var _0x18dac5=_0x325aab?_0x2adb38[_0xc483('0x1e')]:_0x102b98['offset']+_0x102b98[_0xc483('0x1d')];var _0x3a3ce0;if(_0x18dac5>=_0x1f871f){_0x18dac5=_0x1f871f;_0x3a3ce0=0xc8;}else{_0x3a3ce0=0xce;}_0x5af69d[_0xc483('0x18')](_0x3a3ce0);return _0x5af69d[_0xc483('0x1f')](_0xc483('0x20'),_0x548e03+'-'+_0x18dac5+'/'+_0x1f871f)[_0xc483('0x1a')](_0x2adb38);}return null;};}function patchUpdates(_0x93f613){return function(_0x5d3eb2){try{jsonpatch[_0xc483('0x21')](_0x5d3eb2,_0x93f613,!![]);}catch(_0x1f0ac0){return BPromise[_0xc483('0x22')](_0x1f0ac0);}return _0x5d3eb2[_0xc483('0x23')]();};}function saveUpdates(_0x567416,_0x3b2b89){return function(_0x1afe7f){if(_0x1afe7f){return _0x1afe7f[_0xc483('0x24')](_0x567416)[_0xc483('0x25')](function(_0x10647c){return _0x10647c;});}return null;};}function removeEntity(_0x308d21,_0x2cc299){return function(_0x684de6){if(_0x684de6){return _0x684de6[_0xc483('0x26')]()[_0xc483('0x25')](function(){_0x308d21[_0xc483('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x258d3b,_0x12a8f0){return function(_0x30cb35){if(!_0x30cb35){_0x258d3b[_0xc483('0x17')](0x194);}return _0x30cb35;};}function handleError(_0x5d9e9f,_0x3fc5e0){_0x3fc5e0=_0x3fc5e0||0x1f4;return function(_0x16ba5a){logger[_0xc483('0x27')](_0x16ba5a['stack']);if(_0x16ba5a[_0xc483('0x28')]){delete _0x16ba5a[_0xc483('0x28')];}_0x5d9e9f[_0xc483('0x18')](_0x3fc5e0)['send'](_0x16ba5a);};}exports['index']=function(_0xd76269,_0x3cf026){var _0x5db3b8={},_0x8ab001={},_0x53b63b={'count':0x0,'rows':[]};var _0x28874d=_['map'](db[_0xc483('0x29')][_0xc483('0x2a')],function(_0x1c5e95){return{'name':_0x1c5e95['fieldName'],'type':_0x1c5e95[_0xc483('0x2b')][_0xc483('0x2c')]};});_0x8ab001[_0xc483('0x2d')]=_['map'](_0x28874d,_0xc483('0x28'));_0x8ab001[_0xc483('0x2e')]=_[_0xc483('0x2f')](_0xd76269['query']);_0x8ab001[_0xc483('0x30')]=_[_0xc483('0x31')](_0x8ab001[_0xc483('0x2d')],_0x8ab001[_0xc483('0x2e')]);_0x5db3b8['attributes']=_[_0xc483('0x31')](_0x8ab001[_0xc483('0x2d')],qs['fields'](_0xd76269['query'][_0xc483('0x32')]));_0x5db3b8[_0xc483('0x33')]=_0x5db3b8[_0xc483('0x33')][_0xc483('0x34')]?_0x5db3b8[_0xc483('0x33')]:_0x8ab001[_0xc483('0x2d')];if(!_0xd76269[_0xc483('0x2e')][_0xc483('0x35')]('nolimit')){_0x5db3b8[_0xc483('0x1d')]=qs[_0xc483('0x1d')](_0xd76269[_0xc483('0x2e')][_0xc483('0x1d')]);_0x5db3b8[_0xc483('0x1b')]=qs[_0xc483('0x1b')](_0xd76269[_0xc483('0x2e')][_0xc483('0x1b')]);}_0x5db3b8['order']=qs[_0xc483('0x36')](_0xd76269['query'][_0xc483('0x36')]);_0x5db3b8[_0xc483('0x37')]=qs['filters'](_[_0xc483('0x38')](_0xd76269['query'],_0x8ab001[_0xc483('0x30')]),_0x28874d);if(_0xd76269[_0xc483('0x2e')][_0xc483('0x39')]){_0x5db3b8[_0xc483('0x37')]=_['merge'](_0x5db3b8[_0xc483('0x37')],{'$or':_[_0xc483('0x3a')](_0x28874d,function(_0xdae9c9){if(_0xdae9c9[_0xc483('0x2b')]!==_0xc483('0x3b')){var _0x63cc45={};_0x63cc45[_0xdae9c9[_0xc483('0x28')]]={'$like':'%'+_0xd76269[_0xc483('0x2e')]['filter']+'%'};return _0x63cc45;}})});}_0x5db3b8=_[_0xc483('0x3c')]({},_0x5db3b8,_0xd76269[_0xc483('0x3d')]);var _0x1434c9={'where':_0x5db3b8[_0xc483('0x37')]};return db['ZohoAccount'][_0xc483('0x1e')](_0x1434c9)['then'](function(_0x502a53){_0x53b63b[_0xc483('0x1e')]=_0x502a53;if(_0xd76269[_0xc483('0x2e')][_0xc483('0x3e')]){_0x5db3b8[_0xc483('0x3f')]=[{'all':!![]}];}return db['ZohoAccount'][_0xc483('0x40')](_0x5db3b8);})['then'](function(_0x5076d7){_0x53b63b['rows']=_0x5076d7;return _0x53b63b;})[_0xc483('0x25')](respondWithFilteredResult(_0x3cf026,_0x5db3b8))[_0xc483('0x41')](handleError(_0x3cf026,null));};exports[_0xc483('0x42')]=function(_0x25d69a,_0x45eb8c){var _0x5c2ea3={'raw':![],'where':{'id':_0x25d69a['params']['id']}},_0x4fc994={};_0x4fc994[_0xc483('0x2d')]=_['keys'](db['ZohoAccount'][_0xc483('0x2a')]);_0x4fc994[_0xc483('0x2e')]=_[_0xc483('0x2f')](_0x25d69a['query']);_0x4fc994[_0xc483('0x30')]=_[_0xc483('0x31')](_0x4fc994[_0xc483('0x2d')],_0x4fc994['query']);_0x5c2ea3[_0xc483('0x33')]=_['intersection'](_0x4fc994[_0xc483('0x2d')],qs[_0xc483('0x32')](_0x25d69a[_0xc483('0x2e')]['fields']));_0x5c2ea3[_0xc483('0x33')]=_0x5c2ea3[_0xc483('0x33')][_0xc483('0x34')]?_0x5c2ea3[_0xc483('0x33')]:_0x4fc994[_0xc483('0x2d')];if(_0x25d69a[_0xc483('0x2e')][_0xc483('0x3e')]){_0x5c2ea3[_0xc483('0x3f')]=[{'all':!![]}];}_0x5c2ea3=_[_0xc483('0x3c')]({},_0x5c2ea3,_0x25d69a[_0xc483('0x3d')]);return db[_0xc483('0x29')]['find'](_0x5c2ea3)[_0xc483('0x25')](handleEntityNotFound(_0x45eb8c,null))[_0xc483('0x25')](respondWithResult(_0x45eb8c,null))[_0xc483('0x41')](handleError(_0x45eb8c,null));};exports['create']=function(_0x277daa,_0x15dbd6){return db['ZohoAccount'][_0xc483('0x43')](_0x277daa[_0xc483('0x44')],{})[_0xc483('0x25')](respondWithResult(_0x15dbd6,0xc9))[_0xc483('0x41')](handleError(_0x15dbd6,null));};exports['update']=function(_0x3edfbd,_0x20e038){if(_0x3edfbd[_0xc483('0x44')]['id']){delete _0x3edfbd[_0xc483('0x44')]['id'];}return db['ZohoAccount'][_0xc483('0x45')]({'where':{'id':_0x3edfbd[_0xc483('0x46')]['id']}})[_0xc483('0x25')](handleEntityNotFound(_0x20e038,null))[_0xc483('0x25')](saveUpdates(_0x3edfbd[_0xc483('0x44')],null))[_0xc483('0x25')](respondWithResult(_0x20e038,null))['catch'](handleError(_0x20e038,null));};exports[_0xc483('0x26')]=function(_0xc384c7,_0x3ba55c){return db[_0xc483('0x29')][_0xc483('0x45')]({'where':{'id':_0xc384c7[_0xc483('0x46')]['id']}})[_0xc483('0x25')](handleEntityNotFound(_0x3ba55c,null))['then'](removeEntity(_0x3ba55c,null))[_0xc483('0x41')](handleError(_0x3ba55c,null));};exports[_0xc483('0x47')]=function(_0xbf1efe,_0x339e64,_0xa3916f){var _0x36ae4e={};var _0x216407={};var _0x2870c4;var _0x57768f;return db[_0xc483('0x29')][_0xc483('0x48')]({'where':{'id':_0xbf1efe[_0xc483('0x46')]['id']}})[_0xc483('0x25')](handleEntityNotFound(_0x339e64,null))[_0xc483('0x25')](function(_0x575570){if(_0x575570){_0x2870c4=_0x575570;_0x216407[_0xc483('0x2d')]=_[_0xc483('0x2f')](db['ZohoConfiguration']['rawAttributes']);_0x216407[_0xc483('0x2e')]=_[_0xc483('0x2f')](_0xbf1efe[_0xc483('0x2e')]);_0x216407['filters']=_[_0xc483('0x31')](_0x216407['model'],_0x216407['query']);_0x36ae4e[_0xc483('0x33')]=_['intersection'](_0x216407[_0xc483('0x2d')],qs[_0xc483('0x32')](_0xbf1efe[_0xc483('0x2e')][_0xc483('0x32')]));_0x36ae4e[_0xc483('0x33')]=_0x36ae4e['attributes'][_0xc483('0x34')]?_0x36ae4e[_0xc483('0x33')]:_0x216407['model'];_0x36ae4e[_0xc483('0x49')]=qs[_0xc483('0x36')](_0xbf1efe[_0xc483('0x2e')][_0xc483('0x36')]);_0x36ae4e['where']=qs[_0xc483('0x30')](_[_0xc483('0x38')](_0xbf1efe['query'],_0x216407['filters']));if(_0xbf1efe['query'][_0xc483('0x39')]){_0x36ae4e[_0xc483('0x37')]=_[_0xc483('0x3c')](_0x36ae4e[_0xc483('0x37')],{'$or':_[_0xc483('0x3a')](_0x36ae4e[_0xc483('0x33')],function(_0x27bda3){var _0x29768b={};_0x29768b[_0x27bda3]={'$like':'%'+_0xbf1efe[_0xc483('0x2e')][_0xc483('0x39')]+'%'};return _0x29768b;})});}_0x36ae4e=_['merge']({},_0x36ae4e,_0xbf1efe[_0xc483('0x3d')]);return _0x2870c4[_0xc483('0x47')](_0x36ae4e);}})[_0xc483('0x25')](function(_0xa22fa9){if(_0xa22fa9){_0x57768f=_0xa22fa9[_0xc483('0x34')];if(!_0xbf1efe[_0xc483('0x2e')][_0xc483('0x35')](_0xc483('0x4a'))){_0x36ae4e[_0xc483('0x1d')]=qs['limit'](_0xbf1efe['query'][_0xc483('0x1d')]);_0x36ae4e[_0xc483('0x1b')]=qs[_0xc483('0x1b')](_0xbf1efe['query'][_0xc483('0x1b')]);}return _0x2870c4[_0xc483('0x47')](_0x36ae4e);}})[_0xc483('0x25')](function(_0x2029bf){if(_0x2029bf){return _0x2029bf?{'count':_0x57768f,'rows':_0x2029bf}:null;}})[_0xc483('0x25')](respondWithResult(_0x339e64,null))[_0xc483('0x41')](handleError(_0x339e64,null));};exports[_0xc483('0x4b')]=function(_0xe892fd,_0x2b3fc8,_0x3b0db4){if(_0xe892fd[_0xc483('0x44')]['id']){delete _0xe892fd[_0xc483('0x44')]['id'];}return db[_0xc483('0x29')][_0xc483('0x48')]({'where':{'id':_0xe892fd[_0xc483('0x46')]['id']}})['then'](handleEntityNotFound(_0x2b3fc8,null))['then'](function(_0x5da22e){if(_0x5da22e){_0xe892fd[_0xc483('0x44')][_0xc483('0x4c')]=_0x5da22e['id'];_0xe892fd[_0xc483('0x44')][_0xc483('0x4d')]=integrations[_0xc483('0x4e')](_0xe892fd[_0xc483('0x44')][_0xc483('0x4f')],_0xe892fd[_0xc483('0x44')][_0xc483('0x2b')]);_0xe892fd['body']['Descriptions']=integrations[_0xc483('0x50')](_0xe892fd['body'][_0xc483('0x4f')],_0xe892fd['body']['type']);return db[_0xc483('0x51')][_0xc483('0x43')](_0xe892fd[_0xc483('0x44')],{'include':[{'model':db[_0xc483('0x52')],'as':'Subjects'},{'model':db[_0xc483('0x52')],'as':_0xc483('0x53')}]});}return null;})[_0xc483('0x25')](respondWithResult(_0x2b3fc8,null))[_0xc483('0x41')](handleError(_0x2b3fc8,null));};function getAccessToken(_0x3e1c41){return new Promise(function(_0xb75270,_0x4b817f){var _0x55ad3b;switch(_0x3e1c41[_0xc483('0x54')]){case'US':_0x55ad3b=_0xc483('0x55');break;case'AU':_0x55ad3b=_0xc483('0x56');break;case'EU':_0x55ad3b='https://accounts.zoho.eu';break;case'IN':_0x55ad3b='https://accounts.zoho.in';break;case'CN':_0x55ad3b=_0xc483('0x57');break;default:_0x55ad3b=_0xc483('0x58');break;}var _0x446670={'method':_0xc483('0x59'),'uri':_0x55ad3b+_0xc483('0x5a'),'qs':{'refresh_token':_0x3e1c41[_0xc483('0x5b')],'client_id':_0x3e1c41[_0xc483('0x5c')],'client_secret':_0x3e1c41[_0xc483('0x5d')],'grant_type':_0xc483('0x5e')},'json':!![]};return rp(_0x446670)['then'](function(_0xa793ed){if(_0xa793ed[_0xc483('0x5f')]){_0xb75270(_0xa793ed[_0xc483('0x5f')]);}else{_0x4b817f('Unable\x20to\x20retrieve\x20the\x20access\x20token');}})['catch'](function(_0x50af40){_0x4b817f(_0x50af40);});});}exports[_0xc483('0x60')]=function(_0x203749,_0x2b3704,_0x582033){var _0x5b8fb1,_0x2d96bb,_0x596909,_0x467da0,_0x197296;return db[_0xc483('0x29')]['findOne']({'where':{'id':_0x203749[_0xc483('0x46')]['id']},'attributes':['id',_0xc483('0x61'),_0xc483('0x54'),'clientId',_0xc483('0x5d'),_0xc483('0x62'),_0xc483('0x63'),_0xc483('0x5b')]})[_0xc483('0x25')](handleEntityNotFound(_0x2b3704,null))['then'](function(_0x1dd41c){_0x197296=_0x1dd41c;_0x5b8fb1=_0x197296[_0xc483('0x61')];_0x2d96bb=_0x5b8fb1===_0xc483('0x64')?'eu':_0xc483('0x65');_0x596909=_0x197296[_0xc483('0x62')];var _0x47c5a8=_0x596909[_0xc483('0x66')](-0x1);if(_0x47c5a8==='/'||_0x47c5a8==='\x5c'||_0x47c5a8===':'){_0x596909=_0x596909[_0xc483('0x67')](0x0,_0x596909['lastIndexOf'](_0x47c5a8));}if(!_0x197296['refreshToken']){throw new Error(_0xc483('0x68'));}return getAccessToken(_0x197296);})[_0xc483('0x25')](function(_0x163af7){if(_0x163af7){return rp({'method':_0xc483('0x69'),'uri':util[_0xc483('0x6a')](_0xc483('0x6b'),_0x2d96bb),'qs':{'module':_0xc483('0x6c')},'headers':{'Authorization':_0xc483('0x6d')+_0x163af7},'json':!![]});}})[_0xc483('0x25')](function(_0x12efd7){if(_0x12efd7){if(_0x12efd7[_0xc483('0x6e')]&&_0x12efd7[_0xc483('0x6e')][_0xc483('0x27')]){throw new Error(_0x12efd7[_0xc483('0x6e')][_0xc483('0x27')]['message']);}var _0x1ce663=[];var _0x302bf8=[];var _0xb6b87f=[_0xc483('0x6f'),_0xc483('0x70'),_0xc483('0x71'),_0xc483('0x72'),_0xc483('0x73'),_0xc483('0x74'),_0xc483('0x75'),_0xc483('0x76')];_0x302bf8=_[_0xc483('0x77')](_0x12efd7[_0xc483('0x32')],function(_0x5c497f){return _0xb6b87f[_0xc483('0x78')](_0x5c497f[_0xc483('0x79')]);});for(var _0xa52993=0x0;_0xa52993<_0x302bf8['length'];_0xa52993++){if(_0x302bf8[_0xa52993][_0xc483('0x7a')]===![]){_0x1ce663[_0xc483('0x7b')]({'id':_0x302bf8[_0xa52993]['id'],'name':_0x302bf8[_0xa52993][_0xc483('0x7c')],'custom':_0x302bf8[_0xa52993]['custom_field'],'options':_0x302bf8[_0xa52993][_0xc483('0x7d')]===_0xc483('0x7e')&&_0x302bf8[_0xa52993][_0xc483('0x7f')][_0xc483('0x34')]>-0x1?_[_0xc483('0x3a')](_0x302bf8[_0xa52993][_0xc483('0x7f')],function(_0x581b42){return{'name':_0x581b42,'value':_0x581b42};}):[]});}}return{'count':_0x1ce663[_0xc483('0x34')],'rows':_0x1ce663};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithResult(_0x2b3704,null))[_0xc483('0x41')](function(_0xa76186){var _0x313d85=_0x203749['query']['test']?0x1f4:_0xa76186['statusCode']||0x1f4;logger[_0xc483('0x27')]('getFields,\x20%s,\x20%s,\x20%s',_0xc483('0x60'),_0x313d85,JSON['stringify'](_0xa76186));delete _0xa76186[_0xc483('0x28')];if(_0x313d85===0x191){_0x313d85=0x190;}_0x2b3704[_0xc483('0x18')](_0x313d85)[_0xc483('0x80')](_0x203749[_0xc483('0x2e')][_0xc483('0x81')]?{'message':_0xc483('0x82'),'statusCode':_0xa76186['statusCode']}:_0xa76186);});}; \ No newline at end of file +var _0xd42e=['filter','merge','VIRTUAL','options','includeAll','include','rows','catch','show','params','length','find','create','body','update','findOne','ZohoConfiguration','getConfigurations','addConfiguration','Subjects','getSubjects','channel','Descriptions','getDescriptions','ZohoField','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.in','POST','clientId','clientSecret','access_token','Unable\x20to\x20retrieve\x20the\x20access\x20token','getFields','host','zone','code','refreshToken','com','serverUrl','slice','substring','lastIndexOf','Refresh\x20Token\x20not\x20available\x20for\x20the\x20account','GET','format','https://www.zohoapis.%s/crm/v2/settings/fields','Zoho-oauthtoken\x20','response','message','Owner','Subject','Description','WhoId','Call_Duration','Call_Result','Call_Type','remove','includes','api_name','system_mandatory','push','display_label','custom_field','picklist','pick_list_values','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','test','eml-format','request-promise','moment','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','count','offset','limit','set','apply','reject','save','then','destroy','error','stack','send','index','map','ZohoAccount','rawAttributes','fieldName','type','name','query','keys','filters','intersection','model','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0x2ad691,_0x5ddda8){var _0x1b45aa=function(_0x2ff36a){while(--_0x2ff36a){_0x2ad691['push'](_0x2ad691['shift']());}};_0x1b45aa(++_0x5ddda8);}(_0xd42e,0x149));var _0xed42=function(_0x2a3c4d,_0x9c6b37){_0x2a3c4d=_0x2a3c4d-0x0;var _0x55c390=_0xd42e[_0x2a3c4d];return _0x55c390;};'use strict';var emlformat=require(_0xed42('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xed42('0x1'));var moment=require(_0xed42('0x2'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xed42('0x3'));var path=require(_0xed42('0x4'));var sox=require(_0xed42('0x5'));var csv=require(_0xed42('0x6'));var ejs=require(_0xed42('0x7'));var fs=require('fs');var fs_extra=require(_0xed42('0x8'));var _=require('lodash');var squel=require(_0xed42('0x9'));var crypto=require(_0xed42('0xa'));var jsforce=require(_0xed42('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xed42('0x6'));var querystring=require(_0xed42('0xc'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xed42('0xd'));var qs=require(_0xed42('0xe'));var as=require(_0xed42('0xf'));var hardwareService=require(_0xed42('0x10'));var logger=require('../../config/logger')('api');var utils=require(_0xed42('0x11'));var config=require(_0xed42('0x12'));var licenseUtil=require(_0xed42('0x13'));var db=require(_0xed42('0x14'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x65a16e,_0x549df0){_0x549df0=_0x549df0||0xcc;return function(_0x1ff940){if(_0x1ff940){return _0x65a16e[_0xed42('0x15')](_0x549df0);}return _0x65a16e[_0xed42('0x16')](_0x549df0)[_0xed42('0x17')]();};}function respondWithResult(_0x19ddff,_0x334ae4){_0x334ae4=_0x334ae4||0xc8;return function(_0x578156){if(_0x578156){return _0x19ddff[_0xed42('0x16')](_0x334ae4)[_0xed42('0x18')](_0x578156);}};}function respondWithFilteredResult(_0x1426e8,_0x5f56a3){return function(_0x12310f){if(_0x12310f){var _0x23ddec=typeof _0x5f56a3['offset']===_0xed42('0x19')&&typeof _0x5f56a3['limit']===_0xed42('0x19');var _0xb57cd2=_0x12310f[_0xed42('0x1a')];var _0x3eee8c=_0x23ddec?0x0:_0x5f56a3['offset'];var _0x4c54d1=_0x23ddec?_0x12310f[_0xed42('0x1a')]:_0x5f56a3[_0xed42('0x1b')]+_0x5f56a3[_0xed42('0x1c')];var _0x4c48cb;if(_0x4c54d1>=_0xb57cd2){_0x4c54d1=_0xb57cd2;_0x4c48cb=0xc8;}else{_0x4c48cb=0xce;}_0x1426e8[_0xed42('0x16')](_0x4c48cb);return _0x1426e8[_0xed42('0x1d')]('Content-Range',_0x3eee8c+'-'+_0x4c54d1+'/'+_0xb57cd2)[_0xed42('0x18')](_0x12310f);}return null;};}function patchUpdates(_0x242b10){return function(_0x129d51){try{jsonpatch[_0xed42('0x1e')](_0x129d51,_0x242b10,!![]);}catch(_0x542035){return BPromise[_0xed42('0x1f')](_0x542035);}return _0x129d51[_0xed42('0x20')]();};}function saveUpdates(_0x3a3bde,_0x16f3ad){return function(_0x452c9d){if(_0x452c9d){return _0x452c9d['update'](_0x3a3bde)[_0xed42('0x21')](function(_0x2d949b){return _0x2d949b;});}return null;};}function removeEntity(_0x16b2a8,_0x3d3e3e){return function(_0x5b3b65){if(_0x5b3b65){return _0x5b3b65[_0xed42('0x22')]()[_0xed42('0x21')](function(){_0x16b2a8[_0xed42('0x16')](0xcc)[_0xed42('0x17')]();});}};}function handleEntityNotFound(_0x192059,_0xa8a4e2){return function(_0x57c8fd){if(!_0x57c8fd){_0x192059[_0xed42('0x15')](0x194);}return _0x57c8fd;};}function handleError(_0x22d741,_0xeeef90){_0xeeef90=_0xeeef90||0x1f4;return function(_0x1f8524){logger[_0xed42('0x23')](_0x1f8524[_0xed42('0x24')]);if(_0x1f8524['name']){delete _0x1f8524['name'];}_0x22d741[_0xed42('0x16')](_0xeeef90)[_0xed42('0x25')](_0x1f8524);};}exports[_0xed42('0x26')]=function(_0x3ad66c,_0x57373e){var _0xcca4da={},_0xccb7d9={},_0x4f9db9={'count':0x0,'rows':[]};var _0x4c70eb=_[_0xed42('0x27')](db[_0xed42('0x28')][_0xed42('0x29')],function(_0x38251f){return{'name':_0x38251f[_0xed42('0x2a')],'type':_0x38251f[_0xed42('0x2b')]['key']};});_0xccb7d9['model']=_[_0xed42('0x27')](_0x4c70eb,_0xed42('0x2c'));_0xccb7d9[_0xed42('0x2d')]=_[_0xed42('0x2e')](_0x3ad66c[_0xed42('0x2d')]);_0xccb7d9[_0xed42('0x2f')]=_[_0xed42('0x30')](_0xccb7d9[_0xed42('0x31')],_0xccb7d9['query']);_0xcca4da['attributes']=_[_0xed42('0x30')](_0xccb7d9[_0xed42('0x31')],qs[_0xed42('0x32')](_0x3ad66c['query'][_0xed42('0x32')]));_0xcca4da[_0xed42('0x33')]=_0xcca4da['attributes']['length']?_0xcca4da[_0xed42('0x33')]:_0xccb7d9[_0xed42('0x31')];if(!_0x3ad66c[_0xed42('0x2d')][_0xed42('0x34')](_0xed42('0x35'))){_0xcca4da[_0xed42('0x1c')]=qs[_0xed42('0x1c')](_0x3ad66c['query'][_0xed42('0x1c')]);_0xcca4da[_0xed42('0x1b')]=qs[_0xed42('0x1b')](_0x3ad66c[_0xed42('0x2d')][_0xed42('0x1b')]);}_0xcca4da[_0xed42('0x36')]=qs['sort'](_0x3ad66c[_0xed42('0x2d')][_0xed42('0x37')]);_0xcca4da[_0xed42('0x38')]=qs[_0xed42('0x2f')](_[_0xed42('0x39')](_0x3ad66c['query'],_0xccb7d9['filters']),_0x4c70eb);if(_0x3ad66c['query'][_0xed42('0x3a')]){_0xcca4da[_0xed42('0x38')]=_[_0xed42('0x3b')](_0xcca4da[_0xed42('0x38')],{'$or':_[_0xed42('0x27')](_0x4c70eb,function(_0x1c7dcf){if(_0x1c7dcf[_0xed42('0x2b')]!==_0xed42('0x3c')){var _0x235403={};_0x235403[_0x1c7dcf[_0xed42('0x2c')]]={'$like':'%'+_0x3ad66c['query'][_0xed42('0x3a')]+'%'};return _0x235403;}})});}_0xcca4da=_[_0xed42('0x3b')]({},_0xcca4da,_0x3ad66c[_0xed42('0x3d')]);var _0x4ceec6={'where':_0xcca4da['where']};return db[_0xed42('0x28')]['count'](_0x4ceec6)[_0xed42('0x21')](function(_0x301274){_0x4f9db9['count']=_0x301274;if(_0x3ad66c['query'][_0xed42('0x3e')]){_0xcca4da[_0xed42('0x3f')]=[{'all':!![]}];}return db['ZohoAccount']['findAll'](_0xcca4da);})['then'](function(_0x475909){_0x4f9db9[_0xed42('0x40')]=_0x475909;return _0x4f9db9;})[_0xed42('0x21')](respondWithFilteredResult(_0x57373e,_0xcca4da))[_0xed42('0x41')](handleError(_0x57373e,null));};exports[_0xed42('0x42')]=function(_0x20c976,_0x2902b3){var _0x4ffdaf={'raw':![],'where':{'id':_0x20c976[_0xed42('0x43')]['id']}},_0x1dea23={};_0x1dea23[_0xed42('0x31')]=_[_0xed42('0x2e')](db[_0xed42('0x28')][_0xed42('0x29')]);_0x1dea23[_0xed42('0x2d')]=_[_0xed42('0x2e')](_0x20c976[_0xed42('0x2d')]);_0x1dea23['filters']=_['intersection'](_0x1dea23[_0xed42('0x31')],_0x1dea23[_0xed42('0x2d')]);_0x4ffdaf[_0xed42('0x33')]=_[_0xed42('0x30')](_0x1dea23[_0xed42('0x31')],qs[_0xed42('0x32')](_0x20c976[_0xed42('0x2d')]['fields']));_0x4ffdaf[_0xed42('0x33')]=_0x4ffdaf['attributes'][_0xed42('0x44')]?_0x4ffdaf['attributes']:_0x1dea23[_0xed42('0x31')];if(_0x20c976['query'][_0xed42('0x3e')]){_0x4ffdaf[_0xed42('0x3f')]=[{'all':!![]}];}_0x4ffdaf=_[_0xed42('0x3b')]({},_0x4ffdaf,_0x20c976[_0xed42('0x3d')]);return db[_0xed42('0x28')][_0xed42('0x45')](_0x4ffdaf)['then'](handleEntityNotFound(_0x2902b3,null))[_0xed42('0x21')](respondWithResult(_0x2902b3,null))[_0xed42('0x41')](handleError(_0x2902b3,null));};exports[_0xed42('0x46')]=function(_0x2fd607,_0x37224e){return db[_0xed42('0x28')][_0xed42('0x46')](_0x2fd607[_0xed42('0x47')],{})[_0xed42('0x21')](respondWithResult(_0x37224e,0xc9))[_0xed42('0x41')](handleError(_0x37224e,null));};exports[_0xed42('0x48')]=function(_0x3feaac,_0x1368a3){if(_0x3feaac['body']['id']){delete _0x3feaac[_0xed42('0x47')]['id'];}return db[_0xed42('0x28')][_0xed42('0x45')]({'where':{'id':_0x3feaac['params']['id']}})['then'](handleEntityNotFound(_0x1368a3,null))[_0xed42('0x21')](saveUpdates(_0x3feaac[_0xed42('0x47')],null))[_0xed42('0x21')](respondWithResult(_0x1368a3,null))[_0xed42('0x41')](handleError(_0x1368a3,null));};exports[_0xed42('0x22')]=function(_0x5940e9,_0x3bcec9){return db['ZohoAccount'][_0xed42('0x45')]({'where':{'id':_0x5940e9[_0xed42('0x43')]['id']}})[_0xed42('0x21')](handleEntityNotFound(_0x3bcec9,null))[_0xed42('0x21')](removeEntity(_0x3bcec9,null))[_0xed42('0x41')](handleError(_0x3bcec9,null));};exports['getConfigurations']=function(_0x44814e,_0x3c174a,_0x20a8b6){var _0x57fcef={};var _0x2d8924={};var _0x105c59;var _0x147eff;return db['ZohoAccount'][_0xed42('0x49')]({'where':{'id':_0x44814e['params']['id']}})['then'](handleEntityNotFound(_0x3c174a,null))['then'](function(_0x564b0e){if(_0x564b0e){_0x105c59=_0x564b0e;_0x2d8924['model']=_['keys'](db[_0xed42('0x4a')][_0xed42('0x29')]);_0x2d8924[_0xed42('0x2d')]=_[_0xed42('0x2e')](_0x44814e[_0xed42('0x2d')]);_0x2d8924[_0xed42('0x2f')]=_[_0xed42('0x30')](_0x2d8924['model'],_0x2d8924[_0xed42('0x2d')]);_0x57fcef[_0xed42('0x33')]=_[_0xed42('0x30')](_0x2d8924['model'],qs[_0xed42('0x32')](_0x44814e['query'][_0xed42('0x32')]));_0x57fcef['attributes']=_0x57fcef['attributes'][_0xed42('0x44')]?_0x57fcef[_0xed42('0x33')]:_0x2d8924[_0xed42('0x31')];_0x57fcef[_0xed42('0x36')]=qs[_0xed42('0x37')](_0x44814e[_0xed42('0x2d')]['sort']);_0x57fcef[_0xed42('0x38')]=qs['filters'](_[_0xed42('0x39')](_0x44814e[_0xed42('0x2d')],_0x2d8924[_0xed42('0x2f')]));if(_0x44814e[_0xed42('0x2d')][_0xed42('0x3a')]){_0x57fcef[_0xed42('0x38')]=_[_0xed42('0x3b')](_0x57fcef[_0xed42('0x38')],{'$or':_['map'](_0x57fcef[_0xed42('0x33')],function(_0x157098){var _0x1b5ac2={};_0x1b5ac2[_0x157098]={'$like':'%'+_0x44814e[_0xed42('0x2d')][_0xed42('0x3a')]+'%'};return _0x1b5ac2;})});}_0x57fcef=_[_0xed42('0x3b')]({},_0x57fcef,_0x44814e[_0xed42('0x3d')]);return _0x105c59['getConfigurations'](_0x57fcef);}})[_0xed42('0x21')](function(_0x14df6d){if(_0x14df6d){_0x147eff=_0x14df6d[_0xed42('0x44')];if(!_0x44814e[_0xed42('0x2d')][_0xed42('0x34')]('nolimit')){_0x57fcef[_0xed42('0x1c')]=qs['limit'](_0x44814e['query'][_0xed42('0x1c')]);_0x57fcef[_0xed42('0x1b')]=qs[_0xed42('0x1b')](_0x44814e[_0xed42('0x2d')][_0xed42('0x1b')]);}return _0x105c59[_0xed42('0x4b')](_0x57fcef);}})[_0xed42('0x21')](function(_0x313a4f){if(_0x313a4f){return _0x313a4f?{'count':_0x147eff,'rows':_0x313a4f}:null;}})[_0xed42('0x21')](respondWithResult(_0x3c174a,null))[_0xed42('0x41')](handleError(_0x3c174a,null));};exports[_0xed42('0x4c')]=function(_0x4c9cff,_0x56631f,_0x5e1548){if(_0x4c9cff['body']['id']){delete _0x4c9cff['body']['id'];}return db[_0xed42('0x28')][_0xed42('0x49')]({'where':{'id':_0x4c9cff['params']['id']}})[_0xed42('0x21')](handleEntityNotFound(_0x56631f,null))[_0xed42('0x21')](function(_0x3e4104){if(_0x3e4104){_0x4c9cff['body']['AccountId']=_0x3e4104['id'];_0x4c9cff[_0xed42('0x47')][_0xed42('0x4d')]=integrations[_0xed42('0x4e')](_0x4c9cff['body'][_0xed42('0x4f')],_0x4c9cff[_0xed42('0x47')][_0xed42('0x2b')]);_0x4c9cff[_0xed42('0x47')][_0xed42('0x50')]=integrations[_0xed42('0x51')](_0x4c9cff['body'][_0xed42('0x4f')],_0x4c9cff[_0xed42('0x47')]['type']);return db[_0xed42('0x4a')][_0xed42('0x46')](_0x4c9cff[_0xed42('0x47')],{'include':[{'model':db[_0xed42('0x52')],'as':'Subjects'},{'model':db[_0xed42('0x52')],'as':_0xed42('0x50')}]});}return null;})[_0xed42('0x21')](respondWithResult(_0x56631f,null))[_0xed42('0x41')](handleError(_0x56631f,null));};function getAccessToken(_0x3a8454){return new Promise(function(_0x56b8c2,_0x12a020){var _0x24f7e0;switch(_0x3a8454['zone']){case'US':_0x24f7e0=_0xed42('0x53');break;case'AU':_0x24f7e0=_0xed42('0x54');break;case'EU':_0x24f7e0=_0xed42('0x55');break;case'IN':_0x24f7e0=_0xed42('0x56');break;case'CN':_0x24f7e0='https://accounts.zoho.com.cn';break;default:_0x24f7e0='https://accounts.zoho.eu';break;}var _0xa093ef={'method':_0xed42('0x57'),'uri':_0x24f7e0+'/oauth/v2/token','qs':{'refresh_token':_0x3a8454['refreshToken'],'client_id':_0x3a8454[_0xed42('0x58')],'client_secret':_0x3a8454[_0xed42('0x59')],'grant_type':'refresh_token'},'json':!![]};return rp(_0xa093ef)['then'](function(_0x2e580c){if(_0x2e580c[_0xed42('0x5a')]){_0x56b8c2(_0x2e580c[_0xed42('0x5a')]);}else{_0x12a020(_0xed42('0x5b'));}})[_0xed42('0x41')](function(_0x5db75a){_0x12a020(_0x5db75a);});});}exports[_0xed42('0x5c')]=function(_0x463329,_0xdf5048,_0x301afc){var _0x871a5f,_0x1b560e,_0x3f5ead,_0x108638,_0x341e3d;return db[_0xed42('0x28')][_0xed42('0x49')]({'where':{'id':_0x463329[_0xed42('0x43')]['id']},'attributes':['id',_0xed42('0x5d'),_0xed42('0x5e'),_0xed42('0x58'),_0xed42('0x59'),'serverUrl',_0xed42('0x5f'),_0xed42('0x60')]})['then'](handleEntityNotFound(_0xdf5048,null))[_0xed42('0x21')](function(_0x3a6de7){_0x341e3d=_0x3a6de7;_0x871a5f=_0x341e3d[_0xed42('0x5d')];_0x1b560e=_0x871a5f==='zoho.eu'?'eu':_0xed42('0x61');_0x3f5ead=_0x341e3d[_0xed42('0x62')];var _0x1acfa0=_0x3f5ead[_0xed42('0x63')](-0x1);if(_0x1acfa0==='/'||_0x1acfa0==='\x5c'||_0x1acfa0===':'){_0x3f5ead=_0x3f5ead[_0xed42('0x64')](0x0,_0x3f5ead[_0xed42('0x65')](_0x1acfa0));}if(!_0x341e3d[_0xed42('0x60')]){throw new Error(_0xed42('0x66'));}return getAccessToken(_0x341e3d);})['then'](function(_0x43b185){if(_0x43b185){return rp({'method':_0xed42('0x67'),'uri':util[_0xed42('0x68')](_0xed42('0x69'),_0x1b560e),'qs':{'module':'Calls'},'headers':{'Authorization':_0xed42('0x6a')+_0x43b185},'json':!![]});}})[_0xed42('0x21')](function(_0x3299d2){if(_0x3299d2){if(_0x3299d2[_0xed42('0x6b')]&&_0x3299d2[_0xed42('0x6b')]['error']){throw new Error(_0x3299d2['response'][_0xed42('0x23')][_0xed42('0x6c')]);}var _0x35182e=[];var _0x5859c1=[];var _0x1595ae=[_0xed42('0x6d'),_0xed42('0x6e'),_0xed42('0x6f'),_0xed42('0x70'),_0xed42('0x71'),_0xed42('0x72'),'Call_Start_Time',_0xed42('0x73')];_0x5859c1=_[_0xed42('0x74')](_0x3299d2['fields'],function(_0xdfc50f){return _0x1595ae[_0xed42('0x75')](_0xdfc50f[_0xed42('0x76')]);});for(var _0x5208de=0x0;_0x5208de<_0x5859c1[_0xed42('0x44')];_0x5208de++){if(_0x5859c1[_0x5208de][_0xed42('0x77')]===![]){_0x35182e[_0xed42('0x78')]({'id':_0x5859c1[_0x5208de]['id'],'name':_0x5859c1[_0x5208de][_0xed42('0x79')],'custom':_0x5859c1[_0x5208de][_0xed42('0x7a')],'options':_0x5859c1[_0x5208de]['data_type']===_0xed42('0x7b')&&_0x5859c1[_0x5208de][_0xed42('0x7c')]['length']>-0x1?_[_0xed42('0x27')](_0x5859c1[_0x5208de][_0xed42('0x7c')],function(_0x13a640){return{'name':_0x13a640,'value':_0x13a640};}):[]});}}return{'count':_0x35182e[_0xed42('0x44')],'rows':_0x35182e};}else{return{'count':0x0,'rows':[]};}})[_0xed42('0x21')](respondWithResult(_0xdf5048,null))[_0xed42('0x41')](function(_0x5650eb){var _0x827a4e=_0x463329[_0xed42('0x2d')]['test']?0x1f4:_0x5650eb[_0xed42('0x7d')]||0x1f4;logger[_0xed42('0x23')](_0xed42('0x7e'),'getFields',_0x827a4e,JSON[_0xed42('0x7f')](_0x5650eb));delete _0x5650eb[_0xed42('0x2c')];if(_0x827a4e===0x191){_0x827a4e=0x190;}_0xdf5048[_0xed42('0x16')](_0x827a4e)[_0xed42('0x25')](_0x463329[_0xed42('0x2d')][_0xed42('0x80')]?{'message':'Wrong\x20credentials','statusCode':_0x5650eb['statusCode']}:_0x5650eb);});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.model.js b/server/api/intZohoAccount/intZohoAccount.model.js index 4a80d14..bebb4ad 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 _0x6bc0=['clientId','clientSecret','code','host','serverUrl','slice','substring','lastIndexOf','zone','https://accounts.zoho.com','https://accounts.zoho.in','https://accounts.zoho.com.cn','https://accounts.zoho.eu','POST','/oauth/v2/token','application/x-www-form-urlencoded','parse','refreshToken','refresh_token','info','format','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','name','error','inspect','catch','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','https://accounts.zoho.com.au','authorization_code','lodash','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./intZohoAccount.attributes','../../components/integrations/configuration','exports','define','ZohoAccount','int_zoho_accounts','changed'];(function(_0x297fd3,_0x115406){var _0x2af381=function(_0x1dd31b){while(--_0x1dd31b){_0x297fd3['push'](_0x297fd3['shift']());}};_0x2af381(++_0x115406);}(_0x6bc0,0x17d));var _0x06bc=function(_0x1d36b0,_0x59b9ff){_0x1d36b0=_0x1d36b0-0x0;var _0x2d6a18=_0x6bc0[_0x1d36b0];return _0x2d6a18;};'use strict';var _=require(_0x06bc('0x0'));var util=require('util');var logger=require(_0x06bc('0x1'))(_0x06bc('0x2'));var moment=require(_0x06bc('0x3'));var BPromise=require(_0x06bc('0x4'));var rp=require(_0x06bc('0x5'));var fs=require('fs');var path=require(_0x06bc('0x6'));var rimraf=require('rimraf');var config=require(_0x06bc('0x7'));var attributes=require(_0x06bc('0x8'));var integrations=require(_0x06bc('0x9'));module[_0x06bc('0xa')]=function(_0x193c25,_0x152913){return _0x193c25[_0x06bc('0xb')](_0x06bc('0xc'),attributes,{'tableName':_0x06bc('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0xcb5547,_0x1cec44,_0x52e226){if(_0xcb5547[_0x06bc('0xe')]('zone')||_0xcb5547[_0x06bc('0xe')]('serverUrl')||_0xcb5547[_0x06bc('0xe')](_0x06bc('0xf'))||_0xcb5547[_0x06bc('0xe')](_0x06bc('0x10'))||_0xcb5547[_0x06bc('0xe')](_0x06bc('0x11'))||_0xcb5547['changed'](_0x06bc('0x12'))){var _0x2a3104,_0x28d0bf;_0x2a3104=_0xcb5547[_0x06bc('0x13')];var _0x291152=_0x2a3104[_0x06bc('0x14')](-0x1);if(_0x291152==='/'||_0x291152==='\x5c'||_0x291152===':'){_0x2a3104=_0x2a3104[_0x06bc('0x15')](0x0,_0x2a3104[_0x06bc('0x16')](_0x291152));}switch(_0xcb5547[_0x06bc('0x17')]){case'US':_0x28d0bf=_0x06bc('0x18');break;case'AU':_0x28d0bf='https://accounts.zoho.com.au';break;case'IN':_0x28d0bf=_0x06bc('0x19');break;case'CN':_0x28d0bf=_0x06bc('0x1a');break;default:_0x28d0bf=_0x06bc('0x1b');break;}var _0x40ed14={'method':_0x06bc('0x1c'),'uri':_0x28d0bf+_0x06bc('0x1d'),'form':{'grant_type':'authorization_code','client_id':_0xcb5547['clientId'],'client_secret':_0xcb5547['clientSecret'],'redirect_uri':_0xcb5547[_0x06bc('0x13')],'code':_0xcb5547[_0x06bc('0x11')]},'headers':{'Content-Type':_0x06bc('0x1e')}};return rp(_0x40ed14)['then'](function(_0x271d48){var _0x1b0c7e=JSON[_0x06bc('0x1f')](_0x271d48);if(_0x1b0c7e['refresh_token']){_0xcb5547[_0x06bc('0x20')]=_0x1b0c7e[_0x06bc('0x21')];logger[_0x06bc('0x22')](util[_0x06bc('0x23')](_0x06bc('0x24'),_0xcb5547[_0x06bc('0x25')],_0xcb5547['id']));}else{logger[_0x06bc('0x26')](util[_0x06bc('0x23')]('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0xcb5547[_0x06bc('0x25')],_0xcb5547['id']),util[_0x06bc('0x27')](_0x1b0c7e,{'showHidden':![],'depth':null}));}return _0x52e226(null,_0x1cec44);})[_0x06bc('0x28')](function(_0x928555){logger[_0x06bc('0x26')](util[_0x06bc('0x23')](_0x06bc('0x29'),_0xcb5547[_0x06bc('0x25')],_0xcb5547['id']),util['inspect'](parsedResult,{'showHidden':![],'depth':null}));return _0x52e226(_0x928555);});}else{return _0x52e226(null,_0x1cec44);}},'beforeUpdate':function(_0x584817,_0x402820,_0x3cde24){if(_0x584817[_0x06bc('0xe')](_0x06bc('0x17'))||_0x584817['changed'](_0x06bc('0x13'))||_0x584817['changed'](_0x06bc('0xf'))||_0x584817[_0x06bc('0xe')](_0x06bc('0x10'))||_0x584817[_0x06bc('0xe')](_0x06bc('0x11'))||_0x584817['changed']('host')){var _0x2a3fcb,_0x4cdb09;_0x2a3fcb=_0x584817[_0x06bc('0x13')];var _0x5d8078=_0x2a3fcb[_0x06bc('0x14')](-0x1);if(_0x5d8078==='/'||_0x5d8078==='\x5c'||_0x5d8078===':'){_0x2a3fcb=_0x2a3fcb['substring'](0x0,_0x2a3fcb[_0x06bc('0x16')](_0x5d8078));}switch(_0x584817[_0x06bc('0x17')]){case'US':_0x4cdb09='https://accounts.zoho.com';break;case'AU':_0x4cdb09=_0x06bc('0x2a');break;case'IN':_0x4cdb09=_0x06bc('0x19');break;case'CN':_0x4cdb09=_0x06bc('0x1a');break;default:_0x4cdb09=_0x06bc('0x1b');break;}var _0x2d2600={'method':_0x06bc('0x1c'),'uri':_0x4cdb09+_0x06bc('0x1d'),'form':{'grant_type':_0x06bc('0x2b'),'client_id':_0x584817[_0x06bc('0xf')],'client_secret':_0x584817[_0x06bc('0x10')],'redirect_uri':_0x584817[_0x06bc('0x13')],'code':_0x584817[_0x06bc('0x11')]},'headers':{'Content-Type':_0x06bc('0x1e')}};return rp(_0x2d2600)['then'](function(_0x36df37){var _0x5ef1b0=JSON[_0x06bc('0x1f')](_0x36df37);if(_0x5ef1b0[_0x06bc('0x21')]){_0x584817['refreshToken']=_0x5ef1b0[_0x06bc('0x21')];logger[_0x06bc('0x22')](util['format'](_0x06bc('0x24'),_0x584817[_0x06bc('0x25')],_0x584817['id']));}else{logger[_0x06bc('0x26')](util['format'](_0x06bc('0x29'),_0x584817[_0x06bc('0x25')],_0x584817['id']),util[_0x06bc('0x27')](_0x5ef1b0,{'showHidden':![],'depth':null}));}return _0x3cde24(null,_0x402820);})[_0x06bc('0x28')](function(_0xcfb0dc){logger[_0x06bc('0x26')](util[_0x06bc('0x23')](_0x06bc('0x29'),_0x584817['name'],_0x584817['id']),util[_0x06bc('0x27')](parsedResult,{'showHidden':![],'depth':null}));return _0x3cde24(_0xcfb0dc);});}else{return _0x3cde24(null,_0x402820);}}}});}; \ No newline at end of file +var _0x1cba=['../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./intZohoAccount.attributes','exports','define','ZohoAccount','int_zoho_accounts','zone','changed','serverUrl','clientSecret','code','host','substring','lastIndexOf','https://accounts.zoho.in','https://accounts.zoho.com.cn','https://accounts.zoho.eu','POST','/oauth/v2/token','authorization_code','clientId','application/x-www-form-urlencoded','then','parse','refresh_token','refreshToken','format','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','name','error','inspect','catch','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','info','lodash'];(function(_0x578275,_0xe7ae46){var _0xf78041=function(_0x13148c){while(--_0x13148c){_0x578275['push'](_0x578275['shift']());}};_0xf78041(++_0xe7ae46);}(_0x1cba,0x1c2));var _0xa1cb=function(_0xd7f8f7,_0x42785e){_0xd7f8f7=_0xd7f8f7-0x0;var _0x34b92c=_0x1cba[_0xd7f8f7];return _0x34b92c;};'use strict';var _=require(_0xa1cb('0x0'));var util=require('util');var logger=require(_0xa1cb('0x1'))(_0xa1cb('0x2'));var moment=require(_0xa1cb('0x3'));var BPromise=require('bluebird');var rp=require(_0xa1cb('0x4'));var fs=require('fs');var path=require(_0xa1cb('0x5'));var rimraf=require(_0xa1cb('0x6'));var config=require(_0xa1cb('0x7'));var attributes=require(_0xa1cb('0x8'));var integrations=require('../../components/integrations/configuration');module[_0xa1cb('0x9')]=function(_0x436f17,_0x263646){return _0x436f17[_0xa1cb('0xa')](_0xa1cb('0xb'),attributes,{'tableName':_0xa1cb('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x15df39,_0x385cf3,_0x4fe195){if(_0x15df39['changed'](_0xa1cb('0xd'))||_0x15df39[_0xa1cb('0xe')](_0xa1cb('0xf'))||_0x15df39[_0xa1cb('0xe')]('clientId')||_0x15df39['changed'](_0xa1cb('0x10'))||_0x15df39['changed'](_0xa1cb('0x11'))||_0x15df39[_0xa1cb('0xe')](_0xa1cb('0x12'))){var _0x29a840,_0x471dc3;_0x29a840=_0x15df39['serverUrl'];var _0x448966=_0x29a840['slice'](-0x1);if(_0x448966==='/'||_0x448966==='\x5c'||_0x448966===':'){_0x29a840=_0x29a840[_0xa1cb('0x13')](0x0,_0x29a840[_0xa1cb('0x14')](_0x448966));}switch(_0x15df39[_0xa1cb('0xd')]){case'US':_0x471dc3='https://accounts.zoho.com';break;case'AU':_0x471dc3='https://accounts.zoho.com.au';break;case'IN':_0x471dc3=_0xa1cb('0x15');break;case'CN':_0x471dc3=_0xa1cb('0x16');break;default:_0x471dc3=_0xa1cb('0x17');break;}var _0x2eab38={'method':_0xa1cb('0x18'),'uri':_0x471dc3+_0xa1cb('0x19'),'form':{'grant_type':_0xa1cb('0x1a'),'client_id':_0x15df39[_0xa1cb('0x1b')],'client_secret':_0x15df39[_0xa1cb('0x10')],'redirect_uri':_0x15df39[_0xa1cb('0xf')],'code':_0x15df39['code']},'headers':{'Content-Type':_0xa1cb('0x1c')}};return rp(_0x2eab38)[_0xa1cb('0x1d')](function(_0x34ad89){var _0x49f868=JSON[_0xa1cb('0x1e')](_0x34ad89);if(_0x49f868[_0xa1cb('0x1f')]){_0x15df39[_0xa1cb('0x20')]=_0x49f868['refresh_token'];logger['info'](util[_0xa1cb('0x21')](_0xa1cb('0x22'),_0x15df39[_0xa1cb('0x23')],_0x15df39['id']));}else{logger[_0xa1cb('0x24')](util[_0xa1cb('0x21')]('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x15df39[_0xa1cb('0x23')],_0x15df39['id']),util[_0xa1cb('0x25')](_0x49f868,{'showHidden':![],'depth':null}));}return _0x4fe195(null,_0x385cf3);})[_0xa1cb('0x26')](function(_0x37913e){logger[_0xa1cb('0x24')](util[_0xa1cb('0x21')](_0xa1cb('0x27'),_0x15df39[_0xa1cb('0x23')],_0x15df39['id']),util[_0xa1cb('0x25')](parsedResult,{'showHidden':![],'depth':null}));return _0x4fe195(_0x37913e);});}else{return _0x4fe195(null,_0x385cf3);}},'beforeUpdate':function(_0x7acb64,_0x405c84,_0x1df505){if(_0x7acb64['changed'](_0xa1cb('0xd'))||_0x7acb64[_0xa1cb('0xe')](_0xa1cb('0xf'))||_0x7acb64['changed'](_0xa1cb('0x1b'))||_0x7acb64[_0xa1cb('0xe')](_0xa1cb('0x10'))||_0x7acb64[_0xa1cb('0xe')](_0xa1cb('0x11'))||_0x7acb64[_0xa1cb('0xe')]('host')){var _0x4fa2eb,_0x19be47;_0x4fa2eb=_0x7acb64[_0xa1cb('0xf')];var _0x4a31ca=_0x4fa2eb['slice'](-0x1);if(_0x4a31ca==='/'||_0x4a31ca==='\x5c'||_0x4a31ca===':'){_0x4fa2eb=_0x4fa2eb[_0xa1cb('0x13')](0x0,_0x4fa2eb[_0xa1cb('0x14')](_0x4a31ca));}switch(_0x7acb64[_0xa1cb('0xd')]){case'US':_0x19be47='https://accounts.zoho.com';break;case'AU':_0x19be47='https://accounts.zoho.com.au';break;case'IN':_0x19be47=_0xa1cb('0x15');break;case'CN':_0x19be47=_0xa1cb('0x16');break;default:_0x19be47=_0xa1cb('0x17');break;}var _0x5c759b={'method':'POST','uri':_0x19be47+'/oauth/v2/token','form':{'grant_type':_0xa1cb('0x1a'),'client_id':_0x7acb64['clientId'],'client_secret':_0x7acb64['clientSecret'],'redirect_uri':_0x7acb64[_0xa1cb('0xf')],'code':_0x7acb64[_0xa1cb('0x11')]},'headers':{'Content-Type':_0xa1cb('0x1c')}};return rp(_0x5c759b)[_0xa1cb('0x1d')](function(_0x5051e9){var _0x4aa71c=JSON[_0xa1cb('0x1e')](_0x5051e9);if(_0x4aa71c[_0xa1cb('0x1f')]){_0x7acb64[_0xa1cb('0x20')]=_0x4aa71c[_0xa1cb('0x1f')];logger[_0xa1cb('0x28')](util[_0xa1cb('0x21')]('ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d',_0x7acb64['name'],_0x7acb64['id']));}else{logger['error'](util[_0xa1cb('0x21')](_0xa1cb('0x27'),_0x7acb64['name'],_0x7acb64['id']),util[_0xa1cb('0x25')](_0x4aa71c,{'showHidden':![],'depth':null}));}return _0x1df505(null,_0x405c84);})[_0xa1cb('0x26')](function(_0xbc4519){logger[_0xa1cb('0x24')](util[_0xa1cb('0x21')](_0xa1cb('0x27'),_0x7acb64[_0xa1cb('0x23')],_0x7acb64['id']),util[_0xa1cb('0x25')](parsedResult,{'showHidden':![],'depth':null}));return _0x1df505(_0xbc4519);});}else{return _0x1df505(null,_0x405c84);}}}});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.rpc.js b/server/api/intZohoAccount/intZohoAccount.rpc.js index 15244bc..44293c5 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 _0x93e9=['../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ZohoAccount,\x20%s,\x20%s','request\x20sent','ZohoAccount,\x20%s,\x20%s,\x20%s','error','message','result','catch','GetZohoAccount','ZohoAccount','options','raw','where','limit','map','include','model','attributes','stringify','ShowZohoAccount','debug','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x60f353,_0xaa75e5){var _0x3e8003=function(_0x56bbcc){while(--_0x56bbcc){_0x60f353['push'](_0x60f353['shift']());}};_0x3e8003(++_0xaa75e5);}(_0x93e9,0xcc));var _0x993e=function(_0x5806f7,_0x415618){_0x5806f7=_0x5806f7-0x0;var _0x2ef419=_0x93e9[_0x5806f7];return _0x2ef419;};'use strict';var _=require(_0x993e('0x0'));var util=require(_0x993e('0x1'));var moment=require(_0x993e('0x2'));var BPromise=require(_0x993e('0x3'));var rs=require(_0x993e('0x4'));var fs=require('fs');var Redis=require(_0x993e('0x5'));var db=require(_0x993e('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x993e('0x7'));var config=require(_0x993e('0x8'));var jayson=require(_0x993e('0x9'));var client=jayson[_0x993e('0xa')][_0x993e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2366d9,_0x12ac94,_0x1aef74){return new BPromise(function(_0x53d0ce,_0x4701d3){return client[_0x993e('0xc')](_0x2366d9,_0x1aef74)[_0x993e('0xd')](function(_0x280291){logger[_0x993e('0xe')](_0x993e('0xf'),_0x12ac94,_0x993e('0x10'));logger['debug'](_0x993e('0x11'),_0x12ac94,_0x993e('0x10'),JSON['stringify'](_0x280291));if(_0x280291['error']){if(_0x280291[_0x993e('0x12')]['code']===0x1f4){logger[_0x993e('0x12')]('ZohoAccount,\x20%s,\x20%s',_0x12ac94,_0x280291['error'][_0x993e('0x13')]);return _0x4701d3(_0x280291[_0x993e('0x12')][_0x993e('0x13')]);}logger[_0x993e('0x12')](_0x993e('0xf'),_0x12ac94,_0x280291[_0x993e('0x12')][_0x993e('0x13')]);return _0x53d0ce(_0x280291[_0x993e('0x12')][_0x993e('0x13')]);}else{logger[_0x993e('0xe')](_0x993e('0xf'),_0x12ac94,_0x993e('0x10'));_0x53d0ce(_0x280291[_0x993e('0x14')][_0x993e('0x13')]);}})[_0x993e('0x15')](function(_0x454475){logger[_0x993e('0x12')]('ZohoAccount,\x20%s,\x20%s',_0x12ac94,_0x454475);_0x4701d3(_0x454475);});});}exports[_0x993e('0x16')]=function(_0x1acd21){var _0x3cc2b9=this;return new Promise(function(_0x3d6109,_0xfc2cbb){return db[_0x993e('0x17')]['findAll']({'raw':_0x1acd21[_0x993e('0x18')]?_0x1acd21[_0x993e('0x18')][_0x993e('0x19')]===undefined?!![]:![]:!![],'where':_0x1acd21[_0x993e('0x18')]?_0x1acd21[_0x993e('0x18')][_0x993e('0x1a')]||null:null,'attributes':_0x1acd21[_0x993e('0x18')]?_0x1acd21[_0x993e('0x18')]['attributes']||null:null,'limit':_0x1acd21[_0x993e('0x18')]?_0x1acd21['options'][_0x993e('0x1b')]||null:null,'include':_0x1acd21[_0x993e('0x18')]?_0x1acd21[_0x993e('0x18')]['include']?_[_0x993e('0x1c')](_0x1acd21[_0x993e('0x18')][_0x993e('0x1d')],function(_0x1c52fd){return{'model':db[_0x1c52fd[_0x993e('0x1e')]],'as':_0x1c52fd['as'],'attributes':_0x1c52fd[_0x993e('0x1f')],'include':_0x1c52fd[_0x993e('0x1d')]?_[_0x993e('0x1c')](_0x1c52fd[_0x993e('0x1d')],function(_0x18f6ac){return{'model':db[_0x18f6ac[_0x993e('0x1e')]],'as':_0x18f6ac['as'],'attributes':_0x18f6ac[_0x993e('0x1f')],'include':_0x18f6ac['include']?_[_0x993e('0x1c')](_0x18f6ac[_0x993e('0x1d')],function(_0x52b727){return{'model':db[_0x52b727[_0x993e('0x1e')]],'as':_0x52b727['as'],'attributes':_0x52b727['attributes']};}):[]};}):[]};}):[]:[]})[_0x993e('0xd')](function(_0xa03fbd){logger[_0x993e('0xe')](_0x993e('0x16'),_0x1acd21);logger['debug']('GetZohoAccount',_0x1acd21,JSON[_0x993e('0x20')](_0xa03fbd));_0x3d6109(_0xa03fbd);})[_0x993e('0x15')](function(_0x4a4f00){logger[_0x993e('0x12')](_0x993e('0x16'),_0x4a4f00[_0x993e('0x13')],_0x1acd21);_0xfc2cbb(_0x3cc2b9['error'](0x1f4,_0x4a4f00[_0x993e('0x13')]));});});};exports[_0x993e('0x21')]=function(_0x1f5d51){var _0x1fa8a5=this;return new Promise(function(_0x2599ec,_0x54da4e){return db[_0x993e('0x17')]['find']({'raw':_0x1f5d51[_0x993e('0x18')]?_0x1f5d51['options'][_0x993e('0x19')]===undefined?!![]:![]:!![],'where':_0x1f5d51['options']?_0x1f5d51[_0x993e('0x18')][_0x993e('0x1a')]||null:null,'attributes':_0x1f5d51[_0x993e('0x18')]?_0x1f5d51[_0x993e('0x18')][_0x993e('0x1f')]||null:null,'include':_0x1f5d51[_0x993e('0x18')]?_0x1f5d51['options'][_0x993e('0x1d')]?_['map'](_0x1f5d51['options'][_0x993e('0x1d')],function(_0x497d29){return{'model':db[_0x497d29[_0x993e('0x1e')]],'as':_0x497d29['as'],'attributes':_0x497d29[_0x993e('0x1f')],'include':_0x497d29[_0x993e('0x1d')]?_[_0x993e('0x1c')](_0x497d29[_0x993e('0x1d')],function(_0x339fb6){return{'model':db[_0x339fb6[_0x993e('0x1e')]],'as':_0x339fb6['as'],'attributes':_0x339fb6[_0x993e('0x1f')],'include':_0x339fb6[_0x993e('0x1d')]?_[_0x993e('0x1c')](_0x339fb6[_0x993e('0x1d')],function(_0x110504){return{'model':db[_0x110504[_0x993e('0x1e')]],'as':_0x110504['as'],'attributes':_0x110504[_0x993e('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x993e('0xd')](function(_0x5818c5){logger[_0x993e('0xe')](_0x993e('0x21'),_0x1f5d51);logger[_0x993e('0x22')](_0x993e('0x21'),_0x1f5d51,JSON[_0x993e('0x20')](_0x5818c5));_0x2599ec(_0x5818c5);})[_0x993e('0x15')](function(_0x1913c0){logger[_0x993e('0x12')](_0x993e('0x21'),_0x1913c0['message'],_0x1f5d51);_0x54da4e(_0x1fa8a5[_0x993e('0x12')](0x1f4,_0x1913c0['message']));});});}; \ No newline at end of file +var _0x4cb5=['../../config/environment','jayson/promise','http','request','then','info','ZohoAccount,\x20%s,\x20%s','ZohoAccount,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','GetZohoAccount','ZohoAccount','findAll','options','raw','limit','include','map','model','attributes','debug','find','where','ShowZohoAccount','stringify','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x192ab1,_0x473e41){var _0x1bdef3=function(_0x288263){while(--_0x288263){_0x192ab1['push'](_0x192ab1['shift']());}};_0x1bdef3(++_0x473e41);}(_0x4cb5,0x8f));var _0x54cb=function(_0x155d69,_0x11cdce){_0x155d69=_0x155d69-0x0;var _0x196976=_0x4cb5[_0x155d69];return _0x196976;};'use strict';var _=require(_0x54cb('0x0'));var util=require(_0x54cb('0x1'));var moment=require(_0x54cb('0x2'));var BPromise=require(_0x54cb('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x54cb('0x4'));var db=require(_0x54cb('0x5'))['db'];var utils=require(_0x54cb('0x6'));var logger=require(_0x54cb('0x7'))(_0x54cb('0x8'));var config=require(_0x54cb('0x9'));var jayson=require(_0x54cb('0xa'));var client=jayson['client'][_0x54cb('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2a3817,_0x5f4830,_0x3f2076){return new BPromise(function(_0x53cc33,_0x3c2861){return client[_0x54cb('0xc')](_0x2a3817,_0x3f2076)[_0x54cb('0xd')](function(_0x25596b){logger[_0x54cb('0xe')](_0x54cb('0xf'),_0x5f4830,'request\x20sent');logger['debug'](_0x54cb('0x10'),_0x5f4830,_0x54cb('0x11'),JSON['stringify'](_0x25596b));if(_0x25596b[_0x54cb('0x12')]){if(_0x25596b[_0x54cb('0x12')][_0x54cb('0x13')]===0x1f4){logger[_0x54cb('0x12')](_0x54cb('0xf'),_0x5f4830,_0x25596b[_0x54cb('0x12')]['message']);return _0x3c2861(_0x25596b[_0x54cb('0x12')][_0x54cb('0x14')]);}logger[_0x54cb('0x12')](_0x54cb('0xf'),_0x5f4830,_0x25596b[_0x54cb('0x12')][_0x54cb('0x14')]);return _0x53cc33(_0x25596b['error'][_0x54cb('0x14')]);}else{logger[_0x54cb('0xe')](_0x54cb('0xf'),_0x5f4830,_0x54cb('0x11'));_0x53cc33(_0x25596b[_0x54cb('0x15')]['message']);}})[_0x54cb('0x16')](function(_0x256cf7){logger[_0x54cb('0x12')](_0x54cb('0xf'),_0x5f4830,_0x256cf7);_0x3c2861(_0x256cf7);});});}exports[_0x54cb('0x17')]=function(_0x4b4bef){var _0x4d1d19=this;return new Promise(function(_0x238364,_0x3ed6dc){return db[_0x54cb('0x18')][_0x54cb('0x19')]({'raw':_0x4b4bef[_0x54cb('0x1a')]?_0x4b4bef[_0x54cb('0x1a')][_0x54cb('0x1b')]===undefined?!![]:![]:!![],'where':_0x4b4bef[_0x54cb('0x1a')]?_0x4b4bef['options']['where']||null:null,'attributes':_0x4b4bef[_0x54cb('0x1a')]?_0x4b4bef[_0x54cb('0x1a')]['attributes']||null:null,'limit':_0x4b4bef[_0x54cb('0x1a')]?_0x4b4bef[_0x54cb('0x1a')][_0x54cb('0x1c')]||null:null,'include':_0x4b4bef[_0x54cb('0x1a')]?_0x4b4bef[_0x54cb('0x1a')][_0x54cb('0x1d')]?_[_0x54cb('0x1e')](_0x4b4bef['options']['include'],function(_0x725a5){return{'model':db[_0x725a5[_0x54cb('0x1f')]],'as':_0x725a5['as'],'attributes':_0x725a5[_0x54cb('0x20')],'include':_0x725a5[_0x54cb('0x1d')]?_['map'](_0x725a5[_0x54cb('0x1d')],function(_0x397f5f){return{'model':db[_0x397f5f[_0x54cb('0x1f')]],'as':_0x397f5f['as'],'attributes':_0x397f5f[_0x54cb('0x20')],'include':_0x397f5f[_0x54cb('0x1d')]?_[_0x54cb('0x1e')](_0x397f5f['include'],function(_0x4d6746){return{'model':db[_0x4d6746['model']],'as':_0x4d6746['as'],'attributes':_0x4d6746[_0x54cb('0x20')]};}):[]};}):[]};}):[]:[]})[_0x54cb('0xd')](function(_0x39787c){logger[_0x54cb('0xe')]('GetZohoAccount',_0x4b4bef);logger[_0x54cb('0x21')](_0x54cb('0x17'),_0x4b4bef,JSON['stringify'](_0x39787c));_0x238364(_0x39787c);})[_0x54cb('0x16')](function(_0x3cd390){logger[_0x54cb('0x12')](_0x54cb('0x17'),_0x3cd390[_0x54cb('0x14')],_0x4b4bef);_0x3ed6dc(_0x4d1d19[_0x54cb('0x12')](0x1f4,_0x3cd390[_0x54cb('0x14')]));});});};exports['ShowZohoAccount']=function(_0x469952){var _0x3d8e60=this;return new Promise(function(_0x134f14,_0x589b6b){return db[_0x54cb('0x18')][_0x54cb('0x22')]({'raw':_0x469952[_0x54cb('0x1a')]?_0x469952[_0x54cb('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x469952['options']?_0x469952[_0x54cb('0x1a')][_0x54cb('0x23')]||null:null,'attributes':_0x469952['options']?_0x469952['options'][_0x54cb('0x20')]||null:null,'include':_0x469952[_0x54cb('0x1a')]?_0x469952[_0x54cb('0x1a')]['include']?_[_0x54cb('0x1e')](_0x469952['options'][_0x54cb('0x1d')],function(_0x41de8a){return{'model':db[_0x41de8a[_0x54cb('0x1f')]],'as':_0x41de8a['as'],'attributes':_0x41de8a[_0x54cb('0x20')],'include':_0x41de8a[_0x54cb('0x1d')]?_[_0x54cb('0x1e')](_0x41de8a['include'],function(_0x59c466){return{'model':db[_0x59c466[_0x54cb('0x1f')]],'as':_0x59c466['as'],'attributes':_0x59c466[_0x54cb('0x20')],'include':_0x59c466[_0x54cb('0x1d')]?_[_0x54cb('0x1e')](_0x59c466[_0x54cb('0x1d')],function(_0x1819f3){return{'model':db[_0x1819f3['model']],'as':_0x1819f3['as'],'attributes':_0x1819f3[_0x54cb('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1f3104){logger['info'](_0x54cb('0x24'),_0x469952);logger[_0x54cb('0x21')]('ShowZohoAccount',_0x469952,JSON[_0x54cb('0x25')](_0x1f3104));_0x134f14(_0x1f3104);})[_0x54cb('0x16')](function(_0x5e1bdf){logger[_0x54cb('0x12')]('ShowZohoAccount',_0x5e1bdf['message'],_0x469952);_0x589b6b(_0x3d8e60[_0x54cb('0x12')](0x1f4,_0x5e1bdf['message']));});});}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/index.js b/server/api/intZohoConfiguration/index.js index eb11c61..93b5bf5 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 _0xa852=['update','delete','destroy','exports','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','getDescriptions','post','create','put'];(function(_0x2b10c6,_0x185590){var _0x3789d2=function(_0x272987){while(--_0x272987){_0x2b10c6['push'](_0x2b10c6['shift']());}};_0x3789d2(++_0x185590);}(_0xa852,0xa0));var _0x2a85=function(_0x15d0d0,_0xa5250e){_0x15d0d0=_0x15d0d0-0x0;var _0x4e950f=_0xa852[_0x15d0d0];return _0x4e950f;};'use strict';var multer=require(_0x2a85('0x0'));var util=require(_0x2a85('0x1'));var path=require(_0x2a85('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x2a85('0x3')]();var fs_extra=require(_0x2a85('0x4'));var auth=require(_0x2a85('0x5'));var interaction=require(_0x2a85('0x6'));var config=require(_0x2a85('0x7'));var controller=require(_0x2a85('0x8'));router[_0x2a85('0x9')]('/',auth[_0x2a85('0xa')](),controller[_0x2a85('0xb')]);router[_0x2a85('0x9')](_0x2a85('0xc'),auth[_0x2a85('0xa')](),controller[_0x2a85('0xd')]);router['get'](_0x2a85('0xe'),auth[_0x2a85('0xa')](),controller[_0x2a85('0xf')]);router[_0x2a85('0x9')](_0x2a85('0x10'),auth[_0x2a85('0xa')](),controller[_0x2a85('0x11')]);router[_0x2a85('0x9')]('/:id/descriptions',auth[_0x2a85('0xa')](),controller[_0x2a85('0x12')]);router[_0x2a85('0x13')]('/',auth['isAuthenticated'](),controller[_0x2a85('0x14')]);router[_0x2a85('0x15')](_0x2a85('0xc'),auth[_0x2a85('0xa')](),controller[_0x2a85('0x16')]);router[_0x2a85('0x17')]('/:id',auth[_0x2a85('0xa')](),controller[_0x2a85('0x18')]);module[_0x2a85('0x19')]=router; \ No newline at end of file +var _0x5c2b=['update','delete','destroy','exports','util','express','../../components/auth/service','../../config/environment','./intZohoConfiguration.controller','get','isAuthenticated','index','show','getFields','/:id/subjects','getSubjects','/:id/descriptions','/:id'];(function(_0x430cdd,_0xb28769){var _0x4426a2=function(_0x54e3a6){while(--_0x54e3a6){_0x430cdd['push'](_0x430cdd['shift']());}};_0x4426a2(++_0xb28769);}(_0x5c2b,0x190));var _0xb5c2=function(_0x23baf1,_0x1ffe8e){_0x23baf1=_0x23baf1-0x0;var _0x3c2bac=_0x5c2b[_0x23baf1];return _0x3c2bac;};'use strict';var multer=require('multer');var util=require(_0xb5c2('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xb5c2('0x1'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xb5c2('0x2'));var interaction=require('../../components/interaction/service');var config=require(_0xb5c2('0x3'));var controller=require(_0xb5c2('0x4'));router[_0xb5c2('0x5')]('/',auth[_0xb5c2('0x6')](),controller[_0xb5c2('0x7')]);router['get']('/:id',auth[_0xb5c2('0x6')](),controller[_0xb5c2('0x8')]);router[_0xb5c2('0x5')]('/:id/fields',auth[_0xb5c2('0x6')](),controller[_0xb5c2('0x9')]);router['get'](_0xb5c2('0xa'),auth[_0xb5c2('0x6')](),controller[_0xb5c2('0xb')]);router['get'](_0xb5c2('0xc'),auth[_0xb5c2('0x6')](),controller['getDescriptions']);router['post']('/',auth[_0xb5c2('0x6')](),controller['create']);router['put'](_0xb5c2('0xd'),auth[_0xb5c2('0x6')](),controller[_0xb5c2('0xe')]);router[_0xb5c2('0xf')](_0xb5c2('0xd'),auth[_0xb5c2('0x6')](),controller[_0xb5c2('0x10')]);module[_0xb5c2('0x11')]=router; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js b/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js index 865b34b..6b32ed2 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 _0xa493=['lead','nothing','contact_lead','contact','sequelize','exports','STRING','ENUM'];(function(_0x303862,_0x20b5ab){var _0xe6f228=function(_0x41fc5a){while(--_0x41fc5a){_0x303862['push'](_0x303862['shift']());}};_0xe6f228(++_0x20b5ab);}(_0xa493,0x1ec));var _0x3a49=function(_0x819464,_0x46fc91){_0x819464=_0x819464-0x0;var _0x49dcc0=_0xa493[_0x819464];return _0x49dcc0;};'use strict';var Sequelize=require(_0x3a49('0x0'));module[_0x3a49('0x1')]={'name':{'type':Sequelize[_0x3a49('0x2')]},'moduleCreate':{'type':Sequelize[_0x3a49('0x3')](_0x3a49('0x4'),'contact',_0x3a49('0x5')),'defaultValue':'lead'},'moduleSearch':{'type':Sequelize[_0x3a49('0x3')](_0x3a49('0x6'),_0x3a49('0x7'),_0x3a49('0x4')),'defaultValue':_0x3a49('0x6')},'description':{'type':Sequelize[_0x3a49('0x2')]}}; \ No newline at end of file +var _0xfa6f=['nothing','ENUM','contact_lead','sequelize','exports','STRING','lead','contact'];(function(_0x5bd0e2,_0x3bbb30){var _0x124e3f=function(_0x5ffcef){while(--_0x5ffcef){_0x5bd0e2['push'](_0x5bd0e2['shift']());}};_0x124e3f(++_0x3bbb30);}(_0xfa6f,0xdb));var _0xffa6=function(_0x138f59,_0x1b53fb){_0x138f59=_0x138f59-0x0;var _0x3d114d=_0xfa6f[_0x138f59];return _0x3d114d;};'use strict';var Sequelize=require(_0xffa6('0x0'));module[_0xffa6('0x1')]={'name':{'type':Sequelize[_0xffa6('0x2')]},'moduleCreate':{'type':Sequelize['ENUM'](_0xffa6('0x3'),_0xffa6('0x4'),_0xffa6('0x5')),'defaultValue':_0xffa6('0x3')},'moduleSearch':{'type':Sequelize[_0xffa6('0x6')](_0xffa6('0x7'),'contact',_0xffa6('0x3')),'defaultValue':_0xffa6('0x7')},'description':{'type':Sequelize[_0xffa6('0x2')]}}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.controller.js b/server/api/intZohoConfiguration/intZohoConfiguration.controller.js index b75c75b..1f608fa 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 _0x5423=['hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','filter','options','ZohoConfiguration','includeAll','include','findAll','catch','params','keys','create','body','find','findOne','pick','getFields','getSubjects','getDescriptions','eml-format','zip-dir','fast-json-patch','moment','mustache','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','update','then','destroy','end','stack','name','send','index','map','rawAttributes','fieldName','type','model','query','filters','intersection','attributes','fields','length'];(function(_0x440d4c,_0x5ea9e1){var _0x21fba9=function(_0x13d8ce){while(--_0x13d8ce){_0x440d4c['push'](_0x440d4c['shift']());}};_0x21fba9(++_0x5ea9e1);}(_0x5423,0x65));var _0x3542=function(_0x45e2d2,_0x381ec8){_0x45e2d2=_0x45e2d2-0x0;var _0x4db2b7=_0x5423[_0x45e2d2];return _0x4db2b7;};'use strict';var emlformat=require(_0x3542('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x3542('0x1'));var jsonpatch=require(_0x3542('0x2'));var rp=require('request-promise');var moment=require(_0x3542('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x3542('0x4'));var util=require('util');var path=require(_0x3542('0x5'));var sox=require('sox');var csv=require(_0x3542('0x6'));var ejs=require(_0x3542('0x7'));var fs=require('fs');var fs_extra=require(_0x3542('0x8'));var _=require(_0x3542('0x9'));var squel=require(_0x3542('0xa'));var crypto=require(_0x3542('0xb'));var jsforce=require(_0x3542('0xc'));var deskjs=require(_0x3542('0xd'));var toCsv=require(_0x3542('0x6'));var querystring=require(_0x3542('0xe'));var Papa=require('papaparse');var Redis=require(_0x3542('0xf'));var authService=require(_0x3542('0x10'));var qs=require(_0x3542('0x11'));var as=require(_0x3542('0x12'));var hardwareService=require(_0x3542('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0x3542('0x14'));var config=require(_0x3542('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x3542('0x16'))['db'];function respondWithStatusCode(_0x43c64d,_0x5365fa){_0x5365fa=_0x5365fa||0xcc;return function(_0x159333){if(_0x159333){return _0x43c64d[_0x3542('0x17')](_0x5365fa);}return _0x43c64d['status'](_0x5365fa)['end']();};}function respondWithResult(_0xe547bf,_0x5af221){_0x5af221=_0x5af221||0xc8;return function(_0xd12f38){if(_0xd12f38){return _0xe547bf[_0x3542('0x18')](_0x5af221)[_0x3542('0x19')](_0xd12f38);}};}function respondWithFilteredResult(_0x31d0b1,_0x535da8){return function(_0x2f8861){if(_0x2f8861){var _0x34fa5b=typeof _0x535da8[_0x3542('0x1a')]==='undefined'&&typeof _0x535da8[_0x3542('0x1b')]===_0x3542('0x1c');var _0x4dbc55=_0x2f8861[_0x3542('0x1d')];var _0x2fa672=_0x34fa5b?0x0:_0x535da8[_0x3542('0x1a')];var _0x173c8e=_0x34fa5b?_0x2f8861['count']:_0x535da8[_0x3542('0x1a')]+_0x535da8['limit'];var _0x37dadc;if(_0x173c8e>=_0x4dbc55){_0x173c8e=_0x4dbc55;_0x37dadc=0xc8;}else{_0x37dadc=0xce;}_0x31d0b1['status'](_0x37dadc);return _0x31d0b1[_0x3542('0x1e')](_0x3542('0x1f'),_0x2fa672+'-'+_0x173c8e+'/'+_0x4dbc55)['json'](_0x2f8861);}return null;};}function patchUpdates(_0x5c47c4){return function(_0x48e296){try{jsonpatch[_0x3542('0x20')](_0x48e296,_0x5c47c4,!![]);}catch(_0x586d91){return BPromise[_0x3542('0x21')](_0x586d91);}return _0x48e296['save']();};}function saveUpdates(_0x2a1709,_0x43944d){return function(_0x2aa9b2){if(_0x2aa9b2){return _0x2aa9b2[_0x3542('0x22')](_0x2a1709)[_0x3542('0x23')](function(_0x5939f8){return _0x5939f8;});}return null;};}function removeEntity(_0x4b5151,_0x4699c3){return function(_0x427a66){if(_0x427a66){return _0x427a66[_0x3542('0x24')]()[_0x3542('0x23')](function(){_0x4b5151[_0x3542('0x18')](0xcc)[_0x3542('0x25')]();});}};}function handleEntityNotFound(_0x46143f,_0xe04365){return function(_0x2e413){if(!_0x2e413){_0x46143f[_0x3542('0x17')](0x194);}return _0x2e413;};}function handleError(_0x2c35c6,_0x240b9f){_0x240b9f=_0x240b9f||0x1f4;return function(_0x32e769){logger['error'](_0x32e769[_0x3542('0x26')]);if(_0x32e769['name']){delete _0x32e769[_0x3542('0x27')];}_0x2c35c6[_0x3542('0x18')](_0x240b9f)[_0x3542('0x28')](_0x32e769);};}exports[_0x3542('0x29')]=function(_0x5d447b,_0x414c08){var _0x14fd01={},_0x5e5de1={},_0x447cf7={'count':0x0,'rows':[]};var _0x575ce8=_[_0x3542('0x2a')](db['ZohoConfiguration'][_0x3542('0x2b')],function(_0xaa71b7){return{'name':_0xaa71b7[_0x3542('0x2c')],'type':_0xaa71b7[_0x3542('0x2d')]['key']};});_0x5e5de1[_0x3542('0x2e')]=_[_0x3542('0x2a')](_0x575ce8,'name');_0x5e5de1[_0x3542('0x2f')]=_['keys'](_0x5d447b[_0x3542('0x2f')]);_0x5e5de1[_0x3542('0x30')]=_[_0x3542('0x31')](_0x5e5de1[_0x3542('0x2e')],_0x5e5de1['query']);_0x14fd01[_0x3542('0x32')]=_[_0x3542('0x31')](_0x5e5de1[_0x3542('0x2e')],qs[_0x3542('0x33')](_0x5d447b[_0x3542('0x2f')][_0x3542('0x33')]));_0x14fd01[_0x3542('0x32')]=_0x14fd01[_0x3542('0x32')][_0x3542('0x34')]?_0x14fd01['attributes']:_0x5e5de1['model'];if(!_0x5d447b[_0x3542('0x2f')][_0x3542('0x35')](_0x3542('0x36'))){_0x14fd01[_0x3542('0x1b')]=qs[_0x3542('0x1b')](_0x5d447b[_0x3542('0x2f')][_0x3542('0x1b')]);_0x14fd01[_0x3542('0x1a')]=qs[_0x3542('0x1a')](_0x5d447b[_0x3542('0x2f')]['offset']);}_0x14fd01[_0x3542('0x37')]=qs[_0x3542('0x38')](_0x5d447b[_0x3542('0x2f')][_0x3542('0x38')]);_0x14fd01['where']=qs['filters'](_['pick'](_0x5d447b['query'],_0x5e5de1[_0x3542('0x30')]),_0x575ce8);if(_0x5d447b[_0x3542('0x2f')]['filter']){_0x14fd01[_0x3542('0x39')]=_[_0x3542('0x3a')](_0x14fd01[_0x3542('0x39')],{'$or':_[_0x3542('0x2a')](_0x575ce8,function(_0x3c1e09){if(_0x3c1e09[_0x3542('0x2d')]!==_0x3542('0x3b')){var _0x933539={};_0x933539[_0x3c1e09['name']]={'$like':'%'+_0x5d447b['query'][_0x3542('0x3c')]+'%'};return _0x933539;}})});}_0x14fd01=_[_0x3542('0x3a')]({},_0x14fd01,_0x5d447b[_0x3542('0x3d')]);var _0x56b7a1={'where':_0x14fd01[_0x3542('0x39')]};return db[_0x3542('0x3e')][_0x3542('0x1d')](_0x56b7a1)[_0x3542('0x23')](function(_0x2b02a5){_0x447cf7[_0x3542('0x1d')]=_0x2b02a5;if(_0x5d447b[_0x3542('0x2f')][_0x3542('0x3f')]){_0x14fd01[_0x3542('0x40')]=[{'all':!![]}];}return db[_0x3542('0x3e')][_0x3542('0x41')](_0x14fd01);})[_0x3542('0x23')](function(_0x4d6dbf){_0x447cf7['rows']=_0x4d6dbf;return _0x447cf7;})['then'](respondWithFilteredResult(_0x414c08,_0x14fd01))[_0x3542('0x42')](handleError(_0x414c08,null));};exports['show']=function(_0x2fa88e,_0x2f5563){var _0x16fe0f={'raw':![],'where':{'id':_0x2fa88e[_0x3542('0x43')]['id']}},_0x59c892={};_0x59c892[_0x3542('0x2e')]=_[_0x3542('0x44')](db[_0x3542('0x3e')]['rawAttributes']);_0x59c892[_0x3542('0x2f')]=_[_0x3542('0x44')](_0x2fa88e[_0x3542('0x2f')]);_0x59c892['filters']=_[_0x3542('0x31')](_0x59c892[_0x3542('0x2e')],_0x59c892[_0x3542('0x2f')]);_0x16fe0f[_0x3542('0x32')]=_[_0x3542('0x31')](_0x59c892[_0x3542('0x2e')],qs[_0x3542('0x33')](_0x2fa88e['query'][_0x3542('0x33')]));_0x16fe0f[_0x3542('0x32')]=_0x16fe0f[_0x3542('0x32')]['length']?_0x16fe0f['attributes']:_0x59c892[_0x3542('0x2e')];if(_0x2fa88e[_0x3542('0x2f')][_0x3542('0x3f')]){_0x16fe0f['include']=[{'all':!![]}];}_0x16fe0f=_['merge']({},_0x16fe0f,_0x2fa88e[_0x3542('0x3d')]);return db[_0x3542('0x3e')]['find'](_0x16fe0f)[_0x3542('0x23')](handleEntityNotFound(_0x2f5563,null))[_0x3542('0x23')](respondWithResult(_0x2f5563,null))[_0x3542('0x42')](handleError(_0x2f5563,null));};exports[_0x3542('0x45')]=function(_0x3a6a65,_0x2bc9f5){return db['ZohoConfiguration']['create'](_0x3a6a65[_0x3542('0x46')],{})[_0x3542('0x23')](respondWithResult(_0x2bc9f5,0xc9))[_0x3542('0x42')](handleError(_0x2bc9f5,null));};exports['update']=function(_0x5c42eb,_0x11a88c){if(_0x5c42eb[_0x3542('0x46')]['id']){delete _0x5c42eb[_0x3542('0x46')]['id'];}return db[_0x3542('0x3e')][_0x3542('0x47')]({'where':{'id':_0x5c42eb[_0x3542('0x43')]['id']}})[_0x3542('0x23')](handleEntityNotFound(_0x11a88c,null))['then'](saveUpdates(_0x5c42eb['body'],null))[_0x3542('0x23')](respondWithResult(_0x11a88c,null))[_0x3542('0x42')](handleError(_0x11a88c,null));};exports[_0x3542('0x24')]=function(_0x25f318,_0x243e5f){return db['ZohoConfiguration'][_0x3542('0x47')]({'where':{'id':_0x25f318[_0x3542('0x43')]['id']}})[_0x3542('0x23')](handleEntityNotFound(_0x243e5f,null))[_0x3542('0x23')](removeEntity(_0x243e5f,null))[_0x3542('0x42')](handleError(_0x243e5f,null));};exports['getFields']=function(_0x5e044d,_0x58dc37,_0x401c2f){var _0x1203bb={};var _0x191044={};var _0x31b27a;var _0x782029;return db[_0x3542('0x3e')][_0x3542('0x48')]({'where':{'id':_0x5e044d[_0x3542('0x43')]['id']}})[_0x3542('0x23')](handleEntityNotFound(_0x58dc37,null))[_0x3542('0x23')](function(_0x4d6736){if(_0x4d6736){_0x31b27a=_0x4d6736;_0x191044['model']=_['keys'](db['ZohoField']['rawAttributes']);_0x191044[_0x3542('0x2f')]=_[_0x3542('0x44')](_0x5e044d[_0x3542('0x2f')]);_0x191044[_0x3542('0x30')]=_[_0x3542('0x31')](_0x191044[_0x3542('0x2e')],_0x191044[_0x3542('0x2f')]);_0x1203bb[_0x3542('0x32')]=_[_0x3542('0x31')](_0x191044[_0x3542('0x2e')],qs[_0x3542('0x33')](_0x5e044d[_0x3542('0x2f')][_0x3542('0x33')]));_0x1203bb[_0x3542('0x32')]=_0x1203bb[_0x3542('0x32')]['length']?_0x1203bb[_0x3542('0x32')]:_0x191044[_0x3542('0x2e')];_0x1203bb[_0x3542('0x37')]=qs[_0x3542('0x38')](_0x5e044d['query'][_0x3542('0x38')]);_0x1203bb['where']=qs[_0x3542('0x30')](_[_0x3542('0x49')](_0x5e044d['query'],_0x191044[_0x3542('0x30')]));if(_0x5e044d[_0x3542('0x2f')][_0x3542('0x3c')]){_0x1203bb[_0x3542('0x39')]=_[_0x3542('0x3a')](_0x1203bb[_0x3542('0x39')],{'$or':_[_0x3542('0x2a')](_0x1203bb['attributes'],function(_0x211408){var _0x2e7e23={};_0x2e7e23[_0x211408]={'$like':'%'+_0x5e044d[_0x3542('0x2f')][_0x3542('0x3c')]+'%'};return _0x2e7e23;})});}_0x1203bb=_[_0x3542('0x3a')]({},_0x1203bb,_0x5e044d[_0x3542('0x3d')]);return _0x31b27a[_0x3542('0x4a')](_0x1203bb);}})['then'](function(_0x505d2b){if(_0x505d2b){_0x782029=_0x505d2b[_0x3542('0x34')];if(!_0x5e044d['query'][_0x3542('0x35')](_0x3542('0x36'))){_0x1203bb[_0x3542('0x1b')]=qs[_0x3542('0x1b')](_0x5e044d[_0x3542('0x2f')][_0x3542('0x1b')]);_0x1203bb[_0x3542('0x1a')]=qs['offset'](_0x5e044d[_0x3542('0x2f')][_0x3542('0x1a')]);}return _0x31b27a[_0x3542('0x4a')](_0x1203bb);}})['then'](function(_0x587429){if(_0x587429){return _0x587429?{'count':_0x782029,'rows':_0x587429}:null;}})['then'](respondWithResult(_0x58dc37,null))['catch'](handleError(_0x58dc37,null));};exports[_0x3542('0x4b')]=function(_0xb5c365,_0x484299,_0x16139b){var _0x4d757f={};var _0x4032c7={};var _0x9c6ed8;var _0x2948b4;return db[_0x3542('0x3e')]['findOne']({'where':{'id':_0xb5c365[_0x3542('0x43')]['id']}})['then'](handleEntityNotFound(_0x484299,null))['then'](function(_0x4cbed1){if(_0x4cbed1){_0x9c6ed8=_0x4cbed1;_0x4032c7[_0x3542('0x2e')]=_[_0x3542('0x44')](db['ZohoField']['rawAttributes']);_0x4032c7[_0x3542('0x2f')]=_[_0x3542('0x44')](_0xb5c365[_0x3542('0x2f')]);_0x4032c7[_0x3542('0x30')]=_['intersection'](_0x4032c7[_0x3542('0x2e')],_0x4032c7[_0x3542('0x2f')]);_0x4d757f[_0x3542('0x32')]=_[_0x3542('0x31')](_0x4032c7[_0x3542('0x2e')],qs[_0x3542('0x33')](_0xb5c365[_0x3542('0x2f')][_0x3542('0x33')]));_0x4d757f[_0x3542('0x32')]=_0x4d757f['attributes'][_0x3542('0x34')]?_0x4d757f[_0x3542('0x32')]:_0x4032c7[_0x3542('0x2e')];_0x4d757f[_0x3542('0x37')]=qs[_0x3542('0x38')](_0xb5c365['query'][_0x3542('0x38')]);_0x4d757f[_0x3542('0x39')]=qs[_0x3542('0x30')](_[_0x3542('0x49')](_0xb5c365[_0x3542('0x2f')],_0x4032c7[_0x3542('0x30')]));if(_0xb5c365[_0x3542('0x2f')][_0x3542('0x3c')]){_0x4d757f['where']=_[_0x3542('0x3a')](_0x4d757f[_0x3542('0x39')],{'$or':_[_0x3542('0x2a')](_0x4d757f[_0x3542('0x32')],function(_0x4bcd18){var _0x2b0a14={};_0x2b0a14[_0x4bcd18]={'$like':'%'+_0xb5c365[_0x3542('0x2f')]['filter']+'%'};return _0x2b0a14;})});}_0x4d757f=_[_0x3542('0x3a')]({},_0x4d757f,_0xb5c365[_0x3542('0x3d')]);return _0x9c6ed8['getSubjects'](_0x4d757f);}})[_0x3542('0x23')](function(_0x563a59){if(_0x563a59){_0x2948b4=_0x563a59[_0x3542('0x34')];if(!_0xb5c365['query']['hasOwnProperty'](_0x3542('0x36'))){_0x4d757f[_0x3542('0x1b')]=qs[_0x3542('0x1b')](_0xb5c365['query'][_0x3542('0x1b')]);_0x4d757f[_0x3542('0x1a')]=qs[_0x3542('0x1a')](_0xb5c365['query']['offset']);}return _0x9c6ed8['getSubjects'](_0x4d757f);}})[_0x3542('0x23')](function(_0x733304){if(_0x733304){return _0x733304?{'count':_0x2948b4,'rows':_0x733304}:null;}})[_0x3542('0x23')](respondWithResult(_0x484299,null))[_0x3542('0x42')](handleError(_0x484299,null));};exports[_0x3542('0x4c')]=function(_0x181085,_0x3fe697,_0x3eccb4){var _0x360ec7={};var _0x4b075c={};var _0x4ad8f0;var _0x33821e;return db[_0x3542('0x3e')][_0x3542('0x48')]({'where':{'id':_0x181085[_0x3542('0x43')]['id']}})[_0x3542('0x23')](handleEntityNotFound(_0x3fe697,null))[_0x3542('0x23')](function(_0x253596){if(_0x253596){_0x4ad8f0=_0x253596;_0x4b075c[_0x3542('0x2e')]=_[_0x3542('0x44')](db['ZohoField']['rawAttributes']);_0x4b075c['query']=_['keys'](_0x181085[_0x3542('0x2f')]);_0x4b075c[_0x3542('0x30')]=_['intersection'](_0x4b075c[_0x3542('0x2e')],_0x4b075c[_0x3542('0x2f')]);_0x360ec7[_0x3542('0x32')]=_[_0x3542('0x31')](_0x4b075c[_0x3542('0x2e')],qs[_0x3542('0x33')](_0x181085['query'][_0x3542('0x33')]));_0x360ec7[_0x3542('0x32')]=_0x360ec7['attributes']['length']?_0x360ec7['attributes']:_0x4b075c[_0x3542('0x2e')];_0x360ec7[_0x3542('0x37')]=qs['sort'](_0x181085[_0x3542('0x2f')][_0x3542('0x38')]);_0x360ec7[_0x3542('0x39')]=qs['filters'](_[_0x3542('0x49')](_0x181085[_0x3542('0x2f')],_0x4b075c[_0x3542('0x30')]));if(_0x181085[_0x3542('0x2f')][_0x3542('0x3c')]){_0x360ec7[_0x3542('0x39')]=_[_0x3542('0x3a')](_0x360ec7[_0x3542('0x39')],{'$or':_[_0x3542('0x2a')](_0x360ec7['attributes'],function(_0x2e081a){var _0x29c2f4={};_0x29c2f4[_0x2e081a]={'$like':'%'+_0x181085[_0x3542('0x2f')][_0x3542('0x3c')]+'%'};return _0x29c2f4;})});}_0x360ec7=_[_0x3542('0x3a')]({},_0x360ec7,_0x181085[_0x3542('0x3d')]);return _0x4ad8f0['getDescriptions'](_0x360ec7);}})[_0x3542('0x23')](function(_0x4e3e4e){if(_0x4e3e4e){_0x33821e=_0x4e3e4e['length'];if(!_0x181085[_0x3542('0x2f')][_0x3542('0x35')](_0x3542('0x36'))){_0x360ec7['limit']=qs[_0x3542('0x1b')](_0x181085[_0x3542('0x2f')]['limit']);_0x360ec7['offset']=qs[_0x3542('0x1a')](_0x181085[_0x3542('0x2f')][_0x3542('0x1a')]);}return _0x4ad8f0['getDescriptions'](_0x360ec7);}})['then'](function(_0x17a57){if(_0x17a57){return _0x17a57?{'count':_0x33821e,'rows':_0x17a57}:null;}})[_0x3542('0x23')](respondWithResult(_0x3fe697,null))[_0x3542('0x42')](handleError(_0x3fe697,null));}; \ No newline at end of file +var _0x5c7f=['../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','count','limit','set','Content-Range','json','apply','reject','save','update','then','destroy','end','error','name','send','index','map','ZohoConfiguration','rawAttributes','fieldName','type','key','query','keys','model','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','catch','includeAll','create','body','find','params','getFields','ZohoField','filters','length','getSubjects','findOne','getDescriptions','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils'];(function(_0x16fd49,_0x36cd81){var _0x4bd936=function(_0x5a9812){while(--_0x5a9812){_0x16fd49['push'](_0x16fd49['shift']());}};_0x4bd936(++_0x36cd81);}(_0x5c7f,0x8f));var _0xf5c7=function(_0x4ae6ef,_0xc2af80){_0x4ae6ef=_0x4ae6ef-0x0;var _0x3cbb4e=_0x5c7f[_0x4ae6ef];return _0x3cbb4e;};'use strict';var emlformat=require(_0xf5c7('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf5c7('0x1'));var jsonpatch=require(_0xf5c7('0x2'));var rp=require(_0xf5c7('0x3'));var moment=require(_0xf5c7('0x4'));var BPromise=require(_0xf5c7('0x5'));var Mustache=require(_0xf5c7('0x6'));var util=require(_0xf5c7('0x7'));var path=require(_0xf5c7('0x8'));var sox=require(_0xf5c7('0x9'));var csv=require(_0xf5c7('0xa'));var ejs=require(_0xf5c7('0xb'));var fs=require('fs');var fs_extra=require(_0xf5c7('0xc'));var _=require(_0xf5c7('0xd'));var squel=require(_0xf5c7('0xe'));var crypto=require(_0xf5c7('0xf'));var jsforce=require(_0xf5c7('0x10'));var deskjs=require(_0xf5c7('0x11'));var toCsv=require(_0xf5c7('0xa'));var querystring=require(_0xf5c7('0x12'));var Papa=require(_0xf5c7('0x13'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xf5c7('0x14'));var as=require(_0xf5c7('0x15'));var hardwareService=require(_0xf5c7('0x16'));var logger=require(_0xf5c7('0x17'))('api');var utils=require(_0xf5c7('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0xf5c7('0x19'));var db=require(_0xf5c7('0x1a'))['db'];function respondWithStatusCode(_0xe14df8,_0x3c92f3){_0x3c92f3=_0x3c92f3||0xcc;return function(_0x597a0c){if(_0x597a0c){return _0xe14df8[_0xf5c7('0x1b')](_0x3c92f3);}return _0xe14df8[_0xf5c7('0x1c')](_0x3c92f3)['end']();};}function respondWithResult(_0xa58151,_0x2b7eb1){_0x2b7eb1=_0x2b7eb1||0xc8;return function(_0x53d049){if(_0x53d049){return _0xa58151[_0xf5c7('0x1c')](_0x2b7eb1)['json'](_0x53d049);}};}function respondWithFilteredResult(_0x583b2e,_0x809c38){return function(_0x3312af){if(_0x3312af){var _0x120de1=typeof _0x809c38[_0xf5c7('0x1d')]===_0xf5c7('0x1e')&&typeof _0x809c38['limit']===_0xf5c7('0x1e');var _0x2159c5=_0x3312af[_0xf5c7('0x1f')];var _0xaae03f=_0x120de1?0x0:_0x809c38['offset'];var _0x55860f=_0x120de1?_0x3312af['count']:_0x809c38[_0xf5c7('0x1d')]+_0x809c38[_0xf5c7('0x20')];var _0x3d38d4;if(_0x55860f>=_0x2159c5){_0x55860f=_0x2159c5;_0x3d38d4=0xc8;}else{_0x3d38d4=0xce;}_0x583b2e['status'](_0x3d38d4);return _0x583b2e[_0xf5c7('0x21')](_0xf5c7('0x22'),_0xaae03f+'-'+_0x55860f+'/'+_0x2159c5)[_0xf5c7('0x23')](_0x3312af);}return null;};}function patchUpdates(_0x566d4f){return function(_0x5f3e1e){try{jsonpatch[_0xf5c7('0x24')](_0x5f3e1e,_0x566d4f,!![]);}catch(_0x437d05){return BPromise[_0xf5c7('0x25')](_0x437d05);}return _0x5f3e1e[_0xf5c7('0x26')]();};}function saveUpdates(_0xa0a777,_0x2c3795){return function(_0x2666c9){if(_0x2666c9){return _0x2666c9[_0xf5c7('0x27')](_0xa0a777)[_0xf5c7('0x28')](function(_0x430823){return _0x430823;});}return null;};}function removeEntity(_0x5dcef2,_0x4be5d5){return function(_0x20644){if(_0x20644){return _0x20644[_0xf5c7('0x29')]()[_0xf5c7('0x28')](function(){_0x5dcef2[_0xf5c7('0x1c')](0xcc)[_0xf5c7('0x2a')]();});}};}function handleEntityNotFound(_0x275c31,_0x2f5625){return function(_0x44e33c){if(!_0x44e33c){_0x275c31[_0xf5c7('0x1b')](0x194);}return _0x44e33c;};}function handleError(_0x2ad61f,_0x370adb){_0x370adb=_0x370adb||0x1f4;return function(_0x136f69){logger[_0xf5c7('0x2b')](_0x136f69['stack']);if(_0x136f69[_0xf5c7('0x2c')]){delete _0x136f69[_0xf5c7('0x2c')];}_0x2ad61f[_0xf5c7('0x1c')](_0x370adb)[_0xf5c7('0x2d')](_0x136f69);};}exports[_0xf5c7('0x2e')]=function(_0x43b690,_0x109728){var _0x592dbf={},_0x50013b={},_0x587288={'count':0x0,'rows':[]};var _0x362c08=_[_0xf5c7('0x2f')](db[_0xf5c7('0x30')][_0xf5c7('0x31')],function(_0x8eff88){return{'name':_0x8eff88[_0xf5c7('0x32')],'type':_0x8eff88[_0xf5c7('0x33')][_0xf5c7('0x34')]};});_0x50013b['model']=_[_0xf5c7('0x2f')](_0x362c08,'name');_0x50013b[_0xf5c7('0x35')]=_[_0xf5c7('0x36')](_0x43b690['query']);_0x50013b['filters']=_['intersection'](_0x50013b[_0xf5c7('0x37')],_0x50013b['query']);_0x592dbf[_0xf5c7('0x38')]=_[_0xf5c7('0x39')](_0x50013b[_0xf5c7('0x37')],qs[_0xf5c7('0x3a')](_0x43b690['query'][_0xf5c7('0x3a')]));_0x592dbf['attributes']=_0x592dbf[_0xf5c7('0x38')]['length']?_0x592dbf[_0xf5c7('0x38')]:_0x50013b[_0xf5c7('0x37')];if(!_0x43b690['query'][_0xf5c7('0x3b')](_0xf5c7('0x3c'))){_0x592dbf['limit']=qs[_0xf5c7('0x20')](_0x43b690[_0xf5c7('0x35')]['limit']);_0x592dbf['offset']=qs[_0xf5c7('0x1d')](_0x43b690[_0xf5c7('0x35')]['offset']);}_0x592dbf[_0xf5c7('0x3d')]=qs[_0xf5c7('0x3e')](_0x43b690['query'][_0xf5c7('0x3e')]);_0x592dbf[_0xf5c7('0x3f')]=qs['filters'](_[_0xf5c7('0x40')](_0x43b690['query'],_0x50013b['filters']),_0x362c08);if(_0x43b690[_0xf5c7('0x35')][_0xf5c7('0x41')]){_0x592dbf['where']=_[_0xf5c7('0x42')](_0x592dbf[_0xf5c7('0x3f')],{'$or':_[_0xf5c7('0x2f')](_0x362c08,function(_0x181727){if(_0x181727[_0xf5c7('0x33')]!==_0xf5c7('0x43')){var _0x5dd9bd={};_0x5dd9bd[_0x181727[_0xf5c7('0x2c')]]={'$like':'%'+_0x43b690['query'][_0xf5c7('0x41')]+'%'};return _0x5dd9bd;}})});}_0x592dbf=_[_0xf5c7('0x42')]({},_0x592dbf,_0x43b690[_0xf5c7('0x44')]);var _0x21b0a1={'where':_0x592dbf[_0xf5c7('0x3f')]};return db[_0xf5c7('0x30')][_0xf5c7('0x1f')](_0x21b0a1)['then'](function(_0x2f000d){_0x587288['count']=_0x2f000d;if(_0x43b690[_0xf5c7('0x35')]['includeAll']){_0x592dbf[_0xf5c7('0x45')]=[{'all':!![]}];}return db[_0xf5c7('0x30')][_0xf5c7('0x46')](_0x592dbf);})[_0xf5c7('0x28')](function(_0x53406e){_0x587288['rows']=_0x53406e;return _0x587288;})[_0xf5c7('0x28')](respondWithFilteredResult(_0x109728,_0x592dbf))[_0xf5c7('0x47')](handleError(_0x109728,null));};exports['show']=function(_0x857f9b,_0x2d6bcd){var _0x6597fc={'raw':![],'where':{'id':_0x857f9b['params']['id']}},_0x1462c3={};_0x1462c3[_0xf5c7('0x37')]=_['keys'](db['ZohoConfiguration'][_0xf5c7('0x31')]);_0x1462c3[_0xf5c7('0x35')]=_[_0xf5c7('0x36')](_0x857f9b[_0xf5c7('0x35')]);_0x1462c3['filters']=_[_0xf5c7('0x39')](_0x1462c3[_0xf5c7('0x37')],_0x1462c3[_0xf5c7('0x35')]);_0x6597fc[_0xf5c7('0x38')]=_[_0xf5c7('0x39')](_0x1462c3[_0xf5c7('0x37')],qs[_0xf5c7('0x3a')](_0x857f9b['query']['fields']));_0x6597fc[_0xf5c7('0x38')]=_0x6597fc[_0xf5c7('0x38')]['length']?_0x6597fc['attributes']:_0x1462c3[_0xf5c7('0x37')];if(_0x857f9b[_0xf5c7('0x35')][_0xf5c7('0x48')]){_0x6597fc['include']=[{'all':!![]}];}_0x6597fc=_[_0xf5c7('0x42')]({},_0x6597fc,_0x857f9b['options']);return db[_0xf5c7('0x30')]['find'](_0x6597fc)[_0xf5c7('0x28')](handleEntityNotFound(_0x2d6bcd,null))[_0xf5c7('0x28')](respondWithResult(_0x2d6bcd,null))['catch'](handleError(_0x2d6bcd,null));};exports[_0xf5c7('0x49')]=function(_0x27efa2,_0x5b1fae){return db['ZohoConfiguration'][_0xf5c7('0x49')](_0x27efa2[_0xf5c7('0x4a')],{})[_0xf5c7('0x28')](respondWithResult(_0x5b1fae,0xc9))[_0xf5c7('0x47')](handleError(_0x5b1fae,null));};exports[_0xf5c7('0x27')]=function(_0x2196eb,_0x10f86f){if(_0x2196eb[_0xf5c7('0x4a')]['id']){delete _0x2196eb[_0xf5c7('0x4a')]['id'];}return db[_0xf5c7('0x30')][_0xf5c7('0x4b')]({'where':{'id':_0x2196eb['params']['id']}})[_0xf5c7('0x28')](handleEntityNotFound(_0x10f86f,null))[_0xf5c7('0x28')](saveUpdates(_0x2196eb['body'],null))['then'](respondWithResult(_0x10f86f,null))[_0xf5c7('0x47')](handleError(_0x10f86f,null));};exports[_0xf5c7('0x29')]=function(_0x329fda,_0x4890d1){return db['ZohoConfiguration'][_0xf5c7('0x4b')]({'where':{'id':_0x329fda[_0xf5c7('0x4c')]['id']}})[_0xf5c7('0x28')](handleEntityNotFound(_0x4890d1,null))[_0xf5c7('0x28')](removeEntity(_0x4890d1,null))[_0xf5c7('0x47')](handleError(_0x4890d1,null));};exports[_0xf5c7('0x4d')]=function(_0x3e11ac,_0x277ab1,_0x10e4aa){var _0xf9b569={};var _0x5e6127={};var _0x23419c;var _0x3e6126;return db[_0xf5c7('0x30')]['findOne']({'where':{'id':_0x3e11ac[_0xf5c7('0x4c')]['id']}})[_0xf5c7('0x28')](handleEntityNotFound(_0x277ab1,null))[_0xf5c7('0x28')](function(_0x5a96b1){if(_0x5a96b1){_0x23419c=_0x5a96b1;_0x5e6127['model']=_[_0xf5c7('0x36')](db[_0xf5c7('0x4e')]['rawAttributes']);_0x5e6127[_0xf5c7('0x35')]=_[_0xf5c7('0x36')](_0x3e11ac[_0xf5c7('0x35')]);_0x5e6127[_0xf5c7('0x4f')]=_[_0xf5c7('0x39')](_0x5e6127[_0xf5c7('0x37')],_0x5e6127[_0xf5c7('0x35')]);_0xf9b569['attributes']=_[_0xf5c7('0x39')](_0x5e6127['model'],qs['fields'](_0x3e11ac[_0xf5c7('0x35')]['fields']));_0xf9b569[_0xf5c7('0x38')]=_0xf9b569['attributes'][_0xf5c7('0x50')]?_0xf9b569['attributes']:_0x5e6127[_0xf5c7('0x37')];_0xf9b569[_0xf5c7('0x3d')]=qs['sort'](_0x3e11ac[_0xf5c7('0x35')][_0xf5c7('0x3e')]);_0xf9b569[_0xf5c7('0x3f')]=qs[_0xf5c7('0x4f')](_[_0xf5c7('0x40')](_0x3e11ac[_0xf5c7('0x35')],_0x5e6127[_0xf5c7('0x4f')]));if(_0x3e11ac[_0xf5c7('0x35')][_0xf5c7('0x41')]){_0xf9b569[_0xf5c7('0x3f')]=_[_0xf5c7('0x42')](_0xf9b569[_0xf5c7('0x3f')],{'$or':_[_0xf5c7('0x2f')](_0xf9b569[_0xf5c7('0x38')],function(_0x4a223b){var _0x14c1c4={};_0x14c1c4[_0x4a223b]={'$like':'%'+_0x3e11ac['query'][_0xf5c7('0x41')]+'%'};return _0x14c1c4;})});}_0xf9b569=_[_0xf5c7('0x42')]({},_0xf9b569,_0x3e11ac[_0xf5c7('0x44')]);return _0x23419c[_0xf5c7('0x4d')](_0xf9b569);}})[_0xf5c7('0x28')](function(_0x37a09e){if(_0x37a09e){_0x3e6126=_0x37a09e[_0xf5c7('0x50')];if(!_0x3e11ac[_0xf5c7('0x35')]['hasOwnProperty'](_0xf5c7('0x3c'))){_0xf9b569[_0xf5c7('0x20')]=qs[_0xf5c7('0x20')](_0x3e11ac[_0xf5c7('0x35')][_0xf5c7('0x20')]);_0xf9b569[_0xf5c7('0x1d')]=qs[_0xf5c7('0x1d')](_0x3e11ac['query'][_0xf5c7('0x1d')]);}return _0x23419c['getFields'](_0xf9b569);}})[_0xf5c7('0x28')](function(_0x1e71af){if(_0x1e71af){return _0x1e71af?{'count':_0x3e6126,'rows':_0x1e71af}:null;}})['then'](respondWithResult(_0x277ab1,null))[_0xf5c7('0x47')](handleError(_0x277ab1,null));};exports[_0xf5c7('0x51')]=function(_0x1cd4a5,_0x58c567,_0x4b8869){var _0x194cad={};var _0x5814c3={};var _0x4ee438;var _0x24cfdd;return db[_0xf5c7('0x30')][_0xf5c7('0x52')]({'where':{'id':_0x1cd4a5[_0xf5c7('0x4c')]['id']}})[_0xf5c7('0x28')](handleEntityNotFound(_0x58c567,null))[_0xf5c7('0x28')](function(_0x10d45c){if(_0x10d45c){_0x4ee438=_0x10d45c;_0x5814c3[_0xf5c7('0x37')]=_['keys'](db[_0xf5c7('0x4e')][_0xf5c7('0x31')]);_0x5814c3[_0xf5c7('0x35')]=_['keys'](_0x1cd4a5[_0xf5c7('0x35')]);_0x5814c3['filters']=_[_0xf5c7('0x39')](_0x5814c3[_0xf5c7('0x37')],_0x5814c3[_0xf5c7('0x35')]);_0x194cad['attributes']=_[_0xf5c7('0x39')](_0x5814c3[_0xf5c7('0x37')],qs[_0xf5c7('0x3a')](_0x1cd4a5[_0xf5c7('0x35')][_0xf5c7('0x3a')]));_0x194cad[_0xf5c7('0x38')]=_0x194cad[_0xf5c7('0x38')]['length']?_0x194cad[_0xf5c7('0x38')]:_0x5814c3[_0xf5c7('0x37')];_0x194cad[_0xf5c7('0x3d')]=qs['sort'](_0x1cd4a5[_0xf5c7('0x35')][_0xf5c7('0x3e')]);_0x194cad[_0xf5c7('0x3f')]=qs[_0xf5c7('0x4f')](_[_0xf5c7('0x40')](_0x1cd4a5[_0xf5c7('0x35')],_0x5814c3[_0xf5c7('0x4f')]));if(_0x1cd4a5['query'][_0xf5c7('0x41')]){_0x194cad[_0xf5c7('0x3f')]=_[_0xf5c7('0x42')](_0x194cad[_0xf5c7('0x3f')],{'$or':_[_0xf5c7('0x2f')](_0x194cad[_0xf5c7('0x38')],function(_0x3c6c72){var _0x24d0e6={};_0x24d0e6[_0x3c6c72]={'$like':'%'+_0x1cd4a5['query'][_0xf5c7('0x41')]+'%'};return _0x24d0e6;})});}_0x194cad=_[_0xf5c7('0x42')]({},_0x194cad,_0x1cd4a5[_0xf5c7('0x44')]);return _0x4ee438['getSubjects'](_0x194cad);}})[_0xf5c7('0x28')](function(_0xba385c){if(_0xba385c){_0x24cfdd=_0xba385c[_0xf5c7('0x50')];if(!_0x1cd4a5[_0xf5c7('0x35')][_0xf5c7('0x3b')](_0xf5c7('0x3c'))){_0x194cad['limit']=qs[_0xf5c7('0x20')](_0x1cd4a5[_0xf5c7('0x35')]['limit']);_0x194cad[_0xf5c7('0x1d')]=qs[_0xf5c7('0x1d')](_0x1cd4a5[_0xf5c7('0x35')][_0xf5c7('0x1d')]);}return _0x4ee438[_0xf5c7('0x51')](_0x194cad);}})[_0xf5c7('0x28')](function(_0x853639){if(_0x853639){return _0x853639?{'count':_0x24cfdd,'rows':_0x853639}:null;}})['then'](respondWithResult(_0x58c567,null))[_0xf5c7('0x47')](handleError(_0x58c567,null));};exports[_0xf5c7('0x53')]=function(_0x1f4105,_0x311868,_0xc24b75){var _0x2ae6ec={};var _0x188b85={};var _0x5c2ff1;var _0x34d091;return db[_0xf5c7('0x30')][_0xf5c7('0x52')]({'where':{'id':_0x1f4105[_0xf5c7('0x4c')]['id']}})['then'](handleEntityNotFound(_0x311868,null))[_0xf5c7('0x28')](function(_0x45bd32){if(_0x45bd32){_0x5c2ff1=_0x45bd32;_0x188b85['model']=_[_0xf5c7('0x36')](db[_0xf5c7('0x4e')][_0xf5c7('0x31')]);_0x188b85[_0xf5c7('0x35')]=_['keys'](_0x1f4105['query']);_0x188b85[_0xf5c7('0x4f')]=_[_0xf5c7('0x39')](_0x188b85[_0xf5c7('0x37')],_0x188b85[_0xf5c7('0x35')]);_0x2ae6ec['attributes']=_[_0xf5c7('0x39')](_0x188b85['model'],qs[_0xf5c7('0x3a')](_0x1f4105[_0xf5c7('0x35')][_0xf5c7('0x3a')]));_0x2ae6ec[_0xf5c7('0x38')]=_0x2ae6ec[_0xf5c7('0x38')]['length']?_0x2ae6ec[_0xf5c7('0x38')]:_0x188b85[_0xf5c7('0x37')];_0x2ae6ec[_0xf5c7('0x3d')]=qs[_0xf5c7('0x3e')](_0x1f4105[_0xf5c7('0x35')][_0xf5c7('0x3e')]);_0x2ae6ec[_0xf5c7('0x3f')]=qs['filters'](_[_0xf5c7('0x40')](_0x1f4105[_0xf5c7('0x35')],_0x188b85[_0xf5c7('0x4f')]));if(_0x1f4105['query']['filter']){_0x2ae6ec[_0xf5c7('0x3f')]=_[_0xf5c7('0x42')](_0x2ae6ec['where'],{'$or':_[_0xf5c7('0x2f')](_0x2ae6ec[_0xf5c7('0x38')],function(_0x2d7c1e){var _0x166ae2={};_0x166ae2[_0x2d7c1e]={'$like':'%'+_0x1f4105[_0xf5c7('0x35')][_0xf5c7('0x41')]+'%'};return _0x166ae2;})});}_0x2ae6ec=_['merge']({},_0x2ae6ec,_0x1f4105[_0xf5c7('0x44')]);return _0x5c2ff1[_0xf5c7('0x53')](_0x2ae6ec);}})['then'](function(_0x491e8f){if(_0x491e8f){_0x34d091=_0x491e8f[_0xf5c7('0x50')];if(!_0x1f4105['query'][_0xf5c7('0x3b')]('nolimit')){_0x2ae6ec[_0xf5c7('0x20')]=qs[_0xf5c7('0x20')](_0x1f4105[_0xf5c7('0x35')][_0xf5c7('0x20')]);_0x2ae6ec[_0xf5c7('0x1d')]=qs[_0xf5c7('0x1d')](_0x1f4105[_0xf5c7('0x35')]['offset']);}return _0x5c2ff1[_0xf5c7('0x53')](_0x2ae6ec);}})['then'](function(_0x31875a){if(_0x31875a){return _0x31875a?{'count':_0x34d091,'rows':_0x31875a}:null;}})[_0xf5c7('0x28')](respondWithResult(_0x311868,null))[_0xf5c7('0x47')](handleError(_0x311868,null));}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.model.js b/server/api/intZohoConfiguration/intZohoConfiguration.model.js index c44f38c..4c13d52 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 _0x3260=['bluebird','request-promise','rimraf','./intZohoConfiguration.attributes','define','ZohoConfiguration','int_zoho_configurations','lodash','util','api','moment'];(function(_0x20eece,_0x36985f){var _0x41c57b=function(_0x516e1b){while(--_0x516e1b){_0x20eece['push'](_0x20eece['shift']());}};_0x41c57b(++_0x36985f);}(_0x3260,0xd8));var _0x0326=function(_0xaada6a,_0x2ac9c7){_0xaada6a=_0xaada6a-0x0;var _0x106a81=_0x3260[_0xaada6a];return _0x106a81;};'use strict';var _=require(_0x0326('0x0'));var util=require(_0x0326('0x1'));var logger=require('../../config/logger')(_0x0326('0x2'));var moment=require(_0x0326('0x3'));var BPromise=require(_0x0326('0x4'));var rp=require(_0x0326('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0326('0x6'));var config=require('../../config/environment');var attributes=require(_0x0326('0x7'));module['exports']=function(_0x5f1baf,_0x521822){return _0x5f1baf[_0x0326('0x8')](_0x0326('0x9'),attributes,{'tableName':_0x0326('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2ccf=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intZohoConfiguration.attributes','exports','define','lodash','util','../../config/logger'];(function(_0x2e94a5,_0x1d4a06){var _0x952192=function(_0x19b8b5){while(--_0x19b8b5){_0x2e94a5['push'](_0x2e94a5['shift']());}};_0x952192(++_0x1d4a06);}(_0x2ccf,0x1d1));var _0xf2cc=function(_0x5368b7,_0x228e51){_0x5368b7=_0x5368b7-0x0;var _0x33e5c1=_0x2ccf[_0x5368b7];return _0x33e5c1;};'use strict';var _=require(_0xf2cc('0x0'));var util=require(_0xf2cc('0x1'));var logger=require(_0xf2cc('0x2'))(_0xf2cc('0x3'));var moment=require(_0xf2cc('0x4'));var BPromise=require(_0xf2cc('0x5'));var rp=require(_0xf2cc('0x6'));var fs=require('fs');var path=require(_0xf2cc('0x7'));var rimraf=require(_0xf2cc('0x8'));var config=require(_0xf2cc('0x9'));var attributes=require(_0xf2cc('0xa'));module[_0xf2cc('0xb')]=function(_0xa1c955,_0x292288){return _0xa1c955[_0xf2cc('0xc')]('ZohoConfiguration',attributes,{'tableName':'int_zoho_configurations','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 27f0dba..38f6f78 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 _0x8a72=['request\x20sent','debug','ZohoConfiguration,\x20%s,\x20%s,\x20%s','error','code','ZohoConfiguration,\x20%s,\x20%s','message','result','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','then','info'];(function(_0x52e76c,_0x52ff01){var _0x3c7829=function(_0x1ceb84){while(--_0x1ceb84){_0x52e76c['push'](_0x52e76c['shift']());}};_0x3c7829(++_0x52ff01);}(_0x8a72,0x13d));var _0x28a7=function(_0x1e7364,_0x460d7a){_0x1e7364=_0x1e7364-0x0;var _0x4d1128=_0x8a72[_0x1e7364];return _0x4d1128;};'use strict';var _=require('lodash');var util=require(_0x28a7('0x0'));var moment=require(_0x28a7('0x1'));var BPromise=require('bluebird');var rs=require(_0x28a7('0x2'));var fs=require('fs');var Redis=require(_0x28a7('0x3'));var db=require(_0x28a7('0x4'))['db'];var utils=require(_0x28a7('0x5'));var logger=require(_0x28a7('0x6'))(_0x28a7('0x7'));var config=require(_0x28a7('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x28a7('0x9')][_0x28a7('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5469e2,_0x42d3a1,_0x5e9d55){return new BPromise(function(_0x5be978,_0x362d91){return client['request'](_0x5469e2,_0x5e9d55)[_0x28a7('0xb')](function(_0x207fca){logger[_0x28a7('0xc')]('ZohoConfiguration,\x20%s,\x20%s',_0x42d3a1,_0x28a7('0xd'));logger[_0x28a7('0xe')](_0x28a7('0xf'),_0x42d3a1,'request\x20sent',JSON['stringify'](_0x207fca));if(_0x207fca[_0x28a7('0x10')]){if(_0x207fca['error'][_0x28a7('0x11')]===0x1f4){logger['error'](_0x28a7('0x12'),_0x42d3a1,_0x207fca['error'][_0x28a7('0x13')]);return _0x362d91(_0x207fca['error'][_0x28a7('0x13')]);}logger[_0x28a7('0x10')](_0x28a7('0x12'),_0x42d3a1,_0x207fca['error'][_0x28a7('0x13')]);return _0x5be978(_0x207fca[_0x28a7('0x10')]['message']);}else{logger[_0x28a7('0xc')](_0x28a7('0x12'),_0x42d3a1,_0x28a7('0xd'));_0x5be978(_0x207fca[_0x28a7('0x14')]['message']);}})[_0x28a7('0x15')](function(_0x1e6b81){logger[_0x28a7('0x10')](_0x28a7('0x12'),_0x42d3a1,_0x1e6b81);_0x362d91(_0x1e6b81);});});} \ No newline at end of file +var _0x3ed8=['catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request\x20sent','error','code','ZohoConfiguration,\x20%s,\x20%s','message','info','result'];(function(_0xa3d957,_0x5cefc3){var _0x1f2f67=function(_0x53424c){while(--_0x53424c){_0xa3d957['push'](_0xa3d957['shift']());}};_0x1f2f67(++_0x5cefc3);}(_0x3ed8,0x16a));var _0x83ed=function(_0x23b655,_0x4feb2b){_0x23b655=_0x23b655-0x0;var _0x364b32=_0x3ed8[_0x23b655];return _0x364b32;};'use strict';var _=require(_0x83ed('0x0'));var util=require(_0x83ed('0x1'));var moment=require(_0x83ed('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x83ed('0x3'));var db=require(_0x83ed('0x4'))['db'];var utils=require(_0x83ed('0x5'));var logger=require(_0x83ed('0x6'))(_0x83ed('0x7'));var config=require(_0x83ed('0x8'));var jayson=require(_0x83ed('0x9'));var client=jayson[_0x83ed('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3d908c,_0x20a357,_0xc309d8){return new BPromise(function(_0x1ae8dd,_0x2875ba){return client['request'](_0x3d908c,_0xc309d8)['then'](function(_0x371fb6){logger['info']('ZohoConfiguration,\x20%s,\x20%s',_0x20a357,_0x83ed('0xb'));logger['debug']('ZohoConfiguration,\x20%s,\x20%s,\x20%s',_0x20a357,_0x83ed('0xb'),JSON['stringify'](_0x371fb6));if(_0x371fb6[_0x83ed('0xc')]){if(_0x371fb6['error'][_0x83ed('0xd')]===0x1f4){logger['error'](_0x83ed('0xe'),_0x20a357,_0x371fb6['error']['message']);return _0x2875ba(_0x371fb6[_0x83ed('0xc')]['message']);}logger[_0x83ed('0xc')](_0x83ed('0xe'),_0x20a357,_0x371fb6['error'][_0x83ed('0xf')]);return _0x1ae8dd(_0x371fb6[_0x83ed('0xc')]['message']);}else{logger[_0x83ed('0x10')](_0x83ed('0xe'),_0x20a357,_0x83ed('0xb'));_0x1ae8dd(_0x371fb6[_0x83ed('0x11')]['message']);}})[_0x83ed('0x12')](function(_0x496f73){logger['error'](_0x83ed('0xe'),_0x20a357,_0x496f73);_0x2875ba(_0x496f73);});});} \ No newline at end of file diff --git a/server/api/intZohoField/index.js b/server/api/intZohoField/index.js index 9710ef6..e71e3ed 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 _0xaf24=['express','Router','fs-extra','../../components/auth/service','../../config/environment','index','get','/:id','isAuthenticated','show','post','create','put','update','destroy','exports','multer','util','path','connect-timeout'];(function(_0x242df0,_0x342c63){var _0xb3184a=function(_0x2fd919){while(--_0x2fd919){_0x242df0['push'](_0x242df0['shift']());}};_0xb3184a(++_0x342c63);}(_0xaf24,0x13c));var _0x4af2=function(_0x4c9250,_0x2acdd8){_0x4c9250=_0x4c9250-0x0;var _0x41bae8=_0xaf24[_0x4c9250];return _0x41bae8;};'use strict';var multer=require(_0x4af2('0x0'));var util=require(_0x4af2('0x1'));var path=require(_0x4af2('0x2'));var timeout=require(_0x4af2('0x3'));var express=require(_0x4af2('0x4'));var router=express[_0x4af2('0x5')]();var fs_extra=require(_0x4af2('0x6'));var auth=require(_0x4af2('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x4af2('0x8'));var controller=require('./intZohoField.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x4af2('0x9')]);router[_0x4af2('0xa')](_0x4af2('0xb'),auth[_0x4af2('0xc')](),controller[_0x4af2('0xd')]);router[_0x4af2('0xe')]('/',auth[_0x4af2('0xc')](),controller[_0x4af2('0xf')]);router[_0x4af2('0x10')](_0x4af2('0xb'),auth[_0x4af2('0xc')](),controller[_0x4af2('0x11')]);router['delete'](_0x4af2('0xb'),auth[_0x4af2('0xc')](),controller[_0x4af2('0x12')]);module[_0x4af2('0x13')]=router; \ No newline at end of file +var _0x8446=['../../components/auth/service','isAuthenticated','index','show','post','create','put','/:id','update','delete','destroy','exports','multer','express','Router','fs-extra'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8446,0x14c));var _0x6844=function(_0x4da886,_0x4b6e85){_0x4da886=_0x4da886-0x0;var _0xd86f03=_0x8446[_0x4da886];return _0xd86f03;};'use strict';var multer=require(_0x6844('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x6844('0x1'));var router=express[_0x6844('0x2')]();var fs_extra=require(_0x6844('0x3'));var auth=require(_0x6844('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./intZohoField.controller');router['get']('/',auth[_0x6844('0x5')](),controller[_0x6844('0x6')]);router['get']('/:id',auth[_0x6844('0x5')](),controller[_0x6844('0x7')]);router[_0x6844('0x8')]('/',auth[_0x6844('0x5')](),controller[_0x6844('0x9')]);router[_0x6844('0xa')](_0x6844('0xb'),auth['isAuthenticated'](),controller[_0x6844('0xc')]);router[_0x6844('0xd')](_0x6844('0xb'),auth[_0x6844('0x5')](),controller[_0x6844('0xe')]);module[_0x6844('0xf')]=router; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.attributes.js b/server/api/intZohoField/intZohoField.attributes.js index 7c273a9..57827f2 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 _0xb8d0=['ENUM','variable','customVariable','string','STRING','sequelize','exports'];(function(_0x27f62d,_0x37c641){var _0x33f129=function(_0x44dcc4){while(--_0x44dcc4){_0x27f62d['push'](_0x27f62d['shift']());}};_0x33f129(++_0x37c641);}(_0xb8d0,0x12b));var _0x0b8d=function(_0xe20a0e,_0x6bbbab){_0xe20a0e=_0xe20a0e-0x0;var _0x2e1bac=_0xb8d0[_0xe20a0e];return _0x2e1bac;};'use strict';var Sequelize=require(_0x0b8d('0x0'));module[_0x0b8d('0x1')]={'type':{'type':Sequelize[_0x0b8d('0x2')]('string',_0x0b8d('0x3'),_0x0b8d('0x4'),'keyValue','picklist'),'defaultValue':_0x0b8d('0x5')},'content':{'type':Sequelize[_0x0b8d('0x6')]},'key':{'type':Sequelize[_0x0b8d('0x6')]},'keyType':{'type':Sequelize[_0x0b8d('0x2')]('string',_0x0b8d('0x3'),'customVariable')},'keyContent':{'type':Sequelize[_0x0b8d('0x6')]},'idField':{'type':Sequelize[_0x0b8d('0x6')]},'nameField':{'type':Sequelize[_0x0b8d('0x6')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x7755=['BOOLEAN','sequelize','exports','variable','picklist','string','STRING','ENUM','customVariable'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x7755,0x145));var _0x5775=function(_0x548503,_0x1aa00c){_0x548503=_0x548503-0x0;var _0xf8f05f=_0x7755[_0x548503];return _0xf8f05f;};'use strict';var Sequelize=require(_0x5775('0x0'));module[_0x5775('0x1')]={'type':{'type':Sequelize['ENUM']('string',_0x5775('0x2'),'customVariable','keyValue',_0x5775('0x3')),'defaultValue':_0x5775('0x4')},'content':{'type':Sequelize[_0x5775('0x5')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x5775('0x6')](_0x5775('0x4'),_0x5775('0x2'),_0x5775('0x7'))},'keyContent':{'type':Sequelize[_0x5775('0x5')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x5775('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.controller.js b/server/api/intZohoField/intZohoField.controller.js index 968e8b5..9e32565 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 _0x1a4c=['params','fields','options','find','create','body','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','ZohoField','rawAttributes','fieldName','type','map','keys','query','filters','model','attributes','intersection','length','sort','filter','merge','where','VIRTUAL','includeAll','catch','show'];(function(_0x1ac6e5,_0x40f47f){var _0x5877dc=function(_0x99caea){while(--_0x99caea){_0x1ac6e5['push'](_0x1ac6e5['shift']());}};_0x5877dc(++_0x40f47f);}(_0x1a4c,0x164));var _0xc1a4=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x1a4c[_0x21a9d9];return _0x46adce;};'use strict';var emlformat=require(_0xc1a4('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xc1a4('0x1'));var jsonpatch=require(_0xc1a4('0x2'));var rp=require(_0xc1a4('0x3'));var moment=require('moment');var BPromise=require(_0xc1a4('0x4'));var Mustache=require(_0xc1a4('0x5'));var util=require(_0xc1a4('0x6'));var path=require(_0xc1a4('0x7'));var sox=require(_0xc1a4('0x8'));var csv=require('to-csv');var ejs=require(_0xc1a4('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc1a4('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xc1a4('0xb'));var deskjs=require(_0xc1a4('0xc'));var toCsv=require(_0xc1a4('0xd'));var querystring=require('querystring');var Papa=require(_0xc1a4('0xe'));var Redis=require(_0xc1a4('0xf'));var authService=require(_0xc1a4('0x10'));var qs=require(_0xc1a4('0x11'));var as=require(_0xc1a4('0x12'));var hardwareService=require(_0xc1a4('0x13'));var logger=require(_0xc1a4('0x14'))(_0xc1a4('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xc1a4('0x16'));var db=require(_0xc1a4('0x17'))['db'];function respondWithStatusCode(_0x2ce598,_0x20ec8b){_0x20ec8b=_0x20ec8b||0xcc;return function(_0x567646){if(_0x567646){return _0x2ce598[_0xc1a4('0x18')](_0x20ec8b);}return _0x2ce598[_0xc1a4('0x19')](_0x20ec8b)[_0xc1a4('0x1a')]();};}function respondWithResult(_0x4b90c7,_0x149339){_0x149339=_0x149339||0xc8;return function(_0x95d002){if(_0x95d002){return _0x4b90c7[_0xc1a4('0x19')](_0x149339)[_0xc1a4('0x1b')](_0x95d002);}};}function respondWithFilteredResult(_0x2fa0ca,_0x4e4787){return function(_0x59db3b){if(_0x59db3b){var _0x565e63=typeof _0x4e4787[_0xc1a4('0x1c')]==='undefined'&&typeof _0x4e4787['limit']===_0xc1a4('0x1d');var _0x26bf85=_0x59db3b[_0xc1a4('0x1e')];var _0x1d8fda=_0x565e63?0x0:_0x4e4787[_0xc1a4('0x1c')];var _0x2e649b=_0x565e63?_0x59db3b['count']:_0x4e4787[_0xc1a4('0x1c')]+_0x4e4787[_0xc1a4('0x1f')];var _0x150390;if(_0x2e649b>=_0x26bf85){_0x2e649b=_0x26bf85;_0x150390=0xc8;}else{_0x150390=0xce;}_0x2fa0ca[_0xc1a4('0x19')](_0x150390);return _0x2fa0ca['set'](_0xc1a4('0x20'),_0x1d8fda+'-'+_0x2e649b+'/'+_0x26bf85)[_0xc1a4('0x1b')](_0x59db3b);}return null;};}function patchUpdates(_0x13bc91){return function(_0x2cd8f8){try{jsonpatch[_0xc1a4('0x21')](_0x2cd8f8,_0x13bc91,!![]);}catch(_0x21c0de){return BPromise[_0xc1a4('0x22')](_0x21c0de);}return _0x2cd8f8[_0xc1a4('0x23')]();};}function saveUpdates(_0x333b58,_0x528ddd){return function(_0x58dcc2){if(_0x58dcc2){return _0x58dcc2[_0xc1a4('0x24')](_0x333b58)[_0xc1a4('0x25')](function(_0x6c1786){return _0x6c1786;});}return null;};}function removeEntity(_0x1720b1,_0x29576d){return function(_0x47764f){if(_0x47764f){return _0x47764f[_0xc1a4('0x26')]()[_0xc1a4('0x25')](function(){_0x1720b1['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x7c2662,_0x33b6a4){return function(_0x28fa25){if(!_0x28fa25){_0x7c2662[_0xc1a4('0x18')](0x194);}return _0x28fa25;};}function handleError(_0x513b6e,_0x59d8cc){_0x59d8cc=_0x59d8cc||0x1f4;return function(_0x3612fc){logger[_0xc1a4('0x27')](_0x3612fc[_0xc1a4('0x28')]);if(_0x3612fc[_0xc1a4('0x29')]){delete _0x3612fc[_0xc1a4('0x29')];}_0x513b6e[_0xc1a4('0x19')](_0x59d8cc)[_0xc1a4('0x2a')](_0x3612fc);};}exports[_0xc1a4('0x2b')]=function(_0x39f814,_0x2136b0){var _0x465dcf={},_0x393183={},_0x260b8b={'count':0x0,'rows':[]};var _0x43446d=_['map'](db[_0xc1a4('0x2c')][_0xc1a4('0x2d')],function(_0x2ea1a7){return{'name':_0x2ea1a7[_0xc1a4('0x2e')],'type':_0x2ea1a7[_0xc1a4('0x2f')]['key']};});_0x393183['model']=_[_0xc1a4('0x30')](_0x43446d,_0xc1a4('0x29'));_0x393183['query']=_[_0xc1a4('0x31')](_0x39f814[_0xc1a4('0x32')]);_0x393183[_0xc1a4('0x33')]=_['intersection'](_0x393183[_0xc1a4('0x34')],_0x393183[_0xc1a4('0x32')]);_0x465dcf[_0xc1a4('0x35')]=_[_0xc1a4('0x36')](_0x393183[_0xc1a4('0x34')],qs['fields'](_0x39f814[_0xc1a4('0x32')]['fields']));_0x465dcf[_0xc1a4('0x35')]=_0x465dcf[_0xc1a4('0x35')][_0xc1a4('0x37')]?_0x465dcf[_0xc1a4('0x35')]:_0x393183[_0xc1a4('0x34')];if(!_0x39f814[_0xc1a4('0x32')]['hasOwnProperty']('nolimit')){_0x465dcf[_0xc1a4('0x1f')]=qs[_0xc1a4('0x1f')](_0x39f814['query'][_0xc1a4('0x1f')]);_0x465dcf[_0xc1a4('0x1c')]=qs[_0xc1a4('0x1c')](_0x39f814['query']['offset']);}_0x465dcf['order']=qs[_0xc1a4('0x38')](_0x39f814[_0xc1a4('0x32')][_0xc1a4('0x38')]);_0x465dcf['where']=qs[_0xc1a4('0x33')](_['pick'](_0x39f814[_0xc1a4('0x32')],_0x393183[_0xc1a4('0x33')]),_0x43446d);if(_0x39f814['query'][_0xc1a4('0x39')]){_0x465dcf['where']=_[_0xc1a4('0x3a')](_0x465dcf[_0xc1a4('0x3b')],{'$or':_[_0xc1a4('0x30')](_0x43446d,function(_0x22a43e){if(_0x22a43e['type']!==_0xc1a4('0x3c')){var _0x53a2e0={};_0x53a2e0[_0x22a43e['name']]={'$like':'%'+_0x39f814[_0xc1a4('0x32')][_0xc1a4('0x39')]+'%'};return _0x53a2e0;}})});}_0x465dcf=_[_0xc1a4('0x3a')]({},_0x465dcf,_0x39f814['options']);var _0x27380b={'where':_0x465dcf[_0xc1a4('0x3b')]};return db[_0xc1a4('0x2c')][_0xc1a4('0x1e')](_0x27380b)[_0xc1a4('0x25')](function(_0x357dbc){_0x260b8b['count']=_0x357dbc;if(_0x39f814[_0xc1a4('0x32')][_0xc1a4('0x3d')]){_0x465dcf['include']=[{'all':!![]}];}return db[_0xc1a4('0x2c')]['findAll'](_0x465dcf);})['then'](function(_0x48558e){_0x260b8b['rows']=_0x48558e;return _0x260b8b;})['then'](respondWithFilteredResult(_0x2136b0,_0x465dcf))[_0xc1a4('0x3e')](handleError(_0x2136b0,null));};exports[_0xc1a4('0x3f')]=function(_0x510152,_0x42c0d7){var _0x2b49fd={'raw':!![],'where':{'id':_0x510152[_0xc1a4('0x40')]['id']}},_0x2cd3b3={};_0x2cd3b3[_0xc1a4('0x34')]=_[_0xc1a4('0x31')](db['ZohoField'][_0xc1a4('0x2d')]);_0x2cd3b3[_0xc1a4('0x32')]=_[_0xc1a4('0x31')](_0x510152[_0xc1a4('0x32')]);_0x2cd3b3[_0xc1a4('0x33')]=_[_0xc1a4('0x36')](_0x2cd3b3[_0xc1a4('0x34')],_0x2cd3b3[_0xc1a4('0x32')]);_0x2b49fd['attributes']=_[_0xc1a4('0x36')](_0x2cd3b3['model'],qs[_0xc1a4('0x41')](_0x510152[_0xc1a4('0x32')]['fields']));_0x2b49fd[_0xc1a4('0x35')]=_0x2b49fd[_0xc1a4('0x35')][_0xc1a4('0x37')]?_0x2b49fd[_0xc1a4('0x35')]:_0x2cd3b3[_0xc1a4('0x34')];if(_0x510152[_0xc1a4('0x32')][_0xc1a4('0x3d')]){_0x2b49fd['include']=[{'all':!![]}];}_0x2b49fd=_[_0xc1a4('0x3a')]({},_0x2b49fd,_0x510152[_0xc1a4('0x42')]);return db[_0xc1a4('0x2c')][_0xc1a4('0x43')](_0x2b49fd)[_0xc1a4('0x25')](handleEntityNotFound(_0x42c0d7,null))[_0xc1a4('0x25')](respondWithResult(_0x42c0d7,null))[_0xc1a4('0x3e')](handleError(_0x42c0d7,null));};exports[_0xc1a4('0x44')]=function(_0x3cf483,_0x3909d9){return db[_0xc1a4('0x2c')]['create'](_0x3cf483[_0xc1a4('0x45')],{})[_0xc1a4('0x25')](respondWithResult(_0x3909d9,0xc9))['catch'](handleError(_0x3909d9,null));};exports[_0xc1a4('0x24')]=function(_0x273161,_0x54dc05){if(_0x273161[_0xc1a4('0x45')]['id']){delete _0x273161['body']['id'];}return db[_0xc1a4('0x2c')][_0xc1a4('0x43')]({'where':{'id':_0x273161[_0xc1a4('0x40')]['id']}})[_0xc1a4('0x25')](handleEntityNotFound(_0x54dc05,null))[_0xc1a4('0x25')](saveUpdates(_0x273161[_0xc1a4('0x45')],null))[_0xc1a4('0x25')](respondWithResult(_0x54dc05,null))[_0xc1a4('0x3e')](handleError(_0x54dc05,null));};exports['destroy']=function(_0x38bc27,_0x22d340){return db[_0xc1a4('0x2c')]['find']({'where':{'id':_0x38bc27['params']['id']}})[_0xc1a4('0x25')](handleEntityNotFound(_0x22d340,null))[_0xc1a4('0x25')](removeEntity(_0x22d340,null))[_0xc1a4('0x3e')](handleError(_0x22d340,null));}; \ No newline at end of file +var _0x28ad=['length','include','create','body','find','eml-format','rimraf','fast-json-patch','moment','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','limit','undefined','count','set','apply','save','update','then','destroy','end','stack','name','send','index','map','ZohoField','fieldName','type','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','rawAttributes'];(function(_0x405dde,_0x24e000){var _0xf7fdac=function(_0x34739b){while(--_0x34739b){_0x405dde['push'](_0x405dde['shift']());}};_0xf7fdac(++_0x24e000);}(_0x28ad,0x99));var _0xd28a=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x28ad[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require(_0xd28a('0x0'));var rimraf=require(_0xd28a('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd28a('0x2'));var rp=require('request-promise');var moment=require(_0xd28a('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xd28a('0x4'));var util=require('util');var path=require(_0xd28a('0x5'));var sox=require(_0xd28a('0x6'));var csv=require(_0xd28a('0x7'));var ejs=require(_0xd28a('0x8'));var fs=require('fs');var fs_extra=require(_0xd28a('0x9'));var _=require(_0xd28a('0xa'));var squel=require(_0xd28a('0xb'));var crypto=require(_0xd28a('0xc'));var jsforce=require(_0xd28a('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xd28a('0x7'));var querystring=require(_0xd28a('0xe'));var Papa=require('papaparse');var Redis=require(_0xd28a('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xd28a('0x10'));var as=require(_0xd28a('0x11'));var hardwareService=require(_0xd28a('0x12'));var logger=require('../../config/logger')(_0xd28a('0x13'));var utils=require(_0xd28a('0x14'));var config=require(_0xd28a('0x15'));var licenseUtil=require(_0xd28a('0x16'));var db=require(_0xd28a('0x17'))['db'];function respondWithStatusCode(_0x244fb1,_0x4805e8){_0x4805e8=_0x4805e8||0xcc;return function(_0x4d3e4a){if(_0x4d3e4a){return _0x244fb1[_0xd28a('0x18')](_0x4805e8);}return _0x244fb1['status'](_0x4805e8)['end']();};}function respondWithResult(_0x306600,_0x26c654){_0x26c654=_0x26c654||0xc8;return function(_0x468726){if(_0x468726){return _0x306600[_0xd28a('0x19')](_0x26c654)[_0xd28a('0x1a')](_0x468726);}};}function respondWithFilteredResult(_0x1b2266,_0x4c0419){return function(_0x13ec33){if(_0x13ec33){var _0x2c90e4=typeof _0x4c0419[_0xd28a('0x1b')]==='undefined'&&typeof _0x4c0419[_0xd28a('0x1c')]===_0xd28a('0x1d');var _0x12b0b9=_0x13ec33[_0xd28a('0x1e')];var _0x39f865=_0x2c90e4?0x0:_0x4c0419['offset'];var _0x54375f=_0x2c90e4?_0x13ec33['count']:_0x4c0419[_0xd28a('0x1b')]+_0x4c0419[_0xd28a('0x1c')];var _0x2f0c5b;if(_0x54375f>=_0x12b0b9){_0x54375f=_0x12b0b9;_0x2f0c5b=0xc8;}else{_0x2f0c5b=0xce;}_0x1b2266[_0xd28a('0x19')](_0x2f0c5b);return _0x1b2266[_0xd28a('0x1f')]('Content-Range',_0x39f865+'-'+_0x54375f+'/'+_0x12b0b9)['json'](_0x13ec33);}return null;};}function patchUpdates(_0x2d1763){return function(_0x4972b4){try{jsonpatch[_0xd28a('0x20')](_0x4972b4,_0x2d1763,!![]);}catch(_0x3a9cdf){return BPromise['reject'](_0x3a9cdf);}return _0x4972b4[_0xd28a('0x21')]();};}function saveUpdates(_0x5e9995,_0x1d055c){return function(_0x5126e9){if(_0x5126e9){return _0x5126e9[_0xd28a('0x22')](_0x5e9995)[_0xd28a('0x23')](function(_0x5f2118){return _0x5f2118;});}return null;};}function removeEntity(_0x349852,_0x2ecb16){return function(_0x404202){if(_0x404202){return _0x404202[_0xd28a('0x24')]()[_0xd28a('0x23')](function(){_0x349852[_0xd28a('0x19')](0xcc)[_0xd28a('0x25')]();});}};}function handleEntityNotFound(_0xfd1f70,_0x5e1d67){return function(_0x151282){if(!_0x151282){_0xfd1f70[_0xd28a('0x18')](0x194);}return _0x151282;};}function handleError(_0x3ab275,_0x237588){_0x237588=_0x237588||0x1f4;return function(_0x56041e){logger['error'](_0x56041e[_0xd28a('0x26')]);if(_0x56041e[_0xd28a('0x27')]){delete _0x56041e[_0xd28a('0x27')];}_0x3ab275['status'](_0x237588)[_0xd28a('0x28')](_0x56041e);};}exports[_0xd28a('0x29')]=function(_0x3eeb8d,_0x14df51){var _0x45bf6b={},_0x5173b7={},_0x20382c={'count':0x0,'rows':[]};var _0x18fca3=_[_0xd28a('0x2a')](db[_0xd28a('0x2b')]['rawAttributes'],function(_0x22bf3e){return{'name':_0x22bf3e[_0xd28a('0x2c')],'type':_0x22bf3e[_0xd28a('0x2d')]['key']};});_0x5173b7[_0xd28a('0x2e')]=_[_0xd28a('0x2a')](_0x18fca3,'name');_0x5173b7[_0xd28a('0x2f')]=_[_0xd28a('0x30')](_0x3eeb8d['query']);_0x5173b7[_0xd28a('0x31')]=_['intersection'](_0x5173b7[_0xd28a('0x2e')],_0x5173b7[_0xd28a('0x2f')]);_0x45bf6b['attributes']=_[_0xd28a('0x32')](_0x5173b7['model'],qs[_0xd28a('0x33')](_0x3eeb8d[_0xd28a('0x2f')]['fields']));_0x45bf6b[_0xd28a('0x34')]=_0x45bf6b[_0xd28a('0x34')]['length']?_0x45bf6b[_0xd28a('0x34')]:_0x5173b7[_0xd28a('0x2e')];if(!_0x3eeb8d[_0xd28a('0x2f')][_0xd28a('0x35')](_0xd28a('0x36'))){_0x45bf6b[_0xd28a('0x1c')]=qs[_0xd28a('0x1c')](_0x3eeb8d[_0xd28a('0x2f')][_0xd28a('0x1c')]);_0x45bf6b[_0xd28a('0x1b')]=qs['offset'](_0x3eeb8d['query'][_0xd28a('0x1b')]);}_0x45bf6b[_0xd28a('0x37')]=qs[_0xd28a('0x38')](_0x3eeb8d[_0xd28a('0x2f')][_0xd28a('0x38')]);_0x45bf6b[_0xd28a('0x39')]=qs[_0xd28a('0x31')](_[_0xd28a('0x3a')](_0x3eeb8d['query'],_0x5173b7[_0xd28a('0x31')]),_0x18fca3);if(_0x3eeb8d[_0xd28a('0x2f')][_0xd28a('0x3b')]){_0x45bf6b[_0xd28a('0x39')]=_[_0xd28a('0x3c')](_0x45bf6b[_0xd28a('0x39')],{'$or':_[_0xd28a('0x2a')](_0x18fca3,function(_0xb66914){if(_0xb66914[_0xd28a('0x2d')]!==_0xd28a('0x3d')){var _0x510b0f={};_0x510b0f[_0xb66914[_0xd28a('0x27')]]={'$like':'%'+_0x3eeb8d[_0xd28a('0x2f')]['filter']+'%'};return _0x510b0f;}})});}_0x45bf6b=_[_0xd28a('0x3c')]({},_0x45bf6b,_0x3eeb8d[_0xd28a('0x3e')]);var _0x195352={'where':_0x45bf6b[_0xd28a('0x39')]};return db[_0xd28a('0x2b')][_0xd28a('0x1e')](_0x195352)[_0xd28a('0x23')](function(_0x20918f){_0x20382c[_0xd28a('0x1e')]=_0x20918f;if(_0x3eeb8d['query'][_0xd28a('0x3f')]){_0x45bf6b['include']=[{'all':!![]}];}return db[_0xd28a('0x2b')][_0xd28a('0x40')](_0x45bf6b);})[_0xd28a('0x23')](function(_0x5c2902){_0x20382c[_0xd28a('0x41')]=_0x5c2902;return _0x20382c;})[_0xd28a('0x23')](respondWithFilteredResult(_0x14df51,_0x45bf6b))[_0xd28a('0x42')](handleError(_0x14df51,null));};exports[_0xd28a('0x43')]=function(_0x4c9ef3,_0x1010b7){var _0x3de1c3={'raw':!![],'where':{'id':_0x4c9ef3['params']['id']}},_0x2b99a7={};_0x2b99a7[_0xd28a('0x2e')]=_[_0xd28a('0x30')](db[_0xd28a('0x2b')][_0xd28a('0x44')]);_0x2b99a7[_0xd28a('0x2f')]=_[_0xd28a('0x30')](_0x4c9ef3['query']);_0x2b99a7[_0xd28a('0x31')]=_[_0xd28a('0x32')](_0x2b99a7['model'],_0x2b99a7[_0xd28a('0x2f')]);_0x3de1c3[_0xd28a('0x34')]=_['intersection'](_0x2b99a7[_0xd28a('0x2e')],qs[_0xd28a('0x33')](_0x4c9ef3['query']['fields']));_0x3de1c3[_0xd28a('0x34')]=_0x3de1c3['attributes'][_0xd28a('0x45')]?_0x3de1c3[_0xd28a('0x34')]:_0x2b99a7[_0xd28a('0x2e')];if(_0x4c9ef3[_0xd28a('0x2f')][_0xd28a('0x3f')]){_0x3de1c3[_0xd28a('0x46')]=[{'all':!![]}];}_0x3de1c3=_['merge']({},_0x3de1c3,_0x4c9ef3['options']);return db[_0xd28a('0x2b')]['find'](_0x3de1c3)[_0xd28a('0x23')](handleEntityNotFound(_0x1010b7,null))['then'](respondWithResult(_0x1010b7,null))[_0xd28a('0x42')](handleError(_0x1010b7,null));};exports['create']=function(_0x57127f,_0x34b50f){return db[_0xd28a('0x2b')][_0xd28a('0x47')](_0x57127f[_0xd28a('0x48')],{})['then'](respondWithResult(_0x34b50f,0xc9))[_0xd28a('0x42')](handleError(_0x34b50f,null));};exports[_0xd28a('0x22')]=function(_0x2f1194,_0x5d9724){if(_0x2f1194['body']['id']){delete _0x2f1194['body']['id'];}return db[_0xd28a('0x2b')][_0xd28a('0x49')]({'where':{'id':_0x2f1194['params']['id']}})['then'](handleEntityNotFound(_0x5d9724,null))[_0xd28a('0x23')](saveUpdates(_0x2f1194[_0xd28a('0x48')],null))[_0xd28a('0x23')](respondWithResult(_0x5d9724,null))[_0xd28a('0x42')](handleError(_0x5d9724,null));};exports[_0xd28a('0x24')]=function(_0x4e7ef7,_0x3f9c79){return db[_0xd28a('0x2b')]['find']({'where':{'id':_0x4e7ef7['params']['id']}})[_0xd28a('0x23')](handleEntityNotFound(_0x3f9c79,null))[_0xd28a('0x23')](removeEntity(_0x3f9c79,null))[_0xd28a('0x42')](handleError(_0x3f9c79,null));}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.model.js b/server/api/intZohoField/intZohoField.model.js index cdfc361..be72cbd 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 _0xf2e3=['request-promise','path','rimraf','../../config/environment','./intZohoField.attributes','define','ZohoField','int_zoho_fields','zoho_unique_index','idField','FieldId','lodash','../../config/logger','api','moment','bluebird'];(function(_0x36884e,_0x48008f){var _0x1cc367=function(_0x388a78){while(--_0x388a78){_0x36884e['push'](_0x36884e['shift']());}};_0x1cc367(++_0x48008f);}(_0xf2e3,0x9b));var _0x3f2e=function(_0x4ed520,_0x21be63){_0x4ed520=_0x4ed520-0x0;var _0x4415a6=_0xf2e3[_0x4ed520];return _0x4415a6;};'use strict';var _=require(_0x3f2e('0x0'));var util=require('util');var logger=require(_0x3f2e('0x1'))(_0x3f2e('0x2'));var moment=require(_0x3f2e('0x3'));var BPromise=require(_0x3f2e('0x4'));var rp=require(_0x3f2e('0x5'));var fs=require('fs');var path=require(_0x3f2e('0x6'));var rimraf=require(_0x3f2e('0x7'));var config=require(_0x3f2e('0x8'));var attributes=require(_0x3f2e('0x9'));module['exports']=function(_0x33a3b7,_0xdd6b3e){return _0x33a3b7[_0x3f2e('0xa')](_0x3f2e('0xb'),attributes,{'tableName':_0x3f2e('0xc'),'paranoid':![],'indexes':[{'name':_0x3f2e('0xd'),'fields':[_0x3f2e('0xe'),_0x3f2e('0xf')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x6d38=['util','../../config/logger','api','request-promise','rimraf','../../config/environment','./intZohoField.attributes','define','ZohoField','idField','FieldId'];(function(_0x4b7b62,_0x4920a9){var _0x2280df=function(_0x21e1f8){while(--_0x21e1f8){_0x4b7b62['push'](_0x4b7b62['shift']());}};_0x2280df(++_0x4920a9);}(_0x6d38,0x1ef));var _0x86d3=function(_0xefd519,_0xc62635){_0xefd519=_0xefd519-0x0;var _0x4bb882=_0x6d38[_0xefd519];return _0x4bb882;};'use strict';var _=require('lodash');var util=require(_0x86d3('0x0'));var logger=require(_0x86d3('0x1'))(_0x86d3('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x86d3('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x86d3('0x4'));var config=require(_0x86d3('0x5'));var attributes=require(_0x86d3('0x6'));module['exports']=function(_0x2d8272,_0xfbbc15){return _0x2d8272[_0x86d3('0x7')](_0x86d3('0x8'),attributes,{'tableName':'int_zoho_fields','paranoid':![],'indexes':[{'name':'zoho_unique_index','fields':[_0x86d3('0x9'),_0x86d3('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 f6e43d3..bf68594 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 _0x1283=['request\x20sent','result','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','then','info','ZohoField,\x20%s,\x20%s','debug','ZohoField,\x20%s,\x20%s,\x20%s','error','code','message'];(function(_0x588457,_0x2a1fe9){var _0x642552=function(_0x42832d){while(--_0x42832d){_0x588457['push'](_0x588457['shift']());}};_0x642552(++_0x2a1fe9);}(_0x1283,0x1e2));var _0x3128=function(_0x1cd674,_0x8d3638){_0x1cd674=_0x1cd674-0x0;var _0x27928f=_0x1283[_0x1cd674];return _0x27928f;};'use strict';var _=require(_0x3128('0x0'));var util=require('util');var moment=require(_0x3128('0x1'));var BPromise=require('bluebird');var rs=require(_0x3128('0x2'));var fs=require('fs');var Redis=require(_0x3128('0x3'));var db=require(_0x3128('0x4'))['db'];var utils=require(_0x3128('0x5'));var logger=require(_0x3128('0x6'))('rpc');var config=require(_0x3128('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x3128('0x8')][_0x3128('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4fc814,_0x2b42aa,_0x1be8de){return new BPromise(function(_0x2989bc,_0x4085b5){return client['request'](_0x4fc814,_0x1be8de)[_0x3128('0xa')](function(_0x8e3de6){logger[_0x3128('0xb')](_0x3128('0xc'),_0x2b42aa,'request\x20sent');logger[_0x3128('0xd')](_0x3128('0xe'),_0x2b42aa,'request\x20sent',JSON['stringify'](_0x8e3de6));if(_0x8e3de6['error']){if(_0x8e3de6[_0x3128('0xf')][_0x3128('0x10')]===0x1f4){logger['error'](_0x3128('0xc'),_0x2b42aa,_0x8e3de6[_0x3128('0xf')]['message']);return _0x4085b5(_0x8e3de6[_0x3128('0xf')][_0x3128('0x11')]);}logger[_0x3128('0xf')](_0x3128('0xc'),_0x2b42aa,_0x8e3de6[_0x3128('0xf')][_0x3128('0x11')]);return _0x2989bc(_0x8e3de6[_0x3128('0xf')][_0x3128('0x11')]);}else{logger[_0x3128('0xb')](_0x3128('0xc'),_0x2b42aa,_0x3128('0x12'));_0x2989bc(_0x8e3de6[_0x3128('0x13')][_0x3128('0x11')]);}})['catch'](function(_0x272a07){logger[_0x3128('0xf')](_0x3128('0xc'),_0x2b42aa,_0x272a07);_0x4085b5(_0x272a07);});});} \ No newline at end of file +var _0xd5b8=['../../config/logger','rpc','../../config/environment','client','http','then','request\x20sent','stringify','error','code','ZohoField,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils'];(function(_0x2355a4,_0xc0b80d){var _0xe22dd=function(_0x43282c){while(--_0x43282c){_0x2355a4['push'](_0x2355a4['shift']());}};_0xe22dd(++_0xc0b80d);}(_0xd5b8,0xe0));var _0x8d5b=function(_0x567921,_0x490892){_0x567921=_0x567921-0x0;var _0x2b815a=_0xd5b8[_0x567921];return _0x2b815a;};'use strict';var _=require(_0x8d5b('0x0'));var util=require(_0x8d5b('0x1'));var moment=require(_0x8d5b('0x2'));var BPromise=require(_0x8d5b('0x3'));var rs=require(_0x8d5b('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8d5b('0x5'))['db'];var utils=require(_0x8d5b('0x6'));var logger=require(_0x8d5b('0x7'))(_0x8d5b('0x8'));var config=require(_0x8d5b('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x8d5b('0xa')][_0x8d5b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xbb0298,_0xe70fd,_0x113ebc){return new BPromise(function(_0x31bf91,_0x54367a){return client['request'](_0xbb0298,_0x113ebc)[_0x8d5b('0xc')](function(_0x1eeb8f){logger['info']('ZohoField,\x20%s,\x20%s',_0xe70fd,_0x8d5b('0xd'));logger['debug']('ZohoField,\x20%s,\x20%s,\x20%s',_0xe70fd,'request\x20sent',JSON[_0x8d5b('0xe')](_0x1eeb8f));if(_0x1eeb8f[_0x8d5b('0xf')]){if(_0x1eeb8f[_0x8d5b('0xf')][_0x8d5b('0x10')]===0x1f4){logger['error'](_0x8d5b('0x11'),_0xe70fd,_0x1eeb8f[_0x8d5b('0xf')][_0x8d5b('0x12')]);return _0x54367a(_0x1eeb8f[_0x8d5b('0xf')][_0x8d5b('0x12')]);}logger[_0x8d5b('0xf')](_0x8d5b('0x11'),_0xe70fd,_0x1eeb8f[_0x8d5b('0xf')]['message']);return _0x31bf91(_0x1eeb8f[_0x8d5b('0xf')]['message']);}else{logger['info'](_0x8d5b('0x11'),_0xe70fd,_0x8d5b('0xd'));_0x31bf91(_0x1eeb8f[_0x8d5b('0x13')]['message']);}})[_0x8d5b('0x14')](function(_0x3f17f4){logger[_0x8d5b('0xf')]('ZohoField,\x20%s,\x20%s',_0xe70fd,_0x3f17f4);_0x54367a(_0x3f17f4);});});} \ No newline at end of file diff --git a/server/api/integration/index.js b/server/api/integration/index.js index 7431e38..2edacbc 100644 --- a/server/api/integration/index.js +++ b/server/api/integration/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x37a0ab,_0x34b900){var _0x13ca1d=function(_0x3c6a41){while(--_0x3c6a41){_0x37a0ab['push'](_0x37a0ab['shift']());}};_0x13ca1d(++_0x34b900);}(_0x9c44,0x178));var _0x49c4=function(_0x3b0731,_0xcf9925){_0x3b0731=_0x3b0731-0x0;var _0x4204d7=_0x9c44[_0x3b0731];return _0x4204d7;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x49c4('0x6')]=router; \ No newline at end of file +var _0xedd9=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','exports'];(function(_0x37756c,_0x1f851d){var _0x87c98c=function(_0xc367cc){while(--_0xc367cc){_0x37756c['push'](_0x37756c['shift']());}};_0x87c98c(++_0x1f851d);}(_0xedd9,0xfc));var _0x9edd=function(_0x97bba6,_0x4662ee){_0x97bba6=_0x97bba6-0x0;var _0x1299f7=_0xedd9[_0x97bba6];return _0x1299f7;};'use strict';var multer=require('multer');var util=require(_0x9edd('0x0'));var path=require(_0x9edd('0x1'));var timeout=require(_0x9edd('0x2'));var express=require(_0x9edd('0x3'));var router=express[_0x9edd('0x4')]();var fs_extra=require(_0x9edd('0x5'));var auth=require(_0x9edd('0x6'));var interaction=require(_0x9edd('0x7'));var config=require('../../config/environment');module[_0x9edd('0x8')]=router; \ No newline at end of file diff --git a/server/api/integration/integration.attributes.js b/server/api/integration/integration.attributes.js index 9b0f9b9..df70a47 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 _0x9a6a=['state','exports','unique_name_and_version','STRING','app.js'];(function(_0x192ba7,_0x3aca74){var _0x5aa8bb=function(_0x23e4cd){while(--_0x23e4cd){_0x192ba7['push'](_0x192ba7['shift']());}};_0x5aa8bb(++_0x3aca74);}(_0x9a6a,0xce));var _0xa9a6=function(_0xcc683b,_0x1682e6){_0xcc683b=_0xcc683b-0x0;var _0x279201=_0x9a6a[_0xcc683b];return _0x279201;};'use strict';var Sequelize=require('sequelize');module[_0xa9a6('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xa9a6('0x1')},'version':{'type':Sequelize[_0xa9a6('0x2')],'allowNull':![],'unique':'unique_name_and_version'},'main':{'type':Sequelize[_0xa9a6('0x2')],'defaultValue':_0xa9a6('0x3')},'filename':{'type':Sequelize[_0xa9a6('0x2')]},'path':{'type':Sequelize[_0xa9a6('0x2')]},'type':{'type':Sequelize[_0xa9a6('0x2')]},'size':{'type':Sequelize['INTEGER']},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'author':{'type':Sequelize[_0xa9a6('0x2')]},'logo':{'type':Sequelize[_0xa9a6('0x2')]},'state':{'type':Sequelize[_0xa9a6('0x2')],'unique':_0xa9a6('0x4')},'description':{'type':Sequelize['STRING']},'title':{'type':Sequelize[_0xa9a6('0x2')]},'remoteUri':{'type':Sequelize[_0xa9a6('0x2')]},'link':{'type':Sequelize[_0xa9a6('0x2')],'defaultValue':'#'}}; \ No newline at end of file +var _0x2f90=['app.js','INTEGER','BOOLEAN','exports','STRING','unique_name_and_version'];(function(_0x38ff3a,_0x148119){var _0x111f2d=function(_0x55feee){while(--_0x55feee){_0x38ff3a['push'](_0x38ff3a['shift']());}};_0x111f2d(++_0x148119);}(_0x2f90,0x1e9));var _0x02f9=function(_0x3dfce7,_0x190b66){_0x3dfce7=_0x3dfce7-0x0;var _0x3f0e60=_0x2f90[_0x3dfce7];return _0x3f0e60;};'use strict';var Sequelize=require('sequelize');module[_0x02f9('0x0')]={'name':{'type':Sequelize[_0x02f9('0x1')],'allowNull':![],'unique':_0x02f9('0x2')},'version':{'type':Sequelize[_0x02f9('0x1')],'allowNull':![],'unique':_0x02f9('0x2')},'main':{'type':Sequelize[_0x02f9('0x1')],'defaultValue':_0x02f9('0x3')},'filename':{'type':Sequelize[_0x02f9('0x1')]},'path':{'type':Sequelize[_0x02f9('0x1')]},'type':{'type':Sequelize['STRING']},'size':{'type':Sequelize[_0x02f9('0x4')]},'active':{'type':Sequelize[_0x02f9('0x5')],'defaultValue':![]},'author':{'type':Sequelize[_0x02f9('0x1')]},'logo':{'type':Sequelize['STRING']},'state':{'type':Sequelize[_0x02f9('0x1')],'unique':'state'},'description':{'type':Sequelize[_0x02f9('0x1')]},'title':{'type':Sequelize[_0x02f9('0x1')]},'remoteUri':{'type':Sequelize[_0x02f9('0x1')]},'link':{'type':Sequelize[_0x02f9('0x1')],'defaultValue':'#'}}; \ No newline at end of file diff --git a/server/api/integration/integration.controller.js b/server/api/integration/integration.controller.js index 4d4fc5e..5beb00c 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 _0x5496=['../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','error','stack','name','index','Integration','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','attributes','length','hasOwnProperty','nolimit','offset','order','sort','pick','filter','where','merge','VIRTUAL','includeAll','rows','catch','show','params','keys','fields','include','options','find','create','body','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis'];(function(_0x2576d7,_0x167624){var _0x16a08c=function(_0x19de1e){while(--_0x19de1e){_0x2576d7['push'](_0x2576d7['shift']());}};_0x16a08c(++_0x167624);}(_0x5496,0x175));var _0x6549=function(_0x472ffa,_0x2abe9b){_0x472ffa=_0x472ffa-0x0;var _0x4ab47b=_0x5496[_0x472ffa];return _0x4ab47b;};'use strict';var emlformat=require(_0x6549('0x0'));var rimraf=require(_0x6549('0x1'));var zipdir=require(_0x6549('0x2'));var jsonpatch=require(_0x6549('0x3'));var rp=require(_0x6549('0x4'));var moment=require('moment');var BPromise=require(_0x6549('0x5'));var Mustache=require('mustache');var util=require(_0x6549('0x6'));var path=require(_0x6549('0x7'));var sox=require(_0x6549('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6549('0x9'));var _=require(_0x6549('0xa'));var squel=require('squel');var crypto=require(_0x6549('0xb'));var jsforce=require(_0x6549('0xc'));var deskjs=require(_0x6549('0xd'));var toCsv=require('to-csv');var querystring=require(_0x6549('0xe'));var Papa=require(_0x6549('0xf'));var Redis=require(_0x6549('0x10'));var authService=require(_0x6549('0x11'));var qs=require(_0x6549('0x12'));var as=require(_0x6549('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x6549('0x14'));var utils=require(_0x6549('0x15'));var config=require(_0x6549('0x16'));var licenseUtil=require(_0x6549('0x17'));var db=require(_0x6549('0x18'))['db'];function respondWithStatusCode(_0x5bc018,_0x4dfb06){_0x4dfb06=_0x4dfb06||0xcc;return function(_0x3f844f){if(_0x3f844f){return _0x5bc018[_0x6549('0x19')](_0x4dfb06);}return _0x5bc018['status'](_0x4dfb06)[_0x6549('0x1a')]();};}function respondWithResult(_0x150fc8,_0x195d25){_0x195d25=_0x195d25||0xc8;return function(_0x12b068){if(_0x12b068){return _0x150fc8[_0x6549('0x1b')](_0x195d25)[_0x6549('0x1c')](_0x12b068);}};}function respondWithFilteredResult(_0x55c112,_0x5db86d){return function(_0x384f75){if(_0x384f75){var _0x25da29=typeof _0x5db86d['offset']===_0x6549('0x1d')&&typeof _0x5db86d[_0x6549('0x1e')]===_0x6549('0x1d');var _0x387e60=_0x384f75[_0x6549('0x1f')];var _0x53b12b=_0x25da29?0x0:_0x5db86d['offset'];var _0x26a212=_0x25da29?_0x384f75['count']:_0x5db86d['offset']+_0x5db86d[_0x6549('0x1e')];var _0x1e5079;if(_0x26a212>=_0x387e60){_0x26a212=_0x387e60;_0x1e5079=0xc8;}else{_0x1e5079=0xce;}_0x55c112[_0x6549('0x1b')](_0x1e5079);return _0x55c112[_0x6549('0x20')](_0x6549('0x21'),_0x53b12b+'-'+_0x26a212+'/'+_0x387e60)['json'](_0x384f75);}return null;};}function patchUpdates(_0x228117){return function(_0x4b40c1){try{jsonpatch[_0x6549('0x22')](_0x4b40c1,_0x228117,!![]);}catch(_0x72322b){return BPromise[_0x6549('0x23')](_0x72322b);}return _0x4b40c1[_0x6549('0x24')]();};}function saveUpdates(_0x22bcf8,_0x12d547){return function(_0x427b47){if(_0x427b47){return _0x427b47[_0x6549('0x25')](_0x22bcf8)[_0x6549('0x26')](function(_0x6ae00c){return _0x6ae00c;});}return null;};}function removeEntity(_0x40d3f9,_0x1fbfa4){return function(_0x23c0ba){if(_0x23c0ba){return _0x23c0ba['destroy']()[_0x6549('0x26')](function(){_0x40d3f9[_0x6549('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x126967,_0x29f89e){return function(_0x3768cb){if(!_0x3768cb){_0x126967['sendStatus'](0x194);}return _0x3768cb;};}function handleError(_0x31a95,_0xfb51a1){_0xfb51a1=_0xfb51a1||0x1f4;return function(_0x14de1f){logger[_0x6549('0x27')](_0x14de1f[_0x6549('0x28')]);if(_0x14de1f[_0x6549('0x29')]){delete _0x14de1f[_0x6549('0x29')];}_0x31a95[_0x6549('0x1b')](_0xfb51a1)['send'](_0x14de1f);};}exports[_0x6549('0x2a')]=function(_0x136518,_0x17fdfb){var _0x4c605c={},_0x3f1502={},_0x4acaf5={'count':0x0,'rows':[]};var _0x4f0ad1=_['map'](db[_0x6549('0x2b')][_0x6549('0x2c')],function(_0x4f3069){return{'name':_0x4f3069[_0x6549('0x2d')],'type':_0x4f3069[_0x6549('0x2e')][_0x6549('0x2f')]};});_0x3f1502[_0x6549('0x30')]=_[_0x6549('0x31')](_0x4f0ad1,_0x6549('0x29'));_0x3f1502[_0x6549('0x32')]=_['keys'](_0x136518[_0x6549('0x32')]);_0x3f1502[_0x6549('0x33')]=_[_0x6549('0x34')](_0x3f1502[_0x6549('0x30')],_0x3f1502[_0x6549('0x32')]);_0x4c605c[_0x6549('0x35')]=_['intersection'](_0x3f1502[_0x6549('0x30')],qs['fields'](_0x136518[_0x6549('0x32')]['fields']));_0x4c605c[_0x6549('0x35')]=_0x4c605c[_0x6549('0x35')][_0x6549('0x36')]?_0x4c605c['attributes']:_0x3f1502[_0x6549('0x30')];if(!_0x136518[_0x6549('0x32')][_0x6549('0x37')](_0x6549('0x38'))){_0x4c605c['limit']=qs['limit'](_0x136518['query'][_0x6549('0x1e')]);_0x4c605c[_0x6549('0x39')]=qs['offset'](_0x136518[_0x6549('0x32')][_0x6549('0x39')]);}_0x4c605c[_0x6549('0x3a')]=qs[_0x6549('0x3b')](_0x136518[_0x6549('0x32')]['sort']);_0x4c605c['where']=qs[_0x6549('0x33')](_[_0x6549('0x3c')](_0x136518[_0x6549('0x32')],_0x3f1502[_0x6549('0x33')]),_0x4f0ad1);if(_0x136518[_0x6549('0x32')][_0x6549('0x3d')]){_0x4c605c[_0x6549('0x3e')]=_[_0x6549('0x3f')](_0x4c605c[_0x6549('0x3e')],{'$or':_[_0x6549('0x31')](_0x4f0ad1,function(_0x525f82){if(_0x525f82[_0x6549('0x2e')]!==_0x6549('0x40')){var _0x2ea977={};_0x2ea977[_0x525f82[_0x6549('0x29')]]={'$like':'%'+_0x136518[_0x6549('0x32')]['filter']+'%'};return _0x2ea977;}})});}_0x4c605c=_['merge']({},_0x4c605c,_0x136518['options']);var _0x22b919={'where':_0x4c605c[_0x6549('0x3e')]};return db[_0x6549('0x2b')][_0x6549('0x1f')](_0x22b919)['then'](function(_0x56ce9f){_0x4acaf5[_0x6549('0x1f')]=_0x56ce9f;if(_0x136518[_0x6549('0x32')][_0x6549('0x41')]){_0x4c605c['include']=[{'all':!![]}];}return db[_0x6549('0x2b')]['findAll'](_0x4c605c);})[_0x6549('0x26')](function(_0x2ec614){_0x4acaf5[_0x6549('0x42')]=_0x2ec614;return _0x4acaf5;})[_0x6549('0x26')](respondWithFilteredResult(_0x17fdfb,_0x4c605c))[_0x6549('0x43')](handleError(_0x17fdfb,null));};exports[_0x6549('0x44')]=function(_0xbbfdc9,_0x4deaab){var _0x132625={'raw':![],'where':{'id':_0xbbfdc9[_0x6549('0x45')]['id']}},_0x309f45={};_0x309f45[_0x6549('0x30')]=_[_0x6549('0x46')](db[_0x6549('0x2b')][_0x6549('0x2c')]);_0x309f45[_0x6549('0x32')]=_[_0x6549('0x46')](_0xbbfdc9[_0x6549('0x32')]);_0x309f45[_0x6549('0x33')]=_[_0x6549('0x34')](_0x309f45[_0x6549('0x30')],_0x309f45[_0x6549('0x32')]);_0x132625[_0x6549('0x35')]=_[_0x6549('0x34')](_0x309f45['model'],qs[_0x6549('0x47')](_0xbbfdc9[_0x6549('0x32')][_0x6549('0x47')]));_0x132625[_0x6549('0x35')]=_0x132625['attributes'][_0x6549('0x36')]?_0x132625['attributes']:_0x309f45[_0x6549('0x30')];if(_0xbbfdc9[_0x6549('0x32')]['includeAll']){_0x132625[_0x6549('0x48')]=[{'all':!![]}];}_0x132625=_[_0x6549('0x3f')]({},_0x132625,_0xbbfdc9[_0x6549('0x49')]);return db[_0x6549('0x2b')][_0x6549('0x4a')](_0x132625)['then'](handleEntityNotFound(_0x4deaab,null))['then'](respondWithResult(_0x4deaab,null))[_0x6549('0x43')](handleError(_0x4deaab,null));};exports[_0x6549('0x4b')]=function(_0x41d675,_0x1712f3){return db[_0x6549('0x2b')]['create'](_0x41d675[_0x6549('0x4c')],{})[_0x6549('0x26')](respondWithResult(_0x1712f3,0xc9))[_0x6549('0x43')](handleError(_0x1712f3,null));};exports[_0x6549('0x25')]=function(_0xa4c650,_0x25a6ee){if(_0xa4c650[_0x6549('0x4c')]['id']){delete _0xa4c650[_0x6549('0x4c')]['id'];}return db['Integration'][_0x6549('0x4a')]({'where':{'id':_0xa4c650['params']['id']}})[_0x6549('0x26')](handleEntityNotFound(_0x25a6ee,null))[_0x6549('0x26')](saveUpdates(_0xa4c650[_0x6549('0x4c')],null))['then'](respondWithResult(_0x25a6ee,null))[_0x6549('0x43')](handleError(_0x25a6ee,null));};exports[_0x6549('0x4d')]=function(_0x2ef4d2,_0x5300c8){return db[_0x6549('0x2b')][_0x6549('0x4a')]({'where':{'id':_0x2ef4d2[_0x6549('0x45')]['id']}})[_0x6549('0x26')](handleEntityNotFound(_0x5300c8,null))[_0x6549('0x26')](removeEntity(_0x5300c8,null))[_0x6549('0x43')](handleError(_0x5300c8,null));}; \ No newline at end of file +var _0x5fab=['querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','destroy','end','sendStatus','name','send','index','map','Integration','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','VIRTUAL','filter','includeAll','include','findAll','then','rows','show','params','intersection','fields','options','find','catch','create','body','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce'];(function(_0x171ca9,_0x2bb32d){var _0x31668f=function(_0x437a37){while(--_0x437a37){_0x171ca9['push'](_0x171ca9['shift']());}};_0x31668f(++_0x2bb32d);}(_0x5fab,0x177));var _0xb5fa=function(_0x1273bb,_0x193a23){_0x1273bb=_0x1273bb-0x0;var _0x107662=_0x5fab[_0x1273bb];return _0x107662;};'use strict';var emlformat=require(_0xb5fa('0x0'));var rimraf=require(_0xb5fa('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb5fa('0x2'));var rp=require(_0xb5fa('0x3'));var moment=require(_0xb5fa('0x4'));var BPromise=require(_0xb5fa('0x5'));var Mustache=require(_0xb5fa('0x6'));var util=require(_0xb5fa('0x7'));var path=require(_0xb5fa('0x8'));var sox=require(_0xb5fa('0x9'));var csv=require(_0xb5fa('0xa'));var ejs=require(_0xb5fa('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xb5fa('0xc'));var crypto=require(_0xb5fa('0xd'));var jsforce=require(_0xb5fa('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xb5fa('0xa'));var querystring=require(_0xb5fa('0xf'));var Papa=require(_0xb5fa('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xb5fa('0x11'));var as=require(_0xb5fa('0x12'));var hardwareService=require(_0xb5fa('0x13'));var logger=require(_0xb5fa('0x14'))(_0xb5fa('0x15'));var utils=require(_0xb5fa('0x16'));var config=require(_0xb5fa('0x17'));var licenseUtil=require(_0xb5fa('0x18'));var db=require(_0xb5fa('0x19'))['db'];function respondWithStatusCode(_0x4d3576,_0x2ad830){_0x2ad830=_0x2ad830||0xcc;return function(_0x3dad4d){if(_0x3dad4d){return _0x4d3576['sendStatus'](_0x2ad830);}return _0x4d3576[_0xb5fa('0x1a')](_0x2ad830)['end']();};}function respondWithResult(_0x265992,_0x3fc372){_0x3fc372=_0x3fc372||0xc8;return function(_0x40c914){if(_0x40c914){return _0x265992[_0xb5fa('0x1a')](_0x3fc372)[_0xb5fa('0x1b')](_0x40c914);}};}function respondWithFilteredResult(_0x5371cf,_0x567f31){return function(_0x38e964){if(_0x38e964){var _0x587043=typeof _0x567f31[_0xb5fa('0x1c')]===_0xb5fa('0x1d')&&typeof _0x567f31['limit']==='undefined';var _0x451a55=_0x38e964[_0xb5fa('0x1e')];var _0x32e9e5=_0x587043?0x0:_0x567f31[_0xb5fa('0x1c')];var _0x324ba5=_0x587043?_0x38e964[_0xb5fa('0x1e')]:_0x567f31[_0xb5fa('0x1c')]+_0x567f31[_0xb5fa('0x1f')];var _0xc14dc4;if(_0x324ba5>=_0x451a55){_0x324ba5=_0x451a55;_0xc14dc4=0xc8;}else{_0xc14dc4=0xce;}_0x5371cf[_0xb5fa('0x1a')](_0xc14dc4);return _0x5371cf[_0xb5fa('0x20')](_0xb5fa('0x21'),_0x32e9e5+'-'+_0x324ba5+'/'+_0x451a55)['json'](_0x38e964);}return null;};}function patchUpdates(_0x432bfa){return function(_0x519e20){try{jsonpatch[_0xb5fa('0x22')](_0x519e20,_0x432bfa,!![]);}catch(_0x4a6c04){return BPromise[_0xb5fa('0x23')](_0x4a6c04);}return _0x519e20[_0xb5fa('0x24')]();};}function saveUpdates(_0x4e05c0,_0x40dfdf){return function(_0x3a2ab9){if(_0x3a2ab9){return _0x3a2ab9[_0xb5fa('0x25')](_0x4e05c0)['then'](function(_0x32a85c){return _0x32a85c;});}return null;};}function removeEntity(_0xec108f,_0x444237){return function(_0x542348){if(_0x542348){return _0x542348[_0xb5fa('0x26')]()['then'](function(){_0xec108f[_0xb5fa('0x1a')](0xcc)[_0xb5fa('0x27')]();});}};}function handleEntityNotFound(_0x11053a,_0x543edf){return function(_0x2dbd22){if(!_0x2dbd22){_0x11053a[_0xb5fa('0x28')](0x194);}return _0x2dbd22;};}function handleError(_0x6a455c,_0x20d649){_0x20d649=_0x20d649||0x1f4;return function(_0x568870){logger['error'](_0x568870['stack']);if(_0x568870['name']){delete _0x568870[_0xb5fa('0x29')];}_0x6a455c[_0xb5fa('0x1a')](_0x20d649)[_0xb5fa('0x2a')](_0x568870);};}exports[_0xb5fa('0x2b')]=function(_0x534884,_0x3506a4){var _0x358549={},_0x353314={},_0x409af9={'count':0x0,'rows':[]};var _0x2a5690=_[_0xb5fa('0x2c')](db[_0xb5fa('0x2d')][_0xb5fa('0x2e')],function(_0x1f4380){return{'name':_0x1f4380[_0xb5fa('0x2f')],'type':_0x1f4380[_0xb5fa('0x30')][_0xb5fa('0x31')]};});_0x353314[_0xb5fa('0x32')]=_[_0xb5fa('0x2c')](_0x2a5690,_0xb5fa('0x29'));_0x353314[_0xb5fa('0x33')]=_[_0xb5fa('0x34')](_0x534884[_0xb5fa('0x33')]);_0x353314[_0xb5fa('0x35')]=_['intersection'](_0x353314[_0xb5fa('0x32')],_0x353314['query']);_0x358549['attributes']=_['intersection'](_0x353314[_0xb5fa('0x32')],qs['fields'](_0x534884[_0xb5fa('0x33')]['fields']));_0x358549['attributes']=_0x358549[_0xb5fa('0x36')][_0xb5fa('0x37')]?_0x358549['attributes']:_0x353314['model'];if(!_0x534884[_0xb5fa('0x33')][_0xb5fa('0x38')](_0xb5fa('0x39'))){_0x358549['limit']=qs[_0xb5fa('0x1f')](_0x534884[_0xb5fa('0x33')]['limit']);_0x358549[_0xb5fa('0x1c')]=qs[_0xb5fa('0x1c')](_0x534884[_0xb5fa('0x33')]['offset']);}_0x358549[_0xb5fa('0x3a')]=qs[_0xb5fa('0x3b')](_0x534884[_0xb5fa('0x33')]['sort']);_0x358549[_0xb5fa('0x3c')]=qs[_0xb5fa('0x35')](_[_0xb5fa('0x3d')](_0x534884[_0xb5fa('0x33')],_0x353314['filters']),_0x2a5690);if(_0x534884['query']['filter']){_0x358549['where']=_['merge'](_0x358549['where'],{'$or':_[_0xb5fa('0x2c')](_0x2a5690,function(_0x4c0a4d){if(_0x4c0a4d[_0xb5fa('0x30')]!==_0xb5fa('0x3e')){var _0x36db1a={};_0x36db1a[_0x4c0a4d[_0xb5fa('0x29')]]={'$like':'%'+_0x534884[_0xb5fa('0x33')][_0xb5fa('0x3f')]+'%'};return _0x36db1a;}})});}_0x358549=_['merge']({},_0x358549,_0x534884['options']);var _0x4c4bf0={'where':_0x358549[_0xb5fa('0x3c')]};return db['Integration'][_0xb5fa('0x1e')](_0x4c4bf0)['then'](function(_0x58aa97){_0x409af9[_0xb5fa('0x1e')]=_0x58aa97;if(_0x534884[_0xb5fa('0x33')][_0xb5fa('0x40')]){_0x358549[_0xb5fa('0x41')]=[{'all':!![]}];}return db[_0xb5fa('0x2d')][_0xb5fa('0x42')](_0x358549);})[_0xb5fa('0x43')](function(_0x83df0b){_0x409af9[_0xb5fa('0x44')]=_0x83df0b;return _0x409af9;})[_0xb5fa('0x43')](respondWithFilteredResult(_0x3506a4,_0x358549))['catch'](handleError(_0x3506a4,null));};exports[_0xb5fa('0x45')]=function(_0x4bc9df,_0x233f90){var _0x39aac3={'raw':![],'where':{'id':_0x4bc9df[_0xb5fa('0x46')]['id']}},_0x2c7c5f={};_0x2c7c5f[_0xb5fa('0x32')]=_[_0xb5fa('0x34')](db[_0xb5fa('0x2d')][_0xb5fa('0x2e')]);_0x2c7c5f['query']=_[_0xb5fa('0x34')](_0x4bc9df[_0xb5fa('0x33')]);_0x2c7c5f['filters']=_[_0xb5fa('0x47')](_0x2c7c5f['model'],_0x2c7c5f[_0xb5fa('0x33')]);_0x39aac3[_0xb5fa('0x36')]=_['intersection'](_0x2c7c5f['model'],qs[_0xb5fa('0x48')](_0x4bc9df[_0xb5fa('0x33')][_0xb5fa('0x48')]));_0x39aac3[_0xb5fa('0x36')]=_0x39aac3[_0xb5fa('0x36')][_0xb5fa('0x37')]?_0x39aac3[_0xb5fa('0x36')]:_0x2c7c5f[_0xb5fa('0x32')];if(_0x4bc9df['query'][_0xb5fa('0x40')]){_0x39aac3[_0xb5fa('0x41')]=[{'all':!![]}];}_0x39aac3=_['merge']({},_0x39aac3,_0x4bc9df[_0xb5fa('0x49')]);return db[_0xb5fa('0x2d')][_0xb5fa('0x4a')](_0x39aac3)[_0xb5fa('0x43')](handleEntityNotFound(_0x233f90,null))[_0xb5fa('0x43')](respondWithResult(_0x233f90,null))[_0xb5fa('0x4b')](handleError(_0x233f90,null));};exports[_0xb5fa('0x4c')]=function(_0x33eb2c,_0x20f5f5){return db[_0xb5fa('0x2d')][_0xb5fa('0x4c')](_0x33eb2c[_0xb5fa('0x4d')],{})[_0xb5fa('0x43')](respondWithResult(_0x20f5f5,0xc9))[_0xb5fa('0x4b')](handleError(_0x20f5f5,null));};exports[_0xb5fa('0x25')]=function(_0x3a39f2,_0x52f5d8){if(_0x3a39f2['body']['id']){delete _0x3a39f2[_0xb5fa('0x4d')]['id'];}return db['Integration'][_0xb5fa('0x4a')]({'where':{'id':_0x3a39f2[_0xb5fa('0x46')]['id']}})['then'](handleEntityNotFound(_0x52f5d8,null))[_0xb5fa('0x43')](saveUpdates(_0x3a39f2[_0xb5fa('0x4d')],null))[_0xb5fa('0x43')](respondWithResult(_0x52f5d8,null))[_0xb5fa('0x4b')](handleError(_0x52f5d8,null));};exports[_0xb5fa('0x26')]=function(_0x3ffee0,_0x51d5f7){return db[_0xb5fa('0x2d')]['find']({'where':{'id':_0x3ffee0[_0xb5fa('0x46')]['id']}})[_0xb5fa('0x43')](handleEntityNotFound(_0x51d5f7,null))[_0xb5fa('0x43')](removeEntity(_0x51d5f7,null))['catch'](handleError(_0x51d5f7,null));}; \ No newline at end of file diff --git a/server/api/integration/integration.model.js b/server/api/integration/integration.model.js index 43fa66c..1a14a82 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 _0x7ae8=['bluebird','rimraf','../../config/environment','./integration.attributes','exports','define','integrations','../../config/logger','api','moment'];(function(_0x1b9ffa,_0x26ff29){var _0x18d411=function(_0x2f276b){while(--_0x2f276b){_0x1b9ffa['push'](_0x1b9ffa['shift']());}};_0x18d411(++_0x26ff29);}(_0x7ae8,0x75));var _0x87ae=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x7ae8[_0x14add3];return _0x4a174f;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x87ae('0x0'))(_0x87ae('0x1'));var moment=require(_0x87ae('0x2'));var BPromise=require(_0x87ae('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x87ae('0x4'));var config=require(_0x87ae('0x5'));var attributes=require(_0x87ae('0x6'));module[_0x87ae('0x7')]=function(_0x3706e1,_0x11eb63){return _0x3706e1[_0x87ae('0x8')]('Integration',attributes,{'tableName':_0x87ae('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6731=['path','rimraf','../../config/environment','exports','Integration','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x3b0731,_0xcf9925){var _0x4204d7=function(_0x635ac5){while(--_0x635ac5){_0x3b0731['push'](_0x3b0731['shift']());}};_0x4204d7(++_0xcf9925);}(_0x6731,0x165));var _0x1673=function(_0x118749,_0x50e848){_0x118749=_0x118749-0x0;var _0x20d489=_0x6731[_0x118749];return _0x20d489;};'use strict';var _=require(_0x1673('0x0'));var util=require(_0x1673('0x1'));var logger=require(_0x1673('0x2'))(_0x1673('0x3'));var moment=require(_0x1673('0x4'));var BPromise=require(_0x1673('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1673('0x6'));var rimraf=require(_0x1673('0x7'));var config=require(_0x1673('0x8'));var attributes=require('./integration.attributes');module[_0x1673('0x9')]=function(_0x338051,_0x48cb35){return _0x338051['define'](_0x1673('0xa'),attributes,{'tableName':'integrations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/integration/integration.rpc.js b/server/api/integration/integration.rpc.js index 56d4d9c..39bcafe 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 _0xd7d1=['info','Integration,\x20%s,\x20%s','request\x20sent','Integration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then'];(function(_0xc3a71f,_0x54fe71){var _0x46a474=function(_0x47e601){while(--_0x47e601){_0xc3a71f['push'](_0xc3a71f['shift']());}};_0x46a474(++_0x54fe71);}(_0xd7d1,0x1b3));var _0x1d7d=function(_0x8f236b,_0x23c878){_0x8f236b=_0x8f236b-0x0;var _0x517612=_0xd7d1[_0x8f236b];return _0x517612;};'use strict';var _=require(_0x1d7d('0x0'));var util=require(_0x1d7d('0x1'));var moment=require(_0x1d7d('0x2'));var BPromise=require(_0x1d7d('0x3'));var rs=require(_0x1d7d('0x4'));var fs=require('fs');var Redis=require(_0x1d7d('0x5'));var db=require(_0x1d7d('0x6'))['db'];var utils=require(_0x1d7d('0x7'));var logger=require(_0x1d7d('0x8'))(_0x1d7d('0x9'));var config=require(_0x1d7d('0xa'));var jayson=require(_0x1d7d('0xb'));var client=jayson[_0x1d7d('0xc')]['http']({'port':0x232a});function respondWithRpcPromise(_0x462ef8,_0x1aa456,_0x14dbf6){return new BPromise(function(_0x3675a2,_0xd6189e){return client[_0x1d7d('0xd')](_0x462ef8,_0x14dbf6)[_0x1d7d('0xe')](function(_0xa44223){logger[_0x1d7d('0xf')](_0x1d7d('0x10'),_0x1aa456,_0x1d7d('0x11'));logger['debug'](_0x1d7d('0x12'),_0x1aa456,'request\x20sent',JSON[_0x1d7d('0x13')](_0xa44223));if(_0xa44223[_0x1d7d('0x14')]){if(_0xa44223[_0x1d7d('0x14')][_0x1d7d('0x15')]===0x1f4){logger['error'](_0x1d7d('0x10'),_0x1aa456,_0xa44223['error']['message']);return _0xd6189e(_0xa44223[_0x1d7d('0x14')][_0x1d7d('0x16')]);}logger['error']('Integration,\x20%s,\x20%s',_0x1aa456,_0xa44223[_0x1d7d('0x14')][_0x1d7d('0x16')]);return _0x3675a2(_0xa44223[_0x1d7d('0x14')][_0x1d7d('0x16')]);}else{logger[_0x1d7d('0xf')]('Integration,\x20%s,\x20%s',_0x1aa456,_0x1d7d('0x11'));_0x3675a2(_0xa44223[_0x1d7d('0x17')]['message']);}})[_0x1d7d('0x18')](function(_0x162c3a){logger[_0x1d7d('0x14')](_0x1d7d('0x10'),_0x1aa456,_0x162c3a);_0xd6189e(_0x162c3a);});});} \ No newline at end of file +var _0xdb28=['moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','Integration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','catch','lodash','util'];(function(_0x23f950,_0x2ea803){var _0x54df37=function(_0x1b12d7){while(--_0x1b12d7){_0x23f950['push'](_0x23f950['shift']());}};_0x54df37(++_0x2ea803);}(_0xdb28,0x106));var _0x8db2=function(_0x4cc417,_0x1bd55a){_0x4cc417=_0x4cc417-0x0;var _0x440343=_0xdb28[_0x4cc417];return _0x440343;};'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')]('Integration,\x20%s,\x20%s,\x20%s',_0x477f50,_0x8db2('0xe'),JSON[_0x8db2('0x10')](_0x126c78));if(_0x126c78['error']){if(_0x126c78[_0x8db2('0x11')][_0x8db2('0x12')]===0x1f4){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')]['message']);return _0x29f698(_0x126c78['error'][_0x8db2('0x13')]);}logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);return _0x131537(_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);}else{logger[_0x8db2('0x14')](_0x8db2('0xd'),_0x477f50,_0x8db2('0xe'));_0x131537(_0x126c78['result'][_0x8db2('0x13')]);}})[_0x8db2('0x15')](function(_0x48101e){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x48101e);_0x29f698(_0x48101e);});});} \ No newline at end of file diff --git a/server/api/integrationReport/index.js b/server/api/integrationReport/index.js index 704709c..88e6977 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 _0x9f0e=['path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./integrationReport.controller','get','/describe','isAuthenticated','/:id','show','post','create','put','update','delete','destroy','multer','util'];(function(_0x5cd8c2,_0x4bc8ee){var _0x4d2440=function(_0xd55420){while(--_0xd55420){_0x5cd8c2['push'](_0x5cd8c2['shift']());}};_0x4d2440(++_0x4bc8ee);}(_0x9f0e,0x116));var _0xe9f0=function(_0x4a84f1,_0x4d1b28){_0x4a84f1=_0x4a84f1-0x0;var _0x7d0597=_0x9f0e[_0x4a84f1];return _0x7d0597;};'use strict';var multer=require(_0xe9f0('0x0'));var util=require(_0xe9f0('0x1'));var path=require(_0xe9f0('0x2'));var timeout=require(_0xe9f0('0x3'));var express=require(_0xe9f0('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xe9f0('0x5'));var interaction=require(_0xe9f0('0x6'));var config=require(_0xe9f0('0x7'));var controller=require(_0xe9f0('0x8'));router[_0xe9f0('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0xe9f0('0x9')](_0xe9f0('0xa'),auth[_0xe9f0('0xb')](),controller['describe']);router[_0xe9f0('0x9')](_0xe9f0('0xc'),auth[_0xe9f0('0xb')](),controller[_0xe9f0('0xd')]);router[_0xe9f0('0xe')]('/',auth[_0xe9f0('0xb')](),controller[_0xe9f0('0xf')]);router[_0xe9f0('0x10')](_0xe9f0('0xc'),auth['isAuthenticated'](),controller[_0xe9f0('0x11')]);router[_0xe9f0('0x12')](_0xe9f0('0xc'),auth['isAuthenticated'](),controller[_0xe9f0('0x13')]);module['exports']=router; \ No newline at end of file +var _0x524e=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./integrationReport.controller','get','index','/describe','describe','/:id','isAuthenticated','show','post','create','put','update','delete','destroy','path','connect-timeout'];(function(_0x1cf863,_0x9fb77b){var _0x17d963=function(_0x3041f4){while(--_0x3041f4){_0x1cf863['push'](_0x1cf863['shift']());}};_0x17d963(++_0x9fb77b);}(_0x524e,0x15e));var _0xe524=function(_0x2c1d94,_0x408b03){_0x2c1d94=_0x2c1d94-0x0;var _0x2fcc5c=_0x524e[_0x2c1d94];return _0x2fcc5c;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xe524('0x0'));var timeout=require(_0xe524('0x1'));var express=require(_0xe524('0x2'));var router=express[_0xe524('0x3')]();var fs_extra=require(_0xe524('0x4'));var auth=require(_0xe524('0x5'));var interaction=require(_0xe524('0x6'));var config=require(_0xe524('0x7'));var controller=require(_0xe524('0x8'));router[_0xe524('0x9')]('/',auth['isAuthenticated'](),controller[_0xe524('0xa')]);router[_0xe524('0x9')](_0xe524('0xb'),auth['isAuthenticated'](),controller[_0xe524('0xc')]);router[_0xe524('0x9')](_0xe524('0xd'),auth[_0xe524('0xe')](),controller[_0xe524('0xf')]);router[_0xe524('0x10')]('/',auth[_0xe524('0xe')](),controller[_0xe524('0x11')]);router[_0xe524('0x12')](_0xe524('0xd'),auth[_0xe524('0xe')](),controller[_0xe524('0x13')]);router[_0xe524('0x14')](_0xe524('0xd'),auth[_0xe524('0xe')](),controller[_0xe524('0x15')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.attributes.js b/server/api/integrationReport/integrationReport.attributes.js index 2ab8581..afeb9e0 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 _0xb8fb=['DATE','BOOLEAN','TEXT','ENUM','SENT','SENDING','RECEIVED','FAILED','sequelize','exports','STRING','INTEGER'];(function(_0x2ecb67,_0x8ec62d){var _0x168079=function(_0x56c365){while(--_0x56c365){_0x2ecb67['push'](_0x2ecb67['shift']());}};_0x168079(++_0x8ec62d);}(_0xb8fb,0xa4));var _0xbb8f=function(_0x353c76,_0x395249){_0x353c76=_0x353c76-0x0;var _0x1c18b4=_0xb8fb[_0x353c76];return _0x1c18b4;};'use strict';var Sequelize=require(_0xbb8f('0x0'));module[_0xbb8f('0x1')]={'integration':{'type':Sequelize['STRING']},'eventChannel':{'type':Sequelize[_0xbb8f('0x2')]},'exitStatus':{'type':Sequelize[_0xbb8f('0x2')]},'ticketId':{'type':Sequelize[_0xbb8f('0x2')]},'integrationId':{'type':Sequelize[_0xbb8f('0x3')]},'contacts':{'type':Sequelize[_0xbb8f('0x2')]},'uniqueid':{'type':Sequelize[_0xbb8f('0x2')]},'calleridnum':{'type':Sequelize[_0xbb8f('0x2')]},'calleridname':{'type':Sequelize[_0xbb8f('0x2')]},'queue':{'type':Sequelize['STRING']},'interface':{'type':Sequelize[_0xbb8f('0x2')]},'membername':{'type':Sequelize[_0xbb8f('0x2')]},'agentcalledAt':{'type':Sequelize[_0xbb8f('0x4')]},'agentconnectAt':{'type':Sequelize['DATE']},'holdtime':{'type':Sequelize['INTEGER']},'agentcomplete':{'type':Sequelize[_0xbb8f('0x5')],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0xbb8f('0x4')]},'talktime':{'type':Sequelize[_0xbb8f('0x3')]},'agentacw':{'type':Sequelize[_0xbb8f('0x5')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0xbb8f('0x3')]},'reason':{'type':Sequelize[_0xbb8f('0x2')]},'agentringnoanswer':{'type':Sequelize[_0xbb8f('0x5')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize['DATE']},'agentdump':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0xbb8f('0x4')]},'lastevent':{'type':Sequelize[_0xbb8f('0x2')]},'channel':{'type':Sequelize[_0xbb8f('0x2')]},'channelstate':{'type':Sequelize[_0xbb8f('0x3')]},'channelstatedesc':{'type':Sequelize[_0xbb8f('0x2')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0xbb8f('0x2')]},'accountcode':{'type':Sequelize[_0xbb8f('0x2')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0xbb8f('0x2')]},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize['INTEGER']},'destchannelstatedesc':{'type':Sequelize[_0xbb8f('0x2')]},'destcalleridnum':{'type':Sequelize[_0xbb8f('0x2')]},'destcalleridname':{'type':Sequelize[_0xbb8f('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0xbb8f('0x2')]},'destconnectedlinename':{'type':Sequelize[_0xbb8f('0x2')]},'destlanguage':{'type':Sequelize[_0xbb8f('0x2')]},'destaccountcode':{'type':Sequelize[_0xbb8f('0x2')]},'destcontext':{'type':Sequelize['STRING']},'destexten':{'type':Sequelize[_0xbb8f('0x2')]},'destpriority':{'type':Sequelize[_0xbb8f('0x2')]},'destuniqueid':{'type':Sequelize[_0xbb8f('0x2')]},'messageId':{'type':Sequelize['STRING']},'inReplyTo':{'type':Sequelize['STRING']},'subject':{'type':Sequelize[_0xbb8f('0x2')]},'from':{'type':Sequelize['STRING']},'to':{'type':Sequelize['STRING']},'cc':{'type':Sequelize[_0xbb8f('0x2')]},'attachment':{'type':Sequelize[_0xbb8f('0x6')]},'html':{'type':Sequelize['TEXT']},'text':{'type':Sequelize['TEXT']},'status':{'type':Sequelize[_0xbb8f('0x7')](_0xbb8f('0x8'),_0xbb8f('0x9'),_0xbb8f('0xa'),_0xbb8f('0xb'))},'url':{'type':Sequelize[_0xbb8f('0x2')]},'app':{'type':Sequelize[_0xbb8f('0x2')]},'appdata':{'type':Sequelize[_0xbb8f('0x2')]},'projectId':{'type':Sequelize[_0xbb8f('0x3')]}}; \ No newline at end of file +var _0xad1e=['sequelize','exports','STRING','INTEGER','DATE','BOOLEAN','TEXT','ENUM','SENT','SENDING','RECEIVED'];(function(_0x123293,_0x434868){var _0x1e0af1=function(_0x2c6ddd){while(--_0x2c6ddd){_0x123293['push'](_0x123293['shift']());}};_0x1e0af1(++_0x434868);}(_0xad1e,0xb0));var _0xead1=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0xad1e[_0x4a9fb1];return _0x348672;};'use strict';var Sequelize=require(_0xead1('0x0'));module[_0xead1('0x1')]={'integration':{'type':Sequelize[_0xead1('0x2')]},'eventChannel':{'type':Sequelize['STRING']},'exitStatus':{'type':Sequelize[_0xead1('0x2')]},'ticketId':{'type':Sequelize[_0xead1('0x2')]},'integrationId':{'type':Sequelize[_0xead1('0x3')]},'contacts':{'type':Sequelize[_0xead1('0x2')]},'uniqueid':{'type':Sequelize[_0xead1('0x2')]},'calleridnum':{'type':Sequelize[_0xead1('0x2')]},'calleridname':{'type':Sequelize[_0xead1('0x2')]},'queue':{'type':Sequelize[_0xead1('0x2')]},'interface':{'type':Sequelize[_0xead1('0x2')]},'membername':{'type':Sequelize[_0xead1('0x2')]},'agentcalledAt':{'type':Sequelize[_0xead1('0x4')]},'agentconnectAt':{'type':Sequelize[_0xead1('0x4')]},'holdtime':{'type':Sequelize[_0xead1('0x3')]},'agentcomplete':{'type':Sequelize[_0xead1('0x5')],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0xead1('0x4')]},'talktime':{'type':Sequelize[_0xead1('0x3')]},'agentacw':{'type':Sequelize[_0xead1('0x5')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0xead1('0x3')]},'reason':{'type':Sequelize[_0xead1('0x2')]},'agentringnoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0xead1('0x4')]},'agentdump':{'type':Sequelize[_0xead1('0x5')],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0xead1('0x4')]},'lastevent':{'type':Sequelize[_0xead1('0x2')]},'channel':{'type':Sequelize['STRING']},'channelstate':{'type':Sequelize['INTEGER']},'channelstatedesc':{'type':Sequelize[_0xead1('0x2')]},'connectedlinenum':{'type':Sequelize[_0xead1('0x2')]},'connectedlinename':{'type':Sequelize[_0xead1('0x2')]},'language':{'type':Sequelize[_0xead1('0x2')]},'accountcode':{'type':Sequelize[_0xead1('0x2')]},'context':{'type':Sequelize[_0xead1('0x2')]},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0xead1('0x2')]},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize[_0xead1('0x3')]},'destchannelstatedesc':{'type':Sequelize[_0xead1('0x2')]},'destcalleridnum':{'type':Sequelize[_0xead1('0x2')]},'destcalleridname':{'type':Sequelize[_0xead1('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0xead1('0x2')]},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize[_0xead1('0x2')]},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize[_0xead1('0x2')]},'destexten':{'type':Sequelize[_0xead1('0x2')]},'destpriority':{'type':Sequelize[_0xead1('0x2')]},'destuniqueid':{'type':Sequelize[_0xead1('0x2')]},'messageId':{'type':Sequelize[_0xead1('0x2')]},'inReplyTo':{'type':Sequelize[_0xead1('0x2')]},'subject':{'type':Sequelize[_0xead1('0x2')]},'from':{'type':Sequelize[_0xead1('0x2')]},'to':{'type':Sequelize[_0xead1('0x2')]},'cc':{'type':Sequelize[_0xead1('0x2')]},'attachment':{'type':Sequelize['TEXT']},'html':{'type':Sequelize[_0xead1('0x6')]},'text':{'type':Sequelize[_0xead1('0x6')]},'status':{'type':Sequelize[_0xead1('0x7')](_0xead1('0x8'),_0xead1('0x9'),_0xead1('0xa'),'FAILED')},'url':{'type':Sequelize[_0xead1('0x2')]},'app':{'type':Sequelize[_0xead1('0x2')]},'appdata':{'type':Sequelize[_0xead1('0x2')]},'projectId':{'type':Sequelize[_0xead1('0x3')]}}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.controller.js b/server/api/integrationReport/integrationReport.controller.js index f165c97..888c015 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 _0x45f8=['request-promise','moment','bluebird','path','sox','to-csv','ejs','lodash','jsforce','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','apply','update','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','query','keys','intersection','attributes','model','fields','length','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','IntegrationReport','includeAll','include','rows','params','find','catch','create','body','describe','rimraf','zip-dir'];(function(_0x389c88,_0x46d30a){var _0x32b899=function(_0x2b70f2){while(--_0x2b70f2){_0x389c88['push'](_0x389c88['shift']());}};_0x32b899(++_0x46d30a);}(_0x45f8,0x88));var _0x845f=function(_0x138836,_0x229129){_0x138836=_0x138836-0x0;var _0x322688=_0x45f8[_0x138836];return _0x322688;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x845f('0x0'));var zipdir=require(_0x845f('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x845f('0x2'));var moment=require(_0x845f('0x3'));var BPromise=require(_0x845f('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x845f('0x5'));var sox=require(_0x845f('0x6'));var csv=require(_0x845f('0x7'));var ejs=require(_0x845f('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x845f('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x845f('0xa'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x845f('0xb'));var Redis=require('ioredis');var authService=require(_0x845f('0xc'));var qs=require('../../components/parsers/qs');var as=require(_0x845f('0xd'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x845f('0xe'))(_0x845f('0xf'));var utils=require(_0x845f('0x10'));var config=require(_0x845f('0x11'));var licenseUtil=require(_0x845f('0x12'));var db=require(_0x845f('0x13'))['db'];function respondWithStatusCode(_0x2ec35a,_0x810b2d){_0x810b2d=_0x810b2d||0xcc;return function(_0x11c442){if(_0x11c442){return _0x2ec35a[_0x845f('0x14')](_0x810b2d);}return _0x2ec35a[_0x845f('0x15')](_0x810b2d)[_0x845f('0x16')]();};}function respondWithResult(_0x56c0ee,_0x4808ef){_0x4808ef=_0x4808ef||0xc8;return function(_0x1650e3){if(_0x1650e3){return _0x56c0ee['status'](_0x4808ef)['json'](_0x1650e3);}};}function respondWithFilteredResult(_0x33cd45,_0x13372a){return function(_0x16251a){if(_0x16251a){var _0x23ef58=typeof _0x13372a[_0x845f('0x17')]===_0x845f('0x18')&&typeof _0x13372a[_0x845f('0x19')]===_0x845f('0x18');var _0x357e31=_0x16251a[_0x845f('0x1a')];var _0x88ad7f=_0x23ef58?0x0:_0x13372a[_0x845f('0x17')];var _0x56b72c=_0x23ef58?_0x16251a[_0x845f('0x1a')]:_0x13372a[_0x845f('0x17')]+_0x13372a['limit'];var _0x4280bb;if(_0x56b72c>=_0x357e31){_0x56b72c=_0x357e31;_0x4280bb=0xc8;}else{_0x4280bb=0xce;}_0x33cd45[_0x845f('0x15')](_0x4280bb);return _0x33cd45['set'](_0x845f('0x1b'),_0x88ad7f+'-'+_0x56b72c+'/'+_0x357e31)[_0x845f('0x1c')](_0x16251a);}return null;};}function patchUpdates(_0xc9500e){return function(_0x3c74d2){try{jsonpatch[_0x845f('0x1d')](_0x3c74d2,_0xc9500e,!![]);}catch(_0x4c5788){return BPromise['reject'](_0x4c5788);}return _0x3c74d2['save']();};}function saveUpdates(_0x5e47fe,_0x5ad45b){return function(_0x204101){if(_0x204101){return _0x204101[_0x845f('0x1e')](_0x5e47fe)[_0x845f('0x1f')](function(_0x2eb144){return _0x2eb144;});}return null;};}function removeEntity(_0x10aeea,_0xd54e75){return function(_0x16c1af){if(_0x16c1af){return _0x16c1af[_0x845f('0x20')]()[_0x845f('0x1f')](function(){_0x10aeea[_0x845f('0x15')](0xcc)[_0x845f('0x16')]();});}};}function handleEntityNotFound(_0x5246df,_0x1a9af4){return function(_0x318f9e){if(!_0x318f9e){_0x5246df[_0x845f('0x14')](0x194);}return _0x318f9e;};}function handleError(_0x1bde74,_0x37dbd3){_0x37dbd3=_0x37dbd3||0x1f4;return function(_0x2a2476){logger[_0x845f('0x21')](_0x2a2476[_0x845f('0x22')]);if(_0x2a2476[_0x845f('0x23')]){delete _0x2a2476[_0x845f('0x23')];}_0x1bde74[_0x845f('0x15')](_0x37dbd3)[_0x845f('0x24')](_0x2a2476);};}exports[_0x845f('0x25')]=function(_0x3517c1,_0x51e6ba){var _0x3c4315={},_0x2806a3={},_0xe7f5c2={'count':0x0,'rows':[]};var _0x2977c3=_[_0x845f('0x26')](db['IntegrationReport'][_0x845f('0x27')],function(_0x45de14){return{'name':_0x45de14[_0x845f('0x28')],'type':_0x45de14[_0x845f('0x29')][_0x845f('0x2a')]};});_0x2806a3['model']=_[_0x845f('0x26')](_0x2977c3,'name');_0x2806a3[_0x845f('0x2b')]=_[_0x845f('0x2c')](_0x3517c1[_0x845f('0x2b')]);_0x2806a3['filters']=_[_0x845f('0x2d')](_0x2806a3['model'],_0x2806a3[_0x845f('0x2b')]);_0x3c4315[_0x845f('0x2e')]=_[_0x845f('0x2d')](_0x2806a3[_0x845f('0x2f')],qs['fields'](_0x3517c1['query'][_0x845f('0x30')]));_0x3c4315[_0x845f('0x2e')]=_0x3c4315[_0x845f('0x2e')][_0x845f('0x31')]?_0x3c4315[_0x845f('0x2e')]:_0x2806a3[_0x845f('0x2f')];if(!_0x3517c1[_0x845f('0x2b')]['hasOwnProperty']('nolimit')){_0x3c4315[_0x845f('0x19')]=qs[_0x845f('0x19')](_0x3517c1['query'][_0x845f('0x19')]);_0x3c4315['offset']=qs['offset'](_0x3517c1[_0x845f('0x2b')][_0x845f('0x17')]);}_0x3c4315[_0x845f('0x32')]=qs[_0x845f('0x33')](_0x3517c1[_0x845f('0x2b')][_0x845f('0x33')]);_0x3c4315[_0x845f('0x34')]=qs[_0x845f('0x35')](_[_0x845f('0x36')](_0x3517c1['query'],_0x2806a3[_0x845f('0x35')]),_0x2977c3);if(_0x3517c1[_0x845f('0x2b')][_0x845f('0x37')]){_0x3c4315[_0x845f('0x34')]=_[_0x845f('0x38')](_0x3c4315[_0x845f('0x34')],{'$or':_['map'](_0x2977c3,function(_0x5a5159){if(_0x5a5159[_0x845f('0x29')]!==_0x845f('0x39')){var _0x3689ce={};_0x3689ce[_0x5a5159['name']]={'$like':'%'+_0x3517c1[_0x845f('0x2b')][_0x845f('0x37')]+'%'};return _0x3689ce;}})});}_0x3c4315=_[_0x845f('0x38')]({},_0x3c4315,_0x3517c1[_0x845f('0x3a')]);var _0x187c93={'where':_0x3c4315[_0x845f('0x34')]};return db[_0x845f('0x3b')][_0x845f('0x1a')](_0x187c93)[_0x845f('0x1f')](function(_0x358a7d){_0xe7f5c2[_0x845f('0x1a')]=_0x358a7d;if(_0x3517c1[_0x845f('0x2b')][_0x845f('0x3c')]){_0x3c4315[_0x845f('0x3d')]=[{'all':!![]}];}return db['IntegrationReport']['findAll'](_0x3c4315);})[_0x845f('0x1f')](function(_0x4e55c7){_0xe7f5c2[_0x845f('0x3e')]=_0x4e55c7;return _0xe7f5c2;})[_0x845f('0x1f')](respondWithFilteredResult(_0x51e6ba,_0x3c4315))['catch'](handleError(_0x51e6ba,null));};exports['show']=function(_0x4acb9d,_0x7b218c){var _0x3f076a={'raw':![],'where':{'id':_0x4acb9d[_0x845f('0x3f')]['id']}},_0x44051e={};_0x44051e['model']=_[_0x845f('0x2c')](db[_0x845f('0x3b')]['rawAttributes']);_0x44051e[_0x845f('0x2b')]=_[_0x845f('0x2c')](_0x4acb9d[_0x845f('0x2b')]);_0x44051e[_0x845f('0x35')]=_['intersection'](_0x44051e[_0x845f('0x2f')],_0x44051e[_0x845f('0x2b')]);_0x3f076a[_0x845f('0x2e')]=_['intersection'](_0x44051e[_0x845f('0x2f')],qs[_0x845f('0x30')](_0x4acb9d[_0x845f('0x2b')][_0x845f('0x30')]));_0x3f076a[_0x845f('0x2e')]=_0x3f076a[_0x845f('0x2e')][_0x845f('0x31')]?_0x3f076a[_0x845f('0x2e')]:_0x44051e[_0x845f('0x2f')];if(_0x4acb9d[_0x845f('0x2b')][_0x845f('0x3c')]){_0x3f076a[_0x845f('0x3d')]=[{'all':!![]}];}_0x3f076a=_[_0x845f('0x38')]({},_0x3f076a,_0x4acb9d[_0x845f('0x3a')]);return db[_0x845f('0x3b')][_0x845f('0x40')](_0x3f076a)[_0x845f('0x1f')](handleEntityNotFound(_0x7b218c,null))[_0x845f('0x1f')](respondWithResult(_0x7b218c,null))[_0x845f('0x41')](handleError(_0x7b218c,null));};exports['create']=function(_0x570106,_0x5e027c){return db[_0x845f('0x3b')][_0x845f('0x42')](_0x570106[_0x845f('0x43')],{})[_0x845f('0x1f')](respondWithResult(_0x5e027c,0xc9))[_0x845f('0x41')](handleError(_0x5e027c,null));};exports[_0x845f('0x1e')]=function(_0x55b7ad,_0x16028a){if(_0x55b7ad[_0x845f('0x43')]['id']){delete _0x55b7ad['body']['id'];}return db[_0x845f('0x3b')][_0x845f('0x40')]({'where':{'id':_0x55b7ad[_0x845f('0x3f')]['id']}})['then'](handleEntityNotFound(_0x16028a,null))['then'](saveUpdates(_0x55b7ad[_0x845f('0x43')],null))[_0x845f('0x1f')](respondWithResult(_0x16028a,null))['catch'](handleError(_0x16028a,null));};exports['destroy']=function(_0x119a5b,_0xcb698c){return db[_0x845f('0x3b')][_0x845f('0x40')]({'where':{'id':_0x119a5b['params']['id']}})['then'](handleEntityNotFound(_0xcb698c,null))[_0x845f('0x1f')](removeEntity(_0xcb698c,null))['catch'](handleError(_0xcb698c,null));};exports[_0x845f('0x44')]=function(_0x518e67,_0x2bc79a){return db[_0x845f('0x3b')]['describe']()[_0x845f('0x1f')](respondWithResult(_0x2bc79a,null))[_0x845f('0x41')](handleError(_0x2bc79a,null));}; \ No newline at end of file +var _0xcb4f=['destroy','sendStatus','error','stack','name','send','map','IntegrationReport','fieldName','type','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','keys','rawAttributes','length','options','create','body','params','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','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/license/hardware','status','end','json','undefined','limit','offset','count','set','Content-Range','reject','save','update','then'];(function(_0x4a0d37,_0x447d5a){var _0x595ca4=function(_0x4ea7f5){while(--_0x4ea7f5){_0x4a0d37['push'](_0x4a0d37['shift']());}};_0x595ca4(++_0x447d5a);}(_0xcb4f,0x72));var _0xfcb4=function(_0x6cf19c,_0x2f3f02){_0x6cf19c=_0x6cf19c-0x0;var _0xce14f3=_0xcb4f[_0x6cf19c];return _0xce14f3;};'use strict';var emlformat=require(_0xfcb4('0x0'));var rimraf=require(_0xfcb4('0x1'));var zipdir=require(_0xfcb4('0x2'));var jsonpatch=require(_0xfcb4('0x3'));var rp=require(_0xfcb4('0x4'));var moment=require('moment');var BPromise=require(_0xfcb4('0x5'));var Mustache=require(_0xfcb4('0x6'));var util=require(_0xfcb4('0x7'));var path=require(_0xfcb4('0x8'));var sox=require(_0xfcb4('0x9'));var csv=require(_0xfcb4('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xfcb4('0xb'));var squel=require(_0xfcb4('0xc'));var crypto=require(_0xfcb4('0xd'));var jsforce=require(_0xfcb4('0xe'));var deskjs=require(_0xfcb4('0xf'));var toCsv=require(_0xfcb4('0xa'));var querystring=require(_0xfcb4('0x10'));var Papa=require(_0xfcb4('0x11'));var Redis=require(_0xfcb4('0x12'));var authService=require(_0xfcb4('0x13'));var qs=require(_0xfcb4('0x14'));var as=require(_0xfcb4('0x15'));var hardwareService=require(_0xfcb4('0x16'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x425b88,_0x2c71c0){_0x2c71c0=_0x2c71c0||0xcc;return function(_0x2e6886){if(_0x2e6886){return _0x425b88['sendStatus'](_0x2c71c0);}return _0x425b88[_0xfcb4('0x17')](_0x2c71c0)[_0xfcb4('0x18')]();};}function respondWithResult(_0xfa314a,_0xf12b05){_0xf12b05=_0xf12b05||0xc8;return function(_0x1efc23){if(_0x1efc23){return _0xfa314a['status'](_0xf12b05)[_0xfcb4('0x19')](_0x1efc23);}};}function respondWithFilteredResult(_0x3c2acc,_0x9d3b3a){return function(_0x14856c){if(_0x14856c){var _0x10a49b=typeof _0x9d3b3a['offset']===_0xfcb4('0x1a')&&typeof _0x9d3b3a[_0xfcb4('0x1b')]===_0xfcb4('0x1a');var _0x3361d0=_0x14856c['count'];var _0x24c50b=_0x10a49b?0x0:_0x9d3b3a[_0xfcb4('0x1c')];var _0x268259=_0x10a49b?_0x14856c[_0xfcb4('0x1d')]:_0x9d3b3a[_0xfcb4('0x1c')]+_0x9d3b3a[_0xfcb4('0x1b')];var _0x4ea530;if(_0x268259>=_0x3361d0){_0x268259=_0x3361d0;_0x4ea530=0xc8;}else{_0x4ea530=0xce;}_0x3c2acc[_0xfcb4('0x17')](_0x4ea530);return _0x3c2acc[_0xfcb4('0x1e')](_0xfcb4('0x1f'),_0x24c50b+'-'+_0x268259+'/'+_0x3361d0)[_0xfcb4('0x19')](_0x14856c);}return null;};}function patchUpdates(_0x343da8){return function(_0x14734a){try{jsonpatch['apply'](_0x14734a,_0x343da8,!![]);}catch(_0x17c7a5){return BPromise[_0xfcb4('0x20')](_0x17c7a5);}return _0x14734a[_0xfcb4('0x21')]();};}function saveUpdates(_0x25db10,_0x47c388){return function(_0x2d90a6){if(_0x2d90a6){return _0x2d90a6[_0xfcb4('0x22')](_0x25db10)[_0xfcb4('0x23')](function(_0x55d1c5){return _0x55d1c5;});}return null;};}function removeEntity(_0x4ed769,_0x2bf6ac){return function(_0x4d6e8a){if(_0x4d6e8a){return _0x4d6e8a[_0xfcb4('0x24')]()[_0xfcb4('0x23')](function(){_0x4ed769['status'](0xcc)[_0xfcb4('0x18')]();});}};}function handleEntityNotFound(_0x1c3765,_0x279a63){return function(_0x54060f){if(!_0x54060f){_0x1c3765[_0xfcb4('0x25')](0x194);}return _0x54060f;};}function handleError(_0x73aae0,_0x5aac67){_0x5aac67=_0x5aac67||0x1f4;return function(_0x2d0be2){logger[_0xfcb4('0x26')](_0x2d0be2[_0xfcb4('0x27')]);if(_0x2d0be2[_0xfcb4('0x28')]){delete _0x2d0be2[_0xfcb4('0x28')];}_0x73aae0['status'](_0x5aac67)[_0xfcb4('0x29')](_0x2d0be2);};}exports['index']=function(_0x2cff3d,_0xeef2d1){var _0x440d7a={},_0x3fd6c8={},_0x38eb5d={'count':0x0,'rows':[]};var _0x5521d5=_[_0xfcb4('0x2a')](db[_0xfcb4('0x2b')]['rawAttributes'],function(_0x3a9230){return{'name':_0x3a9230[_0xfcb4('0x2c')],'type':_0x3a9230[_0xfcb4('0x2d')]['key']};});_0x3fd6c8[_0xfcb4('0x2e')]=_[_0xfcb4('0x2a')](_0x5521d5,'name');_0x3fd6c8['query']=_['keys'](_0x2cff3d[_0xfcb4('0x2f')]);_0x3fd6c8[_0xfcb4('0x30')]=_[_0xfcb4('0x31')](_0x3fd6c8['model'],_0x3fd6c8[_0xfcb4('0x2f')]);_0x440d7a[_0xfcb4('0x32')]=_['intersection'](_0x3fd6c8[_0xfcb4('0x2e')],qs[_0xfcb4('0x33')](_0x2cff3d[_0xfcb4('0x2f')][_0xfcb4('0x33')]));_0x440d7a['attributes']=_0x440d7a['attributes']['length']?_0x440d7a['attributes']:_0x3fd6c8[_0xfcb4('0x2e')];if(!_0x2cff3d[_0xfcb4('0x2f')][_0xfcb4('0x34')](_0xfcb4('0x35'))){_0x440d7a['limit']=qs[_0xfcb4('0x1b')](_0x2cff3d['query'][_0xfcb4('0x1b')]);_0x440d7a[_0xfcb4('0x1c')]=qs[_0xfcb4('0x1c')](_0x2cff3d[_0xfcb4('0x2f')][_0xfcb4('0x1c')]);}_0x440d7a[_0xfcb4('0x36')]=qs[_0xfcb4('0x37')](_0x2cff3d['query'][_0xfcb4('0x37')]);_0x440d7a[_0xfcb4('0x38')]=qs[_0xfcb4('0x30')](_['pick'](_0x2cff3d[_0xfcb4('0x2f')],_0x3fd6c8[_0xfcb4('0x30')]),_0x5521d5);if(_0x2cff3d['query'][_0xfcb4('0x39')]){_0x440d7a['where']=_[_0xfcb4('0x3a')](_0x440d7a[_0xfcb4('0x38')],{'$or':_[_0xfcb4('0x2a')](_0x5521d5,function(_0x5a2ed2){if(_0x5a2ed2[_0xfcb4('0x2d')]!==_0xfcb4('0x3b')){var _0x1304bb={};_0x1304bb[_0x5a2ed2[_0xfcb4('0x28')]]={'$like':'%'+_0x2cff3d[_0xfcb4('0x2f')][_0xfcb4('0x39')]+'%'};return _0x1304bb;}})});}_0x440d7a=_[_0xfcb4('0x3a')]({},_0x440d7a,_0x2cff3d['options']);var _0x25b5a0={'where':_0x440d7a[_0xfcb4('0x38')]};return db[_0xfcb4('0x2b')][_0xfcb4('0x1d')](_0x25b5a0)[_0xfcb4('0x23')](function(_0x24827b){_0x38eb5d[_0xfcb4('0x1d')]=_0x24827b;if(_0x2cff3d[_0xfcb4('0x2f')][_0xfcb4('0x3c')]){_0x440d7a[_0xfcb4('0x3d')]=[{'all':!![]}];}return db['IntegrationReport'][_0xfcb4('0x3e')](_0x440d7a);})['then'](function(_0x59e068){_0x38eb5d[_0xfcb4('0x3f')]=_0x59e068;return _0x38eb5d;})[_0xfcb4('0x23')](respondWithFilteredResult(_0xeef2d1,_0x440d7a))[_0xfcb4('0x40')](handleError(_0xeef2d1,null));};exports[_0xfcb4('0x41')]=function(_0x4d3b27,_0x1d5d7c){var _0xf919f2={'raw':![],'where':{'id':_0x4d3b27['params']['id']}},_0xfeb98e={};_0xfeb98e['model']=_[_0xfcb4('0x42')](db[_0xfcb4('0x2b')][_0xfcb4('0x43')]);_0xfeb98e[_0xfcb4('0x2f')]=_['keys'](_0x4d3b27[_0xfcb4('0x2f')]);_0xfeb98e['filters']=_[_0xfcb4('0x31')](_0xfeb98e[_0xfcb4('0x2e')],_0xfeb98e[_0xfcb4('0x2f')]);_0xf919f2[_0xfcb4('0x32')]=_[_0xfcb4('0x31')](_0xfeb98e[_0xfcb4('0x2e')],qs['fields'](_0x4d3b27[_0xfcb4('0x2f')]['fields']));_0xf919f2['attributes']=_0xf919f2[_0xfcb4('0x32')][_0xfcb4('0x44')]?_0xf919f2['attributes']:_0xfeb98e['model'];if(_0x4d3b27[_0xfcb4('0x2f')][_0xfcb4('0x3c')]){_0xf919f2['include']=[{'all':!![]}];}_0xf919f2=_[_0xfcb4('0x3a')]({},_0xf919f2,_0x4d3b27[_0xfcb4('0x45')]);return db[_0xfcb4('0x2b')]['find'](_0xf919f2)[_0xfcb4('0x23')](handleEntityNotFound(_0x1d5d7c,null))[_0xfcb4('0x23')](respondWithResult(_0x1d5d7c,null))[_0xfcb4('0x40')](handleError(_0x1d5d7c,null));};exports[_0xfcb4('0x46')]=function(_0x477fc8,_0x37d851){return db[_0xfcb4('0x2b')][_0xfcb4('0x46')](_0x477fc8[_0xfcb4('0x47')],{})['then'](respondWithResult(_0x37d851,0xc9))[_0xfcb4('0x40')](handleError(_0x37d851,null));};exports[_0xfcb4('0x22')]=function(_0x51bade,_0x1f3e1f){if(_0x51bade['body']['id']){delete _0x51bade['body']['id'];}return db[_0xfcb4('0x2b')]['find']({'where':{'id':_0x51bade[_0xfcb4('0x48')]['id']}})[_0xfcb4('0x23')](handleEntityNotFound(_0x1f3e1f,null))[_0xfcb4('0x23')](saveUpdates(_0x51bade[_0xfcb4('0x47')],null))[_0xfcb4('0x23')](respondWithResult(_0x1f3e1f,null))['catch'](handleError(_0x1f3e1f,null));};exports['destroy']=function(_0x113a95,_0x416d66){return db[_0xfcb4('0x2b')][_0xfcb4('0x49')]({'where':{'id':_0x113a95[_0xfcb4('0x48')]['id']}})[_0xfcb4('0x23')](handleEntityNotFound(_0x416d66,null))['then'](removeEntity(_0x416d66,null))[_0xfcb4('0x40')](handleError(_0x416d66,null));};exports['describe']=function(_0x2f04b9,_0x35df99){return db[_0xfcb4('0x2b')][_0xfcb4('0x4a')]()[_0xfcb4('0x23')](respondWithResult(_0x35df99,null))[_0xfcb4('0x40')](handleError(_0x35df99,null));}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.model.js b/server/api/integrationReport/integrationReport.model.js index 941fb2e..112e5a7 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 _0xb2b8=['path','rimraf','../../config/environment','./integrationReport.attributes','exports','define','IntegrationReport','report_integration','util','../../config/logger','bluebird','request-promise'];(function(_0xfe3a4a,_0x564726){var _0x6d1dd1=function(_0x125001){while(--_0x125001){_0xfe3a4a['push'](_0xfe3a4a['shift']());}};_0x6d1dd1(++_0x564726);}(_0xb2b8,0x188));var _0x8b2b=function(_0x1cb048,_0x20bd5b){_0x1cb048=_0x1cb048-0x0;var _0xed7984=_0xb2b8[_0x1cb048];return _0xed7984;};'use strict';var _=require('lodash');var util=require(_0x8b2b('0x0'));var logger=require(_0x8b2b('0x1'))('api');var moment=require('moment');var BPromise=require(_0x8b2b('0x2'));var rp=require(_0x8b2b('0x3'));var fs=require('fs');var path=require(_0x8b2b('0x4'));var rimraf=require(_0x8b2b('0x5'));var config=require(_0x8b2b('0x6'));var attributes=require(_0x8b2b('0x7'));module[_0x8b2b('0x8')]=function(_0x463f63,_0x2a5ebb){return _0x463f63[_0x8b2b('0x9')](_0x8b2b('0xa'),attributes,{'tableName':_0x8b2b('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x74cb=['report_integration','lodash','api','moment','bluebird','path','rimraf','../../config/environment','define','IntegrationReport'];(function(_0x45ff61,_0x4457d6){var _0x5cc960=function(_0x42c0fa){while(--_0x42c0fa){_0x45ff61['push'](_0x45ff61['shift']());}};_0x5cc960(++_0x4457d6);}(_0x74cb,0x155));var _0xb74c=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x74cb[_0x1ac595];return _0x455fff;};'use strict';var _=require(_0xb74c('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xb74c('0x1'));var moment=require(_0xb74c('0x2'));var BPromise=require(_0xb74c('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb74c('0x4'));var rimraf=require(_0xb74c('0x5'));var config=require(_0xb74c('0x6'));var attributes=require('./integrationReport.attributes');module['exports']=function(_0x39801c,_0x427c71){return _0x39801c[_0xb74c('0x7')](_0xb74c('0x8'),attributes,{'tableName':_0xb74c('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 9b624d0..2fc7cf6 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 _0xc4aa=['moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','request','then','IntegrationReport,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','catch','lodash','util'];(function(_0x31c4ff,_0x41f7b7){var _0x3c498c=function(_0x5357ed){while(--_0x5357ed){_0x31c4ff['push'](_0x31c4ff['shift']());}};_0x3c498c(++_0x41f7b7);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0xc4aa[_0x19950b];return _0x3c6b41;};'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')]('IntegrationReport,\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 _0x57ca=['client','http','request','info','request\x20sent','IntegrationReport,\x20%s,\x20%s,\x20%s','error','code','IntegrationReport,\x20%s,\x20%s','message','result','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise'];(function(_0x4cd216,_0x4169d3){var _0x161fd7=function(_0x27c2ce){while(--_0x27c2ce){_0x4cd216['push'](_0x4cd216['shift']());}};_0x161fd7(++_0x4169d3);}(_0x57ca,0x108));var _0xa57c=function(_0x2bb24a,_0x9dcdbb){_0x2bb24a=_0x2bb24a-0x0;var _0x3efc47=_0x57ca[_0x2bb24a];return _0x3efc47;};'use strict';var _=require('lodash');var util=require(_0xa57c('0x0'));var moment=require(_0xa57c('0x1'));var BPromise=require('bluebird');var rs=require(_0xa57c('0x2'));var fs=require('fs');var Redis=require(_0xa57c('0x3'));var db=require(_0xa57c('0x4'))['db'];var utils=require(_0xa57c('0x5'));var logger=require(_0xa57c('0x6'))('rpc');var config=require(_0xa57c('0x7'));var jayson=require(_0xa57c('0x8'));var client=jayson[_0xa57c('0x9')][_0xa57c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xbdfffb,_0x314574,_0x19e28e){return new BPromise(function(_0x271ccc,_0x5e3962){return client[_0xa57c('0xb')](_0xbdfffb,_0x19e28e)['then'](function(_0x46ba92){logger[_0xa57c('0xc')]('IntegrationReport,\x20%s,\x20%s',_0x314574,_0xa57c('0xd'));logger['debug'](_0xa57c('0xe'),_0x314574,_0xa57c('0xd'),JSON['stringify'](_0x46ba92));if(_0x46ba92[_0xa57c('0xf')]){if(_0x46ba92['error'][_0xa57c('0x10')]===0x1f4){logger[_0xa57c('0xf')](_0xa57c('0x11'),_0x314574,_0x46ba92[_0xa57c('0xf')][_0xa57c('0x12')]);return _0x5e3962(_0x46ba92['error'][_0xa57c('0x12')]);}logger['error'](_0xa57c('0x11'),_0x314574,_0x46ba92[_0xa57c('0xf')][_0xa57c('0x12')]);return _0x271ccc(_0x46ba92[_0xa57c('0xf')][_0xa57c('0x12')]);}else{logger[_0xa57c('0xc')](_0xa57c('0x11'),_0x314574,'request\x20sent');_0x271ccc(_0x46ba92[_0xa57c('0x13')][_0xa57c('0x12')]);}})[_0xa57c('0x14')](function(_0x5a6024){logger[_0xa57c('0xf')]('IntegrationReport,\x20%s,\x20%s',_0x314574,_0x5a6024);_0x5e3962(_0x5a6024);});});} \ No newline at end of file diff --git a/server/api/interval/index.js b/server/api/interval/index.js index 68a5ac4..02e1f80 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 _0x7d7f=['./interval.controller','index','get','/:id','isAuthenticated','show','post','create','/:id/sub_intervals','/:id/sub_intervals/create_many','addIntervals','put','update','delete','destroy','exports','multer','util','connect-timeout','express','Router'];(function(_0x307522,_0xd0935a){var _0x2970b0=function(_0x1fc562){while(--_0x1fc562){_0x307522['push'](_0x307522['shift']());}};_0x2970b0(++_0xd0935a);}(_0x7d7f,0xa3));var _0xf7d7=function(_0x39bf11,_0x4a6430){_0x39bf11=_0x39bf11-0x0;var _0x18393f=_0x7d7f[_0x39bf11];return _0x18393f;};'use strict';var multer=require(_0xf7d7('0x0'));var util=require(_0xf7d7('0x1'));var path=require('path');var timeout=require(_0xf7d7('0x2'));var express=require(_0xf7d7('0x3'));var router=express[_0xf7d7('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xf7d7('0x5'));router['get']('/',auth['isAuthenticated'](),controller[_0xf7d7('0x6')]);router[_0xf7d7('0x7')](_0xf7d7('0x8'),auth[_0xf7d7('0x9')](),controller[_0xf7d7('0xa')]);router['get']('/:id/sub_intervals',auth[_0xf7d7('0x9')](),controller['getIntervals']);router[_0xf7d7('0xb')]('/',auth[_0xf7d7('0x9')](),controller[_0xf7d7('0xc')]);router[_0xf7d7('0xb')](_0xf7d7('0xd'),auth[_0xf7d7('0x9')](),controller['addInterval']);router['post'](_0xf7d7('0xe'),auth['isAuthenticated'](),controller[_0xf7d7('0xf')]);router[_0xf7d7('0x10')](_0xf7d7('0x8'),auth[_0xf7d7('0x9')](),controller[_0xf7d7('0x11')]);router[_0xf7d7('0x12')](_0xf7d7('0x8'),auth[_0xf7d7('0x9')](),controller[_0xf7d7('0x13')]);module[_0xf7d7('0x14')]=router; \ No newline at end of file +var _0x49e5=['path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./interval.controller','isAuthenticated','/:id','show','getIntervals','post','create','/:id/sub_intervals','addInterval','/:id/sub_intervals/create_many','addIntervals','update','destroy','exports','multer','util'];(function(_0x19b84f,_0x48765e){var _0x18067b=function(_0x1c69aa){while(--_0x1c69aa){_0x19b84f['push'](_0x19b84f['shift']());}};_0x18067b(++_0x48765e);}(_0x49e5,0x71));var _0x549e=function(_0x5211ef,_0x4193d3){_0x5211ef=_0x5211ef-0x0;var _0x5cd4e2=_0x49e5[_0x5211ef];return _0x5cd4e2;};'use strict';var multer=require(_0x549e('0x0'));var util=require(_0x549e('0x1'));var path=require(_0x549e('0x2'));var timeout=require(_0x549e('0x3'));var express=require(_0x549e('0x4'));var router=express['Router']();var fs_extra=require(_0x549e('0x5'));var auth=require(_0x549e('0x6'));var interaction=require(_0x549e('0x7'));var config=require(_0x549e('0x8'));var controller=require(_0x549e('0x9'));router['get']('/',auth[_0x549e('0xa')](),controller['index']);router['get'](_0x549e('0xb'),auth[_0x549e('0xa')](),controller[_0x549e('0xc')]);router['get']('/:id/sub_intervals',auth['isAuthenticated'](),controller[_0x549e('0xd')]);router[_0x549e('0xe')]('/',auth[_0x549e('0xa')](),controller[_0x549e('0xf')]);router[_0x549e('0xe')](_0x549e('0x10'),auth['isAuthenticated'](),controller[_0x549e('0x11')]);router['post'](_0x549e('0x12'),auth[_0x549e('0xa')](),controller[_0x549e('0x13')]);router['put'](_0x549e('0xb'),auth[_0x549e('0xa')](),controller[_0x549e('0x14')]);router['delete'](_0x549e('0xb'),auth[_0x549e('0xa')](),controller[_0x549e('0x15')]);module[_0x549e('0x16')]=router; \ No newline at end of file diff --git a/server/api/interval/interval.attributes.js b/server/api/interval/interval.attributes.js index acccf1d..50eb2d1 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 _0xf860=['exports','STRING'];(function(_0x1852bb,_0x5f1303){var _0xa4410a=function(_0xaaa32f){while(--_0xaaa32f){_0x1852bb['push'](_0x1852bb['shift']());}};_0xa4410a(++_0x5f1303);}(_0xf860,0x1c8));var _0x0f86=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf860[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module[_0x0f86('0x0')]={'name':{'type':Sequelize[_0x0f86('0x1')]},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x0f86('0x1')],'allowNull':!![]}}; \ No newline at end of file +var _0x8bc4=['STRING','exports'];(function(_0x28e04a,_0x4ce2fe){var _0xde28f5=function(_0x250a0a){while(--_0x250a0a){_0x28e04a['push'](_0x28e04a['shift']());}};_0xde28f5(++_0x4ce2fe);}(_0x8bc4,0x127));var _0x48bc=function(_0x4d1118,_0x28f5ec){_0x4d1118=_0x4d1118-0x0;var _0x2a0ee3=_0x8bc4[_0x4d1118];return _0x2a0ee3;};'use strict';var Sequelize=require('sequelize');module[_0x48bc('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x48bc('0x1')]},'interval':{'type':Sequelize[_0x48bc('0x1')],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/interval/interval.controller.js b/server/api/interval/interval.controller.js index aa49aa1..0447d0e 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 _0x97d8=['../../config/environment','../../config/license/util','sendStatus','end','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','UserProfileResource','error','stack','name','map','Interval','rawAttributes','type','key','query','keys','filters','intersection','model','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','length','catch','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Intervals','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','addInterval','getIntervals','findOne','addIntervals','sequelize','transaction','IntervalId','bulkCreate','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api'];(function(_0x59316b,_0x237c77){var _0x468968=function(_0x45fb03){while(--_0x45fb03){_0x59316b['push'](_0x59316b['shift']());}};_0x468968(++_0x237c77);}(_0x97d8,0x1bf));var _0x897d=function(_0xfa9e04,_0x309093){_0xfa9e04=_0xfa9e04-0x0;var _0x2e32cc=_0x97d8[_0xfa9e04];return _0x2e32cc;};'use strict';var emlformat=require(_0x897d('0x0'));var rimraf=require(_0x897d('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x897d('0x2'));var rp=require(_0x897d('0x3'));var moment=require(_0x897d('0x4'));var BPromise=require(_0x897d('0x5'));var Mustache=require(_0x897d('0x6'));var util=require(_0x897d('0x7'));var path=require(_0x897d('0x8'));var sox=require('sox');var csv=require(_0x897d('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x897d('0xa'));var _=require(_0x897d('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x897d('0xc'));var deskjs=require(_0x897d('0xd'));var toCsv=require(_0x897d('0x9'));var querystring=require(_0x897d('0xe'));var Papa=require(_0x897d('0xf'));var Redis=require(_0x897d('0x10'));var authService=require(_0x897d('0x11'));var qs=require(_0x897d('0x12'));var as=require(_0x897d('0x13'));var hardwareService=require(_0x897d('0x14'));var logger=require(_0x897d('0x15'))(_0x897d('0x16'));var utils=require('../../config/utils');var config=require(_0x897d('0x17'));var licenseUtil=require(_0x897d('0x18'));var db=require('../../mysqldb')['db'];var extensions=require('../../components/extensions/rewrite');function respondWithStatusCode(_0x385a42,_0x4df4c5){_0x4df4c5=_0x4df4c5||0xcc;return function(_0x127590){if(_0x127590){return _0x385a42[_0x897d('0x19')](_0x4df4c5);}return _0x385a42['status'](_0x4df4c5)[_0x897d('0x1a')]();};}function respondWithResult(_0x1b2b27,_0x1c1110){_0x1c1110=_0x1c1110||0xc8;return function(_0x3e5a23){if(_0x3e5a23){return _0x1b2b27[_0x897d('0x1b')](_0x1c1110)[_0x897d('0x1c')](_0x3e5a23);}};}function respondWithFilteredResult(_0x554b46,_0x291bf0){return function(_0x1b801f){if(_0x1b801f){var _0xe79c1f=typeof _0x291bf0[_0x897d('0x1d')]===_0x897d('0x1e')&&typeof _0x291bf0[_0x897d('0x1f')]===_0x897d('0x1e');var _0x1f6d96=_0x1b801f['count'];var _0x4609ba=_0xe79c1f?0x0:_0x291bf0['offset'];var _0x52af16=_0xe79c1f?_0x1b801f[_0x897d('0x20')]:_0x291bf0[_0x897d('0x1d')]+_0x291bf0[_0x897d('0x1f')];var _0x486070;if(_0x52af16>=_0x1f6d96){_0x52af16=_0x1f6d96;_0x486070=0xc8;}else{_0x486070=0xce;}_0x554b46[_0x897d('0x1b')](_0x486070);return _0x554b46['set'](_0x897d('0x21'),_0x4609ba+'-'+_0x52af16+'/'+_0x1f6d96)['json'](_0x1b801f);}return null;};}function patchUpdates(_0x2d3abc){return function(_0x375eec){try{jsonpatch[_0x897d('0x22')](_0x375eec,_0x2d3abc,!![]);}catch(_0x42b0b2){return BPromise[_0x897d('0x23')](_0x42b0b2);}return _0x375eec[_0x897d('0x24')]();};}function saveUpdates(_0x4d549c,_0x4888b2){return function(_0x117449){if(_0x117449){return _0x117449[_0x897d('0x25')](_0x4d549c)[_0x897d('0x26')](function(_0x159ebb){return _0x159ebb;});}return null;};}function removeEntity(_0x53ff9e,_0x59b505){return function(_0x456695){if(_0x456695){return _0x456695[_0x897d('0x27')]()[_0x897d('0x26')](function(){var _0x5a0f75=_0x456695['get']({'plain':!![]});var _0x1a8cda='Intervals';return db[_0x897d('0x28')]['destroy']({'where':{'type':_0x1a8cda,'resourceId':_0x5a0f75['id']}})[_0x897d('0x26')](function(){return _0x456695;});})[_0x897d('0x26')](function(){_0x53ff9e[_0x897d('0x1b')](0xcc)[_0x897d('0x1a')]();});}};}function handleEntityNotFound(_0x25a5a7,_0x15c64a){return function(_0x4ec521){if(!_0x4ec521){_0x25a5a7[_0x897d('0x19')](0x194);}return _0x4ec521;};}function handleError(_0x59ef08,_0x146575){_0x146575=_0x146575||0x1f4;return function(_0xb7f4d1){logger[_0x897d('0x29')](_0xb7f4d1[_0x897d('0x2a')]);if(_0xb7f4d1['name']){delete _0xb7f4d1[_0x897d('0x2b')];}_0x59ef08[_0x897d('0x1b')](_0x146575)['send'](_0xb7f4d1);};}exports['index']=function(_0x52c7ea,_0x7eea1e){var _0x346e66={},_0x33e1dd={},_0x3ded57={'count':0x0,'rows':[]};var _0x1a09b7=_[_0x897d('0x2c')](db[_0x897d('0x2d')][_0x897d('0x2e')],function(_0x569efe){return{'name':_0x569efe['fieldName'],'type':_0x569efe[_0x897d('0x2f')][_0x897d('0x30')]};});_0x33e1dd['model']=_[_0x897d('0x2c')](_0x1a09b7,_0x897d('0x2b'));_0x33e1dd[_0x897d('0x31')]=_[_0x897d('0x32')](_0x52c7ea[_0x897d('0x31')]);_0x33e1dd[_0x897d('0x33')]=_[_0x897d('0x34')](_0x33e1dd[_0x897d('0x35')],_0x33e1dd[_0x897d('0x31')]);_0x346e66['attributes']=_[_0x897d('0x34')](_0x33e1dd[_0x897d('0x35')],qs['fields'](_0x52c7ea[_0x897d('0x31')][_0x897d('0x36')]));_0x346e66[_0x897d('0x37')]=_0x346e66['attributes']['length']?_0x346e66[_0x897d('0x37')]:_0x33e1dd[_0x897d('0x35')];if(!_0x52c7ea[_0x897d('0x31')][_0x897d('0x38')](_0x897d('0x39'))){_0x346e66[_0x897d('0x1f')]=qs[_0x897d('0x1f')](_0x52c7ea['query'][_0x897d('0x1f')]);_0x346e66['offset']=qs[_0x897d('0x1d')](_0x52c7ea[_0x897d('0x31')][_0x897d('0x1d')]);}_0x346e66[_0x897d('0x3a')]=qs[_0x897d('0x3b')](_0x52c7ea['query']['sort']);_0x346e66[_0x897d('0x3c')]=qs['filters'](_[_0x897d('0x3d')](_0x52c7ea['query'],_0x33e1dd['filters']),_0x1a09b7);if(_0x52c7ea[_0x897d('0x31')][_0x897d('0x3e')]){_0x346e66[_0x897d('0x3c')]=_[_0x897d('0x3f')](_0x346e66['where'],{'$or':_[_0x897d('0x2c')](_0x1a09b7,function(_0x4f3193){if(_0x4f3193['type']!==_0x897d('0x40')){var _0x1876bf={};_0x1876bf[_0x4f3193[_0x897d('0x2b')]]={'$like':'%'+_0x52c7ea[_0x897d('0x31')][_0x897d('0x3e')]+'%'};return _0x1876bf;}})});}_0x346e66=_[_0x897d('0x3f')]({},_0x346e66,_0x52c7ea[_0x897d('0x41')]);var _0x21ca87={'where':_0x346e66[_0x897d('0x3c')]};return db['Interval'][_0x897d('0x20')](_0x21ca87)['then'](function(_0x322e0d){_0x3ded57[_0x897d('0x20')]=_0x322e0d;if(_0x52c7ea['query'][_0x897d('0x42')]){_0x346e66[_0x897d('0x43')]=[{'all':!![]}];}return db['Interval'][_0x897d('0x44')](_0x346e66);})[_0x897d('0x26')](function(_0x1bf5c2){_0x3ded57[_0x897d('0x45')]=_0x1bf5c2;return _0x3ded57;})['then'](respondWithFilteredResult(_0x7eea1e,_0x346e66))['catch'](handleError(_0x7eea1e,null));};exports[_0x897d('0x46')]=function(_0x38c29d,_0x57f866){var _0x44ad0f={'raw':!![],'where':{'id':_0x38c29d[_0x897d('0x47')]['id']}},_0x450398={};_0x450398[_0x897d('0x35')]=_['keys'](db[_0x897d('0x2d')][_0x897d('0x2e')]);_0x450398['query']=_[_0x897d('0x32')](_0x38c29d[_0x897d('0x31')]);_0x450398[_0x897d('0x33')]=_[_0x897d('0x34')](_0x450398[_0x897d('0x35')],_0x450398[_0x897d('0x31')]);_0x44ad0f[_0x897d('0x37')]=_[_0x897d('0x34')](_0x450398['model'],qs[_0x897d('0x36')](_0x38c29d['query']['fields']));_0x44ad0f[_0x897d('0x37')]=_0x44ad0f[_0x897d('0x37')][_0x897d('0x48')]?_0x44ad0f['attributes']:_0x450398[_0x897d('0x35')];if(_0x38c29d[_0x897d('0x31')][_0x897d('0x42')]){_0x44ad0f[_0x897d('0x43')]=[{'all':!![]}];}_0x44ad0f=_['merge']({},_0x44ad0f,_0x38c29d[_0x897d('0x41')]);return db['Interval']['find'](_0x44ad0f)[_0x897d('0x26')](handleEntityNotFound(_0x57f866,null))[_0x897d('0x26')](respondWithResult(_0x57f866,null))[_0x897d('0x49')](handleError(_0x57f866,null));};exports[_0x897d('0x4a')]=function(_0x16a9c9,_0xc333d9){return db['Interval'][_0x897d('0x4a')](_0x16a9c9[_0x897d('0x4b')],{})[_0x897d('0x26')](function(_0x3ca977){var _0x4876be=_0x16a9c9[_0x897d('0x4c')][_0x897d('0x4d')]({'plain':!![]});if(!_0x4876be)throw new Error(_0x897d('0x4e'));if(_0x4876be[_0x897d('0x4f')]===_0x897d('0x4c')){var _0x53acbf=_0x3ca977[_0x897d('0x4d')]({'plain':!![]});var _0x415b0a=_0x897d('0x50');return db[_0x897d('0x51')]['find']({'where':{'name':_0x415b0a,'userProfileId':_0x4876be[_0x897d('0x52')]},'raw':!![]})[_0x897d('0x26')](function(_0x1db1e2){if(_0x1db1e2&&_0x1db1e2[_0x897d('0x53')]===0x0){return db['UserProfileResource'][_0x897d('0x4a')]({'name':_0x53acbf['name'],'resourceId':_0x53acbf['id'],'type':_0x1db1e2[_0x897d('0x2b')],'sectionId':_0x1db1e2['id']},{})[_0x897d('0x26')](function(){return _0x3ca977;});}else{return _0x3ca977;}})['catch'](function(_0x28d568){logger['error'](_0x897d('0x54'),_0x28d568);throw _0x28d568;});}return _0x3ca977;})[_0x897d('0x26')](respondWithResult(_0xc333d9,0xc9))['catch'](handleError(_0xc333d9,null));};exports['update']=function(_0x13b96c,_0x1ef5bf){if(_0x13b96c[_0x897d('0x4b')]['id']){delete _0x13b96c[_0x897d('0x4b')]['id'];}return db['Interval'][_0x897d('0x55')]({'where':{'id':_0x13b96c[_0x897d('0x47')]['id']}})[_0x897d('0x26')](handleEntityNotFound(_0x1ef5bf,null))['then'](saveUpdates(_0x13b96c[_0x897d('0x4b')],null))['then'](respondWithResult(_0x1ef5bf,null))['catch'](handleError(_0x1ef5bf,null));};exports[_0x897d('0x27')]=function(_0x5e19fe,_0xe89313){return db['Interval'][_0x897d('0x55')]({'where':{'id':_0x5e19fe['params']['id']}})[_0x897d('0x26')](handleEntityNotFound(_0xe89313,null))[_0x897d('0x26')](removeEntity(_0xe89313,null))[_0x897d('0x49')](handleError(_0xe89313,null));};exports[_0x897d('0x56')]=function(_0x2c053f,_0x58e7e8,_0x471efd){if(_0x2c053f[_0x897d('0x4b')]['id']){delete _0x2c053f[_0x897d('0x4b')]['id'];}return db['Interval']['find']({'where':{'id':_0x2c053f[_0x897d('0x47')]['id']}})['then'](handleEntityNotFound(_0x58e7e8,null))[_0x897d('0x26')](function(_0x508a2c){if(_0x508a2c){_0x2c053f['body']['IntervalId']=_0x508a2c['id'];return db[_0x897d('0x2d')][_0x897d('0x4a')](_0x2c053f[_0x897d('0x4b')]);}})[_0x897d('0x26')](respondWithResult(_0x58e7e8,null))['catch'](handleError(_0x58e7e8,null));};exports[_0x897d('0x57')]=function(_0x3b8a7a,_0x219857,_0x20116f){var _0x390c2d={};var _0x43a177={};var _0x1da766;var _0x37b56a;return db[_0x897d('0x2d')][_0x897d('0x58')]({'where':{'id':_0x3b8a7a[_0x897d('0x47')]['id']}})[_0x897d('0x26')](handleEntityNotFound(_0x219857,null))['then'](function(_0x58072b){if(_0x58072b){_0x1da766=_0x58072b;_0x43a177[_0x897d('0x35')]=_[_0x897d('0x32')](db['Interval']['rawAttributes']);_0x43a177[_0x897d('0x31')]=_[_0x897d('0x32')](_0x3b8a7a[_0x897d('0x31')]);_0x43a177['filters']=_[_0x897d('0x34')](_0x43a177[_0x897d('0x35')],_0x43a177[_0x897d('0x31')]);_0x390c2d[_0x897d('0x37')]=_[_0x897d('0x34')](_0x43a177[_0x897d('0x35')],qs[_0x897d('0x36')](_0x3b8a7a[_0x897d('0x31')][_0x897d('0x36')]));_0x390c2d[_0x897d('0x37')]=_0x390c2d['attributes'][_0x897d('0x48')]?_0x390c2d[_0x897d('0x37')]:_0x43a177[_0x897d('0x35')];_0x390c2d[_0x897d('0x3a')]=qs['sort'](_0x3b8a7a[_0x897d('0x31')][_0x897d('0x3b')]);_0x390c2d['where']=qs[_0x897d('0x33')](_[_0x897d('0x3d')](_0x3b8a7a['query'],_0x43a177[_0x897d('0x33')]));if(_0x3b8a7a[_0x897d('0x31')][_0x897d('0x3e')]){_0x390c2d['where']=_[_0x897d('0x3f')](_0x390c2d[_0x897d('0x3c')],{'$or':_[_0x897d('0x2c')](_0x390c2d[_0x897d('0x37')],function(_0x33b8a1){var _0x2e306e={};_0x2e306e[_0x33b8a1]={'$like':'%'+_0x3b8a7a['query'][_0x897d('0x3e')]+'%'};return _0x2e306e;})});}_0x390c2d=_[_0x897d('0x3f')]({},_0x390c2d,_0x3b8a7a['options']);return _0x1da766['getIntervals'](_0x390c2d);}})[_0x897d('0x26')](function(_0x300bba){if(_0x300bba){_0x37b56a=_0x300bba['length'];if(!_0x3b8a7a['query'][_0x897d('0x38')]('nolimit')){_0x390c2d['limit']=qs['limit'](_0x3b8a7a[_0x897d('0x31')][_0x897d('0x1f')]);_0x390c2d[_0x897d('0x1d')]=qs['offset'](_0x3b8a7a[_0x897d('0x31')]['offset']);}return _0x1da766[_0x897d('0x57')](_0x390c2d);}})[_0x897d('0x26')](function(_0x1dfabc){if(_0x1dfabc){return _0x1dfabc?{'count':_0x37b56a,'rows':_0x1dfabc}:null;}})['then'](respondWithResult(_0x219857,null))['catch'](handleError(_0x219857,null));};exports[_0x897d('0x59')]=function(_0x2b4926,_0x1c928c,_0x45a0b2){return db[_0x897d('0x2d')][_0x897d('0x58')]({'where':{'id':_0x2b4926['params']['id']}})['then'](handleEntityNotFound(_0x1c928c,null))[_0x897d('0x26')](function(_0xda5aa){if(_0xda5aa){return db[_0x897d('0x5a')][_0x897d('0x5b')](function(_0x55bbfc){return db[_0x897d('0x2d')]['destroy']({'where':{'IntervalId':_0x2b4926[_0x897d('0x47')]['id']},'transaction':_0x55bbfc})[_0x897d('0x26')](function(_0xd51114){var _0xdfc2d0=_['map'](_0x2b4926[_0x897d('0x4b')],function(_0x59ecfb){delete _0x59ecfb['id'];_0x59ecfb[_0x897d('0x5c')]=_0x2b4926[_0x897d('0x47')]['id'];return _0x59ecfb;});return db[_0x897d('0x2d')][_0x897d('0x5d')](_0xdfc2d0,{'transaction':_0x55bbfc});});})['then'](function(){return db[_0x897d('0x2d')][_0x897d('0x44')]({'where':{'IntervalId':_0x2b4926[_0x897d('0x47')]['id']}});});}})[_0x897d('0x26')](respondWithResult(_0x1c928c,null))['catch'](handleError(_0x1c928c,null));}; \ No newline at end of file +var _0xceb5=['Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','addInterval','IntervalId','findOne','order','pick','options','hasOwnProperty','addIntervals','sequelize','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/license/util','../../components/extensions/rewrite','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','get','Intervals','UserProfileResource','sendStatus','stack','name','send','index','map','rawAttributes','fieldName','model','query','keys','filters','intersection','attributes','fields','length','nolimit','sort','where','filter','merge','type','VIRTUAL','includeAll','Interval','findAll','rows','catch','params','include','find','create','user'];(function(_0x3b542c,_0x43a6a4){var _0xbe9b5c=function(_0x167747){while(--_0x167747){_0x3b542c['push'](_0x3b542c['shift']());}};_0xbe9b5c(++_0x43a6a4);}(_0xceb5,0x178));var _0x5ceb=function(_0x56756b,_0x3e8cc7){_0x56756b=_0x56756b-0x0;var _0xa3002=_0xceb5[_0x56756b];return _0xa3002;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x5ceb('0x0'));var jsonpatch=require(_0x5ceb('0x1'));var rp=require(_0x5ceb('0x2'));var moment=require(_0x5ceb('0x3'));var BPromise=require(_0x5ceb('0x4'));var Mustache=require(_0x5ceb('0x5'));var util=require(_0x5ceb('0x6'));var path=require(_0x5ceb('0x7'));var sox=require(_0x5ceb('0x8'));var csv=require('to-csv');var ejs=require(_0x5ceb('0x9'));var fs=require('fs');var fs_extra=require(_0x5ceb('0xa'));var _=require(_0x5ceb('0xb'));var squel=require(_0x5ceb('0xc'));var crypto=require(_0x5ceb('0xd'));var jsforce=require(_0x5ceb('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x5ceb('0xf'));var querystring=require(_0x5ceb('0x10'));var Papa=require('papaparse');var Redis=require(_0x5ceb('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x5ceb('0x12'));var as=require(_0x5ceb('0x13'));var hardwareService=require(_0x5ceb('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0x5ceb('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x5ceb('0x16'));var db=require('../../mysqldb')['db'];var extensions=require(_0x5ceb('0x17'));function respondWithStatusCode(_0x401081,_0x490eee){_0x490eee=_0x490eee||0xcc;return function(_0x30f0fe){if(_0x30f0fe){return _0x401081['sendStatus'](_0x490eee);}return _0x401081[_0x5ceb('0x18')](_0x490eee)[_0x5ceb('0x19')]();};}function respondWithResult(_0x4b97de,_0x3538ed){_0x3538ed=_0x3538ed||0xc8;return function(_0x2ce947){if(_0x2ce947){return _0x4b97de[_0x5ceb('0x18')](_0x3538ed)[_0x5ceb('0x1a')](_0x2ce947);}};}function respondWithFilteredResult(_0x1dfe00,_0x476964){return function(_0x448fee){if(_0x448fee){var _0x5a002a=typeof _0x476964[_0x5ceb('0x1b')]===_0x5ceb('0x1c')&&typeof _0x476964[_0x5ceb('0x1d')]==='undefined';var _0x3a1bc8=_0x448fee['count'];var _0x33e979=_0x5a002a?0x0:_0x476964[_0x5ceb('0x1b')];var _0x221cb8=_0x5a002a?_0x448fee[_0x5ceb('0x1e')]:_0x476964['offset']+_0x476964[_0x5ceb('0x1d')];var _0x42d436;if(_0x221cb8>=_0x3a1bc8){_0x221cb8=_0x3a1bc8;_0x42d436=0xc8;}else{_0x42d436=0xce;}_0x1dfe00[_0x5ceb('0x18')](_0x42d436);return _0x1dfe00[_0x5ceb('0x1f')](_0x5ceb('0x20'),_0x33e979+'-'+_0x221cb8+'/'+_0x3a1bc8)[_0x5ceb('0x1a')](_0x448fee);}return null;};}function patchUpdates(_0x3e2f57){return function(_0x4510ab){try{jsonpatch[_0x5ceb('0x21')](_0x4510ab,_0x3e2f57,!![]);}catch(_0x102753){return BPromise[_0x5ceb('0x22')](_0x102753);}return _0x4510ab['save']();};}function saveUpdates(_0x229dee,_0x259578){return function(_0x35d29a){if(_0x35d29a){return _0x35d29a[_0x5ceb('0x23')](_0x229dee)[_0x5ceb('0x24')](function(_0x9365bf){return _0x9365bf;});}return null;};}function removeEntity(_0x135d97,_0x5c18bc){return function(_0x61a1be){if(_0x61a1be){return _0x61a1be[_0x5ceb('0x25')]()[_0x5ceb('0x24')](function(){var _0x321c1d=_0x61a1be[_0x5ceb('0x26')]({'plain':!![]});var _0x593497=_0x5ceb('0x27');return db[_0x5ceb('0x28')][_0x5ceb('0x25')]({'where':{'type':_0x593497,'resourceId':_0x321c1d['id']}})['then'](function(){return _0x61a1be;});})['then'](function(){_0x135d97[_0x5ceb('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5b46f2,_0x36d4da){return function(_0x4ad972){if(!_0x4ad972){_0x5b46f2[_0x5ceb('0x29')](0x194);}return _0x4ad972;};}function handleError(_0x5ad5a4,_0x54b054){_0x54b054=_0x54b054||0x1f4;return function(_0x4d2b7b){logger['error'](_0x4d2b7b[_0x5ceb('0x2a')]);if(_0x4d2b7b[_0x5ceb('0x2b')]){delete _0x4d2b7b['name'];}_0x5ad5a4[_0x5ceb('0x18')](_0x54b054)[_0x5ceb('0x2c')](_0x4d2b7b);};}exports[_0x5ceb('0x2d')]=function(_0x21c2c5,_0x3c4643){var _0xa86af6={},_0x4bf711={},_0x108bfb={'count':0x0,'rows':[]};var _0x49d96f=_[_0x5ceb('0x2e')](db['Interval'][_0x5ceb('0x2f')],function(_0x25d787){return{'name':_0x25d787[_0x5ceb('0x30')],'type':_0x25d787['type']['key']};});_0x4bf711[_0x5ceb('0x31')]=_[_0x5ceb('0x2e')](_0x49d96f,_0x5ceb('0x2b'));_0x4bf711[_0x5ceb('0x32')]=_[_0x5ceb('0x33')](_0x21c2c5[_0x5ceb('0x32')]);_0x4bf711[_0x5ceb('0x34')]=_[_0x5ceb('0x35')](_0x4bf711[_0x5ceb('0x31')],_0x4bf711['query']);_0xa86af6[_0x5ceb('0x36')]=_[_0x5ceb('0x35')](_0x4bf711[_0x5ceb('0x31')],qs['fields'](_0x21c2c5[_0x5ceb('0x32')][_0x5ceb('0x37')]));_0xa86af6[_0x5ceb('0x36')]=_0xa86af6[_0x5ceb('0x36')][_0x5ceb('0x38')]?_0xa86af6[_0x5ceb('0x36')]:_0x4bf711[_0x5ceb('0x31')];if(!_0x21c2c5[_0x5ceb('0x32')]['hasOwnProperty'](_0x5ceb('0x39'))){_0xa86af6[_0x5ceb('0x1d')]=qs['limit'](_0x21c2c5['query'][_0x5ceb('0x1d')]);_0xa86af6['offset']=qs[_0x5ceb('0x1b')](_0x21c2c5[_0x5ceb('0x32')][_0x5ceb('0x1b')]);}_0xa86af6['order']=qs['sort'](_0x21c2c5[_0x5ceb('0x32')][_0x5ceb('0x3a')]);_0xa86af6[_0x5ceb('0x3b')]=qs['filters'](_['pick'](_0x21c2c5[_0x5ceb('0x32')],_0x4bf711[_0x5ceb('0x34')]),_0x49d96f);if(_0x21c2c5[_0x5ceb('0x32')][_0x5ceb('0x3c')]){_0xa86af6[_0x5ceb('0x3b')]=_[_0x5ceb('0x3d')](_0xa86af6[_0x5ceb('0x3b')],{'$or':_[_0x5ceb('0x2e')](_0x49d96f,function(_0xa1cc4d){if(_0xa1cc4d[_0x5ceb('0x3e')]!==_0x5ceb('0x3f')){var _0x128a4a={};_0x128a4a[_0xa1cc4d[_0x5ceb('0x2b')]]={'$like':'%'+_0x21c2c5[_0x5ceb('0x32')][_0x5ceb('0x3c')]+'%'};return _0x128a4a;}})});}_0xa86af6=_[_0x5ceb('0x3d')]({},_0xa86af6,_0x21c2c5['options']);var _0x5151d1={'where':_0xa86af6[_0x5ceb('0x3b')]};return db['Interval']['count'](_0x5151d1)[_0x5ceb('0x24')](function(_0x49b399){_0x108bfb['count']=_0x49b399;if(_0x21c2c5[_0x5ceb('0x32')][_0x5ceb('0x40')]){_0xa86af6['include']=[{'all':!![]}];}return db[_0x5ceb('0x41')][_0x5ceb('0x42')](_0xa86af6);})[_0x5ceb('0x24')](function(_0x131789){_0x108bfb[_0x5ceb('0x43')]=_0x131789;return _0x108bfb;})[_0x5ceb('0x24')](respondWithFilteredResult(_0x3c4643,_0xa86af6))[_0x5ceb('0x44')](handleError(_0x3c4643,null));};exports['show']=function(_0x318a45,_0x5a54ef){var _0xe1c7d8={'raw':!![],'where':{'id':_0x318a45[_0x5ceb('0x45')]['id']}},_0x4f2534={};_0x4f2534[_0x5ceb('0x31')]=_[_0x5ceb('0x33')](db[_0x5ceb('0x41')][_0x5ceb('0x2f')]);_0x4f2534['query']=_['keys'](_0x318a45['query']);_0x4f2534[_0x5ceb('0x34')]=_[_0x5ceb('0x35')](_0x4f2534[_0x5ceb('0x31')],_0x4f2534['query']);_0xe1c7d8[_0x5ceb('0x36')]=_[_0x5ceb('0x35')](_0x4f2534['model'],qs['fields'](_0x318a45[_0x5ceb('0x32')][_0x5ceb('0x37')]));_0xe1c7d8[_0x5ceb('0x36')]=_0xe1c7d8[_0x5ceb('0x36')][_0x5ceb('0x38')]?_0xe1c7d8[_0x5ceb('0x36')]:_0x4f2534['model'];if(_0x318a45[_0x5ceb('0x32')][_0x5ceb('0x40')]){_0xe1c7d8[_0x5ceb('0x46')]=[{'all':!![]}];}_0xe1c7d8=_[_0x5ceb('0x3d')]({},_0xe1c7d8,_0x318a45['options']);return db[_0x5ceb('0x41')][_0x5ceb('0x47')](_0xe1c7d8)['then'](handleEntityNotFound(_0x5a54ef,null))['then'](respondWithResult(_0x5a54ef,null))[_0x5ceb('0x44')](handleError(_0x5a54ef,null));};exports[_0x5ceb('0x48')]=function(_0xd64390,_0x41f8fa){return db[_0x5ceb('0x41')][_0x5ceb('0x48')](_0xd64390['body'],{})[_0x5ceb('0x24')](function(_0x50845f){var _0x435e70=_0xd64390[_0x5ceb('0x49')][_0x5ceb('0x26')]({'plain':!![]});if(!_0x435e70)throw new Error(_0x5ceb('0x4a'));if(_0x435e70[_0x5ceb('0x4b')]==='user'){var _0x412ee4=_0x50845f[_0x5ceb('0x26')]({'plain':!![]});var _0x2d2de3=_0x5ceb('0x27');return db['UserProfileSection'][_0x5ceb('0x47')]({'where':{'name':_0x2d2de3,'userProfileId':_0x435e70[_0x5ceb('0x4c')]},'raw':!![]})[_0x5ceb('0x24')](function(_0x275aa4){if(_0x275aa4&&_0x275aa4[_0x5ceb('0x4d')]===0x0){return db[_0x5ceb('0x28')][_0x5ceb('0x48')]({'name':_0x412ee4[_0x5ceb('0x2b')],'resourceId':_0x412ee4['id'],'type':_0x275aa4[_0x5ceb('0x2b')],'sectionId':_0x275aa4['id']},{})['then'](function(){return _0x50845f;});}else{return _0x50845f;}})[_0x5ceb('0x44')](function(_0x11a881){logger[_0x5ceb('0x4e')](_0x5ceb('0x4f'),_0x11a881);throw _0x11a881;});}return _0x50845f;})[_0x5ceb('0x24')](respondWithResult(_0x41f8fa,0xc9))['catch'](handleError(_0x41f8fa,null));};exports['update']=function(_0x90b3ff,_0x2203c7){if(_0x90b3ff[_0x5ceb('0x50')]['id']){delete _0x90b3ff[_0x5ceb('0x50')]['id'];}return db['Interval'][_0x5ceb('0x47')]({'where':{'id':_0x90b3ff[_0x5ceb('0x45')]['id']}})[_0x5ceb('0x24')](handleEntityNotFound(_0x2203c7,null))['then'](saveUpdates(_0x90b3ff[_0x5ceb('0x50')],null))['then'](respondWithResult(_0x2203c7,null))['catch'](handleError(_0x2203c7,null));};exports[_0x5ceb('0x25')]=function(_0x5d8fdf,_0x2cc09a){return db[_0x5ceb('0x41')]['find']({'where':{'id':_0x5d8fdf[_0x5ceb('0x45')]['id']}})[_0x5ceb('0x24')](handleEntityNotFound(_0x2cc09a,null))[_0x5ceb('0x24')](removeEntity(_0x2cc09a,null))[_0x5ceb('0x44')](handleError(_0x2cc09a,null));};exports[_0x5ceb('0x51')]=function(_0x367af6,_0x248445,_0x2427f5){if(_0x367af6['body']['id']){delete _0x367af6[_0x5ceb('0x50')]['id'];}return db[_0x5ceb('0x41')][_0x5ceb('0x47')]({'where':{'id':_0x367af6[_0x5ceb('0x45')]['id']}})[_0x5ceb('0x24')](handleEntityNotFound(_0x248445,null))[_0x5ceb('0x24')](function(_0x391f3f){if(_0x391f3f){_0x367af6[_0x5ceb('0x50')][_0x5ceb('0x52')]=_0x391f3f['id'];return db[_0x5ceb('0x41')]['create'](_0x367af6[_0x5ceb('0x50')]);}})[_0x5ceb('0x24')](respondWithResult(_0x248445,null))['catch'](handleError(_0x248445,null));};exports['getIntervals']=function(_0x2e2ef7,_0x2a93dd,_0x46df74){var _0x4894cf={};var _0x404682={};var _0x3f4036;var _0xbf62c;return db[_0x5ceb('0x41')][_0x5ceb('0x53')]({'where':{'id':_0x2e2ef7['params']['id']}})[_0x5ceb('0x24')](handleEntityNotFound(_0x2a93dd,null))[_0x5ceb('0x24')](function(_0x49e8af){if(_0x49e8af){_0x3f4036=_0x49e8af;_0x404682[_0x5ceb('0x31')]=_[_0x5ceb('0x33')](db[_0x5ceb('0x41')]['rawAttributes']);_0x404682[_0x5ceb('0x32')]=_[_0x5ceb('0x33')](_0x2e2ef7[_0x5ceb('0x32')]);_0x404682['filters']=_['intersection'](_0x404682['model'],_0x404682[_0x5ceb('0x32')]);_0x4894cf[_0x5ceb('0x36')]=_[_0x5ceb('0x35')](_0x404682[_0x5ceb('0x31')],qs[_0x5ceb('0x37')](_0x2e2ef7['query'][_0x5ceb('0x37')]));_0x4894cf[_0x5ceb('0x36')]=_0x4894cf[_0x5ceb('0x36')][_0x5ceb('0x38')]?_0x4894cf[_0x5ceb('0x36')]:_0x404682[_0x5ceb('0x31')];_0x4894cf[_0x5ceb('0x54')]=qs[_0x5ceb('0x3a')](_0x2e2ef7[_0x5ceb('0x32')][_0x5ceb('0x3a')]);_0x4894cf[_0x5ceb('0x3b')]=qs[_0x5ceb('0x34')](_[_0x5ceb('0x55')](_0x2e2ef7[_0x5ceb('0x32')],_0x404682['filters']));if(_0x2e2ef7[_0x5ceb('0x32')][_0x5ceb('0x3c')]){_0x4894cf['where']=_[_0x5ceb('0x3d')](_0x4894cf[_0x5ceb('0x3b')],{'$or':_['map'](_0x4894cf[_0x5ceb('0x36')],function(_0x18272a){var _0x31ea78={};_0x31ea78[_0x18272a]={'$like':'%'+_0x2e2ef7[_0x5ceb('0x32')][_0x5ceb('0x3c')]+'%'};return _0x31ea78;})});}_0x4894cf=_[_0x5ceb('0x3d')]({},_0x4894cf,_0x2e2ef7[_0x5ceb('0x56')]);return _0x3f4036['getIntervals'](_0x4894cf);}})[_0x5ceb('0x24')](function(_0x480739){if(_0x480739){_0xbf62c=_0x480739[_0x5ceb('0x38')];if(!_0x2e2ef7[_0x5ceb('0x32')][_0x5ceb('0x57')](_0x5ceb('0x39'))){_0x4894cf[_0x5ceb('0x1d')]=qs[_0x5ceb('0x1d')](_0x2e2ef7[_0x5ceb('0x32')]['limit']);_0x4894cf[_0x5ceb('0x1b')]=qs[_0x5ceb('0x1b')](_0x2e2ef7[_0x5ceb('0x32')]['offset']);}return _0x3f4036['getIntervals'](_0x4894cf);}})[_0x5ceb('0x24')](function(_0x495f33){if(_0x495f33){return _0x495f33?{'count':_0xbf62c,'rows':_0x495f33}:null;}})[_0x5ceb('0x24')](respondWithResult(_0x2a93dd,null))['catch'](handleError(_0x2a93dd,null));};exports[_0x5ceb('0x58')]=function(_0x222120,_0x1a0e43,_0x3eacc0){return db['Interval'][_0x5ceb('0x53')]({'where':{'id':_0x222120[_0x5ceb('0x45')]['id']}})[_0x5ceb('0x24')](handleEntityNotFound(_0x1a0e43,null))[_0x5ceb('0x24')](function(_0x1b6c68){if(_0x1b6c68){return db[_0x5ceb('0x59')]['transaction'](function(_0x5036e8){return db['Interval']['destroy']({'where':{'IntervalId':_0x222120[_0x5ceb('0x45')]['id']},'transaction':_0x5036e8})[_0x5ceb('0x24')](function(_0x1022a7){var _0x11dc15=_[_0x5ceb('0x2e')](_0x222120[_0x5ceb('0x50')],function(_0x31fd70){delete _0x31fd70['id'];_0x31fd70[_0x5ceb('0x52')]=_0x222120[_0x5ceb('0x45')]['id'];return _0x31fd70;});return db[_0x5ceb('0x41')]['bulkCreate'](_0x11dc15,{'transaction':_0x5036e8});});})['then'](function(){return db[_0x5ceb('0x41')]['findAll']({'where':{'IntervalId':_0x222120[_0x5ceb('0x45')]['id']}});});}})['then'](respondWithResult(_0x1a0e43,null))[_0x5ceb('0x44')](handleError(_0x1a0e43,null));}; \ No newline at end of file diff --git a/server/api/interval/interval.model.js b/server/api/interval/interval.model.js index 9580821..82941ef 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 _0x1a9d=['rimraf','../../config/environment','../../components/extensions/rewrite','exports','Interval','tools_intervals','rewrite','lodash','../../config/logger','moment','request-promise','path'];(function(_0x4f99bf,_0x2b78b7){var _0x4f6e38=function(_0x376ce2){while(--_0x376ce2){_0x4f99bf['push'](_0x4f99bf['shift']());}};_0x4f6e38(++_0x2b78b7);}(_0x1a9d,0x16f));var _0xd1a9=function(_0x382994,_0x281003){_0x382994=_0x382994-0x0;var _0x42e8d0=_0x1a9d[_0x382994];return _0x42e8d0;};'use strict';var _=require(_0xd1a9('0x0'));var util=require('util');var logger=require(_0xd1a9('0x1'))('api');var moment=require(_0xd1a9('0x2'));var BPromise=require('bluebird');var rp=require(_0xd1a9('0x3'));var fs=require('fs');var path=require(_0xd1a9('0x4'));var rimraf=require(_0xd1a9('0x5'));var config=require(_0xd1a9('0x6'));var attributes=require('./interval.attributes');var extensions=require(_0xd1a9('0x7'));module[_0xd1a9('0x8')]=function(_0x275728,_0x1effef){return _0x275728['define'](_0xd1a9('0x9'),attributes,{'tableName':_0xd1a9('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x1b3b43,_0x52a2e6){extensions[_0xd1a9('0xb')](_0x275728,_0x1b3b43);},'afterBulkCreate':function(_0x3cd1d3,_0x251fbf,_0x2a09fd){_0x2a09fd();extensions[_0xd1a9('0xb')](_0x275728,_0x3cd1d3[0x0]);},'afterUpdate':function(_0x577b8e,_0x1b14c4){extensions[_0xd1a9('0xb')](_0x275728,_0x577b8e);},'afterDestroy':function(_0x192db8,_0x3430ee){extensions['rewrite'](_0x275728,_0x192db8);}}});}; \ No newline at end of file +var _0x4ef7=['../../components/extensions/rewrite','exports','define','tools_intervals','rewrite','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./interval.attributes'];(function(_0x39c453,_0x398b2a){var _0x5eb77c=function(_0x8e11){while(--_0x8e11){_0x39c453['push'](_0x39c453['shift']());}};_0x5eb77c(++_0x398b2a);}(_0x4ef7,0x1c7));var _0x74ef=function(_0x36efff,_0x31cb7c){_0x36efff=_0x36efff-0x0;var _0x41bffe=_0x4ef7[_0x36efff];return _0x41bffe;};'use strict';var _=require(_0x74ef('0x0'));var util=require(_0x74ef('0x1'));var logger=require('../../config/logger')(_0x74ef('0x2'));var moment=require(_0x74ef('0x3'));var BPromise=require(_0x74ef('0x4'));var rp=require(_0x74ef('0x5'));var fs=require('fs');var path=require(_0x74ef('0x6'));var rimraf=require(_0x74ef('0x7'));var config=require(_0x74ef('0x8'));var attributes=require(_0x74ef('0x9'));var extensions=require(_0x74ef('0xa'));module[_0x74ef('0xb')]=function(_0x48651e,_0x134759){return _0x48651e[_0x74ef('0xc')]('Interval',attributes,{'tableName':_0x74ef('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x5eb456,_0x304bdb){extensions[_0x74ef('0xe')](_0x48651e,_0x5eb456);},'afterBulkCreate':function(_0x428b03,_0x53fdc9,_0x7de445){_0x7de445();extensions[_0x74ef('0xe')](_0x48651e,_0x428b03[0x0]);},'afterUpdate':function(_0x48a06e,_0x46109f){extensions['rewrite'](_0x48651e,_0x48a06e);},'afterDestroy':function(_0x280189,_0x5104cd){extensions[_0x74ef('0xe')](_0x48651e,_0x280189);}}});}; \ No newline at end of file diff --git a/server/api/interval/interval.rpc.js b/server/api/interval/interval.rpc.js index 1cb7a7a..a92f909 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(_0x3c4dad,_0x25ffd5){var _0x1a4f49=function(_0x6fe6c){while(--_0x6fe6c){_0x3c4dad['push'](_0x3c4dad['shift']());}};_0x1a4f49(++_0x25ffd5);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5c3c0b,_0x4ee35e){_0x5c3c0b=_0x5c3c0b-0x0;var _0x52ecd2=_0xa9e0[_0x5c3c0b];return _0x52ecd2;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var 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(_0x2fbcf6,_0x2e7155){var _0x3e7265=function(_0x15a3c3){while(--_0x15a3c3){_0x2fbcf6['push'](_0x2fbcf6['shift']());}};_0x3e7265(++_0x2e7155);}(_0xa9e0,0x123));var _0x0a9e=function(_0x484e36,_0x4482d8){_0x484e36=_0x484e36-0x0;var _0xafc85d=_0xa9e0[_0x484e36];return _0xafc85d;};'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 5e1fbc6..8db6bab 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 _0x5f66=['send','exports','Router','./jira.controller','post','isAuthenticated'];(function(_0xf71120,_0x25b7f9){var _0xbe2fd3=function(_0x1acbdd){while(--_0x1acbdd){_0xf71120['push'](_0xf71120['shift']());}};_0xbe2fd3(++_0x25b7f9);}(_0x5f66,0x1a0));var _0x65f6=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0x5f66[_0x465028];return _0xb783d4;};'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')]);module[_0x65f6('0x5')]=router; \ No newline at end of file +var _0x2ef3=['./jira.controller','post','isAuthenticated','exports','express','Router','../../components/auth/service'];(function(_0x4f627e,_0x188f06){var _0x45c5a0=function(_0x1e25be){while(--_0x1e25be){_0x4f627e['push'](_0x4f627e['shift']());}};_0x45c5a0(++_0x188f06);}(_0x2ef3,0xba));var _0x32ef=function(_0x4675f5,_0x3b67a3){_0x4675f5=_0x4675f5-0x0;var _0x33e82a=_0x2ef3[_0x4675f5];return _0x33e82a;};'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 diff --git a/server/api/jira/jira.controller.js b/server/api/jira/jira.controller.js index 96a54f1..6fd23a5 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 _0xb635=['body','headers','x-forwarded-for','connection','remoteAddress','socket','https','../../config/logger','api','3eAmWpBVP0','key','MOTGUI','summary','description','stringify','issuetype','Bug','fields','customfield_11500','email','customfield_11501','customfield_11502','newToken','customfield_11503','name','reason','/rest/api/2/issue','POST','application/json','Basic\x20','request','setEncoding','utf8','data','end','statusCode','json','parse','error','Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','send'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb635,0x1c9));var _0x5b63=function(_0x4ee414,_0x3a26ba){_0x4ee414=_0x4ee414-0x0;var _0xfe984c=_0xb635[_0x4ee414];return _0xfe984c;};'use strict';var BPromise=require('bluebird');var https=require(_0x5b63('0x0'));var logger=require(_0x5b63('0x1'))(_0x5b63('0x2'));var USERNAME='support';var PASSWORD=_0x5b63('0x3');function openIssue(_0x3156d2,_0x53ff96){var _0x748363={'fields':{'project':{'key':_0x3156d2[_0x5b63('0x4')]||_0x5b63('0x5')},'summary':(_0x3156d2[_0x5b63('0x6')]||'Report')+'\x20from\x20'+_0x3156d2['ip'],'description':_0x3156d2[_0x5b63('0x7')]||JSON[_0x5b63('0x8')](_0x3156d2),'issuetype':{'name':_0x3156d2[_0x5b63('0x9')]||_0x5b63('0xa')}}};_0x748363[_0x5b63('0xb')][_0x5b63('0xc')]=_0x3156d2[_0x5b63('0xd')];_0x748363['fields'][_0x5b63('0xe')]=_0x3156d2['oldToken'];_0x748363[_0x5b63('0xb')][_0x5b63('0xf')]=_0x3156d2[_0x5b63('0x10')];_0x748363['fields'][_0x5b63('0x11')]=_0x3156d2[_0x5b63('0x12')];_0x748363[_0x5b63('0xb')]['customfield_11504']=_0x3156d2[_0x5b63('0x13')];_0x748363[_0x5b63('0xb')]['customfield_10102']=_0x3156d2['ip'];var _0x4dce89={'host':'track.xcallymotion.com','port':0x1bb,'path':_0x5b63('0x14'),'method':_0x5b63('0x15'),'timeout':0x4e20,'headers':{'Content-Type':_0x5b63('0x16'),'Authorization':_0x5b63('0x17')+new Buffer(USERNAME+':'+PASSWORD)['toString']('base64')}};var _0x18d77e=JSON[_0x5b63('0x8')](_0x748363);var _0x5dd867=https[_0x5b63('0x18')](_0x4dce89,function(_0x47b3b9){_0x47b3b9[_0x5b63('0x19')](_0x5b63('0x1a'));var _0x3e8a8f='';_0x47b3b9['on'](_0x5b63('0x1b'),function(_0x5a7711){_0x3e8a8f+=_0x5a7711;});_0x47b3b9['on'](_0x5b63('0x1c'),function(){if(_0x53ff96){return _0x53ff96['status'](_0x47b3b9[_0x5b63('0x1d')])[_0x5b63('0x1e')](JSON[_0x5b63('0x1f')](_0x3e8a8f));}});});_0x5dd867['on'](_0x5b63('0x20'),function(_0x125b8d){if(_0x53ff96){return _0x53ff96['status'](0x1f4)[_0x5b63('0x1e')]({'errors':[{'message':_0x5b63('0x21'),'type':'api.jira'}]});}});_0x5dd867['write'](_0x18d77e);_0x5dd867['end']();}exports['openIssue']=openIssue;exports[_0x5b63('0x22')]=function(_0x25603f,_0x3ed5be){_0x25603f[_0x5b63('0x23')]['ip']=_0x25603f[_0x5b63('0x24')][_0x5b63('0x25')]||_0x25603f[_0x5b63('0x26')][_0x5b63('0x27')]||_0x25603f[_0x5b63('0x28')][_0x5b63('0x27')]||_0x25603f[_0x5b63('0x26')]['socket'][_0x5b63('0x27')];return openIssue(_0x25603f[_0x5b63('0x23')],_0x3ed5be);}; \ No newline at end of file +var _0x57b6=['x-forwarded-for','connection','remoteAddress','socket','bluebird','../../config/logger','api','support','key','MOTGUI','summary','Report','\x20from\x20','description','stringify','issuetype','customfield_11500','email','fields','customfield_11501','oldToken','customfield_11502','newToken','reason','customfield_10102','track.xcallymotion.com','/rest/api/2/issue','POST','application/json','Basic\x20','toString','base64','request','setEncoding','utf8','data','end','statusCode','json','parse','status','Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','api.jira','write','openIssue','send','body','headers'];(function(_0x2c0af9,_0x36d649){var _0x4ba973=function(_0xea7607){while(--_0xea7607){_0x2c0af9['push'](_0x2c0af9['shift']());}};_0x4ba973(++_0x36d649);}(_0x57b6,0x1e4));var _0x657b=function(_0x29ee4f,_0x2b6200){_0x29ee4f=_0x29ee4f-0x0;var _0x1b7990=_0x57b6[_0x29ee4f];return _0x1b7990;};'use strict';var BPromise=require(_0x657b('0x0'));var https=require('https');var logger=require(_0x657b('0x1'))(_0x657b('0x2'));var USERNAME=_0x657b('0x3');var PASSWORD='3eAmWpBVP0';function openIssue(_0x2f2e4d,_0x49d7b0){var _0x1cd265={'fields':{'project':{'key':_0x2f2e4d[_0x657b('0x4')]||_0x657b('0x5')},'summary':(_0x2f2e4d[_0x657b('0x6')]||_0x657b('0x7'))+_0x657b('0x8')+_0x2f2e4d['ip'],'description':_0x2f2e4d[_0x657b('0x9')]||JSON[_0x657b('0xa')](_0x2f2e4d),'issuetype':{'name':_0x2f2e4d[_0x657b('0xb')]||'Bug'}}};_0x1cd265['fields'][_0x657b('0xc')]=_0x2f2e4d[_0x657b('0xd')];_0x1cd265[_0x657b('0xe')][_0x657b('0xf')]=_0x2f2e4d[_0x657b('0x10')];_0x1cd265[_0x657b('0xe')][_0x657b('0x11')]=_0x2f2e4d[_0x657b('0x12')];_0x1cd265[_0x657b('0xe')]['customfield_11503']=_0x2f2e4d['name'];_0x1cd265[_0x657b('0xe')]['customfield_11504']=_0x2f2e4d[_0x657b('0x13')];_0x1cd265['fields'][_0x657b('0x14')]=_0x2f2e4d['ip'];var _0x19c8d6={'host':_0x657b('0x15'),'port':0x1bb,'path':_0x657b('0x16'),'method':_0x657b('0x17'),'timeout':0x4e20,'headers':{'Content-Type':_0x657b('0x18'),'Authorization':_0x657b('0x19')+new Buffer(USERNAME+':'+PASSWORD)[_0x657b('0x1a')](_0x657b('0x1b'))}};var _0x37014d=JSON[_0x657b('0xa')](_0x1cd265);var _0x5f3c11=https[_0x657b('0x1c')](_0x19c8d6,function(_0x29ea1b){_0x29ea1b[_0x657b('0x1d')](_0x657b('0x1e'));var _0x523681='';_0x29ea1b['on'](_0x657b('0x1f'),function(_0x4e6bed){_0x523681+=_0x4e6bed;});_0x29ea1b['on'](_0x657b('0x20'),function(){if(_0x49d7b0){return _0x49d7b0['status'](_0x29ea1b[_0x657b('0x21')])[_0x657b('0x22')](JSON[_0x657b('0x23')](_0x523681));}});});_0x5f3c11['on']('error',function(_0x2d7d4b){if(_0x49d7b0){return _0x49d7b0[_0x657b('0x24')](0x1f4)['json']({'errors':[{'message':_0x657b('0x25'),'type':_0x657b('0x26')}]});}});_0x5f3c11[_0x657b('0x27')](_0x37014d);_0x5f3c11[_0x657b('0x20')]();}exports[_0x657b('0x28')]=openIssue;exports[_0x657b('0x29')]=function(_0x5e7013,_0x307501){_0x5e7013[_0x657b('0x2a')]['ip']=_0x5e7013[_0x657b('0x2b')][_0x657b('0x2c')]||_0x5e7013[_0x657b('0x2d')][_0x657b('0x2e')]||_0x5e7013['socket'][_0x657b('0x2e')]||_0x5e7013['connection'][_0x657b('0x2f')][_0x657b('0x2e')];return openIssue(_0x5e7013[_0x657b('0x2a')],_0x307501);}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/index.js b/server/api/jscriptyAnswerReport/index.js index 3b7d5d7..5a3302b 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 _0xb903=['../../components/interaction/service','../../config/environment','./jscriptyAnswerReport.controller','get','index','isAuthenticated','describe','/:id','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service'];(function(_0xf3375f,_0x396425){var _0x2cd1dc=function(_0x15ab1e){while(--_0x15ab1e){_0xf3375f['push'](_0xf3375f['shift']());}};_0x2cd1dc(++_0x396425);}(_0xb903,0x185));var _0x3b90=function(_0x34bcc7,_0x224ea4){_0x34bcc7=_0x34bcc7-0x0;var _0xd710e0=_0xb903[_0x34bcc7];return _0xd710e0;};'use strict';var multer=require(_0x3b90('0x0'));var util=require(_0x3b90('0x1'));var path=require(_0x3b90('0x2'));var timeout=require(_0x3b90('0x3'));var express=require('express');var router=express[_0x3b90('0x4')]();var fs_extra=require(_0x3b90('0x5'));var auth=require(_0x3b90('0x6'));var interaction=require(_0x3b90('0x7'));var config=require(_0x3b90('0x8'));var controller=require(_0x3b90('0x9'));router[_0x3b90('0xa')]('/',auth['isAuthenticated'](),controller[_0x3b90('0xb')]);router['get']('/describe',auth[_0x3b90('0xc')](),controller[_0x3b90('0xd')]);router[_0x3b90('0xa')](_0x3b90('0xe'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x3b90('0xe'),auth[_0x3b90('0xc')](),controller['update']);router[_0x3b90('0xf')](_0x3b90('0xe'),auth['isAuthenticated'](),controller[_0x3b90('0x10')]);module[_0x3b90('0x11')]=router; \ No newline at end of file +var _0x0bb5=['describe','show','post','put','/:id','update','delete','exports','multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyAnswerReport.controller','get','/describe','isAuthenticated'];(function(_0x211eb9,_0x5075c7){var _0x19a5a2=function(_0x2740d0){while(--_0x2740d0){_0x211eb9['push'](_0x211eb9['shift']());}};_0x19a5a2(++_0x5075c7);}(_0x0bb5,0x148));var _0x50bb=function(_0x33b274,_0x2af125){_0x33b274=_0x33b274-0x0;var _0x1bee24=_0x0bb5[_0x33b274];return _0x1bee24;};'use strict';var multer=require(_0x50bb('0x0'));var util=require(_0x50bb('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x50bb('0x2'));var router=express[_0x50bb('0x3')]();var fs_extra=require(_0x50bb('0x4'));var auth=require(_0x50bb('0x5'));var interaction=require(_0x50bb('0x6'));var config=require(_0x50bb('0x7'));var controller=require(_0x50bb('0x8'));router[_0x50bb('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x50bb('0x9')](_0x50bb('0xa'),auth[_0x50bb('0xb')](),controller[_0x50bb('0xc')]);router['get']('/:id',auth[_0x50bb('0xb')](),controller[_0x50bb('0xd')]);router[_0x50bb('0xe')]('/',auth[_0x50bb('0xb')](),controller['create']);router[_0x50bb('0xf')](_0x50bb('0x10'),auth[_0x50bb('0xb')](),controller[_0x50bb('0x11')]);router[_0x50bb('0x12')](_0x50bb('0x10'),auth[_0x50bb('0xb')](),controller['destroy']);module[_0x50bb('0x13')]=router; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js index 205d055..103bf38 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(_0x1928c9,_0x13a6d1){var _0x51b5fb=function(_0x24cf70){while(--_0x24cf70){_0x1928c9['push'](_0x1928c9['shift']());}};_0x51b5fb(++_0x13a6d1);}(_0x7a54,0x106));var _0x47a5=function(_0x274511,_0x28e673){_0x274511=_0x274511-0x0;var _0x1bca82=_0x7a54[_0x274511];return _0x1bca82;};'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(_0x1969a7,_0x5a133a){var _0x3d665f=function(_0x39c64b){while(--_0x39c64b){_0x1969a7['push'](_0x1969a7['shift']());}};_0x3d665f(++_0x5a133a);}(_0x7a54,0x106));var _0x47a5=function(_0x415c10,_0x9f3665){_0x415c10=_0x415c10-0x0;var _0xf592b1=_0x7a54[_0x415c10];return _0xf592b1;};'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 38d5e9f..8b83f7e 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 _0xe0ae=['where','pick','merge','VIRTUAL','filter','options','include','findAll','rows','params','includeAll','catch','create','body','update','find','describe','zip-dir','fast-json-patch','moment','mustache','util','sox','fs-extra','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','end','error','stack','name','send','index','JscriptyAnswerReport','rawAttributes','fieldName','type','key','map','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','sort'];(function(_0x459423,_0x3416a8){var _0x42ed14=function(_0x1d4f69){while(--_0x1d4f69){_0x459423['push'](_0x459423['shift']());}};_0x42ed14(++_0x3416a8);}(_0xe0ae,0xa1));var _0xee0a=function(_0x3815c2,_0x1f54e3){_0x3815c2=_0x3815c2-0x0;var _0x271f88=_0xe0ae[_0x3815c2];return _0x271f88;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xee0a('0x0'));var jsonpatch=require(_0xee0a('0x1'));var rp=require('request-promise');var moment=require(_0xee0a('0x2'));var BPromise=require('bluebird');var Mustache=require(_0xee0a('0x3'));var util=require(_0xee0a('0x4'));var path=require('path');var sox=require(_0xee0a('0x5'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xee0a('0x6'));var _=require(_0xee0a('0x7'));var squel=require(_0xee0a('0x8'));var crypto=require(_0xee0a('0x9'));var jsforce=require('jsforce');var deskjs=require(_0xee0a('0xa'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xee0a('0xb'));var Redis=require(_0xee0a('0xc'));var authService=require(_0xee0a('0xd'));var qs=require('../../components/parsers/qs');var as=require(_0xee0a('0xe'));var hardwareService=require(_0xee0a('0xf'));var logger=require('../../config/logger')(_0xee0a('0x10'));var utils=require('../../config/utils');var config=require(_0xee0a('0x11'));var licenseUtil=require(_0xee0a('0x12'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1fcf59,_0x5c56d9){_0x5c56d9=_0x5c56d9||0xcc;return function(_0x32fad9){if(_0x32fad9){return _0x1fcf59[_0xee0a('0x13')](_0x5c56d9);}return _0x1fcf59['status'](_0x5c56d9)['end']();};}function respondWithResult(_0x325a8e,_0x41b70a){_0x41b70a=_0x41b70a||0xc8;return function(_0x347604){if(_0x347604){return _0x325a8e[_0xee0a('0x14')](_0x41b70a)[_0xee0a('0x15')](_0x347604);}};}function respondWithFilteredResult(_0x57afe6,_0xb891a9){return function(_0xd39431){if(_0xd39431){var _0x50063f=typeof _0xb891a9[_0xee0a('0x16')]===_0xee0a('0x17')&&typeof _0xb891a9[_0xee0a('0x18')]===_0xee0a('0x17');var _0x4f711b=_0xd39431[_0xee0a('0x19')];var _0x1d7a8a=_0x50063f?0x0:_0xb891a9[_0xee0a('0x16')];var _0x55c474=_0x50063f?_0xd39431[_0xee0a('0x19')]:_0xb891a9[_0xee0a('0x16')]+_0xb891a9[_0xee0a('0x18')];var _0x24f8f1;if(_0x55c474>=_0x4f711b){_0x55c474=_0x4f711b;_0x24f8f1=0xc8;}else{_0x24f8f1=0xce;}_0x57afe6['status'](_0x24f8f1);return _0x57afe6[_0xee0a('0x1a')](_0xee0a('0x1b'),_0x1d7a8a+'-'+_0x55c474+'/'+_0x4f711b)[_0xee0a('0x15')](_0xd39431);}return null;};}function patchUpdates(_0x201d32){return function(_0x5c981e){try{jsonpatch[_0xee0a('0x1c')](_0x5c981e,_0x201d32,!![]);}catch(_0xff2f14){return BPromise[_0xee0a('0x1d')](_0xff2f14);}return _0x5c981e[_0xee0a('0x1e')]();};}function saveUpdates(_0x39fa96,_0x1eb176){return function(_0x2c543c){if(_0x2c543c){return _0x2c543c['update'](_0x39fa96)[_0xee0a('0x1f')](function(_0x3d5459){return _0x3d5459;});}return null;};}function removeEntity(_0x27989c,_0x38d029){return function(_0x567810){if(_0x567810){return _0x567810[_0xee0a('0x20')]()[_0xee0a('0x1f')](function(){_0x27989c[_0xee0a('0x14')](0xcc)[_0xee0a('0x21')]();});}};}function handleEntityNotFound(_0x4c61e2,_0x50e9d1){return function(_0x578ecf){if(!_0x578ecf){_0x4c61e2[_0xee0a('0x13')](0x194);}return _0x578ecf;};}function handleError(_0x4f9f56,_0x5c7cfa){_0x5c7cfa=_0x5c7cfa||0x1f4;return function(_0x1c9ad8){logger[_0xee0a('0x22')](_0x1c9ad8[_0xee0a('0x23')]);if(_0x1c9ad8['name']){delete _0x1c9ad8[_0xee0a('0x24')];}_0x4f9f56[_0xee0a('0x14')](_0x5c7cfa)[_0xee0a('0x25')](_0x1c9ad8);};}exports[_0xee0a('0x26')]=function(_0x2e7f18,_0x45538d){var _0x145332={},_0x408909={},_0x65e054={'count':0x0,'rows':[]};var _0x7b472b=_['map'](db[_0xee0a('0x27')][_0xee0a('0x28')],function(_0x284be5){return{'name':_0x284be5[_0xee0a('0x29')],'type':_0x284be5[_0xee0a('0x2a')][_0xee0a('0x2b')]};});_0x408909['model']=_[_0xee0a('0x2c')](_0x7b472b,_0xee0a('0x24'));_0x408909[_0xee0a('0x2d')]=_[_0xee0a('0x2e')](_0x2e7f18['query']);_0x408909[_0xee0a('0x2f')]=_['intersection'](_0x408909[_0xee0a('0x30')],_0x408909[_0xee0a('0x2d')]);_0x145332[_0xee0a('0x31')]=_[_0xee0a('0x32')](_0x408909[_0xee0a('0x30')],qs[_0xee0a('0x33')](_0x2e7f18[_0xee0a('0x2d')][_0xee0a('0x33')]));_0x145332['attributes']=_0x145332[_0xee0a('0x31')][_0xee0a('0x34')]?_0x145332['attributes']:_0x408909[_0xee0a('0x30')];if(!_0x2e7f18[_0xee0a('0x2d')][_0xee0a('0x35')]('nolimit')){_0x145332[_0xee0a('0x18')]=qs[_0xee0a('0x18')](_0x2e7f18[_0xee0a('0x2d')]['limit']);_0x145332[_0xee0a('0x16')]=qs[_0xee0a('0x16')](_0x2e7f18[_0xee0a('0x2d')]['offset']);}_0x145332['order']=qs[_0xee0a('0x36')](_0x2e7f18[_0xee0a('0x2d')][_0xee0a('0x36')]);_0x145332[_0xee0a('0x37')]=qs[_0xee0a('0x2f')](_[_0xee0a('0x38')](_0x2e7f18[_0xee0a('0x2d')],_0x408909[_0xee0a('0x2f')]),_0x7b472b);if(_0x2e7f18[_0xee0a('0x2d')]['filter']){_0x145332[_0xee0a('0x37')]=_[_0xee0a('0x39')](_0x145332['where'],{'$or':_[_0xee0a('0x2c')](_0x7b472b,function(_0x20a6f2){if(_0x20a6f2['type']!==_0xee0a('0x3a')){var _0x22b1c0={};_0x22b1c0[_0x20a6f2[_0xee0a('0x24')]]={'$like':'%'+_0x2e7f18[_0xee0a('0x2d')][_0xee0a('0x3b')]+'%'};return _0x22b1c0;}})});}_0x145332=_[_0xee0a('0x39')]({},_0x145332,_0x2e7f18[_0xee0a('0x3c')]);var _0x1b88df={'where':_0x145332[_0xee0a('0x37')]};return db['JscriptyAnswerReport'][_0xee0a('0x19')](_0x1b88df)[_0xee0a('0x1f')](function(_0x41eba8){_0x65e054[_0xee0a('0x19')]=_0x41eba8;if(_0x2e7f18['query']['includeAll']){_0x145332[_0xee0a('0x3d')]=[{'all':!![]}];}return db[_0xee0a('0x27')][_0xee0a('0x3e')](_0x145332);})[_0xee0a('0x1f')](function(_0x1b69b9){_0x65e054[_0xee0a('0x3f')]=_0x1b69b9;return _0x65e054;})[_0xee0a('0x1f')](respondWithFilteredResult(_0x45538d,_0x145332))['catch'](handleError(_0x45538d,null));};exports['show']=function(_0x285543,_0x283062){var _0x587ee3={'raw':!![],'where':{'id':_0x285543[_0xee0a('0x40')]['id']}},_0x3293b5={};_0x3293b5['model']=_[_0xee0a('0x2e')](db[_0xee0a('0x27')][_0xee0a('0x28')]);_0x3293b5[_0xee0a('0x2d')]=_[_0xee0a('0x2e')](_0x285543[_0xee0a('0x2d')]);_0x3293b5[_0xee0a('0x2f')]=_['intersection'](_0x3293b5['model'],_0x3293b5[_0xee0a('0x2d')]);_0x587ee3['attributes']=_['intersection'](_0x3293b5['model'],qs[_0xee0a('0x33')](_0x285543[_0xee0a('0x2d')]['fields']));_0x587ee3['attributes']=_0x587ee3['attributes']['length']?_0x587ee3[_0xee0a('0x31')]:_0x3293b5[_0xee0a('0x30')];if(_0x285543[_0xee0a('0x2d')][_0xee0a('0x41')]){_0x587ee3[_0xee0a('0x3d')]=[{'all':!![]}];}_0x587ee3=_[_0xee0a('0x39')]({},_0x587ee3,_0x285543['options']);return db[_0xee0a('0x27')]['find'](_0x587ee3)[_0xee0a('0x1f')](handleEntityNotFound(_0x283062,null))[_0xee0a('0x1f')](respondWithResult(_0x283062,null))[_0xee0a('0x42')](handleError(_0x283062,null));};exports[_0xee0a('0x43')]=function(_0x567680,_0x3ef07b){return db[_0xee0a('0x27')][_0xee0a('0x43')](_0x567680[_0xee0a('0x44')],{})[_0xee0a('0x1f')](respondWithResult(_0x3ef07b,0xc9))[_0xee0a('0x42')](handleError(_0x3ef07b,null));};exports[_0xee0a('0x45')]=function(_0x4cd7d3,_0x51300e){if(_0x4cd7d3[_0xee0a('0x44')]['id']){delete _0x4cd7d3[_0xee0a('0x44')]['id'];}return db[_0xee0a('0x27')][_0xee0a('0x46')]({'where':{'id':_0x4cd7d3[_0xee0a('0x40')]['id']}})[_0xee0a('0x1f')](handleEntityNotFound(_0x51300e,null))[_0xee0a('0x1f')](saveUpdates(_0x4cd7d3[_0xee0a('0x44')],null))[_0xee0a('0x1f')](respondWithResult(_0x51300e,null))[_0xee0a('0x42')](handleError(_0x51300e,null));};exports[_0xee0a('0x20')]=function(_0x335356,_0x57face){return db[_0xee0a('0x27')][_0xee0a('0x46')]({'where':{'id':_0x335356[_0xee0a('0x40')]['id']}})[_0xee0a('0x1f')](handleEntityNotFound(_0x57face,null))[_0xee0a('0x1f')](removeEntity(_0x57face,null))['catch'](handleError(_0x57face,null));};exports[_0xee0a('0x47')]=function(_0x160123,_0xc9c3a3){return db[_0xee0a('0x27')][_0xee0a('0x47')]()['then'](respondWithResult(_0xc9c3a3,null))[_0xee0a('0x42')](handleError(_0xc9c3a3,null));}; \ No newline at end of file +var _0x307e=['../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','index','map','rawAttributes','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filter','where','merge','options','includeAll','include','findAll','catch','params','JscriptyAnswerReport','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','to-csv','ejs','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'];(function(_0x55534d,_0x23bea1){var _0xaf68a0=function(_0x54be2e){while(--_0x54be2e){_0x55534d['push'](_0x55534d['shift']());}};_0xaf68a0(++_0x23bea1);}(_0x307e,0xc9));var _0xe307=function(_0x2c9b76,_0x4eeb32){_0x2c9b76=_0x2c9b76-0x0;var _0x1b05a4=_0x307e[_0x2c9b76];return _0x1b05a4;};'use strict';var emlformat=require(_0xe307('0x0'));var rimraf=require(_0xe307('0x1'));var zipdir=require(_0xe307('0x2'));var jsonpatch=require(_0xe307('0x3'));var rp=require(_0xe307('0x4'));var moment=require('moment');var BPromise=require(_0xe307('0x5'));var Mustache=require(_0xe307('0x6'));var util=require('util');var path=require(_0xe307('0x7'));var sox=require('sox');var csv=require(_0xe307('0x8'));var ejs=require(_0xe307('0x9'));var fs=require('fs');var fs_extra=require(_0xe307('0xa'));var _=require('lodash');var squel=require(_0xe307('0xb'));var crypto=require(_0xe307('0xc'));var jsforce=require(_0xe307('0xd'));var deskjs=require(_0xe307('0xe'));var toCsv=require(_0xe307('0x8'));var querystring=require(_0xe307('0xf'));var Papa=require(_0xe307('0x10'));var Redis=require(_0xe307('0x11'));var authService=require(_0xe307('0x12'));var qs=require(_0xe307('0x13'));var as=require(_0xe307('0x14'));var hardwareService=require(_0xe307('0x15'));var logger=require(_0xe307('0x16'))(_0xe307('0x17'));var utils=require(_0xe307('0x18'));var config=require(_0xe307('0x19'));var licenseUtil=require(_0xe307('0x1a'));var db=require(_0xe307('0x1b'))['db'];function respondWithStatusCode(_0x321c99,_0x19fde7){_0x19fde7=_0x19fde7||0xcc;return function(_0x51b237){if(_0x51b237){return _0x321c99[_0xe307('0x1c')](_0x19fde7);}return _0x321c99[_0xe307('0x1d')](_0x19fde7)['end']();};}function respondWithResult(_0x3faac5,_0x2eeb8e){_0x2eeb8e=_0x2eeb8e||0xc8;return function(_0x2d3a73){if(_0x2d3a73){return _0x3faac5[_0xe307('0x1d')](_0x2eeb8e)[_0xe307('0x1e')](_0x2d3a73);}};}function respondWithFilteredResult(_0x22a241,_0x46b0d6){return function(_0x58f715){if(_0x58f715){var _0x2abf63=typeof _0x46b0d6[_0xe307('0x1f')]===_0xe307('0x20')&&typeof _0x46b0d6[_0xe307('0x21')]===_0xe307('0x20');var _0x52f83b=_0x58f715['count'];var _0xbc07f=_0x2abf63?0x0:_0x46b0d6['offset'];var _0x37a8c9=_0x2abf63?_0x58f715[_0xe307('0x22')]:_0x46b0d6[_0xe307('0x1f')]+_0x46b0d6[_0xe307('0x21')];var _0x40e290;if(_0x37a8c9>=_0x52f83b){_0x37a8c9=_0x52f83b;_0x40e290=0xc8;}else{_0x40e290=0xce;}_0x22a241[_0xe307('0x1d')](_0x40e290);return _0x22a241[_0xe307('0x23')](_0xe307('0x24'),_0xbc07f+'-'+_0x37a8c9+'/'+_0x52f83b)[_0xe307('0x1e')](_0x58f715);}return null;};}function patchUpdates(_0x155208){return function(_0x1abdd1){try{jsonpatch[_0xe307('0x25')](_0x1abdd1,_0x155208,!![]);}catch(_0x394bde){return BPromise[_0xe307('0x26')](_0x394bde);}return _0x1abdd1[_0xe307('0x27')]();};}function saveUpdates(_0x48ab0e,_0x269e06){return function(_0x1ec000){if(_0x1ec000){return _0x1ec000[_0xe307('0x28')](_0x48ab0e)[_0xe307('0x29')](function(_0x4fdf45){return _0x4fdf45;});}return null;};}function removeEntity(_0x173244,_0x5d8bcb){return function(_0x9c9503){if(_0x9c9503){return _0x9c9503[_0xe307('0x2a')]()[_0xe307('0x29')](function(){_0x173244['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x405ef6,_0x11fe69){return function(_0x3b169f){if(!_0x3b169f){_0x405ef6[_0xe307('0x1c')](0x194);}return _0x3b169f;};}function handleError(_0xe4e3ee,_0x22bb34){_0x22bb34=_0x22bb34||0x1f4;return function(_0x2651ec){logger[_0xe307('0x2b')](_0x2651ec[_0xe307('0x2c')]);if(_0x2651ec['name']){delete _0x2651ec[_0xe307('0x2d')];}_0xe4e3ee[_0xe307('0x1d')](_0x22bb34)['send'](_0x2651ec);};}exports[_0xe307('0x2e')]=function(_0x51769d,_0x51586d){var _0x2e36f2={},_0x2b0f20={},_0x2ac72a={'count':0x0,'rows':[]};var _0x5758a4=_[_0xe307('0x2f')](db['JscriptyAnswerReport'][_0xe307('0x30')],function(_0x4b17ce){return{'name':_0x4b17ce['fieldName'],'type':_0x4b17ce['type']['key']};});_0x2b0f20[_0xe307('0x31')]=_[_0xe307('0x2f')](_0x5758a4,'name');_0x2b0f20[_0xe307('0x32')]=_[_0xe307('0x33')](_0x51769d[_0xe307('0x32')]);_0x2b0f20[_0xe307('0x34')]=_['intersection'](_0x2b0f20[_0xe307('0x31')],_0x2b0f20['query']);_0x2e36f2['attributes']=_[_0xe307('0x35')](_0x2b0f20[_0xe307('0x31')],qs[_0xe307('0x36')](_0x51769d[_0xe307('0x32')]['fields']));_0x2e36f2[_0xe307('0x37')]=_0x2e36f2['attributes'][_0xe307('0x38')]?_0x2e36f2[_0xe307('0x37')]:_0x2b0f20['model'];if(!_0x51769d[_0xe307('0x32')][_0xe307('0x39')](_0xe307('0x3a'))){_0x2e36f2[_0xe307('0x21')]=qs['limit'](_0x51769d['query'][_0xe307('0x21')]);_0x2e36f2[_0xe307('0x1f')]=qs['offset'](_0x51769d[_0xe307('0x32')][_0xe307('0x1f')]);}_0x2e36f2[_0xe307('0x3b')]=qs['sort'](_0x51769d[_0xe307('0x32')][_0xe307('0x3c')]);_0x2e36f2['where']=qs['filters'](_['pick'](_0x51769d[_0xe307('0x32')],_0x2b0f20['filters']),_0x5758a4);if(_0x51769d[_0xe307('0x32')][_0xe307('0x3d')]){_0x2e36f2[_0xe307('0x3e')]=_[_0xe307('0x3f')](_0x2e36f2['where'],{'$or':_[_0xe307('0x2f')](_0x5758a4,function(_0xd3a160){if(_0xd3a160['type']!=='VIRTUAL'){var _0x8f65ce={};_0x8f65ce[_0xd3a160['name']]={'$like':'%'+_0x51769d['query'][_0xe307('0x3d')]+'%'};return _0x8f65ce;}})});}_0x2e36f2=_[_0xe307('0x3f')]({},_0x2e36f2,_0x51769d[_0xe307('0x40')]);var _0x35f3e1={'where':_0x2e36f2[_0xe307('0x3e')]};return db['JscriptyAnswerReport']['count'](_0x35f3e1)[_0xe307('0x29')](function(_0x2b65d0){_0x2ac72a[_0xe307('0x22')]=_0x2b65d0;if(_0x51769d['query'][_0xe307('0x41')]){_0x2e36f2[_0xe307('0x42')]=[{'all':!![]}];}return db['JscriptyAnswerReport'][_0xe307('0x43')](_0x2e36f2);})['then'](function(_0x18af6a){_0x2ac72a['rows']=_0x18af6a;return _0x2ac72a;})['then'](respondWithFilteredResult(_0x51586d,_0x2e36f2))[_0xe307('0x44')](handleError(_0x51586d,null));};exports['show']=function(_0xc8468e,_0x137322){var _0x24cad8={'raw':!![],'where':{'id':_0xc8468e[_0xe307('0x45')]['id']}},_0xc81c05={};_0xc81c05[_0xe307('0x31')]=_[_0xe307('0x33')](db[_0xe307('0x46')]['rawAttributes']);_0xc81c05[_0xe307('0x32')]=_[_0xe307('0x33')](_0xc8468e[_0xe307('0x32')]);_0xc81c05[_0xe307('0x34')]=_[_0xe307('0x35')](_0xc81c05[_0xe307('0x31')],_0xc81c05[_0xe307('0x32')]);_0x24cad8[_0xe307('0x37')]=_[_0xe307('0x35')](_0xc81c05['model'],qs[_0xe307('0x36')](_0xc8468e[_0xe307('0x32')][_0xe307('0x36')]));_0x24cad8[_0xe307('0x37')]=_0x24cad8[_0xe307('0x37')][_0xe307('0x38')]?_0x24cad8[_0xe307('0x37')]:_0xc81c05['model'];if(_0xc8468e[_0xe307('0x32')]['includeAll']){_0x24cad8[_0xe307('0x42')]=[{'all':!![]}];}_0x24cad8=_[_0xe307('0x3f')]({},_0x24cad8,_0xc8468e['options']);return db['JscriptyAnswerReport'][_0xe307('0x47')](_0x24cad8)[_0xe307('0x29')](handleEntityNotFound(_0x137322,null))[_0xe307('0x29')](respondWithResult(_0x137322,null))[_0xe307('0x44')](handleError(_0x137322,null));};exports['create']=function(_0x23bd80,_0x1c6dd6){return db[_0xe307('0x46')][_0xe307('0x48')](_0x23bd80[_0xe307('0x49')],{})[_0xe307('0x29')](respondWithResult(_0x1c6dd6,0xc9))['catch'](handleError(_0x1c6dd6,null));};exports[_0xe307('0x28')]=function(_0x407303,_0xf2873b){if(_0x407303[_0xe307('0x49')]['id']){delete _0x407303[_0xe307('0x49')]['id'];}return db[_0xe307('0x46')][_0xe307('0x47')]({'where':{'id':_0x407303[_0xe307('0x45')]['id']}})[_0xe307('0x29')](handleEntityNotFound(_0xf2873b,null))[_0xe307('0x29')](saveUpdates(_0x407303['body'],null))[_0xe307('0x29')](respondWithResult(_0xf2873b,null))['catch'](handleError(_0xf2873b,null));};exports[_0xe307('0x2a')]=function(_0x15581e,_0x69d083){return db[_0xe307('0x46')][_0xe307('0x47')]({'where':{'id':_0x15581e[_0xe307('0x45')]['id']}})['then'](handleEntityNotFound(_0x69d083,null))[_0xe307('0x29')](removeEntity(_0x69d083,null))['catch'](handleError(_0x69d083,null));};exports[_0xe307('0x4a')]=function(_0x43518f,_0x456b32){return db['JscriptyAnswerReport']['describe']()[_0xe307('0x29')](respondWithResult(_0x456b32,null))[_0xe307('0x44')](handleError(_0x456b32,null));}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js index 81992b4..604c012 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 _0x4d6a=['bluebird','request-promise','path','rimraf','./jscriptyAnswerReport.attributes','exports','define','util','../../config/logger','moment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4d6a,0x147));var _0xa4d6=function(_0x4852f9,_0x4ee5b1){_0x4852f9=_0x4852f9-0x0;var _0x593806=_0x4d6a[_0x4852f9];return _0x593806;};'use strict';var _=require('lodash');var util=require(_0xa4d6('0x0'));var logger=require(_0xa4d6('0x1'))('api');var moment=require(_0xa4d6('0x2'));var BPromise=require(_0xa4d6('0x3'));var rp=require(_0xa4d6('0x4'));var fs=require('fs');var path=require(_0xa4d6('0x5'));var rimraf=require(_0xa4d6('0x6'));var config=require('../../config/environment');var attributes=require(_0xa4d6('0x7'));module[_0xa4d6('0x8')]=function(_0x1ef6d7,_0x2794ce){return _0x1ef6d7[_0xa4d6('0x9')]('JscriptyAnswerReport',attributes,{'tableName':'report_jscripty_answers','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd7cc=['JscriptyAnswerReport','report_jscripty_answers','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./jscriptyAnswerReport.attributes','exports','define'];(function(_0x47cde9,_0x19d013){var _0x26fdf1=function(_0x32fb69){while(--_0x32fb69){_0x47cde9['push'](_0x47cde9['shift']());}};_0x26fdf1(++_0x19d013);}(_0xd7cc,0x128));var _0xcd7c=function(_0x3cca44,_0x1451a1){_0x3cca44=_0x3cca44-0x0;var _0x259b73=_0xd7cc[_0x3cca44];return _0x259b73;};'use strict';var _=require(_0xcd7c('0x0'));var util=require(_0xcd7c('0x1'));var logger=require(_0xcd7c('0x2'))(_0xcd7c('0x3'));var moment=require(_0xcd7c('0x4'));var BPromise=require(_0xcd7c('0x5'));var rp=require(_0xcd7c('0x6'));var fs=require('fs');var path=require(_0xcd7c('0x7'));var rimraf=require(_0xcd7c('0x8'));var config=require('../../config/environment');var attributes=require(_0xcd7c('0x9'));module[_0xcd7c('0xa')]=function(_0x5564a7,_0x26d967){return _0x5564a7[_0xcd7c('0xb')](_0xcd7c('0xc'),attributes,{'tableName':_0xcd7c('0xd'),'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 56b2bcd..c08224b 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 _0x830a=['client','request','then','info','JscriptyAnswerReport,\x20%s,\x20%s','request\x20sent','debug','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise'];(function(_0x2070da,_0x45e586){var _0x4f9fe1=function(_0x5b6f2a){while(--_0x5b6f2a){_0x2070da['push'](_0x2070da['shift']());}};_0x4f9fe1(++_0x45e586);}(_0x830a,0x175));var _0xa830=function(_0x4c3e0f,_0x398709){_0x4c3e0f=_0x4c3e0f-0x0;var _0x507fc2=_0x830a[_0x4c3e0f];return _0x507fc2;};'use strict';var _=require('lodash');var util=require(_0xa830('0x0'));var moment=require('moment');var BPromise=require(_0xa830('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa830('0x2'));var db=require(_0xa830('0x3'))['db'];var utils=require(_0xa830('0x4'));var logger=require(_0xa830('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0xa830('0x6'));var client=jayson[_0xa830('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4be1c0,_0x3af88f,_0x956b26){return new BPromise(function(_0xa8719a,_0x449f4a){return client[_0xa830('0x8')](_0x4be1c0,_0x956b26)[_0xa830('0x9')](function(_0x29909d){logger[_0xa830('0xa')](_0xa830('0xb'),_0x3af88f,_0xa830('0xc'));logger[_0xa830('0xd')](_0xa830('0xe'),_0x3af88f,'request\x20sent',JSON['stringify'](_0x29909d));if(_0x29909d[_0xa830('0xf')]){if(_0x29909d[_0xa830('0xf')][_0xa830('0x10')]===0x1f4){logger['error'](_0xa830('0xb'),_0x3af88f,_0x29909d[_0xa830('0xf')][_0xa830('0x11')]);return _0x449f4a(_0x29909d[_0xa830('0xf')]['message']);}logger[_0xa830('0xf')](_0xa830('0xb'),_0x3af88f,_0x29909d[_0xa830('0xf')][_0xa830('0x11')]);return _0xa8719a(_0x29909d[_0xa830('0xf')][_0xa830('0x11')]);}else{logger[_0xa830('0xa')](_0xa830('0xb'),_0x3af88f,_0xa830('0xc'));_0xa8719a(_0x29909d[_0xa830('0x12')]['message']);}})[_0xa830('0x13')](function(_0x7d185f){logger[_0xa830('0xf')](_0xa830('0xb'),_0x3af88f,_0x7d185f);_0x449f4a(_0x7d185f);});});} \ No newline at end of file +var _0x5cf0=['stringify','error','code','message','info','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','then','JscriptyAnswerReport,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x556a41,_0x5baab6){var _0x21acb6=function(_0x5d82f1){while(--_0x5d82f1){_0x556a41['push'](_0x556a41['shift']());}};_0x21acb6(++_0x5baab6);}(_0x5cf0,0x1d5));var _0x05cf=function(_0x244bd9,_0x438fa6){_0x244bd9=_0x244bd9-0x0;var _0xeef65b=_0x5cf0[_0x244bd9];return _0xeef65b;};'use strict';var _=require(_0x05cf('0x0'));var util=require(_0x05cf('0x1'));var moment=require('moment');var BPromise=require(_0x05cf('0x2'));var rs=require(_0x05cf('0x3'));var fs=require('fs');var Redis=require(_0x05cf('0x4'));var db=require(_0x05cf('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x05cf('0x6'));var config=require(_0x05cf('0x7'));var jayson=require(_0x05cf('0x8'));var client=jayson[_0x05cf('0x9')][_0x05cf('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4ee18e,_0x4e3a70,_0x3fd1e0){return new BPromise(function(_0x355e60,_0x4ed9ae){return client['request'](_0x4ee18e,_0x3fd1e0)[_0x05cf('0xb')](function(_0x10b945){logger['info'](_0x05cf('0xc'),_0x4e3a70,_0x05cf('0xd'));logger[_0x05cf('0xe')]('JscriptyAnswerReport,\x20%s,\x20%s,\x20%s',_0x4e3a70,_0x05cf('0xd'),JSON[_0x05cf('0xf')](_0x10b945));if(_0x10b945[_0x05cf('0x10')]){if(_0x10b945[_0x05cf('0x10')][_0x05cf('0x11')]===0x1f4){logger['error'](_0x05cf('0xc'),_0x4e3a70,_0x10b945[_0x05cf('0x10')][_0x05cf('0x12')]);return _0x4ed9ae(_0x10b945[_0x05cf('0x10')][_0x05cf('0x12')]);}logger[_0x05cf('0x10')](_0x05cf('0xc'),_0x4e3a70,_0x10b945[_0x05cf('0x10')][_0x05cf('0x12')]);return _0x355e60(_0x10b945[_0x05cf('0x10')][_0x05cf('0x12')]);}else{logger[_0x05cf('0x13')](_0x05cf('0xc'),_0x4e3a70,_0x05cf('0xd'));_0x355e60(_0x10b945[_0x05cf('0x14')][_0x05cf('0x12')]);}})[_0x05cf('0x15')](function(_0x5bf11a){logger[_0x05cf('0x10')](_0x05cf('0xc'),_0x4e3a70,_0x5bf11a);_0x4ed9ae(_0x5bf11a);});});} \ No newline at end of file diff --git a/server/api/jscriptyProject/index.js b/server/api/jscriptyProject/index.js index 53220f3..3639bfe 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 _0x8431=['getAnswers','/:id/summary','30s','post','create','/:id/clone','clone','put','/:id','update','destroy','exports','multer','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyProject.controller','get','isAuthenticated','index','show','getSessions','/:id/answers'];(function(_0x2cfbcf,_0x2cf96f){var _0x41fc13=function(_0x4d7a26){while(--_0x4d7a26){_0x2cfbcf['push'](_0x2cfbcf['shift']());}};_0x41fc13(++_0x2cf96f);}(_0x8431,0x110));var _0x1843=function(_0x21e98f,_0x2fd400){_0x21e98f=_0x21e98f-0x0;var _0x303b51=_0x8431[_0x21e98f];return _0x303b51;};'use strict';var multer=require(_0x1843('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x1843('0x1'));var router=express[_0x1843('0x2')]();var fs_extra=require(_0x1843('0x3'));var auth=require(_0x1843('0x4'));var interaction=require(_0x1843('0x5'));var config=require(_0x1843('0x6'));var controller=require(_0x1843('0x7'));router[_0x1843('0x8')]('/',auth[_0x1843('0x9')](),controller[_0x1843('0xa')]);router[_0x1843('0x8')]('/:id',auth[_0x1843('0x9')](),controller[_0x1843('0xb')]);router[_0x1843('0x8')]('/:id/sessions',auth['isAuthenticated'](),controller[_0x1843('0xc')]);router[_0x1843('0x8')](_0x1843('0xd'),auth['isAuthenticated'](),controller[_0x1843('0xe')]);router[_0x1843('0x8')](_0x1843('0xf'),auth[_0x1843('0x9')](),timeout(_0x1843('0x10')),controller['getSummary']);router[_0x1843('0x11')]('/',auth[_0x1843('0x9')](),controller[_0x1843('0x12')]);router['post'](_0x1843('0x13'),auth[_0x1843('0x9')](),controller[_0x1843('0x14')]);router[_0x1843('0x15')](_0x1843('0x16'),auth[_0x1843('0x9')](),controller[_0x1843('0x17')]);router['delete'](_0x1843('0x16'),auth[_0x1843('0x9')](),controller[_0x1843('0x18')]);module[_0x1843('0x19')]=router; \ No newline at end of file +var _0xee98=['exports','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyProject.controller','isAuthenticated','index','get','/:id','show','getSessions','getAnswers','/:id/summary','30s','getSummary','post','create','/:id/clone','clone','put','update','delete'];(function(_0x389460,_0x3cf4d4){var _0x467a67=function(_0x24235d){while(--_0x24235d){_0x389460['push'](_0x389460['shift']());}};_0x467a67(++_0x3cf4d4);}(_0xee98,0xd1));var _0x8ee9=function(_0x1cc8fe,_0x105328){_0x1cc8fe=_0x1cc8fe-0x0;var _0x230054=_0xee98[_0x1cc8fe];return _0x230054;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x8ee9('0x0'));var timeout=require(_0x8ee9('0x1'));var express=require('express');var router=express[_0x8ee9('0x2')]();var fs_extra=require(_0x8ee9('0x3'));var auth=require(_0x8ee9('0x4'));var interaction=require(_0x8ee9('0x5'));var config=require(_0x8ee9('0x6'));var controller=require(_0x8ee9('0x7'));router['get']('/',auth[_0x8ee9('0x8')](),controller[_0x8ee9('0x9')]);router[_0x8ee9('0xa')](_0x8ee9('0xb'),auth[_0x8ee9('0x8')](),controller[_0x8ee9('0xc')]);router['get']('/:id/sessions',auth[_0x8ee9('0x8')](),controller[_0x8ee9('0xd')]);router[_0x8ee9('0xa')]('/:id/answers',auth[_0x8ee9('0x8')](),controller[_0x8ee9('0xe')]);router[_0x8ee9('0xa')](_0x8ee9('0xf'),auth[_0x8ee9('0x8')](),timeout(_0x8ee9('0x10')),controller[_0x8ee9('0x11')]);router[_0x8ee9('0x12')]('/',auth[_0x8ee9('0x8')](),controller[_0x8ee9('0x13')]);router[_0x8ee9('0x12')](_0x8ee9('0x14'),auth['isAuthenticated'](),controller[_0x8ee9('0x15')]);router[_0x8ee9('0x16')](_0x8ee9('0xb'),auth[_0x8ee9('0x8')](),controller[_0x8ee9('0x17')]);router[_0x8ee9('0x18')](_0x8ee9('0xb'),auth[_0x8ee9('0x8')](),controller['destroy']);module[_0x8ee9('0x19')]=router; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.attributes.js b/server/api/jscriptyProject/jscriptyProject.attributes.js index c849dff..2a84651 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 _0x6e14=['BOOLEAN','sequelize','lodash','exports','name','long','isObjectLike','setDataValue','formData','stringify','isString','format','getDataValue','description'];(function(_0x460150,_0x232949){var _0x340677=function(_0x5b7e32){while(--_0x5b7e32){_0x460150['push'](_0x460150['shift']());}};_0x340677(++_0x232949);}(_0x6e14,0x1b3));var _0x46e1=function(_0xd1e9df,_0x5cd235){_0xd1e9df=_0xd1e9df-0x0;var _0x1b33a9=_0x6e14[_0xd1e9df];return _0x1b33a9;};'use strict';var Sequelize=require(_0x46e1('0x0'));var _=require(_0x46e1('0x1'));var util=require('util');module[_0x46e1('0x2')]={'name':{'type':Sequelize['STRING'],'unique':_0x46e1('0x3')},'description':{'type':Sequelize['STRING']},'formData':{'type':Sequelize['TEXT'](_0x46e1('0x4')),'set':function(_0x15670b){if(_[_0x46e1('0x5')](_0x15670b)){this[_0x46e1('0x6')](_0x46e1('0x7'),JSON[_0x46e1('0x8')](_0x15670b));}else if(_[_0x46e1('0x9')](_0x15670b)){this['setDataValue'](_0x46e1('0x7'),_0x15670b);}else{this[_0x46e1('0x6')]('formData',util[_0x46e1('0xa')]('{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}',this[_0x46e1('0xb')](_0x46e1('0x3'))||'',this['getDataValue'](_0x46e1('0xc'))||''));}}},'enableUncompleteSave':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize[_0x46e1('0xd')],'defaultValue':![]}}; \ No newline at end of file +var _0x4141=['name','description','sequelize','exports','STRING','TEXT','long','isObjectLike','setDataValue','stringify','isString','formData','format','{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}','getDataValue'];(function(_0x4a6467,_0x3e2408){var _0x5a1bc8=function(_0x515d1a){while(--_0x515d1a){_0x4a6467['push'](_0x4a6467['shift']());}};_0x5a1bc8(++_0x3e2408);}(_0x4141,0xd4));var _0x1414=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x4141[_0x122ef9];return _0x42fba0;};'use strict';var Sequelize=require(_0x1414('0x0'));var _=require('lodash');var util=require('util');module[_0x1414('0x1')]={'name':{'type':Sequelize[_0x1414('0x2')],'unique':'name'},'description':{'type':Sequelize['STRING']},'formData':{'type':Sequelize[_0x1414('0x3')](_0x1414('0x4')),'set':function(_0x4ba7ff){if(_[_0x1414('0x5')](_0x4ba7ff)){this[_0x1414('0x6')]('formData',JSON[_0x1414('0x7')](_0x4ba7ff));}else if(_[_0x1414('0x8')](_0x4ba7ff)){this[_0x1414('0x6')]('formData',_0x4ba7ff);}else{this[_0x1414('0x6')](_0x1414('0x9'),util[_0x1414('0xa')](_0x1414('0xb'),this[_0x1414('0xc')](_0x1414('0xd'))||'',this['getDataValue'](_0x1414('0xe'))||''));}}},'enableUncompleteSave':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.controller.js b/server/api/jscriptyProject/jscriptyProject.controller.js index ae5a024..58fbc2e 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 _0xe11d=['answer','isEmpty','now','writeFileSync','setHeader','Content-disposition','attachment;\x20filename=','Jscripty_Project_%d_Summary_%s.csv','Content-type','text/csv','download','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','limit','undefined','count','offset','Content-Range','apply','reject','update','then','Projects','UserProfileResource','destroy','error','stack','name','index','map','JscriptyProject','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','clone','params','createdAt','updatedAt','omit','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getSessions','findOne','JscriptySessionReport','hasOwnProperty','ProjectId','rows','getAnswers','pick','JscriptyAnswerReport','number','fromCharCode','toString','indexOf','replace','getSummary','parse','startTime','-createdAt','questionId','question','format','YYYY-MM-DD\x20HH:mm:ss','SessionId'];(function(_0xafd1b2,_0x4af81d){var _0x4d8be2=function(_0x52a7ef){while(--_0x52a7ef){_0xafd1b2['push'](_0xafd1b2['shift']());}};_0x4d8be2(++_0x4af81d);}(_0xe11d,0x1eb));var _0xde11=function(_0x46b44c,_0x286965){_0x46b44c=_0x46b44c-0x0;var _0x1dda35=_0xe11d[_0x46b44c];return _0x1dda35;};'use strict';var emlformat=require(_0xde11('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xde11('0x1'));var jsonpatch=require(_0xde11('0x2'));var rp=require(_0xde11('0x3'));var moment=require('moment');var BPromise=require(_0xde11('0x4'));var Mustache=require(_0xde11('0x5'));var util=require(_0xde11('0x6'));var path=require(_0xde11('0x7'));var sox=require(_0xde11('0x8'));var csv=require(_0xde11('0x9'));var ejs=require(_0xde11('0xa'));var fs=require('fs');var fs_extra=require(_0xde11('0xb'));var _=require('lodash');var squel=require(_0xde11('0xc'));var crypto=require(_0xde11('0xd'));var jsforce=require(_0xde11('0xe'));var deskjs=require(_0xde11('0xf'));var toCsv=require(_0xde11('0x9'));var querystring=require('querystring');var Papa=require(_0xde11('0x10'));var Redis=require(_0xde11('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xde11('0x12'));var hardwareService=require(_0xde11('0x13'));var logger=require(_0xde11('0x14'))(_0xde11('0x15'));var utils=require(_0xde11('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xde11('0x17'));var db=require(_0xde11('0x18'))['db'];function respondWithStatusCode(_0x27bdb2,_0x4c892a){_0x4c892a=_0x4c892a||0xcc;return function(_0x4971e7){if(_0x4971e7){return _0x27bdb2[_0xde11('0x19')](_0x4c892a);}return _0x27bdb2[_0xde11('0x1a')](_0x4c892a)[_0xde11('0x1b')]();};}function respondWithResult(_0x10f8c2,_0x7008ec){_0x7008ec=_0x7008ec||0xc8;return function(_0x49b68e){if(_0x49b68e){return _0x10f8c2[_0xde11('0x1a')](_0x7008ec)['json'](_0x49b68e);}};}function respondWithFilteredResult(_0x39c5f3,_0x4d5439){return function(_0x57dd88){if(_0x57dd88){var _0x17c1ea=typeof _0x4d5439['offset']==='undefined'&&typeof _0x4d5439[_0xde11('0x1c')]===_0xde11('0x1d');var _0x4fb962=_0x57dd88['count'];var _0x5717cd=_0x17c1ea?0x0:_0x4d5439['offset'];var _0x416c5e=_0x17c1ea?_0x57dd88[_0xde11('0x1e')]:_0x4d5439[_0xde11('0x1f')]+_0x4d5439[_0xde11('0x1c')];var _0x2763fb;if(_0x416c5e>=_0x4fb962){_0x416c5e=_0x4fb962;_0x2763fb=0xc8;}else{_0x2763fb=0xce;}_0x39c5f3['status'](_0x2763fb);return _0x39c5f3['set'](_0xde11('0x20'),_0x5717cd+'-'+_0x416c5e+'/'+_0x4fb962)['json'](_0x57dd88);}return null;};}function patchUpdates(_0x1f2656){return function(_0x2029c1){try{jsonpatch[_0xde11('0x21')](_0x2029c1,_0x1f2656,!![]);}catch(_0x36c7d5){return BPromise[_0xde11('0x22')](_0x36c7d5);}return _0x2029c1['save']();};}function saveUpdates(_0x2ba473,_0x289e2e){return function(_0x1fb8c7){if(_0x1fb8c7){return _0x1fb8c7[_0xde11('0x23')](_0x2ba473)[_0xde11('0x24')](function(_0x285187){return _0x285187;});}return null;};}function removeEntity(_0x425f2f,_0xd1b362){return function(_0x54e20e){if(_0x54e20e){return _0x54e20e['destroy']()[_0xde11('0x24')](function(){var _0x183ff1=_0x54e20e['get']({'plain':!![]});var _0x1a3600=_0xde11('0x25');return db[_0xde11('0x26')][_0xde11('0x27')]({'where':{'type':_0x1a3600,'resourceId':_0x183ff1['id']}})['then'](function(){return _0x54e20e;});})[_0xde11('0x24')](function(){_0x425f2f[_0xde11('0x1a')](0xcc)[_0xde11('0x1b')]();});}};}function handleEntityNotFound(_0x4ad5ec,_0x1918f9){return function(_0x3e8fb9){if(!_0x3e8fb9){_0x4ad5ec['sendStatus'](0x194);}return _0x3e8fb9;};}function handleError(_0x30cf39,_0x1528fc){_0x1528fc=_0x1528fc||0x1f4;return function(_0x1976a3){logger[_0xde11('0x28')](_0x1976a3[_0xde11('0x29')]);if(_0x1976a3[_0xde11('0x2a')]){delete _0x1976a3[_0xde11('0x2a')];}_0x30cf39[_0xde11('0x1a')](_0x1528fc)['send'](_0x1976a3);};}exports[_0xde11('0x2b')]=function(_0x4e576e,_0x3700cb){var _0x24e573={},_0x1aa465={},_0x2ff130={'count':0x0,'rows':[]};var _0x503b16=_[_0xde11('0x2c')](db[_0xde11('0x2d')][_0xde11('0x2e')],function(_0x13f173){return{'name':_0x13f173[_0xde11('0x2f')],'type':_0x13f173[_0xde11('0x30')][_0xde11('0x31')]};});_0x1aa465[_0xde11('0x32')]=_['map'](_0x503b16,_0xde11('0x2a'));_0x1aa465[_0xde11('0x33')]=_[_0xde11('0x34')](_0x4e576e['query']);_0x1aa465[_0xde11('0x35')]=_[_0xde11('0x36')](_0x1aa465['model'],_0x1aa465['query']);_0x24e573[_0xde11('0x37')]=_['intersection'](_0x1aa465[_0xde11('0x32')],qs[_0xde11('0x38')](_0x4e576e['query'][_0xde11('0x38')]));_0x24e573['attributes']=_0x24e573['attributes'][_0xde11('0x39')]?_0x24e573['attributes']:_0x1aa465[_0xde11('0x32')];if(!_0x4e576e['query']['hasOwnProperty'](_0xde11('0x3a'))){_0x24e573[_0xde11('0x1c')]=qs[_0xde11('0x1c')](_0x4e576e[_0xde11('0x33')][_0xde11('0x1c')]);_0x24e573['offset']=qs[_0xde11('0x1f')](_0x4e576e['query'][_0xde11('0x1f')]);}_0x24e573[_0xde11('0x3b')]=qs[_0xde11('0x3c')](_0x4e576e[_0xde11('0x33')][_0xde11('0x3c')]);_0x24e573[_0xde11('0x3d')]=qs[_0xde11('0x35')](_['pick'](_0x4e576e[_0xde11('0x33')],_0x1aa465['filters']),_0x503b16);if(_0x4e576e[_0xde11('0x33')][_0xde11('0x3e')]){_0x24e573[_0xde11('0x3d')]=_[_0xde11('0x3f')](_0x24e573[_0xde11('0x3d')],{'$or':_['map'](_0x503b16,function(_0x552b82){if(_0x552b82['type']!==_0xde11('0x40')){var _0x30b233={};_0x30b233[_0x552b82[_0xde11('0x2a')]]={'$like':'%'+_0x4e576e[_0xde11('0x33')][_0xde11('0x3e')]+'%'};return _0x30b233;}})});}_0x24e573=_[_0xde11('0x3f')]({},_0x24e573,_0x4e576e[_0xde11('0x41')]);var _0x2788df={'where':_0x24e573['where']};return db[_0xde11('0x2d')][_0xde11('0x1e')](_0x2788df)[_0xde11('0x24')](function(_0x1df1e1){_0x2ff130[_0xde11('0x1e')]=_0x1df1e1;if(_0x4e576e['query'][_0xde11('0x42')]){_0x24e573[_0xde11('0x43')]=[{'all':!![]}];}return db[_0xde11('0x2d')][_0xde11('0x44')](_0x24e573);})[_0xde11('0x24')](function(_0x1360df){_0x2ff130['rows']=_0x1360df;return _0x2ff130;})[_0xde11('0x24')](respondWithFilteredResult(_0x3700cb,_0x24e573))[_0xde11('0x45')](handleError(_0x3700cb,null));};exports['show']=function(_0x1bcbc2,_0x37c31a){var _0x337db1={'raw':![],'where':{'id':_0x1bcbc2['params']['id']}},_0x78ae79={};_0x78ae79[_0xde11('0x32')]=_['keys'](db[_0xde11('0x2d')][_0xde11('0x2e')]);_0x78ae79['query']=_['keys'](_0x1bcbc2[_0xde11('0x33')]);_0x78ae79[_0xde11('0x35')]=_['intersection'](_0x78ae79[_0xde11('0x32')],_0x78ae79[_0xde11('0x33')]);_0x337db1[_0xde11('0x37')]=_['intersection'](_0x78ae79[_0xde11('0x32')],qs[_0xde11('0x38')](_0x1bcbc2[_0xde11('0x33')][_0xde11('0x38')]));_0x337db1[_0xde11('0x37')]=_0x337db1[_0xde11('0x37')][_0xde11('0x39')]?_0x337db1['attributes']:_0x78ae79[_0xde11('0x32')];if(_0x1bcbc2['query'][_0xde11('0x42')]){_0x337db1['include']=[{'all':!![]}];}_0x337db1=_['merge']({},_0x337db1,_0x1bcbc2[_0xde11('0x41')]);return db[_0xde11('0x2d')][_0xde11('0x46')](_0x337db1)[_0xde11('0x24')](handleEntityNotFound(_0x37c31a,null))[_0xde11('0x24')](respondWithResult(_0x37c31a,null))[_0xde11('0x45')](handleError(_0x37c31a,null));};exports[_0xde11('0x47')]=function(_0x570f25,_0x42f4f6){return db[_0xde11('0x2d')][_0xde11('0x47')](_0x570f25[_0xde11('0x48')],{})[_0xde11('0x24')](function(_0x416970){var _0x5d016f=_0x570f25[_0xde11('0x49')][_0xde11('0x4a')]({'plain':!![]});if(!_0x5d016f)throw new Error(_0xde11('0x4b'));if(_0x5d016f[_0xde11('0x4c')]===_0xde11('0x49')){var _0x41b134=_0x416970[_0xde11('0x4a')]({'plain':!![]});var _0x3eb497='Projects';return db[_0xde11('0x4d')][_0xde11('0x46')]({'where':{'name':_0x3eb497,'userProfileId':_0x5d016f[_0xde11('0x4e')]},'raw':!![]})[_0xde11('0x24')](function(_0x3148d6){if(_0x3148d6&&_0x3148d6[_0xde11('0x4f')]===0x0){return db[_0xde11('0x26')][_0xde11('0x47')]({'name':_0x41b134[_0xde11('0x2a')],'resourceId':_0x41b134['id'],'type':_0x3148d6[_0xde11('0x2a')],'sectionId':_0x3148d6['id']},{})[_0xde11('0x24')](function(){return _0x416970;});}else{return _0x416970;}})[_0xde11('0x45')](function(_0x5a36b1){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5a36b1);throw _0x5a36b1;});}return _0x416970;})['then'](respondWithResult(_0x42f4f6,0xc9))['catch'](handleError(_0x42f4f6,null));};exports[_0xde11('0x50')]=function(_0x41aa0c,_0xad248c){var _0x2ae5aa={'where':{'id':_0x41aa0c[_0xde11('0x51')]['id']}},_0x4231b0={};_0x4231b0[_0xde11('0x32')]=_[_0xde11('0x34')](db[_0xde11('0x2d')]['rawAttributes']);_0x2ae5aa[_0xde11('0x37')]=_[_0xde11('0x36')](_0x4231b0['model'],qs[_0xde11('0x38')](_0x41aa0c['query'][_0xde11('0x38')]));_0x2ae5aa['attributes']=_0x2ae5aa['attributes'][_0xde11('0x39')]?_0x2ae5aa[_0xde11('0x37')]:_0x4231b0['model'];if(_0x41aa0c[_0xde11('0x33')][_0xde11('0x42')]){_0x2ae5aa['include']=[{'all':!![]}];}_0x2ae5aa=_['merge']({},_0x2ae5aa,_0x41aa0c[_0xde11('0x41')]);return db[_0xde11('0x2d')][_0xde11('0x46')](_0x2ae5aa)[_0xde11('0x24')](handleEntityNotFound(_0xad248c,null))[_0xde11('0x24')](function(_0x17132e){if(_0x17132e){var _0x403aa9=_0x17132e[_0xde11('0x4a')]({'plain':!![]});_0x403aa9=qs['omit'](_0x403aa9,['id',_0xde11('0x52'),_0xde11('0x53')]);_0x41aa0c['body']=_[_0xde11('0x54')](_0x41aa0c[_0xde11('0x48')],['id',_0xde11('0x52'),_0xde11('0x53')]);return db[_0xde11('0x2d')][_0xde11('0x47')](_[_0xde11('0x3f')](_0x403aa9,_0x41aa0c[_0xde11('0x48')]),{'include':_0x41aa0c[_0xde11('0x33')][_0xde11('0x42')]?[{'all':!![]}]:undefined})[_0xde11('0x24')](function(_0x1556bc){var _0x20a742=_0x41aa0c[_0xde11('0x49')]['get']({'plain':!![]});if(!_0x20a742)throw new Error(_0xde11('0x4b'));if(_0x20a742[_0xde11('0x4c')]===_0xde11('0x49')){var _0x47000c=_0x1556bc['get']({'plain':!![]});var _0x5a6bed=_0xde11('0x25');return db[_0xde11('0x4d')][_0xde11('0x46')]({'where':{'name':_0x5a6bed,'userProfileId':_0x20a742[_0xde11('0x4e')]},'raw':!![]})[_0xde11('0x24')](function(_0xe18b88){if(_0xe18b88&&_0xe18b88[_0xde11('0x4f')]===0x0){return db[_0xde11('0x26')][_0xde11('0x47')]({'name':_0x47000c[_0xde11('0x2a')],'resourceId':_0x47000c['id'],'type':_0xe18b88[_0xde11('0x2a')],'sectionId':_0xe18b88['id']},{})['then'](function(){return _0x1556bc;});}else{return _0x1556bc;}})[_0xde11('0x45')](function(_0x94f152){logger[_0xde11('0x28')](_0xde11('0x55'),_0x94f152);throw _0x94f152;});}return _0x1556bc;});}})[_0xde11('0x24')](respondWithResult(_0xad248c,0xc9))[_0xde11('0x45')](handleError(_0xad248c,null));};exports[_0xde11('0x23')]=function(_0x170ced,_0x9d61a0){if(_0x170ced[_0xde11('0x48')]['id']){delete _0x170ced[_0xde11('0x48')]['id'];}return db[_0xde11('0x2d')][_0xde11('0x46')]({'where':{'id':_0x170ced[_0xde11('0x51')]['id']}})[_0xde11('0x24')](handleEntityNotFound(_0x9d61a0,null))[_0xde11('0x24')](saveUpdates(_0x170ced['body'],null))[_0xde11('0x24')](respondWithResult(_0x9d61a0,null))[_0xde11('0x45')](handleError(_0x9d61a0,null));};exports[_0xde11('0x27')]=function(_0x520c85,_0x52c41b){return db[_0xde11('0x2d')][_0xde11('0x46')]({'where':{'id':_0x520c85[_0xde11('0x51')]['id']}})[_0xde11('0x24')](handleEntityNotFound(_0x52c41b,null))[_0xde11('0x24')](removeEntity(_0x52c41b,null))[_0xde11('0x45')](handleError(_0x52c41b,null));};exports[_0xde11('0x56')]=function(_0xfd36a,_0xb90ed9,_0x18ffed){var _0x13a7e9={'raw':!![],'where':{}};var _0x227898={};var _0x3cb0c1={'count':0x0,'rows':[]};return db[_0xde11('0x2d')][_0xde11('0x57')]({'where':{'id':_0xfd36a['params']['id']}})[_0xde11('0x24')](handleEntityNotFound(_0xb90ed9,null))[_0xde11('0x24')](function(_0x2b9148){if(_0x2b9148){_0x227898[_0xde11('0x32')]=_[_0xde11('0x34')](db[_0xde11('0x58')][_0xde11('0x2e')]);_0x227898[_0xde11('0x33')]=_[_0xde11('0x34')](_0xfd36a[_0xde11('0x33')]);_0x227898[_0xde11('0x35')]=_[_0xde11('0x36')](_0x227898['model'],_0x227898[_0xde11('0x33')]);_0x13a7e9['attributes']=_[_0xde11('0x36')](_0x227898['model'],qs[_0xde11('0x38')](_0xfd36a['query'][_0xde11('0x38')]));_0x13a7e9[_0xde11('0x37')]=_0x13a7e9[_0xde11('0x37')]['length']?_0x13a7e9[_0xde11('0x37')]:_0x227898[_0xde11('0x32')];if(!_0xfd36a[_0xde11('0x33')][_0xde11('0x59')](_0xde11('0x3a'))){_0x13a7e9[_0xde11('0x1c')]=qs[_0xde11('0x1c')](_0xfd36a[_0xde11('0x33')]['limit']);_0x13a7e9[_0xde11('0x1f')]=qs[_0xde11('0x1f')](_0xfd36a[_0xde11('0x33')][_0xde11('0x1f')]);}_0x13a7e9[_0xde11('0x3b')]=qs[_0xde11('0x3c')](_0xfd36a[_0xde11('0x33')][_0xde11('0x3c')]);_0x13a7e9['where']=qs[_0xde11('0x35')](_['pick'](_0xfd36a[_0xde11('0x33')],_0x227898[_0xde11('0x35')]));_0x13a7e9[_0xde11('0x3d')][_0xde11('0x5a')]=_0x2b9148['id'];if(_0xfd36a['query']['filter']){_0x13a7e9[_0xde11('0x3d')]=_[_0xde11('0x3f')](_0x13a7e9['where'],{'$or':_[_0xde11('0x2c')](_0x13a7e9[_0xde11('0x37')],function(_0x42082c){var _0x3b6430={};_0x3b6430[_0x42082c]={'$like':'%'+_0xfd36a[_0xde11('0x33')]['filter']+'%'};return _0x3b6430;})});}_0x13a7e9=_[_0xde11('0x3f')]({},_0x13a7e9,_0xfd36a[_0xde11('0x41')]);return db['JscriptySessionReport']['count']({'where':_0x13a7e9['where']})[_0xde11('0x24')](function(_0x357409){_0x3cb0c1[_0xde11('0x1e')]=_0x357409;if(_0xfd36a['query'][_0xde11('0x42')]){_0x13a7e9['include']=[{'all':!![]}];}return db[_0xde11('0x58')][_0xde11('0x44')](_0x13a7e9);})[_0xde11('0x24')](function(_0x238f9e){_0x3cb0c1[_0xde11('0x5b')]=_0x238f9e;return _0x3cb0c1;});}})[_0xde11('0x24')](respondWithFilteredResult(_0xb90ed9,_0x13a7e9))['catch'](handleError(_0xb90ed9,null));};exports[_0xde11('0x5c')]=function(_0x4b7877,_0x2e25e1,_0x468338){var _0x2a3ad2={'raw':!![],'where':{}};var _0xc3743={};var _0x5f5ab4={'count':0x0,'rows':[]};return db['JscriptyProject'][_0xde11('0x57')]({'where':{'id':_0x4b7877[_0xde11('0x51')]['id']}})[_0xde11('0x24')](handleEntityNotFound(_0x2e25e1,null))[_0xde11('0x24')](function(_0x40d3e7){if(_0x40d3e7){_0xc3743[_0xde11('0x32')]=_['keys'](db['JscriptyAnswerReport'][_0xde11('0x2e')]);_0xc3743[_0xde11('0x33')]=_[_0xde11('0x34')](_0x4b7877[_0xde11('0x33')]);_0xc3743[_0xde11('0x35')]=_['intersection'](_0xc3743['model'],_0xc3743[_0xde11('0x33')]);_0x2a3ad2[_0xde11('0x37')]=_[_0xde11('0x36')](_0xc3743[_0xde11('0x32')],qs[_0xde11('0x38')](_0x4b7877[_0xde11('0x33')]['fields']));_0x2a3ad2[_0xde11('0x37')]=_0x2a3ad2[_0xde11('0x37')][_0xde11('0x39')]?_0x2a3ad2[_0xde11('0x37')]:_0xc3743[_0xde11('0x32')];if(!_0x4b7877[_0xde11('0x33')][_0xde11('0x59')]('nolimit')){_0x2a3ad2[_0xde11('0x1c')]=qs[_0xde11('0x1c')](_0x4b7877[_0xde11('0x33')][_0xde11('0x1c')]);_0x2a3ad2[_0xde11('0x1f')]=qs[_0xde11('0x1f')](_0x4b7877[_0xde11('0x33')][_0xde11('0x1f')]);}_0x2a3ad2[_0xde11('0x3b')]=qs[_0xde11('0x3c')](_0x4b7877['query'][_0xde11('0x3c')]);_0x2a3ad2[_0xde11('0x3d')]=qs['filters'](_[_0xde11('0x5d')](_0x4b7877[_0xde11('0x33')],_0xc3743[_0xde11('0x35')]));_0x2a3ad2[_0xde11('0x3d')][_0xde11('0x5a')]=_0x40d3e7['id'];if(_0x4b7877[_0xde11('0x33')][_0xde11('0x3e')]){_0x2a3ad2[_0xde11('0x3d')]=_[_0xde11('0x3f')](_0x2a3ad2['where'],{'$or':_[_0xde11('0x2c')](_0x2a3ad2[_0xde11('0x37')],function(_0x335551){var _0x1ad7da={};_0x1ad7da[_0x335551]={'$like':'%'+_0x4b7877[_0xde11('0x33')]['filter']+'%'};return _0x1ad7da;})});}_0x2a3ad2=_['merge']({},_0x2a3ad2,_0x4b7877[_0xde11('0x41')]);return db[_0xde11('0x5e')][_0xde11('0x1e')]({'where':_0x2a3ad2[_0xde11('0x3d')]})[_0xde11('0x24')](function(_0x5e4de6){_0x5f5ab4['count']=_0x5e4de6;if(_0x4b7877[_0xde11('0x33')]['includeAll']){_0x2a3ad2[_0xde11('0x43')]=[{'all':!![]}];}return db[_0xde11('0x5e')]['findAll'](_0x2a3ad2);})[_0xde11('0x24')](function(_0x4e68e0){_0x5f5ab4[_0xde11('0x5b')]=_0x4e68e0;return _0x5f5ab4;});}})[_0xde11('0x24')](respondWithFilteredResult(_0x2e25e1,_0x2a3ad2))[_0xde11('0x45')](handleError(_0x2e25e1,null));};function char(_0x16b1c1){return _0xde11('0x5f')===typeof _0x16b1c1?String[_0xde11('0x60')][_0xde11('0x21')](null,arguments):_0x16b1c1;}function needsEncapsulation(_0x5b2841){return!!_0x5b2841&&(_0x5b2841[_0xde11('0x61')]()[_0xde11('0x62')](char(0xd))>=0x0||_0x5b2841[_0xde11('0x61')]()[_0xde11('0x62')](char(0xa))>=0x0||_0x5b2841[_0xde11('0x61')]()[_0xde11('0x62')](char(0x2c))>=0x0||_0x5b2841[_0xde11('0x61')]()[_0xde11('0x62')](char(0x22))>=0x0);}function encapsulate(_0x5a133f){var _0x4e8f0f=char(0x22),_0xec764d='\x5c'+char(0x22),_0x3ac4d1=_0x5a133f[_0xde11('0x61')]()[_0xde11('0x63')](new RegExp(_0x4e8f0f,'g'),_0xec764d);return _0x4e8f0f+_0x3ac4d1+_0x4e8f0f;}exports[_0xde11('0x64')]=function(_0x2d8c7d,_0x2941e4,_0x5e9b1d){var _0x361d54,_0x3dbfb8;var _0x461126={'where':{'ProjectId':_0x2d8c7d[_0xde11('0x51')]['id']}};if(_0x2d8c7d['query']['startTime']){_0x461126[_0xde11('0x3d')]['starttime']=JSON[_0xde11('0x65')](_0x2d8c7d[_0xde11('0x33')][_0xde11('0x66')]);}return db[_0xde11('0x58')][_0xde11('0x44')](_0x461126)[_0xde11('0x24')](handleEntityNotFound(_0x2941e4,null))[_0xde11('0x24')](function(_0x1069ee){if(_0x1069ee){_0x361d54=_0x1069ee;return db['JscriptyQuestionReport'][_0xde11('0x44')]({'where':{'SessionId':{'$in':_['map'](_0x361d54,'id')},'ProjectId':_0x2d8c7d['params']['id']},'order':_0xde11('0x67')});}})[_0xde11('0x24')](handleEntityNotFound(_0x2941e4,null))['then'](function(_0x57508d){if(_0x57508d){_0x3dbfb8=_0x57508d;var _0x4fb5f4={};for(var _0x1d3cf4=0x0,_0x537b88=_0x3dbfb8[_0xde11('0x39')];_0x1d3cf4<_0x537b88;_0x1d3cf4++){if(!_0x4fb5f4[_0xde11('0x59')](_0x3dbfb8[_0x1d3cf4][_0xde11('0x68')])){_0x4fb5f4[_0x3dbfb8[_0x1d3cf4][_0xde11('0x68')]]=needsEncapsulation(_0x3dbfb8[_0x1d3cf4][_0xde11('0x69')])?encapsulate(_0x3dbfb8[_0x1d3cf4][_0xde11('0x69')]):_0x3dbfb8[_0x1d3cf4][_0xde11('0x69')];}}var _0x5d4fb0=[],_0x4739c4={};for(var _0x4430e8=0x0,_0x312db4=_0x361d54[_0xde11('0x39')];_0x4430e8<_0x312db4;_0x4430e8++){_0x4739c4={'ProjectId':_0x2d8c7d[_0xde11('0x51')]['id'],'SessionId':_0x361d54[_0x4430e8]['id'],'StartTime':moment(_0x361d54[_0x4430e8]['starttime'])[_0xde11('0x6a')](_0xde11('0x6b'))};for(var _0x3b95c8=0x0,_0x44a3c3=_0x3dbfb8['length'];_0x3b95c8<_0x44a3c3;_0x3b95c8++){if(_0x3dbfb8[_0x3b95c8][_0xde11('0x6c')]==_0x361d54[_0x4430e8]['id']&&_0x4fb5f4[_0xde11('0x59')](_0x3dbfb8[_0x3b95c8]['questionId'])){_0x4739c4[_0x4fb5f4[_0x3dbfb8[_0x3b95c8]['questionId']]]=_0x3dbfb8[_0x3b95c8][_0xde11('0x6d')];}}for(var _0x5dbdf6 in _0x4fb5f4){if(!_0x4739c4[_0xde11('0x59')](_0x4fb5f4[_0x5dbdf6])){_0x4739c4[_0x4fb5f4[_0x5dbdf6]]=null;}}_0x5d4fb0['push'](_0x4739c4);}return _0x5d4fb0;}})['then'](function(_0x485c66){if(!_[_0xde11('0x6e')](_0x485c66)){var _0xf7e700=toCsv(_0x485c66);var _0x1c26f3=Date[_0xde11('0x6f')]();fs[_0xde11('0x70')](util[_0xde11('0x6a')]('/tmp/Jscripty_Project_%d_Summary_%s.csv',_0x2d8c7d[_0xde11('0x51')]['id'],_0x1c26f3),_0xf7e700);_0x2941e4[_0xde11('0x71')](_0xde11('0x72'),_0xde11('0x73')+util['format'](_0xde11('0x74'),_0x2d8c7d[_0xde11('0x51')]['id'],_0x1c26f3));_0x2941e4[_0xde11('0x71')](_0xde11('0x75'),_0xde11('0x76'));return _0x2941e4[_0xde11('0x77')](util[_0xde11('0x6a')]('/tmp/Jscripty_Project_%d_Summary_%s.csv',_0x2d8c7d[_0xde11('0x51')]['id'],_0x1c26f3));}else{return _0x2941e4['sendStatus'](0xcc);}})['catch'](handleError(_0x2941e4,null));}; \ No newline at end of file +var _0x1dcc=['request-promise','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','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','Content-Range','apply','reject','update','destroy','then','get','Projects','error','stack','index','map','JscriptyProject','fieldName','key','name','query','intersection','model','fields','length','attributes','order','sort','filters','pick','filter','where','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','rawAttributes','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','updatedAt','UserProfileSection','getSessions','findOne','keys','JscriptySessionReport','nolimit','ProjectId','getAnswers','JscriptyAnswerReport','hasOwnProperty','fromCharCode','toString','indexOf','replace','getSummary','startTime','parse','JscriptyQuestionReport','-createdAt','questionId','question','starttime','format','YYYY-MM-DD\x20HH:mm:ss','SessionId','answer','push','isEmpty','now','writeFileSync','setHeader','attachment;\x20filename=','Jscripty_Project_%d_Summary_%s.csv','Content-type','text/csv','download','/tmp/Jscripty_Project_%d_Summary_%s.csv','eml-format','fast-json-patch'];(function(_0x49fc4c,_0xb0fd5c){var _0x2f785c=function(_0x28d86b){while(--_0x28d86b){_0x49fc4c['push'](_0x49fc4c['shift']());}};_0x2f785c(++_0xb0fd5c);}(_0x1dcc,0x77));var _0xc1dc=function(_0x36970a,_0x211f8e){_0x36970a=_0x36970a-0x0;var _0x5eff27=_0x1dcc[_0x36970a];return _0x5eff27;};'use strict';var emlformat=require(_0xc1dc('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xc1dc('0x1'));var rp=require(_0xc1dc('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xc1dc('0x3'));var util=require(_0xc1dc('0x4'));var path=require(_0xc1dc('0x5'));var sox=require(_0xc1dc('0x6'));var csv=require(_0xc1dc('0x7'));var ejs=require(_0xc1dc('0x8'));var fs=require('fs');var fs_extra=require(_0xc1dc('0x9'));var _=require('lodash');var squel=require(_0xc1dc('0xa'));var crypto=require(_0xc1dc('0xb'));var jsforce=require(_0xc1dc('0xc'));var deskjs=require(_0xc1dc('0xd'));var toCsv=require(_0xc1dc('0x7'));var querystring=require(_0xc1dc('0xe'));var Papa=require(_0xc1dc('0xf'));var Redis=require(_0xc1dc('0x10'));var authService=require(_0xc1dc('0x11'));var qs=require(_0xc1dc('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc1dc('0x13'));var logger=require(_0xc1dc('0x14'))('api');var utils=require(_0xc1dc('0x15'));var config=require(_0xc1dc('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xc1dc('0x17'))['db'];function respondWithStatusCode(_0x2545e8,_0x31cd63){_0x31cd63=_0x31cd63||0xcc;return function(_0x2d407c){if(_0x2d407c){return _0x2545e8[_0xc1dc('0x18')](_0x31cd63);}return _0x2545e8[_0xc1dc('0x19')](_0x31cd63)[_0xc1dc('0x1a')]();};}function respondWithResult(_0x4d9d5e,_0x48abc3){_0x48abc3=_0x48abc3||0xc8;return function(_0x140b0b){if(_0x140b0b){return _0x4d9d5e[_0xc1dc('0x19')](_0x48abc3)[_0xc1dc('0x1b')](_0x140b0b);}};}function respondWithFilteredResult(_0xdfbe60,_0x31191a){return function(_0x209355){if(_0x209355){var _0x1edb66=typeof _0x31191a['offset']==='undefined'&&typeof _0x31191a['limit']==='undefined';var _0x2e2d8e=_0x209355[_0xc1dc('0x1c')];var _0x12510a=_0x1edb66?0x0:_0x31191a[_0xc1dc('0x1d')];var _0x6d7e23=_0x1edb66?_0x209355[_0xc1dc('0x1c')]:_0x31191a['offset']+_0x31191a[_0xc1dc('0x1e')];var _0xcac31f;if(_0x6d7e23>=_0x2e2d8e){_0x6d7e23=_0x2e2d8e;_0xcac31f=0xc8;}else{_0xcac31f=0xce;}_0xdfbe60[_0xc1dc('0x19')](_0xcac31f);return _0xdfbe60['set'](_0xc1dc('0x1f'),_0x12510a+'-'+_0x6d7e23+'/'+_0x2e2d8e)['json'](_0x209355);}return null;};}function patchUpdates(_0xabf65a){return function(_0x214ce3){try{jsonpatch[_0xc1dc('0x20')](_0x214ce3,_0xabf65a,!![]);}catch(_0x3939af){return BPromise[_0xc1dc('0x21')](_0x3939af);}return _0x214ce3['save']();};}function saveUpdates(_0x3d7a8f,_0x1a92f6){return function(_0x3ce279){if(_0x3ce279){return _0x3ce279[_0xc1dc('0x22')](_0x3d7a8f)['then'](function(_0x31f5eb){return _0x31f5eb;});}return null;};}function removeEntity(_0x2c5e5a,_0x57582b){return function(_0x71bf72){if(_0x71bf72){return _0x71bf72[_0xc1dc('0x23')]()[_0xc1dc('0x24')](function(){var _0x21a887=_0x71bf72[_0xc1dc('0x25')]({'plain':!![]});var _0x454ed2=_0xc1dc('0x26');return db['UserProfileResource']['destroy']({'where':{'type':_0x454ed2,'resourceId':_0x21a887['id']}})[_0xc1dc('0x24')](function(){return _0x71bf72;});})['then'](function(){_0x2c5e5a[_0xc1dc('0x19')](0xcc)[_0xc1dc('0x1a')]();});}};}function handleEntityNotFound(_0x413bc7,_0x4dc1ae){return function(_0x580ffc){if(!_0x580ffc){_0x413bc7[_0xc1dc('0x18')](0x194);}return _0x580ffc;};}function handleError(_0x418072,_0x3a8b7f){_0x3a8b7f=_0x3a8b7f||0x1f4;return function(_0x1dc7bc){logger[_0xc1dc('0x27')](_0x1dc7bc[_0xc1dc('0x28')]);if(_0x1dc7bc['name']){delete _0x1dc7bc['name'];}_0x418072[_0xc1dc('0x19')](_0x3a8b7f)['send'](_0x1dc7bc);};}exports[_0xc1dc('0x29')]=function(_0x577fe5,_0x51f940){var _0x10e03f={},_0xc1e849={},_0xfeab2a={'count':0x0,'rows':[]};var _0x2aface=_[_0xc1dc('0x2a')](db[_0xc1dc('0x2b')]['rawAttributes'],function(_0x453412){return{'name':_0x453412[_0xc1dc('0x2c')],'type':_0x453412['type'][_0xc1dc('0x2d')]};});_0xc1e849['model']=_[_0xc1dc('0x2a')](_0x2aface,_0xc1dc('0x2e'));_0xc1e849[_0xc1dc('0x2f')]=_['keys'](_0x577fe5[_0xc1dc('0x2f')]);_0xc1e849['filters']=_[_0xc1dc('0x30')](_0xc1e849[_0xc1dc('0x31')],_0xc1e849[_0xc1dc('0x2f')]);_0x10e03f['attributes']=_[_0xc1dc('0x30')](_0xc1e849[_0xc1dc('0x31')],qs[_0xc1dc('0x32')](_0x577fe5[_0xc1dc('0x2f')]['fields']));_0x10e03f['attributes']=_0x10e03f['attributes'][_0xc1dc('0x33')]?_0x10e03f[_0xc1dc('0x34')]:_0xc1e849[_0xc1dc('0x31')];if(!_0x577fe5[_0xc1dc('0x2f')]['hasOwnProperty']('nolimit')){_0x10e03f['limit']=qs[_0xc1dc('0x1e')](_0x577fe5[_0xc1dc('0x2f')][_0xc1dc('0x1e')]);_0x10e03f['offset']=qs[_0xc1dc('0x1d')](_0x577fe5[_0xc1dc('0x2f')][_0xc1dc('0x1d')]);}_0x10e03f[_0xc1dc('0x35')]=qs['sort'](_0x577fe5['query'][_0xc1dc('0x36')]);_0x10e03f['where']=qs[_0xc1dc('0x37')](_[_0xc1dc('0x38')](_0x577fe5[_0xc1dc('0x2f')],_0xc1e849[_0xc1dc('0x37')]),_0x2aface);if(_0x577fe5[_0xc1dc('0x2f')][_0xc1dc('0x39')]){_0x10e03f[_0xc1dc('0x3a')]=_[_0xc1dc('0x3b')](_0x10e03f[_0xc1dc('0x3a')],{'$or':_[_0xc1dc('0x2a')](_0x2aface,function(_0x422f37){if(_0x422f37[_0xc1dc('0x3c')]!==_0xc1dc('0x3d')){var _0x248311={};_0x248311[_0x422f37['name']]={'$like':'%'+_0x577fe5[_0xc1dc('0x2f')][_0xc1dc('0x39')]+'%'};return _0x248311;}})});}_0x10e03f=_[_0xc1dc('0x3b')]({},_0x10e03f,_0x577fe5[_0xc1dc('0x3e')]);var _0x141f2e={'where':_0x10e03f['where']};return db[_0xc1dc('0x2b')][_0xc1dc('0x1c')](_0x141f2e)[_0xc1dc('0x24')](function(_0x322368){_0xfeab2a[_0xc1dc('0x1c')]=_0x322368;if(_0x577fe5[_0xc1dc('0x2f')][_0xc1dc('0x3f')]){_0x10e03f[_0xc1dc('0x40')]=[{'all':!![]}];}return db[_0xc1dc('0x2b')][_0xc1dc('0x41')](_0x10e03f);})['then'](function(_0x24d976){_0xfeab2a[_0xc1dc('0x42')]=_0x24d976;return _0xfeab2a;})['then'](respondWithFilteredResult(_0x51f940,_0x10e03f))[_0xc1dc('0x43')](handleError(_0x51f940,null));};exports['show']=function(_0x376fe2,_0x457d3a){var _0x7e535={'raw':![],'where':{'id':_0x376fe2[_0xc1dc('0x44')]['id']}},_0x1193b4={};_0x1193b4[_0xc1dc('0x31')]=_['keys'](db[_0xc1dc('0x2b')][_0xc1dc('0x45')]);_0x1193b4[_0xc1dc('0x2f')]=_['keys'](_0x376fe2[_0xc1dc('0x2f')]);_0x1193b4[_0xc1dc('0x37')]=_['intersection'](_0x1193b4['model'],_0x1193b4['query']);_0x7e535[_0xc1dc('0x34')]=_[_0xc1dc('0x30')](_0x1193b4[_0xc1dc('0x31')],qs[_0xc1dc('0x32')](_0x376fe2['query'][_0xc1dc('0x32')]));_0x7e535[_0xc1dc('0x34')]=_0x7e535['attributes'][_0xc1dc('0x33')]?_0x7e535[_0xc1dc('0x34')]:_0x1193b4[_0xc1dc('0x31')];if(_0x376fe2['query']['includeAll']){_0x7e535[_0xc1dc('0x40')]=[{'all':!![]}];}_0x7e535=_[_0xc1dc('0x3b')]({},_0x7e535,_0x376fe2[_0xc1dc('0x3e')]);return db[_0xc1dc('0x2b')][_0xc1dc('0x46')](_0x7e535)[_0xc1dc('0x24')](handleEntityNotFound(_0x457d3a,null))[_0xc1dc('0x24')](respondWithResult(_0x457d3a,null))[_0xc1dc('0x43')](handleError(_0x457d3a,null));};exports[_0xc1dc('0x47')]=function(_0x51b970,_0x74756){return db['JscriptyProject'][_0xc1dc('0x47')](_0x51b970[_0xc1dc('0x48')],{})[_0xc1dc('0x24')](function(_0x46f7c4){var _0x8e6a96=_0x51b970[_0xc1dc('0x49')][_0xc1dc('0x25')]({'plain':!![]});if(!_0x8e6a96)throw new Error(_0xc1dc('0x4a'));if(_0x8e6a96[_0xc1dc('0x4b')]===_0xc1dc('0x49')){var _0xcc3f55=_0x46f7c4[_0xc1dc('0x25')]({'plain':!![]});var _0x203b8e=_0xc1dc('0x26');return db['UserProfileSection']['find']({'where':{'name':_0x203b8e,'userProfileId':_0x8e6a96[_0xc1dc('0x4c')]},'raw':!![]})[_0xc1dc('0x24')](function(_0x4de388){if(_0x4de388&&_0x4de388[_0xc1dc('0x4d')]===0x0){return db[_0xc1dc('0x4e')]['create']({'name':_0xcc3f55[_0xc1dc('0x2e')],'resourceId':_0xcc3f55['id'],'type':_0x4de388['name'],'sectionId':_0x4de388['id']},{})[_0xc1dc('0x24')](function(){return _0x46f7c4;});}else{return _0x46f7c4;}})[_0xc1dc('0x43')](function(_0x3c6b1d){logger[_0xc1dc('0x27')](_0xc1dc('0x4f'),_0x3c6b1d);throw _0x3c6b1d;});}return _0x46f7c4;})[_0xc1dc('0x24')](respondWithResult(_0x74756,0xc9))[_0xc1dc('0x43')](handleError(_0x74756,null));};exports[_0xc1dc('0x50')]=function(_0x22c10e,_0x42be97){var _0x50ae51={'where':{'id':_0x22c10e[_0xc1dc('0x44')]['id']}},_0x4f97c0={};_0x4f97c0[_0xc1dc('0x31')]=_['keys'](db['JscriptyProject'][_0xc1dc('0x45')]);_0x50ae51[_0xc1dc('0x34')]=_[_0xc1dc('0x30')](_0x4f97c0[_0xc1dc('0x31')],qs[_0xc1dc('0x32')](_0x22c10e[_0xc1dc('0x2f')][_0xc1dc('0x32')]));_0x50ae51[_0xc1dc('0x34')]=_0x50ae51[_0xc1dc('0x34')]['length']?_0x50ae51[_0xc1dc('0x34')]:_0x4f97c0['model'];if(_0x22c10e[_0xc1dc('0x2f')][_0xc1dc('0x3f')]){_0x50ae51[_0xc1dc('0x40')]=[{'all':!![]}];}_0x50ae51=_[_0xc1dc('0x3b')]({},_0x50ae51,_0x22c10e[_0xc1dc('0x3e')]);return db['JscriptyProject'][_0xc1dc('0x46')](_0x50ae51)[_0xc1dc('0x24')](handleEntityNotFound(_0x42be97,null))[_0xc1dc('0x24')](function(_0x5b1fd6){if(_0x5b1fd6){var _0x3b5b1d=_0x5b1fd6[_0xc1dc('0x25')]({'plain':!![]});_0x3b5b1d=qs[_0xc1dc('0x51')](_0x3b5b1d,['id',_0xc1dc('0x52'),_0xc1dc('0x53')]);_0x22c10e[_0xc1dc('0x48')]=_[_0xc1dc('0x51')](_0x22c10e['body'],['id','createdAt','updatedAt']);return db[_0xc1dc('0x2b')][_0xc1dc('0x47')](_[_0xc1dc('0x3b')](_0x3b5b1d,_0x22c10e['body']),{'include':_0x22c10e[_0xc1dc('0x2f')][_0xc1dc('0x3f')]?[{'all':!![]}]:undefined})[_0xc1dc('0x24')](function(_0x41091d){var _0x17d5e7=_0x22c10e['user']['get']({'plain':!![]});if(!_0x17d5e7)throw new Error(_0xc1dc('0x4a'));if(_0x17d5e7['role']===_0xc1dc('0x49')){var _0x382ba1=_0x41091d['get']({'plain':!![]});var _0x4d26a8=_0xc1dc('0x26');return db[_0xc1dc('0x54')]['find']({'where':{'name':_0x4d26a8,'userProfileId':_0x17d5e7[_0xc1dc('0x4c')]},'raw':!![]})[_0xc1dc('0x24')](function(_0x19ea11){if(_0x19ea11&&_0x19ea11[_0xc1dc('0x4d')]===0x0){return db['UserProfileResource']['create']({'name':_0x382ba1['name'],'resourceId':_0x382ba1['id'],'type':_0x19ea11['name'],'sectionId':_0x19ea11['id']},{})['then'](function(){return _0x41091d;});}else{return _0x41091d;}})['catch'](function(_0x3055f8){logger['error'](_0xc1dc('0x4f'),_0x3055f8);throw _0x3055f8;});}return _0x41091d;});}})['then'](respondWithResult(_0x42be97,0xc9))[_0xc1dc('0x43')](handleError(_0x42be97,null));};exports['update']=function(_0x157d03,_0x37e90f){if(_0x157d03[_0xc1dc('0x48')]['id']){delete _0x157d03[_0xc1dc('0x48')]['id'];}return db[_0xc1dc('0x2b')][_0xc1dc('0x46')]({'where':{'id':_0x157d03[_0xc1dc('0x44')]['id']}})[_0xc1dc('0x24')](handleEntityNotFound(_0x37e90f,null))[_0xc1dc('0x24')](saveUpdates(_0x157d03['body'],null))['then'](respondWithResult(_0x37e90f,null))[_0xc1dc('0x43')](handleError(_0x37e90f,null));};exports[_0xc1dc('0x23')]=function(_0x444095,_0x382990){return db[_0xc1dc('0x2b')][_0xc1dc('0x46')]({'where':{'id':_0x444095['params']['id']}})[_0xc1dc('0x24')](handleEntityNotFound(_0x382990,null))[_0xc1dc('0x24')](removeEntity(_0x382990,null))[_0xc1dc('0x43')](handleError(_0x382990,null));};exports[_0xc1dc('0x55')]=function(_0x588be8,_0xe3cce7,_0x78bf5f){var _0x2df251={'raw':!![],'where':{}};var _0x48768a={};var _0x4599f6={'count':0x0,'rows':[]};return db['JscriptyProject'][_0xc1dc('0x56')]({'where':{'id':_0x588be8[_0xc1dc('0x44')]['id']}})[_0xc1dc('0x24')](handleEntityNotFound(_0xe3cce7,null))[_0xc1dc('0x24')](function(_0x36e903){if(_0x36e903){_0x48768a['model']=_[_0xc1dc('0x57')](db[_0xc1dc('0x58')][_0xc1dc('0x45')]);_0x48768a['query']=_['keys'](_0x588be8['query']);_0x48768a[_0xc1dc('0x37')]=_['intersection'](_0x48768a[_0xc1dc('0x31')],_0x48768a['query']);_0x2df251[_0xc1dc('0x34')]=_[_0xc1dc('0x30')](_0x48768a['model'],qs[_0xc1dc('0x32')](_0x588be8[_0xc1dc('0x2f')][_0xc1dc('0x32')]));_0x2df251[_0xc1dc('0x34')]=_0x2df251[_0xc1dc('0x34')]['length']?_0x2df251[_0xc1dc('0x34')]:_0x48768a[_0xc1dc('0x31')];if(!_0x588be8['query']['hasOwnProperty'](_0xc1dc('0x59'))){_0x2df251[_0xc1dc('0x1e')]=qs['limit'](_0x588be8[_0xc1dc('0x2f')][_0xc1dc('0x1e')]);_0x2df251['offset']=qs[_0xc1dc('0x1d')](_0x588be8['query']['offset']);}_0x2df251[_0xc1dc('0x35')]=qs[_0xc1dc('0x36')](_0x588be8['query'][_0xc1dc('0x36')]);_0x2df251[_0xc1dc('0x3a')]=qs['filters'](_['pick'](_0x588be8[_0xc1dc('0x2f')],_0x48768a[_0xc1dc('0x37')]));_0x2df251[_0xc1dc('0x3a')][_0xc1dc('0x5a')]=_0x36e903['id'];if(_0x588be8[_0xc1dc('0x2f')][_0xc1dc('0x39')]){_0x2df251['where']=_[_0xc1dc('0x3b')](_0x2df251[_0xc1dc('0x3a')],{'$or':_['map'](_0x2df251[_0xc1dc('0x34')],function(_0x1cfb1c){var _0x1fabb1={};_0x1fabb1[_0x1cfb1c]={'$like':'%'+_0x588be8[_0xc1dc('0x2f')][_0xc1dc('0x39')]+'%'};return _0x1fabb1;})});}_0x2df251=_[_0xc1dc('0x3b')]({},_0x2df251,_0x588be8['options']);return db[_0xc1dc('0x58')][_0xc1dc('0x1c')]({'where':_0x2df251[_0xc1dc('0x3a')]})['then'](function(_0x2cc1e2){_0x4599f6[_0xc1dc('0x1c')]=_0x2cc1e2;if(_0x588be8[_0xc1dc('0x2f')][_0xc1dc('0x3f')]){_0x2df251[_0xc1dc('0x40')]=[{'all':!![]}];}return db[_0xc1dc('0x58')][_0xc1dc('0x41')](_0x2df251);})[_0xc1dc('0x24')](function(_0x2c6c1d){_0x4599f6[_0xc1dc('0x42')]=_0x2c6c1d;return _0x4599f6;});}})['then'](respondWithFilteredResult(_0xe3cce7,_0x2df251))['catch'](handleError(_0xe3cce7,null));};exports[_0xc1dc('0x5b')]=function(_0x5f10e8,_0x116e90,_0x327993){var _0x27529f={'raw':!![],'where':{}};var _0x6dbca3={};var _0x2d60ac={'count':0x0,'rows':[]};return db['JscriptyProject'][_0xc1dc('0x56')]({'where':{'id':_0x5f10e8[_0xc1dc('0x44')]['id']}})[_0xc1dc('0x24')](handleEntityNotFound(_0x116e90,null))['then'](function(_0xc4c708){if(_0xc4c708){_0x6dbca3[_0xc1dc('0x31')]=_[_0xc1dc('0x57')](db[_0xc1dc('0x5c')][_0xc1dc('0x45')]);_0x6dbca3[_0xc1dc('0x2f')]=_[_0xc1dc('0x57')](_0x5f10e8[_0xc1dc('0x2f')]);_0x6dbca3[_0xc1dc('0x37')]=_[_0xc1dc('0x30')](_0x6dbca3[_0xc1dc('0x31')],_0x6dbca3['query']);_0x27529f['attributes']=_[_0xc1dc('0x30')](_0x6dbca3['model'],qs[_0xc1dc('0x32')](_0x5f10e8['query'][_0xc1dc('0x32')]));_0x27529f['attributes']=_0x27529f[_0xc1dc('0x34')][_0xc1dc('0x33')]?_0x27529f[_0xc1dc('0x34')]:_0x6dbca3['model'];if(!_0x5f10e8[_0xc1dc('0x2f')][_0xc1dc('0x5d')]('nolimit')){_0x27529f['limit']=qs[_0xc1dc('0x1e')](_0x5f10e8['query'][_0xc1dc('0x1e')]);_0x27529f['offset']=qs[_0xc1dc('0x1d')](_0x5f10e8[_0xc1dc('0x2f')][_0xc1dc('0x1d')]);}_0x27529f[_0xc1dc('0x35')]=qs['sort'](_0x5f10e8[_0xc1dc('0x2f')][_0xc1dc('0x36')]);_0x27529f[_0xc1dc('0x3a')]=qs[_0xc1dc('0x37')](_[_0xc1dc('0x38')](_0x5f10e8[_0xc1dc('0x2f')],_0x6dbca3['filters']));_0x27529f['where'][_0xc1dc('0x5a')]=_0xc4c708['id'];if(_0x5f10e8[_0xc1dc('0x2f')][_0xc1dc('0x39')]){_0x27529f[_0xc1dc('0x3a')]=_[_0xc1dc('0x3b')](_0x27529f[_0xc1dc('0x3a')],{'$or':_['map'](_0x27529f['attributes'],function(_0x22c2de){var _0x3231c1={};_0x3231c1[_0x22c2de]={'$like':'%'+_0x5f10e8[_0xc1dc('0x2f')][_0xc1dc('0x39')]+'%'};return _0x3231c1;})});}_0x27529f=_['merge']({},_0x27529f,_0x5f10e8[_0xc1dc('0x3e')]);return db[_0xc1dc('0x5c')][_0xc1dc('0x1c')]({'where':_0x27529f[_0xc1dc('0x3a')]})[_0xc1dc('0x24')](function(_0x457643){_0x2d60ac[_0xc1dc('0x1c')]=_0x457643;if(_0x5f10e8[_0xc1dc('0x2f')][_0xc1dc('0x3f')]){_0x27529f[_0xc1dc('0x40')]=[{'all':!![]}];}return db['JscriptyAnswerReport'][_0xc1dc('0x41')](_0x27529f);})[_0xc1dc('0x24')](function(_0x2a762a){_0x2d60ac['rows']=_0x2a762a;return _0x2d60ac;});}})[_0xc1dc('0x24')](respondWithFilteredResult(_0x116e90,_0x27529f))[_0xc1dc('0x43')](handleError(_0x116e90,null));};function char(_0x36b712){return'number'===typeof _0x36b712?String[_0xc1dc('0x5e')][_0xc1dc('0x20')](null,arguments):_0x36b712;}function needsEncapsulation(_0x1918b4){return!!_0x1918b4&&(_0x1918b4[_0xc1dc('0x5f')]()[_0xc1dc('0x60')](char(0xd))>=0x0||_0x1918b4[_0xc1dc('0x5f')]()[_0xc1dc('0x60')](char(0xa))>=0x0||_0x1918b4[_0xc1dc('0x5f')]()[_0xc1dc('0x60')](char(0x2c))>=0x0||_0x1918b4[_0xc1dc('0x5f')]()[_0xc1dc('0x60')](char(0x22))>=0x0);}function encapsulate(_0x721f51){var _0x1a6bca=char(0x22),_0x41d99c='\x5c'+char(0x22),_0x175706=_0x721f51[_0xc1dc('0x5f')]()[_0xc1dc('0x61')](new RegExp(_0x1a6bca,'g'),_0x41d99c);return _0x1a6bca+_0x175706+_0x1a6bca;}exports[_0xc1dc('0x62')]=function(_0xa8a711,_0x1a8ebf,_0x621756){var _0x58e6f1,_0x45e11b;var _0x15ab26={'where':{'ProjectId':_0xa8a711[_0xc1dc('0x44')]['id']}};if(_0xa8a711['query'][_0xc1dc('0x63')]){_0x15ab26[_0xc1dc('0x3a')]['starttime']=JSON[_0xc1dc('0x64')](_0xa8a711[_0xc1dc('0x2f')][_0xc1dc('0x63')]);}return db[_0xc1dc('0x58')][_0xc1dc('0x41')](_0x15ab26)[_0xc1dc('0x24')](handleEntityNotFound(_0x1a8ebf,null))[_0xc1dc('0x24')](function(_0x3f1358){if(_0x3f1358){_0x58e6f1=_0x3f1358;return db[_0xc1dc('0x65')][_0xc1dc('0x41')]({'where':{'SessionId':{'$in':_[_0xc1dc('0x2a')](_0x58e6f1,'id')},'ProjectId':_0xa8a711[_0xc1dc('0x44')]['id']},'order':_0xc1dc('0x66')});}})['then'](handleEntityNotFound(_0x1a8ebf,null))[_0xc1dc('0x24')](function(_0x4a8ca1){if(_0x4a8ca1){_0x45e11b=_0x4a8ca1;var _0x509873={};for(var _0x5bd3ea=0x0,_0x7bb24e=_0x45e11b[_0xc1dc('0x33')];_0x5bd3ea<_0x7bb24e;_0x5bd3ea++){if(!_0x509873[_0xc1dc('0x5d')](_0x45e11b[_0x5bd3ea][_0xc1dc('0x67')])){_0x509873[_0x45e11b[_0x5bd3ea]['questionId']]=needsEncapsulation(_0x45e11b[_0x5bd3ea][_0xc1dc('0x68')])?encapsulate(_0x45e11b[_0x5bd3ea][_0xc1dc('0x68')]):_0x45e11b[_0x5bd3ea]['question'];}}var _0x3cb914=[],_0x4c4db2={};for(var _0x1a704f=0x0,_0x28e6bf=_0x58e6f1['length'];_0x1a704f<_0x28e6bf;_0x1a704f++){_0x4c4db2={'ProjectId':_0xa8a711[_0xc1dc('0x44')]['id'],'SessionId':_0x58e6f1[_0x1a704f]['id'],'StartTime':moment(_0x58e6f1[_0x1a704f][_0xc1dc('0x69')])[_0xc1dc('0x6a')](_0xc1dc('0x6b'))};for(var _0x485b53=0x0,_0x4c860e=_0x45e11b[_0xc1dc('0x33')];_0x485b53<_0x4c860e;_0x485b53++){if(_0x45e11b[_0x485b53][_0xc1dc('0x6c')]==_0x58e6f1[_0x1a704f]['id']&&_0x509873[_0xc1dc('0x5d')](_0x45e11b[_0x485b53][_0xc1dc('0x67')])){_0x4c4db2[_0x509873[_0x45e11b[_0x485b53][_0xc1dc('0x67')]]]=_0x45e11b[_0x485b53][_0xc1dc('0x6d')];}}for(var _0x4d1c45 in _0x509873){if(!_0x4c4db2[_0xc1dc('0x5d')](_0x509873[_0x4d1c45])){_0x4c4db2[_0x509873[_0x4d1c45]]=null;}}_0x3cb914[_0xc1dc('0x6e')](_0x4c4db2);}return _0x3cb914;}})[_0xc1dc('0x24')](function(_0x3a9170){if(!_[_0xc1dc('0x6f')](_0x3a9170)){var _0xcd2261=toCsv(_0x3a9170);var _0x700725=Date[_0xc1dc('0x70')]();fs[_0xc1dc('0x71')](util[_0xc1dc('0x6a')]('/tmp/Jscripty_Project_%d_Summary_%s.csv',_0xa8a711['params']['id'],_0x700725),_0xcd2261);_0x1a8ebf[_0xc1dc('0x72')]('Content-disposition',_0xc1dc('0x73')+util[_0xc1dc('0x6a')](_0xc1dc('0x74'),_0xa8a711['params']['id'],_0x700725));_0x1a8ebf[_0xc1dc('0x72')](_0xc1dc('0x75'),_0xc1dc('0x76'));return _0x1a8ebf[_0xc1dc('0x77')](util[_0xc1dc('0x6a')](_0xc1dc('0x78'),_0xa8a711['params']['id'],_0x700725));}else{return _0x1a8ebf[_0xc1dc('0x18')](0xcc);}})['catch'](handleError(_0x1a8ebf,null));}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.model.js b/server/api/jscriptyProject/jscriptyProject.model.js index 4f4e992..cf72b67 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 _0x3248=['exports','define','JscriptyProject','jscripty_projects','util','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x52ad65,_0x5aa8ce){var _0x2cba0e=function(_0x247c4b){while(--_0x247c4b){_0x52ad65['push'](_0x52ad65['shift']());}};_0x2cba0e(++_0x5aa8ce);}(_0x3248,0x1bc));var _0x8324=function(_0x410723,_0x34aae3){_0x410723=_0x410723-0x0;var _0x2ded90=_0x3248[_0x410723];return _0x2ded90;};'use strict';var _=require('lodash');var util=require(_0x8324('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x8324('0x1'));var BPromise=require(_0x8324('0x2'));var rp=require(_0x8324('0x3'));var fs=require('fs');var path=require(_0x8324('0x4'));var rimraf=require(_0x8324('0x5'));var config=require(_0x8324('0x6'));var attributes=require('./jscriptyProject.attributes');module[_0x8324('0x7')]=function(_0x1c5c2a,_0x5157f4){return _0x1c5c2a[_0x8324('0x8')](_0x8324('0x9'),attributes,{'tableName':_0x8324('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7d55=['./jscriptyProject.attributes','exports','define','JscriptyProject','lodash','util','../../config/logger','api','request-promise','path','rimraf'];(function(_0x58999b,_0xea4695){var _0x5efc3a=function(_0x98de31){while(--_0x98de31){_0x58999b['push'](_0x58999b['shift']());}};_0x5efc3a(++_0xea4695);}(_0x7d55,0x1bc));var _0x57d5=function(_0x2872e4,_0x3920bd){_0x2872e4=_0x2872e4-0x0;var _0x19930f=_0x7d55[_0x2872e4];return _0x19930f;};'use strict';var _=require(_0x57d5('0x0'));var util=require(_0x57d5('0x1'));var logger=require(_0x57d5('0x2'))(_0x57d5('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x57d5('0x4'));var fs=require('fs');var path=require(_0x57d5('0x5'));var rimraf=require(_0x57d5('0x6'));var config=require('../../config/environment');var attributes=require(_0x57d5('0x7'));module[_0x57d5('0x8')]=function(_0x15c349,_0x30fcfe){return _0x15c349[_0x57d5('0x9')](_0x57d5('0xa'),attributes,{'tableName':'jscripty_projects','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 739af45..7653294 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 _0xb7e7=['JscriptyProject,\x20%s,\x20%s','debug','JscriptyProject,\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(_0x5ae0d3,_0x2313fa){var _0x79e262=function(_0x12f913){while(--_0x12f913){_0x5ae0d3['push'](_0x5ae0d3['shift']());}};_0x79e262(++_0x2313fa);}(_0xb7e7,0x121));var _0x7b7e=function(_0x1e3c16,_0x372caa){_0x1e3c16=_0x1e3c16-0x0;var _0x47a0c9=_0xb7e7[_0x1e3c16];return _0x47a0c9;};'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')]('JscriptyProject,\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 _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(_0x2bd101,_0x1a6fb3){var _0x30e156=function(_0x240a87){while(--_0x240a87){_0x2bd101['push'](_0x2bd101['shift']());}};_0x30e156(++_0x1a6fb3);}(_0xaa88,0x137));var _0x8aa8=function(_0x1cb18a,_0x33167a){_0x1cb18a=_0x1cb18a-0x0;var _0x22442e=_0xaa88[_0x1cb18a];return _0x22442e;};'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 980585f..1f7ecf6 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 _0x66a7=['show','post','create','put','update','delete','destroy','exports','multer','util','path','express','fs-extra','../../components/interaction/service','get','isAuthenticated','index','/:id'];(function(_0x55e839,_0x3b5345){var _0x39c61a=function(_0x5bd269){while(--_0x5bd269){_0x55e839['push'](_0x55e839['shift']());}};_0x39c61a(++_0x3b5345);}(_0x66a7,0x98));var _0x766a=function(_0x5c1345,_0x40116e){_0x5c1345=_0x5c1345-0x0;var _0x1c070d=_0x66a7[_0x5c1345];return _0x1c070d;};'use strict';var multer=require(_0x766a('0x0'));var util=require(_0x766a('0x1'));var path=require(_0x766a('0x2'));var timeout=require('connect-timeout');var express=require(_0x766a('0x3'));var router=express['Router']();var fs_extra=require(_0x766a('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x766a('0x5'));var config=require('../../config/environment');var controller=require('./jscriptyQuestionReport.controller');router[_0x766a('0x6')]('/',auth[_0x766a('0x7')](),controller[_0x766a('0x8')]);router['get']('/describe',auth[_0x766a('0x7')](),controller['describe']);router['get'](_0x766a('0x9'),auth[_0x766a('0x7')](),controller[_0x766a('0xa')]);router[_0x766a('0xb')]('/',auth['isAuthenticated'](),controller[_0x766a('0xc')]);router[_0x766a('0xd')](_0x766a('0x9'),auth[_0x766a('0x7')](),controller[_0x766a('0xe')]);router[_0x766a('0xf')](_0x766a('0x9'),auth[_0x766a('0x7')](),controller[_0x766a('0x10')]);module[_0x766a('0x11')]=router; \ No newline at end of file +var _0xb038=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyQuestionReport.controller','get','/describe','isAuthenticated','describe','/:id','show','post','create','put','delete','destroy','exports','util','path'];(function(_0x2cc3ba,_0x411af2){var _0x311175=function(_0xd3c3e){while(--_0xd3c3e){_0x2cc3ba['push'](_0x2cc3ba['shift']());}};_0x311175(++_0x411af2);}(_0xb038,0xa6));var _0x8b03=function(_0x1ad7fd,_0x35a20c){_0x1ad7fd=_0x1ad7fd-0x0;var _0x500bde=_0xb038[_0x1ad7fd];return _0x500bde;};'use strict';var multer=require('multer');var util=require(_0x8b03('0x0'));var path=require(_0x8b03('0x1'));var timeout=require(_0x8b03('0x2'));var express=require('express');var router=express[_0x8b03('0x3')]();var fs_extra=require(_0x8b03('0x4'));var auth=require(_0x8b03('0x5'));var interaction=require(_0x8b03('0x6'));var config=require(_0x8b03('0x7'));var controller=require(_0x8b03('0x8'));router[_0x8b03('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x8b03('0x9')](_0x8b03('0xa'),auth[_0x8b03('0xb')](),controller[_0x8b03('0xc')]);router[_0x8b03('0x9')](_0x8b03('0xd'),auth[_0x8b03('0xb')](),controller[_0x8b03('0xe')]);router[_0x8b03('0xf')]('/',auth[_0x8b03('0xb')](),controller[_0x8b03('0x10')]);router[_0x8b03('0x11')](_0x8b03('0xd'),auth[_0x8b03('0xb')](),controller['update']);router[_0x8b03('0x12')](_0x8b03('0xd'),auth[_0x8b03('0xb')](),controller[_0x8b03('0x13')]);module[_0x8b03('0x14')]=router; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js index e16d6db..d2b5fd3 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(_0x50a0c2,_0x4befab){var _0x5ebadd=function(_0x3a3342){while(--_0x3a3342){_0x50a0c2['push'](_0x50a0c2['shift']());}};_0x5ebadd(++_0x4befab);}(_0x7a54,0x106));var _0x47a5=function(_0x68a27b,_0xcf21cf){_0x68a27b=_0x68a27b-0x0;var _0x163280=_0x7a54[_0x68a27b];return _0x163280;};'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(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x7a54,0x106));var _0x47a5=function(_0x5c9327,_0x46cff6){_0x5c9327=_0x5c9327-0x0;var _0xd7f9b9=_0x7a54[_0x5c9327];return _0xd7f9b9;};'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 71da4c4..0f9ad9d 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 _0x9637=['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','then','destroy','stack','name','send','index','map','JscriptyQuestionReport','rawAttributes','type','key','query','intersection','model','attributes','fields','length','hasOwnProperty','sort','pick','filters','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','keys','find','create','body','update','catch','eml-format','rimraf','request-promise','moment','mustache','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js'];(function(_0x45b034,_0x3a57dd){var _0x509cb0=function(_0x3a89d5){while(--_0x3a89d5){_0x45b034['push'](_0x45b034['shift']());}};_0x509cb0(++_0x3a57dd);}(_0x9637,0x1b5));var _0x7963=function(_0x48f463,_0x1c3918){_0x48f463=_0x48f463-0x0;var _0x8eb0e6=_0x9637[_0x48f463];return _0x8eb0e6;};'use strict';var emlformat=require(_0x7963('0x0'));var rimraf=require(_0x7963('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x7963('0x2'));var moment=require(_0x7963('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x7963('0x4'));var util=require('util');var path=require(_0x7963('0x5'));var sox=require(_0x7963('0x6'));var csv=require(_0x7963('0x7'));var ejs=require(_0x7963('0x8'));var fs=require('fs');var fs_extra=require(_0x7963('0x9'));var _=require(_0x7963('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x7963('0xb'));var deskjs=require(_0x7963('0xc'));var toCsv=require(_0x7963('0x7'));var querystring=require(_0x7963('0xd'));var Papa=require(_0x7963('0xe'));var Redis=require(_0x7963('0xf'));var authService=require(_0x7963('0x10'));var qs=require(_0x7963('0x11'));var as=require(_0x7963('0x12'));var hardwareService=require(_0x7963('0x13'));var logger=require(_0x7963('0x14'))(_0x7963('0x15'));var utils=require(_0x7963('0x16'));var config=require(_0x7963('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x7963('0x18'))['db'];function respondWithStatusCode(_0x4a314d,_0x4d73b5){_0x4d73b5=_0x4d73b5||0xcc;return function(_0x434403){if(_0x434403){return _0x4a314d[_0x7963('0x19')](_0x4d73b5);}return _0x4a314d['status'](_0x4d73b5)['end']();};}function respondWithResult(_0x58850b,_0x1afa31){_0x1afa31=_0x1afa31||0xc8;return function(_0x54a2ed){if(_0x54a2ed){return _0x58850b[_0x7963('0x1a')](_0x1afa31)[_0x7963('0x1b')](_0x54a2ed);}};}function respondWithFilteredResult(_0x413902,_0xc707b1){return function(_0xdc5d88){if(_0xdc5d88){var _0x4ecb22=typeof _0xc707b1[_0x7963('0x1c')]===_0x7963('0x1d')&&typeof _0xc707b1[_0x7963('0x1e')]===_0x7963('0x1d');var _0x16f5e3=_0xdc5d88[_0x7963('0x1f')];var _0x83cbe3=_0x4ecb22?0x0:_0xc707b1[_0x7963('0x1c')];var _0x185766=_0x4ecb22?_0xdc5d88[_0x7963('0x1f')]:_0xc707b1[_0x7963('0x1c')]+_0xc707b1[_0x7963('0x1e')];var _0x2308fa;if(_0x185766>=_0x16f5e3){_0x185766=_0x16f5e3;_0x2308fa=0xc8;}else{_0x2308fa=0xce;}_0x413902['status'](_0x2308fa);return _0x413902[_0x7963('0x20')](_0x7963('0x21'),_0x83cbe3+'-'+_0x185766+'/'+_0x16f5e3)[_0x7963('0x1b')](_0xdc5d88);}return null;};}function patchUpdates(_0x357624){return function(_0x20dbe3){try{jsonpatch[_0x7963('0x22')](_0x20dbe3,_0x357624,!![]);}catch(_0x86df07){return BPromise[_0x7963('0x23')](_0x86df07);}return _0x20dbe3[_0x7963('0x24')]();};}function saveUpdates(_0x1b0283,_0x4d249f){return function(_0x518ab2){if(_0x518ab2){return _0x518ab2['update'](_0x1b0283)[_0x7963('0x25')](function(_0x3070fd){return _0x3070fd;});}return null;};}function removeEntity(_0x1ff2d0,_0x1cbe34){return function(_0x403586){if(_0x403586){return _0x403586[_0x7963('0x26')]()[_0x7963('0x25')](function(){_0x1ff2d0['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1155b8,_0x201b40){return function(_0x51673f){if(!_0x51673f){_0x1155b8[_0x7963('0x19')](0x194);}return _0x51673f;};}function handleError(_0x4934f7,_0x257492){_0x257492=_0x257492||0x1f4;return function(_0x5c5806){logger['error'](_0x5c5806[_0x7963('0x27')]);if(_0x5c5806[_0x7963('0x28')]){delete _0x5c5806['name'];}_0x4934f7[_0x7963('0x1a')](_0x257492)[_0x7963('0x29')](_0x5c5806);};}exports[_0x7963('0x2a')]=function(_0xfb3c87,_0x35a2ef){var _0x59571f={},_0x4a3168={},_0x24a198={'count':0x0,'rows':[]};var _0x10771a=_[_0x7963('0x2b')](db[_0x7963('0x2c')][_0x7963('0x2d')],function(_0x248b76){return{'name':_0x248b76['fieldName'],'type':_0x248b76[_0x7963('0x2e')][_0x7963('0x2f')]};});_0x4a3168['model']=_[_0x7963('0x2b')](_0x10771a,_0x7963('0x28'));_0x4a3168[_0x7963('0x30')]=_['keys'](_0xfb3c87[_0x7963('0x30')]);_0x4a3168['filters']=_[_0x7963('0x31')](_0x4a3168[_0x7963('0x32')],_0x4a3168['query']);_0x59571f[_0x7963('0x33')]=_['intersection'](_0x4a3168[_0x7963('0x32')],qs[_0x7963('0x34')](_0xfb3c87[_0x7963('0x30')][_0x7963('0x34')]));_0x59571f[_0x7963('0x33')]=_0x59571f[_0x7963('0x33')][_0x7963('0x35')]?_0x59571f[_0x7963('0x33')]:_0x4a3168[_0x7963('0x32')];if(!_0xfb3c87[_0x7963('0x30')][_0x7963('0x36')]('nolimit')){_0x59571f['limit']=qs[_0x7963('0x1e')](_0xfb3c87[_0x7963('0x30')][_0x7963('0x1e')]);_0x59571f[_0x7963('0x1c')]=qs[_0x7963('0x1c')](_0xfb3c87[_0x7963('0x30')][_0x7963('0x1c')]);}_0x59571f['order']=qs[_0x7963('0x37')](_0xfb3c87[_0x7963('0x30')][_0x7963('0x37')]);_0x59571f['where']=qs['filters'](_[_0x7963('0x38')](_0xfb3c87[_0x7963('0x30')],_0x4a3168[_0x7963('0x39')]),_0x10771a);if(_0xfb3c87['query'][_0x7963('0x3a')]){_0x59571f[_0x7963('0x3b')]=_[_0x7963('0x3c')](_0x59571f[_0x7963('0x3b')],{'$or':_[_0x7963('0x2b')](_0x10771a,function(_0x464d3b){if(_0x464d3b[_0x7963('0x2e')]!==_0x7963('0x3d')){var _0x5e402a={};_0x5e402a[_0x464d3b[_0x7963('0x28')]]={'$like':'%'+_0xfb3c87[_0x7963('0x30')][_0x7963('0x3a')]+'%'};return _0x5e402a;}})});}_0x59571f=_[_0x7963('0x3c')]({},_0x59571f,_0xfb3c87[_0x7963('0x3e')]);var _0x20177d={'where':_0x59571f[_0x7963('0x3b')]};return db[_0x7963('0x2c')][_0x7963('0x1f')](_0x20177d)[_0x7963('0x25')](function(_0x5e6593){_0x24a198['count']=_0x5e6593;if(_0xfb3c87['query'][_0x7963('0x3f')]){_0x59571f[_0x7963('0x40')]=[{'all':!![]}];}return db['JscriptyQuestionReport'][_0x7963('0x41')](_0x59571f);})[_0x7963('0x25')](function(_0x58310d){_0x24a198[_0x7963('0x42')]=_0x58310d;return _0x24a198;})['then'](respondWithFilteredResult(_0x35a2ef,_0x59571f))['catch'](handleError(_0x35a2ef,null));};exports[_0x7963('0x43')]=function(_0x63bfad,_0x1c3547){var _0x3060cb={'raw':!![],'where':{'id':_0x63bfad[_0x7963('0x44')]['id']}},_0x4e6be9={};_0x4e6be9[_0x7963('0x32')]=_['keys'](db[_0x7963('0x2c')][_0x7963('0x2d')]);_0x4e6be9[_0x7963('0x30')]=_[_0x7963('0x45')](_0x63bfad[_0x7963('0x30')]);_0x4e6be9[_0x7963('0x39')]=_[_0x7963('0x31')](_0x4e6be9[_0x7963('0x32')],_0x4e6be9[_0x7963('0x30')]);_0x3060cb[_0x7963('0x33')]=_[_0x7963('0x31')](_0x4e6be9['model'],qs['fields'](_0x63bfad[_0x7963('0x30')][_0x7963('0x34')]));_0x3060cb[_0x7963('0x33')]=_0x3060cb['attributes']['length']?_0x3060cb['attributes']:_0x4e6be9[_0x7963('0x32')];if(_0x63bfad['query'][_0x7963('0x3f')]){_0x3060cb[_0x7963('0x40')]=[{'all':!![]}];}_0x3060cb=_['merge']({},_0x3060cb,_0x63bfad[_0x7963('0x3e')]);return db[_0x7963('0x2c')][_0x7963('0x46')](_0x3060cb)[_0x7963('0x25')](handleEntityNotFound(_0x1c3547,null))[_0x7963('0x25')](respondWithResult(_0x1c3547,null))['catch'](handleError(_0x1c3547,null));};exports[_0x7963('0x47')]=function(_0x39d4f0,_0x25c88e){return db[_0x7963('0x2c')][_0x7963('0x47')](_0x39d4f0[_0x7963('0x48')],{})[_0x7963('0x25')](respondWithResult(_0x25c88e,0xc9))['catch'](handleError(_0x25c88e,null));};exports[_0x7963('0x49')]=function(_0x580fe9,_0xbd9438){if(_0x580fe9['body']['id']){delete _0x580fe9[_0x7963('0x48')]['id'];}return db[_0x7963('0x2c')][_0x7963('0x46')]({'where':{'id':_0x580fe9[_0x7963('0x44')]['id']}})['then'](handleEntityNotFound(_0xbd9438,null))[_0x7963('0x25')](saveUpdates(_0x580fe9['body'],null))[_0x7963('0x25')](respondWithResult(_0xbd9438,null))[_0x7963('0x4a')](handleError(_0xbd9438,null));};exports['destroy']=function(_0x1f6616,_0x2165ad){return db[_0x7963('0x2c')]['find']({'where':{'id':_0x1f6616[_0x7963('0x44')]['id']}})[_0x7963('0x25')](handleEntityNotFound(_0x2165ad,null))[_0x7963('0x25')](removeEntity(_0x2165ad,null))[_0x7963('0x4a')](handleError(_0x2165ad,null));};exports['describe']=function(_0x2f864a,_0x4c49a6){return db[_0x7963('0x2c')]['describe']()['then'](respondWithResult(_0x4c49a6,null))[_0x7963('0x4a')](handleError(_0x4c49a6,null));}; \ No newline at end of file +var _0xcb1a=['../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','limit','count','offset','Content-Range','json','apply','reject','update','destroy','then','error','stack','name','send','index','JscriptyQuestionReport','fieldName','type','key','model','map','query','intersection','attributes','nolimit','order','sort','filters','pick','filter','where','merge','VIRTUAL','options','includeAll','rows','catch','show','params','keys','rawAttributes','fields','length','create','body','find','describe','eml-format','rimraf','fast-json-patch','request-promise','bluebird','util','sox','to-csv','lodash','squel','crypto','jsforce','ioredis','../../components/auth/service','../../components/parsers/qs'];(function(_0x416ecb,_0xf3ab55){var _0x1e5481=function(_0x61bc6f){while(--_0x61bc6f){_0x416ecb['push'](_0x416ecb['shift']());}};_0x1e5481(++_0xf3ab55);}(_0xcb1a,0x1e9));var _0xacb1=function(_0x1d844b,_0x683871){_0x1d844b=_0x1d844b-0x0;var _0x34f31b=_0xcb1a[_0x1d844b];return _0x34f31b;};'use strict';var emlformat=require(_0xacb1('0x0'));var rimraf=require(_0xacb1('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xacb1('0x2'));var rp=require(_0xacb1('0x3'));var moment=require('moment');var BPromise=require(_0xacb1('0x4'));var Mustache=require('mustache');var util=require(_0xacb1('0x5'));var path=require('path');var sox=require(_0xacb1('0x6'));var csv=require(_0xacb1('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xacb1('0x8'));var squel=require(_0xacb1('0x9'));var crypto=require(_0xacb1('0xa'));var jsforce=require(_0xacb1('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xacb1('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xacb1('0xc'));var authService=require(_0xacb1('0xd'));var qs=require(_0xacb1('0xe'));var as=require(_0xacb1('0xf'));var hardwareService=require(_0xacb1('0x10'));var logger=require('../../config/logger')(_0xacb1('0x11'));var utils=require(_0xacb1('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0xacb1('0x13'));var db=require(_0xacb1('0x14'))['db'];function respondWithStatusCode(_0x1ad07d,_0x2feefe){_0x2feefe=_0x2feefe||0xcc;return function(_0x5ceb47){if(_0x5ceb47){return _0x1ad07d[_0xacb1('0x15')](_0x2feefe);}return _0x1ad07d[_0xacb1('0x16')](_0x2feefe)[_0xacb1('0x17')]();};}function respondWithResult(_0x216253,_0x14ea10){_0x14ea10=_0x14ea10||0xc8;return function(_0x784919){if(_0x784919){return _0x216253[_0xacb1('0x16')](_0x14ea10)['json'](_0x784919);}};}function respondWithFilteredResult(_0xbac68a,_0x1f7e24){return function(_0x1dd24f){if(_0x1dd24f){var _0x18b1f6=typeof _0x1f7e24['offset']===_0xacb1('0x18')&&typeof _0x1f7e24[_0xacb1('0x19')]===_0xacb1('0x18');var _0x3cc033=_0x1dd24f[_0xacb1('0x1a')];var _0x72bdd8=_0x18b1f6?0x0:_0x1f7e24[_0xacb1('0x1b')];var _0x253e90=_0x18b1f6?_0x1dd24f['count']:_0x1f7e24[_0xacb1('0x1b')]+_0x1f7e24[_0xacb1('0x19')];var _0x12b02e;if(_0x253e90>=_0x3cc033){_0x253e90=_0x3cc033;_0x12b02e=0xc8;}else{_0x12b02e=0xce;}_0xbac68a['status'](_0x12b02e);return _0xbac68a['set'](_0xacb1('0x1c'),_0x72bdd8+'-'+_0x253e90+'/'+_0x3cc033)[_0xacb1('0x1d')](_0x1dd24f);}return null;};}function patchUpdates(_0x5403a7){return function(_0x691c94){try{jsonpatch[_0xacb1('0x1e')](_0x691c94,_0x5403a7,!![]);}catch(_0x1fe68b){return BPromise[_0xacb1('0x1f')](_0x1fe68b);}return _0x691c94['save']();};}function saveUpdates(_0x382911,_0x6e0652){return function(_0x318228){if(_0x318228){return _0x318228[_0xacb1('0x20')](_0x382911)['then'](function(_0x48b5db){return _0x48b5db;});}return null;};}function removeEntity(_0x2221c5,_0xae1e01){return function(_0x5effe0){if(_0x5effe0){return _0x5effe0[_0xacb1('0x21')]()[_0xacb1('0x22')](function(){_0x2221c5[_0xacb1('0x16')](0xcc)[_0xacb1('0x17')]();});}};}function handleEntityNotFound(_0x29a6ac,_0x4ef623){return function(_0x4b4eb8){if(!_0x4b4eb8){_0x29a6ac[_0xacb1('0x15')](0x194);}return _0x4b4eb8;};}function handleError(_0xdf6701,_0x23a823){_0x23a823=_0x23a823||0x1f4;return function(_0x12a240){logger[_0xacb1('0x23')](_0x12a240[_0xacb1('0x24')]);if(_0x12a240[_0xacb1('0x25')]){delete _0x12a240[_0xacb1('0x25')];}_0xdf6701['status'](_0x23a823)[_0xacb1('0x26')](_0x12a240);};}exports[_0xacb1('0x27')]=function(_0x167d75,_0x31231e){var _0x1808af={},_0x3965ab={},_0x26f161={'count':0x0,'rows':[]};var _0x3850ac=_['map'](db[_0xacb1('0x28')]['rawAttributes'],function(_0x1739c7){return{'name':_0x1739c7[_0xacb1('0x29')],'type':_0x1739c7[_0xacb1('0x2a')][_0xacb1('0x2b')]};});_0x3965ab[_0xacb1('0x2c')]=_[_0xacb1('0x2d')](_0x3850ac,'name');_0x3965ab[_0xacb1('0x2e')]=_['keys'](_0x167d75['query']);_0x3965ab['filters']=_[_0xacb1('0x2f')](_0x3965ab['model'],_0x3965ab[_0xacb1('0x2e')]);_0x1808af[_0xacb1('0x30')]=_[_0xacb1('0x2f')](_0x3965ab[_0xacb1('0x2c')],qs['fields'](_0x167d75['query']['fields']));_0x1808af['attributes']=_0x1808af['attributes']['length']?_0x1808af[_0xacb1('0x30')]:_0x3965ab[_0xacb1('0x2c')];if(!_0x167d75[_0xacb1('0x2e')]['hasOwnProperty'](_0xacb1('0x31'))){_0x1808af[_0xacb1('0x19')]=qs[_0xacb1('0x19')](_0x167d75['query'][_0xacb1('0x19')]);_0x1808af[_0xacb1('0x1b')]=qs[_0xacb1('0x1b')](_0x167d75[_0xacb1('0x2e')][_0xacb1('0x1b')]);}_0x1808af[_0xacb1('0x32')]=qs[_0xacb1('0x33')](_0x167d75[_0xacb1('0x2e')][_0xacb1('0x33')]);_0x1808af['where']=qs[_0xacb1('0x34')](_[_0xacb1('0x35')](_0x167d75[_0xacb1('0x2e')],_0x3965ab['filters']),_0x3850ac);if(_0x167d75['query'][_0xacb1('0x36')]){_0x1808af[_0xacb1('0x37')]=_[_0xacb1('0x38')](_0x1808af[_0xacb1('0x37')],{'$or':_[_0xacb1('0x2d')](_0x3850ac,function(_0xb7a74f){if(_0xb7a74f['type']!==_0xacb1('0x39')){var _0x5b4e57={};_0x5b4e57[_0xb7a74f['name']]={'$like':'%'+_0x167d75[_0xacb1('0x2e')]['filter']+'%'};return _0x5b4e57;}})});}_0x1808af=_[_0xacb1('0x38')]({},_0x1808af,_0x167d75[_0xacb1('0x3a')]);var _0x193038={'where':_0x1808af[_0xacb1('0x37')]};return db[_0xacb1('0x28')][_0xacb1('0x1a')](_0x193038)[_0xacb1('0x22')](function(_0x321620){_0x26f161[_0xacb1('0x1a')]=_0x321620;if(_0x167d75['query'][_0xacb1('0x3b')]){_0x1808af['include']=[{'all':!![]}];}return db['JscriptyQuestionReport']['findAll'](_0x1808af);})[_0xacb1('0x22')](function(_0x25ffd6){_0x26f161[_0xacb1('0x3c')]=_0x25ffd6;return _0x26f161;})[_0xacb1('0x22')](respondWithFilteredResult(_0x31231e,_0x1808af))[_0xacb1('0x3d')](handleError(_0x31231e,null));};exports[_0xacb1('0x3e')]=function(_0x12ff06,_0x54426e){var _0x48e9b2={'raw':!![],'where':{'id':_0x12ff06[_0xacb1('0x3f')]['id']}},_0x35bcf2={};_0x35bcf2['model']=_[_0xacb1('0x40')](db['JscriptyQuestionReport'][_0xacb1('0x41')]);_0x35bcf2[_0xacb1('0x2e')]=_[_0xacb1('0x40')](_0x12ff06[_0xacb1('0x2e')]);_0x35bcf2[_0xacb1('0x34')]=_['intersection'](_0x35bcf2[_0xacb1('0x2c')],_0x35bcf2[_0xacb1('0x2e')]);_0x48e9b2[_0xacb1('0x30')]=_[_0xacb1('0x2f')](_0x35bcf2['model'],qs[_0xacb1('0x42')](_0x12ff06[_0xacb1('0x2e')]['fields']));_0x48e9b2[_0xacb1('0x30')]=_0x48e9b2[_0xacb1('0x30')][_0xacb1('0x43')]?_0x48e9b2[_0xacb1('0x30')]:_0x35bcf2[_0xacb1('0x2c')];if(_0x12ff06[_0xacb1('0x2e')][_0xacb1('0x3b')]){_0x48e9b2['include']=[{'all':!![]}];}_0x48e9b2=_[_0xacb1('0x38')]({},_0x48e9b2,_0x12ff06[_0xacb1('0x3a')]);return db[_0xacb1('0x28')]['find'](_0x48e9b2)[_0xacb1('0x22')](handleEntityNotFound(_0x54426e,null))['then'](respondWithResult(_0x54426e,null))[_0xacb1('0x3d')](handleError(_0x54426e,null));};exports[_0xacb1('0x44')]=function(_0x216b67,_0x15893d){return db[_0xacb1('0x28')]['create'](_0x216b67[_0xacb1('0x45')],{})[_0xacb1('0x22')](respondWithResult(_0x15893d,0xc9))['catch'](handleError(_0x15893d,null));};exports['update']=function(_0x3d07f7,_0x33c09b){if(_0x3d07f7['body']['id']){delete _0x3d07f7[_0xacb1('0x45')]['id'];}return db[_0xacb1('0x28')][_0xacb1('0x46')]({'where':{'id':_0x3d07f7[_0xacb1('0x3f')]['id']}})[_0xacb1('0x22')](handleEntityNotFound(_0x33c09b,null))[_0xacb1('0x22')](saveUpdates(_0x3d07f7[_0xacb1('0x45')],null))['then'](respondWithResult(_0x33c09b,null))[_0xacb1('0x3d')](handleError(_0x33c09b,null));};exports[_0xacb1('0x21')]=function(_0x19c65e,_0x5edc18){return db[_0xacb1('0x28')][_0xacb1('0x46')]({'where':{'id':_0x19c65e['params']['id']}})[_0xacb1('0x22')](handleEntityNotFound(_0x5edc18,null))[_0xacb1('0x22')](removeEntity(_0x5edc18,null))[_0xacb1('0x3d')](handleError(_0x5edc18,null));};exports['describe']=function(_0x1593f2,_0x47ac11){return db[_0xacb1('0x28')][_0xacb1('0x47')]()[_0xacb1('0x22')](respondWithResult(_0x47ac11,null))[_0xacb1('0x3d')](handleError(_0x47ac11,null));}; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js index fdbac77..ffbec9f 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 _0x3ece=['exports','define','JscriptyQuestionReport','report_jscripty_questions','util','../../config/logger','api','moment','request-promise','path','../../config/environment','./jscriptyQuestionReport.attributes'];(function(_0x26b8b5,_0xf5c2c1){var _0x2150a9=function(_0x1ca1be){while(--_0x1ca1be){_0x26b8b5['push'](_0x26b8b5['shift']());}};_0x2150a9(++_0xf5c2c1);}(_0x3ece,0x1e4));var _0xe3ec=function(_0x168cff,_0x2b7d2a){_0x168cff=_0x168cff-0x0;var _0x2f0534=_0x3ece[_0x168cff];return _0x2f0534;};'use strict';var _=require('lodash');var util=require(_0xe3ec('0x0'));var logger=require(_0xe3ec('0x1'))(_0xe3ec('0x2'));var moment=require(_0xe3ec('0x3'));var BPromise=require('bluebird');var rp=require(_0xe3ec('0x4'));var fs=require('fs');var path=require(_0xe3ec('0x5'));var rimraf=require('rimraf');var config=require(_0xe3ec('0x6'));var attributes=require(_0xe3ec('0x7'));module[_0xe3ec('0x8')]=function(_0x383352,_0xdcbb6c){return _0x383352[_0xe3ec('0x9')](_0xe3ec('0xa'),attributes,{'tableName':_0xe3ec('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x14db=['request-promise','rimraf','../../config/environment','./jscriptyQuestionReport.attributes','exports','define','JscriptyQuestionReport','report_jscripty_questions','util','../../config/logger','api','bluebird'];(function(_0x13c281,_0x44c9cd){var _0x4753ca=function(_0x1fc09c){while(--_0x1fc09c){_0x13c281['push'](_0x13c281['shift']());}};_0x4753ca(++_0x44c9cd);}(_0x14db,0x1d0));var _0xb14d=function(_0x26b782,_0x4710ab){_0x26b782=_0x26b782-0x0;var _0x485b9c=_0x14db[_0x26b782];return _0x485b9c;};'use strict';var _=require('lodash');var util=require(_0xb14d('0x0'));var logger=require(_0xb14d('0x1'))(_0xb14d('0x2'));var moment=require('moment');var BPromise=require(_0xb14d('0x3'));var rp=require(_0xb14d('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb14d('0x5'));var config=require(_0xb14d('0x6'));var attributes=require(_0xb14d('0x7'));module[_0xb14d('0x8')]=function(_0x2363a1,_0x987780){return _0x2363a1[_0xb14d('0x9')](_0xb14d('0xa'),attributes,{'tableName':_0xb14d('0xb'),'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 262855d..9f58074 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 _0xd69b=['lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','info','request\x20sent','debug','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','stringify','error','code','JscriptyQuestionReport,\x20%s,\x20%s','message','result'];(function(_0xed5f9c,_0x5a25cd){var _0x3a1c43=function(_0x251202){while(--_0x251202){_0xed5f9c['push'](_0xed5f9c['shift']());}};_0x3a1c43(++_0x5a25cd);}(_0xd69b,0x73));var _0xbd69=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0xd69b[_0x42cae2];return _0x5f256f;};'use strict';var _=require(_0xbd69('0x0'));var util=require(_0xbd69('0x1'));var moment=require(_0xbd69('0x2'));var BPromise=require('bluebird');var rs=require(_0xbd69('0x3'));var fs=require('fs');var Redis=require(_0xbd69('0x4'));var db=require(_0xbd69('0x5'))['db'];var utils=require(_0xbd69('0x6'));var logger=require(_0xbd69('0x7'))(_0xbd69('0x8'));var config=require(_0xbd69('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xbd69('0xa')][_0xbd69('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x343729,_0x3ffb11,_0x13a124){return new BPromise(function(_0x3cc60f,_0x5363da){return client[_0xbd69('0xc')](_0x343729,_0x13a124)['then'](function(_0x429d29){logger[_0xbd69('0xd')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x3ffb11,_0xbd69('0xe'));logger[_0xbd69('0xf')](_0xbd69('0x10'),_0x3ffb11,'request\x20sent',JSON[_0xbd69('0x11')](_0x429d29));if(_0x429d29[_0xbd69('0x12')]){if(_0x429d29[_0xbd69('0x12')][_0xbd69('0x13')]===0x1f4){logger['error'](_0xbd69('0x14'),_0x3ffb11,_0x429d29[_0xbd69('0x12')][_0xbd69('0x15')]);return _0x5363da(_0x429d29[_0xbd69('0x12')]['message']);}logger[_0xbd69('0x12')](_0xbd69('0x14'),_0x3ffb11,_0x429d29[_0xbd69('0x12')][_0xbd69('0x15')]);return _0x3cc60f(_0x429d29[_0xbd69('0x12')][_0xbd69('0x15')]);}else{logger[_0xbd69('0xd')](_0xbd69('0x14'),_0x3ffb11,_0xbd69('0xe'));_0x3cc60f(_0x429d29[_0xbd69('0x16')][_0xbd69('0x15')]);}})['catch'](function(_0x252e21){logger[_0xbd69('0x12')](_0xbd69('0x14'),_0x3ffb11,_0x252e21);_0x5363da(_0x252e21);});});} \ No newline at end of file +var _0xe18c=['jayson/promise','client','http','then','info','JscriptyQuestionReport,\x20%s,\x20%s','request\x20sent','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x515566,_0x27d5e7){var _0x4e2f4e=function(_0xf3f7ce){while(--_0xf3f7ce){_0x515566['push'](_0x515566['shift']());}};_0x4e2f4e(++_0x27d5e7);}(_0xe18c,0x65));var _0xce18=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xe18c[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0xce18('0x0'));var util=require(_0xce18('0x1'));var moment=require(_0xce18('0x2'));var BPromise=require(_0xce18('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xce18('0x4'));var db=require(_0xce18('0x5'))['db'];var utils=require(_0xce18('0x6'));var logger=require(_0xce18('0x7'))(_0xce18('0x8'));var config=require('../../config/environment');var jayson=require(_0xce18('0x9'));var client=jayson[_0xce18('0xa')][_0xce18('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x52a284,_0x59386c,_0x19ebb3){return new BPromise(function(_0x5de78c,_0x23f32b){return client['request'](_0x52a284,_0x19ebb3)[_0xce18('0xc')](function(_0x4a1c8e){logger[_0xce18('0xd')](_0xce18('0xe'),_0x59386c,_0xce18('0xf'));logger['debug'](_0xce18('0x10'),_0x59386c,_0xce18('0xf'),JSON[_0xce18('0x11')](_0x4a1c8e));if(_0x4a1c8e['error']){if(_0x4a1c8e[_0xce18('0x12')][_0xce18('0x13')]===0x1f4){logger[_0xce18('0x12')](_0xce18('0xe'),_0x59386c,_0x4a1c8e['error'][_0xce18('0x14')]);return _0x23f32b(_0x4a1c8e[_0xce18('0x12')][_0xce18('0x14')]);}logger[_0xce18('0x12')](_0xce18('0xe'),_0x59386c,_0x4a1c8e[_0xce18('0x12')]['message']);return _0x5de78c(_0x4a1c8e[_0xce18('0x12')][_0xce18('0x14')]);}else{logger[_0xce18('0xd')](_0xce18('0xe'),_0x59386c,_0xce18('0xf'));_0x5de78c(_0x4a1c8e[_0xce18('0x15')][_0xce18('0x14')]);}})['catch'](function(_0xe3604a){logger[_0xce18('0x12')](_0xce18('0xe'),_0x59386c,_0xe3604a);_0x23f32b(_0xe3604a);});});} \ No newline at end of file diff --git a/server/api/jscriptySessionReport/index.js b/server/api/jscriptySessionReport/index.js index 2d910da..af605c3 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 _0xe20a=['exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptySessionReport.controller','get','isAuthenticated','/describe','describe','/:id','show','/:id/questions','getQuestions','post','create','put'];(function(_0x2f0504,_0x277e4c){var _0x52cd4f=function(_0x361209){while(--_0x361209){_0x2f0504['push'](_0x2f0504['shift']());}};_0x52cd4f(++_0x277e4c);}(_0xe20a,0x17b));var _0xae20=function(_0x34dd23,_0x50ce42){_0x34dd23=_0x34dd23-0x0;var _0x18a648=_0xe20a[_0x34dd23];return _0x18a648;};'use strict';var multer=require(_0xae20('0x0'));var util=require('util');var path=require(_0xae20('0x1'));var timeout=require(_0xae20('0x2'));var express=require(_0xae20('0x3'));var router=express[_0xae20('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xae20('0x5'));var interaction=require(_0xae20('0x6'));var config=require(_0xae20('0x7'));var controller=require(_0xae20('0x8'));router[_0xae20('0x9')]('/',auth[_0xae20('0xa')](),controller['index']);router[_0xae20('0x9')](_0xae20('0xb'),auth[_0xae20('0xa')](),controller[_0xae20('0xc')]);router[_0xae20('0x9')](_0xae20('0xd'),auth['isAuthenticated'](),controller[_0xae20('0xe')]);router[_0xae20('0x9')](_0xae20('0xf'),auth[_0xae20('0xa')](),controller[_0xae20('0x10')]);router[_0xae20('0x11')]('/',auth[_0xae20('0xa')](),controller[_0xae20('0x12')]);router[_0xae20('0x13')](_0xae20('0xd'),auth[_0xae20('0xa')](),controller['update']);router['delete'](_0xae20('0xd'),auth[_0xae20('0xa')](),controller['destroy']);module[_0xae20('0x14')]=router; \ No newline at end of file +var _0x8494=['describe','/:id','/:id/questions','getQuestions','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptySessionReport.controller','get','isAuthenticated','index','/describe'];(function(_0x1774dd,_0x18697e){var _0x137a78=function(_0x15bf58){while(--_0x15bf58){_0x1774dd['push'](_0x1774dd['shift']());}};_0x137a78(++_0x18697e);}(_0x8494,0xa7));var _0x4849=function(_0x3c67f1,_0x340704){_0x3c67f1=_0x3c67f1-0x0;var _0x46c9f2=_0x8494[_0x3c67f1];return _0x46c9f2;};'use strict';var multer=require(_0x4849('0x0'));var util=require(_0x4849('0x1'));var path=require(_0x4849('0x2'));var timeout=require(_0x4849('0x3'));var express=require(_0x4849('0x4'));var router=express[_0x4849('0x5')]();var fs_extra=require(_0x4849('0x6'));var auth=require(_0x4849('0x7'));var interaction=require(_0x4849('0x8'));var config=require(_0x4849('0x9'));var controller=require(_0x4849('0xa'));router[_0x4849('0xb')]('/',auth[_0x4849('0xc')](),controller[_0x4849('0xd')]);router[_0x4849('0xb')](_0x4849('0xe'),auth[_0x4849('0xc')](),controller[_0x4849('0xf')]);router[_0x4849('0xb')](_0x4849('0x10'),auth[_0x4849('0xc')](),controller['show']);router[_0x4849('0xb')](_0x4849('0x11'),auth['isAuthenticated'](),controller[_0x4849('0x12')]);router[_0x4849('0x13')]('/',auth[_0x4849('0xc')](),controller[_0x4849('0x14')]);router[_0x4849('0x15')](_0x4849('0x10'),auth[_0x4849('0xc')](),controller[_0x4849('0x16')]);router[_0x4849('0x17')](_0x4849('0x10'),auth[_0x4849('0xc')](),controller[_0x4849('0x18')]);module[_0x4849('0x19')]=router; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js b/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js index d36aeba..64d0e39 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 _0x8fed=['exports','DATE','setDataValue','starttime','YYYY-MM-DD\x20HH:mm:ss','STRING','sequelize'];(function(_0x36d6e9,_0x1e4049){var _0x130a5d=function(_0x153860){while(--_0x153860){_0x36d6e9['push'](_0x36d6e9['shift']());}};_0x130a5d(++_0x1e4049);}(_0x8fed,0x19c));var _0xd8fe=function(_0x3dfdd5,_0x594ee7){_0x3dfdd5=_0x3dfdd5-0x0;var _0x5b44e1=_0x8fed[_0x3dfdd5];return _0x5b44e1;};'use strict';var moment=require('moment');var Sequelize=require(_0xd8fe('0x0'));module[_0xd8fe('0x1')]={'starttime':{'type':Sequelize[_0xd8fe('0x2')],'set':function(_0x52de25){this[_0xd8fe('0x3')](_0xd8fe('0x4'),_0x52de25);this[_0xd8fe('0x3')]('endtime',moment()['format'](_0xd8fe('0x5')));}},'endtime':{'type':Sequelize[_0xd8fe('0x2')]},'membername':{'type':Sequelize[_0xd8fe('0x6')]},'projectname':{'type':Sequelize[_0xd8fe('0x6')]},'queue':{'type':Sequelize[_0xd8fe('0x6')]},'uniqueid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0xd8fe('0x6')]},'calleridnum':{'type':Sequelize[_0xd8fe('0x6')]},'completed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0xf17d=['exports','DATE','setDataValue','endtime','format','YYYY-MM-DD\x20HH:mm:ss','STRING','BOOLEAN','moment','sequelize'];(function(_0x71b1c0,_0xa5c636){var _0x684079=function(_0x1582df){while(--_0x1582df){_0x71b1c0['push'](_0x71b1c0['shift']());}};_0x684079(++_0xa5c636);}(_0xf17d,0xd0));var _0xdf17=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0xf17d[_0x3ab51d];return _0x29a04e;};'use strict';var moment=require(_0xdf17('0x0'));var Sequelize=require(_0xdf17('0x1'));module[_0xdf17('0x2')]={'starttime':{'type':Sequelize[_0xdf17('0x3')],'set':function(_0x523876){this[_0xdf17('0x4')]('starttime',_0x523876);this[_0xdf17('0x4')](_0xdf17('0x5'),moment()[_0xdf17('0x6')](_0xdf17('0x7')));}},'endtime':{'type':Sequelize[_0xdf17('0x3')]},'membername':{'type':Sequelize[_0xdf17('0x8')]},'projectname':{'type':Sequelize[_0xdf17('0x8')]},'queue':{'type':Sequelize[_0xdf17('0x8')]},'uniqueid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0xdf17('0x8')]},'calleridnum':{'type':Sequelize[_0xdf17('0x8')]},'completed':{'type':Sequelize[_0xdf17('0x9')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.controller.js b/server/api/jscriptySessionReport/jscriptySessionReport.controller.js index ba5282f..9fb5bd0 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 _0x7d1c=['../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','then','destroy','name','send','index','map','rawAttributes','type','key','model','query','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','filters','pick','filter','merge','VIRTUAL','JscriptySessionReport','includeAll','include','findAll','rows','catch','params','keys','options','create','body','update','find','describe','findOne','JscriptyQuestionReport','nolimit','SessionId','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','squel','crypto','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment'];(function(_0x32aa1c,_0x8edb24){var _0x381fa9=function(_0x1473e7){while(--_0x1473e7){_0x32aa1c['push'](_0x32aa1c['shift']());}};_0x381fa9(++_0x8edb24);}(_0x7d1c,0xd4));var _0xc7d1=function(_0x5dc8c3,_0x22eee9){_0x5dc8c3=_0x5dc8c3-0x0;var _0x456a93=_0x7d1c[_0x5dc8c3];return _0x456a93;};'use strict';var emlformat=require(_0xc7d1('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xc7d1('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xc7d1('0x2'));var moment=require(_0xc7d1('0x3'));var BPromise=require(_0xc7d1('0x4'));var Mustache=require(_0xc7d1('0x5'));var util=require(_0xc7d1('0x6'));var path=require(_0xc7d1('0x7'));var sox=require('sox');var csv=require(_0xc7d1('0x8'));var ejs=require(_0xc7d1('0x9'));var fs=require('fs');var fs_extra=require(_0xc7d1('0xa'));var _=require('lodash');var squel=require(_0xc7d1('0xb'));var crypto=require(_0xc7d1('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xc7d1('0xd'));var Papa=require(_0xc7d1('0xe'));var Redis=require('ioredis');var authService=require(_0xc7d1('0xf'));var qs=require(_0xc7d1('0x10'));var as=require(_0xc7d1('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xc7d1('0x12'))(_0xc7d1('0x13'));var utils=require(_0xc7d1('0x14'));var config=require(_0xc7d1('0x15'));var licenseUtil=require(_0xc7d1('0x16'));var db=require(_0xc7d1('0x17'))['db'];function respondWithStatusCode(_0x5f3c38,_0x2e9eb7){_0x2e9eb7=_0x2e9eb7||0xcc;return function(_0x30fa9a){if(_0x30fa9a){return _0x5f3c38[_0xc7d1('0x18')](_0x2e9eb7);}return _0x5f3c38[_0xc7d1('0x19')](_0x2e9eb7)[_0xc7d1('0x1a')]();};}function respondWithResult(_0x419072,_0x414db1){_0x414db1=_0x414db1||0xc8;return function(_0x16777b){if(_0x16777b){return _0x419072['status'](_0x414db1)[_0xc7d1('0x1b')](_0x16777b);}};}function respondWithFilteredResult(_0x1df123,_0x2d91fe){return function(_0x57ea47){if(_0x57ea47){var _0x20b609=typeof _0x2d91fe[_0xc7d1('0x1c')]==='undefined'&&typeof _0x2d91fe[_0xc7d1('0x1d')]===_0xc7d1('0x1e');var _0x185a1d=_0x57ea47[_0xc7d1('0x1f')];var _0x87adf1=_0x20b609?0x0:_0x2d91fe['offset'];var _0xf9ad50=_0x20b609?_0x57ea47[_0xc7d1('0x1f')]:_0x2d91fe['offset']+_0x2d91fe[_0xc7d1('0x1d')];var _0x4a9a2c;if(_0xf9ad50>=_0x185a1d){_0xf9ad50=_0x185a1d;_0x4a9a2c=0xc8;}else{_0x4a9a2c=0xce;}_0x1df123['status'](_0x4a9a2c);return _0x1df123[_0xc7d1('0x20')](_0xc7d1('0x21'),_0x87adf1+'-'+_0xf9ad50+'/'+_0x185a1d)['json'](_0x57ea47);}return null;};}function patchUpdates(_0x4186f3){return function(_0x3ebac7){try{jsonpatch[_0xc7d1('0x22')](_0x3ebac7,_0x4186f3,!![]);}catch(_0x40fd93){return BPromise[_0xc7d1('0x23')](_0x40fd93);}return _0x3ebac7['save']();};}function saveUpdates(_0x4ee4b3,_0x1dd3f0){return function(_0xf0dfd1){if(_0xf0dfd1){return _0xf0dfd1['update'](_0x4ee4b3)[_0xc7d1('0x24')](function(_0x3f345b){return _0x3f345b;});}return null;};}function removeEntity(_0x50237e,_0x3d46bc){return function(_0x3222ed){if(_0x3222ed){return _0x3222ed[_0xc7d1('0x25')]()[_0xc7d1('0x24')](function(){_0x50237e[_0xc7d1('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x24802e,_0x1ed804){return function(_0x4fb7d9){if(!_0x4fb7d9){_0x24802e['sendStatus'](0x194);}return _0x4fb7d9;};}function handleError(_0x8e66b2,_0x1387b6){_0x1387b6=_0x1387b6||0x1f4;return function(_0x340327){logger['error'](_0x340327['stack']);if(_0x340327[_0xc7d1('0x26')]){delete _0x340327['name'];}_0x8e66b2['status'](_0x1387b6)[_0xc7d1('0x27')](_0x340327);};}exports[_0xc7d1('0x28')]=function(_0x2e983d,_0x30b75b){var _0x48ee0f={},_0x216a4d={},_0x3a749d={'count':0x0,'rows':[]};var _0x2f9d02=_[_0xc7d1('0x29')](db['JscriptySessionReport'][_0xc7d1('0x2a')],function(_0x294cf9){return{'name':_0x294cf9['fieldName'],'type':_0x294cf9[_0xc7d1('0x2b')][_0xc7d1('0x2c')]};});_0x216a4d[_0xc7d1('0x2d')]=_['map'](_0x2f9d02,'name');_0x216a4d[_0xc7d1('0x2e')]=_['keys'](_0x2e983d[_0xc7d1('0x2e')]);_0x216a4d['filters']=_['intersection'](_0x216a4d[_0xc7d1('0x2d')],_0x216a4d[_0xc7d1('0x2e')]);_0x48ee0f[_0xc7d1('0x2f')]=_[_0xc7d1('0x30')](_0x216a4d['model'],qs['fields'](_0x2e983d[_0xc7d1('0x2e')][_0xc7d1('0x31')]));_0x48ee0f[_0xc7d1('0x2f')]=_0x48ee0f[_0xc7d1('0x2f')][_0xc7d1('0x32')]?_0x48ee0f[_0xc7d1('0x2f')]:_0x216a4d[_0xc7d1('0x2d')];if(!_0x2e983d['query'][_0xc7d1('0x33')]('nolimit')){_0x48ee0f[_0xc7d1('0x1d')]=qs[_0xc7d1('0x1d')](_0x2e983d[_0xc7d1('0x2e')][_0xc7d1('0x1d')]);_0x48ee0f[_0xc7d1('0x1c')]=qs['offset'](_0x2e983d[_0xc7d1('0x2e')][_0xc7d1('0x1c')]);}_0x48ee0f[_0xc7d1('0x34')]=qs[_0xc7d1('0x35')](_0x2e983d[_0xc7d1('0x2e')][_0xc7d1('0x35')]);_0x48ee0f[_0xc7d1('0x36')]=qs[_0xc7d1('0x37')](_[_0xc7d1('0x38')](_0x2e983d[_0xc7d1('0x2e')],_0x216a4d['filters']),_0x2f9d02);if(_0x2e983d['query'][_0xc7d1('0x39')]){_0x48ee0f[_0xc7d1('0x36')]=_[_0xc7d1('0x3a')](_0x48ee0f[_0xc7d1('0x36')],{'$or':_[_0xc7d1('0x29')](_0x2f9d02,function(_0x4d9fb5){if(_0x4d9fb5['type']!==_0xc7d1('0x3b')){var _0xba457c={};_0xba457c[_0x4d9fb5[_0xc7d1('0x26')]]={'$like':'%'+_0x2e983d[_0xc7d1('0x2e')][_0xc7d1('0x39')]+'%'};return _0xba457c;}})});}_0x48ee0f=_[_0xc7d1('0x3a')]({},_0x48ee0f,_0x2e983d['options']);var _0x1b1471={'where':_0x48ee0f[_0xc7d1('0x36')]};return db[_0xc7d1('0x3c')][_0xc7d1('0x1f')](_0x1b1471)[_0xc7d1('0x24')](function(_0x59ccb1){_0x3a749d['count']=_0x59ccb1;if(_0x2e983d[_0xc7d1('0x2e')][_0xc7d1('0x3d')]){_0x48ee0f[_0xc7d1('0x3e')]=[{'all':!![]}];}return db['JscriptySessionReport'][_0xc7d1('0x3f')](_0x48ee0f);})[_0xc7d1('0x24')](function(_0x110b28){_0x3a749d[_0xc7d1('0x40')]=_0x110b28;return _0x3a749d;})[_0xc7d1('0x24')](respondWithFilteredResult(_0x30b75b,_0x48ee0f))[_0xc7d1('0x41')](handleError(_0x30b75b,null));};exports['show']=function(_0x2b7afb,_0x110457){var _0x4a903e={'raw':!![],'where':{'id':_0x2b7afb[_0xc7d1('0x42')]['id']}},_0x11a8bb={};_0x11a8bb[_0xc7d1('0x2d')]=_[_0xc7d1('0x43')](db['JscriptySessionReport'][_0xc7d1('0x2a')]);_0x11a8bb[_0xc7d1('0x2e')]=_[_0xc7d1('0x43')](_0x2b7afb[_0xc7d1('0x2e')]);_0x11a8bb[_0xc7d1('0x37')]=_[_0xc7d1('0x30')](_0x11a8bb['model'],_0x11a8bb['query']);_0x4a903e[_0xc7d1('0x2f')]=_[_0xc7d1('0x30')](_0x11a8bb['model'],qs[_0xc7d1('0x31')](_0x2b7afb[_0xc7d1('0x2e')][_0xc7d1('0x31')]));_0x4a903e[_0xc7d1('0x2f')]=_0x4a903e[_0xc7d1('0x2f')]['length']?_0x4a903e[_0xc7d1('0x2f')]:_0x11a8bb[_0xc7d1('0x2d')];if(_0x2b7afb[_0xc7d1('0x2e')][_0xc7d1('0x3d')]){_0x4a903e[_0xc7d1('0x3e')]=[{'all':!![]}];}_0x4a903e=_[_0xc7d1('0x3a')]({},_0x4a903e,_0x2b7afb[_0xc7d1('0x44')]);return db[_0xc7d1('0x3c')]['find'](_0x4a903e)[_0xc7d1('0x24')](handleEntityNotFound(_0x110457,null))['then'](respondWithResult(_0x110457,null))['catch'](handleError(_0x110457,null));};exports[_0xc7d1('0x45')]=function(_0x2ece77,_0x500e59){return db[_0xc7d1('0x3c')][_0xc7d1('0x45')](_0x2ece77[_0xc7d1('0x46')],{})[_0xc7d1('0x24')](respondWithResult(_0x500e59,0xc9))['catch'](handleError(_0x500e59,null));};exports[_0xc7d1('0x47')]=function(_0x3c6d09,_0x334491){if(_0x3c6d09[_0xc7d1('0x46')]['id']){delete _0x3c6d09[_0xc7d1('0x46')]['id'];}return db['JscriptySessionReport']['find']({'where':{'id':_0x3c6d09['params']['id']}})[_0xc7d1('0x24')](handleEntityNotFound(_0x334491,null))['then'](saveUpdates(_0x3c6d09[_0xc7d1('0x46')],null))[_0xc7d1('0x24')](respondWithResult(_0x334491,null))['catch'](handleError(_0x334491,null));};exports[_0xc7d1('0x25')]=function(_0x231846,_0x13b6f8){return db[_0xc7d1('0x3c')][_0xc7d1('0x48')]({'where':{'id':_0x231846[_0xc7d1('0x42')]['id']}})[_0xc7d1('0x24')](handleEntityNotFound(_0x13b6f8,null))[_0xc7d1('0x24')](removeEntity(_0x13b6f8,null))[_0xc7d1('0x41')](handleError(_0x13b6f8,null));};exports[_0xc7d1('0x49')]=function(_0x805f84,_0x56b299){return db[_0xc7d1('0x3c')][_0xc7d1('0x49')]()[_0xc7d1('0x24')](respondWithResult(_0x56b299,null))['catch'](handleError(_0x56b299,null));};exports['getQuestions']=function(_0x4363fa,_0x3da5d9,_0x4ae0a6){var _0x248d2f={'raw':!![],'where':{}};var _0x5571c3={};var _0xe02548={'count':0x0,'rows':[]};return db[_0xc7d1('0x3c')][_0xc7d1('0x4a')]({'where':{'id':_0x4363fa['params']['id']}})[_0xc7d1('0x24')](handleEntityNotFound(_0x3da5d9,null))[_0xc7d1('0x24')](function(_0x56a79d){if(_0x56a79d){_0x5571c3[_0xc7d1('0x2d')]=_[_0xc7d1('0x43')](db[_0xc7d1('0x4b')][_0xc7d1('0x2a')]);_0x5571c3[_0xc7d1('0x2e')]=_[_0xc7d1('0x43')](_0x4363fa['query']);_0x5571c3['filters']=_[_0xc7d1('0x30')](_0x5571c3[_0xc7d1('0x2d')],_0x5571c3[_0xc7d1('0x2e')]);_0x248d2f[_0xc7d1('0x2f')]=_[_0xc7d1('0x30')](_0x5571c3['model'],qs[_0xc7d1('0x31')](_0x4363fa[_0xc7d1('0x2e')][_0xc7d1('0x31')]));_0x248d2f[_0xc7d1('0x2f')]=_0x248d2f['attributes'][_0xc7d1('0x32')]?_0x248d2f[_0xc7d1('0x2f')]:_0x5571c3[_0xc7d1('0x2d')];if(!_0x4363fa[_0xc7d1('0x2e')][_0xc7d1('0x33')](_0xc7d1('0x4c'))){_0x248d2f['limit']=qs[_0xc7d1('0x1d')](_0x4363fa['query'][_0xc7d1('0x1d')]);_0x248d2f['offset']=qs['offset'](_0x4363fa[_0xc7d1('0x2e')][_0xc7d1('0x1c')]);}_0x248d2f[_0xc7d1('0x34')]=qs['sort'](_0x4363fa[_0xc7d1('0x2e')]['sort']);_0x248d2f['where']=qs['filters'](_[_0xc7d1('0x38')](_0x4363fa['query'],_0x5571c3[_0xc7d1('0x37')]));_0x248d2f[_0xc7d1('0x36')][_0xc7d1('0x4d')]=_0x56a79d['id'];if(_0x4363fa[_0xc7d1('0x2e')][_0xc7d1('0x39')]){_0x248d2f[_0xc7d1('0x36')]=_['merge'](_0x248d2f[_0xc7d1('0x36')],{'$or':_[_0xc7d1('0x29')](_0x248d2f[_0xc7d1('0x2f')],function(_0x18414e){var _0x1d3483={};_0x1d3483[_0x18414e]={'$like':'%'+_0x4363fa[_0xc7d1('0x2e')][_0xc7d1('0x39')]+'%'};return _0x1d3483;})});}_0x248d2f=_[_0xc7d1('0x3a')]({},_0x248d2f,_0x4363fa[_0xc7d1('0x44')]);return db[_0xc7d1('0x4b')][_0xc7d1('0x1f')]({'where':_0x248d2f[_0xc7d1('0x36')]})['then'](function(_0x3ca0a9){_0xe02548['count']=_0x3ca0a9;if(_0x4363fa[_0xc7d1('0x2e')][_0xc7d1('0x3d')]){_0x248d2f[_0xc7d1('0x3e')]=[{'all':!![]}];}return db[_0xc7d1('0x4b')][_0xc7d1('0x3f')](_0x248d2f);})[_0xc7d1('0x24')](function(_0x15871e){_0xe02548[_0xc7d1('0x40')]=_0x15871e;return _0xe02548;});}})[_0xc7d1('0x24')](respondWithFilteredResult(_0x3da5d9,_0x248d2f))['catch'](handleError(_0x3da5d9,null));}; \ No newline at end of file +var _0x3592=['VIRTUAL','options','includeAll','include','findAll','rows','show','params','find','create','body','catch','describe','getQuestions','findOne','JscriptyQuestionReport','SessionId','filter','zip-dir','request-promise','mustache','util','path','to-csv','ejs','fs-extra','lodash','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../mysqldb','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','update','then','destroy','sendStatus','error','stack','name','map','JscriptySessionReport','rawAttributes','fieldName','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','pick','where','merge','type'];(function(_0x3cd574,_0x148bb0){var _0x1286bf=function(_0x27cbb0){while(--_0x27cbb0){_0x3cd574['push'](_0x3cd574['shift']());}};_0x1286bf(++_0x148bb0);}(_0x3592,0x136));var _0x2359=function(_0x48c83e,_0x2dd147){_0x48c83e=_0x48c83e-0x0;var _0x4673f8=_0x3592[_0x48c83e];return _0x4673f8;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x2359('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2359('0x1'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x2359('0x2'));var util=require(_0x2359('0x3'));var path=require(_0x2359('0x4'));var sox=require('sox');var csv=require(_0x2359('0x5'));var ejs=require(_0x2359('0x6'));var fs=require('fs');var fs_extra=require(_0x2359('0x7'));var _=require(_0x2359('0x8'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x2359('0x9'));var deskjs=require('desk.js');var toCsv=require(_0x2359('0x5'));var querystring=require(_0x2359('0xa'));var Papa=require('papaparse');var Redis=require(_0x2359('0xb'));var authService=require(_0x2359('0xc'));var qs=require(_0x2359('0xd'));var as=require(_0x2359('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2359('0xf'))(_0x2359('0x10'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x2359('0x11'))['db'];function respondWithStatusCode(_0x1d7272,_0x2d8784){_0x2d8784=_0x2d8784||0xcc;return function(_0x43b6f8){if(_0x43b6f8){return _0x1d7272['sendStatus'](_0x2d8784);}return _0x1d7272[_0x2359('0x12')](_0x2d8784)[_0x2359('0x13')]();};}function respondWithResult(_0x59f2fc,_0x7b926){_0x7b926=_0x7b926||0xc8;return function(_0xc39aab){if(_0xc39aab){return _0x59f2fc[_0x2359('0x12')](_0x7b926)['json'](_0xc39aab);}};}function respondWithFilteredResult(_0x4a8e43,_0x28a851){return function(_0x1eea2b){if(_0x1eea2b){var _0x32c07f=typeof _0x28a851[_0x2359('0x14')]===_0x2359('0x15')&&typeof _0x28a851[_0x2359('0x16')]==='undefined';var _0x591799=_0x1eea2b[_0x2359('0x17')];var _0x475d71=_0x32c07f?0x0:_0x28a851['offset'];var _0x4c851b=_0x32c07f?_0x1eea2b[_0x2359('0x17')]:_0x28a851['offset']+_0x28a851[_0x2359('0x16')];var _0x10b0db;if(_0x4c851b>=_0x591799){_0x4c851b=_0x591799;_0x10b0db=0xc8;}else{_0x10b0db=0xce;}_0x4a8e43[_0x2359('0x12')](_0x10b0db);return _0x4a8e43[_0x2359('0x18')](_0x2359('0x19'),_0x475d71+'-'+_0x4c851b+'/'+_0x591799)[_0x2359('0x1a')](_0x1eea2b);}return null;};}function patchUpdates(_0x368ac){return function(_0x95652b){try{jsonpatch[_0x2359('0x1b')](_0x95652b,_0x368ac,!![]);}catch(_0x449c50){return BPromise['reject'](_0x449c50);}return _0x95652b['save']();};}function saveUpdates(_0x5fc3c7,_0xb596b6){return function(_0x4a2f3b){if(_0x4a2f3b){return _0x4a2f3b[_0x2359('0x1c')](_0x5fc3c7)[_0x2359('0x1d')](function(_0x21ee7f){return _0x21ee7f;});}return null;};}function removeEntity(_0x24abd0,_0xf3eb08){return function(_0x47a0c7){if(_0x47a0c7){return _0x47a0c7[_0x2359('0x1e')]()[_0x2359('0x1d')](function(){_0x24abd0[_0x2359('0x12')](0xcc)['end']();});}};}function handleEntityNotFound(_0x589e74,_0x138106){return function(_0x5234cc){if(!_0x5234cc){_0x589e74[_0x2359('0x1f')](0x194);}return _0x5234cc;};}function handleError(_0x21228c,_0x39e327){_0x39e327=_0x39e327||0x1f4;return function(_0x23b98b){logger[_0x2359('0x20')](_0x23b98b[_0x2359('0x21')]);if(_0x23b98b[_0x2359('0x22')]){delete _0x23b98b['name'];}_0x21228c[_0x2359('0x12')](_0x39e327)['send'](_0x23b98b);};}exports['index']=function(_0xda23ab,_0x56ee1c){var _0x26cdde={},_0x5b3512={},_0x3ad85d={'count':0x0,'rows':[]};var _0x41edec=_[_0x2359('0x23')](db[_0x2359('0x24')][_0x2359('0x25')],function(_0x3b87e7){return{'name':_0x3b87e7[_0x2359('0x26')],'type':_0x3b87e7['type']['key']};});_0x5b3512[_0x2359('0x27')]=_['map'](_0x41edec,'name');_0x5b3512[_0x2359('0x28')]=_[_0x2359('0x29')](_0xda23ab[_0x2359('0x28')]);_0x5b3512[_0x2359('0x2a')]=_['intersection'](_0x5b3512['model'],_0x5b3512['query']);_0x26cdde[_0x2359('0x2b')]=_[_0x2359('0x2c')](_0x5b3512[_0x2359('0x27')],qs[_0x2359('0x2d')](_0xda23ab[_0x2359('0x28')][_0x2359('0x2d')]));_0x26cdde[_0x2359('0x2b')]=_0x26cdde[_0x2359('0x2b')][_0x2359('0x2e')]?_0x26cdde[_0x2359('0x2b')]:_0x5b3512[_0x2359('0x27')];if(!_0xda23ab[_0x2359('0x28')][_0x2359('0x2f')](_0x2359('0x30'))){_0x26cdde[_0x2359('0x16')]=qs[_0x2359('0x16')](_0xda23ab[_0x2359('0x28')][_0x2359('0x16')]);_0x26cdde[_0x2359('0x14')]=qs[_0x2359('0x14')](_0xda23ab[_0x2359('0x28')][_0x2359('0x14')]);}_0x26cdde[_0x2359('0x31')]=qs[_0x2359('0x32')](_0xda23ab[_0x2359('0x28')][_0x2359('0x32')]);_0x26cdde['where']=qs[_0x2359('0x2a')](_[_0x2359('0x33')](_0xda23ab[_0x2359('0x28')],_0x5b3512[_0x2359('0x2a')]),_0x41edec);if(_0xda23ab[_0x2359('0x28')]['filter']){_0x26cdde[_0x2359('0x34')]=_[_0x2359('0x35')](_0x26cdde[_0x2359('0x34')],{'$or':_[_0x2359('0x23')](_0x41edec,function(_0x308273){if(_0x308273[_0x2359('0x36')]!==_0x2359('0x37')){var _0x5b1215={};_0x5b1215[_0x308273[_0x2359('0x22')]]={'$like':'%'+_0xda23ab[_0x2359('0x28')]['filter']+'%'};return _0x5b1215;}})});}_0x26cdde=_[_0x2359('0x35')]({},_0x26cdde,_0xda23ab[_0x2359('0x38')]);var _0x498a6a={'where':_0x26cdde[_0x2359('0x34')]};return db[_0x2359('0x24')]['count'](_0x498a6a)[_0x2359('0x1d')](function(_0x59cd5e){_0x3ad85d[_0x2359('0x17')]=_0x59cd5e;if(_0xda23ab[_0x2359('0x28')][_0x2359('0x39')]){_0x26cdde[_0x2359('0x3a')]=[{'all':!![]}];}return db[_0x2359('0x24')][_0x2359('0x3b')](_0x26cdde);})['then'](function(_0x6bf6e7){_0x3ad85d[_0x2359('0x3c')]=_0x6bf6e7;return _0x3ad85d;})[_0x2359('0x1d')](respondWithFilteredResult(_0x56ee1c,_0x26cdde))['catch'](handleError(_0x56ee1c,null));};exports[_0x2359('0x3d')]=function(_0x5074bf,_0x1b9e07){var _0x4398c9={'raw':!![],'where':{'id':_0x5074bf[_0x2359('0x3e')]['id']}},_0x5001bc={};_0x5001bc['model']=_['keys'](db['JscriptySessionReport'][_0x2359('0x25')]);_0x5001bc[_0x2359('0x28')]=_['keys'](_0x5074bf[_0x2359('0x28')]);_0x5001bc['filters']=_[_0x2359('0x2c')](_0x5001bc['model'],_0x5001bc[_0x2359('0x28')]);_0x4398c9[_0x2359('0x2b')]=_['intersection'](_0x5001bc[_0x2359('0x27')],qs[_0x2359('0x2d')](_0x5074bf[_0x2359('0x28')][_0x2359('0x2d')]));_0x4398c9['attributes']=_0x4398c9['attributes'][_0x2359('0x2e')]?_0x4398c9[_0x2359('0x2b')]:_0x5001bc[_0x2359('0x27')];if(_0x5074bf[_0x2359('0x28')][_0x2359('0x39')]){_0x4398c9[_0x2359('0x3a')]=[{'all':!![]}];}_0x4398c9=_[_0x2359('0x35')]({},_0x4398c9,_0x5074bf['options']);return db[_0x2359('0x24')][_0x2359('0x3f')](_0x4398c9)[_0x2359('0x1d')](handleEntityNotFound(_0x1b9e07,null))[_0x2359('0x1d')](respondWithResult(_0x1b9e07,null))['catch'](handleError(_0x1b9e07,null));};exports[_0x2359('0x40')]=function(_0x4509cd,_0x21a954){return db[_0x2359('0x24')][_0x2359('0x40')](_0x4509cd[_0x2359('0x41')],{})[_0x2359('0x1d')](respondWithResult(_0x21a954,0xc9))[_0x2359('0x42')](handleError(_0x21a954,null));};exports[_0x2359('0x1c')]=function(_0x794ce9,_0x4bdacc){if(_0x794ce9[_0x2359('0x41')]['id']){delete _0x794ce9['body']['id'];}return db[_0x2359('0x24')][_0x2359('0x3f')]({'where':{'id':_0x794ce9[_0x2359('0x3e')]['id']}})[_0x2359('0x1d')](handleEntityNotFound(_0x4bdacc,null))[_0x2359('0x1d')](saveUpdates(_0x794ce9['body'],null))[_0x2359('0x1d')](respondWithResult(_0x4bdacc,null))[_0x2359('0x42')](handleError(_0x4bdacc,null));};exports[_0x2359('0x1e')]=function(_0x342de3,_0x1dbede){return db[_0x2359('0x24')][_0x2359('0x3f')]({'where':{'id':_0x342de3['params']['id']}})[_0x2359('0x1d')](handleEntityNotFound(_0x1dbede,null))[_0x2359('0x1d')](removeEntity(_0x1dbede,null))[_0x2359('0x42')](handleError(_0x1dbede,null));};exports[_0x2359('0x43')]=function(_0x17e7d2,_0x2f0a22){return db[_0x2359('0x24')]['describe']()[_0x2359('0x1d')](respondWithResult(_0x2f0a22,null))[_0x2359('0x42')](handleError(_0x2f0a22,null));};exports[_0x2359('0x44')]=function(_0x20ccfb,_0xb7812c,_0x8f31cd){var _0x4ec387={'raw':!![],'where':{}};var _0x42d59c={};var _0x166026={'count':0x0,'rows':[]};return db[_0x2359('0x24')][_0x2359('0x45')]({'where':{'id':_0x20ccfb['params']['id']}})[_0x2359('0x1d')](handleEntityNotFound(_0xb7812c,null))[_0x2359('0x1d')](function(_0x375c01){if(_0x375c01){_0x42d59c[_0x2359('0x27')]=_[_0x2359('0x29')](db[_0x2359('0x46')]['rawAttributes']);_0x42d59c[_0x2359('0x28')]=_['keys'](_0x20ccfb[_0x2359('0x28')]);_0x42d59c[_0x2359('0x2a')]=_[_0x2359('0x2c')](_0x42d59c['model'],_0x42d59c[_0x2359('0x28')]);_0x4ec387[_0x2359('0x2b')]=_['intersection'](_0x42d59c[_0x2359('0x27')],qs[_0x2359('0x2d')](_0x20ccfb['query'][_0x2359('0x2d')]));_0x4ec387[_0x2359('0x2b')]=_0x4ec387['attributes']['length']?_0x4ec387[_0x2359('0x2b')]:_0x42d59c[_0x2359('0x27')];if(!_0x20ccfb[_0x2359('0x28')]['hasOwnProperty'](_0x2359('0x30'))){_0x4ec387[_0x2359('0x16')]=qs[_0x2359('0x16')](_0x20ccfb[_0x2359('0x28')][_0x2359('0x16')]);_0x4ec387['offset']=qs[_0x2359('0x14')](_0x20ccfb[_0x2359('0x28')][_0x2359('0x14')]);}_0x4ec387[_0x2359('0x31')]=qs[_0x2359('0x32')](_0x20ccfb['query'][_0x2359('0x32')]);_0x4ec387[_0x2359('0x34')]=qs[_0x2359('0x2a')](_[_0x2359('0x33')](_0x20ccfb['query'],_0x42d59c['filters']));_0x4ec387[_0x2359('0x34')][_0x2359('0x47')]=_0x375c01['id'];if(_0x20ccfb[_0x2359('0x28')][_0x2359('0x48')]){_0x4ec387['where']=_[_0x2359('0x35')](_0x4ec387['where'],{'$or':_[_0x2359('0x23')](_0x4ec387['attributes'],function(_0x170539){var _0x49d3b4={};_0x49d3b4[_0x170539]={'$like':'%'+_0x20ccfb['query']['filter']+'%'};return _0x49d3b4;})});}_0x4ec387=_[_0x2359('0x35')]({},_0x4ec387,_0x20ccfb[_0x2359('0x38')]);return db[_0x2359('0x46')][_0x2359('0x17')]({'where':_0x4ec387['where']})[_0x2359('0x1d')](function(_0x54d8f4){_0x166026[_0x2359('0x17')]=_0x54d8f4;if(_0x20ccfb[_0x2359('0x28')][_0x2359('0x39')]){_0x4ec387[_0x2359('0x3a')]=[{'all':!![]}];}return db[_0x2359('0x46')][_0x2359('0x3b')](_0x4ec387);})['then'](function(_0x4adbb6){_0x166026[_0x2359('0x3c')]=_0x4adbb6;return _0x166026;});}})[_0x2359('0x1d')](respondWithFilteredResult(_0xb7812c,_0x4ec387))[_0x2359('0x42')](handleError(_0xb7812c,null));}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.model.js b/server/api/jscriptySessionReport/jscriptySessionReport.model.js index 81eb421..56573cf 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 _0xb4c7=['../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./jscriptySessionReport.attributes','define','report_jscripty_sessions','lodash','util'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0xb4c7,0x1ea));var _0x7b4c=function(_0x2bd133,_0x3c2beb){_0x2bd133=_0x2bd133-0x0;var _0x226c33=_0xb4c7[_0x2bd133];return _0x226c33;};'use strict';var _=require(_0x7b4c('0x0'));var util=require(_0x7b4c('0x1'));var logger=require(_0x7b4c('0x2'))(_0x7b4c('0x3'));var moment=require(_0x7b4c('0x4'));var BPromise=require('bluebird');var rp=require(_0x7b4c('0x5'));var fs=require('fs');var path=require(_0x7b4c('0x6'));var rimraf=require(_0x7b4c('0x7'));var config=require(_0x7b4c('0x8'));var attributes=require(_0x7b4c('0x9'));module['exports']=function(_0x1b0f57,_0x10e197){return _0x1b0f57[_0x7b4c('0xa')]('JscriptySessionReport',attributes,{'tableName':_0x7b4c('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5fc3=['lodash','util','api','moment','bluebird','request-promise','path','../../config/environment','./jscriptySessionReport.attributes','exports','define','report_jscripty_sessions'];(function(_0x3fb751,_0x24d4d5){var _0x43ec7b=function(_0x57944b){while(--_0x57944b){_0x3fb751['push'](_0x3fb751['shift']());}};_0x43ec7b(++_0x24d4d5);}(_0x5fc3,0xa8));var _0x35fc=function(_0x4bb145,_0x3e7d33){_0x4bb145=_0x4bb145-0x0;var _0x4db596=_0x5fc3[_0x4bb145];return _0x4db596;};'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')]('JscriptySessionReport',attributes,{'tableName':_0x35fc('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.rpc.js b/server/api/jscriptySessionReport/jscriptySessionReport.rpc.js index b69429c..9cbb378 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 _0x77e6=['client','request','then','info','request\x20sent','debug','JscriptySessionReport,\x20%s,\x20%s,\x20%s','stringify','error','code','JscriptySessionReport,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment'];(function(_0x314592,_0x2a0a5c){var _0x41316e=function(_0x46f74b){while(--_0x46f74b){_0x314592['push'](_0x314592['shift']());}};_0x41316e(++_0x2a0a5c);}(_0x77e6,0x1a6));var _0x677e=function(_0x5c4411,_0x3f4958){_0x5c4411=_0x5c4411-0x0;var _0x58bb60=_0x77e6[_0x5c4411];return _0x58bb60;};'use strict';var _=require(_0x677e('0x0'));var util=require(_0x677e('0x1'));var moment=require(_0x677e('0x2'));var BPromise=require(_0x677e('0x3'));var rs=require(_0x677e('0x4'));var fs=require('fs');var Redis=require(_0x677e('0x5'));var db=require(_0x677e('0x6'))['db'];var utils=require(_0x677e('0x7'));var logger=require('../../config/logger')(_0x677e('0x8'));var config=require(_0x677e('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x677e('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x40d314,_0x4d1a57,_0x5a5dd3){return new BPromise(function(_0x2eb40c,_0x4c519f){return client[_0x677e('0xb')](_0x40d314,_0x5a5dd3)[_0x677e('0xc')](function(_0x552931){logger[_0x677e('0xd')]('JscriptySessionReport,\x20%s,\x20%s',_0x4d1a57,_0x677e('0xe'));logger[_0x677e('0xf')](_0x677e('0x10'),_0x4d1a57,_0x677e('0xe'),JSON[_0x677e('0x11')](_0x552931));if(_0x552931[_0x677e('0x12')]){if(_0x552931[_0x677e('0x12')][_0x677e('0x13')]===0x1f4){logger[_0x677e('0x12')](_0x677e('0x14'),_0x4d1a57,_0x552931[_0x677e('0x12')][_0x677e('0x15')]);return _0x4c519f(_0x552931[_0x677e('0x12')][_0x677e('0x15')]);}logger['error']('JscriptySessionReport,\x20%s,\x20%s',_0x4d1a57,_0x552931['error'][_0x677e('0x15')]);return _0x2eb40c(_0x552931[_0x677e('0x12')][_0x677e('0x15')]);}else{logger[_0x677e('0xd')](_0x677e('0x14'),_0x4d1a57,_0x677e('0xe'));_0x2eb40c(_0x552931[_0x677e('0x16')][_0x677e('0x15')]);}})[_0x677e('0x17')](function(_0x32d306){logger[_0x677e('0x12')](_0x677e('0x14'),_0x4d1a57,_0x32d306);_0x4c519f(_0x32d306);});});} \ No newline at end of file +var _0xffd6=['ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','then','JscriptySessionReport,\x20%s,\x20%s','request\x20sent','debug','JscriptySessionReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','moment'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xffd6,0x97));var _0x6ffd=function(_0xbb9dbf,_0x5dafa4){_0xbb9dbf=_0xbb9dbf-0x0;var _0x30223c=_0xffd6[_0xbb9dbf];return _0x30223c;};'use strict';var _=require(_0x6ffd('0x0'));var util=require(_0x6ffd('0x1'));var moment=require(_0x6ffd('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6ffd('0x3'));var db=require(_0x6ffd('0x4'))['db'];var utils=require(_0x6ffd('0x5'));var logger=require('../../config/logger')(_0x6ffd('0x6'));var config=require(_0x6ffd('0x7'));var jayson=require(_0x6ffd('0x8'));var client=jayson[_0x6ffd('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x122b71,_0xeefe34,_0x2445a0){return new BPromise(function(_0x1fbbe6,_0x1d8b50){return client['request'](_0x122b71,_0x2445a0)[_0x6ffd('0xa')](function(_0x417f34){logger['info'](_0x6ffd('0xb'),_0xeefe34,_0x6ffd('0xc'));logger[_0x6ffd('0xd')](_0x6ffd('0xe'),_0xeefe34,_0x6ffd('0xc'),JSON[_0x6ffd('0xf')](_0x417f34));if(_0x417f34[_0x6ffd('0x10')]){if(_0x417f34['error'][_0x6ffd('0x11')]===0x1f4){logger[_0x6ffd('0x10')]('JscriptySessionReport,\x20%s,\x20%s',_0xeefe34,_0x417f34[_0x6ffd('0x10')][_0x6ffd('0x12')]);return _0x1d8b50(_0x417f34[_0x6ffd('0x10')][_0x6ffd('0x12')]);}logger['error'](_0x6ffd('0xb'),_0xeefe34,_0x417f34['error'][_0x6ffd('0x12')]);return _0x1fbbe6(_0x417f34['error'][_0x6ffd('0x12')]);}else{logger[_0x6ffd('0x13')](_0x6ffd('0xb'),_0xeefe34,'request\x20sent');_0x1fbbe6(_0x417f34[_0x6ffd('0x14')][_0x6ffd('0x12')]);}})[_0x6ffd('0x15')](function(_0x3394b2){logger[_0x6ffd('0x10')](_0x6ffd('0xb'),_0xeefe34,_0x3394b2);_0x1d8b50(_0x3394b2);});});} \ No newline at end of file diff --git a/server/api/license/index.js b/server/api/license/index.js index d0ad7eb..a37483a 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 _0xf864=['exports','multer','path','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','./license.controller','get','index','put','/:id','isAuthenticated'];(function(_0x281178,_0x33887e){var _0x1bfe18=function(_0x4cfd9f){while(--_0x4cfd9f){_0x281178['push'](_0x281178['shift']());}};_0x1bfe18(++_0x33887e);}(_0xf864,0x11f));var _0x4f86=function(_0x47b6ab,_0x3493af){_0x47b6ab=_0x47b6ab-0x0;var _0x56e02b=_0xf864[_0x47b6ab];return _0x56e02b;};'use strict';var multer=require(_0x4f86('0x0'));var util=require('util');var path=require(_0x4f86('0x1'));var timeout=require(_0x4f86('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x4f86('0x3'));var interaction=require(_0x4f86('0x4'));var config=require(_0x4f86('0x5'));var controller=require(_0x4f86('0x6'));router[_0x4f86('0x7')]('/',controller[_0x4f86('0x8')]);router[_0x4f86('0x9')](_0x4f86('0xa'),auth[_0x4f86('0xb')](),controller['update']);module[_0x4f86('0xc')]=router; \ No newline at end of file +var _0x36aa=['connect-timeout','express','Router','../../components/auth/service','get','index','isAuthenticated','update','multer','path'];(function(_0x448a7e,_0x25d4b1){var _0x460433=function(_0x33b12f){while(--_0x33b12f){_0x448a7e['push'](_0x448a7e['shift']());}};_0x460433(++_0x25d4b1);}(_0x36aa,0x170));var _0xa36a=function(_0x177989,_0x35ee74){_0x177989=_0x177989-0x0;var _0x4743d5=_0x36aa[_0x177989];return _0x4743d5;};'use strict';var multer=require(_0xa36a('0x0'));var util=require('util');var path=require(_0xa36a('0x1'));var timeout=require(_0xa36a('0x2'));var express=require(_0xa36a('0x3'));var router=express[_0xa36a('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xa36a('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./license.controller');router[_0xa36a('0x6')]('/',controller[_0xa36a('0x7')]);router['put']('/:id',auth[_0xa36a('0x8')](),controller[_0xa36a('0x9')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/license/license.attributes.js b/server/api/license/license.attributes.js index f684e05..1c81051 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 _0x78e6=['sequelize','exports','TEXT','STRING','INTEGER'];(function(_0x68d3bb,_0x25cb76){var _0x24b085=function(_0x308f3c){while(--_0x308f3c){_0x68d3bb['push'](_0x68d3bb['shift']());}};_0x24b085(++_0x25cb76);}(_0x78e6,0x154));var _0x678e=function(_0x476bf4,_0x2a3755){_0x476bf4=_0x476bf4-0x0;var _0x788ffe=_0x78e6[_0x476bf4];return _0x788ffe;};'use strict';var Sequelize=require(_0x678e('0x0'));module[_0x678e('0x1')]={'license':{'type':Sequelize[_0x678e('0x2')]},'data1':{'type':Sequelize[_0x678e('0x3')]},'data2':{'type':Sequelize['STRING']},'chatLicenseExceeded':{'type':Sequelize[_0x678e('0x4')],'defaultValue':0x0}}; \ No newline at end of file +var _0xa259=['STRING','INTEGER','sequelize','TEXT'];(function(_0x3a58d1,_0x3549e7){var _0x194557=function(_0x3288ae){while(--_0x3288ae){_0x3a58d1['push'](_0x3a58d1['shift']());}};_0x194557(++_0x3549e7);}(_0xa259,0x7a));var _0x9a25=function(_0x2d8d69,_0x8e47ff){_0x2d8d69=_0x2d8d69-0x0;var _0x39ae22=_0xa259[_0x2d8d69];return _0x39ae22;};'use strict';var Sequelize=require(_0x9a25('0x0'));module['exports']={'license':{'type':Sequelize[_0x9a25('0x1')]},'data1':{'type':Sequelize['STRING']},'data2':{'type':Sequelize[_0x9a25('0x2')]},'chatLicenseExceeded':{'type':Sequelize[_0x9a25('0x3')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/license/license.controller.js b/server/api/license/license.controller.js index 95342ad..e032ab5 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 _0x4975=['name','index','model','query','keys','intersection','fields','attributes','length','options','getLicense','catch','body','License','find','params','get','key','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','apply','save','update','then','destroy','error','stack'];(function(_0x292ab4,_0x1a26cb){var _0x3c1d92=function(_0xc23137){while(--_0xc23137){_0x292ab4['push'](_0x292ab4['shift']());}};_0x3c1d92(++_0x1a26cb);}(_0x4975,0x86));var _0x5497=function(_0x498fbb,_0x386eaf){_0x498fbb=_0x498fbb-0x0;var _0x796daa=_0x4975[_0x498fbb];return _0x796daa;};'use strict';var emlformat=require(_0x5497('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5497('0x1'));var jsonpatch=require(_0x5497('0x2'));var rp=require(_0x5497('0x3'));var moment=require(_0x5497('0x4'));var BPromise=require(_0x5497('0x5'));var Mustache=require(_0x5497('0x6'));var util=require(_0x5497('0x7'));var path=require(_0x5497('0x8'));var sox=require(_0x5497('0x9'));var csv=require(_0x5497('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5497('0xb'));var _=require('lodash');var squel=require(_0x5497('0xc'));var crypto=require(_0x5497('0xd'));var jsforce=require(_0x5497('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x5497('0xa'));var querystring=require('querystring');var Papa=require(_0x5497('0xf'));var Redis=require(_0x5497('0x10'));var authService=require(_0x5497('0x11'));var qs=require(_0x5497('0x12'));var as=require(_0x5497('0x13'));var hardwareService=require(_0x5497('0x14'));var logger=require(_0x5497('0x15'))(_0x5497('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x5497('0x17'))['db'];function respondWithStatusCode(_0x1b23df,_0x1bb794){_0x1bb794=_0x1bb794||0xcc;return function(_0x984990){if(_0x984990){return _0x1b23df[_0x5497('0x18')](_0x1bb794);}return _0x1b23df[_0x5497('0x19')](_0x1bb794)[_0x5497('0x1a')]();};}function respondWithResult(_0xaca97d,_0x363a5b){_0x363a5b=_0x363a5b||0xc8;return function(_0x1a4c74){if(_0x1a4c74){return _0xaca97d['status'](_0x363a5b)[_0x5497('0x1b')](_0x1a4c74);}};}function respondWithFilteredResult(_0x4fb8e9,_0x4237a9){return function(_0x2bfd8a){if(_0x2bfd8a){var _0x19e5f3=typeof _0x4237a9[_0x5497('0x1c')]===_0x5497('0x1d')&&typeof _0x4237a9[_0x5497('0x1e')]===_0x5497('0x1d');var _0x575f6b=_0x2bfd8a['count'];var _0x3f4d20=_0x19e5f3?0x0:_0x4237a9[_0x5497('0x1c')];var _0x3a47fd=_0x19e5f3?_0x2bfd8a['count']:_0x4237a9[_0x5497('0x1c')]+_0x4237a9[_0x5497('0x1e')];var _0x18e8a8;if(_0x3a47fd>=_0x575f6b){_0x3a47fd=_0x575f6b;_0x18e8a8=0xc8;}else{_0x18e8a8=0xce;}_0x4fb8e9[_0x5497('0x19')](_0x18e8a8);return _0x4fb8e9[_0x5497('0x1f')](_0x5497('0x20'),_0x3f4d20+'-'+_0x3a47fd+'/'+_0x575f6b)[_0x5497('0x1b')](_0x2bfd8a);}return null;};}function patchUpdates(_0x10226f){return function(_0x2e3960){try{jsonpatch[_0x5497('0x21')](_0x2e3960,_0x10226f,!![]);}catch(_0x186065){return BPromise['reject'](_0x186065);}return _0x2e3960[_0x5497('0x22')]();};}function saveUpdates(_0x4d1b27,_0x19200a){return function(_0xd0868d){if(_0xd0868d){return _0xd0868d[_0x5497('0x23')](_0x4d1b27)[_0x5497('0x24')](function(_0x35ecd9){return _0x35ecd9;});}return null;};}function removeEntity(_0x3b2fbc,_0x5018fa){return function(_0x54043a){if(_0x54043a){return _0x54043a[_0x5497('0x25')]()[_0x5497('0x24')](function(){_0x3b2fbc[_0x5497('0x19')](0xcc)[_0x5497('0x1a')]();});}};}function handleEntityNotFound(_0x5223b5,_0x13b7a4){return function(_0x57268c){if(!_0x57268c){_0x5223b5[_0x5497('0x18')](0x194);}return _0x57268c;};}function handleError(_0x16a2b4,_0x429d36){_0x429d36=_0x429d36||0x1f4;return function(_0x34a1a5){logger[_0x5497('0x26')](_0x34a1a5[_0x5497('0x27')]);if(_0x34a1a5['name']){delete _0x34a1a5[_0x5497('0x28')];}_0x16a2b4['status'](_0x429d36)['send'](_0x34a1a5);};}var utilLicense=require('../../config/license/util');exports[_0x5497('0x29')]=function(_0x48d146,_0x5e9356){var _0xc3465={'raw':!![],'where':{'id':0x1}},_0xb14593={};_0xb14593[_0x5497('0x2a')]=_['keys'](db['License']['rawAttributes']);_0xb14593[_0x5497('0x2b')]=_[_0x5497('0x2c')](_0x48d146[_0x5497('0x2b')]);_0xb14593['filters']=_['intersection'](_0xb14593['model'],_0xb14593[_0x5497('0x2b')]);_0xc3465['attributes']=_[_0x5497('0x2d')](_0xb14593[_0x5497('0x2a')],qs[_0x5497('0x2e')](_0x48d146['query'][_0x5497('0x2e')]));_0xc3465[_0x5497('0x2f')]=_0xc3465['attributes'][_0x5497('0x30')]?_0xc3465[_0x5497('0x2f')]:_0xb14593[_0x5497('0x2a')];_0xc3465=_['merge']({},_0xc3465,_0x48d146[_0x5497('0x31')]);return utilLicense[_0x5497('0x32')](_0xc3465)[_0x5497('0x24')](respondWithResult(_0x5e9356,null))[_0x5497('0x33')](handleError(_0x5e9356,null));};exports[_0x5497('0x23')]=function(_0x4a6459,_0x386845){if(_0x4a6459[_0x5497('0x34')]['id']){delete _0x4a6459['body']['id'];}return db[_0x5497('0x35')][_0x5497('0x36')]({'where':{'id':_0x4a6459[_0x5497('0x37')]['id']}})[_0x5497('0x24')](handleEntityNotFound(_0x386845,null))[_0x5497('0x24')](function(_0x37011c){var _0x580e86=_0x37011c[_0x5497('0x38')]({'plain':!![]});return utilLicense['checkLicense'](_0x580e86,_0x4a6459[_0x5497('0x34')][_0x5497('0x39')]);})[_0x5497('0x24')](function(_0x5ab18c){if(!_0x5ab18c['demo']){return saveUpdates(_0x4a6459[_0x5497('0x34')],null);}return _0x5ab18c;})[_0x5497('0x24')](respondWithResult(_0x386845,null))[_0x5497('0x33')](handleError(_0x386845,null));}; \ No newline at end of file +var _0x1967=['params','checkLicense','key','demo','catch','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','undefined','limit','count','set','apply','save','update','then','status','error','name','send','index','model','keys','rawAttributes','query','intersection','attributes','fields','merge','getLicense','body','find'];(function(_0x38218c,_0x2b5d63){var _0x30c637=function(_0x5270d5){while(--_0x5270d5){_0x38218c['push'](_0x38218c['shift']());}};_0x30c637(++_0x2b5d63);}(_0x1967,0x173));var _0x7196=function(_0xef7e0d,_0x103aab){_0xef7e0d=_0xef7e0d-0x0;var _0x2990b4=_0x1967[_0xef7e0d];return _0x2990b4;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7196('0x0'));var zipdir=require(_0x7196('0x1'));var jsonpatch=require(_0x7196('0x2'));var rp=require(_0x7196('0x3'));var moment=require(_0x7196('0x4'));var BPromise=require(_0x7196('0x5'));var Mustache=require(_0x7196('0x6'));var util=require(_0x7196('0x7'));var path=require(_0x7196('0x8'));var sox=require(_0x7196('0x9'));var csv=require('to-csv');var ejs=require(_0x7196('0xa'));var fs=require('fs');var fs_extra=require(_0x7196('0xb'));var _=require(_0x7196('0xc'));var squel=require(_0x7196('0xd'));var crypto=require(_0x7196('0xe'));var jsforce=require(_0x7196('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x7196('0x10'));var querystring=require(_0x7196('0x11'));var Papa=require(_0x7196('0x12'));var Redis=require(_0x7196('0x13'));var authService=require(_0x7196('0x14'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7196('0x15'));var logger=require(_0x7196('0x16'))(_0x7196('0x17'));var utils=require(_0x7196('0x18'));var config=require(_0x7196('0x19'));var licenseUtil=require(_0x7196('0x1a'));var db=require(_0x7196('0x1b'))['db'];function respondWithStatusCode(_0x325641,_0x24f1c3){_0x24f1c3=_0x24f1c3||0xcc;return function(_0xba707b){if(_0xba707b){return _0x325641[_0x7196('0x1c')](_0x24f1c3);}return _0x325641['status'](_0x24f1c3)[_0x7196('0x1d')]();};}function respondWithResult(_0x3feccd,_0x3545aa){_0x3545aa=_0x3545aa||0xc8;return function(_0xf098c1){if(_0xf098c1){return _0x3feccd['status'](_0x3545aa)[_0x7196('0x1e')](_0xf098c1);}};}function respondWithFilteredResult(_0x539414,_0xe32933){return function(_0x2590a6){if(_0x2590a6){var _0xf7e97=typeof _0xe32933[_0x7196('0x1f')]===_0x7196('0x20')&&typeof _0xe32933[_0x7196('0x21')]===_0x7196('0x20');var _0x1ed296=_0x2590a6[_0x7196('0x22')];var _0x32fe2b=_0xf7e97?0x0:_0xe32933[_0x7196('0x1f')];var _0x5b716a=_0xf7e97?_0x2590a6['count']:_0xe32933[_0x7196('0x1f')]+_0xe32933[_0x7196('0x21')];var _0x40418d;if(_0x5b716a>=_0x1ed296){_0x5b716a=_0x1ed296;_0x40418d=0xc8;}else{_0x40418d=0xce;}_0x539414['status'](_0x40418d);return _0x539414[_0x7196('0x23')]('Content-Range',_0x32fe2b+'-'+_0x5b716a+'/'+_0x1ed296)['json'](_0x2590a6);}return null;};}function patchUpdates(_0x296e07){return function(_0x627223){try{jsonpatch[_0x7196('0x24')](_0x627223,_0x296e07,!![]);}catch(_0x4ddf78){return BPromise['reject'](_0x4ddf78);}return _0x627223[_0x7196('0x25')]();};}function saveUpdates(_0x3cd8ff,_0x598a26){return function(_0x18649b){if(_0x18649b){return _0x18649b[_0x7196('0x26')](_0x3cd8ff)[_0x7196('0x27')](function(_0x18d389){return _0x18d389;});}return null;};}function removeEntity(_0x38b3d6,_0x549f34){return function(_0x3f8178){if(_0x3f8178){return _0x3f8178['destroy']()[_0x7196('0x27')](function(){_0x38b3d6[_0x7196('0x28')](0xcc)[_0x7196('0x1d')]();});}};}function handleEntityNotFound(_0xa69810,_0x70aa65){return function(_0x43f6a2){if(!_0x43f6a2){_0xa69810['sendStatus'](0x194);}return _0x43f6a2;};}function handleError(_0x57c404,_0x1482e5){_0x1482e5=_0x1482e5||0x1f4;return function(_0x2d284f){logger[_0x7196('0x29')](_0x2d284f['stack']);if(_0x2d284f['name']){delete _0x2d284f[_0x7196('0x2a')];}_0x57c404[_0x7196('0x28')](_0x1482e5)[_0x7196('0x2b')](_0x2d284f);};}var utilLicense=require('../../config/license/util');exports[_0x7196('0x2c')]=function(_0x4ecea1,_0x4fd339){var _0x59d79d={'raw':!![],'where':{'id':0x1}},_0x30151f={};_0x30151f[_0x7196('0x2d')]=_[_0x7196('0x2e')](db['License'][_0x7196('0x2f')]);_0x30151f[_0x7196('0x30')]=_[_0x7196('0x2e')](_0x4ecea1[_0x7196('0x30')]);_0x30151f['filters']=_[_0x7196('0x31')](_0x30151f[_0x7196('0x2d')],_0x30151f[_0x7196('0x30')]);_0x59d79d[_0x7196('0x32')]=_[_0x7196('0x31')](_0x30151f[_0x7196('0x2d')],qs[_0x7196('0x33')](_0x4ecea1[_0x7196('0x30')][_0x7196('0x33')]));_0x59d79d[_0x7196('0x32')]=_0x59d79d[_0x7196('0x32')]['length']?_0x59d79d[_0x7196('0x32')]:_0x30151f['model'];_0x59d79d=_[_0x7196('0x34')]({},_0x59d79d,_0x4ecea1['options']);return utilLicense[_0x7196('0x35')](_0x59d79d)[_0x7196('0x27')](respondWithResult(_0x4fd339,null))['catch'](handleError(_0x4fd339,null));};exports[_0x7196('0x26')]=function(_0x2bcadd,_0x4531d7){if(_0x2bcadd[_0x7196('0x36')]['id']){delete _0x2bcadd[_0x7196('0x36')]['id'];}return db['License'][_0x7196('0x37')]({'where':{'id':_0x2bcadd[_0x7196('0x38')]['id']}})[_0x7196('0x27')](handleEntityNotFound(_0x4531d7,null))[_0x7196('0x27')](function(_0x3e8f98){var _0x123cad=_0x3e8f98['get']({'plain':!![]});return utilLicense[_0x7196('0x39')](_0x123cad,_0x2bcadd[_0x7196('0x36')][_0x7196('0x3a')]);})['then'](function(_0x33831a){if(!_0x33831a[_0x7196('0x3b')]){return saveUpdates(_0x2bcadd[_0x7196('0x36')],null);}return _0x33831a;})[_0x7196('0x27')](respondWithResult(_0x4531d7,null))[_0x7196('0x3c')](handleError(_0x4531d7,null));}; \ No newline at end of file diff --git a/server/api/license/license.model.js b/server/api/license/license.model.js index b899dca..e04c6b3 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 _0x6ba6=['exports','define','license','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./license.attributes'];(function(_0x2e8418,_0x58c529){var _0x548fe6=function(_0x2b2877){while(--_0x2b2877){_0x2e8418['push'](_0x2e8418['shift']());}};_0x548fe6(++_0x58c529);}(_0x6ba6,0xc7));var _0x66ba=function(_0x2c0c1d,_0x2f60f1){_0x2c0c1d=_0x2c0c1d-0x0;var _0x5bba26=_0x6ba6[_0x2c0c1d];return _0x5bba26;};'use strict';var _=require(_0x66ba('0x0'));var util=require(_0x66ba('0x1'));var logger=require(_0x66ba('0x2'))(_0x66ba('0x3'));var moment=require(_0x66ba('0x4'));var BPromise=require(_0x66ba('0x5'));var rp=require(_0x66ba('0x6'));var fs=require('fs');var path=require(_0x66ba('0x7'));var rimraf=require(_0x66ba('0x8'));var config=require(_0x66ba('0x9'));var attributes=require(_0x66ba('0xa'));module[_0x66ba('0xb')]=function(_0x4632b9,_0xf74fce){return _0x4632b9[_0x66ba('0xc')]('License',attributes,{'tableName':_0x66ba('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x592d=['path','../../config/environment','define','License','license','lodash','util','api','bluebird'];(function(_0x16535f,_0x556d4f){var _0xfc40f7=function(_0x83768){while(--_0x83768){_0x16535f['push'](_0x16535f['shift']());}};_0xfc40f7(++_0x556d4f);}(_0x592d,0x15b));var _0xd592=function(_0x3faf51,_0x4535f3){_0x3faf51=_0x3faf51-0x0;var _0x4685b7=_0x592d[_0x3faf51];return _0x4685b7;};'use strict';var _=require(_0xd592('0x0'));var util=require(_0xd592('0x1'));var logger=require('../../config/logger')(_0xd592('0x2'));var moment=require('moment');var BPromise=require(_0xd592('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd592('0x4'));var rimraf=require('rimraf');var config=require(_0xd592('0x5'));var attributes=require('./license.attributes');module['exports']=function(_0x1682ca,_0x4d6d43){return _0x1682ca[_0xd592('0x6')](_0xd592('0x7'),attributes,{'tableName':_0xd592('0x8'),'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 5062fc0..e847f57 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 _0x6578=['client','request','then','License,\x20%s,\x20%s','debug','License,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/logger','../../config/environment'];(function(_0x2f6233,_0x90172){var _0x1c9c36=function(_0x3ac680){while(--_0x3ac680){_0x2f6233['push'](_0x2f6233['shift']());}};_0x1c9c36(++_0x90172);}(_0x6578,0xa4));var _0x8657=function(_0x5ac987,_0x3dd0a4){_0x5ac987=_0x5ac987-0x0;var _0x1b694b=_0x6578[_0x5ac987];return _0x1b694b;};'use strict';var _=require(_0x8657('0x0'));var util=require('util');var moment=require(_0x8657('0x1'));var BPromise=require(_0x8657('0x2'));var rs=require(_0x8657('0x3'));var fs=require('fs');var Redis=require(_0x8657('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x8657('0x5'))('rpc');var config=require(_0x8657('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x8657('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4c2790,_0x205404,_0x48f014){return new BPromise(function(_0x5ed852,_0x72a99f){return client[_0x8657('0x8')](_0x4c2790,_0x48f014)[_0x8657('0x9')](function(_0xc56d05){logger['info'](_0x8657('0xa'),_0x205404,'request\x20sent');logger[_0x8657('0xb')](_0x8657('0xc'),_0x205404,'request\x20sent',JSON[_0x8657('0xd')](_0xc56d05));if(_0xc56d05[_0x8657('0xe')]){if(_0xc56d05['error'][_0x8657('0xf')]===0x1f4){logger['error'](_0x8657('0xa'),_0x205404,_0xc56d05[_0x8657('0xe')]['message']);return _0x72a99f(_0xc56d05[_0x8657('0xe')][_0x8657('0x10')]);}logger[_0x8657('0xe')](_0x8657('0xa'),_0x205404,_0xc56d05['error'][_0x8657('0x10')]);return _0x5ed852(_0xc56d05[_0x8657('0xe')][_0x8657('0x10')]);}else{logger[_0x8657('0x11')]('License,\x20%s,\x20%s',_0x205404,'request\x20sent');_0x5ed852(_0xc56d05['result'][_0x8657('0x10')]);}})[_0x8657('0x12')](function(_0x5e83e6){logger[_0x8657('0xe')](_0x8657('0xa'),_0x205404,_0x5e83e6);_0x72a99f(_0x5e83e6);});});} \ No newline at end of file +var _0xf0cd=['message','util','bluebird','randomstring','../../config/logger','rpc','jayson/promise','http','request','then','info','License,\x20%s,\x20%s','request\x20sent','debug','License,\x20%s,\x20%s,\x20%s','stringify','code','error'];(function(_0x2b1422,_0xde2c64){var _0x344875=function(_0x24de77){while(--_0x24de77){_0x2b1422['push'](_0x2b1422['shift']());}};_0x344875(++_0xde2c64);}(_0xf0cd,0xa3));var _0xdf0c=function(_0xe193e9,_0x306f7d){_0xe193e9=_0xe193e9-0x0;var _0xb40ab7=_0xf0cd[_0xe193e9];return _0xb40ab7;};'use strict';var _=require('lodash');var util=require(_0xdf0c('0x0'));var moment=require('moment');var BPromise=require(_0xdf0c('0x1'));var rs=require(_0xdf0c('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xdf0c('0x3'))(_0xdf0c('0x4'));var config=require('../../config/environment');var jayson=require(_0xdf0c('0x5'));var client=jayson['client'][_0xdf0c('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x4383a7,_0xa50096,_0x21a018){return new BPromise(function(_0xadde9,_0x4ac5c3){return client[_0xdf0c('0x7')](_0x4383a7,_0x21a018)[_0xdf0c('0x8')](function(_0x16b435){logger[_0xdf0c('0x9')](_0xdf0c('0xa'),_0xa50096,_0xdf0c('0xb'));logger[_0xdf0c('0xc')](_0xdf0c('0xd'),_0xa50096,_0xdf0c('0xb'),JSON[_0xdf0c('0xe')](_0x16b435));if(_0x16b435['error']){if(_0x16b435['error'][_0xdf0c('0xf')]===0x1f4){logger[_0xdf0c('0x10')](_0xdf0c('0xa'),_0xa50096,_0x16b435[_0xdf0c('0x10')][_0xdf0c('0x11')]);return _0x4ac5c3(_0x16b435['error'][_0xdf0c('0x11')]);}logger[_0xdf0c('0x10')](_0xdf0c('0xa'),_0xa50096,_0x16b435[_0xdf0c('0x10')]['message']);return _0xadde9(_0x16b435[_0xdf0c('0x10')]['message']);}else{logger[_0xdf0c('0x9')](_0xdf0c('0xa'),_0xa50096,_0xdf0c('0xb'));_0xadde9(_0x16b435['result'][_0xdf0c('0x11')]);}})['catch'](function(_0x892e33){logger[_0xdf0c('0x10')](_0xdf0c('0xa'),_0xa50096,_0x892e33);_0x4ac5c3(_0x892e33);});});} \ No newline at end of file diff --git a/server/api/mailAccount/index.js b/server/api/mailAccount/index.js index 5603d73..8d7e23c 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 _0xf4f0=['/:id/interactions','getInteractions','/:id/applications','getApplications','/:id/messages','getMessages','/:id/verify','verifySmtp','/:id/users','post','/:id/dispositions','addDisposition','/:id/canned_answers','create','addImap','addSmtp','addInteraction','addApplications','/:id/send','addAgents','put','delete','removeDispositions','removeAnswers','removeImap','removeSmtp','removeAgents','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailAccount.controller','get','isAuthenticated','index','describe','/:id','getDispositions','/:id/in_servers','getImap','/:id/out_servers','getSmtp'];(function(_0x3d8dd8,_0x4dee79){var _0x1955ad=function(_0x3e493b){while(--_0x3e493b){_0x3d8dd8['push'](_0x3d8dd8['shift']());}};_0x1955ad(++_0x4dee79);}(_0xf4f0,0x18b));var _0x0f4f=function(_0x99f811,_0x44d59e){_0x99f811=_0x99f811-0x0;var _0x37ba7f=_0xf4f0[_0x99f811];return _0x37ba7f;};'use strict';var multer=require(_0x0f4f('0x0'));var util=require(_0x0f4f('0x1'));var path=require('path');var timeout=require(_0x0f4f('0x2'));var express=require(_0x0f4f('0x3'));var router=express[_0x0f4f('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x0f4f('0x5'));var interaction=require(_0x0f4f('0x6'));var config=require(_0x0f4f('0x7'));var controller=require(_0x0f4f('0x8'));router[_0x0f4f('0x9')]('/',auth[_0x0f4f('0xa')](),controller[_0x0f4f('0xb')]);router[_0x0f4f('0x9')]('/describe',auth[_0x0f4f('0xa')](),controller[_0x0f4f('0xc')]);router['get'](_0x0f4f('0xd'),auth['isAuthenticated'](),controller['show']);router[_0x0f4f('0x9')]('/:id/dispositions',auth[_0x0f4f('0xa')](),controller[_0x0f4f('0xe')]);router[_0x0f4f('0x9')]('/:id/canned_answers',auth['isAuthenticated'](),controller['getAnswers']);router[_0x0f4f('0x9')](_0x0f4f('0xf'),auth[_0x0f4f('0xa')](),controller[_0x0f4f('0x10')]);router['get'](_0x0f4f('0x11'),auth['isAuthenticated'](),controller[_0x0f4f('0x12')]);router[_0x0f4f('0x9')](_0x0f4f('0x13'),auth['isAuthenticated'](),controller[_0x0f4f('0x14')]);router[_0x0f4f('0x9')](_0x0f4f('0x15'),auth[_0x0f4f('0xa')](),controller[_0x0f4f('0x16')]);router[_0x0f4f('0x9')](_0x0f4f('0x17'),auth[_0x0f4f('0xa')](),controller[_0x0f4f('0x18')]);router[_0x0f4f('0x9')](_0x0f4f('0x19'),auth[_0x0f4f('0xa')](),controller[_0x0f4f('0x1a')]);router[_0x0f4f('0x9')](_0x0f4f('0x1b'),auth[_0x0f4f('0xa')](),controller['getAgents']);router[_0x0f4f('0x1c')](_0x0f4f('0x1d'),auth[_0x0f4f('0xa')](),controller[_0x0f4f('0x1e')]);router['post'](_0x0f4f('0x1f'),auth[_0x0f4f('0xa')](),controller['addAnswer']);router[_0x0f4f('0x1c')]('/',auth[_0x0f4f('0xa')](),controller[_0x0f4f('0x20')]);router[_0x0f4f('0x1c')]('/:id/in_servers',auth['isAuthenticated'](),controller[_0x0f4f('0x21')]);router[_0x0f4f('0x1c')](_0x0f4f('0x11'),auth['isAuthenticated'](),controller[_0x0f4f('0x22')]);router[_0x0f4f('0x1c')](_0x0f4f('0x13'),auth[_0x0f4f('0xa')](),controller[_0x0f4f('0x23')]);router[_0x0f4f('0x1c')](_0x0f4f('0x15'),auth[_0x0f4f('0xa')](),controller[_0x0f4f('0x24')]);router[_0x0f4f('0x1c')](_0x0f4f('0x25'),auth['isAuthenticated'](),controller['send']);router[_0x0f4f('0x1c')](_0x0f4f('0x1b'),auth['isAuthenticated'](),controller[_0x0f4f('0x26')]);router[_0x0f4f('0x27')](_0x0f4f('0xd'),auth['isAuthenticated'](),controller['update']);router[_0x0f4f('0x28')](_0x0f4f('0x1d'),auth[_0x0f4f('0xa')](),controller[_0x0f4f('0x29')]);router[_0x0f4f('0x28')](_0x0f4f('0x1f'),auth[_0x0f4f('0xa')](),controller[_0x0f4f('0x2a')]);router[_0x0f4f('0x28')](_0x0f4f('0xf'),auth[_0x0f4f('0xa')](),controller[_0x0f4f('0x2b')]);router[_0x0f4f('0x28')](_0x0f4f('0x11'),auth['isAuthenticated'](),controller[_0x0f4f('0x2c')]);router[_0x0f4f('0x28')]('/:id',auth[_0x0f4f('0xa')](),controller['destroy']);router['delete'](_0x0f4f('0x1b'),auth[_0x0f4f('0xa')](),controller[_0x0f4f('0x2d')]);module['exports']=router; \ No newline at end of file +var _0xe439=['/:id/interactions','getInteractions','getApplications','/:id/messages','/:id/verify','/:id/users','getAgents','post','addAnswer','create','addImap','addInteraction','/:id/applications','addApplications','/:id/send','send','addAgents','/:id','update','delete','removeDispositions','removeSmtp','destroy','removeAgents','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','get','isAuthenticated','index','/describe','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/in_servers','getImap','/:id/out_servers','getSmtp'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0xe439,0xf9));var _0x9e43=function(_0x1a5d33,_0x267ee4){_0x1a5d33=_0x1a5d33-0x0;var _0x497e37=_0xe439[_0x1a5d33];return _0x497e37;};'use strict';var multer=require(_0x9e43('0x0'));var util=require(_0x9e43('0x1'));var path=require(_0x9e43('0x2'));var timeout=require(_0x9e43('0x3'));var express=require(_0x9e43('0x4'));var router=express[_0x9e43('0x5')]();var fs_extra=require(_0x9e43('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x9e43('0x7'));var config=require('../../config/environment');var controller=require('./mailAccount.controller');router[_0x9e43('0x8')]('/',auth[_0x9e43('0x9')](),controller[_0x9e43('0xa')]);router[_0x9e43('0x8')](_0x9e43('0xb'),auth[_0x9e43('0x9')](),controller['describe']);router['get']('/:id',auth[_0x9e43('0x9')](),controller[_0x9e43('0xc')]);router[_0x9e43('0x8')](_0x9e43('0xd'),auth[_0x9e43('0x9')](),controller[_0x9e43('0xe')]);router[_0x9e43('0x8')](_0x9e43('0xf'),auth['isAuthenticated'](),controller[_0x9e43('0x10')]);router[_0x9e43('0x8')](_0x9e43('0x11'),auth[_0x9e43('0x9')](),controller[_0x9e43('0x12')]);router['get'](_0x9e43('0x13'),auth[_0x9e43('0x9')](),controller[_0x9e43('0x14')]);router[_0x9e43('0x8')](_0x9e43('0x15'),auth[_0x9e43('0x9')](),controller[_0x9e43('0x16')]);router[_0x9e43('0x8')]('/:id/applications',auth[_0x9e43('0x9')](),controller[_0x9e43('0x17')]);router[_0x9e43('0x8')](_0x9e43('0x18'),auth[_0x9e43('0x9')](),controller['getMessages']);router[_0x9e43('0x8')](_0x9e43('0x19'),auth[_0x9e43('0x9')](),controller['verifySmtp']);router[_0x9e43('0x8')](_0x9e43('0x1a'),auth[_0x9e43('0x9')](),controller[_0x9e43('0x1b')]);router[_0x9e43('0x1c')](_0x9e43('0xd'),auth[_0x9e43('0x9')](),controller['addDisposition']);router[_0x9e43('0x1c')](_0x9e43('0xf'),auth[_0x9e43('0x9')](),controller[_0x9e43('0x1d')]);router[_0x9e43('0x1c')]('/',auth[_0x9e43('0x9')](),controller[_0x9e43('0x1e')]);router[_0x9e43('0x1c')](_0x9e43('0x11'),auth['isAuthenticated'](),controller[_0x9e43('0x1f')]);router[_0x9e43('0x1c')]('/:id/out_servers',auth['isAuthenticated'](),controller['addSmtp']);router[_0x9e43('0x1c')](_0x9e43('0x15'),auth['isAuthenticated'](),controller[_0x9e43('0x20')]);router[_0x9e43('0x1c')](_0x9e43('0x21'),auth['isAuthenticated'](),controller[_0x9e43('0x22')]);router[_0x9e43('0x1c')](_0x9e43('0x23'),auth[_0x9e43('0x9')](),controller[_0x9e43('0x24')]);router['post'](_0x9e43('0x1a'),auth['isAuthenticated'](),controller[_0x9e43('0x25')]);router['put'](_0x9e43('0x26'),auth['isAuthenticated'](),controller[_0x9e43('0x27')]);router[_0x9e43('0x28')](_0x9e43('0xd'),auth['isAuthenticated'](),controller[_0x9e43('0x29')]);router[_0x9e43('0x28')](_0x9e43('0xf'),auth['isAuthenticated'](),controller['removeAnswers']);router[_0x9e43('0x28')]('/:id/in_servers',auth['isAuthenticated'](),controller['removeImap']);router[_0x9e43('0x28')](_0x9e43('0x13'),auth[_0x9e43('0x9')](),controller[_0x9e43('0x2a')]);router[_0x9e43('0x28')](_0x9e43('0x26'),auth['isAuthenticated'](),controller[_0x9e43('0x2b')]);router[_0x9e43('0x28')]('/:id/users',auth['isAuthenticated'](),controller[_0x9e43('0x2c')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.attributes.js b/server/api/mailAccount/mailAccount.attributes.js index 9175705..482234b 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 _0xf2ca=['STRING','BOOLEAN','TEXT','Arial,Helvetica,sans-serif','INTEGER','UNSIGNED','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','setDataValue','mandatoryDisposition','sequelize','exports'];(function(_0x4b1146,_0x5916c5){var _0xaab333=function(_0xf79d62){while(--_0xf79d62){_0x4b1146['push'](_0x4b1146['shift']());}};_0xaab333(++_0x5916c5);}(_0xf2ca,0x16a));var _0xaf2c=function(_0xd2e2ab,_0x2440cf){_0xd2e2ab=_0xd2e2ab-0x0;var _0x1703a2=_0xf2ca[_0xd2e2ab];return _0x1703a2;};'use strict';var Sequelize=require(_0xaf2c('0x0'));module[_0xaf2c('0x1')]={'description':{'type':Sequelize[_0xaf2c('0x2')]},'name':{'type':Sequelize['STRING'],'allowNull':![]},'service':{'type':Sequelize[_0xaf2c('0x3')],'defaultValue':![]},'email':{'type':Sequelize[_0xaf2c('0x2')],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0xaf2c('0x3')],'defaultValue':!![]},'key':{'type':Sequelize[_0xaf2c('0x2')],'allowNull':![]},'template':{'type':Sequelize[_0xaf2c('0x4')]},'markAsUnread':{'type':Sequelize[_0xaf2c('0x3')],'defaultValue':![]},'fontFamily':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xaf2c('0x5')},'fontSize':{'type':Sequelize[_0xaf2c('0x6')](0x2)[_0xaf2c('0x7')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0xaf2c('0x4')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}
Subject\x20:\x20{{message.subject}}';}},'notificationSound':{'type':Sequelize[_0xaf2c('0x3')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xaf2c('0x3')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xaf2c('0x3')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xaf2c('0x3')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xaf2c('0x6')],'allowNull':!![],'defaultValue':null,'comment':_0xaf2c('0x8')},'mandatoryDisposition':{'type':Sequelize[_0xaf2c('0x3')],'defaultValue':![],'comment':_0xaf2c('0x9'),'set':function(_0x5ad9b0){if(!_0x5ad9b0)this['setDataValue'](_0xaf2c('0xa'),null);this[_0xaf2c('0xb')](_0xaf2c('0xc'),_0x5ad9b0);}}}; \ No newline at end of file +var _0x495e=['BOOLEAN','TEXT','Arial,Helvetica,sans-serif','INTEGER','UNSIGNED','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDisposition','sequelize','STRING'];(function(_0x39c734,_0x2f3e06){var _0xb2a2f9=function(_0x502f3f){while(--_0x502f3f){_0x39c734['push'](_0x39c734['shift']());}};_0xb2a2f9(++_0x2f3e06);}(_0x495e,0xfb));var _0xe495=function(_0x4c06a3,_0x1e6b6f){_0x4c06a3=_0x4c06a3-0x0;var _0x7ff53c=_0x495e[_0x4c06a3];return _0x7ff53c;};'use strict';var Sequelize=require(_0xe495('0x0'));module['exports']={'description':{'type':Sequelize['STRING']},'name':{'type':Sequelize[_0xe495('0x1')],'allowNull':![]},'service':{'type':Sequelize[_0xe495('0x2')],'defaultValue':![]},'email':{'type':Sequelize[_0xe495('0x1')],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0xe495('0x2')],'defaultValue':!![]},'key':{'type':Sequelize['STRING'],'allowNull':![]},'template':{'type':Sequelize[_0xe495('0x3')]},'markAsUnread':{'type':Sequelize[_0xe495('0x2')],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0xe495('0x1')],'allowNull':![],'defaultValue':_0xe495('0x4')},'fontSize':{'type':Sequelize[_0xe495('0x5')](0x2)[_0xe495('0x6')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0xe495('0x3')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}
Subject\x20:\x20{{message.subject}}';}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xe495('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xe495('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xe495('0x2')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xe495('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xe495('0x5')],'allowNull':!![],'defaultValue':null,'comment':_0xe495('0x7')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0xe495('0x8'),'set':function(_0x4047e8){if(!_0x4047e8)this[_0xe495('0x9')]('mandatoryDispositionPauseId',null);this[_0xe495('0x9')](_0xe495('0xa'),_0x4047e8);}}}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.controller.js b/server/api/mailAccount/mailAccount.controller.js index a63c7c1..c0505ba 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 _0x2fc8=['Content-Range','apply','reject','save','update','destroy','get','end','sendStatus','stack','name','Imap','MailServerOut','Smtp','Pause','mandatoryDispositionPause','map','MailAccount','rawAttributes','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','offset','sort','pick','filter','where','merge','options','includeAll','findAll','rows','params','MailServerIn','include','body','find','describe','addDisposition','MailAccountId','create','getDispositions','findOne','Disposition','nolimit','order','removeDispositions','ids','CannedAnswer','removeAnswers','active','description','cservice','user','cuser','password','pass','cpassword','authentication','host','port','service','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','MailAccounts','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getImap','addImap','getSmtp','removeSmtp','setSmtp','addInteraction','MailInteraction','omit','getInteractions','CmContact','Owner','fullname','Tags','tag','addApplications','transaction','sequelize','Transaction','ISOLATION_LEVELS','READ_COMMITTED','MailApplication','bulkCreate','findAndCountAll','send','getApplications','getMessages','MailMessage','$gte','split','YYYY-MM-DD\x20HH:mm:ss','inlineCss','CmList','List','DESC','isNil','from','format','%s\x20<%s>','email','attachments','root','server/files/attachments','auth','secure','sendMail','List\x20not\x20found','Contacts','messageId','subject','attach','out','Interaction','Messages','verifySmtp','VerifySmtp','Sequelize','ValidationError','You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account','addAgents','emit','userMailAccount:save','isArray','userMailAccount:remove','getAgents','User','rimraf','zip-dir','fast-json-patch','request-promise','moment','path','sox','ejs','lodash','squel','crypto','jsforce','to-csv','html-to-text','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./mailAccount.socket','register','jayson/promise','client','request','then','MailAccount,\x20%s,\x20%s','debug','MailAccount,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','info','result','catch','status','json','undefined','count','limit','set'];(function(_0x4e6ae6,_0x49dba6){var _0x23c108=function(_0x1bc103){while(--_0x1bc103){_0x4e6ae6['push'](_0x4e6ae6['shift']());}};_0x23c108(++_0x49dba6);}(_0x2fc8,0x14a));var _0x82fc=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x2fc8[_0x3bf83f];return _0x22c4a9;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x82fc('0x0'));var zipdir=require(_0x82fc('0x1'));var jsonpatch=require(_0x82fc('0x2'));var rp=require(_0x82fc('0x3'));var moment=require(_0x82fc('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x82fc('0x5'));var sox=require(_0x82fc('0x6'));var csv=require('to-csv');var ejs=require(_0x82fc('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x82fc('0x8'));var squel=require(_0x82fc('0x9'));var crypto=require(_0x82fc('0xa'));var jsforce=require(_0x82fc('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x82fc('0xc'));var querystring=require('querystring');var Papa=require('papaparse');var htmlToText=require(_0x82fc('0xd'));var juice=require('juice');var Redis=require(_0x82fc('0xe'));var authService=require(_0x82fc('0xf'));var qs=require(_0x82fc('0x10'));var as=require(_0x82fc('0x11'));var hardwareService=require(_0x82fc('0x12'));var logger=require('../../config/logger')(_0x82fc('0x13'));var utils=require(_0x82fc('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x82fc('0x15'));var db=require(_0x82fc('0x16'))['db'];config[_0x82fc('0x17')]=_[_0x82fc('0x18')](config['redis'],{'host':_0x82fc('0x19'),'port':0x18eb});var socket=require(_0x82fc('0x1a'))(new Redis(config[_0x82fc('0x17')]));require(_0x82fc('0x1b'))[_0x82fc('0x1c')](socket);var jayson=require(_0x82fc('0x1d'));var client=jayson[_0x82fc('0x1e')]['http']({'port':0x232b});function respondWithRpcPromise(_0x2fe11d,_0xf80411,_0x422bac,_0x28b3fb){return new BPromise(function(_0x3c3444,_0x3969a3){var _0x448552=_0x28b3fb||client;return _0x448552[_0x82fc('0x1f')](_0x2fe11d,_0x422bac)[_0x82fc('0x20')](function(_0x4772d7){logger['info'](_0x82fc('0x21'),_0xf80411,'request\x20sent');logger[_0x82fc('0x22')](_0x82fc('0x23'),_0xf80411,_0x82fc('0x24'),JSON['stringify'](_0x4772d7));if(_0x4772d7[_0x82fc('0x25')]){if(_0x4772d7['error']['code']===0x1f4){logger[_0x82fc('0x25')](_0x82fc('0x21'),_0xf80411,_0x4772d7[_0x82fc('0x25')][_0x82fc('0x26')]);return _0x3969a3(_0x4772d7[_0x82fc('0x25')][_0x82fc('0x26')]);}logger[_0x82fc('0x25')]('MailAccount,\x20%s,\x20%s',_0xf80411,_0x4772d7['error'][_0x82fc('0x26')]);return _0x3c3444(_0x4772d7[_0x82fc('0x25')][_0x82fc('0x26')]);}else{logger[_0x82fc('0x27')]('MailAccount,\x20%s,\x20%s',_0xf80411,_0x82fc('0x24'));_0x3c3444(_0x4772d7[_0x82fc('0x28')]['message']);}})[_0x82fc('0x29')](function(_0x254092){logger[_0x82fc('0x25')]('MailAccount,\x20%s,\x20%s',_0xf80411,_0x254092);_0x3969a3(_0x254092);});});}function respondWithStatusCode(_0x5d11b8,_0x460cf9){_0x460cf9=_0x460cf9||0xcc;return function(_0x390273){if(_0x390273){return _0x5d11b8['sendStatus'](_0x460cf9);}return _0x5d11b8[_0x82fc('0x2a')](_0x460cf9)['end']();};}function respondWithResult(_0x1b37ec,_0x403c8c){_0x403c8c=_0x403c8c||0xc8;return function(_0x522622){if(_0x522622){return _0x1b37ec['status'](_0x403c8c)[_0x82fc('0x2b')](_0x522622);}};}function respondWithFilteredResult(_0x7a9a6a,_0xbd61ce){return function(_0x2c44e7){if(_0x2c44e7){var _0x5b0d61=typeof _0xbd61ce['offset']===_0x82fc('0x2c')&&typeof _0xbd61ce['limit']===_0x82fc('0x2c');var _0x32bb6f=_0x2c44e7[_0x82fc('0x2d')];var _0x526236=_0x5b0d61?0x0:_0xbd61ce['offset'];var _0x14d96e=_0x5b0d61?_0x2c44e7['count']:_0xbd61ce['offset']+_0xbd61ce[_0x82fc('0x2e')];var _0x132aa9;if(_0x14d96e>=_0x32bb6f){_0x14d96e=_0x32bb6f;_0x132aa9=0xc8;}else{_0x132aa9=0xce;}_0x7a9a6a[_0x82fc('0x2a')](_0x132aa9);return _0x7a9a6a[_0x82fc('0x2f')](_0x82fc('0x30'),_0x526236+'-'+_0x14d96e+'/'+_0x32bb6f)['json'](_0x2c44e7);}return null;};}function patchUpdates(_0x5a6208){return function(_0x4aeeca){try{jsonpatch[_0x82fc('0x31')](_0x4aeeca,_0x5a6208,!![]);}catch(_0x2a21e3){return BPromise[_0x82fc('0x32')](_0x2a21e3);}return _0x4aeeca[_0x82fc('0x33')]();};}function saveUpdates(_0x48f9c4,_0x4543a8){return function(_0x491b2a){if(_0x491b2a){return _0x491b2a[_0x82fc('0x34')](_0x48f9c4)['then'](function(_0x5bd509){return _0x5bd509;});}return null;};}function removeEntity(_0x4cd235,_0x51b763){return function(_0x167283){if(_0x167283){return _0x167283[_0x82fc('0x35')]()[_0x82fc('0x20')](function(){var _0x208cb6=_0x167283[_0x82fc('0x36')]({'plain':!![]});var _0x5863ae='MailAccounts';return db['UserProfileResource'][_0x82fc('0x35')]({'where':{'type':_0x5863ae,'resourceId':_0x208cb6['id']}})[_0x82fc('0x20')](function(){return _0x167283;});})[_0x82fc('0x20')](function(){_0x4cd235[_0x82fc('0x2a')](0xcc)[_0x82fc('0x37')]();});}};}function handleEntityNotFound(_0x118b2e,_0x4c9eca){return function(_0x183afd){if(!_0x183afd){_0x118b2e[_0x82fc('0x38')](0x194);}return _0x183afd;};}function handleError(_0x2455da,_0x480bd2){_0x480bd2=_0x480bd2||0x1f4;return function(_0x22bd14){logger[_0x82fc('0x25')](_0x22bd14[_0x82fc('0x39')]);if(_0x22bd14[_0x82fc('0x3a')]){delete _0x22bd14[_0x82fc('0x3a')];}_0x2455da['status'](_0x480bd2)['send'](_0x22bd14);};}exports['index']=function(_0x39defb,_0x5e7073){var _0x980ce8={'include':[{'model':db['MailServerIn'],'as':_0x82fc('0x3b')},{'model':db[_0x82fc('0x3c')],'as':_0x82fc('0x3d')},{'model':db[_0x82fc('0x3e')],'as':_0x82fc('0x3f')}]},_0x59a6c2={},_0x54dced={'count':0x0,'rows':[]};var _0x59f1f4=_[_0x82fc('0x40')](db[_0x82fc('0x41')][_0x82fc('0x42')],function(_0x3ac8d4){return{'name':_0x3ac8d4['fieldName'],'type':_0x3ac8d4['type'][_0x82fc('0x43')]};});_0x59a6c2[_0x82fc('0x44')]=_[_0x82fc('0x40')](_0x59f1f4,'name');_0x59a6c2[_0x82fc('0x45')]=_[_0x82fc('0x46')](_0x39defb[_0x82fc('0x45')]);_0x59a6c2[_0x82fc('0x47')]=_['intersection'](_0x59a6c2['model'],_0x59a6c2['query']);_0x980ce8[_0x82fc('0x48')]=_[_0x82fc('0x49')](_0x59a6c2['model'],qs[_0x82fc('0x4a')](_0x39defb[_0x82fc('0x45')]['fields']));_0x980ce8[_0x82fc('0x48')]=_0x980ce8['attributes'][_0x82fc('0x4b')]?_0x980ce8[_0x82fc('0x48')]:_0x59a6c2['model'];if(!_0x39defb[_0x82fc('0x45')][_0x82fc('0x4c')]('nolimit')){_0x980ce8['limit']=qs[_0x82fc('0x2e')](_0x39defb[_0x82fc('0x45')][_0x82fc('0x2e')]);_0x980ce8[_0x82fc('0x4d')]=qs[_0x82fc('0x4d')](_0x39defb[_0x82fc('0x45')][_0x82fc('0x4d')]);}_0x980ce8['order']=qs[_0x82fc('0x4e')](_0x39defb[_0x82fc('0x45')]['sort']);_0x980ce8['where']=qs[_0x82fc('0x47')](_[_0x82fc('0x4f')](_0x39defb[_0x82fc('0x45')],_0x59a6c2[_0x82fc('0x47')]),_0x59f1f4);if(_0x39defb[_0x82fc('0x45')][_0x82fc('0x50')]){_0x980ce8[_0x82fc('0x51')]=_[_0x82fc('0x52')](_0x980ce8[_0x82fc('0x51')],{'$or':_[_0x82fc('0x40')](_0x59f1f4,function(_0x38ecc8){if(_0x38ecc8['type']!=='VIRTUAL'){var _0x34245d={};_0x34245d[_0x38ecc8['name']]={'$like':'%'+_0x39defb[_0x82fc('0x45')][_0x82fc('0x50')]+'%'};return _0x34245d;}})});}_0x980ce8=_['merge']({},_0x980ce8,_0x39defb[_0x82fc('0x53')]);var _0x5308ac={'where':_0x980ce8[_0x82fc('0x51')]};return db[_0x82fc('0x41')][_0x82fc('0x2d')](_0x5308ac)['then'](function(_0x39bd2d){_0x54dced[_0x82fc('0x2d')]=_0x39bd2d;if(_0x39defb['query'][_0x82fc('0x54')]){_0x980ce8['include']=[{'all':!![]}];}return db[_0x82fc('0x41')][_0x82fc('0x55')](_0x980ce8);})[_0x82fc('0x20')](function(_0x52e250){_0x54dced[_0x82fc('0x56')]=_0x52e250;return _0x54dced;})[_0x82fc('0x20')](respondWithFilteredResult(_0x5e7073,_0x980ce8))[_0x82fc('0x29')](handleError(_0x5e7073,null));};exports['show']=function(_0x50eb47,_0x29f698){var _0x44054b={'raw':![],'where':{'id':_0x50eb47[_0x82fc('0x57')]['id']},'include':[{'model':db[_0x82fc('0x58')],'as':_0x82fc('0x3b')},{'model':db[_0x82fc('0x3c')],'as':_0x82fc('0x3d')},{'model':db[_0x82fc('0x3e')],'as':_0x82fc('0x3f')}]},_0x2827c1={};_0x2827c1[_0x82fc('0x44')]=_[_0x82fc('0x46')](db[_0x82fc('0x41')]['rawAttributes']);_0x2827c1[_0x82fc('0x45')]=_[_0x82fc('0x46')](_0x50eb47[_0x82fc('0x45')]);_0x2827c1[_0x82fc('0x47')]=_[_0x82fc('0x49')](_0x2827c1[_0x82fc('0x44')],_0x2827c1['query']);_0x44054b[_0x82fc('0x48')]=_['intersection'](_0x2827c1[_0x82fc('0x44')],qs[_0x82fc('0x4a')](_0x50eb47[_0x82fc('0x45')][_0x82fc('0x4a')]));_0x44054b[_0x82fc('0x48')]=_0x44054b[_0x82fc('0x48')][_0x82fc('0x4b')]?_0x44054b[_0x82fc('0x48')]:_0x2827c1[_0x82fc('0x44')];if(_0x50eb47[_0x82fc('0x45')][_0x82fc('0x54')]){_0x44054b[_0x82fc('0x59')]=[{'all':!![]}];}_0x44054b=_[_0x82fc('0x52')]({},_0x44054b,_0x50eb47['options']);return db['MailAccount']['find'](_0x44054b)[_0x82fc('0x20')](handleEntityNotFound(_0x29f698,null))['then'](respondWithResult(_0x29f698,null))['catch'](handleError(_0x29f698,null));};exports[_0x82fc('0x34')]=function(_0x5226aa,_0x39f7b7){if(_0x5226aa[_0x82fc('0x5a')]['id']){delete _0x5226aa[_0x82fc('0x5a')]['id'];}return db[_0x82fc('0x41')][_0x82fc('0x5b')]({'where':{'id':_0x5226aa['params']['id']},'include':[{'model':db[_0x82fc('0x58')],'as':_0x82fc('0x3b')},{'model':db[_0x82fc('0x3c')],'as':'Smtp'},{'model':db['Pause'],'as':_0x82fc('0x3f')}]})[_0x82fc('0x20')](handleEntityNotFound(_0x39f7b7,null))[_0x82fc('0x20')](saveUpdates(_0x5226aa[_0x82fc('0x5a')],null))[_0x82fc('0x20')](function(_0x20ede7){if(_0x20ede7&&_0x5226aa[_0x82fc('0x5a')][_0x82fc('0x3b')]){return db[_0x82fc('0x58')]['update'](_0x5226aa[_0x82fc('0x5a')][_0x82fc('0x3b')],{'where':{'MailAccountId':_0x20ede7['id']}})['then'](function(){return _0x20ede7;});}return _0x20ede7;})[_0x82fc('0x20')](function(_0x48bd2d){if(_0x48bd2d&&_0x5226aa[_0x82fc('0x5a')][_0x82fc('0x3d')]){return db[_0x82fc('0x3c')][_0x82fc('0x34')](_0x5226aa[_0x82fc('0x5a')][_0x82fc('0x3d')],{'where':{'MailAccountId':_0x48bd2d['id']}})['then'](function(){return _0x48bd2d;});}return _0x48bd2d;})[_0x82fc('0x20')](respondWithResult(_0x39f7b7,null))[_0x82fc('0x29')](handleError(_0x39f7b7,null));};exports[_0x82fc('0x5c')]=function(_0x452c27,_0x553175){return db[_0x82fc('0x41')]['describe']()['then'](respondWithResult(_0x553175,null))['catch'](handleError(_0x553175,null));};exports[_0x82fc('0x5d')]=function(_0x2351e5,_0x279d0d,_0xf26dac){if(_0x2351e5[_0x82fc('0x5a')]['id']){delete _0x2351e5[_0x82fc('0x5a')]['id'];}return db['MailAccount']['find']({'where':{'id':_0x2351e5['params']['id']}})[_0x82fc('0x20')](handleEntityNotFound(_0x279d0d,null))['then'](function(_0x51604a){if(_0x51604a){_0x2351e5['body'][_0x82fc('0x5e')]=_0x51604a['id'];return db['Disposition'][_0x82fc('0x5f')](_0x2351e5[_0x82fc('0x5a')]);}})['then'](respondWithResult(_0x279d0d,null))[_0x82fc('0x29')](handleError(_0x279d0d,null));};exports[_0x82fc('0x60')]=function(_0x154cbd,_0x3022c2,_0x17d27e){var _0x31d17c={'raw':![],'where':{}};var _0xca2de2={};var _0x1ea383={'count':0x0,'rows':[]};return db[_0x82fc('0x41')][_0x82fc('0x61')]({'where':{'id':_0x154cbd[_0x82fc('0x57')]['id']}})[_0x82fc('0x20')](handleEntityNotFound(_0x3022c2,null))['then'](function(_0x577acc){if(_0x577acc){_0xca2de2[_0x82fc('0x44')]=_[_0x82fc('0x46')](db[_0x82fc('0x62')][_0x82fc('0x42')]);_0xca2de2[_0x82fc('0x45')]=_[_0x82fc('0x46')](_0x154cbd[_0x82fc('0x45')]);_0xca2de2['filters']=_['intersection'](_0xca2de2[_0x82fc('0x44')],_0xca2de2[_0x82fc('0x45')]);_0x31d17c[_0x82fc('0x48')]=_[_0x82fc('0x49')](_0xca2de2['model'],qs[_0x82fc('0x4a')](_0x154cbd[_0x82fc('0x45')][_0x82fc('0x4a')]));_0x31d17c['attributes']=_0x31d17c[_0x82fc('0x48')][_0x82fc('0x4b')]?_0x31d17c[_0x82fc('0x48')]:_0xca2de2[_0x82fc('0x44')];if(!_0x154cbd['query'][_0x82fc('0x4c')](_0x82fc('0x63'))){_0x31d17c[_0x82fc('0x2e')]=qs['limit'](_0x154cbd[_0x82fc('0x45')][_0x82fc('0x2e')]);_0x31d17c['offset']=qs[_0x82fc('0x4d')](_0x154cbd['query'][_0x82fc('0x4d')]);}_0x31d17c[_0x82fc('0x64')]=qs[_0x82fc('0x4e')](_0x154cbd[_0x82fc('0x45')][_0x82fc('0x4e')]);_0x31d17c['where']=qs[_0x82fc('0x47')](_[_0x82fc('0x4f')](_0x154cbd[_0x82fc('0x45')],_0xca2de2[_0x82fc('0x47')]));_0x31d17c['where'][_0x82fc('0x5e')]=_0x577acc['id'];if(_0x154cbd['query']['filter']){_0x31d17c[_0x82fc('0x51')]=_[_0x82fc('0x52')](_0x31d17c['where'],{'$or':_['map'](_0x31d17c[_0x82fc('0x48')],function(_0x3f891d){var _0xa3cacf={};_0xa3cacf[_0x3f891d]={'$like':'%'+_0x154cbd[_0x82fc('0x45')][_0x82fc('0x50')]+'%'};return _0xa3cacf;})});}_0x31d17c=_[_0x82fc('0x52')]({},_0x31d17c,_0x154cbd[_0x82fc('0x53')]);return db['Disposition']['count']({'where':_0x31d17c[_0x82fc('0x51')]})['then'](function(_0x47e41f){_0x1ea383[_0x82fc('0x2d')]=_0x47e41f;if(_0x154cbd['query'][_0x82fc('0x54')]){_0x31d17c[_0x82fc('0x59')]=[{'all':!![]}];}return db[_0x82fc('0x62')][_0x82fc('0x55')](_0x31d17c);})[_0x82fc('0x20')](function(_0x227635){_0x1ea383[_0x82fc('0x56')]=_0x227635;return _0x1ea383;});}})[_0x82fc('0x20')](respondWithFilteredResult(_0x3022c2,_0x31d17c))[_0x82fc('0x29')](handleError(_0x3022c2,null));};exports[_0x82fc('0x65')]=function(_0x5129fd,_0x246fae,_0x28e217){return db[_0x82fc('0x41')][_0x82fc('0x5b')]({'where':{'id':_0x5129fd[_0x82fc('0x57')]['id']}})[_0x82fc('0x20')](handleEntityNotFound(_0x246fae,null))['then'](function(_0x25219b){if(_0x25219b){return _0x25219b[_0x82fc('0x65')](_0x5129fd[_0x82fc('0x45')][_0x82fc('0x66')]);}})[_0x82fc('0x20')](respondWithStatusCode(_0x246fae,null))[_0x82fc('0x29')](handleError(_0x246fae,null));};exports['addAnswer']=function(_0x3360c9,_0xd24980,_0x5e90f9){if(_0x3360c9[_0x82fc('0x5a')]['id']){delete _0x3360c9[_0x82fc('0x5a')]['id'];}return db[_0x82fc('0x41')][_0x82fc('0x5b')]({'where':{'id':_0x3360c9[_0x82fc('0x57')]['id']}})['then'](handleEntityNotFound(_0xd24980,null))[_0x82fc('0x20')](function(_0x2de4eb){if(_0x2de4eb){_0x3360c9[_0x82fc('0x5a')][_0x82fc('0x5e')]=_0x2de4eb['id'];return db[_0x82fc('0x67')][_0x82fc('0x5f')](_0x3360c9[_0x82fc('0x5a')]);}})[_0x82fc('0x20')](respondWithResult(_0xd24980,null))[_0x82fc('0x29')](handleError(_0xd24980,null));};exports['getAnswers']=function(_0x52e774,_0x54b616,_0x5b2dc8){var _0x5d3f6d={'raw':![],'where':{}};var _0x344557={};var _0x2cbc23={'count':0x0,'rows':[]};return db[_0x82fc('0x41')][_0x82fc('0x61')]({'where':{'id':_0x52e774[_0x82fc('0x57')]['id']}})[_0x82fc('0x20')](handleEntityNotFound(_0x54b616,null))[_0x82fc('0x20')](function(_0x218a3a){if(_0x218a3a){_0x344557[_0x82fc('0x44')]=_['keys'](db[_0x82fc('0x67')][_0x82fc('0x42')]);_0x344557['query']=_[_0x82fc('0x46')](_0x52e774['query']);_0x344557[_0x82fc('0x47')]=_[_0x82fc('0x49')](_0x344557[_0x82fc('0x44')],_0x344557['query']);_0x5d3f6d[_0x82fc('0x48')]=_[_0x82fc('0x49')](_0x344557[_0x82fc('0x44')],qs['fields'](_0x52e774['query'][_0x82fc('0x4a')]));_0x5d3f6d['attributes']=_0x5d3f6d[_0x82fc('0x48')][_0x82fc('0x4b')]?_0x5d3f6d[_0x82fc('0x48')]:_0x344557[_0x82fc('0x44')];if(!_0x52e774[_0x82fc('0x45')][_0x82fc('0x4c')](_0x82fc('0x63'))){_0x5d3f6d[_0x82fc('0x2e')]=qs[_0x82fc('0x2e')](_0x52e774[_0x82fc('0x45')][_0x82fc('0x2e')]);_0x5d3f6d[_0x82fc('0x4d')]=qs[_0x82fc('0x4d')](_0x52e774[_0x82fc('0x45')][_0x82fc('0x4d')]);}_0x5d3f6d['order']=qs[_0x82fc('0x4e')](_0x52e774[_0x82fc('0x45')][_0x82fc('0x4e')]);_0x5d3f6d[_0x82fc('0x51')]=qs['filters'](_['pick'](_0x52e774[_0x82fc('0x45')],_0x344557[_0x82fc('0x47')]));_0x5d3f6d['where'][_0x82fc('0x5e')]=_0x218a3a['id'];if(_0x52e774['query'][_0x82fc('0x50')]){_0x5d3f6d[_0x82fc('0x51')]=_['merge'](_0x5d3f6d['where'],{'$or':_[_0x82fc('0x40')](_0x5d3f6d[_0x82fc('0x48')],function(_0xa493b7){var _0x40378d={};_0x40378d[_0xa493b7]={'$like':'%'+_0x52e774[_0x82fc('0x45')][_0x82fc('0x50')]+'%'};return _0x40378d;})});}_0x5d3f6d=_[_0x82fc('0x52')]({},_0x5d3f6d,_0x52e774['options']);return db['CannedAnswer'][_0x82fc('0x2d')]({'where':_0x5d3f6d['where']})[_0x82fc('0x20')](function(_0x5e0902){_0x2cbc23[_0x82fc('0x2d')]=_0x5e0902;if(_0x52e774[_0x82fc('0x45')][_0x82fc('0x54')]){_0x5d3f6d[_0x82fc('0x59')]=[{'all':!![]}];}return db[_0x82fc('0x67')][_0x82fc('0x55')](_0x5d3f6d);})[_0x82fc('0x20')](function(_0x37b0fb){_0x2cbc23[_0x82fc('0x56')]=_0x37b0fb;return _0x2cbc23;});}})[_0x82fc('0x20')](respondWithFilteredResult(_0x54b616,_0x5d3f6d))[_0x82fc('0x29')](handleError(_0x54b616,null));};exports['removeAnswers']=function(_0x25c01d,_0x2866a1,_0x2d268b){return db[_0x82fc('0x41')][_0x82fc('0x5b')]({'where':{'id':_0x25c01d['params']['id']}})[_0x82fc('0x20')](handleEntityNotFound(_0x2866a1,null))[_0x82fc('0x20')](function(_0x4ecceb){if(_0x4ecceb){return _0x4ecceb[_0x82fc('0x68')](_0x25c01d[_0x82fc('0x45')][_0x82fc('0x66')]);}})[_0x82fc('0x20')](respondWithStatusCode(_0x2866a1,null))[_0x82fc('0x29')](handleError(_0x2866a1,null));};exports[_0x82fc('0x5f')]=function(_0x378a90,_0x2b83dc){var _0xb90f85={'name':_0x378a90[_0x82fc('0x5a')][_0x82fc('0x3a')],'key':_0x378a90[_0x82fc('0x5a')][_0x82fc('0x43')],'email':_0x378a90[_0x82fc('0x5a')]['email'],'ListId':_0x378a90[_0x82fc('0x5a')]['ListId'],'active':!_['isNil'](_0x378a90[_0x82fc('0x5a')][_0x82fc('0x69')])?_0x378a90[_0x82fc('0x5a')][_0x82fc('0x69')]:!![],'description':_0x378a90['body'][_0x82fc('0x6a')]||null,'Imap':{},'Smtp':{}};if(_['isNil'](_0x378a90[_0x82fc('0x5a')][_0x82fc('0x6b')])){if(_0x378a90['body']['cauthentication']){_0xb90f85[_0x82fc('0x3b')][_0x82fc('0x6c')]=_0xb90f85[_0x82fc('0x3d')][_0x82fc('0x6c')]=_0x378a90[_0x82fc('0x5a')][_0x82fc('0x6d')];_0xb90f85['Imap'][_0x82fc('0x6e')]=_0xb90f85[_0x82fc('0x3d')][_0x82fc('0x6f')]=_0x378a90[_0x82fc('0x5a')][_0x82fc('0x70')];}else{_0xb90f85[_0x82fc('0x3b')]['authentication']=_0xb90f85['Smtp'][_0x82fc('0x71')]=![];}_0xb90f85['Imap'][_0x82fc('0x72')]=_0x378a90[_0x82fc('0x5a')]['Imap'][_0x82fc('0x72')];_0xb90f85[_0x82fc('0x3b')]['port']=_0x378a90['body'][_0x82fc('0x3b')][_0x82fc('0x73')];_0xb90f85[_0x82fc('0x3d')][_0x82fc('0x72')]=_0x378a90[_0x82fc('0x5a')][_0x82fc('0x3d')][_0x82fc('0x72')];_0xb90f85['Smtp'][_0x82fc('0x73')]=_0x378a90[_0x82fc('0x5a')][_0x82fc('0x3d')][_0x82fc('0x73')];}else{_0xb90f85[_0x82fc('0x3b')][_0x82fc('0x74')]=_0xb90f85[_0x82fc('0x3d')]['service']=_0x378a90[_0x82fc('0x5a')][_0x82fc('0x6b')];_0xb90f85[_0x82fc('0x3b')]['user']=_0xb90f85['Smtp'][_0x82fc('0x6c')]=_0x378a90['body']['cuser'];_0xb90f85[_0x82fc('0x3b')][_0x82fc('0x6e')]=_0xb90f85[_0x82fc('0x3d')][_0x82fc('0x6f')]=_0x378a90[_0x82fc('0x5a')][_0x82fc('0x70')];}return db['MailAccount']['create'](_0xb90f85,{'include':[{'model':db['MailServerOut'],'as':_0x82fc('0x3d')},{'model':db[_0x82fc('0x58')],'as':_0x82fc('0x3b')}]})['then'](function(_0x4d22ca){var _0x3b8664=_0x378a90[_0x82fc('0x6c')]['get']({'plain':!![]});if(!_0x3b8664)throw new Error(_0x82fc('0x75'));if(_0x3b8664[_0x82fc('0x76')]===_0x82fc('0x6c')){var _0x9a9d2c=_0x4d22ca[_0x82fc('0x36')]({'plain':!![]});return db[_0x82fc('0x77')][_0x82fc('0x5b')]({'where':{'name':_0x82fc('0x78'),'userProfileId':_0x3b8664[_0x82fc('0x79')]},'raw':!![]})[_0x82fc('0x20')](function(_0x42316a){if(_0x42316a&&_0x42316a[_0x82fc('0x7a')]===0x0){return db['UserProfileResource'][_0x82fc('0x5f')]({'name':_0x9a9d2c[_0x82fc('0x3a')],'resourceId':_0x9a9d2c['id'],'type':_0x42316a[_0x82fc('0x3a')],'sectionId':_0x42316a['id']},{})[_0x82fc('0x20')](function(){return _0x4d22ca;});}else{return _0x4d22ca;}})[_0x82fc('0x29')](function(_0x136a09){logger['error'](_0x82fc('0x7b'),_0x136a09);throw _0x136a09;});}return _0x4d22ca;})[_0x82fc('0x20')](respondWithResult(_0x2b83dc,0xc9))[_0x82fc('0x29')](handleError(_0x2b83dc,null));};exports[_0x82fc('0x7c')]=function(_0x1dc9a5,_0x303bc9,_0x2eb80b){return db[_0x82fc('0x41')]['findOne']({'where':{'id':_0x1dc9a5[_0x82fc('0x57')]['id']}})[_0x82fc('0x20')](handleEntityNotFound(_0x303bc9,null))[_0x82fc('0x20')](function(_0x56ec1e){if(_0x56ec1e){return _0x56ec1e[_0x82fc('0x7c')]();}return null;})[_0x82fc('0x20')](respondWithResult(_0x303bc9,null))[_0x82fc('0x29')](handleError(_0x303bc9,null));};exports[_0x82fc('0x7d')]=function(_0x44f399,_0x4fc996,_0x999f8b){if(_0x44f399['body']['id']){delete _0x44f399[_0x82fc('0x5a')]['id'];}return db[_0x82fc('0x41')][_0x82fc('0x5b')]({'where':{'id':_0x44f399[_0x82fc('0x57')]['id']}})['then'](handleEntityNotFound(_0x4fc996,null))[_0x82fc('0x20')](function(_0x29d255){if(_0x29d255){_0x44f399[_0x82fc('0x5a')][_0x82fc('0x5e')]=_0x29d255['id'];return db['MailServerIn']['create'](_0x44f399[_0x82fc('0x5a')]);}})['then'](respondWithResult(_0x4fc996,null))['catch'](handleError(_0x4fc996,null));};exports['removeImap']=function(_0x3145c0,_0x5f57cc,_0x34186e){return db['MailAccount'][_0x82fc('0x61')]({'where':{'id':_0x3145c0[_0x82fc('0x57')]['id']}})['then'](handleEntityNotFound(_0x5f57cc,null))['then'](function(_0x1c9fbf){if(_0x1c9fbf){return _0x1c9fbf['setImap'](null);}return null;})[_0x82fc('0x20')](respondWithStatusCode(_0x5f57cc,null))['catch'](handleError(_0x5f57cc,null));};exports['getSmtp']=function(_0x4f1947,_0x41d89a,_0x2b85e){return db[_0x82fc('0x41')]['findOne']({'where':{'id':_0x4f1947['params']['id']}})[_0x82fc('0x20')](handleEntityNotFound(_0x41d89a,null))[_0x82fc('0x20')](function(_0x38990b){if(_0x38990b){return _0x38990b[_0x82fc('0x7e')]();}return null;})[_0x82fc('0x20')](respondWithResult(_0x41d89a,null))[_0x82fc('0x29')](handleError(_0x41d89a,null));};exports['addSmtp']=function(_0x1b7053,_0x47b47b,_0x314dec){if(_0x1b7053['body']['id']){delete _0x1b7053[_0x82fc('0x5a')]['id'];}return db[_0x82fc('0x41')][_0x82fc('0x5b')]({'where':{'id':_0x1b7053[_0x82fc('0x57')]['id']}})[_0x82fc('0x20')](handleEntityNotFound(_0x47b47b,null))[_0x82fc('0x20')](function(_0xf0a5dc){if(_0xf0a5dc){_0x1b7053['body'][_0x82fc('0x5e')]=_0xf0a5dc['id'];return db[_0x82fc('0x3c')][_0x82fc('0x5f')](_0x1b7053[_0x82fc('0x5a')]);}})['then'](respondWithResult(_0x47b47b,null))[_0x82fc('0x29')](handleError(_0x47b47b,null));};exports[_0x82fc('0x7f')]=function(_0x3246a0,_0x4cbc97,_0x10a68d){return db['MailAccount']['findOne']({'where':{'id':_0x3246a0[_0x82fc('0x57')]['id']}})['then'](handleEntityNotFound(_0x4cbc97,null))[_0x82fc('0x20')](function(_0x38cabc){if(_0x38cabc){return _0x38cabc[_0x82fc('0x80')](null);}return null;})[_0x82fc('0x20')](respondWithStatusCode(_0x4cbc97,null))[_0x82fc('0x29')](handleError(_0x4cbc97,null));};exports[_0x82fc('0x81')]=function(_0x5265e5,_0x3f22cc,_0x5eaa8a){return db[_0x82fc('0x82')][_0x82fc('0x5b')]({'where':{'id':_0x5265e5[_0x82fc('0x57')]['id']}})['then'](handleEntityNotFound(_0x3f22cc,null))[_0x82fc('0x20')](function(_0x44cdd4){if(_0x44cdd4){return _0x44cdd4['addInteraction'](_0x5265e5[_0x82fc('0x5a')]['ids'],_[_0x82fc('0x83')](_0x5265e5['body'],[_0x82fc('0x66'),'id'])||{});}})[_0x82fc('0x20')](respondWithResult(_0x3f22cc,null))[_0x82fc('0x29')](handleError(_0x3f22cc,null));};exports[_0x82fc('0x84')]=function(_0x138675,_0x2e11ab,_0x2326b){var _0x5b1a05={'raw':![],'where':{}};var _0x365741={};var _0x56deaf={'count':0x0,'rows':[]};return db[_0x82fc('0x41')][_0x82fc('0x61')]({'where':{'id':_0x138675[_0x82fc('0x57')]['id']}})[_0x82fc('0x20')](handleEntityNotFound(_0x2e11ab,null))[_0x82fc('0x20')](function(_0x4bf325){if(_0x4bf325){_0x365741[_0x82fc('0x44')]=_['keys'](db['MailInteraction']['rawAttributes']);_0x365741[_0x82fc('0x45')]=_['keys'](_0x138675[_0x82fc('0x45')]);_0x365741[_0x82fc('0x47')]=_[_0x82fc('0x49')](_0x365741[_0x82fc('0x44')],_0x365741[_0x82fc('0x45')]);_0x5b1a05[_0x82fc('0x48')]=_['intersection'](_0x365741['model'],qs[_0x82fc('0x4a')](_0x138675['query'][_0x82fc('0x4a')]));_0x5b1a05['attributes']=_0x5b1a05[_0x82fc('0x48')][_0x82fc('0x4b')]?_0x5b1a05[_0x82fc('0x48')]:_0x365741[_0x82fc('0x44')];if(!_0x138675[_0x82fc('0x45')][_0x82fc('0x4c')](_0x82fc('0x63'))){_0x5b1a05[_0x82fc('0x2e')]=qs[_0x82fc('0x2e')](_0x138675[_0x82fc('0x45')][_0x82fc('0x2e')]);_0x5b1a05['offset']=qs[_0x82fc('0x4d')](_0x138675[_0x82fc('0x45')][_0x82fc('0x4d')]);}_0x5b1a05['order']=qs[_0x82fc('0x4e')](_0x138675[_0x82fc('0x45')][_0x82fc('0x4e')]);_0x5b1a05['where']=qs[_0x82fc('0x47')](_['pick'](_0x138675[_0x82fc('0x45')],_0x365741['filters']));_0x5b1a05[_0x82fc('0x51')][_0x82fc('0x5e')]=_0x4bf325['id'];if(_0x138675['query']['filter']){_0x5b1a05['where']=_['merge'](_0x5b1a05[_0x82fc('0x51')],{'$or':_[_0x82fc('0x40')](_0x5b1a05[_0x82fc('0x48')],function(_0x4cc3d3){var _0x317299={};_0x317299[_0x4cc3d3]={'$like':'%'+_0x138675[_0x82fc('0x45')][_0x82fc('0x50')]+'%'};return _0x317299;})});}_0x5b1a05=_[_0x82fc('0x52')]({},_0x5b1a05,_0x138675[_0x82fc('0x53')]);return db[_0x82fc('0x82')][_0x82fc('0x2d')]({'where':_0x5b1a05[_0x82fc('0x51')]})['then'](function(_0x2ba3eb){_0x56deaf[_0x82fc('0x2d')]=_0x2ba3eb;if(_0x138675[_0x82fc('0x45')][_0x82fc('0x54')]){_0x5b1a05[_0x82fc('0x59')]=[{'model':db[_0x82fc('0x85')],'as':'Contact','required':![]},{'model':db['User'],'as':_0x82fc('0x86'),'attributes':[_0x82fc('0x3a'),_0x82fc('0x87'),'internal'],'required':![]},{'model':db['Tag'],'as':_0x82fc('0x88'),'attributes':['id',_0x82fc('0x3a'),'color'],'where':_0x138675[_0x82fc('0x45')][_0x82fc('0x89')]?{'id':_0x138675[_0x82fc('0x45')][_0x82fc('0x89')]}:undefined,'required':_0x138675[_0x82fc('0x45')][_0x82fc('0x89')]?!![]:![]}];}return db[_0x82fc('0x82')]['findAll'](_0x5b1a05);})['then'](function(_0x32ea76){_0x56deaf[_0x82fc('0x56')]=_0x32ea76;return _0x56deaf;});}})[_0x82fc('0x20')](respondWithFilteredResult(_0x2e11ab,_0x5b1a05))[_0x82fc('0x29')](handleError(_0x2e11ab,null));};exports[_0x82fc('0x8a')]=function addApplications(_0x322ee4,_0x2388bb){var _0xd485a1=_0x322ee4[_0x82fc('0x57')]['id'];var _0x36a378=_0x322ee4['body'];var _0x1b0424=0xc8;var _0x3241c5=null;return db['sequelize'][_0x82fc('0x8b')]({'isolationLevel':db[_0x82fc('0x8c')][_0x82fc('0x8d')][_0x82fc('0x8e')][_0x82fc('0x8f')]},function(_0x379ef4){return db[_0x82fc('0x41')]['findOne']({'where':{'id':_0xd485a1},'transaction':_0x379ef4})[_0x82fc('0x20')](function(_0x213a6f){if(_0x213a6f){return db[_0x82fc('0x90')][_0x82fc('0x35')]({'where':{'MailAccountId':_0xd485a1},'transaction':_0x379ef4})['then'](function(){var _0x37816c=_[_0x82fc('0x40')](_0x36a378,function(_0x470100){_0x470100[_0x82fc('0x5e')]=_0xd485a1;return _0x470100;});return db[_0x82fc('0x90')][_0x82fc('0x91')](_0x37816c,{'transaction':_0x379ef4});});}else{_0x1b0424=0x194;_0x3241c5=[];}});})[_0x82fc('0x20')](function(){if(_0x1b0424!==0x194){return db[_0x82fc('0x90')][_0x82fc('0x92')]({'where':{'MailAccountId':_0xd485a1},'order':'priority'})[_0x82fc('0x20')](function(_0x46d6e4){_0x3241c5=_0x46d6e4;});}})[_0x82fc('0x29')](function(_0x17fd95){_0x1b0424=0x1f4;logger['error'](_0x17fd95[_0x82fc('0x39')]);if(_0x17fd95[_0x82fc('0x3a')]){delete _0x17fd95['name'];}_0x3241c5=_0x17fd95;})['finally'](function(){if(_0x3241c5===null){_0x2388bb[_0x82fc('0x38')](_0x1b0424);}else{if(_0x1b0424===0x1f4){_0x2388bb[_0x82fc('0x2a')](_0x1b0424)[_0x82fc('0x93')](_0x3241c5);}else{_0x2388bb[_0x82fc('0x2a')](_0x1b0424)[_0x82fc('0x2b')](_0x3241c5);}}});};exports[_0x82fc('0x94')]=function(_0x178ae2,_0x116a4f,_0x22a77d){var _0x3cae55={};var _0x343957={};var _0xee175b;var _0x8ae66;return db[_0x82fc('0x41')][_0x82fc('0x61')]({'where':{'id':_0x178ae2[_0x82fc('0x57')]['id']}})[_0x82fc('0x20')](handleEntityNotFound(_0x116a4f,null))[_0x82fc('0x20')](function(_0x10af29){if(_0x10af29){_0xee175b=_0x10af29;_0x343957['model']=_['keys'](db[_0x82fc('0x90')][_0x82fc('0x42')]);_0x343957[_0x82fc('0x45')]=_[_0x82fc('0x46')](_0x178ae2[_0x82fc('0x45')]);_0x343957[_0x82fc('0x47')]=_[_0x82fc('0x49')](_0x343957[_0x82fc('0x44')],_0x343957['query']);_0x3cae55[_0x82fc('0x48')]=_[_0x82fc('0x49')](_0x343957['model'],qs[_0x82fc('0x4a')](_0x178ae2['query']['fields']));_0x3cae55[_0x82fc('0x48')]=_0x3cae55['attributes'][_0x82fc('0x4b')]?_0x3cae55[_0x82fc('0x48')]:_0x343957[_0x82fc('0x44')];_0x3cae55[_0x82fc('0x64')]=qs['sort'](_0x178ae2[_0x82fc('0x45')]['sort']);_0x3cae55[_0x82fc('0x51')]=qs[_0x82fc('0x47')](_[_0x82fc('0x4f')](_0x178ae2[_0x82fc('0x45')],_0x343957['filters']));if(_0x178ae2[_0x82fc('0x45')]['filter']){_0x3cae55[_0x82fc('0x51')]=_[_0x82fc('0x52')](_0x3cae55[_0x82fc('0x51')],{'$or':_[_0x82fc('0x40')](_0x3cae55[_0x82fc('0x48')],function(_0x29148d){var _0x1bf62b={};_0x1bf62b[_0x29148d]={'$like':'%'+_0x178ae2['query']['filter']+'%'};return _0x1bf62b;})});}_0x3cae55=_['merge']({},_0x3cae55,_0x178ae2[_0x82fc('0x53')]);return _0xee175b[_0x82fc('0x94')](_0x3cae55);}})[_0x82fc('0x20')](function(_0x2525fe){if(_0x2525fe){_0x8ae66=_0x2525fe[_0x82fc('0x4b')];if(!_0x178ae2[_0x82fc('0x45')][_0x82fc('0x4c')]('nolimit')){_0x3cae55[_0x82fc('0x2e')]=qs['limit'](_0x178ae2[_0x82fc('0x45')]['limit']);_0x3cae55[_0x82fc('0x4d')]=qs['offset'](_0x178ae2['query'][_0x82fc('0x4d')]);}return _0xee175b['getApplications'](_0x3cae55);}})[_0x82fc('0x20')](function(_0x35271c){if(_0x35271c){return _0x35271c?{'count':_0x8ae66,'rows':_0x35271c}:null;}})[_0x82fc('0x20')](respondWithResult(_0x116a4f,null))[_0x82fc('0x29')](handleError(_0x116a4f,null));};exports[_0x82fc('0x95')]=function(_0x4e89e5,_0x1592ea,_0x5b31e4){var _0x57c125={'raw':!![],'where':{}};var _0x36846b={};var _0x467819={'count':0x0,'rows':[]};return db['MailAccount'][_0x82fc('0x61')]({'where':{'id':_0x4e89e5['params']['id']}})[_0x82fc('0x20')](handleEntityNotFound(_0x1592ea,null))[_0x82fc('0x20')](function(_0x23a999){if(_0x23a999){_0x36846b[_0x82fc('0x44')]=_['keys'](db[_0x82fc('0x96')]['rawAttributes']);_0x36846b['query']=_[_0x82fc('0x46')](_0x4e89e5[_0x82fc('0x45')]);_0x36846b[_0x82fc('0x47')]=_[_0x82fc('0x49')](_0x36846b[_0x82fc('0x44')],_0x36846b[_0x82fc('0x45')]);_0x57c125['attributes']=_[_0x82fc('0x49')](_0x36846b[_0x82fc('0x44')],qs[_0x82fc('0x4a')](_0x4e89e5[_0x82fc('0x45')][_0x82fc('0x4a')]));_0x57c125['attributes']=_0x57c125[_0x82fc('0x48')][_0x82fc('0x4b')]?_0x57c125[_0x82fc('0x48')]:_0x36846b[_0x82fc('0x44')];if(!_0x4e89e5[_0x82fc('0x45')][_0x82fc('0x4c')](_0x82fc('0x63'))){_0x57c125[_0x82fc('0x2e')]=qs[_0x82fc('0x2e')](_0x4e89e5[_0x82fc('0x45')][_0x82fc('0x2e')]);_0x57c125[_0x82fc('0x4d')]=qs[_0x82fc('0x4d')](_0x4e89e5[_0x82fc('0x45')][_0x82fc('0x4d')]);}_0x57c125[_0x82fc('0x64')]=qs[_0x82fc('0x4e')](_0x4e89e5[_0x82fc('0x45')][_0x82fc('0x4e')]);_0x57c125[_0x82fc('0x51')]=qs[_0x82fc('0x47')](_['pick'](_0x4e89e5[_0x82fc('0x45')],_0x36846b[_0x82fc('0x47')]));_0x57c125[_0x82fc('0x51')][_0x82fc('0x5e')]=_0x23a999['id'];if(_0x4e89e5['query']['filter']){_0x57c125[_0x82fc('0x51')]=_['merge'](_0x57c125[_0x82fc('0x51')],{'$or':_[_0x82fc('0x40')](_0x57c125[_0x82fc('0x48')],function(_0x5eb719){var _0x6f872e={};_0x6f872e[_0x5eb719]={'$like':'%'+_0x4e89e5[_0x82fc('0x45')][_0x82fc('0x50')]+'%'};return _0x6f872e;})});}if(_0x4e89e5[_0x82fc('0x45')][_0x82fc('0x97')]){var _0x263552=_0x4e89e5['query'][_0x82fc('0x97')][_0x82fc('0x98')](',');var _0xd4099a={};_0xd4099a[_0x263552[0x0]]={'$gte':moment(_0x263552[0x1])['format'](_0x82fc('0x99'))};_0x57c125[_0x82fc('0x51')]=_['merge'](_0x57c125[_0x82fc('0x51')],_0xd4099a);}_0x57c125=_[_0x82fc('0x52')]({},_0x57c125,_0x4e89e5[_0x82fc('0x53')]);return db[_0x82fc('0x96')][_0x82fc('0x2d')]({'where':_0x57c125['where']})[_0x82fc('0x20')](function(_0x439efe){_0x467819[_0x82fc('0x2d')]=_0x439efe;if(_0x4e89e5[_0x82fc('0x45')]['includeAll']){_0x57c125[_0x82fc('0x59')]=[{'all':!![]}];}return db['MailMessage'][_0x82fc('0x55')](_0x57c125);})['then'](function(_0x1ed231){if(_0x4e89e5[_0x82fc('0x45')][_0x82fc('0x9a')]==='true'){for(var _0x482096=0x0;_0x482096<_0x1ed231['length'];_0x482096++){_0x1ed231[_0x482096][_0x82fc('0x5a')]=juice(_0x1ed231[_0x482096][_0x82fc('0x5a')]);}}_0x467819[_0x82fc('0x56')]=_0x1ed231;return _0x467819;});}})[_0x82fc('0x20')](respondWithFilteredResult(_0x1592ea,_0x57c125))[_0x82fc('0x29')](handleError(_0x1592ea,null));};exports['send']=function(_0x1d04fb,_0xb85633,_0x494513){var _0x4902bd,_0x41d619={},_0x256d6c;if(_0x1d04fb[_0x82fc('0x5a')]['to']){_0x256d6c=_0x1d04fb[_0x82fc('0x5a')]['to'][_0x82fc('0x98')](',')[0x0];}return db[_0x82fc('0x41')][_0x82fc('0x5b')]({'where':{'id':_0x1d04fb[_0x82fc('0x57')]['id']},'include':[{'model':db[_0x82fc('0x9b')],'as':_0x82fc('0x9c'),'include':[{'model':db[_0x82fc('0x85')],'as':'Contacts','where':{'email':_0x256d6c},'limit':0x1,'order':[['updatedAt',_0x82fc('0x9d')]]}]},{'model':db[_0x82fc('0x3c')],'as':'Smtp','raw':!![]}]})[_0x82fc('0x20')](handleEntityNotFound(_0xb85633,null))[_0x82fc('0x20')](function(_0xae288d){if(_0xae288d){_0x4902bd=_0xae288d;if(_0xae288d['Smtp']){if(_[_0x82fc('0x9e')](_0x1d04fb[_0x82fc('0x5a')][_0x82fc('0x9f')])){_0x1d04fb[_0x82fc('0x5a')]['from']=util[_0x82fc('0xa0')](_0x82fc('0xa1'),_0xae288d[_0x82fc('0x3a')],_0xae288d[_0x82fc('0xa2')]||_0xae288d['Smtp'][_0x82fc('0x6c')]);}if(_0x1d04fb['body'][_0x82fc('0xa3')]&&_0x1d04fb[_0x82fc('0x5a')][_0x82fc('0xa3')][_0x82fc('0x4b')]){for(var _0x5f20f2=0x0;_0x5f20f2<_0x1d04fb['body']['attachments'][_0x82fc('0x4b')];_0x5f20f2+=0x1){_0x1d04fb[_0x82fc('0x5a')]['attachments'][_0x5f20f2]={'filename':_0x1d04fb[_0x82fc('0x5a')][_0x82fc('0xa3')][_0x5f20f2][_0x82fc('0x3a')],'path':path['join'](config[_0x82fc('0xa4')],_0x82fc('0xa5'),_0x1d04fb[_0x82fc('0x5a')]['attachments'][_0x5f20f2]['basename'])};}}var _0x23c26b={'tls':{'rejectUnauthorized':![]}};if(_[_0x82fc('0x9e')](_0xae288d[_0x82fc('0x3d')][_0x82fc('0x74')])){if(_0xae288d[_0x82fc('0x3d')][_0x82fc('0x71')]){_0x23c26b[_0x82fc('0xa6')]={'user':_0xae288d['Smtp'][_0x82fc('0x6c')],'pass':_0xae288d['Smtp'][_0x82fc('0x6f')]};}_0x23c26b[_0x82fc('0x72')]=_0xae288d[_0x82fc('0x3d')][_0x82fc('0x72')];_0x23c26b[_0x82fc('0x73')]=_0xae288d[_0x82fc('0x3d')][_0x82fc('0x73')];_0x23c26b['secure']=_0xae288d[_0x82fc('0x3d')][_0x82fc('0xa7')];}else{_0x23c26b[_0x82fc('0x74')]=_0xae288d[_0x82fc('0x3d')][_0x82fc('0x74')];_0x23c26b['auth']={'user':_0xae288d['Smtp'][_0x82fc('0x6c')],'pass':_0xae288d[_0x82fc('0x3d')][_0x82fc('0x6f')]};}return respondWithRpcPromise('SendMail',_0x82fc('0xa8'),{'account':_0x23c26b,'message':_0x1d04fb[_0x82fc('0x5a')]});}else{throw new Error(_0x82fc('0xa9'));}}})[_0x82fc('0x20')](function(_0x41a4e9){if(_0x41a4e9){_0x41d619=_0x41a4e9;if(_0x4902bd[_0x82fc('0x9c')]){if(_0x4902bd[_0x82fc('0x9c')][_0x82fc('0xaa')][_0x82fc('0x4b')]){return _0x4902bd[_0x82fc('0x9c')]['Contacts'][0x0];}else{return db['CmContact']['create'](_[_0x82fc('0x18')](_0x1d04fb[_0x82fc('0x5a')],{'firstName':_0x1d04fb[_0x82fc('0x5a')]['to'],'email':_0x1d04fb[_0x82fc('0x5a')]['to'],'phone':_0x1d04fb[_0x82fc('0x5a')]['to'],'ListId':_0x4902bd['ListId']}));}}else{throw new Error(_0x82fc('0xa9'));}}})[_0x82fc('0x20')](function(_0x233585){if(_0x233585){var _0xf6664c={'UserId':_0x1d04fb[_0x82fc('0x6c')]['id'],'ContactId':_0x233585['id'],'MailAccountId':_0x4902bd['id'],'inReplyTo':_0x41d619[_0x82fc('0xab')],'to':_0x1d04fb[_0x82fc('0x5a')]['from'],'cc':_0x1d04fb['body']['cc'],'subject':_0x1d04fb[_0x82fc('0x5a')][_0x82fc('0xac')],'attach':_0x1d04fb[_0x82fc('0x5a')][_0x82fc('0xad')],'firstMsgDirection':_0x82fc('0xae'),'lastMsgAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':_0x82fc('0xae'),'Messages':[_[_0x82fc('0x52')](_0x1d04fb[_0x82fc('0x5a')],{'messageId':_0x41d619[_0x82fc('0xab')],'sentAt':moment()[_0x82fc('0xa0')](_0x82fc('0x99')),'read':!![],'MailAccountId':_0x4902bd['id'],'UserId':_0x1d04fb[_0x82fc('0x6c')]['id'],'ContactId':_0x233585['id']})]};if(_0x1d04fb[_0x82fc('0x5a')][_0x82fc('0xaf')]){_0xf6664c=_[_0x82fc('0x52')](_0xf6664c,_0x1d04fb[_0x82fc('0x5a')][_0x82fc('0xaf')]);}return db[_0x82fc('0x82')]['create'](_0xf6664c,{'include':[{'model':db[_0x82fc('0x96')],'as':_0x82fc('0xb0')}]});}})[_0x82fc('0x20')](respondWithResult(_0xb85633,null))[_0x82fc('0x29')](handleError(_0xb85633,null));};exports[_0x82fc('0xb1')]=function(_0x27f36d,_0x3b966e,_0xd1f4f0){return db[_0x82fc('0x41')][_0x82fc('0x5b')]({'where':{'id':_0x27f36d[_0x82fc('0x57')]['id']},'include':[{'model':db[_0x82fc('0x3c')],'as':_0x82fc('0x3d'),'raw':!![]}]})[_0x82fc('0x20')](handleEntityNotFound(_0x3b966e,null))[_0x82fc('0x20')](function(_0x2025c5){if(_0x2025c5&&_0x2025c5['Smtp']){var _0x432b82={'id':_0x2025c5['id'],'tls':{'rejectUnauthorized':![]}};if(_0x2025c5[_0x82fc('0x3d')][_0x82fc('0x74')]){_0x432b82[_0x82fc('0x74')]=_0x2025c5[_0x82fc('0x3d')][_0x82fc('0x74')];}else{_0x432b82[_0x82fc('0x72')]=_0x2025c5[_0x82fc('0x3d')][_0x82fc('0x72')];_0x432b82[_0x82fc('0x73')]=_0x2025c5[_0x82fc('0x3d')][_0x82fc('0x73')];_0x432b82[_0x82fc('0xa7')]=_0x2025c5[_0x82fc('0x3d')][_0x82fc('0xa7')];}if(_0x2025c5[_0x82fc('0x3d')][_0x82fc('0x71')]){_0x432b82[_0x82fc('0xa6')]={'user':_0x2025c5['Smtp'][_0x82fc('0x6c')],'pass':_0x2025c5[_0x82fc('0x3d')][_0x82fc('0x6f')]};}return respondWithRpcPromise(_0x82fc('0xb2'),'verifySmtp',{'account':_0x432b82});}})[_0x82fc('0x20')](respondWithResult(_0x3b966e,null))[_0x82fc('0x29')](handleError(_0x3b966e,null));};exports[_0x82fc('0x35')]=function(_0x5c108c,_0x5f2ff6){return db[_0x82fc('0x41')][_0x82fc('0x5b')]({'where':{'id':_0x5c108c[_0x82fc('0x57')]['id']}})[_0x82fc('0x20')](handleEntityNotFound(_0x5f2ff6,null))[_0x82fc('0x20')](function(_0x9c79df){if(_0x9c79df&&_0x9c79df[_0x82fc('0x74')]){throw new db[(_0x82fc('0xb3'))][(_0x82fc('0xb4'))](_0x82fc('0xb5'));}return _0x9c79df;})[_0x82fc('0x20')](removeEntity(_0x5f2ff6,null))['catch'](handleError(_0x5f2ff6,null));};exports[_0x82fc('0xb6')]=function(_0x32128f,_0x35973a,_0x1153da){return db[_0x82fc('0x41')][_0x82fc('0x5b')]({'where':{'id':_0x32128f['params']['id']}})['then'](handleEntityNotFound(_0x35973a,null))[_0x82fc('0x20')](function(_0x3bb932){if(_0x3bb932){return _0x3bb932[_0x82fc('0xb6')](_0x32128f['body'][_0x82fc('0x66')],_['omit'](_0x32128f[_0x82fc('0x5a')],[_0x82fc('0x66'),'id'])||{})['spread'](function(_0x3dd129){for(var _0x1051bf=0x0;_0x1051bf<_0x32128f['body'][_0x82fc('0x66')][_0x82fc('0x4b')];_0x1051bf+=0x1){socket[_0x82fc('0xb7')](_0x82fc('0xb8'),{'UserId':Number(_0x32128f[_0x82fc('0x5a')][_0x82fc('0x66')][_0x1051bf]),'MailAccountId':Number(_0x32128f[_0x82fc('0x57')]['id'])});}return _0x3dd129;});}})[_0x82fc('0x20')](respondWithResult(_0x35973a,null))[_0x82fc('0x29')](handleError(_0x35973a,null));};exports['removeAgents']=function(_0x4b86c1,_0x32693f,_0x333106){return db[_0x82fc('0x41')][_0x82fc('0x5b')]({'where':{'id':_0x4b86c1[_0x82fc('0x57')]['id']}})[_0x82fc('0x20')](handleEntityNotFound(_0x32693f,null))[_0x82fc('0x20')](function(_0x5d32d4){if(_0x5d32d4){return _0x5d32d4['removeAgents'](_0x4b86c1[_0x82fc('0x45')][_0x82fc('0x66')])[_0x82fc('0x20')](function(){if(_[_0x82fc('0xb9')](_0x4b86c1[_0x82fc('0x45')][_0x82fc('0x66')])){for(var _0x5bec45=0x0;_0x5bec45<_0x4b86c1[_0x82fc('0x45')][_0x82fc('0x66')][_0x82fc('0x4b')];_0x5bec45+=0x1){socket[_0x82fc('0xb7')](_0x82fc('0xba'),{'UserId':Number(_0x4b86c1[_0x82fc('0x45')][_0x82fc('0x66')][_0x5bec45]),'MailAccountId':Number(_0x4b86c1[_0x82fc('0x57')]['id'])});}}else{socket['emit']('userMailAccount:remove',{'UserId':Number(_0x4b86c1[_0x82fc('0x45')][_0x82fc('0x66')]),'MailAccountId':Number(_0x4b86c1[_0x82fc('0x57')]['id'])});}});}})[_0x82fc('0x20')](respondWithStatusCode(_0x32693f,null))['catch'](handleError(_0x32693f,null));};exports[_0x82fc('0xbb')]=function(_0x26d79e,_0x2c1a24,_0x28f226){var _0x473782={};var _0x2231da={};var _0x4a5796;var _0x45f0e5;return db['MailAccount'][_0x82fc('0x61')]({'where':{'id':_0x26d79e[_0x82fc('0x57')]['id']}})[_0x82fc('0x20')](handleEntityNotFound(_0x2c1a24,null))[_0x82fc('0x20')](function(_0x1f5da2){if(_0x1f5da2){_0x4a5796=_0x1f5da2;_0x2231da[_0x82fc('0x44')]=_['keys'](db[_0x82fc('0xbc')]['rawAttributes']);_0x2231da[_0x82fc('0x45')]=_[_0x82fc('0x46')](_0x26d79e[_0x82fc('0x45')]);_0x2231da[_0x82fc('0x47')]=_[_0x82fc('0x49')](_0x2231da[_0x82fc('0x44')],_0x2231da[_0x82fc('0x45')]);_0x473782[_0x82fc('0x48')]=_[_0x82fc('0x49')](_0x2231da['model'],qs[_0x82fc('0x4a')](_0x26d79e[_0x82fc('0x45')][_0x82fc('0x4a')]));_0x473782[_0x82fc('0x48')]=_0x473782[_0x82fc('0x48')]['length']?_0x473782['attributes']:_0x2231da[_0x82fc('0x44')];_0x473782['order']=qs[_0x82fc('0x4e')](_0x26d79e[_0x82fc('0x45')]['sort']);_0x473782[_0x82fc('0x51')]=qs[_0x82fc('0x47')](_[_0x82fc('0x4f')](_0x26d79e[_0x82fc('0x45')],_0x2231da['filters']));if(_0x26d79e[_0x82fc('0x45')][_0x82fc('0x50')]){_0x473782[_0x82fc('0x51')]=_[_0x82fc('0x52')](_0x473782[_0x82fc('0x51')],{'$or':_[_0x82fc('0x40')](_0x473782['attributes'],function(_0x149c52){var _0x3e6882={};_0x3e6882[_0x149c52]={'$like':'%'+_0x26d79e['query'][_0x82fc('0x50')]+'%'};return _0x3e6882;})});}_0x473782=_[_0x82fc('0x52')]({},_0x473782,_0x26d79e[_0x82fc('0x53')]);return _0x4a5796[_0x82fc('0xbb')](_0x473782);}})['then'](function(_0x2ef987){if(_0x2ef987){_0x45f0e5=_0x2ef987[_0x82fc('0x4b')];if(!_0x26d79e[_0x82fc('0x45')]['hasOwnProperty'](_0x82fc('0x63'))){_0x473782[_0x82fc('0x2e')]=qs[_0x82fc('0x2e')](_0x26d79e[_0x82fc('0x45')]['limit']);_0x473782[_0x82fc('0x4d')]=qs[_0x82fc('0x4d')](_0x26d79e[_0x82fc('0x45')][_0x82fc('0x4d')]);}return _0x4a5796['getAgents'](_0x473782);}})[_0x82fc('0x20')](function(_0x50ecf5){if(_0x50ecf5){return _0x50ecf5?{'count':_0x45f0e5,'rows':_0x50ecf5}:null;}})['then'](respondWithResult(_0x2c1a24,null))[_0x82fc('0x29')](handleError(_0x2c1a24,null));}; \ No newline at end of file +var _0x816f=['$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','true','List','Contacts','DESC','from','%s\x20<%s>','email','attachments','join','server/files/attachments','auth','secure','SendMail','List\x20not\x20found','messageId','subject','attach','out','Interaction','Messages','verifySmtp','VerifySmtp','Sequelize','ValidationError','addAgents','emit','removeAgents','isArray','userMailAccount:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','juice','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../mysqldb','redis','defaults','localhost','./mailAccount.socket','register','jayson/promise','client','http','request','info','MailAccount,\x20%s,\x20%s','debug','MailAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','catch','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','then','destroy','get','MailAccounts','stack','name','send','index','MailServerIn','Imap','MailServerOut','Smtp','mandatoryDispositionPause','map','MailAccount','rawAttributes','type','key','model','keys','query','filters','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','show','Pause','intersection','options','body','params','update','describe','addDisposition','find','MailAccountId','Disposition','create','findOne','rows','removeDispositions','addAnswer','CannedAnswer','getAnswers','hasOwnProperty','isNil','active','description','cservice','cauthentication','user','cuser','password','pass','cpassword','authentication','host','port','service','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getImap','addImap','removeImap','setImap','removeSmtp','setSmtp','addInteraction','MailInteraction','ids','getInteractions','CmContact','Contact','User','Owner','fullname','Tag','Tags','tag','addApplications','sequelize','transaction','MailApplication','bulkCreate','getApplications','MailMessage'];(function(_0x95d5f4,_0x429576){var _0x2f02cf=function(_0x48e081){while(--_0x48e081){_0x95d5f4['push'](_0x95d5f4['shift']());}};_0x2f02cf(++_0x429576);}(_0x816f,0x19c));var _0xf816=function(_0x4831a9,_0x5db041){_0x4831a9=_0x4831a9-0x0;var _0x2bc67e=_0x816f[_0x4831a9];return _0x2bc67e;};'use strict';var emlformat=require(_0xf816('0x0'));var rimraf=require(_0xf816('0x1'));var zipdir=require(_0xf816('0x2'));var jsonpatch=require(_0xf816('0x3'));var rp=require(_0xf816('0x4'));var moment=require(_0xf816('0x5'));var BPromise=require(_0xf816('0x6'));var Mustache=require('mustache');var util=require(_0xf816('0x7'));var path=require(_0xf816('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xf816('0x9'));var fs=require('fs');var fs_extra=require(_0xf816('0xa'));var _=require(_0xf816('0xb'));var squel=require(_0xf816('0xc'));var crypto=require(_0xf816('0xd'));var jsforce=require(_0xf816('0xe'));var deskjs=require(_0xf816('0xf'));var toCsv=require('to-csv');var querystring=require(_0xf816('0x10'));var Papa=require('papaparse');var htmlToText=require('html-to-text');var juice=require(_0xf816('0x11'));var Redis=require(_0xf816('0x12'));var authService=require(_0xf816('0x13'));var qs=require(_0xf816('0x14'));var as=require(_0xf816('0x15'));var hardwareService=require(_0xf816('0x16'));var logger=require('../../config/logger')('api');var utils=require(_0xf816('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xf816('0x18'))['db'];config[_0xf816('0x19')]=_[_0xf816('0x1a')](config[_0xf816('0x19')],{'host':_0xf816('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xf816('0x19')]));require(_0xf816('0x1c'))[_0xf816('0x1d')](socket);var jayson=require(_0xf816('0x1e'));var client=jayson[_0xf816('0x1f')][_0xf816('0x20')]({'port':0x232b});function respondWithRpcPromise(_0x461309,_0x4407be,_0x3c6faf,_0x599aff){return new BPromise(function(_0xb95a79,_0x100653){var _0x15a11d=_0x599aff||client;return _0x15a11d[_0xf816('0x21')](_0x461309,_0x3c6faf)['then'](function(_0x77f863){logger[_0xf816('0x22')](_0xf816('0x23'),_0x4407be,'request\x20sent');logger[_0xf816('0x24')](_0xf816('0x25'),_0x4407be,_0xf816('0x26'),JSON[_0xf816('0x27')](_0x77f863));if(_0x77f863['error']){if(_0x77f863[_0xf816('0x28')]['code']===0x1f4){logger[_0xf816('0x28')]('MailAccount,\x20%s,\x20%s',_0x4407be,_0x77f863[_0xf816('0x28')][_0xf816('0x29')]);return _0x100653(_0x77f863[_0xf816('0x28')][_0xf816('0x29')]);}logger[_0xf816('0x28')]('MailAccount,\x20%s,\x20%s',_0x4407be,_0x77f863[_0xf816('0x28')][_0xf816('0x29')]);return _0xb95a79(_0x77f863[_0xf816('0x28')]['message']);}else{logger[_0xf816('0x22')]('MailAccount,\x20%s,\x20%s',_0x4407be,_0xf816('0x26'));_0xb95a79(_0x77f863['result'][_0xf816('0x29')]);}})[_0xf816('0x2a')](function(_0x58a589){logger['error'](_0xf816('0x23'),_0x4407be,_0x58a589);_0x100653(_0x58a589);});});}function respondWithStatusCode(_0x50aa15,_0x3f46b8){_0x3f46b8=_0x3f46b8||0xcc;return function(_0x5c3d0d){if(_0x5c3d0d){return _0x50aa15[_0xf816('0x2b')](_0x3f46b8);}return _0x50aa15[_0xf816('0x2c')](_0x3f46b8)[_0xf816('0x2d')]();};}function respondWithResult(_0x43061b,_0x3b4778){_0x3b4778=_0x3b4778||0xc8;return function(_0x4fac72){if(_0x4fac72){return _0x43061b[_0xf816('0x2c')](_0x3b4778)[_0xf816('0x2e')](_0x4fac72);}};}function respondWithFilteredResult(_0x4811e0,_0x33df79){return function(_0x160d84){if(_0x160d84){var _0x3e269d=typeof _0x33df79[_0xf816('0x2f')]==='undefined'&&typeof _0x33df79[_0xf816('0x30')]===_0xf816('0x31');var _0x47a6ae=_0x160d84[_0xf816('0x32')];var _0x1b001c=_0x3e269d?0x0:_0x33df79['offset'];var _0x1766b4=_0x3e269d?_0x160d84[_0xf816('0x32')]:_0x33df79[_0xf816('0x2f')]+_0x33df79[_0xf816('0x30')];var _0x1d65b4;if(_0x1766b4>=_0x47a6ae){_0x1766b4=_0x47a6ae;_0x1d65b4=0xc8;}else{_0x1d65b4=0xce;}_0x4811e0[_0xf816('0x2c')](_0x1d65b4);return _0x4811e0[_0xf816('0x33')](_0xf816('0x34'),_0x1b001c+'-'+_0x1766b4+'/'+_0x47a6ae)[_0xf816('0x2e')](_0x160d84);}return null;};}function patchUpdates(_0x27cb8a){return function(_0x5d73c0){try{jsonpatch[_0xf816('0x35')](_0x5d73c0,_0x27cb8a,!![]);}catch(_0x5bd34a){return BPromise[_0xf816('0x36')](_0x5bd34a);}return _0x5d73c0['save']();};}function saveUpdates(_0xfa7d90,_0x4df492){return function(_0x29e773){if(_0x29e773){return _0x29e773['update'](_0xfa7d90)[_0xf816('0x37')](function(_0x17abd5){return _0x17abd5;});}return null;};}function removeEntity(_0x54279e,_0x597365){return function(_0x27b241){if(_0x27b241){return _0x27b241[_0xf816('0x38')]()[_0xf816('0x37')](function(){var _0x2ac01c=_0x27b241[_0xf816('0x39')]({'plain':!![]});var _0x102522=_0xf816('0x3a');return db['UserProfileResource'][_0xf816('0x38')]({'where':{'type':_0x102522,'resourceId':_0x2ac01c['id']}})[_0xf816('0x37')](function(){return _0x27b241;});})['then'](function(){_0x54279e['status'](0xcc)[_0xf816('0x2d')]();});}};}function handleEntityNotFound(_0x26e158,_0x2680a1){return function(_0x43c7b0){if(!_0x43c7b0){_0x26e158['sendStatus'](0x194);}return _0x43c7b0;};}function handleError(_0x529c85,_0x5362e2){_0x5362e2=_0x5362e2||0x1f4;return function(_0x1680b9){logger[_0xf816('0x28')](_0x1680b9[_0xf816('0x3b')]);if(_0x1680b9[_0xf816('0x3c')]){delete _0x1680b9[_0xf816('0x3c')];}_0x529c85[_0xf816('0x2c')](_0x5362e2)[_0xf816('0x3d')](_0x1680b9);};}exports[_0xf816('0x3e')]=function(_0x2c3d0c,_0x2fb6fb){var _0xcc98b7={'include':[{'model':db[_0xf816('0x3f')],'as':_0xf816('0x40')},{'model':db[_0xf816('0x41')],'as':_0xf816('0x42')},{'model':db['Pause'],'as':_0xf816('0x43')}]},_0x7fa83a={},_0xa6962a={'count':0x0,'rows':[]};var _0x488bf6=_[_0xf816('0x44')](db[_0xf816('0x45')][_0xf816('0x46')],function(_0x1160ac){return{'name':_0x1160ac['fieldName'],'type':_0x1160ac[_0xf816('0x47')][_0xf816('0x48')]};});_0x7fa83a[_0xf816('0x49')]=_['map'](_0x488bf6,_0xf816('0x3c'));_0x7fa83a['query']=_[_0xf816('0x4a')](_0x2c3d0c[_0xf816('0x4b')]);_0x7fa83a[_0xf816('0x4c')]=_['intersection'](_0x7fa83a[_0xf816('0x49')],_0x7fa83a[_0xf816('0x4b')]);_0xcc98b7[_0xf816('0x4d')]=_['intersection'](_0x7fa83a['model'],qs[_0xf816('0x4e')](_0x2c3d0c[_0xf816('0x4b')][_0xf816('0x4e')]));_0xcc98b7[_0xf816('0x4d')]=_0xcc98b7[_0xf816('0x4d')][_0xf816('0x4f')]?_0xcc98b7['attributes']:_0x7fa83a['model'];if(!_0x2c3d0c['query']['hasOwnProperty'](_0xf816('0x50'))){_0xcc98b7[_0xf816('0x30')]=qs[_0xf816('0x30')](_0x2c3d0c[_0xf816('0x4b')]['limit']);_0xcc98b7[_0xf816('0x2f')]=qs[_0xf816('0x2f')](_0x2c3d0c[_0xf816('0x4b')][_0xf816('0x2f')]);}_0xcc98b7[_0xf816('0x51')]=qs[_0xf816('0x52')](_0x2c3d0c['query'][_0xf816('0x52')]);_0xcc98b7[_0xf816('0x53')]=qs['filters'](_[_0xf816('0x54')](_0x2c3d0c[_0xf816('0x4b')],_0x7fa83a[_0xf816('0x4c')]),_0x488bf6);if(_0x2c3d0c[_0xf816('0x4b')][_0xf816('0x55')]){_0xcc98b7[_0xf816('0x53')]=_[_0xf816('0x56')](_0xcc98b7[_0xf816('0x53')],{'$or':_[_0xf816('0x44')](_0x488bf6,function(_0x262713){if(_0x262713[_0xf816('0x47')]!==_0xf816('0x57')){var _0x5328d4={};_0x5328d4[_0x262713[_0xf816('0x3c')]]={'$like':'%'+_0x2c3d0c[_0xf816('0x4b')]['filter']+'%'};return _0x5328d4;}})});}_0xcc98b7=_[_0xf816('0x56')]({},_0xcc98b7,_0x2c3d0c['options']);var _0x200f98={'where':_0xcc98b7[_0xf816('0x53')]};return db[_0xf816('0x45')][_0xf816('0x32')](_0x200f98)[_0xf816('0x37')](function(_0x5a692b){_0xa6962a['count']=_0x5a692b;if(_0x2c3d0c[_0xf816('0x4b')][_0xf816('0x58')]){_0xcc98b7[_0xf816('0x59')]=[{'all':!![]}];}return db[_0xf816('0x45')][_0xf816('0x5a')](_0xcc98b7);})[_0xf816('0x37')](function(_0x1e9dd9){_0xa6962a['rows']=_0x1e9dd9;return _0xa6962a;})[_0xf816('0x37')](respondWithFilteredResult(_0x2fb6fb,_0xcc98b7))[_0xf816('0x2a')](handleError(_0x2fb6fb,null));};exports[_0xf816('0x5b')]=function(_0x53ce03,_0x42af98){var _0x25377f={'raw':![],'where':{'id':_0x53ce03['params']['id']},'include':[{'model':db['MailServerIn'],'as':_0xf816('0x40')},{'model':db[_0xf816('0x41')],'as':_0xf816('0x42')},{'model':db[_0xf816('0x5c')],'as':_0xf816('0x43')}]},_0x4b80e6={};_0x4b80e6[_0xf816('0x49')]=_[_0xf816('0x4a')](db[_0xf816('0x45')]['rawAttributes']);_0x4b80e6[_0xf816('0x4b')]=_[_0xf816('0x4a')](_0x53ce03[_0xf816('0x4b')]);_0x4b80e6[_0xf816('0x4c')]=_[_0xf816('0x5d')](_0x4b80e6[_0xf816('0x49')],_0x4b80e6[_0xf816('0x4b')]);_0x25377f[_0xf816('0x4d')]=_[_0xf816('0x5d')](_0x4b80e6['model'],qs[_0xf816('0x4e')](_0x53ce03[_0xf816('0x4b')][_0xf816('0x4e')]));_0x25377f['attributes']=_0x25377f[_0xf816('0x4d')]['length']?_0x25377f['attributes']:_0x4b80e6[_0xf816('0x49')];if(_0x53ce03[_0xf816('0x4b')][_0xf816('0x58')]){_0x25377f[_0xf816('0x59')]=[{'all':!![]}];}_0x25377f=_['merge']({},_0x25377f,_0x53ce03[_0xf816('0x5e')]);return db[_0xf816('0x45')]['find'](_0x25377f)[_0xf816('0x37')](handleEntityNotFound(_0x42af98,null))[_0xf816('0x37')](respondWithResult(_0x42af98,null))[_0xf816('0x2a')](handleError(_0x42af98,null));};exports['update']=function(_0x1cef98,_0x54bb04){if(_0x1cef98[_0xf816('0x5f')]['id']){delete _0x1cef98['body']['id'];}return db[_0xf816('0x45')]['find']({'where':{'id':_0x1cef98[_0xf816('0x60')]['id']},'include':[{'model':db['MailServerIn'],'as':_0xf816('0x40')},{'model':db[_0xf816('0x41')],'as':'Smtp'},{'model':db[_0xf816('0x5c')],'as':_0xf816('0x43')}]})[_0xf816('0x37')](handleEntityNotFound(_0x54bb04,null))['then'](saveUpdates(_0x1cef98[_0xf816('0x5f')],null))[_0xf816('0x37')](function(_0x52949d){if(_0x52949d&&_0x1cef98['body']['Imap']){return db[_0xf816('0x3f')][_0xf816('0x61')](_0x1cef98[_0xf816('0x5f')][_0xf816('0x40')],{'where':{'MailAccountId':_0x52949d['id']}})[_0xf816('0x37')](function(){return _0x52949d;});}return _0x52949d;})[_0xf816('0x37')](function(_0x3a022f){if(_0x3a022f&&_0x1cef98[_0xf816('0x5f')][_0xf816('0x42')]){return db[_0xf816('0x41')][_0xf816('0x61')](_0x1cef98['body'][_0xf816('0x42')],{'where':{'MailAccountId':_0x3a022f['id']}})[_0xf816('0x37')](function(){return _0x3a022f;});}return _0x3a022f;})[_0xf816('0x37')](respondWithResult(_0x54bb04,null))[_0xf816('0x2a')](handleError(_0x54bb04,null));};exports[_0xf816('0x62')]=function(_0x224aee,_0x4fb48a){return db[_0xf816('0x45')][_0xf816('0x62')]()['then'](respondWithResult(_0x4fb48a,null))['catch'](handleError(_0x4fb48a,null));};exports[_0xf816('0x63')]=function(_0x5d2cec,_0x297b01,_0x4e5656){if(_0x5d2cec['body']['id']){delete _0x5d2cec[_0xf816('0x5f')]['id'];}return db[_0xf816('0x45')][_0xf816('0x64')]({'where':{'id':_0x5d2cec['params']['id']}})[_0xf816('0x37')](handleEntityNotFound(_0x297b01,null))[_0xf816('0x37')](function(_0x18b003){if(_0x18b003){_0x5d2cec[_0xf816('0x5f')][_0xf816('0x65')]=_0x18b003['id'];return db[_0xf816('0x66')][_0xf816('0x67')](_0x5d2cec[_0xf816('0x5f')]);}})['then'](respondWithResult(_0x297b01,null))[_0xf816('0x2a')](handleError(_0x297b01,null));};exports['getDispositions']=function(_0x1bb305,_0x4a8c66,_0x578977){var _0x4eb609={'raw':![],'where':{}};var _0x4c3e4b={};var _0x47860d={'count':0x0,'rows':[]};return db[_0xf816('0x45')][_0xf816('0x68')]({'where':{'id':_0x1bb305[_0xf816('0x60')]['id']}})[_0xf816('0x37')](handleEntityNotFound(_0x4a8c66,null))[_0xf816('0x37')](function(_0x40a7d6){if(_0x40a7d6){_0x4c3e4b['model']=_[_0xf816('0x4a')](db[_0xf816('0x66')][_0xf816('0x46')]);_0x4c3e4b[_0xf816('0x4b')]=_[_0xf816('0x4a')](_0x1bb305['query']);_0x4c3e4b[_0xf816('0x4c')]=_[_0xf816('0x5d')](_0x4c3e4b[_0xf816('0x49')],_0x4c3e4b[_0xf816('0x4b')]);_0x4eb609[_0xf816('0x4d')]=_[_0xf816('0x5d')](_0x4c3e4b[_0xf816('0x49')],qs[_0xf816('0x4e')](_0x1bb305[_0xf816('0x4b')]['fields']));_0x4eb609[_0xf816('0x4d')]=_0x4eb609[_0xf816('0x4d')][_0xf816('0x4f')]?_0x4eb609[_0xf816('0x4d')]:_0x4c3e4b[_0xf816('0x49')];if(!_0x1bb305[_0xf816('0x4b')]['hasOwnProperty']('nolimit')){_0x4eb609[_0xf816('0x30')]=qs[_0xf816('0x30')](_0x1bb305['query']['limit']);_0x4eb609[_0xf816('0x2f')]=qs[_0xf816('0x2f')](_0x1bb305[_0xf816('0x4b')][_0xf816('0x2f')]);}_0x4eb609['order']=qs[_0xf816('0x52')](_0x1bb305[_0xf816('0x4b')]['sort']);_0x4eb609[_0xf816('0x53')]=qs[_0xf816('0x4c')](_[_0xf816('0x54')](_0x1bb305[_0xf816('0x4b')],_0x4c3e4b[_0xf816('0x4c')]));_0x4eb609['where']['MailAccountId']=_0x40a7d6['id'];if(_0x1bb305[_0xf816('0x4b')]['filter']){_0x4eb609['where']=_[_0xf816('0x56')](_0x4eb609[_0xf816('0x53')],{'$or':_[_0xf816('0x44')](_0x4eb609[_0xf816('0x4d')],function(_0x29ad19){var _0x3a906e={};_0x3a906e[_0x29ad19]={'$like':'%'+_0x1bb305[_0xf816('0x4b')]['filter']+'%'};return _0x3a906e;})});}_0x4eb609=_[_0xf816('0x56')]({},_0x4eb609,_0x1bb305['options']);return db[_0xf816('0x66')][_0xf816('0x32')]({'where':_0x4eb609[_0xf816('0x53')]})[_0xf816('0x37')](function(_0x4c7fcc){_0x47860d[_0xf816('0x32')]=_0x4c7fcc;if(_0x1bb305['query'][_0xf816('0x58')]){_0x4eb609[_0xf816('0x59')]=[{'all':!![]}];}return db['Disposition'][_0xf816('0x5a')](_0x4eb609);})[_0xf816('0x37')](function(_0x23d667){_0x47860d[_0xf816('0x69')]=_0x23d667;return _0x47860d;});}})['then'](respondWithFilteredResult(_0x4a8c66,_0x4eb609))[_0xf816('0x2a')](handleError(_0x4a8c66,null));};exports[_0xf816('0x6a')]=function(_0x405c4e,_0x17c375,_0x4a6b82){return db[_0xf816('0x45')][_0xf816('0x64')]({'where':{'id':_0x405c4e[_0xf816('0x60')]['id']}})[_0xf816('0x37')](handleEntityNotFound(_0x17c375,null))[_0xf816('0x37')](function(_0x30cf03){if(_0x30cf03){return _0x30cf03['removeDispositions'](_0x405c4e[_0xf816('0x4b')]['ids']);}})[_0xf816('0x37')](respondWithStatusCode(_0x17c375,null))[_0xf816('0x2a')](handleError(_0x17c375,null));};exports[_0xf816('0x6b')]=function(_0x1517a0,_0xf4728c,_0x30c41b){if(_0x1517a0[_0xf816('0x5f')]['id']){delete _0x1517a0['body']['id'];}return db[_0xf816('0x45')][_0xf816('0x64')]({'where':{'id':_0x1517a0[_0xf816('0x60')]['id']}})[_0xf816('0x37')](handleEntityNotFound(_0xf4728c,null))['then'](function(_0x28b474){if(_0x28b474){_0x1517a0['body'][_0xf816('0x65')]=_0x28b474['id'];return db[_0xf816('0x6c')][_0xf816('0x67')](_0x1517a0[_0xf816('0x5f')]);}})[_0xf816('0x37')](respondWithResult(_0xf4728c,null))[_0xf816('0x2a')](handleError(_0xf4728c,null));};exports[_0xf816('0x6d')]=function(_0x4b66f7,_0x4e92a7,_0xecfbfc){var _0x548a60={'raw':![],'where':{}};var _0x1c3d33={};var _0x4c5269={'count':0x0,'rows':[]};return db[_0xf816('0x45')]['findOne']({'where':{'id':_0x4b66f7[_0xf816('0x60')]['id']}})[_0xf816('0x37')](handleEntityNotFound(_0x4e92a7,null))[_0xf816('0x37')](function(_0x5c96e3){if(_0x5c96e3){_0x1c3d33[_0xf816('0x49')]=_[_0xf816('0x4a')](db[_0xf816('0x6c')][_0xf816('0x46')]);_0x1c3d33['query']=_[_0xf816('0x4a')](_0x4b66f7[_0xf816('0x4b')]);_0x1c3d33[_0xf816('0x4c')]=_[_0xf816('0x5d')](_0x1c3d33[_0xf816('0x49')],_0x1c3d33['query']);_0x548a60[_0xf816('0x4d')]=_[_0xf816('0x5d')](_0x1c3d33[_0xf816('0x49')],qs[_0xf816('0x4e')](_0x4b66f7[_0xf816('0x4b')][_0xf816('0x4e')]));_0x548a60[_0xf816('0x4d')]=_0x548a60[_0xf816('0x4d')][_0xf816('0x4f')]?_0x548a60['attributes']:_0x1c3d33['model'];if(!_0x4b66f7['query'][_0xf816('0x6e')](_0xf816('0x50'))){_0x548a60[_0xf816('0x30')]=qs[_0xf816('0x30')](_0x4b66f7[_0xf816('0x4b')][_0xf816('0x30')]);_0x548a60[_0xf816('0x2f')]=qs['offset'](_0x4b66f7[_0xf816('0x4b')][_0xf816('0x2f')]);}_0x548a60[_0xf816('0x51')]=qs['sort'](_0x4b66f7[_0xf816('0x4b')][_0xf816('0x52')]);_0x548a60[_0xf816('0x53')]=qs[_0xf816('0x4c')](_[_0xf816('0x54')](_0x4b66f7['query'],_0x1c3d33['filters']));_0x548a60[_0xf816('0x53')]['MailAccountId']=_0x5c96e3['id'];if(_0x4b66f7[_0xf816('0x4b')][_0xf816('0x55')]){_0x548a60[_0xf816('0x53')]=_['merge'](_0x548a60['where'],{'$or':_[_0xf816('0x44')](_0x548a60[_0xf816('0x4d')],function(_0x63bdb1){var _0x410608={};_0x410608[_0x63bdb1]={'$like':'%'+_0x4b66f7[_0xf816('0x4b')][_0xf816('0x55')]+'%'};return _0x410608;})});}_0x548a60=_[_0xf816('0x56')]({},_0x548a60,_0x4b66f7['options']);return db[_0xf816('0x6c')]['count']({'where':_0x548a60['where']})[_0xf816('0x37')](function(_0x4cf075){_0x4c5269['count']=_0x4cf075;if(_0x4b66f7[_0xf816('0x4b')][_0xf816('0x58')]){_0x548a60['include']=[{'all':!![]}];}return db['CannedAnswer'][_0xf816('0x5a')](_0x548a60);})[_0xf816('0x37')](function(_0x224196){_0x4c5269[_0xf816('0x69')]=_0x224196;return _0x4c5269;});}})[_0xf816('0x37')](respondWithFilteredResult(_0x4e92a7,_0x548a60))[_0xf816('0x2a')](handleError(_0x4e92a7,null));};exports['removeAnswers']=function(_0xd60f99,_0x1ee46c,_0xcd104e){return db['MailAccount']['find']({'where':{'id':_0xd60f99['params']['id']}})['then'](handleEntityNotFound(_0x1ee46c,null))[_0xf816('0x37')](function(_0x38b372){if(_0x38b372){return _0x38b372['removeAnswers'](_0xd60f99[_0xf816('0x4b')]['ids']);}})['then'](respondWithStatusCode(_0x1ee46c,null))[_0xf816('0x2a')](handleError(_0x1ee46c,null));};exports[_0xf816('0x67')]=function(_0x381dea,_0x3493e4){var _0x35cc6={'name':_0x381dea[_0xf816('0x5f')][_0xf816('0x3c')],'key':_0x381dea['body'][_0xf816('0x48')],'email':_0x381dea[_0xf816('0x5f')]['email'],'ListId':_0x381dea['body']['ListId'],'active':!_[_0xf816('0x6f')](_0x381dea[_0xf816('0x5f')][_0xf816('0x70')])?_0x381dea[_0xf816('0x5f')][_0xf816('0x70')]:!![],'description':_0x381dea[_0xf816('0x5f')][_0xf816('0x71')]||null,'Imap':{},'Smtp':{}};if(_[_0xf816('0x6f')](_0x381dea[_0xf816('0x5f')][_0xf816('0x72')])){if(_0x381dea[_0xf816('0x5f')][_0xf816('0x73')]){_0x35cc6[_0xf816('0x40')][_0xf816('0x74')]=_0x35cc6[_0xf816('0x42')][_0xf816('0x74')]=_0x381dea['body'][_0xf816('0x75')];_0x35cc6[_0xf816('0x40')][_0xf816('0x76')]=_0x35cc6[_0xf816('0x42')][_0xf816('0x77')]=_0x381dea[_0xf816('0x5f')][_0xf816('0x78')];}else{_0x35cc6[_0xf816('0x40')][_0xf816('0x79')]=_0x35cc6[_0xf816('0x42')][_0xf816('0x79')]=![];}_0x35cc6[_0xf816('0x40')][_0xf816('0x7a')]=_0x381dea['body']['Imap']['host'];_0x35cc6['Imap'][_0xf816('0x7b')]=_0x381dea[_0xf816('0x5f')][_0xf816('0x40')][_0xf816('0x7b')];_0x35cc6[_0xf816('0x42')][_0xf816('0x7a')]=_0x381dea[_0xf816('0x5f')][_0xf816('0x42')][_0xf816('0x7a')];_0x35cc6[_0xf816('0x42')][_0xf816('0x7b')]=_0x381dea[_0xf816('0x5f')]['Smtp'][_0xf816('0x7b')];}else{_0x35cc6[_0xf816('0x40')][_0xf816('0x7c')]=_0x35cc6[_0xf816('0x42')]['service']=_0x381dea[_0xf816('0x5f')][_0xf816('0x72')];_0x35cc6[_0xf816('0x40')][_0xf816('0x74')]=_0x35cc6['Smtp'][_0xf816('0x74')]=_0x381dea[_0xf816('0x5f')]['cuser'];_0x35cc6['Imap'][_0xf816('0x76')]=_0x35cc6[_0xf816('0x42')][_0xf816('0x77')]=_0x381dea[_0xf816('0x5f')]['cpassword'];}return db['MailAccount']['create'](_0x35cc6,{'include':[{'model':db[_0xf816('0x41')],'as':_0xf816('0x42')},{'model':db[_0xf816('0x3f')],'as':_0xf816('0x40')}]})[_0xf816('0x37')](function(_0x32a043){var _0x423b9a=_0x381dea[_0xf816('0x74')]['get']({'plain':!![]});if(!_0x423b9a)throw new Error(_0xf816('0x7d'));if(_0x423b9a[_0xf816('0x7e')]===_0xf816('0x74')){var _0x2a82e3=_0x32a043['get']({'plain':!![]});return db['UserProfileSection']['find']({'where':{'name':'MailAccounts','userProfileId':_0x423b9a[_0xf816('0x7f')]},'raw':!![]})[_0xf816('0x37')](function(_0x5ac0f2){if(_0x5ac0f2&&_0x5ac0f2['autoAssociation']===0x0){return db[_0xf816('0x80')][_0xf816('0x67')]({'name':_0x2a82e3[_0xf816('0x3c')],'resourceId':_0x2a82e3['id'],'type':_0x5ac0f2[_0xf816('0x3c')],'sectionId':_0x5ac0f2['id']},{})[_0xf816('0x37')](function(){return _0x32a043;});}else{return _0x32a043;}})[_0xf816('0x2a')](function(_0x5985ff){logger[_0xf816('0x28')](_0xf816('0x81'),_0x5985ff);throw _0x5985ff;});}return _0x32a043;})[_0xf816('0x37')](respondWithResult(_0x3493e4,0xc9))[_0xf816('0x2a')](handleError(_0x3493e4,null));};exports['getImap']=function(_0x4e9a92,_0x1ee84e,_0x4abcfc){return db[_0xf816('0x45')][_0xf816('0x68')]({'where':{'id':_0x4e9a92[_0xf816('0x60')]['id']}})[_0xf816('0x37')](handleEntityNotFound(_0x1ee84e,null))[_0xf816('0x37')](function(_0x1e2386){if(_0x1e2386){return _0x1e2386[_0xf816('0x82')]();}return null;})[_0xf816('0x37')](respondWithResult(_0x1ee84e,null))['catch'](handleError(_0x1ee84e,null));};exports[_0xf816('0x83')]=function(_0x2ac8a9,_0x1fa4f4,_0x15bb0a){if(_0x2ac8a9[_0xf816('0x5f')]['id']){delete _0x2ac8a9[_0xf816('0x5f')]['id'];}return db[_0xf816('0x45')][_0xf816('0x64')]({'where':{'id':_0x2ac8a9[_0xf816('0x60')]['id']}})[_0xf816('0x37')](handleEntityNotFound(_0x1fa4f4,null))['then'](function(_0x472b20){if(_0x472b20){_0x2ac8a9['body']['MailAccountId']=_0x472b20['id'];return db[_0xf816('0x3f')][_0xf816('0x67')](_0x2ac8a9['body']);}})[_0xf816('0x37')](respondWithResult(_0x1fa4f4,null))[_0xf816('0x2a')](handleError(_0x1fa4f4,null));};exports[_0xf816('0x84')]=function(_0x2cd658,_0xb02797,_0x2ecd0a){return db[_0xf816('0x45')][_0xf816('0x68')]({'where':{'id':_0x2cd658['params']['id']}})[_0xf816('0x37')](handleEntityNotFound(_0xb02797,null))[_0xf816('0x37')](function(_0x34b552){if(_0x34b552){return _0x34b552[_0xf816('0x85')](null);}return null;})[_0xf816('0x37')](respondWithStatusCode(_0xb02797,null))[_0xf816('0x2a')](handleError(_0xb02797,null));};exports['getSmtp']=function(_0x47f038,_0x2e8690,_0x192ee8){return db[_0xf816('0x45')][_0xf816('0x68')]({'where':{'id':_0x47f038[_0xf816('0x60')]['id']}})['then'](handleEntityNotFound(_0x2e8690,null))[_0xf816('0x37')](function(_0x5da505){if(_0x5da505){return _0x5da505['getSmtp']();}return null;})[_0xf816('0x37')](respondWithResult(_0x2e8690,null))[_0xf816('0x2a')](handleError(_0x2e8690,null));};exports['addSmtp']=function(_0x2820f4,_0x49f688,_0x559fdc){if(_0x2820f4['body']['id']){delete _0x2820f4[_0xf816('0x5f')]['id'];}return db[_0xf816('0x45')]['find']({'where':{'id':_0x2820f4['params']['id']}})[_0xf816('0x37')](handleEntityNotFound(_0x49f688,null))[_0xf816('0x37')](function(_0x1f294a){if(_0x1f294a){_0x2820f4[_0xf816('0x5f')][_0xf816('0x65')]=_0x1f294a['id'];return db[_0xf816('0x41')][_0xf816('0x67')](_0x2820f4[_0xf816('0x5f')]);}})[_0xf816('0x37')](respondWithResult(_0x49f688,null))[_0xf816('0x2a')](handleError(_0x49f688,null));};exports[_0xf816('0x86')]=function(_0x419654,_0x41acf3,_0x565126){return db['MailAccount']['findOne']({'where':{'id':_0x419654['params']['id']}})['then'](handleEntityNotFound(_0x41acf3,null))['then'](function(_0x3fa95d){if(_0x3fa95d){return _0x3fa95d[_0xf816('0x87')](null);}return null;})[_0xf816('0x37')](respondWithStatusCode(_0x41acf3,null))[_0xf816('0x2a')](handleError(_0x41acf3,null));};exports[_0xf816('0x88')]=function(_0x9497ca,_0xb322c0,_0x238789){return db[_0xf816('0x89')][_0xf816('0x64')]({'where':{'id':_0x9497ca[_0xf816('0x60')]['id']}})[_0xf816('0x37')](handleEntityNotFound(_0xb322c0,null))[_0xf816('0x37')](function(_0x5a3032){if(_0x5a3032){return _0x5a3032['addInteraction'](_0x9497ca[_0xf816('0x5f')][_0xf816('0x8a')],_['omit'](_0x9497ca[_0xf816('0x5f')],[_0xf816('0x8a'),'id'])||{});}})[_0xf816('0x37')](respondWithResult(_0xb322c0,null))['catch'](handleError(_0xb322c0,null));};exports[_0xf816('0x8b')]=function(_0x14428d,_0x2e025b,_0x3b1aa2){var _0x39e054={'raw':![],'where':{}};var _0x38e70c={};var _0x6562c6={'count':0x0,'rows':[]};return db[_0xf816('0x45')][_0xf816('0x68')]({'where':{'id':_0x14428d['params']['id']}})[_0xf816('0x37')](handleEntityNotFound(_0x2e025b,null))[_0xf816('0x37')](function(_0x402f01){if(_0x402f01){_0x38e70c['model']=_[_0xf816('0x4a')](db[_0xf816('0x89')][_0xf816('0x46')]);_0x38e70c[_0xf816('0x4b')]=_[_0xf816('0x4a')](_0x14428d[_0xf816('0x4b')]);_0x38e70c['filters']=_['intersection'](_0x38e70c[_0xf816('0x49')],_0x38e70c[_0xf816('0x4b')]);_0x39e054[_0xf816('0x4d')]=_['intersection'](_0x38e70c[_0xf816('0x49')],qs[_0xf816('0x4e')](_0x14428d[_0xf816('0x4b')][_0xf816('0x4e')]));_0x39e054[_0xf816('0x4d')]=_0x39e054[_0xf816('0x4d')][_0xf816('0x4f')]?_0x39e054[_0xf816('0x4d')]:_0x38e70c['model'];if(!_0x14428d[_0xf816('0x4b')][_0xf816('0x6e')](_0xf816('0x50'))){_0x39e054[_0xf816('0x30')]=qs[_0xf816('0x30')](_0x14428d[_0xf816('0x4b')][_0xf816('0x30')]);_0x39e054[_0xf816('0x2f')]=qs[_0xf816('0x2f')](_0x14428d[_0xf816('0x4b')][_0xf816('0x2f')]);}_0x39e054[_0xf816('0x51')]=qs[_0xf816('0x52')](_0x14428d['query'][_0xf816('0x52')]);_0x39e054[_0xf816('0x53')]=qs[_0xf816('0x4c')](_[_0xf816('0x54')](_0x14428d[_0xf816('0x4b')],_0x38e70c['filters']));_0x39e054['where'][_0xf816('0x65')]=_0x402f01['id'];if(_0x14428d[_0xf816('0x4b')]['filter']){_0x39e054[_0xf816('0x53')]=_[_0xf816('0x56')](_0x39e054['where'],{'$or':_['map'](_0x39e054['attributes'],function(_0x52141d){var _0x1e7f67={};_0x1e7f67[_0x52141d]={'$like':'%'+_0x14428d[_0xf816('0x4b')][_0xf816('0x55')]+'%'};return _0x1e7f67;})});}_0x39e054=_[_0xf816('0x56')]({},_0x39e054,_0x14428d[_0xf816('0x5e')]);return db[_0xf816('0x89')][_0xf816('0x32')]({'where':_0x39e054[_0xf816('0x53')]})[_0xf816('0x37')](function(_0xfa9ab7){_0x6562c6['count']=_0xfa9ab7;if(_0x14428d[_0xf816('0x4b')][_0xf816('0x58')]){_0x39e054['include']=[{'model':db[_0xf816('0x8c')],'as':_0xf816('0x8d'),'required':![]},{'model':db[_0xf816('0x8e')],'as':_0xf816('0x8f'),'attributes':[_0xf816('0x3c'),_0xf816('0x90'),'internal'],'required':![]},{'model':db[_0xf816('0x91')],'as':_0xf816('0x92'),'attributes':['id',_0xf816('0x3c'),'color'],'where':_0x14428d[_0xf816('0x4b')][_0xf816('0x93')]?{'id':_0x14428d[_0xf816('0x4b')][_0xf816('0x93')]}:undefined,'required':_0x14428d[_0xf816('0x4b')][_0xf816('0x93')]?!![]:![]}];}return db['MailInteraction'][_0xf816('0x5a')](_0x39e054);})['then'](function(_0x1c5099){_0x6562c6['rows']=_0x1c5099;return _0x6562c6;});}})[_0xf816('0x37')](respondWithFilteredResult(_0x2e025b,_0x39e054))[_0xf816('0x2a')](handleError(_0x2e025b,null));};exports[_0xf816('0x94')]=function(_0x5b0514,_0x5ec988,_0x3e7692){return db[_0xf816('0x45')][_0xf816('0x68')]({'where':{'id':_0x5b0514[_0xf816('0x60')]['id']}})[_0xf816('0x37')](handleEntityNotFound(_0x5ec988,null))[_0xf816('0x37')](function(_0x5e6353){if(_0x5e6353){return db[_0xf816('0x95')][_0xf816('0x96')](function(_0x1077d7){return db['MailApplication'][_0xf816('0x38')]({'where':{'MailAccountId':_0x5b0514[_0xf816('0x60')]['id']},'transaction':_0x1077d7})['then'](function(_0x5b93e8){var _0x259870=_[_0xf816('0x44')](_0x5b0514[_0xf816('0x5f')],function(_0x501de6){_0x501de6[_0xf816('0x65')]=_0x5b0514[_0xf816('0x60')]['id'];return _0x501de6;});return db[_0xf816('0x97')][_0xf816('0x98')](_0x259870,{'transaction':_0x1077d7});});})[_0xf816('0x37')](function(){return db[_0xf816('0x97')]['findAndCountAll']({'where':{'MailAccountId':_0x5b0514[_0xf816('0x60')]['id']},'order':'priority'});});}})['then'](respondWithResult(_0x5ec988,null))['catch'](handleError(_0x5ec988,null));};exports[_0xf816('0x99')]=function(_0xdc616c,_0x5a142c,_0x1626d0){var _0x3aed46={};var _0x676a1a={};var _0x5bd83c;var _0x557572;return db[_0xf816('0x45')][_0xf816('0x68')]({'where':{'id':_0xdc616c[_0xf816('0x60')]['id']}})[_0xf816('0x37')](handleEntityNotFound(_0x5a142c,null))[_0xf816('0x37')](function(_0x10d50c){if(_0x10d50c){_0x5bd83c=_0x10d50c;_0x676a1a[_0xf816('0x49')]=_[_0xf816('0x4a')](db['MailApplication'][_0xf816('0x46')]);_0x676a1a[_0xf816('0x4b')]=_[_0xf816('0x4a')](_0xdc616c[_0xf816('0x4b')]);_0x676a1a[_0xf816('0x4c')]=_['intersection'](_0x676a1a[_0xf816('0x49')],_0x676a1a['query']);_0x3aed46['attributes']=_['intersection'](_0x676a1a[_0xf816('0x49')],qs[_0xf816('0x4e')](_0xdc616c[_0xf816('0x4b')][_0xf816('0x4e')]));_0x3aed46['attributes']=_0x3aed46[_0xf816('0x4d')][_0xf816('0x4f')]?_0x3aed46[_0xf816('0x4d')]:_0x676a1a[_0xf816('0x49')];_0x3aed46[_0xf816('0x51')]=qs['sort'](_0xdc616c['query'][_0xf816('0x52')]);_0x3aed46[_0xf816('0x53')]=qs[_0xf816('0x4c')](_['pick'](_0xdc616c[_0xf816('0x4b')],_0x676a1a[_0xf816('0x4c')]));if(_0xdc616c[_0xf816('0x4b')][_0xf816('0x55')]){_0x3aed46[_0xf816('0x53')]=_[_0xf816('0x56')](_0x3aed46[_0xf816('0x53')],{'$or':_[_0xf816('0x44')](_0x3aed46['attributes'],function(_0x2eb28d){var _0xd203a2={};_0xd203a2[_0x2eb28d]={'$like':'%'+_0xdc616c[_0xf816('0x4b')]['filter']+'%'};return _0xd203a2;})});}_0x3aed46=_['merge']({},_0x3aed46,_0xdc616c['options']);return _0x5bd83c['getApplications'](_0x3aed46);}})[_0xf816('0x37')](function(_0x59cbf3){if(_0x59cbf3){_0x557572=_0x59cbf3[_0xf816('0x4f')];if(!_0xdc616c[_0xf816('0x4b')][_0xf816('0x6e')](_0xf816('0x50'))){_0x3aed46[_0xf816('0x30')]=qs['limit'](_0xdc616c[_0xf816('0x4b')][_0xf816('0x30')]);_0x3aed46[_0xf816('0x2f')]=qs[_0xf816('0x2f')](_0xdc616c[_0xf816('0x4b')][_0xf816('0x2f')]);}return _0x5bd83c['getApplications'](_0x3aed46);}})[_0xf816('0x37')](function(_0x4e38cb){if(_0x4e38cb){return _0x4e38cb?{'count':_0x557572,'rows':_0x4e38cb}:null;}})[_0xf816('0x37')](respondWithResult(_0x5a142c,null))[_0xf816('0x2a')](handleError(_0x5a142c,null));};exports['getMessages']=function(_0x4791f4,_0x41abc6,_0x446bca){var _0x49d534={'raw':!![],'where':{}};var _0x24869b={};var _0x16a3f1={'count':0x0,'rows':[]};return db[_0xf816('0x45')]['findOne']({'where':{'id':_0x4791f4['params']['id']}})['then'](handleEntityNotFound(_0x41abc6,null))['then'](function(_0x1cf18d){if(_0x1cf18d){_0x24869b[_0xf816('0x49')]=_[_0xf816('0x4a')](db[_0xf816('0x9a')][_0xf816('0x46')]);_0x24869b[_0xf816('0x4b')]=_[_0xf816('0x4a')](_0x4791f4[_0xf816('0x4b')]);_0x24869b[_0xf816('0x4c')]=_['intersection'](_0x24869b[_0xf816('0x49')],_0x24869b['query']);_0x49d534[_0xf816('0x4d')]=_['intersection'](_0x24869b[_0xf816('0x49')],qs[_0xf816('0x4e')](_0x4791f4[_0xf816('0x4b')][_0xf816('0x4e')]));_0x49d534[_0xf816('0x4d')]=_0x49d534[_0xf816('0x4d')][_0xf816('0x4f')]?_0x49d534[_0xf816('0x4d')]:_0x24869b['model'];if(!_0x4791f4[_0xf816('0x4b')][_0xf816('0x6e')](_0xf816('0x50'))){_0x49d534[_0xf816('0x30')]=qs[_0xf816('0x30')](_0x4791f4[_0xf816('0x4b')][_0xf816('0x30')]);_0x49d534[_0xf816('0x2f')]=qs[_0xf816('0x2f')](_0x4791f4[_0xf816('0x4b')][_0xf816('0x2f')]);}_0x49d534[_0xf816('0x51')]=qs[_0xf816('0x52')](_0x4791f4[_0xf816('0x4b')][_0xf816('0x52')]);_0x49d534['where']=qs[_0xf816('0x4c')](_[_0xf816('0x54')](_0x4791f4['query'],_0x24869b[_0xf816('0x4c')]));_0x49d534[_0xf816('0x53')][_0xf816('0x65')]=_0x1cf18d['id'];if(_0x4791f4[_0xf816('0x4b')][_0xf816('0x55')]){_0x49d534[_0xf816('0x53')]=_['merge'](_0x49d534[_0xf816('0x53')],{'$or':_[_0xf816('0x44')](_0x49d534[_0xf816('0x4d')],function(_0x214a83){var _0x4109d0={};_0x4109d0[_0x214a83]={'$like':'%'+_0x4791f4[_0xf816('0x4b')]['filter']+'%'};return _0x4109d0;})});}if(_0x4791f4[_0xf816('0x4b')][_0xf816('0x9b')]){var _0x158082=_0x4791f4[_0xf816('0x4b')][_0xf816('0x9b')][_0xf816('0x9c')](',');var _0x32a3cc={};_0x32a3cc[_0x158082[0x0]]={'$gte':moment(_0x158082[0x1])[_0xf816('0x9d')](_0xf816('0x9e'))};_0x49d534[_0xf816('0x53')]=_['merge'](_0x49d534[_0xf816('0x53')],_0x32a3cc);}_0x49d534=_['merge']({},_0x49d534,_0x4791f4[_0xf816('0x5e')]);return db['MailMessage'][_0xf816('0x32')]({'where':_0x49d534[_0xf816('0x53')]})[_0xf816('0x37')](function(_0x5007e7){_0x16a3f1[_0xf816('0x32')]=_0x5007e7;if(_0x4791f4[_0xf816('0x4b')][_0xf816('0x58')]){_0x49d534['include']=[{'all':!![]}];}return db[_0xf816('0x9a')]['findAll'](_0x49d534);})[_0xf816('0x37')](function(_0x35ff35){if(_0x4791f4['query']['inlineCss']===_0xf816('0x9f')){for(var _0x561d0d=0x0;_0x561d0d<_0x35ff35[_0xf816('0x4f')];_0x561d0d++){_0x35ff35[_0x561d0d][_0xf816('0x5f')]=juice(_0x35ff35[_0x561d0d][_0xf816('0x5f')]);}}_0x16a3f1[_0xf816('0x69')]=_0x35ff35;return _0x16a3f1;});}})[_0xf816('0x37')](respondWithFilteredResult(_0x41abc6,_0x49d534))[_0xf816('0x2a')](handleError(_0x41abc6,null));};exports[_0xf816('0x3d')]=function(_0x3d42fa,_0x344129,_0xe49c9){var _0x31ff52,_0x39bd88={},_0x36b3ac;if(_0x3d42fa[_0xf816('0x5f')]['to']){_0x36b3ac=_0x3d42fa['body']['to'][_0xf816('0x9c')](',')[0x0];}return db['MailAccount']['find']({'where':{'id':_0x3d42fa[_0xf816('0x60')]['id']},'include':[{'model':db['CmList'],'as':_0xf816('0xa0'),'include':[{'model':db['CmContact'],'as':_0xf816('0xa1'),'where':{'email':_0x36b3ac},'limit':0x1,'order':[['updatedAt',_0xf816('0xa2')]]}]},{'model':db['MailServerOut'],'as':_0xf816('0x42'),'raw':!![]}]})[_0xf816('0x37')](handleEntityNotFound(_0x344129,null))[_0xf816('0x37')](function(_0x5f441d){if(_0x5f441d){_0x31ff52=_0x5f441d;if(_0x5f441d[_0xf816('0x42')]){if(_['isNil'](_0x3d42fa['body']['from'])){_0x3d42fa[_0xf816('0x5f')][_0xf816('0xa3')]=util['format'](_0xf816('0xa4'),_0x5f441d[_0xf816('0x3c')],_0x5f441d[_0xf816('0xa5')]||_0x5f441d[_0xf816('0x42')][_0xf816('0x74')]);}if(_0x3d42fa[_0xf816('0x5f')][_0xf816('0xa6')]&&_0x3d42fa[_0xf816('0x5f')][_0xf816('0xa6')][_0xf816('0x4f')]){for(var _0x2a6aa5=0x0;_0x2a6aa5<_0x3d42fa[_0xf816('0x5f')][_0xf816('0xa6')][_0xf816('0x4f')];_0x2a6aa5+=0x1){_0x3d42fa[_0xf816('0x5f')][_0xf816('0xa6')][_0x2a6aa5]={'filename':_0x3d42fa['body'][_0xf816('0xa6')][_0x2a6aa5][_0xf816('0x3c')],'path':path[_0xf816('0xa7')](config['root'],_0xf816('0xa8'),_0x3d42fa['body'][_0xf816('0xa6')][_0x2a6aa5]['basename'])};}}var _0x40aa13={'tls':{'rejectUnauthorized':![]}};if(_['isNil'](_0x5f441d[_0xf816('0x42')]['service'])){if(_0x5f441d[_0xf816('0x42')][_0xf816('0x79')]){_0x40aa13[_0xf816('0xa9')]={'user':_0x5f441d[_0xf816('0x42')][_0xf816('0x74')],'pass':_0x5f441d['Smtp'][_0xf816('0x77')]};}_0x40aa13[_0xf816('0x7a')]=_0x5f441d[_0xf816('0x42')]['host'];_0x40aa13['port']=_0x5f441d[_0xf816('0x42')][_0xf816('0x7b')];_0x40aa13[_0xf816('0xaa')]=_0x5f441d[_0xf816('0x42')][_0xf816('0xaa')];}else{_0x40aa13[_0xf816('0x7c')]=_0x5f441d[_0xf816('0x42')][_0xf816('0x7c')];_0x40aa13['auth']={'user':_0x5f441d['Smtp'][_0xf816('0x74')],'pass':_0x5f441d[_0xf816('0x42')][_0xf816('0x77')]};}return respondWithRpcPromise(_0xf816('0xab'),'sendMail',{'account':_0x40aa13,'message':_0x3d42fa[_0xf816('0x5f')]});}else{throw new Error(_0xf816('0xac'));}}})['then'](function(_0x16f416){if(_0x16f416){_0x39bd88=_0x16f416;if(_0x31ff52[_0xf816('0xa0')]){if(_0x31ff52[_0xf816('0xa0')][_0xf816('0xa1')][_0xf816('0x4f')]){return _0x31ff52[_0xf816('0xa0')][_0xf816('0xa1')][0x0];}else{return db[_0xf816('0x8c')][_0xf816('0x67')](_[_0xf816('0x1a')](_0x3d42fa[_0xf816('0x5f')],{'firstName':_0x3d42fa['body']['to'],'email':_0x3d42fa[_0xf816('0x5f')]['to'],'phone':_0x3d42fa[_0xf816('0x5f')]['to'],'ListId':_0x31ff52['ListId']}));}}else{throw new Error(_0xf816('0xac'));}}})['then'](function(_0x406e85){if(_0x406e85){var _0x33f8d6={'UserId':_0x3d42fa[_0xf816('0x74')]['id'],'ContactId':_0x406e85['id'],'MailAccountId':_0x31ff52['id'],'inReplyTo':_0x39bd88[_0xf816('0xad')],'to':_0x3d42fa['body']['from'],'cc':_0x3d42fa[_0xf816('0x5f')]['cc'],'subject':_0x3d42fa[_0xf816('0x5f')][_0xf816('0xae')],'attach':_0x3d42fa[_0xf816('0x5f')][_0xf816('0xaf')],'firstMsgDirection':_0xf816('0xb0'),'lastMsgAt':moment()[_0xf816('0x9d')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':_0xf816('0xb0'),'Messages':[_['merge'](_0x3d42fa[_0xf816('0x5f')],{'messageId':_0x39bd88[_0xf816('0xad')],'sentAt':moment()[_0xf816('0x9d')](_0xf816('0x9e')),'read':!![],'MailAccountId':_0x31ff52['id'],'UserId':_0x3d42fa[_0xf816('0x74')]['id'],'ContactId':_0x406e85['id']})]};if(_0x3d42fa[_0xf816('0x5f')][_0xf816('0xb1')]){_0x33f8d6=_[_0xf816('0x56')](_0x33f8d6,_0x3d42fa[_0xf816('0x5f')][_0xf816('0xb1')]);}return db['MailInteraction'][_0xf816('0x67')](_0x33f8d6,{'include':[{'model':db[_0xf816('0x9a')],'as':_0xf816('0xb2')}]});}})['then'](respondWithResult(_0x344129,null))[_0xf816('0x2a')](handleError(_0x344129,null));};exports[_0xf816('0xb3')]=function(_0x2a37a7,_0x6fb7f8,_0x8a9785){return db[_0xf816('0x45')]['find']({'where':{'id':_0x2a37a7[_0xf816('0x60')]['id']},'include':[{'model':db['MailServerOut'],'as':_0xf816('0x42'),'raw':!![]}]})[_0xf816('0x37')](handleEntityNotFound(_0x6fb7f8,null))[_0xf816('0x37')](function(_0x6c37e5){if(_0x6c37e5&&_0x6c37e5[_0xf816('0x42')]){var _0x21eddf={'id':_0x6c37e5['id'],'tls':{'rejectUnauthorized':![]}};if(_0x6c37e5[_0xf816('0x42')][_0xf816('0x7c')]){_0x21eddf[_0xf816('0x7c')]=_0x6c37e5[_0xf816('0x42')][_0xf816('0x7c')];}else{_0x21eddf['host']=_0x6c37e5[_0xf816('0x42')][_0xf816('0x7a')];_0x21eddf['port']=_0x6c37e5['Smtp']['port'];_0x21eddf[_0xf816('0xaa')]=_0x6c37e5[_0xf816('0x42')][_0xf816('0xaa')];}if(_0x6c37e5[_0xf816('0x42')][_0xf816('0x79')]){_0x21eddf[_0xf816('0xa9')]={'user':_0x6c37e5[_0xf816('0x42')]['user'],'pass':_0x6c37e5[_0xf816('0x42')][_0xf816('0x77')]};}return respondWithRpcPromise(_0xf816('0xb4'),_0xf816('0xb3'),{'account':_0x21eddf});}})[_0xf816('0x37')](respondWithResult(_0x6fb7f8,null))['catch'](handleError(_0x6fb7f8,null));};exports[_0xf816('0x38')]=function(_0x15e827,_0x40a8b3){return db['MailAccount'][_0xf816('0x64')]({'where':{'id':_0x15e827[_0xf816('0x60')]['id']}})['then'](handleEntityNotFound(_0x40a8b3,null))[_0xf816('0x37')](function(_0x44ab01){if(_0x44ab01&&_0x44ab01['service']){throw new db[(_0xf816('0xb5'))][(_0xf816('0xb6'))]('You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account');}return _0x44ab01;})[_0xf816('0x37')](removeEntity(_0x40a8b3,null))[_0xf816('0x2a')](handleError(_0x40a8b3,null));};exports[_0xf816('0xb7')]=function(_0x400fe2,_0x227f8e,_0x366528){return db['MailAccount'][_0xf816('0x64')]({'where':{'id':_0x400fe2['params']['id']}})[_0xf816('0x37')](handleEntityNotFound(_0x227f8e,null))[_0xf816('0x37')](function(_0x44b799){if(_0x44b799){return _0x44b799[_0xf816('0xb7')](_0x400fe2[_0xf816('0x5f')][_0xf816('0x8a')],_['omit'](_0x400fe2[_0xf816('0x5f')],[_0xf816('0x8a'),'id'])||{})['spread'](function(_0x43eb3c){for(var _0x2f55b3=0x0;_0x2f55b3<_0x400fe2[_0xf816('0x5f')][_0xf816('0x8a')][_0xf816('0x4f')];_0x2f55b3+=0x1){socket[_0xf816('0xb8')]('userMailAccount:save',{'UserId':Number(_0x400fe2[_0xf816('0x5f')]['ids'][_0x2f55b3]),'MailAccountId':Number(_0x400fe2['params']['id'])});}return _0x43eb3c;});}})[_0xf816('0x37')](respondWithResult(_0x227f8e,null))['catch'](handleError(_0x227f8e,null));};exports[_0xf816('0xb9')]=function(_0x45f5bf,_0x386466,_0x4346c6){return db['MailAccount'][_0xf816('0x64')]({'where':{'id':_0x45f5bf['params']['id']}})['then'](handleEntityNotFound(_0x386466,null))['then'](function(_0x106d84){if(_0x106d84){return _0x106d84[_0xf816('0xb9')](_0x45f5bf[_0xf816('0x4b')][_0xf816('0x8a')])[_0xf816('0x37')](function(){if(_[_0xf816('0xba')](_0x45f5bf['query'][_0xf816('0x8a')])){for(var _0x5a4749=0x0;_0x5a4749<_0x45f5bf['query'][_0xf816('0x8a')][_0xf816('0x4f')];_0x5a4749+=0x1){socket[_0xf816('0xb8')]('userMailAccount:remove',{'UserId':Number(_0x45f5bf[_0xf816('0x4b')][_0xf816('0x8a')][_0x5a4749]),'MailAccountId':Number(_0x45f5bf[_0xf816('0x60')]['id'])});}}else{socket[_0xf816('0xb8')](_0xf816('0xbb'),{'UserId':Number(_0x45f5bf[_0xf816('0x4b')][_0xf816('0x8a')]),'MailAccountId':Number(_0x45f5bf[_0xf816('0x60')]['id'])});}});}})[_0xf816('0x37')](respondWithStatusCode(_0x386466,null))[_0xf816('0x2a')](handleError(_0x386466,null));};exports[_0xf816('0xbc')]=function(_0x2bc3a2,_0x1bfed9,_0x4953ed){var _0x57fb9f={};var _0x52a927={};var _0x4375a0;var _0x2ac44c;return db[_0xf816('0x45')]['findOne']({'where':{'id':_0x2bc3a2[_0xf816('0x60')]['id']}})[_0xf816('0x37')](handleEntityNotFound(_0x1bfed9,null))[_0xf816('0x37')](function(_0x3b7301){if(_0x3b7301){_0x4375a0=_0x3b7301;_0x52a927['model']=_[_0xf816('0x4a')](db[_0xf816('0x8e')]['rawAttributes']);_0x52a927[_0xf816('0x4b')]=_[_0xf816('0x4a')](_0x2bc3a2[_0xf816('0x4b')]);_0x52a927['filters']=_['intersection'](_0x52a927[_0xf816('0x49')],_0x52a927[_0xf816('0x4b')]);_0x57fb9f[_0xf816('0x4d')]=_[_0xf816('0x5d')](_0x52a927['model'],qs[_0xf816('0x4e')](_0x2bc3a2[_0xf816('0x4b')][_0xf816('0x4e')]));_0x57fb9f['attributes']=_0x57fb9f[_0xf816('0x4d')]['length']?_0x57fb9f[_0xf816('0x4d')]:_0x52a927[_0xf816('0x49')];_0x57fb9f['order']=qs[_0xf816('0x52')](_0x2bc3a2['query'][_0xf816('0x52')]);_0x57fb9f['where']=qs[_0xf816('0x4c')](_[_0xf816('0x54')](_0x2bc3a2[_0xf816('0x4b')],_0x52a927[_0xf816('0x4c')]));if(_0x2bc3a2[_0xf816('0x4b')][_0xf816('0x55')]){_0x57fb9f[_0xf816('0x53')]=_[_0xf816('0x56')](_0x57fb9f['where'],{'$or':_['map'](_0x57fb9f[_0xf816('0x4d')],function(_0x8f9367){var _0x23b5b1={};_0x23b5b1[_0x8f9367]={'$like':'%'+_0x2bc3a2[_0xf816('0x4b')][_0xf816('0x55')]+'%'};return _0x23b5b1;})});}_0x57fb9f=_['merge']({},_0x57fb9f,_0x2bc3a2[_0xf816('0x5e')]);return _0x4375a0['getAgents'](_0x57fb9f);}})[_0xf816('0x37')](function(_0x4458c6){if(_0x4458c6){_0x2ac44c=_0x4458c6[_0xf816('0x4f')];if(!_0x2bc3a2[_0xf816('0x4b')][_0xf816('0x6e')](_0xf816('0x50'))){_0x57fb9f['limit']=qs[_0xf816('0x30')](_0x2bc3a2[_0xf816('0x4b')][_0xf816('0x30')]);_0x57fb9f[_0xf816('0x2f')]=qs[_0xf816('0x2f')](_0x2bc3a2['query'][_0xf816('0x2f')]);}return _0x4375a0[_0xf816('0xbc')](_0x57fb9f);}})[_0xf816('0x37')](function(_0x2b917b){if(_0x2b917b){return _0x2b917b?{'count':_0x2ac44c,'rows':_0x2b917b}:null;}})['then'](respondWithResult(_0x1bfed9,null))[_0xf816('0x2a')](handleError(_0x1bfed9,null));}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.events.js b/server/api/mailAccount/mailAccount.events.js index 95a20f6..a74b72c 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 _0xbd5d=['events','../../mysqldb','setMaxListeners','remove','emit','hasOwnProperty','hook','exports'];(function(_0x13e741,_0x5d3c24){var _0x3f8bb3=function(_0x4440a0){while(--_0x4440a0){_0x13e741['push'](_0x13e741['shift']());}};_0x3f8bb3(++_0x5d3c24);}(_0xbd5d,0x118));var _0xdbd5=function(_0x225e5b,_0x34ef65){_0x225e5b=_0x225e5b-0x0;var _0x34dbb9=_0xbd5d[_0x225e5b];return _0x34dbb9;};'use strict';var EventEmitter=require(_0xdbd5('0x0'));var MailAccount=require(_0xdbd5('0x1'))['db']['MailAccount'];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0xdbd5('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xdbd5('0x3')};function emitEvent(_0x45b2a7){return function(_0xed6d76,_0x1db1ad,_0x1fe0f2){MailAccountEvents[_0xdbd5('0x4')](_0x45b2a7+':'+_0xed6d76['id'],_0xed6d76);MailAccountEvents[_0xdbd5('0x4')](_0x45b2a7,_0xed6d76);_0x1fe0f2(null);};}for(var e in events){if(events[_0xdbd5('0x5')](e)){var event=events[e];MailAccount[_0xdbd5('0x6')](e,emitEvent(event));}}module[_0xdbd5('0x7')]=MailAccountEvents; \ No newline at end of file +var _0xe528=['../../mysqldb','MailAccount','setMaxListeners','update','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x5ddb1c,_0x5ea4df){var _0x354adc=function(_0x2dfb1f){while(--_0x2dfb1f){_0x5ddb1c['push'](_0x5ddb1c['shift']());}};_0x354adc(++_0x5ea4df);}(_0xe528,0x167));var _0x8e52=function(_0x47ad4f,_0x321a17){_0x47ad4f=_0x47ad4f-0x0;var _0x5b8f53=_0xe528[_0x47ad4f];return _0x5b8f53;};'use strict';var EventEmitter=require(_0x8e52('0x0'));var MailAccount=require(_0x8e52('0x1'))['db'][_0x8e52('0x2')];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0x8e52('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x8e52('0x4'),'afterDestroy':_0x8e52('0x5')};function emitEvent(_0x4dfac1){return function(_0x23b7e4,_0x3321b5,_0x1856dd){MailAccountEvents[_0x8e52('0x6')](_0x4dfac1+':'+_0x23b7e4['id'],_0x23b7e4);MailAccountEvents[_0x8e52('0x6')](_0x4dfac1,_0x23b7e4);_0x1856dd(null);};}for(var e in events){if(events[_0x8e52('0x7')](e)){var event=events[e];MailAccount[_0x8e52('0x8')](e,emitEvent(event));}}module[_0x8e52('0x9')]=MailAccountEvents; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.model.js b/server/api/mailAccount/mailAccount.model.js index 468a361..a3c228a 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 _0xff70=['util','api','moment','bluebird','request-promise','path','../../config/environment','./mailAccount.attributes','define','mail_accounts','lodash'];(function(_0x58836f,_0x5351e2){var _0x28f9b1=function(_0x30a6cc){while(--_0x30a6cc){_0x58836f['push'](_0x58836f['shift']());}};_0x28f9b1(++_0x5351e2);}(_0xff70,0x8e));var _0x0ff7=function(_0x1c6ef2,_0x8d926a){_0x1c6ef2=_0x1c6ef2-0x0;var _0x404b8c=_0xff70[_0x1c6ef2];return _0x404b8c;};'use strict';var _=require(_0x0ff7('0x0'));var util=require(_0x0ff7('0x1'));var logger=require('../../config/logger')(_0x0ff7('0x2'));var moment=require(_0x0ff7('0x3'));var BPromise=require(_0x0ff7('0x4'));var rp=require(_0x0ff7('0x5'));var fs=require('fs');var path=require(_0x0ff7('0x6'));var rimraf=require('rimraf');var config=require(_0x0ff7('0x7'));var attributes=require(_0x0ff7('0x8'));module['exports']=function(_0x2df87e,_0x1d6a25){return _0x2df87e[_0x0ff7('0x9')]('MailAccount',attributes,{'tableName':_0x0ff7('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc09f=['../../config/environment','./mailAccount.attributes','define','util','../../config/logger','api','moment','request-promise','path'];(function(_0x4b33b5,_0x4dba68){var _0x159019=function(_0x98702){while(--_0x98702){_0x4b33b5['push'](_0x4b33b5['shift']());}};_0x159019(++_0x4dba68);}(_0xc09f,0xd2));var _0xfc09=function(_0x27d958,_0x29ef87){_0x27d958=_0x27d958-0x0;var _0x53e63e=_0xc09f[_0x27d958];return _0x53e63e;};'use strict';var _=require('lodash');var util=require(_0xfc09('0x0'));var logger=require(_0xfc09('0x1'))(_0xfc09('0x2'));var moment=require(_0xfc09('0x3'));var BPromise=require('bluebird');var rp=require(_0xfc09('0x4'));var fs=require('fs');var path=require(_0xfc09('0x5'));var rimraf=require('rimraf');var config=require(_0xfc09('0x6'));var attributes=require(_0xfc09('0x7'));module['exports']=function(_0x8f1f19,_0x3b4667){return _0x8f1f19[_0xfc09('0x8')]('MailAccount',attributes,{'tableName':'mail_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.rpc.js b/server/api/mailAccount/mailAccount.rpc.js index 5329788..d686520 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 _0x8dfe=['info','MailAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','GetMailAccount','MailAccount','findAll','options','raw','where','attributes','limit','map','include','model','ShowMailAccount','find','NotifyMailAccount','body','mail','keys','CmContact','rawAttributes','createdAt','updatedAt','CompanyId','ListId','isNil','from','from\x20is\x20mandatory','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','account','List','DESC','MailApplication','Smtp','get','omit','Applications','list','applications','orderBy','priority','asc','autoclose','push','length','*,*,*,*','Contacts','create','List\x20not\x20found','contact','messageId','generate','subject','attach','inReplyTo','spread','format','YYYY-MM-DD\x20HH:mm:ss','interaction','created','MailMessage','attachments','originTo','ChatWebsiteId','Email','Attachment','Attachments','UserId','User','unshift','agent','name','Start','startRouting','lodash','util','moment','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','redis','defaults','localhost','./mailAccount.socket','register','request','then'];(function(_0x53ecd2,_0x4d13dd){var _0x247fa3=function(_0xe8cd7d){while(--_0xe8cd7d){_0x53ecd2['push'](_0x53ecd2['shift']());}};_0x247fa3(++_0x4d13dd);}(_0x8dfe,0xb8));var _0xe8df=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8dfe[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xe8df('0x0'));var util=require(_0xe8df('0x1'));var moment=require(_0xe8df('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe8df('0x3'))['db'];var utils=require(_0xe8df('0x4'));var logger=require(_0xe8df('0x5'))(_0xe8df('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xe8df('0x7')][_0xe8df('0x8')]({'port':0x232c});config[_0xe8df('0x9')]=_[_0xe8df('0xa')](config[_0xe8df('0x9')],{'host':_0xe8df('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xe8df('0x9')]));require(_0xe8df('0xc'))[_0xe8df('0xd')](socket);function respondWithRpcPromise(_0x2e2ab6,_0x22f5b3,_0x465a54){return new BPromise(function(_0x1277a4,_0x12754a){return client[_0xe8df('0xe')](_0x2e2ab6,_0x465a54)[_0xe8df('0xf')](function(_0x2e9b7c){logger[_0xe8df('0x10')](_0xe8df('0x11'),_0x22f5b3,_0xe8df('0x12'));logger[_0xe8df('0x13')]('MailAccount,\x20%s,\x20%s,\x20%s',_0x22f5b3,_0xe8df('0x12'),JSON[_0xe8df('0x14')](_0x2e9b7c));if(_0x2e9b7c[_0xe8df('0x15')]){if(_0x2e9b7c[_0xe8df('0x15')][_0xe8df('0x16')]===0x1f4){logger[_0xe8df('0x15')](_0xe8df('0x11'),_0x22f5b3,_0x2e9b7c['error']['message']);return _0x12754a(_0x2e9b7c[_0xe8df('0x15')][_0xe8df('0x17')]);}logger[_0xe8df('0x15')]('MailAccount,\x20%s,\x20%s',_0x22f5b3,_0x2e9b7c['error'][_0xe8df('0x17')]);return _0x1277a4(_0x2e9b7c[_0xe8df('0x15')][_0xe8df('0x17')]);}else{logger['info'](_0xe8df('0x11'),_0x22f5b3,'request\x20sent');_0x1277a4(_0x2e9b7c['result'][_0xe8df('0x17')]);}})[_0xe8df('0x18')](function(_0x49430f){logger[_0xe8df('0x15')]('MailAccount,\x20%s,\x20%s',_0x22f5b3,_0x49430f);_0x12754a(_0x49430f);});});}exports[_0xe8df('0x19')]=function(_0x75529e){var _0xce7230=this;return new Promise(function(_0x2aeff3,_0x2e4a46){return db[_0xe8df('0x1a')][_0xe8df('0x1b')]({'raw':_0x75529e[_0xe8df('0x1c')]?_0x75529e[_0xe8df('0x1c')][_0xe8df('0x1d')]===undefined?!![]:![]:!![],'where':_0x75529e[_0xe8df('0x1c')]?_0x75529e[_0xe8df('0x1c')][_0xe8df('0x1e')]||null:null,'attributes':_0x75529e[_0xe8df('0x1c')]?_0x75529e[_0xe8df('0x1c')][_0xe8df('0x1f')]||null:null,'limit':_0x75529e[_0xe8df('0x1c')]?_0x75529e[_0xe8df('0x1c')][_0xe8df('0x20')]||null:null,'include':_0x75529e[_0xe8df('0x1c')]?_0x75529e['options']['include']?_[_0xe8df('0x21')](_0x75529e['options'][_0xe8df('0x22')],function(_0x388563){return{'model':db[_0x388563[_0xe8df('0x23')]],'as':_0x388563['as'],'attributes':_0x388563[_0xe8df('0x1f')],'include':_0x388563[_0xe8df('0x22')]?_[_0xe8df('0x21')](_0x388563[_0xe8df('0x22')],function(_0x7eff51){return{'model':db[_0x7eff51[_0xe8df('0x23')]],'as':_0x7eff51['as'],'attributes':_0x7eff51[_0xe8df('0x1f')],'include':_0x7eff51[_0xe8df('0x22')]?_[_0xe8df('0x21')](_0x7eff51[_0xe8df('0x22')],function(_0x13ca70){return{'model':db[_0x13ca70[_0xe8df('0x23')]],'as':_0x13ca70['as'],'attributes':_0x13ca70[_0xe8df('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xe8df('0xf')](function(_0x2ba834){logger[_0xe8df('0x10')](_0xe8df('0x19'),_0x75529e);logger[_0xe8df('0x13')](_0xe8df('0x19'),_0x75529e,JSON[_0xe8df('0x14')](_0x2ba834));_0x2aeff3(_0x2ba834);})[_0xe8df('0x18')](function(_0x3664ac){logger[_0xe8df('0x15')]('GetMailAccount',_0x3664ac[_0xe8df('0x17')],_0x75529e);_0x2e4a46(_0xce7230[_0xe8df('0x15')](0x1f4,_0x3664ac[_0xe8df('0x17')]));});});};exports[_0xe8df('0x24')]=function(_0x3b721a){var _0x271d04=this;return new Promise(function(_0x3369ef,_0x3eb308){return db['MailAccount'][_0xe8df('0x25')]({'raw':_0x3b721a[_0xe8df('0x1c')]?_0x3b721a[_0xe8df('0x1c')][_0xe8df('0x1d')]===undefined?!![]:![]:!![],'where':_0x3b721a[_0xe8df('0x1c')]?_0x3b721a['options'][_0xe8df('0x1e')]||null:null,'attributes':_0x3b721a[_0xe8df('0x1c')]?_0x3b721a[_0xe8df('0x1c')][_0xe8df('0x1f')]||null:null,'include':_0x3b721a['options']?_0x3b721a['options'][_0xe8df('0x22')]?_[_0xe8df('0x21')](_0x3b721a['options'][_0xe8df('0x22')],function(_0x3256a4){return{'model':db[_0x3256a4['model']],'as':_0x3256a4['as'],'attributes':_0x3256a4[_0xe8df('0x1f')],'include':_0x3256a4['include']?_['map'](_0x3256a4[_0xe8df('0x22')],function(_0x1e2bd7){return{'model':db[_0x1e2bd7[_0xe8df('0x23')]],'as':_0x1e2bd7['as'],'attributes':_0x1e2bd7[_0xe8df('0x1f')],'include':_0x1e2bd7[_0xe8df('0x22')]?_[_0xe8df('0x21')](_0x1e2bd7[_0xe8df('0x22')],function(_0x4dca85){return{'model':db[_0x4dca85[_0xe8df('0x23')]],'as':_0x4dca85['as'],'attributes':_0x4dca85[_0xe8df('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x477736){logger[_0xe8df('0x10')](_0xe8df('0x24'),_0x3b721a);logger[_0xe8df('0x13')](_0xe8df('0x24'),_0x3b721a,JSON['stringify'](_0x477736));_0x3369ef(_0x477736);})['catch'](function(_0x46e828){logger[_0xe8df('0x15')](_0xe8df('0x24'),_0x46e828[_0xe8df('0x17')],_0x3b721a);_0x3eb308(_0x271d04[_0xe8df('0x15')](0x1f4,_0x46e828[_0xe8df('0x17')]));});});};exports[_0xe8df('0x26')]=function(_0x50e2ad){var _0x3d033c=this;return new Promise(function(_0x3f6ebd,_0x18d303){var _0x43574f={'body':_0x50e2ad[_0xe8df('0x27')],'channel':_0xe8df('0x28')};var _0xa70947=_['difference'](_[_0xe8df('0x29')](db[_0xe8df('0x2a')][_0xe8df('0x2b')]),[_0xe8df('0x2c'),_0xe8df('0x2d'),_0xe8df('0x2e'),_0xe8df('0x2f')]);var _0xdfa395=![];if(_0x50e2ad[_0xe8df('0x27')]['id']){delete _0x50e2ad[_0xe8df('0x27')]['id'];}if(_[_0xe8df('0x30')](_0x50e2ad[_0xe8df('0x27')][_0xe8df('0x31')])){return _0x18d303(_0x3d033c['error'](0x1f4,_0xe8df('0x32')));}if(_[_0xe8df('0x30')](_0x50e2ad[_0xe8df('0x27')][_0xe8df('0x27')])||_0x50e2ad[_0xe8df('0x27')][_0xe8df('0x27')]===''){return _0x18d303(_0x3d033c[_0xe8df('0x15')](0x1f4,'body\x20is\x20mandatory\x20and\x20not\x20empty'));}if(_['isNil'](_0x50e2ad[_0xe8df('0x27')][_0xe8df('0x33')])){return _0x18d303(_0x3d033c[_0xe8df('0x15')](0x1f4,_0xe8df('0x34')+_0xa70947));}if(!_[_0xe8df('0x35')](_0xa70947,_0x50e2ad[_0xe8df('0x27')][_0xe8df('0x33')])){return _0x18d303(_0x3d033c[_0xe8df('0x15')](0x1f4,_0xe8df('0x36')+_0xa70947));}var _0x5a6899={};_0x5a6899[_0x50e2ad['body'][_0xe8df('0x33')]]=_0x50e2ad[_0xe8df('0x27')]['from'];return db[_0xe8df('0x1a')][_0xe8df('0x25')]({'where':{'id':_0x50e2ad[_0xe8df('0x37')]['id']},'include':[{'model':db['CmList'],'as':_0xe8df('0x38'),'include':[{'model':db[_0xe8df('0x2a')],'as':'Contacts','where':_0x5a6899,'limit':0x1,'order':[[_0xe8df('0x2d'),_0xe8df('0x39')]]}]},{'model':db[_0xe8df('0x3a')],'as':'Applications'},{'model':db['MailServerOut'],'as':_0xe8df('0x3b')}]})[_0xe8df('0xf')](function(_0xbff26b){if(_0xbff26b&&_0xbff26b[_0xe8df('0x38')]){var _0x14f4ea=_0xbff26b[_0xe8df('0x3c')]({'plain':!![]});_0x43574f[_0xe8df('0x37')]=_[_0xe8df('0x3d')](_0x14f4ea,[_0xe8df('0x3e'),'List']);_0x43574f['applications']=_0x14f4ea[_0xe8df('0x3e')];_0x43574f[_0xe8df('0x3f')]=_0x14f4ea[_0xe8df('0x38')];_0x43574f[_0xe8df('0x40')]=_[_0xe8df('0x41')](_0x43574f[_0xe8df('0x40')],[_0xe8df('0x42')],[_0xe8df('0x43')]);if(_0x43574f['account']&&_0x43574f[_0xe8df('0x37')][_0xe8df('0x44')]){_0x43574f[_0xe8df('0x40')][_0xe8df('0x45')]({'id':0x0,'priority':_0x43574f[_0xe8df('0x40')][_0xe8df('0x46')]+0x1,'app':'close','appdata':_0xe8df('0x44'),'interval':_0xe8df('0x47')});}if(_0x43574f['account']['Applications']){delete _0x43574f[_0xe8df('0x37')][_0xe8df('0x3e')];}if(_0x43574f[_0xe8df('0x37')][_0xe8df('0x38')]){delete _0x43574f['account'][_0xe8df('0x38')];}if(_0x14f4ea[_0xe8df('0x38')][_0xe8df('0x48')][_0xe8df('0x46')]){return _0x14f4ea['List'][_0xe8df('0x48')][0x0];}var _0x38f46e=_[_0xe8df('0xa')](_0x50e2ad[_0xe8df('0x27')],{'firstName':_0x50e2ad[_0xe8df('0x27')]['from'],'ListId':_0x14f4ea[_0xe8df('0x2f')]});_0x38f46e[_0x50e2ad[_0xe8df('0x27')][_0xe8df('0x33')]]=_0x50e2ad[_0xe8df('0x27')]['from'];return db[_0xe8df('0x2a')][_0xe8df('0x49')](_0x38f46e);}else{throw new Error(_0xe8df('0x4a'));}})[_0xe8df('0xf')](function(_0x543d8a){_0x43574f[_0xe8df('0x4b')]=_0x543d8a;if(_0x543d8a){if(!_0x50e2ad[_0xe8df('0x27')][_0xe8df('0x17')][_0xe8df('0x4c')]){_0x50e2ad['body']['message'][_0xe8df('0x4c')]=rs[_0xe8df('0x4d')]()+'\x20'+_0x50e2ad[_0xe8df('0x27')]['message'][_0xe8df('0x31')];}var _0x41af80={'ContactId':_0x543d8a['id'],'MailAccountId':_0x50e2ad[_0xe8df('0x37')]['id'],'inReplyTo':_0x50e2ad[_0xe8df('0x27')][_0xe8df('0x17')][_0xe8df('0x4c')],'to':_0x50e2ad[_0xe8df('0x27')][_0xe8df('0x17')][_0xe8df('0x31')],'cc':_0x50e2ad[_0xe8df('0x27')][_0xe8df('0x17')]['cc'],'subject':_0x50e2ad[_0xe8df('0x27')][_0xe8df('0x17')][_0xe8df('0x4e')],'attach':_0x50e2ad[_0xe8df('0x27')][_0xe8df('0x17')][_0xe8df('0x4f')],'lastMsgAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':'in'};return db['MailInteraction'][_0xe8df('0x25')]({'where':{'closed':![],'MailAccountId':_0x50e2ad[_0xe8df('0x37')]['id']},'include':[{'model':db['MailMessage'],'as':'Messages','attributes':[_0xe8df('0x4c')],'where':{'messageId':_0x50e2ad[_0xe8df('0x27')][_0xe8df('0x17')][_0xe8df('0x50')]}}]})['then'](function(_0x35c548){if(_0x35c548){return[_0x35c548,![]];}return db['MailInteraction'][_0xe8df('0x49')](_0x41af80)[_0xe8df('0xf')](function(_0x4e33d8){return[_0x4e33d8,!![]];});});}else{throw new Error('Contact\x20not\x20found');}})[_0xe8df('0x51')](function(_0x2d637c,_0x56ec62){if(_0x2d637c){_0xdfa395=_0x56ec62;if(!_0x56ec62){return _0x2d637c['update']({'inReplyTo':_0x50e2ad[_0xe8df('0x27')][_0xe8df('0x17')][_0xe8df('0x4c')],'to':_0x50e2ad[_0xe8df('0x27')]['message']['from'],'cc':_0x50e2ad['body']['message']['cc'],'subject':_0x50e2ad[_0xe8df('0x27')]['message']['subject'],'attach':_0x2d637c[_0xe8df('0x4f')]?_0x2d637c[_0xe8df('0x4f')]:_0x50e2ad[_0xe8df('0x27')][_0xe8df('0x17')][_0xe8df('0x4f')],'substatus':null,'substatusAt':moment()[_0xe8df('0x52')](_0xe8df('0x53')),'lastMsgAt':moment()[_0xe8df('0x52')](_0xe8df('0x53')),'lastMsgDirection':'in'});}else{return _0x2d637c;}}})[_0xe8df('0xf')](function(_0x2927ad){_0x43574f[_0xe8df('0x54')]=_0x2927ad['get']({'plain':!![]});_0x43574f[_0xe8df('0x54')][_0xe8df('0x55')]=_0xdfa395;return db[_0xe8df('0x56')]['create']({'body':_0x50e2ad[_0xe8df('0x27')][_0xe8df('0x27')],'MailAccountId':_0x50e2ad[_0xe8df('0x37')]['id'],'MailInteractionId':_0x2927ad['id'],'direction':'in','ContactId':_0x43574f[_0xe8df('0x4b')]['id'],'messageId':_0x50e2ad[_0xe8df('0x27')]['message'][_0xe8df('0x4c')],'from':_0x50e2ad['body']['message'][_0xe8df('0x31')],'to':_0x50e2ad['body'][_0xe8df('0x17')]['to'],'cc':_0x50e2ad[_0xe8df('0x27')][_0xe8df('0x17')]['cc'],'subject':_0x50e2ad['body'][_0xe8df('0x17')][_0xe8df('0x4e')],'attach':_0x50e2ad[_0xe8df('0x27')][_0xe8df('0x17')][_0xe8df('0x4f')],'Attachments':_0x50e2ad['body'][_0xe8df('0x17')][_0xe8df('0x57')],'originTo':_0x50e2ad['body'][_0xe8df('0x17')][_0xe8df('0x58')],'originCc':_0x50e2ad[_0xe8df('0x27')][_0xe8df('0x17')]['originCc'],'bcc':_0x50e2ad[_0xe8df('0x27')][_0xe8df('0x17')]['bcc'],'ChatWebsiteId':_0x50e2ad[_0xe8df('0x27')][_0xe8df('0x17')][_0xe8df('0x59')]||null,'originChannel':_0x50e2ad[_0xe8df('0x27')][_0xe8df('0x17')]['originChannel']||_0xe8df('0x5a'),'ChatOfflineMessageId':_0x50e2ad[_0xe8df('0x27')]['message']['ChatOfflineMessageId']||null},{'include':[{'model':db[_0xe8df('0x5b')],'as':_0xe8df('0x5c')}]});})[_0xe8df('0xf')](function(_0x459368){_0x43574f[_0xe8df('0x17')]=_0x459368;if(_0x43574f[_0xe8df('0x54')][_0xe8df('0x5d')]){return db[_0xe8df('0x5e')][_0xe8df('0x25')]({'attributes':['id','name'],'where':{'id':_0x43574f[_0xe8df('0x54')][_0xe8df('0x5d')]}})['then'](function(_0x43156a){if(_0x43156a){_0x43574f[_0xe8df('0x40')][_0xe8df('0x5f')]({'id':0x0,'priority':0x0,'app':_0xe8df('0x60'),'appdata':_0x43156a[_0xe8df('0x61')]+','+(_0x43574f['account']['waitForTheAssignedAgent']||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise(_0xe8df('0x62'),'startRouting',_0x43574f);});}return respondWithRpcPromise(_0xe8df('0x62'),_0xe8df('0x63'),_0x43574f);})[_0xe8df('0xf')](function(_0x369086){_0x3f6ebd(_0x369086);})['catch'](function(_0x1f8fdc){_0x18d303(_0x3d033c[_0xe8df('0x15')](0x1f4,_0x1f8fdc[_0xe8df('0x17')]));});});}; \ No newline at end of file +var _0x2285=['List\x20not\x20found','contact','messageId','generate','YYYY-MM-DD\x20HH:mm:ss','MailInteraction','MailMessage','Messages','inReplyTo','Contact\x20not\x20found','spread','update','subject','attach','format','interaction','created','attachments','originTo','ChatWebsiteId','originChannel','Attachment','UserId','User','name','unshift','agent','Start','startRouting','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','defaults','redis','localhost','socket.io-emitter','register','request','then','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','MailAccount,\x20%s,\x20%s','message','info','result','catch','GetMailAccount','MailAccount','options','raw','where','limit','include','map','attributes','model','ShowMailAccount','find','NotifyMailAccount','body','difference','keys','CmContact','CompanyId','ListId','isNil','from','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey','account','CmList','Contacts','DESC','MailApplication','MailServerOut','List','get','Applications','applications','list','orderBy','priority','autoclose','length','close','*,*,*,*','create'];(function(_0xb3f4b,_0x2c35d4){var _0x12f95b=function(_0x406975){while(--_0x406975){_0xb3f4b['push'](_0xb3f4b['shift']());}};_0x12f95b(++_0x2c35d4);}(_0x2285,0xe7));var _0x5228=function(_0x4d204f,_0xe2bfb7){_0x4d204f=_0x4d204f-0x0;var _0x43c741=_0x2285[_0x4d204f];return _0x43c741;};'use strict';var _=require('lodash');var util=require(_0x5228('0x0'));var moment=require(_0x5228('0x1'));var BPromise=require(_0x5228('0x2'));var rs=require(_0x5228('0x3'));var fs=require('fs');var Redis=require(_0x5228('0x4'));var db=require(_0x5228('0x5'))['db'];var utils=require(_0x5228('0x6'));var logger=require(_0x5228('0x7'))(_0x5228('0x8'));var config=require(_0x5228('0x9'));var jayson=require(_0x5228('0xa'));var client=jayson['client'][_0x5228('0xb')]({'port':0x232c});config['redis']=_[_0x5228('0xc')](config[_0x5228('0xd')],{'host':_0x5228('0xe'),'port':0x18eb});var socket=require(_0x5228('0xf'))(new Redis(config[_0x5228('0xd')]));require('./mailAccount.socket')[_0x5228('0x10')](socket);function respondWithRpcPromise(_0x4a0504,_0x52a81d,_0x39c1c3){return new BPromise(function(_0x2eec11,_0x4ce88c){return client[_0x5228('0x11')](_0x4a0504,_0x39c1c3)[_0x5228('0x12')](function(_0x158d88){logger['info']('MailAccount,\x20%s,\x20%s',_0x52a81d,_0x5228('0x13'));logger[_0x5228('0x14')](_0x5228('0x15'),_0x52a81d,_0x5228('0x13'),JSON[_0x5228('0x16')](_0x158d88));if(_0x158d88[_0x5228('0x17')]){if(_0x158d88[_0x5228('0x17')]['code']===0x1f4){logger[_0x5228('0x17')](_0x5228('0x18'),_0x52a81d,_0x158d88[_0x5228('0x17')][_0x5228('0x19')]);return _0x4ce88c(_0x158d88['error'][_0x5228('0x19')]);}logger[_0x5228('0x17')](_0x5228('0x18'),_0x52a81d,_0x158d88['error']['message']);return _0x2eec11(_0x158d88[_0x5228('0x17')]['message']);}else{logger[_0x5228('0x1a')]('MailAccount,\x20%s,\x20%s',_0x52a81d,_0x5228('0x13'));_0x2eec11(_0x158d88[_0x5228('0x1b')][_0x5228('0x19')]);}})[_0x5228('0x1c')](function(_0x5ca764){logger[_0x5228('0x17')]('MailAccount,\x20%s,\x20%s',_0x52a81d,_0x5ca764);_0x4ce88c(_0x5ca764);});});}exports[_0x5228('0x1d')]=function(_0x26bab9){var _0x141ed9=this;return new Promise(function(_0x3d8fd6,_0xba3367){return db[_0x5228('0x1e')]['findAll']({'raw':_0x26bab9[_0x5228('0x1f')]?_0x26bab9[_0x5228('0x1f')][_0x5228('0x20')]===undefined?!![]:![]:!![],'where':_0x26bab9[_0x5228('0x1f')]?_0x26bab9[_0x5228('0x1f')][_0x5228('0x21')]||null:null,'attributes':_0x26bab9[_0x5228('0x1f')]?_0x26bab9[_0x5228('0x1f')]['attributes']||null:null,'limit':_0x26bab9[_0x5228('0x1f')]?_0x26bab9[_0x5228('0x1f')][_0x5228('0x22')]||null:null,'include':_0x26bab9[_0x5228('0x1f')]?_0x26bab9[_0x5228('0x1f')][_0x5228('0x23')]?_[_0x5228('0x24')](_0x26bab9[_0x5228('0x1f')]['include'],function(_0x1fb1c9){return{'model':db[_0x1fb1c9['model']],'as':_0x1fb1c9['as'],'attributes':_0x1fb1c9[_0x5228('0x25')],'include':_0x1fb1c9[_0x5228('0x23')]?_[_0x5228('0x24')](_0x1fb1c9[_0x5228('0x23')],function(_0xc7219d){return{'model':db[_0xc7219d[_0x5228('0x26')]],'as':_0xc7219d['as'],'attributes':_0xc7219d[_0x5228('0x25')],'include':_0xc7219d[_0x5228('0x23')]?_[_0x5228('0x24')](_0xc7219d[_0x5228('0x23')],function(_0x5e6180){return{'model':db[_0x5e6180[_0x5228('0x26')]],'as':_0x5e6180['as'],'attributes':_0x5e6180[_0x5228('0x25')]};}):[]};}):[]};}):[]:[]})[_0x5228('0x12')](function(_0x30ad00){logger['info'](_0x5228('0x1d'),_0x26bab9);logger['debug']('GetMailAccount',_0x26bab9,JSON['stringify'](_0x30ad00));_0x3d8fd6(_0x30ad00);})[_0x5228('0x1c')](function(_0x227be5){logger[_0x5228('0x17')]('GetMailAccount',_0x227be5[_0x5228('0x19')],_0x26bab9);_0xba3367(_0x141ed9[_0x5228('0x17')](0x1f4,_0x227be5[_0x5228('0x19')]));});});};exports[_0x5228('0x27')]=function(_0x5d4da4){var _0x162690=this;return new Promise(function(_0x48c4c4,_0x54f9f5){return db['MailAccount'][_0x5228('0x28')]({'raw':_0x5d4da4[_0x5228('0x1f')]?_0x5d4da4[_0x5228('0x1f')][_0x5228('0x20')]===undefined?!![]:![]:!![],'where':_0x5d4da4[_0x5228('0x1f')]?_0x5d4da4[_0x5228('0x1f')][_0x5228('0x21')]||null:null,'attributes':_0x5d4da4[_0x5228('0x1f')]?_0x5d4da4[_0x5228('0x1f')][_0x5228('0x25')]||null:null,'include':_0x5d4da4[_0x5228('0x1f')]?_0x5d4da4[_0x5228('0x1f')][_0x5228('0x23')]?_[_0x5228('0x24')](_0x5d4da4[_0x5228('0x1f')][_0x5228('0x23')],function(_0x40266a){return{'model':db[_0x40266a['model']],'as':_0x40266a['as'],'attributes':_0x40266a[_0x5228('0x25')],'include':_0x40266a['include']?_['map'](_0x40266a[_0x5228('0x23')],function(_0x19ddde){return{'model':db[_0x19ddde[_0x5228('0x26')]],'as':_0x19ddde['as'],'attributes':_0x19ddde[_0x5228('0x25')],'include':_0x19ddde['include']?_[_0x5228('0x24')](_0x19ddde[_0x5228('0x23')],function(_0x1f7bab){return{'model':db[_0x1f7bab[_0x5228('0x26')]],'as':_0x1f7bab['as'],'attributes':_0x1f7bab['attributes']};}):[]};}):[]};}):[]:[]})[_0x5228('0x12')](function(_0x25c84f){logger[_0x5228('0x1a')](_0x5228('0x27'),_0x5d4da4);logger[_0x5228('0x14')]('ShowMailAccount',_0x5d4da4,JSON['stringify'](_0x25c84f));_0x48c4c4(_0x25c84f);})['catch'](function(_0x41edf5){logger[_0x5228('0x17')](_0x5228('0x27'),_0x41edf5[_0x5228('0x19')],_0x5d4da4);_0x54f9f5(_0x162690[_0x5228('0x17')](0x1f4,_0x41edf5[_0x5228('0x19')]));});});};exports[_0x5228('0x29')]=function(_0x18b7a4){var _0x144a2b=this;return new Promise(function(_0x834c64,_0x3ed722){var _0x81e1e6={'body':_0x18b7a4[_0x5228('0x2a')],'channel':'mail'};var _0x26ca03=_[_0x5228('0x2b')](_[_0x5228('0x2c')](db[_0x5228('0x2d')]['rawAttributes']),['createdAt','updatedAt',_0x5228('0x2e'),_0x5228('0x2f')]);var _0x5e6245=![];if(_0x18b7a4[_0x5228('0x2a')]['id']){delete _0x18b7a4[_0x5228('0x2a')]['id'];}if(_[_0x5228('0x30')](_0x18b7a4[_0x5228('0x2a')][_0x5228('0x31')])){return _0x3ed722(_0x144a2b[_0x5228('0x17')](0x1f4,'from\x20is\x20mandatory'));}if(_[_0x5228('0x30')](_0x18b7a4[_0x5228('0x2a')][_0x5228('0x2a')])||_0x18b7a4[_0x5228('0x2a')]['body']===''){return _0x3ed722(_0x144a2b[_0x5228('0x17')](0x1f4,_0x5228('0x32')));}if(_[_0x5228('0x30')](_0x18b7a4[_0x5228('0x2a')]['mapKey'])){return _0x3ed722(_0x144a2b[_0x5228('0x17')](0x1f4,_0x5228('0x33')+_0x26ca03));}if(!_[_0x5228('0x34')](_0x26ca03,_0x18b7a4[_0x5228('0x2a')][_0x5228('0x35')])){return _0x3ed722(_0x144a2b[_0x5228('0x17')](0x1f4,'mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x26ca03));}var _0x31fe04={};_0x31fe04[_0x18b7a4['body'][_0x5228('0x35')]]=_0x18b7a4[_0x5228('0x2a')][_0x5228('0x31')];return db['MailAccount'][_0x5228('0x28')]({'where':{'id':_0x18b7a4[_0x5228('0x36')]['id']},'include':[{'model':db[_0x5228('0x37')],'as':'List','include':[{'model':db['CmContact'],'as':_0x5228('0x38'),'where':_0x31fe04,'limit':0x1,'order':[['updatedAt',_0x5228('0x39')]]}]},{'model':db[_0x5228('0x3a')],'as':'Applications'},{'model':db[_0x5228('0x3b')],'as':'Smtp'}]})[_0x5228('0x12')](function(_0x11e49e){if(_0x11e49e&&_0x11e49e[_0x5228('0x3c')]){var _0x2f7386=_0x11e49e[_0x5228('0x3d')]({'plain':!![]});_0x81e1e6[_0x5228('0x36')]=_['omit'](_0x2f7386,[_0x5228('0x3e'),_0x5228('0x3c')]);_0x81e1e6[_0x5228('0x3f')]=_0x2f7386[_0x5228('0x3e')];_0x81e1e6[_0x5228('0x40')]=_0x2f7386[_0x5228('0x3c')];_0x81e1e6[_0x5228('0x3f')]=_[_0x5228('0x41')](_0x81e1e6[_0x5228('0x3f')],[_0x5228('0x42')],['asc']);if(_0x81e1e6[_0x5228('0x36')]&&_0x81e1e6[_0x5228('0x36')][_0x5228('0x43')]){_0x81e1e6[_0x5228('0x3f')]['push']({'id':0x0,'priority':_0x81e1e6[_0x5228('0x3f')][_0x5228('0x44')]+0x1,'app':_0x5228('0x45'),'appdata':_0x5228('0x43'),'interval':_0x5228('0x46')});}if(_0x81e1e6[_0x5228('0x36')][_0x5228('0x3e')]){delete _0x81e1e6['account'][_0x5228('0x3e')];}if(_0x81e1e6[_0x5228('0x36')][_0x5228('0x3c')]){delete _0x81e1e6[_0x5228('0x36')][_0x5228('0x3c')];}if(_0x2f7386[_0x5228('0x3c')]['Contacts'][_0x5228('0x44')]){return _0x2f7386[_0x5228('0x3c')][_0x5228('0x38')][0x0];}var _0x54932f=_['defaults'](_0x18b7a4[_0x5228('0x2a')],{'firstName':_0x18b7a4['body'][_0x5228('0x31')],'ListId':_0x2f7386[_0x5228('0x2f')]});_0x54932f[_0x18b7a4[_0x5228('0x2a')][_0x5228('0x35')]]=_0x18b7a4[_0x5228('0x2a')]['from'];return db[_0x5228('0x2d')][_0x5228('0x47')](_0x54932f);}else{throw new Error(_0x5228('0x48'));}})[_0x5228('0x12')](function(_0x9959f3){_0x81e1e6[_0x5228('0x49')]=_0x9959f3;if(_0x9959f3){if(!_0x18b7a4[_0x5228('0x2a')][_0x5228('0x19')][_0x5228('0x4a')]){_0x18b7a4['body'][_0x5228('0x19')][_0x5228('0x4a')]=rs[_0x5228('0x4b')]()+'\x20'+_0x18b7a4[_0x5228('0x2a')][_0x5228('0x19')][_0x5228('0x31')];}var _0x4395fd={'ContactId':_0x9959f3['id'],'MailAccountId':_0x18b7a4[_0x5228('0x36')]['id'],'inReplyTo':_0x18b7a4[_0x5228('0x2a')][_0x5228('0x19')]['messageId'],'to':_0x18b7a4[_0x5228('0x2a')][_0x5228('0x19')][_0x5228('0x31')],'cc':_0x18b7a4[_0x5228('0x2a')][_0x5228('0x19')]['cc'],'subject':_0x18b7a4[_0x5228('0x2a')]['message']['subject'],'attach':_0x18b7a4[_0x5228('0x2a')][_0x5228('0x19')]['attach'],'lastMsgAt':moment()['format'](_0x5228('0x4c')),'lastMsgDirection':'in'};return db[_0x5228('0x4d')]['find']({'where':{'closed':![],'MailAccountId':_0x18b7a4['account']['id']},'include':[{'model':db[_0x5228('0x4e')],'as':_0x5228('0x4f'),'attributes':[_0x5228('0x4a')],'where':{'messageId':_0x18b7a4[_0x5228('0x2a')][_0x5228('0x19')][_0x5228('0x50')]}}]})['then'](function(_0x4ea208){if(_0x4ea208){return[_0x4ea208,![]];}return db[_0x5228('0x4d')][_0x5228('0x47')](_0x4395fd)[_0x5228('0x12')](function(_0xc70f68){return[_0xc70f68,!![]];});});}else{throw new Error(_0x5228('0x51'));}})[_0x5228('0x52')](function(_0x5deece,_0x44b73f){if(_0x5deece){_0x5e6245=_0x44b73f;if(!_0x44b73f){return _0x5deece[_0x5228('0x53')]({'inReplyTo':_0x18b7a4['body'][_0x5228('0x19')][_0x5228('0x4a')],'to':_0x18b7a4[_0x5228('0x2a')][_0x5228('0x19')][_0x5228('0x31')],'cc':_0x18b7a4[_0x5228('0x2a')][_0x5228('0x19')]['cc'],'subject':_0x18b7a4[_0x5228('0x2a')]['message'][_0x5228('0x54')],'attach':_0x5deece['attach']?_0x5deece[_0x5228('0x55')]:_0x18b7a4[_0x5228('0x2a')][_0x5228('0x19')][_0x5228('0x55')],'substatus':null,'substatusAt':moment()['format'](_0x5228('0x4c')),'lastMsgAt':moment()[_0x5228('0x56')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':'in'});}else{return _0x5deece;}}})['then'](function(_0x25656b){_0x81e1e6[_0x5228('0x57')]=_0x25656b[_0x5228('0x3d')]({'plain':!![]});_0x81e1e6['interaction'][_0x5228('0x58')]=_0x5e6245;return db[_0x5228('0x4e')][_0x5228('0x47')]({'body':_0x18b7a4[_0x5228('0x2a')][_0x5228('0x2a')],'MailAccountId':_0x18b7a4[_0x5228('0x36')]['id'],'MailInteractionId':_0x25656b['id'],'direction':'in','ContactId':_0x81e1e6['contact']['id'],'messageId':_0x18b7a4['body']['message'][_0x5228('0x4a')],'from':_0x18b7a4['body'][_0x5228('0x19')][_0x5228('0x31')],'to':_0x18b7a4[_0x5228('0x2a')][_0x5228('0x19')]['to'],'cc':_0x18b7a4[_0x5228('0x2a')][_0x5228('0x19')]['cc'],'subject':_0x18b7a4[_0x5228('0x2a')]['message'][_0x5228('0x54')],'attach':_0x18b7a4[_0x5228('0x2a')][_0x5228('0x19')][_0x5228('0x55')],'Attachments':_0x18b7a4['body'][_0x5228('0x19')][_0x5228('0x59')],'originTo':_0x18b7a4[_0x5228('0x2a')][_0x5228('0x19')][_0x5228('0x5a')],'originCc':_0x18b7a4['body'][_0x5228('0x19')]['originCc'],'bcc':_0x18b7a4['body'][_0x5228('0x19')]['bcc'],'ChatWebsiteId':_0x18b7a4[_0x5228('0x2a')][_0x5228('0x19')][_0x5228('0x5b')]||null,'originChannel':_0x18b7a4['body'][_0x5228('0x19')][_0x5228('0x5c')]||'Email','ChatOfflineMessageId':_0x18b7a4['body'][_0x5228('0x19')]['ChatOfflineMessageId']||null},{'include':[{'model':db[_0x5228('0x5d')],'as':'Attachments'}]});})[_0x5228('0x12')](function(_0x591f9a){_0x81e1e6['message']=_0x591f9a;if(_0x81e1e6[_0x5228('0x57')][_0x5228('0x5e')]){return db[_0x5228('0x5f')][_0x5228('0x28')]({'attributes':['id',_0x5228('0x60')],'where':{'id':_0x81e1e6[_0x5228('0x57')][_0x5228('0x5e')]}})[_0x5228('0x12')](function(_0x4c2d6c){if(_0x4c2d6c){_0x81e1e6['applications'][_0x5228('0x61')]({'id':0x0,'priority':0x0,'app':_0x5228('0x62'),'appdata':_0x4c2d6c[_0x5228('0x60')]+','+(_0x81e1e6['account']['waitForTheAssignedAgent']||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise(_0x5228('0x63'),_0x5228('0x64'),_0x81e1e6);});}return respondWithRpcPromise('Start',_0x5228('0x64'),_0x81e1e6);})[_0x5228('0x12')](function(_0x363b6c){_0x834c64(_0x363b6c);})[_0x5228('0x1c')](function(_0x4123f2){_0x3ed722(_0x144a2b['error'](0x1f4,_0x4123f2[_0x5228('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.socket.js b/server/api/mailAccount/mailAccount.socket.js index fdfbeaa..b7f8b05 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 _0xffdd=['removeListener','register','length','mailAccount:','./mailAccount.events','save','remove'];(function(_0x267095,_0xd6b820){var _0x2c31be=function(_0xed99a8){while(--_0xed99a8){_0x267095['push'](_0x267095['shift']());}};_0x2c31be(++_0xd6b820);}(_0xffdd,0x193));var _0xdffd=function(_0x28dfc,_0x1c669d){_0x28dfc=_0x28dfc-0x0;var _0x4a3541=_0xffdd[_0x28dfc];return _0x4a3541;};'use strict';var MailAccountEvents=require(_0xdffd('0x0'));var events=[_0xdffd('0x1'),_0xdffd('0x2'),'update'];function createListener(_0x588c2d,_0x2b4099){return function(_0x16447f){_0x2b4099['emit'](_0x588c2d,_0x16447f);};}function removeListener(_0x37e2c4,_0x295cff){return function(){MailAccountEvents[_0xdffd('0x3')](_0x37e2c4,_0x295cff);};}exports[_0xdffd('0x4')]=function(_0x54aaf8){for(var _0x581162=0x0,_0x4835f6=events[_0xdffd('0x5')];_0x581162<_0x4835f6;_0x581162++){var _0x25cd14=events[_0x581162];var _0x1c39c6=createListener(_0xdffd('0x6')+_0x25cd14,_0x54aaf8);MailAccountEvents['on'](_0x25cd14,_0x1c39c6);}}; \ No newline at end of file +var _0x5229=['length','mailAccount:','save','remove','update','emit','removeListener','register'];(function(_0x1e32d4,_0xfc50eb){var _0x3c4698=function(_0x281e00){while(--_0x281e00){_0x1e32d4['push'](_0x1e32d4['shift']());}};_0x3c4698(++_0xfc50eb);}(_0x5229,0xba));var _0x9522=function(_0x1cb297,_0x1b1753){_0x1cb297=_0x1cb297-0x0;var _0x18e04f=_0x5229[_0x1cb297];return _0x18e04f;};'use strict';var MailAccountEvents=require('./mailAccount.events');var events=[_0x9522('0x0'),_0x9522('0x1'),_0x9522('0x2')];function createListener(_0x2f9f7e,_0x5cb22e){return function(_0x4e56fb){_0x5cb22e[_0x9522('0x3')](_0x2f9f7e,_0x4e56fb);};}function removeListener(_0x1f8d0e,_0x4692bf){return function(){MailAccountEvents[_0x9522('0x4')](_0x1f8d0e,_0x4692bf);};}exports[_0x9522('0x5')]=function(_0x15d3f7){for(var _0x5c3497=0x0,_0x1d9f4f=events[_0x9522('0x6')];_0x5c3497<_0x1d9f4f;_0x5c3497++){var _0x4fbd3b=events[_0x5c3497];var _0x1d00a2=createListener(_0x9522('0x7')+_0x4fbd3b,_0x15d3f7);MailAccountEvents['on'](_0x4fbd3b,_0x1d00a2);}}; \ No newline at end of file diff --git a/server/api/mailApplication/index.js b/server/api/mailApplication/index.js index 1785fe8..3b3e80c 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 _0xf27e=['express','fs-extra','../../components/auth/service','../../config/environment','./mailApplication.controller','get','isAuthenticated','show','put','/:id','destroy','exports','multer','util','connect-timeout'];(function(_0x5627e1,_0x1b2dbf){var _0x2f013f=function(_0x142015){while(--_0x142015){_0x5627e1['push'](_0x5627e1['shift']());}};_0x2f013f(++_0x1b2dbf);}(_0xf27e,0x75));var _0xef27=function(_0x3f8c2e,_0x51a869){_0x3f8c2e=_0x3f8c2e-0x0;var _0x5590f6=_0xf27e[_0x3f8c2e];return _0x5590f6;};'use strict';var multer=require(_0xef27('0x0'));var util=require(_0xef27('0x1'));var path=require('path');var timeout=require(_0xef27('0x2'));var express=require(_0xef27('0x3'));var router=express['Router']();var fs_extra=require(_0xef27('0x4'));var auth=require(_0xef27('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xef27('0x6'));var controller=require(_0xef27('0x7'));router[_0xef27('0x8')]('/:id',auth[_0xef27('0x9')](),controller[_0xef27('0xa')]);router[_0xef27('0xb')](_0xef27('0xc'),auth[_0xef27('0x9')](),controller['update']);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xef27('0xd')]);module[_0xef27('0xe')]=router; \ No newline at end of file +var _0xf32f=['put','delete','exports','multer','path','connect-timeout','express','Router','fs-extra','../../config/environment','./mailApplication.controller','/:id','isAuthenticated'];(function(_0x3ab9ee,_0x4a74b8){var _0x82ee88=function(_0x6ccc7e){while(--_0x6ccc7e){_0x3ab9ee['push'](_0x3ab9ee['shift']());}};_0x82ee88(++_0x4a74b8);}(_0xf32f,0x1a3));var _0xff32=function(_0x12b502,_0x231484){_0x12b502=_0x12b502-0x0;var _0x2be86a=_0xf32f[_0x12b502];return _0x2be86a;};'use strict';var multer=require(_0xff32('0x0'));var util=require('util');var path=require(_0xff32('0x1'));var timeout=require(_0xff32('0x2'));var express=require(_0xff32('0x3'));var router=express[_0xff32('0x4')]();var fs_extra=require(_0xff32('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xff32('0x6'));var controller=require(_0xff32('0x7'));router['get'](_0xff32('0x8'),auth[_0xff32('0x9')](),controller['show']);router[_0xff32('0xa')](_0xff32('0x8'),auth[_0xff32('0x9')](),controller['update']);router[_0xff32('0xb')](_0xff32('0x8'),auth[_0xff32('0x9')](),controller['destroy']);module[_0xff32('0xc')]=router; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.attributes.js b/server/api/mailApplication/mailApplication.attributes.js index 5368f18..3cdc6a9 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 _0xc343=['STRING','*,*,*,*','exports','noop','TEXT'];(function(_0x4f8929,_0xf41720){var _0x3b67ed=function(_0x5727e2){while(--_0x5727e2){_0x4f8929['push'](_0x4f8929['shift']());}};_0x3b67ed(++_0xf41720);}(_0xc343,0x7f));var _0x3c34=function(_0x3bac1a,_0x4ab08c){_0x3bac1a=_0x3bac1a-0x0;var _0x20ab99=_0xc343[_0x3bac1a];return _0x20ab99;};'use strict';var Sequelize=require('sequelize');module[_0x3c34('0x0')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x3c34('0x1')},'appdata':{'type':Sequelize[_0x3c34('0x2')]()},'description':{'type':Sequelize[_0x3c34('0x3')]},'interval':{'type':Sequelize[_0x3c34('0x3')],'defaultValue':_0x3c34('0x4')}}; \ No newline at end of file +var _0x460b=['exports','INTEGER','STRING','noop','TEXT','*,*,*,*','sequelize'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x460b,0x84));var _0xb460=function(_0x28f5cb,_0x37fadc){_0x28f5cb=_0x28f5cb-0x0;var _0x27cd13=_0x460b[_0x28f5cb];return _0x27cd13;};'use strict';var Sequelize=require(_0xb460('0x0'));module[_0xb460('0x1')]={'priority':{'type':Sequelize[_0xb460('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0xb460('0x3')],'allowNull':![],'defaultValue':_0xb460('0x4')},'appdata':{'type':Sequelize[_0xb460('0x5')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0xb460('0x3')],'defaultValue':_0xb460('0x6')}}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.controller.js b/server/api/mailApplication/mailApplication.controller.js index e8134a1..48833f5 100644 --- a/server/api/mailApplication/mailApplication.controller.js +++ b/server/api/mailApplication/mailApplication.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe706=['limit','count','offset','set','Content-Range','json','apply','save','update','then','end','name','send','show','params','model','keys','MailApplication','rawAttributes','query','filters','attributes','intersection','fields','length','includeAll','include','merge','options','find','body','catch','destroy','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','undefined'];(function(_0x1c56b1,_0x12b079){var _0x137e84=function(_0x273391){while(--_0x273391){_0x1c56b1['push'](_0x1c56b1['shift']());}};_0x137e84(++_0x12b079);}(_0xe706,0xa3));var _0x6e70=function(_0x39ffd1,_0x299703){_0x39ffd1=_0x39ffd1-0x0;var _0x31267e=_0xe706[_0x39ffd1];return _0x31267e;};'use strict';var emlformat=require(_0x6e70('0x0'));var rimraf=require(_0x6e70('0x1'));var zipdir=require(_0x6e70('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6e70('0x3'));var moment=require(_0x6e70('0x4'));var BPromise=require(_0x6e70('0x5'));var Mustache=require(_0x6e70('0x6'));var util=require(_0x6e70('0x7'));var path=require(_0x6e70('0x8'));var sox=require(_0x6e70('0x9'));var csv=require(_0x6e70('0xa'));var ejs=require(_0x6e70('0xb'));var fs=require('fs');var fs_extra=require(_0x6e70('0xc'));var _=require(_0x6e70('0xd'));var squel=require(_0x6e70('0xe'));var crypto=require(_0x6e70('0xf'));var jsforce=require(_0x6e70('0x10'));var deskjs=require(_0x6e70('0x11'));var toCsv=require(_0x6e70('0xa'));var querystring=require(_0x6e70('0x12'));var Papa=require(_0x6e70('0x13'));var Redis=require(_0x6e70('0x14'));var authService=require(_0x6e70('0x15'));var qs=require(_0x6e70('0x16'));var as=require(_0x6e70('0x17'));var hardwareService=require(_0x6e70('0x18'));var logger=require(_0x6e70('0x19'))('api');var utils=require('../../config/utils');var config=require(_0x6e70('0x1a'));var licenseUtil=require(_0x6e70('0x1b'));var db=require(_0x6e70('0x1c'))['db'];function respondWithStatusCode(_0x27dd9b,_0x3b38f3){_0x3b38f3=_0x3b38f3||0xcc;return function(_0x310eb7){if(_0x310eb7){return _0x27dd9b[_0x6e70('0x1d')](_0x3b38f3);}return _0x27dd9b[_0x6e70('0x1e')](_0x3b38f3)['end']();};}function respondWithResult(_0x52737e,_0x48bc72){_0x48bc72=_0x48bc72||0xc8;return function(_0x257e81){if(_0x257e81){return _0x52737e['status'](_0x48bc72)['json'](_0x257e81);}};}function respondWithFilteredResult(_0x304716,_0x22c50c){return function(_0x5d9263){if(_0x5d9263){var _0x24f3ac=typeof _0x22c50c['offset']===_0x6e70('0x1f')&&typeof _0x22c50c[_0x6e70('0x20')]==='undefined';var _0x49029f=_0x5d9263[_0x6e70('0x21')];var _0x5ea7a5=_0x24f3ac?0x0:_0x22c50c[_0x6e70('0x22')];var _0x173afe=_0x24f3ac?_0x5d9263['count']:_0x22c50c['offset']+_0x22c50c[_0x6e70('0x20')];var _0x208e21;if(_0x173afe>=_0x49029f){_0x173afe=_0x49029f;_0x208e21=0xc8;}else{_0x208e21=0xce;}_0x304716[_0x6e70('0x1e')](_0x208e21);return _0x304716[_0x6e70('0x23')](_0x6e70('0x24'),_0x5ea7a5+'-'+_0x173afe+'/'+_0x49029f)[_0x6e70('0x25')](_0x5d9263);}return null;};}function patchUpdates(_0x1b2453){return function(_0x44a49f){try{jsonpatch[_0x6e70('0x26')](_0x44a49f,_0x1b2453,!![]);}catch(_0xb29a2a){return BPromise['reject'](_0xb29a2a);}return _0x44a49f[_0x6e70('0x27')]();};}function saveUpdates(_0x344b65,_0x27b294){return function(_0x502b2d){if(_0x502b2d){return _0x502b2d[_0x6e70('0x28')](_0x344b65)[_0x6e70('0x29')](function(_0x3337a6){return _0x3337a6;});}return null;};}function removeEntity(_0x50da2c,_0x10fc91){return function(_0x538b9c){if(_0x538b9c){return _0x538b9c['destroy']()['then'](function(){_0x50da2c[_0x6e70('0x1e')](0xcc)[_0x6e70('0x2a')]();});}};}function handleEntityNotFound(_0x51d292,_0x3ecdf1){return function(_0x1196ed){if(!_0x1196ed){_0x51d292['sendStatus'](0x194);}return _0x1196ed;};}function handleError(_0x338ad6,_0x67fb43){_0x67fb43=_0x67fb43||0x1f4;return function(_0x2bb231){logger['error'](_0x2bb231['stack']);if(_0x2bb231[_0x6e70('0x2b')]){delete _0x2bb231[_0x6e70('0x2b')];}_0x338ad6[_0x6e70('0x1e')](_0x67fb43)[_0x6e70('0x2c')](_0x2bb231);};}exports[_0x6e70('0x2d')]=function(_0x5d772a,_0x1952ea){var _0x406f29={'raw':!![],'where':{'id':_0x5d772a[_0x6e70('0x2e')]['id']}},_0xecf336={};_0xecf336[_0x6e70('0x2f')]=_[_0x6e70('0x30')](db[_0x6e70('0x31')][_0x6e70('0x32')]);_0xecf336[_0x6e70('0x33')]=_[_0x6e70('0x30')](_0x5d772a['query']);_0xecf336[_0x6e70('0x34')]=_['intersection'](_0xecf336[_0x6e70('0x2f')],_0xecf336['query']);_0x406f29[_0x6e70('0x35')]=_[_0x6e70('0x36')](_0xecf336[_0x6e70('0x2f')],qs['fields'](_0x5d772a[_0x6e70('0x33')][_0x6e70('0x37')]));_0x406f29['attributes']=_0x406f29[_0x6e70('0x35')][_0x6e70('0x38')]?_0x406f29['attributes']:_0xecf336[_0x6e70('0x2f')];if(_0x5d772a[_0x6e70('0x33')][_0x6e70('0x39')]){_0x406f29[_0x6e70('0x3a')]=[{'all':!![]}];}_0x406f29=_[_0x6e70('0x3b')]({},_0x406f29,_0x5d772a[_0x6e70('0x3c')]);return db[_0x6e70('0x31')][_0x6e70('0x3d')](_0x406f29)[_0x6e70('0x29')](handleEntityNotFound(_0x1952ea,null))[_0x6e70('0x29')](respondWithResult(_0x1952ea,null))['catch'](handleError(_0x1952ea,null));};exports[_0x6e70('0x28')]=function(_0x4795a0,_0x23cd1a){if(_0x4795a0[_0x6e70('0x3e')]['id']){delete _0x4795a0[_0x6e70('0x3e')]['id'];}return db[_0x6e70('0x31')][_0x6e70('0x3d')]({'where':{'id':_0x4795a0[_0x6e70('0x2e')]['id']}})[_0x6e70('0x29')](handleEntityNotFound(_0x23cd1a,null))[_0x6e70('0x29')](saveUpdates(_0x4795a0[_0x6e70('0x3e')],null))[_0x6e70('0x29')](respondWithResult(_0x23cd1a,null))[_0x6e70('0x3f')](handleError(_0x23cd1a,null));};exports[_0x6e70('0x40')]=function(_0x5594d3,_0x501b53){return db['MailApplication']['find']({'where':{'id':_0x5594d3[_0x6e70('0x2e')]['id']}})[_0x6e70('0x29')](handleEntityNotFound(_0x501b53,null))[_0x6e70('0x29')](removeEntity(_0x501b53,null))[_0x6e70('0x3f')](handleError(_0x501b53,null));}; \ No newline at end of file +var _0x54ef=['api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','limit','undefined','count','offset','Content-Range','apply','reject','save','update','then','destroy','error','name','show','params','model','rawAttributes','query','keys','filters','intersection','attributes','fields','length','merge','options','MailApplication','find','body','catch','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','jsforce','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger'];(function(_0x335bfd,_0x5dbf4e){var _0x1173d9=function(_0x3b8301){while(--_0x3b8301){_0x335bfd['push'](_0x335bfd['shift']());}};_0x1173d9(++_0x5dbf4e);}(_0x54ef,0x112));var _0xf54e=function(_0x1f72df,_0x648662){_0x1f72df=_0x1f72df-0x0;var _0x444e35=_0x54ef[_0x1f72df];return _0x444e35;};'use strict';var emlformat=require(_0xf54e('0x0'));var rimraf=require(_0xf54e('0x1'));var zipdir=require(_0xf54e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf54e('0x3'));var moment=require(_0xf54e('0x4'));var BPromise=require(_0xf54e('0x5'));var Mustache=require(_0xf54e('0x6'));var util=require(_0xf54e('0x7'));var path=require(_0xf54e('0x8'));var sox=require(_0xf54e('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf54e('0xa'));var _=require(_0xf54e('0xb'));var squel=require(_0xf54e('0xc'));var crypto=require('crypto');var jsforce=require(_0xf54e('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xf54e('0xe'));var querystring=require(_0xf54e('0xf'));var Papa=require('papaparse');var Redis=require(_0xf54e('0x10'));var authService=require(_0xf54e('0x11'));var qs=require(_0xf54e('0x12'));var as=require(_0xf54e('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf54e('0x14'))(_0xf54e('0x15'));var utils=require(_0xf54e('0x16'));var config=require(_0xf54e('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xf54e('0x18'))['db'];function respondWithStatusCode(_0x4b0ee1,_0x4bd828){_0x4bd828=_0x4bd828||0xcc;return function(_0x15a9d4){if(_0x15a9d4){return _0x4b0ee1[_0xf54e('0x19')](_0x4bd828);}return _0x4b0ee1[_0xf54e('0x1a')](_0x4bd828)[_0xf54e('0x1b')]();};}function respondWithResult(_0x5644aa,_0x331732){_0x331732=_0x331732||0xc8;return function(_0x1bbeaa){if(_0x1bbeaa){return _0x5644aa[_0xf54e('0x1a')](_0x331732)[_0xf54e('0x1c')](_0x1bbeaa);}};}function respondWithFilteredResult(_0x56828e,_0x2366ee){return function(_0x389abc){if(_0x389abc){var _0x3eb415=typeof _0x2366ee['offset']==='undefined'&&typeof _0x2366ee[_0xf54e('0x1d')]===_0xf54e('0x1e');var _0x1c02e7=_0x389abc[_0xf54e('0x1f')];var _0x15cc48=_0x3eb415?0x0:_0x2366ee[_0xf54e('0x20')];var _0x2e27b6=_0x3eb415?_0x389abc[_0xf54e('0x1f')]:_0x2366ee[_0xf54e('0x20')]+_0x2366ee[_0xf54e('0x1d')];var _0x226c96;if(_0x2e27b6>=_0x1c02e7){_0x2e27b6=_0x1c02e7;_0x226c96=0xc8;}else{_0x226c96=0xce;}_0x56828e['status'](_0x226c96);return _0x56828e['set'](_0xf54e('0x21'),_0x15cc48+'-'+_0x2e27b6+'/'+_0x1c02e7)['json'](_0x389abc);}return null;};}function patchUpdates(_0x3e1556){return function(_0x1bfe99){try{jsonpatch[_0xf54e('0x22')](_0x1bfe99,_0x3e1556,!![]);}catch(_0x9903fc){return BPromise[_0xf54e('0x23')](_0x9903fc);}return _0x1bfe99[_0xf54e('0x24')]();};}function saveUpdates(_0x388aa0,_0x11985e){return function(_0x3c0169){if(_0x3c0169){return _0x3c0169[_0xf54e('0x25')](_0x388aa0)[_0xf54e('0x26')](function(_0x5b83df){return _0x5b83df;});}return null;};}function removeEntity(_0x6f6d29,_0x54f914){return function(_0x264a8f){if(_0x264a8f){return _0x264a8f[_0xf54e('0x27')]()[_0xf54e('0x26')](function(){_0x6f6d29[_0xf54e('0x1a')](0xcc)[_0xf54e('0x1b')]();});}};}function handleEntityNotFound(_0x160160,_0x1e08d1){return function(_0x43488d){if(!_0x43488d){_0x160160[_0xf54e('0x19')](0x194);}return _0x43488d;};}function handleError(_0x33457f,_0xf6cdd7){_0xf6cdd7=_0xf6cdd7||0x1f4;return function(_0x39c0ae){logger[_0xf54e('0x28')](_0x39c0ae['stack']);if(_0x39c0ae[_0xf54e('0x29')]){delete _0x39c0ae['name'];}_0x33457f[_0xf54e('0x1a')](_0xf6cdd7)['send'](_0x39c0ae);};}exports[_0xf54e('0x2a')]=function(_0x269f47,_0x21ba00){var _0xa13cd0={'raw':!![],'where':{'id':_0x269f47[_0xf54e('0x2b')]['id']}},_0x25b643={};_0x25b643[_0xf54e('0x2c')]=_['keys'](db['MailApplication'][_0xf54e('0x2d')]);_0x25b643[_0xf54e('0x2e')]=_[_0xf54e('0x2f')](_0x269f47[_0xf54e('0x2e')]);_0x25b643[_0xf54e('0x30')]=_[_0xf54e('0x31')](_0x25b643[_0xf54e('0x2c')],_0x25b643[_0xf54e('0x2e')]);_0xa13cd0[_0xf54e('0x32')]=_[_0xf54e('0x31')](_0x25b643['model'],qs['fields'](_0x269f47[_0xf54e('0x2e')][_0xf54e('0x33')]));_0xa13cd0['attributes']=_0xa13cd0[_0xf54e('0x32')][_0xf54e('0x34')]?_0xa13cd0[_0xf54e('0x32')]:_0x25b643[_0xf54e('0x2c')];if(_0x269f47['query']['includeAll']){_0xa13cd0['include']=[{'all':!![]}];}_0xa13cd0=_[_0xf54e('0x35')]({},_0xa13cd0,_0x269f47[_0xf54e('0x36')]);return db[_0xf54e('0x37')][_0xf54e('0x38')](_0xa13cd0)[_0xf54e('0x26')](handleEntityNotFound(_0x21ba00,null))[_0xf54e('0x26')](respondWithResult(_0x21ba00,null))['catch'](handleError(_0x21ba00,null));};exports['update']=function(_0x530cee,_0xc04e04){if(_0x530cee[_0xf54e('0x39')]['id']){delete _0x530cee['body']['id'];}return db['MailApplication'][_0xf54e('0x38')]({'where':{'id':_0x530cee[_0xf54e('0x2b')]['id']}})[_0xf54e('0x26')](handleEntityNotFound(_0xc04e04,null))['then'](saveUpdates(_0x530cee[_0xf54e('0x39')],null))[_0xf54e('0x26')](respondWithResult(_0xc04e04,null))['catch'](handleError(_0xc04e04,null));};exports[_0xf54e('0x27')]=function(_0x6e5bdf,_0x5af03){return db[_0xf54e('0x37')][_0xf54e('0x38')]({'where':{'id':_0x6e5bdf[_0xf54e('0x2b')]['id']}})['then'](handleEntityNotFound(_0x5af03,null))['then'](removeEntity(_0x5af03,null))[_0xf54e('0x3a')](handleError(_0x5af03,null));}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.model.js b/server/api/mailApplication/mailApplication.model.js index 795e7a5..30f595b 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 _0x925d=['MailApplication','mail_applications','utf8mb4','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./mailApplication.attributes','exports','define'];(function(_0x44bdf1,_0x491750){var _0x2ba42e=function(_0x5427be){while(--_0x5427be){_0x44bdf1['push'](_0x44bdf1['shift']());}};_0x2ba42e(++_0x491750);}(_0x925d,0x12f));var _0xd925=function(_0x49ff77,_0x14c869){_0x49ff77=_0x49ff77-0x0;var _0x4814ad=_0x925d[_0x49ff77];return _0x4814ad;};'use strict';var _=require(_0xd925('0x0'));var util=require(_0xd925('0x1'));var logger=require(_0xd925('0x2'))(_0xd925('0x3'));var moment=require('moment');var BPromise=require(_0xd925('0x4'));var rp=require(_0xd925('0x5'));var fs=require('fs');var path=require(_0xd925('0x6'));var rimraf=require(_0xd925('0x7'));var config=require(_0xd925('0x8'));var attributes=require(_0xd925('0x9'));module[_0xd925('0xa')]=function(_0x31c286,_0x3338ff){return _0x31c286[_0xd925('0xb')](_0xd925('0xc'),attributes,{'tableName':_0xd925('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xd925('0xe'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x3a03=['define','MailApplication','mail_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./mailApplication.attributes'];(function(_0x173441,_0x26b0d9){var _0x2423a8=function(_0x4d96c2){while(--_0x4d96c2){_0x173441['push'](_0x173441['shift']());}};_0x2423a8(++_0x26b0d9);}(_0x3a03,0x9b));var _0x33a0=function(_0x1756cf,_0x3071ae){_0x1756cf=_0x1756cf-0x0;var _0x402219=_0x3a03[_0x1756cf];return _0x402219;};'use strict';var _=require(_0x33a0('0x0'));var util=require(_0x33a0('0x1'));var logger=require(_0x33a0('0x2'))('api');var moment=require(_0x33a0('0x3'));var BPromise=require(_0x33a0('0x4'));var rp=require(_0x33a0('0x5'));var fs=require('fs');var path=require(_0x33a0('0x6'));var rimraf=require(_0x33a0('0x7'));var config=require(_0x33a0('0x8'));var attributes=require(_0x33a0('0x9'));module['exports']=function(_0x18a20f,_0x31dab9){return _0x18a20f[_0x33a0('0xa')](_0x33a0('0xb'),attributes,{'tableName':_0x33a0('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x33a0('0xd'),'collate':_0x33a0('0xe')});}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.rpc.js b/server/api/mailApplication/mailApplication.rpc.js index 7e4698a..779ef1e 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 _0x6ae4=['where','attributes','limit','debug','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','info','request\x20sent','error','MailApplication,\x20%s,\x20%s','message','result','catch','UpdateMailApplication','update','body','options','raw'];(function(_0x2261d6,_0x49b42c){var _0x7c52b4=function(_0x5f4964){while(--_0x5f4964){_0x2261d6['push'](_0x2261d6['shift']());}};_0x7c52b4(++_0x49b42c);}(_0x6ae4,0x95));var _0x46ae=function(_0x1e32d4,_0xfc50eb){_0x1e32d4=_0x1e32d4-0x0;var _0x3c4698=_0x6ae4[_0x1e32d4];return _0x3c4698;};'use strict';var _=require(_0x46ae('0x0'));var util=require('util');var moment=require(_0x46ae('0x1'));var BPromise=require(_0x46ae('0x2'));var rs=require(_0x46ae('0x3'));var fs=require('fs');var Redis=require(_0x46ae('0x4'));var db=require(_0x46ae('0x5'))['db'];var utils=require(_0x46ae('0x6'));var logger=require('../../config/logger')(_0x46ae('0x7'));var config=require(_0x46ae('0x8'));var jayson=require(_0x46ae('0x9'));var client=jayson[_0x46ae('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x50e57e,_0x22646e,_0x4fccd4){return new BPromise(function(_0x4ee6f5,_0x3d4d37){return client[_0x46ae('0xb')](_0x50e57e,_0x4fccd4)[_0x46ae('0xc')](function(_0x22c119){logger[_0x46ae('0xd')]('MailApplication,\x20%s,\x20%s',_0x22646e,_0x46ae('0xe'));logger['debug']('MailApplication,\x20%s,\x20%s,\x20%s',_0x22646e,_0x46ae('0xe'),JSON['stringify'](_0x22c119));if(_0x22c119[_0x46ae('0xf')]){if(_0x22c119[_0x46ae('0xf')]['code']===0x1f4){logger[_0x46ae('0xf')](_0x46ae('0x10'),_0x22646e,_0x22c119[_0x46ae('0xf')]['message']);return _0x3d4d37(_0x22c119[_0x46ae('0xf')][_0x46ae('0x11')]);}logger[_0x46ae('0xf')](_0x46ae('0x10'),_0x22646e,_0x22c119['error']['message']);return _0x4ee6f5(_0x22c119[_0x46ae('0xf')][_0x46ae('0x11')]);}else{logger[_0x46ae('0xd')]('MailApplication,\x20%s,\x20%s',_0x22646e,_0x46ae('0xe'));_0x4ee6f5(_0x22c119[_0x46ae('0x12')][_0x46ae('0x11')]);}})[_0x46ae('0x13')](function(_0x26d050){logger[_0x46ae('0xf')](_0x46ae('0x10'),_0x22646e,_0x26d050);_0x3d4d37(_0x26d050);});});}exports[_0x46ae('0x14')]=function(_0x2b4f59){var _0x40f870=this;return new Promise(function(_0x2e257b,_0x19704a){return db['MailApplication'][_0x46ae('0x15')](_0x2b4f59[_0x46ae('0x16')],{'raw':_0x2b4f59[_0x46ae('0x17')]?_0x2b4f59[_0x46ae('0x17')][_0x46ae('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2b4f59[_0x46ae('0x17')]?_0x2b4f59[_0x46ae('0x17')][_0x46ae('0x19')]||null:null,'attributes':_0x2b4f59[_0x46ae('0x17')]?_0x2b4f59[_0x46ae('0x17')][_0x46ae('0x1a')]||null:null,'limit':_0x2b4f59[_0x46ae('0x17')]?_0x2b4f59[_0x46ae('0x17')][_0x46ae('0x1b')]||null:null})[_0x46ae('0xc')](function(_0x53fcc6){logger[_0x46ae('0xd')](_0x46ae('0x14'),_0x2b4f59);logger[_0x46ae('0x1c')](_0x46ae('0x14'),_0x2b4f59,JSON['stringify'](_0x53fcc6));_0x2e257b(_0x53fcc6);})['catch'](function(_0x452b5f){logger[_0x46ae('0xf')]('UpdateMailApplication',_0x452b5f[_0x46ae('0x11')],_0x2b4f59);_0x19704a(_0x40f870[_0x46ae('0xf')](0x1f4,_0x452b5f['message']));});});}; \ No newline at end of file +var _0xe476=['request\x20sent','debug','MailApplication,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','body','options','attributes','limit','UpdateMailApplication','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','MailApplication,\x20%s,\x20%s'];(function(_0x8fb7a4,_0x607700){var _0x1fdca2=function(_0x300754){while(--_0x300754){_0x8fb7a4['push'](_0x8fb7a4['shift']());}};_0x1fdca2(++_0x607700);}(_0xe476,0x79));var _0x6e47=function(_0x5da292,_0x2710cb){_0x5da292=_0x5da292-0x0;var _0x10c3c3=_0xe476[_0x5da292];return _0x10c3c3;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x6e47('0x0'));var BPromise=require('bluebird');var rs=require(_0x6e47('0x1'));var fs=require('fs');var Redis=require(_0x6e47('0x2'));var db=require(_0x6e47('0x3'))['db'];var utils=require(_0x6e47('0x4'));var logger=require(_0x6e47('0x5'))(_0x6e47('0x6'));var config=require(_0x6e47('0x7'));var jayson=require(_0x6e47('0x8'));var client=jayson['client'][_0x6e47('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4bfc78,_0x42d787,_0x229f40){return new BPromise(function(_0x35ca9e,_0x4de7d9){return client[_0x6e47('0xa')](_0x4bfc78,_0x229f40)[_0x6e47('0xb')](function(_0x2be95d){logger[_0x6e47('0xc')](_0x6e47('0xd'),_0x42d787,_0x6e47('0xe'));logger[_0x6e47('0xf')](_0x6e47('0x10'),_0x42d787,_0x6e47('0xe'),JSON[_0x6e47('0x11')](_0x2be95d));if(_0x2be95d[_0x6e47('0x12')]){if(_0x2be95d['error']['code']===0x1f4){logger['error'](_0x6e47('0xd'),_0x42d787,_0x2be95d[_0x6e47('0x12')][_0x6e47('0x13')]);return _0x4de7d9(_0x2be95d[_0x6e47('0x12')]['message']);}logger['error'](_0x6e47('0xd'),_0x42d787,_0x2be95d[_0x6e47('0x12')][_0x6e47('0x13')]);return _0x35ca9e(_0x2be95d[_0x6e47('0x12')]['message']);}else{logger[_0x6e47('0xc')](_0x6e47('0xd'),_0x42d787,_0x6e47('0xe'));_0x35ca9e(_0x2be95d[_0x6e47('0x14')]['message']);}})[_0x6e47('0x15')](function(_0x45a015){logger[_0x6e47('0x12')](_0x6e47('0xd'),_0x42d787,_0x45a015);_0x4de7d9(_0x45a015);});});}exports['UpdateMailApplication']=function(_0x130a4c){var _0x55a365=this;return new Promise(function(_0x5865bb,_0x22f4c6){return db['MailApplication']['update'](_0x130a4c[_0x6e47('0x16')],{'raw':_0x130a4c[_0x6e47('0x17')]?_0x130a4c[_0x6e47('0x17')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x130a4c[_0x6e47('0x17')]?_0x130a4c[_0x6e47('0x17')]['where']||null:null,'attributes':_0x130a4c[_0x6e47('0x17')]?_0x130a4c[_0x6e47('0x17')][_0x6e47('0x18')]||null:null,'limit':_0x130a4c[_0x6e47('0x17')]?_0x130a4c[_0x6e47('0x17')][_0x6e47('0x19')]||null:null})[_0x6e47('0xb')](function(_0x113134){logger[_0x6e47('0xc')](_0x6e47('0x1a'),_0x130a4c);logger[_0x6e47('0xf')](_0x6e47('0x1a'),_0x130a4c,JSON['stringify'](_0x113134));_0x5865bb(_0x113134);})[_0x6e47('0x15')](function(_0x3c084b){logger[_0x6e47('0x12')]('UpdateMailApplication',_0x3c084b[_0x6e47('0x13')],_0x130a4c);_0x22f4c6(_0x55a365[_0x6e47('0x12')](0x1f4,_0x3c084b[_0x6e47('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/index.js b/server/api/mailInteraction/index.js index f48b91a..0744dd5 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 _0xc401=['download','post','create','addMessage','/:id/tags','tracked','addTags','mail','mailinteraction:update','update','delete','destroy','express','../../components/auth/service','../../components/interaction/service','./mailInteraction.controller','isAuthenticated','index','get','/describe','/:id','show','/:id/messages','getMessages','/:id/download'];(function(_0x53d732,_0x4e695e){var _0x249c2c=function(_0x337e95){while(--_0x337e95){_0x53d732['push'](_0x53d732['shift']());}};_0x249c2c(++_0x4e695e);}(_0xc401,0x138));var _0x1c40=function(_0x197656,_0x153dcb){_0x197656=_0x197656-0x0;var _0xe93c86=_0xc401[_0x197656];return _0xe93c86;};'use strict';var express=require(_0x1c40('0x0'));var router=express['Router']();var auth=require(_0x1c40('0x1'));var interaction=require(_0x1c40('0x2'));var controller=require(_0x1c40('0x3'));router['get']('/',auth[_0x1c40('0x4')](),controller[_0x1c40('0x5')]);router[_0x1c40('0x6')](_0x1c40('0x7'),auth[_0x1c40('0x4')](),controller['describe']);router['get'](_0x1c40('0x8'),auth['isAuthenticated'](),controller[_0x1c40('0x9')]);router['get'](_0x1c40('0xa'),auth[_0x1c40('0x4')](),controller[_0x1c40('0xb')]);router[_0x1c40('0x6')](_0x1c40('0xc'),auth[_0x1c40('0x4')](),controller[_0x1c40('0xd')]);router[_0x1c40('0xe')]('/',auth[_0x1c40('0x4')](),controller[_0x1c40('0xf')]);router[_0x1c40('0xe')](_0x1c40('0xa'),auth[_0x1c40('0x4')](),controller[_0x1c40('0x10')]);router[_0x1c40('0xe')](_0x1c40('0x11'),auth[_0x1c40('0x4')](),interaction[_0x1c40('0x12')]('mail','mailinteraction:addtags'),controller[_0x1c40('0x13')]);router['put'](_0x1c40('0x8'),auth[_0x1c40('0x4')](),interaction[_0x1c40('0x12')](_0x1c40('0x14'),_0x1c40('0x15')),controller[_0x1c40('0x16')]);router[_0x1c40('0x17')](_0x1c40('0x8'),auth[_0x1c40('0x4')](),interaction[_0x1c40('0x12')]('mail','mailinteraction:destroy'),controller[_0x1c40('0x18')]);router[_0x1c40('0x17')]('/:id/tags',auth[_0x1c40('0x4')](),controller['removeTags']);module['exports']=router; \ No newline at end of file +var _0xdd95=['get','isAuthenticated','index','/describe','describe','/:id','show','/:id/messages','getMessages','download','post','create','/:id/tags','tracked','mail','mailinteraction:addtags','addTags','put','update','delete','removeTags','Router','../../components/auth/service','../../components/interaction/service','./mailInteraction.controller'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xdd95,0x128));var _0x5dd9=function(_0x45f2fe,_0x3534e0){_0x45f2fe=_0x45f2fe-0x0;var _0x511a6d=_0xdd95[_0x45f2fe];return _0x511a6d;};'use strict';var express=require('express');var router=express[_0x5dd9('0x0')]();var auth=require(_0x5dd9('0x1'));var interaction=require(_0x5dd9('0x2'));var controller=require(_0x5dd9('0x3'));router[_0x5dd9('0x4')]('/',auth[_0x5dd9('0x5')](),controller[_0x5dd9('0x6')]);router[_0x5dd9('0x4')](_0x5dd9('0x7'),auth[_0x5dd9('0x5')](),controller[_0x5dd9('0x8')]);router['get'](_0x5dd9('0x9'),auth[_0x5dd9('0x5')](),controller[_0x5dd9('0xa')]);router[_0x5dd9('0x4')](_0x5dd9('0xb'),auth[_0x5dd9('0x5')](),controller[_0x5dd9('0xc')]);router[_0x5dd9('0x4')]('/:id/download',auth[_0x5dd9('0x5')](),controller[_0x5dd9('0xd')]);router[_0x5dd9('0xe')]('/',auth['isAuthenticated'](),controller[_0x5dd9('0xf')]);router[_0x5dd9('0xe')](_0x5dd9('0xb'),auth['isAuthenticated'](),controller['addMessage']);router[_0x5dd9('0xe')](_0x5dd9('0x10'),auth[_0x5dd9('0x5')](),interaction[_0x5dd9('0x11')](_0x5dd9('0x12'),_0x5dd9('0x13')),controller[_0x5dd9('0x14')]);router[_0x5dd9('0x15')]('/:id',auth[_0x5dd9('0x5')](),interaction[_0x5dd9('0x11')]('mail','mailinteraction:update'),controller[_0x5dd9('0x16')]);router[_0x5dd9('0x17')]('/:id',auth[_0x5dd9('0x5')](),interaction[_0x5dd9('0x11')]('mail','mailinteraction:destroy'),controller['destroy']);router[_0x5dd9('0x17')](_0x5dd9('0x10'),auth[_0x5dd9('0x5')](),controller[_0x5dd9('0x18')]);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 c499d33..a23cded 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 _0xdc12=['ENUM','sequelize','iconv','exports','BOOLEAN','DATE','STRING','TEXT','out'];(function(_0x5c6575,_0x4890fc){var _0x117d42=function(_0x9465b){while(--_0x9465b){_0x5c6575['push'](_0x5c6575['shift']());}};_0x117d42(++_0x4890fc);}(_0xdc12,0x10f));var _0x2dc1=function(_0x529944,_0x916273){_0x529944=_0x529944-0x0;var _0x2f7983=_0xdc12[_0x529944];return _0x2f7983;};'use strict';var Sequelize=require(_0x2dc1('0x0'));var iconv=require(_0x2dc1('0x1'));module[_0x2dc1('0x2')]={'closed':{'type':Sequelize[_0x2dc1('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x2dc1('0x4')]},'disposition':{'type':Sequelize[_0x2dc1('0x5')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x2dc1('0x5')]},'note':{'type':Sequelize['STRING']},'inReplyTo':{'type':Sequelize['STRING'](0x1fe)},'to':{'type':Sequelize[_0x2dc1('0x5')]},'cc':{'type':Sequelize['TEXT']('long')},'subject':{'type':Sequelize[_0x2dc1('0x6')]()},'attach':{'type':Sequelize[_0x2dc1('0x3')],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0x2dc1('0x4')]},'substatus':{'type':Sequelize[_0x2dc1('0x5')](0x3c)},'substatusAt':{'type':Sequelize[_0x2dc1('0x4')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0x2dc1('0x7')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x2dc1('0x4')]},'lastMsgDirection':{'type':Sequelize[_0x2dc1('0x8')]('in',_0x2dc1('0x7')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0xf026=['STRING','TEXT','out','sequelize','iconv','BOOLEAN','DATE'];(function(_0x5d2803,_0xf375bd){var _0xdcad2c=function(_0x3c3a98){while(--_0x3c3a98){_0x5d2803['push'](_0x5d2803['shift']());}};_0xdcad2c(++_0xf375bd);}(_0xf026,0x106));var _0x6f02=function(_0x2235bf,_0x3a06a7){_0x2235bf=_0x2235bf-0x0;var _0x4c3a64=_0xf026[_0x2235bf];return _0x4c3a64;};'use strict';var Sequelize=require(_0x6f02('0x0'));var iconv=require(_0x6f02('0x1'));module['exports']={'closed':{'type':Sequelize[_0x6f02('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x6f02('0x3')]},'disposition':{'type':Sequelize[_0x6f02('0x4')]},'secondDisposition':{'type':Sequelize[_0x6f02('0x4')]},'thirdDisposition':{'type':Sequelize[_0x6f02('0x4')]},'note':{'type':Sequelize[_0x6f02('0x4')]},'inReplyTo':{'type':Sequelize[_0x6f02('0x4')](0x1fe)},'to':{'type':Sequelize[_0x6f02('0x4')]},'cc':{'type':Sequelize[_0x6f02('0x5')]('long')},'subject':{'type':Sequelize[_0x6f02('0x5')]()},'attach':{'type':Sequelize[_0x6f02('0x2')],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0x6f02('0x3')]},'substatus':{'type':Sequelize['STRING'](0x3c)},'substatusAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0x6f02('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x6f02('0x3')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x6f02('0x6')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x6f02('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 e8b42c5..0cbee23 100644 --- a/server/api/mailInteraction/mailInteraction.controller.js +++ b/server/api/mailInteraction/mailInteraction.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb10b=['Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.MailInteractionId\x20IN\x20?','groupBy','MailInteractionId','Setting','findOne','enableEmailPreview','show','params','rawAttributes','includeAll','include','merge','options','create','body','describe','addMessage','ids','omit','getMessages','nolimit','pick','$gte','format','YYYY-MM-DD\x20HH:mm:ss','findAll','inlineCss','rows','spread','emit','mailInteractionTags:save','removeTags','download','unix','join','server','tmp','root','files','attachments','transcript-%d-%s.zip','Attachment','Attachments','Messages','subject','get','each','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','bcc','Bcc','basename','existsSync','build','message%d.eml','unlinkSync','eml-format','zip-dir','moment','bluebird','path','lodash','squel','juice','ioredis','../../components/parsers/qs','../../config/logger','api','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./mailInteraction.socket','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','update','destroy','then','error','stack','name','send','fullname','TagIds','Tags','split','forEach','push','MailMessage','out','-id','trimStart','plainBody','catch','index','map','MailInteraction','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','order','sort','where','field','color','tools_tags','u.id','ui.MailInteractionId','from','user_has_mail_interactions','left_join','users','u.id\x20=\x20ui.UserId','select','mail_interactions','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','mail_accounts','a.id\x20=\x20i.MailAccountId','mail_messages','me.MailInteractionId\x20=\x20i.id','it.MailInteractionId\x20=\x20i.id','expr','search','parseSearch','conditions','length','find','unreadMessages','value','having','`\x20>\x200','Contact','operator','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','type','text','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','start','some','compact','isEmpty','i.MailAccountId\x20IN\x20?','concat','createdAt','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','isNumeric','isEmail','MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','group','SELECT','clone','i.id','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','DESC','t.id\x20IN\x20?','resolve','MailAccountId','i.MailAccountId\x20IS\x20NOT\x20NULL','role','getMailAccounts','i.MailAccountId\x20IS\x20NULL','agent','toString','sequelize','keyBy','a.key','Account.key','Account.mandatoryDisposition','CASE\x20WHEN\x20i.to\x20IS\x20NOT\x20NULL\x20AND\x20i.to\x20<>\x20\x27\x27\x20AND\x20i.to\x20NOT\x20LIKE\x20(\x27%\x27\x20+\x20a.email\x20+\x20\x27%\x27)\x20THEN\x20SUBSTRING_INDEX(i.to,\x20\x27<\x27,\x201)\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','contactName','i.createdAt','i.updatedAt','i.closed','i.attach','i.lastMsgAt','i.subject','i.disposition','i.secondDisposition','i.thirdDisposition','i.ContactId','i.MailAccountId','Contact.firstName','c.email'];(function(_0x311c35,_0x534915){var _0x5cc50c=function(_0x3ad680){while(--_0x3ad680){_0x311c35['push'](_0x311c35['shift']());}};_0x5cc50c(++_0x534915);}(_0xb10b,0x12a));var _0xbb10=function(_0x1c9ce8,_0x5f4a9f){_0x1c9ce8=_0x1c9ce8-0x0;var _0x265023=_0xb10b[_0x1c9ce8];return _0x265023;};'use strict';var emlformat=require(_0xbb10('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xbb10('0x1'));var moment=require(_0xbb10('0x2'));var BPromise=require(_0xbb10('0x3'));var util=require('util');var path=require(_0xbb10('0x4'));var fs=require('fs');var _=require(_0xbb10('0x5'));var squel=require(_0xbb10('0x6'));var juice=require(_0xbb10('0x7'));var Redis=require(_0xbb10('0x8'));var qs=require(_0xbb10('0x9'));var as=require('../../components/parsers/advancedSearch');var logger=require(_0xbb10('0xa'))(_0xbb10('0xb'));var config=require('../../config/environment');var db=require(_0xbb10('0xc'))['db'];config[_0xbb10('0xd')]=_[_0xbb10('0xe')](config[_0xbb10('0xd')],{'host':_0xbb10('0xf'),'port':0x18eb});var socket=require(_0xbb10('0x10'))(new Redis(config[_0xbb10('0xd')]));require(_0xbb10('0x11'))['register'](socket);function respondWithStatusCode(_0x4e47f8,_0x20bd61){_0x20bd61=_0x20bd61||0xcc;return function(_0x118a74){if(_0x118a74){return _0x4e47f8[_0xbb10('0x12')](_0x20bd61);}return _0x4e47f8['status'](_0x20bd61)[_0xbb10('0x13')]();};}function respondWithResult(_0x5be7e0,_0x44fb19){_0x44fb19=_0x44fb19||0xc8;return function(_0x916a32){if(_0x916a32){return _0x5be7e0[_0xbb10('0x14')](_0x44fb19)[_0xbb10('0x15')](_0x916a32);}};}function respondWithFilteredResult(_0x442548,_0x147230){return function(_0x58a612){if(_0x58a612){var _0x26e021=typeof _0x147230[_0xbb10('0x16')]===_0xbb10('0x17')&&typeof _0x147230[_0xbb10('0x18')]===_0xbb10('0x17');var _0x2f2ebf=_0x58a612[_0xbb10('0x19')];var _0x36b5e8=_0x26e021?0x0:_0x147230[_0xbb10('0x16')];var _0x2b184e=_0x26e021?_0x58a612['count']:_0x147230[_0xbb10('0x16')]+_0x147230[_0xbb10('0x18')];var _0x133ac2;if(_0x2b184e>=_0x2f2ebf){_0x2b184e=_0x2f2ebf;_0x133ac2=0xc8;}else{_0x133ac2=0xce;}_0x442548[_0xbb10('0x14')](_0x133ac2);return _0x442548[_0xbb10('0x1a')](_0xbb10('0x1b'),_0x36b5e8+'-'+_0x2b184e+'/'+_0x2f2ebf)[_0xbb10('0x15')](_0x58a612);}return null;};}function saveUpdates(_0x30efc6){return function(_0xbf2906){if(_0xbf2906){return _0xbf2906[_0xbb10('0x1c')](_0x30efc6)['then'](function(_0x5ff0cf){return _0x5ff0cf;});}return null;};}function removeEntity(_0x19f48d){return function(_0x388fab){if(_0x388fab){return _0x388fab[_0xbb10('0x1d')]()[_0xbb10('0x1e')](function(){_0x19f48d[_0xbb10('0x14')](0xcc)['end']();});}};}function handleEntityNotFound(_0x12f888){return function(_0x12ef77){if(!_0x12ef77){_0x12f888['sendStatus'](0x194);}return _0x12ef77;};}function handleError(_0x4c4b0d,_0x8e2b97){_0x8e2b97=_0x8e2b97||0x1f4;return function(_0x311abe){logger[_0xbb10('0x1f')](_0x311abe[_0xbb10('0x20')]);if(_0x311abe[_0xbb10('0x21')]){delete _0x311abe[_0xbb10('0x21')];}_0x4c4b0d[_0xbb10('0x14')](_0x8e2b97)[_0xbb10('0x22')](_0x311abe);};}function getInteractionUsers(_0x7f2377,_0x395404){return new BPromise(function(_0x3ba6cd,_0x26ad93){try{if(_0x395404[_0x7f2377['id']]){_0x7f2377['Users']=_['map'](_0x395404[_0x7f2377['id']],function(_0x4fb5e0){return{'id':_0x4fb5e0['id'],'fullname':_0x4fb5e0[_0xbb10('0x23')]};});}}catch(_0x3c5ae7){_0x26ad93(_0x3c5ae7);}_0x3ba6cd(_0x7f2377);});}function getInteractionTags(_0x2c89b9,_0x4e25ff){return new BPromise(function(_0x2fdde9,_0x24d586){try{if(_0x2c89b9[_0xbb10('0x24')]){_0x2c89b9[_0xbb10('0x25')]=[];_0x2c89b9[_0xbb10('0x24')][_0xbb10('0x26')](',')[_0xbb10('0x27')](function(_0x4aabb9){_0x2c89b9[_0xbb10('0x25')][_0xbb10('0x28')](_0x4e25ff[_0x4aabb9]);});}delete _0x2c89b9[_0xbb10('0x24')];}catch(_0x2e0249){_0x24d586(_0x2e0249);}_0x2fdde9(_0x2c89b9);});}function getLastMessageText(_0x1d30aa){return new BPromise(function(_0x2ff4c1,_0x5d5c80){return db[_0xbb10('0x29')]['findOne']({'where':{'$and':[{'MailInteractionId':_0x1d30aa['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':_0xbb10('0x2a')},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':['plainBody'],'order':_0xbb10('0x2b'),'raw':!![]})[_0xbb10('0x1e')](function(_0x1b59f9){if(_0x1b59f9&&_0x1b59f9['plainBody']){_0x1d30aa['lastMsgText']=_[_0xbb10('0x2c')](_0x1b59f9[_0xbb10('0x2d')]);}_0x2ff4c1(_0x1d30aa);})['catch'](function(_0x359ad4){_0x5d5c80(_0x359ad4);});});}function updateMailInteraction(_0x37dde7,_0x2f653f,_0x1c0b57,_0x37a83f){return new BPromise(function(_0x138bc6,_0xf85197){return getInteractionUsers(_0x37dde7,_0x1c0b57)['then'](function(_0x25acb3){return getInteractionTags(_0x25acb3,_0x2f653f);})[_0xbb10('0x1e')](function(_0x441d15){if(_0x37a83f){_0x138bc6(getLastMessageText(_0x441d15));}else{_0x138bc6(_0x441d15);}})[_0xbb10('0x2e')](function(_0xfb2c5e){_0xf85197(_0xfb2c5e);});});}exports[_0xbb10('0x2f')]=function(_0x188cbd,_0x10202c){var _0x3c8d7d={},_0x56943c={},_0x2b5352={'count':0x0,'rows':[]};var _0x150107=_[_0xbb10('0x30')](db[_0xbb10('0x31')]['rawAttributes'],function(_0x111762){return{'name':_0x111762['fieldName'],'type':_0x111762['type'][_0xbb10('0x32')]};});_0x56943c[_0xbb10('0x33')]=_[_0xbb10('0x30')](_0x150107,_0xbb10('0x21'));_0x56943c[_0xbb10('0x34')]=_[_0xbb10('0x35')](_0x188cbd['query']);_0x56943c[_0xbb10('0x36')]=_[_0xbb10('0x37')](_0x56943c['model'],_0x56943c['query']);_0x3c8d7d['attributes']=_[_0xbb10('0x37')](_0x56943c[_0xbb10('0x33')],qs[_0xbb10('0x38')](_0x188cbd['query'][_0xbb10('0x38')]));_0x3c8d7d[_0xbb10('0x39')]=_0x3c8d7d[_0xbb10('0x39')]['length']?_0x3c8d7d[_0xbb10('0x39')]:_0x56943c[_0xbb10('0x33')];if(!_0x188cbd[_0xbb10('0x34')][_0xbb10('0x3a')]('nolimit')){_0x3c8d7d[_0xbb10('0x18')]=qs[_0xbb10('0x18')](_0x188cbd['query'][_0xbb10('0x18')]);_0x3c8d7d[_0xbb10('0x16')]=qs[_0xbb10('0x16')](_0x188cbd[_0xbb10('0x34')][_0xbb10('0x16')]);}_0x3c8d7d[_0xbb10('0x3b')]=qs['sort'](_0x188cbd[_0xbb10('0x34')][_0xbb10('0x3c')]);_0x3c8d7d[_0xbb10('0x3d')]=qs[_0xbb10('0x36')](_['pick'](_0x188cbd[_0xbb10('0x34')],_0x56943c[_0xbb10('0x36')]),_0x150107);var _0x23dc18=[];var _0x403beb=squel['select']()[_0xbb10('0x3e')]('id')[_0xbb10('0x3e')]('name')['field'](_0xbb10('0x3f'))['from'](_0xbb10('0x40'));var _0x180933=squel['select']()[_0xbb10('0x3e')](_0xbb10('0x41'))[_0xbb10('0x3e')]('u.fullname')[_0xbb10('0x3e')](_0xbb10('0x42'))[_0xbb10('0x43')](_0xbb10('0x44'),'ui')[_0xbb10('0x45')](_0xbb10('0x46'),'u',_0xbb10('0x47'));var _0x3efa96=squel[_0xbb10('0x48')]()[_0xbb10('0x43')](_0xbb10('0x49'),'i')[_0xbb10('0x45')]('cm_contacts','c',_0xbb10('0x4a'))[_0xbb10('0x45')]('users','o',_0xbb10('0x4b'))[_0xbb10('0x45')](_0xbb10('0x4c'),'a',_0xbb10('0x4d'))[_0xbb10('0x45')](_0xbb10('0x4e'),'me',_0xbb10('0x4f'))['left_join']('mail_interaction_has_tags','it',_0xbb10('0x50'))[_0xbb10('0x45')](_0xbb10('0x40'),'t','t.id\x20=\x20it.TagId');var _0x5f0c12=squel[_0xbb10('0x51')]();var _0x34cf4e=[];var _0x1bd054=squel[_0xbb10('0x51')]();var _0x10159b;if(_0x188cbd[_0xbb10('0x34')][_0xbb10('0x52')]){_0x10159b=as[_0xbb10('0x53')](_0x188cbd[_0xbb10('0x34')][_0xbb10('0x52')]);var _0x550111=_0x10159b['sqlOperator'];for(var _0x412e13=0x0;_0x412e13<_0x10159b[_0xbb10('0x54')][_0xbb10('0x55')];_0x412e13++){var _0xb014b0=_0x10159b[_0xbb10('0x54')][_0x412e13];var _0x440f9e='i';var _0x358e7e=_[_0xbb10('0x56')](_0x150107,[_0xbb10('0x21'),_0xb014b0[_0xbb10('0x3e')]]);if(!_0x358e7e){switch(_0xb014b0[_0xbb10('0x3e')]){case _0xbb10('0x57'):if(_0xb014b0[_0xbb10('0x58')]==0x1){_0x3efa96[_0xbb10('0x59')]('`'+_0xb014b0[_0xbb10('0x3e')]+'`\x20=\x200');}else{_0x3efa96[_0xbb10('0x59')]('`'+_0xb014b0['field']+_0xbb10('0x5a'));}break;case _0xbb10('0x5b'):if(_0xb014b0[_0xbb10('0x5c')]===_0xbb10('0x5d')){if(_0xb014b0[_0xbb10('0x58')][_0xbb10('0x26')]('\x20')[_0xbb10('0x55')]>0x1){_0x5f0c12[_0x550111](_0xbb10('0x5e'),qs[_0xbb10('0x5f')](_0xb014b0[_0xbb10('0x58')]),null);}else{var _0x44a056='%'+_0xb014b0[_0xbb10('0x58')]+'%';_0x5f0c12[_0x550111](_0xbb10('0x60'),_0x44a056,_0x44a056,_0x44a056);}}else{_0x358e7e=_[_0xbb10('0x56')](_0x150107,[_0xbb10('0x21'),'ContactId']);_0xb014b0[_0xbb10('0x3e')]=_0xbb10('0x61');_0x155dc5=as[_0xbb10('0x62')](_0x440f9e,_0x358e7e[_0xbb10('0x63')],_0xb014b0);_0x5f0c12[_0x550111](_0x155dc5[_0xbb10('0x64')],_0x155dc5[_0xbb10('0x58')]['start'],_0x155dc5[_0xbb10('0x58')][_0xbb10('0x13')]);}break;case _0xbb10('0x65'):var _0x14fed3=_0xb014b0[_0xbb10('0x58')][_0xbb10('0x26')](',')[_0xbb10('0x30')](function(_0x12ec18){return Number(_0x12ec18);});_0x14fed3[_0xbb10('0x27')](function(_0x40c4fb){_0x1bd054['or'](_0xbb10('0x66'),'%,'+_0x40c4fb+',%');});_0x34cf4e=_[_0xbb10('0x67')](_0x34cf4e,_0x14fed3);break;case _0xbb10('0x68'):if(_0xb014b0['operator']==='$substring'){_0x5f0c12[_0x550111](_0xbb10('0x69'),'%'+_0xb014b0[_0xbb10('0x58')]+'%',null);}else{_0x358e7e=_[_0xbb10('0x56')](_0x150107,[_0xbb10('0x21'),'UserId']);_0xb014b0['field']=_0xbb10('0x6a');_0x155dc5=as[_0xbb10('0x62')](_0x440f9e,_0x358e7e[_0xbb10('0x63')],_0xb014b0);_0x5f0c12[_0x550111](_0x155dc5[_0xbb10('0x64')],_0x155dc5[_0xbb10('0x58')][_0xbb10('0x6b')],_0x155dc5[_0xbb10('0x58')]['end']);}break;case _0xbb10('0x2d'):_0x155dc5=as[_0xbb10('0x62')]('me',null,_0xb014b0);_0x5f0c12[_0x550111](_0x155dc5['text'],_0x155dc5['value']['start'],_0x155dc5[_0xbb10('0x58')][_0xbb10('0x13')]);break;}}else{var _0x155dc5=as['buildExpression'](_0x440f9e,_0x358e7e['type'],_0xb014b0);_0x5f0c12[_0x550111](_0x155dc5['text'],_0x155dc5[_0xbb10('0x58')][_0xbb10('0x6b')],_0x155dc5[_0xbb10('0x58')]['end']);}}}else{var _0xa1bbd9=_(_0x188cbd[_0xbb10('0x34')])['keys']()['map'](function(_0x27d7b9){return _[_0xbb10('0x6c')](_0x150107,[_0xbb10('0x21'),_0x27d7b9])?_0x27d7b9:undefined;})[_0xbb10('0x6d')]()['value']();if(!_[_0xbb10('0x6e')](_0xa1bbd9)){_0xa1bbd9[_0xbb10('0x27')](function(_0xa7179d){if(_0xa7179d==='MailAccountId'){_0x3efa96[_0xbb10('0x3d')](_0xbb10('0x6f'),[][_0xbb10('0x70')](_0x188cbd['query'][_0xa7179d]));}else if(_0xa7179d===_0xbb10('0x71')){var _0x31e85e=JSON[_0xbb10('0x72')](_0x188cbd[_0xbb10('0x34')][_0xa7179d])['$gte'];var _0x251417=JSON[_0xbb10('0x72')](_0x188cbd[_0xbb10('0x34')][_0xa7179d])[_0xbb10('0x73')];_0x3efa96['where'](_0xbb10('0x74'),_0x31e85e,_0x251417);}else{if(_0x188cbd[_0xbb10('0x34')][_0xa7179d]===_0xbb10('0x75')){_0x3efa96[_0xbb10('0x3d')]('i.'+_0xa7179d+_0xbb10('0x76'));}else{_0x3efa96[_0xbb10('0x3d')]('i.'+_0xa7179d+_0xbb10('0x77'),_0x188cbd['query'][_0xa7179d]);}}});}if(_0x188cbd['query']['read']){if(_0x188cbd[_0xbb10('0x34')][_0xbb10('0x78')]==0x1){_0x3efa96[_0xbb10('0x59')]('`unreadMessages`\x20=\x200');}else{_0x3efa96['having'](_0xbb10('0x79'));}}if(_0x188cbd[_0xbb10('0x34')][_0xbb10('0x7a')]){_0x34cf4e=_[_0xbb10('0x7b')](_0x188cbd[_0xbb10('0x34')][_0xbb10('0x7a')])?_0x188cbd['query'][_0xbb10('0x7a')]:new Array(_0x188cbd[_0xbb10('0x34')][_0xbb10('0x7a')]);_0x34cf4e[_0xbb10('0x27')](function(_0x2aaaa6){_0x1bd054['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x2aaaa6+',%');});}if(_0x188cbd['query']['filter']){var _0x329da7=_0x188cbd[_0xbb10('0x34')][_0xbb10('0x7c')][_0xbb10('0x7d')]('\x5c','\x5c\x5c')[_0xbb10('0x7d')](/'/g,'\x27\x27');if(qs[_0xbb10('0x7e')](_0x329da7)){_0x5f0c12['or']('i.id\x20LIKE\x20?',_0x329da7+'%');}else if(qs[_0xbb10('0x7f')](_0x329da7)){_0x5f0c12['or']('c.email\x20LIKE\x20?',_0x329da7+'%');}else{_0x5f0c12['or']('MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs['getFullTextValue'](_0x329da7))['or'](_0xbb10('0x80'),qs[_0xbb10('0x5f')](_0x329da7));}}}_0x3efa96[_0xbb10('0x3d')](_0x5f0c12);_0x3efa96[_0xbb10('0x81')]('i.id');var _0x122d38={'type':db['Sequelize']['QueryTypes'][_0xbb10('0x82')],'raw':!![]};var _0xfe3db0=_0x3efa96[_0xbb10('0x83')]();_0xfe3db0[_0xbb10('0x3e')](_0xbb10('0x84'));_0xfe3db0['field'](_0xbb10('0x85'),_0xbb10('0x57'));if(_0x3c8d7d[_0xbb10('0x3b')]){_0x3c8d7d[_0xbb10('0x3b')][_0xbb10('0x27')](function(_0x27f42f){var _0x174395=_0x27f42f[0x0]==='contactName'?_0x27f42f[0x0]:'i.'+_0x27f42f[0x0];_0x3efa96[_0xbb10('0x3b')](_0x174395,_0x27f42f[0x1]===_0xbb10('0x86')?![]:!![]);});}if(!_[_0xbb10('0x6e')](_0x34cf4e)){_0x3efa96[_0xbb10('0x59')](_0x1bd054);_0xfe3db0[_0xbb10('0x3d')](_0xbb10('0x87'),_0x34cf4e);}BPromise[_0xbb10('0x88')]()[_0xbb10('0x1e')](function(){if(!_0x10159b){if(_0x188cbd['query'][_0xbb10('0x89')])return;_0xfe3db0[_0xbb10('0x3d')](_0xbb10('0x8a'));_0x3efa96['where']('i.MailAccountId\x20IS\x20NOT\x20NULL');return;}if(_0x188cbd['user'][_0xbb10('0x8b')]!=='agent')return;return _0x188cbd['user'][_0xbb10('0x8c')]({'attributes':['id'],'raw':!![]})[_0xbb10('0x1e')](function(_0x33ff06){if(_[_0xbb10('0x6e')](_0x33ff06)){_0xfe3db0[_0xbb10('0x3d')](_0xbb10('0x8d'));_0x3efa96[_0xbb10('0x3d')](_0xbb10('0x8d'));}else{_0xfe3db0[_0xbb10('0x3d')]('i.MailAccountId\x20IN\x20?',_[_0xbb10('0x30')](_0x33ff06,'id'));_0x3efa96[_0xbb10('0x3d')](_0xbb10('0x6f'),_[_0xbb10('0x30')](_0x33ff06,'id'));}});})['then'](function(){if(_0x188cbd['user'][_0xbb10('0x8b')]===_0xbb10('0x8e')&&!_0x10159b&&!_0x188cbd[_0xbb10('0x34')][_0xbb10('0x89')])return[];return db['sequelize'][_0xbb10('0x34')](_0xfe3db0[_0xbb10('0x8f')](),_0x122d38);})[_0xbb10('0x1e')](function(_0xf7b3e1){_0x2b5352[_0xbb10('0x19')]=_0xf7b3e1['length'];if(_0x2b5352['count']===0x0)return[];return db[_0xbb10('0x90')][_0xbb10('0x34')](_0x403beb[_0xbb10('0x8f')](),_0x122d38)['then'](function(_0x256b35){_0x23dc18=_[_0xbb10('0x91')](_0x256b35,'id');_0x122d38=_['merge'](_0x122d38,{'model':db['MailInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x188cbd[_0xbb10('0x34')][_0xbb10('0x38')]){_0x3c8d7d[_0xbb10('0x39')]['forEach'](function(_0x32d5a5){_0x3efa96[_0xbb10('0x3e')]('i.'+_0x32d5a5);});}else{_0x3efa96[_0xbb10('0x3e')](_0xbb10('0x85'),_0xbb10('0x57'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0x92'),_0xbb10('0x93'));_0x3efa96[_0xbb10('0x3e')]('a.mandatoryDisposition',_0xbb10('0x94'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0x95'),_0xbb10('0x96'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0x84'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0x97'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0x98'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0x99'));_0x3efa96['field']('i.closedAt');_0x3efa96[_0xbb10('0x3e')](_0xbb10('0x9a'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0x9b'));_0x3efa96[_0xbb10('0x3e')]('i.lastMsgDirection');_0x3efa96[_0xbb10('0x3e')](_0xbb10('0x9c'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0x9d'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0x9e'));_0x3efa96['field'](_0xbb10('0x9f'));_0x3efa96[_0xbb10('0x3e')]('i.substatus');_0x3efa96[_0xbb10('0x3e')]('i.to');_0x3efa96[_0xbb10('0x3e')](_0xbb10('0xa0'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0xa1'));_0x3efa96[_0xbb10('0x3e')]('i.UserId');_0x3efa96[_0xbb10('0x3e')]('c.firstName',_0xbb10('0xa2'));_0x3efa96[_0xbb10('0x3e')]('c.lastName','Contact.lastName');_0x3efa96[_0xbb10('0x3e')](_0xbb10('0xa3'),_0xbb10('0xa4'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0xa5'),_0xbb10('0xa6'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0xa7'),_0xbb10('0xa8'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0xa9'),'Contact.fax');_0x3efa96[_0xbb10('0x3e')](_0xbb10('0xaa'),_0xbb10('0xab'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0xac'),_0xbb10('0xad'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0xae'),_0xbb10('0x24'));}if(_0x3c8d7d[_0xbb10('0x18')])_0x3efa96[_0xbb10('0x18')](_0x3c8d7d[_0xbb10('0x18')]);if(_0x3c8d7d['offset'])_0x3efa96[_0xbb10('0x16')](_0x3c8d7d['offset']);return db[_0xbb10('0x90')][_0xbb10('0x34')](_0x3efa96[_0xbb10('0x8f')](),_0x122d38);})[_0xbb10('0x1e')](function(_0x38d369){if(_0x38d369['length']>0x0)_0x180933[_0xbb10('0x3d')](_0xbb10('0xaf'),_[_0xbb10('0x30')](_0x38d369,'id'));return db[_0xbb10('0x90')][_0xbb10('0x34')](_0x180933[_0xbb10('0x8f')](),_0x122d38)['then'](function(_0x4bd470){var _0x5cc9d7=_[_0xbb10('0xb0')](_0x4bd470,_0xbb10('0xb1'));var _0x57d5a1=[];return db[_0xbb10('0xb2')][_0xbb10('0xb3')]({'attributes':['enableEmailPreview'],'raw':!![]})[_0xbb10('0x1e')](function(_0xaede56){var _0x5642c3=_0xaede56[_0xbb10('0xb4')];_0x38d369['forEach'](function(_0x34cec7){_0x57d5a1[_0xbb10('0x28')](updateMailInteraction(_0x34cec7,_0x23dc18,_0x5cc9d7,_0x5642c3));});return BPromise['all'](_0x57d5a1);});});});})[_0xbb10('0x1e')](function(_0x28cc74){_0x2b5352['rows']=_0x28cc74;return _0x2b5352;})['then'](respondWithFilteredResult(_0x10202c,_0x3c8d7d))[_0xbb10('0x2e')](handleError(_0x10202c,null));};exports[_0xbb10('0xb5')]=function(_0x3e0e34,_0x3299bc){var _0x3ceb77={'raw':![],'where':{'id':_0x3e0e34[_0xbb10('0xb6')]['id']}},_0x4c3bdc={};_0x4c3bdc[_0xbb10('0x33')]=_[_0xbb10('0x35')](db['MailInteraction'][_0xbb10('0xb7')]);_0x4c3bdc[_0xbb10('0x34')]=_[_0xbb10('0x35')](_0x3e0e34[_0xbb10('0x34')]);_0x4c3bdc[_0xbb10('0x36')]=_[_0xbb10('0x37')](_0x4c3bdc[_0xbb10('0x33')],_0x4c3bdc[_0xbb10('0x34')]);_0x3ceb77[_0xbb10('0x39')]=_['intersection'](_0x4c3bdc['model'],qs[_0xbb10('0x38')](_0x3e0e34[_0xbb10('0x34')][_0xbb10('0x38')]));_0x3ceb77[_0xbb10('0x39')]=_0x3ceb77[_0xbb10('0x39')][_0xbb10('0x55')]?_0x3ceb77[_0xbb10('0x39')]:_0x4c3bdc[_0xbb10('0x33')];if(_0x3e0e34[_0xbb10('0x34')][_0xbb10('0xb8')]){_0x3ceb77[_0xbb10('0xb9')]=[{'all':!![]}];}_0x3ceb77=_[_0xbb10('0xba')]({},_0x3ceb77,_0x3e0e34[_0xbb10('0xbb')]);return db['MailInteraction'][_0xbb10('0x56')](_0x3ceb77)[_0xbb10('0x1e')](handleEntityNotFound(_0x3299bc,null))[_0xbb10('0x1e')](respondWithResult(_0x3299bc,null))[_0xbb10('0x2e')](handleError(_0x3299bc,null));};exports[_0xbb10('0xbc')]=function(_0xd9284e,_0x4258fc){return db[_0xbb10('0x31')][_0xbb10('0xbc')](_0xd9284e[_0xbb10('0xbd')],{})[_0xbb10('0x1e')](respondWithResult(_0x4258fc,0xc9))['catch'](handleError(_0x4258fc,null));};exports[_0xbb10('0x1c')]=function(_0x5e1ac5,_0x3faaca){if(_0x5e1ac5[_0xbb10('0xbd')]['id']){delete _0x5e1ac5[_0xbb10('0xbd')]['id'];}return db[_0xbb10('0x31')][_0xbb10('0x56')]({'where':{'id':_0x5e1ac5[_0xbb10('0xb6')]['id']}})['then'](handleEntityNotFound(_0x3faaca,null))[_0xbb10('0x1e')](saveUpdates(_0x5e1ac5['body'],null))[_0xbb10('0x1e')](respondWithResult(_0x3faaca,null))[_0xbb10('0x2e')](handleError(_0x3faaca,null));};exports[_0xbb10('0x1d')]=function(_0x576bb6,_0x2b652c){return db[_0xbb10('0x31')][_0xbb10('0x56')]({'where':{'id':_0x576bb6[_0xbb10('0xb6')]['id']}})[_0xbb10('0x1e')](handleEntityNotFound(_0x2b652c,null))[_0xbb10('0x1e')](removeEntity(_0x2b652c,null))[_0xbb10('0x2e')](handleError(_0x2b652c,null));};exports[_0xbb10('0xbe')]=function(_0x589565,_0x3696b3){return db['MailInteraction'][_0xbb10('0xbe')]()[_0xbb10('0x1e')](respondWithResult(_0x3696b3,null))[_0xbb10('0x2e')](handleError(_0x3696b3,null));};exports[_0xbb10('0xbf')]=function(_0x44c229,_0x40271f){return db[_0xbb10('0x29')]['find']({'where':{'id':_0x44c229[_0xbb10('0xb6')]['id']}})['then'](handleEntityNotFound(_0x40271f,null))['then'](function(_0x1513e0){if(_0x1513e0){return _0x1513e0[_0xbb10('0xbf')](_0x44c229[_0xbb10('0xbd')][_0xbb10('0xc0')],_[_0xbb10('0xc1')](_0x44c229[_0xbb10('0xbd')],['ids','id'])||{});}})[_0xbb10('0x1e')](respondWithResult(_0x40271f,null))[_0xbb10('0x2e')](handleError(_0x40271f,null));};exports[_0xbb10('0xc2')]=function(_0xb1b7c8,_0x136520){var _0x28127c={'raw':![],'where':{}};var _0x528aff={};var _0xdfdc42={'count':0x0,'rows':[]};return db[_0xbb10('0x31')][_0xbb10('0xb3')]({'where':{'id':_0xb1b7c8[_0xbb10('0xb6')]['id']}})[_0xbb10('0x1e')](handleEntityNotFound(_0x136520,null))[_0xbb10('0x1e')](function(_0x2764e1){if(_0x2764e1){_0x528aff['model']=_[_0xbb10('0x35')](db['MailMessage'][_0xbb10('0xb7')]);_0x528aff['query']=_['keys'](_0xb1b7c8[_0xbb10('0x34')]);_0x528aff[_0xbb10('0x36')]=_[_0xbb10('0x37')](_0x528aff[_0xbb10('0x33')],_0x528aff[_0xbb10('0x34')]);_0x28127c['attributes']=_[_0xbb10('0x37')](_0x528aff['model'],qs['fields'](_0xb1b7c8['query'][_0xbb10('0x38')]));_0x28127c[_0xbb10('0x39')]=_0x28127c[_0xbb10('0x39')][_0xbb10('0x55')]?_0x28127c[_0xbb10('0x39')]:_0x528aff['model'];if(!_0xb1b7c8[_0xbb10('0x34')][_0xbb10('0x3a')](_0xbb10('0xc3'))){_0x28127c[_0xbb10('0x18')]=qs[_0xbb10('0x18')](_0xb1b7c8[_0xbb10('0x34')][_0xbb10('0x18')]);_0x28127c['offset']=qs['offset'](_0xb1b7c8['query'][_0xbb10('0x16')]);}_0x28127c[_0xbb10('0x3b')]=qs[_0xbb10('0x3c')](_0xb1b7c8[_0xbb10('0x34')][_0xbb10('0x3c')]);_0x28127c[_0xbb10('0x3d')]=qs[_0xbb10('0x36')](_[_0xbb10('0xc4')](_0xb1b7c8[_0xbb10('0x34')],_0x528aff[_0xbb10('0x36')]));_0x28127c['where']['MailInteractionId']=_0x2764e1['id'];if(_0xb1b7c8['query'][_0xbb10('0x7c')]){_0x28127c[_0xbb10('0x3d')]=_[_0xbb10('0xba')](_0x28127c['where'],{'$or':_[_0xbb10('0x30')](_0x28127c[_0xbb10('0x39')],function(_0x2c638d){var _0x290280={};_0x290280[_0x2c638d]={'$like':'%'+_0xb1b7c8[_0xbb10('0x34')][_0xbb10('0x7c')]+'%'};return _0x290280;})});}if(_0xb1b7c8['query']['$gte']){var _0x356660=_0xb1b7c8['query'][_0xbb10('0xc5')][_0xbb10('0x26')](',');var _0x152ca9={};_0x152ca9[_0x356660[0x0]]={'$gte':moment(_0x356660[0x1])[_0xbb10('0xc6')](_0xbb10('0xc7'))};_0x28127c[_0xbb10('0x3d')]=_[_0xbb10('0xba')](_0x28127c[_0xbb10('0x3d')],_0x152ca9);}_0x28127c=_[_0xbb10('0xba')]({},_0x28127c,_0xb1b7c8[_0xbb10('0xbb')]);return db['MailMessage'][_0xbb10('0x19')]({'where':_0x28127c['where']})[_0xbb10('0x1e')](function(_0x5547fa){_0xdfdc42[_0xbb10('0x19')]=_0x5547fa;if(_0xb1b7c8[_0xbb10('0x34')][_0xbb10('0xb8')]){_0x28127c[_0xbb10('0xb9')]=[{'all':!![]}];}return db['MailMessage'][_0xbb10('0xc8')](_0x28127c);})['then'](function(_0xfe1154){if(_0xb1b7c8[_0xbb10('0x34')][_0xbb10('0xc9')]==='true'){for(var _0x298167=0x0;_0x298167<_0xfe1154[_0xbb10('0x55')];_0x298167++){_0xfe1154[_0x298167][_0xbb10('0xbd')]=juice(_0xfe1154[_0x298167][_0xbb10('0xbd')]);}}_0xdfdc42[_0xbb10('0xca')]=_0xfe1154;return _0xdfdc42;});}})[_0xbb10('0x1e')](respondWithFilteredResult(_0x136520,_0x28127c))['catch'](handleError(_0x136520,null));};exports['addTags']=function(_0x522a88,_0x26a752){return db['MailInteraction'][_0xbb10('0x56')]({'where':{'id':_0x522a88['params']['id']}})[_0xbb10('0x1e')](handleEntityNotFound(_0x26a752,null))[_0xbb10('0x1e')](function(_0x385ad3){if(_0x385ad3){return _0x385ad3['setTags'](_0x522a88['body'][_0xbb10('0xc0')],_[_0xbb10('0xc1')](_0x522a88[_0xbb10('0xbd')],['ids','id'])||{})[_0xbb10('0xcb')](function(){return db[_0xbb10('0x65')][_0xbb10('0xc8')]({'attributes':['id','name','color'],'where':{'id':_0x522a88['body'][_0xbb10('0xc0')]}});})['then'](function(_0x3dfbcd){socket[_0xbb10('0xcc')](_0xbb10('0xcd'),{'id':Number(_0x522a88[_0xbb10('0xb6')]['id']),'tags':_0x3dfbcd||[]});return{'id':Number(_0x522a88[_0xbb10('0xb6')]['id']),'tags':_0x3dfbcd||[]};});}})[_0xbb10('0x1e')](respondWithResult(_0x26a752,null))[_0xbb10('0x2e')](handleError(_0x26a752,null));};exports[_0xbb10('0xce')]=function(_0x2746eb,_0x431792){return db[_0xbb10('0x31')]['find']({'where':{'id':_0x2746eb[_0xbb10('0xb6')]['id']}})[_0xbb10('0x1e')](handleEntityNotFound(_0x431792,null))['then'](function(_0x14ef50){if(_0x14ef50){return _0x14ef50['removeTags'](_0x2746eb['query'][_0xbb10('0xc0')]);}})[_0xbb10('0x1e')](respondWithStatusCode(_0x431792,null))[_0xbb10('0x2e')](handleError(_0x431792,null));};exports[_0xbb10('0xcf')]=function(_0x99c4,_0x4ca4ce){var _0x161171=moment()[_0xbb10('0xd0')]()['toString']();var _0xa45726=path[_0xbb10('0xd1')](config['root'],_0xbb10('0xd2'),'files',_0xbb10('0xd3'));var _0x8e8049=path[_0xbb10('0xd1')](config[_0xbb10('0xd4')],_0xbb10('0xd2'),_0xbb10('0xd5'),_0xbb10('0xd6'));var _0x56f902=path[_0xbb10('0xd1')](_0xa45726,_0x161171);var _0x4720a1=util[_0xbb10('0xc6')](_0xbb10('0xd7'),_0x99c4[_0xbb10('0xb6')]['id'],_0x161171);var _0x1301e3=path['join'](_0xa45726,_0x4720a1);var _0x550301=[];if(_0x99c4['query'][_0xbb10('0xd6')]){_0x550301[_0xbb10('0x28')]({'model':db[_0xbb10('0xd8')],'as':_0xbb10('0xd9'),'raw':!![]});}var _0x57700b=[{'model':db[_0xbb10('0x29')],'as':_0xbb10('0xda'),'attributes':['id',_0xbb10('0xbd'),'from','to','cc','bcc',_0xbb10('0xdb'),'createdAt'],'where':{'secret':![]},'order':qs[_0xbb10('0x3c')]('id'),'include':_0x550301}];return db[_0xbb10('0x31')][_0xbb10('0x56')]({'where':{'id':_0x99c4[_0xbb10('0xb6')]['id']},'include':_0x57700b})[_0xbb10('0x1e')](handleEntityNotFound(_0x4ca4ce,null))[_0xbb10('0x1e')](function(_0x1fe250){if(_0x1fe250&&_0x1fe250['Messages']){var _0x424371=_0x1fe250[_0xbb10('0xdc')]({'plain':!![]});fs['mkdirSync'](_0x56f902);return BPromise[_0xbb10('0xdd')](_0x424371[_0xbb10('0xda')],function(_0x32f261,_0x5b11a2){var _0x4b490a={'from':_0x32f261['from'],'to':_0x32f261['to'],'subject':_0x32f261[_0xbb10('0xdb')],'html':_0x32f261[_0xbb10('0xbd')],'headers':{'Date':moment(_0x32f261['createdAt'])[_0xbb10('0xc6')](_0xbb10('0xde'))},'attachments':[]};if(_0x32f261['cc']){_0x4b490a[_0xbb10('0xdf')]['Cc']=_0x32f261['cc'];}if(_0x32f261[_0xbb10('0xe0')]){_0x4b490a[_0xbb10('0xdf')][_0xbb10('0xe1')]=_0x32f261[_0xbb10('0xe0')];}return new BPromise(function(_0x48f0eb,_0x304603){if(_0x32f261['Attachments']){for(var _0x5a7c4e=0x0;_0x5a7c4e<_0x32f261['Attachments'][_0xbb10('0x55')];_0x5a7c4e++){var _0x572d73=_0x32f261['Attachments'][_0x5a7c4e];var _0x1f09f1=path['join'](_0x8e8049,_0x572d73[_0xbb10('0xe2')]);if(fs[_0xbb10('0xe3')](_0x1f09f1)){_0x4b490a[_0xbb10('0xd6')]['push']({'name':_0x572d73['name'],'contentType':_0x572d73[_0xbb10('0x63')],'data':fs['readFileSync'](_0x1f09f1)});}}}emlformat[_0xbb10('0xe4')](_0x4b490a,function(_0x211172,_0x589ecb){if(_0x211172)return _0x304603(_0x211172);fs['writeFileSync'](path[_0xbb10('0xd1')](_0x56f902,util[_0xbb10('0xc6')](_0xbb10('0xe5'),_0x5b11a2)),_0x589ecb);return _0x48f0eb(_0x589ecb);});});})['then'](function(){return new BPromise(function(_0x4f4aa8,_0x426a4f){zipdir(_0x56f902,{'saveTo':_0x1301e3},function(_0x22f153,_0x4d47cc){if(_0x22f153)return _0x426a4f(_0x22f153);return _0x4f4aa8(_0x4d47cc);});})[_0xbb10('0x1e')](function(){return new BPromise(function(_0x203e5a,_0xe88e90){rimraf(_0x56f902,function(_0x4845b5){if(_0x4845b5)_0xe88e90(_0x4845b5);return _0x203e5a();});});})[_0xbb10('0x1e')](function(){return _0x4ca4ce[_0xbb10('0xcf')](_0x1301e3,_0x4720a1,function(_0x166f4f){if(!_0x166f4f)fs[_0xbb10('0xe6')](_0x1301e3);});});});}else{return _0x4ca4ce[_0xbb10('0x12')](0xc8);}})[_0xbb10('0x2e')](handleError(_0x4ca4ce,null));}; \ No newline at end of file +var _0xa9e0=['o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','groupBy','Setting','enableEmailPreview','all','rows','show','params','includeAll','include','options','create','body','addMessage','ids','omit','getMessages','nolimit','MailInteractionId','format','YYYY-MM-DD\x20HH:mm:ss','findAll','inlineCss','true','addTags','setTags','Tag','mailInteractionTags:save','download','join','root','server','tmp','attachments','Attachment','Attachments','subject','Messages','get','mkdirSync','each','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','bcc','Bcc','basename','existsSync','readFileSync','writeFileSync','message%d.eml','unlinkSync','eml-format','rimraf','zip-dir','util','lodash','squel','juice','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','defaults','socket.io-emitter','redis','./mailInteraction.socket','register','status','json','offset','undefined','limit','count','set','Content-Range','update','then','destroy','end','sendStatus','error','stack','name','send','Users','fullname','Tags','split','forEach','push','TagIds','MailMessage','findOne','out','-id','plainBody','lastMsgText','trimStart','catch','index','MailInteraction','rawAttributes','fieldName','key','model','map','query','intersection','attributes','fields','length','hasOwnProperty','sort','filters','pick','select','field','color','from','tools_tags','u.id','u.fullname','ui.MailInteractionId','user_has_mail_interactions','left_join','users','u.id\x20=\x20ui.UserId','mail_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','a.id\x20=\x20i.MailAccountId','mail_messages','me.MailInteractionId\x20=\x20i.id','it.MailInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','find','unreadMessages','value','having','`\x20>\x200','Contact','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','type','text','start','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','operator','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','buildExpression','keys','some','compact','where','i.MailAccountId\x20IN\x20?','concat','createdAt','parse','$gte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','isArray','tag','filter','replace','isNumeric','i.id\x20LIKE\x20?','isEmail','c.email\x20LIKE\x20?','MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','group','QueryTypes','SELECT','clone','i.id','order','contactName','DESC','t.id\x20IN\x20?','resolve','MailAccountId','i.MailAccountId\x20IS\x20NOT\x20NULL','user','role','agent','getMailAccounts','i.MailAccountId\x20IS\x20NULL','sequelize','toString','merge','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','a.key','Account.key','Account.mandatoryDisposition','i.createdAt','i.updatedAt','i.closed','i.closedAt','i.attach','i.lastMsgDirection','i.disposition','i.secondDisposition','i.thirdDisposition','i.substatus','i.to','i.MailAccountId','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname'];(function(_0x5ba93e,_0x4c28e5){var _0x25d7cf=function(_0x8be898){while(--_0x8be898){_0x5ba93e['push'](_0x5ba93e['shift']());}};_0x25d7cf(++_0x4c28e5);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0xa9e0[_0x4cf98e];return _0x1623ac;};'use strict';var emlformat=require(_0x0a9e('0x0'));var rimraf=require(_0x0a9e('0x1'));var zipdir=require(_0x0a9e('0x2'));var moment=require('moment');var BPromise=require('bluebird');var util=require(_0x0a9e('0x3'));var path=require('path');var fs=require('fs');var _=require(_0x0a9e('0x4'));var squel=require(_0x0a9e('0x5'));var juice=require(_0x0a9e('0x6'));var Redis=require(_0x0a9e('0x7'));var qs=require(_0x0a9e('0x8'));var as=require('../../components/parsers/advancedSearch');var logger=require(_0x0a9e('0x9'))(_0x0a9e('0xa'));var config=require(_0x0a9e('0xb'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x0a9e('0xc')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x0a9e('0xd'))(new Redis(config[_0x0a9e('0xe')]));require(_0x0a9e('0xf'))[_0x0a9e('0x10')](socket);function respondWithStatusCode(_0xfeb75b,_0xbd1168){_0xbd1168=_0xbd1168||0xcc;return function(_0x4a4c56){if(_0x4a4c56){return _0xfeb75b['sendStatus'](_0xbd1168);}return _0xfeb75b['status'](_0xbd1168)['end']();};}function respondWithResult(_0x273d4d,_0x36471c){_0x36471c=_0x36471c||0xc8;return function(_0xd5b662){if(_0xd5b662){return _0x273d4d[_0x0a9e('0x11')](_0x36471c)[_0x0a9e('0x12')](_0xd5b662);}};}function respondWithFilteredResult(_0x69aeb7,_0x5db4b0){return function(_0x4283ce){if(_0x4283ce){var _0x239b12=typeof _0x5db4b0[_0x0a9e('0x13')]===_0x0a9e('0x14')&&typeof _0x5db4b0[_0x0a9e('0x15')]===_0x0a9e('0x14');var _0x52a03d=_0x4283ce[_0x0a9e('0x16')];var _0x5d0880=_0x239b12?0x0:_0x5db4b0[_0x0a9e('0x13')];var _0x519dfd=_0x239b12?_0x4283ce[_0x0a9e('0x16')]:_0x5db4b0[_0x0a9e('0x13')]+_0x5db4b0['limit'];var _0x225616;if(_0x519dfd>=_0x52a03d){_0x519dfd=_0x52a03d;_0x225616=0xc8;}else{_0x225616=0xce;}_0x69aeb7['status'](_0x225616);return _0x69aeb7[_0x0a9e('0x17')](_0x0a9e('0x18'),_0x5d0880+'-'+_0x519dfd+'/'+_0x52a03d)[_0x0a9e('0x12')](_0x4283ce);}return null;};}function saveUpdates(_0x205fd6){return function(_0x31b1ca){if(_0x31b1ca){return _0x31b1ca[_0x0a9e('0x19')](_0x205fd6)[_0x0a9e('0x1a')](function(_0x20559e){return _0x20559e;});}return null;};}function removeEntity(_0x1314ae){return function(_0x112016){if(_0x112016){return _0x112016[_0x0a9e('0x1b')]()[_0x0a9e('0x1a')](function(){_0x1314ae['status'](0xcc)[_0x0a9e('0x1c')]();});}};}function handleEntityNotFound(_0x155cce){return function(_0x53682f){if(!_0x53682f){_0x155cce[_0x0a9e('0x1d')](0x194);}return _0x53682f;};}function handleError(_0x5a09ef,_0x588269){_0x588269=_0x588269||0x1f4;return function(_0x3a02e1){logger[_0x0a9e('0x1e')](_0x3a02e1[_0x0a9e('0x1f')]);if(_0x3a02e1[_0x0a9e('0x20')]){delete _0x3a02e1['name'];}_0x5a09ef[_0x0a9e('0x11')](_0x588269)[_0x0a9e('0x21')](_0x3a02e1);};}function getInteractionUsers(_0x3b45bc,_0x4d00e6){return new BPromise(function(_0x370d86,_0x42ac8f){try{if(_0x4d00e6[_0x3b45bc['id']]){_0x3b45bc[_0x0a9e('0x22')]=_['map'](_0x4d00e6[_0x3b45bc['id']],function(_0x59181e){return{'id':_0x59181e['id'],'fullname':_0x59181e[_0x0a9e('0x23')]};});}}catch(_0x3a8e58){_0x42ac8f(_0x3a8e58);}_0x370d86(_0x3b45bc);});}function getInteractionTags(_0x40c424,_0x33161b){return new BPromise(function(_0x526cf3,_0x384319){try{if(_0x40c424['TagIds']){_0x40c424[_0x0a9e('0x24')]=[];_0x40c424['TagIds'][_0x0a9e('0x25')](',')[_0x0a9e('0x26')](function(_0x25fba9){_0x40c424[_0x0a9e('0x24')][_0x0a9e('0x27')](_0x33161b[_0x25fba9]);});}delete _0x40c424[_0x0a9e('0x28')];}catch(_0x11c3b6){_0x384319(_0x11c3b6);}_0x526cf3(_0x40c424);});}function getLastMessageText(_0x14de77){return new BPromise(function(_0x5a101a,_0x3652a7){return db[_0x0a9e('0x29')][_0x0a9e('0x2a')]({'where':{'$and':[{'MailInteractionId':_0x14de77['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':_0x0a9e('0x2b')},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':['plainBody'],'order':_0x0a9e('0x2c'),'raw':!![]})[_0x0a9e('0x1a')](function(_0x1843b2){if(_0x1843b2&&_0x1843b2[_0x0a9e('0x2d')]){_0x14de77[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x1843b2[_0x0a9e('0x2d')]);}_0x5a101a(_0x14de77);})[_0x0a9e('0x30')](function(_0x1dbde2){_0x3652a7(_0x1dbde2);});});}function updateMailInteraction(_0x540530,_0x426950,_0x5d1e0e,_0x2407f9){return new BPromise(function(_0x3ae878,_0x1122db){return getInteractionUsers(_0x540530,_0x5d1e0e)[_0x0a9e('0x1a')](function(_0x25ce3a){return getInteractionTags(_0x25ce3a,_0x426950);})['then'](function(_0x66c1d2){if(_0x2407f9){_0x3ae878(getLastMessageText(_0x66c1d2));}else{_0x3ae878(_0x66c1d2);}})[_0x0a9e('0x30')](function(_0x40cb85){_0x1122db(_0x40cb85);});});}exports[_0x0a9e('0x31')]=function(_0x2b45ea,_0x409319){var _0x332d35={},_0x39e565={},_0x5583a4={'count':0x0,'rows':[]};var _0x44295a=_['map'](db[_0x0a9e('0x32')][_0x0a9e('0x33')],function(_0x2b7e7f){return{'name':_0x2b7e7f[_0x0a9e('0x34')],'type':_0x2b7e7f['type'][_0x0a9e('0x35')]};});_0x39e565[_0x0a9e('0x36')]=_[_0x0a9e('0x37')](_0x44295a,_0x0a9e('0x20'));_0x39e565['query']=_['keys'](_0x2b45ea[_0x0a9e('0x38')]);_0x39e565['filters']=_[_0x0a9e('0x39')](_0x39e565[_0x0a9e('0x36')],_0x39e565[_0x0a9e('0x38')]);_0x332d35[_0x0a9e('0x3a')]=_['intersection'](_0x39e565[_0x0a9e('0x36')],qs[_0x0a9e('0x3b')](_0x2b45ea[_0x0a9e('0x38')]['fields']));_0x332d35[_0x0a9e('0x3a')]=_0x332d35[_0x0a9e('0x3a')][_0x0a9e('0x3c')]?_0x332d35['attributes']:_0x39e565['model'];if(!_0x2b45ea[_0x0a9e('0x38')][_0x0a9e('0x3d')]('nolimit')){_0x332d35[_0x0a9e('0x15')]=qs[_0x0a9e('0x15')](_0x2b45ea[_0x0a9e('0x38')][_0x0a9e('0x15')]);_0x332d35['offset']=qs['offset'](_0x2b45ea[_0x0a9e('0x38')][_0x0a9e('0x13')]);}_0x332d35['order']=qs[_0x0a9e('0x3e')](_0x2b45ea[_0x0a9e('0x38')][_0x0a9e('0x3e')]);_0x332d35['where']=qs[_0x0a9e('0x3f')](_[_0x0a9e('0x40')](_0x2b45ea[_0x0a9e('0x38')],_0x39e565[_0x0a9e('0x3f')]),_0x44295a);var _0x13cb1f=[];var _0xeaa5e5=squel[_0x0a9e('0x41')]()[_0x0a9e('0x42')]('id')[_0x0a9e('0x42')](_0x0a9e('0x20'))[_0x0a9e('0x42')](_0x0a9e('0x43'))[_0x0a9e('0x44')](_0x0a9e('0x45'));var _0x37f6cc=squel['select']()['field'](_0x0a9e('0x46'))[_0x0a9e('0x42')](_0x0a9e('0x47'))[_0x0a9e('0x42')](_0x0a9e('0x48'))[_0x0a9e('0x44')](_0x0a9e('0x49'),'ui')[_0x0a9e('0x4a')](_0x0a9e('0x4b'),'u',_0x0a9e('0x4c'));var _0x2c2cb0=squel[_0x0a9e('0x41')]()['from'](_0x0a9e('0x4d'),'i')[_0x0a9e('0x4a')](_0x0a9e('0x4e'),'c',_0x0a9e('0x4f'))[_0x0a9e('0x4a')](_0x0a9e('0x4b'),'o',_0x0a9e('0x50'))[_0x0a9e('0x4a')]('mail_accounts','a',_0x0a9e('0x51'))['left_join'](_0x0a9e('0x52'),'me',_0x0a9e('0x53'))[_0x0a9e('0x4a')]('mail_interaction_has_tags','it',_0x0a9e('0x54'))[_0x0a9e('0x4a')](_0x0a9e('0x45'),'t',_0x0a9e('0x55'));var _0x45c845=squel[_0x0a9e('0x56')]();var _0x45bf7f=[];var _0x5bbcde=squel[_0x0a9e('0x56')]();var _0x1bde3c;if(_0x2b45ea[_0x0a9e('0x38')][_0x0a9e('0x57')]){_0x1bde3c=as[_0x0a9e('0x58')](_0x2b45ea[_0x0a9e('0x38')][_0x0a9e('0x57')]);var _0x19383e=_0x1bde3c[_0x0a9e('0x59')];for(var _0x58a5c2=0x0;_0x58a5c2<_0x1bde3c[_0x0a9e('0x5a')][_0x0a9e('0x3c')];_0x58a5c2++){var _0x4f7240=_0x1bde3c['conditions'][_0x58a5c2];var _0x5ddf84='i';var _0x1adfee=_[_0x0a9e('0x5b')](_0x44295a,[_0x0a9e('0x20'),_0x4f7240[_0x0a9e('0x42')]]);if(!_0x1adfee){switch(_0x4f7240[_0x0a9e('0x42')]){case _0x0a9e('0x5c'):if(_0x4f7240[_0x0a9e('0x5d')]==0x1){_0x2c2cb0[_0x0a9e('0x5e')]('`'+_0x4f7240['field']+'`\x20=\x200');}else{_0x2c2cb0['having']('`'+_0x4f7240[_0x0a9e('0x42')]+_0x0a9e('0x5f'));}break;case _0x0a9e('0x60'):if(_0x4f7240['operator']===_0x0a9e('0x61')){if(_0x4f7240[_0x0a9e('0x5d')]['split']('\x20')['length']>0x1){_0x45c845[_0x19383e](_0x0a9e('0x62'),qs['getFullTextValue'](_0x4f7240[_0x0a9e('0x5d')]),null);}else{var _0x4c3845='%'+_0x4f7240[_0x0a9e('0x5d')]+'%';_0x45c845[_0x19383e](_0x0a9e('0x63'),_0x4c3845,_0x4c3845,_0x4c3845);}}else{_0x1adfee=_[_0x0a9e('0x5b')](_0x44295a,['name',_0x0a9e('0x64')]);_0x4f7240[_0x0a9e('0x42')]='ContactId';_0x2244d6=as['buildExpression'](_0x5ddf84,_0x1adfee[_0x0a9e('0x65')],_0x4f7240);_0x45c845[_0x19383e](_0x2244d6[_0x0a9e('0x66')],_0x2244d6['value'][_0x0a9e('0x67')],_0x2244d6['value'][_0x0a9e('0x1c')]);}break;case'Tag':var _0xe22ccc=_0x4f7240['value']['split'](',')['map'](function(_0x2da03c){return Number(_0x2da03c);});_0xe22ccc['forEach'](function(_0x2f7092){_0x5bbcde['or'](_0x0a9e('0x68'),'%,'+_0x2f7092+',%');});_0x45bf7f=_[_0x0a9e('0x69')](_0x45bf7f,_0xe22ccc);break;case _0x0a9e('0x6a'):if(_0x4f7240[_0x0a9e('0x6b')]===_0x0a9e('0x61')){_0x45c845[_0x19383e](_0x0a9e('0x6c'),'%'+_0x4f7240[_0x0a9e('0x5d')]+'%',null);}else{_0x1adfee=_['find'](_0x44295a,[_0x0a9e('0x20'),_0x0a9e('0x6d')]);_0x4f7240[_0x0a9e('0x42')]=_0x0a9e('0x6d');_0x2244d6=as[_0x0a9e('0x6e')](_0x5ddf84,_0x1adfee[_0x0a9e('0x65')],_0x4f7240);_0x45c845[_0x19383e](_0x2244d6['text'],_0x2244d6[_0x0a9e('0x5d')][_0x0a9e('0x67')],_0x2244d6['value'][_0x0a9e('0x1c')]);}break;case'plainBody':_0x2244d6=as[_0x0a9e('0x6e')]('me',null,_0x4f7240);_0x45c845[_0x19383e](_0x2244d6['text'],_0x2244d6['value']['start'],_0x2244d6[_0x0a9e('0x5d')]['end']);break;}}else{var _0x2244d6=as[_0x0a9e('0x6e')](_0x5ddf84,_0x1adfee[_0x0a9e('0x65')],_0x4f7240);_0x45c845[_0x19383e](_0x2244d6[_0x0a9e('0x66')],_0x2244d6[_0x0a9e('0x5d')][_0x0a9e('0x67')],_0x2244d6['value'][_0x0a9e('0x1c')]);}}}else{var _0x5854cc=_(_0x2b45ea[_0x0a9e('0x38')])[_0x0a9e('0x6f')]()[_0x0a9e('0x37')](function(_0x5adf8f){return _[_0x0a9e('0x70')](_0x44295a,[_0x0a9e('0x20'),_0x5adf8f])?_0x5adf8f:undefined;})[_0x0a9e('0x71')]()[_0x0a9e('0x5d')]();if(!_['isEmpty'](_0x5854cc)){_0x5854cc[_0x0a9e('0x26')](function(_0xe05a5a){if(_0xe05a5a==='MailAccountId'){_0x2c2cb0[_0x0a9e('0x72')](_0x0a9e('0x73'),[][_0x0a9e('0x74')](_0x2b45ea[_0x0a9e('0x38')][_0xe05a5a]));}else if(_0xe05a5a===_0x0a9e('0x75')){var _0x4d4a35=JSON[_0x0a9e('0x76')](_0x2b45ea[_0x0a9e('0x38')][_0xe05a5a])[_0x0a9e('0x77')];var _0x47bb43=JSON[_0x0a9e('0x76')](_0x2b45ea['query'][_0xe05a5a])['$lte'];_0x2c2cb0[_0x0a9e('0x72')](_0x0a9e('0x78'),_0x4d4a35,_0x47bb43);}else{if(_0x2b45ea[_0x0a9e('0x38')][_0xe05a5a]===_0x0a9e('0x79')){_0x2c2cb0[_0x0a9e('0x72')]('i.'+_0xe05a5a+_0x0a9e('0x7a'));}else{_0x2c2cb0[_0x0a9e('0x72')]('i.'+_0xe05a5a+_0x0a9e('0x7b'),_0x2b45ea[_0x0a9e('0x38')][_0xe05a5a]);}}});}if(_0x2b45ea[_0x0a9e('0x38')][_0x0a9e('0x7c')]){if(_0x2b45ea[_0x0a9e('0x38')][_0x0a9e('0x7c')]==0x1){_0x2c2cb0[_0x0a9e('0x5e')](_0x0a9e('0x7d'));}else{_0x2c2cb0[_0x0a9e('0x5e')](_0x0a9e('0x7e'));}}if(_0x2b45ea[_0x0a9e('0x38')]['tag']){_0x45bf7f=_[_0x0a9e('0x7f')](_0x2b45ea[_0x0a9e('0x38')][_0x0a9e('0x80')])?_0x2b45ea['query'][_0x0a9e('0x80')]:new Array(_0x2b45ea[_0x0a9e('0x38')]['tag']);_0x45bf7f[_0x0a9e('0x26')](function(_0x56e31e){_0x5bbcde['or'](_0x0a9e('0x68'),'%,'+_0x56e31e+',%');});}if(_0x2b45ea[_0x0a9e('0x38')][_0x0a9e('0x81')]){var _0x4a43a8=_0x2b45ea['query']['filter'][_0x0a9e('0x82')]('\x5c','\x5c\x5c')[_0x0a9e('0x82')](/'/g,'\x27\x27');if(qs[_0x0a9e('0x83')](_0x4a43a8)){_0x45c845['or'](_0x0a9e('0x84'),_0x4a43a8+'%');}else if(qs[_0x0a9e('0x85')](_0x4a43a8)){_0x45c845['or'](_0x0a9e('0x86'),_0x4a43a8+'%');}else{_0x45c845['or'](_0x0a9e('0x87'),qs[_0x0a9e('0x88')](_0x4a43a8))['or']('MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x0a9e('0x88')](_0x4a43a8));}}}_0x2c2cb0[_0x0a9e('0x72')](_0x45c845);_0x2c2cb0[_0x0a9e('0x89')]('i.id');var _0x2bdc44={'type':db['Sequelize'][_0x0a9e('0x8a')][_0x0a9e('0x8b')],'raw':!![]};var _0x4c46c1=_0x2c2cb0[_0x0a9e('0x8c')]();_0x4c46c1[_0x0a9e('0x42')](_0x0a9e('0x8d'));_0x4c46c1[_0x0a9e('0x42')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x0a9e('0x5c'));if(_0x332d35[_0x0a9e('0x8e')]){_0x332d35[_0x0a9e('0x8e')][_0x0a9e('0x26')](function(_0x5b7fc3){var _0x109ccb=_0x5b7fc3[0x0]===_0x0a9e('0x8f')?_0x5b7fc3[0x0]:'i.'+_0x5b7fc3[0x0];_0x2c2cb0[_0x0a9e('0x8e')](_0x109ccb,_0x5b7fc3[0x1]===_0x0a9e('0x90')?![]:!![]);});}if(!_['isEmpty'](_0x45bf7f)){_0x2c2cb0[_0x0a9e('0x5e')](_0x5bbcde);_0x4c46c1[_0x0a9e('0x72')](_0x0a9e('0x91'),_0x45bf7f);}BPromise[_0x0a9e('0x92')]()[_0x0a9e('0x1a')](function(){if(!_0x1bde3c){if(_0x2b45ea[_0x0a9e('0x38')][_0x0a9e('0x93')])return;_0x4c46c1[_0x0a9e('0x72')](_0x0a9e('0x94'));_0x2c2cb0[_0x0a9e('0x72')](_0x0a9e('0x94'));return;}if(_0x2b45ea[_0x0a9e('0x95')][_0x0a9e('0x96')]!==_0x0a9e('0x97'))return;return _0x2b45ea['user'][_0x0a9e('0x98')]({'attributes':['id'],'raw':!![]})[_0x0a9e('0x1a')](function(_0xc599b3){if(_['isEmpty'](_0xc599b3)){_0x4c46c1[_0x0a9e('0x72')](_0x0a9e('0x99'));_0x2c2cb0[_0x0a9e('0x72')](_0x0a9e('0x99'));}else{_0x4c46c1['where']('i.MailAccountId\x20IN\x20?',_[_0x0a9e('0x37')](_0xc599b3,'id'));_0x2c2cb0[_0x0a9e('0x72')]('i.MailAccountId\x20IN\x20?',_[_0x0a9e('0x37')](_0xc599b3,'id'));}});})['then'](function(){if(_0x2b45ea[_0x0a9e('0x95')][_0x0a9e('0x96')]==='agent'&&!_0x1bde3c&&!_0x2b45ea[_0x0a9e('0x38')][_0x0a9e('0x93')])return[];return db[_0x0a9e('0x9a')][_0x0a9e('0x38')](_0x4c46c1[_0x0a9e('0x9b')](),_0x2bdc44);})[_0x0a9e('0x1a')](function(_0x444f1f){_0x5583a4['count']=_0x444f1f[_0x0a9e('0x3c')];if(_0x5583a4[_0x0a9e('0x16')]===0x0)return[];return db[_0x0a9e('0x9a')][_0x0a9e('0x38')](_0xeaa5e5['toString'](),_0x2bdc44)[_0x0a9e('0x1a')](function(_0xf0db1){_0x13cb1f=_['keyBy'](_0xf0db1,'id');_0x2bdc44=_[_0x0a9e('0x9c')](_0x2bdc44,{'model':db['MailInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x2b45ea[_0x0a9e('0x38')][_0x0a9e('0x3b')]){_0x332d35[_0x0a9e('0x3a')][_0x0a9e('0x26')](function(_0x5af453){_0x2c2cb0['field']('i.'+_0x5af453);});}else{_0x2c2cb0[_0x0a9e('0x42')](_0x0a9e('0x9d'),_0x0a9e('0x5c'));_0x2c2cb0['field'](_0x0a9e('0x9e'),_0x0a9e('0x9f'));_0x2c2cb0['field']('a.mandatoryDisposition',_0x0a9e('0xa0'));_0x2c2cb0['field']('CASE\x20WHEN\x20i.to\x20IS\x20NOT\x20NULL\x20AND\x20i.to\x20<>\x20\x27\x27\x20AND\x20i.to\x20NOT\x20LIKE\x20(\x27%\x27\x20+\x20a.email\x20+\x20\x27%\x27)\x20THEN\x20SUBSTRING_INDEX(i.to,\x20\x27<\x27,\x201)\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','contactName');_0x2c2cb0[_0x0a9e('0x42')](_0x0a9e('0x8d'));_0x2c2cb0[_0x0a9e('0x42')](_0x0a9e('0xa1'));_0x2c2cb0[_0x0a9e('0x42')](_0x0a9e('0xa2'));_0x2c2cb0['field'](_0x0a9e('0xa3'));_0x2c2cb0['field'](_0x0a9e('0xa4'));_0x2c2cb0[_0x0a9e('0x42')](_0x0a9e('0xa5'));_0x2c2cb0[_0x0a9e('0x42')]('i.lastMsgAt');_0x2c2cb0[_0x0a9e('0x42')](_0x0a9e('0xa6'));_0x2c2cb0[_0x0a9e('0x42')]('i.subject');_0x2c2cb0[_0x0a9e('0x42')](_0x0a9e('0xa7'));_0x2c2cb0[_0x0a9e('0x42')](_0x0a9e('0xa8'));_0x2c2cb0[_0x0a9e('0x42')](_0x0a9e('0xa9'));_0x2c2cb0[_0x0a9e('0x42')](_0x0a9e('0xaa'));_0x2c2cb0['field'](_0x0a9e('0xab'));_0x2c2cb0[_0x0a9e('0x42')]('i.ContactId');_0x2c2cb0[_0x0a9e('0x42')](_0x0a9e('0xac'));_0x2c2cb0[_0x0a9e('0x42')]('i.UserId');_0x2c2cb0[_0x0a9e('0x42')]('c.firstName',_0x0a9e('0xad'));_0x2c2cb0[_0x0a9e('0x42')](_0x0a9e('0xae'),_0x0a9e('0xaf'));_0x2c2cb0[_0x0a9e('0x42')](_0x0a9e('0xb0'),_0x0a9e('0xb1'));_0x2c2cb0[_0x0a9e('0x42')]('c.phone',_0x0a9e('0xb2'));_0x2c2cb0[_0x0a9e('0x42')](_0x0a9e('0xb3'),_0x0a9e('0xb4'));_0x2c2cb0[_0x0a9e('0x42')](_0x0a9e('0xb5'),_0x0a9e('0xb6'));_0x2c2cb0[_0x0a9e('0x42')](_0x0a9e('0xb7'),_0x0a9e('0xb8'));_0x2c2cb0[_0x0a9e('0x42')](_0x0a9e('0xb9'),_0x0a9e('0xba'));_0x2c2cb0['field'](_0x0a9e('0xbb'),_0x0a9e('0x28'));}if(_0x332d35[_0x0a9e('0x15')])_0x2c2cb0[_0x0a9e('0x15')](_0x332d35[_0x0a9e('0x15')]);if(_0x332d35['offset'])_0x2c2cb0[_0x0a9e('0x13')](_0x332d35[_0x0a9e('0x13')]);return db['sequelize'][_0x0a9e('0x38')](_0x2c2cb0['toString'](),_0x2bdc44);})[_0x0a9e('0x1a')](function(_0x27041d){if(_0x27041d[_0x0a9e('0x3c')]>0x0)_0x37f6cc[_0x0a9e('0x72')]('ui.MailInteractionId\x20IN\x20?',_[_0x0a9e('0x37')](_0x27041d,'id'));return db['sequelize'][_0x0a9e('0x38')](_0x37f6cc[_0x0a9e('0x9b')](),_0x2bdc44)['then'](function(_0x231c6a){var _0x63c9f7=_[_0x0a9e('0xbc')](_0x231c6a,'MailInteractionId');var _0x4c788f=[];return db[_0x0a9e('0xbd')][_0x0a9e('0x2a')]({'attributes':[_0x0a9e('0xbe')],'raw':!![]})[_0x0a9e('0x1a')](function(_0x3f2f40){var _0x2450a8=_0x3f2f40[_0x0a9e('0xbe')];_0x27041d[_0x0a9e('0x26')](function(_0x3f8124){_0x4c788f['push'](updateMailInteraction(_0x3f8124,_0x13cb1f,_0x63c9f7,_0x2450a8));});return BPromise[_0x0a9e('0xbf')](_0x4c788f);});});});})['then'](function(_0x287324){_0x5583a4[_0x0a9e('0xc0')]=_0x287324;return _0x5583a4;})[_0x0a9e('0x1a')](respondWithFilteredResult(_0x409319,_0x332d35))[_0x0a9e('0x30')](handleError(_0x409319,null));};exports[_0x0a9e('0xc1')]=function(_0x4e7273,_0x436313){var _0x4667bf={'raw':![],'where':{'id':_0x4e7273[_0x0a9e('0xc2')]['id']}},_0x2791c5={};_0x2791c5[_0x0a9e('0x36')]=_['keys'](db['MailInteraction'][_0x0a9e('0x33')]);_0x2791c5['query']=_[_0x0a9e('0x6f')](_0x4e7273[_0x0a9e('0x38')]);_0x2791c5[_0x0a9e('0x3f')]=_[_0x0a9e('0x39')](_0x2791c5[_0x0a9e('0x36')],_0x2791c5[_0x0a9e('0x38')]);_0x4667bf['attributes']=_['intersection'](_0x2791c5[_0x0a9e('0x36')],qs['fields'](_0x4e7273[_0x0a9e('0x38')]['fields']));_0x4667bf[_0x0a9e('0x3a')]=_0x4667bf['attributes']['length']?_0x4667bf[_0x0a9e('0x3a')]:_0x2791c5[_0x0a9e('0x36')];if(_0x4e7273['query'][_0x0a9e('0xc3')]){_0x4667bf[_0x0a9e('0xc4')]=[{'all':!![]}];}_0x4667bf=_[_0x0a9e('0x9c')]({},_0x4667bf,_0x4e7273[_0x0a9e('0xc5')]);return db[_0x0a9e('0x32')]['find'](_0x4667bf)['then'](handleEntityNotFound(_0x436313,null))[_0x0a9e('0x1a')](respondWithResult(_0x436313,null))[_0x0a9e('0x30')](handleError(_0x436313,null));};exports[_0x0a9e('0xc6')]=function(_0x24beb6,_0x59303b){return db['MailInteraction'][_0x0a9e('0xc6')](_0x24beb6[_0x0a9e('0xc7')],{})['then'](respondWithResult(_0x59303b,0xc9))[_0x0a9e('0x30')](handleError(_0x59303b,null));};exports[_0x0a9e('0x19')]=function(_0xcacabb,_0x2427d5){if(_0xcacabb[_0x0a9e('0xc7')]['id']){delete _0xcacabb[_0x0a9e('0xc7')]['id'];}return db[_0x0a9e('0x32')][_0x0a9e('0x5b')]({'where':{'id':_0xcacabb[_0x0a9e('0xc2')]['id']}})[_0x0a9e('0x1a')](handleEntityNotFound(_0x2427d5,null))['then'](saveUpdates(_0xcacabb[_0x0a9e('0xc7')],null))[_0x0a9e('0x1a')](respondWithResult(_0x2427d5,null))[_0x0a9e('0x30')](handleError(_0x2427d5,null));};exports[_0x0a9e('0x1b')]=function(_0x1d0b02,_0x547e37){return db['MailInteraction'][_0x0a9e('0x5b')]({'where':{'id':_0x1d0b02[_0x0a9e('0xc2')]['id']}})[_0x0a9e('0x1a')](handleEntityNotFound(_0x547e37,null))[_0x0a9e('0x1a')](removeEntity(_0x547e37,null))[_0x0a9e('0x30')](handleError(_0x547e37,null));};exports['describe']=function(_0x1339d0,_0x3c775a){return db[_0x0a9e('0x32')]['describe']()[_0x0a9e('0x1a')](respondWithResult(_0x3c775a,null))['catch'](handleError(_0x3c775a,null));};exports[_0x0a9e('0xc8')]=function(_0x4799d4,_0x25b745){return db[_0x0a9e('0x29')][_0x0a9e('0x5b')]({'where':{'id':_0x4799d4['params']['id']}})[_0x0a9e('0x1a')](handleEntityNotFound(_0x25b745,null))['then'](function(_0x4383da){if(_0x4383da){return _0x4383da[_0x0a9e('0xc8')](_0x4799d4[_0x0a9e('0xc7')][_0x0a9e('0xc9')],_[_0x0a9e('0xca')](_0x4799d4[_0x0a9e('0xc7')],[_0x0a9e('0xc9'),'id'])||{});}})[_0x0a9e('0x1a')](respondWithResult(_0x25b745,null))[_0x0a9e('0x30')](handleError(_0x25b745,null));};exports[_0x0a9e('0xcb')]=function(_0x4262d0,_0xc876d4){var _0x2415fe={'raw':![],'where':{}};var _0x399def={};var _0x98c62c={'count':0x0,'rows':[]};return db[_0x0a9e('0x32')]['findOne']({'where':{'id':_0x4262d0['params']['id']}})[_0x0a9e('0x1a')](handleEntityNotFound(_0xc876d4,null))['then'](function(_0x1d999b){if(_0x1d999b){_0x399def[_0x0a9e('0x36')]=_['keys'](db[_0x0a9e('0x29')][_0x0a9e('0x33')]);_0x399def[_0x0a9e('0x38')]=_[_0x0a9e('0x6f')](_0x4262d0['query']);_0x399def[_0x0a9e('0x3f')]=_[_0x0a9e('0x39')](_0x399def[_0x0a9e('0x36')],_0x399def[_0x0a9e('0x38')]);_0x2415fe['attributes']=_[_0x0a9e('0x39')](_0x399def[_0x0a9e('0x36')],qs[_0x0a9e('0x3b')](_0x4262d0['query'][_0x0a9e('0x3b')]));_0x2415fe[_0x0a9e('0x3a')]=_0x2415fe[_0x0a9e('0x3a')]['length']?_0x2415fe[_0x0a9e('0x3a')]:_0x399def[_0x0a9e('0x36')];if(!_0x4262d0[_0x0a9e('0x38')][_0x0a9e('0x3d')](_0x0a9e('0xcc'))){_0x2415fe['limit']=qs[_0x0a9e('0x15')](_0x4262d0[_0x0a9e('0x38')]['limit']);_0x2415fe[_0x0a9e('0x13')]=qs[_0x0a9e('0x13')](_0x4262d0[_0x0a9e('0x38')]['offset']);}_0x2415fe['order']=qs['sort'](_0x4262d0[_0x0a9e('0x38')][_0x0a9e('0x3e')]);_0x2415fe['where']=qs[_0x0a9e('0x3f')](_[_0x0a9e('0x40')](_0x4262d0[_0x0a9e('0x38')],_0x399def['filters']));_0x2415fe[_0x0a9e('0x72')][_0x0a9e('0xcd')]=_0x1d999b['id'];if(_0x4262d0[_0x0a9e('0x38')][_0x0a9e('0x81')]){_0x2415fe[_0x0a9e('0x72')]=_[_0x0a9e('0x9c')](_0x2415fe[_0x0a9e('0x72')],{'$or':_[_0x0a9e('0x37')](_0x2415fe[_0x0a9e('0x3a')],function(_0x5a1848){var _0x43c397={};_0x43c397[_0x5a1848]={'$like':'%'+_0x4262d0['query'][_0x0a9e('0x81')]+'%'};return _0x43c397;})});}if(_0x4262d0[_0x0a9e('0x38')][_0x0a9e('0x77')]){var _0x3cf222=_0x4262d0[_0x0a9e('0x38')][_0x0a9e('0x77')]['split'](',');var _0x1a0314={};_0x1a0314[_0x3cf222[0x0]]={'$gte':moment(_0x3cf222[0x1])[_0x0a9e('0xce')](_0x0a9e('0xcf'))};_0x2415fe[_0x0a9e('0x72')]=_['merge'](_0x2415fe[_0x0a9e('0x72')],_0x1a0314);}_0x2415fe=_[_0x0a9e('0x9c')]({},_0x2415fe,_0x4262d0[_0x0a9e('0xc5')]);return db[_0x0a9e('0x29')][_0x0a9e('0x16')]({'where':_0x2415fe[_0x0a9e('0x72')]})[_0x0a9e('0x1a')](function(_0x25931e){_0x98c62c[_0x0a9e('0x16')]=_0x25931e;if(_0x4262d0[_0x0a9e('0x38')]['includeAll']){_0x2415fe[_0x0a9e('0xc4')]=[{'all':!![]}];}return db[_0x0a9e('0x29')][_0x0a9e('0xd0')](_0x2415fe);})[_0x0a9e('0x1a')](function(_0xea8bd1){if(_0x4262d0[_0x0a9e('0x38')][_0x0a9e('0xd1')]===_0x0a9e('0xd2')){for(var _0x566b90=0x0;_0x566b90<_0xea8bd1[_0x0a9e('0x3c')];_0x566b90++){_0xea8bd1[_0x566b90][_0x0a9e('0xc7')]=juice(_0xea8bd1[_0x566b90][_0x0a9e('0xc7')]);}}_0x98c62c['rows']=_0xea8bd1;return _0x98c62c;});}})[_0x0a9e('0x1a')](respondWithFilteredResult(_0xc876d4,_0x2415fe))[_0x0a9e('0x30')](handleError(_0xc876d4,null));};exports[_0x0a9e('0xd3')]=function(_0x97d5b5,_0x370b5e){return db[_0x0a9e('0x32')][_0x0a9e('0x5b')]({'where':{'id':_0x97d5b5[_0x0a9e('0xc2')]['id']}})[_0x0a9e('0x1a')](handleEntityNotFound(_0x370b5e,null))[_0x0a9e('0x1a')](function(_0x5a7dad){if(_0x5a7dad){return _0x5a7dad[_0x0a9e('0xd4')](_0x97d5b5[_0x0a9e('0xc7')][_0x0a9e('0xc9')],_[_0x0a9e('0xca')](_0x97d5b5[_0x0a9e('0xc7')],[_0x0a9e('0xc9'),'id'])||{})['spread'](function(){return db[_0x0a9e('0xd5')]['findAll']({'attributes':['id','name','color'],'where':{'id':_0x97d5b5[_0x0a9e('0xc7')][_0x0a9e('0xc9')]}});})[_0x0a9e('0x1a')](function(_0x2a07d0){socket['emit'](_0x0a9e('0xd6'),{'id':Number(_0x97d5b5[_0x0a9e('0xc2')]['id']),'tags':_0x2a07d0||[]});return{'id':Number(_0x97d5b5[_0x0a9e('0xc2')]['id']),'tags':_0x2a07d0||[]};});}})[_0x0a9e('0x1a')](respondWithResult(_0x370b5e,null))[_0x0a9e('0x30')](handleError(_0x370b5e,null));};exports['removeTags']=function(_0x57b1b1,_0x9484c8){return db[_0x0a9e('0x32')][_0x0a9e('0x5b')]({'where':{'id':_0x57b1b1['params']['id']}})[_0x0a9e('0x1a')](handleEntityNotFound(_0x9484c8,null))[_0x0a9e('0x1a')](function(_0x422f0a){if(_0x422f0a){return _0x422f0a['removeTags'](_0x57b1b1[_0x0a9e('0x38')][_0x0a9e('0xc9')]);}})[_0x0a9e('0x1a')](respondWithStatusCode(_0x9484c8,null))['catch'](handleError(_0x9484c8,null));};exports[_0x0a9e('0xd7')]=function(_0x336b30,_0x3b7213){var _0x549e03=moment()['unix']()['toString']();var _0x3b04fd=path[_0x0a9e('0xd8')](config[_0x0a9e('0xd9')],_0x0a9e('0xda'),'files',_0x0a9e('0xdb'));var _0x532424=path[_0x0a9e('0xd8')](config[_0x0a9e('0xd9')],_0x0a9e('0xda'),'files',_0x0a9e('0xdc'));var _0x33a26c=path[_0x0a9e('0xd8')](_0x3b04fd,_0x549e03);var _0x580dd6=util[_0x0a9e('0xce')]('transcript-%d-%s.zip',_0x336b30[_0x0a9e('0xc2')]['id'],_0x549e03);var _0x5c57e1=path[_0x0a9e('0xd8')](_0x3b04fd,_0x580dd6);var _0x57b7d4=[];if(_0x336b30[_0x0a9e('0x38')][_0x0a9e('0xdc')]){_0x57b7d4[_0x0a9e('0x27')]({'model':db[_0x0a9e('0xdd')],'as':_0x0a9e('0xde'),'raw':!![]});}var _0x251dd9=[{'model':db[_0x0a9e('0x29')],'as':'Messages','attributes':['id',_0x0a9e('0xc7'),_0x0a9e('0x44'),'to','cc','bcc',_0x0a9e('0xdf'),_0x0a9e('0x75')],'where':{'secret':![]},'order':qs['sort']('id'),'include':_0x57b7d4}];return db[_0x0a9e('0x32')][_0x0a9e('0x5b')]({'where':{'id':_0x336b30[_0x0a9e('0xc2')]['id']},'include':_0x251dd9})['then'](handleEntityNotFound(_0x3b7213,null))[_0x0a9e('0x1a')](function(_0xf49ed4){if(_0xf49ed4&&_0xf49ed4[_0x0a9e('0xe0')]){var _0x3f0d64=_0xf49ed4[_0x0a9e('0xe1')]({'plain':!![]});fs[_0x0a9e('0xe2')](_0x33a26c);return BPromise[_0x0a9e('0xe3')](_0x3f0d64[_0x0a9e('0xe0')],function(_0x22767f,_0x426c3c){var _0x56e148={'from':_0x22767f[_0x0a9e('0x44')],'to':_0x22767f['to'],'subject':_0x22767f['subject'],'html':_0x22767f[_0x0a9e('0xc7')],'headers':{'Date':moment(_0x22767f[_0x0a9e('0x75')])[_0x0a9e('0xce')](_0x0a9e('0xe4'))},'attachments':[]};if(_0x22767f['cc']){_0x56e148[_0x0a9e('0xe5')]['Cc']=_0x22767f['cc'];}if(_0x22767f[_0x0a9e('0xe6')]){_0x56e148['headers'][_0x0a9e('0xe7')]=_0x22767f[_0x0a9e('0xe6')];}return new BPromise(function(_0x2977a7,_0x55a599){if(_0x22767f[_0x0a9e('0xde')]){for(var _0x402544=0x0;_0x402544<_0x22767f[_0x0a9e('0xde')][_0x0a9e('0x3c')];_0x402544++){var _0x31e1e0=_0x22767f[_0x0a9e('0xde')][_0x402544];var _0x1e93f5=path['join'](_0x532424,_0x31e1e0[_0x0a9e('0xe8')]);if(fs[_0x0a9e('0xe9')](_0x1e93f5)){_0x56e148[_0x0a9e('0xdc')][_0x0a9e('0x27')]({'name':_0x31e1e0[_0x0a9e('0x20')],'contentType':_0x31e1e0[_0x0a9e('0x65')],'data':fs[_0x0a9e('0xea')](_0x1e93f5)});}}}emlformat['build'](_0x56e148,function(_0x5c8720,_0x10aa22){if(_0x5c8720)return _0x55a599(_0x5c8720);fs[_0x0a9e('0xeb')](path[_0x0a9e('0xd8')](_0x33a26c,util[_0x0a9e('0xce')](_0x0a9e('0xec'),_0x426c3c)),_0x10aa22);return _0x2977a7(_0x10aa22);});});})[_0x0a9e('0x1a')](function(){return new BPromise(function(_0x609711,_0x584854){zipdir(_0x33a26c,{'saveTo':_0x5c57e1},function(_0x39ea62,_0x1d7fc4){if(_0x39ea62)return _0x584854(_0x39ea62);return _0x609711(_0x1d7fc4);});})[_0x0a9e('0x1a')](function(){return new BPromise(function(_0x2675a5,_0x1b1757){rimraf(_0x33a26c,function(_0x3c6082){if(_0x3c6082)_0x1b1757(_0x3c6082);return _0x2675a5();});});})[_0x0a9e('0x1a')](function(){return _0x3b7213['download'](_0x5c57e1,_0x580dd6,function(_0x311288){if(!_0x311288)fs[_0x0a9e('0xed')](_0x5c57e1);});});});}else{return _0x3b7213[_0x0a9e('0x1d')](0xc8);}})['catch'](handleError(_0x3b7213,null));}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.events.js b/server/api/mailInteraction/mailInteraction.events.js index 3d3a68d..2f32529 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 _0x3191=['map','length','emit','hook','exports','../../mysqldb','MailInteraction','MailMessage','setMaxListeners','save','update','remove','getUsers','then','setDataValue','Users'];(function(_0x446208,_0xb483fb){var _0xe49563=function(_0x1d3a21){while(--_0x1d3a21){_0x446208['push'](_0x446208['shift']());}};_0xe49563(++_0xb483fb);}(_0x3191,0x85));var _0x1319=function(_0x1ba363,_0x4b0e08){_0x1ba363=_0x1ba363-0x0;var _0x32853f=_0x3191[_0x1ba363];return _0x32853f;};'use strict';var EventEmitter=require('events');var MailInteraction=require(_0x1319('0x0'))['db'][_0x1319('0x1')];var MailMessage=require(_0x1319('0x0'))['db'][_0x1319('0x2')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0x1319('0x3')](0x0);var events={'afterCreate':_0x1319('0x4'),'afterUpdate':_0x1319('0x5'),'afterDestroy':_0x1319('0x6')};function emitEvent(_0x1a1a33){return function(_0x1f6a1f,_0x567abb,_0x9ae16){_0x1f6a1f[_0x1319('0x7')]({'attributes':['id'],'raw':!![]})[_0x1319('0x8')](function(_0x14065b){_0x1f6a1f[_0x1319('0x9')](_0x1319('0xa'),_0x14065b[_0x1319('0xb')](function(_0x22ff5a){return{'id':_0x22ff5a['id']};}));return MailMessage['findAll']({'where':{'MailInteractionId':_0x1f6a1f['id'],'direction':'in','read':![]},'raw':!![]});})[_0x1319('0x8')](function(_0x511172){_0x1f6a1f['setDataValue']('unreadMessages',_0x511172[_0x1319('0xc')]);MailInteractionEvents[_0x1319('0xd')](_0x1a1a33+':'+_0x1f6a1f['id'],_0x1f6a1f);MailInteractionEvents[_0x1319('0xd')](_0x1a1a33,_0x1f6a1f);_0x9ae16(null);})['catch'](_0x9ae16(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailInteraction[_0x1319('0xe')](e,emitEvent(event));}}module[_0x1319('0xf')]=MailInteractionEvents; \ No newline at end of file +var _0xac83=['findAll','unreadMessages','length','emit','catch','hasOwnProperty','hook','exports','events','../../mysqldb','MailMessage','setMaxListeners','update','remove','getUsers','then','setDataValue','Users','map'];(function(_0x2dc96f,_0x459058){var _0xd012da=function(_0x38d032){while(--_0x38d032){_0x2dc96f['push'](_0x2dc96f['shift']());}};_0xd012da(++_0x459058);}(_0xac83,0xd9));var _0x3ac8=function(_0x817d9b,_0x3c37e3){_0x817d9b=_0x817d9b-0x0;var _0x2752e1=_0xac83[_0x817d9b];return _0x2752e1;};'use strict';var EventEmitter=require(_0x3ac8('0x0'));var MailInteraction=require(_0x3ac8('0x1'))['db']['MailInteraction'];var MailMessage=require(_0x3ac8('0x1'))['db'][_0x3ac8('0x2')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0x3ac8('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x3ac8('0x4'),'afterDestroy':_0x3ac8('0x5')};function emitEvent(_0x12988c){return function(_0x3d2336,_0x3d1b12,_0x359ea7){_0x3d2336[_0x3ac8('0x6')]({'attributes':['id'],'raw':!![]})[_0x3ac8('0x7')](function(_0x22f6f7){_0x3d2336[_0x3ac8('0x8')](_0x3ac8('0x9'),_0x22f6f7[_0x3ac8('0xa')](function(_0x1c6d37){return{'id':_0x1c6d37['id']};}));return MailMessage[_0x3ac8('0xb')]({'where':{'MailInteractionId':_0x3d2336['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x53ba43){_0x3d2336[_0x3ac8('0x8')](_0x3ac8('0xc'),_0x53ba43[_0x3ac8('0xd')]);MailInteractionEvents[_0x3ac8('0xe')](_0x12988c+':'+_0x3d2336['id'],_0x3d2336);MailInteractionEvents[_0x3ac8('0xe')](_0x12988c,_0x3d2336);_0x359ea7(null);})[_0x3ac8('0xf')](_0x359ea7(null));};}for(var e in events){if(events[_0x3ac8('0x10')](e)){var event=events[e];MailInteraction[_0x3ac8('0x11')](e,emitEvent(event));}}module[_0x3ac8('0x12')]=MailInteractionEvents; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.model.js b/server/api/mailInteraction/mailInteraction.model.js index 2094fa3..c376ea5 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 _0xe04a=['bluebird','request-promise','path','rimraf','./mailInteraction.attributes','MailInteraction','mail_interactions','fti_mail_interactions','subject','FULLTEXT','substatusAt','format','closedAt','YYYY-MM-DD\x20HH:mm:ss','changed','substatus','closed','models','MailMessage','update','then','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment'];(function(_0x122606,_0x2c6d41){var _0x49493e=function(_0x361ba9){while(--_0x361ba9){_0x122606['push'](_0x122606['shift']());}};_0x49493e(++_0x2c6d41);}(_0xe04a,0x1bb));var _0xae04=function(_0x487fe2,_0x5c7282){_0x487fe2=_0x487fe2-0x0;var _0xb43dd9=_0xe04a[_0x487fe2];return _0xb43dd9;};'use strict';var _=require(_0xae04('0x0'));var util=require(_0xae04('0x1'));var logger=require(_0xae04('0x2'))(_0xae04('0x3'));var moment=require(_0xae04('0x4'));var BPromise=require(_0xae04('0x5'));var rp=require(_0xae04('0x6'));var fs=require('fs');var path=require(_0xae04('0x7'));var rimraf=require(_0xae04('0x8'));var config=require('../../config/environment');var attributes=require(_0xae04('0x9'));module['exports']=function(_0x59372b,_0x202ffe){return _0x59372b['define'](_0xae04('0xa'),attributes,{'tableName':_0xae04('0xb'),'paranoid':![],'indexes':[{'name':_0xae04('0xc'),'fields':[_0xae04('0xd'),'to'],'type':_0xae04('0xe')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x5d823f,_0xadf8f6,_0x1a56ed){if(_0x5d823f['substatus']){_0x5d823f[_0xae04('0xf')]=moment()[_0xae04('0x10')]('YYYY-MM-DD\x20HH:mm:ss');}if(_0x5d823f['closed']){_0x5d823f[_0xae04('0x11')]=moment()[_0xae04('0x10')](_0xae04('0x12'));}_0x1a56ed(null,_0xadf8f6);},'beforeUpdate':function(_0x579f62,_0x38c57e,_0x475d8c){if(_0x579f62[_0xae04('0x13')](_0xae04('0x14'))){_0x579f62[_0xae04('0xf')]=_0x579f62['substatus']?moment()[_0xae04('0x10')](_0xae04('0x12')):null;}if(_0x579f62[_0xae04('0x13')](_0xae04('0x15'))){_0x579f62[_0xae04('0x11')]=moment()[_0xae04('0x10')](_0xae04('0x12'));_0x579f62[_0xae04('0x14')]=null;_0x579f62['substatusAt']=null;}_0x475d8c(null,_0x579f62);},'afterUpdate':function(_0x19dbca,_0x4d264b,_0x6b88d8){var _0x2d41b5=_0x59372b[_0xae04('0x16')];var _0x55719d=_0x19dbca['get']({'plain':!![]});if(_0x55719d[_0xae04('0x15')]){return _0x2d41b5[_0xae04('0x17')][_0xae04('0x18')]({'read':!![]},{'where':{'MailInteractionId':_0x55719d['id']}})[_0xae04('0x19')](function(){_0x6b88d8();})['catch'](function(_0x12009e){_0x6b88d8(_0x12009e);});}else{_0x6b88d8();}}},'charset':_0xae04('0x1a'),'collate':_0xae04('0x1b')});}; \ No newline at end of file +var _0x2756=['./mailInteraction.attributes','define','mail_interactions','fti_mail_interactions','subject','FULLTEXT','format','YYYY-MM-DD\x20HH:mm:ss','closed','closedAt','changed','substatus','substatusAt','models','get','then','catch','utf8mb4','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x2756,0x7a));var _0x6275=function(_0x51ec61,_0xf9d1e3){_0x51ec61=_0x51ec61-0x0;var _0x223200=_0x2756[_0x51ec61];return _0x223200;};'use strict';var _=require(_0x6275('0x0'));var util=require(_0x6275('0x1'));var logger=require(_0x6275('0x2'))('api');var moment=require(_0x6275('0x3'));var BPromise=require(_0x6275('0x4'));var rp=require(_0x6275('0x5'));var fs=require('fs');var path=require(_0x6275('0x6'));var rimraf=require(_0x6275('0x7'));var config=require('../../config/environment');var attributes=require(_0x6275('0x8'));module['exports']=function(_0x369253,_0x333bc2){return _0x369253[_0x6275('0x9')]('MailInteraction',attributes,{'tableName':_0x6275('0xa'),'paranoid':![],'indexes':[{'name':_0x6275('0xb'),'fields':[_0x6275('0xc'),'to'],'type':_0x6275('0xd')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x2a7b4e,_0x103c77,_0x2b031b){if(_0x2a7b4e['substatus']){_0x2a7b4e['substatusAt']=moment()[_0x6275('0xe')](_0x6275('0xf'));}if(_0x2a7b4e[_0x6275('0x10')]){_0x2a7b4e[_0x6275('0x11')]=moment()[_0x6275('0xe')](_0x6275('0xf'));}_0x2b031b(null,_0x103c77);},'beforeUpdate':function(_0x216a86,_0x4fd332,_0x47ba1d){if(_0x216a86[_0x6275('0x12')](_0x6275('0x13'))){_0x216a86[_0x6275('0x14')]=_0x216a86[_0x6275('0x13')]?moment()[_0x6275('0xe')](_0x6275('0xf')):null;}if(_0x216a86[_0x6275('0x12')](_0x6275('0x10'))){_0x216a86[_0x6275('0x11')]=moment()[_0x6275('0xe')]('YYYY-MM-DD\x20HH:mm:ss');_0x216a86[_0x6275('0x13')]=null;_0x216a86[_0x6275('0x14')]=null;}_0x47ba1d(null,_0x216a86);},'afterUpdate':function(_0x5c8499,_0x16816c,_0x3a90ce){var _0xec61d6=_0x369253[_0x6275('0x15')];var _0x1a4c68=_0x5c8499[_0x6275('0x16')]({'plain':!![]});if(_0x1a4c68[_0x6275('0x10')]){return _0xec61d6['MailMessage']['update']({'read':!![]},{'where':{'MailInteractionId':_0x1a4c68['id']}})[_0x6275('0x17')](function(){_0x3a90ce();})[_0x6275('0x18')](function(_0x1486e4){_0x3a90ce(_0x1486e4);});}else{_0x3a90ce();}}},'charset':_0x6275('0x19'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.rpc.js b/server/api/mailInteraction/mailInteraction.rpc.js index 6941942..3302c1a 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 _0xf39c=['ids','omit','AddTags','stringify','lodash','util','moment','bluebird','ioredis','../../config/utils','rpc','../../config/environment','http','defaults','redis','localhost','socket.io-emitter','register','request','then','MailInteraction,\x20%s,\x20%s','request\x20sent','MailInteraction,\x20%s,\x20%s,\x20%s','error','message','result','catch','MailInteraction','update','body','options','raw','where','limit','info','debug','UpdateMailInteraction','AddTagsToMailInteraction','find','addTags'];(function(_0x306369,_0x3671a3){var _0x25284d=function(_0x19ddd8){while(--_0x19ddd8){_0x306369['push'](_0x306369['shift']());}};_0x25284d(++_0x3671a3);}(_0xf39c,0x16c));var _0xcf39=function(_0x2cbe4a,_0x2b063c){_0x2cbe4a=_0x2cbe4a-0x0;var _0x42c5a8=_0xf39c[_0x2cbe4a];return _0x42c5a8;};'use strict';var _=require(_0xcf39('0x0'));var util=require(_0xcf39('0x1'));var moment=require(_0xcf39('0x2'));var BPromise=require(_0xcf39('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xcf39('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xcf39('0x5'));var logger=require('../../config/logger')(_0xcf39('0x6'));var config=require(_0xcf39('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0xcf39('0x8')]({'port':0x232a});config['redis']=_[_0xcf39('0x9')](config[_0xcf39('0xa')],{'host':_0xcf39('0xb'),'port':0x18eb});var socket=require(_0xcf39('0xc'))(new Redis(config[_0xcf39('0xa')]));require('./mailInteraction.socket')[_0xcf39('0xd')](socket);function respondWithRpcPromise(_0x10e26e,_0x4f5d63,_0x1f0fc4){return new BPromise(function(_0x2b7ba0,_0xb0cc1e){return client[_0xcf39('0xe')](_0x10e26e,_0x1f0fc4)[_0xcf39('0xf')](function(_0x2049ce){logger['info'](_0xcf39('0x10'),_0x4f5d63,_0xcf39('0x11'));logger['debug'](_0xcf39('0x12'),_0x4f5d63,_0xcf39('0x11'),JSON['stringify'](_0x2049ce));if(_0x2049ce['error']){if(_0x2049ce[_0xcf39('0x13')]['code']===0x1f4){logger[_0xcf39('0x13')](_0xcf39('0x10'),_0x4f5d63,_0x2049ce[_0xcf39('0x13')][_0xcf39('0x14')]);return _0xb0cc1e(_0x2049ce[_0xcf39('0x13')][_0xcf39('0x14')]);}logger[_0xcf39('0x13')]('MailInteraction,\x20%s,\x20%s',_0x4f5d63,_0x2049ce['error'][_0xcf39('0x14')]);return _0x2b7ba0(_0x2049ce[_0xcf39('0x13')]['message']);}else{logger['info'](_0xcf39('0x10'),_0x4f5d63,'request\x20sent');_0x2b7ba0(_0x2049ce[_0xcf39('0x15')][_0xcf39('0x14')]);}})[_0xcf39('0x16')](function(_0x293d2c){logger[_0xcf39('0x13')](_0xcf39('0x10'),_0x4f5d63,_0x293d2c);_0xb0cc1e(_0x293d2c);});});}exports['UpdateMailInteraction']=function(_0x18746b){var _0x269d51=this;return new Promise(function(_0x5d089d,_0x340af4){return db[_0xcf39('0x17')][_0xcf39('0x18')](_0x18746b[_0xcf39('0x19')],{'raw':_0x18746b[_0xcf39('0x1a')]?_0x18746b[_0xcf39('0x1a')][_0xcf39('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x18746b['options']?_0x18746b[_0xcf39('0x1a')][_0xcf39('0x1c')]||null:null,'attributes':_0x18746b['options']?_0x18746b[_0xcf39('0x1a')]['attributes']||null:null,'limit':_0x18746b[_0xcf39('0x1a')]?_0x18746b[_0xcf39('0x1a')][_0xcf39('0x1d')]||null:null})[_0xcf39('0xf')](function(_0x4024f1){logger[_0xcf39('0x1e')]('UpdateMailInteraction',_0x18746b);logger[_0xcf39('0x1f')]('UpdateMailInteraction',_0x18746b,JSON['stringify'](_0x4024f1));_0x5d089d(_0x4024f1);})[_0xcf39('0x16')](function(_0x157030){logger[_0xcf39('0x13')](_0xcf39('0x20'),_0x157030[_0xcf39('0x14')],_0x18746b);_0x340af4(_0x269d51[_0xcf39('0x13')](0x1f4,_0x157030['message']));});});};exports[_0xcf39('0x21')]=function(_0x360913){return new Promise(function(_0x343e95,_0x4a0958){return db[_0xcf39('0x17')][_0xcf39('0x22')]({'where':_0x360913[_0xcf39('0x1a')]?_0x360913[_0xcf39('0x1a')][_0xcf39('0x1c')]||null:null})[_0xcf39('0xf')](function(_0x4356cd){if(_0x4356cd){return _0x4356cd[_0xcf39('0x23')](_0x360913['body'][_0xcf39('0x24')],_[_0xcf39('0x25')](_0x360913['body'],['ids','id'])||{});}})['spread'](function(_0x52c675){logger[_0xcf39('0x1e')]('AddTags',_0x360913);logger[_0xcf39('0x1f')](_0xcf39('0x26'),_0x360913,JSON[_0xcf39('0x27')](_0x52c675));_0x343e95(_0x52c675);})[_0xcf39('0x16')](function(_0x3fb9f5){logger['error'](_0xcf39('0x26'),_0x3fb9f5[_0xcf39('0x14')],_0x360913);_0x4a0958(_this['error'](0x1f4,_0x3fb9f5[_0xcf39('0x14')]));});});}; \ No newline at end of file +var _0x935e=['defaults','localhost','./mailInteraction.socket','register','request','then','info','MailInteraction,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','UpdateMailInteraction','MailInteraction','update','body','options','raw','where','attributes','limit','debug','AddTagsToMailInteraction','ids','omit','spread','AddTags','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis'];(function(_0x1fb1be,_0x2d8779){var _0x4f1564=function(_0x48d5f1){while(--_0x48d5f1){_0x1fb1be['push'](_0x1fb1be['shift']());}};_0x4f1564(++_0x2d8779);}(_0x935e,0x17e));var _0xe935=function(_0x4dcd52,_0x235e0c){_0x4dcd52=_0x4dcd52-0x0;var _0x53e4ba=_0x935e[_0x4dcd52];return _0x53e4ba;};'use strict';var _=require(_0xe935('0x0'));var util=require(_0xe935('0x1'));var moment=require(_0xe935('0x2'));var BPromise=require(_0xe935('0x3'));var rs=require(_0xe935('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe935('0x5'))['db'];var utils=require(_0xe935('0x6'));var logger=require(_0xe935('0x7'))(_0xe935('0x8'));var config=require(_0xe935('0x9'));var jayson=require(_0xe935('0xa'));var client=jayson[_0xe935('0xb')][_0xe935('0xc')]({'port':0x232a});config[_0xe935('0xd')]=_[_0xe935('0xe')](config[_0xe935('0xd')],{'host':_0xe935('0xf'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xe935('0x10'))[_0xe935('0x11')](socket);function respondWithRpcPromise(_0x1cf4de,_0x53e08e,_0x4fb203){return new BPromise(function(_0xeecaff,_0x58c5b8){return client[_0xe935('0x12')](_0x1cf4de,_0x4fb203)[_0xe935('0x13')](function(_0x326f03){logger[_0xe935('0x14')](_0xe935('0x15'),_0x53e08e,_0xe935('0x16'));logger['debug']('MailInteraction,\x20%s,\x20%s,\x20%s',_0x53e08e,_0xe935('0x16'),JSON[_0xe935('0x17')](_0x326f03));if(_0x326f03[_0xe935('0x18')]){if(_0x326f03['error'][_0xe935('0x19')]===0x1f4){logger[_0xe935('0x18')](_0xe935('0x15'),_0x53e08e,_0x326f03[_0xe935('0x18')][_0xe935('0x1a')]);return _0x58c5b8(_0x326f03[_0xe935('0x18')][_0xe935('0x1a')]);}logger[_0xe935('0x18')](_0xe935('0x15'),_0x53e08e,_0x326f03[_0xe935('0x18')][_0xe935('0x1a')]);return _0xeecaff(_0x326f03[_0xe935('0x18')]['message']);}else{logger[_0xe935('0x14')](_0xe935('0x15'),_0x53e08e,_0xe935('0x16'));_0xeecaff(_0x326f03[_0xe935('0x1b')][_0xe935('0x1a')]);}})[_0xe935('0x1c')](function(_0x55f267){logger[_0xe935('0x18')]('MailInteraction,\x20%s,\x20%s',_0x53e08e,_0x55f267);_0x58c5b8(_0x55f267);});});}exports[_0xe935('0x1d')]=function(_0x286f50){var _0x482c66=this;return new Promise(function(_0x30154a,_0x21e197){return db[_0xe935('0x1e')][_0xe935('0x1f')](_0x286f50[_0xe935('0x20')],{'raw':_0x286f50['options']?_0x286f50[_0xe935('0x21')][_0xe935('0x22')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x286f50[_0xe935('0x21')]?_0x286f50[_0xe935('0x21')][_0xe935('0x23')]||null:null,'attributes':_0x286f50[_0xe935('0x21')]?_0x286f50['options'][_0xe935('0x24')]||null:null,'limit':_0x286f50[_0xe935('0x21')]?_0x286f50[_0xe935('0x21')][_0xe935('0x25')]||null:null})['then'](function(_0x3808f0){logger[_0xe935('0x14')](_0xe935('0x1d'),_0x286f50);logger[_0xe935('0x26')]('UpdateMailInteraction',_0x286f50,JSON[_0xe935('0x17')](_0x3808f0));_0x30154a(_0x3808f0);})[_0xe935('0x1c')](function(_0x2107e9){logger[_0xe935('0x18')]('UpdateMailInteraction',_0x2107e9[_0xe935('0x1a')],_0x286f50);_0x21e197(_0x482c66['error'](0x1f4,_0x2107e9[_0xe935('0x1a')]));});});};exports[_0xe935('0x27')]=function(_0x387b6a){return new Promise(function(_0x336fa2,_0x2a55e9){return db[_0xe935('0x1e')]['find']({'where':_0x387b6a[_0xe935('0x21')]?_0x387b6a['options']['where']||null:null})[_0xe935('0x13')](function(_0x403b5e){if(_0x403b5e){return _0x403b5e['addTags'](_0x387b6a[_0xe935('0x20')][_0xe935('0x28')],_[_0xe935('0x29')](_0x387b6a[_0xe935('0x20')],[_0xe935('0x28'),'id'])||{});}})[_0xe935('0x2a')](function(_0x1c4f9a){logger[_0xe935('0x14')](_0xe935('0x2b'),_0x387b6a);logger[_0xe935('0x26')](_0xe935('0x2b'),_0x387b6a,JSON[_0xe935('0x17')](_0x1c4f9a));_0x336fa2(_0x1c4f9a);})[_0xe935('0x1c')](function(_0x113b81){logger[_0xe935('0x18')](_0xe935('0x2b'),_0x113b81['message'],_0x387b6a);_0x2a55e9(_this['error'](0x1f4,_0x113b81[_0xe935('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.socket.js b/server/api/mailInteraction/mailInteraction.socket.js index c860a57..9d79b64 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 _0x9204=['removeListener','mailInteraction:','./mailInteraction.events','save','remove'];(function(_0x569fd6,_0x310968){var _0x1c2757=function(_0x3ab9e4){while(--_0x3ab9e4){_0x569fd6['push'](_0x569fd6['shift']());}};_0x1c2757(++_0x310968);}(_0x9204,0x1c9));var _0x4920=function(_0x5e2cd6,_0x193f61){_0x5e2cd6=_0x5e2cd6-0x0;var _0x5e9163=_0x9204[_0x5e2cd6];return _0x5e9163;};'use strict';var MailInteractionEvents=require(_0x4920('0x0'));var events=[_0x4920('0x1'),_0x4920('0x2'),'update'];function createListener(_0x27750b,_0x13658c){return function(_0x15a3bd){_0x13658c['emit'](_0x27750b,_0x15a3bd);};}function removeListener(_0x2e7188,_0x128c5c){return function(){MailInteractionEvents[_0x4920('0x3')](_0x2e7188,_0x128c5c);};}exports['register']=function(_0x412571){for(var _0x298552=0x0,_0x1d747b=events['length'];_0x298552<_0x1d747b;_0x298552++){var _0x3d3534=events[_0x298552];var _0x4d42d1=createListener(_0x4920('0x4')+_0x3d3534,_0x412571);MailInteractionEvents['on'](_0x3d3534,_0x4d42d1);}}; \ No newline at end of file +var _0x43f3=['save','remove','update','emit','removeListener','register','mailInteraction:'];(function(_0x5e84ee,_0x9645a6){var _0xa2b329=function(_0x2337a1){while(--_0x2337a1){_0x5e84ee['push'](_0x5e84ee['shift']());}};_0xa2b329(++_0x9645a6);}(_0x43f3,0xd2));var _0x343f=function(_0x403c20,_0x4a7b99){_0x403c20=_0x403c20-0x0;var _0x2b271a=_0x43f3[_0x403c20];return _0x2b271a;};'use strict';var MailInteractionEvents=require('./mailInteraction.events');var events=[_0x343f('0x0'),_0x343f('0x1'),_0x343f('0x2')];function createListener(_0x104945,_0x289d7b){return function(_0x22a893){_0x289d7b[_0x343f('0x3')](_0x104945,_0x22a893);};}function removeListener(_0x26f0c8,_0x54b7cb){return function(){MailInteractionEvents[_0x343f('0x4')](_0x26f0c8,_0x54b7cb);};}exports[_0x343f('0x5')]=function(_0x4a74a7){for(var _0x5d34bd=0x0,_0x179f25=events['length'];_0x5d34bd<_0x179f25;_0x5d34bd++){var _0x38510c=events[_0x5d34bd];var _0x2c5d1b=createListener(_0x343f('0x6')+_0x38510c,_0x4a74a7);MailInteractionEvents['on'](_0x38510c,_0x2c5d1b);}}; \ No newline at end of file diff --git a/server/api/mailMessage/index.js b/server/api/mailMessage/index.js index 7f344d2..c7cea30 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 _0xa769=['update','/:id/accept','accept','/:id/reject','reject','delete','/:id','exports','multer','path','connect-timeout','express','fs-extra','../../config/environment','./mailMessage.controller','isAuthenticated','index','get','/describe','describe','show','/:id/download','post','tracked','mail','create','put'];(function(_0x209941,_0x5c9988){var _0x1e8729=function(_0x51a9b8){while(--_0x51a9b8){_0x209941['push'](_0x209941['shift']());}};_0x1e8729(++_0x5c9988);}(_0xa769,0xfb));var _0x9a76=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xa769[_0x3947c9];return _0x2e7871;};'use strict';var multer=require(_0x9a76('0x0'));var util=require('util');var path=require(_0x9a76('0x1'));var timeout=require(_0x9a76('0x2'));var express=require(_0x9a76('0x3'));var router=express['Router']();var fs_extra=require(_0x9a76('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x9a76('0x5'));var controller=require(_0x9a76('0x6'));router['get']('/',auth[_0x9a76('0x7')](),controller[_0x9a76('0x8')]);router[_0x9a76('0x9')](_0x9a76('0xa'),auth[_0x9a76('0x7')](),controller[_0x9a76('0xb')]);router[_0x9a76('0x9')]('/:id',auth[_0x9a76('0x7')](),controller[_0x9a76('0xc')]);router[_0x9a76('0x9')](_0x9a76('0xd'),auth['isAuthenticated'](),controller['download']);router[_0x9a76('0xe')]('/',auth['isAuthenticated'](),interaction[_0x9a76('0xf')](_0x9a76('0x10'),'mailmessage:create'),controller[_0x9a76('0x11')]);router[_0x9a76('0x12')]('/:id',auth[_0x9a76('0x7')](),controller[_0x9a76('0x13')]);router[_0x9a76('0x12')](_0x9a76('0x14'),auth[_0x9a76('0x7')](),controller[_0x9a76('0x15')]);router[_0x9a76('0x12')](_0x9a76('0x16'),auth[_0x9a76('0x7')](),controller[_0x9a76('0x17')]);router[_0x9a76('0x18')](_0x9a76('0x19'),auth[_0x9a76('0x7')](),controller['destroy']);module[_0x9a76('0x1a')]=router; \ No newline at end of file +var _0x1f31=['tracked','mail','create','put','update','/:id/accept','accept','/:id/reject','reject','destroy','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailMessage.controller','isAuthenticated','index','get','/describe','describe','/:id','show','/:id/download','download'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x1f31,0xca));var _0x11f3=function(_0x2f1762,_0xab43df){_0x2f1762=_0x2f1762-0x0;var _0x8ab21=_0x1f31[_0x2f1762];return _0x8ab21;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x11f3('0x0'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x11f3('0x1'));var interaction=require(_0x11f3('0x2'));var config=require(_0x11f3('0x3'));var controller=require(_0x11f3('0x4'));router['get']('/',auth[_0x11f3('0x5')](),controller[_0x11f3('0x6')]);router[_0x11f3('0x7')](_0x11f3('0x8'),auth[_0x11f3('0x5')](),controller[_0x11f3('0x9')]);router[_0x11f3('0x7')](_0x11f3('0xa'),auth[_0x11f3('0x5')](),controller[_0x11f3('0xb')]);router[_0x11f3('0x7')](_0x11f3('0xc'),auth[_0x11f3('0x5')](),controller[_0x11f3('0xd')]);router['post']('/',auth[_0x11f3('0x5')](),interaction[_0x11f3('0xe')](_0x11f3('0xf'),'mailmessage:create'),controller[_0x11f3('0x10')]);router[_0x11f3('0x11')](_0x11f3('0xa'),auth['isAuthenticated'](),controller[_0x11f3('0x12')]);router[_0x11f3('0x11')](_0x11f3('0x13'),auth[_0x11f3('0x5')](),controller[_0x11f3('0x14')]);router[_0x11f3('0x11')](_0x11f3('0x15'),auth[_0x11f3('0x5')](),controller[_0x11f3('0x16')]);router['delete'](_0x11f3('0xa'),auth['isAuthenticated'](),controller[_0x11f3('0x17')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.attributes.js b/server/api/mailMessage/mailMessage.attributes.js index fe5ed14..1d91830 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 _0x4274=['out','STRING','DATE','INTEGER','Email','sequelize','exports','TEXT','long','BOOLEAN','ENUM'];(function(_0x49c8de,_0x101513){var _0x410cf9=function(_0x1cfd5b){while(--_0x1cfd5b){_0x49c8de['push'](_0x49c8de['shift']());}};_0x410cf9(++_0x101513);}(_0x4274,0x1f4));var _0x4427=function(_0x3e6980,_0x190736){_0x3e6980=_0x3e6980-0x0;var _0x5697dc=_0x4274[_0x3e6980];return _0x5697dc;};'use strict';var Sequelize=require(_0x4427('0x0'));var _=require('lodash');module[_0x4427('0x1')]={'body':{'type':Sequelize[_0x4427('0x2')](_0x4427('0x3')),'allowNull':![]},'plainBody':{'type':Sequelize['TEXT']('medium')},'read':{'type':Sequelize[_0x4427('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0x4427('0x5')]('in',_0x4427('0x6')),'defaultValue':_0x4427('0x6'),'allowNull':![]},'messageId':{'type':Sequelize[_0x4427('0x7')](0x1fe)},'from':{'type':Sequelize[_0x4427('0x7')]},'to':{'type':Sequelize[_0x4427('0x2')](_0x4427('0x3'))},'cc':{'type':Sequelize[_0x4427('0x2')]('long')},'bcc':{'type':Sequelize[_0x4427('0x2')]('long')},'subject':{'type':Sequelize[_0x4427('0x2')]},'sentAt':{'type':Sequelize[_0x4427('0x8')]},'attach':{'type':Sequelize[_0x4427('0x9')],'defaultValue':0x0},'secret':{'type':Sequelize[_0x4427('0x4')],'defaultValue':![]},'readAt':{'type':Sequelize['DATE']},'originTo':{'type':Sequelize[_0x4427('0x2')](_0x4427('0x3'))},'originCc':{'type':Sequelize[_0x4427('0x2')](_0x4427('0x3'))},'originChannel':{'type':Sequelize[_0x4427('0x5')](_0x4427('0xa'),'Chat'),'defaultValue':_0x4427('0xa'),'allowNull':![]}}; \ No newline at end of file +var _0xd049=['DATE','ENUM','Email','Chat','sequelize','exports','long','TEXT','medium','BOOLEAN','out','STRING','INTEGER'];(function(_0x188c9d,_0x1fb7b2){var _0x31e3c1=function(_0x247664){while(--_0x247664){_0x188c9d['push'](_0x188c9d['shift']());}};_0x31e3c1(++_0x1fb7b2);}(_0xd049,0x108));var _0x9d04=function(_0x413feb,_0x10477f){_0x413feb=_0x413feb-0x0;var _0x40ee88=_0xd049[_0x413feb];return _0x40ee88;};'use strict';var Sequelize=require(_0x9d04('0x0'));var _=require('lodash');module[_0x9d04('0x1')]={'body':{'type':Sequelize['TEXT'](_0x9d04('0x2')),'allowNull':![]},'plainBody':{'type':Sequelize[_0x9d04('0x3')](_0x9d04('0x4'))},'read':{'type':Sequelize[_0x9d04('0x5')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0x9d04('0x6')),'defaultValue':'out','allowNull':![]},'messageId':{'type':Sequelize[_0x9d04('0x7')](0x1fe)},'from':{'type':Sequelize['STRING']},'to':{'type':Sequelize['TEXT'](_0x9d04('0x2'))},'cc':{'type':Sequelize[_0x9d04('0x3')](_0x9d04('0x2'))},'bcc':{'type':Sequelize[_0x9d04('0x3')](_0x9d04('0x2'))},'subject':{'type':Sequelize[_0x9d04('0x3')]},'sentAt':{'type':Sequelize['DATE']},'attach':{'type':Sequelize[_0x9d04('0x8')],'defaultValue':0x0},'secret':{'type':Sequelize[_0x9d04('0x5')],'defaultValue':![]},'readAt':{'type':Sequelize[_0x9d04('0x9')]},'originTo':{'type':Sequelize[_0x9d04('0x3')]('long')},'originCc':{'type':Sequelize['TEXT'](_0x9d04('0x2'))},'originChannel':{'type':Sequelize[_0x9d04('0xa')](_0x9d04('0xb'),_0x9d04('0xc')),'defaultValue':_0x9d04('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 f94ffa6..4fe1b7a 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 _0x053c=['./mailMessage.socket','jayson/promise','client','http','request','then','MailMessage,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','result','catch','status','json','offset','undefined','count','limit','set','destroy','end','stack','name','send','index','map','MailMessage','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','find','update','body','describe','create','direction','out','split','MailAccount','findOne','MailAccountId','CmList','List','CmContact','Contacts','updatedAt','DESC','MailServerOut','Smtp','isNil','host','port','secure','authentication','auth','user','service','pass','attachments','join','root','server/files/attachments','basename','ListId','List\x20not\x20found','SendMail','sendMail','messageId','format','stringify','accept','mail','read','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','agent','get','MailInteraction','MailInteractionId','read1stAt','interaction','[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','AcceptMessage','acceptMessage','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','User','fullname','email','internal','manual','interface','channel','EventManager','acceptmessage','reject','[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','RejectMessage','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','SIP/%s','motionChannel','event','fromString','rejectmessage','unix','toString','server','tmp','files','message-%s.eml','from','bcc','subject','Attachment','Attachments','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Bcc','existsSync','push','readFileSync','build','download','unlinkSync','eml-format','bluebird','util','path','lodash','html-to-text','api','../../config/logger','mail-interactions','../../mysqldb','redis','defaults','localhost'];(function(_0x5ee478,_0x4d671d){var _0x405126=function(_0x2fbe75){while(--_0x2fbe75){_0x5ee478['push'](_0x5ee478['shift']());}};_0x405126(++_0x4d671d);}(_0x053c,0x147));var _0xc053=function(_0x3e5086,_0x48f4a2){_0x3e5086=_0x3e5086-0x0;var _0xfeb102=_0x053c[_0x3e5086];return _0xfeb102;};'use strict';var emlformat=require(_0xc053('0x0'));var moment=require('moment');var BPromise=require(_0xc053('0x1'));var util=require(_0xc053('0x2'));var path=require(_0xc053('0x3'));var fs=require('fs');var _=require(_0xc053('0x4'));var Redis=require('ioredis');var htmlToText=require(_0xc053('0x5'));var qs=require('../../components/parsers/qs');var logger=require('../../config/logger')(_0xc053('0x6'));var interaction_log=require(_0xc053('0x7'))(_0xc053('0x8'));var config=require('../../config/environment');var db=require(_0xc053('0x9'))['db'];config[_0xc053('0xa')]=_[_0xc053('0xb')](config[_0xc053('0xa')],{'host':_0xc053('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xc053('0xd'))['register'](socket);var jayson=require(_0xc053('0xe'));var client=jayson[_0xc053('0xf')][_0xc053('0x10')]({'port':0x232c});var client9003=jayson[_0xc053('0xf')]['http']({'port':0x232b});var client9002=jayson[_0xc053('0xf')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2738bc,_0x1e1563,_0x2f75a6,_0xaac3ea){return new BPromise(function(_0x3e23a6,_0x1709df){var _0x139321=_0xaac3ea||client;return _0x139321[_0xc053('0x11')](_0x2738bc,_0x2f75a6)[_0xc053('0x12')](function(_0x214ff5){logger['info'](_0xc053('0x13'),_0x1e1563,_0xc053('0x14'));logger[_0xc053('0x15')]('MailMessage,\x20%s,\x20%s,\x20%s',_0x1e1563,_0xc053('0x14'),JSON['stringify'](_0x214ff5));if(_0x214ff5[_0xc053('0x16')]){if(_0x214ff5[_0xc053('0x16')][_0xc053('0x17')]===0x1f4){logger[_0xc053('0x16')]('MailMessage,\x20%s,\x20%s',_0x1e1563,_0x214ff5[_0xc053('0x16')][_0xc053('0x18')]);return _0x1709df(_0x214ff5[_0xc053('0x16')]['message']);}logger[_0xc053('0x16')](_0xc053('0x13'),_0x1e1563,_0x214ff5['error'][_0xc053('0x18')]);return _0x3e23a6(_0x214ff5[_0xc053('0x16')][_0xc053('0x18')]);}else{logger[_0xc053('0x19')](_0xc053('0x13'),_0x1e1563,_0xc053('0x14'));_0x3e23a6(_0x214ff5[_0xc053('0x1a')][_0xc053('0x18')]);}})[_0xc053('0x1b')](function(_0x24ea60){logger[_0xc053('0x16')]('MailMessage,\x20%s,\x20%s',_0x1e1563,_0x24ea60);_0x1709df(_0x24ea60);});});}function respondWithResult(_0x1f4fbb,_0x11ebee){_0x11ebee=_0x11ebee||0xc8;return function(_0x5b783a){if(_0x5b783a){return _0x1f4fbb[_0xc053('0x1c')](_0x11ebee)[_0xc053('0x1d')](_0x5b783a);}};}function respondWithFilteredResult(_0x38e6e4,_0x522d49){return function(_0x716863){if(_0x716863){var _0x10b718=typeof _0x522d49[_0xc053('0x1e')]==='undefined'&&typeof _0x522d49['limit']===_0xc053('0x1f');var _0x14ca9e=_0x716863[_0xc053('0x20')];var _0x36b715=_0x10b718?0x0:_0x522d49[_0xc053('0x1e')];var _0x4995c1=_0x10b718?_0x716863[_0xc053('0x20')]:_0x522d49[_0xc053('0x1e')]+_0x522d49[_0xc053('0x21')];var _0x5b2232;if(_0x4995c1>=_0x14ca9e){_0x4995c1=_0x14ca9e;_0x5b2232=0xc8;}else{_0x5b2232=0xce;}_0x38e6e4['status'](_0x5b2232);return _0x38e6e4[_0xc053('0x22')]('Content-Range',_0x36b715+'-'+_0x4995c1+'/'+_0x14ca9e)[_0xc053('0x1d')](_0x716863);}return null;};}function saveUpdates(_0xb7b17a){return function(_0x4b2965){if(_0x4b2965){return _0x4b2965['update'](_0xb7b17a)['then'](function(_0x57d6a4){return _0x57d6a4;});}return null;};}function removeEntity(_0x398571){return function(_0x2b2661){if(_0x2b2661){return _0x2b2661[_0xc053('0x23')]()[_0xc053('0x12')](function(){_0x398571['status'](0xcc)[_0xc053('0x24')]();});}};}function handleEntityNotFound(_0x57e029){return function(_0x538928){if(!_0x538928){_0x57e029['sendStatus'](0x194);}return _0x538928;};}function handleError(_0x4af572,_0x3d6ac2){_0x3d6ac2=_0x3d6ac2||0x1f4;return function(_0x4fecc7){logger['error'](_0x4fecc7[_0xc053('0x25')]);if(_0x4fecc7['name']){delete _0x4fecc7[_0xc053('0x26')];}_0x4af572[_0xc053('0x1c')](_0x3d6ac2)[_0xc053('0x27')](_0x4fecc7);};}exports[_0xc053('0x28')]=function(_0x1b690d,_0x2379c4){var _0x5e0b05={},_0x1d418d={},_0x31abbd={'count':0x0,'rows':[]};var _0x4b420a=_[_0xc053('0x29')](db[_0xc053('0x2a')][_0xc053('0x2b')],function(_0x56dc48){return{'name':_0x56dc48[_0xc053('0x2c')],'type':_0x56dc48[_0xc053('0x2d')]['key']};});_0x1d418d[_0xc053('0x2e')]=_[_0xc053('0x29')](_0x4b420a,_0xc053('0x26'));_0x1d418d[_0xc053('0x2f')]=_[_0xc053('0x30')](_0x1b690d[_0xc053('0x2f')]);_0x1d418d[_0xc053('0x31')]=_[_0xc053('0x32')](_0x1d418d[_0xc053('0x2e')],_0x1d418d[_0xc053('0x2f')]);_0x5e0b05[_0xc053('0x33')]=_['intersection'](_0x1d418d[_0xc053('0x2e')],qs[_0xc053('0x34')](_0x1b690d[_0xc053('0x2f')][_0xc053('0x34')]));_0x5e0b05[_0xc053('0x33')]=_0x5e0b05['attributes'][_0xc053('0x35')]?_0x5e0b05[_0xc053('0x33')]:_0x1d418d[_0xc053('0x2e')];if(!_0x1b690d[_0xc053('0x2f')][_0xc053('0x36')]('nolimit')){_0x5e0b05[_0xc053('0x21')]=qs[_0xc053('0x21')](_0x1b690d[_0xc053('0x2f')][_0xc053('0x21')]);_0x5e0b05['offset']=qs[_0xc053('0x1e')](_0x1b690d[_0xc053('0x2f')][_0xc053('0x1e')]);}_0x5e0b05['order']=qs[_0xc053('0x37')](_0x1b690d[_0xc053('0x2f')]['sort']);_0x5e0b05[_0xc053('0x38')]=qs[_0xc053('0x31')](_[_0xc053('0x39')](_0x1b690d[_0xc053('0x2f')],_0x1d418d[_0xc053('0x31')]),_0x4b420a);if(_0x1b690d[_0xc053('0x2f')][_0xc053('0x3a')]){_0x5e0b05['where']=_[_0xc053('0x3b')](_0x5e0b05[_0xc053('0x38')],{'$or':_['map'](_0x4b420a,function(_0x530dd5){if(_0x530dd5[_0xc053('0x2d')]!==_0xc053('0x3c')){var _0x250882={};_0x250882[_0x530dd5[_0xc053('0x26')]]={'$like':'%'+_0x1b690d[_0xc053('0x2f')][_0xc053('0x3a')]+'%'};return _0x250882;}})});}_0x5e0b05=_[_0xc053('0x3b')]({},_0x5e0b05,_0x1b690d[_0xc053('0x3d')]);var _0x12789a={'where':_0x5e0b05['where']};return db[_0xc053('0x2a')][_0xc053('0x20')](_0x12789a)['then'](function(_0x57dcee){_0x31abbd[_0xc053('0x20')]=_0x57dcee;if(_0x1b690d['query'][_0xc053('0x3e')]){_0x5e0b05[_0xc053('0x3f')]=[{'all':!![]}];}return db[_0xc053('0x2a')][_0xc053('0x40')](_0x5e0b05);})['then'](function(_0x21aa32){_0x31abbd[_0xc053('0x41')]=_0x21aa32;return _0x31abbd;})[_0xc053('0x12')](respondWithFilteredResult(_0x2379c4,_0x5e0b05))[_0xc053('0x1b')](handleError(_0x2379c4,null));};exports[_0xc053('0x42')]=function(_0x43fab2,_0x172a97){var _0x136d92={'raw':!![],'where':{'id':_0x43fab2[_0xc053('0x43')]['id']}},_0x38bb74={};_0x38bb74[_0xc053('0x2e')]=_[_0xc053('0x30')](db[_0xc053('0x2a')][_0xc053('0x2b')]);_0x38bb74[_0xc053('0x2f')]=_['keys'](_0x43fab2[_0xc053('0x2f')]);_0x38bb74[_0xc053('0x31')]=_[_0xc053('0x32')](_0x38bb74[_0xc053('0x2e')],_0x38bb74['query']);_0x136d92[_0xc053('0x33')]=_[_0xc053('0x32')](_0x38bb74['model'],qs[_0xc053('0x34')](_0x43fab2[_0xc053('0x2f')]['fields']));_0x136d92['attributes']=_0x136d92[_0xc053('0x33')]['length']?_0x136d92[_0xc053('0x33')]:_0x38bb74['model'];if(_0x43fab2[_0xc053('0x2f')][_0xc053('0x3e')]){_0x136d92[_0xc053('0x3f')]=[{'all':!![]}];}_0x136d92=_[_0xc053('0x3b')]({},_0x136d92,_0x43fab2['options']);return db[_0xc053('0x2a')][_0xc053('0x44')](_0x136d92)[_0xc053('0x12')](handleEntityNotFound(_0x172a97,null))['then'](respondWithResult(_0x172a97,null))[_0xc053('0x1b')](handleError(_0x172a97,null));};exports[_0xc053('0x45')]=function(_0x85eded,_0x4d358c){if(_0x85eded[_0xc053('0x46')]['id']){delete _0x85eded[_0xc053('0x46')]['id'];}return db[_0xc053('0x2a')][_0xc053('0x44')]({'where':{'id':_0x85eded[_0xc053('0x43')]['id']}})[_0xc053('0x12')](handleEntityNotFound(_0x4d358c,null))[_0xc053('0x12')](saveUpdates(_0x85eded[_0xc053('0x46')],null))[_0xc053('0x12')](respondWithResult(_0x4d358c,null))[_0xc053('0x1b')](handleError(_0x4d358c,null));};exports['destroy']=function(_0x129264,_0x46424b){return db['MailMessage'][_0xc053('0x44')]({'where':{'id':_0x129264[_0xc053('0x43')]['id']}})['then'](handleEntityNotFound(_0x46424b,null))[_0xc053('0x12')](removeEntity(_0x46424b,null))['catch'](handleError(_0x46424b,null));};exports[_0xc053('0x47')]=function(_0x58035c,_0x471a8d){return db[_0xc053('0x2a')][_0xc053('0x47')]()[_0xc053('0x12')](respondWithResult(_0x471a8d,null))['catch'](handleError(_0x471a8d,null));};exports[_0xc053('0x48')]=function(_0x5e88fa,_0x3ad91f){return db[_0xc053('0x2a')][_0xc053('0x48')](_0x5e88fa['body'])[_0xc053('0x12')](function(_0x512508){if(_0x512508){if(_0x512508[_0xc053('0x49')]===_0xc053('0x4a')&&!_0x512508['secret']){var _0x492bfd,_0x4be9dc,_0x24a547;if(_0x5e88fa[_0xc053('0x46')]['to']){_0x4be9dc=_0x5e88fa[_0xc053('0x46')]['to'][_0xc053('0x4b')](',')[0x0];}return db[_0xc053('0x4c')][_0xc053('0x4d')]({'where':{'id':_0x512508[_0xc053('0x4e')]},'include':[{'model':db[_0xc053('0x4f')],'as':_0xc053('0x50'),'include':[{'model':db[_0xc053('0x51')],'as':_0xc053('0x52'),'where':{'email':_0x4be9dc},'limit':0x1,'order':[[_0xc053('0x53'),_0xc053('0x54')]]}]},{'model':db[_0xc053('0x55')],'as':_0xc053('0x56'),'raw':!![]}]})[_0xc053('0x12')](function(_0x1893ff){_0x492bfd=_0x1893ff;if(_0x492bfd&&_0x492bfd[_0xc053('0x56')]){var _0x4b395b={'tls':{'rejectUnauthorized':![]}};if(_[_0xc053('0x57')](_0x492bfd[_0xc053('0x56')]['service'])){_0x4b395b[_0xc053('0x58')]=_0x492bfd[_0xc053('0x56')][_0xc053('0x58')];_0x4b395b[_0xc053('0x59')]=_0x492bfd[_0xc053('0x56')]['port'];_0x4b395b[_0xc053('0x5a')]=_0x492bfd[_0xc053('0x56')][_0xc053('0x5a')];if(_0x492bfd[_0xc053('0x56')][_0xc053('0x5b')]){_0x4b395b[_0xc053('0x5c')]={'user':_0x492bfd['Smtp'][_0xc053('0x5d')],'pass':_0x492bfd[_0xc053('0x56')]['pass']};}}else{_0x4b395b[_0xc053('0x5e')]=_0x492bfd['Smtp'][_0xc053('0x5e')];_0x4b395b[_0xc053('0x5c')]={'user':_0x492bfd['Smtp'][_0xc053('0x5d')],'pass':_0x492bfd[_0xc053('0x56')][_0xc053('0x5f')]};_0x4b395b[_0xc053('0x5a')]=_0x492bfd['Smtp']['secure'];}if(_0x5e88fa[_0xc053('0x46')][_0xc053('0x60')]&&_0x5e88fa['body'][_0xc053('0x60')][_0xc053('0x35')]){for(var _0x1d0c1b=0x0;_0x1d0c1b<_0x5e88fa[_0xc053('0x46')][_0xc053('0x60')][_0xc053('0x35')];_0x1d0c1b+=0x1){_0x5e88fa[_0xc053('0x46')][_0xc053('0x60')][_0x1d0c1b]={'filename':_0x5e88fa[_0xc053('0x46')]['attachments'][_0x1d0c1b][_0xc053('0x26')],'path':path[_0xc053('0x61')](config[_0xc053('0x62')],_0xc053('0x63'),_0x5e88fa['body'][_0xc053('0x60')][_0x1d0c1b][_0xc053('0x64')])};}}_0x24a547={'account':_0x4b395b,'message':_0x5e88fa[_0xc053('0x46')]};return;}})[_0xc053('0x12')](function(){if(_0x492bfd[_0xc053('0x50')]){if(_0x492bfd[_0xc053('0x50')][_0xc053('0x52')][_0xc053('0x35')]){return _0x492bfd[_0xc053('0x50')]['Contacts'][0x0];}else{return db[_0xc053('0x51')]['create'](_['defaults'](_0x5e88fa[_0xc053('0x46')],{'firstName':_0x5e88fa['body']['to'],'email':_0x5e88fa[_0xc053('0x46')]['to'],'phone':_0x5e88fa['body']['to'],'ListId':_0x492bfd[_0xc053('0x65')]}));}}else{throw new Error(_0xc053('0x66'));}})['then'](function(){if(_0x24a547){return respondWithRpcPromise(_0xc053('0x67'),_0xc053('0x68'),_0x24a547,client9003)['then'](function(_0x401f77){return _0x512508[_0xc053('0x45')]({'read':!![],'messageId':_0x401f77[_0xc053('0x69')],'sentAt':moment()[_0xc053('0x6a')]('YYYY-MM-DD\x20HH:mm:ss')});})['catch'](function(_0x2f6670){logger[_0xc053('0x16')]('%s',JSON[_0xc053('0x6b')](_0x2f6670));return _0x512508;});}return _0x512508;});}return _0x512508;}})[_0xc053('0x12')](respondWithResult(_0x3ad91f,0xc9))[_0xc053('0x1b')](handleError(_0x3ad91f,null));};exports[_0xc053('0x6c')]=function(_0x3aaebc,_0x3bcbff){var _0x45bc1c={'agent':{},'channel':_0xc053('0x6d')};if(_0x3aaebc[_0xc053('0x46')]['id']){delete _0x3aaebc[_0xc053('0x46')]['id'];}_0x3aaebc[_0xc053('0x46')][_0xc053('0x6e')]=!![];_0x3aaebc[_0xc053('0x46')][_0xc053('0x6f')]=moment()[_0xc053('0x6a')](_0xc053('0x70'));_0x3aaebc[_0xc053('0x46')][_0xc053('0x71')]=_0x3aaebc[_0xc053('0x46')][_0xc053('0x71')]||_0x3aaebc[_0xc053('0x5d')]['id'];_0x45bc1c[_0xc053('0x72')]['id']=_0x3aaebc[_0xc053('0x46')][_0xc053('0x71')];return db[_0xc053('0x2a')][_0xc053('0x44')]({'where':{'id':_0x3aaebc[_0xc053('0x43')]['id'],'UserId':null}})[_0xc053('0x12')](handleEntityNotFound(_0x3bcbff,null))[_0xc053('0x12')](saveUpdates(_0x3aaebc[_0xc053('0x46')],null))[_0xc053('0x12')](function(_0x335905){if(_0x335905){_0x45bc1c['message']=_0x335905[_0xc053('0x73')]({'plain':!![]});return db[_0xc053('0x74')][_0xc053('0x44')]({'where':{'id':_0x335905[_0xc053('0x75')]}});}return null;})[_0xc053('0x12')](handleEntityNotFound(_0x3bcbff,null))[_0xc053('0x12')](function(_0x1be4ac){if(_0x1be4ac){return _0x1be4ac[_0xc053('0x45')]({'UserId':_0x3aaebc[_0xc053('0x46')]['UserId'],'read1stAt':_['isNil'](_0x1be4ac[_0xc053('0x76')])?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0xc053('0x12')](function(_0x3b4f9b){if(_0x3b4f9b){_0x45bc1c[_0xc053('0x77')]=_0x3b4f9b['get']({'plain':!![]});interaction_log['info'](_0xc053('0x78'),_0x3aaebc[_0xc053('0x5d')]['id'],_0x3aaebc[_0xc053('0x5d')][_0xc053('0x26')],_0x3aaebc[_0xc053('0x5d')][_0xc053('0x79')],_0x45bc1c['interaction']['id'],_0x3aaebc['body']?JSON[_0xc053('0x6b')](_0x3aaebc[_0xc053('0x46')]):'null');return respondWithRpcPromise(_0xc053('0x7a'),_0xc053('0x7b'),_0x45bc1c);}return null;})[_0xc053('0x12')](function(_0x5597ee){var _0x5d3f17='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x5597ee[_0xc053('0x18')][_0xc053('0x7c')];return db[_0xc053('0x7d')]['query'](_0x5d3f17,{'type':db[_0xc053('0x7e')][_0xc053('0x7f')][_0xc053('0x80')],'raw':!![]})[_0xc053('0x12')](function(_0x3b7af6){return _0x3b7af6;});})['then'](function(_0x2468ed){if(_0x2468ed){_0x45bc1c[_0xc053('0x18')][_0xc053('0x81')]=_0x2468ed[0x0];if(!_0x3aaebc[_0xc053('0x46')]['UserId'])return;return db[_0xc053('0x82')]['find']({'where':{'id':_0x3aaebc['body'][_0xc053('0x71')],'role':_0xc053('0x72')},'attributes':['id',_0xc053('0x26'),_0xc053('0x83'),_0xc053('0x84'),_0xc053('0x85')],'raw':!![]});}return null;})[_0xc053('0x12')](function(_0x3a3180){if(!_0x3a3180)return null;_0x45bc1c[_0xc053('0x18')][_0xc053('0x72')]=_0x3a3180;return _0x45bc1c;})[_0xc053('0x12')](function(_0x25c687){if(_0x25c687){if(_0x3aaebc['body'][_0xc053('0x86')]){_0x45bc1c[_0xc053('0x18')][_0xc053('0x87')]=util[_0xc053('0x6a')]('SIP/%s',_0x3aaebc[_0xc053('0x5d')][_0xc053('0x26')]);_0x45bc1c['message'][_0xc053('0x88')]=_0x45bc1c[_0xc053('0x88')];_0x45bc1c[_0xc053('0x18')]['motionChannel']=_0x45bc1c[_0xc053('0x88')];_0x45bc1c[_0xc053('0x18')]['event']=_0xc053('0x6c');_0x45bc1c[_0xc053('0x18')][_0xc053('0x46')]=htmlToText['fromString'](_0x45bc1c[_0xc053('0x18')][_0xc053('0x46')]);return respondWithRpcPromise(_0xc053('0x89'),'EventManager',{'event':_0xc053('0x8a'),'message':_0x45bc1c[_0xc053('0x18')]},client9002)['then'](function(){return _0x45bc1c;});}return _0x45bc1c;}return null;})[_0xc053('0x12')](respondWithResult(_0x3bcbff,null))[_0xc053('0x1b')](handleError(_0x3bcbff,null));};exports[_0xc053('0x8b')]=function(_0x2ceac2,_0x36f31f){var _0xec8a29={'agent':{},'channel':_0xc053('0x6d')};if(_0x2ceac2[_0xc053('0x46')]['id']){delete _0x2ceac2['body']['id'];}_0x2ceac2['body'][_0xc053('0x71')]=_0x2ceac2['body'][_0xc053('0x71')]||_0x2ceac2[_0xc053('0x5d')]['id'];_0xec8a29['agent']['id']=_0x2ceac2[_0xc053('0x46')][_0xc053('0x71')];return db[_0xc053('0x2a')][_0xc053('0x44')]({'where':{'id':_0x2ceac2[_0xc053('0x43')]['id'],'UserId':null}})[_0xc053('0x12')](handleEntityNotFound(_0x36f31f,null))[_0xc053('0x12')](function(_0x16d96c){if(_0x16d96c){_0xec8a29[_0xc053('0x18')]=_0x16d96c[_0xc053('0x73')]({'plain':!![]});return db[_0xc053('0x74')][_0xc053('0x44')]({'where':{'id':_0x16d96c[_0xc053('0x75')]}});}return null;})[_0xc053('0x12')](handleEntityNotFound(_0x36f31f,null))[_0xc053('0x12')](function(_0x35317a){if(_0x35317a){_0xec8a29['interaction']=_0x35317a[_0xc053('0x73')]({'plain':!![]});interaction_log[_0xc053('0x19')](_0xc053('0x8c'),_0x2ceac2[_0xc053('0x5d')]['id'],_0x2ceac2[_0xc053('0x5d')][_0xc053('0x26')],_0x2ceac2[_0xc053('0x5d')][_0xc053('0x79')],_0xec8a29[_0xc053('0x77')]['id'],_0x2ceac2['body']?JSON[_0xc053('0x6b')](_0x2ceac2['body']):_0xc053('0x8d'));return respondWithRpcPromise(_0xc053('0x8e'),_0xc053('0x8f'),_0xec8a29);}return null;})['then'](function(_0x31162f){var _0x218e28=_0xc053('0x90')+_0x31162f[_0xc053('0x18')][_0xc053('0x7c')];return db[_0xc053('0x7d')]['query'](_0x218e28,{'type':db[_0xc053('0x7e')][_0xc053('0x7f')]['SELECT'],'raw':!![]})[_0xc053('0x12')](function(_0x29f1d5){return _0x29f1d5;});})[_0xc053('0x12')](function(_0x51b2ca){if(_0x51b2ca){_0xec8a29[_0xc053('0x18')][_0xc053('0x81')]=_0x51b2ca[0x0];if(!_0x2ceac2[_0xc053('0x46')][_0xc053('0x71')])return;return db['User'][_0xc053('0x44')]({'where':{'id':_0x2ceac2[_0xc053('0x46')][_0xc053('0x71')],'role':_0xc053('0x72')},'attributes':['id',_0xc053('0x26'),_0xc053('0x83'),'email',_0xc053('0x85')],'raw':!![]});}return null;})['then'](function(_0x4a8888){if(!_0x4a8888)return null;_0xec8a29[_0xc053('0x18')]['agent']=_0x4a8888;return _0xec8a29;})[_0xc053('0x12')](function(_0x3a34b1){if(_0x3a34b1){_0x3a34b1[_0xc053('0x18')][_0xc053('0x87')]=util[_0xc053('0x6a')](_0xc053('0x91'),_0x2ceac2[_0xc053('0x5d')][_0xc053('0x26')]);_0x3a34b1['message'][_0xc053('0x88')]=_0xec8a29[_0xc053('0x88')];_0x3a34b1[_0xc053('0x18')][_0xc053('0x92')]=_0xec8a29[_0xc053('0x88')];_0x3a34b1[_0xc053('0x18')][_0xc053('0x93')]=_0xc053('0x8b');_0x3a34b1['message']['body']=htmlToText[_0xc053('0x94')](_0xec8a29[_0xc053('0x18')]['body']);respondWithRpcPromise(_0xc053('0x89'),'EventManager',{'event':_0xc053('0x95'),'message':_0x3a34b1[_0xc053('0x18')]},client9002);return _0xec8a29;}return null;})[_0xc053('0x12')](respondWithResult(_0x36f31f,null))['catch'](handleError(_0x36f31f,null));};exports['download']=function(_0x4c14db,_0x52787a){var _0x46c1df=moment()[_0xc053('0x96')]()[_0xc053('0x97')]();var _0x420221=path[_0xc053('0x61')](config[_0xc053('0x62')],_0xc053('0x98'),'files',_0xc053('0x99'));var _0x29cc0a=path['join'](config[_0xc053('0x62')],_0xc053('0x98'),_0xc053('0x9a'),_0xc053('0x60'));var _0x4111c5=util[_0xc053('0x6a')](_0xc053('0x9b'),_0x46c1df);return db[_0xc053('0x2a')][_0xc053('0x44')]({'where':{'id':_0x4c14db[_0xc053('0x43')]['id']},'attributes':['id','body',_0xc053('0x9c'),'to','cc',_0xc053('0x9d'),_0xc053('0x9e'),'createdAt'],'include':_0x4c14db['query'][_0xc053('0x60')]?[{'model':db[_0xc053('0x9f')],'as':_0xc053('0xa0')}]:undefined})[_0xc053('0x12')](handleEntityNotFound(_0x52787a,null))[_0xc053('0x12')](function(_0x514d03){if(_0x514d03){var _0x66f366=_0x514d03;var _0x35bc53={'from':_0x66f366[_0xc053('0x9c')],'to':_0x66f366['to'],'subject':_0x66f366['subject'],'html':_0x66f366[_0xc053('0x46')],'headers':{'Date':moment(_0x66f366['createdAt'])[_0xc053('0x6a')](_0xc053('0xa1'))},'attachments':[]};if(_0x514d03['cc']){_0x35bc53[_0xc053('0xa2')]['Cc']=_0x514d03['cc'];}if(_0x514d03['bcc']){_0x35bc53[_0xc053('0xa2')][_0xc053('0xa3')]=_0x514d03['bcc'];}return new BPromise(function(_0x5002ba,_0x5d5a40){if(_0x514d03[_0xc053('0xa0')]){for(var _0x575470=0x0;_0x575470<_0x514d03[_0xc053('0xa0')][_0xc053('0x35')];_0x575470++){var _0x1d28e6=_0x514d03['Attachments'][_0x575470];var _0x4c01c0=path[_0xc053('0x61')](_0x29cc0a,_0x1d28e6[_0xc053('0x64')]);if(fs[_0xc053('0xa4')](_0x4c01c0)){_0x35bc53['attachments'][_0xc053('0xa5')]({'name':_0x1d28e6['name'],'contentType':_0x1d28e6[_0xc053('0x2d')],'data':fs[_0xc053('0xa6')](_0x4c01c0)});}}}emlformat[_0xc053('0xa7')](_0x35bc53,function(_0x68b0d5,_0x1e0e4c){if(_0x68b0d5)return _0x5d5a40(_0x68b0d5);fs['writeFileSync'](path[_0xc053('0x61')](_0x420221,_0x4111c5),_0x1e0e4c);return _0x5002ba(_0x1e0e4c);});});}})[_0xc053('0x12')](function(_0x564fd5){if(_0x564fd5){return _0x52787a[_0xc053('0xa8')](path[_0xc053('0x61')](_0x420221,_0x4111c5),_0x4111c5,function(_0x385c3e){if(!_0x385c3e)fs[_0xc053('0xa9')](path['join'](_0x420221,_0x4111c5));});}})[_0xc053('0x1b')](handleError(_0x52787a,null));}; \ No newline at end of file +var _0xe4e6=['fieldName','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','sort','where','pick','filter','merge','type','options','include','rows','params','includeAll','find','catch','body','describe','create','direction','secret','split','findOne','CmContact','Contacts','updatedAt','DESC','MailServerOut','Smtp','isNil','service','host','port','secure','authentication','auth','pass','user','attachments','join','root','server/files/attachments','basename','List','defaults','List\x20not\x20found','SendMail','sendMail','messageId','YYYY-MM-DD\x20HH:mm:ss','accept','mail','read','readAt','format','UserId','agent','MailInteraction','MailInteractionId','read1stAt','interaction','[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','User','fullname','email','internal','interface','SIP/%s','channel','motionChannel','event','fromString','EventManager','acceptmessage','reject','get','[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','rejectMessage','rejectmessage','download','unix','tmp','server','files','message-%s.eml','bcc','subject','createdAt','Attachment','Attachments','from','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','Bcc','existsSync','push','readFileSync','writeFileSync','eml-format','moment','bluebird','path','ioredis','html-to-text','../../config/logger','api','mail-interactions','../../config/environment','../../mysqldb','redis','socket.io-emitter','./mailMessage.socket','register','jayson/promise','client','http','request','then','MailMessage,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','info','result','status','json','offset','undefined','limit','count','set','update','destroy','sendStatus','stack','name','map','MailMessage','rawAttributes'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe4e6,0x1b1));var _0x6e4e=function(_0x72d8d0,_0x5b844f){_0x72d8d0=_0x72d8d0-0x0;var _0x4f50c0=_0xe4e6[_0x72d8d0];return _0x4f50c0;};'use strict';var emlformat=require(_0x6e4e('0x0'));var moment=require(_0x6e4e('0x1'));var BPromise=require(_0x6e4e('0x2'));var util=require('util');var path=require(_0x6e4e('0x3'));var fs=require('fs');var _=require('lodash');var Redis=require(_0x6e4e('0x4'));var htmlToText=require(_0x6e4e('0x5'));var qs=require('../../components/parsers/qs');var logger=require(_0x6e4e('0x6'))(_0x6e4e('0x7'));var interaction_log=require(_0x6e4e('0x6'))(_0x6e4e('0x8'));var config=require(_0x6e4e('0x9'));var db=require(_0x6e4e('0xa'))['db'];config[_0x6e4e('0xb')]=_['defaults'](config[_0x6e4e('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x6e4e('0xc'))(new Redis(config[_0x6e4e('0xb')]));require(_0x6e4e('0xd'))[_0x6e4e('0xe')](socket);var jayson=require(_0x6e4e('0xf'));var client=jayson[_0x6e4e('0x10')][_0x6e4e('0x11')]({'port':0x232c});var client9003=jayson[_0x6e4e('0x10')][_0x6e4e('0x11')]({'port':0x232b});var client9002=jayson[_0x6e4e('0x10')]['http']({'port':0x232a});function respondWithRpcPromise(_0x567cd4,_0x4af0cf,_0x2eb9e3,_0x271ca0){return new BPromise(function(_0x1694b7,_0x2264e2){var _0x49e687=_0x271ca0||client;return _0x49e687[_0x6e4e('0x12')](_0x567cd4,_0x2eb9e3)[_0x6e4e('0x13')](function(_0x198ace){logger['info'](_0x6e4e('0x14'),_0x4af0cf,'request\x20sent');logger[_0x6e4e('0x15')]('MailMessage,\x20%s,\x20%s,\x20%s',_0x4af0cf,_0x6e4e('0x16'),JSON[_0x6e4e('0x17')](_0x198ace));if(_0x198ace['error']){if(_0x198ace[_0x6e4e('0x18')][_0x6e4e('0x19')]===0x1f4){logger[_0x6e4e('0x18')](_0x6e4e('0x14'),_0x4af0cf,_0x198ace[_0x6e4e('0x18')][_0x6e4e('0x1a')]);return _0x2264e2(_0x198ace['error'][_0x6e4e('0x1a')]);}logger['error'](_0x6e4e('0x14'),_0x4af0cf,_0x198ace[_0x6e4e('0x18')][_0x6e4e('0x1a')]);return _0x1694b7(_0x198ace[_0x6e4e('0x18')][_0x6e4e('0x1a')]);}else{logger[_0x6e4e('0x1b')](_0x6e4e('0x14'),_0x4af0cf,_0x6e4e('0x16'));_0x1694b7(_0x198ace[_0x6e4e('0x1c')][_0x6e4e('0x1a')]);}})['catch'](function(_0x4b2c98){logger[_0x6e4e('0x18')]('MailMessage,\x20%s,\x20%s',_0x4af0cf,_0x4b2c98);_0x2264e2(_0x4b2c98);});});}function respondWithResult(_0x158575,_0x25a62f){_0x25a62f=_0x25a62f||0xc8;return function(_0x5ed291){if(_0x5ed291){return _0x158575[_0x6e4e('0x1d')](_0x25a62f)[_0x6e4e('0x1e')](_0x5ed291);}};}function respondWithFilteredResult(_0x1b9838,_0x3fc862){return function(_0x53e5da){if(_0x53e5da){var _0x3bbe6c=typeof _0x3fc862[_0x6e4e('0x1f')]===_0x6e4e('0x20')&&typeof _0x3fc862[_0x6e4e('0x21')]===_0x6e4e('0x20');var _0x3326cb=_0x53e5da[_0x6e4e('0x22')];var _0x44c895=_0x3bbe6c?0x0:_0x3fc862[_0x6e4e('0x1f')];var _0x41ecf9=_0x3bbe6c?_0x53e5da['count']:_0x3fc862[_0x6e4e('0x1f')]+_0x3fc862[_0x6e4e('0x21')];var _0x33c53c;if(_0x41ecf9>=_0x3326cb){_0x41ecf9=_0x3326cb;_0x33c53c=0xc8;}else{_0x33c53c=0xce;}_0x1b9838['status'](_0x33c53c);return _0x1b9838[_0x6e4e('0x23')]('Content-Range',_0x44c895+'-'+_0x41ecf9+'/'+_0x3326cb)[_0x6e4e('0x1e')](_0x53e5da);}return null;};}function saveUpdates(_0xa25a7c){return function(_0x104aae){if(_0x104aae){return _0x104aae[_0x6e4e('0x24')](_0xa25a7c)['then'](function(_0x523024){return _0x523024;});}return null;};}function removeEntity(_0xd7c671){return function(_0x24f772){if(_0x24f772){return _0x24f772[_0x6e4e('0x25')]()['then'](function(){_0xd7c671[_0x6e4e('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4516c7){return function(_0x4b0fd2){if(!_0x4b0fd2){_0x4516c7[_0x6e4e('0x26')](0x194);}return _0x4b0fd2;};}function handleError(_0x3f0417,_0x3d76e8){_0x3d76e8=_0x3d76e8||0x1f4;return function(_0xbf1f17){logger[_0x6e4e('0x18')](_0xbf1f17[_0x6e4e('0x27')]);if(_0xbf1f17[_0x6e4e('0x28')]){delete _0xbf1f17[_0x6e4e('0x28')];}_0x3f0417[_0x6e4e('0x1d')](_0x3d76e8)['send'](_0xbf1f17);};}exports['index']=function(_0x16a306,_0x1d2824){var _0x5e4cb3={},_0x954999={},_0x5bc0cc={'count':0x0,'rows':[]};var _0x3fdec6=_[_0x6e4e('0x29')](db[_0x6e4e('0x2a')][_0x6e4e('0x2b')],function(_0x4a0c96){return{'name':_0x4a0c96[_0x6e4e('0x2c')],'type':_0x4a0c96['type'][_0x6e4e('0x2d')]};});_0x954999[_0x6e4e('0x2e')]=_[_0x6e4e('0x29')](_0x3fdec6,_0x6e4e('0x28'));_0x954999[_0x6e4e('0x2f')]=_['keys'](_0x16a306[_0x6e4e('0x2f')]);_0x954999[_0x6e4e('0x30')]=_['intersection'](_0x954999[_0x6e4e('0x2e')],_0x954999[_0x6e4e('0x2f')]);_0x5e4cb3[_0x6e4e('0x31')]=_[_0x6e4e('0x32')](_0x954999[_0x6e4e('0x2e')],qs[_0x6e4e('0x33')](_0x16a306[_0x6e4e('0x2f')][_0x6e4e('0x33')]));_0x5e4cb3[_0x6e4e('0x31')]=_0x5e4cb3[_0x6e4e('0x31')][_0x6e4e('0x34')]?_0x5e4cb3['attributes']:_0x954999[_0x6e4e('0x2e')];if(!_0x16a306['query'][_0x6e4e('0x35')]('nolimit')){_0x5e4cb3[_0x6e4e('0x21')]=qs['limit'](_0x16a306['query'][_0x6e4e('0x21')]);_0x5e4cb3[_0x6e4e('0x1f')]=qs[_0x6e4e('0x1f')](_0x16a306[_0x6e4e('0x2f')][_0x6e4e('0x1f')]);}_0x5e4cb3['order']=qs[_0x6e4e('0x36')](_0x16a306[_0x6e4e('0x2f')][_0x6e4e('0x36')]);_0x5e4cb3[_0x6e4e('0x37')]=qs[_0x6e4e('0x30')](_[_0x6e4e('0x38')](_0x16a306[_0x6e4e('0x2f')],_0x954999[_0x6e4e('0x30')]),_0x3fdec6);if(_0x16a306['query'][_0x6e4e('0x39')]){_0x5e4cb3[_0x6e4e('0x37')]=_[_0x6e4e('0x3a')](_0x5e4cb3['where'],{'$or':_[_0x6e4e('0x29')](_0x3fdec6,function(_0x48eeb1){if(_0x48eeb1[_0x6e4e('0x3b')]!=='VIRTUAL'){var _0x5f1af7={};_0x5f1af7[_0x48eeb1[_0x6e4e('0x28')]]={'$like':'%'+_0x16a306[_0x6e4e('0x2f')][_0x6e4e('0x39')]+'%'};return _0x5f1af7;}})});}_0x5e4cb3=_['merge']({},_0x5e4cb3,_0x16a306[_0x6e4e('0x3c')]);var _0x274892={'where':_0x5e4cb3[_0x6e4e('0x37')]};return db[_0x6e4e('0x2a')][_0x6e4e('0x22')](_0x274892)[_0x6e4e('0x13')](function(_0x48f66c){_0x5bc0cc[_0x6e4e('0x22')]=_0x48f66c;if(_0x16a306[_0x6e4e('0x2f')]['includeAll']){_0x5e4cb3[_0x6e4e('0x3d')]=[{'all':!![]}];}return db[_0x6e4e('0x2a')]['findAll'](_0x5e4cb3);})[_0x6e4e('0x13')](function(_0x367f1a){_0x5bc0cc[_0x6e4e('0x3e')]=_0x367f1a;return _0x5bc0cc;})[_0x6e4e('0x13')](respondWithFilteredResult(_0x1d2824,_0x5e4cb3))['catch'](handleError(_0x1d2824,null));};exports['show']=function(_0x5c417a,_0x479e66){var _0x5dfe65={'raw':!![],'where':{'id':_0x5c417a[_0x6e4e('0x3f')]['id']}},_0x3a7dc7={};_0x3a7dc7[_0x6e4e('0x2e')]=_['keys'](db[_0x6e4e('0x2a')]['rawAttributes']);_0x3a7dc7['query']=_['keys'](_0x5c417a[_0x6e4e('0x2f')]);_0x3a7dc7['filters']=_[_0x6e4e('0x32')](_0x3a7dc7[_0x6e4e('0x2e')],_0x3a7dc7[_0x6e4e('0x2f')]);_0x5dfe65[_0x6e4e('0x31')]=_[_0x6e4e('0x32')](_0x3a7dc7[_0x6e4e('0x2e')],qs[_0x6e4e('0x33')](_0x5c417a[_0x6e4e('0x2f')]['fields']));_0x5dfe65[_0x6e4e('0x31')]=_0x5dfe65[_0x6e4e('0x31')][_0x6e4e('0x34')]?_0x5dfe65[_0x6e4e('0x31')]:_0x3a7dc7[_0x6e4e('0x2e')];if(_0x5c417a[_0x6e4e('0x2f')][_0x6e4e('0x40')]){_0x5dfe65[_0x6e4e('0x3d')]=[{'all':!![]}];}_0x5dfe65=_[_0x6e4e('0x3a')]({},_0x5dfe65,_0x5c417a[_0x6e4e('0x3c')]);return db[_0x6e4e('0x2a')][_0x6e4e('0x41')](_0x5dfe65)[_0x6e4e('0x13')](handleEntityNotFound(_0x479e66,null))['then'](respondWithResult(_0x479e66,null))[_0x6e4e('0x42')](handleError(_0x479e66,null));};exports[_0x6e4e('0x24')]=function(_0x3c51ef,_0x50d9be){if(_0x3c51ef[_0x6e4e('0x43')]['id']){delete _0x3c51ef[_0x6e4e('0x43')]['id'];}return db[_0x6e4e('0x2a')]['find']({'where':{'id':_0x3c51ef[_0x6e4e('0x3f')]['id']}})[_0x6e4e('0x13')](handleEntityNotFound(_0x50d9be,null))[_0x6e4e('0x13')](saveUpdates(_0x3c51ef[_0x6e4e('0x43')],null))[_0x6e4e('0x13')](respondWithResult(_0x50d9be,null))['catch'](handleError(_0x50d9be,null));};exports[_0x6e4e('0x25')]=function(_0x391f15,_0x325dc8){return db[_0x6e4e('0x2a')][_0x6e4e('0x41')]({'where':{'id':_0x391f15['params']['id']}})[_0x6e4e('0x13')](handleEntityNotFound(_0x325dc8,null))[_0x6e4e('0x13')](removeEntity(_0x325dc8,null))[_0x6e4e('0x42')](handleError(_0x325dc8,null));};exports['describe']=function(_0xf02d84,_0x11eedc){return db[_0x6e4e('0x2a')][_0x6e4e('0x44')]()[_0x6e4e('0x13')](respondWithResult(_0x11eedc,null))[_0x6e4e('0x42')](handleError(_0x11eedc,null));};exports[_0x6e4e('0x45')]=function(_0x1bc6c9,_0x141a12){return db[_0x6e4e('0x2a')][_0x6e4e('0x45')](_0x1bc6c9[_0x6e4e('0x43')])[_0x6e4e('0x13')](function(_0x22dc4f){if(_0x22dc4f){if(_0x22dc4f[_0x6e4e('0x46')]==='out'&&!_0x22dc4f[_0x6e4e('0x47')]){var _0x541bed,_0x56681a,_0x11aa84;if(_0x1bc6c9[_0x6e4e('0x43')]['to']){_0x56681a=_0x1bc6c9['body']['to'][_0x6e4e('0x48')](',')[0x0];}return db['MailAccount'][_0x6e4e('0x49')]({'where':{'id':_0x22dc4f['MailAccountId']},'include':[{'model':db['CmList'],'as':'List','include':[{'model':db[_0x6e4e('0x4a')],'as':_0x6e4e('0x4b'),'where':{'email':_0x56681a},'limit':0x1,'order':[[_0x6e4e('0x4c'),_0x6e4e('0x4d')]]}]},{'model':db[_0x6e4e('0x4e')],'as':_0x6e4e('0x4f'),'raw':!![]}]})[_0x6e4e('0x13')](function(_0x597f5d){_0x541bed=_0x597f5d;if(_0x541bed&&_0x541bed['Smtp']){var _0x4c1bd0={'tls':{'rejectUnauthorized':![]}};if(_[_0x6e4e('0x50')](_0x541bed[_0x6e4e('0x4f')][_0x6e4e('0x51')])){_0x4c1bd0[_0x6e4e('0x52')]=_0x541bed[_0x6e4e('0x4f')][_0x6e4e('0x52')];_0x4c1bd0[_0x6e4e('0x53')]=_0x541bed['Smtp']['port'];_0x4c1bd0[_0x6e4e('0x54')]=_0x541bed[_0x6e4e('0x4f')]['secure'];if(_0x541bed['Smtp'][_0x6e4e('0x55')]){_0x4c1bd0[_0x6e4e('0x56')]={'user':_0x541bed[_0x6e4e('0x4f')]['user'],'pass':_0x541bed[_0x6e4e('0x4f')][_0x6e4e('0x57')]};}}else{_0x4c1bd0['service']=_0x541bed[_0x6e4e('0x4f')][_0x6e4e('0x51')];_0x4c1bd0[_0x6e4e('0x56')]={'user':_0x541bed[_0x6e4e('0x4f')][_0x6e4e('0x58')],'pass':_0x541bed['Smtp'][_0x6e4e('0x57')]};_0x4c1bd0[_0x6e4e('0x54')]=_0x541bed[_0x6e4e('0x4f')][_0x6e4e('0x54')];}if(_0x1bc6c9['body'][_0x6e4e('0x59')]&&_0x1bc6c9[_0x6e4e('0x43')][_0x6e4e('0x59')]['length']){for(var _0x5f14df=0x0;_0x5f14df<_0x1bc6c9[_0x6e4e('0x43')][_0x6e4e('0x59')][_0x6e4e('0x34')];_0x5f14df+=0x1){_0x1bc6c9['body'][_0x6e4e('0x59')][_0x5f14df]={'filename':_0x1bc6c9[_0x6e4e('0x43')][_0x6e4e('0x59')][_0x5f14df][_0x6e4e('0x28')],'path':path[_0x6e4e('0x5a')](config[_0x6e4e('0x5b')],_0x6e4e('0x5c'),_0x1bc6c9[_0x6e4e('0x43')][_0x6e4e('0x59')][_0x5f14df][_0x6e4e('0x5d')])};}}_0x11aa84={'account':_0x4c1bd0,'message':_0x1bc6c9[_0x6e4e('0x43')]};return;}})[_0x6e4e('0x13')](function(){if(_0x541bed['List']){if(_0x541bed['List'][_0x6e4e('0x4b')]['length']){return _0x541bed[_0x6e4e('0x5e')][_0x6e4e('0x4b')][0x0];}else{return db[_0x6e4e('0x4a')][_0x6e4e('0x45')](_[_0x6e4e('0x5f')](_0x1bc6c9[_0x6e4e('0x43')],{'firstName':_0x1bc6c9[_0x6e4e('0x43')]['to'],'email':_0x1bc6c9[_0x6e4e('0x43')]['to'],'phone':_0x1bc6c9[_0x6e4e('0x43')]['to'],'ListId':_0x541bed['ListId']}));}}else{throw new Error(_0x6e4e('0x60'));}})[_0x6e4e('0x13')](function(){if(_0x11aa84){return respondWithRpcPromise(_0x6e4e('0x61'),_0x6e4e('0x62'),_0x11aa84,client9003)[_0x6e4e('0x13')](function(_0x1a2374){return _0x22dc4f[_0x6e4e('0x24')]({'read':!![],'messageId':_0x1a2374[_0x6e4e('0x63')],'sentAt':moment()['format'](_0x6e4e('0x64'))});})[_0x6e4e('0x42')](function(_0x55ab8a){logger[_0x6e4e('0x18')]('%s',JSON['stringify'](_0x55ab8a));return _0x22dc4f;});}return _0x22dc4f;});}return _0x22dc4f;}})['then'](respondWithResult(_0x141a12,0xc9))[_0x6e4e('0x42')](handleError(_0x141a12,null));};exports[_0x6e4e('0x65')]=function(_0x292a1d,_0x45e95f){var _0x61e8fc={'agent':{},'channel':_0x6e4e('0x66')};if(_0x292a1d['body']['id']){delete _0x292a1d['body']['id'];}_0x292a1d['body'][_0x6e4e('0x67')]=!![];_0x292a1d[_0x6e4e('0x43')][_0x6e4e('0x68')]=moment()[_0x6e4e('0x69')]('YYYY-MM-DD\x20HH:mm:ss');_0x292a1d['body'][_0x6e4e('0x6a')]=_0x292a1d[_0x6e4e('0x43')][_0x6e4e('0x6a')]||_0x292a1d[_0x6e4e('0x58')]['id'];_0x61e8fc[_0x6e4e('0x6b')]['id']=_0x292a1d[_0x6e4e('0x43')][_0x6e4e('0x6a')];return db[_0x6e4e('0x2a')][_0x6e4e('0x41')]({'where':{'id':_0x292a1d[_0x6e4e('0x3f')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x45e95f,null))[_0x6e4e('0x13')](saveUpdates(_0x292a1d['body'],null))[_0x6e4e('0x13')](function(_0x45e5c1){if(_0x45e5c1){_0x61e8fc[_0x6e4e('0x1a')]=_0x45e5c1['get']({'plain':!![]});return db[_0x6e4e('0x6c')][_0x6e4e('0x41')]({'where':{'id':_0x45e5c1[_0x6e4e('0x6d')]}});}return null;})[_0x6e4e('0x13')](handleEntityNotFound(_0x45e95f,null))[_0x6e4e('0x13')](function(_0x6eeb32){if(_0x6eeb32){return _0x6eeb32[_0x6e4e('0x24')]({'UserId':_0x292a1d[_0x6e4e('0x43')][_0x6e4e('0x6a')],'read1stAt':_[_0x6e4e('0x50')](_0x6eeb32[_0x6e4e('0x6e')])?moment()[_0x6e4e('0x69')](_0x6e4e('0x64')):undefined});}return null;})['then'](function(_0x453851){if(_0x453851){_0x61e8fc[_0x6e4e('0x6f')]=_0x453851['get']({'plain':!![]});interaction_log[_0x6e4e('0x1b')](_0x6e4e('0x70'),_0x292a1d['user']['id'],_0x292a1d[_0x6e4e('0x58')][_0x6e4e('0x28')],_0x292a1d[_0x6e4e('0x58')][_0x6e4e('0x71')],_0x61e8fc[_0x6e4e('0x6f')]['id'],_0x292a1d[_0x6e4e('0x43')]?JSON['stringify'](_0x292a1d[_0x6e4e('0x43')]):_0x6e4e('0x72'));return respondWithRpcPromise(_0x6e4e('0x73'),_0x6e4e('0x74'),_0x61e8fc);}return null;})[_0x6e4e('0x13')](function(_0x530fa8){var _0x4bd41c=_0x6e4e('0x75')+_0x530fa8[_0x6e4e('0x1a')][_0x6e4e('0x76')];return db[_0x6e4e('0x77')][_0x6e4e('0x2f')](_0x4bd41c,{'type':db[_0x6e4e('0x78')][_0x6e4e('0x79')][_0x6e4e('0x7a')],'raw':!![]})[_0x6e4e('0x13')](function(_0x3c737e){return _0x3c737e;});})[_0x6e4e('0x13')](function(_0x163e4c){if(_0x163e4c){_0x61e8fc[_0x6e4e('0x1a')][_0x6e4e('0x7b')]=_0x163e4c[0x0];if(!_0x292a1d[_0x6e4e('0x43')]['UserId'])return;return db[_0x6e4e('0x7c')][_0x6e4e('0x41')]({'where':{'id':_0x292a1d[_0x6e4e('0x43')]['UserId'],'role':_0x6e4e('0x6b')},'attributes':['id',_0x6e4e('0x28'),_0x6e4e('0x7d'),_0x6e4e('0x7e'),_0x6e4e('0x7f')],'raw':!![]});}return null;})['then'](function(_0x4c6d39){if(!_0x4c6d39)return null;_0x61e8fc[_0x6e4e('0x1a')][_0x6e4e('0x6b')]=_0x4c6d39;return _0x61e8fc;})['then'](function(_0x38816a){if(_0x38816a){if(_0x292a1d[_0x6e4e('0x43')]['manual']){_0x61e8fc[_0x6e4e('0x1a')][_0x6e4e('0x80')]=util[_0x6e4e('0x69')](_0x6e4e('0x81'),_0x292a1d[_0x6e4e('0x58')][_0x6e4e('0x28')]);_0x61e8fc[_0x6e4e('0x1a')][_0x6e4e('0x82')]=_0x61e8fc[_0x6e4e('0x82')];_0x61e8fc[_0x6e4e('0x1a')][_0x6e4e('0x83')]=_0x61e8fc['channel'];_0x61e8fc[_0x6e4e('0x1a')][_0x6e4e('0x84')]=_0x6e4e('0x65');_0x61e8fc[_0x6e4e('0x1a')][_0x6e4e('0x43')]=htmlToText[_0x6e4e('0x85')](_0x61e8fc[_0x6e4e('0x1a')][_0x6e4e('0x43')]);return respondWithRpcPromise('EventManager',_0x6e4e('0x86'),{'event':_0x6e4e('0x87'),'message':_0x61e8fc['message']},client9002)[_0x6e4e('0x13')](function(){return _0x61e8fc;});}return _0x61e8fc;}return null;})[_0x6e4e('0x13')](respondWithResult(_0x45e95f,null))[_0x6e4e('0x42')](handleError(_0x45e95f,null));};exports[_0x6e4e('0x88')]=function(_0x3b926d,_0x237d55){var _0x19e79c={'agent':{},'channel':_0x6e4e('0x66')};if(_0x3b926d[_0x6e4e('0x43')]['id']){delete _0x3b926d[_0x6e4e('0x43')]['id'];}_0x3b926d[_0x6e4e('0x43')][_0x6e4e('0x6a')]=_0x3b926d[_0x6e4e('0x43')][_0x6e4e('0x6a')]||_0x3b926d[_0x6e4e('0x58')]['id'];_0x19e79c[_0x6e4e('0x6b')]['id']=_0x3b926d[_0x6e4e('0x43')][_0x6e4e('0x6a')];return db[_0x6e4e('0x2a')][_0x6e4e('0x41')]({'where':{'id':_0x3b926d['params']['id'],'UserId':null}})[_0x6e4e('0x13')](handleEntityNotFound(_0x237d55,null))['then'](function(_0x1d54a0){if(_0x1d54a0){_0x19e79c[_0x6e4e('0x1a')]=_0x1d54a0[_0x6e4e('0x89')]({'plain':!![]});return db[_0x6e4e('0x6c')][_0x6e4e('0x41')]({'where':{'id':_0x1d54a0[_0x6e4e('0x6d')]}});}return null;})[_0x6e4e('0x13')](handleEntityNotFound(_0x237d55,null))[_0x6e4e('0x13')](function(_0x42f487){if(_0x42f487){_0x19e79c[_0x6e4e('0x6f')]=_0x42f487[_0x6e4e('0x89')]({'plain':!![]});interaction_log[_0x6e4e('0x1b')](_0x6e4e('0x8a'),_0x3b926d[_0x6e4e('0x58')]['id'],_0x3b926d[_0x6e4e('0x58')][_0x6e4e('0x28')],_0x3b926d[_0x6e4e('0x58')][_0x6e4e('0x71')],_0x19e79c[_0x6e4e('0x6f')]['id'],_0x3b926d[_0x6e4e('0x43')]?JSON['stringify'](_0x3b926d[_0x6e4e('0x43')]):_0x6e4e('0x72'));return respondWithRpcPromise('RejectMessage',_0x6e4e('0x8b'),_0x19e79c);}return null;})[_0x6e4e('0x13')](function(_0x1497f9){var _0x1735d2='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x1497f9['message'][_0x6e4e('0x76')];return db[_0x6e4e('0x77')]['query'](_0x1735d2,{'type':db[_0x6e4e('0x78')]['QueryTypes'][_0x6e4e('0x7a')],'raw':!![]})[_0x6e4e('0x13')](function(_0x21c4d4){return _0x21c4d4;});})[_0x6e4e('0x13')](function(_0x1d8eb2){if(_0x1d8eb2){_0x19e79c[_0x6e4e('0x1a')]['contact']=_0x1d8eb2[0x0];if(!_0x3b926d['body']['UserId'])return;return db[_0x6e4e('0x7c')][_0x6e4e('0x41')]({'where':{'id':_0x3b926d[_0x6e4e('0x43')][_0x6e4e('0x6a')],'role':_0x6e4e('0x6b')},'attributes':['id',_0x6e4e('0x28'),'fullname',_0x6e4e('0x7e'),_0x6e4e('0x7f')],'raw':!![]});}return null;})[_0x6e4e('0x13')](function(_0x4def5a){if(!_0x4def5a)return null;_0x19e79c[_0x6e4e('0x1a')][_0x6e4e('0x6b')]=_0x4def5a;return _0x19e79c;})[_0x6e4e('0x13')](function(_0x21d0af){if(_0x21d0af){_0x21d0af['message'][_0x6e4e('0x80')]=util[_0x6e4e('0x69')](_0x6e4e('0x81'),_0x3b926d['user'][_0x6e4e('0x28')]);_0x21d0af[_0x6e4e('0x1a')]['channel']=_0x19e79c[_0x6e4e('0x82')];_0x21d0af[_0x6e4e('0x1a')][_0x6e4e('0x83')]=_0x19e79c['channel'];_0x21d0af[_0x6e4e('0x1a')]['event']='reject';_0x21d0af[_0x6e4e('0x1a')][_0x6e4e('0x43')]=htmlToText[_0x6e4e('0x85')](_0x19e79c[_0x6e4e('0x1a')]['body']);respondWithRpcPromise(_0x6e4e('0x86'),_0x6e4e('0x86'),{'event':_0x6e4e('0x8c'),'message':_0x21d0af[_0x6e4e('0x1a')]},client9002);return _0x19e79c;}return null;})['then'](respondWithResult(_0x237d55,null))[_0x6e4e('0x42')](handleError(_0x237d55,null));};exports[_0x6e4e('0x8d')]=function(_0x37b718,_0x36e44e){var _0x4d6640=moment()[_0x6e4e('0x8e')]()['toString']();var _0x1d8e96=path[_0x6e4e('0x5a')](config['root'],'server','files',_0x6e4e('0x8f'));var _0x2f65f3=path['join'](config[_0x6e4e('0x5b')],_0x6e4e('0x90'),_0x6e4e('0x91'),_0x6e4e('0x59'));var _0x1bcc27=util[_0x6e4e('0x69')](_0x6e4e('0x92'),_0x4d6640);return db[_0x6e4e('0x2a')]['find']({'where':{'id':_0x37b718['params']['id']},'attributes':['id',_0x6e4e('0x43'),'from','to','cc',_0x6e4e('0x93'),_0x6e4e('0x94'),_0x6e4e('0x95')],'include':_0x37b718['query'][_0x6e4e('0x59')]?[{'model':db[_0x6e4e('0x96')],'as':_0x6e4e('0x97')}]:undefined})['then'](handleEntityNotFound(_0x36e44e,null))[_0x6e4e('0x13')](function(_0x37d153){if(_0x37d153){var _0x4396f3=_0x37d153;var _0x511a6d={'from':_0x4396f3[_0x6e4e('0x98')],'to':_0x4396f3['to'],'subject':_0x4396f3['subject'],'html':_0x4396f3[_0x6e4e('0x43')],'headers':{'Date':moment(_0x4396f3['createdAt'])[_0x6e4e('0x69')](_0x6e4e('0x99'))},'attachments':[]};if(_0x37d153['cc']){_0x511a6d['headers']['Cc']=_0x37d153['cc'];}if(_0x37d153['bcc']){_0x511a6d['headers'][_0x6e4e('0x9a')]=_0x37d153['bcc'];}return new BPromise(function(_0x1c69f6,_0x1e2d0f){if(_0x37d153[_0x6e4e('0x97')]){for(var _0x4f8998=0x0;_0x4f8998<_0x37d153[_0x6e4e('0x97')][_0x6e4e('0x34')];_0x4f8998++){var _0x5ef571=_0x37d153[_0x6e4e('0x97')][_0x4f8998];var _0x3307fc=path['join'](_0x2f65f3,_0x5ef571[_0x6e4e('0x5d')]);if(fs[_0x6e4e('0x9b')](_0x3307fc)){_0x511a6d[_0x6e4e('0x59')][_0x6e4e('0x9c')]({'name':_0x5ef571['name'],'contentType':_0x5ef571['type'],'data':fs[_0x6e4e('0x9d')](_0x3307fc)});}}}emlformat['build'](_0x511a6d,function(_0x58cc22,_0x2f4c69){if(_0x58cc22)return _0x1e2d0f(_0x58cc22);fs[_0x6e4e('0x9e')](path[_0x6e4e('0x5a')](_0x1d8e96,_0x1bcc27),_0x2f4c69);return _0x1c69f6(_0x2f4c69);});});}})['then'](function(_0x219127){if(_0x219127){return _0x36e44e[_0x6e4e('0x8d')](path[_0x6e4e('0x5a')](_0x1d8e96,_0x1bcc27),_0x1bcc27,function(_0x348c08){if(!_0x348c08)fs['unlinkSync'](path[_0x6e4e('0x5a')](_0x1d8e96,_0x1bcc27));});}})[_0x6e4e('0x42')](handleError(_0x36e44e,null));}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.events.js b/server/api/mailMessage/mailMessage.events.js index b9bcd8e..e0f739a 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 _0xc67b=['exports','events','../../mysqldb','MailMessage','setMaxListeners','save','update','remove','hook'];(function(_0x5b1b70,_0x1dfc21){var _0xb6a489=function(_0x5dbf58){while(--_0x5dbf58){_0x5b1b70['push'](_0x5b1b70['shift']());}};_0xb6a489(++_0x1dfc21);}(_0xc67b,0x145));var _0xbc67=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0xc67b[_0x21a9d9];return _0x46adce;};'use strict';var EventEmitter=require(_0xbc67('0x0'));var MailMessage=require(_0xbc67('0x1'))['db'][_0xbc67('0x2')];var MailMessageEvents=new EventEmitter();MailMessageEvents[_0xbc67('0x3')](0x0);var events={'afterCreate':_0xbc67('0x4'),'afterUpdate':_0xbc67('0x5'),'afterDestroy':_0xbc67('0x6')};function emitEvent(_0x4c5649){return function(_0x43ba42,_0x354740,_0x57f409){MailMessageEvents['emit'](_0x4c5649+':'+_0x43ba42['id'],_0x43ba42);MailMessageEvents['emit'](_0x4c5649,_0x43ba42);_0x57f409(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailMessage[_0xbc67('0x7')](e,emitEvent(event));}}module[_0xbc67('0x8')]=MailMessageEvents; \ No newline at end of file +var _0xca55=['../../mysqldb','MailMessage','setMaxListeners','save','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x577f71,_0x3a8951){var _0xfec7c2=function(_0x440797){while(--_0x440797){_0x577f71['push'](_0x577f71['shift']());}};_0xfec7c2(++_0x3a8951);}(_0xca55,0x121));var _0x5ca5=function(_0x400ed9,_0x3e4e67){_0x400ed9=_0x400ed9-0x0;var _0x384bed=_0xca55[_0x400ed9];return _0x384bed;};'use strict';var EventEmitter=require(_0x5ca5('0x0'));var MailMessage=require(_0x5ca5('0x1'))['db'][_0x5ca5('0x2')];var MailMessageEvents=new EventEmitter();MailMessageEvents[_0x5ca5('0x3')](0x0);var events={'afterCreate':_0x5ca5('0x4'),'afterUpdate':'update','afterDestroy':_0x5ca5('0x5')};function emitEvent(_0x4d1427){return function(_0x24c7c1,_0x481564,_0x4e3320){MailMessageEvents[_0x5ca5('0x6')](_0x4d1427+':'+_0x24c7c1['id'],_0x24c7c1);MailMessageEvents['emit'](_0x4d1427,_0x24c7c1);_0x4e3320(null);};}for(var e in events){if(events[_0x5ca5('0x7')](e)){var event=events[e];MailMessage[_0x5ca5('0x8')](e,emitEvent(event));}}module[_0x5ca5('0x9')]=MailMessageEvents; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.model.js b/server/api/mailMessage/mailMessage.model.js index 7f73096..b4c16e5 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 _0x1d8a=['out','secret','UserId','MailInteraction','findOne','MailInteractionId','then','createdAt','catch','lodash','../../config/logger','api','moment','bluebird','request-promise','html-to-text','path','../../config/environment','./mailMessage.attributes','define','messageId','fti_mail_messages','subject','FULLTEXT','plainBody','fromString','body','get','direction','toLowerCase'];(function(_0x5330b7,_0xd242d4){var _0x520a2e=function(_0x10fbc8){while(--_0x10fbc8){_0x5330b7['push'](_0x5330b7['shift']());}};_0x520a2e(++_0xd242d4);}(_0x1d8a,0x153));var _0xa1d8=function(_0x1de098,_0x281154){_0x1de098=_0x1de098-0x0;var _0x45d886=_0x1d8a[_0x1de098];return _0x45d886;};'use strict';var _=require(_0xa1d8('0x0'));var util=require('util');var logger=require(_0xa1d8('0x1'))(_0xa1d8('0x2'));var moment=require(_0xa1d8('0x3'));var BPromise=require(_0xa1d8('0x4'));var rp=require(_0xa1d8('0x5'));var htmlToText=require(_0xa1d8('0x6'));var fs=require('fs');var path=require(_0xa1d8('0x7'));var rimraf=require('rimraf');var config=require(_0xa1d8('0x8'));var attributes=require(_0xa1d8('0x9'));module['exports']=function(_0x295d4d,_0x26e33e){return _0x295d4d[_0xa1d8('0xa')]('MailMessage',attributes,{'tableName':'mail_messages','paranoid':![],'indexes':[{'name':'messageId','fields':[_0xa1d8('0xb')]},{'name':_0xa1d8('0xc'),'fields':['plainBody',_0xa1d8('0xd')],'type':_0xa1d8('0xe')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0xe16b54,_0x50e0d3,_0x1271bb){if(_0xe16b54['body']){_0xe16b54[_0xa1d8('0xf')]=htmlToText[_0xa1d8('0x10')](_0xe16b54[_0xa1d8('0x11')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x1271bb(null,_0x50e0d3);},'afterCreate':function(_0x41d93e,_0x14df5b,_0x3a5867){var _0x13b9e0=_0x295d4d['models'];var _0x188405=_0x41d93e[_0xa1d8('0x12')]({'plain':!![]});if(_0x188405[_0xa1d8('0x13')][_0xa1d8('0x14')]()==='in'||_0x188405[_0xa1d8('0x13')]['toLowerCase']()===_0xa1d8('0x15')&&!_0x188405[_0xa1d8('0x16')]&&!_['isNil'](_0x188405[_0xa1d8('0x17')])){_0x13b9e0[_0xa1d8('0x18')][_0xa1d8('0x19')]({'where':{'id':_0x188405[_0xa1d8('0x1a')]}})[_0xa1d8('0x1b')](function(_0x1d795b){if(_0x1d795b){_0x1d795b['update']({'lastMsgAt':_0x188405[_0xa1d8('0x1c')],'lastMsgDirection':_0x188405[_0xa1d8('0x13')][_0xa1d8('0x14')]()});}})[_0xa1d8('0x1d')](function(_0x284e77){console['error'](_0x284e77);});}_0x3a5867();}},'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x1665=['mail_messages','messageId','fti_mail_messages','subject','FULLTEXT','body','fromString','models','get','direction','toLowerCase','out','isNil','UserId','MailInteraction','findOne','MailInteractionId','then','update','catch','error','utf8mb4','lodash','util','api','moment','bluebird','html-to-text','path','../../config/environment','exports','define','MailMessage'];(function(_0x38770e,_0x1a10be){var _0x266089=function(_0x15f90e){while(--_0x15f90e){_0x38770e['push'](_0x38770e['shift']());}};_0x266089(++_0x1a10be);}(_0x1665,0x9a));var _0x5166=function(_0x72493a,_0x158721){_0x72493a=_0x72493a-0x0;var _0x4c6027=_0x1665[_0x72493a];return _0x4c6027;};'use strict';var _=require(_0x5166('0x0'));var util=require(_0x5166('0x1'));var logger=require('../../config/logger')(_0x5166('0x2'));var moment=require(_0x5166('0x3'));var BPromise=require(_0x5166('0x4'));var rp=require('request-promise');var htmlToText=require(_0x5166('0x5'));var fs=require('fs');var path=require(_0x5166('0x6'));var rimraf=require('rimraf');var config=require(_0x5166('0x7'));var attributes=require('./mailMessage.attributes');module[_0x5166('0x8')]=function(_0x2f6124,_0x557dd9){return _0x2f6124[_0x5166('0x9')](_0x5166('0xa'),attributes,{'tableName':_0x5166('0xb'),'paranoid':![],'indexes':[{'name':_0x5166('0xc'),'fields':[_0x5166('0xc')]},{'name':_0x5166('0xd'),'fields':['plainBody',_0x5166('0xe')],'type':_0x5166('0xf')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x2ba6de,_0x176061,_0x40d6c8){if(_0x2ba6de[_0x5166('0x10')]){_0x2ba6de['plainBody']=htmlToText[_0x5166('0x11')](_0x2ba6de[_0x5166('0x10')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x40d6c8(null,_0x176061);},'afterCreate':function(_0x11262c,_0x13ec61,_0x570b26){var _0x4cf688=_0x2f6124[_0x5166('0x12')];var _0x24a1a6=_0x11262c[_0x5166('0x13')]({'plain':!![]});if(_0x24a1a6[_0x5166('0x14')]['toLowerCase']()==='in'||_0x24a1a6[_0x5166('0x14')][_0x5166('0x15')]()===_0x5166('0x16')&&!_0x24a1a6['secret']&&!_[_0x5166('0x17')](_0x24a1a6[_0x5166('0x18')])){_0x4cf688[_0x5166('0x19')][_0x5166('0x1a')]({'where':{'id':_0x24a1a6[_0x5166('0x1b')]}})[_0x5166('0x1c')](function(_0x5ab106){if(_0x5ab106){_0x5ab106[_0x5166('0x1d')]({'lastMsgAt':_0x24a1a6['createdAt'],'lastMsgDirection':_0x24a1a6[_0x5166('0x14')][_0x5166('0x15')]()});}})[_0x5166('0x1e')](function(_0x2f7feb){console[_0x5166('0x1f')](_0x2f7feb);});}_0x570b26();}},'charset':_0x5166('0x20'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.rpc.js b/server/api/mailMessage/mailMessage.rpc.js index 26687b5..760f4aa 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 _0x1c9a=['raw','CreateMailMessage','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','defaults','redis','localhost','./mailMessage.socket','register','request','then','info','MailMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','MailMessage','create','options'];(function(_0xe20cbe,_0x1e55f1){var _0x35f01d=function(_0x539a24){while(--_0x539a24){_0xe20cbe['push'](_0xe20cbe['shift']());}};_0x35f01d(++_0x1e55f1);}(_0x1c9a,0x98));var _0xa1c9=function(_0x491ee2,_0x3d1bb6){_0x491ee2=_0x491ee2-0x0;var _0x131a46=_0x1c9a[_0x491ee2];return _0x131a46;};'use strict';var _=require(_0xa1c9('0x0'));var util=require('util');var moment=require(_0xa1c9('0x1'));var BPromise=require('bluebird');var rs=require(_0xa1c9('0x2'));var fs=require('fs');var Redis=require(_0xa1c9('0x3'));var db=require(_0xa1c9('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xa1c9('0x5'))(_0xa1c9('0x6'));var config=require(_0xa1c9('0x7'));var jayson=require(_0xa1c9('0x8'));var client=jayson['client'][_0xa1c9('0x9')]({'port':0x232a});config['redis']=_[_0xa1c9('0xa')](config[_0xa1c9('0xb')],{'host':_0xa1c9('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa1c9('0xb')]));require(_0xa1c9('0xd'))[_0xa1c9('0xe')](socket);function respondWithRpcPromise(_0x1efbab,_0x493cf6,_0x27b020){return new BPromise(function(_0x4437f2,_0x29e24a){return client[_0xa1c9('0xf')](_0x1efbab,_0x27b020)[_0xa1c9('0x10')](function(_0xbb76ef){logger[_0xa1c9('0x11')](_0xa1c9('0x12'),_0x493cf6,_0xa1c9('0x13'));logger[_0xa1c9('0x14')]('MailMessage,\x20%s,\x20%s,\x20%s',_0x493cf6,_0xa1c9('0x13'),JSON[_0xa1c9('0x15')](_0xbb76ef));if(_0xbb76ef[_0xa1c9('0x16')]){if(_0xbb76ef[_0xa1c9('0x16')][_0xa1c9('0x17')]===0x1f4){logger['error'](_0xa1c9('0x12'),_0x493cf6,_0xbb76ef[_0xa1c9('0x16')][_0xa1c9('0x18')]);return _0x29e24a(_0xbb76ef[_0xa1c9('0x16')][_0xa1c9('0x18')]);}logger[_0xa1c9('0x16')](_0xa1c9('0x12'),_0x493cf6,_0xbb76ef[_0xa1c9('0x16')][_0xa1c9('0x18')]);return _0x4437f2(_0xbb76ef[_0xa1c9('0x16')]['message']);}else{logger[_0xa1c9('0x11')](_0xa1c9('0x12'),_0x493cf6,_0xa1c9('0x13'));_0x4437f2(_0xbb76ef['result'][_0xa1c9('0x18')]);}})['catch'](function(_0x21cd35){logger[_0xa1c9('0x16')](_0xa1c9('0x12'),_0x493cf6,_0x21cd35);_0x29e24a(_0x21cd35);});});}exports['CreateMailMessage']=function(_0x3a1110){var _0x46b1e4=this;return new Promise(function(_0x128732,_0x4edf37){return db[_0xa1c9('0x19')][_0xa1c9('0x1a')](_0x3a1110['body'],{'raw':_0x3a1110[_0xa1c9('0x1b')]?_0x3a1110[_0xa1c9('0x1b')][_0xa1c9('0x1c')]===undefined?!![]:![]:!![]})['then'](function(_0x29f1b1){logger[_0xa1c9('0x11')](_0xa1c9('0x1d'),_0x3a1110);logger[_0xa1c9('0x14')](_0xa1c9('0x1d'),_0x3a1110,JSON['stringify'](_0x29f1b1));_0x128732(_0x29f1b1);})['catch'](function(_0x200749){logger['error'](_0xa1c9('0x1d'),_0x200749[_0xa1c9('0x18')],_0x3a1110);_0x4edf37(_0x46b1e4[_0xa1c9('0x16')](0x1f4,_0x200749[_0xa1c9('0x18')]));});});}; \ No newline at end of file +var _0x9f0e=['MailMessage,\x20%s,\x20%s','message','result','catch','CreateMailMessage','MailMessage','create','raw','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','redis','defaults','socket.io-emitter','./mailMessage.socket','register','then','info','request\x20sent','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x3c8952,_0x5979fd){var _0x55a5ac=function(_0x35c3d4){while(--_0x35c3d4){_0x3c8952['push'](_0x3c8952['shift']());}};_0x55a5ac(++_0x5979fd);}(_0x9f0e,0x116));var _0xe9f0=function(_0x205811,_0x374bad){_0x205811=_0x205811-0x0;var _0x2074d0=_0x9f0e[_0x205811];return _0x2074d0;};'use strict';var _=require(_0xe9f0('0x0'));var util=require(_0xe9f0('0x1'));var moment=require(_0xe9f0('0x2'));var BPromise=require(_0xe9f0('0x3'));var rs=require(_0xe9f0('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xe9f0('0x5'));var logger=require(_0xe9f0('0x6'))(_0xe9f0('0x7'));var config=require(_0xe9f0('0x8'));var jayson=require(_0xe9f0('0x9'));var client=jayson['client']['http']({'port':0x232a});config[_0xe9f0('0xa')]=_[_0xe9f0('0xb')](config[_0xe9f0('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0xe9f0('0xc'))(new Redis(config[_0xe9f0('0xa')]));require(_0xe9f0('0xd'))[_0xe9f0('0xe')](socket);function respondWithRpcPromise(_0xa523c0,_0x240932,_0x807322){return new BPromise(function(_0x3724f4,_0x6acfb){return client['request'](_0xa523c0,_0x807322)[_0xe9f0('0xf')](function(_0x329ecd){logger[_0xe9f0('0x10')]('MailMessage,\x20%s,\x20%s',_0x240932,_0xe9f0('0x11'));logger['debug'](_0xe9f0('0x12'),_0x240932,_0xe9f0('0x11'),JSON[_0xe9f0('0x13')](_0x329ecd));if(_0x329ecd[_0xe9f0('0x14')]){if(_0x329ecd['error'][_0xe9f0('0x15')]===0x1f4){logger['error'](_0xe9f0('0x16'),_0x240932,_0x329ecd[_0xe9f0('0x14')][_0xe9f0('0x17')]);return _0x6acfb(_0x329ecd['error'][_0xe9f0('0x17')]);}logger[_0xe9f0('0x14')](_0xe9f0('0x16'),_0x240932,_0x329ecd['error'][_0xe9f0('0x17')]);return _0x3724f4(_0x329ecd[_0xe9f0('0x14')][_0xe9f0('0x17')]);}else{logger[_0xe9f0('0x10')](_0xe9f0('0x16'),_0x240932,_0xe9f0('0x11'));_0x3724f4(_0x329ecd[_0xe9f0('0x18')]['message']);}})[_0xe9f0('0x19')](function(_0x19e090){logger[_0xe9f0('0x14')]('MailMessage,\x20%s,\x20%s',_0x240932,_0x19e090);_0x6acfb(_0x19e090);});});}exports[_0xe9f0('0x1a')]=function(_0x30b8c7){var _0x1698cf=this;return new Promise(function(_0x43f399,_0x5ba788){return db[_0xe9f0('0x1b')][_0xe9f0('0x1c')](_0x30b8c7['body'],{'raw':_0x30b8c7['options']?_0x30b8c7['options'][_0xe9f0('0x1d')]===undefined?!![]:![]:!![]})[_0xe9f0('0xf')](function(_0x1211ae){logger[_0xe9f0('0x10')](_0xe9f0('0x1a'),_0x30b8c7);logger['debug'](_0xe9f0('0x1a'),_0x30b8c7,JSON[_0xe9f0('0x13')](_0x1211ae));_0x43f399(_0x1211ae);})[_0xe9f0('0x19')](function(_0x10801b){logger[_0xe9f0('0x14')](_0xe9f0('0x1a'),_0x10801b[_0xe9f0('0x17')],_0x30b8c7);_0x5ba788(_0x1698cf[_0xe9f0('0x14')](0x1f4,_0x10801b[_0xe9f0('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.socket.js b/server/api/mailMessage/mailMessage.socket.js index 034e39c..59f70a9 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 _0xc749=['save','remove','update','emit','removeListener','register','length','mailMessage:'];(function(_0xac21df,_0x4f3ba2){var _0x1faa60=function(_0x591aa7){while(--_0x591aa7){_0xac21df['push'](_0xac21df['shift']());}};_0x1faa60(++_0x4f3ba2);}(_0xc749,0x1c0));var _0x9c74=function(_0x464b1c,_0x38fa45){_0x464b1c=_0x464b1c-0x0;var _0x4187c3=_0xc749[_0x464b1c];return _0x4187c3;};'use strict';var MailMessageEvents=require('./mailMessage.events');var events=[_0x9c74('0x0'),_0x9c74('0x1'),_0x9c74('0x2')];function createListener(_0x117cdc,_0x5c18e1){return function(_0x4e63da){_0x5c18e1[_0x9c74('0x3')](_0x117cdc,_0x4e63da);};}function removeListener(_0x48230c,_0x6180ef){return function(){MailMessageEvents[_0x9c74('0x4')](_0x48230c,_0x6180ef);};}exports[_0x9c74('0x5')]=function(_0x3104f9){for(var _0x19cbdf=0x0,_0x320e37=events[_0x9c74('0x6')];_0x19cbdf<_0x320e37;_0x19cbdf++){var _0x39f6bb=events[_0x19cbdf];var _0x2103d0=createListener(_0x9c74('0x7')+_0x39f6bb,_0x3104f9);MailMessageEvents['on'](_0x39f6bb,_0x2103d0);}}; \ No newline at end of file +var _0x8119=['remove','emit','removeListener','register','length','mailMessage:','./mailMessage.events','save'];(function(_0x3070dc,_0x40cf11){var _0x431489=function(_0x49bc2a){while(--_0x49bc2a){_0x3070dc['push'](_0x3070dc['shift']());}};_0x431489(++_0x40cf11);}(_0x8119,0x126));var _0x9811=function(_0x11ecfe,_0x596bd3){_0x11ecfe=_0x11ecfe-0x0;var _0x477f51=_0x8119[_0x11ecfe];return _0x477f51;};'use strict';var MailMessageEvents=require(_0x9811('0x0'));var events=[_0x9811('0x1'),_0x9811('0x2'),'update'];function createListener(_0x4c72c4,_0x12e903){return function(_0x42c83){_0x12e903[_0x9811('0x3')](_0x4c72c4,_0x42c83);};}function removeListener(_0x30d91b,_0xce1d39){return function(){MailMessageEvents[_0x9811('0x4')](_0x30d91b,_0xce1d39);};}exports[_0x9811('0x5')]=function(_0x1ca7f0){for(var _0x5217f6=0x0,_0x92a712=events[_0x9811('0x6')];_0x5217f6<_0x92a712;_0x5217f6++){var _0x32fd4b=events[_0x5217f6];var _0x18fde9=createListener(_0x9811('0x7')+_0x32fd4b,_0x1ca7f0);MailMessageEvents['on'](_0x32fd4b,_0x18fde9);}}; \ No newline at end of file diff --git a/server/api/mailQueue/index.js b/server/api/mailQueue/index.js index 48bdd14..b66848c 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 _0x1643=['getTeams','/:id/users','getAgents','post','addTeams','addAgents','delete','/:id','destroy','removeTeams','exports','multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailQueue.controller','isAuthenticated','index','get','/describe','describe','show','/:id/members','getMembers','/:id/teams'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x1643,0x7f));var _0x3164=function(_0x491e02,_0x242b05){_0x491e02=_0x491e02-0x0;var _0xebdc4=_0x1643[_0x491e02];return _0xebdc4;};'use strict';var multer=require(_0x3164('0x0'));var util=require(_0x3164('0x1'));var path=require('path');var timeout=require(_0x3164('0x2'));var express=require('express');var router=express[_0x3164('0x3')]();var fs_extra=require(_0x3164('0x4'));var auth=require(_0x3164('0x5'));var interaction=require(_0x3164('0x6'));var config=require(_0x3164('0x7'));var controller=require(_0x3164('0x8'));router['get']('/',auth[_0x3164('0x9')](),controller[_0x3164('0xa')]);router[_0x3164('0xb')](_0x3164('0xc'),auth[_0x3164('0x9')](),controller[_0x3164('0xd')]);router[_0x3164('0xb')]('/:id',auth[_0x3164('0x9')](),controller[_0x3164('0xe')]);router[_0x3164('0xb')](_0x3164('0xf'),auth[_0x3164('0x9')](),controller[_0x3164('0x10')]);router['get'](_0x3164('0x11'),auth[_0x3164('0x9')](),controller[_0x3164('0x12')]);router[_0x3164('0xb')](_0x3164('0x13'),auth[_0x3164('0x9')](),controller[_0x3164('0x14')]);router[_0x3164('0x15')]('/',auth['isAuthenticated'](),controller['create']);router['post'](_0x3164('0x11'),auth[_0x3164('0x9')](),controller[_0x3164('0x16')]);router['post'](_0x3164('0x13'),auth[_0x3164('0x9')](),controller[_0x3164('0x17')]);router['put']('/:id',auth['isAuthenticated'](),controller['update']);router[_0x3164('0x18')](_0x3164('0x19'),auth[_0x3164('0x9')](),controller[_0x3164('0x1a')]);router[_0x3164('0x18')](_0x3164('0x11'),auth[_0x3164('0x9')](),controller[_0x3164('0x1b')]);router[_0x3164('0x18')](_0x3164('0x13'),auth['isAuthenticated'](),controller['removeAgents']);module[_0x3164('0x1c')]=router; \ No newline at end of file +var _0xbb97=['./mailQueue.controller','isAuthenticated','index','get','/describe','describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','getAgents','create','post','addTeams','/:id/users','put','update','delete','destroy','removeTeams','removeAgents','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment'];(function(_0x4eddf7,_0x3cbdbd){var _0x22e324=function(_0x383ce1){while(--_0x383ce1){_0x4eddf7['push'](_0x4eddf7['shift']());}};_0x22e324(++_0x3cbdbd);}(_0xbb97,0x1d8));var _0x7bb9=function(_0x546bd9,_0x14baf3){_0x546bd9=_0x546bd9-0x0;var _0xa7421b=_0xbb97[_0x546bd9];return _0xa7421b;};'use strict';var multer=require(_0x7bb9('0x0'));var util=require(_0x7bb9('0x1'));var path=require(_0x7bb9('0x2'));var timeout=require(_0x7bb9('0x3'));var express=require('express');var router=express[_0x7bb9('0x4')]();var fs_extra=require(_0x7bb9('0x5'));var auth=require(_0x7bb9('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x7bb9('0x7'));var controller=require(_0x7bb9('0x8'));router['get']('/',auth[_0x7bb9('0x9')](),controller[_0x7bb9('0xa')]);router[_0x7bb9('0xb')](_0x7bb9('0xc'),auth[_0x7bb9('0x9')](),controller[_0x7bb9('0xd')]);router[_0x7bb9('0xb')](_0x7bb9('0xe'),auth['isAuthenticated'](),controller[_0x7bb9('0xf')]);router[_0x7bb9('0xb')](_0x7bb9('0x10'),auth[_0x7bb9('0x9')](),controller[_0x7bb9('0x11')]);router['get'](_0x7bb9('0x12'),auth[_0x7bb9('0x9')](),controller[_0x7bb9('0x13')]);router[_0x7bb9('0xb')]('/:id/users',auth[_0x7bb9('0x9')](),controller[_0x7bb9('0x14')]);router['post']('/',auth['isAuthenticated'](),controller[_0x7bb9('0x15')]);router[_0x7bb9('0x16')](_0x7bb9('0x12'),auth[_0x7bb9('0x9')](),controller[_0x7bb9('0x17')]);router[_0x7bb9('0x16')](_0x7bb9('0x18'),auth[_0x7bb9('0x9')](),controller['addAgents']);router[_0x7bb9('0x19')](_0x7bb9('0xe'),auth['isAuthenticated'](),controller[_0x7bb9('0x1a')]);router[_0x7bb9('0x1b')](_0x7bb9('0xe'),auth[_0x7bb9('0x9')](),controller[_0x7bb9('0x1c')]);router[_0x7bb9('0x1b')](_0x7bb9('0x12'),auth[_0x7bb9('0x9')](),controller[_0x7bb9('0x1d')]);router[_0x7bb9('0x1b')](_0x7bb9('0x18'),auth[_0x7bb9('0x9')](),controller[_0x7bb9('0x1e')]);module[_0x7bb9('0x1f')]=router; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.attributes.js b/server/api/mailQueue/mailQueue.attributes.js index 8110ae7..b952650 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 _0x7caa=['beepall','roundrobin','exports','STRING','name','INTEGER','ENUM','rrmemory'];(function(_0x538ffd,_0x145008){var _0x5b5aaa=function(_0x2ed3f3){while(--_0x2ed3f3){_0x538ffd['push'](_0x538ffd['shift']());}};_0x5b5aaa(++_0x145008);}(_0x7caa,0x8a));var _0xa7ca=function(_0x47185f,_0x172017){_0x47185f=_0x47185f-0x0;var _0x1fa0e1=_0x7caa[_0x47185f];return _0x1fa0e1;};'use strict';var Sequelize=require('sequelize');module[_0xa7ca('0x0')]={'name':{'type':Sequelize[_0xa7ca('0x1')],'unique':_0xa7ca('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xa7ca('0x1')]},'timeout':{'type':Sequelize[_0xa7ca('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xa7ca('0x4')](_0xa7ca('0x5'),_0xa7ca('0x6'),_0xa7ca('0x7'))}}; \ No newline at end of file +var _0xe274=['STRING','name','INTEGER','ENUM','rrmemory','sequelize','exports'];(function(_0x39d39d,_0x5586bd){var _0x577ac3=function(_0x12f9f2){while(--_0x12f9f2){_0x39d39d['push'](_0x39d39d['shift']());}};_0x577ac3(++_0x5586bd);}(_0xe274,0x1e1));var _0x4e27=function(_0x2040de,_0x22fcf0){_0x2040de=_0x2040de-0x0;var _0x1a2128=_0xe274[_0x2040de];return _0x1a2128;};'use strict';var Sequelize=require(_0x4e27('0x0'));module[_0x4e27('0x1')]={'name':{'type':Sequelize[_0x4e27('0x2')],'unique':_0x4e27('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x4e27('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x4e27('0x5')](_0x4e27('0x6'),'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 3d3bc17..168011c 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 _0x3246=['user_has_teams','MailQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','sequelize','QueryTypes','SELECT','every','TeamId','includes','all','union','compact','value','removeTeams','removeAgents','addAgents','omit','spread','isArray','userMailQueue:remove','getAgents','eml-format','rimraf','zip-dir','moment','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','end','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','MailQueues','UserProfileResource','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','MailQueue','includeAll','include','rows','catch','show','find','create','body','user','get','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','findOne','UserMailQueue','nolimit','User','UserId','agent','updatedAt','%s/%s','SIP','mailPause','createdAt','Team','getTeams','ids','findAll','voicePause','interface','flatMap','Agents','transaction','addTeams','each','findOrCreate','forEach','emit','userMailQueue:save','select','tq.TeamId','from','join'];(function(_0x4aa74b,_0x3a83e7){var _0xfb1420=function(_0x208b17){while(--_0x208b17){_0x4aa74b['push'](_0x4aa74b['shift']());}};_0xfb1420(++_0x3a83e7);}(_0x3246,0x1ce));var _0x6324=function(_0x54b0e1,_0x2dfabe){_0x54b0e1=_0x54b0e1-0x0;var _0x5dff02=_0x3246[_0x54b0e1];return _0x5dff02;};'use strict';var emlformat=require(_0x6324('0x0'));var rimraf=require(_0x6324('0x1'));var zipdir=require(_0x6324('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x6324('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x6324('0x4'));var path=require(_0x6324('0x5'));var sox=require(_0x6324('0x6'));var csv=require(_0x6324('0x7'));var ejs=require(_0x6324('0x8'));var fs=require('fs');var fs_extra=require(_0x6324('0x9'));var _=require(_0x6324('0xa'));var squel=require(_0x6324('0xb'));var crypto=require(_0x6324('0xc'));var jsforce=require(_0x6324('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x6324('0xe'));var Papa=require(_0x6324('0xf'));var Redis=require('ioredis');var authService=require(_0x6324('0x10'));var qs=require(_0x6324('0x11'));var as=require(_0x6324('0x12'));var hardwareService=require(_0x6324('0x13'));var logger=require(_0x6324('0x14'))(_0x6324('0x15'));var utils=require(_0x6324('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x6324('0x17'));var db=require(_0x6324('0x18'))['db'];config[_0x6324('0x19')]=_[_0x6324('0x1a')](config[_0x6324('0x19')],{'host':_0x6324('0x1b'),'port':0x18eb});var socket=require(_0x6324('0x1c'))(new Redis(config['redis']));require('./mailQueue.socket')[_0x6324('0x1d')](socket);function respondWithStatusCode(_0x9c71be,_0x13b0a4){_0x13b0a4=_0x13b0a4||0xcc;return function(_0x4afa27){if(_0x4afa27){return _0x9c71be[_0x6324('0x1e')](_0x13b0a4);}return _0x9c71be[_0x6324('0x1f')](_0x13b0a4)[_0x6324('0x20')]();};}function respondWithResult(_0x5d9b52,_0x4386d4){_0x4386d4=_0x4386d4||0xc8;return function(_0x270b1c){if(_0x270b1c){return _0x5d9b52['status'](_0x4386d4)['json'](_0x270b1c);}};}function respondWithFilteredResult(_0x5593dc,_0x7f1ddd){return function(_0x3c2d7a){if(_0x3c2d7a){var _0x42b1f2=typeof _0x7f1ddd['offset']===_0x6324('0x21')&&typeof _0x7f1ddd[_0x6324('0x22')]===_0x6324('0x21');var _0x4989d1=_0x3c2d7a[_0x6324('0x23')];var _0x2fdbde=_0x42b1f2?0x0:_0x7f1ddd[_0x6324('0x24')];var _0x522f2c=_0x42b1f2?_0x3c2d7a[_0x6324('0x23')]:_0x7f1ddd[_0x6324('0x24')]+_0x7f1ddd[_0x6324('0x22')];var _0x3cd0af;if(_0x522f2c>=_0x4989d1){_0x522f2c=_0x4989d1;_0x3cd0af=0xc8;}else{_0x3cd0af=0xce;}_0x5593dc['status'](_0x3cd0af);return _0x5593dc[_0x6324('0x25')](_0x6324('0x26'),_0x2fdbde+'-'+_0x522f2c+'/'+_0x4989d1)['json'](_0x3c2d7a);}return null;};}function patchUpdates(_0x28c22d){return function(_0x1370aa){try{jsonpatch[_0x6324('0x27')](_0x1370aa,_0x28c22d,!![]);}catch(_0x328404){return BPromise[_0x6324('0x28')](_0x328404);}return _0x1370aa[_0x6324('0x29')]();};}function saveUpdates(_0x4c4db1,_0x422cc3){return function(_0x132b22){if(_0x132b22){return _0x132b22[_0x6324('0x2a')](_0x4c4db1)[_0x6324('0x2b')](function(_0x309807){return _0x309807;});}return null;};}function removeEntity(_0x1ce95e,_0x8069f6){return function(_0x2efc6f){if(_0x2efc6f){return _0x2efc6f[_0x6324('0x2c')]()[_0x6324('0x2b')](function(){var _0x470cec=_0x2efc6f['get']({'plain':!![]});var _0x46a2fd=_0x6324('0x2d');return db[_0x6324('0x2e')][_0x6324('0x2c')]({'where':{'type':_0x46a2fd,'resourceId':_0x470cec['id']}})['then'](function(){return _0x2efc6f;});})[_0x6324('0x2b')](function(){_0x1ce95e[_0x6324('0x1f')](0xcc)[_0x6324('0x20')]();});}};}function handleEntityNotFound(_0x4aa266,_0x2c6c3a){return function(_0x3e78af){if(!_0x3e78af){_0x4aa266[_0x6324('0x1e')](0x194);}return _0x3e78af;};}function handleError(_0x53b084,_0x17b54f){_0x17b54f=_0x17b54f||0x1f4;return function(_0xbde455){logger[_0x6324('0x2f')](_0xbde455[_0x6324('0x30')]);if(_0xbde455[_0x6324('0x31')]){delete _0xbde455[_0x6324('0x31')];}_0x53b084[_0x6324('0x1f')](_0x17b54f)[_0x6324('0x32')](_0xbde455);};}exports[_0x6324('0x33')]=function(_0x5b956f,_0x2bf94b){var _0x3cd98b={},_0x4b7cf0={},_0x53d6cd={'count':0x0,'rows':[]};var _0x2d9c85=_[_0x6324('0x34')](db['MailQueue'][_0x6324('0x35')],function(_0x4fb907){return{'name':_0x4fb907[_0x6324('0x36')],'type':_0x4fb907[_0x6324('0x37')][_0x6324('0x38')]};});_0x4b7cf0[_0x6324('0x39')]=_[_0x6324('0x34')](_0x2d9c85,_0x6324('0x31'));_0x4b7cf0[_0x6324('0x3a')]=_[_0x6324('0x3b')](_0x5b956f[_0x6324('0x3a')]);_0x4b7cf0[_0x6324('0x3c')]=_[_0x6324('0x3d')](_0x4b7cf0['model'],_0x4b7cf0[_0x6324('0x3a')]);_0x3cd98b[_0x6324('0x3e')]=_['intersection'](_0x4b7cf0['model'],qs['fields'](_0x5b956f[_0x6324('0x3a')][_0x6324('0x3f')]));_0x3cd98b[_0x6324('0x3e')]=_0x3cd98b[_0x6324('0x3e')][_0x6324('0x40')]?_0x3cd98b[_0x6324('0x3e')]:_0x4b7cf0[_0x6324('0x39')];if(!_0x5b956f['query'][_0x6324('0x41')]('nolimit')){_0x3cd98b[_0x6324('0x22')]=qs[_0x6324('0x22')](_0x5b956f[_0x6324('0x3a')][_0x6324('0x22')]);_0x3cd98b[_0x6324('0x24')]=qs[_0x6324('0x24')](_0x5b956f[_0x6324('0x3a')][_0x6324('0x24')]);}_0x3cd98b[_0x6324('0x42')]=qs['sort'](_0x5b956f[_0x6324('0x3a')][_0x6324('0x43')]);_0x3cd98b[_0x6324('0x44')]=qs['filters'](_[_0x6324('0x45')](_0x5b956f[_0x6324('0x3a')],_0x4b7cf0['filters']),_0x2d9c85);if(_0x5b956f[_0x6324('0x3a')][_0x6324('0x46')]){_0x3cd98b[_0x6324('0x44')]=_[_0x6324('0x47')](_0x3cd98b[_0x6324('0x44')],{'$or':_['map'](_0x2d9c85,function(_0x49fac0){if(_0x49fac0[_0x6324('0x37')]!==_0x6324('0x48')){var _0x49799a={};_0x49799a[_0x49fac0['name']]={'$like':'%'+_0x5b956f[_0x6324('0x3a')][_0x6324('0x46')]+'%'};return _0x49799a;}})});}_0x3cd98b=_[_0x6324('0x47')]({},_0x3cd98b,_0x5b956f[_0x6324('0x49')]);var _0x2263d7={'where':_0x3cd98b[_0x6324('0x44')]};return db[_0x6324('0x4a')][_0x6324('0x23')](_0x2263d7)[_0x6324('0x2b')](function(_0x39dd53){_0x53d6cd['count']=_0x39dd53;if(_0x5b956f[_0x6324('0x3a')][_0x6324('0x4b')]){_0x3cd98b[_0x6324('0x4c')]=[{'all':!![]}];}return db[_0x6324('0x4a')]['findAll'](_0x3cd98b);})[_0x6324('0x2b')](function(_0xced61a){_0x53d6cd[_0x6324('0x4d')]=_0xced61a;return _0x53d6cd;})[_0x6324('0x2b')](respondWithFilteredResult(_0x2bf94b,_0x3cd98b))[_0x6324('0x4e')](handleError(_0x2bf94b,null));};exports[_0x6324('0x4f')]=function(_0x11d8e7,_0x16ab49){var _0x1dc594={'raw':!![],'where':{'id':_0x11d8e7['params']['id']}},_0x2e9d26={};_0x2e9d26[_0x6324('0x39')]=_[_0x6324('0x3b')](db[_0x6324('0x4a')][_0x6324('0x35')]);_0x2e9d26[_0x6324('0x3a')]=_[_0x6324('0x3b')](_0x11d8e7[_0x6324('0x3a')]);_0x2e9d26[_0x6324('0x3c')]=_[_0x6324('0x3d')](_0x2e9d26[_0x6324('0x39')],_0x2e9d26[_0x6324('0x3a')]);_0x1dc594[_0x6324('0x3e')]=_[_0x6324('0x3d')](_0x2e9d26[_0x6324('0x39')],qs['fields'](_0x11d8e7['query'][_0x6324('0x3f')]));_0x1dc594[_0x6324('0x3e')]=_0x1dc594[_0x6324('0x3e')]['length']?_0x1dc594[_0x6324('0x3e')]:_0x2e9d26['model'];if(_0x11d8e7[_0x6324('0x3a')]['includeAll']){_0x1dc594[_0x6324('0x4c')]=[{'all':!![]}];}_0x1dc594=_[_0x6324('0x47')]({},_0x1dc594,_0x11d8e7[_0x6324('0x49')]);return db['MailQueue'][_0x6324('0x50')](_0x1dc594)['then'](handleEntityNotFound(_0x16ab49,null))['then'](respondWithResult(_0x16ab49,null))[_0x6324('0x4e')](handleError(_0x16ab49,null));};exports[_0x6324('0x51')]=function(_0x5a0f2a,_0x187b34){return db['MailQueue'][_0x6324('0x51')](_0x5a0f2a[_0x6324('0x52')],{})[_0x6324('0x2b')](function(_0x58373b){var _0x2e2f9b=_0x5a0f2a[_0x6324('0x53')][_0x6324('0x54')]({'plain':!![]});if(!_0x2e2f9b)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2e2f9b[_0x6324('0x55')]===_0x6324('0x53')){var _0x2f720c=_0x58373b[_0x6324('0x54')]({'plain':!![]});var _0x4daf1d='MailQueues';return db[_0x6324('0x56')][_0x6324('0x50')]({'where':{'name':_0x4daf1d,'userProfileId':_0x2e2f9b[_0x6324('0x57')]},'raw':!![]})[_0x6324('0x2b')](function(_0x1299d0){if(_0x1299d0&&_0x1299d0[_0x6324('0x58')]===0x0){return db[_0x6324('0x2e')]['create']({'name':_0x2f720c[_0x6324('0x31')],'resourceId':_0x2f720c['id'],'type':_0x1299d0['name'],'sectionId':_0x1299d0['id']},{})['then'](function(){return _0x58373b;});}else{return _0x58373b;}})[_0x6324('0x4e')](function(_0x5255b4){logger['error'](_0x6324('0x59'),_0x5255b4);throw _0x5255b4;});}return _0x58373b;})[_0x6324('0x2b')](respondWithResult(_0x187b34,0xc9))[_0x6324('0x4e')](handleError(_0x187b34,null));};exports[_0x6324('0x2a')]=function(_0x571abd,_0x4c7cf4){if(_0x571abd[_0x6324('0x52')]['id']){delete _0x571abd[_0x6324('0x52')]['id'];}return db[_0x6324('0x4a')][_0x6324('0x50')]({'where':{'id':_0x571abd[_0x6324('0x5a')]['id']}})[_0x6324('0x2b')](handleEntityNotFound(_0x4c7cf4,null))[_0x6324('0x2b')](saveUpdates(_0x571abd[_0x6324('0x52')],null))[_0x6324('0x2b')](respondWithResult(_0x4c7cf4,null))[_0x6324('0x4e')](handleError(_0x4c7cf4,null));};exports[_0x6324('0x2c')]=function(_0x4f8ddd,_0x997631){return db[_0x6324('0x4a')][_0x6324('0x50')]({'where':{'id':_0x4f8ddd[_0x6324('0x5a')]['id']}})[_0x6324('0x2b')](handleEntityNotFound(_0x997631,null))[_0x6324('0x2b')](removeEntity(_0x997631,null))[_0x6324('0x4e')](handleError(_0x997631,null));};exports[_0x6324('0x5b')]=function(_0x2c76b5,_0x4c4e11){return db[_0x6324('0x4a')][_0x6324('0x5b')]()[_0x6324('0x2b')](respondWithResult(_0x4c4e11,null))[_0x6324('0x4e')](handleError(_0x4c4e11,null));};exports['getMembers']=function(_0x597c57,_0xd04aaa,_0x2a5771){var _0x393590={'raw':!![],'where':{}},_0x94e256={},_0x197b42;return db[_0x6324('0x4a')][_0x6324('0x5c')]({'where':{'id':_0x597c57['params']['id']}})[_0x6324('0x2b')](handleEntityNotFound(_0xd04aaa,null))[_0x6324('0x2b')](function(_0x357bbd){if(_0x357bbd){_0x197b42=_0x357bbd[_0x6324('0x54')]({'plain':!![]});_0x94e256['model']=_[_0x6324('0x3b')](db[_0x6324('0x5d')][_0x6324('0x35')]);_0x94e256[_0x6324('0x3a')]=_[_0x6324('0x3b')](_0x597c57[_0x6324('0x3a')]);_0x94e256['filters']=_['intersection'](_0x94e256['model'],_0x94e256[_0x6324('0x3a')]);_0x393590[_0x6324('0x3e')]=_[_0x6324('0x3d')](_0x94e256[_0x6324('0x39')],qs['fields'](_0x597c57[_0x6324('0x3a')]['fields']));_0x393590[_0x6324('0x3e')]=_0x393590[_0x6324('0x3e')]['length']?_0x393590[_0x6324('0x3e')]:_0x94e256[_0x6324('0x39')];if(!_0x597c57[_0x6324('0x3a')][_0x6324('0x41')](_0x6324('0x5e'))){_0x393590[_0x6324('0x22')]=qs[_0x6324('0x22')](_0x597c57[_0x6324('0x3a')][_0x6324('0x22')]);_0x393590[_0x6324('0x24')]=qs[_0x6324('0x24')](_0x597c57[_0x6324('0x3a')][_0x6324('0x24')]);}_0x393590[_0x6324('0x42')]=qs['sort'](_0x597c57[_0x6324('0x3a')][_0x6324('0x43')]);_0x393590[_0x6324('0x44')]=qs['filters'](_['pick'](_0x597c57[_0x6324('0x3a')],_0x94e256['filters']));_0x393590[_0x6324('0x44')]['MailQueueId']=_0x357bbd['id'];if(_0x597c57[_0x6324('0x3a')][_0x6324('0x46')]){_0x393590['where']=_[_0x6324('0x47')](_0x393590['where'],{'$or':_[_0x6324('0x34')](_0x393590['attributes'],function(_0x32332f){var _0x44f137={};_0x44f137[_0x32332f]={'$like':'%'+_0x597c57['query']['filter']+'%'};return _0x44f137;})});}_0x393590=_['merge']({},_0x393590,_0x597c57['options']);return db[_0x6324('0x5d')]['findAll'](_0x393590);}})['then'](function(_0x263add){if(_0x263add){return db[_0x6324('0x5f')]['findAndCountAll']({'where':{'id':_[_0x6324('0x34')](_0x263add,_0x6324('0x60')),'role':_0x6324('0x61')},'attributes':['id',_0x6324('0x31'),'mailPause',_0x6324('0x62'),'createdAt']});}})[_0x6324('0x2b')](function(_0x3d8449){if(_0x3d8449){return{'count':_0x3d8449['count'],'rows':_['map'](_0x3d8449[_0x6324('0x4d')],function(_0x5750de){return{'membername':_0x5750de[_0x6324('0x31')],'UserId':_0x5750de['id'],'queue_name':_0x197b42['name'],'MailQueueId':_0x197b42['id'],'interface':util['format'](_0x6324('0x63'),_0x6324('0x64'),_0x5750de[_0x6324('0x31')]),'penalty':0x0,'paused':_0x5750de[_0x6324('0x65')],'createdAt':_0x5750de[_0x6324('0x66')],'updatedAt':_0x5750de['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0xd04aaa,_0x393590))['catch'](handleError(_0xd04aaa,null));};exports['getTeams']=function(_0x479411,_0x556de5,_0x29b940){var _0x56dbf2={};var _0x4359b0={};var _0x55072c;var _0xfdf5f9;return db[_0x6324('0x4a')][_0x6324('0x5c')]({'where':{'id':_0x479411[_0x6324('0x5a')]['id']}})[_0x6324('0x2b')](handleEntityNotFound(_0x556de5,null))[_0x6324('0x2b')](function(_0x6e55de){if(_0x6e55de){_0x55072c=_0x6e55de;_0x4359b0[_0x6324('0x39')]=_[_0x6324('0x3b')](db[_0x6324('0x67')][_0x6324('0x35')]);_0x4359b0['query']=_[_0x6324('0x3b')](_0x479411[_0x6324('0x3a')]);_0x4359b0[_0x6324('0x3c')]=_['intersection'](_0x4359b0[_0x6324('0x39')],_0x4359b0['query']);_0x56dbf2[_0x6324('0x3e')]=_[_0x6324('0x3d')](_0x4359b0[_0x6324('0x39')],qs[_0x6324('0x3f')](_0x479411[_0x6324('0x3a')]['fields']));_0x56dbf2['attributes']=_0x56dbf2[_0x6324('0x3e')][_0x6324('0x40')]?_0x56dbf2[_0x6324('0x3e')]:_0x4359b0[_0x6324('0x39')];_0x56dbf2[_0x6324('0x42')]=qs[_0x6324('0x43')](_0x479411[_0x6324('0x3a')][_0x6324('0x43')]);_0x56dbf2[_0x6324('0x44')]=qs[_0x6324('0x3c')](_[_0x6324('0x45')](_0x479411[_0x6324('0x3a')],_0x4359b0[_0x6324('0x3c')]));if(_0x479411[_0x6324('0x3a')][_0x6324('0x46')]){_0x56dbf2['where']=_[_0x6324('0x47')](_0x56dbf2[_0x6324('0x44')],{'$or':_[_0x6324('0x34')](_0x56dbf2[_0x6324('0x3e')],function(_0xdd2707){var _0x50f002={};_0x50f002[_0xdd2707]={'$like':'%'+_0x479411[_0x6324('0x3a')][_0x6324('0x46')]+'%'};return _0x50f002;})});}_0x56dbf2=_['merge']({},_0x56dbf2,_0x479411[_0x6324('0x49')]);return _0x55072c[_0x6324('0x68')](_0x56dbf2);}})[_0x6324('0x2b')](function(_0x24866c){if(_0x24866c){_0xfdf5f9=_0x24866c['length'];if(!_0x479411[_0x6324('0x3a')][_0x6324('0x41')](_0x6324('0x5e'))){_0x56dbf2[_0x6324('0x22')]=qs[_0x6324('0x22')](_0x479411[_0x6324('0x3a')][_0x6324('0x22')]);_0x56dbf2[_0x6324('0x24')]=qs[_0x6324('0x24')](_0x479411[_0x6324('0x3a')][_0x6324('0x24')]);}return _0x55072c[_0x6324('0x68')](_0x56dbf2);}})[_0x6324('0x2b')](function(_0x546dad){if(_0x546dad){return _0x546dad?{'count':_0xfdf5f9,'rows':_0x546dad}:null;}})[_0x6324('0x2b')](respondWithResult(_0x556de5,null))[_0x6324('0x4e')](handleError(_0x556de5,null));};exports['addTeams']=function(_0x212831,_0x325165,_0x326169){var _0x3d8c54=_0x212831[_0x6324('0x52')][_0x6324('0x69')];return db[_0x6324('0x67')][_0x6324('0x6a')]({'where':{'id':_0x3d8c54},'attributes':['id'],'include':[{'model':db[_0x6324('0x5f')],'as':'Agents','attributes':['id',_0x6324('0x31'),'online',_0x6324('0x6b'),_0x6324('0x6c')],'raw':!![]}]})['then'](function(_0x5a767f){if(_0x5a767f){var _0x4809ae=_[_0x6324('0x6d')](_0x5a767f,function(_0x344fb1){var _0x175ed7=_0x344fb1[_0x6324('0x54')]({'plain':!![]});return _0x175ed7[_0x6324('0x6e')];});return db[_0x6324('0x4a')][_0x6324('0x50')]({'where':{'id':_0x212831[_0x6324('0x5a')]['id']}})[_0x6324('0x2b')](function(_0xa2140a){return db['sequelize'][_0x6324('0x6f')](function(_0x54264c){return _0xa2140a[_0x6324('0x70')](_0x3d8c54,{'transaction':_0x54264c})[_0x6324('0x2b')](function(){return BPromise[_0x6324('0x71')](_0x4809ae,function(_0x13a913){return db[_0x6324('0x5d')][_0x6324('0x72')]({'where':{'UserId':_0x13a913['id'],'MailQueueId':_0x212831[_0x6324('0x5a')]['id']},'transaction':_0x54264c});});})[_0x6324('0x2b')](function(){_0x4809ae[_0x6324('0x73')](function(_0x1a1898){socket[_0x6324('0x74')](_0x6324('0x75'),{'UserId':_0x1a1898['id'],'MailQueueId':_0xa2140a['id']});});});});});}})[_0x6324('0x2b')](respondWithStatusCode(_0x325165,null))[_0x6324('0x4e')](handleError(_0x325165,null));};exports['removeTeams']=function(_0x2d85fc,_0x33b893,_0x1f0bbf){return db['Team'][_0x6324('0x6a')]({'where':{'id':_0x2d85fc[_0x6324('0x3a')][_0x6324('0x69')]},'attributes':['id'],'include':[{'model':db[_0x6324('0x5f')],'as':_0x6324('0x6e'),'attributes':['id'],'raw':!![]}]})[_0x6324('0x2b')](handleEntityNotFound(_0x33b893,null))[_0x6324('0x2b')](function(_0x233a53){var _0x160742=_[_0x6324('0x34')](_0x233a53,'id');var _0x5f226c=[];var _0x331f37=[];var _0x14171a=squel[_0x6324('0x76')]();_0x14171a['field'](_0x6324('0x77'))[_0x6324('0x78')]('team_has_mail_queues','tq')[_0x6324('0x79')](_0x6324('0x7a'),'ut','ut.TeamId\x20=\x20tq.TeamId')['where'](_0x6324('0x7b'),_0x2d85fc[_0x6324('0x5a')]['id']);for(var _0x576080=0x0;_0x576080<_0x233a53[_0x6324('0x40')];_0x576080+=0x1){let _0x1f749e=_0x233a53[_0x576080];for(var _0x3ad934=0x0;_0x3ad934<_0x1f749e[_0x6324('0x6e')][_0x6324('0x40')];_0x3ad934+=0x1){let _0x5b69cb=_0x1f749e[_0x6324('0x6e')][_0x3ad934];var _0x175f4b=_0x14171a[_0x6324('0x7c')]();_0x175f4b[_0x6324('0x44')](_0x6324('0x7d'),_0x5b69cb['id']);_0x331f37[_0x6324('0x7e')](db['sequelize'][_0x6324('0x3a')](_0x175f4b[_0x6324('0x7f')](),{'type':db[_0x6324('0x80')][_0x6324('0x81')][_0x6324('0x82')]})[_0x6324('0x2b')](function(_0x30569a){if(_0x30569a['length']===0x1){return _0x5b69cb['id'];}else{var _0x194c5e=_[_0x6324('0x83')](_[_0x6324('0x34')](_0x30569a,_0x6324('0x84')),function(_0x51c1bf){return _[_0x6324('0x85')](_0x160742,_0x51c1bf);});if(_0x194c5e){return _0x5b69cb['id'];}}}));}}return BPromise[_0x6324('0x86')](_0x331f37)[_0x6324('0x2b')](function(_0x57b87a){_0x5f226c=_(_0x5f226c)[_0x6324('0x87')](_0x57b87a)[_0x6324('0x88')]()[_0x6324('0x89')]();return db['MailQueue'][_0x6324('0x50')]({'where':{'id':_0x2d85fc['params']['id']}})[_0x6324('0x2b')](function(_0x207ac6){return db['sequelize'][_0x6324('0x6f')](function(_0x58d06a){return _0x207ac6[_0x6324('0x8a')](_0x2d85fc[_0x6324('0x3a')][_0x6324('0x69')],{'transaction':_0x58d06a})[_0x6324('0x2b')](function(){if(!_['isEmpty'](_0x5f226c)){return _0x207ac6[_0x6324('0x8b')](_0x5f226c,{'transaction':_0x58d06a});}})[_0x6324('0x2b')](function(){_0x5f226c[_0x6324('0x73')](function(_0x115674){socket['emit']('userMailQueue:remove',{'UserId':_0x115674,'MailQueueId':_0x207ac6['id']});});});});});});})[_0x6324('0x2b')](respondWithStatusCode(_0x33b893,null))['catch'](handleError(_0x33b893,null));};exports[_0x6324('0x8c')]=function(_0x545cbf,_0xd123b8,_0x480126){return db[_0x6324('0x4a')][_0x6324('0x50')]({'where':{'id':_0x545cbf[_0x6324('0x5a')]['id']}})['then'](handleEntityNotFound(_0xd123b8,null))[_0x6324('0x2b')](function(_0x4a29b3){if(_0x4a29b3){return _0x4a29b3['addAgents'](_0x545cbf[_0x6324('0x52')]['ids'],_[_0x6324('0x8d')](_0x545cbf[_0x6324('0x52')],['ids','id'])||{})[_0x6324('0x8e')](function(_0x271190){for(var _0x56701=0x0;_0x56701<_0x545cbf[_0x6324('0x52')][_0x6324('0x69')][_0x6324('0x40')];_0x56701+=0x1){socket[_0x6324('0x74')](_0x6324('0x75'),{'UserId':Number(_0x545cbf['body'][_0x6324('0x69')][_0x56701]),'MailQueueId':Number(_0x545cbf[_0x6324('0x5a')]['id'])});}return _0x271190;});}})[_0x6324('0x2b')](respondWithResult(_0xd123b8,null))['catch'](handleError(_0xd123b8,null));};exports[_0x6324('0x8b')]=function(_0x57fa62,_0x4a1acb,_0x5e0c51){return db[_0x6324('0x4a')][_0x6324('0x50')]({'where':{'id':_0x57fa62[_0x6324('0x5a')]['id']}})[_0x6324('0x2b')](handleEntityNotFound(_0x4a1acb,null))[_0x6324('0x2b')](function(_0x590513){if(_0x590513){return _0x590513[_0x6324('0x8b')](_0x57fa62['query']['ids'])['then'](function(){if(_[_0x6324('0x8f')](_0x57fa62[_0x6324('0x3a')][_0x6324('0x69')])){for(var _0xed5784=0x0;_0xed5784<_0x57fa62[_0x6324('0x3a')]['ids'][_0x6324('0x40')];_0xed5784+=0x1){socket['emit'](_0x6324('0x90'),{'UserId':Number(_0x57fa62[_0x6324('0x3a')][_0x6324('0x69')][_0xed5784]),'MailQueueId':Number(_0x57fa62[_0x6324('0x5a')]['id'])});}}else{socket[_0x6324('0x74')](_0x6324('0x90'),{'UserId':Number(_0x57fa62[_0x6324('0x3a')][_0x6324('0x69')]),'MailQueueId':Number(_0x57fa62['params']['id'])});}});}})[_0x6324('0x2b')](respondWithStatusCode(_0x4a1acb,null))[_0x6324('0x4e')](handleError(_0x4a1acb,null));};exports[_0x6324('0x91')]=function(_0x1bb931,_0x3400e8,_0x5c2018){var _0xe579ce={};var _0x2ffcf0={};var _0x1a91c0;var _0x57cc6b;return db['MailQueue'][_0x6324('0x5c')]({'where':{'id':_0x1bb931[_0x6324('0x5a')]['id']}})[_0x6324('0x2b')](handleEntityNotFound(_0x3400e8,null))[_0x6324('0x2b')](function(_0x33d2f8){if(_0x33d2f8){_0x1a91c0=_0x33d2f8;_0x2ffcf0['model']=_[_0x6324('0x3b')](db[_0x6324('0x5f')][_0x6324('0x35')]);_0x2ffcf0[_0x6324('0x3a')]=_[_0x6324('0x3b')](_0x1bb931['query']);_0x2ffcf0['filters']=_[_0x6324('0x3d')](_0x2ffcf0[_0x6324('0x39')],_0x2ffcf0[_0x6324('0x3a')]);_0xe579ce[_0x6324('0x3e')]=_['intersection'](_0x2ffcf0[_0x6324('0x39')],qs[_0x6324('0x3f')](_0x1bb931['query'][_0x6324('0x3f')]));_0xe579ce[_0x6324('0x3e')]=_0xe579ce[_0x6324('0x3e')][_0x6324('0x40')]?_0xe579ce[_0x6324('0x3e')]:_0x2ffcf0[_0x6324('0x39')];_0xe579ce[_0x6324('0x42')]=qs[_0x6324('0x43')](_0x1bb931['query'][_0x6324('0x43')]);_0xe579ce[_0x6324('0x44')]=qs[_0x6324('0x3c')](_[_0x6324('0x45')](_0x1bb931[_0x6324('0x3a')],_0x2ffcf0[_0x6324('0x3c')]));if(_0x1bb931[_0x6324('0x3a')][_0x6324('0x46')]){_0xe579ce[_0x6324('0x44')]=_[_0x6324('0x47')](_0xe579ce[_0x6324('0x44')],{'$or':_[_0x6324('0x34')](_0xe579ce[_0x6324('0x3e')],function(_0x5486f2){var _0x5056f8={};_0x5056f8[_0x5486f2]={'$like':'%'+_0x1bb931['query'][_0x6324('0x46')]+'%'};return _0x5056f8;})});}_0xe579ce=_[_0x6324('0x47')]({},_0xe579ce,_0x1bb931[_0x6324('0x49')]);return _0x1a91c0[_0x6324('0x91')](_0xe579ce);}})['then'](function(_0x30f84f){if(_0x30f84f){_0x57cc6b=_0x30f84f[_0x6324('0x40')];if(!_0x1bb931[_0x6324('0x3a')][_0x6324('0x41')](_0x6324('0x5e'))){_0xe579ce[_0x6324('0x22')]=qs['limit'](_0x1bb931[_0x6324('0x3a')][_0x6324('0x22')]);_0xe579ce[_0x6324('0x24')]=qs[_0x6324('0x24')](_0x1bb931[_0x6324('0x3a')][_0x6324('0x24')]);}return _0x1a91c0['getAgents'](_0xe579ce);}})[_0x6324('0x2b')](function(_0x79eb61){if(_0x79eb61){return _0x79eb61?{'count':_0x57cc6b,'rows':_0x79eb61}:null;}})[_0x6324('0x2b')](respondWithResult(_0x3400e8,null))[_0x6324('0x4e')](handleError(_0x3400e8,null));}; \ No newline at end of file +var _0x0fea=['lodash','squel','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','defaults','redis','localhost','./mailQueue.socket','sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','apply','save','update','then','destroy','get','UserProfileResource','end','stack','name','send','map','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','MailQueue','rows','params','keys','options','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','MailQueues','UserProfileSection','autoAssociation','describe','findOne','MailQueueId','findAll','User','findAndCountAll','UserId','agent','updatedAt','createdAt','format','%s/%s','SIP','mailPause','getTeams','hasOwnProperty','addTeams','ids','Team','Agents','online','flatMap','transaction','each','UserMailQueue','findOrCreate','forEach','emit','removeTeams','select','field','tq.TeamId','from','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','clone','push','sequelize','toString','QueryTypes','SELECT','every','includes','all','union','value','removeAgents','userMailQueue:remove','addAgents','spread','userMailQueue:save','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra'];(function(_0x4caed8,_0x26d635){var _0x5178cb=function(_0xe1a877){while(--_0xe1a877){_0x4caed8['push'](_0x4caed8['shift']());}};_0x5178cb(++_0x26d635);}(_0x0fea,0x80));var _0xa0fe=function(_0x4b2b03,_0xbf34ee){_0x4b2b03=_0x4b2b03-0x0;var _0x1bf0ed=_0x0fea[_0x4b2b03];return _0x1bf0ed;};'use strict';var emlformat=require(_0xa0fe('0x0'));var rimraf=require(_0xa0fe('0x1'));var zipdir=require(_0xa0fe('0x2'));var jsonpatch=require(_0xa0fe('0x3'));var rp=require(_0xa0fe('0x4'));var moment=require(_0xa0fe('0x5'));var BPromise=require(_0xa0fe('0x6'));var Mustache=require(_0xa0fe('0x7'));var util=require(_0xa0fe('0x8'));var path=require(_0xa0fe('0x9'));var sox=require(_0xa0fe('0xa'));var csv=require('to-csv');var ejs=require(_0xa0fe('0xb'));var fs=require('fs');var fs_extra=require(_0xa0fe('0xc'));var _=require(_0xa0fe('0xd'));var squel=require(_0xa0fe('0xe'));var crypto=require('crypto');var jsforce=require(_0xa0fe('0xf'));var deskjs=require(_0xa0fe('0x10'));var toCsv=require(_0xa0fe('0x11'));var querystring=require('querystring');var Papa=require(_0xa0fe('0x12'));var Redis=require(_0xa0fe('0x13'));var authService=require(_0xa0fe('0x14'));var qs=require(_0xa0fe('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa0fe('0x16'));var logger=require('../../config/logger')(_0xa0fe('0x17'));var utils=require(_0xa0fe('0x18'));var config=require(_0xa0fe('0x19'));var licenseUtil=require(_0xa0fe('0x1a'));var db=require('../../mysqldb')['db'];config['redis']=_[_0xa0fe('0x1b')](config[_0xa0fe('0x1c')],{'host':_0xa0fe('0x1d'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa0fe('0x1c')]));require(_0xa0fe('0x1e'))['register'](socket);function respondWithStatusCode(_0x5700c2,_0x438b4f){_0x438b4f=_0x438b4f||0xcc;return function(_0x6e6924){if(_0x6e6924){return _0x5700c2[_0xa0fe('0x1f')](_0x438b4f);}return _0x5700c2[_0xa0fe('0x20')](_0x438b4f)['end']();};}function respondWithResult(_0x3eb700,_0x5b7900){_0x5b7900=_0x5b7900||0xc8;return function(_0x47b50f){if(_0x47b50f){return _0x3eb700['status'](_0x5b7900)[_0xa0fe('0x21')](_0x47b50f);}};}function respondWithFilteredResult(_0x2874e4,_0x23a29b){return function(_0x4dc08d){if(_0x4dc08d){var _0x172859=typeof _0x23a29b['offset']===_0xa0fe('0x22')&&typeof _0x23a29b['limit']===_0xa0fe('0x22');var _0x2cf22e=_0x4dc08d[_0xa0fe('0x23')];var _0x58f888=_0x172859?0x0:_0x23a29b['offset'];var _0x1fc2bf=_0x172859?_0x4dc08d[_0xa0fe('0x23')]:_0x23a29b[_0xa0fe('0x24')]+_0x23a29b[_0xa0fe('0x25')];var _0x5b626c;if(_0x1fc2bf>=_0x2cf22e){_0x1fc2bf=_0x2cf22e;_0x5b626c=0xc8;}else{_0x5b626c=0xce;}_0x2874e4[_0xa0fe('0x20')](_0x5b626c);return _0x2874e4[_0xa0fe('0x26')](_0xa0fe('0x27'),_0x58f888+'-'+_0x1fc2bf+'/'+_0x2cf22e)[_0xa0fe('0x21')](_0x4dc08d);}return null;};}function patchUpdates(_0x3c1d5c){return function(_0x33e199){try{jsonpatch[_0xa0fe('0x28')](_0x33e199,_0x3c1d5c,!![]);}catch(_0x269c77){return BPromise['reject'](_0x269c77);}return _0x33e199[_0xa0fe('0x29')]();};}function saveUpdates(_0x2bd6a8,_0x26e8c2){return function(_0x2ea087){if(_0x2ea087){return _0x2ea087[_0xa0fe('0x2a')](_0x2bd6a8)[_0xa0fe('0x2b')](function(_0x6ca3e6){return _0x6ca3e6;});}return null;};}function removeEntity(_0x25be36,_0x66e04d){return function(_0x5317c7){if(_0x5317c7){return _0x5317c7[_0xa0fe('0x2c')]()[_0xa0fe('0x2b')](function(){var _0x6fda6d=_0x5317c7[_0xa0fe('0x2d')]({'plain':!![]});var _0x32b025='MailQueues';return db[_0xa0fe('0x2e')][_0xa0fe('0x2c')]({'where':{'type':_0x32b025,'resourceId':_0x6fda6d['id']}})['then'](function(){return _0x5317c7;});})[_0xa0fe('0x2b')](function(){_0x25be36[_0xa0fe('0x20')](0xcc)[_0xa0fe('0x2f')]();});}};}function handleEntityNotFound(_0x5b6363,_0x24b1c0){return function(_0x34ad53){if(!_0x34ad53){_0x5b6363[_0xa0fe('0x1f')](0x194);}return _0x34ad53;};}function handleError(_0x58586a,_0x2e5b85){_0x2e5b85=_0x2e5b85||0x1f4;return function(_0x1b07bc){logger['error'](_0x1b07bc[_0xa0fe('0x30')]);if(_0x1b07bc[_0xa0fe('0x31')]){delete _0x1b07bc['name'];}_0x58586a[_0xa0fe('0x20')](_0x2e5b85)[_0xa0fe('0x32')](_0x1b07bc);};}exports['index']=function(_0x35b045,_0x3cbf19){var _0xafde42={},_0x548901={},_0x44d02c={'count':0x0,'rows':[]};var _0x338edf=_[_0xa0fe('0x33')](db['MailQueue'][_0xa0fe('0x34')],function(_0x42c995){return{'name':_0x42c995[_0xa0fe('0x35')],'type':_0x42c995[_0xa0fe('0x36')][_0xa0fe('0x37')]};});_0x548901[_0xa0fe('0x38')]=_[_0xa0fe('0x33')](_0x338edf,_0xa0fe('0x31'));_0x548901[_0xa0fe('0x39')]=_['keys'](_0x35b045[_0xa0fe('0x39')]);_0x548901[_0xa0fe('0x3a')]=_[_0xa0fe('0x3b')](_0x548901[_0xa0fe('0x38')],_0x548901[_0xa0fe('0x39')]);_0xafde42[_0xa0fe('0x3c')]=_[_0xa0fe('0x3b')](_0x548901[_0xa0fe('0x38')],qs[_0xa0fe('0x3d')](_0x35b045[_0xa0fe('0x39')][_0xa0fe('0x3d')]));_0xafde42[_0xa0fe('0x3c')]=_0xafde42[_0xa0fe('0x3c')][_0xa0fe('0x3e')]?_0xafde42['attributes']:_0x548901[_0xa0fe('0x38')];if(!_0x35b045[_0xa0fe('0x39')]['hasOwnProperty'](_0xa0fe('0x3f'))){_0xafde42['limit']=qs['limit'](_0x35b045['query'][_0xa0fe('0x25')]);_0xafde42['offset']=qs['offset'](_0x35b045[_0xa0fe('0x39')]['offset']);}_0xafde42[_0xa0fe('0x40')]=qs[_0xa0fe('0x41')](_0x35b045[_0xa0fe('0x39')][_0xa0fe('0x41')]);_0xafde42[_0xa0fe('0x42')]=qs['filters'](_[_0xa0fe('0x43')](_0x35b045[_0xa0fe('0x39')],_0x548901[_0xa0fe('0x3a')]),_0x338edf);if(_0x35b045[_0xa0fe('0x39')][_0xa0fe('0x44')]){_0xafde42[_0xa0fe('0x42')]=_[_0xa0fe('0x45')](_0xafde42[_0xa0fe('0x42')],{'$or':_[_0xa0fe('0x33')](_0x338edf,function(_0x369622){if(_0x369622[_0xa0fe('0x36')]!==_0xa0fe('0x46')){var _0x4a2bc6={};_0x4a2bc6[_0x369622[_0xa0fe('0x31')]]={'$like':'%'+_0x35b045[_0xa0fe('0x39')]['filter']+'%'};return _0x4a2bc6;}})});}_0xafde42=_['merge']({},_0xafde42,_0x35b045['options']);var _0x177f37={'where':_0xafde42[_0xa0fe('0x42')]};return db['MailQueue'][_0xa0fe('0x23')](_0x177f37)[_0xa0fe('0x2b')](function(_0x10d110){_0x44d02c['count']=_0x10d110;if(_0x35b045[_0xa0fe('0x39')][_0xa0fe('0x47')]){_0xafde42[_0xa0fe('0x48')]=[{'all':!![]}];}return db[_0xa0fe('0x49')]['findAll'](_0xafde42);})['then'](function(_0x115acd){_0x44d02c[_0xa0fe('0x4a')]=_0x115acd;return _0x44d02c;})['then'](respondWithFilteredResult(_0x3cbf19,_0xafde42))['catch'](handleError(_0x3cbf19,null));};exports['show']=function(_0x139e5a,_0x5c7561){var _0x40ad09={'raw':!![],'where':{'id':_0x139e5a[_0xa0fe('0x4b')]['id']}},_0x142259={};_0x142259[_0xa0fe('0x38')]=_[_0xa0fe('0x4c')](db[_0xa0fe('0x49')][_0xa0fe('0x34')]);_0x142259[_0xa0fe('0x39')]=_[_0xa0fe('0x4c')](_0x139e5a[_0xa0fe('0x39')]);_0x142259[_0xa0fe('0x3a')]=_[_0xa0fe('0x3b')](_0x142259[_0xa0fe('0x38')],_0x142259[_0xa0fe('0x39')]);_0x40ad09['attributes']=_['intersection'](_0x142259[_0xa0fe('0x38')],qs[_0xa0fe('0x3d')](_0x139e5a['query'][_0xa0fe('0x3d')]));_0x40ad09[_0xa0fe('0x3c')]=_0x40ad09['attributes']['length']?_0x40ad09[_0xa0fe('0x3c')]:_0x142259[_0xa0fe('0x38')];if(_0x139e5a['query'][_0xa0fe('0x47')]){_0x40ad09['include']=[{'all':!![]}];}_0x40ad09=_[_0xa0fe('0x45')]({},_0x40ad09,_0x139e5a[_0xa0fe('0x4d')]);return db[_0xa0fe('0x49')][_0xa0fe('0x4e')](_0x40ad09)[_0xa0fe('0x2b')](handleEntityNotFound(_0x5c7561,null))[_0xa0fe('0x2b')](respondWithResult(_0x5c7561,null))[_0xa0fe('0x4f')](handleError(_0x5c7561,null));};exports[_0xa0fe('0x50')]=function(_0x57cc51,_0x1255f3){return db[_0xa0fe('0x49')][_0xa0fe('0x50')](_0x57cc51[_0xa0fe('0x51')],{})['then'](function(_0x4cf2ed){var _0x45ffba=_0x57cc51[_0xa0fe('0x52')][_0xa0fe('0x2d')]({'plain':!![]});if(!_0x45ffba)throw new Error(_0xa0fe('0x53'));if(_0x45ffba[_0xa0fe('0x54')]===_0xa0fe('0x52')){var _0x33cdcb=_0x4cf2ed['get']({'plain':!![]});var _0x3e46de=_0xa0fe('0x55');return db[_0xa0fe('0x56')][_0xa0fe('0x4e')]({'where':{'name':_0x3e46de,'userProfileId':_0x45ffba['userProfileId']},'raw':!![]})[_0xa0fe('0x2b')](function(_0x4b4b84){if(_0x4b4b84&&_0x4b4b84[_0xa0fe('0x57')]===0x0){return db[_0xa0fe('0x2e')]['create']({'name':_0x33cdcb['name'],'resourceId':_0x33cdcb['id'],'type':_0x4b4b84[_0xa0fe('0x31')],'sectionId':_0x4b4b84['id']},{})['then'](function(){return _0x4cf2ed;});}else{return _0x4cf2ed;}})[_0xa0fe('0x4f')](function(_0x182fc0){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x182fc0);throw _0x182fc0;});}return _0x4cf2ed;})['then'](respondWithResult(_0x1255f3,0xc9))[_0xa0fe('0x4f')](handleError(_0x1255f3,null));};exports[_0xa0fe('0x2a')]=function(_0x6ad1b0,_0x323dcb){if(_0x6ad1b0[_0xa0fe('0x51')]['id']){delete _0x6ad1b0[_0xa0fe('0x51')]['id'];}return db['MailQueue'][_0xa0fe('0x4e')]({'where':{'id':_0x6ad1b0[_0xa0fe('0x4b')]['id']}})[_0xa0fe('0x2b')](handleEntityNotFound(_0x323dcb,null))[_0xa0fe('0x2b')](saveUpdates(_0x6ad1b0[_0xa0fe('0x51')],null))['then'](respondWithResult(_0x323dcb,null))[_0xa0fe('0x4f')](handleError(_0x323dcb,null));};exports['destroy']=function(_0x4630f2,_0xbe9dc7){return db[_0xa0fe('0x49')]['find']({'where':{'id':_0x4630f2[_0xa0fe('0x4b')]['id']}})['then'](handleEntityNotFound(_0xbe9dc7,null))[_0xa0fe('0x2b')](removeEntity(_0xbe9dc7,null))['catch'](handleError(_0xbe9dc7,null));};exports[_0xa0fe('0x58')]=function(_0x1afd34,_0x526689){return db[_0xa0fe('0x49')]['describe']()[_0xa0fe('0x2b')](respondWithResult(_0x526689,null))[_0xa0fe('0x4f')](handleError(_0x526689,null));};exports['getMembers']=function(_0x55492b,_0x548fcc,_0x15e056){var _0x5658f0={'raw':!![],'where':{}},_0x5d298c={},_0x558fee;return db[_0xa0fe('0x49')][_0xa0fe('0x59')]({'where':{'id':_0x55492b[_0xa0fe('0x4b')]['id']}})[_0xa0fe('0x2b')](handleEntityNotFound(_0x548fcc,null))['then'](function(_0x32b29d){if(_0x32b29d){_0x558fee=_0x32b29d[_0xa0fe('0x2d')]({'plain':!![]});_0x5d298c[_0xa0fe('0x38')]=_[_0xa0fe('0x4c')](db['UserMailQueue'][_0xa0fe('0x34')]);_0x5d298c[_0xa0fe('0x39')]=_[_0xa0fe('0x4c')](_0x55492b[_0xa0fe('0x39')]);_0x5d298c[_0xa0fe('0x3a')]=_[_0xa0fe('0x3b')](_0x5d298c[_0xa0fe('0x38')],_0x5d298c[_0xa0fe('0x39')]);_0x5658f0['attributes']=_['intersection'](_0x5d298c['model'],qs['fields'](_0x55492b[_0xa0fe('0x39')]['fields']));_0x5658f0[_0xa0fe('0x3c')]=_0x5658f0[_0xa0fe('0x3c')][_0xa0fe('0x3e')]?_0x5658f0[_0xa0fe('0x3c')]:_0x5d298c[_0xa0fe('0x38')];if(!_0x55492b[_0xa0fe('0x39')]['hasOwnProperty'](_0xa0fe('0x3f'))){_0x5658f0[_0xa0fe('0x25')]=qs[_0xa0fe('0x25')](_0x55492b['query'][_0xa0fe('0x25')]);_0x5658f0['offset']=qs['offset'](_0x55492b[_0xa0fe('0x39')][_0xa0fe('0x24')]);}_0x5658f0['order']=qs[_0xa0fe('0x41')](_0x55492b[_0xa0fe('0x39')][_0xa0fe('0x41')]);_0x5658f0[_0xa0fe('0x42')]=qs[_0xa0fe('0x3a')](_['pick'](_0x55492b[_0xa0fe('0x39')],_0x5d298c[_0xa0fe('0x3a')]));_0x5658f0[_0xa0fe('0x42')][_0xa0fe('0x5a')]=_0x32b29d['id'];if(_0x55492b['query'][_0xa0fe('0x44')]){_0x5658f0[_0xa0fe('0x42')]=_[_0xa0fe('0x45')](_0x5658f0[_0xa0fe('0x42')],{'$or':_[_0xa0fe('0x33')](_0x5658f0[_0xa0fe('0x3c')],function(_0x1b3f6b){var _0x4a7180={};_0x4a7180[_0x1b3f6b]={'$like':'%'+_0x55492b[_0xa0fe('0x39')][_0xa0fe('0x44')]+'%'};return _0x4a7180;})});}_0x5658f0=_[_0xa0fe('0x45')]({},_0x5658f0,_0x55492b['options']);return db['UserMailQueue'][_0xa0fe('0x5b')](_0x5658f0);}})[_0xa0fe('0x2b')](function(_0x33e1ca){if(_0x33e1ca){return db[_0xa0fe('0x5c')][_0xa0fe('0x5d')]({'where':{'id':_[_0xa0fe('0x33')](_0x33e1ca,_0xa0fe('0x5e')),'role':_0xa0fe('0x5f')},'attributes':['id','name','mailPause',_0xa0fe('0x60'),_0xa0fe('0x61')]});}})[_0xa0fe('0x2b')](function(_0x2675aa){if(_0x2675aa){return{'count':_0x2675aa[_0xa0fe('0x23')],'rows':_[_0xa0fe('0x33')](_0x2675aa[_0xa0fe('0x4a')],function(_0x3acf20){return{'membername':_0x3acf20['name'],'UserId':_0x3acf20['id'],'queue_name':_0x558fee[_0xa0fe('0x31')],'MailQueueId':_0x558fee['id'],'interface':util[_0xa0fe('0x62')](_0xa0fe('0x63'),_0xa0fe('0x64'),_0x3acf20['name']),'penalty':0x0,'paused':_0x3acf20[_0xa0fe('0x65')],'createdAt':_0x3acf20['createdAt'],'updatedAt':_0x3acf20[_0xa0fe('0x60')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xa0fe('0x2b')](respondWithFilteredResult(_0x548fcc,_0x5658f0))[_0xa0fe('0x4f')](handleError(_0x548fcc,null));};exports[_0xa0fe('0x66')]=function(_0xc7f042,_0x22937a,_0x1a852c){var _0xcf7e4a={};var _0x297a1f={};var _0x44f842;var _0x439ed5;return db[_0xa0fe('0x49')][_0xa0fe('0x59')]({'where':{'id':_0xc7f042['params']['id']}})[_0xa0fe('0x2b')](handleEntityNotFound(_0x22937a,null))['then'](function(_0xaaf2eb){if(_0xaaf2eb){_0x44f842=_0xaaf2eb;_0x297a1f[_0xa0fe('0x38')]=_['keys'](db['Team'][_0xa0fe('0x34')]);_0x297a1f[_0xa0fe('0x39')]=_[_0xa0fe('0x4c')](_0xc7f042[_0xa0fe('0x39')]);_0x297a1f['filters']=_[_0xa0fe('0x3b')](_0x297a1f['model'],_0x297a1f[_0xa0fe('0x39')]);_0xcf7e4a[_0xa0fe('0x3c')]=_[_0xa0fe('0x3b')](_0x297a1f[_0xa0fe('0x38')],qs[_0xa0fe('0x3d')](_0xc7f042[_0xa0fe('0x39')][_0xa0fe('0x3d')]));_0xcf7e4a[_0xa0fe('0x3c')]=_0xcf7e4a[_0xa0fe('0x3c')][_0xa0fe('0x3e')]?_0xcf7e4a['attributes']:_0x297a1f['model'];_0xcf7e4a['order']=qs[_0xa0fe('0x41')](_0xc7f042[_0xa0fe('0x39')][_0xa0fe('0x41')]);_0xcf7e4a['where']=qs[_0xa0fe('0x3a')](_[_0xa0fe('0x43')](_0xc7f042['query'],_0x297a1f[_0xa0fe('0x3a')]));if(_0xc7f042[_0xa0fe('0x39')][_0xa0fe('0x44')]){_0xcf7e4a[_0xa0fe('0x42')]=_['merge'](_0xcf7e4a[_0xa0fe('0x42')],{'$or':_[_0xa0fe('0x33')](_0xcf7e4a[_0xa0fe('0x3c')],function(_0x2b1f41){var _0x2af9f3={};_0x2af9f3[_0x2b1f41]={'$like':'%'+_0xc7f042[_0xa0fe('0x39')]['filter']+'%'};return _0x2af9f3;})});}_0xcf7e4a=_[_0xa0fe('0x45')]({},_0xcf7e4a,_0xc7f042['options']);return _0x44f842['getTeams'](_0xcf7e4a);}})[_0xa0fe('0x2b')](function(_0x29ca84){if(_0x29ca84){_0x439ed5=_0x29ca84[_0xa0fe('0x3e')];if(!_0xc7f042[_0xa0fe('0x39')][_0xa0fe('0x67')](_0xa0fe('0x3f'))){_0xcf7e4a['limit']=qs[_0xa0fe('0x25')](_0xc7f042[_0xa0fe('0x39')]['limit']);_0xcf7e4a['offset']=qs[_0xa0fe('0x24')](_0xc7f042['query'][_0xa0fe('0x24')]);}return _0x44f842['getTeams'](_0xcf7e4a);}})[_0xa0fe('0x2b')](function(_0x9b227b){if(_0x9b227b){return _0x9b227b?{'count':_0x439ed5,'rows':_0x9b227b}:null;}})[_0xa0fe('0x2b')](respondWithResult(_0x22937a,null))[_0xa0fe('0x4f')](handleError(_0x22937a,null));};exports[_0xa0fe('0x68')]=function(_0xd87765,_0xa08929,_0x171076){var _0x1496f5=_0xd87765[_0xa0fe('0x51')][_0xa0fe('0x69')];return db[_0xa0fe('0x6a')][_0xa0fe('0x5b')]({'where':{'id':_0x1496f5},'attributes':['id'],'include':[{'model':db[_0xa0fe('0x5c')],'as':_0xa0fe('0x6b'),'attributes':['id',_0xa0fe('0x31'),_0xa0fe('0x6c'),'voicePause','interface'],'raw':!![]}]})['then'](function(_0x1b5f64){if(_0x1b5f64){var _0x2408c0=_[_0xa0fe('0x6d')](_0x1b5f64,function(_0x24c7fa){var _0x15700f=_0x24c7fa[_0xa0fe('0x2d')]({'plain':!![]});return _0x15700f[_0xa0fe('0x6b')];});return db['MailQueue'][_0xa0fe('0x4e')]({'where':{'id':_0xd87765[_0xa0fe('0x4b')]['id']}})[_0xa0fe('0x2b')](function(_0x56f613){return db['sequelize'][_0xa0fe('0x6e')](function(_0x382403){return _0x56f613[_0xa0fe('0x68')](_0x1496f5,{'transaction':_0x382403})[_0xa0fe('0x2b')](function(){return BPromise[_0xa0fe('0x6f')](_0x2408c0,function(_0x55065b){return db[_0xa0fe('0x70')][_0xa0fe('0x71')]({'where':{'UserId':_0x55065b['id'],'MailQueueId':_0xd87765[_0xa0fe('0x4b')]['id']},'transaction':_0x382403});});})[_0xa0fe('0x2b')](function(){_0x2408c0[_0xa0fe('0x72')](function(_0x2f0ccf){socket[_0xa0fe('0x73')]('userMailQueue:save',{'UserId':_0x2f0ccf['id'],'MailQueueId':_0x56f613['id']});});});});});}})['then'](respondWithStatusCode(_0xa08929,null))[_0xa0fe('0x4f')](handleError(_0xa08929,null));};exports[_0xa0fe('0x74')]=function(_0x469aa3,_0x207b8f,_0x1c636f){return db[_0xa0fe('0x6a')][_0xa0fe('0x5b')]({'where':{'id':_0x469aa3['query'][_0xa0fe('0x69')]},'attributes':['id'],'include':[{'model':db[_0xa0fe('0x5c')],'as':'Agents','attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x207b8f,null))[_0xa0fe('0x2b')](function(_0x54be34){var _0x55ba86=_[_0xa0fe('0x33')](_0x54be34,'id');var _0x588de1=[];var _0x470702=[];var _0x17d5a6=squel[_0xa0fe('0x75')]();_0x17d5a6[_0xa0fe('0x76')](_0xa0fe('0x77'))[_0xa0fe('0x78')]('team_has_mail_queues','tq')[_0xa0fe('0x79')](_0xa0fe('0x7a'),'ut',_0xa0fe('0x7b'))[_0xa0fe('0x42')]('MailQueueId\x20=\x20?',_0x469aa3['params']['id']);for(var _0x39840e=0x0;_0x39840e<_0x54be34[_0xa0fe('0x3e')];_0x39840e+=0x1){let _0x14395a=_0x54be34[_0x39840e];for(var _0x7828c=0x0;_0x7828c<_0x14395a[_0xa0fe('0x6b')][_0xa0fe('0x3e')];_0x7828c+=0x1){let _0x2adcef=_0x14395a[_0xa0fe('0x6b')][_0x7828c];var _0x3ed9e9=_0x17d5a6[_0xa0fe('0x7c')]();_0x3ed9e9['where']('ut.UserId\x20=\x20?',_0x2adcef['id']);_0x470702[_0xa0fe('0x7d')](db[_0xa0fe('0x7e')][_0xa0fe('0x39')](_0x3ed9e9[_0xa0fe('0x7f')](),{'type':db[_0xa0fe('0x7e')][_0xa0fe('0x80')][_0xa0fe('0x81')]})[_0xa0fe('0x2b')](function(_0xcbe916){if(_0xcbe916[_0xa0fe('0x3e')]===0x1){return _0x2adcef['id'];}else{var _0x4e8838=_[_0xa0fe('0x82')](_[_0xa0fe('0x33')](_0xcbe916,'TeamId'),function(_0x4fa7a2){return _[_0xa0fe('0x83')](_0x55ba86,_0x4fa7a2);});if(_0x4e8838){return _0x2adcef['id'];}}}));}}return BPromise[_0xa0fe('0x84')](_0x470702)[_0xa0fe('0x2b')](function(_0x5e75f8){_0x588de1=_(_0x588de1)[_0xa0fe('0x85')](_0x5e75f8)['compact']()[_0xa0fe('0x86')]();return db[_0xa0fe('0x49')][_0xa0fe('0x4e')]({'where':{'id':_0x469aa3['params']['id']}})['then'](function(_0x4d75f9){return db[_0xa0fe('0x7e')][_0xa0fe('0x6e')](function(_0x58dafa){return _0x4d75f9[_0xa0fe('0x74')](_0x469aa3[_0xa0fe('0x39')][_0xa0fe('0x69')],{'transaction':_0x58dafa})[_0xa0fe('0x2b')](function(){if(!_['isEmpty'](_0x588de1)){return _0x4d75f9[_0xa0fe('0x87')](_0x588de1,{'transaction':_0x58dafa});}})[_0xa0fe('0x2b')](function(){_0x588de1[_0xa0fe('0x72')](function(_0x321eec){socket['emit'](_0xa0fe('0x88'),{'UserId':_0x321eec,'MailQueueId':_0x4d75f9['id']});});});});});});})[_0xa0fe('0x2b')](respondWithStatusCode(_0x207b8f,null))[_0xa0fe('0x4f')](handleError(_0x207b8f,null));};exports[_0xa0fe('0x89')]=function(_0x5e42d0,_0x2ff197,_0xee506a){return db[_0xa0fe('0x49')][_0xa0fe('0x4e')]({'where':{'id':_0x5e42d0['params']['id']}})['then'](handleEntityNotFound(_0x2ff197,null))[_0xa0fe('0x2b')](function(_0xd19334){if(_0xd19334){return _0xd19334[_0xa0fe('0x89')](_0x5e42d0[_0xa0fe('0x51')][_0xa0fe('0x69')],_['omit'](_0x5e42d0['body'],[_0xa0fe('0x69'),'id'])||{})[_0xa0fe('0x8a')](function(_0x336467){for(var _0x5eeb09=0x0;_0x5eeb09<_0x5e42d0[_0xa0fe('0x51')]['ids'][_0xa0fe('0x3e')];_0x5eeb09+=0x1){socket[_0xa0fe('0x73')](_0xa0fe('0x8b'),{'UserId':Number(_0x5e42d0['body'][_0xa0fe('0x69')][_0x5eeb09]),'MailQueueId':Number(_0x5e42d0['params']['id'])});}return _0x336467;});}})[_0xa0fe('0x2b')](respondWithResult(_0x2ff197,null))[_0xa0fe('0x4f')](handleError(_0x2ff197,null));};exports[_0xa0fe('0x87')]=function(_0x40e526,_0x2fffb4,_0x55156d){return db['MailQueue']['find']({'where':{'id':_0x40e526['params']['id']}})[_0xa0fe('0x2b')](handleEntityNotFound(_0x2fffb4,null))[_0xa0fe('0x2b')](function(_0x1729d5){if(_0x1729d5){return _0x1729d5[_0xa0fe('0x87')](_0x40e526['query'][_0xa0fe('0x69')])[_0xa0fe('0x2b')](function(){if(_['isArray'](_0x40e526[_0xa0fe('0x39')][_0xa0fe('0x69')])){for(var _0x5ce736=0x0;_0x5ce736<_0x40e526[_0xa0fe('0x39')][_0xa0fe('0x69')]['length'];_0x5ce736+=0x1){socket[_0xa0fe('0x73')](_0xa0fe('0x88'),{'UserId':Number(_0x40e526['query'][_0xa0fe('0x69')][_0x5ce736]),'MailQueueId':Number(_0x40e526[_0xa0fe('0x4b')]['id'])});}}else{socket[_0xa0fe('0x73')](_0xa0fe('0x88'),{'UserId':Number(_0x40e526[_0xa0fe('0x39')][_0xa0fe('0x69')]),'MailQueueId':Number(_0x40e526['params']['id'])});}});}})[_0xa0fe('0x2b')](respondWithStatusCode(_0x2fffb4,null))[_0xa0fe('0x4f')](handleError(_0x2fffb4,null));};exports[_0xa0fe('0x8c')]=function(_0x14217a,_0x47bda9,_0x368850){var _0x727c95={};var _0x56e935={};var _0x3595e5;var _0x745549;return db[_0xa0fe('0x49')]['findOne']({'where':{'id':_0x14217a[_0xa0fe('0x4b')]['id']}})[_0xa0fe('0x2b')](handleEntityNotFound(_0x47bda9,null))[_0xa0fe('0x2b')](function(_0x355e90){if(_0x355e90){_0x3595e5=_0x355e90;_0x56e935[_0xa0fe('0x38')]=_[_0xa0fe('0x4c')](db['User'][_0xa0fe('0x34')]);_0x56e935['query']=_[_0xa0fe('0x4c')](_0x14217a['query']);_0x56e935['filters']=_[_0xa0fe('0x3b')](_0x56e935[_0xa0fe('0x38')],_0x56e935[_0xa0fe('0x39')]);_0x727c95['attributes']=_[_0xa0fe('0x3b')](_0x56e935['model'],qs[_0xa0fe('0x3d')](_0x14217a[_0xa0fe('0x39')][_0xa0fe('0x3d')]));_0x727c95['attributes']=_0x727c95[_0xa0fe('0x3c')][_0xa0fe('0x3e')]?_0x727c95[_0xa0fe('0x3c')]:_0x56e935[_0xa0fe('0x38')];_0x727c95[_0xa0fe('0x40')]=qs[_0xa0fe('0x41')](_0x14217a['query'][_0xa0fe('0x41')]);_0x727c95[_0xa0fe('0x42')]=qs['filters'](_[_0xa0fe('0x43')](_0x14217a[_0xa0fe('0x39')],_0x56e935[_0xa0fe('0x3a')]));if(_0x14217a[_0xa0fe('0x39')][_0xa0fe('0x44')]){_0x727c95[_0xa0fe('0x42')]=_[_0xa0fe('0x45')](_0x727c95[_0xa0fe('0x42')],{'$or':_[_0xa0fe('0x33')](_0x727c95[_0xa0fe('0x3c')],function(_0x1f8e6e){var _0x3dd7f8={};_0x3dd7f8[_0x1f8e6e]={'$like':'%'+_0x14217a[_0xa0fe('0x39')][_0xa0fe('0x44')]+'%'};return _0x3dd7f8;})});}_0x727c95=_['merge']({},_0x727c95,_0x14217a[_0xa0fe('0x4d')]);return _0x3595e5[_0xa0fe('0x8c')](_0x727c95);}})['then'](function(_0x3d25f9){if(_0x3d25f9){_0x745549=_0x3d25f9[_0xa0fe('0x3e')];if(!_0x14217a['query'][_0xa0fe('0x67')](_0xa0fe('0x3f'))){_0x727c95[_0xa0fe('0x25')]=qs[_0xa0fe('0x25')](_0x14217a[_0xa0fe('0x39')][_0xa0fe('0x25')]);_0x727c95['offset']=qs[_0xa0fe('0x24')](_0x14217a['query']['offset']);}return _0x3595e5[_0xa0fe('0x8c')](_0x727c95);}})[_0xa0fe('0x2b')](function(_0x4a3463){if(_0x4a3463){return _0x4a3463?{'count':_0x745549,'rows':_0x4a3463}:null;}})[_0xa0fe('0x2b')](respondWithResult(_0x47bda9,null))[_0xa0fe('0x4f')](handleError(_0x47bda9,null));}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.events.js b/server/api/mailQueue/mailQueue.events.js index 1635442..f8dd964 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 _0x8049=['hasOwnProperty','hook','exports','events','../../mysqldb','MailQueue','update','remove','emit'];(function(_0x5bc12e,_0x277c3b){var _0x43e62b=function(_0x297222){while(--_0x297222){_0x5bc12e['push'](_0x5bc12e['shift']());}};_0x43e62b(++_0x277c3b);}(_0x8049,0x78));var _0x9804=function(_0x45c28e,_0x175118){_0x45c28e=_0x45c28e-0x0;var _0x430581=_0x8049[_0x45c28e];return _0x430581;};'use strict';var EventEmitter=require(_0x9804('0x0'));var MailQueue=require(_0x9804('0x1'))['db'][_0x9804('0x2')];var MailQueueEvents=new EventEmitter();MailQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x9804('0x3'),'afterDestroy':_0x9804('0x4')};function emitEvent(_0x5cce49){return function(_0x2bb465,_0x6d23dc,_0x3dc08d){MailQueueEvents[_0x9804('0x5')](_0x5cce49+':'+_0x2bb465['id'],_0x2bb465);MailQueueEvents[_0x9804('0x5')](_0x5cce49,_0x2bb465);_0x3dc08d(null);};}for(var e in events){if(events[_0x9804('0x6')](e)){var event=events[e];MailQueue[_0x9804('0x7')](e,emitEvent(event));}}module[_0x9804('0x8')]=MailQueueEvents; \ No newline at end of file +var _0x4dcf=['remove','emit','hasOwnProperty','events','MailQueue'];(function(_0x20c386,_0x46c9ab){var _0x9d2c7a=function(_0x4f44d1){while(--_0x4f44d1){_0x20c386['push'](_0x20c386['shift']());}};_0x9d2c7a(++_0x46c9ab);}(_0x4dcf,0xfd));var _0xf4dc=function(_0x126b70,_0x390b37){_0x126b70=_0x126b70-0x0;var _0x2b8337=_0x4dcf[_0x126b70];return _0x2b8337;};'use strict';var EventEmitter=require(_0xf4dc('0x0'));var MailQueue=require('../../mysqldb')['db'][_0xf4dc('0x1')];var MailQueueEvents=new EventEmitter();MailQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xf4dc('0x2')};function emitEvent(_0x2f454e){return function(_0x7aed9b,_0x485eae,_0x6c84b5){MailQueueEvents[_0xf4dc('0x3')](_0x2f454e+':'+_0x7aed9b['id'],_0x7aed9b);MailQueueEvents[_0xf4dc('0x3')](_0x2f454e,_0x7aed9b);_0x6c84b5(null);};}for(var e in events){if(events[_0xf4dc('0x4')](e)){var event=events[e];MailQueue['hook'](e,emitEvent(event));}}module['exports']=MailQueueEvents; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.model.js b/server/api/mailQueue/mailQueue.model.js index 3ef145b..7c527f6 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 _0x72f1=['lodash','util','moment','bluebird','request-promise','path','../../config/environment','exports','define','MailQueue'];(function(_0x59bfa0,_0x1d5df7){var _0x1a43b8=function(_0x126c0a){while(--_0x126c0a){_0x59bfa0['push'](_0x59bfa0['shift']());}};_0x1a43b8(++_0x1d5df7);}(_0x72f1,0x1e0));var _0x172f=function(_0x6564b3,_0x3bf0dd){_0x6564b3=_0x6564b3-0x0;var _0x146c0d=_0x72f1[_0x6564b3];return _0x146c0d;};'use strict';var _=require(_0x172f('0x0'));var util=require(_0x172f('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x172f('0x2'));var BPromise=require(_0x172f('0x3'));var rp=require(_0x172f('0x4'));var fs=require('fs');var path=require(_0x172f('0x5'));var rimraf=require('rimraf');var config=require(_0x172f('0x6'));var attributes=require('./mailQueue.attributes');module[_0x172f('0x7')]=function(_0x52d2f9,_0x3edb3d){return _0x52d2f9[_0x172f('0x8')](_0x172f('0x9'),attributes,{'tableName':'mail_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7f9f=['MailQueue','mail_queues','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./mailQueue.attributes','exports','define'];(function(_0x276b4e,_0x54aef7){var _0x13a909=function(_0x84edb5){while(--_0x84edb5){_0x276b4e['push'](_0x276b4e['shift']());}};_0x13a909(++_0x54aef7);}(_0x7f9f,0x84));var _0xf7f9=function(_0xc382e,_0x2aedbe){_0xc382e=_0xc382e-0x0;var _0x212a24=_0x7f9f[_0xc382e];return _0x212a24;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xf7f9('0x0'))(_0xf7f9('0x1'));var moment=require(_0xf7f9('0x2'));var BPromise=require(_0xf7f9('0x3'));var rp=require(_0xf7f9('0x4'));var fs=require('fs');var path=require(_0xf7f9('0x5'));var rimraf=require(_0xf7f9('0x6'));var config=require(_0xf7f9('0x7'));var attributes=require(_0xf7f9('0x8'));module[_0xf7f9('0x9')]=function(_0x40adbe,_0x345236){return _0x40adbe[_0xf7f9('0xa')](_0xf7f9('0xb'),attributes,{'tableName':_0xf7f9('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.rpc.js b/server/api/mailQueue/mailQueue.rpc.js index 58f0929..e4eba70 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 _0x6282=['../../config/utils','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./mailQueue.socket','register','request','then','request\x20sent','debug','MailQueue,\x20%s,\x20%s,\x20%s','error','code','MailQueue,\x20%s,\x20%s','message','catch','GetMailQueue','MailQueue','findAll','options','raw','attributes','include','map','model','info','stringify','find','where','ShowMailQueue','lodash','util','moment','bluebird','../../mysqldb'];(function(_0x5472bc,_0x1bca12){var _0x387419=function(_0x1681d0){while(--_0x1681d0){_0x5472bc['push'](_0x5472bc['shift']());}};_0x387419(++_0x1bca12);}(_0x6282,0x76));var _0x2628=function(_0x468119,_0x422d72){_0x468119=_0x468119-0x0;var _0x54ac28=_0x6282[_0x468119];return _0x54ac28;};'use strict';var _=require(_0x2628('0x0'));var util=require(_0x2628('0x1'));var moment=require(_0x2628('0x2'));var BPromise=require(_0x2628('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2628('0x4'))['db'];var utils=require(_0x2628('0x5'));var logger=require('../../config/logger')(_0x2628('0x6'));var config=require(_0x2628('0x7'));var jayson=require(_0x2628('0x8'));var client=jayson[_0x2628('0x9')][_0x2628('0xa')]({'port':0x232a});config['redis']=_[_0x2628('0xb')](config[_0x2628('0xc')],{'host':_0x2628('0xd'),'port':0x18eb});var socket=require(_0x2628('0xe'))(new Redis(config[_0x2628('0xc')]));require(_0x2628('0xf'))[_0x2628('0x10')](socket);function respondWithRpcPromise(_0x1d12a5,_0x3f9015,_0xd7d01){return new BPromise(function(_0x1e27b8,_0x23e4fc){return client[_0x2628('0x11')](_0x1d12a5,_0xd7d01)[_0x2628('0x12')](function(_0x2f3aec){logger['info']('MailQueue,\x20%s,\x20%s',_0x3f9015,_0x2628('0x13'));logger[_0x2628('0x14')](_0x2628('0x15'),_0x3f9015,_0x2628('0x13'),JSON['stringify'](_0x2f3aec));if(_0x2f3aec['error']){if(_0x2f3aec[_0x2628('0x16')][_0x2628('0x17')]===0x1f4){logger[_0x2628('0x16')](_0x2628('0x18'),_0x3f9015,_0x2f3aec[_0x2628('0x16')]['message']);return _0x23e4fc(_0x2f3aec[_0x2628('0x16')][_0x2628('0x19')]);}logger[_0x2628('0x16')]('MailQueue,\x20%s,\x20%s',_0x3f9015,_0x2f3aec[_0x2628('0x16')][_0x2628('0x19')]);return _0x1e27b8(_0x2f3aec['error'][_0x2628('0x19')]);}else{logger['info'](_0x2628('0x18'),_0x3f9015,_0x2628('0x13'));_0x1e27b8(_0x2f3aec['result'][_0x2628('0x19')]);}})[_0x2628('0x1a')](function(_0x51d048){logger[_0x2628('0x16')]('MailQueue,\x20%s,\x20%s',_0x3f9015,_0x51d048);_0x23e4fc(_0x51d048);});});}exports[_0x2628('0x1b')]=function(_0x4976ce){var _0x54637f=this;return new Promise(function(_0xcf0862,_0xd4cec){return db[_0x2628('0x1c')][_0x2628('0x1d')]({'raw':_0x4976ce[_0x2628('0x1e')]?_0x4976ce[_0x2628('0x1e')][_0x2628('0x1f')]===undefined?!![]:![]:!![],'where':_0x4976ce[_0x2628('0x1e')]?_0x4976ce[_0x2628('0x1e')]['where']||null:null,'attributes':_0x4976ce[_0x2628('0x1e')]?_0x4976ce[_0x2628('0x1e')][_0x2628('0x20')]||null:null,'limit':_0x4976ce[_0x2628('0x1e')]?_0x4976ce[_0x2628('0x1e')]['limit']||null:null,'include':_0x4976ce[_0x2628('0x1e')]?_0x4976ce[_0x2628('0x1e')][_0x2628('0x21')]?_[_0x2628('0x22')](_0x4976ce[_0x2628('0x1e')]['include'],function(_0x4a8768){return{'model':db[_0x4a8768[_0x2628('0x23')]],'as':_0x4a8768['as'],'attributes':_0x4a8768[_0x2628('0x20')],'include':_0x4a8768[_0x2628('0x21')]?_[_0x2628('0x22')](_0x4a8768[_0x2628('0x21')],function(_0x571711){return{'model':db[_0x571711[_0x2628('0x23')]],'as':_0x571711['as'],'attributes':_0x571711[_0x2628('0x20')],'include':_0x571711[_0x2628('0x21')]?_[_0x2628('0x22')](_0x571711[_0x2628('0x21')],function(_0x118e75){return{'model':db[_0x118e75['model']],'as':_0x118e75['as'],'attributes':_0x118e75['attributes']};}):[]};}):[]};}):[]:[]})[_0x2628('0x12')](function(_0x29ffee){logger[_0x2628('0x24')](_0x2628('0x1b'),_0x4976ce);logger['debug'](_0x2628('0x1b'),_0x4976ce,JSON[_0x2628('0x25')](_0x29ffee));_0xcf0862(_0x29ffee);})[_0x2628('0x1a')](function(_0x32e089){logger['error'](_0x2628('0x1b'),_0x32e089[_0x2628('0x19')],_0x4976ce);_0xd4cec(_0x54637f[_0x2628('0x16')](0x1f4,_0x32e089[_0x2628('0x19')]));});});};exports['ShowMailQueue']=function(_0x24e688){var _0x16cd54=this;return new Promise(function(_0x70d522,_0x4443c5){return db[_0x2628('0x1c')][_0x2628('0x26')]({'raw':_0x24e688[_0x2628('0x1e')]?_0x24e688[_0x2628('0x1e')][_0x2628('0x1f')]===undefined?!![]:![]:!![],'where':_0x24e688['options']?_0x24e688[_0x2628('0x1e')][_0x2628('0x27')]||null:null,'attributes':_0x24e688[_0x2628('0x1e')]?_0x24e688[_0x2628('0x1e')][_0x2628('0x20')]||null:null,'include':_0x24e688['options']?_0x24e688['options'][_0x2628('0x21')]?_[_0x2628('0x22')](_0x24e688[_0x2628('0x1e')]['include'],function(_0x2df206){return{'model':db[_0x2df206[_0x2628('0x23')]],'as':_0x2df206['as'],'attributes':_0x2df206[_0x2628('0x20')],'include':_0x2df206['include']?_[_0x2628('0x22')](_0x2df206[_0x2628('0x21')],function(_0x1ad0ed){return{'model':db[_0x1ad0ed['model']],'as':_0x1ad0ed['as'],'attributes':_0x1ad0ed['attributes'],'include':_0x1ad0ed['include']?_['map'](_0x1ad0ed[_0x2628('0x21')],function(_0x20a424){return{'model':db[_0x20a424[_0x2628('0x23')]],'as':_0x20a424['as'],'attributes':_0x20a424['attributes']};}):[]};}):[]};}):[]:[]})[_0x2628('0x12')](function(_0x226fb8){logger[_0x2628('0x24')]('ShowMailQueue',_0x24e688);logger[_0x2628('0x14')](_0x2628('0x28'),_0x24e688,JSON[_0x2628('0x25')](_0x226fb8));_0x70d522(_0x226fb8);})[_0x2628('0x1a')](function(_0xec21c0){logger[_0x2628('0x16')](_0x2628('0x28'),_0xec21c0['message'],_0x24e688);_0x4443c5(_0x16cd54[_0x2628('0x16')](0x1f4,_0xec21c0[_0x2628('0x19')]));});});}; \ No newline at end of file +var _0x340c=['MailQueue,\x20%s,\x20%s','request\x20sent','debug','MailQueue,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','GetMailQueue','findAll','options','raw','where','attributes','limit','map','include','model','stringify','ShowMailQueue','MailQueue','find','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','socket.io-emitter','register','request','then'];(function(_0x18ede4,_0x3f1dc6){var _0x4d66f5=function(_0x3ea9f9){while(--_0x3ea9f9){_0x18ede4['push'](_0x18ede4['shift']());}};_0x4d66f5(++_0x3f1dc6);}(_0x340c,0xe5));var _0xc340=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x340c[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xc340('0x0'));var util=require(_0xc340('0x1'));var moment=require(_0xc340('0x2'));var BPromise=require(_0xc340('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc340('0x4'));var db=require(_0xc340('0x5'))['db'];var utils=require(_0xc340('0x6'));var logger=require(_0xc340('0x7'))('rpc');var config=require(_0xc340('0x8'));var jayson=require(_0xc340('0x9'));var client=jayson[_0xc340('0xa')][_0xc340('0xb')]({'port':0x232a});config[_0xc340('0xc')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xc340('0xd'))(new Redis(config[_0xc340('0xc')]));require('./mailQueue.socket')[_0xc340('0xe')](socket);function respondWithRpcPromise(_0x297b23,_0x1b79e4,_0x2edcf7){return new BPromise(function(_0x1f43c6,_0x49ee1c){return client[_0xc340('0xf')](_0x297b23,_0x2edcf7)[_0xc340('0x10')](function(_0x131e43){logger['info'](_0xc340('0x11'),_0x1b79e4,_0xc340('0x12'));logger[_0xc340('0x13')](_0xc340('0x14'),_0x1b79e4,_0xc340('0x12'),JSON['stringify'](_0x131e43));if(_0x131e43[_0xc340('0x15')]){if(_0x131e43[_0xc340('0x15')][_0xc340('0x16')]===0x1f4){logger[_0xc340('0x15')](_0xc340('0x11'),_0x1b79e4,_0x131e43['error'][_0xc340('0x17')]);return _0x49ee1c(_0x131e43[_0xc340('0x15')][_0xc340('0x17')]);}logger[_0xc340('0x15')](_0xc340('0x11'),_0x1b79e4,_0x131e43['error'][_0xc340('0x17')]);return _0x1f43c6(_0x131e43[_0xc340('0x15')][_0xc340('0x17')]);}else{logger[_0xc340('0x18')](_0xc340('0x11'),_0x1b79e4,'request\x20sent');_0x1f43c6(_0x131e43[_0xc340('0x19')][_0xc340('0x17')]);}})[_0xc340('0x1a')](function(_0x573fb4){logger['error'](_0xc340('0x11'),_0x1b79e4,_0x573fb4);_0x49ee1c(_0x573fb4);});});}exports[_0xc340('0x1b')]=function(_0x3a1bbf){var _0x519c0b=this;return new Promise(function(_0x562d3a,_0x22e6ee){return db['MailQueue'][_0xc340('0x1c')]({'raw':_0x3a1bbf[_0xc340('0x1d')]?_0x3a1bbf[_0xc340('0x1d')][_0xc340('0x1e')]===undefined?!![]:![]:!![],'where':_0x3a1bbf[_0xc340('0x1d')]?_0x3a1bbf[_0xc340('0x1d')][_0xc340('0x1f')]||null:null,'attributes':_0x3a1bbf[_0xc340('0x1d')]?_0x3a1bbf[_0xc340('0x1d')][_0xc340('0x20')]||null:null,'limit':_0x3a1bbf['options']?_0x3a1bbf[_0xc340('0x1d')][_0xc340('0x21')]||null:null,'include':_0x3a1bbf['options']?_0x3a1bbf[_0xc340('0x1d')]['include']?_[_0xc340('0x22')](_0x3a1bbf[_0xc340('0x1d')][_0xc340('0x23')],function(_0x57a615){return{'model':db[_0x57a615[_0xc340('0x24')]],'as':_0x57a615['as'],'attributes':_0x57a615[_0xc340('0x20')],'include':_0x57a615[_0xc340('0x23')]?_[_0xc340('0x22')](_0x57a615[_0xc340('0x23')],function(_0xedbb6f){return{'model':db[_0xedbb6f[_0xc340('0x24')]],'as':_0xedbb6f['as'],'attributes':_0xedbb6f['attributes'],'include':_0xedbb6f['include']?_[_0xc340('0x22')](_0xedbb6f[_0xc340('0x23')],function(_0x34dd53){return{'model':db[_0x34dd53[_0xc340('0x24')]],'as':_0x34dd53['as'],'attributes':_0x34dd53[_0xc340('0x20')]};}):[]};}):[]};}):[]:[]})[_0xc340('0x10')](function(_0x48c974){logger[_0xc340('0x18')](_0xc340('0x1b'),_0x3a1bbf);logger[_0xc340('0x13')](_0xc340('0x1b'),_0x3a1bbf,JSON[_0xc340('0x25')](_0x48c974));_0x562d3a(_0x48c974);})[_0xc340('0x1a')](function(_0x1f632d){logger['error']('GetMailQueue',_0x1f632d[_0xc340('0x17')],_0x3a1bbf);_0x22e6ee(_0x519c0b[_0xc340('0x15')](0x1f4,_0x1f632d[_0xc340('0x17')]));});});};exports[_0xc340('0x26')]=function(_0x42ea78){var _0x3d34a4=this;return new Promise(function(_0x3df6f3,_0x4d5fae){return db[_0xc340('0x27')][_0xc340('0x28')]({'raw':_0x42ea78['options']?_0x42ea78[_0xc340('0x1d')][_0xc340('0x1e')]===undefined?!![]:![]:!![],'where':_0x42ea78[_0xc340('0x1d')]?_0x42ea78['options'][_0xc340('0x1f')]||null:null,'attributes':_0x42ea78[_0xc340('0x1d')]?_0x42ea78[_0xc340('0x1d')]['attributes']||null:null,'include':_0x42ea78[_0xc340('0x1d')]?_0x42ea78[_0xc340('0x1d')]['include']?_[_0xc340('0x22')](_0x42ea78['options'][_0xc340('0x23')],function(_0xe21856){return{'model':db[_0xe21856[_0xc340('0x24')]],'as':_0xe21856['as'],'attributes':_0xe21856['attributes'],'include':_0xe21856[_0xc340('0x23')]?_[_0xc340('0x22')](_0xe21856['include'],function(_0x136f5c){return{'model':db[_0x136f5c[_0xc340('0x24')]],'as':_0x136f5c['as'],'attributes':_0x136f5c[_0xc340('0x20')],'include':_0x136f5c[_0xc340('0x23')]?_[_0xc340('0x22')](_0x136f5c[_0xc340('0x23')],function(_0x1c37bb){return{'model':db[_0x1c37bb['model']],'as':_0x1c37bb['as'],'attributes':_0x1c37bb[_0xc340('0x20')]};}):[]};}):[]};}):[]:[]})[_0xc340('0x10')](function(_0x5443d5){logger[_0xc340('0x18')](_0xc340('0x26'),_0x42ea78);logger[_0xc340('0x13')]('ShowMailQueue',_0x42ea78,JSON[_0xc340('0x25')](_0x5443d5));_0x3df6f3(_0x5443d5);})[_0xc340('0x1a')](function(_0x2396d1){logger['error'](_0xc340('0x26'),_0x2396d1['message'],_0x42ea78);_0x4d5fae(_0x3d34a4['error'](0x1f4,_0x2396d1['message']));});});}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.socket.js b/server/api/mailQueue/mailQueue.socket.js index d20ae6b..ec9c2b1 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 _0xf5fe=['remove','update','emit','register','mailQueue:','./mailQueue.events','save'];(function(_0x267fa5,_0x3f09b8){var _0x20fb4d=function(_0x3cd1e2){while(--_0x3cd1e2){_0x267fa5['push'](_0x267fa5['shift']());}};_0x20fb4d(++_0x3f09b8);}(_0xf5fe,0x1da));var _0xef5f=function(_0x24ef1c,_0x559d36){_0x24ef1c=_0x24ef1c-0x0;var _0x45ab3e=_0xf5fe[_0x24ef1c];return _0x45ab3e;};'use strict';var MailQueueEvents=require(_0xef5f('0x0'));var events=[_0xef5f('0x1'),_0xef5f('0x2'),_0xef5f('0x3')];function createListener(_0x1f97dd,_0x53d6e5){return function(_0x2183ba){_0x53d6e5[_0xef5f('0x4')](_0x1f97dd,_0x2183ba);};}function removeListener(_0xb47ede,_0x388497){return function(){MailQueueEvents['removeListener'](_0xb47ede,_0x388497);};}exports[_0xef5f('0x5')]=function(_0x254970){for(var _0x4bf0e6=0x0,_0x3e09e5=events['length'];_0x4bf0e6<_0x3e09e5;_0x4bf0e6++){var _0x4834d8=events[_0x4bf0e6];var _0xd47d67=createListener(_0xef5f('0x6')+_0x4834d8,_0x254970);MailQueueEvents['on'](_0x4834d8,_0xd47d67);}}; \ No newline at end of file +var _0x4ca7=['./mailQueue.events','save','remove','removeListener','register','length','mailQueue:'];(function(_0x210499,_0x17acd0){var _0x2ffbff=function(_0x14ba9c){while(--_0x14ba9c){_0x210499['push'](_0x210499['shift']());}};_0x2ffbff(++_0x17acd0);}(_0x4ca7,0x1e3));var _0x74ca=function(_0x4cf991,_0x52f975){_0x4cf991=_0x4cf991-0x0;var _0xd69618=_0x4ca7[_0x4cf991];return _0xd69618;};'use strict';var MailQueueEvents=require(_0x74ca('0x0'));var events=[_0x74ca('0x1'),_0x74ca('0x2'),'update'];function createListener(_0x2c7751,_0x169f5e){return function(_0x5c64e1){_0x169f5e['emit'](_0x2c7751,_0x5c64e1);};}function removeListener(_0x878a54,_0x4afef6){return function(){MailQueueEvents[_0x74ca('0x3')](_0x878a54,_0x4afef6);};}exports[_0x74ca('0x4')]=function(_0x4bccc5){for(var _0x352e08=0x0,_0x572dc2=events[_0x74ca('0x5')];_0x352e08<_0x572dc2;_0x352e08++){var _0x1d28e1=events[_0x352e08];var _0x33cabd=createListener(_0x74ca('0x6')+_0x1d28e1,_0x4bccc5);MailQueueEvents['on'](_0x1d28e1,_0x33cabd);}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/index.js b/server/api/mailQueueReport/index.js index 9c2be80..7147da5 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 _0x932e=['exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','isAuthenticated','index','get','/describe','describe','/:id','show','post','put','update','destroy'];(function(_0x1c09e4,_0xa951bd){var _0x42fab9=function(_0x5389f0){while(--_0x5389f0){_0x1c09e4['push'](_0x1c09e4['shift']());}};_0x42fab9(++_0xa951bd);}(_0x932e,0x190));var _0xe932=function(_0x9fae9f,_0x14aba8){_0x9fae9f=_0x9fae9f-0x0;var _0x187c35=_0x932e[_0x9fae9f];return _0x187c35;};'use strict';var multer=require(_0xe932('0x0'));var util=require(_0xe932('0x1'));var path=require(_0xe932('0x2'));var timeout=require(_0xe932('0x3'));var express=require(_0xe932('0x4'));var router=express[_0xe932('0x5')]();var fs_extra=require(_0xe932('0x6'));var auth=require(_0xe932('0x7'));var interaction=require(_0xe932('0x8'));var config=require('../../config/environment');var controller=require('./mailQueueReport.controller');router['get']('/',auth[_0xe932('0x9')](),controller[_0xe932('0xa')]);router[_0xe932('0xb')](_0xe932('0xc'),auth[_0xe932('0x9')](),controller[_0xe932('0xd')]);router['get'](_0xe932('0xe'),auth['isAuthenticated'](),controller[_0xe932('0xf')]);router[_0xe932('0x10')]('/',auth['isAuthenticated'](),controller['create']);router[_0xe932('0x11')](_0xe932('0xe'),auth[_0xe932('0x9')](),controller[_0xe932('0x12')]);router['delete'](_0xe932('0xe'),auth[_0xe932('0x9')](),controller[_0xe932('0x13')]);module[_0xe932('0x14')]=router; \ No newline at end of file +var _0x7291=['./mailQueueReport.controller','get','index','/describe','isAuthenticated','describe','/:id','show','create','put','update','exports','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x247aab,_0x6d308){var _0x198cd0=function(_0x2bf3a4){while(--_0x2bf3a4){_0x247aab['push'](_0x247aab['shift']());}};_0x198cd0(++_0x6d308);}(_0x7291,0x175));var _0x1729=function(_0x1b1eda,_0x4b7376){_0x1b1eda=_0x1b1eda-0x0;var _0x2b3f3a=_0x7291[_0x1b1eda];return _0x2b3f3a;};'use strict';var multer=require('multer');var util=require(_0x1729('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x1729('0x1'));var router=express[_0x1729('0x2')]();var fs_extra=require(_0x1729('0x3'));var auth=require(_0x1729('0x4'));var interaction=require(_0x1729('0x5'));var config=require(_0x1729('0x6'));var controller=require(_0x1729('0x7'));router[_0x1729('0x8')]('/',auth['isAuthenticated'](),controller[_0x1729('0x9')]);router[_0x1729('0x8')](_0x1729('0xa'),auth[_0x1729('0xb')](),controller[_0x1729('0xc')]);router[_0x1729('0x8')](_0x1729('0xd'),auth[_0x1729('0xb')](),controller[_0x1729('0xe')]);router['post']('/',auth[_0x1729('0xb')](),controller[_0x1729('0xf')]);router[_0x1729('0x10')](_0x1729('0xd'),auth[_0x1729('0xb')](),controller[_0x1729('0x11')]);router['delete'](_0x1729('0xd'),auth['isAuthenticated'](),controller['destroy']);module[_0x1729('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 f2d1376..6d551f2 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 _0x2371=['moment','sequelize','exports','STRING','DATE'];(function(_0x1bfbe1,_0x15b960){var _0x23529c=function(_0xa551ae){while(--_0xa551ae){_0x1bfbe1['push'](_0x1bfbe1['shift']());}};_0x23529c(++_0x15b960);}(_0x2371,0x140));var _0x1237=function(_0x58ee19,_0xdf0765){_0x58ee19=_0x58ee19-0x0;var _0x49af25=_0x2371[_0x58ee19];return _0x49af25;};'use strict';var moment=require(_0x1237('0x0'));var Sequelize=require(_0x1237('0x1'));module[_0x1237('0x2')]={'uniqueid':{'type':Sequelize[_0x1237('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x1237('0x3')]},'joinAt':{'type':Sequelize[_0x1237('0x4')]},'leaveAt':{'type':Sequelize[_0x1237('0x4')]},'acceptAt':{'type':Sequelize[_0x1237('0x4')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0x1237('0x3')]}}; \ No newline at end of file +var _0x60fe=['STRING','DATE'];(function(_0x2df507,_0x553862){var _0x1f7167=function(_0x11319e){while(--_0x11319e){_0x2df507['push'](_0x2df507['shift']());}};_0x1f7167(++_0x553862);}(_0x60fe,0x176));var _0xe60f=function(_0x416a3c,_0x481c83){_0x416a3c=_0x416a3c-0x0;var _0x2a055d=_0x60fe[_0x416a3c];return _0x2a055d;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize[_0xe60f('0x0')],'allowNull':![]},'from':{'type':Sequelize[_0xe60f('0x0')]},'joinAt':{'type':Sequelize[_0xe60f('0x1')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0xe60f('0x1')]},'reason':{'type':Sequelize[_0xe60f('0x0')]}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.controller.js b/server/api/mailQueueReport/mailQueueReport.controller.js index f90096a..fc4132f 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 _0xc1c6=['filters','attributes','intersection','fields','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','keys','length','find','create','body','describe','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','name','index','map','MailQueueReport','rawAttributes','type','key','model','query'];(function(_0x3aa911,_0xc1de1f){var _0x4f41df=function(_0x1845b0){while(--_0x1845b0){_0x3aa911['push'](_0x3aa911['shift']());}};_0x4f41df(++_0xc1de1f);}(_0xc1c6,0xf7));var _0x6c1c=function(_0x333a7e,_0x4dd45a){_0x333a7e=_0x333a7e-0x0;var _0x3c1a54=_0xc1c6[_0x333a7e];return _0x3c1a54;};'use strict';var emlformat=require(_0x6c1c('0x0'));var rimraf=require(_0x6c1c('0x1'));var zipdir=require(_0x6c1c('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6c1c('0x3'));var moment=require('moment');var BPromise=require(_0x6c1c('0x4'));var Mustache=require(_0x6c1c('0x5'));var util=require(_0x6c1c('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x6c1c('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6c1c('0x8'));var _=require('lodash');var squel=require(_0x6c1c('0x9'));var crypto=require(_0x6c1c('0xa'));var jsforce=require(_0x6c1c('0xb'));var deskjs=require(_0x6c1c('0xc'));var toCsv=require('to-csv');var querystring=require(_0x6c1c('0xd'));var Papa=require(_0x6c1c('0xe'));var Redis=require('ioredis');var authService=require(_0x6c1c('0xf'));var qs=require(_0x6c1c('0x10'));var as=require(_0x6c1c('0x11'));var hardwareService=require(_0x6c1c('0x12'));var logger=require('../../config/logger')(_0x6c1c('0x13'));var utils=require(_0x6c1c('0x14'));var config=require(_0x6c1c('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x6c1c('0x16'))['db'];function respondWithStatusCode(_0x12a9e6,_0x2067bd){_0x2067bd=_0x2067bd||0xcc;return function(_0x49304f){if(_0x49304f){return _0x12a9e6[_0x6c1c('0x17')](_0x2067bd);}return _0x12a9e6['status'](_0x2067bd)[_0x6c1c('0x18')]();};}function respondWithResult(_0x15a1fc,_0x2d279e){_0x2d279e=_0x2d279e||0xc8;return function(_0x154107){if(_0x154107){return _0x15a1fc[_0x6c1c('0x19')](_0x2d279e)[_0x6c1c('0x1a')](_0x154107);}};}function respondWithFilteredResult(_0x297c33,_0x41aa74){return function(_0x448f35){if(_0x448f35){var _0x5f3758=typeof _0x41aa74[_0x6c1c('0x1b')]===_0x6c1c('0x1c')&&typeof _0x41aa74['limit']===_0x6c1c('0x1c');var _0x237cac=_0x448f35['count'];var _0x137770=_0x5f3758?0x0:_0x41aa74['offset'];var _0x338dc2=_0x5f3758?_0x448f35[_0x6c1c('0x1d')]:_0x41aa74['offset']+_0x41aa74[_0x6c1c('0x1e')];var _0x59ab38;if(_0x338dc2>=_0x237cac){_0x338dc2=_0x237cac;_0x59ab38=0xc8;}else{_0x59ab38=0xce;}_0x297c33[_0x6c1c('0x19')](_0x59ab38);return _0x297c33[_0x6c1c('0x1f')](_0x6c1c('0x20'),_0x137770+'-'+_0x338dc2+'/'+_0x237cac)[_0x6c1c('0x1a')](_0x448f35);}return null;};}function patchUpdates(_0x1acf7f){return function(_0x1efb19){try{jsonpatch[_0x6c1c('0x21')](_0x1efb19,_0x1acf7f,!![]);}catch(_0x2ed830){return BPromise[_0x6c1c('0x22')](_0x2ed830);}return _0x1efb19[_0x6c1c('0x23')]();};}function saveUpdates(_0x3d2bf3,_0x450b1f){return function(_0x2382c0){if(_0x2382c0){return _0x2382c0[_0x6c1c('0x24')](_0x3d2bf3)[_0x6c1c('0x25')](function(_0x19c269){return _0x19c269;});}return null;};}function removeEntity(_0x2319d3,_0x12c638){return function(_0x3a3f13){if(_0x3a3f13){return _0x3a3f13[_0x6c1c('0x26')]()[_0x6c1c('0x25')](function(){_0x2319d3[_0x6c1c('0x19')](0xcc)[_0x6c1c('0x18')]();});}};}function handleEntityNotFound(_0x7ff10d,_0x18452d){return function(_0x80bc05){if(!_0x80bc05){_0x7ff10d[_0x6c1c('0x17')](0x194);}return _0x80bc05;};}function handleError(_0x1b9d7d,_0x2feaf4){_0x2feaf4=_0x2feaf4||0x1f4;return function(_0x5f4568){logger[_0x6c1c('0x27')](_0x5f4568['stack']);if(_0x5f4568[_0x6c1c('0x28')]){delete _0x5f4568['name'];}_0x1b9d7d[_0x6c1c('0x19')](_0x2feaf4)['send'](_0x5f4568);};}exports[_0x6c1c('0x29')]=function(_0xf557ba,_0x504348){var _0x3b1a4f={},_0x24da4c={},_0x4e13e3={'count':0x0,'rows':[]};var _0x3b319a=_[_0x6c1c('0x2a')](db[_0x6c1c('0x2b')][_0x6c1c('0x2c')],function(_0x4fc279){return{'name':_0x4fc279['fieldName'],'type':_0x4fc279[_0x6c1c('0x2d')][_0x6c1c('0x2e')]};});_0x24da4c[_0x6c1c('0x2f')]=_[_0x6c1c('0x2a')](_0x3b319a,_0x6c1c('0x28'));_0x24da4c[_0x6c1c('0x30')]=_['keys'](_0xf557ba[_0x6c1c('0x30')]);_0x24da4c[_0x6c1c('0x31')]=_['intersection'](_0x24da4c[_0x6c1c('0x2f')],_0x24da4c[_0x6c1c('0x30')]);_0x3b1a4f[_0x6c1c('0x32')]=_[_0x6c1c('0x33')](_0x24da4c['model'],qs[_0x6c1c('0x34')](_0xf557ba[_0x6c1c('0x30')][_0x6c1c('0x34')]));_0x3b1a4f['attributes']=_0x3b1a4f[_0x6c1c('0x32')]['length']?_0x3b1a4f[_0x6c1c('0x32')]:_0x24da4c['model'];if(!_0xf557ba[_0x6c1c('0x30')][_0x6c1c('0x35')](_0x6c1c('0x36'))){_0x3b1a4f['limit']=qs['limit'](_0xf557ba[_0x6c1c('0x30')][_0x6c1c('0x1e')]);_0x3b1a4f[_0x6c1c('0x1b')]=qs['offset'](_0xf557ba[_0x6c1c('0x30')]['offset']);}_0x3b1a4f['order']=qs[_0x6c1c('0x37')](_0xf557ba[_0x6c1c('0x30')][_0x6c1c('0x37')]);_0x3b1a4f[_0x6c1c('0x38')]=qs['filters'](_[_0x6c1c('0x39')](_0xf557ba[_0x6c1c('0x30')],_0x24da4c[_0x6c1c('0x31')]),_0x3b319a);if(_0xf557ba[_0x6c1c('0x30')][_0x6c1c('0x3a')]){_0x3b1a4f[_0x6c1c('0x38')]=_[_0x6c1c('0x3b')](_0x3b1a4f[_0x6c1c('0x38')],{'$or':_[_0x6c1c('0x2a')](_0x3b319a,function(_0x232508){if(_0x232508['type']!==_0x6c1c('0x3c')){var _0x464549={};_0x464549[_0x232508[_0x6c1c('0x28')]]={'$like':'%'+_0xf557ba[_0x6c1c('0x30')][_0x6c1c('0x3a')]+'%'};return _0x464549;}})});}_0x3b1a4f=_['merge']({},_0x3b1a4f,_0xf557ba['options']);var _0x549db1={'where':_0x3b1a4f[_0x6c1c('0x38')]};return db['MailQueueReport']['count'](_0x549db1)[_0x6c1c('0x25')](function(_0x37244e){_0x4e13e3['count']=_0x37244e;if(_0xf557ba[_0x6c1c('0x30')][_0x6c1c('0x3d')]){_0x3b1a4f[_0x6c1c('0x3e')]=[{'all':!![]}];}return db['MailQueueReport'][_0x6c1c('0x3f')](_0x3b1a4f);})[_0x6c1c('0x25')](function(_0x502e75){_0x4e13e3[_0x6c1c('0x40')]=_0x502e75;return _0x4e13e3;})['then'](respondWithFilteredResult(_0x504348,_0x3b1a4f))[_0x6c1c('0x41')](handleError(_0x504348,null));};exports[_0x6c1c('0x42')]=function(_0x16a389,_0x174f2c){var _0x10764a={'raw':!![],'where':{'id':_0x16a389[_0x6c1c('0x43')]['id']}},_0x595ba2={};_0x595ba2[_0x6c1c('0x2f')]=_[_0x6c1c('0x44')](db['MailQueueReport'][_0x6c1c('0x2c')]);_0x595ba2[_0x6c1c('0x30')]=_[_0x6c1c('0x44')](_0x16a389[_0x6c1c('0x30')]);_0x595ba2[_0x6c1c('0x31')]=_['intersection'](_0x595ba2[_0x6c1c('0x2f')],_0x595ba2['query']);_0x10764a['attributes']=_['intersection'](_0x595ba2[_0x6c1c('0x2f')],qs[_0x6c1c('0x34')](_0x16a389[_0x6c1c('0x30')][_0x6c1c('0x34')]));_0x10764a[_0x6c1c('0x32')]=_0x10764a[_0x6c1c('0x32')][_0x6c1c('0x45')]?_0x10764a[_0x6c1c('0x32')]:_0x595ba2['model'];if(_0x16a389[_0x6c1c('0x30')][_0x6c1c('0x3d')]){_0x10764a['include']=[{'all':!![]}];}_0x10764a=_[_0x6c1c('0x3b')]({},_0x10764a,_0x16a389['options']);return db[_0x6c1c('0x2b')][_0x6c1c('0x46')](_0x10764a)[_0x6c1c('0x25')](handleEntityNotFound(_0x174f2c,null))[_0x6c1c('0x25')](respondWithResult(_0x174f2c,null))[_0x6c1c('0x41')](handleError(_0x174f2c,null));};exports['create']=function(_0x1fe6e8,_0x58d075){return db[_0x6c1c('0x2b')][_0x6c1c('0x47')](_0x1fe6e8[_0x6c1c('0x48')],{})[_0x6c1c('0x25')](respondWithResult(_0x58d075,0xc9))[_0x6c1c('0x41')](handleError(_0x58d075,null));};exports[_0x6c1c('0x24')]=function(_0x52c14d,_0xa9889a){if(_0x52c14d[_0x6c1c('0x48')]['id']){delete _0x52c14d['body']['id'];}return db[_0x6c1c('0x2b')][_0x6c1c('0x46')]({'where':{'id':_0x52c14d[_0x6c1c('0x43')]['id']}})[_0x6c1c('0x25')](handleEntityNotFound(_0xa9889a,null))['then'](saveUpdates(_0x52c14d[_0x6c1c('0x48')],null))[_0x6c1c('0x25')](respondWithResult(_0xa9889a,null))[_0x6c1c('0x41')](handleError(_0xa9889a,null));};exports['destroy']=function(_0x5b8d69,_0x56b367){return db['MailQueueReport']['find']({'where':{'id':_0x5b8d69[_0x6c1c('0x43')]['id']}})[_0x6c1c('0x25')](handleEntityNotFound(_0x56b367,null))['then'](removeEntity(_0x56b367,null))[_0x6c1c('0x41')](handleError(_0x56b367,null));};exports[_0x6c1c('0x49')]=function(_0x2450ab,_0x5489ac){return db['MailQueueReport'][_0x6c1c('0x49')]()[_0x6c1c('0x25')](respondWithResult(_0x5489ac,null))['catch'](handleError(_0x5489ac,null));}; \ No newline at end of file +var _0xa6b0=['nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','findAll','rows','catch','keys','include','find','create','body','params','describe','eml-format','rimraf','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','undefined','limit','offset','count','set','Content-Range','apply','save','update','destroy','then','sendStatus','stack','name','index','map','MailQueueReport','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty'];(function(_0x175e89,_0x20835f){var _0x2ed996=function(_0x56239f){while(--_0x56239f){_0x175e89['push'](_0x175e89['shift']());}};_0x2ed996(++_0x20835f);}(_0xa6b0,0xaf));var _0x0a6b=function(_0x35aa03,_0x38ac7e){_0x35aa03=_0x35aa03-0x0;var _0x1fb2ef=_0xa6b0[_0x35aa03];return _0x1fb2ef;};'use strict';var emlformat=require(_0x0a6b('0x0'));var rimraf=require(_0x0a6b('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0a6b('0x2'));var moment=require(_0x0a6b('0x3'));var BPromise=require(_0x0a6b('0x4'));var Mustache=require('mustache');var util=require(_0x0a6b('0x5'));var path=require(_0x0a6b('0x6'));var sox=require(_0x0a6b('0x7'));var csv=require(_0x0a6b('0x8'));var ejs=require(_0x0a6b('0x9'));var fs=require('fs');var fs_extra=require(_0x0a6b('0xa'));var _=require(_0x0a6b('0xb'));var squel=require(_0x0a6b('0xc'));var crypto=require(_0x0a6b('0xd'));var jsforce=require(_0x0a6b('0xe'));var deskjs=require(_0x0a6b('0xf'));var toCsv=require(_0x0a6b('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x0a6b('0x10'));var authService=require(_0x0a6b('0x11'));var qs=require(_0x0a6b('0x12'));var as=require(_0x0a6b('0x13'));var hardwareService=require(_0x0a6b('0x14'));var logger=require(_0x0a6b('0x15'))(_0x0a6b('0x16'));var utils=require(_0x0a6b('0x17'));var config=require(_0x0a6b('0x18'));var licenseUtil=require(_0x0a6b('0x19'));var db=require(_0x0a6b('0x1a'))['db'];function respondWithStatusCode(_0x890493,_0x244a7d){_0x244a7d=_0x244a7d||0xcc;return function(_0x3cd9a4){if(_0x3cd9a4){return _0x890493['sendStatus'](_0x244a7d);}return _0x890493['status'](_0x244a7d)[_0x0a6b('0x1b')]();};}function respondWithResult(_0x2f27d6,_0x2abc4e){_0x2abc4e=_0x2abc4e||0xc8;return function(_0x177e87){if(_0x177e87){return _0x2f27d6[_0x0a6b('0x1c')](_0x2abc4e)[_0x0a6b('0x1d')](_0x177e87);}};}function respondWithFilteredResult(_0x9bb98e,_0x19e84c){return function(_0x1205a3){if(_0x1205a3){var _0x9d7aba=typeof _0x19e84c['offset']===_0x0a6b('0x1e')&&typeof _0x19e84c[_0x0a6b('0x1f')]==='undefined';var _0x290f7f=_0x1205a3['count'];var _0xcb412=_0x9d7aba?0x0:_0x19e84c[_0x0a6b('0x20')];var _0x2cb10b=_0x9d7aba?_0x1205a3[_0x0a6b('0x21')]:_0x19e84c['offset']+_0x19e84c[_0x0a6b('0x1f')];var _0x296162;if(_0x2cb10b>=_0x290f7f){_0x2cb10b=_0x290f7f;_0x296162=0xc8;}else{_0x296162=0xce;}_0x9bb98e['status'](_0x296162);return _0x9bb98e[_0x0a6b('0x22')](_0x0a6b('0x23'),_0xcb412+'-'+_0x2cb10b+'/'+_0x290f7f)[_0x0a6b('0x1d')](_0x1205a3);}return null;};}function patchUpdates(_0x491936){return function(_0x3ae3f4){try{jsonpatch[_0x0a6b('0x24')](_0x3ae3f4,_0x491936,!![]);}catch(_0x4077c6){return BPromise['reject'](_0x4077c6);}return _0x3ae3f4[_0x0a6b('0x25')]();};}function saveUpdates(_0x531e4c,_0xe4c2b9){return function(_0x5e8206){if(_0x5e8206){return _0x5e8206[_0x0a6b('0x26')](_0x531e4c)['then'](function(_0x1e5065){return _0x1e5065;});}return null;};}function removeEntity(_0xdda188,_0x3d153f){return function(_0x5c77fb){if(_0x5c77fb){return _0x5c77fb[_0x0a6b('0x27')]()[_0x0a6b('0x28')](function(){_0xdda188[_0x0a6b('0x1c')](0xcc)[_0x0a6b('0x1b')]();});}};}function handleEntityNotFound(_0x3b12a2,_0x5b2229){return function(_0x3e6a1d){if(!_0x3e6a1d){_0x3b12a2[_0x0a6b('0x29')](0x194);}return _0x3e6a1d;};}function handleError(_0x19a653,_0x4ce9d4){_0x4ce9d4=_0x4ce9d4||0x1f4;return function(_0x3a9092){logger['error'](_0x3a9092[_0x0a6b('0x2a')]);if(_0x3a9092[_0x0a6b('0x2b')]){delete _0x3a9092[_0x0a6b('0x2b')];}_0x19a653['status'](_0x4ce9d4)['send'](_0x3a9092);};}exports[_0x0a6b('0x2c')]=function(_0xe01bba,_0x1aecc7){var _0x3d649e={},_0x1935a3={},_0x2bbcb1={'count':0x0,'rows':[]};var _0x486f0d=_[_0x0a6b('0x2d')](db[_0x0a6b('0x2e')]['rawAttributes'],function(_0x4744d1){return{'name':_0x4744d1['fieldName'],'type':_0x4744d1['type'][_0x0a6b('0x2f')]};});_0x1935a3[_0x0a6b('0x30')]=_[_0x0a6b('0x2d')](_0x486f0d,_0x0a6b('0x2b'));_0x1935a3[_0x0a6b('0x31')]=_['keys'](_0xe01bba['query']);_0x1935a3[_0x0a6b('0x32')]=_[_0x0a6b('0x33')](_0x1935a3[_0x0a6b('0x30')],_0x1935a3[_0x0a6b('0x31')]);_0x3d649e['attributes']=_[_0x0a6b('0x33')](_0x1935a3[_0x0a6b('0x30')],qs['fields'](_0xe01bba['query'][_0x0a6b('0x34')]));_0x3d649e[_0x0a6b('0x35')]=_0x3d649e['attributes'][_0x0a6b('0x36')]?_0x3d649e[_0x0a6b('0x35')]:_0x1935a3[_0x0a6b('0x30')];if(!_0xe01bba[_0x0a6b('0x31')][_0x0a6b('0x37')](_0x0a6b('0x38'))){_0x3d649e[_0x0a6b('0x1f')]=qs[_0x0a6b('0x1f')](_0xe01bba[_0x0a6b('0x31')][_0x0a6b('0x1f')]);_0x3d649e[_0x0a6b('0x20')]=qs[_0x0a6b('0x20')](_0xe01bba['query'][_0x0a6b('0x20')]);}_0x3d649e[_0x0a6b('0x39')]=qs['sort'](_0xe01bba[_0x0a6b('0x31')][_0x0a6b('0x3a')]);_0x3d649e[_0x0a6b('0x3b')]=qs[_0x0a6b('0x32')](_[_0x0a6b('0x3c')](_0xe01bba[_0x0a6b('0x31')],_0x1935a3[_0x0a6b('0x32')]),_0x486f0d);if(_0xe01bba[_0x0a6b('0x31')][_0x0a6b('0x3d')]){_0x3d649e['where']=_[_0x0a6b('0x3e')](_0x3d649e[_0x0a6b('0x3b')],{'$or':_[_0x0a6b('0x2d')](_0x486f0d,function(_0x2f7e4b){if(_0x2f7e4b[_0x0a6b('0x3f')]!==_0x0a6b('0x40')){var _0x25254d={};_0x25254d[_0x2f7e4b[_0x0a6b('0x2b')]]={'$like':'%'+_0xe01bba[_0x0a6b('0x31')]['filter']+'%'};return _0x25254d;}})});}_0x3d649e=_[_0x0a6b('0x3e')]({},_0x3d649e,_0xe01bba[_0x0a6b('0x41')]);var _0x3aa7d5={'where':_0x3d649e[_0x0a6b('0x3b')]};return db[_0x0a6b('0x2e')][_0x0a6b('0x21')](_0x3aa7d5)[_0x0a6b('0x28')](function(_0x127e20){_0x2bbcb1[_0x0a6b('0x21')]=_0x127e20;if(_0xe01bba['query'][_0x0a6b('0x42')]){_0x3d649e['include']=[{'all':!![]}];}return db['MailQueueReport'][_0x0a6b('0x43')](_0x3d649e);})['then'](function(_0x556a28){_0x2bbcb1[_0x0a6b('0x44')]=_0x556a28;return _0x2bbcb1;})[_0x0a6b('0x28')](respondWithFilteredResult(_0x1aecc7,_0x3d649e))[_0x0a6b('0x45')](handleError(_0x1aecc7,null));};exports['show']=function(_0x445a7b,_0x4d32bf){var _0x531f94={'raw':!![],'where':{'id':_0x445a7b['params']['id']}},_0x1114f1={};_0x1114f1[_0x0a6b('0x30')]=_['keys'](db[_0x0a6b('0x2e')]['rawAttributes']);_0x1114f1['query']=_[_0x0a6b('0x46')](_0x445a7b[_0x0a6b('0x31')]);_0x1114f1[_0x0a6b('0x32')]=_[_0x0a6b('0x33')](_0x1114f1['model'],_0x1114f1[_0x0a6b('0x31')]);_0x531f94[_0x0a6b('0x35')]=_[_0x0a6b('0x33')](_0x1114f1[_0x0a6b('0x30')],qs[_0x0a6b('0x34')](_0x445a7b[_0x0a6b('0x31')][_0x0a6b('0x34')]));_0x531f94['attributes']=_0x531f94[_0x0a6b('0x35')][_0x0a6b('0x36')]?_0x531f94[_0x0a6b('0x35')]:_0x1114f1[_0x0a6b('0x30')];if(_0x445a7b[_0x0a6b('0x31')][_0x0a6b('0x42')]){_0x531f94[_0x0a6b('0x47')]=[{'all':!![]}];}_0x531f94=_[_0x0a6b('0x3e')]({},_0x531f94,_0x445a7b[_0x0a6b('0x41')]);return db['MailQueueReport'][_0x0a6b('0x48')](_0x531f94)[_0x0a6b('0x28')](handleEntityNotFound(_0x4d32bf,null))[_0x0a6b('0x28')](respondWithResult(_0x4d32bf,null))[_0x0a6b('0x45')](handleError(_0x4d32bf,null));};exports[_0x0a6b('0x49')]=function(_0x638ba8,_0x8f1372){return db['MailQueueReport']['create'](_0x638ba8[_0x0a6b('0x4a')],{})[_0x0a6b('0x28')](respondWithResult(_0x8f1372,0xc9))[_0x0a6b('0x45')](handleError(_0x8f1372,null));};exports[_0x0a6b('0x26')]=function(_0x2ca82a,_0x446187){if(_0x2ca82a[_0x0a6b('0x4a')]['id']){delete _0x2ca82a[_0x0a6b('0x4a')]['id'];}return db[_0x0a6b('0x2e')]['find']({'where':{'id':_0x2ca82a[_0x0a6b('0x4b')]['id']}})[_0x0a6b('0x28')](handleEntityNotFound(_0x446187,null))[_0x0a6b('0x28')](saveUpdates(_0x2ca82a[_0x0a6b('0x4a')],null))[_0x0a6b('0x28')](respondWithResult(_0x446187,null))['catch'](handleError(_0x446187,null));};exports[_0x0a6b('0x27')]=function(_0x3fd0df,_0x3aa85f){return db[_0x0a6b('0x2e')][_0x0a6b('0x48')]({'where':{'id':_0x3fd0df[_0x0a6b('0x4b')]['id']}})[_0x0a6b('0x28')](handleEntityNotFound(_0x3aa85f,null))[_0x0a6b('0x28')](removeEntity(_0x3aa85f,null))[_0x0a6b('0x45')](handleError(_0x3aa85f,null));};exports[_0x0a6b('0x4c')]=function(_0x5d8a4f,_0x4c81a7){return db[_0x0a6b('0x2e')]['describe']()[_0x0a6b('0x28')](respondWithResult(_0x4c81a7,null))['catch'](handleError(_0x4c81a7,null));}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.model.js b/server/api/mailQueueReport/mailQueueReport.model.js index f025b0b..292686f 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 _0xcdd9=['moment','bluebird','request-promise','path','exports','define','MailQueueReport','report_mail_queue','uniqueid','lodash','util','../../config/logger','api'];(function(_0xd91d36,_0x439691){var _0x5b2267=function(_0x3050f2){while(--_0x3050f2){_0xd91d36['push'](_0xd91d36['shift']());}};_0x5b2267(++_0x439691);}(_0xcdd9,0x19c));var _0x9cdd=function(_0x4a10fe,_0x250d29){_0x4a10fe=_0x4a10fe-0x0;var _0x49eb71=_0xcdd9[_0x4a10fe];return _0x49eb71;};'use strict';var _=require(_0x9cdd('0x0'));var util=require(_0x9cdd('0x1'));var logger=require(_0x9cdd('0x2'))(_0x9cdd('0x3'));var moment=require(_0x9cdd('0x4'));var BPromise=require(_0x9cdd('0x5'));var rp=require(_0x9cdd('0x6'));var fs=require('fs');var path=require(_0x9cdd('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./mailQueueReport.attributes');module[_0x9cdd('0x8')]=function(_0x38d6f0,_0x398585){return _0x38d6f0[_0x9cdd('0x9')](_0x9cdd('0xa'),attributes,{'tableName':_0x9cdd('0xb'),'paranoid':![],'indexes':[{'name':_0x9cdd('0xc'),'fields':[_0x9cdd('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x0a0d=['moment','request-promise','path','rimraf','../../config/environment','./mailQueueReport.attributes','uniqueid','api'];(function(_0x568f87,_0x33cba8){var _0xc44e84=function(_0x1640cd){while(--_0x1640cd){_0x568f87['push'](_0x568f87['shift']());}};_0xc44e84(++_0x33cba8);}(_0x0a0d,0xe7));var _0xd0a0=function(_0x5ca5bc,_0x5b8a9d){_0x5ca5bc=_0x5ca5bc-0x0;var _0x26ca86=_0x0a0d[_0x5ca5bc];return _0x26ca86;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0xd0a0('0x0'));var moment=require(_0xd0a0('0x1'));var BPromise=require('bluebird');var rp=require(_0xd0a0('0x2'));var fs=require('fs');var path=require(_0xd0a0('0x3'));var rimraf=require(_0xd0a0('0x4'));var config=require(_0xd0a0('0x5'));var attributes=require(_0xd0a0('0x6'));module['exports']=function(_0x2ce9d6,_0x572843){return _0x2ce9d6['define']('MailQueueReport',attributes,{'tableName':'report_mail_queue','paranoid':![],'indexes':[{'name':_0xd0a0('0x7'),'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 1b0d89d..f4e5d16 100644 --- a/server/api/mailQueueReport/mailQueueReport.rpc.js +++ b/server/api/mailQueueReport/mailQueueReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xadb5=['MailQueueReport,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','CreateMailQueueReport','create','options','raw','debug','MailQueueReport','body','attributes','limit','UpdateMailQueueReport','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info'];(function(_0x5a9f70,_0x4a7f0f){var _0x363cd1=function(_0xec9124){while(--_0xec9124){_0x5a9f70['push'](_0x5a9f70['shift']());}};_0x363cd1(++_0x4a7f0f);}(_0xadb5,0xad));var _0x5adb=function(_0x2a0c6d,_0x53f4cc){_0x2a0c6d=_0x2a0c6d-0x0;var _0x2277ac=_0xadb5[_0x2a0c6d];return _0x2277ac;};'use strict';var _=require('lodash');var util=require(_0x5adb('0x0'));var moment=require('moment');var BPromise=require(_0x5adb('0x1'));var rs=require(_0x5adb('0x2'));var fs=require('fs');var Redis=require(_0x5adb('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x5adb('0x4'));var logger=require(_0x5adb('0x5'))(_0x5adb('0x6'));var config=require('../../config/environment');var jayson=require(_0x5adb('0x7'));var client=jayson[_0x5adb('0x8')][_0x5adb('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3213e8,_0xdf3776,_0x353885){return new BPromise(function(_0x47228a,_0x6d1b45){return client[_0x5adb('0xa')](_0x3213e8,_0x353885)[_0x5adb('0xb')](function(_0x34f59d){logger[_0x5adb('0xc')](_0x5adb('0xd'),_0xdf3776,_0x5adb('0xe'));logger['debug']('MailQueueReport,\x20%s,\x20%s,\x20%s',_0xdf3776,_0x5adb('0xe'),JSON[_0x5adb('0xf')](_0x34f59d));if(_0x34f59d[_0x5adb('0x10')]){if(_0x34f59d['error'][_0x5adb('0x11')]===0x1f4){logger['error'](_0x5adb('0xd'),_0xdf3776,_0x34f59d['error'][_0x5adb('0x12')]);return _0x6d1b45(_0x34f59d[_0x5adb('0x10')][_0x5adb('0x12')]);}logger['error'](_0x5adb('0xd'),_0xdf3776,_0x34f59d[_0x5adb('0x10')][_0x5adb('0x12')]);return _0x47228a(_0x34f59d['error'][_0x5adb('0x12')]);}else{logger['info'](_0x5adb('0xd'),_0xdf3776,_0x5adb('0xe'));_0x47228a(_0x34f59d[_0x5adb('0x13')][_0x5adb('0x12')]);}})[_0x5adb('0x14')](function(_0x39d24d){logger[_0x5adb('0x10')](_0x5adb('0xd'),_0xdf3776,_0x39d24d);_0x6d1b45(_0x39d24d);});});}exports[_0x5adb('0x15')]=function(_0x529b65){var _0x3fff62=this;return new Promise(function(_0x5de028,_0x1d9e86){return db['MailQueueReport'][_0x5adb('0x16')](_0x529b65['body'],{'raw':_0x529b65['options']?_0x529b65[_0x5adb('0x17')][_0x5adb('0x18')]===undefined?!![]:![]:!![]})[_0x5adb('0xb')](function(_0x1fd4a7){logger[_0x5adb('0xc')]('CreateMailQueueReport',_0x529b65);logger[_0x5adb('0x19')]('CreateMailQueueReport',_0x529b65,JSON['stringify'](_0x1fd4a7));_0x5de028(_0x1fd4a7);})[_0x5adb('0x14')](function(_0x379b33){logger[_0x5adb('0x10')](_0x5adb('0x15'),_0x379b33[_0x5adb('0x12')],_0x529b65);_0x1d9e86(_0x3fff62[_0x5adb('0x10')](0x1f4,_0x379b33[_0x5adb('0x12')]));});});};exports['UpdateMailQueueReport']=function(_0x4b1957){var _0x373cc3=this;return new Promise(function(_0x3220cd,_0x3839fb){return db[_0x5adb('0x1a')]['update'](_0x4b1957[_0x5adb('0x1b')],{'raw':_0x4b1957[_0x5adb('0x17')]?_0x4b1957['options'][_0x5adb('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4b1957[_0x5adb('0x17')]?_0x4b1957[_0x5adb('0x17')]['where']||null:null,'attributes':_0x4b1957[_0x5adb('0x17')]?_0x4b1957[_0x5adb('0x17')][_0x5adb('0x1c')]||null:null,'limit':_0x4b1957[_0x5adb('0x17')]?_0x4b1957[_0x5adb('0x17')][_0x5adb('0x1d')]||null:null})['then'](function(_0x49992e){logger['info'](_0x5adb('0x1e'),_0x4b1957);logger[_0x5adb('0x19')](_0x5adb('0x1e'),_0x4b1957,JSON[_0x5adb('0xf')](_0x49992e));_0x3220cd(_0x49992e);})[_0x5adb('0x14')](function(_0x4de310){logger[_0x5adb('0x10')](_0x5adb('0x1e'),_0x4de310[_0x5adb('0x12')],_0x4b1957);_0x3839fb(_0x373cc3[_0x5adb('0x10')](0x1f4,_0x4de310[_0x5adb('0x12')]));});});}; \ No newline at end of file +var _0xc4aa=['create','body','options','raw','update','where','attributes','limit','UpdateMailQueueReport','stringify','lodash','util','moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','request','then','MailQueueReport,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','catch','CreateMailQueueReport','MailQueueReport'];(function(_0x1948c4,_0x4eb78a){var _0x2b835e=function(_0x347f1b){while(--_0x347f1b){_0x1948c4['push'](_0x1948c4['shift']());}};_0x2b835e(++_0x4eb78a);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x1928c9,_0x13a6d1){_0x1928c9=_0x1928c9-0x0;var _0x51b5fb=_0xc4aa[_0x1928c9];return _0x51b5fb;};'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')]('MailQueueReport,\x20%s,\x20%s,\x20%s',_0x3ef77c,_0xac4a('0xe'),JSON['stringify'](_0x26ec84));if(_0x26ec84[_0xac4a('0x10')]){if(_0x26ec84['error'][_0xac4a('0x11')]===0x1f4){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84['error'][_0xac4a('0x12')]);return _0x5b8339(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);return _0x5c6179(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}else{logger[_0xac4a('0x13')](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));_0x5c6179(_0x26ec84['result'][_0xac4a('0x12')]);}})[_0xac4a('0x14')](function(_0x23eb66){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x23eb66);_0x5b8339(_0x23eb66);});});}exports[_0xac4a('0x15')]=function(_0x28e304){var _0x44ec59=this;return new Promise(function(_0x546c5d,_0x5ac21e){return db[_0xac4a('0x16')][_0xac4a('0x17')](_0x28e304[_0xac4a('0x18')],{'raw':_0x28e304['options']?_0x28e304[_0xac4a('0x19')][_0xac4a('0x1a')]===undefined?!![]:![]:!![]})[_0xac4a('0xc')](function(_0x3a3cdb){logger[_0xac4a('0x13')](_0xac4a('0x15'),_0x28e304);logger[_0xac4a('0xf')](_0xac4a('0x15'),_0x28e304,JSON['stringify'](_0x3a3cdb));_0x546c5d(_0x3a3cdb);})[_0xac4a('0x14')](function(_0x3204ad){logger['error'](_0xac4a('0x15'),_0x3204ad[_0xac4a('0x12')],_0x28e304);_0x5ac21e(_0x44ec59[_0xac4a('0x10')](0x1f4,_0x3204ad[_0xac4a('0x12')]));});});};exports['UpdateMailQueueReport']=function(_0x1b7998){var _0x2503d8=this;return new Promise(function(_0x15435c,_0x412494){return db[_0xac4a('0x16')][_0xac4a('0x1b')](_0x1b7998[_0xac4a('0x18')],{'raw':_0x1b7998[_0xac4a('0x19')]?_0x1b7998[_0xac4a('0x19')][_0xac4a('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1b7998[_0xac4a('0x19')]?_0x1b7998[_0xac4a('0x19')][_0xac4a('0x1c')]||null:null,'attributes':_0x1b7998[_0xac4a('0x19')]?_0x1b7998[_0xac4a('0x19')][_0xac4a('0x1d')]||null:null,'limit':_0x1b7998['options']?_0x1b7998[_0xac4a('0x19')][_0xac4a('0x1e')]||null:null})[_0xac4a('0xc')](function(_0x2772fe){logger[_0xac4a('0x13')]('UpdateMailQueueReport',_0x1b7998);logger['debug'](_0xac4a('0x1f'),_0x1b7998,JSON[_0xac4a('0x20')](_0x2772fe));_0x15435c(_0x2772fe);})[_0xac4a('0x14')](function(_0x546b65){logger['error'](_0xac4a('0x1f'),_0x546b65[_0xac4a('0x12')],_0x1b7998);_0x412494(_0x2503d8[_0xac4a('0x10')](0x1f4,_0x546b65[_0xac4a('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/mailServerIn/index.js b/server/api/mailServerIn/index.js index aff709b..94fa82c 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(_0x383205,_0x3daa05){var _0x3e969e=function(_0x3f0d0c){while(--_0x3f0d0c){_0x383205['push'](_0x383205['shift']());}};_0x3e969e(++_0x3daa05);}(_0x70e0,0x17b));var _0x070e=function(_0x184f90,_0x891f7c){_0x184f90=_0x184f90-0x0;var _0x5bd381=_0x70e0[_0x184f90];return _0x5bd381;};'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 _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x4144b3,_0xa4a3db){var _0x144901=function(_0x4b02a4){while(--_0x4b02a4){_0x4144b3['push'](_0x4144b3['shift']());}};_0x144901(++_0xa4a3db);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2d8fc2,_0x1c461d){_0x2d8fc2=_0x2d8fc2-0x0;var _0x3a9e53=_0xa9e0[_0x2d8fc2];return _0x3a9e53;};'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/mailServerIn/mailServerIn.attributes.js b/server/api/mailServerIn/mailServerIn.attributes.js index 76c51be..8b29708 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 _0x823c=['BOOLEAN','INTEGER','INBOX','sequelize','STRING'];(function(_0x522ae8,_0x3b637e){var _0x3189b9=function(_0x3115d4){while(--_0x3115d4){_0x522ae8['push'](_0x522ae8['shift']());}};_0x3189b9(++_0x3b637e);}(_0x823c,0x143));var _0xc823=function(_0x5a3620,_0x32a181){_0x5a3620=_0x5a3620-0x0;var _0x5f0f9c=_0x823c[_0x5a3620];return _0x5f0f9c;};'use strict';var Sequelize=require(_0xc823('0x0'));module['exports']={'description':{'type':Sequelize[_0xc823('0x1')]},'host':{'type':Sequelize[_0xc823('0x1')]},'authentication':{'type':Sequelize[_0xc823('0x2')],'defaultValue':!![]},'user':{'type':Sequelize[_0xc823('0x1')]},'password':{'type':Sequelize[_0xc823('0x1')]},'port':{'type':Sequelize[_0xc823('0x3')]},'tls':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0xc823('0x1')],'defaultValue':_0xc823('0x4')},'connTimeout':{'type':Sequelize[_0xc823('0x3')],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0xc823('0x3')],'defaultValue':0x5},'service':{'type':Sequelize[_0xc823('0x1')]}}; \ No newline at end of file +var _0xa149=['sequelize','exports','STRING','BOOLEAN','INTEGER','INBOX'];(function(_0x2df14d,_0x36a828){var _0x5a65d2=function(_0x5b86a1){while(--_0x5b86a1){_0x2df14d['push'](_0x2df14d['shift']());}};_0x5a65d2(++_0x36a828);}(_0xa149,0x18c));var _0x9a14=function(_0x4dafd1,_0x5bdbc3){_0x4dafd1=_0x4dafd1-0x0;var _0x34e53a=_0xa149[_0x4dafd1];return _0x34e53a;};'use strict';var Sequelize=require(_0x9a14('0x0'));module[_0x9a14('0x1')]={'description':{'type':Sequelize[_0x9a14('0x2')]},'host':{'type':Sequelize[_0x9a14('0x2')]},'authentication':{'type':Sequelize[_0x9a14('0x3')],'defaultValue':!![]},'user':{'type':Sequelize[_0x9a14('0x2')]},'password':{'type':Sequelize[_0x9a14('0x2')]},'port':{'type':Sequelize[_0x9a14('0x4')]},'tls':{'type':Sequelize[_0x9a14('0x3')],'defaultValue':!![]},'mailbox':{'type':Sequelize['STRING'],'defaultValue':_0x9a14('0x5')},'connTimeout':{'type':Sequelize[_0x9a14('0x4')],'defaultValue':0xa},'authTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'service':{'type':Sequelize[_0x9a14('0x2')]}}; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.model.js b/server/api/mailServerIn/mailServerIn.model.js index e157836..24bc038 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 _0xdf85=['exports','define','MailServerIn','mail_servers_in','lodash','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./mailServerIn.attributes'];(function(_0x257b45,_0x3820d5){var _0x4ecab5=function(_0x3c7f52){while(--_0x3c7f52){_0x257b45['push'](_0x257b45['shift']());}};_0x4ecab5(++_0x3820d5);}(_0xdf85,0x12f));var _0x5df8=function(_0x2c7618,_0x26be9c){_0x2c7618=_0x2c7618-0x0;var _0x5ce3f0=_0xdf85[_0x2c7618];return _0x5ce3f0;};'use strict';var _=require(_0x5df8('0x0'));var util=require('util');var logger=require(_0x5df8('0x1'))('api');var moment=require(_0x5df8('0x2'));var BPromise=require(_0x5df8('0x3'));var rp=require(_0x5df8('0x4'));var fs=require('fs');var path=require(_0x5df8('0x5'));var rimraf=require(_0x5df8('0x6'));var config=require(_0x5df8('0x7'));var attributes=require(_0x5df8('0x8'));module[_0x5df8('0x9')]=function(_0x47d38c,_0x42ab33){return _0x47d38c[_0x5df8('0xa')](_0x5df8('0xb'),attributes,{'tableName':_0x5df8('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xec29=['define','mail_servers_in','lodash','util','../../config/logger','moment','bluebird','path','rimraf','./mailServerIn.attributes','exports'];(function(_0x211632,_0x378e2e){var _0x5a1da1=function(_0x44aff2){while(--_0x44aff2){_0x211632['push'](_0x211632['shift']());}};_0x5a1da1(++_0x378e2e);}(_0xec29,0x115));var _0x9ec2=function(_0x3046e6,_0x4e1aee){_0x3046e6=_0x3046e6-0x0;var _0x298578=_0xec29[_0x3046e6];return _0x298578;};'use strict';var _=require(_0x9ec2('0x0'));var util=require(_0x9ec2('0x1'));var logger=require(_0x9ec2('0x2'))('api');var moment=require(_0x9ec2('0x3'));var BPromise=require(_0x9ec2('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9ec2('0x5'));var rimraf=require(_0x9ec2('0x6'));var config=require('../../config/environment');var attributes=require(_0x9ec2('0x7'));module[_0x9ec2('0x8')]=function(_0x103432,_0x103350){return _0x103432[_0x9ec2('0x9')]('MailServerIn',attributes,{'tableName':_0x9ec2('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 3063935..645afeb 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 _0x184a=['GetMailServerIn','MailServerIn','options','raw','attributes','limit','include','map','model','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','MailServerIn,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','info','catch'];(function(_0x2ae298,_0x144b30){var _0x1d958a=function(_0x53c789){while(--_0x53c789){_0x2ae298['push'](_0x2ae298['shift']());}};_0x1d958a(++_0x144b30);}(_0x184a,0x9a));var _0xa184=function(_0xe5dc8c,_0xc5b48f){_0xe5dc8c=_0xe5dc8c-0x0;var _0x20bfd8=_0x184a[_0xe5dc8c];return _0x20bfd8;};'use strict';var _=require(_0xa184('0x0'));var util=require('util');var moment=require(_0xa184('0x1'));var BPromise=require(_0xa184('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa184('0x3'));var db=require(_0xa184('0x4'))['db'];var utils=require(_0xa184('0x5'));var logger=require(_0xa184('0x6'))(_0xa184('0x7'));var config=require(_0xa184('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0xa184('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x374a99,_0x462720,_0x166e9f){return new BPromise(function(_0x19421b,_0xa76dc3){return client[_0xa184('0xa')](_0x374a99,_0x166e9f)[_0xa184('0xb')](function(_0x1bb05c){logger['info'](_0xa184('0xc'),_0x462720,_0xa184('0xd'));logger[_0xa184('0xe')]('MailServerIn,\x20%s,\x20%s,\x20%s',_0x462720,_0xa184('0xd'),JSON[_0xa184('0xf')](_0x1bb05c));if(_0x1bb05c[_0xa184('0x10')]){if(_0x1bb05c[_0xa184('0x10')]['code']===0x1f4){logger['error'](_0xa184('0xc'),_0x462720,_0x1bb05c[_0xa184('0x10')][_0xa184('0x11')]);return _0xa76dc3(_0x1bb05c['error'][_0xa184('0x11')]);}logger[_0xa184('0x10')]('MailServerIn,\x20%s,\x20%s',_0x462720,_0x1bb05c[_0xa184('0x10')][_0xa184('0x11')]);return _0x19421b(_0x1bb05c[_0xa184('0x10')]['message']);}else{logger[_0xa184('0x12')]('MailServerIn,\x20%s,\x20%s',_0x462720,'request\x20sent');_0x19421b(_0x1bb05c['result']['message']);}})[_0xa184('0x13')](function(_0x35f24f){logger['error'](_0xa184('0xc'),_0x462720,_0x35f24f);_0xa76dc3(_0x35f24f);});});}exports[_0xa184('0x14')]=function(_0xa1cae6){var _0x56d72b=this;return new Promise(function(_0xc6dde0,_0x49c14b){return db[_0xa184('0x15')]['findAll']({'raw':_0xa1cae6[_0xa184('0x16')]?_0xa1cae6[_0xa184('0x16')][_0xa184('0x17')]===undefined?!![]:![]:!![],'where':_0xa1cae6[_0xa184('0x16')]?_0xa1cae6['options']['where']||null:null,'attributes':_0xa1cae6[_0xa184('0x16')]?_0xa1cae6['options'][_0xa184('0x18')]||null:null,'limit':_0xa1cae6[_0xa184('0x16')]?_0xa1cae6[_0xa184('0x16')][_0xa184('0x19')]||null:null,'include':_0xa1cae6[_0xa184('0x16')]?_0xa1cae6['options'][_0xa184('0x1a')]?_['map'](_0xa1cae6['options']['include'],function(_0x4cdd62){return{'model':db[_0x4cdd62['model']],'as':_0x4cdd62['as'],'attributes':_0x4cdd62[_0xa184('0x18')],'include':_0x4cdd62[_0xa184('0x1a')]?_[_0xa184('0x1b')](_0x4cdd62[_0xa184('0x1a')],function(_0x439fbf){return{'model':db[_0x439fbf[_0xa184('0x1c')]],'as':_0x439fbf['as'],'attributes':_0x439fbf[_0xa184('0x18')],'include':_0x439fbf[_0xa184('0x1a')]?_[_0xa184('0x1b')](_0x439fbf[_0xa184('0x1a')],function(_0x1304a2){return{'model':db[_0x1304a2['model']],'as':_0x1304a2['as'],'attributes':_0x1304a2[_0xa184('0x18')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x25d001){logger[_0xa184('0x12')]('GetMailServerIn',_0xa1cae6);logger[_0xa184('0xe')](_0xa184('0x14'),_0xa1cae6,JSON[_0xa184('0xf')](_0x25d001));_0xc6dde0(_0x25d001);})['catch'](function(_0x52f8ff){logger['error'](_0xa184('0x14'),_0x52f8ff[_0xa184('0x11')],_0xa1cae6);_0x49c14b(_0x56d72b['error'](0x1f4,_0x52f8ff[_0xa184('0x11')]));});});}; \ No newline at end of file +var _0x7306=['map','model','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','request','then','info','MailServerIn,\x20%s,\x20%s','request\x20sent','debug','MailServerIn,\x20%s,\x20%s,\x20%s','error','message','catch','GetMailServerIn','MailServerIn','options','where','attributes','limit','include'];(function(_0x4e18bb,_0x2b28df){var _0x5ebf1f=function(_0x2f43cc){while(--_0x2f43cc){_0x4e18bb['push'](_0x4e18bb['shift']());}};_0x5ebf1f(++_0x2b28df);}(_0x7306,0xb7));var _0x6730=function(_0x47911f,_0x452bf9){_0x47911f=_0x47911f-0x0;var _0x557cdf=_0x7306[_0x47911f];return _0x557cdf;};'use strict';var _=require(_0x6730('0x0'));var util=require(_0x6730('0x1'));var moment=require(_0x6730('0x2'));var BPromise=require(_0x6730('0x3'));var rs=require(_0x6730('0x4'));var fs=require('fs');var Redis=require(_0x6730('0x5'));var db=require(_0x6730('0x6'))['db'];var utils=require(_0x6730('0x7'));var logger=require('../../config/logger')(_0x6730('0x8'));var config=require('../../config/environment');var jayson=require(_0x6730('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x584f12,_0x2311c6,_0x54f0c){return new BPromise(function(_0x27508e,_0x5b3a8e){return client[_0x6730('0xa')](_0x584f12,_0x54f0c)[_0x6730('0xb')](function(_0x1d1ec4){logger[_0x6730('0xc')](_0x6730('0xd'),_0x2311c6,_0x6730('0xe'));logger[_0x6730('0xf')](_0x6730('0x10'),_0x2311c6,_0x6730('0xe'),JSON['stringify'](_0x1d1ec4));if(_0x1d1ec4[_0x6730('0x11')]){if(_0x1d1ec4[_0x6730('0x11')]['code']===0x1f4){logger[_0x6730('0x11')](_0x6730('0xd'),_0x2311c6,_0x1d1ec4[_0x6730('0x11')][_0x6730('0x12')]);return _0x5b3a8e(_0x1d1ec4[_0x6730('0x11')][_0x6730('0x12')]);}logger[_0x6730('0x11')]('MailServerIn,\x20%s,\x20%s',_0x2311c6,_0x1d1ec4['error']['message']);return _0x27508e(_0x1d1ec4[_0x6730('0x11')][_0x6730('0x12')]);}else{logger[_0x6730('0xc')](_0x6730('0xd'),_0x2311c6,_0x6730('0xe'));_0x27508e(_0x1d1ec4['result'][_0x6730('0x12')]);}})[_0x6730('0x13')](function(_0x264572){logger['error'](_0x6730('0xd'),_0x2311c6,_0x264572);_0x5b3a8e(_0x264572);});});}exports[_0x6730('0x14')]=function(_0x50c58b){var _0xe2121d=this;return new Promise(function(_0x38207a,_0x497ef5){return db[_0x6730('0x15')]['findAll']({'raw':_0x50c58b[_0x6730('0x16')]?_0x50c58b[_0x6730('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x50c58b[_0x6730('0x16')]?_0x50c58b['options'][_0x6730('0x17')]||null:null,'attributes':_0x50c58b[_0x6730('0x16')]?_0x50c58b[_0x6730('0x16')][_0x6730('0x18')]||null:null,'limit':_0x50c58b[_0x6730('0x16')]?_0x50c58b[_0x6730('0x16')][_0x6730('0x19')]||null:null,'include':_0x50c58b[_0x6730('0x16')]?_0x50c58b[_0x6730('0x16')][_0x6730('0x1a')]?_[_0x6730('0x1b')](_0x50c58b[_0x6730('0x16')]['include'],function(_0x5a0464){return{'model':db[_0x5a0464[_0x6730('0x1c')]],'as':_0x5a0464['as'],'attributes':_0x5a0464['attributes'],'include':_0x5a0464['include']?_[_0x6730('0x1b')](_0x5a0464[_0x6730('0x1a')],function(_0x4b1f75){return{'model':db[_0x4b1f75[_0x6730('0x1c')]],'as':_0x4b1f75['as'],'attributes':_0x4b1f75[_0x6730('0x18')],'include':_0x4b1f75[_0x6730('0x1a')]?_[_0x6730('0x1b')](_0x4b1f75[_0x6730('0x1a')],function(_0x3526f1){return{'model':db[_0x3526f1[_0x6730('0x1c')]],'as':_0x3526f1['as'],'attributes':_0x3526f1['attributes']};}):[]};}):[]};}):[]:[]})[_0x6730('0xb')](function(_0x5db989){logger[_0x6730('0xc')](_0x6730('0x14'),_0x50c58b);logger[_0x6730('0xf')](_0x6730('0x14'),_0x50c58b,JSON[_0x6730('0x1d')](_0x5db989));_0x38207a(_0x5db989);})[_0x6730('0x13')](function(_0xb1d46d){logger[_0x6730('0x11')](_0x6730('0x14'),_0xb1d46d[_0x6730('0x12')],_0x50c58b);_0x497ef5(_0xe2121d[_0x6730('0x11')](0x1f4,_0xb1d46d[_0x6730('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/mailServerOut/index.js b/server/api/mailServerOut/index.js index 976cb71..f0c6b12 100644 --- a/server/api/mailServerOut/index.js +++ b/server/api/mailServerOut/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['index','/:id','isAuthenticated','post','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailServerOut.controller','get'];(function(_0x30ae5e,_0x391fc4){var _0x1f2e93=function(_0x60307d){while(--_0x60307d){_0x30ae5e['push'](_0x30ae5e['shift']());}};_0x1f2e93(++_0x391fc4);}(_0x7a54,0x106));var _0x47a5=function(_0x776ea8,_0x45d288){_0x776ea8=_0x776ea8-0x0;var _0x123a41=_0x7a54[_0x776ea8];return _0x123a41;};'use strict';var multer=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var path=require(_0x47a5('0x2'));var timeout=require('connect-timeout');var express=require(_0x47a5('0x3'));var router=express[_0x47a5('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x47a5('0x5'));var interaction=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var controller=require(_0x47a5('0x8'));router[_0x47a5('0x9')]('/',auth['isAuthenticated'](),controller[_0x47a5('0xa')]);router['get'](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller['show']);router[_0x47a5('0xd')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller['update']);router[_0x47a5('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x47a5('0xf')]);module[_0x47a5('0x10')]=router; \ No newline at end of file +var _0x9957=['multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./mailServerOut.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports'];(function(_0x4cf98e,_0xba4b79){var _0x1623ac=function(_0x459bc0){while(--_0x459bc0){_0x4cf98e['push'](_0x4cf98e['shift']());}};_0x1623ac(++_0xba4b79);}(_0x9957,0x93));var _0x7995=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x9957[_0x5b644e];return _0x49c6bf;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('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 623cfb3..d3f3042 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 _0x1ab8=['BOOLEAN','exports','STRING','INTEGER'];(function(_0x1e08fa,_0x2177b8){var _0x48a80f=function(_0x38c6d3){while(--_0x38c6d3){_0x1e08fa['push'](_0x1e08fa['shift']());}};_0x48a80f(++_0x2177b8);}(_0x1ab8,0xa5));var _0x81ab=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x1ab8[_0x1facfa];return _0x9ec701;};'use strict';var Sequelize=require('sequelize');module[_0x81ab('0x0')]={'description':{'type':Sequelize[_0x81ab('0x1')]},'host':{'type':Sequelize['STRING']},'user':{'type':Sequelize['STRING']},'pass':{'type':Sequelize[_0x81ab('0x1')]},'port':{'type':Sequelize[_0x81ab('0x2')]},'secure':{'type':Sequelize[_0x81ab('0x3')],'defaultValue':![]},'service':{'type':Sequelize[_0x81ab('0x1')]},'authentication':{'type':Sequelize[_0x81ab('0x3')],'defaultValue':!![]}}; \ No newline at end of file +var _0x4a34=['INTEGER','BOOLEAN','exports','STRING'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4a34,0x196));var _0x44a3=function(_0x4c531d,_0x38c2a1){_0x4c531d=_0x4c531d-0x0;var _0x57b159=_0x4a34[_0x4c531d];return _0x57b159;};'use strict';var Sequelize=require('sequelize');module[_0x44a3('0x0')]={'description':{'type':Sequelize[_0x44a3('0x1')]},'host':{'type':Sequelize[_0x44a3('0x1')]},'user':{'type':Sequelize[_0x44a3('0x1')]},'pass':{'type':Sequelize[_0x44a3('0x1')]},'port':{'type':Sequelize[_0x44a3('0x2')]},'secure':{'type':Sequelize[_0x44a3('0x3')],'defaultValue':![]},'service':{'type':Sequelize[_0x44a3('0x1')]},'authentication':{'type':Sequelize[_0x44a3('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 f47d4d6..6c8c5b6 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 _0xbb14=['count','set','Content-Range','apply','reject','save','destroy','error','stack','name','send','index','MailServerOut','fieldName','type','map','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','sort','where','pick','merge','filter','includeAll','include','then','rows','catch','show','rawAttributes','options','find','create','body','update','rimraf','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xbb14,0x74));var _0x4bb1=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xbb14[_0x1facfa];return _0x9ec701;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4bb1('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4bb1('0x1'));var rp=require('request-promise');var moment=require(_0x4bb1('0x2'));var BPromise=require(_0x4bb1('0x3'));var Mustache=require(_0x4bb1('0x4'));var util=require(_0x4bb1('0x5'));var path=require('path');var sox=require(_0x4bb1('0x6'));var csv=require(_0x4bb1('0x7'));var ejs=require(_0x4bb1('0x8'));var fs=require('fs');var fs_extra=require(_0x4bb1('0x9'));var _=require(_0x4bb1('0xa'));var squel=require(_0x4bb1('0xb'));var crypto=require('crypto');var jsforce=require(_0x4bb1('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x4bb1('0x7'));var querystring=require(_0x4bb1('0xd'));var Papa=require(_0x4bb1('0xe'));var Redis=require(_0x4bb1('0xf'));var authService=require(_0x4bb1('0x10'));var qs=require(_0x4bb1('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4bb1('0x12'));var logger=require(_0x4bb1('0x13'))(_0x4bb1('0x14'));var utils=require(_0x4bb1('0x15'));var config=require(_0x4bb1('0x16'));var licenseUtil=require(_0x4bb1('0x17'));var db=require(_0x4bb1('0x18'))['db'];function respondWithStatusCode(_0x2e1cb4,_0x44f9a4){_0x44f9a4=_0x44f9a4||0xcc;return function(_0x3c6f64){if(_0x3c6f64){return _0x2e1cb4[_0x4bb1('0x19')](_0x44f9a4);}return _0x2e1cb4[_0x4bb1('0x1a')](_0x44f9a4)[_0x4bb1('0x1b')]();};}function respondWithResult(_0x3a6f73,_0x411304){_0x411304=_0x411304||0xc8;return function(_0x4fb411){if(_0x4fb411){return _0x3a6f73[_0x4bb1('0x1a')](_0x411304)[_0x4bb1('0x1c')](_0x4fb411);}};}function respondWithFilteredResult(_0x1e3a70,_0x5cfd4f){return function(_0x503cbe){if(_0x503cbe){var _0x189735=typeof _0x5cfd4f[_0x4bb1('0x1d')]===_0x4bb1('0x1e')&&typeof _0x5cfd4f[_0x4bb1('0x1f')]===_0x4bb1('0x1e');var _0x5ebc69=_0x503cbe['count'];var _0xe1db3=_0x189735?0x0:_0x5cfd4f[_0x4bb1('0x1d')];var _0xf43f71=_0x189735?_0x503cbe[_0x4bb1('0x20')]:_0x5cfd4f['offset']+_0x5cfd4f['limit'];var _0x22f4ad;if(_0xf43f71>=_0x5ebc69){_0xf43f71=_0x5ebc69;_0x22f4ad=0xc8;}else{_0x22f4ad=0xce;}_0x1e3a70[_0x4bb1('0x1a')](_0x22f4ad);return _0x1e3a70[_0x4bb1('0x21')](_0x4bb1('0x22'),_0xe1db3+'-'+_0xf43f71+'/'+_0x5ebc69)[_0x4bb1('0x1c')](_0x503cbe);}return null;};}function patchUpdates(_0x1f3d3d){return function(_0x63532c){try{jsonpatch[_0x4bb1('0x23')](_0x63532c,_0x1f3d3d,!![]);}catch(_0x2f8fb2){return BPromise[_0x4bb1('0x24')](_0x2f8fb2);}return _0x63532c[_0x4bb1('0x25')]();};}function saveUpdates(_0x4a94c2,_0x369188){return function(_0x244941){if(_0x244941){return _0x244941['update'](_0x4a94c2)['then'](function(_0x43a4db){return _0x43a4db;});}return null;};}function removeEntity(_0x513ab5,_0x5226ea){return function(_0x1efd69){if(_0x1efd69){return _0x1efd69[_0x4bb1('0x26')]()['then'](function(){_0x513ab5[_0x4bb1('0x1a')](0xcc)[_0x4bb1('0x1b')]();});}};}function handleEntityNotFound(_0x5340dc,_0x576140){return function(_0x32d0f7){if(!_0x32d0f7){_0x5340dc[_0x4bb1('0x19')](0x194);}return _0x32d0f7;};}function handleError(_0x4db66a,_0x228655){_0x228655=_0x228655||0x1f4;return function(_0x4f2879){logger[_0x4bb1('0x27')](_0x4f2879[_0x4bb1('0x28')]);if(_0x4f2879[_0x4bb1('0x29')]){delete _0x4f2879[_0x4bb1('0x29')];}_0x4db66a[_0x4bb1('0x1a')](_0x228655)[_0x4bb1('0x2a')](_0x4f2879);};}exports[_0x4bb1('0x2b')]=function(_0x3b0975,_0x32e7e3){var _0x3d78f4={},_0x54a897={},_0x4811ef={'count':0x0,'rows':[]};var _0x5a8c72=_['map'](db[_0x4bb1('0x2c')]['rawAttributes'],function(_0x468ca0){return{'name':_0x468ca0[_0x4bb1('0x2d')],'type':_0x468ca0[_0x4bb1('0x2e')]['key']};});_0x54a897['model']=_[_0x4bb1('0x2f')](_0x5a8c72,_0x4bb1('0x29'));_0x54a897[_0x4bb1('0x30')]=_[_0x4bb1('0x31')](_0x3b0975[_0x4bb1('0x30')]);_0x54a897[_0x4bb1('0x32')]=_[_0x4bb1('0x33')](_0x54a897[_0x4bb1('0x34')],_0x54a897[_0x4bb1('0x30')]);_0x3d78f4['attributes']=_[_0x4bb1('0x33')](_0x54a897[_0x4bb1('0x34')],qs['fields'](_0x3b0975['query'][_0x4bb1('0x35')]));_0x3d78f4[_0x4bb1('0x36')]=_0x3d78f4[_0x4bb1('0x36')][_0x4bb1('0x37')]?_0x3d78f4[_0x4bb1('0x36')]:_0x54a897['model'];if(!_0x3b0975['query'][_0x4bb1('0x38')]('nolimit')){_0x3d78f4[_0x4bb1('0x1f')]=qs[_0x4bb1('0x1f')](_0x3b0975[_0x4bb1('0x30')]['limit']);_0x3d78f4[_0x4bb1('0x1d')]=qs[_0x4bb1('0x1d')](_0x3b0975[_0x4bb1('0x30')][_0x4bb1('0x1d')]);}_0x3d78f4['order']=qs['sort'](_0x3b0975['query'][_0x4bb1('0x39')]);_0x3d78f4[_0x4bb1('0x3a')]=qs[_0x4bb1('0x32')](_[_0x4bb1('0x3b')](_0x3b0975[_0x4bb1('0x30')],_0x54a897[_0x4bb1('0x32')]),_0x5a8c72);if(_0x3b0975[_0x4bb1('0x30')]['filter']){_0x3d78f4['where']=_[_0x4bb1('0x3c')](_0x3d78f4[_0x4bb1('0x3a')],{'$or':_[_0x4bb1('0x2f')](_0x5a8c72,function(_0x290df6){if(_0x290df6[_0x4bb1('0x2e')]!=='VIRTUAL'){var _0x2b0ece={};_0x2b0ece[_0x290df6[_0x4bb1('0x29')]]={'$like':'%'+_0x3b0975[_0x4bb1('0x30')][_0x4bb1('0x3d')]+'%'};return _0x2b0ece;}})});}_0x3d78f4=_[_0x4bb1('0x3c')]({},_0x3d78f4,_0x3b0975['options']);var _0x394b94={'where':_0x3d78f4['where']};return db[_0x4bb1('0x2c')][_0x4bb1('0x20')](_0x394b94)['then'](function(_0x3cbee1){_0x4811ef[_0x4bb1('0x20')]=_0x3cbee1;if(_0x3b0975[_0x4bb1('0x30')][_0x4bb1('0x3e')]){_0x3d78f4[_0x4bb1('0x3f')]=[{'all':!![]}];}return db[_0x4bb1('0x2c')]['findAll'](_0x3d78f4);})[_0x4bb1('0x40')](function(_0x12c7c5){_0x4811ef[_0x4bb1('0x41')]=_0x12c7c5;return _0x4811ef;})[_0x4bb1('0x40')](respondWithFilteredResult(_0x32e7e3,_0x3d78f4))[_0x4bb1('0x42')](handleError(_0x32e7e3,null));};exports[_0x4bb1('0x43')]=function(_0x120138,_0x3844b8){var _0x336656={'raw':!![],'where':{'id':_0x120138['params']['id']}},_0x543e5e={};_0x543e5e[_0x4bb1('0x34')]=_['keys'](db[_0x4bb1('0x2c')][_0x4bb1('0x44')]);_0x543e5e[_0x4bb1('0x30')]=_[_0x4bb1('0x31')](_0x120138[_0x4bb1('0x30')]);_0x543e5e[_0x4bb1('0x32')]=_[_0x4bb1('0x33')](_0x543e5e[_0x4bb1('0x34')],_0x543e5e[_0x4bb1('0x30')]);_0x336656[_0x4bb1('0x36')]=_[_0x4bb1('0x33')](_0x543e5e['model'],qs[_0x4bb1('0x35')](_0x120138['query']['fields']));_0x336656['attributes']=_0x336656[_0x4bb1('0x36')][_0x4bb1('0x37')]?_0x336656[_0x4bb1('0x36')]:_0x543e5e[_0x4bb1('0x34')];if(_0x120138[_0x4bb1('0x30')]['includeAll']){_0x336656['include']=[{'all':!![]}];}_0x336656=_['merge']({},_0x336656,_0x120138[_0x4bb1('0x45')]);return db[_0x4bb1('0x2c')][_0x4bb1('0x46')](_0x336656)[_0x4bb1('0x40')](handleEntityNotFound(_0x3844b8,null))[_0x4bb1('0x40')](respondWithResult(_0x3844b8,null))[_0x4bb1('0x42')](handleError(_0x3844b8,null));};exports['create']=function(_0x2e6845,_0x50dd89){return db[_0x4bb1('0x2c')][_0x4bb1('0x47')](_0x2e6845[_0x4bb1('0x48')],{})['then'](respondWithResult(_0x50dd89,0xc9))['catch'](handleError(_0x50dd89,null));};exports[_0x4bb1('0x49')]=function(_0x53a604,_0x2e33e9){if(_0x53a604[_0x4bb1('0x48')]['id']){delete _0x53a604[_0x4bb1('0x48')]['id'];}return db['MailServerOut']['find']({'where':{'id':_0x53a604['params']['id']}})[_0x4bb1('0x40')](handleEntityNotFound(_0x2e33e9,null))[_0x4bb1('0x40')](saveUpdates(_0x53a604['body'],null))[_0x4bb1('0x40')](respondWithResult(_0x2e33e9,null))['catch'](handleError(_0x2e33e9,null));};exports[_0x4bb1('0x26')]=function(_0x5a8966,_0x41b516){return db[_0x4bb1('0x2c')][_0x4bb1('0x46')]({'where':{'id':_0x5a8966['params']['id']}})[_0x4bb1('0x40')](handleEntityNotFound(_0x41b516,null))[_0x4bb1('0x40')](removeEntity(_0x41b516,null))['catch'](handleError(_0x41b516,null));}; \ No newline at end of file +var _0xbe22=['ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','error','stack','name','index','map','MailServerOut','fieldName','type','key','query','attributes','model','fields','hasOwnProperty','nolimit','sort','where','pick','filters','merge','VIRTUAL','filter','includeAll','include','findAll','rows','show','keys','rawAttributes','intersection','length','options','catch','create','body','rimraf','fast-json-patch','request-promise','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse'];(function(_0x3cd33f,_0x4c13e1){var _0x1e7e2b=function(_0x31cdd0){while(--_0x31cdd0){_0x3cd33f['push'](_0x3cd33f['shift']());}};_0x1e7e2b(++_0x4c13e1);}(_0xbe22,0x87));var _0x2be2=function(_0x217d4,_0x388eeb){_0x217d4=_0x217d4-0x0;var _0x515be2=_0xbe22[_0x217d4];return _0x515be2;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2be2('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2be2('0x1'));var rp=require(_0x2be2('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x2be2('0x3'));var util=require(_0x2be2('0x4'));var path=require(_0x2be2('0x5'));var sox=require(_0x2be2('0x6'));var csv=require('to-csv');var ejs=require(_0x2be2('0x7'));var fs=require('fs');var fs_extra=require(_0x2be2('0x8'));var _=require(_0x2be2('0x9'));var squel=require(_0x2be2('0xa'));var crypto=require(_0x2be2('0xb'));var jsforce=require(_0x2be2('0xc'));var deskjs=require(_0x2be2('0xd'));var toCsv=require(_0x2be2('0xe'));var querystring=require(_0x2be2('0xf'));var Papa=require(_0x2be2('0x10'));var Redis=require(_0x2be2('0x11'));var authService=require(_0x2be2('0x12'));var qs=require(_0x2be2('0x13'));var as=require(_0x2be2('0x14'));var hardwareService=require(_0x2be2('0x15'));var logger=require(_0x2be2('0x16'))(_0x2be2('0x17'));var utils=require(_0x2be2('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x2be2('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4bcd83,_0x3780e3){_0x3780e3=_0x3780e3||0xcc;return function(_0x12818d){if(_0x12818d){return _0x4bcd83[_0x2be2('0x1a')](_0x3780e3);}return _0x4bcd83[_0x2be2('0x1b')](_0x3780e3)[_0x2be2('0x1c')]();};}function respondWithResult(_0x57a695,_0x311d0a){_0x311d0a=_0x311d0a||0xc8;return function(_0x1287a5){if(_0x1287a5){return _0x57a695[_0x2be2('0x1b')](_0x311d0a)[_0x2be2('0x1d')](_0x1287a5);}};}function respondWithFilteredResult(_0x3b3a88,_0x5aae33){return function(_0x51f9f0){if(_0x51f9f0){var _0x47318f=typeof _0x5aae33[_0x2be2('0x1e')]===_0x2be2('0x1f')&&typeof _0x5aae33[_0x2be2('0x20')]===_0x2be2('0x1f');var _0x5e6bb5=_0x51f9f0['count'];var _0x54e4c3=_0x47318f?0x0:_0x5aae33[_0x2be2('0x1e')];var _0x315df2=_0x47318f?_0x51f9f0[_0x2be2('0x21')]:_0x5aae33[_0x2be2('0x1e')]+_0x5aae33[_0x2be2('0x20')];var _0x17ffd9;if(_0x315df2>=_0x5e6bb5){_0x315df2=_0x5e6bb5;_0x17ffd9=0xc8;}else{_0x17ffd9=0xce;}_0x3b3a88[_0x2be2('0x1b')](_0x17ffd9);return _0x3b3a88[_0x2be2('0x22')]('Content-Range',_0x54e4c3+'-'+_0x315df2+'/'+_0x5e6bb5)[_0x2be2('0x1d')](_0x51f9f0);}return null;};}function patchUpdates(_0x80e72c){return function(_0x4ff33f){try{jsonpatch[_0x2be2('0x23')](_0x4ff33f,_0x80e72c,!![]);}catch(_0x241964){return BPromise[_0x2be2('0x24')](_0x241964);}return _0x4ff33f[_0x2be2('0x25')]();};}function saveUpdates(_0x5f07d2,_0x43579d){return function(_0x2e5d4e){if(_0x2e5d4e){return _0x2e5d4e[_0x2be2('0x26')](_0x5f07d2)[_0x2be2('0x27')](function(_0x3084fb){return _0x3084fb;});}return null;};}function removeEntity(_0x5b4424,_0x290d5e){return function(_0x2cd007){if(_0x2cd007){return _0x2cd007[_0x2be2('0x28')]()[_0x2be2('0x27')](function(){_0x5b4424['status'](0xcc)[_0x2be2('0x1c')]();});}};}function handleEntityNotFound(_0x229cdb,_0x6d9dc5){return function(_0x573377){if(!_0x573377){_0x229cdb[_0x2be2('0x1a')](0x194);}return _0x573377;};}function handleError(_0x3d6786,_0x3453b9){_0x3453b9=_0x3453b9||0x1f4;return function(_0x134b6f){logger[_0x2be2('0x29')](_0x134b6f[_0x2be2('0x2a')]);if(_0x134b6f['name']){delete _0x134b6f[_0x2be2('0x2b')];}_0x3d6786[_0x2be2('0x1b')](_0x3453b9)['send'](_0x134b6f);};}exports[_0x2be2('0x2c')]=function(_0x22f93c,_0xc42067){var _0x257bd7={},_0x4dc4c6={},_0x4fc4df={'count':0x0,'rows':[]};var _0x3e6b33=_[_0x2be2('0x2d')](db[_0x2be2('0x2e')]['rawAttributes'],function(_0x1cadee){return{'name':_0x1cadee[_0x2be2('0x2f')],'type':_0x1cadee[_0x2be2('0x30')][_0x2be2('0x31')]};});_0x4dc4c6['model']=_[_0x2be2('0x2d')](_0x3e6b33,_0x2be2('0x2b'));_0x4dc4c6[_0x2be2('0x32')]=_['keys'](_0x22f93c[_0x2be2('0x32')]);_0x4dc4c6['filters']=_['intersection'](_0x4dc4c6['model'],_0x4dc4c6[_0x2be2('0x32')]);_0x257bd7[_0x2be2('0x33')]=_['intersection'](_0x4dc4c6[_0x2be2('0x34')],qs[_0x2be2('0x35')](_0x22f93c[_0x2be2('0x32')][_0x2be2('0x35')]));_0x257bd7[_0x2be2('0x33')]=_0x257bd7[_0x2be2('0x33')]['length']?_0x257bd7['attributes']:_0x4dc4c6[_0x2be2('0x34')];if(!_0x22f93c[_0x2be2('0x32')][_0x2be2('0x36')](_0x2be2('0x37'))){_0x257bd7['limit']=qs['limit'](_0x22f93c[_0x2be2('0x32')]['limit']);_0x257bd7[_0x2be2('0x1e')]=qs['offset'](_0x22f93c[_0x2be2('0x32')]['offset']);}_0x257bd7['order']=qs[_0x2be2('0x38')](_0x22f93c[_0x2be2('0x32')][_0x2be2('0x38')]);_0x257bd7[_0x2be2('0x39')]=qs['filters'](_[_0x2be2('0x3a')](_0x22f93c[_0x2be2('0x32')],_0x4dc4c6[_0x2be2('0x3b')]),_0x3e6b33);if(_0x22f93c['query']['filter']){_0x257bd7['where']=_[_0x2be2('0x3c')](_0x257bd7[_0x2be2('0x39')],{'$or':_[_0x2be2('0x2d')](_0x3e6b33,function(_0x271518){if(_0x271518[_0x2be2('0x30')]!==_0x2be2('0x3d')){var _0x1bac5a={};_0x1bac5a[_0x271518[_0x2be2('0x2b')]]={'$like':'%'+_0x22f93c[_0x2be2('0x32')][_0x2be2('0x3e')]+'%'};return _0x1bac5a;}})});}_0x257bd7=_[_0x2be2('0x3c')]({},_0x257bd7,_0x22f93c['options']);var _0x42b875={'where':_0x257bd7['where']};return db[_0x2be2('0x2e')][_0x2be2('0x21')](_0x42b875)['then'](function(_0x5778f7){_0x4fc4df[_0x2be2('0x21')]=_0x5778f7;if(_0x22f93c['query'][_0x2be2('0x3f')]){_0x257bd7[_0x2be2('0x40')]=[{'all':!![]}];}return db[_0x2be2('0x2e')][_0x2be2('0x41')](_0x257bd7);})[_0x2be2('0x27')](function(_0x4a9c77){_0x4fc4df[_0x2be2('0x42')]=_0x4a9c77;return _0x4fc4df;})[_0x2be2('0x27')](respondWithFilteredResult(_0xc42067,_0x257bd7))['catch'](handleError(_0xc42067,null));};exports[_0x2be2('0x43')]=function(_0x1d9250,_0x4ba035){var _0x4d249f={'raw':!![],'where':{'id':_0x1d9250['params']['id']}},_0x56b2f9={};_0x56b2f9[_0x2be2('0x34')]=_[_0x2be2('0x44')](db[_0x2be2('0x2e')][_0x2be2('0x45')]);_0x56b2f9[_0x2be2('0x32')]=_[_0x2be2('0x44')](_0x1d9250[_0x2be2('0x32')]);_0x56b2f9['filters']=_[_0x2be2('0x46')](_0x56b2f9[_0x2be2('0x34')],_0x56b2f9[_0x2be2('0x32')]);_0x4d249f['attributes']=_[_0x2be2('0x46')](_0x56b2f9[_0x2be2('0x34')],qs[_0x2be2('0x35')](_0x1d9250[_0x2be2('0x32')][_0x2be2('0x35')]));_0x4d249f[_0x2be2('0x33')]=_0x4d249f[_0x2be2('0x33')][_0x2be2('0x47')]?_0x4d249f['attributes']:_0x56b2f9[_0x2be2('0x34')];if(_0x1d9250['query'][_0x2be2('0x3f')]){_0x4d249f[_0x2be2('0x40')]=[{'all':!![]}];}_0x4d249f=_[_0x2be2('0x3c')]({},_0x4d249f,_0x1d9250[_0x2be2('0x48')]);return db[_0x2be2('0x2e')]['find'](_0x4d249f)[_0x2be2('0x27')](handleEntityNotFound(_0x4ba035,null))[_0x2be2('0x27')](respondWithResult(_0x4ba035,null))[_0x2be2('0x49')](handleError(_0x4ba035,null));};exports[_0x2be2('0x4a')]=function(_0x23e799,_0x256aed){return db[_0x2be2('0x2e')]['create'](_0x23e799[_0x2be2('0x4b')],{})[_0x2be2('0x27')](respondWithResult(_0x256aed,0xc9))['catch'](handleError(_0x256aed,null));};exports[_0x2be2('0x26')]=function(_0x346870,_0x3d0a5b){if(_0x346870[_0x2be2('0x4b')]['id']){delete _0x346870[_0x2be2('0x4b')]['id'];}return db[_0x2be2('0x2e')]['find']({'where':{'id':_0x346870['params']['id']}})[_0x2be2('0x27')](handleEntityNotFound(_0x3d0a5b,null))[_0x2be2('0x27')](saveUpdates(_0x346870['body'],null))[_0x2be2('0x27')](respondWithResult(_0x3d0a5b,null))[_0x2be2('0x49')](handleError(_0x3d0a5b,null));};exports[_0x2be2('0x28')]=function(_0x1a68ff,_0x2082e7){return db[_0x2be2('0x2e')]['find']({'where':{'id':_0x1a68ff['params']['id']}})[_0x2be2('0x27')](handleEntityNotFound(_0x2082e7,null))[_0x2be2('0x27')](removeEntity(_0x2082e7,null))[_0x2be2('0x49')](handleError(_0x2082e7,null));}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.model.js b/server/api/mailServerOut/mailServerOut.model.js index 35ea1be..ae3093c 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 _0xb50f=['rimraf','../../config/environment','./mailServerOut.attributes','MailServerOut','mail_servers_out','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x1ba611,_0x5ebc18){var _0x3dbcce=function(_0x418c53){while(--_0x418c53){_0x1ba611['push'](_0x1ba611['shift']());}};_0x3dbcce(++_0x5ebc18);}(_0xb50f,0x118));var _0xfb50=function(_0x41fb98,_0x470189){_0x41fb98=_0x41fb98-0x0;var _0x4b0044=_0xb50f[_0x41fb98];return _0x4b0044;};'use strict';var _=require(_0xfb50('0x0'));var util=require('util');var logger=require(_0xfb50('0x1'))(_0xfb50('0x2'));var moment=require(_0xfb50('0x3'));var BPromise=require(_0xfb50('0x4'));var rp=require(_0xfb50('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xfb50('0x6'));var config=require(_0xfb50('0x7'));var attributes=require(_0xfb50('0x8'));module['exports']=function(_0x1f7738,_0x354856){return _0x1f7738['define'](_0xfb50('0x9'),attributes,{'tableName':_0xfb50('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x46ff=['request-promise','path','rimraf','../../config/environment','./mailServerOut.attributes','exports','define','mail_servers_out','lodash','../../config/logger','api','moment','bluebird'];(function(_0x55e521,_0x544664){var _0x1257b3=function(_0x10f295){while(--_0x10f295){_0x55e521['push'](_0x55e521['shift']());}};_0x1257b3(++_0x544664);}(_0x46ff,0x1dc));var _0xf46f=function(_0x2ec5f2,_0x5d22f5){_0x2ec5f2=_0x2ec5f2-0x0;var _0x359fb6=_0x46ff[_0x2ec5f2];return _0x359fb6;};'use strict';var _=require(_0xf46f('0x0'));var util=require('util');var logger=require(_0xf46f('0x1'))(_0xf46f('0x2'));var moment=require(_0xf46f('0x3'));var BPromise=require(_0xf46f('0x4'));var rp=require(_0xf46f('0x5'));var fs=require('fs');var path=require(_0xf46f('0x6'));var rimraf=require(_0xf46f('0x7'));var config=require(_0xf46f('0x8'));var attributes=require(_0xf46f('0x9'));module[_0xf46f('0xa')]=function(_0x5e06f5,_0x31e29c){return _0x5e06f5[_0xf46f('0xb')]('MailServerOut',attributes,{'tableName':_0xf46f('0xc'),'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 7c4a805..b7aeea4 100644 --- a/server/api/mailServerOut/mailServerOut.rpc.js +++ b/server/api/mailServerOut/mailServerOut.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1261=['then','info','MailServerOut,\x20%s,\x20%s','request\x20sent','MailServerOut,\x20%s,\x20%s,\x20%s','error','code','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request'];(function(_0x26eb38,_0x44a245){var _0xc22233=function(_0x3b021b){while(--_0x3b021b){_0x26eb38['push'](_0x26eb38['shift']());}};_0xc22233(++_0x44a245);}(_0x1261,0x144));var _0x1126=function(_0x473738,_0x15ea31){_0x473738=_0x473738-0x0;var _0x1df4ae=_0x1261[_0x473738];return _0x1df4ae;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var moment=require(_0x1126('0x1'));var BPromise=require(_0x1126('0x2'));var rs=require(_0x1126('0x3'));var fs=require('fs');var Redis=require(_0x1126('0x4'));var db=require(_0x1126('0x5'))['db'];var utils=require(_0x1126('0x6'));var logger=require(_0x1126('0x7'))(_0x1126('0x8'));var config=require(_0x1126('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1126('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x907180,_0x4f239c,_0x17e5f0){return new BPromise(function(_0x28772d,_0x245be9){return client[_0x1126('0xb')](_0x907180,_0x17e5f0)[_0x1126('0xc')](function(_0x59cfa1){logger[_0x1126('0xd')](_0x1126('0xe'),_0x4f239c,_0x1126('0xf'));logger['debug'](_0x1126('0x10'),_0x4f239c,'request\x20sent',JSON['stringify'](_0x59cfa1));if(_0x59cfa1[_0x1126('0x11')]){if(_0x59cfa1['error'][_0x1126('0x12')]===0x1f4){logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);return _0x245be9(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1['error']['message']);return _0x28772d(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}else{logger[_0x1126('0xd')]('MailServerOut,\x20%s,\x20%s',_0x4f239c,_0x1126('0xf'));_0x28772d(_0x59cfa1['result'][_0x1126('0x13')]);}})[_0x1126('0x14')](function(_0x257b5f){logger['error'](_0x1126('0xe'),_0x4f239c,_0x257b5f);_0x245be9(_0x257b5f);});});} \ No newline at end of file +var _0x1261=['then','info','MailServerOut,\x20%s,\x20%s','request\x20sent','MailServerOut,\x20%s,\x20%s,\x20%s','error','code','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request'];(function(_0x3a0614,_0x2be819){var _0x41a6d0=function(_0x2cad51){while(--_0x2cad51){_0x3a0614['push'](_0x3a0614['shift']());}};_0x41a6d0(++_0x2be819);}(_0x1261,0x144));var _0x1126=function(_0x5e3bb1,_0x3cfe7c){_0x5e3bb1=_0x5e3bb1-0x0;var _0x4c1278=_0x1261[_0x5e3bb1];return _0x4c1278;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var moment=require(_0x1126('0x1'));var BPromise=require(_0x1126('0x2'));var rs=require(_0x1126('0x3'));var fs=require('fs');var Redis=require(_0x1126('0x4'));var db=require(_0x1126('0x5'))['db'];var utils=require(_0x1126('0x6'));var logger=require(_0x1126('0x7'))(_0x1126('0x8'));var config=require(_0x1126('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1126('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x907180,_0x4f239c,_0x17e5f0){return new BPromise(function(_0x28772d,_0x245be9){return client[_0x1126('0xb')](_0x907180,_0x17e5f0)[_0x1126('0xc')](function(_0x59cfa1){logger[_0x1126('0xd')](_0x1126('0xe'),_0x4f239c,_0x1126('0xf'));logger['debug'](_0x1126('0x10'),_0x4f239c,'request\x20sent',JSON['stringify'](_0x59cfa1));if(_0x59cfa1[_0x1126('0x11')]){if(_0x59cfa1['error'][_0x1126('0x12')]===0x1f4){logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);return _0x245be9(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1['error']['message']);return _0x28772d(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}else{logger[_0x1126('0xd')]('MailServerOut,\x20%s,\x20%s',_0x4f239c,_0x1126('0xf'));_0x28772d(_0x59cfa1['result'][_0x1126('0x13')]);}})[_0x1126('0x14')](function(_0x257b5f){logger['error'](_0x1126('0xe'),_0x4f239c,_0x257b5f);_0x245be9(_0x257b5f);});});} \ No newline at end of file diff --git a/server/api/mailSubstatus/index.js b/server/api/mailSubstatus/index.js index 7544636..5a1a6ab 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 _0x7269=['post','put','/:id','update','delete','destroy','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailSubstatus.controller','get','isAuthenticated','index','/describe','describe','show'];(function(_0x41c393,_0x390ce7){var _0x500cc1=function(_0x42bb55){while(--_0x42bb55){_0x41c393['push'](_0x41c393['shift']());}};_0x500cc1(++_0x390ce7);}(_0x7269,0x156));var _0x9726=function(_0x25545d,_0x44fb96){_0x25545d=_0x25545d-0x0;var _0x3efd56=_0x7269[_0x25545d];return _0x3efd56;};'use strict';var multer=require(_0x9726('0x0'));var util=require(_0x9726('0x1'));var path=require('path');var timeout=require(_0x9726('0x2'));var express=require(_0x9726('0x3'));var router=express[_0x9726('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x9726('0x5'));var interaction=require(_0x9726('0x6'));var config=require(_0x9726('0x7'));var controller=require(_0x9726('0x8'));router[_0x9726('0x9')]('/',auth[_0x9726('0xa')](),controller[_0x9726('0xb')]);router[_0x9726('0x9')](_0x9726('0xc'),auth[_0x9726('0xa')](),controller[_0x9726('0xd')]);router[_0x9726('0x9')]('/:id',auth[_0x9726('0xa')](),controller[_0x9726('0xe')]);router[_0x9726('0xf')]('/',auth[_0x9726('0xa')](),controller['create']);router[_0x9726('0x10')](_0x9726('0x11'),auth[_0x9726('0xa')](),controller[_0x9726('0x12')]);router[_0x9726('0x13')](_0x9726('0x11'),auth[_0x9726('0xa')](),controller[_0x9726('0x14')]);module['exports']=router; \ No newline at end of file +var _0x9ce0=['show','create','delete','destroy','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/describe','/:id'];(function(_0xaebab7,_0x558742){var _0x19ef22=function(_0x36e972){while(--_0x36e972){_0xaebab7['push'](_0xaebab7['shift']());}};_0x19ef22(++_0x558742);}(_0x9ce0,0x1a4));var _0x09ce=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x9ce0[_0x5ddb1c];return _0x354adc;};'use strict';var multer=require('multer');var util=require(_0x09ce('0x0'));var path=require(_0x09ce('0x1'));var timeout=require('connect-timeout');var express=require(_0x09ce('0x2'));var router=express[_0x09ce('0x3')]();var fs_extra=require(_0x09ce('0x4'));var auth=require(_0x09ce('0x5'));var interaction=require(_0x09ce('0x6'));var config=require('../../config/environment');var controller=require('./mailSubstatus.controller');router[_0x09ce('0x7')]('/',auth[_0x09ce('0x8')](),controller[_0x09ce('0x9')]);router['get'](_0x09ce('0xa'),auth[_0x09ce('0x8')](),controller['describe']);router['get'](_0x09ce('0xb'),auth[_0x09ce('0x8')](),controller[_0x09ce('0xc')]);router['post']('/',auth['isAuthenticated'](),controller[_0x09ce('0xd')]);router['put'](_0x09ce('0xb'),auth['isAuthenticated'](),controller['update']);router[_0x09ce('0xe')](_0x09ce('0xb'),auth[_0x09ce('0x8')](),controller[_0x09ce('0xf')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.attributes.js b/server/api/mailSubstatus/mailSubstatus.attributes.js index 3036e96..ca89374 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 _0xcaf2=['sequelize','STRING','name'];(function(_0x1c6e9e,_0x23c6ac){var _0x1917e6=function(_0x4b28b9){while(--_0x4b28b9){_0x1c6e9e['push'](_0x1c6e9e['shift']());}};_0x1917e6(++_0x23c6ac);}(_0xcaf2,0x8a));var _0x2caf=function(_0x27e2bc,_0x1f5bb1){_0x27e2bc=_0x27e2bc-0x0;var _0x303eed=_0xcaf2[_0x27e2bc];return _0x303eed;};'use strict';var Sequelize=require(_0x2caf('0x0'));module['exports']={'name':{'type':Sequelize[_0x2caf('0x1')],'unique':_0x2caf('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xf9d5=['exports','STRING'];(function(_0x2b5948,_0x3834ab){var _0x30c968=function(_0x201368){while(--_0x201368){_0x2b5948['push'](_0x2b5948['shift']());}};_0x30c968(++_0x3834ab);}(_0xf9d5,0x122));var _0x5f9d=function(_0x13ecc6,_0x1ce75c){_0x13ecc6=_0x13ecc6-0x0;var _0x4ba422=_0xf9d5[_0x13ecc6];return _0x4ba422;};'use strict';var Sequelize=require('sequelize');module[_0x5f9d('0x0')]={'name':{'type':Sequelize[_0x5f9d('0x1')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x5f9d('0x1')]}}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.controller.js b/server/api/mailSubstatus/mailSubstatus.controller.js index fb53a85..2562798 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 _0xc9b9=['map','MailSubstatus','rawAttributes','type','query','keys','intersection','fields','attributes','length','model','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','options','find','create','body','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','destroy','end','error','name','send','index'];(function(_0x4f9a6e,_0x2065f1){var _0x54f321=function(_0x57f271){while(--_0x57f271){_0x4f9a6e['push'](_0x4f9a6e['shift']());}};_0x54f321(++_0x2065f1);}(_0xc9b9,0x6a));var _0x9c9b=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0xc9b9[_0x3bf83f];return _0x22c4a9;};'use strict';var emlformat=require(_0x9c9b('0x0'));var rimraf=require(_0x9c9b('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9c9b('0x2'));var rp=require(_0x9c9b('0x3'));var moment=require(_0x9c9b('0x4'));var BPromise=require(_0x9c9b('0x5'));var Mustache=require(_0x9c9b('0x6'));var util=require(_0x9c9b('0x7'));var path=require(_0x9c9b('0x8'));var sox=require(_0x9c9b('0x9'));var csv=require(_0x9c9b('0xa'));var ejs=require(_0x9c9b('0xb'));var fs=require('fs');var fs_extra=require(_0x9c9b('0xc'));var _=require(_0x9c9b('0xd'));var squel=require('squel');var crypto=require(_0x9c9b('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x9c9b('0xf'));var toCsv=require('to-csv');var querystring=require(_0x9c9b('0x10'));var Papa=require(_0x9c9b('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x9c9b('0x12'));var as=require(_0x9c9b('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9c9b('0x14'))(_0x9c9b('0x15'));var utils=require('../../config/utils');var config=require(_0x9c9b('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x9c9b('0x17'))['db'];function respondWithStatusCode(_0x20d245,_0x27e8ed){_0x27e8ed=_0x27e8ed||0xcc;return function(_0x278118){if(_0x278118){return _0x20d245[_0x9c9b('0x18')](_0x27e8ed);}return _0x20d245[_0x9c9b('0x19')](_0x27e8ed)['end']();};}function respondWithResult(_0x456b39,_0x239c5b){_0x239c5b=_0x239c5b||0xc8;return function(_0x288041){if(_0x288041){return _0x456b39['status'](_0x239c5b)['json'](_0x288041);}};}function respondWithFilteredResult(_0x1ad8c4,_0x5e2187){return function(_0x2c6d0c){if(_0x2c6d0c){var _0x1c404f=typeof _0x5e2187[_0x9c9b('0x1a')]===_0x9c9b('0x1b')&&typeof _0x5e2187[_0x9c9b('0x1c')]===_0x9c9b('0x1b');var _0x17aadf=_0x2c6d0c['count'];var _0x1c324c=_0x1c404f?0x0:_0x5e2187[_0x9c9b('0x1a')];var _0x293f4e=_0x1c404f?_0x2c6d0c[_0x9c9b('0x1d')]:_0x5e2187[_0x9c9b('0x1a')]+_0x5e2187[_0x9c9b('0x1c')];var _0x4285b7;if(_0x293f4e>=_0x17aadf){_0x293f4e=_0x17aadf;_0x4285b7=0xc8;}else{_0x4285b7=0xce;}_0x1ad8c4[_0x9c9b('0x19')](_0x4285b7);return _0x1ad8c4[_0x9c9b('0x1e')](_0x9c9b('0x1f'),_0x1c324c+'-'+_0x293f4e+'/'+_0x17aadf)[_0x9c9b('0x20')](_0x2c6d0c);}return null;};}function patchUpdates(_0x4ad96d){return function(_0x55a50c){try{jsonpatch[_0x9c9b('0x21')](_0x55a50c,_0x4ad96d,!![]);}catch(_0x33e271){return BPromise[_0x9c9b('0x22')](_0x33e271);}return _0x55a50c[_0x9c9b('0x23')]();};}function saveUpdates(_0xfa3966,_0x1ab908){return function(_0x33ff16){if(_0x33ff16){return _0x33ff16[_0x9c9b('0x24')](_0xfa3966)[_0x9c9b('0x25')](function(_0x4d6aa9){return _0x4d6aa9;});}return null;};}function removeEntity(_0x4ee47c,_0x3fe516){return function(_0x213040){if(_0x213040){return _0x213040[_0x9c9b('0x26')]()[_0x9c9b('0x25')](function(){_0x4ee47c[_0x9c9b('0x19')](0xcc)[_0x9c9b('0x27')]();});}};}function handleEntityNotFound(_0x93641a,_0x3694b7){return function(_0x28ff84){if(!_0x28ff84){_0x93641a[_0x9c9b('0x18')](0x194);}return _0x28ff84;};}function handleError(_0x56472f,_0x32ebed){_0x32ebed=_0x32ebed||0x1f4;return function(_0x4bbba7){logger[_0x9c9b('0x28')](_0x4bbba7['stack']);if(_0x4bbba7[_0x9c9b('0x29')]){delete _0x4bbba7[_0x9c9b('0x29')];}_0x56472f['status'](_0x32ebed)[_0x9c9b('0x2a')](_0x4bbba7);};}exports[_0x9c9b('0x2b')]=function(_0x30f0c7,_0x5009cb){var _0x3b8102={},_0x512bc={},_0x18ca0a={'count':0x0,'rows':[]};var _0x1c91bc=_[_0x9c9b('0x2c')](db[_0x9c9b('0x2d')][_0x9c9b('0x2e')],function(_0x2f24e3){return{'name':_0x2f24e3['fieldName'],'type':_0x2f24e3[_0x9c9b('0x2f')]['key']};});_0x512bc['model']=_[_0x9c9b('0x2c')](_0x1c91bc,'name');_0x512bc[_0x9c9b('0x30')]=_[_0x9c9b('0x31')](_0x30f0c7[_0x9c9b('0x30')]);_0x512bc['filters']=_['intersection'](_0x512bc['model'],_0x512bc[_0x9c9b('0x30')]);_0x3b8102['attributes']=_[_0x9c9b('0x32')](_0x512bc['model'],qs['fields'](_0x30f0c7[_0x9c9b('0x30')][_0x9c9b('0x33')]));_0x3b8102[_0x9c9b('0x34')]=_0x3b8102['attributes'][_0x9c9b('0x35')]?_0x3b8102[_0x9c9b('0x34')]:_0x512bc[_0x9c9b('0x36')];if(!_0x30f0c7[_0x9c9b('0x30')]['hasOwnProperty'](_0x9c9b('0x37'))){_0x3b8102[_0x9c9b('0x1c')]=qs['limit'](_0x30f0c7[_0x9c9b('0x30')]['limit']);_0x3b8102[_0x9c9b('0x1a')]=qs[_0x9c9b('0x1a')](_0x30f0c7['query'][_0x9c9b('0x1a')]);}_0x3b8102[_0x9c9b('0x38')]=qs[_0x9c9b('0x39')](_0x30f0c7[_0x9c9b('0x30')]['sort']);_0x3b8102[_0x9c9b('0x3a')]=qs[_0x9c9b('0x3b')](_['pick'](_0x30f0c7[_0x9c9b('0x30')],_0x512bc[_0x9c9b('0x3b')]),_0x1c91bc);if(_0x30f0c7[_0x9c9b('0x30')][_0x9c9b('0x3c')]){_0x3b8102[_0x9c9b('0x3a')]=_[_0x9c9b('0x3d')](_0x3b8102[_0x9c9b('0x3a')],{'$or':_['map'](_0x1c91bc,function(_0x5a0544){if(_0x5a0544[_0x9c9b('0x2f')]!==_0x9c9b('0x3e')){var _0x183cae={};_0x183cae[_0x5a0544[_0x9c9b('0x29')]]={'$like':'%'+_0x30f0c7[_0x9c9b('0x30')][_0x9c9b('0x3c')]+'%'};return _0x183cae;}})});}_0x3b8102=_[_0x9c9b('0x3d')]({},_0x3b8102,_0x30f0c7['options']);var _0x400a55={'where':_0x3b8102['where']};return db[_0x9c9b('0x2d')]['count'](_0x400a55)[_0x9c9b('0x25')](function(_0x1b2b66){_0x18ca0a[_0x9c9b('0x1d')]=_0x1b2b66;if(_0x30f0c7[_0x9c9b('0x30')][_0x9c9b('0x3f')]){_0x3b8102[_0x9c9b('0x40')]=[{'all':!![]}];}return db[_0x9c9b('0x2d')][_0x9c9b('0x41')](_0x3b8102);})[_0x9c9b('0x25')](function(_0x33e75a){_0x18ca0a[_0x9c9b('0x42')]=_0x33e75a;return _0x18ca0a;})[_0x9c9b('0x25')](respondWithFilteredResult(_0x5009cb,_0x3b8102))[_0x9c9b('0x43')](handleError(_0x5009cb,null));};exports[_0x9c9b('0x44')]=function(_0x22f2e3,_0x1ca833){var _0x64b45f={'raw':!![],'where':{'id':_0x22f2e3[_0x9c9b('0x45')]['id']}},_0x5384dc={};_0x5384dc[_0x9c9b('0x36')]=_['keys'](db[_0x9c9b('0x2d')][_0x9c9b('0x2e')]);_0x5384dc[_0x9c9b('0x30')]=_[_0x9c9b('0x31')](_0x22f2e3[_0x9c9b('0x30')]);_0x5384dc[_0x9c9b('0x3b')]=_[_0x9c9b('0x32')](_0x5384dc[_0x9c9b('0x36')],_0x5384dc['query']);_0x64b45f[_0x9c9b('0x34')]=_['intersection'](_0x5384dc[_0x9c9b('0x36')],qs[_0x9c9b('0x33')](_0x22f2e3[_0x9c9b('0x30')]['fields']));_0x64b45f[_0x9c9b('0x34')]=_0x64b45f[_0x9c9b('0x34')][_0x9c9b('0x35')]?_0x64b45f['attributes']:_0x5384dc['model'];if(_0x22f2e3[_0x9c9b('0x30')]['includeAll']){_0x64b45f[_0x9c9b('0x40')]=[{'all':!![]}];}_0x64b45f=_[_0x9c9b('0x3d')]({},_0x64b45f,_0x22f2e3[_0x9c9b('0x46')]);return db[_0x9c9b('0x2d')][_0x9c9b('0x47')](_0x64b45f)[_0x9c9b('0x25')](handleEntityNotFound(_0x1ca833,null))[_0x9c9b('0x25')](respondWithResult(_0x1ca833,null))[_0x9c9b('0x43')](handleError(_0x1ca833,null));};exports[_0x9c9b('0x48')]=function(_0x1179e0,_0x42fea4){return db[_0x9c9b('0x2d')]['create'](_0x1179e0[_0x9c9b('0x49')],{})[_0x9c9b('0x25')](respondWithResult(_0x42fea4,0xc9))['catch'](handleError(_0x42fea4,null));};exports['update']=function(_0x55c171,_0x2e105a){if(_0x55c171[_0x9c9b('0x49')]['id']){delete _0x55c171[_0x9c9b('0x49')]['id'];}return db[_0x9c9b('0x2d')][_0x9c9b('0x47')]({'where':{'id':_0x55c171[_0x9c9b('0x45')]['id']}})[_0x9c9b('0x25')](handleEntityNotFound(_0x2e105a,null))[_0x9c9b('0x25')](saveUpdates(_0x55c171['body'],null))[_0x9c9b('0x25')](respondWithResult(_0x2e105a,null))[_0x9c9b('0x43')](handleError(_0x2e105a,null));};exports[_0x9c9b('0x26')]=function(_0x340a22,_0x291942){return db['MailSubstatus'][_0x9c9b('0x47')]({'where':{'id':_0x340a22[_0x9c9b('0x45')]['id']}})['then'](handleEntityNotFound(_0x291942,null))[_0x9c9b('0x25')](removeEntity(_0x291942,null))['catch'](handleError(_0x291942,null));};exports['describe']=function(_0x29c6c3,_0x18de1d){return db['MailSubstatus'][_0x9c9b('0x4a')]()[_0x9c9b('0x25')](respondWithResult(_0x18de1d,null))[_0x9c9b('0x43')](handleError(_0x18de1d,null));}; \ No newline at end of file +var _0x8834=['fields','length','hasOwnProperty','limit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','keys','create','body','find','describe','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','fs-extra','squel','jsforce','to-csv','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','send','index','map','MailSubstatus','rawAttributes','type','key','model','name','query','filters','intersection','attributes'];(function(_0x2d34d6,_0x397ff9){var _0x1d3d12=function(_0x558800){while(--_0x558800){_0x2d34d6['push'](_0x2d34d6['shift']());}};_0x1d3d12(++_0x397ff9);}(_0x8834,0x148));var _0x4883=function(_0x3c9864,_0x5c1b58){_0x3c9864=_0x3c9864-0x0;var _0x39bedd=_0x8834[_0x3c9864];return _0x39bedd;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x4883('0x0'));var jsonpatch=require(_0x4883('0x1'));var rp=require('request-promise');var moment=require(_0x4883('0x2'));var BPromise=require(_0x4883('0x3'));var Mustache=require(_0x4883('0x4'));var util=require(_0x4883('0x5'));var path=require(_0x4883('0x6'));var sox=require(_0x4883('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4883('0x8'));var _=require('lodash');var squel=require(_0x4883('0x9'));var crypto=require('crypto');var jsforce=require(_0x4883('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x4883('0xb'));var querystring=require(_0x4883('0xc'));var Papa=require(_0x4883('0xd'));var Redis=require(_0x4883('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x4883('0xf'));var hardwareService=require(_0x4883('0x10'));var logger=require(_0x4883('0x11'))(_0x4883('0x12'));var utils=require(_0x4883('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x4883('0x14'));var db=require(_0x4883('0x15'))['db'];function respondWithStatusCode(_0x5cb13f,_0x1b9070){_0x1b9070=_0x1b9070||0xcc;return function(_0x5d922d){if(_0x5d922d){return _0x5cb13f[_0x4883('0x16')](_0x1b9070);}return _0x5cb13f[_0x4883('0x17')](_0x1b9070)[_0x4883('0x18')]();};}function respondWithResult(_0x2dcbb9,_0x5e2cd7){_0x5e2cd7=_0x5e2cd7||0xc8;return function(_0x235dcd){if(_0x235dcd){return _0x2dcbb9['status'](_0x5e2cd7)[_0x4883('0x19')](_0x235dcd);}};}function respondWithFilteredResult(_0x35c1b2,_0xd5a191){return function(_0x38efb9){if(_0x38efb9){var _0x126d4c=typeof _0xd5a191[_0x4883('0x1a')]===_0x4883('0x1b')&&typeof _0xd5a191['limit']===_0x4883('0x1b');var _0x69f756=_0x38efb9[_0x4883('0x1c')];var _0x344688=_0x126d4c?0x0:_0xd5a191[_0x4883('0x1a')];var _0x50af04=_0x126d4c?_0x38efb9['count']:_0xd5a191['offset']+_0xd5a191['limit'];var _0xace1cf;if(_0x50af04>=_0x69f756){_0x50af04=_0x69f756;_0xace1cf=0xc8;}else{_0xace1cf=0xce;}_0x35c1b2['status'](_0xace1cf);return _0x35c1b2[_0x4883('0x1d')](_0x4883('0x1e'),_0x344688+'-'+_0x50af04+'/'+_0x69f756)[_0x4883('0x19')](_0x38efb9);}return null;};}function patchUpdates(_0x401889){return function(_0x35d0fb){try{jsonpatch[_0x4883('0x1f')](_0x35d0fb,_0x401889,!![]);}catch(_0x5b53cd){return BPromise[_0x4883('0x20')](_0x5b53cd);}return _0x35d0fb[_0x4883('0x21')]();};}function saveUpdates(_0x4b5d6d,_0x2370f0){return function(_0x318160){if(_0x318160){return _0x318160[_0x4883('0x22')](_0x4b5d6d)[_0x4883('0x23')](function(_0x47b02f){return _0x47b02f;});}return null;};}function removeEntity(_0x2d5209,_0x2f4cd1){return function(_0x934db7){if(_0x934db7){return _0x934db7[_0x4883('0x24')]()[_0x4883('0x23')](function(){_0x2d5209[_0x4883('0x17')](0xcc)[_0x4883('0x18')]();});}};}function handleEntityNotFound(_0x2a23bb,_0x2b0a8e){return function(_0x10133c){if(!_0x10133c){_0x2a23bb['sendStatus'](0x194);}return _0x10133c;};}function handleError(_0x15d3f2,_0x520e58){_0x520e58=_0x520e58||0x1f4;return function(_0x58a48e){logger[_0x4883('0x25')](_0x58a48e[_0x4883('0x26')]);if(_0x58a48e['name']){delete _0x58a48e['name'];}_0x15d3f2['status'](_0x520e58)[_0x4883('0x27')](_0x58a48e);};}exports[_0x4883('0x28')]=function(_0x513618,_0x4ceff4){var _0x44af4a={},_0x4965b7={},_0x15b8a0={'count':0x0,'rows':[]};var _0x32b5ec=_[_0x4883('0x29')](db[_0x4883('0x2a')][_0x4883('0x2b')],function(_0x4382e9){return{'name':_0x4382e9['fieldName'],'type':_0x4382e9[_0x4883('0x2c')][_0x4883('0x2d')]};});_0x4965b7[_0x4883('0x2e')]=_['map'](_0x32b5ec,_0x4883('0x2f'));_0x4965b7[_0x4883('0x30')]=_['keys'](_0x513618['query']);_0x4965b7[_0x4883('0x31')]=_[_0x4883('0x32')](_0x4965b7[_0x4883('0x2e')],_0x4965b7[_0x4883('0x30')]);_0x44af4a[_0x4883('0x33')]=_['intersection'](_0x4965b7[_0x4883('0x2e')],qs[_0x4883('0x34')](_0x513618[_0x4883('0x30')][_0x4883('0x34')]));_0x44af4a['attributes']=_0x44af4a[_0x4883('0x33')][_0x4883('0x35')]?_0x44af4a[_0x4883('0x33')]:_0x4965b7['model'];if(!_0x513618[_0x4883('0x30')][_0x4883('0x36')]('nolimit')){_0x44af4a['limit']=qs[_0x4883('0x37')](_0x513618['query'][_0x4883('0x37')]);_0x44af4a['offset']=qs[_0x4883('0x1a')](_0x513618[_0x4883('0x30')][_0x4883('0x1a')]);}_0x44af4a[_0x4883('0x38')]=qs[_0x4883('0x39')](_0x513618['query'][_0x4883('0x39')]);_0x44af4a[_0x4883('0x3a')]=qs[_0x4883('0x31')](_[_0x4883('0x3b')](_0x513618[_0x4883('0x30')],_0x4965b7[_0x4883('0x31')]),_0x32b5ec);if(_0x513618[_0x4883('0x30')][_0x4883('0x3c')]){_0x44af4a[_0x4883('0x3a')]=_['merge'](_0x44af4a[_0x4883('0x3a')],{'$or':_[_0x4883('0x29')](_0x32b5ec,function(_0x5362e2){if(_0x5362e2[_0x4883('0x2c')]!==_0x4883('0x3d')){var _0x29d644={};_0x29d644[_0x5362e2[_0x4883('0x2f')]]={'$like':'%'+_0x513618[_0x4883('0x30')][_0x4883('0x3c')]+'%'};return _0x29d644;}})});}_0x44af4a=_[_0x4883('0x3e')]({},_0x44af4a,_0x513618[_0x4883('0x3f')]);var _0x737ce3={'where':_0x44af4a[_0x4883('0x3a')]};return db[_0x4883('0x2a')][_0x4883('0x1c')](_0x737ce3)[_0x4883('0x23')](function(_0x26e15a){_0x15b8a0['count']=_0x26e15a;if(_0x513618['query'][_0x4883('0x40')]){_0x44af4a[_0x4883('0x41')]=[{'all':!![]}];}return db[_0x4883('0x2a')][_0x4883('0x42')](_0x44af4a);})['then'](function(_0x313db3){_0x15b8a0[_0x4883('0x43')]=_0x313db3;return _0x15b8a0;})['then'](respondWithFilteredResult(_0x4ceff4,_0x44af4a))[_0x4883('0x44')](handleError(_0x4ceff4,null));};exports[_0x4883('0x45')]=function(_0x1e9ab8,_0x4c7f84){var _0x230727={'raw':!![],'where':{'id':_0x1e9ab8[_0x4883('0x46')]['id']}},_0x1d9fa3={};_0x1d9fa3[_0x4883('0x2e')]=_['keys'](db['MailSubstatus']['rawAttributes']);_0x1d9fa3[_0x4883('0x30')]=_[_0x4883('0x47')](_0x1e9ab8[_0x4883('0x30')]);_0x1d9fa3[_0x4883('0x31')]=_['intersection'](_0x1d9fa3[_0x4883('0x2e')],_0x1d9fa3['query']);_0x230727[_0x4883('0x33')]=_['intersection'](_0x1d9fa3[_0x4883('0x2e')],qs[_0x4883('0x34')](_0x1e9ab8[_0x4883('0x30')]['fields']));_0x230727[_0x4883('0x33')]=_0x230727[_0x4883('0x33')][_0x4883('0x35')]?_0x230727[_0x4883('0x33')]:_0x1d9fa3[_0x4883('0x2e')];if(_0x1e9ab8[_0x4883('0x30')][_0x4883('0x40')]){_0x230727[_0x4883('0x41')]=[{'all':!![]}];}_0x230727=_[_0x4883('0x3e')]({},_0x230727,_0x1e9ab8['options']);return db[_0x4883('0x2a')]['find'](_0x230727)['then'](handleEntityNotFound(_0x4c7f84,null))['then'](respondWithResult(_0x4c7f84,null))[_0x4883('0x44')](handleError(_0x4c7f84,null));};exports[_0x4883('0x48')]=function(_0x4f8a96,_0x53afd5){return db['MailSubstatus'][_0x4883('0x48')](_0x4f8a96['body'],{})[_0x4883('0x23')](respondWithResult(_0x53afd5,0xc9))['catch'](handleError(_0x53afd5,null));};exports['update']=function(_0x408e0c,_0x535431){if(_0x408e0c['body']['id']){delete _0x408e0c[_0x4883('0x49')]['id'];}return db['MailSubstatus'][_0x4883('0x4a')]({'where':{'id':_0x408e0c[_0x4883('0x46')]['id']}})[_0x4883('0x23')](handleEntityNotFound(_0x535431,null))[_0x4883('0x23')](saveUpdates(_0x408e0c['body'],null))[_0x4883('0x23')](respondWithResult(_0x535431,null))['catch'](handleError(_0x535431,null));};exports[_0x4883('0x24')]=function(_0x395760,_0x51ed9f){return db[_0x4883('0x2a')][_0x4883('0x4a')]({'where':{'id':_0x395760['params']['id']}})[_0x4883('0x23')](handleEntityNotFound(_0x51ed9f,null))[_0x4883('0x23')](removeEntity(_0x51ed9f,null))[_0x4883('0x44')](handleError(_0x51ed9f,null));};exports['describe']=function(_0x397bb0,_0x9983ba){return db[_0x4883('0x2a')][_0x4883('0x4b')]()['then'](respondWithResult(_0x9983ba,null))[_0x4883('0x44')](handleError(_0x9983ba,null));}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.model.js b/server/api/mailSubstatus/mailSubstatus.model.js index 77b6e86..5ccc1e6 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 _0x46ed=['mail_substatuses','lodash','util','../../config/logger','api','moment','request-promise','rimraf','./mailSubstatus.attributes','exports'];(function(_0x211ca6,_0x2456ea){var _0x34f225=function(_0x22f6df){while(--_0x22f6df){_0x211ca6['push'](_0x211ca6['shift']());}};_0x34f225(++_0x2456ea);}(_0x46ed,0x169));var _0xd46e=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x46ed[_0x4a9fb1];return _0x348672;};'use strict';var _=require(_0xd46e('0x0'));var util=require(_0xd46e('0x1'));var logger=require(_0xd46e('0x2'))(_0xd46e('0x3'));var moment=require(_0xd46e('0x4'));var BPromise=require('bluebird');var rp=require(_0xd46e('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd46e('0x6'));var config=require('../../config/environment');var attributes=require(_0xd46e('0x7'));module[_0xd46e('0x8')]=function(_0xae41ca,_0x393327){return _0xae41ca['define']('MailSubstatus',attributes,{'tableName':_0xd46e('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbd76=['request-promise','path','rimraf','../../config/environment','./mailSubstatus.attributes','exports','define','MailSubstatus','mail_substatuses','util','../../config/logger','api','moment','bluebird'];(function(_0x20c5d1,_0x4c0145){var _0x14472d=function(_0xd56ebc){while(--_0xd56ebc){_0x20c5d1['push'](_0x20c5d1['shift']());}};_0x14472d(++_0x4c0145);}(_0xbd76,0x79));var _0x6bd7=function(_0x40220a,_0x22feb1){_0x40220a=_0x40220a-0x0;var _0x3903cc=_0xbd76[_0x40220a];return _0x3903cc;};'use strict';var _=require('lodash');var util=require(_0x6bd7('0x0'));var logger=require(_0x6bd7('0x1'))(_0x6bd7('0x2'));var moment=require(_0x6bd7('0x3'));var BPromise=require(_0x6bd7('0x4'));var rp=require(_0x6bd7('0x5'));var fs=require('fs');var path=require(_0x6bd7('0x6'));var rimraf=require(_0x6bd7('0x7'));var config=require(_0x6bd7('0x8'));var attributes=require(_0x6bd7('0x9'));module[_0x6bd7('0xa')]=function(_0x2b8dfd,_0x46ac3b){return _0x2b8dfd[_0x6bd7('0xb')](_0x6bd7('0xc'),attributes,{'tableName':_0x6bd7('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.rpc.js b/server/api/mailSubstatus/mailSubstatus.rpc.js index c116f88..4648abd 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 _0x453e=['jayson/promise','http','request','info','MailSubstatus,\x20%s,\x20%s','request\x20sent','debug','MailSubstatus,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0xc26f04,_0x1a0439){var _0x19dec7=function(_0x12a754){while(--_0x12a754){_0xc26f04['push'](_0xc26f04['shift']());}};_0x19dec7(++_0x1a0439);}(_0x453e,0xdd));var _0xe453=function(_0x33a694,_0x9b6640){_0x33a694=_0x33a694-0x0;var _0x41ff01=_0x453e[_0x33a694];return _0x41ff01;};'use strict';var _=require(_0xe453('0x0'));var util=require('util');var moment=require(_0xe453('0x1'));var BPromise=require(_0xe453('0x2'));var rs=require(_0xe453('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe453('0x4'))['db'];var utils=require(_0xe453('0x5'));var logger=require(_0xe453('0x6'))(_0xe453('0x7'));var config=require(_0xe453('0x8'));var jayson=require(_0xe453('0x9'));var client=jayson['client'][_0xe453('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4981de,_0x283169,_0x25ec44){return new BPromise(function(_0x1cb276,_0x4b5c94){return client[_0xe453('0xb')](_0x4981de,_0x25ec44)['then'](function(_0x19f2f3){logger[_0xe453('0xc')](_0xe453('0xd'),_0x283169,_0xe453('0xe'));logger[_0xe453('0xf')](_0xe453('0x10'),_0x283169,_0xe453('0xe'),JSON[_0xe453('0x11')](_0x19f2f3));if(_0x19f2f3['error']){if(_0x19f2f3[_0xe453('0x12')][_0xe453('0x13')]===0x1f4){logger[_0xe453('0x12')](_0xe453('0xd'),_0x283169,_0x19f2f3[_0xe453('0x12')][_0xe453('0x14')]);return _0x4b5c94(_0x19f2f3[_0xe453('0x12')]['message']);}logger['error'](_0xe453('0xd'),_0x283169,_0x19f2f3['error'][_0xe453('0x14')]);return _0x1cb276(_0x19f2f3[_0xe453('0x12')][_0xe453('0x14')]);}else{logger[_0xe453('0xc')]('MailSubstatus,\x20%s,\x20%s',_0x283169,_0xe453('0xe'));_0x1cb276(_0x19f2f3[_0xe453('0x15')][_0xe453('0x14')]);}})[_0xe453('0x16')](function(_0x585316){logger[_0xe453('0x12')](_0xe453('0xd'),_0x283169,_0x585316);_0x4b5c94(_0x585316);});});} \ No newline at end of file +var _0x4304=['info','debug','MailSubstatus,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','MailSubstatus,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x4304,0xee));var _0x4430=function(_0x18eb9a,_0x528cca){_0x18eb9a=_0x18eb9a-0x0;var _0x112fc3=_0x4304[_0x18eb9a];return _0x112fc3;};'use strict';var _=require(_0x4430('0x0'));var util=require(_0x4430('0x1'));var moment=require(_0x4430('0x2'));var BPromise=require(_0x4430('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4430('0x4'));var db=require(_0x4430('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x4430('0x6'));var config=require(_0x4430('0x7'));var jayson=require(_0x4430('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3697bd,_0x411d2e,_0x5015a1){return new BPromise(function(_0xfe8dbc,_0x4b2284){return client['request'](_0x3697bd,_0x5015a1)['then'](function(_0x4d58e4){logger[_0x4430('0x9')]('MailSubstatus,\x20%s,\x20%s',_0x411d2e,'request\x20sent');logger[_0x4430('0xa')](_0x4430('0xb'),_0x411d2e,_0x4430('0xc'),JSON['stringify'](_0x4d58e4));if(_0x4d58e4[_0x4430('0xd')]){if(_0x4d58e4[_0x4430('0xd')][_0x4430('0xe')]===0x1f4){logger[_0x4430('0xd')](_0x4430('0xf'),_0x411d2e,_0x4d58e4[_0x4430('0xd')]['message']);return _0x4b2284(_0x4d58e4[_0x4430('0xd')][_0x4430('0x10')]);}logger[_0x4430('0xd')](_0x4430('0xf'),_0x411d2e,_0x4d58e4[_0x4430('0xd')][_0x4430('0x10')]);return _0xfe8dbc(_0x4d58e4[_0x4430('0xd')]['message']);}else{logger['info'](_0x4430('0xf'),_0x411d2e,_0x4430('0xc'));_0xfe8dbc(_0x4d58e4[_0x4430('0x11')][_0x4430('0x10')]);}})[_0x4430('0x12')](function(_0x124f0a){logger[_0x4430('0xd')](_0x4430('0xf'),_0x411d2e,_0x124f0a);_0x4b2284(_0x124f0a);});});} \ No newline at end of file diff --git a/server/api/mailTransferReport/index.js b/server/api/mailTransferReport/index.js index 9986ac3..9213d1c 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 _0xdb02=['index','describe','/:id','show','post','create','put','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../config/environment','./mailTransferReport.controller','get','isAuthenticated'];(function(_0x583fdd,_0x1f3707){var _0x463592=function(_0x3efd73){while(--_0x3efd73){_0x583fdd['push'](_0x583fdd['shift']());}};_0x463592(++_0x1f3707);}(_0xdb02,0x11b));var _0x2db0=function(_0x7a6aed,_0x335e68){_0x7a6aed=_0x7a6aed-0x0;var _0x9dbabf=_0xdb02[_0x7a6aed];return _0x9dbabf;};'use strict';var multer=require(_0x2db0('0x0'));var util=require(_0x2db0('0x1'));var path=require(_0x2db0('0x2'));var timeout=require(_0x2db0('0x3'));var express=require(_0x2db0('0x4'));var router=express[_0x2db0('0x5')]();var fs_extra=require(_0x2db0('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x2db0('0x7'));var controller=require(_0x2db0('0x8'));router[_0x2db0('0x9')]('/',auth[_0x2db0('0xa')](),controller[_0x2db0('0xb')]);router['get']('/describe',auth[_0x2db0('0xa')](),controller[_0x2db0('0xc')]);router[_0x2db0('0x9')](_0x2db0('0xd'),auth[_0x2db0('0xa')](),controller[_0x2db0('0xe')]);router[_0x2db0('0xf')]('/',auth['isAuthenticated'](),controller[_0x2db0('0x10')]);router[_0x2db0('0x11')]('/:id',auth[_0x2db0('0xa')](),controller['update']);router[_0x2db0('0x12')](_0x2db0('0xd'),auth[_0x2db0('0xa')](),controller[_0x2db0('0x13')]);module[_0x2db0('0x14')]=router; \ No newline at end of file +var _0x0c09=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','create','put','delete','destroy','util','connect-timeout','express','Router'];(function(_0x30c57f,_0x4e26ca){var _0x570756=function(_0xd1ee2e){while(--_0xd1ee2e){_0x30c57f['push'](_0x30c57f['shift']());}};_0x570756(++_0x4e26ca);}(_0x0c09,0x18c));var _0x90c0=function(_0x2e03f1,_0xcb491d){_0x2e03f1=_0x2e03f1-0x0;var _0x15c10e=_0x0c09[_0x2e03f1];return _0x15c10e;};'use strict';var multer=require('multer');var util=require(_0x90c0('0x0'));var path=require('path');var timeout=require(_0x90c0('0x1'));var express=require(_0x90c0('0x2'));var router=express[_0x90c0('0x3')]();var fs_extra=require(_0x90c0('0x4'));var auth=require(_0x90c0('0x5'));var interaction=require(_0x90c0('0x6'));var config=require(_0x90c0('0x7'));var controller=require(_0x90c0('0x8'));router[_0x90c0('0x9')]('/',auth[_0x90c0('0xa')](),controller[_0x90c0('0xb')]);router['get'](_0x90c0('0xc'),auth['isAuthenticated'](),controller[_0x90c0('0xd')]);router[_0x90c0('0x9')](_0x90c0('0xe'),auth[_0x90c0('0xa')](),controller[_0x90c0('0xf')]);router['post']('/',auth['isAuthenticated'](),controller[_0x90c0('0x10')]);router[_0x90c0('0x11')](_0x90c0('0xe'),auth[_0x90c0('0xa')](),controller['update']);router[_0x90c0('0x12')](_0x90c0('0xe'),auth[_0x90c0('0xa')](),controller[_0x90c0('0x13')]);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 e183613..24d63ca 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 _0xa9e0=['account','queue','DATE','NOW','moment','sequelize','exports'];(function(_0x4d0f0c,_0x3c225a){var _0x1fe673=function(_0x12f7d7){while(--_0x12f7d7){_0x4d0f0c['push'](_0x4d0f0c['shift']());}};_0x1fe673(++_0x3c225a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xa9e0[_0x5b644e];return _0x49c6bf;};'use strict';var moment=require(_0x0a9e('0x0'));var Sequelize=require(_0x0a9e('0x1'));module[_0x0a9e('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x0a9e('0x3'),'agent',_0x0a9e('0x4')),'allowNull':![],'defaultValue':_0x0a9e('0x4')},'transferredAt':{'type':Sequelize[_0x0a9e('0x5')],'allowNull':![],'defaultValue':Sequelize[_0x0a9e('0x6')]}}; \ No newline at end of file +var _0xb43b=['DATE','NOW','moment','sequelize','STRING','ENUM','account','queue'];(function(_0x5ebc04,_0x14a363){var _0x17845c=function(_0x360850){while(--_0x360850){_0x5ebc04['push'](_0x5ebc04['shift']());}};_0x17845c(++_0x14a363);}(_0xb43b,0x1b2));var _0xbb43=function(_0x46e521,_0x5130de){_0x46e521=_0x46e521-0x0;var _0x371a28=_0xb43b[_0x46e521];return _0x371a28;};'use strict';var moment=require(_0xbb43('0x0'));var Sequelize=require(_0xbb43('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0xbb43('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xbb43('0x3')](_0xbb43('0x4'),'agent',_0xbb43('0x5')),'allowNull':![],'defaultValue':_0xbb43('0x5')},'transferredAt':{'type':Sequelize[_0xbb43('0x6')],'allowNull':![],'defaultValue':Sequelize[_0xbb43('0x7')]}}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.controller.js b/server/api/mailTransferReport/mailTransferReport.controller.js index 42aac56..b832d68 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 _0x6d6d=['fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','MailTransferReport','includeAll','include','findAll','rows','catch','show','params','find','create','body','update','describe','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','limit','count','Content-Range','apply','reject','then','destroy','end','stack','name','send','index','map','rawAttributes','fieldName','type','model','keys','query','filters','intersection','attributes'];(function(_0x1f85d6,_0x2e16e5){var _0x1f2e55=function(_0x41a5b6){while(--_0x41a5b6){_0x1f85d6['push'](_0x1f85d6['shift']());}};_0x1f2e55(++_0x2e16e5);}(_0x6d6d,0xf7));var _0xd6d6=function(_0x2cf13a,_0xf5edb0){_0x2cf13a=_0x2cf13a-0x0;var _0x5283b8=_0x6d6d[_0x2cf13a];return _0x5283b8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd6d6('0x0'));var zipdir=require(_0xd6d6('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xd6d6('0x2'));var moment=require(_0xd6d6('0x3'));var BPromise=require(_0xd6d6('0x4'));var Mustache=require(_0xd6d6('0x5'));var util=require(_0xd6d6('0x6'));var path=require(_0xd6d6('0x7'));var sox=require(_0xd6d6('0x8'));var csv=require(_0xd6d6('0x9'));var ejs=require(_0xd6d6('0xa'));var fs=require('fs');var fs_extra=require(_0xd6d6('0xb'));var _=require(_0xd6d6('0xc'));var squel=require(_0xd6d6('0xd'));var crypto=require(_0xd6d6('0xe'));var jsforce=require(_0xd6d6('0xf'));var deskjs=require(_0xd6d6('0x10'));var toCsv=require(_0xd6d6('0x9'));var querystring=require(_0xd6d6('0x11'));var Papa=require(_0xd6d6('0x12'));var Redis=require('ioredis');var authService=require(_0xd6d6('0x13'));var qs=require(_0xd6d6('0x14'));var as=require(_0xd6d6('0x15'));var hardwareService=require(_0xd6d6('0x16'));var logger=require(_0xd6d6('0x17'))(_0xd6d6('0x18'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xd6d6('0x19'));var db=require(_0xd6d6('0x1a'))['db'];function respondWithStatusCode(_0x3a6c99,_0x581693){_0x581693=_0x581693||0xcc;return function(_0x3ef9ce){if(_0x3ef9ce){return _0x3a6c99[_0xd6d6('0x1b')](_0x581693);}return _0x3a6c99[_0xd6d6('0x1c')](_0x581693)['end']();};}function respondWithResult(_0x5d30b1,_0x5d5680){_0x5d5680=_0x5d5680||0xc8;return function(_0x29e28c){if(_0x29e28c){return _0x5d30b1[_0xd6d6('0x1c')](_0x5d5680)[_0xd6d6('0x1d')](_0x29e28c);}};}function respondWithFilteredResult(_0x413f9a,_0x5d698c){return function(_0x2ab8c6){if(_0x2ab8c6){var _0x509413=typeof _0x5d698c[_0xd6d6('0x1e')]==='undefined'&&typeof _0x5d698c[_0xd6d6('0x1f')]==='undefined';var _0x4abb94=_0x2ab8c6['count'];var _0x495707=_0x509413?0x0:_0x5d698c[_0xd6d6('0x1e')];var _0x41c155=_0x509413?_0x2ab8c6[_0xd6d6('0x20')]:_0x5d698c[_0xd6d6('0x1e')]+_0x5d698c[_0xd6d6('0x1f')];var _0x317028;if(_0x41c155>=_0x4abb94){_0x41c155=_0x4abb94;_0x317028=0xc8;}else{_0x317028=0xce;}_0x413f9a[_0xd6d6('0x1c')](_0x317028);return _0x413f9a['set'](_0xd6d6('0x21'),_0x495707+'-'+_0x41c155+'/'+_0x4abb94)['json'](_0x2ab8c6);}return null;};}function patchUpdates(_0x579a06){return function(_0x43eafd){try{jsonpatch[_0xd6d6('0x22')](_0x43eafd,_0x579a06,!![]);}catch(_0x22a5d5){return BPromise[_0xd6d6('0x23')](_0x22a5d5);}return _0x43eafd['save']();};}function saveUpdates(_0x1a039f,_0x58ab22){return function(_0x4c19a3){if(_0x4c19a3){return _0x4c19a3['update'](_0x1a039f)[_0xd6d6('0x24')](function(_0x200011){return _0x200011;});}return null;};}function removeEntity(_0x57f376,_0x165cc2){return function(_0x2be852){if(_0x2be852){return _0x2be852[_0xd6d6('0x25')]()['then'](function(){_0x57f376['status'](0xcc)[_0xd6d6('0x26')]();});}};}function handleEntityNotFound(_0x11f411,_0x576264){return function(_0x14ad6a){if(!_0x14ad6a){_0x11f411[_0xd6d6('0x1b')](0x194);}return _0x14ad6a;};}function handleError(_0x3dfd50,_0x17bba3){_0x17bba3=_0x17bba3||0x1f4;return function(_0x52a32a){logger['error'](_0x52a32a[_0xd6d6('0x27')]);if(_0x52a32a[_0xd6d6('0x28')]){delete _0x52a32a[_0xd6d6('0x28')];}_0x3dfd50['status'](_0x17bba3)[_0xd6d6('0x29')](_0x52a32a);};}exports[_0xd6d6('0x2a')]=function(_0x272e36,_0x257f7f){var _0x4ee880={},_0x49d74b={},_0x336074={'count':0x0,'rows':[]};var _0x390387=_[_0xd6d6('0x2b')](db['MailTransferReport'][_0xd6d6('0x2c')],function(_0x479977){return{'name':_0x479977[_0xd6d6('0x2d')],'type':_0x479977[_0xd6d6('0x2e')]['key']};});_0x49d74b[_0xd6d6('0x2f')]=_[_0xd6d6('0x2b')](_0x390387,_0xd6d6('0x28'));_0x49d74b['query']=_[_0xd6d6('0x30')](_0x272e36[_0xd6d6('0x31')]);_0x49d74b[_0xd6d6('0x32')]=_[_0xd6d6('0x33')](_0x49d74b[_0xd6d6('0x2f')],_0x49d74b[_0xd6d6('0x31')]);_0x4ee880[_0xd6d6('0x34')]=_[_0xd6d6('0x33')](_0x49d74b[_0xd6d6('0x2f')],qs[_0xd6d6('0x35')](_0x272e36['query'][_0xd6d6('0x35')]));_0x4ee880[_0xd6d6('0x34')]=_0x4ee880[_0xd6d6('0x34')][_0xd6d6('0x36')]?_0x4ee880[_0xd6d6('0x34')]:_0x49d74b[_0xd6d6('0x2f')];if(!_0x272e36[_0xd6d6('0x31')][_0xd6d6('0x37')](_0xd6d6('0x38'))){_0x4ee880[_0xd6d6('0x1f')]=qs[_0xd6d6('0x1f')](_0x272e36[_0xd6d6('0x31')][_0xd6d6('0x1f')]);_0x4ee880[_0xd6d6('0x1e')]=qs['offset'](_0x272e36[_0xd6d6('0x31')][_0xd6d6('0x1e')]);}_0x4ee880['order']=qs[_0xd6d6('0x39')](_0x272e36['query'][_0xd6d6('0x39')]);_0x4ee880[_0xd6d6('0x3a')]=qs['filters'](_[_0xd6d6('0x3b')](_0x272e36[_0xd6d6('0x31')],_0x49d74b['filters']),_0x390387);if(_0x272e36[_0xd6d6('0x31')][_0xd6d6('0x3c')]){_0x4ee880[_0xd6d6('0x3a')]=_[_0xd6d6('0x3d')](_0x4ee880[_0xd6d6('0x3a')],{'$or':_[_0xd6d6('0x2b')](_0x390387,function(_0x4b32fb){if(_0x4b32fb['type']!=='VIRTUAL'){var _0x263da0={};_0x263da0[_0x4b32fb[_0xd6d6('0x28')]]={'$like':'%'+_0x272e36[_0xd6d6('0x31')][_0xd6d6('0x3c')]+'%'};return _0x263da0;}})});}_0x4ee880=_[_0xd6d6('0x3d')]({},_0x4ee880,_0x272e36['options']);var _0x453515={'where':_0x4ee880[_0xd6d6('0x3a')]};return db[_0xd6d6('0x3e')]['count'](_0x453515)[_0xd6d6('0x24')](function(_0x130890){_0x336074['count']=_0x130890;if(_0x272e36[_0xd6d6('0x31')][_0xd6d6('0x3f')]){_0x4ee880[_0xd6d6('0x40')]=[{'all':!![]}];}return db[_0xd6d6('0x3e')][_0xd6d6('0x41')](_0x4ee880);})[_0xd6d6('0x24')](function(_0x1aaa23){_0x336074[_0xd6d6('0x42')]=_0x1aaa23;return _0x336074;})[_0xd6d6('0x24')](respondWithFilteredResult(_0x257f7f,_0x4ee880))[_0xd6d6('0x43')](handleError(_0x257f7f,null));};exports[_0xd6d6('0x44')]=function(_0x4cd2b1,_0x35c8ca){var _0x38be74={'raw':!![],'where':{'id':_0x4cd2b1[_0xd6d6('0x45')]['id']}},_0x5b93a5={};_0x5b93a5[_0xd6d6('0x2f')]=_[_0xd6d6('0x30')](db[_0xd6d6('0x3e')][_0xd6d6('0x2c')]);_0x5b93a5[_0xd6d6('0x31')]=_[_0xd6d6('0x30')](_0x4cd2b1['query']);_0x5b93a5[_0xd6d6('0x32')]=_[_0xd6d6('0x33')](_0x5b93a5['model'],_0x5b93a5[_0xd6d6('0x31')]);_0x38be74[_0xd6d6('0x34')]=_[_0xd6d6('0x33')](_0x5b93a5[_0xd6d6('0x2f')],qs[_0xd6d6('0x35')](_0x4cd2b1[_0xd6d6('0x31')][_0xd6d6('0x35')]));_0x38be74[_0xd6d6('0x34')]=_0x38be74[_0xd6d6('0x34')][_0xd6d6('0x36')]?_0x38be74['attributes']:_0x5b93a5[_0xd6d6('0x2f')];if(_0x4cd2b1[_0xd6d6('0x31')][_0xd6d6('0x3f')]){_0x38be74[_0xd6d6('0x40')]=[{'all':!![]}];}_0x38be74=_[_0xd6d6('0x3d')]({},_0x38be74,_0x4cd2b1['options']);return db[_0xd6d6('0x3e')][_0xd6d6('0x46')](_0x38be74)['then'](handleEntityNotFound(_0x35c8ca,null))[_0xd6d6('0x24')](respondWithResult(_0x35c8ca,null))[_0xd6d6('0x43')](handleError(_0x35c8ca,null));};exports['create']=function(_0x381e67,_0x41cae2){return db[_0xd6d6('0x3e')][_0xd6d6('0x47')](_0x381e67[_0xd6d6('0x48')],{})['then'](respondWithResult(_0x41cae2,0xc9))[_0xd6d6('0x43')](handleError(_0x41cae2,null));};exports[_0xd6d6('0x49')]=function(_0x2f4015,_0x2482f9){if(_0x2f4015['body']['id']){delete _0x2f4015[_0xd6d6('0x48')]['id'];}return db['MailTransferReport']['find']({'where':{'id':_0x2f4015[_0xd6d6('0x45')]['id']}})[_0xd6d6('0x24')](handleEntityNotFound(_0x2482f9,null))[_0xd6d6('0x24')](saveUpdates(_0x2f4015['body'],null))[_0xd6d6('0x24')](respondWithResult(_0x2482f9,null))[_0xd6d6('0x43')](handleError(_0x2482f9,null));};exports[_0xd6d6('0x25')]=function(_0x186097,_0x12304a){return db[_0xd6d6('0x3e')][_0xd6d6('0x46')]({'where':{'id':_0x186097[_0xd6d6('0x45')]['id']}})[_0xd6d6('0x24')](handleEntityNotFound(_0x12304a,null))['then'](removeEntity(_0x12304a,null))[_0xd6d6('0x43')](handleError(_0x12304a,null));};exports[_0xd6d6('0x4a')]=function(_0x6bf525,_0x5c0d33){return db[_0xd6d6('0x3e')][_0xd6d6('0x4a')]()['then'](respondWithResult(_0x5c0d33,null))[_0xd6d6('0x43')](handleError(_0x5c0d33,null));}; \ No newline at end of file +var _0x4500=['nolimit','order','where','pick','merge','VIRTUAL','filter','options','includeAll','findAll','rows','catch','keys','include','create','body','find','params','describe','eml-format','rimraf','request-promise','moment','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','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','save','update','then','destroy','error','stack','name','send','index','MailTransferReport','rawAttributes','fieldName','type','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x4500,0x19e));var _0x0450=function(_0x11de83,_0x49e1c1){_0x11de83=_0x11de83-0x0;var _0x45bdb0=_0x4500[_0x11de83];return _0x45bdb0;};'use strict';var emlformat=require(_0x0450('0x0'));var rimraf=require(_0x0450('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0450('0x2'));var moment=require(_0x0450('0x3'));var BPromise=require(_0x0450('0x4'));var Mustache=require(_0x0450('0x5'));var util=require(_0x0450('0x6'));var path=require(_0x0450('0x7'));var sox=require(_0x0450('0x8'));var csv=require(_0x0450('0x9'));var ejs=require(_0x0450('0xa'));var fs=require('fs');var fs_extra=require(_0x0450('0xb'));var _=require(_0x0450('0xc'));var squel=require(_0x0450('0xd'));var crypto=require('crypto');var jsforce=require(_0x0450('0xe'));var deskjs=require(_0x0450('0xf'));var toCsv=require(_0x0450('0x9'));var querystring=require(_0x0450('0x10'));var Papa=require(_0x0450('0x11'));var Redis=require(_0x0450('0x12'));var authService=require(_0x0450('0x13'));var qs=require(_0x0450('0x14'));var as=require(_0x0450('0x15'));var hardwareService=require(_0x0450('0x16'));var logger=require(_0x0450('0x17'))(_0x0450('0x18'));var utils=require(_0x0450('0x19'));var config=require(_0x0450('0x1a'));var licenseUtil=require('../../config/license/util');var db=require(_0x0450('0x1b'))['db'];function respondWithStatusCode(_0x5bd7c9,_0x1b0733){_0x1b0733=_0x1b0733||0xcc;return function(_0xb0b88b){if(_0xb0b88b){return _0x5bd7c9[_0x0450('0x1c')](_0x1b0733);}return _0x5bd7c9[_0x0450('0x1d')](_0x1b0733)[_0x0450('0x1e')]();};}function respondWithResult(_0x3944c1,_0x58b93d){_0x58b93d=_0x58b93d||0xc8;return function(_0x3e91df){if(_0x3e91df){return _0x3944c1[_0x0450('0x1d')](_0x58b93d)[_0x0450('0x1f')](_0x3e91df);}};}function respondWithFilteredResult(_0xd3ea91,_0x4ecbb1){return function(_0x101d31){if(_0x101d31){var _0x10aca5=typeof _0x4ecbb1[_0x0450('0x20')]===_0x0450('0x21')&&typeof _0x4ecbb1[_0x0450('0x22')]==='undefined';var _0x28400e=_0x101d31['count'];var _0x366e6c=_0x10aca5?0x0:_0x4ecbb1[_0x0450('0x20')];var _0x4751e5=_0x10aca5?_0x101d31[_0x0450('0x23')]:_0x4ecbb1[_0x0450('0x20')]+_0x4ecbb1[_0x0450('0x22')];var _0xd8050a;if(_0x4751e5>=_0x28400e){_0x4751e5=_0x28400e;_0xd8050a=0xc8;}else{_0xd8050a=0xce;}_0xd3ea91[_0x0450('0x1d')](_0xd8050a);return _0xd3ea91[_0x0450('0x24')]('Content-Range',_0x366e6c+'-'+_0x4751e5+'/'+_0x28400e)[_0x0450('0x1f')](_0x101d31);}return null;};}function patchUpdates(_0x3679b6){return function(_0xbf9a74){try{jsonpatch[_0x0450('0x25')](_0xbf9a74,_0x3679b6,!![]);}catch(_0x54d6cf){return BPromise['reject'](_0x54d6cf);}return _0xbf9a74[_0x0450('0x26')]();};}function saveUpdates(_0x2a3917,_0x7d13c5){return function(_0x7d643d){if(_0x7d643d){return _0x7d643d[_0x0450('0x27')](_0x2a3917)[_0x0450('0x28')](function(_0x331d41){return _0x331d41;});}return null;};}function removeEntity(_0x39b74e,_0x2797e6){return function(_0x18b923){if(_0x18b923){return _0x18b923[_0x0450('0x29')]()[_0x0450('0x28')](function(){_0x39b74e[_0x0450('0x1d')](0xcc)[_0x0450('0x1e')]();});}};}function handleEntityNotFound(_0x3890c1,_0x4cd6d8){return function(_0x1dc80c){if(!_0x1dc80c){_0x3890c1[_0x0450('0x1c')](0x194);}return _0x1dc80c;};}function handleError(_0x28d712,_0x4e9f26){_0x4e9f26=_0x4e9f26||0x1f4;return function(_0x32b0dc){logger[_0x0450('0x2a')](_0x32b0dc[_0x0450('0x2b')]);if(_0x32b0dc[_0x0450('0x2c')]){delete _0x32b0dc[_0x0450('0x2c')];}_0x28d712[_0x0450('0x1d')](_0x4e9f26)[_0x0450('0x2d')](_0x32b0dc);};}exports[_0x0450('0x2e')]=function(_0xee693b,_0x5138af){var _0x19e83d={},_0x45e268={},_0x1a4027={'count':0x0,'rows':[]};var _0x17d361=_['map'](db[_0x0450('0x2f')][_0x0450('0x30')],function(_0x3d1efe){return{'name':_0x3d1efe[_0x0450('0x31')],'type':_0x3d1efe[_0x0450('0x32')]['key']};});_0x45e268[_0x0450('0x33')]=_[_0x0450('0x34')](_0x17d361,'name');_0x45e268[_0x0450('0x35')]=_['keys'](_0xee693b[_0x0450('0x35')]);_0x45e268[_0x0450('0x36')]=_[_0x0450('0x37')](_0x45e268[_0x0450('0x33')],_0x45e268[_0x0450('0x35')]);_0x19e83d[_0x0450('0x38')]=_[_0x0450('0x37')](_0x45e268[_0x0450('0x33')],qs['fields'](_0xee693b[_0x0450('0x35')][_0x0450('0x39')]));_0x19e83d['attributes']=_0x19e83d[_0x0450('0x38')][_0x0450('0x3a')]?_0x19e83d[_0x0450('0x38')]:_0x45e268[_0x0450('0x33')];if(!_0xee693b['query'][_0x0450('0x3b')](_0x0450('0x3c'))){_0x19e83d['limit']=qs[_0x0450('0x22')](_0xee693b[_0x0450('0x35')][_0x0450('0x22')]);_0x19e83d[_0x0450('0x20')]=qs[_0x0450('0x20')](_0xee693b[_0x0450('0x35')][_0x0450('0x20')]);}_0x19e83d[_0x0450('0x3d')]=qs['sort'](_0xee693b[_0x0450('0x35')]['sort']);_0x19e83d[_0x0450('0x3e')]=qs[_0x0450('0x36')](_[_0x0450('0x3f')](_0xee693b['query'],_0x45e268['filters']),_0x17d361);if(_0xee693b[_0x0450('0x35')]['filter']){_0x19e83d[_0x0450('0x3e')]=_[_0x0450('0x40')](_0x19e83d[_0x0450('0x3e')],{'$or':_[_0x0450('0x34')](_0x17d361,function(_0x49eee5){if(_0x49eee5[_0x0450('0x32')]!==_0x0450('0x41')){var _0xf4ea68={};_0xf4ea68[_0x49eee5[_0x0450('0x2c')]]={'$like':'%'+_0xee693b[_0x0450('0x35')][_0x0450('0x42')]+'%'};return _0xf4ea68;}})});}_0x19e83d=_['merge']({},_0x19e83d,_0xee693b[_0x0450('0x43')]);var _0x7f6d29={'where':_0x19e83d['where']};return db[_0x0450('0x2f')][_0x0450('0x23')](_0x7f6d29)[_0x0450('0x28')](function(_0x506fc3){_0x1a4027[_0x0450('0x23')]=_0x506fc3;if(_0xee693b[_0x0450('0x35')][_0x0450('0x44')]){_0x19e83d['include']=[{'all':!![]}];}return db['MailTransferReport'][_0x0450('0x45')](_0x19e83d);})[_0x0450('0x28')](function(_0x3342cc){_0x1a4027[_0x0450('0x46')]=_0x3342cc;return _0x1a4027;})[_0x0450('0x28')](respondWithFilteredResult(_0x5138af,_0x19e83d))[_0x0450('0x47')](handleError(_0x5138af,null));};exports['show']=function(_0x20cc4f,_0x2ee8e7){var _0x4562d5={'raw':!![],'where':{'id':_0x20cc4f['params']['id']}},_0x3dd017={};_0x3dd017[_0x0450('0x33')]=_['keys'](db[_0x0450('0x2f')]['rawAttributes']);_0x3dd017[_0x0450('0x35')]=_[_0x0450('0x48')](_0x20cc4f['query']);_0x3dd017[_0x0450('0x36')]=_[_0x0450('0x37')](_0x3dd017[_0x0450('0x33')],_0x3dd017[_0x0450('0x35')]);_0x4562d5[_0x0450('0x38')]=_[_0x0450('0x37')](_0x3dd017[_0x0450('0x33')],qs['fields'](_0x20cc4f['query']['fields']));_0x4562d5['attributes']=_0x4562d5['attributes']['length']?_0x4562d5[_0x0450('0x38')]:_0x3dd017[_0x0450('0x33')];if(_0x20cc4f['query']['includeAll']){_0x4562d5[_0x0450('0x49')]=[{'all':!![]}];}_0x4562d5=_[_0x0450('0x40')]({},_0x4562d5,_0x20cc4f[_0x0450('0x43')]);return db['MailTransferReport']['find'](_0x4562d5)[_0x0450('0x28')](handleEntityNotFound(_0x2ee8e7,null))['then'](respondWithResult(_0x2ee8e7,null))[_0x0450('0x47')](handleError(_0x2ee8e7,null));};exports[_0x0450('0x4a')]=function(_0x565310,_0x5618ca){return db[_0x0450('0x2f')][_0x0450('0x4a')](_0x565310[_0x0450('0x4b')],{})[_0x0450('0x28')](respondWithResult(_0x5618ca,0xc9))[_0x0450('0x47')](handleError(_0x5618ca,null));};exports['update']=function(_0x71739a,_0x11f172){if(_0x71739a[_0x0450('0x4b')]['id']){delete _0x71739a['body']['id'];}return db['MailTransferReport'][_0x0450('0x4c')]({'where':{'id':_0x71739a[_0x0450('0x4d')]['id']}})[_0x0450('0x28')](handleEntityNotFound(_0x11f172,null))[_0x0450('0x28')](saveUpdates(_0x71739a['body'],null))[_0x0450('0x28')](respondWithResult(_0x11f172,null))[_0x0450('0x47')](handleError(_0x11f172,null));};exports[_0x0450('0x29')]=function(_0x2eba16,_0x3aea93){return db[_0x0450('0x2f')][_0x0450('0x4c')]({'where':{'id':_0x2eba16[_0x0450('0x4d')]['id']}})[_0x0450('0x28')](handleEntityNotFound(_0x3aea93,null))[_0x0450('0x28')](removeEntity(_0x3aea93,null))[_0x0450('0x47')](handleError(_0x3aea93,null));};exports[_0x0450('0x4e')]=function(_0x2097b2,_0x1a268b){return db[_0x0450('0x2f')][_0x0450('0x4e')]()['then'](respondWithResult(_0x1a268b,null))[_0x0450('0x47')](handleError(_0x1a268b,null));}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.model.js b/server/api/mailTransferReport/mailTransferReport.model.js index 883769c..5248a34 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 _0x78b7=['bluebird','request-promise','path','./mailTransferReport.attributes','exports','define','MailTransferReport','uniqueid','lodash','util','api','moment'];(function(_0x2022d8,_0x4ff6ef){var _0x3400bf=function(_0x19a6c4){while(--_0x19a6c4){_0x2022d8['push'](_0x2022d8['shift']());}};_0x3400bf(++_0x4ff6ef);}(_0x78b7,0x194));var _0x778b=function(_0x3a7b08,_0x1e9560){_0x3a7b08=_0x3a7b08-0x0;var _0x388494=_0x78b7[_0x3a7b08];return _0x388494;};'use strict';var _=require(_0x778b('0x0'));var util=require(_0x778b('0x1'));var logger=require('../../config/logger')(_0x778b('0x2'));var moment=require(_0x778b('0x3'));var BPromise=require(_0x778b('0x4'));var rp=require(_0x778b('0x5'));var fs=require('fs');var path=require(_0x778b('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x778b('0x7'));module[_0x778b('0x8')]=function(_0x11b624,_0xb6f0af){return _0x11b624[_0x778b('0x9')](_0x778b('0xa'),attributes,{'tableName':'report_mail_transfer','paranoid':![],'indexes':[{'name':_0x778b('0xb'),'fields':[_0x778b('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xdad2=['define','uniqueid','util','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','exports'];(function(_0x2d7f0e,_0x3e6fbd){var _0x110b07=function(_0x557b00){while(--_0x557b00){_0x2d7f0e['push'](_0x2d7f0e['shift']());}};_0x110b07(++_0x3e6fbd);}(_0xdad2,0x14c));var _0x2dad=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0xdad2[_0x5d6456];return _0x4d66c1;};'use strict';var _=require('lodash');var util=require(_0x2dad('0x0'));var logger=require(_0x2dad('0x1'))('api');var moment=require(_0x2dad('0x2'));var BPromise=require(_0x2dad('0x3'));var rp=require(_0x2dad('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2dad('0x5'));var config=require(_0x2dad('0x6'));var attributes=require('./mailTransferReport.attributes');module[_0x2dad('0x7')]=function(_0x36a054,_0x27ca04){return _0x36a054[_0x2dad('0x8')]('MailTransferReport',attributes,{'tableName':'report_mail_transfer','paranoid':![],'indexes':[{'name':_0x2dad('0x9'),'fields':[_0x2dad('0x9')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.rpc.js b/server/api/mailTransferReport/mailTransferReport.rpc.js index 1e63382..24c334e 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 _0xdd15=['MailTransferReport,\x20%s,\x20%s','request\x20sent','MailTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x5e174f,_0x44f7c4){var _0x79c856=function(_0xa1231){while(--_0xa1231){_0x5e174f['push'](_0x5e174f['shift']());}};_0x79c856(++_0x44f7c4);}(_0xdd15,0x1ea));var _0x5dd1=function(_0xd0b415,_0x149675){_0xd0b415=_0xd0b415-0x0;var _0x2bdf2c=_0xdd15[_0xd0b415];return _0x2bdf2c;};'use strict';var _=require(_0x5dd1('0x0'));var util=require(_0x5dd1('0x1'));var moment=require('moment');var BPromise=require(_0x5dd1('0x2'));var rs=require(_0x5dd1('0x3'));var fs=require('fs');var Redis=require(_0x5dd1('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x5dd1('0x5'))(_0x5dd1('0x6'));var config=require(_0x5dd1('0x7'));var jayson=require(_0x5dd1('0x8'));var client=jayson['client'][_0x5dd1('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xaa72e1,_0x34a51b,_0x1dfadd){return new BPromise(function(_0xcd1d19,_0x35d3b0){return client['request'](_0xaa72e1,_0x1dfadd)['then'](function(_0x7186ef){logger['info'](_0x5dd1('0xa'),_0x34a51b,_0x5dd1('0xb'));logger['debug'](_0x5dd1('0xc'),_0x34a51b,'request\x20sent',JSON[_0x5dd1('0xd')](_0x7186ef));if(_0x7186ef['error']){if(_0x7186ef[_0x5dd1('0xe')][_0x5dd1('0xf')]===0x1f4){logger[_0x5dd1('0xe')](_0x5dd1('0xa'),_0x34a51b,_0x7186ef[_0x5dd1('0xe')]['message']);return _0x35d3b0(_0x7186ef[_0x5dd1('0xe')][_0x5dd1('0x10')]);}logger[_0x5dd1('0xe')]('MailTransferReport,\x20%s,\x20%s',_0x34a51b,_0x7186ef['error'][_0x5dd1('0x10')]);return _0xcd1d19(_0x7186ef[_0x5dd1('0xe')][_0x5dd1('0x10')]);}else{logger[_0x5dd1('0x11')]('MailTransferReport,\x20%s,\x20%s',_0x34a51b,_0x5dd1('0xb'));_0xcd1d19(_0x7186ef[_0x5dd1('0x12')][_0x5dd1('0x10')]);}})[_0x5dd1('0x13')](function(_0x3bc317){logger[_0x5dd1('0xe')](_0x5dd1('0xa'),_0x34a51b,_0x3bc317);_0x35d3b0(_0x3bc317);});});} \ No newline at end of file +var _0xce15=['randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','MailTransferReport,\x20%s,\x20%s','request\x20sent','debug','MailTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment'];(function(_0x3635ce,_0x33a6f9){var _0x97ecd0=function(_0x123d98){while(--_0x123d98){_0x3635ce['push'](_0x3635ce['shift']());}};_0x97ecd0(++_0x33a6f9);}(_0xce15,0x14d));var _0x5ce1=function(_0x5ecbbc,_0x2541f5){_0x5ecbbc=_0x5ecbbc-0x0;var _0x219a19=_0xce15[_0x5ecbbc];return _0x219a19;};'use strict';var _=require(_0x5ce1('0x0'));var util=require(_0x5ce1('0x1'));var moment=require(_0x5ce1('0x2'));var BPromise=require('bluebird');var rs=require(_0x5ce1('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5ce1('0x4'))['db'];var utils=require(_0x5ce1('0x5'));var logger=require(_0x5ce1('0x6'))(_0x5ce1('0x7'));var config=require(_0x5ce1('0x8'));var jayson=require(_0x5ce1('0x9'));var client=jayson[_0x5ce1('0xa')][_0x5ce1('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x53115a,_0x79695,_0x524490){return new BPromise(function(_0x109998,_0x4f2dba){return client[_0x5ce1('0xc')](_0x53115a,_0x524490)['then'](function(_0x59eefb){logger[_0x5ce1('0xd')](_0x5ce1('0xe'),_0x79695,_0x5ce1('0xf'));logger[_0x5ce1('0x10')](_0x5ce1('0x11'),_0x79695,_0x5ce1('0xf'),JSON[_0x5ce1('0x12')](_0x59eefb));if(_0x59eefb[_0x5ce1('0x13')]){if(_0x59eefb[_0x5ce1('0x13')][_0x5ce1('0x14')]===0x1f4){logger[_0x5ce1('0x13')](_0x5ce1('0xe'),_0x79695,_0x59eefb[_0x5ce1('0x13')][_0x5ce1('0x15')]);return _0x4f2dba(_0x59eefb['error'][_0x5ce1('0x15')]);}logger[_0x5ce1('0x13')]('MailTransferReport,\x20%s,\x20%s',_0x79695,_0x59eefb[_0x5ce1('0x13')][_0x5ce1('0x15')]);return _0x109998(_0x59eefb[_0x5ce1('0x13')][_0x5ce1('0x15')]);}else{logger['info'](_0x5ce1('0xe'),_0x79695,_0x5ce1('0xf'));_0x109998(_0x59eefb[_0x5ce1('0x16')][_0x5ce1('0x15')]);}})[_0x5ce1('0x17')](function(_0x22e8a2){logger[_0x5ce1('0x13')](_0x5ce1('0xe'),_0x79695,_0x22e8a2);_0x4f2dba(_0x22e8a2);});});} \ No newline at end of file diff --git a/server/api/memberReport/index.js b/server/api/memberReport/index.js index 38095bf..9fc3e9c 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 _0x5208=['../../components/auth/service','../../components/interaction/service','../../config/environment','./memberReport.controller','get','/describe','isAuthenticated','/:id','show','create','put','update','delete','destroy','multer','util','path','express','fs-extra'];(function(_0x23f809,_0xb320a){var _0x161118=function(_0x5ba89e){while(--_0x5ba89e){_0x23f809['push'](_0x23f809['shift']());}};_0x161118(++_0xb320a);}(_0x5208,0x80));var _0x8520=function(_0x1ca9eb,_0x99a10b){_0x1ca9eb=_0x1ca9eb-0x0;var _0x2e284e=_0x5208[_0x1ca9eb];return _0x2e284e;};'use strict';var multer=require(_0x8520('0x0'));var util=require(_0x8520('0x1'));var path=require(_0x8520('0x2'));var timeout=require('connect-timeout');var express=require(_0x8520('0x3'));var router=express['Router']();var fs_extra=require(_0x8520('0x4'));var auth=require(_0x8520('0x5'));var interaction=require(_0x8520('0x6'));var config=require(_0x8520('0x7'));var controller=require(_0x8520('0x8'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x8520('0x9')](_0x8520('0xa'),auth[_0x8520('0xb')](),controller['describe']);router[_0x8520('0x9')](_0x8520('0xc'),auth[_0x8520('0xb')](),controller[_0x8520('0xd')]);router['post']('/',auth[_0x8520('0xb')](),controller[_0x8520('0xe')]);router[_0x8520('0xf')](_0x8520('0xc'),auth[_0x8520('0xb')](),controller[_0x8520('0x10')]);router[_0x8520('0x11')](_0x8520('0xc'),auth['isAuthenticated'](),controller[_0x8520('0x12')]);module['exports']=router; \ No newline at end of file +var _0x76cc=['../../components/auth/service','./memberReport.controller','get','isAuthenticated','index','/describe','describe','/:id','post','create','put','update','delete','destroy','exports','util','connect-timeout','express','Router','fs-extra'];(function(_0x3be8b7,_0x2087a7){var _0x210f48=function(_0x51bc4f){while(--_0x51bc4f){_0x3be8b7['push'](_0x3be8b7['shift']());}};_0x210f48(++_0x2087a7);}(_0x76cc,0x9b));var _0xc76c=function(_0x481ad7,_0x561a93){_0x481ad7=_0x481ad7-0x0;var _0x3b96c5=_0x76cc[_0x481ad7];return _0x3b96c5;};'use strict';var multer=require('multer');var util=require(_0xc76c('0x0'));var path=require('path');var timeout=require(_0xc76c('0x1'));var express=require(_0xc76c('0x2'));var router=express[_0xc76c('0x3')]();var fs_extra=require(_0xc76c('0x4'));var auth=require(_0xc76c('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xc76c('0x6'));router[_0xc76c('0x7')]('/',auth[_0xc76c('0x8')](),controller[_0xc76c('0x9')]);router[_0xc76c('0x7')](_0xc76c('0xa'),auth[_0xc76c('0x8')](),controller[_0xc76c('0xb')]);router[_0xc76c('0x7')](_0xc76c('0xc'),auth[_0xc76c('0x8')](),controller['show']);router[_0xc76c('0xd')]('/',auth['isAuthenticated'](),controller[_0xc76c('0xe')]);router[_0xc76c('0xf')](_0xc76c('0xc'),auth[_0xc76c('0x8')](),controller[_0xc76c('0x10')]);router[_0xc76c('0x11')](_0xc76c('0xc'),auth['isAuthenticated'](),controller[_0xc76c('0x12')]);module[_0xc76c('0x13')]=router; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.attributes.js b/server/api/memberReport/memberReport.attributes.js index d812720..2897cab 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 _0x03bc=['exitAt','talk:[destination]','sequelize','exports','STRING','DEFAULT\x20PAUSE','LOGIN,\x20PAUSE,\x20TALKING','INTEGER','DATE','getDataValue','enterAt','diff','seconds','setDataValue'];(function(_0x20a8ea,_0x3937d8){var _0x4df51b=function(_0x1c6780){while(--_0x1c6780){_0x20a8ea['push'](_0x20a8ea['shift']());}};_0x4df51b(++_0x3937d8);}(_0x03bc,0xb8));var _0xc03b=function(_0x58c882,_0x487257){_0x58c882=_0x58c882-0x0;var _0x145f90=_0x03bc[_0x58c882];return _0x145f90;};'use strict';var Sequelize=require(_0xc03b('0x0'));var moment=require('moment');module[_0xc03b('0x1')]={'channel':{'type':Sequelize[_0xc03b('0x2')]},'membername':{'type':Sequelize['STRING']},'interface':{'type':Sequelize[_0xc03b('0x2')]},'type':{'type':Sequelize['STRING'],'defaultValue':_0xc03b('0x3'),'comment':_0xc03b('0x4')},'duration':{'type':Sequelize[_0xc03b('0x5')]},'enterAt':{'type':Sequelize[_0xc03b('0x6')]},'exitAt':{'type':Sequelize[_0xc03b('0x6')],'set':function(_0x48e3de){var _0x31eda8=moment(_0x48e3de);var _0x5982de=moment(this[_0xc03b('0x7')](_0xc03b('0x8')));var _0x64dd0a=_0x31eda8[_0xc03b('0x9')](_0x5982de,_0xc03b('0xa'));this[_0xc03b('0xb')](_0xc03b('0xc'),_0x48e3de);this[_0xc03b('0xb')]('duration',_0x64dd0a||null);}},'data1':{'type':Sequelize[_0xc03b('0x2')],'comment':'talk:[inbound,\x20outbound],\x20pause:[reason]'},'data2':{'type':Sequelize['STRING'],'comment':'talk:[start]'},'data3':{'type':Sequelize['STRING'],'comment':_0xc03b('0xd')},'data4':{'type':Sequelize['STRING'],'comment':'talk:[dial\x20string]'},'data5':{'type':Sequelize['STRING'],'comment':'talk:[queue]'},'role':{'type':Sequelize[_0xc03b('0x2')]},'internal':{'type':Sequelize[_0xc03b('0x5')]},'uniqueid':{'type':Sequelize[_0xc03b('0x2')]}}; \ No newline at end of file +var _0x45c8=['exports','STRING','DATE','enterAt','diff','seconds','setDataValue','exitAt','duration','talk:[inbound,\x20outbound],\x20pause:[reason]','talk:[destination]','talk:[dial\x20string]','talk:[queue]','INTEGER','sequelize'];(function(_0xb21296,_0x8f4de5){var _0x39b720=function(_0x468230){while(--_0x468230){_0xb21296['push'](_0xb21296['shift']());}};_0x39b720(++_0x8f4de5);}(_0x45c8,0xef));var _0x845c=function(_0x120f3c,_0x1c1c66){_0x120f3c=_0x120f3c-0x0;var _0xdb859=_0x45c8[_0x120f3c];return _0xdb859;};'use strict';var Sequelize=require(_0x845c('0x0'));var moment=require('moment');module[_0x845c('0x1')]={'channel':{'type':Sequelize[_0x845c('0x2')]},'membername':{'type':Sequelize[_0x845c('0x2')]},'interface':{'type':Sequelize[_0x845c('0x2')]},'type':{'type':Sequelize['STRING'],'defaultValue':'DEFAULT\x20PAUSE','comment':'LOGIN,\x20PAUSE,\x20TALKING'},'duration':{'type':Sequelize['INTEGER']},'enterAt':{'type':Sequelize[_0x845c('0x3')]},'exitAt':{'type':Sequelize[_0x845c('0x3')],'set':function(_0x1ff5c6){var _0x4e0242=moment(_0x1ff5c6);var _0x335f38=moment(this['getDataValue'](_0x845c('0x4')));var _0x4648e1=_0x4e0242[_0x845c('0x5')](_0x335f38,_0x845c('0x6'));this[_0x845c('0x7')](_0x845c('0x8'),_0x1ff5c6);this[_0x845c('0x7')](_0x845c('0x9'),_0x4648e1||null);}},'data1':{'type':Sequelize[_0x845c('0x2')],'comment':_0x845c('0xa')},'data2':{'type':Sequelize['STRING'],'comment':'talk:[start]'},'data3':{'type':Sequelize[_0x845c('0x2')],'comment':_0x845c('0xb')},'data4':{'type':Sequelize['STRING'],'comment':_0x845c('0xc')},'data5':{'type':Sequelize[_0x845c('0x2')],'comment':_0x845c('0xd')},'role':{'type':Sequelize[_0x845c('0x2')]},'internal':{'type':Sequelize[_0x845c('0xe')]},'uniqueid':{'type':Sequelize[_0x845c('0x2')]}}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.controller.js b/server/api/memberReport/memberReport.controller.js index 451f933..4d62807 100644 --- a/server/api/memberReport/memberReport.controller.js +++ b/server/api/memberReport/memberReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9c44=['catch','params','find','create','body','describe','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','sendStatus','stack','name','send','index','map','MemberReport','rawAttributes','fieldName','type','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','order','sort','pick','filter','where','merge','VIRTUAL','options','then','includeAll','include','findAll','rows'];(function(_0x4e1f10,_0x3ddbab){var _0x5c5438=function(_0x3f9ddb){while(--_0x3f9ddb){_0x4e1f10['push'](_0x4e1f10['shift']());}};_0x5c5438(++_0x3ddbab);}(_0x9c44,0x178));var _0x49c4=function(_0x3b0731,_0xcf9925){_0x3b0731=_0x3b0731-0x0;var _0x4204d7=_0x9c44[_0x3b0731];return _0x4204d7;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x49c4('0x0'));var jsonpatch=require(_0x49c4('0x1'));var rp=require(_0x49c4('0x2'));var moment=require(_0x49c4('0x3'));var BPromise=require(_0x49c4('0x4'));var Mustache=require(_0x49c4('0x5'));var util=require('util');var path=require('path');var sox=require(_0x49c4('0x6'));var csv=require('to-csv');var ejs=require(_0x49c4('0x7'));var fs=require('fs');var fs_extra=require(_0x49c4('0x8'));var _=require(_0x49c4('0x9'));var squel=require(_0x49c4('0xa'));var crypto=require(_0x49c4('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x49c4('0xc'));var toCsv=require(_0x49c4('0xd'));var querystring=require(_0x49c4('0xe'));var Papa=require(_0x49c4('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x49c4('0x10'));var as=require(_0x49c4('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x49c4('0x12'))(_0x49c4('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x49c4('0x14'));var db=require(_0x49c4('0x15'))['db'];function respondWithStatusCode(_0x5487cd,_0x7df3a9){_0x7df3a9=_0x7df3a9||0xcc;return function(_0x403bfb){if(_0x403bfb){return _0x5487cd['sendStatus'](_0x7df3a9);}return _0x5487cd[_0x49c4('0x16')](_0x7df3a9)[_0x49c4('0x17')]();};}function respondWithResult(_0x21f15a,_0x2decee){_0x2decee=_0x2decee||0xc8;return function(_0x12777c){if(_0x12777c){return _0x21f15a[_0x49c4('0x16')](_0x2decee)[_0x49c4('0x18')](_0x12777c);}};}function respondWithFilteredResult(_0x3de397,_0x58d177){return function(_0x3acd06){if(_0x3acd06){var _0x141003=typeof _0x58d177[_0x49c4('0x19')]===_0x49c4('0x1a')&&typeof _0x58d177[_0x49c4('0x1b')]==='undefined';var _0x44e607=_0x3acd06[_0x49c4('0x1c')];var _0x4c3253=_0x141003?0x0:_0x58d177['offset'];var _0x3c782d=_0x141003?_0x3acd06[_0x49c4('0x1c')]:_0x58d177[_0x49c4('0x19')]+_0x58d177['limit'];var _0x24856d;if(_0x3c782d>=_0x44e607){_0x3c782d=_0x44e607;_0x24856d=0xc8;}else{_0x24856d=0xce;}_0x3de397['status'](_0x24856d);return _0x3de397[_0x49c4('0x1d')](_0x49c4('0x1e'),_0x4c3253+'-'+_0x3c782d+'/'+_0x44e607)[_0x49c4('0x18')](_0x3acd06);}return null;};}function patchUpdates(_0x291526){return function(_0x382040){try{jsonpatch[_0x49c4('0x1f')](_0x382040,_0x291526,!![]);}catch(_0x280893){return BPromise[_0x49c4('0x20')](_0x280893);}return _0x382040[_0x49c4('0x21')]();};}function saveUpdates(_0x578447,_0x527126){return function(_0x57f502){if(_0x57f502){return _0x57f502[_0x49c4('0x22')](_0x578447)['then'](function(_0x592bb8){return _0x592bb8;});}return null;};}function removeEntity(_0x2263ae,_0x15581b){return function(_0x26c640){if(_0x26c640){return _0x26c640[_0x49c4('0x23')]()['then'](function(){_0x2263ae['status'](0xcc)[_0x49c4('0x17')]();});}};}function handleEntityNotFound(_0x9cb797,_0x565423){return function(_0x207358){if(!_0x207358){_0x9cb797[_0x49c4('0x24')](0x194);}return _0x207358;};}function handleError(_0x210159,_0xa7a826){_0xa7a826=_0xa7a826||0x1f4;return function(_0x531d92){logger['error'](_0x531d92[_0x49c4('0x25')]);if(_0x531d92['name']){delete _0x531d92[_0x49c4('0x26')];}_0x210159[_0x49c4('0x16')](_0xa7a826)[_0x49c4('0x27')](_0x531d92);};}exports[_0x49c4('0x28')]=function(_0x5987ae,_0x889909){var _0x2b2793={},_0x46e04d={},_0x4f28a2={'count':0x0,'rows':[]};var _0x6329b3=_[_0x49c4('0x29')](db[_0x49c4('0x2a')][_0x49c4('0x2b')],function(_0x17b50f){return{'name':_0x17b50f[_0x49c4('0x2c')],'type':_0x17b50f[_0x49c4('0x2d')]['key']};});_0x46e04d['model']=_['map'](_0x6329b3,_0x49c4('0x26'));_0x46e04d[_0x49c4('0x2e')]=_[_0x49c4('0x2f')](_0x5987ae[_0x49c4('0x2e')]);_0x46e04d[_0x49c4('0x30')]=_['intersection'](_0x46e04d[_0x49c4('0x31')],_0x46e04d[_0x49c4('0x2e')]);_0x2b2793[_0x49c4('0x32')]=_[_0x49c4('0x33')](_0x46e04d['model'],qs['fields'](_0x5987ae[_0x49c4('0x2e')][_0x49c4('0x34')]));_0x2b2793[_0x49c4('0x32')]=_0x2b2793[_0x49c4('0x32')][_0x49c4('0x35')]?_0x2b2793['attributes']:_0x46e04d[_0x49c4('0x31')];if(!_0x5987ae[_0x49c4('0x2e')][_0x49c4('0x36')]('nolimit')){_0x2b2793['limit']=qs[_0x49c4('0x1b')](_0x5987ae[_0x49c4('0x2e')][_0x49c4('0x1b')]);_0x2b2793[_0x49c4('0x19')]=qs[_0x49c4('0x19')](_0x5987ae[_0x49c4('0x2e')][_0x49c4('0x19')]);}_0x2b2793[_0x49c4('0x37')]=qs[_0x49c4('0x38')](_0x5987ae['query'][_0x49c4('0x38')]);_0x2b2793['where']=qs[_0x49c4('0x30')](_[_0x49c4('0x39')](_0x5987ae[_0x49c4('0x2e')],_0x46e04d[_0x49c4('0x30')]),_0x6329b3);if(_0x5987ae['query'][_0x49c4('0x3a')]){_0x2b2793[_0x49c4('0x3b')]=_[_0x49c4('0x3c')](_0x2b2793['where'],{'$or':_[_0x49c4('0x29')](_0x6329b3,function(_0x21d8c7){if(_0x21d8c7[_0x49c4('0x2d')]!==_0x49c4('0x3d')){var _0x1ba7a0={};_0x1ba7a0[_0x21d8c7[_0x49c4('0x26')]]={'$like':'%'+_0x5987ae[_0x49c4('0x2e')][_0x49c4('0x3a')]+'%'};return _0x1ba7a0;}})});}_0x2b2793=_[_0x49c4('0x3c')]({},_0x2b2793,_0x5987ae[_0x49c4('0x3e')]);var _0x1e506a={'where':_0x2b2793['where']};return db[_0x49c4('0x2a')][_0x49c4('0x1c')](_0x1e506a)[_0x49c4('0x3f')](function(_0x23aa32){_0x4f28a2[_0x49c4('0x1c')]=_0x23aa32;if(_0x5987ae[_0x49c4('0x2e')][_0x49c4('0x40')]){_0x2b2793[_0x49c4('0x41')]=[{'all':!![]}];}return db[_0x49c4('0x2a')][_0x49c4('0x42')](_0x2b2793);})[_0x49c4('0x3f')](function(_0xa3d59e){_0x4f28a2[_0x49c4('0x43')]=_0xa3d59e;return _0x4f28a2;})['then'](respondWithFilteredResult(_0x889909,_0x2b2793))[_0x49c4('0x44')](handleError(_0x889909,null));};exports['show']=function(_0x104efb,_0x4915bc){var _0x28d4fb={'raw':!![],'where':{'id':_0x104efb[_0x49c4('0x45')]['id']}},_0x1480da={};_0x1480da[_0x49c4('0x31')]=_['keys'](db['MemberReport'][_0x49c4('0x2b')]);_0x1480da[_0x49c4('0x2e')]=_[_0x49c4('0x2f')](_0x104efb[_0x49c4('0x2e')]);_0x1480da['filters']=_[_0x49c4('0x33')](_0x1480da[_0x49c4('0x31')],_0x1480da[_0x49c4('0x2e')]);_0x28d4fb[_0x49c4('0x32')]=_[_0x49c4('0x33')](_0x1480da[_0x49c4('0x31')],qs[_0x49c4('0x34')](_0x104efb[_0x49c4('0x2e')][_0x49c4('0x34')]));_0x28d4fb['attributes']=_0x28d4fb[_0x49c4('0x32')]['length']?_0x28d4fb[_0x49c4('0x32')]:_0x1480da[_0x49c4('0x31')];if(_0x104efb[_0x49c4('0x2e')][_0x49c4('0x40')]){_0x28d4fb[_0x49c4('0x41')]=[{'all':!![]}];}_0x28d4fb=_['merge']({},_0x28d4fb,_0x104efb[_0x49c4('0x3e')]);return db[_0x49c4('0x2a')][_0x49c4('0x46')](_0x28d4fb)[_0x49c4('0x3f')](handleEntityNotFound(_0x4915bc,null))[_0x49c4('0x3f')](respondWithResult(_0x4915bc,null))[_0x49c4('0x44')](handleError(_0x4915bc,null));};exports[_0x49c4('0x47')]=function(_0x4d89e0,_0x3bac1b){return db['MemberReport'][_0x49c4('0x47')](_0x4d89e0[_0x49c4('0x48')],{})[_0x49c4('0x3f')](respondWithResult(_0x3bac1b,0xc9))[_0x49c4('0x44')](handleError(_0x3bac1b,null));};exports[_0x49c4('0x22')]=function(_0x30bea5,_0x2c6be1){if(_0x30bea5['body']['id']){delete _0x30bea5[_0x49c4('0x48')]['id'];}return db[_0x49c4('0x2a')]['find']({'where':{'id':_0x30bea5[_0x49c4('0x45')]['id']}})[_0x49c4('0x3f')](handleEntityNotFound(_0x2c6be1,null))[_0x49c4('0x3f')](saveUpdates(_0x30bea5[_0x49c4('0x48')],null))['then'](respondWithResult(_0x2c6be1,null))['catch'](handleError(_0x2c6be1,null));};exports[_0x49c4('0x23')]=function(_0x4e8221,_0x4597c3){return db[_0x49c4('0x2a')][_0x49c4('0x46')]({'where':{'id':_0x4e8221[_0x49c4('0x45')]['id']}})[_0x49c4('0x3f')](handleEntityNotFound(_0x4597c3,null))[_0x49c4('0x3f')](removeEntity(_0x4597c3,null))[_0x49c4('0x44')](handleError(_0x4597c3,null));};exports['describe']=function(_0x1f26c2,_0x1550ce){return db[_0x49c4('0x2a')][_0x49c4('0x49')]()[_0x49c4('0x3f')](respondWithResult(_0x1550ce,null))[_0x49c4('0x44')](handleError(_0x1550ce,null));}; \ No newline at end of file +var _0x55ca=['merge','filter','includeAll','include','findAll','rawAttributes','options','create','body','find','params','catch','destroy','describe','eml-format','rimraf','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','reject','update','then','end','sendStatus','error','stack','name','send','index','map','MemberReport','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x55ca,0x126));var _0xa55c=function(_0x3452eb,_0x44035e){_0x3452eb=_0x3452eb-0x0;var _0x4244fd=_0x55ca[_0x3452eb];return _0x4244fd;};'use strict';var emlformat=require(_0xa55c('0x0'));var rimraf=require(_0xa55c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xa55c('0x2'));var BPromise=require(_0xa55c('0x3'));var Mustache=require('mustache');var util=require(_0xa55c('0x4'));var path=require(_0xa55c('0x5'));var sox=require(_0xa55c('0x6'));var csv=require(_0xa55c('0x7'));var ejs=require(_0xa55c('0x8'));var fs=require('fs');var fs_extra=require(_0xa55c('0x9'));var _=require(_0xa55c('0xa'));var squel=require('squel');var crypto=require(_0xa55c('0xb'));var jsforce=require(_0xa55c('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xa55c('0x7'));var querystring=require(_0xa55c('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xa55c('0xe'));var qs=require(_0xa55c('0xf'));var as=require(_0xa55c('0x10'));var hardwareService=require(_0xa55c('0x11'));var logger=require(_0xa55c('0x12'))(_0xa55c('0x13'));var utils=require(_0xa55c('0x14'));var config=require(_0xa55c('0x15'));var licenseUtil=require(_0xa55c('0x16'));var db=require(_0xa55c('0x17'))['db'];function respondWithStatusCode(_0x5d47ff,_0x59d84a){_0x59d84a=_0x59d84a||0xcc;return function(_0x2a35be){if(_0x2a35be){return _0x5d47ff['sendStatus'](_0x59d84a);}return _0x5d47ff['status'](_0x59d84a)['end']();};}function respondWithResult(_0x18ee85,_0x3930e4){_0x3930e4=_0x3930e4||0xc8;return function(_0x462cd6){if(_0x462cd6){return _0x18ee85[_0xa55c('0x18')](_0x3930e4)[_0xa55c('0x19')](_0x462cd6);}};}function respondWithFilteredResult(_0x247e77,_0x4e0b2f){return function(_0x3ccf65){if(_0x3ccf65){var _0x3dcf4f=typeof _0x4e0b2f[_0xa55c('0x1a')]===_0xa55c('0x1b')&&typeof _0x4e0b2f[_0xa55c('0x1c')]===_0xa55c('0x1b');var _0x51590e=_0x3ccf65[_0xa55c('0x1d')];var _0x24783b=_0x3dcf4f?0x0:_0x4e0b2f['offset'];var _0x3d4c9e=_0x3dcf4f?_0x3ccf65[_0xa55c('0x1d')]:_0x4e0b2f[_0xa55c('0x1a')]+_0x4e0b2f[_0xa55c('0x1c')];var _0x23a1ae;if(_0x3d4c9e>=_0x51590e){_0x3d4c9e=_0x51590e;_0x23a1ae=0xc8;}else{_0x23a1ae=0xce;}_0x247e77[_0xa55c('0x18')](_0x23a1ae);return _0x247e77['set']('Content-Range',_0x24783b+'-'+_0x3d4c9e+'/'+_0x51590e)[_0xa55c('0x19')](_0x3ccf65);}return null;};}function patchUpdates(_0x3776ac){return function(_0xade4c4){try{jsonpatch['apply'](_0xade4c4,_0x3776ac,!![]);}catch(_0x383d92){return BPromise[_0xa55c('0x1e')](_0x383d92);}return _0xade4c4['save']();};}function saveUpdates(_0x187a87,_0x133096){return function(_0x940f28){if(_0x940f28){return _0x940f28[_0xa55c('0x1f')](_0x187a87)[_0xa55c('0x20')](function(_0x49ed04){return _0x49ed04;});}return null;};}function removeEntity(_0x1fc828,_0x504c24){return function(_0x5ba836){if(_0x5ba836){return _0x5ba836['destroy']()[_0xa55c('0x20')](function(){_0x1fc828['status'](0xcc)[_0xa55c('0x21')]();});}};}function handleEntityNotFound(_0x190757,_0x3f64de){return function(_0xf0e574){if(!_0xf0e574){_0x190757[_0xa55c('0x22')](0x194);}return _0xf0e574;};}function handleError(_0x170ba4,_0x1da633){_0x1da633=_0x1da633||0x1f4;return function(_0x11e7f7){logger[_0xa55c('0x23')](_0x11e7f7[_0xa55c('0x24')]);if(_0x11e7f7[_0xa55c('0x25')]){delete _0x11e7f7['name'];}_0x170ba4[_0xa55c('0x18')](_0x1da633)[_0xa55c('0x26')](_0x11e7f7);};}exports[_0xa55c('0x27')]=function(_0x906caa,_0x5d940d){var _0x1377b0={},_0x22f6b6={},_0x1b8388={'count':0x0,'rows':[]};var _0x201941=_[_0xa55c('0x28')](db[_0xa55c('0x29')]['rawAttributes'],function(_0x23e698){return{'name':_0x23e698['fieldName'],'type':_0x23e698[_0xa55c('0x2a')][_0xa55c('0x2b')]};});_0x22f6b6[_0xa55c('0x2c')]=_[_0xa55c('0x28')](_0x201941,'name');_0x22f6b6[_0xa55c('0x2d')]=_[_0xa55c('0x2e')](_0x906caa[_0xa55c('0x2d')]);_0x22f6b6[_0xa55c('0x2f')]=_[_0xa55c('0x30')](_0x22f6b6[_0xa55c('0x2c')],_0x22f6b6[_0xa55c('0x2d')]);_0x1377b0[_0xa55c('0x31')]=_[_0xa55c('0x30')](_0x22f6b6[_0xa55c('0x2c')],qs[_0xa55c('0x32')](_0x906caa['query']['fields']));_0x1377b0[_0xa55c('0x31')]=_0x1377b0[_0xa55c('0x31')]['length']?_0x1377b0[_0xa55c('0x31')]:_0x22f6b6[_0xa55c('0x2c')];if(!_0x906caa[_0xa55c('0x2d')][_0xa55c('0x33')](_0xa55c('0x34'))){_0x1377b0[_0xa55c('0x1c')]=qs[_0xa55c('0x1c')](_0x906caa[_0xa55c('0x2d')][_0xa55c('0x1c')]);_0x1377b0['offset']=qs['offset'](_0x906caa['query'][_0xa55c('0x1a')]);}_0x1377b0[_0xa55c('0x35')]=qs[_0xa55c('0x36')](_0x906caa['query'][_0xa55c('0x36')]);_0x1377b0['where']=qs[_0xa55c('0x2f')](_['pick'](_0x906caa[_0xa55c('0x2d')],_0x22f6b6[_0xa55c('0x2f')]),_0x201941);if(_0x906caa[_0xa55c('0x2d')]['filter']){_0x1377b0[_0xa55c('0x37')]=_[_0xa55c('0x38')](_0x1377b0['where'],{'$or':_[_0xa55c('0x28')](_0x201941,function(_0x194e78){if(_0x194e78['type']!=='VIRTUAL'){var _0x235f6b={};_0x235f6b[_0x194e78['name']]={'$like':'%'+_0x906caa[_0xa55c('0x2d')][_0xa55c('0x39')]+'%'};return _0x235f6b;}})});}_0x1377b0=_['merge']({},_0x1377b0,_0x906caa['options']);var _0x5e50b6={'where':_0x1377b0['where']};return db[_0xa55c('0x29')][_0xa55c('0x1d')](_0x5e50b6)[_0xa55c('0x20')](function(_0x99c4f8){_0x1b8388[_0xa55c('0x1d')]=_0x99c4f8;if(_0x906caa['query'][_0xa55c('0x3a')]){_0x1377b0[_0xa55c('0x3b')]=[{'all':!![]}];}return db[_0xa55c('0x29')][_0xa55c('0x3c')](_0x1377b0);})[_0xa55c('0x20')](function(_0x23cef5){_0x1b8388['rows']=_0x23cef5;return _0x1b8388;})[_0xa55c('0x20')](respondWithFilteredResult(_0x5d940d,_0x1377b0))['catch'](handleError(_0x5d940d,null));};exports['show']=function(_0x404e7f,_0x1f63d8){var _0x496920={'raw':!![],'where':{'id':_0x404e7f['params']['id']}},_0x2bd98b={};_0x2bd98b['model']=_[_0xa55c('0x2e')](db[_0xa55c('0x29')][_0xa55c('0x3d')]);_0x2bd98b['query']=_[_0xa55c('0x2e')](_0x404e7f[_0xa55c('0x2d')]);_0x2bd98b['filters']=_[_0xa55c('0x30')](_0x2bd98b['model'],_0x2bd98b[_0xa55c('0x2d')]);_0x496920[_0xa55c('0x31')]=_['intersection'](_0x2bd98b[_0xa55c('0x2c')],qs[_0xa55c('0x32')](_0x404e7f['query'][_0xa55c('0x32')]));_0x496920[_0xa55c('0x31')]=_0x496920[_0xa55c('0x31')]['length']?_0x496920[_0xa55c('0x31')]:_0x2bd98b['model'];if(_0x404e7f[_0xa55c('0x2d')][_0xa55c('0x3a')]){_0x496920[_0xa55c('0x3b')]=[{'all':!![]}];}_0x496920=_['merge']({},_0x496920,_0x404e7f[_0xa55c('0x3e')]);return db[_0xa55c('0x29')]['find'](_0x496920)[_0xa55c('0x20')](handleEntityNotFound(_0x1f63d8,null))[_0xa55c('0x20')](respondWithResult(_0x1f63d8,null))['catch'](handleError(_0x1f63d8,null));};exports[_0xa55c('0x3f')]=function(_0xd3fe78,_0x52f9a7){return db[_0xa55c('0x29')][_0xa55c('0x3f')](_0xd3fe78[_0xa55c('0x40')],{})[_0xa55c('0x20')](respondWithResult(_0x52f9a7,0xc9))['catch'](handleError(_0x52f9a7,null));};exports[_0xa55c('0x1f')]=function(_0x58a7ea,_0x2157d6){if(_0x58a7ea[_0xa55c('0x40')]['id']){delete _0x58a7ea[_0xa55c('0x40')]['id'];}return db['MemberReport'][_0xa55c('0x41')]({'where':{'id':_0x58a7ea[_0xa55c('0x42')]['id']}})['then'](handleEntityNotFound(_0x2157d6,null))[_0xa55c('0x20')](saveUpdates(_0x58a7ea[_0xa55c('0x40')],null))[_0xa55c('0x20')](respondWithResult(_0x2157d6,null))[_0xa55c('0x43')](handleError(_0x2157d6,null));};exports[_0xa55c('0x44')]=function(_0x1c84d9,_0x1e1293){return db[_0xa55c('0x29')][_0xa55c('0x41')]({'where':{'id':_0x1c84d9[_0xa55c('0x42')]['id']}})['then'](handleEntityNotFound(_0x1e1293,null))[_0xa55c('0x20')](removeEntity(_0x1e1293,null))[_0xa55c('0x43')](handleError(_0x1e1293,null));};exports[_0xa55c('0x45')]=function(_0x4f73b6,_0x4c3095){return db[_0xa55c('0x29')]['describe']()[_0xa55c('0x20')](respondWithResult(_0x4c3095,null))['catch'](handleError(_0x4c3095,null));}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.model.js b/server/api/memberReport/memberReport.model.js index e7839e1..dad5849 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 _0xd16a=['./memberReport.attributes','exports','define','report_member','membername_interface','membername','interface','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd16a,0x151));var _0xad16=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd16a[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xad16('0x0'));var util=require(_0xad16('0x1'));var logger=require(_0xad16('0x2'))(_0xad16('0x3'));var moment=require(_0xad16('0x4'));var BPromise=require(_0xad16('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xad16('0x6'));var rimraf=require(_0xad16('0x7'));var config=require('../../config/environment');var attributes=require(_0xad16('0x8'));module[_0xad16('0x9')]=function(_0x4e5d44,_0x371c3d){return _0x4e5d44[_0xad16('0xa')]('MemberReport',attributes,{'tableName':_0xad16('0xb'),'paranoid':![],'indexes':[{'name':_0xad16('0xc'),'fields':[_0xad16('0xd'),_0xad16('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x8466=['MemberReport','membername','interface','lodash','util','moment','request-promise','path','exports','define'];(function(_0x48fdbb,_0x3239bd){var _0x198205=function(_0x1dd8c6){while(--_0x1dd8c6){_0x48fdbb['push'](_0x48fdbb['shift']());}};_0x198205(++_0x3239bd);}(_0x8466,0x139));var _0x6846=function(_0x2d4d71,_0x4e26bb){_0x2d4d71=_0x2d4d71-0x0;var _0x1d8e5b=_0x8466[_0x2d4d71];return _0x1d8e5b;};'use strict';var _=require(_0x6846('0x0'));var util=require(_0x6846('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x6846('0x2'));var BPromise=require('bluebird');var rp=require(_0x6846('0x3'));var fs=require('fs');var path=require(_0x6846('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./memberReport.attributes');module[_0x6846('0x5')]=function(_0x461b0b,_0xa98eee){return _0x461b0b[_0x6846('0x6')](_0x6846('0x7'),attributes,{'tableName':'report_member','paranoid':![],'indexes':[{'name':'membername_interface','fields':[_0x6846('0x8'),_0x6846('0x9')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.rpc.js b/server/api/memberReport/memberReport.rpc.js index b4923e9..9dde4f9 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 _0x5353=['../../config/environment','jayson/promise','http','request','then','info','MemberReport,\x20%s,\x20%s','request\x20sent','MemberReport,\x20%s,\x20%s,\x20%s','error','message','GetMemberReport','MemberReport','findAll','options','raw','where','attributes','map','include','model','debug','stringify','catch','CreateMemberReport','create','UpdateMemberReport','update','body','limit','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x138adb,_0x193fee){var _0x1b27f2=function(_0x5e97a2){while(--_0x5e97a2){_0x138adb['push'](_0x138adb['shift']());}};_0x1b27f2(++_0x193fee);}(_0x5353,0x12f));var _0x3535=function(_0xed6cf0,_0x4bcfbf){_0xed6cf0=_0xed6cf0-0x0;var _0x2cb18c=_0x5353[_0xed6cf0];return _0x2cb18c;};'use strict';var _=require(_0x3535('0x0'));var util=require('util');var moment=require(_0x3535('0x1'));var BPromise=require(_0x3535('0x2'));var rs=require(_0x3535('0x3'));var fs=require('fs');var Redis=require(_0x3535('0x4'));var db=require(_0x3535('0x5'))['db'];var utils=require(_0x3535('0x6'));var logger=require(_0x3535('0x7'))(_0x3535('0x8'));var config=require(_0x3535('0x9'));var jayson=require(_0x3535('0xa'));var client=jayson['client'][_0x3535('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x498868,_0x1c92fd,_0x268873){return new BPromise(function(_0x3e3500,_0x5437a2){return client[_0x3535('0xc')](_0x498868,_0x268873)[_0x3535('0xd')](function(_0x2da555){logger[_0x3535('0xe')](_0x3535('0xf'),_0x1c92fd,_0x3535('0x10'));logger['debug'](_0x3535('0x11'),_0x1c92fd,_0x3535('0x10'),JSON['stringify'](_0x2da555));if(_0x2da555[_0x3535('0x12')]){if(_0x2da555['error']['code']===0x1f4){logger[_0x3535('0x12')](_0x3535('0xf'),_0x1c92fd,_0x2da555[_0x3535('0x12')][_0x3535('0x13')]);return _0x5437a2(_0x2da555[_0x3535('0x12')][_0x3535('0x13')]);}logger[_0x3535('0x12')]('MemberReport,\x20%s,\x20%s',_0x1c92fd,_0x2da555[_0x3535('0x12')]['message']);return _0x3e3500(_0x2da555[_0x3535('0x12')][_0x3535('0x13')]);}else{logger[_0x3535('0xe')]('MemberReport,\x20%s,\x20%s',_0x1c92fd,_0x3535('0x10'));_0x3e3500(_0x2da555['result'][_0x3535('0x13')]);}})['catch'](function(_0x519c33){logger[_0x3535('0x12')](_0x3535('0xf'),_0x1c92fd,_0x519c33);_0x5437a2(_0x519c33);});});}exports[_0x3535('0x14')]=function(_0x298235){var _0x1dfdfe=this;return new Promise(function(_0x2a1705,_0x4340df){return db[_0x3535('0x15')][_0x3535('0x16')]({'raw':_0x298235[_0x3535('0x17')]?_0x298235[_0x3535('0x17')][_0x3535('0x18')]===undefined?!![]:![]:!![],'where':_0x298235['options']?_0x298235['options'][_0x3535('0x19')]||null:null,'attributes':_0x298235['options']?_0x298235['options'][_0x3535('0x1a')]||null:null,'limit':_0x298235[_0x3535('0x17')]?_0x298235[_0x3535('0x17')]['limit']||null:null,'include':_0x298235['options']?_0x298235[_0x3535('0x17')]['include']?_[_0x3535('0x1b')](_0x298235['options'][_0x3535('0x1c')],function(_0x4d372e){return{'model':db[_0x4d372e[_0x3535('0x1d')]],'as':_0x4d372e['as'],'attributes':_0x4d372e['attributes'],'include':_0x4d372e['include']?_[_0x3535('0x1b')](_0x4d372e[_0x3535('0x1c')],function(_0x5a25d1){return{'model':db[_0x5a25d1[_0x3535('0x1d')]],'as':_0x5a25d1['as'],'attributes':_0x5a25d1[_0x3535('0x1a')],'include':_0x5a25d1[_0x3535('0x1c')]?_[_0x3535('0x1b')](_0x5a25d1['include'],function(_0x2bbe00){return{'model':db[_0x2bbe00[_0x3535('0x1d')]],'as':_0x2bbe00['as'],'attributes':_0x2bbe00[_0x3535('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x3535('0xd')](function(_0x40009c){logger[_0x3535('0xe')](_0x3535('0x14'),_0x298235);logger[_0x3535('0x1e')]('GetMemberReport',_0x298235,JSON[_0x3535('0x1f')](_0x40009c));_0x2a1705(_0x40009c);})[_0x3535('0x20')](function(_0x4cf180){logger[_0x3535('0x12')](_0x3535('0x14'),_0x4cf180[_0x3535('0x13')],_0x298235);_0x4340df(_0x1dfdfe['error'](0x1f4,_0x4cf180['message']));});});};exports[_0x3535('0x21')]=function(_0x3ccb51){var _0x5918e4=this;return new Promise(function(_0x33a8e1,_0x207c14){return db[_0x3535('0x15')][_0x3535('0x22')](_0x3ccb51['body'],{'raw':_0x3ccb51[_0x3535('0x17')]?_0x3ccb51[_0x3535('0x17')]['raw']===undefined?!![]:![]:!![]})[_0x3535('0xd')](function(_0x1509b0){logger[_0x3535('0xe')](_0x3535('0x21'),_0x3ccb51);logger[_0x3535('0x1e')](_0x3535('0x21'),_0x3ccb51,JSON[_0x3535('0x1f')](_0x1509b0));_0x33a8e1(_0x1509b0);})['catch'](function(_0x57b875){logger[_0x3535('0x12')](_0x3535('0x21'),_0x57b875[_0x3535('0x13')],_0x3ccb51);_0x207c14(_0x5918e4[_0x3535('0x12')](0x1f4,_0x57b875[_0x3535('0x13')]));});});};exports[_0x3535('0x23')]=function(_0x1cdce8){var _0x3209d8=this;return new Promise(function(_0x482ba9,_0x3a99ab){return db[_0x3535('0x15')][_0x3535('0x24')](_0x1cdce8[_0x3535('0x25')],{'raw':_0x1cdce8[_0x3535('0x17')]?_0x1cdce8[_0x3535('0x17')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1cdce8[_0x3535('0x17')]?_0x1cdce8['options'][_0x3535('0x19')]||null:null,'attributes':_0x1cdce8[_0x3535('0x17')]?_0x1cdce8['options'][_0x3535('0x1a')]||null:null,'limit':_0x1cdce8[_0x3535('0x17')]?_0x1cdce8[_0x3535('0x17')][_0x3535('0x26')]||null:null})['then'](function(_0x47b9c3){logger[_0x3535('0xe')](_0x3535('0x23'),_0x1cdce8);logger[_0x3535('0x1e')](_0x3535('0x23'),_0x1cdce8,JSON[_0x3535('0x1f')](_0x47b9c3));_0x482ba9(_0x47b9c3);})[_0x3535('0x20')](function(_0x4778e3){logger[_0x3535('0x12')](_0x3535('0x23'),_0x4778e3[_0x3535('0x13')],_0x1cdce8);_0x3a99ab(_0x3209d8[_0x3535('0x12')](0x1f4,_0x4778e3[_0x3535('0x13')]));});});}; \ No newline at end of file +var _0x56a6=['catch','GetMemberReport','MemberReport','findAll','options','raw','where','map','include','model','attributes','CreateMemberReport','create','body','UpdateMemberReport','debug','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','info','MemberReport,\x20%s,\x20%s','request\x20sent','MemberReport,\x20%s,\x20%s,\x20%s','stringify','error','message'];(function(_0x324e86,_0x81b1cb){var _0x592846=function(_0x33439c){while(--_0x33439c){_0x324e86['push'](_0x324e86['shift']());}};_0x592846(++_0x81b1cb);}(_0x56a6,0x17b));var _0x656a=function(_0x44659d,_0xb18d2a){_0x44659d=_0x44659d-0x0;var _0x37bd8b=_0x56a6[_0x44659d];return _0x37bd8b;};'use strict';var _=require(_0x656a('0x0'));var util=require(_0x656a('0x1'));var moment=require(_0x656a('0x2'));var BPromise=require(_0x656a('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x656a('0x4'))['db'];var utils=require(_0x656a('0x5'));var logger=require(_0x656a('0x6'))('rpc');var config=require(_0x656a('0x7'));var jayson=require(_0x656a('0x8'));var client=jayson[_0x656a('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x42f089,_0x33cb4a,_0x29e66f){return new BPromise(function(_0x551d61,_0xea808c){return client['request'](_0x42f089,_0x29e66f)['then'](function(_0x147192){logger[_0x656a('0xa')](_0x656a('0xb'),_0x33cb4a,_0x656a('0xc'));logger['debug'](_0x656a('0xd'),_0x33cb4a,_0x656a('0xc'),JSON[_0x656a('0xe')](_0x147192));if(_0x147192[_0x656a('0xf')]){if(_0x147192['error']['code']===0x1f4){logger['error'](_0x656a('0xb'),_0x33cb4a,_0x147192[_0x656a('0xf')][_0x656a('0x10')]);return _0xea808c(_0x147192[_0x656a('0xf')][_0x656a('0x10')]);}logger['error'](_0x656a('0xb'),_0x33cb4a,_0x147192[_0x656a('0xf')][_0x656a('0x10')]);return _0x551d61(_0x147192[_0x656a('0xf')][_0x656a('0x10')]);}else{logger[_0x656a('0xa')](_0x656a('0xb'),_0x33cb4a,_0x656a('0xc'));_0x551d61(_0x147192['result'][_0x656a('0x10')]);}})[_0x656a('0x11')](function(_0x3ad0ad){logger[_0x656a('0xf')](_0x656a('0xb'),_0x33cb4a,_0x3ad0ad);_0xea808c(_0x3ad0ad);});});}exports[_0x656a('0x12')]=function(_0x28cd04){var _0x24d985=this;return new Promise(function(_0x2f186f,_0x58d959){return db[_0x656a('0x13')][_0x656a('0x14')]({'raw':_0x28cd04[_0x656a('0x15')]?_0x28cd04[_0x656a('0x15')][_0x656a('0x16')]===undefined?!![]:![]:!![],'where':_0x28cd04[_0x656a('0x15')]?_0x28cd04[_0x656a('0x15')][_0x656a('0x17')]||null:null,'attributes':_0x28cd04['options']?_0x28cd04[_0x656a('0x15')]['attributes']||null:null,'limit':_0x28cd04['options']?_0x28cd04['options']['limit']||null:null,'include':_0x28cd04[_0x656a('0x15')]?_0x28cd04[_0x656a('0x15')]['include']?_[_0x656a('0x18')](_0x28cd04[_0x656a('0x15')][_0x656a('0x19')],function(_0x519ef3){return{'model':db[_0x519ef3[_0x656a('0x1a')]],'as':_0x519ef3['as'],'attributes':_0x519ef3[_0x656a('0x1b')],'include':_0x519ef3[_0x656a('0x19')]?_[_0x656a('0x18')](_0x519ef3[_0x656a('0x19')],function(_0xc2860f){return{'model':db[_0xc2860f[_0x656a('0x1a')]],'as':_0xc2860f['as'],'attributes':_0xc2860f[_0x656a('0x1b')],'include':_0xc2860f['include']?_[_0x656a('0x18')](_0xc2860f['include'],function(_0x223d67){return{'model':db[_0x223d67['model']],'as':_0x223d67['as'],'attributes':_0x223d67[_0x656a('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x22dbbb){logger['info'](_0x656a('0x12'),_0x28cd04);logger['debug']('GetMemberReport',_0x28cd04,JSON['stringify'](_0x22dbbb));_0x2f186f(_0x22dbbb);})[_0x656a('0x11')](function(_0x49a723){logger[_0x656a('0xf')]('GetMemberReport',_0x49a723[_0x656a('0x10')],_0x28cd04);_0x58d959(_0x24d985[_0x656a('0xf')](0x1f4,_0x49a723[_0x656a('0x10')]));});});};exports[_0x656a('0x1c')]=function(_0x551fa6){var _0x4f81bb=this;return new Promise(function(_0xbaac52,_0x3a877b){return db['MemberReport'][_0x656a('0x1d')](_0x551fa6[_0x656a('0x1e')],{'raw':_0x551fa6[_0x656a('0x15')]?_0x551fa6[_0x656a('0x15')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x3fbb5b){logger[_0x656a('0xa')]('CreateMemberReport',_0x551fa6);logger['debug'](_0x656a('0x1c'),_0x551fa6,JSON[_0x656a('0xe')](_0x3fbb5b));_0xbaac52(_0x3fbb5b);})[_0x656a('0x11')](function(_0x4c4457){logger['error'](_0x656a('0x1c'),_0x4c4457[_0x656a('0x10')],_0x551fa6);_0x3a877b(_0x4f81bb[_0x656a('0xf')](0x1f4,_0x4c4457[_0x656a('0x10')]));});});};exports[_0x656a('0x1f')]=function(_0x3c1c5d){var _0x5d1aad=this;return new Promise(function(_0x5328c4,_0x375b4b){return db[_0x656a('0x13')]['update'](_0x3c1c5d[_0x656a('0x1e')],{'raw':_0x3c1c5d[_0x656a('0x15')]?_0x3c1c5d['options'][_0x656a('0x16')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3c1c5d[_0x656a('0x15')]?_0x3c1c5d[_0x656a('0x15')][_0x656a('0x17')]||null:null,'attributes':_0x3c1c5d[_0x656a('0x15')]?_0x3c1c5d[_0x656a('0x15')][_0x656a('0x1b')]||null:null,'limit':_0x3c1c5d[_0x656a('0x15')]?_0x3c1c5d[_0x656a('0x15')]['limit']||null:null})['then'](function(_0x484639){logger[_0x656a('0xa')]('UpdateMemberReport',_0x3c1c5d);logger[_0x656a('0x20')](_0x656a('0x1f'),_0x3c1c5d,JSON[_0x656a('0xe')](_0x484639));_0x5328c4(_0x484639);})[_0x656a('0x11')](function(_0x54dd3d){logger[_0x656a('0xf')](_0x656a('0x1f'),_0x54dd3d[_0x656a('0x10')],_0x3c1c5d);_0x375b4b(_0x5d1aad[_0x656a('0xf')](0x1f4,_0x54dd3d[_0x656a('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/migration/index.js b/server/api/migration/index.js index 35d021b..e4b48f0 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 _0x4105=['index','exports','multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./migration.controller'];(function(_0x14f89e,_0x139fce){var _0x26092d=function(_0x2bdc20){while(--_0x2bdc20){_0x14f89e['push'](_0x14f89e['shift']());}};_0x26092d(++_0x139fce);}(_0x4105,0x10a));var _0x5410=function(_0x4323fc,_0x43abd5){_0x4323fc=_0x4323fc-0x0;var _0x87bb78=_0x4105[_0x4323fc];return _0x87bb78;};'use strict';var multer=require(_0x5410('0x0'));var util=require(_0x5410('0x1'));var path=require('path');var timeout=require(_0x5410('0x2'));var express=require('express');var router=express[_0x5410('0x3')]();var fs_extra=require(_0x5410('0x4'));var auth=require(_0x5410('0x5'));var interaction=require(_0x5410('0x6'));var config=require(_0x5410('0x7'));var controller=require(_0x5410('0x8'));router['get']('/',controller[_0x5410('0x9')]);module[_0x5410('0xa')]=router; \ No newline at end of file +var _0x58b9=['./migration.controller','get','index','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0xe96fd3,_0x42572b){var _0x3bb93f=function(_0x21cce5){while(--_0x21cce5){_0xe96fd3['push'](_0xe96fd3['shift']());}};_0x3bb93f(++_0x42572b);}(_0x58b9,0xad));var _0x958b=function(_0x3b6532,_0x3b3e10){_0x3b6532=_0x3b6532-0x0;var _0x4429be=_0x58b9[_0x3b6532];return _0x4429be;};'use strict';var multer=require(_0x958b('0x0'));var util=require('util');var path=require(_0x958b('0x1'));var timeout=require(_0x958b('0x2'));var express=require(_0x958b('0x3'));var router=express[_0x958b('0x4')]();var fs_extra=require(_0x958b('0x5'));var auth=require(_0x958b('0x6'));var interaction=require(_0x958b('0x7'));var config=require(_0x958b('0x8'));var controller=require(_0x958b('0x9'));router[_0x958b('0xa')]('/',controller[_0x958b('0xb')]);module[_0x958b('0xc')]=router; \ No newline at end of file diff --git a/server/api/migration/migration.attributes.js b/server/api/migration/migration.attributes.js index 51f55d1..218c34a 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 _0x50dc=['STRING','exports'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x50dc,0x1a3));var _0xc50d=function(_0x3122b9,_0x344564){_0x3122b9=_0x3122b9-0x0;var _0x29d79b=_0x50dc[_0x3122b9];return _0x29d79b;};'use strict';var Sequelize=require('sequelize');module[_0xc50d('0x0')]={'version':{'type':Sequelize[_0xc50d('0x1')],'unique':'version'}}; \ No newline at end of file +var _0xec36=['sequelize','exports'];(function(_0x435b2f,_0x4c44da){var _0x181648=function(_0x3d753e){while(--_0x3d753e){_0x435b2f['push'](_0x435b2f['shift']());}};_0x181648(++_0x4c44da);}(_0xec36,0x150));var _0x6ec3=function(_0x35885a,_0x42fed7){_0x35885a=_0x35885a-0x0;var _0xe86249=_0xec36[_0x35885a];return _0xe86249;};'use strict';var Sequelize=require(_0x6ec3('0x0'));module[_0x6ec3('0x1')]={'version':{'type':Sequelize['STRING'],'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 f4059fd..cf4080a 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 _0x6eb0=['crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','limit','count','Content-Range','reject','save','update','then','destroy','error','stack','send','index','map','Migration','rawAttributes','fieldName','type','key','name','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','offset','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','catch','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash'];(function(_0xfeba9,_0x28c392){var _0x266971=function(_0xdffc9f){while(--_0xdffc9f){_0xfeba9['push'](_0xfeba9['shift']());}};_0x266971(++_0x28c392);}(_0x6eb0,0x81));var _0x06eb=function(_0x521b82,_0x129c64){_0x521b82=_0x521b82-0x0;var _0x44f669=_0x6eb0[_0x521b82];return _0x44f669;};'use strict';var emlformat=require(_0x06eb('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x06eb('0x1'));var jsonpatch=require(_0x06eb('0x2'));var rp=require(_0x06eb('0x3'));var moment=require(_0x06eb('0x4'));var BPromise=require(_0x06eb('0x5'));var Mustache=require(_0x06eb('0x6'));var util=require(_0x06eb('0x7'));var path=require(_0x06eb('0x8'));var sox=require(_0x06eb('0x9'));var csv=require(_0x06eb('0xa'));var ejs=require(_0x06eb('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x06eb('0xc'));var squel=require('squel');var crypto=require(_0x06eb('0xd'));var jsforce=require(_0x06eb('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x06eb('0xa'));var querystring=require(_0x06eb('0xf'));var Papa=require(_0x06eb('0x10'));var Redis=require(_0x06eb('0x11'));var authService=require(_0x06eb('0x12'));var qs=require(_0x06eb('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x06eb('0x14'));var logger=require(_0x06eb('0x15'))('api');var utils=require(_0x06eb('0x16'));var config=require(_0x06eb('0x17'));var licenseUtil=require(_0x06eb('0x18'));var db=require(_0x06eb('0x19'))['db'];function respondWithStatusCode(_0x4862f5,_0x4a18e9){_0x4a18e9=_0x4a18e9||0xcc;return function(_0x59a667){if(_0x59a667){return _0x4862f5[_0x06eb('0x1a')](_0x4a18e9);}return _0x4862f5[_0x06eb('0x1b')](_0x4a18e9)[_0x06eb('0x1c')]();};}function respondWithResult(_0x477482,_0x5769f2){_0x5769f2=_0x5769f2||0xc8;return function(_0x1f6d5d){if(_0x1f6d5d){return _0x477482[_0x06eb('0x1b')](_0x5769f2)[_0x06eb('0x1d')](_0x1f6d5d);}};}function respondWithFilteredResult(_0x53a12a,_0x472247){return function(_0x41884c){if(_0x41884c){var _0x2dbe87=typeof _0x472247['offset']==='undefined'&&typeof _0x472247[_0x06eb('0x1e')]==='undefined';var _0x1818f8=_0x41884c[_0x06eb('0x1f')];var _0x3efc5b=_0x2dbe87?0x0:_0x472247['offset'];var _0x19cb86=_0x2dbe87?_0x41884c[_0x06eb('0x1f')]:_0x472247['offset']+_0x472247[_0x06eb('0x1e')];var _0x1c9d3a;if(_0x19cb86>=_0x1818f8){_0x19cb86=_0x1818f8;_0x1c9d3a=0xc8;}else{_0x1c9d3a=0xce;}_0x53a12a[_0x06eb('0x1b')](_0x1c9d3a);return _0x53a12a['set'](_0x06eb('0x20'),_0x3efc5b+'-'+_0x19cb86+'/'+_0x1818f8)['json'](_0x41884c);}return null;};}function patchUpdates(_0x421108){return function(_0x2bd496){try{jsonpatch['apply'](_0x2bd496,_0x421108,!![]);}catch(_0x563b1c){return BPromise[_0x06eb('0x21')](_0x563b1c);}return _0x2bd496[_0x06eb('0x22')]();};}function saveUpdates(_0x798aef,_0x2de0f2){return function(_0x285a2e){if(_0x285a2e){return _0x285a2e[_0x06eb('0x23')](_0x798aef)[_0x06eb('0x24')](function(_0x39899e){return _0x39899e;});}return null;};}function removeEntity(_0x56e80e,_0x16e0c8){return function(_0x1a397f){if(_0x1a397f){return _0x1a397f[_0x06eb('0x25')]()['then'](function(){_0x56e80e[_0x06eb('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x207ce8,_0x5af3ce){return function(_0x20cddc){if(!_0x20cddc){_0x207ce8[_0x06eb('0x1a')](0x194);}return _0x20cddc;};}function handleError(_0x4d5d04,_0x3742c3){_0x3742c3=_0x3742c3||0x1f4;return function(_0x80475a){logger[_0x06eb('0x26')](_0x80475a[_0x06eb('0x27')]);if(_0x80475a['name']){delete _0x80475a['name'];}_0x4d5d04[_0x06eb('0x1b')](_0x3742c3)[_0x06eb('0x28')](_0x80475a);};}exports[_0x06eb('0x29')]=function(_0x472d31,_0x552ec5){var _0x5d579a={},_0x368ce9={},_0x226bd2={'count':0x0,'rows':[]};var _0x5968a2=_[_0x06eb('0x2a')](db[_0x06eb('0x2b')][_0x06eb('0x2c')],function(_0x5a8007){return{'name':_0x5a8007[_0x06eb('0x2d')],'type':_0x5a8007[_0x06eb('0x2e')][_0x06eb('0x2f')]};});_0x368ce9['model']=_[_0x06eb('0x2a')](_0x5968a2,_0x06eb('0x30'));_0x368ce9['query']=_[_0x06eb('0x31')](_0x472d31[_0x06eb('0x32')]);_0x368ce9[_0x06eb('0x33')]=_[_0x06eb('0x34')](_0x368ce9[_0x06eb('0x35')],_0x368ce9[_0x06eb('0x32')]);_0x5d579a[_0x06eb('0x36')]=_[_0x06eb('0x34')](_0x368ce9['model'],qs[_0x06eb('0x37')](_0x472d31[_0x06eb('0x32')][_0x06eb('0x37')]));_0x5d579a[_0x06eb('0x36')]=_0x5d579a[_0x06eb('0x36')][_0x06eb('0x38')]?_0x5d579a[_0x06eb('0x36')]:_0x368ce9['model'];if(!_0x472d31[_0x06eb('0x32')][_0x06eb('0x39')](_0x06eb('0x3a'))){_0x5d579a[_0x06eb('0x1e')]=qs[_0x06eb('0x1e')](_0x472d31[_0x06eb('0x32')][_0x06eb('0x1e')]);_0x5d579a[_0x06eb('0x3b')]=qs[_0x06eb('0x3b')](_0x472d31[_0x06eb('0x32')][_0x06eb('0x3b')]);}_0x5d579a[_0x06eb('0x3c')]=qs['sort'](_0x472d31[_0x06eb('0x32')][_0x06eb('0x3d')]);_0x5d579a[_0x06eb('0x3e')]=qs[_0x06eb('0x33')](_[_0x06eb('0x3f')](_0x472d31[_0x06eb('0x32')],_0x368ce9[_0x06eb('0x33')]),_0x5968a2);if(_0x472d31[_0x06eb('0x32')]['filter']){_0x5d579a[_0x06eb('0x3e')]=_[_0x06eb('0x40')](_0x5d579a[_0x06eb('0x3e')],{'$or':_[_0x06eb('0x2a')](_0x5968a2,function(_0x454ce4){if(_0x454ce4[_0x06eb('0x2e')]!==_0x06eb('0x41')){var _0x3e8c6c={};_0x3e8c6c[_0x454ce4[_0x06eb('0x30')]]={'$like':'%'+_0x472d31[_0x06eb('0x32')][_0x06eb('0x42')]+'%'};return _0x3e8c6c;}})});}_0x5d579a=_[_0x06eb('0x40')]({},_0x5d579a,_0x472d31[_0x06eb('0x43')]);var _0x130334={'where':_0x5d579a[_0x06eb('0x3e')]};return db[_0x06eb('0x2b')][_0x06eb('0x1f')](_0x130334)[_0x06eb('0x24')](function(_0x356392){_0x226bd2[_0x06eb('0x1f')]=_0x356392;if(_0x472d31[_0x06eb('0x32')][_0x06eb('0x44')]){_0x5d579a[_0x06eb('0x45')]=[{'all':!![]}];}return db[_0x06eb('0x2b')]['findAll'](_0x5d579a);})[_0x06eb('0x24')](function(_0x14453c){_0x226bd2['rows']=_0x14453c;return _0x226bd2;})[_0x06eb('0x24')](respondWithFilteredResult(_0x552ec5,_0x5d579a))[_0x06eb('0x46')](handleError(_0x552ec5,null));}; \ No newline at end of file +var _0x7560=['util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','json','limit','undefined','count','Content-Range','apply','reject','save','update','destroy','then','end','error','stack','name','send','index','map','Migration','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','offset','order','sort','where','filter','merge','options','includeAll','findAll','rows','catch','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache'];(function(_0x4e2b0f,_0x5babe4){var _0x49436f=function(_0x4308e4){while(--_0x4308e4){_0x4e2b0f['push'](_0x4e2b0f['shift']());}};_0x49436f(++_0x5babe4);}(_0x7560,0x18c));var _0x0756=function(_0x4753f3,_0xfa186e){_0x4753f3=_0x4753f3-0x0;var _0x124353=_0x7560[_0x4753f3];return _0x124353;};'use strict';var emlformat=require(_0x0756('0x0'));var rimraf=require(_0x0756('0x1'));var zipdir=require(_0x0756('0x2'));var jsonpatch=require(_0x0756('0x3'));var rp=require('request-promise');var moment=require(_0x0756('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x0756('0x5'));var util=require(_0x0756('0x6'));var path=require(_0x0756('0x7'));var sox=require(_0x0756('0x8'));var csv=require(_0x0756('0x9'));var ejs=require(_0x0756('0xa'));var fs=require('fs');var fs_extra=require(_0x0756('0xb'));var _=require(_0x0756('0xc'));var squel=require('squel');var crypto=require(_0x0756('0xd'));var jsforce=require(_0x0756('0xe'));var deskjs=require(_0x0756('0xf'));var toCsv=require('to-csv');var querystring=require(_0x0756('0x10'));var Papa=require(_0x0756('0x11'));var Redis=require('ioredis');var authService=require(_0x0756('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x0756('0x13'))(_0x0756('0x14'));var utils=require(_0x0756('0x15'));var config=require(_0x0756('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xc6cf7e,_0x234c15){_0x234c15=_0x234c15||0xcc;return function(_0x93a8b1){if(_0x93a8b1){return _0xc6cf7e[_0x0756('0x17')](_0x234c15);}return _0xc6cf7e['status'](_0x234c15)['end']();};}function respondWithResult(_0x1bcde1,_0x4d781a){_0x4d781a=_0x4d781a||0xc8;return function(_0x3f856f){if(_0x3f856f){return _0x1bcde1[_0x0756('0x18')](_0x4d781a)[_0x0756('0x19')](_0x3f856f);}};}function respondWithFilteredResult(_0x4b8684,_0x28c384){return function(_0xd85b8){if(_0xd85b8){var _0x46ba94=typeof _0x28c384['offset']==='undefined'&&typeof _0x28c384[_0x0756('0x1a')]===_0x0756('0x1b');var _0x1007ff=_0xd85b8[_0x0756('0x1c')];var _0x42a9c2=_0x46ba94?0x0:_0x28c384['offset'];var _0x5822e7=_0x46ba94?_0xd85b8[_0x0756('0x1c')]:_0x28c384['offset']+_0x28c384[_0x0756('0x1a')];var _0x5d2119;if(_0x5822e7>=_0x1007ff){_0x5822e7=_0x1007ff;_0x5d2119=0xc8;}else{_0x5d2119=0xce;}_0x4b8684[_0x0756('0x18')](_0x5d2119);return _0x4b8684['set'](_0x0756('0x1d'),_0x42a9c2+'-'+_0x5822e7+'/'+_0x1007ff)[_0x0756('0x19')](_0xd85b8);}return null;};}function patchUpdates(_0x1e82a4){return function(_0xf758c0){try{jsonpatch[_0x0756('0x1e')](_0xf758c0,_0x1e82a4,!![]);}catch(_0x282f26){return BPromise[_0x0756('0x1f')](_0x282f26);}return _0xf758c0[_0x0756('0x20')]();};}function saveUpdates(_0x2f66f8,_0x3c3a28){return function(_0x54b914){if(_0x54b914){return _0x54b914[_0x0756('0x21')](_0x2f66f8)['then'](function(_0x465b4c){return _0x465b4c;});}return null;};}function removeEntity(_0x54eae0,_0x20d1dc){return function(_0x677c10){if(_0x677c10){return _0x677c10[_0x0756('0x22')]()[_0x0756('0x23')](function(){_0x54eae0[_0x0756('0x18')](0xcc)[_0x0756('0x24')]();});}};}function handleEntityNotFound(_0x4980e0,_0x259dd4){return function(_0x8e6bcb){if(!_0x8e6bcb){_0x4980e0[_0x0756('0x17')](0x194);}return _0x8e6bcb;};}function handleError(_0x2785e9,_0x4d8035){_0x4d8035=_0x4d8035||0x1f4;return function(_0x407766){logger[_0x0756('0x25')](_0x407766[_0x0756('0x26')]);if(_0x407766['name']){delete _0x407766[_0x0756('0x27')];}_0x2785e9[_0x0756('0x18')](_0x4d8035)[_0x0756('0x28')](_0x407766);};}exports[_0x0756('0x29')]=function(_0x14dcf6,_0x40f704){var _0x2ce15f={},_0x10f52a={},_0x2fce41={'count':0x0,'rows':[]};var _0x1758ad=_[_0x0756('0x2a')](db[_0x0756('0x2b')][_0x0756('0x2c')],function(_0x4de3f1){return{'name':_0x4de3f1[_0x0756('0x2d')],'type':_0x4de3f1[_0x0756('0x2e')]['key']};});_0x10f52a[_0x0756('0x2f')]=_[_0x0756('0x2a')](_0x1758ad,_0x0756('0x27'));_0x10f52a[_0x0756('0x30')]=_[_0x0756('0x31')](_0x14dcf6[_0x0756('0x30')]);_0x10f52a[_0x0756('0x32')]=_[_0x0756('0x33')](_0x10f52a[_0x0756('0x2f')],_0x10f52a[_0x0756('0x30')]);_0x2ce15f[_0x0756('0x34')]=_[_0x0756('0x33')](_0x10f52a['model'],qs[_0x0756('0x35')](_0x14dcf6[_0x0756('0x30')][_0x0756('0x35')]));_0x2ce15f[_0x0756('0x34')]=_0x2ce15f[_0x0756('0x34')]['length']?_0x2ce15f['attributes']:_0x10f52a[_0x0756('0x2f')];if(!_0x14dcf6[_0x0756('0x30')][_0x0756('0x36')](_0x0756('0x37'))){_0x2ce15f[_0x0756('0x1a')]=qs[_0x0756('0x1a')](_0x14dcf6[_0x0756('0x30')][_0x0756('0x1a')]);_0x2ce15f[_0x0756('0x38')]=qs[_0x0756('0x38')](_0x14dcf6[_0x0756('0x30')]['offset']);}_0x2ce15f[_0x0756('0x39')]=qs[_0x0756('0x3a')](_0x14dcf6[_0x0756('0x30')][_0x0756('0x3a')]);_0x2ce15f[_0x0756('0x3b')]=qs[_0x0756('0x32')](_['pick'](_0x14dcf6[_0x0756('0x30')],_0x10f52a[_0x0756('0x32')]),_0x1758ad);if(_0x14dcf6[_0x0756('0x30')][_0x0756('0x3c')]){_0x2ce15f[_0x0756('0x3b')]=_[_0x0756('0x3d')](_0x2ce15f['where'],{'$or':_[_0x0756('0x2a')](_0x1758ad,function(_0xe217bb){if(_0xe217bb[_0x0756('0x2e')]!=='VIRTUAL'){var _0x5b1634={};_0x5b1634[_0xe217bb[_0x0756('0x27')]]={'$like':'%'+_0x14dcf6[_0x0756('0x30')][_0x0756('0x3c')]+'%'};return _0x5b1634;}})});}_0x2ce15f=_[_0x0756('0x3d')]({},_0x2ce15f,_0x14dcf6[_0x0756('0x3e')]);var _0x133aac={'where':_0x2ce15f['where']};return db['Migration'][_0x0756('0x1c')](_0x133aac)[_0x0756('0x23')](function(_0x20ad72){_0x2fce41['count']=_0x20ad72;if(_0x14dcf6[_0x0756('0x30')][_0x0756('0x3f')]){_0x2ce15f['include']=[{'all':!![]}];}return db[_0x0756('0x2b')][_0x0756('0x40')](_0x2ce15f);})[_0x0756('0x23')](function(_0x23eaa0){_0x2fce41[_0x0756('0x41')]=_0x23eaa0;return _0x2fce41;})[_0x0756('0x23')](respondWithFilteredResult(_0x40f704,_0x2ce15f))[_0x0756('0x42')](handleError(_0x40f704,null));}; \ No newline at end of file diff --git a/server/api/migration/migration.model.js b/server/api/migration/migration.model.js index 8cebd47..64bd09c 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 _0x43d4=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./migration.attributes','exports','define','Migration','migrations','lodash','util'];(function(_0x50aa2e,_0xfbd6f0){var _0x5e07f0=function(_0x3ed540){while(--_0x3ed540){_0x50aa2e['push'](_0x50aa2e['shift']());}};_0x5e07f0(++_0xfbd6f0);}(_0x43d4,0x186));var _0x443d=function(_0x5a889d,_0x5d738b){_0x5a889d=_0x5a889d-0x0;var _0x500397=_0x43d4[_0x5a889d];return _0x500397;};'use strict';var _=require(_0x443d('0x0'));var util=require(_0x443d('0x1'));var logger=require(_0x443d('0x2'))(_0x443d('0x3'));var moment=require(_0x443d('0x4'));var BPromise=require(_0x443d('0x5'));var rp=require(_0x443d('0x6'));var fs=require('fs');var path=require(_0x443d('0x7'));var rimraf=require(_0x443d('0x8'));var config=require('../../config/environment');var attributes=require(_0x443d('0x9'));module[_0x443d('0xa')]=function(_0xfb3ea8,_0x3ee07d){return _0xfb3ea8[_0x443d('0xb')](_0x443d('0xc'),attributes,{'tableName':_0x443d('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x91a6=['util','../../config/logger','request-promise','path','rimraf','../../config/environment','define','Migration','migrations'];(function(_0x4a8ec9,_0x1f541b){var _0x81c74d=function(_0x451ee2){while(--_0x451ee2){_0x4a8ec9['push'](_0x4a8ec9['shift']());}};_0x81c74d(++_0x1f541b);}(_0x91a6,0x19e));var _0x691a=function(_0x46dc11,_0x40cf19){_0x46dc11=_0x46dc11-0x0;var _0x1391ee=_0x91a6[_0x46dc11];return _0x1391ee;};'use strict';var _=require('lodash');var util=require(_0x691a('0x0'));var logger=require(_0x691a('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x691a('0x2'));var fs=require('fs');var path=require(_0x691a('0x3'));var rimraf=require(_0x691a('0x4'));var config=require(_0x691a('0x5'));var attributes=require('./migration.attributes');module['exports']=function(_0x1308fc,_0x274a11){return _0x1308fc[_0x691a('0x6')](_0x691a('0x7'),attributes,{'tableName':_0x691a('0x8'),'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 fce63f0..6487535 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 _0x04b8=['error','code','message','util','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','then','info','Migration,\x20%s,\x20%s','request\x20sent','Migration,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x2064e5,_0x4f6fa2){var _0x21a233=function(_0x1b2491){while(--_0x1b2491){_0x2064e5['push'](_0x2064e5['shift']());}};_0x21a233(++_0x4f6fa2);}(_0x04b8,0x159));var _0x804b=function(_0x5956c4,_0x5b932a){_0x5956c4=_0x5956c4-0x0;var _0x4b36ed=_0x04b8[_0x5956c4];return _0x4b36ed;};'use strict';var _=require('lodash');var util=require(_0x804b('0x0'));var moment=require('moment');var BPromise=require(_0x804b('0x1'));var rs=require(_0x804b('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x804b('0x3'))['db'];var utils=require(_0x804b('0x4'));var logger=require('../../config/logger')(_0x804b('0x5'));var config=require(_0x804b('0x6'));var jayson=require(_0x804b('0x7'));var client=jayson['client'][_0x804b('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3c5404,_0x476262,_0x50826d){return new BPromise(function(_0x27e950,_0x1071b4){return client['request'](_0x3c5404,_0x50826d)[_0x804b('0x9')](function(_0x336325){logger[_0x804b('0xa')](_0x804b('0xb'),_0x476262,_0x804b('0xc'));logger['debug'](_0x804b('0xd'),_0x476262,_0x804b('0xc'),JSON[_0x804b('0xe')](_0x336325));if(_0x336325[_0x804b('0xf')]){if(_0x336325[_0x804b('0xf')][_0x804b('0x10')]===0x1f4){logger['error'](_0x804b('0xb'),_0x476262,_0x336325['error'][_0x804b('0x11')]);return _0x1071b4(_0x336325[_0x804b('0xf')][_0x804b('0x11')]);}logger[_0x804b('0xf')]('Migration,\x20%s,\x20%s',_0x476262,_0x336325[_0x804b('0xf')][_0x804b('0x11')]);return _0x27e950(_0x336325[_0x804b('0xf')][_0x804b('0x11')]);}else{logger['info'](_0x804b('0xb'),_0x476262,_0x804b('0xc'));_0x27e950(_0x336325['result'][_0x804b('0x11')]);}})['catch'](function(_0x2c90b9){logger[_0x804b('0xf')](_0x804b('0xb'),_0x476262,_0x2c90b9);_0x1071b4(_0x2c90b9);});});} \ No newline at end of file +var _0xbc8b=['../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','Migration,\x20%s,\x20%s','request\x20sent','debug','Migration,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','util','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0xbc8b,0x16b));var _0xbbc8=function(_0x152136,_0x4f14f1){_0x152136=_0x152136-0x0;var _0x20df44=_0xbc8b[_0x152136];return _0x20df44;};'use strict';var _=require('lodash');var util=require(_0xbbc8('0x0'));var moment=require('moment');var BPromise=require(_0xbbc8('0x1'));var rs=require(_0xbbc8('0x2'));var fs=require('fs');var Redis=require(_0xbbc8('0x3'));var db=require(_0xbbc8('0x4'))['db'];var utils=require(_0xbbc8('0x5'));var logger=require(_0xbbc8('0x6'))('rpc');var config=require(_0xbbc8('0x7'));var jayson=require(_0xbbc8('0x8'));var client=jayson[_0xbbc8('0x9')][_0xbbc8('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x18c3d7,_0x5dee88,_0x396aa2){return new BPromise(function(_0x313a01,_0x515917){return client[_0xbbc8('0xb')](_0x18c3d7,_0x396aa2)[_0xbbc8('0xc')](function(_0x255dd2){logger[_0xbbc8('0xd')](_0xbbc8('0xe'),_0x5dee88,_0xbbc8('0xf'));logger[_0xbbc8('0x10')](_0xbbc8('0x11'),_0x5dee88,_0xbbc8('0xf'),JSON[_0xbbc8('0x12')](_0x255dd2));if(_0x255dd2[_0xbbc8('0x13')]){if(_0x255dd2[_0xbbc8('0x13')]['code']===0x1f4){logger[_0xbbc8('0x13')](_0xbbc8('0xe'),_0x5dee88,_0x255dd2[_0xbbc8('0x13')]['message']);return _0x515917(_0x255dd2['error'][_0xbbc8('0x14')]);}logger['error'](_0xbbc8('0xe'),_0x5dee88,_0x255dd2[_0xbbc8('0x13')][_0xbbc8('0x14')]);return _0x313a01(_0x255dd2[_0xbbc8('0x13')][_0xbbc8('0x14')]);}else{logger[_0xbbc8('0xd')](_0xbbc8('0xe'),_0x5dee88,_0xbbc8('0xf'));_0x313a01(_0x255dd2[_0xbbc8('0x15')][_0xbbc8('0x14')]);}})[_0xbbc8('0x16')](function(_0x2438f){logger[_0xbbc8('0x13')](_0xbbc8('0xe'),_0x5dee88,_0x2438f);_0x515917(_0x2438f);});});} \ No newline at end of file diff --git a/server/api/network/index.js b/server/api/network/index.js index 84bb364..ab5bf71 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 _0x02d4=['isAuthenticated','show','post','create','put','update','exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./network.controller','get','index','/:id'];(function(_0xefd519,_0xc62635){var _0x4bb882=function(_0x37e0a1){while(--_0x37e0a1){_0xefd519['push'](_0xefd519['shift']());}};_0x4bb882(++_0xc62635);}(_0x02d4,0x111));var _0x402d=function(_0x2c7c40,_0x4501b7){_0x2c7c40=_0x2c7c40-0x0;var _0x2bf081=_0x02d4[_0x2c7c40];return _0x2bf081;};'use strict';var multer=require(_0x402d('0x0'));var util=require('util');var path=require(_0x402d('0x1'));var timeout=require('connect-timeout');var express=require(_0x402d('0x2'));var router=express[_0x402d('0x3')]();var fs_extra=require(_0x402d('0x4'));var auth=require(_0x402d('0x5'));var interaction=require(_0x402d('0x6'));var config=require(_0x402d('0x7'));var controller=require(_0x402d('0x8'));router[_0x402d('0x9')]('/',auth['isAuthenticated'](),controller[_0x402d('0xa')]);router[_0x402d('0x9')](_0x402d('0xb'),auth[_0x402d('0xc')](),controller[_0x402d('0xd')]);router[_0x402d('0xe')]('/',auth[_0x402d('0xc')](),controller[_0x402d('0xf')]);router[_0x402d('0x10')](_0x402d('0xb'),auth['isAuthenticated'](),controller[_0x402d('0x11')]);router['delete']('/:id',auth[_0x402d('0xc')](),controller['destroy']);module[_0x402d('0x12')]=router; \ No newline at end of file +var _0xbf25=['../../components/interaction/service','../../config/environment','./network.controller','get','isAuthenticated','index','/:id','show','post','update','delete','destroy','exports','multer','util','connect-timeout','express','../../components/auth/service'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xbf25,0x12d));var _0x5bf2=function(_0x24e41c,_0x3a8658){_0x24e41c=_0x24e41c-0x0;var _0x1029da=_0xbf25[_0x24e41c];return _0x1029da;};'use strict';var multer=require(_0x5bf2('0x0'));var util=require(_0x5bf2('0x1'));var path=require('path');var timeout=require(_0x5bf2('0x2'));var express=require(_0x5bf2('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x5bf2('0x4'));var interaction=require(_0x5bf2('0x5'));var config=require(_0x5bf2('0x6'));var controller=require(_0x5bf2('0x7'));router[_0x5bf2('0x8')]('/',auth[_0x5bf2('0x9')](),controller[_0x5bf2('0xa')]);router[_0x5bf2('0x8')](_0x5bf2('0xb'),auth[_0x5bf2('0x9')](),controller[_0x5bf2('0xc')]);router[_0x5bf2('0xd')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x5bf2('0xb'),auth[_0x5bf2('0x9')](),controller[_0x5bf2('0xe')]);router[_0x5bf2('0xf')](_0x5bf2('0xb'),auth[_0x5bf2('0x9')](),controller[_0x5bf2('0x10')]);module[_0x5bf2('0x11')]=router; \ No newline at end of file diff --git a/server/api/network/network.attributes.js b/server/api/network/network.attributes.js index b52e45e..ea43f89 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 _0x7439=['ENUM','externip','stun','turn','STRING'];(function(_0x203314,_0x3cf55e){var _0x3a2b44=function(_0x10b887){while(--_0x10b887){_0x203314['push'](_0x203314['shift']());}};_0x3a2b44(++_0x3cf55e);}(_0x7439,0x172));var _0x9743=function(_0xa1af14,_0x31c2fa){_0xa1af14=_0xa1af14-0x0;var _0x24af4c=_0x7439[_0xa1af14];return _0x24af4c;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize[_0x9743('0x0')]('localnet',_0x9743('0x1'),_0x9743('0x2'),_0x9743('0x3'))},'value':{'type':Sequelize[_0x9743('0x4')]},'username':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0x9743('0x4')]}}; \ No newline at end of file +var _0x63d8=['turn','STRING','sequelize','localnet','externip','stun'];(function(_0xed977b,_0x2983d0){var _0x47adc3=function(_0x22167b){while(--_0x22167b){_0xed977b['push'](_0xed977b['shift']());}};_0x47adc3(++_0x2983d0);}(_0x63d8,0x16a));var _0x863d=function(_0x135f88,_0xc381d4){_0x135f88=_0x135f88-0x0;var _0x219d59=_0x63d8[_0x135f88];return _0x219d59;};'use strict';var Sequelize=require(_0x863d('0x0'));module['exports']={'type':{'type':Sequelize['ENUM'](_0x863d('0x1'),_0x863d('0x2'),_0x863d('0x3'),_0x863d('0x4'))},'value':{'type':Sequelize[_0x863d('0x5')]},'username':{'type':Sequelize[_0x863d('0x5')]},'password':{'type':Sequelize[_0x863d('0x5')]}}; \ No newline at end of file diff --git a/server/api/network/network.controller.js b/server/api/network/network.controller.js index f834e57..6032fbf 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 _0x3423=['result','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','destroy','sendStatus','stack','name','index','rawAttributes','fieldName','type','key','model','map','filters','intersection','query','length','attributes','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','Network','findAll','rows','catch','show','params','fields','find','create','sequelize','transaction','body','toUpperCase','STUN','readFileSync','root','server/files/templates/stun_multiple.ejs','utf8','render','writeFileSync','/etc/asterisk/stun_xcally.conf','Reload','TURN','join','/etc/asterisk/turn_xcally.conf','res_stun_monitor.so','format','/etc/asterisk/sip_xcally_%s.conf','toLowerCase','chan_sip.so','update','server/files/templates/turn_multiple.ejs','server/files/templates/network.ejs','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','client','request','then','info','Network,\x20%s,\x20%s','request\x20sent','Network,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x372df5,_0x4c3340){var _0x55d332=function(_0x3890ca){while(--_0x3890ca){_0x372df5['push'](_0x372df5['shift']());}};_0x55d332(++_0x4c3340);}(_0x3423,0x1f0));var _0x3342=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3423[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x3342('0x0'));var rimraf=require(_0x3342('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3342('0x2'));var rp=require(_0x3342('0x3'));var moment=require(_0x3342('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x3342('0x5'));var util=require(_0x3342('0x6'));var path=require(_0x3342('0x7'));var sox=require('sox');var csv=require(_0x3342('0x8'));var ejs=require(_0x3342('0x9'));var fs=require('fs');var fs_extra=require(_0x3342('0xa'));var _=require(_0x3342('0xb'));var squel=require(_0x3342('0xc'));var crypto=require(_0x3342('0xd'));var jsforce=require(_0x3342('0xe'));var deskjs=require(_0x3342('0xf'));var toCsv=require('to-csv');var querystring=require(_0x3342('0x10'));var Papa=require(_0x3342('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x3342('0x12'));var as=require(_0x3342('0x13'));var hardwareService=require(_0x3342('0x14'));var logger=require('../../config/logger')(_0x3342('0x15'));var utils=require('../../config/utils');var config=require(_0x3342('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var jayson=require('jayson/promise');var client=jayson[_0x3342('0x17')]['http']({'port':0x232a});function respondWithRpcPromise(_0x494416,_0x124745,_0x27e6b1,_0x2dd9d0){return new BPromise(function(_0x24e1ea,_0x10be5d){var _0x5705f3=_0x2dd9d0||client;return _0x5705f3[_0x3342('0x18')](_0x494416,_0x27e6b1)[_0x3342('0x19')](function(_0x33c626){logger[_0x3342('0x1a')](_0x3342('0x1b'),_0x124745,_0x3342('0x1c'));logger['debug'](_0x3342('0x1d'),_0x124745,_0x3342('0x1c'),JSON[_0x3342('0x1e')](_0x33c626));if(_0x33c626[_0x3342('0x1f')]){if(_0x33c626['error'][_0x3342('0x20')]===0x1f4){logger[_0x3342('0x1f')]('Network,\x20%s,\x20%s',_0x124745,_0x33c626['error'][_0x3342('0x21')]);return _0x10be5d(_0x33c626[_0x3342('0x1f')][_0x3342('0x21')]);}logger['error'](_0x3342('0x1b'),_0x124745,_0x33c626[_0x3342('0x1f')][_0x3342('0x21')]);return _0x24e1ea(_0x33c626[_0x3342('0x1f')]['message']);}else{logger[_0x3342('0x1a')](_0x3342('0x1b'),_0x124745,_0x3342('0x1c'));_0x24e1ea(_0x33c626[_0x3342('0x22')][_0x3342('0x21')]);}})['catch'](function(_0x3ff193){logger[_0x3342('0x1f')]('Network,\x20%s,\x20%s',_0x124745,_0x3ff193);_0x10be5d(_0x3ff193);});});}function respondWithStatusCode(_0x3d6d21,_0x58d2a0){_0x58d2a0=_0x58d2a0||0xcc;return function(_0x1b8298){if(_0x1b8298){return _0x3d6d21['sendStatus'](_0x58d2a0);}return _0x3d6d21[_0x3342('0x23')](_0x58d2a0)[_0x3342('0x24')]();};}function respondWithResult(_0x1159f9,_0x3cf3fb){_0x3cf3fb=_0x3cf3fb||0xc8;return function(_0x5c310a){if(_0x5c310a){return _0x1159f9['status'](_0x3cf3fb)[_0x3342('0x25')](_0x5c310a);}};}function respondWithFilteredResult(_0x434bd,_0x4d156d){return function(_0xcbc395){if(_0xcbc395){var _0x510f65=typeof _0x4d156d[_0x3342('0x26')]===_0x3342('0x27')&&typeof _0x4d156d[_0x3342('0x28')]===_0x3342('0x27');var _0x2f59e5=_0xcbc395[_0x3342('0x29')];var _0x288f59=_0x510f65?0x0:_0x4d156d[_0x3342('0x26')];var _0x57e264=_0x510f65?_0xcbc395[_0x3342('0x29')]:_0x4d156d[_0x3342('0x26')]+_0x4d156d[_0x3342('0x28')];var _0x3ddd0f;if(_0x57e264>=_0x2f59e5){_0x57e264=_0x2f59e5;_0x3ddd0f=0xc8;}else{_0x3ddd0f=0xce;}_0x434bd['status'](_0x3ddd0f);return _0x434bd[_0x3342('0x2a')](_0x3342('0x2b'),_0x288f59+'-'+_0x57e264+'/'+_0x2f59e5)[_0x3342('0x25')](_0xcbc395);}return null;};}function patchUpdates(_0x3da958){return function(_0x2e2701){try{jsonpatch[_0x3342('0x2c')](_0x2e2701,_0x3da958,!![]);}catch(_0x4cab68){return BPromise['reject'](_0x4cab68);}return _0x2e2701[_0x3342('0x2d')]();};}function saveUpdates(_0x535714,_0x4ddfba){return function(_0x5a9fce){if(_0x5a9fce){return _0x5a9fce['update'](_0x535714)[_0x3342('0x19')](function(_0x2cd667){return _0x2cd667;});}return null;};}function removeEntity(_0x5e3a37,_0x660db1){return function(_0x14ca8e){if(_0x14ca8e){return _0x14ca8e[_0x3342('0x2e')]()[_0x3342('0x19')](function(){_0x5e3a37[_0x3342('0x23')](0xcc)[_0x3342('0x24')]();});}};}function handleEntityNotFound(_0xbf9d95,_0x5b4d0e){return function(_0x278231){if(!_0x278231){_0xbf9d95[_0x3342('0x2f')](0x194);}return _0x278231;};}function handleError(_0x16ff7c,_0x3e8e13){_0x3e8e13=_0x3e8e13||0x1f4;return function(_0x2fd1d8){logger[_0x3342('0x1f')](_0x2fd1d8[_0x3342('0x30')]);if(_0x2fd1d8[_0x3342('0x31')]){delete _0x2fd1d8[_0x3342('0x31')];}_0x16ff7c[_0x3342('0x23')](_0x3e8e13)['send'](_0x2fd1d8);};}exports[_0x3342('0x32')]=function(_0x10c110,_0x45078a){var _0x88ddfb={},_0xf3bfe3={},_0x1a78be={'count':0x0,'rows':[]};var _0xeb3301=_['map'](db['Network'][_0x3342('0x33')],function(_0x3524b1){return{'name':_0x3524b1[_0x3342('0x34')],'type':_0x3524b1[_0x3342('0x35')][_0x3342('0x36')]};});_0xf3bfe3[_0x3342('0x37')]=_[_0x3342('0x38')](_0xeb3301,_0x3342('0x31'));_0xf3bfe3['query']=_['keys'](_0x10c110['query']);_0xf3bfe3[_0x3342('0x39')]=_[_0x3342('0x3a')](_0xf3bfe3[_0x3342('0x37')],_0xf3bfe3[_0x3342('0x3b')]);_0x88ddfb['attributes']=_[_0x3342('0x3a')](_0xf3bfe3[_0x3342('0x37')],qs['fields'](_0x10c110[_0x3342('0x3b')]['fields']));_0x88ddfb['attributes']=_0x88ddfb['attributes'][_0x3342('0x3c')]?_0x88ddfb[_0x3342('0x3d')]:_0xf3bfe3['model'];if(!_0x10c110[_0x3342('0x3b')][_0x3342('0x3e')]('nolimit')){_0x88ddfb[_0x3342('0x28')]=qs[_0x3342('0x28')](_0x10c110[_0x3342('0x3b')]['limit']);_0x88ddfb[_0x3342('0x26')]=qs[_0x3342('0x26')](_0x10c110[_0x3342('0x3b')]['offset']);}_0x88ddfb[_0x3342('0x3f')]=qs[_0x3342('0x40')](_0x10c110[_0x3342('0x3b')][_0x3342('0x40')]);_0x88ddfb[_0x3342('0x41')]=qs[_0x3342('0x39')](_[_0x3342('0x42')](_0x10c110[_0x3342('0x3b')],_0xf3bfe3[_0x3342('0x39')]),_0xeb3301);if(_0x10c110[_0x3342('0x3b')][_0x3342('0x43')]){_0x88ddfb[_0x3342('0x41')]=_[_0x3342('0x44')](_0x88ddfb[_0x3342('0x41')],{'$or':_['map'](_0xeb3301,function(_0x5d6481){if(_0x5d6481['type']!==_0x3342('0x45')){var _0x5b9fe6={};_0x5b9fe6[_0x5d6481['name']]={'$like':'%'+_0x10c110[_0x3342('0x3b')][_0x3342('0x43')]+'%'};return _0x5b9fe6;}})});}_0x88ddfb=_[_0x3342('0x44')]({},_0x88ddfb,_0x10c110[_0x3342('0x46')]);var _0x561a7a={'where':_0x88ddfb[_0x3342('0x41')]};return db['Network']['count'](_0x561a7a)[_0x3342('0x19')](function(_0x3eb366){_0x1a78be[_0x3342('0x29')]=_0x3eb366;if(_0x10c110[_0x3342('0x3b')][_0x3342('0x47')]){_0x88ddfb[_0x3342('0x48')]=[{'all':!![]}];}return db[_0x3342('0x49')][_0x3342('0x4a')](_0x88ddfb);})[_0x3342('0x19')](function(_0x3dc54a){_0x1a78be[_0x3342('0x4b')]=_0x3dc54a;return _0x1a78be;})[_0x3342('0x19')](respondWithFilteredResult(_0x45078a,_0x88ddfb))[_0x3342('0x4c')](handleError(_0x45078a,null));};exports[_0x3342('0x4d')]=function(_0x198a9f,_0x3988f5){var _0x525d95={'raw':!![],'where':{'id':_0x198a9f[_0x3342('0x4e')]['id']}},_0x5cb788={};_0x5cb788[_0x3342('0x37')]=_['keys'](db[_0x3342('0x49')][_0x3342('0x33')]);_0x5cb788[_0x3342('0x3b')]=_['keys'](_0x198a9f[_0x3342('0x3b')]);_0x5cb788[_0x3342('0x39')]=_[_0x3342('0x3a')](_0x5cb788[_0x3342('0x37')],_0x5cb788[_0x3342('0x3b')]);_0x525d95[_0x3342('0x3d')]=_[_0x3342('0x3a')](_0x5cb788[_0x3342('0x37')],qs[_0x3342('0x4f')](_0x198a9f[_0x3342('0x3b')][_0x3342('0x4f')]));_0x525d95[_0x3342('0x3d')]=_0x525d95[_0x3342('0x3d')]['length']?_0x525d95[_0x3342('0x3d')]:_0x5cb788[_0x3342('0x37')];if(_0x198a9f['query'][_0x3342('0x47')]){_0x525d95[_0x3342('0x48')]=[{'all':!![]}];}_0x525d95=_[_0x3342('0x44')]({},_0x525d95,_0x198a9f[_0x3342('0x46')]);return db[_0x3342('0x49')][_0x3342('0x50')](_0x525d95)['then'](handleEntityNotFound(_0x3988f5,null))[_0x3342('0x19')](respondWithResult(_0x3988f5,null))[_0x3342('0x4c')](handleError(_0x3988f5,null));};exports[_0x3342('0x51')]=function(_0x3ff121,_0x3a53fc,_0x2e1c59){var _0x78f81;return db[_0x3342('0x52')][_0x3342('0x53')](function(_0x2ac0ae){return db[_0x3342('0x49')][_0x3342('0x51')](_0x3ff121[_0x3342('0x54')],{'raw':!![]})['then'](function(_0x204f09){_0x78f81=_0x204f09;return db['Network'][_0x3342('0x4a')]({'where':{'type':_0x3ff121[_0x3342('0x54')]['type']},'raw':!![]});})[_0x3342('0x19')](function(_0x27ccb6){if(_0x78f81['type'][_0x3342('0x55')]()==_0x3342('0x56')){var _0x304522=fs[_0x3342('0x57')](path['join'](config[_0x3342('0x58')],_0x3342('0x59')),_0x3342('0x5a'));var _0xc2d6c1=ejs[_0x3342('0x5b')](_0x304522,{'networks':_0x27ccb6||[]});fs[_0x3342('0x5c')](_0x3342('0x5d'),_0xc2d6c1);return respondWithRpcPromise(_0x3342('0x5e'),_0x3342('0x51'),{'module':'res_stun_monitor.so'});}else if(_0x78f81[_0x3342('0x35')]['toUpperCase']()==_0x3342('0x5f')){var _0x255f5f=fs[_0x3342('0x57')](path[_0x3342('0x60')](config[_0x3342('0x58')],'server/files/templates/turn_multiple.ejs'),_0x3342('0x5a'));var _0x2fedf5=ejs['render'](_0x255f5f,{'networks':_0x27ccb6||[]});fs[_0x3342('0x5c')](_0x3342('0x61'),_0x2fedf5);return respondWithRpcPromise('Reload',_0x3342('0x51'),{'module':_0x3342('0x62')});}else{var _0x2fe714=fs[_0x3342('0x57')](path[_0x3342('0x60')](config['root'],'server/files/templates/network.ejs'),_0x3342('0x5a'));var _0x311052=ejs['render'](_0x2fe714,{'networks':_0x27ccb6||[]});fs['writeFileSync'](util[_0x3342('0x63')](_0x3342('0x64'),_0x3ff121[_0x3342('0x54')][_0x3342('0x35')][_0x3342('0x65')]()),_0x311052);return respondWithRpcPromise(_0x3342('0x5e'),'create',{'module':_0x3342('0x66')});}return null;})[_0x3342('0x19')](function(){return _0x78f81;});})[_0x3342('0x19')](respondWithResult(_0x3a53fc,0xc9))[_0x3342('0x4c')](handleError(_0x3a53fc,null));};exports['update']=function(_0x268fe6,_0x4e1fa2,_0x109005){var _0x2496b2;return db[_0x3342('0x52')][_0x3342('0x53')](function(_0x300d5e){return db['Network'][_0x3342('0x50')]({'where':{'id':_0x268fe6[_0x3342('0x4e')]['id']}})[_0x3342('0x19')](handleEntityNotFound(_0x4e1fa2,null))[_0x3342('0x19')](saveUpdates(_0x268fe6[_0x3342('0x54')],null))[_0x3342('0x19')](function(_0x3cdd3a){if(_0x3cdd3a){_0x2496b2=_0x3cdd3a;return db['Network'][_0x3342('0x4a')]({'where':{'type':_0x2496b2[_0x3342('0x35')]},'raw':!![]});}return null;})[_0x3342('0x19')](function(_0x273683){if(_0x2496b2[_0x3342('0x35')][_0x3342('0x55')]()=='STUN'){var _0x3e6d34=fs[_0x3342('0x57')](path[_0x3342('0x60')](config['root'],'server/files/templates/stun_multiple.ejs'),'utf8');var _0x5a0e78=ejs[_0x3342('0x5b')](_0x3e6d34,{'networks':_0x273683||[]});fs[_0x3342('0x5c')](_0x3342('0x5d'),_0x5a0e78);return respondWithRpcPromise(_0x3342('0x5e'),_0x3342('0x67'),{'module':_0x3342('0x62')});}else if(_0x2496b2[_0x3342('0x35')]['toUpperCase']()==_0x3342('0x5f')){var _0x1f36ae=fs[_0x3342('0x57')](path[_0x3342('0x60')](config[_0x3342('0x58')],_0x3342('0x68')),_0x3342('0x5a'));var _0x28daa0=ejs[_0x3342('0x5b')](_0x1f36ae,{'networks':_0x273683||[]});fs[_0x3342('0x5c')](_0x3342('0x61'),_0x28daa0);return respondWithRpcPromise(_0x3342('0x5e'),_0x3342('0x67'),{'module':_0x3342('0x62')});}else{var _0x2a1af7=fs[_0x3342('0x57')](path['join'](config['root'],_0x3342('0x69')),_0x3342('0x5a'));var _0x544ee6=ejs[_0x3342('0x5b')](_0x2a1af7,{'networks':_0x273683||[]});fs[_0x3342('0x5c')](util[_0x3342('0x63')](_0x3342('0x64'),_0x268fe6[_0x3342('0x54')][_0x3342('0x35')]['toLowerCase']()),_0x544ee6);return respondWithRpcPromise('Reload','update',{'module':_0x3342('0x66')});}return null;})['then'](function(_0x3e6b7c){if(_0x3e6b7c){return _0x2496b2;}return null;});})[_0x3342('0x19')](respondWithResult(_0x4e1fa2,null))[_0x3342('0x4c')](handleError(_0x4e1fa2,null));};exports['destroy']=function(_0x1b385f,_0x3aae5f,_0x4453c7){var _0x2531c4;return db['Network'][_0x3342('0x50')]({'where':{'id':_0x1b385f[_0x3342('0x4e')]['id']}})[_0x3342('0x19')](function(_0x5375ca){_0x2531c4=_0x5375ca;return _0x5375ca;})[_0x3342('0x19')](handleEntityNotFound(_0x3aae5f,null))[_0x3342('0x19')](removeEntity(_0x3aae5f,null))[_0x3342('0x19')](function(){if(_0x2531c4){return db['Network'][_0x3342('0x4a')]({'where':{'type':_0x2531c4['type']},'raw':!![]});}})['then'](function(_0x48ea35){if(_0x2531c4[_0x3342('0x35')][_0x3342('0x55')]()==_0x3342('0x56')){var _0x195cf8=fs[_0x3342('0x57')](path[_0x3342('0x60')](config[_0x3342('0x58')],'server/files/templates/stun_multiple.ejs'),_0x3342('0x5a'));var _0x51c014=ejs['render'](_0x195cf8,{'networks':_0x48ea35||[]});fs[_0x3342('0x5c')](_0x3342('0x5d'),_0x51c014);return respondWithRpcPromise(_0x3342('0x5e'),_0x3342('0x2e'),{'module':'res_stun_monitor.so'});}else if(_0x2531c4['type'][_0x3342('0x55')]()==_0x3342('0x5f')){var _0x4ed6ab=fs['readFileSync'](path[_0x3342('0x60')](config[_0x3342('0x58')],_0x3342('0x68')),_0x3342('0x5a'));var _0x3a0dca=ejs[_0x3342('0x5b')](_0x4ed6ab,{'networks':_0x48ea35||[]});fs[_0x3342('0x5c')]('/etc/asterisk/turn_xcally.conf',_0x3a0dca);return respondWithRpcPromise(_0x3342('0x5e'),_0x3342('0x2e'),{'module':_0x3342('0x62')});}else{var _0x411ac2=fs[_0x3342('0x57')](path['join'](config[_0x3342('0x58')],'server/files/templates/network.ejs'),_0x3342('0x5a'));var _0x216b55=ejs['render'](_0x411ac2,{'networks':_0x48ea35||[]});fs[_0x3342('0x5c')](util[_0x3342('0x63')](_0x3342('0x64'),_0x1b385f[_0x3342('0x54')][_0x3342('0x35')][_0x3342('0x65')]()),_0x216b55);return respondWithRpcPromise(_0x3342('0x5e'),_0x3342('0x2e'),{'module':_0x3342('0x66')});}return null;})[_0x3342('0x4c')](handleError(_0x3aae5f,null));}; \ No newline at end of file +var _0x6836=['render','/etc/asterisk/turn_xcally.conf','server/files/templates/network.ejs','format','body','chan_sip.so','params','server/files/templates/turn_multiple.ejs','/etc/asterisk/sip_xcally_%s.conf','toLowerCase','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','lodash','squel','crypto','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','../../config/license/util','client','http','info','request\x20sent','Network,\x20%s,\x20%s,\x20%s','stringify','error','code','Network,\x20%s,\x20%s','message','result','sendStatus','status','end','offset','undefined','limit','count','json','apply','reject','update','then','destroy','stack','name','index','map','Network','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','catch','keys','find','sequelize','transaction','STUN','readFileSync','join','root','server/files/templates/stun_multiple.ejs','writeFileSync','/etc/asterisk/stun_xcally.conf','Reload','create','res_stun_monitor.so','toUpperCase','TURN','utf8'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x6836,0x133));var _0x6683=function(_0x5f0089,_0x227e2c){_0x5f0089=_0x5f0089-0x0;var _0x193892=_0x6836[_0x5f0089];return _0x193892;};'use strict';var emlformat=require(_0x6683('0x0'));var rimraf=require(_0x6683('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6683('0x2'));var rp=require(_0x6683('0x3'));var moment=require(_0x6683('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x6683('0x5'));var util=require(_0x6683('0x6'));var path=require(_0x6683('0x7'));var sox=require(_0x6683('0x8'));var csv=require(_0x6683('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6683('0xa'));var squel=require(_0x6683('0xb'));var crypto=require(_0x6683('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x6683('0x9'));var querystring=require(_0x6683('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x6683('0xe'));var as=require(_0x6683('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x6683('0x10'));var config=require(_0x6683('0x11'));var licenseUtil=require(_0x6683('0x12'));var db=require('../../mysqldb')['db'];var jayson=require('jayson/promise');var client=jayson[_0x6683('0x13')][_0x6683('0x14')]({'port':0x232a});function respondWithRpcPromise(_0x5028f2,_0x359c6b,_0xc60309,_0x1922df){return new BPromise(function(_0x4a9deb,_0x4598ca){var _0x3838df=_0x1922df||client;return _0x3838df['request'](_0x5028f2,_0xc60309)['then'](function(_0x10dbed){logger[_0x6683('0x15')]('Network,\x20%s,\x20%s',_0x359c6b,_0x6683('0x16'));logger['debug'](_0x6683('0x17'),_0x359c6b,_0x6683('0x16'),JSON[_0x6683('0x18')](_0x10dbed));if(_0x10dbed[_0x6683('0x19')]){if(_0x10dbed[_0x6683('0x19')][_0x6683('0x1a')]===0x1f4){logger[_0x6683('0x19')](_0x6683('0x1b'),_0x359c6b,_0x10dbed[_0x6683('0x19')][_0x6683('0x1c')]);return _0x4598ca(_0x10dbed['error']['message']);}logger[_0x6683('0x19')](_0x6683('0x1b'),_0x359c6b,_0x10dbed[_0x6683('0x19')]['message']);return _0x4a9deb(_0x10dbed[_0x6683('0x19')]['message']);}else{logger[_0x6683('0x15')](_0x6683('0x1b'),_0x359c6b,'request\x20sent');_0x4a9deb(_0x10dbed[_0x6683('0x1d')][_0x6683('0x1c')]);}})['catch'](function(_0x5a1fb1){logger[_0x6683('0x19')]('Network,\x20%s,\x20%s',_0x359c6b,_0x5a1fb1);_0x4598ca(_0x5a1fb1);});});}function respondWithStatusCode(_0x31f784,_0xb5ef9b){_0xb5ef9b=_0xb5ef9b||0xcc;return function(_0x4b9f67){if(_0x4b9f67){return _0x31f784[_0x6683('0x1e')](_0xb5ef9b);}return _0x31f784[_0x6683('0x1f')](_0xb5ef9b)[_0x6683('0x20')]();};}function respondWithResult(_0x45f1c2,_0xc0b630){_0xc0b630=_0xc0b630||0xc8;return function(_0x5bd988){if(_0x5bd988){return _0x45f1c2['status'](_0xc0b630)['json'](_0x5bd988);}};}function respondWithFilteredResult(_0x404e18,_0x24df8f){return function(_0x33dfc4){if(_0x33dfc4){var _0x532207=typeof _0x24df8f[_0x6683('0x21')]===_0x6683('0x22')&&typeof _0x24df8f[_0x6683('0x23')]===_0x6683('0x22');var _0x2ace57=_0x33dfc4[_0x6683('0x24')];var _0x173d13=_0x532207?0x0:_0x24df8f[_0x6683('0x21')];var _0x1d4f59=_0x532207?_0x33dfc4[_0x6683('0x24')]:_0x24df8f[_0x6683('0x21')]+_0x24df8f[_0x6683('0x23')];var _0x18e58d;if(_0x1d4f59>=_0x2ace57){_0x1d4f59=_0x2ace57;_0x18e58d=0xc8;}else{_0x18e58d=0xce;}_0x404e18['status'](_0x18e58d);return _0x404e18['set']('Content-Range',_0x173d13+'-'+_0x1d4f59+'/'+_0x2ace57)[_0x6683('0x25')](_0x33dfc4);}return null;};}function patchUpdates(_0x467dc6){return function(_0x5a32da){try{jsonpatch[_0x6683('0x26')](_0x5a32da,_0x467dc6,!![]);}catch(_0x31f1dd){return BPromise[_0x6683('0x27')](_0x31f1dd);}return _0x5a32da['save']();};}function saveUpdates(_0x55ce3d,_0x5c85de){return function(_0x42e51f){if(_0x42e51f){return _0x42e51f[_0x6683('0x28')](_0x55ce3d)[_0x6683('0x29')](function(_0x128930){return _0x128930;});}return null;};}function removeEntity(_0x3cf7f8,_0x4c1e99){return function(_0x2f12ab){if(_0x2f12ab){return _0x2f12ab[_0x6683('0x2a')]()[_0x6683('0x29')](function(){_0x3cf7f8[_0x6683('0x1f')](0xcc)[_0x6683('0x20')]();});}};}function handleEntityNotFound(_0x47bf4b,_0x5f0811){return function(_0x29aa1c){if(!_0x29aa1c){_0x47bf4b[_0x6683('0x1e')](0x194);}return _0x29aa1c;};}function handleError(_0x19606c,_0x27cfd7){_0x27cfd7=_0x27cfd7||0x1f4;return function(_0x5dd85d){logger[_0x6683('0x19')](_0x5dd85d[_0x6683('0x2b')]);if(_0x5dd85d['name']){delete _0x5dd85d[_0x6683('0x2c')];}_0x19606c[_0x6683('0x1f')](_0x27cfd7)['send'](_0x5dd85d);};}exports[_0x6683('0x2d')]=function(_0x2e18b3,_0x5aee5b){var _0x301735={},_0x2d4328={},_0xda6885={'count':0x0,'rows':[]};var _0x95ade3=_[_0x6683('0x2e')](db[_0x6683('0x2f')][_0x6683('0x30')],function(_0x4e5133){return{'name':_0x4e5133[_0x6683('0x31')],'type':_0x4e5133[_0x6683('0x32')][_0x6683('0x33')]};});_0x2d4328[_0x6683('0x34')]=_[_0x6683('0x2e')](_0x95ade3,_0x6683('0x2c'));_0x2d4328[_0x6683('0x35')]=_['keys'](_0x2e18b3[_0x6683('0x35')]);_0x2d4328[_0x6683('0x36')]=_[_0x6683('0x37')](_0x2d4328['model'],_0x2d4328[_0x6683('0x35')]);_0x301735[_0x6683('0x38')]=_['intersection'](_0x2d4328[_0x6683('0x34')],qs[_0x6683('0x39')](_0x2e18b3['query']['fields']));_0x301735[_0x6683('0x38')]=_0x301735['attributes']['length']?_0x301735['attributes']:_0x2d4328['model'];if(!_0x2e18b3[_0x6683('0x35')][_0x6683('0x3a')](_0x6683('0x3b'))){_0x301735['limit']=qs[_0x6683('0x23')](_0x2e18b3['query'][_0x6683('0x23')]);_0x301735[_0x6683('0x21')]=qs[_0x6683('0x21')](_0x2e18b3['query'][_0x6683('0x21')]);}_0x301735[_0x6683('0x3c')]=qs[_0x6683('0x3d')](_0x2e18b3[_0x6683('0x35')][_0x6683('0x3d')]);_0x301735[_0x6683('0x3e')]=qs['filters'](_[_0x6683('0x3f')](_0x2e18b3[_0x6683('0x35')],_0x2d4328[_0x6683('0x36')]),_0x95ade3);if(_0x2e18b3['query']['filter']){_0x301735[_0x6683('0x3e')]=_[_0x6683('0x40')](_0x301735[_0x6683('0x3e')],{'$or':_[_0x6683('0x2e')](_0x95ade3,function(_0x181d7e){if(_0x181d7e[_0x6683('0x32')]!==_0x6683('0x41')){var _0x381066={};_0x381066[_0x181d7e[_0x6683('0x2c')]]={'$like':'%'+_0x2e18b3['query'][_0x6683('0x42')]+'%'};return _0x381066;}})});}_0x301735=_[_0x6683('0x40')]({},_0x301735,_0x2e18b3[_0x6683('0x43')]);var _0x1a2b1f={'where':_0x301735[_0x6683('0x3e')]};return db[_0x6683('0x2f')][_0x6683('0x24')](_0x1a2b1f)['then'](function(_0x33f3dd){_0xda6885[_0x6683('0x24')]=_0x33f3dd;if(_0x2e18b3[_0x6683('0x35')][_0x6683('0x44')]){_0x301735[_0x6683('0x45')]=[{'all':!![]}];}return db[_0x6683('0x2f')][_0x6683('0x46')](_0x301735);})[_0x6683('0x29')](function(_0x27d582){_0xda6885['rows']=_0x27d582;return _0xda6885;})[_0x6683('0x29')](respondWithFilteredResult(_0x5aee5b,_0x301735))[_0x6683('0x47')](handleError(_0x5aee5b,null));};exports['show']=function(_0x4002d6,_0x13096a){var _0x52c4ea={'raw':!![],'where':{'id':_0x4002d6['params']['id']}},_0x5b7932={};_0x5b7932['model']=_['keys'](db[_0x6683('0x2f')][_0x6683('0x30')]);_0x5b7932[_0x6683('0x35')]=_[_0x6683('0x48')](_0x4002d6['query']);_0x5b7932[_0x6683('0x36')]=_[_0x6683('0x37')](_0x5b7932[_0x6683('0x34')],_0x5b7932[_0x6683('0x35')]);_0x52c4ea[_0x6683('0x38')]=_[_0x6683('0x37')](_0x5b7932[_0x6683('0x34')],qs[_0x6683('0x39')](_0x4002d6[_0x6683('0x35')][_0x6683('0x39')]));_0x52c4ea[_0x6683('0x38')]=_0x52c4ea['attributes']['length']?_0x52c4ea[_0x6683('0x38')]:_0x5b7932[_0x6683('0x34')];if(_0x4002d6['query']['includeAll']){_0x52c4ea[_0x6683('0x45')]=[{'all':!![]}];}_0x52c4ea=_['merge']({},_0x52c4ea,_0x4002d6[_0x6683('0x43')]);return db['Network'][_0x6683('0x49')](_0x52c4ea)[_0x6683('0x29')](handleEntityNotFound(_0x13096a,null))[_0x6683('0x29')](respondWithResult(_0x13096a,null))[_0x6683('0x47')](handleError(_0x13096a,null));};exports['create']=function(_0x1d5d04,_0x5e6aab,_0x23490f){var _0x358436;return db[_0x6683('0x4a')][_0x6683('0x4b')](function(_0x28faef){return db[_0x6683('0x2f')]['create'](_0x1d5d04['body'],{'raw':!![]})[_0x6683('0x29')](function(_0x3963a8){_0x358436=_0x3963a8;return db[_0x6683('0x2f')][_0x6683('0x46')]({'where':{'type':_0x1d5d04['body'][_0x6683('0x32')]},'raw':!![]});})[_0x6683('0x29')](function(_0x3a6118){if(_0x358436[_0x6683('0x32')]['toUpperCase']()==_0x6683('0x4c')){var _0x64d074=fs[_0x6683('0x4d')](path[_0x6683('0x4e')](config[_0x6683('0x4f')],_0x6683('0x50')),'utf8');var _0x2bc741=ejs['render'](_0x64d074,{'networks':_0x3a6118||[]});fs[_0x6683('0x51')](_0x6683('0x52'),_0x2bc741);return respondWithRpcPromise(_0x6683('0x53'),_0x6683('0x54'),{'module':_0x6683('0x55')});}else if(_0x358436['type'][_0x6683('0x56')]()==_0x6683('0x57')){var _0x3fccaa=fs[_0x6683('0x4d')](path[_0x6683('0x4e')](config['root'],'server/files/templates/turn_multiple.ejs'),_0x6683('0x58'));var _0x5eccb2=ejs[_0x6683('0x59')](_0x3fccaa,{'networks':_0x3a6118||[]});fs[_0x6683('0x51')](_0x6683('0x5a'),_0x5eccb2);return respondWithRpcPromise(_0x6683('0x53'),_0x6683('0x54'),{'module':_0x6683('0x55')});}else{var _0x2ce3b9=fs[_0x6683('0x4d')](path['join'](config[_0x6683('0x4f')],_0x6683('0x5b')),_0x6683('0x58'));var _0x1102db=ejs[_0x6683('0x59')](_0x2ce3b9,{'networks':_0x3a6118||[]});fs[_0x6683('0x51')](util[_0x6683('0x5c')]('/etc/asterisk/sip_xcally_%s.conf',_0x1d5d04[_0x6683('0x5d')][_0x6683('0x32')]['toLowerCase']()),_0x1102db);return respondWithRpcPromise(_0x6683('0x53'),'create',{'module':_0x6683('0x5e')});}return null;})['then'](function(){return _0x358436;});})[_0x6683('0x29')](respondWithResult(_0x5e6aab,0xc9))[_0x6683('0x47')](handleError(_0x5e6aab,null));};exports[_0x6683('0x28')]=function(_0x2cad55,_0x41e458,_0x2f1cd8){var _0x2b7bc4;return db['sequelize'][_0x6683('0x4b')](function(_0x3b3874){return db[_0x6683('0x2f')][_0x6683('0x49')]({'where':{'id':_0x2cad55[_0x6683('0x5f')]['id']}})[_0x6683('0x29')](handleEntityNotFound(_0x41e458,null))[_0x6683('0x29')](saveUpdates(_0x2cad55['body'],null))[_0x6683('0x29')](function(_0x315faa){if(_0x315faa){_0x2b7bc4=_0x315faa;return db[_0x6683('0x2f')][_0x6683('0x46')]({'where':{'type':_0x2b7bc4['type']},'raw':!![]});}return null;})[_0x6683('0x29')](function(_0x33a7d4){if(_0x2b7bc4['type']['toUpperCase']()==_0x6683('0x4c')){var _0x4b8fc1=fs[_0x6683('0x4d')](path[_0x6683('0x4e')](config[_0x6683('0x4f')],_0x6683('0x50')),_0x6683('0x58'));var _0x19dac3=ejs[_0x6683('0x59')](_0x4b8fc1,{'networks':_0x33a7d4||[]});fs['writeFileSync'](_0x6683('0x52'),_0x19dac3);return respondWithRpcPromise(_0x6683('0x53'),'update',{'module':_0x6683('0x55')});}else if(_0x2b7bc4[_0x6683('0x32')][_0x6683('0x56')]()==_0x6683('0x57')){var _0x44da2c=fs[_0x6683('0x4d')](path['join'](config[_0x6683('0x4f')],_0x6683('0x60')),_0x6683('0x58'));var _0x3a238d=ejs[_0x6683('0x59')](_0x44da2c,{'networks':_0x33a7d4||[]});fs[_0x6683('0x51')](_0x6683('0x5a'),_0x3a238d);return respondWithRpcPromise(_0x6683('0x53'),'update',{'module':_0x6683('0x55')});}else{var _0x2449d7=fs['readFileSync'](path['join'](config[_0x6683('0x4f')],_0x6683('0x5b')),_0x6683('0x58'));var _0x4d28aa=ejs[_0x6683('0x59')](_0x2449d7,{'networks':_0x33a7d4||[]});fs['writeFileSync'](util[_0x6683('0x5c')](_0x6683('0x61'),_0x2cad55['body'][_0x6683('0x32')][_0x6683('0x62')]()),_0x4d28aa);return respondWithRpcPromise('Reload',_0x6683('0x28'),{'module':_0x6683('0x5e')});}return null;})[_0x6683('0x29')](function(_0x484f64){if(_0x484f64){return _0x2b7bc4;}return null;});})[_0x6683('0x29')](respondWithResult(_0x41e458,null))[_0x6683('0x47')](handleError(_0x41e458,null));};exports['destroy']=function(_0x399b00,_0x51b8dc,_0x4d1c1f){var _0xe048bb;return db[_0x6683('0x2f')][_0x6683('0x49')]({'where':{'id':_0x399b00['params']['id']}})[_0x6683('0x29')](function(_0x53ab71){_0xe048bb=_0x53ab71;return _0x53ab71;})[_0x6683('0x29')](handleEntityNotFound(_0x51b8dc,null))['then'](removeEntity(_0x51b8dc,null))['then'](function(){if(_0xe048bb){return db[_0x6683('0x2f')][_0x6683('0x46')]({'where':{'type':_0xe048bb['type']},'raw':!![]});}})['then'](function(_0x350b27){if(_0xe048bb[_0x6683('0x32')][_0x6683('0x56')]()=='STUN'){var _0x37907b=fs[_0x6683('0x4d')](path[_0x6683('0x4e')](config['root'],_0x6683('0x50')),_0x6683('0x58'));var _0x4ddecf=ejs['render'](_0x37907b,{'networks':_0x350b27||[]});fs[_0x6683('0x51')](_0x6683('0x52'),_0x4ddecf);return respondWithRpcPromise(_0x6683('0x53'),_0x6683('0x2a'),{'module':_0x6683('0x55')});}else if(_0xe048bb['type'][_0x6683('0x56')]()==_0x6683('0x57')){var _0x289ee9=fs[_0x6683('0x4d')](path[_0x6683('0x4e')](config[_0x6683('0x4f')],_0x6683('0x60')),_0x6683('0x58'));var _0x380cf1=ejs[_0x6683('0x59')](_0x289ee9,{'networks':_0x350b27||[]});fs[_0x6683('0x51')]('/etc/asterisk/turn_xcally.conf',_0x380cf1);return respondWithRpcPromise(_0x6683('0x53'),_0x6683('0x2a'),{'module':'res_stun_monitor.so'});}else{var _0x152e62=fs[_0x6683('0x4d')](path['join'](config['root'],_0x6683('0x5b')),_0x6683('0x58'));var _0x1cd33c=ejs[_0x6683('0x59')](_0x152e62,{'networks':_0x350b27||[]});fs[_0x6683('0x51')](util[_0x6683('0x5c')]('/etc/asterisk/sip_xcally_%s.conf',_0x399b00[_0x6683('0x5d')][_0x6683('0x32')]['toLowerCase']()),_0x1cd33c);return respondWithRpcPromise(_0x6683('0x53'),'destroy',{'module':_0x6683('0x5e')});}return null;})[_0x6683('0x47')](handleError(_0x51b8dc,null));}; \ No newline at end of file diff --git a/server/api/network/network.model.js b/server/api/network/network.model.js index edb8573..f99f1e0 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 _0xb821=['rimraf','../../config/environment','./network.attributes','exports','define','Network','network','util','../../config/logger','bluebird'];(function(_0x1a784d,_0x5ca446){var _0x570853=function(_0xedd1b6){while(--_0xedd1b6){_0x1a784d['push'](_0x1a784d['shift']());}};_0x570853(++_0x5ca446);}(_0xb821,0xa7));var _0x1b82=function(_0x1c1332,_0x55cae0){_0x1c1332=_0x1c1332-0x0;var _0xbb88c2=_0xb821[_0x1c1332];return _0xbb88c2;};'use strict';var _=require('lodash');var util=require(_0x1b82('0x0'));var logger=require(_0x1b82('0x1'))('api');var moment=require('moment');var BPromise=require(_0x1b82('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x1b82('0x3'));var config=require(_0x1b82('0x4'));var attributes=require(_0x1b82('0x5'));module[_0x1b82('0x6')]=function(_0x597ca7,_0x3e27c4){return _0x597ca7[_0x1b82('0x7')](_0x1b82('0x8'),attributes,{'tableName':_0x1b82('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x55ea=['./network.attributes','Network','network','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf'];(function(_0x204281,_0x30621c){var _0x225e67=function(_0xe7c4fc){while(--_0xe7c4fc){_0x204281['push'](_0x204281['shift']());}};_0x225e67(++_0x30621c);}(_0x55ea,0xc9));var _0xa55e=function(_0xd82894,_0x1b5fea){_0xd82894=_0xd82894-0x0;var _0x5079ba=_0x55ea[_0xd82894];return _0x5079ba;};'use strict';var _=require(_0xa55e('0x0'));var util=require(_0xa55e('0x1'));var logger=require(_0xa55e('0x2'))('api');var moment=require(_0xa55e('0x3'));var BPromise=require(_0xa55e('0x4'));var rp=require(_0xa55e('0x5'));var fs=require('fs');var path=require(_0xa55e('0x6'));var rimraf=require(_0xa55e('0x7'));var config=require('../../config/environment');var attributes=require(_0xa55e('0x8'));module['exports']=function(_0x515646,_0x588751){return _0x515646['define'](_0xa55e('0x9'),attributes,{'tableName':_0xa55e('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/network/network.rpc.js b/server/api/network/network.rpc.js index ddf536d..ec83ca2 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(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7a54,0x106));var _0x47a5=function(_0x1a4126,_0x2cccab){_0x1a4126=_0x1a4126-0x0;var _0xc0f25f=_0x7a54[_0x1a4126];return _0xc0f25f;};'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(_0x4ebc20,_0x4c087b){var _0x26fce3=function(_0x59253f){while(--_0x59253f){_0x4ebc20['push'](_0x4ebc20['shift']());}};_0x26fce3(++_0x4c087b);}(_0x9957,0x93));var _0x7995=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x9957[_0x6131cd];return _0x47e916;};'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 cdd752b..84ebe7f 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 _0xabb4=['getDispositions','/:id/canned_answers','getAnswers','getApplications','/:id/interactions','getInteractions','getAgents','post','addDisposition','notify','/:id/applications','addApplications','addAgents','/:id/send','send','update','delete','/:id','removeDispositions','/:id/users','removeAgents','exports','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','./openchannelAccount.controller','get','index','/describe','describe','isAuthenticated','show','/:id/dispositions'];(function(_0x39ae3c,_0x143fea){var _0x5e1692=function(_0x1bddb3){while(--_0x1bddb3){_0x39ae3c['push'](_0x39ae3c['shift']());}};_0x5e1692(++_0x143fea);}(_0xabb4,0x1a2));var _0x4abb=function(_0x4a26e0,_0xfaa36b){_0x4a26e0=_0x4a26e0-0x0;var _0x5b30ed=_0xabb4[_0x4a26e0];return _0x5b30ed;};'use strict';var multer=require('multer');var util=require(_0x4abb('0x0'));var path=require(_0x4abb('0x1'));var timeout=require(_0x4abb('0x2'));var express=require(_0x4abb('0x3'));var router=express['Router']();var fs_extra=require(_0x4abb('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x4abb('0x5'));var config=require('../../config/environment');var controller=require(_0x4abb('0x6'));router[_0x4abb('0x7')]('/',auth['isAuthenticated'](),controller[_0x4abb('0x8')]);router['get'](_0x4abb('0x9'),auth['isAuthenticated'](),controller[_0x4abb('0xa')]);router[_0x4abb('0x7')]('/:id',auth[_0x4abb('0xb')](),controller[_0x4abb('0xc')]);router[_0x4abb('0x7')](_0x4abb('0xd'),auth['isAuthenticated'](),controller[_0x4abb('0xe')]);router['get'](_0x4abb('0xf'),auth[_0x4abb('0xb')](),controller[_0x4abb('0x10')]);router[_0x4abb('0x7')]('/:id/applications',auth[_0x4abb('0xb')](),controller[_0x4abb('0x11')]);router[_0x4abb('0x7')](_0x4abb('0x12'),auth[_0x4abb('0xb')](),controller[_0x4abb('0x13')]);router[_0x4abb('0x7')]('/:id/users',auth[_0x4abb('0xb')](),controller[_0x4abb('0x14')]);router['post']('/',auth[_0x4abb('0xb')](),controller['create']);router[_0x4abb('0x15')]('/:id/dispositions',auth[_0x4abb('0xb')](),controller[_0x4abb('0x16')]);router[_0x4abb('0x15')](_0x4abb('0xf'),auth[_0x4abb('0xb')](),controller['addAnswer']);router[_0x4abb('0x15')]('/:id/notify',controller[_0x4abb('0x17')]);router[_0x4abb('0x15')](_0x4abb('0x18'),auth[_0x4abb('0xb')](),controller[_0x4abb('0x19')]);router['post']('/:id/users',auth[_0x4abb('0xb')](),controller[_0x4abb('0x1a')]);router[_0x4abb('0x15')](_0x4abb('0x1b'),auth[_0x4abb('0xb')](),controller[_0x4abb('0x1c')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x4abb('0x1d')]);router[_0x4abb('0x1e')](_0x4abb('0x1f'),auth[_0x4abb('0xb')](),controller['destroy']);router[_0x4abb('0x1e')](_0x4abb('0xd'),auth[_0x4abb('0xb')](),controller[_0x4abb('0x20')]);router['delete'](_0x4abb('0xf'),auth[_0x4abb('0xb')](),controller['removeAnswers']);router['delete'](_0x4abb('0x21'),auth[_0x4abb('0xb')](),controller[_0x4abb('0x22')]);module[_0x4abb('0x23')]=router; \ No newline at end of file +var _0xd59d=['removeAgents','multer','util','path','express','Router','fs-extra','../../components/auth/service','isAuthenticated','index','get','/describe','describe','/:id','show','/:id/canned_answers','/:id/applications','getApplications','/:id/interactions','getInteractions','/:id/users','getAgents','post','/:id/dispositions','addDisposition','/:id/notify','notify','addApplications','put','update','delete','destroy','removeDispositions','removeAnswers'];(function(_0x36e88b,_0x1aff1b){var _0x5df45c=function(_0x555b78){while(--_0x555b78){_0x36e88b['push'](_0x36e88b['shift']());}};_0x5df45c(++_0x1aff1b);}(_0xd59d,0x1dd));var _0xdd59=function(_0x295314,_0x17b250){_0x295314=_0x295314-0x0;var _0x584b0c=_0xd59d[_0x295314];return _0x584b0c;};'use strict';var multer=require(_0xdd59('0x0'));var util=require(_0xdd59('0x1'));var path=require(_0xdd59('0x2'));var timeout=require('connect-timeout');var express=require(_0xdd59('0x3'));var router=express[_0xdd59('0x4')]();var fs_extra=require(_0xdd59('0x5'));var auth=require(_0xdd59('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./openchannelAccount.controller');router['get']('/',auth[_0xdd59('0x7')](),controller[_0xdd59('0x8')]);router[_0xdd59('0x9')](_0xdd59('0xa'),auth[_0xdd59('0x7')](),controller[_0xdd59('0xb')]);router[_0xdd59('0x9')](_0xdd59('0xc'),auth['isAuthenticated'](),controller[_0xdd59('0xd')]);router[_0xdd59('0x9')]('/:id/dispositions',auth[_0xdd59('0x7')](),controller['getDispositions']);router[_0xdd59('0x9')](_0xdd59('0xe'),auth[_0xdd59('0x7')](),controller['getAnswers']);router[_0xdd59('0x9')](_0xdd59('0xf'),auth[_0xdd59('0x7')](),controller[_0xdd59('0x10')]);router['get'](_0xdd59('0x11'),auth['isAuthenticated'](),controller[_0xdd59('0x12')]);router['get'](_0xdd59('0x13'),auth[_0xdd59('0x7')](),controller[_0xdd59('0x14')]);router['post']('/',auth[_0xdd59('0x7')](),controller['create']);router[_0xdd59('0x15')](_0xdd59('0x16'),auth[_0xdd59('0x7')](),controller[_0xdd59('0x17')]);router[_0xdd59('0x15')](_0xdd59('0xe'),auth[_0xdd59('0x7')](),controller['addAnswer']);router[_0xdd59('0x15')](_0xdd59('0x18'),controller[_0xdd59('0x19')]);router[_0xdd59('0x15')](_0xdd59('0xf'),auth[_0xdd59('0x7')](),controller[_0xdd59('0x1a')]);router['post'](_0xdd59('0x13'),auth['isAuthenticated'](),controller['addAgents']);router[_0xdd59('0x15')]('/:id/send',auth[_0xdd59('0x7')](),controller['send']);router[_0xdd59('0x1b')](_0xdd59('0xc'),auth[_0xdd59('0x7')](),controller[_0xdd59('0x1c')]);router[_0xdd59('0x1d')]('/:id',auth['isAuthenticated'](),controller[_0xdd59('0x1e')]);router[_0xdd59('0x1d')]('/:id/dispositions',auth[_0xdd59('0x7')](),controller[_0xdd59('0x1f')]);router[_0xdd59('0x1d')](_0xdd59('0xe'),auth[_0xdd59('0x7')](),controller[_0xdd59('0x20')]);router[_0xdd59('0x1d')](_0xdd59('0x13'),auth[_0xdd59('0x7')](),controller[_0xdd59('0x21')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.attributes.js b/server/api/openchannelAccount/openchannelAccount.attributes.js index d4d6b14..4ba2fd5 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 _0xaf51=['Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','exports','STRING','name','generate','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'];(function(_0x8f8492,_0x479824){var _0x3d2852=function(_0x1d6a44){while(--_0x1d6a44){_0x8f8492['push'](_0x8f8492['shift']());}};_0x3d2852(++_0x479824);}(_0xaf51,0xb7));var _0x1af5=function(_0x14fcdf,_0x581032){_0x14fcdf=_0x14fcdf-0x0;var _0x85f8d4=_0xaf51[_0x14fcdf];return _0x85f8d4;};'use strict';var Sequelize=require(_0x1af5('0x0'));var rs=require('randomstring');module[_0x1af5('0x1')]={'name':{'type':Sequelize[_0x1af5('0x2')],'unique':_0x1af5('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0x1af5('0x2')]},'token':{'type':Sequelize[_0x1af5('0x2')],'defaultValue':function(){return rs[_0x1af5('0x4')]();}},'replyUri':{'type':Sequelize[_0x1af5('0x2')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0x1af5('0x2')],'allowNull':![]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0x1af5('0x5');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x1af5('0x6')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x1af5('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0x1af5('0x2')]},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x1af5('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x1af5('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':null,'comment':_0x1af5('0x8')},'mandatoryDisposition':{'type':Sequelize[_0x1af5('0x6')],'defaultValue':![],'comment':_0x1af5('0x9'),'set':function(_0x2a6535){if(!_0x2a6535)this['setDataValue'](_0x1af5('0xa'),null);this['setDataValue'](_0x1af5('0xb'),_0x2a6535);}}}; \ No newline at end of file +var _0x668d=['exports','STRING','name','TEXT','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','setDataValue','mandatoryDisposition','randomstring'];(function(_0x1d1779,_0x284147){var _0x2377e9=function(_0x299f6f){while(--_0x299f6f){_0x1d1779['push'](_0x1d1779['shift']());}};_0x2377e9(++_0x284147);}(_0x668d,0x6b));var _0xd668=function(_0x2b8bd5,_0x2c96af){_0x2b8bd5=_0x2b8bd5-0x0;var _0x103701=_0x668d[_0x2b8bd5];return _0x103701;};'use strict';var Sequelize=require('sequelize');var rs=require(_0xd668('0x0'));module[_0xd668('0x1')]={'name':{'type':Sequelize[_0xd668('0x2')],'unique':_0xd668('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0xd668('0x2')]},'token':{'type':Sequelize[_0xd668('0x2')],'defaultValue':function(){return rs['generate']();}},'replyUri':{'type':Sequelize[_0xd668('0x2')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0xd668('0x2')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0xd668('0x4')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0xd668('0x5')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xd668('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0xd668('0x2')]},'queueTransfer':{'type':Sequelize[_0xd668('0x5')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xd668('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xd668('0x6')],'allowNull':!![],'defaultValue':null,'comment':_0xd668('0x7')},'mandatoryDisposition':{'type':Sequelize[_0xd668('0x5')],'defaultValue':![],'comment':_0xd668('0x8'),'set':function(_0x3ba2d3){if(!_0x3ba2d3)this['setDataValue'](_0xd668('0x9'),null);this[_0xd668('0xa')](_0xd668('0xb'),_0x3ba2d3);}}}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.controller.js b/server/api/openchannelAccount/openchannelAccount.controller.js index 596fa99..879919e 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 _0xf840=['OpenchannelApplication','bulkCreate','findAndCountAll','getApplications','Contact','internal','Tag','Tags','color','tag','addAgents','spread','emit','userOpenchannelAccount:save','removeAgents','isArray','userOpenchannelAccount:remove','getAgents','out','Messages','dataValues','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/environment','../../config/license/util','../../mysqldb','localhost','socket.io-emitter','redis','./openchannelAccount.socket','register','http','request','then','info','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','OpenchannelAccount,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','json','offset','limit','undefined','count','Content-Range','reject','destroy','get','stack','name','send','index','Pause','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','includeAll','include','OpenchannelAccount','findAll','rows','show','params','mandatoryDispositionPause','length','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','OpenchannelAccounts','UserProfileSection','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','addDisposition','OpenchannelAccountId','Disposition','getDispositions','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','findOne','removeAnswers','openchannel','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','isNil','from','Sequelize','ValidationError','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey','CmList','List','CmContact','Contacts','DESC','applications','orderBy','priority','asc','account','Applications','defaults','contact','lastName','threadId','externalUrl','ContactId','OpenchannelInteraction','firstName','messageId','interaction','created','autoclose','push','close','unmanaged','*,*,*,*','OpenchannelMessage','AttachmentId','UserId','User','unshift','agent','forcedOwnership','Start','startRouting','EventManager','notify','sequelize','transaction'];(function(_0x2d7f0e,_0x3e6fbd){var _0x110b07=function(_0x557b00){while(--_0x557b00){_0x2d7f0e['push'](_0x2d7f0e['shift']());}};_0x110b07(++_0x3e6fbd);}(_0xf840,0x195));var _0x0f84=function(_0x38a155,_0x2aa026){_0x38a155=_0x38a155-0x0;var _0x269403=_0xf840[_0x38a155];return _0x269403;};'use strict';var emlformat=require(_0x0f84('0x0'));var rimraf=require(_0x0f84('0x1'));var zipdir=require(_0x0f84('0x2'));var jsonpatch=require(_0x0f84('0x3'));var rp=require(_0x0f84('0x4'));var moment=require(_0x0f84('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x0f84('0x6'));var util=require(_0x0f84('0x7'));var path=require(_0x0f84('0x8'));var sox=require(_0x0f84('0x9'));var csv=require(_0x0f84('0xa'));var ejs=require(_0x0f84('0xb'));var fs=require('fs');var fs_extra=require(_0x0f84('0xc'));var _=require(_0x0f84('0xd'));var squel=require(_0x0f84('0xe'));var crypto=require('crypto');var jsforce=require(_0x0f84('0xf'));var deskjs=require(_0x0f84('0x10'));var toCsv=require(_0x0f84('0xa'));var querystring=require(_0x0f84('0x11'));var Papa=require(_0x0f84('0x12'));var Redis=require(_0x0f84('0x13'));var authService=require(_0x0f84('0x14'));var qs=require(_0x0f84('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0f84('0x16'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x0f84('0x17'));var licenseUtil=require(_0x0f84('0x18'));var db=require(_0x0f84('0x19'))['db'];config['redis']=_['defaults'](config['redis'],{'host':_0x0f84('0x1a'),'port':0x18eb});var socket=require(_0x0f84('0x1b'))(new Redis(config[_0x0f84('0x1c')]));require(_0x0f84('0x1d'))[_0x0f84('0x1e')](socket);var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232c});var client9002=jayson['client'][_0x0f84('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x5acc27,_0x33a753,_0x57e7b2,_0x581026){return new BPromise(function(_0x373310,_0xb07673){var _0xc0a646=_0x581026||client;return _0xc0a646[_0x0f84('0x20')](_0x5acc27,_0x57e7b2)[_0x0f84('0x21')](function(_0x5ba4a3){logger[_0x0f84('0x22')]('OpenchannelAccount,\x20%s,\x20%s',_0x33a753,'request\x20sent');logger[_0x0f84('0x23')](_0x0f84('0x24'),_0x33a753,_0x0f84('0x25'),JSON[_0x0f84('0x26')](_0x5ba4a3));if(_0x5ba4a3[_0x0f84('0x27')]){if(_0x5ba4a3['error']['code']===0x1f4){logger[_0x0f84('0x27')](_0x0f84('0x28'),_0x33a753,_0x5ba4a3[_0x0f84('0x27')][_0x0f84('0x29')]);return _0xb07673(_0x5ba4a3[_0x0f84('0x27')]['message']);}logger[_0x0f84('0x27')](_0x0f84('0x28'),_0x33a753,_0x5ba4a3[_0x0f84('0x27')]['message']);return _0x373310(_0x5ba4a3[_0x0f84('0x27')][_0x0f84('0x29')]);}else{logger['info']('OpenchannelAccount,\x20%s,\x20%s',_0x33a753,_0x0f84('0x25'));_0x373310(_0x5ba4a3[_0x0f84('0x2a')][_0x0f84('0x29')]);}})[_0x0f84('0x2b')](function(_0x3b91cd){logger['error'](_0x0f84('0x28'),_0x33a753,_0x3b91cd);_0xb07673(_0x3b91cd);});});}function respondWithStatusCode(_0x5486ee,_0x1de94f){_0x1de94f=_0x1de94f||0xcc;return function(_0x3bd526){if(_0x3bd526){return _0x5486ee[_0x0f84('0x2c')](_0x1de94f);}return _0x5486ee[_0x0f84('0x2d')](_0x1de94f)[_0x0f84('0x2e')]();};}function respondWithResult(_0x486899,_0x34c51c){_0x34c51c=_0x34c51c||0xc8;return function(_0x44f5e9){if(_0x44f5e9){return _0x486899[_0x0f84('0x2d')](_0x34c51c)[_0x0f84('0x2f')](_0x44f5e9);}};}function respondWithFilteredResult(_0x33f38a,_0x559808){return function(_0x37271c){if(_0x37271c){var _0x2e9208=typeof _0x559808[_0x0f84('0x30')]==='undefined'&&typeof _0x559808[_0x0f84('0x31')]===_0x0f84('0x32');var _0x2a5c7b=_0x37271c[_0x0f84('0x33')];var _0x185c99=_0x2e9208?0x0:_0x559808[_0x0f84('0x30')];var _0x379d25=_0x2e9208?_0x37271c[_0x0f84('0x33')]:_0x559808[_0x0f84('0x30')]+_0x559808[_0x0f84('0x31')];var _0x4117e6;if(_0x379d25>=_0x2a5c7b){_0x379d25=_0x2a5c7b;_0x4117e6=0xc8;}else{_0x4117e6=0xce;}_0x33f38a['status'](_0x4117e6);return _0x33f38a['set'](_0x0f84('0x34'),_0x185c99+'-'+_0x379d25+'/'+_0x2a5c7b)[_0x0f84('0x2f')](_0x37271c);}return null;};}function patchUpdates(_0x1e5cf3){return function(_0x26d8fa){try{jsonpatch['apply'](_0x26d8fa,_0x1e5cf3,!![]);}catch(_0x15ee6c){return BPromise[_0x0f84('0x35')](_0x15ee6c);}return _0x26d8fa['save']();};}function saveUpdates(_0x561917,_0x36febb){return function(_0x47d42e){if(_0x47d42e){return _0x47d42e['update'](_0x561917)[_0x0f84('0x21')](function(_0x37f228){return _0x37f228;});}return null;};}function removeEntity(_0x2a130b,_0x40379a){return function(_0x52577d){if(_0x52577d){return _0x52577d[_0x0f84('0x36')]()[_0x0f84('0x21')](function(){var _0x430d19=_0x52577d[_0x0f84('0x37')]({'plain':!![]});var _0x28c6b7='OpenchannelAccounts';return db['UserProfileResource'][_0x0f84('0x36')]({'where':{'type':_0x28c6b7,'resourceId':_0x430d19['id']}})[_0x0f84('0x21')](function(){return _0x52577d;});})[_0x0f84('0x21')](function(){_0x2a130b[_0x0f84('0x2d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x43ef48,_0x59675e){return function(_0x577c99){if(!_0x577c99){_0x43ef48[_0x0f84('0x2c')](0x194);}return _0x577c99;};}function handleError(_0x4b73b7,_0x38d3da){_0x38d3da=_0x38d3da||0x1f4;return function(_0x4ec213){logger[_0x0f84('0x27')](_0x4ec213[_0x0f84('0x38')]);if(_0x4ec213[_0x0f84('0x39')]){delete _0x4ec213[_0x0f84('0x39')];}_0x4b73b7[_0x0f84('0x2d')](_0x38d3da)[_0x0f84('0x3a')](_0x4ec213);};}exports[_0x0f84('0x3b')]=function(_0x59afbc,_0x46ec87){var _0x2a97cc={'include':[{'model':db[_0x0f84('0x3c')],'as':'mandatoryDispositionPause'}]},_0x1d7941={},_0x1bb566={'count':0x0,'rows':[]};var _0x35acf5=_[_0x0f84('0x3d')](db['OpenchannelAccount'][_0x0f84('0x3e')],function(_0x323857){return{'name':_0x323857[_0x0f84('0x3f')],'type':_0x323857[_0x0f84('0x40')][_0x0f84('0x41')]};});_0x1d7941[_0x0f84('0x42')]=_[_0x0f84('0x3d')](_0x35acf5,_0x0f84('0x39'));_0x1d7941[_0x0f84('0x43')]=_[_0x0f84('0x44')](_0x59afbc['query']);_0x1d7941[_0x0f84('0x45')]=_[_0x0f84('0x46')](_0x1d7941[_0x0f84('0x42')],_0x1d7941[_0x0f84('0x43')]);_0x2a97cc['attributes']=_[_0x0f84('0x46')](_0x1d7941['model'],qs['fields'](_0x59afbc['query'][_0x0f84('0x47')]));_0x2a97cc[_0x0f84('0x48')]=_0x2a97cc[_0x0f84('0x48')]['length']?_0x2a97cc[_0x0f84('0x48')]:_0x1d7941[_0x0f84('0x42')];if(!_0x59afbc[_0x0f84('0x43')][_0x0f84('0x49')](_0x0f84('0x4a'))){_0x2a97cc['limit']=qs['limit'](_0x59afbc[_0x0f84('0x43')][_0x0f84('0x31')]);_0x2a97cc['offset']=qs['offset'](_0x59afbc['query'][_0x0f84('0x30')]);}_0x2a97cc[_0x0f84('0x4b')]=qs[_0x0f84('0x4c')](_0x59afbc['query'][_0x0f84('0x4c')]);_0x2a97cc[_0x0f84('0x4d')]=qs[_0x0f84('0x45')](_[_0x0f84('0x4e')](_0x59afbc[_0x0f84('0x43')],_0x1d7941[_0x0f84('0x45')]),_0x35acf5);if(_0x59afbc[_0x0f84('0x43')]['filter']){_0x2a97cc[_0x0f84('0x4d')]=_['merge'](_0x2a97cc[_0x0f84('0x4d')],{'$or':_[_0x0f84('0x3d')](_0x35acf5,function(_0x2ed9c5){if(_0x2ed9c5['type']!=='VIRTUAL'){var _0x28faaa={};_0x28faaa[_0x2ed9c5[_0x0f84('0x39')]]={'$like':'%'+_0x59afbc[_0x0f84('0x43')][_0x0f84('0x4f')]+'%'};return _0x28faaa;}})});}_0x2a97cc=_[_0x0f84('0x50')]({},_0x2a97cc,_0x59afbc['options']);var _0x50d495={'where':_0x2a97cc[_0x0f84('0x4d')]};return db['OpenchannelAccount'][_0x0f84('0x33')](_0x50d495)[_0x0f84('0x21')](function(_0x1e2461){_0x1bb566[_0x0f84('0x33')]=_0x1e2461;if(_0x59afbc[_0x0f84('0x43')][_0x0f84('0x51')]){_0x2a97cc[_0x0f84('0x52')]=[{'all':!![]}];}return db[_0x0f84('0x53')][_0x0f84('0x54')](_0x2a97cc);})[_0x0f84('0x21')](function(_0x5e2cfd){_0x1bb566[_0x0f84('0x55')]=_0x5e2cfd;return _0x1bb566;})[_0x0f84('0x21')](respondWithFilteredResult(_0x46ec87,_0x2a97cc))[_0x0f84('0x2b')](handleError(_0x46ec87,null));};exports[_0x0f84('0x56')]=function(_0x5a486b,_0x4c5d64){var _0x5f0d85={'raw':![],'where':{'id':_0x5a486b[_0x0f84('0x57')]['id']},'include':[{'model':db['Pause'],'as':_0x0f84('0x58')}]},_0x55a6d7={};_0x55a6d7[_0x0f84('0x42')]=_[_0x0f84('0x44')](db[_0x0f84('0x53')][_0x0f84('0x3e')]);_0x55a6d7[_0x0f84('0x43')]=_[_0x0f84('0x44')](_0x5a486b[_0x0f84('0x43')]);_0x55a6d7[_0x0f84('0x45')]=_[_0x0f84('0x46')](_0x55a6d7[_0x0f84('0x42')],_0x55a6d7[_0x0f84('0x43')]);_0x5f0d85[_0x0f84('0x48')]=_['intersection'](_0x55a6d7[_0x0f84('0x42')],qs[_0x0f84('0x47')](_0x5a486b[_0x0f84('0x43')][_0x0f84('0x47')]));_0x5f0d85[_0x0f84('0x48')]=_0x5f0d85[_0x0f84('0x48')][_0x0f84('0x59')]?_0x5f0d85[_0x0f84('0x48')]:_0x55a6d7[_0x0f84('0x42')];if(_0x5a486b[_0x0f84('0x43')][_0x0f84('0x51')]){_0x5f0d85[_0x0f84('0x52')]=[{'all':!![]}];}_0x5f0d85=_[_0x0f84('0x50')]({},_0x5f0d85,_0x5a486b[_0x0f84('0x5a')]);return db[_0x0f84('0x53')][_0x0f84('0x5b')](_0x5f0d85)[_0x0f84('0x21')](handleEntityNotFound(_0x4c5d64,null))[_0x0f84('0x21')](respondWithResult(_0x4c5d64,null))[_0x0f84('0x2b')](handleError(_0x4c5d64,null));};exports['create']=function(_0x449dc5,_0xe1680){return db[_0x0f84('0x53')][_0x0f84('0x5c')](_0x449dc5[_0x0f84('0x5d')],{})['then'](function(_0xca2cfc){var _0x40f8f0=_0x449dc5[_0x0f84('0x5e')][_0x0f84('0x37')]({'plain':!![]});if(!_0x40f8f0)throw new Error(_0x0f84('0x5f'));if(_0x40f8f0[_0x0f84('0x60')]===_0x0f84('0x5e')){var _0x49ce68=_0xca2cfc[_0x0f84('0x37')]({'plain':!![]});var _0x13ab2c=_0x0f84('0x61');return db[_0x0f84('0x62')][_0x0f84('0x5b')]({'where':{'name':_0x13ab2c,'userProfileId':_0x40f8f0[_0x0f84('0x63')]},'raw':!![]})[_0x0f84('0x21')](function(_0x48b09c){if(_0x48b09c&&_0x48b09c['autoAssociation']===0x0){return db[_0x0f84('0x64')][_0x0f84('0x5c')]({'name':_0x49ce68['name'],'resourceId':_0x49ce68['id'],'type':_0x48b09c[_0x0f84('0x39')],'sectionId':_0x48b09c['id']},{})[_0x0f84('0x21')](function(){return _0xca2cfc;});}else{return _0xca2cfc;}})['catch'](function(_0x4c9c5c){logger[_0x0f84('0x27')](_0x0f84('0x65'),_0x4c9c5c);throw _0x4c9c5c;});}return _0xca2cfc;})[_0x0f84('0x21')](respondWithResult(_0xe1680,0xc9))[_0x0f84('0x2b')](handleError(_0xe1680,null));};exports[_0x0f84('0x66')]=function(_0x4954d8,_0x1b439b){if(_0x4954d8[_0x0f84('0x5d')]['id']){delete _0x4954d8['body']['id'];}return db[_0x0f84('0x53')][_0x0f84('0x5b')]({'where':{'id':_0x4954d8[_0x0f84('0x57')]['id']},'include':[{'model':db[_0x0f84('0x3c')],'as':'mandatoryDispositionPause'}]})[_0x0f84('0x21')](handleEntityNotFound(_0x1b439b,null))['then'](saveUpdates(_0x4954d8[_0x0f84('0x5d')],null))[_0x0f84('0x21')](respondWithResult(_0x1b439b,null))[_0x0f84('0x2b')](handleError(_0x1b439b,null));};exports['destroy']=function(_0x4d9d49,_0x2bd141){return db['OpenchannelAccount'][_0x0f84('0x5b')]({'where':{'id':_0x4d9d49[_0x0f84('0x57')]['id']}})[_0x0f84('0x21')](handleEntityNotFound(_0x2bd141,null))[_0x0f84('0x21')](removeEntity(_0x2bd141,null))[_0x0f84('0x2b')](handleError(_0x2bd141,null));};exports[_0x0f84('0x67')]=function(_0x102fdc,_0x1b9ae6){return db['OpenchannelAccount'][_0x0f84('0x67')]()[_0x0f84('0x21')](respondWithResult(_0x1b9ae6,null))['catch'](handleError(_0x1b9ae6,null));};exports[_0x0f84('0x68')]=function(_0x15c4eb,_0x39a4f7,_0x3fb49f){if(_0x15c4eb['body']['id']){delete _0x15c4eb[_0x0f84('0x5d')]['id'];}return db[_0x0f84('0x53')][_0x0f84('0x5b')]({'where':{'id':_0x15c4eb[_0x0f84('0x57')]['id']}})[_0x0f84('0x21')](handleEntityNotFound(_0x39a4f7,null))[_0x0f84('0x21')](function(_0x37e8b4){if(_0x37e8b4){_0x15c4eb['body'][_0x0f84('0x69')]=_0x37e8b4['id'];return db[_0x0f84('0x6a')][_0x0f84('0x5c')](_0x15c4eb[_0x0f84('0x5d')]);}})['then'](respondWithResult(_0x39a4f7,null))[_0x0f84('0x2b')](handleError(_0x39a4f7,null));};exports[_0x0f84('0x6b')]=function(_0x12c040,_0x495711,_0x2e5128){var _0x2e7b60={'raw':![],'where':{}};var _0x414283={};var _0x33edd4={'count':0x0,'rows':[]};return db[_0x0f84('0x53')]['findOne']({'where':{'id':_0x12c040[_0x0f84('0x57')]['id']}})['then'](handleEntityNotFound(_0x495711,null))[_0x0f84('0x21')](function(_0x22cf62){if(_0x22cf62){_0x414283['model']=_[_0x0f84('0x44')](db[_0x0f84('0x6a')][_0x0f84('0x3e')]);_0x414283['query']=_[_0x0f84('0x44')](_0x12c040['query']);_0x414283[_0x0f84('0x45')]=_[_0x0f84('0x46')](_0x414283[_0x0f84('0x42')],_0x414283['query']);_0x2e7b60[_0x0f84('0x48')]=_[_0x0f84('0x46')](_0x414283[_0x0f84('0x42')],qs[_0x0f84('0x47')](_0x12c040[_0x0f84('0x43')][_0x0f84('0x47')]));_0x2e7b60[_0x0f84('0x48')]=_0x2e7b60[_0x0f84('0x48')][_0x0f84('0x59')]?_0x2e7b60[_0x0f84('0x48')]:_0x414283['model'];if(!_0x12c040['query']['hasOwnProperty'](_0x0f84('0x4a'))){_0x2e7b60[_0x0f84('0x31')]=qs[_0x0f84('0x31')](_0x12c040[_0x0f84('0x43')][_0x0f84('0x31')]);_0x2e7b60[_0x0f84('0x30')]=qs[_0x0f84('0x30')](_0x12c040[_0x0f84('0x43')][_0x0f84('0x30')]);}_0x2e7b60[_0x0f84('0x4b')]=qs['sort'](_0x12c040[_0x0f84('0x43')][_0x0f84('0x4c')]);_0x2e7b60[_0x0f84('0x4d')]=qs[_0x0f84('0x45')](_['pick'](_0x12c040['query'],_0x414283[_0x0f84('0x45')]));_0x2e7b60[_0x0f84('0x4d')][_0x0f84('0x69')]=_0x22cf62['id'];if(_0x12c040[_0x0f84('0x43')][_0x0f84('0x4f')]){_0x2e7b60[_0x0f84('0x4d')]=_[_0x0f84('0x50')](_0x2e7b60[_0x0f84('0x4d')],{'$or':_[_0x0f84('0x3d')](_0x2e7b60['attributes'],function(_0x37233c){var _0x425d2a={};_0x425d2a[_0x37233c]={'$like':'%'+_0x12c040[_0x0f84('0x43')][_0x0f84('0x4f')]+'%'};return _0x425d2a;})});}_0x2e7b60=_[_0x0f84('0x50')]({},_0x2e7b60,_0x12c040[_0x0f84('0x5a')]);return db[_0x0f84('0x6a')]['count']({'where':_0x2e7b60[_0x0f84('0x4d')]})['then'](function(_0x3f2cb6){_0x33edd4[_0x0f84('0x33')]=_0x3f2cb6;if(_0x12c040[_0x0f84('0x43')][_0x0f84('0x51')]){_0x2e7b60['include']=[{'all':!![]}];}return db[_0x0f84('0x6a')]['findAll'](_0x2e7b60);})[_0x0f84('0x21')](function(_0x46b275){_0x33edd4['rows']=_0x46b275;return _0x33edd4;});}})[_0x0f84('0x21')](respondWithFilteredResult(_0x495711,_0x2e7b60))[_0x0f84('0x2b')](handleError(_0x495711,null));};exports[_0x0f84('0x6c')]=function(_0x2debee,_0xeda925,_0x5a6afb){return db[_0x0f84('0x53')][_0x0f84('0x5b')]({'where':{'id':_0x2debee[_0x0f84('0x57')]['id']}})[_0x0f84('0x21')](handleEntityNotFound(_0xeda925,null))['then'](function(_0x3e4532){if(_0x3e4532){return _0x3e4532['removeDispositions'](_0x2debee[_0x0f84('0x43')][_0x0f84('0x6d')]);}})[_0x0f84('0x21')](respondWithStatusCode(_0xeda925,null))['catch'](handleError(_0xeda925,null));};exports[_0x0f84('0x6e')]=function(_0x3a1c91,_0x418c40,_0x451164){if(_0x3a1c91[_0x0f84('0x5d')]['id']){delete _0x3a1c91[_0x0f84('0x5d')]['id'];}return db[_0x0f84('0x53')][_0x0f84('0x5b')]({'where':{'id':_0x3a1c91[_0x0f84('0x57')]['id']}})[_0x0f84('0x21')](handleEntityNotFound(_0x418c40,null))['then'](function(_0x2084f1){if(_0x2084f1){_0x3a1c91[_0x0f84('0x5d')]['OpenchannelAccountId']=_0x2084f1['id'];return db[_0x0f84('0x6f')][_0x0f84('0x5c')](_0x3a1c91[_0x0f84('0x5d')]);}})[_0x0f84('0x21')](respondWithResult(_0x418c40,null))[_0x0f84('0x2b')](handleError(_0x418c40,null));};exports[_0x0f84('0x70')]=function(_0x46d2db,_0x5a5012,_0x1467d8){var _0x5cb018={'raw':![],'where':{}};var _0x5d06cf={};var _0x43bb32={'count':0x0,'rows':[]};return db[_0x0f84('0x53')][_0x0f84('0x71')]({'where':{'id':_0x46d2db['params']['id']}})[_0x0f84('0x21')](handleEntityNotFound(_0x5a5012,null))[_0x0f84('0x21')](function(_0x3ea703){if(_0x3ea703){_0x5d06cf[_0x0f84('0x42')]=_[_0x0f84('0x44')](db['CannedAnswer'][_0x0f84('0x3e')]);_0x5d06cf[_0x0f84('0x43')]=_['keys'](_0x46d2db[_0x0f84('0x43')]);_0x5d06cf[_0x0f84('0x45')]=_[_0x0f84('0x46')](_0x5d06cf[_0x0f84('0x42')],_0x5d06cf[_0x0f84('0x43')]);_0x5cb018[_0x0f84('0x48')]=_[_0x0f84('0x46')](_0x5d06cf[_0x0f84('0x42')],qs['fields'](_0x46d2db['query'][_0x0f84('0x47')]));_0x5cb018[_0x0f84('0x48')]=_0x5cb018[_0x0f84('0x48')][_0x0f84('0x59')]?_0x5cb018[_0x0f84('0x48')]:_0x5d06cf['model'];if(!_0x46d2db[_0x0f84('0x43')]['hasOwnProperty']('nolimit')){_0x5cb018['limit']=qs[_0x0f84('0x31')](_0x46d2db[_0x0f84('0x43')][_0x0f84('0x31')]);_0x5cb018['offset']=qs[_0x0f84('0x30')](_0x46d2db['query']['offset']);}_0x5cb018[_0x0f84('0x4b')]=qs[_0x0f84('0x4c')](_0x46d2db['query'][_0x0f84('0x4c')]);_0x5cb018[_0x0f84('0x4d')]=qs['filters'](_[_0x0f84('0x4e')](_0x46d2db['query'],_0x5d06cf[_0x0f84('0x45')]));_0x5cb018[_0x0f84('0x4d')][_0x0f84('0x69')]=_0x3ea703['id'];if(_0x46d2db[_0x0f84('0x43')][_0x0f84('0x4f')]){_0x5cb018['where']=_[_0x0f84('0x50')](_0x5cb018[_0x0f84('0x4d')],{'$or':_[_0x0f84('0x3d')](_0x5cb018[_0x0f84('0x48')],function(_0x1ce038){var _0xababba={};_0xababba[_0x1ce038]={'$like':'%'+_0x46d2db[_0x0f84('0x43')][_0x0f84('0x4f')]+'%'};return _0xababba;})});}_0x5cb018=_[_0x0f84('0x50')]({},_0x5cb018,_0x46d2db[_0x0f84('0x5a')]);return db[_0x0f84('0x6f')][_0x0f84('0x33')]({'where':_0x5cb018['where']})[_0x0f84('0x21')](function(_0x4f441d){_0x43bb32[_0x0f84('0x33')]=_0x4f441d;if(_0x46d2db[_0x0f84('0x43')][_0x0f84('0x51')]){_0x5cb018[_0x0f84('0x52')]=[{'all':!![]}];}return db[_0x0f84('0x6f')][_0x0f84('0x54')](_0x5cb018);})[_0x0f84('0x21')](function(_0x2c949b){_0x43bb32['rows']=_0x2c949b;return _0x43bb32;});}})[_0x0f84('0x21')](respondWithFilteredResult(_0x5a5012,_0x5cb018))['catch'](handleError(_0x5a5012,null));};exports[_0x0f84('0x72')]=function(_0x4bc1ad,_0x20ebe3,_0xf919e8){return db[_0x0f84('0x53')][_0x0f84('0x5b')]({'where':{'id':_0x4bc1ad[_0x0f84('0x57')]['id']}})[_0x0f84('0x21')](handleEntityNotFound(_0x20ebe3,null))[_0x0f84('0x21')](function(_0x100788){if(_0x100788){return _0x100788['removeAnswers'](_0x4bc1ad['query'][_0x0f84('0x6d')]);}})[_0x0f84('0x21')](respondWithStatusCode(_0x20ebe3,null))[_0x0f84('0x2b')](handleError(_0x20ebe3,null));};exports['notify']=function(_0x57b63c,_0x429bdf,_0x26f94b){var _0x22f67d={'body':_0x57b63c[_0x0f84('0x5d')],'channel':_0x0f84('0x73')};var _0x42036c=[];var _0x4bc572=[];var _0x127d1c={};var _0x4a8da4=![];return db['CmContact'][_0x0f84('0x67')]()['then'](function(_0x4d4bdc){if(!_0x4d4bdc){throw new db['Sequelize']['ValidationError'](_0x0f84('0x74'));}_0x42036c=_[_0x0f84('0x75')](_[_0x0f84('0x44')](_0x4d4bdc),[_0x0f84('0x76'),_0x0f84('0x77')]);_0x4bc572=_[_0x0f84('0x75')](_[_0x0f84('0x44')](_0x4d4bdc),[_0x0f84('0x76'),_0x0f84('0x77'),_0x0f84('0x78'),_0x0f84('0x79')]);if(_0x57b63c[_0x0f84('0x5d')]['id']){delete _0x57b63c[_0x0f84('0x5d')]['id'];}if(_[_0x0f84('0x7a')](_0x57b63c[_0x0f84('0x5d')][_0x0f84('0x7b')])){throw new db[(_0x0f84('0x7c'))][(_0x0f84('0x7d'))](_0x0f84('0x7e'));}if(_[_0x0f84('0x7a')](_0x57b63c[_0x0f84('0x5d')]['body'])||_0x57b63c[_0x0f84('0x5d')]['body']===''){throw new db[(_0x0f84('0x7c'))][(_0x0f84('0x7d'))](_0x0f84('0x7f'));}if(_['isNil'](_0x57b63c[_0x0f84('0x5d')]['mapKey'])){throw new db[(_0x0f84('0x7c'))]['ValidationError'](_0x0f84('0x80')+_0x4bc572);}if(!_[_0x0f84('0x81')](_0x4bc572,_0x57b63c[_0x0f84('0x5d')][_0x0f84('0x82')])){throw new db[(_0x0f84('0x7c'))][(_0x0f84('0x7d'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x4bc572);}_0x127d1c[_0x57b63c[_0x0f84('0x5d')][_0x0f84('0x82')]]=_0x57b63c[_0x0f84('0x5d')][_0x0f84('0x7b')];})['then'](function(){return db['OpenchannelAccount'][_0x0f84('0x5b')]({'where':{'id':_0x57b63c[_0x0f84('0x57')]['id']},'include':[{'model':db[_0x0f84('0x83')],'as':_0x0f84('0x84'),'include':[{'model':db[_0x0f84('0x85')],'as':_0x0f84('0x86'),'where':_0x127d1c,'limit':0x1,'order':[[_0x0f84('0x77'),_0x0f84('0x87')]]}]},{'model':db['OpenchannelApplication'],'as':'Applications'}]});})[_0x0f84('0x21')](handleEntityNotFound(_0x429bdf,null))[_0x0f84('0x21')](function(_0x55b3c1){if(_0x55b3c1&&_0x55b3c1['List']){_0x22f67d['account']=_0x55b3c1;_0x22f67d[_0x0f84('0x88')]=_0x55b3c1['Applications'];_0x22f67d['list']=_0x55b3c1[_0x0f84('0x84')];_0x22f67d[_0x0f84('0x88')]=_[_0x0f84('0x89')](_0x22f67d[_0x0f84('0x88')],[_0x0f84('0x8a')],[_0x0f84('0x8b')]);if(_0x22f67d[_0x0f84('0x8c')][_0x0f84('0x8d')]){delete _0x22f67d[_0x0f84('0x8c')][_0x0f84('0x8d')];}if(_0x22f67d[_0x0f84('0x8c')][_0x0f84('0x84')]&&_0x22f67d[_0x0f84('0x8c')][_0x0f84('0x84')][_0x0f84('0x86')][_0x0f84('0x59')]){return _0x22f67d[_0x0f84('0x8c')][_0x0f84('0x84')]['Contacts'][0x0];}var _0x424e93=_[_0x0f84('0x8e')](_0x57b63c['body'],{'firstName':_0x57b63c[_0x0f84('0x5d')][_0x0f84('0x7b')],'ListId':_0x55b3c1[_0x0f84('0x79')]});_0x424e93[_0x57b63c[_0x0f84('0x5d')]['mapKey']]=_0x57b63c[_0x0f84('0x5d')]['from'];return db[_0x0f84('0x85')][_0x0f84('0x5c')](_0x424e93,{'fields':_0x42036c,'raw':!![]});}})[_0x0f84('0x21')](handleEntityNotFound(_0x429bdf,null))['then'](function(_0x1a4d0c){_0x22f67d[_0x0f84('0x8f')]=_0x1a4d0c;if(_0x1a4d0c){var _0x57a069={'ContactId':_0x1a4d0c['id'],'OpenchannelAccountId':_0x57b63c[_0x0f84('0x57')]['id'],'from':(_0x1a4d0c['firstName']||'')+'\x20'+(_0x1a4d0c[_0x0f84('0x90')]||'')};var _0x3d961e={'OpenchannelAccountId':_0x57b63c[_0x0f84('0x57')]['id'],'closed':![]};if(_0x57b63c['body'][_0x0f84('0x91')]){_0x3d961e[_0x0f84('0x91')]=_0x57b63c[_0x0f84('0x5d')][_0x0f84('0x91')];return db['OpenchannelInteraction']['find']({'where':_0x3d961e})[_0x0f84('0x21')](function(_0x4d17f6){if(_0x4d17f6){return[_0x4d17f6,![]];}_0x57a069[_0x0f84('0x91')]=_0x57b63c[_0x0f84('0x5d')]['threadId'];_0x57a069[_0x0f84('0x92')]=_0x57b63c[_0x0f84('0x5d')][_0x0f84('0x92')];return db['OpenchannelInteraction'][_0x0f84('0x5c')](_0x57a069)[_0x0f84('0x21')](function(_0x2c4691){return[_0x2c4691,!![]];});});}else{_0x3d961e[_0x0f84('0x91')]=null;}_0x3d961e[_0x0f84('0x93')]=_0x1a4d0c['id'];return db[_0x0f84('0x94')][_0x0f84('0x5b')]({'where':_0x3d961e})['then'](function(_0xc5dc9a){if(_0xc5dc9a){return[_0xc5dc9a,![]];}return db['OpenchannelInteraction']['create'](_0x57a069)[_0x0f84('0x21')](function(_0x3b90f1){return[_0x3b90f1,!![]];});});}})['spread'](function(_0x298288,_0x5960c4){if(_0x298288){_0x4a8da4=_0x5960c4;if(!_0x5960c4){var _0x3e307e={'from':(_0x22f67d[_0x0f84('0x8f')][_0x0f84('0x95')]||'')+'\x20'+(_0x22f67d['contact'][_0x0f84('0x90')]||'')};if(_0x57b63c[_0x0f84('0x5d')][_0x0f84('0x91')]&&_0x57b63c[_0x0f84('0x5d')][_0x0f84('0x96')]&&_0x57b63c[_0x0f84('0x5d')]['threadId']!=_0x57b63c[_0x0f84('0x5d')]['messageId']){_0x3e307e[_0x0f84('0x91')]=_0x57b63c[_0x0f84('0x5d')][_0x0f84('0x96')];}return _0x298288['update'](_0x3e307e);}else{return _0x298288;}}})[_0x0f84('0x21')](function(_0x1f2211){_0x22f67d[_0x0f84('0x97')]=_0x1f2211[_0x0f84('0x37')]({'plain':!![]});_0x22f67d[_0x0f84('0x97')][_0x0f84('0x98')]=_0x4a8da4;if(_0x22f67d['interaction'][_0x0f84('0x98')]){if(_0x22f67d[_0x0f84('0x8c')][_0x0f84('0x99')]){_0x22f67d['applications'][_0x0f84('0x9a')]({'id':0x0,'priority':_0x22f67d[_0x0f84('0x88')][_0x0f84('0x59')]+0x1,'app':_0x0f84('0x9b'),'appdata':_0x0f84('0x9c'),'interval':_0x0f84('0x9d')});}}return db[_0x0f84('0x9e')][_0x0f84('0x5c')]({'body':_0x57b63c[_0x0f84('0x5d')]['body'],'OpenchannelAccountId':_0x57b63c[_0x0f84('0x57')]['id'],'OpenchannelInteractionId':_0x1f2211['id'],'direction':'in','ContactId':_0x22f67d[_0x0f84('0x8f')]['id'],'AttachmentId':_0x57b63c[_0x0f84('0x5d')][_0x0f84('0x9f')]});})['then'](function(_0x19bd08){_0x22f67d['message']=_0x19bd08;if(_0x22f67d[_0x0f84('0x97')][_0x0f84('0xa0')]){return db[_0x0f84('0xa1')][_0x0f84('0x5b')]({'attributes':['id',_0x0f84('0x39')],'where':{'id':_0x22f67d[_0x0f84('0x97')][_0x0f84('0xa0')]}})[_0x0f84('0x21')](function(_0x389de7){if(_0x389de7){_0x22f67d[_0x0f84('0x88')][_0x0f84('0xa2')]({'id':0x0,'priority':0x0,'app':_0x0f84('0xa3'),'appdata':_0x389de7[_0x0f84('0x39')]+','+(_0x22f67d['account']['waitForTheAssignedAgent']||0xa),'interval':'*,*,*,*'});_0x22f67d[_0x0f84('0xa4')]=![];}return respondWithRpcPromise(_0x0f84('0xa5'),_0x0f84('0xa6'),_0x22f67d);});}return respondWithRpcPromise('Start','startRouting',_0x22f67d);})[_0x0f84('0x21')](function(_0x378adf){respondWithRpcPromise(_0x0f84('0xa7'),_0x0f84('0xa7'),{'event':_0x0f84('0xa8'),'message':_0x378adf},client9002);return _0x378adf;})[_0x0f84('0x21')](respondWithResult(_0x429bdf,null))[_0x0f84('0x2b')](handleError(_0x429bdf,null));};exports['addApplications']=function(_0x4d46f0,_0x17f9c4,_0x332370){return db[_0x0f84('0x53')][_0x0f84('0x71')]({'where':{'id':_0x4d46f0[_0x0f84('0x57')]['id']}})['then'](handleEntityNotFound(_0x17f9c4,null))['then'](function(_0x3f57cc){if(_0x3f57cc){return db[_0x0f84('0xa9')][_0x0f84('0xaa')](function(_0x261d75){return db[_0x0f84('0xab')][_0x0f84('0x36')]({'where':{'OpenchannelAccountId':_0x4d46f0['params']['id']},'transaction':_0x261d75})[_0x0f84('0x21')](function(_0x52754f){var _0xe147c4=_['map'](_0x4d46f0[_0x0f84('0x5d')],function(_0x255078){_0x255078['OpenchannelAccountId']=_0x4d46f0[_0x0f84('0x57')]['id'];return _0x255078;});return db[_0x0f84('0xab')][_0x0f84('0xac')](_0xe147c4,{'transaction':_0x261d75});});})[_0x0f84('0x21')](function(){return db[_0x0f84('0xab')][_0x0f84('0xad')]({'where':{'OpenchannelAccountId':_0x4d46f0['params']['id']},'order':_0x0f84('0x8a')});});}})[_0x0f84('0x21')](respondWithResult(_0x17f9c4,null))[_0x0f84('0x2b')](handleError(_0x17f9c4,null));};exports[_0x0f84('0xae')]=function(_0x14196d,_0x527b70,_0x2c3814){var _0x462cd5={};var _0x1b7daf={};var _0x1dddd7;var _0x13c0b3;return db[_0x0f84('0x53')][_0x0f84('0x71')]({'where':{'id':_0x14196d[_0x0f84('0x57')]['id']}})[_0x0f84('0x21')](handleEntityNotFound(_0x527b70,null))[_0x0f84('0x21')](function(_0x2ee2bc){if(_0x2ee2bc){_0x1dddd7=_0x2ee2bc;_0x1b7daf[_0x0f84('0x42')]=_['keys'](db[_0x0f84('0xab')][_0x0f84('0x3e')]);_0x1b7daf[_0x0f84('0x43')]=_[_0x0f84('0x44')](_0x14196d['query']);_0x1b7daf[_0x0f84('0x45')]=_[_0x0f84('0x46')](_0x1b7daf['model'],_0x1b7daf['query']);_0x462cd5[_0x0f84('0x48')]=_[_0x0f84('0x46')](_0x1b7daf[_0x0f84('0x42')],qs[_0x0f84('0x47')](_0x14196d[_0x0f84('0x43')][_0x0f84('0x47')]));_0x462cd5[_0x0f84('0x48')]=_0x462cd5['attributes']['length']?_0x462cd5['attributes']:_0x1b7daf[_0x0f84('0x42')];_0x462cd5[_0x0f84('0x4b')]=qs[_0x0f84('0x4c')](_0x14196d[_0x0f84('0x43')][_0x0f84('0x4c')]);_0x462cd5[_0x0f84('0x4d')]=qs['filters'](_[_0x0f84('0x4e')](_0x14196d[_0x0f84('0x43')],_0x1b7daf['filters']));if(_0x14196d[_0x0f84('0x43')][_0x0f84('0x4f')]){_0x462cd5[_0x0f84('0x4d')]=_[_0x0f84('0x50')](_0x462cd5[_0x0f84('0x4d')],{'$or':_['map'](_0x462cd5[_0x0f84('0x48')],function(_0x485a1f){var _0x36e108={};_0x36e108[_0x485a1f]={'$like':'%'+_0x14196d[_0x0f84('0x43')]['filter']+'%'};return _0x36e108;})});}_0x462cd5=_[_0x0f84('0x50')]({},_0x462cd5,_0x14196d['options']);return _0x1dddd7[_0x0f84('0xae')](_0x462cd5);}})['then'](function(_0xdbcc48){if(_0xdbcc48){_0x13c0b3=_0xdbcc48[_0x0f84('0x59')];if(!_0x14196d['query'][_0x0f84('0x49')](_0x0f84('0x4a'))){_0x462cd5[_0x0f84('0x31')]=qs['limit'](_0x14196d[_0x0f84('0x43')]['limit']);_0x462cd5[_0x0f84('0x30')]=qs[_0x0f84('0x30')](_0x14196d[_0x0f84('0x43')][_0x0f84('0x30')]);}return _0x1dddd7['getApplications'](_0x462cd5);}})['then'](function(_0x436d6d){if(_0x436d6d){return _0x436d6d?{'count':_0x13c0b3,'rows':_0x436d6d}:null;}})[_0x0f84('0x21')](respondWithResult(_0x527b70,null))[_0x0f84('0x2b')](handleError(_0x527b70,null));};exports['getInteractions']=function(_0x422a4e,_0x19ca91,_0x22f912){var _0x27fbf4={'raw':![],'where':{}};var _0x189bba={};var _0x10500b={'count':0x0,'rows':[]};return db['OpenchannelAccount']['findOne']({'where':{'id':_0x422a4e[_0x0f84('0x57')]['id']}})['then'](handleEntityNotFound(_0x19ca91,null))['then'](function(_0x1f452c){if(_0x1f452c){_0x189bba[_0x0f84('0x42')]=_['keys'](db[_0x0f84('0x94')][_0x0f84('0x3e')]);_0x189bba[_0x0f84('0x43')]=_['keys'](_0x422a4e[_0x0f84('0x43')]);_0x189bba[_0x0f84('0x45')]=_[_0x0f84('0x46')](_0x189bba[_0x0f84('0x42')],_0x189bba[_0x0f84('0x43')]);_0x27fbf4['attributes']=_[_0x0f84('0x46')](_0x189bba['model'],qs[_0x0f84('0x47')](_0x422a4e[_0x0f84('0x43')][_0x0f84('0x47')]));_0x27fbf4['attributes']=_0x27fbf4[_0x0f84('0x48')][_0x0f84('0x59')]?_0x27fbf4[_0x0f84('0x48')]:_0x189bba[_0x0f84('0x42')];if(!_0x422a4e[_0x0f84('0x43')][_0x0f84('0x49')](_0x0f84('0x4a'))){_0x27fbf4[_0x0f84('0x31')]=qs[_0x0f84('0x31')](_0x422a4e[_0x0f84('0x43')][_0x0f84('0x31')]);_0x27fbf4['offset']=qs['offset'](_0x422a4e[_0x0f84('0x43')][_0x0f84('0x30')]);}_0x27fbf4['order']=qs[_0x0f84('0x4c')](_0x422a4e['query'][_0x0f84('0x4c')]);_0x27fbf4['where']=qs[_0x0f84('0x45')](_[_0x0f84('0x4e')](_0x422a4e['query'],_0x189bba[_0x0f84('0x45')]));_0x27fbf4[_0x0f84('0x4d')][_0x0f84('0x69')]=_0x1f452c['id'];if(_0x422a4e[_0x0f84('0x43')]['filter']){_0x27fbf4[_0x0f84('0x4d')]=_[_0x0f84('0x50')](_0x27fbf4[_0x0f84('0x4d')],{'$or':_['map'](_0x27fbf4[_0x0f84('0x48')],function(_0x5171e7){var _0x933fcc={};_0x933fcc[_0x5171e7]={'$like':'%'+_0x422a4e[_0x0f84('0x43')][_0x0f84('0x4f')]+'%'};return _0x933fcc;})});}_0x27fbf4=_['merge']({},_0x27fbf4,_0x422a4e[_0x0f84('0x5a')]);return db[_0x0f84('0x94')][_0x0f84('0x33')]({'where':_0x27fbf4[_0x0f84('0x4d')]})[_0x0f84('0x21')](function(_0x1ffd5a){_0x10500b['count']=_0x1ffd5a;if(_0x422a4e['query'][_0x0f84('0x51')]){_0x27fbf4[_0x0f84('0x52')]=[{'model':db[_0x0f84('0x85')],'as':_0x0f84('0xaf'),'required':![]},{'model':db[_0x0f84('0xa1')],'as':'Owner','attributes':[_0x0f84('0x39'),'fullname',_0x0f84('0xb0')],'required':![]},{'model':db[_0x0f84('0xb1')],'as':_0x0f84('0xb2'),'attributes':['id',_0x0f84('0x39'),_0x0f84('0xb3')],'where':_0x422a4e['query'][_0x0f84('0xb4')]?{'id':_0x422a4e[_0x0f84('0x43')]['tag']}:undefined,'required':_0x422a4e['query'][_0x0f84('0xb4')]?!![]:![]}];}return db['OpenchannelInteraction'][_0x0f84('0x54')](_0x27fbf4);})[_0x0f84('0x21')](function(_0x418865){_0x10500b[_0x0f84('0x55')]=_0x418865;return _0x10500b;});}})[_0x0f84('0x21')](respondWithFilteredResult(_0x19ca91,_0x27fbf4))[_0x0f84('0x2b')](handleError(_0x19ca91,null));};exports['addAgents']=function(_0x4b15ef,_0x522163,_0x2401ae){return db['OpenchannelAccount'][_0x0f84('0x5b')]({'where':{'id':_0x4b15ef[_0x0f84('0x57')]['id']}})[_0x0f84('0x21')](handleEntityNotFound(_0x522163,null))[_0x0f84('0x21')](function(_0x325749){if(_0x325749){return _0x325749[_0x0f84('0xb5')](_0x4b15ef[_0x0f84('0x5d')][_0x0f84('0x6d')],_['omit'](_0x4b15ef[_0x0f84('0x5d')],['ids','id'])||{})[_0x0f84('0xb6')](function(_0x34b0ac){for(var _0x946e6e=0x0;_0x946e6e<_0x4b15ef[_0x0f84('0x5d')][_0x0f84('0x6d')]['length'];_0x946e6e+=0x1){socket[_0x0f84('0xb7')](_0x0f84('0xb8'),{'UserId':Number(_0x4b15ef[_0x0f84('0x5d')][_0x0f84('0x6d')][_0x946e6e]),'OpenchannelAccountId':Number(_0x4b15ef[_0x0f84('0x57')]['id'])});}return _0x34b0ac;});}})['then'](respondWithResult(_0x522163,null))['catch'](handleError(_0x522163,null));};exports[_0x0f84('0xb9')]=function(_0x13c584,_0x7cd326,_0x23edd6){return db[_0x0f84('0x53')][_0x0f84('0x5b')]({'where':{'id':_0x13c584[_0x0f84('0x57')]['id']}})[_0x0f84('0x21')](handleEntityNotFound(_0x7cd326,null))[_0x0f84('0x21')](function(_0xdaaf7f){if(_0xdaaf7f){return _0xdaaf7f[_0x0f84('0xb9')](_0x13c584['query'][_0x0f84('0x6d')])[_0x0f84('0x21')](function(){if(_[_0x0f84('0xba')](_0x13c584[_0x0f84('0x43')][_0x0f84('0x6d')])){for(var _0x199519=0x0;_0x199519<_0x13c584[_0x0f84('0x43')][_0x0f84('0x6d')][_0x0f84('0x59')];_0x199519+=0x1){socket['emit'](_0x0f84('0xbb'),{'UserId':Number(_0x13c584[_0x0f84('0x43')][_0x0f84('0x6d')][_0x199519]),'OpenchannelAccountId':Number(_0x13c584[_0x0f84('0x57')]['id'])});}}else{socket['emit'](_0x0f84('0xbb'),{'UserId':Number(_0x13c584[_0x0f84('0x43')][_0x0f84('0x6d')]),'OpenchannelAccountId':Number(_0x13c584[_0x0f84('0x57')]['id'])});}});}})[_0x0f84('0x21')](respondWithStatusCode(_0x7cd326,null))[_0x0f84('0x2b')](handleError(_0x7cd326,null));};exports[_0x0f84('0xbc')]=function(_0x289551,_0x38f452,_0x210de8){var _0x55da10={};var _0x51a7c5={};var _0x11f8a9;var _0x51276d;return db[_0x0f84('0x53')][_0x0f84('0x71')]({'where':{'id':_0x289551['params']['id']}})[_0x0f84('0x21')](handleEntityNotFound(_0x38f452,null))[_0x0f84('0x21')](function(_0xe9d25a){if(_0xe9d25a){_0x11f8a9=_0xe9d25a;_0x51a7c5['model']=_['keys'](db['User'][_0x0f84('0x3e')]);_0x51a7c5[_0x0f84('0x43')]=_[_0x0f84('0x44')](_0x289551[_0x0f84('0x43')]);_0x51a7c5['filters']=_[_0x0f84('0x46')](_0x51a7c5[_0x0f84('0x42')],_0x51a7c5[_0x0f84('0x43')]);_0x55da10['attributes']=_[_0x0f84('0x46')](_0x51a7c5[_0x0f84('0x42')],qs[_0x0f84('0x47')](_0x289551[_0x0f84('0x43')][_0x0f84('0x47')]));_0x55da10[_0x0f84('0x48')]=_0x55da10['attributes'][_0x0f84('0x59')]?_0x55da10['attributes']:_0x51a7c5[_0x0f84('0x42')];_0x55da10[_0x0f84('0x4b')]=qs[_0x0f84('0x4c')](_0x289551[_0x0f84('0x43')]['sort']);_0x55da10[_0x0f84('0x4d')]=qs[_0x0f84('0x45')](_['pick'](_0x289551[_0x0f84('0x43')],_0x51a7c5[_0x0f84('0x45')]));if(_0x289551[_0x0f84('0x43')][_0x0f84('0x4f')]){_0x55da10[_0x0f84('0x4d')]=_['merge'](_0x55da10[_0x0f84('0x4d')],{'$or':_[_0x0f84('0x3d')](_0x55da10[_0x0f84('0x48')],function(_0x17f8ce){var _0x185184={};_0x185184[_0x17f8ce]={'$like':'%'+_0x289551[_0x0f84('0x43')][_0x0f84('0x4f')]+'%'};return _0x185184;})});}_0x55da10=_[_0x0f84('0x50')]({},_0x55da10,_0x289551['options']);return _0x11f8a9[_0x0f84('0xbc')](_0x55da10);}})[_0x0f84('0x21')](function(_0x1cac28){if(_0x1cac28){_0x51276d=_0x1cac28[_0x0f84('0x59')];if(!_0x289551[_0x0f84('0x43')][_0x0f84('0x49')](_0x0f84('0x4a'))){_0x55da10[_0x0f84('0x31')]=qs['limit'](_0x289551['query'][_0x0f84('0x31')]);_0x55da10[_0x0f84('0x30')]=qs[_0x0f84('0x30')](_0x289551[_0x0f84('0x43')]['offset']);}return _0x11f8a9[_0x0f84('0xbc')](_0x55da10);}})['then'](function(_0x34c2b3){if(_0x34c2b3){return _0x34c2b3?{'count':_0x51276d,'rows':_0x34c2b3}:null;}})[_0x0f84('0x21')](respondWithResult(_0x38f452,null))[_0x0f84('0x2b')](handleError(_0x38f452,null));};exports[_0x0f84('0x3a')]=function(_0x3b4f47,_0x38aaee,_0x18beb3){var _0x1a7108,_0x2dca2b,_0x4b7bb4;if(_['isNil'](_0x3b4f47[_0x0f84('0x5d')][_0x0f84('0x5d')])||_0x3b4f47[_0x0f84('0x5d')][_0x0f84('0x5d')]===''){throw new db[(_0x0f84('0x7c'))][(_0x0f84('0x7d'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x0f84('0x7a')](_0x3b4f47[_0x0f84('0x5d')]['to'])){}_0x1a7108=_0x3b4f47[_0x0f84('0x5d')]['to'];return db[_0x0f84('0x53')]['findOne']({'where':{'id':_0x3b4f47[_0x0f84('0x57')]['id']}})[_0x0f84('0x21')](handleEntityNotFound(_0x38aaee,null))[_0x0f84('0x21')](function(_0x67a121){if(_0x67a121){return db['OpenchannelAccount']['find']({'where':{'id':_0x67a121['id']},'include':[{'model':db[_0x0f84('0x83')],'as':_0x0f84('0x84'),'include':[{'model':db[_0x0f84('0x85')],'as':_0x0f84('0x86'),'where':{[_0x67a121[_0x0f84('0x82')]]:_0x1a7108},'limit':0x1,'order':[[_0x0f84('0x77'),_0x0f84('0x87')]]}]}]})['then'](handleEntityNotFound(_0x38aaee,null))['then'](function(_0x54ce14){if(_0x54ce14&&_0x54ce14['List']){_0x2dca2b=_0x54ce14[_0x0f84('0x37')]({'plain':!![]});if(_0x2dca2b[_0x0f84('0x84')]&&_0x2dca2b[_0x0f84('0x84')][_0x0f84('0x86')]['length']){return _0x2dca2b[_0x0f84('0x84')][_0x0f84('0x86')][0x0];}return db[_0x0f84('0x85')][_0x0f84('0x5c')](_[_0x0f84('0x8e')](_0x3b4f47[_0x0f84('0x5d')],{'firstName':_0x1a7108,[_0x54ce14['mapKey']]:_0x1a7108,'phone':_0x1a7108,'ListId':_0x2dca2b[_0x0f84('0x79')]}));}})[_0x0f84('0x21')](handleEntityNotFound(_0x38aaee,null))[_0x0f84('0x21')](function(_0x4f97e4){if(_0x4f97e4){_0x4b7bb4=_0x4f97e4;return db[_0x0f84('0x94')][_0x0f84('0x5b')]({'where':{'ContactId':_0x4b7bb4['id'],'closed':![],'OpenchannelAccountId':_0x2dca2b['id']}})[_0x0f84('0x21')](function(_0x2de3d5){if(_0x2de3d5){return[_0x2de3d5,![]];}return db[_0x0f84('0x94')][_0x0f84('0x5c')]({'UserId':_0x3b4f47[_0x0f84('0x5e')]['id'],'ContactId':_0x4b7bb4['id'],'OpenchannelAccountId':_0x2dca2b['id'],'lastMsgDirection':_0x0f84('0xbd'),'Messages':[_[_0x0f84('0x50')](_0x3b4f47[_0x0f84('0x5d')],{'read':![],'body':_0x3b4f47[_0x0f84('0x5d')][_0x0f84('0x5d')],'OpenchannelAccountId':_0x2dca2b['id'],'UserId':_0x3b4f47[_0x0f84('0x5e')]['id'],'ContactId':_0x4b7bb4['id']})]},{'include':[{'model':db[_0x0f84('0x9e')],'as':_0x0f84('0xbe')}]})['then'](function(_0x20a7d2){return[_0x20a7d2,!![]];});});}})[_0x0f84('0xb6')](function(_0x28783c,_0x42a0d6){if(_0x42a0d6){return _0x28783c;}return db[_0x0f84('0x9e')][_0x0f84('0x5c')](_[_0x0f84('0x50')](_0x3b4f47[_0x0f84('0x5d')],{'read':![],'body':_0x3b4f47[_0x0f84('0x5d')][_0x0f84('0x5d')],'OpenchannelAccountId':_0x2dca2b['id'],'OpenchannelInteractionId':_0x28783c['id'],'UserId':_0x3b4f47[_0x0f84('0x5e')]['id'],'ContactId':_0x4b7bb4['id']}))[_0x0f84('0x21')](function(_0x470198){_0x28783c[_0x0f84('0xbf')]['Messages']=[];_0x28783c[_0x0f84('0xbf')][_0x0f84('0xbe')][_0x0f84('0x9a')](_0x470198[_0x0f84('0xbf')]);return _0x28783c;});});}})[_0x0f84('0x21')](respondWithResult(_0x38aaee,null))[_0x0f84('0x2b')](handleError(_0x38aaee,null));}; \ No newline at end of file +var _0x4337=['getApplications','getInteractions','Contact','User','Owner','fullname','internal','Tag','Tags','color','tag','addAgents','omit','removeAgents','emit','userOpenchannelAccount:remove','getAgents','defaults','out','Messages','push','dataValues','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','ioredis','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./openchannelAccount.socket','register','jayson/promise','client','http','request','then','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','error','message','result','catch','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','reject','get','OpenchannelAccounts','UserProfileResource','destroy','name','index','Pause','mandatoryDispositionPause','map','OpenchannelAccount','rawAttributes','type','query','intersection','model','attributes','length','nolimit','order','sort','where','filters','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','show','params','keys','fields','find','create','body','user','role','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','addDisposition','Disposition','getDispositions','findOne','hasOwnProperty','removeDispositions','ids','addAnswer','getAnswers','CannedAnswer','removeAnswers','notify','openchannel','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','isNil','from','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','DESC','OpenchannelApplication','Applications','account','applications','list','orderBy','priority','asc','Contacts','firstName','threadId','OpenchannelInteraction','spread','contact','lastName','messageId','interaction','created','close','AttachmentId','UserId','unshift','agent','forcedOwnership','Start','startRouting','EventManager','addApplications','sequelize','transaction','OpenchannelAccountId','bulkCreate','findAndCountAll'];(function(_0x45b6d6,_0x141b0b){var _0x34aa43=function(_0xca6a86){while(--_0xca6a86){_0x45b6d6['push'](_0x45b6d6['shift']());}};_0x34aa43(++_0x141b0b);}(_0x4337,0xcb));var _0x7433=function(_0x4d86e8,_0x140df9){_0x4d86e8=_0x4d86e8-0x0;var _0x45bafe=_0x4337[_0x4d86e8];return _0x45bafe;};'use strict';var emlformat=require(_0x7433('0x0'));var rimraf=require(_0x7433('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x7433('0x2'));var rp=require(_0x7433('0x3'));var moment=require(_0x7433('0x4'));var BPromise=require(_0x7433('0x5'));var Mustache=require(_0x7433('0x6'));var util=require(_0x7433('0x7'));var path=require(_0x7433('0x8'));var sox=require(_0x7433('0x9'));var csv=require(_0x7433('0xa'));var ejs=require(_0x7433('0xb'));var fs=require('fs');var fs_extra=require(_0x7433('0xc'));var _=require(_0x7433('0xd'));var squel=require(_0x7433('0xe'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x7433('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x7433('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7433('0x10'));var logger=require(_0x7433('0x11'))(_0x7433('0x12'));var utils=require(_0x7433('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x7433('0x14'));var db=require(_0x7433('0x15'))['db'];config[_0x7433('0x16')]=_['defaults'](config[_0x7433('0x16')],{'host':_0x7433('0x17'),'port':0x18eb});var socket=require(_0x7433('0x18'))(new Redis(config[_0x7433('0x16')]));require(_0x7433('0x19'))[_0x7433('0x1a')](socket);var jayson=require(_0x7433('0x1b'));var client=jayson[_0x7433('0x1c')][_0x7433('0x1d')]({'port':0x232c});var client9002=jayson[_0x7433('0x1c')][_0x7433('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x5943df,_0x597dd8,_0x561e25,_0x5bc6d0){return new BPromise(function(_0x5a2e89,_0x339d2a){var _0x3e280c=_0x5bc6d0||client;return _0x3e280c[_0x7433('0x1e')](_0x5943df,_0x561e25)[_0x7433('0x1f')](function(_0x4f2f25){logger[_0x7433('0x20')](_0x7433('0x21'),_0x597dd8,_0x7433('0x22'));logger[_0x7433('0x23')](_0x7433('0x24'),_0x597dd8,_0x7433('0x22'),JSON['stringify'](_0x4f2f25));if(_0x4f2f25[_0x7433('0x25')]){if(_0x4f2f25[_0x7433('0x25')]['code']===0x1f4){logger[_0x7433('0x25')](_0x7433('0x21'),_0x597dd8,_0x4f2f25[_0x7433('0x25')][_0x7433('0x26')]);return _0x339d2a(_0x4f2f25['error'][_0x7433('0x26')]);}logger[_0x7433('0x25')](_0x7433('0x21'),_0x597dd8,_0x4f2f25[_0x7433('0x25')][_0x7433('0x26')]);return _0x5a2e89(_0x4f2f25['error'][_0x7433('0x26')]);}else{logger[_0x7433('0x20')](_0x7433('0x21'),_0x597dd8,_0x7433('0x22'));_0x5a2e89(_0x4f2f25[_0x7433('0x27')][_0x7433('0x26')]);}})[_0x7433('0x28')](function(_0x4377b0){logger[_0x7433('0x25')](_0x7433('0x21'),_0x597dd8,_0x4377b0);_0x339d2a(_0x4377b0);});});}function respondWithStatusCode(_0x4558f1,_0x45306e){_0x45306e=_0x45306e||0xcc;return function(_0x3c0a46){if(_0x3c0a46){return _0x4558f1[_0x7433('0x29')](_0x45306e);}return _0x4558f1[_0x7433('0x2a')](_0x45306e)['end']();};}function respondWithResult(_0x318e21,_0x186087){_0x186087=_0x186087||0xc8;return function(_0x23c69d){if(_0x23c69d){return _0x318e21[_0x7433('0x2a')](_0x186087)[_0x7433('0x2b')](_0x23c69d);}};}function respondWithFilteredResult(_0x500917,_0x2e562b){return function(_0x3542d3){if(_0x3542d3){var _0x3ac19a=typeof _0x2e562b['offset']===_0x7433('0x2c')&&typeof _0x2e562b[_0x7433('0x2d')]==='undefined';var _0x433717=_0x3542d3[_0x7433('0x2e')];var _0x1295ff=_0x3ac19a?0x0:_0x2e562b[_0x7433('0x2f')];var _0x6c1d92=_0x3ac19a?_0x3542d3[_0x7433('0x2e')]:_0x2e562b[_0x7433('0x2f')]+_0x2e562b['limit'];var _0x122870;if(_0x6c1d92>=_0x433717){_0x6c1d92=_0x433717;_0x122870=0xc8;}else{_0x122870=0xce;}_0x500917[_0x7433('0x2a')](_0x122870);return _0x500917[_0x7433('0x30')](_0x7433('0x31'),_0x1295ff+'-'+_0x6c1d92+'/'+_0x433717)[_0x7433('0x2b')](_0x3542d3);}return null;};}function patchUpdates(_0x152563){return function(_0x290521){try{jsonpatch['apply'](_0x290521,_0x152563,!![]);}catch(_0x2ed44a){return BPromise[_0x7433('0x32')](_0x2ed44a);}return _0x290521['save']();};}function saveUpdates(_0x448cc1,_0x4b233f){return function(_0x227912){if(_0x227912){return _0x227912['update'](_0x448cc1)[_0x7433('0x1f')](function(_0x221e2f){return _0x221e2f;});}return null;};}function removeEntity(_0x592594,_0x594044){return function(_0x27bc1a){if(_0x27bc1a){return _0x27bc1a['destroy']()[_0x7433('0x1f')](function(){var _0x35f7fa=_0x27bc1a[_0x7433('0x33')]({'plain':!![]});var _0x56918c=_0x7433('0x34');return db[_0x7433('0x35')][_0x7433('0x36')]({'where':{'type':_0x56918c,'resourceId':_0x35f7fa['id']}})[_0x7433('0x1f')](function(){return _0x27bc1a;});})[_0x7433('0x1f')](function(){_0x592594['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3e794e,_0x3923de){return function(_0x20ccd6){if(!_0x20ccd6){_0x3e794e[_0x7433('0x29')](0x194);}return _0x20ccd6;};}function handleError(_0xa06645,_0x1bfd78){_0x1bfd78=_0x1bfd78||0x1f4;return function(_0x14237b){logger['error'](_0x14237b['stack']);if(_0x14237b[_0x7433('0x37')]){delete _0x14237b[_0x7433('0x37')];}_0xa06645[_0x7433('0x2a')](_0x1bfd78)['send'](_0x14237b);};}exports[_0x7433('0x38')]=function(_0x258fb7,_0x1d9e3b){var _0x380d24={'include':[{'model':db[_0x7433('0x39')],'as':_0x7433('0x3a')}]},_0x146039={},_0x16c54d={'count':0x0,'rows':[]};var _0x29e1f6=_[_0x7433('0x3b')](db[_0x7433('0x3c')][_0x7433('0x3d')],function(_0xca836c){return{'name':_0xca836c['fieldName'],'type':_0xca836c[_0x7433('0x3e')]['key']};});_0x146039['model']=_[_0x7433('0x3b')](_0x29e1f6,_0x7433('0x37'));_0x146039[_0x7433('0x3f')]=_['keys'](_0x258fb7[_0x7433('0x3f')]);_0x146039['filters']=_[_0x7433('0x40')](_0x146039[_0x7433('0x41')],_0x146039[_0x7433('0x3f')]);_0x380d24[_0x7433('0x42')]=_[_0x7433('0x40')](_0x146039[_0x7433('0x41')],qs['fields'](_0x258fb7[_0x7433('0x3f')]['fields']));_0x380d24[_0x7433('0x42')]=_0x380d24['attributes'][_0x7433('0x43')]?_0x380d24[_0x7433('0x42')]:_0x146039['model'];if(!_0x258fb7[_0x7433('0x3f')]['hasOwnProperty'](_0x7433('0x44'))){_0x380d24[_0x7433('0x2d')]=qs[_0x7433('0x2d')](_0x258fb7[_0x7433('0x3f')][_0x7433('0x2d')]);_0x380d24[_0x7433('0x2f')]=qs[_0x7433('0x2f')](_0x258fb7[_0x7433('0x3f')][_0x7433('0x2f')]);}_0x380d24[_0x7433('0x45')]=qs['sort'](_0x258fb7[_0x7433('0x3f')][_0x7433('0x46')]);_0x380d24[_0x7433('0x47')]=qs[_0x7433('0x48')](_[_0x7433('0x49')](_0x258fb7[_0x7433('0x3f')],_0x146039[_0x7433('0x48')]),_0x29e1f6);if(_0x258fb7[_0x7433('0x3f')][_0x7433('0x4a')]){_0x380d24[_0x7433('0x47')]=_['merge'](_0x380d24['where'],{'$or':_['map'](_0x29e1f6,function(_0x5d218b){if(_0x5d218b[_0x7433('0x3e')]!==_0x7433('0x4b')){var _0x251c60={};_0x251c60[_0x5d218b[_0x7433('0x37')]]={'$like':'%'+_0x258fb7[_0x7433('0x3f')][_0x7433('0x4a')]+'%'};return _0x251c60;}})});}_0x380d24=_[_0x7433('0x4c')]({},_0x380d24,_0x258fb7[_0x7433('0x4d')]);var _0x31ae82={'where':_0x380d24[_0x7433('0x47')]};return db[_0x7433('0x3c')][_0x7433('0x2e')](_0x31ae82)[_0x7433('0x1f')](function(_0x5bb84b){_0x16c54d['count']=_0x5bb84b;if(_0x258fb7[_0x7433('0x3f')][_0x7433('0x4e')]){_0x380d24[_0x7433('0x4f')]=[{'all':!![]}];}return db[_0x7433('0x3c')][_0x7433('0x50')](_0x380d24);})[_0x7433('0x1f')](function(_0x151a52){_0x16c54d[_0x7433('0x51')]=_0x151a52;return _0x16c54d;})['then'](respondWithFilteredResult(_0x1d9e3b,_0x380d24))[_0x7433('0x28')](handleError(_0x1d9e3b,null));};exports[_0x7433('0x52')]=function(_0x4bf853,_0x4b62cb){var _0x38b19f={'raw':![],'where':{'id':_0x4bf853[_0x7433('0x53')]['id']},'include':[{'model':db['Pause'],'as':_0x7433('0x3a')}]},_0x588c69={};_0x588c69[_0x7433('0x41')]=_[_0x7433('0x54')](db[_0x7433('0x3c')][_0x7433('0x3d')]);_0x588c69['query']=_[_0x7433('0x54')](_0x4bf853[_0x7433('0x3f')]);_0x588c69[_0x7433('0x48')]=_[_0x7433('0x40')](_0x588c69[_0x7433('0x41')],_0x588c69[_0x7433('0x3f')]);_0x38b19f[_0x7433('0x42')]=_[_0x7433('0x40')](_0x588c69[_0x7433('0x41')],qs[_0x7433('0x55')](_0x4bf853[_0x7433('0x3f')]['fields']));_0x38b19f['attributes']=_0x38b19f[_0x7433('0x42')]['length']?_0x38b19f[_0x7433('0x42')]:_0x588c69[_0x7433('0x41')];if(_0x4bf853[_0x7433('0x3f')][_0x7433('0x4e')]){_0x38b19f[_0x7433('0x4f')]=[{'all':!![]}];}_0x38b19f=_[_0x7433('0x4c')]({},_0x38b19f,_0x4bf853[_0x7433('0x4d')]);return db[_0x7433('0x3c')][_0x7433('0x56')](_0x38b19f)[_0x7433('0x1f')](handleEntityNotFound(_0x4b62cb,null))[_0x7433('0x1f')](respondWithResult(_0x4b62cb,null))[_0x7433('0x28')](handleError(_0x4b62cb,null));};exports[_0x7433('0x57')]=function(_0x23915c,_0x3d525b){return db[_0x7433('0x3c')][_0x7433('0x57')](_0x23915c[_0x7433('0x58')],{})[_0x7433('0x1f')](function(_0x5270b7){var _0x2be95f=_0x23915c[_0x7433('0x59')][_0x7433('0x33')]({'plain':!![]});if(!_0x2be95f)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2be95f[_0x7433('0x5a')]===_0x7433('0x59')){var _0x36a87c=_0x5270b7[_0x7433('0x33')]({'plain':!![]});var _0x2691bf=_0x7433('0x34');return db[_0x7433('0x5b')]['find']({'where':{'name':_0x2691bf,'userProfileId':_0x2be95f['userProfileId']},'raw':!![]})['then'](function(_0x28630e){if(_0x28630e&&_0x28630e['autoAssociation']===0x0){return db[_0x7433('0x35')]['create']({'name':_0x36a87c[_0x7433('0x37')],'resourceId':_0x36a87c['id'],'type':_0x28630e['name'],'sectionId':_0x28630e['id']},{})[_0x7433('0x1f')](function(){return _0x5270b7;});}else{return _0x5270b7;}})['catch'](function(_0x1a5352){logger[_0x7433('0x25')](_0x7433('0x5c'),_0x1a5352);throw _0x1a5352;});}return _0x5270b7;})[_0x7433('0x1f')](respondWithResult(_0x3d525b,0xc9))['catch'](handleError(_0x3d525b,null));};exports[_0x7433('0x5d')]=function(_0x3ef4e8,_0x21caf6){if(_0x3ef4e8[_0x7433('0x58')]['id']){delete _0x3ef4e8[_0x7433('0x58')]['id'];}return db[_0x7433('0x3c')][_0x7433('0x56')]({'where':{'id':_0x3ef4e8[_0x7433('0x53')]['id']},'include':[{'model':db[_0x7433('0x39')],'as':_0x7433('0x3a')}]})[_0x7433('0x1f')](handleEntityNotFound(_0x21caf6,null))[_0x7433('0x1f')](saveUpdates(_0x3ef4e8[_0x7433('0x58')],null))['then'](respondWithResult(_0x21caf6,null))[_0x7433('0x28')](handleError(_0x21caf6,null));};exports[_0x7433('0x36')]=function(_0x4ec29c,_0x38dac3){return db[_0x7433('0x3c')][_0x7433('0x56')]({'where':{'id':_0x4ec29c['params']['id']}})[_0x7433('0x1f')](handleEntityNotFound(_0x38dac3,null))[_0x7433('0x1f')](removeEntity(_0x38dac3,null))['catch'](handleError(_0x38dac3,null));};exports['describe']=function(_0x38fd9e,_0x2c93ca){return db['OpenchannelAccount'][_0x7433('0x5e')]()[_0x7433('0x1f')](respondWithResult(_0x2c93ca,null))[_0x7433('0x28')](handleError(_0x2c93ca,null));};exports[_0x7433('0x5f')]=function(_0x5333d1,_0x15c639,_0x26306d){if(_0x5333d1['body']['id']){delete _0x5333d1[_0x7433('0x58')]['id'];}return db['OpenchannelAccount'][_0x7433('0x56')]({'where':{'id':_0x5333d1[_0x7433('0x53')]['id']}})[_0x7433('0x1f')](handleEntityNotFound(_0x15c639,null))[_0x7433('0x1f')](function(_0x586868){if(_0x586868){_0x5333d1['body']['OpenchannelAccountId']=_0x586868['id'];return db[_0x7433('0x60')][_0x7433('0x57')](_0x5333d1[_0x7433('0x58')]);}})[_0x7433('0x1f')](respondWithResult(_0x15c639,null))['catch'](handleError(_0x15c639,null));};exports[_0x7433('0x61')]=function(_0x2701f4,_0x449f93,_0x304a69){var _0x22315f={'raw':![],'where':{}};var _0x3d30b7={};var _0x47435c={'count':0x0,'rows':[]};return db[_0x7433('0x3c')][_0x7433('0x62')]({'where':{'id':_0x2701f4[_0x7433('0x53')]['id']}})[_0x7433('0x1f')](handleEntityNotFound(_0x449f93,null))[_0x7433('0x1f')](function(_0x14a251){if(_0x14a251){_0x3d30b7[_0x7433('0x41')]=_[_0x7433('0x54')](db['Disposition'][_0x7433('0x3d')]);_0x3d30b7['query']=_[_0x7433('0x54')](_0x2701f4['query']);_0x3d30b7[_0x7433('0x48')]=_['intersection'](_0x3d30b7[_0x7433('0x41')],_0x3d30b7[_0x7433('0x3f')]);_0x22315f['attributes']=_[_0x7433('0x40')](_0x3d30b7['model'],qs['fields'](_0x2701f4['query'][_0x7433('0x55')]));_0x22315f['attributes']=_0x22315f[_0x7433('0x42')][_0x7433('0x43')]?_0x22315f[_0x7433('0x42')]:_0x3d30b7['model'];if(!_0x2701f4[_0x7433('0x3f')][_0x7433('0x63')](_0x7433('0x44'))){_0x22315f[_0x7433('0x2d')]=qs[_0x7433('0x2d')](_0x2701f4[_0x7433('0x3f')]['limit']);_0x22315f[_0x7433('0x2f')]=qs['offset'](_0x2701f4[_0x7433('0x3f')][_0x7433('0x2f')]);}_0x22315f[_0x7433('0x45')]=qs[_0x7433('0x46')](_0x2701f4[_0x7433('0x3f')][_0x7433('0x46')]);_0x22315f[_0x7433('0x47')]=qs[_0x7433('0x48')](_['pick'](_0x2701f4['query'],_0x3d30b7[_0x7433('0x48')]));_0x22315f[_0x7433('0x47')]['OpenchannelAccountId']=_0x14a251['id'];if(_0x2701f4[_0x7433('0x3f')]['filter']){_0x22315f[_0x7433('0x47')]=_[_0x7433('0x4c')](_0x22315f[_0x7433('0x47')],{'$or':_[_0x7433('0x3b')](_0x22315f['attributes'],function(_0x30fc58){var _0x43451d={};_0x43451d[_0x30fc58]={'$like':'%'+_0x2701f4[_0x7433('0x3f')][_0x7433('0x4a')]+'%'};return _0x43451d;})});}_0x22315f=_[_0x7433('0x4c')]({},_0x22315f,_0x2701f4[_0x7433('0x4d')]);return db[_0x7433('0x60')][_0x7433('0x2e')]({'where':_0x22315f[_0x7433('0x47')]})[_0x7433('0x1f')](function(_0x1b2228){_0x47435c['count']=_0x1b2228;if(_0x2701f4[_0x7433('0x3f')][_0x7433('0x4e')]){_0x22315f[_0x7433('0x4f')]=[{'all':!![]}];}return db[_0x7433('0x60')][_0x7433('0x50')](_0x22315f);})['then'](function(_0x275514){_0x47435c['rows']=_0x275514;return _0x47435c;});}})[_0x7433('0x1f')](respondWithFilteredResult(_0x449f93,_0x22315f))[_0x7433('0x28')](handleError(_0x449f93,null));};exports[_0x7433('0x64')]=function(_0x12a5a1,_0x169f3b,_0x21add8){return db['OpenchannelAccount'][_0x7433('0x56')]({'where':{'id':_0x12a5a1['params']['id']}})[_0x7433('0x1f')](handleEntityNotFound(_0x169f3b,null))[_0x7433('0x1f')](function(_0x2dfc44){if(_0x2dfc44){return _0x2dfc44[_0x7433('0x64')](_0x12a5a1[_0x7433('0x3f')][_0x7433('0x65')]);}})['then'](respondWithStatusCode(_0x169f3b,null))[_0x7433('0x28')](handleError(_0x169f3b,null));};exports[_0x7433('0x66')]=function(_0x541fa5,_0x308557,_0x272311){if(_0x541fa5['body']['id']){delete _0x541fa5['body']['id'];}return db[_0x7433('0x3c')]['find']({'where':{'id':_0x541fa5['params']['id']}})[_0x7433('0x1f')](handleEntityNotFound(_0x308557,null))[_0x7433('0x1f')](function(_0x4f7362){if(_0x4f7362){_0x541fa5['body']['OpenchannelAccountId']=_0x4f7362['id'];return db['CannedAnswer'][_0x7433('0x57')](_0x541fa5['body']);}})['then'](respondWithResult(_0x308557,null))['catch'](handleError(_0x308557,null));};exports[_0x7433('0x67')]=function(_0x37b70a,_0x2b9693,_0x21798a){var _0x2e0dbe={'raw':![],'where':{}};var _0x1007da={};var _0x37e894={'count':0x0,'rows':[]};return db[_0x7433('0x3c')][_0x7433('0x62')]({'where':{'id':_0x37b70a['params']['id']}})[_0x7433('0x1f')](handleEntityNotFound(_0x2b9693,null))[_0x7433('0x1f')](function(_0x20bc68){if(_0x20bc68){_0x1007da[_0x7433('0x41')]=_[_0x7433('0x54')](db[_0x7433('0x68')][_0x7433('0x3d')]);_0x1007da[_0x7433('0x3f')]=_[_0x7433('0x54')](_0x37b70a[_0x7433('0x3f')]);_0x1007da[_0x7433('0x48')]=_[_0x7433('0x40')](_0x1007da[_0x7433('0x41')],_0x1007da[_0x7433('0x3f')]);_0x2e0dbe['attributes']=_[_0x7433('0x40')](_0x1007da['model'],qs['fields'](_0x37b70a[_0x7433('0x3f')][_0x7433('0x55')]));_0x2e0dbe[_0x7433('0x42')]=_0x2e0dbe[_0x7433('0x42')][_0x7433('0x43')]?_0x2e0dbe[_0x7433('0x42')]:_0x1007da['model'];if(!_0x37b70a[_0x7433('0x3f')][_0x7433('0x63')]('nolimit')){_0x2e0dbe[_0x7433('0x2d')]=qs[_0x7433('0x2d')](_0x37b70a[_0x7433('0x3f')][_0x7433('0x2d')]);_0x2e0dbe[_0x7433('0x2f')]=qs[_0x7433('0x2f')](_0x37b70a['query']['offset']);}_0x2e0dbe[_0x7433('0x45')]=qs['sort'](_0x37b70a['query'][_0x7433('0x46')]);_0x2e0dbe['where']=qs[_0x7433('0x48')](_['pick'](_0x37b70a[_0x7433('0x3f')],_0x1007da['filters']));_0x2e0dbe['where']['OpenchannelAccountId']=_0x20bc68['id'];if(_0x37b70a[_0x7433('0x3f')][_0x7433('0x4a')]){_0x2e0dbe[_0x7433('0x47')]=_[_0x7433('0x4c')](_0x2e0dbe[_0x7433('0x47')],{'$or':_['map'](_0x2e0dbe['attributes'],function(_0x535269){var _0x9631d6={};_0x9631d6[_0x535269]={'$like':'%'+_0x37b70a['query'][_0x7433('0x4a')]+'%'};return _0x9631d6;})});}_0x2e0dbe=_['merge']({},_0x2e0dbe,_0x37b70a[_0x7433('0x4d')]);return db[_0x7433('0x68')]['count']({'where':_0x2e0dbe[_0x7433('0x47')]})[_0x7433('0x1f')](function(_0x5a7654){_0x37e894[_0x7433('0x2e')]=_0x5a7654;if(_0x37b70a['query'][_0x7433('0x4e')]){_0x2e0dbe['include']=[{'all':!![]}];}return db[_0x7433('0x68')][_0x7433('0x50')](_0x2e0dbe);})[_0x7433('0x1f')](function(_0x4d5f65){_0x37e894[_0x7433('0x51')]=_0x4d5f65;return _0x37e894;});}})[_0x7433('0x1f')](respondWithFilteredResult(_0x2b9693,_0x2e0dbe))['catch'](handleError(_0x2b9693,null));};exports[_0x7433('0x69')]=function(_0x590a3f,_0x502c7f,_0x24c839){return db['OpenchannelAccount']['find']({'where':{'id':_0x590a3f['params']['id']}})[_0x7433('0x1f')](handleEntityNotFound(_0x502c7f,null))['then'](function(_0x34b0a2){if(_0x34b0a2){return _0x34b0a2[_0x7433('0x69')](_0x590a3f[_0x7433('0x3f')][_0x7433('0x65')]);}})[_0x7433('0x1f')](respondWithStatusCode(_0x502c7f,null))[_0x7433('0x28')](handleError(_0x502c7f,null));};exports[_0x7433('0x6a')]=function(_0x584b77,_0x5741f3,_0x3df5cd){var _0xe8352e={'body':_0x584b77[_0x7433('0x58')],'channel':_0x7433('0x6b')};var _0x477375=[];var _0x4be4b5=[];var _0x424003={};var _0x253f4e=![];return db[_0x7433('0x6c')][_0x7433('0x5e')]()['then'](function(_0x4640d1){if(!_0x4640d1){throw new db[(_0x7433('0x6d'))][(_0x7433('0x6e'))](_0x7433('0x6f'));}_0x477375=_[_0x7433('0x70')](_[_0x7433('0x54')](_0x4640d1),[_0x7433('0x71'),_0x7433('0x72')]);_0x4be4b5=_[_0x7433('0x70')](_['keys'](_0x4640d1),['createdAt',_0x7433('0x72'),_0x7433('0x73'),_0x7433('0x74')]);if(_0x584b77[_0x7433('0x58')]['id']){delete _0x584b77['body']['id'];}if(_[_0x7433('0x75')](_0x584b77[_0x7433('0x58')][_0x7433('0x76')])){throw new db[(_0x7433('0x6d'))][(_0x7433('0x6e'))]('from\x20is\x20mandatory');}if(_[_0x7433('0x75')](_0x584b77[_0x7433('0x58')]['body'])||_0x584b77[_0x7433('0x58')][_0x7433('0x58')]===''){throw new db[(_0x7433('0x6d'))][(_0x7433('0x6e'))](_0x7433('0x77'));}if(_[_0x7433('0x75')](_0x584b77[_0x7433('0x58')][_0x7433('0x78')])){throw new db[(_0x7433('0x6d'))]['ValidationError']('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x4be4b5);}if(!_[_0x7433('0x79')](_0x4be4b5,_0x584b77[_0x7433('0x58')][_0x7433('0x78')])){throw new db[(_0x7433('0x6d'))][(_0x7433('0x6e'))](_0x7433('0x7a')+_0x4be4b5);}_0x424003[_0x584b77[_0x7433('0x58')][_0x7433('0x78')]]=_0x584b77[_0x7433('0x58')]['from'];})[_0x7433('0x1f')](function(){return db[_0x7433('0x3c')][_0x7433('0x56')]({'where':{'id':_0x584b77[_0x7433('0x53')]['id']},'include':[{'model':db[_0x7433('0x7b')],'as':_0x7433('0x7c'),'include':[{'model':db['CmContact'],'as':'Contacts','where':_0x424003,'limit':0x1,'order':[[_0x7433('0x72'),_0x7433('0x7d')]]}]},{'model':db[_0x7433('0x7e')],'as':_0x7433('0x7f')}]});})[_0x7433('0x1f')](handleEntityNotFound(_0x5741f3,null))[_0x7433('0x1f')](function(_0x2fcc1a){if(_0x2fcc1a&&_0x2fcc1a[_0x7433('0x7c')]){_0xe8352e[_0x7433('0x80')]=_0x2fcc1a;_0xe8352e[_0x7433('0x81')]=_0x2fcc1a[_0x7433('0x7f')];_0xe8352e[_0x7433('0x82')]=_0x2fcc1a['List'];_0xe8352e[_0x7433('0x81')]=_[_0x7433('0x83')](_0xe8352e[_0x7433('0x81')],[_0x7433('0x84')],[_0x7433('0x85')]);if(_0xe8352e[_0x7433('0x80')]['Applications']){delete _0xe8352e[_0x7433('0x80')]['Applications'];}if(_0xe8352e[_0x7433('0x80')][_0x7433('0x7c')]&&_0xe8352e['account'][_0x7433('0x7c')][_0x7433('0x86')]['length']){return _0xe8352e['account']['List'][_0x7433('0x86')][0x0];}var _0x1840e7=_['defaults'](_0x584b77[_0x7433('0x58')],{'firstName':_0x584b77[_0x7433('0x58')][_0x7433('0x76')],'ListId':_0x2fcc1a['ListId']});_0x1840e7[_0x584b77[_0x7433('0x58')]['mapKey']]=_0x584b77['body'][_0x7433('0x76')];return db[_0x7433('0x6c')]['create'](_0x1840e7,{'fields':_0x477375,'raw':!![]});}})['then'](handleEntityNotFound(_0x5741f3,null))[_0x7433('0x1f')](function(_0x4e12bb){_0xe8352e['contact']=_0x4e12bb;if(_0x4e12bb){var _0x21c825={'ContactId':_0x4e12bb['id'],'OpenchannelAccountId':_0x584b77[_0x7433('0x53')]['id'],'from':(_0x4e12bb[_0x7433('0x87')]||'')+'\x20'+(_0x4e12bb['lastName']||'')};var _0x1f21e7={'OpenchannelAccountId':_0x584b77[_0x7433('0x53')]['id'],'closed':![]};if(_0x584b77[_0x7433('0x58')]['threadId']){_0x1f21e7[_0x7433('0x88')]=_0x584b77['body'][_0x7433('0x88')];return db[_0x7433('0x89')][_0x7433('0x56')]({'where':_0x1f21e7})['then'](function(_0x549842){if(_0x549842){return[_0x549842,![]];}_0x21c825[_0x7433('0x88')]=_0x584b77[_0x7433('0x58')][_0x7433('0x88')];_0x21c825['externalUrl']=_0x584b77['body']['externalUrl'];return db['OpenchannelInteraction']['create'](_0x21c825)['then'](function(_0x481e3c){return[_0x481e3c,!![]];});});}else{_0x1f21e7['threadId']=null;}_0x1f21e7['ContactId']=_0x4e12bb['id'];return db['OpenchannelInteraction'][_0x7433('0x56')]({'where':_0x1f21e7})[_0x7433('0x1f')](function(_0x5e5c03){if(_0x5e5c03){return[_0x5e5c03,![]];}return db['OpenchannelInteraction'][_0x7433('0x57')](_0x21c825)[_0x7433('0x1f')](function(_0x14f967){return[_0x14f967,!![]];});});}})[_0x7433('0x8a')](function(_0x297d99,_0x22e8e7){if(_0x297d99){_0x253f4e=_0x22e8e7;if(!_0x22e8e7){var _0x5a4d1e={'from':(_0xe8352e['contact'][_0x7433('0x87')]||'')+'\x20'+(_0xe8352e[_0x7433('0x8b')][_0x7433('0x8c')]||'')};if(_0x584b77[_0x7433('0x58')][_0x7433('0x88')]&&_0x584b77['body']['messageId']&&_0x584b77[_0x7433('0x58')][_0x7433('0x88')]!=_0x584b77[_0x7433('0x58')][_0x7433('0x8d')]){_0x5a4d1e[_0x7433('0x88')]=_0x584b77[_0x7433('0x58')][_0x7433('0x8d')];}return _0x297d99[_0x7433('0x5d')](_0x5a4d1e);}else{return _0x297d99;}}})[_0x7433('0x1f')](function(_0x3a4f8e){_0xe8352e[_0x7433('0x8e')]=_0x3a4f8e[_0x7433('0x33')]({'plain':!![]});_0xe8352e['interaction'][_0x7433('0x8f')]=_0x253f4e;if(_0xe8352e[_0x7433('0x8e')][_0x7433('0x8f')]){if(_0xe8352e[_0x7433('0x80')]['autoclose']){_0xe8352e[_0x7433('0x81')]['push']({'id':0x0,'priority':_0xe8352e[_0x7433('0x81')][_0x7433('0x43')]+0x1,'app':_0x7433('0x90'),'appdata':'unmanaged','interval':'*,*,*,*'});}}return db['OpenchannelMessage'][_0x7433('0x57')]({'body':_0x584b77[_0x7433('0x58')][_0x7433('0x58')],'OpenchannelAccountId':_0x584b77[_0x7433('0x53')]['id'],'OpenchannelInteractionId':_0x3a4f8e['id'],'direction':'in','ContactId':_0xe8352e[_0x7433('0x8b')]['id'],'AttachmentId':_0x584b77[_0x7433('0x58')][_0x7433('0x91')]});})['then'](function(_0x2f8035){_0xe8352e[_0x7433('0x26')]=_0x2f8035;if(_0xe8352e['interaction'][_0x7433('0x92')]){return db['User'][_0x7433('0x56')]({'attributes':['id','name'],'where':{'id':_0xe8352e['interaction'][_0x7433('0x92')]}})['then'](function(_0x4514e0){if(_0x4514e0){_0xe8352e['applications'][_0x7433('0x93')]({'id':0x0,'priority':0x0,'app':_0x7433('0x94'),'appdata':_0x4514e0[_0x7433('0x37')]+','+(_0xe8352e[_0x7433('0x80')]['waitForTheAssignedAgent']||0xa),'interval':'*,*,*,*'});_0xe8352e[_0x7433('0x95')]=![];}return respondWithRpcPromise('Start','startRouting',_0xe8352e);});}return respondWithRpcPromise(_0x7433('0x96'),_0x7433('0x97'),_0xe8352e);})['then'](function(_0x1941a0){respondWithRpcPromise(_0x7433('0x98'),'EventManager',{'event':_0x7433('0x6a'),'message':_0x1941a0},client9002);return _0x1941a0;})['then'](respondWithResult(_0x5741f3,null))[_0x7433('0x28')](handleError(_0x5741f3,null));};exports[_0x7433('0x99')]=function(_0x4978cf,_0x2ce292,_0x1012fa){return db[_0x7433('0x3c')][_0x7433('0x62')]({'where':{'id':_0x4978cf['params']['id']}})[_0x7433('0x1f')](handleEntityNotFound(_0x2ce292,null))[_0x7433('0x1f')](function(_0x7fe1fe){if(_0x7fe1fe){return db[_0x7433('0x9a')][_0x7433('0x9b')](function(_0xf69823){return db[_0x7433('0x7e')][_0x7433('0x36')]({'where':{'OpenchannelAccountId':_0x4978cf[_0x7433('0x53')]['id']},'transaction':_0xf69823})[_0x7433('0x1f')](function(_0x72322e){var _0x2ac791=_['map'](_0x4978cf['body'],function(_0x3952b7){_0x3952b7[_0x7433('0x9c')]=_0x4978cf[_0x7433('0x53')]['id'];return _0x3952b7;});return db['OpenchannelApplication'][_0x7433('0x9d')](_0x2ac791,{'transaction':_0xf69823});});})[_0x7433('0x1f')](function(){return db[_0x7433('0x7e')][_0x7433('0x9e')]({'where':{'OpenchannelAccountId':_0x4978cf[_0x7433('0x53')]['id']},'order':_0x7433('0x84')});});}})[_0x7433('0x1f')](respondWithResult(_0x2ce292,null))['catch'](handleError(_0x2ce292,null));};exports[_0x7433('0x9f')]=function(_0x1e9e04,_0x387055,_0x2479ff){var _0x3a6c32={};var _0x3e28eb={};var _0x4e8f1e;var _0xe5a328;return db['OpenchannelAccount'][_0x7433('0x62')]({'where':{'id':_0x1e9e04[_0x7433('0x53')]['id']}})[_0x7433('0x1f')](handleEntityNotFound(_0x387055,null))[_0x7433('0x1f')](function(_0x3e964c){if(_0x3e964c){_0x4e8f1e=_0x3e964c;_0x3e28eb[_0x7433('0x41')]=_[_0x7433('0x54')](db[_0x7433('0x7e')][_0x7433('0x3d')]);_0x3e28eb[_0x7433('0x3f')]=_[_0x7433('0x54')](_0x1e9e04['query']);_0x3e28eb[_0x7433('0x48')]=_['intersection'](_0x3e28eb[_0x7433('0x41')],_0x3e28eb[_0x7433('0x3f')]);_0x3a6c32[_0x7433('0x42')]=_[_0x7433('0x40')](_0x3e28eb[_0x7433('0x41')],qs[_0x7433('0x55')](_0x1e9e04[_0x7433('0x3f')][_0x7433('0x55')]));_0x3a6c32[_0x7433('0x42')]=_0x3a6c32['attributes'][_0x7433('0x43')]?_0x3a6c32[_0x7433('0x42')]:_0x3e28eb[_0x7433('0x41')];_0x3a6c32[_0x7433('0x45')]=qs[_0x7433('0x46')](_0x1e9e04['query'][_0x7433('0x46')]);_0x3a6c32[_0x7433('0x47')]=qs[_0x7433('0x48')](_[_0x7433('0x49')](_0x1e9e04[_0x7433('0x3f')],_0x3e28eb[_0x7433('0x48')]));if(_0x1e9e04[_0x7433('0x3f')][_0x7433('0x4a')]){_0x3a6c32[_0x7433('0x47')]=_[_0x7433('0x4c')](_0x3a6c32[_0x7433('0x47')],{'$or':_[_0x7433('0x3b')](_0x3a6c32['attributes'],function(_0xb414f4){var _0x4ee72a={};_0x4ee72a[_0xb414f4]={'$like':'%'+_0x1e9e04['query'][_0x7433('0x4a')]+'%'};return _0x4ee72a;})});}_0x3a6c32=_[_0x7433('0x4c')]({},_0x3a6c32,_0x1e9e04[_0x7433('0x4d')]);return _0x4e8f1e[_0x7433('0x9f')](_0x3a6c32);}})[_0x7433('0x1f')](function(_0x1c9f52){if(_0x1c9f52){_0xe5a328=_0x1c9f52['length'];if(!_0x1e9e04[_0x7433('0x3f')][_0x7433('0x63')]('nolimit')){_0x3a6c32[_0x7433('0x2d')]=qs[_0x7433('0x2d')](_0x1e9e04['query'][_0x7433('0x2d')]);_0x3a6c32[_0x7433('0x2f')]=qs[_0x7433('0x2f')](_0x1e9e04[_0x7433('0x3f')][_0x7433('0x2f')]);}return _0x4e8f1e[_0x7433('0x9f')](_0x3a6c32);}})['then'](function(_0x270369){if(_0x270369){return _0x270369?{'count':_0xe5a328,'rows':_0x270369}:null;}})[_0x7433('0x1f')](respondWithResult(_0x387055,null))[_0x7433('0x28')](handleError(_0x387055,null));};exports[_0x7433('0xa0')]=function(_0xcb91be,_0x2c0dc5,_0x551b66){var _0x2b776b={'raw':![],'where':{}};var _0x560ef8={};var _0xa56aad={'count':0x0,'rows':[]};return db[_0x7433('0x3c')][_0x7433('0x62')]({'where':{'id':_0xcb91be['params']['id']}})[_0x7433('0x1f')](handleEntityNotFound(_0x2c0dc5,null))[_0x7433('0x1f')](function(_0x358496){if(_0x358496){_0x560ef8[_0x7433('0x41')]=_[_0x7433('0x54')](db[_0x7433('0x89')][_0x7433('0x3d')]);_0x560ef8[_0x7433('0x3f')]=_['keys'](_0xcb91be[_0x7433('0x3f')]);_0x560ef8[_0x7433('0x48')]=_['intersection'](_0x560ef8[_0x7433('0x41')],_0x560ef8[_0x7433('0x3f')]);_0x2b776b[_0x7433('0x42')]=_[_0x7433('0x40')](_0x560ef8['model'],qs[_0x7433('0x55')](_0xcb91be[_0x7433('0x3f')]['fields']));_0x2b776b[_0x7433('0x42')]=_0x2b776b[_0x7433('0x42')][_0x7433('0x43')]?_0x2b776b[_0x7433('0x42')]:_0x560ef8[_0x7433('0x41')];if(!_0xcb91be[_0x7433('0x3f')]['hasOwnProperty']('nolimit')){_0x2b776b[_0x7433('0x2d')]=qs[_0x7433('0x2d')](_0xcb91be[_0x7433('0x3f')][_0x7433('0x2d')]);_0x2b776b[_0x7433('0x2f')]=qs[_0x7433('0x2f')](_0xcb91be[_0x7433('0x3f')][_0x7433('0x2f')]);}_0x2b776b[_0x7433('0x45')]=qs[_0x7433('0x46')](_0xcb91be[_0x7433('0x3f')]['sort']);_0x2b776b[_0x7433('0x47')]=qs[_0x7433('0x48')](_[_0x7433('0x49')](_0xcb91be[_0x7433('0x3f')],_0x560ef8[_0x7433('0x48')]));_0x2b776b[_0x7433('0x47')][_0x7433('0x9c')]=_0x358496['id'];if(_0xcb91be[_0x7433('0x3f')]['filter']){_0x2b776b[_0x7433('0x47')]=_[_0x7433('0x4c')](_0x2b776b[_0x7433('0x47')],{'$or':_[_0x7433('0x3b')](_0x2b776b['attributes'],function(_0x4eea13){var _0x1b4287={};_0x1b4287[_0x4eea13]={'$like':'%'+_0xcb91be['query'][_0x7433('0x4a')]+'%'};return _0x1b4287;})});}_0x2b776b=_['merge']({},_0x2b776b,_0xcb91be[_0x7433('0x4d')]);return db[_0x7433('0x89')][_0x7433('0x2e')]({'where':_0x2b776b[_0x7433('0x47')]})[_0x7433('0x1f')](function(_0x3ab706){_0xa56aad[_0x7433('0x2e')]=_0x3ab706;if(_0xcb91be[_0x7433('0x3f')][_0x7433('0x4e')]){_0x2b776b[_0x7433('0x4f')]=[{'model':db['CmContact'],'as':_0x7433('0xa1'),'required':![]},{'model':db[_0x7433('0xa2')],'as':_0x7433('0xa3'),'attributes':['name',_0x7433('0xa4'),_0x7433('0xa5')],'required':![]},{'model':db[_0x7433('0xa6')],'as':_0x7433('0xa7'),'attributes':['id',_0x7433('0x37'),_0x7433('0xa8')],'where':_0xcb91be[_0x7433('0x3f')][_0x7433('0xa9')]?{'id':_0xcb91be['query'][_0x7433('0xa9')]}:undefined,'required':_0xcb91be['query']['tag']?!![]:![]}];}return db[_0x7433('0x89')][_0x7433('0x50')](_0x2b776b);})[_0x7433('0x1f')](function(_0x492b6a){_0xa56aad[_0x7433('0x51')]=_0x492b6a;return _0xa56aad;});}})[_0x7433('0x1f')](respondWithFilteredResult(_0x2c0dc5,_0x2b776b))[_0x7433('0x28')](handleError(_0x2c0dc5,null));};exports['addAgents']=function(_0x11faae,_0x2a2280,_0x3a3b0a){return db[_0x7433('0x3c')][_0x7433('0x56')]({'where':{'id':_0x11faae[_0x7433('0x53')]['id']}})[_0x7433('0x1f')](handleEntityNotFound(_0x2a2280,null))[_0x7433('0x1f')](function(_0x5a4e4b){if(_0x5a4e4b){return _0x5a4e4b[_0x7433('0xaa')](_0x11faae['body'][_0x7433('0x65')],_[_0x7433('0xab')](_0x11faae[_0x7433('0x58')],[_0x7433('0x65'),'id'])||{})[_0x7433('0x8a')](function(_0x8f8262){for(var _0x5ace73=0x0;_0x5ace73<_0x11faae[_0x7433('0x58')][_0x7433('0x65')][_0x7433('0x43')];_0x5ace73+=0x1){socket['emit']('userOpenchannelAccount:save',{'UserId':Number(_0x11faae[_0x7433('0x58')][_0x7433('0x65')][_0x5ace73]),'OpenchannelAccountId':Number(_0x11faae[_0x7433('0x53')]['id'])});}return _0x8f8262;});}})[_0x7433('0x1f')](respondWithResult(_0x2a2280,null))[_0x7433('0x28')](handleError(_0x2a2280,null));};exports['removeAgents']=function(_0x49cd9a,_0x57654d,_0x10f018){return db[_0x7433('0x3c')][_0x7433('0x56')]({'where':{'id':_0x49cd9a['params']['id']}})['then'](handleEntityNotFound(_0x57654d,null))[_0x7433('0x1f')](function(_0x44e0c9){if(_0x44e0c9){return _0x44e0c9[_0x7433('0xac')](_0x49cd9a[_0x7433('0x3f')][_0x7433('0x65')])[_0x7433('0x1f')](function(){if(_['isArray'](_0x49cd9a['query'][_0x7433('0x65')])){for(var _0x221a85=0x0;_0x221a85<_0x49cd9a['query'][_0x7433('0x65')][_0x7433('0x43')];_0x221a85+=0x1){socket[_0x7433('0xad')](_0x7433('0xae'),{'UserId':Number(_0x49cd9a[_0x7433('0x3f')][_0x7433('0x65')][_0x221a85]),'OpenchannelAccountId':Number(_0x49cd9a['params']['id'])});}}else{socket[_0x7433('0xad')](_0x7433('0xae'),{'UserId':Number(_0x49cd9a['query'][_0x7433('0x65')]),'OpenchannelAccountId':Number(_0x49cd9a[_0x7433('0x53')]['id'])});}});}})[_0x7433('0x1f')](respondWithStatusCode(_0x57654d,null))['catch'](handleError(_0x57654d,null));};exports[_0x7433('0xaf')]=function(_0x596f47,_0x3be8bc,_0x4e7727){var _0x129551={};var _0x5c2df6={};var _0x3101bb;var _0x4b5d50;return db[_0x7433('0x3c')][_0x7433('0x62')]({'where':{'id':_0x596f47[_0x7433('0x53')]['id']}})[_0x7433('0x1f')](handleEntityNotFound(_0x3be8bc,null))['then'](function(_0x34300d){if(_0x34300d){_0x3101bb=_0x34300d;_0x5c2df6[_0x7433('0x41')]=_[_0x7433('0x54')](db[_0x7433('0xa2')]['rawAttributes']);_0x5c2df6[_0x7433('0x3f')]=_[_0x7433('0x54')](_0x596f47[_0x7433('0x3f')]);_0x5c2df6['filters']=_[_0x7433('0x40')](_0x5c2df6[_0x7433('0x41')],_0x5c2df6[_0x7433('0x3f')]);_0x129551['attributes']=_[_0x7433('0x40')](_0x5c2df6[_0x7433('0x41')],qs['fields'](_0x596f47['query'][_0x7433('0x55')]));_0x129551['attributes']=_0x129551[_0x7433('0x42')]['length']?_0x129551[_0x7433('0x42')]:_0x5c2df6[_0x7433('0x41')];_0x129551[_0x7433('0x45')]=qs[_0x7433('0x46')](_0x596f47[_0x7433('0x3f')][_0x7433('0x46')]);_0x129551[_0x7433('0x47')]=qs[_0x7433('0x48')](_[_0x7433('0x49')](_0x596f47[_0x7433('0x3f')],_0x5c2df6[_0x7433('0x48')]));if(_0x596f47[_0x7433('0x3f')][_0x7433('0x4a')]){_0x129551[_0x7433('0x47')]=_[_0x7433('0x4c')](_0x129551['where'],{'$or':_[_0x7433('0x3b')](_0x129551[_0x7433('0x42')],function(_0x5f0f2f){var _0x28fee2={};_0x28fee2[_0x5f0f2f]={'$like':'%'+_0x596f47['query']['filter']+'%'};return _0x28fee2;})});}_0x129551=_['merge']({},_0x129551,_0x596f47[_0x7433('0x4d')]);return _0x3101bb[_0x7433('0xaf')](_0x129551);}})['then'](function(_0x436420){if(_0x436420){_0x4b5d50=_0x436420[_0x7433('0x43')];if(!_0x596f47[_0x7433('0x3f')][_0x7433('0x63')](_0x7433('0x44'))){_0x129551['limit']=qs[_0x7433('0x2d')](_0x596f47[_0x7433('0x3f')][_0x7433('0x2d')]);_0x129551[_0x7433('0x2f')]=qs[_0x7433('0x2f')](_0x596f47[_0x7433('0x3f')]['offset']);}return _0x3101bb['getAgents'](_0x129551);}})['then'](function(_0x2216ba){if(_0x2216ba){return _0x2216ba?{'count':_0x4b5d50,'rows':_0x2216ba}:null;}})[_0x7433('0x1f')](respondWithResult(_0x3be8bc,null))[_0x7433('0x28')](handleError(_0x3be8bc,null));};exports['send']=function(_0x371425,_0x48e588,_0x41279e){var _0x15dc85,_0x488098,_0x35e5b6;if(_[_0x7433('0x75')](_0x371425[_0x7433('0x58')][_0x7433('0x58')])||_0x371425[_0x7433('0x58')][_0x7433('0x58')]===''){throw new db[(_0x7433('0x6d'))][(_0x7433('0x6e'))](_0x7433('0x77'));}if(_[_0x7433('0x75')](_0x371425[_0x7433('0x58')]['to'])){}_0x15dc85=_0x371425[_0x7433('0x58')]['to'];return db[_0x7433('0x3c')][_0x7433('0x62')]({'where':{'id':_0x371425[_0x7433('0x53')]['id']}})['then'](handleEntityNotFound(_0x48e588,null))[_0x7433('0x1f')](function(_0xb5fa88){if(_0xb5fa88){return db['OpenchannelAccount'][_0x7433('0x56')]({'where':{'id':_0xb5fa88['id']},'include':[{'model':db['CmList'],'as':_0x7433('0x7c'),'include':[{'model':db[_0x7433('0x6c')],'as':_0x7433('0x86'),'where':{[_0xb5fa88[_0x7433('0x78')]]:_0x15dc85},'limit':0x1,'order':[[_0x7433('0x72'),_0x7433('0x7d')]]}]}]})[_0x7433('0x1f')](handleEntityNotFound(_0x48e588,null))[_0x7433('0x1f')](function(_0x4d9ffa){if(_0x4d9ffa&&_0x4d9ffa[_0x7433('0x7c')]){_0x488098=_0x4d9ffa[_0x7433('0x33')]({'plain':!![]});if(_0x488098['List']&&_0x488098[_0x7433('0x7c')][_0x7433('0x86')][_0x7433('0x43')]){return _0x488098[_0x7433('0x7c')]['Contacts'][0x0];}return db[_0x7433('0x6c')][_0x7433('0x57')](_[_0x7433('0xb0')](_0x371425[_0x7433('0x58')],{'firstName':_0x15dc85,[_0x4d9ffa[_0x7433('0x78')]]:_0x15dc85,'phone':_0x15dc85,'ListId':_0x488098['ListId']}));}})[_0x7433('0x1f')](handleEntityNotFound(_0x48e588,null))[_0x7433('0x1f')](function(_0x5a3eee){if(_0x5a3eee){_0x35e5b6=_0x5a3eee;return db[_0x7433('0x89')]['find']({'where':{'ContactId':_0x35e5b6['id'],'closed':![],'OpenchannelAccountId':_0x488098['id']}})[_0x7433('0x1f')](function(_0x17958e){if(_0x17958e){return[_0x17958e,![]];}return db['OpenchannelInteraction'][_0x7433('0x57')]({'UserId':_0x371425['user']['id'],'ContactId':_0x35e5b6['id'],'OpenchannelAccountId':_0x488098['id'],'lastMsgDirection':_0x7433('0xb1'),'Messages':[_[_0x7433('0x4c')](_0x371425[_0x7433('0x58')],{'read':![],'body':_0x371425[_0x7433('0x58')][_0x7433('0x58')],'OpenchannelAccountId':_0x488098['id'],'UserId':_0x371425[_0x7433('0x59')]['id'],'ContactId':_0x35e5b6['id']})]},{'include':[{'model':db['OpenchannelMessage'],'as':_0x7433('0xb2')}]})[_0x7433('0x1f')](function(_0x12efa3){return[_0x12efa3,!![]];});});}})[_0x7433('0x8a')](function(_0x49018a,_0x42f16d){if(_0x42f16d){return _0x49018a;}return db['OpenchannelMessage'][_0x7433('0x57')](_[_0x7433('0x4c')](_0x371425[_0x7433('0x58')],{'read':![],'body':_0x371425[_0x7433('0x58')][_0x7433('0x58')],'OpenchannelAccountId':_0x488098['id'],'OpenchannelInteractionId':_0x49018a['id'],'UserId':_0x371425[_0x7433('0x59')]['id'],'ContactId':_0x35e5b6['id']}))[_0x7433('0x1f')](function(_0x2120fc){_0x49018a['dataValues'][_0x7433('0xb2')]=[];_0x49018a['dataValues']['Messages'][_0x7433('0xb3')](_0x2120fc[_0x7433('0xb4')]);return _0x49018a;});});}})['then'](respondWithResult(_0x48e588,null))[_0x7433('0x28')](handleError(_0x48e588,null));}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.events.js b/server/api/openchannelAccount/openchannelAccount.events.js index d1a1c33..1b771fe 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 _0xa74f=['remove','hasOwnProperty','hook','exports','OpenchannelAccount','update'];(function(_0x34105a,_0x5d6c0c){var _0x17616e=function(_0x31ef58){while(--_0x31ef58){_0x34105a['push'](_0x34105a['shift']());}};_0x17616e(++_0x5d6c0c);}(_0xa74f,0x9a));var _0xfa74=function(_0x22f8ab,_0x15d8ff){_0x22f8ab=_0x22f8ab-0x0;var _0x2a70e5=_0xa74f[_0x22f8ab];return _0x2a70e5;};'use strict';var EventEmitter=require('events');var OpenchannelAccount=require('../../mysqldb')['db'][_0xfa74('0x0')];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xfa74('0x1'),'afterDestroy':_0xfa74('0x2')};function emitEvent(_0x394a1e){return function(_0x25a9b7,_0x5b367b,_0x141625){OpenchannelAccountEvents['emit'](_0x394a1e+':'+_0x25a9b7['id'],_0x25a9b7);OpenchannelAccountEvents['emit'](_0x394a1e,_0x25a9b7);_0x141625(null);};}for(var e in events){if(events[_0xfa74('0x3')](e)){var event=events[e];OpenchannelAccount[_0xfa74('0x4')](e,emitEvent(event));}}module[_0xfa74('0x5')]=OpenchannelAccountEvents; \ No newline at end of file +var _0x5ff3=['emit','hasOwnProperty','hook','../../mysqldb','setMaxListeners','update','remove'];(function(_0x58fba1,_0x2fb8ea){var _0x2086cd=function(_0x55a349){while(--_0x55a349){_0x58fba1['push'](_0x58fba1['shift']());}};_0x2086cd(++_0x2fb8ea);}(_0x5ff3,0x17d));var _0x35ff=function(_0xd4dc03,_0x515047){_0xd4dc03=_0xd4dc03-0x0;var _0x3801ff=_0x5ff3[_0xd4dc03];return _0x3801ff;};'use strict';var EventEmitter=require('events');var OpenchannelAccount=require(_0x35ff('0x0'))['db']['OpenchannelAccount'];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents[_0x35ff('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0x35ff('0x2'),'afterDestroy':_0x35ff('0x3')};function emitEvent(_0x3bd66a){return function(_0xd0846d,_0x551514,_0x2fcb74){OpenchannelAccountEvents[_0x35ff('0x4')](_0x3bd66a+':'+_0xd0846d['id'],_0xd0846d);OpenchannelAccountEvents[_0x35ff('0x4')](_0x3bd66a,_0xd0846d);_0x2fcb74(null);};}for(var e in events){if(events[_0x35ff('0x5')](e)){var event=events[e];OpenchannelAccount[_0x35ff('0x6')](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 841728c..7db17d1 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(_0x5edcb3,_0x5d24a7){var _0x17dad9=function(_0x36c58f){while(--_0x36c58f){_0x5edcb3['push'](_0x5edcb3['shift']());}};_0x17dad9(++_0x5d24a7);}(_0xa9e0,0x123));var _0x0a9e=function(_0x32d457,_0x1a39c9){_0x32d457=_0x32d457-0x0;var _0x338386=_0xa9e0[_0x32d457];return _0x338386;};'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(_0x21cd85,_0x380b76){var _0x23de9a=function(_0xf2ecd4){while(--_0xf2ecd4){_0x21cd85['push'](_0x21cd85['shift']());}};_0x23de9a(++_0x380b76);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3c2a69,_0x4c8b41){_0x3c2a69=_0x3c2a69-0x0;var _0x596bc8=_0xa9e0[_0x3c2a69];return _0x596bc8;};'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 c96bb7d..ecb30d9 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 _0x13f6=['code','message','result','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','socket.io-emitter','redis','./openchannelAccount.socket','register','request','then','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x1e16b5,_0x83e227){var _0x719844=function(_0x435b01){while(--_0x435b01){_0x1e16b5['push'](_0x1e16b5['shift']());}};_0x719844(++_0x83e227);}(_0x13f6,0x124));var _0x613f=function(_0x4ba802,_0x2102e9){_0x4ba802=_0x4ba802-0x0;var _0x1feec1=_0x13f6[_0x4ba802];return _0x1feec1;};'use strict';var _=require(_0x613f('0x0'));var util=require(_0x613f('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x613f('0x2'));var fs=require('fs');var Redis=require(_0x613f('0x3'));var db=require(_0x613f('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x613f('0x5'))(_0x613f('0x6'));var config=require(_0x613f('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x613f('0x8')][_0x613f('0x9')]({'port':0x232a});config['redis']=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x613f('0xa'))(new Redis(config[_0x613f('0xb')]));require(_0x613f('0xc'))[_0x613f('0xd')](socket);function respondWithRpcPromise(_0x4e98ce,_0x1a8dd0,_0x40d7f5){return new BPromise(function(_0xcd514c,_0x5210a0){return client[_0x613f('0xe')](_0x4e98ce,_0x40d7f5)[_0x613f('0xf')](function(_0x31875a){logger['info'](_0x613f('0x10'),_0x1a8dd0,_0x613f('0x11'));logger['debug']('OpenchannelAccount,\x20%s,\x20%s,\x20%s',_0x1a8dd0,'request\x20sent',JSON[_0x613f('0x12')](_0x31875a));if(_0x31875a[_0x613f('0x13')]){if(_0x31875a[_0x613f('0x13')][_0x613f('0x14')]===0x1f4){logger[_0x613f('0x13')](_0x613f('0x10'),_0x1a8dd0,_0x31875a[_0x613f('0x13')][_0x613f('0x15')]);return _0x5210a0(_0x31875a[_0x613f('0x13')][_0x613f('0x15')]);}logger['error'](_0x613f('0x10'),_0x1a8dd0,_0x31875a['error']['message']);return _0xcd514c(_0x31875a[_0x613f('0x13')][_0x613f('0x15')]);}else{logger['info'](_0x613f('0x10'),_0x1a8dd0,'request\x20sent');_0xcd514c(_0x31875a[_0x613f('0x16')][_0x613f('0x15')]);}})[_0x613f('0x17')](function(_0x2a47f4){logger[_0x613f('0x13')](_0x613f('0x10'),_0x1a8dd0,_0x2a47f4);_0x5210a0(_0x2a47f4);});});} \ No newline at end of file +var _0x55f1=['socket.io-emitter','./openchannelAccount.socket','register','request','then','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','http','redis','defaults','localhost'];(function(_0x33c85c,_0x443328){var _0x2206ad=function(_0x45603a){while(--_0x45603a){_0x33c85c['push'](_0x33c85c['shift']());}};_0x2206ad(++_0x443328);}(_0x55f1,0x9b));var _0x155f=function(_0x1c635f,_0xaf03af){_0x1c635f=_0x1c635f-0x0;var _0x533b6d=_0x55f1[_0x1c635f];return _0x533b6d;};'use strict';var _=require(_0x155f('0x0'));var util=require('util');var moment=require(_0x155f('0x1'));var BPromise=require(_0x155f('0x2'));var rs=require(_0x155f('0x3'));var fs=require('fs');var Redis=require(_0x155f('0x4'));var db=require(_0x155f('0x5'))['db'];var utils=require(_0x155f('0x6'));var logger=require(_0x155f('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x155f('0x8'));var client=jayson['client'][_0x155f('0x9')]({'port':0x232a});config[_0x155f('0xa')]=_[_0x155f('0xb')](config[_0x155f('0xa')],{'host':_0x155f('0xc'),'port':0x18eb});var socket=require(_0x155f('0xd'))(new Redis(config[_0x155f('0xa')]));require(_0x155f('0xe'))[_0x155f('0xf')](socket);function respondWithRpcPromise(_0x281c5a,_0x11c946,_0x39d85a){return new BPromise(function(_0x5b9e3b,_0x9fb9a){return client[_0x155f('0x10')](_0x281c5a,_0x39d85a)[_0x155f('0x11')](function(_0x3575d8){logger['info'](_0x155f('0x12'),_0x11c946,_0x155f('0x13'));logger[_0x155f('0x14')]('OpenchannelAccount,\x20%s,\x20%s,\x20%s',_0x11c946,'request\x20sent',JSON[_0x155f('0x15')](_0x3575d8));if(_0x3575d8[_0x155f('0x16')]){if(_0x3575d8[_0x155f('0x16')][_0x155f('0x17')]===0x1f4){logger[_0x155f('0x16')](_0x155f('0x12'),_0x11c946,_0x3575d8[_0x155f('0x16')]['message']);return _0x9fb9a(_0x3575d8[_0x155f('0x16')][_0x155f('0x18')]);}logger['error'](_0x155f('0x12'),_0x11c946,_0x3575d8[_0x155f('0x16')][_0x155f('0x18')]);return _0x5b9e3b(_0x3575d8[_0x155f('0x16')][_0x155f('0x18')]);}else{logger[_0x155f('0x19')](_0x155f('0x12'),_0x11c946,_0x155f('0x13'));_0x5b9e3b(_0x3575d8[_0x155f('0x1a')][_0x155f('0x18')]);}})[_0x155f('0x1b')](function(_0x3bdede){logger[_0x155f('0x16')](_0x155f('0x12'),_0x11c946,_0x3bdede);_0x9fb9a(_0x3bdede);});});} \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.socket.js b/server/api/openchannelAccount/openchannelAccount.socket.js index 9d0c0c9..57764c9 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 _0x7980=['emit','removeListener','length','./openchannelAccount.events','save','remove','update'];(function(_0x575ca3,_0x39bf0d){var _0xb349a0=function(_0x82aa70){while(--_0x82aa70){_0x575ca3['push'](_0x575ca3['shift']());}};_0xb349a0(++_0x39bf0d);}(_0x7980,0xab));var _0x0798=function(_0x30e6af,_0x2ef6a2){_0x30e6af=_0x30e6af-0x0;var _0x34e057=_0x7980[_0x30e6af];return _0x34e057;};'use strict';var OpenchannelAccountEvents=require(_0x0798('0x0'));var events=[_0x0798('0x1'),_0x0798('0x2'),_0x0798('0x3')];function createListener(_0x3181e9,_0x48285b){return function(_0x3a9ff7){_0x48285b[_0x0798('0x4')](_0x3181e9,_0x3a9ff7);};}function removeListener(_0xecc24f,_0x1637db){return function(){OpenchannelAccountEvents[_0x0798('0x5')](_0xecc24f,_0x1637db);};}exports['register']=function(_0x22a0f0){for(var _0x557325=0x0,_0x1e534f=events[_0x0798('0x6')];_0x557325<_0x1e534f;_0x557325++){var _0x467859=events[_0x557325];var _0x54da10=createListener('openchannelAccount:'+_0x467859,_0x22a0f0);OpenchannelAccountEvents['on'](_0x467859,_0x54da10);}}; \ No newline at end of file +var _0x636f=['length','openchannelAccount:','remove','update','removeListener','register'];(function(_0x79af35,_0x200dea){var _0x110053=function(_0x97b10d){while(--_0x97b10d){_0x79af35['push'](_0x79af35['shift']());}};_0x110053(++_0x200dea);}(_0x636f,0x188));var _0xf636=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x636f[_0x3bf83f];return _0x22c4a9;};'use strict';var OpenchannelAccountEvents=require('./openchannelAccount.events');var events=['save',_0xf636('0x0'),_0xf636('0x1')];function createListener(_0x17e637,_0x42cf1c){return function(_0x20d16a){_0x42cf1c['emit'](_0x17e637,_0x20d16a);};}function removeListener(_0x29ac70,_0x1479ae){return function(){OpenchannelAccountEvents[_0xf636('0x2')](_0x29ac70,_0x1479ae);};}exports[_0xf636('0x3')]=function(_0x39c5f1){for(var _0x526990=0x0,_0xdae985=events[_0xf636('0x4')];_0x526990<_0xdae985;_0x526990++){var _0x2da859=events[_0x526990];var _0x3f6dfb=createListener(_0xf636('0x5')+_0x2da859,_0x39c5f1);OpenchannelAccountEvents['on'](_0x2da859,_0x3f6dfb);}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/index.js b/server/api/openchannelApplication/index.js index 6bdfb71..abfe1a6 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 _0xcf0f=['./openchannelApplication.controller','get','/:id','isAuthenticated','create','put','update','delete','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x1bf297,_0x522860){var _0x52fff3=function(_0xde9ff2){while(--_0xde9ff2){_0x1bf297['push'](_0x1bf297['shift']());}};_0x52fff3(++_0x522860);}(_0xcf0f,0x117));var _0xfcf0=function(_0x57285e,_0x4e8620){_0x57285e=_0x57285e-0x0;var _0x3828f4=_0xcf0f[_0x57285e];return _0x3828f4;};'use strict';var multer=require('multer');var util=require(_0xfcf0('0x0'));var path=require(_0xfcf0('0x1'));var timeout=require(_0xfcf0('0x2'));var express=require(_0xfcf0('0x3'));var router=express[_0xfcf0('0x4')]();var fs_extra=require(_0xfcf0('0x5'));var auth=require(_0xfcf0('0x6'));var interaction=require(_0xfcf0('0x7'));var config=require(_0xfcf0('0x8'));var controller=require(_0xfcf0('0x9'));router[_0xfcf0('0xa')]('/',auth['isAuthenticated'](),controller['index']);router[_0xfcf0('0xa')](_0xfcf0('0xb'),auth[_0xfcf0('0xc')](),controller['show']);router['post']('/',auth[_0xfcf0('0xc')](),controller[_0xfcf0('0xd')]);router[_0xfcf0('0xe')]('/:id',auth[_0xfcf0('0xc')](),controller[_0xfcf0('0xf')]);router[_0xfcf0('0x10')](_0xfcf0('0xb'),auth[_0xfcf0('0xc')](),controller['destroy']);module[_0xfcf0('0x11')]=router; \ No newline at end of file +var _0x16be=['isAuthenticated','/:id','show','create','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x16be,0xed));var _0xe16b=function(_0x2adf61,_0x25a9d2){_0x2adf61=_0x2adf61-0x0;var _0x3ee746=_0x16be[_0x2adf61];return _0x3ee746;};'use strict';var multer=require('multer');var util=require(_0xe16b('0x0'));var path=require(_0xe16b('0x1'));var timeout=require(_0xe16b('0x2'));var express=require(_0xe16b('0x3'));var router=express[_0xe16b('0x4')]();var fs_extra=require(_0xe16b('0x5'));var auth=require(_0xe16b('0x6'));var interaction=require(_0xe16b('0x7'));var config=require(_0xe16b('0x8'));var controller=require('./openchannelApplication.controller');router[_0xe16b('0x9')]('/',auth[_0xe16b('0xa')](),controller['index']);router[_0xe16b('0x9')](_0xe16b('0xb'),auth['isAuthenticated'](),controller[_0xe16b('0xc')]);router['post']('/',auth['isAuthenticated'](),controller[_0xe16b('0xd')]);router[_0xe16b('0xe')](_0xe16b('0xb'),auth[_0xe16b('0xa')](),controller[_0xe16b('0xf')]);router[_0xe16b('0x10')](_0xe16b('0xb'),auth[_0xe16b('0xa')](),controller[_0xe16b('0x11')]);module[_0xe16b('0x12')]=router; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.attributes.js b/server/api/openchannelApplication/openchannelApplication.attributes.js index fddd885..3733132 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 _0xfab0=['sequelize','INTEGER','STRING','noop','*,*,*,*'];(function(_0x42d553,_0xd1be23){var _0x3645d2=function(_0x43be6d){while(--_0x43be6d){_0x42d553['push'](_0x42d553['shift']());}};_0x3645d2(++_0xd1be23);}(_0xfab0,0x96));var _0x0fab=function(_0x3cac61,_0x62fed0){_0x3cac61=_0x3cac61-0x0;var _0x570b82=_0xfab0[_0x3cac61];return _0x570b82;};'use strict';var Sequelize=require(_0x0fab('0x0'));module['exports']={'priority':{'type':Sequelize[_0x0fab('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x0fab('0x2')],'allowNull':![],'defaultValue':_0x0fab('0x3')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x0fab('0x2')],'defaultValue':_0x0fab('0x4')}}; \ No newline at end of file +var _0x2c01=['sequelize','exports','INTEGER','STRING','noop'];(function(_0x26f7c3,_0x4768da){var _0x5b666d=function(_0x38cf0d){while(--_0x38cf0d){_0x26f7c3['push'](_0x26f7c3['shift']());}};_0x5b666d(++_0x4768da);}(_0x2c01,0x10e));var _0x12c0=function(_0x278412,_0x2b3d12){_0x278412=_0x278412-0x0;var _0x2b5a08=_0x2c01[_0x278412];return _0x2b5a08;};'use strict';var Sequelize=require(_0x12c0('0x0'));module[_0x12c0('0x1')]={'priority':{'type':Sequelize[_0x12c0('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x12c0('0x3')],'allowNull':![],'defaultValue':_0x12c0('0x4')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x12c0('0x3')]},'interval':{'type':Sequelize[_0x12c0('0x3')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.controller.js b/server/api/openchannelApplication/openchannelApplication.controller.js index 76dcf61..e90b005 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 _0x6757=['fields','length','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','rows','catch','params','find','create','body','eml-format','rimraf','zip-dir','bluebird','mustache','util','path','sox','ejs','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../mysqldb','status','end','json','undefined','limit','count','offset','set','Content-Range','reject','save','update','then','destroy','sendStatus','error','stack','name','index','map','OpenchannelApplication','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes'];(function(_0x160c73,_0x2ee678){var _0xd9302=function(_0x169454){while(--_0x169454){_0x160c73['push'](_0x160c73['shift']());}};_0xd9302(++_0x2ee678);}(_0x6757,0xeb));var _0x7675=function(_0x144a74,_0x4ea3f0){_0x144a74=_0x144a74-0x0;var _0x21c0a9=_0x6757[_0x144a74];return _0x21c0a9;};'use strict';var emlformat=require(_0x7675('0x0'));var rimraf=require(_0x7675('0x1'));var zipdir=require(_0x7675('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x7675('0x3'));var Mustache=require(_0x7675('0x4'));var util=require(_0x7675('0x5'));var path=require(_0x7675('0x6'));var sox=require(_0x7675('0x7'));var csv=require('to-csv');var ejs=require(_0x7675('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x7675('0x9'));var jsforce=require(_0x7675('0xa'));var deskjs=require(_0x7675('0xb'));var toCsv=require(_0x7675('0xc'));var querystring=require(_0x7675('0xd'));var Papa=require(_0x7675('0xe'));var Redis=require(_0x7675('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x7675('0x10'));var as=require(_0x7675('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x7675('0x12'))(_0x7675('0x13'));var utils=require(_0x7675('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x7675('0x15'))['db'];function respondWithStatusCode(_0x11f78c,_0x2bf5c2){_0x2bf5c2=_0x2bf5c2||0xcc;return function(_0x2aaf69){if(_0x2aaf69){return _0x11f78c['sendStatus'](_0x2bf5c2);}return _0x11f78c[_0x7675('0x16')](_0x2bf5c2)[_0x7675('0x17')]();};}function respondWithResult(_0x5b5393,_0x528815){_0x528815=_0x528815||0xc8;return function(_0x251f5c){if(_0x251f5c){return _0x5b5393[_0x7675('0x16')](_0x528815)[_0x7675('0x18')](_0x251f5c);}};}function respondWithFilteredResult(_0x4ff30a,_0x5506a6){return function(_0x44e15c){if(_0x44e15c){var _0x14cf6b=typeof _0x5506a6['offset']===_0x7675('0x19')&&typeof _0x5506a6[_0x7675('0x1a')]===_0x7675('0x19');var _0x2d4d2d=_0x44e15c[_0x7675('0x1b')];var _0x485dad=_0x14cf6b?0x0:_0x5506a6['offset'];var _0x1f79bb=_0x14cf6b?_0x44e15c[_0x7675('0x1b')]:_0x5506a6[_0x7675('0x1c')]+_0x5506a6[_0x7675('0x1a')];var _0x311f2d;if(_0x1f79bb>=_0x2d4d2d){_0x1f79bb=_0x2d4d2d;_0x311f2d=0xc8;}else{_0x311f2d=0xce;}_0x4ff30a[_0x7675('0x16')](_0x311f2d);return _0x4ff30a[_0x7675('0x1d')](_0x7675('0x1e'),_0x485dad+'-'+_0x1f79bb+'/'+_0x2d4d2d)[_0x7675('0x18')](_0x44e15c);}return null;};}function patchUpdates(_0x260487){return function(_0x17d11a){try{jsonpatch['apply'](_0x17d11a,_0x260487,!![]);}catch(_0x3c48f6){return BPromise[_0x7675('0x1f')](_0x3c48f6);}return _0x17d11a[_0x7675('0x20')]();};}function saveUpdates(_0x54429f,_0x10c328){return function(_0x20584d){if(_0x20584d){return _0x20584d[_0x7675('0x21')](_0x54429f)[_0x7675('0x22')](function(_0x27dd27){return _0x27dd27;});}return null;};}function removeEntity(_0x4a9af2,_0x36dc7d){return function(_0x42f59a){if(_0x42f59a){return _0x42f59a[_0x7675('0x23')]()[_0x7675('0x22')](function(){_0x4a9af2[_0x7675('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0xedb008,_0x2c72be){return function(_0x3187c4){if(!_0x3187c4){_0xedb008[_0x7675('0x24')](0x194);}return _0x3187c4;};}function handleError(_0x33b7a3,_0xb4ffca){_0xb4ffca=_0xb4ffca||0x1f4;return function(_0x425f94){logger[_0x7675('0x25')](_0x425f94[_0x7675('0x26')]);if(_0x425f94[_0x7675('0x27')]){delete _0x425f94['name'];}_0x33b7a3[_0x7675('0x16')](_0xb4ffca)['send'](_0x425f94);};}exports[_0x7675('0x28')]=function(_0x340f0c,_0x2c923b){var _0x14423d={},_0x4bb38c={},_0x1fd073={'count':0x0,'rows':[]};var _0x33917c=_[_0x7675('0x29')](db[_0x7675('0x2a')][_0x7675('0x2b')],function(_0x3fc471){return{'name':_0x3fc471[_0x7675('0x2c')],'type':_0x3fc471[_0x7675('0x2d')][_0x7675('0x2e')]};});_0x4bb38c[_0x7675('0x2f')]=_[_0x7675('0x29')](_0x33917c,'name');_0x4bb38c[_0x7675('0x30')]=_[_0x7675('0x31')](_0x340f0c['query']);_0x4bb38c[_0x7675('0x32')]=_[_0x7675('0x33')](_0x4bb38c[_0x7675('0x2f')],_0x4bb38c[_0x7675('0x30')]);_0x14423d[_0x7675('0x34')]=_[_0x7675('0x33')](_0x4bb38c[_0x7675('0x2f')],qs[_0x7675('0x35')](_0x340f0c['query']['fields']));_0x14423d[_0x7675('0x34')]=_0x14423d[_0x7675('0x34')][_0x7675('0x36')]?_0x14423d[_0x7675('0x34')]:_0x4bb38c[_0x7675('0x2f')];if(!_0x340f0c[_0x7675('0x30')]['hasOwnProperty'](_0x7675('0x37'))){_0x14423d[_0x7675('0x1a')]=qs[_0x7675('0x1a')](_0x340f0c[_0x7675('0x30')]['limit']);_0x14423d[_0x7675('0x1c')]=qs[_0x7675('0x1c')](_0x340f0c['query'][_0x7675('0x1c')]);}_0x14423d[_0x7675('0x38')]=qs[_0x7675('0x39')](_0x340f0c[_0x7675('0x30')][_0x7675('0x39')]);_0x14423d[_0x7675('0x3a')]=qs[_0x7675('0x32')](_[_0x7675('0x3b')](_0x340f0c['query'],_0x4bb38c[_0x7675('0x32')]),_0x33917c);if(_0x340f0c['query']['filter']){_0x14423d[_0x7675('0x3a')]=_[_0x7675('0x3c')](_0x14423d[_0x7675('0x3a')],{'$or':_[_0x7675('0x29')](_0x33917c,function(_0x12b2cf){if(_0x12b2cf[_0x7675('0x2d')]!==_0x7675('0x3d')){var _0x213263={};_0x213263[_0x12b2cf[_0x7675('0x27')]]={'$like':'%'+_0x340f0c[_0x7675('0x30')][_0x7675('0x3e')]+'%'};return _0x213263;}})});}_0x14423d=_[_0x7675('0x3c')]({},_0x14423d,_0x340f0c[_0x7675('0x3f')]);var _0x182d10={'where':_0x14423d[_0x7675('0x3a')]};return db['OpenchannelApplication']['count'](_0x182d10)[_0x7675('0x22')](function(_0xaf79cf){_0x1fd073[_0x7675('0x1b')]=_0xaf79cf;if(_0x340f0c[_0x7675('0x30')][_0x7675('0x40')]){_0x14423d[_0x7675('0x41')]=[{'all':!![]}];}return db[_0x7675('0x2a')]['findAll'](_0x14423d);})[_0x7675('0x22')](function(_0x1a0fbc){_0x1fd073[_0x7675('0x42')]=_0x1a0fbc;return _0x1fd073;})[_0x7675('0x22')](respondWithFilteredResult(_0x2c923b,_0x14423d))[_0x7675('0x43')](handleError(_0x2c923b,null));};exports['show']=function(_0x16e39c,_0x2027bd){var _0x23869a={'raw':!![],'where':{'id':_0x16e39c[_0x7675('0x44')]['id']}},_0x4a5a05={};_0x4a5a05[_0x7675('0x2f')]=_['keys'](db['OpenchannelApplication'][_0x7675('0x2b')]);_0x4a5a05[_0x7675('0x30')]=_['keys'](_0x16e39c['query']);_0x4a5a05['filters']=_['intersection'](_0x4a5a05['model'],_0x4a5a05[_0x7675('0x30')]);_0x23869a[_0x7675('0x34')]=_[_0x7675('0x33')](_0x4a5a05['model'],qs[_0x7675('0x35')](_0x16e39c['query'][_0x7675('0x35')]));_0x23869a['attributes']=_0x23869a['attributes'][_0x7675('0x36')]?_0x23869a[_0x7675('0x34')]:_0x4a5a05[_0x7675('0x2f')];if(_0x16e39c[_0x7675('0x30')][_0x7675('0x40')]){_0x23869a['include']=[{'all':!![]}];}_0x23869a=_[_0x7675('0x3c')]({},_0x23869a,_0x16e39c[_0x7675('0x3f')]);return db[_0x7675('0x2a')][_0x7675('0x45')](_0x23869a)[_0x7675('0x22')](handleEntityNotFound(_0x2027bd,null))['then'](respondWithResult(_0x2027bd,null))[_0x7675('0x43')](handleError(_0x2027bd,null));};exports[_0x7675('0x46')]=function(_0x2b2494,_0x517af9){return db[_0x7675('0x2a')]['create'](_0x2b2494[_0x7675('0x47')],{})[_0x7675('0x22')](respondWithResult(_0x517af9,0xc9))[_0x7675('0x43')](handleError(_0x517af9,null));};exports[_0x7675('0x21')]=function(_0x528137,_0x17d5a6){if(_0x528137['body']['id']){delete _0x528137[_0x7675('0x47')]['id'];}return db[_0x7675('0x2a')][_0x7675('0x45')]({'where':{'id':_0x528137['params']['id']}})[_0x7675('0x22')](handleEntityNotFound(_0x17d5a6,null))[_0x7675('0x22')](saveUpdates(_0x528137['body'],null))['then'](respondWithResult(_0x17d5a6,null))['catch'](handleError(_0x17d5a6,null));};exports['destroy']=function(_0x37a016,_0x10fb7f){return db['OpenchannelApplication'][_0x7675('0x45')]({'where':{'id':_0x37a016['params']['id']}})[_0x7675('0x22')](handleEntityNotFound(_0x10fb7f,null))[_0x7675('0x22')](removeEntity(_0x10fb7f,null))[_0x7675('0x43')](handleError(_0x10fb7f,null));}; \ No newline at end of file +var _0xf19d=['../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','json','undefined','limit','count','offset','status','set','reject','update','then','destroy','end','error','stack','name','send','index','map','OpenchannelApplication','rawAttributes','type','key','model','query','keys','filters','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','catch','intersection','length','find','create','body','params','rimraf','zip-dir','fast-json-patch','request-promise','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api'];(function(_0x506f6e,_0x4731ef){var _0x2d09b4=function(_0x53ec0e){while(--_0x53ec0e){_0x506f6e['push'](_0x506f6e['shift']());}};_0x2d09b4(++_0x4731ef);}(_0xf19d,0x191));var _0xdf19=function(_0x40bffc,_0x3a45d7){_0x40bffc=_0x40bffc-0x0;var _0x3007e9=_0xf19d[_0x40bffc];return _0x3007e9;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xdf19('0x0'));var zipdir=require(_0xdf19('0x1'));var jsonpatch=require(_0xdf19('0x2'));var rp=require(_0xdf19('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0xdf19('0x4'));var csv=require(_0xdf19('0x5'));var ejs=require(_0xdf19('0x6'));var fs=require('fs');var fs_extra=require(_0xdf19('0x7'));var _=require(_0xdf19('0x8'));var squel=require(_0xdf19('0x9'));var crypto=require(_0xdf19('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xdf19('0xb'));var toCsv=require(_0xdf19('0x5'));var querystring=require(_0xdf19('0xc'));var Papa=require(_0xdf19('0xd'));var Redis=require(_0xdf19('0xe'));var authService=require(_0xdf19('0xf'));var qs=require(_0xdf19('0x10'));var as=require(_0xdf19('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xdf19('0x12'));var utils=require(_0xdf19('0x13'));var config=require(_0xdf19('0x14'));var licenseUtil=require(_0xdf19('0x15'));var db=require(_0xdf19('0x16'))['db'];function respondWithStatusCode(_0x8d24a,_0x40c6bb){_0x40c6bb=_0x40c6bb||0xcc;return function(_0x5e8383){if(_0x5e8383){return _0x8d24a[_0xdf19('0x17')](_0x40c6bb);}return _0x8d24a['status'](_0x40c6bb)['end']();};}function respondWithResult(_0x5bc8b6,_0x3da283){_0x3da283=_0x3da283||0xc8;return function(_0x31f7e1){if(_0x31f7e1){return _0x5bc8b6['status'](_0x3da283)[_0xdf19('0x18')](_0x31f7e1);}};}function respondWithFilteredResult(_0x43e41e,_0x39a5d4){return function(_0x3505a4){if(_0x3505a4){var _0x1994c9=typeof _0x39a5d4['offset']===_0xdf19('0x19')&&typeof _0x39a5d4[_0xdf19('0x1a')]===_0xdf19('0x19');var _0x1a67d0=_0x3505a4[_0xdf19('0x1b')];var _0x54e4d9=_0x1994c9?0x0:_0x39a5d4[_0xdf19('0x1c')];var _0x570aa7=_0x1994c9?_0x3505a4[_0xdf19('0x1b')]:_0x39a5d4[_0xdf19('0x1c')]+_0x39a5d4[_0xdf19('0x1a')];var _0x34f815;if(_0x570aa7>=_0x1a67d0){_0x570aa7=_0x1a67d0;_0x34f815=0xc8;}else{_0x34f815=0xce;}_0x43e41e[_0xdf19('0x1d')](_0x34f815);return _0x43e41e[_0xdf19('0x1e')]('Content-Range',_0x54e4d9+'-'+_0x570aa7+'/'+_0x1a67d0)['json'](_0x3505a4);}return null;};}function patchUpdates(_0x555f8c){return function(_0x1fc23d){try{jsonpatch['apply'](_0x1fc23d,_0x555f8c,!![]);}catch(_0x283859){return BPromise[_0xdf19('0x1f')](_0x283859);}return _0x1fc23d['save']();};}function saveUpdates(_0x3f19c9,_0x45e209){return function(_0x2edf48){if(_0x2edf48){return _0x2edf48[_0xdf19('0x20')](_0x3f19c9)[_0xdf19('0x21')](function(_0x8aeeee){return _0x8aeeee;});}return null;};}function removeEntity(_0x5c0d7a,_0x12a014){return function(_0x1cba35){if(_0x1cba35){return _0x1cba35[_0xdf19('0x22')]()['then'](function(){_0x5c0d7a[_0xdf19('0x1d')](0xcc)[_0xdf19('0x23')]();});}};}function handleEntityNotFound(_0x2642bf,_0x46312b){return function(_0x51fa44){if(!_0x51fa44){_0x2642bf[_0xdf19('0x17')](0x194);}return _0x51fa44;};}function handleError(_0x25ce1a,_0x3eb74f){_0x3eb74f=_0x3eb74f||0x1f4;return function(_0x235ee1){logger[_0xdf19('0x24')](_0x235ee1[_0xdf19('0x25')]);if(_0x235ee1[_0xdf19('0x26')]){delete _0x235ee1[_0xdf19('0x26')];}_0x25ce1a[_0xdf19('0x1d')](_0x3eb74f)[_0xdf19('0x27')](_0x235ee1);};}exports[_0xdf19('0x28')]=function(_0x1123a8,_0x552bc4){var _0x355619={},_0x3d971a={},_0x398886={'count':0x0,'rows':[]};var _0x5bb456=_[_0xdf19('0x29')](db[_0xdf19('0x2a')][_0xdf19('0x2b')],function(_0x2c9d7b){return{'name':_0x2c9d7b['fieldName'],'type':_0x2c9d7b[_0xdf19('0x2c')][_0xdf19('0x2d')]};});_0x3d971a[_0xdf19('0x2e')]=_['map'](_0x5bb456,_0xdf19('0x26'));_0x3d971a[_0xdf19('0x2f')]=_[_0xdf19('0x30')](_0x1123a8[_0xdf19('0x2f')]);_0x3d971a[_0xdf19('0x31')]=_['intersection'](_0x3d971a[_0xdf19('0x2e')],_0x3d971a[_0xdf19('0x2f')]);_0x355619[_0xdf19('0x32')]=_['intersection'](_0x3d971a[_0xdf19('0x2e')],qs[_0xdf19('0x33')](_0x1123a8[_0xdf19('0x2f')][_0xdf19('0x33')]));_0x355619[_0xdf19('0x32')]=_0x355619['attributes']['length']?_0x355619[_0xdf19('0x32')]:_0x3d971a['model'];if(!_0x1123a8[_0xdf19('0x2f')][_0xdf19('0x34')](_0xdf19('0x35'))){_0x355619['limit']=qs[_0xdf19('0x1a')](_0x1123a8['query'][_0xdf19('0x1a')]);_0x355619[_0xdf19('0x1c')]=qs['offset'](_0x1123a8[_0xdf19('0x2f')]['offset']);}_0x355619['order']=qs[_0xdf19('0x36')](_0x1123a8[_0xdf19('0x2f')][_0xdf19('0x36')]);_0x355619[_0xdf19('0x37')]=qs[_0xdf19('0x31')](_[_0xdf19('0x38')](_0x1123a8[_0xdf19('0x2f')],_0x3d971a[_0xdf19('0x31')]),_0x5bb456);if(_0x1123a8[_0xdf19('0x2f')][_0xdf19('0x39')]){_0x355619[_0xdf19('0x37')]=_[_0xdf19('0x3a')](_0x355619[_0xdf19('0x37')],{'$or':_[_0xdf19('0x29')](_0x5bb456,function(_0x29df85){if(_0x29df85[_0xdf19('0x2c')]!==_0xdf19('0x3b')){var _0x2d95d9={};_0x2d95d9[_0x29df85[_0xdf19('0x26')]]={'$like':'%'+_0x1123a8['query'][_0xdf19('0x39')]+'%'};return _0x2d95d9;}})});}_0x355619=_['merge']({},_0x355619,_0x1123a8[_0xdf19('0x3c')]);var _0x17eee6={'where':_0x355619['where']};return db[_0xdf19('0x2a')][_0xdf19('0x1b')](_0x17eee6)['then'](function(_0x3bcf21){_0x398886[_0xdf19('0x1b')]=_0x3bcf21;if(_0x1123a8['query'][_0xdf19('0x3d')]){_0x355619[_0xdf19('0x3e')]=[{'all':!![]}];}return db[_0xdf19('0x2a')]['findAll'](_0x355619);})['then'](function(_0x557fad){_0x398886['rows']=_0x557fad;return _0x398886;})['then'](respondWithFilteredResult(_0x552bc4,_0x355619))[_0xdf19('0x3f')](handleError(_0x552bc4,null));};exports['show']=function(_0x336269,_0x4eff34){var _0x269baf={'raw':!![],'where':{'id':_0x336269['params']['id']}},_0x33668c={};_0x33668c[_0xdf19('0x2e')]=_[_0xdf19('0x30')](db[_0xdf19('0x2a')][_0xdf19('0x2b')]);_0x33668c[_0xdf19('0x2f')]=_[_0xdf19('0x30')](_0x336269['query']);_0x33668c['filters']=_[_0xdf19('0x40')](_0x33668c[_0xdf19('0x2e')],_0x33668c[_0xdf19('0x2f')]);_0x269baf['attributes']=_['intersection'](_0x33668c['model'],qs[_0xdf19('0x33')](_0x336269['query'][_0xdf19('0x33')]));_0x269baf[_0xdf19('0x32')]=_0x269baf[_0xdf19('0x32')][_0xdf19('0x41')]?_0x269baf[_0xdf19('0x32')]:_0x33668c[_0xdf19('0x2e')];if(_0x336269[_0xdf19('0x2f')][_0xdf19('0x3d')]){_0x269baf[_0xdf19('0x3e')]=[{'all':!![]}];}_0x269baf=_[_0xdf19('0x3a')]({},_0x269baf,_0x336269[_0xdf19('0x3c')]);return db['OpenchannelApplication'][_0xdf19('0x42')](_0x269baf)['then'](handleEntityNotFound(_0x4eff34,null))[_0xdf19('0x21')](respondWithResult(_0x4eff34,null))[_0xdf19('0x3f')](handleError(_0x4eff34,null));};exports[_0xdf19('0x43')]=function(_0x3499e7,_0x11bf9f){return db['OpenchannelApplication'][_0xdf19('0x43')](_0x3499e7[_0xdf19('0x44')],{})[_0xdf19('0x21')](respondWithResult(_0x11bf9f,0xc9))['catch'](handleError(_0x11bf9f,null));};exports[_0xdf19('0x20')]=function(_0x45f87b,_0x3cc01e){if(_0x45f87b[_0xdf19('0x44')]['id']){delete _0x45f87b[_0xdf19('0x44')]['id'];}return db[_0xdf19('0x2a')][_0xdf19('0x42')]({'where':{'id':_0x45f87b[_0xdf19('0x45')]['id']}})['then'](handleEntityNotFound(_0x3cc01e,null))['then'](saveUpdates(_0x45f87b[_0xdf19('0x44')],null))[_0xdf19('0x21')](respondWithResult(_0x3cc01e,null))['catch'](handleError(_0x3cc01e,null));};exports[_0xdf19('0x22')]=function(_0x5400fa,_0x3cf3f5){return db['OpenchannelApplication']['find']({'where':{'id':_0x5400fa[_0xdf19('0x45')]['id']}})['then'](handleEntityNotFound(_0x3cf3f5,null))[_0xdf19('0x21')](removeEntity(_0x3cf3f5,null))['catch'](handleError(_0x3cf3f5,null));}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.model.js b/server/api/openchannelApplication/openchannelApplication.model.js index ab0da00..ce1a7aa 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 _0x5d68=['request-promise','path','rimraf','../../config/environment','./openchannelApplication.attributes','exports','OpenchannelApplication','openchannel_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','moment','bluebird'];(function(_0x2e4aa2,_0x11956a){var _0x5e6092=function(_0x4c12c2){while(--_0x4c12c2){_0x2e4aa2['push'](_0x2e4aa2['shift']());}};_0x5e6092(++_0x11956a);}(_0x5d68,0x91));var _0x85d6=function(_0x521700,_0x4a3c7c){_0x521700=_0x521700-0x0;var _0x1131dd=_0x5d68[_0x521700];return _0x1131dd;};'use strict';var _=require(_0x85d6('0x0'));var util=require(_0x85d6('0x1'));var logger=require('../../config/logger')(_0x85d6('0x2'));var moment=require(_0x85d6('0x3'));var BPromise=require(_0x85d6('0x4'));var rp=require(_0x85d6('0x5'));var fs=require('fs');var path=require(_0x85d6('0x6'));var rimraf=require(_0x85d6('0x7'));var config=require(_0x85d6('0x8'));var attributes=require(_0x85d6('0x9'));module[_0x85d6('0xa')]=function(_0x3c52a9,_0x261be2){return _0x3c52a9['define'](_0x85d6('0xb'),attributes,{'tableName':_0x85d6('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x85d6('0xd'),'collate':_0x85d6('0xe')});}; \ No newline at end of file +var _0x1b19=['rimraf','../../config/environment','./openchannelApplication.attributes','exports','define','openchannel_applications','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0xeafe99,_0x19078c){var _0xc5b11=function(_0x13f67a){while(--_0x13f67a){_0xeafe99['push'](_0xeafe99['shift']());}};_0xc5b11(++_0x19078c);}(_0x1b19,0x156));var _0x91b1=function(_0x2928db,_0x486d76){_0x2928db=_0x2928db-0x0;var _0x389c0b=_0x1b19[_0x2928db];return _0x389c0b;};'use strict';var _=require(_0x91b1('0x0'));var util=require(_0x91b1('0x1'));var logger=require(_0x91b1('0x2'))(_0x91b1('0x3'));var moment=require(_0x91b1('0x4'));var BPromise=require(_0x91b1('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x91b1('0x6'));var config=require(_0x91b1('0x7'));var attributes=require(_0x91b1('0x8'));module[_0x91b1('0x9')]=function(_0x1abf48,_0x135304){return _0x1abf48[_0x91b1('0xa')]('OpenchannelApplication',attributes,{'tableName':_0x91b1('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.rpc.js b/server/api/openchannelApplication/openchannelApplication.rpc.js index a6ab07b..6a7ff48 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 _0xc6a7=['error','code','OpenchannelApplication,\x20%s,\x20%s','message','catch','UpdateOpenchannelApplication','update','body','options','raw','limit','then','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','info','debug','OpenchannelApplication,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x2b10b5,_0x5c1f2e){var _0x545669=function(_0x4208be){while(--_0x4208be){_0x2b10b5['push'](_0x2b10b5['shift']());}};_0x545669(++_0x5c1f2e);}(_0xc6a7,0x1cc));var _0x7c6a=function(_0xfa634c,_0x414e0e){_0xfa634c=_0xfa634c-0x0;var _0x73e478=_0xc6a7[_0xfa634c];return _0x73e478;};'use strict';var _=require(_0x7c6a('0x0'));var util=require('util');var moment=require(_0x7c6a('0x1'));var BPromise=require(_0x7c6a('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7c6a('0x3'));var db=require(_0x7c6a('0x4'))['db'];var utils=require(_0x7c6a('0x5'));var logger=require(_0x7c6a('0x6'))(_0x7c6a('0x7'));var config=require(_0x7c6a('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x7c6a('0x9')][_0x7c6a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x15072d,_0x144638,_0xa6ca71){return new BPromise(function(_0x23b04b,_0x52af0f){return client[_0x7c6a('0xb')](_0x15072d,_0xa6ca71)['then'](function(_0x3812c6){logger[_0x7c6a('0xc')]('OpenchannelApplication,\x20%s,\x20%s',_0x144638,'request\x20sent');logger[_0x7c6a('0xd')](_0x7c6a('0xe'),_0x144638,_0x7c6a('0xf'),JSON['stringify'](_0x3812c6));if(_0x3812c6[_0x7c6a('0x10')]){if(_0x3812c6[_0x7c6a('0x10')][_0x7c6a('0x11')]===0x1f4){logger['error'](_0x7c6a('0x12'),_0x144638,_0x3812c6[_0x7c6a('0x10')][_0x7c6a('0x13')]);return _0x52af0f(_0x3812c6[_0x7c6a('0x10')][_0x7c6a('0x13')]);}logger[_0x7c6a('0x10')](_0x7c6a('0x12'),_0x144638,_0x3812c6[_0x7c6a('0x10')][_0x7c6a('0x13')]);return _0x23b04b(_0x3812c6[_0x7c6a('0x10')][_0x7c6a('0x13')]);}else{logger[_0x7c6a('0xc')](_0x7c6a('0x12'),_0x144638,'request\x20sent');_0x23b04b(_0x3812c6['result'][_0x7c6a('0x13')]);}})[_0x7c6a('0x14')](function(_0x138fc5){logger[_0x7c6a('0x10')]('OpenchannelApplication,\x20%s,\x20%s',_0x144638,_0x138fc5);_0x52af0f(_0x138fc5);});});}exports[_0x7c6a('0x15')]=function(_0x1169cb){var _0x677396=this;return new Promise(function(_0x3b2757,_0xb739fe){return db['OpenchannelApplication'][_0x7c6a('0x16')](_0x1169cb[_0x7c6a('0x17')],{'raw':_0x1169cb['options']?_0x1169cb[_0x7c6a('0x18')][_0x7c6a('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1169cb[_0x7c6a('0x18')]?_0x1169cb[_0x7c6a('0x18')]['where']||null:null,'attributes':_0x1169cb['options']?_0x1169cb[_0x7c6a('0x18')]['attributes']||null:null,'limit':_0x1169cb[_0x7c6a('0x18')]?_0x1169cb['options'][_0x7c6a('0x1a')]||null:null})[_0x7c6a('0x1b')](function(_0x4960ad){logger[_0x7c6a('0xc')](_0x7c6a('0x15'),_0x1169cb);logger['debug']('UpdateOpenchannelApplication',_0x1169cb,JSON['stringify'](_0x4960ad));_0x3b2757(_0x4960ad);})[_0x7c6a('0x14')](function(_0x564168){logger[_0x7c6a('0x10')]('UpdateOpenchannelApplication',_0x564168[_0x7c6a('0x13')],_0x1169cb);_0xb739fe(_0x677396[_0x7c6a('0x10')](0x1f4,_0x564168[_0x7c6a('0x13')]));});});}; \ No newline at end of file +var _0x09f2=['request\x20sent','stringify','error','code','message','result','catch','UpdateOpenchannelApplication','OpenchannelApplication','update','body','options','where','limit','debug','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','OpenchannelApplication,\x20%s,\x20%s','OpenchannelApplication,\x20%s,\x20%s,\x20%s'];(function(_0x41ed37,_0xbcd1d4){var _0x13f7ea=function(_0x270235){while(--_0x270235){_0x41ed37['push'](_0x41ed37['shift']());}};_0x13f7ea(++_0xbcd1d4);}(_0x09f2,0x1a7));var _0x209f=function(_0x3638e4,_0x4ea468){_0x3638e4=_0x3638e4-0x0;var _0x3db43b=_0x09f2[_0x3638e4];return _0x3db43b;};'use strict';var _=require(_0x209f('0x0'));var util=require(_0x209f('0x1'));var moment=require(_0x209f('0x2'));var BPromise=require(_0x209f('0x3'));var rs=require(_0x209f('0x4'));var fs=require('fs');var Redis=require(_0x209f('0x5'));var db=require(_0x209f('0x6'))['db'];var utils=require(_0x209f('0x7'));var logger=require(_0x209f('0x8'))(_0x209f('0x9'));var config=require(_0x209f('0xa'));var jayson=require(_0x209f('0xb'));var client=jayson[_0x209f('0xc')][_0x209f('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x56cd65,_0x126ed0,_0x187533){return new BPromise(function(_0x130854,_0x35a64c){return client[_0x209f('0xe')](_0x56cd65,_0x187533)[_0x209f('0xf')](function(_0x27f509){logger[_0x209f('0x10')](_0x209f('0x11'),_0x126ed0,'request\x20sent');logger['debug'](_0x209f('0x12'),_0x126ed0,_0x209f('0x13'),JSON[_0x209f('0x14')](_0x27f509));if(_0x27f509[_0x209f('0x15')]){if(_0x27f509[_0x209f('0x15')][_0x209f('0x16')]===0x1f4){logger[_0x209f('0x15')](_0x209f('0x11'),_0x126ed0,_0x27f509[_0x209f('0x15')]['message']);return _0x35a64c(_0x27f509[_0x209f('0x15')]['message']);}logger[_0x209f('0x15')](_0x209f('0x11'),_0x126ed0,_0x27f509['error'][_0x209f('0x17')]);return _0x130854(_0x27f509[_0x209f('0x15')][_0x209f('0x17')]);}else{logger[_0x209f('0x10')]('OpenchannelApplication,\x20%s,\x20%s',_0x126ed0,'request\x20sent');_0x130854(_0x27f509[_0x209f('0x18')][_0x209f('0x17')]);}})[_0x209f('0x19')](function(_0x323130){logger[_0x209f('0x15')](_0x209f('0x11'),_0x126ed0,_0x323130);_0x35a64c(_0x323130);});});}exports[_0x209f('0x1a')]=function(_0x56bdd3){var _0x277d54=this;return new Promise(function(_0x3bda46,_0x1f08af){return db[_0x209f('0x1b')][_0x209f('0x1c')](_0x56bdd3[_0x209f('0x1d')],{'raw':_0x56bdd3[_0x209f('0x1e')]?_0x56bdd3[_0x209f('0x1e')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x56bdd3[_0x209f('0x1e')]?_0x56bdd3[_0x209f('0x1e')][_0x209f('0x1f')]||null:null,'attributes':_0x56bdd3[_0x209f('0x1e')]?_0x56bdd3[_0x209f('0x1e')]['attributes']||null:null,'limit':_0x56bdd3['options']?_0x56bdd3[_0x209f('0x1e')][_0x209f('0x20')]||null:null})[_0x209f('0xf')](function(_0x4bb6a3){logger['info'](_0x209f('0x1a'),_0x56bdd3);logger[_0x209f('0x21')](_0x209f('0x1a'),_0x56bdd3,JSON['stringify'](_0x4bb6a3));_0x3bda46(_0x4bb6a3);})[_0x209f('0x19')](function(_0x71c0b5){logger['error']('UpdateOpenchannelApplication',_0x71c0b5[_0x209f('0x17')],_0x56bdd3);_0x1f08af(_0x277d54[_0x209f('0x15')](0x1f4,_0x71c0b5[_0x209f('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/index.js b/server/api/openchannelInteraction/index.js index 4aab8e8..ff0c7f3 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 _0xea27=['path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelInteraction.controller','isAuthenticated','index','get','/describe','describe','/:id','show','/:id/messages','/:id/download','download','post','create','addMessage','/:id/tags','tracked','openchannel','openchannelinteraction:addtags','addTags','put','openchannelinteraction:update','update','openchannelinteraction:destroy','delete','removeTags','exports','multer','util'];(function(_0x487f51,_0x268f8f){var _0xaf1452=function(_0x228ab7){while(--_0x228ab7){_0x487f51['push'](_0x487f51['shift']());}};_0xaf1452(++_0x268f8f);}(_0xea27,0xad));var _0x7ea2=function(_0x28947d,_0x4cc9c6){_0x28947d=_0x28947d-0x0;var _0x12d2ee=_0xea27[_0x28947d];return _0x12d2ee;};'use strict';var multer=require(_0x7ea2('0x0'));var util=require(_0x7ea2('0x1'));var path=require(_0x7ea2('0x2'));var timeout=require(_0x7ea2('0x3'));var express=require('express');var router=express[_0x7ea2('0x4')]();var fs_extra=require(_0x7ea2('0x5'));var auth=require(_0x7ea2('0x6'));var interaction=require(_0x7ea2('0x7'));var config=require(_0x7ea2('0x8'));var controller=require(_0x7ea2('0x9'));router['get']('/',auth[_0x7ea2('0xa')](),controller[_0x7ea2('0xb')]);router[_0x7ea2('0xc')](_0x7ea2('0xd'),auth[_0x7ea2('0xa')](),controller[_0x7ea2('0xe')]);router[_0x7ea2('0xc')](_0x7ea2('0xf'),auth['isAuthenticated'](),controller[_0x7ea2('0x10')]);router[_0x7ea2('0xc')](_0x7ea2('0x11'),auth['isAuthenticated'](),controller['getMessages']);router[_0x7ea2('0xc')](_0x7ea2('0x12'),auth[_0x7ea2('0xa')](),controller[_0x7ea2('0x13')]);router[_0x7ea2('0x14')]('/',auth[_0x7ea2('0xa')](),controller[_0x7ea2('0x15')]);router[_0x7ea2('0x14')](_0x7ea2('0x11'),auth[_0x7ea2('0xa')](),controller[_0x7ea2('0x16')]);router[_0x7ea2('0x14')](_0x7ea2('0x17'),auth['isAuthenticated'](),interaction[_0x7ea2('0x18')](_0x7ea2('0x19'),_0x7ea2('0x1a')),controller[_0x7ea2('0x1b')]);router[_0x7ea2('0x1c')]('/:id',auth[_0x7ea2('0xa')](),interaction[_0x7ea2('0x18')](_0x7ea2('0x19'),_0x7ea2('0x1d')),controller[_0x7ea2('0x1e')]);router['delete'](_0x7ea2('0xf'),auth[_0x7ea2('0xa')](),interaction[_0x7ea2('0x18')](_0x7ea2('0x19'),_0x7ea2('0x1f')),controller['destroy']);router[_0x7ea2('0x20')](_0x7ea2('0x17'),auth[_0x7ea2('0xa')](),controller[_0x7ea2('0x21')]);module[_0x7ea2('0x22')]=router; \ No newline at end of file +var _0xfda2=['delete','removeTags','exports','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelInteraction.controller','get','index','isAuthenticated','describe','show','/:id/download','download','post','create','/:id/messages','/:id/tags','tracked','openchannelinteraction:addtags','addTags','put','/:id','openchannel','openchannelinteraction:update','update','openchannelinteraction:destroy','destroy'];(function(_0x3b6207,_0x1cb72f){var _0x8d0ea7=function(_0x5e4123){while(--_0x5e4123){_0x3b6207['push'](_0x3b6207['shift']());}};_0x8d0ea7(++_0x1cb72f);}(_0xfda2,0x163));var _0x2fda=function(_0x3c4593,_0x281a10){_0x3c4593=_0x3c4593-0x0;var _0x4c448e=_0xfda2[_0x3c4593];return _0x4c448e;};'use strict';var multer=require('multer');var util=require(_0x2fda('0x0'));var path=require('path');var timeout=require(_0x2fda('0x1'));var express=require(_0x2fda('0x2'));var router=express[_0x2fda('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x2fda('0x4'));var interaction=require(_0x2fda('0x5'));var config=require(_0x2fda('0x6'));var controller=require(_0x2fda('0x7'));router[_0x2fda('0x8')]('/',auth['isAuthenticated'](),controller[_0x2fda('0x9')]);router[_0x2fda('0x8')]('/describe',auth[_0x2fda('0xa')](),controller[_0x2fda('0xb')]);router[_0x2fda('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x2fda('0xc')]);router[_0x2fda('0x8')]('/:id/messages',auth[_0x2fda('0xa')](),controller['getMessages']);router[_0x2fda('0x8')](_0x2fda('0xd'),auth[_0x2fda('0xa')](),controller[_0x2fda('0xe')]);router[_0x2fda('0xf')]('/',auth[_0x2fda('0xa')](),controller[_0x2fda('0x10')]);router['post'](_0x2fda('0x11'),auth['isAuthenticated'](),controller['addMessage']);router[_0x2fda('0xf')](_0x2fda('0x12'),auth[_0x2fda('0xa')](),interaction[_0x2fda('0x13')]('openchannel',_0x2fda('0x14')),controller[_0x2fda('0x15')]);router[_0x2fda('0x16')](_0x2fda('0x17'),auth[_0x2fda('0xa')](),interaction[_0x2fda('0x13')](_0x2fda('0x18'),_0x2fda('0x19')),controller[_0x2fda('0x1a')]);router['delete'](_0x2fda('0x17'),auth[_0x2fda('0xa')](),interaction[_0x2fda('0x13')]('openchannel',_0x2fda('0x1b')),controller[_0x2fda('0x1c')]);router[_0x2fda('0x1d')](_0x2fda('0x12'),auth[_0x2fda('0xa')](),controller[_0x2fda('0x1e')]);module[_0x2fda('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 28a28b0..8708f0d 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 _0x616c=['exports','BOOLEAN','STRING','DATE','ENUM','out'];(function(_0x1035c1,_0x2d8583){var _0x308d67=function(_0x58ddb6){while(--_0x58ddb6){_0x1035c1['push'](_0x1035c1['shift']());}};_0x308d67(++_0x2d8583);}(_0x616c,0x1b6));var _0xc616=function(_0x8b440,_0x1128b6){_0x8b440=_0x8b440-0x0;var _0x4877e1=_0x616c[_0x8b440];return _0x4877e1;};'use strict';var Sequelize=require('sequelize');module[_0xc616('0x0')]={'closed':{'type':Sequelize[_0xc616('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0xc616('0x2')]},'secondDisposition':{'type':Sequelize[_0xc616('0x2')]},'thirdDisposition':{'type':Sequelize[_0xc616('0x2')]},'note':{'type':Sequelize[_0xc616('0x2')]},'read1stAt':{'type':Sequelize['DATE']},'threadId':{'type':Sequelize['STRING']},'externalUrl':{'type':Sequelize[_0xc616('0x2')]},'lastMsgAt':{'type':Sequelize[_0xc616('0x3')]},'lastMsgDirection':{'type':Sequelize[_0xc616('0x4')]('in',_0xc616('0x5')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0xc616('0x2')]},'autoreplyExecuted':{'type':Sequelize[_0xc616('0x1')],'defaultValue':![]}}; \ No newline at end of file +var _0xa8eb=['DATE','out','sequelize','BOOLEAN','STRING'];(function(_0x17928f,_0x4ad33f){var _0x500b63=function(_0x127644){while(--_0x127644){_0x17928f['push'](_0x17928f['shift']());}};_0x500b63(++_0x4ad33f);}(_0xa8eb,0x179));var _0xba8e=function(_0x3ae164,_0x2e6692){_0x3ae164=_0x3ae164-0x0;var _0x9f36f5=_0xa8eb[_0x3ae164];return _0x9f36f5;};'use strict';var Sequelize=require(_0xba8e('0x0'));module['exports']={'closed':{'type':Sequelize[_0xba8e('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0xba8e('0x2')]},'secondDisposition':{'type':Sequelize[_0xba8e('0x2')]},'thirdDisposition':{'type':Sequelize[_0xba8e('0x2')]},'note':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0xba8e('0x3')]},'threadId':{'type':Sequelize[_0xba8e('0x2')]},'externalUrl':{'type':Sequelize['STRING']},'lastMsgAt':{'type':Sequelize[_0xba8e('0x3')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0xba8e('0x4')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize['STRING']},'autoreplyExecuted':{'type':Sequelize[_0xba8e('0x1')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.controller.js b/server/api/openchannelInteraction/openchannelInteraction.controller.js index 0d13d4e..f8e4c5e 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 _0x3f2f=['closedAt','disposition','threadId','Private','basename','existsSync','pipe','createWriteStream','System','secret','renderFile','views','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','log','unlinkSync','eml-format','rimraf','moment','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','socket.io-emitter','./openchannelInteraction.socket','register','sendStatus','end','status','offset','limit','undefined','count','set','Content-Range','json','apply','reject','update','then','stack','name','send','Users','map','TagIds','Tags','split','push','catch','OpenchannelInteraction','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','sort','pick','select','field','from','tools_tags','u.id','u.fullname','left_join','users','u.id\x20=\x20ui.UserId','openchannel_interactions','cm_contacts','o.id\x20=\x20i.UserId','openchannel_accounts','openchannel_messages','me.OpenchannelInteractionId\x20=\x20i.id','openchannel_interaction_has_tags','it.OpenchannelInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','value','having','`\x20=\x200','`\x20>\x200','Contact','operator','$substring','length','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','find','ContactId','buildExpression','text','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','body','some','isEmpty','forEach','where','i.OpenchannelAccountId\x20IN\x20?','concat','createdAt','parse','$gte','$lte','null','\x20IS\x20NULL','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','isNumeric','i.id\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','Sequelize','QueryTypes','SELECT','clone','i.id','order','contactName','DESC','t.id\x20IN\x20?','resolve','user','role','agent','i.OpenchannelAccountId\x20IS\x20NULL','OpenchannelAccountId','sequelize','toString','keyBy','merge','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages','a.key','a.mandatoryDisposition','i.*','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','Contact.mobile','Contact.fax','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.OpenchannelInteractionId\x20IN\x20?','OpenchannelInteractionId','all','rows','show','includeAll','include','options','create','params','destroy','describe','addMessage','OpenchannelMessage','ids','omit','getMessages','findOne','YYYY-MM-DD\x20HH:mm:ss','addTags','color','emit','openchannelInteractionTags:save','removeTags','download','unix','join','root','files','tmp','server','attachments','format','fullname','firstName','lastName','Attachment','direction','OpenchannelAccount','Account','Owner','get','mkdirSync','Openchannel','N.A.','closed'];(function(_0x68c979,_0x431cff){var _0x4f0001=function(_0xa7595d){while(--_0xa7595d){_0x68c979['push'](_0x68c979['shift']());}};_0x4f0001(++_0x431cff);}(_0x3f2f,0xfb));var _0xf3f2=function(_0x533ec3,_0xd62d7d){_0x533ec3=_0x533ec3-0x0;var _0x28d6d8=_0x3f2f[_0x533ec3];return _0x28d6d8;};'use strict';var emlformat=require(_0xf3f2('0x0'));var rimraf=require(_0xf3f2('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xf3f2('0x2'));var BPromise=require(_0xf3f2('0x3'));var Mustache=require(_0xf3f2('0x4'));var util=require('util');var path=require(_0xf3f2('0x5'));var sox=require(_0xf3f2('0x6'));var csv=require(_0xf3f2('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf3f2('0x8'));var _=require(_0xf3f2('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xf3f2('0xa'));var deskjs=require(_0xf3f2('0xb'));var toCsv=require(_0xf3f2('0x7'));var querystring=require(_0xf3f2('0xc'));var Papa=require('papaparse');var Redis=require(_0xf3f2('0xd'));var authService=require(_0xf3f2('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0xf3f2('0xf'));var pdf=require(_0xf3f2('0x10'));var hardwareService=require(_0xf3f2('0x11'));var logger=require(_0xf3f2('0x12'))(_0xf3f2('0x13'));var utils=require(_0xf3f2('0x14'));var config=require(_0xf3f2('0x15'));var licenseUtil=require(_0xf3f2('0x16'));var db=require(_0xf3f2('0x17'))['db'];config['redis']=_['defaults'](config[_0xf3f2('0x18')],{'host':'localhost','port':0x18eb});var socket=require(_0xf3f2('0x19'))(new Redis(config[_0xf3f2('0x18')]));require(_0xf3f2('0x1a'))[_0xf3f2('0x1b')](socket);function respondWithStatusCode(_0x3dddc6,_0x364dfa){_0x364dfa=_0x364dfa||0xcc;return function(_0x34f6b7){if(_0x34f6b7){return _0x3dddc6[_0xf3f2('0x1c')](_0x364dfa);}return _0x3dddc6['status'](_0x364dfa)[_0xf3f2('0x1d')]();};}function respondWithResult(_0x1b588f,_0x5c5bbf){_0x5c5bbf=_0x5c5bbf||0xc8;return function(_0xc3d0a9){if(_0xc3d0a9){return _0x1b588f[_0xf3f2('0x1e')](_0x5c5bbf)['json'](_0xc3d0a9);}};}function respondWithFilteredResult(_0x366974,_0x2fda5e){return function(_0x5e7ab7){if(_0x5e7ab7){var _0x296d27=typeof _0x2fda5e[_0xf3f2('0x1f')]==='undefined'&&typeof _0x2fda5e[_0xf3f2('0x20')]===_0xf3f2('0x21');var _0x33230c=_0x5e7ab7[_0xf3f2('0x22')];var _0x38907a=_0x296d27?0x0:_0x2fda5e['offset'];var _0x546520=_0x296d27?_0x5e7ab7[_0xf3f2('0x22')]:_0x2fda5e[_0xf3f2('0x1f')]+_0x2fda5e[_0xf3f2('0x20')];var _0x31a7b2;if(_0x546520>=_0x33230c){_0x546520=_0x33230c;_0x31a7b2=0xc8;}else{_0x31a7b2=0xce;}_0x366974['status'](_0x31a7b2);return _0x366974[_0xf3f2('0x23')](_0xf3f2('0x24'),_0x38907a+'-'+_0x546520+'/'+_0x33230c)[_0xf3f2('0x25')](_0x5e7ab7);}return null;};}function patchUpdates(_0x401a60){return function(_0x2d0473){try{jsonpatch[_0xf3f2('0x26')](_0x2d0473,_0x401a60,!![]);}catch(_0x1fb6a4){return BPromise[_0xf3f2('0x27')](_0x1fb6a4);}return _0x2d0473['save']();};}function saveUpdates(_0x5ca2bb,_0x53fe51){return function(_0x5d1185){if(_0x5d1185){return _0x5d1185[_0xf3f2('0x28')](_0x5ca2bb)[_0xf3f2('0x29')](function(_0x24748e){return _0x24748e;});}return null;};}function removeEntity(_0x3feed4,_0x453967){return function(_0xff1def){if(_0xff1def){return _0xff1def['destroy']()['then'](function(){_0x3feed4['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x432ca8,_0x334b51){return function(_0x2780a0){if(!_0x2780a0){_0x432ca8[_0xf3f2('0x1c')](0x194);}return _0x2780a0;};}function handleError(_0x5d8b68,_0x2454c8){_0x2454c8=_0x2454c8||0x1f4;return function(_0x1d4813){logger['error'](_0x1d4813[_0xf3f2('0x2a')]);if(_0x1d4813['name']){delete _0x1d4813[_0xf3f2('0x2b')];}_0x5d8b68['status'](_0x2454c8)[_0xf3f2('0x2c')](_0x1d4813);};}function getInteractionUsers(_0x46fb21,_0x4717c9){return new BPromise(function(_0x2b7c2b,_0x391dda){try{if(_0x4717c9[_0x46fb21['id']]){_0x46fb21[_0xf3f2('0x2d')]=_[_0xf3f2('0x2e')](_0x4717c9[_0x46fb21['id']],function(_0x83ef07){return{'id':_0x83ef07['id'],'fullname':_0x83ef07['fullname']};});}}catch(_0x402daf){_0x391dda(_0x402daf);}_0x2b7c2b(_0x46fb21);});}function getInteractionTags(_0x45a3d5,_0x208f2d){return new BPromise(function(_0x58995d,_0x1e90f6){try{if(_0x45a3d5[_0xf3f2('0x2f')]){_0x45a3d5[_0xf3f2('0x30')]=[];_0x45a3d5[_0xf3f2('0x2f')][_0xf3f2('0x31')](',')['forEach'](function(_0x42f566){_0x45a3d5['Tags'][_0xf3f2('0x32')](_0x208f2d[_0x42f566]);});}delete _0x45a3d5['TagIds'];}catch(_0x1a2747){_0x1e90f6(_0x1a2747);}_0x58995d(_0x45a3d5);});}function updateOpenchannelInteraction(_0x5b4de4,_0x494a8c,_0x3f8e27){return new BPromise(function(_0x279259,_0x4be27c){return getInteractionUsers(_0x5b4de4,_0x3f8e27)[_0xf3f2('0x29')](function(_0x462803){return getInteractionTags(_0x462803,_0x494a8c);})[_0xf3f2('0x29')](function(_0x11693d){_0x279259(_0x11693d);})[_0xf3f2('0x33')](function(_0x762f81){_0x4be27c(_0x762f81);});});}exports['index']=function(_0x329661,_0x1f90a7){var _0x16c58d={},_0x502c47={},_0x409350={'count':0x0,'rows':[]};var _0x294480=_['map'](db[_0xf3f2('0x34')][_0xf3f2('0x35')],function(_0x162bed){return{'name':_0x162bed[_0xf3f2('0x36')],'type':_0x162bed[_0xf3f2('0x37')][_0xf3f2('0x38')]};});_0x502c47[_0xf3f2('0x39')]=_[_0xf3f2('0x2e')](_0x294480,'name');_0x502c47[_0xf3f2('0x3a')]=_[_0xf3f2('0x3b')](_0x329661[_0xf3f2('0x3a')]);_0x502c47[_0xf3f2('0x3c')]=_['intersection'](_0x502c47[_0xf3f2('0x39')],_0x502c47[_0xf3f2('0x3a')]);_0x16c58d[_0xf3f2('0x3d')]=_[_0xf3f2('0x3e')](_0x502c47[_0xf3f2('0x39')],qs[_0xf3f2('0x3f')](_0x329661[_0xf3f2('0x3a')][_0xf3f2('0x3f')]));_0x16c58d[_0xf3f2('0x3d')]=_0x16c58d[_0xf3f2('0x3d')]['length']?_0x16c58d[_0xf3f2('0x3d')]:_0x502c47['model'];if(!_0x329661[_0xf3f2('0x3a')][_0xf3f2('0x40')](_0xf3f2('0x41'))){_0x16c58d[_0xf3f2('0x20')]=qs[_0xf3f2('0x20')](_0x329661[_0xf3f2('0x3a')][_0xf3f2('0x20')]);_0x16c58d[_0xf3f2('0x1f')]=qs[_0xf3f2('0x1f')](_0x329661[_0xf3f2('0x3a')][_0xf3f2('0x1f')]);}_0x16c58d['order']=qs[_0xf3f2('0x42')](_0x329661[_0xf3f2('0x3a')][_0xf3f2('0x42')]);_0x16c58d['where']=qs[_0xf3f2('0x3c')](_[_0xf3f2('0x43')](_0x329661[_0xf3f2('0x3a')],_0x502c47[_0xf3f2('0x3c')]),_0x294480);var _0x5dcfad=[];var _0x1393fe=squel[_0xf3f2('0x44')]()['field']('id')[_0xf3f2('0x45')](_0xf3f2('0x2b'))[_0xf3f2('0x45')]('color')[_0xf3f2('0x46')](_0xf3f2('0x47'));var _0x483fef=squel[_0xf3f2('0x44')]()[_0xf3f2('0x45')](_0xf3f2('0x48'))[_0xf3f2('0x45')](_0xf3f2('0x49'))[_0xf3f2('0x45')]('ui.OpenchannelInteractionId')[_0xf3f2('0x46')]('user_has_openchannel_interactions','ui')[_0xf3f2('0x4a')](_0xf3f2('0x4b'),'u',_0xf3f2('0x4c'));var _0x3bc043=squel[_0xf3f2('0x44')]()['from'](_0xf3f2('0x4d'),'i')[_0xf3f2('0x4a')](_0xf3f2('0x4e'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0xf3f2('0x4a')](_0xf3f2('0x4b'),'o',_0xf3f2('0x4f'))[_0xf3f2('0x4a')](_0xf3f2('0x50'),'a','a.id\x20=\x20i.OpenchannelAccountId')['left_join'](_0xf3f2('0x51'),'me',_0xf3f2('0x52'))[_0xf3f2('0x4a')](_0xf3f2('0x53'),'it',_0xf3f2('0x54'))[_0xf3f2('0x4a')](_0xf3f2('0x47'),'t',_0xf3f2('0x55'));var _0x58f034=squel[_0xf3f2('0x56')]();var _0x223762=[];var _0x50fa8c=squel[_0xf3f2('0x56')]();var _0x7bcb2b;if(_0x329661['query'][_0xf3f2('0x57')]){_0x7bcb2b=as[_0xf3f2('0x58')](_0x329661[_0xf3f2('0x3a')]['search']);var _0x1d62ca=_0x7bcb2b[_0xf3f2('0x59')];for(var _0x3caee7=0x0;_0x3caee7<_0x7bcb2b[_0xf3f2('0x5a')]['length'];_0x3caee7++){var _0x28cd74=_0x7bcb2b['conditions'][_0x3caee7];var _0x391fdc='i';var _0x51d20d=_['find'](_0x294480,['name',_0x28cd74['field']]);if(!_0x51d20d){switch(_0x28cd74[_0xf3f2('0x45')]){case'unreadMessages':if(_0x28cd74[_0xf3f2('0x5b')]==0x1){_0x3bc043[_0xf3f2('0x5c')]('`'+_0x28cd74[_0xf3f2('0x45')]+_0xf3f2('0x5d'));}else{_0x3bc043['having']('`'+_0x28cd74[_0xf3f2('0x45')]+_0xf3f2('0x5e'));}break;case _0xf3f2('0x5f'):if(_0x28cd74[_0xf3f2('0x60')]===_0xf3f2('0x61')){if(_0x28cd74[_0xf3f2('0x5b')][_0xf3f2('0x31')]('\x20')[_0xf3f2('0x62')]>0x1){_0x58f034[_0x1d62ca](_0xf3f2('0x63'),qs[_0xf3f2('0x64')](_0x28cd74[_0xf3f2('0x5b')]),null);}else{var _0x5d3be7='%'+_0x28cd74[_0xf3f2('0x5b')]+'%';_0x58f034[_0x1d62ca]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x5d3be7,_0x5d3be7,_0x5d3be7);}}else{_0x51d20d=_[_0xf3f2('0x65')](_0x294480,[_0xf3f2('0x2b'),_0xf3f2('0x66')]);_0x28cd74[_0xf3f2('0x45')]=_0xf3f2('0x66');_0x5e8bdc=as[_0xf3f2('0x67')](_0x391fdc,_0x51d20d[_0xf3f2('0x37')],_0x28cd74);_0x58f034[_0x1d62ca](_0x5e8bdc[_0xf3f2('0x68')],_0x5e8bdc[_0xf3f2('0x5b')][_0xf3f2('0x69')],_0x5e8bdc[_0xf3f2('0x5b')][_0xf3f2('0x1d')]);}break;case _0xf3f2('0x6a'):var _0xe77940=_0x28cd74[_0xf3f2('0x5b')][_0xf3f2('0x31')](',')[_0xf3f2('0x2e')](function(_0x204e8b){return Number(_0x204e8b);});_0xe77940['forEach'](function(_0x102f42){_0x50fa8c['or'](_0xf3f2('0x6b'),'%,'+_0x102f42+',%');});_0x223762=_[_0xf3f2('0x6c')](_0x223762,_0xe77940);break;case _0xf3f2('0x6d'):if(_0x28cd74[_0xf3f2('0x60')]==='$substring'){_0x58f034[_0x1d62ca](_0xf3f2('0x6e'),'%'+_0x28cd74[_0xf3f2('0x5b')]+'%',null);}else{_0x51d20d=_[_0xf3f2('0x65')](_0x294480,['name',_0xf3f2('0x6f')]);_0x28cd74[_0xf3f2('0x45')]=_0xf3f2('0x6f');_0x5e8bdc=as[_0xf3f2('0x67')](_0x391fdc,_0x51d20d[_0xf3f2('0x37')],_0x28cd74);_0x58f034[_0x1d62ca](_0x5e8bdc[_0xf3f2('0x68')],_0x5e8bdc[_0xf3f2('0x5b')]['start'],_0x5e8bdc['value'][_0xf3f2('0x1d')]);}break;case _0xf3f2('0x70'):_0x5e8bdc=as[_0xf3f2('0x67')]('me',null,_0x28cd74);_0x58f034[_0x1d62ca](_0x5e8bdc[_0xf3f2('0x68')],_0x5e8bdc[_0xf3f2('0x5b')][_0xf3f2('0x69')],_0x5e8bdc[_0xf3f2('0x5b')]['end']);break;}}else{var _0x5e8bdc=as[_0xf3f2('0x67')](_0x391fdc,_0x51d20d[_0xf3f2('0x37')],_0x28cd74);_0x58f034[_0x1d62ca](_0x5e8bdc[_0xf3f2('0x68')],_0x5e8bdc[_0xf3f2('0x5b')][_0xf3f2('0x69')],_0x5e8bdc[_0xf3f2('0x5b')]['end']);}}}else{var _0x5542a0=_(_0x329661[_0xf3f2('0x3a')])[_0xf3f2('0x3b')]()[_0xf3f2('0x2e')](function(_0x4ed3b9){return _[_0xf3f2('0x71')](_0x294480,[_0xf3f2('0x2b'),_0x4ed3b9])?_0x4ed3b9:undefined;})['compact']()[_0xf3f2('0x5b')]();if(!_[_0xf3f2('0x72')](_0x5542a0)){_0x5542a0[_0xf3f2('0x73')](function(_0x9b6bee){if(_0x9b6bee==='OpenchannelAccountId'){_0x3bc043[_0xf3f2('0x74')](_0xf3f2('0x75'),[][_0xf3f2('0x76')](_0x329661[_0xf3f2('0x3a')][_0x9b6bee]));}else if(_0x9b6bee===_0xf3f2('0x77')){var _0x17d211=JSON[_0xf3f2('0x78')](_0x329661[_0xf3f2('0x3a')][_0x9b6bee])[_0xf3f2('0x79')];var _0x3278d3=JSON[_0xf3f2('0x78')](_0x329661[_0xf3f2('0x3a')][_0x9b6bee])[_0xf3f2('0x7a')];_0x3bc043[_0xf3f2('0x74')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x17d211,_0x3278d3);}else{if(_0x329661['query'][_0x9b6bee]===_0xf3f2('0x7b')){_0x3bc043[_0xf3f2('0x74')]('i.'+_0x9b6bee+_0xf3f2('0x7c'));}else{_0x3bc043[_0xf3f2('0x74')]('i.'+_0x9b6bee+'\x20=\x20?',_0x329661['query'][_0x9b6bee]);}}});}if(_0x329661[_0xf3f2('0x3a')][_0xf3f2('0x7d')]){if(_0x329661[_0xf3f2('0x3a')][_0xf3f2('0x7d')]==0x1){_0x3bc043[_0xf3f2('0x5c')](_0xf3f2('0x7e'));}else{_0x3bc043[_0xf3f2('0x5c')](_0xf3f2('0x7f'));}}if(_0x329661['query'][_0xf3f2('0x80')]){_0x223762=_[_0xf3f2('0x81')](_0x329661[_0xf3f2('0x3a')][_0xf3f2('0x80')])?_0x329661['query'][_0xf3f2('0x80')]:new Array(_0x329661[_0xf3f2('0x3a')][_0xf3f2('0x80')]);_0x223762[_0xf3f2('0x73')](function(_0x5b1d27){_0x50fa8c['or'](_0xf3f2('0x6b'),'%,'+_0x5b1d27+',%');});}if(_0x329661['query'][_0xf3f2('0x82')]){var _0x5b7d19=_0x329661['query']['filter'][_0xf3f2('0x83')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs[_0xf3f2('0x84')](_0x5b7d19)){_0x58f034['or'](_0xf3f2('0x85'),_0x5b7d19+'%');}else{_0x58f034['or'](_0xf3f2('0x86'),qs[_0xf3f2('0x64')](_0x5b7d19))['or']('i.from\x20LIKE\x20?',_0x5b7d19+'%')['or'](_0xf3f2('0x87'),_0x5b7d19+'%');}}}_0x3bc043[_0xf3f2('0x74')](_0x58f034);_0x3bc043['group']('i.id');var _0x4ac5d5={'type':db[_0xf3f2('0x88')][_0xf3f2('0x89')][_0xf3f2('0x8a')],'raw':!![]};var _0x437f2b=_0x3bc043[_0xf3f2('0x8b')]();_0x437f2b['field'](_0xf3f2('0x8c'));_0x437f2b['field']('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages');if(_0x16c58d[_0xf3f2('0x8d')]){_0x16c58d['order'][_0xf3f2('0x73')](function(_0x594e49){var _0x5778e8=_0x594e49[0x0]===_0xf3f2('0x8e')?_0x594e49[0x0]:'i.'+_0x594e49[0x0];_0x3bc043[_0xf3f2('0x8d')](_0x5778e8,_0x594e49[0x1]===_0xf3f2('0x8f')?![]:!![]);});}if(!_[_0xf3f2('0x72')](_0x223762)){_0x3bc043[_0xf3f2('0x5c')](_0x50fa8c);_0x437f2b[_0xf3f2('0x74')](_0xf3f2('0x90'),_0x223762);}BPromise[_0xf3f2('0x91')]()[_0xf3f2('0x29')](function(){if(!_0x7bcb2b){if(_0x329661[_0xf3f2('0x3a')]['OpenchannelAccountId'])return;_0x437f2b['where']('i.OpenchannelAccountId\x20IS\x20NOT\x20NULL');_0x3bc043[_0xf3f2('0x74')]('i.OpenchannelAccountId\x20IS\x20NOT\x20NULL');return;}if(_0x329661[_0xf3f2('0x92')][_0xf3f2('0x93')]!==_0xf3f2('0x94'))return;return _0x329661[_0xf3f2('0x92')]['getOpenchannelAccounts']({'attributes':['id'],'raw':!![]})[_0xf3f2('0x29')](function(_0x4f9f42){if(_[_0xf3f2('0x72')](_0x4f9f42)){_0x437f2b[_0xf3f2('0x74')](_0xf3f2('0x95'));_0x3bc043[_0xf3f2('0x74')](_0xf3f2('0x95'));}else{_0x437f2b[_0xf3f2('0x74')](_0xf3f2('0x75'),_[_0xf3f2('0x2e')](_0x4f9f42,'id'));_0x3bc043['where'](_0xf3f2('0x75'),_[_0xf3f2('0x2e')](_0x4f9f42,'id'));}});})[_0xf3f2('0x29')](function(){if(_0x329661[_0xf3f2('0x92')][_0xf3f2('0x93')]==='agent'&&!_0x7bcb2b&&!_0x329661[_0xf3f2('0x3a')][_0xf3f2('0x96')])return[];return db[_0xf3f2('0x97')]['query'](_0x437f2b['toString'](),_0x4ac5d5);})[_0xf3f2('0x29')](function(_0x300834){_0x409350[_0xf3f2('0x22')]=_0x300834['length'];if(_0x409350[_0xf3f2('0x22')]===0x0)return[];return db['sequelize'][_0xf3f2('0x3a')](_0x1393fe[_0xf3f2('0x98')](),_0x4ac5d5)[_0xf3f2('0x29')](function(_0x2a4d61){_0x5dcfad=_[_0xf3f2('0x99')](_0x2a4d61,'id');_0x4ac5d5=_[_0xf3f2('0x9a')](_0x4ac5d5,{'model':db['OpenchannelInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x329661[_0xf3f2('0x3a')][_0xf3f2('0x3f')]){_0x16c58d['attributes'][_0xf3f2('0x73')](function(_0x1680d2){_0x3bc043[_0xf3f2('0x45')]('i.'+_0x1680d2);});}else{_0x3bc043[_0xf3f2('0x45')](_0xf3f2('0x9b'),_0xf3f2('0x9c'));_0x3bc043[_0xf3f2('0x45')](_0xf3f2('0x9d'),'Account.key');_0x3bc043[_0xf3f2('0x45')](_0xf3f2('0x9e'),'Account.mandatoryDisposition');_0x3bc043[_0xf3f2('0x45')]('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',_0xf3f2('0x8e'));_0x3bc043['field'](_0xf3f2('0x9f'));_0x3bc043['field']('c.firstName',_0xf3f2('0xa0'));_0x3bc043['field'](_0xf3f2('0xa1'),_0xf3f2('0xa2'));_0x3bc043[_0xf3f2('0x45')](_0xf3f2('0xa3'),_0xf3f2('0xa4'));_0x3bc043[_0xf3f2('0x45')]('c.phone','Contact.phone');_0x3bc043['field']('c.mobile',_0xf3f2('0xa5'));_0x3bc043[_0xf3f2('0x45')]('c.fax',_0xf3f2('0xa6'));_0x3bc043[_0xf3f2('0x45')]('o.fullname','Owner.fullname');_0x3bc043[_0xf3f2('0x45')]('o.internal',_0xf3f2('0xa7'));_0x3bc043[_0xf3f2('0x45')](_0xf3f2('0xa8'),'TagIds');}if(_0x16c58d[_0xf3f2('0x20')])_0x3bc043[_0xf3f2('0x20')](_0x16c58d['limit']);if(_0x16c58d['offset'])_0x3bc043[_0xf3f2('0x1f')](_0x16c58d[_0xf3f2('0x1f')]);return db['sequelize']['query'](_0x3bc043[_0xf3f2('0x98')](),_0x4ac5d5);})[_0xf3f2('0x29')](function(_0xff3ae7){if(_0xff3ae7['length']>0x0)_0x483fef[_0xf3f2('0x74')](_0xf3f2('0xa9'),_[_0xf3f2('0x2e')](_0xff3ae7,'id'));return db[_0xf3f2('0x97')]['query'](_0x483fef[_0xf3f2('0x98')](),_0x4ac5d5)[_0xf3f2('0x29')](function(_0x520b28){var _0x284d60=_['groupBy'](_0x520b28,_0xf3f2('0xaa'));var _0x36f3f7=[];_0xff3ae7[_0xf3f2('0x73')](function(_0x27c91f){_0x36f3f7['push'](updateOpenchannelInteraction(_0x27c91f,_0x5dcfad,_0x284d60));});return BPromise[_0xf3f2('0xab')](_0x36f3f7);});});})[_0xf3f2('0x29')](function(_0x4a8dae){_0x409350[_0xf3f2('0xac')]=_0x4a8dae;return _0x409350;})[_0xf3f2('0x29')](respondWithFilteredResult(_0x1f90a7,_0x16c58d))[_0xf3f2('0x33')](handleError(_0x1f90a7,null));};exports[_0xf3f2('0xad')]=function(_0x1530f5,_0x362d95){var _0x54e19d={};if(_0x1530f5[_0xf3f2('0x3a')]['type']&&_0x1530f5[_0xf3f2('0x3a')][_0xf3f2('0x37')]===_0xf3f2('0x46')){_0x54e19d[_0xf3f2('0x46')]=_0x1530f5['params']['id'];}else{_0x54e19d['id']=_0x1530f5['params']['id'];}var _0x160719={'raw':![],'where':_0x54e19d},_0x4f2694={};_0x4f2694[_0xf3f2('0x39')]=_[_0xf3f2('0x3b')](db[_0xf3f2('0x34')][_0xf3f2('0x35')]);_0x4f2694['query']=_[_0xf3f2('0x3b')](_0x1530f5[_0xf3f2('0x3a')]);_0x4f2694[_0xf3f2('0x3c')]=_['intersection'](_0x4f2694[_0xf3f2('0x39')],_0x4f2694[_0xf3f2('0x3a')]);_0x160719['attributes']=_[_0xf3f2('0x3e')](_0x4f2694[_0xf3f2('0x39')],qs[_0xf3f2('0x3f')](_0x1530f5[_0xf3f2('0x3a')][_0xf3f2('0x3f')]));_0x160719[_0xf3f2('0x3d')]=_0x160719[_0xf3f2('0x3d')][_0xf3f2('0x62')]?_0x160719[_0xf3f2('0x3d')]:_0x4f2694['model'];if(_0x1530f5[_0xf3f2('0x3a')][_0xf3f2('0xae')]){_0x160719[_0xf3f2('0xaf')]=[{'all':!![]}];}_0x160719=_[_0xf3f2('0x9a')]({},_0x160719,_0x1530f5[_0xf3f2('0xb0')]);return db[_0xf3f2('0x34')][_0xf3f2('0x65')](_0x160719)['then'](handleEntityNotFound(_0x362d95,null))['then'](respondWithResult(_0x362d95,null))[_0xf3f2('0x33')](handleError(_0x362d95,null));};exports[_0xf3f2('0xb1')]=function(_0x324ea0,_0x4e32c9){return db[_0xf3f2('0x34')][_0xf3f2('0xb1')](_0x324ea0[_0xf3f2('0x70')],{})[_0xf3f2('0x29')](respondWithResult(_0x4e32c9,0xc9))[_0xf3f2('0x33')](handleError(_0x4e32c9,null));};exports['update']=function(_0x179916,_0x3eaf76){if(_0x179916[_0xf3f2('0x70')]['id']){delete _0x179916[_0xf3f2('0x70')]['id'];}return db[_0xf3f2('0x34')][_0xf3f2('0x65')]({'where':{'id':_0x179916[_0xf3f2('0xb2')]['id']}})[_0xf3f2('0x29')](handleEntityNotFound(_0x3eaf76,null))[_0xf3f2('0x29')](saveUpdates(_0x179916['body'],null))[_0xf3f2('0x29')](respondWithResult(_0x3eaf76,null))[_0xf3f2('0x33')](handleError(_0x3eaf76,null));};exports[_0xf3f2('0xb3')]=function(_0x32b0ba,_0xacbafe){return db[_0xf3f2('0x34')][_0xf3f2('0x65')]({'where':{'id':_0x32b0ba[_0xf3f2('0xb2')]['id']}})[_0xf3f2('0x29')](handleEntityNotFound(_0xacbafe,null))[_0xf3f2('0x29')](removeEntity(_0xacbafe,null))['catch'](handleError(_0xacbafe,null));};exports[_0xf3f2('0xb4')]=function(_0x5de742,_0x33e708){return db['OpenchannelInteraction']['describe']()['then'](respondWithResult(_0x33e708,null))[_0xf3f2('0x33')](handleError(_0x33e708,null));};exports[_0xf3f2('0xb5')]=function(_0x380ecd,_0x48e672,_0x5985a5){return db[_0xf3f2('0xb6')][_0xf3f2('0x65')]({'where':{'id':_0x380ecd[_0xf3f2('0xb2')]['id']}})['then'](handleEntityNotFound(_0x48e672,null))[_0xf3f2('0x29')](function(_0xc55794){if(_0xc55794){return _0xc55794['addMessage'](_0x380ecd[_0xf3f2('0x70')][_0xf3f2('0xb7')],_[_0xf3f2('0xb8')](_0x380ecd['body'],['ids','id'])||{});}})[_0xf3f2('0x29')](respondWithResult(_0x48e672,null))[_0xf3f2('0x33')](handleError(_0x48e672,null));};exports[_0xf3f2('0xb9')]=function(_0x25ebc5,_0x151ed7,_0x57b875){var _0x4f12da={'raw':![],'where':{}};var _0x1f95ac={};var _0x3f4ccc={'count':0x0,'rows':[]};return db[_0xf3f2('0x34')][_0xf3f2('0xba')]({'where':{'id':_0x25ebc5[_0xf3f2('0xb2')]['id']}})[_0xf3f2('0x29')](handleEntityNotFound(_0x151ed7,null))[_0xf3f2('0x29')](function(_0x83b84f){if(_0x83b84f){_0x1f95ac[_0xf3f2('0x39')]=_[_0xf3f2('0x3b')](db[_0xf3f2('0xb6')][_0xf3f2('0x35')]);_0x1f95ac['query']=_['keys'](_0x25ebc5[_0xf3f2('0x3a')]);_0x1f95ac[_0xf3f2('0x3c')]=_['intersection'](_0x1f95ac['model'],_0x1f95ac['query']);_0x4f12da[_0xf3f2('0x3d')]=_['intersection'](_0x1f95ac[_0xf3f2('0x39')],qs['fields'](_0x25ebc5[_0xf3f2('0x3a')][_0xf3f2('0x3f')]));_0x4f12da['attributes']=_0x4f12da['attributes']['length']?_0x4f12da[_0xf3f2('0x3d')]:_0x1f95ac[_0xf3f2('0x39')];if(!_0x25ebc5[_0xf3f2('0x3a')][_0xf3f2('0x40')](_0xf3f2('0x41'))){_0x4f12da[_0xf3f2('0x20')]=qs[_0xf3f2('0x20')](_0x25ebc5['query']['limit']);_0x4f12da[_0xf3f2('0x1f')]=qs['offset'](_0x25ebc5['query'][_0xf3f2('0x1f')]);}_0x4f12da['order']=qs[_0xf3f2('0x42')](_0x25ebc5[_0xf3f2('0x3a')]['sort']);_0x4f12da[_0xf3f2('0x74')]=qs[_0xf3f2('0x3c')](_[_0xf3f2('0x43')](_0x25ebc5[_0xf3f2('0x3a')],_0x1f95ac['filters']));_0x4f12da[_0xf3f2('0x74')][_0xf3f2('0xaa')]=_0x83b84f['id'];if(_0x25ebc5[_0xf3f2('0x3a')]['filter']){_0x4f12da[_0xf3f2('0x74')]=_['merge'](_0x4f12da['where'],{'$or':_[_0xf3f2('0x2e')](_0x4f12da[_0xf3f2('0x3d')],function(_0x273768){var _0x39b0cc={};_0x39b0cc[_0x273768]={'$like':'%'+_0x25ebc5[_0xf3f2('0x3a')][_0xf3f2('0x82')]+'%'};return _0x39b0cc;})});}if(_0x25ebc5[_0xf3f2('0x3a')][_0xf3f2('0x79')]){var _0x1130a0=_0x25ebc5['query'][_0xf3f2('0x79')][_0xf3f2('0x31')](',');var _0x33b7f5={};_0x33b7f5[_0x1130a0[0x0]]={'$gte':moment(_0x1130a0[0x1])['format'](_0xf3f2('0xbb'))};_0x4f12da['where']=_[_0xf3f2('0x9a')](_0x4f12da['where'],_0x33b7f5);}_0x4f12da=_[_0xf3f2('0x9a')]({},_0x4f12da,_0x25ebc5['options']);return db['OpenchannelMessage']['count']({'where':_0x4f12da[_0xf3f2('0x74')]})[_0xf3f2('0x29')](function(_0x325878){_0x3f4ccc[_0xf3f2('0x22')]=_0x325878;if(_0x25ebc5[_0xf3f2('0x3a')]['includeAll']){_0x4f12da[_0xf3f2('0xaf')]=[{'all':!![]}];}return db[_0xf3f2('0xb6')]['findAll'](_0x4f12da);})[_0xf3f2('0x29')](function(_0x227df9){_0x3f4ccc[_0xf3f2('0xac')]=_0x227df9;return _0x3f4ccc;});}})[_0xf3f2('0x29')](respondWithFilteredResult(_0x151ed7,_0x4f12da))[_0xf3f2('0x33')](handleError(_0x151ed7,null));};exports[_0xf3f2('0xbc')]=function(_0x155449,_0x1b5a5a,_0x393687){return db[_0xf3f2('0x34')][_0xf3f2('0x65')]({'where':{'id':_0x155449['params']['id']}})['then'](handleEntityNotFound(_0x1b5a5a,null))[_0xf3f2('0x29')](function(_0x43766d){if(_0x43766d){return _0x43766d['setTags'](_0x155449['body'][_0xf3f2('0xb7')],_['omit'](_0x155449[_0xf3f2('0x70')],[_0xf3f2('0xb7'),'id'])||{})['spread'](function(){return db[_0xf3f2('0x6a')]['findAll']({'attributes':['id',_0xf3f2('0x2b'),_0xf3f2('0xbd')],'where':{'id':_0x155449[_0xf3f2('0x70')][_0xf3f2('0xb7')]}});})[_0xf3f2('0x29')](function(_0x5af74c){socket[_0xf3f2('0xbe')](_0xf3f2('0xbf'),{'id':Number(_0x155449[_0xf3f2('0xb2')]['id']),'tags':_0x5af74c||[]});return{'id':Number(_0x155449['params']['id']),'tags':_0x5af74c||[]};});}})[_0xf3f2('0x29')](respondWithResult(_0x1b5a5a,null))[_0xf3f2('0x33')](handleError(_0x1b5a5a,null));};exports[_0xf3f2('0xc0')]=function(_0x2aaa2a,_0x13b5eb,_0x36a7a0){return db[_0xf3f2('0x34')][_0xf3f2('0x65')]({'where':{'id':_0x2aaa2a[_0xf3f2('0xb2')]['id']}})[_0xf3f2('0x29')](handleEntityNotFound(_0x13b5eb,null))[_0xf3f2('0x29')](function(_0x5102e8){if(_0x5102e8){return _0x5102e8[_0xf3f2('0xc0')](_0x2aaa2a[_0xf3f2('0x3a')][_0xf3f2('0xb7')]);}})['then'](respondWithStatusCode(_0x13b5eb,null))['catch'](handleError(_0x13b5eb,null));};exports[_0xf3f2('0xc1')]=function(_0x3b385c,_0x62d299){var _0x10beb6=moment()[_0xf3f2('0xc2')]()[_0xf3f2('0x98')]();var _0x39f320=path[_0xf3f2('0xc3')](config[_0xf3f2('0xc4')],'server',_0xf3f2('0xc5'),_0xf3f2('0xc6'));var _0x2e6d8e=path[_0xf3f2('0xc3')](config['root'],_0xf3f2('0xc7'),_0xf3f2('0xc5'),_0xf3f2('0xc8'));var _0x17fb01=path['join'](_0x39f320,_0x10beb6);var _0x8727f8=util[_0xf3f2('0xc9')]('transcript-%d-%s.zip',_0x3b385c[_0xf3f2('0xb2')]['id'],_0x10beb6);var _0x7901b1=path[_0xf3f2('0xc3')](_0x39f320,_0x8727f8);var _0xc3db16=[];_0xc3db16['push']({'model':db['User'],'as':_0xf3f2('0x6d'),'attributes':['id',_0xf3f2('0xca')],'raw':!![]});_0xc3db16[_0xf3f2('0x32')]({'model':db['CmContact'],'as':_0xf3f2('0x5f'),'attributes':['id',_0xf3f2('0xcb'),_0xf3f2('0xcc')],'raw':!![]});if(_0x3b385c[_0xf3f2('0x3a')]['attachments']){_0xc3db16['push']({'model':db[_0xf3f2('0xcd')],'as':_0xf3f2('0xcd'),'raw':!![]});}var _0x5c5357=[{'model':db[_0xf3f2('0xb6')],'as':'Messages','attributes':['id','body',_0xf3f2('0x77'),_0xf3f2('0xce'),'secret',_0xf3f2('0x7d')],'include':_0xc3db16}];_0x5c5357[_0xf3f2('0x32')]({'model':db[_0xf3f2('0xcf')],'as':_0xf3f2('0xd0'),'attributes':['id',_0xf3f2('0x2b')]});_0x5c5357[_0xf3f2('0x32')]({'model':db['User'],'as':_0xf3f2('0xd1'),'attributes':['id',_0xf3f2('0xca')]});return db[_0xf3f2('0x34')]['find']({'where':{'id':_0x3b385c[_0xf3f2('0xb2')]['id']},'include':_0x5c5357})['then'](handleEntityNotFound(_0x62d299,null))[_0xf3f2('0x29')](function(_0x205067){if(_0x205067){var _0x536443=_0x205067[_0xf3f2('0xd2')]({'plain':!![]});fs[_0xf3f2('0xd3')](_0x17fb01);var _0x153e29={'channel':_0xf3f2('0xd4'),'account':_0x536443[_0xf3f2('0xd0')][_0xf3f2('0x2b')],'agent':_0x536443['Owner']?_0x536443['Owner'][_0xf3f2('0xca')]:_0xf3f2('0xd5'),'createdAt':moment(_0x536443[_0xf3f2('0x77')])[_0xf3f2('0xc9')](_0xf3f2('0xbb'))[_0xf3f2('0x98')](),'closedAt':_0x536443[_0xf3f2('0xd6')]?moment(_0x536443[_0xf3f2('0xd7')])[_0xf3f2('0xc9')](_0xf3f2('0xbb'))['toString']():'','disposition':_0x536443[_0xf3f2('0xd8')],'visibility':_0x536443[_0xf3f2('0xd9')]?'Public':_0xf3f2('0xda'),'messages':_(_0x536443['Messages'])[_0xf3f2('0x82')]({'secret':![]})[_0xf3f2('0x2e')](function(_0x1e077c){if(_0x1e077c[_0xf3f2('0xcd')]){var _0x3b79cf=path[_0xf3f2('0xc3')](_0x2e6d8e,_0x1e077c[_0xf3f2('0xcd')][_0xf3f2('0xdb')]);if(fs[_0xf3f2('0xdc')](_0x3b79cf)){fs['createReadStream'](_0x3b79cf)[_0xf3f2('0xdd')](fs[_0xf3f2('0xde')](path[_0xf3f2('0xc3')](_0x17fb01,_0x1e077c['Attachment'][_0xf3f2('0xdb')])));}}return{'date':moment(_0x1e077c['createdAt'])[_0xf3f2('0xc9')](_0xf3f2('0xbb'))[_0xf3f2('0x98')](),'sender':_0x1e077c[_0xf3f2('0xce')]==='out'?_0x1e077c[_0xf3f2('0x6d')]?_0x1e077c[_0xf3f2('0x6d')]['fullname']:_0xf3f2('0xdf'):_0x1e077c[_0xf3f2('0x5f')][_0xf3f2('0xcb')]+(_0x1e077c[_0xf3f2('0x5f')][_0xf3f2('0xcc')]?'\x20'+_0x1e077c[_0xf3f2('0x5f')][_0xf3f2('0xcc')]:''),'body':_0x1e077c[_0xf3f2('0xcd')]?_0x1e077c[_0xf3f2('0xcd')][_0xf3f2('0xdb')]:_0x1e077c[_0xf3f2('0x70')],'direction':_0x1e077c[_0xf3f2('0xce')]==='out'?'A':'C','secret':_0x1e077c[_0xf3f2('0xe0')],'read':_0x1e077c['read'],'attachment':_0x1e077c['Attachment']};})[_0xf3f2('0x5b')]()};return ejs[_0xf3f2('0xe1')](path[_0xf3f2('0xc3')](config[_0xf3f2('0xc4')],_0xf3f2('0xc7'),_0xf3f2('0xe2'),_0xf3f2('0xe3')),{'interaction':_0x153e29})[_0xf3f2('0x29')](function(_0x381770){var _0x57beca=path[_0xf3f2('0xc3')](_0x17fb01,_0xf3f2('0xe4')+_0x536443['id']+'-'+_0x10beb6+_0xf3f2('0xe5'));var _0x5cb601={'path':_0x57beca,'channel':_0xf3f2('0xd4'),'interactionId':_0x536443['id']};return pdf[_0xf3f2('0xe6')](_0x381770,_0x5cb601);})['then'](function(){return new BPromise(function(_0x1705e6,_0x24ec66){zipdir(_0x17fb01,{'saveTo':_0x7901b1},function(_0x4ca07c,_0x38fbcd){if(_0x4ca07c)return _0x24ec66(_0x4ca07c);return _0x1705e6(_0x38fbcd);});})[_0xf3f2('0x29')](function(){return new BPromise(function(_0x1fe5e1,_0x44445c){rimraf(_0x17fb01,function(_0x15910a){if(_0x15910a)_0x44445c(_0x15910a);return _0x1fe5e1();});});})[_0xf3f2('0x29')](function(){return _0x62d299[_0xf3f2('0xc1')](_0x7901b1,_0x8727f8,function(_0x1b5b43){if(_0x1b5b43){console[_0xf3f2('0xe7')]('err',_0x1b5b43);}else{fs[_0xf3f2('0xe8')](_0x7901b1);}});});});}else{return _0x62d299[_0xf3f2('0x1c')](0xc8);}})[_0xf3f2('0x33')](handleError(_0x62d299,null));}; \ No newline at end of file +var _0xc0b6=['openchannel_interactions','left_join','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','users','a.id\x20=\x20i.OpenchannelAccountId','openchannel_messages','it.OpenchannelInteractionId\x20=\x20i.id','tools_tags','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','unreadMessages','value','`\x20=\x200','having','`\x20>\x200','Contact','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','find','ContactId','type','text','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','operator','UserId','buildExpression','body','keys','some','compact','OpenchannelAccountId','i.OpenchannelAccountId\x20IN\x20?','concat','parse','$lte','null','\x20IS\x20NULL','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','filter','replace','isNumeric','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','i.from\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','i.id','Sequelize','QueryTypes','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','order','contactName','DESC','t.id\x20IN\x20?','resolve','i.OpenchannelAccountId\x20IS\x20NOT\x20NULL','user','role','agent','getOpenchannelAccounts','isEmpty','i.OpenchannelAccountId\x20IS\x20NULL','sequelize','toString','keyBy','merge','a.key','a.mandatoryDisposition','Account.mandatoryDisposition','CASE\x20WHEN\x20i.from\x20IS\x20NOT\x20NULL\x20AND\x20i.from\x20<>\x20\x27\x27\x20THEN\x20i.from\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','Contact.firstName','c.lastName','c.email','Contact.email','c.phone','Contact.phone','Contact.mobile','c.fax','Contact.fax','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','OpenchannelInteractionId','push','all','rows','show','params','intersection','includeAll','include','options','create','destroy','describe','addMessage','OpenchannelMessage','ids','omit','getMessages','findOne','hasOwnProperty','$gte','format','findAll','setTags','spread','color','emit','openchannelInteractionTags:save','removeTags','download','unix','join','root','server','files','tmp','transcript-%d-%s.zip','CmContact','firstName','lastName','attachments','Messages','direction','secret','OpenchannelAccount','Account','Owner','mkdirSync','N.A.','createdAt','YYYY-MM-DD\x20HH:mm:ss','closedAt','disposition','threadId','Public','Private','Attachment','existsSync','createReadStream','createWriteStream','basename','out','System','renderFile','downloadInteraction.ejs','.pdf','Openchannel','createPdfFromHTML','log','err','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/logger','api','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./openchannelInteraction.socket','register','sendStatus','status','end','json','count','offset','set','Content-Range','apply','reject','save','update','then','error','stack','send','Users','map','fullname','TagIds','Tags','split','forEach','catch','index','OpenchannelInteraction','rawAttributes','fieldName','model','name','query','attributes','fields','length','nolimit','limit','sort','where','filters','pick','select','field','from','u.id','u.fullname','ui.OpenchannelInteractionId','user_has_openchannel_interactions','u.id\x20=\x20ui.UserId'];(function(_0x42759c,_0x2e3546){var _0x5ab4b5=function(_0x4b14ec){while(--_0x4b14ec){_0x42759c['push'](_0x42759c['shift']());}};_0x5ab4b5(++_0x2e3546);}(_0xc0b6,0xa6));var _0x6c0b=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0xc0b6[_0x432682];return _0x463d05;};'use strict';var emlformat=require(_0x6c0b('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x6c0b('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6c0b('0x2'));var moment=require(_0x6c0b('0x3'));var BPromise=require(_0x6c0b('0x4'));var Mustache=require(_0x6c0b('0x5'));var util=require(_0x6c0b('0x6'));var path=require(_0x6c0b('0x7'));var sox=require(_0x6c0b('0x8'));var csv=require(_0x6c0b('0x9'));var ejs=require(_0x6c0b('0xa'));var fs=require('fs');var fs_extra=require(_0x6c0b('0xb'));var _=require(_0x6c0b('0xc'));var squel=require(_0x6c0b('0xd'));var crypto=require('crypto');var jsforce=require(_0x6c0b('0xe'));var deskjs=require(_0x6c0b('0xf'));var toCsv=require(_0x6c0b('0x9'));var querystring=require('querystring');var Papa=require(_0x6c0b('0x10'));var Redis=require(_0x6c0b('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x6c0b('0x12'));var as=require(_0x6c0b('0x13'));var pdf=require(_0x6c0b('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x6c0b('0x15'))(_0x6c0b('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x6c0b('0x17'));var db=require(_0x6c0b('0x18'))['db'];config[_0x6c0b('0x19')]=_['defaults'](config[_0x6c0b('0x19')],{'host':_0x6c0b('0x1a'),'port':0x18eb});var socket=require(_0x6c0b('0x1b'))(new Redis(config[_0x6c0b('0x19')]));require(_0x6c0b('0x1c'))[_0x6c0b('0x1d')](socket);function respondWithStatusCode(_0x3f802f,_0x424d03){_0x424d03=_0x424d03||0xcc;return function(_0x5163ae){if(_0x5163ae){return _0x3f802f[_0x6c0b('0x1e')](_0x424d03);}return _0x3f802f[_0x6c0b('0x1f')](_0x424d03)[_0x6c0b('0x20')]();};}function respondWithResult(_0x50d14d,_0x322647){_0x322647=_0x322647||0xc8;return function(_0x21cb42){if(_0x21cb42){return _0x50d14d[_0x6c0b('0x1f')](_0x322647)[_0x6c0b('0x21')](_0x21cb42);}};}function respondWithFilteredResult(_0x5143a8,_0x551d04){return function(_0x5082f0){if(_0x5082f0){var _0x4062d3=typeof _0x551d04['offset']==='undefined'&&typeof _0x551d04['limit']==='undefined';var _0x39643f=_0x5082f0[_0x6c0b('0x22')];var _0x2a43b9=_0x4062d3?0x0:_0x551d04['offset'];var _0x2f77d6=_0x4062d3?_0x5082f0[_0x6c0b('0x22')]:_0x551d04[_0x6c0b('0x23')]+_0x551d04['limit'];var _0xc2f46f;if(_0x2f77d6>=_0x39643f){_0x2f77d6=_0x39643f;_0xc2f46f=0xc8;}else{_0xc2f46f=0xce;}_0x5143a8[_0x6c0b('0x1f')](_0xc2f46f);return _0x5143a8[_0x6c0b('0x24')](_0x6c0b('0x25'),_0x2a43b9+'-'+_0x2f77d6+'/'+_0x39643f)[_0x6c0b('0x21')](_0x5082f0);}return null;};}function patchUpdates(_0x38b4f3){return function(_0x2a4cbf){try{jsonpatch[_0x6c0b('0x26')](_0x2a4cbf,_0x38b4f3,!![]);}catch(_0x5b9a9f){return BPromise[_0x6c0b('0x27')](_0x5b9a9f);}return _0x2a4cbf[_0x6c0b('0x28')]();};}function saveUpdates(_0x578024,_0x2205b7){return function(_0xc2feac){if(_0xc2feac){return _0xc2feac[_0x6c0b('0x29')](_0x578024)[_0x6c0b('0x2a')](function(_0x105ecc){return _0x105ecc;});}return null;};}function removeEntity(_0x124d00,_0x4fc780){return function(_0x5ae536){if(_0x5ae536){return _0x5ae536['destroy']()[_0x6c0b('0x2a')](function(){_0x124d00['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1d5d1d,_0x196815){return function(_0x31e1ea){if(!_0x31e1ea){_0x1d5d1d[_0x6c0b('0x1e')](0x194);}return _0x31e1ea;};}function handleError(_0x4888c3,_0x506170){_0x506170=_0x506170||0x1f4;return function(_0x3a0c19){logger[_0x6c0b('0x2b')](_0x3a0c19[_0x6c0b('0x2c')]);if(_0x3a0c19['name']){delete _0x3a0c19['name'];}_0x4888c3[_0x6c0b('0x1f')](_0x506170)[_0x6c0b('0x2d')](_0x3a0c19);};}function getInteractionUsers(_0x242475,_0x15cf06){return new BPromise(function(_0x38e511,_0x199772){try{if(_0x15cf06[_0x242475['id']]){_0x242475[_0x6c0b('0x2e')]=_[_0x6c0b('0x2f')](_0x15cf06[_0x242475['id']],function(_0x4a26a6){return{'id':_0x4a26a6['id'],'fullname':_0x4a26a6[_0x6c0b('0x30')]};});}}catch(_0x48b315){_0x199772(_0x48b315);}_0x38e511(_0x242475);});}function getInteractionTags(_0x2f01ba,_0x366500){return new BPromise(function(_0x157dba,_0x15f482){try{if(_0x2f01ba[_0x6c0b('0x31')]){_0x2f01ba[_0x6c0b('0x32')]=[];_0x2f01ba[_0x6c0b('0x31')][_0x6c0b('0x33')](',')[_0x6c0b('0x34')](function(_0x1910ed){_0x2f01ba[_0x6c0b('0x32')]['push'](_0x366500[_0x1910ed]);});}delete _0x2f01ba[_0x6c0b('0x31')];}catch(_0x4a03c2){_0x15f482(_0x4a03c2);}_0x157dba(_0x2f01ba);});}function updateOpenchannelInteraction(_0x48a7b4,_0x42cbff,_0x376b93){return new BPromise(function(_0x3b1357,_0x2e64a1){return getInteractionUsers(_0x48a7b4,_0x376b93)['then'](function(_0x24fed3){return getInteractionTags(_0x24fed3,_0x42cbff);})['then'](function(_0x175bc0){_0x3b1357(_0x175bc0);})[_0x6c0b('0x35')](function(_0x26ecc3){_0x2e64a1(_0x26ecc3);});});}exports[_0x6c0b('0x36')]=function(_0x597b63,_0x737e8d){var _0x162d5e={},_0x561c6c={},_0x132688={'count':0x0,'rows':[]};var _0x3a6b9d=_[_0x6c0b('0x2f')](db[_0x6c0b('0x37')][_0x6c0b('0x38')],function(_0x11807d){return{'name':_0x11807d[_0x6c0b('0x39')],'type':_0x11807d['type']['key']};});_0x561c6c[_0x6c0b('0x3a')]=_[_0x6c0b('0x2f')](_0x3a6b9d,_0x6c0b('0x3b'));_0x561c6c[_0x6c0b('0x3c')]=_['keys'](_0x597b63[_0x6c0b('0x3c')]);_0x561c6c['filters']=_['intersection'](_0x561c6c['model'],_0x561c6c[_0x6c0b('0x3c')]);_0x162d5e[_0x6c0b('0x3d')]=_['intersection'](_0x561c6c[_0x6c0b('0x3a')],qs['fields'](_0x597b63[_0x6c0b('0x3c')][_0x6c0b('0x3e')]));_0x162d5e[_0x6c0b('0x3d')]=_0x162d5e[_0x6c0b('0x3d')][_0x6c0b('0x3f')]?_0x162d5e[_0x6c0b('0x3d')]:_0x561c6c['model'];if(!_0x597b63[_0x6c0b('0x3c')]['hasOwnProperty'](_0x6c0b('0x40'))){_0x162d5e[_0x6c0b('0x41')]=qs[_0x6c0b('0x41')](_0x597b63[_0x6c0b('0x3c')]['limit']);_0x162d5e[_0x6c0b('0x23')]=qs[_0x6c0b('0x23')](_0x597b63['query'][_0x6c0b('0x23')]);}_0x162d5e['order']=qs['sort'](_0x597b63[_0x6c0b('0x3c')][_0x6c0b('0x42')]);_0x162d5e[_0x6c0b('0x43')]=qs[_0x6c0b('0x44')](_[_0x6c0b('0x45')](_0x597b63['query'],_0x561c6c[_0x6c0b('0x44')]),_0x3a6b9d);var _0x1fd58c=[];var _0x4ee13d=squel[_0x6c0b('0x46')]()[_0x6c0b('0x47')]('id')[_0x6c0b('0x47')](_0x6c0b('0x3b'))[_0x6c0b('0x47')]('color')[_0x6c0b('0x48')]('tools_tags');var _0xdde1f=squel[_0x6c0b('0x46')]()[_0x6c0b('0x47')](_0x6c0b('0x49'))[_0x6c0b('0x47')](_0x6c0b('0x4a'))['field'](_0x6c0b('0x4b'))[_0x6c0b('0x48')](_0x6c0b('0x4c'),'ui')['left_join']('users','u',_0x6c0b('0x4d'));var _0x1b577b=squel[_0x6c0b('0x46')]()[_0x6c0b('0x48')](_0x6c0b('0x4e'),'i')[_0x6c0b('0x4f')](_0x6c0b('0x50'),'c',_0x6c0b('0x51'))[_0x6c0b('0x4f')](_0x6c0b('0x52'),'o','o.id\x20=\x20i.UserId')[_0x6c0b('0x4f')]('openchannel_accounts','a',_0x6c0b('0x53'))['left_join'](_0x6c0b('0x54'),'me','me.OpenchannelInteractionId\x20=\x20i.id')[_0x6c0b('0x4f')]('openchannel_interaction_has_tags','it',_0x6c0b('0x55'))[_0x6c0b('0x4f')](_0x6c0b('0x56'),'t',_0x6c0b('0x57'));var _0x3eb06c=squel[_0x6c0b('0x58')]();var _0x27cd82=[];var _0x4ff98a=squel[_0x6c0b('0x58')]();var _0x97f0ea;if(_0x597b63['query'][_0x6c0b('0x59')]){_0x97f0ea=as[_0x6c0b('0x5a')](_0x597b63[_0x6c0b('0x3c')][_0x6c0b('0x59')]);var _0x18851b=_0x97f0ea[_0x6c0b('0x5b')];for(var _0x1b43a6=0x0;_0x1b43a6<_0x97f0ea['conditions'][_0x6c0b('0x3f')];_0x1b43a6++){var _0x519e79=_0x97f0ea[_0x6c0b('0x5c')][_0x1b43a6];var _0x156a66='i';var _0x16beac=_['find'](_0x3a6b9d,['name',_0x519e79['field']]);if(!_0x16beac){switch(_0x519e79['field']){case _0x6c0b('0x5d'):if(_0x519e79[_0x6c0b('0x5e')]==0x1){_0x1b577b['having']('`'+_0x519e79[_0x6c0b('0x47')]+_0x6c0b('0x5f'));}else{_0x1b577b[_0x6c0b('0x60')]('`'+_0x519e79[_0x6c0b('0x47')]+_0x6c0b('0x61'));}break;case _0x6c0b('0x62'):if(_0x519e79['operator']===_0x6c0b('0x63')){if(_0x519e79[_0x6c0b('0x5e')][_0x6c0b('0x33')]('\x20')[_0x6c0b('0x3f')]>0x1){_0x3eb06c[_0x18851b](_0x6c0b('0x64'),qs['getFullTextValue'](_0x519e79['value']),null);}else{var _0x6a95d5='%'+_0x519e79[_0x6c0b('0x5e')]+'%';_0x3eb06c[_0x18851b](_0x6c0b('0x65'),_0x6a95d5,_0x6a95d5,_0x6a95d5);}}else{_0x16beac=_[_0x6c0b('0x66')](_0x3a6b9d,[_0x6c0b('0x3b'),_0x6c0b('0x67')]);_0x519e79[_0x6c0b('0x47')]=_0x6c0b('0x67');_0x23567c=as['buildExpression'](_0x156a66,_0x16beac[_0x6c0b('0x68')],_0x519e79);_0x3eb06c[_0x18851b](_0x23567c[_0x6c0b('0x69')],_0x23567c[_0x6c0b('0x5e')][_0x6c0b('0x6a')],_0x23567c[_0x6c0b('0x5e')][_0x6c0b('0x20')]);}break;case _0x6c0b('0x6b'):var _0x44afa8=_0x519e79[_0x6c0b('0x5e')]['split'](',')[_0x6c0b('0x2f')](function(_0x4eb08c){return Number(_0x4eb08c);});_0x44afa8['forEach'](function(_0x17b1ac){_0x4ff98a['or'](_0x6c0b('0x6c'),'%,'+_0x17b1ac+',%');});_0x27cd82=_[_0x6c0b('0x6d')](_0x27cd82,_0x44afa8);break;case _0x6c0b('0x6e'):if(_0x519e79[_0x6c0b('0x6f')]==='$substring'){_0x3eb06c[_0x18851b]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x519e79[_0x6c0b('0x5e')]+'%',null);}else{_0x16beac=_[_0x6c0b('0x66')](_0x3a6b9d,[_0x6c0b('0x3b'),_0x6c0b('0x70')]);_0x519e79[_0x6c0b('0x47')]=_0x6c0b('0x70');_0x23567c=as[_0x6c0b('0x71')](_0x156a66,_0x16beac[_0x6c0b('0x68')],_0x519e79);_0x3eb06c[_0x18851b](_0x23567c['text'],_0x23567c[_0x6c0b('0x5e')][_0x6c0b('0x6a')],_0x23567c['value']['end']);}break;case _0x6c0b('0x72'):_0x23567c=as[_0x6c0b('0x71')]('me',null,_0x519e79);_0x3eb06c[_0x18851b](_0x23567c['text'],_0x23567c[_0x6c0b('0x5e')][_0x6c0b('0x6a')],_0x23567c[_0x6c0b('0x5e')][_0x6c0b('0x20')]);break;}}else{var _0x23567c=as['buildExpression'](_0x156a66,_0x16beac['type'],_0x519e79);_0x3eb06c[_0x18851b](_0x23567c['text'],_0x23567c[_0x6c0b('0x5e')]['start'],_0x23567c[_0x6c0b('0x5e')][_0x6c0b('0x20')]);}}}else{var _0x3d7cdf=_(_0x597b63['query'])[_0x6c0b('0x73')]()['map'](function(_0x49dcce){return _[_0x6c0b('0x74')](_0x3a6b9d,[_0x6c0b('0x3b'),_0x49dcce])?_0x49dcce:undefined;})[_0x6c0b('0x75')]()['value']();if(!_['isEmpty'](_0x3d7cdf)){_0x3d7cdf[_0x6c0b('0x34')](function(_0x17f6d0){if(_0x17f6d0===_0x6c0b('0x76')){_0x1b577b['where'](_0x6c0b('0x77'),[][_0x6c0b('0x78')](_0x597b63[_0x6c0b('0x3c')][_0x17f6d0]));}else if(_0x17f6d0==='createdAt'){var _0x10f45b=JSON[_0x6c0b('0x79')](_0x597b63['query'][_0x17f6d0])['$gte'];var _0x1ae79a=JSON[_0x6c0b('0x79')](_0x597b63['query'][_0x17f6d0])[_0x6c0b('0x7a')];_0x1b577b['where']('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x10f45b,_0x1ae79a);}else{if(_0x597b63[_0x6c0b('0x3c')][_0x17f6d0]===_0x6c0b('0x7b')){_0x1b577b[_0x6c0b('0x43')]('i.'+_0x17f6d0+_0x6c0b('0x7c'));}else{_0x1b577b[_0x6c0b('0x43')]('i.'+_0x17f6d0+'\x20=\x20?',_0x597b63[_0x6c0b('0x3c')][_0x17f6d0]);}}});}if(_0x597b63[_0x6c0b('0x3c')][_0x6c0b('0x7d')]){if(_0x597b63[_0x6c0b('0x3c')][_0x6c0b('0x7d')]==0x1){_0x1b577b[_0x6c0b('0x60')](_0x6c0b('0x7e'));}else{_0x1b577b['having'](_0x6c0b('0x7f'));}}if(_0x597b63[_0x6c0b('0x3c')]['tag']){_0x27cd82=_['isArray'](_0x597b63['query']['tag'])?_0x597b63[_0x6c0b('0x3c')]['tag']:new Array(_0x597b63[_0x6c0b('0x3c')][_0x6c0b('0x80')]);_0x27cd82[_0x6c0b('0x34')](function(_0xaad4d2){_0x4ff98a['or'](_0x6c0b('0x6c'),'%,'+_0xaad4d2+',%');});}if(_0x597b63[_0x6c0b('0x3c')][_0x6c0b('0x81')]){var _0x35ae1d=_0x597b63[_0x6c0b('0x3c')][_0x6c0b('0x81')][_0x6c0b('0x82')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs[_0x6c0b('0x83')](_0x35ae1d)){_0x3eb06c['or']('i.id\x20LIKE\x20?',_0x35ae1d+'%');}else{_0x3eb06c['or'](_0x6c0b('0x84'),qs['getFullTextValue'](_0x35ae1d))['or'](_0x6c0b('0x85'),_0x35ae1d+'%')['or'](_0x6c0b('0x86'),_0x35ae1d+'%');}}}_0x1b577b['where'](_0x3eb06c);_0x1b577b['group'](_0x6c0b('0x87'));var _0x2b6467={'type':db[_0x6c0b('0x88')][_0x6c0b('0x89')]['SELECT'],'raw':!![]};var _0x51ce28=_0x1b577b[_0x6c0b('0x8a')]();_0x51ce28[_0x6c0b('0x47')](_0x6c0b('0x87'));_0x51ce28[_0x6c0b('0x47')](_0x6c0b('0x8b'),_0x6c0b('0x5d'));if(_0x162d5e[_0x6c0b('0x8c')]){_0x162d5e['order'][_0x6c0b('0x34')](function(_0xa21379){var _0x33b8d5=_0xa21379[0x0]===_0x6c0b('0x8d')?_0xa21379[0x0]:'i.'+_0xa21379[0x0];_0x1b577b[_0x6c0b('0x8c')](_0x33b8d5,_0xa21379[0x1]===_0x6c0b('0x8e')?![]:!![]);});}if(!_['isEmpty'](_0x27cd82)){_0x1b577b[_0x6c0b('0x60')](_0x4ff98a);_0x51ce28['where'](_0x6c0b('0x8f'),_0x27cd82);}BPromise[_0x6c0b('0x90')]()['then'](function(){if(!_0x97f0ea){if(_0x597b63['query'][_0x6c0b('0x76')])return;_0x51ce28[_0x6c0b('0x43')](_0x6c0b('0x91'));_0x1b577b['where']('i.OpenchannelAccountId\x20IS\x20NOT\x20NULL');return;}if(_0x597b63[_0x6c0b('0x92')][_0x6c0b('0x93')]!==_0x6c0b('0x94'))return;return _0x597b63[_0x6c0b('0x92')][_0x6c0b('0x95')]({'attributes':['id'],'raw':!![]})[_0x6c0b('0x2a')](function(_0x48608e){if(_[_0x6c0b('0x96')](_0x48608e)){_0x51ce28[_0x6c0b('0x43')]('i.OpenchannelAccountId\x20IS\x20NULL');_0x1b577b['where'](_0x6c0b('0x97'));}else{_0x51ce28['where'](_0x6c0b('0x77'),_[_0x6c0b('0x2f')](_0x48608e,'id'));_0x1b577b[_0x6c0b('0x43')](_0x6c0b('0x77'),_[_0x6c0b('0x2f')](_0x48608e,'id'));}});})['then'](function(){if(_0x597b63[_0x6c0b('0x92')][_0x6c0b('0x93')]===_0x6c0b('0x94')&&!_0x97f0ea&&!_0x597b63['query'][_0x6c0b('0x76')])return[];return db[_0x6c0b('0x98')][_0x6c0b('0x3c')](_0x51ce28[_0x6c0b('0x99')](),_0x2b6467);})[_0x6c0b('0x2a')](function(_0x54d731){_0x132688['count']=_0x54d731[_0x6c0b('0x3f')];if(_0x132688[_0x6c0b('0x22')]===0x0)return[];return db[_0x6c0b('0x98')]['query'](_0x4ee13d['toString'](),_0x2b6467)['then'](function(_0x376e30){_0x1fd58c=_[_0x6c0b('0x9a')](_0x376e30,'id');_0x2b6467=_[_0x6c0b('0x9b')](_0x2b6467,{'model':db['OpenchannelInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x597b63['query'][_0x6c0b('0x3e')]){_0x162d5e[_0x6c0b('0x3d')]['forEach'](function(_0x4d17b7){_0x1b577b[_0x6c0b('0x47')]('i.'+_0x4d17b7);});}else{_0x1b577b['field'](_0x6c0b('0x8b'),'unreadMessages');_0x1b577b['field'](_0x6c0b('0x9c'),'Account.key');_0x1b577b['field'](_0x6c0b('0x9d'),_0x6c0b('0x9e'));_0x1b577b['field'](_0x6c0b('0x9f'),_0x6c0b('0x8d'));_0x1b577b['field'](_0x6c0b('0xa0'));_0x1b577b[_0x6c0b('0x47')](_0x6c0b('0xa1'),_0x6c0b('0xa2'));_0x1b577b['field'](_0x6c0b('0xa3'),'Contact.lastName');_0x1b577b[_0x6c0b('0x47')](_0x6c0b('0xa4'),_0x6c0b('0xa5'));_0x1b577b['field'](_0x6c0b('0xa6'),_0x6c0b('0xa7'));_0x1b577b[_0x6c0b('0x47')]('c.mobile',_0x6c0b('0xa8'));_0x1b577b[_0x6c0b('0x47')](_0x6c0b('0xa9'),_0x6c0b('0xaa'));_0x1b577b['field']('o.fullname','Owner.fullname');_0x1b577b['field'](_0x6c0b('0xab'),_0x6c0b('0xac'));_0x1b577b['field'](_0x6c0b('0xad'),'TagIds');}if(_0x162d5e['limit'])_0x1b577b[_0x6c0b('0x41')](_0x162d5e[_0x6c0b('0x41')]);if(_0x162d5e[_0x6c0b('0x23')])_0x1b577b['offset'](_0x162d5e[_0x6c0b('0x23')]);return db[_0x6c0b('0x98')][_0x6c0b('0x3c')](_0x1b577b[_0x6c0b('0x99')](),_0x2b6467);})[_0x6c0b('0x2a')](function(_0x29dcad){if(_0x29dcad[_0x6c0b('0x3f')]>0x0)_0xdde1f[_0x6c0b('0x43')]('ui.OpenchannelInteractionId\x20IN\x20?',_[_0x6c0b('0x2f')](_0x29dcad,'id'));return db[_0x6c0b('0x98')][_0x6c0b('0x3c')](_0xdde1f[_0x6c0b('0x99')](),_0x2b6467)[_0x6c0b('0x2a')](function(_0x25a2b9){var _0x1d49ee=_['groupBy'](_0x25a2b9,_0x6c0b('0xae'));var _0x450ee0=[];_0x29dcad[_0x6c0b('0x34')](function(_0x142fd5){_0x450ee0[_0x6c0b('0xaf')](updateOpenchannelInteraction(_0x142fd5,_0x1fd58c,_0x1d49ee));});return BPromise[_0x6c0b('0xb0')](_0x450ee0);});});})[_0x6c0b('0x2a')](function(_0x587717){_0x132688[_0x6c0b('0xb1')]=_0x587717;return _0x132688;})[_0x6c0b('0x2a')](respondWithFilteredResult(_0x737e8d,_0x162d5e))[_0x6c0b('0x35')](handleError(_0x737e8d,null));};exports[_0x6c0b('0xb2')]=function(_0x5e059e,_0x5a94ec){var _0x593f6b={};if(_0x5e059e[_0x6c0b('0x3c')][_0x6c0b('0x68')]&&_0x5e059e[_0x6c0b('0x3c')]['type']===_0x6c0b('0x48')){_0x593f6b[_0x6c0b('0x48')]=_0x5e059e[_0x6c0b('0xb3')]['id'];}else{_0x593f6b['id']=_0x5e059e['params']['id'];}var _0x375a4e={'raw':![],'where':_0x593f6b},_0x1b5e92={};_0x1b5e92['model']=_['keys'](db['OpenchannelInteraction'][_0x6c0b('0x38')]);_0x1b5e92[_0x6c0b('0x3c')]=_[_0x6c0b('0x73')](_0x5e059e[_0x6c0b('0x3c')]);_0x1b5e92[_0x6c0b('0x44')]=_[_0x6c0b('0xb4')](_0x1b5e92[_0x6c0b('0x3a')],_0x1b5e92[_0x6c0b('0x3c')]);_0x375a4e['attributes']=_[_0x6c0b('0xb4')](_0x1b5e92[_0x6c0b('0x3a')],qs['fields'](_0x5e059e[_0x6c0b('0x3c')]['fields']));_0x375a4e[_0x6c0b('0x3d')]=_0x375a4e['attributes'][_0x6c0b('0x3f')]?_0x375a4e[_0x6c0b('0x3d')]:_0x1b5e92[_0x6c0b('0x3a')];if(_0x5e059e['query'][_0x6c0b('0xb5')]){_0x375a4e[_0x6c0b('0xb6')]=[{'all':!![]}];}_0x375a4e=_[_0x6c0b('0x9b')]({},_0x375a4e,_0x5e059e[_0x6c0b('0xb7')]);return db[_0x6c0b('0x37')][_0x6c0b('0x66')](_0x375a4e)[_0x6c0b('0x2a')](handleEntityNotFound(_0x5a94ec,null))[_0x6c0b('0x2a')](respondWithResult(_0x5a94ec,null))['catch'](handleError(_0x5a94ec,null));};exports[_0x6c0b('0xb8')]=function(_0x32e510,_0x1b8fe6){return db[_0x6c0b('0x37')][_0x6c0b('0xb8')](_0x32e510[_0x6c0b('0x72')],{})[_0x6c0b('0x2a')](respondWithResult(_0x1b8fe6,0xc9))[_0x6c0b('0x35')](handleError(_0x1b8fe6,null));};exports[_0x6c0b('0x29')]=function(_0x3b8b27,_0xf8c1a7){if(_0x3b8b27[_0x6c0b('0x72')]['id']){delete _0x3b8b27[_0x6c0b('0x72')]['id'];}return db['OpenchannelInteraction']['find']({'where':{'id':_0x3b8b27[_0x6c0b('0xb3')]['id']}})[_0x6c0b('0x2a')](handleEntityNotFound(_0xf8c1a7,null))[_0x6c0b('0x2a')](saveUpdates(_0x3b8b27[_0x6c0b('0x72')],null))[_0x6c0b('0x2a')](respondWithResult(_0xf8c1a7,null))['catch'](handleError(_0xf8c1a7,null));};exports[_0x6c0b('0xb9')]=function(_0x540fa1,_0x39f848){return db[_0x6c0b('0x37')]['find']({'where':{'id':_0x540fa1[_0x6c0b('0xb3')]['id']}})[_0x6c0b('0x2a')](handleEntityNotFound(_0x39f848,null))[_0x6c0b('0x2a')](removeEntity(_0x39f848,null))[_0x6c0b('0x35')](handleError(_0x39f848,null));};exports[_0x6c0b('0xba')]=function(_0x1327da,_0x53c17e){return db['OpenchannelInteraction'][_0x6c0b('0xba')]()[_0x6c0b('0x2a')](respondWithResult(_0x53c17e,null))['catch'](handleError(_0x53c17e,null));};exports[_0x6c0b('0xbb')]=function(_0x544450,_0x551300,_0x22c272){return db[_0x6c0b('0xbc')][_0x6c0b('0x66')]({'where':{'id':_0x544450[_0x6c0b('0xb3')]['id']}})['then'](handleEntityNotFound(_0x551300,null))['then'](function(_0x156ca0){if(_0x156ca0){return _0x156ca0['addMessage'](_0x544450[_0x6c0b('0x72')][_0x6c0b('0xbd')],_[_0x6c0b('0xbe')](_0x544450[_0x6c0b('0x72')],[_0x6c0b('0xbd'),'id'])||{});}})['then'](respondWithResult(_0x551300,null))['catch'](handleError(_0x551300,null));};exports[_0x6c0b('0xbf')]=function(_0x11c24d,_0x893853,_0x569d85){var _0xce2bd3={'raw':![],'where':{}};var _0xeef19a={};var _0x402623={'count':0x0,'rows':[]};return db[_0x6c0b('0x37')][_0x6c0b('0xc0')]({'where':{'id':_0x11c24d[_0x6c0b('0xb3')]['id']}})[_0x6c0b('0x2a')](handleEntityNotFound(_0x893853,null))[_0x6c0b('0x2a')](function(_0x52aac9){if(_0x52aac9){_0xeef19a['model']=_[_0x6c0b('0x73')](db[_0x6c0b('0xbc')][_0x6c0b('0x38')]);_0xeef19a['query']=_['keys'](_0x11c24d['query']);_0xeef19a[_0x6c0b('0x44')]=_['intersection'](_0xeef19a[_0x6c0b('0x3a')],_0xeef19a[_0x6c0b('0x3c')]);_0xce2bd3[_0x6c0b('0x3d')]=_[_0x6c0b('0xb4')](_0xeef19a['model'],qs[_0x6c0b('0x3e')](_0x11c24d[_0x6c0b('0x3c')][_0x6c0b('0x3e')]));_0xce2bd3[_0x6c0b('0x3d')]=_0xce2bd3[_0x6c0b('0x3d')][_0x6c0b('0x3f')]?_0xce2bd3['attributes']:_0xeef19a[_0x6c0b('0x3a')];if(!_0x11c24d[_0x6c0b('0x3c')][_0x6c0b('0xc1')](_0x6c0b('0x40'))){_0xce2bd3['limit']=qs['limit'](_0x11c24d[_0x6c0b('0x3c')][_0x6c0b('0x41')]);_0xce2bd3[_0x6c0b('0x23')]=qs[_0x6c0b('0x23')](_0x11c24d['query'][_0x6c0b('0x23')]);}_0xce2bd3[_0x6c0b('0x8c')]=qs[_0x6c0b('0x42')](_0x11c24d[_0x6c0b('0x3c')][_0x6c0b('0x42')]);_0xce2bd3['where']=qs[_0x6c0b('0x44')](_['pick'](_0x11c24d[_0x6c0b('0x3c')],_0xeef19a[_0x6c0b('0x44')]));_0xce2bd3[_0x6c0b('0x43')][_0x6c0b('0xae')]=_0x52aac9['id'];if(_0x11c24d['query'][_0x6c0b('0x81')]){_0xce2bd3[_0x6c0b('0x43')]=_['merge'](_0xce2bd3[_0x6c0b('0x43')],{'$or':_['map'](_0xce2bd3[_0x6c0b('0x3d')],function(_0x24a63f){var _0x4f8794={};_0x4f8794[_0x24a63f]={'$like':'%'+_0x11c24d[_0x6c0b('0x3c')][_0x6c0b('0x81')]+'%'};return _0x4f8794;})});}if(_0x11c24d[_0x6c0b('0x3c')]['$gte']){var _0x1803c5=_0x11c24d[_0x6c0b('0x3c')][_0x6c0b('0xc2')][_0x6c0b('0x33')](',');var _0x37486f={};_0x37486f[_0x1803c5[0x0]]={'$gte':moment(_0x1803c5[0x1])[_0x6c0b('0xc3')]('YYYY-MM-DD\x20HH:mm:ss')};_0xce2bd3[_0x6c0b('0x43')]=_[_0x6c0b('0x9b')](_0xce2bd3[_0x6c0b('0x43')],_0x37486f);}_0xce2bd3=_[_0x6c0b('0x9b')]({},_0xce2bd3,_0x11c24d['options']);return db[_0x6c0b('0xbc')][_0x6c0b('0x22')]({'where':_0xce2bd3[_0x6c0b('0x43')]})['then'](function(_0x39113b){_0x402623[_0x6c0b('0x22')]=_0x39113b;if(_0x11c24d['query'][_0x6c0b('0xb5')]){_0xce2bd3['include']=[{'all':!![]}];}return db[_0x6c0b('0xbc')][_0x6c0b('0xc4')](_0xce2bd3);})[_0x6c0b('0x2a')](function(_0xb0165f){_0x402623[_0x6c0b('0xb1')]=_0xb0165f;return _0x402623;});}})[_0x6c0b('0x2a')](respondWithFilteredResult(_0x893853,_0xce2bd3))[_0x6c0b('0x35')](handleError(_0x893853,null));};exports['addTags']=function(_0x2a40f8,_0x580a31,_0x29c2a2){return db[_0x6c0b('0x37')][_0x6c0b('0x66')]({'where':{'id':_0x2a40f8[_0x6c0b('0xb3')]['id']}})['then'](handleEntityNotFound(_0x580a31,null))[_0x6c0b('0x2a')](function(_0x16a73f){if(_0x16a73f){return _0x16a73f[_0x6c0b('0xc5')](_0x2a40f8['body']['ids'],_[_0x6c0b('0xbe')](_0x2a40f8[_0x6c0b('0x72')],['ids','id'])||{})[_0x6c0b('0xc6')](function(){return db[_0x6c0b('0x6b')][_0x6c0b('0xc4')]({'attributes':['id',_0x6c0b('0x3b'),_0x6c0b('0xc7')],'where':{'id':_0x2a40f8[_0x6c0b('0x72')][_0x6c0b('0xbd')]}});})['then'](function(_0x5b9daa){socket[_0x6c0b('0xc8')](_0x6c0b('0xc9'),{'id':Number(_0x2a40f8[_0x6c0b('0xb3')]['id']),'tags':_0x5b9daa||[]});return{'id':Number(_0x2a40f8[_0x6c0b('0xb3')]['id']),'tags':_0x5b9daa||[]};});}})[_0x6c0b('0x2a')](respondWithResult(_0x580a31,null))[_0x6c0b('0x35')](handleError(_0x580a31,null));};exports[_0x6c0b('0xca')]=function(_0x766b7f,_0x24d9a7,_0x397db8){return db['OpenchannelInteraction'][_0x6c0b('0x66')]({'where':{'id':_0x766b7f['params']['id']}})[_0x6c0b('0x2a')](handleEntityNotFound(_0x24d9a7,null))[_0x6c0b('0x2a')](function(_0x4e833b){if(_0x4e833b){return _0x4e833b[_0x6c0b('0xca')](_0x766b7f[_0x6c0b('0x3c')][_0x6c0b('0xbd')]);}})['then'](respondWithStatusCode(_0x24d9a7,null))['catch'](handleError(_0x24d9a7,null));};exports[_0x6c0b('0xcb')]=function(_0x4bc497,_0x1815c9){var _0x5638ed=moment()[_0x6c0b('0xcc')]()[_0x6c0b('0x99')]();var _0x22d3d9=path[_0x6c0b('0xcd')](config[_0x6c0b('0xce')],_0x6c0b('0xcf'),_0x6c0b('0xd0'),_0x6c0b('0xd1'));var _0x10594d=path['join'](config[_0x6c0b('0xce')],_0x6c0b('0xcf'),_0x6c0b('0xd0'),'attachments');var _0x203298=path[_0x6c0b('0xcd')](_0x22d3d9,_0x5638ed);var _0x2d5f6d=util[_0x6c0b('0xc3')](_0x6c0b('0xd2'),_0x4bc497[_0x6c0b('0xb3')]['id'],_0x5638ed);var _0x4a70cd=path[_0x6c0b('0xcd')](_0x22d3d9,_0x2d5f6d);var _0x59d947=[];_0x59d947[_0x6c0b('0xaf')]({'model':db['User'],'as':_0x6c0b('0x6e'),'attributes':['id',_0x6c0b('0x30')],'raw':!![]});_0x59d947['push']({'model':db[_0x6c0b('0xd3')],'as':'Contact','attributes':['id',_0x6c0b('0xd4'),_0x6c0b('0xd5')],'raw':!![]});if(_0x4bc497[_0x6c0b('0x3c')][_0x6c0b('0xd6')]){_0x59d947[_0x6c0b('0xaf')]({'model':db['Attachment'],'as':'Attachment','raw':!![]});}var _0x2d5b7d=[{'model':db['OpenchannelMessage'],'as':_0x6c0b('0xd7'),'attributes':['id','body','createdAt',_0x6c0b('0xd8'),_0x6c0b('0xd9'),_0x6c0b('0x7d')],'include':_0x59d947}];_0x2d5b7d['push']({'model':db[_0x6c0b('0xda')],'as':_0x6c0b('0xdb'),'attributes':['id',_0x6c0b('0x3b')]});_0x2d5b7d[_0x6c0b('0xaf')]({'model':db[_0x6c0b('0x6e')],'as':_0x6c0b('0xdc'),'attributes':['id',_0x6c0b('0x30')]});return db[_0x6c0b('0x37')]['find']({'where':{'id':_0x4bc497[_0x6c0b('0xb3')]['id']},'include':_0x2d5b7d})[_0x6c0b('0x2a')](handleEntityNotFound(_0x1815c9,null))[_0x6c0b('0x2a')](function(_0x2da505){if(_0x2da505){var _0x93b7c7=_0x2da505['get']({'plain':!![]});fs[_0x6c0b('0xdd')](_0x203298);var _0x14e40b={'channel':'Openchannel','account':_0x93b7c7[_0x6c0b('0xdb')]['name'],'agent':_0x93b7c7[_0x6c0b('0xdc')]?_0x93b7c7[_0x6c0b('0xdc')]['fullname']:_0x6c0b('0xde'),'createdAt':moment(_0x93b7c7[_0x6c0b('0xdf')])[_0x6c0b('0xc3')](_0x6c0b('0xe0'))[_0x6c0b('0x99')](),'closedAt':_0x93b7c7['closed']?moment(_0x93b7c7[_0x6c0b('0xe1')])['format'](_0x6c0b('0xe0'))[_0x6c0b('0x99')]():'','disposition':_0x93b7c7[_0x6c0b('0xe2')],'visibility':_0x93b7c7[_0x6c0b('0xe3')]?_0x6c0b('0xe4'):_0x6c0b('0xe5'),'messages':_(_0x93b7c7[_0x6c0b('0xd7')])[_0x6c0b('0x81')]({'secret':![]})['map'](function(_0xdf2ac7){if(_0xdf2ac7[_0x6c0b('0xe6')]){var _0x1eb625=path[_0x6c0b('0xcd')](_0x10594d,_0xdf2ac7[_0x6c0b('0xe6')]['basename']);if(fs[_0x6c0b('0xe7')](_0x1eb625)){fs[_0x6c0b('0xe8')](_0x1eb625)['pipe'](fs[_0x6c0b('0xe9')](path[_0x6c0b('0xcd')](_0x203298,_0xdf2ac7[_0x6c0b('0xe6')][_0x6c0b('0xea')])));}}return{'date':moment(_0xdf2ac7[_0x6c0b('0xdf')])[_0x6c0b('0xc3')]('YYYY-MM-DD\x20HH:mm:ss')[_0x6c0b('0x99')](),'sender':_0xdf2ac7[_0x6c0b('0xd8')]===_0x6c0b('0xeb')?_0xdf2ac7[_0x6c0b('0x6e')]?_0xdf2ac7[_0x6c0b('0x6e')][_0x6c0b('0x30')]:_0x6c0b('0xec'):_0xdf2ac7[_0x6c0b('0x62')][_0x6c0b('0xd4')]+(_0xdf2ac7['Contact'][_0x6c0b('0xd5')]?'\x20'+_0xdf2ac7[_0x6c0b('0x62')][_0x6c0b('0xd5')]:''),'body':_0xdf2ac7[_0x6c0b('0xe6')]?_0xdf2ac7[_0x6c0b('0xe6')][_0x6c0b('0xea')]:_0xdf2ac7[_0x6c0b('0x72')],'direction':_0xdf2ac7[_0x6c0b('0xd8')]===_0x6c0b('0xeb')?'A':'C','secret':_0xdf2ac7['secret'],'read':_0xdf2ac7[_0x6c0b('0x7d')],'attachment':_0xdf2ac7[_0x6c0b('0xe6')]};})[_0x6c0b('0x5e')]()};return ejs[_0x6c0b('0xed')](path[_0x6c0b('0xcd')](config['root'],'server','views',_0x6c0b('0xee')),{'interaction':_0x14e40b})[_0x6c0b('0x2a')](function(_0x8c95ad){var _0x166152=path[_0x6c0b('0xcd')](_0x203298,'transcript-'+_0x93b7c7['id']+'-'+_0x5638ed+_0x6c0b('0xef'));var _0x31d3cc={'path':_0x166152,'channel':_0x6c0b('0xf0'),'interactionId':_0x93b7c7['id']};return pdf[_0x6c0b('0xf1')](_0x8c95ad,_0x31d3cc);})['then'](function(){return new BPromise(function(_0x22c099,_0x3e3d9d){zipdir(_0x203298,{'saveTo':_0x4a70cd},function(_0x410bcb,_0x4f1415){if(_0x410bcb)return _0x3e3d9d(_0x410bcb);return _0x22c099(_0x4f1415);});})[_0x6c0b('0x2a')](function(){return new BPromise(function(_0x54ce37,_0x335475){rimraf(_0x203298,function(_0x193898){if(_0x193898)_0x335475(_0x193898);return _0x54ce37();});});})[_0x6c0b('0x2a')](function(){return _0x1815c9[_0x6c0b('0xcb')](_0x4a70cd,_0x2d5f6d,function(_0x5b45c7){if(_0x5b45c7){console[_0x6c0b('0xf2')](_0x6c0b('0xf3'),_0x5b45c7);}else{fs['unlinkSync'](_0x4a70cd);}});});});}else{return _0x1815c9[_0x6c0b('0x1e')](0xc8);}})[_0x6c0b('0x35')](handleError(_0x1815c9,null));}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.events.js b/server/api/openchannelInteraction/openchannelInteraction.events.js index b971408..78b358a 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 _0x61cb=['Users','map','unreadMessages','length','emit','catch','hook','exports','events','OpenchannelInteraction','../../mysqldb','OpenchannelMessage','setMaxListeners','save','remove','getUsers','then','setDataValue'];(function(_0x25e7cb,_0x3579b7){var _0x375d92=function(_0xe8cf3b){while(--_0xe8cf3b){_0x25e7cb['push'](_0x25e7cb['shift']());}};_0x375d92(++_0x3579b7);}(_0x61cb,0x1dc));var _0xb61c=function(_0x27830a,_0x4e8504){_0x27830a=_0x27830a-0x0;var _0x32ccc3=_0x61cb[_0x27830a];return _0x32ccc3;};'use strict';var EventEmitter=require(_0xb61c('0x0'));var OpenchannelInteraction=require('../../mysqldb')['db'][_0xb61c('0x1')];var OpenchannelMessage=require(_0xb61c('0x2'))['db'][_0xb61c('0x3')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0xb61c('0x4')](0x0);var events={'afterCreate':_0xb61c('0x5'),'afterUpdate':'update','afterDestroy':_0xb61c('0x6')};function emitEvent(_0x72853b){return function(_0x23f7cd,_0x374e91,_0x34d23e){_0x23f7cd[_0xb61c('0x7')]({'attributes':['id'],'raw':!![]})[_0xb61c('0x8')](function(_0x571a30){_0x23f7cd[_0xb61c('0x9')](_0xb61c('0xa'),_0x571a30[_0xb61c('0xb')](function(_0x415e1f){return{'id':_0x415e1f['id']};}));return OpenchannelMessage['findAll']({'where':{'OpenchannelInteractionId':_0x23f7cd['id'],'direction':'in','read':![]},'raw':!![]});})[_0xb61c('0x8')](function(_0x4bcdc6){_0x23f7cd[_0xb61c('0x9')](_0xb61c('0xc'),_0x4bcdc6[_0xb61c('0xd')]);OpenchannelInteractionEvents[_0xb61c('0xe')](_0x72853b+':'+_0x23f7cd['id'],_0x23f7cd);OpenchannelInteractionEvents[_0xb61c('0xe')](_0x72853b,_0x23f7cd);_0x34d23e(null);})[_0xb61c('0xf')](_0x34d23e(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelInteraction[_0xb61c('0x10')](e,emitEvent(event));}}module[_0xb61c('0x11')]=OpenchannelInteractionEvents; \ No newline at end of file +var _0xb5c7=['getUsers','then','setDataValue','Users','findAll','unreadMessages','emit','catch','hook','exports','events','../../mysqldb','OpenchannelMessage','setMaxListeners','save'];(function(_0x37545c,_0x9906f5){var _0x4cd312=function(_0x21536b){while(--_0x21536b){_0x37545c['push'](_0x37545c['shift']());}};_0x4cd312(++_0x9906f5);}(_0xb5c7,0xfa));var _0x7b5c=function(_0x4b55c9,_0x50a534){_0x4b55c9=_0x4b55c9-0x0;var _0x47995d=_0xb5c7[_0x4b55c9];return _0x47995d;};'use strict';var EventEmitter=require(_0x7b5c('0x0'));var OpenchannelInteraction=require(_0x7b5c('0x1'))['db']['OpenchannelInteraction'];var OpenchannelMessage=require(_0x7b5c('0x1'))['db'][_0x7b5c('0x2')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0x7b5c('0x3')](0x0);var events={'afterCreate':_0x7b5c('0x4'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x4cd2b2){return function(_0x1de264,_0x1a9e4b,_0x285af6){_0x1de264[_0x7b5c('0x5')]({'attributes':['id'],'raw':!![]})[_0x7b5c('0x6')](function(_0x5f0259){_0x1de264[_0x7b5c('0x7')](_0x7b5c('0x8'),_0x5f0259['map'](function(_0x19b516){return{'id':_0x19b516['id']};}));return OpenchannelMessage[_0x7b5c('0x9')]({'where':{'OpenchannelInteractionId':_0x1de264['id'],'direction':'in','read':![]},'raw':!![]});})[_0x7b5c('0x6')](function(_0x2b576e){_0x1de264[_0x7b5c('0x7')](_0x7b5c('0xa'),_0x2b576e['length']);OpenchannelInteractionEvents['emit'](_0x4cd2b2+':'+_0x1de264['id'],_0x1de264);OpenchannelInteractionEvents[_0x7b5c('0xb')](_0x4cd2b2,_0x1de264);_0x285af6(null);})[_0x7b5c('0xc')](_0x285af6(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelInteraction[_0x7b5c('0xd')](e,emitEvent(event));}}module[_0x7b5c('0xe')]=OpenchannelInteractionEvents; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.model.js b/server/api/openchannelInteraction/openchannelInteraction.model.js index a4b0161..8d8f3df 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 _0xf4f3=['changed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./openchannelInteraction.attributes','exports','define','OpenchannelInteraction','utf8mb4','utf8mb4_unicode_ci'];(function(_0x14c00f,_0x11b192){var _0x19fbda=function(_0xf9caa4){while(--_0xf9caa4){_0x14c00f['push'](_0x14c00f['shift']());}};_0x19fbda(++_0x11b192);}(_0xf4f3,0x94));var _0x3f4f=function(_0x3fce4d,_0x30b7ae){_0x3fce4d=_0x3fce4d-0x0;var _0x566ef0=_0xf4f3[_0x3fce4d];return _0x566ef0;};'use strict';var _=require(_0x3f4f('0x0'));var util=require('util');var logger=require(_0x3f4f('0x1'))(_0x3f4f('0x2'));var moment=require(_0x3f4f('0x3'));var BPromise=require(_0x3f4f('0x4'));var rp=require(_0x3f4f('0x5'));var fs=require('fs');var path=require(_0x3f4f('0x6'));var rimraf=require(_0x3f4f('0x7'));var config=require('../../config/environment');var attributes=require(_0x3f4f('0x8'));module[_0x3f4f('0x9')]=function(_0x1135c1,_0x197411){return _0x1135c1[_0x3f4f('0xa')](_0x3f4f('0xb'),attributes,{'tableName':'openchannel_interactions','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x3f4f('0xc'),'collate':_0x3f4f('0xd'),'hooks':{'beforeUpdate':function(_0x13c585,_0x5d235a,_0x13ec8b){if(_0x13c585[_0x3f4f('0xe')]('closed')){_0x13c585[_0x3f4f('0xf')]=moment()[_0x3f4f('0x10')](_0x3f4f('0x11'));}_0x13ec8b(null,_0x13c585);}}});}; \ No newline at end of file +var _0x439c=['path','rimraf','../../config/environment','./openchannelInteraction.attributes','exports','define','OpenchannelInteraction','openchannel_interactions','utf8mb4','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','api','moment','bluebird','request-promise'];(function(_0x28d153,_0x4898dd){var _0x832a70=function(_0x1a4721){while(--_0x1a4721){_0x28d153['push'](_0x28d153['shift']());}};_0x832a70(++_0x4898dd);}(_0x439c,0x86));var _0xc439=function(_0x241910,_0x352e51){_0x241910=_0x241910-0x0;var _0x1fbbbf=_0x439c[_0x241910];return _0x1fbbbf;};'use strict';var _=require(_0xc439('0x0'));var util=require(_0xc439('0x1'));var logger=require('../../config/logger')(_0xc439('0x2'));var moment=require(_0xc439('0x3'));var BPromise=require(_0xc439('0x4'));var rp=require(_0xc439('0x5'));var fs=require('fs');var path=require(_0xc439('0x6'));var rimraf=require(_0xc439('0x7'));var config=require(_0xc439('0x8'));var attributes=require(_0xc439('0x9'));module[_0xc439('0xa')]=function(_0x421c4d,_0x280870){return _0x421c4d[_0xc439('0xb')](_0xc439('0xc'),attributes,{'tableName':_0xc439('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xc439('0xe'),'collate':'utf8mb4_unicode_ci','hooks':{'beforeUpdate':function(_0x3a2338,_0x52c57c,_0xab05c8){if(_0x3a2338[_0xc439('0xf')](_0xc439('0x10'))){_0x3a2338[_0xc439('0x11')]=moment()[_0xc439('0x12')](_0xc439('0x13'));}_0xab05c8(null,_0x3a2338);}}});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.rpc.js b/server/api/openchannelInteraction/openchannelInteraction.rpc.js index b5b0e8d..090ef02 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 _0xa3b3=['info','OpenchannelInteraction,\x20%s,\x20%s','request\x20sent','debug','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','result','UpdateOpenchannelInteraction','update','options','raw','where','attributes','limit','catch','AddTagsToOpenchannelInteraction','OpenchannelInteraction','find','addTags','ids','omit','body','spread','AddTags','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','register','then'];(function(_0xdf7665,_0x181abb){var _0x4be9ff=function(_0x1c6873){while(--_0x1c6873){_0xdf7665['push'](_0xdf7665['shift']());}};_0x4be9ff(++_0x181abb);}(_0xa3b3,0xf1));var _0x3a3b=function(_0x42d201,_0x7bf3f7){_0x42d201=_0x42d201-0x0;var _0x45cbf5=_0xa3b3[_0x42d201];return _0x45cbf5;};'use strict';var _=require(_0x3a3b('0x0'));var util=require(_0x3a3b('0x1'));var moment=require(_0x3a3b('0x2'));var BPromise=require(_0x3a3b('0x3'));var rs=require(_0x3a3b('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3a3b('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x3a3b('0x6'))(_0x3a3b('0x7'));var config=require(_0x3a3b('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x3a3b('0x9')][_0x3a3b('0xa')]({'port':0x232a});config[_0x3a3b('0xb')]=_[_0x3a3b('0xc')](config[_0x3a3b('0xb')],{'host':_0x3a3b('0xd'),'port':0x18eb});var socket=require(_0x3a3b('0xe'))(new Redis(config['redis']));require('./openchannelInteraction.socket')[_0x3a3b('0xf')](socket);function respondWithRpcPromise(_0x47d2b1,_0x453353,_0x1fe401){return new BPromise(function(_0x1604ba,_0x325c57){return client['request'](_0x47d2b1,_0x1fe401)[_0x3a3b('0x10')](function(_0x16ee79){logger[_0x3a3b('0x11')](_0x3a3b('0x12'),_0x453353,_0x3a3b('0x13'));logger[_0x3a3b('0x14')](_0x3a3b('0x15'),_0x453353,_0x3a3b('0x13'),JSON[_0x3a3b('0x16')](_0x16ee79));if(_0x16ee79[_0x3a3b('0x17')]){if(_0x16ee79[_0x3a3b('0x17')]['code']===0x1f4){logger[_0x3a3b('0x17')](_0x3a3b('0x12'),_0x453353,_0x16ee79[_0x3a3b('0x17')][_0x3a3b('0x18')]);return _0x325c57(_0x16ee79[_0x3a3b('0x17')][_0x3a3b('0x18')]);}logger[_0x3a3b('0x17')]('OpenchannelInteraction,\x20%s,\x20%s',_0x453353,_0x16ee79['error']['message']);return _0x1604ba(_0x16ee79[_0x3a3b('0x17')]['message']);}else{logger['info'](_0x3a3b('0x12'),_0x453353,_0x3a3b('0x13'));_0x1604ba(_0x16ee79[_0x3a3b('0x19')][_0x3a3b('0x18')]);}})['catch'](function(_0x14b457){logger[_0x3a3b('0x17')](_0x3a3b('0x12'),_0x453353,_0x14b457);_0x325c57(_0x14b457);});});}exports[_0x3a3b('0x1a')]=function(_0x4c9e15){var _0x5874f2=this;return new Promise(function(_0x5f472f,_0x54331a){return db['OpenchannelInteraction'][_0x3a3b('0x1b')](_0x4c9e15['body'],{'raw':_0x4c9e15[_0x3a3b('0x1c')]?_0x4c9e15[_0x3a3b('0x1c')][_0x3a3b('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4c9e15['options']?_0x4c9e15[_0x3a3b('0x1c')][_0x3a3b('0x1e')]||null:null,'attributes':_0x4c9e15[_0x3a3b('0x1c')]?_0x4c9e15[_0x3a3b('0x1c')][_0x3a3b('0x1f')]||null:null,'limit':_0x4c9e15[_0x3a3b('0x1c')]?_0x4c9e15[_0x3a3b('0x1c')][_0x3a3b('0x20')]||null:null})['then'](function(_0x26c9b2){logger[_0x3a3b('0x11')](_0x3a3b('0x1a'),_0x4c9e15);logger[_0x3a3b('0x14')](_0x3a3b('0x1a'),_0x4c9e15,JSON[_0x3a3b('0x16')](_0x26c9b2));_0x5f472f(_0x26c9b2);})[_0x3a3b('0x21')](function(_0x40be0e){logger[_0x3a3b('0x17')](_0x3a3b('0x1a'),_0x40be0e[_0x3a3b('0x18')],_0x4c9e15);_0x54331a(_0x5874f2['error'](0x1f4,_0x40be0e[_0x3a3b('0x18')]));});});};exports[_0x3a3b('0x22')]=function(_0x46f805){return new Promise(function(_0x4614f4,_0x480cf3){return db[_0x3a3b('0x23')][_0x3a3b('0x24')]({'where':_0x46f805['options']?_0x46f805[_0x3a3b('0x1c')][_0x3a3b('0x1e')]||null:null})['then'](function(_0x33fe9c){if(_0x33fe9c){return _0x33fe9c[_0x3a3b('0x25')](_0x46f805['body'][_0x3a3b('0x26')],_[_0x3a3b('0x27')](_0x46f805[_0x3a3b('0x28')],['ids','id'])||{});}})[_0x3a3b('0x29')](function(_0x2c9fc8){logger['info'](_0x3a3b('0x2a'),_0x46f805);logger[_0x3a3b('0x14')](_0x3a3b('0x2a'),_0x46f805,JSON[_0x3a3b('0x16')](_0x2c9fc8));_0x4614f4(_0x2c9fc8);})['catch'](function(_0x10ca2d){logger[_0x3a3b('0x17')](_0x3a3b('0x2a'),_0x10ca2d[_0x3a3b('0x18')],_0x46f805);_0x480cf3(_this[_0x3a3b('0x17')](0x1f4,_0x10ca2d[_0x3a3b('0x18')]));});});}; \ No newline at end of file +var _0xcb24=['ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','register','request','then','info','OpenchannelInteraction,\x20%s,\x20%s','request\x20sent','debug','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','OpenchannelInteraction','update','body','options','raw','where','attributes','limit','stringify','UpdateOpenchannelInteraction','AddTagsToOpenchannelInteraction','find','ids','omit','AddTags','lodash','util','moment','randomstring'];(function(_0x3b96ae,_0xa19501){var _0x4b170c=function(_0x3f8e59){while(--_0x3f8e59){_0x3b96ae['push'](_0x3b96ae['shift']());}};_0x4b170c(++_0xa19501);}(_0xcb24,0xce));var _0x4cb2=function(_0x87ec6b,_0xb11380){_0x87ec6b=_0x87ec6b-0x0;var _0x15b9c6=_0xcb24[_0x87ec6b];return _0x15b9c6;};'use strict';var _=require(_0x4cb2('0x0'));var util=require(_0x4cb2('0x1'));var moment=require(_0x4cb2('0x2'));var BPromise=require('bluebird');var rs=require(_0x4cb2('0x3'));var fs=require('fs');var Redis=require(_0x4cb2('0x4'));var db=require(_0x4cb2('0x5'))['db'];var utils=require(_0x4cb2('0x6'));var logger=require(_0x4cb2('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x4cb2('0x8'));var client=jayson[_0x4cb2('0x9')]['http']({'port':0x232a});config[_0x4cb2('0xa')]=_[_0x4cb2('0xb')](config[_0x4cb2('0xa')],{'host':_0x4cb2('0xc'),'port':0x18eb});var socket=require(_0x4cb2('0xd'))(new Redis(config['redis']));require('./openchannelInteraction.socket')[_0x4cb2('0xe')](socket);function respondWithRpcPromise(_0x31b7c6,_0x5c8599,_0x309466){return new BPromise(function(_0x167b0f,_0x35d841){return client[_0x4cb2('0xf')](_0x31b7c6,_0x309466)[_0x4cb2('0x10')](function(_0x6aa7df){logger[_0x4cb2('0x11')](_0x4cb2('0x12'),_0x5c8599,_0x4cb2('0x13'));logger[_0x4cb2('0x14')](_0x4cb2('0x15'),_0x5c8599,_0x4cb2('0x13'),JSON['stringify'](_0x6aa7df));if(_0x6aa7df[_0x4cb2('0x16')]){if(_0x6aa7df[_0x4cb2('0x16')][_0x4cb2('0x17')]===0x1f4){logger[_0x4cb2('0x16')]('OpenchannelInteraction,\x20%s,\x20%s',_0x5c8599,_0x6aa7df[_0x4cb2('0x16')]['message']);return _0x35d841(_0x6aa7df[_0x4cb2('0x16')][_0x4cb2('0x18')]);}logger[_0x4cb2('0x16')](_0x4cb2('0x12'),_0x5c8599,_0x6aa7df['error'][_0x4cb2('0x18')]);return _0x167b0f(_0x6aa7df[_0x4cb2('0x16')][_0x4cb2('0x18')]);}else{logger['info']('OpenchannelInteraction,\x20%s,\x20%s',_0x5c8599,'request\x20sent');_0x167b0f(_0x6aa7df[_0x4cb2('0x19')][_0x4cb2('0x18')]);}})[_0x4cb2('0x1a')](function(_0x5a6976){logger[_0x4cb2('0x16')]('OpenchannelInteraction,\x20%s,\x20%s',_0x5c8599,_0x5a6976);_0x35d841(_0x5a6976);});});}exports['UpdateOpenchannelInteraction']=function(_0x90ce2a){var _0x28f80e=this;return new Promise(function(_0x5dc1b5,_0x49868c){return db[_0x4cb2('0x1b')][_0x4cb2('0x1c')](_0x90ce2a[_0x4cb2('0x1d')],{'raw':_0x90ce2a[_0x4cb2('0x1e')]?_0x90ce2a['options'][_0x4cb2('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x90ce2a[_0x4cb2('0x1e')]?_0x90ce2a['options'][_0x4cb2('0x20')]||null:null,'attributes':_0x90ce2a[_0x4cb2('0x1e')]?_0x90ce2a[_0x4cb2('0x1e')][_0x4cb2('0x21')]||null:null,'limit':_0x90ce2a[_0x4cb2('0x1e')]?_0x90ce2a[_0x4cb2('0x1e')][_0x4cb2('0x22')]||null:null})['then'](function(_0x25715e){logger[_0x4cb2('0x11')]('UpdateOpenchannelInteraction',_0x90ce2a);logger[_0x4cb2('0x14')]('UpdateOpenchannelInteraction',_0x90ce2a,JSON[_0x4cb2('0x23')](_0x25715e));_0x5dc1b5(_0x25715e);})[_0x4cb2('0x1a')](function(_0x1a60cd){logger[_0x4cb2('0x16')](_0x4cb2('0x24'),_0x1a60cd[_0x4cb2('0x18')],_0x90ce2a);_0x49868c(_0x28f80e[_0x4cb2('0x16')](0x1f4,_0x1a60cd[_0x4cb2('0x18')]));});});};exports[_0x4cb2('0x25')]=function(_0x9154b3){return new Promise(function(_0x2fa51e,_0x445c51){return db['OpenchannelInteraction'][_0x4cb2('0x26')]({'where':_0x9154b3[_0x4cb2('0x1e')]?_0x9154b3[_0x4cb2('0x1e')][_0x4cb2('0x20')]||null:null})[_0x4cb2('0x10')](function(_0x598c1b){if(_0x598c1b){return _0x598c1b['addTags'](_0x9154b3['body'][_0x4cb2('0x27')],_[_0x4cb2('0x28')](_0x9154b3[_0x4cb2('0x1d')],['ids','id'])||{});}})['spread'](function(_0x4101cd){logger[_0x4cb2('0x11')](_0x4cb2('0x29'),_0x9154b3);logger[_0x4cb2('0x14')](_0x4cb2('0x29'),_0x9154b3,JSON[_0x4cb2('0x23')](_0x4101cd));_0x2fa51e(_0x4101cd);})['catch'](function(_0x58446){logger['error'](_0x4cb2('0x29'),_0x58446[_0x4cb2('0x18')],_0x9154b3);_0x445c51(_this[_0x4cb2('0x16')](0x1f4,_0x58446[_0x4cb2('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.socket.js b/server/api/openchannelInteraction/openchannelInteraction.socket.js index bc25a62..c4c09f4 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 _0x9155=['register','openchannelInteraction:','./openchannelInteraction.events','save','update','emit','removeListener'];(function(_0xf3ba9b,_0x505c2c){var _0x5a7357=function(_0x2b2ffc){while(--_0x2b2ffc){_0xf3ba9b['push'](_0xf3ba9b['shift']());}};_0x5a7357(++_0x505c2c);}(_0x9155,0x191));var _0x5915=function(_0x118653,_0x50ef26){_0x118653=_0x118653-0x0;var _0xc11fa6=_0x9155[_0x118653];return _0xc11fa6;};'use strict';var OpenchannelInteractionEvents=require(_0x5915('0x0'));var events=[_0x5915('0x1'),'remove',_0x5915('0x2')];function createListener(_0x44c2b2,_0x44a13c){return function(_0xcb88ee){_0x44a13c[_0x5915('0x3')](_0x44c2b2,_0xcb88ee);};}function removeListener(_0x465a8b,_0x218986){return function(){OpenchannelInteractionEvents[_0x5915('0x4')](_0x465a8b,_0x218986);};}exports[_0x5915('0x5')]=function(_0xe74a36){for(var _0x210b48=0x0,_0x2f737c=events['length'];_0x210b48<_0x2f737c;_0x210b48++){var _0xb2320a=events[_0x210b48];var _0x176fee=createListener(_0x5915('0x6')+_0xb2320a,_0xe74a36);OpenchannelInteractionEvents['on'](_0xb2320a,_0x176fee);}}; \ No newline at end of file +var _0xcf43=['removeListener','register','length','openchannelInteraction:','save','remove','update','emit'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0xcf43,0x184));var _0x3cf4=function(_0x2852d3,_0x3e582d){_0x2852d3=_0x2852d3-0x0;var _0x19b543=_0xcf43[_0x2852d3];return _0x19b543;};'use strict';var OpenchannelInteractionEvents=require('./openchannelInteraction.events');var events=[_0x3cf4('0x0'),_0x3cf4('0x1'),_0x3cf4('0x2')];function createListener(_0x35ed46,_0x32fa97){return function(_0x5c11f4){_0x32fa97[_0x3cf4('0x3')](_0x35ed46,_0x5c11f4);};}function removeListener(_0x2ab857,_0x338742){return function(){OpenchannelInteractionEvents[_0x3cf4('0x4')](_0x2ab857,_0x338742);};}exports[_0x3cf4('0x5')]=function(_0x556671){for(var _0x35d912=0x0,_0x2174d4=events[_0x3cf4('0x6')];_0x35d912<_0x2174d4;_0x35d912++){var _0x4c6b97=events[_0x35d912];var _0x685dbb=createListener(_0x3cf4('0x7')+_0x4c6b97,_0x556671);OpenchannelInteractionEvents['on'](_0x4c6b97,_0x685dbb);}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/index.js b/server/api/openchannelMessage/index.js index e46b995..d9bff64 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 _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','describe','/:id','show','post','tracked','openchannel','openchannelmessage:create','put','update','/:id/accept','accept','/:id/reject','reject','delete','destroy','multer','util'];(function(_0x2dda5d,_0x4bde46){var _0x24166e=function(_0x21dd33){while(--_0x21dd33){_0x2dda5d['push'](_0x2dda5d['shift']());}};_0x24166e(++_0x4bde46);}(_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('./openchannelMessage.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')](),interaction[_0x0d8b('0xe')](_0x0d8b('0xf'),_0x0d8b('0x10')),controller['create']);router[_0x0d8b('0x11')]('/:id',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x12')]);router[_0x0d8b('0x11')](_0x0d8b('0x13'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x14')]);router[_0x0d8b('0x11')](_0x0d8b('0x15'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x16')]);router[_0x0d8b('0x17')](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x18')]);module['exports']=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(_0x551642,_0x3c3a5a){var _0x22f161=function(_0x5eb8bc){while(--_0x5eb8bc){_0x551642['push'](_0x551642['shift']());}};_0x22f161(++_0x3c3a5a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x491a7f,_0x28bb80){_0x491a7f=_0x491a7f-0x0;var _0x3d8f44=_0xa9e0[_0x491a7f];return _0x3d8f44;};'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 b2fd9d5..21a8bc6 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 _0x0447=['ENUM','out','DATE','STRING','sequelize','exports','TEXT','medium','BOOLEAN'];(function(_0xa1e2fd,_0x1c9305){var _0x218880=function(_0x405167){while(--_0x405167){_0xa1e2fd['push'](_0xa1e2fd['shift']());}};_0x218880(++_0x1c9305);}(_0x0447,0x8b));var _0x7044=function(_0x508c11,_0x308545){_0x508c11=_0x508c11-0x0;var _0x438f65=_0x0447[_0x508c11];return _0x438f65;};'use strict';var Sequelize=require(_0x7044('0x0'));module[_0x7044('0x1')]={'body':{'type':Sequelize[_0x7044('0x2')](_0x7044('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x7044('0x4')],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x7044('0x5')]('in',_0x7044('0x6')),'defaultValue':_0x7044('0x6'),'allowNull':![]},'readAt':{'type':Sequelize[_0x7044('0x7')]},'providerName':{'type':Sequelize[_0x7044('0x8')]},'providerResponse':{'type':Sequelize[_0x7044('0x2')]}}; \ No newline at end of file +var _0xdca3=['ENUM','out','DATE','STRING','sequelize','TEXT','medium','BOOLEAN'];(function(_0xb81680,_0x1e4652){var _0x48b446=function(_0xb891ea){while(--_0xb891ea){_0xb81680['push'](_0xb81680['shift']());}};_0x48b446(++_0x1e4652);}(_0xdca3,0x64));var _0x3dca=function(_0x2bfeff,_0xb6f1fc){_0x2bfeff=_0x2bfeff-0x0;var _0x328c5b=_0xdca3[_0x2bfeff];return _0x328c5b;};'use strict';var Sequelize=require(_0x3dca('0x0'));module['exports']={'body':{'type':Sequelize[_0x3dca('0x1')](_0x3dca('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x3dca('0x3')],'defaultValue':![]},'secret':{'type':Sequelize[_0x3dca('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x3dca('0x4')]('in',_0x3dca('0x5')),'defaultValue':_0x3dca('0x5'),'allowNull':![]},'readAt':{'type':Sequelize[_0x3dca('0x6')]},'providerName':{'type':Sequelize[_0x3dca('0x7')]},'providerResponse':{'type':Sequelize[_0x3dca('0x1')]}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.controller.js b/server/api/openchannelMessage/openchannelMessage.controller.js index a9a222a..a263c11 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 _0x081e=['acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','QueryTypes','SELECT','contact','User','fullname','email','manual','interface','channel','motionChannel','event','accept','EventManager','../../config/logger','openchannel-interactions','reject','interaction','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','internal','SIP/%s','rejectmessage','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','redis','defaults','socket.io-emitter','./openchannelMessage.socket','register','jayson/promise','http','client','then','OpenchannelMessage,\x20%s,\x20%s','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','result','catch','sendStatus','end','json','offset','limit','undefined','count','status','Content-Range','update','destroy','stack','name','send','index','map','OpenchannelMessage','rawAttributes','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','options','includeAll','include','findAll','params','keys','find','create','body','describe','openchannel','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','OpenchannelInteraction','OpenchannelInteractionId','isNil','read1stAt','[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage'];(function(_0x230489,_0x320811){var _0x414f3d=function(_0x42c9e9){while(--_0x42c9e9){_0x230489['push'](_0x230489['shift']());}};_0x414f3d(++_0x320811);}(_0x081e,0x9f));var _0xe081=function(_0x2f48a7,_0x54ea3c){_0x2f48a7=_0x2f48a7-0x0;var _0x3546f6=_0x081e[_0x2f48a7];return _0x3546f6;};'use strict';var emlformat=require(_0xe081('0x0'));var rimraf=require(_0xe081('0x1'));var zipdir=require(_0xe081('0x2'));var jsonpatch=require(_0xe081('0x3'));var rp=require(_0xe081('0x4'));var moment=require(_0xe081('0x5'));var BPromise=require(_0xe081('0x6'));var Mustache=require(_0xe081('0x7'));var util=require(_0xe081('0x8'));var path=require('path');var sox=require(_0xe081('0x9'));var csv=require(_0xe081('0xa'));var ejs=require(_0xe081('0xb'));var fs=require('fs');var fs_extra=require(_0xe081('0xc'));var _=require(_0xe081('0xd'));var squel=require(_0xe081('0xe'));var crypto=require(_0xe081('0xf'));var jsforce=require(_0xe081('0x10'));var deskjs=require(_0xe081('0x11'));var toCsv=require(_0xe081('0xa'));var querystring=require(_0xe081('0x12'));var Papa=require('papaparse');var Redis=require(_0xe081('0x13'));var authService=require(_0xe081('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0xe081('0x15'));var hardwareService=require(_0xe081('0x16'));var logger=require('../../config/logger')(_0xe081('0x17'));var utils=require('../../config/utils');var config=require(_0xe081('0x18'));var licenseUtil=require(_0xe081('0x19'));var db=require('../../mysqldb')['db'];config[_0xe081('0x1a')]=_[_0xe081('0x1b')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xe081('0x1c'))(new Redis(config[_0xe081('0x1a')]));require(_0xe081('0x1d'))[_0xe081('0x1e')](socket);var jayson=require(_0xe081('0x1f'));var client=jayson['client'][_0xe081('0x20')]({'port':0x232c});var client9002=jayson[_0xe081('0x21')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2a5d33,_0x5332c4,_0x580084,_0x62113d){return new BPromise(function(_0x53be59,_0x23c449){var _0xf451b3=_0x62113d||client;return _0xf451b3['request'](_0x2a5d33,_0x580084)[_0xe081('0x22')](function(_0x56900f){logger['info'](_0xe081('0x23'),_0x5332c4,'request\x20sent');logger[_0xe081('0x24')](_0xe081('0x25'),_0x5332c4,_0xe081('0x26'),JSON[_0xe081('0x27')](_0x56900f));if(_0x56900f[_0xe081('0x28')]){if(_0x56900f['error']['code']===0x1f4){logger[_0xe081('0x28')](_0xe081('0x23'),_0x5332c4,_0x56900f['error'][_0xe081('0x29')]);return _0x23c449(_0x56900f['error']['message']);}logger['error']('OpenchannelMessage,\x20%s,\x20%s',_0x5332c4,_0x56900f[_0xe081('0x28')][_0xe081('0x29')]);return _0x53be59(_0x56900f[_0xe081('0x28')][_0xe081('0x29')]);}else{logger[_0xe081('0x2a')](_0xe081('0x23'),_0x5332c4,_0xe081('0x26'));_0x53be59(_0x56900f[_0xe081('0x2b')][_0xe081('0x29')]);}})[_0xe081('0x2c')](function(_0x5447ca){logger[_0xe081('0x28')](_0xe081('0x23'),_0x5332c4,_0x5447ca);_0x23c449(_0x5447ca);});});}function respondWithStatusCode(_0x357e4b,_0x6f43f8){_0x6f43f8=_0x6f43f8||0xcc;return function(_0x3f8955){if(_0x3f8955){return _0x357e4b[_0xe081('0x2d')](_0x6f43f8);}return _0x357e4b['status'](_0x6f43f8)[_0xe081('0x2e')]();};}function respondWithResult(_0x598b6e,_0x1fdc32){_0x1fdc32=_0x1fdc32||0xc8;return function(_0x5acf9f){if(_0x5acf9f){return _0x598b6e['status'](_0x1fdc32)[_0xe081('0x2f')](_0x5acf9f);}};}function respondWithFilteredResult(_0x3d931a,_0x5454af){return function(_0x518d38){if(_0x518d38){var _0x1e9872=typeof _0x5454af[_0xe081('0x30')]==='undefined'&&typeof _0x5454af[_0xe081('0x31')]===_0xe081('0x32');var _0x389f26=_0x518d38[_0xe081('0x33')];var _0xaa001=_0x1e9872?0x0:_0x5454af[_0xe081('0x30')];var _0x4d8fc1=_0x1e9872?_0x518d38[_0xe081('0x33')]:_0x5454af[_0xe081('0x30')]+_0x5454af[_0xe081('0x31')];var _0x374eef;if(_0x4d8fc1>=_0x389f26){_0x4d8fc1=_0x389f26;_0x374eef=0xc8;}else{_0x374eef=0xce;}_0x3d931a[_0xe081('0x34')](_0x374eef);return _0x3d931a['set'](_0xe081('0x35'),_0xaa001+'-'+_0x4d8fc1+'/'+_0x389f26)[_0xe081('0x2f')](_0x518d38);}return null;};}function patchUpdates(_0x4fafb8){return function(_0x5bf988){try{jsonpatch['apply'](_0x5bf988,_0x4fafb8,!![]);}catch(_0x5aba6a){return BPromise['reject'](_0x5aba6a);}return _0x5bf988['save']();};}function saveUpdates(_0x36fe99,_0x17be83){return function(_0x18f78c){if(_0x18f78c){return _0x18f78c[_0xe081('0x36')](_0x36fe99)['then'](function(_0x3d69cf){return _0x3d69cf;});}return null;};}function removeEntity(_0x423f40,_0x5b837b){return function(_0x13a356){if(_0x13a356){return _0x13a356[_0xe081('0x37')]()[_0xe081('0x22')](function(){_0x423f40[_0xe081('0x34')](0xcc)[_0xe081('0x2e')]();});}};}function handleEntityNotFound(_0x416cb0,_0x238185){return function(_0x64997f){if(!_0x64997f){_0x416cb0['sendStatus'](0x194);}return _0x64997f;};}function handleError(_0x370b05,_0x596bb5){_0x596bb5=_0x596bb5||0x1f4;return function(_0x141ec6){logger['error'](_0x141ec6[_0xe081('0x38')]);if(_0x141ec6[_0xe081('0x39')]){delete _0x141ec6[_0xe081('0x39')];}_0x370b05['status'](_0x596bb5)[_0xe081('0x3a')](_0x141ec6);};}exports[_0xe081('0x3b')]=function(_0x454721,_0x3bd08e){var _0x25cfa7={},_0x564bff={},_0x38f4c1={'count':0x0,'rows':[]};var _0x520fb3=_[_0xe081('0x3c')](db[_0xe081('0x3d')][_0xe081('0x3e')],function(_0x4a7612){return{'name':_0x4a7612['fieldName'],'type':_0x4a7612['type'][_0xe081('0x3f')]};});_0x564bff['model']=_['map'](_0x520fb3,_0xe081('0x39'));_0x564bff['query']=_['keys'](_0x454721[_0xe081('0x40')]);_0x564bff[_0xe081('0x41')]=_[_0xe081('0x42')](_0x564bff[_0xe081('0x43')],_0x564bff['query']);_0x25cfa7[_0xe081('0x44')]=_[_0xe081('0x42')](_0x564bff[_0xe081('0x43')],qs[_0xe081('0x45')](_0x454721['query'][_0xe081('0x45')]));_0x25cfa7[_0xe081('0x44')]=_0x25cfa7['attributes'][_0xe081('0x46')]?_0x25cfa7[_0xe081('0x44')]:_0x564bff[_0xe081('0x43')];if(!_0x454721[_0xe081('0x40')][_0xe081('0x47')](_0xe081('0x48'))){_0x25cfa7[_0xe081('0x31')]=qs[_0xe081('0x31')](_0x454721[_0xe081('0x40')][_0xe081('0x31')]);_0x25cfa7[_0xe081('0x30')]=qs[_0xe081('0x30')](_0x454721[_0xe081('0x40')][_0xe081('0x30')]);}_0x25cfa7[_0xe081('0x49')]=qs[_0xe081('0x4a')](_0x454721[_0xe081('0x40')][_0xe081('0x4a')]);_0x25cfa7[_0xe081('0x4b')]=qs[_0xe081('0x41')](_['pick'](_0x454721[_0xe081('0x40')],_0x564bff['filters']),_0x520fb3);if(_0x454721[_0xe081('0x40')]['filter']){_0x25cfa7['where']=_[_0xe081('0x4c')](_0x25cfa7[_0xe081('0x4b')],{'$or':_[_0xe081('0x3c')](_0x520fb3,function(_0xbc4430){if(_0xbc4430['type']!==_0xe081('0x4d')){var _0x3d7494={};_0x3d7494[_0xbc4430[_0xe081('0x39')]]={'$like':'%'+_0x454721['query']['filter']+'%'};return _0x3d7494;}})});}_0x25cfa7=_[_0xe081('0x4c')]({},_0x25cfa7,_0x454721[_0xe081('0x4e')]);var _0x5721e8={'where':_0x25cfa7[_0xe081('0x4b')]};return db[_0xe081('0x3d')]['count'](_0x5721e8)[_0xe081('0x22')](function(_0x16907a){_0x38f4c1[_0xe081('0x33')]=_0x16907a;if(_0x454721[_0xe081('0x40')][_0xe081('0x4f')]){_0x25cfa7[_0xe081('0x50')]=[{'all':!![]}];}return db[_0xe081('0x3d')][_0xe081('0x51')](_0x25cfa7);})[_0xe081('0x22')](function(_0x204c37){_0x38f4c1['rows']=_0x204c37;return _0x38f4c1;})[_0xe081('0x22')](respondWithFilteredResult(_0x3bd08e,_0x25cfa7))[_0xe081('0x2c')](handleError(_0x3bd08e,null));};exports['show']=function(_0x2aeb77,_0x1b7b87){var _0x4b8945={'raw':!![],'where':{'id':_0x2aeb77[_0xe081('0x52')]['id']}},_0x4a77a4={};_0x4a77a4[_0xe081('0x43')]=_[_0xe081('0x53')](db[_0xe081('0x3d')][_0xe081('0x3e')]);_0x4a77a4[_0xe081('0x40')]=_[_0xe081('0x53')](_0x2aeb77[_0xe081('0x40')]);_0x4a77a4[_0xe081('0x41')]=_[_0xe081('0x42')](_0x4a77a4[_0xe081('0x43')],_0x4a77a4[_0xe081('0x40')]);_0x4b8945[_0xe081('0x44')]=_[_0xe081('0x42')](_0x4a77a4['model'],qs[_0xe081('0x45')](_0x2aeb77[_0xe081('0x40')][_0xe081('0x45')]));_0x4b8945[_0xe081('0x44')]=_0x4b8945[_0xe081('0x44')][_0xe081('0x46')]?_0x4b8945['attributes']:_0x4a77a4[_0xe081('0x43')];if(_0x2aeb77['query'][_0xe081('0x4f')]){_0x4b8945[_0xe081('0x50')]=[{'all':!![]}];}_0x4b8945=_['merge']({},_0x4b8945,_0x2aeb77['options']);return db['OpenchannelMessage'][_0xe081('0x54')](_0x4b8945)['then'](handleEntityNotFound(_0x1b7b87,null))['then'](respondWithResult(_0x1b7b87,null))[_0xe081('0x2c')](handleError(_0x1b7b87,null));};exports[_0xe081('0x55')]=function(_0x26b496,_0x3ba3ae){return db['OpenchannelMessage']['create'](_0x26b496[_0xe081('0x56')],{})['then'](respondWithResult(_0x3ba3ae,0xc9))[_0xe081('0x2c')](handleError(_0x3ba3ae,null));};exports['update']=function(_0x148803,_0xb55972){if(_0x148803[_0xe081('0x56')]['id']){delete _0x148803[_0xe081('0x56')]['id'];}return db[_0xe081('0x3d')][_0xe081('0x54')]({'where':{'id':_0x148803[_0xe081('0x52')]['id']}})[_0xe081('0x22')](handleEntityNotFound(_0xb55972,null))[_0xe081('0x22')](saveUpdates(_0x148803[_0xe081('0x56')],null))[_0xe081('0x22')](respondWithResult(_0xb55972,null))[_0xe081('0x2c')](handleError(_0xb55972,null));};exports['destroy']=function(_0x5eb60c,_0x1566ae){return db[_0xe081('0x3d')][_0xe081('0x54')]({'where':{'id':_0x5eb60c[_0xe081('0x52')]['id']}})[_0xe081('0x22')](handleEntityNotFound(_0x1566ae,null))[_0xe081('0x22')](removeEntity(_0x1566ae,null))[_0xe081('0x2c')](handleError(_0x1566ae,null));};exports[_0xe081('0x57')]=function(_0x3965d5,_0x25feb8){return db[_0xe081('0x3d')][_0xe081('0x57')]()['then'](respondWithResult(_0x25feb8,null))[_0xe081('0x2c')](handleError(_0x25feb8,null));};var interaction_log=require('../../config/logger')('openchannel-interactions');exports['accept']=function(_0x3de946,_0x19538b,_0x24cb39){var _0x1978ec={'agent':{},'channel':_0xe081('0x58')};if(_0x3de946[_0xe081('0x56')]['id']){delete _0x3de946[_0xe081('0x56')]['id'];}_0x3de946[_0xe081('0x56')][_0xe081('0x59')]=!![];_0x3de946[_0xe081('0x56')][_0xe081('0x5a')]=moment()[_0xe081('0x5b')](_0xe081('0x5c'));_0x3de946['body'][_0xe081('0x5d')]=_0x3de946[_0xe081('0x56')][_0xe081('0x5d')]||_0x3de946[_0xe081('0x5e')]['id'];_0x1978ec[_0xe081('0x5f')]['id']=_0x3de946[_0xe081('0x56')][_0xe081('0x5d')];return db['OpenchannelMessage'][_0xe081('0x54')]({'where':{'id':_0x3de946[_0xe081('0x52')]['id'],'UserId':null}})[_0xe081('0x22')](handleEntityNotFound(_0x19538b,null))[_0xe081('0x22')](saveUpdates(_0x3de946[_0xe081('0x56')],null))[_0xe081('0x22')](function(_0x2e91b5){if(_0x2e91b5){_0x1978ec[_0xe081('0x29')]=_0x2e91b5[_0xe081('0x60')]({'plain':!![]});return db[_0xe081('0x61')]['find']({'where':{'id':_0x2e91b5[_0xe081('0x62')]}});}return null;})[_0xe081('0x22')](handleEntityNotFound(_0x19538b,null))[_0xe081('0x22')](function(_0x291100){if(_0x291100){return _0x291100[_0xe081('0x36')]({'UserId':_0x3de946[_0xe081('0x56')][_0xe081('0x5d')],'read1stAt':_[_0xe081('0x63')](_0x291100[_0xe081('0x64')])?moment()['format'](_0xe081('0x5c')):undefined});}return null;})[_0xe081('0x22')](function(_0x2fdf1d){if(_0x2fdf1d){_0x1978ec['interaction']=_0x2fdf1d[_0xe081('0x60')]({'plain':!![]});interaction_log[_0xe081('0x2a')](_0xe081('0x65'),_0x3de946[_0xe081('0x5e')]['id'],_0x3de946[_0xe081('0x5e')]['name'],_0x3de946[_0xe081('0x5e')][_0xe081('0x66')],_0x1978ec['interaction']['id'],_0x3de946[_0xe081('0x56')]?JSON[_0xe081('0x27')](_0x3de946[_0xe081('0x56')]):_0xe081('0x67'));return respondWithRpcPromise(_0xe081('0x68'),_0xe081('0x69'),_0x1978ec);}return null;})[_0xe081('0x22')](function(_0x49800d){var _0x47cff9=_0xe081('0x6a')+_0x49800d['message'][_0xe081('0x6b')];return db[_0xe081('0x6c')][_0xe081('0x40')](_0x47cff9,{'type':db['Sequelize'][_0xe081('0x6d')][_0xe081('0x6e')],'raw':!![]})[_0xe081('0x22')](function(_0x25f570){return _0x25f570;});})[_0xe081('0x22')](function(_0x124cf6){if(_0x124cf6){_0x1978ec[_0xe081('0x29')][_0xe081('0x6f')]=_0x124cf6[0x0];if(!_0x3de946[_0xe081('0x56')][_0xe081('0x5d')])return;return db[_0xe081('0x70')]['find']({'where':{'id':_0x3de946[_0xe081('0x56')][_0xe081('0x5d')],'role':_0xe081('0x5f')},'attributes':['id',_0xe081('0x39'),_0xe081('0x71'),_0xe081('0x72'),'internal'],'raw':!![]});}return null;})[_0xe081('0x22')](function(_0x4db157){if(!_0x4db157)return null;_0x1978ec['message']['agent']=_0x4db157;return _0x1978ec;})[_0xe081('0x22')](function(_0x5b3957){if(_0x5b3957){if(_0x3de946[_0xe081('0x56')][_0xe081('0x73')]){_0x1978ec[_0xe081('0x29')][_0xe081('0x74')]=util[_0xe081('0x5b')]('SIP/%s',_0x3de946[_0xe081('0x5e')][_0xe081('0x39')]);_0x1978ec['message'][_0xe081('0x75')]=_0x1978ec[_0xe081('0x75')];_0x1978ec[_0xe081('0x29')][_0xe081('0x76')]=_0x1978ec[_0xe081('0x75')];_0x1978ec[_0xe081('0x29')][_0xe081('0x77')]=_0xe081('0x78');return respondWithRpcPromise(_0xe081('0x79'),_0xe081('0x79'),{'event':'acceptmessage','message':_0x1978ec['message']},client9002)['then'](function(){return _0x1978ec;});}return _0x1978ec;}return null;})[_0xe081('0x22')](respondWithResult(_0x19538b,null))[_0xe081('0x2c')](handleError(_0x19538b,null));};var interaction_log=require(_0xe081('0x7a'))(_0xe081('0x7b'));exports[_0xe081('0x7c')]=function(_0x38a462,_0x20e9f3,_0x4d124f){var _0x2452ae={'agent':{},'channel':_0xe081('0x58')};if(_0x38a462['body']['id']){delete _0x38a462[_0xe081('0x56')]['id'];}_0x38a462[_0xe081('0x56')][_0xe081('0x5d')]=_0x38a462[_0xe081('0x56')]['UserId']||_0x38a462['user']['id'];_0x2452ae[_0xe081('0x5f')]['id']=_0x38a462['body']['UserId'];return db[_0xe081('0x3d')]['find']({'where':{'id':_0x38a462['params']['id'],'UserId':null}})[_0xe081('0x22')](handleEntityNotFound(_0x20e9f3,null))['then'](function(_0x1e55af){if(_0x1e55af){_0x2452ae[_0xe081('0x29')]=_0x1e55af['get']({'plain':!![]});return db[_0xe081('0x61')][_0xe081('0x54')]({'where':{'id':_0x1e55af[_0xe081('0x62')]}});}return null;})[_0xe081('0x22')](handleEntityNotFound(_0x20e9f3,null))[_0xe081('0x22')](function(_0x509a07){if(_0x509a07){_0x2452ae[_0xe081('0x7d')]=_0x509a07['get']({'plain':!![]});interaction_log[_0xe081('0x2a')](_0xe081('0x7e'),_0x38a462['user']['id'],_0x38a462[_0xe081('0x5e')][_0xe081('0x39')],_0x38a462['user'][_0xe081('0x66')],_0x2452ae[_0xe081('0x7d')]['id'],_0x38a462[_0xe081('0x56')]?JSON[_0xe081('0x27')](_0x38a462[_0xe081('0x56')]):_0xe081('0x67'));return respondWithRpcPromise(_0xe081('0x7f'),_0xe081('0x80'),_0x2452ae);}return null;})[_0xe081('0x22')](function(_0x36b7e9){var _0x4e04c6=_0xe081('0x6a')+_0x36b7e9[_0xe081('0x29')][_0xe081('0x6b')];return db[_0xe081('0x6c')][_0xe081('0x40')](_0x4e04c6,{'type':db['Sequelize'][_0xe081('0x6d')][_0xe081('0x6e')],'raw':!![]})[_0xe081('0x22')](function(_0x1ea3a2){return _0x1ea3a2;});})['then'](function(_0x344592){if(_0x344592){_0x2452ae['message']['contact']=_0x344592[0x0];if(!_0x38a462[_0xe081('0x56')][_0xe081('0x5d')])return;return db[_0xe081('0x70')][_0xe081('0x54')]({'where':{'id':_0x38a462[_0xe081('0x56')][_0xe081('0x5d')],'role':_0xe081('0x5f')},'attributes':['id',_0xe081('0x39'),_0xe081('0x71'),'email',_0xe081('0x81')],'raw':!![]});}return null;})[_0xe081('0x22')](function(_0x27bed7){if(!_0x27bed7)return null;_0x2452ae[_0xe081('0x29')][_0xe081('0x5f')]=_0x27bed7;return _0x2452ae;})['then'](function(_0x36d771){if(_0x36d771){_0x36d771[_0xe081('0x29')][_0xe081('0x74')]=util[_0xe081('0x5b')](_0xe081('0x82'),_0x38a462['user'][_0xe081('0x39')]);_0x36d771['message']['channel']=_0x2452ae['channel'];_0x36d771['message'][_0xe081('0x76')]=_0x2452ae['channel'];_0x36d771['message'][_0xe081('0x77')]='reject';respondWithRpcPromise(_0xe081('0x79'),_0xe081('0x79'),{'event':_0xe081('0x83'),'message':_0x36d771['message']},client9002);return _0x2452ae;}return null;})[_0xe081('0x22')](respondWithResult(_0x20e9f3,null))[_0xe081('0x2c')](handleError(_0x20e9f3,null));}; \ No newline at end of file +var _0x39e6=['QueryTypes','SELECT','contact','User','fullname','email','internal','manual','interface','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','reject','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','sequelize','rejectmessage','eml-format','zip-dir','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./openchannelMessage.socket','register','jayson/promise','client','http','request','then','info','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','error','code','OpenchannelMessage,\x20%s,\x20%s','message','result','catch','sendStatus','end','status','offset','undefined','limit','set','json','save','update','destroy','stack','name','index','map','OpenchannelMessage','type','key','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','count','includeAll','include','rows','show','params','rawAttributes','find','create','body','describe','../../config/logger','openchannel-interactions','accept','openchannel','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','OpenchannelInteraction','isNil','read1stAt','interaction','[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','stringify','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','Sequelize'];(function(_0x256684,_0x529c1e){var _0x37a0c9=function(_0x4b431b){while(--_0x4b431b){_0x256684['push'](_0x256684['shift']());}};_0x37a0c9(++_0x529c1e);}(_0x39e6,0x9e));var _0x639e=function(_0x5af03b,_0xf8f69e){_0x5af03b=_0x5af03b-0x0;var _0x11a0ad=_0x39e6[_0x5af03b];return _0x11a0ad;};'use strict';var emlformat=require(_0x639e('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x639e('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x639e('0x2'));var BPromise=require(_0x639e('0x3'));var Mustache=require('mustache');var util=require(_0x639e('0x4'));var path=require(_0x639e('0x5'));var sox=require(_0x639e('0x6'));var csv=require(_0x639e('0x7'));var ejs=require(_0x639e('0x8'));var fs=require('fs');var fs_extra=require(_0x639e('0x9'));var _=require(_0x639e('0xa'));var squel=require(_0x639e('0xb'));var crypto=require(_0x639e('0xc'));var jsforce=require(_0x639e('0xd'));var deskjs=require(_0x639e('0xe'));var toCsv=require(_0x639e('0x7'));var querystring=require(_0x639e('0xf'));var Papa=require(_0x639e('0x10'));var Redis=require(_0x639e('0x11'));var authService=require(_0x639e('0x12'));var qs=require(_0x639e('0x13'));var as=require(_0x639e('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x639e('0x15'));var utils=require(_0x639e('0x16'));var config=require(_0x639e('0x17'));var licenseUtil=require(_0x639e('0x18'));var db=require(_0x639e('0x19'))['db'];config[_0x639e('0x1a')]=_[_0x639e('0x1b')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x639e('0x1c'))(new Redis(config[_0x639e('0x1a')]));require(_0x639e('0x1d'))[_0x639e('0x1e')](socket);var jayson=require(_0x639e('0x1f'));var client=jayson[_0x639e('0x20')]['http']({'port':0x232c});var client9002=jayson[_0x639e('0x20')][_0x639e('0x21')]({'port':0x232a});function respondWithRpcPromise(_0x23f0f9,_0x4077c5,_0x4fa3fa,_0x6dd912){return new BPromise(function(_0x4b9634,_0x13a93c){var _0x3932a8=_0x6dd912||client;return _0x3932a8[_0x639e('0x22')](_0x23f0f9,_0x4fa3fa)[_0x639e('0x23')](function(_0x36b75a){logger[_0x639e('0x24')]('OpenchannelMessage,\x20%s,\x20%s',_0x4077c5,_0x639e('0x25'));logger[_0x639e('0x26')](_0x639e('0x27'),_0x4077c5,_0x639e('0x25'),JSON['stringify'](_0x36b75a));if(_0x36b75a[_0x639e('0x28')]){if(_0x36b75a[_0x639e('0x28')][_0x639e('0x29')]===0x1f4){logger[_0x639e('0x28')](_0x639e('0x2a'),_0x4077c5,_0x36b75a['error'][_0x639e('0x2b')]);return _0x13a93c(_0x36b75a[_0x639e('0x28')]['message']);}logger[_0x639e('0x28')]('OpenchannelMessage,\x20%s,\x20%s',_0x4077c5,_0x36b75a['error'][_0x639e('0x2b')]);return _0x4b9634(_0x36b75a[_0x639e('0x28')][_0x639e('0x2b')]);}else{logger[_0x639e('0x24')](_0x639e('0x2a'),_0x4077c5,'request\x20sent');_0x4b9634(_0x36b75a[_0x639e('0x2c')][_0x639e('0x2b')]);}})[_0x639e('0x2d')](function(_0x2da264){logger[_0x639e('0x28')]('OpenchannelMessage,\x20%s,\x20%s',_0x4077c5,_0x2da264);_0x13a93c(_0x2da264);});});}function respondWithStatusCode(_0x381554,_0x97665a){_0x97665a=_0x97665a||0xcc;return function(_0x3a4fe3){if(_0x3a4fe3){return _0x381554[_0x639e('0x2e')](_0x97665a);}return _0x381554['status'](_0x97665a)[_0x639e('0x2f')]();};}function respondWithResult(_0x282d87,_0x13ef2b){_0x13ef2b=_0x13ef2b||0xc8;return function(_0x49b921){if(_0x49b921){return _0x282d87[_0x639e('0x30')](_0x13ef2b)['json'](_0x49b921);}};}function respondWithFilteredResult(_0x38ce3a,_0x4da5f4){return function(_0x525a1f){if(_0x525a1f){var _0x2c8e3a=typeof _0x4da5f4[_0x639e('0x31')]===_0x639e('0x32')&&typeof _0x4da5f4[_0x639e('0x33')]===_0x639e('0x32');var _0xefc97b=_0x525a1f['count'];var _0x213b7e=_0x2c8e3a?0x0:_0x4da5f4[_0x639e('0x31')];var _0x50ccfa=_0x2c8e3a?_0x525a1f['count']:_0x4da5f4[_0x639e('0x31')]+_0x4da5f4[_0x639e('0x33')];var _0x3b47e7;if(_0x50ccfa>=_0xefc97b){_0x50ccfa=_0xefc97b;_0x3b47e7=0xc8;}else{_0x3b47e7=0xce;}_0x38ce3a['status'](_0x3b47e7);return _0x38ce3a[_0x639e('0x34')]('Content-Range',_0x213b7e+'-'+_0x50ccfa+'/'+_0xefc97b)[_0x639e('0x35')](_0x525a1f);}return null;};}function patchUpdates(_0x22c74b){return function(_0x2fc410){try{jsonpatch['apply'](_0x2fc410,_0x22c74b,!![]);}catch(_0x157d07){return BPromise['reject'](_0x157d07);}return _0x2fc410[_0x639e('0x36')]();};}function saveUpdates(_0xdbacd8,_0x15b440){return function(_0x5b71a8){if(_0x5b71a8){return _0x5b71a8[_0x639e('0x37')](_0xdbacd8)[_0x639e('0x23')](function(_0x2d5add){return _0x2d5add;});}return null;};}function removeEntity(_0x49289c,_0x190c91){return function(_0x4b2ad5){if(_0x4b2ad5){return _0x4b2ad5[_0x639e('0x38')]()[_0x639e('0x23')](function(){_0x49289c[_0x639e('0x30')](0xcc)[_0x639e('0x2f')]();});}};}function handleEntityNotFound(_0x389676,_0x5e3e8b){return function(_0xa5d182){if(!_0xa5d182){_0x389676[_0x639e('0x2e')](0x194);}return _0xa5d182;};}function handleError(_0x18b8c4,_0x1d0b86){_0x1d0b86=_0x1d0b86||0x1f4;return function(_0x4b8a3e){logger[_0x639e('0x28')](_0x4b8a3e[_0x639e('0x39')]);if(_0x4b8a3e[_0x639e('0x3a')]){delete _0x4b8a3e['name'];}_0x18b8c4[_0x639e('0x30')](_0x1d0b86)['send'](_0x4b8a3e);};}exports[_0x639e('0x3b')]=function(_0x22c393,_0x2a347e){var _0x4541cc={},_0x9cc80={},_0x13606b={'count':0x0,'rows':[]};var _0x4d70e3=_[_0x639e('0x3c')](db[_0x639e('0x3d')]['rawAttributes'],function(_0x26e637){return{'name':_0x26e637['fieldName'],'type':_0x26e637[_0x639e('0x3e')][_0x639e('0x3f')]};});_0x9cc80[_0x639e('0x40')]=_[_0x639e('0x3c')](_0x4d70e3,_0x639e('0x3a'));_0x9cc80[_0x639e('0x41')]=_[_0x639e('0x42')](_0x22c393[_0x639e('0x41')]);_0x9cc80['filters']=_['intersection'](_0x9cc80['model'],_0x9cc80['query']);_0x4541cc[_0x639e('0x43')]=_[_0x639e('0x44')](_0x9cc80['model'],qs[_0x639e('0x45')](_0x22c393[_0x639e('0x41')][_0x639e('0x45')]));_0x4541cc['attributes']=_0x4541cc[_0x639e('0x43')][_0x639e('0x46')]?_0x4541cc[_0x639e('0x43')]:_0x9cc80[_0x639e('0x40')];if(!_0x22c393[_0x639e('0x41')][_0x639e('0x47')](_0x639e('0x48'))){_0x4541cc[_0x639e('0x33')]=qs[_0x639e('0x33')](_0x22c393['query'][_0x639e('0x33')]);_0x4541cc[_0x639e('0x31')]=qs[_0x639e('0x31')](_0x22c393[_0x639e('0x41')][_0x639e('0x31')]);}_0x4541cc[_0x639e('0x49')]=qs['sort'](_0x22c393[_0x639e('0x41')][_0x639e('0x4a')]);_0x4541cc[_0x639e('0x4b')]=qs[_0x639e('0x4c')](_[_0x639e('0x4d')](_0x22c393[_0x639e('0x41')],_0x9cc80[_0x639e('0x4c')]),_0x4d70e3);if(_0x22c393[_0x639e('0x41')][_0x639e('0x4e')]){_0x4541cc[_0x639e('0x4b')]=_[_0x639e('0x4f')](_0x4541cc[_0x639e('0x4b')],{'$or':_['map'](_0x4d70e3,function(_0xe25497){if(_0xe25497['type']!=='VIRTUAL'){var _0x261d6a={};_0x261d6a[_0xe25497[_0x639e('0x3a')]]={'$like':'%'+_0x22c393[_0x639e('0x41')][_0x639e('0x4e')]+'%'};return _0x261d6a;}})});}_0x4541cc=_[_0x639e('0x4f')]({},_0x4541cc,_0x22c393['options']);var _0x2b0dbb={'where':_0x4541cc[_0x639e('0x4b')]};return db['OpenchannelMessage'][_0x639e('0x50')](_0x2b0dbb)[_0x639e('0x23')](function(_0x613d53){_0x13606b['count']=_0x613d53;if(_0x22c393[_0x639e('0x41')][_0x639e('0x51')]){_0x4541cc[_0x639e('0x52')]=[{'all':!![]}];}return db[_0x639e('0x3d')]['findAll'](_0x4541cc);})[_0x639e('0x23')](function(_0x5a87d1){_0x13606b[_0x639e('0x53')]=_0x5a87d1;return _0x13606b;})['then'](respondWithFilteredResult(_0x2a347e,_0x4541cc))[_0x639e('0x2d')](handleError(_0x2a347e,null));};exports[_0x639e('0x54')]=function(_0x4398d0,_0x8f10f2){var _0x3c8412={'raw':!![],'where':{'id':_0x4398d0[_0x639e('0x55')]['id']}},_0x5834f8={};_0x5834f8[_0x639e('0x40')]=_[_0x639e('0x42')](db['OpenchannelMessage'][_0x639e('0x56')]);_0x5834f8[_0x639e('0x41')]=_[_0x639e('0x42')](_0x4398d0[_0x639e('0x41')]);_0x5834f8['filters']=_[_0x639e('0x44')](_0x5834f8['model'],_0x5834f8[_0x639e('0x41')]);_0x3c8412[_0x639e('0x43')]=_[_0x639e('0x44')](_0x5834f8[_0x639e('0x40')],qs['fields'](_0x4398d0[_0x639e('0x41')]['fields']));_0x3c8412['attributes']=_0x3c8412[_0x639e('0x43')][_0x639e('0x46')]?_0x3c8412[_0x639e('0x43')]:_0x5834f8[_0x639e('0x40')];if(_0x4398d0['query'][_0x639e('0x51')]){_0x3c8412[_0x639e('0x52')]=[{'all':!![]}];}_0x3c8412=_[_0x639e('0x4f')]({},_0x3c8412,_0x4398d0['options']);return db[_0x639e('0x3d')][_0x639e('0x57')](_0x3c8412)[_0x639e('0x23')](handleEntityNotFound(_0x8f10f2,null))[_0x639e('0x23')](respondWithResult(_0x8f10f2,null))[_0x639e('0x2d')](handleError(_0x8f10f2,null));};exports[_0x639e('0x58')]=function(_0x46b760,_0x53ecb2){return db[_0x639e('0x3d')][_0x639e('0x58')](_0x46b760[_0x639e('0x59')],{})[_0x639e('0x23')](respondWithResult(_0x53ecb2,0xc9))['catch'](handleError(_0x53ecb2,null));};exports[_0x639e('0x37')]=function(_0x29ee94,_0x2f4294){if(_0x29ee94['body']['id']){delete _0x29ee94['body']['id'];}return db['OpenchannelMessage'][_0x639e('0x57')]({'where':{'id':_0x29ee94[_0x639e('0x55')]['id']}})['then'](handleEntityNotFound(_0x2f4294,null))[_0x639e('0x23')](saveUpdates(_0x29ee94[_0x639e('0x59')],null))[_0x639e('0x23')](respondWithResult(_0x2f4294,null))[_0x639e('0x2d')](handleError(_0x2f4294,null));};exports[_0x639e('0x38')]=function(_0x5bab36,_0x427f11){return db[_0x639e('0x3d')]['find']({'where':{'id':_0x5bab36[_0x639e('0x55')]['id']}})[_0x639e('0x23')](handleEntityNotFound(_0x427f11,null))['then'](removeEntity(_0x427f11,null))['catch'](handleError(_0x427f11,null));};exports[_0x639e('0x5a')]=function(_0x549d44,_0x210378){return db[_0x639e('0x3d')][_0x639e('0x5a')]()['then'](respondWithResult(_0x210378,null))[_0x639e('0x2d')](handleError(_0x210378,null));};var interaction_log=require(_0x639e('0x5b'))(_0x639e('0x5c'));exports[_0x639e('0x5d')]=function(_0x5b61d4,_0x212e27,_0x3c6ede){var _0x4eda16={'agent':{},'channel':_0x639e('0x5e')};if(_0x5b61d4[_0x639e('0x59')]['id']){delete _0x5b61d4[_0x639e('0x59')]['id'];}_0x5b61d4[_0x639e('0x59')][_0x639e('0x5f')]=!![];_0x5b61d4['body'][_0x639e('0x60')]=moment()[_0x639e('0x61')](_0x639e('0x62'));_0x5b61d4[_0x639e('0x59')][_0x639e('0x63')]=_0x5b61d4[_0x639e('0x59')][_0x639e('0x63')]||_0x5b61d4[_0x639e('0x64')]['id'];_0x4eda16[_0x639e('0x65')]['id']=_0x5b61d4[_0x639e('0x59')]['UserId'];return db['OpenchannelMessage'][_0x639e('0x57')]({'where':{'id':_0x5b61d4[_0x639e('0x55')]['id'],'UserId':null}})[_0x639e('0x23')](handleEntityNotFound(_0x212e27,null))[_0x639e('0x23')](saveUpdates(_0x5b61d4[_0x639e('0x59')],null))['then'](function(_0x426d8e){if(_0x426d8e){_0x4eda16['message']=_0x426d8e[_0x639e('0x66')]({'plain':!![]});return db[_0x639e('0x67')][_0x639e('0x57')]({'where':{'id':_0x426d8e['OpenchannelInteractionId']}});}return null;})['then'](handleEntityNotFound(_0x212e27,null))[_0x639e('0x23')](function(_0x2a5ca9){if(_0x2a5ca9){return _0x2a5ca9[_0x639e('0x37')]({'UserId':_0x5b61d4['body']['UserId'],'read1stAt':_[_0x639e('0x68')](_0x2a5ca9[_0x639e('0x69')])?moment()['format'](_0x639e('0x62')):undefined});}return null;})[_0x639e('0x23')](function(_0x35a165){if(_0x35a165){_0x4eda16[_0x639e('0x6a')]=_0x35a165['get']({'plain':!![]});interaction_log[_0x639e('0x24')](_0x639e('0x6b'),_0x5b61d4[_0x639e('0x64')]['id'],_0x5b61d4[_0x639e('0x64')]['name'],_0x5b61d4[_0x639e('0x64')][_0x639e('0x6c')],_0x4eda16[_0x639e('0x6a')]['id'],_0x5b61d4[_0x639e('0x59')]?JSON[_0x639e('0x6d')](_0x5b61d4['body']):_0x639e('0x6e'));return respondWithRpcPromise(_0x639e('0x6f'),_0x639e('0x70'),_0x4eda16);}return null;})[_0x639e('0x23')](function(_0x2aa53b){var _0x250046=_0x639e('0x71')+_0x2aa53b[_0x639e('0x2b')][_0x639e('0x72')];return db['sequelize'][_0x639e('0x41')](_0x250046,{'type':db[_0x639e('0x73')][_0x639e('0x74')][_0x639e('0x75')],'raw':!![]})[_0x639e('0x23')](function(_0x5b804e){return _0x5b804e;});})['then'](function(_0x1863d8){if(_0x1863d8){_0x4eda16['message'][_0x639e('0x76')]=_0x1863d8[0x0];if(!_0x5b61d4[_0x639e('0x59')]['UserId'])return;return db[_0x639e('0x77')][_0x639e('0x57')]({'where':{'id':_0x5b61d4[_0x639e('0x59')][_0x639e('0x63')],'role':'agent'},'attributes':['id',_0x639e('0x3a'),_0x639e('0x78'),_0x639e('0x79'),_0x639e('0x7a')],'raw':!![]});}return null;})['then'](function(_0x1fe256){if(!_0x1fe256)return null;_0x4eda16['message'][_0x639e('0x65')]=_0x1fe256;return _0x4eda16;})[_0x639e('0x23')](function(_0x69b47e){if(_0x69b47e){if(_0x5b61d4['body'][_0x639e('0x7b')]){_0x4eda16[_0x639e('0x2b')][_0x639e('0x7c')]=util[_0x639e('0x61')](_0x639e('0x7d'),_0x5b61d4['user']['name']);_0x4eda16[_0x639e('0x2b')][_0x639e('0x7e')]=_0x4eda16[_0x639e('0x7e')];_0x4eda16[_0x639e('0x2b')][_0x639e('0x7f')]=_0x4eda16['channel'];_0x4eda16[_0x639e('0x2b')][_0x639e('0x80')]=_0x639e('0x5d');return respondWithRpcPromise(_0x639e('0x81'),_0x639e('0x81'),{'event':_0x639e('0x82'),'message':_0x4eda16[_0x639e('0x2b')]},client9002)[_0x639e('0x23')](function(){return _0x4eda16;});}return _0x4eda16;}return null;})['then'](respondWithResult(_0x212e27,null))['catch'](handleError(_0x212e27,null));};var interaction_log=require('../../config/logger')(_0x639e('0x5c'));exports[_0x639e('0x83')]=function(_0x413fb5,_0x13e28d,_0x2a2e9b){var _0x3c9ac4={'agent':{},'channel':_0x639e('0x5e')};if(_0x413fb5['body']['id']){delete _0x413fb5[_0x639e('0x59')]['id'];}_0x413fb5['body'][_0x639e('0x63')]=_0x413fb5[_0x639e('0x59')][_0x639e('0x63')]||_0x413fb5[_0x639e('0x64')]['id'];_0x3c9ac4['agent']['id']=_0x413fb5[_0x639e('0x59')][_0x639e('0x63')];return db[_0x639e('0x3d')][_0x639e('0x57')]({'where':{'id':_0x413fb5['params']['id'],'UserId':null}})[_0x639e('0x23')](handleEntityNotFound(_0x13e28d,null))[_0x639e('0x23')](function(_0x356d88){if(_0x356d88){_0x3c9ac4[_0x639e('0x2b')]=_0x356d88['get']({'plain':!![]});return db[_0x639e('0x67')][_0x639e('0x57')]({'where':{'id':_0x356d88['OpenchannelInteractionId']}});}return null;})[_0x639e('0x23')](handleEntityNotFound(_0x13e28d,null))['then'](function(_0x294922){if(_0x294922){_0x3c9ac4[_0x639e('0x6a')]=_0x294922[_0x639e('0x66')]({'plain':!![]});interaction_log[_0x639e('0x24')](_0x639e('0x84'),_0x413fb5['user']['id'],_0x413fb5[_0x639e('0x64')][_0x639e('0x3a')],_0x413fb5[_0x639e('0x64')]['role'],_0x3c9ac4[_0x639e('0x6a')]['id'],_0x413fb5[_0x639e('0x59')]?JSON[_0x639e('0x6d')](_0x413fb5['body']):_0x639e('0x6e'));return respondWithRpcPromise(_0x639e('0x85'),_0x639e('0x86'),_0x3c9ac4);}return null;})[_0x639e('0x23')](function(_0x351459){var _0x31facd=_0x639e('0x71')+_0x351459[_0x639e('0x2b')][_0x639e('0x72')];return db[_0x639e('0x87')][_0x639e('0x41')](_0x31facd,{'type':db[_0x639e('0x73')][_0x639e('0x74')]['SELECT'],'raw':!![]})[_0x639e('0x23')](function(_0x5bcf9b){return _0x5bcf9b;});})[_0x639e('0x23')](function(_0x25faba){if(_0x25faba){_0x3c9ac4[_0x639e('0x2b')][_0x639e('0x76')]=_0x25faba[0x0];if(!_0x413fb5[_0x639e('0x59')]['UserId'])return;return db[_0x639e('0x77')][_0x639e('0x57')]({'where':{'id':_0x413fb5[_0x639e('0x59')][_0x639e('0x63')],'role':_0x639e('0x65')},'attributes':['id',_0x639e('0x3a'),_0x639e('0x78'),_0x639e('0x79'),_0x639e('0x7a')],'raw':!![]});}return null;})[_0x639e('0x23')](function(_0x28e379){if(!_0x28e379)return null;_0x3c9ac4['message']['agent']=_0x28e379;return _0x3c9ac4;})[_0x639e('0x23')](function(_0x1e8927){if(_0x1e8927){_0x1e8927[_0x639e('0x2b')]['interface']=util[_0x639e('0x61')](_0x639e('0x7d'),_0x413fb5[_0x639e('0x64')]['name']);_0x1e8927[_0x639e('0x2b')][_0x639e('0x7e')]=_0x3c9ac4[_0x639e('0x7e')];_0x1e8927['message'][_0x639e('0x7f')]=_0x3c9ac4[_0x639e('0x7e')];_0x1e8927[_0x639e('0x2b')][_0x639e('0x80')]=_0x639e('0x83');respondWithRpcPromise(_0x639e('0x81'),_0x639e('0x81'),{'event':_0x639e('0x88'),'message':_0x1e8927['message']},client9002);return _0x3c9ac4;}return null;})[_0x639e('0x23')](respondWithResult(_0x13e28d,null))['catch'](handleError(_0x13e28d,null));}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.events.js b/server/api/openchannelMessage/openchannelMessage.events.js index db9a298..1890e33 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 _0xe1c5=['remove','emit','events','../../mysqldb','OpenchannelMessage','setMaxListeners','save','update'];(function(_0x28b493,_0x571c6a){var _0x117740=function(_0x4183d1){while(--_0x4183d1){_0x28b493['push'](_0x28b493['shift']());}};_0x117740(++_0x571c6a);}(_0xe1c5,0x1f2));var _0x5e1c=function(_0x5c0fea,_0x2cbc1c){_0x5c0fea=_0x5c0fea-0x0;var _0x43af63=_0xe1c5[_0x5c0fea];return _0x43af63;};'use strict';var EventEmitter=require(_0x5e1c('0x0'));var OpenchannelMessage=require(_0x5e1c('0x1'))['db'][_0x5e1c('0x2')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0x5e1c('0x3')](0x0);var events={'afterCreate':_0x5e1c('0x4'),'afterUpdate':_0x5e1c('0x5'),'afterDestroy':_0x5e1c('0x6')};function emitEvent(_0x7d8632){return function(_0x175ffb,_0x4a4c60,_0x213995){OpenchannelMessageEvents[_0x5e1c('0x7')](_0x7d8632+':'+_0x175ffb['id'],_0x175ffb);OpenchannelMessageEvents['emit'](_0x7d8632,_0x175ffb);_0x213995(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelMessage['hook'](e,emitEvent(event));}}module['exports']=OpenchannelMessageEvents; \ No newline at end of file +var _0xce1d=['hasOwnProperty','hook','save','update','remove'];(function(_0x2878ad,_0x5837b1){var _0x284716=function(_0x6be9e3){while(--_0x6be9e3){_0x2878ad['push'](_0x2878ad['shift']());}};_0x284716(++_0x5837b1);}(_0xce1d,0x1ba));var _0xdce1=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xce1d[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require('events');var OpenchannelMessage=require('../../mysqldb')['db']['OpenchannelMessage'];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xdce1('0x0'),'afterUpdate':_0xdce1('0x1'),'afterDestroy':_0xdce1('0x2')};function emitEvent(_0x37a84a){return function(_0x301ba6,_0x378074,_0xfd5665){OpenchannelMessageEvents['emit'](_0x37a84a+':'+_0x301ba6['id'],_0x301ba6);OpenchannelMessageEvents['emit'](_0x37a84a,_0x301ba6);_0xfd5665(null);};}for(var e in events){if(events[_0xdce1('0x3')](e)){var event=events[e];OpenchannelMessage[_0xdce1('0x4')](e,emitEvent(event));}}module['exports']=OpenchannelMessageEvents; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.model.js b/server/api/openchannelMessage/openchannelMessage.model.js index 1b788bd..1d78dee 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 _0x8f4c=['lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','exports','OpenchannelMessage','fti_openchannel_messages','body','FULLTEXT','models','get','toLowerCase','out','secret','isNil','UserId','findOne','OpenchannelInteractionId','then','update','createdAt','catch','error','direction','describe','OpenchannelAccount','find','OpenchannelAccountId','OpenchannelInteraction','Interactions','CmContact','Contact','keys','replyUri','info','OpenchannelMessage,\x20%s,\x20%s','afterCreate','format','Forwarding\x20message\x20%d\x20to\x20%s','length','Interaction','omit','POST','method','GET','Message\x20%d\x20forwarded\x20to\x20%s','threadId','inspect','finally','utf8mb4_unicode_ci'];(function(_0x304835,_0x1fe5cf){var _0x27ffbe=function(_0xe134e4){while(--_0xe134e4){_0x304835['push'](_0x304835['shift']());}};_0x27ffbe(++_0x1fe5cf);}(_0x8f4c,0x113));var _0xc8f4=function(_0x39157f,_0x3d8c1e){_0x39157f=_0x39157f-0x0;var _0x1ae4e2=_0x8f4c[_0x39157f];return _0x1ae4e2;};'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('./openchannelMessage.attributes');module[_0xc8f4('0x9')]=function(_0x5208da,_0x4c86f8){return _0x5208da['define'](_0xc8f4('0xa'),attributes,{'tableName':'openchannel_messages','paranoid':![],'indexes':[{'name':_0xc8f4('0xb'),'fields':[_0xc8f4('0xc')],'type':_0xc8f4('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x39ed63,_0x34f05f,_0x599de3){var _0x38c41b=_0x5208da[_0xc8f4('0xe')];var _0x2fba62=_0x39ed63[_0xc8f4('0xf')]({'plain':!![]});if(_0x2fba62['direction'][_0xc8f4('0x10')]()==='in'||_0x2fba62['direction'][_0xc8f4('0x10')]()===_0xc8f4('0x11')&&!_0x2fba62[_0xc8f4('0x12')]&&!_[_0xc8f4('0x13')](_0x2fba62[_0xc8f4('0x14')])){_0x38c41b['OpenchannelInteraction'][_0xc8f4('0x15')]({'where':{'id':_0x2fba62[_0xc8f4('0x16')]}})[_0xc8f4('0x17')](function(_0x14bc11){if(_0x14bc11){_0x14bc11[_0xc8f4('0x18')]({'lastMsgAt':_0x2fba62[_0xc8f4('0x19')],'lastMsgDirection':_0x2fba62['direction'][_0xc8f4('0x10')]()});}})[_0xc8f4('0x1a')](function(_0x1518a6){console[_0xc8f4('0x1b')](_0x1518a6);});}if(_0x2fba62[_0xc8f4('0x1c')]==='out'&&!_0x2fba62[_0xc8f4('0x12')]){var _0x4d2b77;_0x38c41b['CmContact'][_0xc8f4('0x1d')]()[_0xc8f4('0x17')](function(_0x108076){return _0x38c41b[_0xc8f4('0x1e')][_0xc8f4('0x1f')]({'where':{'id':_0x2fba62[_0xc8f4('0x20')]},'include':[{'model':_0x38c41b[_0xc8f4('0x21')],'as':_0xc8f4('0x22'),'where':{'id':_0x2fba62[_0xc8f4('0x16')]},'limit':0x1,'include':[{'model':_0x38c41b[_0xc8f4('0x23')],'as':_0xc8f4('0x24'),'attributes':_[_0xc8f4('0x25')](_0x108076)}]}]});})[_0xc8f4('0x17')](function(_0x5f3264){_0x4d2b77=_0x5f3264[_0xc8f4('0xf')]({'plain':!![]});if(_0x4d2b77&&_0x4d2b77[_0xc8f4('0x26')]){logger[_0xc8f4('0x27')](_0xc8f4('0x28'),_0xc8f4('0x29'),util[_0xc8f4('0x2a')](_0xc8f4('0x2b'),_0x2fba62['id'],_0x4d2b77[_0xc8f4('0x26')]));if(_0x4d2b77['Interactions']&&_0x4d2b77[_0xc8f4('0x22')][_0xc8f4('0x2c')]){_0x2fba62[_0xc8f4('0x2d')]=_[_0xc8f4('0x2e')](_0x4d2b77['Interactions'][0x0],_0xc8f4('0x24'));_0x2fba62['Contact']=_0x4d2b77[_0xc8f4('0x22')][0x0]['Contact'];}var _0x34f05f={'method':_0xc8f4('0x2f'),'uri':encodeURI(_0x4d2b77['replyUri']),'json':!![],'resolveWithFullResponse':!![]};switch(_0x34f05f[_0xc8f4('0x30')]){case _0xc8f4('0x31'):_0x34f05f['qs']=_0x2fba62;break;case _0xc8f4('0x2f'):_0x34f05f[_0xc8f4('0xc')]=_0x2fba62;break;}return rp(_0x34f05f)['then'](function(_0x3db490){logger[_0xc8f4('0x27')]('OpenchannelMessage,\x20%s,\x20%s',_0xc8f4('0x29'),util[_0xc8f4('0x2a')](_0xc8f4('0x32'),_0x2fba62['id'],_0x4d2b77[_0xc8f4('0x26')]));if(_0x3db490[_0xc8f4('0xc')][_0xc8f4('0x33')]&&_0x3db490['body'][_0xc8f4('0x33')]!=_0x2fba62[_0xc8f4('0x2d')][_0xc8f4('0x33')]){return _0x38c41b['OpenchannelInteraction'][_0xc8f4('0x18')]({'threadId':_0x3db490[_0xc8f4('0xc')]['threadId']},{'logging':!![],'where':{'id':_0x2fba62['Interaction']['id']}});}else{return;}})['then'](function(){return _0x39ed63[_0xc8f4('0x18')]({'read':!![]});})[_0xc8f4('0x1a')](function(_0x2e9a2a){logger[_0xc8f4('0x1b')](_0xc8f4('0x28'),_0xc8f4('0x29'),util[_0xc8f4('0x34')](_0x2e9a2a,{'showHidden':![],'depth':null}));_0x599de3();});}else{_0x599de3();}})[_0xc8f4('0x35')](function(){_0x599de3();});}else{_0x599de3();}}},'charset':'utf8mb4','collate':_0xc8f4('0x36')});}; \ No newline at end of file +var _0x93e9=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','../../config/environment','./openchannelMessage.attributes','exports','define','OpenchannelMessage','openchannel_messages','body','FULLTEXT','models','get','direction','toLowerCase','secret','OpenchannelInteraction','findOne','OpenchannelInteractionId','then','update','createdAt','catch','error','out','CmContact','OpenchannelAccount','find','OpenchannelAccountId','Contact','keys','replyUri','OpenchannelMessage,\x20%s,\x20%s','format','Forwarding\x20message\x20%d\x20to\x20%s','Interactions','length','Interaction','omit','POST','GET','info','afterCreate','threadId','finally','utf8mb4','utf8mb4_unicode_ci'];(function(_0x3ff2f9,_0x544ba1){var _0x3b0913=function(_0x554288){while(--_0x554288){_0x3ff2f9['push'](_0x3ff2f9['shift']());}};_0x3b0913(++_0x544ba1);}(_0x93e9,0xcc));var _0x993e=function(_0x4d43d4,_0xbe65de){_0x4d43d4=_0x4d43d4-0x0;var _0x176731=_0x93e9[_0x4d43d4];return _0x176731;};'use strict';var _=require(_0x993e('0x0'));var util=require(_0x993e('0x1'));var logger=require(_0x993e('0x2'))(_0x993e('0x3'));var moment=require(_0x993e('0x4'));var BPromise=require(_0x993e('0x5'));var rp=require(_0x993e('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x993e('0x7'));var attributes=require(_0x993e('0x8'));module[_0x993e('0x9')]=function(_0x45f52e,_0x1da414){return _0x45f52e[_0x993e('0xa')](_0x993e('0xb'),attributes,{'tableName':_0x993e('0xc'),'paranoid':![],'indexes':[{'name':'fti_openchannel_messages','fields':[_0x993e('0xd')],'type':_0x993e('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x15d774,_0x280291,_0x2cd389){var _0x27a28f=_0x45f52e[_0x993e('0xf')];var _0x48291a=_0x15d774[_0x993e('0x10')]({'plain':!![]});if(_0x48291a[_0x993e('0x11')]['toLowerCase']()==='in'||_0x48291a['direction'][_0x993e('0x12')]()==='out'&&!_0x48291a[_0x993e('0x13')]&&!_['isNil'](_0x48291a['UserId'])){_0x27a28f[_0x993e('0x14')][_0x993e('0x15')]({'where':{'id':_0x48291a[_0x993e('0x16')]}})[_0x993e('0x17')](function(_0x3e082b){if(_0x3e082b){_0x3e082b[_0x993e('0x18')]({'lastMsgAt':_0x48291a[_0x993e('0x19')],'lastMsgDirection':_0x48291a[_0x993e('0x11')][_0x993e('0x12')]()});}})[_0x993e('0x1a')](function(_0x1a7726){console[_0x993e('0x1b')](_0x1a7726);});}if(_0x48291a[_0x993e('0x11')]===_0x993e('0x1c')&&!_0x48291a[_0x993e('0x13')]){var _0x454475;_0x27a28f[_0x993e('0x1d')]['describe']()[_0x993e('0x17')](function(_0x1acd21){return _0x27a28f[_0x993e('0x1e')][_0x993e('0x1f')]({'where':{'id':_0x48291a[_0x993e('0x20')]},'include':[{'model':_0x27a28f[_0x993e('0x14')],'as':'Interactions','where':{'id':_0x48291a[_0x993e('0x16')]},'limit':0x1,'include':[{'model':_0x27a28f[_0x993e('0x1d')],'as':_0x993e('0x21'),'attributes':_[_0x993e('0x22')](_0x1acd21)}]}]});})[_0x993e('0x17')](function(_0x425ab4){_0x454475=_0x425ab4[_0x993e('0x10')]({'plain':!![]});if(_0x454475&&_0x454475[_0x993e('0x23')]){logger['info'](_0x993e('0x24'),'afterCreate',util[_0x993e('0x25')](_0x993e('0x26'),_0x48291a['id'],_0x454475[_0x993e('0x23')]));if(_0x454475['Interactions']&&_0x454475[_0x993e('0x27')][_0x993e('0x28')]){_0x48291a[_0x993e('0x29')]=_[_0x993e('0x2a')](_0x454475[_0x993e('0x27')][0x0],_0x993e('0x21'));_0x48291a[_0x993e('0x21')]=_0x454475[_0x993e('0x27')][0x0][_0x993e('0x21')];}var _0x280291={'method':_0x993e('0x2b'),'uri':encodeURI(_0x454475[_0x993e('0x23')]),'json':!![],'resolveWithFullResponse':!![]};switch(_0x280291['method']){case _0x993e('0x2c'):_0x280291['qs']=_0x48291a;break;case _0x993e('0x2b'):_0x280291['body']=_0x48291a;break;}return rp(_0x280291)[_0x993e('0x17')](function(_0x4f5cc1){logger[_0x993e('0x2d')](_0x993e('0x24'),_0x993e('0x2e'),util[_0x993e('0x25')]('Message\x20%d\x20forwarded\x20to\x20%s',_0x48291a['id'],_0x454475['replyUri']));if(_0x4f5cc1[_0x993e('0xd')][_0x993e('0x2f')]&&_0x4f5cc1['body'][_0x993e('0x2f')]!=_0x48291a[_0x993e('0x29')][_0x993e('0x2f')]){return _0x27a28f['OpenchannelInteraction'][_0x993e('0x18')]({'threadId':_0x4f5cc1[_0x993e('0xd')][_0x993e('0x2f')]},{'logging':!![],'where':{'id':_0x48291a[_0x993e('0x29')]['id']}});}else{return;}})[_0x993e('0x17')](function(){return _0x15d774['update']({'read':!![]});})[_0x993e('0x1a')](function(_0x4d1379){logger[_0x993e('0x1b')]('OpenchannelMessage,\x20%s,\x20%s',_0x993e('0x2e'),util['inspect'](_0x4d1379,{'showHidden':![],'depth':null}));_0x2cd389();});}else{_0x2cd389();}})[_0x993e('0x30')](function(){_0x2cd389();});}else{_0x2cd389();}}},'charset':_0x993e('0x31'),'collate':_0x993e('0x32')});}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.rpc.js b/server/api/openchannelMessage/openchannelMessage.rpc.js index f74d89b..9737212 100644 --- a/server/api/openchannelMessage/openchannelMessage.rpc.js +++ b/server/api/openchannelMessage/openchannelMessage.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xadb5=['debug','request\x20sent','stringify','error','code','message','info','result','catch','OpenchannelMessage','body','raw','CreateOpenchannelMessage','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./openchannelMessage.socket','register','request','then','OpenchannelMessage,\x20%s,\x20%s'];(function(_0x1d4a6d,_0xaaa75){var _0x1634f6=function(_0xc7d1d4){while(--_0xc7d1d4){_0x1d4a6d['push'](_0x1d4a6d['shift']());}};_0x1634f6(++_0xaaa75);}(_0xadb5,0xad));var _0x5adb=function(_0x274e76,_0x5520dc){_0x274e76=_0x274e76-0x0;var _0xe85cfe=_0xadb5[_0x274e76];return _0xe85cfe;};'use strict';var _=require('lodash');var util=require(_0x5adb('0x0'));var moment=require('moment');var BPromise=require(_0x5adb('0x1'));var rs=require(_0x5adb('0x2'));var fs=require('fs');var Redis=require(_0x5adb('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x5adb('0x4'));var logger=require(_0x5adb('0x5'))(_0x5adb('0x6'));var config=require('../../config/environment');var jayson=require(_0x5adb('0x7'));var client=jayson[_0x5adb('0x8')][_0x5adb('0x9')]({'port':0x232a});config[_0x5adb('0xa')]=_[_0x5adb('0xb')](config[_0x5adb('0xa')],{'host':_0x5adb('0xc'),'port':0x18eb});var socket=require(_0x5adb('0xd'))(new Redis(config[_0x5adb('0xa')]));require(_0x5adb('0xe'))[_0x5adb('0xf')](socket);function respondWithRpcPromise(_0x336bad,_0x129f5a,_0x275428){return new BPromise(function(_0x563d86,_0x4c268d){return client[_0x5adb('0x10')](_0x336bad,_0x275428)[_0x5adb('0x11')](function(_0x82e67e){logger['info'](_0x5adb('0x12'),_0x129f5a,'request\x20sent');logger[_0x5adb('0x13')]('OpenchannelMessage,\x20%s,\x20%s,\x20%s',_0x129f5a,_0x5adb('0x14'),JSON[_0x5adb('0x15')](_0x82e67e));if(_0x82e67e[_0x5adb('0x16')]){if(_0x82e67e['error'][_0x5adb('0x17')]===0x1f4){logger[_0x5adb('0x16')](_0x5adb('0x12'),_0x129f5a,_0x82e67e['error'][_0x5adb('0x18')]);return _0x4c268d(_0x82e67e['error'][_0x5adb('0x18')]);}logger[_0x5adb('0x16')](_0x5adb('0x12'),_0x129f5a,_0x82e67e[_0x5adb('0x16')][_0x5adb('0x18')]);return _0x563d86(_0x82e67e[_0x5adb('0x16')][_0x5adb('0x18')]);}else{logger[_0x5adb('0x19')](_0x5adb('0x12'),_0x129f5a,'request\x20sent');_0x563d86(_0x82e67e[_0x5adb('0x1a')]['message']);}})[_0x5adb('0x1b')](function(_0x558f76){logger[_0x5adb('0x16')]('OpenchannelMessage,\x20%s,\x20%s',_0x129f5a,_0x558f76);_0x4c268d(_0x558f76);});});}exports['CreateOpenchannelMessage']=function(_0x1fbaa5){var _0x1bed20=this;return new Promise(function(_0x438671,_0x1fd4a7){return db[_0x5adb('0x1c')]['create'](_0x1fbaa5[_0x5adb('0x1d')],{'raw':_0x1fbaa5['options']?_0x1fbaa5['options'][_0x5adb('0x1e')]===undefined?!![]:![]:!![]})[_0x5adb('0x11')](function(_0x1a38d3){logger[_0x5adb('0x19')](_0x5adb('0x1f'),_0x1fbaa5);logger[_0x5adb('0x13')](_0x5adb('0x1f'),_0x1fbaa5,JSON['stringify'](_0x1a38d3));_0x438671(_0x1a38d3);})[_0x5adb('0x1b')](function(_0x373cc3){logger[_0x5adb('0x16')](_0x5adb('0x1f'),_0x373cc3[_0x5adb('0x18')],_0x1fbaa5);_0x1fd4a7(_0x1bed20['error'](0x1f4,_0x373cc3[_0x5adb('0x18')]));});});}; \ No newline at end of file +var _0x0b0e=['message','result','OpenchannelMessage','create','body','options','CreateOpenchannelMessage','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./openchannelMessage.socket','then','info','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','OpenchannelMessage,\x20%s,\x20%s'];(function(_0x2c3e9b,_0x16d874){var _0x361ace=function(_0x29e107){while(--_0x29e107){_0x2c3e9b['push'](_0x2c3e9b['shift']());}};_0x361ace(++_0x16d874);}(_0x0b0e,0x187));var _0xe0b0=function(_0x23b57c,_0xdc7f98){_0x23b57c=_0x23b57c-0x0;var _0x4c3b1d=_0x0b0e[_0x23b57c];return _0x4c3b1d;};'use strict';var _=require(_0xe0b0('0x0'));var util=require('util');var moment=require(_0xe0b0('0x1'));var BPromise=require('bluebird');var rs=require(_0xe0b0('0x2'));var fs=require('fs');var Redis=require(_0xe0b0('0x3'));var db=require(_0xe0b0('0x4'))['db'];var utils=require(_0xe0b0('0x5'));var logger=require(_0xe0b0('0x6'))(_0xe0b0('0x7'));var config=require(_0xe0b0('0x8'));var jayson=require(_0xe0b0('0x9'));var client=jayson[_0xe0b0('0xa')][_0xe0b0('0xb')]({'port':0x232a});config[_0xe0b0('0xc')]=_['defaults'](config['redis'],{'host':_0xe0b0('0xd'),'port':0x18eb});var socket=require(_0xe0b0('0xe'))(new Redis(config[_0xe0b0('0xc')]));require(_0xe0b0('0xf'))['register'](socket);function respondWithRpcPromise(_0x338e7c,_0x1dd3b8,_0x553d4f){return new BPromise(function(_0x1fef28,_0x2f32b6){return client['request'](_0x338e7c,_0x553d4f)[_0xe0b0('0x10')](function(_0x2cdad2){logger[_0xe0b0('0x11')]('OpenchannelMessage,\x20%s,\x20%s',_0x1dd3b8,_0xe0b0('0x12'));logger[_0xe0b0('0x13')](_0xe0b0('0x14'),_0x1dd3b8,_0xe0b0('0x12'),JSON[_0xe0b0('0x15')](_0x2cdad2));if(_0x2cdad2['error']){if(_0x2cdad2[_0xe0b0('0x16')][_0xe0b0('0x17')]===0x1f4){logger[_0xe0b0('0x16')](_0xe0b0('0x18'),_0x1dd3b8,_0x2cdad2[_0xe0b0('0x16')]['message']);return _0x2f32b6(_0x2cdad2[_0xe0b0('0x16')]['message']);}logger[_0xe0b0('0x16')](_0xe0b0('0x18'),_0x1dd3b8,_0x2cdad2['error'][_0xe0b0('0x19')]);return _0x1fef28(_0x2cdad2['error'][_0xe0b0('0x19')]);}else{logger[_0xe0b0('0x11')]('OpenchannelMessage,\x20%s,\x20%s',_0x1dd3b8,'request\x20sent');_0x1fef28(_0x2cdad2[_0xe0b0('0x1a')]['message']);}})['catch'](function(_0x4bce65){logger[_0xe0b0('0x16')]('OpenchannelMessage,\x20%s,\x20%s',_0x1dd3b8,_0x4bce65);_0x2f32b6(_0x4bce65);});});}exports['CreateOpenchannelMessage']=function(_0x10cde1){var _0x59dff5=this;return new Promise(function(_0x472286,_0x5dba2f){return db[_0xe0b0('0x1b')][_0xe0b0('0x1c')](_0x10cde1[_0xe0b0('0x1d')],{'raw':_0x10cde1[_0xe0b0('0x1e')]?_0x10cde1[_0xe0b0('0x1e')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x2fa820){logger['info'](_0xe0b0('0x1f'),_0x10cde1);logger[_0xe0b0('0x13')]('CreateOpenchannelMessage',_0x10cde1,JSON[_0xe0b0('0x15')](_0x2fa820));_0x472286(_0x2fa820);})['catch'](function(_0x2208d0){logger['error'](_0xe0b0('0x1f'),_0x2208d0['message'],_0x10cde1);_0x5dba2f(_0x59dff5[_0xe0b0('0x16')](0x1f4,_0x2208d0['message']));});});}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.socket.js b/server/api/openchannelMessage/openchannelMessage.socket.js index 280b267..c28fa83 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 _0x7bb9=['length','openchannelMessage:','./openchannelMessage.events','save','remove','update','emit','removeListener','register'];(function(_0x339129,_0x86dcc6){var _0x1570df=function(_0x3b537e){while(--_0x3b537e){_0x339129['push'](_0x339129['shift']());}};_0x1570df(++_0x86dcc6);}(_0x7bb9,0x89));var _0x97bb=function(_0x122096,_0x60c295){_0x122096=_0x122096-0x0;var _0x3d1966=_0x7bb9[_0x122096];return _0x3d1966;};'use strict';var OpenchannelMessageEvents=require(_0x97bb('0x0'));var events=[_0x97bb('0x1'),_0x97bb('0x2'),_0x97bb('0x3')];function createListener(_0x1e150b,_0x5d0d6c){return function(_0x25462a){_0x5d0d6c[_0x97bb('0x4')](_0x1e150b,_0x25462a);};}function removeListener(_0x3c0cd6,_0x1c3f67){return function(){OpenchannelMessageEvents[_0x97bb('0x5')](_0x3c0cd6,_0x1c3f67);};}exports[_0x97bb('0x6')]=function(_0x45bfbe){for(var _0x3fec1d=0x0,_0x300bb0=events[_0x97bb('0x7')];_0x3fec1d<_0x300bb0;_0x3fec1d++){var _0x54f296=events[_0x3fec1d];var _0x148cf4=createListener(_0x97bb('0x8')+_0x54f296,_0x45bfbe);OpenchannelMessageEvents['on'](_0x54f296,_0x148cf4);}}; \ No newline at end of file +var _0xb264=['length','openchannelMessage:','./openchannelMessage.events','save','update','removeListener','register'];(function(_0x267311,_0x2bd543){var _0x2539b4=function(_0x3f8825){while(--_0x3f8825){_0x267311['push'](_0x267311['shift']());}};_0x2539b4(++_0x2bd543);}(_0xb264,0x1b4));var _0x4b26=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb264[_0x3dd15e];return _0x231fd0;};'use strict';var OpenchannelMessageEvents=require(_0x4b26('0x0'));var events=[_0x4b26('0x1'),'remove',_0x4b26('0x2')];function createListener(_0x2727f7,_0x2d313e){return function(_0x1477af){_0x2d313e['emit'](_0x2727f7,_0x1477af);};}function removeListener(_0x2fc825,_0x2741d5){return function(){OpenchannelMessageEvents[_0x4b26('0x3')](_0x2fc825,_0x2741d5);};}exports[_0x4b26('0x4')]=function(_0x43d1e6){for(var _0x636429=0x0,_0x5018c6=events[_0x4b26('0x5')];_0x636429<_0x5018c6;_0x636429++){var _0x45d5d1=events[_0x636429];var _0x1cff4c=createListener(_0x4b26('0x6')+_0x45d5d1,_0x43d1e6);OpenchannelMessageEvents['on'](_0x45d5d1,_0x1cff4c);}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/index.js b/server/api/openchannelQueue/index.js index 9799491..d53d64c 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 _0xc707=['removeAgents','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelQueue.controller','get','index','/describe','isAuthenticated','describe','/:id','show','/:id/members','getMembers','/:id/teams','/:id/users','addTeams','post','addAgents','put','update','delete','removeTeams'];(function(_0x590b61,_0x4c4335){var _0x1a14dc=function(_0x2ff4f6){while(--_0x2ff4f6){_0x590b61['push'](_0x590b61['shift']());}};_0x1a14dc(++_0x4c4335);}(_0xc707,0x12e));var _0x7c70=function(_0xd308f,_0x3d0a33){_0xd308f=_0xd308f-0x0;var _0x24595c=_0xc707[_0xd308f];return _0x24595c;};'use strict';var multer=require('multer');var util=require(_0x7c70('0x0'));var path=require(_0x7c70('0x1'));var timeout=require(_0x7c70('0x2'));var express=require(_0x7c70('0x3'));var router=express[_0x7c70('0x4')]();var fs_extra=require(_0x7c70('0x5'));var auth=require(_0x7c70('0x6'));var interaction=require(_0x7c70('0x7'));var config=require(_0x7c70('0x8'));var controller=require(_0x7c70('0x9'));router[_0x7c70('0xa')]('/',auth['isAuthenticated'](),controller[_0x7c70('0xb')]);router[_0x7c70('0xa')](_0x7c70('0xc'),auth[_0x7c70('0xd')](),controller[_0x7c70('0xe')]);router[_0x7c70('0xa')](_0x7c70('0xf'),auth[_0x7c70('0xd')](),controller[_0x7c70('0x10')]);router[_0x7c70('0xa')](_0x7c70('0x11'),auth[_0x7c70('0xd')](),controller[_0x7c70('0x12')]);router['get'](_0x7c70('0x13'),auth[_0x7c70('0xd')](),controller['getTeams']);router['get'](_0x7c70('0x14'),auth['isAuthenticated'](),controller['getAgents']);router['post']('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/teams',auth[_0x7c70('0xd')](),controller[_0x7c70('0x15')]);router[_0x7c70('0x16')]('/:id/users',auth['isAuthenticated'](),controller[_0x7c70('0x17')]);router[_0x7c70('0x18')](_0x7c70('0xf'),auth[_0x7c70('0xd')](),controller[_0x7c70('0x19')]);router[_0x7c70('0x1a')]('/:id',auth[_0x7c70('0xd')](),controller['destroy']);router[_0x7c70('0x1a')](_0x7c70('0x13'),auth[_0x7c70('0xd')](),controller[_0x7c70('0x1b')]);router['delete']('/:id/users',auth[_0x7c70('0xd')](),controller[_0x7c70('0x1c')]);module[_0x7c70('0x1d')]=router; \ No newline at end of file +var _0x5cf6=['index','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','/:id','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated'];(function(_0x5f2b2d,_0xa73a0e){var _0x3fe0ad=function(_0x4b28e9){while(--_0x4b28e9){_0x5f2b2d['push'](_0x5f2b2d['shift']());}};_0x3fe0ad(++_0xa73a0e);}(_0x5cf6,0xfa));var _0x65cf=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x5cf6[_0x17d9e3];return _0x14192d;};'use strict';var multer=require(_0x65cf('0x0'));var util=require(_0x65cf('0x1'));var path=require('path');var timeout=require(_0x65cf('0x2'));var express=require(_0x65cf('0x3'));var router=express[_0x65cf('0x4')]();var fs_extra=require(_0x65cf('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x65cf('0x6'));var config=require(_0x65cf('0x7'));var controller=require('./openchannelQueue.controller');router[_0x65cf('0x8')]('/',auth[_0x65cf('0x9')](),controller[_0x65cf('0xa')]);router[_0x65cf('0x8')]('/describe',auth['isAuthenticated'](),controller['describe']);router[_0x65cf('0x8')]('/:id',auth[_0x65cf('0x9')](),controller['show']);router[_0x65cf('0x8')](_0x65cf('0xb'),auth[_0x65cf('0x9')](),controller[_0x65cf('0xc')]);router['get'](_0x65cf('0xd'),auth[_0x65cf('0x9')](),controller[_0x65cf('0xe')]);router['get'](_0x65cf('0xf'),auth[_0x65cf('0x9')](),controller[_0x65cf('0x10')]);router[_0x65cf('0x11')]('/',auth[_0x65cf('0x9')](),controller[_0x65cf('0x12')]);router[_0x65cf('0x11')](_0x65cf('0xd'),auth[_0x65cf('0x9')](),controller[_0x65cf('0x13')]);router['post'](_0x65cf('0xf'),auth[_0x65cf('0x9')](),controller[_0x65cf('0x14')]);router[_0x65cf('0x15')](_0x65cf('0x16'),auth[_0x65cf('0x9')](),controller['update']);router[_0x65cf('0x17')](_0x65cf('0x16'),auth[_0x65cf('0x9')](),controller[_0x65cf('0x18')]);router['delete'](_0x65cf('0xd'),auth['isAuthenticated'](),controller['removeTeams']);router[_0x65cf('0x17')](_0x65cf('0xf'),auth[_0x65cf('0x9')](),controller['removeAgents']);module[_0x65cf('0x19')]=router; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.attributes.js b/server/api/openchannelQueue/openchannelQueue.attributes.js index 8e80236..dac22c0 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 _0x45e5=['roundrobin','exports','STRING','name','INTEGER','ENUM','rrmemory','beepall'];(function(_0x58346e,_0x354653){var _0x419276=function(_0x44b053){while(--_0x44b053){_0x58346e['push'](_0x58346e['shift']());}};_0x419276(++_0x354653);}(_0x45e5,0xd1));var _0x545e=function(_0x1f2fdb,_0x399ebd){_0x1f2fdb=_0x1f2fdb-0x0;var _0x185c37=_0x45e5[_0x1f2fdb];return _0x185c37;};'use strict';var Sequelize=require('sequelize');module[_0x545e('0x0')]={'name':{'type':Sequelize[_0x545e('0x1')],'unique':_0x545e('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x545e('0x1')]},'timeout':{'type':Sequelize[_0x545e('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x545e('0x4')](_0x545e('0x5'),_0x545e('0x6'),_0x545e('0x7'))}}; \ No newline at end of file +var _0xc8df=['roundrobin','exports','name','STRING','INTEGER','ENUM','rrmemory','beepall'];(function(_0x2cb58b,_0x5a879d){var _0xe9dd9c=function(_0x11e835){while(--_0x11e835){_0x2cb58b['push'](_0x2cb58b['shift']());}};_0xe9dd9c(++_0x5a879d);}(_0xc8df,0x1c1));var _0xfc8d=function(_0x4b2863,_0x494899){_0x4b2863=_0x4b2863-0x0;var _0x567d67=_0xc8df[_0x4b2863];return _0x567d67;};'use strict';var Sequelize=require('sequelize');module[_0xfc8d('0x0')]={'name':{'type':Sequelize['STRING'],'unique':_0xfc8d('0x1'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xfc8d('0x2')]},'timeout':{'type':Sequelize[_0xfc8d('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xfc8d('0x4')](_0xfc8d('0x5'),_0xfc8d('0x6'),_0xfc8d('0x7'))}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.controller.js b/server/api/openchannelQueue/openchannelQueue.controller.js index 60b0082..5e26f1b 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 _0xa89e=['zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','./openchannelQueue.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','get','OpenchannelQueues','stack','name','send','index','map','OpenchannelQueue','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','rows','catch','params','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','getMembers','findOne','hasOwnProperty','findAll','findAndCountAll','UserId','openchannelPause','updatedAt','createdAt','format','%s/%s','SIP','Team','getTeams','addTeams','ids','User','Agents','voicePause','interface','flatMap','each','UserOpenchannelQueue','emit','select','field','tq.TeamId','from','team_has_openchannel_queues','user_has_teams','clone','ut.UserId\x20=\x20?','sequelize','toString','QueryTypes','SELECT','every','TeamId','includes','union','compact','value','removeTeams','isEmpty','forEach','addAgents','omit','spread','userOpenchannelQueue:save','removeAgents','isArray','userOpenchannelQueue:remove','getAgents','eml-format'];(function(_0xd5f8af,_0x286680){var _0x1ee122=function(_0x4ef92c){while(--_0x4ef92c){_0xd5f8af['push'](_0xd5f8af['shift']());}};_0x1ee122(++_0x286680);}(_0xa89e,0x117));var _0xea89=function(_0x115690,_0x27d388){_0x115690=_0x115690-0x0;var _0x41e63c=_0xa89e[_0x115690];return _0x41e63c;};'use strict';var emlformat=require(_0xea89('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xea89('0x1'));var jsonpatch=require(_0xea89('0x2'));var rp=require(_0xea89('0x3'));var moment=require('moment');var BPromise=require(_0xea89('0x4'));var Mustache=require('mustache');var util=require(_0xea89('0x5'));var path=require(_0xea89('0x6'));var sox=require(_0xea89('0x7'));var csv=require(_0xea89('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xea89('0x9'));var _=require(_0xea89('0xa'));var squel=require(_0xea89('0xb'));var crypto=require(_0xea89('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xea89('0xd'));var toCsv=require(_0xea89('0x8'));var querystring=require(_0xea89('0xe'));var Papa=require(_0xea89('0xf'));var Redis=require(_0xea89('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xea89('0x11'));var hardwareService=require(_0xea89('0x12'));var logger=require('../../config/logger')(_0xea89('0x13'));var utils=require(_0xea89('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xea89('0x15'));var db=require(_0xea89('0x16'))['db'];config[_0xea89('0x17')]=_[_0xea89('0x18')](config['redis'],{'host':_0xea89('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xea89('0x17')]));require(_0xea89('0x1a'))[_0xea89('0x1b')](socket);function respondWithStatusCode(_0x4d3470,_0x55b786){_0x55b786=_0x55b786||0xcc;return function(_0x2a0223){if(_0x2a0223){return _0x4d3470[_0xea89('0x1c')](_0x55b786);}return _0x4d3470[_0xea89('0x1d')](_0x55b786)[_0xea89('0x1e')]();};}function respondWithResult(_0x4e34b9,_0xc4a09f){_0xc4a09f=_0xc4a09f||0xc8;return function(_0x268880){if(_0x268880){return _0x4e34b9[_0xea89('0x1d')](_0xc4a09f)[_0xea89('0x1f')](_0x268880);}};}function respondWithFilteredResult(_0x340266,_0x27d03f){return function(_0x12eb00){if(_0x12eb00){var _0x5b09a9=typeof _0x27d03f[_0xea89('0x20')]===_0xea89('0x21')&&typeof _0x27d03f[_0xea89('0x22')]===_0xea89('0x21');var _0x17ec20=_0x12eb00[_0xea89('0x23')];var _0x521a9e=_0x5b09a9?0x0:_0x27d03f[_0xea89('0x20')];var _0x4efdd8=_0x5b09a9?_0x12eb00[_0xea89('0x23')]:_0x27d03f[_0xea89('0x20')]+_0x27d03f[_0xea89('0x22')];var _0x3e6a90;if(_0x4efdd8>=_0x17ec20){_0x4efdd8=_0x17ec20;_0x3e6a90=0xc8;}else{_0x3e6a90=0xce;}_0x340266['status'](_0x3e6a90);return _0x340266[_0xea89('0x24')](_0xea89('0x25'),_0x521a9e+'-'+_0x4efdd8+'/'+_0x17ec20)[_0xea89('0x1f')](_0x12eb00);}return null;};}function patchUpdates(_0x3e67ce){return function(_0x45b238){try{jsonpatch['apply'](_0x45b238,_0x3e67ce,!![]);}catch(_0xd688f2){return BPromise[_0xea89('0x26')](_0xd688f2);}return _0x45b238[_0xea89('0x27')]();};}function saveUpdates(_0x2ad436,_0xfc7aa7){return function(_0x4d70fd){if(_0x4d70fd){return _0x4d70fd[_0xea89('0x28')](_0x2ad436)[_0xea89('0x29')](function(_0x2d8e0f){return _0x2d8e0f;});}return null;};}function removeEntity(_0x5b5d7f,_0x3978eb){return function(_0x4a1777){if(_0x4a1777){return _0x4a1777[_0xea89('0x2a')]()['then'](function(){var _0x53e9e3=_0x4a1777[_0xea89('0x2b')]({'plain':!![]});var _0x2fafc5=_0xea89('0x2c');return db['UserProfileResource'][_0xea89('0x2a')]({'where':{'type':_0x2fafc5,'resourceId':_0x53e9e3['id']}})[_0xea89('0x29')](function(){return _0x4a1777;});})[_0xea89('0x29')](function(){_0x5b5d7f[_0xea89('0x1d')](0xcc)[_0xea89('0x1e')]();});}};}function handleEntityNotFound(_0x4e27c3,_0xd85913){return function(_0x1faec7){if(!_0x1faec7){_0x4e27c3['sendStatus'](0x194);}return _0x1faec7;};}function handleError(_0xcdb78e,_0x4b3594){_0x4b3594=_0x4b3594||0x1f4;return function(_0x5f3ff1){logger['error'](_0x5f3ff1[_0xea89('0x2d')]);if(_0x5f3ff1[_0xea89('0x2e')]){delete _0x5f3ff1['name'];}_0xcdb78e[_0xea89('0x1d')](_0x4b3594)[_0xea89('0x2f')](_0x5f3ff1);};}exports[_0xea89('0x30')]=function(_0x1a07b3,_0x149a01){var _0x3b0c53={},_0x5b022b={},_0x55396a={'count':0x0,'rows':[]};var _0x15a04e=_[_0xea89('0x31')](db[_0xea89('0x32')][_0xea89('0x33')],function(_0x23a982){return{'name':_0x23a982[_0xea89('0x34')],'type':_0x23a982[_0xea89('0x35')][_0xea89('0x36')]};});_0x5b022b['model']=_[_0xea89('0x31')](_0x15a04e,_0xea89('0x2e'));_0x5b022b[_0xea89('0x37')]=_[_0xea89('0x38')](_0x1a07b3[_0xea89('0x37')]);_0x5b022b[_0xea89('0x39')]=_[_0xea89('0x3a')](_0x5b022b[_0xea89('0x3b')],_0x5b022b[_0xea89('0x37')]);_0x3b0c53[_0xea89('0x3c')]=_[_0xea89('0x3a')](_0x5b022b[_0xea89('0x3b')],qs[_0xea89('0x3d')](_0x1a07b3[_0xea89('0x37')][_0xea89('0x3d')]));_0x3b0c53[_0xea89('0x3c')]=_0x3b0c53[_0xea89('0x3c')][_0xea89('0x3e')]?_0x3b0c53[_0xea89('0x3c')]:_0x5b022b[_0xea89('0x3b')];if(!_0x1a07b3[_0xea89('0x37')]['hasOwnProperty'](_0xea89('0x3f'))){_0x3b0c53[_0xea89('0x22')]=qs[_0xea89('0x22')](_0x1a07b3['query'][_0xea89('0x22')]);_0x3b0c53[_0xea89('0x20')]=qs['offset'](_0x1a07b3[_0xea89('0x37')][_0xea89('0x20')]);}_0x3b0c53[_0xea89('0x40')]=qs[_0xea89('0x41')](_0x1a07b3[_0xea89('0x37')][_0xea89('0x41')]);_0x3b0c53[_0xea89('0x42')]=qs['filters'](_[_0xea89('0x43')](_0x1a07b3[_0xea89('0x37')],_0x5b022b['filters']),_0x15a04e);if(_0x1a07b3[_0xea89('0x37')][_0xea89('0x44')]){_0x3b0c53['where']=_['merge'](_0x3b0c53['where'],{'$or':_['map'](_0x15a04e,function(_0x59efc6){if(_0x59efc6['type']!==_0xea89('0x45')){var _0xab135c={};_0xab135c[_0x59efc6[_0xea89('0x2e')]]={'$like':'%'+_0x1a07b3[_0xea89('0x37')][_0xea89('0x44')]+'%'};return _0xab135c;}})});}_0x3b0c53=_[_0xea89('0x46')]({},_0x3b0c53,_0x1a07b3[_0xea89('0x47')]);var _0x425e7e={'where':_0x3b0c53[_0xea89('0x42')]};return db['OpenchannelQueue']['count'](_0x425e7e)[_0xea89('0x29')](function(_0x4ca94b){_0x55396a['count']=_0x4ca94b;if(_0x1a07b3[_0xea89('0x37')][_0xea89('0x48')]){_0x3b0c53[_0xea89('0x49')]=[{'all':!![]}];}return db[_0xea89('0x32')]['findAll'](_0x3b0c53);})[_0xea89('0x29')](function(_0x20b70f){_0x55396a[_0xea89('0x4a')]=_0x20b70f;return _0x55396a;})[_0xea89('0x29')](respondWithFilteredResult(_0x149a01,_0x3b0c53))[_0xea89('0x4b')](handleError(_0x149a01,null));};exports['show']=function(_0x11107c,_0x1853c0){var _0x1f5524={'raw':!![],'where':{'id':_0x11107c[_0xea89('0x4c')]['id']}},_0xb992f5={};_0xb992f5[_0xea89('0x3b')]=_[_0xea89('0x38')](db[_0xea89('0x32')][_0xea89('0x33')]);_0xb992f5[_0xea89('0x37')]=_[_0xea89('0x38')](_0x11107c[_0xea89('0x37')]);_0xb992f5[_0xea89('0x39')]=_[_0xea89('0x3a')](_0xb992f5[_0xea89('0x3b')],_0xb992f5[_0xea89('0x37')]);_0x1f5524[_0xea89('0x3c')]=_[_0xea89('0x3a')](_0xb992f5['model'],qs[_0xea89('0x3d')](_0x11107c[_0xea89('0x37')][_0xea89('0x3d')]));_0x1f5524['attributes']=_0x1f5524[_0xea89('0x3c')]['length']?_0x1f5524['attributes']:_0xb992f5[_0xea89('0x3b')];if(_0x11107c[_0xea89('0x37')][_0xea89('0x48')]){_0x1f5524[_0xea89('0x49')]=[{'all':!![]}];}_0x1f5524=_[_0xea89('0x46')]({},_0x1f5524,_0x11107c[_0xea89('0x47')]);return db[_0xea89('0x32')][_0xea89('0x4d')](_0x1f5524)[_0xea89('0x29')](handleEntityNotFound(_0x1853c0,null))[_0xea89('0x29')](respondWithResult(_0x1853c0,null))[_0xea89('0x4b')](handleError(_0x1853c0,null));};exports['create']=function(_0x3c8679,_0x3f4937){return db['OpenchannelQueue'][_0xea89('0x4e')](_0x3c8679['body'],{})['then'](function(_0x50fa7b){var _0xbd568e=_0x3c8679['user'][_0xea89('0x2b')]({'plain':!![]});if(!_0xbd568e)throw new Error(_0xea89('0x4f'));if(_0xbd568e[_0xea89('0x50')]==='user'){var _0x420001=_0x50fa7b[_0xea89('0x2b')]({'plain':!![]});var _0x12b475=_0xea89('0x2c');return db[_0xea89('0x51')]['find']({'where':{'name':_0x12b475,'userProfileId':_0xbd568e[_0xea89('0x52')]},'raw':!![]})[_0xea89('0x29')](function(_0x3c4851){if(_0x3c4851&&_0x3c4851['autoAssociation']===0x0){return db['UserProfileResource'][_0xea89('0x4e')]({'name':_0x420001['name'],'resourceId':_0x420001['id'],'type':_0x3c4851[_0xea89('0x2e')],'sectionId':_0x3c4851['id']},{})[_0xea89('0x29')](function(){return _0x50fa7b;});}else{return _0x50fa7b;}})['catch'](function(_0x5f5b48){logger[_0xea89('0x53')](_0xea89('0x54'),_0x5f5b48);throw _0x5f5b48;});}return _0x50fa7b;})[_0xea89('0x29')](respondWithResult(_0x3f4937,0xc9))['catch'](handleError(_0x3f4937,null));};exports[_0xea89('0x28')]=function(_0x5f5448,_0x380572){if(_0x5f5448[_0xea89('0x55')]['id']){delete _0x5f5448[_0xea89('0x55')]['id'];}return db[_0xea89('0x32')][_0xea89('0x4d')]({'where':{'id':_0x5f5448[_0xea89('0x4c')]['id']}})[_0xea89('0x29')](handleEntityNotFound(_0x380572,null))[_0xea89('0x29')](saveUpdates(_0x5f5448[_0xea89('0x55')],null))[_0xea89('0x29')](respondWithResult(_0x380572,null))[_0xea89('0x4b')](handleError(_0x380572,null));};exports[_0xea89('0x2a')]=function(_0x2b3663,_0x9141ac){return db[_0xea89('0x32')]['find']({'where':{'id':_0x2b3663[_0xea89('0x4c')]['id']}})['then'](handleEntityNotFound(_0x9141ac,null))[_0xea89('0x29')](removeEntity(_0x9141ac,null))[_0xea89('0x4b')](handleError(_0x9141ac,null));};exports['describe']=function(_0x2b17af,_0x7f2adc){return db[_0xea89('0x32')][_0xea89('0x56')]()[_0xea89('0x29')](respondWithResult(_0x7f2adc,null))[_0xea89('0x4b')](handleError(_0x7f2adc,null));};exports[_0xea89('0x57')]=function(_0x5da73c,_0x240211,_0x597554){var _0x1caa24={'raw':!![],'where':{}},_0x1d6601={},_0x37426e;return db[_0xea89('0x32')][_0xea89('0x58')]({'where':{'id':_0x5da73c[_0xea89('0x4c')]['id']}})[_0xea89('0x29')](handleEntityNotFound(_0x240211,null))[_0xea89('0x29')](function(_0x5955ba){if(_0x5955ba){_0x37426e=_0x5955ba['get']({'plain':!![]});_0x1d6601['model']=_[_0xea89('0x38')](db['UserOpenchannelQueue'][_0xea89('0x33')]);_0x1d6601[_0xea89('0x37')]=_['keys'](_0x5da73c[_0xea89('0x37')]);_0x1d6601[_0xea89('0x39')]=_[_0xea89('0x3a')](_0x1d6601[_0xea89('0x3b')],_0x1d6601[_0xea89('0x37')]);_0x1caa24['attributes']=_['intersection'](_0x1d6601[_0xea89('0x3b')],qs[_0xea89('0x3d')](_0x5da73c['query'][_0xea89('0x3d')]));_0x1caa24['attributes']=_0x1caa24[_0xea89('0x3c')][_0xea89('0x3e')]?_0x1caa24[_0xea89('0x3c')]:_0x1d6601['model'];if(!_0x5da73c['query'][_0xea89('0x59')]('nolimit')){_0x1caa24[_0xea89('0x22')]=qs['limit'](_0x5da73c[_0xea89('0x37')]['limit']);_0x1caa24['offset']=qs[_0xea89('0x20')](_0x5da73c[_0xea89('0x37')][_0xea89('0x20')]);}_0x1caa24[_0xea89('0x40')]=qs[_0xea89('0x41')](_0x5da73c['query']['sort']);_0x1caa24[_0xea89('0x42')]=qs[_0xea89('0x39')](_[_0xea89('0x43')](_0x5da73c['query'],_0x1d6601[_0xea89('0x39')]));_0x1caa24['where']['OpenchannelQueueId']=_0x5955ba['id'];if(_0x5da73c[_0xea89('0x37')]['filter']){_0x1caa24[_0xea89('0x42')]=_['merge'](_0x1caa24[_0xea89('0x42')],{'$or':_[_0xea89('0x31')](_0x1caa24['attributes'],function(_0x1cd84c){var _0x9e309b={};_0x9e309b[_0x1cd84c]={'$like':'%'+_0x5da73c[_0xea89('0x37')]['filter']+'%'};return _0x9e309b;})});}_0x1caa24=_[_0xea89('0x46')]({},_0x1caa24,_0x5da73c[_0xea89('0x47')]);return db['UserOpenchannelQueue'][_0xea89('0x5a')](_0x1caa24);}})[_0xea89('0x29')](function(_0x1cc2df){if(_0x1cc2df){return db['User'][_0xea89('0x5b')]({'where':{'id':_[_0xea89('0x31')](_0x1cc2df,_0xea89('0x5c')),'role':'agent'},'attributes':['id',_0xea89('0x2e'),_0xea89('0x5d'),_0xea89('0x5e'),_0xea89('0x5f')]});}})[_0xea89('0x29')](function(_0x234548){if(_0x234548){return{'count':_0x234548[_0xea89('0x23')],'rows':_[_0xea89('0x31')](_0x234548[_0xea89('0x4a')],function(_0x39265c){return{'membername':_0x39265c[_0xea89('0x2e')],'UserId':_0x39265c['id'],'queue_name':_0x37426e[_0xea89('0x2e')],'OpenchannelQueueId':_0x37426e['id'],'interface':util[_0xea89('0x60')](_0xea89('0x61'),_0xea89('0x62'),_0x39265c['name']),'penalty':0x0,'paused':_0x39265c[_0xea89('0x5d')],'createdAt':_0x39265c[_0xea89('0x5f')],'updatedAt':_0x39265c[_0xea89('0x5e')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xea89('0x29')](respondWithFilteredResult(_0x240211,_0x1caa24))['catch'](handleError(_0x240211,null));};exports['getTeams']=function(_0x5428bd,_0xc613b6,_0x41fc5e){var _0xbdc3f4={};var _0x3fc92c={};var _0x19b2e4;var _0x3bf146;return db['OpenchannelQueue'][_0xea89('0x58')]({'where':{'id':_0x5428bd[_0xea89('0x4c')]['id']}})[_0xea89('0x29')](handleEntityNotFound(_0xc613b6,null))['then'](function(_0x551104){if(_0x551104){_0x19b2e4=_0x551104;_0x3fc92c[_0xea89('0x3b')]=_['keys'](db[_0xea89('0x63')][_0xea89('0x33')]);_0x3fc92c['query']=_[_0xea89('0x38')](_0x5428bd[_0xea89('0x37')]);_0x3fc92c['filters']=_[_0xea89('0x3a')](_0x3fc92c[_0xea89('0x3b')],_0x3fc92c[_0xea89('0x37')]);_0xbdc3f4[_0xea89('0x3c')]=_[_0xea89('0x3a')](_0x3fc92c['model'],qs[_0xea89('0x3d')](_0x5428bd['query'][_0xea89('0x3d')]));_0xbdc3f4[_0xea89('0x3c')]=_0xbdc3f4[_0xea89('0x3c')][_0xea89('0x3e')]?_0xbdc3f4[_0xea89('0x3c')]:_0x3fc92c[_0xea89('0x3b')];_0xbdc3f4[_0xea89('0x40')]=qs[_0xea89('0x41')](_0x5428bd[_0xea89('0x37')]['sort']);_0xbdc3f4[_0xea89('0x42')]=qs[_0xea89('0x39')](_[_0xea89('0x43')](_0x5428bd[_0xea89('0x37')],_0x3fc92c[_0xea89('0x39')]));if(_0x5428bd[_0xea89('0x37')]['filter']){_0xbdc3f4[_0xea89('0x42')]=_[_0xea89('0x46')](_0xbdc3f4[_0xea89('0x42')],{'$or':_[_0xea89('0x31')](_0xbdc3f4[_0xea89('0x3c')],function(_0x1d30d0){var _0x4364c4={};_0x4364c4[_0x1d30d0]={'$like':'%'+_0x5428bd[_0xea89('0x37')][_0xea89('0x44')]+'%'};return _0x4364c4;})});}_0xbdc3f4=_[_0xea89('0x46')]({},_0xbdc3f4,_0x5428bd[_0xea89('0x47')]);return _0x19b2e4['getTeams'](_0xbdc3f4);}})[_0xea89('0x29')](function(_0x48cd96){if(_0x48cd96){_0x3bf146=_0x48cd96[_0xea89('0x3e')];if(!_0x5428bd[_0xea89('0x37')][_0xea89('0x59')](_0xea89('0x3f'))){_0xbdc3f4[_0xea89('0x22')]=qs['limit'](_0x5428bd[_0xea89('0x37')]['limit']);_0xbdc3f4[_0xea89('0x20')]=qs[_0xea89('0x20')](_0x5428bd[_0xea89('0x37')][_0xea89('0x20')]);}return _0x19b2e4[_0xea89('0x64')](_0xbdc3f4);}})[_0xea89('0x29')](function(_0xd8054e){if(_0xd8054e){return _0xd8054e?{'count':_0x3bf146,'rows':_0xd8054e}:null;}})[_0xea89('0x29')](respondWithResult(_0xc613b6,null))[_0xea89('0x4b')](handleError(_0xc613b6,null));};exports[_0xea89('0x65')]=function(_0x545bbd,_0x262012,_0x378da8){var _0x31bc87=_0x545bbd[_0xea89('0x55')][_0xea89('0x66')];return db[_0xea89('0x63')][_0xea89('0x5a')]({'where':{'id':_0x31bc87},'attributes':['id'],'include':[{'model':db[_0xea89('0x67')],'as':_0xea89('0x68'),'attributes':['id',_0xea89('0x2e'),'online',_0xea89('0x69'),_0xea89('0x6a')],'raw':!![]}]})[_0xea89('0x29')](function(_0x173e60){if(_0x173e60){var _0x2d9c3d=_[_0xea89('0x6b')](_0x173e60,function(_0x48610f){var _0x799e2e=_0x48610f['get']({'plain':!![]});return _0x799e2e[_0xea89('0x68')];});return db[_0xea89('0x32')][_0xea89('0x4d')]({'where':{'id':_0x545bbd[_0xea89('0x4c')]['id']}})[_0xea89('0x29')](function(_0x2b7cf5){return db['sequelize']['transaction'](function(_0x374359){return _0x2b7cf5[_0xea89('0x65')](_0x31bc87,{'transaction':_0x374359})[_0xea89('0x29')](function(){return BPromise[_0xea89('0x6c')](_0x2d9c3d,function(_0x2aeaca){return db[_0xea89('0x6d')]['findOrCreate']({'where':{'UserId':_0x2aeaca['id'],'OpenchannelQueueId':_0x545bbd[_0xea89('0x4c')]['id']},'transaction':_0x374359});});})[_0xea89('0x29')](function(){_0x2d9c3d['forEach'](function(_0x3409a3){socket[_0xea89('0x6e')]('userOpenchannelQueue:save',{'UserId':_0x3409a3['id'],'OpenchannelQueueId':_0x2b7cf5['id']});});});});});}})[_0xea89('0x29')](respondWithStatusCode(_0x262012,null))[_0xea89('0x4b')](handleError(_0x262012,null));};exports['removeTeams']=function(_0x18ce42,_0x57cf91,_0x5624cb){return db[_0xea89('0x63')]['findAll']({'where':{'id':_0x18ce42[_0xea89('0x37')][_0xea89('0x66')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0xea89('0x68'),'attributes':['id'],'raw':!![]}]})[_0xea89('0x29')](handleEntityNotFound(_0x57cf91,null))[_0xea89('0x29')](function(_0x3847f4){var _0x36c2ad=_['map'](_0x3847f4,'id');var _0x4ec33e=[];var _0x49c915=[];var _0x442554=squel[_0xea89('0x6f')]();_0x442554[_0xea89('0x70')](_0xea89('0x71'))[_0xea89('0x72')](_0xea89('0x73'),'tq')['join'](_0xea89('0x74'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0xea89('0x42')]('OpenchannelQueueId\x20=\x20?',_0x18ce42[_0xea89('0x4c')]['id']);for(var _0x415597=0x0;_0x415597<_0x3847f4['length'];_0x415597+=0x1){let _0x752d3e=_0x3847f4[_0x415597];for(var _0x5b1783=0x0;_0x5b1783<_0x752d3e['Agents'][_0xea89('0x3e')];_0x5b1783+=0x1){let _0x4aeba8=_0x752d3e[_0xea89('0x68')][_0x5b1783];var _0x430462=_0x442554[_0xea89('0x75')]();_0x430462['where'](_0xea89('0x76'),_0x4aeba8['id']);_0x49c915['push'](db[_0xea89('0x77')][_0xea89('0x37')](_0x430462[_0xea89('0x78')](),{'type':db[_0xea89('0x77')][_0xea89('0x79')][_0xea89('0x7a')]})[_0xea89('0x29')](function(_0xbe7fea){if(_0xbe7fea['length']===0x1){return _0x4aeba8['id'];}else{var _0x6243a8=_[_0xea89('0x7b')](_[_0xea89('0x31')](_0xbe7fea,_0xea89('0x7c')),function(_0x232633){return _[_0xea89('0x7d')](_0x36c2ad,_0x232633);});if(_0x6243a8){return _0x4aeba8['id'];}}}));}}return BPromise['all'](_0x49c915)[_0xea89('0x29')](function(_0x57be9d){_0x4ec33e=_(_0x4ec33e)[_0xea89('0x7e')](_0x57be9d)[_0xea89('0x7f')]()[_0xea89('0x80')]();return db[_0xea89('0x32')][_0xea89('0x4d')]({'where':{'id':_0x18ce42[_0xea89('0x4c')]['id']}})[_0xea89('0x29')](function(_0x3d6096){return db[_0xea89('0x77')]['transaction'](function(_0x37c8ab){return _0x3d6096[_0xea89('0x81')](_0x18ce42[_0xea89('0x37')][_0xea89('0x66')],{'transaction':_0x37c8ab})[_0xea89('0x29')](function(){if(!_[_0xea89('0x82')](_0x4ec33e)){return _0x3d6096['removeAgents'](_0x4ec33e,{'transaction':_0x37c8ab});}})['then'](function(){_0x4ec33e[_0xea89('0x83')](function(_0x50e485){socket['emit']('userOpenchannelQueue:remove',{'UserId':_0x50e485,'OpenchannelQueueId':_0x3d6096['id']});});});});});});})[_0xea89('0x29')](respondWithStatusCode(_0x57cf91,null))['catch'](handleError(_0x57cf91,null));};exports[_0xea89('0x84')]=function(_0x3ded95,_0x1f894f,_0x511802){return db[_0xea89('0x32')][_0xea89('0x4d')]({'where':{'id':_0x3ded95[_0xea89('0x4c')]['id']}})[_0xea89('0x29')](handleEntityNotFound(_0x1f894f,null))[_0xea89('0x29')](function(_0x3fab53){if(_0x3fab53){return _0x3fab53['addAgents'](_0x3ded95[_0xea89('0x55')][_0xea89('0x66')],_[_0xea89('0x85')](_0x3ded95[_0xea89('0x55')],[_0xea89('0x66'),'id'])||{})[_0xea89('0x86')](function(_0x238a16){for(var _0x408a37=0x0;_0x408a37<_0x3ded95[_0xea89('0x55')]['ids'][_0xea89('0x3e')];_0x408a37+=0x1){socket[_0xea89('0x6e')](_0xea89('0x87'),{'UserId':Number(_0x3ded95[_0xea89('0x55')][_0xea89('0x66')][_0x408a37]),'OpenchannelQueueId':Number(_0x3ded95[_0xea89('0x4c')]['id'])});}return _0x238a16;});}})[_0xea89('0x29')](respondWithResult(_0x1f894f,null))[_0xea89('0x4b')](handleError(_0x1f894f,null));};exports[_0xea89('0x88')]=function(_0x5c8d46,_0x3beeac,_0x34ff99){return db[_0xea89('0x32')]['find']({'where':{'id':_0x5c8d46['params']['id']}})[_0xea89('0x29')](handleEntityNotFound(_0x3beeac,null))[_0xea89('0x29')](function(_0x414291){if(_0x414291){return _0x414291[_0xea89('0x88')](_0x5c8d46[_0xea89('0x37')][_0xea89('0x66')])['then'](function(){if(_[_0xea89('0x89')](_0x5c8d46[_0xea89('0x37')][_0xea89('0x66')])){for(var _0x735e31=0x0;_0x735e31<_0x5c8d46[_0xea89('0x37')]['ids']['length'];_0x735e31+=0x1){socket[_0xea89('0x6e')](_0xea89('0x8a'),{'UserId':Number(_0x5c8d46[_0xea89('0x37')]['ids'][_0x735e31]),'OpenchannelQueueId':Number(_0x5c8d46[_0xea89('0x4c')]['id'])});}}else{socket[_0xea89('0x6e')](_0xea89('0x8a'),{'UserId':Number(_0x5c8d46[_0xea89('0x37')]['ids']),'OpenchannelQueueId':Number(_0x5c8d46[_0xea89('0x4c')]['id'])});}});}})[_0xea89('0x29')](respondWithStatusCode(_0x3beeac,null))[_0xea89('0x4b')](handleError(_0x3beeac,null));};exports[_0xea89('0x8b')]=function(_0x2400a0,_0x4db311,_0x3d8201){var _0x4fa369={};var _0x3a7474={};var _0x3ca975;var _0x436547;return db[_0xea89('0x32')][_0xea89('0x58')]({'where':{'id':_0x2400a0[_0xea89('0x4c')]['id']}})[_0xea89('0x29')](handleEntityNotFound(_0x4db311,null))[_0xea89('0x29')](function(_0x13b1ad){if(_0x13b1ad){_0x3ca975=_0x13b1ad;_0x3a7474[_0xea89('0x3b')]=_[_0xea89('0x38')](db[_0xea89('0x67')][_0xea89('0x33')]);_0x3a7474[_0xea89('0x37')]=_['keys'](_0x2400a0['query']);_0x3a7474['filters']=_['intersection'](_0x3a7474[_0xea89('0x3b')],_0x3a7474[_0xea89('0x37')]);_0x4fa369[_0xea89('0x3c')]=_[_0xea89('0x3a')](_0x3a7474[_0xea89('0x3b')],qs[_0xea89('0x3d')](_0x2400a0[_0xea89('0x37')][_0xea89('0x3d')]));_0x4fa369['attributes']=_0x4fa369['attributes']['length']?_0x4fa369[_0xea89('0x3c')]:_0x3a7474[_0xea89('0x3b')];_0x4fa369['order']=qs[_0xea89('0x41')](_0x2400a0[_0xea89('0x37')][_0xea89('0x41')]);_0x4fa369[_0xea89('0x42')]=qs[_0xea89('0x39')](_['pick'](_0x2400a0[_0xea89('0x37')],_0x3a7474[_0xea89('0x39')]));if(_0x2400a0[_0xea89('0x37')]['filter']){_0x4fa369['where']=_['merge'](_0x4fa369[_0xea89('0x42')],{'$or':_['map'](_0x4fa369['attributes'],function(_0x39903c){var _0x4d0535={};_0x4d0535[_0x39903c]={'$like':'%'+_0x2400a0['query'][_0xea89('0x44')]+'%'};return _0x4d0535;})});}_0x4fa369=_[_0xea89('0x46')]({},_0x4fa369,_0x2400a0['options']);return _0x3ca975[_0xea89('0x8b')](_0x4fa369);}})['then'](function(_0x3c111b){if(_0x3c111b){_0x436547=_0x3c111b[_0xea89('0x3e')];if(!_0x2400a0[_0xea89('0x37')][_0xea89('0x59')](_0xea89('0x3f'))){_0x4fa369[_0xea89('0x22')]=qs[_0xea89('0x22')](_0x2400a0['query']['limit']);_0x4fa369['offset']=qs['offset'](_0x2400a0[_0xea89('0x37')]['offset']);}return _0x3ca975[_0xea89('0x8b')](_0x4fa369);}})['then'](function(_0x47d16a){if(_0x47d16a){return _0x47d16a?{'count':_0x436547,'rows':_0x47d16a}:null;}})[_0xea89('0x29')](respondWithResult(_0x4db311,null))['catch'](handleError(_0x4db311,null));}; \ No newline at end of file +var _0x7380=['../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelQueue.socket','register','sendStatus','end','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','update','then','get','OpenchannelQueues','UserProfileResource','error','name','send','index','map','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','filter','merge','where','VIRTUAL','options','OpenchannelQueue','includeAll','include','findAll','rows','show','params','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserOpenchannelQueue','OpenchannelQueueId','findAndCountAll','UserId','agent','openchannelPause','updatedAt','createdAt','format','%s/%s','SIP','getTeams','order','addTeams','Team','Agents','online','interface','flatMap','sequelize','transaction','each','forEach','emit','removeTeams','ids','User','select','field','tq.TeamId','from','OpenchannelQueueId\x20=\x20?','push','QueryTypes','SELECT','TeamId','all','value','isEmpty','userOpenchannelQueue:remove','addAgents','omit','spread','removeAgents','isArray','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis'];(function(_0x5927f8,_0x4ff5b5){var _0x183881=function(_0x1e501b){while(--_0x1e501b){_0x5927f8['push'](_0x5927f8['shift']());}};_0x183881(++_0x4ff5b5);}(_0x7380,0x10a));var _0x0738=function(_0x8dc04d,_0xaa7559){_0x8dc04d=_0x8dc04d-0x0;var _0x2f5f28=_0x7380[_0x8dc04d];return _0x2f5f28;};'use strict';var emlformat=require(_0x0738('0x0'));var rimraf=require(_0x0738('0x1'));var zipdir=require(_0x0738('0x2'));var jsonpatch=require(_0x0738('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x0738('0x4'));var Mustache=require(_0x0738('0x5'));var util=require(_0x0738('0x6'));var path=require(_0x0738('0x7'));var sox=require(_0x0738('0x8'));var csv=require(_0x0738('0x9'));var ejs=require(_0x0738('0xa'));var fs=require('fs');var fs_extra=require(_0x0738('0xb'));var _=require(_0x0738('0xc'));var squel=require(_0x0738('0xd'));var crypto=require(_0x0738('0xe'));var jsforce=require(_0x0738('0xf'));var deskjs=require(_0x0738('0x10'));var toCsv=require(_0x0738('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x0738('0x11'));var authService=require(_0x0738('0x12'));var qs=require(_0x0738('0x13'));var as=require(_0x0738('0x14'));var hardwareService=require(_0x0738('0x15'));var logger=require(_0x0738('0x16'))(_0x0738('0x17'));var utils=require(_0x0738('0x18'));var config=require(_0x0738('0x19'));var licenseUtil=require(_0x0738('0x1a'));var db=require(_0x0738('0x1b'))['db'];config[_0x0738('0x1c')]=_[_0x0738('0x1d')](config[_0x0738('0x1c')],{'host':_0x0738('0x1e'),'port':0x18eb});var socket=require(_0x0738('0x1f'))(new Redis(config[_0x0738('0x1c')]));require(_0x0738('0x20'))[_0x0738('0x21')](socket);function respondWithStatusCode(_0x250086,_0x53ab53){_0x53ab53=_0x53ab53||0xcc;return function(_0x144496){if(_0x144496){return _0x250086[_0x0738('0x22')](_0x53ab53);}return _0x250086['status'](_0x53ab53)[_0x0738('0x23')]();};}function respondWithResult(_0x4ba818,_0x5f0b4c){_0x5f0b4c=_0x5f0b4c||0xc8;return function(_0x2c1a8e){if(_0x2c1a8e){return _0x4ba818[_0x0738('0x24')](_0x5f0b4c)[_0x0738('0x25')](_0x2c1a8e);}};}function respondWithFilteredResult(_0x320e7b,_0x55fe3c){return function(_0x20ec0c){if(_0x20ec0c){var _0x1522ee=typeof _0x55fe3c[_0x0738('0x26')]===_0x0738('0x27')&&typeof _0x55fe3c['limit']===_0x0738('0x27');var _0x31ca16=_0x20ec0c[_0x0738('0x28')];var _0x4c7a6a=_0x1522ee?0x0:_0x55fe3c[_0x0738('0x26')];var _0xe4762d=_0x1522ee?_0x20ec0c[_0x0738('0x28')]:_0x55fe3c['offset']+_0x55fe3c[_0x0738('0x29')];var _0x381b78;if(_0xe4762d>=_0x31ca16){_0xe4762d=_0x31ca16;_0x381b78=0xc8;}else{_0x381b78=0xce;}_0x320e7b[_0x0738('0x24')](_0x381b78);return _0x320e7b[_0x0738('0x2a')](_0x0738('0x2b'),_0x4c7a6a+'-'+_0xe4762d+'/'+_0x31ca16)[_0x0738('0x25')](_0x20ec0c);}return null;};}function patchUpdates(_0xca8ac0){return function(_0x34bbb3){try{jsonpatch[_0x0738('0x2c')](_0x34bbb3,_0xca8ac0,!![]);}catch(_0x48bfd1){return BPromise[_0x0738('0x2d')](_0x48bfd1);}return _0x34bbb3['save']();};}function saveUpdates(_0x494ec0,_0x162e9c){return function(_0x5b9e2c){if(_0x5b9e2c){return _0x5b9e2c[_0x0738('0x2e')](_0x494ec0)[_0x0738('0x2f')](function(_0x35ee21){return _0x35ee21;});}return null;};}function removeEntity(_0x54eac6,_0x2fe951){return function(_0xe0a433){if(_0xe0a433){return _0xe0a433['destroy']()['then'](function(){var _0x549029=_0xe0a433[_0x0738('0x30')]({'plain':!![]});var _0x6ff4fc=_0x0738('0x31');return db[_0x0738('0x32')]['destroy']({'where':{'type':_0x6ff4fc,'resourceId':_0x549029['id']}})[_0x0738('0x2f')](function(){return _0xe0a433;});})[_0x0738('0x2f')](function(){_0x54eac6['status'](0xcc)[_0x0738('0x23')]();});}};}function handleEntityNotFound(_0x598141,_0x9a0ef3){return function(_0x2a7e7c){if(!_0x2a7e7c){_0x598141[_0x0738('0x22')](0x194);}return _0x2a7e7c;};}function handleError(_0x1afff8,_0xf9bef3){_0xf9bef3=_0xf9bef3||0x1f4;return function(_0x351592){logger[_0x0738('0x33')](_0x351592['stack']);if(_0x351592[_0x0738('0x34')]){delete _0x351592['name'];}_0x1afff8['status'](_0xf9bef3)[_0x0738('0x35')](_0x351592);};}exports[_0x0738('0x36')]=function(_0x2ae8cc,_0x5b93b2){var _0x40a27b={},_0xf096f5={},_0x4e8a0d={'count':0x0,'rows':[]};var _0x776843=_[_0x0738('0x37')](db['OpenchannelQueue'][_0x0738('0x38')],function(_0x301636){return{'name':_0x301636[_0x0738('0x39')],'type':_0x301636[_0x0738('0x3a')][_0x0738('0x3b')]};});_0xf096f5[_0x0738('0x3c')]=_['map'](_0x776843,_0x0738('0x34'));_0xf096f5['query']=_[_0x0738('0x3d')](_0x2ae8cc[_0x0738('0x3e')]);_0xf096f5[_0x0738('0x3f')]=_[_0x0738('0x40')](_0xf096f5[_0x0738('0x3c')],_0xf096f5[_0x0738('0x3e')]);_0x40a27b[_0x0738('0x41')]=_[_0x0738('0x40')](_0xf096f5[_0x0738('0x3c')],qs[_0x0738('0x42')](_0x2ae8cc[_0x0738('0x3e')][_0x0738('0x42')]));_0x40a27b[_0x0738('0x41')]=_0x40a27b[_0x0738('0x41')][_0x0738('0x43')]?_0x40a27b[_0x0738('0x41')]:_0xf096f5['model'];if(!_0x2ae8cc[_0x0738('0x3e')][_0x0738('0x44')](_0x0738('0x45'))){_0x40a27b[_0x0738('0x29')]=qs[_0x0738('0x29')](_0x2ae8cc[_0x0738('0x3e')][_0x0738('0x29')]);_0x40a27b[_0x0738('0x26')]=qs[_0x0738('0x26')](_0x2ae8cc[_0x0738('0x3e')][_0x0738('0x26')]);}_0x40a27b['order']=qs['sort'](_0x2ae8cc['query'][_0x0738('0x46')]);_0x40a27b['where']=qs[_0x0738('0x3f')](_[_0x0738('0x47')](_0x2ae8cc[_0x0738('0x3e')],_0xf096f5[_0x0738('0x3f')]),_0x776843);if(_0x2ae8cc['query'][_0x0738('0x48')]){_0x40a27b['where']=_[_0x0738('0x49')](_0x40a27b[_0x0738('0x4a')],{'$or':_['map'](_0x776843,function(_0xde386){if(_0xde386[_0x0738('0x3a')]!==_0x0738('0x4b')){var _0x53b7d6={};_0x53b7d6[_0xde386[_0x0738('0x34')]]={'$like':'%'+_0x2ae8cc['query'][_0x0738('0x48')]+'%'};return _0x53b7d6;}})});}_0x40a27b=_[_0x0738('0x49')]({},_0x40a27b,_0x2ae8cc[_0x0738('0x4c')]);var _0x3ceba2={'where':_0x40a27b['where']};return db[_0x0738('0x4d')][_0x0738('0x28')](_0x3ceba2)['then'](function(_0x3b4082){_0x4e8a0d[_0x0738('0x28')]=_0x3b4082;if(_0x2ae8cc['query'][_0x0738('0x4e')]){_0x40a27b[_0x0738('0x4f')]=[{'all':!![]}];}return db[_0x0738('0x4d')][_0x0738('0x50')](_0x40a27b);})[_0x0738('0x2f')](function(_0x38e214){_0x4e8a0d[_0x0738('0x51')]=_0x38e214;return _0x4e8a0d;})[_0x0738('0x2f')](respondWithFilteredResult(_0x5b93b2,_0x40a27b))['catch'](handleError(_0x5b93b2,null));};exports[_0x0738('0x52')]=function(_0x235171,_0x496228){var _0x42d89b={'raw':!![],'where':{'id':_0x235171[_0x0738('0x53')]['id']}},_0x52b4fb={};_0x52b4fb['model']=_[_0x0738('0x3d')](db[_0x0738('0x4d')][_0x0738('0x38')]);_0x52b4fb[_0x0738('0x3e')]=_['keys'](_0x235171[_0x0738('0x3e')]);_0x52b4fb['filters']=_[_0x0738('0x40')](_0x52b4fb[_0x0738('0x3c')],_0x52b4fb[_0x0738('0x3e')]);_0x42d89b[_0x0738('0x41')]=_['intersection'](_0x52b4fb[_0x0738('0x3c')],qs[_0x0738('0x42')](_0x235171[_0x0738('0x3e')][_0x0738('0x42')]));_0x42d89b[_0x0738('0x41')]=_0x42d89b[_0x0738('0x41')]['length']?_0x42d89b[_0x0738('0x41')]:_0x52b4fb['model'];if(_0x235171[_0x0738('0x3e')][_0x0738('0x4e')]){_0x42d89b['include']=[{'all':!![]}];}_0x42d89b=_[_0x0738('0x49')]({},_0x42d89b,_0x235171[_0x0738('0x4c')]);return db[_0x0738('0x4d')]['find'](_0x42d89b)[_0x0738('0x2f')](handleEntityNotFound(_0x496228,null))[_0x0738('0x2f')](respondWithResult(_0x496228,null))[_0x0738('0x54')](handleError(_0x496228,null));};exports[_0x0738('0x55')]=function(_0x963167,_0x5bdaa3){return db[_0x0738('0x4d')]['create'](_0x963167[_0x0738('0x56')],{})['then'](function(_0x5b2202){var _0x46826c=_0x963167[_0x0738('0x57')][_0x0738('0x30')]({'plain':!![]});if(!_0x46826c)throw new Error(_0x0738('0x58'));if(_0x46826c['role']===_0x0738('0x57')){var _0x5be5ce=_0x5b2202[_0x0738('0x30')]({'plain':!![]});var _0x27d3e3=_0x0738('0x31');return db['UserProfileSection'][_0x0738('0x59')]({'where':{'name':_0x27d3e3,'userProfileId':_0x46826c[_0x0738('0x5a')]},'raw':!![]})[_0x0738('0x2f')](function(_0x5629fb){if(_0x5629fb&&_0x5629fb[_0x0738('0x5b')]===0x0){return db[_0x0738('0x32')][_0x0738('0x55')]({'name':_0x5be5ce[_0x0738('0x34')],'resourceId':_0x5be5ce['id'],'type':_0x5629fb[_0x0738('0x34')],'sectionId':_0x5629fb['id']},{})[_0x0738('0x2f')](function(){return _0x5b2202;});}else{return _0x5b2202;}})[_0x0738('0x54')](function(_0x4c347d){logger[_0x0738('0x33')](_0x0738('0x5c'),_0x4c347d);throw _0x4c347d;});}return _0x5b2202;})[_0x0738('0x2f')](respondWithResult(_0x5bdaa3,0xc9))[_0x0738('0x54')](handleError(_0x5bdaa3,null));};exports[_0x0738('0x2e')]=function(_0xe2bb11,_0x2e4932){if(_0xe2bb11[_0x0738('0x56')]['id']){delete _0xe2bb11[_0x0738('0x56')]['id'];}return db[_0x0738('0x4d')][_0x0738('0x59')]({'where':{'id':_0xe2bb11['params']['id']}})['then'](handleEntityNotFound(_0x2e4932,null))[_0x0738('0x2f')](saveUpdates(_0xe2bb11['body'],null))['then'](respondWithResult(_0x2e4932,null))['catch'](handleError(_0x2e4932,null));};exports['destroy']=function(_0x343936,_0x3718a1){return db['OpenchannelQueue']['find']({'where':{'id':_0x343936[_0x0738('0x53')]['id']}})[_0x0738('0x2f')](handleEntityNotFound(_0x3718a1,null))[_0x0738('0x2f')](removeEntity(_0x3718a1,null))['catch'](handleError(_0x3718a1,null));};exports[_0x0738('0x5d')]=function(_0x1c828b,_0x27349a){return db[_0x0738('0x4d')][_0x0738('0x5d')]()[_0x0738('0x2f')](respondWithResult(_0x27349a,null))['catch'](handleError(_0x27349a,null));};exports[_0x0738('0x5e')]=function(_0x5b7d61,_0x17c5a7,_0x4cfd69){var _0x53e6fc={'raw':!![],'where':{}},_0xe2b4f8={},_0x410724;return db[_0x0738('0x4d')][_0x0738('0x5f')]({'where':{'id':_0x5b7d61['params']['id']}})[_0x0738('0x2f')](handleEntityNotFound(_0x17c5a7,null))[_0x0738('0x2f')](function(_0x38f5af){if(_0x38f5af){_0x410724=_0x38f5af['get']({'plain':!![]});_0xe2b4f8['model']=_[_0x0738('0x3d')](db[_0x0738('0x60')]['rawAttributes']);_0xe2b4f8[_0x0738('0x3e')]=_[_0x0738('0x3d')](_0x5b7d61[_0x0738('0x3e')]);_0xe2b4f8[_0x0738('0x3f')]=_[_0x0738('0x40')](_0xe2b4f8['model'],_0xe2b4f8['query']);_0x53e6fc[_0x0738('0x41')]=_['intersection'](_0xe2b4f8['model'],qs['fields'](_0x5b7d61[_0x0738('0x3e')][_0x0738('0x42')]));_0x53e6fc[_0x0738('0x41')]=_0x53e6fc[_0x0738('0x41')][_0x0738('0x43')]?_0x53e6fc[_0x0738('0x41')]:_0xe2b4f8[_0x0738('0x3c')];if(!_0x5b7d61[_0x0738('0x3e')]['hasOwnProperty'](_0x0738('0x45'))){_0x53e6fc[_0x0738('0x29')]=qs[_0x0738('0x29')](_0x5b7d61[_0x0738('0x3e')]['limit']);_0x53e6fc[_0x0738('0x26')]=qs[_0x0738('0x26')](_0x5b7d61[_0x0738('0x3e')][_0x0738('0x26')]);}_0x53e6fc['order']=qs['sort'](_0x5b7d61[_0x0738('0x3e')]['sort']);_0x53e6fc[_0x0738('0x4a')]=qs[_0x0738('0x3f')](_[_0x0738('0x47')](_0x5b7d61[_0x0738('0x3e')],_0xe2b4f8[_0x0738('0x3f')]));_0x53e6fc[_0x0738('0x4a')][_0x0738('0x61')]=_0x38f5af['id'];if(_0x5b7d61[_0x0738('0x3e')][_0x0738('0x48')]){_0x53e6fc['where']=_[_0x0738('0x49')](_0x53e6fc['where'],{'$or':_[_0x0738('0x37')](_0x53e6fc[_0x0738('0x41')],function(_0x5094e8){var _0x444f8b={};_0x444f8b[_0x5094e8]={'$like':'%'+_0x5b7d61[_0x0738('0x3e')][_0x0738('0x48')]+'%'};return _0x444f8b;})});}_0x53e6fc=_['merge']({},_0x53e6fc,_0x5b7d61[_0x0738('0x4c')]);return db[_0x0738('0x60')][_0x0738('0x50')](_0x53e6fc);}})[_0x0738('0x2f')](function(_0x3194ae){if(_0x3194ae){return db['User'][_0x0738('0x62')]({'where':{'id':_['map'](_0x3194ae,_0x0738('0x63')),'role':_0x0738('0x64')},'attributes':['id',_0x0738('0x34'),_0x0738('0x65'),_0x0738('0x66'),_0x0738('0x67')]});}})[_0x0738('0x2f')](function(_0x36d4e7){if(_0x36d4e7){return{'count':_0x36d4e7[_0x0738('0x28')],'rows':_[_0x0738('0x37')](_0x36d4e7[_0x0738('0x51')],function(_0xa98d3b){return{'membername':_0xa98d3b[_0x0738('0x34')],'UserId':_0xa98d3b['id'],'queue_name':_0x410724[_0x0738('0x34')],'OpenchannelQueueId':_0x410724['id'],'interface':util[_0x0738('0x68')](_0x0738('0x69'),_0x0738('0x6a'),_0xa98d3b[_0x0738('0x34')]),'penalty':0x0,'paused':_0xa98d3b[_0x0738('0x65')],'createdAt':_0xa98d3b[_0x0738('0x67')],'updatedAt':_0xa98d3b[_0x0738('0x66')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x17c5a7,_0x53e6fc))[_0x0738('0x54')](handleError(_0x17c5a7,null));};exports[_0x0738('0x6b')]=function(_0x55cd22,_0x57d97a,_0x27ee19){var _0x196c68={};var _0x44ad72={};var _0x495d3a;var _0x1579e6;return db[_0x0738('0x4d')][_0x0738('0x5f')]({'where':{'id':_0x55cd22['params']['id']}})[_0x0738('0x2f')](handleEntityNotFound(_0x57d97a,null))[_0x0738('0x2f')](function(_0x26d40e){if(_0x26d40e){_0x495d3a=_0x26d40e;_0x44ad72[_0x0738('0x3c')]=_[_0x0738('0x3d')](db['Team'][_0x0738('0x38')]);_0x44ad72[_0x0738('0x3e')]=_[_0x0738('0x3d')](_0x55cd22[_0x0738('0x3e')]);_0x44ad72[_0x0738('0x3f')]=_[_0x0738('0x40')](_0x44ad72['model'],_0x44ad72[_0x0738('0x3e')]);_0x196c68[_0x0738('0x41')]=_['intersection'](_0x44ad72[_0x0738('0x3c')],qs[_0x0738('0x42')](_0x55cd22[_0x0738('0x3e')][_0x0738('0x42')]));_0x196c68['attributes']=_0x196c68[_0x0738('0x41')][_0x0738('0x43')]?_0x196c68[_0x0738('0x41')]:_0x44ad72[_0x0738('0x3c')];_0x196c68[_0x0738('0x6c')]=qs[_0x0738('0x46')](_0x55cd22[_0x0738('0x3e')]['sort']);_0x196c68[_0x0738('0x4a')]=qs[_0x0738('0x3f')](_['pick'](_0x55cd22[_0x0738('0x3e')],_0x44ad72[_0x0738('0x3f')]));if(_0x55cd22[_0x0738('0x3e')]['filter']){_0x196c68[_0x0738('0x4a')]=_['merge'](_0x196c68['where'],{'$or':_[_0x0738('0x37')](_0x196c68[_0x0738('0x41')],function(_0x26d833){var _0x22828c={};_0x22828c[_0x26d833]={'$like':'%'+_0x55cd22[_0x0738('0x3e')][_0x0738('0x48')]+'%'};return _0x22828c;})});}_0x196c68=_[_0x0738('0x49')]({},_0x196c68,_0x55cd22[_0x0738('0x4c')]);return _0x495d3a[_0x0738('0x6b')](_0x196c68);}})[_0x0738('0x2f')](function(_0x4bcef5){if(_0x4bcef5){_0x1579e6=_0x4bcef5[_0x0738('0x43')];if(!_0x55cd22[_0x0738('0x3e')][_0x0738('0x44')](_0x0738('0x45'))){_0x196c68[_0x0738('0x29')]=qs[_0x0738('0x29')](_0x55cd22[_0x0738('0x3e')][_0x0738('0x29')]);_0x196c68['offset']=qs[_0x0738('0x26')](_0x55cd22[_0x0738('0x3e')][_0x0738('0x26')]);}return _0x495d3a['getTeams'](_0x196c68);}})[_0x0738('0x2f')](function(_0x45c841){if(_0x45c841){return _0x45c841?{'count':_0x1579e6,'rows':_0x45c841}:null;}})[_0x0738('0x2f')](respondWithResult(_0x57d97a,null))[_0x0738('0x54')](handleError(_0x57d97a,null));};exports[_0x0738('0x6d')]=function(_0x54df4b,_0x172831,_0x28246f){var _0x2f028f=_0x54df4b[_0x0738('0x56')]['ids'];return db[_0x0738('0x6e')][_0x0738('0x50')]({'where':{'id':_0x2f028f},'attributes':['id'],'include':[{'model':db['User'],'as':_0x0738('0x6f'),'attributes':['id',_0x0738('0x34'),_0x0738('0x70'),'voicePause',_0x0738('0x71')],'raw':!![]}]})[_0x0738('0x2f')](function(_0x4255da){if(_0x4255da){var _0x4f97b3=_[_0x0738('0x72')](_0x4255da,function(_0x23c3a4){var _0x57a44b=_0x23c3a4[_0x0738('0x30')]({'plain':!![]});return _0x57a44b[_0x0738('0x6f')];});return db[_0x0738('0x4d')][_0x0738('0x59')]({'where':{'id':_0x54df4b[_0x0738('0x53')]['id']}})['then'](function(_0x144854){return db[_0x0738('0x73')][_0x0738('0x74')](function(_0x4898ce){return _0x144854[_0x0738('0x6d')](_0x2f028f,{'transaction':_0x4898ce})[_0x0738('0x2f')](function(){return BPromise[_0x0738('0x75')](_0x4f97b3,function(_0x3ae225){return db['UserOpenchannelQueue']['findOrCreate']({'where':{'UserId':_0x3ae225['id'],'OpenchannelQueueId':_0x54df4b['params']['id']},'transaction':_0x4898ce});});})[_0x0738('0x2f')](function(){_0x4f97b3[_0x0738('0x76')](function(_0x22d612){socket[_0x0738('0x77')]('userOpenchannelQueue:save',{'UserId':_0x22d612['id'],'OpenchannelQueueId':_0x144854['id']});});});});});}})[_0x0738('0x2f')](respondWithStatusCode(_0x172831,null))[_0x0738('0x54')](handleError(_0x172831,null));};exports[_0x0738('0x78')]=function(_0x5e3d9d,_0x227781,_0x8275d4){return db['Team']['findAll']({'where':{'id':_0x5e3d9d[_0x0738('0x3e')][_0x0738('0x79')]},'attributes':['id'],'include':[{'model':db[_0x0738('0x7a')],'as':'Agents','attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x227781,null))[_0x0738('0x2f')](function(_0x7f99b1){var _0x455375=_['map'](_0x7f99b1,'id');var _0x1f7823=[];var _0x5e4ed6=[];var _0x2b0de8=squel[_0x0738('0x7b')]();_0x2b0de8[_0x0738('0x7c')](_0x0738('0x7d'))[_0x0738('0x7e')]('team_has_openchannel_queues','tq')['join']('user_has_teams','ut','ut.TeamId\x20=\x20tq.TeamId')[_0x0738('0x4a')](_0x0738('0x7f'),_0x5e3d9d[_0x0738('0x53')]['id']);for(var _0x27a3c5=0x0;_0x27a3c5<_0x7f99b1[_0x0738('0x43')];_0x27a3c5+=0x1){let _0xd342e4=_0x7f99b1[_0x27a3c5];for(var _0x2b3f29=0x0;_0x2b3f29<_0xd342e4['Agents'][_0x0738('0x43')];_0x2b3f29+=0x1){let _0x46fd2c=_0xd342e4[_0x0738('0x6f')][_0x2b3f29];var _0x40dd99=_0x2b0de8['clone']();_0x40dd99['where']('ut.UserId\x20=\x20?',_0x46fd2c['id']);_0x5e4ed6[_0x0738('0x80')](db[_0x0738('0x73')][_0x0738('0x3e')](_0x40dd99['toString'](),{'type':db[_0x0738('0x73')][_0x0738('0x81')][_0x0738('0x82')]})[_0x0738('0x2f')](function(_0x4d892b){if(_0x4d892b[_0x0738('0x43')]===0x1){return _0x46fd2c['id'];}else{var _0x3d1cf0=_['every'](_['map'](_0x4d892b,_0x0738('0x83')),function(_0x2f98e2){return _['includes'](_0x455375,_0x2f98e2);});if(_0x3d1cf0){return _0x46fd2c['id'];}}}));}}return BPromise[_0x0738('0x84')](_0x5e4ed6)['then'](function(_0x520e99){_0x1f7823=_(_0x1f7823)['union'](_0x520e99)['compact']()[_0x0738('0x85')]();return db[_0x0738('0x4d')][_0x0738('0x59')]({'where':{'id':_0x5e3d9d[_0x0738('0x53')]['id']}})[_0x0738('0x2f')](function(_0x15f48e){return db[_0x0738('0x73')][_0x0738('0x74')](function(_0x42c1e7){return _0x15f48e[_0x0738('0x78')](_0x5e3d9d['query'][_0x0738('0x79')],{'transaction':_0x42c1e7})[_0x0738('0x2f')](function(){if(!_[_0x0738('0x86')](_0x1f7823)){return _0x15f48e['removeAgents'](_0x1f7823,{'transaction':_0x42c1e7});}})[_0x0738('0x2f')](function(){_0x1f7823[_0x0738('0x76')](function(_0x48dc94){socket[_0x0738('0x77')](_0x0738('0x87'),{'UserId':_0x48dc94,'OpenchannelQueueId':_0x15f48e['id']});});});});});});})[_0x0738('0x2f')](respondWithStatusCode(_0x227781,null))[_0x0738('0x54')](handleError(_0x227781,null));};exports[_0x0738('0x88')]=function(_0x26c8cf,_0x36184d,_0x1440a1){return db[_0x0738('0x4d')][_0x0738('0x59')]({'where':{'id':_0x26c8cf['params']['id']}})['then'](handleEntityNotFound(_0x36184d,null))[_0x0738('0x2f')](function(_0x2e11e9){if(_0x2e11e9){return _0x2e11e9['addAgents'](_0x26c8cf[_0x0738('0x56')][_0x0738('0x79')],_[_0x0738('0x89')](_0x26c8cf[_0x0738('0x56')],['ids','id'])||{})[_0x0738('0x8a')](function(_0x26ec87){for(var _0x38457b=0x0;_0x38457b<_0x26c8cf[_0x0738('0x56')][_0x0738('0x79')][_0x0738('0x43')];_0x38457b+=0x1){socket['emit']('userOpenchannelQueue:save',{'UserId':Number(_0x26c8cf[_0x0738('0x56')]['ids'][_0x38457b]),'OpenchannelQueueId':Number(_0x26c8cf['params']['id'])});}return _0x26ec87;});}})[_0x0738('0x2f')](respondWithResult(_0x36184d,null))[_0x0738('0x54')](handleError(_0x36184d,null));};exports[_0x0738('0x8b')]=function(_0xe0d6a5,_0x1856e6,_0x26502b){return db['OpenchannelQueue'][_0x0738('0x59')]({'where':{'id':_0xe0d6a5[_0x0738('0x53')]['id']}})[_0x0738('0x2f')](handleEntityNotFound(_0x1856e6,null))[_0x0738('0x2f')](function(_0x50f164){if(_0x50f164){return _0x50f164[_0x0738('0x8b')](_0xe0d6a5[_0x0738('0x3e')][_0x0738('0x79')])[_0x0738('0x2f')](function(){if(_[_0x0738('0x8c')](_0xe0d6a5[_0x0738('0x3e')][_0x0738('0x79')])){for(var _0x438bd1=0x0;_0x438bd1<_0xe0d6a5[_0x0738('0x3e')]['ids'][_0x0738('0x43')];_0x438bd1+=0x1){socket['emit'](_0x0738('0x87'),{'UserId':Number(_0xe0d6a5[_0x0738('0x3e')][_0x0738('0x79')][_0x438bd1]),'OpenchannelQueueId':Number(_0xe0d6a5[_0x0738('0x53')]['id'])});}}else{socket[_0x0738('0x77')](_0x0738('0x87'),{'UserId':Number(_0xe0d6a5['query'][_0x0738('0x79')]),'OpenchannelQueueId':Number(_0xe0d6a5[_0x0738('0x53')]['id'])});}});}})[_0x0738('0x2f')](respondWithStatusCode(_0x1856e6,null))[_0x0738('0x54')](handleError(_0x1856e6,null));};exports['getAgents']=function(_0x3245b9,_0x876c1,_0x2bad86){var _0x5962e3={};var _0x212b30={};var _0x5e2c53;var _0x2e46de;return db[_0x0738('0x4d')]['findOne']({'where':{'id':_0x3245b9['params']['id']}})[_0x0738('0x2f')](handleEntityNotFound(_0x876c1,null))['then'](function(_0x203e2c){if(_0x203e2c){_0x5e2c53=_0x203e2c;_0x212b30[_0x0738('0x3c')]=_[_0x0738('0x3d')](db[_0x0738('0x7a')][_0x0738('0x38')]);_0x212b30['query']=_['keys'](_0x3245b9[_0x0738('0x3e')]);_0x212b30[_0x0738('0x3f')]=_['intersection'](_0x212b30['model'],_0x212b30[_0x0738('0x3e')]);_0x5962e3[_0x0738('0x41')]=_['intersection'](_0x212b30[_0x0738('0x3c')],qs[_0x0738('0x42')](_0x3245b9[_0x0738('0x3e')][_0x0738('0x42')]));_0x5962e3[_0x0738('0x41')]=_0x5962e3[_0x0738('0x41')][_0x0738('0x43')]?_0x5962e3[_0x0738('0x41')]:_0x212b30[_0x0738('0x3c')];_0x5962e3[_0x0738('0x6c')]=qs[_0x0738('0x46')](_0x3245b9[_0x0738('0x3e')][_0x0738('0x46')]);_0x5962e3[_0x0738('0x4a')]=qs[_0x0738('0x3f')](_[_0x0738('0x47')](_0x3245b9[_0x0738('0x3e')],_0x212b30[_0x0738('0x3f')]));if(_0x3245b9[_0x0738('0x3e')][_0x0738('0x48')]){_0x5962e3[_0x0738('0x4a')]=_[_0x0738('0x49')](_0x5962e3['where'],{'$or':_[_0x0738('0x37')](_0x5962e3[_0x0738('0x41')],function(_0x30fa0f){var _0x255691={};_0x255691[_0x30fa0f]={'$like':'%'+_0x3245b9['query']['filter']+'%'};return _0x255691;})});}_0x5962e3=_[_0x0738('0x49')]({},_0x5962e3,_0x3245b9[_0x0738('0x4c')]);return _0x5e2c53[_0x0738('0x8d')](_0x5962e3);}})['then'](function(_0x258661){if(_0x258661){_0x2e46de=_0x258661['length'];if(!_0x3245b9[_0x0738('0x3e')]['hasOwnProperty'](_0x0738('0x45'))){_0x5962e3[_0x0738('0x29')]=qs['limit'](_0x3245b9[_0x0738('0x3e')][_0x0738('0x29')]);_0x5962e3[_0x0738('0x26')]=qs[_0x0738('0x26')](_0x3245b9[_0x0738('0x3e')][_0x0738('0x26')]);}return _0x5e2c53['getAgents'](_0x5962e3);}})[_0x0738('0x2f')](function(_0x3b7739){if(_0x3b7739){return _0x3b7739?{'count':_0x2e46de,'rows':_0x3b7739}:null;}})[_0x0738('0x2f')](respondWithResult(_0x876c1,null))[_0x0738('0x54')](handleError(_0x876c1,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.events.js b/server/api/openchannelQueue/openchannelQueue.events.js index 96b52d5..2191ff2 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 _0x9c15=['hook','exports','events','../../mysqldb','OpenchannelQueue','setMaxListeners','save','update','remove','emit','hasOwnProperty'];(function(_0x525207,_0x4bcf07){var _0x259c67=function(_0x9e6e39){while(--_0x9e6e39){_0x525207['push'](_0x525207['shift']());}};_0x259c67(++_0x4bcf07);}(_0x9c15,0x1a4));var _0x59c1=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x9c15[_0x17d9e3];return _0x14192d;};'use strict';var EventEmitter=require(_0x59c1('0x0'));var OpenchannelQueue=require(_0x59c1('0x1'))['db'][_0x59c1('0x2')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0x59c1('0x3')](0x0);var events={'afterCreate':_0x59c1('0x4'),'afterUpdate':_0x59c1('0x5'),'afterDestroy':_0x59c1('0x6')};function emitEvent(_0x4978b4){return function(_0x4d2004,_0x5c71ed,_0x1a2871){OpenchannelQueueEvents[_0x59c1('0x7')](_0x4978b4+':'+_0x4d2004['id'],_0x4d2004);OpenchannelQueueEvents[_0x59c1('0x7')](_0x4978b4,_0x4d2004);_0x1a2871(null);};}for(var e in events){if(events[_0x59c1('0x8')](e)){var event=events[e];OpenchannelQueue[_0x59c1('0x9')](e,emitEvent(event));}}module[_0x59c1('0xa')]=OpenchannelQueueEvents; \ No newline at end of file +var _0xd0e2=['save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','OpenchannelQueue','setMaxListeners'];(function(_0xf81188,_0x312c2b){var _0x2e9594=function(_0x535bb6){while(--_0x535bb6){_0xf81188['push'](_0xf81188['shift']());}};_0x2e9594(++_0x312c2b);}(_0xd0e2,0xac));var _0x2d0e=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd0e2[_0x20a584];return _0x4b41a8;};'use strict';var EventEmitter=require(_0x2d0e('0x0'));var OpenchannelQueue=require(_0x2d0e('0x1'))['db'][_0x2d0e('0x2')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0x2d0e('0x3')](0x0);var events={'afterCreate':_0x2d0e('0x4'),'afterUpdate':_0x2d0e('0x5'),'afterDestroy':_0x2d0e('0x6')};function emitEvent(_0x4b1624){return function(_0x5ef9db,_0x54371d,_0x4b215a){OpenchannelQueueEvents[_0x2d0e('0x7')](_0x4b1624+':'+_0x5ef9db['id'],_0x5ef9db);OpenchannelQueueEvents['emit'](_0x4b1624,_0x5ef9db);_0x4b215a(null);};}for(var e in events){if(events[_0x2d0e('0x8')](e)){var event=events[e];OpenchannelQueue[_0x2d0e('0x9')](e,emitEvent(event));}}module[_0x2d0e('0xa')]=OpenchannelQueueEvents; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.model.js b/server/api/openchannelQueue/openchannelQueue.model.js index be07900..2f6d3bc 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 _0xcd01=['api','moment','bluebird','path','rimraf','../../config/environment','./openchannelQueue.attributes','exports','OpenchannelQueue','openchannel_queues','lodash','util','../../config/logger'];(function(_0x1612c2,_0xf52684){var _0x27535e=function(_0x23dcba){while(--_0x23dcba){_0x1612c2['push'](_0x1612c2['shift']());}};_0x27535e(++_0xf52684);}(_0xcd01,0x176));var _0x1cd0=function(_0x34b7ef,_0x1a42f8){_0x34b7ef=_0x34b7ef-0x0;var _0x12f9b0=_0xcd01[_0x34b7ef];return _0x12f9b0;};'use strict';var _=require(_0x1cd0('0x0'));var util=require(_0x1cd0('0x1'));var logger=require(_0x1cd0('0x2'))(_0x1cd0('0x3'));var moment=require(_0x1cd0('0x4'));var BPromise=require(_0x1cd0('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1cd0('0x6'));var rimraf=require(_0x1cd0('0x7'));var config=require(_0x1cd0('0x8'));var attributes=require(_0x1cd0('0x9'));module[_0x1cd0('0xa')]=function(_0x344684,_0x590ae1){return _0x344684['define'](_0x1cd0('0xb'),attributes,{'tableName':_0x1cd0('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9a00=['../../config/logger','api','bluebird','rimraf','./openchannelQueue.attributes','exports','define','OpenchannelQueue','lodash','util'];(function(_0x49a9d1,_0x57fadf){var _0xa178f4=function(_0x34e2ad){while(--_0x34e2ad){_0x49a9d1['push'](_0x49a9d1['shift']());}};_0xa178f4(++_0x57fadf);}(_0x9a00,0x80));var _0x09a0=function(_0x26c4b9,_0x4ac532){_0x26c4b9=_0x26c4b9-0x0;var _0x1b495f=_0x9a00[_0x26c4b9];return _0x1b495f;};'use strict';var _=require(_0x09a0('0x0'));var util=require(_0x09a0('0x1'));var logger=require(_0x09a0('0x2'))(_0x09a0('0x3'));var moment=require('moment');var BPromise=require(_0x09a0('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x09a0('0x5'));var config=require('../../config/environment');var attributes=require(_0x09a0('0x6'));module[_0x09a0('0x7')]=function(_0xb05358,_0x33c250){return _0xb05358[_0x09a0('0x8')](_0x09a0('0x9'),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 b1b68cc..3cd7edf 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 _0x4656=['message','result','catch','GetOpenchannelQueue','OpenchannelQueue','findAll','options','raw','where','attributes','limit','include','model','map','then','ShowOpenchannelQueue','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','redis','localhost','./openchannelQueue.socket','info','request\x20sent','debug','OpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','OpenchannelQueue,\x20%s,\x20%s'];(function(_0x5dff34,_0x1e00fc){var _0x3c420f=function(_0x56cb21){while(--_0x56cb21){_0x5dff34['push'](_0x5dff34['shift']());}};_0x3c420f(++_0x1e00fc);}(_0x4656,0x166));var _0x6465=function(_0xf16b1,_0x33c637){_0xf16b1=_0xf16b1-0x0;var _0x26f94d=_0x4656[_0xf16b1];return _0x26f94d;};'use strict';var _=require(_0x6465('0x0'));var util=require(_0x6465('0x1'));var moment=require(_0x6465('0x2'));var BPromise=require(_0x6465('0x3'));var rs=require(_0x6465('0x4'));var fs=require('fs');var Redis=require(_0x6465('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x6465('0x6'));var logger=require('../../config/logger')(_0x6465('0x7'));var config=require(_0x6465('0x8'));var jayson=require(_0x6465('0x9'));var client=jayson[_0x6465('0xa')]['http']({'port':0x232a});config[_0x6465('0xb')]=_['defaults'](config['redis'],{'host':_0x6465('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x6465('0xb')]));require(_0x6465('0xd'))['register'](socket);function respondWithRpcPromise(_0x965059,_0x3926a4,_0x278a8d){return new BPromise(function(_0x58a9a2,_0x482567){return client['request'](_0x965059,_0x278a8d)['then'](function(_0x46ef74){logger[_0x6465('0xe')]('OpenchannelQueue,\x20%s,\x20%s',_0x3926a4,_0x6465('0xf'));logger[_0x6465('0x10')](_0x6465('0x11'),_0x3926a4,_0x6465('0xf'),JSON[_0x6465('0x12')](_0x46ef74));if(_0x46ef74[_0x6465('0x13')]){if(_0x46ef74[_0x6465('0x13')][_0x6465('0x14')]===0x1f4){logger[_0x6465('0x13')](_0x6465('0x15'),_0x3926a4,_0x46ef74[_0x6465('0x13')][_0x6465('0x16')]);return _0x482567(_0x46ef74[_0x6465('0x13')]['message']);}logger[_0x6465('0x13')]('OpenchannelQueue,\x20%s,\x20%s',_0x3926a4,_0x46ef74[_0x6465('0x13')][_0x6465('0x16')]);return _0x58a9a2(_0x46ef74[_0x6465('0x13')][_0x6465('0x16')]);}else{logger[_0x6465('0xe')](_0x6465('0x15'),_0x3926a4,_0x6465('0xf'));_0x58a9a2(_0x46ef74[_0x6465('0x17')][_0x6465('0x16')]);}})[_0x6465('0x18')](function(_0x458c57){logger[_0x6465('0x13')](_0x6465('0x15'),_0x3926a4,_0x458c57);_0x482567(_0x458c57);});});}exports[_0x6465('0x19')]=function(_0x3d027a){var _0x4ac22e=this;return new Promise(function(_0x6c9fef,_0xb5d3e3){return db[_0x6465('0x1a')][_0x6465('0x1b')]({'raw':_0x3d027a[_0x6465('0x1c')]?_0x3d027a['options'][_0x6465('0x1d')]===undefined?!![]:![]:!![],'where':_0x3d027a[_0x6465('0x1c')]?_0x3d027a[_0x6465('0x1c')][_0x6465('0x1e')]||null:null,'attributes':_0x3d027a[_0x6465('0x1c')]?_0x3d027a[_0x6465('0x1c')][_0x6465('0x1f')]||null:null,'limit':_0x3d027a[_0x6465('0x1c')]?_0x3d027a['options'][_0x6465('0x20')]||null:null,'include':_0x3d027a[_0x6465('0x1c')]?_0x3d027a[_0x6465('0x1c')]['include']?_['map'](_0x3d027a[_0x6465('0x1c')][_0x6465('0x21')],function(_0x13a968){return{'model':db[_0x13a968[_0x6465('0x22')]],'as':_0x13a968['as'],'attributes':_0x13a968[_0x6465('0x1f')],'include':_0x13a968[_0x6465('0x21')]?_[_0x6465('0x23')](_0x13a968[_0x6465('0x21')],function(_0x563ac6){return{'model':db[_0x563ac6['model']],'as':_0x563ac6['as'],'attributes':_0x563ac6[_0x6465('0x1f')],'include':_0x563ac6[_0x6465('0x21')]?_[_0x6465('0x23')](_0x563ac6['include'],function(_0x20a392){return{'model':db[_0x20a392[_0x6465('0x22')]],'as':_0x20a392['as'],'attributes':_0x20a392['attributes']};}):[]};}):[]};}):[]:[]})[_0x6465('0x24')](function(_0x3ea5c9){logger[_0x6465('0xe')]('GetOpenchannelQueue',_0x3d027a);logger['debug']('GetOpenchannelQueue',_0x3d027a,JSON[_0x6465('0x12')](_0x3ea5c9));_0x6c9fef(_0x3ea5c9);})[_0x6465('0x18')](function(_0x43c8dd){logger[_0x6465('0x13')](_0x6465('0x19'),_0x43c8dd[_0x6465('0x16')],_0x3d027a);_0xb5d3e3(_0x4ac22e[_0x6465('0x13')](0x1f4,_0x43c8dd[_0x6465('0x16')]));});});};exports[_0x6465('0x25')]=function(_0x2675d5){var _0x112e72=this;return new Promise(function(_0x35feb3,_0x283d76){return db[_0x6465('0x1a')]['find']({'raw':_0x2675d5[_0x6465('0x1c')]?_0x2675d5[_0x6465('0x1c')][_0x6465('0x1d')]===undefined?!![]:![]:!![],'where':_0x2675d5[_0x6465('0x1c')]?_0x2675d5[_0x6465('0x1c')]['where']||null:null,'attributes':_0x2675d5[_0x6465('0x1c')]?_0x2675d5['options']['attributes']||null:null,'include':_0x2675d5[_0x6465('0x1c')]?_0x2675d5[_0x6465('0x1c')][_0x6465('0x21')]?_[_0x6465('0x23')](_0x2675d5[_0x6465('0x1c')][_0x6465('0x21')],function(_0x3f8d55){return{'model':db[_0x3f8d55['model']],'as':_0x3f8d55['as'],'attributes':_0x3f8d55[_0x6465('0x1f')],'include':_0x3f8d55[_0x6465('0x21')]?_['map'](_0x3f8d55[_0x6465('0x21')],function(_0x246f77){return{'model':db[_0x246f77[_0x6465('0x22')]],'as':_0x246f77['as'],'attributes':_0x246f77[_0x6465('0x1f')],'include':_0x246f77[_0x6465('0x21')]?_[_0x6465('0x23')](_0x246f77['include'],function(_0x286afc){return{'model':db[_0x286afc[_0x6465('0x22')]],'as':_0x286afc['as'],'attributes':_0x286afc[_0x6465('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x6465('0x24')](function(_0x40511f){logger['info']('ShowOpenchannelQueue',_0x2675d5);logger['debug'](_0x6465('0x25'),_0x2675d5,JSON[_0x6465('0x12')](_0x40511f));_0x35feb3(_0x40511f);})['catch'](function(_0x3acd6e){logger[_0x6465('0x13')](_0x6465('0x25'),_0x3acd6e[_0x6465('0x16')],_0x2675d5);_0x283d76(_0x112e72[_0x6465('0x13')](0x1f4,_0x3acd6e['message']));});});}; \ No newline at end of file +var _0x03ca=['info','OpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','OpenchannelQueue,\x20%s,\x20%s,\x20%s','error','message','result','GetOpenchannelQueue','options','raw','attributes','include','map','model','stringify','catch','ShowOpenchannelQueue','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','request','then'];(function(_0xf1eddb,_0x45dbb3){var _0x1b1b7b=function(_0x7d29a5){while(--_0x7d29a5){_0xf1eddb['push'](_0xf1eddb['shift']());}};_0x1b1b7b(++_0x45dbb3);}(_0x03ca,0x1b6));var _0xa03c=function(_0x37f684,_0x2b41de){_0x37f684=_0x37f684-0x0;var _0x46fd8e=_0x03ca[_0x37f684];return _0x46fd8e;};'use strict';var _=require('lodash');var util=require(_0xa03c('0x0'));var moment=require('moment');var BPromise=require(_0xa03c('0x1'));var rs=require(_0xa03c('0x2'));var fs=require('fs');var Redis=require(_0xa03c('0x3'));var db=require(_0xa03c('0x4'))['db'];var utils=require(_0xa03c('0x5'));var logger=require(_0xa03c('0x6'))('rpc');var config=require(_0xa03c('0x7'));var jayson=require(_0xa03c('0x8'));var client=jayson[_0xa03c('0x9')][_0xa03c('0xa')]({'port':0x232a});config[_0xa03c('0xb')]=_[_0xa03c('0xc')](config['redis'],{'host':_0xa03c('0xd'),'port':0x18eb});var socket=require(_0xa03c('0xe'))(new Redis(config['redis']));require('./openchannelQueue.socket')['register'](socket);function respondWithRpcPromise(_0x4dc469,_0x4bc838,_0x49af21){return new BPromise(function(_0x283b38,_0x304201){return client[_0xa03c('0xf')](_0x4dc469,_0x49af21)[_0xa03c('0x10')](function(_0xcfc77e){logger[_0xa03c('0x11')](_0xa03c('0x12'),_0x4bc838,_0xa03c('0x13'));logger[_0xa03c('0x14')](_0xa03c('0x15'),_0x4bc838,_0xa03c('0x13'),JSON['stringify'](_0xcfc77e));if(_0xcfc77e[_0xa03c('0x16')]){if(_0xcfc77e[_0xa03c('0x16')]['code']===0x1f4){logger[_0xa03c('0x16')]('OpenchannelQueue,\x20%s,\x20%s',_0x4bc838,_0xcfc77e[_0xa03c('0x16')][_0xa03c('0x17')]);return _0x304201(_0xcfc77e[_0xa03c('0x16')][_0xa03c('0x17')]);}logger[_0xa03c('0x16')](_0xa03c('0x12'),_0x4bc838,_0xcfc77e[_0xa03c('0x16')][_0xa03c('0x17')]);return _0x283b38(_0xcfc77e[_0xa03c('0x16')][_0xa03c('0x17')]);}else{logger['info'](_0xa03c('0x12'),_0x4bc838,_0xa03c('0x13'));_0x283b38(_0xcfc77e[_0xa03c('0x18')][_0xa03c('0x17')]);}})['catch'](function(_0x19e75a){logger['error'](_0xa03c('0x12'),_0x4bc838,_0x19e75a);_0x304201(_0x19e75a);});});}exports[_0xa03c('0x19')]=function(_0x57c7b4){var _0x48caf9=this;return new Promise(function(_0x5c2596,_0x5c2971){return db['OpenchannelQueue']['findAll']({'raw':_0x57c7b4[_0xa03c('0x1a')]?_0x57c7b4[_0xa03c('0x1a')][_0xa03c('0x1b')]===undefined?!![]:![]:!![],'where':_0x57c7b4['options']?_0x57c7b4[_0xa03c('0x1a')]['where']||null:null,'attributes':_0x57c7b4[_0xa03c('0x1a')]?_0x57c7b4[_0xa03c('0x1a')][_0xa03c('0x1c')]||null:null,'limit':_0x57c7b4['options']?_0x57c7b4[_0xa03c('0x1a')]['limit']||null:null,'include':_0x57c7b4[_0xa03c('0x1a')]?_0x57c7b4[_0xa03c('0x1a')][_0xa03c('0x1d')]?_[_0xa03c('0x1e')](_0x57c7b4[_0xa03c('0x1a')]['include'],function(_0x202aa9){return{'model':db[_0x202aa9[_0xa03c('0x1f')]],'as':_0x202aa9['as'],'attributes':_0x202aa9[_0xa03c('0x1c')],'include':_0x202aa9[_0xa03c('0x1d')]?_[_0xa03c('0x1e')](_0x202aa9[_0xa03c('0x1d')],function(_0x3494fa){return{'model':db[_0x3494fa[_0xa03c('0x1f')]],'as':_0x3494fa['as'],'attributes':_0x3494fa['attributes'],'include':_0x3494fa['include']?_[_0xa03c('0x1e')](_0x3494fa[_0xa03c('0x1d')],function(_0x447cba){return{'model':db[_0x447cba['model']],'as':_0x447cba['as'],'attributes':_0x447cba[_0xa03c('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xa03c('0x10')](function(_0x19b9f2){logger['info']('GetOpenchannelQueue',_0x57c7b4);logger[_0xa03c('0x14')](_0xa03c('0x19'),_0x57c7b4,JSON[_0xa03c('0x20')](_0x19b9f2));_0x5c2596(_0x19b9f2);})[_0xa03c('0x21')](function(_0x43c98b){logger[_0xa03c('0x16')](_0xa03c('0x19'),_0x43c98b[_0xa03c('0x17')],_0x57c7b4);_0x5c2971(_0x48caf9[_0xa03c('0x16')](0x1f4,_0x43c98b[_0xa03c('0x17')]));});});};exports[_0xa03c('0x22')]=function(_0x1b8437){var _0x18c837=this;return new Promise(function(_0x283e95,_0x46b08b){return db['OpenchannelQueue']['find']({'raw':_0x1b8437['options']?_0x1b8437['options'][_0xa03c('0x1b')]===undefined?!![]:![]:!![],'where':_0x1b8437[_0xa03c('0x1a')]?_0x1b8437[_0xa03c('0x1a')]['where']||null:null,'attributes':_0x1b8437[_0xa03c('0x1a')]?_0x1b8437[_0xa03c('0x1a')]['attributes']||null:null,'include':_0x1b8437[_0xa03c('0x1a')]?_0x1b8437[_0xa03c('0x1a')][_0xa03c('0x1d')]?_[_0xa03c('0x1e')](_0x1b8437[_0xa03c('0x1a')][_0xa03c('0x1d')],function(_0x2bdd9a){return{'model':db[_0x2bdd9a[_0xa03c('0x1f')]],'as':_0x2bdd9a['as'],'attributes':_0x2bdd9a['attributes'],'include':_0x2bdd9a[_0xa03c('0x1d')]?_[_0xa03c('0x1e')](_0x2bdd9a[_0xa03c('0x1d')],function(_0xfb2d90){return{'model':db[_0xfb2d90[_0xa03c('0x1f')]],'as':_0xfb2d90['as'],'attributes':_0xfb2d90['attributes'],'include':_0xfb2d90[_0xa03c('0x1d')]?_[_0xa03c('0x1e')](_0xfb2d90['include'],function(_0x563fe8){return{'model':db[_0x563fe8[_0xa03c('0x1f')]],'as':_0x563fe8['as'],'attributes':_0x563fe8[_0xa03c('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xa03c('0x10')](function(_0x357dd6){logger[_0xa03c('0x11')](_0xa03c('0x22'),_0x1b8437);logger[_0xa03c('0x14')](_0xa03c('0x22'),_0x1b8437,JSON[_0xa03c('0x20')](_0x357dd6));_0x283e95(_0x357dd6);})[_0xa03c('0x21')](function(_0x50d1b1){logger[_0xa03c('0x16')]('ShowOpenchannelQueue',_0x50d1b1[_0xa03c('0x17')],_0x1b8437);_0x46b08b(_0x18c837['error'](0x1f4,_0x50d1b1[_0xa03c('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.socket.js b/server/api/openchannelQueue/openchannelQueue.socket.js index 3cc244d..f820bb5 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 _0x2441=['openchannelQueue:','./openchannelQueue.events','save','remove','emit','removeListener','length'];(function(_0x3fba9f,_0x3b7b9b){var _0x192cf1=function(_0x557290){while(--_0x557290){_0x3fba9f['push'](_0x3fba9f['shift']());}};_0x192cf1(++_0x3b7b9b);}(_0x2441,0xa9));var _0x1244=function(_0x105a97,_0x83a1f){_0x105a97=_0x105a97-0x0;var _0x1d6d36=_0x2441[_0x105a97];return _0x1d6d36;};'use strict';var OpenchannelQueueEvents=require(_0x1244('0x0'));var events=[_0x1244('0x1'),_0x1244('0x2'),'update'];function createListener(_0x116488,_0x4d3a85){return function(_0x49b61a){_0x4d3a85[_0x1244('0x3')](_0x116488,_0x49b61a);};}function removeListener(_0x1bc442,_0x319557){return function(){OpenchannelQueueEvents[_0x1244('0x4')](_0x1bc442,_0x319557);};}exports['register']=function(_0x2e940e){for(var _0x1c5c02=0x0,_0x3e9610=events[_0x1244('0x5')];_0x1c5c02<_0x3e9610;_0x1c5c02++){var _0x56fd1f=events[_0x1c5c02];var _0x157848=createListener(_0x1244('0x6')+_0x56fd1f,_0x2e940e);OpenchannelQueueEvents['on'](_0x56fd1f,_0x157848);}}; \ No newline at end of file +var _0xf990=['./openchannelQueue.events','remove','update','register','openchannelQueue:'];(function(_0x568039,_0x570f8e){var _0x1595fc=function(_0x50ac8f){while(--_0x50ac8f){_0x568039['push'](_0x568039['shift']());}};_0x1595fc(++_0x570f8e);}(_0xf990,0x87));var _0x0f99=function(_0x5489c4,_0x1e7a17){_0x5489c4=_0x5489c4-0x0;var _0x2c4624=_0xf990[_0x5489c4];return _0x2c4624;};'use strict';var OpenchannelQueueEvents=require(_0x0f99('0x0'));var events=['save',_0x0f99('0x1'),_0x0f99('0x2')];function createListener(_0x5f2184,_0x453e4e){return function(_0x3e0628){_0x453e4e['emit'](_0x5f2184,_0x3e0628);};}function removeListener(_0x2b49cd,_0x32153a){return function(){OpenchannelQueueEvents['removeListener'](_0x2b49cd,_0x32153a);};}exports[_0x0f99('0x3')]=function(_0xcd0ec7){for(var _0x3613e4=0x0,_0x43c4aa=events['length'];_0x3613e4<_0x43c4aa;_0x3613e4++){var _0x56ac4c=events[_0x3613e4];var _0x166219=createListener(_0x0f99('0x4')+_0x56ac4c,_0xcd0ec7);OpenchannelQueueEvents['on'](_0x56ac4c,_0x166219);}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/index.js b/server/api/openchannelQueueReport/index.js index b338e74..ec95976 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 _0xa26e=['show','post','put','update','delete','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../config/environment','get','index','/describe','isAuthenticated','describe','/:id'];(function(_0x300f29,_0x4293dc){var _0x13abe4=function(_0x1efb36){while(--_0x1efb36){_0x300f29['push'](_0x300f29['shift']());}};_0x13abe4(++_0x4293dc);}(_0xa26e,0xd8));var _0xea26=function(_0x5162ac,_0x282321){_0x5162ac=_0x5162ac-0x0;var _0x28ef1b=_0xa26e[_0x5162ac];return _0x28ef1b;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xea26('0x0'));var timeout=require(_0xea26('0x1'));var express=require(_0xea26('0x2'));var router=express[_0xea26('0x3')]();var fs_extra=require(_0xea26('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xea26('0x5'));var controller=require('./openchannelQueueReport.controller');router[_0xea26('0x6')]('/',auth['isAuthenticated'](),controller[_0xea26('0x7')]);router[_0xea26('0x6')](_0xea26('0x8'),auth[_0xea26('0x9')](),controller[_0xea26('0xa')]);router[_0xea26('0x6')](_0xea26('0xb'),auth['isAuthenticated'](),controller[_0xea26('0xc')]);router[_0xea26('0xd')]('/',auth[_0xea26('0x9')](),controller['create']);router[_0xea26('0xe')](_0xea26('0xb'),auth[_0xea26('0x9')](),controller[_0xea26('0xf')]);router[_0xea26('0x10')](_0xea26('0xb'),auth[_0xea26('0x9')](),controller[_0xea26('0x11')]);module[_0xea26('0x12')]=router; \ No newline at end of file +var _0x57db=['/:id','post','create','put','update','delete','destroy','exports','multer','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelQueueReport.controller','get','isAuthenticated'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x57db,0x1a0));var _0xb57d=function(_0x51e3a1,_0x4a9a61){_0x51e3a1=_0x51e3a1-0x0;var _0x946f10=_0x57db[_0x51e3a1];return _0x946f10;};'use strict';var multer=require(_0xb57d('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xb57d('0x1'));var express=require(_0xb57d('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xb57d('0x3'));var interaction=require(_0xb57d('0x4'));var config=require(_0xb57d('0x5'));var controller=require(_0xb57d('0x6'));router[_0xb57d('0x7')]('/',auth[_0xb57d('0x8')](),controller['index']);router[_0xb57d('0x7')]('/describe',auth[_0xb57d('0x8')](),controller['describe']);router[_0xb57d('0x7')](_0xb57d('0x9'),auth[_0xb57d('0x8')](),controller['show']);router[_0xb57d('0xa')]('/',auth[_0xb57d('0x8')](),controller[_0xb57d('0xb')]);router[_0xb57d('0xc')](_0xb57d('0x9'),auth[_0xb57d('0x8')](),controller[_0xb57d('0xd')]);router[_0xb57d('0xe')](_0xb57d('0x9'),auth[_0xb57d('0x8')](),controller[_0xb57d('0xf')]);module[_0xb57d('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 1dd7d24..2007f57 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 _0x061c=['STRING','DATE','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x061c,0x1df));var _0xc061=function(_0x34fd3a,_0x331a01){_0x34fd3a=_0x34fd3a-0x0;var _0x4ab359=_0x061c[_0x34fd3a];return _0x4ab359;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0xc061('0x0')]={'uniqueid':{'type':Sequelize[_0xc061('0x1')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0xc061('0x2')]},'exitAt':{'type':Sequelize[_0xc061('0x2')]},'reason':{'type':Sequelize[_0xc061('0x1')]}}; \ No newline at end of file +var _0x3cf5=['sequelize','exports','STRING','DATE','moment'];(function(_0x41307a,_0xb39edf){var _0x51e628=function(_0x351280){while(--_0x351280){_0x41307a['push'](_0x41307a['shift']());}};_0x51e628(++_0xb39edf);}(_0x3cf5,0x1a3));var _0x53cf=function(_0x4a363f,_0x36480a){_0x4a363f=_0x4a363f-0x0;var _0x391de0=_0x3cf5[_0x4a363f];return _0x391de0;};'use strict';var moment=require(_0x53cf('0x0'));var Sequelize=require(_0x53cf('0x1'));module[_0x53cf('0x2')]={'uniqueid':{'type':Sequelize[_0x53cf('0x3')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x53cf('0x4')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0x53cf('0x4')]},'exitAt':{'type':Sequelize[_0x53cf('0x4')]},'reason':{'type':Sequelize[_0x53cf('0x3')]}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.controller.js b/server/api/openchannelQueueReport/openchannelQueueReport.controller.js index 6a3d3c2..d944dfc 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 _0xa4c0=['where','pick','filter','merge','VIRTUAL','options','includeAll','catch','params','keys','rawAttributes','length','include','find','create','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','sendStatus','end','status','json','offset','undefined','count','limit','set','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','OpenchannelQueueReport','fieldName','type','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort'];(function(_0x167604,_0x1b63d3){var _0x53cfab=function(_0x44cba7){while(--_0x44cba7){_0x167604['push'](_0x167604['shift']());}};_0x53cfab(++_0x1b63d3);}(_0xa4c0,0x1cd));var _0x0a4c=function(_0x593327,_0x4d44d7){_0x593327=_0x593327-0x0;var _0x5c648d=_0xa4c0[_0x593327];return _0x5c648d;};'use strict';var emlformat=require(_0x0a4c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x0a4c('0x1'));var jsonpatch=require(_0x0a4c('0x2'));var rp=require(_0x0a4c('0x3'));var moment=require(_0x0a4c('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x0a4c('0x5'));var util=require(_0x0a4c('0x6'));var path=require(_0x0a4c('0x7'));var sox=require(_0x0a4c('0x8'));var csv=require(_0x0a4c('0x9'));var ejs=require(_0x0a4c('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0a4c('0xb'));var squel=require(_0x0a4c('0xc'));var crypto=require(_0x0a4c('0xd'));var jsforce=require(_0x0a4c('0xe'));var deskjs=require(_0x0a4c('0xf'));var toCsv=require(_0x0a4c('0x9'));var querystring=require(_0x0a4c('0x10'));var Papa=require('papaparse');var Redis=require(_0x0a4c('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x0a4c('0x12'));var as=require(_0x0a4c('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0a4c('0x14'))('api');var utils=require(_0x0a4c('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x0a4c('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x368955,_0x2db915){_0x2db915=_0x2db915||0xcc;return function(_0x55762b){if(_0x55762b){return _0x368955[_0x0a4c('0x17')](_0x2db915);}return _0x368955['status'](_0x2db915)[_0x0a4c('0x18')]();};}function respondWithResult(_0x131aad,_0x1a0853){_0x1a0853=_0x1a0853||0xc8;return function(_0x13b1c9){if(_0x13b1c9){return _0x131aad[_0x0a4c('0x19')](_0x1a0853)[_0x0a4c('0x1a')](_0x13b1c9);}};}function respondWithFilteredResult(_0xcf0085,_0x583b1f){return function(_0x5ae129){if(_0x5ae129){var _0x14699a=typeof _0x583b1f[_0x0a4c('0x1b')]===_0x0a4c('0x1c')&&typeof _0x583b1f['limit']==='undefined';var _0x3fb237=_0x5ae129[_0x0a4c('0x1d')];var _0x267c9d=_0x14699a?0x0:_0x583b1f[_0x0a4c('0x1b')];var _0x5e778e=_0x14699a?_0x5ae129[_0x0a4c('0x1d')]:_0x583b1f['offset']+_0x583b1f[_0x0a4c('0x1e')];var _0x328b24;if(_0x5e778e>=_0x3fb237){_0x5e778e=_0x3fb237;_0x328b24=0xc8;}else{_0x328b24=0xce;}_0xcf0085[_0x0a4c('0x19')](_0x328b24);return _0xcf0085[_0x0a4c('0x1f')]('Content-Range',_0x267c9d+'-'+_0x5e778e+'/'+_0x3fb237)[_0x0a4c('0x1a')](_0x5ae129);}return null;};}function patchUpdates(_0x2f7cf1){return function(_0x552ea0){try{jsonpatch[_0x0a4c('0x20')](_0x552ea0,_0x2f7cf1,!![]);}catch(_0x5af420){return BPromise[_0x0a4c('0x21')](_0x5af420);}return _0x552ea0[_0x0a4c('0x22')]();};}function saveUpdates(_0x2229fc,_0x4b5943){return function(_0x39aa4b){if(_0x39aa4b){return _0x39aa4b[_0x0a4c('0x23')](_0x2229fc)[_0x0a4c('0x24')](function(_0x9ced92){return _0x9ced92;});}return null;};}function removeEntity(_0x5c324f,_0x335ca0){return function(_0x3a458b){if(_0x3a458b){return _0x3a458b[_0x0a4c('0x25')]()['then'](function(){_0x5c324f['status'](0xcc)[_0x0a4c('0x18')]();});}};}function handleEntityNotFound(_0x3844ed,_0x1ffbe0){return function(_0x1efd6c){if(!_0x1efd6c){_0x3844ed[_0x0a4c('0x17')](0x194);}return _0x1efd6c;};}function handleError(_0x5b1edb,_0x43c879){_0x43c879=_0x43c879||0x1f4;return function(_0x19bab8){logger[_0x0a4c('0x26')](_0x19bab8[_0x0a4c('0x27')]);if(_0x19bab8[_0x0a4c('0x28')]){delete _0x19bab8[_0x0a4c('0x28')];}_0x5b1edb[_0x0a4c('0x19')](_0x43c879)[_0x0a4c('0x29')](_0x19bab8);};}exports[_0x0a4c('0x2a')]=function(_0x3594b1,_0xe69239){var _0x4e187={},_0x25b2fc={},_0x59b573={'count':0x0,'rows':[]};var _0x3edc64=_[_0x0a4c('0x2b')](db[_0x0a4c('0x2c')]['rawAttributes'],function(_0x33faab){return{'name':_0x33faab[_0x0a4c('0x2d')],'type':_0x33faab[_0x0a4c('0x2e')]['key']};});_0x25b2fc[_0x0a4c('0x2f')]=_[_0x0a4c('0x2b')](_0x3edc64,_0x0a4c('0x28'));_0x25b2fc[_0x0a4c('0x30')]=_['keys'](_0x3594b1[_0x0a4c('0x30')]);_0x25b2fc[_0x0a4c('0x31')]=_[_0x0a4c('0x32')](_0x25b2fc[_0x0a4c('0x2f')],_0x25b2fc['query']);_0x4e187[_0x0a4c('0x33')]=_[_0x0a4c('0x32')](_0x25b2fc[_0x0a4c('0x2f')],qs[_0x0a4c('0x34')](_0x3594b1[_0x0a4c('0x30')][_0x0a4c('0x34')]));_0x4e187[_0x0a4c('0x33')]=_0x4e187['attributes']['length']?_0x4e187[_0x0a4c('0x33')]:_0x25b2fc[_0x0a4c('0x2f')];if(!_0x3594b1['query'][_0x0a4c('0x35')](_0x0a4c('0x36'))){_0x4e187['limit']=qs[_0x0a4c('0x1e')](_0x3594b1['query']['limit']);_0x4e187[_0x0a4c('0x1b')]=qs[_0x0a4c('0x1b')](_0x3594b1[_0x0a4c('0x30')]['offset']);}_0x4e187[_0x0a4c('0x37')]=qs['sort'](_0x3594b1[_0x0a4c('0x30')][_0x0a4c('0x38')]);_0x4e187[_0x0a4c('0x39')]=qs[_0x0a4c('0x31')](_[_0x0a4c('0x3a')](_0x3594b1['query'],_0x25b2fc['filters']),_0x3edc64);if(_0x3594b1[_0x0a4c('0x30')][_0x0a4c('0x3b')]){_0x4e187[_0x0a4c('0x39')]=_[_0x0a4c('0x3c')](_0x4e187[_0x0a4c('0x39')],{'$or':_[_0x0a4c('0x2b')](_0x3edc64,function(_0x54efc7){if(_0x54efc7[_0x0a4c('0x2e')]!==_0x0a4c('0x3d')){var _0x3d65b1={};_0x3d65b1[_0x54efc7['name']]={'$like':'%'+_0x3594b1[_0x0a4c('0x30')][_0x0a4c('0x3b')]+'%'};return _0x3d65b1;}})});}_0x4e187=_[_0x0a4c('0x3c')]({},_0x4e187,_0x3594b1[_0x0a4c('0x3e')]);var _0x2c4572={'where':_0x4e187['where']};return db[_0x0a4c('0x2c')][_0x0a4c('0x1d')](_0x2c4572)[_0x0a4c('0x24')](function(_0x14d9dc){_0x59b573[_0x0a4c('0x1d')]=_0x14d9dc;if(_0x3594b1['query'][_0x0a4c('0x3f')]){_0x4e187['include']=[{'all':!![]}];}return db[_0x0a4c('0x2c')]['findAll'](_0x4e187);})['then'](function(_0x2c4321){_0x59b573['rows']=_0x2c4321;return _0x59b573;})[_0x0a4c('0x24')](respondWithFilteredResult(_0xe69239,_0x4e187))[_0x0a4c('0x40')](handleError(_0xe69239,null));};exports['show']=function(_0x59d61c,_0x128d3c){var _0x1ba050={'raw':!![],'where':{'id':_0x59d61c[_0x0a4c('0x41')]['id']}},_0x28beb5={};_0x28beb5[_0x0a4c('0x2f')]=_[_0x0a4c('0x42')](db[_0x0a4c('0x2c')][_0x0a4c('0x43')]);_0x28beb5[_0x0a4c('0x30')]=_[_0x0a4c('0x42')](_0x59d61c[_0x0a4c('0x30')]);_0x28beb5[_0x0a4c('0x31')]=_[_0x0a4c('0x32')](_0x28beb5['model'],_0x28beb5['query']);_0x1ba050[_0x0a4c('0x33')]=_[_0x0a4c('0x32')](_0x28beb5[_0x0a4c('0x2f')],qs[_0x0a4c('0x34')](_0x59d61c[_0x0a4c('0x30')][_0x0a4c('0x34')]));_0x1ba050[_0x0a4c('0x33')]=_0x1ba050['attributes'][_0x0a4c('0x44')]?_0x1ba050[_0x0a4c('0x33')]:_0x28beb5[_0x0a4c('0x2f')];if(_0x59d61c[_0x0a4c('0x30')]['includeAll']){_0x1ba050[_0x0a4c('0x45')]=[{'all':!![]}];}_0x1ba050=_[_0x0a4c('0x3c')]({},_0x1ba050,_0x59d61c[_0x0a4c('0x3e')]);return db[_0x0a4c('0x2c')][_0x0a4c('0x46')](_0x1ba050)[_0x0a4c('0x24')](handleEntityNotFound(_0x128d3c,null))['then'](respondWithResult(_0x128d3c,null))[_0x0a4c('0x40')](handleError(_0x128d3c,null));};exports[_0x0a4c('0x47')]=function(_0x5827d5,_0x3578ad){return db[_0x0a4c('0x2c')]['create'](_0x5827d5[_0x0a4c('0x48')],{})[_0x0a4c('0x24')](respondWithResult(_0x3578ad,0xc9))[_0x0a4c('0x40')](handleError(_0x3578ad,null));};exports['update']=function(_0x38db80,_0xa3cf94){if(_0x38db80[_0x0a4c('0x48')]['id']){delete _0x38db80[_0x0a4c('0x48')]['id'];}return db[_0x0a4c('0x2c')][_0x0a4c('0x46')]({'where':{'id':_0x38db80['params']['id']}})[_0x0a4c('0x24')](handleEntityNotFound(_0xa3cf94,null))['then'](saveUpdates(_0x38db80[_0x0a4c('0x48')],null))[_0x0a4c('0x24')](respondWithResult(_0xa3cf94,null))['catch'](handleError(_0xa3cf94,null));};exports['destroy']=function(_0x350f18,_0x25e76e){return db['OpenchannelQueueReport']['find']({'where':{'id':_0x350f18[_0x0a4c('0x41')]['id']}})[_0x0a4c('0x24')](handleEntityNotFound(_0x25e76e,null))[_0x0a4c('0x24')](removeEntity(_0x25e76e,null))[_0x0a4c('0x40')](handleError(_0x25e76e,null));};exports[_0x0a4c('0x49')]=function(_0x5ea20c,_0x1bcf95){return db[_0x0a4c('0x2c')][_0x0a4c('0x49')]()[_0x0a4c('0x24')](respondWithResult(_0x1bcf95,null))[_0x0a4c('0x40')](handleError(_0x1bcf95,null));}; \ No newline at end of file +var _0xd934=['../../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','apply','reject','destroy','then','stack','name','index','OpenchannelQueueReport','rawAttributes','fieldName','key','model','map','keys','query','attributes','intersection','fields','length','nolimit','order','sort','where','filters','pick','filter','merge','type','VIRTUAL','includeAll','include','findAll','rows','show','params','options','find','catch','create','body','update','describe','eml-format','zip-dir','fast-json-patch','request-promise','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis'];(function(_0x2389f2,_0x4652a9){var _0x2aaadb=function(_0x195376){while(--_0x195376){_0x2389f2['push'](_0x2389f2['shift']());}};_0x2aaadb(++_0x4652a9);}(_0xd934,0x170));var _0x4d93=function(_0x4fe9e5,_0x36cca8){_0x4fe9e5=_0x4fe9e5-0x0;var _0x263129=_0xd934[_0x4fe9e5];return _0x263129;};'use strict';var emlformat=require(_0x4d93('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4d93('0x1'));var jsonpatch=require(_0x4d93('0x2'));var rp=require(_0x4d93('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x4d93('0x4'));var path=require(_0x4d93('0x5'));var sox=require(_0x4d93('0x6'));var csv=require(_0x4d93('0x7'));var ejs=require(_0x4d93('0x8'));var fs=require('fs');var fs_extra=require(_0x4d93('0x9'));var _=require(_0x4d93('0xa'));var squel=require(_0x4d93('0xb'));var crypto=require(_0x4d93('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x4d93('0xd'));var toCsv=require(_0x4d93('0x7'));var querystring=require(_0x4d93('0xe'));var Papa=require(_0x4d93('0xf'));var Redis=require(_0x4d93('0x10'));var authService=require(_0x4d93('0x11'));var qs=require(_0x4d93('0x12'));var as=require(_0x4d93('0x13'));var hardwareService=require(_0x4d93('0x14'));var logger=require(_0x4d93('0x15'))(_0x4d93('0x16'));var utils=require(_0x4d93('0x17'));var config=require(_0x4d93('0x18'));var licenseUtil=require(_0x4d93('0x19'));var db=require(_0x4d93('0x1a'))['db'];function respondWithStatusCode(_0x52f9a2,_0x41bd5b){_0x41bd5b=_0x41bd5b||0xcc;return function(_0x4c2599){if(_0x4c2599){return _0x52f9a2[_0x4d93('0x1b')](_0x41bd5b);}return _0x52f9a2[_0x4d93('0x1c')](_0x41bd5b)[_0x4d93('0x1d')]();};}function respondWithResult(_0x3d1b3c,_0x33c55f){_0x33c55f=_0x33c55f||0xc8;return function(_0x46372c){if(_0x46372c){return _0x3d1b3c[_0x4d93('0x1c')](_0x33c55f)[_0x4d93('0x1e')](_0x46372c);}};}function respondWithFilteredResult(_0x26096c,_0x347a21){return function(_0x997a28){if(_0x997a28){var _0x26b4da=typeof _0x347a21[_0x4d93('0x1f')]===_0x4d93('0x20')&&typeof _0x347a21[_0x4d93('0x21')]===_0x4d93('0x20');var _0x52925e=_0x997a28[_0x4d93('0x22')];var _0xad63c6=_0x26b4da?0x0:_0x347a21[_0x4d93('0x1f')];var _0x5bca20=_0x26b4da?_0x997a28['count']:_0x347a21['offset']+_0x347a21[_0x4d93('0x21')];var _0x622e13;if(_0x5bca20>=_0x52925e){_0x5bca20=_0x52925e;_0x622e13=0xc8;}else{_0x622e13=0xce;}_0x26096c[_0x4d93('0x1c')](_0x622e13);return _0x26096c['set']('Content-Range',_0xad63c6+'-'+_0x5bca20+'/'+_0x52925e)[_0x4d93('0x1e')](_0x997a28);}return null;};}function patchUpdates(_0x136ccf){return function(_0x5cbeb2){try{jsonpatch[_0x4d93('0x23')](_0x5cbeb2,_0x136ccf,!![]);}catch(_0x42baad){return BPromise[_0x4d93('0x24')](_0x42baad);}return _0x5cbeb2['save']();};}function saveUpdates(_0x282435,_0x3c8764){return function(_0x33e6a4){if(_0x33e6a4){return _0x33e6a4['update'](_0x282435)['then'](function(_0x1cfd20){return _0x1cfd20;});}return null;};}function removeEntity(_0x1f1a1c,_0x498e60){return function(_0xdf63ca){if(_0xdf63ca){return _0xdf63ca[_0x4d93('0x25')]()[_0x4d93('0x26')](function(){_0x1f1a1c[_0x4d93('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x54aa32,_0x47f185){return function(_0x228283){if(!_0x228283){_0x54aa32[_0x4d93('0x1b')](0x194);}return _0x228283;};}function handleError(_0x38e946,_0x18b85c){_0x18b85c=_0x18b85c||0x1f4;return function(_0x5b7f8c){logger['error'](_0x5b7f8c[_0x4d93('0x27')]);if(_0x5b7f8c['name']){delete _0x5b7f8c[_0x4d93('0x28')];}_0x38e946[_0x4d93('0x1c')](_0x18b85c)['send'](_0x5b7f8c);};}exports[_0x4d93('0x29')]=function(_0x52c526,_0x221efc){var _0x594752={},_0x4566d7={},_0x6d7575={'count':0x0,'rows':[]};var _0x53444e=_['map'](db[_0x4d93('0x2a')][_0x4d93('0x2b')],function(_0x38f421){return{'name':_0x38f421[_0x4d93('0x2c')],'type':_0x38f421['type'][_0x4d93('0x2d')]};});_0x4566d7[_0x4d93('0x2e')]=_[_0x4d93('0x2f')](_0x53444e,_0x4d93('0x28'));_0x4566d7['query']=_[_0x4d93('0x30')](_0x52c526['query']);_0x4566d7['filters']=_['intersection'](_0x4566d7['model'],_0x4566d7[_0x4d93('0x31')]);_0x594752[_0x4d93('0x32')]=_[_0x4d93('0x33')](_0x4566d7[_0x4d93('0x2e')],qs['fields'](_0x52c526[_0x4d93('0x31')][_0x4d93('0x34')]));_0x594752[_0x4d93('0x32')]=_0x594752[_0x4d93('0x32')][_0x4d93('0x35')]?_0x594752[_0x4d93('0x32')]:_0x4566d7[_0x4d93('0x2e')];if(!_0x52c526['query']['hasOwnProperty'](_0x4d93('0x36'))){_0x594752[_0x4d93('0x21')]=qs[_0x4d93('0x21')](_0x52c526[_0x4d93('0x31')][_0x4d93('0x21')]);_0x594752[_0x4d93('0x1f')]=qs[_0x4d93('0x1f')](_0x52c526['query'][_0x4d93('0x1f')]);}_0x594752[_0x4d93('0x37')]=qs[_0x4d93('0x38')](_0x52c526[_0x4d93('0x31')][_0x4d93('0x38')]);_0x594752[_0x4d93('0x39')]=qs[_0x4d93('0x3a')](_[_0x4d93('0x3b')](_0x52c526[_0x4d93('0x31')],_0x4566d7['filters']),_0x53444e);if(_0x52c526['query'][_0x4d93('0x3c')]){_0x594752[_0x4d93('0x39')]=_[_0x4d93('0x3d')](_0x594752[_0x4d93('0x39')],{'$or':_['map'](_0x53444e,function(_0x3d52b0){if(_0x3d52b0[_0x4d93('0x3e')]!==_0x4d93('0x3f')){var _0x4ccced={};_0x4ccced[_0x3d52b0['name']]={'$like':'%'+_0x52c526['query'][_0x4d93('0x3c')]+'%'};return _0x4ccced;}})});}_0x594752=_[_0x4d93('0x3d')]({},_0x594752,_0x52c526['options']);var _0x5e31a2={'where':_0x594752['where']};return db[_0x4d93('0x2a')][_0x4d93('0x22')](_0x5e31a2)[_0x4d93('0x26')](function(_0x9a1287){_0x6d7575[_0x4d93('0x22')]=_0x9a1287;if(_0x52c526[_0x4d93('0x31')][_0x4d93('0x40')]){_0x594752[_0x4d93('0x41')]=[{'all':!![]}];}return db[_0x4d93('0x2a')][_0x4d93('0x42')](_0x594752);})[_0x4d93('0x26')](function(_0x1aabba){_0x6d7575[_0x4d93('0x43')]=_0x1aabba;return _0x6d7575;})[_0x4d93('0x26')](respondWithFilteredResult(_0x221efc,_0x594752))['catch'](handleError(_0x221efc,null));};exports[_0x4d93('0x44')]=function(_0x263043,_0x284d1a){var _0x3eb8ba={'raw':!![],'where':{'id':_0x263043[_0x4d93('0x45')]['id']}},_0x20e126={};_0x20e126[_0x4d93('0x2e')]=_[_0x4d93('0x30')](db[_0x4d93('0x2a')][_0x4d93('0x2b')]);_0x20e126[_0x4d93('0x31')]=_[_0x4d93('0x30')](_0x263043[_0x4d93('0x31')]);_0x20e126[_0x4d93('0x3a')]=_['intersection'](_0x20e126[_0x4d93('0x2e')],_0x20e126['query']);_0x3eb8ba[_0x4d93('0x32')]=_[_0x4d93('0x33')](_0x20e126[_0x4d93('0x2e')],qs['fields'](_0x263043['query']['fields']));_0x3eb8ba[_0x4d93('0x32')]=_0x3eb8ba[_0x4d93('0x32')]['length']?_0x3eb8ba[_0x4d93('0x32')]:_0x20e126[_0x4d93('0x2e')];if(_0x263043[_0x4d93('0x31')][_0x4d93('0x40')]){_0x3eb8ba['include']=[{'all':!![]}];}_0x3eb8ba=_[_0x4d93('0x3d')]({},_0x3eb8ba,_0x263043[_0x4d93('0x46')]);return db[_0x4d93('0x2a')][_0x4d93('0x47')](_0x3eb8ba)[_0x4d93('0x26')](handleEntityNotFound(_0x284d1a,null))[_0x4d93('0x26')](respondWithResult(_0x284d1a,null))[_0x4d93('0x48')](handleError(_0x284d1a,null));};exports['create']=function(_0x469012,_0x3acd04){return db[_0x4d93('0x2a')][_0x4d93('0x49')](_0x469012[_0x4d93('0x4a')],{})['then'](respondWithResult(_0x3acd04,0xc9))[_0x4d93('0x48')](handleError(_0x3acd04,null));};exports[_0x4d93('0x4b')]=function(_0x4e0b25,_0x39c817){if(_0x4e0b25[_0x4d93('0x4a')]['id']){delete _0x4e0b25[_0x4d93('0x4a')]['id'];}return db['OpenchannelQueueReport']['find']({'where':{'id':_0x4e0b25[_0x4d93('0x45')]['id']}})[_0x4d93('0x26')](handleEntityNotFound(_0x39c817,null))[_0x4d93('0x26')](saveUpdates(_0x4e0b25[_0x4d93('0x4a')],null))[_0x4d93('0x26')](respondWithResult(_0x39c817,null))[_0x4d93('0x48')](handleError(_0x39c817,null));};exports[_0x4d93('0x25')]=function(_0x1a4d19,_0x345541){return db['OpenchannelQueueReport'][_0x4d93('0x47')]({'where':{'id':_0x1a4d19['params']['id']}})[_0x4d93('0x26')](handleEntityNotFound(_0x345541,null))[_0x4d93('0x26')](removeEntity(_0x345541,null))[_0x4d93('0x48')](handleError(_0x345541,null));};exports[_0x4d93('0x4c')]=function(_0x2b1e49,_0x5340c2){return db['OpenchannelQueueReport'][_0x4d93('0x4c')]()[_0x4d93('0x26')](respondWithResult(_0x5340c2,null))[_0x4d93('0x48')](handleError(_0x5340c2,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.model.js b/server/api/openchannelQueueReport/openchannelQueueReport.model.js index 2fd484a..ecef9a5 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(_0x45e98b,_0x253401){var _0x256d79=function(_0x374ccd){while(--_0x374ccd){_0x45e98b['push'](_0x45e98b['shift']());}};_0x256d79(++_0x253401);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x422905,_0x3bce3a){_0x422905=_0x422905-0x0;var _0x33dc6c=_0xc4aa[_0x422905];return _0x33dc6c;};'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 _0xe14b=['bluebird','path','./openchannelQueueReport.attributes','exports','define','OpenchannelQueueReport','report_openchannel_queue','lodash','util','moment'];(function(_0x586770,_0xd04ca3){var _0x5ea8d9=function(_0x76ff68){while(--_0x76ff68){_0x586770['push'](_0x586770['shift']());}};_0x5ea8d9(++_0xd04ca3);}(_0xe14b,0x93));var _0xbe14=function(_0x39eded,_0x271602){_0x39eded=_0x39eded-0x0;var _0x3838ef=_0xe14b[_0x39eded];return _0x3838ef;};'use strict';var _=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xbe14('0x2'));var BPromise=require(_0xbe14('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbe14('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xbe14('0x5'));module[_0xbe14('0x6')]=function(_0x1fe204,_0x1ff100){return _0x1fe204[_0xbe14('0x7')](_0xbe14('0x8'),attributes,{'tableName':_0xbe14('0x9'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js b/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js index 0d4b082..f6bf397 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 _0x6b20=['util','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','OpenchannelQueueReport,\x20%s,\x20%s','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','info','result','CreateOpenchannelQueueReport','OpenchannelQueueReport','create','options','raw','then','stringify','catch','UpdateOpenchannelQueueReport','update','body','where','attributes','limit','debug','lodash'];(function(_0x30c7b1,_0x3b7400){var _0x1d0240=function(_0x4f0eba){while(--_0x4f0eba){_0x30c7b1['push'](_0x30c7b1['shift']());}};_0x1d0240(++_0x3b7400);}(_0x6b20,0xd1));var _0x06b2=function(_0x4bf59e,_0x58a355){_0x4bf59e=_0x4bf59e-0x0;var _0x179f71=_0x6b20[_0x4bf59e];return _0x179f71;};'use strict';var _=require(_0x06b2('0x0'));var util=require(_0x06b2('0x1'));var moment=require('moment');var BPromise=require(_0x06b2('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x06b2('0x3'));var db=require(_0x06b2('0x4'))['db'];var utils=require(_0x06b2('0x5'));var logger=require('../../config/logger')(_0x06b2('0x6'));var config=require(_0x06b2('0x7'));var jayson=require(_0x06b2('0x8'));var client=jayson[_0x06b2('0x9')][_0x06b2('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x37b825,_0x26a325,_0x4e6d3b){return new BPromise(function(_0x21cd31,_0x1828e4){return client[_0x06b2('0xb')](_0x37b825,_0x4e6d3b)['then'](function(_0x37ace0){logger['info'](_0x06b2('0xc'),_0x26a325,'request\x20sent');logger['debug'](_0x06b2('0xd'),_0x26a325,_0x06b2('0xe'),JSON['stringify'](_0x37ace0));if(_0x37ace0[_0x06b2('0xf')]){if(_0x37ace0[_0x06b2('0xf')][_0x06b2('0x10')]===0x1f4){logger[_0x06b2('0xf')](_0x06b2('0xc'),_0x26a325,_0x37ace0[_0x06b2('0xf')][_0x06b2('0x11')]);return _0x1828e4(_0x37ace0[_0x06b2('0xf')][_0x06b2('0x11')]);}logger[_0x06b2('0xf')](_0x06b2('0xc'),_0x26a325,_0x37ace0[_0x06b2('0xf')][_0x06b2('0x11')]);return _0x21cd31(_0x37ace0['error'][_0x06b2('0x11')]);}else{logger[_0x06b2('0x12')](_0x06b2('0xc'),_0x26a325,_0x06b2('0xe'));_0x21cd31(_0x37ace0[_0x06b2('0x13')][_0x06b2('0x11')]);}})['catch'](function(_0x17e69b){logger[_0x06b2('0xf')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x26a325,_0x17e69b);_0x1828e4(_0x17e69b);});});}exports[_0x06b2('0x14')]=function(_0x594b48){var _0x4c9cae=this;return new Promise(function(_0x192270,_0x1b4ab0){return db[_0x06b2('0x15')][_0x06b2('0x16')](_0x594b48['body'],{'raw':_0x594b48[_0x06b2('0x17')]?_0x594b48[_0x06b2('0x17')][_0x06b2('0x18')]===undefined?!![]:![]:!![]})[_0x06b2('0x19')](function(_0xe28985){logger[_0x06b2('0x12')](_0x06b2('0x14'),_0x594b48);logger['debug'](_0x06b2('0x14'),_0x594b48,JSON[_0x06b2('0x1a')](_0xe28985));_0x192270(_0xe28985);})[_0x06b2('0x1b')](function(_0x208384){logger['error']('CreateOpenchannelQueueReport',_0x208384[_0x06b2('0x11')],_0x594b48);_0x1b4ab0(_0x4c9cae[_0x06b2('0xf')](0x1f4,_0x208384['message']));});});};exports[_0x06b2('0x1c')]=function(_0x5e40f2){var _0x3d58c6=this;return new Promise(function(_0x38987b,_0x2a0645){return db['OpenchannelQueueReport'][_0x06b2('0x1d')](_0x5e40f2[_0x06b2('0x1e')],{'raw':_0x5e40f2[_0x06b2('0x17')]?_0x5e40f2[_0x06b2('0x17')][_0x06b2('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5e40f2['options']?_0x5e40f2[_0x06b2('0x17')][_0x06b2('0x1f')]||null:null,'attributes':_0x5e40f2[_0x06b2('0x17')]?_0x5e40f2[_0x06b2('0x17')][_0x06b2('0x20')]||null:null,'limit':_0x5e40f2[_0x06b2('0x17')]?_0x5e40f2['options'][_0x06b2('0x21')]||null:null})[_0x06b2('0x19')](function(_0x2720fa){logger[_0x06b2('0x12')](_0x06b2('0x1c'),_0x5e40f2);logger[_0x06b2('0x22')](_0x06b2('0x1c'),_0x5e40f2,JSON['stringify'](_0x2720fa));_0x38987b(_0x2720fa);})[_0x06b2('0x1b')](function(_0x32eeea){logger[_0x06b2('0xf')](_0x06b2('0x1c'),_0x32eeea[_0x06b2('0x11')],_0x5e40f2);_0x2a0645(_0x3d58c6[_0x06b2('0xf')](0x1f4,_0x32eeea[_0x06b2('0x11')]));});});}; \ No newline at end of file +var _0xdac7=['client','http','request','then','info','OpenchannelQueueReport,\x20%s,\x20%s','request\x20sent','debug','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','CreateOpenchannelQueueReport','OpenchannelQueueReport','create','body','options','raw','update','attributes','limit','UpdateOpenchannelQueueReport','lodash','util','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x587a45,_0xd5643d){var _0x5af613=function(_0x32c874){while(--_0x32c874){_0x587a45['push'](_0x587a45['shift']());}};_0x5af613(++_0xd5643d);}(_0xdac7,0x180));var _0x7dac=function(_0x5488cf,_0x35dd2d){_0x5488cf=_0x5488cf-0x0;var _0x857d32=_0xdac7[_0x5488cf];return _0x857d32;};'use strict';var _=require(_0x7dac('0x0'));var util=require(_0x7dac('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7dac('0x2'));var db=require(_0x7dac('0x3'))['db'];var utils=require(_0x7dac('0x4'));var logger=require(_0x7dac('0x5'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x7dac('0x6')][_0x7dac('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x505705,_0x28cc84,_0x53c460){return new BPromise(function(_0x3b319f,_0x5ccf75){return client[_0x7dac('0x8')](_0x505705,_0x53c460)[_0x7dac('0x9')](function(_0x45fbdc){logger[_0x7dac('0xa')](_0x7dac('0xb'),_0x28cc84,_0x7dac('0xc'));logger[_0x7dac('0xd')](_0x7dac('0xe'),_0x28cc84,_0x7dac('0xc'),JSON[_0x7dac('0xf')](_0x45fbdc));if(_0x45fbdc['error']){if(_0x45fbdc['error']['code']===0x1f4){logger[_0x7dac('0x10')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x28cc84,_0x45fbdc[_0x7dac('0x10')]['message']);return _0x5ccf75(_0x45fbdc[_0x7dac('0x10')][_0x7dac('0x11')]);}logger[_0x7dac('0x10')](_0x7dac('0xb'),_0x28cc84,_0x45fbdc[_0x7dac('0x10')][_0x7dac('0x11')]);return _0x3b319f(_0x45fbdc[_0x7dac('0x10')]['message']);}else{logger[_0x7dac('0xa')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x28cc84,'request\x20sent');_0x3b319f(_0x45fbdc[_0x7dac('0x12')][_0x7dac('0x11')]);}})[_0x7dac('0x13')](function(_0x2de4ea){logger[_0x7dac('0x10')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x28cc84,_0x2de4ea);_0x5ccf75(_0x2de4ea);});});}exports[_0x7dac('0x14')]=function(_0x4c1f4f){var _0x352a77=this;return new Promise(function(_0x4639e2,_0x313615){return db[_0x7dac('0x15')][_0x7dac('0x16')](_0x4c1f4f[_0x7dac('0x17')],{'raw':_0x4c1f4f[_0x7dac('0x18')]?_0x4c1f4f[_0x7dac('0x18')][_0x7dac('0x19')]===undefined?!![]:![]:!![]})[_0x7dac('0x9')](function(_0x18f993){logger[_0x7dac('0xa')](_0x7dac('0x14'),_0x4c1f4f);logger[_0x7dac('0xd')]('CreateOpenchannelQueueReport',_0x4c1f4f,JSON['stringify'](_0x18f993));_0x4639e2(_0x18f993);})[_0x7dac('0x13')](function(_0x4c9fda){logger[_0x7dac('0x10')](_0x7dac('0x14'),_0x4c9fda['message'],_0x4c1f4f);_0x313615(_0x352a77[_0x7dac('0x10')](0x1f4,_0x4c9fda[_0x7dac('0x11')]));});});};exports['UpdateOpenchannelQueueReport']=function(_0xbdabba){var _0x41b3cd=this;return new Promise(function(_0x341cc8,_0x179881){return db[_0x7dac('0x15')][_0x7dac('0x1a')](_0xbdabba[_0x7dac('0x17')],{'raw':_0xbdabba['options']?_0xbdabba[_0x7dac('0x18')][_0x7dac('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xbdabba[_0x7dac('0x18')]?_0xbdabba['options']['where']||null:null,'attributes':_0xbdabba[_0x7dac('0x18')]?_0xbdabba[_0x7dac('0x18')][_0x7dac('0x1b')]||null:null,'limit':_0xbdabba[_0x7dac('0x18')]?_0xbdabba[_0x7dac('0x18')][_0x7dac('0x1c')]||null:null})[_0x7dac('0x9')](function(_0x31bbf7){logger[_0x7dac('0xa')](_0x7dac('0x1d'),_0xbdabba);logger[_0x7dac('0xd')]('UpdateOpenchannelQueueReport',_0xbdabba,JSON['stringify'](_0x31bbf7));_0x341cc8(_0x31bbf7);})[_0x7dac('0x13')](function(_0xa92c4b){logger[_0x7dac('0x10')]('UpdateOpenchannelQueueReport',_0xa92c4b[_0x7dac('0x11')],_0xbdabba);_0x179881(_0x41b3cd[_0x7dac('0x10')](0x1f4,_0xa92c4b[_0x7dac('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/index.js b/server/api/openchannelTransferReport/index.js index 5b2342e..c744e21 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 _0x5fcb=['./openchannelTransferReport.controller','get','isAuthenticated','/describe','describe','/:id','show','create','put','update','delete','destroy','exports','multer','util','express','Router','fs-extra','../../components/interaction/service','../../config/environment'];(function(_0x435150,_0x591cd9){var _0x13b3a4=function(_0x44eb28){while(--_0x44eb28){_0x435150['push'](_0x435150['shift']());}};_0x13b3a4(++_0x591cd9);}(_0x5fcb,0x1d9));var _0xb5fc=function(_0x3e5bd8,_0xccabb3){_0x3e5bd8=_0x3e5bd8-0x0;var _0x451883=_0x5fcb[_0x3e5bd8];return _0x451883;};'use strict';var multer=require(_0xb5fc('0x0'));var util=require(_0xb5fc('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xb5fc('0x2'));var router=express[_0xb5fc('0x3')]();var fs_extra=require(_0xb5fc('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xb5fc('0x5'));var config=require(_0xb5fc('0x6'));var controller=require(_0xb5fc('0x7'));router[_0xb5fc('0x8')]('/',auth[_0xb5fc('0x9')](),controller['index']);router[_0xb5fc('0x8')](_0xb5fc('0xa'),auth[_0xb5fc('0x9')](),controller[_0xb5fc('0xb')]);router[_0xb5fc('0x8')](_0xb5fc('0xc'),auth[_0xb5fc('0x9')](),controller[_0xb5fc('0xd')]);router['post']('/',auth[_0xb5fc('0x9')](),controller[_0xb5fc('0xe')]);router[_0xb5fc('0xf')](_0xb5fc('0xc'),auth[_0xb5fc('0x9')](),controller[_0xb5fc('0x10')]);router[_0xb5fc('0x11')](_0xb5fc('0xc'),auth[_0xb5fc('0x9')](),controller[_0xb5fc('0x12')]);module[_0xb5fc('0x13')]=router; \ No newline at end of file +var _0x76a6=['index','get','/describe','isAuthenticated','describe','/:id','show','post','put','update','delete','destroy','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment'];(function(_0x5088cd,_0x16c24a){var _0x54ce22=function(_0x247351){while(--_0x247351){_0x5088cd['push'](_0x5088cd['shift']());}};_0x54ce22(++_0x16c24a);}(_0x76a6,0x1ae));var _0x676a=function(_0xf97eb0,_0x1578b7){_0xf97eb0=_0xf97eb0-0x0;var _0xea70f4=_0x76a6[_0xf97eb0];return _0xea70f4;};'use strict';var multer=require('multer');var util=require(_0x676a('0x0'));var path=require(_0x676a('0x1'));var timeout=require(_0x676a('0x2'));var express=require(_0x676a('0x3'));var router=express['Router']();var fs_extra=require(_0x676a('0x4'));var auth=require(_0x676a('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x676a('0x6'));var controller=require('./openchannelTransferReport.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x676a('0x7')]);router[_0x676a('0x8')](_0x676a('0x9'),auth[_0x676a('0xa')](),controller[_0x676a('0xb')]);router['get'](_0x676a('0xc'),auth[_0x676a('0xa')](),controller[_0x676a('0xd')]);router[_0x676a('0xe')]('/',auth[_0x676a('0xa')](),controller['create']);router[_0x676a('0xf')]('/:id',auth[_0x676a('0xa')](),controller[_0x676a('0x10')]);router[_0x676a('0x11')]('/:id',auth[_0x676a('0xa')](),controller[_0x676a('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js b/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js index 482605d..97fe011 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 _0xf3cd=['exports','STRING','ENUM','account','queue','DATE','moment','sequelize'];(function(_0xa73a57,_0x2aa18d){var _0x583faa=function(_0x5ab895){while(--_0x5ab895){_0xa73a57['push'](_0xa73a57['shift']());}};_0x583faa(++_0x2aa18d);}(_0xf3cd,0xfe));var _0xdf3c=function(_0xc80b2b,_0x5a12e9){_0xc80b2b=_0xc80b2b-0x0;var _0x22af6f=_0xf3cd[_0xc80b2b];return _0x22af6f;};'use strict';var moment=require(_0xdf3c('0x0'));var Sequelize=require(_0xdf3c('0x1'));module[_0xdf3c('0x2')]={'uniqueid':{'type':Sequelize[_0xdf3c('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xdf3c('0x4')](_0xdf3c('0x5'),'agent',_0xdf3c('0x6')),'allowNull':![],'defaultValue':_0xdf3c('0x6')},'transferredAt':{'type':Sequelize[_0xdf3c('0x7')],'allowNull':![],'defaultValue':Sequelize['NOW']}}; \ No newline at end of file +var _0xb43b=['DATE','NOW','moment','sequelize','STRING','ENUM','account','queue'];(function(_0x350aeb,_0x3d265a){var _0x3c5273=function(_0x32b417){while(--_0x32b417){_0x350aeb['push'](_0x350aeb['shift']());}};_0x3c5273(++_0x3d265a);}(_0xb43b,0x1b2));var _0xbb43=function(_0x31d739,_0x476a2e){_0x31d739=_0x31d739-0x0;var _0x3ffdab=_0xb43b[_0x31d739];return _0x3ffdab;};'use strict';var moment=require(_0xbb43('0x0'));var Sequelize=require(_0xbb43('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0xbb43('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xbb43('0x3')](_0xbb43('0x4'),'agent',_0xbb43('0x5')),'allowNull':![],'defaultValue':_0xbb43('0x5')},'transferredAt':{'type':Sequelize[_0xbb43('0x6')],'allowNull':![],'defaultValue':Sequelize[_0xbb43('0x7')]}}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.controller.js b/server/api/openchannelTransferReport/openchannelTransferReport.controller.js index 70fd109..2a58f00 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 _0xf1a3=['limit','count','set','Content-Range','apply','reject','update','then','error','stack','name','index','map','rawAttributes','fieldName','type','model','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','order','sort','where','pick','VIRTUAL','filter','merge','includeAll','include','OpenchannelTransferReport','findAll','rows','show','params','options','find','catch','create','body','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset'];(function(_0x14a7b7,_0x12f84a){var _0x18a423=function(_0x2b1932){while(--_0x2b1932){_0x14a7b7['push'](_0x14a7b7['shift']());}};_0x18a423(++_0x12f84a);}(_0xf1a3,0x118));var _0x3f1a=function(_0x9d639c,_0x524dbe){_0x9d639c=_0x9d639c-0x0;var _0x1671de=_0xf1a3[_0x9d639c];return _0x1671de;};'use strict';var emlformat=require(_0x3f1a('0x0'));var rimraf=require(_0x3f1a('0x1'));var zipdir=require(_0x3f1a('0x2'));var jsonpatch=require(_0x3f1a('0x3'));var rp=require(_0x3f1a('0x4'));var moment=require(_0x3f1a('0x5'));var BPromise=require(_0x3f1a('0x6'));var Mustache=require(_0x3f1a('0x7'));var util=require(_0x3f1a('0x8'));var path=require('path');var sox=require(_0x3f1a('0x9'));var csv=require(_0x3f1a('0xa'));var ejs=require(_0x3f1a('0xb'));var fs=require('fs');var fs_extra=require(_0x3f1a('0xc'));var _=require('lodash');var squel=require(_0x3f1a('0xd'));var crypto=require(_0x3f1a('0xe'));var jsforce=require(_0x3f1a('0xf'));var deskjs=require(_0x3f1a('0x10'));var toCsv=require(_0x3f1a('0xa'));var querystring=require(_0x3f1a('0x11'));var Papa=require(_0x3f1a('0x12'));var Redis=require(_0x3f1a('0x13'));var authService=require(_0x3f1a('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0x3f1a('0x15'));var hardwareService=require(_0x3f1a('0x16'));var logger=require('../../config/logger')(_0x3f1a('0x17'));var utils=require('../../config/utils');var config=require(_0x3f1a('0x18'));var licenseUtil=require(_0x3f1a('0x19'));var db=require(_0x3f1a('0x1a'))['db'];function respondWithStatusCode(_0x1bb806,_0x911980){_0x911980=_0x911980||0xcc;return function(_0x36648c){if(_0x36648c){return _0x1bb806[_0x3f1a('0x1b')](_0x911980);}return _0x1bb806[_0x3f1a('0x1c')](_0x911980)[_0x3f1a('0x1d')]();};}function respondWithResult(_0x323a7c,_0x4638a2){_0x4638a2=_0x4638a2||0xc8;return function(_0x41f386){if(_0x41f386){return _0x323a7c[_0x3f1a('0x1c')](_0x4638a2)[_0x3f1a('0x1e')](_0x41f386);}};}function respondWithFilteredResult(_0x1f7666,_0x37d882){return function(_0x54d228){if(_0x54d228){var _0x410dcf=typeof _0x37d882[_0x3f1a('0x1f')]==='undefined'&&typeof _0x37d882[_0x3f1a('0x20')]==='undefined';var _0x27fd9f=_0x54d228[_0x3f1a('0x21')];var _0x280b85=_0x410dcf?0x0:_0x37d882['offset'];var _0x2d2693=_0x410dcf?_0x54d228[_0x3f1a('0x21')]:_0x37d882[_0x3f1a('0x1f')]+_0x37d882[_0x3f1a('0x20')];var _0x29fba3;if(_0x2d2693>=_0x27fd9f){_0x2d2693=_0x27fd9f;_0x29fba3=0xc8;}else{_0x29fba3=0xce;}_0x1f7666[_0x3f1a('0x1c')](_0x29fba3);return _0x1f7666[_0x3f1a('0x22')](_0x3f1a('0x23'),_0x280b85+'-'+_0x2d2693+'/'+_0x27fd9f)[_0x3f1a('0x1e')](_0x54d228);}return null;};}function patchUpdates(_0xe3f2f2){return function(_0x2e6004){try{jsonpatch[_0x3f1a('0x24')](_0x2e6004,_0xe3f2f2,!![]);}catch(_0x4ab027){return BPromise[_0x3f1a('0x25')](_0x4ab027);}return _0x2e6004['save']();};}function saveUpdates(_0x80989,_0x3713cf){return function(_0x314ec5){if(_0x314ec5){return _0x314ec5[_0x3f1a('0x26')](_0x80989)[_0x3f1a('0x27')](function(_0x25ff99){return _0x25ff99;});}return null;};}function removeEntity(_0x22eb73,_0x2c9cd5){return function(_0x1fcab5){if(_0x1fcab5){return _0x1fcab5['destroy']()[_0x3f1a('0x27')](function(){_0x22eb73[_0x3f1a('0x1c')](0xcc)[_0x3f1a('0x1d')]();});}};}function handleEntityNotFound(_0x5c91d2,_0x33d0d5){return function(_0x2b5ca9){if(!_0x2b5ca9){_0x5c91d2[_0x3f1a('0x1b')](0x194);}return _0x2b5ca9;};}function handleError(_0x791de7,_0x1f5e4e){_0x1f5e4e=_0x1f5e4e||0x1f4;return function(_0x417ac0){logger[_0x3f1a('0x28')](_0x417ac0[_0x3f1a('0x29')]);if(_0x417ac0[_0x3f1a('0x2a')]){delete _0x417ac0[_0x3f1a('0x2a')];}_0x791de7[_0x3f1a('0x1c')](_0x1f5e4e)['send'](_0x417ac0);};}exports[_0x3f1a('0x2b')]=function(_0x2351ac,_0x1d54b2){var _0x452d74={},_0x85af30={},_0x4f4c2c={'count':0x0,'rows':[]};var _0x12f2be=_[_0x3f1a('0x2c')](db['OpenchannelTransferReport'][_0x3f1a('0x2d')],function(_0x254237){return{'name':_0x254237[_0x3f1a('0x2e')],'type':_0x254237[_0x3f1a('0x2f')]['key']};});_0x85af30[_0x3f1a('0x30')]=_['map'](_0x12f2be,_0x3f1a('0x2a'));_0x85af30['query']=_[_0x3f1a('0x31')](_0x2351ac['query']);_0x85af30[_0x3f1a('0x32')]=_[_0x3f1a('0x33')](_0x85af30[_0x3f1a('0x30')],_0x85af30[_0x3f1a('0x34')]);_0x452d74[_0x3f1a('0x35')]=_['intersection'](_0x85af30[_0x3f1a('0x30')],qs[_0x3f1a('0x36')](_0x2351ac['query'][_0x3f1a('0x36')]));_0x452d74[_0x3f1a('0x35')]=_0x452d74[_0x3f1a('0x35')][_0x3f1a('0x37')]?_0x452d74[_0x3f1a('0x35')]:_0x85af30[_0x3f1a('0x30')];if(!_0x2351ac['query'][_0x3f1a('0x38')]('nolimit')){_0x452d74[_0x3f1a('0x20')]=qs['limit'](_0x2351ac[_0x3f1a('0x34')][_0x3f1a('0x20')]);_0x452d74['offset']=qs[_0x3f1a('0x1f')](_0x2351ac[_0x3f1a('0x34')]['offset']);}_0x452d74[_0x3f1a('0x39')]=qs[_0x3f1a('0x3a')](_0x2351ac[_0x3f1a('0x34')][_0x3f1a('0x3a')]);_0x452d74[_0x3f1a('0x3b')]=qs[_0x3f1a('0x32')](_[_0x3f1a('0x3c')](_0x2351ac[_0x3f1a('0x34')],_0x85af30[_0x3f1a('0x32')]),_0x12f2be);if(_0x2351ac[_0x3f1a('0x34')]['filter']){_0x452d74['where']=_['merge'](_0x452d74[_0x3f1a('0x3b')],{'$or':_[_0x3f1a('0x2c')](_0x12f2be,function(_0x196507){if(_0x196507[_0x3f1a('0x2f')]!==_0x3f1a('0x3d')){var _0x41076c={};_0x41076c[_0x196507[_0x3f1a('0x2a')]]={'$like':'%'+_0x2351ac[_0x3f1a('0x34')][_0x3f1a('0x3e')]+'%'};return _0x41076c;}})});}_0x452d74=_[_0x3f1a('0x3f')]({},_0x452d74,_0x2351ac['options']);var _0x4686b2={'where':_0x452d74[_0x3f1a('0x3b')]};return db['OpenchannelTransferReport']['count'](_0x4686b2)[_0x3f1a('0x27')](function(_0x11fd27){_0x4f4c2c[_0x3f1a('0x21')]=_0x11fd27;if(_0x2351ac[_0x3f1a('0x34')][_0x3f1a('0x40')]){_0x452d74[_0x3f1a('0x41')]=[{'all':!![]}];}return db[_0x3f1a('0x42')][_0x3f1a('0x43')](_0x452d74);})[_0x3f1a('0x27')](function(_0x321abf){_0x4f4c2c[_0x3f1a('0x44')]=_0x321abf;return _0x4f4c2c;})['then'](respondWithFilteredResult(_0x1d54b2,_0x452d74))['catch'](handleError(_0x1d54b2,null));};exports[_0x3f1a('0x45')]=function(_0x36a4f6,_0x5c9230){var _0x4cd5ef={'raw':!![],'where':{'id':_0x36a4f6[_0x3f1a('0x46')]['id']}},_0x523d72={};_0x523d72[_0x3f1a('0x30')]=_[_0x3f1a('0x31')](db[_0x3f1a('0x42')][_0x3f1a('0x2d')]);_0x523d72[_0x3f1a('0x34')]=_[_0x3f1a('0x31')](_0x36a4f6[_0x3f1a('0x34')]);_0x523d72[_0x3f1a('0x32')]=_[_0x3f1a('0x33')](_0x523d72['model'],_0x523d72[_0x3f1a('0x34')]);_0x4cd5ef[_0x3f1a('0x35')]=_['intersection'](_0x523d72[_0x3f1a('0x30')],qs[_0x3f1a('0x36')](_0x36a4f6[_0x3f1a('0x34')][_0x3f1a('0x36')]));_0x4cd5ef['attributes']=_0x4cd5ef[_0x3f1a('0x35')][_0x3f1a('0x37')]?_0x4cd5ef[_0x3f1a('0x35')]:_0x523d72[_0x3f1a('0x30')];if(_0x36a4f6[_0x3f1a('0x34')][_0x3f1a('0x40')]){_0x4cd5ef[_0x3f1a('0x41')]=[{'all':!![]}];}_0x4cd5ef=_[_0x3f1a('0x3f')]({},_0x4cd5ef,_0x36a4f6[_0x3f1a('0x47')]);return db['OpenchannelTransferReport'][_0x3f1a('0x48')](_0x4cd5ef)['then'](handleEntityNotFound(_0x5c9230,null))['then'](respondWithResult(_0x5c9230,null))[_0x3f1a('0x49')](handleError(_0x5c9230,null));};exports[_0x3f1a('0x4a')]=function(_0x1887db,_0x55d731){return db['OpenchannelTransferReport'][_0x3f1a('0x4a')](_0x1887db[_0x3f1a('0x4b')],{})[_0x3f1a('0x27')](respondWithResult(_0x55d731,0xc9))[_0x3f1a('0x49')](handleError(_0x55d731,null));};exports['update']=function(_0x1bc558,_0x556d00){if(_0x1bc558[_0x3f1a('0x4b')]['id']){delete _0x1bc558[_0x3f1a('0x4b')]['id'];}return db[_0x3f1a('0x42')][_0x3f1a('0x48')]({'where':{'id':_0x1bc558['params']['id']}})[_0x3f1a('0x27')](handleEntityNotFound(_0x556d00,null))[_0x3f1a('0x27')](saveUpdates(_0x1bc558['body'],null))[_0x3f1a('0x27')](respondWithResult(_0x556d00,null))['catch'](handleError(_0x556d00,null));};exports[_0x3f1a('0x4c')]=function(_0x299bf9,_0x4e210a){return db['OpenchannelTransferReport'][_0x3f1a('0x48')]({'where':{'id':_0x299bf9[_0x3f1a('0x46')]['id']}})[_0x3f1a('0x27')](handleEntityNotFound(_0x4e210a,null))['then'](removeEntity(_0x4e210a,null))[_0x3f1a('0x49')](handleError(_0x4e210a,null));};exports[_0x3f1a('0x4d')]=function(_0x109414,_0x567daa){return db[_0x3f1a('0x42')][_0x3f1a('0x4d')]()[_0x3f1a('0x27')](respondWithResult(_0x567daa,null))[_0x3f1a('0x49')](handleError(_0x567daa,null));}; \ No newline at end of file +var _0xc2b6=['Content-Range','reject','save','then','destroy','sendStatus','error','stack','name','send','index','map','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','filter','merge','where','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','OpenchannelTransferReport','find','create','body','describe','rimraf','fast-json-patch','request-promise','moment','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/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set'];(function(_0x2be2c7,_0x32900e){var _0x4cc9a7=function(_0x2a3c37){while(--_0x2a3c37){_0x2be2c7['push'](_0x2be2c7['shift']());}};_0x4cc9a7(++_0x32900e);}(_0xc2b6,0x113));var _0x6c2b=function(_0x35d4e9,_0x298c61){_0x35d4e9=_0x35d4e9-0x0;var _0x5c2770=_0xc2b6[_0x35d4e9];return _0x5c2770;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6c2b('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6c2b('0x1'));var rp=require(_0x6c2b('0x2'));var moment=require(_0x6c2b('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x6c2b('0x4'));var util=require(_0x6c2b('0x5'));var path=require(_0x6c2b('0x6'));var sox=require('sox');var csv=require(_0x6c2b('0x7'));var ejs=require(_0x6c2b('0x8'));var fs=require('fs');var fs_extra=require(_0x6c2b('0x9'));var _=require('lodash');var squel=require(_0x6c2b('0xa'));var crypto=require(_0x6c2b('0xb'));var jsforce=require(_0x6c2b('0xc'));var deskjs=require(_0x6c2b('0xd'));var toCsv=require(_0x6c2b('0x7'));var querystring=require(_0x6c2b('0xe'));var Papa=require(_0x6c2b('0xf'));var Redis=require('ioredis');var authService=require(_0x6c2b('0x10'));var qs=require(_0x6c2b('0x11'));var as=require(_0x6c2b('0x12'));var hardwareService=require(_0x6c2b('0x13'));var logger=require(_0x6c2b('0x14'))(_0x6c2b('0x15'));var utils=require('../../config/utils');var config=require(_0x6c2b('0x16'));var licenseUtil=require(_0x6c2b('0x17'));var db=require(_0x6c2b('0x18'))['db'];function respondWithStatusCode(_0x4fb5f5,_0x1b303d){_0x1b303d=_0x1b303d||0xcc;return function(_0x25e136){if(_0x25e136){return _0x4fb5f5['sendStatus'](_0x1b303d);}return _0x4fb5f5[_0x6c2b('0x19')](_0x1b303d)[_0x6c2b('0x1a')]();};}function respondWithResult(_0x4dad7e,_0x1228f2){_0x1228f2=_0x1228f2||0xc8;return function(_0x46630b){if(_0x46630b){return _0x4dad7e[_0x6c2b('0x19')](_0x1228f2)[_0x6c2b('0x1b')](_0x46630b);}};}function respondWithFilteredResult(_0x1e883f,_0x3d5e9c){return function(_0x57e0a4){if(_0x57e0a4){var _0x40797b=typeof _0x3d5e9c[_0x6c2b('0x1c')]===_0x6c2b('0x1d')&&typeof _0x3d5e9c[_0x6c2b('0x1e')]===_0x6c2b('0x1d');var _0x302cca=_0x57e0a4[_0x6c2b('0x1f')];var _0x4123d9=_0x40797b?0x0:_0x3d5e9c[_0x6c2b('0x1c')];var _0x5aea0c=_0x40797b?_0x57e0a4['count']:_0x3d5e9c['offset']+_0x3d5e9c[_0x6c2b('0x1e')];var _0x4c241b;if(_0x5aea0c>=_0x302cca){_0x5aea0c=_0x302cca;_0x4c241b=0xc8;}else{_0x4c241b=0xce;}_0x1e883f[_0x6c2b('0x19')](_0x4c241b);return _0x1e883f[_0x6c2b('0x20')](_0x6c2b('0x21'),_0x4123d9+'-'+_0x5aea0c+'/'+_0x302cca)['json'](_0x57e0a4);}return null;};}function patchUpdates(_0x3cc845){return function(_0x81154d){try{jsonpatch['apply'](_0x81154d,_0x3cc845,!![]);}catch(_0x491c13){return BPromise[_0x6c2b('0x22')](_0x491c13);}return _0x81154d[_0x6c2b('0x23')]();};}function saveUpdates(_0x472588,_0x7d90b7){return function(_0x34fd60){if(_0x34fd60){return _0x34fd60['update'](_0x472588)[_0x6c2b('0x24')](function(_0x2c93e2){return _0x2c93e2;});}return null;};}function removeEntity(_0xe04635,_0x3a53c8){return function(_0x3c8acc){if(_0x3c8acc){return _0x3c8acc[_0x6c2b('0x25')]()[_0x6c2b('0x24')](function(){_0xe04635[_0x6c2b('0x19')](0xcc)[_0x6c2b('0x1a')]();});}};}function handleEntityNotFound(_0x9f1b60,_0x30aec6){return function(_0x5ba795){if(!_0x5ba795){_0x9f1b60[_0x6c2b('0x26')](0x194);}return _0x5ba795;};}function handleError(_0x2bb383,_0x35e164){_0x35e164=_0x35e164||0x1f4;return function(_0x3d945a){logger[_0x6c2b('0x27')](_0x3d945a[_0x6c2b('0x28')]);if(_0x3d945a['name']){delete _0x3d945a[_0x6c2b('0x29')];}_0x2bb383[_0x6c2b('0x19')](_0x35e164)[_0x6c2b('0x2a')](_0x3d945a);};}exports[_0x6c2b('0x2b')]=function(_0x2f20d1,_0x441c2a){var _0x5c9362={},_0x8de0ae={},_0x204988={'count':0x0,'rows':[]};var _0x1d9d20=_[_0x6c2b('0x2c')](db['OpenchannelTransferReport'][_0x6c2b('0x2d')],function(_0x149e08){return{'name':_0x149e08[_0x6c2b('0x2e')],'type':_0x149e08['type'][_0x6c2b('0x2f')]};});_0x8de0ae[_0x6c2b('0x30')]=_[_0x6c2b('0x2c')](_0x1d9d20,_0x6c2b('0x29'));_0x8de0ae[_0x6c2b('0x31')]=_[_0x6c2b('0x32')](_0x2f20d1[_0x6c2b('0x31')]);_0x8de0ae[_0x6c2b('0x33')]=_[_0x6c2b('0x34')](_0x8de0ae['model'],_0x8de0ae[_0x6c2b('0x31')]);_0x5c9362[_0x6c2b('0x35')]=_[_0x6c2b('0x34')](_0x8de0ae['model'],qs[_0x6c2b('0x36')](_0x2f20d1[_0x6c2b('0x31')][_0x6c2b('0x36')]));_0x5c9362[_0x6c2b('0x35')]=_0x5c9362[_0x6c2b('0x35')][_0x6c2b('0x37')]?_0x5c9362[_0x6c2b('0x35')]:_0x8de0ae['model'];if(!_0x2f20d1[_0x6c2b('0x31')]['hasOwnProperty'](_0x6c2b('0x38'))){_0x5c9362[_0x6c2b('0x1e')]=qs['limit'](_0x2f20d1[_0x6c2b('0x31')][_0x6c2b('0x1e')]);_0x5c9362[_0x6c2b('0x1c')]=qs[_0x6c2b('0x1c')](_0x2f20d1['query'][_0x6c2b('0x1c')]);}_0x5c9362[_0x6c2b('0x39')]=qs[_0x6c2b('0x3a')](_0x2f20d1['query'][_0x6c2b('0x3a')]);_0x5c9362['where']=qs[_0x6c2b('0x33')](_['pick'](_0x2f20d1[_0x6c2b('0x31')],_0x8de0ae[_0x6c2b('0x33')]),_0x1d9d20);if(_0x2f20d1[_0x6c2b('0x31')][_0x6c2b('0x3b')]){_0x5c9362['where']=_[_0x6c2b('0x3c')](_0x5c9362[_0x6c2b('0x3d')],{'$or':_['map'](_0x1d9d20,function(_0x3bb352){if(_0x3bb352[_0x6c2b('0x3e')]!==_0x6c2b('0x3f')){var _0x5101ac={};_0x5101ac[_0x3bb352['name']]={'$like':'%'+_0x2f20d1[_0x6c2b('0x31')][_0x6c2b('0x3b')]+'%'};return _0x5101ac;}})});}_0x5c9362=_[_0x6c2b('0x3c')]({},_0x5c9362,_0x2f20d1[_0x6c2b('0x40')]);var _0x1b7733={'where':_0x5c9362[_0x6c2b('0x3d')]};return db['OpenchannelTransferReport'][_0x6c2b('0x1f')](_0x1b7733)['then'](function(_0x2edece){_0x204988[_0x6c2b('0x1f')]=_0x2edece;if(_0x2f20d1[_0x6c2b('0x31')][_0x6c2b('0x41')]){_0x5c9362[_0x6c2b('0x42')]=[{'all':!![]}];}return db['OpenchannelTransferReport'][_0x6c2b('0x43')](_0x5c9362);})[_0x6c2b('0x24')](function(_0x5c53d7){_0x204988[_0x6c2b('0x44')]=_0x5c53d7;return _0x204988;})[_0x6c2b('0x24')](respondWithFilteredResult(_0x441c2a,_0x5c9362))[_0x6c2b('0x45')](handleError(_0x441c2a,null));};exports[_0x6c2b('0x46')]=function(_0x2275f7,_0x59865b){var _0x8783d3={'raw':!![],'where':{'id':_0x2275f7[_0x6c2b('0x47')]['id']}},_0x4ca255={};_0x4ca255[_0x6c2b('0x30')]=_[_0x6c2b('0x32')](db['OpenchannelTransferReport'][_0x6c2b('0x2d')]);_0x4ca255[_0x6c2b('0x31')]=_[_0x6c2b('0x32')](_0x2275f7[_0x6c2b('0x31')]);_0x4ca255['filters']=_[_0x6c2b('0x34')](_0x4ca255[_0x6c2b('0x30')],_0x4ca255[_0x6c2b('0x31')]);_0x8783d3[_0x6c2b('0x35')]=_[_0x6c2b('0x34')](_0x4ca255['model'],qs['fields'](_0x2275f7[_0x6c2b('0x31')][_0x6c2b('0x36')]));_0x8783d3[_0x6c2b('0x35')]=_0x8783d3[_0x6c2b('0x35')][_0x6c2b('0x37')]?_0x8783d3[_0x6c2b('0x35')]:_0x4ca255[_0x6c2b('0x30')];if(_0x2275f7['query'][_0x6c2b('0x41')]){_0x8783d3[_0x6c2b('0x42')]=[{'all':!![]}];}_0x8783d3=_[_0x6c2b('0x3c')]({},_0x8783d3,_0x2275f7['options']);return db[_0x6c2b('0x48')][_0x6c2b('0x49')](_0x8783d3)[_0x6c2b('0x24')](handleEntityNotFound(_0x59865b,null))[_0x6c2b('0x24')](respondWithResult(_0x59865b,null))[_0x6c2b('0x45')](handleError(_0x59865b,null));};exports[_0x6c2b('0x4a')]=function(_0x300c92,_0x2ec0fd){return db['OpenchannelTransferReport'][_0x6c2b('0x4a')](_0x300c92['body'],{})[_0x6c2b('0x24')](respondWithResult(_0x2ec0fd,0xc9))['catch'](handleError(_0x2ec0fd,null));};exports['update']=function(_0x4b5364,_0x47c06c){if(_0x4b5364[_0x6c2b('0x4b')]['id']){delete _0x4b5364[_0x6c2b('0x4b')]['id'];}return db[_0x6c2b('0x48')]['find']({'where':{'id':_0x4b5364[_0x6c2b('0x47')]['id']}})[_0x6c2b('0x24')](handleEntityNotFound(_0x47c06c,null))[_0x6c2b('0x24')](saveUpdates(_0x4b5364[_0x6c2b('0x4b')],null))[_0x6c2b('0x24')](respondWithResult(_0x47c06c,null))['catch'](handleError(_0x47c06c,null));};exports['destroy']=function(_0x38c33a,_0x113977){return db['OpenchannelTransferReport'][_0x6c2b('0x49')]({'where':{'id':_0x38c33a[_0x6c2b('0x47')]['id']}})['then'](handleEntityNotFound(_0x113977,null))[_0x6c2b('0x24')](removeEntity(_0x113977,null))[_0x6c2b('0x45')](handleError(_0x113977,null));};exports[_0x6c2b('0x4c')]=function(_0x1f0399,_0x5e56ef){return db[_0x6c2b('0x48')]['describe']()[_0x6c2b('0x24')](respondWithResult(_0x5e56ef,null))['catch'](handleError(_0x5e56ef,null));}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.model.js b/server/api/openchannelTransferReport/openchannelTransferReport.model.js index ea49f66..9816170 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 _0x9b12=['../../config/logger','api','moment','bluebird','request-promise','rimraf','exports','define','OpenchannelTransferReport','report_openchannel_transfer','uniqueid','lodash'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x9b12,0x6b));var _0x29b1=function(_0xdaf72f,_0x5f0d2){_0xdaf72f=_0xdaf72f-0x0;var _0x5af468=_0x9b12[_0xdaf72f];return _0x5af468;};'use strict';var _=require(_0x29b1('0x0'));var util=require('util');var logger=require(_0x29b1('0x1'))(_0x29b1('0x2'));var moment=require(_0x29b1('0x3'));var BPromise=require(_0x29b1('0x4'));var rp=require(_0x29b1('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x29b1('0x6'));var config=require('../../config/environment');var attributes=require('./openchannelTransferReport.attributes');module[_0x29b1('0x7')]=function(_0x2177e8,_0xa27581){return _0x2177e8[_0x29b1('0x8')](_0x29b1('0x9'),attributes,{'tableName':_0x29b1('0xa'),'paranoid':![],'indexes':[{'name':_0x29b1('0xb'),'fields':[_0x29b1('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x54cc=['OpenchannelTransferReport','report_openchannel_transfer','uniqueid','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./openchannelTransferReport.attributes','exports','define'];(function(_0x4e82d3,_0x5dd3e9){var _0x39c913=function(_0x128e82){while(--_0x128e82){_0x4e82d3['push'](_0x4e82d3['shift']());}};_0x39c913(++_0x5dd3e9);}(_0x54cc,0x155));var _0xc54c=function(_0x2287f9,_0x50fee3){_0x2287f9=_0x2287f9-0x0;var _0x134417=_0x54cc[_0x2287f9];return _0x134417;};'use strict';var _=require('lodash');var util=require(_0xc54c('0x0'));var logger=require(_0xc54c('0x1'))('api');var moment=require(_0xc54c('0x2'));var BPromise=require(_0xc54c('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc54c('0x4'));var rimraf=require(_0xc54c('0x5'));var config=require(_0xc54c('0x6'));var attributes=require(_0xc54c('0x7'));module[_0xc54c('0x8')]=function(_0x1ae413,_0x4e4782){return _0x1ae413[_0xc54c('0x9')](_0xc54c('0xa'),attributes,{'tableName':_0xc54c('0xb'),'paranoid':![],'indexes':[{'name':_0xc54c('0xc'),'fields':[_0xc54c('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js b/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js index 0b0bacb..605d2eb 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 _0x394e=['error','code','message','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info','OpenchannelTransferReport,\x20%s,\x20%s','request\x20sent','debug','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x21004f,_0x450b56){var _0xbc9a12=function(_0x8cd332){while(--_0x8cd332){_0x21004f['push'](_0x21004f['shift']());}};_0xbc9a12(++_0x450b56);}(_0x394e,0x88));var _0xe394=function(_0x195b7b,_0x547852){_0x195b7b=_0x195b7b-0x0;var _0x1c84de=_0x394e[_0x195b7b];return _0x1c84de;};'use strict';var _=require(_0xe394('0x0'));var util=require(_0xe394('0x1'));var moment=require('moment');var BPromise=require(_0xe394('0x2'));var rs=require(_0xe394('0x3'));var fs=require('fs');var Redis=require(_0xe394('0x4'));var db=require(_0xe394('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xe394('0x6'))(_0xe394('0x7'));var config=require(_0xe394('0x8'));var jayson=require(_0xe394('0x9'));var client=jayson[_0xe394('0xa')][_0xe394('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x337bff,_0x169910,_0xad826e){return new BPromise(function(_0x267d68,_0x1220a2){return client['request'](_0x337bff,_0xad826e)['then'](function(_0x5962d2){logger[_0xe394('0xc')](_0xe394('0xd'),_0x169910,_0xe394('0xe'));logger[_0xe394('0xf')](_0xe394('0x10'),_0x169910,_0xe394('0xe'),JSON[_0xe394('0x11')](_0x5962d2));if(_0x5962d2[_0xe394('0x12')]){if(_0x5962d2[_0xe394('0x12')][_0xe394('0x13')]===0x1f4){logger[_0xe394('0x12')](_0xe394('0xd'),_0x169910,_0x5962d2['error']['message']);return _0x1220a2(_0x5962d2['error'][_0xe394('0x14')]);}logger[_0xe394('0x12')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x169910,_0x5962d2[_0xe394('0x12')][_0xe394('0x14')]);return _0x267d68(_0x5962d2[_0xe394('0x12')][_0xe394('0x14')]);}else{logger[_0xe394('0xc')](_0xe394('0xd'),_0x169910,'request\x20sent');_0x267d68(_0x5962d2['result'][_0xe394('0x14')]);}})[_0xe394('0x15')](function(_0x3f11e7){logger[_0xe394('0x12')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x169910,_0x3f11e7);_0x1220a2(_0x3f11e7);});});} \ No newline at end of file +var _0xf3cc=['rpc','../../config/environment','client','http','request','then','request\x20sent','debug','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','OpenchannelTransferReport,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils'];(function(_0x33b808,_0x2d3d29){var _0x2033db=function(_0x29fa67){while(--_0x29fa67){_0x33b808['push'](_0x33b808['shift']());}};_0x2033db(++_0x2d3d29);}(_0xf3cc,0x10d));var _0xcf3c=function(_0x455ac0,_0x1d5f16){_0x455ac0=_0x455ac0-0x0;var _0xfb9257=_0xf3cc[_0x455ac0];return _0xfb9257;};'use strict';var _=require(_0xcf3c('0x0'));var util=require(_0xcf3c('0x1'));var moment=require(_0xcf3c('0x2'));var BPromise=require(_0xcf3c('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xcf3c('0x4'));var db=require(_0xcf3c('0x5'))['db'];var utils=require(_0xcf3c('0x6'));var logger=require('../../config/logger')(_0xcf3c('0x7'));var config=require(_0xcf3c('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xcf3c('0x9')][_0xcf3c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x35cb18,_0xba8a24,_0x11deda){return new BPromise(function(_0x147e12,_0x1a593f){return client[_0xcf3c('0xb')](_0x35cb18,_0x11deda)[_0xcf3c('0xc')](function(_0x367027){logger['info']('OpenchannelTransferReport,\x20%s,\x20%s',_0xba8a24,_0xcf3c('0xd'));logger[_0xcf3c('0xe')](_0xcf3c('0xf'),_0xba8a24,_0xcf3c('0xd'),JSON[_0xcf3c('0x10')](_0x367027));if(_0x367027[_0xcf3c('0x11')]){if(_0x367027[_0xcf3c('0x11')][_0xcf3c('0x12')]===0x1f4){logger['error'](_0xcf3c('0x13'),_0xba8a24,_0x367027[_0xcf3c('0x11')]['message']);return _0x1a593f(_0x367027[_0xcf3c('0x11')]['message']);}logger['error']('OpenchannelTransferReport,\x20%s,\x20%s',_0xba8a24,_0x367027[_0xcf3c('0x11')]['message']);return _0x147e12(_0x367027[_0xcf3c('0x11')][_0xcf3c('0x14')]);}else{logger['info'](_0xcf3c('0x13'),_0xba8a24,'request\x20sent');_0x147e12(_0x367027[_0xcf3c('0x15')][_0xcf3c('0x14')]);}})[_0xcf3c('0x16')](function(_0x5157d8){logger[_0xcf3c('0x11')](_0xcf3c('0x13'),_0xba8a24,_0x5157d8);_0x1a593f(_0x5157d8);});});} \ No newline at end of file diff --git a/server/api/pause/index.js b/server/api/pause/index.js index 2710e42..6db35cc 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 _0xe5ad=['post','put','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./pause.controller','get','isAuthenticated','/:id'];(function(_0x42a165,_0x4d8b53){var _0x2b4a22=function(_0xa73db8){while(--_0xa73db8){_0x42a165['push'](_0x42a165['shift']());}};_0x2b4a22(++_0x4d8b53);}(_0xe5ad,0x110));var _0xde5a=function(_0x1e48c4,_0xf9ac06){_0x1e48c4=_0x1e48c4-0x0;var _0x28dc10=_0xe5ad[_0x1e48c4];return _0x28dc10;};'use strict';var multer=require(_0xde5a('0x0'));var util=require(_0xde5a('0x1'));var path=require('path');var timeout=require(_0xde5a('0x2'));var express=require(_0xde5a('0x3'));var router=express[_0xde5a('0x4')]();var fs_extra=require(_0xde5a('0x5'));var auth=require(_0xde5a('0x6'));var interaction=require(_0xde5a('0x7'));var config=require(_0xde5a('0x8'));var controller=require(_0xde5a('0x9'));router[_0xde5a('0xa')]('/',auth[_0xde5a('0xb')](),controller['index']);router[_0xde5a('0xa')](_0xde5a('0xc'),auth[_0xde5a('0xb')](),controller['show']);router[_0xde5a('0xd')]('/',auth[_0xde5a('0xb')](),controller['create']);router[_0xde5a('0xe')](_0xde5a('0xc'),auth[_0xde5a('0xb')](),controller[_0xde5a('0xf')]);router[_0xde5a('0x10')](_0xde5a('0xc'),auth[_0xde5a('0xb')](),controller[_0xde5a('0x11')]);module[_0xde5a('0x12')]=router; \ No newline at end of file +var _0xb9be=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/:id','show','post','create','put','delete','destroy','exports','multer','util','path'];(function(_0x6c993a,_0x5ea3ab){var _0x27f547=function(_0x22df20){while(--_0x22df20){_0x6c993a['push'](_0x6c993a['shift']());}};_0x27f547(++_0x5ea3ab);}(_0xb9be,0xc5));var _0xeb9b=function(_0x3c4a7c,_0x2f4e3c){_0x3c4a7c=_0x3c4a7c-0x0;var _0xf13d1e=_0xb9be[_0x3c4a7c];return _0xf13d1e;};'use strict';var multer=require(_0xeb9b('0x0'));var util=require(_0xeb9b('0x1'));var path=require(_0xeb9b('0x2'));var timeout=require(_0xeb9b('0x3'));var express=require(_0xeb9b('0x4'));var router=express[_0xeb9b('0x5')]();var fs_extra=require(_0xeb9b('0x6'));var auth=require(_0xeb9b('0x7'));var interaction=require(_0xeb9b('0x8'));var config=require('../../config/environment');var controller=require('./pause.controller');router[_0xeb9b('0x9')]('/',auth[_0xeb9b('0xa')](),controller[_0xeb9b('0xb')]);router['get'](_0xeb9b('0xc'),auth[_0xeb9b('0xa')](),controller[_0xeb9b('0xd')]);router[_0xeb9b('0xe')]('/',auth[_0xeb9b('0xa')](),controller[_0xeb9b('0xf')]);router[_0xeb9b('0x10')](_0xeb9b('0xc'),auth[_0xeb9b('0xa')](),controller['update']);router[_0xeb9b('0x11')]('/:id',auth['isAuthenticated'](),controller[_0xeb9b('0x12')]);module[_0xeb9b('0x13')]=router; \ No newline at end of file diff --git a/server/api/pause/pause.attributes.js b/server/api/pause/pause.attributes.js index 3dc07ba..9755f0c 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 _0xae75=['sequelize','STRING','name'];(function(_0x30d428,_0x5cd5fd){var _0x2f8a98=function(_0x1362f9){while(--_0x1362f9){_0x30d428['push'](_0x30d428['shift']());}};_0x2f8a98(++_0x5cd5fd);}(_0xae75,0x6c));var _0x5ae7=function(_0x1fb4ad,_0x24224f){_0x1fb4ad=_0x1fb4ad-0x0;var _0x2d33c8=_0xae75[_0x1fb4ad];return _0x2d33c8;};'use strict';var Sequelize=require(_0x5ae7('0x0'));module['exports']={'name':{'type':Sequelize[_0x5ae7('0x1')],'unique':_0x5ae7('0x2'),'allowNull':![]},'description':{'type':Sequelize[_0x5ae7('0x1')]}}; \ No newline at end of file +var _0xf9bd=['sequelize','name'];(function(_0x281bfc,_0x45a6cc){var _0x5588f6=function(_0x285218){while(--_0x285218){_0x281bfc['push'](_0x281bfc['shift']());}};_0x5588f6(++_0x45a6cc);}(_0xf9bd,0x92));var _0xdf9b=function(_0x450fd8,_0x5ef5b7){_0x450fd8=_0x450fd8-0x0;var _0x568efd=_0xf9bd[_0x450fd8];return _0x568efd;};'use strict';var Sequelize=require(_0xdf9b('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0xdf9b('0x1'),'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 d7c6134..a108bc7 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 _0xa940=['sox','to-csv','ejs','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','../../config/license/util','../../mysqldb','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','save','update','then','destroy','get','Pauses','UserProfileResource','sendStatus','name','index','map','fieldName','type','model','query','filters','intersection','attributes','fields','length','nolimit','sort','where','pick','merge','VIRTUAL','filter','options','Pause','includeAll','include','rows','show','params','keys','rawAttributes','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path'];(function(_0x27bae5,_0x113bad){var _0x3b44b5=function(_0xee141b){while(--_0xee141b){_0x27bae5['push'](_0x27bae5['shift']());}};_0x3b44b5(++_0x113bad);}(_0xa940,0x9d));var _0x0a94=function(_0x17c80a,_0x421bd4){_0x17c80a=_0x17c80a-0x0;var _0x2f4ed2=_0xa940[_0x17c80a];return _0x2f4ed2;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x0a94('0x0'));var jsonpatch=require(_0x0a94('0x1'));var rp=require('request-promise');var moment=require(_0x0a94('0x2'));var BPromise=require(_0x0a94('0x3'));var Mustache=require(_0x0a94('0x4'));var util=require(_0x0a94('0x5'));var path=require(_0x0a94('0x6'));var sox=require(_0x0a94('0x7'));var csv=require(_0x0a94('0x8'));var ejs=require(_0x0a94('0x9'));var fs=require('fs');var fs_extra=require(_0x0a94('0xa'));var _=require('lodash');var squel=require(_0x0a94('0xb'));var crypto=require(_0x0a94('0xc'));var jsforce=require(_0x0a94('0xd'));var deskjs=require(_0x0a94('0xe'));var toCsv=require(_0x0a94('0x8'));var querystring=require(_0x0a94('0xf'));var Papa=require(_0x0a94('0x10'));var Redis=require(_0x0a94('0x11'));var authService=require(_0x0a94('0x12'));var qs=require(_0x0a94('0x13'));var as=require(_0x0a94('0x14'));var hardwareService=require(_0x0a94('0x15'));var logger=require(_0x0a94('0x16'))('api');var utils=require(_0x0a94('0x17'));var config=require(_0x0a94('0x18'));var licenseUtil=require(_0x0a94('0x19'));var db=require(_0x0a94('0x1a'))['db'];function respondWithStatusCode(_0x133534,_0x5dbc0f){_0x5dbc0f=_0x5dbc0f||0xcc;return function(_0x32e0e7){if(_0x32e0e7){return _0x133534['sendStatus'](_0x5dbc0f);}return _0x133534[_0x0a94('0x1b')](_0x5dbc0f)[_0x0a94('0x1c')]();};}function respondWithResult(_0x55eb7a,_0xc44a88){_0xc44a88=_0xc44a88||0xc8;return function(_0x5ab298){if(_0x5ab298){return _0x55eb7a[_0x0a94('0x1b')](_0xc44a88)[_0x0a94('0x1d')](_0x5ab298);}};}function respondWithFilteredResult(_0x357055,_0xca7aef){return function(_0x885e15){if(_0x885e15){var _0x1fbc96=typeof _0xca7aef['offset']===_0x0a94('0x1e')&&typeof _0xca7aef[_0x0a94('0x1f')]===_0x0a94('0x1e');var _0x4de277=_0x885e15[_0x0a94('0x20')];var _0x3567da=_0x1fbc96?0x0:_0xca7aef[_0x0a94('0x21')];var _0x2268e9=_0x1fbc96?_0x885e15[_0x0a94('0x20')]:_0xca7aef[_0x0a94('0x21')]+_0xca7aef[_0x0a94('0x1f')];var _0x53cc05;if(_0x2268e9>=_0x4de277){_0x2268e9=_0x4de277;_0x53cc05=0xc8;}else{_0x53cc05=0xce;}_0x357055['status'](_0x53cc05);return _0x357055[_0x0a94('0x22')](_0x0a94('0x23'),_0x3567da+'-'+_0x2268e9+'/'+_0x4de277)['json'](_0x885e15);}return null;};}function patchUpdates(_0x29f163){return function(_0x290608){try{jsonpatch[_0x0a94('0x24')](_0x290608,_0x29f163,!![]);}catch(_0x2336c5){return BPromise['reject'](_0x2336c5);}return _0x290608[_0x0a94('0x25')]();};}function saveUpdates(_0x4d4fea,_0x55aff2){return function(_0x44c331){if(_0x44c331){return _0x44c331[_0x0a94('0x26')](_0x4d4fea)[_0x0a94('0x27')](function(_0x12d63e){return _0x12d63e;});}return null;};}function removeEntity(_0x7bf118,_0x398fec){return function(_0x2b2874){if(_0x2b2874){return _0x2b2874[_0x0a94('0x28')]()[_0x0a94('0x27')](function(){var _0x4dfde9=_0x2b2874[_0x0a94('0x29')]({'plain':!![]});var _0x3e8880=_0x0a94('0x2a');return db[_0x0a94('0x2b')][_0x0a94('0x28')]({'where':{'type':_0x3e8880,'resourceId':_0x4dfde9['id']}})[_0x0a94('0x27')](function(){return _0x2b2874;});})['then'](function(){_0x7bf118['status'](0xcc)[_0x0a94('0x1c')]();});}};}function handleEntityNotFound(_0x185070,_0x77098c){return function(_0x30b213){if(!_0x30b213){_0x185070[_0x0a94('0x2c')](0x194);}return _0x30b213;};}function handleError(_0x3aa2aa,_0x20de0b){_0x20de0b=_0x20de0b||0x1f4;return function(_0x38d790){logger['error'](_0x38d790['stack']);if(_0x38d790[_0x0a94('0x2d')]){delete _0x38d790[_0x0a94('0x2d')];}_0x3aa2aa[_0x0a94('0x1b')](_0x20de0b)['send'](_0x38d790);};}exports[_0x0a94('0x2e')]=function(_0x37cedb,_0x4880ba){var _0x397af7={},_0x2b9b2={},_0x331d88={'count':0x0,'rows':[]};var _0x318bd5=_[_0x0a94('0x2f')](db['Pause']['rawAttributes'],function(_0x452d79){return{'name':_0x452d79[_0x0a94('0x30')],'type':_0x452d79[_0x0a94('0x31')]['key']};});_0x2b9b2[_0x0a94('0x32')]=_[_0x0a94('0x2f')](_0x318bd5,_0x0a94('0x2d'));_0x2b9b2[_0x0a94('0x33')]=_['keys'](_0x37cedb[_0x0a94('0x33')]);_0x2b9b2[_0x0a94('0x34')]=_[_0x0a94('0x35')](_0x2b9b2[_0x0a94('0x32')],_0x2b9b2[_0x0a94('0x33')]);_0x397af7[_0x0a94('0x36')]=_[_0x0a94('0x35')](_0x2b9b2['model'],qs['fields'](_0x37cedb[_0x0a94('0x33')][_0x0a94('0x37')]));_0x397af7[_0x0a94('0x36')]=_0x397af7[_0x0a94('0x36')][_0x0a94('0x38')]?_0x397af7[_0x0a94('0x36')]:_0x2b9b2['model'];if(!_0x37cedb[_0x0a94('0x33')]['hasOwnProperty'](_0x0a94('0x39'))){_0x397af7[_0x0a94('0x1f')]=qs[_0x0a94('0x1f')](_0x37cedb['query'][_0x0a94('0x1f')]);_0x397af7[_0x0a94('0x21')]=qs[_0x0a94('0x21')](_0x37cedb['query'][_0x0a94('0x21')]);}_0x397af7['order']=qs[_0x0a94('0x3a')](_0x37cedb[_0x0a94('0x33')][_0x0a94('0x3a')]);_0x397af7[_0x0a94('0x3b')]=qs[_0x0a94('0x34')](_[_0x0a94('0x3c')](_0x37cedb[_0x0a94('0x33')],_0x2b9b2['filters']),_0x318bd5);if(_0x37cedb[_0x0a94('0x33')]['filter']){_0x397af7[_0x0a94('0x3b')]=_[_0x0a94('0x3d')](_0x397af7[_0x0a94('0x3b')],{'$or':_[_0x0a94('0x2f')](_0x318bd5,function(_0x5e2a33){if(_0x5e2a33[_0x0a94('0x31')]!==_0x0a94('0x3e')){var _0x432de7={};_0x432de7[_0x5e2a33[_0x0a94('0x2d')]]={'$like':'%'+_0x37cedb[_0x0a94('0x33')][_0x0a94('0x3f')]+'%'};return _0x432de7;}})});}_0x397af7=_[_0x0a94('0x3d')]({},_0x397af7,_0x37cedb[_0x0a94('0x40')]);var _0x4abb03={'where':_0x397af7[_0x0a94('0x3b')]};return db[_0x0a94('0x41')][_0x0a94('0x20')](_0x4abb03)[_0x0a94('0x27')](function(_0x296683){_0x331d88['count']=_0x296683;if(_0x37cedb['query'][_0x0a94('0x42')]){_0x397af7[_0x0a94('0x43')]=[{'all':!![]}];}return db[_0x0a94('0x41')]['findAll'](_0x397af7);})[_0x0a94('0x27')](function(_0x106d83){_0x331d88[_0x0a94('0x44')]=_0x106d83;return _0x331d88;})[_0x0a94('0x27')](respondWithFilteredResult(_0x4880ba,_0x397af7))['catch'](handleError(_0x4880ba,null));};exports[_0x0a94('0x45')]=function(_0x1a8063,_0x243782){var _0x1579ff={'raw':!![],'where':{'id':_0x1a8063[_0x0a94('0x46')]['id']}},_0xf97930={};_0xf97930['model']=_[_0x0a94('0x47')](db[_0x0a94('0x41')][_0x0a94('0x48')]);_0xf97930[_0x0a94('0x33')]=_[_0x0a94('0x47')](_0x1a8063[_0x0a94('0x33')]);_0xf97930['filters']=_[_0x0a94('0x35')](_0xf97930[_0x0a94('0x32')],_0xf97930[_0x0a94('0x33')]);_0x1579ff[_0x0a94('0x36')]=_[_0x0a94('0x35')](_0xf97930['model'],qs['fields'](_0x1a8063['query'][_0x0a94('0x37')]));_0x1579ff['attributes']=_0x1579ff[_0x0a94('0x36')][_0x0a94('0x38')]?_0x1579ff['attributes']:_0xf97930['model'];if(_0x1a8063[_0x0a94('0x33')][_0x0a94('0x42')]){_0x1579ff[_0x0a94('0x43')]=[{'all':!![]}];}_0x1579ff=_[_0x0a94('0x3d')]({},_0x1579ff,_0x1a8063[_0x0a94('0x40')]);return db[_0x0a94('0x41')][_0x0a94('0x49')](_0x1579ff)['then'](handleEntityNotFound(_0x243782,null))[_0x0a94('0x27')](respondWithResult(_0x243782,null))[_0x0a94('0x4a')](handleError(_0x243782,null));};exports[_0x0a94('0x4b')]=function(_0x5a2654,_0x1c00a2){return db[_0x0a94('0x41')]['create'](_0x5a2654[_0x0a94('0x4c')],{})[_0x0a94('0x27')](function(_0xd2358a){var _0xb60a09=_0x5a2654[_0x0a94('0x4d')]['get']({'plain':!![]});if(!_0xb60a09)throw new Error(_0x0a94('0x4e'));if(_0xb60a09[_0x0a94('0x4f')]===_0x0a94('0x4d')){var _0xdd4510=_0xd2358a[_0x0a94('0x29')]({'plain':!![]});var _0x1180b5=_0x0a94('0x2a');return db[_0x0a94('0x50')]['find']({'where':{'name':_0x1180b5,'userProfileId':_0xb60a09['userProfileId']},'raw':!![]})[_0x0a94('0x27')](function(_0x11c0f7){if(_0x11c0f7&&_0x11c0f7[_0x0a94('0x51')]===0x0){return db[_0x0a94('0x2b')]['create']({'name':_0xdd4510[_0x0a94('0x2d')],'resourceId':_0xdd4510['id'],'type':_0x11c0f7['name'],'sectionId':_0x11c0f7['id']},{})['then'](function(){return _0xd2358a;});}else{return _0xd2358a;}})['catch'](function(_0x2e7246){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2e7246);throw _0x2e7246;});}return _0xd2358a;})['then'](respondWithResult(_0x1c00a2,0xc9))[_0x0a94('0x4a')](handleError(_0x1c00a2,null));};exports[_0x0a94('0x26')]=function(_0x541c0c,_0xa9bd3d){if(_0x541c0c['body']['id']){delete _0x541c0c[_0x0a94('0x4c')]['id'];}return db[_0x0a94('0x41')]['find']({'where':{'id':_0x541c0c[_0x0a94('0x46')]['id']}})[_0x0a94('0x27')](handleEntityNotFound(_0xa9bd3d,null))[_0x0a94('0x27')](saveUpdates(_0x541c0c[_0x0a94('0x4c')],null))[_0x0a94('0x27')](respondWithResult(_0xa9bd3d,null))['catch'](handleError(_0xa9bd3d,null));};exports[_0x0a94('0x28')]=function(_0x34450f,_0x3b2bc8){return db['Pause']['find']({'where':{'id':_0x34450f[_0x0a94('0x46')]['id']}})[_0x0a94('0x27')](handleEntityNotFound(_0x3b2bc8,null))[_0x0a94('0x27')](removeEntity(_0x3b2bc8,null))['catch'](handleError(_0x3b2bc8,null));}; \ No newline at end of file +var _0x8ec6=['ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','then','destroy','get','Pauses','UserProfileResource','error','stack','name','send','index','map','Pause','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','fields','attributes','sort','where','pick','filter','merge','options','includeAll','include','findAll','catch','show','length','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','update','params','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv'];(function(_0x4d70e1,_0x1c5023){var _0x57fa25=function(_0x51fd8e){while(--_0x51fd8e){_0x4d70e1['push'](_0x4d70e1['shift']());}};_0x57fa25(++_0x1c5023);}(_0x8ec6,0xe9));var _0x68ec=function(_0x5334c2,_0x4566ac){_0x5334c2=_0x5334c2-0x0;var _0x3e6a44=_0x8ec6[_0x5334c2];return _0x3e6a44;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x68ec('0x0'));var zipdir=require(_0x68ec('0x1'));var jsonpatch=require(_0x68ec('0x2'));var rp=require(_0x68ec('0x3'));var moment=require('moment');var BPromise=require(_0x68ec('0x4'));var Mustache=require(_0x68ec('0x5'));var util=require(_0x68ec('0x6'));var path=require(_0x68ec('0x7'));var sox=require(_0x68ec('0x8'));var csv=require(_0x68ec('0x9'));var ejs=require(_0x68ec('0xa'));var fs=require('fs');var fs_extra=require(_0x68ec('0xb'));var _=require(_0x68ec('0xc'));var squel=require(_0x68ec('0xd'));var crypto=require(_0x68ec('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x68ec('0xf'));var Papa=require(_0x68ec('0x10'));var Redis=require(_0x68ec('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x68ec('0x12'));var as=require(_0x68ec('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x68ec('0x14'));var utils=require(_0x68ec('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x68ec('0x16'))['db'];function respondWithStatusCode(_0x1e0b2c,_0x518bba){_0x518bba=_0x518bba||0xcc;return function(_0x5f3d50){if(_0x5f3d50){return _0x1e0b2c[_0x68ec('0x17')](_0x518bba);}return _0x1e0b2c[_0x68ec('0x18')](_0x518bba)[_0x68ec('0x19')]();};}function respondWithResult(_0x41a5c9,_0x3b2275){_0x3b2275=_0x3b2275||0xc8;return function(_0x491e8d){if(_0x491e8d){return _0x41a5c9[_0x68ec('0x18')](_0x3b2275)[_0x68ec('0x1a')](_0x491e8d);}};}function respondWithFilteredResult(_0x4e89a2,_0x3db065){return function(_0x192a5f){if(_0x192a5f){var _0x306529=typeof _0x3db065[_0x68ec('0x1b')]===_0x68ec('0x1c')&&typeof _0x3db065[_0x68ec('0x1d')]===_0x68ec('0x1c');var _0x548793=_0x192a5f[_0x68ec('0x1e')];var _0x327e6c=_0x306529?0x0:_0x3db065[_0x68ec('0x1b')];var _0x236f7b=_0x306529?_0x192a5f[_0x68ec('0x1e')]:_0x3db065[_0x68ec('0x1b')]+_0x3db065[_0x68ec('0x1d')];var _0x40b2a3;if(_0x236f7b>=_0x548793){_0x236f7b=_0x548793;_0x40b2a3=0xc8;}else{_0x40b2a3=0xce;}_0x4e89a2['status'](_0x40b2a3);return _0x4e89a2[_0x68ec('0x1f')](_0x68ec('0x20'),_0x327e6c+'-'+_0x236f7b+'/'+_0x548793)[_0x68ec('0x1a')](_0x192a5f);}return null;};}function patchUpdates(_0x4f9411){return function(_0x3ab803){try{jsonpatch[_0x68ec('0x21')](_0x3ab803,_0x4f9411,!![]);}catch(_0x2eb570){return BPromise['reject'](_0x2eb570);}return _0x3ab803[_0x68ec('0x22')]();};}function saveUpdates(_0x1b0655,_0xaa5873){return function(_0x27d296){if(_0x27d296){return _0x27d296['update'](_0x1b0655)[_0x68ec('0x23')](function(_0x4de8eb){return _0x4de8eb;});}return null;};}function removeEntity(_0x2c0bef,_0x4b8f95){return function(_0x51561b){if(_0x51561b){return _0x51561b[_0x68ec('0x24')]()['then'](function(){var _0x32137b=_0x51561b[_0x68ec('0x25')]({'plain':!![]});var _0x4fd268=_0x68ec('0x26');return db[_0x68ec('0x27')][_0x68ec('0x24')]({'where':{'type':_0x4fd268,'resourceId':_0x32137b['id']}})[_0x68ec('0x23')](function(){return _0x51561b;});})[_0x68ec('0x23')](function(){_0x2c0bef[_0x68ec('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3a710e,_0x584b94){return function(_0x29e170){if(!_0x29e170){_0x3a710e['sendStatus'](0x194);}return _0x29e170;};}function handleError(_0x214907,_0x22f9ba){_0x22f9ba=_0x22f9ba||0x1f4;return function(_0x175d36){logger[_0x68ec('0x28')](_0x175d36[_0x68ec('0x29')]);if(_0x175d36[_0x68ec('0x2a')]){delete _0x175d36[_0x68ec('0x2a')];}_0x214907[_0x68ec('0x18')](_0x22f9ba)[_0x68ec('0x2b')](_0x175d36);};}exports[_0x68ec('0x2c')]=function(_0x3e81da,_0x122097){var _0x2669e5={},_0xe9b01={},_0xfa0d92={'count':0x0,'rows':[]};var _0xc234ea=_[_0x68ec('0x2d')](db[_0x68ec('0x2e')][_0x68ec('0x2f')],function(_0x2fb254){return{'name':_0x2fb254[_0x68ec('0x30')],'type':_0x2fb254[_0x68ec('0x31')][_0x68ec('0x32')]};});_0xe9b01['model']=_[_0x68ec('0x2d')](_0xc234ea,'name');_0xe9b01[_0x68ec('0x33')]=_[_0x68ec('0x34')](_0x3e81da[_0x68ec('0x33')]);_0xe9b01[_0x68ec('0x35')]=_[_0x68ec('0x36')](_0xe9b01['model'],_0xe9b01[_0x68ec('0x33')]);_0x2669e5['attributes']=_[_0x68ec('0x36')](_0xe9b01[_0x68ec('0x37')],qs[_0x68ec('0x38')](_0x3e81da['query'][_0x68ec('0x38')]));_0x2669e5['attributes']=_0x2669e5[_0x68ec('0x39')]['length']?_0x2669e5[_0x68ec('0x39')]:_0xe9b01[_0x68ec('0x37')];if(!_0x3e81da[_0x68ec('0x33')]['hasOwnProperty']('nolimit')){_0x2669e5['limit']=qs['limit'](_0x3e81da[_0x68ec('0x33')]['limit']);_0x2669e5['offset']=qs[_0x68ec('0x1b')](_0x3e81da[_0x68ec('0x33')][_0x68ec('0x1b')]);}_0x2669e5['order']=qs[_0x68ec('0x3a')](_0x3e81da[_0x68ec('0x33')][_0x68ec('0x3a')]);_0x2669e5[_0x68ec('0x3b')]=qs[_0x68ec('0x35')](_[_0x68ec('0x3c')](_0x3e81da[_0x68ec('0x33')],_0xe9b01[_0x68ec('0x35')]),_0xc234ea);if(_0x3e81da[_0x68ec('0x33')][_0x68ec('0x3d')]){_0x2669e5[_0x68ec('0x3b')]=_[_0x68ec('0x3e')](_0x2669e5['where'],{'$or':_[_0x68ec('0x2d')](_0xc234ea,function(_0x67faa){if(_0x67faa[_0x68ec('0x31')]!=='VIRTUAL'){var _0x252f70={};_0x252f70[_0x67faa[_0x68ec('0x2a')]]={'$like':'%'+_0x3e81da[_0x68ec('0x33')]['filter']+'%'};return _0x252f70;}})});}_0x2669e5=_[_0x68ec('0x3e')]({},_0x2669e5,_0x3e81da[_0x68ec('0x3f')]);var _0x2927be={'where':_0x2669e5[_0x68ec('0x3b')]};return db['Pause'][_0x68ec('0x1e')](_0x2927be)['then'](function(_0x390ae4){_0xfa0d92[_0x68ec('0x1e')]=_0x390ae4;if(_0x3e81da[_0x68ec('0x33')][_0x68ec('0x40')]){_0x2669e5[_0x68ec('0x41')]=[{'all':!![]}];}return db[_0x68ec('0x2e')][_0x68ec('0x42')](_0x2669e5);})[_0x68ec('0x23')](function(_0x219651){_0xfa0d92['rows']=_0x219651;return _0xfa0d92;})[_0x68ec('0x23')](respondWithFilteredResult(_0x122097,_0x2669e5))[_0x68ec('0x43')](handleError(_0x122097,null));};exports[_0x68ec('0x44')]=function(_0x3a04b6,_0x304327){var _0xe8a519={'raw':!![],'where':{'id':_0x3a04b6['params']['id']}},_0x314467={};_0x314467['model']=_[_0x68ec('0x34')](db[_0x68ec('0x2e')][_0x68ec('0x2f')]);_0x314467[_0x68ec('0x33')]=_[_0x68ec('0x34')](_0x3a04b6[_0x68ec('0x33')]);_0x314467['filters']=_[_0x68ec('0x36')](_0x314467[_0x68ec('0x37')],_0x314467[_0x68ec('0x33')]);_0xe8a519[_0x68ec('0x39')]=_['intersection'](_0x314467[_0x68ec('0x37')],qs[_0x68ec('0x38')](_0x3a04b6[_0x68ec('0x33')][_0x68ec('0x38')]));_0xe8a519[_0x68ec('0x39')]=_0xe8a519[_0x68ec('0x39')][_0x68ec('0x45')]?_0xe8a519[_0x68ec('0x39')]:_0x314467[_0x68ec('0x37')];if(_0x3a04b6[_0x68ec('0x33')]['includeAll']){_0xe8a519['include']=[{'all':!![]}];}_0xe8a519=_[_0x68ec('0x3e')]({},_0xe8a519,_0x3a04b6[_0x68ec('0x3f')]);return db[_0x68ec('0x2e')][_0x68ec('0x46')](_0xe8a519)[_0x68ec('0x23')](handleEntityNotFound(_0x304327,null))[_0x68ec('0x23')](respondWithResult(_0x304327,null))['catch'](handleError(_0x304327,null));};exports[_0x68ec('0x47')]=function(_0x28b4d5,_0x5899a1){return db[_0x68ec('0x2e')]['create'](_0x28b4d5[_0x68ec('0x48')],{})[_0x68ec('0x23')](function(_0x4009c3){var _0x4cfada=_0x28b4d5[_0x68ec('0x49')][_0x68ec('0x25')]({'plain':!![]});if(!_0x4cfada)throw new Error(_0x68ec('0x4a'));if(_0x4cfada[_0x68ec('0x4b')]===_0x68ec('0x49')){var _0x364f42=_0x4009c3[_0x68ec('0x25')]({'plain':!![]});var _0xfe3e79=_0x68ec('0x26');return db[_0x68ec('0x4c')][_0x68ec('0x46')]({'where':{'name':_0xfe3e79,'userProfileId':_0x4cfada[_0x68ec('0x4d')]},'raw':!![]})[_0x68ec('0x23')](function(_0xfdddd5){if(_0xfdddd5&&_0xfdddd5[_0x68ec('0x4e')]===0x0){return db[_0x68ec('0x27')]['create']({'name':_0x364f42[_0x68ec('0x2a')],'resourceId':_0x364f42['id'],'type':_0xfdddd5[_0x68ec('0x2a')],'sectionId':_0xfdddd5['id']},{})[_0x68ec('0x23')](function(){return _0x4009c3;});}else{return _0x4009c3;}})['catch'](function(_0x138dd8){logger[_0x68ec('0x28')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x138dd8);throw _0x138dd8;});}return _0x4009c3;})['then'](respondWithResult(_0x5899a1,0xc9))['catch'](handleError(_0x5899a1,null));};exports[_0x68ec('0x4f')]=function(_0x395904,_0x4910ee){if(_0x395904[_0x68ec('0x48')]['id']){delete _0x395904[_0x68ec('0x48')]['id'];}return db[_0x68ec('0x2e')][_0x68ec('0x46')]({'where':{'id':_0x395904[_0x68ec('0x50')]['id']}})['then'](handleEntityNotFound(_0x4910ee,null))[_0x68ec('0x23')](saveUpdates(_0x395904[_0x68ec('0x48')],null))[_0x68ec('0x23')](respondWithResult(_0x4910ee,null))['catch'](handleError(_0x4910ee,null));};exports[_0x68ec('0x24')]=function(_0x53db42,_0x1b7ac5){return db[_0x68ec('0x2e')][_0x68ec('0x46')]({'where':{'id':_0x53db42['params']['id']}})[_0x68ec('0x23')](handleEntityNotFound(_0x1b7ac5,null))['then'](removeEntity(_0x1b7ac5,null))['catch'](handleError(_0x1b7ac5,null));}; \ No newline at end of file diff --git a/server/api/pause/pause.model.js b/server/api/pause/pause.model.js index 9f8de97..878e87e 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 _0xe14b=['bluebird','path','./pause.attributes','exports','define','Pause','tools_pauses','lodash','util','moment'];(function(_0x47fce8,_0x443527){var _0x3329ce=function(_0x16423c){while(--_0x16423c){_0x47fce8['push'](_0x47fce8['shift']());}};_0x3329ce(++_0x443527);}(_0xe14b,0x93));var _0xbe14=function(_0x473f08,_0x6325e9){_0x473f08=_0x473f08-0x0;var _0x1ebaac=_0xe14b[_0x473f08];return _0x1ebaac;};'use strict';var _=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xbe14('0x2'));var BPromise=require(_0xbe14('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbe14('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xbe14('0x5'));module[_0xbe14('0x6')]=function(_0x1fe204,_0x1ff100){return _0x1fe204[_0xbe14('0x7')](_0xbe14('0x8'),attributes,{'tableName':_0xbe14('0x9'),'paranoid':![],'indexes':[],'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(_0x276fa6,_0x4638bd){var _0x1fc096=function(_0x3907be){while(--_0x3907be){_0x276fa6['push'](_0x276fa6['shift']());}};_0x1fc096(++_0x4638bd);}(_0x5fc3,0xa8));var _0x35fc=function(_0x128bef,_0xc7a0af){_0x128bef=_0x128bef-0x0;var _0x1ba862=_0x5fc3[_0x128bef];return _0x1ba862;};'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 3ef6f41..cf07b06 100644 --- a/server/api/pause/pause.rpc.js +++ b/server/api/pause/pause.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb10b=['catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','Pause,\x20%s,\x20%s','Pause,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','ShowPause','Pause','find','options','raw','where','attributes','map','include','model','debug'];(function(_0x3d2330,_0x5a1996){var _0x2b142e=function(_0x4eb86c){while(--_0x4eb86c){_0x3d2330['push'](_0x3d2330['shift']());}};_0x2b142e(++_0x5a1996);}(_0xb10b,0x12a));var _0xbb10=function(_0x46306f,_0x5aef14){_0x46306f=_0x46306f-0x0;var _0x16a27f=_0xb10b[_0x46306f];return _0x16a27f;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var moment=require(_0xbb10('0x1'));var BPromise=require(_0xbb10('0x2'));var rs=require(_0xbb10('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbb10('0x4'))['db'];var utils=require(_0xbb10('0x5'));var logger=require(_0xbb10('0x6'))(_0xbb10('0x7'));var config=require(_0xbb10('0x8'));var jayson=require(_0xbb10('0x9'));var client=jayson['client'][_0xbb10('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3cdd53,_0x513741,_0x1b9e94){return new BPromise(function(_0x3fb675,_0x21370f){return client[_0xbb10('0xb')](_0x3cdd53,_0x1b9e94)[_0xbb10('0xc')](function(_0x1ce33e){logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,'request\x20sent');logger['debug'](_0xbb10('0xf'),_0x513741,_0xbb10('0x10'),JSON[_0xbb10('0x11')](_0x1ce33e));if(_0x1ce33e['error']){if(_0x1ce33e[_0xbb10('0x12')]['code']===0x1f4){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x21370f(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}logger['error'](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x3fb675(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}else{logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,_0xbb10('0x10'));_0x3fb675(_0x1ce33e[_0xbb10('0x14')][_0xbb10('0x13')]);}})['catch'](function(_0x2eca0f){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x2eca0f);_0x21370f(_0x2eca0f);});});}exports[_0xbb10('0x15')]=function(_0x378da8){var _0x1682a4=this;return new Promise(function(_0x575cca,_0x30efc6){return db[_0xbb10('0x16')][_0xbb10('0x17')]({'raw':_0x378da8['options']?_0x378da8[_0xbb10('0x18')][_0xbb10('0x19')]===undefined?!![]:![]:!![],'where':_0x378da8[_0xbb10('0x18')]?_0x378da8[_0xbb10('0x18')][_0xbb10('0x1a')]||null:null,'attributes':_0x378da8[_0xbb10('0x18')]?_0x378da8['options'][_0xbb10('0x1b')]||null:null,'include':_0x378da8[_0xbb10('0x18')]?_0x378da8['options']['include']?_[_0xbb10('0x1c')](_0x378da8[_0xbb10('0x18')][_0xbb10('0x1d')],function(_0x317da4){return{'model':db[_0x317da4[_0xbb10('0x1e')]],'as':_0x317da4['as'],'attributes':_0x317da4[_0xbb10('0x1b')],'include':_0x317da4[_0xbb10('0x1d')]?_[_0xbb10('0x1c')](_0x317da4[_0xbb10('0x1d')],function(_0x395404){return{'model':db[_0x395404[_0xbb10('0x1e')]],'as':_0x395404['as'],'attributes':_0x395404[_0xbb10('0x1b')],'include':_0x395404['include']?_['map'](_0x395404['include'],function(_0xc93a04){return{'model':db[_0xc93a04[_0xbb10('0x1e')]],'as':_0xc93a04['as'],'attributes':_0xc93a04[_0xbb10('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2fdde9){logger[_0xbb10('0xd')](_0xbb10('0x15'),_0x378da8);logger[_0xbb10('0x1f')](_0xbb10('0x15'),_0x378da8,JSON[_0xbb10('0x11')](_0x2fdde9));_0x575cca(_0x2fdde9);})[_0xbb10('0x20')](function(_0x4aabb9){logger[_0xbb10('0x12')](_0xbb10('0x15'),_0x4aabb9[_0xbb10('0x13')],_0x378da8);_0x30efc6(_0x1682a4[_0xbb10('0x12')](0x1f4,_0x4aabb9[_0xbb10('0x13')]));});});}; \ No newline at end of file +var _0xb10b=['catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','Pause,\x20%s,\x20%s','Pause,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','ShowPause','Pause','find','options','raw','where','attributes','map','include','model','debug'];(function(_0xcc4b19,_0x5e5e05){var _0x6fa415=function(_0x2fec9a){while(--_0x2fec9a){_0xcc4b19['push'](_0xcc4b19['shift']());}};_0x6fa415(++_0x5e5e05);}(_0xb10b,0x12a));var _0xbb10=function(_0x2a87fc,_0x30a039){_0x2a87fc=_0x2a87fc-0x0;var _0x32d9f5=_0xb10b[_0x2a87fc];return _0x32d9f5;};'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 5ce2537..cab2d81 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 _0x98a8=['multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./plugin.controller','get','isAuthenticated','webhookGet','/:id','show','/:id/download','download','diskStorage','root','format','%s-%s%s','basename','originalname','extname','post','file','webhookPost','put','update','delete'];(function(_0x38aa97,_0x2ac902){var _0x3e2f4b=function(_0x24d7cb){while(--_0x24d7cb){_0x38aa97['push'](_0x38aa97['shift']());}};_0x3e2f4b(++_0x2ac902);}(_0x98a8,0x12c));var _0x898a=function(_0x25ebf9,_0x2eba65){_0x25ebf9=_0x25ebf9-0x0;var _0x312860=_0x98a8[_0x25ebf9];return _0x312860;};'use strict';var multer=require(_0x898a('0x0'));var util=require(_0x898a('0x1'));var path=require(_0x898a('0x2'));var timeout=require(_0x898a('0x3'));var express=require(_0x898a('0x4'));var router=express[_0x898a('0x5')]();var fs_extra=require(_0x898a('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x898a('0x7'));var config=require(_0x898a('0x8'));var controller=require(_0x898a('0x9'));router[_0x898a('0xa')]('/',auth[_0x898a('0xb')](),controller['index']);router[_0x898a('0xa')]('/webhook',controller[_0x898a('0xc')]);router['get'](_0x898a('0xd'),auth[_0x898a('0xb')](),controller[_0x898a('0xe')]);router[_0x898a('0xa')](_0x898a('0xf'),auth[_0x898a('0xb')](),controller[_0x898a('0x10')]);var upload=multer({'storage':multer[_0x898a('0x11')]({'destination':function(_0x3806cb,_0x5d2de4,_0x3e1867){_0x3e1867(null,path['join'](config[_0x898a('0x12')],'server/files/plugins'));},'filename':function(_0x25d7f2,_0x2c76b7,_0x364a23){_0x2c76b7['originalname']=_0x2c76b7['originalname']['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x364a23(null,util[_0x898a('0x13')](_0x898a('0x14'),path[_0x898a('0x15')](_0x2c76b7[_0x898a('0x16')],path[_0x898a('0x17')](_0x2c76b7[_0x898a('0x16')])),Date['now'](),path[_0x898a('0x17')](_0x2c76b7['originalname'])));}})});router[_0x898a('0x18')]('/',upload['single'](_0x898a('0x19')),controller['upload']);router[_0x898a('0x18')]('/webhook',controller[_0x898a('0x1a')]);router[_0x898a('0x1b')](_0x898a('0xd'),auth['isAuthenticated'](),controller[_0x898a('0x1c')]);router['delete']('/:id',auth[_0x898a('0xb')](),controller[_0x898a('0x1d')]);module['exports']=router; \ No newline at end of file +var _0x00bb=['upload','post','put','delete','multer','util','path','express','fs-extra','../../components/auth/service','../../config/environment','./plugin.controller','get','/webhook','webhookGet','/:id','isAuthenticated','/:id/download','download','diskStorage','originalname','replace','%s-%s%s','basename','extname','file'];(function(_0x4f0ff1,_0x21932a){var _0x19c273=function(_0x5b4aca){while(--_0x5b4aca){_0x4f0ff1['push'](_0x4f0ff1['shift']());}};_0x19c273(++_0x21932a);}(_0x00bb,0x1d8));var _0xb00b=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x00bb[_0x397e5f];return _0x5302b8;};'use strict';var multer=require(_0xb00b('0x0'));var util=require(_0xb00b('0x1'));var path=require(_0xb00b('0x2'));var timeout=require('connect-timeout');var express=require(_0xb00b('0x3'));var router=express['Router']();var fs_extra=require(_0xb00b('0x4'));var auth=require(_0xb00b('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xb00b('0x6'));var controller=require(_0xb00b('0x7'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0xb00b('0x8')](_0xb00b('0x9'),controller[_0xb00b('0xa')]);router[_0xb00b('0x8')](_0xb00b('0xb'),auth[_0xb00b('0xc')](),controller['show']);router['get'](_0xb00b('0xd'),auth[_0xb00b('0xc')](),controller[_0xb00b('0xe')]);var upload=multer({'storage':multer[_0xb00b('0xf')]({'destination':function(_0x28d3cc,_0x48e125,_0x3182db){_0x3182db(null,path['join'](config['root'],'server/files/plugins'));},'filename':function(_0x4ff792,_0x2d8ddf,_0x1be8aa){_0x2d8ddf[_0xb00b('0x10')]=_0x2d8ddf[_0xb00b('0x10')][_0xb00b('0x11')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x1be8aa(null,util['format'](_0xb00b('0x12'),path[_0xb00b('0x13')](_0x2d8ddf['originalname'],path[_0xb00b('0x14')](_0x2d8ddf[_0xb00b('0x10')])),Date['now'](),path['extname'](_0x2d8ddf[_0xb00b('0x10')])));}})});router['post']('/',upload['single'](_0xb00b('0x15')),controller[_0xb00b('0x16')]);router[_0xb00b('0x17')](_0xb00b('0x9'),controller['webhookPost']);router[_0xb00b('0x18')]('/:id',auth[_0xb00b('0xc')](),controller['update']);router[_0xb00b('0x19')]('/:id',auth[_0xb00b('0xc')](),controller[_0xb00b('0x19')]);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 1e42f3b..39ffb9e 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 _0x7ad6=['Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.','ENUM','adminOnly','always','never','Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.','sequelize','exports','script','TEXT','STRING','BOOLEAN'];(function(_0x45e98e,_0x169b60){var _0x374dba=function(_0x597612){while(--_0x597612){_0x45e98e['push'](_0x45e98e['shift']());}};_0x374dba(++_0x169b60);}(_0x7ad6,0x11a));var _0x67ad=function(_0x30ae5e,_0x391fc4){_0x30ae5e=_0x30ae5e-0x0;var _0x1f2e93=_0x7ad6[_0x30ae5e];return _0x1f2e93;};'use strict';var Sequelize=require(_0x67ad('0x0'));module[_0x67ad('0x1')]={'name':{'type':Sequelize['STRING']},'type':{'type':Sequelize['ENUM']('html',_0x67ad('0x2'))},'description':{'type':Sequelize[_0x67ad('0x3')]},'version':{'type':Sequelize[_0x67ad('0x3')]},'path':{'type':Sequelize[_0x67ad('0x4')],'comment':'The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.'},'active':{'type':Sequelize[_0x67ad('0x5')],'defaultValue':0x0,'comment':_0x67ad('0x6')},'sidebar':{'type':Sequelize[_0x67ad('0x7')](_0x67ad('0x8'),'agentOnly',_0x67ad('0x9'),_0x67ad('0xa')),'defaultValue':_0x67ad('0x9'),'comment':_0x67ad('0xb')},'icon':{'type':Sequelize[_0x67ad('0x4')]},'adminUrl':{'type':Sequelize[_0x67ad('0x4')]},'agentUrl':{'type':Sequelize[_0x67ad('0x4')]},'scriptName':{'type':Sequelize[_0x67ad('0x4')]},'scriptPath':{'type':Sequelize[_0x67ad('0x4')]}}; \ No newline at end of file +var _0x700e=['Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.','adminOnly','agentOnly','always','never','Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.','STRING','sequelize','ENUM','script','TEXT','BOOLEAN'];(function(_0x1cd47d,_0x55bc75){var _0x29d52f=function(_0x37737a){while(--_0x37737a){_0x1cd47d['push'](_0x1cd47d['shift']());}};_0x29d52f(++_0x55bc75);}(_0x700e,0x17b));var _0xe700=function(_0x1314dd,_0x1a5016){_0x1314dd=_0x1314dd-0x0;var _0x5b6977=_0x700e[_0x1314dd];return _0x5b6977;};'use strict';var Sequelize=require(_0xe700('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xe700('0x1')]('html',_0xe700('0x2'))},'description':{'type':Sequelize[_0xe700('0x3')]},'version':{'type':Sequelize[_0xe700('0x3')]},'path':{'type':Sequelize['STRING'],'comment':'The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.'},'active':{'type':Sequelize[_0xe700('0x4')],'defaultValue':0x0,'comment':_0xe700('0x5')},'sidebar':{'type':Sequelize[_0xe700('0x1')](_0xe700('0x6'),_0xe700('0x7'),_0xe700('0x8'),_0xe700('0x9')),'defaultValue':_0xe700('0x8'),'comment':_0xe700('0xa')},'icon':{'type':Sequelize[_0xe700('0xb')]},'adminUrl':{'type':Sequelize[_0xe700('0xb')]},'agentUrl':{'type':Sequelize['STRING']},'scriptName':{'type':Sequelize[_0xe700('0xb')]},'scriptPath':{'type':Sequelize[_0xe700('0xb')]}}; \ No newline at end of file diff --git a/server/api/plugin/plugin.controller.js b/server/api/plugin/plugin.controller.js index b210263..02dff5d 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 _0x66c6=['resolve','port','\x27PORT\x27\x20parameter\x20not\x20specified','hostname','http://localhost:','encoding','%s%s','headers','content-length','content-type','endsWith','download','statusCode','webhookPost','eml-format','zip-dir','fast-json-patch','moment','mustache','util','path','fs-extra','lodash','squel','crypto','to-csv','querystring','extract-zip','archiver','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','register','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','Plugins','UserProfileResource','name','send','map','Plugin','rawAttributes','fieldName','type','key','model','query','intersection','attributes','fields','length','nolimit','where','filters','pick','filter','VIRTUAL','merge','include','findAll','rows','catch','show','params','keys','includeAll','options','find','join','server/files/plugins','format','basename','createWriteStream','warning','ENOENT','error','Error','Error\x20while\x20generating\x20the\x20zip\x20archive','Sequelize','pipe','root','dirname','node_modules/**/*','attachments/**/*','finalize','close','existsSync','%s.zip','Error\x20while\x20downloading\x20the\x20plugin','unlinkSync','info','Temporary\x20file\x20removed','upload','file','extname','filename','Plugin\x20upload\x20filepath:\x20%s','Plugin\x20upload\x20destination:\x20%s','chmodSync','readdirSync','Invalid\x20plugin\x20structure','lstatSync','isDirectory','some','Plugin\x20manifest\x20missing','readFileSync','manifest.json','Invalid\x20manifest:\x20name\x20missing','Invalid\x20manifest:\x20type\x20missing','version','Invalid\x20manifest:\x20version\x20not\x20specified','parameters','html','views','Invalid\x20manifest:\x20views\x20missing','agent','Invalid\x20manifest:\x20no\x20view\x20specified','Invalid\x20manifest:\x20script\x20name\x20missing','scriptPath','Invalid\x20manifest:\x20script\x20path\x20missing','Invalid\x20manifest:\x20invalid\x20type','sidebar','always','icon','icon-apps','admin','Warning:\x20admin\x20view\x20not\x20specified','script','scriptName','test','plugins','create','role','body','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','get','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','Zip\x20archive\x20removed','delete','webhookGet'];(function(_0x419c82,_0x41c464){var _0x270458=function(_0x3cbba0){while(--_0x3cbba0){_0x419c82['push'](_0x419c82['shift']());}};_0x270458(++_0x41c464);}(_0x66c6,0xb4));var _0x666c=function(_0x2da71d,_0x34f66b){_0x2da71d=_0x2da71d-0x0;var _0x16c334=_0x66c6[_0x2da71d];return _0x16c334;};'use strict';var emlformat=require(_0x666c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x666c('0x1'));var jsonpatch=require(_0x666c('0x2'));var rp=require('request-promise');var moment=require(_0x666c('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x666c('0x4'));var util=require(_0x666c('0x5'));var path=require(_0x666c('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x666c('0x7'));var _=require(_0x666c('0x8'));var squel=require(_0x666c('0x9'));var crypto=require(_0x666c('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x666c('0xb'));var querystring=require(_0x666c('0xc'));var Papa=require('papaparse');var extract=require(_0x666c('0xd'));var rimraf=require('rimraf');var archiver=require(_0x666c('0xe'));var Redis=require(_0x666c('0xf'));var authService=require(_0x666c('0x10'));var qs=require(_0x666c('0x11'));var as=require(_0x666c('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x666c('0x13'))('api');var utils=require(_0x666c('0x14'));var config=require(_0x666c('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x666c('0x16'))['db'];config['redis']=_[_0x666c('0x17')](config[_0x666c('0x18')],{'host':_0x666c('0x19'),'port':0x18eb});var socket=require(_0x666c('0x1a'))(new Redis(config[_0x666c('0x18')]));require('./plugin.socket')[_0x666c('0x1b')](socket);function respondWithStatusCode(_0x49bfea,_0x3eee37){_0x3eee37=_0x3eee37||0xcc;return function(_0x3e0b83){if(_0x3e0b83){return _0x49bfea[_0x666c('0x1c')](_0x3eee37);}return _0x49bfea[_0x666c('0x1d')](_0x3eee37)[_0x666c('0x1e')]();};}function respondWithResult(_0x18c9cb,_0x404ed8){_0x404ed8=_0x404ed8||0xc8;return function(_0x40f384){if(_0x40f384){return _0x18c9cb[_0x666c('0x1d')](_0x404ed8)[_0x666c('0x1f')](_0x40f384);}};}function respondWithFilteredResult(_0x13385f,_0x4e2c1c){return function(_0x201c97){if(_0x201c97){var _0x39a0c5=typeof _0x4e2c1c[_0x666c('0x20')]===_0x666c('0x21')&&typeof _0x4e2c1c[_0x666c('0x22')]===_0x666c('0x21');var _0x5aa63a=_0x201c97['count'];var _0x200850=_0x39a0c5?0x0:_0x4e2c1c[_0x666c('0x20')];var _0x3d41d9=_0x39a0c5?_0x201c97[_0x666c('0x23')]:_0x4e2c1c['offset']+_0x4e2c1c['limit'];var _0x5e09ae;if(_0x3d41d9>=_0x5aa63a){_0x3d41d9=_0x5aa63a;_0x5e09ae=0xc8;}else{_0x5e09ae=0xce;}_0x13385f[_0x666c('0x1d')](_0x5e09ae);return _0x13385f['set'](_0x666c('0x24'),_0x200850+'-'+_0x3d41d9+'/'+_0x5aa63a)[_0x666c('0x1f')](_0x201c97);}return null;};}function patchUpdates(_0x40c16c){return function(_0x4a4c82){try{jsonpatch[_0x666c('0x25')](_0x4a4c82,_0x40c16c,!![]);}catch(_0xa01392){return BPromise[_0x666c('0x26')](_0xa01392);}return _0x4a4c82[_0x666c('0x27')]();};}function saveUpdates(_0x35bcfd,_0x287d73){return function(_0x4caa32){if(_0x4caa32){return _0x4caa32[_0x666c('0x28')](_0x35bcfd)[_0x666c('0x29')](function(_0xe460d8){return _0xe460d8;});}return null;};}function removeEntity(_0x5e42be,_0x367f8a){return function(_0x1450cd){if(_0x1450cd){return _0x1450cd[_0x666c('0x2a')]()[_0x666c('0x29')](function(){var _0x228047=_0x1450cd['get']({'plain':!![]});var _0x373fb2=_0x666c('0x2b');return db[_0x666c('0x2c')][_0x666c('0x2a')]({'where':{'type':_0x373fb2,'resourceId':_0x228047['id']}})[_0x666c('0x29')](function(){return _0x1450cd;});})[_0x666c('0x29')](function(){_0x5e42be['status'](0xcc)[_0x666c('0x1e')]();});}};}function handleEntityNotFound(_0x542287,_0x28011a){return function(_0x46d74d){if(!_0x46d74d){_0x542287['sendStatus'](0x194);}return _0x46d74d;};}function handleError(_0x81d86b,_0x45a780){_0x45a780=_0x45a780||0x1f4;return function(_0x2f5e5e){logger['error'](_0x2f5e5e['stack']);if(_0x2f5e5e[_0x666c('0x2d')]){delete _0x2f5e5e[_0x666c('0x2d')];}_0x81d86b[_0x666c('0x1d')](_0x45a780)[_0x666c('0x2e')](_0x2f5e5e);};}exports['index']=function(_0x176b2c,_0x1d2366){var _0x4715e1={},_0x541dde={},_0x42c4d5={'count':0x0,'rows':[]};var _0x29e21a=_[_0x666c('0x2f')](db[_0x666c('0x30')][_0x666c('0x31')],function(_0x57da84){return{'name':_0x57da84[_0x666c('0x32')],'type':_0x57da84[_0x666c('0x33')][_0x666c('0x34')]};});_0x541dde[_0x666c('0x35')]=_['map'](_0x29e21a,'name');_0x541dde[_0x666c('0x36')]=_['keys'](_0x176b2c['query']);_0x541dde['filters']=_[_0x666c('0x37')](_0x541dde[_0x666c('0x35')],_0x541dde[_0x666c('0x36')]);_0x4715e1[_0x666c('0x38')]=_[_0x666c('0x37')](_0x541dde[_0x666c('0x35')],qs[_0x666c('0x39')](_0x176b2c[_0x666c('0x36')][_0x666c('0x39')]));_0x4715e1['attributes']=_0x4715e1['attributes'][_0x666c('0x3a')]?_0x4715e1[_0x666c('0x38')]:_0x541dde['model'];if(!_0x176b2c[_0x666c('0x36')]['hasOwnProperty'](_0x666c('0x3b'))){_0x4715e1[_0x666c('0x22')]=qs[_0x666c('0x22')](_0x176b2c[_0x666c('0x36')]['limit']);_0x4715e1[_0x666c('0x20')]=qs[_0x666c('0x20')](_0x176b2c['query'][_0x666c('0x20')]);}_0x4715e1['order']=qs['sort'](_0x176b2c[_0x666c('0x36')]['sort']);_0x4715e1[_0x666c('0x3c')]=qs[_0x666c('0x3d')](_[_0x666c('0x3e')](_0x176b2c['query'],_0x541dde[_0x666c('0x3d')]),_0x29e21a);if(_0x176b2c[_0x666c('0x36')][_0x666c('0x3f')]){_0x4715e1[_0x666c('0x3c')]=_['merge'](_0x4715e1['where'],{'$or':_[_0x666c('0x2f')](_0x29e21a,function(_0x5bd7b5){if(_0x5bd7b5[_0x666c('0x33')]!==_0x666c('0x40')){var _0x43fc34={};_0x43fc34[_0x5bd7b5[_0x666c('0x2d')]]={'$like':'%'+_0x176b2c[_0x666c('0x36')][_0x666c('0x3f')]+'%'};return _0x43fc34;}})});}_0x4715e1=_[_0x666c('0x41')]({},_0x4715e1,_0x176b2c['options']);var _0x72851e={'where':_0x4715e1[_0x666c('0x3c')]};return db[_0x666c('0x30')][_0x666c('0x23')](_0x72851e)[_0x666c('0x29')](function(_0x3371ef){_0x42c4d5['count']=_0x3371ef;if(_0x176b2c[_0x666c('0x36')]['includeAll']){_0x4715e1[_0x666c('0x42')]=[{'all':!![]}];}return db[_0x666c('0x30')][_0x666c('0x43')](_0x4715e1);})['then'](function(_0x9f5bde){_0x42c4d5[_0x666c('0x44')]=_0x9f5bde;return _0x42c4d5;})[_0x666c('0x29')](respondWithFilteredResult(_0x1d2366,_0x4715e1))[_0x666c('0x45')](handleError(_0x1d2366,null));};exports[_0x666c('0x46')]=function(_0xe2294e,_0x4327ad){var _0x3b8e3c={'raw':!![],'where':{'id':_0xe2294e[_0x666c('0x47')]['id']}},_0x2063b7={};_0x2063b7[_0x666c('0x35')]=_[_0x666c('0x48')](db[_0x666c('0x30')][_0x666c('0x31')]);_0x2063b7[_0x666c('0x36')]=_[_0x666c('0x48')](_0xe2294e[_0x666c('0x36')]);_0x2063b7[_0x666c('0x3d')]=_['intersection'](_0x2063b7[_0x666c('0x35')],_0x2063b7['query']);_0x3b8e3c[_0x666c('0x38')]=_[_0x666c('0x37')](_0x2063b7[_0x666c('0x35')],qs[_0x666c('0x39')](_0xe2294e[_0x666c('0x36')][_0x666c('0x39')]));_0x3b8e3c[_0x666c('0x38')]=_0x3b8e3c['attributes']['length']?_0x3b8e3c[_0x666c('0x38')]:_0x2063b7[_0x666c('0x35')];if(_0xe2294e[_0x666c('0x36')][_0x666c('0x49')]){_0x3b8e3c['include']=[{'all':!![]}];}_0x3b8e3c=_[_0x666c('0x41')]({},_0x3b8e3c,_0xe2294e[_0x666c('0x4a')]);return db[_0x666c('0x30')]['find'](_0x3b8e3c)['then'](handleEntityNotFound(_0x4327ad,null))[_0x666c('0x29')](respondWithResult(_0x4327ad,null))[_0x666c('0x45')](handleError(_0x4327ad,null));};exports['download']=function(_0x1c7d53,_0x2faaeb,_0x20eef6){return db[_0x666c('0x30')][_0x666c('0x4b')]({'where':{'id':_0x1c7d53['params']['id']},'attributes':['name',_0x666c('0x6')],'raw':!![]})['then'](handleEntityNotFound(_0x2faaeb,null))[_0x666c('0x29')](function(_0x20c937){if(_0x20c937){var _0x3a7261=path[_0x666c('0x4c')](config['root'],_0x666c('0x4d'),util[_0x666c('0x4e')]('%s.zip',path[_0x666c('0x4f')](_0x20c937[_0x666c('0x6')])));var _0x2d2a72=fs[_0x666c('0x50')](_0x3a7261);var _0x3ee540=archiver('zip',{'zlib':{'level':0x9}});_0x3ee540['on'](_0x666c('0x51'),function(_0x555d8f){if(_0x555d8f['code']===_0x666c('0x52')){logger[_0x666c('0x53')](_0x555d8f);}else{throw new db['Sequelize'][(_0x666c('0x54'))](_0x666c('0x55'));}});_0x3ee540['on'](_0x666c('0x53'),function(_0x28b2e1){throw new db[(_0x666c('0x56'))]['Error'](_0x666c('0x55'));});_0x3ee540[_0x666c('0x57')](_0x2d2a72);_0x3ee540['glob']('**/*',{'cwd':path[_0x666c('0x4c')](config[_0x666c('0x58')],_0x666c('0x4d'),path[_0x666c('0x59')](_0x20c937[_0x666c('0x6')])),'ignore':[path[_0x666c('0x4c')](path[_0x666c('0x4f')](_0x20c937['path']),_0x666c('0x5a')),path['join'](path[_0x666c('0x4f')](_0x20c937[_0x666c('0x6')]),_0x666c('0x5b'))],'nodir':!![]})[_0x666c('0x5c')]();_0x2d2a72['on'](_0x666c('0x5d'),function(){if(!fs[_0x666c('0x5e')](_0x3a7261)){throw new db[(_0x666c('0x56'))][(_0x666c('0x54'))]('Plugin\x20not\x20found');}return _0x2faaeb['download'](_0x3a7261,util['format'](_0x666c('0x5f'),path['basename'](_0x20c937[_0x666c('0x6')])),function(_0x5e2821){if(_0x5e2821){throw new db[(_0x666c('0x56'))]['Error'](_0x666c('0x60'));}fs[_0x666c('0x61')](_0x3a7261);logger['info']('Download\x20completed');logger[_0x666c('0x62')](_0x666c('0x63'));});});}return null;})[_0x666c('0x45')](handleError(_0x2faaeb,null));};exports[_0x666c('0x64')]=function(_0x2c014a,_0x16e63f,_0xb151a9){var _0x2212b7=path[_0x666c('0x4f')](_0x2c014a[_0x666c('0x65')]['filename'],path[_0x666c('0x66')](_0x2c014a[_0x666c('0x65')][_0x666c('0x67')]));var _0x33788a=path['join'](config[_0x666c('0x58')],_0x666c('0x4d'),_0x2c014a[_0x666c('0x65')][_0x666c('0x67')]);var _0x5d459d=path[_0x666c('0x4c')](config['root'],'server/files/plugins',_0x2212b7);logger[_0x666c('0x62')](_0x666c('0x68'),_0x33788a);logger[_0x666c('0x62')](_0x666c('0x69'),_0x5d459d);try{fs[_0x666c('0x6a')](_0x33788a,parseInt('0777',0x8));extract(_0x33788a,{'dir':_0x5d459d},function(_0x14b07b){if(_0x14b07b){logger[_0x666c('0x53')](_0x14b07b);handleError(_0x14b07b,!![]);};var _0x447502=fs[_0x666c('0x6b')](_0x5d459d);if(_0x447502[_0x666c('0x3a')]>0x1){removeReferences(_0x33788a,_0x5d459d);logger['error'](_0x666c('0x6c'));return _0xb151a9(new Error(_0x666c('0x6c')));}var _0x151800=fs[_0x666c('0x6d')](path[_0x666c('0x4c')](_0x5d459d,_0x447502[0x0]));if(_0x151800['isFile']()){removeReferences(_0x33788a,_0x5d459d);logger[_0x666c('0x53')](_0x666c('0x6c'));return _0xb151a9(new Error(_0x666c('0x6c')));}if(_0x151800[_0x666c('0x6e')]()){var _0x2433ac=fs[_0x666c('0x6b')](path[_0x666c('0x4c')](_0x5d459d,_0x447502[0x0]));if(_0x2433ac['length']===0x0){removeReferences(_0x33788a,_0x5d459d);logger[_0x666c('0x53')](_0x666c('0x6c'));return _0xb151a9(new Error(_0x666c('0x6c')));}var _0x344f12=_0x2433ac[_0x666c('0x6f')](function(_0x25b032){return _0x25b032==='manifest.json';});if(!_0x344f12){return _0xb151a9(new Error(_0x666c('0x70')));}var _0xef2309=fs[_0x666c('0x71')](path[_0x666c('0x4c')](_0x5d459d,_0x447502[0x0],_0x666c('0x72')));var _0x293464=JSON['parse'](_0xef2309);if(_0x666c('0x21')==typeof _0x293464[_0x666c('0x2d')]){return _0xb151a9(new Error(_0x666c('0x73')));}if(_0x666c('0x21')==typeof _0x293464[_0x666c('0x33')]){return _0xb151a9(new Error(_0x666c('0x74')));}if('undefined'==typeof _0x293464[_0x666c('0x75')]){return _0xb151a9(new Error(_0x666c('0x76')));}if(_0x666c('0x21')==typeof _0x293464[_0x666c('0x77')]){return _0xb151a9(new Error('Invalid\x20manifest:\x20parameters\x20missing'));}if(_0x293464['type']===_0x666c('0x78')){if(_0x666c('0x21')==typeof _0x293464[_0x666c('0x77')][_0x666c('0x79')]){return _0xb151a9(new Error(_0x666c('0x7a')));}if(_0x666c('0x21')==typeof _0x293464[_0x666c('0x77')][_0x666c('0x79')]['admin']&&_0x666c('0x21')==typeof _0x293464[_0x666c('0x77')][_0x666c('0x79')][_0x666c('0x7b')]){return _0xb151a9(new Error(_0x666c('0x7c')));}}else if(_0x293464[_0x666c('0x33')]==='script'){if('undefined'==typeof _0x293464[_0x666c('0x77')]['scriptName']){return _0xb151a9(new Error(_0x666c('0x7d')));}if(_0x666c('0x21')==typeof _0x293464['parameters'][_0x666c('0x7e')]){return _0xb151a9(new Error(_0x666c('0x7f')));}}else{return _0xb151a9(new Error(_0x666c('0x80')));}var _0x366daa=_0x293464[_0x666c('0x2d')];var _0x414aec=_0x293464['description'];var _0x241071=_0x293464[_0x666c('0x33')];var _0x1225d1=_0x293464[_0x666c('0x81')]?_0x293464[_0x666c('0x81')]:_0x666c('0x82');var _0x429f2c=_0x293464[_0x666c('0x83')]?_0x293464['icon']:_0x666c('0x84');var _0x4f6e47='';var _0x36cfba='';var _0x55fe32='';var _0x246739='';var _0x37c00d=_0x293464[_0x666c('0x75')];if(_0x241071==='html'){if(_0x666c('0x21')!=typeof _0x293464[_0x666c('0x77')]['views']['admin']){var _0x270ed5=_0x293464[_0x666c('0x77')][_0x666c('0x79')][_0x666c('0x85')];if(!/^(f|ht)tps?:\/\//i['test'](_0x270ed5)){_0x4f6e47=path[_0x666c('0x4c')]('plugins',_0x2212b7,_0x447502[0x0],_0x270ed5);}else{_0x4f6e47=_0x270ed5;}}else{logger['info'](_0x666c('0x86'));}if(_0x666c('0x21')!=typeof _0x293464[_0x666c('0x77')][_0x666c('0x79')]['agent']){var _0x14ac99=_0x293464['parameters'][_0x666c('0x79')][_0x666c('0x7b')];if(!/^(f|ht)tps?:\/\//i['test'](_0x14ac99)){_0x36cfba=path['join']('plugins',_0x2212b7,_0x447502[0x0],_0x14ac99);}else{_0x36cfba=_0x14ac99;}}else{logger['info']('Warning:\x20agent\x20view\x20not\x20specified');}}else if(_0x241071===_0x666c('0x87')){_0x55fe32=_0x293464[_0x666c('0x77')][_0x666c('0x88')];_0x246739=_0x293464['parameters'][_0x666c('0x7e')];if('undefined'!=typeof _0x293464[_0x666c('0x77')]['views']){if('undefined'!=typeof _0x293464[_0x666c('0x77')][_0x666c('0x79')][_0x666c('0x85')]){var _0x270ed5=_0x293464[_0x666c('0x77')][_0x666c('0x79')][_0x666c('0x85')];if(!/^(f|ht)tps?:\/\//i[_0x666c('0x89')](_0x270ed5)){_0x4f6e47=path[_0x666c('0x4c')](_0x666c('0x8a'),_0x2212b7,_0x447502[0x0],_0x270ed5);}else{_0x4f6e47=_0x270ed5;}}if(_0x666c('0x21')!=typeof _0x293464['parameters'][_0x666c('0x79')]['agent']){var _0x14ac99=_0x293464['parameters'][_0x666c('0x79')]['agent'];if(!/^(f|ht)tps?:\/\//i[_0x666c('0x89')](_0x14ac99)){_0x36cfba=path[_0x666c('0x4c')](_0x666c('0x8a'),_0x2212b7,_0x447502[0x0],_0x14ac99);}else{_0x36cfba=_0x14ac99;}}}}var _0x27fc58={'name':_0x366daa,'description':_0x414aec,'path':path[_0x666c('0x4c')](_0x2212b7,_0x447502[0x0]),'type':_0x241071,'sidebar':_0x1225d1,'icon':_0x429f2c,'adminUrl':_0x4f6e47,'agentUrl':_0x36cfba,'scriptName':_0x55fe32,'scriptPath':_0x246739,'version':_0x37c00d};removeReferences(_0x33788a,null);return db[_0x666c('0x30')][_0x666c('0x8b')](_0x27fc58)[_0x666c('0x29')](function(_0x2f9e6e){var _0x1fdc69={'role':_0x2c014a['body'][_0x666c('0x8c')],'userProfileId':_0x2c014a[_0x666c('0x8d')][_0x666c('0x8e')]};if(!_0x1fdc69)throw new Error(_0x666c('0x8f'));if(_0x1fdc69[_0x666c('0x8c')]===_0x666c('0x90')){var _0x42095b=_0x2f9e6e[_0x666c('0x91')]({'plain':!![]});return db[_0x666c('0x92')]['find']({'where':{'name':_0x666c('0x2b'),'userProfileId':_0x1fdc69[_0x666c('0x8e')]},'raw':!![]})[_0x666c('0x29')](function(_0x288319){if(_0x288319&&_0x288319[_0x666c('0x93')]===0x0){return db['UserProfileResource'][_0x666c('0x8b')]({'name':_0x42095b[_0x666c('0x2d')],'resourceId':_0x42095b['id'],'type':_0x288319[_0x666c('0x2d')],'sectionId':_0x288319['id']},{})['then'](function(){return _0x2f9e6e;});}else{return _0x2f9e6e;}})[_0x666c('0x45')](function(_0x1e4d0d){logger['error'](_0x666c('0x94'),_0x1e4d0d);throw _0x1e4d0d;});}return _0x2f9e6e;})[_0x666c('0x29')](respondWithResult(_0x16e63f,null))['catch'](handleError(_0x16e63f,null));}});}catch(_0x59b71e){_0x16e63f[_0x666c('0x1d')](0x1f4)[_0x666c('0x2e')](_0x59b71e);}};function removeReferences(_0x59c382,_0x15857d){try{if(_0x59c382){fs[_0x666c('0x61')](_0x59c382);logger[_0x666c('0x62')](_0x666c('0x95'));}if(_0x15857d){rimraf(_0x15857d,function(){});logger[_0x666c('0x62')]('Extracted\x20folder\x20removed');}}catch(_0x1f61f8){logger['error'](_0x1f61f8);}}exports[_0x666c('0x28')]=function(_0x236dad,_0x22c9c9,_0xc0805b){return db[_0x666c('0x30')][_0x666c('0x4b')]({'where':{'id':_0x236dad[_0x666c('0x47')]['id']}})[_0x666c('0x29')](handleEntityNotFound(_0x22c9c9,null))[_0x666c('0x29')](saveUpdates(_0x236dad[_0x666c('0x8d')],null))[_0x666c('0x29')](respondWithResult(_0x22c9c9,null))['catch'](handleError(_0x22c9c9,null));};exports[_0x666c('0x96')]=function(_0x3a066c,_0x4c0b32,_0x1e965e){return db[_0x666c('0x30')][_0x666c('0x4b')]({'where':{'id':_0x3a066c['params']['id']}})[_0x666c('0x29')](function(_0x2fcba9){if(_0x2fcba9){return _0x2fcba9['destroy']();}})[_0x666c('0x29')](function(_0x5e358e){rimraf(path['join'](config[_0x666c('0x58')],_0x666c('0x4d'),path[_0x666c('0x59')](_0x5e358e[_0x666c('0x6')])),function(){});return _0x5e358e;})[_0x666c('0x29')](handleEntityNotFound(_0x4c0b32,null))[_0x666c('0x29')](respondWithStatusCode(_0x4c0b32,null))[_0x666c('0x45')](handleError(_0x4c0b32,null));};exports[_0x666c('0x97')]=function(_0x2c0e48,_0x50ba81,_0x43112f){return BPromise[_0x666c('0x98')]()[_0x666c('0x29')](function(){if(!_0x2c0e48[_0x666c('0x36')]['path']){throw new Error('\x27PATH\x27\x20parameter\x20not\x20specified');}if(!_0x2c0e48[_0x666c('0x36')][_0x666c('0x99')]){throw new Error(_0x666c('0x9a'));}var _0x2d1b70=_0x2c0e48[_0x666c('0x36')]['hostname']?_0x2c0e48[_0x666c('0x36')][_0x666c('0x9b')]+':'+_0x2c0e48[_0x666c('0x36')]['port']:_0x666c('0x9c')+_0x2c0e48[_0x666c('0x36')]['port'];var _0x3faf28=_0x2c0e48['query'][_0x666c('0x1f')]?_0x2c0e48['query'][_0x666c('0x1f')]:!![];var _0x47962b=_0x2c0e48['query'][_0x666c('0x9d')]?_0x2c0e48[_0x666c('0x36')]['encoding']:null;var _0x391de4={'method':_0x2c0e48['method'],'uri':util[_0x666c('0x4e')](_0x666c('0x9e'),_0x2d1b70,_0x2c0e48['query'][_0x666c('0x6')]),'json':_0x3faf28,'resolveWithFullResponse':!![],'encoding':_0x47962b,'qs':_0x2c0e48[_0x666c('0x36')]};if(_0x2c0e48[_0x666c('0x9f')]){_0x391de4[_0x666c('0x9f')]=_0x2c0e48['headers'];if(_0x391de4[_0x666c('0x9f')][_0x666c('0xa0')]){delete _0x391de4['headers'][_0x666c('0xa0')];}}if(_0x391de4['headers'][_0x666c('0xa1')]){delete _0x391de4[_0x666c('0x9f')][_0x666c('0xa1')];}return rp(_0x391de4);})[_0x666c('0x29')](function(_0x39a31d){if(_0x39a31d){_0x50ba81['set'](_0x39a31d[_0x666c('0x9f')]);logger[_0x666c('0x62')](_0x39a31d[_0x666c('0x8d')]);if(_[_0x666c('0xa2')](_0x2c0e48[_0x666c('0x36')][_0x666c('0x6')],_0x666c('0xa3'))&&_0x39a31d[_0x666c('0xa4')]==0x1f4){return _0x50ba81[_0x666c('0x1c')](_0x39a31d[_0x666c('0xa4')]);}else{return _0x50ba81[_0x666c('0x1d')](_0x39a31d[_0x666c('0xa4')])['send'](_0x39a31d[_0x666c('0x8d')]);}}else{return _0x50ba81[_0x666c('0x1c')](0xc8);}})[_0x666c('0x45')](handleError(_0x50ba81,null));};exports[_0x666c('0xa5')]=function(_0x3836fb,_0x5022ed,_0x4ef753){return BPromise[_0x666c('0x98')]()[_0x666c('0x29')](function(){if(!_0x3836fb[_0x666c('0x36')][_0x666c('0x6')]){throw new Error('\x27PATH\x27\x20parameter\x20not\x20specified');}if(!_0x3836fb[_0x666c('0x36')]['port']){throw new Error(_0x666c('0x9a'));}var _0x7cfa6=_0x3836fb[_0x666c('0x36')][_0x666c('0x9b')]?_0x3836fb[_0x666c('0x36')][_0x666c('0x9b')]+':'+_0x3836fb[_0x666c('0x36')][_0x666c('0x99')]:_0x666c('0x9c')+_0x3836fb['query']['port'];var _0x1f134c=_0x3836fb[_0x666c('0x36')]['json']?_0x3836fb['query'][_0x666c('0x1f')]:!![];var _0x365c26=_0x3836fb[_0x666c('0x36')][_0x666c('0x9d')]?_0x3836fb[_0x666c('0x36')][_0x666c('0x9d')]:null;var _0x5ec2e9={'method':_0x3836fb['method'],'uri':util[_0x666c('0x4e')](_0x666c('0x9e'),_0x7cfa6,_0x3836fb['query'][_0x666c('0x6')]),'json':_0x1f134c,'resolveWithFullResponse':!![],'encoding':_0x365c26,'body':_0x3836fb[_0x666c('0x8d')]};if(_0x3836fb[_0x666c('0x9f')]){_0x5ec2e9['headers']=_0x3836fb[_0x666c('0x9f')];if(_0x5ec2e9['headers']['content-length']){delete _0x5ec2e9[_0x666c('0x9f')][_0x666c('0xa0')];}}if(_0x5ec2e9[_0x666c('0x9f')][_0x666c('0xa1')]){delete _0x5ec2e9[_0x666c('0x9f')][_0x666c('0xa1')];}return rp(_0x5ec2e9);})[_0x666c('0x29')](function(_0x2aaf80){if(_0x2aaf80){_0x5022ed['set'](_0x2aaf80[_0x666c('0x9f')]);logger[_0x666c('0x62')](_0x2aaf80['body']);return _0x5022ed[_0x666c('0x1d')](_0x2aaf80[_0x666c('0xa4')])[_0x666c('0x2e')](_0x2aaf80[_0x666c('0x8d')]);}else{return _0x5022ed[_0x666c('0x1c')](0xc8);}})[_0x666c('0x45')](handleError(_0x5022ed,null));}; \ No newline at end of file +var _0x9b85=['merge','type','VIRTUAL','options','Plugin','includeAll','include','findAll','rows','show','params','rawAttributes','length','find','catch','download','join','root','%s.zip','basename','createWriteStream','zip','warning','ENOENT','Sequelize','Error','Error\x20while\x20generating\x20the\x20zip\x20archive','glob','dirname','node_modules/**/*','attachments/**/*','finalize','existsSync','Plugin\x20not\x20found','format','unlinkSync','info','file','filename','extname','server/files/plugins','Plugin\x20upload\x20filepath:\x20%s','Plugin\x20upload\x20destination:\x20%s','chmodSync','Invalid\x20plugin\x20structure','isFile','isDirectory','readdirSync','some','readFileSync','manifest.json','parse','Invalid\x20manifest:\x20name\x20missing','Invalid\x20manifest:\x20version\x20not\x20specified','html','parameters','views','admin','Invalid\x20manifest:\x20no\x20view\x20specified','script','scriptPath','Invalid\x20manifest:\x20script\x20path\x20missing','Invalid\x20manifest:\x20invalid\x20type','description','sidebar','always','icon','icon-apps','version','test','plugins','Warning:\x20admin\x20view\x20not\x20specified','Warning:\x20agent\x20view\x20not\x20specified','scriptName','agent','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','Zip\x20archive\x20removed','Extracted\x20folder\x20removed','delete','resolve','\x27PATH\x27\x20parameter\x20not\x20specified','port','\x27PORT\x27\x20parameter\x20not\x20specified','hostname','http://localhost:','encoding','method','%s%s','headers','content-length','content-type','statusCode','webhookPost','eml-format','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','extract-zip','rimraf','archiver','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','register','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','save','update','destroy','then','Plugins','UserProfileResource','error','stack','name','send','index','fieldName','key','map','query','keys','filters','intersection','attributes','fields','model','hasOwnProperty','nolimit','order','sort','where','pick','filter'];(function(_0x5d72da,_0xb7ce32){var _0x43ebe7=function(_0x503755){while(--_0x503755){_0x5d72da['push'](_0x5d72da['shift']());}};_0x43ebe7(++_0xb7ce32);}(_0x9b85,0x10e));var _0x59b8=function(_0x31e29a,_0x349c9b){_0x31e29a=_0x31e29a-0x0;var _0x32d892=_0x9b85[_0x31e29a];return _0x32d892;};'use strict';var emlformat=require(_0x59b8('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x59b8('0x1'));var jsonpatch=require(_0x59b8('0x2'));var rp=require('request-promise');var moment=require(_0x59b8('0x3'));var BPromise=require(_0x59b8('0x4'));var Mustache=require('mustache');var util=require(_0x59b8('0x5'));var path=require(_0x59b8('0x6'));var sox=require(_0x59b8('0x7'));var csv=require(_0x59b8('0x8'));var ejs=require(_0x59b8('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x59b8('0xa'));var squel=require(_0x59b8('0xb'));var crypto=require(_0x59b8('0xc'));var jsforce=require(_0x59b8('0xd'));var deskjs=require(_0x59b8('0xe'));var toCsv=require(_0x59b8('0x8'));var querystring=require(_0x59b8('0xf'));var Papa=require(_0x59b8('0x10'));var extract=require(_0x59b8('0x11'));var rimraf=require(_0x59b8('0x12'));var archiver=require(_0x59b8('0x13'));var Redis=require('ioredis');var authService=require(_0x59b8('0x14'));var qs=require(_0x59b8('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x59b8('0x16'));var logger=require(_0x59b8('0x17'))(_0x59b8('0x18'));var utils=require('../../config/utils');var config=require(_0x59b8('0x19'));var licenseUtil=require(_0x59b8('0x1a'));var db=require(_0x59b8('0x1b'))['db'];config[_0x59b8('0x1c')]=_[_0x59b8('0x1d')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x59b8('0x1e'))(new Redis(config[_0x59b8('0x1c')]));require('./plugin.socket')[_0x59b8('0x1f')](socket);function respondWithStatusCode(_0x579525,_0x5c2d12){_0x5c2d12=_0x5c2d12||0xcc;return function(_0xbc706e){if(_0xbc706e){return _0x579525[_0x59b8('0x20')](_0x5c2d12);}return _0x579525[_0x59b8('0x21')](_0x5c2d12)[_0x59b8('0x22')]();};}function respondWithResult(_0x4e9001,_0x33a4ca){_0x33a4ca=_0x33a4ca||0xc8;return function(_0x2bdea5){if(_0x2bdea5){return _0x4e9001[_0x59b8('0x21')](_0x33a4ca)['json'](_0x2bdea5);}};}function respondWithFilteredResult(_0x33393b,_0x1c51cf){return function(_0x472f17){if(_0x472f17){var _0x3d9f46=typeof _0x1c51cf[_0x59b8('0x23')]===_0x59b8('0x24')&&typeof _0x1c51cf[_0x59b8('0x25')]===_0x59b8('0x24');var _0x5b538e=_0x472f17[_0x59b8('0x26')];var _0x3779b4=_0x3d9f46?0x0:_0x1c51cf[_0x59b8('0x23')];var _0x440d8f=_0x3d9f46?_0x472f17[_0x59b8('0x26')]:_0x1c51cf['offset']+_0x1c51cf[_0x59b8('0x25')];var _0x2e0cb7;if(_0x440d8f>=_0x5b538e){_0x440d8f=_0x5b538e;_0x2e0cb7=0xc8;}else{_0x2e0cb7=0xce;}_0x33393b[_0x59b8('0x21')](_0x2e0cb7);return _0x33393b[_0x59b8('0x27')](_0x59b8('0x28'),_0x3779b4+'-'+_0x440d8f+'/'+_0x5b538e)[_0x59b8('0x29')](_0x472f17);}return null;};}function patchUpdates(_0x50fc3a){return function(_0x3979b8){try{jsonpatch['apply'](_0x3979b8,_0x50fc3a,!![]);}catch(_0x441693){return BPromise['reject'](_0x441693);}return _0x3979b8[_0x59b8('0x2a')]();};}function saveUpdates(_0xbe7fb9,_0x4bbbb4){return function(_0x58f24c){if(_0x58f24c){return _0x58f24c[_0x59b8('0x2b')](_0xbe7fb9)['then'](function(_0x53850d){return _0x53850d;});}return null;};}function removeEntity(_0x166d68,_0x418179){return function(_0x1578a4){if(_0x1578a4){return _0x1578a4[_0x59b8('0x2c')]()[_0x59b8('0x2d')](function(){var _0xe20e11=_0x1578a4['get']({'plain':!![]});var _0x169187=_0x59b8('0x2e');return db[_0x59b8('0x2f')][_0x59b8('0x2c')]({'where':{'type':_0x169187,'resourceId':_0xe20e11['id']}})['then'](function(){return _0x1578a4;});})['then'](function(){_0x166d68[_0x59b8('0x21')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3d469c,_0x43d133){return function(_0x31e146){if(!_0x31e146){_0x3d469c['sendStatus'](0x194);}return _0x31e146;};}function handleError(_0x20ef20,_0x2c019d){_0x2c019d=_0x2c019d||0x1f4;return function(_0x550134){logger[_0x59b8('0x30')](_0x550134[_0x59b8('0x31')]);if(_0x550134['name']){delete _0x550134[_0x59b8('0x32')];}_0x20ef20[_0x59b8('0x21')](_0x2c019d)[_0x59b8('0x33')](_0x550134);};}exports[_0x59b8('0x34')]=function(_0x303292,_0x5500f6){var _0x568ca5={},_0x298a3b={},_0x5c0f2b={'count':0x0,'rows':[]};var _0x21cf24=_['map'](db['Plugin']['rawAttributes'],function(_0x342c5a){return{'name':_0x342c5a[_0x59b8('0x35')],'type':_0x342c5a['type'][_0x59b8('0x36')]};});_0x298a3b['model']=_[_0x59b8('0x37')](_0x21cf24,'name');_0x298a3b[_0x59b8('0x38')]=_[_0x59b8('0x39')](_0x303292[_0x59b8('0x38')]);_0x298a3b[_0x59b8('0x3a')]=_[_0x59b8('0x3b')](_0x298a3b['model'],_0x298a3b[_0x59b8('0x38')]);_0x568ca5[_0x59b8('0x3c')]=_[_0x59b8('0x3b')](_0x298a3b['model'],qs[_0x59b8('0x3d')](_0x303292[_0x59b8('0x38')]['fields']));_0x568ca5[_0x59b8('0x3c')]=_0x568ca5[_0x59b8('0x3c')]['length']?_0x568ca5[_0x59b8('0x3c')]:_0x298a3b[_0x59b8('0x3e')];if(!_0x303292['query'][_0x59b8('0x3f')](_0x59b8('0x40'))){_0x568ca5[_0x59b8('0x25')]=qs[_0x59b8('0x25')](_0x303292['query']['limit']);_0x568ca5[_0x59b8('0x23')]=qs[_0x59b8('0x23')](_0x303292[_0x59b8('0x38')][_0x59b8('0x23')]);}_0x568ca5[_0x59b8('0x41')]=qs[_0x59b8('0x42')](_0x303292[_0x59b8('0x38')]['sort']);_0x568ca5[_0x59b8('0x43')]=qs[_0x59b8('0x3a')](_[_0x59b8('0x44')](_0x303292['query'],_0x298a3b[_0x59b8('0x3a')]),_0x21cf24);if(_0x303292[_0x59b8('0x38')][_0x59b8('0x45')]){_0x568ca5[_0x59b8('0x43')]=_[_0x59b8('0x46')](_0x568ca5[_0x59b8('0x43')],{'$or':_[_0x59b8('0x37')](_0x21cf24,function(_0x139826){if(_0x139826[_0x59b8('0x47')]!==_0x59b8('0x48')){var _0x3b02ed={};_0x3b02ed[_0x139826[_0x59b8('0x32')]]={'$like':'%'+_0x303292[_0x59b8('0x38')][_0x59b8('0x45')]+'%'};return _0x3b02ed;}})});}_0x568ca5=_[_0x59b8('0x46')]({},_0x568ca5,_0x303292[_0x59b8('0x49')]);var _0x3b5cd8={'where':_0x568ca5[_0x59b8('0x43')]};return db[_0x59b8('0x4a')][_0x59b8('0x26')](_0x3b5cd8)[_0x59b8('0x2d')](function(_0x458918){_0x5c0f2b[_0x59b8('0x26')]=_0x458918;if(_0x303292['query'][_0x59b8('0x4b')]){_0x568ca5[_0x59b8('0x4c')]=[{'all':!![]}];}return db[_0x59b8('0x4a')][_0x59b8('0x4d')](_0x568ca5);})[_0x59b8('0x2d')](function(_0x5b3340){_0x5c0f2b[_0x59b8('0x4e')]=_0x5b3340;return _0x5c0f2b;})[_0x59b8('0x2d')](respondWithFilteredResult(_0x5500f6,_0x568ca5))['catch'](handleError(_0x5500f6,null));};exports[_0x59b8('0x4f')]=function(_0x2cd31a,_0x53ce96){var _0x36f811={'raw':!![],'where':{'id':_0x2cd31a[_0x59b8('0x50')]['id']}},_0x4ceff9={};_0x4ceff9['model']=_[_0x59b8('0x39')](db[_0x59b8('0x4a')][_0x59b8('0x51')]);_0x4ceff9[_0x59b8('0x38')]=_[_0x59b8('0x39')](_0x2cd31a[_0x59b8('0x38')]);_0x4ceff9[_0x59b8('0x3a')]=_[_0x59b8('0x3b')](_0x4ceff9[_0x59b8('0x3e')],_0x4ceff9[_0x59b8('0x38')]);_0x36f811[_0x59b8('0x3c')]=_[_0x59b8('0x3b')](_0x4ceff9[_0x59b8('0x3e')],qs[_0x59b8('0x3d')](_0x2cd31a[_0x59b8('0x38')][_0x59b8('0x3d')]));_0x36f811[_0x59b8('0x3c')]=_0x36f811[_0x59b8('0x3c')][_0x59b8('0x52')]?_0x36f811[_0x59b8('0x3c')]:_0x4ceff9[_0x59b8('0x3e')];if(_0x2cd31a[_0x59b8('0x38')][_0x59b8('0x4b')]){_0x36f811[_0x59b8('0x4c')]=[{'all':!![]}];}_0x36f811=_[_0x59b8('0x46')]({},_0x36f811,_0x2cd31a['options']);return db['Plugin'][_0x59b8('0x53')](_0x36f811)['then'](handleEntityNotFound(_0x53ce96,null))[_0x59b8('0x2d')](respondWithResult(_0x53ce96,null))[_0x59b8('0x54')](handleError(_0x53ce96,null));};exports[_0x59b8('0x55')]=function(_0x16a5ca,_0x40c864,_0x4530ac){return db[_0x59b8('0x4a')][_0x59b8('0x53')]({'where':{'id':_0x16a5ca[_0x59b8('0x50')]['id']},'attributes':['name','path'],'raw':!![]})['then'](handleEntityNotFound(_0x40c864,null))[_0x59b8('0x2d')](function(_0x2c8608){if(_0x2c8608){var _0x12769d=path[_0x59b8('0x56')](config[_0x59b8('0x57')],'server/files/plugins',util['format'](_0x59b8('0x58'),path[_0x59b8('0x59')](_0x2c8608['path'])));var _0x1d8f6b=fs[_0x59b8('0x5a')](_0x12769d);var _0x2f3528=archiver(_0x59b8('0x5b'),{'zlib':{'level':0x9}});_0x2f3528['on'](_0x59b8('0x5c'),function(_0x1adee8){if(_0x1adee8['code']===_0x59b8('0x5d')){logger[_0x59b8('0x30')](_0x1adee8);}else{throw new db[(_0x59b8('0x5e'))][(_0x59b8('0x5f'))](_0x59b8('0x60'));}});_0x2f3528['on'](_0x59b8('0x30'),function(_0x224eb8){throw new db[(_0x59b8('0x5e'))][(_0x59b8('0x5f'))](_0x59b8('0x60'));});_0x2f3528['pipe'](_0x1d8f6b);_0x2f3528[_0x59b8('0x61')]('**/*',{'cwd':path[_0x59b8('0x56')](config[_0x59b8('0x57')],'server/files/plugins',path[_0x59b8('0x62')](_0x2c8608['path'])),'ignore':[path[_0x59b8('0x56')](path[_0x59b8('0x59')](_0x2c8608[_0x59b8('0x6')]),_0x59b8('0x63')),path[_0x59b8('0x56')](path[_0x59b8('0x59')](_0x2c8608['path']),_0x59b8('0x64'))],'nodir':!![]})[_0x59b8('0x65')]();_0x1d8f6b['on']('close',function(){if(!fs[_0x59b8('0x66')](_0x12769d)){throw new db['Sequelize'][(_0x59b8('0x5f'))](_0x59b8('0x67'));}return _0x40c864['download'](_0x12769d,util[_0x59b8('0x68')]('%s.zip',path[_0x59b8('0x59')](_0x2c8608[_0x59b8('0x6')])),function(_0x13ce00){if(_0x13ce00){throw new db[(_0x59b8('0x5e'))][(_0x59b8('0x5f'))]('Error\x20while\x20downloading\x20the\x20plugin');}fs[_0x59b8('0x69')](_0x12769d);logger[_0x59b8('0x6a')]('Download\x20completed');logger[_0x59b8('0x6a')]('Temporary\x20file\x20removed');});});}return null;})[_0x59b8('0x54')](handleError(_0x40c864,null));};exports['upload']=function(_0x4be1b0,_0x2dd9d1,_0x53b001){var _0x1d56ec=path['basename'](_0x4be1b0[_0x59b8('0x6b')][_0x59b8('0x6c')],path[_0x59b8('0x6d')](_0x4be1b0[_0x59b8('0x6b')][_0x59b8('0x6c')]));var _0x31ae90=path[_0x59b8('0x56')](config[_0x59b8('0x57')],_0x59b8('0x6e'),_0x4be1b0[_0x59b8('0x6b')]['filename']);var _0x123ed8=path[_0x59b8('0x56')](config[_0x59b8('0x57')],'server/files/plugins',_0x1d56ec);logger['info'](_0x59b8('0x6f'),_0x31ae90);logger[_0x59b8('0x6a')](_0x59b8('0x70'),_0x123ed8);try{fs[_0x59b8('0x71')](_0x31ae90,parseInt('0777',0x8));extract(_0x31ae90,{'dir':_0x123ed8},function(_0x49fdb1){if(_0x49fdb1){logger[_0x59b8('0x30')](_0x49fdb1);handleError(_0x49fdb1,!![]);};var _0x11f9c3=fs['readdirSync'](_0x123ed8);if(_0x11f9c3[_0x59b8('0x52')]>0x1){removeReferences(_0x31ae90,_0x123ed8);logger[_0x59b8('0x30')](_0x59b8('0x72'));return _0x53b001(new Error(_0x59b8('0x72')));}var _0x4bddd7=fs['lstatSync'](path[_0x59b8('0x56')](_0x123ed8,_0x11f9c3[0x0]));if(_0x4bddd7[_0x59b8('0x73')]()){removeReferences(_0x31ae90,_0x123ed8);logger[_0x59b8('0x30')](_0x59b8('0x72'));return _0x53b001(new Error('Invalid\x20plugin\x20structure'));}if(_0x4bddd7[_0x59b8('0x74')]()){var _0xcb8215=fs[_0x59b8('0x75')](path['join'](_0x123ed8,_0x11f9c3[0x0]));if(_0xcb8215[_0x59b8('0x52')]===0x0){removeReferences(_0x31ae90,_0x123ed8);logger['error'](_0x59b8('0x72'));return _0x53b001(new Error(_0x59b8('0x72')));}var _0x35be42=_0xcb8215[_0x59b8('0x76')](function(_0x341af9){return _0x341af9==='manifest.json';});if(!_0x35be42){return _0x53b001(new Error('Plugin\x20manifest\x20missing'));}var _0x3c9fac=fs[_0x59b8('0x77')](path['join'](_0x123ed8,_0x11f9c3[0x0],_0x59b8('0x78')));var _0x16c853=JSON[_0x59b8('0x79')](_0x3c9fac);if('undefined'==typeof _0x16c853[_0x59b8('0x32')]){return _0x53b001(new Error(_0x59b8('0x7a')));}if(_0x59b8('0x24')==typeof _0x16c853[_0x59b8('0x47')]){return _0x53b001(new Error('Invalid\x20manifest:\x20type\x20missing'));}if(_0x59b8('0x24')==typeof _0x16c853['version']){return _0x53b001(new Error(_0x59b8('0x7b')));}if(_0x59b8('0x24')==typeof _0x16c853['parameters']){return _0x53b001(new Error('Invalid\x20manifest:\x20parameters\x20missing'));}if(_0x16c853['type']===_0x59b8('0x7c')){if('undefined'==typeof _0x16c853[_0x59b8('0x7d')][_0x59b8('0x7e')]){return _0x53b001(new Error('Invalid\x20manifest:\x20views\x20missing'));}if(_0x59b8('0x24')==typeof _0x16c853[_0x59b8('0x7d')][_0x59b8('0x7e')][_0x59b8('0x7f')]&&_0x59b8('0x24')==typeof _0x16c853[_0x59b8('0x7d')][_0x59b8('0x7e')]['agent']){return _0x53b001(new Error(_0x59b8('0x80')));}}else if(_0x16c853[_0x59b8('0x47')]===_0x59b8('0x81')){if(_0x59b8('0x24')==typeof _0x16c853[_0x59b8('0x7d')]['scriptName']){return _0x53b001(new Error('Invalid\x20manifest:\x20script\x20name\x20missing'));}if('undefined'==typeof _0x16c853[_0x59b8('0x7d')][_0x59b8('0x82')]){return _0x53b001(new Error(_0x59b8('0x83')));}}else{return _0x53b001(new Error(_0x59b8('0x84')));}var _0x183f21=_0x16c853[_0x59b8('0x32')];var _0xbb371f=_0x16c853[_0x59b8('0x85')];var _0x19c019=_0x16c853[_0x59b8('0x47')];var _0x321e61=_0x16c853[_0x59b8('0x86')]?_0x16c853[_0x59b8('0x86')]:_0x59b8('0x87');var _0x250284=_0x16c853[_0x59b8('0x88')]?_0x16c853[_0x59b8('0x88')]:_0x59b8('0x89');var _0x48be43='';var _0x4004c1='';var _0x94c189='';var _0x53d466='';var _0x4dce1c=_0x16c853[_0x59b8('0x8a')];if(_0x19c019===_0x59b8('0x7c')){if(_0x59b8('0x24')!=typeof _0x16c853[_0x59b8('0x7d')][_0x59b8('0x7e')][_0x59b8('0x7f')]){var _0x5a7fa4=_0x16c853[_0x59b8('0x7d')][_0x59b8('0x7e')][_0x59b8('0x7f')];if(!/^(f|ht)tps?:\/\//i[_0x59b8('0x8b')](_0x5a7fa4)){_0x48be43=path[_0x59b8('0x56')](_0x59b8('0x8c'),_0x1d56ec,_0x11f9c3[0x0],_0x5a7fa4);}else{_0x48be43=_0x5a7fa4;}}else{logger[_0x59b8('0x6a')](_0x59b8('0x8d'));}if(_0x59b8('0x24')!=typeof _0x16c853[_0x59b8('0x7d')][_0x59b8('0x7e')]['agent']){var _0x20457b=_0x16c853['parameters']['views']['agent'];if(!/^(f|ht)tps?:\/\//i[_0x59b8('0x8b')](_0x20457b)){_0x4004c1=path[_0x59b8('0x56')](_0x59b8('0x8c'),_0x1d56ec,_0x11f9c3[0x0],_0x20457b);}else{_0x4004c1=_0x20457b;}}else{logger['info'](_0x59b8('0x8e'));}}else if(_0x19c019==='script'){_0x94c189=_0x16c853['parameters'][_0x59b8('0x8f')];_0x53d466=_0x16c853['parameters'][_0x59b8('0x82')];if(_0x59b8('0x24')!=typeof _0x16c853[_0x59b8('0x7d')]['views']){if(_0x59b8('0x24')!=typeof _0x16c853[_0x59b8('0x7d')][_0x59b8('0x7e')][_0x59b8('0x7f')]){var _0x5a7fa4=_0x16c853[_0x59b8('0x7d')][_0x59b8('0x7e')][_0x59b8('0x7f')];if(!/^(f|ht)tps?:\/\//i[_0x59b8('0x8b')](_0x5a7fa4)){_0x48be43=path['join'](_0x59b8('0x8c'),_0x1d56ec,_0x11f9c3[0x0],_0x5a7fa4);}else{_0x48be43=_0x5a7fa4;}}if(_0x59b8('0x24')!=typeof _0x16c853[_0x59b8('0x7d')][_0x59b8('0x7e')][_0x59b8('0x90')]){var _0x20457b=_0x16c853[_0x59b8('0x7d')][_0x59b8('0x7e')][_0x59b8('0x90')];if(!/^(f|ht)tps?:\/\//i[_0x59b8('0x8b')](_0x20457b)){_0x4004c1=path[_0x59b8('0x56')](_0x59b8('0x8c'),_0x1d56ec,_0x11f9c3[0x0],_0x20457b);}else{_0x4004c1=_0x20457b;}}}}var _0x70c2c6={'name':_0x183f21,'description':_0xbb371f,'path':path[_0x59b8('0x56')](_0x1d56ec,_0x11f9c3[0x0]),'type':_0x19c019,'sidebar':_0x321e61,'icon':_0x250284,'adminUrl':_0x48be43,'agentUrl':_0x4004c1,'scriptName':_0x94c189,'scriptPath':_0x53d466,'version':_0x4dce1c};removeReferences(_0x31ae90,null);return db['Plugin'][_0x59b8('0x91')](_0x70c2c6)[_0x59b8('0x2d')](function(_0xa46c27){var _0x4a3838={'role':_0x4be1b0['body']['role'],'userProfileId':_0x4be1b0[_0x59b8('0x92')]['userProfileId']};if(!_0x4a3838)throw new Error(_0x59b8('0x93'));if(_0x4a3838[_0x59b8('0x94')]==='user'){var _0xc2f850=_0xa46c27[_0x59b8('0x95')]({'plain':!![]});return db[_0x59b8('0x96')]['find']({'where':{'name':_0x59b8('0x2e'),'userProfileId':_0x4a3838['userProfileId']},'raw':!![]})[_0x59b8('0x2d')](function(_0x381e95){if(_0x381e95&&_0x381e95[_0x59b8('0x97')]===0x0){return db[_0x59b8('0x2f')][_0x59b8('0x91')]({'name':_0xc2f850[_0x59b8('0x32')],'resourceId':_0xc2f850['id'],'type':_0x381e95[_0x59b8('0x32')],'sectionId':_0x381e95['id']},{})[_0x59b8('0x2d')](function(){return _0xa46c27;});}else{return _0xa46c27;}})[_0x59b8('0x54')](function(_0x4c0344){logger[_0x59b8('0x30')](_0x59b8('0x98'),_0x4c0344);throw _0x4c0344;});}return _0xa46c27;})[_0x59b8('0x2d')](respondWithResult(_0x2dd9d1,null))[_0x59b8('0x54')](handleError(_0x2dd9d1,null));}});}catch(_0x839533){_0x2dd9d1[_0x59b8('0x21')](0x1f4)[_0x59b8('0x33')](_0x839533);}};function removeReferences(_0x36bdf2,_0x53188e){try{if(_0x36bdf2){fs[_0x59b8('0x69')](_0x36bdf2);logger[_0x59b8('0x6a')](_0x59b8('0x99'));}if(_0x53188e){rimraf(_0x53188e,function(){});logger[_0x59b8('0x6a')](_0x59b8('0x9a'));}}catch(_0x3eefde){logger[_0x59b8('0x30')](_0x3eefde);}}exports[_0x59b8('0x2b')]=function(_0x3c9c87,_0x4b3ac0,_0x57b0d7){return db['Plugin']['find']({'where':{'id':_0x3c9c87[_0x59b8('0x50')]['id']}})[_0x59b8('0x2d')](handleEntityNotFound(_0x4b3ac0,null))[_0x59b8('0x2d')](saveUpdates(_0x3c9c87['body'],null))[_0x59b8('0x2d')](respondWithResult(_0x4b3ac0,null))['catch'](handleError(_0x4b3ac0,null));};exports[_0x59b8('0x9b')]=function(_0x3d0fd6,_0x5bacfc,_0x1410ef){return db['Plugin'][_0x59b8('0x53')]({'where':{'id':_0x3d0fd6['params']['id']}})[_0x59b8('0x2d')](function(_0x1502cd){if(_0x1502cd){return _0x1502cd[_0x59b8('0x2c')]();}})['then'](function(_0x45d645){rimraf(path['join'](config[_0x59b8('0x57')],'server/files/plugins',path['dirname'](_0x45d645[_0x59b8('0x6')])),function(){});return _0x45d645;})[_0x59b8('0x2d')](handleEntityNotFound(_0x5bacfc,null))[_0x59b8('0x2d')](respondWithStatusCode(_0x5bacfc,null))['catch'](handleError(_0x5bacfc,null));};exports['webhookGet']=function(_0x1c4f06,_0x1fd0d4,_0x36cd9b){return BPromise[_0x59b8('0x9c')]()[_0x59b8('0x2d')](function(){if(!_0x1c4f06[_0x59b8('0x38')][_0x59b8('0x6')]){throw new Error(_0x59b8('0x9d'));}if(!_0x1c4f06[_0x59b8('0x38')][_0x59b8('0x9e')]){throw new Error(_0x59b8('0x9f'));}var _0xe431a2=_0x1c4f06[_0x59b8('0x38')][_0x59b8('0xa0')]?_0x1c4f06[_0x59b8('0x38')][_0x59b8('0xa0')]+':'+_0x1c4f06[_0x59b8('0x38')][_0x59b8('0x9e')]:_0x59b8('0xa1')+_0x1c4f06[_0x59b8('0x38')][_0x59b8('0x9e')];var _0x23c446=_0x1c4f06[_0x59b8('0x38')][_0x59b8('0x29')]?_0x1c4f06['query'][_0x59b8('0x29')]:!![];var _0x40baee=_0x1c4f06['query'][_0x59b8('0xa2')]?_0x1c4f06[_0x59b8('0x38')][_0x59b8('0xa2')]:null;var _0x330c05={'method':_0x1c4f06[_0x59b8('0xa3')],'uri':util[_0x59b8('0x68')](_0x59b8('0xa4'),_0xe431a2,_0x1c4f06[_0x59b8('0x38')][_0x59b8('0x6')]),'json':_0x23c446,'resolveWithFullResponse':!![],'encoding':_0x40baee,'qs':_0x1c4f06[_0x59b8('0x38')]};if(_0x1c4f06[_0x59b8('0xa5')]){_0x330c05[_0x59b8('0xa5')]=_0x1c4f06[_0x59b8('0xa5')];if(_0x330c05[_0x59b8('0xa5')]['content-length']){delete _0x330c05['headers'][_0x59b8('0xa6')];}}if(_0x330c05[_0x59b8('0xa5')][_0x59b8('0xa7')]){delete _0x330c05[_0x59b8('0xa5')]['content-type'];}return rp(_0x330c05);})[_0x59b8('0x2d')](function(_0x3265f1){if(_0x3265f1){_0x1fd0d4[_0x59b8('0x27')](_0x3265f1['headers']);logger[_0x59b8('0x6a')](_0x3265f1[_0x59b8('0x92')]);if(_['endsWith'](_0x1c4f06[_0x59b8('0x38')]['path'],'download')&&_0x3265f1[_0x59b8('0xa8')]==0x1f4){return _0x1fd0d4[_0x59b8('0x20')](_0x3265f1['statusCode']);}else{return _0x1fd0d4['status'](_0x3265f1['statusCode'])['send'](_0x3265f1[_0x59b8('0x92')]);}}else{return _0x1fd0d4[_0x59b8('0x20')](0xc8);}})[_0x59b8('0x54')](handleError(_0x1fd0d4,null));};exports[_0x59b8('0xa9')]=function(_0x5da176,_0x347215,_0x2cb006){return BPromise[_0x59b8('0x9c')]()['then'](function(){if(!_0x5da176['query'][_0x59b8('0x6')]){throw new Error('\x27PATH\x27\x20parameter\x20not\x20specified');}if(!_0x5da176[_0x59b8('0x38')][_0x59b8('0x9e')]){throw new Error(_0x59b8('0x9f'));}var _0x466f72=_0x5da176[_0x59b8('0x38')]['hostname']?_0x5da176['query']['hostname']+':'+_0x5da176[_0x59b8('0x38')]['port']:'http://localhost:'+_0x5da176[_0x59b8('0x38')][_0x59b8('0x9e')];var _0x16b594=_0x5da176[_0x59b8('0x38')]['json']?_0x5da176[_0x59b8('0x38')][_0x59b8('0x29')]:!![];var _0x3600b5=_0x5da176[_0x59b8('0x38')][_0x59b8('0xa2')]?_0x5da176[_0x59b8('0x38')][_0x59b8('0xa2')]:null;var _0x2a5d75={'method':_0x5da176[_0x59b8('0xa3')],'uri':util[_0x59b8('0x68')]('%s%s',_0x466f72,_0x5da176['query']['path']),'json':_0x16b594,'resolveWithFullResponse':!![],'encoding':_0x3600b5,'body':_0x5da176['body']};if(_0x5da176[_0x59b8('0xa5')]){_0x2a5d75[_0x59b8('0xa5')]=_0x5da176[_0x59b8('0xa5')];if(_0x2a5d75['headers']['content-length']){delete _0x2a5d75['headers'][_0x59b8('0xa6')];}}if(_0x2a5d75['headers'][_0x59b8('0xa7')]){delete _0x2a5d75[_0x59b8('0xa5')]['content-type'];}return rp(_0x2a5d75);})[_0x59b8('0x2d')](function(_0x58bb6e){if(_0x58bb6e){_0x347215['set'](_0x58bb6e[_0x59b8('0xa5')]);logger[_0x59b8('0x6a')](_0x58bb6e['body']);return _0x347215[_0x59b8('0x21')](_0x58bb6e[_0x59b8('0xa8')])['send'](_0x58bb6e['body']);}else{return _0x347215[_0x59b8('0x20')](0xc8);}})[_0x59b8('0x54')](handleError(_0x347215,null));}; \ No newline at end of file diff --git a/server/api/plugin/plugin.events.js b/server/api/plugin/plugin.events.js index 80e4333..39c9bc0 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 _0x1115=['save','update','remove','emit','hasOwnProperty','exports','../../mysqldb','Plugin','setMaxListeners'];(function(_0x4cfeac,_0x32db27){var _0x54b8af=function(_0x34071c){while(--_0x34071c){_0x4cfeac['push'](_0x4cfeac['shift']());}};_0x54b8af(++_0x32db27);}(_0x1115,0x1b6));var _0x5111=function(_0x9c90ec,_0x4259b8){_0x9c90ec=_0x9c90ec-0x0;var _0x5573a8=_0x1115[_0x9c90ec];return _0x5573a8;};'use strict';var EventEmitter=require('events');var Plugin=require(_0x5111('0x0'))['db'][_0x5111('0x1')];var PluginEvents=new EventEmitter();PluginEvents[_0x5111('0x2')](0x0);var events={'afterCreate':_0x5111('0x3'),'afterUpdate':_0x5111('0x4'),'afterDestroy':_0x5111('0x5')};function emitEvent(_0x301d43){return function(_0x2cd14a,_0xe7b51f,_0x4b0f15){PluginEvents['emit'](_0x301d43+':'+_0x2cd14a['id'],_0x2cd14a);PluginEvents[_0x5111('0x6')](_0x301d43,_0x2cd14a);_0x4b0f15(null);};}for(var e in events){if(events[_0x5111('0x7')](e)){var event=events[e];Plugin['hook'](e,emitEvent(event));}}module[_0x5111('0x8')]=PluginEvents; \ No newline at end of file +var _0xad40=['events','../../mysqldb','Plugin','setMaxListeners','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xad40,0xfa));var _0x0ad4=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0xad40[_0x432682];return _0x463d05;};'use strict';var EventEmitter=require(_0x0ad4('0x0'));var Plugin=require(_0x0ad4('0x1'))['db'][_0x0ad4('0x2')];var PluginEvents=new EventEmitter();PluginEvents[_0x0ad4('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x0ad4('0x4'),'afterDestroy':_0x0ad4('0x5')};function emitEvent(_0x2d5a56){return function(_0x3f47b3,_0x85c3b9,_0x34f7cb){PluginEvents[_0x0ad4('0x6')](_0x2d5a56+':'+_0x3f47b3['id'],_0x3f47b3);PluginEvents['emit'](_0x2d5a56,_0x3f47b3);_0x34f7cb(null);};}for(var e in events){if(events[_0x0ad4('0x7')](e)){var event=events[e];Plugin[_0x0ad4('0x8')](e,emitEvent(event));}}module[_0x0ad4('0x9')]=PluginEvents; \ No newline at end of file diff --git a/server/api/plugin/plugin.model.js b/server/api/plugin/plugin.model.js index ea1d845..ecea415 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 _0xb130=['bluebird','request-promise','../../config/environment','define','lodash','util','../../config/logger','api'];(function(_0x34923a,_0x16f1b8){var _0x218590=function(_0x5f4e2c){while(--_0x5f4e2c){_0x34923a['push'](_0x34923a['shift']());}};_0x218590(++_0x16f1b8);}(_0xb130,0x1ec));var _0x0b13=function(_0x33670a,_0x55e188){_0x33670a=_0x33670a-0x0;var _0x36ad1d=_0xb130[_0x33670a];return _0x36ad1d;};'use strict';var _=require(_0x0b13('0x0'));var util=require(_0x0b13('0x1'));var logger=require(_0x0b13('0x2'))(_0x0b13('0x3'));var moment=require('moment');var BPromise=require(_0x0b13('0x4'));var rp=require(_0x0b13('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x0b13('0x6'));var attributes=require('./plugin.attributes');module['exports']=function(_0x111ba5,_0xcd8984){return _0x111ba5[_0x0b13('0x7')]('Plugin',attributes,{'tableName':'plugins','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x62c0=['../../config/environment','exports','define','Plugin','plugins','util','api','moment','request-promise'];(function(_0x50cf21,_0x15ddc7){var _0x55c8a0=function(_0x2cd059){while(--_0x2cd059){_0x50cf21['push'](_0x50cf21['shift']());}};_0x55c8a0(++_0x15ddc7);}(_0x62c0,0xef));var _0x062c=function(_0x5f3de3,_0x40f0f5){_0x5f3de3=_0x5f3de3-0x0;var _0x287e0d=_0x62c0[_0x5f3de3];return _0x287e0d;};'use strict';var _=require('lodash');var util=require(_0x062c('0x0'));var logger=require('../../config/logger')(_0x062c('0x1'));var moment=require(_0x062c('0x2'));var BPromise=require('bluebird');var rp=require(_0x062c('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x062c('0x4'));var attributes=require('./plugin.attributes');module[_0x062c('0x5')]=function(_0x565822,_0x319ebd){return _0x565822[_0x062c('0x6')](_0x062c('0x7'),attributes,{'tableName':_0x062c('0x8'),'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 2d8d719..52a1999 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 _0xfa19=['message','CreatePlugin','create','body','options','raw','debug','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','defaults','redis','socket.io-emitter','./plugin.socket','register','request','then','info','request\x20sent','Plugin,\x20%s,\x20%s,\x20%s','stringify','error','code','Plugin,\x20%s,\x20%s'];(function(_0x4edd73,_0x31c9f4){var _0x60a855=function(_0x183bce){while(--_0x183bce){_0x4edd73['push'](_0x4edd73['shift']());}};_0x60a855(++_0x31c9f4);}(_0xfa19,0x15c));var _0x9fa1=function(_0x64fcda,_0x454da2){_0x64fcda=_0x64fcda-0x0;var _0x4eac4e=_0xfa19[_0x64fcda];return _0x4eac4e;};'use strict';var _=require(_0x9fa1('0x0'));var util=require(_0x9fa1('0x1'));var moment=require(_0x9fa1('0x2'));var BPromise=require(_0x9fa1('0x3'));var rs=require(_0x9fa1('0x4'));var fs=require('fs');var Redis=require(_0x9fa1('0x5'));var db=require(_0x9fa1('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x9fa1('0x7'))(_0x9fa1('0x8'));var config=require(_0x9fa1('0x9'));var jayson=require(_0x9fa1('0xa'));var client=jayson[_0x9fa1('0xb')]['http']({'port':0x232a});config['redis']=_[_0x9fa1('0xc')](config[_0x9fa1('0xd')],{'host':'localhost','port':0x18eb});var socket=require(_0x9fa1('0xe'))(new Redis(config['redis']));require(_0x9fa1('0xf'))[_0x9fa1('0x10')](socket);function respondWithRpcPromise(_0x28da12,_0x381b69,_0x2f3324){return new BPromise(function(_0x391511,_0x43b139){return client[_0x9fa1('0x11')](_0x28da12,_0x2f3324)[_0x9fa1('0x12')](function(_0x3abcc3){logger[_0x9fa1('0x13')]('Plugin,\x20%s,\x20%s',_0x381b69,_0x9fa1('0x14'));logger['debug'](_0x9fa1('0x15'),_0x381b69,_0x9fa1('0x14'),JSON[_0x9fa1('0x16')](_0x3abcc3));if(_0x3abcc3[_0x9fa1('0x17')]){if(_0x3abcc3[_0x9fa1('0x17')][_0x9fa1('0x18')]===0x1f4){logger[_0x9fa1('0x17')](_0x9fa1('0x19'),_0x381b69,_0x3abcc3[_0x9fa1('0x17')]['message']);return _0x43b139(_0x3abcc3[_0x9fa1('0x17')]['message']);}logger[_0x9fa1('0x17')](_0x9fa1('0x19'),_0x381b69,_0x3abcc3[_0x9fa1('0x17')][_0x9fa1('0x1a')]);return _0x391511(_0x3abcc3[_0x9fa1('0x17')]['message']);}else{logger[_0x9fa1('0x13')](_0x9fa1('0x19'),_0x381b69,_0x9fa1('0x14'));_0x391511(_0x3abcc3['result'][_0x9fa1('0x1a')]);}})['catch'](function(_0x123cd6){logger[_0x9fa1('0x17')]('Plugin,\x20%s,\x20%s',_0x381b69,_0x123cd6);_0x43b139(_0x123cd6);});});}exports[_0x9fa1('0x1b')]=function(_0x1d8ccf){var _0x4f0473=this;return new Promise(function(_0x264709,_0x1cb219){return db['Plugin'][_0x9fa1('0x1c')](_0x1d8ccf[_0x9fa1('0x1d')],{'raw':_0x1d8ccf['options']?_0x1d8ccf[_0x9fa1('0x1e')][_0x9fa1('0x1f')]===undefined?!![]:![]:!![]})[_0x9fa1('0x12')](function(_0xaeea7f){logger[_0x9fa1('0x13')]('CreatePlugin',_0x1d8ccf);logger[_0x9fa1('0x20')]('CreatePlugin',_0x1d8ccf,JSON[_0x9fa1('0x16')](_0xaeea7f));_0x264709(_0xaeea7f);})[_0x9fa1('0x21')](function(_0x546b95){logger[_0x9fa1('0x17')]('CreatePlugin',_0x546b95[_0x9fa1('0x1a')],_0x1d8ccf);_0x1cb219(_0x4f0473[_0x9fa1('0x17')](0x1f4,_0x546b95['message']));});});}; \ No newline at end of file +var _0xf0db=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./plugin.socket','register','request','then','Plugin,\x20%s,\x20%s','request\x20sent','debug','Plugin,\x20%s,\x20%s,\x20%s','error','code','message','info','catch','Plugin','create','body','raw','CreatePlugin','stringify','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x515e8c,_0xb67a31){var _0x34cbb8=function(_0x3a6681){while(--_0x3a6681){_0x515e8c['push'](_0x515e8c['shift']());}};_0x34cbb8(++_0xb67a31);}(_0xf0db,0x112));var _0xbf0d=function(_0x1b5296,_0x1871f9){_0x1b5296=_0x1b5296-0x0;var _0x53e229=_0xf0db[_0x1b5296];return _0x53e229;};'use strict';var _=require('lodash');var util=require(_0xbf0d('0x0'));var moment=require(_0xbf0d('0x1'));var BPromise=require('bluebird');var rs=require(_0xbf0d('0x2'));var fs=require('fs');var Redis=require(_0xbf0d('0x3'));var db=require(_0xbf0d('0x4'))['db'];var utils=require(_0xbf0d('0x5'));var logger=require(_0xbf0d('0x6'))(_0xbf0d('0x7'));var config=require(_0xbf0d('0x8'));var jayson=require(_0xbf0d('0x9'));var client=jayson[_0xbf0d('0xa')][_0xbf0d('0xb')]({'port':0x232a});config[_0xbf0d('0xc')]=_[_0xbf0d('0xd')](config[_0xbf0d('0xc')],{'host':_0xbf0d('0xe'),'port':0x18eb});var socket=require(_0xbf0d('0xf'))(new Redis(config[_0xbf0d('0xc')]));require(_0xbf0d('0x10'))[_0xbf0d('0x11')](socket);function respondWithRpcPromise(_0x1312f3,_0x112734,_0x16e86c){return new BPromise(function(_0x13cf38,_0x432cc1){return client[_0xbf0d('0x12')](_0x1312f3,_0x16e86c)[_0xbf0d('0x13')](function(_0x12c3a4){logger['info'](_0xbf0d('0x14'),_0x112734,_0xbf0d('0x15'));logger[_0xbf0d('0x16')](_0xbf0d('0x17'),_0x112734,_0xbf0d('0x15'),JSON['stringify'](_0x12c3a4));if(_0x12c3a4[_0xbf0d('0x18')]){if(_0x12c3a4[_0xbf0d('0x18')][_0xbf0d('0x19')]===0x1f4){logger[_0xbf0d('0x18')](_0xbf0d('0x14'),_0x112734,_0x12c3a4['error'][_0xbf0d('0x1a')]);return _0x432cc1(_0x12c3a4[_0xbf0d('0x18')][_0xbf0d('0x1a')]);}logger[_0xbf0d('0x18')]('Plugin,\x20%s,\x20%s',_0x112734,_0x12c3a4['error'][_0xbf0d('0x1a')]);return _0x13cf38(_0x12c3a4[_0xbf0d('0x18')][_0xbf0d('0x1a')]);}else{logger[_0xbf0d('0x1b')]('Plugin,\x20%s,\x20%s',_0x112734,_0xbf0d('0x15'));_0x13cf38(_0x12c3a4['result']['message']);}})[_0xbf0d('0x1c')](function(_0x2a78c4){logger['error']('Plugin,\x20%s,\x20%s',_0x112734,_0x2a78c4);_0x432cc1(_0x2a78c4);});});}exports['CreatePlugin']=function(_0x472d5b){var _0x3f4a6f=this;return new Promise(function(_0x41d639,_0x32c625){return db[_0xbf0d('0x1d')][_0xbf0d('0x1e')](_0x472d5b[_0xbf0d('0x1f')],{'raw':_0x472d5b['options']?_0x472d5b['options'][_0xbf0d('0x20')]===undefined?!![]:![]:!![]})[_0xbf0d('0x13')](function(_0x14381e){logger[_0xbf0d('0x1b')]('CreatePlugin',_0x472d5b);logger[_0xbf0d('0x16')](_0xbf0d('0x21'),_0x472d5b,JSON[_0xbf0d('0x22')](_0x14381e));_0x41d639(_0x14381e);})[_0xbf0d('0x1c')](function(_0x43175e){logger[_0xbf0d('0x18')](_0xbf0d('0x21'),_0x43175e[_0xbf0d('0x1a')],_0x472d5b);_0x32c625(_0x3f4a6f[_0xbf0d('0x18')](0x1f4,_0x43175e[_0xbf0d('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/plugin/plugin.socket.js b/server/api/plugin/plugin.socket.js index 74a3759..761a004 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 _0xd2c0=['removeListener','register','length','plugin:','./plugin.events','remove','update','emit'];(function(_0xae7c2f,_0xf31e04){var _0x5d7001=function(_0x4eeadb){while(--_0x4eeadb){_0xae7c2f['push'](_0xae7c2f['shift']());}};_0x5d7001(++_0xf31e04);}(_0xd2c0,0xfc));var _0x0d2c=function(_0x11deb5,_0x46b0f0){_0x11deb5=_0x11deb5-0x0;var _0x5ee90f=_0xd2c0[_0x11deb5];return _0x5ee90f;};'use strict';var PluginEvents=require(_0x0d2c('0x0'));var events=['save',_0x0d2c('0x1'),_0x0d2c('0x2')];function createListener(_0x3839fa,_0x1afd46){return function(_0x29f95d){_0x1afd46[_0x0d2c('0x3')](_0x3839fa,_0x29f95d);};}function removeListener(_0x5bd4c8,_0x127237){return function(){PluginEvents[_0x0d2c('0x4')](_0x5bd4c8,_0x127237);};}exports[_0x0d2c('0x5')]=function(_0x97ecdd){for(var _0x450124=0x0,_0x392c19=events[_0x0d2c('0x6')];_0x450124<_0x392c19;_0x450124++){var _0x335702=events[_0x450124];var _0x122b22=createListener(_0x0d2c('0x7')+_0x335702,_0x97ecdd);PluginEvents['on'](_0x335702,_0x122b22);}}; \ No newline at end of file +var _0x39b8=['remove','emit','removeListener','register','length','./plugin.events','save'];(function(_0x213f7e,_0x4c5d64){var _0x2f788f=function(_0x522346){while(--_0x522346){_0x213f7e['push'](_0x213f7e['shift']());}};_0x2f788f(++_0x4c5d64);}(_0x39b8,0x194));var _0x839b=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x39b8[_0x397e5f];return _0x5302b8;};'use strict';var PluginEvents=require(_0x839b('0x0'));var events=[_0x839b('0x1'),_0x839b('0x2'),'update'];function createListener(_0x450f75,_0x1a3a5d){return function(_0x505d83){_0x1a3a5d[_0x839b('0x3')](_0x450f75,_0x505d83);};}function removeListener(_0x3d8d19,_0x44a337){return function(){PluginEvents[_0x839b('0x4')](_0x3d8d19,_0x44a337);};}exports[_0x839b('0x5')]=function(_0x3a4ca5){for(var _0x2545ae=0x0,_0x3e15ca=events[_0x839b('0x6')];_0x2545ae<_0x3e15ca;_0x2545ae++){var _0x532925=events[_0x2545ae];var _0x1d3217=createListener('plugin:'+_0x532925,_0x3a4ca5);PluginEvents['on'](_0x532925,_0x1d3217);}}; \ No newline at end of file diff --git a/server/api/pm2/index.js b/server/api/pm2/index.js index 2dd47cf..550e00c 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(_0x4a29ee,_0x40fe73){var _0x551dc6=function(_0x16028c){while(--_0x16028c){_0x4a29ee['push'](_0x4a29ee['shift']());}};_0x551dc6(++_0x40fe73);}(_0xa9e0,0x123));var _0x0a9e=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0xa9e0[_0x6c993a];return _0x27f547;};'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(_0x424cc2,_0x521786){var _0x5aaef4=function(_0x4be06b){while(--_0x4be06b){_0x424cc2['push'](_0x424cc2['shift']());}};_0x5aaef4(++_0x521786);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4bfac3,_0x58324d){_0x4bfac3=_0x4bfac3-0x0;var _0x15f0f2=_0xa9e0[_0x4bfac3];return _0x15f0f2;};'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 efaba5e..739d638 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 _0x2547=['express','length','catch','show','describe','create','body','script','join','../../files/plugins','cwd','chdir','dirname','dump','Missing\x20name\x20and/or\x20path','update','stop','hasOwnProperty','params','Unknown\x20status','delete','../../config/pm2','../../config/logger','api','path','child_process','exec','bluebird','sendStatus','status','json','name','send','npm\x20install','info','error','index','list','then','reject'];(function(_0x32ce41,_0x54c6b4){var _0x2c6549=function(_0x175c65){while(--_0x175c65){_0x32ce41['push'](_0x32ce41['shift']());}};_0x2c6549(++_0x54c6b4);}(_0x2547,0x1cd));var _0x7254=function(_0x3a2dac,_0x3b2bb5){_0x3a2dac=_0x3a2dac-0x0;var _0x4ca9b7=_0x2547[_0x3a2dac];return _0x4ca9b7;};'use strict';var _=require('lodash');var pm2=require(_0x7254('0x0'));var logger=require(_0x7254('0x1'))(_0x7254('0x2'));var path=require(_0x7254('0x3'));var exec=require(_0x7254('0x4'))[_0x7254('0x5')];var BPromise=require(_0x7254('0x6'));function handleEntityNotFound(_0x265ebf,_0x53a02f){return function(_0x2ddeae){if(!_0x2ddeae){_0x265ebf[_0x7254('0x7')](0x194);;}return _0x2ddeae;};}function respondWithResult(_0x67f427,_0x119f66){_0x119f66=_0x119f66||0xc8;return function(_0x4b845f){if(_0x4b845f){return _0x67f427[_0x7254('0x8')](_0x119f66)[_0x7254('0x9')](_0x4b845f);}return null;};}function handleError(_0x395913,_0x5da1ec){_0x5da1ec=_0x5da1ec||0x1f4;return function(_0x2a2f82){logger['error'](_0x2a2f82['stack']);if(_0x2a2f82['name']){delete _0x2a2f82[_0x7254('0xa')];}_0x395913[_0x7254('0x8')](_0x5da1ec)[_0x7254('0xb')](_0x2a2f82);};}function execChildProcess(){return new BPromise(function(_0x310c21,_0x6828b6){exec(_0x7254('0xc'),function(_0x4d19e8,_0x3275bd,_0x5ec311){logger[_0x7254('0xd')](_0x3275bd);logger['info'](_0x5ec311);if(_0x4d19e8){logger[_0x7254('0xe')](_0x4d19e8);return _0x6828b6(_0x4d19e8);}return _0x310c21(_0x3275bd);});});}exports[_0x7254('0xf')]=function(_0x348d4e,_0x120780){return pm2[_0x7254('0x10')]()[_0x7254('0x11')](function(_0x124192){if(_0x124192){var _0x21cecc=_[_0x7254('0x12')](_0x124192,function(_0x362a1){return _0x362a1[_0x7254('0xa')]===_0x7254('0x13')||_0x362a1[_0x7254('0xa')]==='motion2';});return{'rows':_0x21cecc,'count':_0x21cecc[_0x7254('0x14')]};}return null;})[_0x7254('0x11')](respondWithResult(_0x120780,null))[_0x7254('0x15')](handleError(_0x120780,null));};exports[_0x7254('0x16')]=function(_0x3b5f06,_0x1e4aff){return pm2[_0x7254('0x17')](_0x3b5f06['params']['id'])[_0x7254('0x11')](respondWithResult(_0x1e4aff,null))[_0x7254('0x11')](handleEntityNotFound(_0x1e4aff,null))[_0x7254('0x15')](handleError(_0x1e4aff,null));};exports[_0x7254('0x18')]=function(_0x2a1ddc,_0x301f00){if(_0x2a1ddc[_0x7254('0x19')][_0x7254('0xa')]&&_0x2a1ddc[_0x7254('0x19')][_0x7254('0x1a')]){var _0x2594b8=path[_0x7254('0x1b')](__dirname,_0x7254('0x1c'),_0x2a1ddc[_0x7254('0x19')][_0x7254('0x1a')]);var _0x95ceaa=process[_0x7254('0x1d')]();process[_0x7254('0x1e')](path[_0x7254('0x1f')](_0x2594b8));return execChildProcess()[_0x7254('0x11')](function(_0x1be69b){process['chdir'](_0x95ceaa);return pm2['start']({'name':_0x2a1ddc[_0x7254('0x19')][_0x7254('0xa')],'script':_0x2594b8});})[_0x7254('0x11')](function(_0x54dace){pm2[_0x7254('0x20')]();return _0x54dace[0x0];})[_0x7254('0x11')](respondWithResult(_0x301f00,0xc9))[_0x7254('0x15')](handleError(_0x301f00,null));}else{return _0x301f00['status'](0x1f4)[_0x7254('0xb')]({'message':_0x7254('0x21')});}};exports[_0x7254('0x22')]=function(_0x494cdb,_0x3c22d0){if(_0x494cdb['body']['id']){delete _0x494cdb[_0x7254('0x19')]['id'];}var _0x134a9e={'online':'restart','stopped':_0x7254('0x23')};if(_0x134a9e[_0x7254('0x24')](_0x494cdb['body'][_0x7254('0x8')])){return pm2[_0x134a9e[_0x494cdb[_0x7254('0x19')][_0x7254('0x8')]]](_0x494cdb[_0x7254('0x25')]['id'])[_0x7254('0x11')](respondWithResult(_0x3c22d0,0xc8))[_0x7254('0x15')](handleError(_0x3c22d0,null));}else{return _0x3c22d0['status'](0x1f4)[_0x7254('0xb')]({'message':_0x7254('0x26')});}};exports['destroy']=function(_0x2f75ea,_0x1279cd){if(_0x2f75ea[_0x7254('0x19')]['id']){delete _0x2f75ea['body']['id'];}if(_0x2f75ea[_0x7254('0x25')]['id']){return pm2[_0x7254('0x27')](_0x2f75ea[_0x7254('0x25')]['id'])[_0x7254('0x11')](function(_0x40a137){pm2[_0x7254('0x20')]();return _0x40a137[0x0];})[_0x7254('0x11')](respondWithResult(_0x1279cd,null))['catch'](handleError(_0x1279cd,null));}else{return _0x1279cd[_0x7254('0x8')](0x1f4)['send']({'message':'Unknown\x20id'});}}; \ No newline at end of file +var _0x4522=['length','then','catch','body','name','script','join','chdir','dirname','start','dump','Missing\x20name\x20and/or\x20path','update','restart','params','send','Unknown\x20status','destroy','delete','Unknown\x20id','../../config/logger','api','path','exec','bluebird','sendStatus','status','json','error','stack','npm\x20install','info','list','reject','express','motion2'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x4522,0x1a0));var _0x2452=function(_0x314e2b,_0x4dad5a){_0x314e2b=_0x314e2b-0x0;var _0x2643f1=_0x4522[_0x314e2b];return _0x2643f1;};'use strict';var _=require('lodash');var pm2=require('../../config/pm2');var logger=require(_0x2452('0x0'))(_0x2452('0x1'));var path=require(_0x2452('0x2'));var exec=require('child_process')[_0x2452('0x3')];var BPromise=require(_0x2452('0x4'));function handleEntityNotFound(_0x35e30a,_0x2f21dc){return function(_0x34ff44){if(!_0x34ff44){_0x35e30a[_0x2452('0x5')](0x194);;}return _0x34ff44;};}function respondWithResult(_0x15fc69,_0x226578){_0x226578=_0x226578||0xc8;return function(_0x2f0139){if(_0x2f0139){return _0x15fc69[_0x2452('0x6')](_0x226578)[_0x2452('0x7')](_0x2f0139);}return null;};}function handleError(_0x33b935,_0x24073f){_0x24073f=_0x24073f||0x1f4;return function(_0x365b1f){logger[_0x2452('0x8')](_0x365b1f[_0x2452('0x9')]);if(_0x365b1f['name']){delete _0x365b1f['name'];}_0x33b935[_0x2452('0x6')](_0x24073f)['send'](_0x365b1f);};}function execChildProcess(){return new BPromise(function(_0x4d665c,_0x2534bb){exec(_0x2452('0xa'),function(_0x1086ef,_0x3ad6c9,_0x1a7489){logger[_0x2452('0xb')](_0x3ad6c9);logger[_0x2452('0xb')](_0x1a7489);if(_0x1086ef){logger[_0x2452('0x8')](_0x1086ef);return _0x2534bb(_0x1086ef);}return _0x4d665c(_0x3ad6c9);});});}exports['index']=function(_0x529fb2,_0x5315ed){return pm2[_0x2452('0xc')]()['then'](function(_0x33e592){if(_0x33e592){var _0x506cd4=_[_0x2452('0xd')](_0x33e592,function(_0x42efdf){return _0x42efdf['name']===_0x2452('0xe')||_0x42efdf['name']===_0x2452('0xf');});return{'rows':_0x506cd4,'count':_0x506cd4[_0x2452('0x10')]};}return null;})[_0x2452('0x11')](respondWithResult(_0x5315ed,null))[_0x2452('0x12')](handleError(_0x5315ed,null));};exports['show']=function(_0x2108e4,_0x16e33a){return pm2['describe'](_0x2108e4['params']['id'])[_0x2452('0x11')](respondWithResult(_0x16e33a,null))[_0x2452('0x11')](handleEntityNotFound(_0x16e33a,null))[_0x2452('0x12')](handleError(_0x16e33a,null));};exports['create']=function(_0x914d2b,_0x467963){if(_0x914d2b[_0x2452('0x13')][_0x2452('0x14')]&&_0x914d2b[_0x2452('0x13')][_0x2452('0x15')]){var _0x3f48c2=path[_0x2452('0x16')](__dirname,'../../files/plugins',_0x914d2b['body'][_0x2452('0x15')]);var _0x32dfe7=process['cwd']();process[_0x2452('0x17')](path[_0x2452('0x18')](_0x3f48c2));return execChildProcess()[_0x2452('0x11')](function(_0x617ba7){process[_0x2452('0x17')](_0x32dfe7);return pm2[_0x2452('0x19')]({'name':_0x914d2b[_0x2452('0x13')]['name'],'script':_0x3f48c2});})[_0x2452('0x11')](function(_0x27d049){pm2[_0x2452('0x1a')]();return _0x27d049[0x0];})[_0x2452('0x11')](respondWithResult(_0x467963,0xc9))[_0x2452('0x12')](handleError(_0x467963,null));}else{return _0x467963['status'](0x1f4)['send']({'message':_0x2452('0x1b')});}};exports[_0x2452('0x1c')]=function(_0x46fcbb,_0x3a183c){if(_0x46fcbb[_0x2452('0x13')]['id']){delete _0x46fcbb['body']['id'];}var _0x3fba00={'online':_0x2452('0x1d'),'stopped':'stop'};if(_0x3fba00['hasOwnProperty'](_0x46fcbb[_0x2452('0x13')][_0x2452('0x6')])){return pm2[_0x3fba00[_0x46fcbb[_0x2452('0x13')][_0x2452('0x6')]]](_0x46fcbb[_0x2452('0x1e')]['id'])[_0x2452('0x11')](respondWithResult(_0x3a183c,0xc8))['catch'](handleError(_0x3a183c,null));}else{return _0x3a183c['status'](0x1f4)[_0x2452('0x1f')]({'message':_0x2452('0x20')});}};exports[_0x2452('0x21')]=function(_0x5c36aa,_0x2fb2ae){if(_0x5c36aa[_0x2452('0x13')]['id']){delete _0x5c36aa['body']['id'];}if(_0x5c36aa[_0x2452('0x1e')]['id']){return pm2[_0x2452('0x22')](_0x5c36aa[_0x2452('0x1e')]['id'])[_0x2452('0x11')](function(_0x334aba){pm2[_0x2452('0x1a')]();return _0x334aba[0x0];})[_0x2452('0x11')](respondWithResult(_0x2fb2ae,null))[_0x2452('0x12')](handleError(_0x2fb2ae,null));}else{return _0x2fb2ae[_0x2452('0x6')](0x1f4)[_0x2452('0x1f')]({'message':_0x2452('0x23')});}}; \ No newline at end of file diff --git a/server/api/realtime/index.js b/server/api/realtime/index.js index 5aa0271..9bcb78f 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 _0x6440=['getQueues','exports','express','Router','./realtime.controller','get','/queues'];(function(_0x335201,_0x314d57){var _0x39b053=function(_0x22d774){while(--_0x22d774){_0x335201['push'](_0x335201['shift']());}};_0x39b053(++_0x314d57);}(_0x6440,0x1de));var _0x0644=function(_0x480bc8,_0x1fac40){_0x480bc8=_0x480bc8-0x0;var _0x28c245=_0x6440[_0x480bc8];return _0x28c245;};'use strict';var express=require(_0x0644('0x0'));var router=express[_0x0644('0x1')]();var auth=require('../../components/auth/service');var controller=require(_0x0644('0x2'));router[_0x0644('0x3')](_0x0644('0x4'),auth['isAuthenticated'](),controller[_0x0644('0x5')]);module[_0x0644('0x6')]=router; \ No newline at end of file +var _0x7b92=['../../components/auth/service','./realtime.controller','isAuthenticated','express'];(function(_0x46cf15,_0x5ddb52){var _0x2e3035=function(_0x4137c3){while(--_0x4137c3){_0x46cf15['push'](_0x46cf15['shift']());}};_0x2e3035(++_0x5ddb52);}(_0x7b92,0x1e3));var _0x27b9=function(_0x33ebf5,_0x258ec6){_0x33ebf5=_0x33ebf5-0x0;var _0x66957b=_0x7b92[_0x33ebf5];return _0x66957b;};'use strict';var express=require(_0x27b9('0x0'));var router=express['Router']();var auth=require(_0x27b9('0x1'));var controller=require(_0x27b9('0x2'));router['get']('/queues',auth[_0x27b9('0x3')](),controller['getQueues']);module['exports']=router; \ No newline at end of file diff --git a/server/api/realtime/realtime.controller.js b/server/api/realtime/realtime.controller.js index 7918f19..3c6400d 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 _0x77d4=['lodash','../../components/parsers/qs','api','../../mysqldb','client','http','limit','count','offset','status','set','json','error','stack','name','mail','chat','openchannel','fax','whatsapp','voice','resolve','then','query','channel','includes','toLowerCase','startCase','Queue','map','rawAttributes','fieldName','type','key','getOptions','role','user','userProfileId','outbound','QueueCampaigns','filter','UserProfile','getResources','findAndCountAll','request','Queues','format','Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues','result','loggedIn','available','waiting','talking','paused','push','pTalking','message','dialActive','dialMethod','Trunk','startPredictive','startProgressive','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','predictiveIntervalAvailable','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalDroppedCallsCallersExit','rows','originated','agents','find','pick','getMembers','length','online','Pause','findAll','User','UserId','agent','loggedInDb','all','catch'];(function(_0x482214,_0x2550ff){var _0x38d0cb=function(_0x2ba281){while(--_0x2ba281){_0x482214['push'](_0x482214['shift']());}};_0x38d0cb(++_0x2550ff);}(_0x77d4,0x108));var _0x477d=function(_0x9df060,_0x253d33){_0x9df060=_0x9df060-0x0;var _0x338dfe=_0x77d4[_0x9df060];return _0x338dfe;};'use strict';var util=require('util');var _=require(_0x477d('0x0'));var jayson=require('jayson/promise');var qs=require(_0x477d('0x1'));var logger=require('../../config/logger')(_0x477d('0x2'));var db=require(_0x477d('0x3'))['db'];var client=jayson['client']['http']({'port':0x232a});var routingClient=jayson[_0x477d('0x4')][_0x477d('0x5')]({'port':0x232c});function respondWithFilteredResult(_0x3d2f8d,_0x471fca){return function(_0x2545e5){if(_0x2545e5){var _0x45ca2d=typeof _0x471fca['offset']==='undefined'&&typeof _0x471fca[_0x477d('0x6')]==='undefined';var _0x5da70c=_0x2545e5[_0x477d('0x7')];var _0x29f11b=_0x45ca2d?0x0:_0x471fca[_0x477d('0x8')];var _0x2c326c=_0x45ca2d?_0x2545e5[_0x477d('0x7')]:_0x471fca['offset']+_0x471fca[_0x477d('0x6')];var _0x4f11bc;if(_0x2c326c>=_0x5da70c){_0x2c326c=_0x5da70c;_0x4f11bc=0xc8;}else{_0x4f11bc=0xce;}_0x3d2f8d[_0x477d('0x9')](_0x4f11bc);return _0x3d2f8d[_0x477d('0xa')]('Content-Range',_0x29f11b+'-'+_0x2c326c+'/'+_0x5da70c)[_0x477d('0xb')](_0x2545e5);}return null;};}function handleError(_0x3d362a,_0x5a190c){_0x5a190c=_0x5a190c||0x1f4;return function(_0x5dd33c){logger[_0x477d('0xc')](_0x5dd33c[_0x477d('0xd')]);if(_0x5dd33c['name']){delete _0x5dd33c[_0x477d('0xe')];}_0x3d362a[_0x477d('0x9')](_0x5a190c)['send'](_0x5dd33c);};}exports['getQueues']=function(_0x38a0a8,_0x4bbfef){var _0x30481f=[_0x477d('0xf'),_0x477d('0x10'),'sms',_0x477d('0x11'),_0x477d('0x12'),_0x477d('0x13'),_0x477d('0x14')];var _0x57b38e={'count':0x0,'rows':[]},_0x28f17a={},_0x5d5553;Promise[_0x477d('0x15')]()[_0x477d('0x16')](function(){if(_0x38a0a8[_0x477d('0x17')][_0x477d('0x18')]){if(!_[_0x477d('0x19')](_0x30481f,_0x38a0a8[_0x477d('0x17')]['channel'][_0x477d('0x1a')]()))throw new Error('Invalid\x20channel');_0x5d5553=_0x38a0a8[_0x477d('0x17')][_0x477d('0x18')][_0x477d('0x1a')]();}var _0x14cbd5=_[_0x477d('0x1b')](_0x5d5553)+_0x477d('0x1c');var _0x435a3b=_[_0x477d('0x1d')](db[_0x14cbd5][_0x477d('0x1e')],function(_0x5981a){return{'name':_0x5981a[_0x477d('0x1f')],'type':_0x5981a[_0x477d('0x20')][_0x477d('0x21')]};});_0x28f17a=qs[_0x477d('0x22')](_0x435a3b,_0x38a0a8);if(_0x38a0a8['user'][_0x477d('0x23')]==='user'){var _0x239b56={'params':{'id':_0x38a0a8[_0x477d('0x24')][_0x477d('0x25')]},'query':{'section':_0x5d5553===_0x477d('0x14')&&_0x38a0a8['query'][_0x477d('0x20')]===_0x477d('0x26')?_0x477d('0x27'):_['startCase'](_0x5d5553)+'Queues','type':_0x38a0a8[_0x477d('0x17')][_0x477d('0x20')],'nolimit':!![],'sort':_0x477d('0xe'),'filter':_0x38a0a8['query'][_0x477d('0x28')]}};return db[_0x477d('0x29')][_0x477d('0x2a')](_0x239b56);}return db[_0x14cbd5][_0x477d('0x2b')](_0x28f17a);})[_0x477d('0x16')](function(_0x537fc4){_0x57b38e[_0x477d('0x7')]=_0x537fc4[_0x477d('0x7')];var _0x17dd16=_0x5d5553===_0x477d('0x14')?client:routingClient;return _0x17dd16[_0x477d('0x2c')](_[_0x477d('0x1b')](_0x5d5553)+_0x477d('0x2d'),_0x38a0a8)[_0x477d('0x16')](function(_0x204541){if(_0x204541[_0x477d('0xc')])throw new Error(util[_0x477d('0x2e')](_0x477d('0x2f'),_0x5d5553));var _0x138c6d=_0x204541[_0x477d('0x30')];var _0x16042d=[_0x477d('0x31'),_0x477d('0x32'),_0x477d('0x33'),_0x477d('0x34'),_0x477d('0x35')];if(_0x5d5553==='voice'&&_0x38a0a8[_0x477d('0x17')]['type']===_0x477d('0x26')){_0x16042d[_0x477d('0x36')](_0x477d('0x37'),'originated',_0x477d('0x38'),_0x477d('0x39'),_0x477d('0x3a'),_0x477d('0x3b'),_0x477d('0x3c'),_0x477d('0x3d'),_0x477d('0x3e'),_0x477d('0x3f'),_0x477d('0x40'),_0x477d('0x41'),'dialPredictiveInterval',_0x477d('0x42'),_0x477d('0x43'),_0x477d('0x44'),'predictiveIntervalTotalCalls',_0x477d('0x45'),_0x477d('0x46'),_0x477d('0x47'),'predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime');}var _0x21de5c=_0x537fc4[_0x477d('0x48')][_0x477d('0x1d')](function(_0x13ac50){var _0x1c0d86=_0x13ac50['get']({'plain':!![]});_0x1c0d86[_0x477d('0x35')]=0x0;_0x1c0d86['loggedInDb']=0x0;_0x1c0d86[_0x477d('0x31')]=0x0;_0x1c0d86[_0x477d('0x32')]=0x0;_0x1c0d86[_0x477d('0x35')]=0x0;_0x1c0d86['waiting']=0x0;if(_0x5d5553==='voice'){_0x1c0d86[_0x477d('0x34')]=0x0;if(_0x38a0a8[_0x477d('0x17')][_0x477d('0x20')]===_0x477d('0x26')){_0x1c0d86['pTalking']=0x0;_0x1c0d86[_0x477d('0x49')]=0x0;}}_0x1c0d86[_0x477d('0x4a')]=[];var _0x40fdc0=_[_0x477d('0x4b')](_0x138c6d[_0x477d('0x48')],['id',_0x1c0d86['id']]);if(_0x40fdc0)_['merge'](_0x1c0d86,_[_0x477d('0x4c')](_0x40fdc0,_0x16042d));if(_0x5d5553===_0x477d('0x14')){return _0x13ac50['getAgents']({'attributes':['id',_0x477d('0xe'),'online'],'joinTableAttributes':[],'raw':!![]})[_0x477d('0x16')](function(_0x7a5a47){return _0x13ac50[_0x477d('0x4d')]({'raw':!![]})[_0x477d('0x16')](function(_0x1f9552){for(var _0x10bbed=0x0;_0x10bbed<_0x7a5a47[_0x477d('0x4e')];_0x10bbed++){var _0xb94247=_[_0x477d('0x4b')](_0x1f9552,['UserId',_0x7a5a47[_0x10bbed]['id']]);var _0x5759f={'id':_0x7a5a47[_0x10bbed]['id'],'name':_0x7a5a47[_0x10bbed][_0x477d('0xe')],'online':Boolean(_0x7a5a47[_0x10bbed][_0x477d('0x4f')]),'paused':_0xb94247?Boolean(_0xb94247[_0x477d('0x35')]):![]};if(_0x5759f['online'])_0x1c0d86['loggedInDb']++;if(_0x5759f[_0x477d('0x35')])_0x1c0d86[_0x477d('0x35')]++;_0x1c0d86['agents'][_0x477d('0x36')](_0x5759f);}return _0x1c0d86;});});}else{var _0x4fb6f5='User'+_[_0x477d('0x1b')](_0x5d5553)+_0x477d('0x1c');var _0x133b81=_0x5d5553+_0x477d('0x50');return db[_0x4fb6f5][_0x477d('0x51')]({'where':{[_[_0x477d('0x1b')](_0x5d5553)+'QueueId']:_0x13ac50['id']},'raw':!![]})[_0x477d('0x16')](function(_0xed1fb2){return db[_0x477d('0x52')][_0x477d('0x51')]({'attributes':['id',_0x477d('0xe'),'online',_0x133b81],'where':{'id':_['map'](_0xed1fb2,_0x477d('0x53')),'role':_0x477d('0x54')},'raw':!![]});})[_0x477d('0x16')](function(_0x59dc4c){for(var _0x45a5da=0x0;_0x45a5da<_0x59dc4c[_0x477d('0x4e')];_0x45a5da++){var _0x3154da={'id':_0x59dc4c[_0x45a5da]['id'],'name':_0x59dc4c[_0x45a5da][_0x477d('0xe')],'online':Boolean(_0x59dc4c[_0x45a5da][_0x477d('0x4f')]),'paused':Boolean(_0x59dc4c[_0x45a5da][_0x133b81])};if(_0x3154da[_0x477d('0x4f')])_0x1c0d86[_0x477d('0x55')]++;if(_0x3154da['paused'])_0x1c0d86[_0x477d('0x35')]++;_0x1c0d86[_0x477d('0x4a')][_0x477d('0x36')](_0x3154da);}return _0x1c0d86;});}});return Promise[_0x477d('0x56')](_0x21de5c);});})[_0x477d('0x16')](function(_0x32b430){_0x57b38e[_0x477d('0x48')]=_0x32b430;return _0x57b38e;})[_0x477d('0x16')](respondWithFilteredResult(_0x4bbfef,_0x28f17a))[_0x477d('0x57')](handleError(_0x4bbfef,null));}; \ No newline at end of file +var _0x2a07=['dialPredictiveIntervalMinThreshold','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','rows','get','paused','loggedInDb','find','merge','online','getMembers','length','UserId','User','Pause','findAll','agent','all','catch','util','lodash','jayson/promise','../../components/parsers/qs','../../config/logger','../../mysqldb','client','http','offset','undefined','limit','count','status','set','Content-Range','error','stack','name','getQueues','mail','chat','openchannel','fax','whatsapp','voice','resolve','then','channel','includes','query','Invalid\x20channel','toLowerCase','Queue','map','rawAttributes','fieldName','type','key','getOptions','user','role','userProfileId','outbound','QueueCampaigns','startCase','Queues','filter','UserProfile','getResources','findAndCountAll','request','Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues','result','loggedIn','available','waiting','talking','push','originated','message','dialActive','dialMethod','Trunk','startPredictive','startProgressive','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','dialPredictiveInterval'];(function(_0x65f9fe,_0x3e63c5){var _0x1bd614=function(_0x22ad56){while(--_0x22ad56){_0x65f9fe['push'](_0x65f9fe['shift']());}};_0x1bd614(++_0x3e63c5);}(_0x2a07,0x74));var _0x72a0=function(_0x9d14e3,_0x5a6072){_0x9d14e3=_0x9d14e3-0x0;var _0x19bf32=_0x2a07[_0x9d14e3];return _0x19bf32;};'use strict';var util=require(_0x72a0('0x0'));var _=require(_0x72a0('0x1'));var jayson=require(_0x72a0('0x2'));var qs=require(_0x72a0('0x3'));var logger=require(_0x72a0('0x4'))('api');var db=require(_0x72a0('0x5'))['db'];var client=jayson[_0x72a0('0x6')][_0x72a0('0x7')]({'port':0x232a});var routingClient=jayson[_0x72a0('0x6')][_0x72a0('0x7')]({'port':0x232c});function respondWithFilteredResult(_0xce74c,_0x3ccf6d){return function(_0x20dab9){if(_0x20dab9){var _0x193e3b=typeof _0x3ccf6d[_0x72a0('0x8')]===_0x72a0('0x9')&&typeof _0x3ccf6d[_0x72a0('0xa')]===_0x72a0('0x9');var _0x1d32e9=_0x20dab9[_0x72a0('0xb')];var _0x2bc45b=_0x193e3b?0x0:_0x3ccf6d['offset'];var _0x169dc2=_0x193e3b?_0x20dab9[_0x72a0('0xb')]:_0x3ccf6d['offset']+_0x3ccf6d[_0x72a0('0xa')];var _0x194488;if(_0x169dc2>=_0x1d32e9){_0x169dc2=_0x1d32e9;_0x194488=0xc8;}else{_0x194488=0xce;}_0xce74c[_0x72a0('0xc')](_0x194488);return _0xce74c[_0x72a0('0xd')](_0x72a0('0xe'),_0x2bc45b+'-'+_0x169dc2+'/'+_0x1d32e9)['json'](_0x20dab9);}return null;};}function handleError(_0x130797,_0x335b9f){_0x335b9f=_0x335b9f||0x1f4;return function(_0x123ca4){logger[_0x72a0('0xf')](_0x123ca4[_0x72a0('0x10')]);if(_0x123ca4[_0x72a0('0x11')]){delete _0x123ca4[_0x72a0('0x11')];}_0x130797['status'](_0x335b9f)['send'](_0x123ca4);};}exports[_0x72a0('0x12')]=function(_0x3cd89f,_0x19eaf9){var _0x1d1133=[_0x72a0('0x13'),_0x72a0('0x14'),'sms',_0x72a0('0x15'),_0x72a0('0x16'),_0x72a0('0x17'),_0x72a0('0x18')];var _0x2d1e95={'count':0x0,'rows':[]},_0x54495e={},_0x100d8f;Promise[_0x72a0('0x19')]()[_0x72a0('0x1a')](function(){if(_0x3cd89f['query'][_0x72a0('0x1b')]){if(!_[_0x72a0('0x1c')](_0x1d1133,_0x3cd89f[_0x72a0('0x1d')][_0x72a0('0x1b')]['toLowerCase']()))throw new Error(_0x72a0('0x1e'));_0x100d8f=_0x3cd89f['query'][_0x72a0('0x1b')][_0x72a0('0x1f')]();}var _0xde058c=_['startCase'](_0x100d8f)+_0x72a0('0x20');var _0x1849d1=_[_0x72a0('0x21')](db[_0xde058c][_0x72a0('0x22')],function(_0x5d6145){return{'name':_0x5d6145[_0x72a0('0x23')],'type':_0x5d6145[_0x72a0('0x24')][_0x72a0('0x25')]};});_0x54495e=qs[_0x72a0('0x26')](_0x1849d1,_0x3cd89f);if(_0x3cd89f[_0x72a0('0x27')][_0x72a0('0x28')]==='user'){var _0x4dd1a6={'params':{'id':_0x3cd89f[_0x72a0('0x27')][_0x72a0('0x29')]},'query':{'section':_0x100d8f===_0x72a0('0x18')&&_0x3cd89f[_0x72a0('0x1d')][_0x72a0('0x24')]===_0x72a0('0x2a')?_0x72a0('0x2b'):_[_0x72a0('0x2c')](_0x100d8f)+_0x72a0('0x2d'),'type':_0x3cd89f[_0x72a0('0x1d')]['type'],'nolimit':!![],'sort':_0x72a0('0x11'),'filter':_0x3cd89f[_0x72a0('0x1d')][_0x72a0('0x2e')]}};return db[_0x72a0('0x2f')][_0x72a0('0x30')](_0x4dd1a6);}return db[_0xde058c][_0x72a0('0x31')](_0x54495e);})[_0x72a0('0x1a')](function(_0x12eda2){_0x2d1e95[_0x72a0('0xb')]=_0x12eda2[_0x72a0('0xb')];var _0x4ba037=_0x100d8f===_0x72a0('0x18')?client:routingClient;return _0x4ba037[_0x72a0('0x32')](_[_0x72a0('0x2c')](_0x100d8f)+_0x72a0('0x2d'),_0x3cd89f)[_0x72a0('0x1a')](function(_0x19e783){if(_0x19e783[_0x72a0('0xf')])throw new Error(util['format'](_0x72a0('0x33'),_0x100d8f));var _0x2c884f=_0x19e783[_0x72a0('0x34')];var _0x197591=[_0x72a0('0x35'),_0x72a0('0x36'),_0x72a0('0x37'),_0x72a0('0x38'),'paused'];if(_0x100d8f===_0x72a0('0x18')&&_0x3cd89f[_0x72a0('0x1d')][_0x72a0('0x24')]==='outbound'){_0x197591[_0x72a0('0x39')]('pTalking',_0x72a0('0x3a'),_0x72a0('0x3b'),_0x72a0('0x3c'),_0x72a0('0x3d'),_0x72a0('0x3e'),_0x72a0('0x3f'),_0x72a0('0x40'),_0x72a0('0x41'),_0x72a0('0x42'),_0x72a0('0x43'),_0x72a0('0x44'),_0x72a0('0x45'),'dialPredictiveIntervalMaxThreshold',_0x72a0('0x46'),'predictiveIntervalAvailable',_0x72a0('0x47'),_0x72a0('0x48'),_0x72a0('0x49'),_0x72a0('0x4a'),_0x72a0('0x4b'),_0x72a0('0x4c'));}var _0x90b437=_0x12eda2[_0x72a0('0x4d')][_0x72a0('0x21')](function(_0x4c1f43){var _0x4a973a=_0x4c1f43[_0x72a0('0x4e')]({'plain':!![]});_0x4a973a[_0x72a0('0x4f')]=0x0;_0x4a973a[_0x72a0('0x50')]=0x0;_0x4a973a[_0x72a0('0x35')]=0x0;_0x4a973a[_0x72a0('0x36')]=0x0;_0x4a973a['paused']=0x0;_0x4a973a[_0x72a0('0x37')]=0x0;if(_0x100d8f===_0x72a0('0x18')){_0x4a973a['talking']=0x0;if(_0x3cd89f[_0x72a0('0x1d')]['type']==='outbound'){_0x4a973a['pTalking']=0x0;_0x4a973a[_0x72a0('0x3a')]=0x0;}}_0x4a973a['agents']=[];var _0x44b47b=_[_0x72a0('0x51')](_0x2c884f[_0x72a0('0x4d')],['id',_0x4a973a['id']]);if(_0x44b47b)_[_0x72a0('0x52')](_0x4a973a,_['pick'](_0x44b47b,_0x197591));if(_0x100d8f==='voice'){return _0x4c1f43['getAgents']({'attributes':['id','name',_0x72a0('0x53')],'joinTableAttributes':[],'raw':!![]})[_0x72a0('0x1a')](function(_0x4a7032){return _0x4c1f43[_0x72a0('0x54')]({'raw':!![]})[_0x72a0('0x1a')](function(_0x49414d){for(var _0x2a8ddf=0x0;_0x2a8ddf<_0x4a7032[_0x72a0('0x55')];_0x2a8ddf++){var _0x45cfbd=_[_0x72a0('0x51')](_0x49414d,[_0x72a0('0x56'),_0x4a7032[_0x2a8ddf]['id']]);var _0x341451={'id':_0x4a7032[_0x2a8ddf]['id'],'name':_0x4a7032[_0x2a8ddf]['name'],'online':Boolean(_0x4a7032[_0x2a8ddf][_0x72a0('0x53')]),'paused':_0x45cfbd?Boolean(_0x45cfbd['paused']):![]};if(_0x341451[_0x72a0('0x53')])_0x4a973a['loggedInDb']++;if(_0x341451[_0x72a0('0x4f')])_0x4a973a[_0x72a0('0x4f')]++;_0x4a973a['agents'][_0x72a0('0x39')](_0x341451);}return _0x4a973a;});});}else{var _0x506d65=_0x72a0('0x57')+_[_0x72a0('0x2c')](_0x100d8f)+_0x72a0('0x20');var _0x4afdd1=_0x100d8f+_0x72a0('0x58');return db[_0x506d65][_0x72a0('0x59')]({'where':{[_[_0x72a0('0x2c')](_0x100d8f)+'QueueId']:_0x4c1f43['id']},'raw':!![]})['then'](function(_0x117fd3){return db['User'][_0x72a0('0x59')]({'attributes':['id',_0x72a0('0x11'),_0x72a0('0x53'),_0x4afdd1],'where':{'id':_[_0x72a0('0x21')](_0x117fd3,_0x72a0('0x56')),'role':_0x72a0('0x5a')},'raw':!![]});})[_0x72a0('0x1a')](function(_0x2f068c){for(var _0x2efa92=0x0;_0x2efa92<_0x2f068c['length'];_0x2efa92++){var _0x4fae3d={'id':_0x2f068c[_0x2efa92]['id'],'name':_0x2f068c[_0x2efa92][_0x72a0('0x11')],'online':Boolean(_0x2f068c[_0x2efa92][_0x72a0('0x53')]),'paused':Boolean(_0x2f068c[_0x2efa92][_0x4afdd1])};if(_0x4fae3d[_0x72a0('0x53')])_0x4a973a[_0x72a0('0x50')]++;if(_0x4fae3d[_0x72a0('0x4f')])_0x4a973a[_0x72a0('0x4f')]++;_0x4a973a['agents']['push'](_0x4fae3d);}return _0x4a973a;});}});return Promise[_0x72a0('0x5b')](_0x90b437);});})[_0x72a0('0x1a')](function(_0xe38fb3){_0x2d1e95[_0x72a0('0x4d')]=_0xe38fb3;return _0x2d1e95;})[_0x72a0('0x1a')](respondWithFilteredResult(_0x19eaf9,_0x54495e))[_0x72a0('0x5c')](handleError(_0x19eaf9,null));}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/index.js b/server/api/reportAgentPreview/index.js index df96b88..235aca0 100644 --- a/server/api/reportAgentPreview/index.js +++ b/server/api/reportAgentPreview/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x23165a,_0x19d021){var _0x40c6c4=function(_0x57e397){while(--_0x57e397){_0x23165a['push'](_0x23165a['shift']());}};_0x40c6c4(++_0x19d021);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1b828b,_0x344400){_0x1b828b=_0x1b828b-0x0;var _0x98da1a=_0xa9e0[_0x1b828b];return _0x98da1a;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router; \ No newline at end of file +var _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0xbf99dd,_0x255ca3){var _0x3f173d=function(_0x110182){while(--_0x110182){_0xbf99dd['push'](_0xbf99dd['shift']());}};_0x3f173d(++_0x255ca3);}(_0x9c44,0x178));var _0x49c4=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x9c44[_0x3bf83f];return _0x22c4a9;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x49c4('0x6')]=router; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.attributes.js b/server/api/reportAgentPreview/reportAgentPreview.attributes.js index 0176459..9b345f2 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 _0x31c2=['DATE','sequelize','exports','INTEGER','STRING'];(function(_0x3c3178,_0x4e3f0e){var _0x3c9458=function(_0x5d72bd){while(--_0x5d72bd){_0x3c3178['push'](_0x3c3178['shift']());}};_0x3c9458(++_0x4e3f0e);}(_0x31c2,0x1e1));var _0x231c=function(_0x33dda7,_0x40c20f){_0x33dda7=_0x33dda7-0x0;var _0x1218d1=_0x31c2[_0x33dda7];return _0x1218d1;};'use strict';var Sequelize=require(_0x231c('0x0'));module[_0x231c('0x1')]={'state':{'type':Sequelize[_0x231c('0x2')](0x2)},'statedesc':{'type':Sequelize[_0x231c('0x3')]},'scheduledat':{'type':Sequelize[_0x231c('0x4')]},'uniqueid':{'type':Sequelize[_0x231c('0x3')]},'starttime':{'type':Sequelize[_0x231c('0x4')]},'responsetime':{'type':Sequelize[_0x231c('0x4')]},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize[_0x231c('0x3')]},'membername':{'type':Sequelize[_0x231c('0x3')]}}; \ No newline at end of file +var _0x31c2=['DATE','sequelize','exports','INTEGER','STRING'];(function(_0x9796cd,_0x1fa7f9){var _0x2e085a=function(_0x4427b1){while(--_0x4427b1){_0x9796cd['push'](_0x9796cd['shift']());}};_0x2e085a(++_0x1fa7f9);}(_0x31c2,0x1e1));var _0x231c=function(_0x2aa0a7,_0x50cd99){_0x2aa0a7=_0x2aa0a7-0x0;var _0x4932ed=_0x31c2[_0x2aa0a7];return _0x4932ed;};'use strict';var Sequelize=require(_0x231c('0x0'));module[_0x231c('0x1')]={'state':{'type':Sequelize[_0x231c('0x2')](0x2)},'statedesc':{'type':Sequelize[_0x231c('0x3')]},'scheduledat':{'type':Sequelize[_0x231c('0x4')]},'uniqueid':{'type':Sequelize[_0x231c('0x3')]},'starttime':{'type':Sequelize[_0x231c('0x4')]},'responsetime':{'type':Sequelize[_0x231c('0x4')]},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize[_0x231c('0x3')]},'membername':{'type':Sequelize[_0x231c('0x3')]}}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.model.js b/server/api/reportAgentPreview/reportAgentPreview.model.js index 11dab12..a7f7a09 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 _0x7deb=['path','../../config/environment','./reportAgentPreview.attributes','exports','api','bluebird'];(function(_0x2bdc83,_0x2f5c9d){var _0x44167d=function(_0x158de6){while(--_0x158de6){_0x2bdc83['push'](_0x2bdc83['shift']());}};_0x44167d(++_0x2f5c9d);}(_0x7deb,0x196));var _0xb7de=function(_0x226ad1,_0x2858e2){_0x226ad1=_0x226ad1-0x0;var _0x16b625=_0x7deb[_0x226ad1];return _0x16b625;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0xb7de('0x0'));var moment=require('moment');var BPromise=require(_0xb7de('0x1'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb7de('0x2'));var rimraf=require('rimraf');var config=require(_0xb7de('0x3'));var attributes=require(_0xb7de('0x4'));module[_0xb7de('0x5')]=function(_0x54ba35,_0x33c1ea){return _0x54ba35['define']('ReportAgentPreview',attributes,{'tableName':'report_agent_preview','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xaa5a=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./reportAgentPreview.attributes','ReportAgentPreview','report_agent_preview','util'];(function(_0x28611e,_0x586726){var _0x530f69=function(_0x407906){while(--_0x407906){_0x28611e['push'](_0x28611e['shift']());}};_0x530f69(++_0x586726);}(_0xaa5a,0x8e));var _0xaaa5=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xaa5a[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0xaaa5('0x0'));var logger=require(_0xaaa5('0x1'))(_0xaaa5('0x2'));var moment=require(_0xaaa5('0x3'));var BPromise=require(_0xaaa5('0x4'));var rp=require(_0xaaa5('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xaaa5('0x6'));var config=require(_0xaaa5('0x7'));var attributes=require(_0xaaa5('0x8'));module['exports']=function(_0x3982c5,_0x1835f8){return _0x3982c5['define'](_0xaaa5('0x9'),attributes,{'tableName':_0xaaa5('0xa'),'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 ab25a00..a241b47 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 _0xb4a6=['randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','error','ReportAgentPreview,\x20%s,\x20%s','message','result','ReportAgentPreview','create','body','options','raw','CreateReportAgentPreview','stringify','catch','lodash','util','moment','bluebird'];(function(_0x817a54,_0x3a6069){var _0x16cf04=function(_0x2f207a){while(--_0x2f207a){_0x817a54['push'](_0x817a54['shift']());}};_0x16cf04(++_0x3a6069);}(_0xb4a6,0x1be));var _0x6b4a=function(_0x20f9bc,_0x1057f0){_0x20f9bc=_0x20f9bc-0x0;var _0x2060a4=_0xb4a6[_0x20f9bc];return _0x2060a4;};'use strict';var _=require(_0x6b4a('0x0'));var util=require(_0x6b4a('0x1'));var moment=require(_0x6b4a('0x2'));var BPromise=require(_0x6b4a('0x3'));var rs=require(_0x6b4a('0x4'));var fs=require('fs');var Redis=require(_0x6b4a('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x6b4a('0x6'));var logger=require(_0x6b4a('0x7'))(_0x6b4a('0x8'));var config=require(_0x6b4a('0x9'));var jayson=require(_0x6b4a('0xa'));var client=jayson[_0x6b4a('0xb')][_0x6b4a('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x3de310,_0x7c1271,_0x3fe467){return new BPromise(function(_0x5640c4,_0x200d1f){return client[_0x6b4a('0xd')](_0x3de310,_0x3fe467)[_0x6b4a('0xe')](function(_0x1a0a91){logger[_0x6b4a('0xf')]('ReportAgentPreview,\x20%s,\x20%s',_0x7c1271,_0x6b4a('0x10'));logger[_0x6b4a('0x11')]('ReportAgentPreview,\x20%s,\x20%s,\x20%s',_0x7c1271,_0x6b4a('0x10'),JSON['stringify'](_0x1a0a91));if(_0x1a0a91[_0x6b4a('0x12')]){if(_0x1a0a91[_0x6b4a('0x12')]['code']===0x1f4){logger[_0x6b4a('0x12')](_0x6b4a('0x13'),_0x7c1271,_0x1a0a91[_0x6b4a('0x12')][_0x6b4a('0x14')]);return _0x200d1f(_0x1a0a91[_0x6b4a('0x12')][_0x6b4a('0x14')]);}logger[_0x6b4a('0x12')](_0x6b4a('0x13'),_0x7c1271,_0x1a0a91[_0x6b4a('0x12')][_0x6b4a('0x14')]);return _0x5640c4(_0x1a0a91[_0x6b4a('0x12')]['message']);}else{logger[_0x6b4a('0xf')]('ReportAgentPreview,\x20%s,\x20%s',_0x7c1271,'request\x20sent');_0x5640c4(_0x1a0a91[_0x6b4a('0x15')][_0x6b4a('0x14')]);}})['catch'](function(_0xd0bcf7){logger[_0x6b4a('0x12')](_0x6b4a('0x13'),_0x7c1271,_0xd0bcf7);_0x200d1f(_0xd0bcf7);});});}exports['CreateReportAgentPreview']=function(_0x9e69bb){var _0x147dcb=this;return new Promise(function(_0x520871,_0x132ed7){return db[_0x6b4a('0x16')][_0x6b4a('0x17')](_0x9e69bb[_0x6b4a('0x18')],{'raw':_0x9e69bb[_0x6b4a('0x19')]?_0x9e69bb[_0x6b4a('0x19')][_0x6b4a('0x1a')]===undefined?!![]:![]:!![]})[_0x6b4a('0xe')](function(_0x3006ff){logger[_0x6b4a('0xf')](_0x6b4a('0x1b'),_0x9e69bb);logger['debug'](_0x6b4a('0x1b'),_0x9e69bb,JSON[_0x6b4a('0x1c')](_0x3006ff));_0x520871(_0x3006ff);})[_0x6b4a('0x1d')](function(_0x49b543){logger[_0x6b4a('0x12')](_0x6b4a('0x1b'),_0x49b543[_0x6b4a('0x14')],_0x9e69bb);_0x132ed7(_0x147dcb[_0x6b4a('0x12')](0x1f4,_0x49b543[_0x6b4a('0x14')]));});});}; \ No newline at end of file +var _0x2de6=['../../config/environment','jayson/promise','client','http','request','then','info','ReportAgentPreview,\x20%s,\x20%s','debug','request\x20sent','error','code','message','result','catch','body','options','raw','CreateReportAgentPreview','stringify','moment','ioredis'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2de6,0x1a0));var _0x62de=function(_0x2a046e,_0x1be4b7){_0x2a046e=_0x2a046e-0x0;var _0x1fe8d5=_0x2de6[_0x2a046e];return _0x1fe8d5;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x62de('0x0'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x62de('0x1'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x62de('0x2'));var jayson=require(_0x62de('0x3'));var client=jayson[_0x62de('0x4')][_0x62de('0x5')]({'port':0x232a});function respondWithRpcPromise(_0x1a7663,_0x5902af,_0x11481a){return new BPromise(function(_0x513e85,_0x27deff){return client[_0x62de('0x6')](_0x1a7663,_0x11481a)[_0x62de('0x7')](function(_0x2ffbd0){logger[_0x62de('0x8')](_0x62de('0x9'),_0x5902af,'request\x20sent');logger[_0x62de('0xa')]('ReportAgentPreview,\x20%s,\x20%s,\x20%s',_0x5902af,_0x62de('0xb'),JSON['stringify'](_0x2ffbd0));if(_0x2ffbd0[_0x62de('0xc')]){if(_0x2ffbd0[_0x62de('0xc')][_0x62de('0xd')]===0x1f4){logger[_0x62de('0xc')](_0x62de('0x9'),_0x5902af,_0x2ffbd0[_0x62de('0xc')][_0x62de('0xe')]);return _0x27deff(_0x2ffbd0[_0x62de('0xc')]['message']);}logger[_0x62de('0xc')](_0x62de('0x9'),_0x5902af,_0x2ffbd0[_0x62de('0xc')][_0x62de('0xe')]);return _0x513e85(_0x2ffbd0[_0x62de('0xc')][_0x62de('0xe')]);}else{logger['info'](_0x62de('0x9'),_0x5902af,_0x62de('0xb'));_0x513e85(_0x2ffbd0[_0x62de('0xf')]['message']);}})[_0x62de('0x10')](function(_0x5bacaf){logger[_0x62de('0xc')]('ReportAgentPreview,\x20%s,\x20%s',_0x5902af,_0x5bacaf);_0x27deff(_0x5bacaf);});});}exports['CreateReportAgentPreview']=function(_0x45bb32){var _0x3eb0c9=this;return new Promise(function(_0x1c72c1,_0x5720d5){return db['ReportAgentPreview']['create'](_0x45bb32[_0x62de('0x11')],{'raw':_0x45bb32[_0x62de('0x12')]?_0x45bb32[_0x62de('0x12')][_0x62de('0x13')]===undefined?!![]:![]:!![]})[_0x62de('0x7')](function(_0x28e874){logger[_0x62de('0x8')]('CreateReportAgentPreview',_0x45bb32);logger[_0x62de('0xa')](_0x62de('0x14'),_0x45bb32,JSON[_0x62de('0x15')](_0x28e874));_0x1c72c1(_0x28e874);})[_0x62de('0x10')](function(_0x30bf80){logger['error'](_0x62de('0x14'),_0x30bf80[_0x62de('0xe')],_0x45bb32);_0x5720d5(_0x3eb0c9[_0x62de('0xc')](0x1f4,_0x30bf80[_0x62de('0xe')]));});});}; \ No newline at end of file diff --git a/server/api/rpc/index.js b/server/api/rpc/index.js index 4501675..ef5ab8d 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 _0xfcef=['/trunks','/campaigns','campaigns','/fax/accounts','faxAccounts','chatQueuesWaitingInteractions','/mail/queues/waitinginteractions','/openchannel/queues/waitinginteractions','openchannelQueuesWaitingInteractions','/openchannel/queues/:id/waitinginteractions','openchannelQueuesIdWaitingInteractions','/sms/queues/waitinginteractions','smsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','/fax/queues/waitinginteractions','faxQueuesWaitingInteractions','post','/mail/queues/:id/notify','queueNotify','mail','/mail/queues/:id','showMailQueues','/chat/queues/:id/notify','chat','showChatQueues','fax','/fax/queues/:id','/openchannel/queues/:id/notify','openchannel','showOpenchannelQueues','sms','/whatsapp/queues/:id/notify','showSmsQueues','/whatsapp/queues/:id','/agents/:id/notify','agentNotify','multer','util','path','Router','../../components/auth/service','./rpc.controller','get','/voice/channels','isAuthenticated','voiceChannels','/voice/channels/:uniqueid/mixmonitor','voiceChannelMixMonitor','/voice/channels/:uniqueid/stopmixmonitor','voiceChannelStopMixMonitor','voiceQueues','/chat/queues','chatQueues','mailQueues','/mail/accounts','mailAccounts','openchannelQueues','/sms/queues','smsQueues','/whatsapp/queues','whatsappQueues','voiceQueuesPreview','/voice/queues/channels','voiceQueuesChannels','/voice/queues/channels/:uniqueid','voiceQueuesChannel','/voice/queues/channels/:uniqueid/redirect/:exten','voiceQueuesChannelRedirect','/voice/queues/:id','showVoiceQueues','updateVoiceQueue','/outbound','/outbound/channels','/agents','agents','put','/agents/:id/capacity','agentCapacity','/telephones','telephones'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xfcef,0x74));var _0xffce=function(_0x57e36f,_0x73f8b8){_0x57e36f=_0x57e36f-0x0;var _0x2dfa06=_0xfcef[_0x57e36f];return _0x2dfa06;};'use strict';var multer=require(_0xffce('0x0'));var util=require(_0xffce('0x1'));var path=require(_0xffce('0x2'));var express=require('express');var router=express[_0xffce('0x3')]();var auth=require(_0xffce('0x4'));var controller=require(_0xffce('0x5'));router[_0xffce('0x6')](_0xffce('0x7'),auth[_0xffce('0x8')](),controller[_0xffce('0x9')]);router['get'](_0xffce('0xa'),auth[_0xffce('0x8')](),controller[_0xffce('0xb')]);router['get'](_0xffce('0xc'),auth[_0xffce('0x8')](),controller[_0xffce('0xd')]);router['get']('/voice/queues',auth[_0xffce('0x8')](),controller[_0xffce('0xe')]);router[_0xffce('0x6')](_0xffce('0xf'),auth['isAuthenticated'](),controller[_0xffce('0x10')]);router['get']('/mail/queues',auth['isAuthenticated'](),controller[_0xffce('0x11')]);router[_0xffce('0x6')](_0xffce('0x12'),auth['isAuthenticated'](),controller[_0xffce('0x13')]);router['get']('/openchannel/queues',auth['isAuthenticated'](),controller[_0xffce('0x14')]);router[_0xffce('0x6')](_0xffce('0x15'),auth['isAuthenticated'](),controller[_0xffce('0x16')]);router['get'](_0xffce('0x17'),auth[_0xffce('0x8')](),controller[_0xffce('0x18')]);router[_0xffce('0x6')]('/fax/queues',auth['isAuthenticated'](),controller['faxQueues']);router[_0xffce('0x6')]('/voice/queues/preview/:id',auth[_0xffce('0x8')](),controller[_0xffce('0x19')]);router[_0xffce('0x6')](_0xffce('0x1a'),auth[_0xffce('0x8')](),controller[_0xffce('0x1b')]);router['get'](_0xffce('0x1c'),auth[_0xffce('0x8')](),controller[_0xffce('0x1d')]);router[_0xffce('0x6')]('/voice/queues/channels/:uniqueid/hangup',auth['isAuthenticated'](),controller['voiceQueuesChannelHangup']);router[_0xffce('0x6')](_0xffce('0x1e'),auth['isAuthenticated'](),controller[_0xffce('0x1f')]);router[_0xffce('0x6')](_0xffce('0x20'),auth[_0xffce('0x8')](),controller[_0xffce('0x21')]);router['put']('/voice/queues/:id',auth[_0xffce('0x8')](),controller[_0xffce('0x22')]);router[_0xffce('0x6')](_0xffce('0x23'),auth[_0xffce('0x8')](),controller['outbound']);router[_0xffce('0x6')](_0xffce('0x24'),auth[_0xffce('0x8')](),controller['outboundChannels']);router[_0xffce('0x6')](_0xffce('0x25'),auth[_0xffce('0x8')](),controller[_0xffce('0x26')]);router[_0xffce('0x27')](_0xffce('0x28'),auth[_0xffce('0x8')](),controller[_0xffce('0x29')]);router[_0xffce('0x6')](_0xffce('0x2a'),auth[_0xffce('0x8')](),controller[_0xffce('0x2b')]);router[_0xffce('0x6')](_0xffce('0x2c'),auth[_0xffce('0x8')](),controller['trunks']);router[_0xffce('0x6')](_0xffce('0x2d'),auth[_0xffce('0x8')](),controller[_0xffce('0x2e')]);router[_0xffce('0x6')](_0xffce('0x2f'),auth[_0xffce('0x8')](),controller[_0xffce('0x30')]);router[_0xffce('0x6')]('/chat/queues/waitinginteractions',auth['isAuthenticated'](),controller[_0xffce('0x31')]);router[_0xffce('0x6')](_0xffce('0x32'),auth[_0xffce('0x8')](),controller['mailQueuesWaitingInteractions']);router[_0xffce('0x6')](_0xffce('0x33'),auth['isAuthenticated'](),controller[_0xffce('0x34')]);router[_0xffce('0x6')](_0xffce('0x35'),auth[_0xffce('0x8')](),controller[_0xffce('0x36')]);router[_0xffce('0x6')](_0xffce('0x37'),auth['isAuthenticated'](),controller[_0xffce('0x38')]);router[_0xffce('0x6')]('/whatsapp/queues/waitinginteractions',auth[_0xffce('0x8')](),controller[_0xffce('0x39')]);router[_0xffce('0x6')](_0xffce('0x3a'),auth[_0xffce('0x8')](),controller[_0xffce('0x3b')]);router[_0xffce('0x3c')](_0xffce('0x3d'),auth[_0xffce('0x8')](),controller[_0xffce('0x3e')](_0xffce('0x3f')));router[_0xffce('0x6')](_0xffce('0x40'),auth[_0xffce('0x8')](),controller[_0xffce('0x41')]);router[_0xffce('0x3c')](_0xffce('0x42'),auth[_0xffce('0x8')](),controller[_0xffce('0x3e')](_0xffce('0x43')));router[_0xffce('0x6')]('/chat/queues/:id',auth[_0xffce('0x8')](),controller[_0xffce('0x44')]);router[_0xffce('0x3c')]('/fax/queues/:id/notify',auth[_0xffce('0x8')](),controller[_0xffce('0x3e')](_0xffce('0x45')));router[_0xffce('0x6')](_0xffce('0x46'),auth[_0xffce('0x8')](),controller['showFaxQueues']);router[_0xffce('0x3c')](_0xffce('0x47'),auth[_0xffce('0x8')](),controller[_0xffce('0x3e')](_0xffce('0x48')));router[_0xffce('0x6')]('/openchannel/queues/:id',auth[_0xffce('0x8')](),controller[_0xffce('0x49')]);router[_0xffce('0x3c')]('/sms/queues/:id/notify',auth[_0xffce('0x8')](),controller[_0xffce('0x3e')](_0xffce('0x4a')));router[_0xffce('0x3c')](_0xffce('0x4b'),auth[_0xffce('0x8')](),controller[_0xffce('0x3e')]('whatsapp'));router[_0xffce('0x6')]('/sms/queues/:id',auth[_0xffce('0x8')](),controller[_0xffce('0x4c')]);router[_0xffce('0x6')](_0xffce('0x4d'),auth['isAuthenticated'](),controller['showWhatsappQueues']);router[_0xffce('0x3c')](_0xffce('0x4e'),auth[_0xffce('0x8')](),controller[_0xffce('0x4f')]);module['exports']=router; \ No newline at end of file +var _0x856e=['smsQueuesWaitingInteractions','/whatsapp/queues/waitinginteractions','whatsappQueuesWaitingInteractions','faxQueuesWaitingInteractions','/mail/queues/:id/notify','queueNotify','mail','/mail/queues/:id','showMailQueues','post','/chat/queues/:id/notify','/chat/queues/:id','showChatQueues','/fax/queues/:id','showFaxQueues','openchannel','/openchannel/queues/:id','/sms/queues/:id/notify','whatsapp','/sms/queues/:id','showSmsQueues','showWhatsappQueues','multer','util','path','express','Router','../../components/auth/service','./rpc.controller','get','/voice/channels','isAuthenticated','voiceChannels','/voice/channels/:uniqueid/mixmonitor','voiceChannelMixMonitor','/voice/channels/:uniqueid/stopmixmonitor','voiceChannelStopMixMonitor','/chat/queues','chatQueues','/mail/queues','mailQueues','mailAccounts','openchannelQueues','/sms/queues','smsQueues','whatsappQueues','/fax/queues','faxQueues','/voice/queues/preview/:id','voiceQueuesPreview','/voice/queues/channels','voiceQueuesChannels','/voice/queues/channels/:uniqueid/hangup','voiceQueuesChannelRedirect','/voice/queues/:id','showVoiceQueues','updateVoiceQueue','/outbound','outbound','outboundChannels','/agents','/agents/:id/capacity','/telephones','telephones','/trunks','campaigns','/fax/accounts','/chat/queues/waitinginteractions','/mail/queues/waitinginteractions','/openchannel/queues/waitinginteractions','openchannelQueuesWaitingInteractions','/openchannel/queues/:id/waitinginteractions','openchannelQueuesIdWaitingInteractions','/sms/queues/waitinginteractions'];(function(_0x3ee1fe,_0x59f2a1){var _0x1ae57a=function(_0x1ef0c4){while(--_0x1ef0c4){_0x3ee1fe['push'](_0x3ee1fe['shift']());}};_0x1ae57a(++_0x59f2a1);}(_0x856e,0xaa));var _0xe856=function(_0x1c7137,_0x4c7c26){_0x1c7137=_0x1c7137-0x0;var _0xeb4432=_0x856e[_0x1c7137];return _0xeb4432;};'use strict';var multer=require(_0xe856('0x0'));var util=require(_0xe856('0x1'));var path=require(_0xe856('0x2'));var express=require(_0xe856('0x3'));var router=express[_0xe856('0x4')]();var auth=require(_0xe856('0x5'));var controller=require(_0xe856('0x6'));router[_0xe856('0x7')](_0xe856('0x8'),auth[_0xe856('0x9')](),controller[_0xe856('0xa')]);router[_0xe856('0x7')](_0xe856('0xb'),auth[_0xe856('0x9')](),controller[_0xe856('0xc')]);router['get'](_0xe856('0xd'),auth[_0xe856('0x9')](),controller[_0xe856('0xe')]);router[_0xe856('0x7')]('/voice/queues',auth[_0xe856('0x9')](),controller['voiceQueues']);router['get'](_0xe856('0xf'),auth[_0xe856('0x9')](),controller[_0xe856('0x10')]);router[_0xe856('0x7')](_0xe856('0x11'),auth[_0xe856('0x9')](),controller[_0xe856('0x12')]);router[_0xe856('0x7')]('/mail/accounts',auth[_0xe856('0x9')](),controller[_0xe856('0x13')]);router[_0xe856('0x7')]('/openchannel/queues',auth[_0xe856('0x9')](),controller[_0xe856('0x14')]);router['get'](_0xe856('0x15'),auth[_0xe856('0x9')](),controller[_0xe856('0x16')]);router[_0xe856('0x7')]('/whatsapp/queues',auth[_0xe856('0x9')](),controller[_0xe856('0x17')]);router['get'](_0xe856('0x18'),auth[_0xe856('0x9')](),controller[_0xe856('0x19')]);router[_0xe856('0x7')](_0xe856('0x1a'),auth[_0xe856('0x9')](),controller[_0xe856('0x1b')]);router[_0xe856('0x7')](_0xe856('0x1c'),auth[_0xe856('0x9')](),controller[_0xe856('0x1d')]);router[_0xe856('0x7')]('/voice/queues/channels/:uniqueid',auth[_0xe856('0x9')](),controller['voiceQueuesChannel']);router[_0xe856('0x7')](_0xe856('0x1e'),auth[_0xe856('0x9')](),controller['voiceQueuesChannelHangup']);router['get']('/voice/queues/channels/:uniqueid/redirect/:exten',auth[_0xe856('0x9')](),controller[_0xe856('0x1f')]);router['get'](_0xe856('0x20'),auth[_0xe856('0x9')](),controller[_0xe856('0x21')]);router['put'](_0xe856('0x20'),auth[_0xe856('0x9')](),controller[_0xe856('0x22')]);router['get'](_0xe856('0x23'),auth[_0xe856('0x9')](),controller[_0xe856('0x24')]);router[_0xe856('0x7')]('/outbound/channels',auth[_0xe856('0x9')](),controller[_0xe856('0x25')]);router[_0xe856('0x7')](_0xe856('0x26'),auth[_0xe856('0x9')](),controller['agents']);router['put'](_0xe856('0x27'),auth[_0xe856('0x9')](),controller['agentCapacity']);router[_0xe856('0x7')](_0xe856('0x28'),auth[_0xe856('0x9')](),controller[_0xe856('0x29')]);router[_0xe856('0x7')](_0xe856('0x2a'),auth[_0xe856('0x9')](),controller['trunks']);router[_0xe856('0x7')]('/campaigns',auth[_0xe856('0x9')](),controller[_0xe856('0x2b')]);router[_0xe856('0x7')](_0xe856('0x2c'),auth[_0xe856('0x9')](),controller['faxAccounts']);router[_0xe856('0x7')](_0xe856('0x2d'),auth[_0xe856('0x9')](),controller['chatQueuesWaitingInteractions']);router[_0xe856('0x7')](_0xe856('0x2e'),auth[_0xe856('0x9')](),controller['mailQueuesWaitingInteractions']);router[_0xe856('0x7')](_0xe856('0x2f'),auth['isAuthenticated'](),controller[_0xe856('0x30')]);router['get'](_0xe856('0x31'),auth[_0xe856('0x9')](),controller[_0xe856('0x32')]);router[_0xe856('0x7')](_0xe856('0x33'),auth[_0xe856('0x9')](),controller[_0xe856('0x34')]);router['get'](_0xe856('0x35'),auth[_0xe856('0x9')](),controller[_0xe856('0x36')]);router[_0xe856('0x7')]('/fax/queues/waitinginteractions',auth[_0xe856('0x9')](),controller[_0xe856('0x37')]);router['post'](_0xe856('0x38'),auth[_0xe856('0x9')](),controller[_0xe856('0x39')](_0xe856('0x3a')));router[_0xe856('0x7')](_0xe856('0x3b'),auth[_0xe856('0x9')](),controller[_0xe856('0x3c')]);router[_0xe856('0x3d')](_0xe856('0x3e'),auth[_0xe856('0x9')](),controller[_0xe856('0x39')]('chat'));router[_0xe856('0x7')](_0xe856('0x3f'),auth[_0xe856('0x9')](),controller[_0xe856('0x40')]);router[_0xe856('0x3d')]('/fax/queues/:id/notify',auth[_0xe856('0x9')](),controller[_0xe856('0x39')]('fax'));router['get'](_0xe856('0x41'),auth[_0xe856('0x9')](),controller[_0xe856('0x42')]);router['post']('/openchannel/queues/:id/notify',auth['isAuthenticated'](),controller[_0xe856('0x39')](_0xe856('0x43')));router[_0xe856('0x7')](_0xe856('0x44'),auth[_0xe856('0x9')](),controller['showOpenchannelQueues']);router['post'](_0xe856('0x45'),auth[_0xe856('0x9')](),controller[_0xe856('0x39')]('sms'));router[_0xe856('0x3d')]('/whatsapp/queues/:id/notify',auth[_0xe856('0x9')](),controller[_0xe856('0x39')](_0xe856('0x46')));router[_0xe856('0x7')](_0xe856('0x47'),auth['isAuthenticated'](),controller[_0xe856('0x48')]);router['get']('/whatsapp/queues/:id',auth[_0xe856('0x9')](),controller[_0xe856('0x49')]);router[_0xe856('0x3d')]('/agents/:id/notify',auth[_0xe856('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 fdacad9..c6a3da2 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 _0x5075=['api','client','http','then','error','message','result','status','json','name','send','isNil','rows','find','VoiceChannels','query','catch','voiceChannelMixMonitor','VoiceChannelMixMonitor','merge','params','voiceChannelStopMixMonitor','VoiceChannelStopMixMonitor','voiceQueues','updateVoiceQueue','UpdateVoiceQueue','voiceQueuesPreview','voiceQueuesChannels','VoiceQueuesChannels','voiceQueuesChannel','VoiceQueuesChannel','voiceQueuesChannelHangup','outbound','Outbound','OutboundChannels','agents','Agents','agentCapacity','body','interaction','user','hasOwnProperty','MemberReport','length','YYYY-MM-DD\x20HH:mm:ss','updateAttributes','findOrCreate','INTERACTION','SIP/%s','interface','agent','internal','capacity','telephones','Telephones','trunks','campaigns','Campaigns','chatQueues','ChatQueues','mailQueues','MailQueues','showMailQueues','MailAccounts','openchannelQueues','OpenchannelQueues','showOpenchannelQueues','smsQueues','SmsQueues','showSmsQueues','whatsappQueues','showWhatsappQueues','WhatsappQueues','FaxQueues','FaxAccounts','chatQueuesWaitingInteractions','ChatQueuesWaitingInteractions','MailQueuesWaitingInteractions','openchannelQueuesIdWaitingInteractions','OpenchannelQueuesWaitingInteractions','type','filter','map','queue_id','uniq','indexOf','smsQueuesWaitingInteractions','SmsQueuesWaitingInteractions','WhatsappQueuesWaitingInteractions','faxQueuesWaitingInteractions','queueNotify','capitalize','Website','Account','Queue','findOne','\x20Queue\x20not\x20found','Message','Interaction','\x20Message\x20not\x20found','queue','InteractionId','From','QueueId','TransferReport','create','Start','agentNotify','Channel\x20field\x20is\x20mandatory','channel','chat','Agent\x20not\x20found','MessageId','agentTransferTimeout','*,*,*,*','bluebird','moment','lodash','util','../../mysqldb','../../config/logger'];(function(_0xf785ae,_0x211032){var _0x2e9f79=function(_0x708ca1){while(--_0x708ca1){_0xf785ae['push'](_0xf785ae['shift']());}};_0x2e9f79(++_0x211032);}(_0x5075,0x73));var _0x5507=function(_0x292f35,_0x72e859){_0x292f35=_0x292f35-0x0;var _0x288e75=_0x5075[_0x292f35];return _0x288e75;};'use strict';var BPromise=require(_0x5507('0x0'));var moment=require(_0x5507('0x1'));var _=require(_0x5507('0x2'));var util=require(_0x5507('0x3'));var db=require(_0x5507('0x4'))['db'];var logger=require(_0x5507('0x5'))(_0x5507('0x6'));var jayson=require('jayson/promise');var amiClient=jayson[_0x5507('0x7')][_0x5507('0x8')]({'port':0x232a});var mailClient=jayson[_0x5507('0x7')]['http']({'port':0x232b});var routingClient=jayson['client'][_0x5507('0x8')]({'port':0x232c});function respondWithRpcPromise(_0x773559,_0x4c2d6d,_0x42c232){return new BPromise(function(_0x7cc84c,_0xbf4b50){var _0x504e05=_0x42c232?_0x42c232:amiClient;return _0x504e05['request'](_0x773559,_0x4c2d6d)[_0x5507('0x9')](function(_0x441bdc){if(_0x441bdc[_0x5507('0xa')]){if(_0x441bdc[_0x5507('0xa')]['code']===0x1f4){return _0xbf4b50(_0x441bdc[_0x5507('0xa')][_0x5507('0xb')]);}return _0x7cc84c(_0x441bdc['error'][_0x5507('0xb')]);}else{_0x7cc84c(_0x441bdc[_0x5507('0xc')]);}})['catch'](function(_0x37a1de){_0xbf4b50(_0x37a1de);});});}function respondWithResult(_0x2a2ea0,_0x32c872){_0x32c872=_0x32c872||0xc8;return function(_0x267f27){if(_0x267f27){return _0x2a2ea0[_0x5507('0xd')](_0x32c872)[_0x5507('0xe')](_0x267f27);}return _0x2a2ea0['sendStatus'](0x194);};}function handleError(_0x9cc3f9,_0x2b7c43){_0x2b7c43=_0x2b7c43||0x1f4;return function(_0xc828e5){logger[_0x5507('0xa')](_0xc828e5['stack']);if(_0xc828e5[_0x5507('0xf')]){delete _0xc828e5[_0x5507('0xf')];}_0x9cc3f9[_0x5507('0xd')](_0x2b7c43)[_0x5507('0x10')](_0xc828e5);};}function findById(_0xa6e4b3){return function(_0x2ede34){if(!_[_0x5507('0x11')](_0xa6e4b3)&&!_[_0x5507('0x11')](_0x2ede34)&&!_[_0x5507('0x11')](_0x2ede34[_0x5507('0x12')])){return _[_0x5507('0x13')](_0x2ede34[_0x5507('0x12')],function(_0x3822dd){return _0x3822dd['id']==_0xa6e4b3;});}return null;};}exports['voiceChannels']=function(_0x14dab0,_0x276a81){return respondWithRpcPromise(_0x5507('0x14'),_0x14dab0[_0x5507('0x15')])['then'](respondWithResult(_0x276a81,null))[_0x5507('0x16')](handleError(_0x276a81,null));};exports[_0x5507('0x17')]=function(_0x1a54b0,_0x3ca1f7){return respondWithRpcPromise(_0x5507('0x18'),_[_0x5507('0x19')](_0x1a54b0['query'],_0x1a54b0[_0x5507('0x1a')]))[_0x5507('0x9')](respondWithResult(_0x3ca1f7,null))[_0x5507('0x16')](handleError(_0x3ca1f7,null));};exports[_0x5507('0x1b')]=function(_0x141d22,_0x2de482){return respondWithRpcPromise(_0x5507('0x1c'),_[_0x5507('0x19')](_0x141d22[_0x5507('0x15')],_0x141d22[_0x5507('0x1a')]))[_0x5507('0x9')](respondWithResult(_0x2de482,null))[_0x5507('0x16')](handleError(_0x2de482,null));};exports[_0x5507('0x1d')]=function(_0x2ee6ed,_0x1a2203){return respondWithRpcPromise('VoiceQueues',_0x2ee6ed[_0x5507('0x15')])['then'](respondWithResult(_0x1a2203,null))[_0x5507('0x16')](handleError(_0x1a2203,null));};exports['showVoiceQueues']=function(_0xa66a01,_0x24668b){return respondWithRpcPromise('VoiceQueues',_0xa66a01['query'])[_0x5507('0x9')](findById(_0xa66a01[_0x5507('0x1a')]['id']))['then'](respondWithResult(_0x24668b,null))[_0x5507('0x16')](handleError(_0x24668b,null));};exports[_0x5507('0x1e')]=function(_0x85d383,_0x38f4d9){return respondWithRpcPromise(_0x5507('0x1f'),_[_0x5507('0x19')](_0x85d383['body'],_0x85d383[_0x5507('0x1a')]))[_0x5507('0x9')](respondWithResult(_0x38f4d9,null))[_0x5507('0x16')](handleError(_0x38f4d9,null));};exports[_0x5507('0x20')]=function(_0x29dd58,_0x495bbe){return respondWithRpcPromise('VoiceQueuesPreview',_[_0x5507('0x19')](_0x29dd58[_0x5507('0x15')],_0x29dd58[_0x5507('0x1a')]))[_0x5507('0x9')](respondWithResult(_0x495bbe,null))['catch'](handleError(_0x495bbe,null));};exports[_0x5507('0x21')]=function(_0x13b6e5,_0xab91bc){return respondWithRpcPromise(_0x5507('0x22'),_0x13b6e5[_0x5507('0x15')])[_0x5507('0x9')](respondWithResult(_0xab91bc,null))[_0x5507('0x16')](handleError(_0xab91bc,null));};exports[_0x5507('0x23')]=function(_0x5ede36,_0xf61ba7){return respondWithRpcPromise(_0x5507('0x24'),_[_0x5507('0x19')](_0x5ede36['query'],_0x5ede36['params']))[_0x5507('0x9')](respondWithResult(_0xf61ba7,null))[_0x5507('0x16')](handleError(_0xf61ba7,null));};exports[_0x5507('0x25')]=function(_0x17d01c,_0x143d97){return respondWithRpcPromise('VoiceQueuesChannelHangup',_['merge'](_0x17d01c[_0x5507('0x15')],_0x17d01c[_0x5507('0x1a')]))[_0x5507('0x9')](respondWithResult(_0x143d97,null))[_0x5507('0x16')](handleError(_0x143d97,null));};exports['voiceQueuesChannelRedirect']=function(_0x54e4bd,_0x23ea7c){return respondWithRpcPromise('VoiceQueuesChannelRedirect',_[_0x5507('0x19')](_0x54e4bd[_0x5507('0x15')],_0x54e4bd[_0x5507('0x1a')]))[_0x5507('0x9')](respondWithResult(_0x23ea7c,null))[_0x5507('0x16')](handleError(_0x23ea7c,null));};exports[_0x5507('0x26')]=function(_0x1c8506,_0x2b962d){return respondWithRpcPromise(_0x5507('0x27'),_0x1c8506[_0x5507('0x15')])['then'](respondWithResult(_0x2b962d,null))['catch'](handleError(_0x2b962d,null));};exports['outboundChannels']=function(_0x570eee,_0x526022){return respondWithRpcPromise(_0x5507('0x28'),_0x570eee[_0x5507('0x15')])[_0x5507('0x9')](respondWithResult(_0x526022,null))[_0x5507('0x16')](handleError(_0x526022,null));};exports[_0x5507('0x29')]=function(_0xbef058,_0x101de3){var _0xbc9f93;return respondWithRpcPromise(_0x5507('0x2a'),_0xbef058[_0x5507('0x15')])[_0x5507('0x9')](function(_0x2db0b2){_0xbc9f93=_0x2db0b2;return respondWithRpcPromise(_0x5507('0x2a'),_0xbef058['query'],routingClient);})['then'](function(_0x50eb32){return _[_0x5507('0x19')]({},_0x50eb32,_0xbc9f93);})[_0x5507('0x9')](respondWithResult(_0x101de3,null))[_0x5507('0x16')](handleError(_0x101de3,null));};exports[_0x5507('0x2b')]=function(_0xcd4df5,_0x17d7db){if(_0xcd4df5[_0x5507('0x2c')]&&_0xcd4df5[_0x5507('0x2c')][_0x5507('0x2d')]&&_0xcd4df5[_0x5507('0x2e')]&&_0xcd4df5[_0x5507('0x2e')][_0x5507('0xf')]){for(var _0x24d7b5 in _0xcd4df5[_0x5507('0x2c')][_0x5507('0x2d')]){if(_0xcd4df5[_0x5507('0x2c')][_0x5507('0x2d')][_0x5507('0x2f')](_0x24d7b5)){db[_0x5507('0x30')]['findAll']({'where':{'channel':_0x24d7b5,'membername':_0xcd4df5[_0x5507('0x2e')][_0x5507('0xf')],'type':'INTERACTION','exitAt':null,'uniqueid':_0xcd4df5['body'][_0x5507('0x2d')][_0x24d7b5]&&_0xcd4df5[_0x5507('0x2c')][_0x5507('0x2d')][_0x24d7b5][_0x5507('0x31')]?{'$notIn':_0xcd4df5[_0x5507('0x2c')]['interaction'][_0x24d7b5]}:{'$ne':null}}})[_0x5507('0x9')](function(_0x39ac17){var _0x1dfc9c=moment()['format'](_0x5507('0x32'));for(var _0x33022e=0x0,_0xadea4c=_0x39ac17[_0x5507('0x31')];_0x33022e<_0xadea4c;_0x33022e+=0x1){_0x39ac17[_0x33022e][_0x5507('0x33')]({'exitAt':_0x1dfc9c});}});for(var _0x48d72b=0x0;_0x48d72b<_0xcd4df5[_0x5507('0x2c')]['interaction'][_0x24d7b5][_0x5507('0x31')];_0x48d72b+=0x1){db[_0x5507('0x30')][_0x5507('0x34')]({'where':{'channel':_0x24d7b5,'membername':_0xcd4df5[_0x5507('0x2e')][_0x5507('0xf')],'type':_0x5507('0x35'),'uniqueid':_0xcd4df5[_0x5507('0x2c')][_0x5507('0x2d')][_0x24d7b5][_0x48d72b],'exitAt':null},'defaults':{'channel':_0x24d7b5,'membername':_0xcd4df5['user'][_0x5507('0xf')],'interface':_[_0x5507('0x11')](_0xcd4df5['user']['interface'])?util['format'](_0x5507('0x36'),_0xcd4df5['user'][_0x5507('0xf')]):_0xcd4df5['user'][_0x5507('0x37')],'type':'INTERACTION','enterAt':moment()['format'](_0x5507('0x32')),'role':_0x5507('0x38'),'internal':_0xcd4df5[_0x5507('0x2e')][_0x5507('0x39')],'uniqueid':_0xcd4df5[_0x5507('0x2c')][_0x5507('0x2d')][_0x24d7b5][_0x48d72b]}});}}}}return respondWithRpcPromise('AgentCapacity',{'id':_0xcd4df5[_0x5507('0x1a')]['id'],'capacity':_0xcd4df5[_0x5507('0x2c')][_0x5507('0x3a')]},routingClient)['then'](respondWithResult(_0x17d7db,null))[_0x5507('0x16')](handleError(_0x17d7db,null));};exports[_0x5507('0x3b')]=function(_0x505e71,_0x2e0cfc){return respondWithRpcPromise(_0x5507('0x3c'),_0x505e71[_0x5507('0x15')])[_0x5507('0x9')](respondWithResult(_0x2e0cfc,null))[_0x5507('0x16')](handleError(_0x2e0cfc,null));};exports[_0x5507('0x3d')]=function(_0x245456,_0x1bb575){return respondWithRpcPromise('Trunks',_0x245456['query'])[_0x5507('0x9')](respondWithResult(_0x1bb575,null))[_0x5507('0x16')](handleError(_0x1bb575,null));};exports[_0x5507('0x3e')]=function(_0x1b34c8,_0xce851d){return respondWithRpcPromise(_0x5507('0x3f'),_0x1b34c8[_0x5507('0x15')])[_0x5507('0x9')](respondWithResult(_0xce851d,null))[_0x5507('0x16')](handleError(_0xce851d,null));};exports[_0x5507('0x40')]=function(_0x40cda2,_0x13dc8b){return respondWithRpcPromise(_0x5507('0x41'),_0x40cda2[_0x5507('0x15')],routingClient)[_0x5507('0x9')](respondWithResult(_0x13dc8b,null))[_0x5507('0x16')](handleError(_0x13dc8b,null));};exports['showChatQueues']=function(_0x3f47af,_0x56e0cd){return respondWithRpcPromise('ChatQueues',_0x3f47af[_0x5507('0x15')],routingClient)[_0x5507('0x9')](findById(_0x3f47af[_0x5507('0x1a')]['id']))[_0x5507('0x9')](respondWithResult(_0x56e0cd,null))['catch'](handleError(_0x56e0cd,null));};exports[_0x5507('0x42')]=function(_0x2f41a9,_0x314d4e){return respondWithRpcPromise(_0x5507('0x43'),_0x2f41a9[_0x5507('0x15')],routingClient)[_0x5507('0x9')](respondWithResult(_0x314d4e,null))['catch'](handleError(_0x314d4e,null));};exports[_0x5507('0x44')]=function(_0x46e589,_0x3a2f9f){return respondWithRpcPromise('MailQueues',_0x46e589['query'],routingClient)[_0x5507('0x9')](findById(_0x46e589['params']['id']))[_0x5507('0x9')](respondWithResult(_0x3a2f9f,null))[_0x5507('0x16')](handleError(_0x3a2f9f,null));};exports['mailAccounts']=function(_0x3e796d,_0x1b622f){return respondWithRpcPromise(_0x5507('0x45'),_0x3e796d[_0x5507('0x15')],mailClient)[_0x5507('0x9')](respondWithResult(_0x1b622f,null))[_0x5507('0x16')](handleError(_0x1b622f,null));};exports[_0x5507('0x46')]=function(_0x2928f2,_0x737d39){return respondWithRpcPromise(_0x5507('0x47'),_0x2928f2[_0x5507('0x15')],routingClient)[_0x5507('0x9')](respondWithResult(_0x737d39,null))['catch'](handleError(_0x737d39,null));};exports[_0x5507('0x48')]=function(_0x2e904b,_0x219e34){return respondWithRpcPromise(_0x5507('0x47'),_0x2e904b[_0x5507('0x15')],routingClient)['then'](findById(_0x2e904b[_0x5507('0x1a')]['id']))['then'](respondWithResult(_0x219e34,null))[_0x5507('0x16')](handleError(_0x219e34,null));};exports[_0x5507('0x49')]=function(_0x241733,_0x54c009){return respondWithRpcPromise(_0x5507('0x4a'),_0x241733[_0x5507('0x15')],routingClient)[_0x5507('0x9')](respondWithResult(_0x54c009,null))['catch'](handleError(_0x54c009,null));};exports[_0x5507('0x4b')]=function(_0x5cfdb0,_0x3dca7d){return respondWithRpcPromise('SmsQueues',_0x5cfdb0['query'],routingClient)[_0x5507('0x9')](findById(_0x5cfdb0[_0x5507('0x1a')]['id']))[_0x5507('0x9')](respondWithResult(_0x3dca7d,null))[_0x5507('0x16')](handleError(_0x3dca7d,null));};exports[_0x5507('0x4c')]=function(_0x31cc0d,_0x4bf567){return respondWithRpcPromise('WhatsappQueues',_0x31cc0d[_0x5507('0x15')],routingClient)[_0x5507('0x9')](respondWithResult(_0x4bf567,null))[_0x5507('0x16')](handleError(_0x4bf567,null));};exports[_0x5507('0x4d')]=function(_0x5e3e73,_0x388faa){return respondWithRpcPromise(_0x5507('0x4e'),_0x5e3e73[_0x5507('0x15')],routingClient)[_0x5507('0x9')](findById(_0x5e3e73[_0x5507('0x1a')]['id']))[_0x5507('0x9')](respondWithResult(_0x388faa,null))[_0x5507('0x16')](handleError(_0x388faa,null));};exports['faxQueues']=function(_0x3802dd,_0xfdbbe5){return respondWithRpcPromise(_0x5507('0x4f'),_0x3802dd['query'],routingClient)[_0x5507('0x9')](respondWithResult(_0xfdbbe5,null))['catch'](handleError(_0xfdbbe5,null));};exports['showFaxQueues']=function(_0x55c257,_0x1fef49){return respondWithRpcPromise(_0x5507('0x4f'),_0x55c257[_0x5507('0x15')],routingClient)[_0x5507('0x9')](findById(_0x55c257[_0x5507('0x1a')]['id']))[_0x5507('0x9')](respondWithResult(_0x1fef49,null))[_0x5507('0x16')](handleError(_0x1fef49,null));};exports['faxAccounts']=function(_0x1812d7,_0x48ed80){return respondWithRpcPromise(_0x5507('0x50'),_0x1812d7[_0x5507('0x15')])[_0x5507('0x9')](respondWithResult(_0x48ed80,null))[_0x5507('0x16')](handleError(_0x48ed80,null));};exports[_0x5507('0x51')]=function(_0x120108,_0x4423a8){return respondWithRpcPromise(_0x5507('0x52'),_0x120108[_0x5507('0x15')],routingClient)[_0x5507('0x9')](respondWithResult(_0x4423a8,null))[_0x5507('0x16')](handleError(_0x4423a8,null));};exports['mailQueuesWaitingInteractions']=function(_0x94b11c,_0xbb0a62){return respondWithRpcPromise(_0x5507('0x53'),_0x94b11c['query'],routingClient)[_0x5507('0x9')](respondWithResult(_0xbb0a62,null))[_0x5507('0x16')](handleError(_0xbb0a62,null));};exports['openchannelQueuesWaitingInteractions']=function(_0x26e777,_0x5815fb){return respondWithRpcPromise('OpenchannelQueuesWaitingInteractions',_0x26e777[_0x5507('0x15')],routingClient)['then'](respondWithResult(_0x5815fb,null))[_0x5507('0x16')](handleError(_0x5815fb,null));};exports[_0x5507('0x54')]=function(_0xfb59be,_0xda51d5){return respondWithRpcPromise(_0x5507('0x55'),_0xfb59be[_0x5507('0x15')],routingClient)['then'](function(_0x43fccf){if(_0xfb59be[_0x5507('0x15')][_0x5507('0x56')]!==undefined){var _0x75aa3c=_(_0x43fccf[_0x5507('0x12')])[_0x5507('0x57')]([_0xfb59be[_0x5507('0x15')][_0x5507('0x56')],_0xfb59be[_0x5507('0x1a')]['id']])[_0x5507('0x58')](_0x5507('0x59'))[_0x5507('0x5a')]()['value']();return _0x43fccf[_0x5507('0x12')][_0x5507('0x57')](function(_0x10f066){return _0x75aa3c[_0x5507('0x5b')](_0x10f066[_0x5507('0x59')])>-0x1;});}else{return _0x43fccf[_0x5507('0x12')]['filter'](function(_0x1dad83){return _0x1dad83['queue_id']===parseInt(_0xfb59be[_0x5507('0x1a')]['id']);});}})['then'](respondWithResult(_0xda51d5,null))['catch'](handleError(_0xda51d5,null));};exports[_0x5507('0x5c')]=function(_0x20274e,_0x2979b1){return respondWithRpcPromise(_0x5507('0x5d'),_0x20274e[_0x5507('0x15')],routingClient)['then'](respondWithResult(_0x2979b1,null))[_0x5507('0x16')](handleError(_0x2979b1,null));};exports['whatsappQueuesWaitingInteractions']=function(_0x410c16,_0x471142){return respondWithRpcPromise(_0x5507('0x5e'),_0x410c16[_0x5507('0x15')],routingClient)['then'](respondWithResult(_0x471142,null))[_0x5507('0x16')](handleError(_0x471142,null));};exports[_0x5507('0x5f')]=function(_0x42bef4,_0x5a8a1b){return respondWithRpcPromise('FaxQueuesWaitingInteractions',_0x42bef4[_0x5507('0x15')],routingClient)[_0x5507('0x9')](respondWithResult(_0x5a8a1b,null))[_0x5507('0x16')](handleError(_0x5a8a1b,null));};exports[_0x5507('0x60')]=function(_0x77a772){return function(_0x26f796,_0x3d7e21){var _0x10b62e,_0x18bed6;var _0x27265e=_[_0x5507('0x61')](_0x77a772);var _0x160e54=_0x77a772==='chat'?_0x5507('0x62'):_0x5507('0x63');return db[_0x27265e+_0x5507('0x64')][_0x5507('0x65')]({'raw':!![],'where':{'id':_0x26f796[_0x5507('0x1a')]['id']}})[_0x5507('0x9')](function(_0x33717e){if(_['isNil'](_0x33717e)){throw new Error(_0x27265e+_0x5507('0x66'));}_0x10b62e=_0x33717e;return db[_0x27265e+_0x5507('0x67')][_0x5507('0x65')]({'where':{'id':_0x26f796[_0x5507('0x2c')]['messageId']},'include':[{'model':db[_0x27265e+_0x5507('0x68')],'as':_0x5507('0x68')},{'model':db[_0x27265e+_0x160e54],'as':_0x5507('0x63')}]});})[_0x5507('0x9')](function(_0x1a5d2e){if(_[_0x5507('0x11')](_0x1a5d2e)){throw new Error(_0x27265e+_0x5507('0x69'));}_0x18bed6=_0x1a5d2e;return _0x1a5d2e['update']({'read':0x0,'readAt':null,'UserId':null});})[_0x5507('0x9')](function(){var _0x38144b={'uniqueid':_0x77a772+'.'+_0x18bed6['id']+'.'+_0x18bed6[_0x5507('0x68')]['id'],'FromUserId':_0x26f796[_0x5507('0x2e')]['id'],'type':_0x5507('0x6a')};_0x38144b[_0x27265e+'MessageId']=_0x18bed6['id'];_0x38144b[_0x27265e+_0x5507('0x6b')]=_0x18bed6[_0x5507('0x68')]['id'];_0x38144b[_0x5507('0x6c')+_0x27265e+_0x160e54+'Id']=_0x18bed6[_0x5507('0x63')]['id'];_0x38144b['To'+_0x27265e+_0x5507('0x6d')]=_0x10b62e['id'];return db[_0x27265e+_0x5507('0x6e')][_0x5507('0x6f')](_0x38144b);})[_0x5507('0x9')](function(){return respondWithRpcPromise(_0x5507('0x70'),{'channel':_0x77a772,'interaction':_0x18bed6[_0x5507('0x68')],'message':_0x18bed6,'account':_0x18bed6[_0x5507('0x63')],'applications':[{'id':0x0,'priority':0x1,'app':_0x5507('0x6a'),'appdata':_0x10b62e[_0x5507('0xf')]+','+(_0x18bed6['Account']['queueTransferTimeout']||0x12c),'interval':'*,*,*,*'}]},routingClient);})[_0x5507('0x9')](respondWithResult(_0x3d7e21,null))[_0x5507('0x16')](handleError(_0x3d7e21,null));};};exports[_0x5507('0x71')]=function(_0x3b04a7,_0x1e913a){var _0x4e1578,_0x2339c7;if(_[_0x5507('0x11')](_0x3b04a7[_0x5507('0x2c')]['channel'])){throw new Error(_0x5507('0x72'));}var _0x5808d9=_0x3b04a7['body'][_0x5507('0x73')];var _0x58b56c=_[_0x5507('0x61')](_0x5808d9);var _0x5c6043=_0x5808d9===_0x5507('0x74')?_0x5507('0x62'):_0x5507('0x63');return db['User']['findOne']({'raw':!![],'where':{'id':_0x3b04a7[_0x5507('0x1a')]['id'],'role':_0x5507('0x38')}})[_0x5507('0x9')](function(_0x51bec0){if(_[_0x5507('0x11')](_0x51bec0)){throw new Error(_0x5507('0x75'));}_0x4e1578=_0x51bec0;return db[_0x58b56c+_0x5507('0x67')][_0x5507('0x65')]({'where':{'id':_0x3b04a7['body']['messageId']},'include':[{'model':db[_0x58b56c+_0x5507('0x68')],'as':_0x5507('0x68')},{'model':db[_0x58b56c+_0x5c6043],'as':'Account'}]});})[_0x5507('0x9')](function(_0x13c0f5){if(_[_0x5507('0x11')](_0x13c0f5)){throw new Error(_0x58b56c+_0x5507('0x69'));}_0x2339c7=_0x13c0f5;return _0x13c0f5['update']({'read':0x0,'readAt':null,'UserId':null});})[_0x5507('0x9')](function(){var _0x3a2b0f={'uniqueid':_0x5808d9+'.'+_0x2339c7['id']+'.'+_0x2339c7['Interaction']['id'],'FromUserId':_0x3b04a7[_0x5507('0x2e')]['id'],'type':_0x5507('0x6a'),'ToUserId':_0x4e1578['id']};_0x3a2b0f[_0x58b56c+_0x5507('0x76')]=_0x2339c7['id'];_0x3a2b0f[_0x58b56c+'InteractionId']=_0x2339c7[_0x5507('0x68')]['id'];_0x3a2b0f[_0x5507('0x6c')+_0x58b56c+_0x5c6043+'Id']=_0x2339c7['Account']['id'];return db[_0x58b56c+_0x5507('0x6e')][_0x5507('0x6f')](_0x3a2b0f);})['then'](function(){return respondWithRpcPromise(_0x5507('0x70'),{'channel':_0x5808d9,'interaction':_0x2339c7[_0x5507('0x68')],'message':_0x2339c7,'account':_0x2339c7[_0x5507('0x63')],'applications':[{'id':0x0,'priority':0x1,'app':'agent','appdata':_0x4e1578[_0x5507('0xf')]+','+(_0x2339c7[_0x5507('0x63')][_0x5507('0x77')]||0x12c),'interval':_0x5507('0x78')}]},routingClient);})[_0x5507('0x9')](respondWithResult(_0x1e913a,null))[_0x5507('0x16')](handleError(_0x1e913a,null));}; \ No newline at end of file +var _0x6f47=['voiceQueuesChannelHangup','voiceQueuesChannelRedirect','VoiceQueuesChannelRedirect','outbound','Outbound','outboundChannels','OutboundChannels','agents','Agents','agentCapacity','interaction','user','hasOwnProperty','MemberReport','INTERACTION','length','format','YYYY-MM-DD\x20HH:mm:ss','interface','agent','internal','telephones','trunks','Trunks','Campaigns','showChatQueues','ChatQueues','MailQueues','showMailQueues','mailAccounts','OpenchannelQueues','showOpenchannelQueues','smsQueues','SmsQueues','WhatsappQueues','showWhatsappQueues','faxQueues','FaxQueues','faxAccounts','FaxAccounts','chatQueuesWaitingInteractions','ChatQueuesWaitingInteractions','mailQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','openchannelQueuesIdWaitingInteractions','type','filter','map','queue_id','uniq','value','smsQueuesWaitingInteractions','SmsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','WhatsappQueuesWaitingInteractions','faxQueuesWaitingInteractions','FaxQueuesWaitingInteractions','queueNotify','capitalize','chat','Website','Account','Queue','findOne','\x20Queue\x20not\x20found','Message','Interaction','\x20Message\x20not\x20found','update','queue','MessageId','InteractionId','From','QueueId','Start','queueTransferTimeout','*,*,*,*','channel','Channel\x20field\x20is\x20mandatory','User','create','moment','lodash','../../mysqldb','api','client','http','request','then','error','code','message','result','catch','status','sendStatus','stack','name','send','isNil','rows','find','voiceChannels','VoiceChannels','query','voiceChannelMixMonitor','merge','params','VoiceChannelStopMixMonitor','VoiceQueues','showVoiceQueues','UpdateVoiceQueue','body','voiceQueuesPreview','VoiceQueuesPreview','voiceQueuesChannels','VoiceQueuesChannels','voiceQueuesChannel'];(function(_0x1d5f3d,_0xc51123){var _0x2c488a=function(_0x599c93){while(--_0x599c93){_0x1d5f3d['push'](_0x1d5f3d['shift']());}};_0x2c488a(++_0xc51123);}(_0x6f47,0xc7));var _0x76f4=function(_0x5834bc,_0x3d4801){_0x5834bc=_0x5834bc-0x0;var _0x3e183a=_0x6f47[_0x5834bc];return _0x3e183a;};'use strict';var BPromise=require('bluebird');var moment=require(_0x76f4('0x0'));var _=require(_0x76f4('0x1'));var util=require('util');var db=require(_0x76f4('0x2'))['db'];var logger=require('../../config/logger')(_0x76f4('0x3'));var jayson=require('jayson/promise');var amiClient=jayson[_0x76f4('0x4')][_0x76f4('0x5')]({'port':0x232a});var mailClient=jayson[_0x76f4('0x4')][_0x76f4('0x5')]({'port':0x232b});var routingClient=jayson['client'][_0x76f4('0x5')]({'port':0x232c});function respondWithRpcPromise(_0xfc2405,_0x2176a7,_0x497f99){return new BPromise(function(_0x1a3172,_0x25656d){var _0x65d2c7=_0x497f99?_0x497f99:amiClient;return _0x65d2c7[_0x76f4('0x6')](_0xfc2405,_0x2176a7)[_0x76f4('0x7')](function(_0x4c6b5c){if(_0x4c6b5c['error']){if(_0x4c6b5c[_0x76f4('0x8')][_0x76f4('0x9')]===0x1f4){return _0x25656d(_0x4c6b5c['error']['message']);}return _0x1a3172(_0x4c6b5c[_0x76f4('0x8')][_0x76f4('0xa')]);}else{_0x1a3172(_0x4c6b5c[_0x76f4('0xb')]);}})[_0x76f4('0xc')](function(_0x1aee7f){_0x25656d(_0x1aee7f);});});}function respondWithResult(_0xafd21e,_0xf7e347){_0xf7e347=_0xf7e347||0xc8;return function(_0x3ec740){if(_0x3ec740){return _0xafd21e[_0x76f4('0xd')](_0xf7e347)['json'](_0x3ec740);}return _0xafd21e[_0x76f4('0xe')](0x194);};}function handleError(_0x30dabf,_0x5da1ff){_0x5da1ff=_0x5da1ff||0x1f4;return function(_0x4b6021){logger['error'](_0x4b6021[_0x76f4('0xf')]);if(_0x4b6021[_0x76f4('0x10')]){delete _0x4b6021[_0x76f4('0x10')];}_0x30dabf[_0x76f4('0xd')](_0x5da1ff)[_0x76f4('0x11')](_0x4b6021);};}function findById(_0x2b5e23){return function(_0x46ba51){if(!_[_0x76f4('0x12')](_0x2b5e23)&&!_[_0x76f4('0x12')](_0x46ba51)&&!_[_0x76f4('0x12')](_0x46ba51[_0x76f4('0x13')])){return _[_0x76f4('0x14')](_0x46ba51[_0x76f4('0x13')],function(_0x38450e){return _0x38450e['id']==_0x2b5e23;});}return null;};}exports[_0x76f4('0x15')]=function(_0x397360,_0xfedbe4){return respondWithRpcPromise(_0x76f4('0x16'),_0x397360[_0x76f4('0x17')])[_0x76f4('0x7')](respondWithResult(_0xfedbe4,null))[_0x76f4('0xc')](handleError(_0xfedbe4,null));};exports[_0x76f4('0x18')]=function(_0x5bf3d5,_0x262937){return respondWithRpcPromise('VoiceChannelMixMonitor',_[_0x76f4('0x19')](_0x5bf3d5[_0x76f4('0x17')],_0x5bf3d5[_0x76f4('0x1a')]))['then'](respondWithResult(_0x262937,null))['catch'](handleError(_0x262937,null));};exports['voiceChannelStopMixMonitor']=function(_0x465240,_0x681d67){return respondWithRpcPromise(_0x76f4('0x1b'),_[_0x76f4('0x19')](_0x465240[_0x76f4('0x17')],_0x465240[_0x76f4('0x1a')]))[_0x76f4('0x7')](respondWithResult(_0x681d67,null))['catch'](handleError(_0x681d67,null));};exports['voiceQueues']=function(_0x3794fa,_0x497913){return respondWithRpcPromise(_0x76f4('0x1c'),_0x3794fa['query'])['then'](respondWithResult(_0x497913,null))['catch'](handleError(_0x497913,null));};exports[_0x76f4('0x1d')]=function(_0x38300d,_0xd368a2){return respondWithRpcPromise(_0x76f4('0x1c'),_0x38300d[_0x76f4('0x17')])[_0x76f4('0x7')](findById(_0x38300d['params']['id']))[_0x76f4('0x7')](respondWithResult(_0xd368a2,null))['catch'](handleError(_0xd368a2,null));};exports['updateVoiceQueue']=function(_0x5b3f07,_0x10ddb4){return respondWithRpcPromise(_0x76f4('0x1e'),_[_0x76f4('0x19')](_0x5b3f07[_0x76f4('0x1f')],_0x5b3f07['params']))[_0x76f4('0x7')](respondWithResult(_0x10ddb4,null))['catch'](handleError(_0x10ddb4,null));};exports[_0x76f4('0x20')]=function(_0x3c7513,_0x43ac4a){return respondWithRpcPromise(_0x76f4('0x21'),_[_0x76f4('0x19')](_0x3c7513['query'],_0x3c7513['params']))[_0x76f4('0x7')](respondWithResult(_0x43ac4a,null))[_0x76f4('0xc')](handleError(_0x43ac4a,null));};exports[_0x76f4('0x22')]=function(_0x281db6,_0x1f2adf){return respondWithRpcPromise(_0x76f4('0x23'),_0x281db6[_0x76f4('0x17')])[_0x76f4('0x7')](respondWithResult(_0x1f2adf,null))[_0x76f4('0xc')](handleError(_0x1f2adf,null));};exports[_0x76f4('0x24')]=function(_0x308af2,_0x2527a6){return respondWithRpcPromise('VoiceQueuesChannel',_['merge'](_0x308af2['query'],_0x308af2['params']))[_0x76f4('0x7')](respondWithResult(_0x2527a6,null))[_0x76f4('0xc')](handleError(_0x2527a6,null));};exports[_0x76f4('0x25')]=function(_0x456b1f,_0x26fdd6){return respondWithRpcPromise('VoiceQueuesChannelHangup',_[_0x76f4('0x19')](_0x456b1f[_0x76f4('0x17')],_0x456b1f[_0x76f4('0x1a')]))[_0x76f4('0x7')](respondWithResult(_0x26fdd6,null))[_0x76f4('0xc')](handleError(_0x26fdd6,null));};exports[_0x76f4('0x26')]=function(_0xb806cc,_0x28d9d6){return respondWithRpcPromise(_0x76f4('0x27'),_[_0x76f4('0x19')](_0xb806cc[_0x76f4('0x17')],_0xb806cc[_0x76f4('0x1a')]))[_0x76f4('0x7')](respondWithResult(_0x28d9d6,null))[_0x76f4('0xc')](handleError(_0x28d9d6,null));};exports[_0x76f4('0x28')]=function(_0x88506b,_0x3308e3){return respondWithRpcPromise(_0x76f4('0x29'),_0x88506b['query'])[_0x76f4('0x7')](respondWithResult(_0x3308e3,null))[_0x76f4('0xc')](handleError(_0x3308e3,null));};exports[_0x76f4('0x2a')]=function(_0x589637,_0x597e83){return respondWithRpcPromise(_0x76f4('0x2b'),_0x589637['query'])[_0x76f4('0x7')](respondWithResult(_0x597e83,null))['catch'](handleError(_0x597e83,null));};exports[_0x76f4('0x2c')]=function(_0x16f36d,_0x312243){var _0x378675;return respondWithRpcPromise(_0x76f4('0x2d'),_0x16f36d[_0x76f4('0x17')])[_0x76f4('0x7')](function(_0x109ad9){_0x378675=_0x109ad9;return respondWithRpcPromise(_0x76f4('0x2d'),_0x16f36d[_0x76f4('0x17')],routingClient);})['then'](function(_0x5b8d2d){return _[_0x76f4('0x19')]({},_0x5b8d2d,_0x378675);})[_0x76f4('0x7')](respondWithResult(_0x312243,null))[_0x76f4('0xc')](handleError(_0x312243,null));};exports[_0x76f4('0x2e')]=function(_0x2b7dc8,_0x2d6068){if(_0x2b7dc8[_0x76f4('0x1f')]&&_0x2b7dc8[_0x76f4('0x1f')][_0x76f4('0x2f')]&&_0x2b7dc8['user']&&_0x2b7dc8[_0x76f4('0x30')][_0x76f4('0x10')]){for(var _0x4f0d1a in _0x2b7dc8['body'][_0x76f4('0x2f')]){if(_0x2b7dc8[_0x76f4('0x1f')][_0x76f4('0x2f')][_0x76f4('0x31')](_0x4f0d1a)){db[_0x76f4('0x32')]['findAll']({'where':{'channel':_0x4f0d1a,'membername':_0x2b7dc8[_0x76f4('0x30')][_0x76f4('0x10')],'type':_0x76f4('0x33'),'exitAt':null,'uniqueid':_0x2b7dc8[_0x76f4('0x1f')][_0x76f4('0x2f')][_0x4f0d1a]&&_0x2b7dc8[_0x76f4('0x1f')]['interaction'][_0x4f0d1a][_0x76f4('0x34')]?{'$notIn':_0x2b7dc8[_0x76f4('0x1f')][_0x76f4('0x2f')][_0x4f0d1a]}:{'$ne':null}}})['then'](function(_0x571261){var _0x11ea58=moment()[_0x76f4('0x35')](_0x76f4('0x36'));for(var _0x2bea6d=0x0,_0x36fa03=_0x571261['length'];_0x2bea6d<_0x36fa03;_0x2bea6d+=0x1){_0x571261[_0x2bea6d]['updateAttributes']({'exitAt':_0x11ea58});}});for(var _0x8e5b60=0x0;_0x8e5b60<_0x2b7dc8['body'][_0x76f4('0x2f')][_0x4f0d1a][_0x76f4('0x34')];_0x8e5b60+=0x1){db['MemberReport']['findOrCreate']({'where':{'channel':_0x4f0d1a,'membername':_0x2b7dc8[_0x76f4('0x30')][_0x76f4('0x10')],'type':_0x76f4('0x33'),'uniqueid':_0x2b7dc8[_0x76f4('0x1f')]['interaction'][_0x4f0d1a][_0x8e5b60],'exitAt':null},'defaults':{'channel':_0x4f0d1a,'membername':_0x2b7dc8[_0x76f4('0x30')][_0x76f4('0x10')],'interface':_[_0x76f4('0x12')](_0x2b7dc8['user'][_0x76f4('0x37')])?util[_0x76f4('0x35')]('SIP/%s',_0x2b7dc8['user'][_0x76f4('0x10')]):_0x2b7dc8[_0x76f4('0x30')][_0x76f4('0x37')],'type':_0x76f4('0x33'),'enterAt':moment()[_0x76f4('0x35')]('YYYY-MM-DD\x20HH:mm:ss'),'role':_0x76f4('0x38'),'internal':_0x2b7dc8['user'][_0x76f4('0x39')],'uniqueid':_0x2b7dc8[_0x76f4('0x1f')][_0x76f4('0x2f')][_0x4f0d1a][_0x8e5b60]}});}}}}return respondWithRpcPromise('AgentCapacity',{'id':_0x2b7dc8[_0x76f4('0x1a')]['id'],'capacity':_0x2b7dc8[_0x76f4('0x1f')]['capacity']},routingClient)[_0x76f4('0x7')](respondWithResult(_0x2d6068,null))[_0x76f4('0xc')](handleError(_0x2d6068,null));};exports[_0x76f4('0x3a')]=function(_0x1c658c,_0x40ff20){return respondWithRpcPromise('Telephones',_0x1c658c[_0x76f4('0x17')])['then'](respondWithResult(_0x40ff20,null))[_0x76f4('0xc')](handleError(_0x40ff20,null));};exports[_0x76f4('0x3b')]=function(_0x154ba,_0x5121ec){return respondWithRpcPromise(_0x76f4('0x3c'),_0x154ba[_0x76f4('0x17')])[_0x76f4('0x7')](respondWithResult(_0x5121ec,null))[_0x76f4('0xc')](handleError(_0x5121ec,null));};exports['campaigns']=function(_0x2028e9,_0xf11e07){return respondWithRpcPromise(_0x76f4('0x3d'),_0x2028e9[_0x76f4('0x17')])['then'](respondWithResult(_0xf11e07,null))[_0x76f4('0xc')](handleError(_0xf11e07,null));};exports['chatQueues']=function(_0x129048,_0x190c8d){return respondWithRpcPromise('ChatQueues',_0x129048['query'],routingClient)[_0x76f4('0x7')](respondWithResult(_0x190c8d,null))[_0x76f4('0xc')](handleError(_0x190c8d,null));};exports[_0x76f4('0x3e')]=function(_0x596b51,_0x27ba06){return respondWithRpcPromise(_0x76f4('0x3f'),_0x596b51[_0x76f4('0x17')],routingClient)['then'](findById(_0x596b51['params']['id']))[_0x76f4('0x7')](respondWithResult(_0x27ba06,null))[_0x76f4('0xc')](handleError(_0x27ba06,null));};exports['mailQueues']=function(_0x490ced,_0x3f1840){return respondWithRpcPromise(_0x76f4('0x40'),_0x490ced[_0x76f4('0x17')],routingClient)[_0x76f4('0x7')](respondWithResult(_0x3f1840,null))[_0x76f4('0xc')](handleError(_0x3f1840,null));};exports[_0x76f4('0x41')]=function(_0x97be11,_0x36a52a){return respondWithRpcPromise(_0x76f4('0x40'),_0x97be11['query'],routingClient)['then'](findById(_0x97be11['params']['id']))[_0x76f4('0x7')](respondWithResult(_0x36a52a,null))[_0x76f4('0xc')](handleError(_0x36a52a,null));};exports[_0x76f4('0x42')]=function(_0x3b6c16,_0x4c9d64){return respondWithRpcPromise('MailAccounts',_0x3b6c16[_0x76f4('0x17')],mailClient)['then'](respondWithResult(_0x4c9d64,null))[_0x76f4('0xc')](handleError(_0x4c9d64,null));};exports['openchannelQueues']=function(_0x4285dd,_0x25e510){return respondWithRpcPromise(_0x76f4('0x43'),_0x4285dd[_0x76f4('0x17')],routingClient)['then'](respondWithResult(_0x25e510,null))[_0x76f4('0xc')](handleError(_0x25e510,null));};exports[_0x76f4('0x44')]=function(_0x22a0cc,_0x40c170){return respondWithRpcPromise(_0x76f4('0x43'),_0x22a0cc[_0x76f4('0x17')],routingClient)[_0x76f4('0x7')](findById(_0x22a0cc['params']['id']))[_0x76f4('0x7')](respondWithResult(_0x40c170,null))[_0x76f4('0xc')](handleError(_0x40c170,null));};exports[_0x76f4('0x45')]=function(_0x320a87,_0x28cf4c){return respondWithRpcPromise(_0x76f4('0x46'),_0x320a87[_0x76f4('0x17')],routingClient)[_0x76f4('0x7')](respondWithResult(_0x28cf4c,null))['catch'](handleError(_0x28cf4c,null));};exports['showSmsQueues']=function(_0xa3091a,_0x617924){return respondWithRpcPromise(_0x76f4('0x46'),_0xa3091a['query'],routingClient)[_0x76f4('0x7')](findById(_0xa3091a['params']['id']))[_0x76f4('0x7')](respondWithResult(_0x617924,null))[_0x76f4('0xc')](handleError(_0x617924,null));};exports['whatsappQueues']=function(_0xda0ac2,_0x37b7f7){return respondWithRpcPromise(_0x76f4('0x47'),_0xda0ac2[_0x76f4('0x17')],routingClient)[_0x76f4('0x7')](respondWithResult(_0x37b7f7,null))[_0x76f4('0xc')](handleError(_0x37b7f7,null));};exports[_0x76f4('0x48')]=function(_0x410d83,_0x1f7257){return respondWithRpcPromise('WhatsappQueues',_0x410d83[_0x76f4('0x17')],routingClient)['then'](findById(_0x410d83[_0x76f4('0x1a')]['id']))[_0x76f4('0x7')](respondWithResult(_0x1f7257,null))[_0x76f4('0xc')](handleError(_0x1f7257,null));};exports[_0x76f4('0x49')]=function(_0xfbb52c,_0x8de630){return respondWithRpcPromise(_0x76f4('0x4a'),_0xfbb52c[_0x76f4('0x17')],routingClient)[_0x76f4('0x7')](respondWithResult(_0x8de630,null))[_0x76f4('0xc')](handleError(_0x8de630,null));};exports['showFaxQueues']=function(_0x30f3de,_0x6f874d){return respondWithRpcPromise('FaxQueues',_0x30f3de[_0x76f4('0x17')],routingClient)[_0x76f4('0x7')](findById(_0x30f3de[_0x76f4('0x1a')]['id']))['then'](respondWithResult(_0x6f874d,null))[_0x76f4('0xc')](handleError(_0x6f874d,null));};exports[_0x76f4('0x4b')]=function(_0x3e829f,_0x52610a){return respondWithRpcPromise(_0x76f4('0x4c'),_0x3e829f[_0x76f4('0x17')])[_0x76f4('0x7')](respondWithResult(_0x52610a,null))[_0x76f4('0xc')](handleError(_0x52610a,null));};exports[_0x76f4('0x4d')]=function(_0x10ee07,_0x19b99c){return respondWithRpcPromise(_0x76f4('0x4e'),_0x10ee07[_0x76f4('0x17')],routingClient)['then'](respondWithResult(_0x19b99c,null))[_0x76f4('0xc')](handleError(_0x19b99c,null));};exports[_0x76f4('0x4f')]=function(_0x19fdc3,_0x39c9af){return respondWithRpcPromise('MailQueuesWaitingInteractions',_0x19fdc3[_0x76f4('0x17')],routingClient)[_0x76f4('0x7')](respondWithResult(_0x39c9af,null))[_0x76f4('0xc')](handleError(_0x39c9af,null));};exports['openchannelQueuesWaitingInteractions']=function(_0x43b44d,_0x1375d5){return respondWithRpcPromise(_0x76f4('0x50'),_0x43b44d[_0x76f4('0x17')],routingClient)[_0x76f4('0x7')](respondWithResult(_0x1375d5,null))['catch'](handleError(_0x1375d5,null));};exports[_0x76f4('0x51')]=function(_0x4dd41f,_0x2b8467){return respondWithRpcPromise(_0x76f4('0x50'),_0x4dd41f['query'],routingClient)['then'](function(_0x58251e){if(_0x4dd41f[_0x76f4('0x17')][_0x76f4('0x52')]!==undefined){var _0x1e7b6=_(_0x58251e[_0x76f4('0x13')])[_0x76f4('0x53')]([_0x4dd41f[_0x76f4('0x17')]['type'],_0x4dd41f[_0x76f4('0x1a')]['id']])[_0x76f4('0x54')](_0x76f4('0x55'))[_0x76f4('0x56')]()[_0x76f4('0x57')]();return _0x58251e[_0x76f4('0x13')][_0x76f4('0x53')](function(_0x202fc8){return _0x1e7b6['indexOf'](_0x202fc8[_0x76f4('0x55')])>-0x1;});}else{return _0x58251e['rows'][_0x76f4('0x53')](function(_0x30358a){return _0x30358a[_0x76f4('0x55')]===parseInt(_0x4dd41f[_0x76f4('0x1a')]['id']);});}})[_0x76f4('0x7')](respondWithResult(_0x2b8467,null))[_0x76f4('0xc')](handleError(_0x2b8467,null));};exports[_0x76f4('0x58')]=function(_0x2a0491,_0x54729b){return respondWithRpcPromise(_0x76f4('0x59'),_0x2a0491['query'],routingClient)['then'](respondWithResult(_0x54729b,null))['catch'](handleError(_0x54729b,null));};exports[_0x76f4('0x5a')]=function(_0x402209,_0x279040){return respondWithRpcPromise(_0x76f4('0x5b'),_0x402209['query'],routingClient)[_0x76f4('0x7')](respondWithResult(_0x279040,null))[_0x76f4('0xc')](handleError(_0x279040,null));};exports[_0x76f4('0x5c')]=function(_0x5f5c24,_0x12f16e){return respondWithRpcPromise(_0x76f4('0x5d'),_0x5f5c24[_0x76f4('0x17')],routingClient)[_0x76f4('0x7')](respondWithResult(_0x12f16e,null))[_0x76f4('0xc')](handleError(_0x12f16e,null));};exports[_0x76f4('0x5e')]=function(_0x3b5e15){return function(_0x4b562c,_0x2e991e){var _0xa49e2a,_0x4c7307;var _0x3bc914=_[_0x76f4('0x5f')](_0x3b5e15);var _0x5e6393=_0x3b5e15===_0x76f4('0x60')?_0x76f4('0x61'):_0x76f4('0x62');return db[_0x3bc914+_0x76f4('0x63')][_0x76f4('0x64')]({'raw':!![],'where':{'id':_0x4b562c[_0x76f4('0x1a')]['id']}})['then'](function(_0x2dac86){if(_[_0x76f4('0x12')](_0x2dac86)){throw new Error(_0x3bc914+_0x76f4('0x65'));}_0xa49e2a=_0x2dac86;return db[_0x3bc914+_0x76f4('0x66')]['findOne']({'where':{'id':_0x4b562c[_0x76f4('0x1f')]['messageId']},'include':[{'model':db[_0x3bc914+_0x76f4('0x67')],'as':'Interaction'},{'model':db[_0x3bc914+_0x5e6393],'as':_0x76f4('0x62')}]});})[_0x76f4('0x7')](function(_0x59e9ed){if(_['isNil'](_0x59e9ed)){throw new Error(_0x3bc914+_0x76f4('0x68'));}_0x4c7307=_0x59e9ed;return _0x59e9ed[_0x76f4('0x69')]({'read':0x0,'readAt':null,'UserId':null});})[_0x76f4('0x7')](function(){var _0x4a2969={'uniqueid':_0x3b5e15+'.'+_0x4c7307['id']+'.'+_0x4c7307['Interaction']['id'],'FromUserId':_0x4b562c[_0x76f4('0x30')]['id'],'type':_0x76f4('0x6a')};_0x4a2969[_0x3bc914+_0x76f4('0x6b')]=_0x4c7307['id'];_0x4a2969[_0x3bc914+_0x76f4('0x6c')]=_0x4c7307[_0x76f4('0x67')]['id'];_0x4a2969[_0x76f4('0x6d')+_0x3bc914+_0x5e6393+'Id']=_0x4c7307[_0x76f4('0x62')]['id'];_0x4a2969['To'+_0x3bc914+_0x76f4('0x6e')]=_0xa49e2a['id'];return db[_0x3bc914+'TransferReport']['create'](_0x4a2969);})[_0x76f4('0x7')](function(){return respondWithRpcPromise(_0x76f4('0x6f'),{'channel':_0x3b5e15,'interaction':_0x4c7307[_0x76f4('0x67')],'message':_0x4c7307,'account':_0x4c7307['Account'],'applications':[{'id':0x0,'priority':0x1,'app':_0x76f4('0x6a'),'appdata':_0xa49e2a[_0x76f4('0x10')]+','+(_0x4c7307[_0x76f4('0x62')][_0x76f4('0x70')]||0x12c),'interval':_0x76f4('0x71')}]},routingClient);})[_0x76f4('0x7')](respondWithResult(_0x2e991e,null))[_0x76f4('0xc')](handleError(_0x2e991e,null));};};exports['agentNotify']=function(_0x13cf2a,_0x316f86){var _0x3e537b,_0x53252e;if(_[_0x76f4('0x12')](_0x13cf2a[_0x76f4('0x1f')][_0x76f4('0x72')])){throw new Error(_0x76f4('0x73'));}var _0x5080a9=_0x13cf2a[_0x76f4('0x1f')]['channel'];var _0xc80d4c=_['capitalize'](_0x5080a9);var _0x238df3=_0x5080a9===_0x76f4('0x60')?_0x76f4('0x61'):'Account';return db[_0x76f4('0x74')][_0x76f4('0x64')]({'raw':!![],'where':{'id':_0x13cf2a[_0x76f4('0x1a')]['id'],'role':'agent'}})[_0x76f4('0x7')](function(_0x460867){if(_['isNil'](_0x460867)){throw new Error('Agent\x20not\x20found');}_0x3e537b=_0x460867;return db[_0xc80d4c+_0x76f4('0x66')][_0x76f4('0x64')]({'where':{'id':_0x13cf2a['body']['messageId']},'include':[{'model':db[_0xc80d4c+_0x76f4('0x67')],'as':_0x76f4('0x67')},{'model':db[_0xc80d4c+_0x238df3],'as':'Account'}]});})[_0x76f4('0x7')](function(_0x54ae6c){if(_['isNil'](_0x54ae6c)){throw new Error(_0xc80d4c+'\x20Message\x20not\x20found');}_0x53252e=_0x54ae6c;return _0x54ae6c[_0x76f4('0x69')]({'read':0x0,'readAt':null,'UserId':null});})['then'](function(){var _0x59265d={'uniqueid':_0x5080a9+'.'+_0x53252e['id']+'.'+_0x53252e[_0x76f4('0x67')]['id'],'FromUserId':_0x13cf2a['user']['id'],'type':'queue','ToUserId':_0x3e537b['id']};_0x59265d[_0xc80d4c+_0x76f4('0x6b')]=_0x53252e['id'];_0x59265d[_0xc80d4c+'InteractionId']=_0x53252e[_0x76f4('0x67')]['id'];_0x59265d[_0x76f4('0x6d')+_0xc80d4c+_0x238df3+'Id']=_0x53252e['Account']['id'];return db[_0xc80d4c+'TransferReport'][_0x76f4('0x75')](_0x59265d);})[_0x76f4('0x7')](function(){return respondWithRpcPromise(_0x76f4('0x6f'),{'channel':_0x5080a9,'interaction':_0x53252e['Interaction'],'message':_0x53252e,'account':_0x53252e[_0x76f4('0x62')],'applications':[{'id':0x0,'priority':0x1,'app':_0x76f4('0x38'),'appdata':_0x3e537b[_0x76f4('0x10')]+','+(_0x53252e[_0x76f4('0x62')]['agentTransferTimeout']||0x12c),'interval':_0x76f4('0x71')}]},routingClient);})[_0x76f4('0x7')](respondWithResult(_0x316f86,null))[_0x76f4('0xc')](handleError(_0x316f86,null));}; \ No newline at end of file diff --git a/server/api/schedule/index.js b/server/api/schedule/index.js index 9d1c2a0..a30bd0a 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 _0x934b=['run','post','create','put','/:id','delete','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./schedule.controller','get','isAuthenticated','index','show','/:id/run'];(function(_0x46e363,_0x45d7e2){var _0x3fb059=function(_0x5e6274){while(--_0x5e6274){_0x46e363['push'](_0x46e363['shift']());}};_0x3fb059(++_0x45d7e2);}(_0x934b,0x6f));var _0xb934=function(_0x5acfde,_0x3596d4){_0x5acfde=_0x5acfde-0x0;var _0x123d61=_0x934b[_0x5acfde];return _0x123d61;};'use strict';var multer=require(_0xb934('0x0'));var util=require(_0xb934('0x1'));var path=require(_0xb934('0x2'));var timeout=require(_0xb934('0x3'));var express=require('express');var router=express[_0xb934('0x4')]();var fs_extra=require(_0xb934('0x5'));var auth=require(_0xb934('0x6'));var interaction=require(_0xb934('0x7'));var config=require(_0xb934('0x8'));var controller=require(_0xb934('0x9'));router[_0xb934('0xa')]('/',auth[_0xb934('0xb')](),controller[_0xb934('0xc')]);router[_0xb934('0xa')]('/:id',auth[_0xb934('0xb')](),controller[_0xb934('0xd')]);router[_0xb934('0xa')](_0xb934('0xe'),auth[_0xb934('0xb')](),controller[_0xb934('0xf')]);router[_0xb934('0x10')]('/',auth['isAuthenticated'](),controller[_0xb934('0x11')]);router[_0xb934('0x12')](_0xb934('0x13'),auth[_0xb934('0xb')](),controller['update']);router[_0xb934('0x14')](_0xb934('0x13'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x1a65=['util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./schedule.controller','get','isAuthenticated','index','/:id','show','/:id/run','run','post','create','update','destroy','exports','multer'];(function(_0x1cc8fe,_0x105328){var _0x230054=function(_0x1a1b56){while(--_0x1a1b56){_0x1cc8fe['push'](_0x1cc8fe['shift']());}};_0x230054(++_0x105328);}(_0x1a65,0x179));var _0x51a6=function(_0xb0ef57,_0x22011d){_0xb0ef57=_0xb0ef57-0x0;var _0x3ddf63=_0x1a65[_0xb0ef57];return _0x3ddf63;};'use strict';var multer=require(_0x51a6('0x0'));var util=require(_0x51a6('0x1'));var path=require(_0x51a6('0x2'));var timeout=require(_0x51a6('0x3'));var express=require(_0x51a6('0x4'));var router=express[_0x51a6('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x51a6('0x6'));var interaction=require(_0x51a6('0x7'));var config=require('../../config/environment');var controller=require(_0x51a6('0x8'));router[_0x51a6('0x9')]('/',auth[_0x51a6('0xa')](),controller[_0x51a6('0xb')]);router[_0x51a6('0x9')](_0x51a6('0xc'),auth[_0x51a6('0xa')](),controller[_0x51a6('0xd')]);router[_0x51a6('0x9')](_0x51a6('0xe'),auth[_0x51a6('0xa')](),controller[_0x51a6('0xf')]);router[_0x51a6('0x10')]('/',auth[_0x51a6('0xa')](),controller[_0x51a6('0x11')]);router['put'](_0x51a6('0xc'),auth[_0x51a6('0xa')](),controller[_0x51a6('0x12')]);router['delete']('/:id',auth[_0x51a6('0xa')](),controller[_0x51a6('0x13')]);module[_0x51a6('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 02b67fc..c783764 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 _0xa7cc=['days','csv','pdf','xlsx','custom','default','TEXT','sequelize','exports','STRING','BOOLEAN','0\x200\x20*\x20*\x20*','DATE','ENUM','years','quarters','weeks'];(function(_0x342700,_0x569f75){var _0x53406f=function(_0x3b3c32){while(--_0x3b3c32){_0x342700['push'](_0x342700['shift']());}};_0x53406f(++_0x569f75);}(_0xa7cc,0xc2));var _0xca7c=function(_0xc53b46,_0x3ec0b0){_0xc53b46=_0xc53b46-0x0;var _0x307642=_0xa7cc[_0xc53b46];return _0x307642;};'use strict';var Sequelize=require(_0xca7c('0x0'));module[_0xca7c('0x1')]={'name':{'type':Sequelize[_0xca7c('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'active':{'type':Sequelize[_0xca7c('0x3')],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0xca7c('0x2')],'allowNull':![],'defaultValue':_0xca7c('0x4')},'startAt':{'type':Sequelize[_0xca7c('0x5')],'allowNull':![]},'endAt':{'type':Sequelize[_0xca7c('0x5')],'allowNull':![]},'subtractNumber':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0xca7c('0x6')](_0xca7c('0x7'),_0xca7c('0x8'),'months',_0xca7c('0x9'),_0xca7c('0xa'),'hours','minutes'),'allowNull':![],'defaultValue':'days'},'output':{'type':Sequelize['ENUM'](_0xca7c('0xb'),_0xca7c('0xc'),_0xca7c('0xd')),'allowNull':![],'defaultValue':_0xca7c('0xb')},'type':{'type':Sequelize['ENUM'](_0xca7c('0xe'),_0xca7c('0xf')),'allowNull':![],'defaultValue':_0xca7c('0xe')},'sendMail':{'type':Sequelize[_0xca7c('0x3')],'defaultValue':![]},'email':{'type':Sequelize[_0xca7c('0x2')]},'cc':{'type':Sequelize[_0xca7c('0x10')]},'bcc':{'type':Sequelize['TEXT']},'sendIfEmpty':{'type':Sequelize[_0xca7c('0x3')],'defaultValue':!![]}}; \ No newline at end of file +var _0x5fb3=['quarters','months','weeks','days','hours','minutes','csv','pdf','xlsx','default','TEXT','BOOLEAN','sequelize','exports','STRING','0\x200\x20*\x20*\x20*','DATE','INTEGER','ENUM','years'];(function(_0x140ec6,_0x377990){var _0x185a75=function(_0x55f45c){while(--_0x55f45c){_0x140ec6['push'](_0x140ec6['shift']());}};_0x185a75(++_0x377990);}(_0x5fb3,0x160));var _0x35fb=function(_0x3493e7,_0x3e274e){_0x3493e7=_0x3493e7-0x0;var _0xc1b1bf=_0x5fb3[_0x3493e7];return _0xc1b1bf;};'use strict';var Sequelize=require(_0x35fb('0x0'));module[_0x35fb('0x1')]={'name':{'type':Sequelize[_0x35fb('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x35fb('0x2')]},'active':{'type':Sequelize['BOOLEAN'],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0x35fb('0x2')],'allowNull':![],'defaultValue':_0x35fb('0x3')},'startAt':{'type':Sequelize[_0x35fb('0x4')],'allowNull':![]},'endAt':{'type':Sequelize['DATE'],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0x35fb('0x5')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0x35fb('0x6')](_0x35fb('0x7'),_0x35fb('0x8'),_0x35fb('0x9'),_0x35fb('0xa'),_0x35fb('0xb'),_0x35fb('0xc'),_0x35fb('0xd')),'allowNull':![],'defaultValue':_0x35fb('0xb')},'output':{'type':Sequelize['ENUM'](_0x35fb('0xe'),_0x35fb('0xf'),_0x35fb('0x10')),'allowNull':![],'defaultValue':'csv'},'type':{'type':Sequelize[_0x35fb('0x6')]('custom',_0x35fb('0x11')),'allowNull':![],'defaultValue':'custom'},'sendMail':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'email':{'type':Sequelize[_0x35fb('0x2')]},'cc':{'type':Sequelize[_0x35fb('0x12')]},'bcc':{'type':Sequelize[_0x35fb('0x12')]},'sendIfEmpty':{'type':Sequelize[_0x35fb('0x13')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/schedule/schedule.controller.js b/server/api/schedule/schedule.controller.js index edb9c09..9210a0b 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 _0x5ccb=['sox','ejs','fs-extra','crypto','jsforce','to-csv','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','then','destroy','Scheduler','error','name','send','index','map','Schedule','fieldName','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','include','findAll','rows','catch','show','params','keys','rawAttributes','length','includeAll','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','find','body','run','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util'];(function(_0x1a8ef4,_0x5f02e0){var _0x37d9f2=function(_0x595a83){while(--_0x595a83){_0x1a8ef4['push'](_0x1a8ef4['shift']());}};_0x37d9f2(++_0x5f02e0);}(_0x5ccb,0xa3));var _0xb5cc=function(_0x44268d,_0xad8443){_0x44268d=_0x44268d-0x0;var _0x4be92d=_0x5ccb[_0x44268d];return _0x4be92d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb5cc('0x0'));var zipdir=require(_0xb5cc('0x1'));var jsonpatch=require(_0xb5cc('0x2'));var rp=require('request-promise');var moment=require(_0xb5cc('0x3'));var BPromise=require(_0xb5cc('0x4'));var Mustache=require(_0xb5cc('0x5'));var util=require(_0xb5cc('0x6'));var path=require('path');var sox=require(_0xb5cc('0x7'));var csv=require('to-csv');var ejs=require(_0xb5cc('0x8'));var fs=require('fs');var fs_extra=require(_0xb5cc('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xb5cc('0xa'));var jsforce=require(_0xb5cc('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xb5cc('0xc'));var querystring=require('querystring');var Papa=require(_0xb5cc('0xd'));var Redis=require(_0xb5cc('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xb5cc('0xf'));var as=require(_0xb5cc('0x10'));var hardwareService=require(_0xb5cc('0x11'));var logger=require(_0xb5cc('0x12'))(_0xb5cc('0x13'));var utils=require(_0xb5cc('0x14'));var config=require(_0xb5cc('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x12e94e,_0x130908){_0x130908=_0x130908||0xcc;return function(_0x3ccc3f){if(_0x3ccc3f){return _0x12e94e[_0xb5cc('0x16')](_0x130908);}return _0x12e94e[_0xb5cc('0x17')](_0x130908)[_0xb5cc('0x18')]();};}function respondWithResult(_0x5a7b7f,_0x584312){_0x584312=_0x584312||0xc8;return function(_0x17ddc0){if(_0x17ddc0){return _0x5a7b7f[_0xb5cc('0x17')](_0x584312)[_0xb5cc('0x19')](_0x17ddc0);}};}function respondWithFilteredResult(_0x40de12,_0x5d4699){return function(_0x50fbb7){if(_0x50fbb7){var _0x1bdbbd=typeof _0x5d4699[_0xb5cc('0x1a')]==='undefined'&&typeof _0x5d4699[_0xb5cc('0x1b')]===_0xb5cc('0x1c');var _0x3bc358=_0x50fbb7[_0xb5cc('0x1d')];var _0x35eb94=_0x1bdbbd?0x0:_0x5d4699['offset'];var _0x1137e2=_0x1bdbbd?_0x50fbb7['count']:_0x5d4699[_0xb5cc('0x1a')]+_0x5d4699[_0xb5cc('0x1b')];var _0x1ad67;if(_0x1137e2>=_0x3bc358){_0x1137e2=_0x3bc358;_0x1ad67=0xc8;}else{_0x1ad67=0xce;}_0x40de12['status'](_0x1ad67);return _0x40de12[_0xb5cc('0x1e')](_0xb5cc('0x1f'),_0x35eb94+'-'+_0x1137e2+'/'+_0x3bc358)['json'](_0x50fbb7);}return null;};}function patchUpdates(_0x59a86b){return function(_0x333487){try{jsonpatch[_0xb5cc('0x20')](_0x333487,_0x59a86b,!![]);}catch(_0x146cf6){return BPromise[_0xb5cc('0x21')](_0x146cf6);}return _0x333487[_0xb5cc('0x22')]();};}function saveUpdates(_0x1a12c7,_0x26d32f){return function(_0x44c25e){if(_0x44c25e){return _0x44c25e['update'](_0x1a12c7)[_0xb5cc('0x23')](function(_0x2e74ad){return _0x2e74ad;});}return null;};}function removeEntity(_0x56958d,_0x4a0e85){return function(_0x5e6b49){if(_0x5e6b49){return _0x5e6b49[_0xb5cc('0x24')]()[_0xb5cc('0x23')](function(){var _0xaaa34a=_0x5e6b49['get']({'plain':!![]});var _0x3ad1dc=_0xb5cc('0x25');return db['UserProfileResource']['destroy']({'where':{'type':_0x3ad1dc,'resourceId':_0xaaa34a['id']}})[_0xb5cc('0x23')](function(){return _0x5e6b49;});})[_0xb5cc('0x23')](function(){_0x56958d['status'](0xcc)[_0xb5cc('0x18')]();});}};}function handleEntityNotFound(_0x4d8525,_0x1669c3){return function(_0xea2027){if(!_0xea2027){_0x4d8525['sendStatus'](0x194);}return _0xea2027;};}function handleError(_0x210946,_0x2f9b30){_0x2f9b30=_0x2f9b30||0x1f4;return function(_0x352881){logger[_0xb5cc('0x26')](_0x352881['stack']);if(_0x352881[_0xb5cc('0x27')]){delete _0x352881['name'];}_0x210946['status'](_0x2f9b30)[_0xb5cc('0x28')](_0x352881);};}exports[_0xb5cc('0x29')]=function(_0x55d1fa,_0x5e4f83){var _0x327c9a={},_0x31a55a={},_0x5796f0={'count':0x0,'rows':[]};var _0x47330c=_[_0xb5cc('0x2a')](db[_0xb5cc('0x2b')]['rawAttributes'],function(_0x2ef935){return{'name':_0x2ef935[_0xb5cc('0x2c')],'type':_0x2ef935['type']['key']};});_0x31a55a[_0xb5cc('0x2d')]=_['map'](_0x47330c,_0xb5cc('0x27'));_0x31a55a[_0xb5cc('0x2e')]=_['keys'](_0x55d1fa['query']);_0x31a55a[_0xb5cc('0x2f')]=_[_0xb5cc('0x30')](_0x31a55a[_0xb5cc('0x2d')],_0x31a55a[_0xb5cc('0x2e')]);_0x327c9a[_0xb5cc('0x31')]=_[_0xb5cc('0x30')](_0x31a55a[_0xb5cc('0x2d')],qs[_0xb5cc('0x32')](_0x55d1fa['query'][_0xb5cc('0x32')]));_0x327c9a[_0xb5cc('0x31')]=_0x327c9a['attributes']['length']?_0x327c9a[_0xb5cc('0x31')]:_0x31a55a[_0xb5cc('0x2d')];if(!_0x55d1fa[_0xb5cc('0x2e')][_0xb5cc('0x33')](_0xb5cc('0x34'))){_0x327c9a[_0xb5cc('0x1b')]=qs[_0xb5cc('0x1b')](_0x55d1fa[_0xb5cc('0x2e')]['limit']);_0x327c9a[_0xb5cc('0x1a')]=qs[_0xb5cc('0x1a')](_0x55d1fa[_0xb5cc('0x2e')][_0xb5cc('0x1a')]);}_0x327c9a[_0xb5cc('0x35')]=qs[_0xb5cc('0x36')](_0x55d1fa[_0xb5cc('0x2e')][_0xb5cc('0x36')]);_0x327c9a[_0xb5cc('0x37')]=qs[_0xb5cc('0x2f')](_[_0xb5cc('0x38')](_0x55d1fa[_0xb5cc('0x2e')],_0x31a55a['filters']),_0x47330c);if(_0x55d1fa[_0xb5cc('0x2e')][_0xb5cc('0x39')]){_0x327c9a[_0xb5cc('0x37')]=_[_0xb5cc('0x3a')](_0x327c9a[_0xb5cc('0x37')],{'$or':_[_0xb5cc('0x2a')](_0x47330c,function(_0x4f0212){if(_0x4f0212[_0xb5cc('0x3b')]!==_0xb5cc('0x3c')){var _0x4da4ae={};_0x4da4ae[_0x4f0212['name']]={'$like':'%'+_0x55d1fa[_0xb5cc('0x2e')][_0xb5cc('0x39')]+'%'};return _0x4da4ae;}})});}_0x327c9a=_[_0xb5cc('0x3a')]({},_0x327c9a,_0x55d1fa[_0xb5cc('0x3d')]);var _0x3f5bf3={'where':_0x327c9a[_0xb5cc('0x37')]};return db[_0xb5cc('0x2b')]['count'](_0x3f5bf3)[_0xb5cc('0x23')](function(_0x3999ce){_0x5796f0[_0xb5cc('0x1d')]=_0x3999ce;if(_0x55d1fa[_0xb5cc('0x2e')]['includeAll']){_0x327c9a[_0xb5cc('0x3e')]=[{'all':!![]}];}return db[_0xb5cc('0x2b')][_0xb5cc('0x3f')](_0x327c9a);})[_0xb5cc('0x23')](function(_0x3f0061){_0x5796f0[_0xb5cc('0x40')]=_0x3f0061;return _0x5796f0;})[_0xb5cc('0x23')](respondWithFilteredResult(_0x5e4f83,_0x327c9a))[_0xb5cc('0x41')](handleError(_0x5e4f83,null));};exports[_0xb5cc('0x42')]=function(_0xcfec85,_0x5f1ea1){var _0x4a7cff={'raw':![],'where':{'id':_0xcfec85[_0xb5cc('0x43')]['id']}},_0xf37d2d={};_0xf37d2d['model']=_[_0xb5cc('0x44')](db['Schedule'][_0xb5cc('0x45')]);_0xf37d2d['query']=_[_0xb5cc('0x44')](_0xcfec85['query']);_0xf37d2d[_0xb5cc('0x2f')]=_[_0xb5cc('0x30')](_0xf37d2d[_0xb5cc('0x2d')],_0xf37d2d[_0xb5cc('0x2e')]);_0x4a7cff[_0xb5cc('0x31')]=_['intersection'](_0xf37d2d[_0xb5cc('0x2d')],qs[_0xb5cc('0x32')](_0xcfec85[_0xb5cc('0x2e')][_0xb5cc('0x32')]));_0x4a7cff['attributes']=_0x4a7cff['attributes'][_0xb5cc('0x46')]?_0x4a7cff['attributes']:_0xf37d2d['model'];if(_0xcfec85[_0xb5cc('0x2e')][_0xb5cc('0x47')]){_0x4a7cff[_0xb5cc('0x3e')]=[{'all':!![]}];}_0x4a7cff=_['merge']({},_0x4a7cff,_0xcfec85['options']);return db[_0xb5cc('0x2b')]['find'](_0x4a7cff)[_0xb5cc('0x23')](handleEntityNotFound(_0x5f1ea1,null))[_0xb5cc('0x23')](respondWithResult(_0x5f1ea1,null))[_0xb5cc('0x41')](handleError(_0x5f1ea1,null));};exports['create']=function(_0x568124,_0x54438f){return db['Schedule'][_0xb5cc('0x48')](_0x568124['body'],{})[_0xb5cc('0x23')](function(_0x2d39e8){var _0x1bdb52=_0x568124[_0xb5cc('0x49')][_0xb5cc('0x4a')]({'plain':!![]});if(!_0x1bdb52)throw new Error(_0xb5cc('0x4b'));if(_0x1bdb52['role']===_0xb5cc('0x49')){var _0x412ada=_0x2d39e8[_0xb5cc('0x4a')]({'plain':!![]});var _0x2992eb=_0xb5cc('0x25');return db[_0xb5cc('0x4c')]['find']({'where':{'name':_0x2992eb,'userProfileId':_0x1bdb52[_0xb5cc('0x4d')]},'raw':!![]})[_0xb5cc('0x23')](function(_0x38f89a){if(_0x38f89a&&_0x38f89a[_0xb5cc('0x4e')]===0x0){return db[_0xb5cc('0x4f')][_0xb5cc('0x48')]({'name':_0x412ada[_0xb5cc('0x27')],'resourceId':_0x412ada['id'],'type':_0x38f89a['name'],'sectionId':_0x38f89a['id']},{})[_0xb5cc('0x23')](function(){return _0x2d39e8;});}else{return _0x2d39e8;}})[_0xb5cc('0x41')](function(_0x4825c4){logger[_0xb5cc('0x26')](_0xb5cc('0x50'),_0x4825c4);throw _0x4825c4;});}return _0x2d39e8;})[_0xb5cc('0x23')](respondWithResult(_0x54438f,0xc9))[_0xb5cc('0x41')](handleError(_0x54438f,null));};exports[_0xb5cc('0x51')]=function(_0x1a7c26,_0x3eeada){if(_0x1a7c26['body']['id']){delete _0x1a7c26['body']['id'];}return db[_0xb5cc('0x2b')][_0xb5cc('0x52')]({'where':{'id':_0x1a7c26[_0xb5cc('0x43')]['id']}})['then'](handleEntityNotFound(_0x3eeada,null))['then'](saveUpdates(_0x1a7c26[_0xb5cc('0x53')],null))[_0xb5cc('0x23')](respondWithResult(_0x3eeada,null))[_0xb5cc('0x41')](handleError(_0x3eeada,null));};exports[_0xb5cc('0x24')]=function(_0x45211d,_0x48f3df){return db[_0xb5cc('0x2b')][_0xb5cc('0x52')]({'where':{'id':_0x45211d['params']['id']}})['then'](handleEntityNotFound(_0x48f3df,null))['then'](removeEntity(_0x48f3df,null))[_0xb5cc('0x41')](handleError(_0x48f3df,null));};exports[_0xb5cc('0x54')]=function(_0xbc619f,_0x3f6d57,_0xd46b5b){var _0xc6fbf2=require('../../config/schedule');return db[_0xb5cc('0x2b')]['find']({'where':{'id':_0xbc619f[_0xb5cc('0x43')]['id']},'raw':!![]})[_0xb5cc('0x23')](handleEntityNotFound(_0x3f6d57,null))['then'](function(){_0xc6fbf2[_0xb5cc('0x54')](_0xbc619f[_0xb5cc('0x43')]['id']);})[_0xb5cc('0x23')](respondWithStatusCode(_0x3f6d57,null))['catch'](handleError(_0x3f6d57,null));}; \ No newline at end of file +var _0xd53d=['../../config/license/util','../../mysqldb','sendStatus','end','json','offset','undefined','limit','count','status','set','Content-Range','apply','reject','save','then','destroy','get','error','stack','name','map','Schedule','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','length','nolimit','order','sort','filter','merge','where','VIRTUAL','include','rows','catch','params','fields','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Scheduler','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','run','../../config/schedule','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','to-csv','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'];(function(_0x598f1f,_0xa7d1c){var _0x26d77d=function(_0x176e50){while(--_0x176e50){_0x598f1f['push'](_0x598f1f['shift']());}};_0x26d77d(++_0xa7d1c);}(_0xd53d,0x17c));var _0xdd53=function(_0x500471,_0xc97759){_0x500471=_0x500471-0x0;var _0x51b6c1=_0xd53d[_0x500471];return _0x51b6c1;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xdd53('0x0'));var jsonpatch=require(_0xdd53('0x1'));var rp=require(_0xdd53('0x2'));var moment=require('moment');var BPromise=require(_0xdd53('0x3'));var Mustache=require(_0xdd53('0x4'));var util=require(_0xdd53('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0xdd53('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xdd53('0x7'));var crypto=require(_0xdd53('0x8'));var jsforce=require(_0xdd53('0x9'));var deskjs=require(_0xdd53('0xa'));var toCsv=require(_0xdd53('0x6'));var querystring=require(_0xdd53('0xb'));var Papa=require('papaparse');var Redis=require(_0xdd53('0xc'));var authService=require(_0xdd53('0xd'));var qs=require(_0xdd53('0xe'));var as=require(_0xdd53('0xf'));var hardwareService=require(_0xdd53('0x10'));var logger=require(_0xdd53('0x11'))('api');var utils=require(_0xdd53('0x12'));var config=require(_0xdd53('0x13'));var licenseUtil=require(_0xdd53('0x14'));var db=require(_0xdd53('0x15'))['db'];function respondWithStatusCode(_0x4bc334,_0x33bda9){_0x33bda9=_0x33bda9||0xcc;return function(_0x15fa52){if(_0x15fa52){return _0x4bc334[_0xdd53('0x16')](_0x33bda9);}return _0x4bc334['status'](_0x33bda9)[_0xdd53('0x17')]();};}function respondWithResult(_0x3b8070,_0x35b680){_0x35b680=_0x35b680||0xc8;return function(_0x505aaf){if(_0x505aaf){return _0x3b8070['status'](_0x35b680)[_0xdd53('0x18')](_0x505aaf);}};}function respondWithFilteredResult(_0x2f6bdf,_0x319477){return function(_0x1b5ef6){if(_0x1b5ef6){var _0x4e7741=typeof _0x319477[_0xdd53('0x19')]===_0xdd53('0x1a')&&typeof _0x319477[_0xdd53('0x1b')]===_0xdd53('0x1a');var _0x9dcaeb=_0x1b5ef6['count'];var _0x96fc44=_0x4e7741?0x0:_0x319477['offset'];var _0x48466d=_0x4e7741?_0x1b5ef6[_0xdd53('0x1c')]:_0x319477[_0xdd53('0x19')]+_0x319477[_0xdd53('0x1b')];var _0x3951c8;if(_0x48466d>=_0x9dcaeb){_0x48466d=_0x9dcaeb;_0x3951c8=0xc8;}else{_0x3951c8=0xce;}_0x2f6bdf[_0xdd53('0x1d')](_0x3951c8);return _0x2f6bdf[_0xdd53('0x1e')](_0xdd53('0x1f'),_0x96fc44+'-'+_0x48466d+'/'+_0x9dcaeb)[_0xdd53('0x18')](_0x1b5ef6);}return null;};}function patchUpdates(_0x494520){return function(_0x4d3231){try{jsonpatch[_0xdd53('0x20')](_0x4d3231,_0x494520,!![]);}catch(_0x5520b2){return BPromise[_0xdd53('0x21')](_0x5520b2);}return _0x4d3231[_0xdd53('0x22')]();};}function saveUpdates(_0x3c71ac,_0x5cff15){return function(_0x25d162){if(_0x25d162){return _0x25d162['update'](_0x3c71ac)[_0xdd53('0x23')](function(_0x48d136){return _0x48d136;});}return null;};}function removeEntity(_0xb3eef5,_0x42e7e0){return function(_0x3c3664){if(_0x3c3664){return _0x3c3664[_0xdd53('0x24')]()[_0xdd53('0x23')](function(){var _0x21773c=_0x3c3664[_0xdd53('0x25')]({'plain':!![]});var _0x438282='Scheduler';return db['UserProfileResource'][_0xdd53('0x24')]({'where':{'type':_0x438282,'resourceId':_0x21773c['id']}})[_0xdd53('0x23')](function(){return _0x3c3664;});})[_0xdd53('0x23')](function(){_0xb3eef5[_0xdd53('0x1d')](0xcc)[_0xdd53('0x17')]();});}};}function handleEntityNotFound(_0x5b2b8,_0x2ba162){return function(_0x49a76c){if(!_0x49a76c){_0x5b2b8[_0xdd53('0x16')](0x194);}return _0x49a76c;};}function handleError(_0x43fc2c,_0x14fbc2){_0x14fbc2=_0x14fbc2||0x1f4;return function(_0x368680){logger[_0xdd53('0x26')](_0x368680[_0xdd53('0x27')]);if(_0x368680[_0xdd53('0x28')]){delete _0x368680[_0xdd53('0x28')];}_0x43fc2c[_0xdd53('0x1d')](_0x14fbc2)['send'](_0x368680);};}exports['index']=function(_0x4fda9d,_0x16e79a){var _0x4198e1={},_0x391a9b={},_0x1f8ce0={'count':0x0,'rows':[]};var _0x250704=_[_0xdd53('0x29')](db[_0xdd53('0x2a')][_0xdd53('0x2b')],function(_0x134d58){return{'name':_0x134d58[_0xdd53('0x2c')],'type':_0x134d58[_0xdd53('0x2d')][_0xdd53('0x2e')]};});_0x391a9b[_0xdd53('0x2f')]=_[_0xdd53('0x29')](_0x250704,_0xdd53('0x28'));_0x391a9b[_0xdd53('0x30')]=_[_0xdd53('0x31')](_0x4fda9d[_0xdd53('0x30')]);_0x391a9b[_0xdd53('0x32')]=_['intersection'](_0x391a9b['model'],_0x391a9b['query']);_0x4198e1['attributes']=_[_0xdd53('0x33')](_0x391a9b[_0xdd53('0x2f')],qs['fields'](_0x4fda9d[_0xdd53('0x30')]['fields']));_0x4198e1['attributes']=_0x4198e1[_0xdd53('0x34')][_0xdd53('0x35')]?_0x4198e1[_0xdd53('0x34')]:_0x391a9b['model'];if(!_0x4fda9d[_0xdd53('0x30')]['hasOwnProperty'](_0xdd53('0x36'))){_0x4198e1['limit']=qs['limit'](_0x4fda9d[_0xdd53('0x30')][_0xdd53('0x1b')]);_0x4198e1[_0xdd53('0x19')]=qs['offset'](_0x4fda9d[_0xdd53('0x30')]['offset']);}_0x4198e1[_0xdd53('0x37')]=qs[_0xdd53('0x38')](_0x4fda9d[_0xdd53('0x30')][_0xdd53('0x38')]);_0x4198e1['where']=qs['filters'](_['pick'](_0x4fda9d[_0xdd53('0x30')],_0x391a9b[_0xdd53('0x32')]),_0x250704);if(_0x4fda9d[_0xdd53('0x30')][_0xdd53('0x39')]){_0x4198e1['where']=_[_0xdd53('0x3a')](_0x4198e1[_0xdd53('0x3b')],{'$or':_[_0xdd53('0x29')](_0x250704,function(_0x40f3ab){if(_0x40f3ab[_0xdd53('0x2d')]!==_0xdd53('0x3c')){var _0x2d287a={};_0x2d287a[_0x40f3ab[_0xdd53('0x28')]]={'$like':'%'+_0x4fda9d[_0xdd53('0x30')][_0xdd53('0x39')]+'%'};return _0x2d287a;}})});}_0x4198e1=_[_0xdd53('0x3a')]({},_0x4198e1,_0x4fda9d['options']);var _0x2e7d45={'where':_0x4198e1[_0xdd53('0x3b')]};return db[_0xdd53('0x2a')][_0xdd53('0x1c')](_0x2e7d45)[_0xdd53('0x23')](function(_0x3855c3){_0x1f8ce0['count']=_0x3855c3;if(_0x4fda9d[_0xdd53('0x30')]['includeAll']){_0x4198e1[_0xdd53('0x3d')]=[{'all':!![]}];}return db['Schedule']['findAll'](_0x4198e1);})['then'](function(_0x5382bb){_0x1f8ce0[_0xdd53('0x3e')]=_0x5382bb;return _0x1f8ce0;})['then'](respondWithFilteredResult(_0x16e79a,_0x4198e1))[_0xdd53('0x3f')](handleError(_0x16e79a,null));};exports['show']=function(_0x1784fa,_0x5ae722){var _0x428ec8={'raw':![],'where':{'id':_0x1784fa[_0xdd53('0x40')]['id']}},_0x25d851={};_0x25d851[_0xdd53('0x2f')]=_['keys'](db[_0xdd53('0x2a')][_0xdd53('0x2b')]);_0x25d851[_0xdd53('0x30')]=_['keys'](_0x1784fa['query']);_0x25d851[_0xdd53('0x32')]=_[_0xdd53('0x33')](_0x25d851['model'],_0x25d851[_0xdd53('0x30')]);_0x428ec8[_0xdd53('0x34')]=_[_0xdd53('0x33')](_0x25d851[_0xdd53('0x2f')],qs[_0xdd53('0x41')](_0x1784fa[_0xdd53('0x30')][_0xdd53('0x41')]));_0x428ec8[_0xdd53('0x34')]=_0x428ec8[_0xdd53('0x34')][_0xdd53('0x35')]?_0x428ec8[_0xdd53('0x34')]:_0x25d851[_0xdd53('0x2f')];if(_0x1784fa['query'][_0xdd53('0x42')]){_0x428ec8[_0xdd53('0x3d')]=[{'all':!![]}];}_0x428ec8=_[_0xdd53('0x3a')]({},_0x428ec8,_0x1784fa['options']);return db[_0xdd53('0x2a')][_0xdd53('0x43')](_0x428ec8)[_0xdd53('0x23')](handleEntityNotFound(_0x5ae722,null))[_0xdd53('0x23')](respondWithResult(_0x5ae722,null))[_0xdd53('0x3f')](handleError(_0x5ae722,null));};exports[_0xdd53('0x44')]=function(_0xa0eea7,_0x3b49f2){return db[_0xdd53('0x2a')][_0xdd53('0x44')](_0xa0eea7[_0xdd53('0x45')],{})['then'](function(_0x4300fa){var _0x14cbb7=_0xa0eea7[_0xdd53('0x46')]['get']({'plain':!![]});if(!_0x14cbb7)throw new Error(_0xdd53('0x47'));if(_0x14cbb7[_0xdd53('0x48')]==='user'){var _0x2b38f1=_0x4300fa['get']({'plain':!![]});var _0x42eba5=_0xdd53('0x49');return db[_0xdd53('0x4a')]['find']({'where':{'name':_0x42eba5,'userProfileId':_0x14cbb7[_0xdd53('0x4b')]},'raw':!![]})[_0xdd53('0x23')](function(_0x176ffd){if(_0x176ffd&&_0x176ffd[_0xdd53('0x4c')]===0x0){return db[_0xdd53('0x4d')][_0xdd53('0x44')]({'name':_0x2b38f1[_0xdd53('0x28')],'resourceId':_0x2b38f1['id'],'type':_0x176ffd['name'],'sectionId':_0x176ffd['id']},{})['then'](function(){return _0x4300fa;});}else{return _0x4300fa;}})['catch'](function(_0x180961){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x180961);throw _0x180961;});}return _0x4300fa;})[_0xdd53('0x23')](respondWithResult(_0x3b49f2,0xc9))[_0xdd53('0x3f')](handleError(_0x3b49f2,null));};exports['update']=function(_0x310670,_0x2bad02){if(_0x310670[_0xdd53('0x45')]['id']){delete _0x310670[_0xdd53('0x45')]['id'];}return db['Schedule']['find']({'where':{'id':_0x310670[_0xdd53('0x40')]['id']}})[_0xdd53('0x23')](handleEntityNotFound(_0x2bad02,null))[_0xdd53('0x23')](saveUpdates(_0x310670[_0xdd53('0x45')],null))['then'](respondWithResult(_0x2bad02,null))[_0xdd53('0x3f')](handleError(_0x2bad02,null));};exports[_0xdd53('0x24')]=function(_0x43a93b,_0x31ed8f){return db[_0xdd53('0x2a')][_0xdd53('0x43')]({'where':{'id':_0x43a93b[_0xdd53('0x40')]['id']}})[_0xdd53('0x23')](handleEntityNotFound(_0x31ed8f,null))[_0xdd53('0x23')](removeEntity(_0x31ed8f,null))[_0xdd53('0x3f')](handleError(_0x31ed8f,null));};exports[_0xdd53('0x4e')]=function(_0x1159dc,_0x292745,_0x47e187){var _0x4feec2=require(_0xdd53('0x4f'));return db[_0xdd53('0x2a')][_0xdd53('0x43')]({'where':{'id':_0x1159dc['params']['id']},'raw':!![]})['then'](handleEntityNotFound(_0x292745,null))[_0xdd53('0x23')](function(){_0x4feec2['run'](_0x1159dc[_0xdd53('0x40')]['id']);})[_0xdd53('0x23')](respondWithStatusCode(_0x292745,null))['catch'](handleError(_0x292745,null));}; \ No newline at end of file diff --git a/server/api/schedule/schedule.model.js b/server/api/schedule/schedule.model.js index f2390e6..b584af8 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 _0x1912=['tools_schedules','lodash','util','api','moment','request-promise','path','rimraf','../../config/environment','./schedule.attributes','exports','Schedule'];(function(_0x579719,_0x3ff188){var _0x536fd7=function(_0x5e1a75){while(--_0x5e1a75){_0x579719['push'](_0x579719['shift']());}};_0x536fd7(++_0x3ff188);}(_0x1912,0xe5));var _0x2191=function(_0x199572,_0x33e667){_0x199572=_0x199572-0x0;var _0x13cfa3=_0x1912[_0x199572];return _0x13cfa3;};'use strict';var _=require(_0x2191('0x0'));var util=require(_0x2191('0x1'));var logger=require('../../config/logger')(_0x2191('0x2'));var moment=require(_0x2191('0x3'));var BPromise=require('bluebird');var rp=require(_0x2191('0x4'));var fs=require('fs');var path=require(_0x2191('0x5'));var rimraf=require(_0x2191('0x6'));var config=require(_0x2191('0x7'));var attributes=require(_0x2191('0x8'));module[_0x2191('0x9')]=function(_0x21ac76,_0x415552){return _0x21ac76['define'](_0x2191('0xa'),attributes,{'tableName':_0x2191('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbc98=['tools_schedules','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./schedule.attributes','define','Schedule'];(function(_0x169f5a,_0x7762d9){var _0x155ca6=function(_0x551c7a){while(--_0x551c7a){_0x169f5a['push'](_0x169f5a['shift']());}};_0x155ca6(++_0x7762d9);}(_0xbc98,0x1a1));var _0x8bc9=function(_0x2238fb,_0x176ca9){_0x2238fb=_0x2238fb-0x0;var _0x28ca72=_0xbc98[_0x2238fb];return _0x28ca72;};'use strict';var _=require(_0x8bc9('0x0'));var util=require(_0x8bc9('0x1'));var logger=require(_0x8bc9('0x2'))(_0x8bc9('0x3'));var moment=require('moment');var BPromise=require(_0x8bc9('0x4'));var rp=require(_0x8bc9('0x5'));var fs=require('fs');var path=require(_0x8bc9('0x6'));var rimraf=require(_0x8bc9('0x7'));var config=require(_0x8bc9('0x8'));var attributes=require(_0x8bc9('0x9'));module['exports']=function(_0xfa22b8,_0x38e2d7){return _0xfa22b8[_0x8bc9('0xa')](_0x8bc9('0xb'),attributes,{'tableName':_0x8bc9('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/schedule/schedule.rpc.js b/server/api/schedule/schedule.rpc.js index 9de7f0c..e036ae5 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 _0x2f04=['stringify','code','error','Schedule,\x20%s,\x20%s','message','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','request\x20sent','Schedule,\x20%s,\x20%s,\x20%s'];(function(_0x4367f5,_0x312ec7){var _0x677ce=function(_0x4de0eb){while(--_0x4de0eb){_0x4367f5['push'](_0x4367f5['shift']());}};_0x677ce(++_0x312ec7);}(_0x2f04,0x85));var _0x42f0=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x2f04[_0x4565bf];return _0x5610ba;};'use strict';var _=require(_0x42f0('0x0'));var util=require(_0x42f0('0x1'));var moment=require(_0x42f0('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x42f0('0x3'));var db=require(_0x42f0('0x4'))['db'];var utils=require(_0x42f0('0x5'));var logger=require(_0x42f0('0x6'))(_0x42f0('0x7'));var config=require(_0x42f0('0x8'));var jayson=require(_0x42f0('0x9'));var client=jayson['client'][_0x42f0('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x27ab50,_0x518fb8,_0x468eb3){return new BPromise(function(_0x3ffbed,_0x9c02b6){return client['request'](_0x27ab50,_0x468eb3)['then'](function(_0x29b5ad){logger[_0x42f0('0xb')]('Schedule,\x20%s,\x20%s',_0x518fb8,_0x42f0('0xc'));logger['debug'](_0x42f0('0xd'),_0x518fb8,_0x42f0('0xc'),JSON[_0x42f0('0xe')](_0x29b5ad));if(_0x29b5ad['error']){if(_0x29b5ad['error'][_0x42f0('0xf')]===0x1f4){logger[_0x42f0('0x10')](_0x42f0('0x11'),_0x518fb8,_0x29b5ad[_0x42f0('0x10')][_0x42f0('0x12')]);return _0x9c02b6(_0x29b5ad[_0x42f0('0x10')]['message']);}logger['error']('Schedule,\x20%s,\x20%s',_0x518fb8,_0x29b5ad['error']['message']);return _0x3ffbed(_0x29b5ad[_0x42f0('0x10')][_0x42f0('0x12')]);}else{logger[_0x42f0('0xb')](_0x42f0('0x11'),_0x518fb8,'request\x20sent');_0x3ffbed(_0x29b5ad[_0x42f0('0x13')][_0x42f0('0x12')]);}})[_0x42f0('0x14')](function(_0x43659a){logger[_0x42f0('0x10')](_0x42f0('0x11'),_0x518fb8,_0x43659a);_0x9c02b6(_0x43659a);});});} \ No newline at end of file +var _0x3def=['Schedule,\x20%s,\x20%s','request\x20sent','Schedule,\x20%s,\x20%s,\x20%s','stringify','error','code','message','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info'];(function(_0x24b703,_0x55b502){var _0x19cace=function(_0x422656){while(--_0x422656){_0x24b703['push'](_0x24b703['shift']());}};_0x19cace(++_0x55b502);}(_0x3def,0x147));var _0xf3de=function(_0x112100,_0x3b48b9){_0x112100=_0x112100-0x0;var _0x489064=_0x3def[_0x112100];return _0x489064;};'use strict';var _=require('lodash');var util=require(_0xf3de('0x0'));var moment=require(_0xf3de('0x1'));var BPromise=require(_0xf3de('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf3de('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xf3de('0x4'));var logger=require(_0xf3de('0x5'))(_0xf3de('0x6'));var config=require(_0xf3de('0x7'));var jayson=require(_0xf3de('0x8'));var client=jayson[_0xf3de('0x9')][_0xf3de('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4be96e,_0x3e8b6e,_0x3fea9a){return new BPromise(function(_0xf8b085,_0x30120b){return client[_0xf3de('0xb')](_0x4be96e,_0x3fea9a)['then'](function(_0x5396cb){logger[_0xf3de('0xc')](_0xf3de('0xd'),_0x3e8b6e,_0xf3de('0xe'));logger['debug'](_0xf3de('0xf'),_0x3e8b6e,_0xf3de('0xe'),JSON[_0xf3de('0x10')](_0x5396cb));if(_0x5396cb[_0xf3de('0x11')]){if(_0x5396cb['error'][_0xf3de('0x12')]===0x1f4){logger['error'](_0xf3de('0xd'),_0x3e8b6e,_0x5396cb['error'][_0xf3de('0x13')]);return _0x30120b(_0x5396cb[_0xf3de('0x11')][_0xf3de('0x13')]);}logger['error']('Schedule,\x20%s,\x20%s',_0x3e8b6e,_0x5396cb[_0xf3de('0x11')][_0xf3de('0x13')]);return _0xf8b085(_0x5396cb[_0xf3de('0x11')][_0xf3de('0x13')]);}else{logger[_0xf3de('0xc')](_0xf3de('0xd'),_0x3e8b6e,_0xf3de('0xe'));_0xf8b085(_0x5396cb['result']['message']);}})['catch'](function(_0x1d777c){logger[_0xf3de('0x11')](_0xf3de('0xd'),_0x3e8b6e,_0x1d777c);_0x30120b(_0x1d777c);});});} \ No newline at end of file diff --git a/server/api/screenRecording/index.js b/server/api/screenRecording/index.js index d004dd1..3e8bb45 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 _0x19e1=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./screenRecording.controller','get','index','/describe','isAuthenticated','/:id','show','/:id/download','post','create','destroy','exports','multer'];(function(_0x569c8b,_0x2374f9){var _0x1fc114=function(_0x33489c){while(--_0x33489c){_0x569c8b['push'](_0x569c8b['shift']());}};_0x1fc114(++_0x2374f9);}(_0x19e1,0x167));var _0x119e=function(_0x266618,_0x18f637){_0x266618=_0x266618-0x0;var _0x54dbf5=_0x19e1[_0x266618];return _0x54dbf5;};'use strict';var multer=require(_0x119e('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x119e('0x1'));var router=express[_0x119e('0x2')]();var fs_extra=require(_0x119e('0x3'));var auth=require(_0x119e('0x4'));var interaction=require(_0x119e('0x5'));var config=require('../../config/environment');var controller=require(_0x119e('0x6'));router[_0x119e('0x7')]('/',auth['isAuthenticated'](),controller[_0x119e('0x8')]);router[_0x119e('0x7')](_0x119e('0x9'),auth[_0x119e('0xa')](),controller['describe']);router['get'](_0x119e('0xb'),auth[_0x119e('0xa')](),controller[_0x119e('0xc')]);router['get'](_0x119e('0xd'),auth[_0x119e('0xa')](),controller['download']);router[_0x119e('0xe')]('/',auth['isAuthenticated'](),controller[_0x119e('0xf')]);router['put'](_0x119e('0xb'),auth[_0x119e('0xa')](),controller['update']);router['delete'](_0x119e('0xb'),auth[_0x119e('0xa')](),controller[_0x119e('0x10')]);module[_0x119e('0x11')]=router; \ No newline at end of file +var _0x67eb=['../../components/interaction/service','./screenRecording.controller','get','isAuthenticated','index','/describe','describe','show','post','create','put','/:id','update','delete','exports','multer','util','path','Router','fs-extra','../../components/auth/service'];(function(_0x1917a4,_0x5bdd51){var _0x1714e3=function(_0x82f4d5){while(--_0x82f4d5){_0x1917a4['push'](_0x1917a4['shift']());}};_0x1714e3(++_0x5bdd51);}(_0x67eb,0xb7));var _0xb67e=function(_0x3456ab,_0x515278){_0x3456ab=_0x3456ab-0x0;var _0x5a9403=_0x67eb[_0x3456ab];return _0x5a9403;};'use strict';var multer=require(_0xb67e('0x0'));var util=require(_0xb67e('0x1'));var path=require(_0xb67e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xb67e('0x3')]();var fs_extra=require(_0xb67e('0x4'));var auth=require(_0xb67e('0x5'));var interaction=require(_0xb67e('0x6'));var config=require('../../config/environment');var controller=require(_0xb67e('0x7'));router[_0xb67e('0x8')]('/',auth[_0xb67e('0x9')](),controller[_0xb67e('0xa')]);router[_0xb67e('0x8')](_0xb67e('0xb'),auth[_0xb67e('0x9')](),controller[_0xb67e('0xc')]);router[_0xb67e('0x8')]('/:id',auth[_0xb67e('0x9')](),controller[_0xb67e('0xd')]);router[_0xb67e('0x8')]('/:id/download',auth[_0xb67e('0x9')](),controller['download']);router[_0xb67e('0xe')]('/',auth[_0xb67e('0x9')](),controller[_0xb67e('0xf')]);router[_0xb67e('0x10')](_0xb67e('0x11'),auth['isAuthenticated'](),controller[_0xb67e('0x12')]);router[_0xb67e('0x13')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0xb67e('0x14')]=router; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.attributes.js b/server/api/screenRecording/screenRecording.attributes.js index aab2f54..cdef6a6 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 _0x94ff=['format','toString','MM-DD-YYYY\x20HH:mm','createdAt','updatedAt','sequelize','exports','VIRTUAL','getDataValue','extname','STRING','replace','setDataValue','INTEGER','subtract','closedAt','duration','DATE','startedAt'];(function(_0x2aa3dd,_0x1f2156){var _0x2572c1=function(_0x415690){while(--_0x415690){_0x2aa3dd['push'](_0x2aa3dd['shift']());}};_0x2572c1(++_0x1f2156);}(_0x94ff,0xc3));var _0xf94f=function(_0x29724d,_0x52199a){_0x29724d=_0x29724d-0x0;var _0x5f0f47=_0x94ff[_0x29724d];return _0x5f0f47;};'use strict';var Sequelize=require(_0xf94f('0x0'));var moment=require('moment');var path=require('path');var config=require('../../config/environment');module[_0xf94f('0x1')]={'format':{'type':Sequelize[_0xf94f('0x2')],'get':function(){return this[_0xf94f('0x3')]('value')?path[_0xf94f('0x4')](this[_0xf94f('0x3')]('value')):undefined;}},'interactionid':{'type':Sequelize[_0xf94f('0x5')]},'channel':{'type':Sequelize[_0xf94f('0x5')]},'value':{'type':Sequelize['STRING'],'set':function(_0x18919a){var _0x5e3f9c=_0x18919a[_0xf94f('0x6')](/\\/g,'/');this[_0xf94f('0x7')]('value',_0x5e3f9c);}},'rating':{'type':Sequelize[_0xf94f('0x8')],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0xf94f('0x8')],'set':function(_0x123003){this['setDataValue']('startedAt',moment()[_0xf94f('0x9')](_0x123003,'ms'));this[_0xf94f('0x7')](_0xf94f('0xa'),moment());this[_0xf94f('0x7')](_0xf94f('0xb'),_0x123003);}},'startedAt':{'type':Sequelize[_0xf94f('0xc')],'get':function(){return moment(this[_0xf94f('0x3')](_0xf94f('0xd')))[_0xf94f('0xe')]('MM-DD-YYYY\x20HH:mm')[_0xf94f('0xf')]();}},'closedAt':{'type':Sequelize[_0xf94f('0xc')],'get':function(){return moment(this[_0xf94f('0x3')](_0xf94f('0xa')))['format'](_0xf94f('0x10'))[_0xf94f('0xf')]();}},'createdAt':{'type':Sequelize[_0xf94f('0xc')],'get':function(){return moment(this[_0xf94f('0x3')](_0xf94f('0x11')))[_0xf94f('0xe')]('MM-DD-YYYY\x20HH:mm')[_0xf94f('0xf')]();}},'updatedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0xf94f('0x3')](_0xf94f('0x12')))['format']('MM-DD-YYYY\x20HH:mm')['toString']();}}}; \ No newline at end of file +var _0x6edc=['setDataValue','INTEGER','startedAt','subtract','duration','DATE','MM-DD-YYYY\x20HH:mm','closedAt','format','createdAt','updatedAt','toString','sequelize','moment','path','../../config/environment','getDataValue','value','extname','STRING'];(function(_0x4e5d21,_0x54c86c){var _0x3bf914=function(_0x248955){while(--_0x248955){_0x4e5d21['push'](_0x4e5d21['shift']());}};_0x3bf914(++_0x54c86c);}(_0x6edc,0x138));var _0xc6ed=function(_0x1afdad,_0x27f0f5){_0x1afdad=_0x1afdad-0x0;var _0x460dfe=_0x6edc[_0x1afdad];return _0x460dfe;};'use strict';var Sequelize=require(_0xc6ed('0x0'));var moment=require(_0xc6ed('0x1'));var path=require(_0xc6ed('0x2'));var config=require(_0xc6ed('0x3'));module['exports']={'format':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0xc6ed('0x4')](_0xc6ed('0x5'))?path[_0xc6ed('0x6')](this[_0xc6ed('0x4')]('value')):undefined;}},'interactionid':{'type':Sequelize[_0xc6ed('0x7')]},'channel':{'type':Sequelize[_0xc6ed('0x7')]},'value':{'type':Sequelize[_0xc6ed('0x7')],'set':function(_0x548a14){var _0x274b0d=_0x548a14['replace'](/\\/g,'/');this[_0xc6ed('0x8')](_0xc6ed('0x5'),_0x274b0d);}},'rating':{'type':Sequelize[_0xc6ed('0x9')],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0xc6ed('0x9')],'set':function(_0x496e6a){this[_0xc6ed('0x8')](_0xc6ed('0xa'),moment()[_0xc6ed('0xb')](_0x496e6a,'ms'));this['setDataValue']('closedAt',moment());this[_0xc6ed('0x8')](_0xc6ed('0xc'),_0x496e6a);}},'startedAt':{'type':Sequelize[_0xc6ed('0xd')],'get':function(){return moment(this[_0xc6ed('0x4')](_0xc6ed('0xa')))['format'](_0xc6ed('0xe'))['toString']();}},'closedAt':{'type':Sequelize[_0xc6ed('0xd')],'get':function(){return moment(this['getDataValue'](_0xc6ed('0xf')))[_0xc6ed('0x10')](_0xc6ed('0xe'))['toString']();}},'createdAt':{'type':Sequelize[_0xc6ed('0xd')],'get':function(){return moment(this[_0xc6ed('0x4')](_0xc6ed('0x11')))['format'](_0xc6ed('0xe'))['toString']();}},'updatedAt':{'type':Sequelize[_0xc6ed('0xd')],'get':function(){return moment(this[_0xc6ed('0x4')](_0xc6ed('0x12')))['format'](_0xc6ed('0xe'))[_0xc6ed('0x13')]();}}}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.controller.js b/server/api/screenRecording/screenRecording.controller.js index b2e426a..936c94e 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 _0xd0bb=['api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','json','apply','save','update','then','destroy','error','stack','name','send','map','ScreenRecording','fieldName','model','differenceBy','format','query','keys','filters','attributes','intersection','fields','length','nolimit','sort','where','filter','type','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','duration','closedAt','value','describe','download','../../components/encryptor','uniqueid','join','root','server/files/screen_recordings','existsSync','decryptFile','secrets','recording','Sequelize','ValidationError','ScreenRecording\x20not\x20found','filename','extname','unlink','message','Not\x20found','cancellazione\x20fisica\x20documento\x20%s','isNil','info','File:\x20\x22','unlinkSync','.cypher','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0xd0bb,0x1eb));var _0xbd0b=function(_0x749c48,_0x336468){_0x749c48=_0x749c48-0x0;var _0x2f419c=_0xd0bb[_0x749c48];return _0x2f419c;};'use strict';var emlformat=require(_0xbd0b('0x0'));var rimraf=require(_0xbd0b('0x1'));var zipdir=require(_0xbd0b('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xbd0b('0x3'));var moment=require('moment');var BPromise=require(_0xbd0b('0x4'));var Mustache=require(_0xbd0b('0x5'));var util=require('util');var path=require(_0xbd0b('0x6'));var sox=require('sox');var csv=require(_0xbd0b('0x7'));var ejs=require(_0xbd0b('0x8'));var fs=require('fs');var fs_extra=require(_0xbd0b('0x9'));var _=require(_0xbd0b('0xa'));var squel=require(_0xbd0b('0xb'));var crypto=require('crypto');var jsforce=require(_0xbd0b('0xc'));var deskjs=require(_0xbd0b('0xd'));var toCsv=require(_0xbd0b('0x7'));var querystring=require(_0xbd0b('0xe'));var Papa=require(_0xbd0b('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xbd0b('0x10'));var as=require(_0xbd0b('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xbd0b('0x12'))(_0xbd0b('0x13'));var utils=require('../../config/utils');var config=require(_0xbd0b('0x14'));var licenseUtil=require(_0xbd0b('0x15'));var db=require(_0xbd0b('0x16'))['db'];function respondWithStatusCode(_0x315ed9,_0x2621bf){_0x2621bf=_0x2621bf||0xcc;return function(_0x42a96b){if(_0x42a96b){return _0x315ed9[_0xbd0b('0x17')](_0x2621bf);}return _0x315ed9[_0xbd0b('0x18')](_0x2621bf)[_0xbd0b('0x19')]();};}function respondWithResult(_0x1c10c1,_0x2d4664){_0x2d4664=_0x2d4664||0xc8;return function(_0x57077a){if(_0x57077a){return _0x1c10c1[_0xbd0b('0x18')](_0x2d4664)['json'](_0x57077a);}};}function respondWithFilteredResult(_0x4a8014,_0x36d1ca){return function(_0x4c0e52){if(_0x4c0e52){var _0x3183cf=typeof _0x36d1ca[_0xbd0b('0x1a')]===_0xbd0b('0x1b')&&typeof _0x36d1ca['limit']==='undefined';var _0x2136ef=_0x4c0e52[_0xbd0b('0x1c')];var _0x1f2a6e=_0x3183cf?0x0:_0x36d1ca[_0xbd0b('0x1a')];var _0x1c0a7c=_0x3183cf?_0x4c0e52[_0xbd0b('0x1c')]:_0x36d1ca['offset']+_0x36d1ca[_0xbd0b('0x1d')];var _0x49499f;if(_0x1c0a7c>=_0x2136ef){_0x1c0a7c=_0x2136ef;_0x49499f=0xc8;}else{_0x49499f=0xce;}_0x4a8014[_0xbd0b('0x18')](_0x49499f);return _0x4a8014[_0xbd0b('0x1e')](_0xbd0b('0x1f'),_0x1f2a6e+'-'+_0x1c0a7c+'/'+_0x2136ef)[_0xbd0b('0x20')](_0x4c0e52);}return null;};}function patchUpdates(_0x4b312d){return function(_0x403c91){try{jsonpatch[_0xbd0b('0x21')](_0x403c91,_0x4b312d,!![]);}catch(_0x40b021){return BPromise['reject'](_0x40b021);}return _0x403c91[_0xbd0b('0x22')]();};}function saveUpdates(_0x560db4,_0xc66b8){return function(_0x3c4938){if(_0x3c4938){return _0x3c4938[_0xbd0b('0x23')](_0x560db4)[_0xbd0b('0x24')](function(_0x297c85){return _0x297c85;});}return null;};}function removeEntity(_0x539359,_0x75909f){return function(_0x58a721){if(_0x58a721){return _0x58a721[_0xbd0b('0x25')]()[_0xbd0b('0x24')](function(){_0x539359[_0xbd0b('0x18')](0xcc)[_0xbd0b('0x19')]();});}};}function handleEntityNotFound(_0xfd9f82,_0xb06342){return function(_0x4fe9ed){if(!_0x4fe9ed){_0xfd9f82[_0xbd0b('0x17')](0x194);}return _0x4fe9ed;};}function handleError(_0x1b46a3,_0x33b752){_0x33b752=_0x33b752||0x1f4;return function(_0x1b5a00){logger[_0xbd0b('0x26')](_0x1b5a00[_0xbd0b('0x27')]);if(_0x1b5a00['name']){delete _0x1b5a00[_0xbd0b('0x28')];}_0x1b46a3[_0xbd0b('0x18')](_0x33b752)[_0xbd0b('0x29')](_0x1b5a00);};}exports['index']=function(_0x4dfe76,_0x2187a5){var _0x684b09={},_0x14e5a3={},_0xf4ba04={'count':0x0,'rows':[]};var _0x4e2149=_[_0xbd0b('0x2a')](db[_0xbd0b('0x2b')]['rawAttributes'],function(_0x45f7d6){return{'name':_0x45f7d6[_0xbd0b('0x2c')],'type':_0x45f7d6['type']['key']};});_0x14e5a3[_0xbd0b('0x2d')]=_[_0xbd0b('0x2e')](_['map'](_0x4e2149,_0xbd0b('0x28')),[_0xbd0b('0x2f')]);_0x14e5a3[_0xbd0b('0x30')]=_[_0xbd0b('0x31')](_0x4dfe76[_0xbd0b('0x30')]);_0x14e5a3[_0xbd0b('0x32')]=_['intersection'](_0x14e5a3[_0xbd0b('0x2d')],_0x14e5a3[_0xbd0b('0x30')]);_0x684b09[_0xbd0b('0x33')]=_[_0xbd0b('0x34')](_0x14e5a3[_0xbd0b('0x2d')],qs[_0xbd0b('0x35')](_0x4dfe76[_0xbd0b('0x30')][_0xbd0b('0x35')]));_0x684b09[_0xbd0b('0x33')]=_0x684b09[_0xbd0b('0x33')][_0xbd0b('0x36')]?_0x684b09[_0xbd0b('0x33')]:_0x14e5a3[_0xbd0b('0x2d')];if(!_0x4dfe76[_0xbd0b('0x30')]['hasOwnProperty'](_0xbd0b('0x37'))){_0x684b09[_0xbd0b('0x1d')]=qs['limit'](_0x4dfe76[_0xbd0b('0x30')][_0xbd0b('0x1d')]);_0x684b09[_0xbd0b('0x1a')]=qs[_0xbd0b('0x1a')](_0x4dfe76[_0xbd0b('0x30')][_0xbd0b('0x1a')]);}_0x684b09['order']=qs[_0xbd0b('0x38')](_0x4dfe76[_0xbd0b('0x30')][_0xbd0b('0x38')]);_0x684b09[_0xbd0b('0x39')]=qs[_0xbd0b('0x32')](_['pick'](_0x4dfe76['query'],_0x14e5a3[_0xbd0b('0x32')]),_0x4e2149);if(_0x4dfe76[_0xbd0b('0x30')][_0xbd0b('0x3a')]){_0x684b09[_0xbd0b('0x39')]=_['merge'](_0x684b09['where'],{'$or':_[_0xbd0b('0x2a')](_0x4e2149,function(_0x4d8237){if(_0x4d8237[_0xbd0b('0x3b')]!==_0xbd0b('0x3c')){var _0x3f34dc={};_0x3f34dc[_0x4d8237[_0xbd0b('0x28')]]={'$like':'%'+_0x4dfe76[_0xbd0b('0x30')][_0xbd0b('0x3a')]+'%'};return _0x3f34dc;}})});}_0x684b09=_[_0xbd0b('0x3d')]({},_0x684b09,_0x4dfe76[_0xbd0b('0x3e')]);var _0x2acc9f={'where':_0x684b09[_0xbd0b('0x39')]};return db[_0xbd0b('0x2b')][_0xbd0b('0x1c')](_0x2acc9f)[_0xbd0b('0x24')](function(_0x425c8a){_0xf4ba04[_0xbd0b('0x1c')]=_0x425c8a;if(_0x4dfe76[_0xbd0b('0x30')][_0xbd0b('0x3f')]){_0x684b09[_0xbd0b('0x40')]=[{'all':!![]}];}return db['ScreenRecording'][_0xbd0b('0x41')](_0x684b09);})[_0xbd0b('0x24')](function(_0x89b5ea){_0xf4ba04[_0xbd0b('0x42')]=_0x89b5ea;return _0xf4ba04;})[_0xbd0b('0x24')](respondWithFilteredResult(_0x2187a5,_0x684b09))[_0xbd0b('0x43')](handleError(_0x2187a5,null));};exports[_0xbd0b('0x44')]=function(_0x1b4497,_0x2a1a1d){var _0x4d72f={'raw':![],'where':{'id':_0x1b4497[_0xbd0b('0x45')]['id']}},_0xa252a2={};_0xa252a2['model']=_[_0xbd0b('0x31')](db['ScreenRecording']['rawAttributes']);_0xa252a2[_0xbd0b('0x30')]=_[_0xbd0b('0x31')](_0x1b4497[_0xbd0b('0x30')]);_0xa252a2['filters']=_[_0xbd0b('0x34')](_0xa252a2[_0xbd0b('0x2d')],_0xa252a2[_0xbd0b('0x30')]);_0x4d72f[_0xbd0b('0x33')]=_[_0xbd0b('0x34')](_0xa252a2['model'],qs[_0xbd0b('0x35')](_0x1b4497[_0xbd0b('0x30')][_0xbd0b('0x35')]));_0x4d72f[_0xbd0b('0x33')]=_0x4d72f[_0xbd0b('0x33')][_0xbd0b('0x36')]?_0x4d72f['attributes']:_0xa252a2[_0xbd0b('0x2d')];if(_0x1b4497[_0xbd0b('0x30')][_0xbd0b('0x3f')]){_0x4d72f[_0xbd0b('0x40')]=[{'all':!![]}];}_0x4d72f=_[_0xbd0b('0x3d')]({},_0x4d72f,_0x1b4497[_0xbd0b('0x3e')]);return db[_0xbd0b('0x2b')][_0xbd0b('0x46')](_0x4d72f)[_0xbd0b('0x24')](handleEntityNotFound(_0x2a1a1d,null))[_0xbd0b('0x24')](respondWithResult(_0x2a1a1d,null))[_0xbd0b('0x43')](handleError(_0x2a1a1d,null));};exports[_0xbd0b('0x47')]=function(_0x222ee1,_0x30f77e){return db[_0xbd0b('0x2b')][_0xbd0b('0x47')](_0x222ee1[_0xbd0b('0x48')],{})[_0xbd0b('0x24')](respondWithResult(_0x30f77e,0xc9))[_0xbd0b('0x43')](handleError(_0x30f77e,null));};exports[_0xbd0b('0x23')]=function(_0x3cfb52,_0xbd64e2){if(_0x3cfb52[_0xbd0b('0x48')]['id']){delete _0x3cfb52['body']['id'];}delete _0x3cfb52[_0xbd0b('0x48')][_0xbd0b('0x49')];delete _0x3cfb52['body']['createdAt'];delete _0x3cfb52['body'][_0xbd0b('0x4a')];delete _0x3cfb52['body'][_0xbd0b('0x4b')];return db[_0xbd0b('0x2b')][_0xbd0b('0x46')]({'where':{'id':_0x3cfb52[_0xbd0b('0x45')]['id']}})['then'](handleEntityNotFound(_0xbd64e2,null))[_0xbd0b('0x24')](saveUpdates(_0x3cfb52['body'],null))[_0xbd0b('0x24')](respondWithResult(_0xbd64e2,null))['catch'](handleError(_0xbd64e2,null));};exports['describe']=function(_0x80d89a,_0x22f741){return db[_0xbd0b('0x2b')][_0xbd0b('0x4c')]()[_0xbd0b('0x24')](respondWithResult(_0x22f741,null))[_0xbd0b('0x43')](handleError(_0x22f741,null));};exports[_0xbd0b('0x4d')]=function(_0x2a7252,_0x4cc013,_0x48a78c){var _0x2d13fd=require(_0xbd0b('0x4e'));var _0x5094bd=![];var _0x514985={};if(_0x2a7252[_0xbd0b('0x30')][_0xbd0b('0x3b')]&&_0x2a7252[_0xbd0b('0x30')][_0xbd0b('0x3b')]==='uniqueid'){_0x514985[_0xbd0b('0x4f')]=_0x2a7252[_0xbd0b('0x45')]['id'];}else{_0x514985['id']=_0x2a7252[_0xbd0b('0x45')]['id'];}return db[_0xbd0b('0x2b')]['find']({'where':_0x514985,'attributes':['id',_0xbd0b('0x4b')],'raw':!![]})[_0xbd0b('0x24')](handleEntityNotFound(_0x4cc013,null))['then'](function(_0x122a19){if(_0x122a19){var _0x1ea443=path[_0xbd0b('0x50')](config[_0xbd0b('0x51')],_0xbd0b('0x52'),_0x122a19[_0xbd0b('0x4b')]);var _0x3a526a=util[_0xbd0b('0x2f')]('%s.cypher',_0x1ea443);if(fs[_0xbd0b('0x53')](_0x3a526a)){_0x5094bd=!![];return _0x2d13fd[_0xbd0b('0x54')](_0x3a526a,_0x1ea443,config[_0xbd0b('0x55')][_0xbd0b('0x56')])[_0xbd0b('0x24')](function(){return _0x122a19;});}return _0x122a19;}})[_0xbd0b('0x24')](function(_0x49b7a6){if(_0x49b7a6){var _0x570648=path[_0xbd0b('0x50')](config[_0xbd0b('0x51')],'server/files/screen_recordings',_0x49b7a6[_0xbd0b('0x4b')]);if(!fs[_0xbd0b('0x53')](_0x570648)){throw new db[(_0xbd0b('0x57'))][(_0xbd0b('0x58'))](_0xbd0b('0x59'));}if(_0x49b7a6['filename']){return _0x4cc013[_0xbd0b('0x4d')](_0x570648,_0x49b7a6[_0xbd0b('0x5a')]+path[_0xbd0b('0x5b')](_0x570648),function(){if(_0x5094bd){fs[_0xbd0b('0x5c')](_0x570648);}});}else{return _0x4cc013[_0xbd0b('0x4d')](_0x570648,function(_0xa08f72){if(_0x5094bd){fs[_0xbd0b('0x5c')](_0x570648);}});}}})[_0xbd0b('0x43')](function(_0x429534){if(_0x429534[_0xbd0b('0x5d')]===_0xbd0b('0x59')){_0x4cc013[_0xbd0b('0x18')](0x194)[_0xbd0b('0x29')](_0xbd0b('0x5e'));}else{return handleError(_0x4cc013,null);}});};exports[_0xbd0b('0x25')]=function(_0x1fefd5,_0x1e0beb){return db['ScreenRecording'][_0xbd0b('0x46')]({'where':{'id':_0x1fefd5[_0xbd0b('0x45')]['id']}})[_0xbd0b('0x24')](function(_0x2c935c){if(_['isNil'](_0x2c935c)){throw new ReferenceError('Entity\x20not\x20found');}return _0x2c935c;})[_0xbd0b('0x24')](function(_0x45c6b5){var _0x4317f0=path[_0xbd0b('0x50')](config[_0xbd0b('0x51')],'server/files/screen_recordings',_0x45c6b5[_0xbd0b('0x4b')]);logger['info'](_0xbd0b('0x5f'),_0x4317f0);if(!_[_0xbd0b('0x60')](_0x45c6b5[_0xbd0b('0x4b')])&&fs[_0xbd0b('0x53')](_0x4317f0)){logger[_0xbd0b('0x61')](_0xbd0b('0x62')+_0x4317f0+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0xbd0b('0x63')](_0x4317f0);}_0x4317f0=_0x4317f0+_0xbd0b('0x64');if(!_[_0xbd0b('0x60')](_0x45c6b5[_0xbd0b('0x4b')])&&fs['existsSync'](_0x4317f0)){logger[_0xbd0b('0x61')](_0xbd0b('0x62')+_0x4317f0+_0xbd0b('0x65'));fs[_0xbd0b('0x63')](_0x4317f0);}return _0x45c6b5;})[_0xbd0b('0x24')](function(_0x4df3df){if(!_0x4df3df)throw new InternalError();return _0x4df3df['destroy']();})[_0xbd0b('0x24')](function(){_0x1e0beb['status'](0xcc)[_0xbd0b('0x19')]();})[_0xbd0b('0x43')](handleError(_0x1e0beb,null));}; \ No newline at end of file +var _0x9a19=['limit','count','set','Content-Range','save','then','destroy','error','stack','name','send','map','ScreenRecording','fieldName','type','key','model','differenceBy','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','create','body','update','duration','value','find','describe','download','../../components/encryptor','uniqueid','join','root','format','%s.cypher','existsSync','decryptFile','recording','server/files/screen_recordings','Sequelize','ValidationError','ScreenRecording\x20not\x20found','filename','extname','unlink','message','isNil','Entity\x20not\x20found','cancellazione\x20fisica\x20documento\x20%s','info','.cypher','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined'];(function(_0x2aee2f,_0xad9887){var _0x19337f=function(_0x2e62d){while(--_0x2e62d){_0x2aee2f['push'](_0x2aee2f['shift']());}};_0x19337f(++_0xad9887);}(_0x9a19,0x114));var _0x99a1=function(_0x503564,_0x55867e){_0x503564=_0x503564-0x0;var _0x4be9fd=_0x9a19[_0x503564];return _0x4be9fd;};'use strict';var emlformat=require(_0x99a1('0x0'));var rimraf=require(_0x99a1('0x1'));var zipdir=require(_0x99a1('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x99a1('0x3'));var moment=require(_0x99a1('0x4'));var BPromise=require(_0x99a1('0x5'));var Mustache=require(_0x99a1('0x6'));var util=require(_0x99a1('0x7'));var path=require(_0x99a1('0x8'));var sox=require(_0x99a1('0x9'));var csv=require(_0x99a1('0xa'));var ejs=require(_0x99a1('0xb'));var fs=require('fs');var fs_extra=require(_0x99a1('0xc'));var _=require(_0x99a1('0xd'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x99a1('0xe'));var toCsv=require(_0x99a1('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x99a1('0xf'));var authService=require(_0x99a1('0x10'));var qs=require(_0x99a1('0x11'));var as=require(_0x99a1('0x12'));var hardwareService=require(_0x99a1('0x13'));var logger=require('../../config/logger')(_0x99a1('0x14'));var utils=require(_0x99a1('0x15'));var config=require(_0x99a1('0x16'));var licenseUtil=require(_0x99a1('0x17'));var db=require(_0x99a1('0x18'))['db'];function respondWithStatusCode(_0x1bc7aa,_0x2ff655){_0x2ff655=_0x2ff655||0xcc;return function(_0x532f56){if(_0x532f56){return _0x1bc7aa[_0x99a1('0x19')](_0x2ff655);}return _0x1bc7aa[_0x99a1('0x1a')](_0x2ff655)[_0x99a1('0x1b')]();};}function respondWithResult(_0x47815e,_0xe1a1f){_0xe1a1f=_0xe1a1f||0xc8;return function(_0x3c9ef4){if(_0x3c9ef4){return _0x47815e[_0x99a1('0x1a')](_0xe1a1f)['json'](_0x3c9ef4);}};}function respondWithFilteredResult(_0x2d81ed,_0x3e45d4){return function(_0x1bb464){if(_0x1bb464){var _0x3d40cc=typeof _0x3e45d4[_0x99a1('0x1c')]===_0x99a1('0x1d')&&typeof _0x3e45d4[_0x99a1('0x1e')]==='undefined';var _0x4f049c=_0x1bb464[_0x99a1('0x1f')];var _0xbf62f1=_0x3d40cc?0x0:_0x3e45d4[_0x99a1('0x1c')];var _0x1fcd00=_0x3d40cc?_0x1bb464[_0x99a1('0x1f')]:_0x3e45d4[_0x99a1('0x1c')]+_0x3e45d4[_0x99a1('0x1e')];var _0x3cd62c;if(_0x1fcd00>=_0x4f049c){_0x1fcd00=_0x4f049c;_0x3cd62c=0xc8;}else{_0x3cd62c=0xce;}_0x2d81ed[_0x99a1('0x1a')](_0x3cd62c);return _0x2d81ed[_0x99a1('0x20')](_0x99a1('0x21'),_0xbf62f1+'-'+_0x1fcd00+'/'+_0x4f049c)['json'](_0x1bb464);}return null;};}function patchUpdates(_0x3023a1){return function(_0x20007e){try{jsonpatch['apply'](_0x20007e,_0x3023a1,!![]);}catch(_0x38435b){return BPromise['reject'](_0x38435b);}return _0x20007e[_0x99a1('0x22')]();};}function saveUpdates(_0x2927b0,_0x2d6f20){return function(_0x2d3b82){if(_0x2d3b82){return _0x2d3b82['update'](_0x2927b0)[_0x99a1('0x23')](function(_0x1268a7){return _0x1268a7;});}return null;};}function removeEntity(_0x483c17,_0x44df2d){return function(_0x5b5dfa){if(_0x5b5dfa){return _0x5b5dfa[_0x99a1('0x24')]()[_0x99a1('0x23')](function(){_0x483c17[_0x99a1('0x1a')](0xcc)[_0x99a1('0x1b')]();});}};}function handleEntityNotFound(_0x3c813,_0x491341){return function(_0x4fe7f7){if(!_0x4fe7f7){_0x3c813[_0x99a1('0x19')](0x194);}return _0x4fe7f7;};}function handleError(_0x5dabd9,_0x5dc733){_0x5dc733=_0x5dc733||0x1f4;return function(_0xafea84){logger[_0x99a1('0x25')](_0xafea84[_0x99a1('0x26')]);if(_0xafea84[_0x99a1('0x27')]){delete _0xafea84[_0x99a1('0x27')];}_0x5dabd9[_0x99a1('0x1a')](_0x5dc733)[_0x99a1('0x28')](_0xafea84);};}exports['index']=function(_0xf41b0d,_0x499eef){var _0x255197={},_0x1137f2={},_0x26fbae={'count':0x0,'rows':[]};var _0x523668=_[_0x99a1('0x29')](db[_0x99a1('0x2a')]['rawAttributes'],function(_0x37514e){return{'name':_0x37514e[_0x99a1('0x2b')],'type':_0x37514e[_0x99a1('0x2c')][_0x99a1('0x2d')]};});_0x1137f2[_0x99a1('0x2e')]=_[_0x99a1('0x2f')](_[_0x99a1('0x29')](_0x523668,_0x99a1('0x27')),['format']);_0x1137f2['query']=_[_0x99a1('0x30')](_0xf41b0d['query']);_0x1137f2[_0x99a1('0x31')]=_[_0x99a1('0x32')](_0x1137f2['model'],_0x1137f2[_0x99a1('0x33')]);_0x255197[_0x99a1('0x34')]=_[_0x99a1('0x32')](_0x1137f2[_0x99a1('0x2e')],qs[_0x99a1('0x35')](_0xf41b0d[_0x99a1('0x33')][_0x99a1('0x35')]));_0x255197[_0x99a1('0x34')]=_0x255197[_0x99a1('0x34')][_0x99a1('0x36')]?_0x255197[_0x99a1('0x34')]:_0x1137f2[_0x99a1('0x2e')];if(!_0xf41b0d[_0x99a1('0x33')][_0x99a1('0x37')]('nolimit')){_0x255197['limit']=qs[_0x99a1('0x1e')](_0xf41b0d[_0x99a1('0x33')][_0x99a1('0x1e')]);_0x255197[_0x99a1('0x1c')]=qs[_0x99a1('0x1c')](_0xf41b0d[_0x99a1('0x33')][_0x99a1('0x1c')]);}_0x255197['order']=qs[_0x99a1('0x38')](_0xf41b0d[_0x99a1('0x33')]['sort']);_0x255197[_0x99a1('0x39')]=qs[_0x99a1('0x31')](_[_0x99a1('0x3a')](_0xf41b0d[_0x99a1('0x33')],_0x1137f2[_0x99a1('0x31')]),_0x523668);if(_0xf41b0d[_0x99a1('0x33')][_0x99a1('0x3b')]){_0x255197[_0x99a1('0x39')]=_[_0x99a1('0x3c')](_0x255197[_0x99a1('0x39')],{'$or':_[_0x99a1('0x29')](_0x523668,function(_0x152969){if(_0x152969[_0x99a1('0x2c')]!=='VIRTUAL'){var _0x5553e4={};_0x5553e4[_0x152969['name']]={'$like':'%'+_0xf41b0d[_0x99a1('0x33')][_0x99a1('0x3b')]+'%'};return _0x5553e4;}})});}_0x255197=_[_0x99a1('0x3c')]({},_0x255197,_0xf41b0d[_0x99a1('0x3d')]);var _0x40613a={'where':_0x255197['where']};return db[_0x99a1('0x2a')][_0x99a1('0x1f')](_0x40613a)[_0x99a1('0x23')](function(_0x51efe5){_0x26fbae['count']=_0x51efe5;if(_0xf41b0d[_0x99a1('0x33')][_0x99a1('0x3e')]){_0x255197[_0x99a1('0x3f')]=[{'all':!![]}];}return db['ScreenRecording'][_0x99a1('0x40')](_0x255197);})[_0x99a1('0x23')](function(_0x1b5d2d){_0x26fbae[_0x99a1('0x41')]=_0x1b5d2d;return _0x26fbae;})[_0x99a1('0x23')](respondWithFilteredResult(_0x499eef,_0x255197))[_0x99a1('0x42')](handleError(_0x499eef,null));};exports[_0x99a1('0x43')]=function(_0x29d0a0,_0x1c4ce4){var _0x2be9e3={'raw':![],'where':{'id':_0x29d0a0[_0x99a1('0x44')]['id']}},_0x4b40e1={};_0x4b40e1[_0x99a1('0x2e')]=_[_0x99a1('0x30')](db['ScreenRecording'][_0x99a1('0x45')]);_0x4b40e1['query']=_[_0x99a1('0x30')](_0x29d0a0[_0x99a1('0x33')]);_0x4b40e1[_0x99a1('0x31')]=_[_0x99a1('0x32')](_0x4b40e1[_0x99a1('0x2e')],_0x4b40e1[_0x99a1('0x33')]);_0x2be9e3['attributes']=_[_0x99a1('0x32')](_0x4b40e1['model'],qs[_0x99a1('0x35')](_0x29d0a0[_0x99a1('0x33')][_0x99a1('0x35')]));_0x2be9e3[_0x99a1('0x34')]=_0x2be9e3[_0x99a1('0x34')][_0x99a1('0x36')]?_0x2be9e3[_0x99a1('0x34')]:_0x4b40e1[_0x99a1('0x2e')];if(_0x29d0a0[_0x99a1('0x33')][_0x99a1('0x3e')]){_0x2be9e3[_0x99a1('0x3f')]=[{'all':!![]}];}_0x2be9e3=_['merge']({},_0x2be9e3,_0x29d0a0[_0x99a1('0x3d')]);return db[_0x99a1('0x2a')]['find'](_0x2be9e3)[_0x99a1('0x23')](handleEntityNotFound(_0x1c4ce4,null))[_0x99a1('0x23')](respondWithResult(_0x1c4ce4,null))[_0x99a1('0x42')](handleError(_0x1c4ce4,null));};exports[_0x99a1('0x46')]=function(_0x113dd9,_0x254c41){return db[_0x99a1('0x2a')]['create'](_0x113dd9[_0x99a1('0x47')],{})['then'](respondWithResult(_0x254c41,0xc9))[_0x99a1('0x42')](handleError(_0x254c41,null));};exports[_0x99a1('0x48')]=function(_0x566442,_0x5433f2){if(_0x566442[_0x99a1('0x47')]['id']){delete _0x566442[_0x99a1('0x47')]['id'];}delete _0x566442[_0x99a1('0x47')][_0x99a1('0x49')];delete _0x566442[_0x99a1('0x47')]['createdAt'];delete _0x566442['body']['closedAt'];delete _0x566442[_0x99a1('0x47')][_0x99a1('0x4a')];return db[_0x99a1('0x2a')][_0x99a1('0x4b')]({'where':{'id':_0x566442[_0x99a1('0x44')]['id']}})[_0x99a1('0x23')](handleEntityNotFound(_0x5433f2,null))[_0x99a1('0x23')](saveUpdates(_0x566442['body'],null))[_0x99a1('0x23')](respondWithResult(_0x5433f2,null))[_0x99a1('0x42')](handleError(_0x5433f2,null));};exports[_0x99a1('0x4c')]=function(_0x5e877f,_0x81e218){return db['ScreenRecording']['describe']()[_0x99a1('0x23')](respondWithResult(_0x81e218,null))[_0x99a1('0x42')](handleError(_0x81e218,null));};exports[_0x99a1('0x4d')]=function(_0x175f6d,_0x11632d,_0xf8208a){var _0x240d2e=require(_0x99a1('0x4e'));var _0x16641e=![];var _0x53e9eb={};if(_0x175f6d[_0x99a1('0x33')]['type']&&_0x175f6d[_0x99a1('0x33')][_0x99a1('0x2c')]==='uniqueid'){_0x53e9eb[_0x99a1('0x4f')]=_0x175f6d[_0x99a1('0x44')]['id'];}else{_0x53e9eb['id']=_0x175f6d[_0x99a1('0x44')]['id'];}return db[_0x99a1('0x2a')][_0x99a1('0x4b')]({'where':_0x53e9eb,'attributes':['id',_0x99a1('0x4a')],'raw':!![]})[_0x99a1('0x23')](handleEntityNotFound(_0x11632d,null))[_0x99a1('0x23')](function(_0x28ba8f){if(_0x28ba8f){var _0x1c2926=path[_0x99a1('0x50')](config[_0x99a1('0x51')],'server/files/screen_recordings',_0x28ba8f['value']);var _0x2e3e08=util[_0x99a1('0x52')](_0x99a1('0x53'),_0x1c2926);if(fs[_0x99a1('0x54')](_0x2e3e08)){_0x16641e=!![];return _0x240d2e[_0x99a1('0x55')](_0x2e3e08,_0x1c2926,config['secrets'][_0x99a1('0x56')])[_0x99a1('0x23')](function(){return _0x28ba8f;});}return _0x28ba8f;}})['then'](function(_0x6107cd){if(_0x6107cd){var _0x95f20a=path[_0x99a1('0x50')](config[_0x99a1('0x51')],_0x99a1('0x57'),_0x6107cd['value']);if(!fs[_0x99a1('0x54')](_0x95f20a)){throw new db[(_0x99a1('0x58'))][(_0x99a1('0x59'))](_0x99a1('0x5a'));}if(_0x6107cd[_0x99a1('0x5b')]){return _0x11632d[_0x99a1('0x4d')](_0x95f20a,_0x6107cd['filename']+path[_0x99a1('0x5c')](_0x95f20a),function(){if(_0x16641e){fs[_0x99a1('0x5d')](_0x95f20a);}});}else{return _0x11632d['download'](_0x95f20a,function(_0x33feb9){if(_0x16641e){fs[_0x99a1('0x5d')](_0x95f20a);}});}}})[_0x99a1('0x42')](function(_0xb126dd){if(_0xb126dd[_0x99a1('0x5e')]==='ScreenRecording\x20not\x20found'){_0x11632d[_0x99a1('0x1a')](0x194)['send']('Not\x20found');}else{return handleError(_0x11632d,null);}});};exports['destroy']=function(_0x38ce3c,_0x3f7c16){return db['ScreenRecording']['find']({'where':{'id':_0x38ce3c[_0x99a1('0x44')]['id']}})['then'](function(_0x21a5f6){if(_[_0x99a1('0x5f')](_0x21a5f6)){throw new ReferenceError(_0x99a1('0x60'));}return _0x21a5f6;})[_0x99a1('0x23')](function(_0x56d6cf){var _0x18f74b=path[_0x99a1('0x50')](config[_0x99a1('0x51')],'server/files/screen_recordings',_0x56d6cf[_0x99a1('0x4a')]);logger['info'](_0x99a1('0x61'),_0x18f74b);if(!_[_0x99a1('0x5f')](_0x56d6cf[_0x99a1('0x4a')])&&fs[_0x99a1('0x54')](_0x18f74b)){logger[_0x99a1('0x62')]('File:\x20\x22'+_0x18f74b+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs['unlinkSync'](_0x18f74b);}_0x18f74b=_0x18f74b+_0x99a1('0x63');if(!_[_0x99a1('0x5f')](_0x56d6cf['value'])&&fs['existsSync'](_0x18f74b)){logger[_0x99a1('0x62')](_0x99a1('0x64')+_0x18f74b+_0x99a1('0x65'));fs['unlinkSync'](_0x18f74b);}return _0x56d6cf;})['then'](function(_0x2b8df8){if(!_0x2b8df8)throw new InternalError();return _0x2b8df8['destroy']();})[_0x99a1('0x23')](function(){_0x3f7c16[_0x99a1('0x1a')](0xcc)[_0x99a1('0x1b')]();})['catch'](handleError(_0x3f7c16,null));}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.model.js b/server/api/screenRecording/screenRecording.model.js index 3f4929c..898348e 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 _0xf242=['util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./screenRecording.attributes','exports','define','ScreenRecording','screen_recordings','interactionid','lodash'];(function(_0x182451,_0x2dd76a){var _0x17174b=function(_0x318ce9){while(--_0x318ce9){_0x182451['push'](_0x182451['shift']());}};_0x17174b(++_0x2dd76a);}(_0xf242,0xd1));var _0x2f24=function(_0x2d8f6c,_0x44db4c){_0x2d8f6c=_0x2d8f6c-0x0;var _0x3a00f6=_0xf242[_0x2d8f6c];return _0x3a00f6;};'use strict';var _=require(_0x2f24('0x0'));var util=require(_0x2f24('0x1'));var logger=require(_0x2f24('0x2'))(_0x2f24('0x3'));var moment=require('moment');var BPromise=require(_0x2f24('0x4'));var rp=require(_0x2f24('0x5'));var fs=require('fs');var path=require(_0x2f24('0x6'));var rimraf=require(_0x2f24('0x7'));var config=require(_0x2f24('0x8'));var attributes=require(_0x2f24('0x9'));module[_0x2f24('0xa')]=function(_0x245d6c,_0x7329be){return _0x245d6c[_0x2f24('0xb')](_0x2f24('0xc'),attributes,{'tableName':_0x2f24('0xd'),'paranoid':![],'indexes':[{'name':_0x2f24('0xe'),'fields':['interactionid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x529b=['bluebird','request-promise','path','rimraf','../../config/environment','exports','define','screen_recordings','interactionid','lodash','util','../../config/logger','api','moment'];(function(_0x23fb5c,_0x20c216){var _0x4ffdb9=function(_0x1096c1){while(--_0x1096c1){_0x23fb5c['push'](_0x23fb5c['shift']());}};_0x4ffdb9(++_0x20c216);}(_0x529b,0xbf));var _0xb529=function(_0x43b31b,_0x57c04a){_0x43b31b=_0x43b31b-0x0;var _0x2bae0f=_0x529b[_0x43b31b];return _0x2bae0f;};'use strict';var _=require(_0xb529('0x0'));var util=require(_0xb529('0x1'));var logger=require(_0xb529('0x2'))(_0xb529('0x3'));var moment=require(_0xb529('0x4'));var BPromise=require(_0xb529('0x5'));var rp=require(_0xb529('0x6'));var fs=require('fs');var path=require(_0xb529('0x7'));var rimraf=require(_0xb529('0x8'));var config=require(_0xb529('0x9'));var attributes=require('./screenRecording.attributes');module[_0xb529('0xa')]=function(_0x1b9b0a,_0x4c5cd7){return _0x1b9b0a[_0xb529('0xb')]('ScreenRecording',attributes,{'tableName':_0xb529('0xc'),'paranoid':![],'indexes':[{'name':_0xb529('0xd'),'fields':[_0xb529('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.rpc.js b/server/api/screenRecording/screenRecording.rpc.js index bae968e..7c69bc5 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 _0x1306=['lodash','util','moment','bluebird','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','ScreenRecording,\x20%s,\x20%s','request\x20sent','debug','ScreenRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch'];(function(_0x273613,_0x33c414){var _0x416e5f=function(_0x4b68bf){while(--_0x4b68bf){_0x273613['push'](_0x273613['shift']());}};_0x416e5f(++_0x33c414);}(_0x1306,0x19e));var _0x6130=function(_0x44199b,_0x3d6a69){_0x44199b=_0x44199b-0x0;var _0x1b840d=_0x1306[_0x44199b];return _0x1b840d;};'use strict';var _=require(_0x6130('0x0'));var util=require(_0x6130('0x1'));var moment=require(_0x6130('0x2'));var BPromise=require(_0x6130('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x6130('0x4'));var logger=require(_0x6130('0x5'))(_0x6130('0x6'));var config=require('../../config/environment');var jayson=require(_0x6130('0x7'));var client=jayson[_0x6130('0x8')][_0x6130('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2d2f2f,_0x251784,_0x97bd02){return new BPromise(function(_0x23ff29,_0x39b217){return client[_0x6130('0xa')](_0x2d2f2f,_0x97bd02)[_0x6130('0xb')](function(_0x4950d1){logger[_0x6130('0xc')](_0x6130('0xd'),_0x251784,_0x6130('0xe'));logger[_0x6130('0xf')](_0x6130('0x10'),_0x251784,_0x6130('0xe'),JSON[_0x6130('0x11')](_0x4950d1));if(_0x4950d1[_0x6130('0x12')]){if(_0x4950d1[_0x6130('0x12')][_0x6130('0x13')]===0x1f4){logger[_0x6130('0x12')](_0x6130('0xd'),_0x251784,_0x4950d1[_0x6130('0x12')][_0x6130('0x14')]);return _0x39b217(_0x4950d1[_0x6130('0x12')][_0x6130('0x14')]);}logger[_0x6130('0x12')](_0x6130('0xd'),_0x251784,_0x4950d1[_0x6130('0x12')][_0x6130('0x14')]);return _0x23ff29(_0x4950d1[_0x6130('0x12')][_0x6130('0x14')]);}else{logger[_0x6130('0xc')](_0x6130('0xd'),_0x251784,_0x6130('0xe'));_0x23ff29(_0x4950d1[_0x6130('0x15')][_0x6130('0x14')]);}})[_0x6130('0x16')](function(_0x4d4551){logger[_0x6130('0x12')](_0x6130('0xd'),_0x251784,_0x4d4551);_0x39b217(_0x4d4551);});});} \ No newline at end of file +var _0x2064=['ScreenRecording,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','request','then','info','ScreenRecording,\x20%s,\x20%s','debug'];(function(_0x1d0756,_0x1ce20d){var _0x5958f7=function(_0x5b91a){while(--_0x5b91a){_0x1d0756['push'](_0x1d0756['shift']());}};_0x5958f7(++_0x1ce20d);}(_0x2064,0x1d5));var _0x4206=function(_0x374ec1,_0x4ee2b5){_0x374ec1=_0x374ec1-0x0;var _0x1b379f=_0x2064[_0x374ec1];return _0x1b379f;};'use strict';var _=require(_0x4206('0x0'));var util=require(_0x4206('0x1'));var moment=require('moment');var BPromise=require(_0x4206('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4206('0x3'));var db=require(_0x4206('0x4'))['db'];var utils=require(_0x4206('0x5'));var logger=require('../../config/logger')(_0x4206('0x6'));var config=require(_0x4206('0x7'));var jayson=require(_0x4206('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x241112,_0x39ffd7,_0x32d5a2){return new BPromise(function(_0xce250e,_0x7721b2){return client[_0x4206('0x9')](_0x241112,_0x32d5a2)[_0x4206('0xa')](function(_0x9b1be0){logger[_0x4206('0xb')](_0x4206('0xc'),_0x39ffd7,'request\x20sent');logger[_0x4206('0xd')](_0x4206('0xe'),_0x39ffd7,_0x4206('0xf'),JSON[_0x4206('0x10')](_0x9b1be0));if(_0x9b1be0[_0x4206('0x11')]){if(_0x9b1be0[_0x4206('0x11')]['code']===0x1f4){logger[_0x4206('0x11')](_0x4206('0xc'),_0x39ffd7,_0x9b1be0['error'][_0x4206('0x12')]);return _0x7721b2(_0x9b1be0['error'][_0x4206('0x12')]);}logger['error'](_0x4206('0xc'),_0x39ffd7,_0x9b1be0[_0x4206('0x11')][_0x4206('0x12')]);return _0xce250e(_0x9b1be0[_0x4206('0x11')][_0x4206('0x12')]);}else{logger[_0x4206('0xb')]('ScreenRecording,\x20%s,\x20%s',_0x39ffd7,_0x4206('0xf'));_0xce250e(_0x9b1be0[_0x4206('0x13')][_0x4206('0x12')]);}})[_0x4206('0x14')](function(_0x410f56){logger[_0x4206('0x11')](_0x4206('0xc'),_0x39ffd7,_0x410f56);_0x7721b2(_0x410f56);});});} \ No newline at end of file diff --git a/server/api/setting/index.js b/server/api/setting/index.js index 65d8ace..4368553 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 _0xcce0=['connect-timeout','Router','fs-extra','./setting.controller','index','get','getDate','show','getLogo','/:id/logo_login','getLogoLogin','gdpr','/:id/favicon','getFavicon','diskStorage','join','root','server/files/images/logos/','format','%s%s','logo','extname','post','single','originalname','file','addLogoLogin','preferred','/:id/preferred','addPreferred','favicon','addFavicon','put','isAuthenticated','update','exports','multer'];(function(_0x59bc47,_0x5c32de){var _0x3bdc7d=function(_0x1e7001){while(--_0x1e7001){_0x59bc47['push'](_0x59bc47['shift']());}};_0x3bdc7d(++_0x5c32de);}(_0xcce0,0x102));var _0x0cce=function(_0x14a2ba,_0x3db02b){_0x14a2ba=_0x14a2ba-0x0;var _0x5d92ee=_0xcce0[_0x14a2ba];return _0x5d92ee;};'use strict';var multer=require(_0x0cce('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x0cce('0x1'));var express=require('express');var router=express[_0x0cce('0x2')]();var fs_extra=require(_0x0cce('0x3'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x0cce('0x4'));router['get']('/',auth['isAuthenticated'](),controller[_0x0cce('0x5')]);router[_0x0cce('0x6')]('/now',controller[_0x0cce('0x7')]);router[_0x0cce('0x6')]('/:id',controller[_0x0cce('0x8')]);router[_0x0cce('0x6')]('/:id/logo',controller[_0x0cce('0x9')]);router['get'](_0x0cce('0xa'),controller[_0x0cce('0xb')]);router[_0x0cce('0x6')]('/:id/gdpr',controller[_0x0cce('0xc')]);router['get']('/:id/preferred',controller['getPreferred']);router[_0x0cce('0x6')](_0x0cce('0xd'),controller[_0x0cce('0xe')]);var upload=multer({'storage':multer[_0x0cce('0xf')]({'destination':function(_0x1629d1,_0x539898,_0x10f7d7){_0x10f7d7(null,path[_0x0cce('0x10')](config[_0x0cce('0x11')],_0x0cce('0x12')));},'filename':function(_0x262feb,_0x2a7978,_0x181f59){_0x181f59(null,util[_0x0cce('0x13')](_0x0cce('0x14'),_0x0cce('0x15'),path[_0x0cce('0x16')](_0x2a7978['originalname'])));}})});router[_0x0cce('0x17')]('/:id/logo',upload[_0x0cce('0x18')]('file'),controller['addLogo']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x556663,_0x5dbb86,_0xbbbd72){_0xbbbd72(null,path[_0x0cce('0x10')](config[_0x0cce('0x11')],_0x0cce('0x12')));},'filename':function(_0x432801,_0x223e6d,_0x5d4d35){_0x5d4d35(null,util['format'](_0x0cce('0x14'),'logologin',path[_0x0cce('0x16')](_0x223e6d[_0x0cce('0x19')])));}})});router[_0x0cce('0x17')](_0x0cce('0xa'),upload['single'](_0x0cce('0x1a')),controller[_0x0cce('0x1b')]);var upload=multer({'storage':multer[_0x0cce('0xf')]({'destination':function(_0x1445d5,_0xb250a0,_0x40b203){_0x40b203(null,path[_0x0cce('0x10')](config[_0x0cce('0x11')],'server/files/images/logos/'));},'filename':function(_0x2bd516,_0x5e75c,_0x278515){_0x278515(null,util[_0x0cce('0x13')]('%s%s',_0x0cce('0x1c'),path[_0x0cce('0x16')](_0x5e75c['originalname'])));}})});router[_0x0cce('0x17')](_0x0cce('0x1d'),upload[_0x0cce('0x18')](_0x0cce('0x1a')),controller[_0x0cce('0x1e')]);var upload=multer({'storage':multer[_0x0cce('0xf')]({'destination':function(_0x4189bf,_0x1952a7,_0x543328){_0x543328(null,path[_0x0cce('0x10')](config['root'],_0x0cce('0x12')));},'filename':function(_0x594264,_0x29c7ac,_0x52bc03){_0x52bc03(null,util[_0x0cce('0x13')](_0x0cce('0x14'),_0x0cce('0x1f'),path[_0x0cce('0x16')](_0x29c7ac[_0x0cce('0x19')])));}})});router[_0x0cce('0x17')](_0x0cce('0xd'),upload[_0x0cce('0x18')]('file'),controller[_0x0cce('0x20')]);router[_0x0cce('0x21')]('/:id',auth[_0x0cce('0x22')](),controller[_0x0cce('0x23')]);module[_0x0cce('0x24')]=router; \ No newline at end of file +var _0xabc1=['server/files/images/logos/','format','%s%s','extname','originalname','post','single','join','file','addLogoLogin','preferred','favicon','/:id/favicon','addFavicon','put','update','exports','multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./setting.controller','get','isAuthenticated','index','/now','getDate','/:id','/:id/logo','/:id/logo_login','getLogoLogin','/:id/gdpr','gdpr','/:id/preferred','getPreferred','diskStorage','root'];(function(_0x3e85a4,_0x18c3a9){var _0x21e7d1=function(_0x48457d){while(--_0x48457d){_0x3e85a4['push'](_0x3e85a4['shift']());}};_0x21e7d1(++_0x18c3a9);}(_0xabc1,0x107));var _0x1abc=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xabc1[_0x2641f9];return _0x585741;};'use strict';var multer=require(_0x1abc('0x0'));var util=require(_0x1abc('0x1'));var path=require('path');var timeout=require(_0x1abc('0x2'));var express=require('express');var router=express[_0x1abc('0x3')]();var fs_extra=require(_0x1abc('0x4'));var auth=require(_0x1abc('0x5'));var interaction=require(_0x1abc('0x6'));var config=require(_0x1abc('0x7'));var controller=require(_0x1abc('0x8'));router[_0x1abc('0x9')]('/',auth[_0x1abc('0xa')](),controller[_0x1abc('0xb')]);router['get'](_0x1abc('0xc'),controller[_0x1abc('0xd')]);router[_0x1abc('0x9')](_0x1abc('0xe'),controller['show']);router['get'](_0x1abc('0xf'),controller['getLogo']);router[_0x1abc('0x9')](_0x1abc('0x10'),controller[_0x1abc('0x11')]);router[_0x1abc('0x9')](_0x1abc('0x12'),controller[_0x1abc('0x13')]);router['get'](_0x1abc('0x14'),controller[_0x1abc('0x15')]);router[_0x1abc('0x9')]('/:id/favicon',controller['getFavicon']);var upload=multer({'storage':multer[_0x1abc('0x16')]({'destination':function(_0xe62cd5,_0x3ba178,_0x57439c){_0x57439c(null,path['join'](config[_0x1abc('0x17')],_0x1abc('0x18')));},'filename':function(_0x56a77a,_0x37acdb,_0x39829c){_0x39829c(null,util[_0x1abc('0x19')](_0x1abc('0x1a'),'logo',path[_0x1abc('0x1b')](_0x37acdb[_0x1abc('0x1c')])));}})});router[_0x1abc('0x1d')](_0x1abc('0xf'),upload[_0x1abc('0x1e')]('file'),controller['addLogo']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x57c411,_0x1399ad,_0x1166a7){_0x1166a7(null,path[_0x1abc('0x1f')](config['root'],'server/files/images/logos/'));},'filename':function(_0x5c4b1f,_0x17c54c,_0x29554e){_0x29554e(null,util[_0x1abc('0x19')]('%s%s','logologin',path[_0x1abc('0x1b')](_0x17c54c[_0x1abc('0x1c')])));}})});router[_0x1abc('0x1d')](_0x1abc('0x10'),upload[_0x1abc('0x1e')](_0x1abc('0x20')),controller[_0x1abc('0x21')]);var upload=multer({'storage':multer[_0x1abc('0x16')]({'destination':function(_0x53c07f,_0x431d77,_0x257d8f){_0x257d8f(null,path['join'](config[_0x1abc('0x17')],_0x1abc('0x18')));},'filename':function(_0x35edfd,_0x243058,_0x524fdf){_0x524fdf(null,util[_0x1abc('0x19')](_0x1abc('0x1a'),_0x1abc('0x22'),path[_0x1abc('0x1b')](_0x243058[_0x1abc('0x1c')])));}})});router[_0x1abc('0x1d')](_0x1abc('0x14'),upload[_0x1abc('0x1e')]('file'),controller['addPreferred']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x989046,_0x1138f5,_0x41b2e7){_0x41b2e7(null,path[_0x1abc('0x1f')](config[_0x1abc('0x17')],_0x1abc('0x18')));},'filename':function(_0x524eb2,_0x1f1fec,_0x48b513){_0x48b513(null,util[_0x1abc('0x19')](_0x1abc('0x1a'),_0x1abc('0x23'),path[_0x1abc('0x1b')](_0x1f1fec['originalname'])));}})});router[_0x1abc('0x1d')](_0x1abc('0x24'),upload[_0x1abc('0x1e')](_0x1abc('0x20')),controller[_0x1abc('0x25')]);router[_0x1abc('0x26')]('/:id',auth[_0x1abc('0xa')](),controller[_0x1abc('0x27')]);module[_0x1abc('0x28')]=router; \ No newline at end of file diff --git a/server/api/setting/setting.attributes.js b/server/api/setting/setting.attributes.js index cb5023b..3025d73 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 _0xadb5=['https://www.xcally.com/bar/phonebar/autoupdater.xml','UNSIGNED','exports','min_internal','INTEGER','min_mailbox','STRING','/var/opt/motion2/server/files/sounds/converted','BOOLEAN'];(function(_0x301dab,_0x38050a){var _0x2500a2=function(_0x4d3dff){while(--_0x4d3dff){_0x301dab['push'](_0x301dab['shift']());}};_0x2500a2(++_0x38050a);}(_0xadb5,0xad));var _0x5adb=function(_0x23cda8,_0x999853){_0x23cda8=_0x23cda8-0x0;var _0x2a0496=_0xadb5[_0x23cda8];return _0x2a0496;};'use strict';var Sequelize=require('sequelize');module[_0x5adb('0x0')]={'min_internal':{'type':Sequelize['INTEGER'](0xb),'unique':_0x5adb('0x1'),'defaultValue':0x3e8},'min_mailbox':{'type':Sequelize[_0x5adb('0x2')](0xb),'unique':_0x5adb('0x3'),'defaultValue':0x3e8},'agi_port':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize[_0x5adb('0x4')],'defaultValue':_0x5adb('0x5')},'logo':{'type':Sequelize[_0x5adb('0x4')]},'defaultLogo':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'loginLogo':{'type':Sequelize[_0x5adb('0x4')]},'defaultLoginLogo':{'type':Sequelize[_0x5adb('0x6')],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize[_0x5adb('0x4')]},'defaultHeaderWhiteLabel':{'type':Sequelize[_0x5adb('0x6')],'defaultValue':!![]},'securePassword':{'type':Sequelize[_0x5adb('0x6')],'defaultValue':!![]},'firstSetup':{'type':Sequelize[_0x5adb('0x6')],'defaultValue':!![]},'stunaddr':{'type':Sequelize[_0x5adb('0x4')]},'turnaddr':{'type':Sequelize[_0x5adb('0x4')]},'turnusername':{'type':Sequelize[_0x5adb('0x4')]},'turnpassword':{'type':Sequelize[_0x5adb('0x4')]},'pageTitle':{'type':Sequelize[_0x5adb('0x4')]},'defaultPageTitle':{'type':Sequelize[_0x5adb('0x6')],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize[_0x5adb('0x6')],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize[_0x5adb('0x2')](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize['STRING'],'defaultValue':_0x5adb('0x7')},'enableEmailPreview':{'type':Sequelize[_0x5adb('0x6')],'defaultValue':![]},'split':{'type':Sequelize[_0x5adb('0x6')],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize['INTEGER'],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize[_0x5adb('0x2')],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize['INTEGER'],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize[_0x5adb('0x4')],'defaultValue':'alternate'},'chatTimeout':{'type':Sequelize[_0x5adb('0x2')],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize[_0x5adb('0x6')],'defaultValue':!![]},'preferred':{'type':Sequelize[_0x5adb('0x4')]},'defaultPreferred':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'rtlSupport':{'type':Sequelize[_0x5adb('0x6')],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize[_0x5adb('0x4')]},'allowedLoginAttempts':{'type':Sequelize[_0x5adb('0x2')],'defaultValue':0x5},'blockDuration':{'type':Sequelize['INTEGER'],'defaultValue':0xa},'favicon':{'type':Sequelize[_0x5adb('0x4')]},'defaultFavicon':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize[_0x5adb('0x2')],'defaultValue':0xa,'validate':{'min':0xa}},'transcribe':{'type':Sequelize[_0x5adb('0x6')],'defaultValue':![]},'automaticTranscribe':{'type':Sequelize[_0x5adb('0x6')],'defaultValue':![]},'transcribeAccountId':{'type':Sequelize[_0x5adb('0x2')]},'transcribeRegion':{'type':Sequelize[_0x5adb('0x4')]},'sentiment':{'type':Sequelize[_0x5adb('0x6')],'defaultValue':![]},'automaticSentiment':{'type':Sequelize[_0x5adb('0x6')],'defaultValue':![]},'sentimentAccountId':{'type':Sequelize[_0x5adb('0x2')]},'sentimentRegion':{'type':Sequelize[_0x5adb('0x4')]},'language':{'type':Sequelize['STRING']},'bucket':{'type':Sequelize[_0x5adb('0x4')]},'googleSsoEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enforcePasswordHistory':{'type':Sequelize[_0x5adb('0x6')],'defaultValue':!![]},'passwordHistoryLimit':{'type':Sequelize['INTEGER'](0x2)[_0x5adb('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5}},'privacyPolicyEmail':{'type':Sequelize['INTEGER'](0x2)['UNSIGNED'],'defaultValue':0x0},'privacyPolicyName':{'type':Sequelize[_0x5adb('0x2')](0x2)[_0x5adb('0x8')],'defaultValue':0x0},'privacyPolicyNumber':{'type':Sequelize[_0x5adb('0x2')](0x2)[_0x5adb('0x8')],'defaultValue':0x0},'searchOnEnterKey':{'type':Sequelize[_0x5adb('0x6')],'defaultValue':!![]},'chatInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'mailInteractionsReloadTimeout':{'type':Sequelize[_0x5adb('0x2')],'defaultValue':0x0},'openchannelInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'smsInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whatsappInteractionsReloadTimeout':{'type':Sequelize[_0x5adb('0x2')],'defaultValue':0x0},'stopRecordingOnTransfer':{'type':Sequelize[_0x5adb('0x6')],'defaultValue':![]}}; \ No newline at end of file +var _0x7a54=['UNSIGNED','sequelize','exports','INTEGER','min_mailbox','STRING','/var/opt/motion2/server/files/sounds/converted','BOOLEAN','alternate'];(function(_0x425a7c,_0x52e7a9){var _0x2df747=function(_0x2a2799){while(--_0x2a2799){_0x425a7c['push'](_0x425a7c['shift']());}};_0x2df747(++_0x52e7a9);}(_0x7a54,0x106));var _0x47a5=function(_0x2ead88,_0x1f67d4){_0x2ead88=_0x2ead88-0x0;var _0x135b54=_0x7a54[_0x2ead88];return _0x135b54;};'use strict';var Sequelize=require(_0x47a5('0x0'));module[_0x47a5('0x1')]={'min_internal':{'type':Sequelize[_0x47a5('0x2')](0xb),'unique':'min_internal','defaultValue':0x3e8},'min_mailbox':{'type':Sequelize[_0x47a5('0x2')](0xb),'unique':_0x47a5('0x3'),'defaultValue':0x3e8},'agi_port':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize[_0x47a5('0x4')],'defaultValue':_0x47a5('0x5')},'logo':{'type':Sequelize[_0x47a5('0x4')]},'defaultLogo':{'type':Sequelize[_0x47a5('0x6')],'defaultValue':!![]},'loginLogo':{'type':Sequelize[_0x47a5('0x4')]},'defaultLoginLogo':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize[_0x47a5('0x4')]},'defaultHeaderWhiteLabel':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'securePassword':{'type':Sequelize[_0x47a5('0x6')],'defaultValue':!![]},'firstSetup':{'type':Sequelize[_0x47a5('0x6')],'defaultValue':!![]},'stunaddr':{'type':Sequelize['STRING']},'turnaddr':{'type':Sequelize[_0x47a5('0x4')]},'turnusername':{'type':Sequelize['STRING']},'turnpassword':{'type':Sequelize['STRING']},'pageTitle':{'type':Sequelize['STRING']},'defaultPageTitle':{'type':Sequelize[_0x47a5('0x6')],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize[_0x47a5('0x6')],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize[_0x47a5('0x6')],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize['STRING'],'defaultValue':'https://www.xcally.com/bar/phonebar/autoupdater.xml'},'enableEmailPreview':{'type':Sequelize[_0x47a5('0x6')],'defaultValue':![]},'split':{'type':Sequelize[_0x47a5('0x6')],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize[_0x47a5('0x2')],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize[_0x47a5('0x2')],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize[_0x47a5('0x2')],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize[_0x47a5('0x4')],'defaultValue':_0x47a5('0x7')},'chatTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize[_0x47a5('0x6')],'defaultValue':!![]},'preferred':{'type':Sequelize[_0x47a5('0x4')]},'defaultPreferred':{'type':Sequelize[_0x47a5('0x6')],'defaultValue':!![]},'rtlSupport':{'type':Sequelize[_0x47a5('0x6')],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize[_0x47a5('0x4')]},'allowedLoginAttempts':{'type':Sequelize[_0x47a5('0x2')],'defaultValue':0x5},'blockDuration':{'type':Sequelize[_0x47a5('0x2')],'defaultValue':0xa},'favicon':{'type':Sequelize[_0x47a5('0x4')]},'defaultFavicon':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize[_0x47a5('0x2')],'defaultValue':0xa,'validate':{'min':0xa}},'transcribe':{'type':Sequelize[_0x47a5('0x6')],'defaultValue':![]},'automaticTranscribe':{'type':Sequelize[_0x47a5('0x6')],'defaultValue':![]},'transcribeAccountId':{'type':Sequelize[_0x47a5('0x2')]},'transcribeRegion':{'type':Sequelize[_0x47a5('0x4')]},'sentiment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'automaticSentiment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'sentimentAccountId':{'type':Sequelize[_0x47a5('0x2')]},'sentimentRegion':{'type':Sequelize['STRING']},'language':{'type':Sequelize['STRING']},'bucket':{'type':Sequelize[_0x47a5('0x4')]},'googleSsoEnabled':{'type':Sequelize[_0x47a5('0x6')],'defaultValue':![]},'enforcePasswordHistory':{'type':Sequelize[_0x47a5('0x6')],'defaultValue':!![]},'passwordHistoryLimit':{'type':Sequelize[_0x47a5('0x2')](0x2)[_0x47a5('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5}},'privacyPolicyEmail':{'type':Sequelize[_0x47a5('0x2')](0x2)[_0x47a5('0x8')],'defaultValue':0x0},'privacyPolicyName':{'type':Sequelize[_0x47a5('0x2')](0x2)[_0x47a5('0x8')],'defaultValue':0x0},'privacyPolicyNumber':{'type':Sequelize['INTEGER'](0x2)[_0x47a5('0x8')],'defaultValue':0x0},'searchOnEnterKey':{'type':Sequelize[_0x47a5('0x6')],'defaultValue':!![]},'chatInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'mailInteractionsReloadTimeout':{'type':Sequelize[_0x47a5('0x2')],'defaultValue':0x0},'openchannelInteractionsReloadTimeout':{'type':Sequelize[_0x47a5('0x2')],'defaultValue':0x0},'smsInteractionsReloadTimeout':{'type':Sequelize[_0x47a5('0x2')],'defaultValue':0x0},'whatsappInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'stopRecordingOnTransfer':{'type':Sequelize[_0x47a5('0x6')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/setting/setting.controller.js b/server/api/setting/setting.controller.js index 606ade1..b010cc1 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 _0xaf9d=['type','key','model','map','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','count','include','findAll','rows','show','params','find','body','addLogo','file','filename','addLogoLogin','loginLogo','getLogo','preferred','favicon','defaultLogo','defaultLoginLogo','defaultPreferred','logo','existsSync','join','root','toLower','default_logo.svg','default','custom','Sequelize','ValidationError','upperFirst','\x20not\x20found','getLogoLogin','server/files/images/logos','getLicense','defaultFavicon','default_loginLogo.svg','gdpr','securePassword','addPreferred','getPreferred','default_preferred.png','addFavicon','getFavicon','default_favicon.ico','download','getDate','utcOffset','format','YYYY-MM-DD\x20HH:mm:ss:SSS','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','http','then','Setting,\x20%s,\x20%s','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','status','offset','limit','undefined','set','Content-Range','apply','reject','save','update','destroy','end','sendStatus','stack','name','send','index','Setting','rawAttributes','fieldName'];(function(_0xffef30,_0x4a797b){var _0xeb9f2f=function(_0x52247a){while(--_0x52247a){_0xffef30['push'](_0xffef30['shift']());}};_0xeb9f2f(++_0x4a797b);}(_0xaf9d,0x146));var _0xdaf9=function(_0x5b176e,_0x442012){_0x5b176e=_0x5b176e-0x0;var _0x42e580=_0xaf9d[_0x5b176e];return _0x42e580;};'use strict';var emlformat=require(_0xdaf9('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xdaf9('0x1'));var jsonpatch=require(_0xdaf9('0x2'));var rp=require(_0xdaf9('0x3'));var moment=require(_0xdaf9('0x4'));var BPromise=require(_0xdaf9('0x5'));var Mustache=require(_0xdaf9('0x6'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0xdaf9('0x7'));var ejs=require(_0xdaf9('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xdaf9('0x9'));var squel=require(_0xdaf9('0xa'));var crypto=require(_0xdaf9('0xb'));var jsforce=require(_0xdaf9('0xc'));var deskjs=require(_0xdaf9('0xd'));var toCsv=require('to-csv');var querystring=require(_0xdaf9('0xe'));var Papa=require(_0xdaf9('0xf'));var Redis=require(_0xdaf9('0x10'));var authService=require(_0xdaf9('0x11'));var qs=require(_0xdaf9('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xdaf9('0x13'));var logger=require(_0xdaf9('0x14'))(_0xdaf9('0x15'));var utils=require(_0xdaf9('0x16'));var config=require(_0xdaf9('0x17'));var licenseUtil=require(_0xdaf9('0x18'));var db=require(_0xdaf9('0x19'))['db'];var jayson=require('jayson/promise');var client=jayson['client'][_0xdaf9('0x1a')]({'port':0x232a});function respondWithRpcPromise(_0x1c1c27,_0x330f08,_0xdc22bf,_0x1a9b90){return new BPromise(function(_0x34b152,_0x3471d8){var _0x3b4d08=_0x1a9b90||client;return _0x3b4d08['request'](_0x1c1c27,_0xdc22bf)[_0xdaf9('0x1b')](function(_0x41b814){logger['info'](_0xdaf9('0x1c'),_0x330f08,_0xdaf9('0x1d'));logger[_0xdaf9('0x1e')](_0xdaf9('0x1f'),_0x330f08,'request\x20sent',JSON['stringify'](_0x41b814));if(_0x41b814[_0xdaf9('0x20')]){if(_0x41b814['error'][_0xdaf9('0x21')]===0x1f4){logger['error'](_0xdaf9('0x1c'),_0x330f08,_0x41b814['error'][_0xdaf9('0x22')]);return _0x3471d8(_0x41b814['error']['message']);}logger[_0xdaf9('0x20')](_0xdaf9('0x1c'),_0x330f08,_0x41b814[_0xdaf9('0x20')][_0xdaf9('0x22')]);return _0x34b152(_0x41b814[_0xdaf9('0x20')][_0xdaf9('0x22')]);}else{logger[_0xdaf9('0x23')]('Setting,\x20%s,\x20%s',_0x330f08,_0xdaf9('0x1d'));_0x34b152(_0x41b814[_0xdaf9('0x24')]['message']);}})[_0xdaf9('0x25')](function(_0x3c6449){logger[_0xdaf9('0x20')](_0xdaf9('0x1c'),_0x330f08,_0x3c6449);_0x3471d8(_0x3c6449);});});}function respondWithStatusCode(_0x1f4f43,_0x34592d){_0x34592d=_0x34592d||0xcc;return function(_0x3a8f45){if(_0x3a8f45){return _0x1f4f43['sendStatus'](_0x34592d);}return _0x1f4f43[_0xdaf9('0x26')](_0x34592d)['end']();};}function respondWithResult(_0x1e07f9,_0x310599){_0x310599=_0x310599||0xc8;return function(_0x4a0d1f){if(_0x4a0d1f){return _0x1e07f9[_0xdaf9('0x26')](_0x310599)['json'](_0x4a0d1f);}};}function respondWithFilteredResult(_0x4fea76,_0x4a4d7c){return function(_0x46ecab){if(_0x46ecab){var _0x369da9=typeof _0x4a4d7c[_0xdaf9('0x27')]==='undefined'&&typeof _0x4a4d7c[_0xdaf9('0x28')]===_0xdaf9('0x29');var _0x5acfb6=_0x46ecab['count'];var _0x495080=_0x369da9?0x0:_0x4a4d7c[_0xdaf9('0x27')];var _0x3ec172=_0x369da9?_0x46ecab['count']:_0x4a4d7c[_0xdaf9('0x27')]+_0x4a4d7c[_0xdaf9('0x28')];var _0x46f242;if(_0x3ec172>=_0x5acfb6){_0x3ec172=_0x5acfb6;_0x46f242=0xc8;}else{_0x46f242=0xce;}_0x4fea76['status'](_0x46f242);return _0x4fea76[_0xdaf9('0x2a')](_0xdaf9('0x2b'),_0x495080+'-'+_0x3ec172+'/'+_0x5acfb6)['json'](_0x46ecab);}return null;};}function patchUpdates(_0xb28ff6){return function(_0x156489){try{jsonpatch[_0xdaf9('0x2c')](_0x156489,_0xb28ff6,!![]);}catch(_0x7b130){return BPromise[_0xdaf9('0x2d')](_0x7b130);}return _0x156489[_0xdaf9('0x2e')]();};}function saveUpdates(_0x467e45,_0x3436a3){return function(_0x53db81){if(_0x53db81){return _0x53db81[_0xdaf9('0x2f')](_0x467e45)['then'](function(_0x57c7d7){return _0x57c7d7;});}return null;};}function removeEntity(_0x1a614d,_0xc5f858){return function(_0x2d426e){if(_0x2d426e){return _0x2d426e[_0xdaf9('0x30')]()['then'](function(){_0x1a614d[_0xdaf9('0x26')](0xcc)[_0xdaf9('0x31')]();});}};}function handleEntityNotFound(_0x30dcc9,_0x2ce178){return function(_0xebcaec){if(!_0xebcaec){_0x30dcc9[_0xdaf9('0x32')](0x194);}return _0xebcaec;};}function handleError(_0x131c6b,_0x59fdf5){_0x59fdf5=_0x59fdf5||0x1f4;return function(_0x2d6164){logger[_0xdaf9('0x20')](_0x2d6164[_0xdaf9('0x33')]);if(_0x2d6164[_0xdaf9('0x34')]){delete _0x2d6164[_0xdaf9('0x34')];}_0x131c6b['status'](_0x59fdf5)[_0xdaf9('0x35')](_0x2d6164);};}exports[_0xdaf9('0x36')]=function(_0x4d0aaa,_0x114787){var _0x4ad368={},_0x5bb5a4={},_0x23be00={'count':0x0,'rows':[]};var _0x1aae57=_['map'](db[_0xdaf9('0x37')][_0xdaf9('0x38')],function(_0x3d0216){return{'name':_0x3d0216[_0xdaf9('0x39')],'type':_0x3d0216[_0xdaf9('0x3a')][_0xdaf9('0x3b')]};});_0x5bb5a4[_0xdaf9('0x3c')]=_[_0xdaf9('0x3d')](_0x1aae57,_0xdaf9('0x34'));_0x5bb5a4['query']=_[_0xdaf9('0x3e')](_0x4d0aaa[_0xdaf9('0x3f')]);_0x5bb5a4[_0xdaf9('0x40')]=_[_0xdaf9('0x41')](_0x5bb5a4[_0xdaf9('0x3c')],_0x5bb5a4[_0xdaf9('0x3f')]);_0x4ad368[_0xdaf9('0x42')]=_[_0xdaf9('0x41')](_0x5bb5a4[_0xdaf9('0x3c')],qs['fields'](_0x4d0aaa[_0xdaf9('0x3f')][_0xdaf9('0x43')]));_0x4ad368[_0xdaf9('0x42')]=_0x4ad368[_0xdaf9('0x42')][_0xdaf9('0x44')]?_0x4ad368[_0xdaf9('0x42')]:_0x5bb5a4['model'];if(!_0x4d0aaa[_0xdaf9('0x3f')][_0xdaf9('0x45')](_0xdaf9('0x46'))){_0x4ad368['limit']=qs[_0xdaf9('0x28')](_0x4d0aaa['query']['limit']);_0x4ad368[_0xdaf9('0x27')]=qs['offset'](_0x4d0aaa[_0xdaf9('0x3f')][_0xdaf9('0x27')]);}_0x4ad368[_0xdaf9('0x47')]=qs['sort'](_0x4d0aaa[_0xdaf9('0x3f')][_0xdaf9('0x48')]);_0x4ad368[_0xdaf9('0x49')]=qs[_0xdaf9('0x40')](_[_0xdaf9('0x4a')](_0x4d0aaa[_0xdaf9('0x3f')],_0x5bb5a4[_0xdaf9('0x40')]),_0x1aae57);if(_0x4d0aaa['query'][_0xdaf9('0x4b')]){_0x4ad368[_0xdaf9('0x49')]=_['merge'](_0x4ad368[_0xdaf9('0x49')],{'$or':_[_0xdaf9('0x3d')](_0x1aae57,function(_0x2038f6){if(_0x2038f6[_0xdaf9('0x3a')]!==_0xdaf9('0x4c')){var _0x144d76={};_0x144d76[_0x2038f6[_0xdaf9('0x34')]]={'$like':'%'+_0x4d0aaa[_0xdaf9('0x3f')][_0xdaf9('0x4b')]+'%'};return _0x144d76;}})});}_0x4ad368=_[_0xdaf9('0x4d')]({},_0x4ad368,_0x4d0aaa[_0xdaf9('0x4e')]);var _0x32bb9e={'where':_0x4ad368['where']};return db[_0xdaf9('0x37')][_0xdaf9('0x4f')](_0x32bb9e)[_0xdaf9('0x1b')](function(_0x24fe16){_0x23be00[_0xdaf9('0x4f')]=_0x24fe16;if(_0x4d0aaa['query']['includeAll']){_0x4ad368[_0xdaf9('0x50')]=[{'all':!![]}];}return db[_0xdaf9('0x37')][_0xdaf9('0x51')](_0x4ad368);})['then'](function(_0x1522cf){_0x23be00[_0xdaf9('0x52')]=_0x1522cf;return _0x23be00;})[_0xdaf9('0x1b')](respondWithFilteredResult(_0x114787,_0x4ad368))[_0xdaf9('0x25')](handleError(_0x114787,null));};exports[_0xdaf9('0x53')]=function(_0x44b86a,_0x3ae0ef){var _0x46b1ff={'raw':![],'where':{'id':_0x44b86a[_0xdaf9('0x54')]['id']}},_0x5c7fea={};_0x5c7fea[_0xdaf9('0x3c')]=_['keys'](db[_0xdaf9('0x37')]['rawAttributes']);_0x5c7fea['query']=_['keys'](_0x44b86a[_0xdaf9('0x3f')]);_0x5c7fea[_0xdaf9('0x40')]=_['intersection'](_0x5c7fea[_0xdaf9('0x3c')],_0x5c7fea[_0xdaf9('0x3f')]);_0x46b1ff['attributes']=_[_0xdaf9('0x41')](_0x5c7fea[_0xdaf9('0x3c')],qs[_0xdaf9('0x43')](_0x44b86a[_0xdaf9('0x3f')][_0xdaf9('0x43')]));_0x46b1ff[_0xdaf9('0x42')]=_0x46b1ff[_0xdaf9('0x42')][_0xdaf9('0x44')]?_0x46b1ff[_0xdaf9('0x42')]:_0x5c7fea[_0xdaf9('0x3c')];if(_0x44b86a['query']['includeAll']){_0x46b1ff[_0xdaf9('0x50')]=[{'all':!![]}];}_0x46b1ff=_[_0xdaf9('0x4d')]({},_0x46b1ff,_0x44b86a[_0xdaf9('0x4e')]);return db['Setting'][_0xdaf9('0x55')](_0x46b1ff)[_0xdaf9('0x1b')](handleEntityNotFound(_0x3ae0ef,null))['then'](respondWithResult(_0x3ae0ef,null))[_0xdaf9('0x25')](handleError(_0x3ae0ef,null));};exports['update']=function(_0x315c30,_0x34d605){if(_0x315c30['body']['id']){delete _0x315c30[_0xdaf9('0x56')]['id'];}return db[_0xdaf9('0x37')][_0xdaf9('0x55')]({'where':{'id':_0x315c30[_0xdaf9('0x54')]['id']}})[_0xdaf9('0x1b')](handleEntityNotFound(_0x34d605,null))['then'](saveUpdates(_0x315c30['body'],null))[_0xdaf9('0x1b')](respondWithResult(_0x34d605,null))[_0xdaf9('0x25')](handleError(_0x34d605,null));};exports[_0xdaf9('0x57')]=function(_0x424d17,_0x12f06e,_0x3307f2){if(_0x424d17['file']&&_0x424d17[_0xdaf9('0x58')][_0xdaf9('0x59')]){_0x424d17['body']['logo']=_0x424d17[_0xdaf9('0x58')][_0xdaf9('0x59')];}return db[_0xdaf9('0x37')]['find']({'where':{'id':_0x424d17['params']['id']}})['then'](handleEntityNotFound(_0x12f06e,null))[_0xdaf9('0x1b')](saveUpdates(_0x424d17[_0xdaf9('0x56')],null))[_0xdaf9('0x1b')](respondWithResult(_0x12f06e,null))[_0xdaf9('0x25')](handleError(_0x12f06e,null));};exports[_0xdaf9('0x5a')]=function(_0x13418b,_0x4d76c0,_0x386331){if(_0x13418b[_0xdaf9('0x58')]&&_0x13418b[_0xdaf9('0x58')]['filename']){_0x13418b[_0xdaf9('0x56')][_0xdaf9('0x5b')]=_0x13418b['file'][_0xdaf9('0x59')];}return db[_0xdaf9('0x37')][_0xdaf9('0x55')]({'where':{'id':_0x13418b[_0xdaf9('0x54')]['id']}})[_0xdaf9('0x1b')](handleEntityNotFound(_0x4d76c0,null))[_0xdaf9('0x1b')](saveUpdates(_0x13418b[_0xdaf9('0x56')],null))[_0xdaf9('0x1b')](respondWithResult(_0x4d76c0,null))[_0xdaf9('0x25')](handleError(_0x4d76c0,null));};var utilLicense=require(_0xdaf9('0x18'));exports[_0xdaf9('0x5c')]=function(_0x599059,_0x5278f2,_0x50b641){var _0x5e1a06='server/files/images/logos';var _0x1709a0={'custom':![]};return utilLicense['getLicense']()['then'](function(_0x5739d9){if(_0x5739d9){_0x1709a0=_0x5739d9;}return db[_0xdaf9('0x37')][_0xdaf9('0x55')]({'where':{'id':_0x599059[_0xdaf9('0x54')]['id']},'attributes':['logo',_0xdaf9('0x5b'),_0xdaf9('0x5d'),_0xdaf9('0x5e'),_0xdaf9('0x5f'),_0xdaf9('0x60'),_0xdaf9('0x61'),'defaultFavicon'],'raw':!![]});})[_0xdaf9('0x1b')](handleEntityNotFound(_0x5278f2,null))['then'](function(_0x252e02){if(_0x252e02){var _0x211b4d=_0x252e02[_0xdaf9('0x62')]&&fs[_0xdaf9('0x63')](path['join'](config['root'],_0x5e1a06,_['toLower'](_0x252e02['logo'])))?path[_0xdaf9('0x64')](config[_0xdaf9('0x65')],_0x5e1a06,_[_0xdaf9('0x66')](_0x252e02['logo'])):path[_0xdaf9('0x64')](config[_0xdaf9('0x65')],_0x5e1a06,_[_0xdaf9('0x66')](_0xdaf9('0x67')));var _0x37449a=_0xdaf9('0x68')+_['upperFirst'](_0xdaf9('0x62'));if(_0x252e02[_0x37449a]||!_0x1709a0[_0xdaf9('0x69')]){_0x211b4d=path[_0xdaf9('0x64')](config[_0xdaf9('0x65')],_0x5e1a06,_[_0xdaf9('0x66')](_0xdaf9('0x67')));}if(!fs[_0xdaf9('0x63')](_0x211b4d)){throw new db[(_0xdaf9('0x6a'))][(_0xdaf9('0x6b'))](_[_0xdaf9('0x6c')](_0xdaf9('0x62'))+_0xdaf9('0x6d'));}return _0x5278f2['download'](_0x211b4d);}})['catch'](handleError(_0x5278f2,null));};var utilLicense=require('../../config/license/util');exports[_0xdaf9('0x6e')]=function(_0x3e9c51,_0x4895c6,_0x128de4){var _0x1c9f1f=_0xdaf9('0x6f');var _0x2e0271={'custom':![]};return utilLicense[_0xdaf9('0x70')]()[_0xdaf9('0x1b')](function(_0x410a17){if(_0x410a17){_0x2e0271=_0x410a17;}return db[_0xdaf9('0x37')]['find']({'where':{'id':_0x3e9c51[_0xdaf9('0x54')]['id']},'attributes':[_0xdaf9('0x62'),_0xdaf9('0x5b'),'preferred',_0xdaf9('0x5e'),_0xdaf9('0x5f'),_0xdaf9('0x60'),'defaultPreferred',_0xdaf9('0x71')],'raw':!![]});})[_0xdaf9('0x1b')](handleEntityNotFound(_0x4895c6,null))['then'](function(_0x517787){if(_0x517787){var _0x1cd024=_0x517787['loginLogo']&&fs['existsSync'](path['join'](config['root'],_0x1c9f1f,_[_0xdaf9('0x66')](_0x517787[_0xdaf9('0x5b')])))?path[_0xdaf9('0x64')](config['root'],_0x1c9f1f,_['toLower'](_0x517787[_0xdaf9('0x5b')])):path[_0xdaf9('0x64')](config[_0xdaf9('0x65')],_0x1c9f1f,_[_0xdaf9('0x66')](_0xdaf9('0x72')));var _0x28fc90='default'+_[_0xdaf9('0x6c')](_0xdaf9('0x5b'));if(_0x517787[_0x28fc90]||!_0x2e0271[_0xdaf9('0x69')]){_0x1cd024=path[_0xdaf9('0x64')](config[_0xdaf9('0x65')],_0x1c9f1f,_['toLower'](_0xdaf9('0x72')));}if(!fs[_0xdaf9('0x63')](_0x1cd024)){throw new db[(_0xdaf9('0x6a'))][(_0xdaf9('0x6b'))](_[_0xdaf9('0x6c')](_0xdaf9('0x5b'))+_0xdaf9('0x6d'));}return _0x4895c6['download'](_0x1cd024);}})[_0xdaf9('0x25')](handleError(_0x4895c6,null));};exports[_0xdaf9('0x73')]=function(_0x25ccbe,_0x21485c){return db[_0xdaf9('0x37')][_0xdaf9('0x55')]({'where':{'id':_0x25ccbe[_0xdaf9('0x54')]['id']},'attributes':[_0xdaf9('0x74')]})[_0xdaf9('0x1b')](respondWithResult(_0x21485c,null))['catch'](handleError(_0x21485c,null));};exports[_0xdaf9('0x75')]=function(_0x3d1684,_0x521e0d,_0x2e53e7){if(_0x3d1684[_0xdaf9('0x58')]&&_0x3d1684[_0xdaf9('0x58')][_0xdaf9('0x59')]){_0x3d1684[_0xdaf9('0x56')]['preferred']=_0x3d1684[_0xdaf9('0x58')][_0xdaf9('0x59')];}return db['Setting'][_0xdaf9('0x55')]({'where':{'id':_0x3d1684[_0xdaf9('0x54')]['id']}})[_0xdaf9('0x1b')](handleEntityNotFound(_0x521e0d,null))['then'](saveUpdates(_0x3d1684[_0xdaf9('0x56')],null))[_0xdaf9('0x1b')](respondWithResult(_0x521e0d,null))[_0xdaf9('0x25')](handleError(_0x521e0d,null));};var utilLicense=require(_0xdaf9('0x18'));exports[_0xdaf9('0x76')]=function(_0x5b2daa,_0x2229e9,_0x178db6){var _0x1b3c87='server/files/images/logos';var _0x3b80bc={'custom':![]};return utilLicense['getLicense']()[_0xdaf9('0x1b')](function(_0x46ab12){if(_0x46ab12){_0x3b80bc=_0x46ab12;}return db[_0xdaf9('0x37')][_0xdaf9('0x55')]({'where':{'id':_0x5b2daa[_0xdaf9('0x54')]['id']},'attributes':[_0xdaf9('0x62'),_0xdaf9('0x5b'),_0xdaf9('0x5d'),_0xdaf9('0x5e'),_0xdaf9('0x5f'),_0xdaf9('0x60'),'defaultPreferred',_0xdaf9('0x71')],'raw':!![]});})['then'](handleEntityNotFound(_0x2229e9,null))['then'](function(_0x34dca1){if(_0x34dca1){var _0x3c9751=_0x34dca1[_0xdaf9('0x5d')]&&fs[_0xdaf9('0x63')](path[_0xdaf9('0x64')](config[_0xdaf9('0x65')],_0x1b3c87,_[_0xdaf9('0x66')](_0x34dca1[_0xdaf9('0x5d')])))?path[_0xdaf9('0x64')](config[_0xdaf9('0x65')],_0x1b3c87,_[_0xdaf9('0x66')](_0x34dca1[_0xdaf9('0x5d')])):path[_0xdaf9('0x64')](config[_0xdaf9('0x65')],_0x1b3c87,_[_0xdaf9('0x66')](_0xdaf9('0x77')));var _0x3cdb32=_0xdaf9('0x68')+_['upperFirst'](_0xdaf9('0x5d'));if(_0x34dca1[_0x3cdb32]||!_0x3b80bc['custom']||!_0x3b80bc['preferred']){_0x3c9751=path[_0xdaf9('0x64')](config[_0xdaf9('0x65')],_0x1b3c87,_['toLower']('default_preferred.png'));}if(!fs['existsSync'](_0x3c9751)){throw new db['Sequelize']['ValidationError'](_[_0xdaf9('0x6c')]('preferred')+_0xdaf9('0x6d'));}return _0x2229e9['download'](_0x3c9751);}})[_0xdaf9('0x25')](handleError(_0x2229e9,null));};exports[_0xdaf9('0x78')]=function(_0x4e1012,_0x4c7424,_0x3741ff){if(_0x4e1012[_0xdaf9('0x58')]&&_0x4e1012[_0xdaf9('0x58')][_0xdaf9('0x59')]){_0x4e1012[_0xdaf9('0x56')][_0xdaf9('0x5e')]=_0x4e1012[_0xdaf9('0x58')][_0xdaf9('0x59')];}return db[_0xdaf9('0x37')][_0xdaf9('0x55')]({'where':{'id':_0x4e1012[_0xdaf9('0x54')]['id']}})['then'](handleEntityNotFound(_0x4c7424,null))[_0xdaf9('0x1b')](saveUpdates(_0x4e1012[_0xdaf9('0x56')],null))[_0xdaf9('0x1b')](respondWithResult(_0x4c7424,null))['catch'](handleError(_0x4c7424,null));};var utilLicense=require(_0xdaf9('0x18'));exports[_0xdaf9('0x79')]=function(_0x375d89,_0x8953ed,_0x5b7ec9){var _0x35ef54=_0xdaf9('0x6f');var _0x10eca8={'custom':![]};return utilLicense[_0xdaf9('0x70')]()['then'](function(_0x1ca51e){if(_0x1ca51e){_0x10eca8=_0x1ca51e;}return db[_0xdaf9('0x37')][_0xdaf9('0x55')]({'where':{'id':_0x375d89[_0xdaf9('0x54')]['id']},'attributes':['logo',_0xdaf9('0x5b'),_0xdaf9('0x5d'),_0xdaf9('0x5e'),_0xdaf9('0x5f'),_0xdaf9('0x60'),'defaultPreferred',_0xdaf9('0x71')],'raw':!![]});})['then'](handleEntityNotFound(_0x8953ed,null))['then'](function(_0x481542){if(_0x481542){var _0xebc70=_0x481542['favicon']&&fs[_0xdaf9('0x63')](path[_0xdaf9('0x64')](config[_0xdaf9('0x65')],_0x35ef54,_[_0xdaf9('0x66')](_0x481542[_0xdaf9('0x5e')])))?path[_0xdaf9('0x64')](config[_0xdaf9('0x65')],_0x35ef54,_[_0xdaf9('0x66')](_0x481542[_0xdaf9('0x5e')])):path['join'](config[_0xdaf9('0x65')],_0x35ef54,_[_0xdaf9('0x66')](_0xdaf9('0x7a')));var _0x3e4cd4=_0xdaf9('0x68')+_['upperFirst']('favicon');if(_0x481542[_0x3e4cd4]||!_0x10eca8[_0xdaf9('0x69')]){_0xebc70=path[_0xdaf9('0x64')](config[_0xdaf9('0x65')],_0x35ef54,_['toLower'](_0xdaf9('0x7a')));}if(!fs['existsSync'](_0xebc70)){throw new db[(_0xdaf9('0x6a'))][(_0xdaf9('0x6b'))](_[_0xdaf9('0x6c')](_0xdaf9('0x5e'))+_0xdaf9('0x6d'));}return _0x8953ed[_0xdaf9('0x7b')](_0xebc70);}})['catch'](handleError(_0x8953ed,null));};exports[_0xdaf9('0x7c')]=function(_0x121b80,_0x27df02){var _0x34be90={'offset':moment()['utcOffset']()};_0x34be90['now']=moment()[_0xdaf9('0x7d')](_0x34be90['offset'])[_0xdaf9('0x7e')](_0xdaf9('0x7f'));return _0x27df02[_0xdaf9('0x26')](0xc8)['send'](_0x34be90);}; \ No newline at end of file +var _0x87f8=['../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','jayson/promise','client','request','info','Setting,\x20%s,\x20%s','debug','Setting,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','sendStatus','end','status','offset','undefined','count','limit','Content-Range','apply','reject','save','update','destroy','then','stack','name','send','index','Setting','rawAttributes','type','map','query','filters','intersection','attributes','model','fields','hasOwnProperty','nolimit','order','sort','pick','filter','where','VIRTUAL','merge','includeAll','include','findAll','catch','show','params','keys','length','options','find','body','file','filename','logo','addLogoLogin','loginLogo','server/files/images/logos','getLicense','preferred','favicon','defaultLoginLogo','defaultPreferred','defaultFavicon','existsSync','join','toLower','root','default','upperFirst','Sequelize','ValidationError','\x20not\x20found','getLogoLogin','defaultLogo','default_loginLogo.svg','download','gdpr','securePassword','addPreferred','../../config/license/util','getPreferred','default_preferred.png','custom','addFavicon','getFavicon','default_favicon.ico','now','YYYY-MM-DD\x20HH:mm:ss:SSS','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x87f8,0x152));var _0x887f=function(_0x3c84af,_0x4d855e){_0x3c84af=_0x3c84af-0x0;var _0x57120e=_0x87f8[_0x3c84af];return _0x57120e;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x887f('0x0'));var rp=require(_0x887f('0x1'));var moment=require('moment');var BPromise=require(_0x887f('0x2'));var Mustache=require('mustache');var util=require(_0x887f('0x3'));var path=require(_0x887f('0x4'));var sox=require(_0x887f('0x5'));var csv=require(_0x887f('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x887f('0x7'));var _=require(_0x887f('0x8'));var squel=require(_0x887f('0x9'));var crypto=require(_0x887f('0xa'));var jsforce=require(_0x887f('0xb'));var deskjs=require(_0x887f('0xc'));var toCsv=require(_0x887f('0x6'));var querystring=require('querystring');var Papa=require(_0x887f('0xd'));var Redis=require('ioredis');var authService=require(_0x887f('0xe'));var qs=require(_0x887f('0xf'));var as=require(_0x887f('0x10'));var hardwareService=require(_0x887f('0x11'));var logger=require('../../config/logger')(_0x887f('0x12'));var utils=require(_0x887f('0x13'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x887f('0x14'))['db'];var jayson=require(_0x887f('0x15'));var client=jayson[_0x887f('0x16')]['http']({'port':0x232a});function respondWithRpcPromise(_0x259198,_0x3abe48,_0x571066,_0x16bbc4){return new BPromise(function(_0x58152e,_0x59b7ab){var _0xabcefd=_0x16bbc4||client;return _0xabcefd[_0x887f('0x17')](_0x259198,_0x571066)['then'](function(_0x3f189a){logger[_0x887f('0x18')](_0x887f('0x19'),_0x3abe48,'request\x20sent');logger[_0x887f('0x1a')](_0x887f('0x1b'),_0x3abe48,'request\x20sent',JSON[_0x887f('0x1c')](_0x3f189a));if(_0x3f189a[_0x887f('0x1d')]){if(_0x3f189a[_0x887f('0x1d')][_0x887f('0x1e')]===0x1f4){logger[_0x887f('0x1d')](_0x887f('0x19'),_0x3abe48,_0x3f189a[_0x887f('0x1d')][_0x887f('0x1f')]);return _0x59b7ab(_0x3f189a[_0x887f('0x1d')][_0x887f('0x1f')]);}logger[_0x887f('0x1d')](_0x887f('0x19'),_0x3abe48,_0x3f189a[_0x887f('0x1d')]['message']);return _0x58152e(_0x3f189a[_0x887f('0x1d')][_0x887f('0x1f')]);}else{logger['info'](_0x887f('0x19'),_0x3abe48,_0x887f('0x20'));_0x58152e(_0x3f189a['result'][_0x887f('0x1f')]);}})['catch'](function(_0x2234ca){logger[_0x887f('0x1d')]('Setting,\x20%s,\x20%s',_0x3abe48,_0x2234ca);_0x59b7ab(_0x2234ca);});});}function respondWithStatusCode(_0x338777,_0x3af68e){_0x3af68e=_0x3af68e||0xcc;return function(_0x3d6948){if(_0x3d6948){return _0x338777[_0x887f('0x21')](_0x3af68e);}return _0x338777['status'](_0x3af68e)[_0x887f('0x22')]();};}function respondWithResult(_0x460091,_0x5c7f41){_0x5c7f41=_0x5c7f41||0xc8;return function(_0x1a1657){if(_0x1a1657){return _0x460091[_0x887f('0x23')](_0x5c7f41)['json'](_0x1a1657);}};}function respondWithFilteredResult(_0x1811e6,_0x7eef96){return function(_0x108890){if(_0x108890){var _0x4f25b1=typeof _0x7eef96[_0x887f('0x24')]==='undefined'&&typeof _0x7eef96['limit']===_0x887f('0x25');var _0x3be8cd=_0x108890[_0x887f('0x26')];var _0x2f20ce=_0x4f25b1?0x0:_0x7eef96[_0x887f('0x24')];var _0x4e1fe1=_0x4f25b1?_0x108890['count']:_0x7eef96[_0x887f('0x24')]+_0x7eef96[_0x887f('0x27')];var _0x286b0d;if(_0x4e1fe1>=_0x3be8cd){_0x4e1fe1=_0x3be8cd;_0x286b0d=0xc8;}else{_0x286b0d=0xce;}_0x1811e6[_0x887f('0x23')](_0x286b0d);return _0x1811e6['set'](_0x887f('0x28'),_0x2f20ce+'-'+_0x4e1fe1+'/'+_0x3be8cd)['json'](_0x108890);}return null;};}function patchUpdates(_0x155e39){return function(_0x543c26){try{jsonpatch[_0x887f('0x29')](_0x543c26,_0x155e39,!![]);}catch(_0x10ec52){return BPromise[_0x887f('0x2a')](_0x10ec52);}return _0x543c26[_0x887f('0x2b')]();};}function saveUpdates(_0x140d92,_0x3375c7){return function(_0x21040d){if(_0x21040d){return _0x21040d[_0x887f('0x2c')](_0x140d92)['then'](function(_0x1ee7b5){return _0x1ee7b5;});}return null;};}function removeEntity(_0x3d395d,_0x8f6faf){return function(_0x470578){if(_0x470578){return _0x470578[_0x887f('0x2d')]()[_0x887f('0x2e')](function(){_0x3d395d['status'](0xcc)[_0x887f('0x22')]();});}};}function handleEntityNotFound(_0x1e3954,_0x450f83){return function(_0x785968){if(!_0x785968){_0x1e3954[_0x887f('0x21')](0x194);}return _0x785968;};}function handleError(_0x4d2de4,_0x2a4d88){_0x2a4d88=_0x2a4d88||0x1f4;return function(_0x1bd047){logger['error'](_0x1bd047[_0x887f('0x2f')]);if(_0x1bd047[_0x887f('0x30')]){delete _0x1bd047[_0x887f('0x30')];}_0x4d2de4['status'](_0x2a4d88)[_0x887f('0x31')](_0x1bd047);};}exports[_0x887f('0x32')]=function(_0x1994d2,_0x202c99){var _0x580bae={},_0x474a9c={},_0x22295f={'count':0x0,'rows':[]};var _0x4c1219=_['map'](db[_0x887f('0x33')][_0x887f('0x34')],function(_0x14e46e){return{'name':_0x14e46e['fieldName'],'type':_0x14e46e[_0x887f('0x35')]['key']};});_0x474a9c['model']=_[_0x887f('0x36')](_0x4c1219,_0x887f('0x30'));_0x474a9c[_0x887f('0x37')]=_['keys'](_0x1994d2[_0x887f('0x37')]);_0x474a9c[_0x887f('0x38')]=_[_0x887f('0x39')](_0x474a9c['model'],_0x474a9c[_0x887f('0x37')]);_0x580bae[_0x887f('0x3a')]=_['intersection'](_0x474a9c[_0x887f('0x3b')],qs[_0x887f('0x3c')](_0x1994d2[_0x887f('0x37')][_0x887f('0x3c')]));_0x580bae[_0x887f('0x3a')]=_0x580bae[_0x887f('0x3a')]['length']?_0x580bae[_0x887f('0x3a')]:_0x474a9c[_0x887f('0x3b')];if(!_0x1994d2[_0x887f('0x37')][_0x887f('0x3d')](_0x887f('0x3e'))){_0x580bae[_0x887f('0x27')]=qs[_0x887f('0x27')](_0x1994d2['query'][_0x887f('0x27')]);_0x580bae[_0x887f('0x24')]=qs[_0x887f('0x24')](_0x1994d2[_0x887f('0x37')]['offset']);}_0x580bae[_0x887f('0x3f')]=qs[_0x887f('0x40')](_0x1994d2['query'][_0x887f('0x40')]);_0x580bae['where']=qs['filters'](_[_0x887f('0x41')](_0x1994d2[_0x887f('0x37')],_0x474a9c[_0x887f('0x38')]),_0x4c1219);if(_0x1994d2[_0x887f('0x37')][_0x887f('0x42')]){_0x580bae[_0x887f('0x43')]=_['merge'](_0x580bae[_0x887f('0x43')],{'$or':_[_0x887f('0x36')](_0x4c1219,function(_0x5e2afc){if(_0x5e2afc[_0x887f('0x35')]!==_0x887f('0x44')){var _0x100a7d={};_0x100a7d[_0x5e2afc[_0x887f('0x30')]]={'$like':'%'+_0x1994d2[_0x887f('0x37')][_0x887f('0x42')]+'%'};return _0x100a7d;}})});}_0x580bae=_[_0x887f('0x45')]({},_0x580bae,_0x1994d2['options']);var _0x4e5c4e={'where':_0x580bae[_0x887f('0x43')]};return db[_0x887f('0x33')]['count'](_0x4e5c4e)[_0x887f('0x2e')](function(_0xc87c72){_0x22295f['count']=_0xc87c72;if(_0x1994d2[_0x887f('0x37')][_0x887f('0x46')]){_0x580bae[_0x887f('0x47')]=[{'all':!![]}];}return db[_0x887f('0x33')][_0x887f('0x48')](_0x580bae);})[_0x887f('0x2e')](function(_0x22b11f){_0x22295f['rows']=_0x22b11f;return _0x22295f;})['then'](respondWithFilteredResult(_0x202c99,_0x580bae))[_0x887f('0x49')](handleError(_0x202c99,null));};exports[_0x887f('0x4a')]=function(_0x4c58f5,_0x297021){var _0x3fcd12={'raw':![],'where':{'id':_0x4c58f5[_0x887f('0x4b')]['id']}},_0x2bdd65={};_0x2bdd65[_0x887f('0x3b')]=_[_0x887f('0x4c')](db['Setting']['rawAttributes']);_0x2bdd65[_0x887f('0x37')]=_['keys'](_0x4c58f5[_0x887f('0x37')]);_0x2bdd65['filters']=_[_0x887f('0x39')](_0x2bdd65[_0x887f('0x3b')],_0x2bdd65[_0x887f('0x37')]);_0x3fcd12[_0x887f('0x3a')]=_[_0x887f('0x39')](_0x2bdd65['model'],qs[_0x887f('0x3c')](_0x4c58f5[_0x887f('0x37')][_0x887f('0x3c')]));_0x3fcd12[_0x887f('0x3a')]=_0x3fcd12[_0x887f('0x3a')][_0x887f('0x4d')]?_0x3fcd12[_0x887f('0x3a')]:_0x2bdd65[_0x887f('0x3b')];if(_0x4c58f5['query'][_0x887f('0x46')]){_0x3fcd12[_0x887f('0x47')]=[{'all':!![]}];}_0x3fcd12=_[_0x887f('0x45')]({},_0x3fcd12,_0x4c58f5[_0x887f('0x4e')]);return db[_0x887f('0x33')][_0x887f('0x4f')](_0x3fcd12)[_0x887f('0x2e')](handleEntityNotFound(_0x297021,null))[_0x887f('0x2e')](respondWithResult(_0x297021,null))['catch'](handleError(_0x297021,null));};exports[_0x887f('0x2c')]=function(_0x51e836,_0x5188d1){if(_0x51e836['body']['id']){delete _0x51e836['body']['id'];}return db['Setting']['find']({'where':{'id':_0x51e836['params']['id']}})[_0x887f('0x2e')](handleEntityNotFound(_0x5188d1,null))['then'](saveUpdates(_0x51e836[_0x887f('0x50')],null))[_0x887f('0x2e')](respondWithResult(_0x5188d1,null))['catch'](handleError(_0x5188d1,null));};exports['addLogo']=function(_0x4a9746,_0x28576e,_0x422490){if(_0x4a9746[_0x887f('0x51')]&&_0x4a9746['file'][_0x887f('0x52')]){_0x4a9746['body'][_0x887f('0x53')]=_0x4a9746['file'][_0x887f('0x52')];}return db['Setting'][_0x887f('0x4f')]({'where':{'id':_0x4a9746['params']['id']}})['then'](handleEntityNotFound(_0x28576e,null))[_0x887f('0x2e')](saveUpdates(_0x4a9746[_0x887f('0x50')],null))[_0x887f('0x2e')](respondWithResult(_0x28576e,null))['catch'](handleError(_0x28576e,null));};exports[_0x887f('0x54')]=function(_0x3f57bf,_0x3ccb7c,_0x24bea4){if(_0x3f57bf[_0x887f('0x51')]&&_0x3f57bf[_0x887f('0x51')][_0x887f('0x52')]){_0x3f57bf[_0x887f('0x50')][_0x887f('0x55')]=_0x3f57bf[_0x887f('0x51')][_0x887f('0x52')];}return db[_0x887f('0x33')][_0x887f('0x4f')]({'where':{'id':_0x3f57bf[_0x887f('0x4b')]['id']}})[_0x887f('0x2e')](handleEntityNotFound(_0x3ccb7c,null))['then'](saveUpdates(_0x3f57bf[_0x887f('0x50')],null))[_0x887f('0x2e')](respondWithResult(_0x3ccb7c,null))[_0x887f('0x49')](handleError(_0x3ccb7c,null));};var utilLicense=require('../../config/license/util');exports['getLogo']=function(_0x386650,_0x3c6799,_0x469dcc){var _0x5efc73=_0x887f('0x56');var _0x1ab23c={'custom':![]};return utilLicense[_0x887f('0x57')]()[_0x887f('0x2e')](function(_0x407a62){if(_0x407a62){_0x1ab23c=_0x407a62;}return db[_0x887f('0x33')][_0x887f('0x4f')]({'where':{'id':_0x386650['params']['id']},'attributes':[_0x887f('0x53'),_0x887f('0x55'),_0x887f('0x58'),_0x887f('0x59'),'defaultLogo',_0x887f('0x5a'),_0x887f('0x5b'),_0x887f('0x5c')],'raw':!![]});})[_0x887f('0x2e')](handleEntityNotFound(_0x3c6799,null))[_0x887f('0x2e')](function(_0x3be0cd){if(_0x3be0cd){var _0x36a8df=_0x3be0cd['logo']&&fs[_0x887f('0x5d')](path[_0x887f('0x5e')](config['root'],_0x5efc73,_[_0x887f('0x5f')](_0x3be0cd[_0x887f('0x53')])))?path[_0x887f('0x5e')](config[_0x887f('0x60')],_0x5efc73,_[_0x887f('0x5f')](_0x3be0cd[_0x887f('0x53')])):path['join'](config[_0x887f('0x60')],_0x5efc73,_[_0x887f('0x5f')]('default_logo.svg'));var _0x49f7f8=_0x887f('0x61')+_[_0x887f('0x62')]('logo');if(_0x3be0cd[_0x49f7f8]||!_0x1ab23c['custom']){_0x36a8df=path[_0x887f('0x5e')](config[_0x887f('0x60')],_0x5efc73,_[_0x887f('0x5f')]('default_logo.svg'));}if(!fs['existsSync'](_0x36a8df)){throw new db[(_0x887f('0x63'))][(_0x887f('0x64'))](_['upperFirst'](_0x887f('0x53'))+_0x887f('0x65'));}return _0x3c6799['download'](_0x36a8df);}})[_0x887f('0x49')](handleError(_0x3c6799,null));};var utilLicense=require('../../config/license/util');exports[_0x887f('0x66')]=function(_0x23647d,_0x3f54e2,_0x4db87e){var _0x231522=_0x887f('0x56');var _0x22a9e9={'custom':![]};return utilLicense[_0x887f('0x57')]()[_0x887f('0x2e')](function(_0x1fa578){if(_0x1fa578){_0x22a9e9=_0x1fa578;}return db[_0x887f('0x33')][_0x887f('0x4f')]({'where':{'id':_0x23647d['params']['id']},'attributes':[_0x887f('0x53'),_0x887f('0x55'),_0x887f('0x58'),_0x887f('0x59'),_0x887f('0x67'),_0x887f('0x5a'),_0x887f('0x5b'),_0x887f('0x5c')],'raw':!![]});})['then'](handleEntityNotFound(_0x3f54e2,null))['then'](function(_0x3abf35){if(_0x3abf35){var _0x5e59bc=_0x3abf35[_0x887f('0x55')]&&fs[_0x887f('0x5d')](path[_0x887f('0x5e')](config[_0x887f('0x60')],_0x231522,_[_0x887f('0x5f')](_0x3abf35[_0x887f('0x55')])))?path['join'](config['root'],_0x231522,_['toLower'](_0x3abf35[_0x887f('0x55')])):path['join'](config['root'],_0x231522,_[_0x887f('0x5f')]('default_loginLogo.svg'));var _0x23e566=_0x887f('0x61')+_['upperFirst']('loginLogo');if(_0x3abf35[_0x23e566]||!_0x22a9e9['custom']){_0x5e59bc=path['join'](config['root'],_0x231522,_[_0x887f('0x5f')](_0x887f('0x68')));}if(!fs[_0x887f('0x5d')](_0x5e59bc)){throw new db['Sequelize'][(_0x887f('0x64'))](_[_0x887f('0x62')](_0x887f('0x55'))+'\x20not\x20found');}return _0x3f54e2[_0x887f('0x69')](_0x5e59bc);}})['catch'](handleError(_0x3f54e2,null));};exports[_0x887f('0x6a')]=function(_0x48ed08,_0x2af03c){return db[_0x887f('0x33')]['find']({'where':{'id':_0x48ed08[_0x887f('0x4b')]['id']},'attributes':[_0x887f('0x6b')]})[_0x887f('0x2e')](respondWithResult(_0x2af03c,null))[_0x887f('0x49')](handleError(_0x2af03c,null));};exports[_0x887f('0x6c')]=function(_0x1787f5,_0x1ef2e0,_0xec10ee){if(_0x1787f5[_0x887f('0x51')]&&_0x1787f5[_0x887f('0x51')]['filename']){_0x1787f5[_0x887f('0x50')][_0x887f('0x58')]=_0x1787f5[_0x887f('0x51')][_0x887f('0x52')];}return db[_0x887f('0x33')][_0x887f('0x4f')]({'where':{'id':_0x1787f5['params']['id']}})[_0x887f('0x2e')](handleEntityNotFound(_0x1ef2e0,null))['then'](saveUpdates(_0x1787f5[_0x887f('0x50')],null))[_0x887f('0x2e')](respondWithResult(_0x1ef2e0,null))['catch'](handleError(_0x1ef2e0,null));};var utilLicense=require(_0x887f('0x6d'));exports[_0x887f('0x6e')]=function(_0x328472,_0x4a00b5,_0x5279ab){var _0x3f7a20='server/files/images/logos';var _0xaa4fe8={'custom':![]};return utilLicense[_0x887f('0x57')]()[_0x887f('0x2e')](function(_0x173ab6){if(_0x173ab6){_0xaa4fe8=_0x173ab6;}return db[_0x887f('0x33')][_0x887f('0x4f')]({'where':{'id':_0x328472['params']['id']},'attributes':[_0x887f('0x53'),_0x887f('0x55'),'preferred','favicon',_0x887f('0x67'),_0x887f('0x5a'),_0x887f('0x5b'),_0x887f('0x5c')],'raw':!![]});})['then'](handleEntityNotFound(_0x4a00b5,null))[_0x887f('0x2e')](function(_0x2a18c7){if(_0x2a18c7){var _0x59d1fc=_0x2a18c7['preferred']&&fs['existsSync'](path['join'](config[_0x887f('0x60')],_0x3f7a20,_['toLower'](_0x2a18c7['preferred'])))?path[_0x887f('0x5e')](config[_0x887f('0x60')],_0x3f7a20,_['toLower'](_0x2a18c7[_0x887f('0x58')])):path[_0x887f('0x5e')](config[_0x887f('0x60')],_0x3f7a20,_[_0x887f('0x5f')](_0x887f('0x6f')));var _0x3c3cea=_0x887f('0x61')+_[_0x887f('0x62')](_0x887f('0x58'));if(_0x2a18c7[_0x3c3cea]||!_0xaa4fe8[_0x887f('0x70')]||!_0xaa4fe8['preferred']){_0x59d1fc=path[_0x887f('0x5e')](config[_0x887f('0x60')],_0x3f7a20,_[_0x887f('0x5f')](_0x887f('0x6f')));}if(!fs['existsSync'](_0x59d1fc)){throw new db[(_0x887f('0x63'))][(_0x887f('0x64'))](_['upperFirst'](_0x887f('0x58'))+_0x887f('0x65'));}return _0x4a00b5[_0x887f('0x69')](_0x59d1fc);}})['catch'](handleError(_0x4a00b5,null));};exports[_0x887f('0x71')]=function(_0x54840a,_0x17e3ba,_0x42724e){if(_0x54840a[_0x887f('0x51')]&&_0x54840a[_0x887f('0x51')][_0x887f('0x52')]){_0x54840a[_0x887f('0x50')][_0x887f('0x59')]=_0x54840a[_0x887f('0x51')]['filename'];}return db['Setting']['find']({'where':{'id':_0x54840a[_0x887f('0x4b')]['id']}})['then'](handleEntityNotFound(_0x17e3ba,null))['then'](saveUpdates(_0x54840a[_0x887f('0x50')],null))[_0x887f('0x2e')](respondWithResult(_0x17e3ba,null))[_0x887f('0x49')](handleError(_0x17e3ba,null));};var utilLicense=require(_0x887f('0x6d'));exports[_0x887f('0x72')]=function(_0x294ae9,_0x39d95,_0x399ce7){var _0x4917ed='server/files/images/logos';var _0x58232b={'custom':![]};return utilLicense[_0x887f('0x57')]()[_0x887f('0x2e')](function(_0x324458){if(_0x324458){_0x58232b=_0x324458;}return db[_0x887f('0x33')]['find']({'where':{'id':_0x294ae9[_0x887f('0x4b')]['id']},'attributes':[_0x887f('0x53'),'loginLogo',_0x887f('0x58'),_0x887f('0x59'),_0x887f('0x67'),'defaultLoginLogo',_0x887f('0x5b'),_0x887f('0x5c')],'raw':!![]});})[_0x887f('0x2e')](handleEntityNotFound(_0x39d95,null))[_0x887f('0x2e')](function(_0x4102e9){if(_0x4102e9){var _0x5aa8a0=_0x4102e9[_0x887f('0x59')]&&fs[_0x887f('0x5d')](path[_0x887f('0x5e')](config[_0x887f('0x60')],_0x4917ed,_[_0x887f('0x5f')](_0x4102e9[_0x887f('0x59')])))?path[_0x887f('0x5e')](config['root'],_0x4917ed,_['toLower'](_0x4102e9['favicon'])):path[_0x887f('0x5e')](config['root'],_0x4917ed,_[_0x887f('0x5f')](_0x887f('0x73')));var _0x144b68='default'+_[_0x887f('0x62')](_0x887f('0x59'));if(_0x4102e9[_0x144b68]||!_0x58232b[_0x887f('0x70')]){_0x5aa8a0=path[_0x887f('0x5e')](config[_0x887f('0x60')],_0x4917ed,_['toLower'](_0x887f('0x73')));}if(!fs[_0x887f('0x5d')](_0x5aa8a0)){throw new db[(_0x887f('0x63'))]['ValidationError'](_[_0x887f('0x62')](_0x887f('0x59'))+_0x887f('0x65'));}return _0x39d95[_0x887f('0x69')](_0x5aa8a0);}})[_0x887f('0x49')](handleError(_0x39d95,null));};exports['getDate']=function(_0xd6bb9b,_0x5ac951){var _0x1daf1d={'offset':moment()['utcOffset']()};_0x1daf1d[_0x887f('0x74')]=moment()['utcOffset'](_0x1daf1d[_0x887f('0x24')])['format'](_0x887f('0x75'));return _0x5ac951[_0x887f('0x23')](0xc8)[_0x887f('0x31')](_0x1daf1d);}; \ No newline at end of file diff --git a/server/api/setting/setting.model.js b/server/api/setting/setting.model.js index d4066d2..c1ca2bc 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 _0xedd9=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./setting.attributes','exports','Setting','util'];(function(_0x1b0874,_0x1751b1){var _0x5d8802=function(_0x46fb52){while(--_0x46fb52){_0x1b0874['push'](_0x1b0874['shift']());}};_0x5d8802(++_0x1751b1);}(_0xedd9,0xfc));var _0x9edd=function(_0x1f896d,_0x5340c2){_0x1f896d=_0x1f896d-0x0;var _0x288175=_0xedd9[_0x1f896d];return _0x288175;};'use strict';var _=require('lodash');var util=require(_0x9edd('0x0'));var logger=require(_0x9edd('0x1'))(_0x9edd('0x2'));var moment=require(_0x9edd('0x3'));var BPromise=require(_0x9edd('0x4'));var rp=require(_0x9edd('0x5'));var fs=require('fs');var path=require(_0x9edd('0x6'));var rimraf=require(_0x9edd('0x7'));var config=require('../../config/environment');var attributes=require(_0x9edd('0x8'));module[_0x9edd('0x9')]=function(_0x268f9e,_0x34c1a7){return _0x268f9e['define'](_0x9edd('0xa'),attributes,{'tableName':'settings','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x55ca=['./setting.attributes','exports','define','settings','lodash','util','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x3f2a90,_0x50baf1){var _0xb46279=function(_0x5e47b5){while(--_0x5e47b5){_0x3f2a90['push'](_0x3f2a90['shift']());}};_0xb46279(++_0x50baf1);}(_0x55ca,0x126));var _0xa55c=function(_0x2ad1b8,_0x1ea09b){_0x2ad1b8=_0x2ad1b8-0x0;var _0x52547d=_0x55ca[_0x2ad1b8];return _0x52547d;};'use strict';var _=require(_0xa55c('0x0'));var util=require(_0xa55c('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xa55c('0x2'));var rp=require(_0xa55c('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa55c('0x4'));var config=require(_0xa55c('0x5'));var attributes=require(_0xa55c('0x6'));module[_0xa55c('0x7')]=function(_0x3c97c8,_0x279caa){return _0x3c97c8[_0xa55c('0x8')]('Setting',attributes,{'tableName':_0xa55c('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/setting/setting.rpc.js b/server/api/setting/setting.rpc.js index 661f6ab..39ff88c 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 _0x1b83=['message','result','catch','ShowSetting','find','options','raw','where','attributes','include','map','model','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Setting,\x20%s,\x20%s','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x443c28,_0x2bab14){var _0x481f01=function(_0x1fe349){while(--_0x1fe349){_0x443c28['push'](_0x443c28['shift']());}};_0x481f01(++_0x2bab14);}(_0x1b83,0x135));var _0x31b8=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x1b83[_0x21a9d9];return _0x46adce;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x31b8('0x0'));var BPromise=require(_0x31b8('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x31b8('0x2'));var db=require(_0x31b8('0x3'))['db'];var utils=require(_0x31b8('0x4'));var logger=require(_0x31b8('0x5'))(_0x31b8('0x6'));var config=require(_0x31b8('0x7'));var jayson=require(_0x31b8('0x8'));var client=jayson[_0x31b8('0x9')][_0x31b8('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x56120c,_0x2a7259,_0x542655){return new BPromise(function(_0x94556b,_0x11109d){return client[_0x31b8('0xb')](_0x56120c,_0x542655)[_0x31b8('0xc')](function(_0x2e97bb){logger[_0x31b8('0xd')](_0x31b8('0xe'),_0x2a7259,_0x31b8('0xf'));logger[_0x31b8('0x10')](_0x31b8('0x11'),_0x2a7259,_0x31b8('0xf'),JSON[_0x31b8('0x12')](_0x2e97bb));if(_0x2e97bb[_0x31b8('0x13')]){if(_0x2e97bb[_0x31b8('0x13')][_0x31b8('0x14')]===0x1f4){logger[_0x31b8('0x13')](_0x31b8('0xe'),_0x2a7259,_0x2e97bb[_0x31b8('0x13')][_0x31b8('0x15')]);return _0x11109d(_0x2e97bb[_0x31b8('0x13')][_0x31b8('0x15')]);}logger[_0x31b8('0x13')](_0x31b8('0xe'),_0x2a7259,_0x2e97bb[_0x31b8('0x13')]['message']);return _0x94556b(_0x2e97bb[_0x31b8('0x13')][_0x31b8('0x15')]);}else{logger['info'](_0x31b8('0xe'),_0x2a7259,'request\x20sent');_0x94556b(_0x2e97bb[_0x31b8('0x16')][_0x31b8('0x15')]);}})[_0x31b8('0x17')](function(_0x25a7c3){logger['error']('Setting,\x20%s,\x20%s',_0x2a7259,_0x25a7c3);_0x11109d(_0x25a7c3);});});}exports[_0x31b8('0x18')]=function(_0x24d607){var _0x144104=this;return new Promise(function(_0x150795,_0x1a0dff){return db['Setting'][_0x31b8('0x19')]({'raw':_0x24d607[_0x31b8('0x1a')]?_0x24d607[_0x31b8('0x1a')][_0x31b8('0x1b')]===undefined?!![]:![]:!![],'where':_0x24d607[_0x31b8('0x1a')]?_0x24d607[_0x31b8('0x1a')][_0x31b8('0x1c')]||null:null,'attributes':_0x24d607[_0x31b8('0x1a')]?_0x24d607[_0x31b8('0x1a')][_0x31b8('0x1d')]||null:null,'include':_0x24d607[_0x31b8('0x1a')]?_0x24d607['options'][_0x31b8('0x1e')]?_[_0x31b8('0x1f')](_0x24d607[_0x31b8('0x1a')][_0x31b8('0x1e')],function(_0x553d4f){return{'model':db[_0x553d4f[_0x31b8('0x20')]],'as':_0x553d4f['as'],'attributes':_0x553d4f['attributes'],'include':_0x553d4f[_0x31b8('0x1e')]?_['map'](_0x553d4f[_0x31b8('0x1e')],function(_0x57e3cb){return{'model':db[_0x57e3cb[_0x31b8('0x20')]],'as':_0x57e3cb['as'],'attributes':_0x57e3cb[_0x31b8('0x1d')],'include':_0x57e3cb['include']?_[_0x31b8('0x1f')](_0x57e3cb[_0x31b8('0x1e')],function(_0x17d7ab){return{'model':db[_0x17d7ab[_0x31b8('0x20')]],'as':_0x17d7ab['as'],'attributes':_0x17d7ab['attributes']};}):[]};}):[]};}):[]:[]})[_0x31b8('0xc')](function(_0x1e94a7){logger[_0x31b8('0xd')](_0x31b8('0x18'),_0x24d607);logger['debug']('ShowSetting',_0x24d607,JSON[_0x31b8('0x12')](_0x1e94a7));_0x150795(_0x1e94a7);})[_0x31b8('0x17')](function(_0x1d80dd){logger['error'](_0x31b8('0x18'),_0x1d80dd[_0x31b8('0x15')],_0x24d607);_0x1a0dff(_0x144104[_0x31b8('0x13')](0x1f4,_0x1d80dd[_0x31b8('0x15')]));});});}; \ No newline at end of file +var _0xfff2=['ShowSetting','Setting','find','options','raw','where','attributes','include','map','model','debug','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','request','info','request\x20sent','Setting,\x20%s,\x20%s,\x20%s','stringify','error','Setting,\x20%s,\x20%s','message','catch'];(function(_0x2406b4,_0x2f9771){var _0x7f3752=function(_0x583971){while(--_0x583971){_0x2406b4['push'](_0x2406b4['shift']());}};_0x7f3752(++_0x2f9771);}(_0xfff2,0x1a1));var _0x2fff=function(_0x3a5232,_0x577f7e){_0x3a5232=_0x3a5232-0x0;var _0x5c0b41=_0xfff2[_0x3a5232];return _0x5c0b41;};'use strict';var _=require(_0x2fff('0x0'));var util=require(_0x2fff('0x1'));var moment=require(_0x2fff('0x2'));var BPromise=require(_0x2fff('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2fff('0x4'))['db'];var utils=require(_0x2fff('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x2fff('0x6'));var jayson=require(_0x2fff('0x7'));var client=jayson[_0x2fff('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2223cc,_0x2b182e,_0x5a2ad8){return new BPromise(function(_0x13f998,_0x6ceeb9){return client[_0x2fff('0x9')](_0x2223cc,_0x5a2ad8)['then'](function(_0x2e38cf){logger[_0x2fff('0xa')]('Setting,\x20%s,\x20%s',_0x2b182e,_0x2fff('0xb'));logger['debug'](_0x2fff('0xc'),_0x2b182e,_0x2fff('0xb'),JSON[_0x2fff('0xd')](_0x2e38cf));if(_0x2e38cf['error']){if(_0x2e38cf[_0x2fff('0xe')]['code']===0x1f4){logger[_0x2fff('0xe')](_0x2fff('0xf'),_0x2b182e,_0x2e38cf[_0x2fff('0xe')][_0x2fff('0x10')]);return _0x6ceeb9(_0x2e38cf['error'][_0x2fff('0x10')]);}logger['error'](_0x2fff('0xf'),_0x2b182e,_0x2e38cf[_0x2fff('0xe')][_0x2fff('0x10')]);return _0x13f998(_0x2e38cf[_0x2fff('0xe')][_0x2fff('0x10')]);}else{logger[_0x2fff('0xa')]('Setting,\x20%s,\x20%s',_0x2b182e,'request\x20sent');_0x13f998(_0x2e38cf['result']['message']);}})[_0x2fff('0x11')](function(_0x17d456){logger[_0x2fff('0xe')]('Setting,\x20%s,\x20%s',_0x2b182e,_0x17d456);_0x6ceeb9(_0x17d456);});});}exports[_0x2fff('0x12')]=function(_0x43ca95){var _0x19eef1=this;return new Promise(function(_0x5ba36b,_0x2c38ab){return db[_0x2fff('0x13')][_0x2fff('0x14')]({'raw':_0x43ca95['options']?_0x43ca95[_0x2fff('0x15')][_0x2fff('0x16')]===undefined?!![]:![]:!![],'where':_0x43ca95[_0x2fff('0x15')]?_0x43ca95[_0x2fff('0x15')][_0x2fff('0x17')]||null:null,'attributes':_0x43ca95[_0x2fff('0x15')]?_0x43ca95[_0x2fff('0x15')][_0x2fff('0x18')]||null:null,'include':_0x43ca95[_0x2fff('0x15')]?_0x43ca95[_0x2fff('0x15')][_0x2fff('0x19')]?_[_0x2fff('0x1a')](_0x43ca95['options']['include'],function(_0x1cd38a){return{'model':db[_0x1cd38a[_0x2fff('0x1b')]],'as':_0x1cd38a['as'],'attributes':_0x1cd38a[_0x2fff('0x18')],'include':_0x1cd38a[_0x2fff('0x19')]?_[_0x2fff('0x1a')](_0x1cd38a[_0x2fff('0x19')],function(_0x408e6c){return{'model':db[_0x408e6c['model']],'as':_0x408e6c['as'],'attributes':_0x408e6c[_0x2fff('0x18')],'include':_0x408e6c[_0x2fff('0x19')]?_[_0x2fff('0x1a')](_0x408e6c[_0x2fff('0x19')],function(_0xb01c3d){return{'model':db[_0xb01c3d[_0x2fff('0x1b')]],'as':_0xb01c3d['as'],'attributes':_0xb01c3d[_0x2fff('0x18')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x520d28){logger[_0x2fff('0xa')]('ShowSetting',_0x43ca95);logger[_0x2fff('0x1c')]('ShowSetting',_0x43ca95,JSON[_0x2fff('0xd')](_0x520d28));_0x5ba36b(_0x520d28);})[_0x2fff('0x11')](function(_0x5933d0){logger['error']('ShowSetting',_0x5933d0[_0x2fff('0x10')],_0x43ca95);_0x2c38ab(_0x19eef1[_0x2fff('0xe')](0x1f4,_0x5933d0[_0x2fff('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/index.js b/server/api/smsAccount/index.js index 6ee9566..69a769f 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 _0x7fbe=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsAccount.controller','get','isAuthenticated','index','/describe','describe','/:id','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/applications','getApplications','/:id/interactions','getInteractions','/:id/status','statusGet','/:id/users','post','create','/:id/notify','notify','put','delete','removeAnswers','path','connect-timeout','express'];(function(_0x10066a,_0x1ee40b){var _0x2dac60=function(_0x28ce4f){while(--_0x28ce4f){_0x10066a['push'](_0x10066a['shift']());}};_0x2dac60(++_0x1ee40b);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0x225737,_0x28110b){_0x225737=_0x225737-0x0;var _0x4c5156=_0x7fbe[_0x225737];return _0x4c5156;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xe7fb('0x0'));var timeout=require(_0xe7fb('0x1'));var express=require(_0xe7fb('0x2'));var router=express[_0xe7fb('0x3')]();var fs_extra=require(_0xe7fb('0x4'));var auth=require(_0xe7fb('0x5'));var interaction=require(_0xe7fb('0x6'));var config=require(_0xe7fb('0x7'));var controller=require(_0xe7fb('0x8'));router[_0xe7fb('0x9')]('/',auth[_0xe7fb('0xa')](),controller[_0xe7fb('0xb')]);router[_0xe7fb('0x9')](_0xe7fb('0xc'),auth['isAuthenticated'](),controller[_0xe7fb('0xd')]);router[_0xe7fb('0x9')](_0xe7fb('0xe'),auth[_0xe7fb('0xa')](),controller['show']);router['get'](_0xe7fb('0xf'),auth[_0xe7fb('0xa')](),controller[_0xe7fb('0x10')]);router[_0xe7fb('0x9')](_0xe7fb('0x11'),auth[_0xe7fb('0xa')](),controller[_0xe7fb('0x12')]);router[_0xe7fb('0x9')](_0xe7fb('0x13'),auth[_0xe7fb('0xa')](),controller[_0xe7fb('0x14')]);router[_0xe7fb('0x9')](_0xe7fb('0x15'),auth[_0xe7fb('0xa')](),controller[_0xe7fb('0x16')]);router['get'](_0xe7fb('0x17'),controller[_0xe7fb('0x18')]);router['get'](_0xe7fb('0x19'),auth[_0xe7fb('0xa')](),controller['getAgents']);router[_0xe7fb('0x1a')]('/',auth['isAuthenticated'](),controller[_0xe7fb('0x1b')]);router[_0xe7fb('0x1a')](_0xe7fb('0xf'),auth[_0xe7fb('0xa')](),controller['addDisposition']);router[_0xe7fb('0x1a')]('/:id/canned_answers',auth[_0xe7fb('0xa')](),controller['addAnswer']);router[_0xe7fb('0x1a')](_0xe7fb('0x1c'),controller[_0xe7fb('0x1d')]);router[_0xe7fb('0x1a')]('/:id/applications',auth[_0xe7fb('0xa')](),controller['addApplications']);router[_0xe7fb('0x1a')]('/:id/send',auth[_0xe7fb('0xa')](),controller['send']);router[_0xe7fb('0x1a')](_0xe7fb('0x17'),controller['status']);router[_0xe7fb('0x1a')](_0xe7fb('0x19'),auth[_0xe7fb('0xa')](),controller['addAgents']);router[_0xe7fb('0x1e')](_0xe7fb('0xe'),auth['isAuthenticated'](),controller['update']);router['delete'](_0xe7fb('0xe'),auth['isAuthenticated'](),controller['destroy']);router[_0xe7fb('0x1f')](_0xe7fb('0xf'),auth[_0xe7fb('0xa')](),controller['removeDispositions']);router[_0xe7fb('0x1f')](_0xe7fb('0x11'),auth[_0xe7fb('0xa')](),controller[_0xe7fb('0x20')]);router[_0xe7fb('0x1f')](_0xe7fb('0x19'),auth[_0xe7fb('0xa')](),controller['removeAgents']);module['exports']=router; \ No newline at end of file +var _0x7217=['/:id/send','status','put','update','delete','removeDispositions','removeAnswers','multer','path','connect-timeout','express','Router','fs-extra','../../config/environment','./smsAccount.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/applications','/:id/interactions','getInteractions','/:id/status','statusGet','/:id/users','create','post','/:id/notify','notify','addApplications'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x7217,0x19e));var _0x7721=function(_0x138f59,_0x1b53fb){_0x138f59=_0x138f59-0x0;var _0x3d114d=_0x7217[_0x138f59];return _0x3d114d;};'use strict';var multer=require(_0x7721('0x0'));var util=require('util');var path=require(_0x7721('0x1'));var timeout=require(_0x7721('0x2'));var express=require(_0x7721('0x3'));var router=express[_0x7721('0x4')]();var fs_extra=require(_0x7721('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x7721('0x6'));var controller=require(_0x7721('0x7'));router[_0x7721('0x8')]('/',auth[_0x7721('0x9')](),controller[_0x7721('0xa')]);router[_0x7721('0x8')](_0x7721('0xb'),auth[_0x7721('0x9')](),controller[_0x7721('0xc')]);router[_0x7721('0x8')](_0x7721('0xd'),auth[_0x7721('0x9')](),controller[_0x7721('0xe')]);router[_0x7721('0x8')](_0x7721('0xf'),auth['isAuthenticated'](),controller[_0x7721('0x10')]);router[_0x7721('0x8')](_0x7721('0x11'),auth[_0x7721('0x9')](),controller[_0x7721('0x12')]);router[_0x7721('0x8')](_0x7721('0x13'),auth[_0x7721('0x9')](),controller['getApplications']);router[_0x7721('0x8')](_0x7721('0x14'),auth['isAuthenticated'](),controller[_0x7721('0x15')]);router[_0x7721('0x8')](_0x7721('0x16'),controller[_0x7721('0x17')]);router['get'](_0x7721('0x18'),auth[_0x7721('0x9')](),controller['getAgents']);router['post']('/',auth['isAuthenticated'](),controller[_0x7721('0x19')]);router[_0x7721('0x1a')](_0x7721('0xf'),auth[_0x7721('0x9')](),controller['addDisposition']);router[_0x7721('0x1a')]('/:id/canned_answers',auth[_0x7721('0x9')](),controller['addAnswer']);router[_0x7721('0x1a')](_0x7721('0x1b'),controller[_0x7721('0x1c')]);router[_0x7721('0x1a')](_0x7721('0x13'),auth[_0x7721('0x9')](),controller[_0x7721('0x1d')]);router[_0x7721('0x1a')](_0x7721('0x1e'),auth[_0x7721('0x9')](),controller['send']);router[_0x7721('0x1a')](_0x7721('0x16'),controller[_0x7721('0x1f')]);router[_0x7721('0x1a')]('/:id/users',auth[_0x7721('0x9')](),controller['addAgents']);router[_0x7721('0x20')](_0x7721('0xd'),auth[_0x7721('0x9')](),controller[_0x7721('0x21')]);router[_0x7721('0x22')](_0x7721('0xd'),auth[_0x7721('0x9')](),controller['destroy']);router[_0x7721('0x22')](_0x7721('0xf'),auth[_0x7721('0x9')](),controller[_0x7721('0x23')]);router[_0x7721('0x22')](_0x7721('0x11'),auth[_0x7721('0x9')](),controller[_0x7721('0x24')]);router[_0x7721('0x22')]('/:id/users',auth[_0x7721('0x9')](),controller['removeAgents']);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 71a1995..5b46d1f 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 _0x8d14=['plivo','clickatell','bandwidth','csc','infobip','intelepeer','BOOLEAN','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','randomstring','exports','name','STRING','ENUM','twilio','skebby','connectel'];(function(_0x481f96,_0x4a5329){var _0x2647d9=function(_0x3a28bc){while(--_0x3a28bc){_0x481f96['push'](_0x481f96['shift']());}};_0x2647d9(++_0x4a5329);}(_0x8d14,0xf4));var _0x48d1=function(_0x516153,_0x2ea833){_0x516153=_0x516153-0x0;var _0x521474=_0x8d14[_0x516153];return _0x521474;};'use strict';var Sequelize=require(_0x48d1('0x0'));var rs=require(_0x48d1('0x1'));module[_0x48d1('0x2')]={'name':{'type':Sequelize['STRING'],'unique':_0x48d1('0x3'),'allowNull':![]},'key':{'type':Sequelize['STRING'],'allowNull':![]},'remote':{'type':Sequelize['STRING'],'allowNull':![]},'token':{'type':Sequelize[_0x48d1('0x4')],'defaultValue':function(){return rs['generate']();}},'phone':{'type':Sequelize[_0x48d1('0x4')]},'type':{'type':Sequelize[_0x48d1('0x5')](_0x48d1('0x6'),_0x48d1('0x7'),_0x48d1('0x8'),'clicksend',_0x48d1('0x9'),_0x48d1('0xa'),_0x48d1('0xb'),_0x48d1('0xc'),_0x48d1('0xd'),_0x48d1('0xe'))},'accountSid':{'type':Sequelize[_0x48d1('0x4')]},'authId':{'type':Sequelize[_0x48d1('0x4')]},'authToken':{'type':Sequelize[_0x48d1('0x4')]},'smsMethod':{'type':Sequelize[_0x48d1('0x5')]('SI','TI','GP')},'username':{'type':Sequelize[_0x48d1('0x4')]},'password':{'type':Sequelize['STRING']},'apiKey':{'type':Sequelize[_0x48d1('0x4')]},'applicationId':{'type':Sequelize[_0x48d1('0x4')]},'accountId':{'type':Sequelize[_0x48d1('0x4')]},'senderString':{'type':Sequelize['STRING']},'deliveryReport':{'type':Sequelize[_0x48d1('0xf')],'defaultValue':![]},'description':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0x48d1('0x10');}},'notificationSound':{'type':Sequelize[_0x48d1('0xf')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x48d1('0xf')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x48d1('0x11')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x48d1('0xf')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x48d1('0x11')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x48d1('0xf')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x48d1('0x11')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize[_0x48d1('0x4')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x48d1('0x11')],'comment':_0x48d1('0x12')},'mandatoryDisposition':{'type':Sequelize[_0x48d1('0xf')],'defaultValue':![],'comment':_0x48d1('0x13'),'set':function(_0x5cf8cb){if(!_0x5cf8cb)this[_0x48d1('0x14')](_0x48d1('0x15'),null);this[_0x48d1('0x14')](_0x48d1('0x16'),_0x5cf8cb);}}}; \ No newline at end of file +var _0x9343=['TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','randomstring','exports','STRING','name','generate','ENUM','twilio','skebby','connectel','clicksend','plivo','clickatell','bandwidth','csc','infobip','intelepeer','BOOLEAN'];(function(_0x5f51e4,_0x24f018){var _0x290ba4=function(_0x487659){while(--_0x487659){_0x5f51e4['push'](_0x5f51e4['shift']());}};_0x290ba4(++_0x24f018);}(_0x9343,0x15a));var _0x3934=function(_0x5a9c64,_0x5b2d26){_0x5a9c64=_0x5a9c64-0x0;var _0x282d76=_0x9343[_0x5a9c64];return _0x282d76;};'use strict';var Sequelize=require(_0x3934('0x0'));var rs=require(_0x3934('0x1'));module[_0x3934('0x2')]={'name':{'type':Sequelize[_0x3934('0x3')],'unique':_0x3934('0x4'),'allowNull':![]},'key':{'type':Sequelize[_0x3934('0x3')],'allowNull':![]},'remote':{'type':Sequelize[_0x3934('0x3')],'allowNull':![]},'token':{'type':Sequelize[_0x3934('0x3')],'defaultValue':function(){return rs[_0x3934('0x5')]();}},'phone':{'type':Sequelize[_0x3934('0x3')]},'type':{'type':Sequelize[_0x3934('0x6')](_0x3934('0x7'),_0x3934('0x8'),_0x3934('0x9'),_0x3934('0xa'),_0x3934('0xb'),_0x3934('0xc'),_0x3934('0xd'),_0x3934('0xe'),_0x3934('0xf'),_0x3934('0x10'))},'accountSid':{'type':Sequelize[_0x3934('0x3')]},'authId':{'type':Sequelize['STRING']},'authToken':{'type':Sequelize[_0x3934('0x3')]},'smsMethod':{'type':Sequelize[_0x3934('0x6')]('SI','TI','GP')},'username':{'type':Sequelize[_0x3934('0x3')]},'password':{'type':Sequelize[_0x3934('0x3')]},'apiKey':{'type':Sequelize[_0x3934('0x3')]},'applicationId':{'type':Sequelize[_0x3934('0x3')]},'accountId':{'type':Sequelize[_0x3934('0x3')]},'senderString':{'type':Sequelize[_0x3934('0x3')]},'deliveryReport':{'type':Sequelize[_0x3934('0x11')],'defaultValue':![]},'description':{'type':Sequelize[_0x3934('0x3')]},'notificationTemplate':{'type':Sequelize[_0x3934('0x12')],'defaultValue':function(){return _0x3934('0x13');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x3934('0x11')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x3934('0x14')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x3934('0x14')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x3934('0x11')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x3934('0x14')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize['STRING']},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':_0x3934('0x15')},'mandatoryDisposition':{'type':Sequelize[_0x3934('0x11')],'defaultValue':![],'comment':_0x3934('0x16'),'set':function(_0x1a8b2a){if(!_0x1a8b2a)this[_0x3934('0x17')](_0x3934('0x18'),null);this[_0x3934('0x17')](_0x3934('0x19'),_0x1a8b2a);}}}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.controller.js b/server/api/smsAccount/smsAccount.controller.js index 1b47886..7ee5f77 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 _0x4a61=['createdAt','updatedAt','CompanyId','ListId','mobile','twilio','from','From','Body','messageId','MessageSid','sender','text','message_id','plivo','Text','MessageUUID','infobip','results','csc','originatingAddress','segmentedMessage','clickatell','replyMessageId','bandwidth','intelepeer','refid','body\x20is\x20mandatory\x20and\x20not\x20empty','isNil','includes','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','Contacts','omit','defaults','CmContact','SmsInteraction','spread','interaction','created','autoclose','close','unmanaged','ContactId','unshift','agent','waitForTheAssignedAgent','*,*,*,*','Start','startRouting','receiveMessage','entity\x20found','SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s','Content-Type','addApplications','sequelize','transaction','bulkCreate','findAndCountAll','getApplications','getInteractions','User','Owner','fullname','Tags','tag','to\x20is\x20mandatory','CmList','List','DESC','user','SmsMessage','Messages','dataValues','push','debug','inspect','skebby_dispatch_id','connectel','requestid','statusInt','clicksend','status_code','groupName','DELIVERED','redif','skebby','error_code','DELIVERED_TO_GATEWAY','RECEIVED_BY_RECIPIENT','message-delivered','DELIVRD','ACCEPTD','statusGet','received\x20delivery\x20report\x20from','message-id','state','addAgents','emit','removeAgents','isArray','userSmsAccount:remove','getAgents','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','register','jayson/promise','client','http','request','then','info','request\x20sent','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','SmsAccount,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','json','apply','save','update','destroy','UserProfileResource','stack','name','send','index','Pause','mandatoryDispositionPause','map','SmsAccount','rawAttributes','fieldName','type','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','VIRTUAL','merge','includeAll','rows','show','params','include','options','find','get','role','UserProfileSection','userProfileId','autoAssociation','create','body','describe','addDisposition','Disposition','getDispositions','findOne','pick','findAll','removeDispositions','addAnswer','SmsAccountId','CannedAnswer','getAnswers','removeAnswers','ids','notify','sms','SmsApplication','account','applications','orderBy','priority','asc','Applications','Sequelize','ValidationError','no\x20available\x20attributes','difference'];(function(_0x7e2eb0,_0x17cd58){var _0xd92de4=function(_0x5d005b){while(--_0x5d005b){_0x7e2eb0['push'](_0x7e2eb0['shift']());}};_0xd92de4(++_0x17cd58);}(_0x4a61,0x67));var _0x14a6=function(_0xbadbc0,_0x315714){_0xbadbc0=_0xbadbc0-0x0;var _0x335211=_0x4a61[_0xbadbc0];return _0x335211;};'use strict';var emlformat=require(_0x14a6('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x14a6('0x1'));var jsonpatch=require(_0x14a6('0x2'));var rp=require(_0x14a6('0x3'));var moment=require(_0x14a6('0x4'));var BPromise=require(_0x14a6('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x14a6('0x6'));var sox=require('sox');var csv=require(_0x14a6('0x7'));var ejs=require(_0x14a6('0x8'));var fs=require('fs');var fs_extra=require(_0x14a6('0x9'));var _=require('lodash');var squel=require(_0x14a6('0xa'));var crypto=require('crypto');var jsforce=require(_0x14a6('0xb'));var deskjs=require(_0x14a6('0xc'));var toCsv=require(_0x14a6('0x7'));var querystring=require(_0x14a6('0xd'));var Papa=require(_0x14a6('0xe'));var Redis=require('ioredis');var authService=require(_0x14a6('0xf'));var qs=require(_0x14a6('0x10'));var as=require(_0x14a6('0x11'));var hardwareService=require(_0x14a6('0x12'));var logger=require(_0x14a6('0x13'))('api');var utils=require(_0x14a6('0x14'));var config=require(_0x14a6('0x15'));var licenseUtil=require(_0x14a6('0x16'));var db=require(_0x14a6('0x17'))['db'];config[_0x14a6('0x18')]=_['defaults'](config[_0x14a6('0x18')],{'host':_0x14a6('0x19'),'port':0x18eb});var socket=require(_0x14a6('0x1a'))(new Redis(config[_0x14a6('0x18')]));require('./smsAccount.socket')[_0x14a6('0x1b')](socket);var jayson=require(_0x14a6('0x1c'));var client=jayson[_0x14a6('0x1d')][_0x14a6('0x1e')]({'port':0x232c});function respondWithRpcPromise(_0x5e74a0,_0x49d517,_0x255630,_0x3bba3e){return new BPromise(function(_0x1bf8f5,_0x67a24e){var _0x559c9d=_0x3bba3e||client;return _0x559c9d[_0x14a6('0x1f')](_0x5e74a0,_0x255630)[_0x14a6('0x20')](function(_0x58d26a){logger[_0x14a6('0x21')]('SmsAccount,\x20%s,\x20%s',_0x49d517,_0x14a6('0x22'));logger['debug'](_0x14a6('0x23'),_0x49d517,'request\x20sent',JSON[_0x14a6('0x24')](_0x58d26a));if(_0x58d26a[_0x14a6('0x25')]){if(_0x58d26a[_0x14a6('0x25')]['code']===0x1f4){logger[_0x14a6('0x25')](_0x14a6('0x26'),_0x49d517,_0x58d26a[_0x14a6('0x25')][_0x14a6('0x27')]);return _0x67a24e(_0x58d26a[_0x14a6('0x25')]['message']);}logger[_0x14a6('0x25')](_0x14a6('0x26'),_0x49d517,_0x58d26a[_0x14a6('0x25')][_0x14a6('0x27')]);return _0x1bf8f5(_0x58d26a['error'][_0x14a6('0x27')]);}else{logger[_0x14a6('0x21')](_0x14a6('0x26'),_0x49d517,_0x14a6('0x22'));_0x1bf8f5(_0x58d26a[_0x14a6('0x28')][_0x14a6('0x27')]);}})[_0x14a6('0x29')](function(_0x166955){logger[_0x14a6('0x25')](_0x14a6('0x26'),_0x49d517,_0x166955);_0x67a24e(_0x166955);});});}function respondWithStatusCode(_0x5053dc,_0x490c97){_0x490c97=_0x490c97||0xcc;return function(_0x15d54b){if(_0x15d54b){return _0x5053dc[_0x14a6('0x2a')](_0x490c97);}return _0x5053dc[_0x14a6('0x2b')](_0x490c97)[_0x14a6('0x2c')]();};}function respondWithResult(_0x41f9b2,_0x16b46e){_0x16b46e=_0x16b46e||0xc8;return function(_0x41923a){if(_0x41923a){return _0x41f9b2[_0x14a6('0x2b')](_0x16b46e)['json'](_0x41923a);}};}function respondWithFilteredResult(_0x37cdc3,_0x42f2dc){return function(_0x15cacd){if(_0x15cacd){var _0x58724a=typeof _0x42f2dc[_0x14a6('0x2d')]===_0x14a6('0x2e')&&typeof _0x42f2dc['limit']==='undefined';var _0x4eb6c1=_0x15cacd[_0x14a6('0x2f')];var _0xa2519a=_0x58724a?0x0:_0x42f2dc['offset'];var _0x130e6f=_0x58724a?_0x15cacd[_0x14a6('0x2f')]:_0x42f2dc[_0x14a6('0x2d')]+_0x42f2dc[_0x14a6('0x30')];var _0x12dea;if(_0x130e6f>=_0x4eb6c1){_0x130e6f=_0x4eb6c1;_0x12dea=0xc8;}else{_0x12dea=0xce;}_0x37cdc3[_0x14a6('0x2b')](_0x12dea);return _0x37cdc3[_0x14a6('0x31')](_0x14a6('0x32'),_0xa2519a+'-'+_0x130e6f+'/'+_0x4eb6c1)[_0x14a6('0x33')](_0x15cacd);}return null;};}function patchUpdates(_0x59bfee){return function(_0xdf8707){try{jsonpatch[_0x14a6('0x34')](_0xdf8707,_0x59bfee,!![]);}catch(_0x224ebc){return BPromise['reject'](_0x224ebc);}return _0xdf8707[_0x14a6('0x35')]();};}function saveUpdates(_0x3281c1,_0x281962){return function(_0x21e733){if(_0x21e733){return _0x21e733[_0x14a6('0x36')](_0x3281c1)['then'](function(_0x3d9021){return _0x3d9021;});}return null;};}function removeEntity(_0x458a5b,_0x5dae58){return function(_0x2a9d5d){if(_0x2a9d5d){return _0x2a9d5d[_0x14a6('0x37')]()[_0x14a6('0x20')](function(){var _0x13e7d5=_0x2a9d5d['get']({'plain':!![]});var _0x51467b='SmsAccounts';return db[_0x14a6('0x38')][_0x14a6('0x37')]({'where':{'type':_0x51467b,'resourceId':_0x13e7d5['id']}})[_0x14a6('0x20')](function(){return _0x2a9d5d;});})['then'](function(){_0x458a5b[_0x14a6('0x2b')](0xcc)[_0x14a6('0x2c')]();});}};}function handleEntityNotFound(_0x489a37,_0x3bccc7){return function(_0x1408fb){if(!_0x1408fb){_0x489a37['sendStatus'](0x194);}return _0x1408fb;};}function handleError(_0x487ea0,_0x5f4702){_0x5f4702=_0x5f4702||0x1f4;return function(_0x563694){logger[_0x14a6('0x25')](_0x563694[_0x14a6('0x39')]);if(_0x563694[_0x14a6('0x3a')]){delete _0x563694[_0x14a6('0x3a')];}_0x487ea0[_0x14a6('0x2b')](_0x5f4702)[_0x14a6('0x3b')](_0x563694);};}exports[_0x14a6('0x3c')]=function(_0x2524b5,_0x40a3dc){var _0x29ff2a={'include':[{'model':db[_0x14a6('0x3d')],'as':_0x14a6('0x3e')}]},_0x2e51e1={},_0x2f0ab1={'count':0x0,'rows':[]};var _0x5ac33d=_[_0x14a6('0x3f')](db[_0x14a6('0x40')][_0x14a6('0x41')],function(_0x40dae4){return{'name':_0x40dae4[_0x14a6('0x42')],'type':_0x40dae4[_0x14a6('0x43')]['key']};});_0x2e51e1['model']=_[_0x14a6('0x3f')](_0x5ac33d,'name');_0x2e51e1[_0x14a6('0x44')]=_[_0x14a6('0x45')](_0x2524b5['query']);_0x2e51e1[_0x14a6('0x46')]=_[_0x14a6('0x47')](_0x2e51e1[_0x14a6('0x48')],_0x2e51e1[_0x14a6('0x44')]);_0x29ff2a[_0x14a6('0x49')]=_[_0x14a6('0x47')](_0x2e51e1['model'],qs['fields'](_0x2524b5[_0x14a6('0x44')][_0x14a6('0x4a')]));_0x29ff2a[_0x14a6('0x49')]=_0x29ff2a[_0x14a6('0x49')][_0x14a6('0x4b')]?_0x29ff2a['attributes']:_0x2e51e1['model'];if(!_0x2524b5[_0x14a6('0x44')][_0x14a6('0x4c')](_0x14a6('0x4d'))){_0x29ff2a[_0x14a6('0x30')]=qs[_0x14a6('0x30')](_0x2524b5[_0x14a6('0x44')][_0x14a6('0x30')]);_0x29ff2a[_0x14a6('0x2d')]=qs[_0x14a6('0x2d')](_0x2524b5[_0x14a6('0x44')][_0x14a6('0x2d')]);}_0x29ff2a[_0x14a6('0x4e')]=qs[_0x14a6('0x4f')](_0x2524b5['query'][_0x14a6('0x4f')]);_0x29ff2a[_0x14a6('0x50')]=qs['filters'](_['pick'](_0x2524b5[_0x14a6('0x44')],_0x2e51e1[_0x14a6('0x46')]),_0x5ac33d);if(_0x2524b5[_0x14a6('0x44')][_0x14a6('0x51')]){_0x29ff2a['where']=_['merge'](_0x29ff2a[_0x14a6('0x50')],{'$or':_['map'](_0x5ac33d,function(_0x1d8bdb){if(_0x1d8bdb['type']!==_0x14a6('0x52')){var _0x3c5769={};_0x3c5769[_0x1d8bdb['name']]={'$like':'%'+_0x2524b5[_0x14a6('0x44')][_0x14a6('0x51')]+'%'};return _0x3c5769;}})});}_0x29ff2a=_[_0x14a6('0x53')]({},_0x29ff2a,_0x2524b5['options']);var _0x72fce={'where':_0x29ff2a[_0x14a6('0x50')]};return db['SmsAccount'][_0x14a6('0x2f')](_0x72fce)[_0x14a6('0x20')](function(_0x4eb83a){_0x2f0ab1['count']=_0x4eb83a;if(_0x2524b5[_0x14a6('0x44')][_0x14a6('0x54')]){_0x29ff2a['include']=[{'all':!![]}];}return db['SmsAccount']['findAll'](_0x29ff2a);})[_0x14a6('0x20')](function(_0x5e94e2){_0x2f0ab1[_0x14a6('0x55')]=_0x5e94e2;return _0x2f0ab1;})[_0x14a6('0x20')](respondWithFilteredResult(_0x40a3dc,_0x29ff2a))[_0x14a6('0x29')](handleError(_0x40a3dc,null));};exports[_0x14a6('0x56')]=function(_0x2d3052,_0x4e9146){var _0x2f9b31={'raw':![],'where':{'id':_0x2d3052[_0x14a6('0x57')]['id']},'include':[{'model':db[_0x14a6('0x3d')],'as':'mandatoryDispositionPause'}]},_0x5efe62={};_0x5efe62[_0x14a6('0x48')]=_['keys'](db[_0x14a6('0x40')][_0x14a6('0x41')]);_0x5efe62[_0x14a6('0x44')]=_[_0x14a6('0x45')](_0x2d3052['query']);_0x5efe62[_0x14a6('0x46')]=_[_0x14a6('0x47')](_0x5efe62[_0x14a6('0x48')],_0x5efe62[_0x14a6('0x44')]);_0x2f9b31[_0x14a6('0x49')]=_[_0x14a6('0x47')](_0x5efe62['model'],qs[_0x14a6('0x4a')](_0x2d3052[_0x14a6('0x44')]['fields']));_0x2f9b31[_0x14a6('0x49')]=_0x2f9b31[_0x14a6('0x49')][_0x14a6('0x4b')]?_0x2f9b31[_0x14a6('0x49')]:_0x5efe62[_0x14a6('0x48')];if(_0x2d3052[_0x14a6('0x44')][_0x14a6('0x54')]){_0x2f9b31[_0x14a6('0x58')]=[{'all':!![]}];}_0x2f9b31=_['merge']({},_0x2f9b31,_0x2d3052[_0x14a6('0x59')]);return db[_0x14a6('0x40')][_0x14a6('0x5a')](_0x2f9b31)['then'](handleEntityNotFound(_0x4e9146,null))[_0x14a6('0x20')](respondWithResult(_0x4e9146,null))[_0x14a6('0x29')](handleError(_0x4e9146,null));};exports['create']=function(_0x16d0a7,_0x451dda){return db[_0x14a6('0x40')]['create'](_0x16d0a7['body'],{})['then'](function(_0x3aa1a3){var _0x20a4ed=_0x16d0a7['user'][_0x14a6('0x5b')]({'plain':!![]});if(!_0x20a4ed)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x20a4ed[_0x14a6('0x5c')]==='user'){var _0x3687a5=_0x3aa1a3['get']({'plain':!![]});var _0x2c01a6='SmsAccounts';return db[_0x14a6('0x5d')][_0x14a6('0x5a')]({'where':{'name':_0x2c01a6,'userProfileId':_0x20a4ed[_0x14a6('0x5e')]},'raw':!![]})[_0x14a6('0x20')](function(_0x22bb9f){if(_0x22bb9f&&_0x22bb9f[_0x14a6('0x5f')]===0x0){return db['UserProfileResource'][_0x14a6('0x60')]({'name':_0x3687a5[_0x14a6('0x3a')],'resourceId':_0x3687a5['id'],'type':_0x22bb9f[_0x14a6('0x3a')],'sectionId':_0x22bb9f['id']},{})['then'](function(){return _0x3aa1a3;});}else{return _0x3aa1a3;}})[_0x14a6('0x29')](function(_0x317b6e){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x317b6e);throw _0x317b6e;});}return _0x3aa1a3;})[_0x14a6('0x20')](respondWithResult(_0x451dda,0xc9))[_0x14a6('0x29')](handleError(_0x451dda,null));};exports['update']=function(_0x221739,_0x345ad7){if(_0x221739[_0x14a6('0x61')]['id']){delete _0x221739['body']['id'];}return db[_0x14a6('0x40')][_0x14a6('0x5a')]({'where':{'id':_0x221739[_0x14a6('0x57')]['id']},'include':[{'model':db[_0x14a6('0x3d')],'as':_0x14a6('0x3e')}]})[_0x14a6('0x20')](handleEntityNotFound(_0x345ad7,null))['then'](saveUpdates(_0x221739[_0x14a6('0x61')],null))['then'](respondWithResult(_0x345ad7,null))[_0x14a6('0x29')](handleError(_0x345ad7,null));};exports[_0x14a6('0x37')]=function(_0x5c52e6,_0x51cd24){return db[_0x14a6('0x40')]['find']({'where':{'id':_0x5c52e6['params']['id']}})[_0x14a6('0x20')](handleEntityNotFound(_0x51cd24,null))[_0x14a6('0x20')](removeEntity(_0x51cd24,null))['catch'](handleError(_0x51cd24,null));};exports[_0x14a6('0x62')]=function(_0x365a92,_0x54b381){return db[_0x14a6('0x40')][_0x14a6('0x62')]()[_0x14a6('0x20')](respondWithResult(_0x54b381,null))[_0x14a6('0x29')](handleError(_0x54b381,null));};exports[_0x14a6('0x63')]=function(_0x2d9902,_0xea0a93,_0x4f3508){if(_0x2d9902['body']['id']){delete _0x2d9902[_0x14a6('0x61')]['id'];}return db['SmsAccount'][_0x14a6('0x5a')]({'where':{'id':_0x2d9902[_0x14a6('0x57')]['id']}})[_0x14a6('0x20')](handleEntityNotFound(_0xea0a93,null))[_0x14a6('0x20')](function(_0x4d4f83){if(_0x4d4f83){_0x2d9902[_0x14a6('0x61')]['SmsAccountId']=_0x4d4f83['id'];return db[_0x14a6('0x64')][_0x14a6('0x60')](_0x2d9902[_0x14a6('0x61')]);}})[_0x14a6('0x20')](respondWithResult(_0xea0a93,null))['catch'](handleError(_0xea0a93,null));};exports[_0x14a6('0x65')]=function(_0x4e7ea0,_0x669c6f,_0x32bc6f){var _0x15b544={'raw':![],'where':{}};var _0x386714={};var _0x59e722={'count':0x0,'rows':[]};return db[_0x14a6('0x40')][_0x14a6('0x66')]({'where':{'id':_0x4e7ea0[_0x14a6('0x57')]['id']}})[_0x14a6('0x20')](handleEntityNotFound(_0x669c6f,null))[_0x14a6('0x20')](function(_0x4cb7a1){if(_0x4cb7a1){_0x386714[_0x14a6('0x48')]=_[_0x14a6('0x45')](db['Disposition'][_0x14a6('0x41')]);_0x386714[_0x14a6('0x44')]=_[_0x14a6('0x45')](_0x4e7ea0['query']);_0x386714[_0x14a6('0x46')]=_[_0x14a6('0x47')](_0x386714['model'],_0x386714[_0x14a6('0x44')]);_0x15b544[_0x14a6('0x49')]=_[_0x14a6('0x47')](_0x386714[_0x14a6('0x48')],qs[_0x14a6('0x4a')](_0x4e7ea0['query'][_0x14a6('0x4a')]));_0x15b544[_0x14a6('0x49')]=_0x15b544[_0x14a6('0x49')][_0x14a6('0x4b')]?_0x15b544['attributes']:_0x386714[_0x14a6('0x48')];if(!_0x4e7ea0['query'][_0x14a6('0x4c')](_0x14a6('0x4d'))){_0x15b544[_0x14a6('0x30')]=qs[_0x14a6('0x30')](_0x4e7ea0['query'][_0x14a6('0x30')]);_0x15b544['offset']=qs['offset'](_0x4e7ea0['query'][_0x14a6('0x2d')]);}_0x15b544[_0x14a6('0x4e')]=qs['sort'](_0x4e7ea0[_0x14a6('0x44')][_0x14a6('0x4f')]);_0x15b544['where']=qs[_0x14a6('0x46')](_[_0x14a6('0x67')](_0x4e7ea0[_0x14a6('0x44')],_0x386714[_0x14a6('0x46')]));_0x15b544[_0x14a6('0x50')]['SmsAccountId']=_0x4cb7a1['id'];if(_0x4e7ea0['query'][_0x14a6('0x51')]){_0x15b544[_0x14a6('0x50')]=_[_0x14a6('0x53')](_0x15b544[_0x14a6('0x50')],{'$or':_['map'](_0x15b544[_0x14a6('0x49')],function(_0x3d724){var _0x1eb096={};_0x1eb096[_0x3d724]={'$like':'%'+_0x4e7ea0[_0x14a6('0x44')][_0x14a6('0x51')]+'%'};return _0x1eb096;})});}_0x15b544=_[_0x14a6('0x53')]({},_0x15b544,_0x4e7ea0['options']);return db[_0x14a6('0x64')][_0x14a6('0x2f')]({'where':_0x15b544['where']})[_0x14a6('0x20')](function(_0x5a654e){_0x59e722[_0x14a6('0x2f')]=_0x5a654e;if(_0x4e7ea0[_0x14a6('0x44')]['includeAll']){_0x15b544[_0x14a6('0x58')]=[{'all':!![]}];}return db['Disposition'][_0x14a6('0x68')](_0x15b544);})[_0x14a6('0x20')](function(_0x47ae4e){_0x59e722[_0x14a6('0x55')]=_0x47ae4e;return _0x59e722;});}})[_0x14a6('0x20')](respondWithFilteredResult(_0x669c6f,_0x15b544))['catch'](handleError(_0x669c6f,null));};exports[_0x14a6('0x69')]=function(_0x1dbb23,_0x2c9127,_0x5c8d52){return db[_0x14a6('0x40')][_0x14a6('0x5a')]({'where':{'id':_0x1dbb23[_0x14a6('0x57')]['id']}})['then'](handleEntityNotFound(_0x2c9127,null))[_0x14a6('0x20')](function(_0x22bee3){if(_0x22bee3){return _0x22bee3[_0x14a6('0x69')](_0x1dbb23[_0x14a6('0x44')]['ids']);}})[_0x14a6('0x20')](respondWithStatusCode(_0x2c9127,null))[_0x14a6('0x29')](handleError(_0x2c9127,null));};exports[_0x14a6('0x6a')]=function(_0x15fc3e,_0x272d06,_0x297cae){if(_0x15fc3e['body']['id']){delete _0x15fc3e[_0x14a6('0x61')]['id'];}return db['SmsAccount'][_0x14a6('0x5a')]({'where':{'id':_0x15fc3e[_0x14a6('0x57')]['id']}})[_0x14a6('0x20')](handleEntityNotFound(_0x272d06,null))[_0x14a6('0x20')](function(_0x45ef27){if(_0x45ef27){_0x15fc3e[_0x14a6('0x61')][_0x14a6('0x6b')]=_0x45ef27['id'];return db[_0x14a6('0x6c')][_0x14a6('0x60')](_0x15fc3e[_0x14a6('0x61')]);}})[_0x14a6('0x20')](respondWithResult(_0x272d06,null))[_0x14a6('0x29')](handleError(_0x272d06,null));};exports[_0x14a6('0x6d')]=function(_0x381523,_0xd4c2e4,_0x4756dd){var _0x44fbda={'raw':![],'where':{}};var _0x5eb5f8={};var _0x5bc6cb={'count':0x0,'rows':[]};return db['SmsAccount'][_0x14a6('0x66')]({'where':{'id':_0x381523[_0x14a6('0x57')]['id']}})[_0x14a6('0x20')](handleEntityNotFound(_0xd4c2e4,null))[_0x14a6('0x20')](function(_0x276592){if(_0x276592){_0x5eb5f8[_0x14a6('0x48')]=_[_0x14a6('0x45')](db['CannedAnswer'][_0x14a6('0x41')]);_0x5eb5f8[_0x14a6('0x44')]=_[_0x14a6('0x45')](_0x381523['query']);_0x5eb5f8[_0x14a6('0x46')]=_['intersection'](_0x5eb5f8[_0x14a6('0x48')],_0x5eb5f8[_0x14a6('0x44')]);_0x44fbda[_0x14a6('0x49')]=_['intersection'](_0x5eb5f8[_0x14a6('0x48')],qs['fields'](_0x381523['query'][_0x14a6('0x4a')]));_0x44fbda[_0x14a6('0x49')]=_0x44fbda[_0x14a6('0x49')][_0x14a6('0x4b')]?_0x44fbda[_0x14a6('0x49')]:_0x5eb5f8[_0x14a6('0x48')];if(!_0x381523[_0x14a6('0x44')][_0x14a6('0x4c')](_0x14a6('0x4d'))){_0x44fbda[_0x14a6('0x30')]=qs[_0x14a6('0x30')](_0x381523['query'][_0x14a6('0x30')]);_0x44fbda[_0x14a6('0x2d')]=qs[_0x14a6('0x2d')](_0x381523['query'][_0x14a6('0x2d')]);}_0x44fbda[_0x14a6('0x4e')]=qs[_0x14a6('0x4f')](_0x381523[_0x14a6('0x44')][_0x14a6('0x4f')]);_0x44fbda[_0x14a6('0x50')]=qs[_0x14a6('0x46')](_[_0x14a6('0x67')](_0x381523['query'],_0x5eb5f8[_0x14a6('0x46')]));_0x44fbda[_0x14a6('0x50')][_0x14a6('0x6b')]=_0x276592['id'];if(_0x381523[_0x14a6('0x44')][_0x14a6('0x51')]){_0x44fbda[_0x14a6('0x50')]=_[_0x14a6('0x53')](_0x44fbda[_0x14a6('0x50')],{'$or':_[_0x14a6('0x3f')](_0x44fbda[_0x14a6('0x49')],function(_0x2a0169){var _0x24c557={};_0x24c557[_0x2a0169]={'$like':'%'+_0x381523[_0x14a6('0x44')]['filter']+'%'};return _0x24c557;})});}_0x44fbda=_[_0x14a6('0x53')]({},_0x44fbda,_0x381523[_0x14a6('0x59')]);return db[_0x14a6('0x6c')][_0x14a6('0x2f')]({'where':_0x44fbda[_0x14a6('0x50')]})[_0x14a6('0x20')](function(_0x580bf3){_0x5bc6cb['count']=_0x580bf3;if(_0x381523[_0x14a6('0x44')]['includeAll']){_0x44fbda[_0x14a6('0x58')]=[{'all':!![]}];}return db[_0x14a6('0x6c')][_0x14a6('0x68')](_0x44fbda);})[_0x14a6('0x20')](function(_0x541820){_0x5bc6cb[_0x14a6('0x55')]=_0x541820;return _0x5bc6cb;});}})[_0x14a6('0x20')](respondWithFilteredResult(_0xd4c2e4,_0x44fbda))[_0x14a6('0x29')](handleError(_0xd4c2e4,null));};exports[_0x14a6('0x6e')]=function(_0x2525d4,_0x282b36,_0x48ee57){return db['SmsAccount']['find']({'where':{'id':_0x2525d4[_0x14a6('0x57')]['id']}})[_0x14a6('0x20')](handleEntityNotFound(_0x282b36,null))[_0x14a6('0x20')](function(_0x431c6a){if(_0x431c6a){return _0x431c6a[_0x14a6('0x6e')](_0x2525d4['query'][_0x14a6('0x6f')]);}})[_0x14a6('0x20')](respondWithStatusCode(_0x282b36,null))['catch'](handleError(_0x282b36,null));};exports[_0x14a6('0x70')]=function(_0x50aa7c,_0x5144cf,_0x34777f){var _0x195845={'channel':_0x14a6('0x71')};var _0x3b5118=[];var _0x3a7db8=[];var _0x51008d={};return db[_0x14a6('0x40')][_0x14a6('0x5a')]({'where':{'id':_0x50aa7c['params']['id']},'include':[{'model':db[_0x14a6('0x72')],'as':'Applications'}]})['then'](handleEntityNotFound(_0x5144cf,null))['then'](function(_0x4432f1){_0x195845[_0x14a6('0x73')]=_0x4432f1;_0x195845[_0x14a6('0x74')]=_[_0x14a6('0x75')](_0x4432f1['Applications'],[_0x14a6('0x76')],[_0x14a6('0x77')]);if(_0x195845[_0x14a6('0x73')][_0x14a6('0x78')]){delete _0x195845[_0x14a6('0x73')][_0x14a6('0x78')];}return db['CmContact'][_0x14a6('0x62')]();})[_0x14a6('0x20')](function(_0x2118d8){if(!_0x2118d8){throw new db[(_0x14a6('0x79'))][(_0x14a6('0x7a'))](_0x14a6('0x7b'));}_0x3b5118=_[_0x14a6('0x7c')](_[_0x14a6('0x45')](_0x2118d8),[_0x14a6('0x7d'),_0x14a6('0x7e')]);_0x3a7db8=_[_0x14a6('0x7c')](_[_0x14a6('0x45')](_0x2118d8),['createdAt',_0x14a6('0x7e'),_0x14a6('0x7f'),_0x14a6('0x80')]);_0x195845['body']={'mapKey':_0x14a6('0x81')};if(_0x195845[_0x14a6('0x73')][_0x14a6('0x43')]){switch(_0x195845[_0x14a6('0x73')]['type']){case _0x14a6('0x82'):_0x195845[_0x14a6('0x61')][_0x14a6('0x83')]=_0x50aa7c[_0x14a6('0x61')][_0x14a6('0x84')];_0x195845[_0x14a6('0x61')][_0x14a6('0x61')]=_0x50aa7c[_0x14a6('0x61')][_0x14a6('0x85')];_0x195845[_0x14a6('0x61')][_0x14a6('0x86')]=_0x50aa7c[_0x14a6('0x61')][_0x14a6('0x87')];break;case'skebby':_0x195845['body'][_0x14a6('0x83')]='+'+_0x50aa7c[_0x14a6('0x61')][_0x14a6('0x88')];_0x195845['body']['body']=_0x50aa7c[_0x14a6('0x61')][_0x14a6('0x89')];break;case'connectel':_0x195845[_0x14a6('0x61')][_0x14a6('0x83')]=_0x50aa7c['body'][_0x14a6('0x83')];_0x195845[_0x14a6('0x61')][_0x14a6('0x61')]=_0x50aa7c[_0x14a6('0x61')][_0x14a6('0x27')];break;case'clicksend':_0x195845[_0x14a6('0x61')][_0x14a6('0x83')]=_0x50aa7c[_0x14a6('0x61')][_0x14a6('0x83')];_0x195845['body'][_0x14a6('0x61')]=_0x50aa7c[_0x14a6('0x61')]['body'];_0x195845[_0x14a6('0x61')]['messageId']=_0x50aa7c[_0x14a6('0x61')][_0x14a6('0x8a')];break;case _0x14a6('0x8b'):_0x195845[_0x14a6('0x61')][_0x14a6('0x83')]=_0x50aa7c[_0x14a6('0x61')]['From'];_0x195845[_0x14a6('0x61')][_0x14a6('0x61')]=_0x50aa7c[_0x14a6('0x61')][_0x14a6('0x8c')];_0x195845[_0x14a6('0x61')]['messageId']=_0x50aa7c['body'][_0x14a6('0x8d')];break;case _0x14a6('0x8e'):_0x195845[_0x14a6('0x61')][_0x14a6('0x83')]='+'+_0x50aa7c[_0x14a6('0x61')][_0x14a6('0x8f')][0x0]['from'];_0x195845[_0x14a6('0x61')][_0x14a6('0x61')]=_0x50aa7c['body'][_0x14a6('0x8f')][0x0][_0x14a6('0x89')];_0x195845[_0x14a6('0x61')]['messageId']=_0x50aa7c['body']['results'][0x0][_0x14a6('0x86')];break;case _0x14a6('0x90'):_0x195845[_0x14a6('0x61')][_0x14a6('0x83')]=_0x50aa7c[_0x14a6('0x61')][_0x14a6('0x91')];_0x195845[_0x14a6('0x61')][_0x14a6('0x61')]=_0x50aa7c[_0x14a6('0x61')][_0x14a6('0x92')][_0x14a6('0x27')];break;case _0x14a6('0x93'):_0x195845['body'][_0x14a6('0x83')]=_0x50aa7c[_0x14a6('0x61')]['fromNumber'];_0x195845[_0x14a6('0x61')]['body']=_0x50aa7c[_0x14a6('0x61')][_0x14a6('0x89')];_0x195845[_0x14a6('0x61')]['messageId']=_0x50aa7c[_0x14a6('0x61')][_0x14a6('0x94')];break;case _0x14a6('0x95'):_0x195845[_0x14a6('0x61')]['messageId']=_0x50aa7c[_0x14a6('0x61')][0x0][_0x14a6('0x27')]['id'];_0x195845['body']['from']=_0x50aa7c['body'][0x0][_0x14a6('0x27')]['from'];_0x195845[_0x14a6('0x61')][_0x14a6('0x61')]=_0x50aa7c[_0x14a6('0x61')][0x0]['message']['text'];break;case _0x14a6('0x96'):_0x195845[_0x14a6('0x61')][_0x14a6('0x83')]=_0x50aa7c['body'][_0x14a6('0x83')];_0x195845[_0x14a6('0x61')][_0x14a6('0x61')]=_0x50aa7c[_0x14a6('0x61')][_0x14a6('0x27')];_0x195845[_0x14a6('0x61')]['messageId']=_0x50aa7c['body'][_0x14a6('0x97')];break;}}if(_0x195845[_0x14a6('0x61')]['id']){delete _0x195845[_0x14a6('0x61')]['id'];}if(_['isNil'](_0x195845[_0x14a6('0x61')][_0x14a6('0x83')])){throw new db[(_0x14a6('0x79'))][(_0x14a6('0x7a'))]('from\x20is\x20mandatory');}if(_['isNil'](_0x195845['body'][_0x14a6('0x61')])||_0x195845['body'][_0x14a6('0x61')]===''){throw new db['Sequelize']['ValidationError'](_0x14a6('0x98'));}if(_[_0x14a6('0x99')](_0x195845[_0x14a6('0x61')]['mapKey'])){throw new db[(_0x14a6('0x79'))][(_0x14a6('0x7a'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x3a7db8);}if(!_[_0x14a6('0x9a')](_0x3a7db8,_0x195845['body'][_0x14a6('0x9b')])){throw new db[(_0x14a6('0x79'))][(_0x14a6('0x7a'))](_0x14a6('0x9c')+_0x3a7db8);}_0x51008d[_0x195845[_0x14a6('0x61')][_0x14a6('0x9b')]]=_0x195845[_0x14a6('0x61')]['from'];return db['CmList'][_0x14a6('0x5a')]({'where':{'id':_0x195845[_0x14a6('0x73')]['ListId']},'include':[{'model':db['CmContact'],'as':_0x14a6('0x9d'),'where':_0x51008d,'limit':0x1,'order':[[_0x14a6('0x7e'),'DESC']]}]});})[_0x14a6('0x20')](handleEntityNotFound(_0x5144cf,null))[_0x14a6('0x20')](function(_0x21e1f9){if(_0x21e1f9){_0x195845['list']=_[_0x14a6('0x9e')](_0x21e1f9,[_0x14a6('0x9d')]);if(_0x21e1f9[_0x14a6('0x9d')][_0x14a6('0x4b')]){return _0x21e1f9[_0x14a6('0x9d')][0x0];}var _0x4de706=_[_0x14a6('0x9f')](_0x195845[_0x14a6('0x61')],{'firstName':_0x195845['body']['from'],'ListId':_0x21e1f9['id']});_0x4de706[_0x195845[_0x14a6('0x61')][_0x14a6('0x9b')]]=_0x195845[_0x14a6('0x61')][_0x14a6('0x83')];return db[_0x14a6('0xa0')][_0x14a6('0x60')](_0x4de706,{'fields':_0x3b5118,'raw':!![]});}})[_0x14a6('0x20')](handleEntityNotFound(_0x5144cf,null))[_0x14a6('0x20')](function(_0x3964f1){if(_0x3964f1){_0x195845['contact']=_0x3964f1;var _0x4b216f={'ContactId':_0x3964f1['id'],'phone':_0x195845[_0x14a6('0x61')][_0x14a6('0x83')],'SmsAccountId':_0x50aa7c['params']['id']};var _0x2e0329={'ContactId':_0x3964f1['id'],'SmsAccountId':_0x50aa7c[_0x14a6('0x57')]['id'],'closed':![]};return db[_0x14a6('0xa1')]['find']({'where':_0x2e0329})['then'](function(_0x29105a){if(_0x29105a){return[_0x29105a,![]];}return db[_0x14a6('0xa1')][_0x14a6('0x60')](_0x4b216f)[_0x14a6('0x20')](function(_0x4ddb60){return[_0x4ddb60,!![]];});});}})[_0x14a6('0xa2')](function(_0x2eb6cd,_0x2f5e43){_0x195845['interaction']=_0x2eb6cd[_0x14a6('0x5b')]({'plain':!![]});_0x195845[_0x14a6('0xa3')][_0x14a6('0xa4')]=![];if(_0x2f5e43){if(_0x195845['account'][_0x14a6('0xa5')]){_0x195845[_0x14a6('0x74')]['push']({'id':0x0,'priority':_0x195845[_0x14a6('0x74')]['length']+0x1,'app':_0x14a6('0xa6'),'appdata':_0x14a6('0xa7'),'interval':'*,*,*,*'});}_0x195845['interaction'][_0x14a6('0xa4')]=!![];}return db['SmsMessage'][_0x14a6('0x60')]({'phone':_0x195845['body'][_0x14a6('0x83')],'messageId':_0x195845[_0x14a6('0x61')]['messageId'],'body':_0x195845[_0x14a6('0x61')]['body'],'SmsAccountId':_0x50aa7c['params']['id'],'SmsInteractionId':_0x2eb6cd['id'],'direction':'in','ContactId':_0x2eb6cd[_0x14a6('0xa8')],'AttachmentId':_0x195845[_0x14a6('0x61')]['AttachmentId']});})['then'](function(_0x2a3ef0){_0x195845[_0x14a6('0x27')]=_0x2a3ef0;if(_0x195845[_0x14a6('0xa3')]['UserId']){return db['User'][_0x14a6('0x5a')]({'attributes':['id',_0x14a6('0x3a')],'where':{'id':_0x195845[_0x14a6('0xa3')]['UserId']}})['then'](function(_0x1ae1fa){if(_0x1ae1fa){_0x195845[_0x14a6('0x74')][_0x14a6('0xa9')]({'id':0x0,'priority':0x0,'app':_0x14a6('0xaa'),'appdata':_0x1ae1fa[_0x14a6('0x3a')]+','+(_0x195845['account'][_0x14a6('0xab')]||0xa),'interval':_0x14a6('0xac')});}return respondWithRpcPromise(_0x14a6('0xad'),_0x14a6('0xae'),_0x195845);});}return respondWithRpcPromise(_0x14a6('0xad'),'startRouting',_0x195845);})['then'](function(_0x59be37){if(_0x59be37){var _0x8faf82=0xc8;var _0x20dbb8=_0x14a6('0xaf');logger[_0x14a6('0x21')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x20dbb8,_0x8faf82,_0x14a6('0xb0'));logger['debug'](_0x14a6('0xb1'),_0x20dbb8,_0x8faf82,'entity\x20found',JSON['stringify'](_0x59be37));if(_0x195845[_0x14a6('0x73')][_0x14a6('0x43')]===_0x14a6('0x82')){return _0x5144cf[_0x14a6('0x2b')](_0x8faf82)[_0x14a6('0x31')](_0x14a6('0xb2'),'text/xml')[_0x14a6('0x3b')]('\x0a');}else{return _0x5144cf[_0x14a6('0x2b')](_0x8faf82)[_0x14a6('0x33')](_0x59be37);}}})['catch'](handleError(_0x5144cf,null));};exports[_0x14a6('0xb3')]=function(_0x4afdb0,_0x558d80,_0x1b7bad){return db['SmsAccount'][_0x14a6('0x66')]({'where':{'id':_0x4afdb0[_0x14a6('0x57')]['id']}})[_0x14a6('0x20')](handleEntityNotFound(_0x558d80,null))[_0x14a6('0x20')](function(_0x3623c1){if(_0x3623c1){return db[_0x14a6('0xb4')][_0x14a6('0xb5')](function(_0xb20944){return db['SmsApplication']['destroy']({'where':{'SmsAccountId':_0x4afdb0[_0x14a6('0x57')]['id']},'transaction':_0xb20944})['then'](function(_0x374877){var _0x100dcd=_[_0x14a6('0x3f')](_0x4afdb0[_0x14a6('0x61')],function(_0x475048){_0x475048[_0x14a6('0x6b')]=_0x4afdb0[_0x14a6('0x57')]['id'];return _0x475048;});return db[_0x14a6('0x72')][_0x14a6('0xb6')](_0x100dcd,{'transaction':_0xb20944});});})[_0x14a6('0x20')](function(){return db[_0x14a6('0x72')][_0x14a6('0xb7')]({'where':{'SmsAccountId':_0x4afdb0[_0x14a6('0x57')]['id']},'order':_0x14a6('0x76')});});}})['then'](respondWithResult(_0x558d80,null))[_0x14a6('0x29')](handleError(_0x558d80,null));};exports['getApplications']=function(_0x41f5e2,_0x435e01,_0xdcc679){var _0x31ffbf={};var _0x4c9c22={};var _0x1dae6e;var _0x24667d;return db[_0x14a6('0x40')][_0x14a6('0x66')]({'where':{'id':_0x41f5e2[_0x14a6('0x57')]['id']}})[_0x14a6('0x20')](handleEntityNotFound(_0x435e01,null))['then'](function(_0x16b907){if(_0x16b907){_0x1dae6e=_0x16b907;_0x4c9c22['model']=_[_0x14a6('0x45')](db['SmsApplication'][_0x14a6('0x41')]);_0x4c9c22[_0x14a6('0x44')]=_[_0x14a6('0x45')](_0x41f5e2['query']);_0x4c9c22['filters']=_[_0x14a6('0x47')](_0x4c9c22[_0x14a6('0x48')],_0x4c9c22[_0x14a6('0x44')]);_0x31ffbf['attributes']=_[_0x14a6('0x47')](_0x4c9c22['model'],qs[_0x14a6('0x4a')](_0x41f5e2['query'][_0x14a6('0x4a')]));_0x31ffbf['attributes']=_0x31ffbf['attributes'][_0x14a6('0x4b')]?_0x31ffbf[_0x14a6('0x49')]:_0x4c9c22[_0x14a6('0x48')];_0x31ffbf[_0x14a6('0x4e')]=qs[_0x14a6('0x4f')](_0x41f5e2[_0x14a6('0x44')][_0x14a6('0x4f')]);_0x31ffbf[_0x14a6('0x50')]=qs[_0x14a6('0x46')](_[_0x14a6('0x67')](_0x41f5e2[_0x14a6('0x44')],_0x4c9c22[_0x14a6('0x46')]));if(_0x41f5e2[_0x14a6('0x44')]['filter']){_0x31ffbf['where']=_['merge'](_0x31ffbf[_0x14a6('0x50')],{'$or':_[_0x14a6('0x3f')](_0x31ffbf[_0x14a6('0x49')],function(_0x3ddd62){var _0x384f61={};_0x384f61[_0x3ddd62]={'$like':'%'+_0x41f5e2[_0x14a6('0x44')]['filter']+'%'};return _0x384f61;})});}_0x31ffbf=_[_0x14a6('0x53')]({},_0x31ffbf,_0x41f5e2[_0x14a6('0x59')]);return _0x1dae6e[_0x14a6('0xb8')](_0x31ffbf);}})['then'](function(_0x46d5b7){if(_0x46d5b7){_0x24667d=_0x46d5b7[_0x14a6('0x4b')];if(!_0x41f5e2[_0x14a6('0x44')][_0x14a6('0x4c')]('nolimit')){_0x31ffbf[_0x14a6('0x30')]=qs[_0x14a6('0x30')](_0x41f5e2[_0x14a6('0x44')][_0x14a6('0x30')]);_0x31ffbf[_0x14a6('0x2d')]=qs[_0x14a6('0x2d')](_0x41f5e2[_0x14a6('0x44')][_0x14a6('0x2d')]);}return _0x1dae6e['getApplications'](_0x31ffbf);}})[_0x14a6('0x20')](function(_0x1d3ab9){if(_0x1d3ab9){return _0x1d3ab9?{'count':_0x24667d,'rows':_0x1d3ab9}:null;}})['then'](respondWithResult(_0x435e01,null))[_0x14a6('0x29')](handleError(_0x435e01,null));};exports[_0x14a6('0xb9')]=function(_0x3d71a1,_0x146cac,_0x379d45){var _0xefb902={'raw':![],'where':{}};var _0x18af5c={};var _0x13b9f3={'count':0x0,'rows':[]};return db[_0x14a6('0x40')][_0x14a6('0x66')]({'where':{'id':_0x3d71a1['params']['id']}})[_0x14a6('0x20')](handleEntityNotFound(_0x146cac,null))['then'](function(_0x4fc5ae){if(_0x4fc5ae){_0x18af5c[_0x14a6('0x48')]=_['keys'](db['SmsInteraction'][_0x14a6('0x41')]);_0x18af5c[_0x14a6('0x44')]=_[_0x14a6('0x45')](_0x3d71a1[_0x14a6('0x44')]);_0x18af5c[_0x14a6('0x46')]=_[_0x14a6('0x47')](_0x18af5c[_0x14a6('0x48')],_0x18af5c[_0x14a6('0x44')]);_0xefb902[_0x14a6('0x49')]=_[_0x14a6('0x47')](_0x18af5c[_0x14a6('0x48')],qs['fields'](_0x3d71a1[_0x14a6('0x44')]['fields']));_0xefb902['attributes']=_0xefb902['attributes'][_0x14a6('0x4b')]?_0xefb902[_0x14a6('0x49')]:_0x18af5c['model'];if(!_0x3d71a1['query'][_0x14a6('0x4c')](_0x14a6('0x4d'))){_0xefb902[_0x14a6('0x30')]=qs[_0x14a6('0x30')](_0x3d71a1[_0x14a6('0x44')][_0x14a6('0x30')]);_0xefb902[_0x14a6('0x2d')]=qs[_0x14a6('0x2d')](_0x3d71a1[_0x14a6('0x44')]['offset']);}_0xefb902[_0x14a6('0x4e')]=qs['sort'](_0x3d71a1[_0x14a6('0x44')]['sort']);_0xefb902[_0x14a6('0x50')]=qs[_0x14a6('0x46')](_[_0x14a6('0x67')](_0x3d71a1['query'],_0x18af5c[_0x14a6('0x46')]));_0xefb902[_0x14a6('0x50')][_0x14a6('0x6b')]=_0x4fc5ae['id'];if(_0x3d71a1[_0x14a6('0x44')][_0x14a6('0x51')]){_0xefb902[_0x14a6('0x50')]=_['merge'](_0xefb902[_0x14a6('0x50')],{'$or':_[_0x14a6('0x3f')](_0xefb902[_0x14a6('0x49')],function(_0x55c0ff){var _0x4375fa={};_0x4375fa[_0x55c0ff]={'$like':'%'+_0x3d71a1[_0x14a6('0x44')][_0x14a6('0x51')]+'%'};return _0x4375fa;})});}_0xefb902=_[_0x14a6('0x53')]({},_0xefb902,_0x3d71a1[_0x14a6('0x59')]);return db['SmsInteraction']['count']({'where':_0xefb902['where']})[_0x14a6('0x20')](function(_0x1dca7c){_0x13b9f3['count']=_0x1dca7c;if(_0x3d71a1[_0x14a6('0x44')][_0x14a6('0x54')]){_0xefb902['include']=[{'model':db[_0x14a6('0xa0')],'as':'Contact','required':![]},{'model':db[_0x14a6('0xba')],'as':_0x14a6('0xbb'),'attributes':[_0x14a6('0x3a'),_0x14a6('0xbc'),'internal'],'required':![]},{'model':db['Tag'],'as':_0x14a6('0xbd'),'attributes':['id',_0x14a6('0x3a'),'color'],'where':_0x3d71a1['query'][_0x14a6('0xbe')]?{'id':_0x3d71a1[_0x14a6('0x44')]['tag']}:undefined,'required':_0x3d71a1['query'][_0x14a6('0xbe')]?!![]:![]}];}return db[_0x14a6('0xa1')][_0x14a6('0x68')](_0xefb902);})[_0x14a6('0x20')](function(_0xa4faff){_0x13b9f3[_0x14a6('0x55')]=_0xa4faff;return _0x13b9f3;});}})[_0x14a6('0x20')](respondWithFilteredResult(_0x146cac,_0xefb902))['catch'](handleError(_0x146cac,null));};exports[_0x14a6('0x3b')]=function(_0x4f6816,_0x1b9f57,_0x2894ab){var _0x51ad0f,_0x501d0f,_0x16e672;if(_[_0x14a6('0x99')](_0x4f6816['body'][_0x14a6('0x61')])||_0x4f6816[_0x14a6('0x61')]['body']===''){throw new db['Sequelize'][(_0x14a6('0x7a'))](_0x14a6('0x98'));}if(_[_0x14a6('0x99')](_0x4f6816[_0x14a6('0x61')]['to'])){throw new db[(_0x14a6('0x79'))][(_0x14a6('0x7a'))](_0x14a6('0xbf'));}_0x51ad0f=_0x4f6816[_0x14a6('0x61')]['to'];return db['SmsAccount']['find']({'where':{'id':_0x4f6816[_0x14a6('0x57')]['id']},'include':[{'model':db[_0x14a6('0xc0')],'as':_0x14a6('0xc1'),'include':[{'model':db[_0x14a6('0xa0')],'as':'Contacts','where':{'mobile':_0x51ad0f},'limit':0x1,'order':[['updatedAt',_0x14a6('0xc2')]]}]}]})[_0x14a6('0x20')](handleEntityNotFound(_0x1b9f57,null))[_0x14a6('0x20')](function(_0xab377d){if(_0xab377d&&_0xab377d['List']){_0x501d0f=_0xab377d[_0x14a6('0x5b')]({'plain':!![]});if(_0x501d0f['List']&&_0x501d0f['List'][_0x14a6('0x9d')][_0x14a6('0x4b')]){return _0x501d0f[_0x14a6('0xc1')][_0x14a6('0x9d')][0x0];}return db[_0x14a6('0xa0')]['create'](_[_0x14a6('0x9f')](_0x4f6816['body'],{'firstName':_0x51ad0f,'mobile':_0x51ad0f,'phone':_0x51ad0f,'ListId':_0x501d0f[_0x14a6('0x80')]}));}})[_0x14a6('0x20')](handleEntityNotFound(_0x1b9f57,null))['then'](function(_0x3efd8b){if(_0x3efd8b){_0x16e672=_0x3efd8b;return db[_0x14a6('0xa1')][_0x14a6('0x5a')]({'where':{'ContactId':_0x16e672['id'],'closed':![],'SmsAccountId':_0x501d0f['id']}})[_0x14a6('0x20')](function(_0x49490b){if(_0x49490b){return[_0x49490b,![]];}return db['SmsInteraction']['create']({'UserId':_0x4f6816[_0x14a6('0xc3')]['id'],'ContactId':_0x16e672['id'],'SmsAccountId':_0x501d0f['id'],'phone':_0x51ad0f,'firstMsgDirection':'out','Messages':[_[_0x14a6('0x53')](_0x4f6816['body'],{'read':![],'body':_0x4f6816[_0x14a6('0x61')]['body'],'phone':_0x51ad0f,'SmsAccountId':_0x501d0f['id'],'UserId':_0x4f6816['user']['id'],'ContactId':_0x16e672['id']})]},{'include':[{'model':db[_0x14a6('0xc4')],'as':_0x14a6('0xc5')}]})[_0x14a6('0x20')](function(_0xf7aff3){return[_0xf7aff3,!![]];});});}})[_0x14a6('0xa2')](function(_0x7640c0,_0x150f08){if(_0x150f08){return _0x7640c0;}return db['SmsMessage'][_0x14a6('0x60')](_[_0x14a6('0x53')](_0x4f6816[_0x14a6('0x61')],{'read':![],'body':_0x4f6816[_0x14a6('0x61')][_0x14a6('0x61')],'phone':_0x51ad0f,'SmsAccountId':_0x501d0f['id'],'SmsInteractionId':_0x7640c0['id'],'UserId':_0x4f6816['user']['id'],'ContactId':_0x16e672['id']}))['then'](function(_0x477692){_0x7640c0['dataValues']['Messages']=[];_0x7640c0[_0x14a6('0xc6')]['Messages'][_0x14a6('0xc7')](_0x477692[_0x14a6('0xc6')]);return _0x7640c0;});})[_0x14a6('0x20')](respondWithResult(_0x1b9f57,null))['catch'](handleError(_0x1b9f57,null));};exports['status']=function(_0x13a49e,_0x2ae753,_0x54ccef){if(_0x13a49e[_0x14a6('0x61')]['id']){delete _0x13a49e[_0x14a6('0x61')]['id'];}var _0x36c02a,_0x11b280,_0x328a3f;return db[_0x14a6('0x40')][_0x14a6('0x5a')]({'where':{'id':_0x13a49e[_0x14a6('0x57')]['id']}})[_0x14a6('0x20')](handleEntityNotFound(_0x2ae753,null))['then'](function(_0xc3e671){if(_0xc3e671){_0x328a3f=_0xc3e671;logger[_0x14a6('0xc8')](_0x14a6('0x23'),_0x14a6('0x2b'),'received\x20delivery\x20report\x20from',_0xc3e671[_0x14a6('0x43')],util[_0x14a6('0xc9')](_0x13a49e[_0x14a6('0x61')],{'showHidden':![],'depth':null}));switch(_0xc3e671['type']){case'skebby':if(_0x13a49e[_0x14a6('0x61')][_0x14a6('0xca')]&&_0x13a49e[_0x14a6('0x61')]['status']){_0x11b280=_0x13a49e[_0x14a6('0x61')]['status'];return db[_0x14a6('0xc4')][_0x14a6('0x5a')]({'where':{'messageId':_0x13a49e['body'][_0x14a6('0xca')]}});}break;case _0x14a6('0xcb'):if(_0x13a49e[_0x14a6('0x61')][_0x14a6('0xcc')]&&_0x13a49e[_0x14a6('0x61')][_0x14a6('0xcd')]){_0x11b280=_0x13a49e[_0x14a6('0x61')]['statusInt'];return db[_0x14a6('0xc4')][_0x14a6('0x5a')]({'where':{'messageId':_0x13a49e[_0x14a6('0x61')]['requestid']}});}break;case _0x14a6('0xce'):if(_0x13a49e['body'][_0x14a6('0x8a')]&&_0x13a49e[_0x14a6('0x61')][_0x14a6('0xcf')]){_0x11b280=_0x13a49e[_0x14a6('0x61')][_0x14a6('0xcf')];return db[_0x14a6('0xc4')][_0x14a6('0x5a')]({'where':{'messageId':_0x13a49e[_0x14a6('0x61')][_0x14a6('0x8a')]}});}break;case _0x14a6('0x8e'):var _0x2bc7ac=_0x13a49e[_0x14a6('0x61')][_0x14a6('0x8f')][0x0];if(_0x2bc7ac['messageId']&&_0x2bc7ac[_0x14a6('0x2b')][_0x14a6('0xd0')]===_0x14a6('0xd1')){_0x11b280=_0x2bc7ac[_0x14a6('0x2b')][_0x14a6('0xd0')];return db['SmsMessage'][_0x14a6('0x5a')]({'where':{'messageId':_0x2bc7ac[_0x14a6('0x86')]}});}break;case _0x14a6('0x93'):if(_0x13a49e[_0x14a6('0x61')][_0x14a6('0x86')]&&_0x13a49e[_0x14a6('0x61')][_0x14a6('0x2b')]){_0x11b280=_0x13a49e[_0x14a6('0x61')]['status'];return db[_0x14a6('0xc4')][_0x14a6('0x5a')]({'where':{'messageId':_0x13a49e[_0x14a6('0x61')]['messageId']}});}break;case _0x14a6('0x95'):if(_0x13a49e[_0x14a6('0x61')][0x0][_0x14a6('0x27')]['id']){_0x11b280=_0x13a49e[_0x14a6('0x61')][0x0][_0x14a6('0x43')];return db[_0x14a6('0xc4')][_0x14a6('0x5a')]({'where':{'messageId':_0x13a49e[_0x14a6('0x61')][0x0][_0x14a6('0x27')]['id']}});}break;case _0x14a6('0x96'):if(_0x13a49e[_0x14a6('0x61')]['redif']&&_0x13a49e[_0x14a6('0x61')][_0x14a6('0x2b')]){_0x11b280=_0x13a49e[_0x14a6('0x61')][_0x14a6('0x2b')];return db['SmsMessage']['find']({'where':{'messageId':_0x13a49e[_0x14a6('0x61')][_0x14a6('0xd2')]}});}break;}}})['then'](handleEntityNotFound(_0x2ae753,null))[_0x14a6('0x20')](function(_0x47b26a){if(_0x47b26a){_0x36c02a=_0x47b26a;switch(_0x328a3f[_0x14a6('0x43')]){case'skebby':if(_0x11b280===_0x14a6('0xd1')){return _0x36c02a[_0x14a6('0x36')]({'read':!![]});}else{logger[_0x14a6('0x25')](_0x14a6('0x23'),'status',_0x14a6('0xd3'),util[_0x14a6('0xc9')](_0x13a49e[_0x14a6('0x61')],{'showHidden':![],'depth':null}));}break;case'connectel':if(_0x11b280==='1'){return _0x36c02a[_0x14a6('0x36')]({'read':!![]});}else{logger[_0x14a6('0x25')](_0x14a6('0x23'),_0x14a6('0x2b'),_0x14a6('0xd3'),util['inspect'](_0x13a49e['body'],{'showHidden':![],'depth':null}));}break;case _0x14a6('0xce'):if(!_0x13a49e[_0x14a6('0x61')][_0x14a6('0xd4')]&&_0x11b280>=0xc8&&_0x11b280<=0xce){return _0x36c02a[_0x14a6('0x36')]({'read':!![]});}else{logger['error'](_0x14a6('0x23'),_0x14a6('0x2b'),_0x14a6('0xce'),util[_0x14a6('0xc9')](_0x13a49e[_0x14a6('0x61')],{'showHidden':![],'depth':null}));}break;case _0x14a6('0x8e'):var _0x1020d2=_0x13a49e[_0x14a6('0x61')][_0x14a6('0x8f')][0x0];if(_0x1020d2[_0x14a6('0x2b')]['groupName']==='DELIVERED'){return _0x36c02a[_0x14a6('0x36')]({'read':!![]});}else{logger[_0x14a6('0x25')](_0x14a6('0x23'),_0x14a6('0x2b'),'infobip',util['inspect'](_0x13a49e[_0x14a6('0x61')],{'showHidden':![],'depth':null}));}break;case _0x14a6('0x93'):if(_0x11b280==_0x14a6('0xd5')||_0x11b280==_0x14a6('0xd6')){return _0x36c02a['update']({'read':!![]});}else{logger[_0x14a6('0x25')]('SmsAccount,\x20%s,\x20%s,\x20%s','status',_0x14a6('0x93'),util[_0x14a6('0xc9')](_0x13a49e['body'],{'showHidden':![],'depth':null}));}break;case'bandwidth':if(_0x11b280==_0x14a6('0xd7')){return _0x36c02a[_0x14a6('0x36')]({'read':!![]});}else{logger[_0x14a6('0x25')](_0x14a6('0x23'),_0x14a6('0x2b'),_0x14a6('0x95'),util['inspect'](_0x13a49e[_0x14a6('0x61')],{'showHidden':![],'depth':null}));}break;case'intelepeer':if(_0x11b280===_0x14a6('0xd8')||_0x11b280===_0x14a6('0xd9')){return _0x36c02a[_0x14a6('0x36')]({'read':!![]});}else{logger[_0x14a6('0x25')](_0x14a6('0x23'),_0x14a6('0x2b'),'intelepeer',util['inspect'](_0x13a49e[_0x14a6('0x61')],{'showHidden':![],'depth':null}));}break;}return _0x36c02a;}})[_0x14a6('0x20')](respondWithResult(_0x2ae753,null))[_0x14a6('0x29')](handleError(_0x2ae753,null));};exports[_0x14a6('0xda')]=function(_0x3ea5d0,_0x4185f0,_0x10c3af){var _0x173a1c,_0x4b687e,_0x4ac17a;return db['SmsAccount'][_0x14a6('0x5a')]({'where':{'id':_0x3ea5d0[_0x14a6('0x57')]['id']}})['then'](handleEntityNotFound(_0x4185f0,null))[_0x14a6('0x20')](function(_0x55b2cf){if(_0x55b2cf){_0x4ac17a=_0x55b2cf;logger[_0x14a6('0xc8')](_0x14a6('0x23'),_0x14a6('0x2b'),_0x14a6('0xdb'),_0x55b2cf[_0x14a6('0x43')],util[_0x14a6('0xc9')](_0x3ea5d0[_0x14a6('0x44')],{'showHidden':![],'depth':null}));switch(_0x55b2cf[_0x14a6('0x43')]){case'csc':if(_0x3ea5d0[_0x14a6('0x44')][_0x14a6('0xdc')]&&_0x3ea5d0[_0x14a6('0x44')]['state']){_0x4b687e=_0x3ea5d0[_0x14a6('0x44')][_0x14a6('0xdd')];return db[_0x14a6('0xc4')][_0x14a6('0x5a')]({'where':{'messageId':_0x3ea5d0['query'][_0x14a6('0xdc')]}});}break;}}})[_0x14a6('0x20')](handleEntityNotFound(_0x4185f0,null))['then'](function(_0xebdd49){if(_0xebdd49){_0x173a1c=_0xebdd49;switch(_0x4ac17a['type']){case _0x14a6('0x90'):if(_0x4b687e==='2'||_0x4b687e==='6'){return _0x173a1c['update']({'read':!![]});}else{logger[_0x14a6('0x25')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x14a6('0x2b'),_0x14a6('0x90'),util['inspect'](_0x3ea5d0[_0x14a6('0x44')],{'showHidden':![],'depth':null}));};break;}return _0x173a1c;}})[_0x14a6('0x20')](respondWithResult(_0x4185f0,null))[_0x14a6('0x29')](handleError(_0x4185f0,null));};exports[_0x14a6('0xde')]=function(_0x3f5244,_0x56f39e,_0x57c923){return db[_0x14a6('0x40')][_0x14a6('0x5a')]({'where':{'id':_0x3f5244[_0x14a6('0x57')]['id']}})[_0x14a6('0x20')](handleEntityNotFound(_0x56f39e,null))[_0x14a6('0x20')](function(_0x5a5ff4){if(_0x5a5ff4){return _0x5a5ff4[_0x14a6('0xde')](_0x3f5244[_0x14a6('0x61')]['ids'],_[_0x14a6('0x9e')](_0x3f5244['body'],[_0x14a6('0x6f'),'id'])||{})[_0x14a6('0xa2')](function(_0x51b789){for(var _0x487ac3=0x0;_0x487ac3<_0x3f5244[_0x14a6('0x61')][_0x14a6('0x6f')][_0x14a6('0x4b')];_0x487ac3+=0x1){socket[_0x14a6('0xdf')]('userSmsAccount:save',{'UserId':Number(_0x3f5244[_0x14a6('0x61')][_0x14a6('0x6f')][_0x487ac3]),'SmsAccountId':Number(_0x3f5244[_0x14a6('0x57')]['id'])});}return _0x51b789;});}})[_0x14a6('0x20')](respondWithResult(_0x56f39e,null))[_0x14a6('0x29')](handleError(_0x56f39e,null));};exports[_0x14a6('0xe0')]=function(_0x11e354,_0x55c908,_0x3ddfc6){return db[_0x14a6('0x40')][_0x14a6('0x5a')]({'where':{'id':_0x11e354[_0x14a6('0x57')]['id']}})['then'](handleEntityNotFound(_0x55c908,null))[_0x14a6('0x20')](function(_0x953c8c){if(_0x953c8c){return _0x953c8c[_0x14a6('0xe0')](_0x11e354[_0x14a6('0x44')][_0x14a6('0x6f')])[_0x14a6('0x20')](function(){if(_[_0x14a6('0xe1')](_0x11e354['query']['ids'])){for(var _0xb2fac1=0x0;_0xb2fac1<_0x11e354[_0x14a6('0x44')]['ids'][_0x14a6('0x4b')];_0xb2fac1+=0x1){socket[_0x14a6('0xdf')](_0x14a6('0xe2'),{'UserId':Number(_0x11e354[_0x14a6('0x44')]['ids'][_0xb2fac1]),'SmsAccountId':Number(_0x11e354['params']['id'])});}}else{socket[_0x14a6('0xdf')](_0x14a6('0xe2'),{'UserId':Number(_0x11e354[_0x14a6('0x44')]['ids']),'SmsAccountId':Number(_0x11e354[_0x14a6('0x57')]['id'])});}});}})['then'](respondWithStatusCode(_0x55c908,null))['catch'](handleError(_0x55c908,null));};exports[_0x14a6('0xe3')]=function(_0xbfeaa5,_0x349f22,_0x75b878){var _0x554f44={};var _0x2b47ed={};var _0x3d013b;var _0x532763;return db['SmsAccount']['findOne']({'where':{'id':_0xbfeaa5[_0x14a6('0x57')]['id']}})[_0x14a6('0x20')](handleEntityNotFound(_0x349f22,null))[_0x14a6('0x20')](function(_0x41553c){if(_0x41553c){_0x3d013b=_0x41553c;_0x2b47ed[_0x14a6('0x48')]=_['keys'](db[_0x14a6('0xba')][_0x14a6('0x41')]);_0x2b47ed['query']=_[_0x14a6('0x45')](_0xbfeaa5[_0x14a6('0x44')]);_0x2b47ed[_0x14a6('0x46')]=_[_0x14a6('0x47')](_0x2b47ed[_0x14a6('0x48')],_0x2b47ed[_0x14a6('0x44')]);_0x554f44[_0x14a6('0x49')]=_[_0x14a6('0x47')](_0x2b47ed[_0x14a6('0x48')],qs['fields'](_0xbfeaa5[_0x14a6('0x44')][_0x14a6('0x4a')]));_0x554f44[_0x14a6('0x49')]=_0x554f44[_0x14a6('0x49')][_0x14a6('0x4b')]?_0x554f44[_0x14a6('0x49')]:_0x2b47ed['model'];_0x554f44['order']=qs[_0x14a6('0x4f')](_0xbfeaa5[_0x14a6('0x44')][_0x14a6('0x4f')]);_0x554f44['where']=qs[_0x14a6('0x46')](_[_0x14a6('0x67')](_0xbfeaa5[_0x14a6('0x44')],_0x2b47ed['filters']));if(_0xbfeaa5[_0x14a6('0x44')][_0x14a6('0x51')]){_0x554f44[_0x14a6('0x50')]=_['merge'](_0x554f44[_0x14a6('0x50')],{'$or':_[_0x14a6('0x3f')](_0x554f44[_0x14a6('0x49')],function(_0x33e243){var _0x379f38={};_0x379f38[_0x33e243]={'$like':'%'+_0xbfeaa5[_0x14a6('0x44')][_0x14a6('0x51')]+'%'};return _0x379f38;})});}_0x554f44=_[_0x14a6('0x53')]({},_0x554f44,_0xbfeaa5[_0x14a6('0x59')]);return _0x3d013b[_0x14a6('0xe3')](_0x554f44);}})[_0x14a6('0x20')](function(_0x551189){if(_0x551189){_0x532763=_0x551189[_0x14a6('0x4b')];if(!_0xbfeaa5[_0x14a6('0x44')][_0x14a6('0x4c')](_0x14a6('0x4d'))){_0x554f44[_0x14a6('0x30')]=qs[_0x14a6('0x30')](_0xbfeaa5['query']['limit']);_0x554f44[_0x14a6('0x2d')]=qs['offset'](_0xbfeaa5[_0x14a6('0x44')]['offset']);}return _0x3d013b[_0x14a6('0xe3')](_0x554f44);}})[_0x14a6('0x20')](function(_0x2c1010){if(_0x2c1010){return _0x2c1010?{'count':_0x532763,'rows':_0x2c1010}:null;}})[_0x14a6('0x20')](respondWithResult(_0x349f22,null))[_0x14a6('0x29')](handleError(_0x349f22,null));}; \ No newline at end of file +var _0xd624=['removeAnswers','notify','sms','SmsApplication','Applications','account','applications','orderBy','priority','asc','CmContact','Sequelize','difference','updatedAt','CompanyId','mobile','twilio','from','Body','skebby','sender','text','connectel','clicksend','messageId','plivo','Text','MessageUUID','results','csc','originatingAddress','fromNumber','bandwidth','intelepeer','refid','isNil','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','CmList','ListId','Contacts','DESC','defaults','contact','SmsInteraction','spread','interaction','autoclose','push','close','unmanaged','SmsMessage','ContactId','UserId','agent','waitForTheAssignedAgent','*,*,*,*','Start','startRouting','receiveMessage','entity\x20found','SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s','Content-Type','text/xml','\x0a','addApplications','sequelize','transaction','findAndCountAll','getApplications','getInteractions','User','Owner','color','tag','to\x20is\x20mandatory','List','Messages','dataValues','received\x20delivery\x20report\x20from','inspect','skebby_dispatch_id','statusInt','requestid','message_id','status_code','infobip','groupName','DELIVERED','clickatell','redif','error_code','DELIVERED_TO_GATEWAY','RECEIVED_BY_RECIPIENT','message-delivered','DELIVRD','statusGet','message-id','state','addAgents','emit','userSmsAccount:save','removeAgents','isArray','userSmsAccount:remove','getAgents','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','socket.io-emitter','./smsAccount.socket','register','client','http','request','info','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','get','SmsAccounts','UserProfileResource','stack','name','send','mandatoryDispositionPause','map','rawAttributes','fieldName','type','key','query','keys','filters','attributes','intersection','model','fields','hasOwnProperty','order','sort','pick','merge','where','VIRTUAL','filter','options','SmsAccount','includeAll','include','findAll','show','params','Pause','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','findOne','length','nolimit','SmsAccountId','removeDispositions','ids','addAnswer','CannedAnswer','rows'];(function(_0x3e8450,_0x3d95a1){var _0x40a872=function(_0x12993e){while(--_0x12993e){_0x3e8450['push'](_0x3e8450['shift']());}};_0x40a872(++_0x3d95a1);}(_0xd624,0x6e));var _0x4d62=function(_0x449d98,_0x51d49b){_0x449d98=_0x449d98-0x0;var _0xe2d046=_0xd624[_0x449d98];return _0xe2d046;};'use strict';var emlformat=require(_0x4d62('0x0'));var rimraf=require(_0x4d62('0x1'));var zipdir=require(_0x4d62('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4d62('0x3'));var moment=require(_0x4d62('0x4'));var BPromise=require(_0x4d62('0x5'));var Mustache=require('mustache');var util=require(_0x4d62('0x6'));var path=require(_0x4d62('0x7'));var sox=require(_0x4d62('0x8'));var csv=require(_0x4d62('0x9'));var ejs=require(_0x4d62('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4d62('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x4d62('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x4d62('0x9'));var querystring=require(_0x4d62('0xd'));var Papa=require(_0x4d62('0xe'));var Redis=require(_0x4d62('0xf'));var authService=require(_0x4d62('0x10'));var qs=require(_0x4d62('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4d62('0x12'));var logger=require(_0x4d62('0x13'))(_0x4d62('0x14'));var utils=require(_0x4d62('0x15'));var config=require(_0x4d62('0x16'));var licenseUtil=require(_0x4d62('0x17'));var db=require(_0x4d62('0x18'))['db'];config[_0x4d62('0x19')]=_['defaults'](config[_0x4d62('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0x4d62('0x1a'))(new Redis(config[_0x4d62('0x19')]));require(_0x4d62('0x1b'))[_0x4d62('0x1c')](socket);var jayson=require('jayson/promise');var client=jayson[_0x4d62('0x1d')][_0x4d62('0x1e')]({'port':0x232c});function respondWithRpcPromise(_0x52382b,_0xc7ef89,_0x22e890,_0x814023){return new BPromise(function(_0x11ae07,_0x1c5d2f){var _0x424bd4=_0x814023||client;return _0x424bd4[_0x4d62('0x1f')](_0x52382b,_0x22e890)['then'](function(_0x67b43b){logger[_0x4d62('0x20')](_0x4d62('0x21'),_0xc7ef89,_0x4d62('0x22'));logger[_0x4d62('0x23')](_0x4d62('0x24'),_0xc7ef89,_0x4d62('0x22'),JSON[_0x4d62('0x25')](_0x67b43b));if(_0x67b43b['error']){if(_0x67b43b[_0x4d62('0x26')][_0x4d62('0x27')]===0x1f4){logger['error'](_0x4d62('0x21'),_0xc7ef89,_0x67b43b[_0x4d62('0x26')]['message']);return _0x1c5d2f(_0x67b43b['error']['message']);}logger[_0x4d62('0x26')](_0x4d62('0x21'),_0xc7ef89,_0x67b43b[_0x4d62('0x26')][_0x4d62('0x28')]);return _0x11ae07(_0x67b43b[_0x4d62('0x26')][_0x4d62('0x28')]);}else{logger['info'](_0x4d62('0x21'),_0xc7ef89,_0x4d62('0x22'));_0x11ae07(_0x67b43b[_0x4d62('0x29')][_0x4d62('0x28')]);}})[_0x4d62('0x2a')](function(_0x1a0108){logger['error'](_0x4d62('0x21'),_0xc7ef89,_0x1a0108);_0x1c5d2f(_0x1a0108);});});}function respondWithStatusCode(_0x18f778,_0x59aa17){_0x59aa17=_0x59aa17||0xcc;return function(_0x10dda5){if(_0x10dda5){return _0x18f778[_0x4d62('0x2b')](_0x59aa17);}return _0x18f778[_0x4d62('0x2c')](_0x59aa17)[_0x4d62('0x2d')]();};}function respondWithResult(_0x4c33af,_0x4c6735){_0x4c6735=_0x4c6735||0xc8;return function(_0x4bed4f){if(_0x4bed4f){return _0x4c33af[_0x4d62('0x2c')](_0x4c6735)[_0x4d62('0x2e')](_0x4bed4f);}};}function respondWithFilteredResult(_0x4d7303,_0x6da5d8){return function(_0x238d57){if(_0x238d57){var _0x3eb514=typeof _0x6da5d8[_0x4d62('0x2f')]===_0x4d62('0x30')&&typeof _0x6da5d8[_0x4d62('0x31')]==='undefined';var _0xbb4a13=_0x238d57[_0x4d62('0x32')];var _0x496bd0=_0x3eb514?0x0:_0x6da5d8[_0x4d62('0x2f')];var _0x4725af=_0x3eb514?_0x238d57['count']:_0x6da5d8[_0x4d62('0x2f')]+_0x6da5d8[_0x4d62('0x31')];var _0x2f9263;if(_0x4725af>=_0xbb4a13){_0x4725af=_0xbb4a13;_0x2f9263=0xc8;}else{_0x2f9263=0xce;}_0x4d7303[_0x4d62('0x2c')](_0x2f9263);return _0x4d7303[_0x4d62('0x33')](_0x4d62('0x34'),_0x496bd0+'-'+_0x4725af+'/'+_0xbb4a13)[_0x4d62('0x2e')](_0x238d57);}return null;};}function patchUpdates(_0x52ea4c){return function(_0x583c06){try{jsonpatch[_0x4d62('0x35')](_0x583c06,_0x52ea4c,!![]);}catch(_0x1e0a5a){return BPromise[_0x4d62('0x36')](_0x1e0a5a);}return _0x583c06[_0x4d62('0x37')]();};}function saveUpdates(_0x5e1a8f,_0x5470aa){return function(_0x4e3bfd){if(_0x4e3bfd){return _0x4e3bfd[_0x4d62('0x38')](_0x5e1a8f)[_0x4d62('0x39')](function(_0x1c6812){return _0x1c6812;});}return null;};}function removeEntity(_0x3fb555,_0x48f65a){return function(_0xc415cf){if(_0xc415cf){return _0xc415cf[_0x4d62('0x3a')]()[_0x4d62('0x39')](function(){var _0x95c2b6=_0xc415cf[_0x4d62('0x3b')]({'plain':!![]});var _0x154bac=_0x4d62('0x3c');return db[_0x4d62('0x3d')][_0x4d62('0x3a')]({'where':{'type':_0x154bac,'resourceId':_0x95c2b6['id']}})[_0x4d62('0x39')](function(){return _0xc415cf;});})[_0x4d62('0x39')](function(){_0x3fb555[_0x4d62('0x2c')](0xcc)[_0x4d62('0x2d')]();});}};}function handleEntityNotFound(_0x2c5431,_0x5b1c84){return function(_0x2d0942){if(!_0x2d0942){_0x2c5431[_0x4d62('0x2b')](0x194);}return _0x2d0942;};}function handleError(_0x16bf4d,_0x553dd7){_0x553dd7=_0x553dd7||0x1f4;return function(_0x12e219){logger['error'](_0x12e219[_0x4d62('0x3e')]);if(_0x12e219[_0x4d62('0x3f')]){delete _0x12e219[_0x4d62('0x3f')];}_0x16bf4d[_0x4d62('0x2c')](_0x553dd7)[_0x4d62('0x40')](_0x12e219);};}exports['index']=function(_0x428e0b,_0x4a6dd7){var _0x29bf1b={'include':[{'model':db['Pause'],'as':_0x4d62('0x41')}]},_0x57596f={},_0x32224f={'count':0x0,'rows':[]};var _0xc928ad=_[_0x4d62('0x42')](db['SmsAccount'][_0x4d62('0x43')],function(_0x229190){return{'name':_0x229190[_0x4d62('0x44')],'type':_0x229190[_0x4d62('0x45')][_0x4d62('0x46')]};});_0x57596f['model']=_[_0x4d62('0x42')](_0xc928ad,_0x4d62('0x3f'));_0x57596f[_0x4d62('0x47')]=_[_0x4d62('0x48')](_0x428e0b[_0x4d62('0x47')]);_0x57596f[_0x4d62('0x49')]=_['intersection'](_0x57596f['model'],_0x57596f[_0x4d62('0x47')]);_0x29bf1b[_0x4d62('0x4a')]=_[_0x4d62('0x4b')](_0x57596f[_0x4d62('0x4c')],qs[_0x4d62('0x4d')](_0x428e0b['query']['fields']));_0x29bf1b[_0x4d62('0x4a')]=_0x29bf1b['attributes']['length']?_0x29bf1b['attributes']:_0x57596f['model'];if(!_0x428e0b[_0x4d62('0x47')][_0x4d62('0x4e')]('nolimit')){_0x29bf1b[_0x4d62('0x31')]=qs['limit'](_0x428e0b[_0x4d62('0x47')]['limit']);_0x29bf1b[_0x4d62('0x2f')]=qs[_0x4d62('0x2f')](_0x428e0b[_0x4d62('0x47')][_0x4d62('0x2f')]);}_0x29bf1b[_0x4d62('0x4f')]=qs[_0x4d62('0x50')](_0x428e0b[_0x4d62('0x47')][_0x4d62('0x50')]);_0x29bf1b['where']=qs[_0x4d62('0x49')](_[_0x4d62('0x51')](_0x428e0b[_0x4d62('0x47')],_0x57596f[_0x4d62('0x49')]),_0xc928ad);if(_0x428e0b[_0x4d62('0x47')]['filter']){_0x29bf1b['where']=_[_0x4d62('0x52')](_0x29bf1b[_0x4d62('0x53')],{'$or':_[_0x4d62('0x42')](_0xc928ad,function(_0x42dd7a){if(_0x42dd7a[_0x4d62('0x45')]!==_0x4d62('0x54')){var _0x31e824={};_0x31e824[_0x42dd7a[_0x4d62('0x3f')]]={'$like':'%'+_0x428e0b[_0x4d62('0x47')][_0x4d62('0x55')]+'%'};return _0x31e824;}})});}_0x29bf1b=_[_0x4d62('0x52')]({},_0x29bf1b,_0x428e0b[_0x4d62('0x56')]);var _0x18ee0b={'where':_0x29bf1b[_0x4d62('0x53')]};return db[_0x4d62('0x57')][_0x4d62('0x32')](_0x18ee0b)['then'](function(_0x3eec29){_0x32224f['count']=_0x3eec29;if(_0x428e0b[_0x4d62('0x47')][_0x4d62('0x58')]){_0x29bf1b[_0x4d62('0x59')]=[{'all':!![]}];}return db['SmsAccount'][_0x4d62('0x5a')](_0x29bf1b);})[_0x4d62('0x39')](function(_0x3359eb){_0x32224f['rows']=_0x3359eb;return _0x32224f;})[_0x4d62('0x39')](respondWithFilteredResult(_0x4a6dd7,_0x29bf1b))[_0x4d62('0x2a')](handleError(_0x4a6dd7,null));};exports[_0x4d62('0x5b')]=function(_0x352bed,_0x21cfcc){var _0xf14d19={'raw':![],'where':{'id':_0x352bed[_0x4d62('0x5c')]['id']},'include':[{'model':db[_0x4d62('0x5d')],'as':_0x4d62('0x41')}]},_0x1f0e71={};_0x1f0e71['model']=_[_0x4d62('0x48')](db[_0x4d62('0x57')][_0x4d62('0x43')]);_0x1f0e71['query']=_[_0x4d62('0x48')](_0x352bed[_0x4d62('0x47')]);_0x1f0e71[_0x4d62('0x49')]=_[_0x4d62('0x4b')](_0x1f0e71[_0x4d62('0x4c')],_0x1f0e71['query']);_0xf14d19[_0x4d62('0x4a')]=_[_0x4d62('0x4b')](_0x1f0e71[_0x4d62('0x4c')],qs[_0x4d62('0x4d')](_0x352bed[_0x4d62('0x47')][_0x4d62('0x4d')]));_0xf14d19['attributes']=_0xf14d19[_0x4d62('0x4a')]['length']?_0xf14d19[_0x4d62('0x4a')]:_0x1f0e71[_0x4d62('0x4c')];if(_0x352bed[_0x4d62('0x47')][_0x4d62('0x58')]){_0xf14d19['include']=[{'all':!![]}];}_0xf14d19=_['merge']({},_0xf14d19,_0x352bed['options']);return db[_0x4d62('0x57')][_0x4d62('0x5e')](_0xf14d19)[_0x4d62('0x39')](handleEntityNotFound(_0x21cfcc,null))[_0x4d62('0x39')](respondWithResult(_0x21cfcc,null))[_0x4d62('0x2a')](handleError(_0x21cfcc,null));};exports[_0x4d62('0x5f')]=function(_0x5e4644,_0x302120){return db[_0x4d62('0x57')][_0x4d62('0x5f')](_0x5e4644[_0x4d62('0x60')],{})['then'](function(_0x299671){var _0x58012c=_0x5e4644[_0x4d62('0x61')][_0x4d62('0x3b')]({'plain':!![]});if(!_0x58012c)throw new Error(_0x4d62('0x62'));if(_0x58012c[_0x4d62('0x63')]===_0x4d62('0x61')){var _0x2a16d6=_0x299671[_0x4d62('0x3b')]({'plain':!![]});var _0x45f92d=_0x4d62('0x3c');return db[_0x4d62('0x64')][_0x4d62('0x5e')]({'where':{'name':_0x45f92d,'userProfileId':_0x58012c[_0x4d62('0x65')]},'raw':!![]})[_0x4d62('0x39')](function(_0x47f66d){if(_0x47f66d&&_0x47f66d[_0x4d62('0x66')]===0x0){return db[_0x4d62('0x3d')][_0x4d62('0x5f')]({'name':_0x2a16d6[_0x4d62('0x3f')],'resourceId':_0x2a16d6['id'],'type':_0x47f66d[_0x4d62('0x3f')],'sectionId':_0x47f66d['id']},{})['then'](function(){return _0x299671;});}else{return _0x299671;}})[_0x4d62('0x2a')](function(_0x25ab5a){logger[_0x4d62('0x26')](_0x4d62('0x67'),_0x25ab5a);throw _0x25ab5a;});}return _0x299671;})[_0x4d62('0x39')](respondWithResult(_0x302120,0xc9))[_0x4d62('0x2a')](handleError(_0x302120,null));};exports['update']=function(_0x17fdca,_0x272690){if(_0x17fdca[_0x4d62('0x60')]['id']){delete _0x17fdca[_0x4d62('0x60')]['id'];}return db[_0x4d62('0x57')][_0x4d62('0x5e')]({'where':{'id':_0x17fdca[_0x4d62('0x5c')]['id']},'include':[{'model':db[_0x4d62('0x5d')],'as':_0x4d62('0x41')}]})['then'](handleEntityNotFound(_0x272690,null))[_0x4d62('0x39')](saveUpdates(_0x17fdca[_0x4d62('0x60')],null))[_0x4d62('0x39')](respondWithResult(_0x272690,null))[_0x4d62('0x2a')](handleError(_0x272690,null));};exports[_0x4d62('0x3a')]=function(_0x267292,_0x51b36d){return db[_0x4d62('0x57')][_0x4d62('0x5e')]({'where':{'id':_0x267292[_0x4d62('0x5c')]['id']}})[_0x4d62('0x39')](handleEntityNotFound(_0x51b36d,null))[_0x4d62('0x39')](removeEntity(_0x51b36d,null))['catch'](handleError(_0x51b36d,null));};exports[_0x4d62('0x68')]=function(_0x59bc0c,_0x2dff05){return db[_0x4d62('0x57')][_0x4d62('0x68')]()[_0x4d62('0x39')](respondWithResult(_0x2dff05,null))['catch'](handleError(_0x2dff05,null));};exports['addDisposition']=function(_0x1e7557,_0x2e6cb2,_0x1be265){if(_0x1e7557[_0x4d62('0x60')]['id']){delete _0x1e7557[_0x4d62('0x60')]['id'];}return db[_0x4d62('0x57')][_0x4d62('0x5e')]({'where':{'id':_0x1e7557['params']['id']}})[_0x4d62('0x39')](handleEntityNotFound(_0x2e6cb2,null))[_0x4d62('0x39')](function(_0xdc9c99){if(_0xdc9c99){_0x1e7557[_0x4d62('0x60')]['SmsAccountId']=_0xdc9c99['id'];return db[_0x4d62('0x69')]['create'](_0x1e7557['body']);}})[_0x4d62('0x39')](respondWithResult(_0x2e6cb2,null))[_0x4d62('0x2a')](handleError(_0x2e6cb2,null));};exports['getDispositions']=function(_0x3c578b,_0x1c5db1,_0x19a706){var _0x1cb401={'raw':![],'where':{}};var _0x1c6481={};var _0xd6dee5={'count':0x0,'rows':[]};return db[_0x4d62('0x57')][_0x4d62('0x6a')]({'where':{'id':_0x3c578b[_0x4d62('0x5c')]['id']}})['then'](handleEntityNotFound(_0x1c5db1,null))[_0x4d62('0x39')](function(_0x193084){if(_0x193084){_0x1c6481['model']=_[_0x4d62('0x48')](db[_0x4d62('0x69')][_0x4d62('0x43')]);_0x1c6481[_0x4d62('0x47')]=_['keys'](_0x3c578b['query']);_0x1c6481[_0x4d62('0x49')]=_[_0x4d62('0x4b')](_0x1c6481[_0x4d62('0x4c')],_0x1c6481[_0x4d62('0x47')]);_0x1cb401[_0x4d62('0x4a')]=_[_0x4d62('0x4b')](_0x1c6481[_0x4d62('0x4c')],qs[_0x4d62('0x4d')](_0x3c578b[_0x4d62('0x47')][_0x4d62('0x4d')]));_0x1cb401[_0x4d62('0x4a')]=_0x1cb401[_0x4d62('0x4a')][_0x4d62('0x6b')]?_0x1cb401[_0x4d62('0x4a')]:_0x1c6481[_0x4d62('0x4c')];if(!_0x3c578b['query'][_0x4d62('0x4e')](_0x4d62('0x6c'))){_0x1cb401['limit']=qs[_0x4d62('0x31')](_0x3c578b[_0x4d62('0x47')][_0x4d62('0x31')]);_0x1cb401[_0x4d62('0x2f')]=qs['offset'](_0x3c578b[_0x4d62('0x47')][_0x4d62('0x2f')]);}_0x1cb401[_0x4d62('0x4f')]=qs[_0x4d62('0x50')](_0x3c578b['query'][_0x4d62('0x50')]);_0x1cb401['where']=qs['filters'](_[_0x4d62('0x51')](_0x3c578b[_0x4d62('0x47')],_0x1c6481['filters']));_0x1cb401[_0x4d62('0x53')][_0x4d62('0x6d')]=_0x193084['id'];if(_0x3c578b[_0x4d62('0x47')][_0x4d62('0x55')]){_0x1cb401['where']=_[_0x4d62('0x52')](_0x1cb401[_0x4d62('0x53')],{'$or':_[_0x4d62('0x42')](_0x1cb401['attributes'],function(_0x52efe6){var _0x54fa3a={};_0x54fa3a[_0x52efe6]={'$like':'%'+_0x3c578b[_0x4d62('0x47')][_0x4d62('0x55')]+'%'};return _0x54fa3a;})});}_0x1cb401=_[_0x4d62('0x52')]({},_0x1cb401,_0x3c578b[_0x4d62('0x56')]);return db['Disposition'][_0x4d62('0x32')]({'where':_0x1cb401['where']})[_0x4d62('0x39')](function(_0x1ad7e9){_0xd6dee5['count']=_0x1ad7e9;if(_0x3c578b[_0x4d62('0x47')][_0x4d62('0x58')]){_0x1cb401[_0x4d62('0x59')]=[{'all':!![]}];}return db['Disposition']['findAll'](_0x1cb401);})['then'](function(_0x3dd392){_0xd6dee5['rows']=_0x3dd392;return _0xd6dee5;});}})['then'](respondWithFilteredResult(_0x1c5db1,_0x1cb401))[_0x4d62('0x2a')](handleError(_0x1c5db1,null));};exports[_0x4d62('0x6e')]=function(_0x4e0b49,_0x58fe0c,_0x416ff5){return db[_0x4d62('0x57')]['find']({'where':{'id':_0x4e0b49[_0x4d62('0x5c')]['id']}})['then'](handleEntityNotFound(_0x58fe0c,null))[_0x4d62('0x39')](function(_0x27f6c3){if(_0x27f6c3){return _0x27f6c3[_0x4d62('0x6e')](_0x4e0b49[_0x4d62('0x47')][_0x4d62('0x6f')]);}})[_0x4d62('0x39')](respondWithStatusCode(_0x58fe0c,null))[_0x4d62('0x2a')](handleError(_0x58fe0c,null));};exports[_0x4d62('0x70')]=function(_0x1e96e8,_0x470671,_0x570d80){if(_0x1e96e8['body']['id']){delete _0x1e96e8[_0x4d62('0x60')]['id'];}return db[_0x4d62('0x57')][_0x4d62('0x5e')]({'where':{'id':_0x1e96e8[_0x4d62('0x5c')]['id']}})[_0x4d62('0x39')](handleEntityNotFound(_0x470671,null))[_0x4d62('0x39')](function(_0x463557){if(_0x463557){_0x1e96e8[_0x4d62('0x60')][_0x4d62('0x6d')]=_0x463557['id'];return db['CannedAnswer'][_0x4d62('0x5f')](_0x1e96e8[_0x4d62('0x60')]);}})['then'](respondWithResult(_0x470671,null))['catch'](handleError(_0x470671,null));};exports['getAnswers']=function(_0x3662a4,_0x927893,_0x4ffb1f){var _0x34489f={'raw':![],'where':{}};var _0x488ade={};var _0x2798d6={'count':0x0,'rows':[]};return db[_0x4d62('0x57')][_0x4d62('0x6a')]({'where':{'id':_0x3662a4[_0x4d62('0x5c')]['id']}})[_0x4d62('0x39')](handleEntityNotFound(_0x927893,null))[_0x4d62('0x39')](function(_0x523321){if(_0x523321){_0x488ade['model']=_[_0x4d62('0x48')](db[_0x4d62('0x71')][_0x4d62('0x43')]);_0x488ade[_0x4d62('0x47')]=_[_0x4d62('0x48')](_0x3662a4[_0x4d62('0x47')]);_0x488ade[_0x4d62('0x49')]=_[_0x4d62('0x4b')](_0x488ade['model'],_0x488ade[_0x4d62('0x47')]);_0x34489f[_0x4d62('0x4a')]=_[_0x4d62('0x4b')](_0x488ade['model'],qs[_0x4d62('0x4d')](_0x3662a4['query'][_0x4d62('0x4d')]));_0x34489f['attributes']=_0x34489f[_0x4d62('0x4a')][_0x4d62('0x6b')]?_0x34489f['attributes']:_0x488ade[_0x4d62('0x4c')];if(!_0x3662a4[_0x4d62('0x47')][_0x4d62('0x4e')]('nolimit')){_0x34489f[_0x4d62('0x31')]=qs[_0x4d62('0x31')](_0x3662a4[_0x4d62('0x47')][_0x4d62('0x31')]);_0x34489f[_0x4d62('0x2f')]=qs['offset'](_0x3662a4[_0x4d62('0x47')][_0x4d62('0x2f')]);}_0x34489f[_0x4d62('0x4f')]=qs['sort'](_0x3662a4[_0x4d62('0x47')][_0x4d62('0x50')]);_0x34489f['where']=qs[_0x4d62('0x49')](_[_0x4d62('0x51')](_0x3662a4[_0x4d62('0x47')],_0x488ade['filters']));_0x34489f[_0x4d62('0x53')][_0x4d62('0x6d')]=_0x523321['id'];if(_0x3662a4[_0x4d62('0x47')][_0x4d62('0x55')]){_0x34489f[_0x4d62('0x53')]=_[_0x4d62('0x52')](_0x34489f[_0x4d62('0x53')],{'$or':_[_0x4d62('0x42')](_0x34489f['attributes'],function(_0x2bfc06){var _0x31ba55={};_0x31ba55[_0x2bfc06]={'$like':'%'+_0x3662a4[_0x4d62('0x47')][_0x4d62('0x55')]+'%'};return _0x31ba55;})});}_0x34489f=_[_0x4d62('0x52')]({},_0x34489f,_0x3662a4[_0x4d62('0x56')]);return db[_0x4d62('0x71')][_0x4d62('0x32')]({'where':_0x34489f[_0x4d62('0x53')]})[_0x4d62('0x39')](function(_0x11a1d6){_0x2798d6[_0x4d62('0x32')]=_0x11a1d6;if(_0x3662a4['query'][_0x4d62('0x58')]){_0x34489f[_0x4d62('0x59')]=[{'all':!![]}];}return db['CannedAnswer'][_0x4d62('0x5a')](_0x34489f);})[_0x4d62('0x39')](function(_0x465be5){_0x2798d6[_0x4d62('0x72')]=_0x465be5;return _0x2798d6;});}})[_0x4d62('0x39')](respondWithFilteredResult(_0x927893,_0x34489f))['catch'](handleError(_0x927893,null));};exports[_0x4d62('0x73')]=function(_0x4b45a8,_0x3c5e08,_0x155ea2){return db[_0x4d62('0x57')][_0x4d62('0x5e')]({'where':{'id':_0x4b45a8['params']['id']}})[_0x4d62('0x39')](handleEntityNotFound(_0x3c5e08,null))[_0x4d62('0x39')](function(_0x2cbb6f){if(_0x2cbb6f){return _0x2cbb6f[_0x4d62('0x73')](_0x4b45a8[_0x4d62('0x47')]['ids']);}})['then'](respondWithStatusCode(_0x3c5e08,null))[_0x4d62('0x2a')](handleError(_0x3c5e08,null));};exports[_0x4d62('0x74')]=function(_0x9be6ea,_0x548c80,_0x1d4d6c){var _0x40ca69={'channel':_0x4d62('0x75')};var _0x257f8e=[];var _0x4644d3=[];var _0x48f5f4={};return db[_0x4d62('0x57')][_0x4d62('0x5e')]({'where':{'id':_0x9be6ea['params']['id']},'include':[{'model':db[_0x4d62('0x76')],'as':_0x4d62('0x77')}]})[_0x4d62('0x39')](handleEntityNotFound(_0x548c80,null))['then'](function(_0x1769cf){_0x40ca69[_0x4d62('0x78')]=_0x1769cf;_0x40ca69[_0x4d62('0x79')]=_[_0x4d62('0x7a')](_0x1769cf['Applications'],[_0x4d62('0x7b')],[_0x4d62('0x7c')]);if(_0x40ca69[_0x4d62('0x78')]['Applications']){delete _0x40ca69[_0x4d62('0x78')][_0x4d62('0x77')];}return db[_0x4d62('0x7d')][_0x4d62('0x68')]();})[_0x4d62('0x39')](function(_0x41f344){if(!_0x41f344){throw new db[(_0x4d62('0x7e'))]['ValidationError']('no\x20available\x20attributes');}_0x257f8e=_[_0x4d62('0x7f')](_['keys'](_0x41f344),['createdAt',_0x4d62('0x80')]);_0x4644d3=_[_0x4d62('0x7f')](_[_0x4d62('0x48')](_0x41f344),['createdAt','updatedAt',_0x4d62('0x81'),'ListId']);_0x40ca69[_0x4d62('0x60')]={'mapKey':_0x4d62('0x82')};if(_0x40ca69['account']['type']){switch(_0x40ca69[_0x4d62('0x78')][_0x4d62('0x45')]){case _0x4d62('0x83'):_0x40ca69[_0x4d62('0x60')][_0x4d62('0x84')]=_0x9be6ea[_0x4d62('0x60')]['From'];_0x40ca69[_0x4d62('0x60')][_0x4d62('0x60')]=_0x9be6ea[_0x4d62('0x60')][_0x4d62('0x85')];_0x40ca69[_0x4d62('0x60')]['messageId']=_0x9be6ea[_0x4d62('0x60')]['MessageSid'];break;case _0x4d62('0x86'):_0x40ca69[_0x4d62('0x60')]['from']='+'+_0x9be6ea[_0x4d62('0x60')][_0x4d62('0x87')];_0x40ca69[_0x4d62('0x60')]['body']=_0x9be6ea['body'][_0x4d62('0x88')];break;case _0x4d62('0x89'):_0x40ca69['body']['from']=_0x9be6ea['body'][_0x4d62('0x84')];_0x40ca69['body'][_0x4d62('0x60')]=_0x9be6ea[_0x4d62('0x60')][_0x4d62('0x28')];break;case _0x4d62('0x8a'):_0x40ca69[_0x4d62('0x60')]['from']=_0x9be6ea[_0x4d62('0x60')][_0x4d62('0x84')];_0x40ca69['body'][_0x4d62('0x60')]=_0x9be6ea[_0x4d62('0x60')]['body'];_0x40ca69[_0x4d62('0x60')][_0x4d62('0x8b')]=_0x9be6ea[_0x4d62('0x60')]['message_id'];break;case _0x4d62('0x8c'):_0x40ca69[_0x4d62('0x60')]['from']=_0x9be6ea[_0x4d62('0x60')]['From'];_0x40ca69[_0x4d62('0x60')][_0x4d62('0x60')]=_0x9be6ea[_0x4d62('0x60')][_0x4d62('0x8d')];_0x40ca69['body'][_0x4d62('0x8b')]=_0x9be6ea[_0x4d62('0x60')][_0x4d62('0x8e')];break;case'infobip':_0x40ca69['body']['from']='+'+_0x9be6ea['body'][_0x4d62('0x8f')][0x0][_0x4d62('0x84')];_0x40ca69[_0x4d62('0x60')][_0x4d62('0x60')]=_0x9be6ea[_0x4d62('0x60')]['results'][0x0][_0x4d62('0x88')];_0x40ca69['body'][_0x4d62('0x8b')]=_0x9be6ea[_0x4d62('0x60')]['results'][0x0][_0x4d62('0x8b')];break;case _0x4d62('0x90'):_0x40ca69['body']['from']=_0x9be6ea['body'][_0x4d62('0x91')];_0x40ca69[_0x4d62('0x60')]['body']=_0x9be6ea[_0x4d62('0x60')]['segmentedMessage'][_0x4d62('0x28')];break;case'clickatell':_0x40ca69[_0x4d62('0x60')]['from']=_0x9be6ea[_0x4d62('0x60')][_0x4d62('0x92')];_0x40ca69[_0x4d62('0x60')][_0x4d62('0x60')]=_0x9be6ea[_0x4d62('0x60')][_0x4d62('0x88')];_0x40ca69[_0x4d62('0x60')][_0x4d62('0x8b')]=_0x9be6ea[_0x4d62('0x60')]['replyMessageId'];break;case _0x4d62('0x93'):_0x40ca69[_0x4d62('0x60')][_0x4d62('0x8b')]=_0x9be6ea['body'][0x0][_0x4d62('0x28')]['id'];_0x40ca69[_0x4d62('0x60')]['from']=_0x9be6ea[_0x4d62('0x60')][0x0][_0x4d62('0x28')][_0x4d62('0x84')];_0x40ca69[_0x4d62('0x60')]['body']=_0x9be6ea[_0x4d62('0x60')][0x0][_0x4d62('0x28')][_0x4d62('0x88')];break;case _0x4d62('0x94'):_0x40ca69['body'][_0x4d62('0x84')]=_0x9be6ea[_0x4d62('0x60')][_0x4d62('0x84')];_0x40ca69['body']['body']=_0x9be6ea['body'][_0x4d62('0x28')];_0x40ca69[_0x4d62('0x60')][_0x4d62('0x8b')]=_0x9be6ea[_0x4d62('0x60')][_0x4d62('0x95')];break;}}if(_0x40ca69[_0x4d62('0x60')]['id']){delete _0x40ca69[_0x4d62('0x60')]['id'];}if(_['isNil'](_0x40ca69[_0x4d62('0x60')][_0x4d62('0x84')])){throw new db[(_0x4d62('0x7e'))]['ValidationError']('from\x20is\x20mandatory');}if(_[_0x4d62('0x96')](_0x40ca69[_0x4d62('0x60')][_0x4d62('0x60')])||_0x40ca69[_0x4d62('0x60')][_0x4d62('0x60')]===''){throw new db[(_0x4d62('0x7e'))][(_0x4d62('0x97'))](_0x4d62('0x98'));}if(_[_0x4d62('0x96')](_0x40ca69[_0x4d62('0x60')][_0x4d62('0x99')])){throw new db[(_0x4d62('0x7e'))][(_0x4d62('0x97'))](_0x4d62('0x9a')+_0x4644d3);}if(!_[_0x4d62('0x9b')](_0x4644d3,_0x40ca69['body'][_0x4d62('0x99')])){throw new db[(_0x4d62('0x7e'))][(_0x4d62('0x97'))](_0x4d62('0x9c')+_0x4644d3);}_0x48f5f4[_0x40ca69[_0x4d62('0x60')][_0x4d62('0x99')]]=_0x40ca69[_0x4d62('0x60')][_0x4d62('0x84')];return db[_0x4d62('0x9d')][_0x4d62('0x5e')]({'where':{'id':_0x40ca69[_0x4d62('0x78')][_0x4d62('0x9e')]},'include':[{'model':db[_0x4d62('0x7d')],'as':_0x4d62('0x9f'),'where':_0x48f5f4,'limit':0x1,'order':[[_0x4d62('0x80'),_0x4d62('0xa0')]]}]});})[_0x4d62('0x39')](handleEntityNotFound(_0x548c80,null))[_0x4d62('0x39')](function(_0x496101){if(_0x496101){_0x40ca69['list']=_['omit'](_0x496101,[_0x4d62('0x9f')]);if(_0x496101[_0x4d62('0x9f')][_0x4d62('0x6b')]){return _0x496101[_0x4d62('0x9f')][0x0];}var _0x1159a4=_[_0x4d62('0xa1')](_0x40ca69[_0x4d62('0x60')],{'firstName':_0x40ca69[_0x4d62('0x60')]['from'],'ListId':_0x496101['id']});_0x1159a4[_0x40ca69[_0x4d62('0x60')][_0x4d62('0x99')]]=_0x40ca69[_0x4d62('0x60')]['from'];return db[_0x4d62('0x7d')][_0x4d62('0x5f')](_0x1159a4,{'fields':_0x257f8e,'raw':!![]});}})[_0x4d62('0x39')](handleEntityNotFound(_0x548c80,null))[_0x4d62('0x39')](function(_0x4b06ef){if(_0x4b06ef){_0x40ca69[_0x4d62('0xa2')]=_0x4b06ef;var _0x526e54={'ContactId':_0x4b06ef['id'],'phone':_0x40ca69[_0x4d62('0x60')][_0x4d62('0x84')],'SmsAccountId':_0x9be6ea['params']['id']};var _0x53877b={'ContactId':_0x4b06ef['id'],'SmsAccountId':_0x9be6ea[_0x4d62('0x5c')]['id'],'closed':![]};return db['SmsInteraction'][_0x4d62('0x5e')]({'where':_0x53877b})['then'](function(_0x11b95d){if(_0x11b95d){return[_0x11b95d,![]];}return db[_0x4d62('0xa3')]['create'](_0x526e54)['then'](function(_0xdb0dbd){return[_0xdb0dbd,!![]];});});}})[_0x4d62('0xa4')](function(_0x427f0b,_0xc8a7b9){_0x40ca69[_0x4d62('0xa5')]=_0x427f0b['get']({'plain':!![]});_0x40ca69['interaction']['created']=![];if(_0xc8a7b9){if(_0x40ca69['account'][_0x4d62('0xa6')]){_0x40ca69['applications'][_0x4d62('0xa7')]({'id':0x0,'priority':_0x40ca69[_0x4d62('0x79')]['length']+0x1,'app':_0x4d62('0xa8'),'appdata':_0x4d62('0xa9'),'interval':'*,*,*,*'});}_0x40ca69[_0x4d62('0xa5')]['created']=!![];}return db[_0x4d62('0xaa')][_0x4d62('0x5f')]({'phone':_0x40ca69[_0x4d62('0x60')][_0x4d62('0x84')],'messageId':_0x40ca69[_0x4d62('0x60')]['messageId'],'body':_0x40ca69[_0x4d62('0x60')][_0x4d62('0x60')],'SmsAccountId':_0x9be6ea[_0x4d62('0x5c')]['id'],'SmsInteractionId':_0x427f0b['id'],'direction':'in','ContactId':_0x427f0b[_0x4d62('0xab')],'AttachmentId':_0x40ca69['body']['AttachmentId']});})[_0x4d62('0x39')](function(_0xb97c95){_0x40ca69[_0x4d62('0x28')]=_0xb97c95;if(_0x40ca69[_0x4d62('0xa5')][_0x4d62('0xac')]){return db['User']['find']({'attributes':['id','name'],'where':{'id':_0x40ca69[_0x4d62('0xa5')][_0x4d62('0xac')]}})[_0x4d62('0x39')](function(_0x1ea3bb){if(_0x1ea3bb){_0x40ca69[_0x4d62('0x79')]['unshift']({'id':0x0,'priority':0x0,'app':_0x4d62('0xad'),'appdata':_0x1ea3bb['name']+','+(_0x40ca69[_0x4d62('0x78')][_0x4d62('0xae')]||0xa),'interval':_0x4d62('0xaf')});}return respondWithRpcPromise(_0x4d62('0xb0'),_0x4d62('0xb1'),_0x40ca69);});}return respondWithRpcPromise(_0x4d62('0xb0'),'startRouting',_0x40ca69);})[_0x4d62('0x39')](function(_0x18edaa){if(_0x18edaa){var _0x32b721=0xc8;var _0x387e71=_0x4d62('0xb2');logger[_0x4d62('0x20')](_0x4d62('0x24'),_0x387e71,_0x32b721,_0x4d62('0xb3'));logger[_0x4d62('0x23')](_0x4d62('0xb4'),_0x387e71,_0x32b721,_0x4d62('0xb3'),JSON[_0x4d62('0x25')](_0x18edaa));if(_0x40ca69['account'][_0x4d62('0x45')]==='twilio'){return _0x548c80[_0x4d62('0x2c')](_0x32b721)[_0x4d62('0x33')](_0x4d62('0xb5'),_0x4d62('0xb6'))['send'](_0x4d62('0xb7'));}else{return _0x548c80['status'](_0x32b721)[_0x4d62('0x2e')](_0x18edaa);}}})[_0x4d62('0x2a')](handleError(_0x548c80,null));};exports[_0x4d62('0xb8')]=function(_0x102a55,_0x3e715f,_0x2375e7){return db[_0x4d62('0x57')][_0x4d62('0x6a')]({'where':{'id':_0x102a55[_0x4d62('0x5c')]['id']}})['then'](handleEntityNotFound(_0x3e715f,null))[_0x4d62('0x39')](function(_0x4c06b4){if(_0x4c06b4){return db[_0x4d62('0xb9')][_0x4d62('0xba')](function(_0x509fd1){return db[_0x4d62('0x76')][_0x4d62('0x3a')]({'where':{'SmsAccountId':_0x102a55[_0x4d62('0x5c')]['id']},'transaction':_0x509fd1})[_0x4d62('0x39')](function(_0x15e86d){var _0x2af1ff=_[_0x4d62('0x42')](_0x102a55[_0x4d62('0x60')],function(_0xc1ecc0){_0xc1ecc0[_0x4d62('0x6d')]=_0x102a55[_0x4d62('0x5c')]['id'];return _0xc1ecc0;});return db[_0x4d62('0x76')]['bulkCreate'](_0x2af1ff,{'transaction':_0x509fd1});});})[_0x4d62('0x39')](function(){return db[_0x4d62('0x76')][_0x4d62('0xbb')]({'where':{'SmsAccountId':_0x102a55[_0x4d62('0x5c')]['id']},'order':'priority'});});}})[_0x4d62('0x39')](respondWithResult(_0x3e715f,null))[_0x4d62('0x2a')](handleError(_0x3e715f,null));};exports[_0x4d62('0xbc')]=function(_0x2ce2c1,_0x304c6a,_0x48f9a0){var _0x30e3cd={};var _0x241767={};var _0x442350;var _0x73bcc;return db[_0x4d62('0x57')][_0x4d62('0x6a')]({'where':{'id':_0x2ce2c1[_0x4d62('0x5c')]['id']}})[_0x4d62('0x39')](handleEntityNotFound(_0x304c6a,null))['then'](function(_0x38c4db){if(_0x38c4db){_0x442350=_0x38c4db;_0x241767[_0x4d62('0x4c')]=_[_0x4d62('0x48')](db['SmsApplication'][_0x4d62('0x43')]);_0x241767[_0x4d62('0x47')]=_[_0x4d62('0x48')](_0x2ce2c1['query']);_0x241767['filters']=_[_0x4d62('0x4b')](_0x241767[_0x4d62('0x4c')],_0x241767[_0x4d62('0x47')]);_0x30e3cd[_0x4d62('0x4a')]=_['intersection'](_0x241767[_0x4d62('0x4c')],qs[_0x4d62('0x4d')](_0x2ce2c1['query'][_0x4d62('0x4d')]));_0x30e3cd[_0x4d62('0x4a')]=_0x30e3cd[_0x4d62('0x4a')][_0x4d62('0x6b')]?_0x30e3cd['attributes']:_0x241767[_0x4d62('0x4c')];_0x30e3cd[_0x4d62('0x4f')]=qs[_0x4d62('0x50')](_0x2ce2c1[_0x4d62('0x47')]['sort']);_0x30e3cd[_0x4d62('0x53')]=qs[_0x4d62('0x49')](_[_0x4d62('0x51')](_0x2ce2c1[_0x4d62('0x47')],_0x241767[_0x4d62('0x49')]));if(_0x2ce2c1[_0x4d62('0x47')][_0x4d62('0x55')]){_0x30e3cd[_0x4d62('0x53')]=_[_0x4d62('0x52')](_0x30e3cd['where'],{'$or':_[_0x4d62('0x42')](_0x30e3cd['attributes'],function(_0x313212){var _0x2bab76={};_0x2bab76[_0x313212]={'$like':'%'+_0x2ce2c1['query'][_0x4d62('0x55')]+'%'};return _0x2bab76;})});}_0x30e3cd=_[_0x4d62('0x52')]({},_0x30e3cd,_0x2ce2c1['options']);return _0x442350[_0x4d62('0xbc')](_0x30e3cd);}})[_0x4d62('0x39')](function(_0x46740b){if(_0x46740b){_0x73bcc=_0x46740b[_0x4d62('0x6b')];if(!_0x2ce2c1[_0x4d62('0x47')]['hasOwnProperty'](_0x4d62('0x6c'))){_0x30e3cd[_0x4d62('0x31')]=qs[_0x4d62('0x31')](_0x2ce2c1['query'][_0x4d62('0x31')]);_0x30e3cd[_0x4d62('0x2f')]=qs[_0x4d62('0x2f')](_0x2ce2c1[_0x4d62('0x47')][_0x4d62('0x2f')]);}return _0x442350[_0x4d62('0xbc')](_0x30e3cd);}})['then'](function(_0x3f4a22){if(_0x3f4a22){return _0x3f4a22?{'count':_0x73bcc,'rows':_0x3f4a22}:null;}})[_0x4d62('0x39')](respondWithResult(_0x304c6a,null))['catch'](handleError(_0x304c6a,null));};exports[_0x4d62('0xbd')]=function(_0x35543a,_0x39e244,_0x18e4f4){var _0x410fb8={'raw':![],'where':{}};var _0x19ac4b={};var _0xfe27b1={'count':0x0,'rows':[]};return db[_0x4d62('0x57')][_0x4d62('0x6a')]({'where':{'id':_0x35543a['params']['id']}})[_0x4d62('0x39')](handleEntityNotFound(_0x39e244,null))['then'](function(_0x505c84){if(_0x505c84){_0x19ac4b[_0x4d62('0x4c')]=_[_0x4d62('0x48')](db[_0x4d62('0xa3')][_0x4d62('0x43')]);_0x19ac4b[_0x4d62('0x47')]=_[_0x4d62('0x48')](_0x35543a[_0x4d62('0x47')]);_0x19ac4b[_0x4d62('0x49')]=_[_0x4d62('0x4b')](_0x19ac4b[_0x4d62('0x4c')],_0x19ac4b['query']);_0x410fb8[_0x4d62('0x4a')]=_[_0x4d62('0x4b')](_0x19ac4b['model'],qs['fields'](_0x35543a[_0x4d62('0x47')][_0x4d62('0x4d')]));_0x410fb8[_0x4d62('0x4a')]=_0x410fb8[_0x4d62('0x4a')][_0x4d62('0x6b')]?_0x410fb8[_0x4d62('0x4a')]:_0x19ac4b['model'];if(!_0x35543a['query']['hasOwnProperty'](_0x4d62('0x6c'))){_0x410fb8[_0x4d62('0x31')]=qs[_0x4d62('0x31')](_0x35543a[_0x4d62('0x47')][_0x4d62('0x31')]);_0x410fb8[_0x4d62('0x2f')]=qs['offset'](_0x35543a['query'][_0x4d62('0x2f')]);}_0x410fb8[_0x4d62('0x4f')]=qs['sort'](_0x35543a['query'][_0x4d62('0x50')]);_0x410fb8['where']=qs[_0x4d62('0x49')](_[_0x4d62('0x51')](_0x35543a['query'],_0x19ac4b[_0x4d62('0x49')]));_0x410fb8['where'][_0x4d62('0x6d')]=_0x505c84['id'];if(_0x35543a[_0x4d62('0x47')]['filter']){_0x410fb8[_0x4d62('0x53')]=_['merge'](_0x410fb8[_0x4d62('0x53')],{'$or':_[_0x4d62('0x42')](_0x410fb8['attributes'],function(_0xed2f2a){var _0x3bac7d={};_0x3bac7d[_0xed2f2a]={'$like':'%'+_0x35543a[_0x4d62('0x47')][_0x4d62('0x55')]+'%'};return _0x3bac7d;})});}_0x410fb8=_['merge']({},_0x410fb8,_0x35543a[_0x4d62('0x56')]);return db[_0x4d62('0xa3')]['count']({'where':_0x410fb8[_0x4d62('0x53')]})['then'](function(_0x45f984){_0xfe27b1[_0x4d62('0x32')]=_0x45f984;if(_0x35543a[_0x4d62('0x47')]['includeAll']){_0x410fb8[_0x4d62('0x59')]=[{'model':db['CmContact'],'as':'Contact','required':![]},{'model':db[_0x4d62('0xbe')],'as':_0x4d62('0xbf'),'attributes':[_0x4d62('0x3f'),'fullname','internal'],'required':![]},{'model':db['Tag'],'as':'Tags','attributes':['id',_0x4d62('0x3f'),_0x4d62('0xc0')],'where':_0x35543a[_0x4d62('0x47')][_0x4d62('0xc1')]?{'id':_0x35543a['query'][_0x4d62('0xc1')]}:undefined,'required':_0x35543a[_0x4d62('0x47')][_0x4d62('0xc1')]?!![]:![]}];}return db[_0x4d62('0xa3')]['findAll'](_0x410fb8);})[_0x4d62('0x39')](function(_0x39e91d){_0xfe27b1[_0x4d62('0x72')]=_0x39e91d;return _0xfe27b1;});}})[_0x4d62('0x39')](respondWithFilteredResult(_0x39e244,_0x410fb8))[_0x4d62('0x2a')](handleError(_0x39e244,null));};exports[_0x4d62('0x40')]=function(_0x3cd16d,_0x3d8821,_0xa21765){var _0x446a5e,_0xb509ae,_0x141aef;if(_[_0x4d62('0x96')](_0x3cd16d[_0x4d62('0x60')]['body'])||_0x3cd16d['body'][_0x4d62('0x60')]===''){throw new db[(_0x4d62('0x7e'))][(_0x4d62('0x97'))](_0x4d62('0x98'));}if(_[_0x4d62('0x96')](_0x3cd16d[_0x4d62('0x60')]['to'])){throw new db['Sequelize']['ValidationError'](_0x4d62('0xc2'));}_0x446a5e=_0x3cd16d[_0x4d62('0x60')]['to'];return db['SmsAccount'][_0x4d62('0x5e')]({'where':{'id':_0x3cd16d['params']['id']},'include':[{'model':db[_0x4d62('0x9d')],'as':'List','include':[{'model':db[_0x4d62('0x7d')],'as':'Contacts','where':{'mobile':_0x446a5e},'limit':0x1,'order':[[_0x4d62('0x80'),_0x4d62('0xa0')]]}]}]})[_0x4d62('0x39')](handleEntityNotFound(_0x3d8821,null))[_0x4d62('0x39')](function(_0x19e8a8){if(_0x19e8a8&&_0x19e8a8['List']){_0xb509ae=_0x19e8a8['get']({'plain':!![]});if(_0xb509ae[_0x4d62('0xc3')]&&_0xb509ae[_0x4d62('0xc3')][_0x4d62('0x9f')][_0x4d62('0x6b')]){return _0xb509ae[_0x4d62('0xc3')][_0x4d62('0x9f')][0x0];}return db[_0x4d62('0x7d')][_0x4d62('0x5f')](_[_0x4d62('0xa1')](_0x3cd16d['body'],{'firstName':_0x446a5e,'mobile':_0x446a5e,'phone':_0x446a5e,'ListId':_0xb509ae[_0x4d62('0x9e')]}));}})['then'](handleEntityNotFound(_0x3d8821,null))['then'](function(_0x4861e9){if(_0x4861e9){_0x141aef=_0x4861e9;return db[_0x4d62('0xa3')][_0x4d62('0x5e')]({'where':{'ContactId':_0x141aef['id'],'closed':![],'SmsAccountId':_0xb509ae['id']}})[_0x4d62('0x39')](function(_0x4e1d7b){if(_0x4e1d7b){return[_0x4e1d7b,![]];}return db[_0x4d62('0xa3')]['create']({'UserId':_0x3cd16d[_0x4d62('0x61')]['id'],'ContactId':_0x141aef['id'],'SmsAccountId':_0xb509ae['id'],'phone':_0x446a5e,'firstMsgDirection':'out','Messages':[_[_0x4d62('0x52')](_0x3cd16d[_0x4d62('0x60')],{'read':![],'body':_0x3cd16d[_0x4d62('0x60')][_0x4d62('0x60')],'phone':_0x446a5e,'SmsAccountId':_0xb509ae['id'],'UserId':_0x3cd16d[_0x4d62('0x61')]['id'],'ContactId':_0x141aef['id']})]},{'include':[{'model':db[_0x4d62('0xaa')],'as':_0x4d62('0xc4')}]})['then'](function(_0x4d8f29){return[_0x4d8f29,!![]];});});}})[_0x4d62('0xa4')](function(_0x3b1a15,_0x3d8136){if(_0x3d8136){return _0x3b1a15;}return db['SmsMessage'][_0x4d62('0x5f')](_['merge'](_0x3cd16d[_0x4d62('0x60')],{'read':![],'body':_0x3cd16d['body'][_0x4d62('0x60')],'phone':_0x446a5e,'SmsAccountId':_0xb509ae['id'],'SmsInteractionId':_0x3b1a15['id'],'UserId':_0x3cd16d[_0x4d62('0x61')]['id'],'ContactId':_0x141aef['id']}))[_0x4d62('0x39')](function(_0x109deb){_0x3b1a15[_0x4d62('0xc5')][_0x4d62('0xc4')]=[];_0x3b1a15[_0x4d62('0xc5')][_0x4d62('0xc4')][_0x4d62('0xa7')](_0x109deb[_0x4d62('0xc5')]);return _0x3b1a15;});})['then'](respondWithResult(_0x3d8821,null))['catch'](handleError(_0x3d8821,null));};exports['status']=function(_0x29be8f,_0x1d480b,_0x42b8a4){if(_0x29be8f[_0x4d62('0x60')]['id']){delete _0x29be8f[_0x4d62('0x60')]['id'];}var _0x2d748a,_0x52ce82,_0x528a02;return db[_0x4d62('0x57')]['find']({'where':{'id':_0x29be8f[_0x4d62('0x5c')]['id']}})[_0x4d62('0x39')](handleEntityNotFound(_0x1d480b,null))['then'](function(_0x469500){if(_0x469500){_0x528a02=_0x469500;logger[_0x4d62('0x23')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x4d62('0x2c'),_0x4d62('0xc6'),_0x469500[_0x4d62('0x45')],util[_0x4d62('0xc7')](_0x29be8f[_0x4d62('0x60')],{'showHidden':![],'depth':null}));switch(_0x469500[_0x4d62('0x45')]){case _0x4d62('0x86'):if(_0x29be8f[_0x4d62('0x60')][_0x4d62('0xc8')]&&_0x29be8f[_0x4d62('0x60')][_0x4d62('0x2c')]){_0x52ce82=_0x29be8f[_0x4d62('0x60')][_0x4d62('0x2c')];return db[_0x4d62('0xaa')][_0x4d62('0x5e')]({'where':{'messageId':_0x29be8f[_0x4d62('0x60')][_0x4d62('0xc8')]}});}break;case _0x4d62('0x89'):if(_0x29be8f[_0x4d62('0x60')]['requestid']&&_0x29be8f[_0x4d62('0x60')]['statusInt']){_0x52ce82=_0x29be8f[_0x4d62('0x60')][_0x4d62('0xc9')];return db['SmsMessage'][_0x4d62('0x5e')]({'where':{'messageId':_0x29be8f[_0x4d62('0x60')][_0x4d62('0xca')]}});}break;case'clicksend':if(_0x29be8f[_0x4d62('0x60')][_0x4d62('0xcb')]&&_0x29be8f['body'][_0x4d62('0xcc')]){_0x52ce82=_0x29be8f[_0x4d62('0x60')]['status_code'];return db[_0x4d62('0xaa')][_0x4d62('0x5e')]({'where':{'messageId':_0x29be8f[_0x4d62('0x60')][_0x4d62('0xcb')]}});}break;case _0x4d62('0xcd'):var _0x3538ed=_0x29be8f[_0x4d62('0x60')][_0x4d62('0x8f')][0x0];if(_0x3538ed[_0x4d62('0x8b')]&&_0x3538ed[_0x4d62('0x2c')][_0x4d62('0xce')]===_0x4d62('0xcf')){_0x52ce82=_0x3538ed[_0x4d62('0x2c')][_0x4d62('0xce')];return db[_0x4d62('0xaa')][_0x4d62('0x5e')]({'where':{'messageId':_0x3538ed[_0x4d62('0x8b')]}});}break;case _0x4d62('0xd0'):if(_0x29be8f[_0x4d62('0x60')]['messageId']&&_0x29be8f['body']['status']){_0x52ce82=_0x29be8f['body'][_0x4d62('0x2c')];return db['SmsMessage'][_0x4d62('0x5e')]({'where':{'messageId':_0x29be8f[_0x4d62('0x60')][_0x4d62('0x8b')]}});}break;case _0x4d62('0x93'):if(_0x29be8f[_0x4d62('0x60')][0x0][_0x4d62('0x28')]['id']){_0x52ce82=_0x29be8f[_0x4d62('0x60')][0x0][_0x4d62('0x45')];return db[_0x4d62('0xaa')][_0x4d62('0x5e')]({'where':{'messageId':_0x29be8f[_0x4d62('0x60')][0x0]['message']['id']}});}break;case _0x4d62('0x94'):if(_0x29be8f[_0x4d62('0x60')]['redif']&&_0x29be8f[_0x4d62('0x60')][_0x4d62('0x2c')]){_0x52ce82=_0x29be8f[_0x4d62('0x60')][_0x4d62('0x2c')];return db[_0x4d62('0xaa')][_0x4d62('0x5e')]({'where':{'messageId':_0x29be8f[_0x4d62('0x60')][_0x4d62('0xd1')]}});}break;}}})['then'](handleEntityNotFound(_0x1d480b,null))[_0x4d62('0x39')](function(_0x46d9ad){if(_0x46d9ad){_0x2d748a=_0x46d9ad;switch(_0x528a02[_0x4d62('0x45')]){case'skebby':if(_0x52ce82==='DELIVERED'){return _0x2d748a[_0x4d62('0x38')]({'read':!![]});}else{logger['error']('SmsAccount,\x20%s,\x20%s,\x20%s',_0x4d62('0x2c'),_0x4d62('0x86'),util[_0x4d62('0xc7')](_0x29be8f[_0x4d62('0x60')],{'showHidden':![],'depth':null}));}break;case _0x4d62('0x89'):if(_0x52ce82==='1'){return _0x2d748a[_0x4d62('0x38')]({'read':!![]});}else{logger[_0x4d62('0x26')](_0x4d62('0x24'),'status','skebby',util[_0x4d62('0xc7')](_0x29be8f[_0x4d62('0x60')],{'showHidden':![],'depth':null}));}break;case _0x4d62('0x8a'):if(!_0x29be8f[_0x4d62('0x60')][_0x4d62('0xd2')]&&_0x52ce82>=0xc8&&_0x52ce82<=0xce){return _0x2d748a['update']({'read':!![]});}else{logger[_0x4d62('0x26')](_0x4d62('0x24'),_0x4d62('0x2c'),'clicksend',util[_0x4d62('0xc7')](_0x29be8f[_0x4d62('0x60')],{'showHidden':![],'depth':null}));}break;case _0x4d62('0xcd'):var _0x13df3d=_0x29be8f['body'][_0x4d62('0x8f')][0x0];if(_0x13df3d[_0x4d62('0x2c')][_0x4d62('0xce')]===_0x4d62('0xcf')){return _0x2d748a[_0x4d62('0x38')]({'read':!![]});}else{logger[_0x4d62('0x26')](_0x4d62('0x24'),_0x4d62('0x2c'),'infobip',util['inspect'](_0x29be8f['body'],{'showHidden':![],'depth':null}));}break;case _0x4d62('0xd0'):if(_0x52ce82==_0x4d62('0xd3')||_0x52ce82==_0x4d62('0xd4')){return _0x2d748a['update']({'read':!![]});}else{logger['error'](_0x4d62('0x24'),_0x4d62('0x2c'),_0x4d62('0xd0'),util[_0x4d62('0xc7')](_0x29be8f[_0x4d62('0x60')],{'showHidden':![],'depth':null}));}break;case'bandwidth':if(_0x52ce82==_0x4d62('0xd5')){return _0x2d748a[_0x4d62('0x38')]({'read':!![]});}else{logger[_0x4d62('0x26')](_0x4d62('0x24'),_0x4d62('0x2c'),_0x4d62('0x93'),util['inspect'](_0x29be8f['body'],{'showHidden':![],'depth':null}));}break;case _0x4d62('0x94'):if(_0x52ce82===_0x4d62('0xd6')||_0x52ce82==='ACCEPTD'){return _0x2d748a[_0x4d62('0x38')]({'read':!![]});}else{logger[_0x4d62('0x26')](_0x4d62('0x24'),_0x4d62('0x2c'),'intelepeer',util[_0x4d62('0xc7')](_0x29be8f[_0x4d62('0x60')],{'showHidden':![],'depth':null}));}break;}return _0x2d748a;}})[_0x4d62('0x39')](respondWithResult(_0x1d480b,null))[_0x4d62('0x2a')](handleError(_0x1d480b,null));};exports[_0x4d62('0xd7')]=function(_0x234748,_0x50c011,_0x50f059){var _0x5a9f1e,_0x18a104,_0x1e4b13;return db[_0x4d62('0x57')][_0x4d62('0x5e')]({'where':{'id':_0x234748['params']['id']}})[_0x4d62('0x39')](handleEntityNotFound(_0x50c011,null))[_0x4d62('0x39')](function(_0x3fd01d){if(_0x3fd01d){_0x1e4b13=_0x3fd01d;logger[_0x4d62('0x23')](_0x4d62('0x24'),_0x4d62('0x2c'),_0x4d62('0xc6'),_0x3fd01d[_0x4d62('0x45')],util['inspect'](_0x234748['query'],{'showHidden':![],'depth':null}));switch(_0x3fd01d[_0x4d62('0x45')]){case'csc':if(_0x234748[_0x4d62('0x47')][_0x4d62('0xd8')]&&_0x234748[_0x4d62('0x47')][_0x4d62('0xd9')]){_0x18a104=_0x234748[_0x4d62('0x47')][_0x4d62('0xd9')];return db[_0x4d62('0xaa')][_0x4d62('0x5e')]({'where':{'messageId':_0x234748[_0x4d62('0x47')][_0x4d62('0xd8')]}});}break;}}})[_0x4d62('0x39')](handleEntityNotFound(_0x50c011,null))[_0x4d62('0x39')](function(_0xc13e1b){if(_0xc13e1b){_0x5a9f1e=_0xc13e1b;switch(_0x1e4b13[_0x4d62('0x45')]){case _0x4d62('0x90'):if(_0x18a104==='2'||_0x18a104==='6'){return _0x5a9f1e[_0x4d62('0x38')]({'read':!![]});}else{logger['error'](_0x4d62('0x24'),_0x4d62('0x2c'),'csc',util[_0x4d62('0xc7')](_0x234748['query'],{'showHidden':![],'depth':null}));};break;}return _0x5a9f1e;}})['then'](respondWithResult(_0x50c011,null))[_0x4d62('0x2a')](handleError(_0x50c011,null));};exports[_0x4d62('0xda')]=function(_0x5c78fd,_0xc2ce1c,_0xb96b1e){return db[_0x4d62('0x57')][_0x4d62('0x5e')]({'where':{'id':_0x5c78fd[_0x4d62('0x5c')]['id']}})[_0x4d62('0x39')](handleEntityNotFound(_0xc2ce1c,null))[_0x4d62('0x39')](function(_0x503b26){if(_0x503b26){return _0x503b26['addAgents'](_0x5c78fd[_0x4d62('0x60')][_0x4d62('0x6f')],_['omit'](_0x5c78fd[_0x4d62('0x60')],['ids','id'])||{})['spread'](function(_0x450639){for(var _0x16896a=0x0;_0x16896a<_0x5c78fd[_0x4d62('0x60')][_0x4d62('0x6f')][_0x4d62('0x6b')];_0x16896a+=0x1){socket[_0x4d62('0xdb')](_0x4d62('0xdc'),{'UserId':Number(_0x5c78fd[_0x4d62('0x60')][_0x4d62('0x6f')][_0x16896a]),'SmsAccountId':Number(_0x5c78fd['params']['id'])});}return _0x450639;});}})[_0x4d62('0x39')](respondWithResult(_0xc2ce1c,null))[_0x4d62('0x2a')](handleError(_0xc2ce1c,null));};exports[_0x4d62('0xdd')]=function(_0x50073a,_0x1654a1,_0x5735b0){return db['SmsAccount'][_0x4d62('0x5e')]({'where':{'id':_0x50073a[_0x4d62('0x5c')]['id']}})[_0x4d62('0x39')](handleEntityNotFound(_0x1654a1,null))[_0x4d62('0x39')](function(_0x3f4f52){if(_0x3f4f52){return _0x3f4f52['removeAgents'](_0x50073a[_0x4d62('0x47')]['ids'])[_0x4d62('0x39')](function(){if(_[_0x4d62('0xde')](_0x50073a['query'][_0x4d62('0x6f')])){for(var _0x163ca5=0x0;_0x163ca5<_0x50073a['query'][_0x4d62('0x6f')]['length'];_0x163ca5+=0x1){socket[_0x4d62('0xdb')](_0x4d62('0xdf'),{'UserId':Number(_0x50073a[_0x4d62('0x47')][_0x4d62('0x6f')][_0x163ca5]),'SmsAccountId':Number(_0x50073a[_0x4d62('0x5c')]['id'])});}}else{socket['emit'](_0x4d62('0xdf'),{'UserId':Number(_0x50073a[_0x4d62('0x47')]['ids']),'SmsAccountId':Number(_0x50073a[_0x4d62('0x5c')]['id'])});}});}})[_0x4d62('0x39')](respondWithStatusCode(_0x1654a1,null))[_0x4d62('0x2a')](handleError(_0x1654a1,null));};exports[_0x4d62('0xe0')]=function(_0x10de29,_0x54aeb8,_0x42f17b){var _0x5807bc={};var _0x1d0d51={};var _0x1f24a3;var _0x3c6367;return db[_0x4d62('0x57')][_0x4d62('0x6a')]({'where':{'id':_0x10de29[_0x4d62('0x5c')]['id']}})['then'](handleEntityNotFound(_0x54aeb8,null))[_0x4d62('0x39')](function(_0x36627e){if(_0x36627e){_0x1f24a3=_0x36627e;_0x1d0d51[_0x4d62('0x4c')]=_[_0x4d62('0x48')](db[_0x4d62('0xbe')][_0x4d62('0x43')]);_0x1d0d51[_0x4d62('0x47')]=_[_0x4d62('0x48')](_0x10de29['query']);_0x1d0d51['filters']=_[_0x4d62('0x4b')](_0x1d0d51[_0x4d62('0x4c')],_0x1d0d51[_0x4d62('0x47')]);_0x5807bc[_0x4d62('0x4a')]=_[_0x4d62('0x4b')](_0x1d0d51[_0x4d62('0x4c')],qs[_0x4d62('0x4d')](_0x10de29['query'][_0x4d62('0x4d')]));_0x5807bc['attributes']=_0x5807bc[_0x4d62('0x4a')][_0x4d62('0x6b')]?_0x5807bc[_0x4d62('0x4a')]:_0x1d0d51['model'];_0x5807bc[_0x4d62('0x4f')]=qs[_0x4d62('0x50')](_0x10de29['query'][_0x4d62('0x50')]);_0x5807bc[_0x4d62('0x53')]=qs[_0x4d62('0x49')](_['pick'](_0x10de29[_0x4d62('0x47')],_0x1d0d51[_0x4d62('0x49')]));if(_0x10de29[_0x4d62('0x47')][_0x4d62('0x55')]){_0x5807bc[_0x4d62('0x53')]=_[_0x4d62('0x52')](_0x5807bc[_0x4d62('0x53')],{'$or':_[_0x4d62('0x42')](_0x5807bc[_0x4d62('0x4a')],function(_0x156283){var _0x13af78={};_0x13af78[_0x156283]={'$like':'%'+_0x10de29[_0x4d62('0x47')]['filter']+'%'};return _0x13af78;})});}_0x5807bc=_[_0x4d62('0x52')]({},_0x5807bc,_0x10de29[_0x4d62('0x56')]);return _0x1f24a3[_0x4d62('0xe0')](_0x5807bc);}})[_0x4d62('0x39')](function(_0x2bcce0){if(_0x2bcce0){_0x3c6367=_0x2bcce0[_0x4d62('0x6b')];if(!_0x10de29[_0x4d62('0x47')][_0x4d62('0x4e')](_0x4d62('0x6c'))){_0x5807bc['limit']=qs[_0x4d62('0x31')](_0x10de29['query'][_0x4d62('0x31')]);_0x5807bc[_0x4d62('0x2f')]=qs[_0x4d62('0x2f')](_0x10de29[_0x4d62('0x47')][_0x4d62('0x2f')]);}return _0x1f24a3[_0x4d62('0xe0')](_0x5807bc);}})[_0x4d62('0x39')](function(_0x14b839){if(_0x14b839){return _0x14b839?{'count':_0x3c6367,'rows':_0x14b839}:null;}})[_0x4d62('0x39')](respondWithResult(_0x54aeb8,null))[_0x4d62('0x2a')](handleError(_0x54aeb8,null));}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.events.js b/server/api/smsAccount/smsAccount.events.js index 0d79723..908aa96 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 _0x601a=['emit','hook','exports','events','../../mysqldb','SmsAccount','setMaxListeners','save','update','remove'];(function(_0x89bfa9,_0x4d3cc4){var _0x27484a=function(_0x47ef9d){while(--_0x47ef9d){_0x89bfa9['push'](_0x89bfa9['shift']());}};_0x27484a(++_0x4d3cc4);}(_0x601a,0xe9));var _0xa601=function(_0x4044fb,_0x3da156){_0x4044fb=_0x4044fb-0x0;var _0x44df96=_0x601a[_0x4044fb];return _0x44df96;};'use strict';var EventEmitter=require(_0xa601('0x0'));var SmsAccount=require(_0xa601('0x1'))['db'][_0xa601('0x2')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0xa601('0x3')](0x0);var events={'afterCreate':_0xa601('0x4'),'afterUpdate':_0xa601('0x5'),'afterDestroy':_0xa601('0x6')};function emitEvent(_0x1dc479){return function(_0x5ed2ea,_0x5d583d,_0x531234){SmsAccountEvents['emit'](_0x1dc479+':'+_0x5ed2ea['id'],_0x5ed2ea);SmsAccountEvents[_0xa601('0x7')](_0x1dc479,_0x5ed2ea);_0x531234(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsAccount[_0xa601('0x8')](e,emitEvent(event));}}module[_0xa601('0x9')]=SmsAccountEvents; \ No newline at end of file +var _0x8467=['events','SmsAccount','setMaxListeners','update','remove','emit','exports'];(function(_0x498b80,_0x4a207c){var _0x368941=function(_0x1397a9){while(--_0x1397a9){_0x498b80['push'](_0x498b80['shift']());}};_0x368941(++_0x4a207c);}(_0x8467,0x17a));var _0x7846=function(_0x5c4f6b,_0x2cdfce){_0x5c4f6b=_0x5c4f6b-0x0;var _0x104c4e=_0x8467[_0x5c4f6b];return _0x104c4e;};'use strict';var EventEmitter=require(_0x7846('0x0'));var SmsAccount=require('../../mysqldb')['db'][_0x7846('0x1')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0x7846('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x7846('0x3'),'afterDestroy':_0x7846('0x4')};function emitEvent(_0x2d4933){return function(_0x1e1aeb,_0x5d2cd8,_0x270fcb){SmsAccountEvents[_0x7846('0x5')](_0x2d4933+':'+_0x1e1aeb['id'],_0x1e1aeb);SmsAccountEvents['emit'](_0x2d4933,_0x1e1aeb);_0x270fcb(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsAccount['hook'](e,emitEvent(event));}}module[_0x7846('0x6')]=SmsAccountEvents; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.model.js b/server/api/smsAccount/smsAccount.model.js index 98d594b..2df170e 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 _0xa707=['path','rimraf','../../config/environment','./smsAccount.attributes','exports','define','sms_accounts','../../config/logger','bluebird','request-promise'];(function(_0x4e95b2,_0x52d331){var _0x2baa11=function(_0x1f01ce){while(--_0x1f01ce){_0x4e95b2['push'](_0x4e95b2['shift']());}};_0x2baa11(++_0x52d331);}(_0xa707,0x7f));var _0x7a70=function(_0x303333,_0x263d94){_0x303333=_0x303333-0x0;var _0x35c854=_0xa707[_0x303333];return _0x35c854;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x7a70('0x0'))('api');var moment=require('moment');var BPromise=require(_0x7a70('0x1'));var rp=require(_0x7a70('0x2'));var fs=require('fs');var path=require(_0x7a70('0x3'));var rimraf=require(_0x7a70('0x4'));var config=require(_0x7a70('0x5'));var attributes=require(_0x7a70('0x6'));module[_0x7a70('0x7')]=function(_0x3bdab1,_0x4dc033){return _0x3bdab1[_0x7a70('0x8')]('SmsAccount',attributes,{'tableName':_0x7a70('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbe23=['rimraf','./smsAccount.attributes','exports','define','SmsAccount','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x266945,_0x5c5e8c){var _0x4477d5=function(_0x18c0b2){while(--_0x18c0b2){_0x266945['push'](_0x266945['shift']());}};_0x4477d5(++_0x5c5e8c);}(_0xbe23,0x1cd));var _0x3be2=function(_0x51a87b,_0x3e5505){_0x51a87b=_0x51a87b-0x0;var _0xf7bdd9=_0xbe23[_0x51a87b];return _0xf7bdd9;};'use strict';var _=require('lodash');var util=require(_0x3be2('0x0'));var logger=require(_0x3be2('0x1'))(_0x3be2('0x2'));var moment=require(_0x3be2('0x3'));var BPromise=require(_0x3be2('0x4'));var rp=require(_0x3be2('0x5'));var fs=require('fs');var path=require(_0x3be2('0x6'));var rimraf=require(_0x3be2('0x7'));var config=require('../../config/environment');var attributes=require(_0x3be2('0x8'));module[_0x3be2('0x9')]=function(_0x3a5cba,_0x8d9bde){return _0x3a5cba[_0x3be2('0xa')](_0x3be2('0xb'),attributes,{'tableName':'sms_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.rpc.js b/server/api/smsAccount/smsAccount.rpc.js index ec20835..527e91f 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 _0x7b13=['request','then','SmsAccount,\x20%s,\x20%s','request\x20sent','SmsAccount,\x20%s,\x20%s,\x20%s','error','message','info','catch','ShowSmsAccount','SmsAccount','find','options','where','attributes','include','model','map','stringify','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./smsAccount.socket','register'];(function(_0xe2c95e,_0x3e6545){var _0x42ce6f=function(_0x218482){while(--_0x218482){_0xe2c95e['push'](_0xe2c95e['shift']());}};_0x42ce6f(++_0x3e6545);}(_0x7b13,0x11d));var _0x37b1=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x7b13[_0x167cc1];return _0x10bc4b;};'use strict';var _=require(_0x37b1('0x0'));var util=require(_0x37b1('0x1'));var moment=require(_0x37b1('0x2'));var BPromise=require(_0x37b1('0x3'));var rs=require(_0x37b1('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x37b1('0x5'))['db'];var utils=require(_0x37b1('0x6'));var logger=require(_0x37b1('0x7'))(_0x37b1('0x8'));var config=require(_0x37b1('0x9'));var jayson=require(_0x37b1('0xa'));var client=jayson[_0x37b1('0xb')][_0x37b1('0xc')]({'port':0x232a});config[_0x37b1('0xd')]=_[_0x37b1('0xe')](config['redis'],{'host':_0x37b1('0xf'),'port':0x18eb});var socket=require(_0x37b1('0x10'))(new Redis(config[_0x37b1('0xd')]));require(_0x37b1('0x11'))[_0x37b1('0x12')](socket);function respondWithRpcPromise(_0x453836,_0x38eae7,_0x285baf){return new BPromise(function(_0x14b297,_0x44f402){return client[_0x37b1('0x13')](_0x453836,_0x285baf)[_0x37b1('0x14')](function(_0x6d73aa){logger['info'](_0x37b1('0x15'),_0x38eae7,_0x37b1('0x16'));logger['debug'](_0x37b1('0x17'),_0x38eae7,_0x37b1('0x16'),JSON['stringify'](_0x6d73aa));if(_0x6d73aa['error']){if(_0x6d73aa[_0x37b1('0x18')]['code']===0x1f4){logger['error'](_0x37b1('0x15'),_0x38eae7,_0x6d73aa['error'][_0x37b1('0x19')]);return _0x44f402(_0x6d73aa[_0x37b1('0x18')]['message']);}logger['error'](_0x37b1('0x15'),_0x38eae7,_0x6d73aa[_0x37b1('0x18')][_0x37b1('0x19')]);return _0x14b297(_0x6d73aa[_0x37b1('0x18')][_0x37b1('0x19')]);}else{logger[_0x37b1('0x1a')](_0x37b1('0x15'),_0x38eae7,_0x37b1('0x16'));_0x14b297(_0x6d73aa['result'][_0x37b1('0x19')]);}})[_0x37b1('0x1b')](function(_0x2d4619){logger[_0x37b1('0x18')](_0x37b1('0x15'),_0x38eae7,_0x2d4619);_0x44f402(_0x2d4619);});});}exports[_0x37b1('0x1c')]=function(_0x3852a6){var _0xfd219=this;return new Promise(function(_0x9bfc17,_0x1b0660){return db[_0x37b1('0x1d')][_0x37b1('0x1e')]({'raw':_0x3852a6['options']?_0x3852a6['options']['raw']===undefined?!![]:![]:!![],'where':_0x3852a6[_0x37b1('0x1f')]?_0x3852a6['options'][_0x37b1('0x20')]||null:null,'attributes':_0x3852a6['options']?_0x3852a6[_0x37b1('0x1f')][_0x37b1('0x21')]||null:null,'include':_0x3852a6[_0x37b1('0x1f')]?_0x3852a6['options'][_0x37b1('0x22')]?_['map'](_0x3852a6[_0x37b1('0x1f')][_0x37b1('0x22')],function(_0x281649){return{'model':db[_0x281649[_0x37b1('0x23')]],'as':_0x281649['as'],'attributes':_0x281649[_0x37b1('0x21')],'include':_0x281649[_0x37b1('0x22')]?_[_0x37b1('0x24')](_0x281649['include'],function(_0x756d03){return{'model':db[_0x756d03['model']],'as':_0x756d03['as'],'attributes':_0x756d03[_0x37b1('0x21')],'include':_0x756d03[_0x37b1('0x22')]?_[_0x37b1('0x24')](_0x756d03['include'],function(_0x42ac31){return{'model':db[_0x42ac31['model']],'as':_0x42ac31['as'],'attributes':_0x42ac31[_0x37b1('0x21')]};}):[]};}):[]};}):[]:[]})[_0x37b1('0x14')](function(_0x319cb7){logger[_0x37b1('0x1a')](_0x37b1('0x1c'),_0x3852a6);logger['debug'](_0x37b1('0x1c'),_0x3852a6,JSON[_0x37b1('0x25')](_0x319cb7));_0x9bfc17(_0x319cb7);})[_0x37b1('0x1b')](function(_0xbb8103){logger['error'](_0x37b1('0x1c'),_0xbb8103[_0x37b1('0x19')],_0x3852a6);_0x1b0660(_0xfd219[_0x37b1('0x18')](0x1f4,_0xbb8103['message']));});});}; \ No newline at end of file +var _0x6a49=['client','http','redis','defaults','localhost','socket.io-emitter','./smsAccount.socket','register','request','then','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','ShowSmsAccount','options','raw','where','attributes','include','map','model','lodash','util','moment','bluebird','../../mysqldb','../../config/logger','../../config/environment','jayson/promise'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x6a49,0xca));var _0x96a4=function(_0x14c29a,_0x665f77){_0x14c29a=_0x14c29a-0x0;var _0x3c072d=_0x6a49[_0x14c29a];return _0x3c072d;};'use strict';var _=require(_0x96a4('0x0'));var util=require(_0x96a4('0x1'));var moment=require(_0x96a4('0x2'));var BPromise=require(_0x96a4('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x96a4('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x96a4('0x5'))('rpc');var config=require(_0x96a4('0x6'));var jayson=require(_0x96a4('0x7'));var client=jayson[_0x96a4('0x8')][_0x96a4('0x9')]({'port':0x232a});config[_0x96a4('0xa')]=_[_0x96a4('0xb')](config[_0x96a4('0xa')],{'host':_0x96a4('0xc'),'port':0x18eb});var socket=require(_0x96a4('0xd'))(new Redis(config['redis']));require(_0x96a4('0xe'))[_0x96a4('0xf')](socket);function respondWithRpcPromise(_0x5d67fa,_0x2a0014,_0x5ecf40){return new BPromise(function(_0x5d495a,_0x2ebcce){return client[_0x96a4('0x10')](_0x5d67fa,_0x5ecf40)[_0x96a4('0x11')](function(_0x4a7cb8){logger['info'](_0x96a4('0x12'),_0x2a0014,_0x96a4('0x13'));logger[_0x96a4('0x14')](_0x96a4('0x15'),_0x2a0014,_0x96a4('0x13'),JSON[_0x96a4('0x16')](_0x4a7cb8));if(_0x4a7cb8[_0x96a4('0x17')]){if(_0x4a7cb8[_0x96a4('0x17')]['code']===0x1f4){logger[_0x96a4('0x17')](_0x96a4('0x12'),_0x2a0014,_0x4a7cb8['error'][_0x96a4('0x18')]);return _0x2ebcce(_0x4a7cb8[_0x96a4('0x17')][_0x96a4('0x18')]);}logger[_0x96a4('0x17')]('SmsAccount,\x20%s,\x20%s',_0x2a0014,_0x4a7cb8['error'][_0x96a4('0x18')]);return _0x5d495a(_0x4a7cb8['error'][_0x96a4('0x18')]);}else{logger[_0x96a4('0x19')](_0x96a4('0x12'),_0x2a0014,_0x96a4('0x13'));_0x5d495a(_0x4a7cb8[_0x96a4('0x1a')][_0x96a4('0x18')]);}})['catch'](function(_0x3ac80d){logger['error'](_0x96a4('0x12'),_0x2a0014,_0x3ac80d);_0x2ebcce(_0x3ac80d);});});}exports[_0x96a4('0x1b')]=function(_0x329df0){var _0x5cb3d0=this;return new Promise(function(_0xd19317,_0xc4b31d){return db['SmsAccount']['find']({'raw':_0x329df0[_0x96a4('0x1c')]?_0x329df0[_0x96a4('0x1c')][_0x96a4('0x1d')]===undefined?!![]:![]:!![],'where':_0x329df0[_0x96a4('0x1c')]?_0x329df0['options'][_0x96a4('0x1e')]||null:null,'attributes':_0x329df0['options']?_0x329df0['options'][_0x96a4('0x1f')]||null:null,'include':_0x329df0['options']?_0x329df0[_0x96a4('0x1c')][_0x96a4('0x20')]?_[_0x96a4('0x21')](_0x329df0['options'][_0x96a4('0x20')],function(_0x443194){return{'model':db[_0x443194[_0x96a4('0x22')]],'as':_0x443194['as'],'attributes':_0x443194[_0x96a4('0x1f')],'include':_0x443194[_0x96a4('0x20')]?_[_0x96a4('0x21')](_0x443194['include'],function(_0x28d49f){return{'model':db[_0x28d49f[_0x96a4('0x22')]],'as':_0x28d49f['as'],'attributes':_0x28d49f['attributes'],'include':_0x28d49f[_0x96a4('0x20')]?_['map'](_0x28d49f[_0x96a4('0x20')],function(_0x35a31f){return{'model':db[_0x35a31f[_0x96a4('0x22')]],'as':_0x35a31f['as'],'attributes':_0x35a31f[_0x96a4('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x96a4('0x11')](function(_0x35d62e){logger[_0x96a4('0x19')]('ShowSmsAccount',_0x329df0);logger[_0x96a4('0x14')](_0x96a4('0x1b'),_0x329df0,JSON[_0x96a4('0x16')](_0x35d62e));_0xd19317(_0x35d62e);})['catch'](function(_0x3ece07){logger[_0x96a4('0x17')]('ShowSmsAccount',_0x3ece07[_0x96a4('0x18')],_0x329df0);_0xc4b31d(_0x5cb3d0['error'](0x1f4,_0x3ece07[_0x96a4('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.socket.js b/server/api/smsAccount/smsAccount.socket.js index bf899a1..af046dc 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(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4154a6,_0x2c0b8e){_0x4154a6=_0x4154a6-0x0;var _0x3b2786=_0xa9e0[_0x4154a6];return _0x3b2786;};'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 5ef1cc3..ce30f25 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 _0x7217=['Router','fs-extra','../../config/environment','./smsApplication.controller','get','isAuthenticated','index','/:id','show','post','create','put','delete','destroy','exports','multer','path','connect-timeout','express'];(function(_0x5eb4fa,_0x29ab44){var _0x45a211=function(_0x99075d){while(--_0x99075d){_0x5eb4fa['push'](_0x5eb4fa['shift']());}};_0x45a211(++_0x29ab44);}(_0x7217,0x19e));var _0x7721=function(_0x3b5250,_0x7a0b2c){_0x3b5250=_0x3b5250-0x0;var _0xc844a1=_0x7217[_0x3b5250];return _0xc844a1;};'use strict';var multer=require(_0x7721('0x0'));var util=require('util');var path=require(_0x7721('0x1'));var timeout=require(_0x7721('0x2'));var express=require(_0x7721('0x3'));var router=express[_0x7721('0x4')]();var fs_extra=require(_0x7721('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x7721('0x6'));var controller=require(_0x7721('0x7'));router[_0x7721('0x8')]('/',auth[_0x7721('0x9')](),controller[_0x7721('0xa')]);router[_0x7721('0x8')](_0x7721('0xb'),auth[_0x7721('0x9')](),controller[_0x7721('0xc')]);router[_0x7721('0xd')]('/',auth[_0x7721('0x9')](),controller[_0x7721('0xe')]);router[_0x7721('0xf')](_0x7721('0xb'),auth[_0x7721('0x9')](),controller['update']);router[_0x7721('0x10')](_0x7721('0xb'),auth[_0x7721('0x9')](),controller[_0x7721('0x11')]);module[_0x7721('0x12')]=router; \ No newline at end of file +var _0x7217=['Router','fs-extra','../../config/environment','./smsApplication.controller','get','isAuthenticated','index','/:id','show','post','create','put','delete','destroy','exports','multer','path','connect-timeout','express'];(function(_0x30fe10,_0x3996dc){var _0x4a2f42=function(_0x4147b9){while(--_0x4147b9){_0x30fe10['push'](_0x30fe10['shift']());}};_0x4a2f42(++_0x3996dc);}(_0x7217,0x19e));var _0x7721=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x7217[_0x2dafbe];return _0x58a45a;};'use strict';var multer=require(_0x7721('0x0'));var util=require('util');var path=require(_0x7721('0x1'));var timeout=require(_0x7721('0x2'));var express=require(_0x7721('0x3'));var router=express[_0x7721('0x4')]();var fs_extra=require(_0x7721('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x7721('0x6'));var controller=require(_0x7721('0x7'));router[_0x7721('0x8')]('/',auth[_0x7721('0x9')](),controller[_0x7721('0xa')]);router[_0x7721('0x8')](_0x7721('0xb'),auth[_0x7721('0x9')](),controller[_0x7721('0xc')]);router[_0x7721('0xd')]('/',auth[_0x7721('0x9')](),controller[_0x7721('0xe')]);router[_0x7721('0xf')](_0x7721('0xb'),auth[_0x7721('0x9')](),controller['update']);router[_0x7721('0x10')](_0x7721('0xb'),auth[_0x7721('0x9')](),controller[_0x7721('0x11')]);module[_0x7721('0x12')]=router; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.attributes.js b/server/api/smsApplication/smsApplication.attributes.js index ad9ad3a..31d0bc2 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 _0x4feb=['*,*,*,*','sequelize','exports','INTEGER','STRING','noop','TEXT'];(function(_0x138adb,_0x193fee){var _0x1b27f2=function(_0x5e97a2){while(--_0x5e97a2){_0x138adb['push'](_0x138adb['shift']());}};_0x1b27f2(++_0x193fee);}(_0x4feb,0x190));var _0xb4fe=function(_0x426f3c,_0x5c7024){_0x426f3c=_0x426f3c-0x0;var _0x38569c=_0x4feb[_0x426f3c];return _0x38569c;};'use strict';var Sequelize=require(_0xb4fe('0x0'));module[_0xb4fe('0x1')]={'priority':{'type':Sequelize[_0xb4fe('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0xb4fe('0x3')],'allowNull':![],'defaultValue':_0xb4fe('0x4')},'appdata':{'type':Sequelize[_0xb4fe('0x5')]()},'description':{'type':Sequelize[_0xb4fe('0x3')]},'interval':{'type':Sequelize[_0xb4fe('0x3')],'defaultValue':_0xb4fe('0x6')}}; \ No newline at end of file +var _0x4024=['STRING','*,*,*,*','sequelize'];(function(_0xbd53a0,_0x59d902){var _0x24bab8=function(_0x5a05d5){while(--_0x5a05d5){_0xbd53a0['push'](_0xbd53a0['shift']());}};_0x24bab8(++_0x59d902);}(_0x4024,0x146));var _0x4402=function(_0xee2e36,_0x4aef6e){_0xee2e36=_0xee2e36-0x0;var _0x4da65b=_0x4024[_0xee2e36];return _0x4da65b;};'use strict';var Sequelize=require(_0x4402('0x0'));module['exports']={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x4402('0x1')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x4402('0x1')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0x4402('0x2')}}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.controller.js b/server/api/smsApplication/smsApplication.controller.js index 94a1e72..d830356 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 _0x0eb4=['pick','filter','where','merge','options','SmsApplication','findAll','show','includeAll','include','find','catch','create','body','params','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','jsforce','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','limit','undefined','count','set','Content-Range','json','apply','reject','save','update','destroy','then','error','stack','name','send','index','map','fieldName','type','keys','intersection','model','query','attributes','fields','length','hasOwnProperty','nolimit','sort','filters'];(function(_0xbd08b4,_0x4790ed){var _0x314f1e=function(_0x161589){while(--_0x161589){_0xbd08b4['push'](_0xbd08b4['shift']());}};_0x314f1e(++_0x4790ed);}(_0x0eb4,0x133));var _0x40eb=function(_0x4148b9,_0x1fd160){_0x4148b9=_0x4148b9-0x0;var _0x1f6ec8=_0x0eb4[_0x4148b9];return _0x1f6ec8;};'use strict';var emlformat=require(_0x40eb('0x0'));var rimraf=require(_0x40eb('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x40eb('0x2'));var moment=require(_0x40eb('0x3'));var BPromise=require(_0x40eb('0x4'));var Mustache=require(_0x40eb('0x5'));var util=require(_0x40eb('0x6'));var path=require(_0x40eb('0x7'));var sox=require(_0x40eb('0x8'));var csv=require(_0x40eb('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x40eb('0xa'));var _=require(_0x40eb('0xb'));var squel=require(_0x40eb('0xc'));var crypto=require('crypto');var jsforce=require(_0x40eb('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x40eb('0x9'));var querystring=require('querystring');var Papa=require(_0x40eb('0xe'));var Redis=require(_0x40eb('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x40eb('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x40eb('0x11'));var logger=require('../../config/logger')(_0x40eb('0x12'));var utils=require(_0x40eb('0x13'));var config=require(_0x40eb('0x14'));var licenseUtil=require(_0x40eb('0x15'));var db=require(_0x40eb('0x16'))['db'];function respondWithStatusCode(_0x3378c1,_0x2eacdc){_0x2eacdc=_0x2eacdc||0xcc;return function(_0xb14b66){if(_0xb14b66){return _0x3378c1[_0x40eb('0x17')](_0x2eacdc);}return _0x3378c1[_0x40eb('0x18')](_0x2eacdc)[_0x40eb('0x19')]();};}function respondWithResult(_0x2ff22b,_0x11f8d7){_0x11f8d7=_0x11f8d7||0xc8;return function(_0x23f7d5){if(_0x23f7d5){return _0x2ff22b[_0x40eb('0x18')](_0x11f8d7)['json'](_0x23f7d5);}};}function respondWithFilteredResult(_0x47b6e3,_0x28e123){return function(_0x3c470d){if(_0x3c470d){var _0x1c359a=typeof _0x28e123[_0x40eb('0x1a')]==='undefined'&&typeof _0x28e123[_0x40eb('0x1b')]===_0x40eb('0x1c');var _0x354417=_0x3c470d[_0x40eb('0x1d')];var _0x4856bb=_0x1c359a?0x0:_0x28e123[_0x40eb('0x1a')];var _0xd56ce7=_0x1c359a?_0x3c470d[_0x40eb('0x1d')]:_0x28e123[_0x40eb('0x1a')]+_0x28e123[_0x40eb('0x1b')];var _0x3f79b9;if(_0xd56ce7>=_0x354417){_0xd56ce7=_0x354417;_0x3f79b9=0xc8;}else{_0x3f79b9=0xce;}_0x47b6e3[_0x40eb('0x18')](_0x3f79b9);return _0x47b6e3[_0x40eb('0x1e')](_0x40eb('0x1f'),_0x4856bb+'-'+_0xd56ce7+'/'+_0x354417)[_0x40eb('0x20')](_0x3c470d);}return null;};}function patchUpdates(_0x4dd342){return function(_0x5206c8){try{jsonpatch[_0x40eb('0x21')](_0x5206c8,_0x4dd342,!![]);}catch(_0x1c00ba){return BPromise[_0x40eb('0x22')](_0x1c00ba);}return _0x5206c8[_0x40eb('0x23')]();};}function saveUpdates(_0x413ae1,_0x34b6cf){return function(_0x35a7ad){if(_0x35a7ad){return _0x35a7ad[_0x40eb('0x24')](_0x413ae1)['then'](function(_0x28b63b){return _0x28b63b;});}return null;};}function removeEntity(_0x2763f0,_0x2bfedf){return function(_0x29892b){if(_0x29892b){return _0x29892b[_0x40eb('0x25')]()[_0x40eb('0x26')](function(){_0x2763f0[_0x40eb('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x167647,_0x2b8874){return function(_0x4e69aa){if(!_0x4e69aa){_0x167647[_0x40eb('0x17')](0x194);}return _0x4e69aa;};}function handleError(_0x28c33b,_0x52ff4a){_0x52ff4a=_0x52ff4a||0x1f4;return function(_0x1313b6){logger[_0x40eb('0x27')](_0x1313b6[_0x40eb('0x28')]);if(_0x1313b6['name']){delete _0x1313b6[_0x40eb('0x29')];}_0x28c33b['status'](_0x52ff4a)[_0x40eb('0x2a')](_0x1313b6);};}exports[_0x40eb('0x2b')]=function(_0x14ef90,_0x476fdc){var _0x56d2f4={},_0x481d9c={},_0x1577ff={'count':0x0,'rows':[]};var _0x450621=_[_0x40eb('0x2c')](db['SmsApplication']['rawAttributes'],function(_0x3de04e){return{'name':_0x3de04e[_0x40eb('0x2d')],'type':_0x3de04e[_0x40eb('0x2e')]['key']};});_0x481d9c['model']=_[_0x40eb('0x2c')](_0x450621,_0x40eb('0x29'));_0x481d9c['query']=_[_0x40eb('0x2f')](_0x14ef90['query']);_0x481d9c['filters']=_[_0x40eb('0x30')](_0x481d9c[_0x40eb('0x31')],_0x481d9c[_0x40eb('0x32')]);_0x56d2f4[_0x40eb('0x33')]=_['intersection'](_0x481d9c[_0x40eb('0x31')],qs[_0x40eb('0x34')](_0x14ef90['query'][_0x40eb('0x34')]));_0x56d2f4['attributes']=_0x56d2f4[_0x40eb('0x33')][_0x40eb('0x35')]?_0x56d2f4[_0x40eb('0x33')]:_0x481d9c[_0x40eb('0x31')];if(!_0x14ef90[_0x40eb('0x32')][_0x40eb('0x36')](_0x40eb('0x37'))){_0x56d2f4['limit']=qs[_0x40eb('0x1b')](_0x14ef90['query'][_0x40eb('0x1b')]);_0x56d2f4[_0x40eb('0x1a')]=qs[_0x40eb('0x1a')](_0x14ef90[_0x40eb('0x32')][_0x40eb('0x1a')]);}_0x56d2f4['order']=qs[_0x40eb('0x38')](_0x14ef90['query'][_0x40eb('0x38')]);_0x56d2f4['where']=qs[_0x40eb('0x39')](_[_0x40eb('0x3a')](_0x14ef90[_0x40eb('0x32')],_0x481d9c[_0x40eb('0x39')]),_0x450621);if(_0x14ef90[_0x40eb('0x32')][_0x40eb('0x3b')]){_0x56d2f4[_0x40eb('0x3c')]=_[_0x40eb('0x3d')](_0x56d2f4['where'],{'$or':_[_0x40eb('0x2c')](_0x450621,function(_0x7d4d8f){if(_0x7d4d8f['type']!=='VIRTUAL'){var _0xcfe4f4={};_0xcfe4f4[_0x7d4d8f['name']]={'$like':'%'+_0x14ef90[_0x40eb('0x32')][_0x40eb('0x3b')]+'%'};return _0xcfe4f4;}})});}_0x56d2f4=_[_0x40eb('0x3d')]({},_0x56d2f4,_0x14ef90[_0x40eb('0x3e')]);var _0x3b9961={'where':_0x56d2f4[_0x40eb('0x3c')]};return db[_0x40eb('0x3f')][_0x40eb('0x1d')](_0x3b9961)[_0x40eb('0x26')](function(_0xcb3285){_0x1577ff['count']=_0xcb3285;if(_0x14ef90[_0x40eb('0x32')]['includeAll']){_0x56d2f4['include']=[{'all':!![]}];}return db['SmsApplication'][_0x40eb('0x40')](_0x56d2f4);})[_0x40eb('0x26')](function(_0x4317db){_0x1577ff['rows']=_0x4317db;return _0x1577ff;})[_0x40eb('0x26')](respondWithFilteredResult(_0x476fdc,_0x56d2f4))['catch'](handleError(_0x476fdc,null));};exports[_0x40eb('0x41')]=function(_0x2c7c60,_0x3fda20){var _0x32a3c1={'raw':!![],'where':{'id':_0x2c7c60['params']['id']}},_0x5e767d={};_0x5e767d['model']=_['keys'](db[_0x40eb('0x3f')]['rawAttributes']);_0x5e767d['query']=_[_0x40eb('0x2f')](_0x2c7c60[_0x40eb('0x32')]);_0x5e767d[_0x40eb('0x39')]=_[_0x40eb('0x30')](_0x5e767d[_0x40eb('0x31')],_0x5e767d[_0x40eb('0x32')]);_0x32a3c1['attributes']=_[_0x40eb('0x30')](_0x5e767d['model'],qs[_0x40eb('0x34')](_0x2c7c60[_0x40eb('0x32')][_0x40eb('0x34')]));_0x32a3c1[_0x40eb('0x33')]=_0x32a3c1[_0x40eb('0x33')]['length']?_0x32a3c1[_0x40eb('0x33')]:_0x5e767d[_0x40eb('0x31')];if(_0x2c7c60[_0x40eb('0x32')][_0x40eb('0x42')]){_0x32a3c1[_0x40eb('0x43')]=[{'all':!![]}];}_0x32a3c1=_[_0x40eb('0x3d')]({},_0x32a3c1,_0x2c7c60[_0x40eb('0x3e')]);return db['SmsApplication'][_0x40eb('0x44')](_0x32a3c1)[_0x40eb('0x26')](handleEntityNotFound(_0x3fda20,null))[_0x40eb('0x26')](respondWithResult(_0x3fda20,null))[_0x40eb('0x45')](handleError(_0x3fda20,null));};exports['create']=function(_0x1d70b6,_0x53b3fc){return db[_0x40eb('0x3f')][_0x40eb('0x46')](_0x1d70b6[_0x40eb('0x47')],{})['then'](respondWithResult(_0x53b3fc,0xc9))[_0x40eb('0x45')](handleError(_0x53b3fc,null));};exports['update']=function(_0x23904a,_0x108279){if(_0x23904a[_0x40eb('0x47')]['id']){delete _0x23904a['body']['id'];}return db[_0x40eb('0x3f')][_0x40eb('0x44')]({'where':{'id':_0x23904a['params']['id']}})[_0x40eb('0x26')](handleEntityNotFound(_0x108279,null))[_0x40eb('0x26')](saveUpdates(_0x23904a[_0x40eb('0x47')],null))[_0x40eb('0x26')](respondWithResult(_0x108279,null))['catch'](handleError(_0x108279,null));};exports[_0x40eb('0x25')]=function(_0x2d7fa9,_0x20b09c){return db[_0x40eb('0x3f')][_0x40eb('0x44')]({'where':{'id':_0x2d7fa9[_0x40eb('0x48')]['id']}})[_0x40eb('0x26')](handleEntityNotFound(_0x20b09c,null))[_0x40eb('0x26')](removeEntity(_0x20b09c,null))[_0x40eb('0x45')](handleError(_0x20b09c,null));}; \ No newline at end of file +var _0x57a9=['api','../../config/utils','../../config/environment','sendStatus','status','end','json','offset','undefined','count','limit','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','SmsApplication','fieldName','query','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','type','options','includeAll','catch','keys','rawAttributes','include','find','create','body','params','eml-format','rimraf','fast-json-patch','request-promise','mustache','util','path','sox','ejs','fs-extra','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger'];(function(_0x8c43de,_0x90ff31){var _0xa6591b=function(_0x469716){while(--_0x469716){_0x8c43de['push'](_0x8c43de['shift']());}};_0xa6591b(++_0x90ff31);}(_0x57a9,0x1e4));var _0x957a=function(_0x520b68,_0x2fcb88){_0x520b68=_0x520b68-0x0;var _0x4ecfc7=_0x57a9[_0x520b68];return _0x4ecfc7;};'use strict';var emlformat=require(_0x957a('0x0'));var rimraf=require(_0x957a('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x957a('0x2'));var rp=require(_0x957a('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x957a('0x4'));var util=require(_0x957a('0x5'));var path=require(_0x957a('0x6'));var sox=require(_0x957a('0x7'));var csv=require('to-csv');var ejs=require(_0x957a('0x8'));var fs=require('fs');var fs_extra=require(_0x957a('0x9'));var _=require('lodash');var squel=require(_0x957a('0xa'));var crypto=require(_0x957a('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x957a('0xc'));var Papa=require(_0x957a('0xd'));var Redis=require(_0x957a('0xe'));var authService=require(_0x957a('0xf'));var qs=require(_0x957a('0x10'));var as=require(_0x957a('0x11'));var hardwareService=require(_0x957a('0x12'));var logger=require(_0x957a('0x13'))(_0x957a('0x14'));var utils=require(_0x957a('0x15'));var config=require(_0x957a('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4300f8,_0x1aaafe){_0x1aaafe=_0x1aaafe||0xcc;return function(_0x1d2a13){if(_0x1d2a13){return _0x4300f8[_0x957a('0x17')](_0x1aaafe);}return _0x4300f8[_0x957a('0x18')](_0x1aaafe)[_0x957a('0x19')]();};}function respondWithResult(_0x5a005d,_0x3fb30a){_0x3fb30a=_0x3fb30a||0xc8;return function(_0x569556){if(_0x569556){return _0x5a005d['status'](_0x3fb30a)[_0x957a('0x1a')](_0x569556);}};}function respondWithFilteredResult(_0x67cfa1,_0x2717ef){return function(_0x4271b9){if(_0x4271b9){var _0x53650b=typeof _0x2717ef[_0x957a('0x1b')]===_0x957a('0x1c')&&typeof _0x2717ef['limit']===_0x957a('0x1c');var _0x3ced85=_0x4271b9[_0x957a('0x1d')];var _0x33dc30=_0x53650b?0x0:_0x2717ef[_0x957a('0x1b')];var _0x326308=_0x53650b?_0x4271b9[_0x957a('0x1d')]:_0x2717ef[_0x957a('0x1b')]+_0x2717ef[_0x957a('0x1e')];var _0x2a3e37;if(_0x326308>=_0x3ced85){_0x326308=_0x3ced85;_0x2a3e37=0xc8;}else{_0x2a3e37=0xce;}_0x67cfa1['status'](_0x2a3e37);return _0x67cfa1['set'](_0x957a('0x1f'),_0x33dc30+'-'+_0x326308+'/'+_0x3ced85)['json'](_0x4271b9);}return null;};}function patchUpdates(_0x56fd3c){return function(_0x149978){try{jsonpatch[_0x957a('0x20')](_0x149978,_0x56fd3c,!![]);}catch(_0x5941a4){return BPromise[_0x957a('0x21')](_0x5941a4);}return _0x149978[_0x957a('0x22')]();};}function saveUpdates(_0x4a0c57,_0x36288f){return function(_0x4cccc6){if(_0x4cccc6){return _0x4cccc6[_0x957a('0x23')](_0x4a0c57)[_0x957a('0x24')](function(_0x36e139){return _0x36e139;});}return null;};}function removeEntity(_0x1340b8,_0x4d5b65){return function(_0x38a9b5){if(_0x38a9b5){return _0x38a9b5[_0x957a('0x25')]()[_0x957a('0x24')](function(){_0x1340b8[_0x957a('0x18')](0xcc)[_0x957a('0x19')]();});}};}function handleEntityNotFound(_0x2abd30,_0x391673){return function(_0x2d506f){if(!_0x2d506f){_0x2abd30['sendStatus'](0x194);}return _0x2d506f;};}function handleError(_0x2fc65a,_0x18c939){_0x18c939=_0x18c939||0x1f4;return function(_0x44da6d){logger[_0x957a('0x26')](_0x44da6d[_0x957a('0x27')]);if(_0x44da6d[_0x957a('0x28')]){delete _0x44da6d[_0x957a('0x28')];}_0x2fc65a['status'](_0x18c939)[_0x957a('0x29')](_0x44da6d);};}exports[_0x957a('0x2a')]=function(_0x3970c9,_0x2457a6){var _0x3c8ba1={},_0x284074={},_0x3edaef={'count':0x0,'rows':[]};var _0x279a94=_['map'](db[_0x957a('0x2b')]['rawAttributes'],function(_0x2a2b5e){return{'name':_0x2a2b5e[_0x957a('0x2c')],'type':_0x2a2b5e['type']['key']};});_0x284074['model']=_['map'](_0x279a94,'name');_0x284074['query']=_['keys'](_0x3970c9[_0x957a('0x2d')]);_0x284074[_0x957a('0x2e')]=_[_0x957a('0x2f')](_0x284074['model'],_0x284074[_0x957a('0x2d')]);_0x3c8ba1[_0x957a('0x30')]=_[_0x957a('0x2f')](_0x284074[_0x957a('0x31')],qs[_0x957a('0x32')](_0x3970c9[_0x957a('0x2d')][_0x957a('0x32')]));_0x3c8ba1[_0x957a('0x30')]=_0x3c8ba1[_0x957a('0x30')][_0x957a('0x33')]?_0x3c8ba1[_0x957a('0x30')]:_0x284074[_0x957a('0x31')];if(!_0x3970c9['query'][_0x957a('0x34')](_0x957a('0x35'))){_0x3c8ba1[_0x957a('0x1e')]=qs[_0x957a('0x1e')](_0x3970c9[_0x957a('0x2d')][_0x957a('0x1e')]);_0x3c8ba1[_0x957a('0x1b')]=qs[_0x957a('0x1b')](_0x3970c9[_0x957a('0x2d')][_0x957a('0x1b')]);}_0x3c8ba1[_0x957a('0x36')]=qs['sort'](_0x3970c9['query'][_0x957a('0x37')]);_0x3c8ba1[_0x957a('0x38')]=qs[_0x957a('0x2e')](_[_0x957a('0x39')](_0x3970c9[_0x957a('0x2d')],_0x284074[_0x957a('0x2e')]),_0x279a94);if(_0x3970c9['query'][_0x957a('0x3a')]){_0x3c8ba1[_0x957a('0x38')]=_[_0x957a('0x3b')](_0x3c8ba1[_0x957a('0x38')],{'$or':_[_0x957a('0x3c')](_0x279a94,function(_0x19be0e){if(_0x19be0e[_0x957a('0x3d')]!=='VIRTUAL'){var _0xa76955={};_0xa76955[_0x19be0e[_0x957a('0x28')]]={'$like':'%'+_0x3970c9[_0x957a('0x2d')][_0x957a('0x3a')]+'%'};return _0xa76955;}})});}_0x3c8ba1=_[_0x957a('0x3b')]({},_0x3c8ba1,_0x3970c9[_0x957a('0x3e')]);var _0x61bc39={'where':_0x3c8ba1[_0x957a('0x38')]};return db[_0x957a('0x2b')][_0x957a('0x1d')](_0x61bc39)['then'](function(_0x3a2ce2){_0x3edaef[_0x957a('0x1d')]=_0x3a2ce2;if(_0x3970c9[_0x957a('0x2d')][_0x957a('0x3f')]){_0x3c8ba1['include']=[{'all':!![]}];}return db['SmsApplication']['findAll'](_0x3c8ba1);})['then'](function(_0x5cac4e){_0x3edaef['rows']=_0x5cac4e;return _0x3edaef;})['then'](respondWithFilteredResult(_0x2457a6,_0x3c8ba1))[_0x957a('0x40')](handleError(_0x2457a6,null));};exports['show']=function(_0x44b7fc,_0x4eac7f){var _0x49dd8f={'raw':!![],'where':{'id':_0x44b7fc['params']['id']}},_0xd8bb69={};_0xd8bb69[_0x957a('0x31')]=_[_0x957a('0x41')](db[_0x957a('0x2b')][_0x957a('0x42')]);_0xd8bb69[_0x957a('0x2d')]=_[_0x957a('0x41')](_0x44b7fc['query']);_0xd8bb69[_0x957a('0x2e')]=_[_0x957a('0x2f')](_0xd8bb69['model'],_0xd8bb69[_0x957a('0x2d')]);_0x49dd8f[_0x957a('0x30')]=_['intersection'](_0xd8bb69[_0x957a('0x31')],qs[_0x957a('0x32')](_0x44b7fc[_0x957a('0x2d')][_0x957a('0x32')]));_0x49dd8f['attributes']=_0x49dd8f[_0x957a('0x30')]['length']?_0x49dd8f[_0x957a('0x30')]:_0xd8bb69['model'];if(_0x44b7fc[_0x957a('0x2d')][_0x957a('0x3f')]){_0x49dd8f[_0x957a('0x43')]=[{'all':!![]}];}_0x49dd8f=_[_0x957a('0x3b')]({},_0x49dd8f,_0x44b7fc[_0x957a('0x3e')]);return db[_0x957a('0x2b')][_0x957a('0x44')](_0x49dd8f)[_0x957a('0x24')](handleEntityNotFound(_0x4eac7f,null))[_0x957a('0x24')](respondWithResult(_0x4eac7f,null))[_0x957a('0x40')](handleError(_0x4eac7f,null));};exports[_0x957a('0x45')]=function(_0xcff332,_0x82f016){return db[_0x957a('0x2b')][_0x957a('0x45')](_0xcff332[_0x957a('0x46')],{})[_0x957a('0x24')](respondWithResult(_0x82f016,0xc9))[_0x957a('0x40')](handleError(_0x82f016,null));};exports[_0x957a('0x23')]=function(_0x3dc023,_0x78a65c){if(_0x3dc023[_0x957a('0x46')]['id']){delete _0x3dc023[_0x957a('0x46')]['id'];}return db[_0x957a('0x2b')][_0x957a('0x44')]({'where':{'id':_0x3dc023[_0x957a('0x47')]['id']}})['then'](handleEntityNotFound(_0x78a65c,null))[_0x957a('0x24')](saveUpdates(_0x3dc023['body'],null))[_0x957a('0x24')](respondWithResult(_0x78a65c,null))[_0x957a('0x40')](handleError(_0x78a65c,null));};exports['destroy']=function(_0x700aba,_0x3f9dfc){return db[_0x957a('0x2b')][_0x957a('0x44')]({'where':{'id':_0x700aba[_0x957a('0x47')]['id']}})[_0x957a('0x24')](handleEntityNotFound(_0x3f9dfc,null))['then'](removeEntity(_0x3f9dfc,null))[_0x957a('0x40')](handleError(_0x3f9dfc,null));}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.model.js b/server/api/smsApplication/smsApplication.model.js index a5ebde9..398720e 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 _0x86ae=['utf8mb4_unicode_ci','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./smsApplication.attributes','exports','define','SmsApplication','sms_applications'];(function(_0x172236,_0x33868e){var _0x371f36=function(_0x23ba41){while(--_0x23ba41){_0x172236['push'](_0x172236['shift']());}};_0x371f36(++_0x33868e);}(_0x86ae,0x160));var _0xe86a=function(_0x265668,_0x46f931){_0x265668=_0x265668-0x0;var _0x3b700b=_0x86ae[_0x265668];return _0x3b700b;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xe86a('0x0'))(_0xe86a('0x1'));var moment=require(_0xe86a('0x2'));var BPromise=require('bluebird');var rp=require(_0xe86a('0x3'));var fs=require('fs');var path=require(_0xe86a('0x4'));var rimraf=require(_0xe86a('0x5'));var config=require(_0xe86a('0x6'));var attributes=require(_0xe86a('0x7'));module[_0xe86a('0x8')]=function(_0x22b3e2,_0x299db8){return _0x22b3e2[_0xe86a('0x9')](_0xe86a('0xa'),attributes,{'tableName':_0xe86a('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xe86a('0xc')});}; \ No newline at end of file +var _0x72b1=['path','rimraf','./smsApplication.attributes','exports','SmsApplication','utf8mb4','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x30ae5e,_0x391fc4){var _0x1f2e93=function(_0x60307d){while(--_0x60307d){_0x30ae5e['push'](_0x30ae5e['shift']());}};_0x1f2e93(++_0x391fc4);}(_0x72b1,0x16e));var _0x172b=function(_0x449e,_0x1afd6b){_0x449e=_0x449e-0x0;var _0x8fab81=_0x72b1[_0x449e];return _0x8fab81;};'use strict';var _=require(_0x172b('0x0'));var util=require('util');var logger=require(_0x172b('0x1'))(_0x172b('0x2'));var moment=require(_0x172b('0x3'));var BPromise=require(_0x172b('0x4'));var rp=require(_0x172b('0x5'));var fs=require('fs');var path=require(_0x172b('0x6'));var rimraf=require(_0x172b('0x7'));var config=require('../../config/environment');var attributes=require(_0x172b('0x8'));module[_0x172b('0x9')]=function(_0x475fd6,_0x222624){return _0x475fd6['define'](_0x172b('0xa'),attributes,{'tableName':'sms_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x172b('0xb'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.rpc.js b/server/api/smsApplication/smsApplication.rpc.js index 671576a..d6b53eb 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 _0xe3b3=['info','SmsApplication,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then'];(function(_0x242eff,_0xa5cfff){var _0x4083bc=function(_0x2b0e42){while(--_0x2b0e42){_0x242eff['push'](_0x242eff['shift']());}};_0x4083bc(++_0xa5cfff);}(_0xe3b3,0x1b3));var _0x3e3b=function(_0x4ff9c7,_0x449097){_0x4ff9c7=_0x4ff9c7-0x0;var _0x4d3c63=_0xe3b3[_0x4ff9c7];return _0x4d3c63;};'use strict';var _=require(_0x3e3b('0x0'));var util=require(_0x3e3b('0x1'));var moment=require(_0x3e3b('0x2'));var BPromise=require(_0x3e3b('0x3'));var rs=require(_0x3e3b('0x4'));var fs=require('fs');var Redis=require(_0x3e3b('0x5'));var db=require(_0x3e3b('0x6'))['db'];var utils=require(_0x3e3b('0x7'));var logger=require(_0x3e3b('0x8'))(_0x3e3b('0x9'));var config=require('../../config/environment');var jayson=require(_0x3e3b('0xa'));var client=jayson[_0x3e3b('0xb')][_0x3e3b('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x57c8f9,_0x11ed30,_0x46c928){return new BPromise(function(_0x3d7821,_0x3491a7){return client[_0x3e3b('0xd')](_0x57c8f9,_0x46c928)[_0x3e3b('0xe')](function(_0x214205){logger[_0x3e3b('0xf')](_0x3e3b('0x10'),_0x11ed30,'request\x20sent');logger[_0x3e3b('0x11')]('SmsApplication,\x20%s,\x20%s,\x20%s',_0x11ed30,_0x3e3b('0x12'),JSON[_0x3e3b('0x13')](_0x214205));if(_0x214205[_0x3e3b('0x14')]){if(_0x214205[_0x3e3b('0x14')][_0x3e3b('0x15')]===0x1f4){logger[_0x3e3b('0x14')](_0x3e3b('0x10'),_0x11ed30,_0x214205[_0x3e3b('0x14')][_0x3e3b('0x16')]);return _0x3491a7(_0x214205[_0x3e3b('0x14')][_0x3e3b('0x16')]);}logger[_0x3e3b('0x14')](_0x3e3b('0x10'),_0x11ed30,_0x214205[_0x3e3b('0x14')][_0x3e3b('0x16')]);return _0x3d7821(_0x214205[_0x3e3b('0x14')][_0x3e3b('0x16')]);}else{logger['info'](_0x3e3b('0x10'),_0x11ed30,'request\x20sent');_0x3d7821(_0x214205[_0x3e3b('0x17')][_0x3e3b('0x16')]);}})[_0x3e3b('0x18')](function(_0x5a36e3){logger['error']('SmsApplication,\x20%s,\x20%s',_0x11ed30,_0x5a36e3);_0x3491a7(_0x5a36e3);});});} \ No newline at end of file +var _0xa0a3=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SmsApplication,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','util','moment','randomstring','ioredis'];(function(_0xf8320,_0x72706b){var _0xfe70e3=function(_0x189fc9){while(--_0x189fc9){_0xf8320['push'](_0xf8320['shift']());}};_0xfe70e3(++_0x72706b);}(_0xa0a3,0x1e0));var _0x3a0a=function(_0x213cab,_0x30bcbf){_0x213cab=_0x213cab-0x0;var _0x329fa8=_0xa0a3[_0x213cab];return _0x329fa8;};'use strict';var _=require('lodash');var util=require(_0x3a0a('0x0'));var moment=require(_0x3a0a('0x1'));var BPromise=require('bluebird');var rs=require(_0x3a0a('0x2'));var fs=require('fs');var Redis=require(_0x3a0a('0x3'));var db=require(_0x3a0a('0x4'))['db'];var utils=require(_0x3a0a('0x5'));var logger=require(_0x3a0a('0x6'))(_0x3a0a('0x7'));var config=require(_0x3a0a('0x8'));var jayson=require(_0x3a0a('0x9'));var client=jayson[_0x3a0a('0xa')][_0x3a0a('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4719d,_0x451873,_0x1766c1){return new BPromise(function(_0x5d98d3,_0x56ee1b){return client[_0x3a0a('0xc')](_0x4719d,_0x1766c1)[_0x3a0a('0xd')](function(_0x29207e){logger[_0x3a0a('0xe')](_0x3a0a('0xf'),_0x451873,_0x3a0a('0x10'));logger[_0x3a0a('0x11')]('SmsApplication,\x20%s,\x20%s,\x20%s',_0x451873,'request\x20sent',JSON[_0x3a0a('0x12')](_0x29207e));if(_0x29207e[_0x3a0a('0x13')]){if(_0x29207e['error']['code']===0x1f4){logger[_0x3a0a('0x13')](_0x3a0a('0xf'),_0x451873,_0x29207e['error'][_0x3a0a('0x14')]);return _0x56ee1b(_0x29207e[_0x3a0a('0x13')][_0x3a0a('0x14')]);}logger[_0x3a0a('0x13')](_0x3a0a('0xf'),_0x451873,_0x29207e[_0x3a0a('0x13')][_0x3a0a('0x14')]);return _0x5d98d3(_0x29207e[_0x3a0a('0x13')][_0x3a0a('0x14')]);}else{logger[_0x3a0a('0xe')](_0x3a0a('0xf'),_0x451873,_0x3a0a('0x10'));_0x5d98d3(_0x29207e[_0x3a0a('0x15')][_0x3a0a('0x14')]);}})['catch'](function(_0x41a6b0){logger['error'](_0x3a0a('0xf'),_0x451873,_0x41a6b0);_0x56ee1b(_0x41a6b0);});});} \ No newline at end of file diff --git a/server/api/smsInteraction/index.js b/server/api/smsInteraction/index.js index dd09034..96146af 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 _0x34b7=['/:id/tags','removeTags','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./smsInteraction.controller','get','isAuthenticated','index','/describe','describe','getMessages','/:id/download','download','post','create','/:id/messages','addMessage','tracked','sms','smsinteraction:addtags','addTags','put','/:id','smsinteraction:update','delete','destroy'];(function(_0x30c649,_0x2ebbac){var _0x3edfb9=function(_0xab82f5){while(--_0xab82f5){_0x30c649['push'](_0x30c649['shift']());}};_0x3edfb9(++_0x2ebbac);}(_0x34b7,0x196));var _0x734b=function(_0x58b301,_0x45e991){_0x58b301=_0x58b301-0x0;var _0x2171b3=_0x34b7[_0x58b301];return _0x2171b3;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x734b('0x0'));var timeout=require(_0x734b('0x1'));var express=require(_0x734b('0x2'));var router=express[_0x734b('0x3')]();var fs_extra=require(_0x734b('0x4'));var auth=require(_0x734b('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x734b('0x6'));router[_0x734b('0x7')]('/',auth[_0x734b('0x8')](),controller[_0x734b('0x9')]);router[_0x734b('0x7')](_0x734b('0xa'),auth['isAuthenticated'](),controller[_0x734b('0xb')]);router[_0x734b('0x7')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x734b('0x7')]('/:id/messages',auth[_0x734b('0x8')](),controller[_0x734b('0xc')]);router[_0x734b('0x7')](_0x734b('0xd'),auth[_0x734b('0x8')](),controller[_0x734b('0xe')]);router[_0x734b('0xf')]('/',auth[_0x734b('0x8')](),controller[_0x734b('0x10')]);router[_0x734b('0xf')](_0x734b('0x11'),auth[_0x734b('0x8')](),controller[_0x734b('0x12')]);router[_0x734b('0xf')]('/:id/tags',auth[_0x734b('0x8')](),interaction[_0x734b('0x13')](_0x734b('0x14'),_0x734b('0x15')),controller[_0x734b('0x16')]);router[_0x734b('0x17')](_0x734b('0x18'),auth[_0x734b('0x8')](),interaction[_0x734b('0x13')](_0x734b('0x14'),_0x734b('0x19')),controller['update']);router[_0x734b('0x1a')](_0x734b('0x18'),auth[_0x734b('0x8')](),interaction[_0x734b('0x13')]('sms','smsinteraction:destroy'),controller[_0x734b('0x1b')]);router[_0x734b('0x1a')](_0x734b('0x1c'),auth[_0x734b('0x8')](),controller[_0x734b('0x1d')]);module[_0x734b('0x1e')]=router; \ No newline at end of file +var _0x2547=['/:id/messages','getMessages','/:id/download','post','create','addMessage','/:id/tags','tracked','sms','smsinteraction:addtags','addTags','put','smsinteraction:update','update','delete','smsinteraction:destroy','destroy','removeTags','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./smsInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id'];(function(_0x54d9b1,_0x5c2377){var _0x50934d=function(_0x4b98e1){while(--_0x4b98e1){_0x54d9b1['push'](_0x54d9b1['shift']());}};_0x50934d(++_0x5c2377);}(_0x2547,0x1cd));var _0x7254=function(_0xdd84d3,_0x5b4e2b){_0xdd84d3=_0xdd84d3-0x0;var _0x43852b=_0x2547[_0xdd84d3];return _0x43852b;};'use strict';var multer=require('multer');var util=require(_0x7254('0x0'));var path=require(_0x7254('0x1'));var timeout=require(_0x7254('0x2'));var express=require(_0x7254('0x3'));var router=express[_0x7254('0x4')]();var fs_extra=require(_0x7254('0x5'));var auth=require(_0x7254('0x6'));var interaction=require(_0x7254('0x7'));var config=require('../../config/environment');var controller=require(_0x7254('0x8'));router[_0x7254('0x9')]('/',auth[_0x7254('0xa')](),controller[_0x7254('0xb')]);router['get'](_0x7254('0xc'),auth[_0x7254('0xa')](),controller[_0x7254('0xd')]);router['get'](_0x7254('0xe'),auth['isAuthenticated'](),controller['show']);router['get'](_0x7254('0xf'),auth[_0x7254('0xa')](),controller[_0x7254('0x10')]);router[_0x7254('0x9')](_0x7254('0x11'),auth[_0x7254('0xa')](),controller['download']);router[_0x7254('0x12')]('/',auth['isAuthenticated'](),controller[_0x7254('0x13')]);router['post'](_0x7254('0xf'),auth[_0x7254('0xa')](),controller[_0x7254('0x14')]);router[_0x7254('0x12')](_0x7254('0x15'),auth[_0x7254('0xa')](),interaction[_0x7254('0x16')](_0x7254('0x17'),_0x7254('0x18')),controller[_0x7254('0x19')]);router[_0x7254('0x1a')](_0x7254('0xe'),auth[_0x7254('0xa')](),interaction['tracked'](_0x7254('0x17'),_0x7254('0x1b')),controller[_0x7254('0x1c')]);router[_0x7254('0x1d')](_0x7254('0xe'),auth[_0x7254('0xa')](),interaction[_0x7254('0x16')]('sms',_0x7254('0x1e')),controller[_0x7254('0x1f')]);router[_0x7254('0x1d')](_0x7254('0x15'),auth[_0x7254('0xa')](),controller[_0x7254('0x20')]);module[_0x7254('0x21')]=router; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.attributes.js b/server/api/smsInteraction/smsInteraction.attributes.js index 68d523b..ab661aa 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 _0xafdd=['ENUM','out','sequelize','moment','exports','BOOLEAN','DATE','STRING'];(function(_0x41d15e,_0x1542b3){var _0x1ea1da=function(_0x194424){while(--_0x194424){_0x41d15e['push'](_0x41d15e['shift']());}};_0x1ea1da(++_0x1542b3);}(_0xafdd,0x19a));var _0xdafd=function(_0x4a6043,_0xc54a74){_0x4a6043=_0x4a6043-0x0;var _0x19f6a9=_0xafdd[_0x4a6043];return _0x19f6a9;};'use strict';var Sequelize=require(_0xdafd('0x0'));var moment=require(_0xdafd('0x1'));module[_0xdafd('0x2')]={'closed':{'type':Sequelize[_0xdafd('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xdafd('0x4')]},'disposition':{'type':Sequelize[_0xdafd('0x5')]},'secondDisposition':{'type':Sequelize[_0xdafd('0x5')]},'thirdDisposition':{'type':Sequelize[_0xdafd('0x5')]},'note':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0xdafd('0x5')]},'read1stAt':{'type':Sequelize[_0xdafd('0x4')]},'firstMsgDirection':{'type':Sequelize[_0xdafd('0x6')]('in',_0xdafd('0x7')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xdafd('0x4')]},'lastMsgDirection':{'type':Sequelize[_0xdafd('0x6')]('in',_0xdafd('0x7')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0x938d=['STRING','out','ENUM','sequelize','moment','BOOLEAN','DATE'];(function(_0x4d8df2,_0xffb304){var _0x461b9c=function(_0x12aabf){while(--_0x12aabf){_0x4d8df2['push'](_0x4d8df2['shift']());}};_0x461b9c(++_0xffb304);}(_0x938d,0x122));var _0xd938=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x938d[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xd938('0x0'));var moment=require(_0xd938('0x1'));module['exports']={'closed':{'type':Sequelize[_0xd938('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xd938('0x3')]},'disposition':{'type':Sequelize[_0xd938('0x4')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0xd938('0x4')]},'phone':{'type':Sequelize[_0xd938('0x4')]},'read1stAt':{'type':Sequelize[_0xd938('0x3')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0xd938('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xd938('0x3')]},'lastMsgDirection':{'type':Sequelize[_0xd938('0x6')]('in',_0xd938('0x5')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0xd938('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 d4d113a..6bb439f 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 _0x4d89=['zip-dir','fast-json-patch','request-promise','moment','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','../../config/license/hardware','../../config/logger','api','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./smsInteraction.socket','register','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','reject','save','update','destroy','then','error','name','send','Users','Tags','TagIds','split','forEach','push','catch','rawAttributes','fieldName','type','key','model','map','query','keys','intersection','attributes','fields','length','hasOwnProperty','sort','where','filters','pick','select','field','u.fullname','ui.SmsInteractionId','from','user_has_sms_interactions','left_join','users','u.id\x20=\x20ui.UserId','sms_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','sms_accounts','a.id\x20=\x20i.SmsAccountId','sms_messages','me.SmsInteractionId\x20=\x20i.id','sms_interaction_has_tags','tools_tags','t.id\x20=\x20it.TagId','expr','search','parseSearch','conditions','find','unreadMessages','value','having','`\x20=\x200','`\x20>\x200','Contact','operator','$substring','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','text','start','Tag','union','User','UserId','body','some','compact','isEmpty','SmsAccountId','i.SmsAccountId\x20IN\x20?','concat','createdAt','$gte','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','filter','replace','isNumeric','i.id\x20LIKE\x20?','i.phone\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','order','contactName','DESC','i.SmsAccountId\x20IS\x20NOT\x20NULL','user','role','i.SmsAccountId\x20IS\x20NULL','sequelize','toString','keyBy','merge','SmsInteraction','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','Contact.firstName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','Contact.fax','o.fullname','Owner.fullname','o.internal','ui.SmsInteractionId\x20IN\x20?','groupBy','all','rows','params','includeAll','include','options','create','describe','addMessage','SmsMessage','ids','omit','nolimit','format','YYYY-MM-DD\x20HH:mm:ss','findAll','addTags','setTags','spread','color','emit','removeTags','unix','root','server','files','join','attachments','CmContact','firstName','lastName','Messages','secret','Owner','fullname','get','mkdirSync','N.A.','closedAt','disposition','direction','out','System','renderFile','downloadInteraction.ejs','transcript-','Sms','createPdfFromHTML','download','err','unlinkSync','eml-format','rimraf'];(function(_0x20e4f7,_0x4ae5a2){var _0x323396=function(_0x26a1ad){while(--_0x26a1ad){_0x20e4f7['push'](_0x20e4f7['shift']());}};_0x323396(++_0x4ae5a2);}(_0x4d89,0xdd));var _0x94d8=function(_0x39c60b,_0x2ee00b){_0x39c60b=_0x39c60b-0x0;var _0xd921b=_0x4d89[_0x39c60b];return _0xd921b;};'use strict';var emlformat=require(_0x94d8('0x0'));var rimraf=require(_0x94d8('0x1'));var zipdir=require(_0x94d8('0x2'));var jsonpatch=require(_0x94d8('0x3'));var rp=require(_0x94d8('0x4'));var moment=require(_0x94d8('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x94d8('0x6'));var util=require('util');var path=require('path');var sox=require(_0x94d8('0x7'));var csv=require(_0x94d8('0x8'));var ejs=require(_0x94d8('0x9'));var fs=require('fs');var fs_extra=require(_0x94d8('0xa'));var _=require(_0x94d8('0xb'));var squel=require(_0x94d8('0xc'));var crypto=require(_0x94d8('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x94d8('0xe'));var toCsv=require(_0x94d8('0x8'));var querystring=require(_0x94d8('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var pdf=require('../../components/export/pdf');var hardwareService=require(_0x94d8('0x10'));var logger=require(_0x94d8('0x11'))(_0x94d8('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x94d8('0x13'))['db'];config['redis']=_[_0x94d8('0x14')](config[_0x94d8('0x15')],{'host':_0x94d8('0x16'),'port':0x18eb});var socket=require(_0x94d8('0x17'))(new Redis(config[_0x94d8('0x15')]));require(_0x94d8('0x18'))[_0x94d8('0x19')](socket);function respondWithStatusCode(_0x1775e6,_0x449267){_0x449267=_0x449267||0xcc;return function(_0xd4a528){if(_0xd4a528){return _0x1775e6[_0x94d8('0x1a')](_0x449267);}return _0x1775e6[_0x94d8('0x1b')](_0x449267)[_0x94d8('0x1c')]();};}function respondWithResult(_0xea3d90,_0x150619){_0x150619=_0x150619||0xc8;return function(_0x10bbc4){if(_0x10bbc4){return _0xea3d90[_0x94d8('0x1b')](_0x150619)[_0x94d8('0x1d')](_0x10bbc4);}};}function respondWithFilteredResult(_0x4f14ed,_0x3a4e67){return function(_0x3dd51b){if(_0x3dd51b){var _0x36dd0=typeof _0x3a4e67[_0x94d8('0x1e')]==='undefined'&&typeof _0x3a4e67[_0x94d8('0x1f')]===_0x94d8('0x20');var _0x4899c1=_0x3dd51b[_0x94d8('0x21')];var _0x1f462f=_0x36dd0?0x0:_0x3a4e67['offset'];var _0x46dc0d=_0x36dd0?_0x3dd51b[_0x94d8('0x21')]:_0x3a4e67[_0x94d8('0x1e')]+_0x3a4e67[_0x94d8('0x1f')];var _0x5aa8e4;if(_0x46dc0d>=_0x4899c1){_0x46dc0d=_0x4899c1;_0x5aa8e4=0xc8;}else{_0x5aa8e4=0xce;}_0x4f14ed[_0x94d8('0x1b')](_0x5aa8e4);return _0x4f14ed[_0x94d8('0x22')](_0x94d8('0x23'),_0x1f462f+'-'+_0x46dc0d+'/'+_0x4899c1)['json'](_0x3dd51b);}return null;};}function patchUpdates(_0x21ff3b){return function(_0x26fa4c){try{jsonpatch['apply'](_0x26fa4c,_0x21ff3b,!![]);}catch(_0xcc575a){return BPromise[_0x94d8('0x24')](_0xcc575a);}return _0x26fa4c[_0x94d8('0x25')]();};}function saveUpdates(_0x4be27e,_0x16d32b){return function(_0x2cd4e5){if(_0x2cd4e5){return _0x2cd4e5[_0x94d8('0x26')](_0x4be27e)['then'](function(_0x2b9911){return _0x2b9911;});}return null;};}function removeEntity(_0x76fd9d,_0x193236){return function(_0x5b88b5){if(_0x5b88b5){return _0x5b88b5[_0x94d8('0x27')]()[_0x94d8('0x28')](function(){_0x76fd9d[_0x94d8('0x1b')](0xcc)[_0x94d8('0x1c')]();});}};}function handleEntityNotFound(_0xcec9f6,_0x1211ad){return function(_0x47da7a){if(!_0x47da7a){_0xcec9f6['sendStatus'](0x194);}return _0x47da7a;};}function handleError(_0x32f1e6,_0x34357c){_0x34357c=_0x34357c||0x1f4;return function(_0x1107e2){logger[_0x94d8('0x29')](_0x1107e2['stack']);if(_0x1107e2[_0x94d8('0x2a')]){delete _0x1107e2[_0x94d8('0x2a')];}_0x32f1e6[_0x94d8('0x1b')](_0x34357c)[_0x94d8('0x2b')](_0x1107e2);};}function getInteractionUsers(_0x1e2ebe,_0x43c4ed){return new BPromise(function(_0x1200d7,_0x5e6483){try{if(_0x43c4ed[_0x1e2ebe['id']]){_0x1e2ebe[_0x94d8('0x2c')]=_['map'](_0x43c4ed[_0x1e2ebe['id']],function(_0x683181){return{'id':_0x683181['id'],'fullname':_0x683181['fullname']};});}}catch(_0x2f2cb5){_0x5e6483(_0x2f2cb5);}_0x1200d7(_0x1e2ebe);});}function getInteractionTags(_0x1b17a7,_0x8deee1){return new BPromise(function(_0x3e05fb,_0x56926a){try{if(_0x1b17a7['TagIds']){_0x1b17a7[_0x94d8('0x2d')]=[];_0x1b17a7[_0x94d8('0x2e')][_0x94d8('0x2f')](',')[_0x94d8('0x30')](function(_0x2c4434){_0x1b17a7[_0x94d8('0x2d')][_0x94d8('0x31')](_0x8deee1[_0x2c4434]);});}delete _0x1b17a7['TagIds'];}catch(_0x334401){_0x56926a(_0x334401);}_0x3e05fb(_0x1b17a7);});}function updateSmsInteraction(_0x2ebfca,_0x2fc98a,_0x3a45f3){return new BPromise(function(_0x4cfc43,_0x5e06be){return getInteractionUsers(_0x2ebfca,_0x3a45f3)['then'](function(_0x22572e){return getInteractionTags(_0x22572e,_0x2fc98a);})[_0x94d8('0x28')](function(_0x513568){_0x4cfc43(_0x513568);})[_0x94d8('0x32')](function(_0x1ef129){_0x5e06be(_0x1ef129);});});}exports['index']=function(_0x5e66ef,_0x4779b1){var _0x454d8a={},_0x20afe8={},_0x1b056d={'count':0x0,'rows':[]};var _0x1b367d=_['map'](db['SmsInteraction'][_0x94d8('0x33')],function(_0xa2063b){return{'name':_0xa2063b[_0x94d8('0x34')],'type':_0xa2063b[_0x94d8('0x35')][_0x94d8('0x36')]};});_0x20afe8[_0x94d8('0x37')]=_[_0x94d8('0x38')](_0x1b367d,_0x94d8('0x2a'));_0x20afe8[_0x94d8('0x39')]=_[_0x94d8('0x3a')](_0x5e66ef[_0x94d8('0x39')]);_0x20afe8['filters']=_[_0x94d8('0x3b')](_0x20afe8['model'],_0x20afe8[_0x94d8('0x39')]);_0x454d8a[_0x94d8('0x3c')]=_[_0x94d8('0x3b')](_0x20afe8['model'],qs['fields'](_0x5e66ef[_0x94d8('0x39')][_0x94d8('0x3d')]));_0x454d8a[_0x94d8('0x3c')]=_0x454d8a[_0x94d8('0x3c')][_0x94d8('0x3e')]?_0x454d8a[_0x94d8('0x3c')]:_0x20afe8[_0x94d8('0x37')];if(!_0x5e66ef[_0x94d8('0x39')][_0x94d8('0x3f')]('nolimit')){_0x454d8a[_0x94d8('0x1f')]=qs[_0x94d8('0x1f')](_0x5e66ef[_0x94d8('0x39')][_0x94d8('0x1f')]);_0x454d8a[_0x94d8('0x1e')]=qs['offset'](_0x5e66ef['query'][_0x94d8('0x1e')]);}_0x454d8a['order']=qs[_0x94d8('0x40')](_0x5e66ef[_0x94d8('0x39')][_0x94d8('0x40')]);_0x454d8a[_0x94d8('0x41')]=qs[_0x94d8('0x42')](_[_0x94d8('0x43')](_0x5e66ef[_0x94d8('0x39')],_0x20afe8[_0x94d8('0x42')]),_0x1b367d);var _0x1c2826=[];var _0x35ed61=squel[_0x94d8('0x44')]()[_0x94d8('0x45')]('id')[_0x94d8('0x45')](_0x94d8('0x2a'))['field']('color')['from']('tools_tags');var _0x11ce41=squel[_0x94d8('0x44')]()['field']('u.id')[_0x94d8('0x45')](_0x94d8('0x46'))['field'](_0x94d8('0x47'))[_0x94d8('0x48')](_0x94d8('0x49'),'ui')[_0x94d8('0x4a')](_0x94d8('0x4b'),'u',_0x94d8('0x4c'));var _0x3fc3f5=squel['select']()['from'](_0x94d8('0x4d'),'i')[_0x94d8('0x4a')](_0x94d8('0x4e'),'c',_0x94d8('0x4f'))[_0x94d8('0x4a')]('users','o',_0x94d8('0x50'))['left_join'](_0x94d8('0x51'),'a',_0x94d8('0x52'))[_0x94d8('0x4a')](_0x94d8('0x53'),'me',_0x94d8('0x54'))[_0x94d8('0x4a')](_0x94d8('0x55'),'it','it.SmsInteractionId\x20=\x20i.id')[_0x94d8('0x4a')](_0x94d8('0x56'),'t',_0x94d8('0x57'));var _0x2fb1a2=squel['expr']();var _0x454bd3=[];var _0x430c28=squel[_0x94d8('0x58')]();var _0x1b500e;if(_0x5e66ef[_0x94d8('0x39')][_0x94d8('0x59')]){_0x1b500e=as[_0x94d8('0x5a')](_0x5e66ef['query'][_0x94d8('0x59')]);var _0x4b3873=_0x1b500e['sqlOperator'];for(var _0x57e17e=0x0;_0x57e17e<_0x1b500e['conditions'][_0x94d8('0x3e')];_0x57e17e++){var _0x256457=_0x1b500e[_0x94d8('0x5b')][_0x57e17e];var _0x12c2f3='i';var _0x24d68d=_[_0x94d8('0x5c')](_0x1b367d,[_0x94d8('0x2a'),_0x256457[_0x94d8('0x45')]]);if(!_0x24d68d){switch(_0x256457['field']){case _0x94d8('0x5d'):if(_0x256457[_0x94d8('0x5e')]==0x1){_0x3fc3f5[_0x94d8('0x5f')]('`'+_0x256457[_0x94d8('0x45')]+_0x94d8('0x60'));}else{_0x3fc3f5['having']('`'+_0x256457[_0x94d8('0x45')]+_0x94d8('0x61'));}break;case _0x94d8('0x62'):if(_0x256457[_0x94d8('0x63')]===_0x94d8('0x64')){if(_0x256457['value'][_0x94d8('0x2f')]('\x20')['length']>0x1){_0x2fb1a2[_0x4b3873]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x94d8('0x65')](_0x256457[_0x94d8('0x5e')]),null);}else{var _0x3b07ff='%'+_0x256457[_0x94d8('0x5e')]+'%';_0x2fb1a2[_0x4b3873](_0x94d8('0x66'),_0x3b07ff,_0x3b07ff,_0x3b07ff);}}else{_0x24d68d=_[_0x94d8('0x5c')](_0x1b367d,[_0x94d8('0x2a'),_0x94d8('0x67')]);_0x256457[_0x94d8('0x45')]=_0x94d8('0x67');_0x42ff86=as[_0x94d8('0x68')](_0x12c2f3,_0x24d68d[_0x94d8('0x35')],_0x256457);_0x2fb1a2[_0x4b3873](_0x42ff86[_0x94d8('0x69')],_0x42ff86['value'][_0x94d8('0x6a')],_0x42ff86['value']['end']);}break;case _0x94d8('0x6b'):var _0x79582f=_0x256457[_0x94d8('0x5e')]['split'](',')[_0x94d8('0x38')](function(_0x154c1c){return Number(_0x154c1c);});_0x79582f[_0x94d8('0x30')](function(_0xeea422){_0x430c28['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0xeea422+',%');});_0x454bd3=_[_0x94d8('0x6c')](_0x454bd3,_0x79582f);break;case _0x94d8('0x6d'):if(_0x256457[_0x94d8('0x63')]===_0x94d8('0x64')){_0x2fb1a2[_0x4b3873]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x256457[_0x94d8('0x5e')]+'%',null);}else{_0x24d68d=_[_0x94d8('0x5c')](_0x1b367d,['name','UserId']);_0x256457[_0x94d8('0x45')]=_0x94d8('0x6e');_0x42ff86=as['buildExpression'](_0x12c2f3,_0x24d68d[_0x94d8('0x35')],_0x256457);_0x2fb1a2[_0x4b3873](_0x42ff86[_0x94d8('0x69')],_0x42ff86[_0x94d8('0x5e')][_0x94d8('0x6a')],_0x42ff86['value']['end']);}break;case _0x94d8('0x6f'):_0x42ff86=as[_0x94d8('0x68')]('me',null,_0x256457);_0x2fb1a2[_0x4b3873](_0x42ff86[_0x94d8('0x69')],_0x42ff86['value'][_0x94d8('0x6a')],_0x42ff86[_0x94d8('0x5e')]['end']);break;}}else{var _0x42ff86=as[_0x94d8('0x68')](_0x12c2f3,_0x24d68d['type'],_0x256457);_0x2fb1a2[_0x4b3873](_0x42ff86[_0x94d8('0x69')],_0x42ff86['value'][_0x94d8('0x6a')],_0x42ff86[_0x94d8('0x5e')][_0x94d8('0x1c')]);}}}else{var _0x187348=_(_0x5e66ef[_0x94d8('0x39')])[_0x94d8('0x3a')]()[_0x94d8('0x38')](function(_0x59d3cb){return _[_0x94d8('0x70')](_0x1b367d,[_0x94d8('0x2a'),_0x59d3cb])?_0x59d3cb:undefined;})[_0x94d8('0x71')]()[_0x94d8('0x5e')]();if(!_[_0x94d8('0x72')](_0x187348)){_0x187348[_0x94d8('0x30')](function(_0x401d38){if(_0x401d38===_0x94d8('0x73')){_0x3fc3f5[_0x94d8('0x41')](_0x94d8('0x74'),[][_0x94d8('0x75')](_0x5e66ef['query'][_0x401d38]));}else if(_0x401d38===_0x94d8('0x76')){var _0x700135=JSON['parse'](_0x5e66ef['query'][_0x401d38])[_0x94d8('0x77')];var _0x49c8ff=JSON['parse'](_0x5e66ef[_0x94d8('0x39')][_0x401d38])['$lte'];_0x3fc3f5[_0x94d8('0x41')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x700135,_0x49c8ff);}else{if(_0x5e66ef[_0x94d8('0x39')][_0x401d38]===_0x94d8('0x78')){_0x3fc3f5[_0x94d8('0x41')]('i.'+_0x401d38+_0x94d8('0x79'));}else{_0x3fc3f5['where']('i.'+_0x401d38+_0x94d8('0x7a'),_0x5e66ef[_0x94d8('0x39')][_0x401d38]);}}});}if(_0x5e66ef[_0x94d8('0x39')][_0x94d8('0x7b')]){if(_0x5e66ef['query'][_0x94d8('0x7b')]==0x1){_0x3fc3f5[_0x94d8('0x5f')](_0x94d8('0x7c'));}else{_0x3fc3f5[_0x94d8('0x5f')](_0x94d8('0x7d'));}}if(_0x5e66ef[_0x94d8('0x39')]['tag']){_0x454bd3=_['isArray'](_0x5e66ef['query'][_0x94d8('0x7e')])?_0x5e66ef[_0x94d8('0x39')][_0x94d8('0x7e')]:new Array(_0x5e66ef[_0x94d8('0x39')][_0x94d8('0x7e')]);_0x454bd3['forEach'](function(_0x2e7bac){_0x430c28['or'](_0x94d8('0x7f'),'%,'+_0x2e7bac+',%');});}if(_0x5e66ef[_0x94d8('0x39')][_0x94d8('0x80')]){var _0xc96eee=_0x5e66ef['query'][_0x94d8('0x80')]['replace']('\x5c','\x5c\x5c')[_0x94d8('0x81')](/'/g,'\x27\x27');if(qs[_0x94d8('0x82')](_0xc96eee)){_0x2fb1a2['or'](_0x94d8('0x83'),_0xc96eee+'%')['or'](_0x94d8('0x84'),_0xc96eee+'%');}else{_0x2fb1a2['or'](_0x94d8('0x85'),qs[_0x94d8('0x65')](_0xc96eee))['or'](_0x94d8('0x86'),_0xc96eee+'%');}}}_0x3fc3f5['where'](_0x2fb1a2);_0x3fc3f5[_0x94d8('0x87')](_0x94d8('0x88'));var _0x59907b={'type':db['Sequelize'][_0x94d8('0x89')][_0x94d8('0x8a')],'raw':!![]};var _0x201c5e=_0x3fc3f5[_0x94d8('0x8b')]();_0x201c5e[_0x94d8('0x45')](_0x94d8('0x88'));_0x201c5e[_0x94d8('0x45')](_0x94d8('0x8c'),_0x94d8('0x5d'));if(_0x454d8a[_0x94d8('0x8d')]){_0x454d8a['order'][_0x94d8('0x30')](function(_0x3c7b4c){var _0x1761c1=_0x3c7b4c[0x0]===_0x94d8('0x8e')?_0x3c7b4c[0x0]:'i.'+_0x3c7b4c[0x0];_0x3fc3f5[_0x94d8('0x8d')](_0x1761c1,_0x3c7b4c[0x1]===_0x94d8('0x8f')?![]:!![]);});}if(!_[_0x94d8('0x72')](_0x454bd3)){_0x3fc3f5[_0x94d8('0x5f')](_0x430c28);_0x201c5e['where']('t.id\x20IN\x20?',_0x454bd3);}BPromise['resolve']()[_0x94d8('0x28')](function(){if(!_0x1b500e){if(_0x5e66ef[_0x94d8('0x39')][_0x94d8('0x73')])return;_0x201c5e[_0x94d8('0x41')](_0x94d8('0x90'));_0x3fc3f5['where']('i.SmsAccountId\x20IS\x20NOT\x20NULL');return;}if(_0x5e66ef[_0x94d8('0x91')][_0x94d8('0x92')]!=='agent')return;return _0x5e66ef[_0x94d8('0x91')]['getSmsAccounts']({'attributes':['id'],'raw':!![]})[_0x94d8('0x28')](function(_0x3c29d2){if(_[_0x94d8('0x72')](_0x3c29d2)){_0x201c5e[_0x94d8('0x41')]('i.SmsAccountId\x20IS\x20NULL');_0x3fc3f5[_0x94d8('0x41')](_0x94d8('0x93'));}else{_0x201c5e[_0x94d8('0x41')](_0x94d8('0x74'),_[_0x94d8('0x38')](_0x3c29d2,'id'));_0x3fc3f5[_0x94d8('0x41')](_0x94d8('0x74'),_[_0x94d8('0x38')](_0x3c29d2,'id'));}});})['then'](function(){if(_0x5e66ef[_0x94d8('0x91')][_0x94d8('0x92')]==='agent'&&!_0x1b500e&&!_0x5e66ef['query'][_0x94d8('0x73')])return[];return db[_0x94d8('0x94')][_0x94d8('0x39')](_0x201c5e[_0x94d8('0x95')](),_0x59907b);})['then'](function(_0x5e9463){_0x1b056d[_0x94d8('0x21')]=_0x5e9463[_0x94d8('0x3e')];if(_0x1b056d[_0x94d8('0x21')]===0x0)return[];return db[_0x94d8('0x94')][_0x94d8('0x39')](_0x35ed61[_0x94d8('0x95')](),_0x59907b)[_0x94d8('0x28')](function(_0x214d5b){_0x1c2826=_[_0x94d8('0x96')](_0x214d5b,'id');_0x59907b=_[_0x94d8('0x97')](_0x59907b,{'model':db[_0x94d8('0x98')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x5e66ef[_0x94d8('0x39')]['fields']){_0x454d8a[_0x94d8('0x3c')]['forEach'](function(_0x4be07d){_0x3fc3f5[_0x94d8('0x45')]('i.'+_0x4be07d);});}else{_0x3fc3f5[_0x94d8('0x45')](_0x94d8('0x8c'),_0x94d8('0x5d'));_0x3fc3f5[_0x94d8('0x45')]('a.key',_0x94d8('0x99'));_0x3fc3f5[_0x94d8('0x45')](_0x94d8('0x9a'),_0x94d8('0x9b'));_0x3fc3f5[_0x94d8('0x45')](_0x94d8('0x9c'),_0x94d8('0x8e'));_0x3fc3f5[_0x94d8('0x45')](_0x94d8('0x9d'));_0x3fc3f5[_0x94d8('0x45')]('c.firstName',_0x94d8('0x9e'));_0x3fc3f5[_0x94d8('0x45')]('c.lastName',_0x94d8('0x9f'));_0x3fc3f5[_0x94d8('0x45')](_0x94d8('0xa0'),_0x94d8('0xa1'));_0x3fc3f5[_0x94d8('0x45')](_0x94d8('0xa2'),_0x94d8('0xa3'));_0x3fc3f5[_0x94d8('0x45')](_0x94d8('0xa4'),_0x94d8('0xa5'));_0x3fc3f5[_0x94d8('0x45')]('c.fax',_0x94d8('0xa6'));_0x3fc3f5[_0x94d8('0x45')](_0x94d8('0xa7'),_0x94d8('0xa8'));_0x3fc3f5[_0x94d8('0x45')](_0x94d8('0xa9'),'Owner.internal');_0x3fc3f5[_0x94d8('0x45')]('GROUP_CONCAT(DISTINCT\x20t.id)',_0x94d8('0x2e'));}if(_0x454d8a[_0x94d8('0x1f')])_0x3fc3f5['limit'](_0x454d8a['limit']);if(_0x454d8a['offset'])_0x3fc3f5[_0x94d8('0x1e')](_0x454d8a[_0x94d8('0x1e')]);return db['sequelize'][_0x94d8('0x39')](_0x3fc3f5['toString'](),_0x59907b);})[_0x94d8('0x28')](function(_0x2691c1){if(_0x2691c1[_0x94d8('0x3e')]>0x0)_0x11ce41[_0x94d8('0x41')](_0x94d8('0xaa'),_[_0x94d8('0x38')](_0x2691c1,'id'));return db['sequelize'][_0x94d8('0x39')](_0x11ce41[_0x94d8('0x95')](),_0x59907b)['then'](function(_0x1be24a){var _0x37cd30=_[_0x94d8('0xab')](_0x1be24a,'SmsInteractionId');var _0x5da207=[];_0x2691c1['forEach'](function(_0x1aef89){_0x5da207['push'](updateSmsInteraction(_0x1aef89,_0x1c2826,_0x37cd30));});return BPromise[_0x94d8('0xac')](_0x5da207);});});})[_0x94d8('0x28')](function(_0x167e83){_0x1b056d[_0x94d8('0xad')]=_0x167e83;return _0x1b056d;})[_0x94d8('0x28')](respondWithFilteredResult(_0x4779b1,_0x454d8a))[_0x94d8('0x32')](handleError(_0x4779b1,null));};exports['show']=function(_0x2b75e5,_0x321c3d){var _0x1293e2={'raw':![],'where':{'id':_0x2b75e5[_0x94d8('0xae')]['id']}},_0x47478f={};_0x47478f['model']=_[_0x94d8('0x3a')](db[_0x94d8('0x98')][_0x94d8('0x33')]);_0x47478f['query']=_[_0x94d8('0x3a')](_0x2b75e5[_0x94d8('0x39')]);_0x47478f[_0x94d8('0x42')]=_[_0x94d8('0x3b')](_0x47478f['model'],_0x47478f['query']);_0x1293e2[_0x94d8('0x3c')]=_[_0x94d8('0x3b')](_0x47478f[_0x94d8('0x37')],qs[_0x94d8('0x3d')](_0x2b75e5[_0x94d8('0x39')][_0x94d8('0x3d')]));_0x1293e2[_0x94d8('0x3c')]=_0x1293e2[_0x94d8('0x3c')][_0x94d8('0x3e')]?_0x1293e2[_0x94d8('0x3c')]:_0x47478f[_0x94d8('0x37')];if(_0x2b75e5[_0x94d8('0x39')][_0x94d8('0xaf')]){_0x1293e2[_0x94d8('0xb0')]=[{'all':!![]}];}_0x1293e2=_[_0x94d8('0x97')]({},_0x1293e2,_0x2b75e5[_0x94d8('0xb1')]);return db[_0x94d8('0x98')][_0x94d8('0x5c')](_0x1293e2)['then'](handleEntityNotFound(_0x321c3d,null))[_0x94d8('0x28')](respondWithResult(_0x321c3d,null))['catch'](handleError(_0x321c3d,null));};exports[_0x94d8('0xb2')]=function(_0xb9838,_0x20af23){return db['SmsInteraction'][_0x94d8('0xb2')](_0xb9838['body'],{})[_0x94d8('0x28')](respondWithResult(_0x20af23,0xc9))[_0x94d8('0x32')](handleError(_0x20af23,null));};exports[_0x94d8('0x26')]=function(_0x47c0fc,_0x29776f){if(_0x47c0fc[_0x94d8('0x6f')]['id']){delete _0x47c0fc[_0x94d8('0x6f')]['id'];}return db[_0x94d8('0x98')][_0x94d8('0x5c')]({'where':{'id':_0x47c0fc[_0x94d8('0xae')]['id']}})['then'](handleEntityNotFound(_0x29776f,null))['then'](saveUpdates(_0x47c0fc[_0x94d8('0x6f')],null))[_0x94d8('0x28')](respondWithResult(_0x29776f,null))[_0x94d8('0x32')](handleError(_0x29776f,null));};exports[_0x94d8('0x27')]=function(_0x5cc967,_0x56538a){return db['SmsInteraction'][_0x94d8('0x5c')]({'where':{'id':_0x5cc967[_0x94d8('0xae')]['id']}})['then'](handleEntityNotFound(_0x56538a,null))[_0x94d8('0x28')](removeEntity(_0x56538a,null))[_0x94d8('0x32')](handleError(_0x56538a,null));};exports[_0x94d8('0xb3')]=function(_0x17418c,_0xe16b76){return db[_0x94d8('0x98')]['describe']()[_0x94d8('0x28')](respondWithResult(_0xe16b76,null))[_0x94d8('0x32')](handleError(_0xe16b76,null));};exports[_0x94d8('0xb4')]=function(_0x577b86,_0x42606f,_0xe6da32){return db[_0x94d8('0xb5')][_0x94d8('0x5c')]({'where':{'id':_0x577b86[_0x94d8('0xae')]['id']}})[_0x94d8('0x28')](handleEntityNotFound(_0x42606f,null))[_0x94d8('0x28')](function(_0x11e405){if(_0x11e405){return _0x11e405[_0x94d8('0xb4')](_0x577b86[_0x94d8('0x6f')][_0x94d8('0xb6')],_[_0x94d8('0xb7')](_0x577b86[_0x94d8('0x6f')],['ids','id'])||{});}})['then'](respondWithResult(_0x42606f,null))['catch'](handleError(_0x42606f,null));};exports['getMessages']=function(_0x489dc2,_0x2bf975,_0x29833f){var _0x2094e1={'raw':![],'where':{}};var _0x469c9c={};var _0x49f11f={'count':0x0,'rows':[]};return db[_0x94d8('0x98')]['findOne']({'where':{'id':_0x489dc2[_0x94d8('0xae')]['id']}})[_0x94d8('0x28')](handleEntityNotFound(_0x2bf975,null))['then'](function(_0x12c426){if(_0x12c426){_0x469c9c['model']=_[_0x94d8('0x3a')](db[_0x94d8('0xb5')][_0x94d8('0x33')]);_0x469c9c[_0x94d8('0x39')]=_[_0x94d8('0x3a')](_0x489dc2[_0x94d8('0x39')]);_0x469c9c[_0x94d8('0x42')]=_[_0x94d8('0x3b')](_0x469c9c[_0x94d8('0x37')],_0x469c9c['query']);_0x2094e1[_0x94d8('0x3c')]=_[_0x94d8('0x3b')](_0x469c9c[_0x94d8('0x37')],qs[_0x94d8('0x3d')](_0x489dc2[_0x94d8('0x39')]['fields']));_0x2094e1[_0x94d8('0x3c')]=_0x2094e1[_0x94d8('0x3c')]['length']?_0x2094e1[_0x94d8('0x3c')]:_0x469c9c[_0x94d8('0x37')];if(!_0x489dc2[_0x94d8('0x39')][_0x94d8('0x3f')](_0x94d8('0xb8'))){_0x2094e1[_0x94d8('0x1f')]=qs[_0x94d8('0x1f')](_0x489dc2[_0x94d8('0x39')]['limit']);_0x2094e1[_0x94d8('0x1e')]=qs[_0x94d8('0x1e')](_0x489dc2['query'][_0x94d8('0x1e')]);}_0x2094e1[_0x94d8('0x8d')]=qs['sort'](_0x489dc2['query'][_0x94d8('0x40')]);_0x2094e1[_0x94d8('0x41')]=qs[_0x94d8('0x42')](_[_0x94d8('0x43')](_0x489dc2[_0x94d8('0x39')],_0x469c9c[_0x94d8('0x42')]));_0x2094e1[_0x94d8('0x41')]['SmsInteractionId']=_0x12c426['id'];if(_0x489dc2[_0x94d8('0x39')][_0x94d8('0x80')]){_0x2094e1[_0x94d8('0x41')]=_[_0x94d8('0x97')](_0x2094e1[_0x94d8('0x41')],{'$or':_[_0x94d8('0x38')](_0x2094e1[_0x94d8('0x3c')],function(_0x5a99d2){var _0x240b8c={};_0x240b8c[_0x5a99d2]={'$like':'%'+_0x489dc2[_0x94d8('0x39')]['filter']+'%'};return _0x240b8c;})});}if(_0x489dc2['query'][_0x94d8('0x77')]){var _0x1a53e4=_0x489dc2['query']['$gte'][_0x94d8('0x2f')](',');var _0x3871b6={};_0x3871b6[_0x1a53e4[0x0]]={'$gte':moment(_0x1a53e4[0x1])[_0x94d8('0xb9')](_0x94d8('0xba'))};_0x2094e1[_0x94d8('0x41')]=_['merge'](_0x2094e1['where'],_0x3871b6);}_0x2094e1=_[_0x94d8('0x97')]({},_0x2094e1,_0x489dc2[_0x94d8('0xb1')]);return db[_0x94d8('0xb5')]['count']({'where':_0x2094e1[_0x94d8('0x41')]})[_0x94d8('0x28')](function(_0x57e61a){_0x49f11f[_0x94d8('0x21')]=_0x57e61a;if(_0x489dc2[_0x94d8('0x39')][_0x94d8('0xaf')]){_0x2094e1[_0x94d8('0xb0')]=[{'all':!![]}];}return db[_0x94d8('0xb5')][_0x94d8('0xbb')](_0x2094e1);})[_0x94d8('0x28')](function(_0x4f98f1){_0x49f11f[_0x94d8('0xad')]=_0x4f98f1;return _0x49f11f;});}})['then'](respondWithFilteredResult(_0x2bf975,_0x2094e1))['catch'](handleError(_0x2bf975,null));};exports[_0x94d8('0xbc')]=function(_0x232274,_0x1aba2c,_0x2aa303){return db[_0x94d8('0x98')][_0x94d8('0x5c')]({'where':{'id':_0x232274[_0x94d8('0xae')]['id']}})[_0x94d8('0x28')](handleEntityNotFound(_0x1aba2c,null))[_0x94d8('0x28')](function(_0x240ce0){if(_0x240ce0){return _0x240ce0[_0x94d8('0xbd')](_0x232274[_0x94d8('0x6f')]['ids'],_[_0x94d8('0xb7')](_0x232274[_0x94d8('0x6f')],[_0x94d8('0xb6'),'id'])||{})[_0x94d8('0xbe')](function(){return db[_0x94d8('0x6b')][_0x94d8('0xbb')]({'attributes':['id',_0x94d8('0x2a'),_0x94d8('0xbf')],'where':{'id':_0x232274[_0x94d8('0x6f')][_0x94d8('0xb6')]}});})[_0x94d8('0x28')](function(_0x286372){socket[_0x94d8('0xc0')]('smsInteractionTags:save',{'id':Number(_0x232274[_0x94d8('0xae')]['id']),'tags':_0x286372||[]});return{'id':Number(_0x232274['params']['id']),'tags':_0x286372||[]};});}})[_0x94d8('0x28')](respondWithResult(_0x1aba2c,null))[_0x94d8('0x32')](handleError(_0x1aba2c,null));};exports[_0x94d8('0xc1')]=function(_0x1daa90,_0x334cb7,_0x31df34){return db[_0x94d8('0x98')][_0x94d8('0x5c')]({'where':{'id':_0x1daa90['params']['id']}})[_0x94d8('0x28')](handleEntityNotFound(_0x334cb7,null))[_0x94d8('0x28')](function(_0x221d63){if(_0x221d63){return _0x221d63[_0x94d8('0xc1')](_0x1daa90['query']['ids']);}})[_0x94d8('0x28')](respondWithStatusCode(_0x334cb7,null))['catch'](handleError(_0x334cb7,null));};exports['download']=function(_0x506e30,_0xc32e4c){var _0x5d1353=moment()[_0x94d8('0xc2')]()[_0x94d8('0x95')]();var _0x592645=path['join'](config[_0x94d8('0xc3')],_0x94d8('0xc4'),_0x94d8('0xc5'),'tmp');var _0x224690=path[_0x94d8('0xc6')](config['root'],'server',_0x94d8('0xc5'),_0x94d8('0xc7'));var _0x323d6e=path[_0x94d8('0xc6')](_0x592645,_0x5d1353);var _0x42e80f=util[_0x94d8('0xb9')]('transcript-%d-%s.zip',_0x506e30[_0x94d8('0xae')]['id'],_0x5d1353);var _0x5b4d88=path[_0x94d8('0xc6')](_0x592645,_0x42e80f);var _0x4014ea=[];_0x4014ea[_0x94d8('0x31')]({'model':db[_0x94d8('0x6d')],'as':'User','attributes':['id','fullname'],'raw':!![]});_0x4014ea[_0x94d8('0x31')]({'model':db[_0x94d8('0xc8')],'as':'Contact','attributes':['id',_0x94d8('0xc9'),_0x94d8('0xca')],'raw':!![]});var _0x2fb953=[{'model':db['SmsMessage'],'as':_0x94d8('0xcb'),'attributes':['id','body','createdAt','direction',_0x94d8('0xcc'),_0x94d8('0x7b')],'include':_0x4014ea}];_0x2fb953[_0x94d8('0x31')]({'model':db['SmsAccount'],'as':'Account','attributes':['id','name']});_0x2fb953[_0x94d8('0x31')]({'model':db['User'],'as':_0x94d8('0xcd'),'attributes':['id',_0x94d8('0xce')]});return db[_0x94d8('0x98')][_0x94d8('0x5c')]({'where':{'id':_0x506e30[_0x94d8('0xae')]['id']},'include':_0x2fb953})[_0x94d8('0x28')](handleEntityNotFound(_0xc32e4c,null))[_0x94d8('0x28')](function(_0x542893){if(_0x542893){var _0x38e7aa=_0x542893[_0x94d8('0xcf')]({'plain':!![]});fs[_0x94d8('0xd0')](_0x323d6e);var _0x3994ab={'channel':'Sms','account':_0x38e7aa['Account'][_0x94d8('0x2a')],'agent':_0x38e7aa[_0x94d8('0xcd')]?_0x38e7aa[_0x94d8('0xcd')][_0x94d8('0xce')]:_0x94d8('0xd1'),'createdAt':moment(_0x38e7aa[_0x94d8('0x76')])[_0x94d8('0xb9')](_0x94d8('0xba'))[_0x94d8('0x95')](),'closedAt':_0x38e7aa['closed']?moment(_0x38e7aa[_0x94d8('0xd2')])[_0x94d8('0xb9')](_0x94d8('0xba'))[_0x94d8('0x95')]():'','disposition':_0x38e7aa[_0x94d8('0xd3')],'messages':_(_0x38e7aa['Messages'])[_0x94d8('0x80')]({'secret':![]})['map'](function(_0x452006){return{'date':moment(_0x452006['createdAt'])['format'](_0x94d8('0xba'))[_0x94d8('0x95')](),'sender':_0x452006[_0x94d8('0xd4')]===_0x94d8('0xd5')?_0x452006['User']?_0x452006[_0x94d8('0x6d')][_0x94d8('0xce')]:_0x94d8('0xd6'):_0x452006[_0x94d8('0x62')][_0x94d8('0xc9')]+(_0x452006['Contact'][_0x94d8('0xca')]?'\x20'+_0x452006[_0x94d8('0x62')]['lastName']:''),'body':_0x452006['body'],'direction':_0x452006[_0x94d8('0xd4')]===_0x94d8('0xd5')?'A':'C','secret':_0x452006[_0x94d8('0xcc')],'read':_0x452006[_0x94d8('0x7b')]};})['value']()};return ejs[_0x94d8('0xd7')](path[_0x94d8('0xc6')](config[_0x94d8('0xc3')],_0x94d8('0xc4'),'views',_0x94d8('0xd8')),{'interaction':_0x3994ab})[_0x94d8('0x28')](function(_0x16d181){var _0x348a81=path[_0x94d8('0xc6')](_0x323d6e,_0x94d8('0xd9')+_0x38e7aa['id']+'-'+_0x5d1353+'.pdf');var _0x1923bd={'path':_0x348a81,'channel':_0x94d8('0xda'),'interactionId':_0x38e7aa['id']};return pdf[_0x94d8('0xdb')](_0x16d181,_0x1923bd);})[_0x94d8('0x28')](function(){return new BPromise(function(_0x46b796,_0x5784b3){zipdir(_0x323d6e,{'saveTo':_0x5b4d88},function(_0x2119db,_0x2a722b){if(_0x2119db)return _0x5784b3(_0x2119db);return _0x46b796(_0x2a722b);});})[_0x94d8('0x28')](function(){return new BPromise(function(_0x576f93,_0x38d347){rimraf(_0x323d6e,function(_0x10b827){if(_0x10b827)_0x38d347(_0x10b827);return _0x576f93();});});})[_0x94d8('0x28')](function(){return _0xc32e4c[_0x94d8('0xdc')](_0x5b4d88,_0x42e80f,function(_0x5e2f98){if(_0x5e2f98){console['log'](_0x94d8('0xdd'),_0x5e2f98);}else{fs[_0x94d8('0xde')](_0x5b4d88);}});});});}else{return _0xc32e4c['sendStatus'](0xc8);}})[_0x94d8('0x32')](handleError(_0xc32e4c,null));}; \ No newline at end of file +var _0xbb8e=['start','Tag','union','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','body','type','some','compact','isEmpty','SmsAccountId','i.SmsAccountId\x20IN\x20?','concat','createdAt','$gte','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','read','`unreadMessages`\x20>\x200','tag','isArray','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','filter','replace','isNumeric','i.id\x20LIKE\x20?','i.phone\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','SELECT','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','DESC','t.id\x20IN\x20?','i.SmsAccountId\x20IS\x20NOT\x20NULL','user','agent','getSmsAccounts','i.SmsAccountId\x20IS\x20NULL','role','sequelize','toString','keyBy','a.key','Account.key','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','Contact.firstName','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','o.fullname','Owner.fullname','o.internal','GROUP_CONCAT(DISTINCT\x20t.id)','groupBy','SmsInteractionId','all','rows','show','params','includeAll','merge','create','destroy','describe','addMessage','ids','omit','findOne','SmsMessage','hasOwnProperty','nolimit','format','YYYY-MM-DD\x20HH:mm:ss','include','findAll','addTags','setTags','spread','emit','smsInteractionTags:save','removeTags','unix','join','root','files','server','attachments','transcript-%d-%s.zip','Contact','firstName','lastName','Messages','direction','secret','SmsAccount','User','Owner','fullname','get','mkdirSync','Account','N.A.','closedAt','out','System','renderFile','views','downloadInteraction.ejs','transcript-','Sms','log','err','unlinkSync','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','localhost','socket.io-emitter','redis','./smsInteraction.socket','register','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','then','end','error','stack','send','Users','TagIds','Tags','forEach','push','catch','index','SmsInteraction','rawAttributes','key','map','query','keys','intersection','model','attributes','fields','length','order','sort','where','filters','pick','select','field','name','color','tools_tags','ui.SmsInteractionId','from','user_has_sms_interactions','left_join','users','u.id\x20=\x20ui.UserId','sms_interactions','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','a.id\x20=\x20i.SmsAccountId','sms_messages','me.SmsInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','search','sqlOperator','conditions','find','unreadMessages','value','having','`\x20=\x200','`\x20>\x200','operator','$substring','split','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','text'];(function(_0x5e93df,_0xfd611a){var _0x2d16f1=function(_0x8efa67){while(--_0x8efa67){_0x5e93df['push'](_0x5e93df['shift']());}};_0x2d16f1(++_0xfd611a);}(_0xbb8e,0x164));var _0xebb8=function(_0x40d2be,_0x4b7661){_0x40d2be=_0x40d2be-0x0;var _0x52a6b2=_0xbb8e[_0x40d2be];return _0x52a6b2;};'use strict';var emlformat=require(_0xebb8('0x0'));var rimraf=require(_0xebb8('0x1'));var zipdir=require(_0xebb8('0x2'));var jsonpatch=require(_0xebb8('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xebb8('0x4'));var Mustache=require('mustache');var util=require(_0xebb8('0x5'));var path=require(_0xebb8('0x6'));var sox=require(_0xebb8('0x7'));var csv=require('to-csv');var ejs=require(_0xebb8('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xebb8('0x9'));var squel=require(_0xebb8('0xa'));var crypto=require(_0xebb8('0xb'));var jsforce=require(_0xebb8('0xc'));var deskjs=require(_0xebb8('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xebb8('0xe'));var authService=require(_0xebb8('0xf'));var qs=require(_0xebb8('0x10'));var as=require(_0xebb8('0x11'));var pdf=require(_0xebb8('0x12'));var hardwareService=require(_0xebb8('0x13'));var logger=require(_0xebb8('0x14'))('api');var utils=require(_0xebb8('0x15'));var config=require(_0xebb8('0x16'));var licenseUtil=require(_0xebb8('0x17'));var db=require(_0xebb8('0x18'))['db'];config['redis']=_[_0xebb8('0x19')](config['redis'],{'host':_0xebb8('0x1a'),'port':0x18eb});var socket=require(_0xebb8('0x1b'))(new Redis(config[_0xebb8('0x1c')]));require(_0xebb8('0x1d'))[_0xebb8('0x1e')](socket);function respondWithStatusCode(_0x4e5b34,_0x57ec01){_0x57ec01=_0x57ec01||0xcc;return function(_0x1e1dfb){if(_0x1e1dfb){return _0x4e5b34[_0xebb8('0x1f')](_0x57ec01);}return _0x4e5b34[_0xebb8('0x20')](_0x57ec01)['end']();};}function respondWithResult(_0x123474,_0x22f88e){_0x22f88e=_0x22f88e||0xc8;return function(_0x4a9b09){if(_0x4a9b09){return _0x123474['status'](_0x22f88e)[_0xebb8('0x21')](_0x4a9b09);}};}function respondWithFilteredResult(_0x266d71,_0x118c70){return function(_0x407637){if(_0x407637){var _0x516575=typeof _0x118c70[_0xebb8('0x22')]===_0xebb8('0x23')&&typeof _0x118c70[_0xebb8('0x24')]===_0xebb8('0x23');var _0x5343c9=_0x407637[_0xebb8('0x25')];var _0x528a94=_0x516575?0x0:_0x118c70['offset'];var _0x570766=_0x516575?_0x407637[_0xebb8('0x25')]:_0x118c70[_0xebb8('0x22')]+_0x118c70['limit'];var _0x29bd25;if(_0x570766>=_0x5343c9){_0x570766=_0x5343c9;_0x29bd25=0xc8;}else{_0x29bd25=0xce;}_0x266d71['status'](_0x29bd25);return _0x266d71[_0xebb8('0x26')](_0xebb8('0x27'),_0x528a94+'-'+_0x570766+'/'+_0x5343c9)['json'](_0x407637);}return null;};}function patchUpdates(_0x35c15d){return function(_0x22db37){try{jsonpatch[_0xebb8('0x28')](_0x22db37,_0x35c15d,!![]);}catch(_0x4897d8){return BPromise[_0xebb8('0x29')](_0x4897d8);}return _0x22db37['save']();};}function saveUpdates(_0x43278b,_0x378298){return function(_0x1c77df){if(_0x1c77df){return _0x1c77df['update'](_0x43278b)[_0xebb8('0x2a')](function(_0x1233a2){return _0x1233a2;});}return null;};}function removeEntity(_0xafcc13,_0x33dae3){return function(_0x2ddf4d){if(_0x2ddf4d){return _0x2ddf4d['destroy']()[_0xebb8('0x2a')](function(){_0xafcc13['status'](0xcc)[_0xebb8('0x2b')]();});}};}function handleEntityNotFound(_0x146bf3,_0x3ce39b){return function(_0x576e04){if(!_0x576e04){_0x146bf3[_0xebb8('0x1f')](0x194);}return _0x576e04;};}function handleError(_0x141c63,_0x1d2d5a){_0x1d2d5a=_0x1d2d5a||0x1f4;return function(_0x47d925){logger[_0xebb8('0x2c')](_0x47d925[_0xebb8('0x2d')]);if(_0x47d925['name']){delete _0x47d925['name'];}_0x141c63[_0xebb8('0x20')](_0x1d2d5a)[_0xebb8('0x2e')](_0x47d925);};}function getInteractionUsers(_0x59b4ef,_0x5d7878){return new BPromise(function(_0x46ac95,_0x2d02b0){try{if(_0x5d7878[_0x59b4ef['id']]){_0x59b4ef[_0xebb8('0x2f')]=_['map'](_0x5d7878[_0x59b4ef['id']],function(_0x198b4a){return{'id':_0x198b4a['id'],'fullname':_0x198b4a['fullname']};});}}catch(_0x581ef7){_0x2d02b0(_0x581ef7);}_0x46ac95(_0x59b4ef);});}function getInteractionTags(_0x16c1a7,_0x4fc262){return new BPromise(function(_0x5a6bc3,_0x47e634){try{if(_0x16c1a7[_0xebb8('0x30')]){_0x16c1a7[_0xebb8('0x31')]=[];_0x16c1a7[_0xebb8('0x30')]['split'](',')[_0xebb8('0x32')](function(_0x2a44aa){_0x16c1a7[_0xebb8('0x31')][_0xebb8('0x33')](_0x4fc262[_0x2a44aa]);});}delete _0x16c1a7[_0xebb8('0x30')];}catch(_0x4c48ad){_0x47e634(_0x4c48ad);}_0x5a6bc3(_0x16c1a7);});}function updateSmsInteraction(_0x37a04b,_0x127fc3,_0x4beb3b){return new BPromise(function(_0x412270,_0x24b4fa){return getInteractionUsers(_0x37a04b,_0x4beb3b)[_0xebb8('0x2a')](function(_0x3d36eb){return getInteractionTags(_0x3d36eb,_0x127fc3);})[_0xebb8('0x2a')](function(_0x10abd4){_0x412270(_0x10abd4);})[_0xebb8('0x34')](function(_0x9055c5){_0x24b4fa(_0x9055c5);});});}exports[_0xebb8('0x35')]=function(_0x55099f,_0x62b99d){var _0x4313c6={},_0x11de1c={},_0x15bb66={'count':0x0,'rows':[]};var _0x46a6dd=_['map'](db[_0xebb8('0x36')][_0xebb8('0x37')],function(_0xa9fe92){return{'name':_0xa9fe92['fieldName'],'type':_0xa9fe92['type'][_0xebb8('0x38')]};});_0x11de1c['model']=_[_0xebb8('0x39')](_0x46a6dd,'name');_0x11de1c[_0xebb8('0x3a')]=_[_0xebb8('0x3b')](_0x55099f['query']);_0x11de1c['filters']=_[_0xebb8('0x3c')](_0x11de1c[_0xebb8('0x3d')],_0x11de1c['query']);_0x4313c6[_0xebb8('0x3e')]=_['intersection'](_0x11de1c['model'],qs[_0xebb8('0x3f')](_0x55099f['query'][_0xebb8('0x3f')]));_0x4313c6['attributes']=_0x4313c6[_0xebb8('0x3e')][_0xebb8('0x40')]?_0x4313c6[_0xebb8('0x3e')]:_0x11de1c[_0xebb8('0x3d')];if(!_0x55099f[_0xebb8('0x3a')]['hasOwnProperty']('nolimit')){_0x4313c6['limit']=qs[_0xebb8('0x24')](_0x55099f[_0xebb8('0x3a')][_0xebb8('0x24')]);_0x4313c6['offset']=qs[_0xebb8('0x22')](_0x55099f['query'][_0xebb8('0x22')]);}_0x4313c6[_0xebb8('0x41')]=qs[_0xebb8('0x42')](_0x55099f[_0xebb8('0x3a')][_0xebb8('0x42')]);_0x4313c6[_0xebb8('0x43')]=qs[_0xebb8('0x44')](_[_0xebb8('0x45')](_0x55099f[_0xebb8('0x3a')],_0x11de1c[_0xebb8('0x44')]),_0x46a6dd);var _0x5df3d3=[];var _0x18f3e5=squel[_0xebb8('0x46')]()[_0xebb8('0x47')]('id')[_0xebb8('0x47')](_0xebb8('0x48'))[_0xebb8('0x47')](_0xebb8('0x49'))['from'](_0xebb8('0x4a'));var _0x25f4c5=squel[_0xebb8('0x46')]()[_0xebb8('0x47')]('u.id')[_0xebb8('0x47')]('u.fullname')[_0xebb8('0x47')](_0xebb8('0x4b'))[_0xebb8('0x4c')](_0xebb8('0x4d'),'ui')[_0xebb8('0x4e')](_0xebb8('0x4f'),'u',_0xebb8('0x50'));var _0xbf03df=squel[_0xebb8('0x46')]()['from'](_0xebb8('0x51'),'i')['left_join']('cm_contacts','c',_0xebb8('0x52'))[_0xebb8('0x4e')](_0xebb8('0x4f'),'o',_0xebb8('0x53'))[_0xebb8('0x4e')]('sms_accounts','a',_0xebb8('0x54'))[_0xebb8('0x4e')](_0xebb8('0x55'),'me',_0xebb8('0x56'))[_0xebb8('0x4e')]('sms_interaction_has_tags','it','it.SmsInteractionId\x20=\x20i.id')[_0xebb8('0x4e')](_0xebb8('0x4a'),'t',_0xebb8('0x57'));var _0x3431bc=squel['expr']();var _0x1598f1=[];var _0x9f91c5=squel['expr']();var _0x5615db;if(_0x55099f['query'][_0xebb8('0x58')]){_0x5615db=as['parseSearch'](_0x55099f[_0xebb8('0x3a')][_0xebb8('0x58')]);var _0x3ada32=_0x5615db[_0xebb8('0x59')];for(var _0x2942e4=0x0;_0x2942e4<_0x5615db[_0xebb8('0x5a')][_0xebb8('0x40')];_0x2942e4++){var _0x19af05=_0x5615db[_0xebb8('0x5a')][_0x2942e4];var _0x5bb96c='i';var _0x3c8573=_[_0xebb8('0x5b')](_0x46a6dd,[_0xebb8('0x48'),_0x19af05['field']]);if(!_0x3c8573){switch(_0x19af05['field']){case _0xebb8('0x5c'):if(_0x19af05[_0xebb8('0x5d')]==0x1){_0xbf03df[_0xebb8('0x5e')]('`'+_0x19af05[_0xebb8('0x47')]+_0xebb8('0x5f'));}else{_0xbf03df[_0xebb8('0x5e')]('`'+_0x19af05[_0xebb8('0x47')]+_0xebb8('0x60'));}break;case'Contact':if(_0x19af05[_0xebb8('0x61')]===_0xebb8('0x62')){if(_0x19af05[_0xebb8('0x5d')][_0xebb8('0x63')]('\x20')[_0xebb8('0x40')]>0x1){_0x3431bc[_0x3ada32](_0xebb8('0x64'),qs[_0xebb8('0x65')](_0x19af05[_0xebb8('0x5d')]),null);}else{var _0x54017f='%'+_0x19af05['value']+'%';_0x3431bc[_0x3ada32](_0xebb8('0x66'),_0x54017f,_0x54017f,_0x54017f);}}else{_0x3c8573=_['find'](_0x46a6dd,['name',_0xebb8('0x67')]);_0x19af05['field']=_0xebb8('0x67');_0xf98a0a=as[_0xebb8('0x68')](_0x5bb96c,_0x3c8573['type'],_0x19af05);_0x3431bc[_0x3ada32](_0xf98a0a[_0xebb8('0x69')],_0xf98a0a[_0xebb8('0x5d')][_0xebb8('0x6a')],_0xf98a0a[_0xebb8('0x5d')][_0xebb8('0x2b')]);}break;case _0xebb8('0x6b'):var _0x5f2957=_0x19af05[_0xebb8('0x5d')][_0xebb8('0x63')](',')['map'](function(_0x2aa51c){return Number(_0x2aa51c);});_0x5f2957[_0xebb8('0x32')](function(_0x173032){_0x9f91c5['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x173032+',%');});_0x1598f1=_[_0xebb8('0x6c')](_0x1598f1,_0x5f2957);break;case'User':if(_0x19af05[_0xebb8('0x61')]==='$substring'){_0x3431bc[_0x3ada32](_0xebb8('0x6d'),'%'+_0x19af05[_0xebb8('0x5d')]+'%',null);}else{_0x3c8573=_[_0xebb8('0x5b')](_0x46a6dd,[_0xebb8('0x48'),_0xebb8('0x6e')]);_0x19af05[_0xebb8('0x47')]=_0xebb8('0x6e');_0xf98a0a=as['buildExpression'](_0x5bb96c,_0x3c8573['type'],_0x19af05);_0x3431bc[_0x3ada32](_0xf98a0a[_0xebb8('0x69')],_0xf98a0a['value'][_0xebb8('0x6a')],_0xf98a0a['value'][_0xebb8('0x2b')]);}break;case _0xebb8('0x6f'):_0xf98a0a=as[_0xebb8('0x68')]('me',null,_0x19af05);_0x3431bc[_0x3ada32](_0xf98a0a['text'],_0xf98a0a[_0xebb8('0x5d')][_0xebb8('0x6a')],_0xf98a0a['value'][_0xebb8('0x2b')]);break;}}else{var _0xf98a0a=as[_0xebb8('0x68')](_0x5bb96c,_0x3c8573[_0xebb8('0x70')],_0x19af05);_0x3431bc[_0x3ada32](_0xf98a0a[_0xebb8('0x69')],_0xf98a0a[_0xebb8('0x5d')][_0xebb8('0x6a')],_0xf98a0a[_0xebb8('0x5d')][_0xebb8('0x2b')]);}}}else{var _0x1cea3a=_(_0x55099f[_0xebb8('0x3a')])[_0xebb8('0x3b')]()[_0xebb8('0x39')](function(_0x24a9e7){return _[_0xebb8('0x71')](_0x46a6dd,['name',_0x24a9e7])?_0x24a9e7:undefined;})[_0xebb8('0x72')]()[_0xebb8('0x5d')]();if(!_[_0xebb8('0x73')](_0x1cea3a)){_0x1cea3a[_0xebb8('0x32')](function(_0x19816c){if(_0x19816c===_0xebb8('0x74')){_0xbf03df[_0xebb8('0x43')](_0xebb8('0x75'),[][_0xebb8('0x76')](_0x55099f[_0xebb8('0x3a')][_0x19816c]));}else if(_0x19816c===_0xebb8('0x77')){var _0x2ed2d3=JSON['parse'](_0x55099f[_0xebb8('0x3a')][_0x19816c])[_0xebb8('0x78')];var _0x40bbea=JSON[_0xebb8('0x79')](_0x55099f[_0xebb8('0x3a')][_0x19816c])[_0xebb8('0x7a')];_0xbf03df[_0xebb8('0x43')](_0xebb8('0x7b'),_0x2ed2d3,_0x40bbea);}else{if(_0x55099f[_0xebb8('0x3a')][_0x19816c]===_0xebb8('0x7c')){_0xbf03df[_0xebb8('0x43')]('i.'+_0x19816c+_0xebb8('0x7d'));}else{_0xbf03df['where']('i.'+_0x19816c+'\x20=\x20?',_0x55099f['query'][_0x19816c]);}}});}if(_0x55099f['query']['read']){if(_0x55099f['query'][_0xebb8('0x7e')]==0x1){_0xbf03df[_0xebb8('0x5e')]('`unreadMessages`\x20=\x200');}else{_0xbf03df[_0xebb8('0x5e')](_0xebb8('0x7f'));}}if(_0x55099f[_0xebb8('0x3a')][_0xebb8('0x80')]){_0x1598f1=_[_0xebb8('0x81')](_0x55099f['query'][_0xebb8('0x80')])?_0x55099f[_0xebb8('0x3a')]['tag']:new Array(_0x55099f[_0xebb8('0x3a')][_0xebb8('0x80')]);_0x1598f1[_0xebb8('0x32')](function(_0x5ec076){_0x9f91c5['or'](_0xebb8('0x82'),'%,'+_0x5ec076+',%');});}if(_0x55099f['query'][_0xebb8('0x83')]){var _0x146ec4=_0x55099f[_0xebb8('0x3a')][_0xebb8('0x83')][_0xebb8('0x84')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs[_0xebb8('0x85')](_0x146ec4)){_0x3431bc['or'](_0xebb8('0x86'),_0x146ec4+'%')['or'](_0xebb8('0x87'),_0x146ec4+'%');}else{_0x3431bc['or'](_0xebb8('0x88'),qs['getFullTextValue'](_0x146ec4))['or'](_0xebb8('0x89'),_0x146ec4+'%');}}}_0xbf03df[_0xebb8('0x43')](_0x3431bc);_0xbf03df[_0xebb8('0x8a')](_0xebb8('0x8b'));var _0x35bfab={'type':db[_0xebb8('0x8c')]['QueryTypes'][_0xebb8('0x8d')],'raw':!![]};var _0x16743f=_0xbf03df['clone']();_0x16743f[_0xebb8('0x47')]('i.id');_0x16743f[_0xebb8('0x47')](_0xebb8('0x8e'),_0xebb8('0x5c'));if(_0x4313c6[_0xebb8('0x41')]){_0x4313c6['order'][_0xebb8('0x32')](function(_0x104383){var _0x50249e=_0x104383[0x0]===_0xebb8('0x8f')?_0x104383[0x0]:'i.'+_0x104383[0x0];_0xbf03df[_0xebb8('0x41')](_0x50249e,_0x104383[0x1]===_0xebb8('0x90')?![]:!![]);});}if(!_[_0xebb8('0x73')](_0x1598f1)){_0xbf03df[_0xebb8('0x5e')](_0x9f91c5);_0x16743f['where'](_0xebb8('0x91'),_0x1598f1);}BPromise['resolve']()[_0xebb8('0x2a')](function(){if(!_0x5615db){if(_0x55099f[_0xebb8('0x3a')][_0xebb8('0x74')])return;_0x16743f[_0xebb8('0x43')](_0xebb8('0x92'));_0xbf03df['where']('i.SmsAccountId\x20IS\x20NOT\x20NULL');return;}if(_0x55099f[_0xebb8('0x93')]['role']!==_0xebb8('0x94'))return;return _0x55099f[_0xebb8('0x93')][_0xebb8('0x95')]({'attributes':['id'],'raw':!![]})['then'](function(_0xd60ee9){if(_[_0xebb8('0x73')](_0xd60ee9)){_0x16743f[_0xebb8('0x43')](_0xebb8('0x96'));_0xbf03df[_0xebb8('0x43')]('i.SmsAccountId\x20IS\x20NULL');}else{_0x16743f[_0xebb8('0x43')](_0xebb8('0x75'),_['map'](_0xd60ee9,'id'));_0xbf03df['where'](_0xebb8('0x75'),_[_0xebb8('0x39')](_0xd60ee9,'id'));}});})[_0xebb8('0x2a')](function(){if(_0x55099f[_0xebb8('0x93')][_0xebb8('0x97')]===_0xebb8('0x94')&&!_0x5615db&&!_0x55099f['query'][_0xebb8('0x74')])return[];return db[_0xebb8('0x98')][_0xebb8('0x3a')](_0x16743f['toString'](),_0x35bfab);})[_0xebb8('0x2a')](function(_0x614191){_0x15bb66['count']=_0x614191[_0xebb8('0x40')];if(_0x15bb66['count']===0x0)return[];return db['sequelize'][_0xebb8('0x3a')](_0x18f3e5[_0xebb8('0x99')](),_0x35bfab)['then'](function(_0x5abf84){_0x5df3d3=_[_0xebb8('0x9a')](_0x5abf84,'id');_0x35bfab=_['merge'](_0x35bfab,{'model':db['SmsInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x55099f[_0xebb8('0x3a')][_0xebb8('0x3f')]){_0x4313c6[_0xebb8('0x3e')][_0xebb8('0x32')](function(_0xff7f76){_0xbf03df[_0xebb8('0x47')]('i.'+_0xff7f76);});}else{_0xbf03df[_0xebb8('0x47')](_0xebb8('0x8e'),_0xebb8('0x5c'));_0xbf03df[_0xebb8('0x47')](_0xebb8('0x9b'),_0xebb8('0x9c'));_0xbf03df[_0xebb8('0x47')]('a.mandatoryDisposition',_0xebb8('0x9d'));_0xbf03df[_0xebb8('0x47')](_0xebb8('0x9e'),_0xebb8('0x8f'));_0xbf03df[_0xebb8('0x47')](_0xebb8('0x9f'));_0xbf03df[_0xebb8('0x47')](_0xebb8('0xa0'),_0xebb8('0xa1'));_0xbf03df['field']('c.lastName','Contact.lastName');_0xbf03df[_0xebb8('0x47')]('c.email','Contact.email');_0xbf03df['field'](_0xebb8('0xa2'),_0xebb8('0xa3'));_0xbf03df['field'](_0xebb8('0xa4'),_0xebb8('0xa5'));_0xbf03df[_0xebb8('0x47')](_0xebb8('0xa6'),'Contact.fax');_0xbf03df[_0xebb8('0x47')](_0xebb8('0xa7'),_0xebb8('0xa8'));_0xbf03df[_0xebb8('0x47')](_0xebb8('0xa9'),'Owner.internal');_0xbf03df[_0xebb8('0x47')](_0xebb8('0xaa'),_0xebb8('0x30'));}if(_0x4313c6[_0xebb8('0x24')])_0xbf03df['limit'](_0x4313c6['limit']);if(_0x4313c6[_0xebb8('0x22')])_0xbf03df[_0xebb8('0x22')](_0x4313c6[_0xebb8('0x22')]);return db[_0xebb8('0x98')][_0xebb8('0x3a')](_0xbf03df[_0xebb8('0x99')](),_0x35bfab);})[_0xebb8('0x2a')](function(_0x4782cb){if(_0x4782cb[_0xebb8('0x40')]>0x0)_0x25f4c5[_0xebb8('0x43')]('ui.SmsInteractionId\x20IN\x20?',_[_0xebb8('0x39')](_0x4782cb,'id'));return db[_0xebb8('0x98')][_0xebb8('0x3a')](_0x25f4c5['toString'](),_0x35bfab)[_0xebb8('0x2a')](function(_0x5092c2){var _0x2399bc=_[_0xebb8('0xab')](_0x5092c2,_0xebb8('0xac'));var _0x23747b=[];_0x4782cb[_0xebb8('0x32')](function(_0x3df2c6){_0x23747b[_0xebb8('0x33')](updateSmsInteraction(_0x3df2c6,_0x5df3d3,_0x2399bc));});return BPromise[_0xebb8('0xad')](_0x23747b);});});})[_0xebb8('0x2a')](function(_0x17bcd4){_0x15bb66[_0xebb8('0xae')]=_0x17bcd4;return _0x15bb66;})[_0xebb8('0x2a')](respondWithFilteredResult(_0x62b99d,_0x4313c6))[_0xebb8('0x34')](handleError(_0x62b99d,null));};exports[_0xebb8('0xaf')]=function(_0x344b65,_0x2b3dcf){var _0x297043={'raw':![],'where':{'id':_0x344b65[_0xebb8('0xb0')]['id']}},_0x1014cb={};_0x1014cb['model']=_[_0xebb8('0x3b')](db[_0xebb8('0x36')][_0xebb8('0x37')]);_0x1014cb[_0xebb8('0x3a')]=_[_0xebb8('0x3b')](_0x344b65[_0xebb8('0x3a')]);_0x1014cb[_0xebb8('0x44')]=_[_0xebb8('0x3c')](_0x1014cb[_0xebb8('0x3d')],_0x1014cb[_0xebb8('0x3a')]);_0x297043[_0xebb8('0x3e')]=_[_0xebb8('0x3c')](_0x1014cb[_0xebb8('0x3d')],qs[_0xebb8('0x3f')](_0x344b65[_0xebb8('0x3a')][_0xebb8('0x3f')]));_0x297043[_0xebb8('0x3e')]=_0x297043['attributes']['length']?_0x297043[_0xebb8('0x3e')]:_0x1014cb[_0xebb8('0x3d')];if(_0x344b65[_0xebb8('0x3a')][_0xebb8('0xb1')]){_0x297043['include']=[{'all':!![]}];}_0x297043=_[_0xebb8('0xb2')]({},_0x297043,_0x344b65['options']);return db[_0xebb8('0x36')][_0xebb8('0x5b')](_0x297043)[_0xebb8('0x2a')](handleEntityNotFound(_0x2b3dcf,null))[_0xebb8('0x2a')](respondWithResult(_0x2b3dcf,null))[_0xebb8('0x34')](handleError(_0x2b3dcf,null));};exports['create']=function(_0x1c8046,_0x2856c7){return db[_0xebb8('0x36')][_0xebb8('0xb3')](_0x1c8046[_0xebb8('0x6f')],{})[_0xebb8('0x2a')](respondWithResult(_0x2856c7,0xc9))[_0xebb8('0x34')](handleError(_0x2856c7,null));};exports['update']=function(_0x37bc61,_0xcdaaa4){if(_0x37bc61[_0xebb8('0x6f')]['id']){delete _0x37bc61['body']['id'];}return db['SmsInteraction'][_0xebb8('0x5b')]({'where':{'id':_0x37bc61[_0xebb8('0xb0')]['id']}})[_0xebb8('0x2a')](handleEntityNotFound(_0xcdaaa4,null))[_0xebb8('0x2a')](saveUpdates(_0x37bc61['body'],null))[_0xebb8('0x2a')](respondWithResult(_0xcdaaa4,null))['catch'](handleError(_0xcdaaa4,null));};exports[_0xebb8('0xb4')]=function(_0x1a6abb,_0x49ee23){return db[_0xebb8('0x36')]['find']({'where':{'id':_0x1a6abb[_0xebb8('0xb0')]['id']}})['then'](handleEntityNotFound(_0x49ee23,null))[_0xebb8('0x2a')](removeEntity(_0x49ee23,null))[_0xebb8('0x34')](handleError(_0x49ee23,null));};exports[_0xebb8('0xb5')]=function(_0x57904f,_0x473fc9){return db[_0xebb8('0x36')][_0xebb8('0xb5')]()[_0xebb8('0x2a')](respondWithResult(_0x473fc9,null))[_0xebb8('0x34')](handleError(_0x473fc9,null));};exports['addMessage']=function(_0x2b23b9,_0x1f3273,_0x35e550){return db['SmsMessage'][_0xebb8('0x5b')]({'where':{'id':_0x2b23b9['params']['id']}})[_0xebb8('0x2a')](handleEntityNotFound(_0x1f3273,null))[_0xebb8('0x2a')](function(_0x5125c7){if(_0x5125c7){return _0x5125c7[_0xebb8('0xb6')](_0x2b23b9[_0xebb8('0x6f')][_0xebb8('0xb7')],_[_0xebb8('0xb8')](_0x2b23b9['body'],['ids','id'])||{});}})[_0xebb8('0x2a')](respondWithResult(_0x1f3273,null))[_0xebb8('0x34')](handleError(_0x1f3273,null));};exports['getMessages']=function(_0x58e9b0,_0x1aca9f,_0x3375b9){var _0x4dee4d={'raw':![],'where':{}};var _0x550e93={};var _0x1ffdd8={'count':0x0,'rows':[]};return db[_0xebb8('0x36')][_0xebb8('0xb9')]({'where':{'id':_0x58e9b0[_0xebb8('0xb0')]['id']}})['then'](handleEntityNotFound(_0x1aca9f,null))[_0xebb8('0x2a')](function(_0x59c677){if(_0x59c677){_0x550e93[_0xebb8('0x3d')]=_[_0xebb8('0x3b')](db[_0xebb8('0xba')][_0xebb8('0x37')]);_0x550e93[_0xebb8('0x3a')]=_[_0xebb8('0x3b')](_0x58e9b0[_0xebb8('0x3a')]);_0x550e93['filters']=_[_0xebb8('0x3c')](_0x550e93['model'],_0x550e93[_0xebb8('0x3a')]);_0x4dee4d[_0xebb8('0x3e')]=_[_0xebb8('0x3c')](_0x550e93[_0xebb8('0x3d')],qs[_0xebb8('0x3f')](_0x58e9b0['query'][_0xebb8('0x3f')]));_0x4dee4d[_0xebb8('0x3e')]=_0x4dee4d[_0xebb8('0x3e')][_0xebb8('0x40')]?_0x4dee4d[_0xebb8('0x3e')]:_0x550e93[_0xebb8('0x3d')];if(!_0x58e9b0['query'][_0xebb8('0xbb')](_0xebb8('0xbc'))){_0x4dee4d[_0xebb8('0x24')]=qs[_0xebb8('0x24')](_0x58e9b0[_0xebb8('0x3a')][_0xebb8('0x24')]);_0x4dee4d[_0xebb8('0x22')]=qs[_0xebb8('0x22')](_0x58e9b0[_0xebb8('0x3a')][_0xebb8('0x22')]);}_0x4dee4d[_0xebb8('0x41')]=qs[_0xebb8('0x42')](_0x58e9b0['query'][_0xebb8('0x42')]);_0x4dee4d[_0xebb8('0x43')]=qs[_0xebb8('0x44')](_['pick'](_0x58e9b0[_0xebb8('0x3a')],_0x550e93['filters']));_0x4dee4d['where']['SmsInteractionId']=_0x59c677['id'];if(_0x58e9b0[_0xebb8('0x3a')][_0xebb8('0x83')]){_0x4dee4d[_0xebb8('0x43')]=_[_0xebb8('0xb2')](_0x4dee4d[_0xebb8('0x43')],{'$or':_[_0xebb8('0x39')](_0x4dee4d[_0xebb8('0x3e')],function(_0x538ba0){var _0x5480f4={};_0x5480f4[_0x538ba0]={'$like':'%'+_0x58e9b0[_0xebb8('0x3a')][_0xebb8('0x83')]+'%'};return _0x5480f4;})});}if(_0x58e9b0[_0xebb8('0x3a')]['$gte']){var _0x587aa5=_0x58e9b0[_0xebb8('0x3a')][_0xebb8('0x78')][_0xebb8('0x63')](',');var _0x38981f={};_0x38981f[_0x587aa5[0x0]]={'$gte':moment(_0x587aa5[0x1])[_0xebb8('0xbd')](_0xebb8('0xbe'))};_0x4dee4d[_0xebb8('0x43')]=_['merge'](_0x4dee4d['where'],_0x38981f);}_0x4dee4d=_[_0xebb8('0xb2')]({},_0x4dee4d,_0x58e9b0['options']);return db['SmsMessage'][_0xebb8('0x25')]({'where':_0x4dee4d[_0xebb8('0x43')]})[_0xebb8('0x2a')](function(_0x22e145){_0x1ffdd8[_0xebb8('0x25')]=_0x22e145;if(_0x58e9b0[_0xebb8('0x3a')][_0xebb8('0xb1')]){_0x4dee4d[_0xebb8('0xbf')]=[{'all':!![]}];}return db[_0xebb8('0xba')][_0xebb8('0xc0')](_0x4dee4d);})[_0xebb8('0x2a')](function(_0x40f040){_0x1ffdd8[_0xebb8('0xae')]=_0x40f040;return _0x1ffdd8;});}})['then'](respondWithFilteredResult(_0x1aca9f,_0x4dee4d))[_0xebb8('0x34')](handleError(_0x1aca9f,null));};exports[_0xebb8('0xc1')]=function(_0x3c2961,_0x104641,_0x442e0c){return db[_0xebb8('0x36')][_0xebb8('0x5b')]({'where':{'id':_0x3c2961[_0xebb8('0xb0')]['id']}})['then'](handleEntityNotFound(_0x104641,null))['then'](function(_0x27c244){if(_0x27c244){return _0x27c244[_0xebb8('0xc2')](_0x3c2961[_0xebb8('0x6f')][_0xebb8('0xb7')],_[_0xebb8('0xb8')](_0x3c2961[_0xebb8('0x6f')],[_0xebb8('0xb7'),'id'])||{})[_0xebb8('0xc3')](function(){return db[_0xebb8('0x6b')][_0xebb8('0xc0')]({'attributes':['id','name',_0xebb8('0x49')],'where':{'id':_0x3c2961['body'][_0xebb8('0xb7')]}});})[_0xebb8('0x2a')](function(_0x465abd){socket[_0xebb8('0xc4')](_0xebb8('0xc5'),{'id':Number(_0x3c2961[_0xebb8('0xb0')]['id']),'tags':_0x465abd||[]});return{'id':Number(_0x3c2961[_0xebb8('0xb0')]['id']),'tags':_0x465abd||[]};});}})['then'](respondWithResult(_0x104641,null))[_0xebb8('0x34')](handleError(_0x104641,null));};exports[_0xebb8('0xc6')]=function(_0x4097df,_0x37924e,_0x17b6c0){return db[_0xebb8('0x36')]['find']({'where':{'id':_0x4097df[_0xebb8('0xb0')]['id']}})['then'](handleEntityNotFound(_0x37924e,null))[_0xebb8('0x2a')](function(_0x4f144e){if(_0x4f144e){return _0x4f144e[_0xebb8('0xc6')](_0x4097df[_0xebb8('0x3a')]['ids']);}})[_0xebb8('0x2a')](respondWithStatusCode(_0x37924e,null))[_0xebb8('0x34')](handleError(_0x37924e,null));};exports['download']=function(_0x395da5,_0x3ea7d1){var _0x59efc2=moment()[_0xebb8('0xc7')]()[_0xebb8('0x99')]();var _0x5728ca=path[_0xebb8('0xc8')](config[_0xebb8('0xc9')],'server',_0xebb8('0xca'),'tmp');var _0xf3d560=path['join'](config[_0xebb8('0xc9')],_0xebb8('0xcb'),_0xebb8('0xca'),_0xebb8('0xcc'));var _0x1cf265=path[_0xebb8('0xc8')](_0x5728ca,_0x59efc2);var _0x59e978=util[_0xebb8('0xbd')](_0xebb8('0xcd'),_0x395da5[_0xebb8('0xb0')]['id'],_0x59efc2);var _0x3984b1=path[_0xebb8('0xc8')](_0x5728ca,_0x59e978);var _0x5a0fb4=[];_0x5a0fb4[_0xebb8('0x33')]({'model':db['User'],'as':'User','attributes':['id','fullname'],'raw':!![]});_0x5a0fb4[_0xebb8('0x33')]({'model':db['CmContact'],'as':_0xebb8('0xce'),'attributes':['id',_0xebb8('0xcf'),_0xebb8('0xd0')],'raw':!![]});var _0x30721d=[{'model':db['SmsMessage'],'as':_0xebb8('0xd1'),'attributes':['id',_0xebb8('0x6f'),_0xebb8('0x77'),_0xebb8('0xd2'),_0xebb8('0xd3'),'read'],'include':_0x5a0fb4}];_0x30721d[_0xebb8('0x33')]({'model':db[_0xebb8('0xd4')],'as':'Account','attributes':['id',_0xebb8('0x48')]});_0x30721d[_0xebb8('0x33')]({'model':db[_0xebb8('0xd5')],'as':_0xebb8('0xd6'),'attributes':['id',_0xebb8('0xd7')]});return db[_0xebb8('0x36')][_0xebb8('0x5b')]({'where':{'id':_0x395da5[_0xebb8('0xb0')]['id']},'include':_0x30721d})['then'](handleEntityNotFound(_0x3ea7d1,null))['then'](function(_0x12f2f5){if(_0x12f2f5){var _0x15269a=_0x12f2f5[_0xebb8('0xd8')]({'plain':!![]});fs[_0xebb8('0xd9')](_0x1cf265);var _0x4a4363={'channel':'Sms','account':_0x15269a[_0xebb8('0xda')][_0xebb8('0x48')],'agent':_0x15269a[_0xebb8('0xd6')]?_0x15269a['Owner'][_0xebb8('0xd7')]:_0xebb8('0xdb'),'createdAt':moment(_0x15269a['createdAt'])[_0xebb8('0xbd')](_0xebb8('0xbe'))[_0xebb8('0x99')](),'closedAt':_0x15269a['closed']?moment(_0x15269a[_0xebb8('0xdc')])[_0xebb8('0xbd')](_0xebb8('0xbe'))['toString']():'','disposition':_0x15269a['disposition'],'messages':_(_0x15269a['Messages'])[_0xebb8('0x83')]({'secret':![]})[_0xebb8('0x39')](function(_0x7f28a5){return{'date':moment(_0x7f28a5[_0xebb8('0x77')])[_0xebb8('0xbd')]('YYYY-MM-DD\x20HH:mm:ss')[_0xebb8('0x99')](),'sender':_0x7f28a5['direction']===_0xebb8('0xdd')?_0x7f28a5[_0xebb8('0xd5')]?_0x7f28a5[_0xebb8('0xd5')]['fullname']:_0xebb8('0xde'):_0x7f28a5[_0xebb8('0xce')][_0xebb8('0xcf')]+(_0x7f28a5[_0xebb8('0xce')][_0xebb8('0xd0')]?'\x20'+_0x7f28a5[_0xebb8('0xce')][_0xebb8('0xd0')]:''),'body':_0x7f28a5[_0xebb8('0x6f')],'direction':_0x7f28a5['direction']===_0xebb8('0xdd')?'A':'C','secret':_0x7f28a5[_0xebb8('0xd3')],'read':_0x7f28a5[_0xebb8('0x7e')]};})[_0xebb8('0x5d')]()};return ejs[_0xebb8('0xdf')](path[_0xebb8('0xc8')](config[_0xebb8('0xc9')],_0xebb8('0xcb'),_0xebb8('0xe0'),_0xebb8('0xe1')),{'interaction':_0x4a4363})['then'](function(_0x1116f0){var _0x227c0c=path[_0xebb8('0xc8')](_0x1cf265,_0xebb8('0xe2')+_0x15269a['id']+'-'+_0x59efc2+'.pdf');var _0x4e998b={'path':_0x227c0c,'channel':_0xebb8('0xe3'),'interactionId':_0x15269a['id']};return pdf['createPdfFromHTML'](_0x1116f0,_0x4e998b);})[_0xebb8('0x2a')](function(){return new BPromise(function(_0x4d3e80,_0x534554){zipdir(_0x1cf265,{'saveTo':_0x3984b1},function(_0x26bcc6,_0x1310b1){if(_0x26bcc6)return _0x534554(_0x26bcc6);return _0x4d3e80(_0x1310b1);});})['then'](function(){return new BPromise(function(_0x11d821,_0x2d122a){rimraf(_0x1cf265,function(_0x12aeb7){if(_0x12aeb7)_0x2d122a(_0x12aeb7);return _0x11d821();});});})['then'](function(){return _0x3ea7d1['download'](_0x3984b1,_0x59e978,function(_0x42f636){if(_0x42f636){console[_0xebb8('0xe4')](_0xebb8('0xe5'),_0x42f636);}else{fs[_0xebb8('0xe6')](_0x3984b1);}});});});}else{return _0x3ea7d1[_0xebb8('0x1f')](0xc8);}})[_0xebb8('0x34')](handleError(_0x3ea7d1,null));}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.events.js b/server/api/smsInteraction/smsInteraction.events.js index 85c8b65..2a4573f 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 _0xefda=['length','emit','catch','hasOwnProperty','hook','exports','events','../../mysqldb','SmsMessage','save','update','remove','getUsers','then','setDataValue','map','findAll','unreadMessages'];(function(_0x39771f,_0x260dc3){var _0x3276c1=function(_0x5dc424){while(--_0x5dc424){_0x39771f['push'](_0x39771f['shift']());}};_0x3276c1(++_0x260dc3);}(_0xefda,0x96));var _0xaefd=function(_0x29a64c,_0x775ec7){_0x29a64c=_0x29a64c-0x0;var _0x1f2395=_0xefda[_0x29a64c];return _0x1f2395;};'use strict';var EventEmitter=require(_0xaefd('0x0'));var SmsInteraction=require('../../mysqldb')['db']['SmsInteraction'];var SmsMessage=require(_0xaefd('0x1'))['db'][_0xaefd('0x2')];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xaefd('0x3'),'afterUpdate':_0xaefd('0x4'),'afterDestroy':_0xaefd('0x5')};function emitEvent(_0x22df24){return function(_0x1ef6b4,_0x3288f9,_0x497258){_0x1ef6b4[_0xaefd('0x6')]({'attributes':['id'],'raw':!![]})[_0xaefd('0x7')](function(_0x24d10c){_0x1ef6b4[_0xaefd('0x8')]('Users',_0x24d10c[_0xaefd('0x9')](function(_0xbb04fb){return{'id':_0xbb04fb['id']};}));return SmsMessage[_0xaefd('0xa')]({'where':{'SmsInteractionId':_0x1ef6b4['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x48a255){_0x1ef6b4['setDataValue'](_0xaefd('0xb'),_0x48a255[_0xaefd('0xc')]);SmsInteractionEvents[_0xaefd('0xd')](_0x22df24+':'+_0x1ef6b4['id'],_0x1ef6b4);SmsInteractionEvents[_0xaefd('0xd')](_0x22df24,_0x1ef6b4);_0x497258(null);})[_0xaefd('0xe')](_0x497258(null));};}for(var e in events){if(events[_0xaefd('0xf')](e)){var event=events[e];SmsInteraction[_0xaefd('0x10')](e,emitEvent(event));}}module[_0xaefd('0x11')]=SmsInteractionEvents; \ No newline at end of file +var _0x63a5=['hook','exports','events','../../mysqldb','SmsInteraction','SmsMessage','save','update','remove','then','map','findAll','setDataValue','unreadMessages','length','emit','catch','hasOwnProperty'];(function(_0x34aada,_0x5597c1){var _0x4db440=function(_0x4f5118){while(--_0x4f5118){_0x34aada['push'](_0x34aada['shift']());}};_0x4db440(++_0x5597c1);}(_0x63a5,0x18e));var _0x563a=function(_0xa148b7,_0x2f3eb2){_0xa148b7=_0xa148b7-0x0;var _0x51efd3=_0x63a5[_0xa148b7];return _0x51efd3;};'use strict';var EventEmitter=require(_0x563a('0x0'));var SmsInteraction=require(_0x563a('0x1'))['db'][_0x563a('0x2')];var SmsMessage=require('../../mysqldb')['db'][_0x563a('0x3')];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x563a('0x4'),'afterUpdate':_0x563a('0x5'),'afterDestroy':_0x563a('0x6')};function emitEvent(_0x37e617){return function(_0x5c2a8d,_0x4cc9e5,_0x1fdcb0){_0x5c2a8d['getUsers']({'attributes':['id'],'raw':!![]})[_0x563a('0x7')](function(_0x4f89b4){_0x5c2a8d['setDataValue']('Users',_0x4f89b4[_0x563a('0x8')](function(_0x32bf51){return{'id':_0x32bf51['id']};}));return SmsMessage[_0x563a('0x9')]({'where':{'SmsInteractionId':_0x5c2a8d['id'],'direction':'in','read':![]},'raw':!![]});})[_0x563a('0x7')](function(_0x255922){_0x5c2a8d[_0x563a('0xa')](_0x563a('0xb'),_0x255922[_0x563a('0xc')]);SmsInteractionEvents[_0x563a('0xd')](_0x37e617+':'+_0x5c2a8d['id'],_0x5c2a8d);SmsInteractionEvents[_0x563a('0xd')](_0x37e617,_0x5c2a8d);_0x1fdcb0(null);})[_0x563a('0xe')](_0x1fdcb0(null));};}for(var e in events){if(events[_0x563a('0xf')](e)){var event=events[e];SmsInteraction[_0x563a('0x10')](e,emitEvent(event));}}module[_0x563a('0x11')]=SmsInteractionEvents; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.model.js b/server/api/smsInteraction/smsInteraction.model.js index c1e6167..0caabd7 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 _0x41c3=['./smsInteraction.attributes','exports','define','SmsInteraction','changed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf'];(function(_0x365b71,_0x2601f8){var _0x44e77f=function(_0x8d76ab){while(--_0x8d76ab){_0x365b71['push'](_0x365b71['shift']());}};_0x44e77f(++_0x2601f8);}(_0x41c3,0x198));var _0x341c=function(_0x1b8eda,_0x444725){_0x1b8eda=_0x1b8eda-0x0;var _0x46feed=_0x41c3[_0x1b8eda];return _0x46feed;};'use strict';var _=require(_0x341c('0x0'));var util=require(_0x341c('0x1'));var logger=require(_0x341c('0x2'))(_0x341c('0x3'));var moment=require(_0x341c('0x4'));var BPromise=require(_0x341c('0x5'));var rp=require(_0x341c('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x341c('0x7'));var config=require('../../config/environment');var attributes=require(_0x341c('0x8'));module[_0x341c('0x9')]=function(_0x25de3f,_0x33338b){return _0x25de3f[_0x341c('0xa')](_0x341c('0xb'),attributes,{'tableName':'sms_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x2f852f,_0x2be5de,_0x110709){if(_0x2f852f[_0x341c('0xc')]('closed')){_0x2f852f[_0x341c('0xd')]=moment()[_0x341c('0xe')](_0x341c('0xf'));}_0x110709(null,_0x2f852f);}}});}; \ No newline at end of file +var _0x7835=['path','rimraf','../../config/environment','exports','SmsInteraction','sms_interactions','changed','closed','format','lodash','util','api','moment','bluebird','request-promise'];(function(_0x2ddfd9,_0x5877d0){var _0x2668f0=function(_0x70ad6f){while(--_0x70ad6f){_0x2ddfd9['push'](_0x2ddfd9['shift']());}};_0x2668f0(++_0x5877d0);}(_0x7835,0x180));var _0x5783=function(_0x1bc261,_0x4f287e){_0x1bc261=_0x1bc261-0x0;var _0x2ed900=_0x7835[_0x1bc261];return _0x2ed900;};'use strict';var _=require(_0x5783('0x0'));var util=require(_0x5783('0x1'));var logger=require('../../config/logger')(_0x5783('0x2'));var moment=require(_0x5783('0x3'));var BPromise=require(_0x5783('0x4'));var rp=require(_0x5783('0x5'));var fs=require('fs');var path=require(_0x5783('0x6'));var rimraf=require(_0x5783('0x7'));var config=require(_0x5783('0x8'));var attributes=require('./smsInteraction.attributes');module[_0x5783('0x9')]=function(_0x426889,_0x2810f4){return _0x426889['define'](_0x5783('0xa'),attributes,{'tableName':_0x5783('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x4e6908,_0x2623b4,_0x547db7){if(_0x4e6908[_0x5783('0xc')](_0x5783('0xd'))){_0x4e6908['closedAt']=moment()[_0x5783('0xe')]('YYYY-MM-DD\x20HH:mm:ss');}_0x547db7(null,_0x4e6908);}}});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.rpc.js b/server/api/smsInteraction/smsInteraction.rpc.js index 3ebf609..d429aed 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 _0xde1c=['ids','omit','spread','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','defaults','redis','socket.io-emitter','./smsInteraction.socket','register','info','SmsInteraction,\x20%s,\x20%s','request\x20sent','debug','SmsInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','UpdateSmsInteraction','update','body','options','raw','where','limit','then','AddTagsToSmsInteraction','SmsInteraction','find','addTags'];(function(_0xf16851,_0x2fe387){var _0x22337b=function(_0x75442b){while(--_0x75442b){_0xf16851['push'](_0xf16851['shift']());}};_0x22337b(++_0x2fe387);}(_0xde1c,0xb0));var _0xcde1=function(_0x34540a,_0x20be51){_0x34540a=_0x34540a-0x0;var _0x595056=_0xde1c[_0x34540a];return _0x595056;};'use strict';var _=require(_0xcde1('0x0'));var util=require(_0xcde1('0x1'));var moment=require(_0xcde1('0x2'));var BPromise=require(_0xcde1('0x3'));var rs=require(_0xcde1('0x4'));var fs=require('fs');var Redis=require(_0xcde1('0x5'));var db=require(_0xcde1('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xcde1('0x7'))(_0xcde1('0x8'));var config=require('../../config/environment');var jayson=require(_0xcde1('0x9'));var client=jayson[_0xcde1('0xa')][_0xcde1('0xb')]({'port':0x232a});config['redis']=_[_0xcde1('0xc')](config[_0xcde1('0xd')],{'host':'localhost','port':0x18eb});var socket=require(_0xcde1('0xe'))(new Redis(config[_0xcde1('0xd')]));require(_0xcde1('0xf'))[_0xcde1('0x10')](socket);function respondWithRpcPromise(_0x27e83d,_0x375c3d,_0x548cf1){return new BPromise(function(_0xaa2be7,_0x4fd2bc){return client['request'](_0x27e83d,_0x548cf1)['then'](function(_0xe44738){logger[_0xcde1('0x11')](_0xcde1('0x12'),_0x375c3d,_0xcde1('0x13'));logger[_0xcde1('0x14')](_0xcde1('0x15'),_0x375c3d,'request\x20sent',JSON[_0xcde1('0x16')](_0xe44738));if(_0xe44738[_0xcde1('0x17')]){if(_0xe44738[_0xcde1('0x17')]['code']===0x1f4){logger[_0xcde1('0x17')](_0xcde1('0x12'),_0x375c3d,_0xe44738[_0xcde1('0x17')][_0xcde1('0x18')]);return _0x4fd2bc(_0xe44738[_0xcde1('0x17')][_0xcde1('0x18')]);}logger[_0xcde1('0x17')](_0xcde1('0x12'),_0x375c3d,_0xe44738[_0xcde1('0x17')]['message']);return _0xaa2be7(_0xe44738[_0xcde1('0x17')][_0xcde1('0x18')]);}else{logger['info']('SmsInteraction,\x20%s,\x20%s',_0x375c3d,'request\x20sent');_0xaa2be7(_0xe44738[_0xcde1('0x19')][_0xcde1('0x18')]);}})[_0xcde1('0x1a')](function(_0x2a2f89){logger[_0xcde1('0x17')]('SmsInteraction,\x20%s,\x20%s',_0x375c3d,_0x2a2f89);_0x4fd2bc(_0x2a2f89);});});}exports[_0xcde1('0x1b')]=function(_0x1b036d){var _0xb1469a=this;return new Promise(function(_0x36522c,_0x1b0b70){return db['SmsInteraction'][_0xcde1('0x1c')](_0x1b036d[_0xcde1('0x1d')],{'raw':_0x1b036d[_0xcde1('0x1e')]?_0x1b036d[_0xcde1('0x1e')][_0xcde1('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1b036d[_0xcde1('0x1e')]?_0x1b036d['options'][_0xcde1('0x20')]||null:null,'attributes':_0x1b036d[_0xcde1('0x1e')]?_0x1b036d[_0xcde1('0x1e')]['attributes']||null:null,'limit':_0x1b036d[_0xcde1('0x1e')]?_0x1b036d[_0xcde1('0x1e')][_0xcde1('0x21')]||null:null})[_0xcde1('0x22')](function(_0x29c217){logger[_0xcde1('0x11')](_0xcde1('0x1b'),_0x1b036d);logger[_0xcde1('0x14')](_0xcde1('0x1b'),_0x1b036d,JSON[_0xcde1('0x16')](_0x29c217));_0x36522c(_0x29c217);})[_0xcde1('0x1a')](function(_0x25f39e){logger['error'](_0xcde1('0x1b'),_0x25f39e['message'],_0x1b036d);_0x1b0b70(_0xb1469a['error'](0x1f4,_0x25f39e[_0xcde1('0x18')]));});});};exports[_0xcde1('0x23')]=function(_0x3c8196){return new Promise(function(_0x7c0453,_0x3d4e7b){return db[_0xcde1('0x24')][_0xcde1('0x25')]({'where':_0x3c8196[_0xcde1('0x1e')]?_0x3c8196[_0xcde1('0x1e')][_0xcde1('0x20')]||null:null})[_0xcde1('0x22')](function(_0x3b71c9){if(_0x3b71c9){return _0x3b71c9[_0xcde1('0x26')](_0x3c8196[_0xcde1('0x1d')][_0xcde1('0x27')],_[_0xcde1('0x28')](_0x3c8196['body'],[_0xcde1('0x27'),'id'])||{});}})[_0xcde1('0x29')](function(_0x1a354c){logger[_0xcde1('0x11')](_0xcde1('0x2a'),_0x3c8196);logger[_0xcde1('0x14')](_0xcde1('0x2a'),_0x3c8196,JSON[_0xcde1('0x16')](_0x1a354c));_0x7c0453(_0x1a354c);})[_0xcde1('0x1a')](function(_0x3c9b7a){logger['error'](_0xcde1('0x2a'),_0x3c9b7a[_0xcde1('0x18')],_0x3c8196);_0x3d4e7b(_this[_0xcde1('0x17')](0x1f4,_0x3c9b7a[_0xcde1('0x18')]));});});}; \ No newline at end of file +var _0xf02f=['SmsInteraction','update','options','raw','where','attributes','limit','stringify','AddTagsToSmsInteraction','find','addTags','ids','omit','body','AddTags','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./smsInteraction.socket','register','request','then','info','debug','SmsInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','code','error','SmsInteraction,\x20%s,\x20%s','message','result','catch','UpdateSmsInteraction'];(function(_0x5e2128,_0xe2107e){var _0x2bbc88=function(_0x23ce4d){while(--_0x23ce4d){_0x5e2128['push'](_0x5e2128['shift']());}};_0x2bbc88(++_0xe2107e);}(_0xf02f,0x13c));var _0xff02=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xf02f[_0x14add3];return _0x4a174f;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xff02('0x0'));var BPromise=require(_0xff02('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xff02('0x2'))['db'];var utils=require(_0xff02('0x3'));var logger=require(_0xff02('0x4'))(_0xff02('0x5'));var config=require(_0xff02('0x6'));var jayson=require(_0xff02('0x7'));var client=jayson[_0xff02('0x8')][_0xff02('0x9')]({'port':0x232a});config[_0xff02('0xa')]=_[_0xff02('0xb')](config[_0xff02('0xa')],{'host':_0xff02('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xff02('0xa')]));require(_0xff02('0xd'))[_0xff02('0xe')](socket);function respondWithRpcPromise(_0x17bdc0,_0x5ed93d,_0x1e964a){return new BPromise(function(_0x327dfc,_0xccd69b){return client[_0xff02('0xf')](_0x17bdc0,_0x1e964a)[_0xff02('0x10')](function(_0x5de7f9){logger[_0xff02('0x11')]('SmsInteraction,\x20%s,\x20%s',_0x5ed93d,'request\x20sent');logger[_0xff02('0x12')](_0xff02('0x13'),_0x5ed93d,_0xff02('0x14'),JSON['stringify'](_0x5de7f9));if(_0x5de7f9['error']){if(_0x5de7f9['error'][_0xff02('0x15')]===0x1f4){logger[_0xff02('0x16')](_0xff02('0x17'),_0x5ed93d,_0x5de7f9['error']['message']);return _0xccd69b(_0x5de7f9['error']['message']);}logger[_0xff02('0x16')](_0xff02('0x17'),_0x5ed93d,_0x5de7f9[_0xff02('0x16')][_0xff02('0x18')]);return _0x327dfc(_0x5de7f9[_0xff02('0x16')][_0xff02('0x18')]);}else{logger[_0xff02('0x11')](_0xff02('0x17'),_0x5ed93d,_0xff02('0x14'));_0x327dfc(_0x5de7f9[_0xff02('0x19')][_0xff02('0x18')]);}})[_0xff02('0x1a')](function(_0xe1d77e){logger[_0xff02('0x16')](_0xff02('0x17'),_0x5ed93d,_0xe1d77e);_0xccd69b(_0xe1d77e);});});}exports[_0xff02('0x1b')]=function(_0x4be2fe){var _0x26781e=this;return new Promise(function(_0x265c82,_0x556493){return db[_0xff02('0x1c')][_0xff02('0x1d')](_0x4be2fe['body'],{'raw':_0x4be2fe['options']?_0x4be2fe[_0xff02('0x1e')][_0xff02('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4be2fe[_0xff02('0x1e')]?_0x4be2fe['options'][_0xff02('0x20')]||null:null,'attributes':_0x4be2fe[_0xff02('0x1e')]?_0x4be2fe[_0xff02('0x1e')][_0xff02('0x21')]||null:null,'limit':_0x4be2fe[_0xff02('0x1e')]?_0x4be2fe[_0xff02('0x1e')][_0xff02('0x22')]||null:null})['then'](function(_0x22f54b){logger[_0xff02('0x11')](_0xff02('0x1b'),_0x4be2fe);logger['debug'](_0xff02('0x1b'),_0x4be2fe,JSON[_0xff02('0x23')](_0x22f54b));_0x265c82(_0x22f54b);})[_0xff02('0x1a')](function(_0x2c85f2){logger['error']('UpdateSmsInteraction',_0x2c85f2[_0xff02('0x18')],_0x4be2fe);_0x556493(_0x26781e['error'](0x1f4,_0x2c85f2[_0xff02('0x18')]));});});};exports[_0xff02('0x24')]=function(_0x215693){return new Promise(function(_0x3cc085,_0x39f5c0){return db[_0xff02('0x1c')][_0xff02('0x25')]({'where':_0x215693[_0xff02('0x1e')]?_0x215693['options'][_0xff02('0x20')]||null:null})['then'](function(_0x3b04a2){if(_0x3b04a2){return _0x3b04a2[_0xff02('0x26')](_0x215693['body'][_0xff02('0x27')],_[_0xff02('0x28')](_0x215693[_0xff02('0x29')],[_0xff02('0x27'),'id'])||{});}})['spread'](function(_0x1ba249){logger['info'](_0xff02('0x2a'),_0x215693);logger['debug'](_0xff02('0x2a'),_0x215693,JSON['stringify'](_0x1ba249));_0x3cc085(_0x1ba249);})['catch'](function(_0x4b14ff){logger['error'](_0xff02('0x2a'),_0x4b14ff[_0xff02('0x18')],_0x215693);_0x39f5c0(_this[_0xff02('0x16')](0x1f4,_0x4b14ff[_0xff02('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.socket.js b/server/api/smsInteraction/smsInteraction.socket.js index 58b8e5e..fc137dd 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 _0x9f41=['smsInteraction:','save','remove','emit','removeListener','length'];(function(_0x7629e,_0x40c972){var _0x19569b=function(_0xa62841){while(--_0xa62841){_0x7629e['push'](_0x7629e['shift']());}};_0x19569b(++_0x40c972);}(_0x9f41,0x85));var _0x19f4=function(_0x4a5a56,_0x289339){_0x4a5a56=_0x4a5a56-0x0;var _0x17d0ef=_0x9f41[_0x4a5a56];return _0x17d0ef;};'use strict';var SmsInteractionEvents=require('./smsInteraction.events');var events=[_0x19f4('0x0'),_0x19f4('0x1'),'update'];function createListener(_0x4bc2b6,_0xe593be){return function(_0x2b3679){_0xe593be[_0x19f4('0x2')](_0x4bc2b6,_0x2b3679);};}function removeListener(_0x1651b7,_0x11314f){return function(){SmsInteractionEvents[_0x19f4('0x3')](_0x1651b7,_0x11314f);};}exports['register']=function(_0x17b471){for(var _0x5a77a8=0x0,_0xf72ccc=events[_0x19f4('0x4')];_0x5a77a8<_0xf72ccc;_0x5a77a8++){var _0x53e477=events[_0x5a77a8];var _0x1dde13=createListener(_0x19f4('0x5')+_0x53e477,_0x17b471);SmsInteractionEvents['on'](_0x53e477,_0x1dde13);}}; \ No newline at end of file +var _0xa7ea=['length','smsInteraction:','./smsInteraction.events','save','remove','emit','removeListener','register'];(function(_0x3432dd,_0x47e20e){var _0x2c7ca3=function(_0xca2d4e){while(--_0xca2d4e){_0x3432dd['push'](_0x3432dd['shift']());}};_0x2c7ca3(++_0x47e20e);}(_0xa7ea,0x72));var _0xaa7e=function(_0x210fb4,_0x59acc7){_0x210fb4=_0x210fb4-0x0;var _0x3ff61c=_0xa7ea[_0x210fb4];return _0x3ff61c;};'use strict';var SmsInteractionEvents=require(_0xaa7e('0x0'));var events=[_0xaa7e('0x1'),_0xaa7e('0x2'),'update'];function createListener(_0x558ede,_0x1c5c8a){return function(_0x3586bb){_0x1c5c8a[_0xaa7e('0x3')](_0x558ede,_0x3586bb);};}function removeListener(_0x37bd3b,_0x3f5fac){return function(){SmsInteractionEvents[_0xaa7e('0x4')](_0x37bd3b,_0x3f5fac);};}exports[_0xaa7e('0x5')]=function(_0x33ba71){for(var _0x1dcd46=0x0,_0x1ee4da=events[_0xaa7e('0x6')];_0x1dcd46<_0x1ee4da;_0x1dcd46++){var _0x4ea402=events[_0x1dcd46];var _0x119eb0=createListener(_0xaa7e('0x7')+_0x4ea402,_0x33ba71);SmsInteractionEvents['on'](_0x4ea402,_0x119eb0);}}; \ No newline at end of file diff --git a/server/api/smsMessage/index.js b/server/api/smsMessage/index.js index 69610b3..73d89ba 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 _0xf263=['smsmessage:create','/:id/status','status','put','/:id/accept','/:id/reject','reject','delete','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsMessage.controller','isAuthenticated','index','get','describe','/:id','show','post','sms'];(function(_0x6075de,_0x50dd8d){var _0x4e63e9=function(_0x592157){while(--_0x592157){_0x6075de['push'](_0x6075de['shift']());}};_0x4e63e9(++_0x50dd8d);}(_0xf263,0x141));var _0x3f26=function(_0x36fbef,_0x4ffc84){_0x36fbef=_0x36fbef-0x0;var _0x45e270=_0xf263[_0x36fbef];return _0x45e270;};'use strict';var multer=require(_0x3f26('0x0'));var util=require('util');var path=require(_0x3f26('0x1'));var timeout=require(_0x3f26('0x2'));var express=require(_0x3f26('0x3'));var router=express[_0x3f26('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x3f26('0x5'));var interaction=require(_0x3f26('0x6'));var config=require(_0x3f26('0x7'));var controller=require(_0x3f26('0x8'));router['get']('/',auth[_0x3f26('0x9')](),controller[_0x3f26('0xa')]);router[_0x3f26('0xb')]('/describe',auth[_0x3f26('0x9')](),controller[_0x3f26('0xc')]);router[_0x3f26('0xb')](_0x3f26('0xd'),auth[_0x3f26('0x9')](),controller[_0x3f26('0xe')]);router[_0x3f26('0xf')]('/',auth[_0x3f26('0x9')](),interaction['tracked'](_0x3f26('0x10'),_0x3f26('0x11')),controller['create']);router['post'](_0x3f26('0x12'),controller[_0x3f26('0x13')]);router[_0x3f26('0x14')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0x3f26('0x14')](_0x3f26('0x15'),auth[_0x3f26('0x9')](),controller['accept']);router[_0x3f26('0x14')](_0x3f26('0x16'),auth[_0x3f26('0x9')](),controller[_0x3f26('0x17')]);router[_0x3f26('0x18')](_0x3f26('0xd'),auth['isAuthenticated'](),controller['destroy']);module[_0x3f26('0x19')]=router; \ No newline at end of file +var _0x6ee5=['tracked','sms','smsmessage:create','create','/:id/status','status','put','accept','reject','destroy','exports','multer','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsMessage.controller','isAuthenticated','index','/describe','describe','get','/:id','show','post'];(function(_0x565ed7,_0x398228){var _0x183ad7=function(_0x5a43d7){while(--_0x5a43d7){_0x565ed7['push'](_0x565ed7['shift']());}};_0x183ad7(++_0x398228);}(_0x6ee5,0x92));var _0x56ee=function(_0x1fd2b5,_0x43e527){_0x1fd2b5=_0x1fd2b5-0x0;var _0x5d22b2=_0x6ee5[_0x1fd2b5];return _0x5d22b2;};'use strict';var multer=require(_0x56ee('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x56ee('0x1'));var express=require(_0x56ee('0x2'));var router=express[_0x56ee('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x56ee('0x4'));var interaction=require(_0x56ee('0x5'));var config=require(_0x56ee('0x6'));var controller=require(_0x56ee('0x7'));router['get']('/',auth[_0x56ee('0x8')](),controller[_0x56ee('0x9')]);router['get'](_0x56ee('0xa'),auth['isAuthenticated'](),controller[_0x56ee('0xb')]);router[_0x56ee('0xc')](_0x56ee('0xd'),auth[_0x56ee('0x8')](),controller[_0x56ee('0xe')]);router[_0x56ee('0xf')]('/',auth[_0x56ee('0x8')](),interaction[_0x56ee('0x10')](_0x56ee('0x11'),_0x56ee('0x12')),controller[_0x56ee('0x13')]);router['post'](_0x56ee('0x14'),controller[_0x56ee('0x15')]);router['put'](_0x56ee('0xd'),auth['isAuthenticated'](),controller['update']);router[_0x56ee('0x16')]('/:id/accept',auth[_0x56ee('0x8')](),controller[_0x56ee('0x17')]);router[_0x56ee('0x16')]('/:id/reject',auth[_0x56ee('0x8')](),controller[_0x56ee('0x18')]);router['delete'](_0x56ee('0xd'),auth[_0x56ee('0x8')](),controller[_0x56ee('0x19')]);module[_0x56ee('0x1a')]=router; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.attributes.js b/server/api/smsMessage/smsMessage.attributes.js index beca04b..65a1a58 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 _0xb34e=['TEXT','medium','BOOLEAN','ENUM','out','STRING','DATE','sequelize','exports'];(function(_0x10f68e,_0xf198ea){var _0x4c8372=function(_0x38517){while(--_0x38517){_0x10f68e['push'](_0x10f68e['shift']());}};_0x4c8372(++_0xf198ea);}(_0xb34e,0x181));var _0xeb34=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xb34e[_0x1facfa];return _0x9ec701;};'use strict';var Sequelize=require(_0xeb34('0x0'));module[_0xeb34('0x1')]={'body':{'type':Sequelize[_0xeb34('0x2')](_0xeb34('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0xeb34('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0xeb34('0x5')]('in',_0xeb34('0x6')),'defaultValue':_0xeb34('0x6'),'allowNull':![]},'messageId':{'type':Sequelize[_0xeb34('0x7')](0xbe)},'phone':{'type':Sequelize[_0xeb34('0x7')]},'readAt':{'type':Sequelize[_0xeb34('0x8')]},'secret':{'type':Sequelize[_0xeb34('0x4')],'defaultValue':![]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0xeb34('0x2')]}}; \ No newline at end of file +var _0x3f4b=['exports','TEXT','BOOLEAN','out','STRING','sequelize'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x3f4b,0x11f));var _0xb3f4=function(_0xd334e6,_0x21229c){_0xd334e6=_0xd334e6-0x0;var _0x55600f=_0x3f4b[_0xd334e6];return _0x55600f;};'use strict';var Sequelize=require(_0xb3f4('0x0'));module[_0xb3f4('0x1')]={'body':{'type':Sequelize[_0xb3f4('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0xb3f4('0x3')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0xb3f4('0x4')),'defaultValue':_0xb3f4('0x4'),'allowNull':![]},'messageId':{'type':Sequelize[_0xb3f4('0x5')](0xbe)},'phone':{'type':Sequelize[_0xb3f4('0x5')]},'readAt':{'type':Sequelize['DATE']},'secret':{'type':Sequelize[_0xb3f4('0x3')],'defaultValue':![]},'providerName':{'type':Sequelize[_0xb3f4('0x5')]},'providerResponse':{'type':Sequelize[_0xb3f4('0x2')]}}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.controller.js b/server/api/smsMessage/smsMessage.controller.js index 41e7338..fa259e9 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 _0x3d04=['get','[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','acceptMessage','ContactId','Sequelize','QueryTypes','SELECT','contact','User','agent','fullname','email','internal','manual','interface','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','stringify','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','rejectmessage','SmsAccount','SmsAccountId','debug','received\x20delivery\x20report\x20from','inspect','twilio','MessageSid','messageId','SmsAccount,\x20%s,\x20%s,\x20%s','MessageUUID','sent','delivered','plivio','infobip','results','DELIVERED','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./smsMessage.socket','register','jayson/promise','http','client','then','info','SmsMessage,\x20%s,\x20%s','request\x20sent','SmsMessage,\x20%s,\x20%s,\x20%s','error','code','message','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','stack','name','send','index','map','SmsMessage','rawAttributes','fieldName','key','model','query','keys','filters','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','type','includeAll','findAll','rows','catch','show','intersection','fields','include','options','find','create','body','params','describe','sms-interactions','accept','sms','read','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','user','SmsInteraction','SmsInteractionId','isNil','read1stAt','format','interaction'];(function(_0x38ec02,_0x5e65b0){var _0x53ee6c=function(_0x54274e){while(--_0x54274e){_0x38ec02['push'](_0x38ec02['shift']());}};_0x53ee6c(++_0x5e65b0);}(_0x3d04,0xbe));var _0x43d0=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x3d04[_0x3b380d];return _0x54502b;};'use strict';var emlformat=require(_0x43d0('0x0'));var rimraf=require(_0x43d0('0x1'));var zipdir=require(_0x43d0('0x2'));var jsonpatch=require(_0x43d0('0x3'));var rp=require(_0x43d0('0x4'));var moment=require(_0x43d0('0x5'));var BPromise=require(_0x43d0('0x6'));var Mustache=require(_0x43d0('0x7'));var util=require('util');var path=require(_0x43d0('0x8'));var sox=require(_0x43d0('0x9'));var csv=require(_0x43d0('0xa'));var ejs=require(_0x43d0('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(_0x43d0('0xc'));var deskjs=require(_0x43d0('0xd'));var toCsv=require(_0x43d0('0xa'));var querystring=require(_0x43d0('0xe'));var Papa=require(_0x43d0('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x43d0('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x43d0('0x11'))(_0x43d0('0x12'));var utils=require(_0x43d0('0x13'));var config=require(_0x43d0('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x43d0('0x15'))['db'];config[_0x43d0('0x16')]=_['defaults'](config[_0x43d0('0x16')],{'host':_0x43d0('0x17'),'port':0x18eb});var socket=require(_0x43d0('0x18'))(new Redis(config['redis']));require(_0x43d0('0x19'))[_0x43d0('0x1a')](socket);var jayson=require(_0x43d0('0x1b'));var client=jayson['client'][_0x43d0('0x1c')]({'port':0x232c});var client9002=jayson[_0x43d0('0x1d')][_0x43d0('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x1218b5,_0x91b4a1,_0x4aa32a,_0x5d4fc4){return new BPromise(function(_0x1e91a7,_0x3356f1){var _0x35decf=_0x5d4fc4||client;return _0x35decf['request'](_0x1218b5,_0x4aa32a)[_0x43d0('0x1e')](function(_0x532402){logger[_0x43d0('0x1f')](_0x43d0('0x20'),_0x91b4a1,_0x43d0('0x21'));logger['debug'](_0x43d0('0x22'),_0x91b4a1,_0x43d0('0x21'),JSON['stringify'](_0x532402));if(_0x532402[_0x43d0('0x23')]){if(_0x532402[_0x43d0('0x23')][_0x43d0('0x24')]===0x1f4){logger[_0x43d0('0x23')](_0x43d0('0x20'),_0x91b4a1,_0x532402[_0x43d0('0x23')][_0x43d0('0x25')]);return _0x3356f1(_0x532402[_0x43d0('0x23')][_0x43d0('0x25')]);}logger[_0x43d0('0x23')](_0x43d0('0x20'),_0x91b4a1,_0x532402[_0x43d0('0x23')][_0x43d0('0x25')]);return _0x1e91a7(_0x532402[_0x43d0('0x23')][_0x43d0('0x25')]);}else{logger['info'](_0x43d0('0x20'),_0x91b4a1,_0x43d0('0x21'));_0x1e91a7(_0x532402['result'][_0x43d0('0x25')]);}})['catch'](function(_0x29c111){logger[_0x43d0('0x23')]('SmsMessage,\x20%s,\x20%s',_0x91b4a1,_0x29c111);_0x3356f1(_0x29c111);});});}function respondWithStatusCode(_0x3e38e4,_0x238c64){_0x238c64=_0x238c64||0xcc;return function(_0x5ac4c0){if(_0x5ac4c0){return _0x3e38e4[_0x43d0('0x26')](_0x238c64);}return _0x3e38e4[_0x43d0('0x27')](_0x238c64)[_0x43d0('0x28')]();};}function respondWithResult(_0x5f16ac,_0x447725){_0x447725=_0x447725||0xc8;return function(_0x38e89e){if(_0x38e89e){return _0x5f16ac[_0x43d0('0x27')](_0x447725)[_0x43d0('0x29')](_0x38e89e);}};}function respondWithFilteredResult(_0x37d78f,_0x440ecb){return function(_0x31a057){if(_0x31a057){var _0x4a3cd4=typeof _0x440ecb[_0x43d0('0x2a')]===_0x43d0('0x2b')&&typeof _0x440ecb[_0x43d0('0x2c')]==='undefined';var _0x4bfce9=_0x31a057['count'];var _0x3c1ea3=_0x4a3cd4?0x0:_0x440ecb[_0x43d0('0x2a')];var _0x10086b=_0x4a3cd4?_0x31a057[_0x43d0('0x2d')]:_0x440ecb[_0x43d0('0x2a')]+_0x440ecb[_0x43d0('0x2c')];var _0x5d23c2;if(_0x10086b>=_0x4bfce9){_0x10086b=_0x4bfce9;_0x5d23c2=0xc8;}else{_0x5d23c2=0xce;}_0x37d78f[_0x43d0('0x27')](_0x5d23c2);return _0x37d78f[_0x43d0('0x2e')](_0x43d0('0x2f'),_0x3c1ea3+'-'+_0x10086b+'/'+_0x4bfce9)[_0x43d0('0x29')](_0x31a057);}return null;};}function patchUpdates(_0xbc5a4){return function(_0x2b0ce8){try{jsonpatch[_0x43d0('0x30')](_0x2b0ce8,_0xbc5a4,!![]);}catch(_0x1bdd74){return BPromise[_0x43d0('0x31')](_0x1bdd74);}return _0x2b0ce8[_0x43d0('0x32')]();};}function saveUpdates(_0x42de80,_0x5385ee){return function(_0x3d2c3b){if(_0x3d2c3b){return _0x3d2c3b[_0x43d0('0x33')](_0x42de80)[_0x43d0('0x1e')](function(_0x4058df){return _0x4058df;});}return null;};}function removeEntity(_0x57b317,_0x336695){return function(_0x493409){if(_0x493409){return _0x493409[_0x43d0('0x34')]()[_0x43d0('0x1e')](function(){_0x57b317['status'](0xcc)[_0x43d0('0x28')]();});}};}function handleEntityNotFound(_0x266339,_0x2aea11){return function(_0x3c1d26){if(!_0x3c1d26){_0x266339[_0x43d0('0x26')](0x194);}return _0x3c1d26;};}function handleError(_0x31d67c,_0x35a375){_0x35a375=_0x35a375||0x1f4;return function(_0x21d26e){logger[_0x43d0('0x23')](_0x21d26e[_0x43d0('0x35')]);if(_0x21d26e[_0x43d0('0x36')]){delete _0x21d26e['name'];}_0x31d67c[_0x43d0('0x27')](_0x35a375)[_0x43d0('0x37')](_0x21d26e);};}exports[_0x43d0('0x38')]=function(_0x7891c5,_0x294828){var _0x201453={},_0x314360={},_0xf5b750={'count':0x0,'rows':[]};var _0x198836=_[_0x43d0('0x39')](db[_0x43d0('0x3a')][_0x43d0('0x3b')],function(_0x19843c){return{'name':_0x19843c[_0x43d0('0x3c')],'type':_0x19843c['type'][_0x43d0('0x3d')]};});_0x314360[_0x43d0('0x3e')]=_[_0x43d0('0x39')](_0x198836,_0x43d0('0x36'));_0x314360[_0x43d0('0x3f')]=_[_0x43d0('0x40')](_0x7891c5[_0x43d0('0x3f')]);_0x314360[_0x43d0('0x41')]=_['intersection'](_0x314360['model'],_0x314360[_0x43d0('0x3f')]);_0x201453['attributes']=_['intersection'](_0x314360[_0x43d0('0x3e')],qs['fields'](_0x7891c5[_0x43d0('0x3f')]['fields']));_0x201453[_0x43d0('0x42')]=_0x201453['attributes'][_0x43d0('0x43')]?_0x201453[_0x43d0('0x42')]:_0x314360[_0x43d0('0x3e')];if(!_0x7891c5['query'][_0x43d0('0x44')]('nolimit')){_0x201453[_0x43d0('0x2c')]=qs['limit'](_0x7891c5['query'][_0x43d0('0x2c')]);_0x201453[_0x43d0('0x2a')]=qs['offset'](_0x7891c5[_0x43d0('0x3f')][_0x43d0('0x2a')]);}_0x201453[_0x43d0('0x45')]=qs[_0x43d0('0x46')](_0x7891c5[_0x43d0('0x3f')]['sort']);_0x201453[_0x43d0('0x47')]=qs[_0x43d0('0x41')](_[_0x43d0('0x48')](_0x7891c5[_0x43d0('0x3f')],_0x314360['filters']),_0x198836);if(_0x7891c5[_0x43d0('0x3f')][_0x43d0('0x49')]){_0x201453[_0x43d0('0x47')]=_[_0x43d0('0x4a')](_0x201453[_0x43d0('0x47')],{'$or':_['map'](_0x198836,function(_0x1b8b2a){if(_0x1b8b2a[_0x43d0('0x4b')]!=='VIRTUAL'){var _0x19baae={};_0x19baae[_0x1b8b2a[_0x43d0('0x36')]]={'$like':'%'+_0x7891c5[_0x43d0('0x3f')]['filter']+'%'};return _0x19baae;}})});}_0x201453=_[_0x43d0('0x4a')]({},_0x201453,_0x7891c5['options']);var _0x19362e={'where':_0x201453['where']};return db[_0x43d0('0x3a')][_0x43d0('0x2d')](_0x19362e)[_0x43d0('0x1e')](function(_0x43d88b){_0xf5b750[_0x43d0('0x2d')]=_0x43d88b;if(_0x7891c5['query'][_0x43d0('0x4c')]){_0x201453['include']=[{'all':!![]}];}return db[_0x43d0('0x3a')][_0x43d0('0x4d')](_0x201453);})[_0x43d0('0x1e')](function(_0x94df19){_0xf5b750[_0x43d0('0x4e')]=_0x94df19;return _0xf5b750;})[_0x43d0('0x1e')](respondWithFilteredResult(_0x294828,_0x201453))[_0x43d0('0x4f')](handleError(_0x294828,null));};exports[_0x43d0('0x50')]=function(_0x347ec2,_0x313c3e){var _0x27affd={'raw':!![],'where':{'id':_0x347ec2['params']['id']}},_0x22b1f9={};_0x22b1f9[_0x43d0('0x3e')]=_[_0x43d0('0x40')](db[_0x43d0('0x3a')]['rawAttributes']);_0x22b1f9[_0x43d0('0x3f')]=_['keys'](_0x347ec2['query']);_0x22b1f9[_0x43d0('0x41')]=_[_0x43d0('0x51')](_0x22b1f9[_0x43d0('0x3e')],_0x22b1f9[_0x43d0('0x3f')]);_0x27affd[_0x43d0('0x42')]=_['intersection'](_0x22b1f9['model'],qs[_0x43d0('0x52')](_0x347ec2['query'][_0x43d0('0x52')]));_0x27affd[_0x43d0('0x42')]=_0x27affd['attributes']['length']?_0x27affd['attributes']:_0x22b1f9[_0x43d0('0x3e')];if(_0x347ec2[_0x43d0('0x3f')][_0x43d0('0x4c')]){_0x27affd[_0x43d0('0x53')]=[{'all':!![]}];}_0x27affd=_[_0x43d0('0x4a')]({},_0x27affd,_0x347ec2[_0x43d0('0x54')]);return db[_0x43d0('0x3a')][_0x43d0('0x55')](_0x27affd)[_0x43d0('0x1e')](handleEntityNotFound(_0x313c3e,null))['then'](respondWithResult(_0x313c3e,null))[_0x43d0('0x4f')](handleError(_0x313c3e,null));};exports[_0x43d0('0x56')]=function(_0x2561c9,_0x33f91b){return db[_0x43d0('0x3a')][_0x43d0('0x56')](_0x2561c9[_0x43d0('0x57')],{})[_0x43d0('0x1e')](respondWithResult(_0x33f91b,0xc9))[_0x43d0('0x4f')](handleError(_0x33f91b,null));};exports[_0x43d0('0x33')]=function(_0x47f811,_0x50aca4){if(_0x47f811[_0x43d0('0x57')]['id']){delete _0x47f811[_0x43d0('0x57')]['id'];}return db[_0x43d0('0x3a')][_0x43d0('0x55')]({'where':{'id':_0x47f811[_0x43d0('0x58')]['id']}})[_0x43d0('0x1e')](handleEntityNotFound(_0x50aca4,null))[_0x43d0('0x1e')](saveUpdates(_0x47f811[_0x43d0('0x57')],null))[_0x43d0('0x1e')](respondWithResult(_0x50aca4,null))[_0x43d0('0x4f')](handleError(_0x50aca4,null));};exports[_0x43d0('0x34')]=function(_0x3c4dcb,_0x155ea8){return db[_0x43d0('0x3a')][_0x43d0('0x55')]({'where':{'id':_0x3c4dcb['params']['id']}})['then'](handleEntityNotFound(_0x155ea8,null))['then'](removeEntity(_0x155ea8,null))[_0x43d0('0x4f')](handleError(_0x155ea8,null));};exports[_0x43d0('0x59')]=function(_0x14884e,_0x4f15a3){return db['SmsMessage']['describe']()[_0x43d0('0x1e')](respondWithResult(_0x4f15a3,null))['catch'](handleError(_0x4f15a3,null));};var interaction_log=require(_0x43d0('0x11'))(_0x43d0('0x5a'));exports[_0x43d0('0x5b')]=function(_0x5519c1,_0x167434,_0x47668e){var _0x35a743={'agent':{},'channel':_0x43d0('0x5c')};if(_0x5519c1[_0x43d0('0x57')]['id']){delete _0x5519c1[_0x43d0('0x57')]['id'];}_0x5519c1[_0x43d0('0x57')][_0x43d0('0x5d')]=!![];_0x5519c1[_0x43d0('0x57')][_0x43d0('0x5e')]=moment()['format'](_0x43d0('0x5f'));_0x5519c1[_0x43d0('0x57')][_0x43d0('0x60')]=_0x5519c1[_0x43d0('0x57')][_0x43d0('0x60')]||_0x5519c1[_0x43d0('0x61')]['id'];_0x35a743['agent']['id']=_0x5519c1[_0x43d0('0x57')][_0x43d0('0x60')];return db[_0x43d0('0x3a')][_0x43d0('0x55')]({'where':{'id':_0x5519c1[_0x43d0('0x58')]['id'],'UserId':null}})[_0x43d0('0x1e')](handleEntityNotFound(_0x167434,null))['then'](saveUpdates(_0x5519c1[_0x43d0('0x57')],null))[_0x43d0('0x1e')](function(_0x2fc753){if(_0x2fc753){_0x35a743[_0x43d0('0x25')]=_0x2fc753['get']({'plain':!![]});return db[_0x43d0('0x62')][_0x43d0('0x55')]({'where':{'id':_0x2fc753[_0x43d0('0x63')]}});}return null;})['then'](handleEntityNotFound(_0x167434,null))['then'](function(_0x3ca7a5){if(_0x3ca7a5){return _0x3ca7a5[_0x43d0('0x33')]({'UserId':_0x5519c1['body']['UserId'],'read1stAt':_[_0x43d0('0x64')](_0x3ca7a5[_0x43d0('0x65')])?moment()[_0x43d0('0x66')](_0x43d0('0x5f')):undefined});}return null;})[_0x43d0('0x1e')](function(_0x2a66d6){if(_0x2a66d6){_0x35a743[_0x43d0('0x67')]=_0x2a66d6[_0x43d0('0x68')]({'plain':!![]});interaction_log['info'](_0x43d0('0x69'),_0x5519c1[_0x43d0('0x61')]['id'],_0x5519c1['user']['name'],_0x5519c1['user'][_0x43d0('0x6a')],_0x35a743[_0x43d0('0x67')]['id'],_0x5519c1[_0x43d0('0x57')]?JSON['stringify'](_0x5519c1[_0x43d0('0x57')]):_0x43d0('0x6b'));return respondWithRpcPromise('AcceptMessage',_0x43d0('0x6c'),_0x35a743);}return null;})[_0x43d0('0x1e')](function(_0x519e2c){var _0x3ed718='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x519e2c[_0x43d0('0x25')][_0x43d0('0x6d')];return db['sequelize']['query'](_0x3ed718,{'type':db[_0x43d0('0x6e')][_0x43d0('0x6f')][_0x43d0('0x70')],'raw':!![]})['then'](function(_0x5c18ff){return _0x5c18ff;});})[_0x43d0('0x1e')](function(_0x3047f1){if(_0x3047f1){_0x35a743['message'][_0x43d0('0x71')]=_0x3047f1[0x0];if(!_0x5519c1['body']['UserId'])return;return db[_0x43d0('0x72')][_0x43d0('0x55')]({'where':{'id':_0x5519c1[_0x43d0('0x57')][_0x43d0('0x60')],'role':_0x43d0('0x73')},'attributes':['id',_0x43d0('0x36'),_0x43d0('0x74'),_0x43d0('0x75'),_0x43d0('0x76')],'raw':!![]});}return null;})[_0x43d0('0x1e')](function(_0x3b488c){if(!_0x3b488c)return null;_0x35a743['message'][_0x43d0('0x73')]=_0x3b488c;return _0x35a743;})['then'](function(_0x57db6e){if(_0x57db6e){if(_0x5519c1[_0x43d0('0x57')][_0x43d0('0x77')]){_0x35a743['message'][_0x43d0('0x78')]=util[_0x43d0('0x66')](_0x43d0('0x79'),_0x5519c1[_0x43d0('0x61')][_0x43d0('0x36')]);_0x35a743[_0x43d0('0x25')][_0x43d0('0x7a')]=_0x35a743[_0x43d0('0x7a')];_0x35a743[_0x43d0('0x25')][_0x43d0('0x7b')]=_0x35a743[_0x43d0('0x7a')];_0x35a743[_0x43d0('0x25')][_0x43d0('0x7c')]=_0x43d0('0x5b');return respondWithRpcPromise(_0x43d0('0x7d'),'EventManager',{'event':_0x43d0('0x7e'),'message':_0x35a743[_0x43d0('0x25')]},client9002)[_0x43d0('0x1e')](function(){return _0x35a743;});}return _0x35a743;}return null;})[_0x43d0('0x1e')](respondWithResult(_0x167434,null))[_0x43d0('0x4f')](handleError(_0x167434,null));};var interaction_log=require(_0x43d0('0x11'))('sms-interactions');exports[_0x43d0('0x31')]=function(_0x5bf51d,_0x3c747f,_0x948a6a){var _0x1a809c={'agent':{},'channel':_0x43d0('0x5c')};if(_0x5bf51d[_0x43d0('0x57')]['id']){delete _0x5bf51d[_0x43d0('0x57')]['id'];}_0x5bf51d[_0x43d0('0x57')]['UserId']=_0x5bf51d['body'][_0x43d0('0x60')]||_0x5bf51d[_0x43d0('0x61')]['id'];_0x1a809c[_0x43d0('0x73')]['id']=_0x5bf51d[_0x43d0('0x57')][_0x43d0('0x60')];return db[_0x43d0('0x3a')]['find']({'where':{'id':_0x5bf51d['params']['id'],'UserId':null}})[_0x43d0('0x1e')](handleEntityNotFound(_0x3c747f,null))['then'](function(_0x1ed60f){if(_0x1ed60f){_0x1a809c[_0x43d0('0x25')]=_0x1ed60f[_0x43d0('0x68')]({'plain':!![]});return db[_0x43d0('0x62')][_0x43d0('0x55')]({'where':{'id':_0x1ed60f[_0x43d0('0x63')]}});}return null;})[_0x43d0('0x1e')](handleEntityNotFound(_0x3c747f,null))['then'](function(_0x2b276f){if(_0x2b276f){_0x1a809c[_0x43d0('0x67')]=_0x2b276f[_0x43d0('0x68')]({'plain':!![]});interaction_log[_0x43d0('0x1f')](_0x43d0('0x7f'),_0x5bf51d[_0x43d0('0x61')]['id'],_0x5bf51d[_0x43d0('0x61')][_0x43d0('0x36')],_0x5bf51d[_0x43d0('0x61')][_0x43d0('0x6a')],_0x1a809c[_0x43d0('0x67')]['id'],_0x5bf51d[_0x43d0('0x57')]?JSON[_0x43d0('0x80')](_0x5bf51d[_0x43d0('0x57')]):'null');return respondWithRpcPromise('RejectMessage','rejectMessage',_0x1a809c);}return null;})[_0x43d0('0x1e')](function(_0x4387ab){var _0x3cc0fa=_0x43d0('0x81')+_0x4387ab['message'][_0x43d0('0x6d')];return db['sequelize'][_0x43d0('0x3f')](_0x3cc0fa,{'type':db[_0x43d0('0x6e')][_0x43d0('0x6f')][_0x43d0('0x70')],'raw':!![]})[_0x43d0('0x1e')](function(_0xee9f4c){return _0xee9f4c;});})[_0x43d0('0x1e')](function(_0x531ba2){if(_0x531ba2){_0x1a809c[_0x43d0('0x25')][_0x43d0('0x71')]=_0x531ba2[0x0];if(!_0x5bf51d[_0x43d0('0x57')][_0x43d0('0x60')])return;return db['User'][_0x43d0('0x55')]({'where':{'id':_0x5bf51d['body'][_0x43d0('0x60')],'role':'agent'},'attributes':['id',_0x43d0('0x36'),_0x43d0('0x74'),_0x43d0('0x75'),'internal'],'raw':!![]});}return null;})[_0x43d0('0x1e')](function(_0x3e1e3e){if(!_0x3e1e3e)return null;_0x1a809c[_0x43d0('0x25')][_0x43d0('0x73')]=_0x3e1e3e;return _0x1a809c;})['then'](function(_0x3c19f7){if(_0x3c19f7){_0x3c19f7[_0x43d0('0x25')][_0x43d0('0x78')]=util[_0x43d0('0x66')](_0x43d0('0x79'),_0x5bf51d[_0x43d0('0x61')][_0x43d0('0x36')]);_0x3c19f7[_0x43d0('0x25')]['channel']=_0x1a809c[_0x43d0('0x7a')];_0x3c19f7['message'][_0x43d0('0x7b')]=_0x1a809c[_0x43d0('0x7a')];_0x3c19f7['message'][_0x43d0('0x7c')]=_0x43d0('0x31');respondWithRpcPromise(_0x43d0('0x7d'),_0x43d0('0x7d'),{'event':_0x43d0('0x82'),'message':_0x3c19f7['message']},client9002);return _0x1a809c;}return null;})[_0x43d0('0x1e')](respondWithResult(_0x3c747f,null))['catch'](handleError(_0x3c747f,null));};exports[_0x43d0('0x27')]=function(_0x5e1aa3,_0x2f768b,_0x5b4eed){if(_0x5e1aa3[_0x43d0('0x57')]['id']){delete _0x5e1aa3['body']['id'];}var _0x5b0d07;return db[_0x43d0('0x3a')][_0x43d0('0x55')]({'where':{'id':_0x5e1aa3[_0x43d0('0x58')]['id']}})[_0x43d0('0x1e')](handleEntityNotFound(_0x2f768b,null))[_0x43d0('0x1e')](function(_0x230b1a){if(_0x230b1a){_0x5b0d07=_0x230b1a;return db[_0x43d0('0x83')][_0x43d0('0x55')]({'where':{'id':_0x230b1a[_0x43d0('0x84')]}});}})[_0x43d0('0x1e')](handleEntityNotFound(_0x2f768b,null))[_0x43d0('0x1e')](function(_0x26ae3b){if(_0x26ae3b){logger[_0x43d0('0x85')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x43d0('0x27'),_0x43d0('0x86'),_0x26ae3b[_0x43d0('0x4b')],util[_0x43d0('0x87')](_0x5e1aa3[_0x43d0('0x57')],{'showHidden':![],'depth':null}));switch(_0x26ae3b['type']){case _0x43d0('0x88'):if(_0x5e1aa3[_0x43d0('0x57')][_0x43d0('0x89')]&&_0x5e1aa3[_0x43d0('0x57')][_0x43d0('0x89')]===_0x5b0d07[_0x43d0('0x8a')]){return _0x5b0d07['update']({'read':!![]});}else{logger[_0x43d0('0x23')](_0x43d0('0x8b'),_0x43d0('0x27'),'twilio',util[_0x43d0('0x87')](_0x5e1aa3[_0x43d0('0x57')],{'showHidden':![],'depth':null}));}break;case'plivo':if(_0x5e1aa3['body'][_0x43d0('0x8c')]&&_0x5e1aa3[_0x43d0('0x57')][_0x43d0('0x8c')]===_0x5b0d07[_0x43d0('0x8a')]&&_['indexOf']([_0x43d0('0x8d'),_0x43d0('0x8e')],_0x5e1aa3['body']['Status'])>=0x0){return _0x5b0d07[_0x43d0('0x33')]({'read':!![]});}else{logger['error'](_0x43d0('0x8b'),_0x43d0('0x27'),_0x43d0('0x8f'),util[_0x43d0('0x87')](_0x5e1aa3[_0x43d0('0x57')],{'showHidden':![],'depth':null}));}break;case _0x43d0('0x90'):var _0x26a1a6=_0x5e1aa3[_0x43d0('0x57')][_0x43d0('0x91')][0x0];if(_0x26a1a6['status']['groupName']===_0x43d0('0x92')){return _0x5b0d07[_0x43d0('0x33')]({'read':!![]});}else{logger[_0x43d0('0x23')](_0x43d0('0x8b'),'status','infobip',util[_0x43d0('0x87')](_0x5e1aa3[_0x43d0('0x57')],{'showHidden':![],'depth':null}));}break;}return _0x5b0d07;}})[_0x43d0('0x1e')](respondWithResult(_0x2f768b,null))[_0x43d0('0x4f')](handleError(_0x2f768b,null));}; \ No newline at end of file +var _0xb758=['internal','manual','channel','motionChannel','event','EventManager','acceptmessage','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','SELECT','interface','SIP/%s','SmsAccountId','received\x20delivery\x20report\x20from','inspect','MessageSid','messageId','SmsAccount,\x20%s,\x20%s,\x20%s','twilio','plivo','MessageUUID','indexOf','sent','delivered','plivio','infobip','results','DELIVERED','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/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','./smsMessage.socket','register','jayson/promise','client','http','info','SmsMessage,\x20%s,\x20%s','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','json','offset','undefined','count','apply','reject','save','update','then','destroy','stack','name','send','index','map','SmsMessage','rawAttributes','fieldName','type','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filter','merge','VIRTUAL','includeAll','include','rows','show','params','keys','options','find','create','body','describe','sms-interactions','sms','read','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','SmsInteraction','SmsInteractionId','isNil','read1stAt','format','interaction','get','role','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','Sequelize','QueryTypes','contact','User','fullname','email'];(function(_0x4237a6,_0x3e6a46){var _0x2d569a=function(_0x103747){while(--_0x103747){_0x4237a6['push'](_0x4237a6['shift']());}};_0x2d569a(++_0x3e6a46);}(_0xb758,0x14a));var _0x8b75=function(_0x2b737c,_0x274adf){_0x2b737c=_0x2b737c-0x0;var _0x466ed5=_0xb758[_0x2b737c];return _0x466ed5;};'use strict';var emlformat=require(_0x8b75('0x0'));var rimraf=require(_0x8b75('0x1'));var zipdir=require(_0x8b75('0x2'));var jsonpatch=require(_0x8b75('0x3'));var rp=require('request-promise');var moment=require(_0x8b75('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x8b75('0x5'));var util=require('util');var path=require(_0x8b75('0x6'));var sox=require(_0x8b75('0x7'));var csv=require('to-csv');var ejs=require(_0x8b75('0x8'));var fs=require('fs');var fs_extra=require(_0x8b75('0x9'));var _=require(_0x8b75('0xa'));var squel=require(_0x8b75('0xb'));var crypto=require(_0x8b75('0xc'));var jsforce=require(_0x8b75('0xd'));var deskjs=require(_0x8b75('0xe'));var toCsv=require(_0x8b75('0xf'));var querystring=require(_0x8b75('0x10'));var Papa=require(_0x8b75('0x11'));var Redis=require(_0x8b75('0x12'));var authService=require(_0x8b75('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x8b75('0x14'));var hardwareService=require(_0x8b75('0x15'));var logger=require(_0x8b75('0x16'))(_0x8b75('0x17'));var utils=require(_0x8b75('0x18'));var config=require(_0x8b75('0x19'));var licenseUtil=require(_0x8b75('0x1a'));var db=require('../../mysqldb')['db'];config[_0x8b75('0x1b')]=_[_0x8b75('0x1c')](config['redis'],{'host':_0x8b75('0x1d'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x8b75('0x1b')]));require(_0x8b75('0x1e'))[_0x8b75('0x1f')](socket);var jayson=require(_0x8b75('0x20'));var client=jayson[_0x8b75('0x21')][_0x8b75('0x22')]({'port':0x232c});var client9002=jayson[_0x8b75('0x21')]['http']({'port':0x232a});function respondWithRpcPromise(_0x10b52c,_0x1f48a7,_0x32a73f,_0x78e366){return new BPromise(function(_0x1aed0a,_0x286df6){var _0x3367a=_0x78e366||client;return _0x3367a['request'](_0x10b52c,_0x32a73f)['then'](function(_0x553587){logger[_0x8b75('0x23')](_0x8b75('0x24'),_0x1f48a7,_0x8b75('0x25'));logger[_0x8b75('0x26')](_0x8b75('0x27'),_0x1f48a7,_0x8b75('0x25'),JSON[_0x8b75('0x28')](_0x553587));if(_0x553587[_0x8b75('0x29')]){if(_0x553587['error'][_0x8b75('0x2a')]===0x1f4){logger[_0x8b75('0x29')]('SmsMessage,\x20%s,\x20%s',_0x1f48a7,_0x553587[_0x8b75('0x29')]['message']);return _0x286df6(_0x553587['error']['message']);}logger[_0x8b75('0x29')](_0x8b75('0x24'),_0x1f48a7,_0x553587[_0x8b75('0x29')][_0x8b75('0x2b')]);return _0x1aed0a(_0x553587[_0x8b75('0x29')][_0x8b75('0x2b')]);}else{logger['info'](_0x8b75('0x24'),_0x1f48a7,_0x8b75('0x25'));_0x1aed0a(_0x553587[_0x8b75('0x2c')]['message']);}})[_0x8b75('0x2d')](function(_0x53bdc9){logger['error']('SmsMessage,\x20%s,\x20%s',_0x1f48a7,_0x53bdc9);_0x286df6(_0x53bdc9);});});}function respondWithStatusCode(_0x6b7b21,_0x273cb7){_0x273cb7=_0x273cb7||0xcc;return function(_0x4663a0){if(_0x4663a0){return _0x6b7b21[_0x8b75('0x2e')](_0x273cb7);}return _0x6b7b21[_0x8b75('0x2f')](_0x273cb7)[_0x8b75('0x30')]();};}function respondWithResult(_0x4d3fbd,_0x3f9b7c){_0x3f9b7c=_0x3f9b7c||0xc8;return function(_0x473532){if(_0x473532){return _0x4d3fbd[_0x8b75('0x2f')](_0x3f9b7c)[_0x8b75('0x31')](_0x473532);}};}function respondWithFilteredResult(_0xe5d5cf,_0x5bac9a){return function(_0x18f40f){if(_0x18f40f){var _0xe35c84=typeof _0x5bac9a[_0x8b75('0x32')]===_0x8b75('0x33')&&typeof _0x5bac9a['limit']===_0x8b75('0x33');var _0x4b7606=_0x18f40f[_0x8b75('0x34')];var _0x160588=_0xe35c84?0x0:_0x5bac9a['offset'];var _0x3bb985=_0xe35c84?_0x18f40f[_0x8b75('0x34')]:_0x5bac9a[_0x8b75('0x32')]+_0x5bac9a['limit'];var _0x1fd454;if(_0x3bb985>=_0x4b7606){_0x3bb985=_0x4b7606;_0x1fd454=0xc8;}else{_0x1fd454=0xce;}_0xe5d5cf[_0x8b75('0x2f')](_0x1fd454);return _0xe5d5cf['set']('Content-Range',_0x160588+'-'+_0x3bb985+'/'+_0x4b7606)[_0x8b75('0x31')](_0x18f40f);}return null;};}function patchUpdates(_0x59263d){return function(_0x1b094f){try{jsonpatch[_0x8b75('0x35')](_0x1b094f,_0x59263d,!![]);}catch(_0x12e266){return BPromise[_0x8b75('0x36')](_0x12e266);}return _0x1b094f[_0x8b75('0x37')]();};}function saveUpdates(_0x1a09b6,_0x45da4b){return function(_0x5af8c6){if(_0x5af8c6){return _0x5af8c6[_0x8b75('0x38')](_0x1a09b6)[_0x8b75('0x39')](function(_0x487f20){return _0x487f20;});}return null;};}function removeEntity(_0x2292cf,_0x3c7be6){return function(_0x5cc0a3){if(_0x5cc0a3){return _0x5cc0a3[_0x8b75('0x3a')]()[_0x8b75('0x39')](function(){_0x2292cf[_0x8b75('0x2f')](0xcc)[_0x8b75('0x30')]();});}};}function handleEntityNotFound(_0x4eff9d,_0x530123){return function(_0x859140){if(!_0x859140){_0x4eff9d[_0x8b75('0x2e')](0x194);}return _0x859140;};}function handleError(_0x3b7b58,_0x2f2fb7){_0x2f2fb7=_0x2f2fb7||0x1f4;return function(_0x2b9b58){logger[_0x8b75('0x29')](_0x2b9b58[_0x8b75('0x3b')]);if(_0x2b9b58[_0x8b75('0x3c')]){delete _0x2b9b58[_0x8b75('0x3c')];}_0x3b7b58[_0x8b75('0x2f')](_0x2f2fb7)[_0x8b75('0x3d')](_0x2b9b58);};}exports[_0x8b75('0x3e')]=function(_0x43d831,_0x118794){var _0x2c3e4c={},_0x585c13={},_0x4bdcc2={'count':0x0,'rows':[]};var _0x358bba=_[_0x8b75('0x3f')](db[_0x8b75('0x40')][_0x8b75('0x41')],function(_0x5bc8ac){return{'name':_0x5bc8ac[_0x8b75('0x42')],'type':_0x5bc8ac[_0x8b75('0x43')][_0x8b75('0x44')]};});_0x585c13['model']=_[_0x8b75('0x3f')](_0x358bba,_0x8b75('0x3c'));_0x585c13[_0x8b75('0x45')]=_['keys'](_0x43d831[_0x8b75('0x45')]);_0x585c13[_0x8b75('0x46')]=_[_0x8b75('0x47')](_0x585c13[_0x8b75('0x48')],_0x585c13[_0x8b75('0x45')]);_0x2c3e4c[_0x8b75('0x49')]=_[_0x8b75('0x47')](_0x585c13[_0x8b75('0x48')],qs[_0x8b75('0x4a')](_0x43d831['query'][_0x8b75('0x4a')]));_0x2c3e4c[_0x8b75('0x49')]=_0x2c3e4c['attributes'][_0x8b75('0x4b')]?_0x2c3e4c[_0x8b75('0x49')]:_0x585c13[_0x8b75('0x48')];if(!_0x43d831['query'][_0x8b75('0x4c')](_0x8b75('0x4d'))){_0x2c3e4c[_0x8b75('0x4e')]=qs[_0x8b75('0x4e')](_0x43d831[_0x8b75('0x45')][_0x8b75('0x4e')]);_0x2c3e4c[_0x8b75('0x32')]=qs[_0x8b75('0x32')](_0x43d831[_0x8b75('0x45')][_0x8b75('0x32')]);}_0x2c3e4c[_0x8b75('0x4f')]=qs[_0x8b75('0x50')](_0x43d831['query'][_0x8b75('0x50')]);_0x2c3e4c[_0x8b75('0x51')]=qs[_0x8b75('0x46')](_['pick'](_0x43d831['query'],_0x585c13[_0x8b75('0x46')]),_0x358bba);if(_0x43d831[_0x8b75('0x45')][_0x8b75('0x52')]){_0x2c3e4c['where']=_[_0x8b75('0x53')](_0x2c3e4c[_0x8b75('0x51')],{'$or':_[_0x8b75('0x3f')](_0x358bba,function(_0x4092f5){if(_0x4092f5[_0x8b75('0x43')]!==_0x8b75('0x54')){var _0x36079d={};_0x36079d[_0x4092f5[_0x8b75('0x3c')]]={'$like':'%'+_0x43d831['query']['filter']+'%'};return _0x36079d;}})});}_0x2c3e4c=_[_0x8b75('0x53')]({},_0x2c3e4c,_0x43d831['options']);var _0x5f5d3c={'where':_0x2c3e4c[_0x8b75('0x51')]};return db[_0x8b75('0x40')][_0x8b75('0x34')](_0x5f5d3c)['then'](function(_0x4b0a5c){_0x4bdcc2[_0x8b75('0x34')]=_0x4b0a5c;if(_0x43d831[_0x8b75('0x45')][_0x8b75('0x55')]){_0x2c3e4c[_0x8b75('0x56')]=[{'all':!![]}];}return db['SmsMessage']['findAll'](_0x2c3e4c);})[_0x8b75('0x39')](function(_0x37d21a){_0x4bdcc2[_0x8b75('0x57')]=_0x37d21a;return _0x4bdcc2;})[_0x8b75('0x39')](respondWithFilteredResult(_0x118794,_0x2c3e4c))[_0x8b75('0x2d')](handleError(_0x118794,null));};exports[_0x8b75('0x58')]=function(_0x23df4c,_0x8318a3){var _0x25321e={'raw':!![],'where':{'id':_0x23df4c[_0x8b75('0x59')]['id']}},_0x2e41e8={};_0x2e41e8['model']=_[_0x8b75('0x5a')](db[_0x8b75('0x40')]['rawAttributes']);_0x2e41e8['query']=_[_0x8b75('0x5a')](_0x23df4c[_0x8b75('0x45')]);_0x2e41e8['filters']=_[_0x8b75('0x47')](_0x2e41e8['model'],_0x2e41e8[_0x8b75('0x45')]);_0x25321e['attributes']=_[_0x8b75('0x47')](_0x2e41e8[_0x8b75('0x48')],qs['fields'](_0x23df4c[_0x8b75('0x45')][_0x8b75('0x4a')]));_0x25321e[_0x8b75('0x49')]=_0x25321e[_0x8b75('0x49')][_0x8b75('0x4b')]?_0x25321e[_0x8b75('0x49')]:_0x2e41e8[_0x8b75('0x48')];if(_0x23df4c['query']['includeAll']){_0x25321e['include']=[{'all':!![]}];}_0x25321e=_[_0x8b75('0x53')]({},_0x25321e,_0x23df4c[_0x8b75('0x5b')]);return db[_0x8b75('0x40')][_0x8b75('0x5c')](_0x25321e)[_0x8b75('0x39')](handleEntityNotFound(_0x8318a3,null))[_0x8b75('0x39')](respondWithResult(_0x8318a3,null))[_0x8b75('0x2d')](handleError(_0x8318a3,null));};exports[_0x8b75('0x5d')]=function(_0x1613e7,_0x253946){return db[_0x8b75('0x40')][_0x8b75('0x5d')](_0x1613e7[_0x8b75('0x5e')],{})[_0x8b75('0x39')](respondWithResult(_0x253946,0xc9))[_0x8b75('0x2d')](handleError(_0x253946,null));};exports[_0x8b75('0x38')]=function(_0x2cf0be,_0x36a80d){if(_0x2cf0be[_0x8b75('0x5e')]['id']){delete _0x2cf0be[_0x8b75('0x5e')]['id'];}return db[_0x8b75('0x40')][_0x8b75('0x5c')]({'where':{'id':_0x2cf0be[_0x8b75('0x59')]['id']}})[_0x8b75('0x39')](handleEntityNotFound(_0x36a80d,null))[_0x8b75('0x39')](saveUpdates(_0x2cf0be['body'],null))[_0x8b75('0x39')](respondWithResult(_0x36a80d,null))[_0x8b75('0x2d')](handleError(_0x36a80d,null));};exports[_0x8b75('0x3a')]=function(_0x1f4ec5,_0x4da7fe){return db[_0x8b75('0x40')][_0x8b75('0x5c')]({'where':{'id':_0x1f4ec5[_0x8b75('0x59')]['id']}})[_0x8b75('0x39')](handleEntityNotFound(_0x4da7fe,null))[_0x8b75('0x39')](removeEntity(_0x4da7fe,null))[_0x8b75('0x2d')](handleError(_0x4da7fe,null));};exports[_0x8b75('0x5f')]=function(_0x107ef5,_0x387be1){return db[_0x8b75('0x40')][_0x8b75('0x5f')]()[_0x8b75('0x39')](respondWithResult(_0x387be1,null))[_0x8b75('0x2d')](handleError(_0x387be1,null));};var interaction_log=require(_0x8b75('0x16'))(_0x8b75('0x60'));exports['accept']=function(_0x47676d,_0x352566,_0x33e6a1){var _0x531064={'agent':{},'channel':_0x8b75('0x61')};if(_0x47676d['body']['id']){delete _0x47676d[_0x8b75('0x5e')]['id'];}_0x47676d[_0x8b75('0x5e')][_0x8b75('0x62')]=!![];_0x47676d[_0x8b75('0x5e')][_0x8b75('0x63')]=moment()['format'](_0x8b75('0x64'));_0x47676d[_0x8b75('0x5e')]['UserId']=_0x47676d['body'][_0x8b75('0x65')]||_0x47676d[_0x8b75('0x66')]['id'];_0x531064[_0x8b75('0x67')]['id']=_0x47676d[_0x8b75('0x5e')][_0x8b75('0x65')];return db['SmsMessage'][_0x8b75('0x5c')]({'where':{'id':_0x47676d[_0x8b75('0x59')]['id'],'UserId':null}})[_0x8b75('0x39')](handleEntityNotFound(_0x352566,null))['then'](saveUpdates(_0x47676d['body'],null))['then'](function(_0x347a46){if(_0x347a46){_0x531064['message']=_0x347a46['get']({'plain':!![]});return db[_0x8b75('0x68')][_0x8b75('0x5c')]({'where':{'id':_0x347a46[_0x8b75('0x69')]}});}return null;})['then'](handleEntityNotFound(_0x352566,null))[_0x8b75('0x39')](function(_0x33f70d){if(_0x33f70d){return _0x33f70d[_0x8b75('0x38')]({'UserId':_0x47676d['body'][_0x8b75('0x65')],'read1stAt':_[_0x8b75('0x6a')](_0x33f70d[_0x8b75('0x6b')])?moment()[_0x8b75('0x6c')](_0x8b75('0x64')):undefined});}return null;})[_0x8b75('0x39')](function(_0x4fbf76){if(_0x4fbf76){_0x531064[_0x8b75('0x6d')]=_0x4fbf76[_0x8b75('0x6e')]({'plain':!![]});interaction_log[_0x8b75('0x23')]('[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x47676d[_0x8b75('0x66')]['id'],_0x47676d[_0x8b75('0x66')][_0x8b75('0x3c')],_0x47676d[_0x8b75('0x66')][_0x8b75('0x6f')],_0x531064[_0x8b75('0x6d')]['id'],_0x47676d['body']?JSON[_0x8b75('0x28')](_0x47676d[_0x8b75('0x5e')]):_0x8b75('0x70'));return respondWithRpcPromise(_0x8b75('0x71'),_0x8b75('0x72'),_0x531064);}return null;})[_0x8b75('0x39')](function(_0x2d5a29){var _0x1157df=_0x8b75('0x73')+_0x2d5a29[_0x8b75('0x2b')][_0x8b75('0x74')];return db['sequelize']['query'](_0x1157df,{'type':db[_0x8b75('0x75')][_0x8b75('0x76')]['SELECT'],'raw':!![]})['then'](function(_0x330a1f){return _0x330a1f;});})[_0x8b75('0x39')](function(_0x3644dd){if(_0x3644dd){_0x531064['message'][_0x8b75('0x77')]=_0x3644dd[0x0];if(!_0x47676d[_0x8b75('0x5e')][_0x8b75('0x65')])return;return db[_0x8b75('0x78')][_0x8b75('0x5c')]({'where':{'id':_0x47676d[_0x8b75('0x5e')][_0x8b75('0x65')],'role':'agent'},'attributes':['id',_0x8b75('0x3c'),_0x8b75('0x79'),_0x8b75('0x7a'),_0x8b75('0x7b')],'raw':!![]});}return null;})[_0x8b75('0x39')](function(_0x135119){if(!_0x135119)return null;_0x531064[_0x8b75('0x2b')][_0x8b75('0x67')]=_0x135119;return _0x531064;})['then'](function(_0x26d292){if(_0x26d292){if(_0x47676d[_0x8b75('0x5e')][_0x8b75('0x7c')]){_0x531064[_0x8b75('0x2b')]['interface']=util[_0x8b75('0x6c')]('SIP/%s',_0x47676d[_0x8b75('0x66')][_0x8b75('0x3c')]);_0x531064[_0x8b75('0x2b')][_0x8b75('0x7d')]=_0x531064[_0x8b75('0x7d')];_0x531064[_0x8b75('0x2b')][_0x8b75('0x7e')]=_0x531064[_0x8b75('0x7d')];_0x531064[_0x8b75('0x2b')][_0x8b75('0x7f')]='accept';return respondWithRpcPromise(_0x8b75('0x80'),_0x8b75('0x80'),{'event':_0x8b75('0x81'),'message':_0x531064[_0x8b75('0x2b')]},client9002)[_0x8b75('0x39')](function(){return _0x531064;});}return _0x531064;}return null;})[_0x8b75('0x39')](respondWithResult(_0x352566,null))[_0x8b75('0x2d')](handleError(_0x352566,null));};var interaction_log=require(_0x8b75('0x16'))('sms-interactions');exports['reject']=function(_0x4592c6,_0x42629c,_0xd8fc2c){var _0x166a94={'agent':{},'channel':_0x8b75('0x61')};if(_0x4592c6['body']['id']){delete _0x4592c6[_0x8b75('0x5e')]['id'];}_0x4592c6['body']['UserId']=_0x4592c6['body'][_0x8b75('0x65')]||_0x4592c6[_0x8b75('0x66')]['id'];_0x166a94[_0x8b75('0x67')]['id']=_0x4592c6['body']['UserId'];return db['SmsMessage'][_0x8b75('0x5c')]({'where':{'id':_0x4592c6[_0x8b75('0x59')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x42629c,null))[_0x8b75('0x39')](function(_0x4156c2){if(_0x4156c2){_0x166a94[_0x8b75('0x2b')]=_0x4156c2[_0x8b75('0x6e')]({'plain':!![]});return db[_0x8b75('0x68')]['find']({'where':{'id':_0x4156c2[_0x8b75('0x69')]}});}return null;})[_0x8b75('0x39')](handleEntityNotFound(_0x42629c,null))[_0x8b75('0x39')](function(_0x55aa90){if(_0x55aa90){_0x166a94[_0x8b75('0x6d')]=_0x55aa90[_0x8b75('0x6e')]({'plain':!![]});interaction_log[_0x8b75('0x23')](_0x8b75('0x82'),_0x4592c6[_0x8b75('0x66')]['id'],_0x4592c6[_0x8b75('0x66')][_0x8b75('0x3c')],_0x4592c6[_0x8b75('0x66')][_0x8b75('0x6f')],_0x166a94[_0x8b75('0x6d')]['id'],_0x4592c6[_0x8b75('0x5e')]?JSON[_0x8b75('0x28')](_0x4592c6[_0x8b75('0x5e')]):'null');return respondWithRpcPromise(_0x8b75('0x83'),'rejectMessage',_0x166a94);}return null;})[_0x8b75('0x39')](function(_0x134c68){var _0x498e8f=_0x8b75('0x73')+_0x134c68[_0x8b75('0x2b')]['ContactId'];return db['sequelize'][_0x8b75('0x45')](_0x498e8f,{'type':db[_0x8b75('0x75')][_0x8b75('0x76')][_0x8b75('0x84')],'raw':!![]})['then'](function(_0x5975f2){return _0x5975f2;});})['then'](function(_0x23c392){if(_0x23c392){_0x166a94['message']['contact']=_0x23c392[0x0];if(!_0x4592c6[_0x8b75('0x5e')][_0x8b75('0x65')])return;return db[_0x8b75('0x78')][_0x8b75('0x5c')]({'where':{'id':_0x4592c6[_0x8b75('0x5e')][_0x8b75('0x65')],'role':'agent'},'attributes':['id',_0x8b75('0x3c'),_0x8b75('0x79'),_0x8b75('0x7a'),'internal'],'raw':!![]});}return null;})[_0x8b75('0x39')](function(_0x17d133){if(!_0x17d133)return null;_0x166a94[_0x8b75('0x2b')][_0x8b75('0x67')]=_0x17d133;return _0x166a94;})[_0x8b75('0x39')](function(_0x216b93){if(_0x216b93){_0x216b93[_0x8b75('0x2b')][_0x8b75('0x85')]=util[_0x8b75('0x6c')](_0x8b75('0x86'),_0x4592c6[_0x8b75('0x66')][_0x8b75('0x3c')]);_0x216b93[_0x8b75('0x2b')][_0x8b75('0x7d')]=_0x166a94['channel'];_0x216b93[_0x8b75('0x2b')][_0x8b75('0x7e')]=_0x166a94[_0x8b75('0x7d')];_0x216b93[_0x8b75('0x2b')][_0x8b75('0x7f')]=_0x8b75('0x36');respondWithRpcPromise(_0x8b75('0x80'),_0x8b75('0x80'),{'event':'rejectmessage','message':_0x216b93[_0x8b75('0x2b')]},client9002);return _0x166a94;}return null;})[_0x8b75('0x39')](respondWithResult(_0x42629c,null))[_0x8b75('0x2d')](handleError(_0x42629c,null));};exports['status']=function(_0x4352c0,_0x4de111,_0x56fd02){if(_0x4352c0[_0x8b75('0x5e')]['id']){delete _0x4352c0[_0x8b75('0x5e')]['id'];}var _0x5a70e6;return db[_0x8b75('0x40')][_0x8b75('0x5c')]({'where':{'id':_0x4352c0[_0x8b75('0x59')]['id']}})['then'](handleEntityNotFound(_0x4de111,null))[_0x8b75('0x39')](function(_0x3fc78e){if(_0x3fc78e){_0x5a70e6=_0x3fc78e;return db['SmsAccount'][_0x8b75('0x5c')]({'where':{'id':_0x3fc78e[_0x8b75('0x87')]}});}})[_0x8b75('0x39')](handleEntityNotFound(_0x4de111,null))[_0x8b75('0x39')](function(_0x19133e){if(_0x19133e){logger['debug'](_0x8b75('0x27'),_0x8b75('0x2f'),_0x8b75('0x88'),_0x19133e[_0x8b75('0x43')],util[_0x8b75('0x89')](_0x4352c0[_0x8b75('0x5e')],{'showHidden':![],'depth':null}));switch(_0x19133e['type']){case'twilio':if(_0x4352c0[_0x8b75('0x5e')][_0x8b75('0x8a')]&&_0x4352c0[_0x8b75('0x5e')][_0x8b75('0x8a')]===_0x5a70e6[_0x8b75('0x8b')]){return _0x5a70e6[_0x8b75('0x38')]({'read':!![]});}else{logger[_0x8b75('0x29')](_0x8b75('0x8c'),_0x8b75('0x2f'),_0x8b75('0x8d'),util[_0x8b75('0x89')](_0x4352c0[_0x8b75('0x5e')],{'showHidden':![],'depth':null}));}break;case _0x8b75('0x8e'):if(_0x4352c0['body'][_0x8b75('0x8f')]&&_0x4352c0['body'][_0x8b75('0x8f')]===_0x5a70e6['messageId']&&_[_0x8b75('0x90')]([_0x8b75('0x91'),_0x8b75('0x92')],_0x4352c0['body']['Status'])>=0x0){return _0x5a70e6[_0x8b75('0x38')]({'read':!![]});}else{logger[_0x8b75('0x29')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x8b75('0x2f'),_0x8b75('0x93'),util[_0x8b75('0x89')](_0x4352c0[_0x8b75('0x5e')],{'showHidden':![],'depth':null}));}break;case _0x8b75('0x94'):var _0x41d0aa=_0x4352c0['body'][_0x8b75('0x95')][0x0];if(_0x41d0aa[_0x8b75('0x2f')]['groupName']===_0x8b75('0x96')){return _0x5a70e6[_0x8b75('0x38')]({'read':!![]});}else{logger[_0x8b75('0x29')](_0x8b75('0x8c'),'status',_0x8b75('0x94'),util[_0x8b75('0x89')](_0x4352c0[_0x8b75('0x5e')],{'showHidden':![],'depth':null}));}break;}return _0x5a70e6;}})[_0x8b75('0x39')](respondWithResult(_0x4de111,null))[_0x8b75('0x2d')](handleError(_0x4de111,null));}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.events.js b/server/api/smsMessage/smsMessage.events.js index 92ad8cf..0612186 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 _0xa175=['exports','events','../../mysqldb','SmsMessage','setMaxListeners','save','remove','emit','hasOwnProperty','hook'];(function(_0x3ab4dc,_0x16e7c8){var _0xd6291d=function(_0x3cd0a8){while(--_0x3cd0a8){_0x3ab4dc['push'](_0x3ab4dc['shift']());}};_0xd6291d(++_0x16e7c8);}(_0xa175,0x10f));var _0x5a17=function(_0x3e5afe,_0x35cba2){_0x3e5afe=_0x3e5afe-0x0;var _0x475a38=_0xa175[_0x3e5afe];return _0x475a38;};'use strict';var EventEmitter=require(_0x5a17('0x0'));var SmsMessage=require(_0x5a17('0x1'))['db'][_0x5a17('0x2')];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0x5a17('0x3')](0x0);var events={'afterCreate':_0x5a17('0x4'),'afterUpdate':'update','afterDestroy':_0x5a17('0x5')};function emitEvent(_0x22acf6){return function(_0x54c77e,_0x16909a,_0x181ea4){SmsMessageEvents[_0x5a17('0x6')](_0x22acf6+':'+_0x54c77e['id'],_0x54c77e);SmsMessageEvents[_0x5a17('0x6')](_0x22acf6,_0x54c77e);_0x181ea4(null);};}for(var e in events){if(events[_0x5a17('0x7')](e)){var event=events[e];SmsMessage[_0x5a17('0x8')](e,emitEvent(event));}}module[_0x5a17('0x9')]=SmsMessageEvents; \ No newline at end of file +var _0xa12d=['hasOwnProperty','hook','exports','events','SmsMessage','setMaxListeners','save','update','remove','emit'];(function(_0x1c480a,_0x4b1db6){var _0x2b7470=function(_0xd22a40){while(--_0xd22a40){_0x1c480a['push'](_0x1c480a['shift']());}};_0x2b7470(++_0x4b1db6);}(_0xa12d,0x175));var _0xda12=function(_0x52bc80,_0x5bc698){_0x52bc80=_0x52bc80-0x0;var _0x292d5a=_0xa12d[_0x52bc80];return _0x292d5a;};'use strict';var EventEmitter=require(_0xda12('0x0'));var SmsMessage=require('../../mysqldb')['db'][_0xda12('0x1')];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0xda12('0x2')](0x0);var events={'afterCreate':_0xda12('0x3'),'afterUpdate':_0xda12('0x4'),'afterDestroy':_0xda12('0x5')};function emitEvent(_0x36d53c){return function(_0x45ae44,_0x59b0ce,_0x3b23f9){SmsMessageEvents[_0xda12('0x6')](_0x36d53c+':'+_0x45ae44['id'],_0x45ae44);SmsMessageEvents['emit'](_0x36d53c,_0x45ae44);_0x3b23f9(null);};}for(var e in events){if(events[_0xda12('0x7')](e)){var event=events[e];SmsMessage[_0xda12('0x8')](e,emitEvent(event));}}module[_0xda12('0x9')]=SmsMessageEvents; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.model.js b/server/api/smsMessage/smsMessage.model.js index efdeb8a..dfe48a2 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 _0xc02d=['internal_order_id','deliveryReport','read','connectel','https://smsapi.connectel.se/api/v2/send/','requestid','clicksend','senderString','format','%s:%s','https://rest.clicksend.com/v3/sms/send','Basic\x20%s','base64','http_code','data','queued_count','head','messages','clickSend','plivo','authId','https://api.plivo.com/v1/Account/%s/Message/','message_uuid','Missing\x20parameters:\x20authId,\x20authToken','infobip','baseUrl','/auth/1/session','/sms/2/text/advanced','application/json','IBSSO\x20','messageId','Missing\x20parameters:\x20base_url','Missing\x20parameters:\x20username,\x20password','csc','crypto','apiKey','text','timestamp','keys','length','createHash','digest','id_sms','Missing\x20parameters:\x20apiKey','clickatell','https://platform.clickatell.com/messages','uuid','UTF-8','apiMessageId','accountId','/messages','bandwidth','https://api.intelepeer.com/_rest/v4/app/sms/send','Bearer\x20','code','message','https://api.intelepeer.com/_rest/v4/app/sms/mdr','status','intelepeer','utf8mb4_unicode_ci','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./smsMessage.attributes','exports','define','SmsMessage','sms_messages','fti_sms_messages','body','FULLTEXT','models','get','toLowerCase','direction','out','isNil','UserId','SmsInteraction','SmsInteractionId','update','createdAt','catch','secret','SmsAccount','find','type','twilio','accountSid','authToken','phone','create','remote','/api/sms/messages/','/status?token=','token','then','sid','error','SmsMessage,\x20%s,\x20%s,\x20%s','inspect','afterCreate','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','skebby','password','smsMethod','sender','login?username=','username','&password=','GET','sms','POST','user_key','session_key','total_sent'];(function(_0x5f1391,_0x19c132){var _0x50ebe3=function(_0x3d00a3){while(--_0x3d00a3){_0x5f1391['push'](_0x5f1391['shift']());}};_0x50ebe3(++_0x19c132);}(_0xc02d,0x1aa));var _0xdc02=function(_0x431fb5,_0x546d1f){_0x431fb5=_0x431fb5-0x0;var _0x184dc4=_0xc02d[_0x431fb5];return _0x184dc4;};'use strict';var _=require('lodash');var util=require(_0xdc02('0x0'));var logger=require(_0xdc02('0x1'))(_0xdc02('0x2'));var moment=require(_0xdc02('0x3'));var BPromise=require(_0xdc02('0x4'));var rp=require(_0xdc02('0x5'));var fs=require('fs');var path=require(_0xdc02('0x6'));var rimraf=require(_0xdc02('0x7'));var config=require(_0xdc02('0x8'));var attributes=require(_0xdc02('0x9'));module[_0xdc02('0xa')]=function(_0x592468,_0x27a980){return _0x592468[_0xdc02('0xb')](_0xdc02('0xc'),attributes,{'tableName':_0xdc02('0xd'),'paranoid':![],'indexes':[{'name':'messageId','fields':['messageId']},{'name':_0xdc02('0xe'),'fields':[_0xdc02('0xf')],'type':_0xdc02('0x10')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x4baca1,_0xfba63f,_0x599f49){var _0x3cb973=_0x592468[_0xdc02('0x11')];var _0x381468=_0x4baca1[_0xdc02('0x12')]({'plain':!![]});if(_0x381468['direction'][_0xdc02('0x13')]()==='in'||_0x381468[_0xdc02('0x14')][_0xdc02('0x13')]()===_0xdc02('0x15')&&!_0x381468['secret']&&!_[_0xdc02('0x16')](_0x381468[_0xdc02('0x17')])){_0x3cb973[_0xdc02('0x18')]['findOne']({'where':{'id':_0x381468[_0xdc02('0x19')]}})['then'](function(_0x28837f){if(_0x28837f){_0x28837f[_0xdc02('0x1a')]({'lastMsgAt':_0x381468[_0xdc02('0x1b')],'lastMsgDirection':_0x381468['direction'][_0xdc02('0x13')]()});}})[_0xdc02('0x1c')](function(_0x41b4e1){console['error'](_0x41b4e1);});}if(_0x381468[_0xdc02('0x14')]==='out'&&!_0x381468[_0xdc02('0x1d')]){var _0x24d677;_0x3cb973[_0xdc02('0x1e')][_0xdc02('0x1f')]({'where':{'id':_0x381468['SmsAccountId']},'raw':!![]})['then'](function(_0x88b0b2){_0x24d677=_0x88b0b2;if(_0x24d677&&_0x24d677[_0xdc02('0x20')]){switch(_0x24d677[_0xdc02('0x20')]){case _0xdc02('0x21'):var _0xf086fd=require(_0xdc02('0x21'));if(_0x24d677[_0xdc02('0x22')]&&_0x24d677[_0xdc02('0x23')]&&_0x24d677[_0xdc02('0x24')]){var _0x345518=new _0xf086fd(_0x24d677[_0xdc02('0x22')],_0x24d677[_0xdc02('0x23')]);_0x345518['messages'][_0xdc02('0x25')]({'body':_0x381468[_0xdc02('0xf')],'to':_0x381468[_0xdc02('0x24')],'from':_0x24d677['phone'],'statusCallback':_0x24d677[_0xdc02('0x26')]+_0xdc02('0x27')+_0x381468['id']+_0xdc02('0x28')+_0x24d677[_0xdc02('0x29')]})[_0xdc02('0x2a')](function(_0x3f708b){if(_0x3f708b[_0xdc02('0x2b')]){return _0x4baca1['update']({'messageId':_0x3f708b[_0xdc02('0x2b')]});}})[_0xdc02('0x1c')](function(_0x11b57c){logger[_0xdc02('0x2c')](_0xdc02('0x2d'),'afterCreate',_0xdc02('0x21'),util[_0xdc02('0x2e')](_0x11b57c,{'showHidden':![],'depth':null}));});}else{logger['error'](_0xdc02('0x2d'),_0xdc02('0x2f'),_0xdc02('0x21'),_0xdc02('0x30'));}break;case _0xdc02('0x31'):var _0x35bb31='https://api.skebby.it/API/v1.0/REST/';if(_0x24d677['username']&&_0x24d677[_0xdc02('0x32')]){var _0x31062d={'recipient':[_0x381468['phone']],'message':_0x381468[_0xdc02('0xf')],'message_type':_0x24d677[_0xdc02('0x33')]};if(_0x24d677[_0xdc02('0x33')]&&_0x24d677['smsMethod']!=='SI'){_0x31062d[_0xdc02('0x34')]=_0x24d677[_0xdc02('0x24')];}var _0x169137={'url':_0x35bb31+_0xdc02('0x35')+_0x24d677[_0xdc02('0x36')]+_0xdc02('0x37')+_0x24d677['password'],'method':_0xdc02('0x38')};rp(_0x169137)[_0xdc02('0x2a')](function(_0xdccef3){var _0x4f3731=_0xdccef3['split'](';');var _0x22ef09={'user_key':_0x4f3731[0x0],'session_key':_0x4f3731[0x1]};_0x169137={'url':_0x35bb31+_0xdc02('0x39'),'method':_0xdc02('0x3a'),'headers':{'user_key':_0x22ef09[_0xdc02('0x3b')],'Session_key':_0x22ef09[_0xdc02('0x3c')]},'json':!![],'body':_0x31062d};return rp(_0x169137);})[_0xdc02('0x2a')](function(_0x476caf){if(_0x476caf[_0xdc02('0x3d')]>=0x1){var _0x3421d5={'messageId':_0x476caf[_0xdc02('0x3e')]};if(_0x24d677[_0xdc02('0x33')]!=='GP'||!_0x24d677[_0xdc02('0x3f')]){_0x3421d5[_0xdc02('0x40')]=!![];}return _0x4baca1[_0xdc02('0x1a')](_0x3421d5);}else{return logger[_0xdc02('0x2c')](_0xdc02('0x2d'),_0xdc02('0x2f'),_0xdc02('0x31'),util[_0xdc02('0x2e')](_0x476caf,{'showHidden':![],'depth':null}));}})[_0xdc02('0x1c')](function(_0x556866){return logger['error'](_0xdc02('0x2d'),'afterCreate','skebby',util[_0xdc02('0x2e')](_0x556866,{'showHidden':![],'depth':null}));});}else{logger['error'](_0xdc02('0x2d'),'afterCreate',_0xdc02('0x31'),'Missing\x20parameters:\x20username,\x20password');}break;case _0xdc02('0x41'):if(_0x24d677[_0xdc02('0x23')]){var _0x1e4c7a={'recipient':_0x381468[_0xdc02('0x24')],'message':_0x381468[_0xdc02('0xf')],'sender':_0x24d677['senderString']||_0x24d677[_0xdc02('0x24')],'authorization':_0x24d677[_0xdc02('0x23')]};var _0xfba63f={'method':_0xdc02('0x3a'),'uri':_0xdc02('0x42'),'body':_0x1e4c7a,'json':!![]};rp(_0xfba63f)[_0xdc02('0x2a')](function(_0x2dcd83){var _0x48fdaf={'messageId':_0x2dcd83[_0xdc02('0x43')]};if(!_0x24d677[_0xdc02('0x3f')]){_0x48fdaf[_0xdc02('0x40')]=!![];}return _0x4baca1[_0xdc02('0x1a')](_0x48fdaf);})[_0xdc02('0x1c')](function(_0x306edc){logger[_0xdc02('0x2c')](_0xdc02('0x2d'),_0xdc02('0x2f'),_0xdc02('0x41'),util['inspect'](_0x306edc,{'showHidden':![],'depth':null}));});}else{logger[_0xdc02('0x2c')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xdc02('0x2f'),'connectel','Missing\x20parameters:\x20authToken');}break;case _0xdc02('0x44'):if(_0x24d677[_0xdc02('0x36')]&&_0x24d677[_0xdc02('0x32')]){var _0x1e4c7a={'messages':[{'source':'xCALLY\x20Motion','to':_0x381468['phone'],'body':_0x381468[_0xdc02('0xf')],'from':_0x24d677[_0xdc02('0x45')]||_0x24d677[_0xdc02('0x24')]}]};var _0x42135e=util[_0xdc02('0x46')](_0xdc02('0x47'),_0x24d677[_0xdc02('0x36')],_0x24d677[_0xdc02('0x32')]);var _0xfba63f={'method':_0xdc02('0x3a'),'uri':_0xdc02('0x48'),'body':_0x1e4c7a,'headers':{'Authorization':util[_0xdc02('0x46')](_0xdc02('0x49'),new Buffer(_0x42135e)['toString'](_0xdc02('0x4a')))},'json':!![]};rp(_0xfba63f)['then'](function(_0x680553){if(_0x680553[_0xdc02('0x4b')]>=0xc8&&_0x680553[_0xdc02('0x4b')]<=0xce){if(_0x680553[_0xdc02('0x4c')]&&_0x680553['data'][_0xdc02('0x4d')]>0x0){var _0x33e014=_[_0xdc02('0x4e')](_0x680553[_0xdc02('0x4c')][_0xdc02('0x4f')]);var _0x4b36dc={'messageId':_0x33e014['message_id']};if(!_0x24d677[_0xdc02('0x3f')]){_0x4b36dc[_0xdc02('0x40')]=!![];}return _0x4baca1[_0xdc02('0x1a')](_0x4b36dc);}else{logger[_0xdc02('0x2c')](_0xdc02('0x2d'),'afterCreate',_0xdc02('0x50'),util[_0xdc02('0x2e')](_0x680553,{'showHidden':![],'depth':null}));}}else{logger[_0xdc02('0x2c')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xdc02('0x2f'),_0xdc02('0x50'),util[_0xdc02('0x2e')](_0x680553,{'showHidden':![],'depth':null}));}})[_0xdc02('0x1c')](function(_0xf00961){logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0xdc02('0x2f'),_0xdc02('0x50'),util[_0xdc02('0x2e')](_0xf00961,{'showHidden':![],'depth':null}));});}else{logger[_0xdc02('0x2c')](_0xdc02('0x2d'),_0xdc02('0x2f'),_0xdc02('0x50'),'Missing\x20parameters:\x20username,\x20password');}break;case _0xdc02('0x51'):if(_0x24d677[_0xdc02('0x52')]&&_0x24d677[_0xdc02('0x23')]){var _0x1e4c7a={'dst':_0x381468['phone'],'text':_0x381468[_0xdc02('0xf')],'src':_0x24d677[_0xdc02('0x45')]||_0x24d677['phone'],'url':_0x24d677['remote']+_0xdc02('0x27')+_0x381468['id']+_0xdc02('0x28')+_0x24d677[_0xdc02('0x29')]};var _0x42135e=util[_0xdc02('0x46')](_0xdc02('0x47'),_0x24d677['authId'],_0x24d677[_0xdc02('0x23')]);var _0xfba63f={'method':_0xdc02('0x3a'),'uri':util[_0xdc02('0x46')](_0xdc02('0x53'),_0x24d677[_0xdc02('0x52')]),'body':_0x1e4c7a,'headers':{'Authorization':util[_0xdc02('0x46')]('Basic\x20%s',new Buffer(_0x42135e)['toString'](_0xdc02('0x4a')))},'json':!![]};rp(_0xfba63f)['then'](function(_0x2238ef){var _0x584f79={'messageId':_0x2238ef[_0xdc02('0x54')][0x0]};return _0x4baca1[_0xdc02('0x1a')](_0x584f79);})[_0xdc02('0x1c')](function(_0x513f51){logger['error'](_0xdc02('0x2d'),'afterCreate',_0xdc02('0x51'),util[_0xdc02('0x2e')](_0x513f51,{'showHidden':![],'depth':null}));});}else{logger['error'](_0xdc02('0x2d'),'afterCreate',_0xdc02('0x51'),_0xdc02('0x55'));}break;case _0xdc02('0x56'):if(_0x24d677[_0xdc02('0x36')]&&_0x24d677[_0xdc02('0x32')]){if(_0x24d677[_0xdc02('0x57')]){var _0x20f380={'method':_0xdc02('0x3a'),'uri':_0x24d677[_0xdc02('0x57')]+_0xdc02('0x58'),'body':{'username':_0x24d677[_0xdc02('0x36')],'password':_0x24d677[_0xdc02('0x32')]},'json':!![]};return rp(_0x20f380)[_0xdc02('0x2a')](function(_0x555777){var _0xa0a63e={'method':_0xdc02('0x3a'),'uri':_0x24d677[_0xdc02('0x57')]+_0xdc02('0x59'),'body':{'messages':[{'from':_0x24d677['phone'],'destinations':[{'to':_0x381468[_0xdc02('0x24')]}],'text':_0x381468[_0xdc02('0xf')],'notifyUrl':_0x24d677['remote']+_0xdc02('0x27')+_0x381468['id']+'/status?token='+_0x24d677[_0xdc02('0x29')],'notifyContentType':_0xdc02('0x5a'),'callbackData':_0x24d677[_0xdc02('0x24')]+';'+_0x381468[_0xdc02('0xf')]}]},'headers':{'Authorization':_0xdc02('0x5b')+_0x555777[_0xdc02('0x29')]},'json':!![]};return rp(_0xa0a63e)[_0xdc02('0x2a')](function(_0x2e8e1d){if(_0x2e8e1d[_0xdc02('0x4f')]){var _0x5de66d={'messageId':_0x2e8e1d[_0xdc02('0x4f')][0x0][_0xdc02('0x5c')]};if(!_0x24d677[_0xdc02('0x3f')]){_0x5de66d[_0xdc02('0x40')]=!![];}return _0x4baca1[_0xdc02('0x1a')](_0x5de66d);}else{return logger[_0xdc02('0x2c')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xdc02('0x2f'),_0xdc02('0x56'),util[_0xdc02('0x2e')](_0x2e8e1d,{'showHidden':![],'depth':null}));}});})['catch'](function(_0x45e42a){return logger[_0xdc02('0x2c')](_0xdc02('0x2d'),_0xdc02('0x2f'),_0xdc02('0x56'),util[_0xdc02('0x2e')](_0x45e42a,{'showHidden':![],'depth':null}));});}else{logger[_0xdc02('0x2c')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0xdc02('0x56'),_0xdc02('0x5d'));}}else{logger[_0xdc02('0x2c')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xdc02('0x2f'),_0xdc02('0x56'),_0xdc02('0x5e'));}break;case _0xdc02('0x5f'):var _0x5830d3=require(_0xdc02('0x60'));if(_0x24d677[_0xdc02('0x61')]){var _0x476538={};_0x476538['login']=_0x24d677[_0xdc02('0x36')];_0x476538[_0xdc02('0x24')]=_0x381468[_0xdc02('0x24')];_0x476538[_0xdc02('0x34')]=_0x24d677[_0xdc02('0x24')];_0x476538[_0xdc02('0x62')]=_0x381468[_0xdc02('0xf')];_0x476538[_0xdc02('0x63')]=+new Date();var _0x133833='';var _0x5c0d2e='';var _0x25b475=Object[_0xdc02('0x64')](_0x476538);_0x25b475['sort']();for(var _0x24fe6f=0x0;_0x24fe6f<_0x25b475[_0xdc02('0x65')];_0x24fe6f++){if(_0x133833!=''){_0x133833+='&';}_0x133833+=_0x25b475[_0x24fe6f]+'='+encodeURIComponent(_0x476538[_0x25b475[_0x24fe6f]]);_0x5c0d2e+=_0x476538[_0x25b475[_0x24fe6f]];}_0x5c0d2e+=_0x24d677[_0xdc02('0x61')];_0x5c0d2e=_0x5830d3[_0xdc02('0x66')]('md5')['update'](_0x5c0d2e)[_0xdc02('0x67')]('hex');if(_0x133833!==''){_0x133833+='&';}_0x133833+='signature='+_0x5c0d2e;var _0x169137={'method':'GET','uri':_0x24d677[_0xdc02('0x57')]+'/external/get/send.php?'+_0x133833,'json':!![]};return rp(_0x169137)[_0xdc02('0x2a')](function(_0x4659b5){var _0x3e5be5=Object[_0xdc02('0x64')](_0x4659b5);if(_0x4659b5[_0x3e5be5[0x0]]['error']&&parseInt(_0x4659b5[_0x3e5be5[0x0]][_0xdc02('0x2c')])===0x0){var _0x187097={'messageId':_0x4659b5[_0x3e5be5[0x0]][_0xdc02('0x68')]};if(!_0x24d677[_0xdc02('0x3f')]){_0x187097[_0xdc02('0x40')]=!![];}return _0x4baca1[_0xdc02('0x1a')](_0x187097);}else{return logger['error'](_0xdc02('0x2d'),_0xdc02('0x2f'),_0xdc02('0x5f'),util[_0xdc02('0x2e')](_0x4659b5[_0xdc02('0x2c')],{'showHidden':![],'depth':null}));}})[_0xdc02('0x1c')](function(_0x950760){return logger[_0xdc02('0x2c')](_0xdc02('0x2d'),_0xdc02('0x2f'),_0xdc02('0x5f'),util[_0xdc02('0x2e')](_0x950760,{'showHidden':![],'depth':null}));});}else{logger[_0xdc02('0x2c')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xdc02('0x2f'),_0xdc02('0x5f'),_0xdc02('0x69'));}break;case _0xdc02('0x6a'):if(_0x24d677[_0xdc02('0x61')]){var _0x15438a={'method':_0xdc02('0x3a'),'uri':_0xdc02('0x6b'),'headers':{'Authorization':_0x24d677['apiKey']},'body':{'content':_0x381468['body'],'to':[_0x381468[_0xdc02('0x24')]],'from':_0x24d677[_0xdc02('0x24')],'binary':![],'clientMessageId':_0xdc02('0x6c'),'charset':_0xdc02('0x6d')},'json':!![]};rp(_0x15438a)[_0xdc02('0x2a')](function(_0x3eaacf){if(!_0x3eaacf[_0xdc02('0x2c')]){var _0x2f6b0c={'messageId':_0x3eaacf[_0xdc02('0x4f')][0x0][_0xdc02('0x6e')]};if(!_0x24d677[_0xdc02('0x3f')]){_0x2f6b0c[_0xdc02('0x40')]=!![];}return _0x4baca1['update'](_0x2f6b0c);}else{return logger[_0xdc02('0x2c')](_0xdc02('0x2d'),_0xdc02('0x2f'),_0xdc02('0x6a'),util[_0xdc02('0x2e')](_0x3eaacf[_0xdc02('0x2c')],{'showHidden':![],'depth':null}));}})[_0xdc02('0x1c')](function(_0x2e1b43){return logger[_0xdc02('0x2c')](_0xdc02('0x2d'),_0xdc02('0x2f'),_0xdc02('0x6a'),util[_0xdc02('0x2e')](_0x2e1b43,{'showHidden':![],'depth':null}));});}else{logger['error'](_0xdc02('0x2d'),_0xdc02('0x2f'),_0xdc02('0x6a'),_0xdc02('0x69'));}break;case'bandwidth':if(_0x24d677['username']&&_0x24d677[_0xdc02('0x32')]){var _0x42135e=util[_0xdc02('0x46')](_0xdc02('0x47'),_0x24d677[_0xdc02('0x36')],_0x24d677['password']);var _0xfba63f={'method':'POST','uri':'https://messaging.bandwidth.com/api/v2/users/'+_0x24d677[_0xdc02('0x6f')]+_0xdc02('0x70'),'body':{'to':[_0x381468['phone']],'text':_0x381468[_0xdc02('0xf')],'from':_0x24d677[_0xdc02('0x24')],'applicationId':_0x24d677['applicationId']},'headers':{'Authorization':util[_0xdc02('0x46')]('Basic\x20%s',new Buffer(_0x42135e)['toString'](_0xdc02('0x4a')))},'json':!![]};rp(_0xfba63f)[_0xdc02('0x2a')](function(_0x380bf5){if(_0x380bf5['id']){var _0x51976c={'messageId':_0x380bf5['id']};return _0x4baca1[_0xdc02('0x1a')](_0x51976c);}else{logger[_0xdc02('0x2c')](_0xdc02('0x2d'),_0xdc02('0x2f'),_0xdc02('0x71'),util['inspect'](_0x380bf5,{'showHidden':![],'depth':null}));}})[_0xdc02('0x1c')](function(_0x47dcb3){logger[_0xdc02('0x2c')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xdc02('0x2f'),_0xdc02('0x71'),util[_0xdc02('0x2e')](_0x47dcb3,{'showHidden':![],'depth':null}));});}else{logger[_0xdc02('0x2c')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xdc02('0x2f'),_0xdc02('0x71'),'Missing\x20parameters:\x20username,\x20password');}break;case'intelepeer':if(_0x24d677[_0xdc02('0x61')]){var _0x38b30={};var _0x169137={'method':_0xdc02('0x3a'),'uri':_0xdc02('0x72'),'headers':{'Authorization':_0xdc02('0x73')+_0x24d677[_0xdc02('0x61')],'Content-Type':_0xdc02('0x5a')},'body':{'from':_0x24d677[_0xdc02('0x24')],'to':_0x381468['phone'],'text':_0x381468['body']},'json':!![]};return rp(_0x169137)[_0xdc02('0x2a')](function(_0x4fe627){if(_0x4fe627[_0xdc02('0x74')]==0xca){_0x38b30[_0xdc02('0x75')]=_0x4fe627;var _0x5a7073={'method':_0xdc02('0x3a'),'uri':_0xdc02('0x76'),'headers':{'Authorization':_0xdc02('0x73')+_0x24d677['apiKey'],'Content-Type':_0xdc02('0x5a')},'body':{'refid':_0x38b30[_0xdc02('0x75')]['refid']},'json':!![]};return rp(_0x5a7073)[_0xdc02('0x2a')](function(_0x6c4d3d){_0x38b30[_0xdc02('0x77')]=_0x6c4d3d;var _0x4a8137={'messageId':_0x38b30[_0xdc02('0x75')]['refid'],'read':!![]};return _0x4baca1[_0xdc02('0x1a')](_0x4a8137);});}else{return logger[_0xdc02('0x2c')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xdc02('0x2f'),_0xdc02('0x78'),util[_0xdc02('0x2e')](_0x4fe627,{'showHidden':![],'depth':null}));}})['catch'](function(_0x2c4530){return logger[_0xdc02('0x2c')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xdc02('0x2f'),_0xdc02('0x78'),util[_0xdc02('0x2e')](_0x2c4530,{'showHidden':![],'depth':null}));});}else{return logger['error'](_0xdc02('0x2d'),_0xdc02('0x2f'),_0xdc02('0x78'),'Token\x20not\x20received');}break;}}})['finally'](function(){_0x599f49();});}else{_0x599f49();}}},'charset':'utf8mb4','collate':_0xdc02('0x79')});}; \ No newline at end of file +var _0xd9dc=['then','createdAt','catch','error','SmsAccount','find','SmsAccountId','type','twilio','accountSid','authToken','messages','create','phone','/status?token=','token','update','sid','SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','inspect','skebby','password','smsMethod','sender','login?username=','username','GET','split','sms','session_key','total_sent','internal_order_id','Missing\x20parameters:\x20username,\x20password','connectel','POST','requestid','deliveryReport','read','Missing\x20parameters:\x20authToken','clicksend','xCALLY\x20Motion','format','%s:%s','toString','base64','http_code','data','queued_count','message_id','clickSend','plivo','authId','senderString','/api/sms/messages/','https://api.plivo.com/v1/Account/%s/Message/','Basic\x20%s','message_uuid','Missing\x20parameters:\x20authId,\x20authToken','baseUrl','/sms/2/text/advanced','remote','application/json','infobip','csc','crypto','text','timestamp','sort','apiKey','md5','digest','hex','signature=','/external/get/send.php?','keys','id_sms','https://platform.clickatell.com/messages','UTF-8','apiMessageId','clickatell','https://messaging.bandwidth.com/api/v2/users/','accountId','/messages','applicationId','bandwidth','intelepeer','https://api.intelepeer.com/_rest/v4/app/sms/send','message','Bearer\x20','refid','status','Token\x20not\x20received','finally','utf8mb4_unicode_ci','util','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','./smsMessage.attributes','exports','define','SmsMessage','sms_messages','messageId','body','FULLTEXT','models','direction','out','secret','isNil','SmsInteraction','SmsInteractionId'];(function(_0x268ae4,_0x4280bf){var _0x432e21=function(_0x51ce74){while(--_0x51ce74){_0x268ae4['push'](_0x268ae4['shift']());}};_0x432e21(++_0x4280bf);}(_0xd9dc,0x1be));var _0xcd9d=function(_0x162432,_0x457935){_0x162432=_0x162432-0x0;var _0x15df9f=_0xd9dc[_0x162432];return _0x15df9f;};'use strict';var _=require('lodash');var util=require(_0xcd9d('0x0'));var logger=require(_0xcd9d('0x1'))('api');var moment=require(_0xcd9d('0x2'));var BPromise=require(_0xcd9d('0x3'));var rp=require(_0xcd9d('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xcd9d('0x5'));var config=require(_0xcd9d('0x6'));var attributes=require(_0xcd9d('0x7'));module[_0xcd9d('0x8')]=function(_0x8cc2e4,_0x50f1e2){return _0x8cc2e4[_0xcd9d('0x9')](_0xcd9d('0xa'),attributes,{'tableName':_0xcd9d('0xb'),'paranoid':![],'indexes':[{'name':_0xcd9d('0xc'),'fields':[_0xcd9d('0xc')]},{'name':'fti_sms_messages','fields':[_0xcd9d('0xd')],'type':_0xcd9d('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x32dce7,_0x112c01,_0x18f6a7){var _0x2bbf4e=_0x8cc2e4[_0xcd9d('0xf')];var _0x257586=_0x32dce7['get']({'plain':!![]});if(_0x257586[_0xcd9d('0x10')]['toLowerCase']()==='in'||_0x257586[_0xcd9d('0x10')]['toLowerCase']()===_0xcd9d('0x11')&&!_0x257586[_0xcd9d('0x12')]&&!_[_0xcd9d('0x13')](_0x257586['UserId'])){_0x2bbf4e[_0xcd9d('0x14')]['findOne']({'where':{'id':_0x257586[_0xcd9d('0x15')]}})[_0xcd9d('0x16')](function(_0x31ddbb){if(_0x31ddbb){_0x31ddbb['update']({'lastMsgAt':_0x257586[_0xcd9d('0x17')],'lastMsgDirection':_0x257586[_0xcd9d('0x10')]['toLowerCase']()});}})[_0xcd9d('0x18')](function(_0x5a7248){console[_0xcd9d('0x19')](_0x5a7248);});}if(_0x257586['direction']===_0xcd9d('0x11')&&!_0x257586[_0xcd9d('0x12')]){var _0x3a66af;_0x2bbf4e[_0xcd9d('0x1a')][_0xcd9d('0x1b')]({'where':{'id':_0x257586[_0xcd9d('0x1c')]},'raw':!![]})[_0xcd9d('0x16')](function(_0x3c544d){_0x3a66af=_0x3c544d;if(_0x3a66af&&_0x3a66af[_0xcd9d('0x1d')]){switch(_0x3a66af[_0xcd9d('0x1d')]){case _0xcd9d('0x1e'):var _0x497425=require(_0xcd9d('0x1e'));if(_0x3a66af[_0xcd9d('0x1f')]&&_0x3a66af[_0xcd9d('0x20')]&&_0x3a66af['phone']){var _0x2a5848=new _0x497425(_0x3a66af[_0xcd9d('0x1f')],_0x3a66af[_0xcd9d('0x20')]);_0x2a5848[_0xcd9d('0x21')][_0xcd9d('0x22')]({'body':_0x257586[_0xcd9d('0xd')],'to':_0x257586[_0xcd9d('0x23')],'from':_0x3a66af[_0xcd9d('0x23')],'statusCallback':_0x3a66af['remote']+'/api/sms/messages/'+_0x257586['id']+_0xcd9d('0x24')+_0x3a66af[_0xcd9d('0x25')]})[_0xcd9d('0x16')](function(_0x474bb4){if(_0x474bb4['sid']){return _0x32dce7[_0xcd9d('0x26')]({'messageId':_0x474bb4[_0xcd9d('0x27')]});}})[_0xcd9d('0x18')](function(_0xf0f632){logger[_0xcd9d('0x19')](_0xcd9d('0x28'),_0xcd9d('0x29'),_0xcd9d('0x1e'),util[_0xcd9d('0x2a')](_0xf0f632,{'showHidden':![],'depth':null}));});}else{logger[_0xcd9d('0x19')](_0xcd9d('0x28'),_0xcd9d('0x29'),_0xcd9d('0x1e'),'Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken');}break;case _0xcd9d('0x2b'):var _0x2b07a4='https://api.skebby.it/API/v1.0/REST/';if(_0x3a66af['username']&&_0x3a66af[_0xcd9d('0x2c')]){var _0x124da9={'recipient':[_0x257586['phone']],'message':_0x257586[_0xcd9d('0xd')],'message_type':_0x3a66af[_0xcd9d('0x2d')]};if(_0x3a66af[_0xcd9d('0x2d')]&&_0x3a66af[_0xcd9d('0x2d')]!=='SI'){_0x124da9[_0xcd9d('0x2e')]=_0x3a66af['phone'];}var _0x47f894={'url':_0x2b07a4+_0xcd9d('0x2f')+_0x3a66af[_0xcd9d('0x30')]+'&password='+_0x3a66af[_0xcd9d('0x2c')],'method':_0xcd9d('0x31')};rp(_0x47f894)[_0xcd9d('0x16')](function(_0x4f1752){var _0x154dd8=_0x4f1752[_0xcd9d('0x32')](';');var _0x343835={'user_key':_0x154dd8[0x0],'session_key':_0x154dd8[0x1]};_0x47f894={'url':_0x2b07a4+_0xcd9d('0x33'),'method':'POST','headers':{'user_key':_0x343835['user_key'],'Session_key':_0x343835[_0xcd9d('0x34')]},'json':!![],'body':_0x124da9};return rp(_0x47f894);})['then'](function(_0x5a0c5f){if(_0x5a0c5f[_0xcd9d('0x35')]>=0x1){var _0x155a7e={'messageId':_0x5a0c5f[_0xcd9d('0x36')]};if(_0x3a66af[_0xcd9d('0x2d')]!=='GP'||!_0x3a66af['deliveryReport']){_0x155a7e['read']=!![];}return _0x32dce7[_0xcd9d('0x26')](_0x155a7e);}else{return logger[_0xcd9d('0x19')](_0xcd9d('0x28'),'afterCreate',_0xcd9d('0x2b'),util[_0xcd9d('0x2a')](_0x5a0c5f,{'showHidden':![],'depth':null}));}})[_0xcd9d('0x18')](function(_0x1cac92){return logger[_0xcd9d('0x19')](_0xcd9d('0x28'),_0xcd9d('0x29'),_0xcd9d('0x2b'),util[_0xcd9d('0x2a')](_0x1cac92,{'showHidden':![],'depth':null}));});}else{logger[_0xcd9d('0x19')](_0xcd9d('0x28'),_0xcd9d('0x29'),'skebby',_0xcd9d('0x37'));}break;case _0xcd9d('0x38'):if(_0x3a66af['authToken']){var _0x17bfe9={'recipient':_0x257586[_0xcd9d('0x23')],'message':_0x257586['body'],'sender':_0x3a66af['senderString']||_0x3a66af[_0xcd9d('0x23')],'authorization':_0x3a66af[_0xcd9d('0x20')]};var _0x112c01={'method':_0xcd9d('0x39'),'uri':'https://smsapi.connectel.se/api/v2/send/','body':_0x17bfe9,'json':!![]};rp(_0x112c01)[_0xcd9d('0x16')](function(_0x663d1e){var _0x532174={'messageId':_0x663d1e[_0xcd9d('0x3a')]};if(!_0x3a66af[_0xcd9d('0x3b')]){_0x532174[_0xcd9d('0x3c')]=!![];}return _0x32dce7[_0xcd9d('0x26')](_0x532174);})['catch'](function(_0x4f06e6){logger[_0xcd9d('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xcd9d('0x29'),_0xcd9d('0x38'),util[_0xcd9d('0x2a')](_0x4f06e6,{'showHidden':![],'depth':null}));});}else{logger['error'](_0xcd9d('0x28'),_0xcd9d('0x29'),_0xcd9d('0x38'),_0xcd9d('0x3d'));}break;case _0xcd9d('0x3e'):if(_0x3a66af[_0xcd9d('0x30')]&&_0x3a66af[_0xcd9d('0x2c')]){var _0x17bfe9={'messages':[{'source':_0xcd9d('0x3f'),'to':_0x257586[_0xcd9d('0x23')],'body':_0x257586[_0xcd9d('0xd')],'from':_0x3a66af['senderString']||_0x3a66af['phone']}]};var _0x1aabf5=util[_0xcd9d('0x40')](_0xcd9d('0x41'),_0x3a66af[_0xcd9d('0x30')],_0x3a66af['password']);var _0x112c01={'method':_0xcd9d('0x39'),'uri':'https://rest.clicksend.com/v3/sms/send','body':_0x17bfe9,'headers':{'Authorization':util[_0xcd9d('0x40')]('Basic\x20%s',new Buffer(_0x1aabf5)[_0xcd9d('0x42')](_0xcd9d('0x43')))},'json':!![]};rp(_0x112c01)['then'](function(_0x5224c1){if(_0x5224c1[_0xcd9d('0x44')]>=0xc8&&_0x5224c1[_0xcd9d('0x44')]<=0xce){if(_0x5224c1[_0xcd9d('0x45')]&&_0x5224c1[_0xcd9d('0x45')][_0xcd9d('0x46')]>0x0){var _0x1081cd=_['head'](_0x5224c1['data']['messages']);var _0x1ddc10={'messageId':_0x1081cd[_0xcd9d('0x47')]};if(!_0x3a66af['deliveryReport']){_0x1ddc10[_0xcd9d('0x3c')]=!![];}return _0x32dce7[_0xcd9d('0x26')](_0x1ddc10);}else{logger[_0xcd9d('0x19')](_0xcd9d('0x28'),_0xcd9d('0x29'),_0xcd9d('0x48'),util[_0xcd9d('0x2a')](_0x5224c1,{'showHidden':![],'depth':null}));}}else{logger[_0xcd9d('0x19')](_0xcd9d('0x28'),_0xcd9d('0x29'),'clickSend',util[_0xcd9d('0x2a')](_0x5224c1,{'showHidden':![],'depth':null}));}})[_0xcd9d('0x18')](function(_0x1f3de0){logger[_0xcd9d('0x19')](_0xcd9d('0x28'),_0xcd9d('0x29'),_0xcd9d('0x48'),util[_0xcd9d('0x2a')](_0x1f3de0,{'showHidden':![],'depth':null}));});}else{logger['error'](_0xcd9d('0x28'),_0xcd9d('0x29'),_0xcd9d('0x48'),'Missing\x20parameters:\x20username,\x20password');}break;case _0xcd9d('0x49'):if(_0x3a66af[_0xcd9d('0x4a')]&&_0x3a66af[_0xcd9d('0x20')]){var _0x17bfe9={'dst':_0x257586[_0xcd9d('0x23')],'text':_0x257586[_0xcd9d('0xd')],'src':_0x3a66af[_0xcd9d('0x4b')]||_0x3a66af[_0xcd9d('0x23')],'url':_0x3a66af['remote']+_0xcd9d('0x4c')+_0x257586['id']+_0xcd9d('0x24')+_0x3a66af[_0xcd9d('0x25')]};var _0x1aabf5=util['format'](_0xcd9d('0x41'),_0x3a66af[_0xcd9d('0x4a')],_0x3a66af[_0xcd9d('0x20')]);var _0x112c01={'method':'POST','uri':util[_0xcd9d('0x40')](_0xcd9d('0x4d'),_0x3a66af[_0xcd9d('0x4a')]),'body':_0x17bfe9,'headers':{'Authorization':util[_0xcd9d('0x40')](_0xcd9d('0x4e'),new Buffer(_0x1aabf5)['toString'](_0xcd9d('0x43')))},'json':!![]};rp(_0x112c01)[_0xcd9d('0x16')](function(_0x59fe77){var _0x2c2782={'messageId':_0x59fe77[_0xcd9d('0x4f')][0x0]};return _0x32dce7['update'](_0x2c2782);})[_0xcd9d('0x18')](function(_0x1085f5){logger[_0xcd9d('0x19')](_0xcd9d('0x28'),_0xcd9d('0x29'),_0xcd9d('0x49'),util['inspect'](_0x1085f5,{'showHidden':![],'depth':null}));});}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0xcd9d('0x29'),_0xcd9d('0x49'),_0xcd9d('0x50'));}break;case'infobip':if(_0x3a66af[_0xcd9d('0x30')]&&_0x3a66af[_0xcd9d('0x2c')]){if(_0x3a66af['baseUrl']){var _0x311c2b={'method':_0xcd9d('0x39'),'uri':_0x3a66af[_0xcd9d('0x51')]+'/auth/1/session','body':{'username':_0x3a66af[_0xcd9d('0x30')],'password':_0x3a66af[_0xcd9d('0x2c')]},'json':!![]};return rp(_0x311c2b)['then'](function(_0x167135){var _0x5af756={'method':_0xcd9d('0x39'),'uri':_0x3a66af[_0xcd9d('0x51')]+_0xcd9d('0x52'),'body':{'messages':[{'from':_0x3a66af['phone'],'destinations':[{'to':_0x257586[_0xcd9d('0x23')]}],'text':_0x257586[_0xcd9d('0xd')],'notifyUrl':_0x3a66af[_0xcd9d('0x53')]+_0xcd9d('0x4c')+_0x257586['id']+_0xcd9d('0x24')+_0x3a66af[_0xcd9d('0x25')],'notifyContentType':_0xcd9d('0x54'),'callbackData':_0x3a66af[_0xcd9d('0x23')]+';'+_0x257586[_0xcd9d('0xd')]}]},'headers':{'Authorization':'IBSSO\x20'+_0x167135[_0xcd9d('0x25')]},'json':!![]};return rp(_0x5af756)[_0xcd9d('0x16')](function(_0x303584){if(_0x303584['messages']){var _0x1be86e={'messageId':_0x303584[_0xcd9d('0x21')][0x0][_0xcd9d('0xc')]};if(!_0x3a66af[_0xcd9d('0x3b')]){_0x1be86e[_0xcd9d('0x3c')]=!![];}return _0x32dce7[_0xcd9d('0x26')](_0x1be86e);}else{return logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0xcd9d('0x29'),_0xcd9d('0x55'),util[_0xcd9d('0x2a')](_0x303584,{'showHidden':![],'depth':null}));}});})[_0xcd9d('0x18')](function(_0x2025ca){return logger['error'](_0xcd9d('0x28'),'afterCreate',_0xcd9d('0x55'),util['inspect'](_0x2025ca,{'showHidden':![],'depth':null}));});}else{logger[_0xcd9d('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xcd9d('0x29'),_0xcd9d('0x55'),'Missing\x20parameters:\x20base_url');}}else{logger[_0xcd9d('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xcd9d('0x29'),_0xcd9d('0x55'),'Missing\x20parameters:\x20username,\x20password');}break;case _0xcd9d('0x56'):var _0x2ad975=require(_0xcd9d('0x57'));if(_0x3a66af['apiKey']){var _0x1301ed={};_0x1301ed['login']=_0x3a66af['username'];_0x1301ed[_0xcd9d('0x23')]=_0x257586[_0xcd9d('0x23')];_0x1301ed[_0xcd9d('0x2e')]=_0x3a66af['phone'];_0x1301ed[_0xcd9d('0x58')]=_0x257586[_0xcd9d('0xd')];_0x1301ed[_0xcd9d('0x59')]=+new Date();var _0x26cad2='';var _0x2ff261='';var _0x2d9cb3=Object['keys'](_0x1301ed);_0x2d9cb3[_0xcd9d('0x5a')]();for(var _0x1299c0=0x0;_0x1299c0<_0x2d9cb3['length'];_0x1299c0++){if(_0x26cad2!=''){_0x26cad2+='&';}_0x26cad2+=_0x2d9cb3[_0x1299c0]+'='+encodeURIComponent(_0x1301ed[_0x2d9cb3[_0x1299c0]]);_0x2ff261+=_0x1301ed[_0x2d9cb3[_0x1299c0]];}_0x2ff261+=_0x3a66af[_0xcd9d('0x5b')];_0x2ff261=_0x2ad975['createHash'](_0xcd9d('0x5c'))[_0xcd9d('0x26')](_0x2ff261)[_0xcd9d('0x5d')](_0xcd9d('0x5e'));if(_0x26cad2!==''){_0x26cad2+='&';}_0x26cad2+=_0xcd9d('0x5f')+_0x2ff261;var _0x47f894={'method':_0xcd9d('0x31'),'uri':_0x3a66af[_0xcd9d('0x51')]+_0xcd9d('0x60')+_0x26cad2,'json':!![]};return rp(_0x47f894)['then'](function(_0x25f758){var _0x52b1dc=Object[_0xcd9d('0x61')](_0x25f758);if(_0x25f758[_0x52b1dc[0x0]][_0xcd9d('0x19')]&&parseInt(_0x25f758[_0x52b1dc[0x0]][_0xcd9d('0x19')])===0x0){var _0x2f3c93={'messageId':_0x25f758[_0x52b1dc[0x0]][_0xcd9d('0x62')]};if(!_0x3a66af['deliveryReport']){_0x2f3c93[_0xcd9d('0x3c')]=!![];}return _0x32dce7[_0xcd9d('0x26')](_0x2f3c93);}else{return logger[_0xcd9d('0x19')](_0xcd9d('0x28'),_0xcd9d('0x29'),'csc',util['inspect'](_0x25f758[_0xcd9d('0x19')],{'showHidden':![],'depth':null}));}})['catch'](function(_0x24f307){return logger[_0xcd9d('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xcd9d('0x29'),_0xcd9d('0x56'),util[_0xcd9d('0x2a')](_0x24f307,{'showHidden':![],'depth':null}));});}else{logger[_0xcd9d('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xcd9d('0x29'),'csc','Missing\x20parameters:\x20apiKey');}break;case'clickatell':if(_0x3a66af[_0xcd9d('0x5b')]){var _0x526139={'method':_0xcd9d('0x39'),'uri':_0xcd9d('0x63'),'headers':{'Authorization':_0x3a66af[_0xcd9d('0x5b')]},'body':{'content':_0x257586[_0xcd9d('0xd')],'to':[_0x257586[_0xcd9d('0x23')]],'from':_0x3a66af[_0xcd9d('0x23')],'binary':![],'clientMessageId':'uuid','charset':_0xcd9d('0x64')},'json':!![]};rp(_0x526139)[_0xcd9d('0x16')](function(_0x1eb686){if(!_0x1eb686['error']){var _0x1e8e2a={'messageId':_0x1eb686[_0xcd9d('0x21')][0x0][_0xcd9d('0x65')]};if(!_0x3a66af['deliveryReport']){_0x1e8e2a[_0xcd9d('0x3c')]=!![];}return _0x32dce7['update'](_0x1e8e2a);}else{return logger[_0xcd9d('0x19')](_0xcd9d('0x28'),_0xcd9d('0x29'),_0xcd9d('0x66'),util[_0xcd9d('0x2a')](_0x1eb686[_0xcd9d('0x19')],{'showHidden':![],'depth':null}));}})[_0xcd9d('0x18')](function(_0xa9face){return logger[_0xcd9d('0x19')](_0xcd9d('0x28'),'afterCreate','clickatell',util[_0xcd9d('0x2a')](_0xa9face,{'showHidden':![],'depth':null}));});}else{logger[_0xcd9d('0x19')](_0xcd9d('0x28'),_0xcd9d('0x29'),'clickatell','Missing\x20parameters:\x20apiKey');}break;case'bandwidth':if(_0x3a66af[_0xcd9d('0x30')]&&_0x3a66af['password']){var _0x1aabf5=util[_0xcd9d('0x40')](_0xcd9d('0x41'),_0x3a66af[_0xcd9d('0x30')],_0x3a66af[_0xcd9d('0x2c')]);var _0x112c01={'method':_0xcd9d('0x39'),'uri':_0xcd9d('0x67')+_0x3a66af[_0xcd9d('0x68')]+_0xcd9d('0x69'),'body':{'to':[_0x257586['phone']],'text':_0x257586[_0xcd9d('0xd')],'from':_0x3a66af[_0xcd9d('0x23')],'applicationId':_0x3a66af[_0xcd9d('0x6a')]},'headers':{'Authorization':util[_0xcd9d('0x40')](_0xcd9d('0x4e'),new Buffer(_0x1aabf5)[_0xcd9d('0x42')](_0xcd9d('0x43')))},'json':!![]};rp(_0x112c01)[_0xcd9d('0x16')](function(_0x13d9e7){if(_0x13d9e7['id']){var _0x1588d3={'messageId':_0x13d9e7['id']};return _0x32dce7[_0xcd9d('0x26')](_0x1588d3);}else{logger['error'](_0xcd9d('0x28'),_0xcd9d('0x29'),_0xcd9d('0x6b'),util[_0xcd9d('0x2a')](_0x13d9e7,{'showHidden':![],'depth':null}));}})[_0xcd9d('0x18')](function(_0x2def56){logger['error'](_0xcd9d('0x28'),_0xcd9d('0x29'),_0xcd9d('0x6b'),util['inspect'](_0x2def56,{'showHidden':![],'depth':null}));});}else{logger[_0xcd9d('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0xcd9d('0x6b'),'Missing\x20parameters:\x20username,\x20password');}break;case _0xcd9d('0x6c'):if(_0x3a66af[_0xcd9d('0x5b')]){var _0x15507f={};var _0x47f894={'method':_0xcd9d('0x39'),'uri':_0xcd9d('0x6d'),'headers':{'Authorization':'Bearer\x20'+_0x3a66af[_0xcd9d('0x5b')],'Content-Type':'application/json'},'body':{'from':_0x3a66af[_0xcd9d('0x23')],'to':_0x257586[_0xcd9d('0x23')],'text':_0x257586['body']},'json':!![]};return rp(_0x47f894)[_0xcd9d('0x16')](function(_0x3adb55){if(_0x3adb55['code']==0xca){_0x15507f[_0xcd9d('0x6e')]=_0x3adb55;var _0x20ffe1={'method':_0xcd9d('0x39'),'uri':'https://api.intelepeer.com/_rest/v4/app/sms/mdr','headers':{'Authorization':_0xcd9d('0x6f')+_0x3a66af[_0xcd9d('0x5b')],'Content-Type':'application/json'},'body':{'refid':_0x15507f['message'][_0xcd9d('0x70')]},'json':!![]};return rp(_0x20ffe1)[_0xcd9d('0x16')](function(_0x53e331){_0x15507f[_0xcd9d('0x71')]=_0x53e331;var _0x308c79={'messageId':_0x15507f[_0xcd9d('0x6e')][_0xcd9d('0x70')],'read':!![]};return _0x32dce7[_0xcd9d('0x26')](_0x308c79);});}else{return logger[_0xcd9d('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xcd9d('0x29'),_0xcd9d('0x6c'),util[_0xcd9d('0x2a')](_0x3adb55,{'showHidden':![],'depth':null}));}})[_0xcd9d('0x18')](function(_0xf7e367){return logger[_0xcd9d('0x19')](_0xcd9d('0x28'),_0xcd9d('0x29'),'intelepeer',util[_0xcd9d('0x2a')](_0xf7e367,{'showHidden':![],'depth':null}));});}else{return logger[_0xcd9d('0x19')](_0xcd9d('0x28'),_0xcd9d('0x29'),_0xcd9d('0x6c'),_0xcd9d('0x72'));}break;}}})[_0xcd9d('0x73')](function(){_0x18f6a7();});}else{_0x18f6a7();}}},'charset':'utf8mb4','collate':_0xcd9d('0x74')});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.rpc.js b/server/api/smsMessage/smsMessage.rpc.js index 7c9bbb6..f17e847 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 _0x219c=['info','SmsMessage,\x20%s,\x20%s','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateSmsMessage','SmsMessage','create','body','options','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./smsMessage.socket','register','request','then'];(function(_0x179b53,_0x31f6fe){var _0x38a146=function(_0x33f0c2){while(--_0x33f0c2){_0x179b53['push'](_0x179b53['shift']());}};_0x38a146(++_0x31f6fe);}(_0x219c,0x19c));var _0xc219=function(_0x269dc1,_0x173ec4){_0x269dc1=_0x269dc1-0x0;var _0x1d2636=_0x219c[_0x269dc1];return _0x1d2636;};'use strict';var _=require(_0xc219('0x0'));var util=require(_0xc219('0x1'));var moment=require(_0xc219('0x2'));var BPromise=require(_0xc219('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc219('0x4'));var db=require(_0xc219('0x5'))['db'];var utils=require(_0xc219('0x6'));var logger=require(_0xc219('0x7'))(_0xc219('0x8'));var config=require(_0xc219('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xc219('0xa')][_0xc219('0xb')]({'port':0x232a});config[_0xc219('0xc')]=_[_0xc219('0xd')](config[_0xc219('0xc')],{'host':_0xc219('0xe'),'port':0x18eb});var socket=require(_0xc219('0xf'))(new Redis(config['redis']));require(_0xc219('0x10'))[_0xc219('0x11')](socket);function respondWithRpcPromise(_0x29a9b8,_0x31b528,_0x32ddcb){return new BPromise(function(_0x57de96,_0x4262b9){return client[_0xc219('0x12')](_0x29a9b8,_0x32ddcb)[_0xc219('0x13')](function(_0x196e89){logger[_0xc219('0x14')](_0xc219('0x15'),_0x31b528,_0xc219('0x16'));logger[_0xc219('0x17')](_0xc219('0x18'),_0x31b528,'request\x20sent',JSON[_0xc219('0x19')](_0x196e89));if(_0x196e89[_0xc219('0x1a')]){if(_0x196e89['error'][_0xc219('0x1b')]===0x1f4){logger[_0xc219('0x1a')]('SmsMessage,\x20%s,\x20%s',_0x31b528,_0x196e89[_0xc219('0x1a')][_0xc219('0x1c')]);return _0x4262b9(_0x196e89[_0xc219('0x1a')][_0xc219('0x1c')]);}logger[_0xc219('0x1a')](_0xc219('0x15'),_0x31b528,_0x196e89[_0xc219('0x1a')][_0xc219('0x1c')]);return _0x57de96(_0x196e89[_0xc219('0x1a')][_0xc219('0x1c')]);}else{logger['info'](_0xc219('0x15'),_0x31b528,'request\x20sent');_0x57de96(_0x196e89[_0xc219('0x1d')][_0xc219('0x1c')]);}})[_0xc219('0x1e')](function(_0xc42db3){logger[_0xc219('0x1a')]('SmsMessage,\x20%s,\x20%s',_0x31b528,_0xc42db3);_0x4262b9(_0xc42db3);});});}exports[_0xc219('0x1f')]=function(_0x3562f5){var _0x18dba7=this;return new Promise(function(_0x39c6dd,_0x1d33fd){return db[_0xc219('0x20')][_0xc219('0x21')](_0x3562f5[_0xc219('0x22')],{'raw':_0x3562f5[_0xc219('0x23')]?_0x3562f5[_0xc219('0x23')]['raw']===undefined?!![]:![]:!![]})[_0xc219('0x13')](function(_0x4ff9d2){logger[_0xc219('0x14')](_0xc219('0x1f'),_0x3562f5);logger[_0xc219('0x17')]('CreateSmsMessage',_0x3562f5,JSON['stringify'](_0x4ff9d2));_0x39c6dd(_0x4ff9d2);})[_0xc219('0x1e')](function(_0x150523){logger[_0xc219('0x1a')](_0xc219('0x1f'),_0x150523[_0xc219('0x1c')],_0x3562f5);_0x1d33fd(_0x18dba7['error'](0x1f4,_0x150523['message']));});});}; \ No newline at end of file +var _0x5725=['moment','bluebird','randomstring','ioredis','../../config/logger','../../config/environment','jayson/promise','http','redis','socket.io-emitter','request','then','info','SmsMessage,\x20%s,\x20%s','debug','SmsMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','SmsMessage','create','body','options','raw','CreateSmsMessage','stringify','lodash','util'];(function(_0x49bf26,_0x4eb02){var _0x508421=function(_0x8e8908){while(--_0x8e8908){_0x49bf26['push'](_0x49bf26['shift']());}};_0x508421(++_0x4eb02);}(_0x5725,0x148));var _0x5572=function(_0x2be8c2,_0x14a4b5){_0x2be8c2=_0x2be8c2-0x0;var _0x97f531=_0x5725[_0x2be8c2];return _0x97f531;};'use strict';var _=require(_0x5572('0x0'));var util=require(_0x5572('0x1'));var moment=require(_0x5572('0x2'));var BPromise=require(_0x5572('0x3'));var rs=require(_0x5572('0x4'));var fs=require('fs');var Redis=require(_0x5572('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x5572('0x6'))('rpc');var config=require(_0x5572('0x7'));var jayson=require(_0x5572('0x8'));var client=jayson['client'][_0x5572('0x9')]({'port':0x232a});config[_0x5572('0xa')]=_['defaults'](config[_0x5572('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x5572('0xb'))(new Redis(config[_0x5572('0xa')]));require('./smsMessage.socket')['register'](socket);function respondWithRpcPromise(_0x2e0c45,_0x399cba,_0x21dd72){return new BPromise(function(_0xf900ba,_0x64fc96){return client[_0x5572('0xc')](_0x2e0c45,_0x21dd72)[_0x5572('0xd')](function(_0x4125af){logger[_0x5572('0xe')](_0x5572('0xf'),_0x399cba,'request\x20sent');logger[_0x5572('0x10')](_0x5572('0x11'),_0x399cba,'request\x20sent',JSON['stringify'](_0x4125af));if(_0x4125af[_0x5572('0x12')]){if(_0x4125af['error'][_0x5572('0x13')]===0x1f4){logger[_0x5572('0x12')](_0x5572('0xf'),_0x399cba,_0x4125af[_0x5572('0x12')][_0x5572('0x14')]);return _0x64fc96(_0x4125af['error'][_0x5572('0x14')]);}logger[_0x5572('0x12')]('SmsMessage,\x20%s,\x20%s',_0x399cba,_0x4125af[_0x5572('0x12')][_0x5572('0x14')]);return _0xf900ba(_0x4125af[_0x5572('0x12')]['message']);}else{logger[_0x5572('0xe')]('SmsMessage,\x20%s,\x20%s',_0x399cba,'request\x20sent');_0xf900ba(_0x4125af[_0x5572('0x15')][_0x5572('0x14')]);}})[_0x5572('0x16')](function(_0x1d276b){logger[_0x5572('0x12')](_0x5572('0xf'),_0x399cba,_0x1d276b);_0x64fc96(_0x1d276b);});});}exports['CreateSmsMessage']=function(_0x1b3a59){var _0x4a7ae0=this;return new Promise(function(_0x1d98ea,_0x2797e5){return db[_0x5572('0x17')][_0x5572('0x18')](_0x1b3a59[_0x5572('0x19')],{'raw':_0x1b3a59[_0x5572('0x1a')]?_0x1b3a59[_0x5572('0x1a')][_0x5572('0x1b')]===undefined?!![]:![]:!![]})[_0x5572('0xd')](function(_0x432c27){logger['info']('CreateSmsMessage',_0x1b3a59);logger[_0x5572('0x10')](_0x5572('0x1c'),_0x1b3a59,JSON[_0x5572('0x1d')](_0x432c27));_0x1d98ea(_0x432c27);})[_0x5572('0x16')](function(_0x452b9a){logger[_0x5572('0x12')](_0x5572('0x1c'),_0x452b9a[_0x5572('0x14')],_0x1b3a59);_0x2797e5(_0x4a7ae0[_0x5572('0x12')](0x1f4,_0x452b9a[_0x5572('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.socket.js b/server/api/smsMessage/smsMessage.socket.js index c9e05c8..8e1e57e 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 _0xf4bc=['length','smsMessage:','./smsMessage.events','save','remove','removeListener','register'];(function(_0x30638c,_0x25acdd){var _0x17eef6=function(_0x1a5ce3){while(--_0x1a5ce3){_0x30638c['push'](_0x30638c['shift']());}};_0x17eef6(++_0x25acdd);}(_0xf4bc,0xfe));var _0xcf4b=function(_0x3ce089,_0x1a4890){_0x3ce089=_0x3ce089-0x0;var _0x35b89d=_0xf4bc[_0x3ce089];return _0x35b89d;};'use strict';var SmsMessageEvents=require(_0xcf4b('0x0'));var events=[_0xcf4b('0x1'),_0xcf4b('0x2'),'update'];function createListener(_0x102a81,_0x253ae3){return function(_0x415898){_0x253ae3['emit'](_0x102a81,_0x415898);};}function removeListener(_0x4c506d,_0x18e76d){return function(){SmsMessageEvents[_0xcf4b('0x3')](_0x4c506d,_0x18e76d);};}exports[_0xcf4b('0x4')]=function(_0xf69407){for(var _0x48ac64=0x0,_0x11a2c5=events[_0xcf4b('0x5')];_0x48ac64<_0x11a2c5;_0x48ac64++){var _0x328af9=events[_0x48ac64];var _0x50711f=createListener(_0xcf4b('0x6')+_0x328af9,_0xf69407);SmsMessageEvents['on'](_0x328af9,_0x50711f);}}; \ No newline at end of file +var _0x0d66=['emit','removeListener','register','smsMessage:','update'];(function(_0x1cec84,_0x101ec2){var _0x12b7d3=function(_0x9679d8){while(--_0x9679d8){_0x1cec84['push'](_0x1cec84['shift']());}};_0x12b7d3(++_0x101ec2);}(_0x0d66,0x180));var _0x60d6=function(_0x13f980,_0x1e1c56){_0x13f980=_0x13f980-0x0;var _0x27153c=_0x0d66[_0x13f980];return _0x27153c;};'use strict';var SmsMessageEvents=require('./smsMessage.events');var events=['save','remove',_0x60d6('0x0')];function createListener(_0x5c3d3c,_0xe0eee1){return function(_0x4228d8){_0xe0eee1[_0x60d6('0x1')](_0x5c3d3c,_0x4228d8);};}function removeListener(_0x5203d5,_0x60afa0){return function(){SmsMessageEvents[_0x60d6('0x2')](_0x5203d5,_0x60afa0);};}exports[_0x60d6('0x3')]=function(_0x2bb805){for(var _0x3fe9fb=0x0,_0x22f604=events['length'];_0x3fe9fb<_0x22f604;_0x3fe9fb++){var _0x3ce51e=events[_0x3fe9fb];var _0x5d1001=createListener(_0x60d6('0x4')+_0x3ce51e,_0x2bb805);SmsMessageEvents['on'](_0x3ce51e,_0x5d1001);}}; \ No newline at end of file diff --git a/server/api/smsQueue/index.js b/server/api/smsQueue/index.js index 3a38d34..548d490 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 _0x8e20=['create','/:id/teams','addTeams','addAgents','put','update','delete','destroy','removeTeams','removeAgents','multer','path','connect-timeout','express','fs-extra','../../components/interaction/service','./smsQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','show','getMembers','getTeams','/:id/users','getAgents','post'];(function(_0x2a24cb,_0x5cd973){var _0x3d0110=function(_0xd119c0){while(--_0xd119c0){_0x2a24cb['push'](_0x2a24cb['shift']());}};_0x3d0110(++_0x5cd973);}(_0x8e20,0xd5));var _0x08e2=function(_0x3a7634,_0x2db384){_0x3a7634=_0x3a7634-0x0;var _0x23bbe9=_0x8e20[_0x3a7634];return _0x23bbe9;};'use strict';var multer=require(_0x08e2('0x0'));var util=require('util');var path=require(_0x08e2('0x1'));var timeout=require(_0x08e2('0x2'));var express=require(_0x08e2('0x3'));var router=express['Router']();var fs_extra=require(_0x08e2('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x08e2('0x5'));var config=require('../../config/environment');var controller=require(_0x08e2('0x6'));router[_0x08e2('0x7')]('/',auth[_0x08e2('0x8')](),controller[_0x08e2('0x9')]);router[_0x08e2('0x7')](_0x08e2('0xa'),auth[_0x08e2('0x8')](),controller[_0x08e2('0xb')]);router[_0x08e2('0x7')](_0x08e2('0xc'),auth[_0x08e2('0x8')](),controller[_0x08e2('0xd')]);router[_0x08e2('0x7')]('/:id/members',auth[_0x08e2('0x8')](),controller[_0x08e2('0xe')]);router['get']('/:id/teams',auth[_0x08e2('0x8')](),controller[_0x08e2('0xf')]);router['get'](_0x08e2('0x10'),auth['isAuthenticated'](),controller[_0x08e2('0x11')]);router[_0x08e2('0x12')]('/',auth[_0x08e2('0x8')](),controller[_0x08e2('0x13')]);router[_0x08e2('0x12')](_0x08e2('0x14'),auth[_0x08e2('0x8')](),controller[_0x08e2('0x15')]);router['post'](_0x08e2('0x10'),auth[_0x08e2('0x8')](),controller[_0x08e2('0x16')]);router[_0x08e2('0x17')]('/:id',auth['isAuthenticated'](),controller[_0x08e2('0x18')]);router[_0x08e2('0x19')](_0x08e2('0xc'),auth[_0x08e2('0x8')](),controller[_0x08e2('0x1a')]);router['delete'](_0x08e2('0x14'),auth[_0x08e2('0x8')](),controller[_0x08e2('0x1b')]);router[_0x08e2('0x19')]('/:id/users',auth[_0x08e2('0x8')](),controller[_0x08e2('0x1c')]);module['exports']=router; \ No newline at end of file +var _0xbc16=['delete','/:id/teams','removeAgents','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/members','getTeams','getAgents','post','addTeams','/:id/users','addAgents','put','update'];(function(_0xc0a3d3,_0x2c8d00){var _0x3386e8=function(_0x3f9df4){while(--_0x3f9df4){_0xc0a3d3['push'](_0xc0a3d3['shift']());}};_0x3386e8(++_0x2c8d00);}(_0xbc16,0x1a8));var _0x6bc1=function(_0x160c34,_0x54f26b){_0x160c34=_0x160c34-0x0;var _0x3bfa50=_0xbc16[_0x160c34];return _0x3bfa50;};'use strict';var multer=require(_0x6bc1('0x0'));var util=require(_0x6bc1('0x1'));var path=require(_0x6bc1('0x2'));var timeout=require(_0x6bc1('0x3'));var express=require(_0x6bc1('0x4'));var router=express[_0x6bc1('0x5')]();var fs_extra=require(_0x6bc1('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x6bc1('0x7'));var controller=require('./smsQueue.controller');router[_0x6bc1('0x8')]('/',auth[_0x6bc1('0x9')](),controller[_0x6bc1('0xa')]);router['get'](_0x6bc1('0xb'),auth[_0x6bc1('0x9')](),controller[_0x6bc1('0xc')]);router['get'](_0x6bc1('0xd'),auth[_0x6bc1('0x9')](),controller[_0x6bc1('0xe')]);router[_0x6bc1('0x8')](_0x6bc1('0xf'),auth[_0x6bc1('0x9')](),controller['getMembers']);router['get']('/:id/teams',auth[_0x6bc1('0x9')](),controller[_0x6bc1('0x10')]);router[_0x6bc1('0x8')]('/:id/users',auth[_0x6bc1('0x9')](),controller[_0x6bc1('0x11')]);router['post']('/',auth[_0x6bc1('0x9')](),controller['create']);router[_0x6bc1('0x12')]('/:id/teams',auth[_0x6bc1('0x9')](),controller[_0x6bc1('0x13')]);router[_0x6bc1('0x12')](_0x6bc1('0x14'),auth['isAuthenticated'](),controller[_0x6bc1('0x15')]);router[_0x6bc1('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x6bc1('0x17')]);router[_0x6bc1('0x18')]('/:id',auth['isAuthenticated'](),controller['destroy']);router[_0x6bc1('0x18')](_0x6bc1('0x19'),auth[_0x6bc1('0x9')](),controller['removeTeams']);router[_0x6bc1('0x18')](_0x6bc1('0x14'),auth[_0x6bc1('0x9')](),controller[_0x6bc1('0x1a')]);module[_0x6bc1('0x1b')]=router; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.attributes.js b/server/api/smsQueue/smsQueue.attributes.js index ef6f9d6..a0a1c25 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 _0x3427=['exports','STRING','INTEGER','ENUM','rrmemory','beepall','roundrobin','sequelize'];(function(_0x31c297,_0x31a804){var _0x3ac758=function(_0x45f239){while(--_0x45f239){_0x31c297['push'](_0x31c297['shift']());}};_0x3ac758(++_0x31a804);}(_0x3427,0x13f));var _0x7342=function(_0xece53a,_0x4bc5d9){_0xece53a=_0xece53a-0x0;var _0x63b71d=_0x3427[_0xece53a];return _0x63b71d;};'use strict';var Sequelize=require(_0x7342('0x0'));module[_0x7342('0x1')]={'name':{'type':Sequelize[_0x7342('0x2')],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x7342('0x2')]},'timeout':{'type':Sequelize[_0x7342('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x7342('0x4')](_0x7342('0x5'),_0x7342('0x6'),_0x7342('0x7'))}}; \ No newline at end of file +var _0x9da2=['name','INTEGER','ENUM','sequelize','exports','STRING'];(function(_0x559403,_0x5f3054){var _0x54a8d9=function(_0x47bd82){while(--_0x47bd82){_0x559403['push'](_0x559403['shift']());}};_0x54a8d9(++_0x5f3054);}(_0x9da2,0x17d));var _0x29da=function(_0x17cc31,_0x33c0a5){_0x17cc31=_0x17cc31-0x0;var _0x273211=_0x9da2[_0x17cc31];return _0x273211;};'use strict';var Sequelize=require(_0x29da('0x0'));module[_0x29da('0x1')]={'name':{'type':Sequelize[_0x29da('0x2')],'unique':_0x29da('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x29da('0x2')]},'timeout':{'type':Sequelize[_0x29da('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x29da('0x5')]('rrmemory','beepall','roundrobin')}}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.controller.js b/server/api/smsQueue/smsQueue.controller.js index c02f08e..50a2f55 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 _0x27eb=['all','union','compact','value','isEmpty','userSmsQueue:remove','addAgents','removeAgents','getAgents','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','sox','ejs','fs-extra','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./smsQueue.socket','sendStatus','status','end','offset','undefined','count','limit','Content-Range','json','reject','save','then','destroy','get','SmsQueues','name','index','map','SmsQueue','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','filter','where','VIRTUAL','merge','options','include','findAll','rows','catch','show','body','user','UserProfileSection','find','autoAssociation','create','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','describe','findOne','UserSmsQueue','order','SmsQueueId','User','findAndCountAll','UserId','agent','smsPause','updatedAt','createdAt','format','%s/%s','SIP','getTeams','addTeams','ids','Team','Agents','online','voicePause','interface','sequelize','transaction','each','findOrCreate','forEach','emit','userSmsQueue:save','removeTeams','select','field','tq.TeamId','from','team_has_sms_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','SmsQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','TeamId','includes'];(function(_0x2b2de5,_0x338319){var _0x1304dd=function(_0x31f38){while(--_0x31f38){_0x2b2de5['push'](_0x2b2de5['shift']());}};_0x1304dd(++_0x338319);}(_0x27eb,0x96));var _0xb27e=function(_0x4ed8d0,_0x3958df){_0x4ed8d0=_0x4ed8d0-0x0;var _0x52514e=_0x27eb[_0x4ed8d0];return _0x52514e;};'use strict';var emlformat=require(_0xb27e('0x0'));var rimraf=require(_0xb27e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb27e('0x2'));var rp=require(_0xb27e('0x3'));var moment=require('moment');var BPromise=require(_0xb27e('0x4'));var Mustache=require(_0xb27e('0x5'));var util=require(_0xb27e('0x6'));var path=require('path');var sox=require(_0xb27e('0x7'));var csv=require('to-csv');var ejs=require(_0xb27e('0x8'));var fs=require('fs');var fs_extra=require(_0xb27e('0x9'));var _=require(_0xb27e('0xa'));var squel=require('squel');var crypto=require(_0xb27e('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xb27e('0xc'));var toCsv=require('to-csv');var querystring=require(_0xb27e('0xd'));var Papa=require(_0xb27e('0xe'));var Redis=require(_0xb27e('0xf'));var authService=require(_0xb27e('0x10'));var qs=require(_0xb27e('0x11'));var as=require(_0xb27e('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb27e('0x13'))(_0xb27e('0x14'));var utils=require('../../config/utils');var config=require(_0xb27e('0x15'));var licenseUtil=require(_0xb27e('0x16'));var db=require(_0xb27e('0x17'))['db'];config[_0xb27e('0x18')]=_[_0xb27e('0x19')](config[_0xb27e('0x18')],{'host':_0xb27e('0x1a'),'port':0x18eb});var socket=require(_0xb27e('0x1b'))(new Redis(config['redis']));require(_0xb27e('0x1c'))['register'](socket);function respondWithStatusCode(_0x3123e3,_0x2ab928){_0x2ab928=_0x2ab928||0xcc;return function(_0x53cf0d){if(_0x53cf0d){return _0x3123e3[_0xb27e('0x1d')](_0x2ab928);}return _0x3123e3[_0xb27e('0x1e')](_0x2ab928)[_0xb27e('0x1f')]();};}function respondWithResult(_0x59d0f8,_0x2fdec8){_0x2fdec8=_0x2fdec8||0xc8;return function(_0x54237f){if(_0x54237f){return _0x59d0f8['status'](_0x2fdec8)['json'](_0x54237f);}};}function respondWithFilteredResult(_0x107310,_0x5a9fde){return function(_0x4cbd4c){if(_0x4cbd4c){var _0x449338=typeof _0x5a9fde[_0xb27e('0x20')]===_0xb27e('0x21')&&typeof _0x5a9fde['limit']===_0xb27e('0x21');var _0x26efe9=_0x4cbd4c['count'];var _0x5a7289=_0x449338?0x0:_0x5a9fde[_0xb27e('0x20')];var _0x3cc065=_0x449338?_0x4cbd4c[_0xb27e('0x22')]:_0x5a9fde[_0xb27e('0x20')]+_0x5a9fde[_0xb27e('0x23')];var _0x3b4c5f;if(_0x3cc065>=_0x26efe9){_0x3cc065=_0x26efe9;_0x3b4c5f=0xc8;}else{_0x3b4c5f=0xce;}_0x107310['status'](_0x3b4c5f);return _0x107310['set'](_0xb27e('0x24'),_0x5a7289+'-'+_0x3cc065+'/'+_0x26efe9)[_0xb27e('0x25')](_0x4cbd4c);}return null;};}function patchUpdates(_0xab7109){return function(_0x3e2bc4){try{jsonpatch['apply'](_0x3e2bc4,_0xab7109,!![]);}catch(_0x4a6c38){return BPromise[_0xb27e('0x26')](_0x4a6c38);}return _0x3e2bc4[_0xb27e('0x27')]();};}function saveUpdates(_0x415804,_0x5e4cb1){return function(_0x4e5b7b){if(_0x4e5b7b){return _0x4e5b7b['update'](_0x415804)[_0xb27e('0x28')](function(_0x2b5585){return _0x2b5585;});}return null;};}function removeEntity(_0x512dc1,_0x5783f9){return function(_0x14b4ca){if(_0x14b4ca){return _0x14b4ca[_0xb27e('0x29')]()[_0xb27e('0x28')](function(){var _0x3e09d9=_0x14b4ca[_0xb27e('0x2a')]({'plain':!![]});var _0x3aba9b=_0xb27e('0x2b');return db['UserProfileResource'][_0xb27e('0x29')]({'where':{'type':_0x3aba9b,'resourceId':_0x3e09d9['id']}})['then'](function(){return _0x14b4ca;});})[_0xb27e('0x28')](function(){_0x512dc1[_0xb27e('0x1e')](0xcc)[_0xb27e('0x1f')]();});}};}function handleEntityNotFound(_0x48df99,_0x4bb9e4){return function(_0x2dfbcb){if(!_0x2dfbcb){_0x48df99[_0xb27e('0x1d')](0x194);}return _0x2dfbcb;};}function handleError(_0x21c749,_0x13a221){_0x13a221=_0x13a221||0x1f4;return function(_0x50ec86){logger['error'](_0x50ec86['stack']);if(_0x50ec86[_0xb27e('0x2c')]){delete _0x50ec86[_0xb27e('0x2c')];}_0x21c749[_0xb27e('0x1e')](_0x13a221)['send'](_0x50ec86);};}exports[_0xb27e('0x2d')]=function(_0x353332,_0x28ae46){var _0x33d479={},_0x4ef4c4={},_0x156a82={'count':0x0,'rows':[]};var _0x250bf2=_[_0xb27e('0x2e')](db[_0xb27e('0x2f')][_0xb27e('0x30')],function(_0x2506b2){return{'name':_0x2506b2['fieldName'],'type':_0x2506b2[_0xb27e('0x31')][_0xb27e('0x32')]};});_0x4ef4c4[_0xb27e('0x33')]=_[_0xb27e('0x2e')](_0x250bf2,'name');_0x4ef4c4[_0xb27e('0x34')]=_[_0xb27e('0x35')](_0x353332[_0xb27e('0x34')]);_0x4ef4c4[_0xb27e('0x36')]=_[_0xb27e('0x37')](_0x4ef4c4[_0xb27e('0x33')],_0x4ef4c4[_0xb27e('0x34')]);_0x33d479[_0xb27e('0x38')]=_[_0xb27e('0x37')](_0x4ef4c4['model'],qs['fields'](_0x353332['query'][_0xb27e('0x39')]));_0x33d479[_0xb27e('0x38')]=_0x33d479[_0xb27e('0x38')][_0xb27e('0x3a')]?_0x33d479[_0xb27e('0x38')]:_0x4ef4c4['model'];if(!_0x353332[_0xb27e('0x34')][_0xb27e('0x3b')](_0xb27e('0x3c'))){_0x33d479['limit']=qs['limit'](_0x353332[_0xb27e('0x34')][_0xb27e('0x23')]);_0x33d479[_0xb27e('0x20')]=qs['offset'](_0x353332['query'][_0xb27e('0x20')]);}_0x33d479['order']=qs['sort'](_0x353332[_0xb27e('0x34')][_0xb27e('0x3d')]);_0x33d479['where']=qs[_0xb27e('0x36')](_[_0xb27e('0x3e')](_0x353332['query'],_0x4ef4c4[_0xb27e('0x36')]),_0x250bf2);if(_0x353332[_0xb27e('0x34')][_0xb27e('0x3f')]){_0x33d479[_0xb27e('0x40')]=_['merge'](_0x33d479[_0xb27e('0x40')],{'$or':_[_0xb27e('0x2e')](_0x250bf2,function(_0x1c9986){if(_0x1c9986[_0xb27e('0x31')]!==_0xb27e('0x41')){var _0x14ea12={};_0x14ea12[_0x1c9986[_0xb27e('0x2c')]]={'$like':'%'+_0x353332['query']['filter']+'%'};return _0x14ea12;}})});}_0x33d479=_[_0xb27e('0x42')]({},_0x33d479,_0x353332[_0xb27e('0x43')]);var _0x51acd5={'where':_0x33d479[_0xb27e('0x40')]};return db[_0xb27e('0x2f')][_0xb27e('0x22')](_0x51acd5)['then'](function(_0x2b8baa){_0x156a82[_0xb27e('0x22')]=_0x2b8baa;if(_0x353332[_0xb27e('0x34')]['includeAll']){_0x33d479[_0xb27e('0x44')]=[{'all':!![]}];}return db[_0xb27e('0x2f')][_0xb27e('0x45')](_0x33d479);})[_0xb27e('0x28')](function(_0xe7a939){_0x156a82[_0xb27e('0x46')]=_0xe7a939;return _0x156a82;})['then'](respondWithFilteredResult(_0x28ae46,_0x33d479))[_0xb27e('0x47')](handleError(_0x28ae46,null));};exports[_0xb27e('0x48')]=function(_0x4ab323,_0x377bb0){var _0x20e9b4={'raw':!![],'where':{'id':_0x4ab323['params']['id']}},_0x474f80={};_0x474f80[_0xb27e('0x33')]=_[_0xb27e('0x35')](db['SmsQueue']['rawAttributes']);_0x474f80[_0xb27e('0x34')]=_[_0xb27e('0x35')](_0x4ab323[_0xb27e('0x34')]);_0x474f80['filters']=_[_0xb27e('0x37')](_0x474f80[_0xb27e('0x33')],_0x474f80['query']);_0x20e9b4[_0xb27e('0x38')]=_[_0xb27e('0x37')](_0x474f80[_0xb27e('0x33')],qs[_0xb27e('0x39')](_0x4ab323[_0xb27e('0x34')][_0xb27e('0x39')]));_0x20e9b4['attributes']=_0x20e9b4[_0xb27e('0x38')][_0xb27e('0x3a')]?_0x20e9b4[_0xb27e('0x38')]:_0x474f80[_0xb27e('0x33')];if(_0x4ab323['query']['includeAll']){_0x20e9b4[_0xb27e('0x44')]=[{'all':!![]}];}_0x20e9b4=_[_0xb27e('0x42')]({},_0x20e9b4,_0x4ab323[_0xb27e('0x43')]);return db['SmsQueue']['find'](_0x20e9b4)[_0xb27e('0x28')](handleEntityNotFound(_0x377bb0,null))[_0xb27e('0x28')](respondWithResult(_0x377bb0,null))[_0xb27e('0x47')](handleError(_0x377bb0,null));};exports['create']=function(_0x387768,_0x53a833){return db[_0xb27e('0x2f')]['create'](_0x387768[_0xb27e('0x49')],{})[_0xb27e('0x28')](function(_0xc8381){var _0x1a9139=_0x387768[_0xb27e('0x4a')][_0xb27e('0x2a')]({'plain':!![]});if(!_0x1a9139)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1a9139['role']===_0xb27e('0x4a')){var _0x4385dd=_0xc8381[_0xb27e('0x2a')]({'plain':!![]});var _0x50f491=_0xb27e('0x2b');return db[_0xb27e('0x4b')][_0xb27e('0x4c')]({'where':{'name':_0x50f491,'userProfileId':_0x1a9139['userProfileId']},'raw':!![]})['then'](function(_0xceeb02){if(_0xceeb02&&_0xceeb02[_0xb27e('0x4d')]===0x0){return db['UserProfileResource'][_0xb27e('0x4e')]({'name':_0x4385dd['name'],'resourceId':_0x4385dd['id'],'type':_0xceeb02[_0xb27e('0x2c')],'sectionId':_0xceeb02['id']},{})[_0xb27e('0x28')](function(){return _0xc8381;});}else{return _0xc8381;}})[_0xb27e('0x47')](function(_0x198902){logger[_0xb27e('0x4f')](_0xb27e('0x50'),_0x198902);throw _0x198902;});}return _0xc8381;})[_0xb27e('0x28')](respondWithResult(_0x53a833,0xc9))[_0xb27e('0x47')](handleError(_0x53a833,null));};exports[_0xb27e('0x51')]=function(_0x31c487,_0x53d2f3){if(_0x31c487['body']['id']){delete _0x31c487[_0xb27e('0x49')]['id'];}return db[_0xb27e('0x2f')][_0xb27e('0x4c')]({'where':{'id':_0x31c487[_0xb27e('0x52')]['id']}})[_0xb27e('0x28')](handleEntityNotFound(_0x53d2f3,null))[_0xb27e('0x28')](saveUpdates(_0x31c487[_0xb27e('0x49')],null))[_0xb27e('0x28')](respondWithResult(_0x53d2f3,null))[_0xb27e('0x47')](handleError(_0x53d2f3,null));};exports['destroy']=function(_0x592815,_0x210192){return db[_0xb27e('0x2f')][_0xb27e('0x4c')]({'where':{'id':_0x592815[_0xb27e('0x52')]['id']}})[_0xb27e('0x28')](handleEntityNotFound(_0x210192,null))['then'](removeEntity(_0x210192,null))[_0xb27e('0x47')](handleError(_0x210192,null));};exports[_0xb27e('0x53')]=function(_0x2a1c25,_0x4d2ec2){return db['SmsQueue'][_0xb27e('0x53')]()['then'](respondWithResult(_0x4d2ec2,null))['catch'](handleError(_0x4d2ec2,null));};exports['getMembers']=function(_0x2e8f35,_0x26cf72,_0x1b24b9){var _0x293978={'raw':!![],'where':{}},_0x106c8a={},_0x1ab9fd;return db[_0xb27e('0x2f')][_0xb27e('0x54')]({'where':{'id':_0x2e8f35[_0xb27e('0x52')]['id']}})['then'](handleEntityNotFound(_0x26cf72,null))[_0xb27e('0x28')](function(_0x405ac0){if(_0x405ac0){_0x1ab9fd=_0x405ac0[_0xb27e('0x2a')]({'plain':!![]});_0x106c8a[_0xb27e('0x33')]=_[_0xb27e('0x35')](db[_0xb27e('0x55')][_0xb27e('0x30')]);_0x106c8a[_0xb27e('0x34')]=_['keys'](_0x2e8f35['query']);_0x106c8a[_0xb27e('0x36')]=_[_0xb27e('0x37')](_0x106c8a[_0xb27e('0x33')],_0x106c8a['query']);_0x293978[_0xb27e('0x38')]=_['intersection'](_0x106c8a[_0xb27e('0x33')],qs[_0xb27e('0x39')](_0x2e8f35[_0xb27e('0x34')][_0xb27e('0x39')]));_0x293978[_0xb27e('0x38')]=_0x293978['attributes']['length']?_0x293978['attributes']:_0x106c8a[_0xb27e('0x33')];if(!_0x2e8f35[_0xb27e('0x34')]['hasOwnProperty'](_0xb27e('0x3c'))){_0x293978[_0xb27e('0x23')]=qs['limit'](_0x2e8f35[_0xb27e('0x34')][_0xb27e('0x23')]);_0x293978[_0xb27e('0x20')]=qs[_0xb27e('0x20')](_0x2e8f35[_0xb27e('0x34')][_0xb27e('0x20')]);}_0x293978[_0xb27e('0x56')]=qs['sort'](_0x2e8f35[_0xb27e('0x34')][_0xb27e('0x3d')]);_0x293978['where']=qs[_0xb27e('0x36')](_[_0xb27e('0x3e')](_0x2e8f35[_0xb27e('0x34')],_0x106c8a[_0xb27e('0x36')]));_0x293978['where'][_0xb27e('0x57')]=_0x405ac0['id'];if(_0x2e8f35[_0xb27e('0x34')]['filter']){_0x293978[_0xb27e('0x40')]=_[_0xb27e('0x42')](_0x293978['where'],{'$or':_[_0xb27e('0x2e')](_0x293978[_0xb27e('0x38')],function(_0x3377dd){var _0x38095e={};_0x38095e[_0x3377dd]={'$like':'%'+_0x2e8f35[_0xb27e('0x34')][_0xb27e('0x3f')]+'%'};return _0x38095e;})});}_0x293978=_[_0xb27e('0x42')]({},_0x293978,_0x2e8f35['options']);return db['UserSmsQueue'][_0xb27e('0x45')](_0x293978);}})[_0xb27e('0x28')](function(_0x231f83){if(_0x231f83){return db[_0xb27e('0x58')][_0xb27e('0x59')]({'where':{'id':_[_0xb27e('0x2e')](_0x231f83,_0xb27e('0x5a')),'role':_0xb27e('0x5b')},'attributes':['id',_0xb27e('0x2c'),_0xb27e('0x5c'),_0xb27e('0x5d'),_0xb27e('0x5e')]});}})[_0xb27e('0x28')](function(_0x2805b7){if(_0x2805b7){return{'count':_0x2805b7['count'],'rows':_[_0xb27e('0x2e')](_0x2805b7[_0xb27e('0x46')],function(_0x3bc91a){return{'membername':_0x3bc91a[_0xb27e('0x2c')],'UserId':_0x3bc91a['id'],'queue_name':_0x1ab9fd['name'],'SmsQueueId':_0x1ab9fd['id'],'interface':util[_0xb27e('0x5f')](_0xb27e('0x60'),_0xb27e('0x61'),_0x3bc91a[_0xb27e('0x2c')]),'penalty':0x0,'paused':_0x3bc91a[_0xb27e('0x5c')],'createdAt':_0x3bc91a[_0xb27e('0x5e')],'updatedAt':_0x3bc91a[_0xb27e('0x5d')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xb27e('0x28')](respondWithFilteredResult(_0x26cf72,_0x293978))[_0xb27e('0x47')](handleError(_0x26cf72,null));};exports[_0xb27e('0x62')]=function(_0x4ba736,_0x418826,_0x32477e){var _0x610bbf={};var _0x2fc536={};var _0x3c8e95;var _0x351ca3;return db[_0xb27e('0x2f')][_0xb27e('0x54')]({'where':{'id':_0x4ba736[_0xb27e('0x52')]['id']}})[_0xb27e('0x28')](handleEntityNotFound(_0x418826,null))[_0xb27e('0x28')](function(_0x19f767){if(_0x19f767){_0x3c8e95=_0x19f767;_0x2fc536[_0xb27e('0x33')]=_[_0xb27e('0x35')](db['Team'][_0xb27e('0x30')]);_0x2fc536[_0xb27e('0x34')]=_[_0xb27e('0x35')](_0x4ba736[_0xb27e('0x34')]);_0x2fc536[_0xb27e('0x36')]=_[_0xb27e('0x37')](_0x2fc536[_0xb27e('0x33')],_0x2fc536[_0xb27e('0x34')]);_0x610bbf[_0xb27e('0x38')]=_[_0xb27e('0x37')](_0x2fc536[_0xb27e('0x33')],qs[_0xb27e('0x39')](_0x4ba736[_0xb27e('0x34')][_0xb27e('0x39')]));_0x610bbf[_0xb27e('0x38')]=_0x610bbf[_0xb27e('0x38')]['length']?_0x610bbf['attributes']:_0x2fc536['model'];_0x610bbf[_0xb27e('0x56')]=qs[_0xb27e('0x3d')](_0x4ba736[_0xb27e('0x34')][_0xb27e('0x3d')]);_0x610bbf[_0xb27e('0x40')]=qs[_0xb27e('0x36')](_[_0xb27e('0x3e')](_0x4ba736[_0xb27e('0x34')],_0x2fc536[_0xb27e('0x36')]));if(_0x4ba736[_0xb27e('0x34')][_0xb27e('0x3f')]){_0x610bbf[_0xb27e('0x40')]=_[_0xb27e('0x42')](_0x610bbf[_0xb27e('0x40')],{'$or':_[_0xb27e('0x2e')](_0x610bbf[_0xb27e('0x38')],function(_0x382b05){var _0x2dfed8={};_0x2dfed8[_0x382b05]={'$like':'%'+_0x4ba736[_0xb27e('0x34')][_0xb27e('0x3f')]+'%'};return _0x2dfed8;})});}_0x610bbf=_[_0xb27e('0x42')]({},_0x610bbf,_0x4ba736[_0xb27e('0x43')]);return _0x3c8e95[_0xb27e('0x62')](_0x610bbf);}})['then'](function(_0x1c61f7){if(_0x1c61f7){_0x351ca3=_0x1c61f7[_0xb27e('0x3a')];if(!_0x4ba736['query']['hasOwnProperty']('nolimit')){_0x610bbf['limit']=qs['limit'](_0x4ba736[_0xb27e('0x34')]['limit']);_0x610bbf[_0xb27e('0x20')]=qs[_0xb27e('0x20')](_0x4ba736[_0xb27e('0x34')][_0xb27e('0x20')]);}return _0x3c8e95[_0xb27e('0x62')](_0x610bbf);}})[_0xb27e('0x28')](function(_0x1fdcd8){if(_0x1fdcd8){return _0x1fdcd8?{'count':_0x351ca3,'rows':_0x1fdcd8}:null;}})[_0xb27e('0x28')](respondWithResult(_0x418826,null))[_0xb27e('0x47')](handleError(_0x418826,null));};exports[_0xb27e('0x63')]=function(_0x1b14f5,_0x1f6f59,_0x78df14){var _0x516047=_0x1b14f5['body'][_0xb27e('0x64')];return db[_0xb27e('0x65')]['findAll']({'where':{'id':_0x516047},'attributes':['id'],'include':[{'model':db[_0xb27e('0x58')],'as':_0xb27e('0x66'),'attributes':['id',_0xb27e('0x2c'),_0xb27e('0x67'),_0xb27e('0x68'),_0xb27e('0x69')],'raw':!![]}]})[_0xb27e('0x28')](function(_0xfd0fc6){if(_0xfd0fc6){var _0x495fd2=_['flatMap'](_0xfd0fc6,function(_0x99f586){var _0x135f1c=_0x99f586[_0xb27e('0x2a')]({'plain':!![]});return _0x135f1c[_0xb27e('0x66')];});return db[_0xb27e('0x2f')][_0xb27e('0x4c')]({'where':{'id':_0x1b14f5[_0xb27e('0x52')]['id']}})['then'](function(_0x219768){return db[_0xb27e('0x6a')][_0xb27e('0x6b')](function(_0x4d78da){return _0x219768[_0xb27e('0x63')](_0x516047,{'transaction':_0x4d78da})[_0xb27e('0x28')](function(){return BPromise[_0xb27e('0x6c')](_0x495fd2,function(_0x3adc20){return db['UserSmsQueue'][_0xb27e('0x6d')]({'where':{'UserId':_0x3adc20['id'],'SmsQueueId':_0x1b14f5[_0xb27e('0x52')]['id']},'transaction':_0x4d78da});});})['then'](function(){_0x495fd2[_0xb27e('0x6e')](function(_0x1ce1d2){socket[_0xb27e('0x6f')](_0xb27e('0x70'),{'UserId':_0x1ce1d2['id'],'SmsQueueId':_0x219768['id']});});});});});}})[_0xb27e('0x28')](respondWithStatusCode(_0x1f6f59,null))[_0xb27e('0x47')](handleError(_0x1f6f59,null));};exports[_0xb27e('0x71')]=function(_0x3f840d,_0x470096,_0xfa6b0){return db[_0xb27e('0x65')][_0xb27e('0x45')]({'where':{'id':_0x3f840d['query'][_0xb27e('0x64')]},'attributes':['id'],'include':[{'model':db[_0xb27e('0x58')],'as':_0xb27e('0x66'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x470096,null))[_0xb27e('0x28')](function(_0x83d3b1){var _0x5e9383=_[_0xb27e('0x2e')](_0x83d3b1,'id');var _0x395028=[];var _0x50ca04=[];var _0x22a67e=squel[_0xb27e('0x72')]();_0x22a67e[_0xb27e('0x73')](_0xb27e('0x74'))[_0xb27e('0x75')](_0xb27e('0x76'),'tq')[_0xb27e('0x77')](_0xb27e('0x78'),'ut',_0xb27e('0x79'))[_0xb27e('0x40')](_0xb27e('0x7a'),_0x3f840d['params']['id']);for(var _0xee4800=0x0;_0xee4800<_0x83d3b1[_0xb27e('0x3a')];_0xee4800+=0x1){let _0x2e9161=_0x83d3b1[_0xee4800];for(var _0x17a0d3=0x0;_0x17a0d3<_0x2e9161[_0xb27e('0x66')][_0xb27e('0x3a')];_0x17a0d3+=0x1){let _0x18595a=_0x2e9161['Agents'][_0x17a0d3];var _0xa23a58=_0x22a67e[_0xb27e('0x7b')]();_0xa23a58['where'](_0xb27e('0x7c'),_0x18595a['id']);_0x50ca04[_0xb27e('0x7d')](db[_0xb27e('0x6a')][_0xb27e('0x34')](_0xa23a58[_0xb27e('0x7e')](),{'type':db[_0xb27e('0x6a')][_0xb27e('0x7f')][_0xb27e('0x80')]})['then'](function(_0x15fb61){if(_0x15fb61[_0xb27e('0x3a')]===0x1){return _0x18595a['id'];}else{var _0x2fc2c0=_[_0xb27e('0x81')](_[_0xb27e('0x2e')](_0x15fb61,_0xb27e('0x82')),function(_0x16b718){return _[_0xb27e('0x83')](_0x5e9383,_0x16b718);});if(_0x2fc2c0){return _0x18595a['id'];}}}));}}return BPromise[_0xb27e('0x84')](_0x50ca04)['then'](function(_0x3722b3){_0x395028=_(_0x395028)[_0xb27e('0x85')](_0x3722b3)[_0xb27e('0x86')]()[_0xb27e('0x87')]();return db[_0xb27e('0x2f')][_0xb27e('0x4c')]({'where':{'id':_0x3f840d[_0xb27e('0x52')]['id']}})['then'](function(_0x3bf9bd){return db[_0xb27e('0x6a')][_0xb27e('0x6b')](function(_0x1deb4a){return _0x3bf9bd[_0xb27e('0x71')](_0x3f840d['query'][_0xb27e('0x64')],{'transaction':_0x1deb4a})[_0xb27e('0x28')](function(){if(!_[_0xb27e('0x88')](_0x395028)){return _0x3bf9bd['removeAgents'](_0x395028,{'transaction':_0x1deb4a});}})[_0xb27e('0x28')](function(){_0x395028[_0xb27e('0x6e')](function(_0x3d35d1){socket[_0xb27e('0x6f')](_0xb27e('0x89'),{'UserId':_0x3d35d1,'SmsQueueId':_0x3bf9bd['id']});});});});});});})[_0xb27e('0x28')](respondWithStatusCode(_0x470096,null))['catch'](handleError(_0x470096,null));};exports[_0xb27e('0x8a')]=function(_0xc80e97,_0x9ad4c5,_0x30016c){return db[_0xb27e('0x2f')][_0xb27e('0x4c')]({'where':{'id':_0xc80e97[_0xb27e('0x52')]['id']}})[_0xb27e('0x28')](handleEntityNotFound(_0x9ad4c5,null))[_0xb27e('0x28')](function(_0x4c208f){if(_0x4c208f){return _0x4c208f[_0xb27e('0x8a')](_0xc80e97['body']['ids'],_['omit'](_0xc80e97[_0xb27e('0x49')],[_0xb27e('0x64'),'id'])||{})['spread'](function(_0x58b340){for(var _0x15066a=0x0;_0x15066a<_0xc80e97[_0xb27e('0x49')][_0xb27e('0x64')][_0xb27e('0x3a')];_0x15066a+=0x1){socket[_0xb27e('0x6f')](_0xb27e('0x70'),{'UserId':Number(_0xc80e97[_0xb27e('0x49')]['ids'][_0x15066a]),'SmsQueueId':Number(_0xc80e97['params']['id'])});}return _0x58b340;});}})[_0xb27e('0x28')](respondWithResult(_0x9ad4c5,null))['catch'](handleError(_0x9ad4c5,null));};exports[_0xb27e('0x8b')]=function(_0x5e8198,_0x1c9d2e,_0x3ab94c){return db['SmsQueue']['find']({'where':{'id':_0x5e8198[_0xb27e('0x52')]['id']}})[_0xb27e('0x28')](handleEntityNotFound(_0x1c9d2e,null))[_0xb27e('0x28')](function(_0x4b8802){if(_0x4b8802){return _0x4b8802[_0xb27e('0x8b')](_0x5e8198['query']['ids'])[_0xb27e('0x28')](function(){if(_['isArray'](_0x5e8198['query']['ids'])){for(var _0x1cdc80=0x0;_0x1cdc80<_0x5e8198[_0xb27e('0x34')][_0xb27e('0x64')]['length'];_0x1cdc80+=0x1){socket['emit'](_0xb27e('0x89'),{'UserId':Number(_0x5e8198[_0xb27e('0x34')][_0xb27e('0x64')][_0x1cdc80]),'SmsQueueId':Number(_0x5e8198['params']['id'])});}}else{socket[_0xb27e('0x6f')](_0xb27e('0x89'),{'UserId':Number(_0x5e8198[_0xb27e('0x34')][_0xb27e('0x64')]),'SmsQueueId':Number(_0x5e8198['params']['id'])});}});}})[_0xb27e('0x28')](respondWithStatusCode(_0x1c9d2e,null))[_0xb27e('0x47')](handleError(_0x1c9d2e,null));};exports[_0xb27e('0x8c')]=function(_0x148919,_0x48e477,_0x5ab8d3){var _0x2932e9={};var _0x739f67={};var _0x4fecfa;var _0x5e0271;return db[_0xb27e('0x2f')][_0xb27e('0x54')]({'where':{'id':_0x148919[_0xb27e('0x52')]['id']}})[_0xb27e('0x28')](handleEntityNotFound(_0x48e477,null))[_0xb27e('0x28')](function(_0x3e7545){if(_0x3e7545){_0x4fecfa=_0x3e7545;_0x739f67['model']=_['keys'](db[_0xb27e('0x58')][_0xb27e('0x30')]);_0x739f67[_0xb27e('0x34')]=_[_0xb27e('0x35')](_0x148919[_0xb27e('0x34')]);_0x739f67[_0xb27e('0x36')]=_[_0xb27e('0x37')](_0x739f67[_0xb27e('0x33')],_0x739f67[_0xb27e('0x34')]);_0x2932e9[_0xb27e('0x38')]=_[_0xb27e('0x37')](_0x739f67[_0xb27e('0x33')],qs['fields'](_0x148919[_0xb27e('0x34')][_0xb27e('0x39')]));_0x2932e9[_0xb27e('0x38')]=_0x2932e9['attributes']['length']?_0x2932e9[_0xb27e('0x38')]:_0x739f67['model'];_0x2932e9[_0xb27e('0x56')]=qs[_0xb27e('0x3d')](_0x148919[_0xb27e('0x34')]['sort']);_0x2932e9['where']=qs[_0xb27e('0x36')](_[_0xb27e('0x3e')](_0x148919[_0xb27e('0x34')],_0x739f67['filters']));if(_0x148919['query'][_0xb27e('0x3f')]){_0x2932e9[_0xb27e('0x40')]=_[_0xb27e('0x42')](_0x2932e9[_0xb27e('0x40')],{'$or':_[_0xb27e('0x2e')](_0x2932e9[_0xb27e('0x38')],function(_0x59e3b3){var _0x1e5b00={};_0x1e5b00[_0x59e3b3]={'$like':'%'+_0x148919['query'][_0xb27e('0x3f')]+'%'};return _0x1e5b00;})});}_0x2932e9=_['merge']({},_0x2932e9,_0x148919[_0xb27e('0x43')]);return _0x4fecfa[_0xb27e('0x8c')](_0x2932e9);}})[_0xb27e('0x28')](function(_0x467f3e){if(_0x467f3e){_0x5e0271=_0x467f3e['length'];if(!_0x148919[_0xb27e('0x34')][_0xb27e('0x3b')](_0xb27e('0x3c'))){_0x2932e9[_0xb27e('0x23')]=qs['limit'](_0x148919[_0xb27e('0x34')][_0xb27e('0x23')]);_0x2932e9[_0xb27e('0x20')]=qs[_0xb27e('0x20')](_0x148919['query']['offset']);}return _0x4fecfa[_0xb27e('0x8c')](_0x2932e9);}})[_0xb27e('0x28')](function(_0x26851e){if(_0x26851e){return _0x26851e?{'count':_0x5e0271,'rows':_0x26851e}:null;}})[_0xb27e('0x28')](respondWithResult(_0x48e477,null))[_0xb27e('0x47')](handleError(_0x48e477,null));}; \ No newline at end of file +var _0xeec6=['%s/%s','SIP','getTeams','Team','addTeams','ids','Agents','online','voicePause','interface','sequelize','transaction','each','forEach','userSmsQueue:save','removeTeams','select','field','tq.TeamId','join','user_has_teams','SmsQueueId\x20=\x20?','QueryTypes','every','TeamId','all','union','isEmpty','emit','addAgents','omit','spread','isArray','userSmsQueue:remove','getAgents','eml-format','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/license/util','redis','localhost','socket.io-emitter','./smsQueue.socket','register','status','end','json','offset','undefined','limit','count','save','then','get','destroy','sendStatus','stack','name','send','map','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','SmsQueue','includeAll','findAll','rows','params','length','include','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','SmsQueues','UserProfileSection','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','findOne','UserSmsQueue','SmsQueueId','User','findAndCountAll','UserId','agent','smsPause','updatedAt','createdAt','format'];(function(_0x2f98cb,_0x3022a4){var _0x5b04c6=function(_0x4ee7e3){while(--_0x4ee7e3){_0x2f98cb['push'](_0x2f98cb['shift']());}};_0x5b04c6(++_0x3022a4);}(_0xeec6,0x125));var _0x6eec=function(_0x4c3afd,_0x3e7a45){_0x4c3afd=_0x4c3afd-0x0;var _0x4e2ef3=_0xeec6[_0x4c3afd];return _0x4e2ef3;};'use strict';var emlformat=require(_0x6eec('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x6eec('0x1'));var rp=require(_0x6eec('0x2'));var moment=require(_0x6eec('0x3'));var BPromise=require(_0x6eec('0x4'));var Mustache=require('mustache');var util=require(_0x6eec('0x5'));var path=require(_0x6eec('0x6'));var sox=require('sox');var csv=require(_0x6eec('0x7'));var ejs=require(_0x6eec('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6eec('0x9'));var squel=require(_0x6eec('0xa'));var crypto=require(_0x6eec('0xb'));var jsforce=require(_0x6eec('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x6eec('0x7'));var querystring=require(_0x6eec('0xd'));var Papa=require(_0x6eec('0xe'));var Redis=require('ioredis');var authService=require(_0x6eec('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x6eec('0x10'));var hardwareService=require(_0x6eec('0x11'));var logger=require(_0x6eec('0x12'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x6eec('0x13'));var db=require('../../mysqldb')['db'];config['redis']=_['defaults'](config[_0x6eec('0x14')],{'host':_0x6eec('0x15'),'port':0x18eb});var socket=require(_0x6eec('0x16'))(new Redis(config['redis']));require(_0x6eec('0x17'))[_0x6eec('0x18')](socket);function respondWithStatusCode(_0x222fdc,_0x3ea277){_0x3ea277=_0x3ea277||0xcc;return function(_0x4e46ff){if(_0x4e46ff){return _0x222fdc['sendStatus'](_0x3ea277);}return _0x222fdc[_0x6eec('0x19')](_0x3ea277)[_0x6eec('0x1a')]();};}function respondWithResult(_0x4f7bee,_0x32a015){_0x32a015=_0x32a015||0xc8;return function(_0x2857da){if(_0x2857da){return _0x4f7bee[_0x6eec('0x19')](_0x32a015)[_0x6eec('0x1b')](_0x2857da);}};}function respondWithFilteredResult(_0x322515,_0x159223){return function(_0x3ae7f3){if(_0x3ae7f3){var _0x491bb4=typeof _0x159223[_0x6eec('0x1c')]===_0x6eec('0x1d')&&typeof _0x159223[_0x6eec('0x1e')]==='undefined';var _0x5af05a=_0x3ae7f3[_0x6eec('0x1f')];var _0x5f3704=_0x491bb4?0x0:_0x159223[_0x6eec('0x1c')];var _0x24d184=_0x491bb4?_0x3ae7f3[_0x6eec('0x1f')]:_0x159223[_0x6eec('0x1c')]+_0x159223[_0x6eec('0x1e')];var _0x240030;if(_0x24d184>=_0x5af05a){_0x24d184=_0x5af05a;_0x240030=0xc8;}else{_0x240030=0xce;}_0x322515['status'](_0x240030);return _0x322515['set']('Content-Range',_0x5f3704+'-'+_0x24d184+'/'+_0x5af05a)['json'](_0x3ae7f3);}return null;};}function patchUpdates(_0x1ddbee){return function(_0x45be5a){try{jsonpatch['apply'](_0x45be5a,_0x1ddbee,!![]);}catch(_0x2489c2){return BPromise['reject'](_0x2489c2);}return _0x45be5a[_0x6eec('0x20')]();};}function saveUpdates(_0x388dc0,_0x2cd6a4){return function(_0x5f208f){if(_0x5f208f){return _0x5f208f['update'](_0x388dc0)[_0x6eec('0x21')](function(_0x5e1d62){return _0x5e1d62;});}return null;};}function removeEntity(_0x20884b,_0x12f25a){return function(_0x354d4e){if(_0x354d4e){return _0x354d4e['destroy']()[_0x6eec('0x21')](function(){var _0x24f79a=_0x354d4e[_0x6eec('0x22')]({'plain':!![]});var _0x4d44c5='SmsQueues';return db['UserProfileResource'][_0x6eec('0x23')]({'where':{'type':_0x4d44c5,'resourceId':_0x24f79a['id']}})[_0x6eec('0x21')](function(){return _0x354d4e;});})['then'](function(){_0x20884b['status'](0xcc)[_0x6eec('0x1a')]();});}};}function handleEntityNotFound(_0x2396f6,_0x4b862c){return function(_0x45d8a4){if(!_0x45d8a4){_0x2396f6[_0x6eec('0x24')](0x194);}return _0x45d8a4;};}function handleError(_0x147ae3,_0x1759d2){_0x1759d2=_0x1759d2||0x1f4;return function(_0xf3abdd){logger['error'](_0xf3abdd[_0x6eec('0x25')]);if(_0xf3abdd[_0x6eec('0x26')]){delete _0xf3abdd[_0x6eec('0x26')];}_0x147ae3[_0x6eec('0x19')](_0x1759d2)[_0x6eec('0x27')](_0xf3abdd);};}exports['index']=function(_0x2b7991,_0x16b6f0){var _0x127913={},_0x31ff29={},_0x45b855={'count':0x0,'rows':[]};var _0x1fbf9c=_[_0x6eec('0x28')](db['SmsQueue'][_0x6eec('0x29')],function(_0x203f66){return{'name':_0x203f66[_0x6eec('0x2a')],'type':_0x203f66[_0x6eec('0x2b')][_0x6eec('0x2c')]};});_0x31ff29['model']=_[_0x6eec('0x28')](_0x1fbf9c,_0x6eec('0x26'));_0x31ff29[_0x6eec('0x2d')]=_[_0x6eec('0x2e')](_0x2b7991['query']);_0x31ff29[_0x6eec('0x2f')]=_[_0x6eec('0x30')](_0x31ff29[_0x6eec('0x31')],_0x31ff29[_0x6eec('0x2d')]);_0x127913['attributes']=_[_0x6eec('0x30')](_0x31ff29[_0x6eec('0x31')],qs[_0x6eec('0x32')](_0x2b7991[_0x6eec('0x2d')]['fields']));_0x127913[_0x6eec('0x33')]=_0x127913[_0x6eec('0x33')]['length']?_0x127913['attributes']:_0x31ff29['model'];if(!_0x2b7991[_0x6eec('0x2d')][_0x6eec('0x34')](_0x6eec('0x35'))){_0x127913[_0x6eec('0x1e')]=qs['limit'](_0x2b7991[_0x6eec('0x2d')][_0x6eec('0x1e')]);_0x127913[_0x6eec('0x1c')]=qs[_0x6eec('0x1c')](_0x2b7991[_0x6eec('0x2d')][_0x6eec('0x1c')]);}_0x127913[_0x6eec('0x36')]=qs['sort'](_0x2b7991[_0x6eec('0x2d')][_0x6eec('0x37')]);_0x127913[_0x6eec('0x38')]=qs[_0x6eec('0x2f')](_[_0x6eec('0x39')](_0x2b7991[_0x6eec('0x2d')],_0x31ff29['filters']),_0x1fbf9c);if(_0x2b7991[_0x6eec('0x2d')]['filter']){_0x127913[_0x6eec('0x38')]=_[_0x6eec('0x3a')](_0x127913[_0x6eec('0x38')],{'$or':_[_0x6eec('0x28')](_0x1fbf9c,function(_0x51dfc5){if(_0x51dfc5[_0x6eec('0x2b')]!==_0x6eec('0x3b')){var _0x1028e3={};_0x1028e3[_0x51dfc5[_0x6eec('0x26')]]={'$like':'%'+_0x2b7991['query'][_0x6eec('0x3c')]+'%'};return _0x1028e3;}})});}_0x127913=_[_0x6eec('0x3a')]({},_0x127913,_0x2b7991[_0x6eec('0x3d')]);var _0x59bdb2={'where':_0x127913[_0x6eec('0x38')]};return db[_0x6eec('0x3e')][_0x6eec('0x1f')](_0x59bdb2)[_0x6eec('0x21')](function(_0x3fe638){_0x45b855[_0x6eec('0x1f')]=_0x3fe638;if(_0x2b7991[_0x6eec('0x2d')][_0x6eec('0x3f')]){_0x127913['include']=[{'all':!![]}];}return db[_0x6eec('0x3e')][_0x6eec('0x40')](_0x127913);})[_0x6eec('0x21')](function(_0x2a2600){_0x45b855[_0x6eec('0x41')]=_0x2a2600;return _0x45b855;})[_0x6eec('0x21')](respondWithFilteredResult(_0x16b6f0,_0x127913))['catch'](handleError(_0x16b6f0,null));};exports['show']=function(_0x42ff32,_0x1dffbe){var _0x413495={'raw':!![],'where':{'id':_0x42ff32[_0x6eec('0x42')]['id']}},_0x3f09bc={};_0x3f09bc[_0x6eec('0x31')]=_[_0x6eec('0x2e')](db['SmsQueue'][_0x6eec('0x29')]);_0x3f09bc['query']=_['keys'](_0x42ff32['query']);_0x3f09bc[_0x6eec('0x2f')]=_['intersection'](_0x3f09bc['model'],_0x3f09bc[_0x6eec('0x2d')]);_0x413495['attributes']=_[_0x6eec('0x30')](_0x3f09bc[_0x6eec('0x31')],qs[_0x6eec('0x32')](_0x42ff32[_0x6eec('0x2d')][_0x6eec('0x32')]));_0x413495['attributes']=_0x413495[_0x6eec('0x33')][_0x6eec('0x43')]?_0x413495[_0x6eec('0x33')]:_0x3f09bc[_0x6eec('0x31')];if(_0x42ff32[_0x6eec('0x2d')][_0x6eec('0x3f')]){_0x413495[_0x6eec('0x44')]=[{'all':!![]}];}_0x413495=_['merge']({},_0x413495,_0x42ff32['options']);return db[_0x6eec('0x3e')][_0x6eec('0x45')](_0x413495)[_0x6eec('0x21')](handleEntityNotFound(_0x1dffbe,null))[_0x6eec('0x21')](respondWithResult(_0x1dffbe,null))[_0x6eec('0x46')](handleError(_0x1dffbe,null));};exports['create']=function(_0x1c5479,_0xd45765){return db[_0x6eec('0x3e')][_0x6eec('0x47')](_0x1c5479[_0x6eec('0x48')],{})[_0x6eec('0x21')](function(_0x4f5a94){var _0x430b98=_0x1c5479[_0x6eec('0x49')]['get']({'plain':!![]});if(!_0x430b98)throw new Error(_0x6eec('0x4a'));if(_0x430b98[_0x6eec('0x4b')]===_0x6eec('0x49')){var _0x4a2bd2=_0x4f5a94[_0x6eec('0x22')]({'plain':!![]});var _0xf4ea83=_0x6eec('0x4c');return db[_0x6eec('0x4d')][_0x6eec('0x45')]({'where':{'name':_0xf4ea83,'userProfileId':_0x430b98[_0x6eec('0x4e')]},'raw':!![]})[_0x6eec('0x21')](function(_0x5e5cf8){if(_0x5e5cf8&&_0x5e5cf8['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x4a2bd2['name'],'resourceId':_0x4a2bd2['id'],'type':_0x5e5cf8[_0x6eec('0x26')],'sectionId':_0x5e5cf8['id']},{})[_0x6eec('0x21')](function(){return _0x4f5a94;});}else{return _0x4f5a94;}})[_0x6eec('0x46')](function(_0x196af0){logger[_0x6eec('0x4f')](_0x6eec('0x50'),_0x196af0);throw _0x196af0;});}return _0x4f5a94;})['then'](respondWithResult(_0xd45765,0xc9))['catch'](handleError(_0xd45765,null));};exports[_0x6eec('0x51')]=function(_0x1e4515,_0x1c5763){if(_0x1e4515['body']['id']){delete _0x1e4515['body']['id'];}return db['SmsQueue']['find']({'where':{'id':_0x1e4515[_0x6eec('0x42')]['id']}})['then'](handleEntityNotFound(_0x1c5763,null))[_0x6eec('0x21')](saveUpdates(_0x1e4515[_0x6eec('0x48')],null))['then'](respondWithResult(_0x1c5763,null))[_0x6eec('0x46')](handleError(_0x1c5763,null));};exports[_0x6eec('0x23')]=function(_0x4a3bf0,_0x531ee7){return db[_0x6eec('0x3e')][_0x6eec('0x45')]({'where':{'id':_0x4a3bf0[_0x6eec('0x42')]['id']}})[_0x6eec('0x21')](handleEntityNotFound(_0x531ee7,null))[_0x6eec('0x21')](removeEntity(_0x531ee7,null))[_0x6eec('0x46')](handleError(_0x531ee7,null));};exports['describe']=function(_0x3d5882,_0x215319){return db[_0x6eec('0x3e')][_0x6eec('0x52')]()[_0x6eec('0x21')](respondWithResult(_0x215319,null))[_0x6eec('0x46')](handleError(_0x215319,null));};exports['getMembers']=function(_0x11a208,_0x59125f,_0x4c04bd){var _0x4344b9={'raw':!![],'where':{}},_0x57d38d={},_0x1aa55c;return db['SmsQueue'][_0x6eec('0x53')]({'where':{'id':_0x11a208['params']['id']}})[_0x6eec('0x21')](handleEntityNotFound(_0x59125f,null))[_0x6eec('0x21')](function(_0x270ede){if(_0x270ede){_0x1aa55c=_0x270ede[_0x6eec('0x22')]({'plain':!![]});_0x57d38d[_0x6eec('0x31')]=_[_0x6eec('0x2e')](db[_0x6eec('0x54')]['rawAttributes']);_0x57d38d[_0x6eec('0x2d')]=_['keys'](_0x11a208[_0x6eec('0x2d')]);_0x57d38d[_0x6eec('0x2f')]=_[_0x6eec('0x30')](_0x57d38d[_0x6eec('0x31')],_0x57d38d[_0x6eec('0x2d')]);_0x4344b9['attributes']=_[_0x6eec('0x30')](_0x57d38d['model'],qs[_0x6eec('0x32')](_0x11a208[_0x6eec('0x2d')]['fields']));_0x4344b9[_0x6eec('0x33')]=_0x4344b9[_0x6eec('0x33')][_0x6eec('0x43')]?_0x4344b9[_0x6eec('0x33')]:_0x57d38d[_0x6eec('0x31')];if(!_0x11a208[_0x6eec('0x2d')]['hasOwnProperty'](_0x6eec('0x35'))){_0x4344b9[_0x6eec('0x1e')]=qs['limit'](_0x11a208[_0x6eec('0x2d')]['limit']);_0x4344b9[_0x6eec('0x1c')]=qs[_0x6eec('0x1c')](_0x11a208[_0x6eec('0x2d')]['offset']);}_0x4344b9[_0x6eec('0x36')]=qs[_0x6eec('0x37')](_0x11a208[_0x6eec('0x2d')][_0x6eec('0x37')]);_0x4344b9[_0x6eec('0x38')]=qs[_0x6eec('0x2f')](_[_0x6eec('0x39')](_0x11a208[_0x6eec('0x2d')],_0x57d38d[_0x6eec('0x2f')]));_0x4344b9[_0x6eec('0x38')][_0x6eec('0x55')]=_0x270ede['id'];if(_0x11a208['query'][_0x6eec('0x3c')]){_0x4344b9['where']=_[_0x6eec('0x3a')](_0x4344b9[_0x6eec('0x38')],{'$or':_[_0x6eec('0x28')](_0x4344b9[_0x6eec('0x33')],function(_0x4f79cb){var _0x1a9463={};_0x1a9463[_0x4f79cb]={'$like':'%'+_0x11a208[_0x6eec('0x2d')][_0x6eec('0x3c')]+'%'};return _0x1a9463;})});}_0x4344b9=_['merge']({},_0x4344b9,_0x11a208[_0x6eec('0x3d')]);return db[_0x6eec('0x54')][_0x6eec('0x40')](_0x4344b9);}})['then'](function(_0x3c19ed){if(_0x3c19ed){return db[_0x6eec('0x56')][_0x6eec('0x57')]({'where':{'id':_[_0x6eec('0x28')](_0x3c19ed,_0x6eec('0x58')),'role':_0x6eec('0x59')},'attributes':['id',_0x6eec('0x26'),_0x6eec('0x5a'),_0x6eec('0x5b'),_0x6eec('0x5c')]});}})['then'](function(_0x2d8b12){if(_0x2d8b12){return{'count':_0x2d8b12[_0x6eec('0x1f')],'rows':_['map'](_0x2d8b12[_0x6eec('0x41')],function(_0x2fde6f){return{'membername':_0x2fde6f['name'],'UserId':_0x2fde6f['id'],'queue_name':_0x1aa55c[_0x6eec('0x26')],'SmsQueueId':_0x1aa55c['id'],'interface':util[_0x6eec('0x5d')](_0x6eec('0x5e'),_0x6eec('0x5f'),_0x2fde6f[_0x6eec('0x26')]),'penalty':0x0,'paused':_0x2fde6f[_0x6eec('0x5a')],'createdAt':_0x2fde6f[_0x6eec('0x5c')],'updatedAt':_0x2fde6f[_0x6eec('0x5b')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x59125f,_0x4344b9))[_0x6eec('0x46')](handleError(_0x59125f,null));};exports[_0x6eec('0x60')]=function(_0x1140b7,_0x334e06,_0x549c9f){var _0x24b2a7={};var _0x1b0452={};var _0x49f332;var _0x21deeb;return db['SmsQueue'][_0x6eec('0x53')]({'where':{'id':_0x1140b7[_0x6eec('0x42')]['id']}})[_0x6eec('0x21')](handleEntityNotFound(_0x334e06,null))['then'](function(_0xd24fab){if(_0xd24fab){_0x49f332=_0xd24fab;_0x1b0452[_0x6eec('0x31')]=_[_0x6eec('0x2e')](db[_0x6eec('0x61')][_0x6eec('0x29')]);_0x1b0452['query']=_[_0x6eec('0x2e')](_0x1140b7[_0x6eec('0x2d')]);_0x1b0452[_0x6eec('0x2f')]=_[_0x6eec('0x30')](_0x1b0452[_0x6eec('0x31')],_0x1b0452[_0x6eec('0x2d')]);_0x24b2a7[_0x6eec('0x33')]=_['intersection'](_0x1b0452[_0x6eec('0x31')],qs[_0x6eec('0x32')](_0x1140b7[_0x6eec('0x2d')][_0x6eec('0x32')]));_0x24b2a7[_0x6eec('0x33')]=_0x24b2a7[_0x6eec('0x33')][_0x6eec('0x43')]?_0x24b2a7['attributes']:_0x1b0452[_0x6eec('0x31')];_0x24b2a7[_0x6eec('0x36')]=qs[_0x6eec('0x37')](_0x1140b7[_0x6eec('0x2d')]['sort']);_0x24b2a7['where']=qs[_0x6eec('0x2f')](_[_0x6eec('0x39')](_0x1140b7[_0x6eec('0x2d')],_0x1b0452[_0x6eec('0x2f')]));if(_0x1140b7[_0x6eec('0x2d')][_0x6eec('0x3c')]){_0x24b2a7['where']=_[_0x6eec('0x3a')](_0x24b2a7['where'],{'$or':_[_0x6eec('0x28')](_0x24b2a7[_0x6eec('0x33')],function(_0x3e58a2){var _0x5dd917={};_0x5dd917[_0x3e58a2]={'$like':'%'+_0x1140b7[_0x6eec('0x2d')]['filter']+'%'};return _0x5dd917;})});}_0x24b2a7=_[_0x6eec('0x3a')]({},_0x24b2a7,_0x1140b7[_0x6eec('0x3d')]);return _0x49f332['getTeams'](_0x24b2a7);}})[_0x6eec('0x21')](function(_0x30316d){if(_0x30316d){_0x21deeb=_0x30316d[_0x6eec('0x43')];if(!_0x1140b7[_0x6eec('0x2d')][_0x6eec('0x34')](_0x6eec('0x35'))){_0x24b2a7[_0x6eec('0x1e')]=qs[_0x6eec('0x1e')](_0x1140b7[_0x6eec('0x2d')][_0x6eec('0x1e')]);_0x24b2a7['offset']=qs[_0x6eec('0x1c')](_0x1140b7['query'][_0x6eec('0x1c')]);}return _0x49f332[_0x6eec('0x60')](_0x24b2a7);}})[_0x6eec('0x21')](function(_0x433c93){if(_0x433c93){return _0x433c93?{'count':_0x21deeb,'rows':_0x433c93}:null;}})[_0x6eec('0x21')](respondWithResult(_0x334e06,null))['catch'](handleError(_0x334e06,null));};exports[_0x6eec('0x62')]=function(_0x2d939b,_0x1f4f20,_0xc97261){var _0x148ae0=_0x2d939b[_0x6eec('0x48')][_0x6eec('0x63')];return db['Team'][_0x6eec('0x40')]({'where':{'id':_0x148ae0},'attributes':['id'],'include':[{'model':db[_0x6eec('0x56')],'as':_0x6eec('0x64'),'attributes':['id',_0x6eec('0x26'),_0x6eec('0x65'),_0x6eec('0x66'),_0x6eec('0x67')],'raw':!![]}]})['then'](function(_0x7ddf86){if(_0x7ddf86){var _0x595895=_['flatMap'](_0x7ddf86,function(_0x3c7672){var _0x487e89=_0x3c7672[_0x6eec('0x22')]({'plain':!![]});return _0x487e89[_0x6eec('0x64')];});return db[_0x6eec('0x3e')][_0x6eec('0x45')]({'where':{'id':_0x2d939b[_0x6eec('0x42')]['id']}})[_0x6eec('0x21')](function(_0x4dda7e){return db[_0x6eec('0x68')][_0x6eec('0x69')](function(_0x295799){return _0x4dda7e[_0x6eec('0x62')](_0x148ae0,{'transaction':_0x295799})['then'](function(){return BPromise[_0x6eec('0x6a')](_0x595895,function(_0x262a91){return db[_0x6eec('0x54')]['findOrCreate']({'where':{'UserId':_0x262a91['id'],'SmsQueueId':_0x2d939b['params']['id']},'transaction':_0x295799});});})[_0x6eec('0x21')](function(){_0x595895[_0x6eec('0x6b')](function(_0x46cd4c){socket['emit'](_0x6eec('0x6c'),{'UserId':_0x46cd4c['id'],'SmsQueueId':_0x4dda7e['id']});});});});});}})[_0x6eec('0x21')](respondWithStatusCode(_0x1f4f20,null))[_0x6eec('0x46')](handleError(_0x1f4f20,null));};exports[_0x6eec('0x6d')]=function(_0x58a6ad,_0x59a5f4,_0x466d61){return db[_0x6eec('0x61')]['findAll']({'where':{'id':_0x58a6ad[_0x6eec('0x2d')][_0x6eec('0x63')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0x6eec('0x64'),'attributes':['id'],'raw':!![]}]})[_0x6eec('0x21')](handleEntityNotFound(_0x59a5f4,null))[_0x6eec('0x21')](function(_0x7b8a09){var _0x3aa590=_[_0x6eec('0x28')](_0x7b8a09,'id');var _0xfdc28c=[];var _0x4d5a21=[];var _0x4f1c0f=squel[_0x6eec('0x6e')]();_0x4f1c0f[_0x6eec('0x6f')](_0x6eec('0x70'))['from']('team_has_sms_queues','tq')[_0x6eec('0x71')](_0x6eec('0x72'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0x6eec('0x38')](_0x6eec('0x73'),_0x58a6ad[_0x6eec('0x42')]['id']);for(var _0x2f1df6=0x0;_0x2f1df6<_0x7b8a09['length'];_0x2f1df6+=0x1){let _0x549f84=_0x7b8a09[_0x2f1df6];for(var _0x2d178d=0x0;_0x2d178d<_0x549f84['Agents']['length'];_0x2d178d+=0x1){let _0x55bcb8=_0x549f84[_0x6eec('0x64')][_0x2d178d];var _0x29e921=_0x4f1c0f['clone']();_0x29e921['where']('ut.UserId\x20=\x20?',_0x55bcb8['id']);_0x4d5a21['push'](db[_0x6eec('0x68')]['query'](_0x29e921['toString'](),{'type':db[_0x6eec('0x68')][_0x6eec('0x74')]['SELECT']})[_0x6eec('0x21')](function(_0x36dc27){if(_0x36dc27[_0x6eec('0x43')]===0x1){return _0x55bcb8['id'];}else{var _0x4b7470=_[_0x6eec('0x75')](_[_0x6eec('0x28')](_0x36dc27,_0x6eec('0x76')),function(_0x3ba05c){return _['includes'](_0x3aa590,_0x3ba05c);});if(_0x4b7470){return _0x55bcb8['id'];}}}));}}return BPromise[_0x6eec('0x77')](_0x4d5a21)['then'](function(_0x323e03){_0xfdc28c=_(_0xfdc28c)[_0x6eec('0x78')](_0x323e03)['compact']()['value']();return db[_0x6eec('0x3e')]['find']({'where':{'id':_0x58a6ad['params']['id']}})[_0x6eec('0x21')](function(_0x1b6f6c){return db[_0x6eec('0x68')]['transaction'](function(_0x1967a2){return _0x1b6f6c[_0x6eec('0x6d')](_0x58a6ad[_0x6eec('0x2d')]['ids'],{'transaction':_0x1967a2})['then'](function(){if(!_[_0x6eec('0x79')](_0xfdc28c)){return _0x1b6f6c['removeAgents'](_0xfdc28c,{'transaction':_0x1967a2});}})['then'](function(){_0xfdc28c[_0x6eec('0x6b')](function(_0xcb0d1c){socket[_0x6eec('0x7a')]('userSmsQueue:remove',{'UserId':_0xcb0d1c,'SmsQueueId':_0x1b6f6c['id']});});});});});});})['then'](respondWithStatusCode(_0x59a5f4,null))[_0x6eec('0x46')](handleError(_0x59a5f4,null));};exports['addAgents']=function(_0x391398,_0x249b8d,_0x5cf5d3){return db[_0x6eec('0x3e')]['find']({'where':{'id':_0x391398[_0x6eec('0x42')]['id']}})[_0x6eec('0x21')](handleEntityNotFound(_0x249b8d,null))['then'](function(_0x1d959d){if(_0x1d959d){return _0x1d959d[_0x6eec('0x7b')](_0x391398[_0x6eec('0x48')][_0x6eec('0x63')],_[_0x6eec('0x7c')](_0x391398[_0x6eec('0x48')],[_0x6eec('0x63'),'id'])||{})[_0x6eec('0x7d')](function(_0x305eb8){for(var _0x111597=0x0;_0x111597<_0x391398[_0x6eec('0x48')][_0x6eec('0x63')][_0x6eec('0x43')];_0x111597+=0x1){socket['emit'](_0x6eec('0x6c'),{'UserId':Number(_0x391398[_0x6eec('0x48')][_0x6eec('0x63')][_0x111597]),'SmsQueueId':Number(_0x391398[_0x6eec('0x42')]['id'])});}return _0x305eb8;});}})[_0x6eec('0x21')](respondWithResult(_0x249b8d,null))[_0x6eec('0x46')](handleError(_0x249b8d,null));};exports['removeAgents']=function(_0x5e3e79,_0x4071ec,_0x23a07c){return db[_0x6eec('0x3e')][_0x6eec('0x45')]({'where':{'id':_0x5e3e79['params']['id']}})[_0x6eec('0x21')](handleEntityNotFound(_0x4071ec,null))[_0x6eec('0x21')](function(_0x48f7af){if(_0x48f7af){return _0x48f7af['removeAgents'](_0x5e3e79[_0x6eec('0x2d')][_0x6eec('0x63')])['then'](function(){if(_[_0x6eec('0x7e')](_0x5e3e79[_0x6eec('0x2d')]['ids'])){for(var _0x1234d4=0x0;_0x1234d4<_0x5e3e79[_0x6eec('0x2d')][_0x6eec('0x63')]['length'];_0x1234d4+=0x1){socket[_0x6eec('0x7a')](_0x6eec('0x7f'),{'UserId':Number(_0x5e3e79['query'][_0x6eec('0x63')][_0x1234d4]),'SmsQueueId':Number(_0x5e3e79[_0x6eec('0x42')]['id'])});}}else{socket[_0x6eec('0x7a')](_0x6eec('0x7f'),{'UserId':Number(_0x5e3e79[_0x6eec('0x2d')][_0x6eec('0x63')]),'SmsQueueId':Number(_0x5e3e79[_0x6eec('0x42')]['id'])});}});}})['then'](respondWithStatusCode(_0x4071ec,null))[_0x6eec('0x46')](handleError(_0x4071ec,null));};exports['getAgents']=function(_0x2a0fc3,_0x217a43,_0x38d04c){var _0x202499={};var _0x1685db={};var _0x18e978;var _0x521a4e;return db['SmsQueue']['findOne']({'where':{'id':_0x2a0fc3[_0x6eec('0x42')]['id']}})['then'](handleEntityNotFound(_0x217a43,null))['then'](function(_0x5f0b49){if(_0x5f0b49){_0x18e978=_0x5f0b49;_0x1685db['model']=_[_0x6eec('0x2e')](db['User'][_0x6eec('0x29')]);_0x1685db[_0x6eec('0x2d')]=_[_0x6eec('0x2e')](_0x2a0fc3[_0x6eec('0x2d')]);_0x1685db['filters']=_[_0x6eec('0x30')](_0x1685db[_0x6eec('0x31')],_0x1685db[_0x6eec('0x2d')]);_0x202499['attributes']=_[_0x6eec('0x30')](_0x1685db[_0x6eec('0x31')],qs[_0x6eec('0x32')](_0x2a0fc3['query']['fields']));_0x202499[_0x6eec('0x33')]=_0x202499[_0x6eec('0x33')][_0x6eec('0x43')]?_0x202499['attributes']:_0x1685db[_0x6eec('0x31')];_0x202499['order']=qs[_0x6eec('0x37')](_0x2a0fc3[_0x6eec('0x2d')][_0x6eec('0x37')]);_0x202499[_0x6eec('0x38')]=qs[_0x6eec('0x2f')](_[_0x6eec('0x39')](_0x2a0fc3['query'],_0x1685db['filters']));if(_0x2a0fc3['query'][_0x6eec('0x3c')]){_0x202499[_0x6eec('0x38')]=_[_0x6eec('0x3a')](_0x202499['where'],{'$or':_[_0x6eec('0x28')](_0x202499[_0x6eec('0x33')],function(_0x731c05){var _0x3dc666={};_0x3dc666[_0x731c05]={'$like':'%'+_0x2a0fc3[_0x6eec('0x2d')][_0x6eec('0x3c')]+'%'};return _0x3dc666;})});}_0x202499=_[_0x6eec('0x3a')]({},_0x202499,_0x2a0fc3[_0x6eec('0x3d')]);return _0x18e978[_0x6eec('0x80')](_0x202499);}})[_0x6eec('0x21')](function(_0x14dc3a){if(_0x14dc3a){_0x521a4e=_0x14dc3a[_0x6eec('0x43')];if(!_0x2a0fc3[_0x6eec('0x2d')][_0x6eec('0x34')]('nolimit')){_0x202499[_0x6eec('0x1e')]=qs['limit'](_0x2a0fc3[_0x6eec('0x2d')]['limit']);_0x202499[_0x6eec('0x1c')]=qs['offset'](_0x2a0fc3[_0x6eec('0x2d')][_0x6eec('0x1c')]);}return _0x18e978['getAgents'](_0x202499);}})[_0x6eec('0x21')](function(_0x21fcdd){if(_0x21fcdd){return _0x21fcdd?{'count':_0x521a4e,'rows':_0x21fcdd}:null;}})[_0x6eec('0x21')](respondWithResult(_0x217a43,null))[_0x6eec('0x46')](handleError(_0x217a43,null));}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.events.js b/server/api/smsQueue/smsQueue.events.js index bc8e66d..7d71f2b 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 _0xe926=['hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners','save','update','remove','emit'];(function(_0x2f6e8a,_0x54fe4f){var _0x1bffd2=function(_0x5b1b73){while(--_0x5b1b73){_0x2f6e8a['push'](_0x2f6e8a['shift']());}};_0x1bffd2(++_0x54fe4f);}(_0xe926,0xb7));var _0x6e92=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0xe926[_0x126558];return _0x1f6d14;};'use strict';var EventEmitter=require(_0x6e92('0x0'));var SmsQueue=require(_0x6e92('0x1'))['db']['SmsQueue'];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0x6e92('0x2')](0x0);var events={'afterCreate':_0x6e92('0x3'),'afterUpdate':_0x6e92('0x4'),'afterDestroy':_0x6e92('0x5')};function emitEvent(_0xc6a6f9){return function(_0x2a00be,_0x4990a4,_0x5e6b14){SmsQueueEvents[_0x6e92('0x6')](_0xc6a6f9+':'+_0x2a00be['id'],_0x2a00be);SmsQueueEvents[_0x6e92('0x6')](_0xc6a6f9,_0x2a00be);_0x5e6b14(null);};}for(var e in events){if(events[_0x6e92('0x7')](e)){var event=events[e];SmsQueue[_0x6e92('0x8')](e,emitEvent(event));}}module[_0x6e92('0x9')]=SmsQueueEvents; \ No newline at end of file +var _0xb449=['hook','exports','events','SmsQueue','save','update','remove','emit','hasOwnProperty'];(function(_0x1e4f2f,_0x35edfa){var _0xccea89=function(_0x164386){while(--_0x164386){_0x1e4f2f['push'](_0x1e4f2f['shift']());}};_0xccea89(++_0x35edfa);}(_0xb449,0x14f));var _0x9b44=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb449[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0x9b44('0x0'));var SmsQueue=require('../../mysqldb')['db'][_0x9b44('0x1')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x9b44('0x2'),'afterUpdate':_0x9b44('0x3'),'afterDestroy':_0x9b44('0x4')};function emitEvent(_0x3ce79c){return function(_0x1c7648,_0x5093cd,_0x46a4e5){SmsQueueEvents['emit'](_0x3ce79c+':'+_0x1c7648['id'],_0x1c7648);SmsQueueEvents[_0x9b44('0x5')](_0x3ce79c,_0x1c7648);_0x46a4e5(null);};}for(var e in events){if(events[_0x9b44('0x6')](e)){var event=events[e];SmsQueue[_0x9b44('0x7')](e,emitEvent(event));}}module[_0x9b44('0x8')]=SmsQueueEvents; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.model.js b/server/api/smsQueue/smsQueue.model.js index 3be3ab2..3480555 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 _0xf2bb=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./smsQueue.attributes','exports','define','sms_queues'];(function(_0x3d2d14,_0x1b6351){var _0x2491d0=function(_0x13cce6){while(--_0x13cce6){_0x3d2d14['push'](_0x3d2d14['shift']());}};_0x2491d0(++_0x1b6351);}(_0xf2bb,0xd2));var _0xbf2b=function(_0x50a0c2,_0x4befab){_0x50a0c2=_0x50a0c2-0x0;var _0x5ebadd=_0xf2bb[_0x50a0c2];return _0x5ebadd;};'use strict';var _=require(_0xbf2b('0x0'));var util=require(_0xbf2b('0x1'));var logger=require(_0xbf2b('0x2'))(_0xbf2b('0x3'));var moment=require(_0xbf2b('0x4'));var BPromise=require(_0xbf2b('0x5'));var rp=require(_0xbf2b('0x6'));var fs=require('fs');var path=require(_0xbf2b('0x7'));var rimraf=require(_0xbf2b('0x8'));var config=require(_0xbf2b('0x9'));var attributes=require(_0xbf2b('0xa'));module[_0xbf2b('0xb')]=function(_0x2d7963,_0x852013){return _0x2d7963[_0xbf2b('0xc')]('SmsQueue',attributes,{'tableName':_0xbf2b('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xeda5=['request-promise','rimraf','./smsQueue.attributes','exports','define','sms_queues','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0xda464c,_0x26e47d){var _0x19e222=function(_0x1ec605){while(--_0x1ec605){_0xda464c['push'](_0xda464c['shift']());}};_0x19e222(++_0x26e47d);}(_0xeda5,0x11a));var _0x5eda=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xeda5[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x5eda('0x0'));var util=require(_0x5eda('0x1'));var logger=require(_0x5eda('0x2'))(_0x5eda('0x3'));var moment=require(_0x5eda('0x4'));var BPromise=require(_0x5eda('0x5'));var rp=require(_0x5eda('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5eda('0x7'));var config=require('../../config/environment');var attributes=require(_0x5eda('0x8'));module[_0x5eda('0x9')]=function(_0xfb2c8f,_0x23f3cc){return _0xfb2c8f[_0x5eda('0xa')]('SmsQueue',attributes,{'tableName':_0x5eda('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.rpc.js b/server/api/smsQueue/smsQueue.rpc.js index f78f80f..10faa8b 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 _0x2913=['find','raw','stringify','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','redis','defaults','localhost','register','request','then','info','SmsQueue,\x20%s,\x20%s','debug','request\x20sent','error','code','message','GetSmsQueue','SmsQueue','findAll','options','limit','include','model','attributes','map','catch','ShowSmsQueue'];(function(_0x4ec22c,_0x33e5a0){var _0x1ab28e=function(_0x82fc57){while(--_0x82fc57){_0x4ec22c['push'](_0x4ec22c['shift']());}};_0x1ab28e(++_0x33e5a0);}(_0x2913,0x9b));var _0x3291=function(_0x120ffc,_0x3f3bd1){_0x120ffc=_0x120ffc-0x0;var _0x363f7f=_0x2913[_0x120ffc];return _0x363f7f;};'use strict';var _=require('lodash');var util=require(_0x3291('0x0'));var moment=require(_0x3291('0x1'));var BPromise=require(_0x3291('0x2'));var rs=require(_0x3291('0x3'));var fs=require('fs');var Redis=require(_0x3291('0x4'));var db=require(_0x3291('0x5'))['db'];var utils=require(_0x3291('0x6'));var logger=require(_0x3291('0x7'))(_0x3291('0x8'));var config=require('../../config/environment');var jayson=require(_0x3291('0x9'));var client=jayson['client'][_0x3291('0xa')]({'port':0x232a});config[_0x3291('0xb')]=_[_0x3291('0xc')](config[_0x3291('0xb')],{'host':_0x3291('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./smsQueue.socket')[_0x3291('0xe')](socket);function respondWithRpcPromise(_0x33166d,_0x10ad0c,_0x58a5d3){return new BPromise(function(_0x191ebc,_0x461d59){return client[_0x3291('0xf')](_0x33166d,_0x58a5d3)[_0x3291('0x10')](function(_0x5e0230){logger[_0x3291('0x11')](_0x3291('0x12'),_0x10ad0c,'request\x20sent');logger[_0x3291('0x13')]('SmsQueue,\x20%s,\x20%s,\x20%s',_0x10ad0c,_0x3291('0x14'),JSON['stringify'](_0x5e0230));if(_0x5e0230['error']){if(_0x5e0230[_0x3291('0x15')][_0x3291('0x16')]===0x1f4){logger[_0x3291('0x15')](_0x3291('0x12'),_0x10ad0c,_0x5e0230[_0x3291('0x15')]['message']);return _0x461d59(_0x5e0230[_0x3291('0x15')][_0x3291('0x17')]);}logger['error'](_0x3291('0x12'),_0x10ad0c,_0x5e0230[_0x3291('0x15')][_0x3291('0x17')]);return _0x191ebc(_0x5e0230[_0x3291('0x15')][_0x3291('0x17')]);}else{logger[_0x3291('0x11')]('SmsQueue,\x20%s,\x20%s',_0x10ad0c,_0x3291('0x14'));_0x191ebc(_0x5e0230['result']['message']);}})['catch'](function(_0x5ef715){logger[_0x3291('0x15')]('SmsQueue,\x20%s,\x20%s',_0x10ad0c,_0x5ef715);_0x461d59(_0x5ef715);});});}exports[_0x3291('0x18')]=function(_0x25ae29){var _0x157cd3=this;return new Promise(function(_0x8d8897,_0x5e9c42){return db[_0x3291('0x19')][_0x3291('0x1a')]({'raw':_0x25ae29[_0x3291('0x1b')]?_0x25ae29[_0x3291('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x25ae29[_0x3291('0x1b')]?_0x25ae29[_0x3291('0x1b')]['where']||null:null,'attributes':_0x25ae29['options']?_0x25ae29['options']['attributes']||null:null,'limit':_0x25ae29[_0x3291('0x1b')]?_0x25ae29[_0x3291('0x1b')][_0x3291('0x1c')]||null:null,'include':_0x25ae29[_0x3291('0x1b')]?_0x25ae29[_0x3291('0x1b')][_0x3291('0x1d')]?_['map'](_0x25ae29[_0x3291('0x1b')]['include'],function(_0x2154a7){return{'model':db[_0x2154a7[_0x3291('0x1e')]],'as':_0x2154a7['as'],'attributes':_0x2154a7[_0x3291('0x1f')],'include':_0x2154a7['include']?_[_0x3291('0x20')](_0x2154a7['include'],function(_0x344f7e){return{'model':db[_0x344f7e[_0x3291('0x1e')]],'as':_0x344f7e['as'],'attributes':_0x344f7e[_0x3291('0x1f')],'include':_0x344f7e[_0x3291('0x1d')]?_[_0x3291('0x20')](_0x344f7e[_0x3291('0x1d')],function(_0x2fbeb8){return{'model':db[_0x2fbeb8[_0x3291('0x1e')]],'as':_0x2fbeb8['as'],'attributes':_0x2fbeb8['attributes']};}):[]};}):[]};}):[]:[]})[_0x3291('0x10')](function(_0x395a16){logger[_0x3291('0x11')](_0x3291('0x18'),_0x25ae29);logger[_0x3291('0x13')](_0x3291('0x18'),_0x25ae29,JSON['stringify'](_0x395a16));_0x8d8897(_0x395a16);})[_0x3291('0x21')](function(_0x8c23ef){logger[_0x3291('0x15')]('GetSmsQueue',_0x8c23ef[_0x3291('0x17')],_0x25ae29);_0x5e9c42(_0x157cd3[_0x3291('0x15')](0x1f4,_0x8c23ef[_0x3291('0x17')]));});});};exports[_0x3291('0x22')]=function(_0x9e9fac){var _0x11c7cd=this;return new Promise(function(_0x5398bf,_0x33810b){return db[_0x3291('0x19')][_0x3291('0x23')]({'raw':_0x9e9fac[_0x3291('0x1b')]?_0x9e9fac['options'][_0x3291('0x24')]===undefined?!![]:![]:!![],'where':_0x9e9fac['options']?_0x9e9fac['options']['where']||null:null,'attributes':_0x9e9fac[_0x3291('0x1b')]?_0x9e9fac[_0x3291('0x1b')][_0x3291('0x1f')]||null:null,'include':_0x9e9fac['options']?_0x9e9fac['options'][_0x3291('0x1d')]?_[_0x3291('0x20')](_0x9e9fac['options']['include'],function(_0x1c097d){return{'model':db[_0x1c097d[_0x3291('0x1e')]],'as':_0x1c097d['as'],'attributes':_0x1c097d[_0x3291('0x1f')],'include':_0x1c097d[_0x3291('0x1d')]?_['map'](_0x1c097d[_0x3291('0x1d')],function(_0x5e223c){return{'model':db[_0x5e223c['model']],'as':_0x5e223c['as'],'attributes':_0x5e223c[_0x3291('0x1f')],'include':_0x5e223c[_0x3291('0x1d')]?_[_0x3291('0x20')](_0x5e223c[_0x3291('0x1d')],function(_0x43d704){return{'model':db[_0x43d704[_0x3291('0x1e')]],'as':_0x43d704['as'],'attributes':_0x43d704[_0x3291('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x3291('0x10')](function(_0x332920){logger[_0x3291('0x11')](_0x3291('0x22'),_0x9e9fac);logger[_0x3291('0x13')]('ShowSmsQueue',_0x9e9fac,JSON[_0x3291('0x25')](_0x332920));_0x5398bf(_0x332920);})[_0x3291('0x21')](function(_0x50307c){logger[_0x3291('0x15')](_0x3291('0x22'),_0x50307c[_0x3291('0x17')],_0x9e9fac);_0x33810b(_0x11c7cd[_0x3291('0x15')](0x1f4,_0x50307c[_0x3291('0x17')]));});});}; \ No newline at end of file +var _0x6a48=['client','redis','defaults','localhost','register','request','then','SmsQueue,\x20%s,\x20%s','SmsQueue,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','info','result','catch','GetSmsQueue','findAll','options','where','attributes','limit','map','include','model','debug','stringify','SmsQueue','find','ShowSmsQueue','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise'];(function(_0x46d7d8,_0x2e7e34){var _0x141154=function(_0x45bf4e){while(--_0x45bf4e){_0x46d7d8['push'](_0x46d7d8['shift']());}};_0x141154(++_0x2e7e34);}(_0x6a48,0x1ae));var _0x86a4=function(_0x5e79a0,_0x1a7a77){_0x5e79a0=_0x5e79a0-0x0;var _0x3ce239=_0x6a48[_0x5e79a0];return _0x3ce239;};'use strict';var _=require(_0x86a4('0x0'));var util=require(_0x86a4('0x1'));var moment=require(_0x86a4('0x2'));var BPromise=require('bluebird');var rs=require(_0x86a4('0x3'));var fs=require('fs');var Redis=require(_0x86a4('0x4'));var db=require(_0x86a4('0x5'))['db'];var utils=require(_0x86a4('0x6'));var logger=require(_0x86a4('0x7'))('rpc');var config=require(_0x86a4('0x8'));var jayson=require(_0x86a4('0x9'));var client=jayson[_0x86a4('0xa')]['http']({'port':0x232a});config[_0x86a4('0xb')]=_[_0x86a4('0xc')](config[_0x86a4('0xb')],{'host':_0x86a4('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x86a4('0xb')]));require('./smsQueue.socket')[_0x86a4('0xe')](socket);function respondWithRpcPromise(_0xea78dd,_0x2d41f7,_0x5d2c53){return new BPromise(function(_0x48b6c6,_0x18edc1){return client[_0x86a4('0xf')](_0xea78dd,_0x5d2c53)[_0x86a4('0x10')](function(_0x4e05c4){logger['info'](_0x86a4('0x11'),_0x2d41f7,'request\x20sent');logger['debug'](_0x86a4('0x12'),_0x2d41f7,_0x86a4('0x13'),JSON['stringify'](_0x4e05c4));if(_0x4e05c4[_0x86a4('0x14')]){if(_0x4e05c4[_0x86a4('0x14')][_0x86a4('0x15')]===0x1f4){logger['error'](_0x86a4('0x11'),_0x2d41f7,_0x4e05c4[_0x86a4('0x14')]['message']);return _0x18edc1(_0x4e05c4['error'][_0x86a4('0x16')]);}logger[_0x86a4('0x14')](_0x86a4('0x11'),_0x2d41f7,_0x4e05c4[_0x86a4('0x14')][_0x86a4('0x16')]);return _0x48b6c6(_0x4e05c4[_0x86a4('0x14')][_0x86a4('0x16')]);}else{logger[_0x86a4('0x17')](_0x86a4('0x11'),_0x2d41f7,_0x86a4('0x13'));_0x48b6c6(_0x4e05c4[_0x86a4('0x18')][_0x86a4('0x16')]);}})[_0x86a4('0x19')](function(_0x2f7a27){logger['error']('SmsQueue,\x20%s,\x20%s',_0x2d41f7,_0x2f7a27);_0x18edc1(_0x2f7a27);});});}exports[_0x86a4('0x1a')]=function(_0x3e3eaf){var _0x32fc32=this;return new Promise(function(_0x289803,_0x14bf5b){return db['SmsQueue'][_0x86a4('0x1b')]({'raw':_0x3e3eaf['options']?_0x3e3eaf[_0x86a4('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x3e3eaf['options']?_0x3e3eaf['options'][_0x86a4('0x1d')]||null:null,'attributes':_0x3e3eaf[_0x86a4('0x1c')]?_0x3e3eaf['options'][_0x86a4('0x1e')]||null:null,'limit':_0x3e3eaf['options']?_0x3e3eaf[_0x86a4('0x1c')][_0x86a4('0x1f')]||null:null,'include':_0x3e3eaf[_0x86a4('0x1c')]?_0x3e3eaf[_0x86a4('0x1c')]['include']?_[_0x86a4('0x20')](_0x3e3eaf['options'][_0x86a4('0x21')],function(_0x2c7c02){return{'model':db[_0x2c7c02[_0x86a4('0x22')]],'as':_0x2c7c02['as'],'attributes':_0x2c7c02[_0x86a4('0x1e')],'include':_0x2c7c02[_0x86a4('0x21')]?_[_0x86a4('0x20')](_0x2c7c02['include'],function(_0x53f4a4){return{'model':db[_0x53f4a4[_0x86a4('0x22')]],'as':_0x53f4a4['as'],'attributes':_0x53f4a4[_0x86a4('0x1e')],'include':_0x53f4a4['include']?_[_0x86a4('0x20')](_0x53f4a4[_0x86a4('0x21')],function(_0x505606){return{'model':db[_0x505606['model']],'as':_0x505606['as'],'attributes':_0x505606['attributes']};}):[]};}):[]};}):[]:[]})[_0x86a4('0x10')](function(_0x4541a9){logger[_0x86a4('0x17')](_0x86a4('0x1a'),_0x3e3eaf);logger[_0x86a4('0x23')](_0x86a4('0x1a'),_0x3e3eaf,JSON[_0x86a4('0x24')](_0x4541a9));_0x289803(_0x4541a9);})[_0x86a4('0x19')](function(_0x31b009){logger['error'](_0x86a4('0x1a'),_0x31b009[_0x86a4('0x16')],_0x3e3eaf);_0x14bf5b(_0x32fc32['error'](0x1f4,_0x31b009[_0x86a4('0x16')]));});});};exports['ShowSmsQueue']=function(_0x393b19){var _0xb9446a=this;return new Promise(function(_0x2b0ee1,_0x5f1754){return db[_0x86a4('0x25')][_0x86a4('0x26')]({'raw':_0x393b19[_0x86a4('0x1c')]?_0x393b19[_0x86a4('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x393b19['options']?_0x393b19[_0x86a4('0x1c')][_0x86a4('0x1d')]||null:null,'attributes':_0x393b19[_0x86a4('0x1c')]?_0x393b19[_0x86a4('0x1c')][_0x86a4('0x1e')]||null:null,'include':_0x393b19[_0x86a4('0x1c')]?_0x393b19[_0x86a4('0x1c')][_0x86a4('0x21')]?_['map'](_0x393b19['options'][_0x86a4('0x21')],function(_0x1a4a0e){return{'model':db[_0x1a4a0e['model']],'as':_0x1a4a0e['as'],'attributes':_0x1a4a0e[_0x86a4('0x1e')],'include':_0x1a4a0e[_0x86a4('0x21')]?_[_0x86a4('0x20')](_0x1a4a0e[_0x86a4('0x21')],function(_0xec707d){return{'model':db[_0xec707d[_0x86a4('0x22')]],'as':_0xec707d['as'],'attributes':_0xec707d[_0x86a4('0x1e')],'include':_0xec707d[_0x86a4('0x21')]?_[_0x86a4('0x20')](_0xec707d[_0x86a4('0x21')],function(_0x26e722){return{'model':db[_0x26e722['model']],'as':_0x26e722['as'],'attributes':_0x26e722['attributes']};}):[]};}):[]};}):[]:[]})[_0x86a4('0x10')](function(_0x2187fd){logger['info'](_0x86a4('0x27'),_0x393b19);logger['debug']('ShowSmsQueue',_0x393b19,JSON[_0x86a4('0x24')](_0x2187fd));_0x2b0ee1(_0x2187fd);})[_0x86a4('0x19')](function(_0x1fad95){logger[_0x86a4('0x14')]('ShowSmsQueue',_0x1fad95[_0x86a4('0x16')],_0x393b19);_0x5f1754(_0xb9446a['error'](0x1f4,_0x1fad95[_0x86a4('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.socket.js b/server/api/smsQueue/smsQueue.socket.js index 7981a0f..4a5a0cd 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 _0xe1ab=['removeListener','length','remove','update','emit'];(function(_0x3e8431,_0xbc6948){var _0x47d8a1=function(_0x4ee19c){while(--_0x4ee19c){_0x3e8431['push'](_0x3e8431['shift']());}};_0x47d8a1(++_0xbc6948);}(_0xe1ab,0x174));var _0xbe1a=function(_0x1cb18a,_0x33167a){_0x1cb18a=_0x1cb18a-0x0;var _0x22442e=_0xe1ab[_0x1cb18a];return _0x22442e;};'use strict';var SmsQueueEvents=require('./smsQueue.events');var events=['save',_0xbe1a('0x0'),_0xbe1a('0x1')];function createListener(_0x38bb71,_0x3c426a){return function(_0x11b2bd){_0x3c426a[_0xbe1a('0x2')](_0x38bb71,_0x11b2bd);};}function removeListener(_0xdcf6a5,_0x33f021){return function(){SmsQueueEvents[_0xbe1a('0x3')](_0xdcf6a5,_0x33f021);};}exports['register']=function(_0x47f476){for(var _0x2c8ff4=0x0,_0x30c8f9=events[_0xbe1a('0x4')];_0x2c8ff4<_0x30c8f9;_0x2c8ff4++){var _0x2f90be=events[_0x2c8ff4];var _0x29cd99=createListener('smsQueue:'+_0x2f90be,_0x47f476);SmsQueueEvents['on'](_0x2f90be,_0x29cd99);}}; \ No newline at end of file +var _0x4366=['register','smsQueue:','./smsQueue.events','save','removeListener'];(function(_0x3520e5,_0x2d6c0c){var _0x3697bd=function(_0x8e2aff){while(--_0x8e2aff){_0x3520e5['push'](_0x3520e5['shift']());}};_0x3697bd(++_0x2d6c0c);}(_0x4366,0x9d));var _0x6436=function(_0x39cc43,_0x2e6319){_0x39cc43=_0x39cc43-0x0;var _0x2fef65=_0x4366[_0x39cc43];return _0x2fef65;};'use strict';var SmsQueueEvents=require(_0x6436('0x0'));var events=[_0x6436('0x1'),'remove','update'];function createListener(_0x5dbfbe,_0x4f3893){return function(_0x1c81b1){_0x4f3893['emit'](_0x5dbfbe,_0x1c81b1);};}function removeListener(_0x1035e1,_0x41a1bb){return function(){SmsQueueEvents[_0x6436('0x2')](_0x1035e1,_0x41a1bb);};}exports[_0x6436('0x3')]=function(_0x570dea){for(var _0x4a98b2=0x0,_0xe1e1b9=events['length'];_0x4a98b2<_0xe1e1b9;_0x4a98b2++){var _0xbb1c04=events[_0x4a98b2];var _0x31d7ce=createListener(_0x6436('0x4')+_0xbb1c04,_0x570dea);SmsQueueEvents['on'](_0xbb1c04,_0x31d7ce);}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/index.js b/server/api/smsQueueReport/index.js index 53820e7..bd0445f 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 _0x2984=['../../config/environment','./smsQueueReport.controller','get','isAuthenticated','/describe','describe','/:id','show','create','put','update','destroy','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service'];(function(_0x2ed124,_0x262d2a){var _0x2e1e47=function(_0x4c4f08){while(--_0x4c4f08){_0x2ed124['push'](_0x2ed124['shift']());}};_0x2e1e47(++_0x262d2a);}(_0x2984,0xae));var _0x4298=function(_0x4b5815,_0x44fb95){_0x4b5815=_0x4b5815-0x0;var _0x58634a=_0x2984[_0x4b5815];return _0x58634a;};'use strict';var multer=require('multer');var util=require(_0x4298('0x0'));var path=require(_0x4298('0x1'));var timeout=require(_0x4298('0x2'));var express=require('express');var router=express[_0x4298('0x3')]();var fs_extra=require(_0x4298('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x4298('0x5'));var config=require(_0x4298('0x6'));var controller=require(_0x4298('0x7'));router[_0x4298('0x8')]('/',auth[_0x4298('0x9')](),controller['index']);router[_0x4298('0x8')](_0x4298('0xa'),auth[_0x4298('0x9')](),controller[_0x4298('0xb')]);router[_0x4298('0x8')](_0x4298('0xc'),auth[_0x4298('0x9')](),controller[_0x4298('0xd')]);router['post']('/',auth[_0x4298('0x9')](),controller[_0x4298('0xe')]);router[_0x4298('0xf')](_0x4298('0xc'),auth['isAuthenticated'](),controller[_0x4298('0x10')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x4298('0x11')]);module['exports']=router; \ No newline at end of file +var _0x7610=['put','delete','destroy','multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../config/environment','./smsQueueReport.controller','isAuthenticated','get','/describe','describe','/:id','show','create'];(function(_0x99f838,_0xe376e2){var _0x432cd7=function(_0x2cd5dc){while(--_0x2cd5dc){_0x99f838['push'](_0x99f838['shift']());}};_0x432cd7(++_0xe376e2);}(_0x7610,0x123));var _0x0761=function(_0x55dd18,_0xdb250){_0x55dd18=_0x55dd18-0x0;var _0x1b48fd=_0x7610[_0x55dd18];return _0x1b48fd;};'use strict';var multer=require(_0x0761('0x0'));var util=require(_0x0761('0x1'));var path=require(_0x0761('0x2'));var timeout=require(_0x0761('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x0761('0x4'));var auth=require(_0x0761('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x0761('0x6'));var controller=require(_0x0761('0x7'));router['get']('/',auth[_0x0761('0x8')](),controller['index']);router[_0x0761('0x9')](_0x0761('0xa'),auth['isAuthenticated'](),controller[_0x0761('0xb')]);router[_0x0761('0x9')](_0x0761('0xc'),auth['isAuthenticated'](),controller[_0x0761('0xd')]);router['post']('/',auth['isAuthenticated'](),controller[_0x0761('0xe')]);router[_0x0761('0xf')]('/:id',auth[_0x0761('0x8')](),controller['update']);router[_0x0761('0x10')](_0x0761('0xc'),auth[_0x0761('0x8')](),controller[_0x0761('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.attributes.js b/server/api/smsQueueReport/smsQueueReport.attributes.js index eb74d18..7a1c784 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 _0x9e94=['STRING','DATE','exports'];(function(_0x24354d,_0x315e4d){var _0x49132f=function(_0x2c7e97){while(--_0x2c7e97){_0x24354d['push'](_0x24354d['shift']());}};_0x49132f(++_0x315e4d);}(_0x9e94,0xe0));var _0x49e9=function(_0x585e40,_0x4c4c5a){_0x585e40=_0x585e40-0x0;var _0x4cc87a=_0x9e94[_0x585e40];return _0x4cc87a;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x49e9('0x0')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0x49e9('0x1')]},'joinAt':{'type':Sequelize[_0x49e9('0x2')]},'leaveAt':{'type':Sequelize[_0x49e9('0x2')]},'acceptAt':{'type':Sequelize[_0x49e9('0x2')]},'exitAt':{'type':Sequelize[_0x49e9('0x2')]},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x7a7d=['DATE','sequelize','exports','STRING'];(function(_0x19d350,_0x3c843f){var _0x3bfc8d=function(_0xd89003){while(--_0xd89003){_0x19d350['push'](_0x19d350['shift']());}};_0x3bfc8d(++_0x3c843f);}(_0x7a7d,0x165));var _0xd7a7=function(_0x22c242,_0x413842){_0x22c242=_0x22c242-0x0;var _0x1cf587=_0x7a7d[_0x22c242];return _0x1cf587;};'use strict';var moment=require('moment');var Sequelize=require(_0xd7a7('0x0'));module[_0xd7a7('0x1')]={'uniqueid':{'type':Sequelize[_0xd7a7('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0xd7a7('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0xd7a7('0x3')]},'acceptAt':{'type':Sequelize[_0xd7a7('0x3')]},'exitAt':{'type':Sequelize[_0xd7a7('0x3')]},'reason':{'type':Sequelize[_0xd7a7('0x2')]}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.controller.js b/server/api/smsQueueReport/smsQueueReport.controller.js index b080dd3..6a739c3 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 _0x8724=['key','model','query','keys','intersection','attributes','fields','length','nolimit','sort','filter','where','VIRTUAL','merge','includeAll','include','rows','show','params','find','catch','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','undefined','limit','count','set','Content-Range','reject','save','update','destroy','then','stack','name','send','index','map','SmsQueueReport','rawAttributes','fieldName','type'];(function(_0x413feb,_0x10477f){var _0x40ee88=function(_0x32a3f6){while(--_0x32a3f6){_0x413feb['push'](_0x413feb['shift']());}};_0x40ee88(++_0x10477f);}(_0x8724,0x138));var _0x4872=function(_0x1a12ea,_0x33f4cd){_0x1a12ea=_0x1a12ea-0x0;var _0x2f26de=_0x8724[_0x1a12ea];return _0x2f26de;};'use strict';var emlformat=require(_0x4872('0x0'));var rimraf=require(_0x4872('0x1'));var zipdir=require(_0x4872('0x2'));var jsonpatch=require(_0x4872('0x3'));var rp=require(_0x4872('0x4'));var moment=require(_0x4872('0x5'));var BPromise=require(_0x4872('0x6'));var Mustache=require('mustache');var util=require(_0x4872('0x7'));var path=require(_0x4872('0x8'));var sox=require(_0x4872('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4872('0xa'));var _=require(_0x4872('0xb'));var squel=require('squel');var crypto=require(_0x4872('0xc'));var jsforce=require(_0x4872('0xd'));var deskjs=require(_0x4872('0xe'));var toCsv=require(_0x4872('0xf'));var querystring=require('querystring');var Papa=require(_0x4872('0x10'));var Redis=require(_0x4872('0x11'));var authService=require(_0x4872('0x12'));var qs=require(_0x4872('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4872('0x14'));var logger=require(_0x4872('0x15'))(_0x4872('0x16'));var utils=require(_0x4872('0x17'));var config=require(_0x4872('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x573bac,_0x251ce1){_0x251ce1=_0x251ce1||0xcc;return function(_0x5ef272){if(_0x5ef272){return _0x573bac[_0x4872('0x19')](_0x251ce1);}return _0x573bac[_0x4872('0x1a')](_0x251ce1)[_0x4872('0x1b')]();};}function respondWithResult(_0x25fe57,_0x2aef1b){_0x2aef1b=_0x2aef1b||0xc8;return function(_0x5d9390){if(_0x5d9390){return _0x25fe57[_0x4872('0x1a')](_0x2aef1b)[_0x4872('0x1c')](_0x5d9390);}};}function respondWithFilteredResult(_0x4d40b8,_0x3dc32a){return function(_0x1ed312){if(_0x1ed312){var _0x3ed722=typeof _0x3dc32a['offset']===_0x4872('0x1d')&&typeof _0x3dc32a[_0x4872('0x1e')]===_0x4872('0x1d');var _0x210ec5=_0x1ed312[_0x4872('0x1f')];var _0xbd272c=_0x3ed722?0x0:_0x3dc32a['offset'];var _0x2d0c62=_0x3ed722?_0x1ed312[_0x4872('0x1f')]:_0x3dc32a['offset']+_0x3dc32a['limit'];var _0x337777;if(_0x2d0c62>=_0x210ec5){_0x2d0c62=_0x210ec5;_0x337777=0xc8;}else{_0x337777=0xce;}_0x4d40b8[_0x4872('0x1a')](_0x337777);return _0x4d40b8[_0x4872('0x20')](_0x4872('0x21'),_0xbd272c+'-'+_0x2d0c62+'/'+_0x210ec5)['json'](_0x1ed312);}return null;};}function patchUpdates(_0x6a1b7d){return function(_0x1cf7c5){try{jsonpatch['apply'](_0x1cf7c5,_0x6a1b7d,!![]);}catch(_0x267f93){return BPromise[_0x4872('0x22')](_0x267f93);}return _0x1cf7c5[_0x4872('0x23')]();};}function saveUpdates(_0x51ac34,_0x5264cc){return function(_0x2a1093){if(_0x2a1093){return _0x2a1093[_0x4872('0x24')](_0x51ac34)['then'](function(_0x4bbebb){return _0x4bbebb;});}return null;};}function removeEntity(_0x20fd39,_0xede354){return function(_0x6e8c45){if(_0x6e8c45){return _0x6e8c45[_0x4872('0x25')]()[_0x4872('0x26')](function(){_0x20fd39[_0x4872('0x1a')](0xcc)[_0x4872('0x1b')]();});}};}function handleEntityNotFound(_0x191698,_0x2b6b7f){return function(_0x185cdf){if(!_0x185cdf){_0x191698['sendStatus'](0x194);}return _0x185cdf;};}function handleError(_0x5f06dd,_0x30c395){_0x30c395=_0x30c395||0x1f4;return function(_0x437214){logger['error'](_0x437214[_0x4872('0x27')]);if(_0x437214[_0x4872('0x28')]){delete _0x437214['name'];}_0x5f06dd[_0x4872('0x1a')](_0x30c395)[_0x4872('0x29')](_0x437214);};}exports[_0x4872('0x2a')]=function(_0x17143b,_0x34e4b4){var _0x230d88={},_0x545734={},_0x271db7={'count':0x0,'rows':[]};var _0x42e2af=_[_0x4872('0x2b')](db[_0x4872('0x2c')][_0x4872('0x2d')],function(_0x198584){return{'name':_0x198584[_0x4872('0x2e')],'type':_0x198584[_0x4872('0x2f')][_0x4872('0x30')]};});_0x545734[_0x4872('0x31')]=_['map'](_0x42e2af,_0x4872('0x28'));_0x545734[_0x4872('0x32')]=_[_0x4872('0x33')](_0x17143b[_0x4872('0x32')]);_0x545734['filters']=_[_0x4872('0x34')](_0x545734['model'],_0x545734['query']);_0x230d88[_0x4872('0x35')]=_[_0x4872('0x34')](_0x545734['model'],qs[_0x4872('0x36')](_0x17143b[_0x4872('0x32')]['fields']));_0x230d88[_0x4872('0x35')]=_0x230d88[_0x4872('0x35')][_0x4872('0x37')]?_0x230d88[_0x4872('0x35')]:_0x545734['model'];if(!_0x17143b[_0x4872('0x32')]['hasOwnProperty'](_0x4872('0x38'))){_0x230d88['limit']=qs[_0x4872('0x1e')](_0x17143b['query'][_0x4872('0x1e')]);_0x230d88['offset']=qs['offset'](_0x17143b[_0x4872('0x32')]['offset']);}_0x230d88['order']=qs[_0x4872('0x39')](_0x17143b[_0x4872('0x32')][_0x4872('0x39')]);_0x230d88['where']=qs['filters'](_['pick'](_0x17143b[_0x4872('0x32')],_0x545734['filters']),_0x42e2af);if(_0x17143b['query'][_0x4872('0x3a')]){_0x230d88[_0x4872('0x3b')]=_['merge'](_0x230d88[_0x4872('0x3b')],{'$or':_[_0x4872('0x2b')](_0x42e2af,function(_0x4d33c2){if(_0x4d33c2[_0x4872('0x2f')]!==_0x4872('0x3c')){var _0x4c82cb={};_0x4c82cb[_0x4d33c2[_0x4872('0x28')]]={'$like':'%'+_0x17143b[_0x4872('0x32')][_0x4872('0x3a')]+'%'};return _0x4c82cb;}})});}_0x230d88=_[_0x4872('0x3d')]({},_0x230d88,_0x17143b['options']);var _0x144077={'where':_0x230d88['where']};return db[_0x4872('0x2c')][_0x4872('0x1f')](_0x144077)[_0x4872('0x26')](function(_0x3e72c3){_0x271db7['count']=_0x3e72c3;if(_0x17143b[_0x4872('0x32')][_0x4872('0x3e')]){_0x230d88[_0x4872('0x3f')]=[{'all':!![]}];}return db['SmsQueueReport']['findAll'](_0x230d88);})[_0x4872('0x26')](function(_0x4a2640){_0x271db7[_0x4872('0x40')]=_0x4a2640;return _0x271db7;})[_0x4872('0x26')](respondWithFilteredResult(_0x34e4b4,_0x230d88))['catch'](handleError(_0x34e4b4,null));};exports[_0x4872('0x41')]=function(_0x59f9b3,_0x6cec25){var _0x32a812={'raw':!![],'where':{'id':_0x59f9b3[_0x4872('0x42')]['id']}},_0x39bd0={};_0x39bd0[_0x4872('0x31')]=_[_0x4872('0x33')](db[_0x4872('0x2c')]['rawAttributes']);_0x39bd0['query']=_[_0x4872('0x33')](_0x59f9b3['query']);_0x39bd0['filters']=_[_0x4872('0x34')](_0x39bd0['model'],_0x39bd0['query']);_0x32a812[_0x4872('0x35')]=_[_0x4872('0x34')](_0x39bd0[_0x4872('0x31')],qs[_0x4872('0x36')](_0x59f9b3[_0x4872('0x32')][_0x4872('0x36')]));_0x32a812['attributes']=_0x32a812[_0x4872('0x35')][_0x4872('0x37')]?_0x32a812[_0x4872('0x35')]:_0x39bd0[_0x4872('0x31')];if(_0x59f9b3[_0x4872('0x32')][_0x4872('0x3e')]){_0x32a812['include']=[{'all':!![]}];}_0x32a812=_[_0x4872('0x3d')]({},_0x32a812,_0x59f9b3['options']);return db[_0x4872('0x2c')][_0x4872('0x43')](_0x32a812)['then'](handleEntityNotFound(_0x6cec25,null))[_0x4872('0x26')](respondWithResult(_0x6cec25,null))[_0x4872('0x44')](handleError(_0x6cec25,null));};exports[_0x4872('0x45')]=function(_0x265533,_0x55db91){return db[_0x4872('0x2c')][_0x4872('0x45')](_0x265533[_0x4872('0x46')],{})[_0x4872('0x26')](respondWithResult(_0x55db91,0xc9))[_0x4872('0x44')](handleError(_0x55db91,null));};exports[_0x4872('0x24')]=function(_0x2193e3,_0x339eb2){if(_0x2193e3[_0x4872('0x46')]['id']){delete _0x2193e3['body']['id'];}return db[_0x4872('0x2c')][_0x4872('0x43')]({'where':{'id':_0x2193e3[_0x4872('0x42')]['id']}})['then'](handleEntityNotFound(_0x339eb2,null))[_0x4872('0x26')](saveUpdates(_0x2193e3[_0x4872('0x46')],null))[_0x4872('0x26')](respondWithResult(_0x339eb2,null))['catch'](handleError(_0x339eb2,null));};exports['destroy']=function(_0x35f20d,_0x54c10e){return db['SmsQueueReport'][_0x4872('0x43')]({'where':{'id':_0x35f20d[_0x4872('0x42')]['id']}})['then'](handleEntityNotFound(_0x54c10e,null))[_0x4872('0x26')](removeEntity(_0x54c10e,null))['catch'](handleError(_0x54c10e,null));};exports[_0x4872('0x47')]=function(_0x530d42,_0x1f3a7b){return db[_0x4872('0x2c')][_0x4872('0x47')]()[_0x4872('0x26')](respondWithResult(_0x1f3a7b,null))[_0x4872('0x44')](handleError(_0x1f3a7b,null));}; \ No newline at end of file +var _0x8fb8=['attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','VIRTUAL','merge','options','includeAll','include','rows','show','params','find','create','body','catch','describe','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','map','SmsQueueReport','rawAttributes','fieldName','type','key','keys','intersection','model','query'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x8fb8,0x1e6));var _0x88fb=function(_0x5458a6,_0x1688c5){_0x5458a6=_0x5458a6-0x0;var _0x2669fc=_0x8fb8[_0x5458a6];return _0x2669fc;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x88fb('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x88fb('0x1'));var rp=require(_0x88fb('0x2'));var moment=require(_0x88fb('0x3'));var BPromise=require(_0x88fb('0x4'));var Mustache=require('mustache');var util=require(_0x88fb('0x5'));var path=require(_0x88fb('0x6'));var sox=require(_0x88fb('0x7'));var csv=require(_0x88fb('0x8'));var ejs=require(_0x88fb('0x9'));var fs=require('fs');var fs_extra=require(_0x88fb('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x88fb('0xb'));var deskjs=require(_0x88fb('0xc'));var toCsv=require(_0x88fb('0x8'));var querystring=require(_0x88fb('0xd'));var Papa=require('papaparse');var Redis=require(_0x88fb('0xe'));var authService=require(_0x88fb('0xf'));var qs=require(_0x88fb('0x10'));var as=require(_0x88fb('0x11'));var hardwareService=require(_0x88fb('0x12'));var logger=require(_0x88fb('0x13'))('api');var utils=require('../../config/utils');var config=require(_0x88fb('0x14'));var licenseUtil=require(_0x88fb('0x15'));var db=require(_0x88fb('0x16'))['db'];function respondWithStatusCode(_0x70fb83,_0x462895){_0x462895=_0x462895||0xcc;return function(_0x53f769){if(_0x53f769){return _0x70fb83[_0x88fb('0x17')](_0x462895);}return _0x70fb83[_0x88fb('0x18')](_0x462895)[_0x88fb('0x19')]();};}function respondWithResult(_0x1ad461,_0x16dd8c){_0x16dd8c=_0x16dd8c||0xc8;return function(_0x8e5a44){if(_0x8e5a44){return _0x1ad461[_0x88fb('0x18')](_0x16dd8c)[_0x88fb('0x1a')](_0x8e5a44);}};}function respondWithFilteredResult(_0x3d6136,_0x783a54){return function(_0xd92b97){if(_0xd92b97){var _0x526aa1=typeof _0x783a54['offset']===_0x88fb('0x1b')&&typeof _0x783a54[_0x88fb('0x1c')]===_0x88fb('0x1b');var _0x431328=_0xd92b97[_0x88fb('0x1d')];var _0x355b7a=_0x526aa1?0x0:_0x783a54[_0x88fb('0x1e')];var _0x338db4=_0x526aa1?_0xd92b97[_0x88fb('0x1d')]:_0x783a54['offset']+_0x783a54[_0x88fb('0x1c')];var _0x5a42af;if(_0x338db4>=_0x431328){_0x338db4=_0x431328;_0x5a42af=0xc8;}else{_0x5a42af=0xce;}_0x3d6136[_0x88fb('0x18')](_0x5a42af);return _0x3d6136[_0x88fb('0x1f')](_0x88fb('0x20'),_0x355b7a+'-'+_0x338db4+'/'+_0x431328)['json'](_0xd92b97);}return null;};}function patchUpdates(_0x59bc47){return function(_0x1d5940){try{jsonpatch[_0x88fb('0x21')](_0x1d5940,_0x59bc47,!![]);}catch(_0x478417){return BPromise[_0x88fb('0x22')](_0x478417);}return _0x1d5940[_0x88fb('0x23')]();};}function saveUpdates(_0x1363bb,_0x207ead){return function(_0x301038){if(_0x301038){return _0x301038[_0x88fb('0x24')](_0x1363bb)[_0x88fb('0x25')](function(_0x40cf58){return _0x40cf58;});}return null;};}function removeEntity(_0x56d11e,_0x4767c3){return function(_0x4eaef3){if(_0x4eaef3){return _0x4eaef3[_0x88fb('0x26')]()['then'](function(){_0x56d11e[_0x88fb('0x18')](0xcc)[_0x88fb('0x19')]();});}};}function handleEntityNotFound(_0xf07bf6,_0x2d4a4d){return function(_0x326d08){if(!_0x326d08){_0xf07bf6[_0x88fb('0x17')](0x194);}return _0x326d08;};}function handleError(_0x10d339,_0x27ef24){_0x27ef24=_0x27ef24||0x1f4;return function(_0x1ce608){logger[_0x88fb('0x27')](_0x1ce608[_0x88fb('0x28')]);if(_0x1ce608[_0x88fb('0x29')]){delete _0x1ce608[_0x88fb('0x29')];}_0x10d339[_0x88fb('0x18')](_0x27ef24)[_0x88fb('0x2a')](_0x1ce608);};}exports['index']=function(_0x4d3905,_0x3fd291){var _0x36cf86={},_0x44c3c8={},_0x845a10={'count':0x0,'rows':[]};var _0xb8a236=_[_0x88fb('0x2b')](db[_0x88fb('0x2c')][_0x88fb('0x2d')],function(_0x35ffc6){return{'name':_0x35ffc6[_0x88fb('0x2e')],'type':_0x35ffc6[_0x88fb('0x2f')][_0x88fb('0x30')]};});_0x44c3c8['model']=_[_0x88fb('0x2b')](_0xb8a236,_0x88fb('0x29'));_0x44c3c8['query']=_[_0x88fb('0x31')](_0x4d3905['query']);_0x44c3c8['filters']=_[_0x88fb('0x32')](_0x44c3c8[_0x88fb('0x33')],_0x44c3c8[_0x88fb('0x34')]);_0x36cf86[_0x88fb('0x35')]=_['intersection'](_0x44c3c8[_0x88fb('0x33')],qs[_0x88fb('0x36')](_0x4d3905['query']['fields']));_0x36cf86[_0x88fb('0x35')]=_0x36cf86['attributes'][_0x88fb('0x37')]?_0x36cf86[_0x88fb('0x35')]:_0x44c3c8[_0x88fb('0x33')];if(!_0x4d3905[_0x88fb('0x34')][_0x88fb('0x38')](_0x88fb('0x39'))){_0x36cf86[_0x88fb('0x1c')]=qs['limit'](_0x4d3905[_0x88fb('0x34')][_0x88fb('0x1c')]);_0x36cf86[_0x88fb('0x1e')]=qs[_0x88fb('0x1e')](_0x4d3905[_0x88fb('0x34')]['offset']);}_0x36cf86[_0x88fb('0x3a')]=qs['sort'](_0x4d3905[_0x88fb('0x34')][_0x88fb('0x3b')]);_0x36cf86['where']=qs[_0x88fb('0x3c')](_[_0x88fb('0x3d')](_0x4d3905[_0x88fb('0x34')],_0x44c3c8['filters']),_0xb8a236);if(_0x4d3905['query'][_0x88fb('0x3e')]){_0x36cf86[_0x88fb('0x3f')]=_['merge'](_0x36cf86[_0x88fb('0x3f')],{'$or':_[_0x88fb('0x2b')](_0xb8a236,function(_0x3ab138){if(_0x3ab138[_0x88fb('0x2f')]!==_0x88fb('0x40')){var _0x186dd9={};_0x186dd9[_0x3ab138[_0x88fb('0x29')]]={'$like':'%'+_0x4d3905[_0x88fb('0x34')][_0x88fb('0x3e')]+'%'};return _0x186dd9;}})});}_0x36cf86=_[_0x88fb('0x41')]({},_0x36cf86,_0x4d3905[_0x88fb('0x42')]);var _0x219243={'where':_0x36cf86[_0x88fb('0x3f')]};return db[_0x88fb('0x2c')][_0x88fb('0x1d')](_0x219243)[_0x88fb('0x25')](function(_0x540105){_0x845a10[_0x88fb('0x1d')]=_0x540105;if(_0x4d3905[_0x88fb('0x34')][_0x88fb('0x43')]){_0x36cf86[_0x88fb('0x44')]=[{'all':!![]}];}return db[_0x88fb('0x2c')]['findAll'](_0x36cf86);})[_0x88fb('0x25')](function(_0x1fc762){_0x845a10[_0x88fb('0x45')]=_0x1fc762;return _0x845a10;})[_0x88fb('0x25')](respondWithFilteredResult(_0x3fd291,_0x36cf86))['catch'](handleError(_0x3fd291,null));};exports[_0x88fb('0x46')]=function(_0x2193e8,_0x31f266){var _0x559885={'raw':!![],'where':{'id':_0x2193e8[_0x88fb('0x47')]['id']}},_0x5984b4={};_0x5984b4[_0x88fb('0x33')]=_[_0x88fb('0x31')](db[_0x88fb('0x2c')][_0x88fb('0x2d')]);_0x5984b4[_0x88fb('0x34')]=_[_0x88fb('0x31')](_0x2193e8['query']);_0x5984b4[_0x88fb('0x3c')]=_[_0x88fb('0x32')](_0x5984b4['model'],_0x5984b4[_0x88fb('0x34')]);_0x559885[_0x88fb('0x35')]=_[_0x88fb('0x32')](_0x5984b4['model'],qs[_0x88fb('0x36')](_0x2193e8[_0x88fb('0x34')]['fields']));_0x559885[_0x88fb('0x35')]=_0x559885[_0x88fb('0x35')][_0x88fb('0x37')]?_0x559885[_0x88fb('0x35')]:_0x5984b4['model'];if(_0x2193e8['query'][_0x88fb('0x43')]){_0x559885[_0x88fb('0x44')]=[{'all':!![]}];}_0x559885=_['merge']({},_0x559885,_0x2193e8[_0x88fb('0x42')]);return db['SmsQueueReport'][_0x88fb('0x48')](_0x559885)[_0x88fb('0x25')](handleEntityNotFound(_0x31f266,null))['then'](respondWithResult(_0x31f266,null))['catch'](handleError(_0x31f266,null));};exports[_0x88fb('0x49')]=function(_0x2d2355,_0x4a8cac){return db[_0x88fb('0x2c')][_0x88fb('0x49')](_0x2d2355[_0x88fb('0x4a')],{})[_0x88fb('0x25')](respondWithResult(_0x4a8cac,0xc9))[_0x88fb('0x4b')](handleError(_0x4a8cac,null));};exports[_0x88fb('0x24')]=function(_0x3ff9e6,_0x444d60){if(_0x3ff9e6[_0x88fb('0x4a')]['id']){delete _0x3ff9e6[_0x88fb('0x4a')]['id'];}return db[_0x88fb('0x2c')][_0x88fb('0x48')]({'where':{'id':_0x3ff9e6[_0x88fb('0x47')]['id']}})['then'](handleEntityNotFound(_0x444d60,null))[_0x88fb('0x25')](saveUpdates(_0x3ff9e6[_0x88fb('0x4a')],null))[_0x88fb('0x25')](respondWithResult(_0x444d60,null))[_0x88fb('0x4b')](handleError(_0x444d60,null));};exports[_0x88fb('0x26')]=function(_0x5161ef,_0x9adc55){return db[_0x88fb('0x2c')]['find']({'where':{'id':_0x5161ef[_0x88fb('0x47')]['id']}})['then'](handleEntityNotFound(_0x9adc55,null))[_0x88fb('0x25')](removeEntity(_0x9adc55,null))[_0x88fb('0x4b')](handleError(_0x9adc55,null));};exports[_0x88fb('0x4c')]=function(_0x10b3a3,_0x1ba1ca){return db[_0x88fb('0x2c')][_0x88fb('0x4c')]()['then'](respondWithResult(_0x1ba1ca,null))[_0x88fb('0x4b')](handleError(_0x1ba1ca,null));}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.model.js b/server/api/smsQueueReport/smsQueueReport.model.js index f3bbc7d..4ca603a 100644 --- a/server/api/smsQueueReport/smsQueueReport.model.js +++ b/server/api/smsQueueReport/smsQueueReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb7e7=['../../config/logger','moment','request-promise','rimraf','../../config/environment','./smsQueueReport.attributes','define','SmsQueueReport','uniqueid','lodash'];(function(_0x95675b,_0x88d868){var _0x2279e0=function(_0x155a3a){while(--_0x155a3a){_0x95675b['push'](_0x95675b['shift']());}};_0x2279e0(++_0x88d868);}(_0xb7e7,0x121));var _0x7b7e=function(_0x13ea00,_0x12f610){_0x13ea00=_0x13ea00-0x0;var _0x1f7347=_0xb7e7[_0x13ea00];return _0x1f7347;};'use strict';var _=require(_0x7b7e('0x0'));var util=require('util');var logger=require(_0x7b7e('0x1'))('api');var moment=require(_0x7b7e('0x2'));var BPromise=require('bluebird');var rp=require(_0x7b7e('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7b7e('0x4'));var config=require(_0x7b7e('0x5'));var attributes=require(_0x7b7e('0x6'));module['exports']=function(_0x53ed64,_0x333fa4){return _0x53ed64[_0x7b7e('0x7')](_0x7b7e('0x8'),attributes,{'tableName':'report_sms_queue','paranoid':![],'indexes':[{'name':_0x7b7e('0x9'),'fields':[_0x7b7e('0x9')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xb7e7=['../../config/logger','moment','request-promise','rimraf','../../config/environment','./smsQueueReport.attributes','define','SmsQueueReport','uniqueid','lodash'];(function(_0x43a1f5,_0x22a0af){var _0x11e541=function(_0x10f9e5){while(--_0x10f9e5){_0x43a1f5['push'](_0x43a1f5['shift']());}};_0x11e541(++_0x22a0af);}(_0xb7e7,0x121));var _0x7b7e=function(_0x1e3c16,_0x372caa){_0x1e3c16=_0x1e3c16-0x0;var _0x47a0c9=_0xb7e7[_0x1e3c16];return _0x47a0c9;};'use strict';var _=require(_0x7b7e('0x0'));var util=require('util');var logger=require(_0x7b7e('0x1'))('api');var moment=require(_0x7b7e('0x2'));var BPromise=require('bluebird');var rp=require(_0x7b7e('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7b7e('0x4'));var config=require(_0x7b7e('0x5'));var attributes=require(_0x7b7e('0x6'));module['exports']=function(_0x53ed64,_0x333fa4){return _0x53ed64[_0x7b7e('0x7')](_0x7b7e('0x8'),attributes,{'tableName':'report_sms_queue','paranoid':![],'indexes':[{'name':_0x7b7e('0x9'),'fields':[_0x7b7e('0x9')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.rpc.js b/server/api/smsQueueReport/smsQueueReport.rpc.js index 16d65c1..a68772a 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 _0xfc2b=['options','UpdateSmsQueueReport','update','raw','limit','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','SmsQueueReport,\x20%s,\x20%s','debug','SmsQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','CreateSmsQueueReport','SmsQueueReport','create','body'];(function(_0x572296,_0x81e0e3){var _0x240020=function(_0x439916){while(--_0x439916){_0x572296['push'](_0x572296['shift']());}};_0x240020(++_0x81e0e3);}(_0xfc2b,0x113));var _0xbfc2=function(_0x492fbd,_0x56f184){_0x492fbd=_0x492fbd-0x0;var _0x26c9e3=_0xfc2b[_0x492fbd];return _0x26c9e3;};'use strict';var _=require('lodash');var util=require(_0xbfc2('0x0'));var moment=require('moment');var BPromise=require(_0xbfc2('0x1'));var rs=require(_0xbfc2('0x2'));var fs=require('fs');var Redis=require(_0xbfc2('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xbfc2('0x4'));var logger=require(_0xbfc2('0x5'))('rpc');var config=require(_0xbfc2('0x6'));var jayson=require(_0xbfc2('0x7'));var client=jayson[_0xbfc2('0x8')][_0xbfc2('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xafdb0f,_0x15cc13,_0x96c5a4){return new BPromise(function(_0x36a5c0,_0x473e02){return client['request'](_0xafdb0f,_0x96c5a4)[_0xbfc2('0xa')](function(_0x354402){logger[_0xbfc2('0xb')](_0xbfc2('0xc'),_0x15cc13,'request\x20sent');logger[_0xbfc2('0xd')](_0xbfc2('0xe'),_0x15cc13,_0xbfc2('0xf'),JSON[_0xbfc2('0x10')](_0x354402));if(_0x354402['error']){if(_0x354402[_0xbfc2('0x11')][_0xbfc2('0x12')]===0x1f4){logger[_0xbfc2('0x11')]('SmsQueueReport,\x20%s,\x20%s',_0x15cc13,_0x354402[_0xbfc2('0x11')][_0xbfc2('0x13')]);return _0x473e02(_0x354402[_0xbfc2('0x11')]['message']);}logger[_0xbfc2('0x11')]('SmsQueueReport,\x20%s,\x20%s',_0x15cc13,_0x354402[_0xbfc2('0x11')][_0xbfc2('0x13')]);return _0x36a5c0(_0x354402[_0xbfc2('0x11')][_0xbfc2('0x13')]);}else{logger[_0xbfc2('0xb')](_0xbfc2('0xc'),_0x15cc13,_0xbfc2('0xf'));_0x36a5c0(_0x354402['result'][_0xbfc2('0x13')]);}})[_0xbfc2('0x14')](function(_0x5e8fef){logger['error'](_0xbfc2('0xc'),_0x15cc13,_0x5e8fef);_0x473e02(_0x5e8fef);});});}exports[_0xbfc2('0x15')]=function(_0x546698){var _0x5399e9=this;return new Promise(function(_0x4c45bd,_0x341019){return db[_0xbfc2('0x16')][_0xbfc2('0x17')](_0x546698[_0xbfc2('0x18')],{'raw':_0x546698[_0xbfc2('0x19')]?_0x546698[_0xbfc2('0x19')]['raw']===undefined?!![]:![]:!![]})[_0xbfc2('0xa')](function(_0x539f47){logger['info'](_0xbfc2('0x15'),_0x546698);logger[_0xbfc2('0xd')](_0xbfc2('0x15'),_0x546698,JSON[_0xbfc2('0x10')](_0x539f47));_0x4c45bd(_0x539f47);})[_0xbfc2('0x14')](function(_0x58cf89){logger[_0xbfc2('0x11')](_0xbfc2('0x15'),_0x58cf89[_0xbfc2('0x13')],_0x546698);_0x341019(_0x5399e9[_0xbfc2('0x11')](0x1f4,_0x58cf89[_0xbfc2('0x13')]));});});};exports[_0xbfc2('0x1a')]=function(_0x314736){var _0xab18b3=this;return new Promise(function(_0x30c065,_0x45bf75){return db[_0xbfc2('0x16')][_0xbfc2('0x1b')](_0x314736[_0xbfc2('0x18')],{'raw':_0x314736[_0xbfc2('0x19')]?_0x314736[_0xbfc2('0x19')][_0xbfc2('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x314736[_0xbfc2('0x19')]?_0x314736[_0xbfc2('0x19')]['where']||null:null,'attributes':_0x314736[_0xbfc2('0x19')]?_0x314736[_0xbfc2('0x19')]['attributes']||null:null,'limit':_0x314736[_0xbfc2('0x19')]?_0x314736[_0xbfc2('0x19')][_0xbfc2('0x1d')]||null:null})[_0xbfc2('0xa')](function(_0x228be0){logger[_0xbfc2('0xb')](_0xbfc2('0x1a'),_0x314736);logger[_0xbfc2('0xd')](_0xbfc2('0x1a'),_0x314736,JSON[_0xbfc2('0x10')](_0x228be0));_0x30c065(_0x228be0);})['catch'](function(_0x1a38eb){logger[_0xbfc2('0x11')](_0xbfc2('0x1a'),_0x1a38eb['message'],_0x314736);_0x45bf75(_0xab18b3[_0xbfc2('0x11')](0x1f4,_0x1a38eb[_0xbfc2('0x13')]));});});}; \ No newline at end of file +var _0xccea=['where','limit','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','SmsQueueReport,\x20%s,\x20%s','request\x20sent','debug','SmsQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','CreateSmsQueueReport','SmsQueueReport','create','body','options','raw','UpdateSmsQueueReport','update'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xccea,0x1f1));var _0xacce=function(_0xd1d19a,_0x1933f0){_0xd1d19a=_0xd1d19a-0x0;var _0x52a79d=_0xccea[_0xd1d19a];return _0x52a79d;};'use strict';var _=require('lodash');var util=require(_0xacce('0x0'));var moment=require(_0xacce('0x1'));var BPromise=require(_0xacce('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xacce('0x3'));var db=require(_0xacce('0x4'))['db'];var utils=require(_0xacce('0x5'));var logger=require(_0xacce('0x6'))('rpc');var config=require(_0xacce('0x7'));var jayson=require(_0xacce('0x8'));var client=jayson[_0xacce('0x9')][_0xacce('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x12cd9d,_0x409d03,_0x17683f){return new BPromise(function(_0x4687ed,_0x1eec6d){return client[_0xacce('0xb')](_0x12cd9d,_0x17683f)[_0xacce('0xc')](function(_0x4ba70f){logger[_0xacce('0xd')](_0xacce('0xe'),_0x409d03,_0xacce('0xf'));logger[_0xacce('0x10')](_0xacce('0x11'),_0x409d03,_0xacce('0xf'),JSON[_0xacce('0x12')](_0x4ba70f));if(_0x4ba70f[_0xacce('0x13')]){if(_0x4ba70f['error']['code']===0x1f4){logger[_0xacce('0x13')](_0xacce('0xe'),_0x409d03,_0x4ba70f[_0xacce('0x13')]['message']);return _0x1eec6d(_0x4ba70f['error'][_0xacce('0x14')]);}logger['error']('SmsQueueReport,\x20%s,\x20%s',_0x409d03,_0x4ba70f[_0xacce('0x13')][_0xacce('0x14')]);return _0x4687ed(_0x4ba70f[_0xacce('0x13')][_0xacce('0x14')]);}else{logger[_0xacce('0xd')](_0xacce('0xe'),_0x409d03,'request\x20sent');_0x4687ed(_0x4ba70f[_0xacce('0x15')]['message']);}})[_0xacce('0x16')](function(_0x4759e1){logger[_0xacce('0x13')](_0xacce('0xe'),_0x409d03,_0x4759e1);_0x1eec6d(_0x4759e1);});});}exports[_0xacce('0x17')]=function(_0x4d83b9){var _0x3119bc=this;return new Promise(function(_0x2356a8,_0x42e548){return db[_0xacce('0x18')][_0xacce('0x19')](_0x4d83b9[_0xacce('0x1a')],{'raw':_0x4d83b9[_0xacce('0x1b')]?_0x4d83b9[_0xacce('0x1b')][_0xacce('0x1c')]===undefined?!![]:![]:!![]})['then'](function(_0xc5308d){logger[_0xacce('0xd')](_0xacce('0x17'),_0x4d83b9);logger[_0xacce('0x10')]('CreateSmsQueueReport',_0x4d83b9,JSON[_0xacce('0x12')](_0xc5308d));_0x2356a8(_0xc5308d);})['catch'](function(_0x553272){logger[_0xacce('0x13')](_0xacce('0x17'),_0x553272[_0xacce('0x14')],_0x4d83b9);_0x42e548(_0x3119bc['error'](0x1f4,_0x553272['message']));});});};exports[_0xacce('0x1d')]=function(_0x251be4){var _0x85cc17=this;return new Promise(function(_0x431127,_0x3ef52e){return db[_0xacce('0x18')][_0xacce('0x1e')](_0x251be4[_0xacce('0x1a')],{'raw':_0x251be4[_0xacce('0x1b')]?_0x251be4[_0xacce('0x1b')][_0xacce('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x251be4[_0xacce('0x1b')]?_0x251be4[_0xacce('0x1b')][_0xacce('0x1f')]||null:null,'attributes':_0x251be4[_0xacce('0x1b')]?_0x251be4[_0xacce('0x1b')]['attributes']||null:null,'limit':_0x251be4[_0xacce('0x1b')]?_0x251be4[_0xacce('0x1b')][_0xacce('0x20')]||null:null})[_0xacce('0xc')](function(_0x405812){logger[_0xacce('0xd')](_0xacce('0x1d'),_0x251be4);logger[_0xacce('0x10')]('UpdateSmsQueueReport',_0x251be4,JSON[_0xacce('0x12')](_0x405812));_0x431127(_0x405812);})[_0xacce('0x16')](function(_0x249b68){logger[_0xacce('0x13')](_0xacce('0x1d'),_0x249b68['message'],_0x251be4);_0x3ef52e(_0x85cc17['error'](0x1f4,_0x249b68[_0xacce('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/index.js b/server/api/smsTransferReport/index.js index ec9e089..04c3e7f 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 _0x885a=['describe','/:id','show','post','isAuthenticated','create','put','delete','destroy','exports','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsTransferReport.controller','get','index','/describe'];(function(_0xa72e3a,_0x4d3bd1){var _0x41cff3=function(_0x4dd760){while(--_0x4dd760){_0xa72e3a['push'](_0xa72e3a['shift']());}};_0x41cff3(++_0x4d3bd1);}(_0x885a,0x180));var _0xa885=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x885a[_0x4565bf];return _0x5610ba;};'use strict';var multer=require('multer');var util=require(_0xa885('0x0'));var path=require(_0xa885('0x1'));var timeout=require(_0xa885('0x2'));var express=require(_0xa885('0x3'));var router=express['Router']();var fs_extra=require(_0xa885('0x4'));var auth=require(_0xa885('0x5'));var interaction=require(_0xa885('0x6'));var config=require(_0xa885('0x7'));var controller=require(_0xa885('0x8'));router[_0xa885('0x9')]('/',auth['isAuthenticated'](),controller[_0xa885('0xa')]);router[_0xa885('0x9')](_0xa885('0xb'),auth['isAuthenticated'](),controller[_0xa885('0xc')]);router[_0xa885('0x9')](_0xa885('0xd'),auth['isAuthenticated'](),controller[_0xa885('0xe')]);router[_0xa885('0xf')]('/',auth[_0xa885('0x10')](),controller[_0xa885('0x11')]);router[_0xa885('0x12')](_0xa885('0xd'),auth[_0xa885('0x10')](),controller['update']);router[_0xa885('0x13')](_0xa885('0xd'),auth[_0xa885('0x10')](),controller[_0xa885('0x14')]);module[_0xa885('0x15')]=router; \ No newline at end of file +var _0xac31=['update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/describe','show','post','create','put','/:id'];(function(_0x495df9,_0x3b6b9b){var _0x1a561d=function(_0x3d42d9){while(--_0x3d42d9){_0x495df9['push'](_0x495df9['shift']());}};_0x1a561d(++_0x3b6b9b);}(_0xac31,0xca));var _0x1ac3=function(_0x55e944,_0x5b6eb3){_0x55e944=_0x55e944-0x0;var _0x1bdb9a=_0xac31[_0x55e944];return _0x1bdb9a;};'use strict';var multer=require(_0x1ac3('0x0'));var util=require(_0x1ac3('0x1'));var path=require(_0x1ac3('0x2'));var timeout=require(_0x1ac3('0x3'));var express=require(_0x1ac3('0x4'));var router=express[_0x1ac3('0x5')]();var fs_extra=require(_0x1ac3('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x1ac3('0x7'));var config=require(_0x1ac3('0x8'));var controller=require('./smsTransferReport.controller');router['get']('/',auth[_0x1ac3('0x9')](),controller[_0x1ac3('0xa')]);router[_0x1ac3('0xb')](_0x1ac3('0xc'),auth[_0x1ac3('0x9')](),controller['describe']);router[_0x1ac3('0xb')]('/:id',auth[_0x1ac3('0x9')](),controller[_0x1ac3('0xd')]);router[_0x1ac3('0xe')]('/',auth['isAuthenticated'](),controller[_0x1ac3('0xf')]);router[_0x1ac3('0x10')](_0x1ac3('0x11'),auth[_0x1ac3('0x9')](),controller[_0x1ac3('0x12')]);router[_0x1ac3('0x13')]('/:id',auth[_0x1ac3('0x9')](),controller[_0x1ac3('0x14')]);module[_0x1ac3('0x15')]=router; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.attributes.js b/server/api/smsTransferReport/smsTransferReport.attributes.js index db385e1..d8d76bf 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 _0x9c44=['ENUM','account','agent','queue','NOW','exports','STRING'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x9c44,0x178));var _0x49c4=function(_0x50a0c2,_0x4befab){_0x50a0c2=_0x50a0c2-0x0;var _0x5ebadd=_0x9c44[_0x50a0c2];return _0x5ebadd;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x49c4('0x0')]={'uniqueid':{'type':Sequelize[_0x49c4('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x49c4('0x2')](_0x49c4('0x3'),_0x49c4('0x4'),_0x49c4('0x5')),'allowNull':![],'defaultValue':'queue'},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x49c4('0x6')]}}; \ No newline at end of file +var _0x9bde=['NOW','sequelize','STRING','account','agent','queue','DATE'];(function(_0x421eeb,_0x3d3e3e){var _0x2c7371=function(_0x174b74){while(--_0x174b74){_0x421eeb['push'](_0x421eeb['shift']());}};_0x2c7371(++_0x3d3e3e);}(_0x9bde,0xe1));var _0xe9bd=function(_0x43ef21,_0x326178){_0x43ef21=_0x43ef21-0x0;var _0x432c03=_0x9bde[_0x43ef21];return _0x432c03;};'use strict';var moment=require('moment');var Sequelize=require(_0xe9bd('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0xe9bd('0x1')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xe9bd('0x2'),_0xe9bd('0x3'),_0xe9bd('0x4')),'allowNull':![],'defaultValue':_0xe9bd('0x4')},'transferredAt':{'type':Sequelize[_0xe9bd('0x5')],'allowNull':![],'defaultValue':Sequelize[_0xe9bd('0x6')]}}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.controller.js b/server/api/smsTransferReport/smsTransferReport.controller.js index 9f9bfc8..c923123 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 _0xfc1e=['status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','index','map','SmsTransferReport','type','key','model','query','keys','filters','attributes','intersection','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','rows','catch','show','params','rawAttributes','find','create','body','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus'];(function(_0x891d2b,_0xc90d6f){var _0x363e90=function(_0x61783c){while(--_0x61783c){_0x891d2b['push'](_0x891d2b['shift']());}};_0x363e90(++_0xc90d6f);}(_0xfc1e,0x7e));var _0xefc1=function(_0x5c6299,_0x11bd28){_0x5c6299=_0x5c6299-0x0;var _0x23b564=_0xfc1e[_0x5c6299];return _0x23b564;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xefc1('0x0'));var zipdir=require(_0xefc1('0x1'));var jsonpatch=require(_0xefc1('0x2'));var rp=require(_0xefc1('0x3'));var moment=require(_0xefc1('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xefc1('0x5'));var sox=require(_0xefc1('0x6'));var csv=require(_0xefc1('0x7'));var ejs=require(_0xefc1('0x8'));var fs=require('fs');var fs_extra=require(_0xefc1('0x9'));var _=require(_0xefc1('0xa'));var squel=require(_0xefc1('0xb'));var crypto=require('crypto');var jsforce=require(_0xefc1('0xc'));var deskjs=require(_0xefc1('0xd'));var toCsv=require('to-csv');var querystring=require(_0xefc1('0xe'));var Papa=require(_0xefc1('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xefc1('0x10'));var as=require(_0xefc1('0x11'));var hardwareService=require(_0xefc1('0x12'));var logger=require(_0xefc1('0x13'))(_0xefc1('0x14'));var utils=require(_0xefc1('0x15'));var config=require(_0xefc1('0x16'));var licenseUtil=require(_0xefc1('0x17'));var db=require(_0xefc1('0x18'))['db'];function respondWithStatusCode(_0x53d2a1,_0xb62c30){_0xb62c30=_0xb62c30||0xcc;return function(_0x140827){if(_0x140827){return _0x53d2a1[_0xefc1('0x19')](_0xb62c30);}return _0x53d2a1[_0xefc1('0x1a')](_0xb62c30)[_0xefc1('0x1b')]();};}function respondWithResult(_0x510f14,_0x47d0ff){_0x47d0ff=_0x47d0ff||0xc8;return function(_0xdcc0a3){if(_0xdcc0a3){return _0x510f14['status'](_0x47d0ff)[_0xefc1('0x1c')](_0xdcc0a3);}};}function respondWithFilteredResult(_0x489ebe,_0x6fc1e1){return function(_0x59cd9a){if(_0x59cd9a){var _0x513115=typeof _0x6fc1e1[_0xefc1('0x1d')]===_0xefc1('0x1e')&&typeof _0x6fc1e1['limit']===_0xefc1('0x1e');var _0x124314=_0x59cd9a[_0xefc1('0x1f')];var _0x5294ed=_0x513115?0x0:_0x6fc1e1[_0xefc1('0x1d')];var _0x52f377=_0x513115?_0x59cd9a['count']:_0x6fc1e1[_0xefc1('0x1d')]+_0x6fc1e1[_0xefc1('0x20')];var _0x5c6f9b;if(_0x52f377>=_0x124314){_0x52f377=_0x124314;_0x5c6f9b=0xc8;}else{_0x5c6f9b=0xce;}_0x489ebe[_0xefc1('0x1a')](_0x5c6f9b);return _0x489ebe[_0xefc1('0x21')](_0xefc1('0x22'),_0x5294ed+'-'+_0x52f377+'/'+_0x124314)[_0xefc1('0x1c')](_0x59cd9a);}return null;};}function patchUpdates(_0x5a9b08){return function(_0x11c70a){try{jsonpatch[_0xefc1('0x23')](_0x11c70a,_0x5a9b08,!![]);}catch(_0x122308){return BPromise[_0xefc1('0x24')](_0x122308);}return _0x11c70a['save']();};}function saveUpdates(_0xe8306f,_0x4dd386){return function(_0x538e94){if(_0x538e94){return _0x538e94[_0xefc1('0x25')](_0xe8306f)[_0xefc1('0x26')](function(_0x29ed57){return _0x29ed57;});}return null;};}function removeEntity(_0x2768f5,_0x104e94){return function(_0x2666ac){if(_0x2666ac){return _0x2666ac[_0xefc1('0x27')]()['then'](function(){_0x2768f5[_0xefc1('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2d2f58,_0x3912a4){return function(_0x26989d){if(!_0x26989d){_0x2d2f58['sendStatus'](0x194);}return _0x26989d;};}function handleError(_0x3e5194,_0x3c67c5){_0x3c67c5=_0x3c67c5||0x1f4;return function(_0x4f004d){logger[_0xefc1('0x28')](_0x4f004d[_0xefc1('0x29')]);if(_0x4f004d[_0xefc1('0x2a')]){delete _0x4f004d[_0xefc1('0x2a')];}_0x3e5194['status'](_0x3c67c5)[_0xefc1('0x2b')](_0x4f004d);};}exports[_0xefc1('0x2c')]=function(_0x1aa472,_0x103b4d){var _0xe74cd0={},_0x58dc17={},_0xfd36d8={'count':0x0,'rows':[]};var _0x28bcb6=_[_0xefc1('0x2d')](db[_0xefc1('0x2e')]['rawAttributes'],function(_0x50b47a){return{'name':_0x50b47a['fieldName'],'type':_0x50b47a[_0xefc1('0x2f')][_0xefc1('0x30')]};});_0x58dc17[_0xefc1('0x31')]=_[_0xefc1('0x2d')](_0x28bcb6,'name');_0x58dc17[_0xefc1('0x32')]=_[_0xefc1('0x33')](_0x1aa472[_0xefc1('0x32')]);_0x58dc17[_0xefc1('0x34')]=_['intersection'](_0x58dc17[_0xefc1('0x31')],_0x58dc17[_0xefc1('0x32')]);_0xe74cd0[_0xefc1('0x35')]=_[_0xefc1('0x36')](_0x58dc17[_0xefc1('0x31')],qs[_0xefc1('0x37')](_0x1aa472['query'][_0xefc1('0x37')]));_0xe74cd0[_0xefc1('0x35')]=_0xe74cd0['attributes'][_0xefc1('0x38')]?_0xe74cd0[_0xefc1('0x35')]:_0x58dc17[_0xefc1('0x31')];if(!_0x1aa472[_0xefc1('0x32')]['hasOwnProperty'](_0xefc1('0x39'))){_0xe74cd0[_0xefc1('0x20')]=qs['limit'](_0x1aa472['query'][_0xefc1('0x20')]);_0xe74cd0['offset']=qs[_0xefc1('0x1d')](_0x1aa472[_0xefc1('0x32')][_0xefc1('0x1d')]);}_0xe74cd0[_0xefc1('0x3a')]=qs[_0xefc1('0x3b')](_0x1aa472[_0xefc1('0x32')][_0xefc1('0x3b')]);_0xe74cd0[_0xefc1('0x3c')]=qs[_0xefc1('0x34')](_[_0xefc1('0x3d')](_0x1aa472[_0xefc1('0x32')],_0x58dc17['filters']),_0x28bcb6);if(_0x1aa472['query'][_0xefc1('0x3e')]){_0xe74cd0[_0xefc1('0x3c')]=_[_0xefc1('0x3f')](_0xe74cd0[_0xefc1('0x3c')],{'$or':_[_0xefc1('0x2d')](_0x28bcb6,function(_0x147e6c){if(_0x147e6c[_0xefc1('0x2f')]!==_0xefc1('0x40')){var _0x17137d={};_0x17137d[_0x147e6c[_0xefc1('0x2a')]]={'$like':'%'+_0x1aa472['query'][_0xefc1('0x3e')]+'%'};return _0x17137d;}})});}_0xe74cd0=_[_0xefc1('0x3f')]({},_0xe74cd0,_0x1aa472[_0xefc1('0x41')]);var _0x32edef={'where':_0xe74cd0[_0xefc1('0x3c')]};return db[_0xefc1('0x2e')][_0xefc1('0x1f')](_0x32edef)['then'](function(_0x417349){_0xfd36d8[_0xefc1('0x1f')]=_0x417349;if(_0x1aa472[_0xefc1('0x32')]['includeAll']){_0xe74cd0[_0xefc1('0x42')]=[{'all':!![]}];}return db[_0xefc1('0x2e')]['findAll'](_0xe74cd0);})[_0xefc1('0x26')](function(_0x23e668){_0xfd36d8[_0xefc1('0x43')]=_0x23e668;return _0xfd36d8;})[_0xefc1('0x26')](respondWithFilteredResult(_0x103b4d,_0xe74cd0))[_0xefc1('0x44')](handleError(_0x103b4d,null));};exports[_0xefc1('0x45')]=function(_0x376d66,_0x28f48c){var _0x224626={'raw':!![],'where':{'id':_0x376d66[_0xefc1('0x46')]['id']}},_0x223267={};_0x223267[_0xefc1('0x31')]=_[_0xefc1('0x33')](db['SmsTransferReport'][_0xefc1('0x47')]);_0x223267[_0xefc1('0x32')]=_['keys'](_0x376d66[_0xefc1('0x32')]);_0x223267[_0xefc1('0x34')]=_['intersection'](_0x223267[_0xefc1('0x31')],_0x223267[_0xefc1('0x32')]);_0x224626['attributes']=_[_0xefc1('0x36')](_0x223267[_0xefc1('0x31')],qs[_0xefc1('0x37')](_0x376d66['query']['fields']));_0x224626[_0xefc1('0x35')]=_0x224626['attributes'][_0xefc1('0x38')]?_0x224626[_0xefc1('0x35')]:_0x223267['model'];if(_0x376d66[_0xefc1('0x32')]['includeAll']){_0x224626['include']=[{'all':!![]}];}_0x224626=_[_0xefc1('0x3f')]({},_0x224626,_0x376d66[_0xefc1('0x41')]);return db['SmsTransferReport'][_0xefc1('0x48')](_0x224626)[_0xefc1('0x26')](handleEntityNotFound(_0x28f48c,null))[_0xefc1('0x26')](respondWithResult(_0x28f48c,null))[_0xefc1('0x44')](handleError(_0x28f48c,null));};exports['create']=function(_0x489170,_0xa8bcef){return db[_0xefc1('0x2e')][_0xefc1('0x49')](_0x489170[_0xefc1('0x4a')],{})[_0xefc1('0x26')](respondWithResult(_0xa8bcef,0xc9))['catch'](handleError(_0xa8bcef,null));};exports[_0xefc1('0x25')]=function(_0x1942c9,_0x3b8212){if(_0x1942c9[_0xefc1('0x4a')]['id']){delete _0x1942c9['body']['id'];}return db[_0xefc1('0x2e')][_0xefc1('0x48')]({'where':{'id':_0x1942c9[_0xefc1('0x46')]['id']}})[_0xefc1('0x26')](handleEntityNotFound(_0x3b8212,null))[_0xefc1('0x26')](saveUpdates(_0x1942c9[_0xefc1('0x4a')],null))[_0xefc1('0x26')](respondWithResult(_0x3b8212,null))[_0xefc1('0x44')](handleError(_0x3b8212,null));};exports[_0xefc1('0x27')]=function(_0x39efa9,_0x3ba51c){return db[_0xefc1('0x2e')][_0xefc1('0x48')]({'where':{'id':_0x39efa9['params']['id']}})[_0xefc1('0x26')](handleEntityNotFound(_0x3ba51c,null))['then'](removeEntity(_0x3ba51c,null))[_0xefc1('0x44')](handleError(_0x3ba51c,null));};exports[_0xefc1('0x4b')]=function(_0x1b51de,_0x57c1c9){return db[_0xefc1('0x2e')][_0xefc1('0x4b')]()['then'](respondWithResult(_0x57c1c9,null))[_0xefc1('0x44')](handleError(_0x57c1c9,null));}; \ No newline at end of file +var _0x28b3=['end','error','name','send','index','map','SmsTransferReport','rawAttributes','type','key','model','query','filters','intersection','attributes','length','nolimit','where','pick','filter','VIRTUAL','merge','options','findAll','rows','show','params','keys','fields','includeAll','catch','create','body','find','describe','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then'];(function(_0x27a8ee,_0x4b606e){var _0x354050=function(_0x2a79e4){while(--_0x2a79e4){_0x27a8ee['push'](_0x27a8ee['shift']());}};_0x354050(++_0x4b606e);}(_0x28b3,0x101));var _0x328b=function(_0x434b75,_0x329aca){_0x434b75=_0x434b75-0x0;var _0x4b08c0=_0x28b3[_0x434b75];return _0x4b08c0;};'use strict';var emlformat=require(_0x328b('0x0'));var rimraf=require(_0x328b('0x1'));var zipdir=require(_0x328b('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x328b('0x3'));var moment=require(_0x328b('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x328b('0x5'));var util=require(_0x328b('0x6'));var path=require(_0x328b('0x7'));var sox=require(_0x328b('0x8'));var csv=require('to-csv');var ejs=require(_0x328b('0x9'));var fs=require('fs');var fs_extra=require(_0x328b('0xa'));var _=require(_0x328b('0xb'));var squel=require(_0x328b('0xc'));var crypto=require(_0x328b('0xd'));var jsforce=require(_0x328b('0xe'));var deskjs=require(_0x328b('0xf'));var toCsv=require(_0x328b('0x10'));var querystring=require(_0x328b('0x11'));var Papa=require(_0x328b('0x12'));var Redis=require(_0x328b('0x13'));var authService=require(_0x328b('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0x328b('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x328b('0x16'))(_0x328b('0x17'));var utils=require('../../config/utils');var config=require(_0x328b('0x18'));var licenseUtil=require(_0x328b('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x32397a,_0x507a70){_0x507a70=_0x507a70||0xcc;return function(_0x4aa23f){if(_0x4aa23f){return _0x32397a[_0x328b('0x1a')](_0x507a70);}return _0x32397a[_0x328b('0x1b')](_0x507a70)['end']();};}function respondWithResult(_0x465203,_0x4f980f){_0x4f980f=_0x4f980f||0xc8;return function(_0x89d6af){if(_0x89d6af){return _0x465203[_0x328b('0x1b')](_0x4f980f)[_0x328b('0x1c')](_0x89d6af);}};}function respondWithFilteredResult(_0xb2008f,_0x14a8ce){return function(_0x2706eb){if(_0x2706eb){var _0x1dee53=typeof _0x14a8ce[_0x328b('0x1d')]===_0x328b('0x1e')&&typeof _0x14a8ce[_0x328b('0x1f')]==='undefined';var _0x379a05=_0x2706eb[_0x328b('0x20')];var _0x59f089=_0x1dee53?0x0:_0x14a8ce[_0x328b('0x1d')];var _0x5a9166=_0x1dee53?_0x2706eb[_0x328b('0x20')]:_0x14a8ce[_0x328b('0x1d')]+_0x14a8ce[_0x328b('0x1f')];var _0x305994;if(_0x5a9166>=_0x379a05){_0x5a9166=_0x379a05;_0x305994=0xc8;}else{_0x305994=0xce;}_0xb2008f[_0x328b('0x1b')](_0x305994);return _0xb2008f['set'](_0x328b('0x21'),_0x59f089+'-'+_0x5a9166+'/'+_0x379a05)[_0x328b('0x1c')](_0x2706eb);}return null;};}function patchUpdates(_0x4df292){return function(_0x51329a){try{jsonpatch[_0x328b('0x22')](_0x51329a,_0x4df292,!![]);}catch(_0x5967de){return BPromise[_0x328b('0x23')](_0x5967de);}return _0x51329a[_0x328b('0x24')]();};}function saveUpdates(_0x317dd4,_0x3e98c7){return function(_0x226a86){if(_0x226a86){return _0x226a86[_0x328b('0x25')](_0x317dd4)['then'](function(_0x5d0424){return _0x5d0424;});}return null;};}function removeEntity(_0x121d44,_0x5dba5e){return function(_0x165bcc){if(_0x165bcc){return _0x165bcc['destroy']()[_0x328b('0x26')](function(){_0x121d44[_0x328b('0x1b')](0xcc)[_0x328b('0x27')]();});}};}function handleEntityNotFound(_0x559f9d,_0xc37a57){return function(_0xafdf57){if(!_0xafdf57){_0x559f9d[_0x328b('0x1a')](0x194);}return _0xafdf57;};}function handleError(_0x44ff3d,_0x44cdb1){_0x44cdb1=_0x44cdb1||0x1f4;return function(_0x16760b){logger[_0x328b('0x28')](_0x16760b['stack']);if(_0x16760b['name']){delete _0x16760b[_0x328b('0x29')];}_0x44ff3d['status'](_0x44cdb1)[_0x328b('0x2a')](_0x16760b);};}exports[_0x328b('0x2b')]=function(_0x4c2129,_0x35d0c8){var _0x51138d={},_0x5cec8f={},_0x5c8de4={'count':0x0,'rows':[]};var _0x1fd423=_[_0x328b('0x2c')](db[_0x328b('0x2d')][_0x328b('0x2e')],function(_0x941b61){return{'name':_0x941b61['fieldName'],'type':_0x941b61[_0x328b('0x2f')][_0x328b('0x30')]};});_0x5cec8f[_0x328b('0x31')]=_[_0x328b('0x2c')](_0x1fd423,_0x328b('0x29'));_0x5cec8f[_0x328b('0x32')]=_['keys'](_0x4c2129[_0x328b('0x32')]);_0x5cec8f[_0x328b('0x33')]=_[_0x328b('0x34')](_0x5cec8f[_0x328b('0x31')],_0x5cec8f[_0x328b('0x32')]);_0x51138d[_0x328b('0x35')]=_['intersection'](_0x5cec8f[_0x328b('0x31')],qs['fields'](_0x4c2129['query']['fields']));_0x51138d['attributes']=_0x51138d['attributes'][_0x328b('0x36')]?_0x51138d[_0x328b('0x35')]:_0x5cec8f[_0x328b('0x31')];if(!_0x4c2129[_0x328b('0x32')]['hasOwnProperty'](_0x328b('0x37'))){_0x51138d[_0x328b('0x1f')]=qs['limit'](_0x4c2129[_0x328b('0x32')][_0x328b('0x1f')]);_0x51138d[_0x328b('0x1d')]=qs['offset'](_0x4c2129[_0x328b('0x32')][_0x328b('0x1d')]);}_0x51138d['order']=qs['sort'](_0x4c2129[_0x328b('0x32')]['sort']);_0x51138d[_0x328b('0x38')]=qs[_0x328b('0x33')](_[_0x328b('0x39')](_0x4c2129[_0x328b('0x32')],_0x5cec8f[_0x328b('0x33')]),_0x1fd423);if(_0x4c2129[_0x328b('0x32')][_0x328b('0x3a')]){_0x51138d['where']=_['merge'](_0x51138d[_0x328b('0x38')],{'$or':_[_0x328b('0x2c')](_0x1fd423,function(_0x369af9){if(_0x369af9[_0x328b('0x2f')]!==_0x328b('0x3b')){var _0x59e42f={};_0x59e42f[_0x369af9[_0x328b('0x29')]]={'$like':'%'+_0x4c2129['query'][_0x328b('0x3a')]+'%'};return _0x59e42f;}})});}_0x51138d=_[_0x328b('0x3c')]({},_0x51138d,_0x4c2129[_0x328b('0x3d')]);var _0x21c504={'where':_0x51138d['where']};return db[_0x328b('0x2d')][_0x328b('0x20')](_0x21c504)['then'](function(_0x4a3a88){_0x5c8de4[_0x328b('0x20')]=_0x4a3a88;if(_0x4c2129[_0x328b('0x32')]['includeAll']){_0x51138d['include']=[{'all':!![]}];}return db['SmsTransferReport'][_0x328b('0x3e')](_0x51138d);})[_0x328b('0x26')](function(_0x1efff1){_0x5c8de4[_0x328b('0x3f')]=_0x1efff1;return _0x5c8de4;})[_0x328b('0x26')](respondWithFilteredResult(_0x35d0c8,_0x51138d))['catch'](handleError(_0x35d0c8,null));};exports[_0x328b('0x40')]=function(_0x119fdf,_0x4aba24){var _0x1d7fcc={'raw':!![],'where':{'id':_0x119fdf[_0x328b('0x41')]['id']}},_0x3a3a2d={};_0x3a3a2d[_0x328b('0x31')]=_[_0x328b('0x42')](db[_0x328b('0x2d')][_0x328b('0x2e')]);_0x3a3a2d[_0x328b('0x32')]=_[_0x328b('0x42')](_0x119fdf['query']);_0x3a3a2d['filters']=_[_0x328b('0x34')](_0x3a3a2d[_0x328b('0x31')],_0x3a3a2d['query']);_0x1d7fcc['attributes']=_[_0x328b('0x34')](_0x3a3a2d['model'],qs[_0x328b('0x43')](_0x119fdf[_0x328b('0x32')][_0x328b('0x43')]));_0x1d7fcc[_0x328b('0x35')]=_0x1d7fcc[_0x328b('0x35')][_0x328b('0x36')]?_0x1d7fcc[_0x328b('0x35')]:_0x3a3a2d[_0x328b('0x31')];if(_0x119fdf[_0x328b('0x32')][_0x328b('0x44')]){_0x1d7fcc['include']=[{'all':!![]}];}_0x1d7fcc=_[_0x328b('0x3c')]({},_0x1d7fcc,_0x119fdf[_0x328b('0x3d')]);return db[_0x328b('0x2d')]['find'](_0x1d7fcc)[_0x328b('0x26')](handleEntityNotFound(_0x4aba24,null))[_0x328b('0x26')](respondWithResult(_0x4aba24,null))[_0x328b('0x45')](handleError(_0x4aba24,null));};exports[_0x328b('0x46')]=function(_0x3c3300,_0x47883e){return db[_0x328b('0x2d')][_0x328b('0x46')](_0x3c3300[_0x328b('0x47')],{})[_0x328b('0x26')](respondWithResult(_0x47883e,0xc9))[_0x328b('0x45')](handleError(_0x47883e,null));};exports[_0x328b('0x25')]=function(_0x236b26,_0x401a2d){if(_0x236b26[_0x328b('0x47')]['id']){delete _0x236b26[_0x328b('0x47')]['id'];}return db[_0x328b('0x2d')][_0x328b('0x48')]({'where':{'id':_0x236b26[_0x328b('0x41')]['id']}})[_0x328b('0x26')](handleEntityNotFound(_0x401a2d,null))[_0x328b('0x26')](saveUpdates(_0x236b26[_0x328b('0x47')],null))[_0x328b('0x26')](respondWithResult(_0x401a2d,null))[_0x328b('0x45')](handleError(_0x401a2d,null));};exports['destroy']=function(_0x2bcbb0,_0xb91e0c){return db[_0x328b('0x2d')]['find']({'where':{'id':_0x2bcbb0[_0x328b('0x41')]['id']}})['then'](handleEntityNotFound(_0xb91e0c,null))[_0x328b('0x26')](removeEntity(_0xb91e0c,null))[_0x328b('0x45')](handleError(_0xb91e0c,null));};exports['describe']=function(_0x29cc95,_0x2fbba6){return db[_0x328b('0x2d')][_0x328b('0x49')]()[_0x328b('0x26')](respondWithResult(_0x2fbba6,null))['catch'](handleError(_0x2fbba6,null));}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.model.js b/server/api/smsTransferReport/smsTransferReport.model.js index 92ff41e..0b4b90f 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 _0xedc0=['SmsTransferReport','report_sms_transfer','uniqueid','lodash','../../config/logger','api','moment','bluebird','request-promise','rimraf','./smsTransferReport.attributes'];(function(_0x435447,_0x3c242b){var _0x590f37=function(_0x1a622b){while(--_0x1a622b){_0x435447['push'](_0x435447['shift']());}};_0x590f37(++_0x3c242b);}(_0xedc0,0x12c));var _0x0edc=function(_0x2335e6,_0x1bade8){_0x2335e6=_0x2335e6-0x0;var _0x370a50=_0xedc0[_0x2335e6];return _0x370a50;};'use strict';var _=require(_0x0edc('0x0'));var util=require('util');var logger=require(_0x0edc('0x1'))(_0x0edc('0x2'));var moment=require(_0x0edc('0x3'));var BPromise=require(_0x0edc('0x4'));var rp=require(_0x0edc('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0edc('0x6'));var config=require('../../config/environment');var attributes=require(_0x0edc('0x7'));module['exports']=function(_0x597d9e,_0x20d011){return _0x597d9e['define'](_0x0edc('0x8'),attributes,{'tableName':_0x0edc('0x9'),'paranoid':![],'indexes':[{'name':_0x0edc('0xa'),'fields':[_0x0edc('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x7c8e=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./smsTransferReport.attributes','exports','define','SmsTransferReport','report_sms_transfer','uniqueid'];(function(_0x149989,_0x41684a){var _0x92453b=function(_0x22f566){while(--_0x22f566){_0x149989['push'](_0x149989['shift']());}};_0x92453b(++_0x41684a);}(_0x7c8e,0x10e));var _0xe7c8=function(_0x1bf301,_0xda5c4c){_0x1bf301=_0x1bf301-0x0;var _0x51c947=_0x7c8e[_0x1bf301];return _0x51c947;};'use strict';var _=require('lodash');var util=require(_0xe7c8('0x0'));var logger=require(_0xe7c8('0x1'))(_0xe7c8('0x2'));var moment=require(_0xe7c8('0x3'));var BPromise=require(_0xe7c8('0x4'));var rp=require(_0xe7c8('0x5'));var fs=require('fs');var path=require(_0xe7c8('0x6'));var rimraf=require(_0xe7c8('0x7'));var config=require(_0xe7c8('0x8'));var attributes=require(_0xe7c8('0x9'));module[_0xe7c8('0xa')]=function(_0x1f0a65,_0x293383){return _0x1f0a65[_0xe7c8('0xb')](_0xe7c8('0xc'),attributes,{'tableName':_0xe7c8('0xd'),'paranoid':![],'indexes':[{'name':_0xe7c8('0xe'),'fields':[_0xe7c8('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.rpc.js b/server/api/smsTransferReport/smsTransferReport.rpc.js index e667932..3e7f282 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 _0xe700=['request\x20sent','error','code','message','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','client','http','request','then','info','SmsTransferReport,\x20%s,\x20%s','debug','SmsTransferReport,\x20%s,\x20%s,\x20%s'];(function(_0x28cc3e,_0x131dd1){var _0x347414=function(_0x58c202){while(--_0x58c202){_0x28cc3e['push'](_0x28cc3e['shift']());}};_0x347414(++_0x131dd1);}(_0xe700,0x16a));var _0x0e70=function(_0x203284,_0x601740){_0x203284=_0x203284-0x0;var _0x52802d=_0xe700[_0x203284];return _0x52802d;};'use strict';var _=require(_0x0e70('0x0'));var util=require(_0x0e70('0x1'));var moment=require(_0x0e70('0x2'));var BPromise=require(_0x0e70('0x3'));var rs=require(_0x0e70('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0e70('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x0e70('0x6'))(_0x0e70('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x0e70('0x8')][_0x0e70('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4415bb,_0x65a900,_0x51382d){return new BPromise(function(_0x33f0c3,_0x37da83){return client[_0x0e70('0xa')](_0x4415bb,_0x51382d)[_0x0e70('0xb')](function(_0x151c76){logger[_0x0e70('0xc')](_0x0e70('0xd'),_0x65a900,'request\x20sent');logger[_0x0e70('0xe')](_0x0e70('0xf'),_0x65a900,_0x0e70('0x10'),JSON['stringify'](_0x151c76));if(_0x151c76[_0x0e70('0x11')]){if(_0x151c76[_0x0e70('0x11')][_0x0e70('0x12')]===0x1f4){logger[_0x0e70('0x11')](_0x0e70('0xd'),_0x65a900,_0x151c76[_0x0e70('0x11')]['message']);return _0x37da83(_0x151c76[_0x0e70('0x11')][_0x0e70('0x13')]);}logger[_0x0e70('0x11')](_0x0e70('0xd'),_0x65a900,_0x151c76[_0x0e70('0x11')][_0x0e70('0x13')]);return _0x33f0c3(_0x151c76['error']['message']);}else{logger[_0x0e70('0xc')](_0x0e70('0xd'),_0x65a900,_0x0e70('0x10'));_0x33f0c3(_0x151c76['result'][_0x0e70('0x13')]);}})[_0x0e70('0x14')](function(_0x3c9545){logger[_0x0e70('0x11')](_0x0e70('0xd'),_0x65a900,_0x3c9545);_0x37da83(_0x3c9545);});});} \ No newline at end of file +var _0x956a=['message','info','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request','then','SmsTransferReport,\x20%s,\x20%s','request\x20sent','SmsTransferReport,\x20%s,\x20%s,\x20%s','error','code'];(function(_0x2a68b3,_0x21b722){var _0x5181c1=function(_0x266dbe){while(--_0x266dbe){_0x2a68b3['push'](_0x2a68b3['shift']());}};_0x5181c1(++_0x21b722);}(_0x956a,0xb6));var _0xa956=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x956a[_0x3947c9];return _0x2e7871;};'use strict';var _=require('lodash');var util=require(_0xa956('0x0'));var moment=require(_0xa956('0x1'));var BPromise=require(_0xa956('0x2'));var rs=require(_0xa956('0x3'));var fs=require('fs');var Redis=require(_0xa956('0x4'));var db=require(_0xa956('0x5'))['db'];var utils=require(_0xa956('0x6'));var logger=require(_0xa956('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0xa956('0x8'));var client=jayson[_0xa956('0x9')][_0xa956('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5f1684,_0xdaa956,_0x1318ea){return new BPromise(function(_0x1265dd,_0x10f0e3){return client[_0xa956('0xb')](_0x5f1684,_0x1318ea)[_0xa956('0xc')](function(_0x380479){logger['info'](_0xa956('0xd'),_0xdaa956,_0xa956('0xe'));logger['debug'](_0xa956('0xf'),_0xdaa956,_0xa956('0xe'),JSON['stringify'](_0x380479));if(_0x380479['error']){if(_0x380479[_0xa956('0x10')][_0xa956('0x11')]===0x1f4){logger[_0xa956('0x10')]('SmsTransferReport,\x20%s,\x20%s',_0xdaa956,_0x380479[_0xa956('0x10')][_0xa956('0x12')]);return _0x10f0e3(_0x380479[_0xa956('0x10')]['message']);}logger['error'](_0xa956('0xd'),_0xdaa956,_0x380479['error']['message']);return _0x1265dd(_0x380479[_0xa956('0x10')][_0xa956('0x12')]);}else{logger[_0xa956('0x13')]('SmsTransferReport,\x20%s,\x20%s',_0xdaa956,'request\x20sent');_0x1265dd(_0x380479['result'][_0xa956('0x12')]);}})['catch'](function(_0x36e181){logger[_0xa956('0x10')](_0xa956('0xd'),_0xdaa956,_0x36e181);_0x10f0e3(_0x36e181);});});} \ No newline at end of file diff --git a/server/api/sound/index.js b/server/api/sound/index.js index 0d616ca..2752461 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 _0x24d8=['express','Router','../../components/auth/service','../../components/interaction/service','./sound.controller','get','/:id','isAuthenticated','show','/:id/download','download','diskStorage','join','root','originalname','format','%s-%s%s','basename','extname','now','post','single','file','create','put','update','delete','multer','util','connect-timeout'];(function(_0x386e95,_0x5ec588){var _0xb4cdf6=function(_0x18f357){while(--_0x18f357){_0x386e95['push'](_0x386e95['shift']());}};_0xb4cdf6(++_0x5ec588);}(_0x24d8,0x165));var _0x824d=function(_0x11c573,_0x9e7c6e){_0x11c573=_0x11c573-0x0;var _0x6b72de=_0x24d8[_0x11c573];return _0x6b72de;};'use strict';var multer=require(_0x824d('0x0'));var util=require(_0x824d('0x1'));var path=require('path');var timeout=require(_0x824d('0x2'));var express=require(_0x824d('0x3'));var router=express[_0x824d('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x824d('0x5'));var interaction=require(_0x824d('0x6'));var config=require('../../config/environment');var controller=require(_0x824d('0x7'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x824d('0x8')](_0x824d('0x9'),auth[_0x824d('0xa')](),controller[_0x824d('0xb')]);router['get'](_0x824d('0xc'),auth[_0x824d('0xa')](),controller[_0x824d('0xd')]);var upload=multer({'storage':multer[_0x824d('0xe')]({'destination':function(_0x3a3af8,_0x4aba37,_0x3b0b3){_0x3b0b3(null,path[_0x824d('0xf')](config[_0x824d('0x10')],'server/files/sounds/original/'));},'filename':function(_0x1d7e54,_0x2b0004,_0x68a1a8){_0x2b0004[_0x824d('0x11')]=_0x2b0004[_0x824d('0x11')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x68a1a8(null,util[_0x824d('0x12')](_0x824d('0x13'),path[_0x824d('0x14')](_0x2b0004[_0x824d('0x11')],path[_0x824d('0x15')](_0x2b0004[_0x824d('0x11')])),Date[_0x824d('0x16')](),path[_0x824d('0x15')](_0x2b0004['originalname'])));}})});router[_0x824d('0x17')]('/',upload[_0x824d('0x18')](_0x824d('0x19')),controller[_0x824d('0x1a')]);router[_0x824d('0x1b')](_0x824d('0x9'),auth[_0x824d('0xa')](),controller[_0x824d('0x1c')]);router[_0x824d('0x1d')]('/:id',auth[_0x824d('0xa')](),controller[_0x824d('0x1d')]);module['exports']=router; \ No newline at end of file +var _0x9e86=['put','delete','exports','path','connect-timeout','Router','../../config/environment','./sound.controller','get','isAuthenticated','/:id','show','/:id/download','download','diskStorage','join','root','server/files/sounds/original/','originalname','format','%s-%s%s','extname','now','post','single','file'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x9e86,0x1f1));var _0x69e8=function(_0x2f0ba9,_0x4e0d24){_0x2f0ba9=_0x2f0ba9-0x0;var _0x48af1d=_0x9e86[_0x2f0ba9];return _0x48af1d;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x69e8('0x0'));var timeout=require(_0x69e8('0x1'));var express=require('express');var router=express[_0x69e8('0x2')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x69e8('0x3'));var controller=require(_0x69e8('0x4'));router[_0x69e8('0x5')]('/',auth[_0x69e8('0x6')](),controller['index']);router['get'](_0x69e8('0x7'),auth[_0x69e8('0x6')](),controller[_0x69e8('0x8')]);router['get'](_0x69e8('0x9'),auth[_0x69e8('0x6')](),controller[_0x69e8('0xa')]);var upload=multer({'storage':multer[_0x69e8('0xb')]({'destination':function(_0x143428,_0x49d3c5,_0x186b92){_0x186b92(null,path[_0x69e8('0xc')](config[_0x69e8('0xd')],_0x69e8('0xe')));},'filename':function(_0x5aa925,_0x3a6dde,_0x8a12e0){_0x3a6dde['originalname']=_0x3a6dde[_0x69e8('0xf')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x8a12e0(null,util[_0x69e8('0x10')](_0x69e8('0x11'),path['basename'](_0x3a6dde[_0x69e8('0xf')],path[_0x69e8('0x12')](_0x3a6dde[_0x69e8('0xf')])),Date[_0x69e8('0x13')](),path[_0x69e8('0x12')](_0x3a6dde[_0x69e8('0xf')])));}})});router[_0x69e8('0x14')]('/',upload[_0x69e8('0x15')](_0x69e8('0x16')),controller['create']);router[_0x69e8('0x17')]('/:id',auth[_0x69e8('0x6')](),controller['update']);router[_0x69e8('0x18')]('/:id',auth[_0x69e8('0x6')](),controller['delete']);module[_0x69e8('0x19')]=router; \ No newline at end of file diff --git a/server/api/sound/sound.attributes.js b/server/api/sound/sound.attributes.js index 95a90ca..b143d4e 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 _0x5a62=['BIGINT','INTEGER','sequelize','STRING','name','FLOAT'];(function(_0x487496,_0x249683){var _0x539dc8=function(_0x2c38e1){while(--_0x2c38e1){_0x487496['push'](_0x487496['shift']());}};_0x539dc8(++_0x249683);}(_0x5a62,0x1ac));var _0x25a6=function(_0x5b8b97,_0x6b4dfa){_0x5b8b97=_0x5b8b97-0x0;var _0x1fdf84=_0x5a62[_0x5b8b97];return _0x1fdf84;};'use strict';var Sequelize=require(_0x25a6('0x0'));module['exports']={'name':{'type':Sequelize[_0x25a6('0x1')],'unique':_0x25a6('0x2'),'allowNull':![]},'save_name':{'type':Sequelize[_0x25a6('0x1')]},'display_name':{'type':Sequelize[_0x25a6('0x1')],'defaultValue':''},'description':{'type':Sequelize['STRING']},'original_format':{'type':Sequelize[_0x25a6('0x1')]},'original_duration':{'type':Sequelize[_0x25a6('0x3')]},'original_sampleCount':{'type':Sequelize[_0x25a6('0x4')]},'original_channelCount':{'type':Sequelize[_0x25a6('0x5')]},'original_bitRate':{'type':Sequelize['BIGINT']},'original_sampleRate':{'type':Sequelize['INTEGER']},'converted_format':{'type':Sequelize[_0x25a6('0x1')]},'converted_duration':{'type':Sequelize['FLOAT']},'converted_sampleCount':{'type':Sequelize[_0x25a6('0x4')]},'converted_channelCount':{'type':Sequelize[_0x25a6('0x5')]},'converted_bitRate':{'type':Sequelize[_0x25a6('0x4')]},'converted_sampleRate':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0x32c2=['name','BIGINT','INTEGER','FLOAT','sequelize','exports','STRING'];(function(_0x1d4612,_0x46203c){var _0x1ab519=function(_0x5b459b){while(--_0x5b459b){_0x1d4612['push'](_0x1d4612['shift']());}};_0x1ab519(++_0x46203c);}(_0x32c2,0x90));var _0x232c=function(_0x5b8b20,_0x79b0a9){_0x5b8b20=_0x5b8b20-0x0;var _0x5bc4df=_0x32c2[_0x5b8b20];return _0x5bc4df;};'use strict';var Sequelize=require(_0x232c('0x0'));module[_0x232c('0x1')]={'name':{'type':Sequelize[_0x232c('0x2')],'unique':_0x232c('0x3'),'allowNull':![]},'save_name':{'type':Sequelize['STRING']},'display_name':{'type':Sequelize['STRING'],'defaultValue':''},'description':{'type':Sequelize['STRING']},'original_format':{'type':Sequelize[_0x232c('0x2')]},'original_duration':{'type':Sequelize['FLOAT']},'original_sampleCount':{'type':Sequelize[_0x232c('0x4')]},'original_channelCount':{'type':Sequelize[_0x232c('0x5')]},'original_bitRate':{'type':Sequelize[_0x232c('0x4')]},'original_sampleRate':{'type':Sequelize[_0x232c('0x5')]},'converted_format':{'type':Sequelize[_0x232c('0x2')]},'converted_duration':{'type':Sequelize[_0x232c('0x6')]},'converted_sampleCount':{'type':Sequelize[_0x232c('0x4')]},'converted_channelCount':{'type':Sequelize[_0x232c('0x5')]},'converted_bitRate':{'type':Sequelize[_0x232c('0x4')]},'converted_sampleRate':{'type':Sequelize[_0x232c('0x5')]}}; \ No newline at end of file diff --git a/server/api/sound/sound.controller.js b/server/api/sound/sound.controller.js index 8bdfb3d..032b3c3 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 _0x57f5=['sampleCount','channelCount','original_bitRate','bitRate','original_sampleRate','sampleRate','dest','converted_duration','converted_channelCount','converted_sampleRate','body','role','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','get','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','start','params','pick','description','delete','original_format','fast-json-patch','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','limit','undefined','count','Content-Range','apply','reject','update','then','destroy','Sounds','UserProfileResource','error','stack','name','send','index','map','rawAttributes','type','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filter','merge','VIRTUAL','options','Sound','includeAll','include','findAll','show','find','catch','download','save_name','converted_format','join','root','server/files/sounds/converted','Sequelize','ValidationError','format','%s.%s','create','basename','originalname','extname','file','filename','substring','wav','server/files/sounds/original','info','Sound\x20upload\x20destination:\x20%s','chmodSync','0777','unlinkSync','src','duration','original_sampleCount'];(function(_0x3ae1bf,_0x20a7e1){var _0x350253=function(_0x437520){while(--_0x437520){_0x3ae1bf['push'](_0x3ae1bf['shift']());}};_0x350253(++_0x20a7e1);}(_0x57f5,0x8e));var _0x557f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x57f5[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x557f('0x0'));var rp=require('request-promise');var moment=require(_0x557f('0x1'));var BPromise=require(_0x557f('0x2'));var Mustache=require(_0x557f('0x3'));var util=require('util');var path=require('path');var sox=require(_0x557f('0x4'));var csv=require(_0x557f('0x5'));var ejs=require(_0x557f('0x6'));var fs=require('fs');var fs_extra=require(_0x557f('0x7'));var _=require(_0x557f('0x8'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x557f('0x9'));var toCsv=require(_0x557f('0x5'));var querystring=require(_0x557f('0xa'));var Papa=require(_0x557f('0xb'));var Redis=require('ioredis');var authService=require(_0x557f('0xc'));var qs=require(_0x557f('0xd'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x557f('0xe'));var logger=require(_0x557f('0xf'))('api');var utils=require(_0x557f('0x10'));var config=require(_0x557f('0x11'));var licenseUtil=require('../../config/license/util');var db=require(_0x557f('0x12'))['db'];function respondWithStatusCode(_0x13362d,_0x3fcd7f){_0x3fcd7f=_0x3fcd7f||0xcc;return function(_0x180641){if(_0x180641){return _0x13362d['sendStatus'](_0x3fcd7f);}return _0x13362d[_0x557f('0x13')](_0x3fcd7f)[_0x557f('0x14')]();};}function respondWithResult(_0x14c43d,_0x1b68df){_0x1b68df=_0x1b68df||0xc8;return function(_0x1472b5){if(_0x1472b5){return _0x14c43d[_0x557f('0x13')](_0x1b68df)[_0x557f('0x15')](_0x1472b5);}};}function respondWithFilteredResult(_0x7ac4c3,_0x57d9fc){return function(_0x28e907){if(_0x28e907){var _0x7a3fdf=typeof _0x57d9fc[_0x557f('0x16')]==='undefined'&&typeof _0x57d9fc[_0x557f('0x17')]===_0x557f('0x18');var _0x3d7096=_0x28e907[_0x557f('0x19')];var _0x53bf90=_0x7a3fdf?0x0:_0x57d9fc['offset'];var _0x566706=_0x7a3fdf?_0x28e907[_0x557f('0x19')]:_0x57d9fc[_0x557f('0x16')]+_0x57d9fc[_0x557f('0x17')];var _0x4c2681;if(_0x566706>=_0x3d7096){_0x566706=_0x3d7096;_0x4c2681=0xc8;}else{_0x4c2681=0xce;}_0x7ac4c3[_0x557f('0x13')](_0x4c2681);return _0x7ac4c3['set'](_0x557f('0x1a'),_0x53bf90+'-'+_0x566706+'/'+_0x3d7096)[_0x557f('0x15')](_0x28e907);}return null;};}function patchUpdates(_0x30ff6e){return function(_0x3045f8){try{jsonpatch[_0x557f('0x1b')](_0x3045f8,_0x30ff6e,!![]);}catch(_0x1c8aee){return BPromise[_0x557f('0x1c')](_0x1c8aee);}return _0x3045f8['save']();};}function saveUpdates(_0xcb7555,_0x4ce901){return function(_0x5546f5){if(_0x5546f5){return _0x5546f5[_0x557f('0x1d')](_0xcb7555)[_0x557f('0x1e')](function(_0x92bf4c){return _0x92bf4c;});}return null;};}function removeEntity(_0x536bb3,_0x35a875){return function(_0x4a0c12){if(_0x4a0c12){return _0x4a0c12[_0x557f('0x1f')]()[_0x557f('0x1e')](function(){var _0x514822=_0x4a0c12['get']({'plain':!![]});var _0x3faff8=_0x557f('0x20');return db[_0x557f('0x21')]['destroy']({'where':{'type':_0x3faff8,'resourceId':_0x514822['id']}})[_0x557f('0x1e')](function(){return _0x4a0c12;});})[_0x557f('0x1e')](function(){_0x536bb3[_0x557f('0x13')](0xcc)[_0x557f('0x14')]();});}};}function handleEntityNotFound(_0x1a1382,_0x37b67a){return function(_0x3bba7f){if(!_0x3bba7f){_0x1a1382['sendStatus'](0x194);}return _0x3bba7f;};}function handleError(_0x225fb1,_0x530c8c){_0x530c8c=_0x530c8c||0x1f4;return function(_0x607660){logger[_0x557f('0x22')](_0x607660[_0x557f('0x23')]);if(_0x607660[_0x557f('0x24')]){delete _0x607660[_0x557f('0x24')];}_0x225fb1['status'](_0x530c8c)[_0x557f('0x25')](_0x607660);};}exports[_0x557f('0x26')]=function(_0x13f393,_0x43f40a){var _0x1778ff={},_0x3ac692={},_0xf0ad28={'count':0x0,'rows':[]};var _0x216bc5=_[_0x557f('0x27')](db['Sound'][_0x557f('0x28')],function(_0x1f1621){return{'name':_0x1f1621['fieldName'],'type':_0x1f1621[_0x557f('0x29')]['key']};});_0x3ac692[_0x557f('0x2a')]=_[_0x557f('0x27')](_0x216bc5,_0x557f('0x24'));_0x3ac692['query']=_[_0x557f('0x2b')](_0x13f393[_0x557f('0x2c')]);_0x3ac692[_0x557f('0x2d')]=_[_0x557f('0x2e')](_0x3ac692[_0x557f('0x2a')],_0x3ac692[_0x557f('0x2c')]);_0x1778ff[_0x557f('0x2f')]=_[_0x557f('0x2e')](_0x3ac692[_0x557f('0x2a')],qs['fields'](_0x13f393[_0x557f('0x2c')][_0x557f('0x30')]));_0x1778ff[_0x557f('0x2f')]=_0x1778ff[_0x557f('0x2f')][_0x557f('0x31')]?_0x1778ff[_0x557f('0x2f')]:_0x3ac692[_0x557f('0x2a')];if(!_0x13f393[_0x557f('0x2c')][_0x557f('0x32')]('nolimit')){_0x1778ff['limit']=qs[_0x557f('0x17')](_0x13f393[_0x557f('0x2c')][_0x557f('0x17')]);_0x1778ff[_0x557f('0x16')]=qs[_0x557f('0x16')](_0x13f393[_0x557f('0x2c')][_0x557f('0x16')]);}_0x1778ff[_0x557f('0x33')]=qs['sort'](_0x13f393[_0x557f('0x2c')][_0x557f('0x34')]);_0x1778ff[_0x557f('0x35')]=qs[_0x557f('0x2d')](_['pick'](_0x13f393[_0x557f('0x2c')],_0x3ac692['filters']),_0x216bc5);if(_0x13f393[_0x557f('0x2c')][_0x557f('0x36')]){_0x1778ff[_0x557f('0x35')]=_[_0x557f('0x37')](_0x1778ff[_0x557f('0x35')],{'$or':_[_0x557f('0x27')](_0x216bc5,function(_0x52f74e){if(_0x52f74e['type']!==_0x557f('0x38')){var _0x2af345={};_0x2af345[_0x52f74e[_0x557f('0x24')]]={'$like':'%'+_0x13f393['query']['filter']+'%'};return _0x2af345;}})});}_0x1778ff=_['merge']({},_0x1778ff,_0x13f393[_0x557f('0x39')]);var _0x127924={'where':_0x1778ff['where']};return db[_0x557f('0x3a')][_0x557f('0x19')](_0x127924)[_0x557f('0x1e')](function(_0x422665){_0xf0ad28[_0x557f('0x19')]=_0x422665;if(_0x13f393['query'][_0x557f('0x3b')]){_0x1778ff[_0x557f('0x3c')]=[{'all':!![]}];}return db[_0x557f('0x3a')][_0x557f('0x3d')](_0x1778ff);})['then'](function(_0x5e19e1){_0xf0ad28['rows']=_0x5e19e1;return _0xf0ad28;})['then'](respondWithFilteredResult(_0x43f40a,_0x1778ff))['catch'](handleError(_0x43f40a,null));};exports[_0x557f('0x3e')]=function(_0x5c8ef4,_0x3fadf5){var _0x345a22={'raw':!![],'where':{'id':_0x5c8ef4['params']['id']}},_0x1b4c1b={};_0x1b4c1b[_0x557f('0x2a')]=_[_0x557f('0x2b')](db[_0x557f('0x3a')][_0x557f('0x28')]);_0x1b4c1b['query']=_[_0x557f('0x2b')](_0x5c8ef4['query']);_0x1b4c1b['filters']=_['intersection'](_0x1b4c1b[_0x557f('0x2a')],_0x1b4c1b[_0x557f('0x2c')]);_0x345a22[_0x557f('0x2f')]=_[_0x557f('0x2e')](_0x1b4c1b[_0x557f('0x2a')],qs[_0x557f('0x30')](_0x5c8ef4[_0x557f('0x2c')][_0x557f('0x30')]));_0x345a22[_0x557f('0x2f')]=_0x345a22[_0x557f('0x2f')]['length']?_0x345a22[_0x557f('0x2f')]:_0x1b4c1b[_0x557f('0x2a')];if(_0x5c8ef4[_0x557f('0x2c')][_0x557f('0x3b')]){_0x345a22[_0x557f('0x3c')]=[{'all':!![]}];}_0x345a22=_[_0x557f('0x37')]({},_0x345a22,_0x5c8ef4[_0x557f('0x39')]);return db[_0x557f('0x3a')][_0x557f('0x3f')](_0x345a22)[_0x557f('0x1e')](handleEntityNotFound(_0x3fadf5,null))[_0x557f('0x1e')](respondWithResult(_0x3fadf5,null))[_0x557f('0x40')](handleError(_0x3fadf5,null));};exports[_0x557f('0x41')]=function(_0x51fd33,_0x3a6c92,_0x23c7a9){return db['Sound'][_0x557f('0x3f')]({'where':{'id':_0x51fd33['params']['id']},'attributes':['name',_0x557f('0x42'),_0x557f('0x43')],'raw':!![]})[_0x557f('0x1e')](handleEntityNotFound(_0x3a6c92,null))[_0x557f('0x1e')](function(_0x49f6dd){if(_0x49f6dd){if(!fs['existsSync'](path[_0x557f('0x44')](config[_0x557f('0x45')],_0x557f('0x46'),_0x49f6dd[_0x557f('0x42')]+'.'+_0x49f6dd[_0x557f('0x43')]))){throw new db[(_0x557f('0x47'))][(_0x557f('0x48'))]('Sound\x20not\x20found');}return _0x3a6c92['download'](path[_0x557f('0x44')](config['root'],'server/files/sounds/converted',util[_0x557f('0x49')]('%s.%s',_0x49f6dd[_0x557f('0x42')],_0x49f6dd['converted_format'])),util[_0x557f('0x49')](_0x557f('0x4a'),_0x49f6dd[_0x557f('0x24')],_0x49f6dd[_0x557f('0x43')]));}return null;})['catch'](handleError(_0x3a6c92,null));};exports[_0x557f('0x4b')]=function(_0x59bb56,_0x3800bf,_0x3b846b){var _0x5b3d85={'name':path[_0x557f('0x4c')](_0x59bb56['file'][_0x557f('0x4d')],path[_0x557f('0x4e')](_0x59bb56[_0x557f('0x4f')][_0x557f('0x4d')])),'save_name':path[_0x557f('0x4c')](_0x59bb56['file'][_0x557f('0x50')],path[_0x557f('0x4e')](_0x59bb56[_0x557f('0x4f')][_0x557f('0x50')])),'original_format':path[_0x557f('0x4e')](_0x59bb56[_0x557f('0x4f')]['originalname'])[_0x557f('0x51')](0x1),'converted_format':_0x557f('0x52')};var _0x4b9d55=path[_0x557f('0x44')](config[_0x557f('0x45')],_0x557f('0x53'),_0x59bb56['file'][_0x557f('0x50')]);var _0x17a72b=path[_0x557f('0x44')](config[_0x557f('0x45')],_0x557f('0x46'),util[_0x557f('0x49')](_0x557f('0x4a'),path['basename'](_0x59bb56[_0x557f('0x4f')]['filename'],path[_0x557f('0x4e')](_0x59bb56[_0x557f('0x4f')][_0x557f('0x50')])),_0x5b3d85[_0x557f('0x43')]));logger[_0x557f('0x54')]('Sound\x20upload\x20filepath:\x20%s',_0x4b9d55);logger[_0x557f('0x54')](_0x557f('0x55'),_0x17a72b);try{fs[_0x557f('0x56')](_0x4b9d55,parseInt(_0x557f('0x57'),0x8));var _0x5f4b3e=sox['transcode'](_0x4b9d55,_0x17a72b,{'sampleRate':0x1f40,'format':_0x557f('0x52'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x5f4b3e['on'](_0x557f('0x22'),function(_0x50983d){fs[_0x557f('0x58')](_0x4b9d55);_0x3800bf[_0x557f('0x13')](0x1f4)[_0x557f('0x25')](_0x50983d);});_0x5f4b3e['on'](_0x557f('0x59'),function(_0xebe678){_0x5b3d85['original_duration']=isNaN(_0xebe678['duration'])?null:_0xebe678[_0x557f('0x5a')]*0x3e8;_0x5b3d85[_0x557f('0x5b')]=isNaN(_0xebe678[_0x557f('0x5c')])?null:_0xebe678['sampleCount'];_0x5b3d85['original_channelCount']=isNaN(_0xebe678[_0x557f('0x5d')])?null:_0xebe678[_0x557f('0x5d')];_0x5b3d85[_0x557f('0x5e')]=isNaN(_0xebe678[_0x557f('0x5f')])?null:_0xebe678[_0x557f('0x5f')];_0x5b3d85[_0x557f('0x60')]=isNaN(_0xebe678[_0x557f('0x61')])?null:_0xebe678[_0x557f('0x61')];});_0x5f4b3e['on'](_0x557f('0x62'),function(_0x3a861c){_0x5b3d85[_0x557f('0x63')]=isNaN(_0x3a861c['duration'])?null:_0x3a861c[_0x557f('0x5a')]*0x3e8;_0x5b3d85['converted_sampleCount']=isNaN(_0x3a861c[_0x557f('0x5c')])?null:_0x3a861c[_0x557f('0x5c')];_0x5b3d85[_0x557f('0x64')]=isNaN(_0x3a861c['channelCount'])?null:_0x3a861c['channelCount'];_0x5b3d85['converted_bitRate']=isNaN(_0x3a861c['bitRate'])?null:_0x3a861c[_0x557f('0x5f')];_0x5b3d85[_0x557f('0x65')]=isNaN(_0x3a861c['sampleRate'])?null:_0x3a861c[_0x557f('0x61')];});_0x5f4b3e['on']('end',function(){fs[_0x557f('0x56')](_0x17a72b,parseInt(_0x557f('0x57'),0x8));return db['Sound'][_0x557f('0x4b')](_0x5b3d85)['then'](function(_0x5e0805){var _0x3cca74={'role':_0x59bb56[_0x557f('0x66')][_0x557f('0x67')],'userProfileId':_0x59bb56['body'][_0x557f('0x68')]};if(!_0x3cca74)throw new Error(_0x557f('0x69'));if(_0x3cca74['role']===_0x557f('0x6a')){var _0x5114da=_0x5e0805[_0x557f('0x6b')]({'plain':!![]});return db[_0x557f('0x6c')][_0x557f('0x3f')]({'where':{'name':_0x557f('0x20'),'userProfileId':_0x3cca74[_0x557f('0x68')]},'raw':!![]})['then'](function(_0x79f6c0){if(_0x79f6c0&&_0x79f6c0[_0x557f('0x6d')]===0x0){return db['UserProfileResource'][_0x557f('0x4b')]({'name':_0x5114da[_0x557f('0x24')],'resourceId':_0x5114da['id'],'type':_0x79f6c0[_0x557f('0x24')],'sectionId':_0x79f6c0['id']},{})[_0x557f('0x1e')](function(){return _0x5e0805;});}else{return _0x5e0805;}})[_0x557f('0x40')](function(_0x4ebe31){logger[_0x557f('0x22')](_0x557f('0x6e'),_0x4ebe31);throw _0x4ebe31;});}return _0x5e0805;})[_0x557f('0x1e')](respondWithResult(_0x3800bf,null))['catch'](handleError(_0x3800bf,null));});_0x5f4b3e[_0x557f('0x6f')]();}catch(_0x558d77){_0x3800bf[_0x557f('0x13')](0x1f4)[_0x557f('0x25')](_0x558d77);}};exports[_0x557f('0x1d')]=function(_0x196eda,_0x21ac0b,_0x3c335d){return db[_0x557f('0x3a')][_0x557f('0x3f')]({'where':{'id':_0x196eda[_0x557f('0x70')]['id']}})['then'](handleEntityNotFound(_0x21ac0b,null))[_0x557f('0x1e')](saveUpdates(_[_0x557f('0x71')](_0x196eda[_0x557f('0x66')],[_0x557f('0x24'),_0x557f('0x72')]),null))[_0x557f('0x1e')](respondWithResult(_0x21ac0b,null))[_0x557f('0x40')](handleError(_0x21ac0b,null));};exports[_0x557f('0x73')]=function(_0x546978,_0xdd505c,_0x26b3d0){return db['Sound'][_0x557f('0x3f')]({'where':{'id':_0x546978['params']['id']}})[_0x557f('0x1e')](function(_0x53314a){if(_0x53314a){return _0x53314a['destroy']();}})[_0x557f('0x1e')](function(_0x5a73ea){var _0x1a3fb0=path['join'](config[_0x557f('0x45')],'server/files/sounds/original',util[_0x557f('0x49')](_0x557f('0x4a'),_0x5a73ea['save_name'],_0x5a73ea[_0x557f('0x74')]));var _0x2d51a8=path[_0x557f('0x44')](config[_0x557f('0x45')],_0x557f('0x46'),util[_0x557f('0x49')](_0x557f('0x4a'),_0x5a73ea[_0x557f('0x42')],_0x5a73ea['converted_format']));fs[_0x557f('0x58')](_0x1a3fb0);fs['unlinkSync'](_0x2d51a8);return _0x5a73ea;})[_0x557f('0x1e')](function(_0x519dbe){if(_0x519dbe){return _0xdd505c[_0x557f('0x13')](0xcc)['end']();}})[_0x557f('0x1e')](handleEntityNotFound(_0xdd505c,null))[_0x557f('0x40')](handleError(_0xdd505c,null));}; \ No newline at end of file +var _0xa28c=['transcode','error','unlinkSync','send','src','duration','original_sampleCount','original_channelCount','channelCount','original_bitRate','bitRate','original_sampleRate','sampleRate','dest','converted_sampleCount','sampleCount','converted_channelCount','converted_bitRate','converted_sampleRate','0777','body','role','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','autoAssociation','UserProfileResource','start','description','delete','original_format','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','get','Sounds','stack','name','map','Sound','fieldName','type','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','rawAttributes','keys','find','catch','download','params','save_name','converted_format','existsSync','join','server/files/sounds/converted','Sequelize','ValidationError','Sound\x20not\x20found','%s.%s','format','create','basename','file','originalname','extname','filename','substring','wav','root','server/files/sounds/original','info','Sound\x20upload\x20destination:\x20%s','chmodSync'];(function(_0x3098f2,_0x859a3d){var _0x4f9e1a=function(_0x5e517f){while(--_0x5e517f){_0x3098f2['push'](_0x3098f2['shift']());}};_0x4f9e1a(++_0x859a3d);}(_0xa28c,0x197));var _0xca28=function(_0x422905,_0x3bce3a){_0x422905=_0x422905-0x0;var _0x33dc6c=_0xa28c[_0x422905];return _0x33dc6c;};'use strict';var emlformat=require(_0xca28('0x0'));var rimraf=require(_0xca28('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xca28('0x2'));var rp=require(_0xca28('0x3'));var moment=require('moment');var BPromise=require(_0xca28('0x4'));var Mustache=require(_0xca28('0x5'));var util=require(_0xca28('0x6'));var path=require(_0xca28('0x7'));var sox=require(_0xca28('0x8'));var csv=require(_0xca28('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xca28('0xa'));var squel=require(_0xca28('0xb'));var crypto=require(_0xca28('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xca28('0xd'));var toCsv=require('to-csv');var querystring=require(_0xca28('0xe'));var Papa=require('papaparse');var Redis=require(_0xca28('0xf'));var authService=require(_0xca28('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xca28('0x11'));var hardwareService=require(_0xca28('0x12'));var logger=require(_0xca28('0x13'))(_0xca28('0x14'));var utils=require(_0xca28('0x15'));var config=require(_0xca28('0x16'));var licenseUtil=require(_0xca28('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2a9997,_0x1b6660){_0x1b6660=_0x1b6660||0xcc;return function(_0x314936){if(_0x314936){return _0x2a9997['sendStatus'](_0x1b6660);}return _0x2a9997[_0xca28('0x18')](_0x1b6660)[_0xca28('0x19')]();};}function respondWithResult(_0x26adce,_0x2f26b6){_0x2f26b6=_0x2f26b6||0xc8;return function(_0x2b541d){if(_0x2b541d){return _0x26adce[_0xca28('0x18')](_0x2f26b6)[_0xca28('0x1a')](_0x2b541d);}};}function respondWithFilteredResult(_0x58a8f9,_0x3622a3){return function(_0xdaee43){if(_0xdaee43){var _0x3541bc=typeof _0x3622a3[_0xca28('0x1b')]===_0xca28('0x1c')&&typeof _0x3622a3[_0xca28('0x1d')]===_0xca28('0x1c');var _0x3b042f=_0xdaee43[_0xca28('0x1e')];var _0x35ad72=_0x3541bc?0x0:_0x3622a3[_0xca28('0x1b')];var _0x12966d=_0x3541bc?_0xdaee43[_0xca28('0x1e')]:_0x3622a3[_0xca28('0x1b')]+_0x3622a3[_0xca28('0x1d')];var _0x43f5b9;if(_0x12966d>=_0x3b042f){_0x12966d=_0x3b042f;_0x43f5b9=0xc8;}else{_0x43f5b9=0xce;}_0x58a8f9[_0xca28('0x18')](_0x43f5b9);return _0x58a8f9[_0xca28('0x1f')]('Content-Range',_0x35ad72+'-'+_0x12966d+'/'+_0x3b042f)['json'](_0xdaee43);}return null;};}function patchUpdates(_0x3a1f41){return function(_0x567301){try{jsonpatch[_0xca28('0x20')](_0x567301,_0x3a1f41,!![]);}catch(_0x14fb25){return BPromise[_0xca28('0x21')](_0x14fb25);}return _0x567301[_0xca28('0x22')]();};}function saveUpdates(_0x473a45,_0x2f08d3){return function(_0x2a9869){if(_0x2a9869){return _0x2a9869[_0xca28('0x23')](_0x473a45)[_0xca28('0x24')](function(_0x55ef1b){return _0x55ef1b;});}return null;};}function removeEntity(_0x3336bc,_0x4234c1){return function(_0x5462b6){if(_0x5462b6){return _0x5462b6[_0xca28('0x25')]()['then'](function(){var _0x4e9f2f=_0x5462b6[_0xca28('0x26')]({'plain':!![]});var _0x3a9885=_0xca28('0x27');return db['UserProfileResource']['destroy']({'where':{'type':_0x3a9885,'resourceId':_0x4e9f2f['id']}})['then'](function(){return _0x5462b6;});})[_0xca28('0x24')](function(){_0x3336bc[_0xca28('0x18')](0xcc)[_0xca28('0x19')]();});}};}function handleEntityNotFound(_0x31aac3,_0x18b0d4){return function(_0x1f097e){if(!_0x1f097e){_0x31aac3['sendStatus'](0x194);}return _0x1f097e;};}function handleError(_0xa38c67,_0x104b7f){_0x104b7f=_0x104b7f||0x1f4;return function(_0x5c2492){logger['error'](_0x5c2492[_0xca28('0x28')]);if(_0x5c2492[_0xca28('0x29')]){delete _0x5c2492[_0xca28('0x29')];}_0xa38c67[_0xca28('0x18')](_0x104b7f)['send'](_0x5c2492);};}exports['index']=function(_0x1fe677,_0x12df9d){var _0x5b874f={},_0x9a4fae={},_0x206eb4={'count':0x0,'rows':[]};var _0x1db27b=_[_0xca28('0x2a')](db[_0xca28('0x2b')]['rawAttributes'],function(_0x22bc77){return{'name':_0x22bc77[_0xca28('0x2c')],'type':_0x22bc77[_0xca28('0x2d')][_0xca28('0x2e')]};});_0x9a4fae['model']=_[_0xca28('0x2a')](_0x1db27b,_0xca28('0x29'));_0x9a4fae[_0xca28('0x2f')]=_['keys'](_0x1fe677['query']);_0x9a4fae[_0xca28('0x30')]=_[_0xca28('0x31')](_0x9a4fae[_0xca28('0x32')],_0x9a4fae[_0xca28('0x2f')]);_0x5b874f[_0xca28('0x33')]=_[_0xca28('0x31')](_0x9a4fae[_0xca28('0x32')],qs['fields'](_0x1fe677['query'][_0xca28('0x34')]));_0x5b874f[_0xca28('0x33')]=_0x5b874f['attributes'][_0xca28('0x35')]?_0x5b874f['attributes']:_0x9a4fae[_0xca28('0x32')];if(!_0x1fe677[_0xca28('0x2f')][_0xca28('0x36')]('nolimit')){_0x5b874f[_0xca28('0x1d')]=qs[_0xca28('0x1d')](_0x1fe677['query'][_0xca28('0x1d')]);_0x5b874f[_0xca28('0x1b')]=qs[_0xca28('0x1b')](_0x1fe677['query'][_0xca28('0x1b')]);}_0x5b874f[_0xca28('0x37')]=qs['sort'](_0x1fe677[_0xca28('0x2f')][_0xca28('0x38')]);_0x5b874f['where']=qs[_0xca28('0x30')](_[_0xca28('0x39')](_0x1fe677[_0xca28('0x2f')],_0x9a4fae['filters']),_0x1db27b);if(_0x1fe677['query'][_0xca28('0x3a')]){_0x5b874f[_0xca28('0x3b')]=_[_0xca28('0x3c')](_0x5b874f[_0xca28('0x3b')],{'$or':_[_0xca28('0x2a')](_0x1db27b,function(_0x469bf5){if(_0x469bf5['type']!==_0xca28('0x3d')){var _0x1bf426={};_0x1bf426[_0x469bf5['name']]={'$like':'%'+_0x1fe677[_0xca28('0x2f')][_0xca28('0x3a')]+'%'};return _0x1bf426;}})});}_0x5b874f=_[_0xca28('0x3c')]({},_0x5b874f,_0x1fe677[_0xca28('0x3e')]);var _0x401336={'where':_0x5b874f[_0xca28('0x3b')]};return db['Sound'][_0xca28('0x1e')](_0x401336)[_0xca28('0x24')](function(_0x4c4e7d){_0x206eb4['count']=_0x4c4e7d;if(_0x1fe677[_0xca28('0x2f')][_0xca28('0x3f')]){_0x5b874f['include']=[{'all':!![]}];}return db[_0xca28('0x2b')]['findAll'](_0x5b874f);})['then'](function(_0x1771c0){_0x206eb4['rows']=_0x1771c0;return _0x206eb4;})[_0xca28('0x24')](respondWithFilteredResult(_0x12df9d,_0x5b874f))['catch'](handleError(_0x12df9d,null));};exports['show']=function(_0x5b98b8,_0x39e072){var _0x5a63b9={'raw':!![],'where':{'id':_0x5b98b8['params']['id']}},_0x5a329a={};_0x5a329a[_0xca28('0x32')]=_['keys'](db['Sound'][_0xca28('0x40')]);_0x5a329a[_0xca28('0x2f')]=_[_0xca28('0x41')](_0x5b98b8[_0xca28('0x2f')]);_0x5a329a[_0xca28('0x30')]=_['intersection'](_0x5a329a['model'],_0x5a329a['query']);_0x5a63b9[_0xca28('0x33')]=_[_0xca28('0x31')](_0x5a329a[_0xca28('0x32')],qs[_0xca28('0x34')](_0x5b98b8['query'][_0xca28('0x34')]));_0x5a63b9['attributes']=_0x5a63b9['attributes'][_0xca28('0x35')]?_0x5a63b9[_0xca28('0x33')]:_0x5a329a['model'];if(_0x5b98b8['query']['includeAll']){_0x5a63b9['include']=[{'all':!![]}];}_0x5a63b9=_[_0xca28('0x3c')]({},_0x5a63b9,_0x5b98b8[_0xca28('0x3e')]);return db[_0xca28('0x2b')][_0xca28('0x42')](_0x5a63b9)['then'](handleEntityNotFound(_0x39e072,null))[_0xca28('0x24')](respondWithResult(_0x39e072,null))[_0xca28('0x43')](handleError(_0x39e072,null));};exports[_0xca28('0x44')]=function(_0x2955bb,_0x3d9530,_0x5be61a){return db[_0xca28('0x2b')][_0xca28('0x42')]({'where':{'id':_0x2955bb[_0xca28('0x45')]['id']},'attributes':[_0xca28('0x29'),_0xca28('0x46'),_0xca28('0x47')],'raw':!![]})[_0xca28('0x24')](handleEntityNotFound(_0x3d9530,null))[_0xca28('0x24')](function(_0x55fcc2){if(_0x55fcc2){if(!fs[_0xca28('0x48')](path[_0xca28('0x49')](config['root'],_0xca28('0x4a'),_0x55fcc2['save_name']+'.'+_0x55fcc2[_0xca28('0x47')]))){throw new db[(_0xca28('0x4b'))][(_0xca28('0x4c'))](_0xca28('0x4d'));}return _0x3d9530[_0xca28('0x44')](path[_0xca28('0x49')](config['root'],'server/files/sounds/converted',util['format'](_0xca28('0x4e'),_0x55fcc2[_0xca28('0x46')],_0x55fcc2[_0xca28('0x47')])),util[_0xca28('0x4f')]('%s.%s',_0x55fcc2[_0xca28('0x29')],_0x55fcc2[_0xca28('0x47')]));}return null;})[_0xca28('0x43')](handleError(_0x3d9530,null));};exports[_0xca28('0x50')]=function(_0x4f730f,_0x5e169d,_0x4dbfbd){var _0x319965={'name':path[_0xca28('0x51')](_0x4f730f[_0xca28('0x52')][_0xca28('0x53')],path['extname'](_0x4f730f[_0xca28('0x52')][_0xca28('0x53')])),'save_name':path[_0xca28('0x51')](_0x4f730f[_0xca28('0x52')]['filename'],path[_0xca28('0x54')](_0x4f730f[_0xca28('0x52')][_0xca28('0x55')])),'original_format':path[_0xca28('0x54')](_0x4f730f[_0xca28('0x52')][_0xca28('0x53')])[_0xca28('0x56')](0x1),'converted_format':_0xca28('0x57')};var _0x234c0f=path[_0xca28('0x49')](config[_0xca28('0x58')],_0xca28('0x59'),_0x4f730f['file']['filename']);var _0x3b13d1=path['join'](config[_0xca28('0x58')],'server/files/sounds/converted',util[_0xca28('0x4f')](_0xca28('0x4e'),path['basename'](_0x4f730f[_0xca28('0x52')][_0xca28('0x55')],path[_0xca28('0x54')](_0x4f730f['file'][_0xca28('0x55')])),_0x319965[_0xca28('0x47')]));logger[_0xca28('0x5a')]('Sound\x20upload\x20filepath:\x20%s',_0x234c0f);logger[_0xca28('0x5a')](_0xca28('0x5b'),_0x3b13d1);try{fs[_0xca28('0x5c')](_0x234c0f,parseInt('0777',0x8));var _0x18415f=sox[_0xca28('0x5d')](_0x234c0f,_0x3b13d1,{'sampleRate':0x1f40,'format':_0xca28('0x57'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x18415f['on'](_0xca28('0x5e'),function(_0x32f54c){fs[_0xca28('0x5f')](_0x234c0f);_0x5e169d[_0xca28('0x18')](0x1f4)[_0xca28('0x60')](_0x32f54c);});_0x18415f['on'](_0xca28('0x61'),function(_0x19f866){_0x319965['original_duration']=isNaN(_0x19f866[_0xca28('0x62')])?null:_0x19f866['duration']*0x3e8;_0x319965[_0xca28('0x63')]=isNaN(_0x19f866['sampleCount'])?null:_0x19f866['sampleCount'];_0x319965[_0xca28('0x64')]=isNaN(_0x19f866[_0xca28('0x65')])?null:_0x19f866[_0xca28('0x65')];_0x319965[_0xca28('0x66')]=isNaN(_0x19f866[_0xca28('0x67')])?null:_0x19f866[_0xca28('0x67')];_0x319965[_0xca28('0x68')]=isNaN(_0x19f866[_0xca28('0x69')])?null:_0x19f866['sampleRate'];});_0x18415f['on'](_0xca28('0x6a'),function(_0x315e7b){_0x319965['converted_duration']=isNaN(_0x315e7b['duration'])?null:_0x315e7b['duration']*0x3e8;_0x319965[_0xca28('0x6b')]=isNaN(_0x315e7b['sampleCount'])?null:_0x315e7b[_0xca28('0x6c')];_0x319965[_0xca28('0x6d')]=isNaN(_0x315e7b[_0xca28('0x65')])?null:_0x315e7b[_0xca28('0x65')];_0x319965[_0xca28('0x6e')]=isNaN(_0x315e7b['bitRate'])?null:_0x315e7b['bitRate'];_0x319965[_0xca28('0x6f')]=isNaN(_0x315e7b[_0xca28('0x69')])?null:_0x315e7b['sampleRate'];});_0x18415f['on'](_0xca28('0x19'),function(){fs[_0xca28('0x5c')](_0x3b13d1,parseInt(_0xca28('0x70'),0x8));return db['Sound'][_0xca28('0x50')](_0x319965)['then'](function(_0x24289f){var _0x43c07d={'role':_0x4f730f[_0xca28('0x71')][_0xca28('0x72')],'userProfileId':_0x4f730f[_0xca28('0x71')][_0xca28('0x73')]};if(!_0x43c07d)throw new Error(_0xca28('0x74'));if(_0x43c07d['role']===_0xca28('0x75')){var _0x323037=_0x24289f[_0xca28('0x26')]({'plain':!![]});return db[_0xca28('0x76')][_0xca28('0x42')]({'where':{'name':_0xca28('0x27'),'userProfileId':_0x43c07d[_0xca28('0x73')]},'raw':!![]})[_0xca28('0x24')](function(_0x3a20cc){if(_0x3a20cc&&_0x3a20cc[_0xca28('0x77')]===0x0){return db[_0xca28('0x78')][_0xca28('0x50')]({'name':_0x323037[_0xca28('0x29')],'resourceId':_0x323037['id'],'type':_0x3a20cc['name'],'sectionId':_0x3a20cc['id']},{})[_0xca28('0x24')](function(){return _0x24289f;});}else{return _0x24289f;}})[_0xca28('0x43')](function(_0x55a19f){logger[_0xca28('0x5e')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x55a19f);throw _0x55a19f;});}return _0x24289f;})[_0xca28('0x24')](respondWithResult(_0x5e169d,null))['catch'](handleError(_0x5e169d,null));});_0x18415f[_0xca28('0x79')]();}catch(_0x31ffba){_0x5e169d['status'](0x1f4)[_0xca28('0x60')](_0x31ffba);}};exports[_0xca28('0x23')]=function(_0x44bf34,_0x24e07e,_0x5711cf){return db['Sound'][_0xca28('0x42')]({'where':{'id':_0x44bf34[_0xca28('0x45')]['id']}})[_0xca28('0x24')](handleEntityNotFound(_0x24e07e,null))[_0xca28('0x24')](saveUpdates(_[_0xca28('0x39')](_0x44bf34[_0xca28('0x71')],[_0xca28('0x29'),_0xca28('0x7a')]),null))[_0xca28('0x24')](respondWithResult(_0x24e07e,null))[_0xca28('0x43')](handleError(_0x24e07e,null));};exports[_0xca28('0x7b')]=function(_0x126ae9,_0x3f75d9,_0x5e3554){return db[_0xca28('0x2b')]['find']({'where':{'id':_0x126ae9[_0xca28('0x45')]['id']}})[_0xca28('0x24')](function(_0x668488){if(_0x668488){return _0x668488['destroy']();}})[_0xca28('0x24')](function(_0x48ef63){var _0x1730bf=path[_0xca28('0x49')](config[_0xca28('0x58')],_0xca28('0x59'),util[_0xca28('0x4f')](_0xca28('0x4e'),_0x48ef63['save_name'],_0x48ef63[_0xca28('0x7c')]));var _0x2e8899=path['join'](config[_0xca28('0x58')],_0xca28('0x4a'),util[_0xca28('0x4f')]('%s.%s',_0x48ef63[_0xca28('0x46')],_0x48ef63['converted_format']));fs[_0xca28('0x5f')](_0x1730bf);fs[_0xca28('0x5f')](_0x2e8899);return _0x48ef63;})[_0xca28('0x24')](function(_0x8a2c84){if(_0x8a2c84){return _0x3f75d9[_0xca28('0x18')](0xcc)[_0xca28('0x19')]();}})[_0xca28('0x24')](handleEntityNotFound(_0x3f75d9,null))['catch'](handleError(_0x3f75d9,null));}; \ No newline at end of file diff --git a/server/api/sound/sound.model.js b/server/api/sound/sound.model.js index de5bce7..8a6b0a2 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 _0x7ea2=['api','bluebird','path','rimraf','../../config/environment','./sound.attributes','exports','define','Sound','tools_sounds','lodash','util','../../config/logger'];(function(_0x350258,_0x4e0a50){var _0x3714b3=function(_0x8918f7){while(--_0x8918f7){_0x350258['push'](_0x350258['shift']());}};_0x3714b3(++_0x4e0a50);}(_0x7ea2,0x135));var _0x27ea=function(_0x52ea08,_0x15d935){_0x52ea08=_0x52ea08-0x0;var _0x28d546=_0x7ea2[_0x52ea08];return _0x28d546;};'use strict';var _=require(_0x27ea('0x0'));var util=require(_0x27ea('0x1'));var logger=require(_0x27ea('0x2'))(_0x27ea('0x3'));var moment=require('moment');var BPromise=require(_0x27ea('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x27ea('0x5'));var rimraf=require(_0x27ea('0x6'));var config=require(_0x27ea('0x7'));var attributes=require(_0x27ea('0x8'));module[_0x27ea('0x9')]=function(_0x1af7b5,_0xf05976){return _0x1af7b5[_0x27ea('0xa')](_0x27ea('0xb'),attributes,{'tableName':_0x27ea('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9d1f=['moment','bluebird','path','rimraf','exports','define','Sound','util','api'];(function(_0x49ff3f,_0x531e8f){var _0x4f9703=function(_0x108049){while(--_0x108049){_0x49ff3f['push'](_0x49ff3f['shift']());}};_0x4f9703(++_0x531e8f);}(_0x9d1f,0x142));var _0xf9d1=function(_0x1ebc6c,_0x58a00b){_0x1ebc6c=_0x1ebc6c-0x0;var _0x3a826d=_0x9d1f[_0x1ebc6c];return _0x3a826d;};'use strict';var _=require('lodash');var util=require(_0xf9d1('0x0'));var logger=require('../../config/logger')(_0xf9d1('0x1'));var moment=require(_0xf9d1('0x2'));var BPromise=require(_0xf9d1('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf9d1('0x4'));var rimraf=require(_0xf9d1('0x5'));var config=require('../../config/environment');var attributes=require('./sound.attributes');module[_0xf9d1('0x6')]=function(_0x1fefcb,_0x1d93bd){return _0x1fefcb[_0xf9d1('0x7')](_0xf9d1('0x8'),attributes,{'tableName':'tools_sounds','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/sound/sound.rpc.js b/server/api/sound/sound.rpc.js index 4d80355..3dd22c7 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 _0x46c9=['model','attributes','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Sound,\x20%s,\x20%s','request\x20sent','debug','Sound,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','ShowSound','options','raw','map','include'];(function(_0x404957,_0x5192a4){var _0x4e0365=function(_0x4f6cd7){while(--_0x4f6cd7){_0x404957['push'](_0x404957['shift']());}};_0x4e0365(++_0x5192a4);}(_0x46c9,0x14c));var _0x946c=function(_0x2c27ed,_0x5c50f0){_0x2c27ed=_0x2c27ed-0x0;var _0x597bd1=_0x46c9[_0x2c27ed];return _0x597bd1;};'use strict';var _=require(_0x946c('0x0'));var util=require('util');var moment=require(_0x946c('0x1'));var BPromise=require(_0x946c('0x2'));var rs=require(_0x946c('0x3'));var fs=require('fs');var Redis=require(_0x946c('0x4'));var db=require(_0x946c('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x946c('0x6'));var config=require(_0x946c('0x7'));var jayson=require(_0x946c('0x8'));var client=jayson[_0x946c('0x9')][_0x946c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x473b5e,_0x4627f7,_0x4be46f){return new BPromise(function(_0x10544b,_0xa65180){return client[_0x946c('0xb')](_0x473b5e,_0x4be46f)[_0x946c('0xc')](function(_0xe91fc4){logger[_0x946c('0xd')](_0x946c('0xe'),_0x4627f7,_0x946c('0xf'));logger[_0x946c('0x10')](_0x946c('0x11'),_0x4627f7,_0x946c('0xf'),JSON['stringify'](_0xe91fc4));if(_0xe91fc4[_0x946c('0x12')]){if(_0xe91fc4[_0x946c('0x12')][_0x946c('0x13')]===0x1f4){logger[_0x946c('0x12')](_0x946c('0xe'),_0x4627f7,_0xe91fc4[_0x946c('0x12')][_0x946c('0x14')]);return _0xa65180(_0xe91fc4[_0x946c('0x12')][_0x946c('0x14')]);}logger[_0x946c('0x12')](_0x946c('0xe'),_0x4627f7,_0xe91fc4[_0x946c('0x12')][_0x946c('0x14')]);return _0x10544b(_0xe91fc4[_0x946c('0x12')][_0x946c('0x14')]);}else{logger['info'](_0x946c('0xe'),_0x4627f7,_0x946c('0xf'));_0x10544b(_0xe91fc4[_0x946c('0x15')]['message']);}})[_0x946c('0x16')](function(_0x88f176){logger[_0x946c('0x12')](_0x946c('0xe'),_0x4627f7,_0x88f176);_0xa65180(_0x88f176);});});}exports[_0x946c('0x17')]=function(_0x1f621c){var _0x9280c=this;return new Promise(function(_0x6fec2c,_0x318323){return db['Sound']['find']({'raw':_0x1f621c[_0x946c('0x18')]?_0x1f621c[_0x946c('0x18')][_0x946c('0x19')]===undefined?!![]:![]:!![],'where':_0x1f621c[_0x946c('0x18')]?_0x1f621c[_0x946c('0x18')]['where']||null:null,'attributes':_0x1f621c[_0x946c('0x18')]?_0x1f621c[_0x946c('0x18')]['attributes']||null:null,'include':_0x1f621c[_0x946c('0x18')]?_0x1f621c[_0x946c('0x18')]['include']?_[_0x946c('0x1a')](_0x1f621c[_0x946c('0x18')][_0x946c('0x1b')],function(_0x1344b8){return{'model':db[_0x1344b8[_0x946c('0x1c')]],'as':_0x1344b8['as'],'attributes':_0x1344b8[_0x946c('0x1d')],'include':_0x1344b8[_0x946c('0x1b')]?_[_0x946c('0x1a')](_0x1344b8[_0x946c('0x1b')],function(_0x523cdd){return{'model':db[_0x523cdd['model']],'as':_0x523cdd['as'],'attributes':_0x523cdd['attributes'],'include':_0x523cdd[_0x946c('0x1b')]?_[_0x946c('0x1a')](_0x523cdd['include'],function(_0x391ec7){return{'model':db[_0x391ec7[_0x946c('0x1c')]],'as':_0x391ec7['as'],'attributes':_0x391ec7['attributes']};}):[]};}):[]};}):[]:[]})[_0x946c('0xc')](function(_0x3949eb){logger[_0x946c('0xd')](_0x946c('0x17'),_0x1f621c);logger[_0x946c('0x10')](_0x946c('0x17'),_0x1f621c,JSON['stringify'](_0x3949eb));_0x6fec2c(_0x3949eb);})[_0x946c('0x16')](function(_0x3f655e){logger[_0x946c('0x12')](_0x946c('0x17'),_0x3f655e[_0x946c('0x14')],_0x1f621c);_0x318323(_0x9280c['error'](0x1f4,_0x3f655e[_0x946c('0x14')]));});});}; \ No newline at end of file +var _0xde72=['debug','Sound,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','ShowSound','Sound','find','options','raw','where','attributes','include','map','model','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','Sound,\x20%s,\x20%s'];(function(_0x7b484,_0x195ad4){var _0x2ae1cf=function(_0x2e6247){while(--_0x2e6247){_0x7b484['push'](_0x7b484['shift']());}};_0x2ae1cf(++_0x195ad4);}(_0xde72,0xec));var _0x2de7=function(_0x3d14cc,_0x5e8809){_0x3d14cc=_0x3d14cc-0x0;var _0x21cd3d=_0xde72[_0x3d14cc];return _0x21cd3d;};'use strict';var _=require(_0x2de7('0x0'));var util=require(_0x2de7('0x1'));var moment=require(_0x2de7('0x2'));var BPromise=require(_0x2de7('0x3'));var rs=require(_0x2de7('0x4'));var fs=require('fs');var Redis=require(_0x2de7('0x5'));var db=require(_0x2de7('0x6'))['db'];var utils=require(_0x2de7('0x7'));var logger=require(_0x2de7('0x8'))('rpc');var config=require(_0x2de7('0x9'));var jayson=require(_0x2de7('0xa'));var client=jayson[_0x2de7('0xb')][_0x2de7('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x39f66e,_0x172370,_0x5e477c){return new BPromise(function(_0x1b5c50,_0x45022a){return client[_0x2de7('0xd')](_0x39f66e,_0x5e477c)[_0x2de7('0xe')](function(_0x45c880){logger['info'](_0x2de7('0xf'),_0x172370,'request\x20sent');logger[_0x2de7('0x10')](_0x2de7('0x11'),_0x172370,_0x2de7('0x12'),JSON[_0x2de7('0x13')](_0x45c880));if(_0x45c880[_0x2de7('0x14')]){if(_0x45c880[_0x2de7('0x14')][_0x2de7('0x15')]===0x1f4){logger[_0x2de7('0x14')](_0x2de7('0xf'),_0x172370,_0x45c880[_0x2de7('0x14')][_0x2de7('0x16')]);return _0x45022a(_0x45c880['error'][_0x2de7('0x16')]);}logger[_0x2de7('0x14')](_0x2de7('0xf'),_0x172370,_0x45c880[_0x2de7('0x14')][_0x2de7('0x16')]);return _0x1b5c50(_0x45c880[_0x2de7('0x14')][_0x2de7('0x16')]);}else{logger[_0x2de7('0x17')](_0x2de7('0xf'),_0x172370,_0x2de7('0x12'));_0x1b5c50(_0x45c880[_0x2de7('0x18')][_0x2de7('0x16')]);}})[_0x2de7('0x19')](function(_0xc692de){logger[_0x2de7('0x14')](_0x2de7('0xf'),_0x172370,_0xc692de);_0x45022a(_0xc692de);});});}exports[_0x2de7('0x1a')]=function(_0x166663){var _0x193a01=this;return new Promise(function(_0x1076c5,_0x13f0da){return db[_0x2de7('0x1b')][_0x2de7('0x1c')]({'raw':_0x166663['options']?_0x166663[_0x2de7('0x1d')][_0x2de7('0x1e')]===undefined?!![]:![]:!![],'where':_0x166663[_0x2de7('0x1d')]?_0x166663[_0x2de7('0x1d')][_0x2de7('0x1f')]||null:null,'attributes':_0x166663['options']?_0x166663[_0x2de7('0x1d')][_0x2de7('0x20')]||null:null,'include':_0x166663[_0x2de7('0x1d')]?_0x166663['options'][_0x2de7('0x21')]?_[_0x2de7('0x22')](_0x166663[_0x2de7('0x1d')][_0x2de7('0x21')],function(_0x501054){return{'model':db[_0x501054[_0x2de7('0x23')]],'as':_0x501054['as'],'attributes':_0x501054[_0x2de7('0x20')],'include':_0x501054[_0x2de7('0x21')]?_['map'](_0x501054['include'],function(_0x475052){return{'model':db[_0x475052['model']],'as':_0x475052['as'],'attributes':_0x475052[_0x2de7('0x20')],'include':_0x475052[_0x2de7('0x21')]?_[_0x2de7('0x22')](_0x475052['include'],function(_0x106f71){return{'model':db[_0x106f71[_0x2de7('0x23')]],'as':_0x106f71['as'],'attributes':_0x106f71[_0x2de7('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x265e02){logger[_0x2de7('0x17')](_0x2de7('0x1a'),_0x166663);logger[_0x2de7('0x10')]('ShowSound',_0x166663,JSON[_0x2de7('0x13')](_0x265e02));_0x1076c5(_0x265e02);})[_0x2de7('0x19')](function(_0x55dab3){logger[_0x2de7('0x14')](_0x2de7('0x1a'),_0x55dab3[_0x2de7('0x16')],_0x166663);_0x13f0da(_0x193a01[_0x2de7('0x14')](0x1f4,_0x55dab3[_0x2de7('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/squareMessage/index.js b/server/api/squareMessage/index.js index b8114f1..b90c2bb 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 _0x14a0=['get','isAuthenticated','/:id','show','create','delete','destroy','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./squareMessage.controller'];(function(_0x322f60,_0xd6710b){var _0x3066ae=function(_0xa87e99){while(--_0xa87e99){_0x322f60['push'](_0x322f60['shift']());}};_0x3066ae(++_0xd6710b);}(_0x14a0,0x8e));var _0x014a=function(_0x3e3b4e,_0x2a974b){_0x3e3b4e=_0x3e3b4e-0x0;var _0x1e434b=_0x14a0[_0x3e3b4e];return _0x1e434b;};'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['post']('/',auth['isAuthenticated'](),controller[_0x014a('0xc')]);router['put']('/:id',auth['isAuthenticated'](),controller['update']);router[_0x014a('0xd')]('/:id',auth[_0x014a('0x9')](),controller[_0x014a('0xe')]);module['exports']=router; \ No newline at end of file +var _0x8603=['../../components/interaction/service','./squareMessage.controller','isAuthenticated','index','get','/:id','create','put','update','exports','util','path','connect-timeout','fs-extra','../../components/auth/service'];(function(_0x193ddf,_0x6f30bb){var _0x5bc6df=function(_0x70fd9e){while(--_0x70fd9e){_0x193ddf['push'](_0x193ddf['shift']());}};_0x5bc6df(++_0x6f30bb);}(_0x8603,0x190));var _0x3860=function(_0x3b5e02,_0x535469){_0x3b5e02=_0x3b5e02-0x0;var _0x59464c=_0x8603[_0x3b5e02];return _0x59464c;};'use strict';var multer=require('multer');var util=require(_0x3860('0x0'));var path=require(_0x3860('0x1'));var timeout=require(_0x3860('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x3860('0x3'));var auth=require(_0x3860('0x4'));var interaction=require(_0x3860('0x5'));var config=require('../../config/environment');var controller=require(_0x3860('0x6'));router['get']('/',auth[_0x3860('0x7')](),controller[_0x3860('0x8')]);router[_0x3860('0x9')](_0x3860('0xa'),auth[_0x3860('0x7')](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0x3860('0xb')]);router[_0x3860('0xc')]('/:id',auth[_0x3860('0x7')](),controller[_0x3860('0xd')]);router['delete'](_0x3860('0xa'),auth[_0x3860('0x7')](),controller['destroy']);module[_0x3860('0xe')]=router; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.attributes.js b/server/api/squareMessage/squareMessage.attributes.js index 1719fb4..08b81bc 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 _0x9e7a=['exports','STRING','TEXT','ENUM','out'];(function(_0x54d8da,_0x128e28){var _0x4e3f37=function(_0x2da0ad){while(--_0x2da0ad){_0x54d8da['push'](_0x54d8da['shift']());}};_0x4e3f37(++_0x128e28);}(_0x9e7a,0xe1));var _0xa9e7=function(_0x25db1c,_0x286661){_0x25db1c=_0x25db1c-0x0;var _0xaea16=_0x9e7a[_0x25db1c];return _0xaea16;};'use strict';var Sequelize=require('sequelize');module[_0xa9e7('0x0')]={'uniqueid':{'type':Sequelize[_0xa9e7('0x1')]},'body':{'type':Sequelize[_0xa9e7('0x2')]('medium'),'allowNull':![]},'direction':{'type':Sequelize[_0xa9e7('0x3')]('in',_0xa9e7('0x4')),'defaultValue':_0xa9e7('0x4'),'allowNull':![]},'providerName':{'type':Sequelize[_0xa9e7('0x1')]},'providerResponse':{'type':Sequelize[_0xa9e7('0x2')]}}; \ No newline at end of file +var _0x7d91=['STRING','exports','TEXT','medium','ENUM','out'];(function(_0x51e5bd,_0x3c2cf1){var _0x250aed=function(_0x17120c){while(--_0x17120c){_0x51e5bd['push'](_0x51e5bd['shift']());}};_0x250aed(++_0x3c2cf1);}(_0x7d91,0x10f));var _0x17d9=function(_0x192ec1,_0x19c184){_0x192ec1=_0x192ec1-0x0;var _0x1dcfa1=_0x7d91[_0x192ec1];return _0x1dcfa1;};'use strict';var Sequelize=require('sequelize');module[_0x17d9('0x0')]={'uniqueid':{'type':Sequelize['STRING']},'body':{'type':Sequelize[_0x17d9('0x1')](_0x17d9('0x2')),'allowNull':![]},'direction':{'type':Sequelize[_0x17d9('0x3')]('in',_0x17d9('0x4')),'defaultValue':'out','allowNull':![]},'providerName':{'type':Sequelize[_0x17d9('0x5')]},'providerResponse':{'type':Sequelize[_0x17d9('0x1')]}}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.controller.js b/server/api/squareMessage/squareMessage.controller.js index 548a86c..cfa6573 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 _0x1f75=['sort','where','pick','filters','filter','merge','SquareMessage','includeAll','include','findAll','rows','catch','show','params','length','options','find','create','update','body','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../config/license/util','end','status','json','offset','undefined','limit','count','apply','reject','save','then','destroy','sendStatus','error','stack','name','send','index','map','rawAttributes','type','key','model','query','keys','intersection','attributes','fields','nolimit'];(function(_0x2f8003,_0x365f08){var _0x41ee18=function(_0x123258){while(--_0x123258){_0x2f8003['push'](_0x2f8003['shift']());}};_0x41ee18(++_0x365f08);}(_0x1f75,0x13c));var _0x51f7=function(_0x4bb66f,_0x3cd682){_0x4bb66f=_0x4bb66f-0x0;var _0xf2772f=_0x1f75[_0x4bb66f];return _0xf2772f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x51f7('0x0'));var zipdir=require(_0x51f7('0x1'));var jsonpatch=require(_0x51f7('0x2'));var rp=require(_0x51f7('0x3'));var moment=require(_0x51f7('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x51f7('0x5'));var util=require(_0x51f7('0x6'));var path=require(_0x51f7('0x7'));var sox=require(_0x51f7('0x8'));var csv=require(_0x51f7('0x9'));var ejs=require(_0x51f7('0xa'));var fs=require('fs');var fs_extra=require(_0x51f7('0xb'));var _=require(_0x51f7('0xc'));var squel=require(_0x51f7('0xd'));var crypto=require(_0x51f7('0xe'));var jsforce=require(_0x51f7('0xf'));var deskjs=require(_0x51f7('0x10'));var toCsv=require('to-csv');var querystring=require(_0x51f7('0x11'));var Papa=require(_0x51f7('0x12'));var Redis=require('ioredis');var authService=require(_0x51f7('0x13'));var qs=require(_0x51f7('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x51f7('0x15'))(_0x51f7('0x16'));var utils=require('../../config/utils');var config=require(_0x51f7('0x17'));var licenseUtil=require(_0x51f7('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x452c6b,_0x180e9d){_0x180e9d=_0x180e9d||0xcc;return function(_0x11cc37){if(_0x11cc37){return _0x452c6b['sendStatus'](_0x180e9d);}return _0x452c6b['status'](_0x180e9d)[_0x51f7('0x19')]();};}function respondWithResult(_0x29884b,_0x3c4b5a){_0x3c4b5a=_0x3c4b5a||0xc8;return function(_0x3fc869){if(_0x3fc869){return _0x29884b[_0x51f7('0x1a')](_0x3c4b5a)[_0x51f7('0x1b')](_0x3fc869);}};}function respondWithFilteredResult(_0x56f9e3,_0x10aa7f){return function(_0x6e0f2e){if(_0x6e0f2e){var _0x12e09d=typeof _0x10aa7f[_0x51f7('0x1c')]===_0x51f7('0x1d')&&typeof _0x10aa7f[_0x51f7('0x1e')]===_0x51f7('0x1d');var _0x4f9fd0=_0x6e0f2e[_0x51f7('0x1f')];var _0x33d2a7=_0x12e09d?0x0:_0x10aa7f['offset'];var _0x1201c1=_0x12e09d?_0x6e0f2e[_0x51f7('0x1f')]:_0x10aa7f['offset']+_0x10aa7f['limit'];var _0x564686;if(_0x1201c1>=_0x4f9fd0){_0x1201c1=_0x4f9fd0;_0x564686=0xc8;}else{_0x564686=0xce;}_0x56f9e3[_0x51f7('0x1a')](_0x564686);return _0x56f9e3['set']('Content-Range',_0x33d2a7+'-'+_0x1201c1+'/'+_0x4f9fd0)[_0x51f7('0x1b')](_0x6e0f2e);}return null;};}function patchUpdates(_0x1decc1){return function(_0x475566){try{jsonpatch[_0x51f7('0x20')](_0x475566,_0x1decc1,!![]);}catch(_0x669234){return BPromise[_0x51f7('0x21')](_0x669234);}return _0x475566[_0x51f7('0x22')]();};}function saveUpdates(_0x22f585,_0x4e277e){return function(_0x28566c){if(_0x28566c){return _0x28566c['update'](_0x22f585)[_0x51f7('0x23')](function(_0x38801b){return _0x38801b;});}return null;};}function removeEntity(_0xa001f4,_0x1bde25){return function(_0x19e020){if(_0x19e020){return _0x19e020[_0x51f7('0x24')]()[_0x51f7('0x23')](function(){_0xa001f4[_0x51f7('0x1a')](0xcc)[_0x51f7('0x19')]();});}};}function handleEntityNotFound(_0x10f90b,_0x45421f){return function(_0x47ed7c){if(!_0x47ed7c){_0x10f90b[_0x51f7('0x25')](0x194);}return _0x47ed7c;};}function handleError(_0x384ca0,_0x13eee4){_0x13eee4=_0x13eee4||0x1f4;return function(_0x54bf48){logger[_0x51f7('0x26')](_0x54bf48[_0x51f7('0x27')]);if(_0x54bf48[_0x51f7('0x28')]){delete _0x54bf48[_0x51f7('0x28')];}_0x384ca0['status'](_0x13eee4)[_0x51f7('0x29')](_0x54bf48);};}exports[_0x51f7('0x2a')]=function(_0x1d8bf6,_0xdaebe7){var _0xf70aa2={},_0x4bced1={},_0x31cf1f={'count':0x0,'rows':[]};var _0x32056c=_[_0x51f7('0x2b')](db['SquareMessage'][_0x51f7('0x2c')],function(_0x50a2f4){return{'name':_0x50a2f4['fieldName'],'type':_0x50a2f4[_0x51f7('0x2d')][_0x51f7('0x2e')]};});_0x4bced1[_0x51f7('0x2f')]=_[_0x51f7('0x2b')](_0x32056c,_0x51f7('0x28'));_0x4bced1[_0x51f7('0x30')]=_[_0x51f7('0x31')](_0x1d8bf6['query']);_0x4bced1['filters']=_[_0x51f7('0x32')](_0x4bced1[_0x51f7('0x2f')],_0x4bced1[_0x51f7('0x30')]);_0xf70aa2[_0x51f7('0x33')]=_[_0x51f7('0x32')](_0x4bced1[_0x51f7('0x2f')],qs[_0x51f7('0x34')](_0x1d8bf6[_0x51f7('0x30')][_0x51f7('0x34')]));_0xf70aa2['attributes']=_0xf70aa2[_0x51f7('0x33')]['length']?_0xf70aa2[_0x51f7('0x33')]:_0x4bced1['model'];if(!_0x1d8bf6[_0x51f7('0x30')]['hasOwnProperty'](_0x51f7('0x35'))){_0xf70aa2['limit']=qs[_0x51f7('0x1e')](_0x1d8bf6[_0x51f7('0x30')][_0x51f7('0x1e')]);_0xf70aa2['offset']=qs[_0x51f7('0x1c')](_0x1d8bf6[_0x51f7('0x30')]['offset']);}_0xf70aa2['order']=qs['sort'](_0x1d8bf6[_0x51f7('0x30')][_0x51f7('0x36')]);_0xf70aa2[_0x51f7('0x37')]=qs['filters'](_[_0x51f7('0x38')](_0x1d8bf6[_0x51f7('0x30')],_0x4bced1[_0x51f7('0x39')]),_0x32056c);if(_0x1d8bf6['query'][_0x51f7('0x3a')]){_0xf70aa2[_0x51f7('0x37')]=_[_0x51f7('0x3b')](_0xf70aa2['where'],{'$or':_[_0x51f7('0x2b')](_0x32056c,function(_0x23c30d){if(_0x23c30d[_0x51f7('0x2d')]!=='VIRTUAL'){var _0x2a962f={};_0x2a962f[_0x23c30d[_0x51f7('0x28')]]={'$like':'%'+_0x1d8bf6[_0x51f7('0x30')][_0x51f7('0x3a')]+'%'};return _0x2a962f;}})});}_0xf70aa2=_[_0x51f7('0x3b')]({},_0xf70aa2,_0x1d8bf6['options']);var _0x30ce2e={'where':_0xf70aa2[_0x51f7('0x37')]};return db[_0x51f7('0x3c')][_0x51f7('0x1f')](_0x30ce2e)['then'](function(_0x2218f0){_0x31cf1f['count']=_0x2218f0;if(_0x1d8bf6[_0x51f7('0x30')][_0x51f7('0x3d')]){_0xf70aa2[_0x51f7('0x3e')]=[{'all':!![]}];}return db[_0x51f7('0x3c')][_0x51f7('0x3f')](_0xf70aa2);})[_0x51f7('0x23')](function(_0x1339a3){_0x31cf1f[_0x51f7('0x40')]=_0x1339a3;return _0x31cf1f;})[_0x51f7('0x23')](respondWithFilteredResult(_0xdaebe7,_0xf70aa2))[_0x51f7('0x41')](handleError(_0xdaebe7,null));};exports[_0x51f7('0x42')]=function(_0x1d277e,_0x2f5496){var _0x52d6fb={'raw':!![],'where':{'id':_0x1d277e[_0x51f7('0x43')]['id']}},_0x53ba21={};_0x53ba21[_0x51f7('0x2f')]=_['keys'](db['SquareMessage'][_0x51f7('0x2c')]);_0x53ba21[_0x51f7('0x30')]=_[_0x51f7('0x31')](_0x1d277e['query']);_0x53ba21[_0x51f7('0x39')]=_[_0x51f7('0x32')](_0x53ba21[_0x51f7('0x2f')],_0x53ba21[_0x51f7('0x30')]);_0x52d6fb['attributes']=_[_0x51f7('0x32')](_0x53ba21[_0x51f7('0x2f')],qs[_0x51f7('0x34')](_0x1d277e[_0x51f7('0x30')][_0x51f7('0x34')]));_0x52d6fb[_0x51f7('0x33')]=_0x52d6fb[_0x51f7('0x33')][_0x51f7('0x44')]?_0x52d6fb['attributes']:_0x53ba21[_0x51f7('0x2f')];if(_0x1d277e['query'][_0x51f7('0x3d')]){_0x52d6fb[_0x51f7('0x3e')]=[{'all':!![]}];}_0x52d6fb=_[_0x51f7('0x3b')]({},_0x52d6fb,_0x1d277e[_0x51f7('0x45')]);return db[_0x51f7('0x3c')][_0x51f7('0x46')](_0x52d6fb)[_0x51f7('0x23')](handleEntityNotFound(_0x2f5496,null))[_0x51f7('0x23')](respondWithResult(_0x2f5496,null))['catch'](handleError(_0x2f5496,null));};exports[_0x51f7('0x47')]=function(_0x4ec365,_0x4284b1){return db['SquareMessage'][_0x51f7('0x47')](_0x4ec365['body'],{})[_0x51f7('0x23')](respondWithResult(_0x4284b1,0xc9))[_0x51f7('0x41')](handleError(_0x4284b1,null));};exports[_0x51f7('0x48')]=function(_0x501cb8,_0x5c0207){if(_0x501cb8[_0x51f7('0x49')]['id']){delete _0x501cb8[_0x51f7('0x49')]['id'];}return db[_0x51f7('0x3c')][_0x51f7('0x46')]({'where':{'id':_0x501cb8[_0x51f7('0x43')]['id']}})[_0x51f7('0x23')](handleEntityNotFound(_0x5c0207,null))[_0x51f7('0x23')](saveUpdates(_0x501cb8[_0x51f7('0x49')],null))[_0x51f7('0x23')](respondWithResult(_0x5c0207,null))[_0x51f7('0x41')](handleError(_0x5c0207,null));};exports[_0x51f7('0x24')]=function(_0x2ea89d,_0x48526e){return db[_0x51f7('0x3c')][_0x51f7('0x46')]({'where':{'id':_0x2ea89d['params']['id']}})['then'](handleEntityNotFound(_0x48526e,null))[_0x51f7('0x23')](removeEntity(_0x48526e,null))['catch'](handleError(_0x48526e,null));}; \ No newline at end of file +var _0xe354=['length','nolimit','sort','filters','pick','where','merge','VIRTUAL','filter','options','SquareMessage','count','includeAll','rows','catch','show','params','include','find','create','body','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','set','Content-Range','apply','save','update','then','destroy','end','error','stack','name','send','index','map','rawAttributes','fieldName','type','query','keys','intersection','model','attributes','fields'];(function(_0x1e3257,_0x29b350){var _0x22ce6a=function(_0x2302e5){while(--_0x2302e5){_0x1e3257['push'](_0x1e3257['shift']());}};_0x22ce6a(++_0x29b350);}(_0xe354,0x187));var _0x4e35=function(_0x55b83d,_0x500d9c){_0x55b83d=_0x55b83d-0x0;var _0x4ae99a=_0xe354[_0x55b83d];return _0x4ae99a;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x4e35('0x0'));var jsonpatch=require(_0x4e35('0x1'));var rp=require('request-promise');var moment=require(_0x4e35('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x4e35('0x3'));var util=require(_0x4e35('0x4'));var path=require(_0x4e35('0x5'));var sox=require(_0x4e35('0x6'));var csv=require(_0x4e35('0x7'));var ejs=require(_0x4e35('0x8'));var fs=require('fs');var fs_extra=require(_0x4e35('0x9'));var _=require(_0x4e35('0xa'));var squel=require('squel');var crypto=require(_0x4e35('0xb'));var jsforce=require(_0x4e35('0xc'));var deskjs=require(_0x4e35('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x4e35('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x4e35('0xf'));var as=require(_0x4e35('0x10'));var hardwareService=require(_0x4e35('0x11'));var logger=require(_0x4e35('0x12'))(_0x4e35('0x13'));var utils=require(_0x4e35('0x14'));var config=require(_0x4e35('0x15'));var licenseUtil=require(_0x4e35('0x16'));var db=require(_0x4e35('0x17'))['db'];function respondWithStatusCode(_0x28cfee,_0x4e9eb6){_0x4e9eb6=_0x4e9eb6||0xcc;return function(_0x594403){if(_0x594403){return _0x28cfee[_0x4e35('0x18')](_0x4e9eb6);}return _0x28cfee[_0x4e35('0x19')](_0x4e9eb6)['end']();};}function respondWithResult(_0x520af7,_0x19a2f3){_0x19a2f3=_0x19a2f3||0xc8;return function(_0x1ff1ca){if(_0x1ff1ca){return _0x520af7[_0x4e35('0x19')](_0x19a2f3)[_0x4e35('0x1a')](_0x1ff1ca);}};}function respondWithFilteredResult(_0x15aa1d,_0x1e65ed){return function(_0xfe9f0a){if(_0xfe9f0a){var _0x579029=typeof _0x1e65ed[_0x4e35('0x1b')]===_0x4e35('0x1c')&&typeof _0x1e65ed['limit']===_0x4e35('0x1c');var _0x2a6103=_0xfe9f0a['count'];var _0xf12e1d=_0x579029?0x0:_0x1e65ed[_0x4e35('0x1b')];var _0x425185=_0x579029?_0xfe9f0a['count']:_0x1e65ed['offset']+_0x1e65ed[_0x4e35('0x1d')];var _0x500bbd;if(_0x425185>=_0x2a6103){_0x425185=_0x2a6103;_0x500bbd=0xc8;}else{_0x500bbd=0xce;}_0x15aa1d[_0x4e35('0x19')](_0x500bbd);return _0x15aa1d[_0x4e35('0x1e')](_0x4e35('0x1f'),_0xf12e1d+'-'+_0x425185+'/'+_0x2a6103)['json'](_0xfe9f0a);}return null;};}function patchUpdates(_0x9c9a94){return function(_0x1dba5a){try{jsonpatch[_0x4e35('0x20')](_0x1dba5a,_0x9c9a94,!![]);}catch(_0x1cfdd9){return BPromise['reject'](_0x1cfdd9);}return _0x1dba5a[_0x4e35('0x21')]();};}function saveUpdates(_0x2a3159,_0x1deee2){return function(_0x18d88f){if(_0x18d88f){return _0x18d88f[_0x4e35('0x22')](_0x2a3159)[_0x4e35('0x23')](function(_0x189dae){return _0x189dae;});}return null;};}function removeEntity(_0x555d84,_0x5493a4){return function(_0x8d31d9){if(_0x8d31d9){return _0x8d31d9[_0x4e35('0x24')]()[_0x4e35('0x23')](function(){_0x555d84[_0x4e35('0x19')](0xcc)[_0x4e35('0x25')]();});}};}function handleEntityNotFound(_0x171533,_0x5c8575){return function(_0x480c3c){if(!_0x480c3c){_0x171533[_0x4e35('0x18')](0x194);}return _0x480c3c;};}function handleError(_0x573d9d,_0x3e6805){_0x3e6805=_0x3e6805||0x1f4;return function(_0x5a51fd){logger[_0x4e35('0x26')](_0x5a51fd[_0x4e35('0x27')]);if(_0x5a51fd['name']){delete _0x5a51fd[_0x4e35('0x28')];}_0x573d9d[_0x4e35('0x19')](_0x3e6805)[_0x4e35('0x29')](_0x5a51fd);};}exports[_0x4e35('0x2a')]=function(_0x2b5505,_0x4689e7){var _0x1b89fa={},_0x2afe93={},_0xaa0c99={'count':0x0,'rows':[]};var _0x48b2b9=_[_0x4e35('0x2b')](db['SquareMessage'][_0x4e35('0x2c')],function(_0x11afba){return{'name':_0x11afba[_0x4e35('0x2d')],'type':_0x11afba[_0x4e35('0x2e')]['key']};});_0x2afe93['model']=_[_0x4e35('0x2b')](_0x48b2b9,_0x4e35('0x28'));_0x2afe93[_0x4e35('0x2f')]=_[_0x4e35('0x30')](_0x2b5505[_0x4e35('0x2f')]);_0x2afe93['filters']=_[_0x4e35('0x31')](_0x2afe93[_0x4e35('0x32')],_0x2afe93[_0x4e35('0x2f')]);_0x1b89fa[_0x4e35('0x33')]=_[_0x4e35('0x31')](_0x2afe93[_0x4e35('0x32')],qs[_0x4e35('0x34')](_0x2b5505['query'][_0x4e35('0x34')]));_0x1b89fa[_0x4e35('0x33')]=_0x1b89fa['attributes'][_0x4e35('0x35')]?_0x1b89fa[_0x4e35('0x33')]:_0x2afe93[_0x4e35('0x32')];if(!_0x2b5505[_0x4e35('0x2f')]['hasOwnProperty'](_0x4e35('0x36'))){_0x1b89fa[_0x4e35('0x1d')]=qs[_0x4e35('0x1d')](_0x2b5505[_0x4e35('0x2f')][_0x4e35('0x1d')]);_0x1b89fa[_0x4e35('0x1b')]=qs[_0x4e35('0x1b')](_0x2b5505[_0x4e35('0x2f')][_0x4e35('0x1b')]);}_0x1b89fa['order']=qs['sort'](_0x2b5505[_0x4e35('0x2f')][_0x4e35('0x37')]);_0x1b89fa['where']=qs[_0x4e35('0x38')](_[_0x4e35('0x39')](_0x2b5505['query'],_0x2afe93[_0x4e35('0x38')]),_0x48b2b9);if(_0x2b5505[_0x4e35('0x2f')]['filter']){_0x1b89fa[_0x4e35('0x3a')]=_[_0x4e35('0x3b')](_0x1b89fa['where'],{'$or':_[_0x4e35('0x2b')](_0x48b2b9,function(_0x159d08){if(_0x159d08['type']!==_0x4e35('0x3c')){var _0x446ef0={};_0x446ef0[_0x159d08[_0x4e35('0x28')]]={'$like':'%'+_0x2b5505['query'][_0x4e35('0x3d')]+'%'};return _0x446ef0;}})});}_0x1b89fa=_[_0x4e35('0x3b')]({},_0x1b89fa,_0x2b5505[_0x4e35('0x3e')]);var _0x2c1123={'where':_0x1b89fa[_0x4e35('0x3a')]};return db[_0x4e35('0x3f')][_0x4e35('0x40')](_0x2c1123)[_0x4e35('0x23')](function(_0x344f34){_0xaa0c99[_0x4e35('0x40')]=_0x344f34;if(_0x2b5505[_0x4e35('0x2f')][_0x4e35('0x41')]){_0x1b89fa['include']=[{'all':!![]}];}return db[_0x4e35('0x3f')]['findAll'](_0x1b89fa);})[_0x4e35('0x23')](function(_0x1d63f3){_0xaa0c99[_0x4e35('0x42')]=_0x1d63f3;return _0xaa0c99;})['then'](respondWithFilteredResult(_0x4689e7,_0x1b89fa))[_0x4e35('0x43')](handleError(_0x4689e7,null));};exports[_0x4e35('0x44')]=function(_0x241ffa,_0x302d4e){var _0x567383={'raw':!![],'where':{'id':_0x241ffa[_0x4e35('0x45')]['id']}},_0x3e23ff={};_0x3e23ff[_0x4e35('0x32')]=_[_0x4e35('0x30')](db[_0x4e35('0x3f')][_0x4e35('0x2c')]);_0x3e23ff[_0x4e35('0x2f')]=_[_0x4e35('0x30')](_0x241ffa[_0x4e35('0x2f')]);_0x3e23ff['filters']=_['intersection'](_0x3e23ff[_0x4e35('0x32')],_0x3e23ff['query']);_0x567383['attributes']=_[_0x4e35('0x31')](_0x3e23ff[_0x4e35('0x32')],qs['fields'](_0x241ffa[_0x4e35('0x2f')][_0x4e35('0x34')]));_0x567383[_0x4e35('0x33')]=_0x567383[_0x4e35('0x33')]['length']?_0x567383[_0x4e35('0x33')]:_0x3e23ff[_0x4e35('0x32')];if(_0x241ffa[_0x4e35('0x2f')][_0x4e35('0x41')]){_0x567383[_0x4e35('0x46')]=[{'all':!![]}];}_0x567383=_[_0x4e35('0x3b')]({},_0x567383,_0x241ffa[_0x4e35('0x3e')]);return db[_0x4e35('0x3f')][_0x4e35('0x47')](_0x567383)[_0x4e35('0x23')](handleEntityNotFound(_0x302d4e,null))[_0x4e35('0x23')](respondWithResult(_0x302d4e,null))[_0x4e35('0x43')](handleError(_0x302d4e,null));};exports[_0x4e35('0x48')]=function(_0x2a96d6,_0x58389e){return db[_0x4e35('0x3f')]['create'](_0x2a96d6['body'],{})[_0x4e35('0x23')](respondWithResult(_0x58389e,0xc9))[_0x4e35('0x43')](handleError(_0x58389e,null));};exports[_0x4e35('0x22')]=function(_0x241648,_0xbfe539){if(_0x241648[_0x4e35('0x49')]['id']){delete _0x241648[_0x4e35('0x49')]['id'];}return db['SquareMessage'][_0x4e35('0x47')]({'where':{'id':_0x241648[_0x4e35('0x45')]['id']}})[_0x4e35('0x23')](handleEntityNotFound(_0xbfe539,null))['then'](saveUpdates(_0x241648['body'],null))[_0x4e35('0x23')](respondWithResult(_0xbfe539,null))[_0x4e35('0x43')](handleError(_0xbfe539,null));};exports[_0x4e35('0x24')]=function(_0x8396ca,_0x41d9a2){return db[_0x4e35('0x3f')]['find']({'where':{'id':_0x8396ca[_0x4e35('0x45')]['id']}})[_0x4e35('0x23')](handleEntityNotFound(_0x41d9a2,null))['then'](removeEntity(_0x41d9a2,null))[_0x4e35('0x43')](handleError(_0x41d9a2,null));}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.model.js b/server/api/squareMessage/squareMessage.model.js index b0149a8..149adf8 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 _0x89b0=['../../config/environment','./squareMessage.attributes','exports','define','square_messages','lodash','util','../../config/logger','api','bluebird','request-promise','rimraf'];(function(_0x58670d,_0x26cf37){var _0x333293=function(_0x170064){while(--_0x170064){_0x58670d['push'](_0x58670d['shift']());}};_0x333293(++_0x26cf37);}(_0x89b0,0x7d));var _0x089b=function(_0x2b2ed6,_0x41c149){_0x2b2ed6=_0x2b2ed6-0x0;var _0xd13d17=_0x89b0[_0x2b2ed6];return _0xd13d17;};'use strict';var _=require(_0x089b('0x0'));var util=require(_0x089b('0x1'));var logger=require(_0x089b('0x2'))(_0x089b('0x3'));var moment=require('moment');var BPromise=require(_0x089b('0x4'));var rp=require(_0x089b('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x089b('0x6'));var config=require(_0x089b('0x7'));var attributes=require(_0x089b('0x8'));module[_0x089b('0x9')]=function(_0x37615f,_0x236d8c){return _0x37615f[_0x089b('0xa')]('SquareMessage',attributes,{'tableName':_0x089b('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd2ad=['square_messages','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./squareMessage.attributes','SquareMessage'];(function(_0x4a7631,_0x2c85b9){var _0x1a5a6f=function(_0x1ee3fd){while(--_0x1ee3fd){_0x4a7631['push'](_0x4a7631['shift']());}};_0x1a5a6f(++_0x2c85b9);}(_0xd2ad,0x12d));var _0xdd2a=function(_0x51bda1,_0x44f80d){_0x51bda1=_0x51bda1-0x0;var _0x1ce08c=_0xd2ad[_0x51bda1];return _0x1ce08c;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xdd2a('0x0'))(_0xdd2a('0x1'));var moment=require(_0xdd2a('0x2'));var BPromise=require('bluebird');var rp=require(_0xdd2a('0x3'));var fs=require('fs');var path=require(_0xdd2a('0x4'));var rimraf=require(_0xdd2a('0x5'));var config=require(_0xdd2a('0x6'));var attributes=require(_0xdd2a('0x7'));module['exports']=function(_0x3bf738,_0x522044){return _0x3bf738['define'](_0xdd2a('0x8'),attributes,{'tableName':_0xdd2a('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.rpc.js b/server/api/squareMessage/squareMessage.rpc.js index 48e6bc6..9572c17 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 _0x2049=['options','raw','stringify','util','moment','bluebird','randomstring','../../config/utils','../../config/environment','http','request','then','SquareMessage,\x20%s,\x20%s','SquareMessage,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','info','result','catch','CreateSquareMessage','create','body'];(function(_0x599a76,_0x385252){var _0x3421e8=function(_0x59b4ee){while(--_0x59b4ee){_0x599a76['push'](_0x599a76['shift']());}};_0x3421e8(++_0x385252);}(_0x2049,0x1e6));var _0x9204=function(_0x4de82a,_0x340752){_0x4de82a=_0x4de82a-0x0;var _0x1ee230=_0x2049[_0x4de82a];return _0x1ee230;};'use strict';var _=require('lodash');var util=require(_0x9204('0x0'));var moment=require(_0x9204('0x1'));var BPromise=require(_0x9204('0x2'));var rs=require(_0x9204('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x9204('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0x9204('0x5'));var jayson=require('jayson/promise');var client=jayson['client'][_0x9204('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x428d4d,_0x26df12,_0x305a97){return new BPromise(function(_0x973aa9,_0x156208){return client[_0x9204('0x7')](_0x428d4d,_0x305a97)[_0x9204('0x8')](function(_0x5ea00e){logger['info'](_0x9204('0x9'),_0x26df12,'request\x20sent');logger['debug'](_0x9204('0xa'),_0x26df12,_0x9204('0xb'),JSON['stringify'](_0x5ea00e));if(_0x5ea00e['error']){if(_0x5ea00e[_0x9204('0xc')]['code']===0x1f4){logger[_0x9204('0xc')](_0x9204('0x9'),_0x26df12,_0x5ea00e[_0x9204('0xc')][_0x9204('0xd')]);return _0x156208(_0x5ea00e['error'][_0x9204('0xd')]);}logger['error']('SquareMessage,\x20%s,\x20%s',_0x26df12,_0x5ea00e[_0x9204('0xc')]['message']);return _0x973aa9(_0x5ea00e['error'][_0x9204('0xd')]);}else{logger[_0x9204('0xe')](_0x9204('0x9'),_0x26df12,_0x9204('0xb'));_0x973aa9(_0x5ea00e[_0x9204('0xf')][_0x9204('0xd')]);}})[_0x9204('0x10')](function(_0x44a7c3){logger['error'](_0x9204('0x9'),_0x26df12,_0x44a7c3);_0x156208(_0x44a7c3);});});}exports[_0x9204('0x11')]=function(_0xdaf4f5){var _0x1ca1d6=this;return new Promise(function(_0x4df610,_0x5ba979){return db['SquareMessage'][_0x9204('0x12')](_0xdaf4f5[_0x9204('0x13')],{'raw':_0xdaf4f5[_0x9204('0x14')]?_0xdaf4f5['options'][_0x9204('0x15')]===undefined?!![]:![]:!![]})[_0x9204('0x8')](function(_0x101677){logger[_0x9204('0xe')](_0x9204('0x11'),_0xdaf4f5);logger['debug'](_0x9204('0x11'),_0xdaf4f5,JSON[_0x9204('0x16')](_0x101677));_0x4df610(_0x101677);})[_0x9204('0x10')](function(_0x6e802){logger[_0x9204('0xc')](_0x9204('0x11'),_0x6e802['message'],_0xdaf4f5);_0x5ba979(_0x1ca1d6[_0x9204('0xc')](0x1f4,_0x6e802['message']));});});}; \ No newline at end of file +var _0x4ae3=['SquareMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','CreateSquareMessage','create','body','options','debug','lodash','util','moment','bluebird','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','SquareMessage,\x20%s,\x20%s'];(function(_0x1b9864,_0x53e2fc){var _0x11d5c1=function(_0x376583){while(--_0x376583){_0x1b9864['push'](_0x1b9864['shift']());}};_0x11d5c1(++_0x53e2fc);}(_0x4ae3,0x1be));var _0x34ae=function(_0x44b0de,_0x213afa){_0x44b0de=_0x44b0de-0x0;var _0x21da2a=_0x4ae3[_0x44b0de];return _0x21da2a;};'use strict';var _=require(_0x34ae('0x0'));var util=require(_0x34ae('0x1'));var moment=require(_0x34ae('0x2'));var BPromise=require(_0x34ae('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x34ae('0x4'));var logger=require(_0x34ae('0x5'))(_0x34ae('0x6'));var config=require('../../config/environment');var jayson=require(_0x34ae('0x7'));var client=jayson[_0x34ae('0x8')][_0x34ae('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5eedb0,_0x322b3c,_0x550eb0){return new BPromise(function(_0x16c785,_0x2dc082){return client[_0x34ae('0xa')](_0x5eedb0,_0x550eb0)[_0x34ae('0xb')](function(_0x1e68f5){logger['info'](_0x34ae('0xc'),_0x322b3c,'request\x20sent');logger['debug'](_0x34ae('0xd'),_0x322b3c,_0x34ae('0xe'),JSON[_0x34ae('0xf')](_0x1e68f5));if(_0x1e68f5['error']){if(_0x1e68f5[_0x34ae('0x10')][_0x34ae('0x11')]===0x1f4){logger[_0x34ae('0x10')]('SquareMessage,\x20%s,\x20%s',_0x322b3c,_0x1e68f5['error'][_0x34ae('0x12')]);return _0x2dc082(_0x1e68f5[_0x34ae('0x10')][_0x34ae('0x12')]);}logger[_0x34ae('0x10')](_0x34ae('0xc'),_0x322b3c,_0x1e68f5[_0x34ae('0x10')][_0x34ae('0x12')]);return _0x16c785(_0x1e68f5[_0x34ae('0x10')][_0x34ae('0x12')]);}else{logger[_0x34ae('0x13')](_0x34ae('0xc'),_0x322b3c,_0x34ae('0xe'));_0x16c785(_0x1e68f5[_0x34ae('0x14')][_0x34ae('0x12')]);}})[_0x34ae('0x15')](function(_0xbfeb94){logger['error'](_0x34ae('0xc'),_0x322b3c,_0xbfeb94);_0x2dc082(_0xbfeb94);});});}exports[_0x34ae('0x16')]=function(_0x32cb3e){var _0xa1a41c=this;return new Promise(function(_0x3851d7,_0x5c4199){return db['SquareMessage'][_0x34ae('0x17')](_0x32cb3e[_0x34ae('0x18')],{'raw':_0x32cb3e[_0x34ae('0x19')]?_0x32cb3e[_0x34ae('0x19')]['raw']===undefined?!![]:![]:!![]})[_0x34ae('0xb')](function(_0x2a3e67){logger['info'](_0x34ae('0x16'),_0x32cb3e);logger[_0x34ae('0x1a')]('CreateSquareMessage',_0x32cb3e,JSON[_0x34ae('0xf')](_0x2a3e67));_0x3851d7(_0x2a3e67);})[_0x34ae('0x15')](function(_0x436868){logger[_0x34ae('0x10')](_0x34ae('0x16'),_0x436868[_0x34ae('0x12')],_0x32cb3e);_0x5c4199(_0xa1a41c[_0x34ae('0x10')](0x1f4,_0x436868[_0x34ae('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/squareOdbc/index.js b/server/api/squareOdbc/index.js index 4e4483c..84df6b0 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 _0x4bc1=['post','create','put','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareOdbc.controller','get','isAuthenticated','/:id','show','/:id/test','test'];(function(_0x1883eb,_0x197563){var _0x4b345b=function(_0x4aecac){while(--_0x4aecac){_0x1883eb['push'](_0x1883eb['shift']());}};_0x4b345b(++_0x197563);}(_0x4bc1,0xb6));var _0x14bc=function(_0x1271f4,_0xf3298d){_0x1271f4=_0x1271f4-0x0;var _0x9285a4=_0x4bc1[_0x1271f4];return _0x9285a4;};'use strict';var multer=require(_0x14bc('0x0'));var util=require(_0x14bc('0x1'));var path=require(_0x14bc('0x2'));var timeout=require(_0x14bc('0x3'));var express=require(_0x14bc('0x4'));var router=express[_0x14bc('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x14bc('0x6'));var interaction=require(_0x14bc('0x7'));var config=require(_0x14bc('0x8'));var controller=require(_0x14bc('0x9'));router[_0x14bc('0xa')]('/',auth[_0x14bc('0xb')](),controller['index']);router['get'](_0x14bc('0xc'),auth[_0x14bc('0xb')](),controller[_0x14bc('0xd')]);router[_0x14bc('0xa')](_0x14bc('0xe'),auth['isAuthenticated'](),timeout('15s'),controller[_0x14bc('0xf')]);router[_0x14bc('0x10')]('/',auth[_0x14bc('0xb')](),controller[_0x14bc('0x11')]);router[_0x14bc('0x12')]('/:id',auth[_0x14bc('0xb')](),controller['update']);router[_0x14bc('0x13')]('/:id',auth[_0x14bc('0xb')](),controller[_0x14bc('0x14')]);module[_0x14bc('0x15')]=router; \ No newline at end of file +var _0xd664=['get','isAuthenticated','index','show','15s','test','post','create','put','/:id','update','delete','destroy','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareOdbc.controller'];(function(_0x23e859,_0x419ccc){var _0xe4964=function(_0x2e2501){while(--_0x2e2501){_0x23e859['push'](_0x23e859['shift']());}};_0xe4964(++_0x419ccc);}(_0xd664,0x97));var _0x4d66=function(_0x31d3e1,_0x1964af){_0x31d3e1=_0x31d3e1-0x0;var _0x3fc0f4=_0xd664[_0x31d3e1];return _0x3fc0f4;};'use strict';var multer=require(_0x4d66('0x0'));var util=require(_0x4d66('0x1'));var path=require(_0x4d66('0x2'));var timeout=require(_0x4d66('0x3'));var express=require(_0x4d66('0x4'));var router=express['Router']();var fs_extra=require(_0x4d66('0x5'));var auth=require(_0x4d66('0x6'));var interaction=require(_0x4d66('0x7'));var config=require(_0x4d66('0x8'));var controller=require(_0x4d66('0x9'));router[_0x4d66('0xa')]('/',auth[_0x4d66('0xb')](),controller[_0x4d66('0xc')]);router['get']('/:id',auth[_0x4d66('0xb')](),controller[_0x4d66('0xd')]);router[_0x4d66('0xa')]('/:id/test',auth['isAuthenticated'](),timeout(_0x4d66('0xe')),controller[_0x4d66('0xf')]);router[_0x4d66('0x10')]('/',auth[_0x4d66('0xb')](),controller[_0x4d66('0x11')]);router[_0x4d66('0x12')](_0x4d66('0x13'),auth[_0x4d66('0xb')](),controller[_0x4d66('0x14')]);router[_0x4d66('0x15')](_0x4d66('0x13'),auth[_0x4d66('0xb')](),controller[_0x4d66('0x16')]);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 53942e3..f6e9ce1 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 _0x9788=['name','STRING','sequelize','exports'];(function(_0x3b76e9,_0x39efb2){var _0x43489c=function(_0x1040a9){while(--_0x1040a9){_0x3b76e9['push'](_0x3b76e9['shift']());}};_0x43489c(++_0x39efb2);}(_0x9788,0x14a));var _0x8978=function(_0x2b21e6,_0x4df2bf){_0x2b21e6=_0x2b21e6-0x0;var _0xea3f17=_0x9788[_0x2b21e6];return _0xea3f17;};'use strict';var Sequelize=require(_0x8978('0x0'));module[_0x8978('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x8978('0x2'),'allowNull':![]},'dsn':{'type':Sequelize[_0x8978('0x3')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x296b=['exports','name','STRING'];(function(_0x55c03f,_0x485550){var _0x5c9c26=function(_0x1f1df2){while(--_0x1f1df2){_0x55c03f['push'](_0x55c03f['shift']());}};_0x5c9c26(++_0x485550);}(_0x296b,0x138));var _0xb296=function(_0x4099ee,_0x38495a){_0x4099ee=_0x4099ee-0x0;var _0x1b7bfc=_0x296b[_0x4099ee];return _0x1b7bfc;};'use strict';var Sequelize=require('sequelize');module[_0xb296('0x0')]={'name':{'type':Sequelize['STRING'],'unique':_0xb296('0x1'),'allowNull':![]},'dsn':{'type':Sequelize[_0xb296('0x2')]},'description':{'type':Sequelize[_0xb296('0x2')]}}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.controller.js b/server/api/squareOdbc/squareOdbc.controller.js index 2d3a66c..2e3da4a 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 _0xe928=['path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','save','then','destroy','get','ODBC','UserProfileResource','end','name','send','index','map','SquareOdbc','rawAttributes','fieldName','type','key','model','query','keys','attributes','fields','length','nolimit','order','sort','where','pick','filters','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','intersection','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','error','update','dsn','odbc','openSync','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util'];(function(_0x5d43ef,_0x51fb2b){var _0x167451=function(_0x3ed3af){while(--_0x3ed3af){_0x5d43ef['push'](_0x5d43ef['shift']());}};_0x167451(++_0x51fb2b);}(_0xe928,0x164));var _0x8e92=function(_0x3e95c0,_0x5cc3f1){_0x3e95c0=_0x3e95c0-0x0;var _0x29cdcd=_0xe928[_0x3e95c0];return _0x29cdcd;};'use strict';var emlformat=require(_0x8e92('0x0'));var rimraf=require(_0x8e92('0x1'));var zipdir=require(_0x8e92('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8e92('0x3'));var moment=require(_0x8e92('0x4'));var BPromise=require(_0x8e92('0x5'));var Mustache=require(_0x8e92('0x6'));var util=require(_0x8e92('0x7'));var path=require(_0x8e92('0x8'));var sox=require(_0x8e92('0x9'));var csv=require(_0x8e92('0xa'));var ejs=require(_0x8e92('0xb'));var fs=require('fs');var fs_extra=require(_0x8e92('0xc'));var _=require(_0x8e92('0xd'));var squel=require('squel');var crypto=require(_0x8e92('0xe'));var jsforce=require(_0x8e92('0xf'));var deskjs=require(_0x8e92('0x10'));var toCsv=require('to-csv');var querystring=require(_0x8e92('0x11'));var Papa=require(_0x8e92('0x12'));var Redis=require(_0x8e92('0x13'));var authService=require(_0x8e92('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0x8e92('0x15'));var hardwareService=require(_0x8e92('0x16'));var logger=require(_0x8e92('0x17'))(_0x8e92('0x18'));var utils=require(_0x8e92('0x19'));var config=require(_0x8e92('0x1a'));var licenseUtil=require(_0x8e92('0x1b'));var db=require(_0x8e92('0x1c'))['db'];function respondWithStatusCode(_0x5b0d38,_0x4abdfb){_0x4abdfb=_0x4abdfb||0xcc;return function(_0x1e7487){if(_0x1e7487){return _0x5b0d38[_0x8e92('0x1d')](_0x4abdfb);}return _0x5b0d38[_0x8e92('0x1e')](_0x4abdfb)['end']();};}function respondWithResult(_0x35ebd1,_0x43a1cd){_0x43a1cd=_0x43a1cd||0xc8;return function(_0x542557){if(_0x542557){return _0x35ebd1[_0x8e92('0x1e')](_0x43a1cd)[_0x8e92('0x1f')](_0x542557);}};}function respondWithFilteredResult(_0x35fabb,_0x123f37){return function(_0x3b2740){if(_0x3b2740){var _0x3765b8=typeof _0x123f37[_0x8e92('0x20')]===_0x8e92('0x21')&&typeof _0x123f37['limit']===_0x8e92('0x21');var _0x232ecd=_0x3b2740[_0x8e92('0x22')];var _0x3028d1=_0x3765b8?0x0:_0x123f37[_0x8e92('0x20')];var _0x5135b6=_0x3765b8?_0x3b2740[_0x8e92('0x22')]:_0x123f37['offset']+_0x123f37[_0x8e92('0x23')];var _0x1b2a89;if(_0x5135b6>=_0x232ecd){_0x5135b6=_0x232ecd;_0x1b2a89=0xc8;}else{_0x1b2a89=0xce;}_0x35fabb[_0x8e92('0x1e')](_0x1b2a89);return _0x35fabb[_0x8e92('0x24')](_0x8e92('0x25'),_0x3028d1+'-'+_0x5135b6+'/'+_0x232ecd)[_0x8e92('0x1f')](_0x3b2740);}return null;};}function patchUpdates(_0x5df9ad){return function(_0xe45806){try{jsonpatch[_0x8e92('0x26')](_0xe45806,_0x5df9ad,!![]);}catch(_0x4513d5){return BPromise['reject'](_0x4513d5);}return _0xe45806[_0x8e92('0x27')]();};}function saveUpdates(_0x4d736a,_0x14b07e){return function(_0x26ac11){if(_0x26ac11){return _0x26ac11['update'](_0x4d736a)[_0x8e92('0x28')](function(_0x521d28){return _0x521d28;});}return null;};}function removeEntity(_0x1fe300,_0x5cced7){return function(_0x7baf84){if(_0x7baf84){return _0x7baf84[_0x8e92('0x29')]()['then'](function(){var _0x48a882=_0x7baf84[_0x8e92('0x2a')]({'plain':!![]});var _0x2b1659=_0x8e92('0x2b');return db[_0x8e92('0x2c')][_0x8e92('0x29')]({'where':{'type':_0x2b1659,'resourceId':_0x48a882['id']}})[_0x8e92('0x28')](function(){return _0x7baf84;});})[_0x8e92('0x28')](function(){_0x1fe300[_0x8e92('0x1e')](0xcc)[_0x8e92('0x2d')]();});}};}function handleEntityNotFound(_0x327650,_0x364588){return function(_0xed07a8){if(!_0xed07a8){_0x327650[_0x8e92('0x1d')](0x194);}return _0xed07a8;};}function handleError(_0x3e8e4f,_0x569045){_0x569045=_0x569045||0x1f4;return function(_0x4e45d3){logger['error'](_0x4e45d3['stack']);if(_0x4e45d3[_0x8e92('0x2e')]){delete _0x4e45d3[_0x8e92('0x2e')];}_0x3e8e4f[_0x8e92('0x1e')](_0x569045)[_0x8e92('0x2f')](_0x4e45d3);};}exports[_0x8e92('0x30')]=function(_0x3104fd,_0xe5bd1f){var _0x19166d={},_0x46af83={},_0x2ac4af={'count':0x0,'rows':[]};var _0x38a8a0=_[_0x8e92('0x31')](db[_0x8e92('0x32')][_0x8e92('0x33')],function(_0x4ed9ce){return{'name':_0x4ed9ce[_0x8e92('0x34')],'type':_0x4ed9ce[_0x8e92('0x35')][_0x8e92('0x36')]};});_0x46af83[_0x8e92('0x37')]=_[_0x8e92('0x31')](_0x38a8a0,'name');_0x46af83[_0x8e92('0x38')]=_[_0x8e92('0x39')](_0x3104fd[_0x8e92('0x38')]);_0x46af83['filters']=_['intersection'](_0x46af83['model'],_0x46af83[_0x8e92('0x38')]);_0x19166d[_0x8e92('0x3a')]=_['intersection'](_0x46af83['model'],qs[_0x8e92('0x3b')](_0x3104fd[_0x8e92('0x38')][_0x8e92('0x3b')]));_0x19166d['attributes']=_0x19166d[_0x8e92('0x3a')][_0x8e92('0x3c')]?_0x19166d[_0x8e92('0x3a')]:_0x46af83[_0x8e92('0x37')];if(!_0x3104fd[_0x8e92('0x38')]['hasOwnProperty'](_0x8e92('0x3d'))){_0x19166d[_0x8e92('0x23')]=qs[_0x8e92('0x23')](_0x3104fd[_0x8e92('0x38')][_0x8e92('0x23')]);_0x19166d['offset']=qs[_0x8e92('0x20')](_0x3104fd[_0x8e92('0x38')]['offset']);}_0x19166d[_0x8e92('0x3e')]=qs[_0x8e92('0x3f')](_0x3104fd['query']['sort']);_0x19166d[_0x8e92('0x40')]=qs['filters'](_[_0x8e92('0x41')](_0x3104fd['query'],_0x46af83[_0x8e92('0x42')]),_0x38a8a0);if(_0x3104fd['query']['filter']){_0x19166d['where']=_[_0x8e92('0x43')](_0x19166d[_0x8e92('0x40')],{'$or':_['map'](_0x38a8a0,function(_0x57816b){if(_0x57816b[_0x8e92('0x35')]!==_0x8e92('0x44')){var _0xb5ea25={};_0xb5ea25[_0x57816b['name']]={'$like':'%'+_0x3104fd[_0x8e92('0x38')]['filter']+'%'};return _0xb5ea25;}})});}_0x19166d=_['merge']({},_0x19166d,_0x3104fd[_0x8e92('0x45')]);var _0x1689da={'where':_0x19166d[_0x8e92('0x40')]};return db['SquareOdbc'][_0x8e92('0x22')](_0x1689da)[_0x8e92('0x28')](function(_0x17d84e){_0x2ac4af[_0x8e92('0x22')]=_0x17d84e;if(_0x3104fd[_0x8e92('0x38')][_0x8e92('0x46')]){_0x19166d[_0x8e92('0x47')]=[{'all':!![]}];}return db[_0x8e92('0x32')][_0x8e92('0x48')](_0x19166d);})[_0x8e92('0x28')](function(_0x498a56){_0x2ac4af[_0x8e92('0x49')]=_0x498a56;return _0x2ac4af;})[_0x8e92('0x28')](respondWithFilteredResult(_0xe5bd1f,_0x19166d))[_0x8e92('0x4a')](handleError(_0xe5bd1f,null));};exports[_0x8e92('0x4b')]=function(_0xf275ed,_0x5c8d0b){var _0x4cbe6a={'raw':!![],'where':{'id':_0xf275ed[_0x8e92('0x4c')]['id']}},_0x31c254={};_0x31c254[_0x8e92('0x37')]=_['keys'](db['SquareOdbc'][_0x8e92('0x33')]);_0x31c254['query']=_['keys'](_0xf275ed[_0x8e92('0x38')]);_0x31c254[_0x8e92('0x42')]=_[_0x8e92('0x4d')](_0x31c254[_0x8e92('0x37')],_0x31c254[_0x8e92('0x38')]);_0x4cbe6a['attributes']=_[_0x8e92('0x4d')](_0x31c254['model'],qs[_0x8e92('0x3b')](_0xf275ed[_0x8e92('0x38')][_0x8e92('0x3b')]));_0x4cbe6a['attributes']=_0x4cbe6a['attributes']['length']?_0x4cbe6a['attributes']:_0x31c254[_0x8e92('0x37')];if(_0xf275ed[_0x8e92('0x38')][_0x8e92('0x46')]){_0x4cbe6a[_0x8e92('0x47')]=[{'all':!![]}];}_0x4cbe6a=_[_0x8e92('0x43')]({},_0x4cbe6a,_0xf275ed[_0x8e92('0x45')]);return db[_0x8e92('0x32')][_0x8e92('0x4e')](_0x4cbe6a)[_0x8e92('0x28')](handleEntityNotFound(_0x5c8d0b,null))[_0x8e92('0x28')](respondWithResult(_0x5c8d0b,null))[_0x8e92('0x4a')](handleError(_0x5c8d0b,null));};exports[_0x8e92('0x4f')]=function(_0x29212a,_0x18a23c){return db[_0x8e92('0x32')][_0x8e92('0x4f')](_0x29212a[_0x8e92('0x50')],{})[_0x8e92('0x28')](function(_0x58258c){var _0x37a841=_0x29212a['user']['get']({'plain':!![]});if(!_0x37a841)throw new Error(_0x8e92('0x51'));if(_0x37a841[_0x8e92('0x52')]===_0x8e92('0x53')){var _0x3c5e05=_0x58258c[_0x8e92('0x2a')]({'plain':!![]});var _0x3ae2cc=_0x8e92('0x2b');return db[_0x8e92('0x54')][_0x8e92('0x4e')]({'where':{'name':_0x3ae2cc,'userProfileId':_0x37a841[_0x8e92('0x55')]},'raw':!![]})['then'](function(_0x2bec6d){if(_0x2bec6d&&_0x2bec6d['autoAssociation']===0x0){return db[_0x8e92('0x2c')][_0x8e92('0x4f')]({'name':_0x3c5e05['name'],'resourceId':_0x3c5e05['id'],'type':_0x2bec6d['name'],'sectionId':_0x2bec6d['id']},{})[_0x8e92('0x28')](function(){return _0x58258c;});}else{return _0x58258c;}})[_0x8e92('0x4a')](function(_0x6f1dec){logger[_0x8e92('0x56')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x6f1dec);throw _0x6f1dec;});}return _0x58258c;})[_0x8e92('0x28')](respondWithResult(_0x18a23c,0xc9))[_0x8e92('0x4a')](handleError(_0x18a23c,null));};exports[_0x8e92('0x57')]=function(_0x5abdda,_0x3d892d){if(_0x5abdda['body']['id']){delete _0x5abdda[_0x8e92('0x50')]['id'];}return db['SquareOdbc']['find']({'where':{'id':_0x5abdda[_0x8e92('0x4c')]['id']}})[_0x8e92('0x28')](handleEntityNotFound(_0x3d892d,null))[_0x8e92('0x28')](saveUpdates(_0x5abdda[_0x8e92('0x50')],null))[_0x8e92('0x28')](respondWithResult(_0x3d892d,null))[_0x8e92('0x4a')](handleError(_0x3d892d,null));};exports[_0x8e92('0x29')]=function(_0x2c5bc0,_0x173947){return db[_0x8e92('0x32')][_0x8e92('0x4e')]({'where':{'id':_0x2c5bc0[_0x8e92('0x4c')]['id']}})['then'](handleEntityNotFound(_0x173947,null))[_0x8e92('0x28')](removeEntity(_0x173947,null))[_0x8e92('0x4a')](handleError(_0x173947,null));};exports['test']=function(_0x3242bd,_0x377cd5,_0x4e9824){var _0x4fc617;return db['SquareOdbc']['find']({'where':{'id':_0x3242bd['params']['id']},'attributes':['id',_0x8e92('0x58')]})[_0x8e92('0x28')](handleEntityNotFound(_0x377cd5,null))[_0x8e92('0x28')](function(_0x5980a7){if(_0x5980a7){var _0x369d51=require(_0x8e92('0x59'))();_0x369d51[_0x8e92('0x5a')](_0x5980a7['dsn']);_0x369d51['closeSync']();return _0x5980a7;}})[_0x8e92('0x28')](respondWithResult(_0x377cd5,null))['catch'](handleError(_0x377cd5,null));}; \ No newline at end of file +var _0x57f3=['UserProfileSection','userProfileId','autoAssociation','test','dsn','odbc','openSync','closeSync','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','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','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','get','ODBC','UserProfileResource','error','stack','name','send','index','map','SquareOdbc','rawAttributes','fieldName','type','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','filters','merge','where','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role'];(function(_0x126bcd,_0x4a1c06){var _0x488a50=function(_0xb70251){while(--_0xb70251){_0x126bcd['push'](_0x126bcd['shift']());}};_0x488a50(++_0x4a1c06);}(_0x57f3,0x116));var _0x357f=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x57f3[_0x59ee6f];return _0x4c0979;};'use strict';var emlformat=require(_0x357f('0x0'));var rimraf=require(_0x357f('0x1'));var zipdir=require(_0x357f('0x2'));var jsonpatch=require(_0x357f('0x3'));var rp=require(_0x357f('0x4'));var moment=require('moment');var BPromise=require(_0x357f('0x5'));var Mustache=require('mustache');var util=require(_0x357f('0x6'));var path=require(_0x357f('0x7'));var sox=require('sox');var csv=require(_0x357f('0x8'));var ejs=require(_0x357f('0x9'));var fs=require('fs');var fs_extra=require(_0x357f('0xa'));var _=require('lodash');var squel=require(_0x357f('0xb'));var crypto=require(_0x357f('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x357f('0xd'));var toCsv=require('to-csv');var querystring=require(_0x357f('0xe'));var Papa=require('papaparse');var Redis=require(_0x357f('0xf'));var authService=require(_0x357f('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x357f('0x11'));var hardwareService=require(_0x357f('0x12'));var logger=require(_0x357f('0x13'))(_0x357f('0x14'));var utils=require(_0x357f('0x15'));var config=require(_0x357f('0x16'));var licenseUtil=require(_0x357f('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x120769,_0x5acead){_0x5acead=_0x5acead||0xcc;return function(_0x468447){if(_0x468447){return _0x120769[_0x357f('0x18')](_0x5acead);}return _0x120769[_0x357f('0x19')](_0x5acead)[_0x357f('0x1a')]();};}function respondWithResult(_0x2fb805,_0x57f334){_0x57f334=_0x57f334||0xc8;return function(_0x47baff){if(_0x47baff){return _0x2fb805[_0x357f('0x19')](_0x57f334)[_0x357f('0x1b')](_0x47baff);}};}function respondWithFilteredResult(_0x24fcb9,_0x1e4b82){return function(_0x23f21e){if(_0x23f21e){var _0x174cdc=typeof _0x1e4b82[_0x357f('0x1c')]==='undefined'&&typeof _0x1e4b82['limit']===_0x357f('0x1d');var _0x5ad9e4=_0x23f21e[_0x357f('0x1e')];var _0x5d4981=_0x174cdc?0x0:_0x1e4b82[_0x357f('0x1c')];var _0x2444dc=_0x174cdc?_0x23f21e['count']:_0x1e4b82[_0x357f('0x1c')]+_0x1e4b82[_0x357f('0x1f')];var _0x155466;if(_0x2444dc>=_0x5ad9e4){_0x2444dc=_0x5ad9e4;_0x155466=0xc8;}else{_0x155466=0xce;}_0x24fcb9[_0x357f('0x19')](_0x155466);return _0x24fcb9[_0x357f('0x20')](_0x357f('0x21'),_0x5d4981+'-'+_0x2444dc+'/'+_0x5ad9e4)[_0x357f('0x1b')](_0x23f21e);}return null;};}function patchUpdates(_0x4f159a){return function(_0x21be0d){try{jsonpatch[_0x357f('0x22')](_0x21be0d,_0x4f159a,!![]);}catch(_0x789fa7){return BPromise[_0x357f('0x23')](_0x789fa7);}return _0x21be0d[_0x357f('0x24')]();};}function saveUpdates(_0x33cb58,_0x44177e){return function(_0x15bc15){if(_0x15bc15){return _0x15bc15[_0x357f('0x25')](_0x33cb58)[_0x357f('0x26')](function(_0x4fe6dc){return _0x4fe6dc;});}return null;};}function removeEntity(_0x41712e,_0x4bb7c1){return function(_0x31b254){if(_0x31b254){return _0x31b254[_0x357f('0x27')]()[_0x357f('0x26')](function(){var _0x1adfdb=_0x31b254[_0x357f('0x28')]({'plain':!![]});var _0x37dd41=_0x357f('0x29');return db[_0x357f('0x2a')][_0x357f('0x27')]({'where':{'type':_0x37dd41,'resourceId':_0x1adfdb['id']}})[_0x357f('0x26')](function(){return _0x31b254;});})[_0x357f('0x26')](function(){_0x41712e[_0x357f('0x19')](0xcc)[_0x357f('0x1a')]();});}};}function handleEntityNotFound(_0x4898af,_0x41f1c0){return function(_0x7806f2){if(!_0x7806f2){_0x4898af['sendStatus'](0x194);}return _0x7806f2;};}function handleError(_0x91f61b,_0x109d5b){_0x109d5b=_0x109d5b||0x1f4;return function(_0x428e21){logger[_0x357f('0x2b')](_0x428e21[_0x357f('0x2c')]);if(_0x428e21[_0x357f('0x2d')]){delete _0x428e21[_0x357f('0x2d')];}_0x91f61b['status'](_0x109d5b)[_0x357f('0x2e')](_0x428e21);};}exports[_0x357f('0x2f')]=function(_0x157c27,_0xeb556){var _0x22ba0f={},_0x4fa81a={},_0x56c805={'count':0x0,'rows':[]};var _0x11ee35=_[_0x357f('0x30')](db[_0x357f('0x31')][_0x357f('0x32')],function(_0x3d072e){return{'name':_0x3d072e[_0x357f('0x33')],'type':_0x3d072e[_0x357f('0x34')]['key']};});_0x4fa81a[_0x357f('0x35')]=_[_0x357f('0x30')](_0x11ee35,'name');_0x4fa81a[_0x357f('0x36')]=_[_0x357f('0x37')](_0x157c27['query']);_0x4fa81a['filters']=_[_0x357f('0x38')](_0x4fa81a['model'],_0x4fa81a[_0x357f('0x36')]);_0x22ba0f[_0x357f('0x39')]=_[_0x357f('0x38')](_0x4fa81a[_0x357f('0x35')],qs[_0x357f('0x3a')](_0x157c27[_0x357f('0x36')][_0x357f('0x3a')]));_0x22ba0f[_0x357f('0x39')]=_0x22ba0f[_0x357f('0x39')][_0x357f('0x3b')]?_0x22ba0f[_0x357f('0x39')]:_0x4fa81a[_0x357f('0x35')];if(!_0x157c27[_0x357f('0x36')][_0x357f('0x3c')](_0x357f('0x3d'))){_0x22ba0f['limit']=qs[_0x357f('0x1f')](_0x157c27[_0x357f('0x36')][_0x357f('0x1f')]);_0x22ba0f[_0x357f('0x1c')]=qs[_0x357f('0x1c')](_0x157c27[_0x357f('0x36')][_0x357f('0x1c')]);}_0x22ba0f['order']=qs[_0x357f('0x3e')](_0x157c27[_0x357f('0x36')]['sort']);_0x22ba0f['where']=qs['filters'](_[_0x357f('0x3f')](_0x157c27[_0x357f('0x36')],_0x4fa81a[_0x357f('0x40')]),_0x11ee35);if(_0x157c27[_0x357f('0x36')]['filter']){_0x22ba0f['where']=_[_0x357f('0x41')](_0x22ba0f[_0x357f('0x42')],{'$or':_['map'](_0x11ee35,function(_0x39d9e1){if(_0x39d9e1['type']!==_0x357f('0x43')){var _0x15c79b={};_0x15c79b[_0x39d9e1[_0x357f('0x2d')]]={'$like':'%'+_0x157c27[_0x357f('0x36')]['filter']+'%'};return _0x15c79b;}})});}_0x22ba0f=_[_0x357f('0x41')]({},_0x22ba0f,_0x157c27['options']);var _0x5ddf29={'where':_0x22ba0f['where']};return db[_0x357f('0x31')]['count'](_0x5ddf29)[_0x357f('0x26')](function(_0xab8b0){_0x56c805['count']=_0xab8b0;if(_0x157c27[_0x357f('0x36')][_0x357f('0x44')]){_0x22ba0f[_0x357f('0x45')]=[{'all':!![]}];}return db[_0x357f('0x31')][_0x357f('0x46')](_0x22ba0f);})[_0x357f('0x26')](function(_0x2a8a5b){_0x56c805[_0x357f('0x47')]=_0x2a8a5b;return _0x56c805;})[_0x357f('0x26')](respondWithFilteredResult(_0xeb556,_0x22ba0f))[_0x357f('0x48')](handleError(_0xeb556,null));};exports[_0x357f('0x49')]=function(_0x389335,_0x5bebd9){var _0x4455f0={'raw':!![],'where':{'id':_0x389335[_0x357f('0x4a')]['id']}},_0x1941ba={};_0x1941ba[_0x357f('0x35')]=_[_0x357f('0x37')](db['SquareOdbc'][_0x357f('0x32')]);_0x1941ba[_0x357f('0x36')]=_[_0x357f('0x37')](_0x389335['query']);_0x1941ba['filters']=_[_0x357f('0x38')](_0x1941ba[_0x357f('0x35')],_0x1941ba[_0x357f('0x36')]);_0x4455f0[_0x357f('0x39')]=_['intersection'](_0x1941ba['model'],qs[_0x357f('0x3a')](_0x389335[_0x357f('0x36')][_0x357f('0x3a')]));_0x4455f0[_0x357f('0x39')]=_0x4455f0[_0x357f('0x39')][_0x357f('0x3b')]?_0x4455f0[_0x357f('0x39')]:_0x1941ba[_0x357f('0x35')];if(_0x389335[_0x357f('0x36')]['includeAll']){_0x4455f0['include']=[{'all':!![]}];}_0x4455f0=_[_0x357f('0x41')]({},_0x4455f0,_0x389335[_0x357f('0x4b')]);return db[_0x357f('0x31')][_0x357f('0x4c')](_0x4455f0)[_0x357f('0x26')](handleEntityNotFound(_0x5bebd9,null))[_0x357f('0x26')](respondWithResult(_0x5bebd9,null))['catch'](handleError(_0x5bebd9,null));};exports[_0x357f('0x4d')]=function(_0x5b8b95,_0x2fd563){return db[_0x357f('0x31')][_0x357f('0x4d')](_0x5b8b95[_0x357f('0x4e')],{})['then'](function(_0x844964){var _0x2d8fe3=_0x5b8b95[_0x357f('0x4f')][_0x357f('0x28')]({'plain':!![]});if(!_0x2d8fe3)throw new Error(_0x357f('0x50'));if(_0x2d8fe3[_0x357f('0x51')]===_0x357f('0x4f')){var _0x2cf54b=_0x844964[_0x357f('0x28')]({'plain':!![]});var _0x46190d='ODBC';return db[_0x357f('0x52')]['find']({'where':{'name':_0x46190d,'userProfileId':_0x2d8fe3[_0x357f('0x53')]},'raw':!![]})[_0x357f('0x26')](function(_0xf55bb8){if(_0xf55bb8&&_0xf55bb8[_0x357f('0x54')]===0x0){return db['UserProfileResource'][_0x357f('0x4d')]({'name':_0x2cf54b['name'],'resourceId':_0x2cf54b['id'],'type':_0xf55bb8['name'],'sectionId':_0xf55bb8['id']},{})[_0x357f('0x26')](function(){return _0x844964;});}else{return _0x844964;}})[_0x357f('0x48')](function(_0xd8ea6f){logger[_0x357f('0x2b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xd8ea6f);throw _0xd8ea6f;});}return _0x844964;})[_0x357f('0x26')](respondWithResult(_0x2fd563,0xc9))['catch'](handleError(_0x2fd563,null));};exports[_0x357f('0x25')]=function(_0x4d9cac,_0x2dce0c){if(_0x4d9cac[_0x357f('0x4e')]['id']){delete _0x4d9cac['body']['id'];}return db[_0x357f('0x31')][_0x357f('0x4c')]({'where':{'id':_0x4d9cac['params']['id']}})[_0x357f('0x26')](handleEntityNotFound(_0x2dce0c,null))[_0x357f('0x26')](saveUpdates(_0x4d9cac['body'],null))['then'](respondWithResult(_0x2dce0c,null))['catch'](handleError(_0x2dce0c,null));};exports['destroy']=function(_0x5427a5,_0x535b8a){return db[_0x357f('0x31')][_0x357f('0x4c')]({'where':{'id':_0x5427a5[_0x357f('0x4a')]['id']}})[_0x357f('0x26')](handleEntityNotFound(_0x535b8a,null))[_0x357f('0x26')](removeEntity(_0x535b8a,null))[_0x357f('0x48')](handleError(_0x535b8a,null));};exports[_0x357f('0x55')]=function(_0x3b59c9,_0x1378a6,_0x4ba177){var _0x3c2ddd;return db[_0x357f('0x31')][_0x357f('0x4c')]({'where':{'id':_0x3b59c9[_0x357f('0x4a')]['id']},'attributes':['id',_0x357f('0x56')]})[_0x357f('0x26')](handleEntityNotFound(_0x1378a6,null))['then'](function(_0x39cfbe){if(_0x39cfbe){var _0x53de4e=require(_0x357f('0x57'))();_0x53de4e[_0x357f('0x58')](_0x39cfbe[_0x357f('0x56')]);_0x53de4e[_0x357f('0x59')]();return _0x39cfbe;}})[_0x357f('0x26')](respondWithResult(_0x1378a6,null))[_0x357f('0x48')](handleError(_0x1378a6,null));}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.model.js b/server/api/squareOdbc/squareOdbc.model.js index 1438395..8dfa135 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 _0x8986=['api','bluebird','request-promise','path','rimraf','../../config/environment','./squareOdbc.attributes','SquareOdbc','square_odbc','lodash','util'];(function(_0x20e6e6,_0x3eba42){var _0x31d889=function(_0x3f1a1f){while(--_0x3f1a1f){_0x20e6e6['push'](_0x20e6e6['shift']());}};_0x31d889(++_0x3eba42);}(_0x8986,0x1cc));var _0x6898=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x8986[_0x17d9e3];return _0x14192d;};'use strict';var _=require(_0x6898('0x0'));var util=require(_0x6898('0x1'));var logger=require('../../config/logger')(_0x6898('0x2'));var moment=require('moment');var BPromise=require(_0x6898('0x3'));var rp=require(_0x6898('0x4'));var fs=require('fs');var path=require(_0x6898('0x5'));var rimraf=require(_0x6898('0x6'));var config=require(_0x6898('0x7'));var attributes=require(_0x6898('0x8'));module['exports']=function(_0x1d9095,_0x4a4e23){return _0x1d9095['define'](_0x6898('0x9'),attributes,{'tableName':_0x6898('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x66b1=['square_odbc','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','define','SquareOdbc'];(function(_0x1c4ecd,_0x3d14af){var _0x45d750=function(_0x468767){while(--_0x468767){_0x1c4ecd['push'](_0x1c4ecd['shift']());}};_0x45d750(++_0x3d14af);}(_0x66b1,0xa6));var _0x166b=function(_0x21a413,_0xc15ba5){_0x21a413=_0x21a413-0x0;var _0x449b5d=_0x66b1[_0x21a413];return _0x449b5d;};'use strict';var _=require(_0x166b('0x0'));var util=require('util');var logger=require(_0x166b('0x1'))(_0x166b('0x2'));var moment=require(_0x166b('0x3'));var BPromise=require(_0x166b('0x4'));var rp=require(_0x166b('0x5'));var fs=require('fs');var path=require(_0x166b('0x6'));var rimraf=require(_0x166b('0x7'));var config=require('../../config/environment');var attributes=require('./squareOdbc.attributes');module['exports']=function(_0x125146,_0x53a78a){return _0x125146[_0x166b('0x8')](_0x166b('0x9'),attributes,{'tableName':_0x166b('0xa'),'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 670d6c0..4b7a948 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 _0x0f3b=['ShowSquareOdbc','SquareOdbc','find','options','raw','attributes','include','map','model','then','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','info','SquareOdbc,\x20%s,\x20%s','request\x20sent','SquareOdbc,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x4c4ad1,_0x568c37){var _0x573a86=function(_0x586b35){while(--_0x586b35){_0x4c4ad1['push'](_0x4c4ad1['shift']());}};_0x573a86(++_0x568c37);}(_0x0f3b,0x141));var _0xb0f3=function(_0x16c08c,_0x1c69ea){_0x16c08c=_0x16c08c-0x0;var _0x11a790=_0x0f3b[_0x16c08c];return _0x11a790;};'use strict';var _=require(_0xb0f3('0x0'));var util=require(_0xb0f3('0x1'));var moment=require('moment');var BPromise=require(_0xb0f3('0x2'));var rs=require(_0xb0f3('0x3'));var fs=require('fs');var Redis=require(_0xb0f3('0x4'));var db=require(_0xb0f3('0x5'))['db'];var utils=require(_0xb0f3('0x6'));var logger=require(_0xb0f3('0x7'))(_0xb0f3('0x8'));var config=require(_0xb0f3('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xb0f3('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x445d82,_0x423a7f,_0x2af653){return new BPromise(function(_0x32ac1f,_0x4ed37e){return client[_0xb0f3('0xb')](_0x445d82,_0x2af653)['then'](function(_0x62149e){logger[_0xb0f3('0xc')](_0xb0f3('0xd'),_0x423a7f,_0xb0f3('0xe'));logger['debug'](_0xb0f3('0xf'),_0x423a7f,_0xb0f3('0xe'),JSON[_0xb0f3('0x10')](_0x62149e));if(_0x62149e[_0xb0f3('0x11')]){if(_0x62149e[_0xb0f3('0x11')][_0xb0f3('0x12')]===0x1f4){logger[_0xb0f3('0x11')]('SquareOdbc,\x20%s,\x20%s',_0x423a7f,_0x62149e[_0xb0f3('0x11')][_0xb0f3('0x13')]);return _0x4ed37e(_0x62149e[_0xb0f3('0x11')][_0xb0f3('0x13')]);}logger[_0xb0f3('0x11')]('SquareOdbc,\x20%s,\x20%s',_0x423a7f,_0x62149e['error'][_0xb0f3('0x13')]);return _0x32ac1f(_0x62149e[_0xb0f3('0x11')][_0xb0f3('0x13')]);}else{logger['info'](_0xb0f3('0xd'),_0x423a7f,'request\x20sent');_0x32ac1f(_0x62149e['result'][_0xb0f3('0x13')]);}})['catch'](function(_0x1be399){logger[_0xb0f3('0x11')](_0xb0f3('0xd'),_0x423a7f,_0x1be399);_0x4ed37e(_0x1be399);});});}exports[_0xb0f3('0x14')]=function(_0x2f9543){var _0x559999=this;return new Promise(function(_0x1c4ce3,_0x57ccc6){return db[_0xb0f3('0x15')][_0xb0f3('0x16')]({'raw':_0x2f9543[_0xb0f3('0x17')]?_0x2f9543['options'][_0xb0f3('0x18')]===undefined?!![]:![]:!![],'where':_0x2f9543[_0xb0f3('0x17')]?_0x2f9543[_0xb0f3('0x17')]['where']||null:null,'attributes':_0x2f9543[_0xb0f3('0x17')]?_0x2f9543[_0xb0f3('0x17')][_0xb0f3('0x19')]||null:null,'include':_0x2f9543['options']?_0x2f9543[_0xb0f3('0x17')][_0xb0f3('0x1a')]?_[_0xb0f3('0x1b')](_0x2f9543['options'][_0xb0f3('0x1a')],function(_0x3c0612){return{'model':db[_0x3c0612['model']],'as':_0x3c0612['as'],'attributes':_0x3c0612[_0xb0f3('0x19')],'include':_0x3c0612[_0xb0f3('0x1a')]?_[_0xb0f3('0x1b')](_0x3c0612[_0xb0f3('0x1a')],function(_0x2616ae){return{'model':db[_0x2616ae[_0xb0f3('0x1c')]],'as':_0x2616ae['as'],'attributes':_0x2616ae[_0xb0f3('0x19')],'include':_0x2616ae[_0xb0f3('0x1a')]?_[_0xb0f3('0x1b')](_0x2616ae[_0xb0f3('0x1a')],function(_0x437710){return{'model':db[_0x437710[_0xb0f3('0x1c')]],'as':_0x437710['as'],'attributes':_0x437710[_0xb0f3('0x19')]};}):[]};}):[]};}):[]:[]})[_0xb0f3('0x1d')](function(_0x5ae14b){logger['info'](_0xb0f3('0x14'),_0x2f9543);logger['debug'](_0xb0f3('0x14'),_0x2f9543,JSON[_0xb0f3('0x10')](_0x5ae14b));_0x1c4ce3(_0x5ae14b);})[_0xb0f3('0x1e')](function(_0x447548){logger[_0xb0f3('0x11')](_0xb0f3('0x14'),_0x447548[_0xb0f3('0x13')],_0x2f9543);_0x57ccc6(_0x559999[_0xb0f3('0x11')](0x1f4,_0x447548[_0xb0f3('0x13')]));});});}; \ No newline at end of file +var _0x576b=['SquareOdbc','find','options','raw','where','attributes','include','map','model','then','debug','stringify','lodash','util','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','SquareOdbc,\x20%s,\x20%s','request\x20sent','SquareOdbc,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','ShowSquareOdbc'];(function(_0x3a6a1d,_0x535363){var _0xf4cb8b=function(_0x454792){while(--_0x454792){_0x3a6a1d['push'](_0x3a6a1d['shift']());}};_0xf4cb8b(++_0x535363);}(_0x576b,0x1ac));var _0xb576=function(_0x4500d5,_0x5999c0){_0x4500d5=_0x4500d5-0x0;var _0x4df167=_0x576b[_0x4500d5];return _0x4df167;};'use strict';var _=require(_0xb576('0x0'));var util=require(_0xb576('0x1'));var moment=require('moment');var BPromise=require(_0xb576('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb576('0x3'));var db=require(_0xb576('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xb576('0x5'))(_0xb576('0x6'));var config=require(_0xb576('0x7'));var jayson=require(_0xb576('0x8'));var client=jayson['client'][_0xb576('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x26f84c,_0x5775a2,_0xec6ffd){return new BPromise(function(_0x5a9a98,_0x82fdf5){return client['request'](_0x26f84c,_0xec6ffd)['then'](function(_0x277fc5){logger[_0xb576('0xa')](_0xb576('0xb'),_0x5775a2,_0xb576('0xc'));logger['debug'](_0xb576('0xd'),_0x5775a2,_0xb576('0xc'),JSON['stringify'](_0x277fc5));if(_0x277fc5['error']){if(_0x277fc5[_0xb576('0xe')][_0xb576('0xf')]===0x1f4){logger[_0xb576('0xe')]('SquareOdbc,\x20%s,\x20%s',_0x5775a2,_0x277fc5['error'][_0xb576('0x10')]);return _0x82fdf5(_0x277fc5[_0xb576('0xe')][_0xb576('0x10')]);}logger[_0xb576('0xe')](_0xb576('0xb'),_0x5775a2,_0x277fc5[_0xb576('0xe')]['message']);return _0x5a9a98(_0x277fc5[_0xb576('0xe')]['message']);}else{logger[_0xb576('0xa')]('SquareOdbc,\x20%s,\x20%s',_0x5775a2,_0xb576('0xc'));_0x5a9a98(_0x277fc5[_0xb576('0x11')][_0xb576('0x10')]);}})[_0xb576('0x12')](function(_0x46cba4){logger[_0xb576('0xe')](_0xb576('0xb'),_0x5775a2,_0x46cba4);_0x82fdf5(_0x46cba4);});});}exports[_0xb576('0x13')]=function(_0x54a633){var _0x1dbe31=this;return new Promise(function(_0x27acf5,_0x51e73c){return db[_0xb576('0x14')][_0xb576('0x15')]({'raw':_0x54a633[_0xb576('0x16')]?_0x54a633[_0xb576('0x16')][_0xb576('0x17')]===undefined?!![]:![]:!![],'where':_0x54a633[_0xb576('0x16')]?_0x54a633[_0xb576('0x16')][_0xb576('0x18')]||null:null,'attributes':_0x54a633[_0xb576('0x16')]?_0x54a633[_0xb576('0x16')][_0xb576('0x19')]||null:null,'include':_0x54a633['options']?_0x54a633[_0xb576('0x16')][_0xb576('0x1a')]?_[_0xb576('0x1b')](_0x54a633[_0xb576('0x16')][_0xb576('0x1a')],function(_0x34dc8d){return{'model':db[_0x34dc8d[_0xb576('0x1c')]],'as':_0x34dc8d['as'],'attributes':_0x34dc8d['attributes'],'include':_0x34dc8d[_0xb576('0x1a')]?_[_0xb576('0x1b')](_0x34dc8d[_0xb576('0x1a')],function(_0x2fb602){return{'model':db[_0x2fb602[_0xb576('0x1c')]],'as':_0x2fb602['as'],'attributes':_0x2fb602[_0xb576('0x19')],'include':_0x2fb602[_0xb576('0x1a')]?_[_0xb576('0x1b')](_0x2fb602['include'],function(_0x1cb6f8){return{'model':db[_0x1cb6f8[_0xb576('0x1c')]],'as':_0x1cb6f8['as'],'attributes':_0x1cb6f8[_0xb576('0x19')]};}):[]};}):[]};}):[]:[]})[_0xb576('0x1d')](function(_0x523146){logger[_0xb576('0xa')]('ShowSquareOdbc',_0x54a633);logger[_0xb576('0x1e')](_0xb576('0x13'),_0x54a633,JSON[_0xb576('0x1f')](_0x523146));_0x27acf5(_0x523146);})[_0xb576('0x12')](function(_0xaebbc4){logger[_0xb576('0xe')](_0xb576('0x13'),_0xaebbc4[_0xb576('0x10')],_0x54a633);_0x51e73c(_0x1dbe31[_0xb576('0xe')](0x1f4,_0xaebbc4[_0xb576('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/squareProject/index.js b/server/api/squareProject/index.js index c2be67e..8b0048d 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 _0x65da=['delete','removeUsers','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareProject.controller','index','get','/:id','isAuthenticated','show','/:id/users','getUsers','post','addUsers','update'];(function(_0x1786e0,_0x19dc8c){var _0x4a6229=function(_0x151bdd){while(--_0x151bdd){_0x1786e0['push'](_0x1786e0['shift']());}};_0x4a6229(++_0x19dc8c);}(_0x65da,0x152));var _0xa65d=function(_0x1573ea,_0x434f02){_0x1573ea=_0x1573ea-0x0;var _0x51c0e2=_0x65da[_0x1573ea];return _0x51c0e2;};'use strict';var multer=require(_0xa65d('0x0'));var util=require('util');var path=require(_0xa65d('0x1'));var timeout=require(_0xa65d('0x2'));var express=require(_0xa65d('0x3'));var router=express['Router']();var fs_extra=require(_0xa65d('0x4'));var auth=require(_0xa65d('0x5'));var interaction=require(_0xa65d('0x6'));var config=require(_0xa65d('0x7'));var controller=require(_0xa65d('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0xa65d('0x9')]);router[_0xa65d('0xa')](_0xa65d('0xb'),auth[_0xa65d('0xc')](),controller[_0xa65d('0xd')]);router[_0xa65d('0xa')](_0xa65d('0xe'),auth['isAuthenticated'](),controller[_0xa65d('0xf')]);router[_0xa65d('0x10')]('/',auth['isAuthenticated'](),controller['create']);router[_0xa65d('0x10')](_0xa65d('0xe'),auth[_0xa65d('0xc')](),controller[_0xa65d('0x11')]);router['put'](_0xa65d('0xb'),auth[_0xa65d('0xc')](),controller[_0xa65d('0x12')]);router[_0xa65d('0x13')](_0xa65d('0xb'),auth[_0xa65d('0xc')](),controller['destroy']);router[_0xa65d('0x13')](_0xa65d('0xe'),auth['isAuthenticated'](),controller[_0xa65d('0x14')]);module['exports']=router; \ No newline at end of file +var _0x363a=['get','/:id','show','/:id/users','getUsers','post','addUsers','delete','destroy','removeUsers','exports','util','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./squareProject.controller','isAuthenticated','index'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x363a,0x97));var _0xa363=function(_0x5bae64,_0x5062bd){_0x5bae64=_0x5bae64-0x0;var _0x45e8af=_0x363a[_0x5bae64];return _0x45e8af;};'use strict';var multer=require('multer');var util=require(_0xa363('0x0'));var path=require('path');var timeout=require(_0xa363('0x1'));var express=require('express');var router=express[_0xa363('0x2')]();var fs_extra=require(_0xa363('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xa363('0x4'));var config=require(_0xa363('0x5'));var controller=require(_0xa363('0x6'));router['get']('/',auth[_0xa363('0x7')](),controller[_0xa363('0x8')]);router[_0xa363('0x9')](_0xa363('0xa'),auth[_0xa363('0x7')](),controller[_0xa363('0xb')]);router[_0xa363('0x9')](_0xa363('0xc'),auth['isAuthenticated'](),controller[_0xa363('0xd')]);router[_0xa363('0xe')]('/',auth[_0xa363('0x7')](),controller['create']);router['post'](_0xa363('0xc'),auth['isAuthenticated'](),controller[_0xa363('0xf')]);router['put'](_0xa363('0xa'),auth[_0xa363('0x7')](),controller['update']);router[_0xa363('0x10')](_0xa363('0xa'),auth[_0xa363('0x7')](),controller[_0xa363('0x11')]);router[_0xa363('0x10')]('/:id/users',auth['isAuthenticated'](),controller[_0xa363('0x12')]);module[_0xa363('0x13')]=router; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.attributes.js b/server/api/squareProject/squareProject.attributes.js index 7872367..58effe3 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 _0x22b0=['DATE','exports','name','STRING','TEXT','BLOB','long','getDataValue','preproduction','toString','utf8','production'];(function(_0x11a220,_0x4e470a){var _0x20d8fe=function(_0xbedfd){while(--_0xbedfd){_0x11a220['push'](_0x11a220['shift']());}};_0x20d8fe(++_0x4e470a);}(_0x22b0,0xcd));var _0x022b=function(_0x107d0,_0x2c5573){_0x107d0=_0x107d0-0x0;var _0x5d3287=_0x22b0[_0x107d0];return _0x5d3287;};'use strict';var Sequelize=require('sequelize');module[_0x022b('0x0')]={'name':{'type':Sequelize['STRING'],'unique':_0x022b('0x1'),'allowNull':![]},'description':{'type':Sequelize[_0x022b('0x2')]},'notes':{'type':Sequelize[_0x022b('0x3')]},'preproduction':{'type':Sequelize[_0x022b('0x4')](_0x022b('0x5')),'get':function(){if(this[_0x022b('0x6')](_0x022b('0x7'))){return this['getDataValue']('preproduction')[_0x022b('0x8')](_0x022b('0x9'));}}},'production':{'type':Sequelize[_0x022b('0x4')](_0x022b('0x5')),'get':function(){if(this[_0x022b('0x6')](_0x022b('0xa'))){return this[_0x022b('0x6')](_0x022b('0xa'))[_0x022b('0x8')](_0x022b('0x9'));}}},'savedAt':{'type':Sequelize[_0x022b('0xb')]},'publishedAt':{'type':Sequelize[_0x022b('0xb')]}}; \ No newline at end of file +var _0x8aaa=['preproduction','getDataValue','toString','utf8','long','production','DATE','exports','STRING','name','TEXT','BLOB'];(function(_0x20abea,_0x48795e){var _0x1382f7=function(_0x355e90){while(--_0x355e90){_0x20abea['push'](_0x20abea['shift']());}};_0x1382f7(++_0x48795e);}(_0x8aaa,0x19f));var _0xa8aa=function(_0x3a9815,_0x47eb16){_0x3a9815=_0x3a9815-0x0;var _0x188653=_0x8aaa[_0x3a9815];return _0x188653;};'use strict';var Sequelize=require('sequelize');module[_0xa8aa('0x0')]={'name':{'type':Sequelize[_0xa8aa('0x1')],'unique':_0xa8aa('0x2'),'allowNull':![]},'description':{'type':Sequelize[_0xa8aa('0x1')]},'notes':{'type':Sequelize[_0xa8aa('0x3')]},'preproduction':{'type':Sequelize[_0xa8aa('0x4')]('long'),'get':function(){if(this['getDataValue'](_0xa8aa('0x5'))){return this[_0xa8aa('0x6')](_0xa8aa('0x5'))[_0xa8aa('0x7')](_0xa8aa('0x8'));}}},'production':{'type':Sequelize[_0xa8aa('0x4')](_0xa8aa('0x9')),'get':function(){if(this[_0xa8aa('0x6')](_0xa8aa('0xa'))){return this['getDataValue']('production')[_0xa8aa('0x7')](_0xa8aa('0x8'));}}},'savedAt':{'type':Sequelize[_0xa8aa('0xb')]},'publishedAt':{'type':Sequelize[_0xa8aa('0xb')]}}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.controller.js b/server/api/squareProject/squareProject.controller.js index 98d9ce2..b76fe59 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 _0xec13=['name','map','rawAttributes','fieldName','key','filters','model','query','attributes','intersection','fields','length','order','sort','pick','filter','where','type','VIRTUAL','merge','options','SquareProject','includeAll','rows','catch','show','params','keys','include','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addUsers','ids','omit','removeUsers','isArray','emit','userSquareProject:remove','findOne','User','hasOwnProperty','getUsers','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','./squareProject.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','reject','save','update','then','destroy','SquareProjects','error','stack'];(function(_0x157061,_0x215282){var _0x23688a=function(_0x1bc5ad){while(--_0x1bc5ad){_0x157061['push'](_0x157061['shift']());}};_0x23688a(++_0x215282);}(_0xec13,0xf7));var _0x3ec1=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0xec13[_0xbca1b1];return _0x4e1686;};'use strict';var emlformat=require(_0x3ec1('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x3ec1('0x1'));var jsonpatch=require(_0x3ec1('0x2'));var rp=require(_0x3ec1('0x3'));var moment=require(_0x3ec1('0x4'));var BPromise=require(_0x3ec1('0x5'));var Mustache=require(_0x3ec1('0x6'));var util=require(_0x3ec1('0x7'));var path=require(_0x3ec1('0x8'));var sox=require(_0x3ec1('0x9'));var csv=require('to-csv');var ejs=require(_0x3ec1('0xa'));var fs=require('fs');var fs_extra=require(_0x3ec1('0xb'));var _=require(_0x3ec1('0xc'));var squel=require(_0x3ec1('0xd'));var crypto=require(_0x3ec1('0xe'));var jsforce=require(_0x3ec1('0xf'));var deskjs=require(_0x3ec1('0x10'));var toCsv=require(_0x3ec1('0x11'));var querystring=require(_0x3ec1('0x12'));var Papa=require(_0x3ec1('0x13'));var Redis=require(_0x3ec1('0x14'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x3ec1('0x15'));var hardwareService=require(_0x3ec1('0x16'));var logger=require(_0x3ec1('0x17'))(_0x3ec1('0x18'));var utils=require(_0x3ec1('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0x3ec1('0x1a'));var db=require(_0x3ec1('0x1b'))['db'];config[_0x3ec1('0x1c')]=_[_0x3ec1('0x1d')](config[_0x3ec1('0x1c')],{'host':_0x3ec1('0x1e'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x3ec1('0x1c')]));require(_0x3ec1('0x1f'))[_0x3ec1('0x20')](socket);function respondWithStatusCode(_0x17b8bf,_0x54624c){_0x54624c=_0x54624c||0xcc;return function(_0x333273){if(_0x333273){return _0x17b8bf[_0x3ec1('0x21')](_0x54624c);}return _0x17b8bf[_0x3ec1('0x22')](_0x54624c)[_0x3ec1('0x23')]();};}function respondWithResult(_0x911888,_0x1af45e){_0x1af45e=_0x1af45e||0xc8;return function(_0x1982d0){if(_0x1982d0){return _0x911888[_0x3ec1('0x22')](_0x1af45e)[_0x3ec1('0x24')](_0x1982d0);}};}function respondWithFilteredResult(_0x44399e,_0x1dd9ff){return function(_0x85680f){if(_0x85680f){var _0x42d2e9=typeof _0x1dd9ff[_0x3ec1('0x25')]===_0x3ec1('0x26')&&typeof _0x1dd9ff[_0x3ec1('0x27')]===_0x3ec1('0x26');var _0x45e6a2=_0x85680f[_0x3ec1('0x28')];var _0x399aa3=_0x42d2e9?0x0:_0x1dd9ff['offset'];var _0x2b0546=_0x42d2e9?_0x85680f[_0x3ec1('0x28')]:_0x1dd9ff[_0x3ec1('0x25')]+_0x1dd9ff['limit'];var _0x5627a9;if(_0x2b0546>=_0x45e6a2){_0x2b0546=_0x45e6a2;_0x5627a9=0xc8;}else{_0x5627a9=0xce;}_0x44399e[_0x3ec1('0x22')](_0x5627a9);return _0x44399e['set'](_0x3ec1('0x29'),_0x399aa3+'-'+_0x2b0546+'/'+_0x45e6a2)[_0x3ec1('0x24')](_0x85680f);}return null;};}function patchUpdates(_0x275409){return function(_0x484555){try{jsonpatch['apply'](_0x484555,_0x275409,!![]);}catch(_0x3e896c){return BPromise[_0x3ec1('0x2a')](_0x3e896c);}return _0x484555[_0x3ec1('0x2b')]();};}function saveUpdates(_0x10319f,_0x21e854){return function(_0x4fbdac){if(_0x4fbdac){return _0x4fbdac[_0x3ec1('0x2c')](_0x10319f)[_0x3ec1('0x2d')](function(_0x45812d){return _0x45812d;});}return null;};}function removeEntity(_0x3ad7fe,_0x3f9be7){return function(_0x3e5b64){if(_0x3e5b64){return _0x3e5b64[_0x3ec1('0x2e')]()[_0x3ec1('0x2d')](function(){var _0x1e90f1=_0x3e5b64['get']({'plain':!![]});var _0xb47786=_0x3ec1('0x2f');return db['UserProfileResource'][_0x3ec1('0x2e')]({'where':{'type':_0xb47786,'resourceId':_0x1e90f1['id']}})[_0x3ec1('0x2d')](function(){return _0x3e5b64;});})[_0x3ec1('0x2d')](function(){_0x3ad7fe[_0x3ec1('0x22')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3e9c23,_0x13eeaa){return function(_0xf8190){if(!_0xf8190){_0x3e9c23[_0x3ec1('0x21')](0x194);}return _0xf8190;};}function handleError(_0x474f6e,_0x1185eb){_0x1185eb=_0x1185eb||0x1f4;return function(_0x2f5d6b){logger[_0x3ec1('0x30')](_0x2f5d6b[_0x3ec1('0x31')]);if(_0x2f5d6b[_0x3ec1('0x32')]){delete _0x2f5d6b[_0x3ec1('0x32')];}_0x474f6e[_0x3ec1('0x22')](_0x1185eb)['send'](_0x2f5d6b);};}exports['index']=function(_0x14fcb1,_0x4dc8ce){var _0x232b91={},_0x5bdb42={},_0x426360={'count':0x0,'rows':[]};var _0x212081=_[_0x3ec1('0x33')](db['SquareProject'][_0x3ec1('0x34')],function(_0x2d66f5){return{'name':_0x2d66f5[_0x3ec1('0x35')],'type':_0x2d66f5['type'][_0x3ec1('0x36')]};});_0x5bdb42['model']=_['map'](_0x212081,_0x3ec1('0x32'));_0x5bdb42['query']=_['keys'](_0x14fcb1['query']);_0x5bdb42[_0x3ec1('0x37')]=_['intersection'](_0x5bdb42[_0x3ec1('0x38')],_0x5bdb42[_0x3ec1('0x39')]);_0x232b91[_0x3ec1('0x3a')]=_[_0x3ec1('0x3b')](_0x5bdb42[_0x3ec1('0x38')],qs[_0x3ec1('0x3c')](_0x14fcb1['query'][_0x3ec1('0x3c')]));_0x232b91['attributes']=_0x232b91[_0x3ec1('0x3a')][_0x3ec1('0x3d')]?_0x232b91[_0x3ec1('0x3a')]:_0x5bdb42['model'];if(!_0x14fcb1[_0x3ec1('0x39')]['hasOwnProperty']('nolimit')){_0x232b91['limit']=qs[_0x3ec1('0x27')](_0x14fcb1['query'][_0x3ec1('0x27')]);_0x232b91[_0x3ec1('0x25')]=qs[_0x3ec1('0x25')](_0x14fcb1['query'][_0x3ec1('0x25')]);}_0x232b91[_0x3ec1('0x3e')]=qs[_0x3ec1('0x3f')](_0x14fcb1[_0x3ec1('0x39')][_0x3ec1('0x3f')]);_0x232b91['where']=qs[_0x3ec1('0x37')](_[_0x3ec1('0x40')](_0x14fcb1[_0x3ec1('0x39')],_0x5bdb42[_0x3ec1('0x37')]),_0x212081);if(_0x14fcb1[_0x3ec1('0x39')][_0x3ec1('0x41')]){_0x232b91[_0x3ec1('0x42')]=_['merge'](_0x232b91['where'],{'$or':_[_0x3ec1('0x33')](_0x212081,function(_0x46c4ee){if(_0x46c4ee[_0x3ec1('0x43')]!==_0x3ec1('0x44')){var _0x581f37={};_0x581f37[_0x46c4ee[_0x3ec1('0x32')]]={'$like':'%'+_0x14fcb1[_0x3ec1('0x39')][_0x3ec1('0x41')]+'%'};return _0x581f37;}})});}_0x232b91=_[_0x3ec1('0x45')]({},_0x232b91,_0x14fcb1[_0x3ec1('0x46')]);var _0x142781={'where':_0x232b91[_0x3ec1('0x42')]};return db[_0x3ec1('0x47')][_0x3ec1('0x28')](_0x142781)[_0x3ec1('0x2d')](function(_0x1b2389){_0x426360[_0x3ec1('0x28')]=_0x1b2389;if(_0x14fcb1[_0x3ec1('0x39')][_0x3ec1('0x48')]){_0x232b91['include']=[{'all':!![]}];}return db[_0x3ec1('0x47')]['findAll'](_0x232b91);})[_0x3ec1('0x2d')](function(_0x7e6933){_0x426360[_0x3ec1('0x49')]=_0x7e6933;return _0x426360;})[_0x3ec1('0x2d')](respondWithFilteredResult(_0x4dc8ce,_0x232b91))[_0x3ec1('0x4a')](handleError(_0x4dc8ce,null));};exports[_0x3ec1('0x4b')]=function(_0x2f237e,_0x56f170){var _0x4232ff={'raw':![],'where':{'id':_0x2f237e[_0x3ec1('0x4c')]['id']}},_0x5c4b3a={};_0x5c4b3a[_0x3ec1('0x38')]=_['keys'](db['SquareProject'][_0x3ec1('0x34')]);_0x5c4b3a[_0x3ec1('0x39')]=_[_0x3ec1('0x4d')](_0x2f237e[_0x3ec1('0x39')]);_0x5c4b3a[_0x3ec1('0x37')]=_[_0x3ec1('0x3b')](_0x5c4b3a['model'],_0x5c4b3a['query']);_0x4232ff['attributes']=_['intersection'](_0x5c4b3a['model'],qs[_0x3ec1('0x3c')](_0x2f237e[_0x3ec1('0x39')][_0x3ec1('0x3c')]));_0x4232ff[_0x3ec1('0x3a')]=_0x4232ff[_0x3ec1('0x3a')]['length']?_0x4232ff['attributes']:_0x5c4b3a[_0x3ec1('0x38')];if(_0x2f237e[_0x3ec1('0x39')]['includeAll']){_0x4232ff[_0x3ec1('0x4e')]=[{'all':!![]}];}_0x4232ff=_[_0x3ec1('0x45')]({},_0x4232ff,_0x2f237e['options']);return db[_0x3ec1('0x47')][_0x3ec1('0x4f')](_0x4232ff)[_0x3ec1('0x2d')](handleEntityNotFound(_0x56f170,null))['then'](respondWithResult(_0x56f170,null))['catch'](handleError(_0x56f170,null));};exports[_0x3ec1('0x50')]=function(_0x53d48e,_0x6da8d6){return db[_0x3ec1('0x47')][_0x3ec1('0x50')](_0x53d48e[_0x3ec1('0x51')],{})['then'](function(_0x12d06e){var _0x58c24a=_0x53d48e[_0x3ec1('0x52')][_0x3ec1('0x53')]({'plain':!![]});if(!_0x58c24a)throw new Error(_0x3ec1('0x54'));if(_0x58c24a[_0x3ec1('0x55')]===_0x3ec1('0x52')){var _0x3ec8e3=_0x12d06e[_0x3ec1('0x53')]({'plain':!![]});var _0x1e6bad='SquareProjects';return db['UserProfileSection']['find']({'where':{'name':_0x1e6bad,'userProfileId':_0x58c24a['userProfileId']},'raw':!![]})[_0x3ec1('0x2d')](function(_0xabb505){if(_0xabb505&&_0xabb505['autoAssociation']===0x0){return db[_0x3ec1('0x56')][_0x3ec1('0x50')]({'name':_0x3ec8e3[_0x3ec1('0x32')],'resourceId':_0x3ec8e3['id'],'type':_0xabb505['name'],'sectionId':_0xabb505['id']},{})[_0x3ec1('0x2d')](function(){return _0x12d06e;});}else{return _0x12d06e;}})[_0x3ec1('0x4a')](function(_0x595426){logger['error'](_0x3ec1('0x57'),_0x595426);throw _0x595426;});}return _0x12d06e;})['then'](respondWithResult(_0x6da8d6,0xc9))['catch'](handleError(_0x6da8d6,null));};exports[_0x3ec1('0x2c')]=function(_0x1f5cad,_0x522a89){if(_0x1f5cad[_0x3ec1('0x51')]['id']){delete _0x1f5cad[_0x3ec1('0x51')]['id'];}return db['SquareProject'][_0x3ec1('0x4f')]({'where':{'id':_0x1f5cad[_0x3ec1('0x4c')]['id']}})[_0x3ec1('0x2d')](handleEntityNotFound(_0x522a89,null))[_0x3ec1('0x2d')](saveUpdates(_0x1f5cad[_0x3ec1('0x51')],null))['then'](respondWithResult(_0x522a89,null))[_0x3ec1('0x4a')](handleError(_0x522a89,null));};exports['destroy']=function(_0x374824,_0x2795bb){return db['SquareProject'][_0x3ec1('0x4f')]({'where':{'id':_0x374824[_0x3ec1('0x4c')]['id']}})[_0x3ec1('0x2d')](handleEntityNotFound(_0x2795bb,null))[_0x3ec1('0x2d')](removeEntity(_0x2795bb,null))[_0x3ec1('0x4a')](handleError(_0x2795bb,null));};exports[_0x3ec1('0x58')]=function(_0x5883dd,_0xd6dfc0,_0x585711){return db['SquareProject'][_0x3ec1('0x4f')]({'where':{'id':_0x5883dd['params']['id']}})[_0x3ec1('0x2d')](handleEntityNotFound(_0xd6dfc0,null))[_0x3ec1('0x2d')](function(_0xcfcb87){if(_0xcfcb87){return _0xcfcb87[_0x3ec1('0x58')](_0x5883dd[_0x3ec1('0x51')][_0x3ec1('0x59')],_[_0x3ec1('0x5a')](_0x5883dd['body'],[_0x3ec1('0x59'),'id'])||{});}})[_0x3ec1('0x2d')](respondWithResult(_0xd6dfc0,null))[_0x3ec1('0x4a')](handleError(_0xd6dfc0,null));};exports[_0x3ec1('0x5b')]=function(_0x3855c6,_0x108133,_0x256fec){return db['SquareProject']['find']({'where':{'id':_0x3855c6[_0x3ec1('0x4c')]['id']}})['then'](handleEntityNotFound(_0x108133,null))['then'](function(_0x2b0ed7){if(_0x2b0ed7){return _0x2b0ed7[_0x3ec1('0x5b')](_0x3855c6['query'][_0x3ec1('0x59')])[_0x3ec1('0x2d')](function(){if(_[_0x3ec1('0x5c')](_0x3855c6[_0x3ec1('0x39')][_0x3ec1('0x59')])){for(var _0x5b2020=0x0;_0x5b2020<_0x3855c6[_0x3ec1('0x39')][_0x3ec1('0x59')][_0x3ec1('0x3d')];_0x5b2020+=0x1){socket[_0x3ec1('0x5d')]('userSquareProject:remove',{'UserId':Number(_0x3855c6[_0x3ec1('0x39')][_0x3ec1('0x59')][_0x5b2020]),'SquareProjectId':Number(_0x3855c6[_0x3ec1('0x4c')]['id'])});}}else{socket[_0x3ec1('0x5d')](_0x3ec1('0x5e'),{'UserId':Number(_0x3855c6[_0x3ec1('0x39')][_0x3ec1('0x59')]),'SquareProjectId':Number(_0x3855c6[_0x3ec1('0x4c')]['id'])});}});}})[_0x3ec1('0x2d')](respondWithStatusCode(_0x108133,null))[_0x3ec1('0x4a')](handleError(_0x108133,null));};exports['getUsers']=function(_0x59cc14,_0x3d4378,_0x35c219){var _0xe38f02={};var _0x36307a={};var _0x626a71;var _0x41b857;return db[_0x3ec1('0x47')][_0x3ec1('0x5f')]({'where':{'id':_0x59cc14['params']['id']}})[_0x3ec1('0x2d')](handleEntityNotFound(_0x3d4378,null))[_0x3ec1('0x2d')](function(_0x578371){if(_0x578371){_0x626a71=_0x578371;_0x36307a[_0x3ec1('0x38')]=_[_0x3ec1('0x4d')](db[_0x3ec1('0x60')][_0x3ec1('0x34')]);_0x36307a[_0x3ec1('0x39')]=_[_0x3ec1('0x4d')](_0x59cc14[_0x3ec1('0x39')]);_0x36307a['filters']=_[_0x3ec1('0x3b')](_0x36307a[_0x3ec1('0x38')],_0x36307a['query']);_0xe38f02[_0x3ec1('0x3a')]=_[_0x3ec1('0x3b')](_0x36307a[_0x3ec1('0x38')],qs[_0x3ec1('0x3c')](_0x59cc14[_0x3ec1('0x39')]['fields']));_0xe38f02[_0x3ec1('0x3a')]=_0xe38f02[_0x3ec1('0x3a')][_0x3ec1('0x3d')]?_0xe38f02[_0x3ec1('0x3a')]:_0x36307a[_0x3ec1('0x38')];_0xe38f02[_0x3ec1('0x3e')]=qs[_0x3ec1('0x3f')](_0x59cc14[_0x3ec1('0x39')][_0x3ec1('0x3f')]);_0xe38f02[_0x3ec1('0x42')]=qs['filters'](_[_0x3ec1('0x40')](_0x59cc14[_0x3ec1('0x39')],_0x36307a[_0x3ec1('0x37')]));if(_0x59cc14[_0x3ec1('0x39')]['filter']){_0xe38f02['where']=_[_0x3ec1('0x45')](_0xe38f02[_0x3ec1('0x42')],{'$or':_[_0x3ec1('0x33')](_0xe38f02[_0x3ec1('0x3a')],function(_0x3eed4c){var _0x280f77={};_0x280f77[_0x3eed4c]={'$like':'%'+_0x59cc14[_0x3ec1('0x39')]['filter']+'%'};return _0x280f77;})});}_0xe38f02=_[_0x3ec1('0x45')]({},_0xe38f02,_0x59cc14[_0x3ec1('0x46')]);return _0x626a71['getUsers'](_0xe38f02);}})[_0x3ec1('0x2d')](function(_0x26a626){if(_0x26a626){_0x41b857=_0x26a626[_0x3ec1('0x3d')];if(!_0x59cc14[_0x3ec1('0x39')][_0x3ec1('0x61')]('nolimit')){_0xe38f02[_0x3ec1('0x27')]=qs['limit'](_0x59cc14[_0x3ec1('0x39')]['limit']);_0xe38f02['offset']=qs[_0x3ec1('0x25')](_0x59cc14[_0x3ec1('0x39')]['offset']);}return _0x626a71[_0x3ec1('0x62')](_0xe38f02);}})[_0x3ec1('0x2d')](function(_0x56387a){if(_0x56387a){return _0x56387a?{'count':_0x41b857,'rows':_0x56387a}:null;}})['then'](respondWithResult(_0x3d4378,null))[_0x3ec1('0x4a')](handleError(_0x3d4378,null));}; \ No newline at end of file +var _0xaf01=['options','include','findAll','rows','catch','show','params','find','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','SquareProjects','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','addUsers','omit','ids','removeUsers','isArray','emit','userSquareProject:remove','getUsers','findOne','User','hasOwnProperty','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','redis','defaults','localhost','socket.io-emitter','./squareProject.socket','register','status','json','undefined','limit','offset','count','set','Content-Range','apply','save','then','destroy','end','sendStatus','error','stack','name','send','map','SquareProject','rawAttributes','type','key','query','keys','filters','intersection','model','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL'];(function(_0x427593,_0x2f4ac8){var _0x13ebab=function(_0x44440e){while(--_0x44440e){_0x427593['push'](_0x427593['shift']());}};_0x13ebab(++_0x2f4ac8);}(_0xaf01,0xea));var _0x1af0=function(_0x599f41,_0x4db732){_0x599f41=_0x599f41-0x0;var _0x2e4d58=_0xaf01[_0x599f41];return _0x2e4d58;};'use strict';var emlformat=require(_0x1af0('0x0'));var rimraf=require(_0x1af0('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x1af0('0x2'));var rp=require(_0x1af0('0x3'));var moment=require(_0x1af0('0x4'));var BPromise=require(_0x1af0('0x5'));var Mustache=require(_0x1af0('0x6'));var util=require(_0x1af0('0x7'));var path=require(_0x1af0('0x8'));var sox=require(_0x1af0('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1af0('0xa'));var _=require(_0x1af0('0xb'));var squel=require(_0x1af0('0xc'));var crypto=require('crypto');var jsforce=require(_0x1af0('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x1af0('0xe'));var querystring=require(_0x1af0('0xf'));var Papa=require(_0x1af0('0x10'));var Redis=require(_0x1af0('0x11'));var authService=require(_0x1af0('0x12'));var qs=require(_0x1af0('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1af0('0x14'));var logger=require(_0x1af0('0x15'))(_0x1af0('0x16'));var utils=require('../../config/utils');var config=require(_0x1af0('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0x1af0('0x18')]=_[_0x1af0('0x19')](config[_0x1af0('0x18')],{'host':_0x1af0('0x1a'),'port':0x18eb});var socket=require(_0x1af0('0x1b'))(new Redis(config[_0x1af0('0x18')]));require(_0x1af0('0x1c'))[_0x1af0('0x1d')](socket);function respondWithStatusCode(_0x215536,_0x18a96e){_0x18a96e=_0x18a96e||0xcc;return function(_0x3dfc83){if(_0x3dfc83){return _0x215536['sendStatus'](_0x18a96e);}return _0x215536[_0x1af0('0x1e')](_0x18a96e)['end']();};}function respondWithResult(_0x2f22c3,_0x4b132b){_0x4b132b=_0x4b132b||0xc8;return function(_0x5c3741){if(_0x5c3741){return _0x2f22c3[_0x1af0('0x1e')](_0x4b132b)[_0x1af0('0x1f')](_0x5c3741);}};}function respondWithFilteredResult(_0x49f33e,_0x48bcdc){return function(_0xe9e403){if(_0xe9e403){var _0x2889e3=typeof _0x48bcdc['offset']===_0x1af0('0x20')&&typeof _0x48bcdc[_0x1af0('0x21')]==='undefined';var _0x185595=_0xe9e403['count'];var _0x2bdee6=_0x2889e3?0x0:_0x48bcdc[_0x1af0('0x22')];var _0x20be8c=_0x2889e3?_0xe9e403[_0x1af0('0x23')]:_0x48bcdc['offset']+_0x48bcdc[_0x1af0('0x21')];var _0x1ef53f;if(_0x20be8c>=_0x185595){_0x20be8c=_0x185595;_0x1ef53f=0xc8;}else{_0x1ef53f=0xce;}_0x49f33e[_0x1af0('0x1e')](_0x1ef53f);return _0x49f33e[_0x1af0('0x24')](_0x1af0('0x25'),_0x2bdee6+'-'+_0x20be8c+'/'+_0x185595)[_0x1af0('0x1f')](_0xe9e403);}return null;};}function patchUpdates(_0x2f837){return function(_0x3d88f6){try{jsonpatch[_0x1af0('0x26')](_0x3d88f6,_0x2f837,!![]);}catch(_0x1a17de){return BPromise['reject'](_0x1a17de);}return _0x3d88f6[_0x1af0('0x27')]();};}function saveUpdates(_0x1b8851,_0x22f9c1){return function(_0x324974){if(_0x324974){return _0x324974['update'](_0x1b8851)[_0x1af0('0x28')](function(_0x18c4df){return _0x18c4df;});}return null;};}function removeEntity(_0x5e97ef,_0x5afa9b){return function(_0x2c4b04){if(_0x2c4b04){return _0x2c4b04[_0x1af0('0x29')]()['then'](function(){var _0x55d98a=_0x2c4b04['get']({'plain':!![]});var _0xa426d9='SquareProjects';return db['UserProfileResource'][_0x1af0('0x29')]({'where':{'type':_0xa426d9,'resourceId':_0x55d98a['id']}})['then'](function(){return _0x2c4b04;});})[_0x1af0('0x28')](function(){_0x5e97ef[_0x1af0('0x1e')](0xcc)[_0x1af0('0x2a')]();});}};}function handleEntityNotFound(_0xcb86be,_0x1083ca){return function(_0x59b990){if(!_0x59b990){_0xcb86be[_0x1af0('0x2b')](0x194);}return _0x59b990;};}function handleError(_0x273469,_0x10e4c7){_0x10e4c7=_0x10e4c7||0x1f4;return function(_0x455750){logger[_0x1af0('0x2c')](_0x455750[_0x1af0('0x2d')]);if(_0x455750[_0x1af0('0x2e')]){delete _0x455750[_0x1af0('0x2e')];}_0x273469[_0x1af0('0x1e')](_0x10e4c7)[_0x1af0('0x2f')](_0x455750);};}exports['index']=function(_0x4e55fb,_0x552bd8){var _0x478a40={},_0x51df89={},_0x4cb914={'count':0x0,'rows':[]};var _0x24676b=_[_0x1af0('0x30')](db[_0x1af0('0x31')][_0x1af0('0x32')],function(_0x22890a){return{'name':_0x22890a['fieldName'],'type':_0x22890a[_0x1af0('0x33')][_0x1af0('0x34')]};});_0x51df89['model']=_[_0x1af0('0x30')](_0x24676b,_0x1af0('0x2e'));_0x51df89[_0x1af0('0x35')]=_[_0x1af0('0x36')](_0x4e55fb[_0x1af0('0x35')]);_0x51df89[_0x1af0('0x37')]=_[_0x1af0('0x38')](_0x51df89[_0x1af0('0x39')],_0x51df89[_0x1af0('0x35')]);_0x478a40[_0x1af0('0x3a')]=_[_0x1af0('0x38')](_0x51df89[_0x1af0('0x39')],qs[_0x1af0('0x3b')](_0x4e55fb[_0x1af0('0x35')][_0x1af0('0x3b')]));_0x478a40[_0x1af0('0x3a')]=_0x478a40['attributes'][_0x1af0('0x3c')]?_0x478a40['attributes']:_0x51df89[_0x1af0('0x39')];if(!_0x4e55fb[_0x1af0('0x35')]['hasOwnProperty'](_0x1af0('0x3d'))){_0x478a40[_0x1af0('0x21')]=qs[_0x1af0('0x21')](_0x4e55fb[_0x1af0('0x35')][_0x1af0('0x21')]);_0x478a40[_0x1af0('0x22')]=qs[_0x1af0('0x22')](_0x4e55fb[_0x1af0('0x35')]['offset']);}_0x478a40[_0x1af0('0x3e')]=qs[_0x1af0('0x3f')](_0x4e55fb[_0x1af0('0x35')][_0x1af0('0x3f')]);_0x478a40[_0x1af0('0x40')]=qs[_0x1af0('0x37')](_[_0x1af0('0x41')](_0x4e55fb[_0x1af0('0x35')],_0x51df89[_0x1af0('0x37')]),_0x24676b);if(_0x4e55fb['query'][_0x1af0('0x42')]){_0x478a40['where']=_[_0x1af0('0x43')](_0x478a40[_0x1af0('0x40')],{'$or':_[_0x1af0('0x30')](_0x24676b,function(_0x2c710d){if(_0x2c710d[_0x1af0('0x33')]!==_0x1af0('0x44')){var _0x28ddc3={};_0x28ddc3[_0x2c710d[_0x1af0('0x2e')]]={'$like':'%'+_0x4e55fb[_0x1af0('0x35')]['filter']+'%'};return _0x28ddc3;}})});}_0x478a40=_[_0x1af0('0x43')]({},_0x478a40,_0x4e55fb[_0x1af0('0x45')]);var _0x184b5b={'where':_0x478a40[_0x1af0('0x40')]};return db[_0x1af0('0x31')][_0x1af0('0x23')](_0x184b5b)['then'](function(_0x12a5cb){_0x4cb914[_0x1af0('0x23')]=_0x12a5cb;if(_0x4e55fb[_0x1af0('0x35')]['includeAll']){_0x478a40[_0x1af0('0x46')]=[{'all':!![]}];}return db[_0x1af0('0x31')][_0x1af0('0x47')](_0x478a40);})[_0x1af0('0x28')](function(_0x19c69f){_0x4cb914[_0x1af0('0x48')]=_0x19c69f;return _0x4cb914;})[_0x1af0('0x28')](respondWithFilteredResult(_0x552bd8,_0x478a40))[_0x1af0('0x49')](handleError(_0x552bd8,null));};exports[_0x1af0('0x4a')]=function(_0x53ad20,_0xb0b174){var _0x1fac92={'raw':![],'where':{'id':_0x53ad20[_0x1af0('0x4b')]['id']}},_0x2020f8={};_0x2020f8[_0x1af0('0x39')]=_['keys'](db['SquareProject'][_0x1af0('0x32')]);_0x2020f8[_0x1af0('0x35')]=_['keys'](_0x53ad20[_0x1af0('0x35')]);_0x2020f8[_0x1af0('0x37')]=_['intersection'](_0x2020f8['model'],_0x2020f8[_0x1af0('0x35')]);_0x1fac92[_0x1af0('0x3a')]=_['intersection'](_0x2020f8[_0x1af0('0x39')],qs[_0x1af0('0x3b')](_0x53ad20[_0x1af0('0x35')][_0x1af0('0x3b')]));_0x1fac92[_0x1af0('0x3a')]=_0x1fac92['attributes'][_0x1af0('0x3c')]?_0x1fac92['attributes']:_0x2020f8['model'];if(_0x53ad20[_0x1af0('0x35')]['includeAll']){_0x1fac92[_0x1af0('0x46')]=[{'all':!![]}];}_0x1fac92=_[_0x1af0('0x43')]({},_0x1fac92,_0x53ad20['options']);return db[_0x1af0('0x31')][_0x1af0('0x4c')](_0x1fac92)[_0x1af0('0x28')](handleEntityNotFound(_0xb0b174,null))[_0x1af0('0x28')](respondWithResult(_0xb0b174,null))[_0x1af0('0x49')](handleError(_0xb0b174,null));};exports['create']=function(_0x5cc626,_0x124534){return db[_0x1af0('0x31')][_0x1af0('0x4d')](_0x5cc626[_0x1af0('0x4e')],{})[_0x1af0('0x28')](function(_0x3b6354){var _0xa54d8a=_0x5cc626['user'][_0x1af0('0x4f')]({'plain':!![]});if(!_0xa54d8a)throw new Error(_0x1af0('0x50'));if(_0xa54d8a[_0x1af0('0x51')]===_0x1af0('0x52')){var _0xa05aa0=_0x3b6354[_0x1af0('0x4f')]({'plain':!![]});var _0xe645c5=_0x1af0('0x53');return db[_0x1af0('0x54')][_0x1af0('0x4c')]({'where':{'name':_0xe645c5,'userProfileId':_0xa54d8a[_0x1af0('0x55')]},'raw':!![]})[_0x1af0('0x28')](function(_0x561465){if(_0x561465&&_0x561465[_0x1af0('0x56')]===0x0){return db[_0x1af0('0x57')][_0x1af0('0x4d')]({'name':_0xa05aa0[_0x1af0('0x2e')],'resourceId':_0xa05aa0['id'],'type':_0x561465[_0x1af0('0x2e')],'sectionId':_0x561465['id']},{})['then'](function(){return _0x3b6354;});}else{return _0x3b6354;}})[_0x1af0('0x49')](function(_0x5afefb){logger[_0x1af0('0x2c')](_0x1af0('0x58'),_0x5afefb);throw _0x5afefb;});}return _0x3b6354;})[_0x1af0('0x28')](respondWithResult(_0x124534,0xc9))['catch'](handleError(_0x124534,null));};exports[_0x1af0('0x59')]=function(_0xce6dcf,_0x3228ca){if(_0xce6dcf[_0x1af0('0x4e')]['id']){delete _0xce6dcf['body']['id'];}return db[_0x1af0('0x31')]['find']({'where':{'id':_0xce6dcf[_0x1af0('0x4b')]['id']}})[_0x1af0('0x28')](handleEntityNotFound(_0x3228ca,null))[_0x1af0('0x28')](saveUpdates(_0xce6dcf[_0x1af0('0x4e')],null))[_0x1af0('0x28')](respondWithResult(_0x3228ca,null))[_0x1af0('0x49')](handleError(_0x3228ca,null));};exports['destroy']=function(_0x26ccc0,_0x55e229){return db[_0x1af0('0x31')][_0x1af0('0x4c')]({'where':{'id':_0x26ccc0[_0x1af0('0x4b')]['id']}})[_0x1af0('0x28')](handleEntityNotFound(_0x55e229,null))[_0x1af0('0x28')](removeEntity(_0x55e229,null))['catch'](handleError(_0x55e229,null));};exports[_0x1af0('0x5a')]=function(_0x26edb9,_0x4cf38d,_0x218238){return db[_0x1af0('0x31')]['find']({'where':{'id':_0x26edb9[_0x1af0('0x4b')]['id']}})[_0x1af0('0x28')](handleEntityNotFound(_0x4cf38d,null))[_0x1af0('0x28')](function(_0x5ec543){if(_0x5ec543){return _0x5ec543[_0x1af0('0x5a')](_0x26edb9[_0x1af0('0x4e')]['ids'],_[_0x1af0('0x5b')](_0x26edb9['body'],[_0x1af0('0x5c'),'id'])||{});}})[_0x1af0('0x28')](respondWithResult(_0x4cf38d,null))[_0x1af0('0x49')](handleError(_0x4cf38d,null));};exports[_0x1af0('0x5d')]=function(_0x4f2c0a,_0x4e1a83,_0x41fac3){return db[_0x1af0('0x31')][_0x1af0('0x4c')]({'where':{'id':_0x4f2c0a[_0x1af0('0x4b')]['id']}})[_0x1af0('0x28')](handleEntityNotFound(_0x4e1a83,null))['then'](function(_0x8f2c76){if(_0x8f2c76){return _0x8f2c76[_0x1af0('0x5d')](_0x4f2c0a[_0x1af0('0x35')][_0x1af0('0x5c')])[_0x1af0('0x28')](function(){if(_[_0x1af0('0x5e')](_0x4f2c0a['query'][_0x1af0('0x5c')])){for(var _0x1aa207=0x0;_0x1aa207<_0x4f2c0a['query'][_0x1af0('0x5c')][_0x1af0('0x3c')];_0x1aa207+=0x1){socket[_0x1af0('0x5f')](_0x1af0('0x60'),{'UserId':Number(_0x4f2c0a[_0x1af0('0x35')][_0x1af0('0x5c')][_0x1aa207]),'SquareProjectId':Number(_0x4f2c0a[_0x1af0('0x4b')]['id'])});}}else{socket[_0x1af0('0x5f')](_0x1af0('0x60'),{'UserId':Number(_0x4f2c0a[_0x1af0('0x35')][_0x1af0('0x5c')]),'SquareProjectId':Number(_0x4f2c0a['params']['id'])});}});}})[_0x1af0('0x28')](respondWithStatusCode(_0x4e1a83,null))[_0x1af0('0x49')](handleError(_0x4e1a83,null));};exports[_0x1af0('0x61')]=function(_0x41baca,_0x366068,_0x3ac0e5){var _0x2c69e1={};var _0x513c7d={};var _0x4450cd;var _0x3b4c03;return db[_0x1af0('0x31')][_0x1af0('0x62')]({'where':{'id':_0x41baca[_0x1af0('0x4b')]['id']}})[_0x1af0('0x28')](handleEntityNotFound(_0x366068,null))[_0x1af0('0x28')](function(_0x3bef61){if(_0x3bef61){_0x4450cd=_0x3bef61;_0x513c7d[_0x1af0('0x39')]=_[_0x1af0('0x36')](db[_0x1af0('0x63')][_0x1af0('0x32')]);_0x513c7d['query']=_[_0x1af0('0x36')](_0x41baca['query']);_0x513c7d[_0x1af0('0x37')]=_[_0x1af0('0x38')](_0x513c7d[_0x1af0('0x39')],_0x513c7d[_0x1af0('0x35')]);_0x2c69e1[_0x1af0('0x3a')]=_['intersection'](_0x513c7d['model'],qs[_0x1af0('0x3b')](_0x41baca[_0x1af0('0x35')]['fields']));_0x2c69e1[_0x1af0('0x3a')]=_0x2c69e1['attributes'][_0x1af0('0x3c')]?_0x2c69e1[_0x1af0('0x3a')]:_0x513c7d['model'];_0x2c69e1[_0x1af0('0x3e')]=qs[_0x1af0('0x3f')](_0x41baca['query'][_0x1af0('0x3f')]);_0x2c69e1['where']=qs['filters'](_['pick'](_0x41baca[_0x1af0('0x35')],_0x513c7d[_0x1af0('0x37')]));if(_0x41baca[_0x1af0('0x35')]['filter']){_0x2c69e1[_0x1af0('0x40')]=_['merge'](_0x2c69e1[_0x1af0('0x40')],{'$or':_[_0x1af0('0x30')](_0x2c69e1[_0x1af0('0x3a')],function(_0x1be9e7){var _0x2d8ead={};_0x2d8ead[_0x1be9e7]={'$like':'%'+_0x41baca[_0x1af0('0x35')][_0x1af0('0x42')]+'%'};return _0x2d8ead;})});}_0x2c69e1=_[_0x1af0('0x43')]({},_0x2c69e1,_0x41baca[_0x1af0('0x45')]);return _0x4450cd[_0x1af0('0x61')](_0x2c69e1);}})['then'](function(_0xbb1c5){if(_0xbb1c5){_0x3b4c03=_0xbb1c5[_0x1af0('0x3c')];if(!_0x41baca[_0x1af0('0x35')][_0x1af0('0x64')](_0x1af0('0x3d'))){_0x2c69e1[_0x1af0('0x21')]=qs[_0x1af0('0x21')](_0x41baca[_0x1af0('0x35')][_0x1af0('0x21')]);_0x2c69e1[_0x1af0('0x22')]=qs['offset'](_0x41baca[_0x1af0('0x35')][_0x1af0('0x22')]);}return _0x4450cd[_0x1af0('0x61')](_0x2c69e1);}})[_0x1af0('0x28')](function(_0x1905cc){if(_0x1905cc){return _0x1905cc?{'count':_0x3b4c03,'rows':_0x1905cc}:null;}})[_0x1af0('0x28')](respondWithResult(_0x366068,null))[_0x1af0('0x49')](handleError(_0x366068,null));}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.events.js b/server/api/squareProject/squareProject.events.js index a1e3518..8ff37ad 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 _0xfe2c=['save','update','remove','emit','events','../../mysqldb','SquareProject','setMaxListeners'];(function(_0x2a6372,_0x38c990){var _0xd85be0=function(_0x2e93de){while(--_0x2e93de){_0x2a6372['push'](_0x2a6372['shift']());}};_0xd85be0(++_0x38c990);}(_0xfe2c,0x13c));var _0xcfe2=function(_0x14f5ae,_0x99f3b2){_0x14f5ae=_0x14f5ae-0x0;var _0x47710d=_0xfe2c[_0x14f5ae];return _0x47710d;};'use strict';var EventEmitter=require(_0xcfe2('0x0'));var SquareProject=require(_0xcfe2('0x1'))['db'][_0xcfe2('0x2')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0xcfe2('0x3')](0x0);var events={'afterCreate':_0xcfe2('0x4'),'afterUpdate':_0xcfe2('0x5'),'afterDestroy':_0xcfe2('0x6')};function emitEvent(_0x183f19){return function(_0x251735,_0x26a24c,_0x103ae7){SquareProjectEvents[_0xcfe2('0x7')](_0x183f19+':'+_0x251735['id'],_0x251735);SquareProjectEvents['emit'](_0x183f19,_0x251735);_0x103ae7(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SquareProject['hook'](e,emitEvent(event));}}module['exports']=SquareProjectEvents; \ No newline at end of file +var _0xea68=['setMaxListeners','update','emit','hook','exports','events','../../mysqldb'];(function(_0x4b87df,_0x10c403){var _0x3e3301=function(_0x3ffce2){while(--_0x3ffce2){_0x4b87df['push'](_0x4b87df['shift']());}};_0x3e3301(++_0x10c403);}(_0xea68,0x124));var _0x8ea6=function(_0x3ea187,_0x52504f){_0x3ea187=_0x3ea187-0x0;var _0x381119=_0xea68[_0x3ea187];return _0x381119;};'use strict';var EventEmitter=require(_0x8ea6('0x0'));var SquareProject=require(_0x8ea6('0x1'))['db']['SquareProject'];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0x8ea6('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x8ea6('0x3'),'afterDestroy':'remove'};function emitEvent(_0x34843b){return function(_0x7f0150,_0xb41453,_0xf684d7){SquareProjectEvents['emit'](_0x34843b+':'+_0x7f0150['id'],_0x7f0150);SquareProjectEvents[_0x8ea6('0x4')](_0x34843b,_0x7f0150);_0xf684d7(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SquareProject[_0x8ea6('0x5')](e,emitEvent(event));}}module[_0x8ea6('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 65f8139..6bb062d 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 _0x6e5e=['../../config/logger','api','moment','bluebird','request-promise','../../config/environment','./squareProject.attributes','exports','SquareProject','square_projects','changed','preproduction','savedAt','YYYY-MM-DD\x20HH:mm:ss','publishedAt','util'];(function(_0x56916d,_0x37b935){var _0x2b7f1f=function(_0x206eb1){while(--_0x206eb1){_0x56916d['push'](_0x56916d['shift']());}};_0x2b7f1f(++_0x37b935);}(_0x6e5e,0x13f));var _0xe6e5=function(_0x115372,_0x1912ac){_0x115372=_0x115372-0x0;var _0x3bfc82=_0x6e5e[_0x115372];return _0x3bfc82;};'use strict';var _=require('lodash');var util=require(_0xe6e5('0x0'));var logger=require(_0xe6e5('0x1'))(_0xe6e5('0x2'));var moment=require(_0xe6e5('0x3'));var BPromise=require(_0xe6e5('0x4'));var rp=require(_0xe6e5('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xe6e5('0x6'));var attributes=require(_0xe6e5('0x7'));module[_0xe6e5('0x8')]=function(_0x35a5d3,_0xee78a2){return _0x35a5d3['define'](_0xe6e5('0x9'),attributes,{'tableName':_0xe6e5('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x35f8f5,_0x5c8c0b,_0xc2bf53){if(_0x35f8f5[_0xe6e5('0xb')](_0xe6e5('0xc'))){_0x35f8f5[_0xe6e5('0xd')]=moment()['format'](_0xe6e5('0xe'));}if(_0x35f8f5['changed']('production')){_0x35f8f5[_0xe6e5('0xf')]=moment()['format'](_0xe6e5('0xe'));}_0xc2bf53(null,_0x35f8f5);}}});}; \ No newline at end of file +var _0xfa6e=['path','rimraf','./squareProject.attributes','exports','define','SquareProject','square_projects','changed','preproduction','savedAt','format','YYYY-MM-DD\x20HH:mm:ss','production','publishedAt','lodash','../../config/logger','api','moment','request-promise'];(function(_0x5d9867,_0x5e9030){var _0x7d2118=function(_0x2e5149){while(--_0x2e5149){_0x5d9867['push'](_0x5d9867['shift']());}};_0x7d2118(++_0x5e9030);}(_0xfa6e,0x12b));var _0xefa6=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xfa6e[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0xefa6('0x0'));var util=require('util');var logger=require(_0xefa6('0x1'))(_0xefa6('0x2'));var moment=require(_0xefa6('0x3'));var BPromise=require('bluebird');var rp=require(_0xefa6('0x4'));var fs=require('fs');var path=require(_0xefa6('0x5'));var rimraf=require(_0xefa6('0x6'));var config=require('../../config/environment');var attributes=require(_0xefa6('0x7'));module[_0xefa6('0x8')]=function(_0x1cca46,_0x3bff22){return _0x1cca46[_0xefa6('0x9')](_0xefa6('0xa'),attributes,{'tableName':_0xefa6('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x1e5404,_0x12a216,_0x414952){if(_0x1e5404[_0xefa6('0xc')](_0xefa6('0xd'))){_0x1e5404[_0xefa6('0xe')]=moment()[_0xefa6('0xf')](_0xefa6('0x10'));}if(_0x1e5404[_0xefa6('0xc')](_0xefa6('0x11'))){_0x1e5404[_0xefa6('0x12')]=moment()['format'](_0xefa6('0x10'));}_0x414952(null,_0x1e5404);}}});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.rpc.js b/server/api/squareProject/squareProject.rpc.js index 98dee23..88961d3 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 _0x1d01=['register','request','then','info','request\x20sent','SquareProject,\x20%s,\x20%s,\x20%s','error','code','SquareProject,\x20%s,\x20%s','message','result','catch','ShowSquareProject','SquareProject','find','options','raw','where','attributes','include','map','model','debug','stringify','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','defaults','localhost','socket.io-emitter','redis'];(function(_0x3eb885,_0x33f7b6){var _0x114ee4=function(_0x449a2c){while(--_0x449a2c){_0x3eb885['push'](_0x3eb885['shift']());}};_0x114ee4(++_0x33f7b6);}(_0x1d01,0x1e0));var _0x11d0=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x1d01[_0x2641f9];return _0x585741;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x11d0('0x0'));var BPromise=require('bluebird');var rs=require(_0x11d0('0x1'));var fs=require('fs');var Redis=require(_0x11d0('0x2'));var db=require(_0x11d0('0x3'))['db'];var utils=require(_0x11d0('0x4'));var logger=require(_0x11d0('0x5'))(_0x11d0('0x6'));var config=require(_0x11d0('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x11d0('0x8')][_0x11d0('0x9')]({'port':0x232a});config['redis']=_[_0x11d0('0xa')](config['redis'],{'host':_0x11d0('0xb'),'port':0x18eb});var socket=require(_0x11d0('0xc'))(new Redis(config[_0x11d0('0xd')]));require('./squareProject.socket')[_0x11d0('0xe')](socket);function respondWithRpcPromise(_0x33c080,_0x42ed97,_0x15310d){return new BPromise(function(_0x50d398,_0x2dcdc2){return client[_0x11d0('0xf')](_0x33c080,_0x15310d)[_0x11d0('0x10')](function(_0x44c457){logger[_0x11d0('0x11')]('SquareProject,\x20%s,\x20%s',_0x42ed97,_0x11d0('0x12'));logger['debug'](_0x11d0('0x13'),_0x42ed97,'request\x20sent',JSON['stringify'](_0x44c457));if(_0x44c457['error']){if(_0x44c457[_0x11d0('0x14')][_0x11d0('0x15')]===0x1f4){logger['error'](_0x11d0('0x16'),_0x42ed97,_0x44c457[_0x11d0('0x14')][_0x11d0('0x17')]);return _0x2dcdc2(_0x44c457[_0x11d0('0x14')][_0x11d0('0x17')]);}logger[_0x11d0('0x14')]('SquareProject,\x20%s,\x20%s',_0x42ed97,_0x44c457[_0x11d0('0x14')]['message']);return _0x50d398(_0x44c457[_0x11d0('0x14')]['message']);}else{logger[_0x11d0('0x11')](_0x11d0('0x16'),_0x42ed97,_0x11d0('0x12'));_0x50d398(_0x44c457[_0x11d0('0x18')]['message']);}})[_0x11d0('0x19')](function(_0x1d3f15){logger[_0x11d0('0x14')](_0x11d0('0x16'),_0x42ed97,_0x1d3f15);_0x2dcdc2(_0x1d3f15);});});}exports[_0x11d0('0x1a')]=function(_0xa57560){var _0x14746a=this;return new Promise(function(_0x462a90,_0x3fa606){return db[_0x11d0('0x1b')][_0x11d0('0x1c')]({'raw':_0xa57560['options']?_0xa57560[_0x11d0('0x1d')][_0x11d0('0x1e')]===undefined?!![]:![]:!![],'where':_0xa57560[_0x11d0('0x1d')]?_0xa57560[_0x11d0('0x1d')][_0x11d0('0x1f')]||null:null,'attributes':_0xa57560[_0x11d0('0x1d')]?_0xa57560[_0x11d0('0x1d')][_0x11d0('0x20')]||null:null,'include':_0xa57560[_0x11d0('0x1d')]?_0xa57560[_0x11d0('0x1d')][_0x11d0('0x21')]?_[_0x11d0('0x22')](_0xa57560[_0x11d0('0x1d')][_0x11d0('0x21')],function(_0x5bebcf){return{'model':db[_0x5bebcf[_0x11d0('0x23')]],'as':_0x5bebcf['as'],'attributes':_0x5bebcf[_0x11d0('0x20')],'include':_0x5bebcf[_0x11d0('0x21')]?_['map'](_0x5bebcf[_0x11d0('0x21')],function(_0xfa3772){return{'model':db[_0xfa3772['model']],'as':_0xfa3772['as'],'attributes':_0xfa3772[_0x11d0('0x20')],'include':_0xfa3772[_0x11d0('0x21')]?_[_0x11d0('0x22')](_0xfa3772[_0x11d0('0x21')],function(_0x1d25f1){return{'model':db[_0x1d25f1[_0x11d0('0x23')]],'as':_0x1d25f1['as'],'attributes':_0x1d25f1[_0x11d0('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x18432e){logger[_0x11d0('0x11')](_0x11d0('0x1a'),_0xa57560);logger[_0x11d0('0x24')](_0x11d0('0x1a'),_0xa57560,JSON[_0x11d0('0x25')](_0x18432e));_0x462a90(_0x18432e);})[_0x11d0('0x19')](function(_0x367c94){logger['error'](_0x11d0('0x1a'),_0x367c94[_0x11d0('0x17')],_0xa57560);_0x3fa606(_0x14746a[_0x11d0('0x14')](0x1f4,_0x367c94[_0x11d0('0x17')]));});});}; \ No newline at end of file +var _0x4752=['redis','./squareProject.socket','register','request','then','info','request\x20sent','debug','stringify','error','code','SquareProject,\x20%s,\x20%s','message','result','catch','ShowSquareProject','SquareProject','options','raw','where','attributes','include','map','model','util','moment','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','defaults','localhost','socket.io-emitter'];(function(_0x53176b,_0x3ca310){var _0x150749=function(_0x3886b0){while(--_0x3886b0){_0x53176b['push'](_0x53176b['shift']());}};_0x150749(++_0x3ca310);}(_0x4752,0x14a));var _0x2475=function(_0x4be736,_0x5a868d){_0x4be736=_0x4be736-0x0;var _0x3e7221=_0x4752[_0x4be736];return _0x3e7221;};'use strict';var _=require('lodash');var util=require(_0x2475('0x0'));var moment=require(_0x2475('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2475('0x2'))['db'];var utils=require(_0x2475('0x3'));var logger=require('../../config/logger')(_0x2475('0x4'));var config=require(_0x2475('0x5'));var jayson=require(_0x2475('0x6'));var client=jayson['client']['http']({'port':0x232a});config['redis']=_[_0x2475('0x7')](config['redis'],{'host':_0x2475('0x8'),'port':0x18eb});var socket=require(_0x2475('0x9'))(new Redis(config[_0x2475('0xa')]));require(_0x2475('0xb'))[_0x2475('0xc')](socket);function respondWithRpcPromise(_0x8c4d29,_0x4dc46a,_0x2bc19b){return new BPromise(function(_0x598641,_0xe2a4f7){return client[_0x2475('0xd')](_0x8c4d29,_0x2bc19b)[_0x2475('0xe')](function(_0x5987e7){logger[_0x2475('0xf')]('SquareProject,\x20%s,\x20%s',_0x4dc46a,_0x2475('0x10'));logger[_0x2475('0x11')]('SquareProject,\x20%s,\x20%s,\x20%s',_0x4dc46a,_0x2475('0x10'),JSON[_0x2475('0x12')](_0x5987e7));if(_0x5987e7['error']){if(_0x5987e7[_0x2475('0x13')][_0x2475('0x14')]===0x1f4){logger['error'](_0x2475('0x15'),_0x4dc46a,_0x5987e7['error'][_0x2475('0x16')]);return _0xe2a4f7(_0x5987e7[_0x2475('0x13')][_0x2475('0x16')]);}logger[_0x2475('0x13')](_0x2475('0x15'),_0x4dc46a,_0x5987e7[_0x2475('0x13')][_0x2475('0x16')]);return _0x598641(_0x5987e7[_0x2475('0x13')][_0x2475('0x16')]);}else{logger[_0x2475('0xf')](_0x2475('0x15'),_0x4dc46a,_0x2475('0x10'));_0x598641(_0x5987e7[_0x2475('0x17')]['message']);}})[_0x2475('0x18')](function(_0x203294){logger[_0x2475('0x13')](_0x2475('0x15'),_0x4dc46a,_0x203294);_0xe2a4f7(_0x203294);});});}exports[_0x2475('0x19')]=function(_0x2b4871){var _0x57c652=this;return new Promise(function(_0x8f78d3,_0x4f9ab3){return db[_0x2475('0x1a')]['find']({'raw':_0x2b4871[_0x2475('0x1b')]?_0x2b4871['options'][_0x2475('0x1c')]===undefined?!![]:![]:!![],'where':_0x2b4871[_0x2475('0x1b')]?_0x2b4871[_0x2475('0x1b')][_0x2475('0x1d')]||null:null,'attributes':_0x2b4871['options']?_0x2b4871[_0x2475('0x1b')][_0x2475('0x1e')]||null:null,'include':_0x2b4871[_0x2475('0x1b')]?_0x2b4871[_0x2475('0x1b')][_0x2475('0x1f')]?_[_0x2475('0x20')](_0x2b4871['options'][_0x2475('0x1f')],function(_0xc7c958){return{'model':db[_0xc7c958[_0x2475('0x21')]],'as':_0xc7c958['as'],'attributes':_0xc7c958['attributes'],'include':_0xc7c958[_0x2475('0x1f')]?_[_0x2475('0x20')](_0xc7c958[_0x2475('0x1f')],function(_0x4a1194){return{'model':db[_0x4a1194['model']],'as':_0x4a1194['as'],'attributes':_0x4a1194[_0x2475('0x1e')],'include':_0x4a1194['include']?_[_0x2475('0x20')](_0x4a1194[_0x2475('0x1f')],function(_0x419bc7){return{'model':db[_0x419bc7[_0x2475('0x21')]],'as':_0x419bc7['as'],'attributes':_0x419bc7[_0x2475('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x2475('0xe')](function(_0x3886e2){logger['info']('ShowSquareProject',_0x2b4871);logger['debug'](_0x2475('0x19'),_0x2b4871,JSON[_0x2475('0x12')](_0x3886e2));_0x8f78d3(_0x3886e2);})['catch'](function(_0x49399b){logger[_0x2475('0x13')](_0x2475('0x19'),_0x49399b['message'],_0x2b4871);_0x4f9ab3(_0x57c652[_0x2475('0x13')](0x1f4,_0x49399b['message']));});});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.socket.js b/server/api/squareProject/squareProject.socket.js index e4ac4e3..1a4bb94 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 _0x74d0=['./squareProject.events','save','remove','emit','removeListener','register','length','squareProject:'];(function(_0x157cc1,_0x34c6f6){var _0x37476a=function(_0x5ce0f5){while(--_0x5ce0f5){_0x157cc1['push'](_0x157cc1['shift']());}};_0x37476a(++_0x34c6f6);}(_0x74d0,0xd8));var _0x074d=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x74d0[_0x14add3];return _0x4a174f;};'use strict';var SquareProjectEvents=require(_0x074d('0x0'));var events=[_0x074d('0x1'),_0x074d('0x2'),'update'];function createListener(_0x4c1fa6,_0x53225e){return function(_0x467807){_0x53225e[_0x074d('0x3')](_0x4c1fa6,_0x467807);};}function removeListener(_0xae83c0,_0x7fba18){return function(){SquareProjectEvents[_0x074d('0x4')](_0xae83c0,_0x7fba18);};}exports[_0x074d('0x5')]=function(_0x3fe894){for(var _0x1fd9e7=0x0,_0x454d8c=events[_0x074d('0x6')];_0x1fd9e7<_0x454d8c;_0x1fd9e7++){var _0x39ba9f=events[_0x1fd9e7];var _0x5c7c22=createListener(_0x074d('0x7')+_0x39ba9f,_0x3fe894);SquareProjectEvents['on'](_0x39ba9f,_0x5c7c22);}}; \ No newline at end of file +var _0x826f=['length','squareProject:','./squareProject.events','remove','update','emit','removeListener'];(function(_0x4b784d,_0x5efb2f){var _0x2cdeaf=function(_0x106242){while(--_0x106242){_0x4b784d['push'](_0x4b784d['shift']());}};_0x2cdeaf(++_0x5efb2f);}(_0x826f,0x13d));var _0xf826=function(_0x18c301,_0x81cc9d){_0x18c301=_0x18c301-0x0;var _0x39135f=_0x826f[_0x18c301];return _0x39135f;};'use strict';var SquareProjectEvents=require(_0xf826('0x0'));var events=['save',_0xf826('0x1'),_0xf826('0x2')];function createListener(_0x1778c7,_0x32041d){return function(_0x36f999){_0x32041d[_0xf826('0x3')](_0x1778c7,_0x36f999);};}function removeListener(_0x198f1d,_0x5ef1e8){return function(){SquareProjectEvents[_0xf826('0x4')](_0x198f1d,_0x5ef1e8);};}exports['register']=function(_0x59e008){for(var _0x81b1ee=0x0,_0x1a5bca=events[_0xf826('0x5')];_0x81b1ee<_0x1a5bca;_0x81b1ee++){var _0x4e34aa=events[_0x81b1ee];var _0x3e17da=createListener(_0xf826('0x6')+_0x4e34aa,_0x59e008);SquareProjectEvents['on'](_0x4e34aa,_0x3e17da);}}; \ No newline at end of file diff --git a/server/api/squareRecording/index.js b/server/api/squareRecording/index.js index 762106f..9de17ba 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 _0x0295=['isAuthenticated','index','post','create','put','/:id','update','delete','destroy','exports','multer','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareRecording.controller','get'];(function(_0x819464,_0x46fc91){var _0x49dcc0=function(_0x36b2b2){while(--_0x36b2b2){_0x819464['push'](_0x819464['shift']());}};_0x49dcc0(++_0x46fc91);}(_0x0295,0x1f0));var _0x5029=function(_0x2b8ef1,_0x28380f){_0x2b8ef1=_0x2b8ef1-0x0;var _0x262f55=_0x0295[_0x2b8ef1];return _0x262f55;};'use strict';var multer=require(_0x5029('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x5029('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x5029('0x2'));var auth=require(_0x5029('0x3'));var interaction=require(_0x5029('0x4'));var config=require(_0x5029('0x5'));var controller=require(_0x5029('0x6'));router[_0x5029('0x7')]('/',auth[_0x5029('0x8')](),controller[_0x5029('0x9')]);router[_0x5029('0x7')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x5029('0x7')]('/:id/download',auth[_0x5029('0x8')](),controller['download']);router[_0x5029('0xa')]('/',auth['isAuthenticated'](),controller[_0x5029('0xb')]);router[_0x5029('0xc')](_0x5029('0xd'),auth['isAuthenticated'](),controller[_0x5029('0xe')]);router[_0x5029('0xf')](_0x5029('0xd'),auth['isAuthenticated'](),controller[_0x5029('0x10')]);module[_0x5029('0x11')]=router; \ No newline at end of file +var _0x7fbe=['/:id','show','/:id/download','create','put','update','delete','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareRecording.controller','get','isAuthenticated','index'];(function(_0x337ccd,_0x3d0edc){var _0x19bc69=function(_0x45cb01){while(--_0x45cb01){_0x337ccd['push'](_0x337ccd['shift']());}};_0x19bc69(++_0x3d0edc);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0x160425,_0x2983aa){_0x160425=_0x160425-0x0;var _0x455b67=_0x7fbe[_0x160425];return _0x455b67;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xe7fb('0x0'));var timeout=require(_0xe7fb('0x1'));var express=require(_0xe7fb('0x2'));var router=express[_0xe7fb('0x3')]();var fs_extra=require(_0xe7fb('0x4'));var auth=require(_0xe7fb('0x5'));var interaction=require(_0xe7fb('0x6'));var config=require(_0xe7fb('0x7'));var controller=require(_0xe7fb('0x8'));router[_0xe7fb('0x9')]('/',auth[_0xe7fb('0xa')](),controller[_0xe7fb('0xb')]);router[_0xe7fb('0x9')](_0xe7fb('0xc'),auth['isAuthenticated'](),controller[_0xe7fb('0xd')]);router[_0xe7fb('0x9')](_0xe7fb('0xe'),auth[_0xe7fb('0xa')](),controller['download']);router['post']('/',auth[_0xe7fb('0xa')](),controller[_0xe7fb('0xf')]);router[_0xe7fb('0x10')](_0xe7fb('0xc'),auth[_0xe7fb('0xa')](),controller[_0xe7fb('0x11')]);router[_0xe7fb('0x12')](_0xe7fb('0xc'),auth[_0xe7fb('0xa')](),controller[_0xe7fb('0x13')]);module[_0xe7fb('0x14')]=router; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.attributes.js b/server/api/squareRecording/squareRecording.attributes.js index 6aa3ddd..9438188 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 _0x2eb2=['substring','lastIndexOf','exports','STRING','VIRTUAL','getDataValue','savePath'];(function(_0xaa0309,_0x1c8008){var _0x5de7ce=function(_0x3aa6ae){while(--_0x3aa6ae){_0xaa0309['push'](_0xaa0309['shift']());}};_0x5de7ce(++_0x1c8008);}(_0x2eb2,0x19f));var _0x22eb=function(_0x1e7b16,_0x4607a1){_0x1e7b16=_0x1e7b16-0x0;var _0x37fadc=_0x2eb2[_0x1e7b16];return _0x37fadc;};'use strict';var Sequelize=require('sequelize');module[_0x22eb('0x0')]={'uniqueid':{'type':Sequelize[_0x22eb('0x1')]},'callerid':{'type':Sequelize[_0x22eb('0x1')]},'calleridname':{'type':Sequelize[_0x22eb('0x1')]},'context':{'type':Sequelize[_0x22eb('0x1')]},'extension':{'type':Sequelize[_0x22eb('0x1')]},'priority':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x22eb('0x1')]},'dnid':{'type':Sequelize['STRING']},'projectName':{'type':Sequelize['STRING']},'saveName':{'type':Sequelize[_0x22eb('0x1')]},'filename':{'type':Sequelize[_0x22eb('0x1')]},'savePath':{'type':Sequelize[_0x22eb('0x1')]},'format':{'type':Sequelize[_0x22eb('0x2')],'get':function(){var _0x4539d0='';var _0x396806=this[_0x22eb('0x3')](_0x22eb('0x4'));if(_0x396806){_0x4539d0=_0x396806[_0x22eb('0x5')](_0x396806[_0x22eb('0x6')]('.'));}return _0x4539d0;}}}; \ No newline at end of file +var _0x7fbe=['STRING','VIRTUAL','getDataValue','savePath','substring','lastIndexOf'];(function(_0x3c0a9e,_0x30686d){var _0x1b60c5=function(_0x3e72d6){while(--_0x3e72d6){_0x3c0a9e['push'](_0x3c0a9e['shift']());}};_0x1b60c5(++_0x30686d);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0x13e1d9,_0x479e22){_0x13e1d9=_0x13e1d9-0x0;var _0x5e3c69=_0x7fbe[_0x13e1d9];return _0x5e3c69;};'use strict';var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize[_0xe7fb('0x0')]},'callerid':{'type':Sequelize[_0xe7fb('0x0')]},'calleridname':{'type':Sequelize[_0xe7fb('0x0')]},'context':{'type':Sequelize[_0xe7fb('0x0')]},'extension':{'type':Sequelize[_0xe7fb('0x0')]},'priority':{'type':Sequelize[_0xe7fb('0x0')]},'accountcode':{'type':Sequelize[_0xe7fb('0x0')]},'dnid':{'type':Sequelize[_0xe7fb('0x0')]},'projectName':{'type':Sequelize[_0xe7fb('0x0')]},'saveName':{'type':Sequelize[_0xe7fb('0x0')]},'filename':{'type':Sequelize[_0xe7fb('0x0')]},'savePath':{'type':Sequelize[_0xe7fb('0x0')]},'format':{'type':Sequelize[_0xe7fb('0x1')],'get':function(){var _0x1f943f='';var _0x5ad75b=this[_0xe7fb('0x2')](_0xe7fb('0x3'));if(_0x5ad75b){_0x1f943f=_0x5ad75b[_0xe7fb('0x4')](_0x5ad75b[_0xe7fb('0x5')]('.'));}return _0x1f943f;}}}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.controller.js b/server/api/squareRecording/squareRecording.controller.js index ac4d943..8b04ce8 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 _0xee94=['name','send','index','map','SquareRecording','rawAttributes','fieldName','key','model','keys','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','catch','show','params','length','find','create','body','uniqueid','filename','savePath','format','%s.cypher','existsSync','decryptFile','recording','Sequelize','ValidationError','extname','unlink','download','message','Not\x20found','Entity\x20not\x20found','info','isNil','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack'];(function(_0x128a73,_0x26c676){var _0x210caa=function(_0x47ac0f){while(--_0x47ac0f){_0x128a73['push'](_0x128a73['shift']());}};_0x210caa(++_0x26c676);}(_0xee94,0x1ce));var _0x4ee9=function(_0x6a0eaa,_0x5ab7cc){_0x6a0eaa=_0x6a0eaa-0x0;var _0x475908=_0xee94[_0x6a0eaa];return _0x475908;};'use strict';var emlformat=require(_0x4ee9('0x0'));var rimraf=require(_0x4ee9('0x1'));var zipdir=require(_0x4ee9('0x2'));var jsonpatch=require(_0x4ee9('0x3'));var rp=require('request-promise');var moment=require(_0x4ee9('0x4'));var BPromise=require(_0x4ee9('0x5'));var Mustache=require(_0x4ee9('0x6'));var util=require(_0x4ee9('0x7'));var path=require(_0x4ee9('0x8'));var sox=require('sox');var csv=require(_0x4ee9('0x9'));var ejs=require(_0x4ee9('0xa'));var fs=require('fs');var fs_extra=require(_0x4ee9('0xb'));var _=require(_0x4ee9('0xc'));var squel=require(_0x4ee9('0xd'));var crypto=require(_0x4ee9('0xe'));var jsforce=require(_0x4ee9('0xf'));var deskjs=require(_0x4ee9('0x10'));var toCsv=require(_0x4ee9('0x9'));var querystring=require('querystring');var Papa=require(_0x4ee9('0x11'));var Redis=require('ioredis');var authService=require(_0x4ee9('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x4ee9('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x4ee9('0x14'))('api');var utils=require(_0x4ee9('0x15'));var config=require(_0x4ee9('0x16'));var licenseUtil=require(_0x4ee9('0x17'));var db=require(_0x4ee9('0x18'))['db'];function respondWithStatusCode(_0x5b508b,_0x4f52e3){_0x4f52e3=_0x4f52e3||0xcc;return function(_0x56d0f9){if(_0x56d0f9){return _0x5b508b[_0x4ee9('0x19')](_0x4f52e3);}return _0x5b508b[_0x4ee9('0x1a')](_0x4f52e3)[_0x4ee9('0x1b')]();};}function respondWithResult(_0x582f65,_0x12a50f){_0x12a50f=_0x12a50f||0xc8;return function(_0x11e39a){if(_0x11e39a){return _0x582f65[_0x4ee9('0x1a')](_0x12a50f)[_0x4ee9('0x1c')](_0x11e39a);}};}function respondWithFilteredResult(_0xfe7c55,_0x4c8f8f){return function(_0x2bce9e){if(_0x2bce9e){var _0x1f4d08=typeof _0x4c8f8f[_0x4ee9('0x1d')]===_0x4ee9('0x1e')&&typeof _0x4c8f8f[_0x4ee9('0x1f')]===_0x4ee9('0x1e');var _0x5e5b00=_0x2bce9e[_0x4ee9('0x20')];var _0x1c7076=_0x1f4d08?0x0:_0x4c8f8f['offset'];var _0x2e665c=_0x1f4d08?_0x2bce9e[_0x4ee9('0x20')]:_0x4c8f8f[_0x4ee9('0x1d')]+_0x4c8f8f[_0x4ee9('0x1f')];var _0x3b9d9b;if(_0x2e665c>=_0x5e5b00){_0x2e665c=_0x5e5b00;_0x3b9d9b=0xc8;}else{_0x3b9d9b=0xce;}_0xfe7c55[_0x4ee9('0x1a')](_0x3b9d9b);return _0xfe7c55[_0x4ee9('0x21')](_0x4ee9('0x22'),_0x1c7076+'-'+_0x2e665c+'/'+_0x5e5b00)[_0x4ee9('0x1c')](_0x2bce9e);}return null;};}function patchUpdates(_0x45426b){return function(_0x4afe9b){try{jsonpatch[_0x4ee9('0x23')](_0x4afe9b,_0x45426b,!![]);}catch(_0x3ccb42){return BPromise[_0x4ee9('0x24')](_0x3ccb42);}return _0x4afe9b[_0x4ee9('0x25')]();};}function saveUpdates(_0x864013,_0x40cd30){return function(_0x934bb8){if(_0x934bb8){return _0x934bb8[_0x4ee9('0x26')](_0x864013)[_0x4ee9('0x27')](function(_0x1af5dc){return _0x1af5dc;});}return null;};}function removeEntity(_0xbd1bee,_0x2c408e){return function(_0x3b273f){if(_0x3b273f){return _0x3b273f[_0x4ee9('0x28')]()[_0x4ee9('0x27')](function(){_0xbd1bee['status'](0xcc)[_0x4ee9('0x1b')]();});}};}function handleEntityNotFound(_0x45419e,_0x5c117d){return function(_0x425246){if(!_0x425246){_0x45419e['sendStatus'](0x194);}return _0x425246;};}function handleError(_0x189f1f,_0x7f1b2b){_0x7f1b2b=_0x7f1b2b||0x1f4;return function(_0x1dea03){logger[_0x4ee9('0x29')](_0x1dea03[_0x4ee9('0x2a')]);if(_0x1dea03[_0x4ee9('0x2b')]){delete _0x1dea03[_0x4ee9('0x2b')];}_0x189f1f['status'](_0x7f1b2b)[_0x4ee9('0x2c')](_0x1dea03);};}exports[_0x4ee9('0x2d')]=function(_0x77bab7,_0x1fc451){var _0x3c9b5c={},_0x999f21={},_0x3d3e9d={'count':0x0,'rows':[]};var _0x1b2d0d=_[_0x4ee9('0x2e')](db[_0x4ee9('0x2f')][_0x4ee9('0x30')],function(_0x55aced){return{'name':_0x55aced[_0x4ee9('0x31')],'type':_0x55aced['type'][_0x4ee9('0x32')]};});_0x999f21[_0x4ee9('0x33')]=_[_0x4ee9('0x2e')](_0x1b2d0d,_0x4ee9('0x2b'));_0x999f21['query']=_[_0x4ee9('0x34')](_0x77bab7[_0x4ee9('0x35')]);_0x999f21[_0x4ee9('0x36')]=_['intersection'](_0x999f21[_0x4ee9('0x33')],_0x999f21[_0x4ee9('0x35')]);_0x3c9b5c['attributes']=_[_0x4ee9('0x37')](_0x999f21[_0x4ee9('0x33')],qs['fields'](_0x77bab7[_0x4ee9('0x35')][_0x4ee9('0x38')]));_0x3c9b5c['attributes']=_0x3c9b5c[_0x4ee9('0x39')]['length']?_0x3c9b5c[_0x4ee9('0x39')]:_0x999f21['model'];if(!_0x77bab7[_0x4ee9('0x35')][_0x4ee9('0x3a')](_0x4ee9('0x3b'))){_0x3c9b5c[_0x4ee9('0x1f')]=qs['limit'](_0x77bab7[_0x4ee9('0x35')][_0x4ee9('0x1f')]);_0x3c9b5c[_0x4ee9('0x1d')]=qs['offset'](_0x77bab7[_0x4ee9('0x35')][_0x4ee9('0x1d')]);}_0x3c9b5c[_0x4ee9('0x3c')]=qs[_0x4ee9('0x3d')](_0x77bab7[_0x4ee9('0x35')][_0x4ee9('0x3d')]);_0x3c9b5c[_0x4ee9('0x3e')]=qs[_0x4ee9('0x36')](_[_0x4ee9('0x3f')](_0x77bab7[_0x4ee9('0x35')],_0x999f21['filters']),_0x1b2d0d);if(_0x77bab7[_0x4ee9('0x35')][_0x4ee9('0x40')]){_0x3c9b5c[_0x4ee9('0x3e')]=_[_0x4ee9('0x41')](_0x3c9b5c[_0x4ee9('0x3e')],{'$or':_[_0x4ee9('0x2e')](_0x1b2d0d,function(_0x48adac){if(_0x48adac[_0x4ee9('0x42')]!==_0x4ee9('0x43')){var _0x5b26e8={};_0x5b26e8[_0x48adac[_0x4ee9('0x2b')]]={'$like':'%'+_0x77bab7[_0x4ee9('0x35')][_0x4ee9('0x40')]+'%'};return _0x5b26e8;}})});}_0x3c9b5c=_[_0x4ee9('0x41')]({},_0x3c9b5c,_0x77bab7[_0x4ee9('0x44')]);var _0xf580c3={'where':_0x3c9b5c[_0x4ee9('0x3e')]};return db[_0x4ee9('0x2f')]['count'](_0xf580c3)[_0x4ee9('0x27')](function(_0x14d20f){_0x3d3e9d[_0x4ee9('0x20')]=_0x14d20f;if(_0x77bab7['query'][_0x4ee9('0x45')]){_0x3c9b5c[_0x4ee9('0x46')]=[{'all':!![]}];}return db['SquareRecording'][_0x4ee9('0x47')](_0x3c9b5c);})[_0x4ee9('0x27')](function(_0x1ff15f){_0x3d3e9d['rows']=_0x1ff15f;return _0x3d3e9d;})[_0x4ee9('0x27')](respondWithFilteredResult(_0x1fc451,_0x3c9b5c))[_0x4ee9('0x48')](handleError(_0x1fc451,null));};exports[_0x4ee9('0x49')]=function(_0x1dbab0,_0x27853b){var _0x56f350={'raw':!![],'where':{'id':_0x1dbab0[_0x4ee9('0x4a')]['id']}},_0x10287c={};_0x10287c['model']=_[_0x4ee9('0x34')](db[_0x4ee9('0x2f')][_0x4ee9('0x30')]);_0x10287c[_0x4ee9('0x35')]=_[_0x4ee9('0x34')](_0x1dbab0[_0x4ee9('0x35')]);_0x10287c[_0x4ee9('0x36')]=_['intersection'](_0x10287c[_0x4ee9('0x33')],_0x10287c[_0x4ee9('0x35')]);_0x56f350[_0x4ee9('0x39')]=_[_0x4ee9('0x37')](_0x10287c[_0x4ee9('0x33')],qs[_0x4ee9('0x38')](_0x1dbab0['query']['fields']));_0x56f350[_0x4ee9('0x39')]=_0x56f350[_0x4ee9('0x39')][_0x4ee9('0x4b')]?_0x56f350[_0x4ee9('0x39')]:_0x10287c[_0x4ee9('0x33')];if(_0x1dbab0[_0x4ee9('0x35')][_0x4ee9('0x45')]){_0x56f350[_0x4ee9('0x46')]=[{'all':!![]}];}_0x56f350=_[_0x4ee9('0x41')]({},_0x56f350,_0x1dbab0['options']);return db[_0x4ee9('0x2f')][_0x4ee9('0x4c')](_0x56f350)['then'](handleEntityNotFound(_0x27853b,null))['then'](respondWithResult(_0x27853b,null))[_0x4ee9('0x48')](handleError(_0x27853b,null));};exports[_0x4ee9('0x4d')]=function(_0x5d6d6e,_0x1e2be3){return db[_0x4ee9('0x2f')][_0x4ee9('0x4d')](_0x5d6d6e[_0x4ee9('0x4e')],{})[_0x4ee9('0x27')](respondWithResult(_0x1e2be3,0xc9))[_0x4ee9('0x48')](handleError(_0x1e2be3,null));};exports[_0x4ee9('0x26')]=function(_0x3af7e9,_0x11ad69){if(_0x3af7e9[_0x4ee9('0x4e')]['id']){delete _0x3af7e9[_0x4ee9('0x4e')]['id'];}return db[_0x4ee9('0x2f')][_0x4ee9('0x4c')]({'where':{'id':_0x3af7e9[_0x4ee9('0x4a')]['id']}})[_0x4ee9('0x27')](handleEntityNotFound(_0x11ad69,null))['then'](saveUpdates(_0x3af7e9[_0x4ee9('0x4e')],null))[_0x4ee9('0x27')](respondWithResult(_0x11ad69,null))[_0x4ee9('0x48')](handleError(_0x11ad69,null));};exports['download']=function(_0x11d695,_0x5f0bd1,_0x2ede07){var _0x34dc61=require('../../components/encryptor');var _0x27ba88=![];var _0x36e732={};if(_0x11d695[_0x4ee9('0x35')]['type']&&_0x11d695[_0x4ee9('0x35')][_0x4ee9('0x42')]===_0x4ee9('0x4f')){_0x36e732[_0x4ee9('0x4f')]=_0x11d695[_0x4ee9('0x4a')]['id'];}else{_0x36e732['id']=_0x11d695[_0x4ee9('0x4a')]['id'];}return db[_0x4ee9('0x2f')][_0x4ee9('0x4c')]({'where':_0x36e732,'attributes':['id','savePath',_0x4ee9('0x50')],'raw':!![]})[_0x4ee9('0x27')](handleEntityNotFound(_0x5f0bd1,null))[_0x4ee9('0x27')](function(_0x242759){if(_0x242759){var _0x2a6998=_0x242759[_0x4ee9('0x51')];var _0x1f6998=util[_0x4ee9('0x52')](_0x4ee9('0x53'),_0x2a6998);if(fs[_0x4ee9('0x54')](_0x1f6998)){_0x27ba88=!![];return _0x34dc61[_0x4ee9('0x55')](_0x1f6998,_0x2a6998,config['secrets'][_0x4ee9('0x56')])[_0x4ee9('0x27')](function(){return _0x242759;});}return _0x242759;}})['then'](function(_0x38c857){if(_0x38c857){var _0x47112c=_0x38c857['savePath'];if(!fs[_0x4ee9('0x54')](_0x47112c)){throw new db[(_0x4ee9('0x57'))][(_0x4ee9('0x58'))]('SquareRecording\x20not\x20found');}if(_0x38c857[_0x4ee9('0x50')]){return _0x5f0bd1['download'](_0x47112c,_0x38c857[_0x4ee9('0x50')]+path[_0x4ee9('0x59')](_0x47112c),function(){if(_0x27ba88){fs[_0x4ee9('0x5a')](_0x47112c);}});}else{return _0x5f0bd1[_0x4ee9('0x5b')](_0x47112c,function(_0x51bfb7){if(_0x27ba88){fs[_0x4ee9('0x5a')](_0x47112c);}});}}})['catch'](function(_0x555861){if(_0x555861[_0x4ee9('0x5c')]==='SquareRecording\x20not\x20found'){_0x5f0bd1[_0x4ee9('0x1a')](0x194)[_0x4ee9('0x2c')](_0x4ee9('0x5d'));}else{return handleError(_0x5f0bd1,null);}});};exports[_0x4ee9('0x28')]=function(_0x19f106,_0x25e568){return db['SquareRecording'][_0x4ee9('0x4c')]({'where':{'id':_0x19f106['params']['id']}})[_0x4ee9('0x27')](function(_0x393c6b){if(_['isNil'](_0x393c6b)){throw new ReferenceError(_0x4ee9('0x5e'));}return _0x393c6b;})['then'](function(_0x26e121){var _0x2dbdcb=_0x26e121[_0x4ee9('0x51')];logger[_0x4ee9('0x5f')]('cancellazione\x20fisica\x20documento\x20%s',_0x2dbdcb);if(!_[_0x4ee9('0x60')](_0x26e121['savePath'])&&fs[_0x4ee9('0x54')](_0x2dbdcb)){logger[_0x4ee9('0x5f')](_0x4ee9('0x61')+_0x2dbdcb+_0x4ee9('0x62'));fs[_0x4ee9('0x63')](_0x2dbdcb);}_0x2dbdcb=_0x2dbdcb+_0x4ee9('0x64');if(!_[_0x4ee9('0x60')](_0x26e121[_0x4ee9('0x51')])&&fs[_0x4ee9('0x54')](_0x2dbdcb)){logger[_0x4ee9('0x5f')](_0x4ee9('0x61')+_0x2dbdcb+_0x4ee9('0x62'));fs[_0x4ee9('0x63')](_0x2dbdcb);}return _0x26e121;})[_0x4ee9('0x27')](function(_0x23ac8e){if(!_0x23ac8e)throw new InternalError();return _0x23ac8e[_0x4ee9('0x28')]();})[_0x4ee9('0x27')](function(){_0x25e568[_0x4ee9('0x1a')](0xcc)['end']();})['catch'](handleError(_0x25e568,null));}; \ No newline at end of file +var _0x58f8=['unlinkSync','.cypher','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','end','error','stack','name','send','index','SquareRecording','rawAttributes','type','key','model','map','query','keys','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','includeAll','catch','params','length','include','options','find','create','body','download','uniqueid','filename','savePath','format','%s.cypher','existsSync','recording','Sequelize','SquareRecording\x20not\x20found','extname','unlink','Not\x20found','isNil','Entity\x20not\x20found','cancellazione\x20fisica\x20documento\x20%s','info','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione'];(function(_0x52dfbd,_0x23fcac){var _0x422793=function(_0x421d36){while(--_0x421d36){_0x52dfbd['push'](_0x52dfbd['shift']());}};_0x422793(++_0x23fcac);}(_0x58f8,0xba));var _0x858f=function(_0xab0d35,_0xb21ed7){_0xab0d35=_0xab0d35-0x0;var _0x3f8b24=_0x58f8[_0xab0d35];return _0x3f8b24;};'use strict';var emlformat=require(_0x858f('0x0'));var rimraf=require(_0x858f('0x1'));var zipdir=require(_0x858f('0x2'));var jsonpatch=require(_0x858f('0x3'));var rp=require(_0x858f('0x4'));var moment=require(_0x858f('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x858f('0x6'));var util=require('util');var path=require('path');var sox=require(_0x858f('0x7'));var csv=require(_0x858f('0x8'));var ejs=require(_0x858f('0x9'));var fs=require('fs');var fs_extra=require(_0x858f('0xa'));var _=require(_0x858f('0xb'));var squel=require('squel');var crypto=require(_0x858f('0xc'));var jsforce=require(_0x858f('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x858f('0x8'));var querystring=require(_0x858f('0xe'));var Papa=require('papaparse');var Redis=require(_0x858f('0xf'));var authService=require(_0x858f('0x10'));var qs=require(_0x858f('0x11'));var as=require(_0x858f('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x858f('0x13'))(_0x858f('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x858f('0x15'));var db=require(_0x858f('0x16'))['db'];function respondWithStatusCode(_0x50bc3d,_0x35e499){_0x35e499=_0x35e499||0xcc;return function(_0x227e01){if(_0x227e01){return _0x50bc3d[_0x858f('0x17')](_0x35e499);}return _0x50bc3d[_0x858f('0x18')](_0x35e499)['end']();};}function respondWithResult(_0x58fa7a,_0x2a1105){_0x2a1105=_0x2a1105||0xc8;return function(_0x551f9d){if(_0x551f9d){return _0x58fa7a[_0x858f('0x18')](_0x2a1105)[_0x858f('0x19')](_0x551f9d);}};}function respondWithFilteredResult(_0x145a86,_0x57e108){return function(_0x26462c){if(_0x26462c){var _0x38685a=typeof _0x57e108[_0x858f('0x1a')]===_0x858f('0x1b')&&typeof _0x57e108[_0x858f('0x1c')]===_0x858f('0x1b');var _0x202572=_0x26462c[_0x858f('0x1d')];var _0x4ef7de=_0x38685a?0x0:_0x57e108[_0x858f('0x1a')];var _0x40ea89=_0x38685a?_0x26462c['count']:_0x57e108['offset']+_0x57e108[_0x858f('0x1c')];var _0xc1d27a;if(_0x40ea89>=_0x202572){_0x40ea89=_0x202572;_0xc1d27a=0xc8;}else{_0xc1d27a=0xce;}_0x145a86['status'](_0xc1d27a);return _0x145a86[_0x858f('0x1e')](_0x858f('0x1f'),_0x4ef7de+'-'+_0x40ea89+'/'+_0x202572)[_0x858f('0x19')](_0x26462c);}return null;};}function patchUpdates(_0x21083b){return function(_0x499bf5){try{jsonpatch[_0x858f('0x20')](_0x499bf5,_0x21083b,!![]);}catch(_0x5d9793){return BPromise['reject'](_0x5d9793);}return _0x499bf5[_0x858f('0x21')]();};}function saveUpdates(_0x3f369c,_0x14712e){return function(_0x277c0f){if(_0x277c0f){return _0x277c0f[_0x858f('0x22')](_0x3f369c)[_0x858f('0x23')](function(_0x5466d9){return _0x5466d9;});}return null;};}function removeEntity(_0x438254,_0x560457){return function(_0x252bfa){if(_0x252bfa){return _0x252bfa[_0x858f('0x24')]()[_0x858f('0x23')](function(){_0x438254[_0x858f('0x18')](0xcc)[_0x858f('0x25')]();});}};}function handleEntityNotFound(_0x124f5d,_0x41fdc5){return function(_0x11f99f){if(!_0x11f99f){_0x124f5d[_0x858f('0x17')](0x194);}return _0x11f99f;};}function handleError(_0x440cd2,_0x5bdaef){_0x5bdaef=_0x5bdaef||0x1f4;return function(_0x413d89){logger[_0x858f('0x26')](_0x413d89[_0x858f('0x27')]);if(_0x413d89[_0x858f('0x28')]){delete _0x413d89[_0x858f('0x28')];}_0x440cd2[_0x858f('0x18')](_0x5bdaef)[_0x858f('0x29')](_0x413d89);};}exports[_0x858f('0x2a')]=function(_0x98db7b,_0x484dff){var _0x4fe2d1={},_0xf2b1d9={},_0x5c3167={'count':0x0,'rows':[]};var _0x34f1f4=_['map'](db[_0x858f('0x2b')][_0x858f('0x2c')],function(_0x28c543){return{'name':_0x28c543['fieldName'],'type':_0x28c543[_0x858f('0x2d')][_0x858f('0x2e')]};});_0xf2b1d9[_0x858f('0x2f')]=_[_0x858f('0x30')](_0x34f1f4,_0x858f('0x28'));_0xf2b1d9[_0x858f('0x31')]=_[_0x858f('0x32')](_0x98db7b['query']);_0xf2b1d9['filters']=_[_0x858f('0x33')](_0xf2b1d9['model'],_0xf2b1d9[_0x858f('0x31')]);_0x4fe2d1['attributes']=_[_0x858f('0x33')](_0xf2b1d9[_0x858f('0x2f')],qs[_0x858f('0x34')](_0x98db7b[_0x858f('0x31')][_0x858f('0x34')]));_0x4fe2d1[_0x858f('0x35')]=_0x4fe2d1[_0x858f('0x35')]['length']?_0x4fe2d1[_0x858f('0x35')]:_0xf2b1d9[_0x858f('0x2f')];if(!_0x98db7b[_0x858f('0x31')][_0x858f('0x36')](_0x858f('0x37'))){_0x4fe2d1[_0x858f('0x1c')]=qs[_0x858f('0x1c')](_0x98db7b[_0x858f('0x31')]['limit']);_0x4fe2d1[_0x858f('0x1a')]=qs[_0x858f('0x1a')](_0x98db7b[_0x858f('0x31')]['offset']);}_0x4fe2d1[_0x858f('0x38')]=qs[_0x858f('0x39')](_0x98db7b['query'][_0x858f('0x39')]);_0x4fe2d1[_0x858f('0x3a')]=qs['filters'](_[_0x858f('0x3b')](_0x98db7b[_0x858f('0x31')],_0xf2b1d9['filters']),_0x34f1f4);if(_0x98db7b[_0x858f('0x31')][_0x858f('0x3c')]){_0x4fe2d1[_0x858f('0x3a')]=_['merge'](_0x4fe2d1[_0x858f('0x3a')],{'$or':_['map'](_0x34f1f4,function(_0x33f093){if(_0x33f093[_0x858f('0x2d')]!==_0x858f('0x3d')){var _0x7a93e0={};_0x7a93e0[_0x33f093[_0x858f('0x28')]]={'$like':'%'+_0x98db7b[_0x858f('0x31')][_0x858f('0x3c')]+'%'};return _0x7a93e0;}})});}_0x4fe2d1=_['merge']({},_0x4fe2d1,_0x98db7b['options']);var _0x11b51a={'where':_0x4fe2d1[_0x858f('0x3a')]};return db[_0x858f('0x2b')][_0x858f('0x1d')](_0x11b51a)[_0x858f('0x23')](function(_0x2a2765){_0x5c3167[_0x858f('0x1d')]=_0x2a2765;if(_0x98db7b[_0x858f('0x31')][_0x858f('0x3e')]){_0x4fe2d1['include']=[{'all':!![]}];}return db[_0x858f('0x2b')]['findAll'](_0x4fe2d1);})[_0x858f('0x23')](function(_0x1fd997){_0x5c3167['rows']=_0x1fd997;return _0x5c3167;})[_0x858f('0x23')](respondWithFilteredResult(_0x484dff,_0x4fe2d1))[_0x858f('0x3f')](handleError(_0x484dff,null));};exports['show']=function(_0x2c6f14,_0x41ded8){var _0x4ed77c={'raw':!![],'where':{'id':_0x2c6f14[_0x858f('0x40')]['id']}},_0x211018={};_0x211018['model']=_[_0x858f('0x32')](db[_0x858f('0x2b')][_0x858f('0x2c')]);_0x211018[_0x858f('0x31')]=_[_0x858f('0x32')](_0x2c6f14[_0x858f('0x31')]);_0x211018['filters']=_[_0x858f('0x33')](_0x211018[_0x858f('0x2f')],_0x211018[_0x858f('0x31')]);_0x4ed77c[_0x858f('0x35')]=_[_0x858f('0x33')](_0x211018[_0x858f('0x2f')],qs[_0x858f('0x34')](_0x2c6f14[_0x858f('0x31')][_0x858f('0x34')]));_0x4ed77c[_0x858f('0x35')]=_0x4ed77c[_0x858f('0x35')][_0x858f('0x41')]?_0x4ed77c['attributes']:_0x211018[_0x858f('0x2f')];if(_0x2c6f14[_0x858f('0x31')][_0x858f('0x3e')]){_0x4ed77c[_0x858f('0x42')]=[{'all':!![]}];}_0x4ed77c=_['merge']({},_0x4ed77c,_0x2c6f14[_0x858f('0x43')]);return db[_0x858f('0x2b')][_0x858f('0x44')](_0x4ed77c)[_0x858f('0x23')](handleEntityNotFound(_0x41ded8,null))[_0x858f('0x23')](respondWithResult(_0x41ded8,null))[_0x858f('0x3f')](handleError(_0x41ded8,null));};exports[_0x858f('0x45')]=function(_0xf9d7c1,_0x3c8a3b){return db[_0x858f('0x2b')][_0x858f('0x45')](_0xf9d7c1['body'],{})[_0x858f('0x23')](respondWithResult(_0x3c8a3b,0xc9))[_0x858f('0x3f')](handleError(_0x3c8a3b,null));};exports[_0x858f('0x22')]=function(_0x1c9446,_0x4c0769){if(_0x1c9446['body']['id']){delete _0x1c9446[_0x858f('0x46')]['id'];}return db[_0x858f('0x2b')]['find']({'where':{'id':_0x1c9446['params']['id']}})[_0x858f('0x23')](handleEntityNotFound(_0x4c0769,null))[_0x858f('0x23')](saveUpdates(_0x1c9446[_0x858f('0x46')],null))[_0x858f('0x23')](respondWithResult(_0x4c0769,null))[_0x858f('0x3f')](handleError(_0x4c0769,null));};exports[_0x858f('0x47')]=function(_0x32634a,_0x4198e4,_0x41c5af){var _0x2b7baf=require('../../components/encryptor');var _0x443e40=![];var _0x23cf5e={};if(_0x32634a['query'][_0x858f('0x2d')]&&_0x32634a['query'][_0x858f('0x2d')]===_0x858f('0x48')){_0x23cf5e[_0x858f('0x48')]=_0x32634a[_0x858f('0x40')]['id'];}else{_0x23cf5e['id']=_0x32634a[_0x858f('0x40')]['id'];}return db[_0x858f('0x2b')][_0x858f('0x44')]({'where':_0x23cf5e,'attributes':['id','savePath',_0x858f('0x49')],'raw':!![]})['then'](handleEntityNotFound(_0x4198e4,null))[_0x858f('0x23')](function(_0x553601){if(_0x553601){var _0x8da2ce=_0x553601[_0x858f('0x4a')];var _0x2300c6=util[_0x858f('0x4b')](_0x858f('0x4c'),_0x8da2ce);if(fs[_0x858f('0x4d')](_0x2300c6)){_0x443e40=!![];return _0x2b7baf['decryptFile'](_0x2300c6,_0x8da2ce,config['secrets'][_0x858f('0x4e')])[_0x858f('0x23')](function(){return _0x553601;});}return _0x553601;}})[_0x858f('0x23')](function(_0xf13cf3){if(_0xf13cf3){var _0x535228=_0xf13cf3[_0x858f('0x4a')];if(!fs[_0x858f('0x4d')](_0x535228)){throw new db[(_0x858f('0x4f'))]['ValidationError'](_0x858f('0x50'));}if(_0xf13cf3[_0x858f('0x49')]){return _0x4198e4[_0x858f('0x47')](_0x535228,_0xf13cf3['filename']+path[_0x858f('0x51')](_0x535228),function(){if(_0x443e40){fs[_0x858f('0x52')](_0x535228);}});}else{return _0x4198e4['download'](_0x535228,function(_0x5d763c){if(_0x443e40){fs['unlink'](_0x535228);}});}}})[_0x858f('0x3f')](function(_0x1606bf){if(_0x1606bf['message']===_0x858f('0x50')){_0x4198e4[_0x858f('0x18')](0x194)[_0x858f('0x29')](_0x858f('0x53'));}else{return handleError(_0x4198e4,null);}});};exports['destroy']=function(_0x189057,_0x266673){return db[_0x858f('0x2b')][_0x858f('0x44')]({'where':{'id':_0x189057[_0x858f('0x40')]['id']}})[_0x858f('0x23')](function(_0x212dac){if(_[_0x858f('0x54')](_0x212dac)){throw new ReferenceError(_0x858f('0x55'));}return _0x212dac;})[_0x858f('0x23')](function(_0x44be66){var _0x54e2c0=_0x44be66[_0x858f('0x4a')];logger['info'](_0x858f('0x56'),_0x54e2c0);if(!_[_0x858f('0x54')](_0x44be66[_0x858f('0x4a')])&&fs['existsSync'](_0x54e2c0)){logger[_0x858f('0x57')](_0x858f('0x58')+_0x54e2c0+_0x858f('0x59'));fs[_0x858f('0x5a')](_0x54e2c0);}_0x54e2c0=_0x54e2c0+_0x858f('0x5b');if(!_[_0x858f('0x54')](_0x44be66[_0x858f('0x4a')])&&fs[_0x858f('0x4d')](_0x54e2c0)){logger[_0x858f('0x57')](_0x858f('0x58')+_0x54e2c0+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0x858f('0x5a')](_0x54e2c0);}return _0x44be66;})[_0x858f('0x23')](function(_0x2e8452){if(!_0x2e8452)throw new InternalError();return _0x2e8452[_0x858f('0x24')]();})[_0x858f('0x23')](function(){_0x266673[_0x858f('0x18')](0xcc)[_0x858f('0x25')]();})['catch'](handleError(_0x266673,null));}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.model.js b/server/api/squareRecording/squareRecording.model.js index 0d8ce8c..87c9aec 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 _0xb511=['rimraf','../../config/environment','exports','define','SquareRecording','lodash','util','../../config/logger','moment','bluebird','path'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xb511,0x165));var _0x1b51=function(_0x117ae1,_0x1c5579){_0x117ae1=_0x117ae1-0x0;var _0x5d209e=_0xb511[_0x117ae1];return _0x5d209e;};'use strict';var _=require(_0x1b51('0x0'));var util=require(_0x1b51('0x1'));var logger=require(_0x1b51('0x2'))('api');var moment=require(_0x1b51('0x3'));var BPromise=require(_0x1b51('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1b51('0x5'));var rimraf=require(_0x1b51('0x6'));var config=require(_0x1b51('0x7'));var attributes=require('./squareRecording.attributes');module[_0x1b51('0x8')]=function(_0x463bec,_0x506653){return _0x463bec[_0x1b51('0x9')](_0x1b51('0xa'),attributes,{'tableName':'square_recordings','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3c85=['./squareRecording.attributes','exports','lodash','util','../../config/logger','api','request-promise','path','rimraf'];(function(_0xe1ce0f,_0x2043b8){var _0x2c1530=function(_0x280752){while(--_0x280752){_0xe1ce0f['push'](_0xe1ce0f['shift']());}};_0x2c1530(++_0x2043b8);}(_0x3c85,0x1a0));var _0x53c8=function(_0xb4773b,_0x181bf0){_0xb4773b=_0xb4773b-0x0;var _0x290456=_0x3c85[_0xb4773b];return _0x290456;};'use strict';var _=require(_0x53c8('0x0'));var util=require(_0x53c8('0x1'));var logger=require(_0x53c8('0x2'))(_0x53c8('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x53c8('0x4'));var fs=require('fs');var path=require(_0x53c8('0x5'));var rimraf=require(_0x53c8('0x6'));var config=require('../../config/environment');var attributes=require(_0x53c8('0x7'));module[_0x53c8('0x8')]=function(_0x4758fd,_0x4c2e1b){return _0x4758fd['define']('SquareRecording',attributes,{'tableName':'square_recordings','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.rpc.js b/server/api/squareRecording/squareRecording.rpc.js index 8869ae2..9eac1a5 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 _0x5add=['client','http','request','then','SquareRecording,\x20%s,\x20%s','request\x20sent','debug','SquareRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','CreateSquareRecording','SquareRecording','body','options','raw','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x5eb6e6,_0x17f551){var _0x35c38b=function(_0xa3592){while(--_0xa3592){_0x5eb6e6['push'](_0x5eb6e6['shift']());}};_0x35c38b(++_0x17f551);}(_0x5add,0x121));var _0xd5ad=function(_0x37adbf,_0xffe809){_0x37adbf=_0x37adbf-0x0;var _0x5c24a3=_0x5add[_0x37adbf];return _0x5c24a3;};'use strict';var _=require(_0xd5ad('0x0'));var util=require(_0xd5ad('0x1'));var moment=require('moment');var BPromise=require(_0xd5ad('0x2'));var rs=require(_0xd5ad('0x3'));var fs=require('fs');var Redis=require(_0xd5ad('0x4'));var db=require(_0xd5ad('0x5'))['db'];var utils=require(_0xd5ad('0x6'));var logger=require(_0xd5ad('0x7'))(_0xd5ad('0x8'));var config=require(_0xd5ad('0x9'));var jayson=require(_0xd5ad('0xa'));var client=jayson[_0xd5ad('0xb')][_0xd5ad('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x46afb1,_0x47ad11,_0x3833a4){return new BPromise(function(_0x33966d,_0x12f429){return client[_0xd5ad('0xd')](_0x46afb1,_0x3833a4)[_0xd5ad('0xe')](function(_0x4c6780){logger['info'](_0xd5ad('0xf'),_0x47ad11,_0xd5ad('0x10'));logger[_0xd5ad('0x11')](_0xd5ad('0x12'),_0x47ad11,_0xd5ad('0x10'),JSON[_0xd5ad('0x13')](_0x4c6780));if(_0x4c6780['error']){if(_0x4c6780[_0xd5ad('0x14')][_0xd5ad('0x15')]===0x1f4){logger['error'](_0xd5ad('0xf'),_0x47ad11,_0x4c6780[_0xd5ad('0x14')][_0xd5ad('0x16')]);return _0x12f429(_0x4c6780['error']['message']);}logger[_0xd5ad('0x14')](_0xd5ad('0xf'),_0x47ad11,_0x4c6780[_0xd5ad('0x14')][_0xd5ad('0x16')]);return _0x33966d(_0x4c6780[_0xd5ad('0x14')][_0xd5ad('0x16')]);}else{logger[_0xd5ad('0x17')]('SquareRecording,\x20%s,\x20%s',_0x47ad11,'request\x20sent');_0x33966d(_0x4c6780['result']['message']);}})[_0xd5ad('0x18')](function(_0x2380a5){logger[_0xd5ad('0x14')](_0xd5ad('0xf'),_0x47ad11,_0x2380a5);_0x12f429(_0x2380a5);});});}exports[_0xd5ad('0x19')]=function(_0x5292ce){var _0x102572=this;return new Promise(function(_0x4d837e,_0x14a86a){return db[_0xd5ad('0x1a')]['create'](_0x5292ce[_0xd5ad('0x1b')],{'raw':_0x5292ce[_0xd5ad('0x1c')]?_0x5292ce[_0xd5ad('0x1c')][_0xd5ad('0x1d')]===undefined?!![]:![]:!![]})[_0xd5ad('0xe')](function(_0x4c2fa4){logger[_0xd5ad('0x17')](_0xd5ad('0x19'),_0x5292ce);logger[_0xd5ad('0x11')](_0xd5ad('0x19'),_0x5292ce,JSON[_0xd5ad('0x13')](_0x4c2fa4));_0x4d837e(_0x4c2fa4);})[_0xd5ad('0x18')](function(_0x5edf06){logger['error'](_0xd5ad('0x19'),_0x5edf06[_0xd5ad('0x16')],_0x5292ce);_0x14a86a(_0x102572[_0xd5ad('0x14')](0x1f4,_0x5edf06[_0xd5ad('0x16')]));});});}; \ No newline at end of file +var _0xb146=['then','info','SquareRecording,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','CreateSquareRecording','create','body','options','debug','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x1eac5c,_0x39005e){var _0x162461=function(_0xd36912){while(--_0xd36912){_0x1eac5c['push'](_0x1eac5c['shift']());}};_0x162461(++_0x39005e);}(_0xb146,0xd3));var _0x6b14=function(_0x5ba17f,_0x108a73){_0x5ba17f=_0x5ba17f-0x0;var _0x2167e8=_0xb146[_0x5ba17f];return _0x2167e8;};'use strict';var _=require(_0x6b14('0x0'));var util=require(_0x6b14('0x1'));var moment=require(_0x6b14('0x2'));var BPromise=require(_0x6b14('0x3'));var rs=require(_0x6b14('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6b14('0x5'))['db'];var utils=require(_0x6b14('0x6'));var logger=require(_0x6b14('0x7'))(_0x6b14('0x8'));var config=require(_0x6b14('0x9'));var jayson=require(_0x6b14('0xa'));var client=jayson[_0x6b14('0xb')][_0x6b14('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x3f8d12,_0x4347c1,_0xae727b){return new BPromise(function(_0x2e6ce9,_0x4b341e){return client['request'](_0x3f8d12,_0xae727b)[_0x6b14('0xd')](function(_0x17d76c){logger[_0x6b14('0xe')](_0x6b14('0xf'),_0x4347c1,_0x6b14('0x10'));logger['debug']('SquareRecording,\x20%s,\x20%s,\x20%s',_0x4347c1,_0x6b14('0x10'),JSON[_0x6b14('0x11')](_0x17d76c));if(_0x17d76c[_0x6b14('0x12')]){if(_0x17d76c['error'][_0x6b14('0x13')]===0x1f4){logger[_0x6b14('0x12')](_0x6b14('0xf'),_0x4347c1,_0x17d76c['error'][_0x6b14('0x14')]);return _0x4b341e(_0x17d76c[_0x6b14('0x12')][_0x6b14('0x14')]);}logger[_0x6b14('0x12')](_0x6b14('0xf'),_0x4347c1,_0x17d76c['error'][_0x6b14('0x14')]);return _0x2e6ce9(_0x17d76c[_0x6b14('0x12')][_0x6b14('0x14')]);}else{logger[_0x6b14('0xe')]('SquareRecording,\x20%s,\x20%s',_0x4347c1,'request\x20sent');_0x2e6ce9(_0x17d76c[_0x6b14('0x15')][_0x6b14('0x14')]);}})[_0x6b14('0x16')](function(_0xd3a851){logger[_0x6b14('0x12')](_0x6b14('0xf'),_0x4347c1,_0xd3a851);_0x4b341e(_0xd3a851);});});}exports[_0x6b14('0x17')]=function(_0x4f0f48){var _0x26fcea=this;return new Promise(function(_0xb67130,_0x226a14){return db['SquareRecording'][_0x6b14('0x18')](_0x4f0f48[_0x6b14('0x19')],{'raw':_0x4f0f48['options']?_0x4f0f48[_0x6b14('0x1a')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x494a5e){logger['info'](_0x6b14('0x17'),_0x4f0f48);logger[_0x6b14('0x1b')](_0x6b14('0x17'),_0x4f0f48,JSON['stringify'](_0x494a5e));_0xb67130(_0x494a5e);})[_0x6b14('0x16')](function(_0x2ce180){logger[_0x6b14('0x12')](_0x6b14('0x17'),_0x2ce180[_0x6b14('0x14')],_0x4f0f48);_0x226a14(_0x26fcea[_0x6b14('0x12')](0x1f4,_0x2ce180[_0x6b14('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/squareReport/index.js b/server/api/squareReport/index.js index c119241..7c06ef4 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 _0xbaf0=['/:id','update','delete','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./squareReport.controller','get','isAuthenticated','index','/describe','show','post','create','put'];(function(_0x39de87,_0x97e1d8){var _0x41f5dd=function(_0x2a031c){while(--_0x2a031c){_0x39de87['push'](_0x39de87['shift']());}};_0x41f5dd(++_0x97e1d8);}(_0xbaf0,0x12a));var _0x0baf=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0xbaf0[_0x432682];return _0x463d05;};'use strict';var multer=require('multer');var util=require(_0x0baf('0x0'));var path=require(_0x0baf('0x1'));var timeout=require(_0x0baf('0x2'));var express=require(_0x0baf('0x3'));var router=express[_0x0baf('0x4')]();var fs_extra=require(_0x0baf('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x0baf('0x6'));var config=require(_0x0baf('0x7'));var controller=require(_0x0baf('0x8'));router[_0x0baf('0x9')]('/',auth[_0x0baf('0xa')](),controller[_0x0baf('0xb')]);router[_0x0baf('0x9')](_0x0baf('0xc'),auth[_0x0baf('0xa')](),controller['describe']);router[_0x0baf('0x9')]('/:id',auth[_0x0baf('0xa')](),controller[_0x0baf('0xd')]);router[_0x0baf('0xe')]('/',auth[_0x0baf('0xa')](),controller[_0x0baf('0xf')]);router[_0x0baf('0x10')](_0x0baf('0x11'),auth[_0x0baf('0xa')](),controller[_0x0baf('0x12')]);router[_0x0baf('0x13')](_0x0baf('0x11'),auth['isAuthenticated'](),controller['destroy']);module[_0x0baf('0x14')]=router; \ No newline at end of file +var _0xbaf0=['/:id','update','delete','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./squareReport.controller','get','isAuthenticated','index','/describe','show','post','create','put'];(function(_0x1e0098,_0xc2c97b){var _0x5e2dcc=function(_0x116430){while(--_0x116430){_0x1e0098['push'](_0x1e0098['shift']());}};_0x5e2dcc(++_0xc2c97b);}(_0xbaf0,0x12a));var _0x0baf=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0xbaf0[_0x465028];return _0xb783d4;};'use strict';var multer=require('multer');var util=require(_0x0baf('0x0'));var path=require(_0x0baf('0x1'));var timeout=require(_0x0baf('0x2'));var express=require(_0x0baf('0x3'));var router=express[_0x0baf('0x4')]();var fs_extra=require(_0x0baf('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x0baf('0x6'));var config=require(_0x0baf('0x7'));var controller=require(_0x0baf('0x8'));router[_0x0baf('0x9')]('/',auth[_0x0baf('0xa')](),controller[_0x0baf('0xb')]);router[_0x0baf('0x9')](_0x0baf('0xc'),auth[_0x0baf('0xa')](),controller['describe']);router[_0x0baf('0x9')]('/:id',auth[_0x0baf('0xa')](),controller[_0x0baf('0xd')]);router[_0x0baf('0xe')]('/',auth[_0x0baf('0xa')](),controller[_0x0baf('0xf')]);router[_0x0baf('0x10')](_0x0baf('0x11'),auth[_0x0baf('0xa')](),controller[_0x0baf('0x12')]);router[_0x0baf('0x13')](_0x0baf('0x11'),auth['isAuthenticated'](),controller['destroy']);module[_0x0baf('0x14')]=router; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.attributes.js b/server/api/squareReport/squareReport.attributes.js index dbd3686..8546be5 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 _0x3ef4=['STRING','DATE','BOOLEAN','sequelize','exports'];(function(_0x2ab3e7,_0x1f777d){var _0x2f2877=function(_0x510104){while(--_0x510104){_0x2ab3e7['push'](_0x2ab3e7['shift']());}};_0x2f2877(++_0x1f777d);}(_0x3ef4,0x1de));var _0x43ef=function(_0x4ece58,_0x50922a){_0x4ece58=_0x4ece58-0x0;var _0x20d209=_0x3ef4[_0x4ece58];return _0x20d209;};'use strict';var Sequelize=require(_0x43ef('0x0'));module[_0x43ef('0x1')]={'network':{'type':Sequelize[_0x43ef('0x2')]},'network_script':{'type':Sequelize[_0x43ef('0x2')]},'request':{'type':Sequelize[_0x43ef('0x2')]},'channel':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x43ef('0x2')]},'type':{'type':Sequelize[_0x43ef('0x2')]},'uniqueid':{'type':Sequelize[_0x43ef('0x2')]},'version':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0x43ef('0x2')]},'calleridname':{'type':Sequelize[_0x43ef('0x2')]},'callingpres':{'type':Sequelize[_0x43ef('0x2')]},'callingani2':{'type':Sequelize[_0x43ef('0x2')]},'callington':{'type':Sequelize['STRING']},'callingtns':{'type':Sequelize[_0x43ef('0x2')]},'dnid':{'type':Sequelize[_0x43ef('0x2')]},'rdnis':{'type':Sequelize[_0x43ef('0x2')]},'context':{'type':Sequelize['STRING']},'extension':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0x43ef('0x2')]},'enhanced':{'type':Sequelize[_0x43ef('0x2')]},'accountcode':{'type':Sequelize['STRING']},'threadid':{'type':Sequelize[_0x43ef('0x2')]},'project_name':{'type':Sequelize[_0x43ef('0x2')]},'joinAt':{'type':Sequelize[_0x43ef('0x3')]},'leaveAt':{'type':Sequelize[_0x43ef('0x3')]},'bot':{'type':Sequelize[_0x43ef('0x4')],'defaultValue':![]}}; \ No newline at end of file +var _0x9c02=['BOOLEAN','sequelize','exports','STRING','DATE'];(function(_0x2340a0,_0x2bd1c0){var _0x5631ff=function(_0x254896){while(--_0x254896){_0x2340a0['push'](_0x2340a0['shift']());}};_0x5631ff(++_0x2bd1c0);}(_0x9c02,0x196));var _0x29c0=function(_0x52a44d,_0x16d532){_0x52a44d=_0x52a44d-0x0;var _0xa3006f=_0x9c02[_0x52a44d];return _0xa3006f;};'use strict';var Sequelize=require(_0x29c0('0x0'));module[_0x29c0('0x1')]={'network':{'type':Sequelize[_0x29c0('0x2')]},'network_script':{'type':Sequelize['STRING']},'request':{'type':Sequelize['STRING']},'channel':{'type':Sequelize['STRING']},'language':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x29c0('0x2')]},'uniqueid':{'type':Sequelize['STRING']},'version':{'type':Sequelize[_0x29c0('0x2')]},'callerid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x29c0('0x2')]},'callingpres':{'type':Sequelize['STRING']},'callingani2':{'type':Sequelize[_0x29c0('0x2')]},'callington':{'type':Sequelize[_0x29c0('0x2')]},'callingtns':{'type':Sequelize[_0x29c0('0x2')]},'dnid':{'type':Sequelize['STRING']},'rdnis':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x29c0('0x2')]},'extension':{'type':Sequelize[_0x29c0('0x2')]},'priority':{'type':Sequelize[_0x29c0('0x2')]},'enhanced':{'type':Sequelize[_0x29c0('0x2')]},'accountcode':{'type':Sequelize[_0x29c0('0x2')]},'threadid':{'type':Sequelize['STRING']},'project_name':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x29c0('0x3')]},'leaveAt':{'type':Sequelize['DATE']},'bot':{'type':Sequelize[_0x29c0('0x4')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.controller.js b/server/api/squareReport/squareReport.controller.js index d180625..1fd0732 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 _0xbf26=['type','key','model','keys','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','then','include','rows','catch','show','params','includeAll','merge','create','body','destroy','find','describe','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','reject','update','end','error','stack','name','send','index','map','SquareReport','rawAttributes','fieldName'];(function(_0x1df725,_0x114043){var _0x55d843=function(_0x4f64c9){while(--_0x4f64c9){_0x1df725['push'](_0x1df725['shift']());}};_0x55d843(++_0x114043);}(_0xbf26,0x66));var _0x6bf2=function(_0x3536ab,_0x116ff6){_0x3536ab=_0x3536ab-0x0;var _0x23477f=_0xbf26[_0x3536ab];return _0x23477f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6bf2('0x0'));var zipdir=require(_0x6bf2('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6bf2('0x2'));var moment=require(_0x6bf2('0x3'));var BPromise=require(_0x6bf2('0x4'));var Mustache=require(_0x6bf2('0x5'));var util=require('util');var path=require(_0x6bf2('0x6'));var sox=require(_0x6bf2('0x7'));var csv=require(_0x6bf2('0x8'));var ejs=require(_0x6bf2('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x6bf2('0xa'));var crypto=require(_0x6bf2('0xb'));var jsforce=require(_0x6bf2('0xc'));var deskjs=require(_0x6bf2('0xd'));var toCsv=require('to-csv');var querystring=require(_0x6bf2('0xe'));var Papa=require(_0x6bf2('0xf'));var Redis=require(_0x6bf2('0x10'));var authService=require(_0x6bf2('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x6bf2('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x6bf2('0x13'))(_0x6bf2('0x14'));var utils=require(_0x6bf2('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x6bf2('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1dfd5d,_0x562466){_0x562466=_0x562466||0xcc;return function(_0x5b5689){if(_0x5b5689){return _0x1dfd5d[_0x6bf2('0x17')](_0x562466);}return _0x1dfd5d[_0x6bf2('0x18')](_0x562466)['end']();};}function respondWithResult(_0xa887f9,_0x438995){_0x438995=_0x438995||0xc8;return function(_0x52a395){if(_0x52a395){return _0xa887f9[_0x6bf2('0x18')](_0x438995)[_0x6bf2('0x19')](_0x52a395);}};}function respondWithFilteredResult(_0x3dfb78,_0x199444){return function(_0xa4e147){if(_0xa4e147){var _0xc1b448=typeof _0x199444[_0x6bf2('0x1a')]===_0x6bf2('0x1b')&&typeof _0x199444[_0x6bf2('0x1c')]==='undefined';var _0x45cb4c=_0xa4e147[_0x6bf2('0x1d')];var _0x54b365=_0xc1b448?0x0:_0x199444[_0x6bf2('0x1a')];var _0x3306f4=_0xc1b448?_0xa4e147[_0x6bf2('0x1d')]:_0x199444['offset']+_0x199444[_0x6bf2('0x1c')];var _0x33139c;if(_0x3306f4>=_0x45cb4c){_0x3306f4=_0x45cb4c;_0x33139c=0xc8;}else{_0x33139c=0xce;}_0x3dfb78['status'](_0x33139c);return _0x3dfb78[_0x6bf2('0x1e')](_0x6bf2('0x1f'),_0x54b365+'-'+_0x3306f4+'/'+_0x45cb4c)[_0x6bf2('0x19')](_0xa4e147);}return null;};}function patchUpdates(_0x43dc51){return function(_0xe58a4f){try{jsonpatch['apply'](_0xe58a4f,_0x43dc51,!![]);}catch(_0x3fe4d9){return BPromise[_0x6bf2('0x20')](_0x3fe4d9);}return _0xe58a4f['save']();};}function saveUpdates(_0x272544,_0x5d2dbc){return function(_0x52bad0){if(_0x52bad0){return _0x52bad0[_0x6bf2('0x21')](_0x272544)['then'](function(_0x375f8a){return _0x375f8a;});}return null;};}function removeEntity(_0x1644ec,_0x227432){return function(_0x4d9673){if(_0x4d9673){return _0x4d9673['destroy']()['then'](function(){_0x1644ec['status'](0xcc)[_0x6bf2('0x22')]();});}};}function handleEntityNotFound(_0x408caa,_0x522b9e){return function(_0xaede38){if(!_0xaede38){_0x408caa['sendStatus'](0x194);}return _0xaede38;};}function handleError(_0x12c712,_0x4171e4){_0x4171e4=_0x4171e4||0x1f4;return function(_0x22de33){logger[_0x6bf2('0x23')](_0x22de33[_0x6bf2('0x24')]);if(_0x22de33[_0x6bf2('0x25')]){delete _0x22de33['name'];}_0x12c712[_0x6bf2('0x18')](_0x4171e4)[_0x6bf2('0x26')](_0x22de33);};}exports[_0x6bf2('0x27')]=function(_0x5663e8,_0x3afb60){var _0x3e56fc={},_0xc607ea={},_0x1ea15b={'count':0x0,'rows':[]};var _0x316177=_[_0x6bf2('0x28')](db[_0x6bf2('0x29')][_0x6bf2('0x2a')],function(_0x12282d){return{'name':_0x12282d[_0x6bf2('0x2b')],'type':_0x12282d[_0x6bf2('0x2c')][_0x6bf2('0x2d')]};});_0xc607ea[_0x6bf2('0x2e')]=_['map'](_0x316177,_0x6bf2('0x25'));_0xc607ea['query']=_[_0x6bf2('0x2f')](_0x5663e8[_0x6bf2('0x30')]);_0xc607ea[_0x6bf2('0x31')]=_[_0x6bf2('0x32')](_0xc607ea[_0x6bf2('0x2e')],_0xc607ea[_0x6bf2('0x30')]);_0x3e56fc['attributes']=_[_0x6bf2('0x32')](_0xc607ea[_0x6bf2('0x2e')],qs['fields'](_0x5663e8['query'][_0x6bf2('0x33')]));_0x3e56fc['attributes']=_0x3e56fc[_0x6bf2('0x34')]['length']?_0x3e56fc[_0x6bf2('0x34')]:_0xc607ea['model'];if(!_0x5663e8[_0x6bf2('0x30')][_0x6bf2('0x35')](_0x6bf2('0x36'))){_0x3e56fc[_0x6bf2('0x1c')]=qs[_0x6bf2('0x1c')](_0x5663e8['query'][_0x6bf2('0x1c')]);_0x3e56fc[_0x6bf2('0x1a')]=qs['offset'](_0x5663e8[_0x6bf2('0x30')][_0x6bf2('0x1a')]);}_0x3e56fc[_0x6bf2('0x37')]=qs[_0x6bf2('0x38')](_0x5663e8[_0x6bf2('0x30')][_0x6bf2('0x38')]);_0x3e56fc[_0x6bf2('0x39')]=qs[_0x6bf2('0x31')](_[_0x6bf2('0x3a')](_0x5663e8[_0x6bf2('0x30')],_0xc607ea[_0x6bf2('0x31')]),_0x316177);if(_0x5663e8[_0x6bf2('0x30')][_0x6bf2('0x3b')]){_0x3e56fc[_0x6bf2('0x39')]=_['merge'](_0x3e56fc[_0x6bf2('0x39')],{'$or':_[_0x6bf2('0x28')](_0x316177,function(_0x12124e){if(_0x12124e[_0x6bf2('0x2c')]!=='VIRTUAL'){var _0x30e7ed={};_0x30e7ed[_0x12124e['name']]={'$like':'%'+_0x5663e8['query'][_0x6bf2('0x3b')]+'%'};return _0x30e7ed;}})});}_0x3e56fc=_['merge']({},_0x3e56fc,_0x5663e8['options']);var _0x276c37={'where':_0x3e56fc[_0x6bf2('0x39')]};return db[_0x6bf2('0x29')][_0x6bf2('0x1d')](_0x276c37)[_0x6bf2('0x3c')](function(_0x5ee1c4){_0x1ea15b[_0x6bf2('0x1d')]=_0x5ee1c4;if(_0x5663e8[_0x6bf2('0x30')]['includeAll']){_0x3e56fc[_0x6bf2('0x3d')]=[{'all':!![]}];}return db['SquareReport']['findAll'](_0x3e56fc);})[_0x6bf2('0x3c')](function(_0xec66c8){_0x1ea15b[_0x6bf2('0x3e')]=_0xec66c8;return _0x1ea15b;})[_0x6bf2('0x3c')](respondWithFilteredResult(_0x3afb60,_0x3e56fc))[_0x6bf2('0x3f')](handleError(_0x3afb60,null));};exports[_0x6bf2('0x40')]=function(_0x46a2d6,_0x436ae3){var _0x226fd6={'raw':!![],'where':{'id':_0x46a2d6[_0x6bf2('0x41')]['id']}},_0x534b65={};_0x534b65[_0x6bf2('0x2e')]=_[_0x6bf2('0x2f')](db[_0x6bf2('0x29')]['rawAttributes']);_0x534b65['query']=_[_0x6bf2('0x2f')](_0x46a2d6[_0x6bf2('0x30')]);_0x534b65[_0x6bf2('0x31')]=_['intersection'](_0x534b65[_0x6bf2('0x2e')],_0x534b65[_0x6bf2('0x30')]);_0x226fd6['attributes']=_['intersection'](_0x534b65[_0x6bf2('0x2e')],qs[_0x6bf2('0x33')](_0x46a2d6[_0x6bf2('0x30')][_0x6bf2('0x33')]));_0x226fd6[_0x6bf2('0x34')]=_0x226fd6[_0x6bf2('0x34')]['length']?_0x226fd6[_0x6bf2('0x34')]:_0x534b65[_0x6bf2('0x2e')];if(_0x46a2d6[_0x6bf2('0x30')][_0x6bf2('0x42')]){_0x226fd6[_0x6bf2('0x3d')]=[{'all':!![]}];}_0x226fd6=_[_0x6bf2('0x43')]({},_0x226fd6,_0x46a2d6['options']);return db['SquareReport']['find'](_0x226fd6)['then'](handleEntityNotFound(_0x436ae3,null))[_0x6bf2('0x3c')](respondWithResult(_0x436ae3,null))['catch'](handleError(_0x436ae3,null));};exports[_0x6bf2('0x44')]=function(_0x43a446,_0x4322af){return db[_0x6bf2('0x29')]['create'](_0x43a446[_0x6bf2('0x45')],{})['then'](respondWithResult(_0x4322af,0xc9))[_0x6bf2('0x3f')](handleError(_0x4322af,null));};exports['update']=function(_0x15e35e,_0x3231dc){if(_0x15e35e[_0x6bf2('0x45')]['id']){delete _0x15e35e['body']['id'];}return db[_0x6bf2('0x29')]['find']({'where':{'id':_0x15e35e[_0x6bf2('0x41')]['id']}})[_0x6bf2('0x3c')](handleEntityNotFound(_0x3231dc,null))[_0x6bf2('0x3c')](saveUpdates(_0x15e35e['body'],null))[_0x6bf2('0x3c')](respondWithResult(_0x3231dc,null))[_0x6bf2('0x3f')](handleError(_0x3231dc,null));};exports[_0x6bf2('0x46')]=function(_0x14d2b4,_0x4599a8){return db['SquareReport'][_0x6bf2('0x47')]({'where':{'id':_0x14d2b4['params']['id']}})['then'](handleEntityNotFound(_0x4599a8,null))[_0x6bf2('0x3c')](removeEntity(_0x4599a8,null))[_0x6bf2('0x3f')](handleError(_0x4599a8,null));};exports['describe']=function(_0x2cc6c5,_0x22bbe7){return db['SquareReport'][_0x6bf2('0x48')]()[_0x6bf2('0x3c')](respondWithResult(_0x22bbe7,null))[_0x6bf2('0x3f')](handleError(_0x22bbe7,null));}; \ No newline at end of file +var _0xa192=['status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','error','stack','name','send','map','SquareReport','rawAttributes','model','query','keys','attributes','intersection','fields','length','nolimit','order','sort','filters','filter','where','type','VIRTUAL','merge','includeAll','findAll','rows','catch','show','params','include','options','create','body','find','destroy','describe','eml-format','rimraf','moment','bluebird','mustache','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus'];(function(_0x2acab3,_0x9d8a85){var _0x3ace4f=function(_0x557fde){while(--_0x557fde){_0x2acab3['push'](_0x2acab3['shift']());}};_0x3ace4f(++_0x9d8a85);}(_0xa192,0x14a));var _0x2a19=function(_0x978cfa,_0x2c3c2f){_0x978cfa=_0x978cfa-0x0;var _0x596ad3=_0xa192[_0x978cfa];return _0x596ad3;};'use strict';var emlformat=require(_0x2a19('0x0'));var rimraf=require(_0x2a19('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x2a19('0x2'));var BPromise=require(_0x2a19('0x3'));var Mustache=require(_0x2a19('0x4'));var util=require('util');var path=require('path');var sox=require(_0x2a19('0x5'));var csv=require(_0x2a19('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2a19('0x7'));var _=require('lodash');var squel=require(_0x2a19('0x8'));var crypto=require(_0x2a19('0x9'));var jsforce=require(_0x2a19('0xa'));var deskjs=require(_0x2a19('0xb'));var toCsv=require(_0x2a19('0x6'));var querystring=require('querystring');var Papa=require(_0x2a19('0xc'));var Redis=require(_0x2a19('0xd'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x2a19('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2a19('0xf'))('api');var utils=require(_0x2a19('0x10'));var config=require(_0x2a19('0x11'));var licenseUtil=require('../../config/license/util');var db=require(_0x2a19('0x12'))['db'];function respondWithStatusCode(_0x12034b,_0x296ede){_0x296ede=_0x296ede||0xcc;return function(_0x42ca1c){if(_0x42ca1c){return _0x12034b[_0x2a19('0x13')](_0x296ede);}return _0x12034b[_0x2a19('0x14')](_0x296ede)[_0x2a19('0x15')]();};}function respondWithResult(_0x234116,_0x390710){_0x390710=_0x390710||0xc8;return function(_0x1467ce){if(_0x1467ce){return _0x234116[_0x2a19('0x14')](_0x390710)[_0x2a19('0x16')](_0x1467ce);}};}function respondWithFilteredResult(_0x47d5e0,_0x284c57){return function(_0x260437){if(_0x260437){var _0x4c88bc=typeof _0x284c57[_0x2a19('0x17')]===_0x2a19('0x18')&&typeof _0x284c57[_0x2a19('0x19')]==='undefined';var _0x307d10=_0x260437['count'];var _0x349104=_0x4c88bc?0x0:_0x284c57[_0x2a19('0x17')];var _0x4acd6b=_0x4c88bc?_0x260437[_0x2a19('0x1a')]:_0x284c57['offset']+_0x284c57[_0x2a19('0x19')];var _0x3ea2f5;if(_0x4acd6b>=_0x307d10){_0x4acd6b=_0x307d10;_0x3ea2f5=0xc8;}else{_0x3ea2f5=0xce;}_0x47d5e0[_0x2a19('0x14')](_0x3ea2f5);return _0x47d5e0[_0x2a19('0x1b')](_0x2a19('0x1c'),_0x349104+'-'+_0x4acd6b+'/'+_0x307d10)[_0x2a19('0x16')](_0x260437);}return null;};}function patchUpdates(_0x928d47){return function(_0x19fbb1){try{jsonpatch[_0x2a19('0x1d')](_0x19fbb1,_0x928d47,!![]);}catch(_0x5eb3ce){return BPromise[_0x2a19('0x1e')](_0x5eb3ce);}return _0x19fbb1[_0x2a19('0x1f')]();};}function saveUpdates(_0x548c61,_0x207264){return function(_0x2605fd){if(_0x2605fd){return _0x2605fd[_0x2a19('0x20')](_0x548c61)[_0x2a19('0x21')](function(_0x23c345){return _0x23c345;});}return null;};}function removeEntity(_0x33b7d,_0x348e46){return function(_0x363e4f){if(_0x363e4f){return _0x363e4f['destroy']()['then'](function(){_0x33b7d['status'](0xcc)[_0x2a19('0x15')]();});}};}function handleEntityNotFound(_0x13682d,_0x4b8aea){return function(_0x461b8a){if(!_0x461b8a){_0x13682d[_0x2a19('0x13')](0x194);}return _0x461b8a;};}function handleError(_0xb8d745,_0xd7f9a4){_0xd7f9a4=_0xd7f9a4||0x1f4;return function(_0x25c26d){logger[_0x2a19('0x22')](_0x25c26d[_0x2a19('0x23')]);if(_0x25c26d[_0x2a19('0x24')]){delete _0x25c26d[_0x2a19('0x24')];}_0xb8d745[_0x2a19('0x14')](_0xd7f9a4)[_0x2a19('0x25')](_0x25c26d);};}exports['index']=function(_0x3dc47b,_0x38a49e){var _0xe07320={},_0xb360e5={},_0x5a2633={'count':0x0,'rows':[]};var _0x44c0b6=_[_0x2a19('0x26')](db[_0x2a19('0x27')][_0x2a19('0x28')],function(_0x3e28f1){return{'name':_0x3e28f1['fieldName'],'type':_0x3e28f1['type']['key']};});_0xb360e5[_0x2a19('0x29')]=_[_0x2a19('0x26')](_0x44c0b6,_0x2a19('0x24'));_0xb360e5[_0x2a19('0x2a')]=_[_0x2a19('0x2b')](_0x3dc47b[_0x2a19('0x2a')]);_0xb360e5['filters']=_['intersection'](_0xb360e5['model'],_0xb360e5[_0x2a19('0x2a')]);_0xe07320[_0x2a19('0x2c')]=_[_0x2a19('0x2d')](_0xb360e5[_0x2a19('0x29')],qs[_0x2a19('0x2e')](_0x3dc47b['query'][_0x2a19('0x2e')]));_0xe07320['attributes']=_0xe07320[_0x2a19('0x2c')][_0x2a19('0x2f')]?_0xe07320['attributes']:_0xb360e5['model'];if(!_0x3dc47b['query']['hasOwnProperty'](_0x2a19('0x30'))){_0xe07320[_0x2a19('0x19')]=qs['limit'](_0x3dc47b['query'][_0x2a19('0x19')]);_0xe07320[_0x2a19('0x17')]=qs['offset'](_0x3dc47b['query'][_0x2a19('0x17')]);}_0xe07320[_0x2a19('0x31')]=qs[_0x2a19('0x32')](_0x3dc47b[_0x2a19('0x2a')][_0x2a19('0x32')]);_0xe07320['where']=qs[_0x2a19('0x33')](_['pick'](_0x3dc47b[_0x2a19('0x2a')],_0xb360e5['filters']),_0x44c0b6);if(_0x3dc47b['query'][_0x2a19('0x34')]){_0xe07320[_0x2a19('0x35')]=_['merge'](_0xe07320[_0x2a19('0x35')],{'$or':_['map'](_0x44c0b6,function(_0x3d95ed){if(_0x3d95ed[_0x2a19('0x36')]!==_0x2a19('0x37')){var _0x5643e8={};_0x5643e8[_0x3d95ed[_0x2a19('0x24')]]={'$like':'%'+_0x3dc47b['query'][_0x2a19('0x34')]+'%'};return _0x5643e8;}})});}_0xe07320=_[_0x2a19('0x38')]({},_0xe07320,_0x3dc47b['options']);var _0xe858bf={'where':_0xe07320[_0x2a19('0x35')]};return db[_0x2a19('0x27')]['count'](_0xe858bf)['then'](function(_0x3dc98f){_0x5a2633[_0x2a19('0x1a')]=_0x3dc98f;if(_0x3dc47b[_0x2a19('0x2a')][_0x2a19('0x39')]){_0xe07320['include']=[{'all':!![]}];}return db['SquareReport'][_0x2a19('0x3a')](_0xe07320);})[_0x2a19('0x21')](function(_0x22081d){_0x5a2633[_0x2a19('0x3b')]=_0x22081d;return _0x5a2633;})[_0x2a19('0x21')](respondWithFilteredResult(_0x38a49e,_0xe07320))[_0x2a19('0x3c')](handleError(_0x38a49e,null));};exports[_0x2a19('0x3d')]=function(_0x4ab61f,_0x31fa22){var _0x442572={'raw':!![],'where':{'id':_0x4ab61f[_0x2a19('0x3e')]['id']}},_0x2206b3={};_0x2206b3[_0x2a19('0x29')]=_[_0x2a19('0x2b')](db[_0x2a19('0x27')][_0x2a19('0x28')]);_0x2206b3[_0x2a19('0x2a')]=_[_0x2a19('0x2b')](_0x4ab61f[_0x2a19('0x2a')]);_0x2206b3[_0x2a19('0x33')]=_[_0x2a19('0x2d')](_0x2206b3[_0x2a19('0x29')],_0x2206b3[_0x2a19('0x2a')]);_0x442572[_0x2a19('0x2c')]=_[_0x2a19('0x2d')](_0x2206b3[_0x2a19('0x29')],qs[_0x2a19('0x2e')](_0x4ab61f[_0x2a19('0x2a')][_0x2a19('0x2e')]));_0x442572[_0x2a19('0x2c')]=_0x442572[_0x2a19('0x2c')]['length']?_0x442572[_0x2a19('0x2c')]:_0x2206b3[_0x2a19('0x29')];if(_0x4ab61f[_0x2a19('0x2a')]['includeAll']){_0x442572[_0x2a19('0x3f')]=[{'all':!![]}];}_0x442572=_[_0x2a19('0x38')]({},_0x442572,_0x4ab61f[_0x2a19('0x40')]);return db[_0x2a19('0x27')]['find'](_0x442572)[_0x2a19('0x21')](handleEntityNotFound(_0x31fa22,null))[_0x2a19('0x21')](respondWithResult(_0x31fa22,null))[_0x2a19('0x3c')](handleError(_0x31fa22,null));};exports[_0x2a19('0x41')]=function(_0x4cf73b,_0x97572e){return db[_0x2a19('0x27')][_0x2a19('0x41')](_0x4cf73b['body'],{})[_0x2a19('0x21')](respondWithResult(_0x97572e,0xc9))[_0x2a19('0x3c')](handleError(_0x97572e,null));};exports[_0x2a19('0x20')]=function(_0x1343de,_0x3ebaed){if(_0x1343de[_0x2a19('0x42')]['id']){delete _0x1343de['body']['id'];}return db['SquareReport'][_0x2a19('0x43')]({'where':{'id':_0x1343de['params']['id']}})[_0x2a19('0x21')](handleEntityNotFound(_0x3ebaed,null))[_0x2a19('0x21')](saveUpdates(_0x1343de[_0x2a19('0x42')],null))[_0x2a19('0x21')](respondWithResult(_0x3ebaed,null))[_0x2a19('0x3c')](handleError(_0x3ebaed,null));};exports[_0x2a19('0x44')]=function(_0x5ec422,_0x3e38cc){return db[_0x2a19('0x27')][_0x2a19('0x43')]({'where':{'id':_0x5ec422[_0x2a19('0x3e')]['id']}})[_0x2a19('0x21')](handleEntityNotFound(_0x3e38cc,null))[_0x2a19('0x21')](removeEntity(_0x3e38cc,null))[_0x2a19('0x3c')](handleError(_0x3e38cc,null));};exports[_0x2a19('0x45')]=function(_0x4785b7,_0x5d668f){return db[_0x2a19('0x27')][_0x2a19('0x45')]()['then'](respondWithResult(_0x5d668f,null))[_0x2a19('0x3c')](handleError(_0x5d668f,null));}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.model.js b/server/api/squareReport/squareReport.model.js index a51cb2f..a4d85cd 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 _0xe7f2=['api','moment','bluebird','request-promise','../../config/environment','./squareReport.attributes','define','SquareReport','report_square','uniqueid','project_name','leaveAt','util','../../config/logger'];(function(_0x124bf2,_0x1e0919){var _0x197fc2=function(_0x4b41fd){while(--_0x4b41fd){_0x124bf2['push'](_0x124bf2['shift']());}};_0x197fc2(++_0x1e0919);}(_0xe7f2,0x16a));var _0x2e7f=function(_0x36b6bc,_0x8e6775){_0x36b6bc=_0x36b6bc-0x0;var _0x36ae0c=_0xe7f2[_0x36b6bc];return _0x36ae0c;};'use strict';var _=require('lodash');var util=require(_0x2e7f('0x0'));var logger=require(_0x2e7f('0x1'))(_0x2e7f('0x2'));var moment=require(_0x2e7f('0x3'));var BPromise=require(_0x2e7f('0x4'));var rp=require(_0x2e7f('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x2e7f('0x6'));var attributes=require(_0x2e7f('0x7'));module['exports']=function(_0x7cfef8,_0x2762db){return _0x7cfef8[_0x2e7f('0x8')](_0x2e7f('0x9'),attributes,{'tableName':_0x2e7f('0xa'),'paranoid':![],'indexes':[{'name':'uid_pname','fields':[_0x2e7f('0xb'),_0x2e7f('0xc')]},{'name':_0x2e7f('0xd'),'fields':[_0x2e7f('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x38dc=['uid_pname','project_name','leaveAt','lodash','util','../../config/logger','api','moment','path','rimraf','../../config/environment','./squareReport.attributes','exports','define','report_square'];(function(_0x3e25c1,_0x1d15f9){var _0x52e7f2=function(_0x597a5a){while(--_0x597a5a){_0x3e25c1['push'](_0x3e25c1['shift']());}};_0x52e7f2(++_0x1d15f9);}(_0x38dc,0x198));var _0xc38d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x38dc[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xc38d('0x0'));var util=require(_0xc38d('0x1'));var logger=require(_0xc38d('0x2'))(_0xc38d('0x3'));var moment=require(_0xc38d('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xc38d('0x5'));var rimraf=require(_0xc38d('0x6'));var config=require(_0xc38d('0x7'));var attributes=require(_0xc38d('0x8'));module[_0xc38d('0x9')]=function(_0x31a104,_0x22a66c){return _0x31a104[_0xc38d('0xa')]('SquareReport',attributes,{'tableName':_0xc38d('0xb'),'paranoid':![],'indexes':[{'name':_0xc38d('0xc'),'fields':['uniqueid',_0xc38d('0xd')]},{'name':'leaveAt','fields':[_0xc38d('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.rpc.js b/server/api/squareReport/squareReport.rpc.js index 73a3e51..8517266 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 _0xcb34=['SquareReport,\x20%s,\x20%s,\x20%s','stringify','error','SquareReport,\x20%s,\x20%s','message','result','catch','CreateSquareReport','SquareReport','create','body','options','raw','where','attributes','limit','UpdateSquareReport','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','http','request','then','info','request\x20sent','debug'];(function(_0x3e5086,_0x48f4a2){var _0xfeb102=function(_0x5a945f){while(--_0x5a945f){_0x3e5086['push'](_0x3e5086['shift']());}};_0xfeb102(++_0x48f4a2);}(_0xcb34,0x71));var _0x4cb3=function(_0x2db12b,_0x30ab1d){_0x2db12b=_0x2db12b-0x0;var _0x20990b=_0xcb34[_0x2db12b];return _0x20990b;};'use strict';var _=require(_0x4cb3('0x0'));var util=require(_0x4cb3('0x1'));var moment=require('moment');var BPromise=require(_0x4cb3('0x2'));var rs=require(_0x4cb3('0x3'));var fs=require('fs');var Redis=require(_0x4cb3('0x4'));var db=require(_0x4cb3('0x5'))['db'];var utils=require(_0x4cb3('0x6'));var logger=require(_0x4cb3('0x7'))(_0x4cb3('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x4cb3('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x105bfc,_0x48b9e7,_0x35a107){return new BPromise(function(_0x5479c8,_0x19230b){return client[_0x4cb3('0xa')](_0x105bfc,_0x35a107)[_0x4cb3('0xb')](function(_0x338a74){logger[_0x4cb3('0xc')]('SquareReport,\x20%s,\x20%s',_0x48b9e7,_0x4cb3('0xd'));logger[_0x4cb3('0xe')](_0x4cb3('0xf'),_0x48b9e7,_0x4cb3('0xd'),JSON[_0x4cb3('0x10')](_0x338a74));if(_0x338a74[_0x4cb3('0x11')]){if(_0x338a74[_0x4cb3('0x11')]['code']===0x1f4){logger['error'](_0x4cb3('0x12'),_0x48b9e7,_0x338a74['error'][_0x4cb3('0x13')]);return _0x19230b(_0x338a74[_0x4cb3('0x11')][_0x4cb3('0x13')]);}logger['error'](_0x4cb3('0x12'),_0x48b9e7,_0x338a74['error'][_0x4cb3('0x13')]);return _0x5479c8(_0x338a74[_0x4cb3('0x11')]['message']);}else{logger['info'](_0x4cb3('0x12'),_0x48b9e7,_0x4cb3('0xd'));_0x5479c8(_0x338a74[_0x4cb3('0x14')][_0x4cb3('0x13')]);}})[_0x4cb3('0x15')](function(_0x59487f){logger['error'](_0x4cb3('0x12'),_0x48b9e7,_0x59487f);_0x19230b(_0x59487f);});});}exports[_0x4cb3('0x16')]=function(_0x4ad8ad){var _0x32220e=this;return new Promise(function(_0x8ac1f,_0x1bade4){return db[_0x4cb3('0x17')][_0x4cb3('0x18')](_0x4ad8ad[_0x4cb3('0x19')],{'raw':_0x4ad8ad[_0x4cb3('0x1a')]?_0x4ad8ad['options'][_0x4cb3('0x1b')]===undefined?!![]:![]:!![]})[_0x4cb3('0xb')](function(_0x396a18){logger[_0x4cb3('0xc')]('CreateSquareReport',_0x4ad8ad);logger[_0x4cb3('0xe')](_0x4cb3('0x16'),_0x4ad8ad,JSON[_0x4cb3('0x10')](_0x396a18));_0x8ac1f(_0x396a18);})[_0x4cb3('0x15')](function(_0x1b5436){logger[_0x4cb3('0x11')](_0x4cb3('0x16'),_0x1b5436['message'],_0x4ad8ad);_0x1bade4(_0x32220e['error'](0x1f4,_0x1b5436['message']));});});};exports['UpdateSquareReport']=function(_0x29cb77){var _0x294423=this;return new Promise(function(_0x5edffe,_0x1aa608){return db[_0x4cb3('0x17')]['update'](_0x29cb77[_0x4cb3('0x19')],{'raw':_0x29cb77[_0x4cb3('0x1a')]?_0x29cb77['options'][_0x4cb3('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x29cb77[_0x4cb3('0x1a')]?_0x29cb77[_0x4cb3('0x1a')][_0x4cb3('0x1c')]||null:null,'attributes':_0x29cb77[_0x4cb3('0x1a')]?_0x29cb77[_0x4cb3('0x1a')][_0x4cb3('0x1d')]||null:null,'limit':_0x29cb77[_0x4cb3('0x1a')]?_0x29cb77[_0x4cb3('0x1a')][_0x4cb3('0x1e')]||null:null})[_0x4cb3('0xb')](function(_0x2f47c3){logger[_0x4cb3('0xc')](_0x4cb3('0x1f'),_0x29cb77);logger[_0x4cb3('0xe')](_0x4cb3('0x1f'),_0x29cb77,JSON[_0x4cb3('0x10')](_0x2f47c3));_0x5edffe(_0x2f47c3);})[_0x4cb3('0x15')](function(_0x5f3491){logger[_0x4cb3('0x11')](_0x4cb3('0x1f'),_0x5f3491['message'],_0x29cb77);_0x1aa608(_0x294423['error'](0x1f4,_0x5f3491[_0x4cb3('0x13')]));});});}; \ No newline at end of file +var _0xfe40=['limit','UpdateSquareReport','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','then','info','SquareReport,\x20%s,\x20%s','request\x20sent','debug','SquareReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','CreateSquareReport','create','body','options','raw','update','where','attributes'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xfe40,0x11a));var _0x0fe4=function(_0x84c526,_0x399932){_0x84c526=_0x84c526-0x0;var _0x383caf=_0xfe40[_0x84c526];return _0x383caf;};'use strict';var _=require(_0x0fe4('0x0'));var util=require(_0x0fe4('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x0fe4('0x2'));var fs=require('fs');var Redis=require(_0x0fe4('0x3'));var db=require(_0x0fe4('0x4'))['db'];var utils=require(_0x0fe4('0x5'));var logger=require(_0x0fe4('0x6'))('rpc');var config=require(_0x0fe4('0x7'));var jayson=require(_0x0fe4('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3e3116,_0x17de1e,_0x2bbbe6){return new BPromise(function(_0x2bf85b,_0xff9a34){return client[_0x0fe4('0x9')](_0x3e3116,_0x2bbbe6)[_0x0fe4('0xa')](function(_0x373e08){logger[_0x0fe4('0xb')](_0x0fe4('0xc'),_0x17de1e,_0x0fe4('0xd'));logger[_0x0fe4('0xe')](_0x0fe4('0xf'),_0x17de1e,_0x0fe4('0xd'),JSON[_0x0fe4('0x10')](_0x373e08));if(_0x373e08[_0x0fe4('0x11')]){if(_0x373e08[_0x0fe4('0x11')]['code']===0x1f4){logger[_0x0fe4('0x11')](_0x0fe4('0xc'),_0x17de1e,_0x373e08[_0x0fe4('0x11')]['message']);return _0xff9a34(_0x373e08[_0x0fe4('0x11')][_0x0fe4('0x12')]);}logger['error'](_0x0fe4('0xc'),_0x17de1e,_0x373e08[_0x0fe4('0x11')][_0x0fe4('0x12')]);return _0x2bf85b(_0x373e08[_0x0fe4('0x11')][_0x0fe4('0x12')]);}else{logger[_0x0fe4('0xb')](_0x0fe4('0xc'),_0x17de1e,_0x0fe4('0xd'));_0x2bf85b(_0x373e08[_0x0fe4('0x13')][_0x0fe4('0x12')]);}})['catch'](function(_0xbb5784){logger[_0x0fe4('0x11')](_0x0fe4('0xc'),_0x17de1e,_0xbb5784);_0xff9a34(_0xbb5784);});});}exports[_0x0fe4('0x14')]=function(_0x5c6793){var _0x3cbe17=this;return new Promise(function(_0x10baf4,_0x26b2ac){return db['SquareReport'][_0x0fe4('0x15')](_0x5c6793[_0x0fe4('0x16')],{'raw':_0x5c6793[_0x0fe4('0x17')]?_0x5c6793[_0x0fe4('0x17')][_0x0fe4('0x18')]===undefined?!![]:![]:!![]})['then'](function(_0x2dcdb8){logger[_0x0fe4('0xb')](_0x0fe4('0x14'),_0x5c6793);logger[_0x0fe4('0xe')](_0x0fe4('0x14'),_0x5c6793,JSON[_0x0fe4('0x10')](_0x2dcdb8));_0x10baf4(_0x2dcdb8);})['catch'](function(_0x45c483){logger[_0x0fe4('0x11')]('CreateSquareReport',_0x45c483['message'],_0x5c6793);_0x26b2ac(_0x3cbe17[_0x0fe4('0x11')](0x1f4,_0x45c483[_0x0fe4('0x12')]));});});};exports['UpdateSquareReport']=function(_0x40020a){var _0x2c1d99=this;return new Promise(function(_0xf0bfc0,_0x32d572){return db['SquareReport'][_0x0fe4('0x19')](_0x40020a[_0x0fe4('0x16')],{'raw':_0x40020a[_0x0fe4('0x17')]?_0x40020a[_0x0fe4('0x17')][_0x0fe4('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x40020a[_0x0fe4('0x17')]?_0x40020a['options'][_0x0fe4('0x1a')]||null:null,'attributes':_0x40020a[_0x0fe4('0x17')]?_0x40020a[_0x0fe4('0x17')][_0x0fe4('0x1b')]||null:null,'limit':_0x40020a[_0x0fe4('0x17')]?_0x40020a['options'][_0x0fe4('0x1c')]||null:null})['then'](function(_0x38071f){logger['info']('UpdateSquareReport',_0x40020a);logger[_0x0fe4('0xe')](_0x0fe4('0x1d'),_0x40020a,JSON[_0x0fe4('0x10')](_0x38071f));_0xf0bfc0(_0x38071f);})[_0x0fe4('0x1e')](function(_0x5e0468){logger['error'](_0x0fe4('0x1d'),_0x5e0468[_0x0fe4('0x12')],_0x40020a);_0x32d572(_0x2c1d99[_0x0fe4('0x11')](0x1f4,_0x5e0468[_0x0fe4('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/squareReportDetail/index.js b/server/api/squareReportDetail/index.js index 9f45f7b..b7b7c26 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 _0x6937=['update','delete','/:id','destroy','multer','util','path','connect-timeout','express','Router','../../config/environment','get','/describe','isAuthenticated','describe','show','post','create','put'];(function(_0x1b8d36,_0x380eeb){var _0x29c55f=function(_0x4a89a2){while(--_0x4a89a2){_0x1b8d36['push'](_0x1b8d36['shift']());}};_0x29c55f(++_0x380eeb);}(_0x6937,0xaf));var _0x7693=function(_0x374785,_0x4f71b8){_0x374785=_0x374785-0x0;var _0x572c40=_0x6937[_0x374785];return _0x572c40;};'use strict';var multer=require(_0x7693('0x0'));var util=require(_0x7693('0x1'));var path=require(_0x7693('0x2'));var timeout=require(_0x7693('0x3'));var express=require(_0x7693('0x4'));var router=express[_0x7693('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x7693('0x6'));var controller=require('./squareReportDetail.controller');router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x7693('0x7')](_0x7693('0x8'),auth[_0x7693('0x9')](),controller[_0x7693('0xa')]);router[_0x7693('0x7')]('/:id',auth[_0x7693('0x9')](),controller[_0x7693('0xb')]);router[_0x7693('0xc')]('/',auth[_0x7693('0x9')](),controller[_0x7693('0xd')]);router[_0x7693('0xe')]('/:id',auth[_0x7693('0x9')](),controller[_0x7693('0xf')]);router[_0x7693('0x10')](_0x7693('0x11'),auth[_0x7693('0x9')](),controller[_0x7693('0x12')]);module['exports']=router; \ No newline at end of file +var _0x55ec=['update','destroy','exports','multer','util','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareReportDetail.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x55ec,0x192));var _0xc55e=function(_0x4b7b62,_0x4920a9){_0x4b7b62=_0x4b7b62-0x0;var _0x2280df=_0x55ec[_0x4b7b62];return _0x2280df;};'use strict';var multer=require(_0xc55e('0x0'));var util=require(_0xc55e('0x1'));var path=require('path');var timeout=require(_0xc55e('0x2'));var express=require('express');var router=express[_0xc55e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xc55e('0x4'));var interaction=require(_0xc55e('0x5'));var config=require(_0xc55e('0x6'));var controller=require(_0xc55e('0x7'));router[_0xc55e('0x8')]('/',auth[_0xc55e('0x9')](),controller[_0xc55e('0xa')]);router[_0xc55e('0x8')](_0xc55e('0xb'),auth[_0xc55e('0x9')](),controller[_0xc55e('0xc')]);router[_0xc55e('0x8')](_0xc55e('0xd'),auth[_0xc55e('0x9')](),controller[_0xc55e('0xe')]);router[_0xc55e('0xf')]('/',auth[_0xc55e('0x9')](),controller[_0xc55e('0x10')]);router[_0xc55e('0x11')](_0xc55e('0xd'),auth['isAuthenticated'](),controller[_0xc55e('0x12')]);router['delete'](_0xc55e('0xd'),auth['isAuthenticated'](),controller[_0xc55e('0x13')]);module[_0xc55e('0x14')]=router; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.attributes.js b/server/api/squareReportDetail/squareReportDetail.attributes.js index 991beff..0fd7922 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 _0x8d29=['sequelize','exports','STRING','TEXT'];(function(_0x5476b6,_0x3327e7){var _0x23ff39=function(_0x5bca05){while(--_0x5bca05){_0x5476b6['push'](_0x5476b6['shift']());}};_0x23ff39(++_0x3327e7);}(_0x8d29,0x130));var _0x98d2=function(_0x7c4871,_0x3de904){_0x7c4871=_0x7c4871-0x0;var _0x255513=_0x8d29[_0x7c4871];return _0x255513;};'use strict';var Sequelize=require(_0x98d2('0x0'));module[_0x98d2('0x1')]={'uniqueid':{'type':Sequelize['STRING']},'node':{'type':Sequelize[_0x98d2('0x2')]},'application':{'type':Sequelize[_0x98d2('0x2')]},'data':{'type':Sequelize[_0x98d2('0x3')]},'project_name':{'type':Sequelize[_0x98d2('0x2')]},'callerid':{'type':Sequelize[_0x98d2('0x2')]}}; \ No newline at end of file +var _0xa71a=['sequelize','STRING','TEXT'];(function(_0x1612d6,_0x5577bf){var _0x27a583=function(_0x3dc4a2){while(--_0x3dc4a2){_0x1612d6['push'](_0x1612d6['shift']());}};_0x27a583(++_0x5577bf);}(_0xa71a,0x1bf));var _0xaa71=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xa71a[_0x2641f9];return _0x585741;};'use strict';var Sequelize=require(_0xaa71('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0xaa71('0x1')]},'node':{'type':Sequelize['STRING']},'application':{'type':Sequelize['STRING']},'data':{'type':Sequelize[_0xaa71('0x2')]},'project_name':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0xaa71('0x1')]}}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.controller.js b/server/api/squareReportDetail/squareReportDetail.controller.js index 1210021..b5a7499 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 _0xcd00=['stack','name','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','offset','order','where','merge','filter','options','SquareDetailsReport','include','findAll','rows','catch','show','create','body','find','params','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','../../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','undefined','count','limit','set','apply','reject','save','update','destroy','then'];(function(_0x44508f,_0x3d2edc){var _0x3cc7b9=function(_0x362c76){while(--_0x362c76){_0x44508f['push'](_0x44508f['shift']());}};_0x3cc7b9(++_0x3d2edc);}(_0xcd00,0xf2));var _0x0cd0=function(_0x209941,_0x5c9988){_0x209941=_0x209941-0x0;var _0x1e8729=_0xcd00[_0x209941];return _0x1e8729;};'use strict';var emlformat=require(_0x0cd0('0x0'));var rimraf=require(_0x0cd0('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0cd0('0x2'));var rp=require(_0x0cd0('0x3'));var moment=require(_0x0cd0('0x4'));var BPromise=require(_0x0cd0('0x5'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x0cd0('0x6'));var ejs=require(_0x0cd0('0x7'));var fs=require('fs');var fs_extra=require(_0x0cd0('0x8'));var _=require(_0x0cd0('0x9'));var squel=require(_0x0cd0('0xa'));var crypto=require(_0x0cd0('0xb'));var jsforce=require(_0x0cd0('0xc'));var deskjs=require(_0x0cd0('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0cd0('0xe'));var Redis=require('ioredis');var authService=require(_0x0cd0('0xf'));var qs=require(_0x0cd0('0x10'));var as=require(_0x0cd0('0x11'));var hardwareService=require(_0x0cd0('0x12'));var logger=require(_0x0cd0('0x13'))('api');var utils=require(_0x0cd0('0x14'));var config=require(_0x0cd0('0x15'));var licenseUtil=require(_0x0cd0('0x16'));var db=require(_0x0cd0('0x17'))['db'];function respondWithStatusCode(_0x13090f,_0x5464bc){_0x5464bc=_0x5464bc||0xcc;return function(_0x4ef8b2){if(_0x4ef8b2){return _0x13090f[_0x0cd0('0x18')](_0x5464bc);}return _0x13090f[_0x0cd0('0x19')](_0x5464bc)[_0x0cd0('0x1a')]();};}function respondWithResult(_0x26fb5c,_0x3ebeb0){_0x3ebeb0=_0x3ebeb0||0xc8;return function(_0x4ed9ae){if(_0x4ed9ae){return _0x26fb5c['status'](_0x3ebeb0)[_0x0cd0('0x1b')](_0x4ed9ae);}};}function respondWithFilteredResult(_0x3e8955,_0x110018){return function(_0x3e82eb){if(_0x3e82eb){var _0x23c73e=typeof _0x110018['offset']==='undefined'&&typeof _0x110018['limit']===_0x0cd0('0x1c');var _0x58d3b6=_0x3e82eb['count'];var _0x74794f=_0x23c73e?0x0:_0x110018['offset'];var _0x5e5434=_0x23c73e?_0x3e82eb[_0x0cd0('0x1d')]:_0x110018['offset']+_0x110018[_0x0cd0('0x1e')];var _0x2270ff;if(_0x5e5434>=_0x58d3b6){_0x5e5434=_0x58d3b6;_0x2270ff=0xc8;}else{_0x2270ff=0xce;}_0x3e8955['status'](_0x2270ff);return _0x3e8955[_0x0cd0('0x1f')]('Content-Range',_0x74794f+'-'+_0x5e5434+'/'+_0x58d3b6)[_0x0cd0('0x1b')](_0x3e82eb);}return null;};}function patchUpdates(_0x1f29ed){return function(_0x200f00){try{jsonpatch[_0x0cd0('0x20')](_0x200f00,_0x1f29ed,!![]);}catch(_0x5b96cc){return BPromise[_0x0cd0('0x21')](_0x5b96cc);}return _0x200f00[_0x0cd0('0x22')]();};}function saveUpdates(_0x277703,_0x1d5892){return function(_0x534b11){if(_0x534b11){return _0x534b11[_0x0cd0('0x23')](_0x277703)['then'](function(_0x1a4c50){return _0x1a4c50;});}return null;};}function removeEntity(_0x23ef8e,_0x27e9f4){return function(_0x5b41d2){if(_0x5b41d2){return _0x5b41d2[_0x0cd0('0x24')]()[_0x0cd0('0x25')](function(){_0x23ef8e[_0x0cd0('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x453256,_0x59bf8a){return function(_0x159183){if(!_0x159183){_0x453256[_0x0cd0('0x18')](0x194);}return _0x159183;};}function handleError(_0x332996,_0x4b6582){_0x4b6582=_0x4b6582||0x1f4;return function(_0x4183a2){logger['error'](_0x4183a2[_0x0cd0('0x26')]);if(_0x4183a2[_0x0cd0('0x27')]){delete _0x4183a2[_0x0cd0('0x27')];}_0x332996[_0x0cd0('0x19')](_0x4b6582)['send'](_0x4183a2);};}exports['index']=function(_0x4096fc,_0x4b87e8){var _0x18f8c1={},_0x539d9f={},_0x1e29a1={'count':0x0,'rows':[]};var _0x586a7e=_['map'](db['SquareDetailsReport']['rawAttributes'],function(_0x59a887){return{'name':_0x59a887[_0x0cd0('0x28')],'type':_0x59a887[_0x0cd0('0x29')][_0x0cd0('0x2a')]};});_0x539d9f[_0x0cd0('0x2b')]=_[_0x0cd0('0x2c')](_0x586a7e,_0x0cd0('0x27'));_0x539d9f[_0x0cd0('0x2d')]=_[_0x0cd0('0x2e')](_0x4096fc[_0x0cd0('0x2d')]);_0x539d9f[_0x0cd0('0x2f')]=_[_0x0cd0('0x30')](_0x539d9f[_0x0cd0('0x2b')],_0x539d9f[_0x0cd0('0x2d')]);_0x18f8c1[_0x0cd0('0x31')]=_[_0x0cd0('0x30')](_0x539d9f[_0x0cd0('0x2b')],qs[_0x0cd0('0x32')](_0x4096fc['query'][_0x0cd0('0x32')]));_0x18f8c1[_0x0cd0('0x31')]=_0x18f8c1[_0x0cd0('0x31')][_0x0cd0('0x33')]?_0x18f8c1['attributes']:_0x539d9f['model'];if(!_0x4096fc[_0x0cd0('0x2d')][_0x0cd0('0x34')]('nolimit')){_0x18f8c1[_0x0cd0('0x1e')]=qs[_0x0cd0('0x1e')](_0x4096fc[_0x0cd0('0x2d')][_0x0cd0('0x1e')]);_0x18f8c1[_0x0cd0('0x35')]=qs[_0x0cd0('0x35')](_0x4096fc['query'][_0x0cd0('0x35')]);}_0x18f8c1[_0x0cd0('0x36')]=qs['sort'](_0x4096fc['query']['sort']);_0x18f8c1[_0x0cd0('0x37')]=qs['filters'](_['pick'](_0x4096fc['query'],_0x539d9f[_0x0cd0('0x2f')]),_0x586a7e);if(_0x4096fc[_0x0cd0('0x2d')]['filter']){_0x18f8c1[_0x0cd0('0x37')]=_[_0x0cd0('0x38')](_0x18f8c1[_0x0cd0('0x37')],{'$or':_['map'](_0x586a7e,function(_0x448bb5){if(_0x448bb5[_0x0cd0('0x29')]!=='VIRTUAL'){var _0x4128b9={};_0x4128b9[_0x448bb5['name']]={'$like':'%'+_0x4096fc[_0x0cd0('0x2d')][_0x0cd0('0x39')]+'%'};return _0x4128b9;}})});}_0x18f8c1=_[_0x0cd0('0x38')]({},_0x18f8c1,_0x4096fc[_0x0cd0('0x3a')]);var _0x42e933={'where':_0x18f8c1[_0x0cd0('0x37')]};return db[_0x0cd0('0x3b')][_0x0cd0('0x1d')](_0x42e933)['then'](function(_0x43c7ea){_0x1e29a1[_0x0cd0('0x1d')]=_0x43c7ea;if(_0x4096fc[_0x0cd0('0x2d')]['includeAll']){_0x18f8c1[_0x0cd0('0x3c')]=[{'all':!![]}];}return db[_0x0cd0('0x3b')][_0x0cd0('0x3d')](_0x18f8c1);})[_0x0cd0('0x25')](function(_0x177745){_0x1e29a1[_0x0cd0('0x3e')]=_0x177745;return _0x1e29a1;})['then'](respondWithFilteredResult(_0x4b87e8,_0x18f8c1))[_0x0cd0('0x3f')](handleError(_0x4b87e8,null));};exports[_0x0cd0('0x40')]=function(_0x1091e6,_0x586f8e){var _0x3823d6={'raw':!![],'where':{'id':_0x1091e6['params']['id']}},_0x37bf9f={};_0x37bf9f[_0x0cd0('0x2b')]=_[_0x0cd0('0x2e')](db['SquareDetailsReport']['rawAttributes']);_0x37bf9f[_0x0cd0('0x2d')]=_[_0x0cd0('0x2e')](_0x1091e6[_0x0cd0('0x2d')]);_0x37bf9f[_0x0cd0('0x2f')]=_[_0x0cd0('0x30')](_0x37bf9f[_0x0cd0('0x2b')],_0x37bf9f[_0x0cd0('0x2d')]);_0x3823d6['attributes']=_[_0x0cd0('0x30')](_0x37bf9f[_0x0cd0('0x2b')],qs['fields'](_0x1091e6[_0x0cd0('0x2d')][_0x0cd0('0x32')]));_0x3823d6[_0x0cd0('0x31')]=_0x3823d6[_0x0cd0('0x31')]['length']?_0x3823d6[_0x0cd0('0x31')]:_0x37bf9f[_0x0cd0('0x2b')];if(_0x1091e6[_0x0cd0('0x2d')]['includeAll']){_0x3823d6[_0x0cd0('0x3c')]=[{'all':!![]}];}_0x3823d6=_[_0x0cd0('0x38')]({},_0x3823d6,_0x1091e6[_0x0cd0('0x3a')]);return db[_0x0cd0('0x3b')]['find'](_0x3823d6)['then'](handleEntityNotFound(_0x586f8e,null))[_0x0cd0('0x25')](respondWithResult(_0x586f8e,null))[_0x0cd0('0x3f')](handleError(_0x586f8e,null));};exports[_0x0cd0('0x41')]=function(_0x1d1ffb,_0x1ec5d3){return db[_0x0cd0('0x3b')]['create'](_0x1d1ffb[_0x0cd0('0x42')],{})[_0x0cd0('0x25')](respondWithResult(_0x1ec5d3,0xc9))['catch'](handleError(_0x1ec5d3,null));};exports[_0x0cd0('0x23')]=function(_0x447998,_0x39b0ac){if(_0x447998[_0x0cd0('0x42')]['id']){delete _0x447998[_0x0cd0('0x42')]['id'];}return db[_0x0cd0('0x3b')][_0x0cd0('0x43')]({'where':{'id':_0x447998[_0x0cd0('0x44')]['id']}})[_0x0cd0('0x25')](handleEntityNotFound(_0x39b0ac,null))[_0x0cd0('0x25')](saveUpdates(_0x447998[_0x0cd0('0x42')],null))[_0x0cd0('0x25')](respondWithResult(_0x39b0ac,null))['catch'](handleError(_0x39b0ac,null));};exports[_0x0cd0('0x24')]=function(_0xde2971,_0x3c2170){return db[_0x0cd0('0x3b')][_0x0cd0('0x43')]({'where':{'id':_0xde2971['params']['id']}})['then'](handleEntityNotFound(_0x3c2170,null))[_0x0cd0('0x25')](removeEntity(_0x3c2170,null))['catch'](handleError(_0x3c2170,null));};exports[_0x0cd0('0x45')]=function(_0x2e68b4,_0x17622c){return db[_0x0cd0('0x3b')]['describe']()[_0x0cd0('0x25')](respondWithResult(_0x17622c,null))[_0x0cd0('0x3f')](handleError(_0x17622c,null));}; \ No newline at end of file +var _0x90bc=['index','map','SquareDetailsReport','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','findAll','catch','show','params','include','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','limit','count','set','Content-Range','json','apply','reject','update','then','destroy','stack','name','send'];(function(_0x49d19d,_0x245cf5){var _0x4ebef1=function(_0xf0a4e6){while(--_0xf0a4e6){_0x49d19d['push'](_0x49d19d['shift']());}};_0x4ebef1(++_0x245cf5);}(_0x90bc,0x1a3));var _0xc90b=function(_0xb1c395,_0x33e77e){_0xb1c395=_0xb1c395-0x0;var _0x53f005=_0x90bc[_0xb1c395];return _0x53f005;};'use strict';var emlformat=require(_0xc90b('0x0'));var rimraf=require(_0xc90b('0x1'));var zipdir=require(_0xc90b('0x2'));var jsonpatch=require(_0xc90b('0x3'));var rp=require(_0xc90b('0x4'));var moment=require(_0xc90b('0x5'));var BPromise=require(_0xc90b('0x6'));var Mustache=require(_0xc90b('0x7'));var util=require('util');var path=require(_0xc90b('0x8'));var sox=require(_0xc90b('0x9'));var csv=require(_0xc90b('0xa'));var ejs=require(_0xc90b('0xb'));var fs=require('fs');var fs_extra=require(_0xc90b('0xc'));var _=require(_0xc90b('0xd'));var squel=require('squel');var crypto=require(_0xc90b('0xe'));var jsforce=require(_0xc90b('0xf'));var deskjs=require(_0xc90b('0x10'));var toCsv=require(_0xc90b('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xc90b('0x11'));var qs=require(_0xc90b('0x12'));var as=require(_0xc90b('0x13'));var hardwareService=require(_0xc90b('0x14'));var logger=require(_0xc90b('0x15'))(_0xc90b('0x16'));var utils=require('../../config/utils');var config=require(_0xc90b('0x17'));var licenseUtil=require(_0xc90b('0x18'));var db=require(_0xc90b('0x19'))['db'];function respondWithStatusCode(_0xfb708c,_0x5761f7){_0x5761f7=_0x5761f7||0xcc;return function(_0x37bb02){if(_0x37bb02){return _0xfb708c[_0xc90b('0x1a')](_0x5761f7);}return _0xfb708c[_0xc90b('0x1b')](_0x5761f7)[_0xc90b('0x1c')]();};}function respondWithResult(_0x5774a4,_0x7611ad){_0x7611ad=_0x7611ad||0xc8;return function(_0x219808){if(_0x219808){return _0x5774a4[_0xc90b('0x1b')](_0x7611ad)['json'](_0x219808);}};}function respondWithFilteredResult(_0x1236de,_0x350109){return function(_0x548156){if(_0x548156){var _0x388794=typeof _0x350109[_0xc90b('0x1d')]==='undefined'&&typeof _0x350109[_0xc90b('0x1e')]==='undefined';var _0x3d3d40=_0x548156[_0xc90b('0x1f')];var _0x11b640=_0x388794?0x0:_0x350109[_0xc90b('0x1d')];var _0x29917c=_0x388794?_0x548156[_0xc90b('0x1f')]:_0x350109[_0xc90b('0x1d')]+_0x350109[_0xc90b('0x1e')];var _0x1a7488;if(_0x29917c>=_0x3d3d40){_0x29917c=_0x3d3d40;_0x1a7488=0xc8;}else{_0x1a7488=0xce;}_0x1236de[_0xc90b('0x1b')](_0x1a7488);return _0x1236de[_0xc90b('0x20')](_0xc90b('0x21'),_0x11b640+'-'+_0x29917c+'/'+_0x3d3d40)[_0xc90b('0x22')](_0x548156);}return null;};}function patchUpdates(_0x2c855d){return function(_0x8c2f44){try{jsonpatch[_0xc90b('0x23')](_0x8c2f44,_0x2c855d,!![]);}catch(_0x304545){return BPromise[_0xc90b('0x24')](_0x304545);}return _0x8c2f44['save']();};}function saveUpdates(_0x480377,_0x3fb023){return function(_0x337a23){if(_0x337a23){return _0x337a23[_0xc90b('0x25')](_0x480377)[_0xc90b('0x26')](function(_0xceaffc){return _0xceaffc;});}return null;};}function removeEntity(_0x23a285,_0x7be099){return function(_0x4a2f91){if(_0x4a2f91){return _0x4a2f91[_0xc90b('0x27')]()[_0xc90b('0x26')](function(){_0x23a285[_0xc90b('0x1b')](0xcc)[_0xc90b('0x1c')]();});}};}function handleEntityNotFound(_0xed4949,_0x4fac96){return function(_0x4a5217){if(!_0x4a5217){_0xed4949[_0xc90b('0x1a')](0x194);}return _0x4a5217;};}function handleError(_0xafef24,_0xd3f654){_0xd3f654=_0xd3f654||0x1f4;return function(_0x1d26ef){logger['error'](_0x1d26ef[_0xc90b('0x28')]);if(_0x1d26ef[_0xc90b('0x29')]){delete _0x1d26ef[_0xc90b('0x29')];}_0xafef24[_0xc90b('0x1b')](_0xd3f654)[_0xc90b('0x2a')](_0x1d26ef);};}exports[_0xc90b('0x2b')]=function(_0x4ff4de,_0x1a0868){var _0x5f5c6d={},_0x26cd09={},_0x567eac={'count':0x0,'rows':[]};var _0x402adf=_[_0xc90b('0x2c')](db[_0xc90b('0x2d')][_0xc90b('0x2e')],function(_0x138379){return{'name':_0x138379[_0xc90b('0x2f')],'type':_0x138379[_0xc90b('0x30')][_0xc90b('0x31')]};});_0x26cd09['model']=_['map'](_0x402adf,'name');_0x26cd09[_0xc90b('0x32')]=_[_0xc90b('0x33')](_0x4ff4de[_0xc90b('0x32')]);_0x26cd09[_0xc90b('0x34')]=_[_0xc90b('0x35')](_0x26cd09[_0xc90b('0x36')],_0x26cd09[_0xc90b('0x32')]);_0x5f5c6d[_0xc90b('0x37')]=_[_0xc90b('0x35')](_0x26cd09[_0xc90b('0x36')],qs[_0xc90b('0x38')](_0x4ff4de[_0xc90b('0x32')][_0xc90b('0x38')]));_0x5f5c6d[_0xc90b('0x37')]=_0x5f5c6d[_0xc90b('0x37')][_0xc90b('0x39')]?_0x5f5c6d[_0xc90b('0x37')]:_0x26cd09[_0xc90b('0x36')];if(!_0x4ff4de['query'][_0xc90b('0x3a')](_0xc90b('0x3b'))){_0x5f5c6d[_0xc90b('0x1e')]=qs['limit'](_0x4ff4de['query'][_0xc90b('0x1e')]);_0x5f5c6d[_0xc90b('0x1d')]=qs[_0xc90b('0x1d')](_0x4ff4de[_0xc90b('0x32')]['offset']);}_0x5f5c6d[_0xc90b('0x3c')]=qs[_0xc90b('0x3d')](_0x4ff4de[_0xc90b('0x32')][_0xc90b('0x3d')]);_0x5f5c6d[_0xc90b('0x3e')]=qs[_0xc90b('0x34')](_[_0xc90b('0x3f')](_0x4ff4de[_0xc90b('0x32')],_0x26cd09[_0xc90b('0x34')]),_0x402adf);if(_0x4ff4de[_0xc90b('0x32')][_0xc90b('0x40')]){_0x5f5c6d['where']=_[_0xc90b('0x41')](_0x5f5c6d['where'],{'$or':_[_0xc90b('0x2c')](_0x402adf,function(_0x1f5b2c){if(_0x1f5b2c['type']!=='VIRTUAL'){var _0x54835a={};_0x54835a[_0x1f5b2c[_0xc90b('0x29')]]={'$like':'%'+_0x4ff4de['query'][_0xc90b('0x40')]+'%'};return _0x54835a;}})});}_0x5f5c6d=_[_0xc90b('0x41')]({},_0x5f5c6d,_0x4ff4de[_0xc90b('0x42')]);var _0x5e1b42={'where':_0x5f5c6d[_0xc90b('0x3e')]};return db[_0xc90b('0x2d')][_0xc90b('0x1f')](_0x5e1b42)[_0xc90b('0x26')](function(_0x44693c){_0x567eac[_0xc90b('0x1f')]=_0x44693c;if(_0x4ff4de[_0xc90b('0x32')][_0xc90b('0x43')]){_0x5f5c6d['include']=[{'all':!![]}];}return db['SquareDetailsReport'][_0xc90b('0x44')](_0x5f5c6d);})['then'](function(_0x1fe1fd){_0x567eac['rows']=_0x1fe1fd;return _0x567eac;})[_0xc90b('0x26')](respondWithFilteredResult(_0x1a0868,_0x5f5c6d))[_0xc90b('0x45')](handleError(_0x1a0868,null));};exports[_0xc90b('0x46')]=function(_0x570a5b,_0x449da7){var _0x4961c3={'raw':!![],'where':{'id':_0x570a5b[_0xc90b('0x47')]['id']}},_0x7ffe46={};_0x7ffe46[_0xc90b('0x36')]=_[_0xc90b('0x33')](db[_0xc90b('0x2d')]['rawAttributes']);_0x7ffe46['query']=_[_0xc90b('0x33')](_0x570a5b[_0xc90b('0x32')]);_0x7ffe46['filters']=_[_0xc90b('0x35')](_0x7ffe46[_0xc90b('0x36')],_0x7ffe46[_0xc90b('0x32')]);_0x4961c3['attributes']=_['intersection'](_0x7ffe46[_0xc90b('0x36')],qs[_0xc90b('0x38')](_0x570a5b[_0xc90b('0x32')][_0xc90b('0x38')]));_0x4961c3[_0xc90b('0x37')]=_0x4961c3[_0xc90b('0x37')]['length']?_0x4961c3['attributes']:_0x7ffe46['model'];if(_0x570a5b[_0xc90b('0x32')][_0xc90b('0x43')]){_0x4961c3[_0xc90b('0x48')]=[{'all':!![]}];}_0x4961c3=_[_0xc90b('0x41')]({},_0x4961c3,_0x570a5b[_0xc90b('0x42')]);return db[_0xc90b('0x2d')][_0xc90b('0x49')](_0x4961c3)['then'](handleEntityNotFound(_0x449da7,null))[_0xc90b('0x26')](respondWithResult(_0x449da7,null))[_0xc90b('0x45')](handleError(_0x449da7,null));};exports[_0xc90b('0x4a')]=function(_0x3231ad,_0x2e84a1){return db[_0xc90b('0x2d')][_0xc90b('0x4a')](_0x3231ad[_0xc90b('0x4b')],{})[_0xc90b('0x26')](respondWithResult(_0x2e84a1,0xc9))['catch'](handleError(_0x2e84a1,null));};exports[_0xc90b('0x25')]=function(_0x17bb3d,_0x46a948){if(_0x17bb3d[_0xc90b('0x4b')]['id']){delete _0x17bb3d[_0xc90b('0x4b')]['id'];}return db[_0xc90b('0x2d')][_0xc90b('0x49')]({'where':{'id':_0x17bb3d[_0xc90b('0x47')]['id']}})['then'](handleEntityNotFound(_0x46a948,null))[_0xc90b('0x26')](saveUpdates(_0x17bb3d[_0xc90b('0x4b')],null))['then'](respondWithResult(_0x46a948,null))[_0xc90b('0x45')](handleError(_0x46a948,null));};exports['destroy']=function(_0x3de9b2,_0x3a4439){return db[_0xc90b('0x2d')][_0xc90b('0x49')]({'where':{'id':_0x3de9b2[_0xc90b('0x47')]['id']}})[_0xc90b('0x26')](handleEntityNotFound(_0x3a4439,null))[_0xc90b('0x26')](removeEntity(_0x3a4439,null))[_0xc90b('0x45')](handleError(_0x3a4439,null));};exports[_0xc90b('0x4c')]=function(_0x4835d5,_0x13f9bd){return db[_0xc90b('0x2d')]['describe']()['then'](respondWithResult(_0x13f9bd,null))['catch'](handleError(_0x13f9bd,null));}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.model.js b/server/api/squareReportDetail/squareReportDetail.model.js index 4c0648f..76109a9 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 _0x954f=['bluebird','../../config/environment','./squareReportDetail.attributes','exports','SquareDetailsReport','report_square_details','lodash','util','../../config/logger','api'];(function(_0x142691,_0x281ee4){var _0x7ff861=function(_0x19f6a3){while(--_0x19f6a3){_0x142691['push'](_0x142691['shift']());}};_0x7ff861(++_0x281ee4);}(_0x954f,0x6a));var _0xf954=function(_0xd9ab80,_0x1f1968){_0xd9ab80=_0xd9ab80-0x0;var _0x559fc7=_0x954f[_0xd9ab80];return _0x559fc7;};'use strict';var _=require(_0xf954('0x0'));var util=require(_0xf954('0x1'));var logger=require(_0xf954('0x2'))(_0xf954('0x3'));var moment=require('moment');var BPromise=require(_0xf954('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xf954('0x5'));var attributes=require(_0xf954('0x6'));module[_0xf954('0x7')]=function(_0x14621a,_0x13e1ce){return _0x14621a['define'](_0xf954('0x8'),attributes,{'tableName':_0xf954('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x584a=['path','../../config/environment','./squareReportDetail.attributes','exports','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x5b4610,_0x5408ad){var _0x36822a=function(_0x1a1130){while(--_0x1a1130){_0x5b4610['push'](_0x5b4610['shift']());}};_0x36822a(++_0x5408ad);}(_0x584a,0x72));var _0xa584=function(_0x303862,_0x20b5ab){_0x303862=_0x303862-0x0;var _0xe6f228=_0x584a[_0x303862];return _0xe6f228;};'use strict';var _=require(_0xa584('0x0'));var util=require(_0xa584('0x1'));var logger=require(_0xa584('0x2'))(_0xa584('0x3'));var moment=require(_0xa584('0x4'));var BPromise=require(_0xa584('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa584('0x6'));var rimraf=require('rimraf');var config=require(_0xa584('0x7'));var attributes=require(_0xa584('0x8'));module[_0xa584('0x9')]=function(_0x303995,_0x36d9ba){return _0x303995['define']('SquareDetailsReport',attributes,{'tableName':'report_square_details','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.rpc.js b/server/api/squareReportDetail/squareReportDetail.rpc.js index 5c4e1f8..c1bf240 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 _0x7916=['moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','then','SquareDetailsReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','CreateSquareDetailsReport','SquareDetailsReport','create','body','options','raw','lodash'];(function(_0x441c91,_0xb98613){var _0x3289c4=function(_0xe2a88c){while(--_0xe2a88c){_0x441c91['push'](_0x441c91['shift']());}};_0x3289c4(++_0xb98613);}(_0x7916,0x128));var _0x6791=function(_0x72b8d6,_0x433ad3){_0x72b8d6=_0x72b8d6-0x0;var _0x76e041=_0x7916[_0x72b8d6];return _0x76e041;};'use strict';var _=require(_0x6791('0x0'));var util=require('util');var moment=require(_0x6791('0x1'));var BPromise=require(_0x6791('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6791('0x3'));var db=require(_0x6791('0x4'))['db'];var utils=require(_0x6791('0x5'));var logger=require(_0x6791('0x6'))('rpc');var config=require(_0x6791('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x6791('0x8')][_0x6791('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5ad8c0,_0x8b85ff,_0x5d2118){return new BPromise(function(_0x2b240c,_0x50c563){return client['request'](_0x5ad8c0,_0x5d2118)[_0x6791('0xa')](function(_0x198a64){logger['info'](_0x6791('0xb'),_0x8b85ff,_0x6791('0xc'));logger[_0x6791('0xd')]('SquareDetailsReport,\x20%s,\x20%s,\x20%s',_0x8b85ff,_0x6791('0xc'),JSON[_0x6791('0xe')](_0x198a64));if(_0x198a64[_0x6791('0xf')]){if(_0x198a64[_0x6791('0xf')][_0x6791('0x10')]===0x1f4){logger[_0x6791('0xf')](_0x6791('0xb'),_0x8b85ff,_0x198a64[_0x6791('0xf')][_0x6791('0x11')]);return _0x50c563(_0x198a64[_0x6791('0xf')][_0x6791('0x11')]);}logger['error']('SquareDetailsReport,\x20%s,\x20%s',_0x8b85ff,_0x198a64[_0x6791('0xf')]['message']);return _0x2b240c(_0x198a64[_0x6791('0xf')]['message']);}else{logger[_0x6791('0x12')](_0x6791('0xb'),_0x8b85ff,'request\x20sent');_0x2b240c(_0x198a64[_0x6791('0x13')]['message']);}})[_0x6791('0x14')](function(_0x150d1f){logger['error'](_0x6791('0xb'),_0x8b85ff,_0x150d1f);_0x50c563(_0x150d1f);});});}exports[_0x6791('0x15')]=function(_0x5bec14){var _0x1872f5=this;return new Promise(function(_0x4d8a79,_0xe55dba){return db[_0x6791('0x16')][_0x6791('0x17')](_0x5bec14[_0x6791('0x18')],{'raw':_0x5bec14[_0x6791('0x19')]?_0x5bec14[_0x6791('0x19')][_0x6791('0x1a')]===undefined?!![]:![]:!![]})['then'](function(_0x4a2922){logger[_0x6791('0x12')]('CreateSquareDetailsReport',_0x5bec14);logger[_0x6791('0xd')](_0x6791('0x15'),_0x5bec14,JSON['stringify'](_0x4a2922));_0x4d8a79(_0x4a2922);})[_0x6791('0x14')](function(_0x309610){logger[_0x6791('0xf')](_0x6791('0x15'),_0x309610['message'],_0x5bec14);_0xe55dba(_0x1872f5[_0x6791('0xf')](0x1f4,_0x309610[_0x6791('0x11')]));});});}; \ No newline at end of file +var _0x5a13=['CreateSquareDetailsReport','SquareDetailsReport','create','body','options','raw','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','SquareDetailsReport,\x20%s,\x20%s','request\x20sent','stringify','code','message','error','info','result','catch'];(function(_0x22c9ff,_0x3b8ceb){var _0x35b92b=function(_0x303e98){while(--_0x303e98){_0x22c9ff['push'](_0x22c9ff['shift']());}};_0x35b92b(++_0x3b8ceb);}(_0x5a13,0x145));var _0x35a1=function(_0x5423bb,_0x1d0e90){_0x5423bb=_0x5423bb-0x0;var _0x498050=_0x5a13[_0x5423bb];return _0x498050;};'use strict';var _=require(_0x35a1('0x0'));var util=require(_0x35a1('0x1'));var moment=require('moment');var BPromise=require(_0x35a1('0x2'));var rs=require(_0x35a1('0x3'));var fs=require('fs');var Redis=require(_0x35a1('0x4'));var db=require(_0x35a1('0x5'))['db'];var utils=require(_0x35a1('0x6'));var logger=require(_0x35a1('0x7'))(_0x35a1('0x8'));var config=require(_0x35a1('0x9'));var jayson=require(_0x35a1('0xa'));var client=jayson[_0x35a1('0xb')][_0x35a1('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x407b26,_0x10a34f,_0x3aa00e){return new BPromise(function(_0x58afca,_0x57d9fd){return client['request'](_0x407b26,_0x3aa00e)[_0x35a1('0xd')](function(_0x103ec8){logger['info'](_0x35a1('0xe'),_0x10a34f,_0x35a1('0xf'));logger['debug']('SquareDetailsReport,\x20%s,\x20%s,\x20%s',_0x10a34f,_0x35a1('0xf'),JSON[_0x35a1('0x10')](_0x103ec8));if(_0x103ec8['error']){if(_0x103ec8['error'][_0x35a1('0x11')]===0x1f4){logger['error'](_0x35a1('0xe'),_0x10a34f,_0x103ec8['error'][_0x35a1('0x12')]);return _0x57d9fd(_0x103ec8[_0x35a1('0x13')][_0x35a1('0x12')]);}logger[_0x35a1('0x13')](_0x35a1('0xe'),_0x10a34f,_0x103ec8[_0x35a1('0x13')][_0x35a1('0x12')]);return _0x58afca(_0x103ec8[_0x35a1('0x13')][_0x35a1('0x12')]);}else{logger[_0x35a1('0x14')](_0x35a1('0xe'),_0x10a34f,_0x35a1('0xf'));_0x58afca(_0x103ec8[_0x35a1('0x15')][_0x35a1('0x12')]);}})[_0x35a1('0x16')](function(_0x251d32){logger[_0x35a1('0x13')](_0x35a1('0xe'),_0x10a34f,_0x251d32);_0x57d9fd(_0x251d32);});});}exports[_0x35a1('0x17')]=function(_0x1de373){var _0x5e4317=this;return new Promise(function(_0x3b17dc,_0xbeb751){return db[_0x35a1('0x18')][_0x35a1('0x19')](_0x1de373[_0x35a1('0x1a')],{'raw':_0x1de373[_0x35a1('0x1b')]?_0x1de373[_0x35a1('0x1b')][_0x35a1('0x1c')]===undefined?!![]:![]:!![]})[_0x35a1('0xd')](function(_0x5929e5){logger[_0x35a1('0x14')](_0x35a1('0x17'),_0x1de373);logger['debug'](_0x35a1('0x17'),_0x1de373,JSON[_0x35a1('0x10')](_0x5929e5));_0x3b17dc(_0x5929e5);})['catch'](function(_0xc13bad){logger['error'](_0x35a1('0x17'),_0xc13bad[_0x35a1('0x12')],_0x1de373);_0xbeb751(_0x5e4317[_0x35a1('0x13')](0x1f4,_0xc13bad['message']));});});}; \ No newline at end of file diff --git a/server/api/system/index.js b/server/api/system/index.js index fd54448..e646e90 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 _0xb824=['../../components/auth/service','./system.controller','get','isAuthenticated','/process/:pid/kill','killProcess','express','Router'];(function(_0x113974,_0x2db362){var _0x44b766=function(_0xa0d616){while(--_0xa0d616){_0x113974['push'](_0x113974['shift']());}};_0x44b766(++_0x2db362);}(_0xb824,0x96));var _0x4b82=function(_0x5a1a0b,_0x224d8a){_0x5a1a0b=_0x5a1a0b-0x0;var _0x35a7dc=_0xb824[_0x5a1a0b];return _0x35a7dc;};'use strict';var express=require(_0x4b82('0x0'));var router=express[_0x4b82('0x1')]();var auth=require(_0x4b82('0x2'));var controller=require(_0x4b82('0x3'));router[_0x4b82('0x4')]('/',auth[_0x4b82('0x5')](),controller['index']);router[_0x4b82('0x4')](_0x4b82('0x6'),auth['isAuthenticated'](),controller[_0x4b82('0x7')]);module['exports']=router; \ No newline at end of file +var _0xad6b=['exports','Router','./system.controller','get','isAuthenticated','/process/:pid/kill'];(function(_0x1e3378,_0xbb7fd){var _0x55b7ec=function(_0x1c9e7b){while(--_0x1c9e7b){_0x1e3378['push'](_0x1e3378['shift']());}};_0x55b7ec(++_0xbb7fd);}(_0xad6b,0xa9));var _0xbad6=function(_0x2112d4,_0x3c863c){_0x2112d4=_0x2112d4-0x0;var _0x434972=_0xad6b[_0x2112d4];return _0x434972;};'use strict';var express=require('express');var router=express[_0xbad6('0x0')]();var auth=require('../../components/auth/service');var controller=require(_0xbad6('0x1'));router[_0xbad6('0x2')]('/',auth[_0xbad6('0x3')](),controller['index']);router['get'](_0xbad6('0x4'),auth[_0xbad6('0x3')](),controller['killProcess']);module[_0xbad6('0x5')]=router; \ No newline at end of file diff --git a/server/api/system/system.controller.js b/server/api/system/system.controller.js index 5986a83..884a54a 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 _0xb39a=['then','json','status','killProcess','components/import/cm','format','ps\x20-p\x20%s\x20-ww\x20-o\x20args','params','split','length','indexOf','Process\x20with\x20pid\x20%s\x20not\x20found!','SIGINT','Process\x20with\x20pid\x20%s\x20killed\x20correctly','catch','systeminformation','exec','../../config/logger','api','util','bluebird','lodash','error','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','inspect','send','index'];(function(_0xf0c9fc,_0x83f7d0){var _0x805791=function(_0x4b3675){while(--_0x4b3675){_0xf0c9fc['push'](_0xf0c9fc['shift']());}};_0x805791(++_0x83f7d0);}(_0xb39a,0xb1));var _0xab39=function(_0x2e5baf,_0x4b77a1){_0x2e5baf=_0x2e5baf-0x0;var _0x4c0797=_0xb39a[_0x2e5baf];return _0x4c0797;};'use strict';var info=require(_0xab39('0x0'));var exec=require('child_process')[_0xab39('0x1')];var logger=require(_0xab39('0x2'))(_0xab39('0x3'));var util=require(_0xab39('0x4'));var BPromise=require(_0xab39('0x5'));var _=require(_0xab39('0x6'));function handleError(_0xdf50f5,_0x28d81d,_0x1a407b){_0x28d81d=_0x28d81d||0x1f4;return function(_0x3f653c){logger[_0xab39('0x7')](_0xab39('0x8'),_0x1a407b,_0x28d81d,util[_0xab39('0x9')](_0x3f653c,{'showHidden':![],'depth':null}));delete _0x3f653c['name'];_0xdf50f5['status'](_0x28d81d)[_0xab39('0xa')](_0x3f653c);};}exports[_0xab39('0xb')]=function(_0x2a552b,_0x20fd33){return info['getAllData']()[_0xab39('0xc')](function(_0x348509){return _0x20fd33['status'](0xc8)[_0xab39('0xd')](_0x348509);})['catch'](function(_0x242e0c){return _0x20fd33[_0xab39('0xe')](0x1f4)[_0xab39('0xd')](_0x242e0c);});};exports[_0xab39('0xf')]=function(_0x402345,_0xa02e5b){var _0x52ddf3=[_0xab39('0x10')];return new BPromise(function(_0x4c7ea,_0x5600b8){return exec(util[_0xab39('0x11')](_0xab39('0x12'),_0x402345[_0xab39('0x13')]['pid']),function(_0x338fb0,_0x28519e,_0x28aa5f){if(_0x338fb0){return _0x5600b8(_0x338fb0);}return _0x4c7ea(_0x28519e);});})[_0xab39('0xc')](function(_0x42eb59){var _0x598e34=![];var _0xc1840f=_0x42eb59[_0xab39('0x14')](/\n/);for(var _0x128b85=0x0,_0x4c0ae2=_0x52ddf3[_0xab39('0x15')];_0x128b85<_0x4c0ae2,_0x598e34===![];_0x128b85+=0x1){if(_0x42eb59[_0xab39('0x16')](_0x52ddf3[_0x128b85])>=0x0){_0x598e34=!![];}}if(!_0x598e34){throw new Error(util[_0xab39('0x11')](_0xab39('0x17'),_0x402345[_0xab39('0x13')]['pid']));}process['kill'](_0x402345['params']['pid'],_0xab39('0x18'));return _0xa02e5b[_0xab39('0xe')](0xc8)['json']({'message':util[_0xab39('0x11')](_0xab39('0x19'),_0x402345['params']['pid'])});})[_0xab39('0x1a')](handleError(_0xa02e5b,null,_0xab39('0xf')));}; \ No newline at end of file +var _0x63ae=['json','catch','components/import/cm','format','ps\x20-p\x20%s\x20-ww\x20-o\x20args','params','pid','length','indexOf','Process\x20with\x20pid\x20%s\x20not\x20found!','kill','SIGINT','Process\x20with\x20pid\x20%s\x20killed\x20correctly','killProcess','systeminformation','child_process','exec','../../config/logger','api','util','lodash','error','inspect','name','status','send','index','getAllData','then'];(function(_0x258e0f,_0xa16a34){var _0x385bda=function(_0x309f3c){while(--_0x309f3c){_0x258e0f['push'](_0x258e0f['shift']());}};_0x385bda(++_0xa16a34);}(_0x63ae,0x82));var _0xe63a=function(_0x5ddeba,_0x1afdea){_0x5ddeba=_0x5ddeba-0x0;var _0x322e10=_0x63ae[_0x5ddeba];return _0x322e10;};'use strict';var info=require(_0xe63a('0x0'));var exec=require(_0xe63a('0x1'))[_0xe63a('0x2')];var logger=require(_0xe63a('0x3'))(_0xe63a('0x4'));var util=require(_0xe63a('0x5'));var BPromise=require('bluebird');var _=require(_0xe63a('0x6'));function handleError(_0x24a632,_0x464661,_0x3d450a){_0x464661=_0x464661||0x1f4;return function(_0x3b6f02){logger[_0xe63a('0x7')]('<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s',_0x3d450a,_0x464661,util[_0xe63a('0x8')](_0x3b6f02,{'showHidden':![],'depth':null}));delete _0x3b6f02[_0xe63a('0x9')];_0x24a632[_0xe63a('0xa')](_0x464661)[_0xe63a('0xb')](_0x3b6f02);};}exports[_0xe63a('0xc')]=function(_0x197033,_0x3cdc03){return info[_0xe63a('0xd')]()[_0xe63a('0xe')](function(_0x4bcb46){return _0x3cdc03['status'](0xc8)[_0xe63a('0xf')](_0x4bcb46);})[_0xe63a('0x10')](function(_0x20eb9f){return _0x3cdc03[_0xe63a('0xa')](0x1f4)[_0xe63a('0xf')](_0x20eb9f);});};exports['killProcess']=function(_0x151846,_0x594409){var _0x37d784=[_0xe63a('0x11')];return new BPromise(function(_0x531a75,_0x427d31){return exec(util[_0xe63a('0x12')](_0xe63a('0x13'),_0x151846[_0xe63a('0x14')][_0xe63a('0x15')]),function(_0x528c3a,_0x42c972,_0x503dbd){if(_0x528c3a){return _0x427d31(_0x528c3a);}return _0x531a75(_0x42c972);});})['then'](function(_0x24a120){var _0x14c46b=![];var _0x5e503b=_0x24a120['split'](/\n/);for(var _0x39339e=0x0,_0x2e96fb=_0x37d784[_0xe63a('0x16')];_0x39339e<_0x2e96fb,_0x14c46b===![];_0x39339e+=0x1){if(_0x24a120[_0xe63a('0x17')](_0x37d784[_0x39339e])>=0x0){_0x14c46b=!![];}}if(!_0x14c46b){throw new Error(util[_0xe63a('0x12')](_0xe63a('0x18'),_0x151846[_0xe63a('0x14')][_0xe63a('0x15')]));}process[_0xe63a('0x19')](_0x151846[_0xe63a('0x14')][_0xe63a('0x15')],_0xe63a('0x1a'));return _0x594409['status'](0xc8)[_0xe63a('0xf')]({'message':util[_0xe63a('0x12')](_0xe63a('0x1b'),_0x151846[_0xe63a('0x14')]['pid'])});})['catch'](handleError(_0x594409,null,_0xe63a('0x1c')));}; \ No newline at end of file diff --git a/server/api/tag/index.js b/server/api/tag/index.js index 4ce4ee1..f530993 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 _0x6d35=['../../components/interaction/service','../../config/environment','./tag.controller','get','index','show','post','create','put','/:id','isAuthenticated','update','delete','destroy','exports','util','connect-timeout','Router','fs-extra','../../components/auth/service'];(function(_0x36eaaa,_0x326732){var _0x461349=function(_0x4e4180){while(--_0x4e4180){_0x36eaaa['push'](_0x36eaaa['shift']());}};_0x461349(++_0x326732);}(_0x6d35,0xd7));var _0x56d3=function(_0x1ac120,_0x3e7e45){_0x1ac120=_0x1ac120-0x0;var _0x19b703=_0x6d35[_0x1ac120];return _0x19b703;};'use strict';var multer=require('multer');var util=require(_0x56d3('0x0'));var path=require('path');var timeout=require(_0x56d3('0x1'));var express=require('express');var router=express[_0x56d3('0x2')]();var fs_extra=require(_0x56d3('0x3'));var auth=require(_0x56d3('0x4'));var interaction=require(_0x56d3('0x5'));var config=require(_0x56d3('0x6'));var controller=require(_0x56d3('0x7'));router[_0x56d3('0x8')]('/',auth['isAuthenticated'](),controller[_0x56d3('0x9')]);router[_0x56d3('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x56d3('0xa')]);router[_0x56d3('0xb')]('/',auth['isAuthenticated'](),controller[_0x56d3('0xc')]);router[_0x56d3('0xd')](_0x56d3('0xe'),auth[_0x56d3('0xf')](),controller[_0x56d3('0x10')]);router[_0x56d3('0x11')](_0x56d3('0xe'),auth[_0x56d3('0xf')](),controller[_0x56d3('0x12')]);module[_0x56d3('0x13')]=router; \ No newline at end of file +var _0x273e=['update','delete','multer','util','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./tag.controller','get','isAuthenticated','index','/:id','show','post','create','put'];(function(_0x59e917,_0x5e9255){var _0x2871cf=function(_0x40c58b){while(--_0x40c58b){_0x59e917['push'](_0x59e917['shift']());}};_0x2871cf(++_0x5e9255);}(_0x273e,0x1b2));var _0xe273=function(_0x280998,_0x3794c6){_0x280998=_0x280998-0x0;var _0x134094=_0x273e[_0x280998];return _0x134094;};'use strict';var multer=require(_0xe273('0x0'));var util=require(_0xe273('0x1'));var path=require('path');var timeout=require(_0xe273('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xe273('0x3'));var auth=require(_0xe273('0x4'));var interaction=require(_0xe273('0x5'));var config=require(_0xe273('0x6'));var controller=require(_0xe273('0x7'));router[_0xe273('0x8')]('/',auth[_0xe273('0x9')](),controller[_0xe273('0xa')]);router[_0xe273('0x8')](_0xe273('0xb'),auth[_0xe273('0x9')](),controller[_0xe273('0xc')]);router[_0xe273('0xd')]('/',auth[_0xe273('0x9')](),controller[_0xe273('0xe')]);router[_0xe273('0xf')](_0xe273('0xb'),auth[_0xe273('0x9')](),controller[_0xe273('0x10')]);router[_0xe273('0x11')](_0xe273('0xb'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/tag/tag.attributes.js b/server/api/tag/tag.attributes.js index 418fe74..f1ce07d 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 _0x9354=['exports','STRING','#0091EA'];(function(_0x3b95e2,_0x3d2dfb){var _0x1191c4=function(_0x4a18b3){while(--_0x4a18b3){_0x3b95e2['push'](_0x3b95e2['shift']());}};_0x1191c4(++_0x3d2dfb);}(_0x9354,0x96));var _0x4935=function(_0x16d10f,_0x2ba2d5){_0x16d10f=_0x16d10f-0x0;var _0x50c823=_0x9354[_0x16d10f];return _0x50c823;};'use strict';var Sequelize=require('sequelize');module[_0x4935('0x0')]={'name':{'type':Sequelize[_0x4935('0x1')],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0x4935('0x1')],'defaultValue':_0x4935('0x2')},'description':{'type':Sequelize[_0x4935('0x1')]}}; \ No newline at end of file +var _0x61d0=['STRING','name','#0091EA','sequelize'];(function(_0xda464c,_0x26e47d){var _0x19e222=function(_0x1ec605){while(--_0x1ec605){_0xda464c['push'](_0xda464c['shift']());}};_0x19e222(++_0x26e47d);}(_0x61d0,0x187));var _0x061d=function(_0x4fbb86,_0x374ed0){_0x4fbb86=_0x4fbb86-0x0;var _0xb141fe=_0x61d0[_0x4fbb86];return _0xb141fe;};'use strict';var Sequelize=require(_0x061d('0x0'));module['exports']={'name':{'type':Sequelize[_0x061d('0x1')],'unique':_0x061d('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize['STRING'],'defaultValue':_0x061d('0x3')},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/tag/tag.controller.js b/server/api/tag/tag.controller.js index 53a0607..6ab9394 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 _0x750a=['filter','options','Tag','include','findAll','rows','catch','show','params','includeAll','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','body','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/environment','../../config/license/util','status','end','offset','undefined','count','set','json','destroy','then','get','Tags','UserProfileResource','sendStatus','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','keys','filters','intersection','query','fields','attributes','hasOwnProperty','nolimit','limit','order','sort','where','pick','merge','VIRTUAL'];(function(_0x15da5f,_0x3fce0e){var _0x1992f1=function(_0x1bf2be){while(--_0x1bf2be){_0x15da5f['push'](_0x15da5f['shift']());}};_0x1992f1(++_0x3fce0e);}(_0x750a,0x140));var _0xa750=function(_0x57fa0b,_0x5df1ce){_0x57fa0b=_0x57fa0b-0x0;var _0x18669f=_0x750a[_0x57fa0b];return _0x18669f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa750('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xa750('0x1'));var moment=require(_0xa750('0x2'));var BPromise=require(_0xa750('0x3'));var Mustache=require(_0xa750('0x4'));var util=require(_0xa750('0x5'));var path=require(_0xa750('0x6'));var sox=require(_0xa750('0x7'));var csv=require(_0xa750('0x8'));var ejs=require(_0xa750('0x9'));var fs=require('fs');var fs_extra=require(_0xa750('0xa'));var _=require(_0xa750('0xb'));var squel=require(_0xa750('0xc'));var crypto=require(_0xa750('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xa750('0x8'));var querystring=require('querystring');var Papa=require(_0xa750('0xe'));var Redis=require(_0xa750('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xa750('0x10'));var as=require(_0xa750('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xa750('0x12'));var utils=require('../../config/utils');var config=require(_0xa750('0x13'));var licenseUtil=require(_0xa750('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x24ec62,_0x1c5657){_0x1c5657=_0x1c5657||0xcc;return function(_0x344c67){if(_0x344c67){return _0x24ec62['sendStatus'](_0x1c5657);}return _0x24ec62[_0xa750('0x15')](_0x1c5657)[_0xa750('0x16')]();};}function respondWithResult(_0x2d3421,_0x24e48a){_0x24e48a=_0x24e48a||0xc8;return function(_0xa66181){if(_0xa66181){return _0x2d3421[_0xa750('0x15')](_0x24e48a)['json'](_0xa66181);}};}function respondWithFilteredResult(_0x3ae2a1,_0x8488ea){return function(_0x290d46){if(_0x290d46){var _0x49fe3b=typeof _0x8488ea[_0xa750('0x17')]===_0xa750('0x18')&&typeof _0x8488ea['limit']==='undefined';var _0x321eb2=_0x290d46['count'];var _0x433dbd=_0x49fe3b?0x0:_0x8488ea[_0xa750('0x17')];var _0x4f1faa=_0x49fe3b?_0x290d46[_0xa750('0x19')]:_0x8488ea['offset']+_0x8488ea['limit'];var _0x25e335;if(_0x4f1faa>=_0x321eb2){_0x4f1faa=_0x321eb2;_0x25e335=0xc8;}else{_0x25e335=0xce;}_0x3ae2a1['status'](_0x25e335);return _0x3ae2a1[_0xa750('0x1a')]('Content-Range',_0x433dbd+'-'+_0x4f1faa+'/'+_0x321eb2)[_0xa750('0x1b')](_0x290d46);}return null;};}function patchUpdates(_0x4a007d){return function(_0x3dc7f1){try{jsonpatch['apply'](_0x3dc7f1,_0x4a007d,!![]);}catch(_0x1efb68){return BPromise['reject'](_0x1efb68);}return _0x3dc7f1['save']();};}function saveUpdates(_0xaa9d3e,_0x52da84){return function(_0x216fbf){if(_0x216fbf){return _0x216fbf['update'](_0xaa9d3e)['then'](function(_0x5b433d){return _0x5b433d;});}return null;};}function removeEntity(_0x5d758e,_0x15d72f){return function(_0x2ec6c4){if(_0x2ec6c4){return _0x2ec6c4[_0xa750('0x1c')]()[_0xa750('0x1d')](function(){var _0x1b80a5=_0x2ec6c4[_0xa750('0x1e')]({'plain':!![]});var _0x3001bc=_0xa750('0x1f');return db[_0xa750('0x20')][_0xa750('0x1c')]({'where':{'type':_0x3001bc,'resourceId':_0x1b80a5['id']}})[_0xa750('0x1d')](function(){return _0x2ec6c4;});})[_0xa750('0x1d')](function(){_0x5d758e[_0xa750('0x15')](0xcc)[_0xa750('0x16')]();});}};}function handleEntityNotFound(_0x310e2d,_0x4ffff4){return function(_0x3d3923){if(!_0x3d3923){_0x310e2d[_0xa750('0x21')](0x194);}return _0x3d3923;};}function handleError(_0x21cd2c,_0x4cceee){_0x4cceee=_0x4cceee||0x1f4;return function(_0x35ab53){logger[_0xa750('0x22')](_0x35ab53[_0xa750('0x23')]);if(_0x35ab53[_0xa750('0x24')]){delete _0x35ab53['name'];}_0x21cd2c[_0xa750('0x15')](_0x4cceee)[_0xa750('0x25')](_0x35ab53);};}exports[_0xa750('0x26')]=function(_0x2aef3a,_0x2c5253){var _0x59ab33={},_0x46cc11={},_0x4c2c9e={'count':0x0,'rows':[]};var _0x2d0e93=_[_0xa750('0x27')](db['Tag'][_0xa750('0x28')],function(_0x6bc25d){return{'name':_0x6bc25d[_0xa750('0x29')],'type':_0x6bc25d[_0xa750('0x2a')][_0xa750('0x2b')]};});_0x46cc11[_0xa750('0x2c')]=_[_0xa750('0x27')](_0x2d0e93,_0xa750('0x24'));_0x46cc11['query']=_[_0xa750('0x2d')](_0x2aef3a['query']);_0x46cc11[_0xa750('0x2e')]=_[_0xa750('0x2f')](_0x46cc11[_0xa750('0x2c')],_0x46cc11[_0xa750('0x30')]);_0x59ab33['attributes']=_[_0xa750('0x2f')](_0x46cc11[_0xa750('0x2c')],qs['fields'](_0x2aef3a[_0xa750('0x30')][_0xa750('0x31')]));_0x59ab33[_0xa750('0x32')]=_0x59ab33[_0xa750('0x32')]['length']?_0x59ab33[_0xa750('0x32')]:_0x46cc11['model'];if(!_0x2aef3a['query'][_0xa750('0x33')](_0xa750('0x34'))){_0x59ab33[_0xa750('0x35')]=qs['limit'](_0x2aef3a[_0xa750('0x30')][_0xa750('0x35')]);_0x59ab33[_0xa750('0x17')]=qs['offset'](_0x2aef3a[_0xa750('0x30')][_0xa750('0x17')]);}_0x59ab33[_0xa750('0x36')]=qs['sort'](_0x2aef3a[_0xa750('0x30')][_0xa750('0x37')]);_0x59ab33[_0xa750('0x38')]=qs['filters'](_[_0xa750('0x39')](_0x2aef3a[_0xa750('0x30')],_0x46cc11[_0xa750('0x2e')]),_0x2d0e93);if(_0x2aef3a[_0xa750('0x30')]['filter']){_0x59ab33['where']=_[_0xa750('0x3a')](_0x59ab33[_0xa750('0x38')],{'$or':_['map'](_0x2d0e93,function(_0x43dc3a){if(_0x43dc3a[_0xa750('0x2a')]!==_0xa750('0x3b')){var _0x1166ff={};_0x1166ff[_0x43dc3a[_0xa750('0x24')]]={'$like':'%'+_0x2aef3a['query'][_0xa750('0x3c')]+'%'};return _0x1166ff;}})});}_0x59ab33=_[_0xa750('0x3a')]({},_0x59ab33,_0x2aef3a[_0xa750('0x3d')]);var _0x134874={'where':_0x59ab33[_0xa750('0x38')]};return db[_0xa750('0x3e')][_0xa750('0x19')](_0x134874)['then'](function(_0x3daa38){_0x4c2c9e['count']=_0x3daa38;if(_0x2aef3a[_0xa750('0x30')]['includeAll']){_0x59ab33[_0xa750('0x3f')]=[{'all':!![]}];}return db[_0xa750('0x3e')][_0xa750('0x40')](_0x59ab33);})[_0xa750('0x1d')](function(_0x430d60){_0x4c2c9e[_0xa750('0x41')]=_0x430d60;return _0x4c2c9e;})[_0xa750('0x1d')](respondWithFilteredResult(_0x2c5253,_0x59ab33))[_0xa750('0x42')](handleError(_0x2c5253,null));};exports[_0xa750('0x43')]=function(_0x108a1a,_0x36a8d6){var _0x1458f1={'raw':!![],'where':{'id':_0x108a1a[_0xa750('0x44')]['id']}},_0x3ec860={};_0x3ec860[_0xa750('0x2c')]=_[_0xa750('0x2d')](db[_0xa750('0x3e')][_0xa750('0x28')]);_0x3ec860[_0xa750('0x30')]=_[_0xa750('0x2d')](_0x108a1a['query']);_0x3ec860[_0xa750('0x2e')]=_[_0xa750('0x2f')](_0x3ec860[_0xa750('0x2c')],_0x3ec860[_0xa750('0x30')]);_0x1458f1[_0xa750('0x32')]=_[_0xa750('0x2f')](_0x3ec860[_0xa750('0x2c')],qs[_0xa750('0x31')](_0x108a1a[_0xa750('0x30')]['fields']));_0x1458f1[_0xa750('0x32')]=_0x1458f1[_0xa750('0x32')]['length']?_0x1458f1[_0xa750('0x32')]:_0x3ec860[_0xa750('0x2c')];if(_0x108a1a[_0xa750('0x30')][_0xa750('0x45')]){_0x1458f1[_0xa750('0x3f')]=[{'all':!![]}];}_0x1458f1=_[_0xa750('0x3a')]({},_0x1458f1,_0x108a1a[_0xa750('0x3d')]);return db[_0xa750('0x3e')][_0xa750('0x46')](_0x1458f1)[_0xa750('0x1d')](handleEntityNotFound(_0x36a8d6,null))['then'](respondWithResult(_0x36a8d6,null))[_0xa750('0x42')](handleError(_0x36a8d6,null));};exports[_0xa750('0x47')]=function(_0x58afd2,_0x93e49f){return db[_0xa750('0x3e')][_0xa750('0x47')](_0x58afd2['body'],{})[_0xa750('0x1d')](function(_0x3fc623){var _0x1e5a9a=_0x58afd2[_0xa750('0x48')]['get']({'plain':!![]});if(!_0x1e5a9a)throw new Error(_0xa750('0x49'));if(_0x1e5a9a[_0xa750('0x4a')]===_0xa750('0x48')){var _0xed4f88=_0x3fc623['get']({'plain':!![]});var _0x203f2a=_0xa750('0x1f');return db['UserProfileSection'][_0xa750('0x46')]({'where':{'name':_0x203f2a,'userProfileId':_0x1e5a9a['userProfileId']},'raw':!![]})[_0xa750('0x1d')](function(_0x69995b){if(_0x69995b&&_0x69995b['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0xed4f88[_0xa750('0x24')],'resourceId':_0xed4f88['id'],'type':_0x69995b[_0xa750('0x24')],'sectionId':_0x69995b['id']},{})['then'](function(){return _0x3fc623;});}else{return _0x3fc623;}})[_0xa750('0x42')](function(_0x1a79a9){logger[_0xa750('0x22')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1a79a9);throw _0x1a79a9;});}return _0x3fc623;})['then'](respondWithResult(_0x93e49f,0xc9))['catch'](handleError(_0x93e49f,null));};exports['update']=function(_0x3c34d4,_0x4a1b5d){if(_0x3c34d4[_0xa750('0x4b')]['id']){delete _0x3c34d4[_0xa750('0x4b')]['id'];}return db['Tag'][_0xa750('0x46')]({'where':{'id':_0x3c34d4['params']['id']}})[_0xa750('0x1d')](handleEntityNotFound(_0x4a1b5d,null))['then'](saveUpdates(_0x3c34d4['body'],null))['then'](respondWithResult(_0x4a1b5d,null))['catch'](handleError(_0x4a1b5d,null));};exports[_0xa750('0x1c')]=function(_0x40dac2,_0x5f1313){return db['Tag']['find']({'where':{'id':_0x40dac2[_0xa750('0x44')]['id']}})[_0xa750('0x1d')](handleEntityNotFound(_0x5f1313,null))[_0xa750('0x1d')](removeEntity(_0x5f1313,null))[_0xa750('0x42')](handleError(_0x5f1313,null));}; \ No newline at end of file +var _0x2750=['sendStatus','status','end','json','undefined','limit','count','offset','set','reject','save','update','destroy','then','get','Tags','UserProfileResource','error','stack','name','send','map','Tag','fieldName','type','key','query','filters','model','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','rawAttributes','keys','length','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb'];(function(_0x11e9e7,_0x3338da){var _0x45030e=function(_0x46313e){while(--_0x46313e){_0x11e9e7['push'](_0x11e9e7['shift']());}};_0x45030e(++_0x3338da);}(_0x2750,0x13b));var _0x0275=function(_0x4f533b,_0x269d14){_0x4f533b=_0x4f533b-0x0;var _0x3cccdc=_0x2750[_0x4f533b];return _0x3cccdc;};'use strict';var emlformat=require(_0x0275('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x0275('0x1'));var jsonpatch=require(_0x0275('0x2'));var rp=require(_0x0275('0x3'));var moment=require(_0x0275('0x4'));var BPromise=require(_0x0275('0x5'));var Mustache=require(_0x0275('0x6'));var util=require(_0x0275('0x7'));var path=require(_0x0275('0x8'));var sox=require(_0x0275('0x9'));var csv=require(_0x0275('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0275('0xb'));var _=require(_0x0275('0xc'));var squel=require(_0x0275('0xd'));var crypto=require(_0x0275('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x0275('0xf'));var toCsv=require(_0x0275('0xa'));var querystring=require(_0x0275('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x0275('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x0275('0x12'));var hardwareService=require(_0x0275('0x13'));var logger=require(_0x0275('0x14'))(_0x0275('0x15'));var utils=require(_0x0275('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x0275('0x17'));var db=require(_0x0275('0x18'))['db'];function respondWithStatusCode(_0x1f128d,_0x4c6ee0){_0x4c6ee0=_0x4c6ee0||0xcc;return function(_0x55ffd6){if(_0x55ffd6){return _0x1f128d[_0x0275('0x19')](_0x4c6ee0);}return _0x1f128d[_0x0275('0x1a')](_0x4c6ee0)[_0x0275('0x1b')]();};}function respondWithResult(_0x46a729,_0x28827b){_0x28827b=_0x28827b||0xc8;return function(_0x36921c){if(_0x36921c){return _0x46a729['status'](_0x28827b)[_0x0275('0x1c')](_0x36921c);}};}function respondWithFilteredResult(_0x3030c0,_0x4aa412){return function(_0x6344fc){if(_0x6344fc){var _0xaae367=typeof _0x4aa412['offset']===_0x0275('0x1d')&&typeof _0x4aa412[_0x0275('0x1e')]==='undefined';var _0x5e7466=_0x6344fc['count'];var _0x591d27=_0xaae367?0x0:_0x4aa412['offset'];var _0x566ad6=_0xaae367?_0x6344fc[_0x0275('0x1f')]:_0x4aa412[_0x0275('0x20')]+_0x4aa412['limit'];var _0x7075c9;if(_0x566ad6>=_0x5e7466){_0x566ad6=_0x5e7466;_0x7075c9=0xc8;}else{_0x7075c9=0xce;}_0x3030c0[_0x0275('0x1a')](_0x7075c9);return _0x3030c0[_0x0275('0x21')]('Content-Range',_0x591d27+'-'+_0x566ad6+'/'+_0x5e7466)[_0x0275('0x1c')](_0x6344fc);}return null;};}function patchUpdates(_0x402f0d){return function(_0x575786){try{jsonpatch['apply'](_0x575786,_0x402f0d,!![]);}catch(_0x31ba9e){return BPromise[_0x0275('0x22')](_0x31ba9e);}return _0x575786[_0x0275('0x23')]();};}function saveUpdates(_0x592a53,_0xf3b68e){return function(_0x5ab9e7){if(_0x5ab9e7){return _0x5ab9e7[_0x0275('0x24')](_0x592a53)['then'](function(_0x26f2c2){return _0x26f2c2;});}return null;};}function removeEntity(_0xfa0081,_0x594321){return function(_0x140a18){if(_0x140a18){return _0x140a18[_0x0275('0x25')]()[_0x0275('0x26')](function(){var _0x52946b=_0x140a18[_0x0275('0x27')]({'plain':!![]});var _0x44bbf8=_0x0275('0x28');return db[_0x0275('0x29')][_0x0275('0x25')]({'where':{'type':_0x44bbf8,'resourceId':_0x52946b['id']}})[_0x0275('0x26')](function(){return _0x140a18;});})['then'](function(){_0xfa0081[_0x0275('0x1a')](0xcc)[_0x0275('0x1b')]();});}};}function handleEntityNotFound(_0x1d24b2,_0x275dac){return function(_0x4689a3){if(!_0x4689a3){_0x1d24b2['sendStatus'](0x194);}return _0x4689a3;};}function handleError(_0x1ffd57,_0xd59d69){_0xd59d69=_0xd59d69||0x1f4;return function(_0x3246ea){logger[_0x0275('0x2a')](_0x3246ea[_0x0275('0x2b')]);if(_0x3246ea['name']){delete _0x3246ea[_0x0275('0x2c')];}_0x1ffd57[_0x0275('0x1a')](_0xd59d69)[_0x0275('0x2d')](_0x3246ea);};}exports['index']=function(_0x5e2e22,_0x3cb2d7){var _0x299190={},_0x5dc2bc={},_0x7eff96={'count':0x0,'rows':[]};var _0x155a50=_[_0x0275('0x2e')](db[_0x0275('0x2f')]['rawAttributes'],function(_0x24c762){return{'name':_0x24c762[_0x0275('0x30')],'type':_0x24c762[_0x0275('0x31')][_0x0275('0x32')]};});_0x5dc2bc['model']=_[_0x0275('0x2e')](_0x155a50,'name');_0x5dc2bc[_0x0275('0x33')]=_['keys'](_0x5e2e22[_0x0275('0x33')]);_0x5dc2bc[_0x0275('0x34')]=_['intersection'](_0x5dc2bc[_0x0275('0x35')],_0x5dc2bc[_0x0275('0x33')]);_0x299190[_0x0275('0x36')]=_[_0x0275('0x37')](_0x5dc2bc['model'],qs[_0x0275('0x38')](_0x5e2e22[_0x0275('0x33')][_0x0275('0x38')]));_0x299190[_0x0275('0x36')]=_0x299190[_0x0275('0x36')]['length']?_0x299190[_0x0275('0x36')]:_0x5dc2bc[_0x0275('0x35')];if(!_0x5e2e22[_0x0275('0x33')][_0x0275('0x39')](_0x0275('0x3a'))){_0x299190[_0x0275('0x1e')]=qs[_0x0275('0x1e')](_0x5e2e22[_0x0275('0x33')][_0x0275('0x1e')]);_0x299190[_0x0275('0x20')]=qs[_0x0275('0x20')](_0x5e2e22['query'][_0x0275('0x20')]);}_0x299190[_0x0275('0x3b')]=qs[_0x0275('0x3c')](_0x5e2e22[_0x0275('0x33')][_0x0275('0x3c')]);_0x299190[_0x0275('0x3d')]=qs[_0x0275('0x34')](_[_0x0275('0x3e')](_0x5e2e22[_0x0275('0x33')],_0x5dc2bc[_0x0275('0x34')]),_0x155a50);if(_0x5e2e22[_0x0275('0x33')][_0x0275('0x3f')]){_0x299190[_0x0275('0x3d')]=_[_0x0275('0x40')](_0x299190['where'],{'$or':_[_0x0275('0x2e')](_0x155a50,function(_0x1cc40d){if(_0x1cc40d['type']!==_0x0275('0x41')){var _0x76b8fa={};_0x76b8fa[_0x1cc40d[_0x0275('0x2c')]]={'$like':'%'+_0x5e2e22[_0x0275('0x33')][_0x0275('0x3f')]+'%'};return _0x76b8fa;}})});}_0x299190=_[_0x0275('0x40')]({},_0x299190,_0x5e2e22[_0x0275('0x42')]);var _0x5e57b5={'where':_0x299190[_0x0275('0x3d')]};return db[_0x0275('0x2f')][_0x0275('0x1f')](_0x5e57b5)[_0x0275('0x26')](function(_0x4f888c){_0x7eff96[_0x0275('0x1f')]=_0x4f888c;if(_0x5e2e22[_0x0275('0x33')][_0x0275('0x43')]){_0x299190[_0x0275('0x44')]=[{'all':!![]}];}return db['Tag'][_0x0275('0x45')](_0x299190);})['then'](function(_0x261e66){_0x7eff96[_0x0275('0x46')]=_0x261e66;return _0x7eff96;})[_0x0275('0x26')](respondWithFilteredResult(_0x3cb2d7,_0x299190))[_0x0275('0x47')](handleError(_0x3cb2d7,null));};exports['show']=function(_0x13c651,_0x3d1bfc){var _0x59839d={'raw':!![],'where':{'id':_0x13c651[_0x0275('0x48')]['id']}},_0x1e143e={};_0x1e143e[_0x0275('0x35')]=_['keys'](db[_0x0275('0x2f')][_0x0275('0x49')]);_0x1e143e['query']=_[_0x0275('0x4a')](_0x13c651[_0x0275('0x33')]);_0x1e143e[_0x0275('0x34')]=_[_0x0275('0x37')](_0x1e143e[_0x0275('0x35')],_0x1e143e[_0x0275('0x33')]);_0x59839d[_0x0275('0x36')]=_[_0x0275('0x37')](_0x1e143e[_0x0275('0x35')],qs[_0x0275('0x38')](_0x13c651[_0x0275('0x33')]['fields']));_0x59839d[_0x0275('0x36')]=_0x59839d[_0x0275('0x36')][_0x0275('0x4b')]?_0x59839d[_0x0275('0x36')]:_0x1e143e[_0x0275('0x35')];if(_0x13c651[_0x0275('0x33')][_0x0275('0x43')]){_0x59839d[_0x0275('0x44')]=[{'all':!![]}];}_0x59839d=_[_0x0275('0x40')]({},_0x59839d,_0x13c651[_0x0275('0x42')]);return db[_0x0275('0x2f')]['find'](_0x59839d)['then'](handleEntityNotFound(_0x3d1bfc,null))[_0x0275('0x26')](respondWithResult(_0x3d1bfc,null))[_0x0275('0x47')](handleError(_0x3d1bfc,null));};exports[_0x0275('0x4c')]=function(_0x3bd019,_0x310c6b){return db['Tag'][_0x0275('0x4c')](_0x3bd019['body'],{})[_0x0275('0x26')](function(_0x17dde0){var _0x27a469=_0x3bd019[_0x0275('0x4d')]['get']({'plain':!![]});if(!_0x27a469)throw new Error(_0x0275('0x4e'));if(_0x27a469['role']==='user'){var _0x515860=_0x17dde0[_0x0275('0x27')]({'plain':!![]});var _0x4e36fc=_0x0275('0x28');return db[_0x0275('0x4f')][_0x0275('0x50')]({'where':{'name':_0x4e36fc,'userProfileId':_0x27a469[_0x0275('0x51')]},'raw':!![]})[_0x0275('0x26')](function(_0x11794b){if(_0x11794b&&_0x11794b[_0x0275('0x52')]===0x0){return db['UserProfileResource'][_0x0275('0x4c')]({'name':_0x515860['name'],'resourceId':_0x515860['id'],'type':_0x11794b[_0x0275('0x2c')],'sectionId':_0x11794b['id']},{})[_0x0275('0x26')](function(){return _0x17dde0;});}else{return _0x17dde0;}})[_0x0275('0x47')](function(_0x1686d9){logger[_0x0275('0x2a')](_0x0275('0x53'),_0x1686d9);throw _0x1686d9;});}return _0x17dde0;})[_0x0275('0x26')](respondWithResult(_0x310c6b,0xc9))[_0x0275('0x47')](handleError(_0x310c6b,null));};exports[_0x0275('0x24')]=function(_0x3673ad,_0x545333){if(_0x3673ad['body']['id']){delete _0x3673ad[_0x0275('0x54')]['id'];}return db['Tag']['find']({'where':{'id':_0x3673ad[_0x0275('0x48')]['id']}})[_0x0275('0x26')](handleEntityNotFound(_0x545333,null))[_0x0275('0x26')](saveUpdates(_0x3673ad[_0x0275('0x54')],null))[_0x0275('0x26')](respondWithResult(_0x545333,null))[_0x0275('0x47')](handleError(_0x545333,null));};exports['destroy']=function(_0x104232,_0x163ce2){return db[_0x0275('0x2f')][_0x0275('0x50')]({'where':{'id':_0x104232[_0x0275('0x48')]['id']}})[_0x0275('0x26')](handleEntityNotFound(_0x163ce2,null))['then'](removeEntity(_0x163ce2,null))[_0x0275('0x47')](handleError(_0x163ce2,null));}; \ No newline at end of file diff --git a/server/api/tag/tag.model.js b/server/api/tag/tag.model.js index 6d47575..390de5e 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 _0xb570=['path','../../config/environment','./tag.attributes','exports','define','Tag','tools_tags','lodash','api','bluebird'];(function(_0x5c60ed,_0x69825a){var _0x23f9dc=function(_0xcf1a3f){while(--_0xcf1a3f){_0x5c60ed['push'](_0x5c60ed['shift']());}};_0x23f9dc(++_0x69825a);}(_0xb570,0x133));var _0x0b57=function(_0x53de52,_0x247e17){_0x53de52=_0x53de52-0x0;var _0x558f1f=_0xb570[_0x53de52];return _0x558f1f;};'use strict';var _=require(_0x0b57('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x0b57('0x1'));var moment=require('moment');var BPromise=require(_0x0b57('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0b57('0x3'));var rimraf=require('rimraf');var config=require(_0x0b57('0x4'));var attributes=require(_0x0b57('0x5'));module[_0x0b57('0x6')]=function(_0x5ada44,_0x4faa5d){return _0x5ada44[_0x0b57('0x7')](_0x0b57('0x8'),attributes,{'tableName':_0x0b57('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6626=['util','api','bluebird','request-promise','path','./tag.attributes','define','tools_tags'];(function(_0x18bccf,_0x515956){var _0x3d07bd=function(_0x394cb2){while(--_0x394cb2){_0x18bccf['push'](_0x18bccf['shift']());}};_0x3d07bd(++_0x515956);}(_0x6626,0x1d0));var _0x6662=function(_0x1cf21a,_0x22b0e3){_0x1cf21a=_0x1cf21a-0x0;var _0x22532d=_0x6626[_0x1cf21a];return _0x22532d;};'use strict';var _=require('lodash');var util=require(_0x6662('0x0'));var logger=require('../../config/logger')(_0x6662('0x1'));var moment=require('moment');var BPromise=require(_0x6662('0x2'));var rp=require(_0x6662('0x3'));var fs=require('fs');var path=require(_0x6662('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x6662('0x5'));module['exports']=function(_0xcd778e,_0x5e0e04){return _0xcd778e[_0x6662('0x6')]('Tag',attributes,{'tableName':_0x6662('0x7'),'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 119954a..1fbddef 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 _0xf8b2=['code','Tag,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','debug','Tag,\x20%s,\x20%s,\x20%s','error'];(function(_0x41ac36,_0x519d13){var _0x434def=function(_0x4876e2){while(--_0x4876e2){_0x41ac36['push'](_0x41ac36['shift']());}};_0x434def(++_0x519d13);}(_0xf8b2,0x15e));var _0x2f8b=function(_0x50161b,_0x4b98eb){_0x50161b=_0x50161b-0x0;var _0x58c059=_0xf8b2[_0x50161b];return _0x58c059;};'use strict';var _=require(_0x2f8b('0x0'));var util=require(_0x2f8b('0x1'));var moment=require(_0x2f8b('0x2'));var BPromise=require(_0x2f8b('0x3'));var rs=require(_0x2f8b('0x4'));var fs=require('fs');var Redis=require(_0x2f8b('0x5'));var db=require(_0x2f8b('0x6'))['db'];var utils=require(_0x2f8b('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0x2f8b('0x8'));var jayson=require(_0x2f8b('0x9'));var client=jayson[_0x2f8b('0xa')][_0x2f8b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3b0511,_0x2cc1e9,_0x449c86){return new BPromise(function(_0x24bd39,_0x366bac){return client['request'](_0x3b0511,_0x449c86)[_0x2f8b('0xc')](function(_0xb352e8){logger[_0x2f8b('0xd')]('Tag,\x20%s,\x20%s',_0x2cc1e9,_0x2f8b('0xe'));logger[_0x2f8b('0xf')](_0x2f8b('0x10'),_0x2cc1e9,'request\x20sent',JSON['stringify'](_0xb352e8));if(_0xb352e8[_0x2f8b('0x11')]){if(_0xb352e8[_0x2f8b('0x11')][_0x2f8b('0x12')]===0x1f4){logger[_0x2f8b('0x11')](_0x2f8b('0x13'),_0x2cc1e9,_0xb352e8['error'][_0x2f8b('0x14')]);return _0x366bac(_0xb352e8['error'][_0x2f8b('0x14')]);}logger[_0x2f8b('0x11')](_0x2f8b('0x13'),_0x2cc1e9,_0xb352e8[_0x2f8b('0x11')][_0x2f8b('0x14')]);return _0x24bd39(_0xb352e8[_0x2f8b('0x11')][_0x2f8b('0x14')]);}else{logger[_0x2f8b('0xd')]('Tag,\x20%s,\x20%s',_0x2cc1e9,_0x2f8b('0xe'));_0x24bd39(_0xb352e8[_0x2f8b('0x15')][_0x2f8b('0x14')]);}})[_0x2f8b('0x16')](function(_0xa79a7){logger[_0x2f8b('0x11')](_0x2f8b('0x13'),_0x2cc1e9,_0xa79a7);_0x366bac(_0xa79a7);});});} \ No newline at end of file +var _0x2121=['request\x20sent','stringify','error','message','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request','then','info','Tag,\x20%s,\x20%s'];(function(_0x43696d,_0x42a116){var _0x53f3e5=function(_0x37a3dd){while(--_0x37a3dd){_0x43696d['push'](_0x43696d['shift']());}};_0x53f3e5(++_0x42a116);}(_0x2121,0x1b4));var _0x1212=function(_0x18c17d,_0x5cf387){_0x18c17d=_0x18c17d-0x0;var _0x31e697=_0x2121[_0x18c17d];return _0x31e697;};'use strict';var _=require(_0x1212('0x0'));var util=require(_0x1212('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x1212('0x2'));var fs=require('fs');var Redis=require(_0x1212('0x3'));var db=require(_0x1212('0x4'))['db'];var utils=require(_0x1212('0x5'));var logger=require(_0x1212('0x6'))('rpc');var config=require(_0x1212('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x1212('0x8')][_0x1212('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x20fadc,_0x1b1ef5,_0x233a53){return new BPromise(function(_0x642ed5,_0x4a3d2a){return client[_0x1212('0xa')](_0x20fadc,_0x233a53)[_0x1212('0xb')](function(_0x434d23){logger[_0x1212('0xc')](_0x1212('0xd'),_0x1b1ef5,_0x1212('0xe'));logger['debug']('Tag,\x20%s,\x20%s,\x20%s',_0x1b1ef5,_0x1212('0xe'),JSON[_0x1212('0xf')](_0x434d23));if(_0x434d23[_0x1212('0x10')]){if(_0x434d23[_0x1212('0x10')]['code']===0x1f4){logger[_0x1212('0x10')](_0x1212('0xd'),_0x1b1ef5,_0x434d23[_0x1212('0x10')][_0x1212('0x11')]);return _0x4a3d2a(_0x434d23[_0x1212('0x10')][_0x1212('0x11')]);}logger[_0x1212('0x10')](_0x1212('0xd'),_0x1b1ef5,_0x434d23[_0x1212('0x10')][_0x1212('0x11')]);return _0x642ed5(_0x434d23[_0x1212('0x10')][_0x1212('0x11')]);}else{logger[_0x1212('0xc')](_0x1212('0xd'),_0x1b1ef5,_0x1212('0xe'));_0x642ed5(_0x434d23['result']['message']);}})['catch'](function(_0x3cfe21){logger[_0x1212('0x10')](_0x1212('0xd'),_0x1b1ef5,_0x3cfe21);_0x4a3d2a(_0x3cfe21);});});} \ No newline at end of file diff --git a/server/api/team/index.js b/server/api/team/index.js index 712c840..358b295 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(_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'));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(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x37c22c,_0x28a70d){_0x37c22c=_0x37c22c-0x0;var _0x119d79=_0xa9e0[_0x37c22c];return _0x119d79;};'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 08adc96..356b6d8 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 _0xe706=['STRING','sequelize','exports'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0xe706,0xa3));var _0x6e70=function(_0x1b8bc6,_0x4672de){_0x1b8bc6=_0x1b8bc6-0x0;var _0x17b6bd=_0xe706[_0x1b8bc6];return _0x17b6bd;};'use strict';var Sequelize=require(_0x6e70('0x0'));module[_0x6e70('0x1')]={'name':{'type':Sequelize[_0x6e70('0x2')],'allowNull':![],'unique':'name'},'description':{'type':Sequelize[_0x6e70('0x2')]}}; \ No newline at end of file +var _0xbaf0=['name','exports','STRING'];(function(_0x591cfd,_0x501204){var _0x4d0100=function(_0xb9ff0c){while(--_0xb9ff0c){_0x591cfd['push'](_0x591cfd['shift']());}};_0x4d0100(++_0x501204);}(_0xbaf0,0x12a));var _0x0baf=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0xbaf0[_0x6c993a];return _0x27f547;};'use strict';var Sequelize=require('sequelize');module[_0x0baf('0x0')]={'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/team/team.controller.js b/server/api/team/team.controller.js index a705dce..402d923 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 _0x0bd8=['rimraf','fast-json-patch','moment','bluebird','mustache','path','sox','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./team.socket','register','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','get','Teams','UserProfileResource','destroy','then','error','stack','name','send','index','rawAttributes','fieldName','key','model','keys','query','intersection','fields','attributes','length','hasOwnProperty','order','sort','filters','pick','merge','where','map','VIRTUAL','filter','options','include','findAll','show','params','includeAll','Team','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','getQueues','channel','isValidChannel','Unknown\x20channel','capitalize','toLowerCase','Queue','Queues','addQueues','Sequelize','ValidationError','add','ids','removeQueues','findOne','remove','addAgents','isArray','Voice','Chat','Mail','Sms','Whatsapp','sequelize','transaction','QueueId','defaults','TeamVoiceQueue','User','findOrCreate','emit','Queue:save','online','interface','UserVoiceQueueRt','upsert','isNil','format','SIP/%s','voicePause','penalty','all','TeamVoicePrefix','UserVoicePrefix','VoicePrefixId','spread','removeAgents','Fax','Openchannel','Queue:remove','getAgents','nolimit','eml-format'];(function(_0x587da1,_0x2b871d){var _0x26c5eb=function(_0x3b711f){while(--_0x3b711f){_0x587da1['push'](_0x587da1['shift']());}};_0x26c5eb(++_0x2b871d);}(_0x0bd8,0x1a0));var _0x80bd=function(_0x229f5e,_0x433f0f){_0x229f5e=_0x229f5e-0x0;var _0x2d62ff=_0x0bd8[_0x229f5e];return _0x2d62ff;};'use strict';var emlformat=require(_0x80bd('0x0'));var rimraf=require(_0x80bd('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x80bd('0x2'));var rp=require('request-promise');var moment=require(_0x80bd('0x3'));var BPromise=require(_0x80bd('0x4'));var Mustache=require(_0x80bd('0x5'));var util=require('util');var path=require(_0x80bd('0x6'));var sox=require(_0x80bd('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x80bd('0x8'));var squel=require(_0x80bd('0x9'));var crypto=require(_0x80bd('0xa'));var jsforce=require(_0x80bd('0xb'));var deskjs=require(_0x80bd('0xc'));var toCsv=require('to-csv');var querystring=require(_0x80bd('0xd'));var Papa=require('papaparse');var Redis=require(_0x80bd('0xe'));var authService=require(_0x80bd('0xf'));var qs=require(_0x80bd('0x10'));var as=require(_0x80bd('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x80bd('0x12'));var config=require(_0x80bd('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x80bd('0x14'))['db'];config['redis']=_['defaults'](config[_0x80bd('0x15')],{'host':_0x80bd('0x16'),'port':0x18eb});var socket=require(_0x80bd('0x17'))(new Redis(config['redis']));require(_0x80bd('0x18'))[_0x80bd('0x19')](socket);function respondWithStatusCode(_0x137197,_0x2fd92a){_0x2fd92a=_0x2fd92a||0xcc;return function(_0x51e4ff){if(_0x51e4ff){return _0x137197[_0x80bd('0x1a')](_0x2fd92a);}return _0x137197[_0x80bd('0x1b')](_0x2fd92a)[_0x80bd('0x1c')]();};}function respondWithResult(_0x590b05,_0x5a334e){_0x5a334e=_0x5a334e||0xc8;return function(_0x13baca){if(_0x13baca){return _0x590b05['status'](_0x5a334e)[_0x80bd('0x1d')](_0x13baca);}};}function respondWithFilteredResult(_0x5a3be8,_0x7fb582){return function(_0x4d4b2b){if(_0x4d4b2b){var _0x484a05=typeof _0x7fb582[_0x80bd('0x1e')]==='undefined'&&typeof _0x7fb582['limit']===_0x80bd('0x1f');var _0x239a74=_0x4d4b2b[_0x80bd('0x20')];var _0x52648f=_0x484a05?0x0:_0x7fb582[_0x80bd('0x1e')];var _0x748b75=_0x484a05?_0x4d4b2b[_0x80bd('0x20')]:_0x7fb582[_0x80bd('0x1e')]+_0x7fb582[_0x80bd('0x21')];var _0x5c1137;if(_0x748b75>=_0x239a74){_0x748b75=_0x239a74;_0x5c1137=0xc8;}else{_0x5c1137=0xce;}_0x5a3be8[_0x80bd('0x1b')](_0x5c1137);return _0x5a3be8[_0x80bd('0x22')](_0x80bd('0x23'),_0x52648f+'-'+_0x748b75+'/'+_0x239a74)['json'](_0x4d4b2b);}return null;};}function patchUpdates(_0xdfed34){return function(_0x59fb2a){try{jsonpatch[_0x80bd('0x24')](_0x59fb2a,_0xdfed34,!![]);}catch(_0x5574ca){return BPromise[_0x80bd('0x25')](_0x5574ca);}return _0x59fb2a['save']();};}function saveUpdates(_0x5e54ce,_0x58b8d4){return function(_0x55871f){if(_0x55871f){return _0x55871f['update'](_0x5e54ce)['then'](function(_0x5dd88f){return _0x5dd88f;});}return null;};}function removeEntity(_0x205f96,_0x4d8504){return function(_0x46f7b6){if(_0x46f7b6){return _0x46f7b6['destroy']()['then'](function(){var _0x10852f=_0x46f7b6[_0x80bd('0x26')]({'plain':!![]});var _0x4e346e=_0x80bd('0x27');return db[_0x80bd('0x28')][_0x80bd('0x29')]({'where':{'type':_0x4e346e,'resourceId':_0x10852f['id']}})[_0x80bd('0x2a')](function(){return _0x46f7b6;});})[_0x80bd('0x2a')](function(){_0x205f96['status'](0xcc)[_0x80bd('0x1c')]();});}};}function handleEntityNotFound(_0x230bf5,_0x30d5a3){return function(_0x942412){if(!_0x942412){_0x230bf5[_0x80bd('0x1a')](0x194);}return _0x942412;};}function handleError(_0x464400,_0x21dc78){_0x21dc78=_0x21dc78||0x1f4;return function(_0x2adc8e){logger[_0x80bd('0x2b')](_0x2adc8e[_0x80bd('0x2c')]);if(_0x2adc8e[_0x80bd('0x2d')]){delete _0x2adc8e['name'];}_0x464400[_0x80bd('0x1b')](_0x21dc78)[_0x80bd('0x2e')](_0x2adc8e);};}exports[_0x80bd('0x2f')]=function(_0x1ab4b4,_0x320f5a){var _0x2da2a7={},_0x598227={},_0x193913={'count':0x0,'rows':[]};var _0x5979f8=_['map'](db['Team'][_0x80bd('0x30')],function(_0x59cea4){return{'name':_0x59cea4[_0x80bd('0x31')],'type':_0x59cea4['type'][_0x80bd('0x32')]};});_0x598227[_0x80bd('0x33')]=_['map'](_0x5979f8,'name');_0x598227['query']=_[_0x80bd('0x34')](_0x1ab4b4[_0x80bd('0x35')]);_0x598227['filters']=_['intersection'](_0x598227[_0x80bd('0x33')],_0x598227['query']);_0x2da2a7['attributes']=_[_0x80bd('0x36')](_0x598227['model'],qs[_0x80bd('0x37')](_0x1ab4b4[_0x80bd('0x35')][_0x80bd('0x37')]));_0x2da2a7[_0x80bd('0x38')]=_0x2da2a7[_0x80bd('0x38')][_0x80bd('0x39')]?_0x2da2a7[_0x80bd('0x38')]:_0x598227['model'];if(!_0x1ab4b4[_0x80bd('0x35')][_0x80bd('0x3a')]('nolimit')){_0x2da2a7[_0x80bd('0x21')]=qs[_0x80bd('0x21')](_0x1ab4b4['query'][_0x80bd('0x21')]);_0x2da2a7[_0x80bd('0x1e')]=qs['offset'](_0x1ab4b4['query'][_0x80bd('0x1e')]);}_0x2da2a7[_0x80bd('0x3b')]=qs['sort'](_0x1ab4b4[_0x80bd('0x35')][_0x80bd('0x3c')]);_0x2da2a7['where']=qs[_0x80bd('0x3d')](_[_0x80bd('0x3e')](_0x1ab4b4['query'],_0x598227[_0x80bd('0x3d')]),_0x5979f8);if(_0x1ab4b4[_0x80bd('0x35')]['filter']){_0x2da2a7['where']=_[_0x80bd('0x3f')](_0x2da2a7[_0x80bd('0x40')],{'$or':_[_0x80bd('0x41')](_0x5979f8,function(_0x5adac4){if(_0x5adac4['type']!==_0x80bd('0x42')){var _0x32c9a8={};_0x32c9a8[_0x5adac4[_0x80bd('0x2d')]]={'$like':'%'+_0x1ab4b4[_0x80bd('0x35')][_0x80bd('0x43')]+'%'};return _0x32c9a8;}})});}_0x2da2a7=_['merge']({},_0x2da2a7,_0x1ab4b4[_0x80bd('0x44')]);var _0x49fbf7={'where':_0x2da2a7['where']};return db['Team'][_0x80bd('0x20')](_0x49fbf7)['then'](function(_0x16c8bf){_0x193913['count']=_0x16c8bf;if(_0x1ab4b4[_0x80bd('0x35')]['includeAll']){_0x2da2a7[_0x80bd('0x45')]=[{'all':!![]}];}return db['Team'][_0x80bd('0x46')](_0x2da2a7);})[_0x80bd('0x2a')](function(_0x3af57e){_0x193913['rows']=_0x3af57e;return _0x193913;})[_0x80bd('0x2a')](respondWithFilteredResult(_0x320f5a,_0x2da2a7))['catch'](handleError(_0x320f5a,null));};exports[_0x80bd('0x47')]=function(_0x4ba2ae,_0x5d0163){var _0x9e8339={'raw':![],'where':{'id':_0x4ba2ae[_0x80bd('0x48')]['id']}},_0x11a91e={};_0x11a91e[_0x80bd('0x33')]=_[_0x80bd('0x34')](db['Team'][_0x80bd('0x30')]);_0x11a91e[_0x80bd('0x35')]=_[_0x80bd('0x34')](_0x4ba2ae[_0x80bd('0x35')]);_0x11a91e[_0x80bd('0x3d')]=_[_0x80bd('0x36')](_0x11a91e['model'],_0x11a91e[_0x80bd('0x35')]);_0x9e8339[_0x80bd('0x38')]=_[_0x80bd('0x36')](_0x11a91e['model'],qs[_0x80bd('0x37')](_0x4ba2ae[_0x80bd('0x35')][_0x80bd('0x37')]));_0x9e8339[_0x80bd('0x38')]=_0x9e8339['attributes'][_0x80bd('0x39')]?_0x9e8339[_0x80bd('0x38')]:_0x11a91e['model'];if(_0x4ba2ae[_0x80bd('0x35')][_0x80bd('0x49')]){_0x9e8339[_0x80bd('0x45')]=[{'all':!![]}];}_0x9e8339=_[_0x80bd('0x3f')]({},_0x9e8339,_0x4ba2ae[_0x80bd('0x44')]);return db[_0x80bd('0x4a')][_0x80bd('0x4b')](_0x9e8339)[_0x80bd('0x2a')](handleEntityNotFound(_0x5d0163,null))[_0x80bd('0x2a')](respondWithResult(_0x5d0163,null))['catch'](handleError(_0x5d0163,null));};exports[_0x80bd('0x4c')]=function(_0x2c9b33,_0x1c3e91){return db[_0x80bd('0x4a')][_0x80bd('0x4c')](_0x2c9b33[_0x80bd('0x4d')],{})[_0x80bd('0x2a')](function(_0x4ff836){var _0x19b43c=_0x2c9b33[_0x80bd('0x4e')][_0x80bd('0x26')]({'plain':!![]});if(!_0x19b43c)throw new Error(_0x80bd('0x4f'));if(_0x19b43c[_0x80bd('0x50')]==='user'){var _0x1a2b96=_0x4ff836[_0x80bd('0x26')]({'plain':!![]});var _0x432296=_0x80bd('0x27');return db[_0x80bd('0x51')]['find']({'where':{'name':_0x432296,'userProfileId':_0x19b43c[_0x80bd('0x52')]},'raw':!![]})['then'](function(_0x578ea1){if(_0x578ea1&&_0x578ea1[_0x80bd('0x53')]===0x0){return db[_0x80bd('0x28')][_0x80bd('0x4c')]({'name':_0x1a2b96[_0x80bd('0x2d')],'resourceId':_0x1a2b96['id'],'type':_0x578ea1[_0x80bd('0x2d')],'sectionId':_0x578ea1['id']},{})['then'](function(){return _0x4ff836;});}else{return _0x4ff836;}})[_0x80bd('0x54')](function(_0x612a88){logger['error'](_0x80bd('0x55'),_0x612a88);throw _0x612a88;});}return _0x4ff836;})[_0x80bd('0x2a')](respondWithResult(_0x1c3e91,0xc9))[_0x80bd('0x54')](handleError(_0x1c3e91,null));};exports[_0x80bd('0x56')]=function(_0x17c527,_0x5704b9){if(_0x17c527[_0x80bd('0x4d')]['id']){delete _0x17c527[_0x80bd('0x4d')]['id'];}return db['Team']['find']({'where':{'id':_0x17c527[_0x80bd('0x48')]['id']}})[_0x80bd('0x2a')](handleEntityNotFound(_0x5704b9,null))[_0x80bd('0x2a')](saveUpdates(_0x17c527[_0x80bd('0x4d')],null))['then'](respondWithResult(_0x5704b9,null))[_0x80bd('0x54')](handleError(_0x5704b9,null));};exports[_0x80bd('0x29')]=function(_0x1657a8,_0x10cef4){return db[_0x80bd('0x4a')]['find']({'where':{'id':_0x1657a8[_0x80bd('0x48')]['id']}})[_0x80bd('0x2a')](handleEntityNotFound(_0x10cef4,null))[_0x80bd('0x2a')](removeEntity(_0x10cef4,null))[_0x80bd('0x54')](handleError(_0x10cef4,null));};exports[_0x80bd('0x57')]=function(_0x547f93,_0x4e0641,_0x56dd3a){return db[_0x80bd('0x4a')]['findOne']({'where':{'id':_0x547f93[_0x80bd('0x48')]['id']}})[_0x80bd('0x2a')](handleEntityNotFound(_0x4e0641,null))[_0x80bd('0x2a')](function(_0x2d2af2){if(!_0x547f93['query'][_0x80bd('0x58')]||!utils[_0x80bd('0x59')](_0x547f93[_0x80bd('0x35')][_0x80bd('0x58')])){throw new db['Sequelize']['ValidationError'](_0x80bd('0x5a'));}var _0x31ca84={};var _0x575827={};_0x575827[_0x80bd('0x33')]=_[_0x80bd('0x34')](db[_[_0x80bd('0x5b')](_0x547f93[_0x80bd('0x35')][_0x80bd('0x58')][_0x80bd('0x5c')]())+_0x80bd('0x5d')][_0x80bd('0x30')]);_0x575827['query']=_[_0x80bd('0x34')](_0x547f93[_0x80bd('0x35')]);_0x575827['filters']=_[_0x80bd('0x36')](_0x575827['model'],_0x575827[_0x80bd('0x35')]);_0x31ca84[_0x80bd('0x38')]=_[_0x80bd('0x36')](_0x575827[_0x80bd('0x33')],qs[_0x80bd('0x37')](_0x547f93[_0x80bd('0x35')][_0x80bd('0x37')]));_0x31ca84['attributes']=_0x31ca84[_0x80bd('0x38')][_0x80bd('0x39')]?_0x31ca84[_0x80bd('0x38')]:_0x575827[_0x80bd('0x33')];_0x31ca84[_0x80bd('0x21')]=qs['limit'](_0x547f93['query'][_0x80bd('0x21')]);_0x31ca84[_0x80bd('0x1e')]=qs[_0x80bd('0x1e')](_0x547f93[_0x80bd('0x35')][_0x80bd('0x1e')]);_0x31ca84['order']=qs[_0x80bd('0x3c')](_0x547f93[_0x80bd('0x35')][_0x80bd('0x3c')]);_0x31ca84[_0x80bd('0x40')]=qs[_0x80bd('0x3d')](_['pick'](_0x547f93['query'],_0x575827[_0x80bd('0x3d')]));_0x31ca84=_[_0x80bd('0x3f')]({},_0x31ca84,_0x547f93[_0x80bd('0x44')]);return _0x2d2af2['get'+_['capitalize'](_0x547f93[_0x80bd('0x35')][_0x80bd('0x58')][_0x80bd('0x5c')]())+_0x80bd('0x5e')](_0x31ca84);})[_0x80bd('0x2a')](respondWithResult(_0x4e0641,null))['catch'](handleError(_0x4e0641,null));};exports[_0x80bd('0x5f')]=function(_0x996b35,_0x9af21b,_0x329a2c){return db[_0x80bd('0x4a')]['findOne']({'where':{'id':_0x996b35[_0x80bd('0x48')]['id']}})['then'](function(_0x1f82e2){if(_0x1f82e2){if(!_0x996b35[_0x80bd('0x4d')][_0x80bd('0x58')]||!utils['isValidChannel'](_0x996b35[_0x80bd('0x4d')]['channel'])){throw new db[(_0x80bd('0x60'))][(_0x80bd('0x61'))](_0x80bd('0x5a'));}return _0x1f82e2[_0x80bd('0x62')+_[_0x80bd('0x5b')](_0x996b35['body']['channel'][_0x80bd('0x5c')]())+_0x80bd('0x5e')](_0x996b35[_0x80bd('0x4d')][_0x80bd('0x63')]);}return null;})[_0x80bd('0x2a')](handleEntityNotFound(_0x9af21b,null))[_0x80bd('0x2a')](respondWithStatusCode(_0x9af21b,null))[_0x80bd('0x54')](handleError(_0x9af21b,null));};exports[_0x80bd('0x64')]=function(_0x4c597e,_0x1488ba,_0x1a5851){return db[_0x80bd('0x4a')][_0x80bd('0x65')]({'where':{'id':_0x4c597e[_0x80bd('0x48')]['id']}})[_0x80bd('0x2a')](function(_0x3cdaef){if(_0x3cdaef){if(!_0x4c597e[_0x80bd('0x35')][_0x80bd('0x58')]||!utils[_0x80bd('0x59')](_0x4c597e[_0x80bd('0x35')]['channel'])){throw new db[(_0x80bd('0x60'))]['ValidationError'](_0x80bd('0x5a'));}return _0x3cdaef[_0x80bd('0x66')+_['capitalize'](_0x4c597e[_0x80bd('0x35')]['channel'][_0x80bd('0x5c')]())+_0x80bd('0x5e')](_0x4c597e[_0x80bd('0x35')][_0x80bd('0x63')]);}return null;})[_0x80bd('0x2a')](handleEntityNotFound(_0x1488ba,null))[_0x80bd('0x2a')](respondWithStatusCode(_0x1488ba,null))['catch'](handleError(_0x1488ba,null));};exports[_0x80bd('0x67')]=function(_0x355869,_0xe0f65e){var _0x5446a5=_[_0x80bd('0x68')](_0x355869[_0x80bd('0x4d')][_0x80bd('0x63')])?_0x355869['body'][_0x80bd('0x63')]:[_0x355869['body']['ids']];var _0x2aa0f9=_0x355869['params']['id'];return db[_0x80bd('0x4a')][_0x80bd('0x4b')]({'where':{'id':_0x2aa0f9}})[_0x80bd('0x2a')](handleEntityNotFound(_0xe0f65e,null))[_0x80bd('0x2a')](function(_0x2199ff){if(_0x2199ff){var _0x5aafd2=[_0x80bd('0x69'),_0x80bd('0x6a'),_0x80bd('0x6b'),_0x80bd('0x6c'),'Fax','Openchannel',_0x80bd('0x6d')];return db[_0x80bd('0x6e')][_0x80bd('0x6f')](function(_0x24a7e3){var _0x3ec08e=_['map'](_0x5aafd2,function(_0x2b8f3e){var _0x2cf232={'attributes':['id',_0x80bd('0x2d')]};if(_0x2b8f3e===_0x80bd('0x69')){_0x2cf232['through']={'attributes':['penalty']};}return _0x2199ff['get'+_0x2b8f3e+_0x80bd('0x5e')](_0x2cf232)[_0x80bd('0x2a')](function(_0x15de72){var _0x5de255=_[_0x80bd('0x41')](_0x15de72,function(_0x3c5f99){var _0x224525=_[_0x80bd('0x41')](_0x5446a5,function(_0x1bf51){var _0x2f125f={'where':{'UserId':_0x1bf51,[_0x2b8f3e+_0x80bd('0x70')]:_0x3c5f99['id']},'transaction':_0x24a7e3};if(_0x2b8f3e==='Voice'){_0x2f125f[_0x80bd('0x71')]={'penalty':_0x3c5f99[_0x80bd('0x72')]['penalty']};}return db[_0x80bd('0x73')+_0x2b8f3e+_0x80bd('0x5d')][_0x80bd('0x74')](_0x2f125f)[_0x80bd('0x2a')](function(){socket[_0x80bd('0x75')](_0x80bd('0x4e')+_0x2b8f3e+_0x80bd('0x76'),{'UserId':_0x1bf51,[_0x2b8f3e+'QueueId']:_0x3c5f99['id']});if(_0x2b8f3e!==_0x80bd('0x69')){return;}return db[_0x80bd('0x73')]['findAll']({'where':{'id':_0x5446a5,'online':0x1},'attributes':['id',_0x80bd('0x2d'),_0x80bd('0x77'),'voicePause',_0x80bd('0x78')],'raw':!![]})['then'](function(_0x18ffc0){var _0x5e91e0=_[_0x80bd('0x41')](_0x18ffc0,function(_0x2594e5){return db[_0x80bd('0x79')][_0x80bd('0x7a')]({'membername':_0x2594e5[_0x80bd('0x2d')],'UserId':_0x2594e5['id'],'queue_name':_0x3c5f99['name'],'VoiceQueueId':_0x3c5f99['id'],'interface':_[_0x80bd('0x7b')](_0x2594e5[_0x80bd('0x78')])?util[_0x80bd('0x7c')](_0x80bd('0x7d'),_0x2594e5[_0x80bd('0x2d')]):_0x2594e5['interface'],'paused':_0x2594e5[_0x80bd('0x7e')]||![],'penalty':_0x3c5f99[_0x80bd('0x72')][_0x80bd('0x7f')]},{'transaction':_0x24a7e3});});return Promise['all'](_0x5e91e0);});});});return Promise['all'](_0x224525);});return Promise[_0x80bd('0x80')](_0x5de255);})[_0x80bd('0x2a')](function(){return db[_0x80bd('0x81')]['findOne']({'where':{'teamId':_0x2aa0f9}})[_0x80bd('0x2a')](function(_0x26fc5b){if(_0x26fc5b){var _0x34087f=_[_0x80bd('0x41')](_0x5446a5,function(_0x5cb06a){db[_0x80bd('0x82')][_0x80bd('0x7a')]({'UserId':_0x5cb06a,'VoicePrefixId':_0x26fc5b[_0x80bd('0x83')]});});return Promise[_0x80bd('0x80')](_0x34087f);}});});});return Promise[_0x80bd('0x80')](_0x3ec08e)[_0x80bd('0x2a')](function(){return _0x2199ff[_0x80bd('0x67')](_0x5446a5,{'transaction':_0x24a7e3})[_0x80bd('0x84')](function(_0x50af6b){return _0x50af6b;});});});}})[_0x80bd('0x2a')](respondWithResult(_0xe0f65e,null))['catch'](handleError(_0xe0f65e,null));};exports[_0x80bd('0x85')]=function(_0x5ea65e,_0x44d0dd){var _0x2a2e0c=_[_0x80bd('0x68')](_0x5ea65e[_0x80bd('0x35')][_0x80bd('0x63')])?_0x5ea65e['query'][_0x80bd('0x63')]:[_0x5ea65e[_0x80bd('0x35')][_0x80bd('0x63')]];var _0x34913c=_0x5ea65e[_0x80bd('0x48')]['id'];return db[_0x80bd('0x4a')]['find']({'where':{'id':_0x34913c}})[_0x80bd('0x2a')](handleEntityNotFound(_0x44d0dd,null))['then'](function(_0x5e6693){if(_0x5e6693){var _0x2f9181=['Voice',_0x80bd('0x6a'),_0x80bd('0x6b'),_0x80bd('0x6c'),_0x80bd('0x86'),_0x80bd('0x87'),_0x80bd('0x6d')];return db[_0x80bd('0x6e')][_0x80bd('0x6f')](function(_0x4770a2){var _0x5edbee=_[_0x80bd('0x41')](_0x2f9181,function(_0x1f56a3){var _0x391d9c={'attributes':['id','name']};return _0x5e6693[_0x80bd('0x26')+_0x1f56a3+'Queues'](_0x391d9c)[_0x80bd('0x2a')](function(_0x12b780){var _0x105163=_[_0x80bd('0x41')](_0x12b780,function(_0x4e9d0a){return _0x4e9d0a[_0x80bd('0x85')](_0x2a2e0c,{'transaction':_0x4770a2})[_0x80bd('0x2a')](function(){var _0x5c0495=_['map'](_0x2a2e0c,function(_0x49c631){socket[_0x80bd('0x75')]('user'+_0x1f56a3+_0x80bd('0x88'),{'UserId':Number(_0x49c631),[_0x1f56a3+_0x80bd('0x70')]:_0x4e9d0a['id']});if(_0x1f56a3!==_0x80bd('0x69')){return;}return db['UserVoiceQueueRt'][_0x80bd('0x29')]({'where':{'VoiceQueueId':_0x4e9d0a['id'],'UserId':_0x49c631},'transaction':_0x4770a2});});return Promise[_0x80bd('0x80')](_0x5c0495);});});return Promise[_0x80bd('0x80')](_0x105163);});});return Promise['all'](_0x5edbee)[_0x80bd('0x2a')](function(){return _0x5e6693[_0x80bd('0x85')](_0x2a2e0c,{'transaction':_0x4770a2});})['then'](function(){return db['TeamVoicePrefix'][_0x80bd('0x65')]({'where':{'teamId':_0x34913c}})['then'](function(_0x55c530){if(_0x55c530){var _0x39d2a3=_[_0x80bd('0x41')](_0x2a2e0c,function(_0x4e2d35){db['UserVoicePrefix'][_0x80bd('0x29')]({'where':{'UserId':_0x4e2d35,'VoicePrefixId':_0x55c530[_0x80bd('0x83')]}});});return Promise[_0x80bd('0x80')](_0x39d2a3);}});});});}})[_0x80bd('0x2a')](respondWithStatusCode(_0x44d0dd,null))[_0x80bd('0x54')](handleError(_0x44d0dd,null));};exports[_0x80bd('0x89')]=function(_0x21f16c,_0x322a2f,_0x27a814){var _0x4f1f70={};var _0x4a24ad={};var _0x5e8381;var _0x35fffb;return db[_0x80bd('0x4a')][_0x80bd('0x65')]({'where':{'id':_0x21f16c[_0x80bd('0x48')]['id']}})[_0x80bd('0x2a')](handleEntityNotFound(_0x322a2f,null))[_0x80bd('0x2a')](function(_0x1858de){if(_0x1858de){_0x5e8381=_0x1858de;_0x4a24ad['model']=_[_0x80bd('0x34')](db['User'][_0x80bd('0x30')]);_0x4a24ad[_0x80bd('0x35')]=_[_0x80bd('0x34')](_0x21f16c[_0x80bd('0x35')]);_0x4a24ad[_0x80bd('0x3d')]=_[_0x80bd('0x36')](_0x4a24ad[_0x80bd('0x33')],_0x4a24ad[_0x80bd('0x35')]);_0x4f1f70[_0x80bd('0x38')]=_['intersection'](_0x4a24ad[_0x80bd('0x33')],qs[_0x80bd('0x37')](_0x21f16c['query']['fields']));_0x4f1f70[_0x80bd('0x38')]=_0x4f1f70[_0x80bd('0x38')][_0x80bd('0x39')]?_0x4f1f70[_0x80bd('0x38')]:_0x4a24ad['model'];_0x4f1f70[_0x80bd('0x3b')]=qs[_0x80bd('0x3c')](_0x21f16c[_0x80bd('0x35')][_0x80bd('0x3c')]);_0x4f1f70['where']=qs[_0x80bd('0x3d')](_[_0x80bd('0x3e')](_0x21f16c['query'],_0x4a24ad[_0x80bd('0x3d')]));if(_0x21f16c['query'][_0x80bd('0x43')]){_0x4f1f70[_0x80bd('0x40')]=_[_0x80bd('0x3f')](_0x4f1f70[_0x80bd('0x40')],{'$or':_[_0x80bd('0x41')](_0x4f1f70['attributes'],function(_0x53ff8f){var _0xba4e60={};_0xba4e60[_0x53ff8f]={'$like':'%'+_0x21f16c[_0x80bd('0x35')][_0x80bd('0x43')]+'%'};return _0xba4e60;})});}_0x4f1f70=_[_0x80bd('0x3f')]({},_0x4f1f70,_0x21f16c[_0x80bd('0x44')]);return _0x5e8381[_0x80bd('0x89')](_0x4f1f70);}})[_0x80bd('0x2a')](function(_0x40ce58){if(_0x40ce58){_0x35fffb=_0x40ce58[_0x80bd('0x39')];if(!_0x21f16c[_0x80bd('0x35')][_0x80bd('0x3a')](_0x80bd('0x8a'))){_0x4f1f70[_0x80bd('0x21')]=qs[_0x80bd('0x21')](_0x21f16c[_0x80bd('0x35')][_0x80bd('0x21')]);_0x4f1f70[_0x80bd('0x1e')]=qs[_0x80bd('0x1e')](_0x21f16c['query'][_0x80bd('0x1e')]);}return _0x5e8381[_0x80bd('0x89')](_0x4f1f70);}})['then'](function(_0x277698){if(_0x277698){return _0x277698?{'count':_0x35fffb,'rows':_0x277698}:null;}})['then'](respondWithResult(_0x322a2f,null))['catch'](handleError(_0x322a2f,null));}; \ No newline at end of file +var _0x57c4=['body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','Teams','UserProfileSection','find','userProfileId','UserProfileResource','destroy','sequelize','transaction','TeamVoicePrefix','VoicePrefixId','SELECT\x20UserId\x20FROM\x20user_has_teams\x20WHERE\x20TeamId\x20=\x20','QueryTypes','SELECT','getQueues','findOne','channel','isValidChannel','ValidationError','Unknown\x20channel','capitalize','toLowerCase','Queue','order','Queues','addQueues','Sequelize','add','ids','removeQueues','remove','addAgents','isArray','Voice','Mail','Fax','Openchannel','Whatsapp','through','penalty','User','findOrCreate','emit','Queue:save','online','voicePause','UserVoiceQueueRt','upsert','isNil','format','interface','TeamVoiceQueue','all','UserVoicePrefix','spread','removeAgents','Chat','Sms','pick','getAgents','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','register','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','reject','save','update','then','error','stack','name','send','index','map','Team','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','filter','merge','where','VIRTUAL','options','includeAll','include','findAll','catch','show','params','rawAttributes','create'];(function(_0x5959c9,_0x2ed153){var _0x4ffcbc=function(_0x459b7a){while(--_0x459b7a){_0x5959c9['push'](_0x5959c9['shift']());}};_0x4ffcbc(++_0x2ed153);}(_0x57c4,0xcc));var _0x457c=function(_0x51ec2d,_0x5794b0){_0x51ec2d=_0x51ec2d-0x0;var _0x74d9db=_0x57c4[_0x51ec2d];return _0x74d9db;};'use strict';var emlformat=require(_0x457c('0x0'));var rimraf=require(_0x457c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x457c('0x2'));var moment=require('moment');var BPromise=require(_0x457c('0x3'));var Mustache=require(_0x457c('0x4'));var util=require(_0x457c('0x5'));var path=require(_0x457c('0x6'));var sox=require(_0x457c('0x7'));var csv=require(_0x457c('0x8'));var ejs=require(_0x457c('0x9'));var fs=require('fs');var fs_extra=require(_0x457c('0xa'));var _=require('lodash');var squel=require(_0x457c('0xb'));var crypto=require(_0x457c('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x457c('0xd'));var toCsv=require(_0x457c('0x8'));var querystring=require('querystring');var Papa=require(_0x457c('0xe'));var Redis=require(_0x457c('0xf'));var authService=require(_0x457c('0x10'));var qs=require(_0x457c('0x11'));var as=require(_0x457c('0x12'));var hardwareService=require(_0x457c('0x13'));var logger=require(_0x457c('0x14'))(_0x457c('0x15'));var utils=require(_0x457c('0x16'));var config=require(_0x457c('0x17'));var licenseUtil=require(_0x457c('0x18'));var db=require(_0x457c('0x19'))['db'];config[_0x457c('0x1a')]=_[_0x457c('0x1b')](config[_0x457c('0x1a')],{'host':_0x457c('0x1c'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x457c('0x1a')]));require('./team.socket')[_0x457c('0x1d')](socket);function respondWithStatusCode(_0x31077b,_0x40c2d8){_0x40c2d8=_0x40c2d8||0xcc;return function(_0x5f04e3){if(_0x5f04e3){return _0x31077b[_0x457c('0x1e')](_0x40c2d8);}return _0x31077b[_0x457c('0x1f')](_0x40c2d8)[_0x457c('0x20')]();};}function respondWithResult(_0x4d4aa7,_0x1060ae){_0x1060ae=_0x1060ae||0xc8;return function(_0x2913bb){if(_0x2913bb){return _0x4d4aa7[_0x457c('0x1f')](_0x1060ae)[_0x457c('0x21')](_0x2913bb);}};}function respondWithFilteredResult(_0x4bbe6d,_0x4e75d8){return function(_0x2ac1d4){if(_0x2ac1d4){var _0x3534ec=typeof _0x4e75d8[_0x457c('0x22')]==='undefined'&&typeof _0x4e75d8[_0x457c('0x23')]===_0x457c('0x24');var _0x50966d=_0x2ac1d4[_0x457c('0x25')];var _0x17b01b=_0x3534ec?0x0:_0x4e75d8[_0x457c('0x22')];var _0x5c2895=_0x3534ec?_0x2ac1d4[_0x457c('0x25')]:_0x4e75d8[_0x457c('0x22')]+_0x4e75d8[_0x457c('0x23')];var _0x27a531;if(_0x5c2895>=_0x50966d){_0x5c2895=_0x50966d;_0x27a531=0xc8;}else{_0x27a531=0xce;}_0x4bbe6d['status'](_0x27a531);return _0x4bbe6d[_0x457c('0x26')](_0x457c('0x27'),_0x17b01b+'-'+_0x5c2895+'/'+_0x50966d)[_0x457c('0x21')](_0x2ac1d4);}return null;};}function patchUpdates(_0x55f633){return function(_0x3ae11d){try{jsonpatch['apply'](_0x3ae11d,_0x55f633,!![]);}catch(_0x3a808a){return BPromise[_0x457c('0x28')](_0x3a808a);}return _0x3ae11d[_0x457c('0x29')]();};}function saveUpdates(_0x39be3f,_0x273f22){return function(_0x43aa51){if(_0x43aa51){return _0x43aa51[_0x457c('0x2a')](_0x39be3f)[_0x457c('0x2b')](function(_0x29aeb3){return _0x29aeb3;});}return null;};}function handleEntityNotFound(_0x2d2894,_0x5ba6af){return function(_0x23d24a){if(!_0x23d24a){_0x2d2894[_0x457c('0x1e')](0x194);}return _0x23d24a;};}function handleError(_0x344aa3,_0x579fd0){_0x579fd0=_0x579fd0||0x1f4;return function(_0xda931c){logger[_0x457c('0x2c')](_0xda931c[_0x457c('0x2d')]);if(_0xda931c[_0x457c('0x2e')]){delete _0xda931c[_0x457c('0x2e')];}_0x344aa3[_0x457c('0x1f')](_0x579fd0)[_0x457c('0x2f')](_0xda931c);};}exports[_0x457c('0x30')]=function(_0x111e5e,_0x36a863){var _0x154018={},_0x2773b8={},_0x3c59a7={'count':0x0,'rows':[]};var _0x418f84=_[_0x457c('0x31')](db[_0x457c('0x32')]['rawAttributes'],function(_0x31e68b){return{'name':_0x31e68b[_0x457c('0x33')],'type':_0x31e68b[_0x457c('0x34')][_0x457c('0x35')]};});_0x2773b8[_0x457c('0x36')]=_['map'](_0x418f84,_0x457c('0x2e'));_0x2773b8[_0x457c('0x37')]=_[_0x457c('0x38')](_0x111e5e['query']);_0x2773b8[_0x457c('0x39')]=_['intersection'](_0x2773b8[_0x457c('0x36')],_0x2773b8[_0x457c('0x37')]);_0x154018[_0x457c('0x3a')]=_[_0x457c('0x3b')](_0x2773b8['model'],qs[_0x457c('0x3c')](_0x111e5e['query'][_0x457c('0x3c')]));_0x154018[_0x457c('0x3a')]=_0x154018[_0x457c('0x3a')][_0x457c('0x3d')]?_0x154018[_0x457c('0x3a')]:_0x2773b8[_0x457c('0x36')];if(!_0x111e5e[_0x457c('0x37')][_0x457c('0x3e')](_0x457c('0x3f'))){_0x154018['limit']=qs[_0x457c('0x23')](_0x111e5e[_0x457c('0x37')]['limit']);_0x154018['offset']=qs[_0x457c('0x22')](_0x111e5e[_0x457c('0x37')][_0x457c('0x22')]);}_0x154018['order']=qs[_0x457c('0x40')](_0x111e5e[_0x457c('0x37')][_0x457c('0x40')]);_0x154018['where']=qs[_0x457c('0x39')](_['pick'](_0x111e5e['query'],_0x2773b8[_0x457c('0x39')]),_0x418f84);if(_0x111e5e[_0x457c('0x37')][_0x457c('0x41')]){_0x154018['where']=_[_0x457c('0x42')](_0x154018[_0x457c('0x43')],{'$or':_[_0x457c('0x31')](_0x418f84,function(_0x4f17c8){if(_0x4f17c8['type']!==_0x457c('0x44')){var _0x28d3d9={};_0x28d3d9[_0x4f17c8[_0x457c('0x2e')]]={'$like':'%'+_0x111e5e['query'][_0x457c('0x41')]+'%'};return _0x28d3d9;}})});}_0x154018=_[_0x457c('0x42')]({},_0x154018,_0x111e5e[_0x457c('0x45')]);var _0x56f25b={'where':_0x154018[_0x457c('0x43')]};return db[_0x457c('0x32')][_0x457c('0x25')](_0x56f25b)[_0x457c('0x2b')](function(_0x5fd56a){_0x3c59a7[_0x457c('0x25')]=_0x5fd56a;if(_0x111e5e[_0x457c('0x37')][_0x457c('0x46')]){_0x154018[_0x457c('0x47')]=[{'all':!![]}];}return db[_0x457c('0x32')][_0x457c('0x48')](_0x154018);})[_0x457c('0x2b')](function(_0x40d490){_0x3c59a7['rows']=_0x40d490;return _0x3c59a7;})[_0x457c('0x2b')](respondWithFilteredResult(_0x36a863,_0x154018))[_0x457c('0x49')](handleError(_0x36a863,null));};exports[_0x457c('0x4a')]=function(_0x5df1fc,_0x54ffd1){var _0x4e23a8={'raw':![],'where':{'id':_0x5df1fc[_0x457c('0x4b')]['id']}},_0x1a740b={};_0x1a740b[_0x457c('0x36')]=_['keys'](db[_0x457c('0x32')][_0x457c('0x4c')]);_0x1a740b[_0x457c('0x37')]=_[_0x457c('0x38')](_0x5df1fc[_0x457c('0x37')]);_0x1a740b['filters']=_['intersection'](_0x1a740b[_0x457c('0x36')],_0x1a740b[_0x457c('0x37')]);_0x4e23a8['attributes']=_[_0x457c('0x3b')](_0x1a740b[_0x457c('0x36')],qs[_0x457c('0x3c')](_0x5df1fc[_0x457c('0x37')]['fields']));_0x4e23a8[_0x457c('0x3a')]=_0x4e23a8[_0x457c('0x3a')][_0x457c('0x3d')]?_0x4e23a8['attributes']:_0x1a740b['model'];if(_0x5df1fc[_0x457c('0x37')][_0x457c('0x46')]){_0x4e23a8[_0x457c('0x47')]=[{'all':!![]}];}_0x4e23a8=_[_0x457c('0x42')]({},_0x4e23a8,_0x5df1fc[_0x457c('0x45')]);return db[_0x457c('0x32')]['find'](_0x4e23a8)[_0x457c('0x2b')](handleEntityNotFound(_0x54ffd1,null))['then'](respondWithResult(_0x54ffd1,null))[_0x457c('0x49')](handleError(_0x54ffd1,null));};exports[_0x457c('0x4d')]=function(_0x20688d,_0x3595fd){return db[_0x457c('0x32')][_0x457c('0x4d')](_0x20688d[_0x457c('0x4e')],{})[_0x457c('0x2b')](function(_0x55e5a3){var _0x52f52f=_0x20688d['user'][_0x457c('0x4f')]({'plain':!![]});if(!_0x52f52f)throw new Error(_0x457c('0x50'));if(_0x52f52f['role']===_0x457c('0x51')){var _0x1bae60=_0x55e5a3['get']({'plain':!![]});var _0x346ea0=_0x457c('0x52');return db[_0x457c('0x53')][_0x457c('0x54')]({'where':{'name':_0x346ea0,'userProfileId':_0x52f52f[_0x457c('0x55')]},'raw':!![]})[_0x457c('0x2b')](function(_0x32b6b1){if(_0x32b6b1&&_0x32b6b1['autoAssociation']===0x0){return db[_0x457c('0x56')][_0x457c('0x4d')]({'name':_0x1bae60[_0x457c('0x2e')],'resourceId':_0x1bae60['id'],'type':_0x32b6b1[_0x457c('0x2e')],'sectionId':_0x32b6b1['id']},{})[_0x457c('0x2b')](function(){return _0x55e5a3;});}else{return _0x55e5a3;}})['catch'](function(_0x396df4){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x396df4);throw _0x396df4;});}return _0x55e5a3;})[_0x457c('0x2b')](respondWithResult(_0x3595fd,0xc9))[_0x457c('0x49')](handleError(_0x3595fd,null));};exports[_0x457c('0x2a')]=function(_0x51f6f6,_0x1252ce){if(_0x51f6f6[_0x457c('0x4e')]['id']){delete _0x51f6f6[_0x457c('0x4e')]['id'];}return db[_0x457c('0x32')][_0x457c('0x54')]({'where':{'id':_0x51f6f6['params']['id']}})['then'](handleEntityNotFound(_0x1252ce,null))[_0x457c('0x2b')](saveUpdates(_0x51f6f6[_0x457c('0x4e')],null))['then'](respondWithResult(_0x1252ce,null))['catch'](handleError(_0x1252ce,null));};exports[_0x457c('0x57')]=function(_0x3c851d,_0x411a2e){var _0x3e3b13=_0x3c851d[_0x457c('0x4b')]['id'];var _0x1b7468=0x0;return db[_0x457c('0x58')][_0x457c('0x59')](function(_0x43b9ae){return db[_0x457c('0x5a')][_0x457c('0x54')]({'where':{'TeamId':_0x3e3b13}})[_0x457c('0x2b')](function(_0x1c29ec){if(_0x1c29ec===null){return;}_0x1b7468=_0x1c29ec[_0x457c('0x5b')];var _0x1dc520=_0x457c('0x5c')+_0x3e3b13;return db[_0x457c('0x58')][_0x457c('0x37')](_0x1dc520,{'type':db['Sequelize'][_0x457c('0x5d')][_0x457c('0x5e')],'raw':!![],'transaction':_0x43b9ae})[_0x457c('0x2b')](function(_0x475b86){var _0x8fa58a=_['map'](_0x475b86,function(_0xc94491){return Number(_0xc94491['UserId']);});return db['UserVoicePrefix'][_0x457c('0x57')]({'where':{'UserId':{'$in':_0x8fa58a},'VoicePrefixId':_0x1b7468},'transaction':_0x43b9ae});});})[_0x457c('0x2b')](function(){return db[_0x457c('0x32')]['destroy']({'where':{'id':_0x3e3b13},'cascade':!![],'transaction':_0x43b9ae});})['then'](function(_0x3de519){if(_0x3de519===0x0){_0x411a2e[_0x457c('0x1e')](0x194);}else{return db[_0x457c('0x56')]['destroy']({'where':{'type':_0x457c('0x52'),'resourceId':_0x3e3b13},'cascade':!![],'transaction':_0x43b9ae})['then'](function(){_0x411a2e[_0x457c('0x1f')](0xcc)[_0x457c('0x20')]();});}})[_0x457c('0x49')](function(_0x3129a5){_0x411a2e['status'](0x1f4)[_0x457c('0x2f')](_0x3129a5);});});};exports[_0x457c('0x5f')]=function(_0x34b964,_0x10baf6,_0x480074){return db['Team'][_0x457c('0x60')]({'where':{'id':_0x34b964[_0x457c('0x4b')]['id']}})[_0x457c('0x2b')](handleEntityNotFound(_0x10baf6,null))[_0x457c('0x2b')](function(_0x2fe6fa){if(!_0x34b964[_0x457c('0x37')][_0x457c('0x61')]||!utils[_0x457c('0x62')](_0x34b964[_0x457c('0x37')][_0x457c('0x61')])){throw new db['Sequelize'][(_0x457c('0x63'))](_0x457c('0x64'));}var _0x40ce76={};var _0x4fc093={};_0x4fc093[_0x457c('0x36')]=_['keys'](db[_[_0x457c('0x65')](_0x34b964[_0x457c('0x37')]['channel'][_0x457c('0x66')]())+_0x457c('0x67')][_0x457c('0x4c')]);_0x4fc093[_0x457c('0x37')]=_[_0x457c('0x38')](_0x34b964[_0x457c('0x37')]);_0x4fc093['filters']=_[_0x457c('0x3b')](_0x4fc093[_0x457c('0x36')],_0x4fc093[_0x457c('0x37')]);_0x40ce76['attributes']=_[_0x457c('0x3b')](_0x4fc093[_0x457c('0x36')],qs[_0x457c('0x3c')](_0x34b964[_0x457c('0x37')][_0x457c('0x3c')]));_0x40ce76[_0x457c('0x3a')]=_0x40ce76[_0x457c('0x3a')][_0x457c('0x3d')]?_0x40ce76[_0x457c('0x3a')]:_0x4fc093[_0x457c('0x36')];_0x40ce76['limit']=qs[_0x457c('0x23')](_0x34b964[_0x457c('0x37')][_0x457c('0x23')]);_0x40ce76[_0x457c('0x22')]=qs['offset'](_0x34b964[_0x457c('0x37')][_0x457c('0x22')]);_0x40ce76[_0x457c('0x68')]=qs[_0x457c('0x40')](_0x34b964[_0x457c('0x37')][_0x457c('0x40')]);_0x40ce76[_0x457c('0x43')]=qs['filters'](_['pick'](_0x34b964[_0x457c('0x37')],_0x4fc093['filters']));_0x40ce76=_[_0x457c('0x42')]({},_0x40ce76,_0x34b964['options']);return _0x2fe6fa[_0x457c('0x4f')+_[_0x457c('0x65')](_0x34b964[_0x457c('0x37')][_0x457c('0x61')]['toLowerCase']())+_0x457c('0x69')](_0x40ce76);})[_0x457c('0x2b')](respondWithResult(_0x10baf6,null))[_0x457c('0x49')](handleError(_0x10baf6,null));};exports[_0x457c('0x6a')]=function(_0x1ab599,_0x5a10a2,_0x193b48){return db[_0x457c('0x32')][_0x457c('0x60')]({'where':{'id':_0x1ab599[_0x457c('0x4b')]['id']}})[_0x457c('0x2b')](function(_0x2eddee){if(_0x2eddee){if(!_0x1ab599[_0x457c('0x4e')][_0x457c('0x61')]||!utils[_0x457c('0x62')](_0x1ab599[_0x457c('0x4e')][_0x457c('0x61')])){throw new db[(_0x457c('0x6b'))][(_0x457c('0x63'))]('Unknown\x20channel');}return _0x2eddee[_0x457c('0x6c')+_[_0x457c('0x65')](_0x1ab599['body'][_0x457c('0x61')][_0x457c('0x66')]())+_0x457c('0x69')](_0x1ab599[_0x457c('0x4e')][_0x457c('0x6d')]);}return null;})[_0x457c('0x2b')](handleEntityNotFound(_0x5a10a2,null))[_0x457c('0x2b')](respondWithStatusCode(_0x5a10a2,null))[_0x457c('0x49')](handleError(_0x5a10a2,null));};exports[_0x457c('0x6e')]=function(_0x5259fe,_0x15331f,_0xf1872b){return db[_0x457c('0x32')]['findOne']({'where':{'id':_0x5259fe[_0x457c('0x4b')]['id']}})[_0x457c('0x2b')](function(_0x2dde5a){if(_0x2dde5a){if(!_0x5259fe[_0x457c('0x37')][_0x457c('0x61')]||!utils['isValidChannel'](_0x5259fe[_0x457c('0x37')][_0x457c('0x61')])){throw new db[(_0x457c('0x6b'))][(_0x457c('0x63'))]('Unknown\x20channel');}return _0x2dde5a[_0x457c('0x6f')+_[_0x457c('0x65')](_0x5259fe['query'][_0x457c('0x61')][_0x457c('0x66')]())+_0x457c('0x69')](_0x5259fe[_0x457c('0x37')][_0x457c('0x6d')]);}return null;})[_0x457c('0x2b')](handleEntityNotFound(_0x15331f,null))[_0x457c('0x2b')](respondWithStatusCode(_0x15331f,null))[_0x457c('0x49')](handleError(_0x15331f,null));};exports[_0x457c('0x70')]=function(_0x350c54,_0x2a581d){var _0x278333=_[_0x457c('0x71')](_0x350c54['body'][_0x457c('0x6d')])?_0x350c54[_0x457c('0x4e')][_0x457c('0x6d')]:[_0x350c54[_0x457c('0x4e')]['ids']];var _0x42a64d=_0x350c54[_0x457c('0x4b')]['id'];return db['Team']['find']({'where':{'id':_0x42a64d}})['then'](handleEntityNotFound(_0x2a581d,null))[_0x457c('0x2b')](function(_0x1c75c3){if(_0x1c75c3){var _0x27545d=[_0x457c('0x72'),'Chat',_0x457c('0x73'),'Sms',_0x457c('0x74'),_0x457c('0x75'),_0x457c('0x76')];return db[_0x457c('0x58')][_0x457c('0x59')](function(_0x12f3e3){var _0x3f4ed1=_['map'](_0x27545d,function(_0x377463){var _0x1cc053={'attributes':['id',_0x457c('0x2e')]};if(_0x377463===_0x457c('0x72')){_0x1cc053[_0x457c('0x77')]={'attributes':['penalty']};}return _0x1c75c3['get'+_0x377463+_0x457c('0x69')](_0x1cc053)['then'](function(_0x43c88e){var _0x5cd3e1=_['map'](_0x43c88e,function(_0x3c1390){var _0x30a83e=_[_0x457c('0x31')](_0x278333,function(_0x223391){var _0x41cad6={'where':{'UserId':_0x223391,[_0x377463+'QueueId']:_0x3c1390['id']},'transaction':_0x12f3e3};if(_0x377463==='Voice'){_0x41cad6['defaults']={'penalty':_0x3c1390['TeamVoiceQueue'][_0x457c('0x78')]};}return db[_0x457c('0x79')+_0x377463+_0x457c('0x67')][_0x457c('0x7a')](_0x41cad6)[_0x457c('0x2b')](function(){socket[_0x457c('0x7b')](_0x457c('0x51')+_0x377463+_0x457c('0x7c'),{'UserId':_0x223391,[_0x377463+'QueueId']:_0x3c1390['id']});if(_0x377463!==_0x457c('0x72')){return;}return db[_0x457c('0x79')][_0x457c('0x48')]({'where':{'id':_0x278333,'online':0x1},'attributes':['id',_0x457c('0x2e'),_0x457c('0x7d'),_0x457c('0x7e'),'interface'],'raw':!![]})[_0x457c('0x2b')](function(_0x1b56d0){var _0x2c8e8b=_[_0x457c('0x31')](_0x1b56d0,function(_0x5b7cdc){return db[_0x457c('0x7f')][_0x457c('0x80')]({'membername':_0x5b7cdc['name'],'UserId':_0x5b7cdc['id'],'queue_name':_0x3c1390[_0x457c('0x2e')],'VoiceQueueId':_0x3c1390['id'],'interface':_[_0x457c('0x81')](_0x5b7cdc['interface'])?util[_0x457c('0x82')]('SIP/%s',_0x5b7cdc['name']):_0x5b7cdc[_0x457c('0x83')],'paused':_0x5b7cdc['voicePause']||![],'penalty':_0x3c1390[_0x457c('0x84')]['penalty']},{'transaction':_0x12f3e3});});return Promise[_0x457c('0x85')](_0x2c8e8b);});});});return Promise[_0x457c('0x85')](_0x30a83e);});return Promise['all'](_0x5cd3e1);})[_0x457c('0x2b')](function(){return db[_0x457c('0x5a')]['findOne']({'where':{'teamId':_0x42a64d}})[_0x457c('0x2b')](function(_0x2c0771){if(_0x2c0771){var _0x2fd00d=_[_0x457c('0x31')](_0x278333,function(_0x284667){db[_0x457c('0x86')][_0x457c('0x80')]({'UserId':_0x284667,'VoicePrefixId':_0x2c0771[_0x457c('0x5b')]});});return Promise[_0x457c('0x85')](_0x2fd00d);}});});});return Promise[_0x457c('0x85')](_0x3f4ed1)['then'](function(){return _0x1c75c3[_0x457c('0x70')](_0x278333,{'transaction':_0x12f3e3})[_0x457c('0x87')](function(_0x5a9966){return _0x5a9966;});});});}})[_0x457c('0x2b')](respondWithResult(_0x2a581d,null))[_0x457c('0x49')](handleError(_0x2a581d,null));};exports[_0x457c('0x88')]=function(_0x34eb87,_0x1df622){var _0x3d3ef3=_[_0x457c('0x71')](_0x34eb87[_0x457c('0x37')][_0x457c('0x6d')])?_0x34eb87[_0x457c('0x37')][_0x457c('0x6d')]:[_0x34eb87[_0x457c('0x37')][_0x457c('0x6d')]];var _0x2d6293=_0x34eb87[_0x457c('0x4b')]['id'];return db[_0x457c('0x32')][_0x457c('0x54')]({'where':{'id':_0x2d6293}})['then'](handleEntityNotFound(_0x1df622,null))[_0x457c('0x2b')](function(_0x32a5ab){if(_0x32a5ab){var _0x10e97e=['Voice',_0x457c('0x89'),_0x457c('0x73'),_0x457c('0x8a'),_0x457c('0x74'),_0x457c('0x75'),_0x457c('0x76')];return db['sequelize']['transaction'](function(_0x803f5){var _0x5bc300=_[_0x457c('0x31')](_0x10e97e,function(_0x34dff5){var _0x460232={'attributes':['id',_0x457c('0x2e')]};return _0x32a5ab['get'+_0x34dff5+_0x457c('0x69')](_0x460232)[_0x457c('0x2b')](function(_0x13765d){var _0x60082b=_[_0x457c('0x31')](_0x13765d,function(_0x3ce5fb){return _0x3ce5fb[_0x457c('0x88')](_0x3d3ef3,{'transaction':_0x803f5})['then'](function(){var _0x375e17=_[_0x457c('0x31')](_0x3d3ef3,function(_0x386de6){socket[_0x457c('0x7b')](_0x457c('0x51')+_0x34dff5+'Queue:remove',{'UserId':Number(_0x386de6),[_0x34dff5+'QueueId']:_0x3ce5fb['id']});if(_0x34dff5!=='Voice'){return;}return db[_0x457c('0x7f')][_0x457c('0x57')]({'where':{'VoiceQueueId':_0x3ce5fb['id'],'UserId':_0x386de6},'transaction':_0x803f5});});return Promise[_0x457c('0x85')](_0x375e17);});});return Promise[_0x457c('0x85')](_0x60082b);});});return Promise['all'](_0x5bc300)[_0x457c('0x2b')](function(){return _0x32a5ab[_0x457c('0x88')](_0x3d3ef3,{'transaction':_0x803f5});})[_0x457c('0x2b')](function(){return db[_0x457c('0x5a')][_0x457c('0x60')]({'where':{'teamId':_0x2d6293}})['then'](function(_0x5cfa2a){if(_0x5cfa2a){var _0x29c31b=_[_0x457c('0x31')](_0x3d3ef3,function(_0x5a414e){db['UserVoicePrefix'][_0x457c('0x57')]({'where':{'UserId':_0x5a414e,'VoicePrefixId':_0x5cfa2a[_0x457c('0x5b')]}});});return Promise['all'](_0x29c31b);}});});});}})['then'](respondWithStatusCode(_0x1df622,null))['catch'](handleError(_0x1df622,null));};exports['getAgents']=function(_0x46fde1,_0x413682,_0x17ee95){var _0x3edb20={};var _0x4492da={};var _0x118d4f;var _0x479307;return db[_0x457c('0x32')][_0x457c('0x60')]({'where':{'id':_0x46fde1[_0x457c('0x4b')]['id']}})[_0x457c('0x2b')](handleEntityNotFound(_0x413682,null))[_0x457c('0x2b')](function(_0x39aa90){if(_0x39aa90){_0x118d4f=_0x39aa90;_0x4492da['model']=_[_0x457c('0x38')](db[_0x457c('0x79')][_0x457c('0x4c')]);_0x4492da[_0x457c('0x37')]=_['keys'](_0x46fde1['query']);_0x4492da[_0x457c('0x39')]=_[_0x457c('0x3b')](_0x4492da['model'],_0x4492da['query']);_0x3edb20[_0x457c('0x3a')]=_[_0x457c('0x3b')](_0x4492da[_0x457c('0x36')],qs[_0x457c('0x3c')](_0x46fde1[_0x457c('0x37')]['fields']));_0x3edb20[_0x457c('0x3a')]=_0x3edb20[_0x457c('0x3a')][_0x457c('0x3d')]?_0x3edb20['attributes']:_0x4492da[_0x457c('0x36')];_0x3edb20[_0x457c('0x68')]=qs[_0x457c('0x40')](_0x46fde1['query'][_0x457c('0x40')]);_0x3edb20[_0x457c('0x43')]=qs[_0x457c('0x39')](_[_0x457c('0x8b')](_0x46fde1[_0x457c('0x37')],_0x4492da[_0x457c('0x39')]));if(_0x46fde1[_0x457c('0x37')]['filter']){_0x3edb20[_0x457c('0x43')]=_[_0x457c('0x42')](_0x3edb20[_0x457c('0x43')],{'$or':_[_0x457c('0x31')](_0x3edb20[_0x457c('0x3a')],function(_0xa789fd){var _0x2b2e1f={};_0x2b2e1f[_0xa789fd]={'$like':'%'+_0x46fde1[_0x457c('0x37')][_0x457c('0x41')]+'%'};return _0x2b2e1f;})});}_0x3edb20=_[_0x457c('0x42')]({},_0x3edb20,_0x46fde1[_0x457c('0x45')]);return _0x118d4f[_0x457c('0x8c')](_0x3edb20);}})[_0x457c('0x2b')](function(_0x51a453){if(_0x51a453){_0x479307=_0x51a453['length'];if(!_0x46fde1[_0x457c('0x37')][_0x457c('0x3e')]('nolimit')){_0x3edb20[_0x457c('0x23')]=qs['limit'](_0x46fde1[_0x457c('0x37')][_0x457c('0x23')]);_0x3edb20[_0x457c('0x22')]=qs['offset'](_0x46fde1[_0x457c('0x37')]['offset']);}return _0x118d4f[_0x457c('0x8c')](_0x3edb20);}})[_0x457c('0x2b')](function(_0x3fc6a0){if(_0x3fc6a0){return _0x3fc6a0?{'count':_0x479307,'rows':_0x3fc6a0}:null;}})[_0x457c('0x2b')](respondWithResult(_0x413682,null))[_0x457c('0x49')](handleError(_0x413682,null));}; \ No newline at end of file diff --git a/server/api/team/team.events.js b/server/api/team/team.events.js index 03be5a1..8e400fe 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 _0xf717=['hook','exports','events','Team','save','update','remove','emit'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xf717,0x9a));var _0x7f71=function(_0x23d0a1,_0x5011a){_0x23d0a1=_0x23d0a1-0x0;var _0x1ef866=_0xf717[_0x23d0a1];return _0x1ef866;};'use strict';var EventEmitter=require(_0x7f71('0x0'));var Team=require('../../mysqldb')['db'][_0x7f71('0x1')];var TeamEvents=new EventEmitter();TeamEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x7f71('0x2'),'afterUpdate':_0x7f71('0x3'),'afterDestroy':_0x7f71('0x4')};function emitEvent(_0x3f37d6){return function(_0x277387,_0x3e7baa,_0x3492e7){TeamEvents[_0x7f71('0x5')](_0x3f37d6+':'+_0x277387['id'],_0x277387);TeamEvents[_0x7f71('0x5')](_0x3f37d6,_0x277387);_0x3492e7(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Team[_0x7f71('0x6')](e,emitEvent(event));}}module[_0x7f71('0x7')]=TeamEvents; \ No newline at end of file +var _0xbca8=['save','update','remove','emit','hasOwnProperty','exports','../../mysqldb','Team','setMaxListeners'];(function(_0x1d606d,_0x376e51){var _0x3c38bd=function(_0x2ea4e2){while(--_0x2ea4e2){_0x1d606d['push'](_0x1d606d['shift']());}};_0x3c38bd(++_0x376e51);}(_0xbca8,0x180));var _0x8bca=function(_0x3bf26c,_0x23141e){_0x3bf26c=_0x3bf26c-0x0;var _0x477f57=_0xbca8[_0x3bf26c];return _0x477f57;};'use strict';var EventEmitter=require('events');var Team=require(_0x8bca('0x0'))['db'][_0x8bca('0x1')];var TeamEvents=new EventEmitter();TeamEvents[_0x8bca('0x2')](0x0);var events={'afterCreate':_0x8bca('0x3'),'afterUpdate':_0x8bca('0x4'),'afterDestroy':_0x8bca('0x5')};function emitEvent(_0x978098){return function(_0x4d5912,_0x260d8d,_0x20a7ff){TeamEvents[_0x8bca('0x6')](_0x978098+':'+_0x4d5912['id'],_0x4d5912);TeamEvents[_0x8bca('0x6')](_0x978098,_0x4d5912);_0x20a7ff(null);};}for(var e in events){if(events[_0x8bca('0x7')](e)){var event=events[e];Team['hook'](e,emitEvent(event));}}module[_0x8bca('0x8')]=TeamEvents; \ No newline at end of file diff --git a/server/api/team/team.model.js b/server/api/team/team.model.js index 57fa1de..b7cddb5 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 _0xff8f=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./team.attributes','define','teams'];(function(_0x3aebe0,_0x3c0c91){var _0x47827f=function(_0x119bbc){while(--_0x119bbc){_0x3aebe0['push'](_0x3aebe0['shift']());}};_0x47827f(++_0x3c0c91);}(_0xff8f,0x120));var _0xfff8=function(_0x3ef389,_0x16362d){_0x3ef389=_0x3ef389-0x0;var _0x47c576=_0xff8f[_0x3ef389];return _0x47c576;};'use strict';var _=require(_0xfff8('0x0'));var util=require(_0xfff8('0x1'));var logger=require(_0xfff8('0x2'))(_0xfff8('0x3'));var moment=require(_0xfff8('0x4'));var BPromise=require(_0xfff8('0x5'));var rp=require(_0xfff8('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xfff8('0x7'));var config=require(_0xfff8('0x8'));var attributes=require(_0xfff8('0x9'));module['exports']=function(_0x487ae9,_0x1015ab){return _0x487ae9[_0xfff8('0xa')]('Team',attributes,{'tableName':_0xfff8('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb438=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./team.attributes','exports','define','Team','teams','lodash','util','../../config/logger'];(function(_0x1f2b0f,_0x25b6fa){var _0x2920fe=function(_0x542299){while(--_0x542299){_0x1f2b0f['push'](_0x1f2b0f['shift']());}};_0x2920fe(++_0x25b6fa);}(_0xb438,0x1bd));var _0x8b43=function(_0xa0bea3,_0x2b59a6){_0xa0bea3=_0xa0bea3-0x0;var _0x8af6c2=_0xb438[_0xa0bea3];return _0x8af6c2;};'use strict';var _=require(_0x8b43('0x0'));var util=require(_0x8b43('0x1'));var logger=require(_0x8b43('0x2'))('api');var moment=require(_0x8b43('0x3'));var BPromise=require(_0x8b43('0x4'));var rp=require(_0x8b43('0x5'));var fs=require('fs');var path=require(_0x8b43('0x6'));var rimraf=require(_0x8b43('0x7'));var config=require(_0x8b43('0x8'));var attributes=require(_0x8b43('0x9'));module[_0x8b43('0xa')]=function(_0xb9c2c6,_0x417d79){return _0xb9c2c6[_0x8b43('0xb')](_0x8b43('0xc'),attributes,{'tableName':_0x8b43('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/team/team.rpc.js b/server/api/team/team.rpc.js index 6e85b1a..33eca28 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 _0x45c5=['debug','Team,\x20%s,\x20%s,\x20%s','stringify','error','code','Team,\x20%s,\x20%s','message','result','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./team.socket','register','then','info','request\x20sent'];(function(_0x737a1f,_0x235fef){var _0x16eba1=function(_0x292aa8){while(--_0x292aa8){_0x737a1f['push'](_0x737a1f['shift']());}};_0x16eba1(++_0x235fef);}(_0x45c5,0x120));var _0x545c=function(_0x6ac983,_0x52c41f){_0x6ac983=_0x6ac983-0x0;var _0x31cd9d=_0x45c5[_0x6ac983];return _0x31cd9d;};'use strict';var _=require(_0x545c('0x0'));var util=require(_0x545c('0x1'));var moment=require(_0x545c('0x2'));var BPromise=require('bluebird');var rs=require(_0x545c('0x3'));var fs=require('fs');var Redis=require(_0x545c('0x4'));var db=require(_0x545c('0x5'))['db'];var utils=require(_0x545c('0x6'));var logger=require(_0x545c('0x7'))(_0x545c('0x8'));var config=require('../../config/environment');var jayson=require(_0x545c('0x9'));var client=jayson['client'][_0x545c('0xa')]({'port':0x232a});config[_0x545c('0xb')]=_[_0x545c('0xc')](config[_0x545c('0xb')],{'host':_0x545c('0xd'),'port':0x18eb});var socket=require(_0x545c('0xe'))(new Redis(config[_0x545c('0xb')]));require(_0x545c('0xf'))[_0x545c('0x10')](socket);function respondWithRpcPromise(_0x3d7d30,_0x22da9f,_0x36c0bf){return new BPromise(function(_0x499a9c,_0x22e772){return client['request'](_0x3d7d30,_0x36c0bf)[_0x545c('0x11')](function(_0x171a24){logger[_0x545c('0x12')]('Team,\x20%s,\x20%s',_0x22da9f,_0x545c('0x13'));logger[_0x545c('0x14')](_0x545c('0x15'),_0x22da9f,'request\x20sent',JSON[_0x545c('0x16')](_0x171a24));if(_0x171a24[_0x545c('0x17')]){if(_0x171a24['error'][_0x545c('0x18')]===0x1f4){logger['error'](_0x545c('0x19'),_0x22da9f,_0x171a24[_0x545c('0x17')]['message']);return _0x22e772(_0x171a24['error'][_0x545c('0x1a')]);}logger[_0x545c('0x17')](_0x545c('0x19'),_0x22da9f,_0x171a24[_0x545c('0x17')][_0x545c('0x1a')]);return _0x499a9c(_0x171a24[_0x545c('0x17')][_0x545c('0x1a')]);}else{logger[_0x545c('0x12')](_0x545c('0x19'),_0x22da9f,_0x545c('0x13'));_0x499a9c(_0x171a24[_0x545c('0x1b')][_0x545c('0x1a')]);}})['catch'](function(_0x50d1cb){logger[_0x545c('0x17')](_0x545c('0x19'),_0x22da9f,_0x50d1cb);_0x22e772(_0x50d1cb);});});} \ No newline at end of file +var _0xd2a2=['catch','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','localhost','socket.io-emitter','./team.socket','then','info','Team,\x20%s,\x20%s','request\x20sent','error','code','message'];(function(_0xbfd9e0,_0x4a6972){var _0x404416=function(_0x3e9c9e){while(--_0x3e9c9e){_0xbfd9e0['push'](_0xbfd9e0['shift']());}};_0x404416(++_0x4a6972);}(_0xd2a2,0xd0));var _0x2d2a=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd2a2[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x2d2a('0x0'));var util=require('util');var moment=require(_0x2d2a('0x1'));var BPromise=require(_0x2d2a('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2d2a('0x3'));var db=require(_0x2d2a('0x4'))['db'];var utils=require(_0x2d2a('0x5'));var logger=require(_0x2d2a('0x6'))(_0x2d2a('0x7'));var config=require(_0x2d2a('0x8'));var jayson=require(_0x2d2a('0x9'));var client=jayson['client'][_0x2d2a('0xa')]({'port':0x232a});config[_0x2d2a('0xb')]=_['defaults'](config[_0x2d2a('0xb')],{'host':_0x2d2a('0xc'),'port':0x18eb});var socket=require(_0x2d2a('0xd'))(new Redis(config[_0x2d2a('0xb')]));require(_0x2d2a('0xe'))['register'](socket);function respondWithRpcPromise(_0x3186d8,_0xe60cde,_0x527bd6){return new BPromise(function(_0xeabead,_0x43af22){return client['request'](_0x3186d8,_0x527bd6)[_0x2d2a('0xf')](function(_0x254a08){logger[_0x2d2a('0x10')](_0x2d2a('0x11'),_0xe60cde,_0x2d2a('0x12'));logger['debug']('Team,\x20%s,\x20%s,\x20%s',_0xe60cde,_0x2d2a('0x12'),JSON['stringify'](_0x254a08));if(_0x254a08[_0x2d2a('0x13')]){if(_0x254a08[_0x2d2a('0x13')][_0x2d2a('0x14')]===0x1f4){logger[_0x2d2a('0x13')](_0x2d2a('0x11'),_0xe60cde,_0x254a08['error'][_0x2d2a('0x15')]);return _0x43af22(_0x254a08[_0x2d2a('0x13')][_0x2d2a('0x15')]);}logger[_0x2d2a('0x13')](_0x2d2a('0x11'),_0xe60cde,_0x254a08[_0x2d2a('0x13')]['message']);return _0xeabead(_0x254a08[_0x2d2a('0x13')][_0x2d2a('0x15')]);}else{logger[_0x2d2a('0x10')](_0x2d2a('0x11'),_0xe60cde,_0x2d2a('0x12'));_0xeabead(_0x254a08['result'][_0x2d2a('0x15')]);}})[_0x2d2a('0x16')](function(_0x4414b1){logger[_0x2d2a('0x13')](_0x2d2a('0x11'),_0xe60cde,_0x4414b1);_0x43af22(_0x4414b1);});});} \ No newline at end of file diff --git a/server/api/team/team.socket.js b/server/api/team/team.socket.js index 4b47314..373005a 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 _0x1903=['length','team:','save','remove','update','removeListener'];(function(_0x31c3be,_0x5e540f){var _0x48314d=function(_0x65134b){while(--_0x65134b){_0x31c3be['push'](_0x31c3be['shift']());}};_0x48314d(++_0x5e540f);}(_0x1903,0x7a));var _0x3190=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x1903[_0x14add3];return _0x4a174f;};'use strict';var TeamEvents=require('./team.events');var events=[_0x3190('0x0'),_0x3190('0x1'),_0x3190('0x2')];function createListener(_0x3d10cd,_0x32cfc8){return function(_0x31da66){_0x32cfc8['emit'](_0x3d10cd,_0x31da66);};}function removeListener(_0x5cbbca,_0x3cd272){return function(){TeamEvents[_0x3190('0x3')](_0x5cbbca,_0x3cd272);};}exports['register']=function(_0x4ba830){for(var _0x231f63=0x0,_0x428b45=events[_0x3190('0x4')];_0x231f63<_0x428b45;_0x231f63++){var _0x5b2586=events[_0x231f63];var _0x28e501=createListener(_0x3190('0x5')+_0x5b2586,_0x4ba830);TeamEvents['on'](_0x5b2586,_0x28e501);}}; \ No newline at end of file +var _0x04cc=['update','emit','removeListener','register','length','team:','./team.events','save','remove'];(function(_0x5d9d17,_0x4ae1ce){var _0x4382fe=function(_0x101634){while(--_0x101634){_0x5d9d17['push'](_0x5d9d17['shift']());}};_0x4382fe(++_0x4ae1ce);}(_0x04cc,0x1bf));var _0xc04c=function(_0x2d284c,_0x59aa64){_0x2d284c=_0x2d284c-0x0;var _0x4f5756=_0x04cc[_0x2d284c];return _0x4f5756;};'use strict';var TeamEvents=require(_0xc04c('0x0'));var events=[_0xc04c('0x1'),_0xc04c('0x2'),_0xc04c('0x3')];function createListener(_0x3440c0,_0x571015){return function(_0x5e5698){_0x571015[_0xc04c('0x4')](_0x3440c0,_0x5e5698);};}function removeListener(_0x2876bb,_0x323837){return function(){TeamEvents[_0xc04c('0x5')](_0x2876bb,_0x323837);};}exports[_0xc04c('0x6')]=function(_0x3ed884){for(var _0x227653=0x0,_0x14c0d7=events[_0xc04c('0x7')];_0x227653<_0x14c0d7;_0x227653++){var _0x4dc02d=events[_0x227653];var _0x5d714e=createListener(_0xc04c('0x8')+_0x4dc02d,_0x3ed884);TeamEvents['on'](_0x4dc02d,_0x5d714e);}}; \ No newline at end of file diff --git a/server/api/teamVoicePrefix/teamVoicePrefix.attributes.js b/server/api/teamVoicePrefix/teamVoicePrefix.attributes.js index 5829a00..674970b 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 _0xdbe1=['INTEGER','sequelize'];(function(_0x1cf59c,_0x2b0040){var _0x5c6741=function(_0x1365a1){while(--_0x1365a1){_0x1cf59c['push'](_0x1cf59c['shift']());}};_0x5c6741(++_0x2b0040);}(_0xdbe1,0x137));var _0x1dbe=function(_0x19d746,_0x3674e3){_0x19d746=_0x19d746-0x0;var _0x44ace8=_0xdbe1[_0x19d746];return _0x44ace8;};'use strict';var Sequelize=require(_0x1dbe('0x0'));module['exports']={'TeamId':{'type':Sequelize[_0x1dbe('0x1')]},'VoicePrefixId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0x750a=['exports'];(function(_0x2f1089,_0x42d03d){var _0x1af573=function(_0x13d931){while(--_0x13d931){_0x2f1089['push'](_0x2f1089['shift']());}};_0x1af573(++_0x42d03d);}(_0x750a,0x140));var _0xa750=function(_0xfbe8cb,_0x195e76){_0xfbe8cb=_0xfbe8cb-0x0;var _0x3c0959=_0x750a[_0xfbe8cb];return _0x3c0959;};'use strict';var Sequelize=require('sequelize');module[_0xa750('0x0')]={'TeamId':{'type':Sequelize['INTEGER']},'VoicePrefixId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/teamVoicePrefix/teamVoicePrefix.model.js b/server/api/teamVoicePrefix/teamVoicePrefix.model.js index 99f5d7f..c70a115 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 _0x570f=['bluebird','request-promise','path','rimraf','../../config/environment','./teamVoicePrefix.attributes','exports','TeamVoicePrefix','lodash','util','../../config/logger'];(function(_0x660191,_0x5dee7c){var _0xcaad0=function(_0x2a0155){while(--_0x2a0155){_0x660191['push'](_0x660191['shift']());}};_0xcaad0(++_0x5dee7c);}(_0x570f,0x152));var _0xf570=function(_0x38c3c4,_0x22fa29){_0x38c3c4=_0x38c3c4-0x0;var _0x2cf445=_0x570f[_0x38c3c4];return _0x2cf445;};'use strict';var _=require(_0xf570('0x0'));var util=require(_0xf570('0x1'));var logger=require(_0xf570('0x2'))('api');var moment=require('moment');var BPromise=require(_0xf570('0x3'));var rp=require(_0xf570('0x4'));var fs=require('fs');var path=require(_0xf570('0x5'));var rimraf=require(_0xf570('0x6'));var config=require(_0xf570('0x7'));var attributes=require(_0xf570('0x8'));module[_0xf570('0x9')]=function(_0x5ce063,_0x2ec4ba){return _0x5ce063['define'](_0xf570('0xa'),attributes,{'tableName':'team_has_voice_prefixes','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1cc3=['path','../../config/environment','./teamVoicePrefix.attributes','exports','define','TeamVoicePrefix','team_has_voice_prefixes','lodash','util','api','bluebird','request-promise'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1cc3,0x11b));var _0x31cc=function(_0x13d07a,_0x41efc3){_0x13d07a=_0x13d07a-0x0;var _0x5ee0ee=_0x1cc3[_0x13d07a];return _0x5ee0ee;};'use strict';var _=require(_0x31cc('0x0'));var util=require(_0x31cc('0x1'));var logger=require('../../config/logger')(_0x31cc('0x2'));var moment=require('moment');var BPromise=require(_0x31cc('0x3'));var rp=require(_0x31cc('0x4'));var fs=require('fs');var path=require(_0x31cc('0x5'));var rimraf=require('rimraf');var config=require(_0x31cc('0x6'));var attributes=require(_0x31cc('0x7'));module[_0x31cc('0x8')]=function(_0x541da0,_0xc7ae44){return _0x541da0[_0x31cc('0x9')](_0x31cc('0xa'),attributes,{'tableName':_0x31cc('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/index.js b/server/api/teamVoiceQueue/index.js index baa0a45..28711c3 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 _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0xbb4325,_0x293598){var _0xf7423a=function(_0xbbd86f){while(--_0xbbd86f){_0xbb4325['push'](_0xbb4325['shift']());}};_0xf7423a(++_0x293598);}(_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(_0x93a23e,_0xa070c0){var _0x449575=function(_0x5f455b){while(--_0x5f455b){_0x93a23e['push'](_0x93a23e['shift']());}};_0x449575(++_0xa070c0);}(_0xa9e0,0x123));var _0x0a9e=function(_0x173d7e,_0x3242fd){_0x173d7e=_0x173d7e-0x0;var _0x2220d6=_0xa9e0[_0x173d7e];return _0x2220d6;};'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/teamVoiceQueue/teamVoiceQueue.attributes.js b/server/api/teamVoiceQueue/teamVoiceQueue.attributes.js index e4883fc..e04c577 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 _0x8b5b=['INTEGER'];(function(_0x28346a,_0x349ce5){var _0x5a0d97=function(_0x10bac2){while(--_0x10bac2){_0x28346a['push'](_0x28346a['shift']());}};_0x5a0d97(++_0x349ce5);}(_0x8b5b,0x137));var _0xb8b5=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x8b5b[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require('sequelize');module['exports']={'penalty':{'type':Sequelize[_0xb8b5('0x0')],'defaultValue':0x0}}; \ No newline at end of file +var _0x5cb5=['INTEGER','sequelize'];(function(_0x33ae4a,_0x5eaba3){var _0x13ed86=function(_0x416244){while(--_0x416244){_0x33ae4a['push'](_0x33ae4a['shift']());}};_0x13ed86(++_0x5eaba3);}(_0x5cb5,0xd9));var _0x55cb=function(_0x3f2393,_0x47c731){_0x3f2393=_0x3f2393-0x0;var _0x5373cb=_0x5cb5[_0x3f2393];return _0x5373cb;};'use strict';var Sequelize=require(_0x55cb('0x0'));module['exports']={'penalty':{'type':Sequelize[_0x55cb('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 4c6fbdc..0f8027f 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 _0x833b=['../../config/environment','./teamVoiceQueue.attributes','exports','TeamVoiceQueue','team_has_voice_queues','util','api','bluebird','path','rimraf'];(function(_0x42629e,_0x554d7e){var _0x2de7c0=function(_0x12ebd3){while(--_0x12ebd3){_0x42629e['push'](_0x42629e['shift']());}};_0x2de7c0(++_0x554d7e);}(_0x833b,0x131));var _0xb833=function(_0x172747,_0x1732bd){_0x172747=_0x172747-0x0;var _0x509692=_0x833b[_0x172747];return _0x509692;};'use strict';var _=require('lodash');var util=require(_0xb833('0x0'));var logger=require('../../config/logger')(_0xb833('0x1'));var moment=require('moment');var BPromise=require(_0xb833('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb833('0x3'));var rimraf=require(_0xb833('0x4'));var config=require(_0xb833('0x5'));var attributes=require(_0xb833('0x6'));module[_0xb833('0x7')]=function(_0x35b3f0,_0x4422a2){return _0x35b3f0['define'](_0xb833('0x8'),attributes,{'tableName':_0xb833('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3d9c=['request-promise','path','rimraf','../../config/environment','./teamVoiceQueue.attributes','exports','define','TeamVoiceQueue','lodash','../../config/logger','api','moment'];(function(_0x143d34,_0x462642){var _0x4234d3=function(_0x5f2618){while(--_0x5f2618){_0x143d34['push'](_0x143d34['shift']());}};_0x4234d3(++_0x462642);}(_0x3d9c,0x134));var _0xc3d9=function(_0x3bd5a8,_0x541df6){_0x3bd5a8=_0x3bd5a8-0x0;var _0x6d02aa=_0x3d9c[_0x3bd5a8];return _0x6d02aa;};'use strict';var _=require(_0xc3d9('0x0'));var util=require('util');var logger=require(_0xc3d9('0x1'))(_0xc3d9('0x2'));var moment=require(_0xc3d9('0x3'));var BPromise=require('bluebird');var rp=require(_0xc3d9('0x4'));var fs=require('fs');var path=require(_0xc3d9('0x5'));var rimraf=require(_0xc3d9('0x6'));var config=require(_0xc3d9('0x7'));var attributes=require(_0xc3d9('0x8'));module[_0xc3d9('0x9')]=function(_0x137aaf,_0x492577){return _0x137aaf[_0xc3d9('0xa')](_0xc3d9('0xb'),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 80fcb7a..0628991 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 _0x1849=['debug','TeamVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','TeamVoiceQueue,\x20%s,\x20%s','request\x20sent'];(function(_0x12fc8d,_0x19ee33){var _0x3f9d04=function(_0x52e51c){while(--_0x52e51c){_0x12fc8d['push'](_0x12fc8d['shift']());}};_0x3f9d04(++_0x19ee33);}(_0x1849,0x7e));var _0x9184=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x1849[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0x9184('0x0'));var util=require(_0x9184('0x1'));var moment=require(_0x9184('0x2'));var BPromise=require(_0x9184('0x3'));var rs=require(_0x9184('0x4'));var fs=require('fs');var Redis=require(_0x9184('0x5'));var db=require(_0x9184('0x6'))['db'];var utils=require(_0x9184('0x7'));var logger=require('../../config/logger')(_0x9184('0x8'));var config=require(_0x9184('0x9'));var jayson=require(_0x9184('0xa'));var client=jayson[_0x9184('0xb')][_0x9184('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1bb657,_0x191799,_0x30bfdb){return new BPromise(function(_0x43ee17,_0x4bf1ad){return client[_0x9184('0xd')](_0x1bb657,_0x30bfdb)[_0x9184('0xe')](function(_0x5ae634){logger[_0x9184('0xf')](_0x9184('0x10'),_0x191799,_0x9184('0x11'));logger[_0x9184('0x12')](_0x9184('0x13'),_0x191799,'request\x20sent',JSON[_0x9184('0x14')](_0x5ae634));if(_0x5ae634[_0x9184('0x15')]){if(_0x5ae634[_0x9184('0x15')]['code']===0x1f4){logger[_0x9184('0x15')](_0x9184('0x10'),_0x191799,_0x5ae634[_0x9184('0x15')]['message']);return _0x4bf1ad(_0x5ae634[_0x9184('0x15')][_0x9184('0x16')]);}logger[_0x9184('0x15')](_0x9184('0x10'),_0x191799,_0x5ae634[_0x9184('0x15')][_0x9184('0x16')]);return _0x43ee17(_0x5ae634[_0x9184('0x15')]['message']);}else{logger['info'](_0x9184('0x10'),_0x191799,_0x9184('0x11'));_0x43ee17(_0x5ae634['result'][_0x9184('0x16')]);}})[_0x9184('0x17')](function(_0x3fda89){logger[_0x9184('0x15')]('TeamVoiceQueue,\x20%s,\x20%s',_0x191799,_0x3fda89);_0x4bf1ad(_0x3fda89);});});} \ No newline at end of file +var _0xd3c2=['catch','lodash','bluebird','randomstring','../../config/utils','../../config/logger','../../config/environment','client','http','request','then','info','request\x20sent','debug','TeamVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','TeamVoiceQueue,\x20%s,\x20%s','message','result'];(function(_0x37b057,_0x39d7b6){var _0x3b448d=function(_0x5ca56f){while(--_0x5ca56f){_0x37b057['push'](_0x37b057['shift']());}};_0x3b448d(++_0x39d7b6);}(_0xd3c2,0x1e4));var _0x2d3c=function(_0x5c949b,_0x4058c5){_0x5c949b=_0x5c949b-0x0;var _0x44b2de=_0xd3c2[_0x5c949b];return _0x44b2de;};'use strict';var _=require(_0x2d3c('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x2d3c('0x1'));var rs=require(_0x2d3c('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x2d3c('0x3'));var logger=require(_0x2d3c('0x4'))('rpc');var config=require(_0x2d3c('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x2d3c('0x6')][_0x2d3c('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x3847cc,_0x2e3745,_0x7fa5b9){return new BPromise(function(_0xaff3aa,_0x2f47d1){return client[_0x2d3c('0x8')](_0x3847cc,_0x7fa5b9)[_0x2d3c('0x9')](function(_0x5900eb){logger[_0x2d3c('0xa')]('TeamVoiceQueue,\x20%s,\x20%s',_0x2e3745,_0x2d3c('0xb'));logger[_0x2d3c('0xc')](_0x2d3c('0xd'),_0x2e3745,'request\x20sent',JSON[_0x2d3c('0xe')](_0x5900eb));if(_0x5900eb[_0x2d3c('0xf')]){if(_0x5900eb[_0x2d3c('0xf')][_0x2d3c('0x10')]===0x1f4){logger[_0x2d3c('0xf')](_0x2d3c('0x11'),_0x2e3745,_0x5900eb[_0x2d3c('0xf')][_0x2d3c('0x12')]);return _0x2f47d1(_0x5900eb[_0x2d3c('0xf')][_0x2d3c('0x12')]);}logger[_0x2d3c('0xf')](_0x2d3c('0x11'),_0x2e3745,_0x5900eb['error'][_0x2d3c('0x12')]);return _0xaff3aa(_0x5900eb['error'][_0x2d3c('0x12')]);}else{logger[_0x2d3c('0xa')](_0x2d3c('0x11'),_0x2e3745,_0x2d3c('0xb'));_0xaff3aa(_0x5900eb[_0x2d3c('0x13')][_0x2d3c('0x12')]);}})[_0x2d3c('0x14')](function(_0x546c64){logger[_0x2d3c('0xf')](_0x2d3c('0x11'),_0x2e3745,_0x546c64);_0x2f47d1(_0x546c64);});});} \ No newline at end of file diff --git a/server/api/template/index.js b/server/api/template/index.js index 25ce994..3bbc134 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 _0xd5c8=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./template.controller','isAuthenticated','/:id','show','post','put','update','delete','destroy','exports','path','connect-timeout'];(function(_0x102aa8,_0x306a23){var _0x4d3fd0=function(_0x215fbe){while(--_0x215fbe){_0x102aa8['push'](_0x102aa8['shift']());}};_0x4d3fd0(++_0x306a23);}(_0xd5c8,0x166));var _0x8d5c=function(_0x22b6e5,_0x2819c8){_0x22b6e5=_0x22b6e5-0x0;var _0x1c21e5=_0xd5c8[_0x22b6e5];return _0x1c21e5;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x8d5c('0x0'));var timeout=require(_0x8d5c('0x1'));var express=require(_0x8d5c('0x2'));var router=express[_0x8d5c('0x3')]();var fs_extra=require(_0x8d5c('0x4'));var auth=require(_0x8d5c('0x5'));var interaction=require(_0x8d5c('0x6'));var config=require(_0x8d5c('0x7'));var controller=require(_0x8d5c('0x8'));router['get']('/',auth[_0x8d5c('0x9')](),controller['index']);router['get'](_0x8d5c('0xa'),auth[_0x8d5c('0x9')](),controller[_0x8d5c('0xb')]);router[_0x8d5c('0xc')]('/',auth['isAuthenticated'](),controller['create']);router[_0x8d5c('0xd')]('/:id',auth[_0x8d5c('0x9')](),controller[_0x8d5c('0xe')]);router[_0x8d5c('0xf')](_0x8d5c('0xa'),auth[_0x8d5c('0x9')](),controller[_0x8d5c('0x10')]);module[_0x8d5c('0x11')]=router; \ No newline at end of file +var _0xf19c=['show','post','create','put','update','delete','destroy','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./template.controller','get','index','/:id','isAuthenticated'];(function(_0x97e49d,_0x5a74ff){var _0x36a843=function(_0x214dfa){while(--_0x214dfa){_0x97e49d['push'](_0x97e49d['shift']());}};_0x36a843(++_0x5a74ff);}(_0xf19c,0x10b));var _0xcf19=function(_0x5f3a00,_0x275be3){_0x5f3a00=_0x5f3a00-0x0;var _0x133dd3=_0xf19c[_0x5f3a00];return _0x133dd3;};'use strict';var multer=require(_0xcf19('0x0'));var util=require(_0xcf19('0x1'));var path=require(_0xcf19('0x2'));var timeout=require('connect-timeout');var express=require(_0xcf19('0x3'));var router=express[_0xcf19('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xcf19('0x5'));var interaction=require(_0xcf19('0x6'));var config=require(_0xcf19('0x7'));var controller=require(_0xcf19('0x8'));router[_0xcf19('0x9')]('/',auth['isAuthenticated'](),controller[_0xcf19('0xa')]);router[_0xcf19('0x9')](_0xcf19('0xb'),auth[_0xcf19('0xc')](),controller[_0xcf19('0xd')]);router[_0xcf19('0xe')]('/',auth['isAuthenticated'](),controller[_0xcf19('0xf')]);router[_0xcf19('0x10')](_0xcf19('0xb'),auth[_0xcf19('0xc')](),controller[_0xcf19('0x11')]);router[_0xcf19('0x12')](_0xcf19('0xb'),auth[_0xcf19('0xc')](),controller[_0xcf19('0x13')]);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 fe5d269..dce37ca 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 _0x08be=['sequelize','exports','STRING','TEXT'];(function(_0x1f9179,_0x598964){var _0x2974c9=function(_0x52443b){while(--_0x52443b){_0x1f9179['push'](_0x1f9179['shift']());}};_0x2974c9(++_0x598964);}(_0x08be,0x128));var _0xe08b=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x08be[_0x5b644e];return _0x49c6bf;};'use strict';var Sequelize=require(_0xe08b('0x0'));module[_0xe08b('0x1')]={'name':{'type':Sequelize[_0xe08b('0x2')]},'description':{'type':Sequelize[_0xe08b('0x2')]},'html':{'type':Sequelize[_0xe08b('0x3')]}}; \ No newline at end of file +var _0x578d=['sequelize','exports','STRING','TEXT'];(function(_0x35f8bb,_0x2feb03){var _0x29198b=function(_0x4448c8){while(--_0x4448c8){_0x35f8bb['push'](_0x35f8bb['shift']());}};_0x29198b(++_0x2feb03);}(_0x578d,0xb4));var _0xd578=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x578d[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xd578('0x0'));module[_0xd578('0x1')]={'name':{'type':Sequelize[_0xd578('0x2')]},'description':{'type':Sequelize[_0xd578('0x2')]},'html':{'type':Sequelize[_0xd578('0x3')]}}; \ No newline at end of file diff --git a/server/api/template/template.controller.js b/server/api/template/template.controller.js index 564b672..402606c 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 _0x03ab=['util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','Templates','sendStatus','error','stack','name','map','Template','rawAttributes','fieldName','type','key','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','merge','filter','includeAll','include','findAll','rows','catch','show','keys','options','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','eml-format','rimraf','zip-dir','request-promise','moment'];(function(_0x2284c4,_0xf1f627){var _0x5ea6fe=function(_0x209e1e){while(--_0x209e1e){_0x2284c4['push'](_0x2284c4['shift']());}};_0x5ea6fe(++_0xf1f627);}(_0x03ab,0x1ae));var _0xb03a=function(_0xd94b6b,_0x477ef9){_0xd94b6b=_0xd94b6b-0x0;var _0x48e4a8=_0x03ab[_0xd94b6b];return _0x48e4a8;};'use strict';var emlformat=require(_0xb03a('0x0'));var rimraf=require(_0xb03a('0x1'));var zipdir=require(_0xb03a('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb03a('0x3'));var moment=require(_0xb03a('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xb03a('0x5'));var path=require(_0xb03a('0x6'));var sox=require(_0xb03a('0x7'));var csv=require(_0xb03a('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb03a('0x9'));var _=require(_0xb03a('0xa'));var squel=require(_0xb03a('0xb'));var crypto=require(_0xb03a('0xc'));var jsforce=require(_0xb03a('0xd'));var deskjs=require(_0xb03a('0xe'));var toCsv=require(_0xb03a('0x8'));var querystring=require(_0xb03a('0xf'));var Papa=require(_0xb03a('0x10'));var Redis=require(_0xb03a('0x11'));var authService=require(_0xb03a('0x12'));var qs=require(_0xb03a('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb03a('0x14'));var logger=require(_0xb03a('0x15'))(_0xb03a('0x16'));var utils=require(_0xb03a('0x17'));var config=require(_0xb03a('0x18'));var licenseUtil=require(_0xb03a('0x19'));var db=require(_0xb03a('0x1a'))['db'];function respondWithStatusCode(_0x22661f,_0x49d44e){_0x49d44e=_0x49d44e||0xcc;return function(_0x11e3d3){if(_0x11e3d3){return _0x22661f['sendStatus'](_0x49d44e);}return _0x22661f[_0xb03a('0x1b')](_0x49d44e)[_0xb03a('0x1c')]();};}function respondWithResult(_0x14e7d2,_0x341255){_0x341255=_0x341255||0xc8;return function(_0x1d2883){if(_0x1d2883){return _0x14e7d2[_0xb03a('0x1b')](_0x341255)[_0xb03a('0x1d')](_0x1d2883);}};}function respondWithFilteredResult(_0x550b42,_0x266f1a){return function(_0x3920ec){if(_0x3920ec){var _0x599859=typeof _0x266f1a[_0xb03a('0x1e')]===_0xb03a('0x1f')&&typeof _0x266f1a[_0xb03a('0x20')]===_0xb03a('0x1f');var _0x32c991=_0x3920ec[_0xb03a('0x21')];var _0x5dddc4=_0x599859?0x0:_0x266f1a['offset'];var _0x203af8=_0x599859?_0x3920ec[_0xb03a('0x21')]:_0x266f1a[_0xb03a('0x1e')]+_0x266f1a[_0xb03a('0x20')];var _0x54a229;if(_0x203af8>=_0x32c991){_0x203af8=_0x32c991;_0x54a229=0xc8;}else{_0x54a229=0xce;}_0x550b42[_0xb03a('0x1b')](_0x54a229);return _0x550b42[_0xb03a('0x22')](_0xb03a('0x23'),_0x5dddc4+'-'+_0x203af8+'/'+_0x32c991)[_0xb03a('0x1d')](_0x3920ec);}return null;};}function patchUpdates(_0x5c6c2c){return function(_0x408402){try{jsonpatch[_0xb03a('0x24')](_0x408402,_0x5c6c2c,!![]);}catch(_0x3ba71b){return BPromise[_0xb03a('0x25')](_0x3ba71b);}return _0x408402[_0xb03a('0x26')]();};}function saveUpdates(_0x47a2c6,_0x4ae3fa){return function(_0x1caedf){if(_0x1caedf){return _0x1caedf[_0xb03a('0x27')](_0x47a2c6)['then'](function(_0x2c3ecf){return _0x2c3ecf;});}return null;};}function removeEntity(_0x310dc1,_0x101521){return function(_0x5c108e){if(_0x5c108e){return _0x5c108e[_0xb03a('0x28')]()[_0xb03a('0x29')](function(){var _0xf275c9=_0x5c108e['get']({'plain':!![]});var _0x44249a=_0xb03a('0x2a');return db['UserProfileResource'][_0xb03a('0x28')]({'where':{'type':_0x44249a,'resourceId':_0xf275c9['id']}})['then'](function(){return _0x5c108e;});})[_0xb03a('0x29')](function(){_0x310dc1['status'](0xcc)[_0xb03a('0x1c')]();});}};}function handleEntityNotFound(_0x129005,_0x37658a){return function(_0x62e15d){if(!_0x62e15d){_0x129005[_0xb03a('0x2b')](0x194);}return _0x62e15d;};}function handleError(_0x16dc32,_0x51b036){_0x51b036=_0x51b036||0x1f4;return function(_0x303dd1){logger[_0xb03a('0x2c')](_0x303dd1[_0xb03a('0x2d')]);if(_0x303dd1[_0xb03a('0x2e')]){delete _0x303dd1['name'];}_0x16dc32[_0xb03a('0x1b')](_0x51b036)['send'](_0x303dd1);};}exports['index']=function(_0x508335,_0x15d59a){var _0x1b056c={},_0x29ad77={},_0x140e8e={'count':0x0,'rows':[]};var _0x25f716=_[_0xb03a('0x2f')](db[_0xb03a('0x30')][_0xb03a('0x31')],function(_0x3590ef){return{'name':_0x3590ef[_0xb03a('0x32')],'type':_0x3590ef[_0xb03a('0x33')][_0xb03a('0x34')]};});_0x29ad77['model']=_[_0xb03a('0x2f')](_0x25f716,_0xb03a('0x2e'));_0x29ad77[_0xb03a('0x35')]=_['keys'](_0x508335[_0xb03a('0x35')]);_0x29ad77[_0xb03a('0x36')]=_[_0xb03a('0x37')](_0x29ad77['model'],_0x29ad77[_0xb03a('0x35')]);_0x1b056c['attributes']=_['intersection'](_0x29ad77[_0xb03a('0x38')],qs[_0xb03a('0x39')](_0x508335[_0xb03a('0x35')]['fields']));_0x1b056c['attributes']=_0x1b056c[_0xb03a('0x3a')][_0xb03a('0x3b')]?_0x1b056c[_0xb03a('0x3a')]:_0x29ad77[_0xb03a('0x38')];if(!_0x508335[_0xb03a('0x35')][_0xb03a('0x3c')](_0xb03a('0x3d'))){_0x1b056c[_0xb03a('0x20')]=qs['limit'](_0x508335[_0xb03a('0x35')]['limit']);_0x1b056c[_0xb03a('0x1e')]=qs[_0xb03a('0x1e')](_0x508335[_0xb03a('0x35')][_0xb03a('0x1e')]);}_0x1b056c[_0xb03a('0x3e')]=qs[_0xb03a('0x3f')](_0x508335[_0xb03a('0x35')][_0xb03a('0x3f')]);_0x1b056c[_0xb03a('0x40')]=qs[_0xb03a('0x36')](_['pick'](_0x508335[_0xb03a('0x35')],_0x29ad77[_0xb03a('0x36')]),_0x25f716);if(_0x508335[_0xb03a('0x35')]['filter']){_0x1b056c[_0xb03a('0x40')]=_[_0xb03a('0x41')](_0x1b056c[_0xb03a('0x40')],{'$or':_[_0xb03a('0x2f')](_0x25f716,function(_0x5ab45a){if(_0x5ab45a[_0xb03a('0x33')]!=='VIRTUAL'){var _0x18ccbf={};_0x18ccbf[_0x5ab45a[_0xb03a('0x2e')]]={'$like':'%'+_0x508335[_0xb03a('0x35')][_0xb03a('0x42')]+'%'};return _0x18ccbf;}})});}_0x1b056c=_[_0xb03a('0x41')]({},_0x1b056c,_0x508335['options']);var _0x28599e={'where':_0x1b056c[_0xb03a('0x40')]};return db['Template'][_0xb03a('0x21')](_0x28599e)['then'](function(_0x54f505){_0x140e8e[_0xb03a('0x21')]=_0x54f505;if(_0x508335['query'][_0xb03a('0x43')]){_0x1b056c[_0xb03a('0x44')]=[{'all':!![]}];}return db[_0xb03a('0x30')][_0xb03a('0x45')](_0x1b056c);})['then'](function(_0x2f0afc){_0x140e8e[_0xb03a('0x46')]=_0x2f0afc;return _0x140e8e;})[_0xb03a('0x29')](respondWithFilteredResult(_0x15d59a,_0x1b056c))[_0xb03a('0x47')](handleError(_0x15d59a,null));};exports[_0xb03a('0x48')]=function(_0x14b98e,_0x4c8b61){var _0x59fd31={'raw':!![],'where':{'id':_0x14b98e['params']['id']}},_0xa6ba25={};_0xa6ba25[_0xb03a('0x38')]=_[_0xb03a('0x49')](db[_0xb03a('0x30')][_0xb03a('0x31')]);_0xa6ba25[_0xb03a('0x35')]=_[_0xb03a('0x49')](_0x14b98e[_0xb03a('0x35')]);_0xa6ba25[_0xb03a('0x36')]=_[_0xb03a('0x37')](_0xa6ba25['model'],_0xa6ba25['query']);_0x59fd31[_0xb03a('0x3a')]=_[_0xb03a('0x37')](_0xa6ba25[_0xb03a('0x38')],qs[_0xb03a('0x39')](_0x14b98e[_0xb03a('0x35')][_0xb03a('0x39')]));_0x59fd31[_0xb03a('0x3a')]=_0x59fd31[_0xb03a('0x3a')][_0xb03a('0x3b')]?_0x59fd31['attributes']:_0xa6ba25['model'];if(_0x14b98e[_0xb03a('0x35')]['includeAll']){_0x59fd31[_0xb03a('0x44')]=[{'all':!![]}];}_0x59fd31=_['merge']({},_0x59fd31,_0x14b98e[_0xb03a('0x4a')]);return db[_0xb03a('0x30')][_0xb03a('0x4b')](_0x59fd31)[_0xb03a('0x29')](handleEntityNotFound(_0x4c8b61,null))[_0xb03a('0x29')](respondWithResult(_0x4c8b61,null))['catch'](handleError(_0x4c8b61,null));};exports[_0xb03a('0x4c')]=function(_0x38d88d,_0x5651ab){return db[_0xb03a('0x30')]['create'](_0x38d88d[_0xb03a('0x4d')],{})[_0xb03a('0x29')](function(_0xe47499){var _0xdd8e52=_0x38d88d[_0xb03a('0x4e')][_0xb03a('0x4f')]({'plain':!![]});if(!_0xdd8e52)throw new Error(_0xb03a('0x50'));if(_0xdd8e52[_0xb03a('0x51')]===_0xb03a('0x4e')){var _0x47b352=_0xe47499['get']({'plain':!![]});var _0x5b41f0=_0xb03a('0x2a');return db[_0xb03a('0x52')][_0xb03a('0x4b')]({'where':{'name':_0x5b41f0,'userProfileId':_0xdd8e52[_0xb03a('0x53')]},'raw':!![]})[_0xb03a('0x29')](function(_0x3c5eda){if(_0x3c5eda&&_0x3c5eda['autoAssociation']===0x0){return db[_0xb03a('0x54')]['create']({'name':_0x47b352[_0xb03a('0x2e')],'resourceId':_0x47b352['id'],'type':_0x3c5eda[_0xb03a('0x2e')],'sectionId':_0x3c5eda['id']},{})[_0xb03a('0x29')](function(){return _0xe47499;});}else{return _0xe47499;}})[_0xb03a('0x47')](function(_0x3e31a9){logger[_0xb03a('0x2c')](_0xb03a('0x55'),_0x3e31a9);throw _0x3e31a9;});}return _0xe47499;})[_0xb03a('0x29')](respondWithResult(_0x5651ab,0xc9))[_0xb03a('0x47')](handleError(_0x5651ab,null));};exports[_0xb03a('0x27')]=function(_0x52987f,_0x3c0a9e){if(_0x52987f[_0xb03a('0x4d')]['id']){delete _0x52987f[_0xb03a('0x4d')]['id'];}return db['Template'][_0xb03a('0x4b')]({'where':{'id':_0x52987f[_0xb03a('0x56')]['id']}})[_0xb03a('0x29')](handleEntityNotFound(_0x3c0a9e,null))[_0xb03a('0x29')](saveUpdates(_0x52987f[_0xb03a('0x4d')],null))[_0xb03a('0x29')](respondWithResult(_0x3c0a9e,null))['catch'](handleError(_0x3c0a9e,null));};exports[_0xb03a('0x28')]=function(_0x547c89,_0x2cb4cd){return db[_0xb03a('0x30')][_0xb03a('0x4b')]({'where':{'id':_0x547c89[_0xb03a('0x56')]['id']}})[_0xb03a('0x29')](handleEntityNotFound(_0x2cb4cd,null))['then'](removeEntity(_0x2cb4cd,null))[_0xb03a('0x47')](handleError(_0x2cb4cd,null));}; \ No newline at end of file +var _0x0dcd=['length','nolimit','order','sort','filters','pick','filter','where','VIRTUAL','includeAll','include','findAll','rows','catch','params','find','create','role','user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','offset','undefined','count','limit','set','json','apply','save','update','then','destroy','get','Templates','UserProfileResource','end','error','stack','name','index','map','Template','rawAttributes','fieldName','type','model','query','keys','intersection','attributes','fields'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x0dcd,0xb5));var _0xd0dc=function(_0x26bbbc,_0x2aaba3){_0x26bbbc=_0x26bbbc-0x0;var _0x579ec0=_0x0dcd[_0x26bbbc];return _0x579ec0;};'use strict';var emlformat=require(_0xd0dc('0x0'));var rimraf=require(_0xd0dc('0x1'));var zipdir=require(_0xd0dc('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xd0dc('0x3'));var moment=require(_0xd0dc('0x4'));var BPromise=require(_0xd0dc('0x5'));var Mustache=require(_0xd0dc('0x6'));var util=require(_0xd0dc('0x7'));var path=require(_0xd0dc('0x8'));var sox=require(_0xd0dc('0x9'));var csv=require(_0xd0dc('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd0dc('0xb'));var squel=require(_0xd0dc('0xc'));var crypto=require(_0xd0dc('0xd'));var jsforce=require(_0xd0dc('0xe'));var deskjs=require(_0xd0dc('0xf'));var toCsv=require(_0xd0dc('0xa'));var querystring=require('querystring');var Papa=require(_0xd0dc('0x10'));var Redis=require('ioredis');var authService=require(_0xd0dc('0x11'));var qs=require(_0xd0dc('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd0dc('0x13'));var logger=require(_0xd0dc('0x14'))('api');var utils=require(_0xd0dc('0x15'));var config=require(_0xd0dc('0x16'));var licenseUtil=require(_0xd0dc('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x519795,_0x125cc5){_0x125cc5=_0x125cc5||0xcc;return function(_0x1f8ec0){if(_0x1f8ec0){return _0x519795[_0xd0dc('0x18')](_0x125cc5);}return _0x519795[_0xd0dc('0x19')](_0x125cc5)['end']();};}function respondWithResult(_0x2dbfbc,_0x181c7e){_0x181c7e=_0x181c7e||0xc8;return function(_0x3ca13e){if(_0x3ca13e){return _0x2dbfbc[_0xd0dc('0x19')](_0x181c7e)['json'](_0x3ca13e);}};}function respondWithFilteredResult(_0x32a71f,_0x3a7c52){return function(_0x28bd09){if(_0x28bd09){var _0x89530d=typeof _0x3a7c52[_0xd0dc('0x1a')]===_0xd0dc('0x1b')&&typeof _0x3a7c52['limit']==='undefined';var _0x34b6e5=_0x28bd09[_0xd0dc('0x1c')];var _0x297631=_0x89530d?0x0:_0x3a7c52[_0xd0dc('0x1a')];var _0x30a402=_0x89530d?_0x28bd09['count']:_0x3a7c52['offset']+_0x3a7c52[_0xd0dc('0x1d')];var _0xfc9b2b;if(_0x30a402>=_0x34b6e5){_0x30a402=_0x34b6e5;_0xfc9b2b=0xc8;}else{_0xfc9b2b=0xce;}_0x32a71f[_0xd0dc('0x19')](_0xfc9b2b);return _0x32a71f[_0xd0dc('0x1e')]('Content-Range',_0x297631+'-'+_0x30a402+'/'+_0x34b6e5)[_0xd0dc('0x1f')](_0x28bd09);}return null;};}function patchUpdates(_0x18af32){return function(_0x2fdfc3){try{jsonpatch[_0xd0dc('0x20')](_0x2fdfc3,_0x18af32,!![]);}catch(_0x3c0648){return BPromise['reject'](_0x3c0648);}return _0x2fdfc3[_0xd0dc('0x21')]();};}function saveUpdates(_0x5a6950,_0x266898){return function(_0x5a5952){if(_0x5a5952){return _0x5a5952[_0xd0dc('0x22')](_0x5a6950)[_0xd0dc('0x23')](function(_0x34cb98){return _0x34cb98;});}return null;};}function removeEntity(_0x352268,_0x4afe98){return function(_0x4222c6){if(_0x4222c6){return _0x4222c6[_0xd0dc('0x24')]()[_0xd0dc('0x23')](function(){var _0x2b06d7=_0x4222c6[_0xd0dc('0x25')]({'plain':!![]});var _0x23540b=_0xd0dc('0x26');return db[_0xd0dc('0x27')][_0xd0dc('0x24')]({'where':{'type':_0x23540b,'resourceId':_0x2b06d7['id']}})[_0xd0dc('0x23')](function(){return _0x4222c6;});})[_0xd0dc('0x23')](function(){_0x352268[_0xd0dc('0x19')](0xcc)[_0xd0dc('0x28')]();});}};}function handleEntityNotFound(_0xd55c51,_0xc80d76){return function(_0x4f94dc){if(!_0x4f94dc){_0xd55c51[_0xd0dc('0x18')](0x194);}return _0x4f94dc;};}function handleError(_0x3add67,_0x3492f){_0x3492f=_0x3492f||0x1f4;return function(_0x79db9d){logger[_0xd0dc('0x29')](_0x79db9d[_0xd0dc('0x2a')]);if(_0x79db9d['name']){delete _0x79db9d[_0xd0dc('0x2b')];}_0x3add67[_0xd0dc('0x19')](_0x3492f)['send'](_0x79db9d);};}exports[_0xd0dc('0x2c')]=function(_0x3699d1,_0xed56a){var _0x58c2d7={},_0x5123f3={},_0x19c03e={'count':0x0,'rows':[]};var _0x17d0da=_[_0xd0dc('0x2d')](db[_0xd0dc('0x2e')][_0xd0dc('0x2f')],function(_0x4d861a){return{'name':_0x4d861a[_0xd0dc('0x30')],'type':_0x4d861a[_0xd0dc('0x31')]['key']};});_0x5123f3[_0xd0dc('0x32')]=_[_0xd0dc('0x2d')](_0x17d0da,'name');_0x5123f3[_0xd0dc('0x33')]=_[_0xd0dc('0x34')](_0x3699d1[_0xd0dc('0x33')]);_0x5123f3['filters']=_[_0xd0dc('0x35')](_0x5123f3[_0xd0dc('0x32')],_0x5123f3[_0xd0dc('0x33')]);_0x58c2d7[_0xd0dc('0x36')]=_[_0xd0dc('0x35')](_0x5123f3[_0xd0dc('0x32')],qs[_0xd0dc('0x37')](_0x3699d1[_0xd0dc('0x33')]['fields']));_0x58c2d7[_0xd0dc('0x36')]=_0x58c2d7[_0xd0dc('0x36')][_0xd0dc('0x38')]?_0x58c2d7[_0xd0dc('0x36')]:_0x5123f3['model'];if(!_0x3699d1[_0xd0dc('0x33')]['hasOwnProperty'](_0xd0dc('0x39'))){_0x58c2d7[_0xd0dc('0x1d')]=qs[_0xd0dc('0x1d')](_0x3699d1['query'][_0xd0dc('0x1d')]);_0x58c2d7[_0xd0dc('0x1a')]=qs['offset'](_0x3699d1[_0xd0dc('0x33')][_0xd0dc('0x1a')]);}_0x58c2d7[_0xd0dc('0x3a')]=qs[_0xd0dc('0x3b')](_0x3699d1[_0xd0dc('0x33')][_0xd0dc('0x3b')]);_0x58c2d7['where']=qs[_0xd0dc('0x3c')](_[_0xd0dc('0x3d')](_0x3699d1['query'],_0x5123f3[_0xd0dc('0x3c')]),_0x17d0da);if(_0x3699d1[_0xd0dc('0x33')][_0xd0dc('0x3e')]){_0x58c2d7[_0xd0dc('0x3f')]=_['merge'](_0x58c2d7[_0xd0dc('0x3f')],{'$or':_['map'](_0x17d0da,function(_0x4c599e){if(_0x4c599e[_0xd0dc('0x31')]!==_0xd0dc('0x40')){var _0x319f44={};_0x319f44[_0x4c599e['name']]={'$like':'%'+_0x3699d1[_0xd0dc('0x33')][_0xd0dc('0x3e')]+'%'};return _0x319f44;}})});}_0x58c2d7=_['merge']({},_0x58c2d7,_0x3699d1['options']);var _0x432516={'where':_0x58c2d7[_0xd0dc('0x3f')]};return db[_0xd0dc('0x2e')][_0xd0dc('0x1c')](_0x432516)['then'](function(_0x597cdd){_0x19c03e[_0xd0dc('0x1c')]=_0x597cdd;if(_0x3699d1['query'][_0xd0dc('0x41')]){_0x58c2d7[_0xd0dc('0x42')]=[{'all':!![]}];}return db[_0xd0dc('0x2e')][_0xd0dc('0x43')](_0x58c2d7);})[_0xd0dc('0x23')](function(_0x58876f){_0x19c03e[_0xd0dc('0x44')]=_0x58876f;return _0x19c03e;})['then'](respondWithFilteredResult(_0xed56a,_0x58c2d7))[_0xd0dc('0x45')](handleError(_0xed56a,null));};exports['show']=function(_0x1dba1d,_0x4558ee){var _0x17e539={'raw':!![],'where':{'id':_0x1dba1d[_0xd0dc('0x46')]['id']}},_0x122263={};_0x122263[_0xd0dc('0x32')]=_['keys'](db[_0xd0dc('0x2e')][_0xd0dc('0x2f')]);_0x122263[_0xd0dc('0x33')]=_[_0xd0dc('0x34')](_0x1dba1d['query']);_0x122263[_0xd0dc('0x3c')]=_['intersection'](_0x122263[_0xd0dc('0x32')],_0x122263['query']);_0x17e539['attributes']=_['intersection'](_0x122263[_0xd0dc('0x32')],qs[_0xd0dc('0x37')](_0x1dba1d[_0xd0dc('0x33')][_0xd0dc('0x37')]));_0x17e539[_0xd0dc('0x36')]=_0x17e539[_0xd0dc('0x36')][_0xd0dc('0x38')]?_0x17e539[_0xd0dc('0x36')]:_0x122263[_0xd0dc('0x32')];if(_0x1dba1d[_0xd0dc('0x33')][_0xd0dc('0x41')]){_0x17e539[_0xd0dc('0x42')]=[{'all':!![]}];}_0x17e539=_['merge']({},_0x17e539,_0x1dba1d['options']);return db['Template'][_0xd0dc('0x47')](_0x17e539)[_0xd0dc('0x23')](handleEntityNotFound(_0x4558ee,null))[_0xd0dc('0x23')](respondWithResult(_0x4558ee,null))[_0xd0dc('0x45')](handleError(_0x4558ee,null));};exports[_0xd0dc('0x48')]=function(_0xbbb7b2,_0x22355e){return db[_0xd0dc('0x2e')][_0xd0dc('0x48')](_0xbbb7b2['body'],{})[_0xd0dc('0x23')](function(_0x31fd2f){var _0x16ccf6=_0xbbb7b2['user'][_0xd0dc('0x25')]({'plain':!![]});if(!_0x16ccf6)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x16ccf6[_0xd0dc('0x49')]===_0xd0dc('0x4a')){var _0x5c53d3=_0x31fd2f[_0xd0dc('0x25')]({'plain':!![]});var _0x23940c=_0xd0dc('0x26');return db[_0xd0dc('0x4b')][_0xd0dc('0x47')]({'where':{'name':_0x23940c,'userProfileId':_0x16ccf6['userProfileId']},'raw':!![]})[_0xd0dc('0x23')](function(_0x100d8e){if(_0x100d8e&&_0x100d8e[_0xd0dc('0x4c')]===0x0){return db[_0xd0dc('0x27')][_0xd0dc('0x48')]({'name':_0x5c53d3[_0xd0dc('0x2b')],'resourceId':_0x5c53d3['id'],'type':_0x100d8e[_0xd0dc('0x2b')],'sectionId':_0x100d8e['id']},{})[_0xd0dc('0x23')](function(){return _0x31fd2f;});}else{return _0x31fd2f;}})['catch'](function(_0x33792f){logger['error'](_0xd0dc('0x4d'),_0x33792f);throw _0x33792f;});}return _0x31fd2f;})[_0xd0dc('0x23')](respondWithResult(_0x22355e,0xc9))[_0xd0dc('0x45')](handleError(_0x22355e,null));};exports[_0xd0dc('0x22')]=function(_0x4cc7ef,_0x2fd9f4){if(_0x4cc7ef['body']['id']){delete _0x4cc7ef[_0xd0dc('0x4e')]['id'];}return db[_0xd0dc('0x2e')][_0xd0dc('0x47')]({'where':{'id':_0x4cc7ef['params']['id']}})[_0xd0dc('0x23')](handleEntityNotFound(_0x2fd9f4,null))['then'](saveUpdates(_0x4cc7ef[_0xd0dc('0x4e')],null))[_0xd0dc('0x23')](respondWithResult(_0x2fd9f4,null))['catch'](handleError(_0x2fd9f4,null));};exports[_0xd0dc('0x24')]=function(_0x2eec7a,_0x4a94f6){return db['Template'][_0xd0dc('0x47')]({'where':{'id':_0x2eec7a[_0xd0dc('0x46')]['id']}})[_0xd0dc('0x23')](handleEntityNotFound(_0x4a94f6,null))[_0xd0dc('0x23')](removeEntity(_0x4a94f6,null))['catch'](handleError(_0x4a94f6,null));}; \ No newline at end of file diff --git a/server/api/template/template.model.js b/server/api/template/template.model.js index 834bb2b..ad044cb 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 _0x8e7c=['request-promise','path','rimraf','./template.attributes','exports','define','lodash','util','../../config/logger','moment','bluebird'];(function(_0x3d3145,_0x32531a){var _0x5348f5=function(_0x572cc5){while(--_0x572cc5){_0x3d3145['push'](_0x3d3145['shift']());}};_0x5348f5(++_0x32531a);}(_0x8e7c,0x1ea));var _0xc8e7=function(_0x243c36,_0x32633a){_0x243c36=_0x243c36-0x0;var _0x28e9c8=_0x8e7c[_0x243c36];return _0x28e9c8;};'use strict';var _=require(_0xc8e7('0x0'));var util=require(_0xc8e7('0x1'));var logger=require(_0xc8e7('0x2'))('api');var moment=require(_0xc8e7('0x3'));var BPromise=require(_0xc8e7('0x4'));var rp=require(_0xc8e7('0x5'));var fs=require('fs');var path=require(_0xc8e7('0x6'));var rimraf=require(_0xc8e7('0x7'));var config=require('../../config/environment');var attributes=require(_0xc8e7('0x8'));module[_0xc8e7('0x9')]=function(_0x4993f3,_0x1e1684){return _0x4993f3[_0xc8e7('0xa')]('Template',attributes,{'tableName':'tools_templates','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x60ee=['./template.attributes','tools_templates','lodash','../../config/logger','api','bluebird','path','rimraf','../../config/environment'];(function(_0x3ec47c,_0x4cc00c){var _0x4b80c1=function(_0x52e469){while(--_0x52e469){_0x3ec47c['push'](_0x3ec47c['shift']());}};_0x4b80c1(++_0x4cc00c);}(_0x60ee,0x16a));var _0xe60e=function(_0x40220a,_0x22feb1){_0x40220a=_0x40220a-0x0;var _0x3903cc=_0x60ee[_0x40220a];return _0x3903cc;};'use strict';var _=require(_0xe60e('0x0'));var util=require('util');var logger=require(_0xe60e('0x1'))(_0xe60e('0x2'));var moment=require('moment');var BPromise=require(_0xe60e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe60e('0x4'));var rimraf=require(_0xe60e('0x5'));var config=require(_0xe60e('0x6'));var attributes=require(_0xe60e('0x7'));module['exports']=function(_0x27479a,_0x32c6e6){return _0x27479a['define']('Template',attributes,{'tableName':_0xe60e('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/template/template.rpc.js b/server/api/template/template.rpc.js index a01b1ae..8320beb 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 _0xadd3=['Template,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetTemplate','Template','findAll','options','raw','where','attributes','limit','include','model','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then','info','Template,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x3224c0,_0x326dc3){var _0xc3b27b=function(_0x2a640f){while(--_0x2a640f){_0x3224c0['push'](_0x3224c0['shift']());}};_0xc3b27b(++_0x326dc3);}(_0xadd3,0x13a));var _0x3add=function(_0x413feb,_0x10477f){_0x413feb=_0x413feb-0x0;var _0x40ee88=_0xadd3[_0x413feb];return _0x40ee88;};'use strict';var _=require(_0x3add('0x0'));var util=require(_0x3add('0x1'));var moment=require('moment');var BPromise=require(_0x3add('0x2'));var rs=require(_0x3add('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3add('0x4'))['db'];var utils=require(_0x3add('0x5'));var logger=require(_0x3add('0x6'))(_0x3add('0x7'));var config=require(_0x3add('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x3add('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x228eb9,_0x1aa0c1,_0x5eb76a){return new BPromise(function(_0x4dcf76,_0x552812){return client[_0x3add('0xa')](_0x228eb9,_0x5eb76a)[_0x3add('0xb')](function(_0x5c7735){logger[_0x3add('0xc')](_0x3add('0xd'),_0x1aa0c1,_0x3add('0xe'));logger[_0x3add('0xf')](_0x3add('0x10'),_0x1aa0c1,_0x3add('0xe'),JSON[_0x3add('0x11')](_0x5c7735));if(_0x5c7735[_0x3add('0x12')]){if(_0x5c7735['error'][_0x3add('0x13')]===0x1f4){logger['error'](_0x3add('0xd'),_0x1aa0c1,_0x5c7735[_0x3add('0x12')][_0x3add('0x14')]);return _0x552812(_0x5c7735[_0x3add('0x12')]['message']);}logger[_0x3add('0x12')]('Template,\x20%s,\x20%s',_0x1aa0c1,_0x5c7735[_0x3add('0x12')]['message']);return _0x4dcf76(_0x5c7735[_0x3add('0x12')][_0x3add('0x14')]);}else{logger[_0x3add('0xc')](_0x3add('0xd'),_0x1aa0c1,_0x3add('0xe'));_0x4dcf76(_0x5c7735[_0x3add('0x15')][_0x3add('0x14')]);}})[_0x3add('0x16')](function(_0xf84d4e){logger['error'](_0x3add('0xd'),_0x1aa0c1,_0xf84d4e);_0x552812(_0xf84d4e);});});}exports[_0x3add('0x17')]=function(_0x1de75f){var _0x206954=this;return new Promise(function(_0x4af28f,_0x56593a){return db[_0x3add('0x18')][_0x3add('0x19')]({'raw':_0x1de75f[_0x3add('0x1a')]?_0x1de75f['options'][_0x3add('0x1b')]===undefined?!![]:![]:!![],'where':_0x1de75f[_0x3add('0x1a')]?_0x1de75f[_0x3add('0x1a')][_0x3add('0x1c')]||null:null,'attributes':_0x1de75f[_0x3add('0x1a')]?_0x1de75f[_0x3add('0x1a')][_0x3add('0x1d')]||null:null,'limit':_0x1de75f[_0x3add('0x1a')]?_0x1de75f[_0x3add('0x1a')][_0x3add('0x1e')]||null:null,'include':_0x1de75f[_0x3add('0x1a')]?_0x1de75f[_0x3add('0x1a')][_0x3add('0x1f')]?_['map'](_0x1de75f['options']['include'],function(_0x2bbaea){return{'model':db[_0x2bbaea[_0x3add('0x20')]],'as':_0x2bbaea['as'],'attributes':_0x2bbaea['attributes'],'include':_0x2bbaea['include']?_['map'](_0x2bbaea[_0x3add('0x1f')],function(_0x2e8c97){return{'model':db[_0x2e8c97[_0x3add('0x20')]],'as':_0x2e8c97['as'],'attributes':_0x2e8c97[_0x3add('0x1d')],'include':_0x2e8c97[_0x3add('0x1f')]?_['map'](_0x2e8c97[_0x3add('0x1f')],function(_0x557118){return{'model':db[_0x557118[_0x3add('0x20')]],'as':_0x557118['as'],'attributes':_0x557118[_0x3add('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x3add('0xb')](function(_0x26b47f){logger[_0x3add('0xc')](_0x3add('0x17'),_0x1de75f);logger['debug'](_0x3add('0x17'),_0x1de75f,JSON[_0x3add('0x11')](_0x26b47f));_0x4af28f(_0x26b47f);})['catch'](function(_0x59fc60){logger[_0x3add('0x12')](_0x3add('0x17'),_0x59fc60[_0x3add('0x14')],_0x1de75f);_0x56593a(_0x206954[_0x3add('0x12')](0x1f4,_0x59fc60[_0x3add('0x14')]));});});}; \ No newline at end of file +var _0x8697=['Template,\x20%s,\x20%s','request\x20sent','debug','Template,\x20%s,\x20%s,\x20%s','error','message','result','catch','Template','findAll','options','raw','where','attributes','limit','map','include','model','info','GetTemplate','stringify','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http'];(function(_0x31e29a,_0x349c9b){var _0x32d892=function(_0x41cc86){while(--_0x41cc86){_0x31e29a['push'](_0x31e29a['shift']());}};_0x32d892(++_0x349c9b);}(_0x8697,0x72));var _0x7869=function(_0x42f4cc,_0x180d01){_0x42f4cc=_0x42f4cc-0x0;var _0x39946a=_0x8697[_0x42f4cc];return _0x39946a;};'use strict';var _=require(_0x7869('0x0'));var util=require(_0x7869('0x1'));var moment=require(_0x7869('0x2'));var BPromise=require('bluebird');var rs=require(_0x7869('0x3'));var fs=require('fs');var Redis=require(_0x7869('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x7869('0x5'));var logger=require(_0x7869('0x6'))('rpc');var config=require(_0x7869('0x7'));var jayson=require(_0x7869('0x8'));var client=jayson['client'][_0x7869('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xb00914,_0x1bb6b0,_0x158d3e){return new BPromise(function(_0x12e29d,_0x517b35){return client['request'](_0xb00914,_0x158d3e)['then'](function(_0x47259d){logger['info'](_0x7869('0xa'),_0x1bb6b0,_0x7869('0xb'));logger[_0x7869('0xc')](_0x7869('0xd'),_0x1bb6b0,_0x7869('0xb'),JSON['stringify'](_0x47259d));if(_0x47259d['error']){if(_0x47259d[_0x7869('0xe')]['code']===0x1f4){logger[_0x7869('0xe')](_0x7869('0xa'),_0x1bb6b0,_0x47259d[_0x7869('0xe')][_0x7869('0xf')]);return _0x517b35(_0x47259d['error'][_0x7869('0xf')]);}logger[_0x7869('0xe')](_0x7869('0xa'),_0x1bb6b0,_0x47259d[_0x7869('0xe')][_0x7869('0xf')]);return _0x12e29d(_0x47259d[_0x7869('0xe')]['message']);}else{logger['info'](_0x7869('0xa'),_0x1bb6b0,_0x7869('0xb'));_0x12e29d(_0x47259d[_0x7869('0x10')][_0x7869('0xf')]);}})[_0x7869('0x11')](function(_0x2e7742){logger[_0x7869('0xe')]('Template,\x20%s,\x20%s',_0x1bb6b0,_0x2e7742);_0x517b35(_0x2e7742);});});}exports['GetTemplate']=function(_0x7c209f){var _0x39e998=this;return new Promise(function(_0x19554f,_0x175014){return db[_0x7869('0x12')][_0x7869('0x13')]({'raw':_0x7c209f[_0x7869('0x14')]?_0x7c209f[_0x7869('0x14')][_0x7869('0x15')]===undefined?!![]:![]:!![],'where':_0x7c209f['options']?_0x7c209f['options'][_0x7869('0x16')]||null:null,'attributes':_0x7c209f['options']?_0x7c209f[_0x7869('0x14')][_0x7869('0x17')]||null:null,'limit':_0x7c209f[_0x7869('0x14')]?_0x7c209f[_0x7869('0x14')][_0x7869('0x18')]||null:null,'include':_0x7c209f[_0x7869('0x14')]?_0x7c209f[_0x7869('0x14')]['include']?_[_0x7869('0x19')](_0x7c209f[_0x7869('0x14')][_0x7869('0x1a')],function(_0x37b67c){return{'model':db[_0x37b67c[_0x7869('0x1b')]],'as':_0x37b67c['as'],'attributes':_0x37b67c[_0x7869('0x17')],'include':_0x37b67c['include']?_[_0x7869('0x19')](_0x37b67c[_0x7869('0x1a')],function(_0x5aa78a){return{'model':db[_0x5aa78a['model']],'as':_0x5aa78a['as'],'attributes':_0x5aa78a['attributes'],'include':_0x5aa78a[_0x7869('0x1a')]?_['map'](_0x5aa78a['include'],function(_0x5b0796){return{'model':db[_0x5b0796[_0x7869('0x1b')]],'as':_0x5b0796['as'],'attributes':_0x5b0796[_0x7869('0x17')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1e4dfe){logger[_0x7869('0x1c')]('GetTemplate',_0x7c209f);logger[_0x7869('0xc')](_0x7869('0x1d'),_0x7c209f,JSON[_0x7869('0x1e')](_0x1e4dfe));_0x19554f(_0x1e4dfe);})['catch'](function(_0xf1efd1){logger[_0x7869('0xe')](_0x7869('0x1d'),_0xf1efd1[_0x7869('0xf')],_0x7c209f);_0x175014(_0x39e998[_0x7869('0xe')](0x1f4,_0xf1efd1[_0x7869('0xf')]));});});}; \ No newline at end of file diff --git a/server/api/trigger/index.js b/server/api/trigger/index.js index de27644..c7c023a 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 _0xdc7b=['get','/:id','show','/:id/all_conditions','getAllConditions','/:id/any_conditions','getActions','post','create','addAllCondition','/:id/actions','addAction','put','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./trigger.controller','isAuthenticated','index'];(function(_0x26a815,_0xcde2b9){var _0x539ed1=function(_0x66f759){while(--_0x66f759){_0x26a815['push'](_0x26a815['shift']());}};_0x539ed1(++_0xcde2b9);}(_0xdc7b,0x153));var _0xbdc7=function(_0x30072c,_0x76f5bd){_0x30072c=_0x30072c-0x0;var _0x7ff218=_0xdc7b[_0x30072c];return _0x7ff218;};'use strict';var multer=require(_0xbdc7('0x0'));var util=require(_0xbdc7('0x1'));var path=require(_0xbdc7('0x2'));var timeout=require(_0xbdc7('0x3'));var express=require(_0xbdc7('0x4'));var router=express[_0xbdc7('0x5')]();var fs_extra=require(_0xbdc7('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xbdc7('0x7'));var config=require(_0xbdc7('0x8'));var controller=require(_0xbdc7('0x9'));router['get']('/',auth[_0xbdc7('0xa')](),controller[_0xbdc7('0xb')]);router[_0xbdc7('0xc')](_0xbdc7('0xd'),auth[_0xbdc7('0xa')](),controller[_0xbdc7('0xe')]);router['get'](_0xbdc7('0xf'),auth[_0xbdc7('0xa')](),controller[_0xbdc7('0x10')]);router[_0xbdc7('0xc')](_0xbdc7('0x11'),auth[_0xbdc7('0xa')](),controller['getAnyConditions']);router[_0xbdc7('0xc')]('/:id/actions',auth['isAuthenticated'](),controller[_0xbdc7('0x12')]);router[_0xbdc7('0x13')]('/',auth['isAuthenticated'](),controller[_0xbdc7('0x14')]);router['post'](_0xbdc7('0xf'),auth[_0xbdc7('0xa')](),controller[_0xbdc7('0x15')]);router[_0xbdc7('0x13')](_0xbdc7('0x11'),auth[_0xbdc7('0xa')](),controller['addAnyCondition']);router[_0xbdc7('0x13')](_0xbdc7('0x16'),auth[_0xbdc7('0xa')](),controller[_0xbdc7('0x17')]);router[_0xbdc7('0x18')](_0xbdc7('0xd'),auth[_0xbdc7('0xa')](),controller['update']);router[_0xbdc7('0x19')](_0xbdc7('0xd'),auth[_0xbdc7('0xa')](),controller['destroy']);module[_0xbdc7('0x1a')]=router; \ No newline at end of file +var _0x85f4=['../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/all_conditions','getAllConditions','/:id/any_conditions','getAnyConditions','/:id/actions','create','post','addAllCondition','addAnyCondition','addAction','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x1ae5ab,_0xc5d441){var _0x1ce001=function(_0x5ef96d){while(--_0x5ef96d){_0x1ae5ab['push'](_0x1ae5ab['shift']());}};_0x1ce001(++_0xc5d441);}(_0x85f4,0xc3));var _0x485f=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x85f4[_0x167cc1];return _0x10bc4b;};'use strict';var multer=require(_0x485f('0x0'));var util=require(_0x485f('0x1'));var path=require(_0x485f('0x2'));var timeout=require(_0x485f('0x3'));var express=require(_0x485f('0x4'));var router=express[_0x485f('0x5')]();var fs_extra=require(_0x485f('0x6'));var auth=require(_0x485f('0x7'));var interaction=require(_0x485f('0x8'));var config=require(_0x485f('0x9'));var controller=require('./trigger.controller');router[_0x485f('0xa')]('/',auth[_0x485f('0xb')](),controller['index']);router[_0x485f('0xa')](_0x485f('0xc'),auth['isAuthenticated'](),controller[_0x485f('0xd')]);router['get'](_0x485f('0xe'),auth[_0x485f('0xb')](),controller[_0x485f('0xf')]);router[_0x485f('0xa')](_0x485f('0x10'),auth['isAuthenticated'](),controller[_0x485f('0x11')]);router[_0x485f('0xa')](_0x485f('0x12'),auth['isAuthenticated'](),controller['getActions']);router['post']('/',auth['isAuthenticated'](),controller[_0x485f('0x13')]);router[_0x485f('0x14')](_0x485f('0xe'),auth[_0x485f('0xb')](),controller[_0x485f('0x15')]);router[_0x485f('0x14')](_0x485f('0x10'),auth['isAuthenticated'](),controller[_0x485f('0x16')]);router[_0x485f('0x14')]('/:id/actions',auth[_0x485f('0xb')](),controller[_0x485f('0x17')]);router[_0x485f('0x18')](_0x485f('0xc'),auth[_0x485f('0xb')](),controller[_0x485f('0x19')]);router[_0x485f('0x1a')]('/:id',auth['isAuthenticated'](),controller[_0x485f('0x1b')]);module[_0x485f('0x1c')]=router; \ No newline at end of file diff --git a/server/api/trigger/trigger.attributes.js b/server/api/trigger/trigger.attributes.js index fd5b95d..274b56c 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 _0xc6a1=['STRING','BOOLEAN','sequelize'];(function(_0x149a20,_0x2d1b4c){var _0x1d486a=function(_0x42523a){while(--_0x42523a){_0x149a20['push'](_0x149a20['shift']());}};_0x1d486a(++_0x2d1b4c);}(_0xc6a1,0x158));var _0x1c6a=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0xc6a1[_0x17d9e3];return _0x14192d;};'use strict';var Sequelize=require(_0x1c6a('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x1c6a('0x1')]},'description':{'type':Sequelize[_0x1c6a('0x1')]},'status':{'type':Sequelize[_0x1c6a('0x2')],'defaultValue':![]}}; \ No newline at end of file +var _0xbb22=['sequelize','STRING','BOOLEAN'];(function(_0x4e9628,_0x250573){var _0x27bc8c=function(_0xb3b7ae){while(--_0xb3b7ae){_0x4e9628['push'](_0x4e9628['shift']());}};_0x27bc8c(++_0x250573);}(_0xbb22,0x1e6));var _0x2bb2=function(_0x5f132f,_0x501a1f){_0x5f132f=_0x5f132f-0x0;var _0x409741=_0xbb22[_0x5f132f];return _0x409741;};'use strict';var Sequelize=require(_0x2bb2('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x2bb2('0x1')]},'description':{'type':Sequelize[_0x2bb2('0x1')]},'status':{'type':Sequelize[_0x2bb2('0x2')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/trigger/trigger.controller.js b/server/api/trigger/trigger.controller.js index 3cd9df9..6b42749 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 _0x386d=['destroy','get','Triggers','error','name','send','Trigger','rawAttributes','keys','query','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filter','merge','map','options','includeAll','include','findAll','rows','catch','show','params','length','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','addAllCondition','TriggerAllId','addAnyCondition','TriggerAnyId','Condition','getAllConditions','pick','getAnyConditions','addAction','Action','getActions','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','limit','count','offset','Content-Range','json','apply','reject','save','update','then'];(function(_0x53bf0d,_0x1d975e){var _0x5bcb10=function(_0x353ee4){while(--_0x353ee4){_0x53bf0d['push'](_0x53bf0d['shift']());}};_0x5bcb10(++_0x1d975e);}(_0x386d,0xf1));var _0xd386=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x386d[_0x17d9e3];return _0x14192d;};'use strict';var emlformat=require(_0xd386('0x0'));var rimraf=require(_0xd386('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xd386('0x2'));var moment=require(_0xd386('0x3'));var BPromise=require(_0xd386('0x4'));var Mustache=require(_0xd386('0x5'));var util=require(_0xd386('0x6'));var path=require('path');var sox=require(_0xd386('0x7'));var csv=require(_0xd386('0x8'));var ejs=require(_0xd386('0x9'));var fs=require('fs');var fs_extra=require(_0xd386('0xa'));var _=require(_0xd386('0xb'));var squel=require(_0xd386('0xc'));var crypto=require(_0xd386('0xd'));var jsforce=require(_0xd386('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xd386('0xf'));var Papa=require(_0xd386('0x10'));var Redis=require(_0xd386('0x11'));var authService=require(_0xd386('0x12'));var qs=require(_0xd386('0x13'));var as=require(_0xd386('0x14'));var hardwareService=require(_0xd386('0x15'));var logger=require(_0xd386('0x16'))(_0xd386('0x17'));var utils=require('../../config/utils');var config=require(_0xd386('0x18'));var licenseUtil=require(_0xd386('0x19'));var db=require(_0xd386('0x1a'))['db'];function respondWithStatusCode(_0x5c561a,_0x446079){_0x446079=_0x446079||0xcc;return function(_0x56d728){if(_0x56d728){return _0x5c561a[_0xd386('0x1b')](_0x446079);}return _0x5c561a[_0xd386('0x1c')](_0x446079)[_0xd386('0x1d')]();};}function respondWithResult(_0x3abbf4,_0x5225b6){_0x5225b6=_0x5225b6||0xc8;return function(_0x164fe7){if(_0x164fe7){return _0x3abbf4[_0xd386('0x1c')](_0x5225b6)['json'](_0x164fe7);}};}function respondWithFilteredResult(_0xf86759,_0x336204){return function(_0x37fc9f){if(_0x37fc9f){var _0x47add6=typeof _0x336204['offset']===_0xd386('0x1e')&&typeof _0x336204[_0xd386('0x1f')]===_0xd386('0x1e');var _0x29f640=_0x37fc9f[_0xd386('0x20')];var _0x37c7fb=_0x47add6?0x0:_0x336204[_0xd386('0x21')];var _0x5c74ab=_0x47add6?_0x37fc9f['count']:_0x336204['offset']+_0x336204['limit'];var _0x28ca62;if(_0x5c74ab>=_0x29f640){_0x5c74ab=_0x29f640;_0x28ca62=0xc8;}else{_0x28ca62=0xce;}_0xf86759[_0xd386('0x1c')](_0x28ca62);return _0xf86759['set'](_0xd386('0x22'),_0x37c7fb+'-'+_0x5c74ab+'/'+_0x29f640)[_0xd386('0x23')](_0x37fc9f);}return null;};}function patchUpdates(_0x5ec743){return function(_0x3e2842){try{jsonpatch[_0xd386('0x24')](_0x3e2842,_0x5ec743,!![]);}catch(_0x44ef24){return BPromise[_0xd386('0x25')](_0x44ef24);}return _0x3e2842[_0xd386('0x26')]();};}function saveUpdates(_0x20f945,_0x1cca4e){return function(_0x3dd2d6){if(_0x3dd2d6){return _0x3dd2d6[_0xd386('0x27')](_0x20f945)[_0xd386('0x28')](function(_0x3136f4){return _0x3136f4;});}return null;};}function removeEntity(_0x56ccaf,_0x2fcad3){return function(_0x5be200){if(_0x5be200){return _0x5be200[_0xd386('0x29')]()['then'](function(){var _0x33afa8=_0x5be200[_0xd386('0x2a')]({'plain':!![]});var _0x1b9c08=_0xd386('0x2b');return db['UserProfileResource'][_0xd386('0x29')]({'where':{'type':_0x1b9c08,'resourceId':_0x33afa8['id']}})[_0xd386('0x28')](function(){return _0x5be200;});})[_0xd386('0x28')](function(){_0x56ccaf[_0xd386('0x1c')](0xcc)[_0xd386('0x1d')]();});}};}function handleEntityNotFound(_0x1638af,_0x15b484){return function(_0x5e36c8){if(!_0x5e36c8){_0x1638af[_0xd386('0x1b')](0x194);}return _0x5e36c8;};}function handleError(_0x1d4782,_0x4f1e61){_0x4f1e61=_0x4f1e61||0x1f4;return function(_0x3cab78){logger[_0xd386('0x2c')](_0x3cab78['stack']);if(_0x3cab78[_0xd386('0x2d')]){delete _0x3cab78['name'];}_0x1d4782[_0xd386('0x1c')](_0x4f1e61)[_0xd386('0x2e')](_0x3cab78);};}exports['index']=function(_0x159fb8,_0x484839){var _0x2ae0b9={},_0x4cefdb={},_0x37eb68={'count':0x0,'rows':[]};var _0x223f73=_['map'](db[_0xd386('0x2f')][_0xd386('0x30')],function(_0x5e4eb9){return{'name':_0x5e4eb9['fieldName'],'type':_0x5e4eb9['type']['key']};});_0x4cefdb['model']=_['map'](_0x223f73,_0xd386('0x2d'));_0x4cefdb['query']=_[_0xd386('0x31')](_0x159fb8[_0xd386('0x32')]);_0x4cefdb[_0xd386('0x33')]=_[_0xd386('0x34')](_0x4cefdb[_0xd386('0x35')],_0x4cefdb['query']);_0x2ae0b9[_0xd386('0x36')]=_['intersection'](_0x4cefdb['model'],qs[_0xd386('0x37')](_0x159fb8['query'][_0xd386('0x37')]));_0x2ae0b9[_0xd386('0x36')]=_0x2ae0b9[_0xd386('0x36')]['length']?_0x2ae0b9[_0xd386('0x36')]:_0x4cefdb[_0xd386('0x35')];if(!_0x159fb8['query'][_0xd386('0x38')](_0xd386('0x39'))){_0x2ae0b9[_0xd386('0x1f')]=qs[_0xd386('0x1f')](_0x159fb8[_0xd386('0x32')][_0xd386('0x1f')]);_0x2ae0b9[_0xd386('0x21')]=qs[_0xd386('0x21')](_0x159fb8[_0xd386('0x32')][_0xd386('0x21')]);}_0x2ae0b9[_0xd386('0x3a')]=qs[_0xd386('0x3b')](_0x159fb8[_0xd386('0x32')][_0xd386('0x3b')]);_0x2ae0b9[_0xd386('0x3c')]=qs[_0xd386('0x33')](_['pick'](_0x159fb8['query'],_0x4cefdb[_0xd386('0x33')]),_0x223f73);if(_0x159fb8[_0xd386('0x32')][_0xd386('0x3d')]){_0x2ae0b9[_0xd386('0x3c')]=_[_0xd386('0x3e')](_0x2ae0b9['where'],{'$or':_[_0xd386('0x3f')](_0x223f73,function(_0x36973d){if(_0x36973d['type']!=='VIRTUAL'){var _0x2ac265={};_0x2ac265[_0x36973d['name']]={'$like':'%'+_0x159fb8[_0xd386('0x32')][_0xd386('0x3d')]+'%'};return _0x2ac265;}})});}_0x2ae0b9=_[_0xd386('0x3e')]({},_0x2ae0b9,_0x159fb8[_0xd386('0x40')]);var _0x22c193={'where':_0x2ae0b9[_0xd386('0x3c')]};return db[_0xd386('0x2f')]['count'](_0x22c193)[_0xd386('0x28')](function(_0x282460){_0x37eb68[_0xd386('0x20')]=_0x282460;if(_0x159fb8[_0xd386('0x32')][_0xd386('0x41')]){_0x2ae0b9[_0xd386('0x42')]=[{'all':!![]}];}return db['Trigger'][_0xd386('0x43')](_0x2ae0b9);})[_0xd386('0x28')](function(_0x3634f9){_0x37eb68[_0xd386('0x44')]=_0x3634f9;return _0x37eb68;})[_0xd386('0x28')](respondWithFilteredResult(_0x484839,_0x2ae0b9))[_0xd386('0x45')](handleError(_0x484839,null));};exports[_0xd386('0x46')]=function(_0x354997,_0x6e4040){var _0x2f17be={'raw':![],'where':{'id':_0x354997[_0xd386('0x47')]['id']}},_0x180f22={};_0x180f22[_0xd386('0x35')]=_[_0xd386('0x31')](db[_0xd386('0x2f')][_0xd386('0x30')]);_0x180f22['query']=_['keys'](_0x354997[_0xd386('0x32')]);_0x180f22[_0xd386('0x33')]=_[_0xd386('0x34')](_0x180f22[_0xd386('0x35')],_0x180f22[_0xd386('0x32')]);_0x2f17be[_0xd386('0x36')]=_[_0xd386('0x34')](_0x180f22[_0xd386('0x35')],qs['fields'](_0x354997['query'][_0xd386('0x37')]));_0x2f17be[_0xd386('0x36')]=_0x2f17be[_0xd386('0x36')][_0xd386('0x48')]?_0x2f17be['attributes']:_0x180f22['model'];if(_0x354997[_0xd386('0x32')][_0xd386('0x41')]){_0x2f17be[_0xd386('0x42')]=[{'all':!![]}];}_0x2f17be=_[_0xd386('0x3e')]({},_0x2f17be,_0x354997[_0xd386('0x40')]);return db[_0xd386('0x2f')][_0xd386('0x49')](_0x2f17be)[_0xd386('0x28')](handleEntityNotFound(_0x6e4040,null))[_0xd386('0x28')](respondWithResult(_0x6e4040,null))[_0xd386('0x45')](handleError(_0x6e4040,null));};exports[_0xd386('0x4a')]=function(_0x45a666,_0x706f6e){return db[_0xd386('0x2f')][_0xd386('0x4a')](_0x45a666[_0xd386('0x4b')],{})[_0xd386('0x28')](function(_0x3a0174){var _0x17c052=_0x45a666[_0xd386('0x4c')]['get']({'plain':!![]});if(!_0x17c052)throw new Error(_0xd386('0x4d'));if(_0x17c052[_0xd386('0x4e')]==='user'){var _0x5d1266=_0x3a0174[_0xd386('0x2a')]({'plain':!![]});var _0x3f81ac=_0xd386('0x2b');return db[_0xd386('0x4f')]['find']({'where':{'name':_0x3f81ac,'userProfileId':_0x17c052[_0xd386('0x50')]},'raw':!![]})[_0xd386('0x28')](function(_0x14b9ca){if(_0x14b9ca&&_0x14b9ca[_0xd386('0x51')]===0x0){return db[_0xd386('0x52')]['create']({'name':_0x5d1266[_0xd386('0x2d')],'resourceId':_0x5d1266['id'],'type':_0x14b9ca[_0xd386('0x2d')],'sectionId':_0x14b9ca['id']},{})[_0xd386('0x28')](function(){return _0x3a0174;});}else{return _0x3a0174;}})[_0xd386('0x45')](function(_0x162591){logger[_0xd386('0x2c')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x162591);throw _0x162591;});}return _0x3a0174;})['then'](respondWithResult(_0x706f6e,0xc9))[_0xd386('0x45')](handleError(_0x706f6e,null));};exports['update']=function(_0x1c6255,_0x31dd40){if(_0x1c6255[_0xd386('0x4b')]['id']){delete _0x1c6255[_0xd386('0x4b')]['id'];}return db[_0xd386('0x2f')]['find']({'where':{'id':_0x1c6255[_0xd386('0x47')]['id']}})['then'](handleEntityNotFound(_0x31dd40,null))['then'](saveUpdates(_0x1c6255[_0xd386('0x4b')],null))[_0xd386('0x28')](respondWithResult(_0x31dd40,null))[_0xd386('0x45')](handleError(_0x31dd40,null));};exports[_0xd386('0x29')]=function(_0x24e070,_0x4c23db){return db[_0xd386('0x2f')]['find']({'where':{'id':_0x24e070['params']['id']}})[_0xd386('0x28')](handleEntityNotFound(_0x4c23db,null))[_0xd386('0x28')](removeEntity(_0x4c23db,null))[_0xd386('0x45')](handleError(_0x4c23db,null));};exports[_0xd386('0x53')]=function(_0x11ad56,_0x1712f0,_0x38d091){if(_0x11ad56[_0xd386('0x4b')]['id']){delete _0x11ad56[_0xd386('0x4b')]['id'];}return db[_0xd386('0x2f')][_0xd386('0x49')]({'where':{'id':_0x11ad56[_0xd386('0x47')]['id']}})[_0xd386('0x28')](handleEntityNotFound(_0x1712f0,null))['then'](function(_0x34f531){if(_0x34f531){_0x11ad56['body'][_0xd386('0x54')]=_0x34f531['id'];return db['Condition'][_0xd386('0x4a')](_0x11ad56[_0xd386('0x4b')]);}})[_0xd386('0x28')](respondWithResult(_0x1712f0,null))[_0xd386('0x45')](handleError(_0x1712f0,null));};exports[_0xd386('0x55')]=function(_0x3dbf4b,_0x5e5f38,_0x6ed4f0){if(_0x3dbf4b['body']['id']){delete _0x3dbf4b[_0xd386('0x4b')]['id'];}return db[_0xd386('0x2f')]['find']({'where':{'id':_0x3dbf4b[_0xd386('0x47')]['id']}})[_0xd386('0x28')](handleEntityNotFound(_0x5e5f38,null))[_0xd386('0x28')](function(_0x5bbda1){if(_0x5bbda1){_0x3dbf4b[_0xd386('0x4b')][_0xd386('0x56')]=_0x5bbda1['id'];return db[_0xd386('0x57')][_0xd386('0x4a')](_0x3dbf4b[_0xd386('0x4b')]);}})[_0xd386('0x28')](respondWithResult(_0x5e5f38,null))[_0xd386('0x45')](handleError(_0x5e5f38,null));};exports[_0xd386('0x58')]=function(_0x1fbe29,_0x188bbf,_0x1a9fcb){var _0x2bcafe={};var _0x5c7340={};var _0x5bde7d;var _0x107cb3;return db[_0xd386('0x2f')]['findOne']({'where':{'id':_0x1fbe29[_0xd386('0x47')]['id']}})['then'](handleEntityNotFound(_0x188bbf,null))['then'](function(_0x237aaf){if(_0x237aaf){_0x5bde7d=_0x237aaf;_0x5c7340[_0xd386('0x35')]=_[_0xd386('0x31')](db[_0xd386('0x57')][_0xd386('0x30')]);_0x5c7340['query']=_[_0xd386('0x31')](_0x1fbe29[_0xd386('0x32')]);_0x5c7340[_0xd386('0x33')]=_['intersection'](_0x5c7340[_0xd386('0x35')],_0x5c7340[_0xd386('0x32')]);_0x2bcafe[_0xd386('0x36')]=_[_0xd386('0x34')](_0x5c7340[_0xd386('0x35')],qs[_0xd386('0x37')](_0x1fbe29[_0xd386('0x32')][_0xd386('0x37')]));_0x2bcafe[_0xd386('0x36')]=_0x2bcafe[_0xd386('0x36')]['length']?_0x2bcafe['attributes']:_0x5c7340[_0xd386('0x35')];_0x2bcafe[_0xd386('0x3a')]=qs[_0xd386('0x3b')](_0x1fbe29[_0xd386('0x32')][_0xd386('0x3b')]);_0x2bcafe[_0xd386('0x3c')]=qs[_0xd386('0x33')](_[_0xd386('0x59')](_0x1fbe29['query'],_0x5c7340['filters']));if(_0x1fbe29['query'][_0xd386('0x3d')]){_0x2bcafe['where']=_[_0xd386('0x3e')](_0x2bcafe[_0xd386('0x3c')],{'$or':_[_0xd386('0x3f')](_0x2bcafe['attributes'],function(_0x46319e){var _0x1bf353={};_0x1bf353[_0x46319e]={'$like':'%'+_0x1fbe29['query'][_0xd386('0x3d')]+'%'};return _0x1bf353;})});}_0x2bcafe=_[_0xd386('0x3e')]({},_0x2bcafe,_0x1fbe29['options']);return _0x5bde7d[_0xd386('0x58')](_0x2bcafe);}})[_0xd386('0x28')](function(_0x396470){if(_0x396470){_0x107cb3=_0x396470['length'];if(!_0x1fbe29[_0xd386('0x32')][_0xd386('0x38')](_0xd386('0x39'))){_0x2bcafe[_0xd386('0x1f')]=qs['limit'](_0x1fbe29[_0xd386('0x32')]['limit']);_0x2bcafe[_0xd386('0x21')]=qs[_0xd386('0x21')](_0x1fbe29[_0xd386('0x32')][_0xd386('0x21')]);}return _0x5bde7d[_0xd386('0x58')](_0x2bcafe);}})[_0xd386('0x28')](function(_0x4cdc1a){if(_0x4cdc1a){return _0x4cdc1a?{'count':_0x107cb3,'rows':_0x4cdc1a}:null;}})[_0xd386('0x28')](respondWithResult(_0x188bbf,null))['catch'](handleError(_0x188bbf,null));};exports[_0xd386('0x5a')]=function(_0x3f9e96,_0x59b572,_0x352602){var _0xf98ecb={};var _0x573d99={};var _0x539e79;var _0x4dd896;return db[_0xd386('0x2f')]['findOne']({'where':{'id':_0x3f9e96[_0xd386('0x47')]['id']}})[_0xd386('0x28')](handleEntityNotFound(_0x59b572,null))[_0xd386('0x28')](function(_0x4b930b){if(_0x4b930b){_0x539e79=_0x4b930b;_0x573d99[_0xd386('0x35')]=_[_0xd386('0x31')](db['Condition'][_0xd386('0x30')]);_0x573d99[_0xd386('0x32')]=_['keys'](_0x3f9e96[_0xd386('0x32')]);_0x573d99[_0xd386('0x33')]=_[_0xd386('0x34')](_0x573d99[_0xd386('0x35')],_0x573d99[_0xd386('0x32')]);_0xf98ecb[_0xd386('0x36')]=_[_0xd386('0x34')](_0x573d99[_0xd386('0x35')],qs['fields'](_0x3f9e96[_0xd386('0x32')][_0xd386('0x37')]));_0xf98ecb['attributes']=_0xf98ecb[_0xd386('0x36')][_0xd386('0x48')]?_0xf98ecb[_0xd386('0x36')]:_0x573d99['model'];_0xf98ecb[_0xd386('0x3a')]=qs['sort'](_0x3f9e96[_0xd386('0x32')]['sort']);_0xf98ecb[_0xd386('0x3c')]=qs['filters'](_[_0xd386('0x59')](_0x3f9e96[_0xd386('0x32')],_0x573d99[_0xd386('0x33')]));if(_0x3f9e96[_0xd386('0x32')][_0xd386('0x3d')]){_0xf98ecb['where']=_[_0xd386('0x3e')](_0xf98ecb[_0xd386('0x3c')],{'$or':_[_0xd386('0x3f')](_0xf98ecb[_0xd386('0x36')],function(_0x1e4fdc){var _0x22cc95={};_0x22cc95[_0x1e4fdc]={'$like':'%'+_0x3f9e96[_0xd386('0x32')][_0xd386('0x3d')]+'%'};return _0x22cc95;})});}_0xf98ecb=_[_0xd386('0x3e')]({},_0xf98ecb,_0x3f9e96[_0xd386('0x40')]);return _0x539e79[_0xd386('0x5a')](_0xf98ecb);}})[_0xd386('0x28')](function(_0x1c33b4){if(_0x1c33b4){_0x4dd896=_0x1c33b4[_0xd386('0x48')];if(!_0x3f9e96[_0xd386('0x32')]['hasOwnProperty'](_0xd386('0x39'))){_0xf98ecb[_0xd386('0x1f')]=qs[_0xd386('0x1f')](_0x3f9e96[_0xd386('0x32')][_0xd386('0x1f')]);_0xf98ecb[_0xd386('0x21')]=qs[_0xd386('0x21')](_0x3f9e96[_0xd386('0x32')][_0xd386('0x21')]);}return _0x539e79['getAnyConditions'](_0xf98ecb);}})['then'](function(_0x243828){if(_0x243828){return _0x243828?{'count':_0x4dd896,'rows':_0x243828}:null;}})[_0xd386('0x28')](respondWithResult(_0x59b572,null))[_0xd386('0x45')](handleError(_0x59b572,null));};exports[_0xd386('0x5b')]=function(_0x149c1c,_0x25058e,_0x26128e){if(_0x149c1c[_0xd386('0x4b')]['id']){delete _0x149c1c['body']['id'];}return db[_0xd386('0x2f')][_0xd386('0x49')]({'where':{'id':_0x149c1c[_0xd386('0x47')]['id']}})[_0xd386('0x28')](handleEntityNotFound(_0x25058e,null))[_0xd386('0x28')](function(_0x1042c4){if(_0x1042c4){_0x149c1c['body']['TriggerId']=_0x1042c4['id'];return db[_0xd386('0x5c')][_0xd386('0x4a')](_0x149c1c[_0xd386('0x4b')]);}})[_0xd386('0x28')](respondWithResult(_0x25058e,null))[_0xd386('0x45')](handleError(_0x25058e,null));};exports[_0xd386('0x5d')]=function(_0x4a7443,_0x44f795,_0x6effc3){var _0x51fb88={};var _0x1b9cc7={};var _0x3f2c18;var _0x51b0c7;return db['Trigger']['findOne']({'where':{'id':_0x4a7443[_0xd386('0x47')]['id']}})[_0xd386('0x28')](handleEntityNotFound(_0x44f795,null))[_0xd386('0x28')](function(_0x4e568c){if(_0x4e568c){_0x3f2c18=_0x4e568c;_0x1b9cc7[_0xd386('0x35')]=_[_0xd386('0x31')](db[_0xd386('0x5c')][_0xd386('0x30')]);_0x1b9cc7[_0xd386('0x32')]=_['keys'](_0x4a7443['query']);_0x1b9cc7['filters']=_[_0xd386('0x34')](_0x1b9cc7['model'],_0x1b9cc7[_0xd386('0x32')]);_0x51fb88['attributes']=_[_0xd386('0x34')](_0x1b9cc7['model'],qs[_0xd386('0x37')](_0x4a7443[_0xd386('0x32')][_0xd386('0x37')]));_0x51fb88[_0xd386('0x36')]=_0x51fb88[_0xd386('0x36')]['length']?_0x51fb88[_0xd386('0x36')]:_0x1b9cc7['model'];_0x51fb88[_0xd386('0x3a')]=qs['sort'](_0x4a7443[_0xd386('0x32')][_0xd386('0x3b')]);_0x51fb88[_0xd386('0x3c')]=qs[_0xd386('0x33')](_[_0xd386('0x59')](_0x4a7443['query'],_0x1b9cc7[_0xd386('0x33')]));if(_0x4a7443[_0xd386('0x32')]['filter']){_0x51fb88[_0xd386('0x3c')]=_['merge'](_0x51fb88[_0xd386('0x3c')],{'$or':_[_0xd386('0x3f')](_0x51fb88['attributes'],function(_0x3821e6){var _0xe95f2={};_0xe95f2[_0x3821e6]={'$like':'%'+_0x4a7443[_0xd386('0x32')]['filter']+'%'};return _0xe95f2;})});}_0x51fb88=_['merge']({},_0x51fb88,_0x4a7443[_0xd386('0x40')]);return _0x3f2c18[_0xd386('0x5d')](_0x51fb88);}})[_0xd386('0x28')](function(_0xe65743){if(_0xe65743){_0x51b0c7=_0xe65743[_0xd386('0x48')];if(!_0x4a7443[_0xd386('0x32')][_0xd386('0x38')](_0xd386('0x39'))){_0x51fb88['limit']=qs[_0xd386('0x1f')](_0x4a7443[_0xd386('0x32')][_0xd386('0x1f')]);_0x51fb88[_0xd386('0x21')]=qs[_0xd386('0x21')](_0x4a7443['query'][_0xd386('0x21')]);}return _0x3f2c18[_0xd386('0x5d')](_0x51fb88);}})[_0xd386('0x28')](function(_0x28a201){if(_0x28a201){return _0x28a201?{'count':_0x51b0c7,'rows':_0x28a201}:null;}})[_0xd386('0x28')](respondWithResult(_0x44f795,null))[_0xd386('0x45')](handleError(_0x44f795,null));}; \ No newline at end of file +var _0xce3b=['ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/license/util','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','then','destroy','Triggers','stack','name','send','Trigger','rawAttributes','key','keys','query','filters','model','attributes','fields','length','nolimit','order','sort','where','pick','merge','type','VIRTUAL','filter','options','includeAll','include','findAll','catch','show','params','intersection','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','UserProfileResource','error','update','TriggerAllId','Condition','TriggerAnyId','getAllConditions','findOne','map','getAnyConditions','hasOwnProperty','addAction','getActions','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','papaparse'];(function(_0x410371,_0x52ec52){var _0x49a12a=function(_0x29a2ec){while(--_0x29a2ec){_0x410371['push'](_0x410371['shift']());}};_0x49a12a(++_0x52ec52);}(_0xce3b,0x1ef));var _0xbce3=function(_0x1a5847,_0x40cf63){_0x1a5847=_0x1a5847-0x0;var _0x40eb41=_0xce3b[_0x1a5847];return _0x40eb41;};'use strict';var emlformat=require(_0xbce3('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xbce3('0x1'));var rp=require(_0xbce3('0x2'));var moment=require(_0xbce3('0x3'));var BPromise=require(_0xbce3('0x4'));var Mustache=require(_0xbce3('0x5'));var util=require('util');var path=require('path');var sox=require(_0xbce3('0x6'));var csv=require(_0xbce3('0x7'));var ejs=require(_0xbce3('0x8'));var fs=require('fs');var fs_extra=require(_0xbce3('0x9'));var _=require(_0xbce3('0xa'));var squel=require('squel');var crypto=require(_0xbce3('0xb'));var jsforce=require(_0xbce3('0xc'));var deskjs=require(_0xbce3('0xd'));var toCsv=require(_0xbce3('0x7'));var querystring=require('querystring');var Papa=require(_0xbce3('0xe'));var Redis=require(_0xbce3('0xf'));var authService=require(_0xbce3('0x10'));var qs=require(_0xbce3('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xbce3('0x12'))(_0xbce3('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xbce3('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4abc86,_0x20365f){_0x20365f=_0x20365f||0xcc;return function(_0x1e2f01){if(_0x1e2f01){return _0x4abc86['sendStatus'](_0x20365f);}return _0x4abc86[_0xbce3('0x15')](_0x20365f)['end']();};}function respondWithResult(_0x4cfa5b,_0x3ef264){_0x3ef264=_0x3ef264||0xc8;return function(_0x1bacfd){if(_0x1bacfd){return _0x4cfa5b[_0xbce3('0x15')](_0x3ef264)[_0xbce3('0x16')](_0x1bacfd);}};}function respondWithFilteredResult(_0x19556a,_0x3332ed){return function(_0x3aa55e){if(_0x3aa55e){var _0x8a1f48=typeof _0x3332ed[_0xbce3('0x17')]===_0xbce3('0x18')&&typeof _0x3332ed[_0xbce3('0x19')]===_0xbce3('0x18');var _0xe41b08=_0x3aa55e[_0xbce3('0x1a')];var _0x527480=_0x8a1f48?0x0:_0x3332ed[_0xbce3('0x17')];var _0x52262c=_0x8a1f48?_0x3aa55e['count']:_0x3332ed[_0xbce3('0x17')]+_0x3332ed[_0xbce3('0x19')];var _0x4a9f72;if(_0x52262c>=_0xe41b08){_0x52262c=_0xe41b08;_0x4a9f72=0xc8;}else{_0x4a9f72=0xce;}_0x19556a[_0xbce3('0x15')](_0x4a9f72);return _0x19556a[_0xbce3('0x1b')](_0xbce3('0x1c'),_0x527480+'-'+_0x52262c+'/'+_0xe41b08)[_0xbce3('0x16')](_0x3aa55e);}return null;};}function patchUpdates(_0x2ae79c){return function(_0x4df192){try{jsonpatch['apply'](_0x4df192,_0x2ae79c,!![]);}catch(_0x18b8c5){return BPromise[_0xbce3('0x1d')](_0x18b8c5);}return _0x4df192[_0xbce3('0x1e')]();};}function saveUpdates(_0x36a775,_0x18b2db){return function(_0x37589f){if(_0x37589f){return _0x37589f['update'](_0x36a775)[_0xbce3('0x1f')](function(_0x28fd14){return _0x28fd14;});}return null;};}function removeEntity(_0x10143b,_0x399729){return function(_0x5dece0){if(_0x5dece0){return _0x5dece0[_0xbce3('0x20')]()['then'](function(){var _0x2ae979=_0x5dece0['get']({'plain':!![]});var _0x3326ae=_0xbce3('0x21');return db['UserProfileResource'][_0xbce3('0x20')]({'where':{'type':_0x3326ae,'resourceId':_0x2ae979['id']}})['then'](function(){return _0x5dece0;});})['then'](function(){_0x10143b[_0xbce3('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x549178,_0x2ebdfd){return function(_0x481a2f){if(!_0x481a2f){_0x549178['sendStatus'](0x194);}return _0x481a2f;};}function handleError(_0x3eaa24,_0x34ec79){_0x34ec79=_0x34ec79||0x1f4;return function(_0x2d9a1c){logger['error'](_0x2d9a1c[_0xbce3('0x22')]);if(_0x2d9a1c[_0xbce3('0x23')]){delete _0x2d9a1c[_0xbce3('0x23')];}_0x3eaa24[_0xbce3('0x15')](_0x34ec79)[_0xbce3('0x24')](_0x2d9a1c);};}exports['index']=function(_0x261996,_0xcef7d8){var _0x1603c2={},_0x3a7e01={},_0x4ce181={'count':0x0,'rows':[]};var _0x101e12=_['map'](db[_0xbce3('0x25')][_0xbce3('0x26')],function(_0x5d7a8d){return{'name':_0x5d7a8d['fieldName'],'type':_0x5d7a8d['type'][_0xbce3('0x27')]};});_0x3a7e01['model']=_['map'](_0x101e12,_0xbce3('0x23'));_0x3a7e01['query']=_[_0xbce3('0x28')](_0x261996[_0xbce3('0x29')]);_0x3a7e01[_0xbce3('0x2a')]=_['intersection'](_0x3a7e01[_0xbce3('0x2b')],_0x3a7e01['query']);_0x1603c2[_0xbce3('0x2c')]=_['intersection'](_0x3a7e01[_0xbce3('0x2b')],qs['fields'](_0x261996['query'][_0xbce3('0x2d')]));_0x1603c2[_0xbce3('0x2c')]=_0x1603c2[_0xbce3('0x2c')][_0xbce3('0x2e')]?_0x1603c2[_0xbce3('0x2c')]:_0x3a7e01[_0xbce3('0x2b')];if(!_0x261996[_0xbce3('0x29')]['hasOwnProperty'](_0xbce3('0x2f'))){_0x1603c2['limit']=qs['limit'](_0x261996[_0xbce3('0x29')][_0xbce3('0x19')]);_0x1603c2[_0xbce3('0x17')]=qs[_0xbce3('0x17')](_0x261996[_0xbce3('0x29')][_0xbce3('0x17')]);}_0x1603c2[_0xbce3('0x30')]=qs[_0xbce3('0x31')](_0x261996[_0xbce3('0x29')][_0xbce3('0x31')]);_0x1603c2[_0xbce3('0x32')]=qs['filters'](_[_0xbce3('0x33')](_0x261996[_0xbce3('0x29')],_0x3a7e01[_0xbce3('0x2a')]),_0x101e12);if(_0x261996[_0xbce3('0x29')]['filter']){_0x1603c2['where']=_[_0xbce3('0x34')](_0x1603c2[_0xbce3('0x32')],{'$or':_['map'](_0x101e12,function(_0x5857cd){if(_0x5857cd[_0xbce3('0x35')]!==_0xbce3('0x36')){var _0x79c84b={};_0x79c84b[_0x5857cd['name']]={'$like':'%'+_0x261996[_0xbce3('0x29')][_0xbce3('0x37')]+'%'};return _0x79c84b;}})});}_0x1603c2=_['merge']({},_0x1603c2,_0x261996[_0xbce3('0x38')]);var _0x3577a1={'where':_0x1603c2[_0xbce3('0x32')]};return db[_0xbce3('0x25')]['count'](_0x3577a1)[_0xbce3('0x1f')](function(_0x1f8389){_0x4ce181['count']=_0x1f8389;if(_0x261996['query'][_0xbce3('0x39')]){_0x1603c2[_0xbce3('0x3a')]=[{'all':!![]}];}return db[_0xbce3('0x25')][_0xbce3('0x3b')](_0x1603c2);})['then'](function(_0x4f7915){_0x4ce181['rows']=_0x4f7915;return _0x4ce181;})[_0xbce3('0x1f')](respondWithFilteredResult(_0xcef7d8,_0x1603c2))[_0xbce3('0x3c')](handleError(_0xcef7d8,null));};exports[_0xbce3('0x3d')]=function(_0x531b94,_0x3b4220){var _0x4596df={'raw':![],'where':{'id':_0x531b94[_0xbce3('0x3e')]['id']}},_0x116007={};_0x116007[_0xbce3('0x2b')]=_[_0xbce3('0x28')](db[_0xbce3('0x25')][_0xbce3('0x26')]);_0x116007[_0xbce3('0x29')]=_['keys'](_0x531b94[_0xbce3('0x29')]);_0x116007[_0xbce3('0x2a')]=_[_0xbce3('0x3f')](_0x116007[_0xbce3('0x2b')],_0x116007['query']);_0x4596df[_0xbce3('0x2c')]=_[_0xbce3('0x3f')](_0x116007[_0xbce3('0x2b')],qs['fields'](_0x531b94['query'][_0xbce3('0x2d')]));_0x4596df[_0xbce3('0x2c')]=_0x4596df[_0xbce3('0x2c')]['length']?_0x4596df[_0xbce3('0x2c')]:_0x116007[_0xbce3('0x2b')];if(_0x531b94[_0xbce3('0x29')][_0xbce3('0x39')]){_0x4596df[_0xbce3('0x3a')]=[{'all':!![]}];}_0x4596df=_['merge']({},_0x4596df,_0x531b94['options']);return db['Trigger'][_0xbce3('0x40')](_0x4596df)[_0xbce3('0x1f')](handleEntityNotFound(_0x3b4220,null))[_0xbce3('0x1f')](respondWithResult(_0x3b4220,null))[_0xbce3('0x3c')](handleError(_0x3b4220,null));};exports[_0xbce3('0x41')]=function(_0x5872b4,_0xa4255e){return db['Trigger'][_0xbce3('0x41')](_0x5872b4[_0xbce3('0x42')],{})[_0xbce3('0x1f')](function(_0x171560){var _0x1b173b=_0x5872b4[_0xbce3('0x43')][_0xbce3('0x44')]({'plain':!![]});if(!_0x1b173b)throw new Error(_0xbce3('0x45'));if(_0x1b173b['role']===_0xbce3('0x43')){var _0x5131c5=_0x171560[_0xbce3('0x44')]({'plain':!![]});var _0x592059=_0xbce3('0x21');return db[_0xbce3('0x46')][_0xbce3('0x40')]({'where':{'name':_0x592059,'userProfileId':_0x1b173b[_0xbce3('0x47')]},'raw':!![]})['then'](function(_0x3ee2e6){if(_0x3ee2e6&&_0x3ee2e6['autoAssociation']===0x0){return db[_0xbce3('0x48')][_0xbce3('0x41')]({'name':_0x5131c5[_0xbce3('0x23')],'resourceId':_0x5131c5['id'],'type':_0x3ee2e6[_0xbce3('0x23')],'sectionId':_0x3ee2e6['id']},{})[_0xbce3('0x1f')](function(){return _0x171560;});}else{return _0x171560;}})[_0xbce3('0x3c')](function(_0x5dbfd3){logger[_0xbce3('0x49')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5dbfd3);throw _0x5dbfd3;});}return _0x171560;})[_0xbce3('0x1f')](respondWithResult(_0xa4255e,0xc9))['catch'](handleError(_0xa4255e,null));};exports[_0xbce3('0x4a')]=function(_0x15b265,_0x4b14d5){if(_0x15b265['body']['id']){delete _0x15b265[_0xbce3('0x42')]['id'];}return db[_0xbce3('0x25')][_0xbce3('0x40')]({'where':{'id':_0x15b265[_0xbce3('0x3e')]['id']}})[_0xbce3('0x1f')](handleEntityNotFound(_0x4b14d5,null))['then'](saveUpdates(_0x15b265[_0xbce3('0x42')],null))[_0xbce3('0x1f')](respondWithResult(_0x4b14d5,null))[_0xbce3('0x3c')](handleError(_0x4b14d5,null));};exports[_0xbce3('0x20')]=function(_0x10b3eb,_0x5bdaa6){return db[_0xbce3('0x25')]['find']({'where':{'id':_0x10b3eb[_0xbce3('0x3e')]['id']}})['then'](handleEntityNotFound(_0x5bdaa6,null))[_0xbce3('0x1f')](removeEntity(_0x5bdaa6,null))[_0xbce3('0x3c')](handleError(_0x5bdaa6,null));};exports['addAllCondition']=function(_0x57ef01,_0x178ae3,_0x20c7e4){if(_0x57ef01[_0xbce3('0x42')]['id']){delete _0x57ef01[_0xbce3('0x42')]['id'];}return db[_0xbce3('0x25')][_0xbce3('0x40')]({'where':{'id':_0x57ef01[_0xbce3('0x3e')]['id']}})['then'](handleEntityNotFound(_0x178ae3,null))[_0xbce3('0x1f')](function(_0x556db9){if(_0x556db9){_0x57ef01[_0xbce3('0x42')][_0xbce3('0x4b')]=_0x556db9['id'];return db[_0xbce3('0x4c')]['create'](_0x57ef01['body']);}})[_0xbce3('0x1f')](respondWithResult(_0x178ae3,null))[_0xbce3('0x3c')](handleError(_0x178ae3,null));};exports['addAnyCondition']=function(_0x3adaac,_0x26c7c9,_0x3d7214){if(_0x3adaac['body']['id']){delete _0x3adaac[_0xbce3('0x42')]['id'];}return db[_0xbce3('0x25')][_0xbce3('0x40')]({'where':{'id':_0x3adaac[_0xbce3('0x3e')]['id']}})[_0xbce3('0x1f')](handleEntityNotFound(_0x26c7c9,null))[_0xbce3('0x1f')](function(_0x57e03a){if(_0x57e03a){_0x3adaac['body'][_0xbce3('0x4d')]=_0x57e03a['id'];return db[_0xbce3('0x4c')][_0xbce3('0x41')](_0x3adaac[_0xbce3('0x42')]);}})[_0xbce3('0x1f')](respondWithResult(_0x26c7c9,null))[_0xbce3('0x3c')](handleError(_0x26c7c9,null));};exports[_0xbce3('0x4e')]=function(_0x40d505,_0x139b6c,_0x35286f){var _0x116f6a={};var _0x545301={};var _0x11a4fd;var _0x482353;return db[_0xbce3('0x25')][_0xbce3('0x4f')]({'where':{'id':_0x40d505['params']['id']}})['then'](handleEntityNotFound(_0x139b6c,null))[_0xbce3('0x1f')](function(_0x587320){if(_0x587320){_0x11a4fd=_0x587320;_0x545301[_0xbce3('0x2b')]=_[_0xbce3('0x28')](db[_0xbce3('0x4c')][_0xbce3('0x26')]);_0x545301['query']=_['keys'](_0x40d505['query']);_0x545301['filters']=_[_0xbce3('0x3f')](_0x545301[_0xbce3('0x2b')],_0x545301['query']);_0x116f6a[_0xbce3('0x2c')]=_['intersection'](_0x545301['model'],qs['fields'](_0x40d505[_0xbce3('0x29')]['fields']));_0x116f6a[_0xbce3('0x2c')]=_0x116f6a[_0xbce3('0x2c')][_0xbce3('0x2e')]?_0x116f6a[_0xbce3('0x2c')]:_0x545301[_0xbce3('0x2b')];_0x116f6a[_0xbce3('0x30')]=qs[_0xbce3('0x31')](_0x40d505[_0xbce3('0x29')][_0xbce3('0x31')]);_0x116f6a[_0xbce3('0x32')]=qs[_0xbce3('0x2a')](_[_0xbce3('0x33')](_0x40d505[_0xbce3('0x29')],_0x545301[_0xbce3('0x2a')]));if(_0x40d505[_0xbce3('0x29')][_0xbce3('0x37')]){_0x116f6a[_0xbce3('0x32')]=_['merge'](_0x116f6a[_0xbce3('0x32')],{'$or':_[_0xbce3('0x50')](_0x116f6a[_0xbce3('0x2c')],function(_0x5d3ba5){var _0x52b5cc={};_0x52b5cc[_0x5d3ba5]={'$like':'%'+_0x40d505[_0xbce3('0x29')][_0xbce3('0x37')]+'%'};return _0x52b5cc;})});}_0x116f6a=_[_0xbce3('0x34')]({},_0x116f6a,_0x40d505[_0xbce3('0x38')]);return _0x11a4fd[_0xbce3('0x4e')](_0x116f6a);}})[_0xbce3('0x1f')](function(_0x53a0fb){if(_0x53a0fb){_0x482353=_0x53a0fb[_0xbce3('0x2e')];if(!_0x40d505[_0xbce3('0x29')]['hasOwnProperty'](_0xbce3('0x2f'))){_0x116f6a[_0xbce3('0x19')]=qs[_0xbce3('0x19')](_0x40d505[_0xbce3('0x29')][_0xbce3('0x19')]);_0x116f6a['offset']=qs[_0xbce3('0x17')](_0x40d505[_0xbce3('0x29')]['offset']);}return _0x11a4fd[_0xbce3('0x4e')](_0x116f6a);}})['then'](function(_0x208ab2){if(_0x208ab2){return _0x208ab2?{'count':_0x482353,'rows':_0x208ab2}:null;}})['then'](respondWithResult(_0x139b6c,null))[_0xbce3('0x3c')](handleError(_0x139b6c,null));};exports[_0xbce3('0x51')]=function(_0x4556b5,_0x5db0cb,_0x38d52e){var _0x97ac60={};var _0x2c8fd8={};var _0x4bf4cf;var _0x1fb7de;return db[_0xbce3('0x25')][_0xbce3('0x4f')]({'where':{'id':_0x4556b5[_0xbce3('0x3e')]['id']}})[_0xbce3('0x1f')](handleEntityNotFound(_0x5db0cb,null))[_0xbce3('0x1f')](function(_0x2f9c08){if(_0x2f9c08){_0x4bf4cf=_0x2f9c08;_0x2c8fd8[_0xbce3('0x2b')]=_[_0xbce3('0x28')](db[_0xbce3('0x4c')][_0xbce3('0x26')]);_0x2c8fd8[_0xbce3('0x29')]=_[_0xbce3('0x28')](_0x4556b5[_0xbce3('0x29')]);_0x2c8fd8[_0xbce3('0x2a')]=_[_0xbce3('0x3f')](_0x2c8fd8[_0xbce3('0x2b')],_0x2c8fd8[_0xbce3('0x29')]);_0x97ac60[_0xbce3('0x2c')]=_[_0xbce3('0x3f')](_0x2c8fd8[_0xbce3('0x2b')],qs[_0xbce3('0x2d')](_0x4556b5[_0xbce3('0x29')][_0xbce3('0x2d')]));_0x97ac60[_0xbce3('0x2c')]=_0x97ac60[_0xbce3('0x2c')][_0xbce3('0x2e')]?_0x97ac60[_0xbce3('0x2c')]:_0x2c8fd8[_0xbce3('0x2b')];_0x97ac60[_0xbce3('0x30')]=qs[_0xbce3('0x31')](_0x4556b5['query'][_0xbce3('0x31')]);_0x97ac60[_0xbce3('0x32')]=qs[_0xbce3('0x2a')](_[_0xbce3('0x33')](_0x4556b5[_0xbce3('0x29')],_0x2c8fd8[_0xbce3('0x2a')]));if(_0x4556b5[_0xbce3('0x29')][_0xbce3('0x37')]){_0x97ac60['where']=_['merge'](_0x97ac60[_0xbce3('0x32')],{'$or':_[_0xbce3('0x50')](_0x97ac60[_0xbce3('0x2c')],function(_0x480d24){var _0x5785a8={};_0x5785a8[_0x480d24]={'$like':'%'+_0x4556b5[_0xbce3('0x29')]['filter']+'%'};return _0x5785a8;})});}_0x97ac60=_[_0xbce3('0x34')]({},_0x97ac60,_0x4556b5[_0xbce3('0x38')]);return _0x4bf4cf[_0xbce3('0x51')](_0x97ac60);}})['then'](function(_0x2712ab){if(_0x2712ab){_0x1fb7de=_0x2712ab[_0xbce3('0x2e')];if(!_0x4556b5[_0xbce3('0x29')][_0xbce3('0x52')](_0xbce3('0x2f'))){_0x97ac60[_0xbce3('0x19')]=qs[_0xbce3('0x19')](_0x4556b5[_0xbce3('0x29')]['limit']);_0x97ac60[_0xbce3('0x17')]=qs[_0xbce3('0x17')](_0x4556b5['query'][_0xbce3('0x17')]);}return _0x4bf4cf[_0xbce3('0x51')](_0x97ac60);}})[_0xbce3('0x1f')](function(_0x332c9d){if(_0x332c9d){return _0x332c9d?{'count':_0x1fb7de,'rows':_0x332c9d}:null;}})[_0xbce3('0x1f')](respondWithResult(_0x5db0cb,null))[_0xbce3('0x3c')](handleError(_0x5db0cb,null));};exports[_0xbce3('0x53')]=function(_0x1f0c10,_0x161dcb,_0x5550e0){if(_0x1f0c10['body']['id']){delete _0x1f0c10[_0xbce3('0x42')]['id'];}return db[_0xbce3('0x25')][_0xbce3('0x40')]({'where':{'id':_0x1f0c10['params']['id']}})[_0xbce3('0x1f')](handleEntityNotFound(_0x161dcb,null))[_0xbce3('0x1f')](function(_0xc2973e){if(_0xc2973e){_0x1f0c10[_0xbce3('0x42')]['TriggerId']=_0xc2973e['id'];return db['Action']['create'](_0x1f0c10[_0xbce3('0x42')]);}})['then'](respondWithResult(_0x161dcb,null))[_0xbce3('0x3c')](handleError(_0x161dcb,null));};exports[_0xbce3('0x54')]=function(_0x490883,_0x3775c1,_0x1a2030){var _0x560251={};var _0x583ffd={};var _0x131b82;var _0x3eb68c;return db['Trigger'][_0xbce3('0x4f')]({'where':{'id':_0x490883[_0xbce3('0x3e')]['id']}})[_0xbce3('0x1f')](handleEntityNotFound(_0x3775c1,null))['then'](function(_0x5d62e5){if(_0x5d62e5){_0x131b82=_0x5d62e5;_0x583ffd['model']=_[_0xbce3('0x28')](db['Action'][_0xbce3('0x26')]);_0x583ffd[_0xbce3('0x29')]=_[_0xbce3('0x28')](_0x490883[_0xbce3('0x29')]);_0x583ffd['filters']=_[_0xbce3('0x3f')](_0x583ffd[_0xbce3('0x2b')],_0x583ffd['query']);_0x560251['attributes']=_['intersection'](_0x583ffd[_0xbce3('0x2b')],qs[_0xbce3('0x2d')](_0x490883[_0xbce3('0x29')][_0xbce3('0x2d')]));_0x560251['attributes']=_0x560251['attributes'][_0xbce3('0x2e')]?_0x560251[_0xbce3('0x2c')]:_0x583ffd[_0xbce3('0x2b')];_0x560251[_0xbce3('0x30')]=qs['sort'](_0x490883[_0xbce3('0x29')][_0xbce3('0x31')]);_0x560251['where']=qs[_0xbce3('0x2a')](_['pick'](_0x490883['query'],_0x583ffd['filters']));if(_0x490883['query'][_0xbce3('0x37')]){_0x560251[_0xbce3('0x32')]=_[_0xbce3('0x34')](_0x560251[_0xbce3('0x32')],{'$or':_[_0xbce3('0x50')](_0x560251[_0xbce3('0x2c')],function(_0x40480b){var _0x39fbd3={};_0x39fbd3[_0x40480b]={'$like':'%'+_0x490883[_0xbce3('0x29')][_0xbce3('0x37')]+'%'};return _0x39fbd3;})});}_0x560251=_['merge']({},_0x560251,_0x490883[_0xbce3('0x38')]);return _0x131b82[_0xbce3('0x54')](_0x560251);}})[_0xbce3('0x1f')](function(_0x11cff8){if(_0x11cff8){_0x3eb68c=_0x11cff8[_0xbce3('0x2e')];if(!_0x490883[_0xbce3('0x29')][_0xbce3('0x52')]('nolimit')){_0x560251[_0xbce3('0x19')]=qs[_0xbce3('0x19')](_0x490883['query'][_0xbce3('0x19')]);_0x560251[_0xbce3('0x17')]=qs[_0xbce3('0x17')](_0x490883[_0xbce3('0x29')][_0xbce3('0x17')]);}return _0x131b82['getActions'](_0x560251);}})[_0xbce3('0x1f')](function(_0x2b87b9){if(_0x2b87b9){return _0x2b87b9?{'count':_0x3eb68c,'rows':_0x2b87b9}:null;}})[_0xbce3('0x1f')](respondWithResult(_0x3775c1,null))['catch'](handleError(_0x3775c1,null));}; \ No newline at end of file diff --git a/server/api/trigger/trigger.model.js b/server/api/trigger/trigger.model.js index ec1edb4..42a40c4 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 _0xd5b2=['util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','Trigger'];(function(_0xd1d19a,_0x1933f0){var _0x52a79d=function(_0x5199e2){while(--_0x5199e2){_0xd1d19a['push'](_0xd1d19a['shift']());}};_0x52a79d(++_0x1933f0);}(_0xd5b2,0x10e));var _0x2d5b=function(_0x543084,_0x4337f5){_0x543084=_0x543084-0x0;var _0x306a57=_0xd5b2[_0x543084];return _0x306a57;};'use strict';var _=require('lodash');var util=require(_0x2d5b('0x0'));var logger=require(_0x2d5b('0x1'))('api');var moment=require(_0x2d5b('0x2'));var BPromise=require(_0x2d5b('0x3'));var rp=require(_0x2d5b('0x4'));var fs=require('fs');var path=require(_0x2d5b('0x5'));var rimraf=require(_0x2d5b('0x6'));var config=require(_0x2d5b('0x7'));var attributes=require('./trigger.attributes');module['exports']=function(_0x58cff9,_0x2e1867){return _0x58cff9['define'](_0x2d5b('0x8'),attributes,{'tableName':'tools_triggers','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf822=['path','../../config/environment','./trigger.attributes','exports','Trigger','tools_triggers','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x1e48d3,_0x5d8c43){var _0x2852b1=function(_0x11d7b3){while(--_0x11d7b3){_0x1e48d3['push'](_0x1e48d3['shift']());}};_0x2852b1(++_0x5d8c43);}(_0xf822,0x19e));var _0x2f82=function(_0x3f3822,_0x5d0063){_0x3f3822=_0x3f3822-0x0;var _0x15794f=_0xf822[_0x3f3822];return _0x15794f;};'use strict';var _=require(_0x2f82('0x0'));var util=require('util');var logger=require(_0x2f82('0x1'))(_0x2f82('0x2'));var moment=require(_0x2f82('0x3'));var BPromise=require(_0x2f82('0x4'));var rp=require(_0x2f82('0x5'));var fs=require('fs');var path=require(_0x2f82('0x6'));var rimraf=require('rimraf');var config=require(_0x2f82('0x7'));var attributes=require(_0x2f82('0x8'));module[_0x2f82('0x9')]=function(_0x5b73e5,_0x360c8f){return _0x5b73e5['define'](_0x2f82('0xa'),attributes,{'tableName':_0x2f82('0xb'),'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 510b11c..88f0bd0 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 _0x8572=['map','model','stringify','catch','ShowTrigger','Trigger','lodash','moment','bluebird','../../mysqldb','rpc','../../config/environment','client','http','request','then','info','request\x20sent','debug','Trigger,\x20%s,\x20%s,\x20%s','code','Trigger,\x20%s,\x20%s','error','message','result','GetTrigger','options','raw','where','attributes','include'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x8572,0xdf));var _0x2857=function(_0x58afd5,_0x534a48){_0x58afd5=_0x58afd5-0x0;var _0x3e503b=_0x8572[_0x58afd5];return _0x3e503b;};'use strict';var _=require(_0x2857('0x0'));var util=require('util');var moment=require(_0x2857('0x1'));var BPromise=require(_0x2857('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2857('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x2857('0x4'));var config=require(_0x2857('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x2857('0x6')][_0x2857('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x381e8d,_0x273812,_0x124a89){return new BPromise(function(_0x522bb1,_0x1895f8){return client[_0x2857('0x8')](_0x381e8d,_0x124a89)[_0x2857('0x9')](function(_0x1910bf){logger[_0x2857('0xa')]('Trigger,\x20%s,\x20%s',_0x273812,_0x2857('0xb'));logger[_0x2857('0xc')](_0x2857('0xd'),_0x273812,_0x2857('0xb'),JSON['stringify'](_0x1910bf));if(_0x1910bf['error']){if(_0x1910bf['error'][_0x2857('0xe')]===0x1f4){logger['error'](_0x2857('0xf'),_0x273812,_0x1910bf['error']['message']);return _0x1895f8(_0x1910bf[_0x2857('0x10')][_0x2857('0x11')]);}logger['error'](_0x2857('0xf'),_0x273812,_0x1910bf['error']['message']);return _0x522bb1(_0x1910bf['error'][_0x2857('0x11')]);}else{logger['info'](_0x2857('0xf'),_0x273812,_0x2857('0xb'));_0x522bb1(_0x1910bf[_0x2857('0x12')][_0x2857('0x11')]);}})['catch'](function(_0x25ad14){logger[_0x2857('0x10')]('Trigger,\x20%s,\x20%s',_0x273812,_0x25ad14);_0x1895f8(_0x25ad14);});});}exports[_0x2857('0x13')]=function(_0x3be44e){var _0x1637ed=this;return new Promise(function(_0x51b792,_0xa14c55){return db['Trigger']['findAll']({'raw':_0x3be44e[_0x2857('0x14')]?_0x3be44e[_0x2857('0x14')][_0x2857('0x15')]===undefined?!![]:![]:!![],'where':_0x3be44e['options']?_0x3be44e[_0x2857('0x14')][_0x2857('0x16')]||null:null,'attributes':_0x3be44e[_0x2857('0x14')]?_0x3be44e['options'][_0x2857('0x17')]||null:null,'limit':_0x3be44e[_0x2857('0x14')]?_0x3be44e[_0x2857('0x14')]['limit']||null:null,'include':_0x3be44e[_0x2857('0x14')]?_0x3be44e[_0x2857('0x14')][_0x2857('0x18')]?_[_0x2857('0x19')](_0x3be44e[_0x2857('0x14')][_0x2857('0x18')],function(_0x499ce2){return{'model':db[_0x499ce2['model']],'as':_0x499ce2['as'],'attributes':_0x499ce2[_0x2857('0x17')],'include':_0x499ce2['include']?_[_0x2857('0x19')](_0x499ce2[_0x2857('0x18')],function(_0x1a42e4){return{'model':db[_0x1a42e4[_0x2857('0x1a')]],'as':_0x1a42e4['as'],'attributes':_0x1a42e4[_0x2857('0x17')],'include':_0x1a42e4['include']?_[_0x2857('0x19')](_0x1a42e4['include'],function(_0x55ef4f){return{'model':db[_0x55ef4f[_0x2857('0x1a')]],'as':_0x55ef4f['as'],'attributes':_0x55ef4f[_0x2857('0x17')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3f2000){logger[_0x2857('0xa')]('GetTrigger',_0x3be44e);logger['debug'](_0x2857('0x13'),_0x3be44e,JSON[_0x2857('0x1b')](_0x3f2000));_0x51b792(_0x3f2000);})[_0x2857('0x1c')](function(_0x2316ae){logger[_0x2857('0x10')]('GetTrigger',_0x2316ae[_0x2857('0x11')],_0x3be44e);_0xa14c55(_0x1637ed['error'](0x1f4,_0x2316ae[_0x2857('0x11')]));});});};exports[_0x2857('0x1d')]=function(_0x60dbcb){var _0x45fc9e=this;return new Promise(function(_0x21d881,_0x1a3eb1){return db[_0x2857('0x1e')]['find']({'raw':_0x60dbcb['options']?_0x60dbcb['options'][_0x2857('0x15')]===undefined?!![]:![]:!![],'where':_0x60dbcb[_0x2857('0x14')]?_0x60dbcb['options'][_0x2857('0x16')]||null:null,'attributes':_0x60dbcb['options']?_0x60dbcb[_0x2857('0x14')][_0x2857('0x17')]||null:null,'include':_0x60dbcb[_0x2857('0x14')]?_0x60dbcb[_0x2857('0x14')][_0x2857('0x18')]?_[_0x2857('0x19')](_0x60dbcb[_0x2857('0x14')][_0x2857('0x18')],function(_0x393aa7){return{'model':db[_0x393aa7[_0x2857('0x1a')]],'as':_0x393aa7['as'],'attributes':_0x393aa7['attributes'],'include':_0x393aa7[_0x2857('0x18')]?_[_0x2857('0x19')](_0x393aa7[_0x2857('0x18')],function(_0x56354e){return{'model':db[_0x56354e[_0x2857('0x1a')]],'as':_0x56354e['as'],'attributes':_0x56354e[_0x2857('0x17')],'include':_0x56354e[_0x2857('0x18')]?_[_0x2857('0x19')](_0x56354e['include'],function(_0x383718){return{'model':db[_0x383718[_0x2857('0x1a')]],'as':_0x383718['as'],'attributes':_0x383718['attributes']};}):[]};}):[]};}):[]:[]})[_0x2857('0x9')](function(_0x1fcc17){logger['info'](_0x2857('0x1d'),_0x60dbcb);logger[_0x2857('0xc')](_0x2857('0x1d'),_0x60dbcb,JSON['stringify'](_0x1fcc17));_0x21d881(_0x1fcc17);})[_0x2857('0x1c')](function(_0x2a08f2){logger['error'](_0x2857('0x1d'),_0x2a08f2[_0x2857('0x11')],_0x60dbcb);_0x1a3eb1(_0x45fc9e[_0x2857('0x10')](0x1f4,_0x2a08f2[_0x2857('0x11')]));});});}; \ No newline at end of file +var _0x29d5=['util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','Trigger,\x20%s,\x20%s,\x20%s','stringify','error','Trigger,\x20%s,\x20%s','message','result','Trigger','findAll','options','raw','where','attributes','include','map','model','catch','GetTrigger','ShowTrigger','find'];(function(_0x1fb1c1,_0x4ebe69){var _0x1622df=function(_0x52b793){while(--_0x52b793){_0x1fb1c1['push'](_0x1fb1c1['shift']());}};_0x1622df(++_0x4ebe69);}(_0x29d5,0x110));var _0x529d=function(_0xbc914b,_0x4bc7de){_0xbc914b=_0xbc914b-0x0;var _0x59a90b=_0x29d5[_0xbc914b];return _0x59a90b;};'use strict';var _=require('lodash');var util=require(_0x529d('0x0'));var moment=require(_0x529d('0x1'));var BPromise=require('bluebird');var rs=require(_0x529d('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x529d('0x3'))['db'];var utils=require(_0x529d('0x4'));var logger=require(_0x529d('0x5'))('rpc');var config=require(_0x529d('0x6'));var jayson=require(_0x529d('0x7'));var client=jayson[_0x529d('0x8')][_0x529d('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4a2013,_0x29f840,_0x51ec06){return new BPromise(function(_0x287831,_0x11481f){return client[_0x529d('0xa')](_0x4a2013,_0x51ec06)[_0x529d('0xb')](function(_0x4ae77d){logger[_0x529d('0xc')]('Trigger,\x20%s,\x20%s',_0x29f840,_0x529d('0xd'));logger[_0x529d('0xe')](_0x529d('0xf'),_0x29f840,'request\x20sent',JSON[_0x529d('0x10')](_0x4ae77d));if(_0x4ae77d[_0x529d('0x11')]){if(_0x4ae77d[_0x529d('0x11')]['code']===0x1f4){logger[_0x529d('0x11')](_0x529d('0x12'),_0x29f840,_0x4ae77d['error'][_0x529d('0x13')]);return _0x11481f(_0x4ae77d[_0x529d('0x11')][_0x529d('0x13')]);}logger[_0x529d('0x11')]('Trigger,\x20%s,\x20%s',_0x29f840,_0x4ae77d[_0x529d('0x11')]['message']);return _0x287831(_0x4ae77d[_0x529d('0x11')][_0x529d('0x13')]);}else{logger[_0x529d('0xc')]('Trigger,\x20%s,\x20%s',_0x29f840,'request\x20sent');_0x287831(_0x4ae77d[_0x529d('0x14')][_0x529d('0x13')]);}})['catch'](function(_0x4ba276){logger[_0x529d('0x11')](_0x529d('0x12'),_0x29f840,_0x4ba276);_0x11481f(_0x4ba276);});});}exports['GetTrigger']=function(_0x10d696){var _0x50101e=this;return new Promise(function(_0x44a6de,_0x1db859){return db[_0x529d('0x15')][_0x529d('0x16')]({'raw':_0x10d696[_0x529d('0x17')]?_0x10d696['options'][_0x529d('0x18')]===undefined?!![]:![]:!![],'where':_0x10d696[_0x529d('0x17')]?_0x10d696['options'][_0x529d('0x19')]||null:null,'attributes':_0x10d696[_0x529d('0x17')]?_0x10d696[_0x529d('0x17')][_0x529d('0x1a')]||null:null,'limit':_0x10d696[_0x529d('0x17')]?_0x10d696[_0x529d('0x17')]['limit']||null:null,'include':_0x10d696['options']?_0x10d696[_0x529d('0x17')][_0x529d('0x1b')]?_[_0x529d('0x1c')](_0x10d696[_0x529d('0x17')][_0x529d('0x1b')],function(_0xa33e46){return{'model':db[_0xa33e46[_0x529d('0x1d')]],'as':_0xa33e46['as'],'attributes':_0xa33e46[_0x529d('0x1a')],'include':_0xa33e46[_0x529d('0x1b')]?_[_0x529d('0x1c')](_0xa33e46[_0x529d('0x1b')],function(_0x350d70){return{'model':db[_0x350d70['model']],'as':_0x350d70['as'],'attributes':_0x350d70[_0x529d('0x1a')],'include':_0x350d70[_0x529d('0x1b')]?_['map'](_0x350d70[_0x529d('0x1b')],function(_0x34cfff){return{'model':db[_0x34cfff['model']],'as':_0x34cfff['as'],'attributes':_0x34cfff['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x1a6921){logger[_0x529d('0xc')]('GetTrigger',_0x10d696);logger[_0x529d('0xe')]('GetTrigger',_0x10d696,JSON[_0x529d('0x10')](_0x1a6921));_0x44a6de(_0x1a6921);})[_0x529d('0x1e')](function(_0x3c4ad9){logger[_0x529d('0x11')](_0x529d('0x1f'),_0x3c4ad9[_0x529d('0x13')],_0x10d696);_0x1db859(_0x50101e[_0x529d('0x11')](0x1f4,_0x3c4ad9[_0x529d('0x13')]));});});};exports[_0x529d('0x20')]=function(_0x465d4c){var _0x4dad80=this;return new Promise(function(_0x55cbed,_0x2350fa){return db[_0x529d('0x15')][_0x529d('0x21')]({'raw':_0x465d4c[_0x529d('0x17')]?_0x465d4c[_0x529d('0x17')][_0x529d('0x18')]===undefined?!![]:![]:!![],'where':_0x465d4c[_0x529d('0x17')]?_0x465d4c['options']['where']||null:null,'attributes':_0x465d4c[_0x529d('0x17')]?_0x465d4c['options'][_0x529d('0x1a')]||null:null,'include':_0x465d4c[_0x529d('0x17')]?_0x465d4c[_0x529d('0x17')][_0x529d('0x1b')]?_[_0x529d('0x1c')](_0x465d4c[_0x529d('0x17')][_0x529d('0x1b')],function(_0x26c316){return{'model':db[_0x26c316[_0x529d('0x1d')]],'as':_0x26c316['as'],'attributes':_0x26c316[_0x529d('0x1a')],'include':_0x26c316[_0x529d('0x1b')]?_['map'](_0x26c316[_0x529d('0x1b')],function(_0x33ca0d){return{'model':db[_0x33ca0d['model']],'as':_0x33ca0d['as'],'attributes':_0x33ca0d[_0x529d('0x1a')],'include':_0x33ca0d[_0x529d('0x1b')]?_[_0x529d('0x1c')](_0x33ca0d[_0x529d('0x1b')],function(_0x44e024){return{'model':db[_0x44e024[_0x529d('0x1d')]],'as':_0x44e024['as'],'attributes':_0x44e024[_0x529d('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x529d('0xb')](function(_0x52d46f){logger[_0x529d('0xc')](_0x529d('0x20'),_0x465d4c);logger['debug']('ShowTrigger',_0x465d4c,JSON[_0x529d('0x10')](_0x52d46f));_0x55cbed(_0x52d46f);})[_0x529d('0x1e')](function(_0x51bcb2){logger[_0x529d('0x11')](_0x529d('0x20'),_0x51bcb2['message'],_0x465d4c);_0x2350fa(_0x4dad80[_0x529d('0x11')](0x1f4,_0x51bcb2[_0x529d('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/trunk/index.js b/server/api/trunk/index.js index b885dfe..4688e60 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 _0x155e=['update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./trunk.controller','get','isAuthenticated','index','/:id','show','post','/:id/clone','clone','create'];(function(_0x4620e6,_0x150200){var _0x1fb56f=function(_0x5cc33f){while(--_0x5cc33f){_0x4620e6['push'](_0x4620e6['shift']());}};_0x1fb56f(++_0x150200);}(_0x155e,0x10c));var _0xe155=function(_0x18777b,_0x596582){_0x18777b=_0x18777b-0x0;var _0xaa5585=_0x155e[_0x18777b];return _0xaa5585;};'use strict';var multer=require('multer');var util=require(_0xe155('0x0'));var path=require(_0xe155('0x1'));var timeout=require(_0xe155('0x2'));var express=require(_0xe155('0x3'));var router=express[_0xe155('0x4')]();var fs_extra=require(_0xe155('0x5'));var auth=require(_0xe155('0x6'));var interaction=require(_0xe155('0x7'));var config=require('../../config/environment');var controller=require(_0xe155('0x8'));router[_0xe155('0x9')]('/',auth[_0xe155('0xa')](),controller[_0xe155('0xb')]);router['get'](_0xe155('0xc'),auth[_0xe155('0xa')](),controller[_0xe155('0xd')]);router[_0xe155('0xe')](_0xe155('0xf'),auth[_0xe155('0xa')](),controller[_0xe155('0x10')]);router['post']('/',auth[_0xe155('0xa')](),controller[_0xe155('0x11')]);router['put'](_0xe155('0xc'),auth[_0xe155('0xa')](),controller[_0xe155('0x12')]);router[_0xe155('0x13')](_0xe155('0xc'),auth[_0xe155('0xa')](),controller[_0xe155('0x14')]);module[_0xe155('0x15')]=router; \ No newline at end of file +var _0x66fd=['delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','get','isAuthenticated','index','show','post','/:id/clone','clone','create','/:id'];(function(_0x4f939a,_0x5232ee){var _0xb1d4eb=function(_0x19821b){while(--_0x19821b){_0x4f939a['push'](_0x4f939a['shift']());}};_0xb1d4eb(++_0x5232ee);}(_0x66fd,0x7b));var _0xd66f=function(_0x565a87,_0x2a5c73){_0x565a87=_0x565a87-0x0;var _0x4b08c0=_0x66fd[_0x565a87];return _0x4b08c0;};'use strict';var multer=require(_0xd66f('0x0'));var util=require(_0xd66f('0x1'));var path=require(_0xd66f('0x2'));var timeout=require(_0xd66f('0x3'));var express=require(_0xd66f('0x4'));var router=express[_0xd66f('0x5')]();var fs_extra=require(_0xd66f('0x6'));var auth=require(_0xd66f('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./trunk.controller');router[_0xd66f('0x8')]('/',auth[_0xd66f('0x9')](),controller[_0xd66f('0xa')]);router[_0xd66f('0x8')]('/:id',auth['isAuthenticated'](),controller[_0xd66f('0xb')]);router[_0xd66f('0xc')](_0xd66f('0xd'),auth['isAuthenticated'](),controller[_0xd66f('0xe')]);router[_0xd66f('0xc')]('/',auth['isAuthenticated'](),controller[_0xd66f('0xf')]);router['put'](_0xd66f('0x10'),auth[_0xd66f('0x9')](),controller['update']);router[_0xd66f('0x11')]('/:id',auth[_0xd66f('0x9')](),controller[_0xd66f('0x12')]);module[_0xd66f('0x13')]=router; \ No newline at end of file diff --git a/server/api/trunk/trunk.attributes.js b/server/api/trunk/trunk.attributes.js index 64c248b..39cdeb6 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 _0x0379=['fingerprint','certificate','active','passive','actpass','dynamic','update,nonat','BOOLEAN','exports','STRING','name','ENUM','user','peer','friend','from-voip-provider','ALLOWED_NOT_SCREENED','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB','setDataValue','join','getDataValue','transport','split','rfc2833','info','shortinfo','inband','auto','yes','nonat','update','outgoing','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','allow','ulaw;alaw;gsm','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','INTEGER','\x22\x22\x20<>','originate','uas','pai'];(function(_0x1895cc,_0x1cd507){var _0xe25587=function(_0x40655a){while(--_0x40655a){_0x1895cc['push'](_0x1895cc['shift']());}};_0xe25587(++_0x1cd507);}(_0x0379,0x198));var _0x9037=function(_0x2551dd,_0x5ba066){_0x2551dd=_0x2551dd-0x0;var _0x905704=_0x0379[_0x2551dd];return _0x905704;};'use strict';var Sequelize=require('sequelize');module[_0x9037('0x0')]={'name':{'type':Sequelize[_0x9037('0x1')],'allowNull':![],'unique':_0x9037('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x9037('0x3')]('friend',_0x9037('0x4'),_0x9037('0x5')),'allowNull':![],'defaultValue':_0x9037('0x6')},'context':{'type':Sequelize[_0x9037('0x1')],'allowNull':![],'defaultValue':_0x9037('0x7')},'callingpres':{'type':Sequelize['ENUM'](_0x9037('0x8'),'ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN',_0x9037('0x9'),_0x9037('0xa'),_0x9037('0xb'),_0x9037('0xc'),_0x9037('0xd'))},'deny':{'type':Sequelize['STRING']},'permit':{'type':Sequelize[_0x9037('0x1')]},'secret':{'type':Sequelize[_0x9037('0x1')]},'md5secret':{'type':Sequelize['STRING']},'remotesecret':{'type':Sequelize[_0x9037('0x1')]},'transport':{'type':Sequelize[_0x9037('0x1')],'defaultValue':'udp','set':function(_0x4f223c){this[_0x9037('0xe')]('transport',_0x4f223c?_0x4f223c[_0x9037('0xf')](','):null);},'get':function(){return this[_0x9037('0x10')]('transport')?this[_0x9037('0x10')](_0x9037('0x11'))[_0x9037('0x12')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]'},'dtmfmode':{'type':Sequelize[_0x9037('0x3')](_0x9037('0x13'),_0x9037('0x14'),_0x9037('0x15'),_0x9037('0x16'),_0x9037('0x17')),'defaultValue':_0x9037('0x13')},'directmedia':{'type':Sequelize[_0x9037('0x3')](_0x9037('0x18'),'no',_0x9037('0x19'),_0x9037('0x1a'),_0x9037('0x1b')),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x9037('0x3')](_0x9037('0x18'),'no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x9037('0x1')]},'directmediadeny':{'type':Sequelize[_0x9037('0x1')]},'nat':{'type':Sequelize[_0x9037('0x1')],'defaultValue':'force_rport,comedia','set':function(_0x4714b6){this[_0x9037('0xe')]('nat',_0x4714b6?_0x4714b6[_0x9037('0xf')](','):null);},'get':function(){return this[_0x9037('0x10')](_0x9037('0x1c'))?this[_0x9037('0x10')](_0x9037('0x1c'))[_0x9037('0x12')](','):null;},'comment':_0x9037('0x1d')},'callgroup':{'type':Sequelize[_0x9037('0x1')]},'namedcallgroup':{'type':Sequelize[_0x9037('0x1')]},'pickupgroup':{'type':Sequelize[_0x9037('0x1')]},'namedpickupgroup':{'type':Sequelize[_0x9037('0x1')]},'language':{'type':Sequelize[_0x9037('0x1')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x9037('0x1')],'allowNull':!![]},'disallow':{'type':Sequelize[_0x9037('0x1')],'defaultValue':_0x9037('0x1e')},'allow':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'ulaw;alaw;gsm','set':function(_0x33d91c){this[_0x9037('0xe')](_0x9037('0x1f'),_0x33d91c?_0x33d91c[_0x9037('0xf')](';'):_0x9037('0x20'));},'get':function(){return this[_0x9037('0x10')](_0x9037('0x1f'))?this[_0x9037('0x10')](_0x9037('0x1f'))[_0x9037('0x12')](';'):null;},'comment':_0x9037('0x21')},'autoframing':{'type':Sequelize[_0x9037('0x3')]('yes','no')},'insecure':{'type':Sequelize[_0x9037('0x1')],'defaultValue':'port,invite','set':function(_0x150e65){this[_0x9037('0xe')](_0x9037('0x22'),_0x150e65?_0x150e65[_0x9037('0xf')](','):null);},'get':function(){return this[_0x9037('0x10')](_0x9037('0x22'))?this['getDataValue']('insecure')[_0x9037('0x12')](','):null;},'comment':_0x9037('0x23')},'trustrpid':{'type':Sequelize[_0x9037('0x3')](_0x9037('0x18'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x9037('0x3')](_0x9037('0x18'),'no'),'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x9037('0x3')]('yes','no',_0x9037('0x24'))},'promiscredir':{'type':Sequelize[_0x9037('0x3')](_0x9037('0x18'),'no')},'useclientcode':{'type':Sequelize[_0x9037('0x3')](_0x9037('0x18'),'no')},'accountcode':{'type':Sequelize[_0x9037('0x25')](0xb)},'setvar':{'type':Sequelize[_0x9037('0x1')]},'callerid':{'type':Sequelize['STRING'],'defaultValue':_0x9037('0x26')},'amaflags':{'type':Sequelize[_0x9037('0x1')]},'callcounter':{'type':Sequelize[_0x9037('0x3')](_0x9037('0x18'),'no'),'defaultValue':'yes'},'busylevel':{'type':Sequelize['INTEGER'](0xb)},'allowoverlap':{'type':Sequelize[_0x9037('0x3')](_0x9037('0x18'),'no')},'allowsubscribe':{'type':Sequelize[_0x9037('0x3')](_0x9037('0x18'),'no')},'allowtransfer':{'type':Sequelize[_0x9037('0x3')](_0x9037('0x18'),'no')},'ignoresdpversion':{'type':Sequelize[_0x9037('0x3')](_0x9037('0x18'),'no')},'subscribecontext':{'type':Sequelize['STRING']},'template':{'type':Sequelize[_0x9037('0x1')]},'videosupport':{'type':Sequelize['ENUM'](_0x9037('0x18'),'no','always'),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize['INTEGER'](0xb)},'rfc2833compensate':{'type':Sequelize[_0x9037('0x3')](_0x9037('0x18'),'no')},'mailbox':{'type':Sequelize['STRING']},'session_timers':{'type':Sequelize[_0x9037('0x3')]('accept','refuse',_0x9037('0x27'))},'session_expires':{'type':Sequelize['INTEGER'](0xb)},'session_minse':{'type':Sequelize[_0x9037('0x25')](0xb)},'session_refresher':{'type':Sequelize[_0x9037('0x3')]('uac','uas'),'defaultValue':_0x9037('0x28')},'t38pt_usertpsource':{'type':Sequelize['STRING']},'regexten':{'type':Sequelize[_0x9037('0x1')]},'fromdomain':{'type':Sequelize[_0x9037('0x1')]},'fromuser':{'type':Sequelize['STRING']},'port':{'type':Sequelize[_0x9037('0x25')](0x5)},'qualify':{'type':Sequelize['ENUM'](_0x9037('0x18'),'no'),'defaultValue':'yes'},'keepalive':{'type':Sequelize[_0x9037('0x25')](0xb)},'defaultip':{'type':Sequelize[_0x9037('0x1')]},'defaultuser':{'type':Sequelize[_0x9037('0x1')]},'rtptimeout':{'type':Sequelize[_0x9037('0x25')](0xb)},'rtpholdtimeout':{'type':Sequelize['INTEGER'](0xb)},'rtpkeepalive':{'type':Sequelize[_0x9037('0x25')](0xb)},'sendrpid':{'type':Sequelize[_0x9037('0x3')](_0x9037('0x18'),'no',_0x9037('0x29')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x9037('0x1')]},'callbackextension':{'type':Sequelize[_0x9037('0x1')]},'timert1':{'type':Sequelize[_0x9037('0x25')](0xb)},'timerb':{'type':Sequelize[_0x9037('0x25')](0xb)},'qualifyfreq':{'type':Sequelize[_0x9037('0x25')](0xb)},'contactpermit':{'type':Sequelize[_0x9037('0x1')]},'contactdeny':{'type':Sequelize[_0x9037('0x1')]},'contactacl':{'type':Sequelize[_0x9037('0x1')]},'unsolicited_mailbox':{'type':Sequelize[_0x9037('0x1')]},'use_q850_reason':{'type':Sequelize[_0x9037('0x1')]},'maxforwards':{'type':Sequelize['INTEGER'](0xb)},'encryption':{'type':Sequelize[_0x9037('0x3')](_0x9037('0x18'),'no'),'defaultValue':'no'},'avpf':{'type':Sequelize[_0x9037('0x3')]('yes','no')},'force_avp':{'type':Sequelize[_0x9037('0x3')](_0x9037('0x18'),'no')},'icesupport':{'type':Sequelize['ENUM'](_0x9037('0x18'),'no')},'dtlsenable':{'type':Sequelize['ENUM'](_0x9037('0x18'),'no')},'dtlsverify':{'type':Sequelize[_0x9037('0x3')](_0x9037('0x18'),'no',_0x9037('0x2a'),_0x9037('0x2b'))},'dtlsrekey':{'type':Sequelize[_0x9037('0x25')](0xb)},'dtlscertfile':{'type':Sequelize[_0x9037('0x1')]},'dtlsprivatekey':{'type':Sequelize[_0x9037('0x1')]},'dtlscipher':{'type':Sequelize['STRING']},'dtlscafile':{'type':Sequelize[_0x9037('0x1')]},'dtlscapath':{'type':Sequelize[_0x9037('0x1')]},'dtlssetup':{'type':Sequelize['ENUM'](_0x9037('0x2c'),_0x9037('0x2d'),_0x9037('0x2e')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize['STRING']},'usereqphone':{'type':Sequelize[_0x9037('0x3')]('yes','no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x9037('0x1')]},'recordofffeature':{'type':Sequelize['STRING']},'call_limit':{'type':Sequelize[_0x9037('0x25')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize['ENUM'](_0x9037('0x18'),'no')},'subscribemwi':{'type':Sequelize['ENUM'](_0x9037('0x18'),'no')},'vmexten':{'type':Sequelize[_0x9037('0x1')]},'mohinterpret':{'type':Sequelize[_0x9037('0x1')]},'mohsuggest':{'type':Sequelize[_0x9037('0x1')]},'parkinglot':{'type':Sequelize[_0x9037('0x1')]},'description':{'type':Sequelize[_0x9037('0x1')]},'host':{'type':Sequelize[_0x9037('0x1')],'defaultValue':_0x9037('0x2f')},'canreinvite':{'type':Sequelize['ENUM']('yes','no',_0x9037('0x19'),_0x9037('0x1a'),_0x9037('0x30')),'defaultValue':'no'},'registry':{'type':Sequelize[_0x9037('0x1')]},'otherFields':{'type':Sequelize['STRING']},'active':{'type':Sequelize[_0x9037('0x31')],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize['STRING'],'defaultValue':'no'}}; \ No newline at end of file +var _0x3318=['friend','user','from-voip-provider','ENUM','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB','setDataValue','transport','join','getDataValue','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','inband','yes','nonat','update','outgoing','force_rport,comedia','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','allow','ulaw;alaw;gsm','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','INTEGER','always','accept','refuse','originate','uac','uas','pai','certificate','passive','actpass','dynamic','update,nonat','BOOLEAN','sequelize','STRING','name'];(function(_0x30763e,_0x37232f){var _0x5df299=function(_0x7fa901){while(--_0x7fa901){_0x30763e['push'](_0x30763e['shift']());}};_0x5df299(++_0x37232f);}(_0x3318,0x96));var _0x8331=function(_0x1741ba,_0x33116f){_0x1741ba=_0x1741ba-0x0;var _0x2a3110=_0x3318[_0x1741ba];return _0x2a3110;};'use strict';var Sequelize=require(_0x8331('0x0'));module['exports']={'name':{'type':Sequelize[_0x8331('0x1')],'allowNull':![],'unique':_0x8331('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize['ENUM'](_0x8331('0x3'),_0x8331('0x4'),'peer'),'allowNull':![],'defaultValue':_0x8331('0x3')},'context':{'type':Sequelize[_0x8331('0x1')],'allowNull':![],'defaultValue':_0x8331('0x5')},'callingpres':{'type':Sequelize[_0x8331('0x6')](_0x8331('0x7'),_0x8331('0x8'),_0x8331('0x9'),'ALLOWED',_0x8331('0xa'),_0x8331('0xb'),_0x8331('0xc'),_0x8331('0xd'))},'deny':{'type':Sequelize[_0x8331('0x1')]},'permit':{'type':Sequelize['STRING']},'secret':{'type':Sequelize[_0x8331('0x1')]},'md5secret':{'type':Sequelize[_0x8331('0x1')]},'remotesecret':{'type':Sequelize[_0x8331('0x1')]},'transport':{'type':Sequelize[_0x8331('0x1')],'defaultValue':'udp','set':function(_0x3ae972){this[_0x8331('0xe')](_0x8331('0xf'),_0x3ae972?_0x3ae972[_0x8331('0x10')](','):null);},'get':function(){return this['getDataValue'](_0x8331('0xf'))?this[_0x8331('0x11')]('transport')[_0x8331('0x12')](','):null;},'comment':_0x8331('0x13')},'dtmfmode':{'type':Sequelize[_0x8331('0x6')](_0x8331('0x14'),_0x8331('0x15'),'shortinfo',_0x8331('0x16'),'auto'),'defaultValue':'rfc2833'},'directmedia':{'type':Sequelize[_0x8331('0x6')](_0x8331('0x17'),'no',_0x8331('0x18'),_0x8331('0x19'),_0x8331('0x1a')),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x8331('0x6')]('yes','no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x8331('0x1')]},'directmediadeny':{'type':Sequelize[_0x8331('0x1')]},'nat':{'type':Sequelize[_0x8331('0x1')],'defaultValue':_0x8331('0x1b'),'set':function(_0xba0d4d){this[_0x8331('0xe')](_0x8331('0x1c'),_0xba0d4d?_0xba0d4d[_0x8331('0x10')](','):null);},'get':function(){return this['getDataValue']('nat')?this['getDataValue'](_0x8331('0x1c'))[_0x8331('0x12')](','):null;},'comment':_0x8331('0x1d')},'callgroup':{'type':Sequelize[_0x8331('0x1')]},'namedcallgroup':{'type':Sequelize[_0x8331('0x1')]},'pickupgroup':{'type':Sequelize['STRING']},'namedpickupgroup':{'type':Sequelize[_0x8331('0x1')]},'language':{'type':Sequelize['STRING'],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x8331('0x1')],'allowNull':!![]},'disallow':{'type':Sequelize[_0x8331('0x1')],'defaultValue':_0x8331('0x1e')},'allow':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'ulaw;alaw;gsm','set':function(_0x4e2f52){this['setDataValue'](_0x8331('0x1f'),_0x4e2f52?_0x4e2f52[_0x8331('0x10')](';'):_0x8331('0x20'));},'get':function(){return this[_0x8331('0x11')]('allow')?this[_0x8331('0x11')](_0x8331('0x1f'))[_0x8331('0x12')](';'):null;},'comment':_0x8331('0x21')},'autoframing':{'type':Sequelize['ENUM']('yes','no')},'insecure':{'type':Sequelize[_0x8331('0x1')],'defaultValue':'port,invite','set':function(_0x26312a){this[_0x8331('0xe')](_0x8331('0x22'),_0x26312a?_0x26312a['join'](','):null);},'get':function(){return this['getDataValue']('insecure')?this[_0x8331('0x11')](_0x8331('0x22'))[_0x8331('0x12')](','):null;},'comment':_0x8331('0x23')},'trustrpid':{'type':Sequelize['ENUM'](_0x8331('0x17'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x8331('0x6')]('yes','no'),'defaultValue':'no'},'progressinband':{'type':Sequelize['ENUM'](_0x8331('0x17'),'no',_0x8331('0x24'))},'promiscredir':{'type':Sequelize[_0x8331('0x6')](_0x8331('0x17'),'no')},'useclientcode':{'type':Sequelize[_0x8331('0x6')](_0x8331('0x17'),'no')},'accountcode':{'type':Sequelize['INTEGER'](0xb)},'setvar':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize['STRING'],'defaultValue':'\x22\x22\x20<>'},'amaflags':{'type':Sequelize[_0x8331('0x1')]},'callcounter':{'type':Sequelize[_0x8331('0x6')]('yes','no'),'defaultValue':_0x8331('0x17')},'busylevel':{'type':Sequelize[_0x8331('0x25')](0xb)},'allowoverlap':{'type':Sequelize[_0x8331('0x6')]('yes','no')},'allowsubscribe':{'type':Sequelize[_0x8331('0x6')](_0x8331('0x17'),'no')},'allowtransfer':{'type':Sequelize[_0x8331('0x6')](_0x8331('0x17'),'no')},'ignoresdpversion':{'type':Sequelize[_0x8331('0x6')](_0x8331('0x17'),'no')},'subscribecontext':{'type':Sequelize[_0x8331('0x1')]},'template':{'type':Sequelize[_0x8331('0x1')]},'videosupport':{'type':Sequelize[_0x8331('0x6')](_0x8331('0x17'),'no',_0x8331('0x26')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x8331('0x25')](0xb)},'rfc2833compensate':{'type':Sequelize['ENUM'](_0x8331('0x17'),'no')},'mailbox':{'type':Sequelize[_0x8331('0x1')]},'session_timers':{'type':Sequelize[_0x8331('0x6')](_0x8331('0x27'),_0x8331('0x28'),_0x8331('0x29'))},'session_expires':{'type':Sequelize['INTEGER'](0xb)},'session_minse':{'type':Sequelize[_0x8331('0x25')](0xb)},'session_refresher':{'type':Sequelize[_0x8331('0x6')](_0x8331('0x2a'),_0x8331('0x2b')),'defaultValue':'uas'},'t38pt_usertpsource':{'type':Sequelize[_0x8331('0x1')]},'regexten':{'type':Sequelize['STRING']},'fromdomain':{'type':Sequelize[_0x8331('0x1')]},'fromuser':{'type':Sequelize[_0x8331('0x1')]},'port':{'type':Sequelize[_0x8331('0x25')](0x5)},'qualify':{'type':Sequelize[_0x8331('0x6')]('yes','no'),'defaultValue':_0x8331('0x17')},'keepalive':{'type':Sequelize[_0x8331('0x25')](0xb)},'defaultip':{'type':Sequelize['STRING']},'defaultuser':{'type':Sequelize[_0x8331('0x1')]},'rtptimeout':{'type':Sequelize[_0x8331('0x25')](0xb)},'rtpholdtimeout':{'type':Sequelize[_0x8331('0x25')](0xb)},'rtpkeepalive':{'type':Sequelize[_0x8331('0x25')](0xb)},'sendrpid':{'type':Sequelize[_0x8331('0x6')](_0x8331('0x17'),'no',_0x8331('0x2c')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x8331('0x1')]},'callbackextension':{'type':Sequelize['STRING']},'timert1':{'type':Sequelize['INTEGER'](0xb)},'timerb':{'type':Sequelize['INTEGER'](0xb)},'qualifyfreq':{'type':Sequelize['INTEGER'](0xb)},'contactpermit':{'type':Sequelize[_0x8331('0x1')]},'contactdeny':{'type':Sequelize['STRING']},'contactacl':{'type':Sequelize[_0x8331('0x1')]},'unsolicited_mailbox':{'type':Sequelize[_0x8331('0x1')]},'use_q850_reason':{'type':Sequelize[_0x8331('0x1')]},'maxforwards':{'type':Sequelize[_0x8331('0x25')](0xb)},'encryption':{'type':Sequelize[_0x8331('0x6')](_0x8331('0x17'),'no'),'defaultValue':'no'},'avpf':{'type':Sequelize[_0x8331('0x6')](_0x8331('0x17'),'no')},'force_avp':{'type':Sequelize['ENUM'](_0x8331('0x17'),'no')},'icesupport':{'type':Sequelize['ENUM'](_0x8331('0x17'),'no')},'dtlsenable':{'type':Sequelize[_0x8331('0x6')](_0x8331('0x17'),'no')},'dtlsverify':{'type':Sequelize[_0x8331('0x6')]('yes','no','fingerprint',_0x8331('0x2d'))},'dtlsrekey':{'type':Sequelize[_0x8331('0x25')](0xb)},'dtlscertfile':{'type':Sequelize['STRING']},'dtlsprivatekey':{'type':Sequelize[_0x8331('0x1')]},'dtlscipher':{'type':Sequelize[_0x8331('0x1')]},'dtlscafile':{'type':Sequelize[_0x8331('0x1')]},'dtlscapath':{'type':Sequelize[_0x8331('0x1')]},'dtlssetup':{'type':Sequelize[_0x8331('0x6')]('active',_0x8331('0x2e'),_0x8331('0x2f')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x8331('0x1')]},'usereqphone':{'type':Sequelize[_0x8331('0x6')](_0x8331('0x17'),'no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x8331('0x1')]},'recordofffeature':{'type':Sequelize[_0x8331('0x1')]},'call_limit':{'type':Sequelize[_0x8331('0x25')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0x8331('0x6')](_0x8331('0x17'),'no')},'subscribemwi':{'type':Sequelize[_0x8331('0x6')](_0x8331('0x17'),'no')},'vmexten':{'type':Sequelize[_0x8331('0x1')]},'mohinterpret':{'type':Sequelize[_0x8331('0x1')]},'mohsuggest':{'type':Sequelize[_0x8331('0x1')]},'parkinglot':{'type':Sequelize[_0x8331('0x1')]},'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize['STRING'],'defaultValue':_0x8331('0x30')},'canreinvite':{'type':Sequelize['ENUM'](_0x8331('0x17'),'no',_0x8331('0x18'),_0x8331('0x19'),_0x8331('0x31')),'defaultValue':'no'},'registry':{'type':Sequelize[_0x8331('0x1')]},'otherFields':{'type':Sequelize[_0x8331('0x1')]},'active':{'type':Sequelize[_0x8331('0x32')],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0x8331('0x1')],'defaultValue':'no'}}; \ No newline at end of file diff --git a/server/api/trunk/trunk.controller.js b/server/api/trunk/trunk.controller.js index 9cae62f..30a0e1f 100644 --- a/server/api/trunk/trunk.controller.js +++ b/server/api/trunk/trunk.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['clone','includeAll','merge','get','omit','createdAt','updatedAt','body','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','findAll','readFileSync','join','root','server/files/templates/trunk.ejs','utf8','server/files/templates/registry.ejs','render','writeFileSync','/etc/asterisk/sip_xcally_trunks.conf','registry','/etc/asterisk/sip_xcally_registers.conf','Reload','chan_sip.so','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','jayson/promise','client','http','request','then','info','Trunk,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','apply','update','destroy','Trunks','stack','name','send','map','Trunk','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','type','filter','options','include','rows','show','params','find'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x9957,0x93));var _0x7995=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x9957[_0x2dafbe];return _0x58a45a;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];var jayson=require(_0x7995('0x1b'));var client=jayson[_0x7995('0x1c')][_0x7995('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x23999f,_0x2bbe7a,_0x4cc004,_0x58f5ad){return new BPromise(function(_0x2b4e94,_0x2233dd){var _0x24b5bb=_0x58f5ad||client;return _0x24b5bb[_0x7995('0x1e')](_0x23999f,_0x4cc004)[_0x7995('0x1f')](function(_0x1a5310){logger[_0x7995('0x20')](_0x7995('0x21'),_0x2bbe7a,'request\x20sent');logger[_0x7995('0x22')]('Trunk,\x20%s,\x20%s,\x20%s',_0x2bbe7a,_0x7995('0x23'),JSON[_0x7995('0x24')](_0x1a5310));if(_0x1a5310[_0x7995('0x25')]){if(_0x1a5310[_0x7995('0x25')][_0x7995('0x26')]===0x1f4){logger[_0x7995('0x25')]('Trunk,\x20%s,\x20%s',_0x2bbe7a,_0x1a5310['error'][_0x7995('0x27')]);return _0x2233dd(_0x1a5310['error']['message']);}logger[_0x7995('0x25')](_0x7995('0x21'),_0x2bbe7a,_0x1a5310['error'][_0x7995('0x27')]);return _0x2b4e94(_0x1a5310['error']['message']);}else{logger[_0x7995('0x20')](_0x7995('0x21'),_0x2bbe7a,_0x7995('0x23'));_0x2b4e94(_0x1a5310[_0x7995('0x28')][_0x7995('0x27')]);}})[_0x7995('0x29')](function(_0x5d40ae){logger[_0x7995('0x25')](_0x7995('0x21'),_0x2bbe7a,_0x5d40ae);_0x2233dd(_0x5d40ae);});});}function respondWithStatusCode(_0x204507,_0x285437){_0x285437=_0x285437||0xcc;return function(_0x563799){if(_0x563799){return _0x204507[_0x7995('0x2a')](_0x285437);}return _0x204507[_0x7995('0x2b')](_0x285437)[_0x7995('0x2c')]();};}function respondWithResult(_0x59405a,_0x39df42){_0x39df42=_0x39df42||0xc8;return function(_0x34e70c){if(_0x34e70c){return _0x59405a[_0x7995('0x2b')](_0x39df42)[_0x7995('0x2d')](_0x34e70c);}};}function respondWithFilteredResult(_0x3a3fcf,_0x2a307e){return function(_0x56691a){if(_0x56691a){var _0x47625f=typeof _0x2a307e['offset']===_0x7995('0x2e')&&typeof _0x2a307e[_0x7995('0x2f')]===_0x7995('0x2e');var _0x132a42=_0x56691a[_0x7995('0x30')];var _0x4b6f99=_0x47625f?0x0:_0x2a307e[_0x7995('0x31')];var _0x514445=_0x47625f?_0x56691a[_0x7995('0x30')]:_0x2a307e[_0x7995('0x31')]+_0x2a307e[_0x7995('0x2f')];var _0x574574;if(_0x514445>=_0x132a42){_0x514445=_0x132a42;_0x574574=0xc8;}else{_0x574574=0xce;}_0x3a3fcf['status'](_0x574574);return _0x3a3fcf['set'](_0x7995('0x32'),_0x4b6f99+'-'+_0x514445+'/'+_0x132a42)[_0x7995('0x2d')](_0x56691a);}return null;};}function patchUpdates(_0x327a81){return function(_0x2b874d){try{jsonpatch[_0x7995('0x33')](_0x2b874d,_0x327a81,!![]);}catch(_0x1ca460){return BPromise['reject'](_0x1ca460);}return _0x2b874d['save']();};}function saveUpdates(_0xfa8f15,_0x5524af){return function(_0x553671){if(_0x553671){return _0x553671[_0x7995('0x34')](_0xfa8f15)[_0x7995('0x1f')](function(_0x1e9fa4){return _0x1e9fa4;});}return null;};}function removeEntity(_0x1f7d27,_0x510841){return function(_0x44309d){if(_0x44309d){return _0x44309d[_0x7995('0x35')]()['then'](function(){var _0x48db25=_0x44309d['get']({'plain':!![]});var _0x45bc5e=_0x7995('0x36');return db['UserProfileResource'][_0x7995('0x35')]({'where':{'type':_0x45bc5e,'resourceId':_0x48db25['id']}})['then'](function(){return _0x44309d;});})[_0x7995('0x1f')](function(){_0x1f7d27[_0x7995('0x2b')](0xcc)[_0x7995('0x2c')]();});}};}function handleEntityNotFound(_0x5014d2,_0x52d76d){return function(_0x36d057){if(!_0x36d057){_0x5014d2['sendStatus'](0x194);}return _0x36d057;};}function handleError(_0x5d2428,_0x3e99cd){_0x3e99cd=_0x3e99cd||0x1f4;return function(_0xe328b1){logger['error'](_0xe328b1[_0x7995('0x37')]);if(_0xe328b1[_0x7995('0x38')]){delete _0xe328b1[_0x7995('0x38')];}_0x5d2428[_0x7995('0x2b')](_0x3e99cd)[_0x7995('0x39')](_0xe328b1);};}exports['index']=function(_0x2d4285,_0x242713){var _0xf612e6={},_0x1d60b8={},_0x4b1541={'count':0x0,'rows':[]};var _0x2be2c0=_[_0x7995('0x3a')](db[_0x7995('0x3b')][_0x7995('0x3c')],function(_0x1f5bee){return{'name':_0x1f5bee[_0x7995('0x3d')],'type':_0x1f5bee['type'][_0x7995('0x3e')]};});_0x1d60b8[_0x7995('0x3f')]=_[_0x7995('0x3a')](_0x2be2c0,_0x7995('0x38'));_0x1d60b8[_0x7995('0x40')]=_[_0x7995('0x41')](_0x2d4285[_0x7995('0x40')]);_0x1d60b8[_0x7995('0x42')]=_[_0x7995('0x43')](_0x1d60b8[_0x7995('0x3f')],_0x1d60b8[_0x7995('0x40')]);_0xf612e6[_0x7995('0x44')]=_[_0x7995('0x43')](_0x1d60b8['model'],qs['fields'](_0x2d4285[_0x7995('0x40')][_0x7995('0x45')]));_0xf612e6['attributes']=_0xf612e6['attributes'][_0x7995('0x46')]?_0xf612e6['attributes']:_0x1d60b8['model'];if(!_0x2d4285[_0x7995('0x40')][_0x7995('0x47')](_0x7995('0x48'))){_0xf612e6['limit']=qs[_0x7995('0x2f')](_0x2d4285['query'][_0x7995('0x2f')]);_0xf612e6['offset']=qs['offset'](_0x2d4285[_0x7995('0x40')][_0x7995('0x31')]);}_0xf612e6[_0x7995('0x49')]=qs[_0x7995('0x4a')](_0x2d4285['query'][_0x7995('0x4a')]);_0xf612e6[_0x7995('0x4b')]=qs[_0x7995('0x42')](_[_0x7995('0x4c')](_0x2d4285['query'],_0x1d60b8['filters']),_0x2be2c0);if(_0x2d4285[_0x7995('0x40')]['filter']){_0xf612e6[_0x7995('0x4b')]=_['merge'](_0xf612e6[_0x7995('0x4b')],{'$or':_['map'](_0x2be2c0,function(_0x1e795e){if(_0x1e795e[_0x7995('0x4d')]!=='VIRTUAL'){var _0x3e9e62={};_0x3e9e62[_0x1e795e[_0x7995('0x38')]]={'$like':'%'+_0x2d4285[_0x7995('0x40')][_0x7995('0x4e')]+'%'};return _0x3e9e62;}})});}_0xf612e6=_['merge']({},_0xf612e6,_0x2d4285[_0x7995('0x4f')]);var _0x3e787d={'where':_0xf612e6[_0x7995('0x4b')]};return db['Trunk'][_0x7995('0x30')](_0x3e787d)[_0x7995('0x1f')](function(_0x511567){_0x4b1541[_0x7995('0x30')]=_0x511567;if(_0x2d4285[_0x7995('0x40')]['includeAll']){_0xf612e6[_0x7995('0x50')]=[{'all':!![]}];}return db[_0x7995('0x3b')]['findAll'](_0xf612e6);})[_0x7995('0x1f')](function(_0x5843ba){_0x4b1541[_0x7995('0x51')]=_0x5843ba;return _0x4b1541;})[_0x7995('0x1f')](respondWithFilteredResult(_0x242713,_0xf612e6))[_0x7995('0x29')](handleError(_0x242713,null));};exports[_0x7995('0x52')]=function(_0xddf537,_0x14b537){var _0x1579b9={'raw':![],'where':{'id':_0xddf537[_0x7995('0x53')]['id']}},_0x4d46bc={};_0x4d46bc[_0x7995('0x3f')]=_[_0x7995('0x41')](db['Trunk'][_0x7995('0x3c')]);_0x4d46bc[_0x7995('0x40')]=_[_0x7995('0x41')](_0xddf537['query']);_0x4d46bc['filters']=_['intersection'](_0x4d46bc[_0x7995('0x3f')],_0x4d46bc[_0x7995('0x40')]);_0x1579b9['attributes']=_[_0x7995('0x43')](_0x4d46bc[_0x7995('0x3f')],qs[_0x7995('0x45')](_0xddf537[_0x7995('0x40')][_0x7995('0x45')]));_0x1579b9['attributes']=_0x1579b9[_0x7995('0x44')]['length']?_0x1579b9[_0x7995('0x44')]:_0x4d46bc[_0x7995('0x3f')];if(_0xddf537[_0x7995('0x40')]['includeAll']){_0x1579b9['include']=[{'all':!![]}];}_0x1579b9=_['merge']({},_0x1579b9,_0xddf537['options']);return db[_0x7995('0x3b')][_0x7995('0x54')](_0x1579b9)[_0x7995('0x1f')](handleEntityNotFound(_0x14b537,null))[_0x7995('0x1f')](respondWithResult(_0x14b537,null))[_0x7995('0x29')](handleError(_0x14b537,null));};exports[_0x7995('0x55')]=function(_0x1f4270,_0xda6ce8){var _0x328671={'where':{'id':_0x1f4270[_0x7995('0x53')]['id']}},_0x17ecd3={};_0x17ecd3[_0x7995('0x3f')]=_[_0x7995('0x41')](db[_0x7995('0x3b')][_0x7995('0x3c')]);_0x328671[_0x7995('0x44')]=_[_0x7995('0x43')](_0x17ecd3[_0x7995('0x3f')],qs[_0x7995('0x45')](_0x1f4270['query'][_0x7995('0x45')]));_0x328671[_0x7995('0x44')]=_0x328671[_0x7995('0x44')][_0x7995('0x46')]?_0x328671['attributes']:_0x17ecd3['model'];if(_0x1f4270[_0x7995('0x40')][_0x7995('0x56')]){_0x328671[_0x7995('0x50')]=[{'all':!![]}];}_0x328671=_[_0x7995('0x57')]({},_0x328671,_0x1f4270['options']);return db[_0x7995('0x3b')][_0x7995('0x54')](_0x328671)[_0x7995('0x1f')](handleEntityNotFound(_0xda6ce8,null))[_0x7995('0x1f')](function(_0x502d43){if(_0x502d43){var _0x5e2d97=_0x502d43[_0x7995('0x58')]({'plain':!![]});_0x5e2d97=qs[_0x7995('0x59')](_0x5e2d97,['id',_0x7995('0x5a'),_0x7995('0x5b')]);_0x1f4270[_0x7995('0x5c')]=_[_0x7995('0x59')](_0x1f4270[_0x7995('0x5c')],['id',_0x7995('0x5a'),_0x7995('0x5b')]);return db['Trunk'][_0x7995('0x5d')](_[_0x7995('0x57')](_0x5e2d97,_0x1f4270[_0x7995('0x5c')]),{'include':_0x1f4270[_0x7995('0x40')]['includeAll']?[{'all':!![]}]:undefined})['then'](function(_0x3053fd){var _0xebb5c8=_0x1f4270['user'][_0x7995('0x58')]({'plain':!![]});if(!_0xebb5c8)throw new Error(_0x7995('0x5e'));if(_0xebb5c8[_0x7995('0x5f')]===_0x7995('0x60')){var _0x32cb04=_0x3053fd['get']({'plain':!![]});var _0x457d09='Trunks';return db[_0x7995('0x61')][_0x7995('0x54')]({'where':{'name':_0x457d09,'userProfileId':_0xebb5c8[_0x7995('0x62')]},'raw':!![]})[_0x7995('0x1f')](function(_0x4388c1){if(_0x4388c1&&_0x4388c1[_0x7995('0x63')]===0x0){return db[_0x7995('0x64')][_0x7995('0x5d')]({'name':_0x32cb04[_0x7995('0x38')],'resourceId':_0x32cb04['id'],'type':_0x4388c1[_0x7995('0x38')],'sectionId':_0x4388c1['id']},{})[_0x7995('0x1f')](function(){return _0x3053fd;});}else{return _0x3053fd;}})[_0x7995('0x29')](function(_0x56eb85){logger[_0x7995('0x25')](_0x7995('0x65'),_0x56eb85);throw _0x56eb85;});}return _0x3053fd;});}})[_0x7995('0x1f')](respondWithResult(_0xda6ce8,0xc9))[_0x7995('0x29')](handleError(_0xda6ce8,null));};exports[_0x7995('0x5d')]=function(_0x54a2e0,_0x4b54f2,_0x268fde){var _0x87e38d;return db[_0x7995('0x3b')][_0x7995('0x5d')](_0x54a2e0['body'],{'raw':!![]})[_0x7995('0x1f')](function(_0x50a12e){_0x87e38d=_0x50a12e;return db['Trunk'][_0x7995('0x66')]({'raw':!![]});})[_0x7995('0x1f')](function(_0x3f0a71){var _0x44bf2b=fs[_0x7995('0x67')](path[_0x7995('0x68')](config[_0x7995('0x69')],_0x7995('0x6a')),_0x7995('0x6b'));var _0x2466df=fs['readFileSync'](path[_0x7995('0x68')](config[_0x7995('0x69')],_0x7995('0x6c')),'utf8');var _0x1fe1cb=ejs[_0x7995('0x6d')](_0x44bf2b,{'trunks':_0x3f0a71||[]});fs[_0x7995('0x6e')](_0x7995('0x6f'),_0x1fe1cb);if(_0x87e38d[_0x7995('0x70')]){var _0x51ab1e=ejs[_0x7995('0x6d')](_0x2466df,{'trunks':_0x3f0a71||[]});fs[_0x7995('0x6e')](_0x7995('0x71'),_0x51ab1e);}})[_0x7995('0x1f')](function(){return respondWithRpcPromise(_0x7995('0x72'),'create',{'module':'chan_sip.so'});})[_0x7995('0x1f')](function(){var _0xfe1105=_0x54a2e0[_0x7995('0x60')][_0x7995('0x58')]({'plain':!![]});if(!_0xfe1105)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xfe1105[_0x7995('0x5f')]===_0x7995('0x60')){var _0x54b955=_0x87e38d['get']({'plain':!![]});return db[_0x7995('0x61')][_0x7995('0x54')]({'where':{'name':'Trunks','userProfileId':_0xfe1105[_0x7995('0x62')]},'raw':!![]})['then'](function(_0x3758f9){if(_0x3758f9&&_0x3758f9[_0x7995('0x63')]===0x0){return db['UserProfileResource']['create']({'name':_0x54b955[_0x7995('0x38')],'resourceId':_0x54b955['id'],'type':_0x3758f9['name'],'sectionId':_0x3758f9['id']},{})[_0x7995('0x1f')](function(){return _0x87e38d;});}else{return _0x87e38d;}})[_0x7995('0x29')](function(_0x3dd197){logger[_0x7995('0x25')](_0x7995('0x65'),_0x3dd197);throw _0x3dd197;});}return _0x87e38d;})[_0x7995('0x1f')](respondWithResult(_0x4b54f2,0xc9))[_0x7995('0x29')](handleError(_0x4b54f2,null));};exports[_0x7995('0x34')]=function(_0x29e0ee,_0x117317,_0x1ab590){var _0x16108c;return db[_0x7995('0x3b')][_0x7995('0x54')]({'where':{'id':_0x29e0ee[_0x7995('0x53')]['id']}})[_0x7995('0x1f')](handleEntityNotFound(_0x117317,null))[_0x7995('0x1f')](saveUpdates(_0x29e0ee[_0x7995('0x5c')],null))[_0x7995('0x1f')](function(_0xa2fc8e){if(_0xa2fc8e){_0x16108c=_0xa2fc8e;return db[_0x7995('0x3b')][_0x7995('0x66')]({'raw':!![]});}})[_0x7995('0x1f')](function(_0x280fbb){if(_0x280fbb){var _0x260ef1=fs[_0x7995('0x67')](path[_0x7995('0x68')](config[_0x7995('0x69')],'server/files/templates/trunk.ejs'),_0x7995('0x6b'));var _0x10f4ca=fs['readFileSync'](path['join'](config[_0x7995('0x69')],_0x7995('0x6c')),_0x7995('0x6b'));var _0x38acda=ejs[_0x7995('0x6d')](_0x260ef1,{'trunks':_0x280fbb||[]});fs[_0x7995('0x6e')]('/etc/asterisk/sip_xcally_trunks.conf',_0x38acda);var _0x2f8a2d=ejs[_0x7995('0x6d')](_0x10f4ca,{'trunks':_0x280fbb||[]});fs[_0x7995('0x6e')](_0x7995('0x71'),_0x2f8a2d);return respondWithRpcPromise(_0x7995('0x72'),_0x7995('0x34'),{'module':_0x7995('0x73')});}return null;})[_0x7995('0x1f')](function(_0x560095){if(_0x560095){return _0x16108c;}})[_0x7995('0x1f')](respondWithResult(_0x117317,null))[_0x7995('0x29')](handleError(_0x117317,null));};exports['destroy']=function(_0x479271,_0xd24c64,_0xf8c2ed){var _0x18e1a2;return db[_0x7995('0x3b')][_0x7995('0x54')]({'where':{'id':_0x479271['params']['id']}})[_0x7995('0x1f')](handleEntityNotFound(_0xd24c64,null))[_0x7995('0x1f')](removeEntity(_0xd24c64,null))['then'](function(){return db[_0x7995('0x3b')][_0x7995('0x66')]({'raw':!![]});})['then'](function(_0x1535a3){var _0x4a5bc5=fs[_0x7995('0x67')](path[_0x7995('0x68')](config[_0x7995('0x69')],_0x7995('0x6a')),_0x7995('0x6b'));var _0x5d16da=fs[_0x7995('0x67')](path[_0x7995('0x68')](config[_0x7995('0x69')],'server/files/templates/registry.ejs'),_0x7995('0x6b'));var _0x3f3434=ejs[_0x7995('0x6d')](_0x4a5bc5,{'trunks':_0x1535a3});var _0x308a26=ejs['render'](_0x5d16da,{'trunks':_0x1535a3});fs[_0x7995('0x6e')](_0x7995('0x6f'),_0x3f3434);fs[_0x7995('0x6e')]('/etc/asterisk/sip_xcally_registers.conf',_0x308a26);return respondWithRpcPromise('Reload',_0x7995('0x35'),{'module':_0x7995('0x73')});})['catch'](handleError(_0xd24c64,null));}; \ No newline at end of file +var _0x6f0d=['server/files/templates/registry.ejs','utf8','render','writeFileSync','registry','Reload','chan_sip.so','user','UserProfileSection','autoAssociation','/etc/asterisk/sip_xcally_trunks.conf','/etc/asterisk/sip_xcally_registers.conf','destroy','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','jayson/promise','client','http','then','info','Trunk,\x20%s,\x20%s','request\x20sent','debug','Trunk,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','get','Trunks','UserProfileResource','end','stack','name','send','index','map','Trunk','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','clone','rawAttributes','find','updatedAt','body','omit','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','readFileSync','root','server/files/templates/trunk.ejs','join'];(function(_0x40623e,_0x155616){var _0x15def6=function(_0x4f63bc){while(--_0x4f63bc){_0x40623e['push'](_0x40623e['shift']());}};_0x15def6(++_0x155616);}(_0x6f0d,0x16c));var _0xd6f0=function(_0x3ad33d,_0x58770c){_0x3ad33d=_0x3ad33d-0x0;var _0x47f7ea=_0x6f0d[_0x3ad33d];return _0x47f7ea;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd6f0('0x0'));var zipdir=require(_0xd6f0('0x1'));var jsonpatch=require(_0xd6f0('0x2'));var rp=require(_0xd6f0('0x3'));var moment=require('moment');var BPromise=require(_0xd6f0('0x4'));var Mustache=require(_0xd6f0('0x5'));var util=require(_0xd6f0('0x6'));var path=require(_0xd6f0('0x7'));var sox=require(_0xd6f0('0x8'));var csv=require('to-csv');var ejs=require(_0xd6f0('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd6f0('0xa'));var squel=require(_0xd6f0('0xb'));var crypto=require(_0xd6f0('0xc'));var jsforce=require(_0xd6f0('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xd6f0('0xe'));var Papa=require(_0xd6f0('0xf'));var Redis=require(_0xd6f0('0x10'));var authService=require(_0xd6f0('0x11'));var qs=require(_0xd6f0('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd6f0('0x13'));var logger=require(_0xd6f0('0x14'))(_0xd6f0('0x15'));var utils=require(_0xd6f0('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xd6f0('0x17'));var db=require(_0xd6f0('0x18'))['db'];var jayson=require(_0xd6f0('0x19'));var client=jayson[_0xd6f0('0x1a')][_0xd6f0('0x1b')]({'port':0x232a});function respondWithRpcPromise(_0x409549,_0x2bf5b8,_0x250999,_0x246dad){return new BPromise(function(_0x4ab979,_0x2b3f32){var _0x354846=_0x246dad||client;return _0x354846['request'](_0x409549,_0x250999)[_0xd6f0('0x1c')](function(_0x593abe){logger[_0xd6f0('0x1d')](_0xd6f0('0x1e'),_0x2bf5b8,_0xd6f0('0x1f'));logger[_0xd6f0('0x20')](_0xd6f0('0x21'),_0x2bf5b8,_0xd6f0('0x1f'),JSON[_0xd6f0('0x22')](_0x593abe));if(_0x593abe[_0xd6f0('0x23')]){if(_0x593abe[_0xd6f0('0x23')][_0xd6f0('0x24')]===0x1f4){logger[_0xd6f0('0x23')](_0xd6f0('0x1e'),_0x2bf5b8,_0x593abe[_0xd6f0('0x23')][_0xd6f0('0x25')]);return _0x2b3f32(_0x593abe[_0xd6f0('0x23')][_0xd6f0('0x25')]);}logger['error']('Trunk,\x20%s,\x20%s',_0x2bf5b8,_0x593abe[_0xd6f0('0x23')][_0xd6f0('0x25')]);return _0x4ab979(_0x593abe[_0xd6f0('0x23')]['message']);}else{logger[_0xd6f0('0x1d')](_0xd6f0('0x1e'),_0x2bf5b8,'request\x20sent');_0x4ab979(_0x593abe[_0xd6f0('0x26')]['message']);}})[_0xd6f0('0x27')](function(_0x1c9d90){logger['error'](_0xd6f0('0x1e'),_0x2bf5b8,_0x1c9d90);_0x2b3f32(_0x1c9d90);});});}function respondWithStatusCode(_0x45e99c,_0x5ea2dd){_0x5ea2dd=_0x5ea2dd||0xcc;return function(_0x3dbdc3){if(_0x3dbdc3){return _0x45e99c[_0xd6f0('0x28')](_0x5ea2dd);}return _0x45e99c[_0xd6f0('0x29')](_0x5ea2dd)['end']();};}function respondWithResult(_0x2ca8bb,_0x3dc166){_0x3dc166=_0x3dc166||0xc8;return function(_0x5ecb16){if(_0x5ecb16){return _0x2ca8bb[_0xd6f0('0x29')](_0x3dc166)['json'](_0x5ecb16);}};}function respondWithFilteredResult(_0x2042d5,_0x3fb5c3){return function(_0x1630dc){if(_0x1630dc){var _0x3c1bff=typeof _0x3fb5c3[_0xd6f0('0x2a')]===_0xd6f0('0x2b')&&typeof _0x3fb5c3[_0xd6f0('0x2c')]===_0xd6f0('0x2b');var _0x48975d=_0x1630dc[_0xd6f0('0x2d')];var _0x1982d3=_0x3c1bff?0x0:_0x3fb5c3['offset'];var _0x38a3e9=_0x3c1bff?_0x1630dc[_0xd6f0('0x2d')]:_0x3fb5c3[_0xd6f0('0x2a')]+_0x3fb5c3[_0xd6f0('0x2c')];var _0x1a3967;if(_0x38a3e9>=_0x48975d){_0x38a3e9=_0x48975d;_0x1a3967=0xc8;}else{_0x1a3967=0xce;}_0x2042d5[_0xd6f0('0x29')](_0x1a3967);return _0x2042d5[_0xd6f0('0x2e')](_0xd6f0('0x2f'),_0x1982d3+'-'+_0x38a3e9+'/'+_0x48975d)[_0xd6f0('0x30')](_0x1630dc);}return null;};}function patchUpdates(_0x43f72f){return function(_0x1dff9b){try{jsonpatch[_0xd6f0('0x31')](_0x1dff9b,_0x43f72f,!![]);}catch(_0x348529){return BPromise[_0xd6f0('0x32')](_0x348529);}return _0x1dff9b[_0xd6f0('0x33')]();};}function saveUpdates(_0x2d7c90,_0x31c493){return function(_0x376890){if(_0x376890){return _0x376890[_0xd6f0('0x34')](_0x2d7c90)[_0xd6f0('0x1c')](function(_0x3906ca){return _0x3906ca;});}return null;};}function removeEntity(_0x26ab29,_0x4a8ebe){return function(_0x11124c){if(_0x11124c){return _0x11124c['destroy']()['then'](function(){var _0x43d588=_0x11124c[_0xd6f0('0x35')]({'plain':!![]});var _0x12a6fa=_0xd6f0('0x36');return db[_0xd6f0('0x37')]['destroy']({'where':{'type':_0x12a6fa,'resourceId':_0x43d588['id']}})[_0xd6f0('0x1c')](function(){return _0x11124c;});})['then'](function(){_0x26ab29[_0xd6f0('0x29')](0xcc)[_0xd6f0('0x38')]();});}};}function handleEntityNotFound(_0x42c01a,_0x1eecf0){return function(_0x518751){if(!_0x518751){_0x42c01a['sendStatus'](0x194);}return _0x518751;};}function handleError(_0x47b33d,_0x3b6463){_0x3b6463=_0x3b6463||0x1f4;return function(_0xe2958d){logger['error'](_0xe2958d[_0xd6f0('0x39')]);if(_0xe2958d['name']){delete _0xe2958d[_0xd6f0('0x3a')];}_0x47b33d[_0xd6f0('0x29')](_0x3b6463)[_0xd6f0('0x3b')](_0xe2958d);};}exports[_0xd6f0('0x3c')]=function(_0x451834,_0x3d1280){var _0x6b44fa={},_0x4fd4db={},_0x52203d={'count':0x0,'rows':[]};var _0x162537=_[_0xd6f0('0x3d')](db[_0xd6f0('0x3e')]['rawAttributes'],function(_0x59f905){return{'name':_0x59f905[_0xd6f0('0x3f')],'type':_0x59f905[_0xd6f0('0x40')][_0xd6f0('0x41')]};});_0x4fd4db[_0xd6f0('0x42')]=_[_0xd6f0('0x3d')](_0x162537,_0xd6f0('0x3a'));_0x4fd4db[_0xd6f0('0x43')]=_[_0xd6f0('0x44')](_0x451834['query']);_0x4fd4db[_0xd6f0('0x45')]=_[_0xd6f0('0x46')](_0x4fd4db[_0xd6f0('0x42')],_0x4fd4db[_0xd6f0('0x43')]);_0x6b44fa['attributes']=_[_0xd6f0('0x46')](_0x4fd4db[_0xd6f0('0x42')],qs[_0xd6f0('0x47')](_0x451834[_0xd6f0('0x43')][_0xd6f0('0x47')]));_0x6b44fa['attributes']=_0x6b44fa[_0xd6f0('0x48')][_0xd6f0('0x49')]?_0x6b44fa[_0xd6f0('0x48')]:_0x4fd4db['model'];if(!_0x451834[_0xd6f0('0x43')][_0xd6f0('0x4a')]('nolimit')){_0x6b44fa['limit']=qs[_0xd6f0('0x2c')](_0x451834[_0xd6f0('0x43')][_0xd6f0('0x2c')]);_0x6b44fa['offset']=qs[_0xd6f0('0x2a')](_0x451834[_0xd6f0('0x43')]['offset']);}_0x6b44fa[_0xd6f0('0x4b')]=qs[_0xd6f0('0x4c')](_0x451834[_0xd6f0('0x43')][_0xd6f0('0x4c')]);_0x6b44fa['where']=qs[_0xd6f0('0x45')](_[_0xd6f0('0x4d')](_0x451834[_0xd6f0('0x43')],_0x4fd4db[_0xd6f0('0x45')]),_0x162537);if(_0x451834[_0xd6f0('0x43')][_0xd6f0('0x4e')]){_0x6b44fa[_0xd6f0('0x4f')]=_[_0xd6f0('0x50')](_0x6b44fa['where'],{'$or':_[_0xd6f0('0x3d')](_0x162537,function(_0x3d42ca){if(_0x3d42ca['type']!==_0xd6f0('0x51')){var _0x39ca69={};_0x39ca69[_0x3d42ca[_0xd6f0('0x3a')]]={'$like':'%'+_0x451834[_0xd6f0('0x43')]['filter']+'%'};return _0x39ca69;}})});}_0x6b44fa=_[_0xd6f0('0x50')]({},_0x6b44fa,_0x451834[_0xd6f0('0x52')]);var _0x494542={'where':_0x6b44fa['where']};return db[_0xd6f0('0x3e')]['count'](_0x494542)[_0xd6f0('0x1c')](function(_0x61b354){_0x52203d[_0xd6f0('0x2d')]=_0x61b354;if(_0x451834['query'][_0xd6f0('0x53')]){_0x6b44fa[_0xd6f0('0x54')]=[{'all':!![]}];}return db[_0xd6f0('0x3e')][_0xd6f0('0x55')](_0x6b44fa);})[_0xd6f0('0x1c')](function(_0x4c42ce){_0x52203d[_0xd6f0('0x56')]=_0x4c42ce;return _0x52203d;})['then'](respondWithFilteredResult(_0x3d1280,_0x6b44fa))[_0xd6f0('0x27')](handleError(_0x3d1280,null));};exports[_0xd6f0('0x57')]=function(_0x2eb338,_0x1dc320){var _0x554e37={'raw':![],'where':{'id':_0x2eb338[_0xd6f0('0x58')]['id']}},_0x5ceb6b={};_0x5ceb6b[_0xd6f0('0x42')]=_['keys'](db[_0xd6f0('0x3e')]['rawAttributes']);_0x5ceb6b[_0xd6f0('0x43')]=_[_0xd6f0('0x44')](_0x2eb338[_0xd6f0('0x43')]);_0x5ceb6b[_0xd6f0('0x45')]=_[_0xd6f0('0x46')](_0x5ceb6b['model'],_0x5ceb6b[_0xd6f0('0x43')]);_0x554e37[_0xd6f0('0x48')]=_[_0xd6f0('0x46')](_0x5ceb6b[_0xd6f0('0x42')],qs[_0xd6f0('0x47')](_0x2eb338[_0xd6f0('0x43')][_0xd6f0('0x47')]));_0x554e37[_0xd6f0('0x48')]=_0x554e37['attributes'][_0xd6f0('0x49')]?_0x554e37[_0xd6f0('0x48')]:_0x5ceb6b[_0xd6f0('0x42')];if(_0x2eb338[_0xd6f0('0x43')][_0xd6f0('0x53')]){_0x554e37[_0xd6f0('0x54')]=[{'all':!![]}];}_0x554e37=_[_0xd6f0('0x50')]({},_0x554e37,_0x2eb338[_0xd6f0('0x52')]);return db[_0xd6f0('0x3e')]['find'](_0x554e37)[_0xd6f0('0x1c')](handleEntityNotFound(_0x1dc320,null))['then'](respondWithResult(_0x1dc320,null))['catch'](handleError(_0x1dc320,null));};exports[_0xd6f0('0x59')]=function(_0x55fd25,_0x539ef1){var _0x28c3c4={'where':{'id':_0x55fd25[_0xd6f0('0x58')]['id']}},_0x2d39a2={};_0x2d39a2['model']=_[_0xd6f0('0x44')](db[_0xd6f0('0x3e')][_0xd6f0('0x5a')]);_0x28c3c4['attributes']=_[_0xd6f0('0x46')](_0x2d39a2[_0xd6f0('0x42')],qs['fields'](_0x55fd25[_0xd6f0('0x43')][_0xd6f0('0x47')]));_0x28c3c4['attributes']=_0x28c3c4[_0xd6f0('0x48')][_0xd6f0('0x49')]?_0x28c3c4[_0xd6f0('0x48')]:_0x2d39a2[_0xd6f0('0x42')];if(_0x55fd25[_0xd6f0('0x43')]['includeAll']){_0x28c3c4[_0xd6f0('0x54')]=[{'all':!![]}];}_0x28c3c4=_[_0xd6f0('0x50')]({},_0x28c3c4,_0x55fd25['options']);return db[_0xd6f0('0x3e')][_0xd6f0('0x5b')](_0x28c3c4)[_0xd6f0('0x1c')](handleEntityNotFound(_0x539ef1,null))['then'](function(_0x229f19){if(_0x229f19){var _0x5d75fa=_0x229f19['get']({'plain':!![]});_0x5d75fa=qs['omit'](_0x5d75fa,['id','createdAt',_0xd6f0('0x5c')]);_0x55fd25[_0xd6f0('0x5d')]=_[_0xd6f0('0x5e')](_0x55fd25[_0xd6f0('0x5d')],['id','createdAt',_0xd6f0('0x5c')]);return db['Trunk'][_0xd6f0('0x5f')](_[_0xd6f0('0x50')](_0x5d75fa,_0x55fd25[_0xd6f0('0x5d')]),{'include':_0x55fd25['query'][_0xd6f0('0x53')]?[{'all':!![]}]:undefined})[_0xd6f0('0x1c')](function(_0x269dd7){var _0x705eb=_0x55fd25['user'][_0xd6f0('0x35')]({'plain':!![]});if(!_0x705eb)throw new Error(_0xd6f0('0x60'));if(_0x705eb[_0xd6f0('0x61')]==='user'){var _0x5bc4e7=_0x269dd7[_0xd6f0('0x35')]({'plain':!![]});var _0x1fee47=_0xd6f0('0x36');return db['UserProfileSection'][_0xd6f0('0x5b')]({'where':{'name':_0x1fee47,'userProfileId':_0x705eb[_0xd6f0('0x62')]},'raw':!![]})[_0xd6f0('0x1c')](function(_0x282e9b){if(_0x282e9b&&_0x282e9b['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x5bc4e7['name'],'resourceId':_0x5bc4e7['id'],'type':_0x282e9b[_0xd6f0('0x3a')],'sectionId':_0x282e9b['id']},{})[_0xd6f0('0x1c')](function(){return _0x269dd7;});}else{return _0x269dd7;}})[_0xd6f0('0x27')](function(_0x30cd81){logger[_0xd6f0('0x23')](_0xd6f0('0x63'),_0x30cd81);throw _0x30cd81;});}return _0x269dd7;});}})[_0xd6f0('0x1c')](respondWithResult(_0x539ef1,0xc9))[_0xd6f0('0x27')](handleError(_0x539ef1,null));};exports[_0xd6f0('0x5f')]=function(_0x5ad146,_0x55f96e,_0x1b9728){var _0x5af4f6;return db[_0xd6f0('0x3e')][_0xd6f0('0x5f')](_0x5ad146[_0xd6f0('0x5d')],{'raw':!![]})[_0xd6f0('0x1c')](function(_0x14384f){_0x5af4f6=_0x14384f;return db[_0xd6f0('0x3e')][_0xd6f0('0x55')]({'raw':!![]});})['then'](function(_0x3c8a3e){var _0x318a68=fs[_0xd6f0('0x64')](path['join'](config[_0xd6f0('0x65')],_0xd6f0('0x66')),'utf8');var _0xad50ac=fs[_0xd6f0('0x64')](path[_0xd6f0('0x67')](config[_0xd6f0('0x65')],_0xd6f0('0x68')),_0xd6f0('0x69'));var _0x1c6140=ejs[_0xd6f0('0x6a')](_0x318a68,{'trunks':_0x3c8a3e||[]});fs[_0xd6f0('0x6b')]('/etc/asterisk/sip_xcally_trunks.conf',_0x1c6140);if(_0x5af4f6[_0xd6f0('0x6c')]){var _0x205b6a=ejs[_0xd6f0('0x6a')](_0xad50ac,{'trunks':_0x3c8a3e||[]});fs[_0xd6f0('0x6b')]('/etc/asterisk/sip_xcally_registers.conf',_0x205b6a);}})[_0xd6f0('0x1c')](function(){return respondWithRpcPromise(_0xd6f0('0x6d'),_0xd6f0('0x5f'),{'module':_0xd6f0('0x6e')});})[_0xd6f0('0x1c')](function(){var _0x12e0e5=_0x5ad146[_0xd6f0('0x6f')][_0xd6f0('0x35')]({'plain':!![]});if(!_0x12e0e5)throw new Error(_0xd6f0('0x60'));if(_0x12e0e5[_0xd6f0('0x61')]==='user'){var _0x440d5c=_0x5af4f6[_0xd6f0('0x35')]({'plain':!![]});return db[_0xd6f0('0x70')]['find']({'where':{'name':_0xd6f0('0x36'),'userProfileId':_0x12e0e5[_0xd6f0('0x62')]},'raw':!![]})[_0xd6f0('0x1c')](function(_0x406bc7){if(_0x406bc7&&_0x406bc7[_0xd6f0('0x71')]===0x0){return db[_0xd6f0('0x37')][_0xd6f0('0x5f')]({'name':_0x440d5c[_0xd6f0('0x3a')],'resourceId':_0x440d5c['id'],'type':_0x406bc7[_0xd6f0('0x3a')],'sectionId':_0x406bc7['id']},{})[_0xd6f0('0x1c')](function(){return _0x5af4f6;});}else{return _0x5af4f6;}})[_0xd6f0('0x27')](function(_0x5b3155){logger['error'](_0xd6f0('0x63'),_0x5b3155);throw _0x5b3155;});}return _0x5af4f6;})[_0xd6f0('0x1c')](respondWithResult(_0x55f96e,0xc9))[_0xd6f0('0x27')](handleError(_0x55f96e,null));};exports[_0xd6f0('0x34')]=function(_0x1da442,_0x5a781b,_0x15143a){var _0x2d38e6;return db['Trunk'][_0xd6f0('0x5b')]({'where':{'id':_0x1da442['params']['id']}})[_0xd6f0('0x1c')](handleEntityNotFound(_0x5a781b,null))[_0xd6f0('0x1c')](saveUpdates(_0x1da442[_0xd6f0('0x5d')],null))[_0xd6f0('0x1c')](function(_0x391c2a){if(_0x391c2a){_0x2d38e6=_0x391c2a;return db['Trunk']['findAll']({'raw':!![]});}})[_0xd6f0('0x1c')](function(_0x17b320){if(_0x17b320){var _0x484124=fs[_0xd6f0('0x64')](path['join'](config['root'],_0xd6f0('0x66')),'utf8');var _0x5dc1c7=fs['readFileSync'](path['join'](config[_0xd6f0('0x65')],_0xd6f0('0x68')),_0xd6f0('0x69'));var _0xcfed18=ejs[_0xd6f0('0x6a')](_0x484124,{'trunks':_0x17b320||[]});fs[_0xd6f0('0x6b')](_0xd6f0('0x72'),_0xcfed18);var _0x381f88=ejs[_0xd6f0('0x6a')](_0x5dc1c7,{'trunks':_0x17b320||[]});fs['writeFileSync'](_0xd6f0('0x73'),_0x381f88);return respondWithRpcPromise('Reload','update',{'module':_0xd6f0('0x6e')});}return null;})[_0xd6f0('0x1c')](function(_0x397f2c){if(_0x397f2c){return _0x2d38e6;}})['then'](respondWithResult(_0x5a781b,null))[_0xd6f0('0x27')](handleError(_0x5a781b,null));};exports[_0xd6f0('0x74')]=function(_0xc0585c,_0xf7ade1,_0x41e738){var _0x202e37;return db[_0xd6f0('0x3e')][_0xd6f0('0x5b')]({'where':{'id':_0xc0585c['params']['id']}})[_0xd6f0('0x1c')](handleEntityNotFound(_0xf7ade1,null))[_0xd6f0('0x1c')](removeEntity(_0xf7ade1,null))['then'](function(){return db[_0xd6f0('0x3e')][_0xd6f0('0x55')]({'raw':!![]});})[_0xd6f0('0x1c')](function(_0x175ba6){var _0x403698=fs[_0xd6f0('0x64')](path[_0xd6f0('0x67')](config['root'],_0xd6f0('0x66')),_0xd6f0('0x69'));var _0x5c3659=fs['readFileSync'](path['join'](config['root'],_0xd6f0('0x68')),_0xd6f0('0x69'));var _0x2fdd59=ejs[_0xd6f0('0x6a')](_0x403698,{'trunks':_0x175ba6});var _0x427b95=ejs[_0xd6f0('0x6a')](_0x5c3659,{'trunks':_0x175ba6});fs['writeFileSync'](_0xd6f0('0x72'),_0x2fdd59);fs[_0xd6f0('0x6b')](_0xd6f0('0x73'),_0x427b95);return respondWithRpcPromise(_0xd6f0('0x6d'),'destroy',{'module':_0xd6f0('0x6e')});})['catch'](handleError(_0xf7ade1,null));}; \ No newline at end of file diff --git a/server/api/trunk/trunk.model.js b/server/api/trunk/trunk.model.js index 42a26dc..21d13a8 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 _0x743e=['../../config/environment','./trunk.attributes','exports','define','Trunk','tools_trunks','lodash','util','../../config/logger','api','moment','path','rimraf'];(function(_0x75b25d,_0x3fbae3){var _0x3400de=function(_0x380c27){while(--_0x380c27){_0x75b25d['push'](_0x75b25d['shift']());}};_0x3400de(++_0x3fbae3);}(_0x743e,0x172));var _0xe743=function(_0x486790,_0x1f6dfc){_0x486790=_0x486790-0x0;var _0xa5e6a6=_0x743e[_0x486790];return _0xa5e6a6;};'use strict';var _=require(_0xe743('0x0'));var util=require(_0xe743('0x1'));var logger=require(_0xe743('0x2'))(_0xe743('0x3'));var moment=require(_0xe743('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xe743('0x5'));var rimraf=require(_0xe743('0x6'));var config=require(_0xe743('0x7'));var attributes=require(_0xe743('0x8'));module[_0xe743('0x9')]=function(_0x466f02,_0x57969b){return _0x466f02[_0xe743('0xa')](_0xe743('0xb'),attributes,{'tableName':_0xe743('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9345=['moment','bluebird','request-promise','path','../../config/environment','./trunk.attributes','define','Trunk','tools_trunks','lodash','util'];(function(_0x1b6186,_0x1ec7f2){var _0x186121=function(_0x1748a8){while(--_0x1748a8){_0x1b6186['push'](_0x1b6186['shift']());}};_0x186121(++_0x1ec7f2);}(_0x9345,0x1e2));var _0x5934=function(_0x3d1244,_0x156028){_0x3d1244=_0x3d1244-0x0;var _0x5d6372=_0x9345[_0x3d1244];return _0x5d6372;};'use strict';var _=require(_0x5934('0x0'));var util=require(_0x5934('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x5934('0x2'));var BPromise=require(_0x5934('0x3'));var rp=require(_0x5934('0x4'));var fs=require('fs');var path=require(_0x5934('0x5'));var rimraf=require('rimraf');var config=require(_0x5934('0x6'));var attributes=require(_0x5934('0x7'));module['exports']=function(_0x531f36,_0x5afe00){return _0x531f36[_0x5934('0x8')](_0x5934('0x9'),attributes,{'tableName':_0x5934('0xa'),'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 47fe21f..5553a52 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 _0x3dba=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','Trunk,\x20%s,\x20%s','request\x20sent','debug','Trunk,\x20%s,\x20%s,\x20%s','code','error','message','GetTrunk','Trunk','options','raw','where','attributes','limit','include','map','model','then','stringify','ShowTrunk','find','catch'];(function(_0x2629c5,_0x383b78){var _0x221056=function(_0xe1d3e0){while(--_0xe1d3e0){_0x2629c5['push'](_0x2629c5['shift']());}};_0x221056(++_0x383b78);}(_0x3dba,0x84));var _0xa3db=function(_0x261999,_0x15f7e8){_0x261999=_0x261999-0x0;var _0x109e04=_0x3dba[_0x261999];return _0x109e04;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xa3db('0x0'));var fs=require('fs');var Redis=require(_0xa3db('0x1'));var db=require(_0xa3db('0x2'))['db'];var utils=require(_0xa3db('0x3'));var logger=require(_0xa3db('0x4'))('rpc');var config=require(_0xa3db('0x5'));var jayson=require(_0xa3db('0x6'));var client=jayson[_0xa3db('0x7')][_0xa3db('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x15da8d,_0xf7bbd7,_0x4f9976){return new BPromise(function(_0x544237,_0x16721b){return client[_0xa3db('0x9')](_0x15da8d,_0x4f9976)['then'](function(_0x284c5c){logger[_0xa3db('0xa')](_0xa3db('0xb'),_0xf7bbd7,_0xa3db('0xc'));logger[_0xa3db('0xd')](_0xa3db('0xe'),_0xf7bbd7,_0xa3db('0xc'),JSON['stringify'](_0x284c5c));if(_0x284c5c['error']){if(_0x284c5c['error'][_0xa3db('0xf')]===0x1f4){logger[_0xa3db('0x10')]('Trunk,\x20%s,\x20%s',_0xf7bbd7,_0x284c5c['error'][_0xa3db('0x11')]);return _0x16721b(_0x284c5c['error'][_0xa3db('0x11')]);}logger[_0xa3db('0x10')](_0xa3db('0xb'),_0xf7bbd7,_0x284c5c[_0xa3db('0x10')]['message']);return _0x544237(_0x284c5c[_0xa3db('0x10')][_0xa3db('0x11')]);}else{logger[_0xa3db('0xa')](_0xa3db('0xb'),_0xf7bbd7,_0xa3db('0xc'));_0x544237(_0x284c5c['result'][_0xa3db('0x11')]);}})['catch'](function(_0x32d25c){logger[_0xa3db('0x10')](_0xa3db('0xb'),_0xf7bbd7,_0x32d25c);_0x16721b(_0x32d25c);});});}exports[_0xa3db('0x12')]=function(_0x121a4f){var _0x23db66=this;return new Promise(function(_0x312ca8,_0x22e15b){return db[_0xa3db('0x13')]['findAll']({'raw':_0x121a4f[_0xa3db('0x14')]?_0x121a4f[_0xa3db('0x14')][_0xa3db('0x15')]===undefined?!![]:![]:!![],'where':_0x121a4f[_0xa3db('0x14')]?_0x121a4f[_0xa3db('0x14')][_0xa3db('0x16')]||null:null,'attributes':_0x121a4f[_0xa3db('0x14')]?_0x121a4f[_0xa3db('0x14')][_0xa3db('0x17')]||null:null,'limit':_0x121a4f[_0xa3db('0x14')]?_0x121a4f[_0xa3db('0x14')][_0xa3db('0x18')]||null:null,'include':_0x121a4f['options']?_0x121a4f[_0xa3db('0x14')][_0xa3db('0x19')]?_[_0xa3db('0x1a')](_0x121a4f[_0xa3db('0x14')][_0xa3db('0x19')],function(_0x121d1f){return{'model':db[_0x121d1f[_0xa3db('0x1b')]],'as':_0x121d1f['as'],'attributes':_0x121d1f[_0xa3db('0x17')],'include':_0x121d1f[_0xa3db('0x19')]?_[_0xa3db('0x1a')](_0x121d1f[_0xa3db('0x19')],function(_0x9243f8){return{'model':db[_0x9243f8[_0xa3db('0x1b')]],'as':_0x9243f8['as'],'attributes':_0x9243f8[_0xa3db('0x17')],'include':_0x9243f8['include']?_[_0xa3db('0x1a')](_0x9243f8[_0xa3db('0x19')],function(_0x19e7d6){return{'model':db[_0x19e7d6['model']],'as':_0x19e7d6['as'],'attributes':_0x19e7d6[_0xa3db('0x17')]};}):[]};}):[]};}):[]:[]})[_0xa3db('0x1c')](function(_0x403e02){logger[_0xa3db('0xa')](_0xa3db('0x12'),_0x121a4f);logger['debug'](_0xa3db('0x12'),_0x121a4f,JSON[_0xa3db('0x1d')](_0x403e02));_0x312ca8(_0x403e02);})['catch'](function(_0x2a4484){logger[_0xa3db('0x10')](_0xa3db('0x12'),_0x2a4484[_0xa3db('0x11')],_0x121a4f);_0x22e15b(_0x23db66[_0xa3db('0x10')](0x1f4,_0x2a4484[_0xa3db('0x11')]));});});};exports[_0xa3db('0x1e')]=function(_0x4f64b6){var _0x4e58f7=this;return new Promise(function(_0xbf4529,_0x46080a){return db[_0xa3db('0x13')][_0xa3db('0x1f')]({'raw':_0x4f64b6['options']?_0x4f64b6['options'][_0xa3db('0x15')]===undefined?!![]:![]:!![],'where':_0x4f64b6[_0xa3db('0x14')]?_0x4f64b6['options'][_0xa3db('0x16')]||null:null,'attributes':_0x4f64b6['options']?_0x4f64b6[_0xa3db('0x14')][_0xa3db('0x17')]||null:null,'include':_0x4f64b6[_0xa3db('0x14')]?_0x4f64b6[_0xa3db('0x14')]['include']?_[_0xa3db('0x1a')](_0x4f64b6[_0xa3db('0x14')][_0xa3db('0x19')],function(_0x3f511a){return{'model':db[_0x3f511a[_0xa3db('0x1b')]],'as':_0x3f511a['as'],'attributes':_0x3f511a[_0xa3db('0x17')],'include':_0x3f511a['include']?_[_0xa3db('0x1a')](_0x3f511a[_0xa3db('0x19')],function(_0x1688dd){return{'model':db[_0x1688dd[_0xa3db('0x1b')]],'as':_0x1688dd['as'],'attributes':_0x1688dd['attributes'],'include':_0x1688dd['include']?_[_0xa3db('0x1a')](_0x1688dd[_0xa3db('0x19')],function(_0x4f6580){return{'model':db[_0x4f6580['model']],'as':_0x4f6580['as'],'attributes':_0x4f6580[_0xa3db('0x17')]};}):[]};}):[]};}):[]:[]})[_0xa3db('0x1c')](function(_0x200bdd){logger[_0xa3db('0xa')](_0xa3db('0x1e'),_0x4f64b6);logger['debug'](_0xa3db('0x1e'),_0x4f64b6,JSON[_0xa3db('0x1d')](_0x200bdd));_0xbf4529(_0x200bdd);})[_0xa3db('0x20')](function(_0x5c3e5c){logger['error'](_0xa3db('0x1e'),_0x5c3e5c[_0xa3db('0x11')],_0x4f64b6);_0x46080a(_0x4e58f7[_0xa3db('0x10')](0x1f4,_0x5c3e5c[_0xa3db('0x11')]));});});}; \ No newline at end of file +var _0xbfd3=['request\x20sent','result','GetTrunk','Trunk','findAll','options','where','attributes','include','model','map','catch','find','raw','ShowTrunk','stringify','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Trunk,\x20%s,\x20%s','debug','error','code','message'];(function(_0xd02def,_0x144f25){var _0x2e8374=function(_0x5ceb35){while(--_0x5ceb35){_0xd02def['push'](_0xd02def['shift']());}};_0x2e8374(++_0x144f25);}(_0xbfd3,0x178));var _0x3bfd=function(_0xdb1f81,_0x165a69){_0xdb1f81=_0xdb1f81-0x0;var _0x5c9b1c=_0xbfd3[_0xdb1f81];return _0x5c9b1c;};'use strict';var _=require(_0x3bfd('0x0'));var util=require('util');var moment=require(_0x3bfd('0x1'));var BPromise=require(_0x3bfd('0x2'));var rs=require(_0x3bfd('0x3'));var fs=require('fs');var Redis=require(_0x3bfd('0x4'));var db=require(_0x3bfd('0x5'))['db'];var utils=require(_0x3bfd('0x6'));var logger=require('../../config/logger')(_0x3bfd('0x7'));var config=require(_0x3bfd('0x8'));var jayson=require(_0x3bfd('0x9'));var client=jayson[_0x3bfd('0xa')][_0x3bfd('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x332735,_0x367587,_0x2f1d83){return new BPromise(function(_0xb3d514,_0xcd13c8){return client[_0x3bfd('0xc')](_0x332735,_0x2f1d83)[_0x3bfd('0xd')](function(_0x14d8a4){logger[_0x3bfd('0xe')](_0x3bfd('0xf'),_0x367587,'request\x20sent');logger[_0x3bfd('0x10')]('Trunk,\x20%s,\x20%s,\x20%s',_0x367587,'request\x20sent',JSON['stringify'](_0x14d8a4));if(_0x14d8a4[_0x3bfd('0x11')]){if(_0x14d8a4['error'][_0x3bfd('0x12')]===0x1f4){logger[_0x3bfd('0x11')](_0x3bfd('0xf'),_0x367587,_0x14d8a4['error'][_0x3bfd('0x13')]);return _0xcd13c8(_0x14d8a4[_0x3bfd('0x11')][_0x3bfd('0x13')]);}logger[_0x3bfd('0x11')]('Trunk,\x20%s,\x20%s',_0x367587,_0x14d8a4[_0x3bfd('0x11')][_0x3bfd('0x13')]);return _0xb3d514(_0x14d8a4[_0x3bfd('0x11')]['message']);}else{logger['info'](_0x3bfd('0xf'),_0x367587,_0x3bfd('0x14'));_0xb3d514(_0x14d8a4[_0x3bfd('0x15')][_0x3bfd('0x13')]);}})['catch'](function(_0x1cd0cb){logger[_0x3bfd('0x11')](_0x3bfd('0xf'),_0x367587,_0x1cd0cb);_0xcd13c8(_0x1cd0cb);});});}exports[_0x3bfd('0x16')]=function(_0x5c69aa){var _0x4dedc9=this;return new Promise(function(_0x21092b,_0x1a30ce){return db[_0x3bfd('0x17')][_0x3bfd('0x18')]({'raw':_0x5c69aa[_0x3bfd('0x19')]?_0x5c69aa[_0x3bfd('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x5c69aa[_0x3bfd('0x19')]?_0x5c69aa[_0x3bfd('0x19')][_0x3bfd('0x1a')]||null:null,'attributes':_0x5c69aa[_0x3bfd('0x19')]?_0x5c69aa[_0x3bfd('0x19')][_0x3bfd('0x1b')]||null:null,'limit':_0x5c69aa[_0x3bfd('0x19')]?_0x5c69aa[_0x3bfd('0x19')]['limit']||null:null,'include':_0x5c69aa[_0x3bfd('0x19')]?_0x5c69aa[_0x3bfd('0x19')][_0x3bfd('0x1c')]?_['map'](_0x5c69aa[_0x3bfd('0x19')][_0x3bfd('0x1c')],function(_0x32acc4){return{'model':db[_0x32acc4[_0x3bfd('0x1d')]],'as':_0x32acc4['as'],'attributes':_0x32acc4['attributes'],'include':_0x32acc4[_0x3bfd('0x1c')]?_[_0x3bfd('0x1e')](_0x32acc4[_0x3bfd('0x1c')],function(_0x378e57){return{'model':db[_0x378e57[_0x3bfd('0x1d')]],'as':_0x378e57['as'],'attributes':_0x378e57[_0x3bfd('0x1b')],'include':_0x378e57[_0x3bfd('0x1c')]?_[_0x3bfd('0x1e')](_0x378e57['include'],function(_0x5a299a){return{'model':db[_0x5a299a[_0x3bfd('0x1d')]],'as':_0x5a299a['as'],'attributes':_0x5a299a[_0x3bfd('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x3bfd('0xd')](function(_0x3226ee){logger[_0x3bfd('0xe')]('GetTrunk',_0x5c69aa);logger['debug'](_0x3bfd('0x16'),_0x5c69aa,JSON['stringify'](_0x3226ee));_0x21092b(_0x3226ee);})[_0x3bfd('0x1f')](function(_0x5ac563){logger[_0x3bfd('0x11')](_0x3bfd('0x16'),_0x5ac563['message'],_0x5c69aa);_0x1a30ce(_0x4dedc9[_0x3bfd('0x11')](0x1f4,_0x5ac563[_0x3bfd('0x13')]));});});};exports['ShowTrunk']=function(_0x35193f){var _0xe715e6=this;return new Promise(function(_0x12c1ee,_0x6052c8){return db['Trunk'][_0x3bfd('0x20')]({'raw':_0x35193f[_0x3bfd('0x19')]?_0x35193f[_0x3bfd('0x19')][_0x3bfd('0x21')]===undefined?!![]:![]:!![],'where':_0x35193f[_0x3bfd('0x19')]?_0x35193f['options']['where']||null:null,'attributes':_0x35193f[_0x3bfd('0x19')]?_0x35193f['options'][_0x3bfd('0x1b')]||null:null,'include':_0x35193f[_0x3bfd('0x19')]?_0x35193f[_0x3bfd('0x19')][_0x3bfd('0x1c')]?_[_0x3bfd('0x1e')](_0x35193f['options'][_0x3bfd('0x1c')],function(_0x31c9d9){return{'model':db[_0x31c9d9[_0x3bfd('0x1d')]],'as':_0x31c9d9['as'],'attributes':_0x31c9d9[_0x3bfd('0x1b')],'include':_0x31c9d9[_0x3bfd('0x1c')]?_[_0x3bfd('0x1e')](_0x31c9d9[_0x3bfd('0x1c')],function(_0x7dfbbf){return{'model':db[_0x7dfbbf['model']],'as':_0x7dfbbf['as'],'attributes':_0x7dfbbf[_0x3bfd('0x1b')],'include':_0x7dfbbf[_0x3bfd('0x1c')]?_['map'](_0x7dfbbf[_0x3bfd('0x1c')],function(_0x51776f){return{'model':db[_0x51776f[_0x3bfd('0x1d')]],'as':_0x51776f['as'],'attributes':_0x51776f[_0x3bfd('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x3bfd('0xd')](function(_0x5b2fe5){logger[_0x3bfd('0xe')](_0x3bfd('0x22'),_0x35193f);logger[_0x3bfd('0x10')](_0x3bfd('0x22'),_0x35193f,JSON[_0x3bfd('0x23')](_0x5b2fe5));_0x12c1ee(_0x5b2fe5);})[_0x3bfd('0x1f')](function(_0xb8d253){logger['error']('ShowTrunk',_0xb8d253[_0x3bfd('0x13')],_0x35193f);_0x6052c8(_0xe715e6[_0x3bfd('0x11')](0x1f4,_0xb8d253[_0x3bfd('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/user/index.js b/server/api/user/index.js index fc38c79..6e5bc79 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 _0x7607=['isAuthenticated','index','/describe','describe','/whoami','whoami','getPresence','/:id','show','getAvatar','/:id/open_tabs','getOpenTabs','/:id/contacts','getContacts','getQueues','/:id/queues_rt','getVoiceQueuesRt','/:id/groups','getGroups','/:id/recordings','getRecordings','/:id/screen_recordings','getScreenRecordings','/:id/chat/interactions','getChatInteractions','/:id/openchannel/interactions','getOpenchannelInteractions','/:id/mail/interactions','getMailInteractions','/:id/sms/interactions','getSmsInteractions','/:id/fax/interactions','getFaxInteractions','getWhatsappInteractions','getTeams','/:id/lists','getLists','/:id/agents','getAgents','/:id/prefixes','getVoicePrefixes','/:id/fax_accounts','getFaxAccounts','/:id/mail_accounts','getMailAccounts','/:id/openchannel_accounts','getOpenchannelAccounts','/:id/sms_accounts','/:id/chat_websites','getChatWebsites','/:id/whatsapp_accounts','getWhatsappAccounts','/:id/square_projects','getSquareProjects','/:id/scheduled_calls','getScheduledCalls','getApiKey','post','addContacts','create','/create_many','/:id/queues','addQueues','diskStorage','join','root','server/files/images/','now','originalname','/:id/avatar','file','addAvatar','/:id/login','login','/:id/logout','logout','/:id/pause','pause','/:id/unpause','unpause','/:id/teams','addTeams','/:id/chat_interactions','addMailInteractions','addFaxInteractions','/:id/sms_interactions','addSmsInteractions','/:id/openchannel_interactions','addWhatsappInteractions','addFaxAccounts','addMailAccounts','addOpenchannelAccounts','addWhatsappAccounts','addSquareProjects','/:id/api_key','createApiKey','put','update','changePassword','removeQueues','delete','removeTeams','destroy','removeChatInteractions','removeMailInteractions','/:id/fax_interactions','removeSmsInteractions','/:id/whatsapp_interactions','removeWhatsappInteractions','removeMailAccounts','removeOpenchannelAccounts','removeSmsAccounts','removeWhatsappAccounts','removeSquareProjects','removeApiKey','exports','multer','util','express','Router','../../components/auth/service','../../components/interaction/service','./user.controller','get'];(function(_0x1e1f9a,_0x112326){var _0xf93dce=function(_0x2fafc9){while(--_0x2fafc9){_0x1e1f9a['push'](_0x1e1f9a['shift']());}};_0xf93dce(++_0x112326);}(_0x7607,0x16c));var _0x7760=function(_0x50a28c,_0xe5f377){_0x50a28c=_0x50a28c-0x0;var _0x1921ff=_0x7607[_0x50a28c];return _0x1921ff;};'use strict';var multer=require(_0x7760('0x0'));var util=require(_0x7760('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x7760('0x2'));var router=express[_0x7760('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x7760('0x4'));var interaction=require(_0x7760('0x5'));var config=require('../../config/environment');var controller=require(_0x7760('0x6'));router[_0x7760('0x7')]('/',auth[_0x7760('0x8')](),controller[_0x7760('0x9')]);router[_0x7760('0x7')](_0x7760('0xa'),auth[_0x7760('0x8')](),controller[_0x7760('0xb')]);router[_0x7760('0x7')](_0x7760('0xc'),auth[_0x7760('0x8')](),controller[_0x7760('0xd')]);router[_0x7760('0x7')]('/presence',auth['isAuthenticated'](),controller[_0x7760('0xe')]);router[_0x7760('0x7')](_0x7760('0xf'),auth[_0x7760('0x8')](),controller[_0x7760('0x10')]);router[_0x7760('0x7')]('/:id/avatar',controller[_0x7760('0x11')]);router['get'](_0x7760('0x12'),auth['isAuthenticated'](),controller[_0x7760('0x13')]);router[_0x7760('0x7')](_0x7760('0x14'),auth[_0x7760('0x8')](),controller[_0x7760('0x15')]);router[_0x7760('0x7')]('/:id/queues',auth[_0x7760('0x8')](),controller[_0x7760('0x16')]);router[_0x7760('0x7')](_0x7760('0x17'),auth[_0x7760('0x8')](),controller[_0x7760('0x18')]);router[_0x7760('0x7')](_0x7760('0x19'),auth[_0x7760('0x8')](),controller[_0x7760('0x1a')]);router[_0x7760('0x7')](_0x7760('0x1b'),auth['isAuthenticated'](),controller[_0x7760('0x1c')]);router[_0x7760('0x7')](_0x7760('0x1d'),auth[_0x7760('0x8')](),controller[_0x7760('0x1e')]);router[_0x7760('0x7')](_0x7760('0x1f'),auth[_0x7760('0x8')](),controller[_0x7760('0x20')]);router[_0x7760('0x7')](_0x7760('0x21'),auth['isAuthenticated'](),controller[_0x7760('0x22')]);router['get'](_0x7760('0x23'),auth['isAuthenticated'](),controller[_0x7760('0x24')]);router[_0x7760('0x7')](_0x7760('0x25'),auth[_0x7760('0x8')](),controller[_0x7760('0x26')]);router[_0x7760('0x7')](_0x7760('0x27'),auth['isAuthenticated'](),controller[_0x7760('0x28')]);router[_0x7760('0x7')]('/:id/whatsapp/interactions',auth[_0x7760('0x8')](),controller[_0x7760('0x29')]);router[_0x7760('0x7')]('/:id/teams',auth[_0x7760('0x8')](),controller[_0x7760('0x2a')]);router['get'](_0x7760('0x2b'),auth['isAuthenticated'](),controller[_0x7760('0x2c')]);router[_0x7760('0x7')](_0x7760('0x2d'),auth[_0x7760('0x8')](),controller[_0x7760('0x2e')]);router[_0x7760('0x7')](_0x7760('0x2f'),auth[_0x7760('0x8')](),controller[_0x7760('0x30')]);router['get'](_0x7760('0x31'),auth[_0x7760('0x8')](),controller[_0x7760('0x32')]);router[_0x7760('0x7')](_0x7760('0x33'),auth[_0x7760('0x8')](),controller[_0x7760('0x34')]);router['get'](_0x7760('0x35'),auth['isAuthenticated'](),controller[_0x7760('0x36')]);router[_0x7760('0x7')](_0x7760('0x37'),auth[_0x7760('0x8')](),controller['getSmsAccounts']);router[_0x7760('0x7')](_0x7760('0x38'),auth[_0x7760('0x8')](),controller[_0x7760('0x39')]);router['get'](_0x7760('0x3a'),auth['isAuthenticated'](),controller[_0x7760('0x3b')]);router[_0x7760('0x7')](_0x7760('0x3c'),auth[_0x7760('0x8')](),controller[_0x7760('0x3d')]);router[_0x7760('0x7')](_0x7760('0x3e'),auth[_0x7760('0x8')](),controller[_0x7760('0x3f')]);router[_0x7760('0x7')]('/:id/api_key',auth[_0x7760('0x8')](),controller[_0x7760('0x40')]);router[_0x7760('0x41')](_0x7760('0x14'),auth['isAuthenticated'](),controller[_0x7760('0x42')]);router[_0x7760('0x41')]('/',auth[_0x7760('0x8')](),controller[_0x7760('0x43')]);router[_0x7760('0x41')](_0x7760('0x44'),auth['isAuthenticated'](),controller['bulkCreate']);router[_0x7760('0x41')](_0x7760('0x45'),auth[_0x7760('0x8')](),controller[_0x7760('0x46')]);var upload=multer({'storage':multer[_0x7760('0x47')]({'destination':function(_0x319e20,_0x45150c,_0x54caba){_0x54caba(null,path[_0x7760('0x48')](config[_0x7760('0x49')],_0x7760('0x4a')));},'filename':function(_0x4c5e95,_0x10f398,_0x7a292d){_0x7a292d(null,util['format']('%s-%s',Date[_0x7760('0x4b')](),_0x10f398[_0x7760('0x4c')]));}})});router[_0x7760('0x41')](_0x7760('0x4d'),upload['single'](_0x7760('0x4e')),controller[_0x7760('0x4f')]);router[_0x7760('0x41')](_0x7760('0x50'),auth[_0x7760('0x8')](),controller[_0x7760('0x51')]);router[_0x7760('0x41')](_0x7760('0x52'),auth[_0x7760('0x8')](),controller[_0x7760('0x53')]);router[_0x7760('0x41')](_0x7760('0x54'),auth['isAuthenticated'](),controller[_0x7760('0x55')]);router['post'](_0x7760('0x56'),auth['isAuthenticated'](),controller[_0x7760('0x57')]);router[_0x7760('0x41')](_0x7760('0x58'),auth['isAuthenticated'](),controller[_0x7760('0x59')]);router[_0x7760('0x41')](_0x7760('0x5a'),auth[_0x7760('0x8')](),controller['addChatInteractions']);router[_0x7760('0x41')]('/:id/mail_interactions',auth[_0x7760('0x8')](),controller[_0x7760('0x5b')]);router[_0x7760('0x41')]('/:id/fax_interactions',auth[_0x7760('0x8')](),controller[_0x7760('0x5c')]);router[_0x7760('0x41')](_0x7760('0x5d'),auth[_0x7760('0x8')](),controller[_0x7760('0x5e')]);router['post'](_0x7760('0x5f'),auth[_0x7760('0x8')](),controller['addOpenchannelInteractions']);router['post']('/:id/whatsapp_interactions',auth[_0x7760('0x8')](),controller[_0x7760('0x60')]);router[_0x7760('0x41')](_0x7760('0x31'),auth['isAuthenticated'](),controller[_0x7760('0x61')]);router[_0x7760('0x41')]('/:id/mail_accounts',auth[_0x7760('0x8')](),controller[_0x7760('0x62')]);router[_0x7760('0x41')](_0x7760('0x35'),auth[_0x7760('0x8')](),controller[_0x7760('0x63')]);router[_0x7760('0x41')](_0x7760('0x37'),auth[_0x7760('0x8')](),controller['addSmsAccounts']);router[_0x7760('0x41')](_0x7760('0x38'),auth[_0x7760('0x8')](),controller['addChatWebsites']);router[_0x7760('0x41')](_0x7760('0x3a'),auth[_0x7760('0x8')](),controller[_0x7760('0x64')]);router[_0x7760('0x41')](_0x7760('0x3c'),auth[_0x7760('0x8')](),controller[_0x7760('0x65')]);router['post'](_0x7760('0x66'),auth[_0x7760('0x8')](),controller[_0x7760('0x67')]);router[_0x7760('0x68')](_0x7760('0xf'),auth[_0x7760('0x8')](),controller[_0x7760('0x69')]);router['put']('/:id/password',auth[_0x7760('0x8')](),controller[_0x7760('0x6a')]);router['delete'](_0x7760('0x45'),auth[_0x7760('0x8')](),controller[_0x7760('0x6b')]);router[_0x7760('0x6c')](_0x7760('0x58'),auth[_0x7760('0x8')](),controller[_0x7760('0x6d')]);router['delete'](_0x7760('0xf'),auth[_0x7760('0x8')](),controller[_0x7760('0x6e')]);router[_0x7760('0x6c')]('/:id/chat_interactions',auth[_0x7760('0x8')](),controller[_0x7760('0x6f')]);router[_0x7760('0x6c')]('/:id/mail_interactions',auth[_0x7760('0x8')](),controller[_0x7760('0x70')]);router['delete'](_0x7760('0x71'),auth['isAuthenticated'](),controller['removeFaxInteractions']);router[_0x7760('0x6c')](_0x7760('0x5d'),auth[_0x7760('0x8')](),controller[_0x7760('0x72')]);router[_0x7760('0x6c')](_0x7760('0x5f'),auth[_0x7760('0x8')](),controller['removeOpenchannelInteractions']);router['delete'](_0x7760('0x73'),auth['isAuthenticated'](),controller[_0x7760('0x74')]);router[_0x7760('0x6c')](_0x7760('0x31'),auth[_0x7760('0x8')](),controller['removeFaxAccounts']);router['delete'](_0x7760('0x33'),auth[_0x7760('0x8')](),controller[_0x7760('0x75')]);router['delete']('/:id/openchannel_accounts',auth[_0x7760('0x8')](),controller[_0x7760('0x76')]);router[_0x7760('0x6c')]('/:id/sms_accounts',auth[_0x7760('0x8')](),controller[_0x7760('0x77')]);router[_0x7760('0x6c')](_0x7760('0x38'),auth[_0x7760('0x8')](),controller['removeChatWebsites']);router[_0x7760('0x6c')](_0x7760('0x3a'),auth[_0x7760('0x8')](),controller[_0x7760('0x78')]);router['delete'](_0x7760('0x3c'),auth['isAuthenticated'](),controller[_0x7760('0x79')]);router[_0x7760('0x6c')](_0x7760('0x66'),auth['isAuthenticated'](),controller[_0x7760('0x7a')]);module[_0x7760('0x7b')]=router; \ No newline at end of file +var _0x17d8=['/:id/agents','/:id/prefixes','getVoicePrefixes','/:id/fax_accounts','getFaxAccounts','/:id/mail_accounts','getMailAccounts','/:id/openchannel_accounts','/:id/sms_accounts','getSmsAccounts','/:id/chat_websites','getChatWebsites','/:id/square_projects','getSquareProjects','/:id/scheduled_calls','getScheduledCalls','/:id/api_key','getApiKey','addContacts','post','create','join','server/files/images/','format','originalname','file','login','/:id/logout','logout','/:id/pause','unpause','addTeams','/:id/chat_interactions','addChatInteractions','/:id/mail_interactions','addMailInteractions','/:id/fax_interactions','addFaxInteractions','/:id/sms_interactions','addSmsInteractions','/:id/openchannel_interactions','addOpenchannelInteractions','/:id/whatsapp_interactions','addWhatsappInteractions','addMailAccounts','addOpenchannelAccounts','addChatWebsites','addWhatsappAccounts','addSquareProjects','createApiKey','put','/:id/password','delete','removeQueues','removeTeams','destroy','removeChatInteractions','removeMailInteractions','removeFaxInteractions','removeSmsInteractions','removeOpenchannelInteractions','removeWhatsappInteractions','removeFaxAccounts','removeMailAccounts','removeSmsAccounts','removeChatWebsites','/:id/whatsapp_accounts','removeSquareProjects','removeApiKey','exports','multer','path','express','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','/describe','/presence','/:id','/:id/avatar','getAvatar','/:id/open_tabs','/:id/contacts','getContacts','/:id/queues','getQueues','/:id/groups','getGroups','/:id/recordings','getRecordings','getScreenRecordings','/:id/chat/interactions','/:id/openchannel/interactions','/:id/mail/interactions','getMailInteractions','getSmsInteractions','/:id/fax/interactions','getFaxInteractions','getWhatsappInteractions','/:id/teams'];(function(_0x290ce9,_0x387c7f){var _0x57f1b4=function(_0x2352a3){while(--_0x2352a3){_0x290ce9['push'](_0x290ce9['shift']());}};_0x57f1b4(++_0x387c7f);}(_0x17d8,0xac));var _0x817d=function(_0x390636,_0x156bce){_0x390636=_0x390636-0x0;var _0x4a6ae8=_0x17d8[_0x390636];return _0x4a6ae8;};'use strict';var multer=require(_0x817d('0x0'));var util=require('util');var path=require(_0x817d('0x1'));var timeout=require('connect-timeout');var express=require(_0x817d('0x2'));var router=express['Router']();var fs_extra=require(_0x817d('0x3'));var auth=require(_0x817d('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x817d('0x5'));var controller=require('./user.controller');router[_0x817d('0x6')]('/',auth[_0x817d('0x7')](),controller['index']);router[_0x817d('0x6')](_0x817d('0x8'),auth[_0x817d('0x7')](),controller['describe']);router[_0x817d('0x6')]('/whoami',auth[_0x817d('0x7')](),controller['whoami']);router[_0x817d('0x6')](_0x817d('0x9'),auth[_0x817d('0x7')](),controller['getPresence']);router[_0x817d('0x6')](_0x817d('0xa'),auth[_0x817d('0x7')](),controller['show']);router[_0x817d('0x6')](_0x817d('0xb'),controller[_0x817d('0xc')]);router[_0x817d('0x6')](_0x817d('0xd'),auth['isAuthenticated'](),controller['getOpenTabs']);router[_0x817d('0x6')](_0x817d('0xe'),auth['isAuthenticated'](),controller[_0x817d('0xf')]);router[_0x817d('0x6')](_0x817d('0x10'),auth[_0x817d('0x7')](),controller[_0x817d('0x11')]);router['get']('/:id/queues_rt',auth[_0x817d('0x7')](),controller['getVoiceQueuesRt']);router[_0x817d('0x6')](_0x817d('0x12'),auth['isAuthenticated'](),controller[_0x817d('0x13')]);router['get'](_0x817d('0x14'),auth['isAuthenticated'](),controller[_0x817d('0x15')]);router[_0x817d('0x6')]('/:id/screen_recordings',auth[_0x817d('0x7')](),controller[_0x817d('0x16')]);router['get'](_0x817d('0x17'),auth[_0x817d('0x7')](),controller['getChatInteractions']);router['get'](_0x817d('0x18'),auth[_0x817d('0x7')](),controller['getOpenchannelInteractions']);router[_0x817d('0x6')](_0x817d('0x19'),auth[_0x817d('0x7')](),controller[_0x817d('0x1a')]);router[_0x817d('0x6')]('/:id/sms/interactions',auth[_0x817d('0x7')](),controller[_0x817d('0x1b')]);router[_0x817d('0x6')](_0x817d('0x1c'),auth['isAuthenticated'](),controller[_0x817d('0x1d')]);router[_0x817d('0x6')]('/:id/whatsapp/interactions',auth[_0x817d('0x7')](),controller[_0x817d('0x1e')]);router[_0x817d('0x6')](_0x817d('0x1f'),auth[_0x817d('0x7')](),controller['getTeams']);router[_0x817d('0x6')]('/:id/lists',auth['isAuthenticated'](),controller['getLists']);router[_0x817d('0x6')](_0x817d('0x20'),auth[_0x817d('0x7')](),controller['getAgents']);router[_0x817d('0x6')](_0x817d('0x21'),auth['isAuthenticated'](),controller[_0x817d('0x22')]);router['get'](_0x817d('0x23'),auth['isAuthenticated'](),controller[_0x817d('0x24')]);router['get'](_0x817d('0x25'),auth[_0x817d('0x7')](),controller[_0x817d('0x26')]);router['get'](_0x817d('0x27'),auth[_0x817d('0x7')](),controller['getOpenchannelAccounts']);router[_0x817d('0x6')](_0x817d('0x28'),auth[_0x817d('0x7')](),controller[_0x817d('0x29')]);router[_0x817d('0x6')](_0x817d('0x2a'),auth[_0x817d('0x7')](),controller[_0x817d('0x2b')]);router[_0x817d('0x6')]('/:id/whatsapp_accounts',auth[_0x817d('0x7')](),controller['getWhatsappAccounts']);router[_0x817d('0x6')](_0x817d('0x2c'),auth[_0x817d('0x7')](),controller[_0x817d('0x2d')]);router[_0x817d('0x6')](_0x817d('0x2e'),auth[_0x817d('0x7')](),controller[_0x817d('0x2f')]);router[_0x817d('0x6')](_0x817d('0x30'),auth[_0x817d('0x7')](),controller[_0x817d('0x31')]);router['post']('/:id/contacts',auth[_0x817d('0x7')](),controller[_0x817d('0x32')]);router[_0x817d('0x33')]('/',auth[_0x817d('0x7')](),controller[_0x817d('0x34')]);router['post']('/create_many',auth[_0x817d('0x7')](),controller['bulkCreate']);router[_0x817d('0x33')]('/:id/queues',auth[_0x817d('0x7')](),controller['addQueues']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x2452a3,_0x364c55,_0x16d134){_0x16d134(null,path[_0x817d('0x35')](config['root'],_0x817d('0x36')));},'filename':function(_0xe5dbef,_0x148fb3,_0x48f5d2){_0x48f5d2(null,util[_0x817d('0x37')]('%s-%s',Date['now'](),_0x148fb3[_0x817d('0x38')]));}})});router[_0x817d('0x33')](_0x817d('0xb'),upload['single'](_0x817d('0x39')),controller['addAvatar']);router[_0x817d('0x33')]('/:id/login',auth[_0x817d('0x7')](),controller[_0x817d('0x3a')]);router[_0x817d('0x33')](_0x817d('0x3b'),auth[_0x817d('0x7')](),controller[_0x817d('0x3c')]);router[_0x817d('0x33')](_0x817d('0x3d'),auth[_0x817d('0x7')](),controller['pause']);router[_0x817d('0x33')]('/:id/unpause',auth[_0x817d('0x7')](),controller[_0x817d('0x3e')]);router['post'](_0x817d('0x1f'),auth['isAuthenticated'](),controller[_0x817d('0x3f')]);router[_0x817d('0x33')](_0x817d('0x40'),auth[_0x817d('0x7')](),controller[_0x817d('0x41')]);router[_0x817d('0x33')](_0x817d('0x42'),auth[_0x817d('0x7')](),controller[_0x817d('0x43')]);router[_0x817d('0x33')](_0x817d('0x44'),auth[_0x817d('0x7')](),controller[_0x817d('0x45')]);router['post'](_0x817d('0x46'),auth[_0x817d('0x7')](),controller[_0x817d('0x47')]);router[_0x817d('0x33')](_0x817d('0x48'),auth['isAuthenticated'](),controller[_0x817d('0x49')]);router[_0x817d('0x33')](_0x817d('0x4a'),auth['isAuthenticated'](),controller[_0x817d('0x4b')]);router[_0x817d('0x33')]('/:id/fax_accounts',auth[_0x817d('0x7')](),controller['addFaxAccounts']);router[_0x817d('0x33')](_0x817d('0x25'),auth[_0x817d('0x7')](),controller[_0x817d('0x4c')]);router[_0x817d('0x33')](_0x817d('0x27'),auth[_0x817d('0x7')](),controller[_0x817d('0x4d')]);router[_0x817d('0x33')](_0x817d('0x28'),auth[_0x817d('0x7')](),controller['addSmsAccounts']);router[_0x817d('0x33')]('/:id/chat_websites',auth[_0x817d('0x7')](),controller[_0x817d('0x4e')]);router[_0x817d('0x33')]('/:id/whatsapp_accounts',auth[_0x817d('0x7')](),controller[_0x817d('0x4f')]);router[_0x817d('0x33')]('/:id/square_projects',auth[_0x817d('0x7')](),controller[_0x817d('0x50')]);router[_0x817d('0x33')](_0x817d('0x30'),auth[_0x817d('0x7')](),controller[_0x817d('0x51')]);router[_0x817d('0x52')](_0x817d('0xa'),auth[_0x817d('0x7')](),controller['update']);router[_0x817d('0x52')](_0x817d('0x53'),auth[_0x817d('0x7')](),controller['changePassword']);router[_0x817d('0x54')](_0x817d('0x10'),auth[_0x817d('0x7')](),controller[_0x817d('0x55')]);router[_0x817d('0x54')](_0x817d('0x1f'),auth[_0x817d('0x7')](),controller[_0x817d('0x56')]);router[_0x817d('0x54')](_0x817d('0xa'),auth[_0x817d('0x7')](),controller[_0x817d('0x57')]);router[_0x817d('0x54')](_0x817d('0x40'),auth[_0x817d('0x7')](),controller[_0x817d('0x58')]);router[_0x817d('0x54')](_0x817d('0x42'),auth[_0x817d('0x7')](),controller[_0x817d('0x59')]);router[_0x817d('0x54')](_0x817d('0x44'),auth['isAuthenticated'](),controller[_0x817d('0x5a')]);router[_0x817d('0x54')](_0x817d('0x46'),auth['isAuthenticated'](),controller[_0x817d('0x5b')]);router[_0x817d('0x54')](_0x817d('0x48'),auth['isAuthenticated'](),controller[_0x817d('0x5c')]);router[_0x817d('0x54')](_0x817d('0x4a'),auth[_0x817d('0x7')](),controller[_0x817d('0x5d')]);router[_0x817d('0x54')](_0x817d('0x23'),auth[_0x817d('0x7')](),controller[_0x817d('0x5e')]);router[_0x817d('0x54')](_0x817d('0x25'),auth[_0x817d('0x7')](),controller[_0x817d('0x5f')]);router[_0x817d('0x54')](_0x817d('0x27'),auth['isAuthenticated'](),controller['removeOpenchannelAccounts']);router[_0x817d('0x54')](_0x817d('0x28'),auth['isAuthenticated'](),controller[_0x817d('0x60')]);router['delete'](_0x817d('0x2a'),auth[_0x817d('0x7')](),controller[_0x817d('0x61')]);router[_0x817d('0x54')](_0x817d('0x62'),auth[_0x817d('0x7')](),controller['removeWhatsappAccounts']);router['delete'](_0x817d('0x2c'),auth['isAuthenticated'](),controller[_0x817d('0x63')]);router[_0x817d('0x54')](_0x817d('0x30'),auth[_0x817d('0x7')](),controller[_0x817d('0x64')]);module[_0x817d('0x65')]=router; \ No newline at end of file diff --git a/server/api/user/user.attributes.js b/server/api/user/user.attributes.js index c933112..bcd3308 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 _0x9d56=['false','screenrecording','blocked','blockedAt','UNSIGNED','sequelize','moment','util','lodash','STRING','name','setDataValue','defaultuser','The\x20name\x20of\x20the\x20user','fullname','callerid','format','\x22%s\x22\x20<%s>','getDataValue','internal','email','toLowerCase','admin','user','agent','telephone','local','INTEGER','accountcode','BOOLEAN','DATE','peer','friend','from-sip','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB','udp','join','transport','split','ENUM','rfc2833','info','shortinfo','inband','auto','yes','nonat','update','outgoing','nat','all','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]','insecure','\x22\x22\x20<>','always','accept','refuse','originate','uas','fingerprint','certificate','active','passive','actpass','update,nonat','TEXT','showWebBar','get','isArray','wss','encryption','avpf','force_avp','icesupport','dtlsenable','dtlssetup','dtlscertfile','dtlsprivatekey','rtcp_mux','dtlsverify','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','permissions','map','VIRTUAL','phoneBarEnableScreenRecordingByAgent'];(function(_0x3e44fa,_0x75ed2a){var _0x2a0aba=function(_0x1db6a7){while(--_0x1db6a7){_0x3e44fa['push'](_0x3e44fa['shift']());}};_0x2a0aba(++_0x75ed2a);}(_0x9d56,0x122));var _0x69d5=function(_0x4c32e2,_0x852323){_0x4c32e2=_0x4c32e2-0x0;var _0x226366=_0x9d56[_0x4c32e2];return _0x226366;};'use strict';var Sequelize=require(_0x69d5('0x0'));var moment=require(_0x69d5('0x1'));var util=require(_0x69d5('0x2'));var _=require(_0x69d5('0x3'));module['exports']={'name':{'type':Sequelize[_0x69d5('0x4')],'allowNull':![],'unique':_0x69d5('0x5'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x19fdd4){this[_0x69d5('0x6')](_0x69d5('0x5'),_0x19fdd4);this['setDataValue'](_0x69d5('0x7'),_0x19fdd4);},'comment':_0x69d5('0x8')},'fullname':{'type':Sequelize[_0x69d5('0x4')],'allowNull':![],'set':function(_0x1ca8b8){this[_0x69d5('0x6')](_0x69d5('0x9'),_0x1ca8b8);this[_0x69d5('0x6')](_0x69d5('0xa'),util[_0x69d5('0xb')](_0x69d5('0xc'),_0x1ca8b8,this[_0x69d5('0xd')](_0x69d5('0xe'))));}},'alias':{'type':Sequelize[_0x69d5('0x4')]},'email':{'type':Sequelize[_0x69d5('0x4')],'allowNull':![],'unique':_0x69d5('0xf'),'validate':{'isEmail':!![]},'set':function(_0x1174c0){if(_0x1174c0){this[_0x69d5('0x6')](_0x69d5('0xf'),_0x1174c0[_0x69d5('0x10')]());}}},'role':{'type':Sequelize['ENUM'](_0x69d5('0x11'),_0x69d5('0x12'),_0x69d5('0x13'),_0x69d5('0x14')),'allowNull':![]},'password':{'type':Sequelize[_0x69d5('0x4')],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize['STRING'],'defaultValue':_0x69d5('0x15')},'internal':{'type':Sequelize[_0x69d5('0x16')](0xb),'allowNull':![],'unique':_0x69d5('0xe'),'set':function(_0x134e84){this['setDataValue']('internal',_0x134e84);this['setDataValue'](_0x69d5('0x17'),_0x134e84);this[_0x69d5('0x6')](_0x69d5('0xa'),util[_0x69d5('0xb')](_0x69d5('0xc'),this['getDataValue'](_0x69d5('0x9')),_0x134e84));}},'salt':{'type':Sequelize[_0x69d5('0x4')]},'phone':{'type':Sequelize[_0x69d5('0x4')]},'mobile':{'type':Sequelize[_0x69d5('0x4')]},'address':{'type':Sequelize[_0x69d5('0x4')]},'zipcode':{'type':Sequelize[_0x69d5('0x4')]},'userpic':{'type':Sequelize[_0x69d5('0x4')]},'city':{'type':Sequelize[_0x69d5('0x4')]},'country':{'type':Sequelize['STRING']},'online':{'type':Sequelize[_0x69d5('0x18')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize[_0x69d5('0x19')]},'voicePause':{'type':Sequelize[_0x69d5('0x18')],'defaultValue':![]},'chatPause':{'type':Sequelize[_0x69d5('0x18')],'defaultValue':![]},'mailPause':{'type':Sequelize[_0x69d5('0x18')],'defaultValue':![]},'faxPause':{'type':Sequelize[_0x69d5('0x18')],'defaultValue':![]},'smsPause':{'type':Sequelize[_0x69d5('0x18')],'defaultValue':![]},'whatsappPause':{'type':Sequelize[_0x69d5('0x18')],'defaultValue':![]},'openchannelPause':{'type':Sequelize[_0x69d5('0x18')],'defaultValue':![]},'pauseType':{'type':Sequelize['STRING'],'defaultValue':'DEFAULT\x20PAUSE'},'lastPauseAt':{'type':Sequelize[_0x69d5('0x19')]},'chatCapacity':{'type':Sequelize[_0x69d5('0x16')],'defaultValue':0x0},'mailCapacity':{'type':Sequelize[_0x69d5('0x16')],'defaultValue':0x0},'faxCapacity':{'type':Sequelize[_0x69d5('0x16')],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0x69d5('0x16')],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize[_0x69d5('0x16')],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize[_0x69d5('0x16')],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize[_0x69d5('0x18')],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize[_0x69d5('0x18')],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize['INTEGER'](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize[_0x69d5('0x16')](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize[_0x69d5('0x18')],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize[_0x69d5('0x16')],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize[_0x69d5('0x18')],'defaultValue':![]},'chanspy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'host':{'type':Sequelize[_0x69d5('0x4')],'allowNull':!![],'defaultValue':'dynamic'},'ipaddr':{'type':Sequelize[_0x69d5('0x4')],'allowNull':!![]},'port':{'type':Sequelize[_0x69d5('0x16')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize[_0x69d5('0x16')](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize['STRING'],'allowNull':!![]},'regserver':{'type':Sequelize[_0x69d5('0x4')],'allowNull':!![]},'useragent':{'type':Sequelize[_0x69d5('0x4')],'allowNull':!![]},'lastms':{'type':Sequelize[_0x69d5('0x16')](0xb),'allowNull':!![]},'type':{'type':Sequelize['ENUM']('friend',_0x69d5('0x12'),_0x69d5('0x1a')),'allowNull':!![],'defaultValue':_0x69d5('0x1b')},'context':{'type':Sequelize[_0x69d5('0x4')],'allowNull':!![],'defaultValue':_0x69d5('0x1c')},'callingpres':{'type':Sequelize['ENUM'](_0x69d5('0x1d'),_0x69d5('0x1e'),_0x69d5('0x1f'),_0x69d5('0x20'),_0x69d5('0x21'),_0x69d5('0x22'),_0x69d5('0x23'),_0x69d5('0x24')),'allowNull':!![]},'deny':{'type':Sequelize['STRING'],'allowNull':!![]},'permit':{'type':Sequelize[_0x69d5('0x4')],'allowNull':!![]},'secret':{'type':Sequelize[_0x69d5('0x4')],'allowNull':!![]},'md5secret':{'type':Sequelize['STRING'],'allowNull':!![]},'remotesecret':{'type':Sequelize[_0x69d5('0x4')],'allowNull':!![]},'transport':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x69d5('0x25'),'set':function(_0x36b999){this[_0x69d5('0x6')]('transport',_0x36b999?_0x36b999[_0x69d5('0x26')](','):null);},'get':function(){return this[_0x69d5('0xd')]('transport')?this[_0x69d5('0xd')](_0x69d5('0x27'))[_0x69d5('0x28')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]'},'dtmfmode':{'type':Sequelize[_0x69d5('0x29')](_0x69d5('0x2a'),_0x69d5('0x2b'),_0x69d5('0x2c'),_0x69d5('0x2d'),_0x69d5('0x2e')),'allowNull':!![],'defaultValue':_0x69d5('0x2a')},'directmedia':{'type':Sequelize[_0x69d5('0x29')](_0x69d5('0x2f'),'no',_0x69d5('0x30'),_0x69d5('0x31'),_0x69d5('0x32')),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x69d5('0x29')](_0x69d5('0x2f'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x69d5('0x4')],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0x69d5('0x4')],'allowNull':!![]},'nat':{'type':Sequelize[_0x69d5('0x4')],'allowNull':!![],'defaultValue':'force_rport,comedia','set':function(_0x1cc79d){this[_0x69d5('0x6')](_0x69d5('0x33'),_0x1cc79d?_0x1cc79d['join'](','):null);},'get':function(){return this[_0x69d5('0xd')](_0x69d5('0x33'))?this[_0x69d5('0xd')]('nat')[_0x69d5('0x28')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]'},'callgroup':{'type':Sequelize[_0x69d5('0x4')]},'namedcallgroup':{'type':Sequelize[_0x69d5('0x4')]},'pickupgroup':{'type':Sequelize[_0x69d5('0x4')]},'namedpickupgroup':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x69d5('0x4')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x69d5('0x4')]},'disallow':{'type':Sequelize[_0x69d5('0x4')],'allowNull':![],'defaultValue':_0x69d5('0x34')},'allow':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x69d5('0x35'),'set':function(_0x661bca){this[_0x69d5('0x6')](_0x69d5('0x36'),_0x661bca?_0x661bca[_0x69d5('0x26')](';'):_0x69d5('0x35'));},'get':function(){return this['getDataValue'](_0x69d5('0x36'))?this['getDataValue']('allow')[_0x69d5('0x28')](';'):null;},'comment':_0x69d5('0x37')},'autoframing':{'type':Sequelize[_0x69d5('0x29')](_0x69d5('0x2f'),'no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0x69d5('0x4')],'allowNull':!![],'set':function(_0x30fbaf){this[_0x69d5('0x6')](_0x69d5('0x38'),_0x30fbaf?_0x30fbaf[_0x69d5('0x26')](','):null);},'get':function(){return this[_0x69d5('0xd')](_0x69d5('0x38'))?this['getDataValue']('insecure')['split'](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]'},'trustrpid':{'type':Sequelize[_0x69d5('0x29')](_0x69d5('0x2f'),'no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x69d5('0x29')](_0x69d5('0x2f'),'no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x69d5('0x29')](_0x69d5('0x2f'),'no','never'),'allowNull':!![]},'promiscredir':{'type':Sequelize['ENUM'](_0x69d5('0x2f'),'no'),'allowNull':!![]},'useclientcode':{'type':Sequelize[_0x69d5('0x29')](_0x69d5('0x2f'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize[_0x69d5('0x16')](0xb),'allowNull':!![]},'setvar':{'type':Sequelize[_0x69d5('0x4')],'allowNull':!![]},'callerid':{'type':Sequelize[_0x69d5('0x4')],'allowNull':!![],'defaultValue':_0x69d5('0x39')},'amaflags':{'type':Sequelize[_0x69d5('0x4')],'allowNull':!![]},'callcounter':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![],'defaultValue':_0x69d5('0x2f')},'busylevel':{'type':Sequelize[_0x69d5('0x16')](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize[_0x69d5('0x29')](_0x69d5('0x2f'),'no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize[_0x69d5('0x29')](_0x69d5('0x2f'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0x69d5('0x29')](_0x69d5('0x2f'),'no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0x69d5('0x4')],'allowNull':!![]},'template':{'type':Sequelize[_0x69d5('0x4')],'allowNull':!![]},'videosupport':{'type':Sequelize[_0x69d5('0x29')](_0x69d5('0x2f'),'no',_0x69d5('0x3a')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x69d5('0x16')](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize[_0x69d5('0x29')](_0x69d5('0x2f'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize['STRING'],'allowNull':!![]},'session_timers':{'type':Sequelize[_0x69d5('0x29')](_0x69d5('0x3b'),_0x69d5('0x3c'),_0x69d5('0x3d')),'allowNull':!![]},'session_expires':{'type':Sequelize[_0x69d5('0x16')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0x69d5('0x29')]('uac',_0x69d5('0x3e')),'allowNull':!![],'defaultValue':_0x69d5('0x3e')},'t38pt_usertpsource':{'type':Sequelize[_0x69d5('0x4')],'allowNull':!![]},'regexten':{'type':Sequelize['STRING'],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0x69d5('0x4')],'allowNull':!![]},'fromuser':{'type':Sequelize[_0x69d5('0x4')],'allowNull':!![]},'qualify':{'type':Sequelize[_0x69d5('0x29')](_0x69d5('0x2f'),'no'),'allowNull':!![],'defaultValue':_0x69d5('0x2f')},'keepalive':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize[_0x69d5('0x4')],'allowNull':!![]},'defaultuser':{'type':Sequelize[_0x69d5('0x4')],'allowNull':!![]},'rtptimeout':{'type':Sequelize[_0x69d5('0x16')](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize[_0x69d5('0x16')](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0x69d5('0x16')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize[_0x69d5('0x29')](_0x69d5('0x2f'),'no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x69d5('0x4')],'allowNull':!![]},'callbackextension':{'type':Sequelize[_0x69d5('0x4')],'allowNull':!![]},'timert1':{'type':Sequelize[_0x69d5('0x16')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize[_0x69d5('0x16')](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize[_0x69d5('0x16')](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize[_0x69d5('0x4')],'allowNull':!![]},'contactdeny':{'type':Sequelize[_0x69d5('0x4')],'allowNull':!![]},'contactacl':{'type':Sequelize[_0x69d5('0x4')],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize[_0x69d5('0x4')],'allowNull':!![]},'use_q850_reason':{'type':Sequelize[_0x69d5('0x4')],'allowNull':!![]},'maxforwards':{'type':Sequelize[_0x69d5('0x16')](0xb),'allowNull':!![]},'encryption':{'type':Sequelize[_0x69d5('0x29')](_0x69d5('0x2f'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize[_0x69d5('0x29')]('yes','no'),'allowNull':!![]},'force_avp':{'type':Sequelize[_0x69d5('0x29')](_0x69d5('0x2f'),'no'),'allowNull':!![]},'icesupport':{'type':Sequelize['ENUM'](_0x69d5('0x2f'),'no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize['ENUM'](_0x69d5('0x2f'),'no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize[_0x69d5('0x29')](_0x69d5('0x2f'),'no',_0x69d5('0x3f'),_0x69d5('0x40')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize[_0x69d5('0x16')](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0x69d5('0x4')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlscipher':{'type':Sequelize[_0x69d5('0x4')],'allowNull':!![]},'dtlscafile':{'type':Sequelize[_0x69d5('0x4')],'allowNull':!![]},'dtlscapath':{'type':Sequelize[_0x69d5('0x4')],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0x69d5('0x29')](_0x69d5('0x41'),_0x69d5('0x42'),_0x69d5('0x43')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize['STRING'],'allowNull':!![]},'usereqphone':{'type':Sequelize['ENUM'](_0x69d5('0x2f'),'no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x69d5('0x4')],'allowNull':!![]},'recordofffeature':{'type':Sequelize[_0x69d5('0x4')],'allowNull':!![]},'call_limit':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize[_0x69d5('0x29')](_0x69d5('0x2f'),'no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0x69d5('0x29')](_0x69d5('0x2f'),'no'),'allowNull':!![]},'vmexten':{'type':Sequelize[_0x69d5('0x4')],'allowNull':!![]},'mohinterpret':{'type':Sequelize['STRING'],'allowNull':!![]},'mohsuggest':{'type':Sequelize[_0x69d5('0x4')],'allowNull':!![]},'parkinglot':{'type':Sequelize[_0x69d5('0x4')],'allowNull':!![]},'canreinvite':{'type':Sequelize[_0x69d5('0x29')](_0x69d5('0x2f'),'no',_0x69d5('0x30'),_0x69d5('0x31'),_0x69d5('0x44')),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0x69d5('0x18')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize[_0x69d5('0x4')]},'resetPasswordExpires':{'type':Sequelize[_0x69d5('0x19')]},'passwordResetAt':{'type':Sequelize['DATE'],'defaultValue':null},'previousPasswords':{'type':Sequelize[_0x69d5('0x45')]},'showWebBar':{'type':Sequelize[_0x69d5('0x16')],'defaultValue':0x0,'set':function(_0x18593a){this['setDataValue'](_0x69d5('0x46'),_0x18593a);var _0x18ab59=this[_0x69d5('0x47')]({'plain':!![]});switch(_0x18593a){case 0x0:case 0x1:var _0x5bb04e=_0x18ab59[_0x69d5('0x27')]?_[_0x69d5('0x48')](_0x18ab59[_0x69d5('0x27')])?_0x18ab59[_0x69d5('0x27')][_0x69d5('0x26')]():_0x18ab59[_0x69d5('0x27')]:_0x69d5('0x25');if(_0x5bb04e===_0x69d5('0x49')){_0x5bb04e=_0x69d5('0x25');}this[_0x69d5('0x6')]('transport',_0x5bb04e);this[_0x69d5('0x6')](_0x69d5('0x4a'),'no');this[_0x69d5('0x6')](_0x69d5('0x4b'),null);this[_0x69d5('0x6')](_0x69d5('0x4c'),null);this[_0x69d5('0x6')](_0x69d5('0x4d'),null);this[_0x69d5('0x6')](_0x69d5('0x4e'),null);this[_0x69d5('0x6')]('dtlsverify',null);this[_0x69d5('0x6')](_0x69d5('0x4f'),null);this[_0x69d5('0x6')](_0x69d5('0x50'),null);this[_0x69d5('0x6')](_0x69d5('0x51'),null);this[_0x69d5('0x6')](_0x69d5('0x52'),'no');break;case 0x2:this[_0x69d5('0x6')](_0x69d5('0x27'),_0x69d5('0x49'));this[_0x69d5('0x6')]('encryption',_0x69d5('0x2f'));this['setDataValue'](_0x69d5('0x4b'),_0x69d5('0x2f'));this[_0x69d5('0x6')](_0x69d5('0x4c'),_0x69d5('0x2f'));this['setDataValue']('icesupport',_0x69d5('0x2f'));this['setDataValue'](_0x69d5('0x4e'),'yes');this[_0x69d5('0x6')](_0x69d5('0x53'),'no');this[_0x69d5('0x6')](_0x69d5('0x4f'),_0x69d5('0x43'));this['setDataValue'](_0x69d5('0x50'),_0x18ab59[_0x69d5('0x50')]||_0x69d5('0x54'));this[_0x69d5('0x6')]('dtlsprivatekey',_0x18ab59[_0x69d5('0x51')]||_0x69d5('0x55'));this['setDataValue']('rtcp_mux',_0x69d5('0x2f'));break;default:}}},'permissions':{'type':Sequelize['TEXT'],'set':function(_0x1e7338){this[_0x69d5('0x6')](_0x69d5('0x56'),_0x1e7338?_0x1e7338[_0x69d5('0x26')](','):[]);},'get':function(){return this[_0x69d5('0xd')](_0x69d5('0x56'))?_[_0x69d5('0x57')](this[_0x69d5('0xd')]('permissions')[_0x69d5('0x28')](','),function(_0x3d2624){return parseInt(_0x3d2624,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize[_0x69d5('0x4')]},'phoneBarNoReplyNumber':{'type':Sequelize['STRING']},'phoneBarBusyNumber':{'type':Sequelize[_0x69d5('0x4')]},'phoneBarUnconditional':{'type':Sequelize[_0x69d5('0x18')],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize[_0x69d5('0x18')],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize[_0x69d5('0x18')],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0x69d5('0x4')],'defaultValue':''},'crudPermissions':{'type':Sequelize[_0x69d5('0x16')],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize['ENUM'](_0x69d5('0x2f'),'no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0x69d5('0x18')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize[_0x69d5('0x4')]},'phoneBarEnableJaws':{'type':Sequelize[_0x69d5('0x18')],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0x69d5('0x18')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize[_0x69d5('0x58')],'get':function(){return this['getDataValue']('phoneBarEnableScreenRecordingByAgent')?this[_0x69d5('0xd')](_0x69d5('0x59')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0x69d5('0x18')],'defaultValue':![]},'hotdesk':{'type':Sequelize[_0x69d5('0x18')],'defaultValue':![]},'interface':{'type':Sequelize[_0x69d5('0x4')],'defaultValue':null},'privacyEnabled':{'type':Sequelize[_0x69d5('0x18')],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize[_0x69d5('0x4')],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0x69d5('0x4')],'allowNull':!![]},'screenrecording':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'set':function(_0x46ad4d){if(typeof _0x46ad4d==='string'){var _0x5774b7=_0x46ad4d==='1'?!![]:_0x46ad4d==='0'?![]:_0x46ad4d==='true'?!![]:_0x46ad4d===_0x69d5('0x5a')?![]:![];this['setDataValue']('screenrecording',_0x5774b7);}else{this[_0x69d5('0x6')](_0x69d5('0x5b'),_0x46ad4d);}}},'blocked':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'set':function(_0x26b53a){this[_0x69d5('0x6')](_0x69d5('0x5c'),_0x26b53a);if(_0x26b53a===!![]){this['setDataValue'](_0x69d5('0x5d'),moment());this[_0x69d5('0x6')]('loginAttempts',0x0);}else{this[_0x69d5('0x6')](_0x69d5('0x5d'),null);}}},'blockedAt':{'type':Sequelize['DATE'],'defaultValue':null},'loginAttempts':{'type':Sequelize[_0x69d5('0x16')],'defaultValue':0x0},'disabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'settingsEnabled':{'type':Sequelize[_0x69d5('0x18')],'defaultValue':!![]},'wssPort':{'type':Sequelize[_0x69d5('0x16')](0x5)[_0x69d5('0x5e')],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize[_0x69d5('0x18')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x69d5('0x18')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0x69d5('0x18')],'defaultValue':!![]}}; \ No newline at end of file +var _0x5a5a=['moment','util','lodash','exports','STRING','setDataValue','name','The\x20name\x20of\x20the\x20user','fullname','callerid','format','getDataValue','internal','email','toLowerCase','ENUM','admin','user','telephone','local','INTEGER','accountcode','\x22%s\x22\x20<%s>','BOOLEAN','DATE','dynamic','friend','peer','from-sip','ALLOWED_NOT_SCREENED','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB','transport','join','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','shortinfo','inband','auto','yes','nonat','update','outgoing','nat','all','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','always','accept','refuse','originate','uas','fingerprint','certificate','active','passive','update,nonat','showWebBar','get','isArray','wss','udp','encryption','avpf','force_avp','icesupport','dtlsverify','dtlssetup','dtlscertfile','dtlsprivatekey','rtcp_mux','dtlsenable','actpass','/etc/pki/tls/certs/motion.crt','TEXT','map','permissions','VIRTUAL','phoneBarEnableScreenRecordingByAgent','string','true','false','screenrecording','loginAttempts','blockedAt','UNSIGNED'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x5a5a,0x1d1));var _0xa5a5=function(_0x225c0c,_0x5071b1){_0x225c0c=_0x225c0c-0x0;var _0x7d45e6=_0x5a5a[_0x225c0c];return _0x7d45e6;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xa5a5('0x0'));var util=require(_0xa5a5('0x1'));var _=require(_0xa5a5('0x2'));module[_0xa5a5('0x3')]={'name':{'type':Sequelize[_0xa5a5('0x4')],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x1e6eca){this[_0xa5a5('0x5')](_0xa5a5('0x6'),_0x1e6eca);this['setDataValue']('defaultuser',_0x1e6eca);},'comment':_0xa5a5('0x7')},'fullname':{'type':Sequelize[_0xa5a5('0x4')],'allowNull':![],'set':function(_0x5691f1){this[_0xa5a5('0x5')](_0xa5a5('0x8'),_0x5691f1);this[_0xa5a5('0x5')](_0xa5a5('0x9'),util[_0xa5a5('0xa')]('\x22%s\x22\x20<%s>',_0x5691f1,this[_0xa5a5('0xb')](_0xa5a5('0xc'))));}},'alias':{'type':Sequelize[_0xa5a5('0x4')]},'email':{'type':Sequelize[_0xa5a5('0x4')],'allowNull':![],'unique':_0xa5a5('0xd'),'validate':{'isEmail':!![]},'set':function(_0x1b4247){if(_0x1b4247){this[_0xa5a5('0x5')](_0xa5a5('0xd'),_0x1b4247[_0xa5a5('0xe')]());}}},'role':{'type':Sequelize[_0xa5a5('0xf')](_0xa5a5('0x10'),_0xa5a5('0x11'),'agent',_0xa5a5('0x12')),'allowNull':![]},'password':{'type':Sequelize[_0xa5a5('0x4')],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize[_0xa5a5('0x4')],'defaultValue':_0xa5a5('0x13')},'internal':{'type':Sequelize[_0xa5a5('0x14')](0xb),'allowNull':![],'unique':_0xa5a5('0xc'),'set':function(_0x5d71e4){this[_0xa5a5('0x5')](_0xa5a5('0xc'),_0x5d71e4);this[_0xa5a5('0x5')](_0xa5a5('0x15'),_0x5d71e4);this[_0xa5a5('0x5')](_0xa5a5('0x9'),util[_0xa5a5('0xa')](_0xa5a5('0x16'),this['getDataValue'](_0xa5a5('0x8')),_0x5d71e4));}},'salt':{'type':Sequelize[_0xa5a5('0x4')]},'phone':{'type':Sequelize[_0xa5a5('0x4')]},'mobile':{'type':Sequelize[_0xa5a5('0x4')]},'address':{'type':Sequelize[_0xa5a5('0x4')]},'zipcode':{'type':Sequelize[_0xa5a5('0x4')]},'userpic':{'type':Sequelize[_0xa5a5('0x4')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0xa5a5('0x4')]},'online':{'type':Sequelize[_0xa5a5('0x17')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize[_0xa5a5('0x18')]},'voicePause':{'type':Sequelize[_0xa5a5('0x17')],'defaultValue':![]},'chatPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'mailPause':{'type':Sequelize[_0xa5a5('0x17')],'defaultValue':![]},'faxPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'smsPause':{'type':Sequelize[_0xa5a5('0x17')],'defaultValue':![]},'whatsappPause':{'type':Sequelize[_0xa5a5('0x17')],'defaultValue':![]},'openchannelPause':{'type':Sequelize[_0xa5a5('0x17')],'defaultValue':![]},'pauseType':{'type':Sequelize[_0xa5a5('0x4')],'defaultValue':'DEFAULT\x20PAUSE'},'lastPauseAt':{'type':Sequelize['DATE']},'chatCapacity':{'type':Sequelize[_0xa5a5('0x14')],'defaultValue':0x0},'mailCapacity':{'type':Sequelize[_0xa5a5('0x14')],'defaultValue':0x0},'faxCapacity':{'type':Sequelize[_0xa5a5('0x14')],'defaultValue':0x0},'smsCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize[_0xa5a5('0x14')],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize[_0xa5a5('0x17')],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize['INTEGER'](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize[_0xa5a5('0x14')](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize[_0xa5a5('0x17')],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize[_0xa5a5('0x14')],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize[_0xa5a5('0x17')],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'chanspy':{'type':Sequelize[_0xa5a5('0x17')],'defaultValue':![]},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'host':{'type':Sequelize[_0xa5a5('0x4')],'allowNull':!![],'defaultValue':_0xa5a5('0x19')},'ipaddr':{'type':Sequelize['STRING'],'allowNull':!![]},'port':{'type':Sequelize['INTEGER'](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize[_0xa5a5('0x14')](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize[_0xa5a5('0x4')],'allowNull':!![]},'regserver':{'type':Sequelize['STRING'],'allowNull':!![]},'useragent':{'type':Sequelize['STRING'],'allowNull':!![]},'lastms':{'type':Sequelize[_0xa5a5('0x14')](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0xa5a5('0xf')](_0xa5a5('0x1a'),_0xa5a5('0x11'),_0xa5a5('0x1b')),'allowNull':!![],'defaultValue':_0xa5a5('0x1a')},'context':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0xa5a5('0x1c')},'callingpres':{'type':Sequelize['ENUM'](_0xa5a5('0x1d'),'ALLOWED_PASSED_SCREEN',_0xa5a5('0x1e'),_0xa5a5('0x1f'),'PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN',_0xa5a5('0x20')),'allowNull':!![]},'deny':{'type':Sequelize['STRING'],'allowNull':!![]},'permit':{'type':Sequelize[_0xa5a5('0x4')],'allowNull':!![]},'secret':{'type':Sequelize[_0xa5a5('0x4')],'allowNull':!![]},'md5secret':{'type':Sequelize['STRING'],'allowNull':!![]},'remotesecret':{'type':Sequelize[_0xa5a5('0x4')],'allowNull':!![]},'transport':{'type':Sequelize[_0xa5a5('0x4')],'allowNull':!![],'defaultValue':'udp','set':function(_0x2db22d){this[_0xa5a5('0x5')](_0xa5a5('0x21'),_0x2db22d?_0x2db22d[_0xa5a5('0x22')](','):null);},'get':function(){return this[_0xa5a5('0xb')](_0xa5a5('0x21'))?this[_0xa5a5('0xb')]('transport')[_0xa5a5('0x23')](','):null;},'comment':_0xa5a5('0x24')},'dtmfmode':{'type':Sequelize[_0xa5a5('0xf')](_0xa5a5('0x25'),_0xa5a5('0x26'),_0xa5a5('0x27'),_0xa5a5('0x28'),_0xa5a5('0x29')),'allowNull':!![],'defaultValue':_0xa5a5('0x25')},'directmedia':{'type':Sequelize[_0xa5a5('0xf')](_0xa5a5('0x2a'),'no',_0xa5a5('0x2b'),_0xa5a5('0x2c'),_0xa5a5('0x2d')),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0xa5a5('0xf')](_0xa5a5('0x2a'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0xa5a5('0x4')],'allowNull':!![]},'directmediadeny':{'type':Sequelize['STRING'],'allowNull':!![]},'nat':{'type':Sequelize[_0xa5a5('0x4')],'allowNull':!![],'defaultValue':'force_rport,comedia','set':function(_0x49c55d){this['setDataValue'](_0xa5a5('0x2e'),_0x49c55d?_0x49c55d['join'](','):null);},'get':function(){return this[_0xa5a5('0xb')](_0xa5a5('0x2e'))?this[_0xa5a5('0xb')]('nat')[_0xa5a5('0x23')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]'},'callgroup':{'type':Sequelize['STRING']},'namedcallgroup':{'type':Sequelize[_0xa5a5('0x4')]},'pickupgroup':{'type':Sequelize[_0xa5a5('0x4')]},'namedpickupgroup':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0xa5a5('0x4')],'defaultValue':'en'},'tonezone':{'type':Sequelize['STRING']},'disallow':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xa5a5('0x2f')},'allow':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xa5a5('0x30'),'set':function(_0x53fe36){this[_0xa5a5('0x5')](_0xa5a5('0x31'),_0x53fe36?_0x53fe36[_0xa5a5('0x22')](';'):_0xa5a5('0x30'));},'get':function(){return this[_0xa5a5('0xb')](_0xa5a5('0x31'))?this[_0xa5a5('0xb')](_0xa5a5('0x31'))[_0xa5a5('0x23')](';'):null;},'comment':_0xa5a5('0x32')},'autoframing':{'type':Sequelize['ENUM'](_0xa5a5('0x2a'),'no'),'allowNull':!![]},'insecure':{'type':Sequelize['STRING'],'allowNull':!![],'set':function(_0x1054f9){this[_0xa5a5('0x5')]('insecure',_0x1054f9?_0x1054f9[_0xa5a5('0x22')](','):null);},'get':function(){return this[_0xa5a5('0xb')](_0xa5a5('0x33'))?this[_0xa5a5('0xb')](_0xa5a5('0x33'))['split'](','):null;},'comment':_0xa5a5('0x34')},'trustrpid':{'type':Sequelize[_0xa5a5('0xf')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0xa5a5('0xf')](_0xa5a5('0x2a'),'no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0xa5a5('0xf')](_0xa5a5('0x2a'),'no',_0xa5a5('0x35')),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0xa5a5('0xf')](_0xa5a5('0x2a'),'no'),'allowNull':!![]},'useclientcode':{'type':Sequelize['ENUM'](_0xa5a5('0x2a'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'setvar':{'type':Sequelize[_0xa5a5('0x4')],'allowNull':!![]},'callerid':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':'\x22\x22\x20<>'},'amaflags':{'type':Sequelize[_0xa5a5('0x4')],'allowNull':!![]},'callcounter':{'type':Sequelize[_0xa5a5('0xf')](_0xa5a5('0x2a'),'no'),'allowNull':!![],'defaultValue':'yes'},'busylevel':{'type':Sequelize[_0xa5a5('0x14')](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize[_0xa5a5('0xf')](_0xa5a5('0x2a'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0xa5a5('0xf')]('yes','no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0xa5a5('0xf')]('yes','no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize['STRING'],'allowNull':!![]},'template':{'type':Sequelize[_0xa5a5('0x4')],'allowNull':!![]},'videosupport':{'type':Sequelize[_0xa5a5('0xf')](_0xa5a5('0x2a'),'no',_0xa5a5('0x36')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0xa5a5('0x14')](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize[_0xa5a5('0xf')](_0xa5a5('0x2a'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0xa5a5('0x4')],'allowNull':!![]},'session_timers':{'type':Sequelize['ENUM'](_0xa5a5('0x37'),_0xa5a5('0x38'),_0xa5a5('0x39')),'allowNull':!![]},'session_expires':{'type':Sequelize[_0xa5a5('0x14')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize[_0xa5a5('0x14')](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0xa5a5('0xf')]('uac',_0xa5a5('0x3a')),'allowNull':!![],'defaultValue':_0xa5a5('0x3a')},'t38pt_usertpsource':{'type':Sequelize['STRING'],'allowNull':!![]},'regexten':{'type':Sequelize[_0xa5a5('0x4')],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0xa5a5('0x4')],'allowNull':!![]},'fromuser':{'type':Sequelize[_0xa5a5('0x4')],'allowNull':!![]},'qualify':{'type':Sequelize['ENUM'](_0xa5a5('0x2a'),'no'),'allowNull':!![],'defaultValue':_0xa5a5('0x2a')},'keepalive':{'type':Sequelize[_0xa5a5('0x14')](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize[_0xa5a5('0x4')],'allowNull':!![]},'defaultuser':{'type':Sequelize['STRING'],'allowNull':!![]},'rtptimeout':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize[_0xa5a5('0x14')](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0xa5a5('0x14')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize[_0xa5a5('0xf')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0xa5a5('0x4')],'allowNull':!![]},'callbackextension':{'type':Sequelize[_0xa5a5('0x4')],'allowNull':!![]},'timert1':{'type':Sequelize[_0xa5a5('0x14')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize[_0xa5a5('0x14')](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize[_0xa5a5('0x14')](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize[_0xa5a5('0x4')],'allowNull':!![]},'contactdeny':{'type':Sequelize[_0xa5a5('0x4')],'allowNull':!![]},'contactacl':{'type':Sequelize['STRING'],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize[_0xa5a5('0x4')],'allowNull':!![]},'use_q850_reason':{'type':Sequelize[_0xa5a5('0x4')],'allowNull':!![]},'maxforwards':{'type':Sequelize[_0xa5a5('0x14')](0xb),'allowNull':!![]},'encryption':{'type':Sequelize[_0xa5a5('0xf')](_0xa5a5('0x2a'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize[_0xa5a5('0xf')]('yes','no'),'allowNull':!![]},'force_avp':{'type':Sequelize[_0xa5a5('0xf')](_0xa5a5('0x2a'),'no'),'allowNull':!![]},'icesupport':{'type':Sequelize[_0xa5a5('0xf')]('yes','no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize[_0xa5a5('0xf')](_0xa5a5('0x2a'),'no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize['ENUM'](_0xa5a5('0x2a'),'no',_0xa5a5('0x3b'),_0xa5a5('0x3c')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize[_0xa5a5('0x14')](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlscipher':{'type':Sequelize[_0xa5a5('0x4')],'allowNull':!![]},'dtlscafile':{'type':Sequelize[_0xa5a5('0x4')],'allowNull':!![]},'dtlscapath':{'type':Sequelize[_0xa5a5('0x4')],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0xa5a5('0xf')](_0xa5a5('0x3d'),_0xa5a5('0x3e'),'actpass'),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize['STRING'],'allowNull':!![]},'usereqphone':{'type':Sequelize[_0xa5a5('0xf')](_0xa5a5('0x2a'),'no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0xa5a5('0x4')],'allowNull':!![]},'recordofffeature':{'type':Sequelize['STRING'],'allowNull':!![]},'call_limit':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize['ENUM'](_0xa5a5('0x2a'),'no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0xa5a5('0xf')](_0xa5a5('0x2a'),'no'),'allowNull':!![]},'vmexten':{'type':Sequelize[_0xa5a5('0x4')],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0xa5a5('0x4')],'allowNull':!![]},'mohsuggest':{'type':Sequelize[_0xa5a5('0x4')],'allowNull':!![]},'parkinglot':{'type':Sequelize[_0xa5a5('0x4')],'allowNull':!![]},'canreinvite':{'type':Sequelize[_0xa5a5('0xf')](_0xa5a5('0x2a'),'no',_0xa5a5('0x2b'),'update',_0xa5a5('0x3f')),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize[_0xa5a5('0x4')]},'resetPasswordExpires':{'type':Sequelize[_0xa5a5('0x18')]},'passwordResetAt':{'type':Sequelize[_0xa5a5('0x18')],'defaultValue':null},'previousPasswords':{'type':Sequelize['TEXT']},'showWebBar':{'type':Sequelize[_0xa5a5('0x14')],'defaultValue':0x0,'set':function(_0x380dae){this['setDataValue'](_0xa5a5('0x40'),_0x380dae);var _0x3b6aff=this[_0xa5a5('0x41')]({'plain':!![]});switch(_0x380dae){case 0x0:case 0x1:var _0x19910c=_0x3b6aff[_0xa5a5('0x21')]?_[_0xa5a5('0x42')](_0x3b6aff[_0xa5a5('0x21')])?_0x3b6aff[_0xa5a5('0x21')][_0xa5a5('0x22')]():_0x3b6aff[_0xa5a5('0x21')]:'udp';if(_0x19910c===_0xa5a5('0x43')){_0x19910c=_0xa5a5('0x44');}this[_0xa5a5('0x5')]('transport',_0x19910c);this[_0xa5a5('0x5')](_0xa5a5('0x45'),'no');this[_0xa5a5('0x5')](_0xa5a5('0x46'),null);this[_0xa5a5('0x5')](_0xa5a5('0x47'),null);this[_0xa5a5('0x5')](_0xa5a5('0x48'),null);this[_0xa5a5('0x5')]('dtlsenable',null);this['setDataValue'](_0xa5a5('0x49'),null);this[_0xa5a5('0x5')](_0xa5a5('0x4a'),null);this['setDataValue'](_0xa5a5('0x4b'),null);this['setDataValue'](_0xa5a5('0x4c'),null);this[_0xa5a5('0x5')](_0xa5a5('0x4d'),'no');break;case 0x2:this[_0xa5a5('0x5')]('transport','wss');this[_0xa5a5('0x5')](_0xa5a5('0x45'),'yes');this[_0xa5a5('0x5')](_0xa5a5('0x46'),_0xa5a5('0x2a'));this[_0xa5a5('0x5')]('force_avp','yes');this[_0xa5a5('0x5')]('icesupport',_0xa5a5('0x2a'));this[_0xa5a5('0x5')](_0xa5a5('0x4e'),_0xa5a5('0x2a'));this['setDataValue'](_0xa5a5('0x49'),'no');this['setDataValue'](_0xa5a5('0x4a'),_0xa5a5('0x4f'));this[_0xa5a5('0x5')](_0xa5a5('0x4b'),_0x3b6aff[_0xa5a5('0x4b')]||_0xa5a5('0x50'));this[_0xa5a5('0x5')]('dtlsprivatekey',_0x3b6aff[_0xa5a5('0x4c')]||'/etc/pki/tls/private/motion.key');this[_0xa5a5('0x5')](_0xa5a5('0x4d'),_0xa5a5('0x2a'));break;default:}}},'permissions':{'type':Sequelize[_0xa5a5('0x51')],'set':function(_0x20500c){this[_0xa5a5('0x5')]('permissions',_0x20500c?_0x20500c[_0xa5a5('0x22')](','):[]);},'get':function(){return this[_0xa5a5('0xb')]('permissions')?_[_0xa5a5('0x52')](this[_0xa5a5('0xb')](_0xa5a5('0x53'))[_0xa5a5('0x23')](','),function(_0x49e6c1){return parseInt(_0x49e6c1,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize[_0xa5a5('0x4')]},'phoneBarNoReplyNumber':{'type':Sequelize[_0xa5a5('0x4')]},'phoneBarBusyNumber':{'type':Sequelize[_0xa5a5('0x4')]},'phoneBarUnconditional':{'type':Sequelize[_0xa5a5('0x17')],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize[_0xa5a5('0x17')],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0xa5a5('0x17')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize[_0xa5a5('0x17')],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize[_0xa5a5('0x14')],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize['STRING'],'defaultValue':''},'crudPermissions':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0xa5a5('0xf')]('yes','no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0xa5a5('0x17')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize[_0xa5a5('0x4')]},'phoneBarEnableJaws':{'type':Sequelize[_0xa5a5('0x17')],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize[_0xa5a5('0x54')],'get':function(){return this[_0xa5a5('0xb')](_0xa5a5('0x55'))?this[_0xa5a5('0xb')](_0xa5a5('0x55')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize[_0xa5a5('0x17')],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hotdesk':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'interface':{'type':Sequelize[_0xa5a5('0x4')],'defaultValue':null},'privacyEnabled':{'type':Sequelize[_0xa5a5('0x17')],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize[_0xa5a5('0x4')],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0xa5a5('0x4')],'allowNull':!![]},'screenrecording':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'set':function(_0x84cf3e){if(typeof _0x84cf3e===_0xa5a5('0x56')){var _0x4da43e=_0x84cf3e==='1'?!![]:_0x84cf3e==='0'?![]:_0x84cf3e===_0xa5a5('0x57')?!![]:_0x84cf3e===_0xa5a5('0x58')?![]:![];this[_0xa5a5('0x5')](_0xa5a5('0x59'),_0x4da43e);}else{this[_0xa5a5('0x5')]('screenrecording',_0x84cf3e);}}},'blocked':{'type':Sequelize[_0xa5a5('0x17')],'defaultValue':![],'set':function(_0x104fe7){this['setDataValue']('blocked',_0x104fe7);if(_0x104fe7===!![]){this[_0xa5a5('0x5')]('blockedAt',moment());this[_0xa5a5('0x5')](_0xa5a5('0x5a'),0x0);}else{this[_0xa5a5('0x5')](_0xa5a5('0x5b'),null);}}},'blockedAt':{'type':Sequelize[_0xa5a5('0x18')],'defaultValue':null},'loginAttempts':{'type':Sequelize[_0xa5a5('0x14')],'defaultValue':0x0},'disabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'settingsEnabled':{'type':Sequelize[_0xa5a5('0x17')],'defaultValue':!![]},'wssPort':{'type':Sequelize[_0xa5a5('0x14')](0x5)[_0xa5a5('0x5c')],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize[_0xa5a5('0x17')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0xa5a5('0x17')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0xa5a5('0x17')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/user/user.controller.js b/server/api/user/user.controller.js index f85b55e..756d5a3 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 _0x896e=['SmsAccount','addSmsAccounts','removeSmsAccounts','getChatWebsites','addChatWebsites','removeChatWebsites','WhatsappAccount','getWhatsappAccounts','addWhatsappAccounts','removeWhatsappAccounts','getSquareProjects','SquareProject','addSquareProjects','removeSquareProjects','getScheduledCalls','concat','$gte','$lt','$lte','$not','$between','$notBetween','$in','$like','$notLike','$iLike','$overlap','$contains','$contained','CmHopper','firstName','lastName','phone','Contact','dialActive','VoiceQueue','getApiKey','retrieveApiKey','token','No\x20API\x20access\x20key\x20found!','createApiKey','generateApiKey','iat','nonce','removeApiKey','apiKeyNonce','apiKeyIat','You\x20don\x27t\x20have\x20sufficient\x20privileges\x20to\x20access\x20this\x20resource.','whoami','getPresence','teams','queues','inbound','lower','col','toString','asc','desc','substring','uniqBy','orderBy','client','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','ringing','busy','slice','charAt','toUpperCase','QueryTypes','field','ui.','InteractionId','_interactions','ui.UserId\x20=\x20?','OpenTabs','moment','bluebird','util','path','lodash','squel','jayson/promise','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','socket.io-emitter','redis','register','defaults','localhost','http','request','info','User,\x20%s,\x20%s','debug','User,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','destroy','then','get','role','admin','Users','agent','Telephones','telephone','ignore','value','includes','name','UserProfileResource','stack','index','User','rawAttributes','map','type','key','filter','where','query','includeAll','include','attributes','findAll','openTabs','true','rows','dataValues','push','sms','fax','mail','openchannel','whatsapp','all','show','params','differenceBy','keys','salt','filters','model','fields','length','options','find','chat','update','body','describe','addContacts','ids','omit','internal','Setting','findById','securePassword','validatePasswordPattern','password','isNil','min_internal','sequelize','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)','SELECT','from','voicemail','VoiceMail','fullname','email','permissions','101','102','103','113','106','107','108','109','100','111','114','create','Unauthorized','user','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20another\x20administrator','settingsEnabled','userProfileId','UserProfileSection','Agents','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','bulkCreate','some','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20administrator','checkUserLimits','each','isEmpty','autoAssociation','compact','changePassword','oldPassword','newPassword','Sequelize','Invalid\x20body\x20format.\x20Use\x20oldPassword\x20and\x20newPassword','authenticate','Wrong\x20credentials','ValidationError','New\x20password\x20must\x20be\x20different\x20from\x20old\x20password','Invalid\x20body\x20format.\x20Use\x20newPassword','findOne','passwordHistoryLimit','enforcePasswordHistory','previousPasswords','updatePasswordsHistory','addQueues','online','loginInPause','voicePause','interface','isValidChannel','Unknown\x20channel','toLowerCase','Queues','penalty','spread','capitalize','QueueId','emit','voice','format','SIP/%s','upsert','removeQueues','channel','remove','isArray','Queue:remove','UserVoiceQueueRt','addAvatar','userpic','getAvatar','join','root','server/files/images/logos/default_profile.png','download','existsSync','server/files/images/','ChatOpenTabs','CHAT','FaxOpenTabs','FAX','createdAt','OpenchannelOpenTabs','OPENCHANNEL','MailOpenTabs','MAIL','SmsOpenTabs','WhatsappOpenTabs','getContacts','CmContact','intersection','order','sort','merge','hasOwnProperty','CmList','List','Tag','Tags','color','tag','nolimit','Queue','pick','Unknown\x20role','getVoiceQueuesRt','ChatGroup','getGroups','VoiceRecording','UserId','getScreenRecordings','ScreenRecording','getChatInteractions','ChatInteraction','getOpenchannelInteractions','OpenchannelInteraction','getMailInteractions','MailInteraction','getSmsInteractions','SmsInteraction','getFaxInteractions','FaxInteraction','getWhatsappInteractions','login','mobile','LOCAL/%s@from-sip/n','intrf','user:%s','user:forcelogout','headers','connection','remoteAddress','socket','User\x20not\x20found\x20or\x20not\x20allowed\x20to\x20perform\x20login\x20method','getVoiceQueues','UserVoiceQueue.penalty','MemberReport','getChannels','YYYY-MM-DD\x20HH:mm:ss','forEach','LOGIN','device','PAUSE','LOGININPAUSE','isMiddleware','resolve','logout','pause','QueuePause','updateAttributes','DEFAULT\x20PAUSE','unpause','mailPause','chatPause','faxPause','openchannelPause','smsPause','whatsapppause','lastPauseAt','manual','%s%s','Pause','getTeams','addTeams','Voice','getChatQueues','Chat','setDataValue','getSmsQueues','Sms','getWhatsappQueues','Whatsapp','Fax','Openchannel','flatten','getDataValue','UserVoicePrefix','VoicePrefixId','removeTeams','Team','getMailQueues','getOpenchannelQueues','transaction','TeamVoicePrefix','getLists','getAgents','values','send','You\x20can\x27t\x20delete\x20yourself','user_has_chat_interactions:save','removeChatInteractions','user_has_chat_interactions:remove','addMailInteractions','user_has_mail_interactions:save','removeMailInteractions','user_has_mail_interactions:remove','addFaxInteractions','user_has_fax_interactions:save','removeFaxInteractions','user_has_fax_interactions:remove','addSmsInteractions','user_has_sms_interactions:save','removeSmsInteractions','user_has_sms_interactions:remove','addOpenchannelInteractions','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','addWhatsappInteractions','user_has_whatsapp_interactions:save','removeWhatsappInteractions','getVoicePrefixes','getFaxAccounts','FaxAccount','addFaxAccounts','removeFaxAccounts','getMailAccounts','MailAccount','addMailAccounts','removeMailAccounts','OpenchannelAccount','addOpenchannelAccounts','removeOpenchannelAccounts','getSmsAccounts'];(function(_0x543084,_0x4337f5){var _0x306a57=function(_0x2769ed){while(--_0x2769ed){_0x543084['push'](_0x543084['shift']());}};_0x306a57(++_0x4337f5);}(_0x896e,0x1e9));var _0xe896=function(_0x204557,_0x247c40){_0x204557=_0x204557-0x0;var _0x13871e=_0x896e[_0x204557];return _0x13871e;};'use strict';var moment=require(_0xe896('0x0'));var BPromise=require(_0xe896('0x1'));var util=require(_0xe896('0x2'));var path=require(_0xe896('0x3'));var fs=require('fs');var _=require(_0xe896('0x4'));var squel=require(_0xe896('0x5'));var jayson=require(_0xe896('0x6'));var Redis=require(_0xe896('0x7'));var authService=require(_0xe896('0x8'));var qs=require(_0xe896('0x9'));var logger=require(_0xe896('0xa'))(_0xe896('0xb'));var utils=require('../../config/utils');var config=require(_0xe896('0xc'));var licenseUtil=require(_0xe896('0xd'));var db=require(_0xe896('0xe'))['db'];var socket=require(_0xe896('0xf'))(new Redis(config[_0xe896('0x10')]));require('./user.socket')[_0xe896('0x11')](socket);config[_0xe896('0x10')]=_[_0xe896('0x12')](config['redis'],{'host':_0xe896('0x13'),'port':0x18eb});var client=jayson['client'][_0xe896('0x14')]({'port':0x232a});var values;function respondWithRpcPromise(_0x5be679,_0x409eaf,_0x146b12,_0xa00ae9){return new BPromise(function(_0x47a310,_0x3c531e){var _0x4452cd=_0xa00ae9||client;return _0x4452cd[_0xe896('0x15')](_0x5be679,_0x146b12)['then'](function(_0x2aa522){logger[_0xe896('0x16')](_0xe896('0x17'),_0x409eaf,'request\x20sent');logger[_0xe896('0x18')](_0xe896('0x19'),_0x409eaf,_0xe896('0x1a'),JSON['stringify'](_0x2aa522));if(_0x2aa522['error']){if(_0x2aa522[_0xe896('0x1b')][_0xe896('0x1c')]===0x1f4){logger['error']('User,\x20%s,\x20%s',_0x409eaf,_0x2aa522[_0xe896('0x1b')][_0xe896('0x1d')]);return _0x3c531e(_0x2aa522['error'][_0xe896('0x1d')]);}logger['error'](_0xe896('0x17'),_0x409eaf,_0x2aa522[_0xe896('0x1b')][_0xe896('0x1d')]);return _0x47a310(_0x2aa522['error'][_0xe896('0x1d')]);}else{logger[_0xe896('0x16')](_0xe896('0x17'),_0x409eaf,_0xe896('0x1a'));_0x47a310(_0x2aa522[_0xe896('0x1e')][_0xe896('0x1d')]);}})[_0xe896('0x1f')](function(_0x32d3d3){logger['error'](_0xe896('0x17'),_0x409eaf,_0x32d3d3);_0x3c531e(_0x32d3d3);});});}function respondWithStatusCode(_0x5e1f29,_0x5d2c8d){_0x5d2c8d=_0x5d2c8d||0xcc;return function(_0x3117cc){if(_0x3117cc){return _0x5e1f29[_0xe896('0x20')](_0x5d2c8d);}return _0x5e1f29[_0xe896('0x21')](_0x5d2c8d)[_0xe896('0x22')]();};}function respondWithResult(_0x498469,_0x468479){_0x468479=_0x468479||0xc8;return function(_0x4ad156){if(_0x4ad156){return _0x498469['status'](_0x468479)[_0xe896('0x23')](_0x4ad156);}};}function respondWithFilteredResult(_0x41e689,_0x1e952a){return function(_0x2e2c10){if(_0x2e2c10){var _0x20e295=typeof _0x1e952a[_0xe896('0x24')]===_0xe896('0x25')&&typeof _0x1e952a['limit']===_0xe896('0x25');var _0x163a75=_0x2e2c10[_0xe896('0x26')];var _0x569d5f=_0x20e295?0x0:_0x1e952a[_0xe896('0x24')];var _0xd50fe2=_0x20e295?_0x2e2c10[_0xe896('0x26')]:_0x1e952a[_0xe896('0x24')]+_0x1e952a[_0xe896('0x27')];var _0x3f8ceb;if(_0xd50fe2>=_0x163a75){_0xd50fe2=_0x163a75;_0x3f8ceb=0xc8;}else{_0x3f8ceb=0xce;}_0x41e689['status'](_0x3f8ceb);return _0x41e689[_0xe896('0x28')](_0xe896('0x29'),_0x569d5f+'-'+_0xd50fe2+'/'+_0x163a75)[_0xe896('0x23')](_0x2e2c10);}return null;};}function saveUpdates(_0xbfb15b){return function(_0xace03f){if(_0xace03f){return _0xace03f['update'](_0xbfb15b)['then'](function(_0x5c7dae){return _0x5c7dae;});}return null;};}function removeEntity(_0x504d7c){return function(_0x562ddd){if(_0x562ddd){return _0x562ddd[_0xe896('0x2a')]()[_0xe896('0x2b')](function(){var _0x10fd26=_0x562ddd[_0xe896('0x2c')]({'plain':!![]});if(_0x10fd26[_0xe896('0x2d')]===_0xe896('0x2e'))return;var _0x322ebc=[{'name':_0xe896('0x2f'),'value':'user','ignore':!![]},{'name':'Agents','value':_0xe896('0x30'),'ignore':![]},{'name':_0xe896('0x31'),'value':_0xe896('0x32'),'ignore':![]}];var _0x76c0c3=_(_0x322ebc)['filter'](_0xe896('0x33'))['map']('value')[_0xe896('0x34')]();if(_[_0xe896('0x35')](_0x76c0c3,_0x10fd26[_0xe896('0x2d')])){return;}var _0x4a1115=_['find'](_0x322ebc,['value',_0x10fd26[_0xe896('0x2d')]])[_0xe896('0x36')];return db[_0xe896('0x37')][_0xe896('0x2a')]({'where':{'type':_0x4a1115,'resourceId':_0x10fd26['id']}})[_0xe896('0x2b')](function(){return _0x562ddd;});})['then'](function(){_0x504d7c[_0xe896('0x21')](0xcc)[_0xe896('0x22')]();});}};}function handleEntityNotFound(_0x39cbe6){return function(_0x28e09c){if(!_0x28e09c){_0x39cbe6[_0xe896('0x20')](0x194);}return _0x28e09c;};}function handleError(_0x2cce09,_0x3aeccc){_0x3aeccc=_0x3aeccc||0x1f4;return function(_0x3e28f0){logger['error'](_0x3e28f0[_0xe896('0x38')]);if(_0x3e28f0[_0xe896('0x36')]){delete _0x3e28f0['name'];}_0x2cce09[_0xe896('0x21')](_0x3aeccc)['send'](_0x3e28f0);};}exports[_0xe896('0x39')]=function(_0x4f164f,_0x42f445){var _0x5ba71e={},_0x2ab7a6={'count':0x0,'rows':[]};var _0x470c29=_(db[_0xe896('0x3a')][_0xe896('0x3b')])[_0xe896('0x3c')](function(_0x533173){return{'name':_0x533173['fieldName'],'type':_0x533173[_0xe896('0x3d')][_0xe896('0x3e')]};})[_0xe896('0x3f')](function(_0x15b6c5){return!_[_0xe896('0x35')](['password','salt'],_0x15b6c5[_0xe896('0x36')]);})[_0xe896('0x34')]();_0x5ba71e=qs['getOptions'](_0x470c29,_0x4f164f);var _0x57e194={'where':_0x5ba71e[_0xe896('0x40')]};return db[_0xe896('0x3a')][_0xe896('0x26')](_0x57e194)[_0xe896('0x2b')](function(_0x359bfb){_0x2ab7a6[_0xe896('0x26')]=_0x359bfb;if(_0x4f164f[_0xe896('0x41')][_0xe896('0x42')]){_0x5ba71e[_0xe896('0x43')]=[{'all':!![]}];}if(!_[_0xe896('0x35')](_0x5ba71e[_0xe896('0x44')],'id')){_0x5ba71e[_0xe896('0x44')]['push']('id');}return db[_0xe896('0x3a')][_0xe896('0x45')](_0x5ba71e);})['then'](function(_0x57366b){_0x2ab7a6['rows']=_0x57366b;if(_0x4f164f[_0xe896('0x41')][_0xe896('0x46')]===_0xe896('0x47')){var _0x5d1a19=[];for(var _0x431323=0x0;_0x431323<_0x2ab7a6[_0xe896('0x48')]['length'];_0x431323++){_0x5d1a19['push'](get_open_tabs('chat',_0x2ab7a6[_0xe896('0x48')][_0x431323][_0xe896('0x49')]));_0x5d1a19[_0xe896('0x4a')](get_open_tabs(_0xe896('0x4b'),_0x2ab7a6[_0xe896('0x48')][_0x431323][_0xe896('0x49')]));_0x5d1a19['push'](get_open_tabs(_0xe896('0x4c'),_0x2ab7a6[_0xe896('0x48')][_0x431323]['dataValues']));_0x5d1a19[_0xe896('0x4a')](get_open_tabs(_0xe896('0x4d'),_0x2ab7a6[_0xe896('0x48')][_0x431323][_0xe896('0x49')]));_0x5d1a19['push'](get_open_tabs(_0xe896('0x4e'),_0x2ab7a6[_0xe896('0x48')][_0x431323][_0xe896('0x49')]));_0x5d1a19[_0xe896('0x4a')](get_open_tabs(_0xe896('0x4f'),_0x2ab7a6[_0xe896('0x48')][_0x431323]['dataValues']));}return BPromise[_0xe896('0x50')](_0x5d1a19)['then'](function(_0x234a22){return _0x2ab7a6;});}else{return _0x2ab7a6;}})[_0xe896('0x2b')](respondWithFilteredResult(_0x42f445,_0x5ba71e))[_0xe896('0x1f')](handleError(_0x42f445,null));};exports[_0xe896('0x51')]=function(_0x252c27,_0x8523d7){var _0x5b1f4a={'raw':![],'where':{'id':_0x252c27[_0xe896('0x52')]['id']}},_0xbb7658={};_0xbb7658['model']=_[_0xe896('0x53')](_[_0xe896('0x54')](db['User'][_0xe896('0x3b')]),['password',_0xe896('0x55')]);_0xbb7658[_0xe896('0x41')]=_[_0xe896('0x54')](_0x252c27[_0xe896('0x41')]);_0xbb7658[_0xe896('0x56')]=_['intersection'](_0xbb7658[_0xe896('0x57')],_0xbb7658[_0xe896('0x41')]);_0x5b1f4a[_0xe896('0x44')]=_['intersection'](_0xbb7658[_0xe896('0x57')],qs['fields'](_0x252c27['query'][_0xe896('0x58')]));_0x5b1f4a[_0xe896('0x44')]=_0x5b1f4a['attributes'][_0xe896('0x59')]?_0x5b1f4a[_0xe896('0x44')]:_0xbb7658['model'];if(_0x252c27['query'][_0xe896('0x42')]){_0x5b1f4a[_0xe896('0x43')]=[{'all':!![]}];}_0x5b1f4a=_['merge']({},_0x5b1f4a,_0x252c27[_0xe896('0x5a')]);if(!_[_0xe896('0x35')](_0x5b1f4a[_0xe896('0x44')],'id')){_0x5b1f4a[_0xe896('0x44')][_0xe896('0x4a')]('id');}return db[_0xe896('0x3a')][_0xe896('0x5b')](_0x5b1f4a)[_0xe896('0x2b')](handleEntityNotFound(_0x8523d7,null))[_0xe896('0x2b')](function(_0x3837e7){var _0x357302=[];values=_0x3837e7;if(_0x252c27['query'][_0xe896('0x46')]===_0xe896('0x47')){_0x357302[_0xe896('0x4a')](get_open_tabs(_0xe896('0x5c'),_0x3837e7[_0xe896('0x49')]));_0x357302[_0xe896('0x4a')](get_open_tabs(_0xe896('0x4b'),_0x3837e7[_0xe896('0x49')]));_0x357302[_0xe896('0x4a')](get_open_tabs(_0xe896('0x4e'),_0x3837e7[_0xe896('0x49')]));_0x357302[_0xe896('0x4a')](get_open_tabs('whatsapp',_0x3837e7[_0xe896('0x49')]));_0x357302[_0xe896('0x4a')](get_open_tabs(_0xe896('0x4c'),_0x3837e7['dataValues']));_0x357302['push'](get_open_tabs('mail',_0x3837e7[_0xe896('0x49')]));return BPromise[_0xe896('0x50')](_0x357302);}else{return values;}})[_0xe896('0x2b')](function(_0x2496d4){return values;})['then'](respondWithResult(_0x8523d7,null))[_0xe896('0x1f')](handleError(_0x8523d7,null));};exports[_0xe896('0x5d')]=function(_0x57ed84,_0x3c893a){if(_0x57ed84['body']['id']){delete _0x57ed84[_0xe896('0x5e')]['id'];}delete _0x57ed84[_0xe896('0x5e')]['role'];return db[_0xe896('0x3a')][_0xe896('0x5b')]({'where':{'id':_0x57ed84['params']['id']}})['then'](handleEntityNotFound(_0x3c893a,null))[_0xe896('0x2b')](saveUpdates(_0x57ed84[_0xe896('0x5e')],null))[_0xe896('0x2b')](respondWithResult(_0x3c893a,null))[_0xe896('0x1f')](handleError(_0x3c893a,null));};exports[_0xe896('0x5f')]=function(_0x4e4092,_0xdadb92){return db[_0xe896('0x3a')][_0xe896('0x5f')]()[_0xe896('0x2b')](respondWithResult(_0xdadb92,null))['catch'](handleError(_0xdadb92,null));};exports['addContacts']=function(_0x12c2b4,_0x463299){return db['User'][_0xe896('0x5b')]({'where':{'id':_0x12c2b4['params']['id']}})[_0xe896('0x2b')](handleEntityNotFound(_0x463299,null))[_0xe896('0x2b')](function(_0xce2b25){if(_0xce2b25){return _0xce2b25[_0xe896('0x60')](_0x12c2b4[_0xe896('0x5e')][_0xe896('0x61')],_[_0xe896('0x62')](_0x12c2b4[_0xe896('0x5e')],[_0xe896('0x61'),'id'])||{});}})[_0xe896('0x2b')](respondWithResult(_0x463299,null))[_0xe896('0x1f')](handleError(_0x463299,null));};function validateUser(_0x3248e6){return new BPromise(function(_0x41ec26,_0x14d88e){if(_0x3248e6[_0xe896('0x63')])return _0x41ec26(_0x3248e6);return db[_0xe896('0x64')][_0xe896('0x65')](0x1)[_0xe896('0x2b')](function(_0x27d90d){if(_0x27d90d[_0xe896('0x66')])authService[_0xe896('0x67')](_0x3248e6[_0xe896('0x68')]);db['User']['max'](_0xe896('0x63'))[_0xe896('0x2b')](function(_0x496e2c){if(_[_0xe896('0x69')](_0x496e2c)){_0x3248e6[_0xe896('0x63')]=_0x27d90d[_0xe896('0x6a')]||0x1;return;}if(_[_0xe896('0x69')](_0x27d90d[_0xe896('0x6a')])||_0x27d90d[_0xe896('0x6a')]===_0x496e2c){_0x3248e6[_0xe896('0x63')]=_0x496e2c+0x1;return;}if(_0x27d90d[_0xe896('0x6a')]>_0x496e2c){_0x3248e6[_0xe896('0x63')]=_0x27d90d[_0xe896('0x6a')];return;}return db[_0xe896('0x6b')]['query'](_0xe896('0x6c'),{'type':db[_0xe896('0x6b')]['QueryTypes'][_0xe896('0x6d')]})['then'](function(_0x47b8b7){if(_0x47b8b7&&_0x47b8b7[_0xe896('0x59')]){for(var _0x1bbeeb=0x0,_0x4fd476=_0x47b8b7['length'];_0x1bbeeb<_0x4fd476&&_[_0xe896('0x69')](_0x3248e6['internal']);_0x1bbeeb++){if(_0x27d90d['min_internal']<=_0x47b8b7[_0x1bbeeb][_0xe896('0x6e')]){_0x3248e6[_0xe896('0x63')]=_0x47b8b7[_0x1bbeeb][_0xe896('0x6e')];}else if(_0x27d90d['min_internal']>_0x47b8b7[_0x1bbeeb][_0xe896('0x6e')]&&_0x27d90d[_0xe896('0x6a')]<=_0x47b8b7[_0x1bbeeb]['to']){_0x3248e6[_0xe896('0x63')]=_0x27d90d['min_internal'];}}}if(_[_0xe896('0x69')](_0x3248e6[_0xe896('0x63')])){_0x3248e6[_0xe896('0x63')]=_0x496e2c+0x1;}return _0x41ec26(_0x3248e6);});});})[_0xe896('0x1f')](function(_0x5ce0ae){_0x14d88e(_0x5ce0ae);});});}function updateUser(_0x253f95){return new BPromise(function(_0x37d951,_0x3b51f1){try{if(_0x253f95[_0xe896('0x6f')]){_0x253f95['mailbox']=_0x253f95[_0xe896('0x63')];_0x253f95[_0xe896('0x70')]={'mailbox':_0x253f95['internal'],'password':_0x253f95[_0xe896('0x68')],'fullname':_0x253f95[_0xe896('0x71')],'email':_0x253f95[_0xe896('0x72')]};}if(_0x253f95[_0xe896('0x2d')]==='agent'){if(!_0x253f95[_0xe896('0x73')])_0x253f95[_0xe896('0x73')]=[_0xe896('0x74'),_0xe896('0x75'),_0xe896('0x76'),_0xe896('0x77'),'110','104','105',_0xe896('0x78'),_0xe896('0x79'),_0xe896('0x7a'),_0xe896('0x7b'),_0xe896('0x7c'),_0xe896('0x7d'),_0xe896('0x7e'),'115'];}_0x37d951(_0x253f95);}catch(_0x5228c8){_0x3b51f1(_0x5228c8);}});}exports[_0xe896('0x7f')]=function(_0x47eded,_0x36bde7){if(_0x47eded['user'][_0xe896('0x2d')]==='agent')throw new Error(_0xe896('0x80'));if(_0x47eded[_0xe896('0x5e')][_0xe896('0x2d')]===_0xe896('0x81')&&_0x47eded[_0xe896('0x81')]['role']!==_0xe896('0x2e')){throw new Error(_0xe896('0x82'));}if(_0x47eded[_0xe896('0x5e')][_0xe896('0x2d')]===_0xe896('0x2e')&&_0x47eded[_0xe896('0x81')][_0xe896('0x2d')]!=='admin'){throw new Error(_0xe896('0x83'));}return licenseUtil['checkUserLimits']([_0x47eded[_0xe896('0x5e')]])[_0xe896('0x2b')](function(){return validateUser(_0x47eded[_0xe896('0x5e')]);})['then'](function(_0x3b31c7){return updateUser(_0x3b31c7)[_0xe896('0x2b')](function(_0x231604){if(_0x231604[_0xe896('0x2d')]===_0xe896('0x2e')){_0x231604[_0xe896('0x84')]=_0x47eded[_0xe896('0x81')][_0xe896('0x84')];delete _0x231604[_0xe896('0x85')];}return _0x231604;});})[_0xe896('0x2b')](function(_0x561b15){return db['User'][_0xe896('0x7f')](_0x561b15,{'include':[{'model':db[_0xe896('0x70')],'as':_0xe896('0x70')}]});})[_0xe896('0x2b')](function(_0x48885e){if(_0x47eded[_0xe896('0x5e')][_0xe896('0x2d')]===_0xe896('0x81'))return _0x48885e;if(_0x47eded[_0xe896('0x81')][_0xe896('0x2d')]!==_0xe896('0x81'))return _0x48885e;return db[_0xe896('0x86')][_0xe896('0x5b')]({'where':{'name':_0x48885e[_0xe896('0x2d')]===_0xe896('0x30')?_0xe896('0x87'):_0xe896('0x31'),'userProfileId':_0x47eded['user'][_0xe896('0x85')]},'raw':!![]})[_0xe896('0x2b')](function(_0x3f0d99){if(!_0x3f0d99||_0x3f0d99['autoAssociation']!=0x0)return _0x48885e;return db[_0xe896('0x37')]['create']({'name':_0x48885e['name'],'resourceId':_0x48885e['id'],'type':_0x3f0d99[_0xe896('0x36')],'sectionId':_0x3f0d99['id']},{})[_0xe896('0x2b')](function(){return _0x48885e;});})[_0xe896('0x1f')](function(_0x497b8f){logger[_0xe896('0x1b')](_0xe896('0x88'),_0x497b8f);throw _0x497b8f;});})['then'](respondWithResult(_0x36bde7,0xc9))['catch'](handleError(_0x36bde7,null));};exports[_0xe896('0x89')]=function(_0x19c9e0,_0x32d2f5){var _0x24924e=_0x19c9e0[_0xe896('0x5e')];var _0x295c34=[];if(_0x19c9e0[_0xe896('0x81')]['role']==='agent')throw new Error(_0xe896('0x80'));if(_['some'](_0x24924e,['role',_0xe896('0x81')])&&_0x19c9e0[_0xe896('0x81')][_0xe896('0x2d')]!==_0xe896('0x2e')){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user');}if(_[_0xe896('0x8a')](_0x24924e,[_0xe896('0x2d'),'admin'])&&_0x19c9e0[_0xe896('0x81')][_0xe896('0x2d')]!==_0xe896('0x2e')){throw new Error(_0xe896('0x8b'));}return licenseUtil[_0xe896('0x8c')](_0x24924e)[_0xe896('0x2b')](function(){return validateUser(_0x24924e[0x0]);})[_0xe896('0x2b')](function(){for(var _0x1c5812=0x1;_0x1c5812<_0x24924e[_0xe896('0x59')];_0x1c5812++){var _0x20f8a2=_0x24924e[_0x1c5812-0x1][_0xe896('0x63')];if(!_0x24924e[_0x1c5812][_0xe896('0x63')])_0x24924e[_0x1c5812][_0xe896('0x63')]=_0x20f8a2+0x1;_0x295c34['push'](validateUser(_0x24924e[_0x1c5812]));}return BPromise[_0xe896('0x50')](_0x295c34);})[_0xe896('0x2b')](function(){_0x295c34=[];for(var _0x371e40=0x0;_0x371e40<_0x24924e[_0xe896('0x59')];_0x371e40++){_0x295c34[_0xe896('0x4a')](updateUser(_0x24924e[_0x371e40]));}return BPromise[_0xe896('0x50')](_0x295c34);})[_0xe896('0x2b')](function(){return BPromise[_0xe896('0x8d')](_0x24924e,function(_0x2bf6d5){return db[_0xe896('0x3a')]['create'](_0x2bf6d5,{'include':[{'model':db['VoiceMail'],'as':_0xe896('0x70')}]})[_0xe896('0x2b')](function(_0x3822cd){_0x2bf6d5['id']=_0x3822cd['id'];return _0x2bf6d5;});});})['then'](function(_0x100804){if(_0x19c9e0[_0xe896('0x5e')]['role']===_0xe896('0x81'))return _0x100804;if(_0x19c9e0[_0xe896('0x81')]['role']!==_0xe896('0x81'))return _0x100804;var _0xb137f=_[_0xe896('0x8a')](_0x100804,function(_0x28e40d){return _0x28e40d[_0xe896('0x2d')]===_0xe896('0x30')||_0x28e40d[_0xe896('0x2d')]===_0xe896('0x32');});if(!_0xb137f)return _0x100804;return db['UserProfileSection'][_0xe896('0x45')]({'where':{'name':{'$or':[_0xe896('0x87'),_0xe896('0x31')]},'userProfileId':_0x19c9e0[_0xe896('0x81')][_0xe896('0x85')]},'raw':!![]})['then'](function(_0x446f91){if(_[_0xe896('0x8e')](_0x446f91)||!_[_0xe896('0x8a')](_0x446f91,['autoAssociation',0x0]))return _0x100804;_0x295c34=[];var _0x2ffbb1=_(_0x446f91)[_0xe896('0x3c')](function(_0x406f50){if(_0x406f50[_0xe896('0x8f')]===0x1)return;return _0x406f50[_0xe896('0x36')]===_0xe896('0x87')?_0xe896('0x30'):_0xe896('0x32');})[_0xe896('0x90')]()['value']();for(var _0x3da4c5=0x0;_0x3da4c5<_0x100804['length'];_0x3da4c5++){if(!_[_0xe896('0x35')](_0x2ffbb1,_0x100804[_0x3da4c5][_0xe896('0x2d')]))return;var _0x166672=_0x100804[_0x3da4c5][_0xe896('0x2d')]==='agent'?_0xe896('0x87'):_0xe896('0x31');_0x295c34['push'](db[_0xe896('0x37')][_0xe896('0x7f')]({'name':_0x100804[_0x3da4c5][_0xe896('0x36')],'resourceId':_0x100804[_0x3da4c5]['id'],'type':_0x166672,'sectionId':_['find'](_0x446f91,[_0xe896('0x36'),_0x166672])['id']},{}));}return BPromise['all'](_0x295c34);});})['then'](respondWithResult(_0x32d2f5,0xc9))[_0xe896('0x1f')](handleError(_0x32d2f5,null));};exports[_0xe896('0x91')]=function(_0x5c4826,_0x1cf246){if(_0x5c4826[_0xe896('0x5e')]['id']){delete _0x5c4826['body']['id'];}return db['User']['find']({'where':{'id':_0x5c4826['params']['id']}})[_0xe896('0x2b')](function(_0x237cae){if(!_0x237cae)return null;if(_0x237cae['id']===_0x5c4826[_0xe896('0x81')]['id']){if(!_0x5c4826[_0xe896('0x5e')][_0xe896('0x92')]||!_0x5c4826[_0xe896('0x5e')][_0xe896('0x93')]){throw new db[(_0xe896('0x94'))]['ValidationError'](_0xe896('0x95'));}if(!_0x237cae[_0xe896('0x96')](_0x5c4826[_0xe896('0x5e')][_0xe896('0x92')])){throw new db['Sequelize']['ValidationError'](_0xe896('0x97'));}if(_0x5c4826[_0xe896('0x5e')]['oldPassword']===_0x5c4826['body'][_0xe896('0x93')]){throw new db[(_0xe896('0x94'))][(_0xe896('0x98'))](_0xe896('0x99'));}}else if(_0x5c4826[_0xe896('0x81')]['role']===_0xe896('0x2e')){if(!_0x5c4826[_0xe896('0x5e')][_0xe896('0x93')]){throw new db['Sequelize'][(_0xe896('0x98'))](_0xe896('0x9a'));}}else if(_0x5c4826[_0xe896('0x81')][_0xe896('0x2d')]===_0xe896('0x81')){if(!_0x5c4826['body'][_0xe896('0x93')]){throw new db[(_0xe896('0x94'))][(_0xe896('0x98'))]('Invalid\x20body\x20format.\x20Use\x20newPassword');}if(_0x237cae[_0xe896('0x2d')]!=='agent'){throw new db[(_0xe896('0x94'))][(_0xe896('0x98'))](_0xe896('0x80'));}}else{throw new db[(_0xe896('0x94'))][(_0xe896('0x98'))](_0xe896('0x80'));}return _0x237cae;})['then'](handleEntityNotFound(_0x1cf246,null))['then'](function(_0x43fe9a){return db['Setting'][_0xe896('0x9b')]({'attributes':['id',_0xe896('0x66'),'enforcePasswordHistory',_0xe896('0x9c')]})[_0xe896('0x2b')](function(_0x571abb){if(_0x571abb[_0xe896('0x66')])authService['validatePasswordPattern'](_0x5c4826[_0xe896('0x5e')][_0xe896('0x93')]);if(!_0x571abb[_0xe896('0x9d')]||!_0x43fe9a[_0xe896('0x9e')])return _0x43fe9a;authService['validatePasswordHistory'](_0x5c4826[_0xe896('0x5e')][_0xe896('0x93')],_0x43fe9a[_0xe896('0x9e')],_0x571abb[_0xe896('0x9c')]);return _0x43fe9a;})[_0xe896('0x2b')](saveUpdates({'password':_0x5c4826[_0xe896('0x5e')][_0xe896('0x93')],'passwordResetAt':_0x5c4826[_0xe896('0x81')]['id']==_0x5c4826[_0xe896('0x52')]['id']?moment():null,'previousPasswords':authService[_0xe896('0x9f')](_0x5c4826[_0xe896('0x5e')][_0xe896('0x93')],_0x43fe9a[_0xe896('0x9e')])},null));})[_0xe896('0x2b')](respondWithResult(_0x1cf246,null))[_0xe896('0x1f')](handleError(_0x1cf246,null));};exports[_0xe896('0xa0')]=function(_0x16b398,_0x4edeaf){var _0x10d8bf=_0x16b398[_0xe896('0x5e')]['channel'];return db['User'][_0xe896('0x5b')]({'where':{'id':_0x16b398[_0xe896('0x52')]['id']},'attributes':['id',_0xe896('0x36'),_0xe896('0x2d'),_0xe896('0xa1'),_0xe896('0xa2'),_0xe896('0xa3'),_0xe896('0xa4')]})['then'](handleEntityNotFound(_0x4edeaf,null))[_0xe896('0x2b')](function(_0x3c70a3){if(_0x3c70a3){if(!utils[_0xe896('0xa5')](_0x10d8bf)){throw new db[(_0xe896('0x94'))]['ValidationError'](_0xe896('0xa6'));}return _0x3c70a3['add'+_['capitalize'](_0x10d8bf[_0xe896('0xa7')]())+_0xe896('0xa8')](_0x16b398[_0xe896('0x5e')][_0xe896('0x61')],{'penalty':_0x16b398[_0xe896('0x5e')][_0xe896('0xa9')]||0x0})[_0xe896('0xaa')](function(_0x49293e){for(var _0x2d3ada=0x0;_0x2d3ada<_0x16b398[_0xe896('0x5e')][_0xe896('0x61')][_0xe896('0x59')];_0x2d3ada+=0x1){var _0xe78476={'UserId':Number(_0x16b398[_0xe896('0x52')]['id'])};_0xe78476[_[_0xe896('0xab')](_0x10d8bf[_0xe896('0xa7')]())+_0xe896('0xac')]=Number(_0x16b398['body'][_0xe896('0x61')][_0x2d3ada]);socket[_0xe896('0xad')]('user'+_[_0xe896('0xab')](_0x10d8bf['toLowerCase']())+'Queue:save',_0xe78476);}return _0x49293e;})[_0xe896('0x2b')](function(){if(_0x10d8bf==='voice'){return db['VoiceQueue'][_0xe896('0x45')]({'where':{'id':_0x16b398[_0xe896('0x5e')][_0xe896('0x61')]||[]},'raw':!![],'attributes':['id','name']});}})[_0xe896('0x2b')](function(_0x55be9b){var _0x1bcbac=_0x3c70a3[_0xe896('0x2c')]({'plain':!![]});var _0x59c689=[];if(_0x10d8bf===_0xe896('0xae')&&_0x1bcbac[_0xe896('0x2d')]==='agent'&&_0x1bcbac[_0xe896('0xa1')]){for(var _0x5478f3=0x0;_0x5478f3<_0x55be9b['length'];_0x5478f3+=0x1){_0x59c689['push']({'membername':_0x1bcbac[_0xe896('0x36')],'UserId':_0x1bcbac['id'],'queue_name':_0x55be9b[_0x5478f3]['name'],'VoiceQueueId':_0x55be9b[_0x5478f3]['id'],'interface':_[_0xe896('0x69')](_0x1bcbac[_0xe896('0xa4')])?util[_0xe896('0xaf')](_0xe896('0xb0'),_0x1bcbac['name']):_0x1bcbac[_0xe896('0xa4')],'paused':_0x1bcbac[_0xe896('0xa3')]||![],'penalty':_0x16b398[_0xe896('0x5e')][_0xe896('0xa9')]||0x0});}return BPromise['each'](_0x59c689,function(_0x3f9c29){return db['UserVoiceQueueRt'][_0xe896('0xb1')](_0x3f9c29);});}return _0x3c70a3;});}})[_0xe896('0x2b')](respondWithStatusCode(_0x4edeaf,null))[_0xe896('0x1f')](handleError(_0x4edeaf,null));};exports[_0xe896('0xb2')]=function(_0x5a5336,_0x42ab19){var _0x4d3a74;return db[_0xe896('0x3a')]['find']({'where':{'id':_0x5a5336[_0xe896('0x52')]['id']},'attributes':['id',_0xe896('0x36'),_0xe896('0x2d')]})['then'](handleEntityNotFound(_0x42ab19,null))[_0xe896('0x2b')](function(_0x4ba3b6){if(_0x4ba3b6){_0x4d3a74=_0x4ba3b6;if(!_0x5a5336[_0xe896('0x41')][_0xe896('0xb3')]||!utils['isValidChannel'](_0x5a5336[_0xe896('0x41')][_0xe896('0xb3')])){throw new db['Sequelize'][(_0xe896('0x98'))](_0xe896('0xa6'));}return _0x4ba3b6[_0xe896('0xb4')+_[_0xe896('0xab')](_0x5a5336[_0xe896('0x41')][_0xe896('0xb3')][_0xe896('0xa7')]())+_0xe896('0xa8')](_0x5a5336[_0xe896('0x41')]['ids']);}})['then'](function(_0x3cf3df){if(_[_0xe896('0xb5')](_0x5a5336['query'][_0xe896('0x61')])){for(var _0x325631=0x0;_0x325631<_0x5a5336['query']['ids'][_0xe896('0x59')];_0x325631+=0x1){var _0x265206={'UserId':Number(_0x5a5336['params']['id'])};_0x265206[_[_0xe896('0xab')](_0x5a5336[_0xe896('0x41')]['channel'][_0xe896('0xa7')]())+_0xe896('0xac')]=Number(_0x5a5336[_0xe896('0x41')]['ids'][_0x325631]);socket[_0xe896('0xad')](_0xe896('0x81')+_['capitalize'](_0x5a5336[_0xe896('0x41')][_0xe896('0xb3')][_0xe896('0xa7')]())+_0xe896('0xb6'),_0x265206);}}else{var _0x265206={'UserId':Number(_0x5a5336[_0xe896('0x52')]['id'])};_0x265206[_[_0xe896('0xab')](_0x5a5336[_0xe896('0x41')][_0xe896('0xb3')][_0xe896('0xa7')]())+_0xe896('0xac')]=Number(_0x5a5336[_0xe896('0x41')][_0xe896('0x61')]);socket[_0xe896('0xad')]('user'+_[_0xe896('0xab')](_0x5a5336['query'][_0xe896('0xb3')][_0xe896('0xa7')]())+'Queue:remove',_0x265206);}return _0x3cf3df;})[_0xe896('0x2b')](function(){if(_0x5a5336[_0xe896('0x41')][_0xe896('0xb3')]==='voice'){return db[_0xe896('0xb7')][_0xe896('0x2a')]({'where':{'UserId':_0x5a5336[_0xe896('0x52')]['id'],'VoiceQueueId':_0x5a5336[_0xe896('0x41')][_0xe896('0x61')]},'individualHooks':!![]})[_0xe896('0x2b')](function(){return _0x4d3a74;});}return _0x4d3a74;})[_0xe896('0x2b')](respondWithStatusCode(_0x42ab19,null))[_0xe896('0x1f')](handleError(_0x42ab19,null));};exports[_0xe896('0xb8')]=function(_0x48456b,_0x5b688b){_0x48456b['body'][_0xe896('0xb9')]=_0x48456b['file']['filename'];return db[_0xe896('0x3a')]['find']({'where':{'id':_0x48456b['params']['id']}})['then'](handleEntityNotFound(_0x5b688b,null))[_0xe896('0x2b')](saveUpdates(_0x48456b['body'],null))[_0xe896('0x2b')](respondWithResult(_0x5b688b,null))[_0xe896('0x1f')](handleError(_0x5b688b,null));};exports[_0xe896('0xba')]=function(_0x29cf8c,_0x5d0efc){var _0x11fdf2=path[_0xe896('0xbb')](config[_0xe896('0xbc')],_0xe896('0xbd'));return db[_0xe896('0x3a')]['find']({'where':{'id':_0x29cf8c['params']['id']},'attributes':['id',_0xe896('0xb9')],'raw':!![]})[_0xe896('0x2b')](handleEntityNotFound(_0x5d0efc,null))['then'](function(_0x21b078){if(_0x21b078){if(_[_0xe896('0x69')](_0x21b078[_0xe896('0xb9')])){return _0x5d0efc[_0xe896('0xbe')](_0x11fdf2);}else{if(!fs[_0xe896('0xbf')](path[_0xe896('0xbb')](config[_0xe896('0xbc')],_0xe896('0xc0'),_0x21b078[_0xe896('0xb9')]))){return _0x5d0efc[_0xe896('0xbe')](_0x11fdf2);}return _0x5d0efc[_0xe896('0xbe')](path[_0xe896('0xbb')](config[_0xe896('0xbc')],'server/files/images/',_0x21b078[_0xe896('0xb9')]));}}})[_0xe896('0x1f')](handleError(_0x5d0efc,null));};exports['getOpenTabs']=function(_0x17e2a5,_0x361452){return db[_0xe896('0x3a')][_0xe896('0x5b')]({'where':{'id':_0x17e2a5[_0xe896('0x52')]['id']},'attributes':['id']})[_0xe896('0x2b')](handleEntityNotFound(_0x361452,null))[_0xe896('0x2b')](function(_0x1005df){var _0x21aa35=[];values=_0x1005df[_0xe896('0x49')];_0x21aa35['push'](get_open_tabs(_0xe896('0x5c'),_0x1005df['dataValues']));_0x21aa35[_0xe896('0x4a')](get_open_tabs(_0xe896('0x4b'),_0x1005df[_0xe896('0x49')]));_0x21aa35[_0xe896('0x4a')](get_open_tabs(_0xe896('0x4e'),_0x1005df[_0xe896('0x49')]));_0x21aa35[_0xe896('0x4a')](get_open_tabs(_0xe896('0x4f'),_0x1005df['dataValues']));_0x21aa35[_0xe896('0x4a')](get_open_tabs(_0xe896('0x4c'),_0x1005df[_0xe896('0x49')]));_0x21aa35[_0xe896('0x4a')](get_open_tabs(_0xe896('0x4d'),_0x1005df[_0xe896('0x49')]));return BPromise[_0xe896('0x50')](_0x21aa35);})[_0xe896('0x2b')](function(_0x4e631a){var _0x2c7636=[];if(_0x4e631a){for(var _0x3fc0fe=0x0;_0x3fc0fe=_0x50605b){_0x328e5e=_0x50605b;_0x1deea6=0xc8;}else{_0x1deea6=0xce;}_0x292ce3['status'](_0x1deea6);return _0x292ce3[_0x190b('0x25')](_0x190b('0x26'),_0x3260d5+'-'+_0x328e5e+'/'+_0x50605b)[_0x190b('0x21')](_0x3ad3a5);}return null;};}function saveUpdates(_0x494f3f){return function(_0x536d7b){if(_0x536d7b){return _0x536d7b[_0x190b('0x27')](_0x494f3f)['then'](function(_0x14be2c){return _0x14be2c;});}return null;};}function removeEntity(_0x19e421){return function(_0x5b9cb6){if(_0x5b9cb6){return _0x5b9cb6[_0x190b('0x28')]()['then'](function(){var _0x40d060=_0x5b9cb6['get']({'plain':!![]});if(_0x40d060[_0x190b('0x29')]==='admin')return;var _0xc789e5=[{'name':_0x190b('0x2a'),'value':'user','ignore':!![]},{'name':_0x190b('0x2b'),'value':_0x190b('0x2c'),'ignore':![]},{'name':_0x190b('0x2d'),'value':_0x190b('0x2e'),'ignore':![]}];var _0x3c7488=_(_0xc789e5)[_0x190b('0x2f')](_0x190b('0x30'))[_0x190b('0x31')]('value')['value']();if(_[_0x190b('0x32')](_0x3c7488,_0x40d060[_0x190b('0x29')])){return;}var _0x58113b=_[_0x190b('0x33')](_0xc789e5,[_0x190b('0x34'),_0x40d060[_0x190b('0x29')]])[_0x190b('0x35')];return db[_0x190b('0x36')][_0x190b('0x28')]({'where':{'type':_0x58113b,'resourceId':_0x40d060['id']}})[_0x190b('0x13')](function(){return _0x5b9cb6;});})['then'](function(){_0x19e421['status'](0xcc)[_0x190b('0x20')]();});}};}function handleEntityNotFound(_0x2f7111){return function(_0x1a950d){if(!_0x1a950d){_0x2f7111['sendStatus'](0x194);}return _0x1a950d;};}function handleError(_0x33e9db,_0x5e773c){_0x5e773c=_0x5e773c||0x1f4;return function(_0x2e468b){logger['error'](_0x2e468b[_0x190b('0x37')]);if(_0x2e468b['name']){delete _0x2e468b['name'];}_0x33e9db[_0x190b('0x1f')](_0x5e773c)[_0x190b('0x38')](_0x2e468b);};}exports['index']=function(_0x2ec698,_0xfd0d62){var _0x161756={},_0x5a9cba={'count':0x0,'rows':[]};var _0xde2b0b=_(db[_0x190b('0x39')]['rawAttributes'])['map'](function(_0x2b9de5){return{'name':_0x2b9de5['fieldName'],'type':_0x2b9de5[_0x190b('0x3a')][_0x190b('0x3b')]};})[_0x190b('0x2f')](function(_0xad955a){return!_['includes']([_0x190b('0x3c'),'salt'],_0xad955a[_0x190b('0x35')]);})[_0x190b('0x34')]();_0x161756=qs['getOptions'](_0xde2b0b,_0x2ec698);var _0x2e7889={'where':_0x161756[_0x190b('0x3d')]};return db[_0x190b('0x39')]['count'](_0x2e7889)[_0x190b('0x13')](function(_0x598a46){_0x5a9cba['count']=_0x598a46;if(_0x2ec698['query'][_0x190b('0x3e')]){_0x161756[_0x190b('0x3f')]=[{'all':!![]}];}if(!_[_0x190b('0x32')](_0x161756[_0x190b('0x40')],'id')){_0x161756['attributes']['push']('id');}return db[_0x190b('0x39')]['findAll'](_0x161756);})[_0x190b('0x13')](function(_0x3d67f0){_0x5a9cba['rows']=_0x3d67f0;if(_0x2ec698[_0x190b('0x41')][_0x190b('0x42')]===_0x190b('0x43')){var _0x47e414=[];for(var _0x4b6584=0x0;_0x4b6584<_0x5a9cba[_0x190b('0x44')]['length'];_0x4b6584++){_0x47e414[_0x190b('0x45')](get_open_tabs('chat',_0x5a9cba[_0x190b('0x44')][_0x4b6584][_0x190b('0x46')]));_0x47e414[_0x190b('0x45')](get_open_tabs('sms',_0x5a9cba[_0x190b('0x44')][_0x4b6584]['dataValues']));_0x47e414[_0x190b('0x45')](get_open_tabs(_0x190b('0x47'),_0x5a9cba[_0x190b('0x44')][_0x4b6584][_0x190b('0x46')]));_0x47e414[_0x190b('0x45')](get_open_tabs(_0x190b('0x48'),_0x5a9cba[_0x190b('0x44')][_0x4b6584]['dataValues']));_0x47e414[_0x190b('0x45')](get_open_tabs(_0x190b('0x49'),_0x5a9cba[_0x190b('0x44')][_0x4b6584]['dataValues']));_0x47e414[_0x190b('0x45')](get_open_tabs(_0x190b('0x4a'),_0x5a9cba[_0x190b('0x44')][_0x4b6584][_0x190b('0x46')]));}return BPromise[_0x190b('0x4b')](_0x47e414)['then'](function(_0x1f2262){return _0x5a9cba;});}else{return _0x5a9cba;}})[_0x190b('0x13')](respondWithFilteredResult(_0xfd0d62,_0x161756))[_0x190b('0x1e')](handleError(_0xfd0d62,null));};exports['show']=function(_0x129a53,_0x27591f){var _0x2b0a3a={'raw':![],'where':{'id':_0x129a53['params']['id']}},_0x505e52={};_0x505e52[_0x190b('0x4c')]=_[_0x190b('0x4d')](_[_0x190b('0x4e')](db[_0x190b('0x39')][_0x190b('0x4f')]),[_0x190b('0x3c'),'salt']);_0x505e52[_0x190b('0x41')]=_[_0x190b('0x4e')](_0x129a53[_0x190b('0x41')]);_0x505e52['filters']=_[_0x190b('0x50')](_0x505e52[_0x190b('0x4c')],_0x505e52[_0x190b('0x41')]);_0x2b0a3a['attributes']=_[_0x190b('0x50')](_0x505e52[_0x190b('0x4c')],qs[_0x190b('0x51')](_0x129a53[_0x190b('0x41')][_0x190b('0x51')]));_0x2b0a3a[_0x190b('0x40')]=_0x2b0a3a[_0x190b('0x40')][_0x190b('0x52')]?_0x2b0a3a[_0x190b('0x40')]:_0x505e52[_0x190b('0x4c')];if(_0x129a53[_0x190b('0x41')]['includeAll']){_0x2b0a3a[_0x190b('0x3f')]=[{'all':!![]}];}_0x2b0a3a=_['merge']({},_0x2b0a3a,_0x129a53[_0x190b('0x53')]);if(!_[_0x190b('0x32')](_0x2b0a3a['attributes'],'id')){_0x2b0a3a[_0x190b('0x40')][_0x190b('0x45')]('id');}return db[_0x190b('0x39')][_0x190b('0x33')](_0x2b0a3a)[_0x190b('0x13')](handleEntityNotFound(_0x27591f,null))[_0x190b('0x13')](function(_0x618748){var _0x262419=[];values=_0x618748;if(_0x129a53['query'][_0x190b('0x42')]===_0x190b('0x43')){_0x262419[_0x190b('0x45')](get_open_tabs('chat',_0x618748[_0x190b('0x46')]));_0x262419['push'](get_open_tabs('sms',_0x618748[_0x190b('0x46')]));_0x262419[_0x190b('0x45')](get_open_tabs(_0x190b('0x49'),_0x618748[_0x190b('0x46')]));_0x262419[_0x190b('0x45')](get_open_tabs(_0x190b('0x4a'),_0x618748[_0x190b('0x46')]));_0x262419[_0x190b('0x45')](get_open_tabs(_0x190b('0x47'),_0x618748[_0x190b('0x46')]));_0x262419[_0x190b('0x45')](get_open_tabs(_0x190b('0x48'),_0x618748[_0x190b('0x46')]));return BPromise[_0x190b('0x4b')](_0x262419);}else{return values;}})['then'](function(_0x3f80ce){return values;})[_0x190b('0x13')](respondWithResult(_0x27591f,null))[_0x190b('0x1e')](handleError(_0x27591f,null));};exports[_0x190b('0x27')]=function(_0x53d740,_0x50f9f7){if(_0x53d740[_0x190b('0x54')]['id']){delete _0x53d740[_0x190b('0x54')]['id'];}delete _0x53d740['body'][_0x190b('0x29')];return db['User'][_0x190b('0x33')]({'where':{'id':_0x53d740[_0x190b('0x55')]['id']}})[_0x190b('0x13')](handleEntityNotFound(_0x50f9f7,null))['then'](saveUpdates(_0x53d740[_0x190b('0x54')],null))[_0x190b('0x13')](respondWithResult(_0x50f9f7,null))[_0x190b('0x1e')](handleError(_0x50f9f7,null));};exports[_0x190b('0x56')]=function(_0x135fbe,_0x12724e){return db[_0x190b('0x39')][_0x190b('0x56')]()[_0x190b('0x13')](respondWithResult(_0x12724e,null))['catch'](handleError(_0x12724e,null));};exports['addContacts']=function(_0x2cfe68,_0x30b6ac){return db[_0x190b('0x39')][_0x190b('0x33')]({'where':{'id':_0x2cfe68['params']['id']}})[_0x190b('0x13')](handleEntityNotFound(_0x30b6ac,null))[_0x190b('0x13')](function(_0x481862){if(_0x481862){return _0x481862[_0x190b('0x57')](_0x2cfe68[_0x190b('0x54')][_0x190b('0x58')],_[_0x190b('0x59')](_0x2cfe68[_0x190b('0x54')],[_0x190b('0x58'),'id'])||{});}})[_0x190b('0x13')](respondWithResult(_0x30b6ac,null))[_0x190b('0x1e')](handleError(_0x30b6ac,null));};function validateUser(_0x550d04){return new BPromise(function(_0x14d1b8,_0x5deaf2){if(_0x550d04['internal'])return _0x14d1b8(_0x550d04);return db[_0x190b('0x5a')][_0x190b('0x5b')](0x1)[_0x190b('0x13')](function(_0x4e3d20){if(_0x4e3d20['securePassword'])authService[_0x190b('0x5c')](_0x550d04[_0x190b('0x3c')]);db[_0x190b('0x39')][_0x190b('0x5d')](_0x190b('0x5e'))[_0x190b('0x13')](function(_0xf3a6d0){if(_[_0x190b('0x5f')](_0xf3a6d0)){_0x550d04['internal']=_0x4e3d20[_0x190b('0x60')]||0x1;return;}if(_[_0x190b('0x5f')](_0x4e3d20[_0x190b('0x60')])||_0x4e3d20[_0x190b('0x60')]===_0xf3a6d0){_0x550d04[_0x190b('0x5e')]=_0xf3a6d0+0x1;return;}if(_0x4e3d20['min_internal']>_0xf3a6d0){_0x550d04[_0x190b('0x5e')]=_0x4e3d20[_0x190b('0x60')];return;}return db[_0x190b('0x61')]['query'](_0x190b('0x62'),{'type':db[_0x190b('0x61')][_0x190b('0x63')][_0x190b('0x64')]})['then'](function(_0x540da5){if(_0x540da5&&_0x540da5[_0x190b('0x52')]){for(var _0x2bf55e=0x0,_0x2f97ef=_0x540da5['length'];_0x2bf55e<_0x2f97ef&&_[_0x190b('0x5f')](_0x550d04['internal']);_0x2bf55e++){if(_0x4e3d20[_0x190b('0x60')]<=_0x540da5[_0x2bf55e][_0x190b('0x65')]){_0x550d04[_0x190b('0x5e')]=_0x540da5[_0x2bf55e][_0x190b('0x65')];}else if(_0x4e3d20['min_internal']>_0x540da5[_0x2bf55e][_0x190b('0x65')]&&_0x4e3d20['min_internal']<=_0x540da5[_0x2bf55e]['to']){_0x550d04[_0x190b('0x5e')]=_0x4e3d20['min_internal'];}}}if(_['isNil'](_0x550d04[_0x190b('0x5e')])){_0x550d04['internal']=_0xf3a6d0+0x1;}return _0x14d1b8(_0x550d04);});});})[_0x190b('0x1e')](function(_0x76f768){_0x5deaf2(_0x76f768);});});}function updateUser(_0x24ff6a){return new BPromise(function(_0x3b6803,_0x425641){try{if(_0x24ff6a['voicemail']){_0x24ff6a[_0x190b('0x66')]=_0x24ff6a[_0x190b('0x5e')];_0x24ff6a[_0x190b('0x67')]={'mailbox':_0x24ff6a['internal'],'password':_0x24ff6a[_0x190b('0x3c')],'fullname':_0x24ff6a[_0x190b('0x68')],'email':_0x24ff6a['email']};}if(_0x24ff6a[_0x190b('0x29')]===_0x190b('0x2c')){if(!_0x24ff6a[_0x190b('0x69')])_0x24ff6a['permissions']=[_0x190b('0x6a'),_0x190b('0x6b'),_0x190b('0x6c'),_0x190b('0x6d'),'110',_0x190b('0x6e'),_0x190b('0x6f'),_0x190b('0x70'),'107',_0x190b('0x71'),_0x190b('0x72'),_0x190b('0x73'),'111',_0x190b('0x74'),_0x190b('0x75')];}_0x3b6803(_0x24ff6a);}catch(_0x71f228){_0x425641(_0x71f228);}});}exports[_0x190b('0x76')]=function(_0x2bd35c,_0x5d67c1){if(_0x2bd35c['user'][_0x190b('0x29')]===_0x190b('0x2c'))throw new Error('Unauthorized');if(_0x2bd35c[_0x190b('0x54')][_0x190b('0x29')]==='user'&&_0x2bd35c['user'][_0x190b('0x29')]!==_0x190b('0x77')){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user');}if(_0x2bd35c['body'][_0x190b('0x29')]===_0x190b('0x77')&&_0x2bd35c[_0x190b('0x78')][_0x190b('0x29')]!==_0x190b('0x77')){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20another\x20administrator');}return licenseUtil['checkUserLimits']([_0x2bd35c[_0x190b('0x54')]])['then'](function(){return validateUser(_0x2bd35c[_0x190b('0x54')]);})[_0x190b('0x13')](function(_0x472dea){return updateUser(_0x472dea)[_0x190b('0x13')](function(_0x16b41f){if(_0x16b41f[_0x190b('0x29')]===_0x190b('0x77')){_0x16b41f[_0x190b('0x79')]=_0x2bd35c[_0x190b('0x78')][_0x190b('0x79')];delete _0x16b41f[_0x190b('0x7a')];}return _0x16b41f;});})['then'](function(_0xaee442){return db[_0x190b('0x39')][_0x190b('0x76')](_0xaee442,{'include':[{'model':db['VoiceMail'],'as':'VoiceMail'}]});})[_0x190b('0x13')](function(_0x27eacf){if(_0x2bd35c['body'][_0x190b('0x29')]===_0x190b('0x78'))return _0x27eacf;if(_0x2bd35c[_0x190b('0x78')]['role']!==_0x190b('0x78'))return _0x27eacf;return db[_0x190b('0x7b')]['find']({'where':{'name':_0x27eacf[_0x190b('0x29')]===_0x190b('0x2c')?'Agents':_0x190b('0x2d'),'userProfileId':_0x2bd35c['user']['userProfileId']},'raw':!![]})['then'](function(_0x55e228){if(!_0x55e228||_0x55e228[_0x190b('0x7c')]!=0x0)return _0x27eacf;return db[_0x190b('0x36')]['create']({'name':_0x27eacf[_0x190b('0x35')],'resourceId':_0x27eacf['id'],'type':_0x55e228[_0x190b('0x35')],'sectionId':_0x55e228['id']},{})['then'](function(){return _0x27eacf;});})[_0x190b('0x1e')](function(_0x452449){logger[_0x190b('0x1a')](_0x190b('0x7d'),_0x452449);throw _0x452449;});})[_0x190b('0x13')](respondWithResult(_0x5d67c1,0xc9))[_0x190b('0x1e')](handleError(_0x5d67c1,null));};exports[_0x190b('0x7e')]=function(_0x29e335,_0xc3610b){var _0x55eab0=_0x29e335[_0x190b('0x54')];var _0x5865b5=[];if(_0x29e335['user'][_0x190b('0x29')]===_0x190b('0x2c'))throw new Error(_0x190b('0x7f'));if(_[_0x190b('0x80')](_0x55eab0,[_0x190b('0x29'),_0x190b('0x78')])&&_0x29e335[_0x190b('0x78')][_0x190b('0x29')]!==_0x190b('0x77')){throw new Error(_0x190b('0x81'));}if(_[_0x190b('0x80')](_0x55eab0,[_0x190b('0x29'),'admin'])&&_0x29e335[_0x190b('0x78')][_0x190b('0x29')]!==_0x190b('0x77')){throw new Error(_0x190b('0x82'));}return licenseUtil[_0x190b('0x83')](_0x55eab0)[_0x190b('0x13')](function(){return validateUser(_0x55eab0[0x0]);})[_0x190b('0x13')](function(){for(var _0x173b45=0x1;_0x173b45<_0x55eab0[_0x190b('0x52')];_0x173b45++){var _0x4e35a4=_0x55eab0[_0x173b45-0x1][_0x190b('0x5e')];if(!_0x55eab0[_0x173b45][_0x190b('0x5e')])_0x55eab0[_0x173b45][_0x190b('0x5e')]=_0x4e35a4+0x1;_0x5865b5['push'](validateUser(_0x55eab0[_0x173b45]));}return BPromise[_0x190b('0x4b')](_0x5865b5);})[_0x190b('0x13')](function(){_0x5865b5=[];for(var _0x4e73ad=0x0;_0x4e73ad<_0x55eab0['length'];_0x4e73ad++){_0x5865b5[_0x190b('0x45')](updateUser(_0x55eab0[_0x4e73ad]));}return BPromise[_0x190b('0x4b')](_0x5865b5);})[_0x190b('0x13')](function(){return BPromise[_0x190b('0x84')](_0x55eab0,function(_0x15c495){return db[_0x190b('0x39')][_0x190b('0x76')](_0x15c495,{'include':[{'model':db[_0x190b('0x67')],'as':_0x190b('0x67')}]})[_0x190b('0x13')](function(_0x585137){_0x15c495['id']=_0x585137['id'];return _0x15c495;});});})[_0x190b('0x13')](function(_0x203dbd){if(_0x29e335[_0x190b('0x54')]['role']===_0x190b('0x78'))return _0x203dbd;if(_0x29e335[_0x190b('0x78')][_0x190b('0x29')]!==_0x190b('0x78'))return _0x203dbd;var _0x1c5cf3=_[_0x190b('0x80')](_0x203dbd,function(_0x5eefe2){return _0x5eefe2[_0x190b('0x29')]===_0x190b('0x2c')||_0x5eefe2['role']===_0x190b('0x2e');});if(!_0x1c5cf3)return _0x203dbd;return db[_0x190b('0x7b')][_0x190b('0x85')]({'where':{'name':{'$or':[_0x190b('0x2b'),_0x190b('0x2d')]},'userProfileId':_0x29e335[_0x190b('0x78')][_0x190b('0x7a')]},'raw':!![]})[_0x190b('0x13')](function(_0x56f872){if(_[_0x190b('0x86')](_0x56f872)||!_[_0x190b('0x80')](_0x56f872,[_0x190b('0x7c'),0x0]))return _0x203dbd;_0x5865b5=[];var _0x22aad4=_(_0x56f872)['map'](function(_0x4661a9){if(_0x4661a9[_0x190b('0x7c')]===0x1)return;return _0x4661a9['name']===_0x190b('0x2b')?_0x190b('0x2c'):_0x190b('0x2e');})[_0x190b('0x87')]()[_0x190b('0x34')]();for(var _0x256cb7=0x0;_0x256cb7<_0x203dbd[_0x190b('0x52')];_0x256cb7++){if(!_['includes'](_0x22aad4,_0x203dbd[_0x256cb7][_0x190b('0x29')]))return;var _0x30d158=_0x203dbd[_0x256cb7][_0x190b('0x29')]==='agent'?_0x190b('0x2b'):'Telephones';_0x5865b5[_0x190b('0x45')](db[_0x190b('0x36')][_0x190b('0x76')]({'name':_0x203dbd[_0x256cb7][_0x190b('0x35')],'resourceId':_0x203dbd[_0x256cb7]['id'],'type':_0x30d158,'sectionId':_[_0x190b('0x33')](_0x56f872,[_0x190b('0x35'),_0x30d158])['id']},{}));}return BPromise[_0x190b('0x4b')](_0x5865b5);});})['then'](respondWithResult(_0xc3610b,0xc9))[_0x190b('0x1e')](handleError(_0xc3610b,null));};exports['changePassword']=function(_0x56851d,_0x5e9465){if(_0x56851d[_0x190b('0x54')]['id']){delete _0x56851d[_0x190b('0x54')]['id'];}return db['User'][_0x190b('0x33')]({'where':{'id':_0x56851d[_0x190b('0x55')]['id']}})[_0x190b('0x13')](function(_0xe2dfbd){if(!_0xe2dfbd)return null;if(_0xe2dfbd['id']===_0x56851d[_0x190b('0x78')]['id']){if(!_0x56851d['body']['oldPassword']||!_0x56851d['body'][_0x190b('0x88')]){throw new db[(_0x190b('0x89'))][(_0x190b('0x8a'))]('Invalid\x20body\x20format.\x20Use\x20oldPassword\x20and\x20newPassword');}if(!_0xe2dfbd[_0x190b('0x8b')](_0x56851d[_0x190b('0x54')][_0x190b('0x8c')])){throw new db[(_0x190b('0x89'))][(_0x190b('0x8a'))]('Wrong\x20credentials');}if(_0x56851d[_0x190b('0x54')]['oldPassword']===_0x56851d[_0x190b('0x54')][_0x190b('0x88')]){throw new db[(_0x190b('0x89'))]['ValidationError']('New\x20password\x20must\x20be\x20different\x20from\x20old\x20password');}}else if(_0x56851d[_0x190b('0x78')]['role']===_0x190b('0x77')){if(!_0x56851d[_0x190b('0x54')][_0x190b('0x88')]){throw new db[(_0x190b('0x89'))][(_0x190b('0x8a'))](_0x190b('0x8d'));}}else if(_0x56851d[_0x190b('0x78')][_0x190b('0x29')]===_0x190b('0x78')){if(!_0x56851d[_0x190b('0x54')][_0x190b('0x88')]){throw new db[(_0x190b('0x89'))][(_0x190b('0x8a'))](_0x190b('0x8d'));}if(_0xe2dfbd[_0x190b('0x29')]!==_0x190b('0x2c')){throw new db['Sequelize'][(_0x190b('0x8a'))](_0x190b('0x7f'));}}else{throw new db['Sequelize'][(_0x190b('0x8a'))](_0x190b('0x7f'));}return _0xe2dfbd;})['then'](handleEntityNotFound(_0x5e9465,null))['then'](function(_0x54745c){return db[_0x190b('0x5a')][_0x190b('0x8e')]({'attributes':['id',_0x190b('0x8f'),_0x190b('0x90'),'passwordHistoryLimit']})[_0x190b('0x13')](function(_0x10c160){if(_0x10c160[_0x190b('0x8f')])authService[_0x190b('0x5c')](_0x56851d['body'][_0x190b('0x88')]);if(!_0x10c160[_0x190b('0x90')]||!_0x54745c[_0x190b('0x91')])return _0x54745c;authService[_0x190b('0x92')](_0x56851d['body']['newPassword'],_0x54745c[_0x190b('0x91')],_0x10c160[_0x190b('0x93')]);return _0x54745c;})[_0x190b('0x13')](saveUpdates({'password':_0x56851d[_0x190b('0x54')][_0x190b('0x88')],'passwordResetAt':_0x56851d['user']['id']==_0x56851d[_0x190b('0x55')]['id']?moment():null,'previousPasswords':authService[_0x190b('0x94')](_0x56851d[_0x190b('0x54')][_0x190b('0x88')],_0x54745c['previousPasswords'])},null));})['then'](respondWithResult(_0x5e9465,null))['catch'](handleError(_0x5e9465,null));};exports[_0x190b('0x95')]=function(_0x48b4b8,_0x419d67){var _0xeb99e0=_0x48b4b8[_0x190b('0x54')]['channel'];return db[_0x190b('0x39')]['find']({'where':{'id':_0x48b4b8[_0x190b('0x55')]['id']},'attributes':['id',_0x190b('0x35'),_0x190b('0x29'),'online','loginInPause',_0x190b('0x96'),_0x190b('0x97')]})[_0x190b('0x13')](handleEntityNotFound(_0x419d67,null))[_0x190b('0x13')](function(_0x529964){if(_0x529964){if(!utils[_0x190b('0x98')](_0xeb99e0)){throw new db[(_0x190b('0x89'))][(_0x190b('0x8a'))](_0x190b('0x99'));}return _0x529964[_0x190b('0x9a')+_['capitalize'](_0xeb99e0['toLowerCase']())+_0x190b('0x9b')](_0x48b4b8[_0x190b('0x54')][_0x190b('0x58')],{'penalty':_0x48b4b8[_0x190b('0x54')][_0x190b('0x9c')]||0x0})[_0x190b('0x9d')](function(_0x2538f0){for(var _0x4eeff4=0x0;_0x4eeff4<_0x48b4b8['body'][_0x190b('0x58')][_0x190b('0x52')];_0x4eeff4+=0x1){var _0x3ad1bb={'UserId':Number(_0x48b4b8[_0x190b('0x55')]['id'])};_0x3ad1bb[_[_0x190b('0x9e')](_0xeb99e0[_0x190b('0x9f')]())+_0x190b('0xa0')]=Number(_0x48b4b8[_0x190b('0x54')][_0x190b('0x58')][_0x4eeff4]);socket[_0x190b('0xa1')](_0x190b('0x78')+_[_0x190b('0x9e')](_0xeb99e0[_0x190b('0x9f')]())+_0x190b('0xa2'),_0x3ad1bb);}return _0x2538f0;})['then'](function(){if(_0xeb99e0==='voice'){return db[_0x190b('0xa3')][_0x190b('0x85')]({'where':{'id':_0x48b4b8[_0x190b('0x54')][_0x190b('0x58')]||[]},'raw':!![],'attributes':['id',_0x190b('0x35')]});}})[_0x190b('0x13')](function(_0x106545){var _0x1e2ce3=_0x529964[_0x190b('0xa4')]({'plain':!![]});var _0x276aee=[];if(_0xeb99e0==='voice'&&_0x1e2ce3[_0x190b('0x29')]===_0x190b('0x2c')&&_0x1e2ce3['online']){for(var _0x3afc13=0x0;_0x3afc13<_0x106545['length'];_0x3afc13+=0x1){_0x276aee['push']({'membername':_0x1e2ce3[_0x190b('0x35')],'UserId':_0x1e2ce3['id'],'queue_name':_0x106545[_0x3afc13][_0x190b('0x35')],'VoiceQueueId':_0x106545[_0x3afc13]['id'],'interface':_[_0x190b('0x5f')](_0x1e2ce3[_0x190b('0x97')])?util[_0x190b('0xa5')]('SIP/%s',_0x1e2ce3[_0x190b('0x35')]):_0x1e2ce3[_0x190b('0x97')],'paused':_0x1e2ce3[_0x190b('0x96')]||![],'penalty':_0x48b4b8['body'][_0x190b('0x9c')]||0x0});}return BPromise[_0x190b('0x84')](_0x276aee,function(_0x15f242){return db['UserVoiceQueueRt'][_0x190b('0xa6')](_0x15f242);});}return _0x529964;});}})[_0x190b('0x13')](respondWithStatusCode(_0x419d67,null))[_0x190b('0x1e')](handleError(_0x419d67,null));};exports[_0x190b('0xa7')]=function(_0x443af0,_0x4458b9){var _0x266574;return db['User']['find']({'where':{'id':_0x443af0[_0x190b('0x55')]['id']},'attributes':['id',_0x190b('0x35'),_0x190b('0x29')]})[_0x190b('0x13')](handleEntityNotFound(_0x4458b9,null))[_0x190b('0x13')](function(_0x19c2a3){if(_0x19c2a3){_0x266574=_0x19c2a3;if(!_0x443af0[_0x190b('0x41')][_0x190b('0xa8')]||!utils['isValidChannel'](_0x443af0[_0x190b('0x41')][_0x190b('0xa8')])){throw new db[(_0x190b('0x89'))][(_0x190b('0x8a'))](_0x190b('0x99'));}return _0x19c2a3[_0x190b('0xa9')+_['capitalize'](_0x443af0['query'][_0x190b('0xa8')][_0x190b('0x9f')]())+_0x190b('0x9b')](_0x443af0['query'][_0x190b('0x58')]);}})[_0x190b('0x13')](function(_0x2f227f){if(_['isArray'](_0x443af0[_0x190b('0x41')][_0x190b('0x58')])){for(var _0x4d6ee0=0x0;_0x4d6ee0<_0x443af0[_0x190b('0x41')][_0x190b('0x58')][_0x190b('0x52')];_0x4d6ee0+=0x1){var _0x3acdcb={'UserId':Number(_0x443af0[_0x190b('0x55')]['id'])};_0x3acdcb[_[_0x190b('0x9e')](_0x443af0[_0x190b('0x41')][_0x190b('0xa8')][_0x190b('0x9f')]())+_0x190b('0xa0')]=Number(_0x443af0['query'][_0x190b('0x58')][_0x4d6ee0]);socket[_0x190b('0xa1')](_0x190b('0x78')+_[_0x190b('0x9e')](_0x443af0[_0x190b('0x41')][_0x190b('0xa8')][_0x190b('0x9f')]())+_0x190b('0xaa'),_0x3acdcb);}}else{var _0x3acdcb={'UserId':Number(_0x443af0['params']['id'])};_0x3acdcb[_['capitalize'](_0x443af0[_0x190b('0x41')][_0x190b('0xa8')]['toLowerCase']())+'QueueId']=Number(_0x443af0[_0x190b('0x41')][_0x190b('0x58')]);socket[_0x190b('0xa1')](_0x190b('0x78')+_[_0x190b('0x9e')](_0x443af0[_0x190b('0x41')][_0x190b('0xa8')][_0x190b('0x9f')]())+_0x190b('0xaa'),_0x3acdcb);}return _0x2f227f;})[_0x190b('0x13')](function(){if(_0x443af0[_0x190b('0x41')]['channel']==='voice'){return db[_0x190b('0xab')][_0x190b('0x28')]({'where':{'UserId':_0x443af0[_0x190b('0x55')]['id'],'VoiceQueueId':_0x443af0['query'][_0x190b('0x58')]},'individualHooks':!![]})['then'](function(){return _0x266574;});}return _0x266574;})[_0x190b('0x13')](respondWithStatusCode(_0x4458b9,null))[_0x190b('0x1e')](handleError(_0x4458b9,null));};exports[_0x190b('0xac')]=function(_0xf71c5,_0x57ff6c){_0xf71c5[_0x190b('0x54')]['userpic']=_0xf71c5[_0x190b('0xad')]['filename'];return db[_0x190b('0x39')][_0x190b('0x33')]({'where':{'id':_0xf71c5[_0x190b('0x55')]['id']}})['then'](handleEntityNotFound(_0x57ff6c,null))[_0x190b('0x13')](saveUpdates(_0xf71c5[_0x190b('0x54')],null))['then'](respondWithResult(_0x57ff6c,null))[_0x190b('0x1e')](handleError(_0x57ff6c,null));};exports['getAvatar']=function(_0x377e7b,_0x3b8071){var _0x31ec79=path[_0x190b('0xae')](config[_0x190b('0xaf')],_0x190b('0xb0'));return db[_0x190b('0x39')][_0x190b('0x33')]({'where':{'id':_0x377e7b['params']['id']},'attributes':['id',_0x190b('0xb1')],'raw':!![]})[_0x190b('0x13')](handleEntityNotFound(_0x3b8071,null))[_0x190b('0x13')](function(_0x436cdc){if(_0x436cdc){if(_[_0x190b('0x5f')](_0x436cdc[_0x190b('0xb1')])){return _0x3b8071[_0x190b('0xb2')](_0x31ec79);}else{if(!fs[_0x190b('0xb3')](path[_0x190b('0xae')](config[_0x190b('0xaf')],_0x190b('0xb4'),_0x436cdc[_0x190b('0xb1')]))){return _0x3b8071[_0x190b('0xb2')](_0x31ec79);}return _0x3b8071[_0x190b('0xb2')](path[_0x190b('0xae')](config[_0x190b('0xaf')],_0x190b('0xb4'),_0x436cdc[_0x190b('0xb1')]));}}})[_0x190b('0x1e')](handleError(_0x3b8071,null));};exports[_0x190b('0xb5')]=function(_0x8b13f,_0x1d73f9){return db['User'][_0x190b('0x33')]({'where':{'id':_0x8b13f['params']['id']},'attributes':['id']})[_0x190b('0x13')](handleEntityNotFound(_0x1d73f9,null))[_0x190b('0x13')](function(_0x4736da){var _0x26dc6f=[];values=_0x4736da[_0x190b('0x46')];_0x26dc6f[_0x190b('0x45')](get_open_tabs(_0x190b('0xb6'),_0x4736da['dataValues']));_0x26dc6f[_0x190b('0x45')](get_open_tabs('sms',_0x4736da[_0x190b('0x46')]));_0x26dc6f['push'](get_open_tabs(_0x190b('0x49'),_0x4736da[_0x190b('0x46')]));_0x26dc6f['push'](get_open_tabs('whatsapp',_0x4736da[_0x190b('0x46')]));_0x26dc6f[_0x190b('0x45')](get_open_tabs('fax',_0x4736da[_0x190b('0x46')]));_0x26dc6f[_0x190b('0x45')](get_open_tabs(_0x190b('0x48'),_0x4736da['dataValues']));return BPromise[_0x190b('0x4b')](_0x26dc6f);})[_0x190b('0x13')](function(_0x1d2c82){var _0x551bc0=[];if(_0x1d2c82){for(var _0x481048=0x0;_0x481048=_0x9602b8[_0xaaca('0x52')]){throw new Error('Maximum\x20login\x20has\x20been\x20reached');}})[_0xaaca('0xf')](function(){if(_0xc74f3f){return db[_0xaaca('0x29')][_0xaaca('0x4c')]({'where':{'membername':_0xc74f3f[_0xaaca('0x32')]},'individualHooks':!![]});}})['then'](function(){if(_0xc74f3f){return _0xc74f3f['getVoiceQueues']({'raw':!![]});}})['then'](function(_0x13b1e2){if(_0xc74f3f){if(_0x13b1e2){var _0x128f5a=[];_0x290240=_0x13b1e2;if(_0x290240[_0xaaca('0x2d')]){for(var _0x4132bd=0x0;_0x4132bd<_0x290240[_0xaaca('0x2d')];_0x4132bd++){_0x128f5a['push'](db['UserVoiceQueueRt'][_0xaaca('0x53')]({'membername':_0xc74f3f['name'],'UserId':_0xc74f3f['id'],'queue_name':_0x290240[_0x4132bd][_0xaaca('0x32')],'VoiceQueueId':_0x290240[_0x4132bd]['id'],'interface':_0x5351b4,'paused':_0xc74f3f[_0xaaca('0x4f')]||![],'penalty':_0x290240[_0x4132bd][_0xaaca('0x54')]||0x0}));}return BPromise[_0xaaca('0x4b')](_0x128f5a);}}}})[_0xaaca('0xf')](function(){if(_0xc74f3f){return db[_0xaaca('0x2a')][_0xaaca('0x2b')]({'where':{'membername':_0xc74f3f['name'],'exitAt':null}});}})[_0xaaca('0xf')](function(_0x554552){if(_0xc74f3f){if(_0x554552&&_0x554552[_0xaaca('0x2d')]){var _0x376bbc=[];_0x554552['forEach'](function(_0x4b0e5f){_0x376bbc['push'](_0x4b0e5f['update']({'exitAt':moment()['format'](_0xaaca('0x36'))}));});return BPromise['all'](_0x376bbc);}}})[_0xaaca('0xf')](function(_0x1f971f){if(_0xc74f3f){var _0x2d5562=[];var _0x277932=[];var _0x5d1258=utils[_0xaaca('0x30')]();var _0x385334={'membername':_0xc74f3f['name'],'interface':_0x5351b4,'enterAt':moment()[_0xaaca('0x2e')]('YYYY-MM-DD\x20HH:mm:ss'),'role':_0xc74f3f[_0xaaca('0x4e')],'internal':_0xc74f3f['internal']};_0x5d1258[_0xaaca('0x4a')](function(_0x14b136){_0x2d5562[_0xaaca('0x31')](_[_0xaaca('0x55')]({'channel':_0x14b136,'type':_0xaaca('0x56'),'data1':_0xaaca('0x57'),'data2':_0x5351b4},_0x385334));if(_0xc74f3f[_0xaaca('0x4f')]){_0x277932[_0xaaca('0x31')](_['merge']({'channel':_0x14b136,'type':_0xaaca('0x2c'),'data1':_0xaaca('0x58')},_0x385334));}});return db[_0xaaca('0x2a')][_0xaaca('0x3a')](_0x2d5562[_0xaaca('0x59')](_0x277932),{'individualHooks':!![]});}})['then'](function(){if(_0xc74f3f){return _0xc74f3f[_0xaaca('0x41')]({'online':!![],'lastLoginAt':moment()['format'](_0xaaca('0x36')),'voicePause':_0xc74f3f[_0xaaca('0x4f')]||![],'mailPause':_0xc74f3f[_0xaaca('0x4f')]||![],'chatPause':_0xc74f3f[_0xaaca('0x4f')]||![],'faxPause':_0xc74f3f['loginInPause']||![],'smsPause':_0xc74f3f[_0xaaca('0x4f')]||![],'openchannelPause':_0xc74f3f[_0xaaca('0x4f')]||![],'pauseType':_0xc74f3f[_0xaaca('0x4f')]?'LOGININPAUSE':null,'lastPauseAt':moment()[_0xaaca('0x2e')](_0xaaca('0x36')),'interface':_0x5351b4});}})[_0xaaca('0xf')](function(_0x4ad1b5){_0x343d37(_0x4ad1b5);})[_0xaaca('0x19')](function(_0x51f75f){_0x340559(_0x380db1[_0xaaca('0x14')](0x1f4,_0x51f75f[_0xaaca('0x16')]));});});}; \ No newline at end of file +var _0xa86b=['role','interface','UserVoiceQueueRt','update','PAUSE','format','length','updateAttributes','getChannels','forEach','push','isNil','SIP/%s','body','type','DEFAULT\x20PAUSE','internal','uniqueid','MemberReport','bulkCreate','YYYY-MM-DD\x20HH:mm:ss','UnpauseUser','findOne','channel','isValidChannel','voice','system','mail','fax','set','Pause','destroy','all','mobile','phone','count','../../config/license/util','getLicense','Maximum\x20login\x20has\x20been\x20reached','getVoiceQueues','upsert','loginInPause','UserVoiceQueue.penalty','LOGIN','callysquare','concat','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','register','then','info','request\x20sent','debug','stringify','error','code','User,\x20%s,\x20%s','message','result','catch','GetUser','User','findAll','options','raw','where','attributes','limit','include','map','model','ShowUser','find','PauseUser','name'];(function(_0x22fb94,_0x9a235c){var _0x33da77=function(_0x58edb8){while(--_0x58edb8){_0x22fb94['push'](_0x22fb94['shift']());}};_0x33da77(++_0x9a235c);}(_0xa86b,0x18e));var _0xba86=function(_0x125155,_0x315d57){_0x125155=_0x125155-0x0;var _0x4f42b5=_0xa86b[_0x125155];return _0x4f42b5;};'use strict';var _=require(_0xba86('0x0'));var util=require(_0xba86('0x1'));var moment=require(_0xba86('0x2'));var BPromise=require(_0xba86('0x3'));var rs=require(_0xba86('0x4'));var fs=require('fs');var Redis=require(_0xba86('0x5'));var db=require(_0xba86('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xba86('0x7'))(_0xba86('0x8'));var config=require('../../config/environment');var jayson=require(_0xba86('0x9'));var client=jayson[_0xba86('0xa')]['http']({'port':0x232a});config[_0xba86('0xb')]=_[_0xba86('0xc')](config[_0xba86('0xb')],{'host':_0xba86('0xd'),'port':0x18eb});var socket=require(_0xba86('0xe'))(new Redis(config[_0xba86('0xb')]));require('./user.socket')[_0xba86('0xf')](socket);function respondWithRpcPromise(_0x126895,_0x308aba,_0x5cb632){return new BPromise(function(_0x18da94,_0x10efe3){return client['request'](_0x126895,_0x5cb632)[_0xba86('0x10')](function(_0x13b12b){logger[_0xba86('0x11')]('User,\x20%s,\x20%s',_0x308aba,_0xba86('0x12'));logger[_0xba86('0x13')]('User,\x20%s,\x20%s,\x20%s',_0x308aba,_0xba86('0x12'),JSON[_0xba86('0x14')](_0x13b12b));if(_0x13b12b[_0xba86('0x15')]){if(_0x13b12b[_0xba86('0x15')][_0xba86('0x16')]===0x1f4){logger[_0xba86('0x15')](_0xba86('0x17'),_0x308aba,_0x13b12b[_0xba86('0x15')][_0xba86('0x18')]);return _0x10efe3(_0x13b12b['error'][_0xba86('0x18')]);}logger['error'](_0xba86('0x17'),_0x308aba,_0x13b12b['error'][_0xba86('0x18')]);return _0x18da94(_0x13b12b[_0xba86('0x15')]['message']);}else{logger['info']('User,\x20%s,\x20%s',_0x308aba,'request\x20sent');_0x18da94(_0x13b12b[_0xba86('0x19')][_0xba86('0x18')]);}})[_0xba86('0x1a')](function(_0x57e1c1){logger[_0xba86('0x15')](_0xba86('0x17'),_0x308aba,_0x57e1c1);_0x10efe3(_0x57e1c1);});});}exports[_0xba86('0x1b')]=function(_0x1837c7){var _0x2c6cd2=this;return new Promise(function(_0x4b0bef,_0x3a2738){return db[_0xba86('0x1c')][_0xba86('0x1d')]({'raw':_0x1837c7[_0xba86('0x1e')]?_0x1837c7[_0xba86('0x1e')][_0xba86('0x1f')]===undefined?!![]:![]:!![],'where':_0x1837c7[_0xba86('0x1e')]?_0x1837c7[_0xba86('0x1e')][_0xba86('0x20')]||null:null,'attributes':_0x1837c7[_0xba86('0x1e')]?_0x1837c7[_0xba86('0x1e')][_0xba86('0x21')]||null:null,'limit':_0x1837c7[_0xba86('0x1e')]?_0x1837c7['options'][_0xba86('0x22')]||null:null,'include':_0x1837c7[_0xba86('0x1e')]?_0x1837c7[_0xba86('0x1e')][_0xba86('0x23')]?_[_0xba86('0x24')](_0x1837c7[_0xba86('0x1e')][_0xba86('0x23')],function(_0x565db8){return{'model':db[_0x565db8['model']],'as':_0x565db8['as'],'attributes':_0x565db8['attributes'],'include':_0x565db8[_0xba86('0x23')]?_[_0xba86('0x24')](_0x565db8[_0xba86('0x23')],function(_0x25c66e){return{'model':db[_0x25c66e[_0xba86('0x25')]],'as':_0x25c66e['as'],'attributes':_0x25c66e[_0xba86('0x21')],'include':_0x25c66e[_0xba86('0x23')]?_[_0xba86('0x24')](_0x25c66e['include'],function(_0x206061){return{'model':db[_0x206061[_0xba86('0x25')]],'as':_0x206061['as'],'attributes':_0x206061[_0xba86('0x21')]};}):[]};}):[]};}):[]:[]})[_0xba86('0x10')](function(_0x1108ea){logger[_0xba86('0x11')](_0xba86('0x1b'),_0x1837c7);logger[_0xba86('0x13')](_0xba86('0x1b'),_0x1837c7,JSON[_0xba86('0x14')](_0x1108ea));_0x4b0bef(_0x1108ea);})['catch'](function(_0x24ef93){logger[_0xba86('0x15')]('GetUser',_0x24ef93[_0xba86('0x18')],_0x1837c7);_0x3a2738(_0x2c6cd2[_0xba86('0x15')](0x1f4,_0x24ef93['message']));});});};exports[_0xba86('0x26')]=function(_0xcc59e){var _0x35d781=this;return new Promise(function(_0xcda5f5,_0x33cc62){return db[_0xba86('0x1c')][_0xba86('0x27')]({'raw':_0xcc59e[_0xba86('0x1e')]?_0xcc59e[_0xba86('0x1e')][_0xba86('0x1f')]===undefined?!![]:![]:!![],'where':_0xcc59e[_0xba86('0x1e')]?_0xcc59e[_0xba86('0x1e')]['where']||null:null,'attributes':_0xcc59e[_0xba86('0x1e')]?_0xcc59e[_0xba86('0x1e')][_0xba86('0x21')]||null:null,'include':_0xcc59e[_0xba86('0x1e')]?_0xcc59e[_0xba86('0x1e')][_0xba86('0x23')]?_['map'](_0xcc59e[_0xba86('0x1e')][_0xba86('0x23')],function(_0x3a70bd){return{'model':db[_0x3a70bd['model']],'as':_0x3a70bd['as'],'attributes':_0x3a70bd[_0xba86('0x21')],'include':_0x3a70bd[_0xba86('0x23')]?_[_0xba86('0x24')](_0x3a70bd[_0xba86('0x23')],function(_0x3fd98f){return{'model':db[_0x3fd98f['model']],'as':_0x3fd98f['as'],'attributes':_0x3fd98f[_0xba86('0x21')],'include':_0x3fd98f[_0xba86('0x23')]?_[_0xba86('0x24')](_0x3fd98f[_0xba86('0x23')],function(_0x12e941){return{'model':db[_0x12e941[_0xba86('0x25')]],'as':_0x12e941['as'],'attributes':_0x12e941['attributes']};}):[]};}):[]};}):[]:[]})[_0xba86('0x10')](function(_0x418182){logger[_0xba86('0x11')](_0xba86('0x26'),_0xcc59e);logger['debug'](_0xba86('0x26'),_0xcc59e,JSON[_0xba86('0x14')](_0x418182));_0xcda5f5(_0x418182);})[_0xba86('0x1a')](function(_0x1fc70a){logger[_0xba86('0x15')](_0xba86('0x26'),_0x1fc70a[_0xba86('0x18')],_0xcc59e);_0x33cc62(_0x35d781[_0xba86('0x15')](0x1f4,_0x1fc70a[_0xba86('0x18')]));});});};exports[_0xba86('0x28')]=function(_0x45e483){var _0x2a13a3=this;return new Promise(function(_0x127611,_0x458478){var _0x5c1789;return db[_0xba86('0x1c')][_0xba86('0x27')]({'where':_0x45e483[_0xba86('0x1e')][_0xba86('0x20')]||{},'attributes':['id',_0xba86('0x29'),_0xba86('0x2a'),'internal',_0xba86('0x2b')]})[_0xba86('0x10')](function(_0x231036){if(_0x231036){_0x5c1789=_0x231036;return db[_0xba86('0x2c')][_0xba86('0x2d')]({'paused':0x1},{'where':{'UserId':_0x5c1789['id']},'individualHooks':!![]});}})[_0xba86('0x10')](function(){if(_0x5c1789){return db['MemberReport'][_0xba86('0x1d')]({'where':{'membername':_0x5c1789[_0xba86('0x29')],'type':_0xba86('0x2e'),'exitAt':null}});}})[_0xba86('0x10')](function(_0x2e6e5f){if(_0x5c1789){if(_0x2e6e5f&&_0x2e6e5f['length']){var _0x118bc4=moment()[_0xba86('0x2f')]('YYYY-MM-DD\x20HH:mm:ss');for(var _0xb349f8=0x0,_0x4a4eb7=_0x2e6e5f[_0xba86('0x30')];_0xb349f8<_0x4a4eb7;_0xb349f8++){_0x2e6e5f[_0xb349f8][_0xba86('0x31')]({'exitAt':_0x118bc4});}}}})[_0xba86('0x10')](function(){if(_0x5c1789){var _0x868fa5=[];var _0x4ee6da=utils[_0xba86('0x32')]();_0x4ee6da[_0xba86('0x33')](function(_0x5240f1){_0x868fa5[_0xba86('0x34')]({'channel':_0x5240f1,'membername':_0x5c1789[_0xba86('0x29')],'interface':_[_0xba86('0x35')](_0x5c1789[_0xba86('0x2b')])?util[_0xba86('0x2f')](_0xba86('0x36'),_0x5c1789[_0xba86('0x29')]):_0x5c1789[_0xba86('0x2b')],'type':'PAUSE','enterAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'data1':_0x45e483[_0xba86('0x37')][_0xba86('0x38')]||_0xba86('0x39'),'role':_0x5c1789[_0xba86('0x2a')],'internal':_0x5c1789[_0xba86('0x3a')],'uniqueid':_0x45e483[_0xba86('0x37')][_0xba86('0x3b')]||null});});return db[_0xba86('0x3c')][_0xba86('0x3d')](_0x868fa5,{'individualHooks':!![]});}})['then'](function(){if(_0x5c1789){return _0x5c1789[_0xba86('0x2d')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'openchannelPause':!![],'whatsappPause':!![],'pauseType':_0x45e483[_0xba86('0x37')]['type']||_0xba86('0x39'),'lastPauseAt':moment()[_0xba86('0x2f')](_0xba86('0x3e'))});}})['then'](function(_0x5f212a){_0x127611(_0x5f212a);})[_0xba86('0x1a')](function(_0x126e77){_0x458478(_0x2a13a3['error'](0x1f4,_0x126e77['message']));});});};exports[_0xba86('0x3f')]=function(_0x2b75e9){var _0x2f584e=this;return new Promise(function(_0x142400,_0x522eb7){var _0x20186a;return db['User'][_0xba86('0x40')]({'where':_0x2b75e9[_0xba86('0x1e')][_0xba86('0x20')]||{},'attributes':['id','name']})['then'](function(_0x94af07){if(_0x94af07){_0x20186a=_0x94af07;if(_0x2b75e9[_0xba86('0x37')][_0xba86('0x41')]&&!utils[_0xba86('0x42')](_0x2b75e9[_0xba86('0x37')]['channel'])){throw new Error('Unknown\x20channel');}switch(_0x2b75e9['body'][_0xba86('0x41')]){case _0xba86('0x43'):return db[_0xba86('0x2c')][_0xba86('0x2d')]({'paused':0x0},{'where':{'UserId':_0x20186a['id']}})[_0xba86('0x10')](function(){return db[_0xba86('0x3c')][_0xba86('0x27')]({'where':{'channel':_0x2b75e9[_0xba86('0x37')]['channel'],'membername':_0x20186a[_0xba86('0x29')],'type':'PAUSE','exitAt':null}});})[_0xba86('0x10')](function(_0x581ea6){if(_0x581ea6){return _0x581ea6[_0xba86('0x2d')]({'exitAt':moment()[_0xba86('0x2f')](_0xba86('0x3e')),'data2':_0xba86('0x44')},{'individualHooks':!![]});}return null;})[_0xba86('0x10')](function(){return _0x20186a[_0xba86('0x2d')]({'voicePause':![]});});case _0xba86('0x45'):case'chat':case _0xba86('0x46'):case'sms':case'openchannel':case'whatsapp':return db[_0xba86('0x3c')][_0xba86('0x27')]({'where':{'channel':_0x2b75e9['body'][_0xba86('0x41')],'membername':_0x20186a[_0xba86('0x29')],'type':_0xba86('0x2e'),'exitAt':null}})[_0xba86('0x10')](function(_0xce08a0){return _0xce08a0[_0xba86('0x2d')]({'exitAt':moment()[_0xba86('0x2f')](_0xba86('0x3e')),'data2':'system'},{'individualHooks':!![]});})[_0xba86('0x10')](function(){var _0x16932f={};_[_0xba86('0x47')](_0x16932f,util[_0xba86('0x2f')]('%s%s',_0x2b75e9[_0xba86('0x37')]['channel'],_0xba86('0x48')),![]);return _0x20186a[_0xba86('0x2d')](_0x16932f);});default:return db[_0xba86('0x2c')]['update']({'paused':0x0},{'where':{'UserId':_0x20186a['id']}})[_0xba86('0x10')](function(){return db[_0xba86('0x3c')]['findAll']({'where':{'membername':_0x20186a[_0xba86('0x29')],'type':_0xba86('0x2e'),'exitAt':null}});})[_0xba86('0x10')](function(_0x2ace9e){var _0x11cbe8=[];_0x2ace9e[_0xba86('0x33')](function(_0x5b56c9){_0x11cbe8[_0xba86('0x34')](_0x5b56c9[_0xba86('0x2d')]({'exitAt':moment()[_0xba86('0x2f')](_0xba86('0x3e')),'data2':_0xba86('0x44')}));});return BPromise['all'](_0x11cbe8);})[_0xba86('0x10')](function(){return _0x20186a[_0xba86('0x2d')]({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![]});});}}})[_0xba86('0x10')](function(_0x4dc244){_0x142400(_0x4dc244);})['catch'](function(_0xf23526){_0x522eb7(_0x2f584e['error'](0x1f4,_0xf23526[_0xba86('0x18')]));});});};exports['LogoutUser']=function(_0x22414a){var _0x185172=this;return new Promise(function(_0x571b02,_0x52b6eb){var _0x3a0db1;return db[_0xba86('0x1c')][_0xba86('0x40')]({'where':_0x22414a[_0xba86('0x1e')][_0xba86('0x20')]||{},'attributes':['id',_0xba86('0x29')]})['then'](function(_0xae7aa8){if(_0xae7aa8){_0x3a0db1=_0xae7aa8;return db[_0xba86('0x2c')][_0xba86('0x49')]({'where':{'membername':_0x3a0db1['name']},'individualHooks':!![]});}})[_0xba86('0x10')](function(){if(_0x3a0db1){return db[_0xba86('0x3c')][_0xba86('0x1d')]({'where':{'membername':_0x3a0db1[_0xba86('0x29')],'exitAt':null}});}})['then'](function(_0x5ef76d){if(_0x3a0db1){if(_0x5ef76d&&_0x5ef76d[_0xba86('0x30')]){var _0x513216=[];_0x5ef76d[_0xba86('0x33')](function(_0x5dfedb){_0x513216[_0xba86('0x34')](_0x5dfedb['update']({'exitAt':moment()['format'](_0xba86('0x3e'))}));});return BPromise[_0xba86('0x4a')](_0x513216);}}})[_0xba86('0x10')](function(){if(_0x3a0db1){return _0x3a0db1['update']({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});}})[_0xba86('0x10')](function(_0x32e667){_0x571b02(_0x32e667);})['catch'](function(_0x1e3887){_0x52b6eb(_0x185172[_0xba86('0x15')](0x1f4,_0x1e3887[_0xba86('0x18')]));});});};exports['LoginUser']=function(_0x5133f5){var _0x2596b7=this;return new Promise(function(_0x4e5a0f,_0x54751c){var _0xceeff6;var _0x4f47d7;var _0x292ec4;var _0x158d2c;return db[_0xba86('0x1c')][_0xba86('0x40')]({'where':_0x5133f5[_0xba86('0x1e')][_0xba86('0x20')]||{},'attributes':['id',_0xba86('0x29'),_0xba86('0x2a'),_0xba86('0x4b'),_0xba86('0x4c'),_0xba86('0x3a'),'loginInPause',_0xba86('0x2b')]})['then'](function(_0x3b9bd5){if(_0x3b9bd5){_0xceeff6=_0x3b9bd5;_0x158d2c=_0x5133f5[_0xba86('0x37')][_0xba86('0x2b')]?_0x5133f5[_0xba86('0x37')][_0xba86('0x2b')]:util['format'](_0xba86('0x36'),_0xceeff6[_0xba86('0x29')]);return db['User'][_0xba86('0x4d')]({'where':{'role':'agent','online':!![],'id':{'$ne':_0xceeff6['id']}}});}})[_0xba86('0x10')](function(_0x16cc32){if(_0x16cc32){_0x292ec4=_0x16cc32;return require(_0xba86('0x4e'))[_0xba86('0x4f')]();}})[_0xba86('0x10')](function(_0x27f9f5){if(_0x27f9f5&&_0x27f9f5['agents']&&_0x292ec4>=_0x27f9f5['agents']){throw new Error(_0xba86('0x50'));}})[_0xba86('0x10')](function(){if(_0xceeff6){return db[_0xba86('0x2c')][_0xba86('0x49')]({'where':{'membername':_0xceeff6[_0xba86('0x29')]},'individualHooks':!![]});}})['then'](function(){if(_0xceeff6){return _0xceeff6[_0xba86('0x51')]({'raw':!![]});}})[_0xba86('0x10')](function(_0x4109f3){if(_0xceeff6){if(_0x4109f3){var _0x5ed4c2=[];_0x4f47d7=_0x4109f3;if(_0x4f47d7[_0xba86('0x30')]){for(var _0x333b97=0x0;_0x333b97<_0x4f47d7[_0xba86('0x30')];_0x333b97++){_0x5ed4c2[_0xba86('0x34')](db[_0xba86('0x2c')][_0xba86('0x52')]({'membername':_0xceeff6[_0xba86('0x29')],'UserId':_0xceeff6['id'],'queue_name':_0x4f47d7[_0x333b97]['name'],'VoiceQueueId':_0x4f47d7[_0x333b97]['id'],'interface':_0x158d2c,'paused':_0xceeff6[_0xba86('0x53')]||![],'penalty':_0x4f47d7[_0x333b97][_0xba86('0x54')]||0x0}));}return BPromise[_0xba86('0x4a')](_0x5ed4c2);}}}})['then'](function(){if(_0xceeff6){return db[_0xba86('0x3c')][_0xba86('0x1d')]({'where':{'membername':_0xceeff6['name'],'exitAt':null}});}})['then'](function(_0x24d984){if(_0xceeff6){if(_0x24d984&&_0x24d984[_0xba86('0x30')]){var _0x4f79ad=[];_0x24d984[_0xba86('0x33')](function(_0x41ad2b){_0x4f79ad[_0xba86('0x34')](_0x41ad2b[_0xba86('0x2d')]({'exitAt':moment()['format'](_0xba86('0x3e'))}));});return BPromise['all'](_0x4f79ad);}}})[_0xba86('0x10')](function(_0x5533e8){if(_0xceeff6){var _0x4cd83c=[];var _0x323449=[];var _0x4364ab=utils[_0xba86('0x32')]();var _0x18ef16={'membername':_0xceeff6[_0xba86('0x29')],'interface':_0x158d2c,'enterAt':moment()[_0xba86('0x2f')](_0xba86('0x3e')),'role':_0xceeff6[_0xba86('0x2a')],'internal':_0xceeff6[_0xba86('0x3a')]};_0x4364ab[_0xba86('0x33')](function(_0x142282){_0x4cd83c[_0xba86('0x34')](_['merge']({'channel':_0x142282,'type':_0xba86('0x55'),'data1':_0xba86('0x56'),'data2':_0x158d2c},_0x18ef16));if(_0xceeff6['loginInPause']){_0x323449[_0xba86('0x34')](_['merge']({'channel':_0x142282,'type':'PAUSE','data1':'LOGININPAUSE'},_0x18ef16));}});return db[_0xba86('0x3c')][_0xba86('0x3d')](_0x4cd83c[_0xba86('0x57')](_0x323449),{'individualHooks':!![]});}})[_0xba86('0x10')](function(){if(_0xceeff6){return _0xceeff6[_0xba86('0x2d')]({'online':!![],'lastLoginAt':moment()[_0xba86('0x2f')]('YYYY-MM-DD\x20HH:mm:ss'),'voicePause':_0xceeff6[_0xba86('0x53')]||![],'mailPause':_0xceeff6[_0xba86('0x53')]||![],'chatPause':_0xceeff6['loginInPause']||![],'faxPause':_0xceeff6['loginInPause']||![],'smsPause':_0xceeff6[_0xba86('0x53')]||![],'openchannelPause':_0xceeff6[_0xba86('0x53')]||![],'pauseType':_0xceeff6['loginInPause']?'LOGININPAUSE':null,'lastPauseAt':moment()[_0xba86('0x2f')](_0xba86('0x3e')),'interface':_0x158d2c});}})[_0xba86('0x10')](function(_0x5d352b){_0x4e5a0f(_0x5d352b);})[_0xba86('0x1a')](function(_0x1b8162){_0x54751c(_0x2596b7[_0xba86('0x15')](0x1f4,_0x1b8162[_0xba86('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/user/user.socket.js b/server/api/user/user.socket.js index 074d6d6..6fa3d38 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 _0xd15c=['update','removeListener','length','save','remove'];(function(_0x23a042,_0x169361){var _0x57543a=function(_0x1fccec){while(--_0x1fccec){_0x23a042['push'](_0x23a042['shift']());}};_0x57543a(++_0x169361);}(_0xd15c,0x1b1));var _0xcd15=function(_0x1a6946,_0x1b3237){_0x1a6946=_0x1a6946-0x0;var _0x1990bf=_0xd15c[_0x1a6946];return _0x1990bf;};'use strict';var UserEvents=require('./user.events');var events=[_0xcd15('0x0'),_0xcd15('0x1'),_0xcd15('0x2')];function createListener(_0x8eeb06,_0x2c37cd){return function(_0x2038ba){_0x2c37cd['emit'](_0x8eeb06,_0x2038ba);};}function removeListener(_0x252c12,_0x223739){return function(){UserEvents[_0xcd15('0x3')](_0x252c12,_0x223739);};}exports['register']=function(_0x493849){for(var _0x257ef2=0x0,_0x2b1804=events[_0xcd15('0x4')];_0x257ef2<_0x2b1804;_0x257ef2++){var _0x397035=events[_0x257ef2];var _0x2aefa0=createListener('user:'+_0x397035,_0x493849);UserEvents['on'](_0x397035,_0x2aefa0);}}; \ No newline at end of file +var _0x6f72=['update','emit','length','user:','./user.events','save','remove'];(function(_0x3e9d63,_0x375e22){var _0x4e357e=function(_0x570f7b){while(--_0x570f7b){_0x3e9d63['push'](_0x3e9d63['shift']());}};_0x4e357e(++_0x375e22);}(_0x6f72,0x1ee));var _0x26f7=function(_0x4a5452,_0xa31da4){_0x4a5452=_0x4a5452-0x0;var _0x209900=_0x6f72[_0x4a5452];return _0x209900;};'use strict';var UserEvents=require(_0x26f7('0x0'));var events=[_0x26f7('0x1'),_0x26f7('0x2'),_0x26f7('0x3')];function createListener(_0x213e45,_0x33fe0d){return function(_0x4b66af){_0x33fe0d[_0x26f7('0x4')](_0x213e45,_0x4b66af);};}function removeListener(_0x1ae216,_0x50eaaf){return function(){UserEvents['removeListener'](_0x1ae216,_0x50eaaf);};}exports['register']=function(_0x38a2e3){for(var _0x2352ec=0x0,_0x4312a3=events[_0x26f7('0x5')];_0x2352ec<_0x4312a3;_0x2352ec++){var _0x2227a3=events[_0x2352ec];var _0x56e4b5=createListener(_0x26f7('0x6')+_0x2227a3,_0x38a2e3);UserEvents['on'](_0x2227a3,_0x56e4b5);}}; \ No newline at end of file diff --git a/server/api/userChatQueue/index.js b/server/api/userChatQueue/index.js index 765beaa..19c5990 100644 --- a/server/api/userChatQueue/index.js +++ b/server/api/userChatQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x48437d,_0x326d82){var _0x200808=function(_0x50d749){while(--_0x50d749){_0x48437d['push'](_0x48437d['shift']());}};_0x200808(++_0x326d82);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4154a6,_0x2c0b8e){_0x4154a6=_0x4154a6-0x0;var _0x3b2786=_0xa9e0[_0x4154a6];return _0x3b2786;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router; \ No newline at end of file +var _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x105896,_0x2b1b8e){var _0x397ad0=function(_0xa176ec){while(--_0xa176ec){_0x105896['push'](_0x105896['shift']());}};_0x397ad0(++_0x2b1b8e);}(_0x9c44,0x178));var _0x49c4=function(_0x45d55e,_0x2fede3){_0x45d55e=_0x45d55e-0x0;var _0x29812a=_0x9c44[_0x45d55e];return _0x29812a;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x49c4('0x6')]=router; \ No newline at end of file diff --git a/server/api/userChatQueue/userChatQueue.attributes.js b/server/api/userChatQueue/userChatQueue.attributes.js index b220a72..f76e76f 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 _0x33c8=['sequelize','exports','INTEGER'];(function(_0x505463,_0x4c7075){var _0x46637f=function(_0x353ae4){while(--_0x353ae4){_0x505463['push'](_0x505463['shift']());}};_0x46637f(++_0x4c7075);}(_0x33c8,0xb7));var _0x833c=function(_0x42a26a,_0xcd612a){_0x42a26a=_0x42a26a-0x0;var _0x4def88=_0x33c8[_0x42a26a];return _0x4def88;};'use strict';var Sequelize=require(_0x833c('0x0'));module[_0x833c('0x1')]={'penalty':{'type':Sequelize[_0x833c('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0xf185=['sequelize','INTEGER'];(function(_0xe6e5fb,_0x567477){var _0x54e344=function(_0x1a696c){while(--_0x1a696c){_0xe6e5fb['push'](_0xe6e5fb['shift']());}};_0x54e344(++_0x567477);}(_0xf185,0x1be));var _0x5f18=function(_0x22e4ae,_0x5a34c6){_0x22e4ae=_0x22e4ae-0x0;var _0x172c2f=_0xf185[_0x22e4ae];return _0x172c2f;};'use strict';var Sequelize=require(_0x5f18('0x0'));module['exports']={'penalty':{'type':Sequelize[_0x5f18('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 ed6a85b..c778eca 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 _0x863e=['define','UserChatQueue','lodash','../../config/logger','api','moment','request-promise','path','rimraf','./userChatQueue.attributes','exports'];(function(_0x4bca8c,_0x3156b9){var _0x582deb=function(_0x22cf2f){while(--_0x22cf2f){_0x4bca8c['push'](_0x4bca8c['shift']());}};_0x582deb(++_0x3156b9);}(_0x863e,0xa7));var _0xe863=function(_0x46b9c7,_0x15947d){_0x46b9c7=_0x46b9c7-0x0;var _0xd33d90=_0x863e[_0x46b9c7];return _0xd33d90;};'use strict';var _=require(_0xe863('0x0'));var util=require('util');var logger=require(_0xe863('0x1'))(_0xe863('0x2'));var moment=require(_0xe863('0x3'));var BPromise=require('bluebird');var rp=require(_0xe863('0x4'));var fs=require('fs');var path=require(_0xe863('0x5'));var rimraf=require(_0xe863('0x6'));var config=require('../../config/environment');var attributes=require(_0xe863('0x7'));module[_0xe863('0x8')]=function(_0x263375,_0x1cf450){return _0x263375[_0xe863('0x9')](_0xe863('0xa'),attributes,{'tableName':'user_has_chat_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xeef1=['lodash','util','../../config/logger','api','moment','bluebird','path','../../config/environment','./userChatQueue.attributes','define','UserChatQueue','user_has_chat_queues'];(function(_0x48bf2d,_0x229885){var _0x527a20=function(_0x4a0298){while(--_0x4a0298){_0x48bf2d['push'](_0x48bf2d['shift']());}};_0x527a20(++_0x229885);}(_0xeef1,0x15c));var _0x1eef=function(_0x3f4409,_0x50eafa){_0x3f4409=_0x3f4409-0x0;var _0x415b21=_0xeef1[_0x3f4409];return _0x415b21;};'use strict';var _=require(_0x1eef('0x0'));var util=require(_0x1eef('0x1'));var logger=require(_0x1eef('0x2'))(_0x1eef('0x3'));var moment=require(_0x1eef('0x4'));var BPromise=require(_0x1eef('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1eef('0x6'));var rimraf=require('rimraf');var config=require(_0x1eef('0x7'));var attributes=require(_0x1eef('0x8'));module['exports']=function(_0x599018,_0x2abdd4){return _0x599018[_0x1eef('0x9')](_0x1eef('0xa'),attributes,{'tableName':_0x1eef('0xb'),'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 92560b2..e5c18b4 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 _0xa124=['bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','UserChatQueue,\x20%s,\x20%s','request\x20sent','debug','UserChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','lodash','util'];(function(_0x3d2012,_0x3d02b9){var _0x53d542=function(_0x8f2be8){while(--_0x8f2be8){_0x3d2012['push'](_0x3d2012['shift']());}};_0x53d542(++_0x3d02b9);}(_0xa124,0xfa));var _0x4a12=function(_0x7cb10c,_0x2fcc3a){_0x7cb10c=_0x7cb10c-0x0;var _0x11df59=_0xa124[_0x7cb10c];return _0x11df59;};'use strict';var _=require(_0x4a12('0x0'));var util=require(_0x4a12('0x1'));var moment=require('moment');var BPromise=require(_0x4a12('0x2'));var rs=require(_0x4a12('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4a12('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x4a12('0x5'))(_0x4a12('0x6'));var config=require(_0x4a12('0x7'));var jayson=require(_0x4a12('0x8'));var client=jayson[_0x4a12('0x9')][_0x4a12('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1206d2,_0x1bc362,_0x24f207){return new BPromise(function(_0x365a78,_0x3a1d2f){return client['request'](_0x1206d2,_0x24f207)[_0x4a12('0xb')](function(_0x5219c7){logger['info'](_0x4a12('0xc'),_0x1bc362,_0x4a12('0xd'));logger[_0x4a12('0xe')](_0x4a12('0xf'),_0x1bc362,'request\x20sent',JSON[_0x4a12('0x10')](_0x5219c7));if(_0x5219c7[_0x4a12('0x11')]){if(_0x5219c7[_0x4a12('0x11')][_0x4a12('0x12')]===0x1f4){logger['error'](_0x4a12('0xc'),_0x1bc362,_0x5219c7[_0x4a12('0x11')][_0x4a12('0x13')]);return _0x3a1d2f(_0x5219c7[_0x4a12('0x11')][_0x4a12('0x13')]);}logger['error'](_0x4a12('0xc'),_0x1bc362,_0x5219c7[_0x4a12('0x11')][_0x4a12('0x13')]);return _0x365a78(_0x5219c7[_0x4a12('0x11')][_0x4a12('0x13')]);}else{logger[_0x4a12('0x14')](_0x4a12('0xc'),_0x1bc362,_0x4a12('0xd'));_0x365a78(_0x5219c7['result'][_0x4a12('0x13')]);}})['catch'](function(_0x465dd3){logger[_0x4a12('0x11')](_0x4a12('0xc'),_0x1bc362,_0x465dd3);_0x3a1d2f(_0x465dd3);});});} \ No newline at end of file +var _0x6461=['result','catch','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','UserChatQueue,\x20%s,\x20%s','request\x20sent','debug','UserChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','info'];(function(_0x40b2ed,_0x2b1765){var _0x18397d=function(_0xc6a86f){while(--_0xc6a86f){_0x40b2ed['push'](_0x40b2ed['shift']());}};_0x18397d(++_0x2b1765);}(_0x6461,0x191));var _0x1646=function(_0x17a52f,_0x140c2c){_0x17a52f=_0x17a52f-0x0;var _0x207db9=_0x6461[_0x17a52f];return _0x207db9;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x1646('0x0'));var BPromise=require(_0x1646('0x1'));var rs=require(_0x1646('0x2'));var fs=require('fs');var Redis=require(_0x1646('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x1646('0x4'));var logger=require(_0x1646('0x5'))(_0x1646('0x6'));var config=require(_0x1646('0x7'));var jayson=require(_0x1646('0x8'));var client=jayson[_0x1646('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x26287d,_0x58692d,_0x4ae9d8){return new BPromise(function(_0xccd6bd,_0x18a8dd){return client[_0x1646('0xa')](_0x26287d,_0x4ae9d8)['then'](function(_0x58efdb){logger['info'](_0x1646('0xb'),_0x58692d,_0x1646('0xc'));logger[_0x1646('0xd')](_0x1646('0xe'),_0x58692d,_0x1646('0xc'),JSON[_0x1646('0xf')](_0x58efdb));if(_0x58efdb['error']){if(_0x58efdb[_0x1646('0x10')]['code']===0x1f4){logger['error'](_0x1646('0xb'),_0x58692d,_0x58efdb[_0x1646('0x10')][_0x1646('0x11')]);return _0x18a8dd(_0x58efdb[_0x1646('0x10')][_0x1646('0x11')]);}logger[_0x1646('0x10')]('UserChatQueue,\x20%s,\x20%s',_0x58692d,_0x58efdb['error'][_0x1646('0x11')]);return _0xccd6bd(_0x58efdb[_0x1646('0x10')][_0x1646('0x11')]);}else{logger[_0x1646('0x12')]('UserChatQueue,\x20%s,\x20%s',_0x58692d,'request\x20sent');_0xccd6bd(_0x58efdb[_0x1646('0x13')][_0x1646('0x11')]);}})[_0x1646('0x14')](function(_0x62f58f){logger[_0x1646('0x10')](_0x1646('0xb'),_0x58692d,_0x62f58f);_0x18a8dd(_0x62f58f);});});} \ No newline at end of file diff --git a/server/api/userFaxQueue/index.js b/server/api/userFaxQueue/index.js index 4d72dd1..0d4087d 100644 --- a/server/api/userFaxQueue/index.js +++ b/server/api/userFaxQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xedd9=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','exports'];(function(_0x22e1db,_0x63059d){var _0x36daf9=function(_0x585eda){while(--_0x585eda){_0x22e1db['push'](_0x22e1db['shift']());}};_0x36daf9(++_0x63059d);}(_0xedd9,0xfc));var _0x9edd=function(_0x1a2b8f,_0x17b6f7){_0x1a2b8f=_0x1a2b8f-0x0;var _0x56f586=_0xedd9[_0x1a2b8f];return _0x56f586;};'use strict';var multer=require('multer');var util=require(_0x9edd('0x0'));var path=require(_0x9edd('0x1'));var timeout=require(_0x9edd('0x2'));var express=require(_0x9edd('0x3'));var router=express[_0x9edd('0x4')]();var fs_extra=require(_0x9edd('0x5'));var auth=require(_0x9edd('0x6'));var interaction=require(_0x9edd('0x7'));var config=require('../../config/environment');module[_0x9edd('0x8')]=router; \ No newline at end of file +var _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x50325b,_0x4bcfdc){var _0xe63bc1=function(_0x193976){while(--_0x193976){_0x50325b['push'](_0x50325b['shift']());}};_0xe63bc1(++_0x4bcfdc);}(_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/userFaxQueue/userFaxQueue.attributes.js b/server/api/userFaxQueue/userFaxQueue.attributes.js index 299fda2..7e5ebdc 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 _0x9822=['sequelize','exports','STRING'];(function(_0x4ae6ef,_0xc2af80){var _0x3cbb4e=function(_0x569ad5){while(--_0x569ad5){_0x4ae6ef['push'](_0x4ae6ef['shift']());}};_0x3cbb4e(++_0xc2af80);}(_0x9822,0x12f));var _0x2982=function(_0x401388,_0x1e8fe8){_0x401388=_0x401388-0x0;var _0x426efe=_0x9822[_0x401388];return _0x426efe;};'use strict';var Sequelize=require(_0x2982('0x0'));module[_0x2982('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'assigned':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'queue':{'type':Sequelize[_0x2982('0x2')]}}; \ No newline at end of file +var _0x96b7=['INTEGER','sequelize','exports'];(function(_0x2a4645,_0x340f8e){var _0x59a486=function(_0x5b2c82){while(--_0x5b2c82){_0x2a4645['push'](_0x2a4645['shift']());}};_0x59a486(++_0x340f8e);}(_0x96b7,0x127));var _0x796b=function(_0x4cee17,_0xda2b5){_0x4cee17=_0x4cee17-0x0;var _0x1d3b07=_0x96b7[_0x4cee17];return _0x1d3b07;};'use strict';var Sequelize=require(_0x796b('0x0'));module[_0x796b('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x796b('0x2')],'defaultValue':0x0},'queue':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.model.js b/server/api/userFaxQueue/userFaxQueue.model.js index 46a4af3..581053a 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 _0xb08e=['lodash','util','api','moment','bluebird','path','rimraf','../../config/environment','exports','define','UserFaxQueue','user_has_fax_queues'];(function(_0x4e7012,_0x5d5f73){var _0xcd56d5=function(_0x330847){while(--_0x330847){_0x4e7012['push'](_0x4e7012['shift']());}};_0xcd56d5(++_0x5d5f73);}(_0xb08e,0xe4));var _0xeb08=function(_0x176dd3,_0x1f546f){_0x176dd3=_0x176dd3-0x0;var _0x21bdd6=_0xb08e[_0x176dd3];return _0x21bdd6;};'use strict';var _=require(_0xeb08('0x0'));var util=require(_0xeb08('0x1'));var logger=require('../../config/logger')(_0xeb08('0x2'));var moment=require(_0xeb08('0x3'));var BPromise=require(_0xeb08('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xeb08('0x5'));var rimraf=require(_0xeb08('0x6'));var config=require(_0xeb08('0x7'));var attributes=require('./userFaxQueue.attributes');module[_0xeb08('0x8')]=function(_0x12731c,_0x2cb8e5){return _0x12731c[_0xeb08('0x9')](_0xeb08('0xa'),attributes,{'tableName':_0xeb08('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x86e9=['../../config/environment','exports','define','UserFaxQueue','lodash','util','../../config/logger','api','rimraf'];(function(_0x29e474,_0x3a2aaa){var _0x3a9f24=function(_0x798f9f){while(--_0x798f9f){_0x29e474['push'](_0x29e474['shift']());}};_0x3a9f24(++_0x3a2aaa);}(_0x86e9,0x13f));var _0x986e=function(_0xe8d631,_0x3d89f4){_0xe8d631=_0xe8d631-0x0;var _0x4e9099=_0x86e9[_0xe8d631];return _0x4e9099;};'use strict';var _=require(_0x986e('0x0'));var util=require(_0x986e('0x1'));var logger=require(_0x986e('0x2'))(_0x986e('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(_0x986e('0x4'));var config=require(_0x986e('0x5'));var attributes=require('./userFaxQueue.attributes');module[_0x986e('0x6')]=function(_0x44ea66,_0x4b5030){return _0x44ea66[_0x986e('0x7')](_0x986e('0x8'),attributes,{'tableName':'user_has_fax_queues','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 1b9c0af..7063191 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 _0x820c=['error','code','UserFaxQueue,\x20%s,\x20%s','message','catch','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','http','request','then','info','request\x20sent','debug','UserFaxQueue,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x45783c,_0x49c56d){var _0x1161da=function(_0x3c5d41){while(--_0x3c5d41){_0x45783c['push'](_0x45783c['shift']());}};_0x1161da(++_0x49c56d);}(_0x820c,0x1bd));var _0xc820=function(_0x5de2b0,_0x260016){_0x5de2b0=_0x5de2b0-0x0;var _0xc28a32=_0x820c[_0x5de2b0];return _0xc28a32;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0xc820('0x0'));var rs=require(_0xc820('0x1'));var fs=require('fs');var Redis=require(_0xc820('0x2'));var db=require(_0xc820('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xc820('0x4'))(_0xc820('0x5'));var config=require('../../config/environment');var jayson=require(_0xc820('0x6'));var client=jayson['client'][_0xc820('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x302d36,_0x175e5a,_0x3dc3bd){return new BPromise(function(_0x3d8739,_0x4111bb){return client[_0xc820('0x8')](_0x302d36,_0x3dc3bd)[_0xc820('0x9')](function(_0x4cc951){logger[_0xc820('0xa')]('UserFaxQueue,\x20%s,\x20%s',_0x175e5a,_0xc820('0xb'));logger[_0xc820('0xc')](_0xc820('0xd'),_0x175e5a,_0xc820('0xb'),JSON[_0xc820('0xe')](_0x4cc951));if(_0x4cc951['error']){if(_0x4cc951[_0xc820('0xf')][_0xc820('0x10')]===0x1f4){logger[_0xc820('0xf')](_0xc820('0x11'),_0x175e5a,_0x4cc951[_0xc820('0xf')][_0xc820('0x12')]);return _0x4111bb(_0x4cc951[_0xc820('0xf')]['message']);}logger['error'](_0xc820('0x11'),_0x175e5a,_0x4cc951[_0xc820('0xf')]['message']);return _0x3d8739(_0x4cc951['error'][_0xc820('0x12')]);}else{logger[_0xc820('0xa')]('UserFaxQueue,\x20%s,\x20%s',_0x175e5a,_0xc820('0xb'));_0x3d8739(_0x4cc951['result'][_0xc820('0x12')]);}})[_0xc820('0x13')](function(_0x1edf9e){logger['error']('UserFaxQueue,\x20%s,\x20%s',_0x175e5a,_0x1edf9e);_0x4111bb(_0x1edf9e);});});} \ No newline at end of file +var _0x28d6=['then','info','UserFaxQueue,\x20%s,\x20%s','debug','UserFaxQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request'];(function(_0x42bd0b,_0x3530e8){var _0x26441b=function(_0x2c34bf){while(--_0x2c34bf){_0x42bd0b['push'](_0x42bd0b['shift']());}};_0x26441b(++_0x3530e8);}(_0x28d6,0x1d7));var _0x628d=function(_0x5d0207,_0x4000c4){_0x5d0207=_0x5d0207-0x0;var _0xf3e249=_0x28d6[_0x5d0207];return _0xf3e249;};'use strict';var _=require(_0x628d('0x0'));var util=require(_0x628d('0x1'));var moment=require(_0x628d('0x2'));var BPromise=require(_0x628d('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x628d('0x4'))['db'];var utils=require(_0x628d('0x5'));var logger=require(_0x628d('0x6'))(_0x628d('0x7'));var config=require(_0x628d('0x8'));var jayson=require(_0x628d('0x9'));var client=jayson[_0x628d('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x327955,_0x1661b7,_0x39644a){return new BPromise(function(_0x56f213,_0xe9fa43){return client[_0x628d('0xb')](_0x327955,_0x39644a)[_0x628d('0xc')](function(_0x30543e){logger[_0x628d('0xd')](_0x628d('0xe'),_0x1661b7,'request\x20sent');logger[_0x628d('0xf')](_0x628d('0x10'),_0x1661b7,_0x628d('0x11'),JSON[_0x628d('0x12')](_0x30543e));if(_0x30543e[_0x628d('0x13')]){if(_0x30543e[_0x628d('0x13')][_0x628d('0x14')]===0x1f4){logger['error'](_0x628d('0xe'),_0x1661b7,_0x30543e[_0x628d('0x13')][_0x628d('0x15')]);return _0xe9fa43(_0x30543e[_0x628d('0x13')][_0x628d('0x15')]);}logger['error'](_0x628d('0xe'),_0x1661b7,_0x30543e[_0x628d('0x13')][_0x628d('0x15')]);return _0x56f213(_0x30543e[_0x628d('0x13')][_0x628d('0x15')]);}else{logger['info'](_0x628d('0xe'),_0x1661b7,_0x628d('0x11'));_0x56f213(_0x30543e[_0x628d('0x16')][_0x628d('0x15')]);}})['catch'](function(_0x3b98d7){logger[_0x628d('0x13')](_0x628d('0xe'),_0x1661b7,_0x3b98d7);_0xe9fa43(_0x3b98d7);});});} \ No newline at end of file diff --git a/server/api/userMailQueue/index.js b/server/api/userMailQueue/index.js index 73603f2..9e3fe20 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(_0x4176f4,_0x188816){var _0x3809b9=function(_0x3a88a7){while(--_0x3a88a7){_0x4176f4['push'](_0x4176f4['shift']());}};_0x3809b9(++_0x188816);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x17b6e3,_0x4522ed){_0x17b6e3=_0x17b6e3-0x0;var _0x3906f3=_0xcb91[_0x17b6e3];return _0x3906f3;};'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 _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x81f3e2,_0x4ecb1f){var _0x37fdbf=function(_0x1ad08f){while(--_0x1ad08f){_0x81f3e2['push'](_0x81f3e2['shift']());}};_0x37fdbf(++_0x4ecb1f);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x16337a,_0x4789a1){_0x16337a=_0x16337a-0x0;var _0x422365=_0xcb91[_0x16337a];return _0x422365;};'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/userMailQueue/userMailQueue.attributes.js b/server/api/userMailQueue/userMailQueue.attributes.js index 56f105b..f0fed91 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 _0x5832=['sequelize','exports','INTEGER'];(function(_0x58fe9b,_0x116c3b){var _0x3d68c8=function(_0x161326){while(--_0x161326){_0x58fe9b['push'](_0x58fe9b['shift']());}};_0x3d68c8(++_0x116c3b);}(_0x5832,0x18f));var _0x2583=function(_0x737a1f,_0x235fef){_0x737a1f=_0x737a1f-0x0;var _0x16eba1=_0x5832[_0x737a1f];return _0x16eba1;};'use strict';var Sequelize=require(_0x2583('0x0'));module[_0x2583('0x1')]={'penalty':{'type':Sequelize[_0x2583('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x1063=['INTEGER','sequelize','exports'];(function(_0x57b324,_0x504222){var _0x6fd4b6=function(_0xac9ea2){while(--_0xac9ea2){_0x57b324['push'](_0x57b324['shift']());}};_0x6fd4b6(++_0x504222);}(_0x1063,0x184));var _0x3106=function(_0x31910d,_0xa572a3){_0x31910d=_0x31910d-0x0;var _0x3c2f2c=_0x1063[_0x31910d];return _0x3c2f2c;};'use strict';var Sequelize=require(_0x3106('0x0'));module[_0x3106('0x1')]={'penalty':{'type':Sequelize[_0x3106('0x2')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userMailQueue/userMailQueue.model.js b/server/api/userMailQueue/userMailQueue.model.js index 4a39060..f1d6099 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 _0x7c9e=['../../config/environment','UserMailQueue','user_has_mail_queues','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7c9e,0x87));var _0xe7c9=function(_0x56ce19,_0x336d24){_0x56ce19=_0x56ce19-0x0;var _0xb949fb=_0x7c9e[_0x56ce19];return _0xb949fb;};'use strict';var _=require(_0xe7c9('0x0'));var util=require(_0xe7c9('0x1'));var logger=require(_0xe7c9('0x2'))(_0xe7c9('0x3'));var moment=require(_0xe7c9('0x4'));var BPromise=require(_0xe7c9('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe7c9('0x6'));var rimraf=require(_0xe7c9('0x7'));var config=require(_0xe7c9('0x8'));var attributes=require('./userMailQueue.attributes');module['exports']=function(_0x319583,_0x3faff2){return _0x319583['define'](_0xe7c9('0x9'),attributes,{'tableName':_0xe7c9('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf585=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','exports','define','UserMailQueue'];(function(_0x47a7d0,_0x4e182d){var _0xb9bd08=function(_0x588ee2){while(--_0x588ee2){_0x47a7d0['push'](_0x47a7d0['shift']());}};_0xb9bd08(++_0x4e182d);}(_0xf585,0x10e));var _0x5f58=function(_0xdea41a,_0x552987){_0xdea41a=_0xdea41a-0x0;var _0x15d0d8=_0xf585[_0xdea41a];return _0x15d0d8;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x5f58('0x0'))(_0x5f58('0x1'));var moment=require(_0x5f58('0x2'));var BPromise=require(_0x5f58('0x3'));var rp=require(_0x5f58('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5f58('0x5'));var config=require(_0x5f58('0x6'));var attributes=require('./userMailQueue.attributes');module[_0x5f58('0x7')]=function(_0x2e40da,_0x245711){return _0x2e40da[_0x5f58('0x8')](_0x5f58('0x9'),attributes,{'tableName':'user_has_mail_queues','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 fabb202..d02d507 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 _0x1cb9=['error','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','UserMailQueue,\x20%s,\x20%s','request\x20sent','debug','UserMailQueue,\x20%s,\x20%s,\x20%s','stringify'];(function(_0xd1d19a,_0x1933f0){var _0x52a79d=function(_0x5199e2){while(--_0x5199e2){_0xd1d19a['push'](_0xd1d19a['shift']());}};_0x52a79d(++_0x1933f0);}(_0x1cb9,0x14e));var _0x91cb=function(_0x24ebb6,_0x54710e){_0x24ebb6=_0x24ebb6-0x0;var _0x14a4e9=_0x1cb9[_0x24ebb6];return _0x14a4e9;};'use strict';var _=require(_0x91cb('0x0'));var util=require('util');var moment=require(_0x91cb('0x1'));var BPromise=require(_0x91cb('0x2'));var rs=require(_0x91cb('0x3'));var fs=require('fs');var Redis=require(_0x91cb('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x91cb('0x5'));var logger=require(_0x91cb('0x6'))('rpc');var config=require(_0x91cb('0x7'));var jayson=require(_0x91cb('0x8'));var client=jayson[_0x91cb('0x9')][_0x91cb('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3b9d98,_0x8f8a3b,_0x4c1f56){return new BPromise(function(_0x15c517,_0x5bda2f){return client[_0x91cb('0xb')](_0x3b9d98,_0x4c1f56)['then'](function(_0xa43e7a){logger[_0x91cb('0xc')](_0x91cb('0xd'),_0x8f8a3b,_0x91cb('0xe'));logger[_0x91cb('0xf')](_0x91cb('0x10'),_0x8f8a3b,_0x91cb('0xe'),JSON[_0x91cb('0x11')](_0xa43e7a));if(_0xa43e7a[_0x91cb('0x12')]){if(_0xa43e7a[_0x91cb('0x12')]['code']===0x1f4){logger[_0x91cb('0x12')](_0x91cb('0xd'),_0x8f8a3b,_0xa43e7a['error'][_0x91cb('0x13')]);return _0x5bda2f(_0xa43e7a[_0x91cb('0x12')][_0x91cb('0x13')]);}logger[_0x91cb('0x12')]('UserMailQueue,\x20%s,\x20%s',_0x8f8a3b,_0xa43e7a['error'][_0x91cb('0x13')]);return _0x15c517(_0xa43e7a[_0x91cb('0x12')]['message']);}else{logger['info'](_0x91cb('0xd'),_0x8f8a3b,_0x91cb('0xe'));_0x15c517(_0xa43e7a[_0x91cb('0x14')]['message']);}})[_0x91cb('0x15')](function(_0x135890){logger['error'](_0x91cb('0xd'),_0x8f8a3b,_0x135890);_0x5bda2f(_0x135890);});});} \ No newline at end of file +var _0x00bb=['stringify','error','message','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','request','info','UserMailQueue,\x20%s,\x20%s','request\x20sent','debug','UserMailQueue,\x20%s,\x20%s,\x20%s'];(function(_0x5447f8,_0x3b751e){var _0x4c6575=function(_0x1879d1){while(--_0x1879d1){_0x5447f8['push'](_0x5447f8['shift']());}};_0x4c6575(++_0x3b751e);}(_0x00bb,0x1d8));var _0xb00b=function(_0x42245d,_0x51758f){_0x42245d=_0x42245d-0x0;var _0x4b211a=_0x00bb[_0x42245d];return _0x4b211a;};'use strict';var _=require(_0xb00b('0x0'));var util=require(_0xb00b('0x1'));var moment=require(_0xb00b('0x2'));var BPromise=require('bluebird');var rs=require(_0xb00b('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb00b('0x4'))['db'];var utils=require(_0xb00b('0x5'));var logger=require('../../config/logger')(_0xb00b('0x6'));var config=require(_0xb00b('0x7'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x36e363,_0xf737d0,_0x41dfc9){return new BPromise(function(_0x37f07d,_0xfa4181){return client[_0xb00b('0x8')](_0x36e363,_0x41dfc9)['then'](function(_0x51d12b){logger[_0xb00b('0x9')](_0xb00b('0xa'),_0xf737d0,_0xb00b('0xb'));logger[_0xb00b('0xc')](_0xb00b('0xd'),_0xf737d0,'request\x20sent',JSON[_0xb00b('0xe')](_0x51d12b));if(_0x51d12b['error']){if(_0x51d12b['error']['code']===0x1f4){logger[_0xb00b('0xf')](_0xb00b('0xa'),_0xf737d0,_0x51d12b[_0xb00b('0xf')][_0xb00b('0x10')]);return _0xfa4181(_0x51d12b[_0xb00b('0xf')][_0xb00b('0x10')]);}logger['error'](_0xb00b('0xa'),_0xf737d0,_0x51d12b[_0xb00b('0xf')]['message']);return _0x37f07d(_0x51d12b[_0xb00b('0xf')][_0xb00b('0x10')]);}else{logger['info']('UserMailQueue,\x20%s,\x20%s',_0xf737d0,_0xb00b('0xb'));_0x37f07d(_0x51d12b['result']['message']);}})[_0xb00b('0x11')](function(_0x638443){logger[_0xb00b('0xf')](_0xb00b('0xa'),_0xf737d0,_0x638443);_0xfa4181(_0x638443);});});} \ No newline at end of file diff --git a/server/api/userNotification/index.js b/server/api/userNotification/index.js index f020dfc..95d399f 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 _0xc752=['post','sendUserNotification','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./userNotification.controller'];(function(_0x581249,_0x483f03){var _0x284bae=function(_0x2faadd){while(--_0x2faadd){_0x581249['push'](_0x581249['shift']());}};_0x284bae(++_0x483f03);}(_0xc752,0x183));var _0x2c75=function(_0x11ab7d,_0x3612ba){_0x11ab7d=_0x11ab7d-0x0;var _0x456f18=_0xc752[_0x11ab7d];return _0x456f18;};'use strict';var multer=require(_0x2c75('0x0'));var util=require(_0x2c75('0x1'));var path=require(_0x2c75('0x2'));var timeout=require(_0x2c75('0x3'));var express=require(_0x2c75('0x4'));var router=express[_0x2c75('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x2c75('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x2c75('0x7'));var controller=require(_0x2c75('0x8'));router[_0x2c75('0x9')]('/',auth['isAuthenticated'](),controller[_0x2c75('0xa')]);module[_0x2c75('0xb')]=router; \ No newline at end of file +var _0xf5ed=['post','isAuthenticated','sendUserNotification','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./userNotification.controller'];(function(_0x57fc2a,_0x14bbe5){var _0xa839b=function(_0x26572c){while(--_0x26572c){_0x57fc2a['push'](_0x57fc2a['shift']());}};_0xa839b(++_0x14bbe5);}(_0xf5ed,0x82));var _0xdf5e=function(_0x195122,_0x3d0c8e){_0x195122=_0x195122-0x0;var _0x3c62f1=_0xf5ed[_0x195122];return _0x3c62f1;};'use strict';var multer=require(_0xdf5e('0x0'));var util=require(_0xdf5e('0x1'));var path=require(_0xdf5e('0x2'));var timeout=require(_0xdf5e('0x3'));var express=require(_0xdf5e('0x4'));var router=express[_0xdf5e('0x5')]();var fs_extra=require(_0xdf5e('0x6'));var auth=require(_0xdf5e('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xdf5e('0x8'));var controller=require(_0xdf5e('0x9'));router[_0xdf5e('0xa')]('/',auth[_0xdf5e('0xb')](),controller[_0xdf5e('0xc')]);module[_0xdf5e('0xd')]=router; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.attributes.js b/server/api/userNotification/userNotification.attributes.js index 8ce96c5..b726279 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 _0xaa34=['exports','TEXT','STRING','BOOLEAN','sequelize'];(function(_0x57ca75,_0x4c03fd){var _0x551d12=function(_0x4b24a5){while(--_0x4b24a5){_0x57ca75['push'](_0x57ca75['shift']());}};_0x551d12(++_0x4c03fd);}(_0xaa34,0x108));var _0x4aa3=function(_0x5da2ac,_0x45ff8b){_0x5da2ac=_0x5da2ac-0x0;var _0x1f93d=_0xaa34[_0x5da2ac];return _0x1f93d;};'use strict';var Sequelize=require(_0x4aa3('0x0'));module[_0x4aa3('0x1')]={'body':{'type':Sequelize[_0x4aa3('0x2')]},'senderName':{'type':Sequelize[_0x4aa3('0x3')]},'recipientsId':{'type':Sequelize[_0x4aa3('0x2')]},'recipientsDescription':{'type':Sequelize[_0x4aa3('0x3')]},'beep':{'type':Sequelize[_0x4aa3('0x4')]}}; \ No newline at end of file +var _0x224c=['STRING','BOOLEAN','sequelize','TEXT'];(function(_0x22b88f,_0x115ec0){var _0x1f8b3d=function(_0xd33ee){while(--_0xd33ee){_0x22b88f['push'](_0x22b88f['shift']());}};_0x1f8b3d(++_0x115ec0);}(_0x224c,0xfa));var _0xc224=function(_0x305b9b,_0x11a9cb){_0x305b9b=_0x305b9b-0x0;var _0x3a747b=_0x224c[_0x305b9b];return _0x3a747b;};'use strict';var Sequelize=require(_0xc224('0x0'));module['exports']={'body':{'type':Sequelize[_0xc224('0x1')]},'senderName':{'type':Sequelize[_0xc224('0x2')]},'recipientsId':{'type':Sequelize['TEXT']},'recipientsDescription':{'type':Sequelize[_0xc224('0x2')]},'beep':{'type':Sequelize[_0xc224('0x3')]}}; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.controller.js b/server/api/userNotification/userNotification.controller.js index 618ce18..6042565 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 _0x8850=['../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','redis','socket.io-emitter','./userNotification.socket','sendStatus','status','end','json','undefined','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','sendUserNotification','body','hasOwnProperty','text','Sequelize','ValidationError','Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27','TemplateId','view','Missing\x20\x27recipients\x27\x20parameter','parse','recipients','chatqueue','mailqueue','openchannelqueue','whatsappqueue','team','user','includes','model','toLowerCase','Invalid\x20model\x20in\x20\x27recipients\x27\x20object','senderName','recipientsDescription','beep','recipientsId','sortBy','join','sequelize','transaction','UserNotification','forEach','recipient','emit','catch','Template','findOne','html','Invalid\x20\x27TemplateId\x27\x20parameter','render','startCase','User','ids','queue','replace','Queue','push','all','getAgents','map','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','papaparse','ioredis'];(function(_0x2d7f0e,_0x3e6fbd){var _0x110b07=function(_0x557b00){while(--_0x557b00){_0x2d7f0e['push'](_0x2d7f0e['shift']());}};_0x110b07(++_0x3e6fbd);}(_0x8850,0x1d3));var _0x0885=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x8850[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require(_0x0885('0x0'));var rimraf=require(_0x0885('0x1'));var zipdir=require(_0x0885('0x2'));var jsonpatch=require(_0x0885('0x3'));var rp=require('request-promise');var moment=require(_0x0885('0x4'));var BPromise=require(_0x0885('0x5'));var Mustache=require(_0x0885('0x6'));var util=require(_0x0885('0x7'));var path=require('path');var sox=require(_0x0885('0x8'));var csv=require(_0x0885('0x9'));var ejs=require(_0x0885('0xa'));var fs=require('fs');var fs_extra=require(_0x0885('0xb'));var _=require('lodash');var squel=require(_0x0885('0xc'));var crypto=require(_0x0885('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x0885('0xe'));var toCsv=require('to-csv');var querystring=require(_0x0885('0xf'));var Papa=require(_0x0885('0x10'));var Redis=require(_0x0885('0x11'));var authService=require(_0x0885('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x0885('0x13'));var hardwareService=require(_0x0885('0x14'));var logger=require(_0x0885('0x15'))(_0x0885('0x16'));var utils=require('../../config/utils');var config=require(_0x0885('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x0885('0x18'))['db'];config[_0x0885('0x19')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x0885('0x1a'))(new Redis(config[_0x0885('0x19')]));require(_0x0885('0x1b'))['register'](socket);function respondWithStatusCode(_0x486eb8,_0x1fe4f9){_0x1fe4f9=_0x1fe4f9||0xcc;return function(_0x2af36f){if(_0x2af36f){return _0x486eb8[_0x0885('0x1c')](_0x1fe4f9);}return _0x486eb8[_0x0885('0x1d')](_0x1fe4f9)[_0x0885('0x1e')]();};}function respondWithResult(_0x5dae8a,_0x36ef36){_0x36ef36=_0x36ef36||0xc8;return function(_0x557408){if(_0x557408){return _0x5dae8a[_0x0885('0x1d')](_0x36ef36)[_0x0885('0x1f')](_0x557408);}};}function respondWithFilteredResult(_0x448561,_0x521be8){return function(_0xf3d4cf){if(_0xf3d4cf){var _0x39c097=typeof _0x521be8['offset']===_0x0885('0x20')&&typeof _0x521be8['limit']==='undefined';var _0xfa3cc5=_0xf3d4cf['count'];var _0x1c5cbb=_0x39c097?0x0:_0x521be8[_0x0885('0x21')];var _0x251796=_0x39c097?_0xf3d4cf['count']:_0x521be8[_0x0885('0x21')]+_0x521be8[_0x0885('0x22')];var _0x501e07;if(_0x251796>=_0xfa3cc5){_0x251796=_0xfa3cc5;_0x501e07=0xc8;}else{_0x501e07=0xce;}_0x448561[_0x0885('0x1d')](_0x501e07);return _0x448561[_0x0885('0x23')](_0x0885('0x24'),_0x1c5cbb+'-'+_0x251796+'/'+_0xfa3cc5)[_0x0885('0x1f')](_0xf3d4cf);}return null;};}function patchUpdates(_0x1f0a9e){return function(_0x407928){try{jsonpatch[_0x0885('0x25')](_0x407928,_0x1f0a9e,!![]);}catch(_0x4f5a7c){return BPromise[_0x0885('0x26')](_0x4f5a7c);}return _0x407928[_0x0885('0x27')]();};}function saveUpdates(_0x524a3d,_0x2979c0){return function(_0x34e710){if(_0x34e710){return _0x34e710[_0x0885('0x28')](_0x524a3d)[_0x0885('0x29')](function(_0x346c93){return _0x346c93;});}return null;};}function removeEntity(_0x5cf0e8,_0xd55cb5){return function(_0x54d914){if(_0x54d914){return _0x54d914[_0x0885('0x2a')]()[_0x0885('0x29')](function(){_0x5cf0e8['status'](0xcc)[_0x0885('0x1e')]();});}};}function handleEntityNotFound(_0x2c72c9,_0x1aceb9){return function(_0x2d5398){if(!_0x2d5398){_0x2c72c9['sendStatus'](0x194);}return _0x2d5398;};}function handleError(_0x47c415,_0x18772f){_0x18772f=_0x18772f||0x1f4;return function(_0x1653a6){logger[_0x0885('0x2b')](_0x1653a6[_0x0885('0x2c')]);if(_0x1653a6['name']){delete _0x1653a6[_0x0885('0x2d')];}_0x47c415[_0x0885('0x1d')](_0x18772f)[_0x0885('0x2e')](_0x1653a6);};}exports[_0x0885('0x2f')]=function(_0x2ec997,_0x39d769,_0x11f728){if(!_0x2ec997[_0x0885('0x30')][_0x0885('0x31')](_0x0885('0x32'))&&!_0x2ec997[_0x0885('0x30')]['hasOwnProperty']('TemplateId')){throw new db[(_0x0885('0x33'))][(_0x0885('0x34'))](_0x0885('0x35'));}else{if(_0x2ec997[_0x0885('0x30')][_0x0885('0x31')](_0x0885('0x36'))&&!_0x2ec997[_0x0885('0x30')][_0x0885('0x31')](_0x0885('0x37'))){throw new db[(_0x0885('0x33'))][(_0x0885('0x34'))]('Missing\x20\x27view\x27\x20parameter');}if(!_0x2ec997[_0x0885('0x30')]['hasOwnProperty']('recipients')){throw new db['Sequelize'][(_0x0885('0x34'))](_0x0885('0x38'));}else{try{var _0x2e154d=JSON[_0x0885('0x39')](_0x2ec997[_0x0885('0x30')][_0x0885('0x3a')]);}catch(_0x18800b){logger[_0x0885('0x2b')](_0x18800b);throw new db[(_0x0885('0x33'))][(_0x0885('0x34'))]('Invalid\x20\x27recipients\x27\x20object');}var _0x5c5a55=[_0x0885('0x3b'),'faxqueue',_0x0885('0x3c'),_0x0885('0x3d'),'smsqueue','voicequeue',_0x0885('0x3e'),_0x0885('0x3f'),_0x0885('0x40')];if(_['some'](_0x2e154d,function(_0x19c43e){return!_[_0x0885('0x41')](_0x5c5a55,_0x19c43e[_0x0885('0x42')][_0x0885('0x43')]());})){throw new db[(_0x0885('0x33'))][(_0x0885('0x34'))](_0x0885('0x44'));}}}var _0x2cb82c={};_0x2cb82c['senderName']=_0x2ec997[_0x0885('0x30')][_0x0885('0x31')](_0x0885('0x45'))?_0x2ec997[_0x0885('0x30')][_0x0885('0x45')]:_0x2ec997[_0x0885('0x40')]['fullname'];_0x2cb82c['recipientsDescription']=_['isEmpty'](_0x2ec997[_0x0885('0x30')][_0x0885('0x46')])?null:_0x2ec997[_0x0885('0x30')][_0x0885('0x46')];_0x2cb82c['beep']=_0x2ec997['body'][_0x0885('0x47')]||![];_0x2cb82c['SenderId']=_0x2ec997[_0x0885('0x40')]['id'];return getContent(_0x2ec997[_0x0885('0x30')])[_0x0885('0x29')](function(_0x4e9c4b){_0x2cb82c[_0x0885('0x30')]=_0x4e9c4b;return getRecipients(_0x2e154d);})['then'](function(_0x128d52){_0x2cb82c[_0x0885('0x48')]=_[_0x0885('0x49')](_0x128d52)[_0x0885('0x4a')](',');return db[_0x0885('0x4b')][_0x0885('0x4c')](function(_0x5a5145){return db[_0x0885('0x4d')]['create'](_0x2cb82c,{'raw':!![],'transaction':_0x5a5145})[_0x0885('0x29')](function(_0x159d08){var _0x28f9ec={'sender':_0x2cb82c[_0x0885('0x45')],'description':_0x2cb82c[_0x0885('0x46')],'content':_0x2cb82c[_0x0885('0x30')],'beep':_0x2cb82c[_0x0885('0x47')]};_0x128d52[_0x0885('0x4e')](function(_0x203708){_0x28f9ec[_0x0885('0x4f')]=_0x203708;socket[_0x0885('0x50')]('userNotification:send',_0x28f9ec);});return _0x159d08;});});})[_0x0885('0x29')](respondWithResult(_0x39d769,0xc9))[_0x0885('0x51')](handleError(_0x39d769,null));};function getContent(_0x4aba29){return new BPromise(function(_0x15c3b2,_0x56cffb){if(_0x4aba29[_0x0885('0x32')]){_0x15c3b2(_0x4aba29[_0x0885('0x32')]);return;}return db[_0x0885('0x52')][_0x0885('0x53')]({'attributes':[_0x0885('0x54')],'where':{'id':_0x4aba29[_0x0885('0x36')]},'raw':!![]})[_0x0885('0x29')](function(_0xa04c5a){if(!_0xa04c5a)throw new db['Sequelize'][(_0x0885('0x34'))](_0x0885('0x55'));var _0x545f51=Mustache[_0x0885('0x56')](_0xa04c5a[_0x0885('0x54')],_0x4aba29[_0x0885('0x37')]);_0x15c3b2(_0x545f51);})[_0x0885('0x51')](function(_0x307288){_0x56cffb(_0x307288);});});}function getRecipients(_0x339dc3){return new BPromise(function(_0xeb3775,_0x49055f){var _0x47fd3f=[];var _0x2629b4=[];_0x339dc3[_0x0885('0x4e')](function(_0x57e4a1){var _0x5163ef=_[_0x0885('0x57')](_0x57e4a1[_0x0885('0x42')]['toLowerCase']());if(_0x5163ef===_0x0885('0x58')){_0x47fd3f=_['union'](_0x47fd3f,_0x57e4a1[_0x0885('0x59')]);}else{if(_[_0x0885('0x41')](_0x5163ef,_0x0885('0x5a')))_0x5163ef=_0x5163ef[_0x0885('0x5b')](_0x0885('0x5a'),_0x0885('0x5c'));_0x57e4a1[_0x0885('0x59')][_0x0885('0x4e')](function(_0x29960e){_0x2629b4[_0x0885('0x5d')](getAgents(_0x5163ef,_0x29960e));});}});return BPromise[_0x0885('0x5e')](_0x2629b4)[_0x0885('0x29')](function(_0x163db2){_0x47fd3f=_['union'](_0x47fd3f,_['flatten'](_0x163db2));_0xeb3775(_0x47fd3f);})[_0x0885('0x51')](function(_0x4846b5){_0x49055f(_0x4846b5);});});}function getAgents(_0x105fc2,_0x1cdaaf){return new BPromise(function(_0x2a4c0b,_0x4e3f32){return db[_0x105fc2]['findOne']({'where':{'id':_0x1cdaaf}})['then'](function(_0x3f4655){return _0x3f4655[_0x0885('0x5f')]({'attributes':['id'],'raw':!![]})[_0x0885('0x29')](function(_0x515bce){var _0x2c1985=_[_0x0885('0x60')](_0x515bce,'id');_0x2a4c0b(_0x2c1985);});})[_0x0885('0x51')](function(_0x59ef05){_0x4e3f32(_0x59ef05);});});} \ No newline at end of file +var _0xf4cf=['offset','undefined','count','set','Content-Range','apply','reject','then','destroy','end','error','stack','name','sendUserNotification','body','hasOwnProperty','text','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','openchannelqueue','smsqueue','whatsappqueue','team','some','includes','model','toLowerCase','Invalid\x20model\x20in\x20\x27recipients\x27\x20object','senderName','user','fullname','recipientsDescription','beep','SenderId','sortBy','join','sequelize','transaction','UserNotification','forEach','emit','userNotification:send','catch','Template','findOne','html','startCase','ids','queue','replace','push','all','union','flatten','getAgents','map','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./userNotification.socket','register','sendStatus','status','json'];(function(_0x1ca7cf,_0x29aa03){var _0x28d334=function(_0x296e32){while(--_0x296e32){_0x1ca7cf['push'](_0x1ca7cf['shift']());}};_0x28d334(++_0x29aa03);}(_0xf4cf,0xa0));var _0xff4c=function(_0x231e16,_0x67347b){_0x231e16=_0x231e16-0x0;var _0x570a7c=_0xf4cf[_0x231e16];return _0x570a7c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xff4c('0x0'));var zipdir=require(_0xff4c('0x1'));var jsonpatch=require(_0xff4c('0x2'));var rp=require(_0xff4c('0x3'));var moment=require('moment');var BPromise=require(_0xff4c('0x4'));var Mustache=require(_0xff4c('0x5'));var util=require(_0xff4c('0x6'));var path=require(_0xff4c('0x7'));var sox=require(_0xff4c('0x8'));var csv=require(_0xff4c('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xff4c('0xa'));var squel=require(_0xff4c('0xb'));var crypto=require(_0xff4c('0xc'));var jsforce=require(_0xff4c('0xd'));var deskjs=require(_0xff4c('0xe'));var toCsv=require(_0xff4c('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xff4c('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xff4c('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xff4c('0x11'));var logger=require(_0xff4c('0x12'))(_0xff4c('0x13'));var utils=require('../../config/utils');var config=require(_0xff4c('0x14'));var licenseUtil=require(_0xff4c('0x15'));var db=require(_0xff4c('0x16'))['db'];config['redis']=_[_0xff4c('0x17')](config[_0xff4c('0x18')],{'host':_0xff4c('0x19'),'port':0x18eb});var socket=require(_0xff4c('0x1a'))(new Redis(config[_0xff4c('0x18')]));require(_0xff4c('0x1b'))[_0xff4c('0x1c')](socket);function respondWithStatusCode(_0x3838f8,_0x5e9f2c){_0x5e9f2c=_0x5e9f2c||0xcc;return function(_0x43681e){if(_0x43681e){return _0x3838f8[_0xff4c('0x1d')](_0x5e9f2c);}return _0x3838f8[_0xff4c('0x1e')](_0x5e9f2c)['end']();};}function respondWithResult(_0x2b3501,_0x4a769a){_0x4a769a=_0x4a769a||0xc8;return function(_0x359d2b){if(_0x359d2b){return _0x2b3501[_0xff4c('0x1e')](_0x4a769a)[_0xff4c('0x1f')](_0x359d2b);}};}function respondWithFilteredResult(_0x456b7a,_0x39247b){return function(_0x58ef69){if(_0x58ef69){var _0x5b7899=typeof _0x39247b[_0xff4c('0x20')]===_0xff4c('0x21')&&typeof _0x39247b['limit']==='undefined';var _0x2f5e20=_0x58ef69[_0xff4c('0x22')];var _0x58fe4e=_0x5b7899?0x0:_0x39247b[_0xff4c('0x20')];var _0x5685e0=_0x5b7899?_0x58ef69[_0xff4c('0x22')]:_0x39247b[_0xff4c('0x20')]+_0x39247b['limit'];var _0x1a37b3;if(_0x5685e0>=_0x2f5e20){_0x5685e0=_0x2f5e20;_0x1a37b3=0xc8;}else{_0x1a37b3=0xce;}_0x456b7a[_0xff4c('0x1e')](_0x1a37b3);return _0x456b7a[_0xff4c('0x23')](_0xff4c('0x24'),_0x58fe4e+'-'+_0x5685e0+'/'+_0x2f5e20)[_0xff4c('0x1f')](_0x58ef69);}return null;};}function patchUpdates(_0x5526a0){return function(_0x46ee6c){try{jsonpatch[_0xff4c('0x25')](_0x46ee6c,_0x5526a0,!![]);}catch(_0x5b3b3d){return BPromise[_0xff4c('0x26')](_0x5b3b3d);}return _0x46ee6c['save']();};}function saveUpdates(_0xdacc5b,_0x4e8ec1){return function(_0x3d63c4){if(_0x3d63c4){return _0x3d63c4['update'](_0xdacc5b)[_0xff4c('0x27')](function(_0x1813fa){return _0x1813fa;});}return null;};}function removeEntity(_0x3d3ed9,_0x37235f){return function(_0x917792){if(_0x917792){return _0x917792[_0xff4c('0x28')]()[_0xff4c('0x27')](function(){_0x3d3ed9[_0xff4c('0x1e')](0xcc)[_0xff4c('0x29')]();});}};}function handleEntityNotFound(_0x4f3077,_0x4452f6){return function(_0x3ad31b){if(!_0x3ad31b){_0x4f3077[_0xff4c('0x1d')](0x194);}return _0x3ad31b;};}function handleError(_0xaf2219,_0x29e421){_0x29e421=_0x29e421||0x1f4;return function(_0x189914){logger[_0xff4c('0x2a')](_0x189914[_0xff4c('0x2b')]);if(_0x189914[_0xff4c('0x2c')]){delete _0x189914[_0xff4c('0x2c')];}_0xaf2219[_0xff4c('0x1e')](_0x29e421)['send'](_0x189914);};}exports[_0xff4c('0x2d')]=function(_0x234d43,_0xbbc923,_0x370348){if(!_0x234d43[_0xff4c('0x2e')][_0xff4c('0x2f')](_0xff4c('0x30'))&&!_0x234d43[_0xff4c('0x2e')][_0xff4c('0x2f')](_0xff4c('0x31'))){throw new db[(_0xff4c('0x32'))][(_0xff4c('0x33'))](_0xff4c('0x34'));}else{if(_0x234d43['body'][_0xff4c('0x2f')](_0xff4c('0x31'))&&!_0x234d43[_0xff4c('0x2e')][_0xff4c('0x2f')](_0xff4c('0x35'))){throw new db['Sequelize'][(_0xff4c('0x33'))]('Missing\x20\x27view\x27\x20parameter');}if(!_0x234d43['body'][_0xff4c('0x2f')](_0xff4c('0x36'))){throw new db[(_0xff4c('0x32'))][(_0xff4c('0x33'))](_0xff4c('0x37'));}else{try{var _0x2b486d=JSON[_0xff4c('0x38')](_0x234d43['body'][_0xff4c('0x36')]);}catch(_0x423a11){logger[_0xff4c('0x2a')](_0x423a11);throw new db[(_0xff4c('0x32'))][(_0xff4c('0x33'))](_0xff4c('0x39'));}var _0x1275bc=['chatqueue',_0xff4c('0x3a'),'mailqueue',_0xff4c('0x3b'),_0xff4c('0x3c'),'voicequeue',_0xff4c('0x3d'),_0xff4c('0x3e'),'user'];if(_[_0xff4c('0x3f')](_0x2b486d,function(_0x4c3765){return!_[_0xff4c('0x40')](_0x1275bc,_0x4c3765[_0xff4c('0x41')][_0xff4c('0x42')]());})){throw new db[(_0xff4c('0x32'))][(_0xff4c('0x33'))](_0xff4c('0x43'));}}}var _0x42385c={};_0x42385c[_0xff4c('0x44')]=_0x234d43[_0xff4c('0x2e')]['hasOwnProperty'](_0xff4c('0x44'))?_0x234d43[_0xff4c('0x2e')]['senderName']:_0x234d43[_0xff4c('0x45')][_0xff4c('0x46')];_0x42385c[_0xff4c('0x47')]=_['isEmpty'](_0x234d43['body'][_0xff4c('0x47')])?null:_0x234d43[_0xff4c('0x2e')][_0xff4c('0x47')];_0x42385c[_0xff4c('0x48')]=_0x234d43[_0xff4c('0x2e')][_0xff4c('0x48')]||![];_0x42385c[_0xff4c('0x49')]=_0x234d43[_0xff4c('0x45')]['id'];return getContent(_0x234d43[_0xff4c('0x2e')])[_0xff4c('0x27')](function(_0x307169){_0x42385c[_0xff4c('0x2e')]=_0x307169;return getRecipients(_0x2b486d);})[_0xff4c('0x27')](function(_0x503123){_0x42385c['recipientsId']=_[_0xff4c('0x4a')](_0x503123)[_0xff4c('0x4b')](',');return db[_0xff4c('0x4c')][_0xff4c('0x4d')](function(_0x51d2a2){return db[_0xff4c('0x4e')]['create'](_0x42385c,{'raw':!![],'transaction':_0x51d2a2})['then'](function(_0x3d0ae6){var _0xeddc37={'sender':_0x42385c[_0xff4c('0x44')],'description':_0x42385c[_0xff4c('0x47')],'content':_0x42385c[_0xff4c('0x2e')],'beep':_0x42385c[_0xff4c('0x48')]};_0x503123[_0xff4c('0x4f')](function(_0x2f3287){_0xeddc37['recipient']=_0x2f3287;socket[_0xff4c('0x50')](_0xff4c('0x51'),_0xeddc37);});return _0x3d0ae6;});});})[_0xff4c('0x27')](respondWithResult(_0xbbc923,0xc9))[_0xff4c('0x52')](handleError(_0xbbc923,null));};function getContent(_0xcc3ce0){return new BPromise(function(_0x536d89,_0x3447b0){if(_0xcc3ce0[_0xff4c('0x30')]){_0x536d89(_0xcc3ce0[_0xff4c('0x30')]);return;}return db[_0xff4c('0x53')][_0xff4c('0x54')]({'attributes':['html'],'where':{'id':_0xcc3ce0['TemplateId']},'raw':!![]})[_0xff4c('0x27')](function(_0x214b55){if(!_0x214b55)throw new db[(_0xff4c('0x32'))][(_0xff4c('0x33'))]('Invalid\x20\x27TemplateId\x27\x20parameter');var _0x3858d0=Mustache['render'](_0x214b55[_0xff4c('0x55')],_0xcc3ce0['view']);_0x536d89(_0x3858d0);})[_0xff4c('0x52')](function(_0x559d36){_0x3447b0(_0x559d36);});});}function getRecipients(_0x404e28){return new BPromise(function(_0x4bfd88,_0x2ef4f1){var _0x1ac9a8=[];var _0x1acea9=[];_0x404e28[_0xff4c('0x4f')](function(_0x40c00a){var _0x1688a0=_[_0xff4c('0x56')](_0x40c00a['model'][_0xff4c('0x42')]());if(_0x1688a0==='User'){_0x1ac9a8=_['union'](_0x1ac9a8,_0x40c00a[_0xff4c('0x57')]);}else{if(_[_0xff4c('0x40')](_0x1688a0,_0xff4c('0x58')))_0x1688a0=_0x1688a0[_0xff4c('0x59')]('queue','Queue');_0x40c00a['ids'][_0xff4c('0x4f')](function(_0xcbf013){_0x1acea9[_0xff4c('0x5a')](getAgents(_0x1688a0,_0xcbf013));});}});return BPromise[_0xff4c('0x5b')](_0x1acea9)['then'](function(_0x38d214){_0x1ac9a8=_[_0xff4c('0x5c')](_0x1ac9a8,_[_0xff4c('0x5d')](_0x38d214));_0x4bfd88(_0x1ac9a8);})['catch'](function(_0x33b59f){_0x2ef4f1(_0x33b59f);});});}function getAgents(_0x56bf3e,_0x63d0d6){return new BPromise(function(_0x28b22d,_0x112444){return db[_0x56bf3e][_0xff4c('0x54')]({'where':{'id':_0x63d0d6}})[_0xff4c('0x27')](function(_0x5035ba){return _0x5035ba[_0xff4c('0x5e')]({'attributes':['id'],'raw':!![]})['then'](function(_0x443d41){var _0xfc767c=_[_0xff4c('0x5f')](_0x443d41,'id');_0x28b22d(_0xfc767c);});})[_0xff4c('0x52')](function(_0x2b6787){_0x112444(_0x2b6787);});});} \ No newline at end of file diff --git a/server/api/userNotification/userNotification.events.js b/server/api/userNotification/userNotification.events.js index 143eee7..5f96405 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 _0x694b=['exports','events','../../mysqldb','UserNotification','setMaxListeners','update','remove','emit','hasOwnProperty'];(function(_0x509dad,_0x1f995f){var _0x21e122=function(_0x2a9b90){while(--_0x2a9b90){_0x509dad['push'](_0x509dad['shift']());}};_0x21e122(++_0x1f995f);}(_0x694b,0x184));var _0xb694=function(_0x317d4c,_0x391e9d){_0x317d4c=_0x317d4c-0x0;var _0x433884=_0x694b[_0x317d4c];return _0x433884;};'use strict';var EventEmitter=require(_0xb694('0x0'));var UserNotification=require(_0xb694('0x1'))['db'][_0xb694('0x2')];var UserNotificationEvents=new EventEmitter();UserNotificationEvents[_0xb694('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xb694('0x4'),'afterDestroy':_0xb694('0x5')};function emitEvent(_0xea6fde){return function(_0x115228,_0x2bce0f,_0x46b2fb){UserNotificationEvents['emit'](_0xea6fde+':'+_0x115228['id'],_0x115228);UserNotificationEvents[_0xb694('0x6')](_0xea6fde,_0x115228);_0x46b2fb(null);};}for(var e in events){if(events[_0xb694('0x7')](e)){var event=events[e];UserNotification['hook'](e,emitEvent(event));}}module[_0xb694('0x8')]=UserNotificationEvents; \ No newline at end of file +var _0xde29=['update','remove','emit','hasOwnProperty','hook','exports','events','UserNotification','save'];(function(_0x609988,_0x507944){var _0x159984=function(_0x39d9ce){while(--_0x39d9ce){_0x609988['push'](_0x609988['shift']());}};_0x159984(++_0x507944);}(_0xde29,0x1a4));var _0x9de2=function(_0x3fbd51,_0x40b693){_0x3fbd51=_0x3fbd51-0x0;var _0x60db65=_0xde29[_0x3fbd51];return _0x60db65;};'use strict';var EventEmitter=require(_0x9de2('0x0'));var UserNotification=require('../../mysqldb')['db'][_0x9de2('0x1')];var UserNotificationEvents=new EventEmitter();UserNotificationEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x9de2('0x2'),'afterUpdate':_0x9de2('0x3'),'afterDestroy':_0x9de2('0x4')};function emitEvent(_0x423346){return function(_0x42f398,_0x1b1bce,_0x447692){UserNotificationEvents[_0x9de2('0x5')](_0x423346+':'+_0x42f398['id'],_0x42f398);UserNotificationEvents[_0x9de2('0x5')](_0x423346,_0x42f398);_0x447692(null);};}for(var e in events){if(events[_0x9de2('0x6')](e)){var event=events[e];UserNotification[_0x9de2('0x7')](e,emitEvent(event));}}module[_0x9de2('0x8')]=UserNotificationEvents; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.model.js b/server/api/userNotification/userNotification.model.js index 260529e..2fea7db 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 _0x05b6=['UserNotification','userNotifications','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./userNotification.attributes','exports','define'];(function(_0x226526,_0x18f8dc){var _0x2117c2=function(_0x27a168){while(--_0x27a168){_0x226526['push'](_0x226526['shift']());}};_0x2117c2(++_0x18f8dc);}(_0x05b6,0x74));var _0x605b=function(_0x51f357,_0x58d147){_0x51f357=_0x51f357-0x0;var _0x186473=_0x05b6[_0x51f357];return _0x186473;};'use strict';var _=require(_0x605b('0x0'));var util=require('util');var logger=require(_0x605b('0x1'))(_0x605b('0x2'));var moment=require(_0x605b('0x3'));var BPromise=require(_0x605b('0x4'));var rp=require(_0x605b('0x5'));var fs=require('fs');var path=require(_0x605b('0x6'));var rimraf=require(_0x605b('0x7'));var config=require(_0x605b('0x8'));var attributes=require(_0x605b('0x9'));module[_0x605b('0xa')]=function(_0x404efe,_0x311da0){return _0x404efe[_0x605b('0xb')](_0x605b('0xc'),attributes,{'tableName':_0x605b('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x605b('0xe'),'collate':_0x605b('0xf')});}; \ No newline at end of file +var _0xa988=['request-promise','path','../../config/environment','./userNotification.attributes','exports','define','UserNotification','userNotifications','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','bluebird'];(function(_0x50448b,_0x5ee3f0){var _0x38108b=function(_0xb88d24){while(--_0xb88d24){_0x50448b['push'](_0x50448b['shift']());}};_0x38108b(++_0x5ee3f0);}(_0xa988,0x1d7));var _0x8a98=function(_0x2d0c90,_0x34857e){_0x2d0c90=_0x2d0c90-0x0;var _0x45a452=_0xa988[_0x2d0c90];return _0x45a452;};'use strict';var _=require(_0x8a98('0x0'));var util=require(_0x8a98('0x1'));var logger=require(_0x8a98('0x2'))('api');var moment=require(_0x8a98('0x3'));var BPromise=require(_0x8a98('0x4'));var rp=require(_0x8a98('0x5'));var fs=require('fs');var path=require(_0x8a98('0x6'));var rimraf=require('rimraf');var config=require(_0x8a98('0x7'));var attributes=require(_0x8a98('0x8'));module[_0x8a98('0x9')]=function(_0x48ffb9,_0x1fa645){return _0x48ffb9[_0x8a98('0xa')](_0x8a98('0xb'),attributes,{'tableName':_0x8a98('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x8a98('0xd')});}; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.rpc.js b/server/api/userNotification/userNotification.rpc.js index c10c50e..0f26cdd 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 _0xa0f6=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','./userNotification.socket','register','info','UserNotification,\x20%s,\x20%s','request\x20sent','debug','UserNotification,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','randomstring'];(function(_0x416aa0,_0x3e4e0f){var _0x521a19=function(_0x157019){while(--_0x157019){_0x416aa0['push'](_0x416aa0['shift']());}};_0x521a19(++_0x3e4e0f);}(_0xa0f6,0x135));var _0x6a0f=function(_0x39ae54,_0x388a9b){_0x39ae54=_0x39ae54-0x0;var _0x266967=_0xa0f6[_0x39ae54];return _0x266967;};'use strict';var _=require(_0x6a0f('0x0'));var util=require(_0x6a0f('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x6a0f('0x2'));var fs=require('fs');var Redis=require(_0x6a0f('0x3'));var db=require(_0x6a0f('0x4'))['db'];var utils=require(_0x6a0f('0x5'));var logger=require(_0x6a0f('0x6'))(_0x6a0f('0x7'));var config=require(_0x6a0f('0x8'));var jayson=require(_0x6a0f('0x9'));var client=jayson[_0x6a0f('0xa')][_0x6a0f('0xb')]({'port':0x232a});config[_0x6a0f('0xc')]=_['defaults'](config[_0x6a0f('0xc')],{'host':_0x6a0f('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x6a0f('0xc')]));require(_0x6a0f('0xe'))[_0x6a0f('0xf')](socket);function respondWithRpcPromise(_0x42030c,_0x47238c,_0xebd664){return new BPromise(function(_0x210d4b,_0x53d1bb){return client['request'](_0x42030c,_0xebd664)['then'](function(_0x249eed){logger[_0x6a0f('0x10')](_0x6a0f('0x11'),_0x47238c,_0x6a0f('0x12'));logger[_0x6a0f('0x13')](_0x6a0f('0x14'),_0x47238c,_0x6a0f('0x12'),JSON[_0x6a0f('0x15')](_0x249eed));if(_0x249eed['error']){if(_0x249eed['error']['code']===0x1f4){logger['error'](_0x6a0f('0x11'),_0x47238c,_0x249eed[_0x6a0f('0x16')][_0x6a0f('0x17')]);return _0x53d1bb(_0x249eed['error'][_0x6a0f('0x17')]);}logger[_0x6a0f('0x16')](_0x6a0f('0x11'),_0x47238c,_0x249eed['error'][_0x6a0f('0x17')]);return _0x210d4b(_0x249eed[_0x6a0f('0x16')][_0x6a0f('0x17')]);}else{logger[_0x6a0f('0x10')](_0x6a0f('0x11'),_0x47238c,_0x6a0f('0x12'));_0x210d4b(_0x249eed[_0x6a0f('0x18')][_0x6a0f('0x17')]);}})[_0x6a0f('0x19')](function(_0x66ac6b){logger[_0x6a0f('0x16')](_0x6a0f('0x11'),_0x47238c,_0x66ac6b);_0x53d1bb(_0x66ac6b);});});} \ No newline at end of file +var _0xd818=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','defaults','redis','socket.io-emitter','register','request','UserNotification,\x20%s,\x20%s','request\x20sent','debug','UserNotification,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','moment','bluebird'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0xd818,0xa4));var _0x8d81=function(_0x3db122,_0x5e6bee){_0x3db122=_0x3db122-0x0;var _0x325b67=_0xd818[_0x3db122];return _0x325b67;};'use strict';var _=require(_0x8d81('0x0'));var util=require(_0x8d81('0x1'));var moment=require(_0x8d81('0x2'));var BPromise=require(_0x8d81('0x3'));var rs=require(_0x8d81('0x4'));var fs=require('fs');var Redis=require(_0x8d81('0x5'));var db=require(_0x8d81('0x6'))['db'];var utils=require(_0x8d81('0x7'));var logger=require(_0x8d81('0x8'))('rpc');var config=require(_0x8d81('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x8d81('0xa')][_0x8d81('0xb')]({'port':0x232a});config['redis']=_[_0x8d81('0xc')](config[_0x8d81('0xd')],{'host':'localhost','port':0x18eb});var socket=require(_0x8d81('0xe'))(new Redis(config[_0x8d81('0xd')]));require('./userNotification.socket')[_0x8d81('0xf')](socket);function respondWithRpcPromise(_0x2afbcb,_0x3256c1,_0x3dca8c){return new BPromise(function(_0x420379,_0x4c4491){return client[_0x8d81('0x10')](_0x2afbcb,_0x3dca8c)['then'](function(_0x1add74){logger['info'](_0x8d81('0x11'),_0x3256c1,_0x8d81('0x12'));logger[_0x8d81('0x13')](_0x8d81('0x14'),_0x3256c1,_0x8d81('0x12'),JSON[_0x8d81('0x15')](_0x1add74));if(_0x1add74[_0x8d81('0x16')]){if(_0x1add74[_0x8d81('0x16')][_0x8d81('0x17')]===0x1f4){logger[_0x8d81('0x16')](_0x8d81('0x11'),_0x3256c1,_0x1add74[_0x8d81('0x16')][_0x8d81('0x18')]);return _0x4c4491(_0x1add74[_0x8d81('0x16')][_0x8d81('0x18')]);}logger[_0x8d81('0x16')]('UserNotification,\x20%s,\x20%s',_0x3256c1,_0x1add74[_0x8d81('0x16')][_0x8d81('0x18')]);return _0x420379(_0x1add74[_0x8d81('0x16')]['message']);}else{logger[_0x8d81('0x19')]('UserNotification,\x20%s,\x20%s',_0x3256c1,_0x8d81('0x12'));_0x420379(_0x1add74[_0x8d81('0x1a')]['message']);}})[_0x8d81('0x1b')](function(_0x4dbdf1){logger[_0x8d81('0x16')]('UserNotification,\x20%s,\x20%s',_0x3256c1,_0x4dbdf1);_0x4c4491(_0x4dbdf1);});});} \ No newline at end of file diff --git a/server/api/userNotification/userNotification.socket.js b/server/api/userNotification/userNotification.socket.js index 9616154..2c3e665 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 _0x52ed=['./userNotification.events','save','remove','update','emit','removeListener','register','userNotification:'];(function(_0x40220a,_0x22feb1){var _0x3903cc=function(_0x33a296){while(--_0x33a296){_0x40220a['push'](_0x40220a['shift']());}};_0x3903cc(++_0x22feb1);}(_0x52ed,0x198));var _0xd52e=function(_0x2f4d7f,_0x62f4b7){_0x2f4d7f=_0x2f4d7f-0x0;var _0x147ba1=_0x52ed[_0x2f4d7f];return _0x147ba1;};'use strict';var UserNotificationEvents=require(_0xd52e('0x0'));var events=[_0xd52e('0x1'),_0xd52e('0x2'),_0xd52e('0x3')];function createListener(_0x37e8f5,_0x3a7d2f){return function(_0xa6087e){_0x3a7d2f[_0xd52e('0x4')](_0x37e8f5,_0xa6087e);};}function removeListener(_0x386e89,_0x1959c4){return function(){UserNotificationEvents[_0xd52e('0x5')](_0x386e89,_0x1959c4);};}exports[_0xd52e('0x6')]=function(_0x366e4f){for(var _0x49d32c=0x0,_0x441cb3=events['length'];_0x49d32c<_0x441cb3;_0x49d32c++){var _0x50a3a7=events[_0x49d32c];var _0x301b8f=createListener(_0xd52e('0x7')+_0x50a3a7,_0x366e4f);UserNotificationEvents['on'](_0x50a3a7,_0x301b8f);}}; \ No newline at end of file +var _0x33c6=['userNotification:','save','update','removeListener','register','length'];(function(_0x2adbeb,_0x5581be){var _0x5e18a6=function(_0x84e42b){while(--_0x84e42b){_0x2adbeb['push'](_0x2adbeb['shift']());}};_0x5e18a6(++_0x5581be);}(_0x33c6,0x16f));var _0x633c=function(_0x39c646,_0x1bbf0f){_0x39c646=_0x39c646-0x0;var _0x12ea70=_0x33c6[_0x39c646];return _0x12ea70;};'use strict';var UserNotificationEvents=require('./userNotification.events');var events=[_0x633c('0x0'),'remove',_0x633c('0x1')];function createListener(_0x34f8e9,_0x245828){return function(_0x11f20e){_0x245828['emit'](_0x34f8e9,_0x11f20e);};}function removeListener(_0xc997ab,_0x19025a){return function(){UserNotificationEvents[_0x633c('0x2')](_0xc997ab,_0x19025a);};}exports[_0x633c('0x3')]=function(_0x14c91b){for(var _0x20b48f=0x0,_0x359274=events[_0x633c('0x4')];_0x20b48f<_0x359274;_0x20b48f++){var _0x4143ab=events[_0x20b48f];var _0x241071=createListener(_0x633c('0x5')+_0x4143ab,_0x14c91b);UserNotificationEvents['on'](_0x4143ab,_0x241071);}}; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/index.js b/server/api/userOpenchannelQueue/index.js index e14fbef..12745e5 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(_0x535db8,_0xbef1c0){var _0x377735=function(_0x23364d){while(--_0x23364d){_0x535db8['push'](_0x535db8['shift']());}};_0x377735(++_0xbef1c0);}(_0x70e0,0x17b));var _0x070e=function(_0x30649d,_0x571b1a){_0x30649d=_0x30649d-0x0;var _0x141167=_0x70e0[_0x30649d];return _0x141167;};'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 _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x4d2a72,_0x533c59){var _0x9fd500=function(_0x11b446){while(--_0x11b446){_0x4d2a72['push'](_0x4d2a72['shift']());}};_0x9fd500(++_0x533c59);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x296144,_0x26bbbf){_0x296144=_0x296144-0x0;var _0x5329b1=_0xcb91[_0x296144];return _0x5329b1;};'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/userOpenchannelQueue/userOpenchannelQueue.attributes.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js index 74ff78e..21e2280 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 _0x3f03=['sequelize','exports','INTEGER'];(function(_0x254b48,_0x18ab08){var _0x666dd=function(_0x56d2fe){while(--_0x56d2fe){_0x254b48['push'](_0x254b48['shift']());}};_0x666dd(++_0x18ab08);}(_0x3f03,0xf0));var _0x33f0=function(_0x2ed2d6,_0x1d7cee){_0x2ed2d6=_0x2ed2d6-0x0;var _0x3d56cb=_0x3f03[_0x2ed2d6];return _0x3d56cb;};'use strict';var Sequelize=require(_0x33f0('0x0'));module[_0x33f0('0x1')]={'penalty':{'type':Sequelize[_0x33f0('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x8071=['sequelize'];(function(_0x29fe43,_0xb347b){var _0x5cdbf2=function(_0xad55ab){while(--_0xad55ab){_0x29fe43['push'](_0x29fe43['shift']());}};_0x5cdbf2(++_0xb347b);}(_0x8071,0x1c3));var _0x1807=function(_0x5630de,_0x120117){_0x5630de=_0x5630de-0x0;var _0x5957bf=_0x8071[_0x5630de];return _0x5957bf;};'use strict';var Sequelize=require(_0x1807('0x0'));module['exports']={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/userOpenchannelQueue.model.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.model.js index 1ced5a1..86b3e95 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 _0x74a8=['request-promise','path','./userOpenchannelQueue.attributes','exports','UserOpenchannelQueue','lodash','util','../../config/logger','moment'];(function(_0x52c1f6,_0x4eda0b){var _0x4df981=function(_0x71aa7){while(--_0x71aa7){_0x52c1f6['push'](_0x52c1f6['shift']());}};_0x4df981(++_0x4eda0b);}(_0x74a8,0xcb));var _0x874a=function(_0x102a1d,_0xeab8c4){_0x102a1d=_0x102a1d-0x0;var _0x1e9d1a=_0x74a8[_0x102a1d];return _0x1e9d1a;};'use strict';var _=require(_0x874a('0x0'));var util=require(_0x874a('0x1'));var logger=require(_0x874a('0x2'))('api');var moment=require(_0x874a('0x3'));var BPromise=require('bluebird');var rp=require(_0x874a('0x4'));var fs=require('fs');var path=require(_0x874a('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x874a('0x6'));module[_0x874a('0x7')]=function(_0x1dcc99,_0x109f0f){return _0x1dcc99['define'](_0x874a('0x8'),attributes,{'tableName':'user_has_openchannel_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5626=['../../config/environment','./userOpenchannelQueue.attributes','exports','define','UserOpenchannelQueue','user_has_openchannel_queues','lodash','util','../../config/logger','moment','bluebird','request-promise','path'];(function(_0x557d54,_0x4edf64){var _0x50ad36=function(_0x316ec6){while(--_0x316ec6){_0x557d54['push'](_0x557d54['shift']());}};_0x50ad36(++_0x4edf64);}(_0x5626,0x1f4));var _0x6562=function(_0x7583d,_0x13ca15){_0x7583d=_0x7583d-0x0;var _0xbba271=_0x5626[_0x7583d];return _0xbba271;};'use strict';var _=require(_0x6562('0x0'));var util=require(_0x6562('0x1'));var logger=require(_0x6562('0x2'))('api');var moment=require(_0x6562('0x3'));var BPromise=require(_0x6562('0x4'));var rp=require(_0x6562('0x5'));var fs=require('fs');var path=require(_0x6562('0x6'));var rimraf=require('rimraf');var config=require(_0x6562('0x7'));var attributes=require(_0x6562('0x8'));module[_0x6562('0x9')]=function(_0x569807,_0x3e8c05){return _0x569807[_0x6562('0xa')](_0x6562('0xb'),attributes,{'tableName':_0x6562('0xc'),'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 f357e31..2ed7cb8 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 _0xfe0a=['debug','UserOpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','UserOpenchannelQueue,\x20%s,\x20%s','message','result','lodash','moment','bluebird','randomstring','../../mysqldb','rpc','../../config/environment','jayson/promise','client','then','info','request\x20sent'];(function(_0x46746e,_0x7aaa02){var _0x964c9c=function(_0x2f67af){while(--_0x2f67af){_0x46746e['push'](_0x46746e['shift']());}};_0x964c9c(++_0x7aaa02);}(_0xfe0a,0x10c));var _0xafe0=function(_0xcf95b4,_0x24baf1){_0xcf95b4=_0xcf95b4-0x0;var _0x20d28b=_0xfe0a[_0xcf95b4];return _0x20d28b;};'use strict';var _=require(_0xafe0('0x0'));var util=require('util');var moment=require(_0xafe0('0x1'));var BPromise=require(_0xafe0('0x2'));var rs=require(_0xafe0('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xafe0('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xafe0('0x5'));var config=require(_0xafe0('0x6'));var jayson=require(_0xafe0('0x7'));var client=jayson[_0xafe0('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x52b706,_0x3fa984,_0x33e481){return new BPromise(function(_0x1a9b30,_0x29bce4){return client['request'](_0x52b706,_0x33e481)[_0xafe0('0x9')](function(_0x5bd48b){logger[_0xafe0('0xa')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x3fa984,_0xafe0('0xb'));logger[_0xafe0('0xc')](_0xafe0('0xd'),_0x3fa984,_0xafe0('0xb'),JSON[_0xafe0('0xe')](_0x5bd48b));if(_0x5bd48b[_0xafe0('0xf')]){if(_0x5bd48b['error'][_0xafe0('0x10')]===0x1f4){logger[_0xafe0('0xf')](_0xafe0('0x11'),_0x3fa984,_0x5bd48b[_0xafe0('0xf')]['message']);return _0x29bce4(_0x5bd48b[_0xafe0('0xf')][_0xafe0('0x12')]);}logger['error'](_0xafe0('0x11'),_0x3fa984,_0x5bd48b[_0xafe0('0xf')][_0xafe0('0x12')]);return _0x1a9b30(_0x5bd48b[_0xafe0('0xf')][_0xafe0('0x12')]);}else{logger[_0xafe0('0xa')](_0xafe0('0x11'),_0x3fa984,_0xafe0('0xb'));_0x1a9b30(_0x5bd48b[_0xafe0('0x13')][_0xafe0('0x12')]);}})['catch'](function(_0x484a0a){logger[_0xafe0('0xf')](_0xafe0('0x11'),_0x3fa984,_0x484a0a);_0x29bce4(_0x484a0a);});});} \ No newline at end of file +var _0xb59d=['ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','UserOpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','code','UserOpenchannelQueue,\x20%s,\x20%s','error','message','result','catch','lodash','util','moment','bluebird','randomstring'];(function(_0x4d7379,_0x4b4e63){var _0x46d7cf=function(_0x53f5f0){while(--_0x53f5f0){_0x4d7379['push'](_0x4d7379['shift']());}};_0x46d7cf(++_0x4b4e63);}(_0xb59d,0xe5));var _0xdb59=function(_0x270d2b,_0x2fb849){_0x270d2b=_0x270d2b-0x0;var _0x1bea16=_0xb59d[_0x270d2b];return _0x1bea16;};'use strict';var _=require(_0xdb59('0x0'));var util=require(_0xdb59('0x1'));var moment=require(_0xdb59('0x2'));var BPromise=require(_0xdb59('0x3'));var rs=require(_0xdb59('0x4'));var fs=require('fs');var Redis=require(_0xdb59('0x5'));var db=require(_0xdb59('0x6'))['db'];var utils=require(_0xdb59('0x7'));var logger=require('../../config/logger')(_0xdb59('0x8'));var config=require(_0xdb59('0x9'));var jayson=require(_0xdb59('0xa'));var client=jayson[_0xdb59('0xb')][_0xdb59('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1e1148,_0x4c4762,_0x468167){return new BPromise(function(_0x4d2a12,_0x438136){return client[_0xdb59('0xd')](_0x1e1148,_0x468167)[_0xdb59('0xe')](function(_0x2b6959){logger[_0xdb59('0xf')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x4c4762,_0xdb59('0x10'));logger[_0xdb59('0x11')](_0xdb59('0x12'),_0x4c4762,_0xdb59('0x10'),JSON[_0xdb59('0x13')](_0x2b6959));if(_0x2b6959['error']){if(_0x2b6959['error'][_0xdb59('0x14')]===0x1f4){logger['error'](_0xdb59('0x15'),_0x4c4762,_0x2b6959[_0xdb59('0x16')][_0xdb59('0x17')]);return _0x438136(_0x2b6959['error']['message']);}logger[_0xdb59('0x16')](_0xdb59('0x15'),_0x4c4762,_0x2b6959[_0xdb59('0x16')][_0xdb59('0x17')]);return _0x4d2a12(_0x2b6959[_0xdb59('0x16')][_0xdb59('0x17')]);}else{logger[_0xdb59('0xf')](_0xdb59('0x15'),_0x4c4762,_0xdb59('0x10'));_0x4d2a12(_0x2b6959[_0xdb59('0x18')][_0xdb59('0x17')]);}})[_0xdb59('0x19')](function(_0x83f96d){logger[_0xdb59('0x16')](_0xdb59('0x15'),_0x4c4762,_0x83f96d);_0x438136(_0x83f96d);});});} \ No newline at end of file diff --git a/server/api/userProfile/index.js b/server/api/userProfile/index.js index f2bcc9f..6f9f233 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 _0x948d=['isAuthenticated','index','/describe','describe','get','/:id','getSections','/:id/resources','getResources','post','/:id/clone','/:id/sections','addResources','delete','removeSections','removeResources','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./userProfile.controller'];(function(_0x416109,_0x4f8619){var _0xf9c380=function(_0x50ce89){while(--_0x50ce89){_0x416109['push'](_0x416109['shift']());}};_0xf9c380(++_0x4f8619);}(_0x948d,0x1e5));var _0xd948=function(_0x187ec,_0xcc3888){_0x187ec=_0x187ec-0x0;var _0xb51f5f=_0x948d[_0x187ec];return _0xb51f5f;};'use strict';var multer=require(_0xd948('0x0'));var util=require(_0xd948('0x1'));var path=require('path');var timeout=require(_0xd948('0x2'));var express=require(_0xd948('0x3'));var router=express[_0xd948('0x4')]();var fs_extra=require(_0xd948('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xd948('0x6'));var config=require(_0xd948('0x7'));var controller=require(_0xd948('0x8'));router['get']('/',auth[_0xd948('0x9')](),controller[_0xd948('0xa')]);router['get'](_0xd948('0xb'),auth[_0xd948('0x9')](),controller[_0xd948('0xc')]);router[_0xd948('0xd')](_0xd948('0xe'),auth[_0xd948('0x9')](),controller['show']);router[_0xd948('0xd')]('/:id/sections',auth[_0xd948('0x9')](),controller[_0xd948('0xf')]);router['get'](_0xd948('0x10'),auth['isAuthenticated'](),controller[_0xd948('0x11')]);router['post']('/',auth[_0xd948('0x9')](),controller['create']);router[_0xd948('0x12')](_0xd948('0x13'),auth[_0xd948('0x9')](),controller['clone']);router[_0xd948('0x12')](_0xd948('0x14'),auth['isAuthenticated'](),controller['addSections']);router[_0xd948('0x12')]('/:id/resources',auth['isAuthenticated'](),controller[_0xd948('0x15')]);router['put'](_0xd948('0xe'),auth[_0xd948('0x9')](),controller['update']);router[_0xd948('0x16')](_0xd948('0xe'),auth[_0xd948('0x9')](),controller['destroy']);router[_0xd948('0x16')](_0xd948('0x14'),auth[_0xd948('0x9')](),controller[_0xd948('0x17')]);router['delete'](_0xd948('0x10'),auth[_0xd948('0x9')](),controller[_0xd948('0x18')]);module[_0xd948('0x19')]=router; \ No newline at end of file +var _0x0697=['/:id/sections','getSections','getResources','post','/:id/clone','clone','addSections','/:id/resources','put','update','delete','destroy','removeSections','removeResources','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./userProfile.controller','get','isAuthenticated','/describe','/:id'];(function(_0xa4c85,_0x2b52a7){var _0x172c1f=function(_0x149473){while(--_0x149473){_0xa4c85['push'](_0xa4c85['shift']());}};_0x172c1f(++_0x2b52a7);}(_0x0697,0x16a));var _0x7069=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0697[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x7069('0x0'));var util=require(_0x7069('0x1'));var path=require(_0x7069('0x2'));var timeout=require(_0x7069('0x3'));var express=require(_0x7069('0x4'));var router=express[_0x7069('0x5')]();var fs_extra=require(_0x7069('0x6'));var auth=require(_0x7069('0x7'));var interaction=require(_0x7069('0x8'));var config=require(_0x7069('0x9'));var controller=require(_0x7069('0xa'));router[_0x7069('0xb')]('/',auth[_0x7069('0xc')](),controller['index']);router[_0x7069('0xb')](_0x7069('0xd'),auth[_0x7069('0xc')](),controller['describe']);router[_0x7069('0xb')](_0x7069('0xe'),auth[_0x7069('0xc')](),controller['show']);router[_0x7069('0xb')](_0x7069('0xf'),auth['isAuthenticated'](),controller[_0x7069('0x10')]);router[_0x7069('0xb')]('/:id/resources',auth[_0x7069('0xc')](),controller[_0x7069('0x11')]);router[_0x7069('0x12')]('/',auth[_0x7069('0xc')](),controller['create']);router[_0x7069('0x12')](_0x7069('0x13'),auth[_0x7069('0xc')](),controller[_0x7069('0x14')]);router[_0x7069('0x12')](_0x7069('0xf'),auth[_0x7069('0xc')](),controller[_0x7069('0x15')]);router[_0x7069('0x12')](_0x7069('0x16'),auth['isAuthenticated'](),controller['addResources']);router[_0x7069('0x17')](_0x7069('0xe'),auth[_0x7069('0xc')](),controller[_0x7069('0x18')]);router[_0x7069('0x19')]('/:id',auth[_0x7069('0xc')](),controller[_0x7069('0x1a')]);router[_0x7069('0x19')](_0x7069('0xf'),auth[_0x7069('0xc')](),controller[_0x7069('0x1b')]);router['delete'](_0x7069('0x16'),auth['isAuthenticated'](),controller[_0x7069('0x1c')]);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 a1ef442..3a4de62 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 _0x4ab4=['name','setDataValue','crudPermissions','join','getDataValue','BOOLEAN','sequelize','STRING'];(function(_0x354422,_0x383c8f){var _0x411173=function(_0x3b5edf){while(--_0x3b5edf){_0x354422['push'](_0x354422['shift']());}};_0x411173(++_0x383c8f);}(_0x4ab4,0x186));var _0x44ab=function(_0x3fe889,_0x1b0b72){_0x3fe889=_0x3fe889-0x0;var _0x5e0026=_0x4ab4[_0x3fe889];return _0x5e0026;};'use strict';var Sequelize=require(_0x44ab('0x0'));module['exports']={'name':{'type':Sequelize[_0x44ab('0x1')],'allowNull':![],'unique':_0x44ab('0x2')},'crudPermissions':{'type':Sequelize[_0x44ab('0x1')],'set':function(_0x4c9fbc){this[_0x44ab('0x3')](_0x44ab('0x4'),_0x4c9fbc?_0x4c9fbc[_0x44ab('0x5')](''):[]);},'get':function(){return this[_0x44ab('0x6')](_0x44ab('0x4'))?this[_0x44ab('0x6')](_0x44ab('0x4'))['split'](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize[_0x44ab('0x1')],'allowNull':!![]},'privacyEnabled':{'type':Sequelize[_0x44ab('0x7')],'defaultValue':![]},'downloadAttachments':{'type':Sequelize[_0x44ab('0x7')],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize[_0x44ab('0x7')],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize[_0x44ab('0x7')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x44ab('0x7')],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize[_0x44ab('0x7')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file +var _0xd1b1=['BOOLEAN','exports','STRING','setDataValue','crudPermissions','join','getDataValue'];(function(_0x2bd6d9,_0x2071cb){var _0x4b4929=function(_0x41a57b){while(--_0x41a57b){_0x2bd6d9['push'](_0x2bd6d9['shift']());}};_0x4b4929(++_0x2071cb);}(_0xd1b1,0x1a5));var _0x1d1b=function(_0x5b0f62,_0xfba66a){_0x5b0f62=_0x5b0f62-0x0;var _0x9a8bb0=_0xd1b1[_0x5b0f62];return _0x9a8bb0;};'use strict';var Sequelize=require('sequelize');module[_0x1d1b('0x0')]={'name':{'type':Sequelize[_0x1d1b('0x1')],'allowNull':![],'unique':'name'},'crudPermissions':{'type':Sequelize[_0x1d1b('0x1')],'set':function(_0x22cf83){this[_0x1d1b('0x2')](_0x1d1b('0x3'),_0x22cf83?_0x22cf83[_0x1d1b('0x4')](''):[]);},'get':function(){return this[_0x1d1b('0x5')]('crudPermissions')?this[_0x1d1b('0x5')](_0x1d1b('0x3'))['split'](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize[_0x1d1b('0x1')],'allowNull':!![]},'privacyEnabled':{'type':Sequelize[_0x1d1b('0x6')],'defaultValue':![]},'downloadAttachments':{'type':Sequelize[_0x1d1b('0x6')],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize[_0x1d1b('0x6')],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize[_0x1d1b('0x6')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x1d1b('0x6')],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize[_0x1d1b('0x6')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0x1d1b('0x6')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.controller.js b/server/api/userProfile/userProfile.controller.js index b834403..caa266e 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 _0xc0d7=['sectionId','each','push','removeSections','ids','getSections','includes','isEmpty','subsections','enabled','Dashboard','forEach','resourceId','addResources','transaction','bulkCreate','getResources','Missing\x20section\x20parameter','No\x20User\x20Profile\x20found\x20for\x20id\x20','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./userProfile.socket','register','sendStatus','end','status','json','offset','undefined','limit','count','apply','reject','save','update','then','destroy','stack','name','send','index','map','type','key','keys','filters','intersection','query','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','UserProfile','catch','show','params','rawAttributes','include','merge','options','find','create','body','clone','includeAll','get','omit','createdAt','updatedAt','sequelize','UserProfileSection','autoAssociation','UserProfileResource','findAll','userProfileId','Resources','describe'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xc0d7,0x7f));var _0x7c0d=function(_0x383725,_0x1d9f0c){_0x383725=_0x383725-0x0;var _0x520501=_0xc0d7[_0x383725];return _0x520501;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x7c0d('0x0'));var rp=require(_0x7c0d('0x1'));var moment=require(_0x7c0d('0x2'));var BPromise=require(_0x7c0d('0x3'));var Mustache=require(_0x7c0d('0x4'));var util=require(_0x7c0d('0x5'));var path=require(_0x7c0d('0x6'));var sox=require(_0x7c0d('0x7'));var csv=require(_0x7c0d('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7c0d('0x9'));var _=require(_0x7c0d('0xa'));var squel=require(_0x7c0d('0xb'));var crypto=require(_0x7c0d('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x7c0d('0xd'));var toCsv=require(_0x7c0d('0x8'));var querystring=require(_0x7c0d('0xe'));var Papa=require(_0x7c0d('0xf'));var Redis=require('ioredis');var authService=require(_0x7c0d('0x10'));var qs=require(_0x7c0d('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x7c0d('0x12'))(_0x7c0d('0x13'));var utils=require('../../config/utils');var config=require(_0x7c0d('0x14'));var licenseUtil=require(_0x7c0d('0x15'));var db=require(_0x7c0d('0x16'))['db'];config[_0x7c0d('0x17')]=_[_0x7c0d('0x18')](config[_0x7c0d('0x17')],{'host':'localhost','port':0x18eb});var socket=require(_0x7c0d('0x19'))(new Redis(config[_0x7c0d('0x17')]));require(_0x7c0d('0x1a'))[_0x7c0d('0x1b')](socket);function respondWithStatusCode(_0x33dd94,_0xe2533c){_0xe2533c=_0xe2533c||0xcc;return function(_0x9c965b){if(_0x9c965b){return _0x33dd94[_0x7c0d('0x1c')](_0xe2533c);}return _0x33dd94['status'](_0xe2533c)[_0x7c0d('0x1d')]();};}function respondWithResult(_0x4e9850,_0x20bf75){_0x20bf75=_0x20bf75||0xc8;return function(_0x571480){if(_0x571480){return _0x4e9850[_0x7c0d('0x1e')](_0x20bf75)[_0x7c0d('0x1f')](_0x571480);}};}function respondWithFilteredResult(_0x478100,_0x3e506f){return function(_0x2841e1){if(_0x2841e1){var _0x906a2c=typeof _0x3e506f[_0x7c0d('0x20')]===_0x7c0d('0x21')&&typeof _0x3e506f[_0x7c0d('0x22')]===_0x7c0d('0x21');var _0x111dbe=_0x2841e1[_0x7c0d('0x23')];var _0x3e1b95=_0x906a2c?0x0:_0x3e506f[_0x7c0d('0x20')];var _0x407f52=_0x906a2c?_0x2841e1[_0x7c0d('0x23')]:_0x3e506f[_0x7c0d('0x20')]+_0x3e506f[_0x7c0d('0x22')];var _0x1308c6;if(_0x407f52>=_0x111dbe){_0x407f52=_0x111dbe;_0x1308c6=0xc8;}else{_0x1308c6=0xce;}_0x478100['status'](_0x1308c6);return _0x478100['set']('Content-Range',_0x3e1b95+'-'+_0x407f52+'/'+_0x111dbe)['json'](_0x2841e1);}return null;};}function patchUpdates(_0x5872fe){return function(_0x3c401a){try{jsonpatch[_0x7c0d('0x24')](_0x3c401a,_0x5872fe,!![]);}catch(_0x1c7b84){return BPromise[_0x7c0d('0x25')](_0x1c7b84);}return _0x3c401a[_0x7c0d('0x26')]();};}function saveUpdates(_0x2a92ce,_0x360c67){return function(_0x5b4b2b){if(_0x5b4b2b){return _0x5b4b2b[_0x7c0d('0x27')](_0x2a92ce)[_0x7c0d('0x28')](function(_0x5aa006){return _0x5aa006;});}return null;};}function removeEntity(_0x540abc,_0x357cca){return function(_0x5a0d69){if(_0x5a0d69){return _0x5a0d69[_0x7c0d('0x29')]()[_0x7c0d('0x28')](function(){_0x540abc[_0x7c0d('0x1e')](0xcc)[_0x7c0d('0x1d')]();});}};}function handleEntityNotFound(_0x4625d0,_0x5ea868){return function(_0x27fc36){if(!_0x27fc36){_0x4625d0[_0x7c0d('0x1c')](0x194);}return _0x27fc36;};}function handleError(_0x36a264,_0x1e37c6){_0x1e37c6=_0x1e37c6||0x1f4;return function(_0x2a8756){logger['error'](_0x2a8756[_0x7c0d('0x2a')]);if(_0x2a8756['name']){delete _0x2a8756[_0x7c0d('0x2b')];}_0x36a264[_0x7c0d('0x1e')](_0x1e37c6)[_0x7c0d('0x2c')](_0x2a8756);};}exports[_0x7c0d('0x2d')]=function(_0xb0e57e,_0x35284b){var _0x4f66ef={},_0x16023f={},_0x5dbfe1={'count':0x0,'rows':[]};var _0x368e6f=_[_0x7c0d('0x2e')](db['UserProfile']['rawAttributes'],function(_0x6dee5a){return{'name':_0x6dee5a['fieldName'],'type':_0x6dee5a[_0x7c0d('0x2f')][_0x7c0d('0x30')]};});_0x16023f['model']=_['map'](_0x368e6f,'name');_0x16023f['query']=_[_0x7c0d('0x31')](_0xb0e57e['query']);_0x16023f[_0x7c0d('0x32')]=_[_0x7c0d('0x33')](_0x16023f['model'],_0x16023f[_0x7c0d('0x34')]);_0x4f66ef[_0x7c0d('0x35')]=_[_0x7c0d('0x33')](_0x16023f[_0x7c0d('0x36')],qs['fields'](_0xb0e57e[_0x7c0d('0x34')][_0x7c0d('0x37')]));_0x4f66ef[_0x7c0d('0x35')]=_0x4f66ef[_0x7c0d('0x35')][_0x7c0d('0x38')]?_0x4f66ef[_0x7c0d('0x35')]:_0x16023f[_0x7c0d('0x36')];if(!_0xb0e57e[_0x7c0d('0x34')][_0x7c0d('0x39')](_0x7c0d('0x3a'))){_0x4f66ef['limit']=qs[_0x7c0d('0x22')](_0xb0e57e[_0x7c0d('0x34')]['limit']);_0x4f66ef[_0x7c0d('0x20')]=qs[_0x7c0d('0x20')](_0xb0e57e[_0x7c0d('0x34')][_0x7c0d('0x20')]);}_0x4f66ef[_0x7c0d('0x3b')]=qs[_0x7c0d('0x3c')](_0xb0e57e['query'][_0x7c0d('0x3c')]);_0x4f66ef[_0x7c0d('0x3d')]=qs[_0x7c0d('0x32')](_[_0x7c0d('0x3e')](_0xb0e57e[_0x7c0d('0x34')],_0x16023f['filters']),_0x368e6f);if(_0xb0e57e['query'][_0x7c0d('0x3f')]){_0x4f66ef[_0x7c0d('0x3d')]=_['merge'](_0x4f66ef[_0x7c0d('0x3d')],{'$or':_['map'](_0x368e6f,function(_0x2c51f7){if(_0x2c51f7[_0x7c0d('0x2f')]!=='VIRTUAL'){var _0x33ac68={};_0x33ac68[_0x2c51f7['name']]={'$like':'%'+_0xb0e57e[_0x7c0d('0x34')][_0x7c0d('0x3f')]+'%'};return _0x33ac68;}})});}_0x4f66ef=_['merge']({},_0x4f66ef,_0xb0e57e['options']);var _0x5ca209={'where':_0x4f66ef[_0x7c0d('0x3d')]};return db[_0x7c0d('0x40')][_0x7c0d('0x23')](_0x5ca209)[_0x7c0d('0x28')](function(_0x5dc200){_0x5dbfe1['count']=_0x5dc200;if(_0xb0e57e[_0x7c0d('0x34')]['includeAll']){_0x4f66ef['include']=[{'all':!![]}];}return db[_0x7c0d('0x40')]['findAll'](_0x4f66ef);})[_0x7c0d('0x28')](function(_0x36aafb){_0x5dbfe1['rows']=_0x36aafb;return _0x5dbfe1;})[_0x7c0d('0x28')](respondWithFilteredResult(_0x35284b,_0x4f66ef))[_0x7c0d('0x41')](handleError(_0x35284b,null));};exports[_0x7c0d('0x42')]=function(_0x3c3339,_0x141d2b){var _0x490573={'raw':![],'where':{'id':_0x3c3339[_0x7c0d('0x43')]['id']}},_0x3e7e8f={};_0x3e7e8f['model']=_[_0x7c0d('0x31')](db[_0x7c0d('0x40')][_0x7c0d('0x44')]);_0x3e7e8f[_0x7c0d('0x34')]=_['keys'](_0x3c3339[_0x7c0d('0x34')]);_0x3e7e8f[_0x7c0d('0x32')]=_[_0x7c0d('0x33')](_0x3e7e8f[_0x7c0d('0x36')],_0x3e7e8f[_0x7c0d('0x34')]);_0x490573['attributes']=_[_0x7c0d('0x33')](_0x3e7e8f['model'],qs[_0x7c0d('0x37')](_0x3c3339['query'][_0x7c0d('0x37')]));_0x490573[_0x7c0d('0x35')]=_0x490573[_0x7c0d('0x35')][_0x7c0d('0x38')]?_0x490573[_0x7c0d('0x35')]:_0x3e7e8f['model'];if(_0x3c3339[_0x7c0d('0x34')]['includeAll']){_0x490573[_0x7c0d('0x45')]=[{'all':!![]}];}_0x490573=_[_0x7c0d('0x46')]({},_0x490573,_0x3c3339[_0x7c0d('0x47')]);return db['UserProfile'][_0x7c0d('0x48')](_0x490573)['then'](handleEntityNotFound(_0x141d2b,null))['then'](respondWithResult(_0x141d2b,null))[_0x7c0d('0x41')](handleError(_0x141d2b,null));};exports[_0x7c0d('0x49')]=function(_0x24a5c4,_0x57038b){return db[_0x7c0d('0x40')][_0x7c0d('0x49')](_0x24a5c4[_0x7c0d('0x4a')],{})['then'](respondWithResult(_0x57038b,0xc9))[_0x7c0d('0x41')](handleError(_0x57038b,null));};exports[_0x7c0d('0x4b')]=function(_0x1d90e1,_0x2064d1){var _0x2ae2fa={'where':{'id':_0x1d90e1['params']['id']}},_0x5be7d5={};_0x5be7d5[_0x7c0d('0x36')]=_[_0x7c0d('0x31')](db['UserProfile']['rawAttributes']);_0x2ae2fa[_0x7c0d('0x35')]=_[_0x7c0d('0x33')](_0x5be7d5[_0x7c0d('0x36')],qs['fields'](_0x1d90e1[_0x7c0d('0x34')][_0x7c0d('0x37')]));_0x2ae2fa[_0x7c0d('0x35')]=_0x2ae2fa[_0x7c0d('0x35')][_0x7c0d('0x38')]?_0x2ae2fa[_0x7c0d('0x35')]:_0x5be7d5['model'];if(_0x1d90e1['query'][_0x7c0d('0x4c')]){_0x2ae2fa[_0x7c0d('0x45')]=[{'all':!![]}];}_0x2ae2fa=_[_0x7c0d('0x46')]({},_0x2ae2fa,_0x1d90e1['options']);return db[_0x7c0d('0x40')][_0x7c0d('0x48')](_0x2ae2fa)[_0x7c0d('0x28')](handleEntityNotFound(_0x2064d1,null))[_0x7c0d('0x28')](function(_0x4c81fb){if(_0x4c81fb){var _0x130580=_0x4c81fb[_0x7c0d('0x4d')]({'plain':!![]});_0x130580=qs[_0x7c0d('0x4e')](_0x130580,['id',_0x7c0d('0x4f'),_0x7c0d('0x50'),'crudPermissions']);_0x1d90e1['body']=_[_0x7c0d('0x4e')](_0x1d90e1[_0x7c0d('0x4a')],['id',_0x7c0d('0x4f'),_0x7c0d('0x50')]);return db[_0x7c0d('0x51')]['transaction'](function(_0x1b8464){return db[_0x7c0d('0x40')][_0x7c0d('0x49')](_['merge'](_0x130580,_0x1d90e1[_0x7c0d('0x4a')]),{'include':_0x1d90e1[_0x7c0d('0x34')]['includeAll']?[{'all':!![]}]:undefined,'transaction':_0x1b8464})[_0x7c0d('0x28')](function(_0x446c20){var _0x1072a7=_0x446c20[_0x7c0d('0x4d')]({'plain':!![]});return db[_0x7c0d('0x52')]['findAll']({'where':{'userProfileId':_0x1d90e1['params']['id']},'raw':!![]})['then'](function(_0xe7e80c){if(_0xe7e80c){return BPromise['each'](_0xe7e80c,function(_0x432d5a){return new BPromise(function(_0x38acae,_0x293344){if(_0x432d5a['autoAssociation']===null||_0x432d5a[_0x7c0d('0x53')]===0x1)_0x38acae(null);return db[_0x7c0d('0x54')][_0x7c0d('0x55')]({'where':{'sectionId':_0x432d5a['id']},'raw':!![]})[_0x7c0d('0x28')](function(_0x4bd3b4){var _0x83cb2=_[_0x7c0d('0x2e')](_0x4bd3b4,function(_0x40a488){return qs[_0x7c0d('0x4e')](_0x40a488,['id',_0x7c0d('0x4f'),_0x7c0d('0x50'),'sectionId']);});_0x38acae(_0x83cb2);})['catch'](function(_0x2630a5){_0x293344(_0x2630a5);});})[_0x7c0d('0x28')](function(_0x3153a4){var _0x4ce477=qs[_0x7c0d('0x4e')](_0x432d5a,['id',_0x7c0d('0x4f'),'updatedAt']);_0x4ce477[_0x7c0d('0x56')]=_0x1072a7['id'];if(_0x3153a4)_0x4ce477[_0x7c0d('0x57')]=_0x3153a4;return _0x4ce477;})[_0x7c0d('0x28')](function(_0x47fc74){return db['UserProfileSection'][_0x7c0d('0x49')](_0x47fc74,{'include':[{'model':db[_0x7c0d('0x54')],'as':_0x7c0d('0x57')}],'raw':!![],'transaction':_0x1b8464});});})[_0x7c0d('0x28')](function(){return _0x1072a7;});}});});});}})[_0x7c0d('0x28')](respondWithResult(_0x2064d1,0xc9))[_0x7c0d('0x41')](handleError(_0x2064d1,null));};exports[_0x7c0d('0x27')]=function(_0x17464e,_0x553dc8){if(_0x17464e[_0x7c0d('0x4a')]['id']){delete _0x17464e[_0x7c0d('0x4a')]['id'];}return db['UserProfile'][_0x7c0d('0x48')]({'where':{'id':_0x17464e['params']['id']}})[_0x7c0d('0x28')](handleEntityNotFound(_0x553dc8,null))['then'](saveUpdates(_0x17464e['body'],null))['then'](respondWithResult(_0x553dc8,null))[_0x7c0d('0x41')](handleError(_0x553dc8,null));};exports[_0x7c0d('0x29')]=function(_0x34228d,_0xa26bf){return db[_0x7c0d('0x40')]['find']({'where':{'id':_0x34228d[_0x7c0d('0x43')]['id']}})['then'](handleEntityNotFound(_0xa26bf,null))[_0x7c0d('0x28')](removeEntity(_0xa26bf,null))[_0x7c0d('0x41')](handleError(_0xa26bf,null));};exports[_0x7c0d('0x58')]=function(_0x474ee8,_0x2234f2){return db[_0x7c0d('0x40')]['describe']()['then'](respondWithResult(_0x2234f2,null))[_0x7c0d('0x41')](handleError(_0x2234f2,null));};exports['addSections']=function(_0x1e0ca5,_0x1d077a){var _0x44af1c=_0x1e0ca5[_0x7c0d('0x4a')];return db[_0x7c0d('0x40')][_0x7c0d('0x48')]({'where':{'id':_0x1e0ca5['params']['id']}})[_0x7c0d('0x28')](handleEntityNotFound(_0x1d077a,null))['then'](function(_0x24d194){if(_0x24d194){return db['sequelize']['transaction'](function(_0x4ffa50){return db[_0x7c0d('0x52')]['destroy']({'where':{'userProfileId':_0x1e0ca5[_0x7c0d('0x43')]['id'],'sectionId':_[_0x7c0d('0x2e')](_0x44af1c,function(_0x300f4a){return _0x300f4a[_0x7c0d('0x59')];})},'transaction':_0x4ffa50})[_0x7c0d('0x28')](function(){var _0xdb8150=_[_0x7c0d('0x2e')](_0x44af1c,function(_0x1208d5){_0x1208d5['userProfileId']=_0x1e0ca5[_0x7c0d('0x43')]['id'];return _0x1208d5;});var _0x56de5c=[];return BPromise[_0x7c0d('0x5a')](_0xdb8150,function(_0x815be6){return db[_0x7c0d('0x52')][_0x7c0d('0x49')](_0x815be6,{'include':[{'model':db['UserProfileResource'],'as':_0x7c0d('0x57')}],'raw':!![],'transaction':_0x4ffa50})[_0x7c0d('0x28')](function(_0x59f82f){_0x56de5c[_0x7c0d('0x5b')](_0x59f82f[_0x7c0d('0x4d')]({'plain':!![]}));});})[_0x7c0d('0x28')](function(){return _0x56de5c;});});});}})[_0x7c0d('0x28')](function(_0x2e1f40){return _0x2e1f40;})[_0x7c0d('0x28')](respondWithResult(_0x1d077a,null))['catch'](handleError(_0x1d077a,null));};exports[_0x7c0d('0x5c')]=function(_0x3d0015,_0x3c2e91){var _0x2689d8;return db[_0x7c0d('0x40')][_0x7c0d('0x48')]({'where':{'id':_0x3d0015[_0x7c0d('0x43')]['id']},'attributes':['id','name']})[_0x7c0d('0x28')](handleEntityNotFound(_0x3c2e91,null))['then'](function(_0x165b6d){if(_0x165b6d){_0x2689d8=_0x165b6d;return db[_0x7c0d('0x52')][_0x7c0d('0x29')]({'where':{'userProfileId':_0x3d0015[_0x7c0d('0x43')]['id'],'sectionId':_0x3d0015[_0x7c0d('0x34')][_0x7c0d('0x5d')]}});}})['then'](function(){return _0x2689d8;})['then'](respondWithStatusCode(_0x3c2e91,null))['catch'](handleError(_0x3c2e91,null));};exports[_0x7c0d('0x5e')]=function(_0x5802e9,_0x556d85){var _0x4588b3=[];var _0xc13ba0=[];return db[_0x7c0d('0x52')][_0x7c0d('0x55')]({'where':{'userProfileId':_0x5802e9[_0x7c0d('0x43')]['id']},'raw':!![]})['then'](function(_0xe03a76){_0x4588b3=_['filter'](_0xe03a76,function(_0x17b233){return _0x17b233['enabled']===0x1||_[_0x7c0d('0x5f')]([0x3eb,0x709],_0x17b233['sectionId']);});if(!_[_0x7c0d('0x60')](_0x4588b3)){return _[_0x7c0d('0x2e')](_0x4588b3,function(_0xa35f1c){return _0xa35f1c['sectionId'];});}else{return;}})[_0x7c0d('0x28')](function(_0x29e6a3){if(_0x29e6a3)_0xc13ba0=_0x29e6a3;if(_[_0x7c0d('0x5f')](_0xc13ba0,0x64)){var _0x357635=_[_0x7c0d('0x48')](_0x4588b3,{'sectionId':0x64});return hasDefaultDashboard(_0x357635)[_0x7c0d('0x28')](function(_0x1514d2){return _['map'](_0x4588b3,function(_0x4b519e){if(_0x4b519e['sectionId']===0x64){_0x4b519e[_0x7c0d('0x61')]=_0x1514d2;}return _0x4b519e;});});}else{return;}})[_0x7c0d('0x28')](function(_0x4cbd7b){if(_0x4cbd7b)_0x4588b3=_0x4cbd7b;if(_[_0x7c0d('0x5f')](_0xc13ba0,0x3eb)){var _0xea781e=_[_0x7c0d('0x48')](_0x4588b3,{'sectionId':0x3eb});return getCustomDashboards(_0xea781e)[_0x7c0d('0x28')](function(_0x4fe08d){return _['map'](_0x4588b3,function(_0x5bc3ed){if(_0xea781e['enabled']){if(_0x5bc3ed[_0x7c0d('0x59')]===0x3eb){_0x5bc3ed['subsections']=_0x4fe08d;}}else{if(_0x5bc3ed[_0x7c0d('0x59')]===0x64){_0x5bc3ed['subsections']=_0x4fe08d;}}return _0x5bc3ed;});});}else{return;}})[_0x7c0d('0x28')](function(_0x4db98f){if(_0x4db98f)_0x4588b3=_0x4db98f;if(_['includes'](_0xc13ba0,0x709)){var _0x1c5873=_[_0x7c0d('0x48')](_0x4588b3,{'sectionId':0x709});return getPlugins(_0x1c5873)[_0x7c0d('0x28')](function(_0x410aac){if(_0x1c5873[_0x7c0d('0x62')]){return _[_0x7c0d('0x2e')](_0x4588b3,function(_0xb4f856){if(_0xb4f856[_0x7c0d('0x59')]===0x709){_0xb4f856[_0x7c0d('0x61')]=_0x410aac;}return _0xb4f856;});}else{var _0x1a275e={'sectionId':0x76c,'enabled':0x1,'subsections':_0x410aac};var _0x5bc1d6=_['map'](_0x4588b3);_0x5bc1d6[_0x7c0d('0x5b')](_0x1a275e);return _0x5bc1d6;}});}else{return;}})[_0x7c0d('0x28')](function(_0x5dd43c){if(_0x5dd43c)_0x4588b3=_0x5dd43c;return _[_0x7c0d('0x3f')](_0x4588b3,['enabled',0x1]);})[_0x7c0d('0x28')](respondWithResult(_0x556d85,null))[_0x7c0d('0x41')](handleError(_0x556d85,null));};function hasDefaultDashboard(_0x376787){var _0x5d5417=[0x65];return new BPromise(function(_0x26a0d8,_0x558445){try{if(_0x376787[_0x7c0d('0x53')]){_0x26a0d8(_0x5d5417);}else{return db[_0x7c0d('0x54')]['findOne']({'where':{'sectionId':_0x376787['id']},'raw':!![]})[_0x7c0d('0x28')](function(_0x42c5d3){_0x42c5d3?_0x26a0d8(_0x5d5417):_0x26a0d8();});}}catch(_0x416ffc){_0x558445(_0x416ffc);}});}function getCustomDashboards(_0x416de9){var _0x1eafca=[];return new BPromise(function(_0x55a80c,_0x1f6998){try{if(_0x416de9['autoAssociation']){return db[_0x7c0d('0x63')]['findAll']({'raw':!![]})['then'](function(_0x1ceb1b){_0x1ceb1b['forEach'](function(_0x5ea23c){_0x1eafca[_0x7c0d('0x5b')](_0x5ea23c['id']+0x1869f);});_0x55a80c(_0x1eafca);});}else{return db[_0x7c0d('0x54')]['findAll']({'where':{'sectionId':_0x416de9['id']},'raw':!![]})[_0x7c0d('0x28')](function(_0xa21402){_0xa21402[_0x7c0d('0x64')](function(_0x4e6028){_0x1eafca['push'](_0x4e6028[_0x7c0d('0x65')]+0x1869f);});_0x55a80c(_0x1eafca);});}}catch(_0x67f985){_0x1f6998(_0x67f985);}});}function getPlugins(_0x380bab){var _0x2de550=[];return new BPromise(function(_0x467870,_0x6edcaf){try{if(_0x380bab[_0x7c0d('0x53')]){return db['Plugin'][_0x7c0d('0x55')]({'raw':!![]})['then'](function(_0x2ee826){_0x2ee826[_0x7c0d('0x64')](function(_0x551357){_0x2de550[_0x7c0d('0x5b')](_0x551357['id']+0x15b38);});_0x467870(_0x2de550);});}else{return db[_0x7c0d('0x54')][_0x7c0d('0x55')]({'where':{'sectionId':_0x380bab['id']},'raw':!![]})[_0x7c0d('0x28')](function(_0x28abd0){_0x28abd0[_0x7c0d('0x64')](function(_0x48d6cf){_0x2de550[_0x7c0d('0x5b')](_0x48d6cf[_0x7c0d('0x65')]+0x15b38);});_0x467870(_0x2de550);});}}catch(_0x32ac1f){_0x6edcaf(_0x32ac1f);}});}exports[_0x7c0d('0x66')]=function(_0x3bae51,_0x5d605e){return db[_0x7c0d('0x40')]['find']({'where':{'id':_0x3bae51[_0x7c0d('0x43')]['id']}})[_0x7c0d('0x28')](handleEntityNotFound(_0x5d605e,null))[_0x7c0d('0x28')](function(_0x4a233a){if(_0x4a233a){return db['sequelize'][_0x7c0d('0x67')](function(_0x52338e){return db['UserProfileSection']['findAll']({'where':{'userProfileId':_0x3bae51[_0x7c0d('0x43')]['id']},'attributes':['id'],'raw':!![]})[_0x7c0d('0x28')](function(_0x276289){if(_0x276289){return db['UserProfileSection'][_0x7c0d('0x29')]({'where':{'userProfileId':_0x3bae51['params']['id'],'id':_[_0x7c0d('0x2e')](_0x276289,function(_0x20e260){return _0x20e260['id'];})},'transaction':_0x52338e});}})['then'](function(_0x214187){var _0x2c52a1=_[_0x7c0d('0x2e')](_0x3bae51[_0x7c0d('0x4a')],function(_0x24a177){_0x24a177[_0x7c0d('0x56')]=_0x3bae51[_0x7c0d('0x43')]['id'];return _0x24a177;});return db[_0x7c0d('0x52')][_0x7c0d('0x68')](_0x2c52a1,{'raw':!![],'transaction':_0x52338e});})[_0x7c0d('0x28')](function(_0x42c7fb){var _0x4cf692=_[_0x7c0d('0x3f')](_[_0x7c0d('0x2e')](_0x42c7fb,function(_0x35022d){return _0x35022d[_0x7c0d('0x4d')]({'plain':!![]});}),{'includeAll':![]});if(_0x4cf692){return db[_0x7c0d('0x52')]['findAll']({'where':{'userProfileId':_0x3bae51[_0x7c0d('0x43')]['id'],'sectionId':_[_0x7c0d('0x2e')](_0x4cf692,function(_0x210c21){return _0x210c21[_0x7c0d('0x59')];})},'attributes':['id',_0x7c0d('0x59')],'raw':!![]})[_0x7c0d('0x28')](function(_0x2a4a6c){var _0x38f53d=_[_0x7c0d('0x2e')](_0x3bae51[_0x7c0d('0x4a')],function(_0x1a6167){_0x1a6167[_0x7c0d('0x56')]=_0x3bae51[_0x7c0d('0x43')]['id'];return _0x1a6167;});return db[_0x7c0d('0x54')][_0x7c0d('0x68')](_0x38f53d,{'raw':!![],'transaction':_0x52338e});});}})['catch'](handleError(_0x5d605e,null));});}})['then'](function(_0x23bf53){var _0x353e41=_[_0x7c0d('0x2e')](_0x23bf53,function(_0x445bac){return _0x445bac[_0x7c0d('0x4d')]({'plain':!![]});});})[_0x7c0d('0x28')](respondWithResult(_0x5d605e,null))[_0x7c0d('0x41')](handleError(_0x5d605e,null));};exports['removeResources']=function(_0x58f65d,_0x201a96,_0x5d0df6){return db[_0x7c0d('0x40')][_0x7c0d('0x48')]({'where':{'id':_0x58f65d[_0x7c0d('0x43')]['id']}})[_0x7c0d('0x28')](handleEntityNotFound(_0x201a96,null))['then'](function(_0x341820){if(_0x341820){return _0x341820['removeResources'](_0x58f65d[_0x7c0d('0x34')]['ids']);}})[_0x7c0d('0x28')](respondWithStatusCode(_0x201a96,null))['catch'](handleError(_0x201a96,null));};exports[_0x7c0d('0x69')]=function(_0x13834b,_0x4f8353){var _0x3a693a={};if(!_0x13834b[_0x7c0d('0x34')]['section'])throw new Error(_0x7c0d('0x6a'));if(!_0x13834b['query'][_0x7c0d('0x39')](_0x7c0d('0x3a'))){_0x3a693a[_0x7c0d('0x22')]=qs[_0x7c0d('0x22')](_0x13834b[_0x7c0d('0x34')][_0x7c0d('0x22')]);_0x3a693a[_0x7c0d('0x20')]=qs[_0x7c0d('0x20')](_0x13834b['query'][_0x7c0d('0x20')]);}return db[_0x7c0d('0x40')][_0x7c0d('0x48')]({'where':{'id':_0x13834b['params']['id']}})[_0x7c0d('0x28')](function(_0x4b73ad){if(!_0x4b73ad)throw new Error(_0x7c0d('0x6b')+_0x13834b['params']['id']);return db[_0x7c0d('0x40')][_0x7c0d('0x69')](_0x13834b);})[_0x7c0d('0x28')](respondWithFilteredResult(_0x4f8353,_0x3a693a))[_0x7c0d('0x41')](handleError(_0x4f8353,null));}; \ No newline at end of file +var _0xb6fa=['getResources','section','eml-format','fast-json-patch','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./userProfile.socket','register','status','json','offset','undefined','limit','count','set','apply','reject','save','update','destroy','end','sendStatus','stack','map','UserProfile','rawAttributes','fieldName','type','key','name','query','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filters','merge','where','VIRTUAL','filter','options','then','includeAll','include','rows','catch','params','length','find','create','body','clone','get','omit','updatedAt','crudPermissions','createdAt','sequelize','transaction','UserProfileSection','autoAssociation','UserProfileResource','findAll','sectionId','userProfileId','Resources','describe','addSections','each','push','removeSections','ids','getSections','includes','isEmpty','subsections','enabled','Dashboard','forEach','resourceId','Plugin','addResources','bulkCreate','removeResources'];(function(_0x2f9758,_0x219e8a){var _0x66fb08=function(_0x136964){while(--_0x136964){_0x2f9758['push'](_0x2f9758['shift']());}};_0x66fb08(++_0x219e8a);}(_0xb6fa,0x1c2));var _0xab6f=function(_0x1aed80,_0x3ca6f6){_0x1aed80=_0x1aed80-0x0;var _0x43961e=_0xb6fa[_0x1aed80];return _0x43961e;};'use strict';var emlformat=require(_0xab6f('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xab6f('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xab6f('0x2'));var Mustache=require(_0xab6f('0x3'));var util=require('util');var path=require(_0xab6f('0x4'));var sox=require(_0xab6f('0x5'));var csv=require(_0xab6f('0x6'));var ejs=require(_0xab6f('0x7'));var fs=require('fs');var fs_extra=require(_0xab6f('0x8'));var _=require(_0xab6f('0x9'));var squel=require(_0xab6f('0xa'));var crypto=require(_0xab6f('0xb'));var jsforce=require(_0xab6f('0xc'));var deskjs=require(_0xab6f('0xd'));var toCsv=require(_0xab6f('0x6'));var querystring=require(_0xab6f('0xe'));var Papa=require(_0xab6f('0xf'));var Redis=require(_0xab6f('0x10'));var authService=require(_0xab6f('0x11'));var qs=require(_0xab6f('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xab6f('0x13'))(_0xab6f('0x14'));var utils=require('../../config/utils');var config=require(_0xab6f('0x15'));var licenseUtil=require(_0xab6f('0x16'));var db=require(_0xab6f('0x17'))['db'];config[_0xab6f('0x18')]=_[_0xab6f('0x19')](config[_0xab6f('0x18')],{'host':_0xab6f('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xab6f('0x18')]));require(_0xab6f('0x1b'))[_0xab6f('0x1c')](socket);function respondWithStatusCode(_0x4df7a8,_0x3fa542){_0x3fa542=_0x3fa542||0xcc;return function(_0x53d5e2){if(_0x53d5e2){return _0x4df7a8['sendStatus'](_0x3fa542);}return _0x4df7a8[_0xab6f('0x1d')](_0x3fa542)['end']();};}function respondWithResult(_0x422850,_0x3653f0){_0x3653f0=_0x3653f0||0xc8;return function(_0x14447f){if(_0x14447f){return _0x422850['status'](_0x3653f0)[_0xab6f('0x1e')](_0x14447f);}};}function respondWithFilteredResult(_0x4ede75,_0x24cd26){return function(_0x439b73){if(_0x439b73){var _0x3e616c=typeof _0x24cd26[_0xab6f('0x1f')]===_0xab6f('0x20')&&typeof _0x24cd26[_0xab6f('0x21')]===_0xab6f('0x20');var _0x48601f=_0x439b73[_0xab6f('0x22')];var _0x247e68=_0x3e616c?0x0:_0x24cd26[_0xab6f('0x1f')];var _0x485200=_0x3e616c?_0x439b73[_0xab6f('0x22')]:_0x24cd26[_0xab6f('0x1f')]+_0x24cd26[_0xab6f('0x21')];var _0x2c63dc;if(_0x485200>=_0x48601f){_0x485200=_0x48601f;_0x2c63dc=0xc8;}else{_0x2c63dc=0xce;}_0x4ede75[_0xab6f('0x1d')](_0x2c63dc);return _0x4ede75[_0xab6f('0x23')]('Content-Range',_0x247e68+'-'+_0x485200+'/'+_0x48601f)['json'](_0x439b73);}return null;};}function patchUpdates(_0x21194b){return function(_0xc1704e){try{jsonpatch[_0xab6f('0x24')](_0xc1704e,_0x21194b,!![]);}catch(_0x83e273){return BPromise[_0xab6f('0x25')](_0x83e273);}return _0xc1704e[_0xab6f('0x26')]();};}function saveUpdates(_0xb1ef77,_0x5634c5){return function(_0x1294d3){if(_0x1294d3){return _0x1294d3[_0xab6f('0x27')](_0xb1ef77)['then'](function(_0x1f8db7){return _0x1f8db7;});}return null;};}function removeEntity(_0x4290f,_0x159f29){return function(_0x2e10a7){if(_0x2e10a7){return _0x2e10a7[_0xab6f('0x28')]()['then'](function(){_0x4290f[_0xab6f('0x1d')](0xcc)[_0xab6f('0x29')]();});}};}function handleEntityNotFound(_0x4bcedd,_0x149fad){return function(_0x30e0fa){if(!_0x30e0fa){_0x4bcedd[_0xab6f('0x2a')](0x194);}return _0x30e0fa;};}function handleError(_0x2f8ebc,_0x475703){_0x475703=_0x475703||0x1f4;return function(_0x181bab){logger['error'](_0x181bab[_0xab6f('0x2b')]);if(_0x181bab['name']){delete _0x181bab['name'];}_0x2f8ebc['status'](_0x475703)['send'](_0x181bab);};}exports['index']=function(_0x14af68,_0xd58fdf){var _0x4110dd={},_0x3206b8={},_0x39b6b5={'count':0x0,'rows':[]};var _0x4b5a4d=_[_0xab6f('0x2c')](db[_0xab6f('0x2d')][_0xab6f('0x2e')],function(_0x26c62b){return{'name':_0x26c62b[_0xab6f('0x2f')],'type':_0x26c62b[_0xab6f('0x30')][_0xab6f('0x31')]};});_0x3206b8['model']=_[_0xab6f('0x2c')](_0x4b5a4d,_0xab6f('0x32'));_0x3206b8[_0xab6f('0x33')]=_['keys'](_0x14af68[_0xab6f('0x33')]);_0x3206b8['filters']=_[_0xab6f('0x34')](_0x3206b8[_0xab6f('0x35')],_0x3206b8[_0xab6f('0x33')]);_0x4110dd[_0xab6f('0x36')]=_[_0xab6f('0x34')](_0x3206b8[_0xab6f('0x35')],qs[_0xab6f('0x37')](_0x14af68[_0xab6f('0x33')][_0xab6f('0x37')]));_0x4110dd['attributes']=_0x4110dd[_0xab6f('0x36')]['length']?_0x4110dd['attributes']:_0x3206b8[_0xab6f('0x35')];if(!_0x14af68[_0xab6f('0x33')][_0xab6f('0x38')](_0xab6f('0x39'))){_0x4110dd[_0xab6f('0x21')]=qs[_0xab6f('0x21')](_0x14af68['query']['limit']);_0x4110dd['offset']=qs[_0xab6f('0x1f')](_0x14af68[_0xab6f('0x33')][_0xab6f('0x1f')]);}_0x4110dd[_0xab6f('0x3a')]=qs['sort'](_0x14af68[_0xab6f('0x33')][_0xab6f('0x3b')]);_0x4110dd['where']=qs['filters'](_[_0xab6f('0x3c')](_0x14af68[_0xab6f('0x33')],_0x3206b8[_0xab6f('0x3d')]),_0x4b5a4d);if(_0x14af68[_0xab6f('0x33')]['filter']){_0x4110dd['where']=_[_0xab6f('0x3e')](_0x4110dd[_0xab6f('0x3f')],{'$or':_[_0xab6f('0x2c')](_0x4b5a4d,function(_0x159c99){if(_0x159c99[_0xab6f('0x30')]!==_0xab6f('0x40')){var _0x4e835f={};_0x4e835f[_0x159c99[_0xab6f('0x32')]]={'$like':'%'+_0x14af68[_0xab6f('0x33')][_0xab6f('0x41')]+'%'};return _0x4e835f;}})});}_0x4110dd=_[_0xab6f('0x3e')]({},_0x4110dd,_0x14af68[_0xab6f('0x42')]);var _0x53377b={'where':_0x4110dd[_0xab6f('0x3f')]};return db[_0xab6f('0x2d')][_0xab6f('0x22')](_0x53377b)[_0xab6f('0x43')](function(_0x3df7f1){_0x39b6b5[_0xab6f('0x22')]=_0x3df7f1;if(_0x14af68[_0xab6f('0x33')][_0xab6f('0x44')]){_0x4110dd[_0xab6f('0x45')]=[{'all':!![]}];}return db[_0xab6f('0x2d')]['findAll'](_0x4110dd);})[_0xab6f('0x43')](function(_0x44ca1b){_0x39b6b5[_0xab6f('0x46')]=_0x44ca1b;return _0x39b6b5;})[_0xab6f('0x43')](respondWithFilteredResult(_0xd58fdf,_0x4110dd))[_0xab6f('0x47')](handleError(_0xd58fdf,null));};exports['show']=function(_0x4da669,_0x3ed9b2){var _0x2afa4a={'raw':![],'where':{'id':_0x4da669[_0xab6f('0x48')]['id']}},_0x2a9183={};_0x2a9183[_0xab6f('0x35')]=_['keys'](db[_0xab6f('0x2d')][_0xab6f('0x2e')]);_0x2a9183['query']=_['keys'](_0x4da669[_0xab6f('0x33')]);_0x2a9183[_0xab6f('0x3d')]=_['intersection'](_0x2a9183[_0xab6f('0x35')],_0x2a9183[_0xab6f('0x33')]);_0x2afa4a[_0xab6f('0x36')]=_[_0xab6f('0x34')](_0x2a9183[_0xab6f('0x35')],qs[_0xab6f('0x37')](_0x4da669['query'][_0xab6f('0x37')]));_0x2afa4a[_0xab6f('0x36')]=_0x2afa4a[_0xab6f('0x36')][_0xab6f('0x49')]?_0x2afa4a[_0xab6f('0x36')]:_0x2a9183[_0xab6f('0x35')];if(_0x4da669[_0xab6f('0x33')][_0xab6f('0x44')]){_0x2afa4a[_0xab6f('0x45')]=[{'all':!![]}];}_0x2afa4a=_[_0xab6f('0x3e')]({},_0x2afa4a,_0x4da669[_0xab6f('0x42')]);return db[_0xab6f('0x2d')][_0xab6f('0x4a')](_0x2afa4a)['then'](handleEntityNotFound(_0x3ed9b2,null))[_0xab6f('0x43')](respondWithResult(_0x3ed9b2,null))[_0xab6f('0x47')](handleError(_0x3ed9b2,null));};exports['create']=function(_0x30cbc0,_0x1a4a0e){return db[_0xab6f('0x2d')][_0xab6f('0x4b')](_0x30cbc0[_0xab6f('0x4c')],{})[_0xab6f('0x43')](respondWithResult(_0x1a4a0e,0xc9))[_0xab6f('0x47')](handleError(_0x1a4a0e,null));};exports[_0xab6f('0x4d')]=function(_0xd38461,_0x439437){var _0x1578ed={'where':{'id':_0xd38461[_0xab6f('0x48')]['id']}},_0x3c6751={};_0x3c6751[_0xab6f('0x35')]=_['keys'](db[_0xab6f('0x2d')]['rawAttributes']);_0x1578ed['attributes']=_[_0xab6f('0x34')](_0x3c6751[_0xab6f('0x35')],qs['fields'](_0xd38461[_0xab6f('0x33')][_0xab6f('0x37')]));_0x1578ed[_0xab6f('0x36')]=_0x1578ed[_0xab6f('0x36')]['length']?_0x1578ed[_0xab6f('0x36')]:_0x3c6751[_0xab6f('0x35')];if(_0xd38461['query'][_0xab6f('0x44')]){_0x1578ed[_0xab6f('0x45')]=[{'all':!![]}];}_0x1578ed=_[_0xab6f('0x3e')]({},_0x1578ed,_0xd38461['options']);return db[_0xab6f('0x2d')][_0xab6f('0x4a')](_0x1578ed)[_0xab6f('0x43')](handleEntityNotFound(_0x439437,null))[_0xab6f('0x43')](function(_0x4ad321){if(_0x4ad321){var _0xe55593=_0x4ad321[_0xab6f('0x4e')]({'plain':!![]});_0xe55593=qs[_0xab6f('0x4f')](_0xe55593,['id','createdAt',_0xab6f('0x50'),_0xab6f('0x51')]);_0xd38461['body']=_[_0xab6f('0x4f')](_0xd38461['body'],['id',_0xab6f('0x52'),_0xab6f('0x50')]);return db[_0xab6f('0x53')][_0xab6f('0x54')](function(_0x12c3ed){return db[_0xab6f('0x2d')][_0xab6f('0x4b')](_[_0xab6f('0x3e')](_0xe55593,_0xd38461[_0xab6f('0x4c')]),{'include':_0xd38461['query'][_0xab6f('0x44')]?[{'all':!![]}]:undefined,'transaction':_0x12c3ed})[_0xab6f('0x43')](function(_0x21bb03){var _0x45fa50=_0x21bb03[_0xab6f('0x4e')]({'plain':!![]});return db[_0xab6f('0x55')]['findAll']({'where':{'userProfileId':_0xd38461[_0xab6f('0x48')]['id']},'raw':!![]})[_0xab6f('0x43')](function(_0xfcde29){if(_0xfcde29){return BPromise['each'](_0xfcde29,function(_0x3bd96e){return new BPromise(function(_0x137c2f,_0x3aafae){if(_0x3bd96e[_0xab6f('0x56')]===null||_0x3bd96e[_0xab6f('0x56')]===0x1)_0x137c2f(null);return db[_0xab6f('0x57')][_0xab6f('0x58')]({'where':{'sectionId':_0x3bd96e['id']},'raw':!![]})[_0xab6f('0x43')](function(_0x2c8ccd){var _0x445ef8=_['map'](_0x2c8ccd,function(_0x17c031){return qs[_0xab6f('0x4f')](_0x17c031,['id',_0xab6f('0x52'),_0xab6f('0x50'),_0xab6f('0x59')]);});_0x137c2f(_0x445ef8);})[_0xab6f('0x47')](function(_0x6156c9){_0x3aafae(_0x6156c9);});})[_0xab6f('0x43')](function(_0x4a54e7){var _0x5160aa=qs['omit'](_0x3bd96e,['id',_0xab6f('0x52'),_0xab6f('0x50')]);_0x5160aa[_0xab6f('0x5a')]=_0x45fa50['id'];if(_0x4a54e7)_0x5160aa[_0xab6f('0x5b')]=_0x4a54e7;return _0x5160aa;})[_0xab6f('0x43')](function(_0x8ffbf6){return db['UserProfileSection'][_0xab6f('0x4b')](_0x8ffbf6,{'include':[{'model':db[_0xab6f('0x57')],'as':'Resources'}],'raw':!![],'transaction':_0x12c3ed});});})[_0xab6f('0x43')](function(){return _0x45fa50;});}});});});}})[_0xab6f('0x43')](respondWithResult(_0x439437,0xc9))[_0xab6f('0x47')](handleError(_0x439437,null));};exports[_0xab6f('0x27')]=function(_0x1c8bb0,_0x4df8e7){if(_0x1c8bb0[_0xab6f('0x4c')]['id']){delete _0x1c8bb0['body']['id'];}return db[_0xab6f('0x2d')][_0xab6f('0x4a')]({'where':{'id':_0x1c8bb0['params']['id']}})[_0xab6f('0x43')](handleEntityNotFound(_0x4df8e7,null))['then'](saveUpdates(_0x1c8bb0[_0xab6f('0x4c')],null))[_0xab6f('0x43')](respondWithResult(_0x4df8e7,null))[_0xab6f('0x47')](handleError(_0x4df8e7,null));};exports[_0xab6f('0x28')]=function(_0x1042cb,_0x13f8f4){return db[_0xab6f('0x2d')]['find']({'where':{'id':_0x1042cb['params']['id']}})[_0xab6f('0x43')](handleEntityNotFound(_0x13f8f4,null))['then'](removeEntity(_0x13f8f4,null))[_0xab6f('0x47')](handleError(_0x13f8f4,null));};exports[_0xab6f('0x5c')]=function(_0x41d9de,_0x56c3c5){return db[_0xab6f('0x2d')][_0xab6f('0x5c')]()[_0xab6f('0x43')](respondWithResult(_0x56c3c5,null))[_0xab6f('0x47')](handleError(_0x56c3c5,null));};exports[_0xab6f('0x5d')]=function(_0x12e06e,_0x250843){var _0x7b221a=_0x12e06e[_0xab6f('0x4c')];return db['UserProfile']['find']({'where':{'id':_0x12e06e['params']['id']}})[_0xab6f('0x43')](handleEntityNotFound(_0x250843,null))[_0xab6f('0x43')](function(_0x167a31){if(_0x167a31){return db[_0xab6f('0x53')][_0xab6f('0x54')](function(_0x1e0d3e){return db['UserProfileSection'][_0xab6f('0x28')]({'where':{'userProfileId':_0x12e06e[_0xab6f('0x48')]['id'],'sectionId':_[_0xab6f('0x2c')](_0x7b221a,function(_0x4ba68b){return _0x4ba68b[_0xab6f('0x59')];})},'transaction':_0x1e0d3e})[_0xab6f('0x43')](function(){var _0x6740cf=_['map'](_0x7b221a,function(_0x19e41d){_0x19e41d[_0xab6f('0x5a')]=_0x12e06e[_0xab6f('0x48')]['id'];return _0x19e41d;});var _0xba4168=[];return BPromise[_0xab6f('0x5e')](_0x6740cf,function(_0x3e32c3){return db['UserProfileSection'][_0xab6f('0x4b')](_0x3e32c3,{'include':[{'model':db['UserProfileResource'],'as':_0xab6f('0x5b')}],'raw':!![],'transaction':_0x1e0d3e})[_0xab6f('0x43')](function(_0x5e8fd1){_0xba4168[_0xab6f('0x5f')](_0x5e8fd1[_0xab6f('0x4e')]({'plain':!![]}));});})[_0xab6f('0x43')](function(){return _0xba4168;});});});}})[_0xab6f('0x43')](function(_0x4c893e){return _0x4c893e;})[_0xab6f('0x43')](respondWithResult(_0x250843,null))['catch'](handleError(_0x250843,null));};exports[_0xab6f('0x60')]=function(_0x4645b3,_0x77df73){var _0x27a4bf;return db[_0xab6f('0x2d')]['find']({'where':{'id':_0x4645b3['params']['id']},'attributes':['id',_0xab6f('0x32')]})[_0xab6f('0x43')](handleEntityNotFound(_0x77df73,null))[_0xab6f('0x43')](function(_0x256734){if(_0x256734){_0x27a4bf=_0x256734;return db[_0xab6f('0x55')][_0xab6f('0x28')]({'where':{'userProfileId':_0x4645b3['params']['id'],'sectionId':_0x4645b3[_0xab6f('0x33')][_0xab6f('0x61')]}});}})[_0xab6f('0x43')](function(){return _0x27a4bf;})[_0xab6f('0x43')](respondWithStatusCode(_0x77df73,null))[_0xab6f('0x47')](handleError(_0x77df73,null));};exports[_0xab6f('0x62')]=function(_0x57794f,_0x4930dd){var _0x4a39dc=[];var _0x2748a5=[];return db[_0xab6f('0x55')][_0xab6f('0x58')]({'where':{'userProfileId':_0x57794f[_0xab6f('0x48')]['id']},'raw':!![]})[_0xab6f('0x43')](function(_0x34c741){_0x4a39dc=_[_0xab6f('0x41')](_0x34c741,function(_0x724990){return _0x724990['enabled']===0x1||_[_0xab6f('0x63')]([0x3eb,0x709],_0x724990[_0xab6f('0x59')]);});if(!_[_0xab6f('0x64')](_0x4a39dc)){return _[_0xab6f('0x2c')](_0x4a39dc,function(_0x3576c0){return _0x3576c0[_0xab6f('0x59')];});}else{return;}})[_0xab6f('0x43')](function(_0x15a7bb){if(_0x15a7bb)_0x2748a5=_0x15a7bb;if(_[_0xab6f('0x63')](_0x2748a5,0x64)){var _0x1b9b0d=_[_0xab6f('0x4a')](_0x4a39dc,{'sectionId':0x64});return hasDefaultDashboard(_0x1b9b0d)[_0xab6f('0x43')](function(_0x2c5d4){return _['map'](_0x4a39dc,function(_0x1fb8c6){if(_0x1fb8c6[_0xab6f('0x59')]===0x64){_0x1fb8c6[_0xab6f('0x65')]=_0x2c5d4;}return _0x1fb8c6;});});}else{return;}})[_0xab6f('0x43')](function(_0x2328d8){if(_0x2328d8)_0x4a39dc=_0x2328d8;if(_[_0xab6f('0x63')](_0x2748a5,0x3eb)){var _0x39a335=_[_0xab6f('0x4a')](_0x4a39dc,{'sectionId':0x3eb});return getCustomDashboards(_0x39a335)['then'](function(_0x3787e6){return _[_0xab6f('0x2c')](_0x4a39dc,function(_0xeb2f2){if(_0x39a335[_0xab6f('0x66')]){if(_0xeb2f2[_0xab6f('0x59')]===0x3eb){_0xeb2f2[_0xab6f('0x65')]=_0x3787e6;}}else{if(_0xeb2f2[_0xab6f('0x59')]===0x64){_0xeb2f2['subsections']=_0x3787e6;}}return _0xeb2f2;});});}else{return;}})['then'](function(_0x1f5f45){if(_0x1f5f45)_0x4a39dc=_0x1f5f45;if(_[_0xab6f('0x63')](_0x2748a5,0x709)){var _0x222a8c=_[_0xab6f('0x4a')](_0x4a39dc,{'sectionId':0x709});return getPlugins(_0x222a8c)[_0xab6f('0x43')](function(_0x25132d){if(_0x222a8c[_0xab6f('0x66')]){return _[_0xab6f('0x2c')](_0x4a39dc,function(_0x28a168){if(_0x28a168[_0xab6f('0x59')]===0x709){_0x28a168['subsections']=_0x25132d;}return _0x28a168;});}else{var _0x6ef6cd={'sectionId':0x76c,'enabled':0x1,'subsections':_0x25132d};var _0x4307d8=_[_0xab6f('0x2c')](_0x4a39dc);_0x4307d8[_0xab6f('0x5f')](_0x6ef6cd);return _0x4307d8;}});}else{return;}})[_0xab6f('0x43')](function(_0x17f705){if(_0x17f705)_0x4a39dc=_0x17f705;return _[_0xab6f('0x41')](_0x4a39dc,[_0xab6f('0x66'),0x1]);})['then'](respondWithResult(_0x4930dd,null))[_0xab6f('0x47')](handleError(_0x4930dd,null));};function hasDefaultDashboard(_0x1b4d2a){var _0x1afcf9=[0x65];return new BPromise(function(_0x1fcc8d,_0x27b641){try{if(_0x1b4d2a[_0xab6f('0x56')]){_0x1fcc8d(_0x1afcf9);}else{return db[_0xab6f('0x57')]['findOne']({'where':{'sectionId':_0x1b4d2a['id']},'raw':!![]})[_0xab6f('0x43')](function(_0x3cbe7d){_0x3cbe7d?_0x1fcc8d(_0x1afcf9):_0x1fcc8d();});}}catch(_0x2c8397){_0x27b641(_0x2c8397);}});}function getCustomDashboards(_0x4f5e0f){var _0x19fe71=[];return new BPromise(function(_0x42ab86,_0xf0c9b0){try{if(_0x4f5e0f[_0xab6f('0x56')]){return db[_0xab6f('0x67')]['findAll']({'raw':!![]})['then'](function(_0x583cbb){_0x583cbb[_0xab6f('0x68')](function(_0x228b7c){_0x19fe71[_0xab6f('0x5f')](_0x228b7c['id']+0x1869f);});_0x42ab86(_0x19fe71);});}else{return db[_0xab6f('0x57')][_0xab6f('0x58')]({'where':{'sectionId':_0x4f5e0f['id']},'raw':!![]})['then'](function(_0x380f5b){_0x380f5b[_0xab6f('0x68')](function(_0x4c9ffa){_0x19fe71['push'](_0x4c9ffa[_0xab6f('0x69')]+0x1869f);});_0x42ab86(_0x19fe71);});}}catch(_0x28f135){_0xf0c9b0(_0x28f135);}});}function getPlugins(_0x4ce345){var _0xf309aa=[];return new BPromise(function(_0x1091eb,_0x3cd0c6){try{if(_0x4ce345[_0xab6f('0x56')]){return db[_0xab6f('0x6a')][_0xab6f('0x58')]({'raw':!![]})[_0xab6f('0x43')](function(_0x10d512){_0x10d512['forEach'](function(_0x1a1ecd){_0xf309aa[_0xab6f('0x5f')](_0x1a1ecd['id']+0x15b38);});_0x1091eb(_0xf309aa);});}else{return db[_0xab6f('0x57')][_0xab6f('0x58')]({'where':{'sectionId':_0x4ce345['id']},'raw':!![]})[_0xab6f('0x43')](function(_0x2389ca){_0x2389ca['forEach'](function(_0x20472a){_0xf309aa[_0xab6f('0x5f')](_0x20472a[_0xab6f('0x69')]+0x15b38);});_0x1091eb(_0xf309aa);});}}catch(_0x1996c0){_0x3cd0c6(_0x1996c0);}});}exports[_0xab6f('0x6b')]=function(_0x56ca5a,_0x5a2165){return db[_0xab6f('0x2d')][_0xab6f('0x4a')]({'where':{'id':_0x56ca5a[_0xab6f('0x48')]['id']}})[_0xab6f('0x43')](handleEntityNotFound(_0x5a2165,null))[_0xab6f('0x43')](function(_0x4142a0){if(_0x4142a0){return db[_0xab6f('0x53')]['transaction'](function(_0x55a09a){return db[_0xab6f('0x55')][_0xab6f('0x58')]({'where':{'userProfileId':_0x56ca5a['params']['id']},'attributes':['id'],'raw':!![]})[_0xab6f('0x43')](function(_0x372db6){if(_0x372db6){return db[_0xab6f('0x55')][_0xab6f('0x28')]({'where':{'userProfileId':_0x56ca5a[_0xab6f('0x48')]['id'],'id':_[_0xab6f('0x2c')](_0x372db6,function(_0x236f8b){return _0x236f8b['id'];})},'transaction':_0x55a09a});}})[_0xab6f('0x43')](function(_0x1c3584){var _0x20e25d=_[_0xab6f('0x2c')](_0x56ca5a[_0xab6f('0x4c')],function(_0x355047){_0x355047['userProfileId']=_0x56ca5a[_0xab6f('0x48')]['id'];return _0x355047;});return db[_0xab6f('0x55')][_0xab6f('0x6c')](_0x20e25d,{'raw':!![],'transaction':_0x55a09a});})[_0xab6f('0x43')](function(_0x4db06a){var _0x1b3bd6=_['filter'](_['map'](_0x4db06a,function(_0x3ccb0f){return _0x3ccb0f[_0xab6f('0x4e')]({'plain':!![]});}),{'includeAll':![]});if(_0x1b3bd6){return db['UserProfileSection'][_0xab6f('0x58')]({'where':{'userProfileId':_0x56ca5a[_0xab6f('0x48')]['id'],'sectionId':_[_0xab6f('0x2c')](_0x1b3bd6,function(_0x47abff){return _0x47abff['sectionId'];})},'attributes':['id','sectionId'],'raw':!![]})[_0xab6f('0x43')](function(_0x467721){var _0x48626e=_[_0xab6f('0x2c')](_0x56ca5a[_0xab6f('0x4c')],function(_0x522c2f){_0x522c2f[_0xab6f('0x5a')]=_0x56ca5a[_0xab6f('0x48')]['id'];return _0x522c2f;});return db[_0xab6f('0x57')][_0xab6f('0x6c')](_0x48626e,{'raw':!![],'transaction':_0x55a09a});});}})[_0xab6f('0x47')](handleError(_0x5a2165,null));});}})[_0xab6f('0x43')](function(_0xd0f428){var _0x14edcb=_[_0xab6f('0x2c')](_0xd0f428,function(_0x21f4dc){return _0x21f4dc[_0xab6f('0x4e')]({'plain':!![]});});})[_0xab6f('0x43')](respondWithResult(_0x5a2165,null))[_0xab6f('0x47')](handleError(_0x5a2165,null));};exports[_0xab6f('0x6d')]=function(_0x5ed359,_0x2606cf,_0x1399af){return db[_0xab6f('0x2d')][_0xab6f('0x4a')]({'where':{'id':_0x5ed359['params']['id']}})[_0xab6f('0x43')](handleEntityNotFound(_0x2606cf,null))[_0xab6f('0x43')](function(_0x2de817){if(_0x2de817){return _0x2de817[_0xab6f('0x6d')](_0x5ed359[_0xab6f('0x33')][_0xab6f('0x61')]);}})[_0xab6f('0x43')](respondWithStatusCode(_0x2606cf,null))[_0xab6f('0x47')](handleError(_0x2606cf,null));};exports[_0xab6f('0x6e')]=function(_0x2c1bb6,_0x36aed9){var _0x223950={};if(!_0x2c1bb6[_0xab6f('0x33')][_0xab6f('0x6f')])throw new Error('Missing\x20section\x20parameter');if(!_0x2c1bb6['query'][_0xab6f('0x38')]('nolimit')){_0x223950['limit']=qs[_0xab6f('0x21')](_0x2c1bb6['query'][_0xab6f('0x21')]);_0x223950['offset']=qs[_0xab6f('0x1f')](_0x2c1bb6[_0xab6f('0x33')][_0xab6f('0x1f')]);}return db['UserProfile'][_0xab6f('0x4a')]({'where':{'id':_0x2c1bb6[_0xab6f('0x48')]['id']}})[_0xab6f('0x43')](function(_0x350358){if(!_0x350358)throw new Error('No\x20User\x20Profile\x20found\x20for\x20id\x20'+_0x2c1bb6[_0xab6f('0x48')]['id']);return db[_0xab6f('0x2d')]['getResources'](_0x2c1bb6);})['then'](respondWithFilteredResult(_0x36aed9,_0x223950))[_0xab6f('0x47')](handleError(_0x36aed9,null));}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.events.js b/server/api/userProfile/userProfile.events.js index 758ee6d..ca4d010 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 _0x4317=['remove','hasOwnProperty','hook','exports','../../mysqldb','UserProfile','setMaxListeners','update'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x4317,0x7c));var _0x7431=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x4317[_0x19e35c];return _0x3e1fe8;};'use strict';var EventEmitter=require('events');var UserProfile=require(_0x7431('0x0'))['db'][_0x7431('0x1')];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0x7431('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x7431('0x3'),'afterDestroy':_0x7431('0x4')};function emitEvent(_0x290b11){return function(_0xa4197b,_0x12c492,_0x201287){UserProfileEvents['emit'](_0x290b11+':'+_0xa4197b['id'],_0xa4197b);UserProfileEvents['emit'](_0x290b11,_0xa4197b);_0x201287(null);};}for(var e in events){if(events[_0x7431('0x5')](e)){var event=events[e];UserProfile[_0x7431('0x6')](e,emitEvent(event));}}module[_0x7431('0x7')]=UserProfileEvents; \ No newline at end of file +var _0x202a=['update','hasOwnProperty','../../mysqldb','UserProfile','setMaxListeners'];(function(_0x4e676e,_0x2a7c6d){var _0x336a3c=function(_0x4767c4){while(--_0x4767c4){_0x4e676e['push'](_0x4e676e['shift']());}};_0x336a3c(++_0x2a7c6d);}(_0x202a,0xc0));var _0xa202=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x202a[_0x321bb2];return _0x9c12ed;};'use strict';var EventEmitter=require('events');var UserProfile=require(_0xa202('0x0'))['db'][_0xa202('0x1')];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0xa202('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xa202('0x3'),'afterDestroy':'remove'};function emitEvent(_0x4878f5){return function(_0x595945,_0x32f8b7,_0x1ce932){UserProfileEvents['emit'](_0x4878f5+':'+_0x595945['id'],_0x595945);UserProfileEvents['emit'](_0x4878f5,_0x595945);_0x1ce932(null);};}for(var e in events){if(events[_0xa202('0x4')](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 7f66458..6d4747f 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 _0xf2e3=['projects','JscriptyProject','contacts','Lists','ListId','lists','CmList','companies','globalcustomfields','CmCustomField','ChatQueue','chatwebsites','ChatWebsite','faxqueues','FaxQueue','faxaccounts','FaxAccount','inboundroutes','internalroutes','outboundroutes','VoiceExtension','contexts','VoiceContext','VoiceMail','voicerecordings','VoiceRecording','Agents','membername','User','role','Telephones','telephone','VoiceQueues','queue','VoiceQueue','inbound','QueueCampaigns','outbound','VoiceMusicOnHold','VoiceChanSpy','VoicePrefix','ivrcampaigns','mailqueues','MailAccount','mailsubstatuses','MailSubstatus','openchannelqueues','OpenchannelQueue','openchannelaccounts','OpenchannelAccount','smsqueues','SmsQueue','SmsAccount','whatsappqueues','whatsappaccounts','WhatsappAccount','Team','voicequeues','users','agents','admin','user','zendeskaccounts','salesforceaccounts','SalesforceAccount','freshdeskaccounts','FreshdeskAccount','sugarcrmaccounts','SugarcrmAccount','DeskAccount','ZohoAccount','vtigeraccounts','cannedanswers','CannedAnswer','dispositions','Disposition','Dashboard','intervals','Interval','pauses','Pause','scheduler','Schedule','sounds','Sound','Tag','templates','Template','triggers','Trigger','Trunk','variables','Variable','Plugin','extractedreports','reportId','metrics','AnalyticMetric','toUpperCase','slice','Sequelize','SELECT','ui.','ui.createdAt','from','user_has_','where','ui.UserId\x20=\x20?','sequelize','query','user_profiles','section','Invalid\x20section\x20\x27','isEmpty','length','find','params','all','ignore','union','push','autoAssociation','rawAttributes','keys','intersection','attributes','fields','hasOwnProperty','limit','offset','order','sort','filters','pick','merge','foreignKey','forEach','options','includeAll','include','reportType','DefaultReports','custom','count','rows','CmContact','color','tag','ThroughTags','openTabs','chat','dataValues','sms','fax','whatsapp','lodash','../../components/parsers/qs','squel','exports','models','filter','field','value','findAll','then','associatedResources','map','catch','model','resolve','UserProfileResource','AnalyticExtractedReport','resourceId','type','SquareProject','odbc','SquareOdbc','childModel','parentSections','SquareProjects','name','projectName'];(function(_0x3a78a0,_0x44985f){var _0x48e917=function(_0x1e428c){while(--_0x1e428c){_0x3a78a0['push'](_0x3a78a0['shift']());}};_0x48e917(++_0x44985f);}(_0xf2e3,0x9b));var _0x3f2e=function(_0x3070dc,_0x40cf11){_0x3070dc=_0x3070dc-0x0;var _0x431489=_0xf2e3[_0x3070dc];return _0x431489;};'use strict';var _=require(_0x3f2e('0x0'));var attributes=require('./userProfile.attributes');var qs=require(_0x3f2e('0x1'));var squel=require(_0x3f2e('0x2'));module[_0x3f2e('0x3')]=function(_0x30f1bb){var _0x27d28c=_0x30f1bb[_0x3f2e('0x4')];function _0x3938e2(_0xabcf5c,_0x216b26){return new Promise(function(_0x5f254a,_0x33a3b7){if(!_0x216b26)return _0x5f254a(null);var _0xdd6b3e=_0x216b26[_0x3f2e('0x5')]?{[_0x216b26[_0x3f2e('0x5')][_0x3f2e('0x6')]]:_0x216b26[_0x3f2e('0x5')][_0x3f2e('0x7')]}:undefined;return _0x27d28c[_0xabcf5c][_0x3f2e('0x8')]({'where':_0xdd6b3e,'raw':!![]})[_0x3f2e('0x9')](function(_0x29a6cc){_0x216b26[_0x3f2e('0xa')]=_[_0x3f2e('0xb')](_0x29a6cc,'id');_0x5f254a(_0x216b26);})[_0x3f2e('0xc')](function(_0x10a392){_0x33a3b7(_0x10a392);});});}function _0x1bb1dd(_0x305861,_0x824ee8){return new Promise(function(_0x475cd2,_0x39b819){var _0x5a4da3=_0x305861[_0x3f2e('0x5')]?{[_0x305861[_0x3f2e('0x5')]['field']]:_0x305861[_0x3f2e('0x5')][_0x3f2e('0x7')]}:undefined;return _0x27d28c[_0x305861[_0x3f2e('0xd')]][_0x3f2e('0x8')]({'where':_0x5a4da3,'raw':!![]})[_0x3f2e('0x9')](function(_0x57cba7){_0x824ee8[_0x3f2e('0xa')]=_[_0x3f2e('0xb')](_0x57cba7,function(_0x2d2fac){return _0x2d2fac['name'];});_0x475cd2(_0x824ee8);})[_0x3f2e('0xc')](function(_0x218b44){_0x39b819(_0x218b44);});});}function _0x17ef58(_0x2c4feb,_0x1dc5d0,_0x2fef73){if(!_0x1dc5d0)return Promise[_0x3f2e('0xe')](null);return new Promise(function(_0x155411,_0x178283){return _0x27d28c[_0x3f2e('0xf')][_0x3f2e('0x8')]({'where':{'sectionId':_0x1dc5d0['id']},'raw':!![]})['then'](function(_0x40e28f){if(_0x2c4feb[_0x3f2e('0x6')]&&_0x2c4feb[_0x3f2e('0x6')]!=='id'){_0x1dc5d0[_0x3f2e('0xa')]=_[_0x3f2e('0xb')](_0x40e28f,function(_0x4eb1e7){return _0x4eb1e7[_0x2c4feb['field']];});}else{if(_0x2fef73===_0x3f2e('0x10')){_0x1dc5d0[_0x3f2e('0xa')]=_[_0x3f2e('0xb')](_0x40e28f,function(_0x2ac500){return{'id':_0x2ac500[_0x3f2e('0x11')],'type':_0x2ac500[_0x3f2e('0x12')]};});}else{_0x1dc5d0['associatedResources']=_['map'](_0x40e28f,function(_0xf81165){return _0xf81165[_0x3f2e('0x11')];});}}_0x155411(_0x1dc5d0);})['catch'](function(_0x541292){_0x178283(_0x541292);});});}function _0x46bb1c(_0x5646f5,_0x1b8c67){var _0x401ed9={'parentSections':[]};switch(_0x5646f5['toLowerCase']()){case'squareprojects':_0x401ed9['childModel']=_0x3f2e('0x13');break;case _0x3f2e('0x14'):_0x401ed9['childModel']=_0x3f2e('0x15');break;case'squarerecordings':_0x401ed9[_0x3f2e('0x16')]='SquareRecording';_0x401ed9[_0x3f2e('0x17')]=[{'name':_0x3f2e('0x18'),'field':_0x3f2e('0x19'),'foreignKey':_0x3f2e('0x1a')}];break;case _0x3f2e('0x1b'):_0x401ed9['childModel']=_0x3f2e('0x1c');break;case _0x3f2e('0x1d'):_0x401ed9['childModel']='CmContact';_0x401ed9[_0x3f2e('0x17')]=[{'name':_0x3f2e('0x1e'),'field':'id','foreignKey':_0x3f2e('0x1f')}];break;case _0x3f2e('0x20'):_0x401ed9['childModel']=_0x3f2e('0x21');break;case _0x3f2e('0x22'):_0x401ed9[_0x3f2e('0x16')]='CmCompany';break;case _0x3f2e('0x23'):_0x401ed9[_0x3f2e('0x16')]=_0x3f2e('0x24');break;case'chatqueues':_0x401ed9[_0x3f2e('0x16')]=_0x3f2e('0x25');break;case _0x3f2e('0x26'):_0x401ed9[_0x3f2e('0x16')]=_0x3f2e('0x27');break;case _0x3f2e('0x28'):_0x401ed9['childModel']=_0x3f2e('0x29');break;case _0x3f2e('0x2a'):_0x401ed9[_0x3f2e('0x16')]=_0x3f2e('0x2b');break;case _0x3f2e('0x2c'):case _0x3f2e('0x2d'):case _0x3f2e('0x2e'):_0x401ed9['childModel']=_0x3f2e('0x2f');break;case _0x3f2e('0x30'):_0x401ed9[_0x3f2e('0x16')]=_0x3f2e('0x31');break;case'voicemails':_0x401ed9['childModel']=_0x3f2e('0x32');break;case _0x3f2e('0x33'):_0x401ed9[_0x3f2e('0x16')]=_0x3f2e('0x34');_0x401ed9[_0x3f2e('0x17')]=[{'name':_0x3f2e('0x35'),'field':_0x3f2e('0x19'),'foreignKey':_0x3f2e('0x36'),'model':_0x3f2e('0x37'),'filter':{'field':_0x3f2e('0x38'),'value':['agent']}},{'name':_0x3f2e('0x39'),'field':_0x3f2e('0x19'),'foreignKey':_0x3f2e('0x36'),'model':_0x3f2e('0x37'),'filter':{'field':'role','value':[_0x3f2e('0x3a')]}},{'name':_0x3f2e('0x3b'),'field':_0x3f2e('0x19'),'foreignKey':_0x3f2e('0x3c'),'model':_0x3f2e('0x3d'),'filter':{'field':_0x3f2e('0x12'),'value':[_0x3f2e('0x3e')]}},{'name':_0x3f2e('0x3f'),'field':'name','foreignKey':_0x3f2e('0x3c'),'model':_0x3f2e('0x3d'),'filter':{'field':_0x3f2e('0x12'),'value':[_0x3f2e('0x40')]}}];break;case'musiconholds':_0x401ed9[_0x3f2e('0x16')]=_0x3f2e('0x41');break;case'chanspies':_0x401ed9[_0x3f2e('0x16')]=_0x3f2e('0x42');break;case'voiceprefixes':_0x401ed9[_0x3f2e('0x16')]=_0x3f2e('0x43');break;case _0x3f2e('0x44'):_0x401ed9[_0x3f2e('0x16')]='Campaign';break;case _0x3f2e('0x45'):_0x401ed9[_0x3f2e('0x16')]='MailQueue';break;case'mailaccounts':_0x401ed9[_0x3f2e('0x16')]=_0x3f2e('0x46');break;case _0x3f2e('0x47'):_0x401ed9['childModel']=_0x3f2e('0x48');break;case _0x3f2e('0x49'):_0x401ed9[_0x3f2e('0x16')]=_0x3f2e('0x4a');break;case _0x3f2e('0x4b'):_0x401ed9[_0x3f2e('0x16')]=_0x3f2e('0x4c');break;case _0x3f2e('0x4d'):_0x401ed9[_0x3f2e('0x16')]=_0x3f2e('0x4e');break;case'smsaccounts':_0x401ed9['childModel']=_0x3f2e('0x4f');break;case _0x3f2e('0x50'):_0x401ed9['childModel']='WhatsappQueue';break;case _0x3f2e('0x51'):_0x401ed9[_0x3f2e('0x16')]=_0x3f2e('0x52');break;case'teams':_0x401ed9[_0x3f2e('0x16')]=_0x3f2e('0x53');break;case _0x3f2e('0x54'):case'queuecampaigns':_0x401ed9[_0x3f2e('0x16')]=_0x3f2e('0x3d');if(_0x1b8c67){_0x401ed9[_0x3f2e('0x17')]=[{'name':'VoiceQueues'},{'name':_0x3f2e('0x3f')}];}break;case _0x3f2e('0x55'):case _0x3f2e('0x56'):case'telephones':_0x401ed9[_0x3f2e('0x16')]='User';if(_0x1b8c67){_0x401ed9[_0x3f2e('0x17')]=[{'name':'Users','filter':{'field':'role','value':[_0x3f2e('0x57'),_0x3f2e('0x58')]},'ignore':!![]},{'name':_0x3f2e('0x35')},{'name':_0x3f2e('0x39')}];}break;case _0x3f2e('0x59'):_0x401ed9['childModel']='ZendeskAccount';break;case _0x3f2e('0x5a'):_0x401ed9[_0x3f2e('0x16')]=_0x3f2e('0x5b');break;case _0x3f2e('0x5c'):_0x401ed9[_0x3f2e('0x16')]=_0x3f2e('0x5d');break;case _0x3f2e('0x5e'):_0x401ed9[_0x3f2e('0x16')]=_0x3f2e('0x5f');break;case'deskaccounts':_0x401ed9['childModel']=_0x3f2e('0x60');break;case'zohoaccounts':_0x401ed9[_0x3f2e('0x16')]=_0x3f2e('0x61');break;case _0x3f2e('0x62'):_0x401ed9[_0x3f2e('0x16')]='User';break;case _0x3f2e('0x63'):_0x401ed9['childModel']=_0x3f2e('0x64');break;case _0x3f2e('0x65'):_0x401ed9['childModel']=_0x3f2e('0x66');break;case'customdashboards':_0x401ed9[_0x3f2e('0x16')]=_0x3f2e('0x67');break;case _0x3f2e('0x68'):_0x401ed9['childModel']=_0x3f2e('0x69');break;case _0x3f2e('0x6a'):_0x401ed9[_0x3f2e('0x16')]=_0x3f2e('0x6b');break;case _0x3f2e('0x6c'):_0x401ed9[_0x3f2e('0x16')]=_0x3f2e('0x6d');break;case _0x3f2e('0x6e'):_0x401ed9[_0x3f2e('0x16')]=_0x3f2e('0x6f');break;case'tags':_0x401ed9[_0x3f2e('0x16')]=_0x3f2e('0x70');break;case _0x3f2e('0x71'):_0x401ed9[_0x3f2e('0x16')]=_0x3f2e('0x72');break;case _0x3f2e('0x73'):_0x401ed9[_0x3f2e('0x16')]=_0x3f2e('0x74');break;case'trunks':_0x401ed9[_0x3f2e('0x16')]=_0x3f2e('0x75');break;case _0x3f2e('0x76'):_0x401ed9[_0x3f2e('0x16')]=_0x3f2e('0x77');break;case'plugins':_0x401ed9['childModel']=_0x3f2e('0x78');break;case _0x3f2e('0x79'):_0x401ed9[_0x3f2e('0x16')]='AnalyticExtractedReport';_0x401ed9['parentSections']=[{'name':'Reports','field':'id','foreignKey':_0x3f2e('0x7a')}];break;case _0x3f2e('0x7b'):_0x401ed9[_0x3f2e('0x16')]=_0x3f2e('0x7c');break;}return _0x401ed9;}function _0x359197(_0x5689d6,_0x18cc5d){var _0xc3c853=_0x5689d6['charAt'](0x0)[_0x3f2e('0x7d')]()+_0x5689d6[_0x3f2e('0x7e')](0x1);var _0x3d05fe={'type':_0x27d28c[_0x3f2e('0x7f')]['QueryTypes'][_0x3f2e('0x80')],'raw':!![]};return new Promise(function(_0x5da1f3,_0x4dc239){var _0x793fbb=squel['select']()['field'](_0x3f2e('0x81')+_0xc3c853+'InteractionId','id')[_0x3f2e('0x6')](_0x3f2e('0x82'))[_0x3f2e('0x83')](_0x3f2e('0x84')+_0x5689d6+'_interactions','ui')[_0x3f2e('0x85')](_0x3f2e('0x86'),_0x18cc5d['id']);return _0x27d28c[_0x3f2e('0x87')][_0x3f2e('0x88')](_0x793fbb['toString'](),_0x3d05fe)[_0x3f2e('0x9')](function(_0x4858ee){_0x18cc5d[_0xc3c853+'OpenTabs']=_0x4858ee;_0x5da1f3(_0x4858ee);})[_0x3f2e('0xc')](function(_0x1d9f99){_0x4dc239(_0x1d9f99);});});}return _0x30f1bb['define']('UserProfile',attributes,{'tableName':_0x3f2e('0x89'),'paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0x27e810){var _0x32cd8e={'raw':![],'where':{}};var _0x487daf={};var _0x22b00a={'count':0x0,'rows':[]};var _0x311c62=_0x27e810[_0x3f2e('0x88')][_0x3f2e('0x8a')];var _0x515895=_0x27e810[_0x3f2e('0x88')]['mergeResources']||![];var _0x457492=_0x46bb1c(_0x311c62,_0x515895);if(!_0x457492[_0x3f2e('0x16')])throw new Error(_0x3f2e('0x8b')+_0x311c62+'\x27');var _0x3c87ce=[{'name':_0x311c62}];if(!_[_0x3f2e('0x8c')](_0x457492[_0x3f2e('0x17')]))_0x3c87ce=_0x457492[_0x3f2e('0x17')];var _0x266f60=[];for(var _0x4f42be=0x0;_0x4f42be<_0x3c87ce[_0x3f2e('0x8d')];_0x4f42be++){_0x266f60['push'](_0x27d28c['UserProfileSection'][_0x3f2e('0x8e')]({'where':{'userProfileId':_0x27e810[_0x3f2e('0x8f')]['id'],'name':_0x3c87ce[_0x4f42be]['name']},'raw':!![]}));}return Promise[_0x3f2e('0x90')](_0x266f60)[_0x3f2e('0x9')](function(_0x58c6f2){var _0x4768f5=_['filter'](_0x58c6f2,function(_0x5577c0){return _0x5577c0?_0x5577c0:undefined;});var _0x2d26c3=_[_0x3f2e('0x5')](_0x3c87ce,[_0x3f2e('0x91'),!![]]);var _0x5d3db7=_['isEmpty'](_0x4768f5)&&_[_0x3f2e('0x8c')](_0x2d26c3)?null:_[_0x3f2e('0x92')](_0x2d26c3,_0x4768f5);if(!_0x5d3db7)return null;var _0x1ac6a3=[];for(var _0x2cf3b9=0x0;_0x2cf3b9<_0x5d3db7[_0x3f2e('0x8d')];_0x2cf3b9++){var _0x3a8983=_[_0x3f2e('0x8e')](_0x3c87ce,function(_0x224e1e){return _0x5d3db7[_0x2cf3b9]?_0x224e1e[_0x3f2e('0x19')]===_0x5d3db7[_0x2cf3b9][_0x3f2e('0x19')]:null;});if(_0x3a8983){if(_0x5d3db7[_0x2cf3b9][_0x3f2e('0x91')]){_0x1ac6a3[_0x3f2e('0x93')](_0x3938e2(_0x457492[_0x3f2e('0x16')],_0x5d3db7[_0x2cf3b9]));}else{if(!_0x5d3db7[_0x2cf3b9][_0x3f2e('0x94')]){_0x1ac6a3[_0x3f2e('0x93')](_0x17ef58(_0x3a8983,_0x5d3db7[_0x2cf3b9],_0x457492[_0x3f2e('0x16')]));}else{if(_0x3a8983[_0x3f2e('0xd')]){_0x1ac6a3[_0x3f2e('0x93')](_0x1bb1dd(_0x3a8983,_0x5d3db7[_0x2cf3b9]));}}}}}return Promise[_0x3f2e('0x90')](_0x1ac6a3);})[_0x3f2e('0x9')](function(_0x50b853){var _0xbef922=_0x50b853;var _0x1850b6=null;if(_0xbef922){_0x1850b6=_0xbef922[_0x3f2e('0x8d')]===0x1?_0xbef922[0x0]:null;}if(!_0x1850b6&&!_0xbef922)return _0x22b00a;var _0xd9ea7b=_0x27d28c[_0x457492[_0x3f2e('0x16')]][_0x3f2e('0x95')];_0x487daf[_0x3f2e('0xd')]=_[_0x3f2e('0x96')](_0xd9ea7b);_0x487daf[_0x3f2e('0x88')]=_['keys'](_0x27e810[_0x3f2e('0x88')]);_0x487daf['filters']=_[_0x3f2e('0x97')](_0x487daf[_0x3f2e('0xd')],_0x487daf['query']);_0x32cd8e[_0x3f2e('0x98')]=_[_0x3f2e('0x97')](_0x487daf['model'],qs[_0x3f2e('0x99')](_0x27e810[_0x3f2e('0x88')][_0x3f2e('0x99')]));_0x32cd8e[_0x3f2e('0x98')]=_0x32cd8e[_0x3f2e('0x98')][_0x3f2e('0x8d')]?_0x32cd8e[_0x3f2e('0x98')]:_0x487daf[_0x3f2e('0xd')];if(!_0x27e810['query'][_0x3f2e('0x9a')]('nolimit')){_0x32cd8e[_0x3f2e('0x9b')]=qs[_0x3f2e('0x9b')](_0x27e810[_0x3f2e('0x88')][_0x3f2e('0x9b')]);_0x32cd8e[_0x3f2e('0x9c')]=qs[_0x3f2e('0x9c')](_0x27e810[_0x3f2e('0x88')][_0x3f2e('0x9c')]);}_0x32cd8e[_0x3f2e('0x9d')]=qs[_0x3f2e('0x9e')](_0x27e810[_0x3f2e('0x88')][_0x3f2e('0x9e')]);_0x32cd8e['where']=qs[_0x3f2e('0x9f')](_[_0x3f2e('0xa0')](_0x27e810[_0x3f2e('0x88')],_0x487daf[_0x3f2e('0x9f')]));if(_0x27e810[_0x3f2e('0x88')]['filter']){_0x32cd8e[_0x3f2e('0x85')]=_[_0x3f2e('0xa1')](_0x32cd8e['where'],{'$or':_[_0x3f2e('0xb')](_0xd9ea7b,function(_0x10ddb6){if(_0x10ddb6['type']['key']!=='VIRTUAL'){var _0x3dc17c={};_0x3dc17c[_0x10ddb6[_0x3f2e('0x6')]]={'$like':'%'+_0x27e810[_0x3f2e('0x88')][_0x3f2e('0x5')]+'%'};return _0x3dc17c;}})});}var _0x236dcf=[];var _0x38d0cb=null;var _0x27c3af={};if(_0x1850b6){_0x38d0cb=_[_0x3f2e('0x8e')](_0x3c87ce,[_0x3f2e('0x19'),_0x1850b6['name']]);if(_0x38d0cb[_0x3f2e('0x6')]){_0x27c3af={};if(_0x457492['childModel']===_0x3f2e('0x10')){_0x27c3af[_0x38d0cb['foreignKey']]=_[_0x3f2e('0xb')](_0x1850b6[_0x3f2e('0xa')],'id');}else{_0x27c3af[_0x38d0cb['foreignKey']]=_0x1850b6[_0x3f2e('0xa')];}_0x236dcf[_0x3f2e('0x93')](_0x27c3af);}else{_0x32cd8e[_0x3f2e('0x85')]['id']=_0x1850b6[_0x3f2e('0xa')];}}else{for(var _0x50d5ca=0x0;_0x50d5ca<_0xbef922[_0x3f2e('0x8d')];_0x50d5ca++){_0x38d0cb=_['find'](_0x3c87ce,[_0x3f2e('0x19'),_0xbef922[_0x50d5ca][_0x3f2e('0x19')]]);if(_0x38d0cb[_0x3f2e('0x6')]){_0x27c3af={};_0x27c3af[_0x38d0cb[_0x3f2e('0xa2')]]=_0xbef922[_0x50d5ca][_0x3f2e('0xa')];_0x236dcf[_0x3f2e('0x93')](_0x27c3af);}else{if(!_0x32cd8e['where']['id'])_0x32cd8e[_0x3f2e('0x85')]['id']=[];_0xbef922[_0x50d5ca][_0x3f2e('0xa')][_0x3f2e('0xa3')](function(_0x13e5c3){_0x32cd8e[_0x3f2e('0x85')]['id'][_0x3f2e('0x93')](_0x13e5c3);});}}}if(!_[_0x3f2e('0x8c')](_0x236dcf)){_0x32cd8e['where']=_['merge'](_0x32cd8e['where'],{'$and':{'$or':_0x236dcf}});}_0x32cd8e=_['merge']({},_0x32cd8e,_0x27e810[_0x3f2e('0xa4')]);if(_0x1850b6&&!_0x1850b6['autoAssociation']&&_0x457492[_0x3f2e('0x16')]==='AnalyticExtractedReport'){if(_0x27e810[_0x3f2e('0x88')][_0x3f2e('0xa5')]){_0x32cd8e[_0x3f2e('0xa6')]=[{'all':!![]}];}return _0x27d28c[_0x457492[_0x3f2e('0x16')]][_0x3f2e('0x8')](_0x32cd8e)[_0x3f2e('0x9')](function(_0x263160){var _0x5bd1cb=[];_0x263160[_0x3f2e('0xa3')](function(_0x850a9c){var _0x604478;switch(_0x850a9c[_0x3f2e('0xa7')]){case'default':_0x604478=_['find'](_0x1850b6[_0x3f2e('0xa')],function(_0x344afb){return _0x344afb['id']===_0x850a9c[_0x3f2e('0x7a')]&&_0x344afb['type']===_0x3f2e('0xa8');});break;case _0x3f2e('0xa9'):_0x604478=_['find'](_0x1850b6[_0x3f2e('0xa')],function(_0x14a919){return _0x14a919['id']===_0x850a9c[_0x3f2e('0x7a')]&&_0x14a919[_0x3f2e('0x12')]==='CustomReports';});break;}if(_0x604478)_0x5bd1cb[_0x3f2e('0x93')](_0x850a9c);});_0x22b00a[_0x3f2e('0xaa')]=_0x5bd1cb[_0x3f2e('0x8d')];_0x22b00a[_0x3f2e('0xab')]=_0x5bd1cb;return _0x22b00a;});}else{return _0x27d28c[_0x457492[_0x3f2e('0x16')]][_0x3f2e('0xaa')]({'where':_0x32cd8e[_0x3f2e('0x85')]})[_0x3f2e('0x9')](function(_0x380407){_0x22b00a['count']=_0x380407;if(_0x27e810[_0x3f2e('0x88')][_0x3f2e('0xa5')]){if(_0x457492[_0x3f2e('0x16')]===_0x3f2e('0xac')){_0x32cd8e[_0x3f2e('0xa6')]=[{'model':_0x27d28c[_0x3f2e('0x70')],'as':'Tags','attributes':['id',_0x3f2e('0x19'),_0x3f2e('0xad')],'required':_0x27e810[_0x3f2e('0x88')][_0x3f2e('0xae')]?!![]:![]},{'model':_0x27d28c['Tag'],'as':_0x3f2e('0xaf'),'attributes':['id',_0x3f2e('0x19'),_0x3f2e('0xad')],'through':_0x27e810[_0x3f2e('0x88')]['tag']?{'attributes':[],'where':{'TagId':_0x27e810[_0x3f2e('0x88')][_0x3f2e('0xae')]||undefined}}:{},'required':_0x27e810[_0x3f2e('0x88')][_0x3f2e('0xae')]?!![]:![]}];}else{_0x32cd8e[_0x3f2e('0xa6')]=[{'all':!![]}];}}return _0x27d28c[_0x457492[_0x3f2e('0x16')]][_0x3f2e('0x8')](_0x32cd8e);})[_0x3f2e('0x9')](function(_0x5cb1f8){_0x22b00a['rows']=_0x5cb1f8;if(_0x311c62===_0x3f2e('0x35')&&_0x27e810[_0x3f2e('0x88')][_0x3f2e('0xb0')]==='true'){var _0x511c6c=[];for(var _0x1d3945=0x0;_0x1d3945<_0x22b00a[_0x3f2e('0xab')][_0x3f2e('0x8d')];_0x1d3945++){_0x511c6c[_0x3f2e('0x93')](_0x359197(_0x3f2e('0xb1'),_0x22b00a[_0x3f2e('0xab')][_0x1d3945][_0x3f2e('0xb2')]));_0x511c6c['push'](_0x359197(_0x3f2e('0xb3'),_0x22b00a['rows'][_0x1d3945][_0x3f2e('0xb2')]));_0x511c6c[_0x3f2e('0x93')](_0x359197(_0x3f2e('0xb4'),_0x22b00a[_0x3f2e('0xab')][_0x1d3945]['dataValues']));_0x511c6c['push'](_0x359197('mail',_0x22b00a[_0x3f2e('0xab')][_0x1d3945]['dataValues']));_0x511c6c[_0x3f2e('0x93')](_0x359197('openchannel',_0x22b00a[_0x3f2e('0xab')][_0x1d3945][_0x3f2e('0xb2')]));_0x511c6c[_0x3f2e('0x93')](_0x359197(_0x3f2e('0xb5'),_0x22b00a[_0x3f2e('0xab')][_0x1d3945]['dataValues']));}return Promise[_0x3f2e('0x90')](_0x511c6c)[_0x3f2e('0x9')](function(){return _0x22b00a;});}return _0x22b00a;});}});}}});}; \ No newline at end of file +var _0xffd6=['FaxQueue','faxaccounts','FaxAccount','inboundroutes','internalroutes','outboundroutes','VoiceExtension','contexts','VoiceContext','VoiceMail','voicerecordings','membername','User','role','agent','telephone','VoiceQueues','QueueCampaigns','queue','VoiceQueue','outbound','VoiceMusicOnHold','chanspies','voiceprefixes','VoicePrefix','ivrcampaigns','mailqueues','MailQueue','mailaccounts','MailAccount','mailsubstatuses','OpenchannelQueue','OpenchannelAccount','smsqueues','smsaccounts','SmsAccount','whatsappqueues','WhatsappQueue','whatsappaccounts','WhatsappAccount','teams','users','agents','telephones','Users','admin','user','Agents','Telephones','zendeskaccounts','salesforceaccounts','SalesforceAccount','freshdeskaccounts','FreshdeskAccount','sugarcrmaccounts','SugarcrmAccount','deskaccounts','vtigeraccounts','cannedanswers','CannedAnswer','dispositions','customdashboards','Interval','pauses','Pause','scheduler','sounds','Sound','Tag','templates','Template','Trigger','trunks','Trunk','variables','Variable','plugins','Plugin','extractedreports','AnalyticExtractedReport','Reports','reportId','metrics','AnalyticMetric','charAt','slice','Sequelize','QueryTypes','select','ui.','InteractionId','ui.createdAt','from','user_has_','_interactions','ui.UserId\x20=\x20?','sequelize','query','OpenTabs','define','UserProfile','user_profiles','section','mergeResources','Invalid\x20section\x20\x27','isEmpty','length','push','UserProfileSection','find','params','all','ignore','union','autoAssociation','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','limit','offset','order','sort','where','key','VIRTUAL','foreignKey','merge','options','includeAll','include','findAll','forEach','default','custom','CustomReports','count','color','tag','rows','openTabs','true','chat','dataValues','fax','mail','openchannel','whatsapp','lodash','./userProfile.attributes','../../components/parsers/qs','models','filter','field','value','then','map','catch','model','associatedResources','name','resolve','UserProfileResource','type','resourceId','toLowerCase','squareprojects','SquareProject','odbc','childModel','squarerecordings','SquareRecording','parentSections','projectName','projects','Lists','lists','CmList','companies','CmCompany','globalcustomfields','CmCustomField','chatqueues','ChatQueue','chatwebsites'];(function(_0x2ea41,_0x4f807b){var _0x8ee23b=function(_0x2e5fd8){while(--_0x2e5fd8){_0x2ea41['push'](_0x2ea41['shift']());}};_0x8ee23b(++_0x4f807b);}(_0xffd6,0x97));var _0x6ffd=function(_0x47408e,_0x481428){_0x47408e=_0x47408e-0x0;var _0x1636bc=_0xffd6[_0x47408e];return _0x1636bc;};'use strict';var _=require(_0x6ffd('0x0'));var attributes=require(_0x6ffd('0x1'));var qs=require(_0x6ffd('0x2'));var squel=require('squel');module['exports']=function(_0x305b6b){var _0x400c43=_0x305b6b[_0x6ffd('0x3')];function _0x560afa(_0x1d12e3,_0x173979){return new Promise(function(_0x3b8a46,_0x2949a4){if(!_0x173979)return _0x3b8a46(null);var _0x561055=_0x173979[_0x6ffd('0x4')]?{[_0x173979[_0x6ffd('0x4')][_0x6ffd('0x5')]]:_0x173979[_0x6ffd('0x4')][_0x6ffd('0x6')]}:undefined;return _0x400c43[_0x1d12e3]['findAll']({'where':_0x561055,'raw':!![]})[_0x6ffd('0x7')](function(_0x417f34){_0x173979['associatedResources']=_[_0x6ffd('0x8')](_0x417f34,'id');_0x3b8a46(_0x173979);})[_0x6ffd('0x9')](function(_0x23f7f2){_0x2949a4(_0x23f7f2);});});}function _0x3dda1e(_0x262023,_0x39323f){return new Promise(function(_0x836501,_0x5892e1){var _0x242078=_0x262023[_0x6ffd('0x4')]?{[_0x262023['filter'][_0x6ffd('0x5')]]:_0x262023[_0x6ffd('0x4')][_0x6ffd('0x6')]}:undefined;return _0x400c43[_0x262023[_0x6ffd('0xa')]]['findAll']({'where':_0x242078,'raw':!![]})[_0x6ffd('0x7')](function(_0x594cb3){_0x39323f[_0x6ffd('0xb')]=_['map'](_0x594cb3,function(_0xfd9569){return _0xfd9569[_0x6ffd('0xc')];});_0x836501(_0x39323f);})[_0x6ffd('0x9')](function(_0x5d8aff){_0x5892e1(_0x5d8aff);});});}function _0x15fca6(_0x9d2f93,_0x350c94,_0x3394b2){if(!_0x350c94)return Promise[_0x6ffd('0xd')](null);return new Promise(function(_0x19a772,_0x3f38e7){return _0x400c43[_0x6ffd('0xe')]['findAll']({'where':{'sectionId':_0x350c94['id']},'raw':!![]})[_0x6ffd('0x7')](function(_0x56c541){if(_0x9d2f93['field']&&_0x9d2f93[_0x6ffd('0x5')]!=='id'){_0x350c94[_0x6ffd('0xb')]=_['map'](_0x56c541,function(_0x34c3c1){return _0x34c3c1[_0x9d2f93[_0x6ffd('0x5')]];});}else{if(_0x3394b2==='AnalyticExtractedReport'){_0x350c94['associatedResources']=_[_0x6ffd('0x8')](_0x56c541,function(_0x1c9d19){return{'id':_0x1c9d19['resourceId'],'type':_0x1c9d19[_0x6ffd('0xf')]};});}else{_0x350c94[_0x6ffd('0xb')]=_[_0x6ffd('0x8')](_0x56c541,function(_0x53128a){return _0x53128a[_0x6ffd('0x10')];});}}_0x19a772(_0x350c94);})[_0x6ffd('0x9')](function(_0x50896b){_0x3f38e7(_0x50896b);});});}function _0x356c9c(_0x438d1a,_0x50c19a){var _0x31fb22={'parentSections':[]};switch(_0x438d1a[_0x6ffd('0x11')]()){case _0x6ffd('0x12'):_0x31fb22['childModel']=_0x6ffd('0x13');break;case _0x6ffd('0x14'):_0x31fb22[_0x6ffd('0x15')]='SquareOdbc';break;case _0x6ffd('0x16'):_0x31fb22['childModel']=_0x6ffd('0x17');_0x31fb22[_0x6ffd('0x18')]=[{'name':'SquareProjects','field':'name','foreignKey':_0x6ffd('0x19')}];break;case _0x6ffd('0x1a'):_0x31fb22[_0x6ffd('0x15')]='JscriptyProject';break;case'contacts':_0x31fb22[_0x6ffd('0x15')]='CmContact';_0x31fb22[_0x6ffd('0x18')]=[{'name':_0x6ffd('0x1b'),'field':'id','foreignKey':'ListId'}];break;case _0x6ffd('0x1c'):_0x31fb22[_0x6ffd('0x15')]=_0x6ffd('0x1d');break;case _0x6ffd('0x1e'):_0x31fb22[_0x6ffd('0x15')]=_0x6ffd('0x1f');break;case _0x6ffd('0x20'):_0x31fb22[_0x6ffd('0x15')]=_0x6ffd('0x21');break;case _0x6ffd('0x22'):_0x31fb22[_0x6ffd('0x15')]=_0x6ffd('0x23');break;case _0x6ffd('0x24'):_0x31fb22['childModel']='ChatWebsite';break;case'faxqueues':_0x31fb22[_0x6ffd('0x15')]=_0x6ffd('0x25');break;case _0x6ffd('0x26'):_0x31fb22[_0x6ffd('0x15')]=_0x6ffd('0x27');break;case _0x6ffd('0x28'):case _0x6ffd('0x29'):case _0x6ffd('0x2a'):_0x31fb22[_0x6ffd('0x15')]=_0x6ffd('0x2b');break;case _0x6ffd('0x2c'):_0x31fb22[_0x6ffd('0x15')]=_0x6ffd('0x2d');break;case'voicemails':_0x31fb22[_0x6ffd('0x15')]=_0x6ffd('0x2e');break;case _0x6ffd('0x2f'):_0x31fb22[_0x6ffd('0x15')]='VoiceRecording';_0x31fb22[_0x6ffd('0x18')]=[{'name':'Agents','field':'name','foreignKey':_0x6ffd('0x30'),'model':_0x6ffd('0x31'),'filter':{'field':_0x6ffd('0x32'),'value':[_0x6ffd('0x33')]}},{'name':'Telephones','field':_0x6ffd('0xc'),'foreignKey':'membername','model':_0x6ffd('0x31'),'filter':{'field':_0x6ffd('0x32'),'value':[_0x6ffd('0x34')]}},{'name':_0x6ffd('0x35'),'field':_0x6ffd('0xc'),'foreignKey':'queue','model':'VoiceQueue','filter':{'field':_0x6ffd('0xf'),'value':['inbound']}},{'name':_0x6ffd('0x36'),'field':_0x6ffd('0xc'),'foreignKey':_0x6ffd('0x37'),'model':_0x6ffd('0x38'),'filter':{'field':_0x6ffd('0xf'),'value':[_0x6ffd('0x39')]}}];break;case'musiconholds':_0x31fb22[_0x6ffd('0x15')]=_0x6ffd('0x3a');break;case _0x6ffd('0x3b'):_0x31fb22[_0x6ffd('0x15')]='VoiceChanSpy';break;case _0x6ffd('0x3c'):_0x31fb22['childModel']=_0x6ffd('0x3d');break;case _0x6ffd('0x3e'):_0x31fb22[_0x6ffd('0x15')]='Campaign';break;case _0x6ffd('0x3f'):_0x31fb22[_0x6ffd('0x15')]=_0x6ffd('0x40');break;case _0x6ffd('0x41'):_0x31fb22[_0x6ffd('0x15')]=_0x6ffd('0x42');break;case _0x6ffd('0x43'):_0x31fb22['childModel']='MailSubstatus';break;case'openchannelqueues':_0x31fb22[_0x6ffd('0x15')]=_0x6ffd('0x44');break;case'openchannelaccounts':_0x31fb22[_0x6ffd('0x15')]=_0x6ffd('0x45');break;case _0x6ffd('0x46'):_0x31fb22[_0x6ffd('0x15')]='SmsQueue';break;case _0x6ffd('0x47'):_0x31fb22[_0x6ffd('0x15')]=_0x6ffd('0x48');break;case _0x6ffd('0x49'):_0x31fb22[_0x6ffd('0x15')]=_0x6ffd('0x4a');break;case _0x6ffd('0x4b'):_0x31fb22[_0x6ffd('0x15')]=_0x6ffd('0x4c');break;case _0x6ffd('0x4d'):_0x31fb22[_0x6ffd('0x15')]='Team';break;case'voicequeues':case'queuecampaigns':_0x31fb22[_0x6ffd('0x15')]=_0x6ffd('0x38');if(_0x50c19a){_0x31fb22['parentSections']=[{'name':_0x6ffd('0x35')},{'name':_0x6ffd('0x36')}];}break;case _0x6ffd('0x4e'):case _0x6ffd('0x4f'):case _0x6ffd('0x50'):_0x31fb22['childModel']=_0x6ffd('0x31');if(_0x50c19a){_0x31fb22[_0x6ffd('0x18')]=[{'name':_0x6ffd('0x51'),'filter':{'field':'role','value':[_0x6ffd('0x52'),_0x6ffd('0x53')]},'ignore':!![]},{'name':_0x6ffd('0x54')},{'name':_0x6ffd('0x55')}];}break;case _0x6ffd('0x56'):_0x31fb22[_0x6ffd('0x15')]='ZendeskAccount';break;case _0x6ffd('0x57'):_0x31fb22[_0x6ffd('0x15')]=_0x6ffd('0x58');break;case _0x6ffd('0x59'):_0x31fb22[_0x6ffd('0x15')]=_0x6ffd('0x5a');break;case _0x6ffd('0x5b'):_0x31fb22['childModel']=_0x6ffd('0x5c');break;case _0x6ffd('0x5d'):_0x31fb22['childModel']='DeskAccount';break;case'zohoaccounts':_0x31fb22[_0x6ffd('0x15')]='ZohoAccount';break;case _0x6ffd('0x5e'):_0x31fb22[_0x6ffd('0x15')]=_0x6ffd('0x31');break;case _0x6ffd('0x5f'):_0x31fb22['childModel']=_0x6ffd('0x60');break;case _0x6ffd('0x61'):_0x31fb22[_0x6ffd('0x15')]='Disposition';break;case _0x6ffd('0x62'):_0x31fb22[_0x6ffd('0x15')]='Dashboard';break;case'intervals':_0x31fb22[_0x6ffd('0x15')]=_0x6ffd('0x63');break;case _0x6ffd('0x64'):_0x31fb22[_0x6ffd('0x15')]=_0x6ffd('0x65');break;case _0x6ffd('0x66'):_0x31fb22[_0x6ffd('0x15')]='Schedule';break;case _0x6ffd('0x67'):_0x31fb22[_0x6ffd('0x15')]=_0x6ffd('0x68');break;case'tags':_0x31fb22['childModel']=_0x6ffd('0x69');break;case _0x6ffd('0x6a'):_0x31fb22[_0x6ffd('0x15')]=_0x6ffd('0x6b');break;case'triggers':_0x31fb22[_0x6ffd('0x15')]=_0x6ffd('0x6c');break;case _0x6ffd('0x6d'):_0x31fb22[_0x6ffd('0x15')]=_0x6ffd('0x6e');break;case _0x6ffd('0x6f'):_0x31fb22['childModel']=_0x6ffd('0x70');break;case _0x6ffd('0x71'):_0x31fb22[_0x6ffd('0x15')]=_0x6ffd('0x72');break;case _0x6ffd('0x73'):_0x31fb22['childModel']=_0x6ffd('0x74');_0x31fb22[_0x6ffd('0x18')]=[{'name':_0x6ffd('0x75'),'field':'id','foreignKey':_0x6ffd('0x76')}];break;case _0x6ffd('0x77'):_0x31fb22['childModel']=_0x6ffd('0x78');break;}return _0x31fb22;}function _0x217e22(_0x1849ae,_0x55719f){var _0x3ba9c5=_0x1849ae[_0x6ffd('0x79')](0x0)['toUpperCase']()+_0x1849ae[_0x6ffd('0x7a')](0x1);var _0x4f057c={'type':_0x400c43[_0x6ffd('0x7b')][_0x6ffd('0x7c')]['SELECT'],'raw':!![]};return new Promise(function(_0x2c860e,_0x5be0d6){var _0x141e52=squel[_0x6ffd('0x7d')]()[_0x6ffd('0x5')](_0x6ffd('0x7e')+_0x3ba9c5+_0x6ffd('0x7f'),'id')['field'](_0x6ffd('0x80'))[_0x6ffd('0x81')](_0x6ffd('0x82')+_0x1849ae+_0x6ffd('0x83'),'ui')['where'](_0x6ffd('0x84'),_0x55719f['id']);return _0x400c43[_0x6ffd('0x85')][_0x6ffd('0x86')](_0x141e52['toString'](),_0x4f057c)[_0x6ffd('0x7')](function(_0x51cf91){_0x55719f[_0x3ba9c5+_0x6ffd('0x87')]=_0x51cf91;_0x2c860e(_0x51cf91);})['catch'](function(_0x363959){_0x5be0d6(_0x363959);});});}return _0x305b6b[_0x6ffd('0x88')](_0x6ffd('0x89'),attributes,{'tableName':_0x6ffd('0x8a'),'paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0x54a057){var _0x176471={'raw':![],'where':{}};var _0x45d6b5={};var _0x2514cd={'count':0x0,'rows':[]};var _0x2cdcb2=_0x54a057[_0x6ffd('0x86')][_0x6ffd('0x8b')];var _0x256a03=_0x54a057[_0x6ffd('0x86')][_0x6ffd('0x8c')]||![];var _0x302db8=_0x356c9c(_0x2cdcb2,_0x256a03);if(!_0x302db8[_0x6ffd('0x15')])throw new Error(_0x6ffd('0x8d')+_0x2cdcb2+'\x27');var _0x4931e1=[{'name':_0x2cdcb2}];if(!_[_0x6ffd('0x8e')](_0x302db8[_0x6ffd('0x18')]))_0x4931e1=_0x302db8[_0x6ffd('0x18')];var _0x3d7d9d=[];for(var _0x179b3f=0x0;_0x179b3f<_0x4931e1[_0x6ffd('0x8f')];_0x179b3f++){_0x3d7d9d[_0x6ffd('0x90')](_0x400c43[_0x6ffd('0x91')][_0x6ffd('0x92')]({'where':{'userProfileId':_0x54a057[_0x6ffd('0x93')]['id'],'name':_0x4931e1[_0x179b3f][_0x6ffd('0xc')]},'raw':!![]}));}return Promise[_0x6ffd('0x94')](_0x3d7d9d)['then'](function(_0x2fbfdc){var _0x4a28bd=_[_0x6ffd('0x4')](_0x2fbfdc,function(_0x20d9ed){return _0x20d9ed?_0x20d9ed:undefined;});var _0x2657ed=_[_0x6ffd('0x4')](_0x4931e1,[_0x6ffd('0x95'),!![]]);var _0x199b6e=_[_0x6ffd('0x8e')](_0x4a28bd)&&_['isEmpty'](_0x2657ed)?null:_[_0x6ffd('0x96')](_0x2657ed,_0x4a28bd);if(!_0x199b6e)return null;var _0x8cece8=[];for(var _0xef9c35=0x0;_0xef9c35<_0x199b6e[_0x6ffd('0x8f')];_0xef9c35++){var _0x209b93=_[_0x6ffd('0x92')](_0x4931e1,function(_0x222636){return _0x199b6e[_0xef9c35]?_0x222636[_0x6ffd('0xc')]===_0x199b6e[_0xef9c35][_0x6ffd('0xc')]:null;});if(_0x209b93){if(_0x199b6e[_0xef9c35][_0x6ffd('0x95')]){_0x8cece8['push'](_0x560afa(_0x302db8[_0x6ffd('0x15')],_0x199b6e[_0xef9c35]));}else{if(!_0x199b6e[_0xef9c35][_0x6ffd('0x97')]){_0x8cece8[_0x6ffd('0x90')](_0x15fca6(_0x209b93,_0x199b6e[_0xef9c35],_0x302db8[_0x6ffd('0x15')]));}else{if(_0x209b93[_0x6ffd('0xa')]){_0x8cece8[_0x6ffd('0x90')](_0x3dda1e(_0x209b93,_0x199b6e[_0xef9c35]));}}}}}return Promise['all'](_0x8cece8);})['then'](function(_0x1bca62){var _0x193e8e=_0x1bca62;var _0x4ceb5b=null;if(_0x193e8e){_0x4ceb5b=_0x193e8e[_0x6ffd('0x8f')]===0x1?_0x193e8e[0x0]:null;}if(!_0x4ceb5b&&!_0x193e8e)return _0x2514cd;var _0x4fd6fa=_0x400c43[_0x302db8[_0x6ffd('0x15')]]['rawAttributes'];_0x45d6b5[_0x6ffd('0xa')]=_[_0x6ffd('0x98')](_0x4fd6fa);_0x45d6b5['query']=_[_0x6ffd('0x98')](_0x54a057['query']);_0x45d6b5[_0x6ffd('0x99')]=_[_0x6ffd('0x9a')](_0x45d6b5['model'],_0x45d6b5[_0x6ffd('0x86')]);_0x176471[_0x6ffd('0x9b')]=_[_0x6ffd('0x9a')](_0x45d6b5['model'],qs[_0x6ffd('0x9c')](_0x54a057[_0x6ffd('0x86')][_0x6ffd('0x9c')]));_0x176471[_0x6ffd('0x9b')]=_0x176471[_0x6ffd('0x9b')][_0x6ffd('0x8f')]?_0x176471[_0x6ffd('0x9b')]:_0x45d6b5[_0x6ffd('0xa')];if(!_0x54a057['query'][_0x6ffd('0x9d')](_0x6ffd('0x9e'))){_0x176471['limit']=qs['limit'](_0x54a057['query'][_0x6ffd('0x9f')]);_0x176471[_0x6ffd('0xa0')]=qs[_0x6ffd('0xa0')](_0x54a057[_0x6ffd('0x86')][_0x6ffd('0xa0')]);}_0x176471[_0x6ffd('0xa1')]=qs[_0x6ffd('0xa2')](_0x54a057[_0x6ffd('0x86')]['sort']);_0x176471[_0x6ffd('0xa3')]=qs[_0x6ffd('0x99')](_['pick'](_0x54a057[_0x6ffd('0x86')],_0x45d6b5[_0x6ffd('0x99')]));if(_0x54a057[_0x6ffd('0x86')][_0x6ffd('0x4')]){_0x176471['where']=_['merge'](_0x176471[_0x6ffd('0xa3')],{'$or':_['map'](_0x4fd6fa,function(_0x5db7ac){if(_0x5db7ac[_0x6ffd('0xf')][_0x6ffd('0xa4')]!==_0x6ffd('0xa5')){var _0x976c59={};_0x976c59[_0x5db7ac[_0x6ffd('0x5')]]={'$like':'%'+_0x54a057[_0x6ffd('0x86')][_0x6ffd('0x4')]+'%'};return _0x976c59;}})});}var _0xe63fdc=[];var _0x10b35e=null;var _0x11570f={};if(_0x4ceb5b){_0x10b35e=_[_0x6ffd('0x92')](_0x4931e1,[_0x6ffd('0xc'),_0x4ceb5b['name']]);if(_0x10b35e['field']){_0x11570f={};if(_0x302db8[_0x6ffd('0x15')]===_0x6ffd('0x74')){_0x11570f[_0x10b35e[_0x6ffd('0xa6')]]=_[_0x6ffd('0x8')](_0x4ceb5b[_0x6ffd('0xb')],'id');}else{_0x11570f[_0x10b35e['foreignKey']]=_0x4ceb5b[_0x6ffd('0xb')];}_0xe63fdc[_0x6ffd('0x90')](_0x11570f);}else{_0x176471[_0x6ffd('0xa3')]['id']=_0x4ceb5b[_0x6ffd('0xb')];}}else{for(var _0x58e1e4=0x0;_0x58e1e4<_0x193e8e[_0x6ffd('0x8f')];_0x58e1e4++){_0x10b35e=_[_0x6ffd('0x92')](_0x4931e1,['name',_0x193e8e[_0x58e1e4][_0x6ffd('0xc')]]);if(_0x10b35e[_0x6ffd('0x5')]){_0x11570f={};_0x11570f[_0x10b35e[_0x6ffd('0xa6')]]=_0x193e8e[_0x58e1e4][_0x6ffd('0xb')];_0xe63fdc[_0x6ffd('0x90')](_0x11570f);}else{if(!_0x176471[_0x6ffd('0xa3')]['id'])_0x176471['where']['id']=[];_0x193e8e[_0x58e1e4][_0x6ffd('0xb')]['forEach'](function(_0x4ad447){_0x176471[_0x6ffd('0xa3')]['id'][_0x6ffd('0x90')](_0x4ad447);});}}}if(!_['isEmpty'](_0xe63fdc)){_0x176471[_0x6ffd('0xa3')]=_[_0x6ffd('0xa7')](_0x176471[_0x6ffd('0xa3')],{'$and':{'$or':_0xe63fdc}});}_0x176471=_[_0x6ffd('0xa7')]({},_0x176471,_0x54a057[_0x6ffd('0xa8')]);if(_0x4ceb5b&&!_0x4ceb5b[_0x6ffd('0x97')]&&_0x302db8[_0x6ffd('0x15')]===_0x6ffd('0x74')){if(_0x54a057[_0x6ffd('0x86')][_0x6ffd('0xa9')]){_0x176471[_0x6ffd('0xaa')]=[{'all':!![]}];}return _0x400c43[_0x302db8['childModel']][_0x6ffd('0xab')](_0x176471)[_0x6ffd('0x7')](function(_0x54546a){var _0xad693e=[];_0x54546a[_0x6ffd('0xac')](function(_0x6224fe){var _0x275eaa;switch(_0x6224fe['reportType']){case _0x6ffd('0xad'):_0x275eaa=_[_0x6ffd('0x92')](_0x4ceb5b['associatedResources'],function(_0x4c2fa6){return _0x4c2fa6['id']===_0x6224fe[_0x6ffd('0x76')]&&_0x4c2fa6['type']==='DefaultReports';});break;case _0x6ffd('0xae'):_0x275eaa=_[_0x6ffd('0x92')](_0x4ceb5b['associatedResources'],function(_0x113f5e){return _0x113f5e['id']===_0x6224fe['reportId']&&_0x113f5e['type']===_0x6ffd('0xaf');});break;}if(_0x275eaa)_0xad693e[_0x6ffd('0x90')](_0x6224fe);});_0x2514cd['count']=_0xad693e['length'];_0x2514cd['rows']=_0xad693e;return _0x2514cd;});}else{return _0x400c43[_0x302db8[_0x6ffd('0x15')]][_0x6ffd('0xb0')]({'where':_0x176471[_0x6ffd('0xa3')]})['then'](function(_0xdf230f){_0x2514cd[_0x6ffd('0xb0')]=_0xdf230f;if(_0x54a057[_0x6ffd('0x86')][_0x6ffd('0xa9')]){if(_0x302db8[_0x6ffd('0x15')]==='CmContact'){_0x176471[_0x6ffd('0xaa')]=[{'model':_0x400c43[_0x6ffd('0x69')],'as':'Tags','attributes':['id','name',_0x6ffd('0xb1')],'required':_0x54a057[_0x6ffd('0x86')][_0x6ffd('0xb2')]?!![]:![]},{'model':_0x400c43['Tag'],'as':'ThroughTags','attributes':['id',_0x6ffd('0xc'),_0x6ffd('0xb1')],'through':_0x54a057['query'][_0x6ffd('0xb2')]?{'attributes':[],'where':{'TagId':_0x54a057[_0x6ffd('0x86')][_0x6ffd('0xb2')]||undefined}}:{},'required':_0x54a057['query'][_0x6ffd('0xb2')]?!![]:![]}];}else{_0x176471[_0x6ffd('0xaa')]=[{'all':!![]}];}}return _0x400c43[_0x302db8[_0x6ffd('0x15')]][_0x6ffd('0xab')](_0x176471);})[_0x6ffd('0x7')](function(_0x971a0a){_0x2514cd[_0x6ffd('0xb3')]=_0x971a0a;if(_0x2cdcb2==='Agents'&&_0x54a057[_0x6ffd('0x86')][_0x6ffd('0xb4')]===_0x6ffd('0xb5')){var _0x55fda9=[];for(var _0x13243c=0x0;_0x13243c<_0x2514cd['rows'][_0x6ffd('0x8f')];_0x13243c++){_0x55fda9[_0x6ffd('0x90')](_0x217e22(_0x6ffd('0xb6'),_0x2514cd[_0x6ffd('0xb3')][_0x13243c][_0x6ffd('0xb7')]));_0x55fda9[_0x6ffd('0x90')](_0x217e22('sms',_0x2514cd[_0x6ffd('0xb3')][_0x13243c][_0x6ffd('0xb7')]));_0x55fda9[_0x6ffd('0x90')](_0x217e22(_0x6ffd('0xb8'),_0x2514cd[_0x6ffd('0xb3')][_0x13243c][_0x6ffd('0xb7')]));_0x55fda9['push'](_0x217e22(_0x6ffd('0xb9'),_0x2514cd[_0x6ffd('0xb3')][_0x13243c][_0x6ffd('0xb7')]));_0x55fda9[_0x6ffd('0x90')](_0x217e22(_0x6ffd('0xba'),_0x2514cd[_0x6ffd('0xb3')][_0x13243c]['dataValues']));_0x55fda9['push'](_0x217e22(_0x6ffd('0xbb'),_0x2514cd[_0x6ffd('0xb3')][_0x13243c]['dataValues']));}return Promise[_0x6ffd('0x94')](_0x55fda9)['then'](function(){return _0x2514cd;});}return _0x2514cd;});}});}}});}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.rpc.js b/server/api/userProfile/userProfile.rpc.js index c8eaabe..3f5dd3f 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 _0xd1f1=['UserProfile,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','./userProfile.socket','register','request','then','UserProfile,\x20%s,\x20%s','request\x20sent'];(function(_0x4d09fd,_0x289a8f){var _0x2173d5=function(_0x26b8c3){while(--_0x26b8c3){_0x4d09fd['push'](_0x4d09fd['shift']());}};_0x2173d5(++_0x289a8f);}(_0xd1f1,0xbc));var _0x1d1f=function(_0x25390b,_0x1771ca){_0x25390b=_0x25390b-0x0;var _0x490180=_0xd1f1[_0x25390b];return _0x490180;};'use strict';var _=require(_0x1d1f('0x0'));var util=require(_0x1d1f('0x1'));var moment=require('moment');var BPromise=require(_0x1d1f('0x2'));var rs=require(_0x1d1f('0x3'));var fs=require('fs');var Redis=require(_0x1d1f('0x4'));var db=require(_0x1d1f('0x5'))['db'];var utils=require(_0x1d1f('0x6'));var logger=require(_0x1d1f('0x7'))(_0x1d1f('0x8'));var config=require('../../config/environment');var jayson=require(_0x1d1f('0x9'));var client=jayson[_0x1d1f('0xa')][_0x1d1f('0xb')]({'port':0x232a});config[_0x1d1f('0xc')]=_[_0x1d1f('0xd')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x1d1f('0xc')]));require(_0x1d1f('0xe'))[_0x1d1f('0xf')](socket);function respondWithRpcPromise(_0x18ac32,_0x5a640d,_0x474a28){return new BPromise(function(_0x3f1a34,_0x220282){return client[_0x1d1f('0x10')](_0x18ac32,_0x474a28)[_0x1d1f('0x11')](function(_0x5f39fe){logger['info'](_0x1d1f('0x12'),_0x5a640d,_0x1d1f('0x13'));logger['debug'](_0x1d1f('0x14'),_0x5a640d,_0x1d1f('0x13'),JSON[_0x1d1f('0x15')](_0x5f39fe));if(_0x5f39fe[_0x1d1f('0x16')]){if(_0x5f39fe['error'][_0x1d1f('0x17')]===0x1f4){logger[_0x1d1f('0x16')](_0x1d1f('0x12'),_0x5a640d,_0x5f39fe[_0x1d1f('0x16')][_0x1d1f('0x18')]);return _0x220282(_0x5f39fe[_0x1d1f('0x16')][_0x1d1f('0x18')]);}logger[_0x1d1f('0x16')](_0x1d1f('0x12'),_0x5a640d,_0x5f39fe[_0x1d1f('0x16')][_0x1d1f('0x18')]);return _0x3f1a34(_0x5f39fe[_0x1d1f('0x16')][_0x1d1f('0x18')]);}else{logger[_0x1d1f('0x19')]('UserProfile,\x20%s,\x20%s',_0x5a640d,'request\x20sent');_0x3f1a34(_0x5f39fe['result'][_0x1d1f('0x18')]);}})['catch'](function(_0x1300b0){logger['error']('UserProfile,\x20%s,\x20%s',_0x5a640d,_0x1300b0);_0x220282(_0x1300b0);});});} \ No newline at end of file +var _0xfe91=['register','request','then','info','UserProfile,\x20%s,\x20%s','debug','UserProfile,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','lodash','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','socket.io-emitter'];(function(_0x560c0b,_0x181f31){var _0x2f4dfa=function(_0x3eabc9){while(--_0x3eabc9){_0x560c0b['push'](_0x560c0b['shift']());}};_0x2f4dfa(++_0x181f31);}(_0xfe91,0xd4));var _0x1fe9=function(_0x23ca4d,_0x5c2a32){_0x23ca4d=_0x23ca4d-0x0;var _0x435432=_0xfe91[_0x23ca4d];return _0x435432;};'use strict';var _=require(_0x1fe9('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x1fe9('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1fe9('0x2'));var db=require(_0x1fe9('0x3'))['db'];var utils=require(_0x1fe9('0x4'));var logger=require(_0x1fe9('0x5'))(_0x1fe9('0x6'));var config=require(_0x1fe9('0x7'));var jayson=require(_0x1fe9('0x8'));var client=jayson['client'][_0x1fe9('0x9')]({'port':0x232a});config[_0x1fe9('0xa')]=_[_0x1fe9('0xb')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x1fe9('0xc'))(new Redis(config[_0x1fe9('0xa')]));require('./userProfile.socket')[_0x1fe9('0xd')](socket);function respondWithRpcPromise(_0x41669b,_0x35d723,_0x336ac6){return new BPromise(function(_0x1c3089,_0x421381){return client[_0x1fe9('0xe')](_0x41669b,_0x336ac6)[_0x1fe9('0xf')](function(_0x4e0e6b){logger[_0x1fe9('0x10')](_0x1fe9('0x11'),_0x35d723,'request\x20sent');logger[_0x1fe9('0x12')](_0x1fe9('0x13'),_0x35d723,_0x1fe9('0x14'),JSON[_0x1fe9('0x15')](_0x4e0e6b));if(_0x4e0e6b[_0x1fe9('0x16')]){if(_0x4e0e6b['error'][_0x1fe9('0x17')]===0x1f4){logger[_0x1fe9('0x16')](_0x1fe9('0x11'),_0x35d723,_0x4e0e6b[_0x1fe9('0x16')]['message']);return _0x421381(_0x4e0e6b[_0x1fe9('0x16')][_0x1fe9('0x18')]);}logger[_0x1fe9('0x16')]('UserProfile,\x20%s,\x20%s',_0x35d723,_0x4e0e6b[_0x1fe9('0x16')][_0x1fe9('0x18')]);return _0x1c3089(_0x4e0e6b[_0x1fe9('0x16')]['message']);}else{logger[_0x1fe9('0x10')](_0x1fe9('0x11'),_0x35d723,_0x1fe9('0x14'));_0x1c3089(_0x4e0e6b['result'][_0x1fe9('0x18')]);}})['catch'](function(_0x2cc92e){logger[_0x1fe9('0x16')]('UserProfile,\x20%s,\x20%s',_0x35d723,_0x2cc92e);_0x421381(_0x2cc92e);});});} \ No newline at end of file diff --git a/server/api/userProfile/userProfile.socket.js b/server/api/userProfile/userProfile.socket.js index bf55689..0f32481 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 _0xa7d7=['remove','removeListener','length','userProfile:','./userProfile.events','save'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0xa7d7,0x1de));var _0x7a7d=function(_0x3c51d4,_0x36ba53){_0x3c51d4=_0x3c51d4-0x0;var _0x53c45f=_0xa7d7[_0x3c51d4];return _0x53c45f;};'use strict';var UserProfileEvents=require(_0x7a7d('0x0'));var events=[_0x7a7d('0x1'),_0x7a7d('0x2'),'update'];function createListener(_0x4f995c,_0x2beee1){return function(_0x245866){_0x2beee1['emit'](_0x4f995c,_0x245866);};}function removeListener(_0x2ce44f,_0xbcd723){return function(){UserProfileEvents[_0x7a7d('0x3')](_0x2ce44f,_0xbcd723);};}exports['register']=function(_0x55d5d3){for(var _0x25b6b2=0x0,_0x2ca3d2=events[_0x7a7d('0x4')];_0x25b6b2<_0x2ca3d2;_0x25b6b2++){var _0x33df06=events[_0x25b6b2];var _0x3b94e9=createListener(_0x7a7d('0x5')+_0x33df06,_0x55d5d3);UserProfileEvents['on'](_0x33df06,_0x3b94e9);}}; \ No newline at end of file +var _0x864c=['save','emit','removeListener','register','length','userProfile:'];(function(_0x2988de,_0x1273bd){var _0x29ace0=function(_0x38f226){while(--_0x38f226){_0x2988de['push'](_0x2988de['shift']());}};_0x29ace0(++_0x1273bd);}(_0x864c,0x156));var _0xc864=function(_0x2cfc78,_0xddc128){_0x2cfc78=_0x2cfc78-0x0;var _0x263b77=_0x864c[_0x2cfc78];return _0x263b77;};'use strict';var UserProfileEvents=require('./userProfile.events');var events=[_0xc864('0x0'),'remove','update'];function createListener(_0x320af0,_0x2def6b){return function(_0x245474){_0x2def6b[_0xc864('0x1')](_0x320af0,_0x245474);};}function removeListener(_0x322434,_0x34a9a9){return function(){UserProfileEvents[_0xc864('0x2')](_0x322434,_0x34a9a9);};}exports[_0xc864('0x3')]=function(_0x490408){for(var _0x34213e=0x0,_0x731296=events[_0xc864('0x4')];_0x34213e<_0x731296;_0x34213e++){var _0x55b109=events[_0x34213e];var _0x5110ce=createListener(_0xc864('0x5')+_0x55b109,_0x490408);UserProfileEvents['on'](_0x55b109,_0x5110ce);}}; \ No newline at end of file diff --git a/server/api/userProfileResource/index.js b/server/api/userProfileResource/index.js index fba12b7..c15fa86 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 _0x7565=['express','fs-extra','../../components/interaction/service','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','delete','exports','multer','util','connect-timeout'];(function(_0x5b998c,_0x445dec){var _0x391a5c=function(_0x37f93b){while(--_0x37f93b){_0x5b998c['push'](_0x5b998c['shift']());}};_0x391a5c(++_0x445dec);}(_0x7565,0x1ad));var _0x5756=function(_0x3bc583,_0x1c7d3c){_0x3bc583=_0x3bc583-0x0;var _0x6e46a=_0x7565[_0x3bc583];return _0x6e46a;};'use strict';var multer=require(_0x5756('0x0'));var util=require(_0x5756('0x1'));var path=require('path');var timeout=require(_0x5756('0x2'));var express=require(_0x5756('0x3'));var router=express['Router']();var fs_extra=require(_0x5756('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x5756('0x5'));var config=require('../../config/environment');var controller=require('./userProfileResource.controller');router[_0x5756('0x6')]('/',auth[_0x5756('0x7')](),controller[_0x5756('0x8')]);router['get'](_0x5756('0x9'),auth['isAuthenticated'](),controller[_0x5756('0xa')]);router[_0x5756('0x6')](_0x5756('0xb'),auth[_0x5756('0x7')](),controller[_0x5756('0xc')]);router[_0x5756('0xd')]('/',auth[_0x5756('0x7')](),controller[_0x5756('0xe')]);router[_0x5756('0xf')](_0x5756('0xb'),auth[_0x5756('0x7')](),controller['update']);router[_0x5756('0x10')](_0x5756('0xb'),auth['isAuthenticated'](),controller['destroy']);module[_0x5756('0x11')]=router; \ No newline at end of file +var _0xa67b=['Router','../../components/interaction/service','./userProfileResource.controller','isAuthenticated','index','get','/describe','/:id','show','post','create','put','update','delete','exports','multer','util','path','connect-timeout'];(function(_0x523135,_0x111316){var _0x5e8a36=function(_0x3220aa){while(--_0x3220aa){_0x523135['push'](_0x523135['shift']());}};_0x5e8a36(++_0x111316);}(_0xa67b,0x1c4));var _0xba67=function(_0x6bf1c5,_0x40ff86){_0x6bf1c5=_0x6bf1c5-0x0;var _0x5a6c40=_0xa67b[_0x6bf1c5];return _0x5a6c40;};'use strict';var multer=require(_0xba67('0x0'));var util=require(_0xba67('0x1'));var path=require(_0xba67('0x2'));var timeout=require(_0xba67('0x3'));var express=require('express');var router=express[_0xba67('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xba67('0x5'));var config=require('../../config/environment');var controller=require(_0xba67('0x6'));router['get']('/',auth[_0xba67('0x7')](),controller[_0xba67('0x8')]);router[_0xba67('0x9')](_0xba67('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0xba67('0x9')](_0xba67('0xb'),auth[_0xba67('0x7')](),controller[_0xba67('0xc')]);router[_0xba67('0xd')]('/',auth[_0xba67('0x7')](),controller[_0xba67('0xe')]);router[_0xba67('0xf')](_0xba67('0xb'),auth['isAuthenticated'](),controller[_0xba67('0x10')]);router[_0xba67('0x11')](_0xba67('0xb'),auth[_0xba67('0x7')](),controller['destroy']);module[_0xba67('0x12')]=router; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.attributes.js b/server/api/userProfileResource/userProfileResource.attributes.js index 5b375df..1a1c258 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 _0xf195=['STRING','sequelize','exports'];(function(_0x28493e,_0x316c05){var _0x565085=function(_0x50a711){while(--_0x50a711){_0x28493e['push'](_0x28493e['shift']());}};_0x565085(++_0x316c05);}(_0xf195,0x91));var _0x5f19=function(_0x22e47a,_0x4ea10c){_0x22e47a=_0x22e47a-0x0;var _0x15a12a=_0xf195[_0x22e47a];return _0x15a12a;};'use strict';var Sequelize=require(_0x5f19('0x0'));module[_0x5f19('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'resourceId':{'type':Sequelize['INTEGER'],'allowNull':![]},'type':{'type':Sequelize[_0x5f19('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0x80e3=['STRING','INTEGER'];(function(_0xd1c05d,_0x13d866){var _0x41eafb=function(_0xf11d15){while(--_0xf11d15){_0xd1c05d['push'](_0xd1c05d['shift']());}};_0x41eafb(++_0x13d866);}(_0x80e3,0x117));var _0x380e=function(_0x43812d,_0x93a580){_0x43812d=_0x43812d-0x0;var _0x452347=_0x80e3[_0x43812d];return _0x452347;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'resourceId':{'type':Sequelize[_0x380e('0x0')],'allowNull':![]},'type':{'type':Sequelize[_0x380e('0x1')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.controller.js b/server/api/userProfileResource/userProfileResource.controller.js index 31f1963..7107837 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 _0x896e=['hasOwnProperty','nolimit','order','sort','where','merge','filter','UserProfileResource','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(_0x565ed7,_0x398228){var _0x183ad7=function(_0x5a43d7){while(--_0x5a43d7){_0x565ed7['push'](_0x565ed7['shift']());}};_0x183ad7(++_0x398228);}(_0x896e,0x1e9));var _0xe896=function(_0x13fc01,_0x4f7fb9){_0x13fc01=_0x13fc01-0x0;var _0x1168c6=_0x896e[_0x13fc01];return _0x1168c6;};'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['UserProfileResource'][_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['UserProfileResource'][_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 _0xef0f=['json','apply','reject','save','update','destroy','then','error','stack','name','send','index','map','UserProfileResource','key','model','filters','intersection','query','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','VIRTUAL','filter','merge','options','includeAll','include','findAll','rows','params','keys','rawAttributes','find','create','body','catch','describe','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','Content-Range'];(function(_0x3cc607,_0x5d2399){var _0xf0bd45=function(_0x1f49c3){while(--_0x1f49c3){_0x3cc607['push'](_0x3cc607['shift']());}};_0xf0bd45(++_0x5d2399);}(_0xef0f,0x168));var _0xfef0=function(_0x25fdcd,_0x46eefb){_0x25fdcd=_0x25fdcd-0x0;var _0x47ab50=_0xef0f[_0x25fdcd];return _0x47ab50;};'use strict';var emlformat=require(_0xfef0('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xfef0('0x1'));var jsonpatch=require(_0xfef0('0x2'));var rp=require(_0xfef0('0x3'));var moment=require('moment');var BPromise=require(_0xfef0('0x4'));var Mustache=require(_0xfef0('0x5'));var util=require(_0xfef0('0x6'));var path=require('path');var sox=require(_0xfef0('0x7'));var csv=require(_0xfef0('0x8'));var ejs=require(_0xfef0('0x9'));var fs=require('fs');var fs_extra=require(_0xfef0('0xa'));var _=require(_0xfef0('0xb'));var squel=require(_0xfef0('0xc'));var crypto=require('crypto');var jsforce=require(_0xfef0('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xfef0('0x8'));var querystring=require(_0xfef0('0xe'));var Papa=require(_0xfef0('0xf'));var Redis=require(_0xfef0('0x10'));var authService=require(_0xfef0('0x11'));var qs=require(_0xfef0('0x12'));var as=require(_0xfef0('0x13'));var hardwareService=require(_0xfef0('0x14'));var logger=require(_0xfef0('0x15'))(_0xfef0('0x16'));var utils=require(_0xfef0('0x17'));var config=require(_0xfef0('0x18'));var licenseUtil=require(_0xfef0('0x19'));var db=require(_0xfef0('0x1a'))['db'];function respondWithStatusCode(_0x546c7a,_0x3135ab){_0x3135ab=_0x3135ab||0xcc;return function(_0x2f4e23){if(_0x2f4e23){return _0x546c7a[_0xfef0('0x1b')](_0x3135ab);}return _0x546c7a[_0xfef0('0x1c')](_0x3135ab)[_0xfef0('0x1d')]();};}function respondWithResult(_0x45599a,_0xa9f040){_0xa9f040=_0xa9f040||0xc8;return function(_0x573ae7){if(_0x573ae7){return _0x45599a[_0xfef0('0x1c')](_0xa9f040)['json'](_0x573ae7);}};}function respondWithFilteredResult(_0x4b5bcf,_0x5acdd0){return function(_0x118b8d){if(_0x118b8d){var _0x284b6d=typeof _0x5acdd0[_0xfef0('0x1e')]===_0xfef0('0x1f')&&typeof _0x5acdd0[_0xfef0('0x20')]===_0xfef0('0x1f');var _0x155833=_0x118b8d[_0xfef0('0x21')];var _0x581459=_0x284b6d?0x0:_0x5acdd0[_0xfef0('0x1e')];var _0x1642cd=_0x284b6d?_0x118b8d[_0xfef0('0x21')]:_0x5acdd0[_0xfef0('0x1e')]+_0x5acdd0[_0xfef0('0x20')];var _0x55912f;if(_0x1642cd>=_0x155833){_0x1642cd=_0x155833;_0x55912f=0xc8;}else{_0x55912f=0xce;}_0x4b5bcf[_0xfef0('0x1c')](_0x55912f);return _0x4b5bcf['set'](_0xfef0('0x22'),_0x581459+'-'+_0x1642cd+'/'+_0x155833)[_0xfef0('0x23')](_0x118b8d);}return null;};}function patchUpdates(_0x28dee1){return function(_0x48408a){try{jsonpatch[_0xfef0('0x24')](_0x48408a,_0x28dee1,!![]);}catch(_0x4c304d){return BPromise[_0xfef0('0x25')](_0x4c304d);}return _0x48408a[_0xfef0('0x26')]();};}function saveUpdates(_0x52b93b,_0x4897af){return function(_0x4b8b22){if(_0x4b8b22){return _0x4b8b22[_0xfef0('0x27')](_0x52b93b)['then'](function(_0x1f9970){return _0x1f9970;});}return null;};}function removeEntity(_0x46b34a,_0x1a8d66){return function(_0x4483f2){if(_0x4483f2){return _0x4483f2[_0xfef0('0x28')]()[_0xfef0('0x29')](function(){_0x46b34a['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x316e20,_0x1ffaa4){return function(_0x924f6e){if(!_0x924f6e){_0x316e20[_0xfef0('0x1b')](0x194);}return _0x924f6e;};}function handleError(_0xab231c,_0xf60f2){_0xf60f2=_0xf60f2||0x1f4;return function(_0x5df04f){logger[_0xfef0('0x2a')](_0x5df04f[_0xfef0('0x2b')]);if(_0x5df04f['name']){delete _0x5df04f[_0xfef0('0x2c')];}_0xab231c[_0xfef0('0x1c')](_0xf60f2)[_0xfef0('0x2d')](_0x5df04f);};}exports[_0xfef0('0x2e')]=function(_0x37921f,_0x1ac4a3){var _0x3e3c4c={},_0x3e026a={},_0x26cb9a={'count':0x0,'rows':[]};var _0x213a91=_[_0xfef0('0x2f')](db[_0xfef0('0x30')]['rawAttributes'],function(_0x445625){return{'name':_0x445625['fieldName'],'type':_0x445625['type'][_0xfef0('0x31')]};});_0x3e026a[_0xfef0('0x32')]=_['map'](_0x213a91,'name');_0x3e026a['query']=_['keys'](_0x37921f['query']);_0x3e026a[_0xfef0('0x33')]=_[_0xfef0('0x34')](_0x3e026a[_0xfef0('0x32')],_0x3e026a['query']);_0x3e3c4c['attributes']=_['intersection'](_0x3e026a[_0xfef0('0x32')],qs['fields'](_0x37921f[_0xfef0('0x35')][_0xfef0('0x36')]));_0x3e3c4c[_0xfef0('0x37')]=_0x3e3c4c['attributes'][_0xfef0('0x38')]?_0x3e3c4c['attributes']:_0x3e026a[_0xfef0('0x32')];if(!_0x37921f[_0xfef0('0x35')][_0xfef0('0x39')](_0xfef0('0x3a'))){_0x3e3c4c[_0xfef0('0x20')]=qs[_0xfef0('0x20')](_0x37921f[_0xfef0('0x35')][_0xfef0('0x20')]);_0x3e3c4c['offset']=qs[_0xfef0('0x1e')](_0x37921f[_0xfef0('0x35')][_0xfef0('0x1e')]);}_0x3e3c4c[_0xfef0('0x3b')]=qs[_0xfef0('0x3c')](_0x37921f[_0xfef0('0x35')][_0xfef0('0x3c')]);_0x3e3c4c[_0xfef0('0x3d')]=qs[_0xfef0('0x33')](_[_0xfef0('0x3e')](_0x37921f[_0xfef0('0x35')],_0x3e026a[_0xfef0('0x33')]),_0x213a91);if(_0x37921f[_0xfef0('0x35')]['filter']){_0x3e3c4c[_0xfef0('0x3d')]=_['merge'](_0x3e3c4c[_0xfef0('0x3d')],{'$or':_[_0xfef0('0x2f')](_0x213a91,function(_0x1ddce6){if(_0x1ddce6['type']!==_0xfef0('0x3f')){var _0x29469e={};_0x29469e[_0x1ddce6[_0xfef0('0x2c')]]={'$like':'%'+_0x37921f['query'][_0xfef0('0x40')]+'%'};return _0x29469e;}})});}_0x3e3c4c=_[_0xfef0('0x41')]({},_0x3e3c4c,_0x37921f[_0xfef0('0x42')]);var _0x5577f4={'where':_0x3e3c4c[_0xfef0('0x3d')]};return db['UserProfileResource']['count'](_0x5577f4)[_0xfef0('0x29')](function(_0x547a5d){_0x26cb9a['count']=_0x547a5d;if(_0x37921f[_0xfef0('0x35')][_0xfef0('0x43')]){_0x3e3c4c[_0xfef0('0x44')]=[{'all':!![]}];}return db[_0xfef0('0x30')][_0xfef0('0x45')](_0x3e3c4c);})[_0xfef0('0x29')](function(_0x4dd8f8){_0x26cb9a[_0xfef0('0x46')]=_0x4dd8f8;return _0x26cb9a;})[_0xfef0('0x29')](respondWithFilteredResult(_0x1ac4a3,_0x3e3c4c))['catch'](handleError(_0x1ac4a3,null));};exports['show']=function(_0x1d554e,_0x5dc824){var _0x1fc518={'raw':![],'where':{'id':_0x1d554e[_0xfef0('0x47')]['id']}},_0x22c940={};_0x22c940[_0xfef0('0x32')]=_[_0xfef0('0x48')](db[_0xfef0('0x30')][_0xfef0('0x49')]);_0x22c940[_0xfef0('0x35')]=_['keys'](_0x1d554e[_0xfef0('0x35')]);_0x22c940['filters']=_['intersection'](_0x22c940[_0xfef0('0x32')],_0x22c940[_0xfef0('0x35')]);_0x1fc518['attributes']=_[_0xfef0('0x34')](_0x22c940['model'],qs[_0xfef0('0x36')](_0x1d554e[_0xfef0('0x35')][_0xfef0('0x36')]));_0x1fc518[_0xfef0('0x37')]=_0x1fc518['attributes'][_0xfef0('0x38')]?_0x1fc518[_0xfef0('0x37')]:_0x22c940['model'];if(_0x1d554e['query'][_0xfef0('0x43')]){_0x1fc518['include']=[{'all':!![]}];}_0x1fc518=_[_0xfef0('0x41')]({},_0x1fc518,_0x1d554e[_0xfef0('0x42')]);return db[_0xfef0('0x30')][_0xfef0('0x4a')](_0x1fc518)[_0xfef0('0x29')](handleEntityNotFound(_0x5dc824,null))[_0xfef0('0x29')](respondWithResult(_0x5dc824,null))['catch'](handleError(_0x5dc824,null));};exports[_0xfef0('0x4b')]=function(_0x559a28,_0x5a417e){return db[_0xfef0('0x30')][_0xfef0('0x4b')](_0x559a28[_0xfef0('0x4c')],{})['then'](respondWithResult(_0x5a417e,0xc9))[_0xfef0('0x4d')](handleError(_0x5a417e,null));};exports['update']=function(_0x5dd26b,_0x51f207){if(_0x5dd26b[_0xfef0('0x4c')]['id']){delete _0x5dd26b[_0xfef0('0x4c')]['id'];}return db[_0xfef0('0x30')][_0xfef0('0x4a')]({'where':{'id':_0x5dd26b[_0xfef0('0x47')]['id']}})[_0xfef0('0x29')](handleEntityNotFound(_0x51f207,null))[_0xfef0('0x29')](saveUpdates(_0x5dd26b[_0xfef0('0x4c')],null))[_0xfef0('0x29')](respondWithResult(_0x51f207,null))['catch'](handleError(_0x51f207,null));};exports['destroy']=function(_0x2bebec,_0x18e5ba){return db[_0xfef0('0x30')][_0xfef0('0x4a')]({'where':{'id':_0x2bebec[_0xfef0('0x47')]['id']}})[_0xfef0('0x29')](handleEntityNotFound(_0x18e5ba,null))[_0xfef0('0x29')](removeEntity(_0x18e5ba,null))[_0xfef0('0x4d')](handleError(_0x18e5ba,null));};exports['describe']=function(_0x2466e7,_0x19e449){return db[_0xfef0('0x30')][_0xfef0('0x4e')]()[_0xfef0('0x29')](respondWithResult(_0x19e449,null))['catch'](handleError(_0x19e449,null));}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.model.js b/server/api/userProfileResource/userProfileResource.model.js index a7348c5..bd80e9a 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 _0x3c8e=['api','moment','bluebird','path','rimraf','../../config/environment','exports','define','UserProfileResource','compositeIndex','resourceId','sectionId','lodash','util','../../config/logger'];(function(_0x4d5514,_0x3c0460){var _0x4bf726=function(_0x24b1a8){while(--_0x24b1a8){_0x4d5514['push'](_0x4d5514['shift']());}};_0x4bf726(++_0x3c0460);}(_0x3c8e,0xc0));var _0xe3c8=function(_0x386dae,_0x4ac649){_0x386dae=_0x386dae-0x0;var _0x111990=_0x3c8e[_0x386dae];return _0x111990;};'use strict';var _=require(_0xe3c8('0x0'));var util=require(_0xe3c8('0x1'));var logger=require(_0xe3c8('0x2'))(_0xe3c8('0x3'));var moment=require(_0xe3c8('0x4'));var BPromise=require(_0xe3c8('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe3c8('0x6'));var rimraf=require(_0xe3c8('0x7'));var config=require(_0xe3c8('0x8'));var attributes=require('./userProfileResource.attributes');module[_0xe3c8('0x9')]=function(_0x4ba9b3,_0x5cff63){return _0x4ba9b3[_0xe3c8('0xa')](_0xe3c8('0xb'),attributes,{'tableName':'user_profile_has_resources','paranoid':![],'indexes':[{'name':_0xe3c8('0xc'),'fields':[_0xe3c8('0xd'),_0xe3c8('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xea5e=['./userProfileResource.attributes','UserProfileResource','compositeIndex','resourceId','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x59e081,_0x11b24a){var _0x35cf0f=function(_0x4a8755){while(--_0x4a8755){_0x59e081['push'](_0x59e081['shift']());}};_0x35cf0f(++_0x11b24a);}(_0xea5e,0x115));var _0xeea5=function(_0xf7f7f8,_0x2d9074){_0xf7f7f8=_0xf7f7f8-0x0;var _0x532fe3=_0xea5e[_0xf7f7f8];return _0x532fe3;};'use strict';var _=require(_0xeea5('0x0'));var util=require(_0xeea5('0x1'));var logger=require(_0xeea5('0x2'))(_0xeea5('0x3'));var moment=require(_0xeea5('0x4'));var BPromise=require(_0xeea5('0x5'));var rp=require(_0xeea5('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xeea5('0x7'));var config=require(_0xeea5('0x8'));var attributes=require(_0xeea5('0x9'));module['exports']=function(_0x3fd957,_0x1ce741){return _0x3fd957['define'](_0xeea5('0xa'),attributes,{'tableName':'user_profile_has_resources','paranoid':![],'indexes':[{'name':_0xeea5('0xb'),'fields':[_0xeea5('0xc'),'sectionId']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.rpc.js b/server/api/userProfileResource/userProfileResource.rpc.js index be54c50..2e86e02 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 _0x39dd=['util','moment','bluebird','randomstring','../../config/utils','../../config/environment','jayson/promise','http','info','UserProfileResource,\x20%s,\x20%s','request\x20sent','debug','UserProfileResource,\x20%s,\x20%s,\x20%s','error','code','message','lodash'];(function(_0x1a8d7a,_0x573579){var _0x1cd909=function(_0x536acb){while(--_0x536acb){_0x1a8d7a['push'](_0x1a8d7a['shift']());}};_0x1cd909(++_0x573579);}(_0x39dd,0x1db));var _0xd39d=function(_0x2b023d,_0x21bd4f){_0x2b023d=_0x2b023d-0x0;var _0x37158d=_0x39dd[_0x2b023d];return _0x37158d;};'use strict';var _=require(_0xd39d('0x0'));var util=require(_0xd39d('0x1'));var moment=require(_0xd39d('0x2'));var BPromise=require(_0xd39d('0x3'));var rs=require(_0xd39d('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xd39d('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0xd39d('0x6'));var jayson=require(_0xd39d('0x7'));var client=jayson['client'][_0xd39d('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x104849,_0x371b86,_0x1ee6ce){return new BPromise(function(_0x1ab036,_0x2fe7b2){return client['request'](_0x104849,_0x1ee6ce)['then'](function(_0x44a7a2){logger[_0xd39d('0x9')](_0xd39d('0xa'),_0x371b86,_0xd39d('0xb'));logger[_0xd39d('0xc')](_0xd39d('0xd'),_0x371b86,_0xd39d('0xb'),JSON['stringify'](_0x44a7a2));if(_0x44a7a2[_0xd39d('0xe')]){if(_0x44a7a2[_0xd39d('0xe')][_0xd39d('0xf')]===0x1f4){logger[_0xd39d('0xe')](_0xd39d('0xa'),_0x371b86,_0x44a7a2['error'][_0xd39d('0x10')]);return _0x2fe7b2(_0x44a7a2['error']['message']);}logger[_0xd39d('0xe')]('UserProfileResource,\x20%s,\x20%s',_0x371b86,_0x44a7a2['error'][_0xd39d('0x10')]);return _0x1ab036(_0x44a7a2[_0xd39d('0xe')][_0xd39d('0x10')]);}else{logger['info'](_0xd39d('0xa'),_0x371b86,'request\x20sent');_0x1ab036(_0x44a7a2['result'][_0xd39d('0x10')]);}})['catch'](function(_0x5c79a5){logger[_0xd39d('0xe')]('UserProfileResource,\x20%s,\x20%s',_0x371b86,_0x5c79a5);_0x2fe7b2(_0x5c79a5);});});} \ No newline at end of file +var _0x898c=['ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','UserProfileResource,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring'];(function(_0x583cf0,_0x2db411){var _0x3244ed=function(_0x24375d){while(--_0x24375d){_0x583cf0['push'](_0x583cf0['shift']());}};_0x3244ed(++_0x2db411);}(_0x898c,0x73));var _0xc898=function(_0x3c083b,_0x549e68){_0x3c083b=_0x3c083b-0x0;var _0x1c4f50=_0x898c[_0x3c083b];return _0x1c4f50;};'use strict';var _=require(_0xc898('0x0'));var util=require(_0xc898('0x1'));var moment=require(_0xc898('0x2'));var BPromise=require(_0xc898('0x3'));var rs=require(_0xc898('0x4'));var fs=require('fs');var Redis=require(_0xc898('0x5'));var db=require(_0xc898('0x6'))['db'];var utils=require(_0xc898('0x7'));var logger=require(_0xc898('0x8'))('rpc');var config=require(_0xc898('0x9'));var jayson=require(_0xc898('0xa'));var client=jayson[_0xc898('0xb')][_0xc898('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x27a234,_0x51b9b8,_0x7366e1){return new BPromise(function(_0x5c427b,_0x28113e){return client[_0xc898('0xd')](_0x27a234,_0x7366e1)[_0xc898('0xe')](function(_0x45f049){logger[_0xc898('0xf')](_0xc898('0x10'),_0x51b9b8,_0xc898('0x11'));logger[_0xc898('0x12')]('UserProfileResource,\x20%s,\x20%s,\x20%s',_0x51b9b8,_0xc898('0x11'),JSON[_0xc898('0x13')](_0x45f049));if(_0x45f049[_0xc898('0x14')]){if(_0x45f049['error'][_0xc898('0x15')]===0x1f4){logger[_0xc898('0x14')](_0xc898('0x10'),_0x51b9b8,_0x45f049['error'][_0xc898('0x16')]);return _0x28113e(_0x45f049[_0xc898('0x14')][_0xc898('0x16')]);}logger[_0xc898('0x14')](_0xc898('0x10'),_0x51b9b8,_0x45f049[_0xc898('0x14')][_0xc898('0x16')]);return _0x5c427b(_0x45f049[_0xc898('0x14')][_0xc898('0x16')]);}else{logger[_0xc898('0xf')](_0xc898('0x10'),_0x51b9b8,_0xc898('0x11'));_0x5c427b(_0x45f049['result'][_0xc898('0x16')]);}})[_0xc898('0x17')](function(_0x4b18ed){logger[_0xc898('0x14')](_0xc898('0x10'),_0x51b9b8,_0x4b18ed);_0x28113e(_0x4b18ed);});});} \ No newline at end of file diff --git a/server/api/userProfileSection/index.js b/server/api/userProfileSection/index.js index a6faadc..9a0404c 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 _0x8bec=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','describe','/:id','show','post','create','put','update','destroy','exports','multer','util','path'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x8bec,0x105));var _0xc8be=function(_0x336ecc,_0x2f4f91){_0x336ecc=_0x336ecc-0x0;var _0x36a593=_0x8bec[_0x336ecc];return _0x36a593;};'use strict';var multer=require(_0xc8be('0x0'));var util=require(_0xc8be('0x1'));var path=require(_0xc8be('0x2'));var timeout=require(_0xc8be('0x3'));var express=require(_0xc8be('0x4'));var router=express[_0xc8be('0x5')]();var fs_extra=require(_0xc8be('0x6'));var auth=require(_0xc8be('0x7'));var interaction=require(_0xc8be('0x8'));var config=require(_0xc8be('0x9'));var controller=require('./userProfileSection.controller');router[_0xc8be('0xa')]('/',auth[_0xc8be('0xb')](),controller[_0xc8be('0xc')]);router[_0xc8be('0xa')]('/describe',auth[_0xc8be('0xb')](),controller[_0xc8be('0xd')]);router[_0xc8be('0xa')](_0xc8be('0xe'),auth[_0xc8be('0xb')](),controller[_0xc8be('0xf')]);router[_0xc8be('0x10')]('/',auth[_0xc8be('0xb')](),controller[_0xc8be('0x11')]);router[_0xc8be('0x12')](_0xc8be('0xe'),auth['isAuthenticated'](),controller[_0xc8be('0x13')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xc8be('0x14')]);module[_0xc8be('0x15')]=router; \ No newline at end of file +var _0x6808=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','./userProfileSection.controller','get','isAuthenticated','index','/describe','describe','/:id','show','create','update','delete','destroy','exports','multer'];(function(_0x26956f,_0x76a7cc){var _0x30776d=function(_0x5f3152){while(--_0x5f3152){_0x26956f['push'](_0x26956f['shift']());}};_0x30776d(++_0x76a7cc);}(_0x6808,0x1af));var _0x8680=function(_0x1ea5ab,_0x145a47){_0x1ea5ab=_0x1ea5ab-0x0;var _0xc064e3=_0x6808[_0x1ea5ab];return _0xc064e3;};'use strict';var multer=require(_0x8680('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x8680('0x1')]();var fs_extra=require(_0x8680('0x2'));var auth=require(_0x8680('0x3'));var interaction=require(_0x8680('0x4'));var config=require('../../config/environment');var controller=require(_0x8680('0x5'));router[_0x8680('0x6')]('/',auth[_0x8680('0x7')](),controller[_0x8680('0x8')]);router[_0x8680('0x6')](_0x8680('0x9'),auth[_0x8680('0x7')](),controller[_0x8680('0xa')]);router[_0x8680('0x6')](_0x8680('0xb'),auth[_0x8680('0x7')](),controller[_0x8680('0xc')]);router['post']('/',auth['isAuthenticated'](),controller[_0x8680('0xd')]);router['put'](_0x8680('0xb'),auth['isAuthenticated'](),controller[_0x8680('0xe')]);router[_0x8680('0xf')](_0x8680('0xb'),auth[_0x8680('0x7')](),controller[_0x8680('0x10')]);module[_0x8680('0x11')]=router; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.attributes.js b/server/api/userProfileSection/userProfileSection.attributes.js index 438b88c..24f5bfc 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 _0xcf66=['getDataValue','crudPermissions','split','sequelize','exports','STRING','INTEGER','BOOLEAN','setDataValue','join'];(function(_0x36706e,_0x4e8324){var _0x939a51=function(_0x35b927){while(--_0x35b927){_0x36706e['push'](_0x36706e['shift']());}};_0x939a51(++_0x4e8324);}(_0xcf66,0x71));var _0x6cf6=function(_0x598fdc,_0x145c4a){_0x598fdc=_0x598fdc-0x0;var _0x2941cd=_0xcf66[_0x598fdc];return _0x2941cd;};'use strict';var Sequelize=require(_0x6cf6('0x0'));module[_0x6cf6('0x1')]={'name':{'type':Sequelize[_0x6cf6('0x2')],'allowNull':![]},'category':{'type':Sequelize['STRING'],'allowNull':![]},'sectionId':{'type':Sequelize[_0x6cf6('0x3')],'allowNull':![]},'enabled':{'type':Sequelize[_0x6cf6('0x4')],'defaultValue':null},'autoAssociation':{'type':Sequelize['BOOLEAN'],'defaultValue':null},'crudPermissions':{'type':Sequelize['STRING'],'set':function(_0x1c599d){this[_0x6cf6('0x5')]('crudPermissions',_0x1c599d?_0x1c599d[_0x6cf6('0x6')](''):[]);},'get':function(){return this[_0x6cf6('0x7')](_0x6cf6('0x8'))?this['getDataValue'](_0x6cf6('0x8'))[_0x6cf6('0x9')](''):[];}}}; \ No newline at end of file +var _0x3423=['STRING','INTEGER','BOOLEAN','setDataValue','crudPermissions','join','getDataValue','split'];(function(_0x553ad5,_0x33d279){var _0x540b0f=function(_0x5c7582){while(--_0x5c7582){_0x553ad5['push'](_0x553ad5['shift']());}};_0x540b0f(++_0x33d279);}(_0x3423,0x188));var _0x3342=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3423[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x3342('0x0')],'allowNull':![]},'category':{'type':Sequelize[_0x3342('0x0')],'allowNull':![]},'sectionId':{'type':Sequelize[_0x3342('0x1')],'allowNull':![]},'enabled':{'type':Sequelize[_0x3342('0x2')],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0x3342('0x2')],'defaultValue':null},'crudPermissions':{'type':Sequelize[_0x3342('0x0')],'set':function(_0x2207ce){this[_0x3342('0x3')](_0x3342('0x4'),_0x2207ce?_0x2207ce[_0x3342('0x5')](''):[]);},'get':function(){return this[_0x3342('0x6')](_0x3342('0x4'))?this[_0x3342('0x6')](_0x3342('0x4'))[_0x3342('0x7')](''):[];}}}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.controller.js b/server/api/userProfileSection/userProfileSection.controller.js index 2af28cd..00bc232 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 _0xa6b3=['../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','undefined','limit','count','offset','Content-Range','apply','then','destroy','sendStatus','error','stack','name','send','index','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','fields','attributes','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','UserProfileSection','includeAll','findAll','rows','catch','show','params','keys','length','find','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service'];(function(_0x4fded8,_0x29d666){var _0x8d5752=function(_0x43dc48){while(--_0x43dc48){_0x4fded8['push'](_0x4fded8['shift']());}};_0x8d5752(++_0x29d666);}(_0xa6b3,0xcc));var _0x3a6b=function(_0x7152aa,_0x433a7c){_0x7152aa=_0x7152aa-0x0;var _0x8ae18a=_0xa6b3[_0x7152aa];return _0x8ae18a;};'use strict';var emlformat=require(_0x3a6b('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x3a6b('0x1'));var jsonpatch=require(_0x3a6b('0x2'));var rp=require(_0x3a6b('0x3'));var moment=require(_0x3a6b('0x4'));var BPromise=require(_0x3a6b('0x5'));var Mustache=require('mustache');var util=require(_0x3a6b('0x6'));var path=require('path');var sox=require(_0x3a6b('0x7'));var csv=require('to-csv');var ejs=require(_0x3a6b('0x8'));var fs=require('fs');var fs_extra=require(_0x3a6b('0x9'));var _=require('lodash');var squel=require(_0x3a6b('0xa'));var crypto=require(_0x3a6b('0xb'));var jsforce=require(_0x3a6b('0xc'));var deskjs=require(_0x3a6b('0xd'));var toCsv=require(_0x3a6b('0xe'));var querystring=require('querystring');var Papa=require(_0x3a6b('0xf'));var Redis=require(_0x3a6b('0x10'));var authService=require(_0x3a6b('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x3a6b('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3a6b('0x13'))(_0x3a6b('0x14'));var utils=require(_0x3a6b('0x15'));var config=require(_0x3a6b('0x16'));var licenseUtil=require(_0x3a6b('0x17'));var db=require(_0x3a6b('0x18'))['db'];function respondWithStatusCode(_0x50a4ef,_0x205160){_0x205160=_0x205160||0xcc;return function(_0x16ffe1){if(_0x16ffe1){return _0x50a4ef['sendStatus'](_0x205160);}return _0x50a4ef['status'](_0x205160)[_0x3a6b('0x19')]();};}function respondWithResult(_0x1e0633,_0x382b54){_0x382b54=_0x382b54||0xc8;return function(_0x2b13cb){if(_0x2b13cb){return _0x1e0633[_0x3a6b('0x1a')](_0x382b54)[_0x3a6b('0x1b')](_0x2b13cb);}};}function respondWithFilteredResult(_0x1e44df,_0x2453e9){return function(_0x547fb7){if(_0x547fb7){var _0x23df32=typeof _0x2453e9['offset']===_0x3a6b('0x1c')&&typeof _0x2453e9[_0x3a6b('0x1d')]===_0x3a6b('0x1c');var _0x561f6a=_0x547fb7[_0x3a6b('0x1e')];var _0x5a4081=_0x23df32?0x0:_0x2453e9[_0x3a6b('0x1f')];var _0x2ad4c3=_0x23df32?_0x547fb7['count']:_0x2453e9['offset']+_0x2453e9[_0x3a6b('0x1d')];var _0x35e31d;if(_0x2ad4c3>=_0x561f6a){_0x2ad4c3=_0x561f6a;_0x35e31d=0xc8;}else{_0x35e31d=0xce;}_0x1e44df[_0x3a6b('0x1a')](_0x35e31d);return _0x1e44df['set'](_0x3a6b('0x20'),_0x5a4081+'-'+_0x2ad4c3+'/'+_0x561f6a)[_0x3a6b('0x1b')](_0x547fb7);}return null;};}function patchUpdates(_0x1bd4e1){return function(_0x57c8de){try{jsonpatch[_0x3a6b('0x21')](_0x57c8de,_0x1bd4e1,!![]);}catch(_0x1bedf2){return BPromise['reject'](_0x1bedf2);}return _0x57c8de['save']();};}function saveUpdates(_0x149026,_0x23bfa6){return function(_0x555792){if(_0x555792){return _0x555792['update'](_0x149026)[_0x3a6b('0x22')](function(_0x57ead4){return _0x57ead4;});}return null;};}function removeEntity(_0x5f0033,_0x151c56){return function(_0x31d6d6){if(_0x31d6d6){return _0x31d6d6[_0x3a6b('0x23')]()[_0x3a6b('0x22')](function(){_0x5f0033[_0x3a6b('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4aad4f,_0x1b7bed){return function(_0x371352){if(!_0x371352){_0x4aad4f[_0x3a6b('0x24')](0x194);}return _0x371352;};}function handleError(_0x5be987,_0x2bd377){_0x2bd377=_0x2bd377||0x1f4;return function(_0x32bcf7){logger[_0x3a6b('0x25')](_0x32bcf7[_0x3a6b('0x26')]);if(_0x32bcf7[_0x3a6b('0x27')]){delete _0x32bcf7[_0x3a6b('0x27')];}_0x5be987[_0x3a6b('0x1a')](_0x2bd377)[_0x3a6b('0x28')](_0x32bcf7);};}exports[_0x3a6b('0x29')]=function(_0x349f6b,_0x3bc38f){var _0x18cae9={},_0x3db106={},_0x702a70={'count':0x0,'rows':[]};var _0x443cbd=_['map'](db['UserProfileSection'][_0x3a6b('0x2a')],function(_0x223d16){return{'name':_0x223d16[_0x3a6b('0x2b')],'type':_0x223d16[_0x3a6b('0x2c')][_0x3a6b('0x2d')]};});_0x3db106[_0x3a6b('0x2e')]=_[_0x3a6b('0x2f')](_0x443cbd,_0x3a6b('0x27'));_0x3db106[_0x3a6b('0x30')]=_['keys'](_0x349f6b['query']);_0x3db106[_0x3a6b('0x31')]=_[_0x3a6b('0x32')](_0x3db106[_0x3a6b('0x2e')],_0x3db106[_0x3a6b('0x30')]);_0x18cae9['attributes']=_[_0x3a6b('0x32')](_0x3db106[_0x3a6b('0x2e')],qs[_0x3a6b('0x33')](_0x349f6b[_0x3a6b('0x30')]['fields']));_0x18cae9[_0x3a6b('0x34')]=_0x18cae9[_0x3a6b('0x34')]['length']?_0x18cae9[_0x3a6b('0x34')]:_0x3db106[_0x3a6b('0x2e')];if(!_0x349f6b['query']['hasOwnProperty'](_0x3a6b('0x35'))){_0x18cae9[_0x3a6b('0x1d')]=qs[_0x3a6b('0x1d')](_0x349f6b[_0x3a6b('0x30')][_0x3a6b('0x1d')]);_0x18cae9[_0x3a6b('0x1f')]=qs[_0x3a6b('0x1f')](_0x349f6b[_0x3a6b('0x30')][_0x3a6b('0x1f')]);}_0x18cae9[_0x3a6b('0x36')]=qs['sort'](_0x349f6b[_0x3a6b('0x30')][_0x3a6b('0x37')]);_0x18cae9[_0x3a6b('0x38')]=qs[_0x3a6b('0x31')](_[_0x3a6b('0x39')](_0x349f6b[_0x3a6b('0x30')],_0x3db106['filters']),_0x443cbd);if(_0x349f6b[_0x3a6b('0x30')][_0x3a6b('0x3a')]){_0x18cae9[_0x3a6b('0x38')]=_[_0x3a6b('0x3b')](_0x18cae9[_0x3a6b('0x38')],{'$or':_[_0x3a6b('0x2f')](_0x443cbd,function(_0x36b7d4){if(_0x36b7d4[_0x3a6b('0x2c')]!==_0x3a6b('0x3c')){var _0x3e8ddc={};_0x3e8ddc[_0x36b7d4['name']]={'$like':'%'+_0x349f6b[_0x3a6b('0x30')][_0x3a6b('0x3a')]+'%'};return _0x3e8ddc;}})});}_0x18cae9=_[_0x3a6b('0x3b')]({},_0x18cae9,_0x349f6b[_0x3a6b('0x3d')]);var _0x381de3={'where':_0x18cae9['where']};return db[_0x3a6b('0x3e')][_0x3a6b('0x1e')](_0x381de3)[_0x3a6b('0x22')](function(_0x1bd462){_0x702a70[_0x3a6b('0x1e')]=_0x1bd462;if(_0x349f6b[_0x3a6b('0x30')][_0x3a6b('0x3f')]){_0x18cae9['include']=[{'all':!![]}];}return db[_0x3a6b('0x3e')][_0x3a6b('0x40')](_0x18cae9);})[_0x3a6b('0x22')](function(_0x57bdbd){_0x702a70[_0x3a6b('0x41')]=_0x57bdbd;return _0x702a70;})['then'](respondWithFilteredResult(_0x3bc38f,_0x18cae9))[_0x3a6b('0x42')](handleError(_0x3bc38f,null));};exports[_0x3a6b('0x43')]=function(_0x4dda04,_0x2d8264){var _0x49fb71={'raw':![],'where':{'id':_0x4dda04[_0x3a6b('0x44')]['id']}},_0x331b01={};_0x331b01[_0x3a6b('0x2e')]=_[_0x3a6b('0x45')](db['UserProfileSection'][_0x3a6b('0x2a')]);_0x331b01[_0x3a6b('0x30')]=_[_0x3a6b('0x45')](_0x4dda04[_0x3a6b('0x30')]);_0x331b01['filters']=_[_0x3a6b('0x32')](_0x331b01['model'],_0x331b01[_0x3a6b('0x30')]);_0x49fb71['attributes']=_[_0x3a6b('0x32')](_0x331b01[_0x3a6b('0x2e')],qs['fields'](_0x4dda04[_0x3a6b('0x30')]['fields']));_0x49fb71['attributes']=_0x49fb71[_0x3a6b('0x34')][_0x3a6b('0x46')]?_0x49fb71[_0x3a6b('0x34')]:_0x331b01[_0x3a6b('0x2e')];if(_0x4dda04[_0x3a6b('0x30')][_0x3a6b('0x3f')]){_0x49fb71['include']=[{'all':!![]}];}_0x49fb71=_[_0x3a6b('0x3b')]({},_0x49fb71,_0x4dda04['options']);return db['UserProfileSection'][_0x3a6b('0x47')](_0x49fb71)[_0x3a6b('0x22')](handleEntityNotFound(_0x2d8264,null))['then'](respondWithResult(_0x2d8264,null))[_0x3a6b('0x42')](handleError(_0x2d8264,null));};exports['create']=function(_0x2c2777,_0x20cce4){return db[_0x3a6b('0x3e')]['create'](_0x2c2777[_0x3a6b('0x48')],{})[_0x3a6b('0x22')](respondWithResult(_0x20cce4,0xc9))['catch'](handleError(_0x20cce4,null));};exports['update']=function(_0x459a8e,_0x22ee47){if(_0x459a8e['body']['id']){delete _0x459a8e['body']['id'];}return db[_0x3a6b('0x3e')]['find']({'where':{'id':_0x459a8e[_0x3a6b('0x44')]['id']}})[_0x3a6b('0x22')](handleEntityNotFound(_0x22ee47,null))[_0x3a6b('0x22')](saveUpdates(_0x459a8e[_0x3a6b('0x48')],null))[_0x3a6b('0x22')](respondWithResult(_0x22ee47,null))['catch'](handleError(_0x22ee47,null));};exports[_0x3a6b('0x23')]=function(_0x3f1b67,_0x22f889){return db['UserProfileSection'][_0x3a6b('0x47')]({'where':{'id':_0x3f1b67[_0x3a6b('0x44')]['id']}})[_0x3a6b('0x22')](handleEntityNotFound(_0x22f889,null))['then'](removeEntity(_0x22f889,null))[_0x3a6b('0x42')](handleError(_0x22f889,null));};exports[_0x3a6b('0x49')]=function(_0x2484bd,_0x52e6c6){return db[_0x3a6b('0x3e')][_0x3a6b('0x49')]()[_0x3a6b('0x22')](respondWithResult(_0x52e6c6,null))[_0x3a6b('0x42')](handleError(_0x52e6c6,null));}; \ No newline at end of file +var _0x04b3=['status','Content-Range','apply','reject','save','update','destroy','then','stack','name','index','map','UserProfileSection','rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','pick','filter','where','VIRTUAL','merge','options','includeAll','include','findAll','rows','keys','find','catch','create','body','params','describe','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/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','limit','count','offset'];(function(_0x3c2c80,_0x3157a9){var _0x521cfd=function(_0x242b43){while(--_0x242b43){_0x3c2c80['push'](_0x3c2c80['shift']());}};_0x521cfd(++_0x3157a9);}(_0x04b3,0x1b2));var _0x304b=function(_0x2e0270,_0x52796f){_0x2e0270=_0x2e0270-0x0;var _0x2d8202=_0x04b3[_0x2e0270];return _0x2d8202;};'use strict';var emlformat=require(_0x304b('0x0'));var rimraf=require(_0x304b('0x1'));var zipdir=require(_0x304b('0x2'));var jsonpatch=require(_0x304b('0x3'));var rp=require(_0x304b('0x4'));var moment=require(_0x304b('0x5'));var BPromise=require(_0x304b('0x6'));var Mustache=require(_0x304b('0x7'));var util=require(_0x304b('0x8'));var path=require(_0x304b('0x9'));var sox=require(_0x304b('0xa'));var csv=require(_0x304b('0xb'));var ejs=require(_0x304b('0xc'));var fs=require('fs');var fs_extra=require(_0x304b('0xd'));var _=require(_0x304b('0xe'));var squel=require(_0x304b('0xf'));var crypto=require('crypto');var jsforce=require(_0x304b('0x10'));var deskjs=require(_0x304b('0x11'));var toCsv=require(_0x304b('0xb'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x304b('0x12'));var authService=require(_0x304b('0x13'));var qs=require(_0x304b('0x14'));var as=require(_0x304b('0x15'));var hardwareService=require(_0x304b('0x16'));var logger=require('../../config/logger')(_0x304b('0x17'));var utils=require(_0x304b('0x18'));var config=require(_0x304b('0x19'));var licenseUtil=require(_0x304b('0x1a'));var db=require(_0x304b('0x1b'))['db'];function respondWithStatusCode(_0x27c04f,_0xd02c7){_0xd02c7=_0xd02c7||0xcc;return function(_0x4ba736){if(_0x4ba736){return _0x27c04f[_0x304b('0x1c')](_0xd02c7);}return _0x27c04f['status'](_0xd02c7)[_0x304b('0x1d')]();};}function respondWithResult(_0x3c7a16,_0x2e30df){_0x2e30df=_0x2e30df||0xc8;return function(_0x1d7605){if(_0x1d7605){return _0x3c7a16['status'](_0x2e30df)[_0x304b('0x1e')](_0x1d7605);}};}function respondWithFilteredResult(_0x252aeb,_0x21b2fc){return function(_0x2af961){if(_0x2af961){var _0x2de054=typeof _0x21b2fc['offset']==='undefined'&&typeof _0x21b2fc[_0x304b('0x1f')]==='undefined';var _0x14a8a5=_0x2af961[_0x304b('0x20')];var _0x11f479=_0x2de054?0x0:_0x21b2fc[_0x304b('0x21')];var _0x5736b4=_0x2de054?_0x2af961[_0x304b('0x20')]:_0x21b2fc[_0x304b('0x21')]+_0x21b2fc[_0x304b('0x1f')];var _0x4df5a4;if(_0x5736b4>=_0x14a8a5){_0x5736b4=_0x14a8a5;_0x4df5a4=0xc8;}else{_0x4df5a4=0xce;}_0x252aeb[_0x304b('0x22')](_0x4df5a4);return _0x252aeb['set'](_0x304b('0x23'),_0x11f479+'-'+_0x5736b4+'/'+_0x14a8a5)[_0x304b('0x1e')](_0x2af961);}return null;};}function patchUpdates(_0x393d5f){return function(_0x51ed79){try{jsonpatch[_0x304b('0x24')](_0x51ed79,_0x393d5f,!![]);}catch(_0x3d9455){return BPromise[_0x304b('0x25')](_0x3d9455);}return _0x51ed79[_0x304b('0x26')]();};}function saveUpdates(_0x49cfce,_0x1b6825){return function(_0x2e5282){if(_0x2e5282){return _0x2e5282[_0x304b('0x27')](_0x49cfce)['then'](function(_0x152192){return _0x152192;});}return null;};}function removeEntity(_0x543f50,_0x507a81){return function(_0x4e8daf){if(_0x4e8daf){return _0x4e8daf[_0x304b('0x28')]()[_0x304b('0x29')](function(){_0x543f50[_0x304b('0x22')](0xcc)['end']();});}};}function handleEntityNotFound(_0x281cb7,_0x24e73f){return function(_0x30f5e7){if(!_0x30f5e7){_0x281cb7['sendStatus'](0x194);}return _0x30f5e7;};}function handleError(_0x233b03,_0xe5da00){_0xe5da00=_0xe5da00||0x1f4;return function(_0x543556){logger['error'](_0x543556[_0x304b('0x2a')]);if(_0x543556[_0x304b('0x2b')]){delete _0x543556['name'];}_0x233b03[_0x304b('0x22')](_0xe5da00)['send'](_0x543556);};}exports[_0x304b('0x2c')]=function(_0x38943d,_0x4b51df){var _0xa11847={},_0x63e92a={},_0x4f5be1={'count':0x0,'rows':[]};var _0x59023c=_[_0x304b('0x2d')](db[_0x304b('0x2e')][_0x304b('0x2f')],function(_0x1ff4c8){return{'name':_0x1ff4c8[_0x304b('0x30')],'type':_0x1ff4c8[_0x304b('0x31')][_0x304b('0x32')]};});_0x63e92a[_0x304b('0x33')]=_['map'](_0x59023c,_0x304b('0x2b'));_0x63e92a[_0x304b('0x34')]=_['keys'](_0x38943d[_0x304b('0x34')]);_0x63e92a[_0x304b('0x35')]=_['intersection'](_0x63e92a[_0x304b('0x33')],_0x63e92a[_0x304b('0x34')]);_0xa11847[_0x304b('0x36')]=_[_0x304b('0x37')](_0x63e92a[_0x304b('0x33')],qs['fields'](_0x38943d[_0x304b('0x34')][_0x304b('0x38')]));_0xa11847[_0x304b('0x36')]=_0xa11847['attributes'][_0x304b('0x39')]?_0xa11847[_0x304b('0x36')]:_0x63e92a[_0x304b('0x33')];if(!_0x38943d[_0x304b('0x34')][_0x304b('0x3a')](_0x304b('0x3b'))){_0xa11847[_0x304b('0x1f')]=qs[_0x304b('0x1f')](_0x38943d[_0x304b('0x34')][_0x304b('0x1f')]);_0xa11847[_0x304b('0x21')]=qs[_0x304b('0x21')](_0x38943d[_0x304b('0x34')]['offset']);}_0xa11847['order']=qs[_0x304b('0x3c')](_0x38943d['query'][_0x304b('0x3c')]);_0xa11847['where']=qs['filters'](_[_0x304b('0x3d')](_0x38943d['query'],_0x63e92a[_0x304b('0x35')]),_0x59023c);if(_0x38943d['query'][_0x304b('0x3e')]){_0xa11847['where']=_['merge'](_0xa11847[_0x304b('0x3f')],{'$or':_[_0x304b('0x2d')](_0x59023c,function(_0x51b7d0){if(_0x51b7d0[_0x304b('0x31')]!==_0x304b('0x40')){var _0x25559e={};_0x25559e[_0x51b7d0['name']]={'$like':'%'+_0x38943d[_0x304b('0x34')][_0x304b('0x3e')]+'%'};return _0x25559e;}})});}_0xa11847=_[_0x304b('0x41')]({},_0xa11847,_0x38943d[_0x304b('0x42')]);var _0x523348={'where':_0xa11847[_0x304b('0x3f')]};return db[_0x304b('0x2e')][_0x304b('0x20')](_0x523348)[_0x304b('0x29')](function(_0x4c83ef){_0x4f5be1[_0x304b('0x20')]=_0x4c83ef;if(_0x38943d[_0x304b('0x34')][_0x304b('0x43')]){_0xa11847[_0x304b('0x44')]=[{'all':!![]}];}return db[_0x304b('0x2e')][_0x304b('0x45')](_0xa11847);})[_0x304b('0x29')](function(_0x970083){_0x4f5be1[_0x304b('0x46')]=_0x970083;return _0x4f5be1;})[_0x304b('0x29')](respondWithFilteredResult(_0x4b51df,_0xa11847))['catch'](handleError(_0x4b51df,null));};exports['show']=function(_0x3e5355,_0x1e5e69){var _0xbe369b={'raw':![],'where':{'id':_0x3e5355['params']['id']}},_0x3c6a09={};_0x3c6a09[_0x304b('0x33')]=_[_0x304b('0x47')](db[_0x304b('0x2e')][_0x304b('0x2f')]);_0x3c6a09[_0x304b('0x34')]=_[_0x304b('0x47')](_0x3e5355[_0x304b('0x34')]);_0x3c6a09[_0x304b('0x35')]=_[_0x304b('0x37')](_0x3c6a09[_0x304b('0x33')],_0x3c6a09[_0x304b('0x34')]);_0xbe369b[_0x304b('0x36')]=_[_0x304b('0x37')](_0x3c6a09[_0x304b('0x33')],qs[_0x304b('0x38')](_0x3e5355[_0x304b('0x34')][_0x304b('0x38')]));_0xbe369b[_0x304b('0x36')]=_0xbe369b[_0x304b('0x36')][_0x304b('0x39')]?_0xbe369b[_0x304b('0x36')]:_0x3c6a09[_0x304b('0x33')];if(_0x3e5355[_0x304b('0x34')][_0x304b('0x43')]){_0xbe369b['include']=[{'all':!![]}];}_0xbe369b=_[_0x304b('0x41')]({},_0xbe369b,_0x3e5355[_0x304b('0x42')]);return db[_0x304b('0x2e')][_0x304b('0x48')](_0xbe369b)['then'](handleEntityNotFound(_0x1e5e69,null))[_0x304b('0x29')](respondWithResult(_0x1e5e69,null))[_0x304b('0x49')](handleError(_0x1e5e69,null));};exports[_0x304b('0x4a')]=function(_0x2c0cff,_0xcd571){return db[_0x304b('0x2e')][_0x304b('0x4a')](_0x2c0cff['body'],{})[_0x304b('0x29')](respondWithResult(_0xcd571,0xc9))[_0x304b('0x49')](handleError(_0xcd571,null));};exports[_0x304b('0x27')]=function(_0x275aea,_0x1ac285){if(_0x275aea[_0x304b('0x4b')]['id']){delete _0x275aea[_0x304b('0x4b')]['id'];}return db['UserProfileSection'][_0x304b('0x48')]({'where':{'id':_0x275aea['params']['id']}})['then'](handleEntityNotFound(_0x1ac285,null))[_0x304b('0x29')](saveUpdates(_0x275aea[_0x304b('0x4b')],null))[_0x304b('0x29')](respondWithResult(_0x1ac285,null))['catch'](handleError(_0x1ac285,null));};exports['destroy']=function(_0x496183,_0x311d8e){return db['UserProfileSection'][_0x304b('0x48')]({'where':{'id':_0x496183[_0x304b('0x4c')]['id']}})[_0x304b('0x29')](handleEntityNotFound(_0x311d8e,null))[_0x304b('0x29')](removeEntity(_0x311d8e,null))[_0x304b('0x49')](handleError(_0x311d8e,null));};exports['describe']=function(_0x357473,_0x9e7ce0){return db[_0x304b('0x2e')][_0x304b('0x4d')]()['then'](respondWithResult(_0x9e7ce0,null))[_0x304b('0x49')](handleError(_0x9e7ce0,null));}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.model.js b/server/api/userProfileSection/userProfileSection.model.js index 177c306..c13e159 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 _0xb458=['define','UserProfileSection','user_profile_has_sections','userProfileId','lodash','util','../../config/logger','bluebird','path','rimraf','../../config/environment','./userProfileSection.attributes'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb458,0x94));var _0x8b45=function(_0x1481d2,_0x2c97b0){_0x1481d2=_0x1481d2-0x0;var _0xeaa21f=_0xb458[_0x1481d2];return _0xeaa21f;};'use strict';var _=require(_0x8b45('0x0'));var util=require(_0x8b45('0x1'));var logger=require(_0x8b45('0x2'))('api');var moment=require('moment');var BPromise=require(_0x8b45('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8b45('0x4'));var rimraf=require(_0x8b45('0x5'));var config=require(_0x8b45('0x6'));var attributes=require(_0x8b45('0x7'));module['exports']=function(_0xfe8757,_0xd23b88){return _0xfe8757[_0x8b45('0x8')](_0x8b45('0x9'),attributes,{'tableName':_0x8b45('0xa'),'paranoid':![],'indexes':[{'name':'compositeIndex','fields':['sectionId',_0x8b45('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xadb3=['lodash','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','define','UserProfileSection','user_profile_has_sections','compositeIndex','sectionId','userProfileId'];(function(_0x29b564,_0x2d95bd){var _0xae0676=function(_0x4eedb8){while(--_0x4eedb8){_0x29b564['push'](_0x29b564['shift']());}};_0xae0676(++_0x2d95bd);}(_0xadb3,0x1b2));var _0x3adb=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0xadb3[_0x17d9e3];return _0x14192d;};'use strict';var _=require(_0x3adb('0x0'));var util=require('util');var logger=require(_0x3adb('0x1'))(_0x3adb('0x2'));var moment=require('moment');var BPromise=require(_0x3adb('0x3'));var rp=require(_0x3adb('0x4'));var fs=require('fs');var path=require(_0x3adb('0x5'));var rimraf=require(_0x3adb('0x6'));var config=require(_0x3adb('0x7'));var attributes=require('./userProfileSection.attributes');module['exports']=function(_0x24cb64,_0x1bf926){return _0x24cb64[_0x3adb('0x8')](_0x3adb('0x9'),attributes,{'tableName':_0x3adb('0xa'),'paranoid':![],'indexes':[{'name':_0x3adb('0xb'),'fields':[_0x3adb('0xc'),_0x3adb('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.rpc.js b/server/api/userProfileSection/userProfileSection.rpc.js index 8e09669..13c076c 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 _0x6912=['moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request\x20sent','debug','stringify','error','code','UserProfileSection,\x20%s,\x20%s','message','result','lodash'];(function(_0x3874b0,_0xca85bb){var _0x2f567e=function(_0xb2ab77){while(--_0xb2ab77){_0x3874b0['push'](_0x3874b0['shift']());}};_0x2f567e(++_0xca85bb);}(_0x6912,0x143));var _0x2691=function(_0x4316e2,_0x330345){_0x4316e2=_0x4316e2-0x0;var _0xafd62b=_0x6912[_0x4316e2];return _0xafd62b;};'use strict';var _=require(_0x2691('0x0'));var util=require('util');var moment=require(_0x2691('0x1'));var BPromise=require(_0x2691('0x2'));var rs=require(_0x2691('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2691('0x4'))['db'];var utils=require(_0x2691('0x5'));var logger=require(_0x2691('0x6'))('rpc');var config=require(_0x2691('0x7'));var jayson=require(_0x2691('0x8'));var client=jayson[_0x2691('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x8d3e71,_0x5d8c76,_0x4d474f){return new BPromise(function(_0x1c78f7,_0x2dd198){return client['request'](_0x8d3e71,_0x4d474f)['then'](function(_0x351d31){logger['info']('UserProfileSection,\x20%s,\x20%s',_0x5d8c76,_0x2691('0xa'));logger[_0x2691('0xb')]('UserProfileSection,\x20%s,\x20%s,\x20%s',_0x5d8c76,'request\x20sent',JSON[_0x2691('0xc')](_0x351d31));if(_0x351d31[_0x2691('0xd')]){if(_0x351d31[_0x2691('0xd')][_0x2691('0xe')]===0x1f4){logger[_0x2691('0xd')](_0x2691('0xf'),_0x5d8c76,_0x351d31[_0x2691('0xd')][_0x2691('0x10')]);return _0x2dd198(_0x351d31[_0x2691('0xd')]['message']);}logger['error'](_0x2691('0xf'),_0x5d8c76,_0x351d31[_0x2691('0xd')][_0x2691('0x10')]);return _0x1c78f7(_0x351d31[_0x2691('0xd')][_0x2691('0x10')]);}else{logger['info'](_0x2691('0xf'),_0x5d8c76,_0x2691('0xa'));_0x1c78f7(_0x351d31[_0x2691('0x11')][_0x2691('0x10')]);}})['catch'](function(_0x5310b6){logger[_0x2691('0xd')](_0x2691('0xf'),_0x5d8c76,_0x5310b6);_0x2dd198(_0x5310b6);});});} \ No newline at end of file +var _0x48db=['lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','UserProfileSection,\x20%s,\x20%s','stringify','error','code','message','info','result','catch'];(function(_0x2ea09b,_0x482527){var _0x13bcde=function(_0x2c5876){while(--_0x2c5876){_0x2ea09b['push'](_0x2ea09b['shift']());}};_0x13bcde(++_0x482527);}(_0x48db,0x1e4));var _0xb48d=function(_0x50e474,_0x43f310){_0x50e474=_0x50e474-0x0;var _0x3958d8=_0x48db[_0x50e474];return _0x3958d8;};'use strict';var _=require(_0xb48d('0x0'));var util=require(_0xb48d('0x1'));var moment=require(_0xb48d('0x2'));var BPromise=require(_0xb48d('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb48d('0x4'))['db'];var utils=require(_0xb48d('0x5'));var logger=require(_0xb48d('0x6'))(_0xb48d('0x7'));var config=require(_0xb48d('0x8'));var jayson=require(_0xb48d('0x9'));var client=jayson[_0xb48d('0xa')][_0xb48d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4f442f,_0x5acf6a,_0x22ea6b){return new BPromise(function(_0x11efef,_0x44f215){return client[_0xb48d('0xc')](_0x4f442f,_0x22ea6b)[_0xb48d('0xd')](function(_0x387ae6){logger['info'](_0xb48d('0xe'),_0x5acf6a,'request\x20sent');logger['debug']('UserProfileSection,\x20%s,\x20%s,\x20%s',_0x5acf6a,'request\x20sent',JSON[_0xb48d('0xf')](_0x387ae6));if(_0x387ae6[_0xb48d('0x10')]){if(_0x387ae6[_0xb48d('0x10')][_0xb48d('0x11')]===0x1f4){logger[_0xb48d('0x10')](_0xb48d('0xe'),_0x5acf6a,_0x387ae6[_0xb48d('0x10')]['message']);return _0x44f215(_0x387ae6[_0xb48d('0x10')][_0xb48d('0x12')]);}logger[_0xb48d('0x10')]('UserProfileSection,\x20%s,\x20%s',_0x5acf6a,_0x387ae6['error'][_0xb48d('0x12')]);return _0x11efef(_0x387ae6[_0xb48d('0x10')][_0xb48d('0x12')]);}else{logger[_0xb48d('0x13')](_0xb48d('0xe'),_0x5acf6a,'request\x20sent');_0x11efef(_0x387ae6[_0xb48d('0x14')][_0xb48d('0x12')]);}})[_0xb48d('0x15')](function(_0x51f9f1){logger['error'](_0xb48d('0xe'),_0x5acf6a,_0x51f9f1);_0x44f215(_0x51f9f1);});});} \ No newline at end of file diff --git a/server/api/userSmsQueue/index.js b/server/api/userSmsQueue/index.js index 1eee81d..341e9fa 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 _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x2838ec,_0x3bbd73){var _0x519b09=function(_0x1c1b64){while(--_0x1c1b64){_0x2838ec['push'](_0x2838ec['shift']());}};_0x519b09(++_0x3bbd73);}(_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(_0x58ebb1,_0x1d8ba4){var _0x2666fb=function(_0x522e3a){while(--_0x522e3a){_0x58ebb1['push'](_0x58ebb1['shift']());}};_0x2666fb(++_0x1d8ba4);}(_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/userSmsQueue/userSmsQueue.attributes.js b/server/api/userSmsQueue/userSmsQueue.attributes.js index 8b0bc5e..00a51ae 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 _0xd529=['INTEGER','sequelize','exports'];(function(_0x3c16ba,_0x36b6af){var _0x319547=function(_0x598a2d){while(--_0x598a2d){_0x3c16ba['push'](_0x3c16ba['shift']());}};_0x319547(++_0x36b6af);}(_0xd529,0x1c9));var _0x9d52=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0xd529[_0xfae23b];return _0x200640;};'use strict';var Sequelize=require(_0x9d52('0x0'));module[_0x9d52('0x1')]={'penalty':{'type':Sequelize[_0x9d52('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0xd9c5=['sequelize','INTEGER'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xd9c5,0x196));var _0x5d9c=function(_0x1a6c15,_0x22367e){_0x1a6c15=_0x1a6c15-0x0;var _0x292c5c=_0xd9c5[_0x1a6c15];return _0x292c5c;};'use strict';var Sequelize=require(_0x5d9c('0x0'));module['exports']={'penalty':{'type':Sequelize[_0x5d9c('0x1')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userSmsQueue/userSmsQueue.model.js b/server/api/userSmsQueue/userSmsQueue.model.js index a09494e..58c8135 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 _0xd117=['request-promise','path','rimraf','../../config/environment','./userSmsQueue.attributes','exports','define','UserSmsQueue','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x33554b,_0x48162b){var _0x256954=function(_0x185f66){while(--_0x185f66){_0x33554b['push'](_0x33554b['shift']());}};_0x256954(++_0x48162b);}(_0xd117,0x182));var _0x7d11=function(_0x616290,_0x280b7f){_0x616290=_0x616290-0x0;var _0x453879=_0xd117[_0x616290];return _0x453879;};'use strict';var _=require(_0x7d11('0x0'));var util=require(_0x7d11('0x1'));var logger=require(_0x7d11('0x2'))(_0x7d11('0x3'));var moment=require(_0x7d11('0x4'));var BPromise=require(_0x7d11('0x5'));var rp=require(_0x7d11('0x6'));var fs=require('fs');var path=require(_0x7d11('0x7'));var rimraf=require(_0x7d11('0x8'));var config=require(_0x7d11('0x9'));var attributes=require(_0x7d11('0xa'));module[_0x7d11('0xb')]=function(_0x27d7e8,_0x40c3c4){return _0x27d7e8[_0x7d11('0xc')](_0x7d11('0xd'),attributes,{'tableName':'user_has_sms_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xcb22=['./userSmsQueue.attributes','define','UserSmsQueue','user_has_sms_queues','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x5538a4,_0xe0b8b0){var _0x530a52=function(_0x1ebe09){while(--_0x1ebe09){_0x5538a4['push'](_0x5538a4['shift']());}};_0x530a52(++_0xe0b8b0);}(_0xcb22,0xc8));var _0x2cb2=function(_0x3601a7,_0x4c3985){_0x3601a7=_0x3601a7-0x0;var _0x50ba77=_0xcb22[_0x3601a7];return _0x50ba77;};'use strict';var _=require(_0x2cb2('0x0'));var util=require(_0x2cb2('0x1'));var logger=require(_0x2cb2('0x2'))(_0x2cb2('0x3'));var moment=require(_0x2cb2('0x4'));var BPromise=require(_0x2cb2('0x5'));var rp=require(_0x2cb2('0x6'));var fs=require('fs');var path=require(_0x2cb2('0x7'));var rimraf=require(_0x2cb2('0x8'));var config=require(_0x2cb2('0x9'));var attributes=require(_0x2cb2('0xa'));module['exports']=function(_0x77ae56,_0x3582d7){return _0x77ae56[_0x2cb2('0xb')](_0x2cb2('0xc'),attributes,{'tableName':_0x2cb2('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userSmsQueue/userSmsQueue.rpc.js b/server/api/userSmsQueue/userSmsQueue.rpc.js index 36d6454..76c986a 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 _0x8a48=['message','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','UserSmsQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error'];(function(_0x454165,_0x1f3e74){var _0x56db53=function(_0x23388c){while(--_0x23388c){_0x454165['push'](_0x454165['shift']());}};_0x56db53(++_0x1f3e74);}(_0x8a48,0x114));var _0x88a4=function(_0x109d73,_0x3925bb){_0x109d73=_0x109d73-0x0;var _0x56ed3a=_0x8a48[_0x109d73];return _0x56ed3a;};'use strict';var _=require(_0x88a4('0x0'));var util=require(_0x88a4('0x1'));var moment=require(_0x88a4('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x88a4('0x3'));var db=require(_0x88a4('0x4'))['db'];var utils=require(_0x88a4('0x5'));var logger=require(_0x88a4('0x6'))('rpc');var config=require(_0x88a4('0x7'));var jayson=require(_0x88a4('0x8'));var client=jayson[_0x88a4('0x9')][_0x88a4('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3a9a96,_0x3af2c9,_0x5506d8){return new BPromise(function(_0x598a8a,_0xf85838){return client[_0x88a4('0xb')](_0x3a9a96,_0x5506d8)['then'](function(_0x5e7ae1){logger[_0x88a4('0xc')](_0x88a4('0xd'),_0x3af2c9,_0x88a4('0xe'));logger[_0x88a4('0xf')]('UserSmsQueue,\x20%s,\x20%s,\x20%s',_0x3af2c9,_0x88a4('0xe'),JSON[_0x88a4('0x10')](_0x5e7ae1));if(_0x5e7ae1['error']){if(_0x5e7ae1[_0x88a4('0x11')]['code']===0x1f4){logger['error'](_0x88a4('0xd'),_0x3af2c9,_0x5e7ae1[_0x88a4('0x11')][_0x88a4('0x12')]);return _0xf85838(_0x5e7ae1[_0x88a4('0x11')]['message']);}logger['error'](_0x88a4('0xd'),_0x3af2c9,_0x5e7ae1['error'][_0x88a4('0x12')]);return _0x598a8a(_0x5e7ae1[_0x88a4('0x11')][_0x88a4('0x12')]);}else{logger['info']('UserSmsQueue,\x20%s,\x20%s',_0x3af2c9,_0x88a4('0xe'));_0x598a8a(_0x5e7ae1[_0x88a4('0x13')][_0x88a4('0x12')]);}})[_0x88a4('0x14')](function(_0xd5e885){logger[_0x88a4('0x11')]('UserSmsQueue,\x20%s,\x20%s',_0x3af2c9,_0xd5e885);_0xf85838(_0xd5e885);});});} \ No newline at end of file +var _0xa82c=['result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','request','then','info','UserSmsQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message'];(function(_0xde489f,_0x4eab25){var _0x336884=function(_0x40d578){while(--_0x40d578){_0xde489f['push'](_0xde489f['shift']());}};_0x336884(++_0x4eab25);}(_0xa82c,0x7a));var _0xca82=function(_0x3a2ca8,_0x36fdad){_0x3a2ca8=_0x3a2ca8-0x0;var _0x5579d0=_0xa82c[_0x3a2ca8];return _0x5579d0;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xca82('0x0'));var BPromise=require(_0xca82('0x1'));var rs=require(_0xca82('0x2'));var fs=require('fs');var Redis=require(_0xca82('0x3'));var db=require(_0xca82('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xca82('0x5'));var config=require(_0xca82('0x6'));var jayson=require(_0xca82('0x7'));var client=jayson[_0xca82('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3bf6e9,_0x114c25,_0x319ff5){return new BPromise(function(_0x1cab99,_0x1d0b3d){return client[_0xca82('0x9')](_0x3bf6e9,_0x319ff5)[_0xca82('0xa')](function(_0x1739b5){logger[_0xca82('0xb')](_0xca82('0xc'),_0x114c25,_0xca82('0xd'));logger[_0xca82('0xe')]('UserSmsQueue,\x20%s,\x20%s,\x20%s',_0x114c25,_0xca82('0xd'),JSON[_0xca82('0xf')](_0x1739b5));if(_0x1739b5[_0xca82('0x10')]){if(_0x1739b5[_0xca82('0x10')]['code']===0x1f4){logger[_0xca82('0x10')](_0xca82('0xc'),_0x114c25,_0x1739b5[_0xca82('0x10')][_0xca82('0x11')]);return _0x1d0b3d(_0x1739b5[_0xca82('0x10')]['message']);}logger[_0xca82('0x10')](_0xca82('0xc'),_0x114c25,_0x1739b5[_0xca82('0x10')][_0xca82('0x11')]);return _0x1cab99(_0x1739b5[_0xca82('0x10')]['message']);}else{logger[_0xca82('0xb')](_0xca82('0xc'),_0x114c25,'request\x20sent');_0x1cab99(_0x1739b5[_0xca82('0x12')][_0xca82('0x11')]);}})[_0xca82('0x13')](function(_0x3b8d22){logger['error'](_0xca82('0xc'),_0x114c25,_0x3b8d22);_0x1d0b3d(_0x3b8d22);});});} \ No newline at end of file diff --git a/server/api/userVoicePrefix/userVoicePrefix.attributes.js b/server/api/userVoicePrefix/userVoicePrefix.attributes.js index c141f1a..c7bd470 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 _0x7791=['exports','sequelize'];(function(_0xb2ce7a,_0x54db49){var _0x86b586=function(_0x4bbab0){while(--_0x4bbab0){_0xb2ce7a['push'](_0xb2ce7a['shift']());}};_0x86b586(++_0x54db49);}(_0x7791,0x177));var _0x1779=function(_0x488818,_0x17c6de){_0x488818=_0x488818-0x0;var _0x30783c=_0x7791[_0x488818];return _0x30783c;};'use strict';var Sequelize=require(_0x1779('0x0'));module[_0x1779('0x1')]={'UserId':{'type':Sequelize['INTEGER']},'VoicePrefixId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0x0a8c=['exports','INTEGER'];(function(_0x1da3ba,_0x449ae0){var _0x477c6b=function(_0x29646d){while(--_0x29646d){_0x1da3ba['push'](_0x1da3ba['shift']());}};_0x477c6b(++_0x449ae0);}(_0x0a8c,0x16e));var _0xc0a8=function(_0xa226b0,_0x167a45){_0xa226b0=_0xa226b0-0x0;var _0x13c645=_0x0a8c[_0xa226b0];return _0x13c645;};'use strict';var Sequelize=require('sequelize');module[_0xc0a8('0x0')]={'UserId':{'type':Sequelize['INTEGER']},'VoicePrefixId':{'type':Sequelize[_0xc0a8('0x1')]}}; \ No newline at end of file diff --git a/server/api/userVoicePrefix/userVoicePrefix.model.js b/server/api/userVoicePrefix/userVoicePrefix.model.js index e5199f9..f3f6331 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(_0x1297d1,_0x1d8ffd){var _0x4bfc5d=function(_0x4c3918){while(--_0x4c3918){_0x1297d1['push'](_0x1297d1['shift']());}};_0x4bfc5d(++_0x1d8ffd);}(_0xa9e0,0x123));var _0x0a9e=function(_0x484e36,_0x4482d8){_0x484e36=_0x484e36-0x0;var _0xafc85d=_0xa9e0[_0x484e36];return _0xafc85d;};'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(_0x24d9cf,_0x7b8910){var _0x3844ba=function(_0x232a26){while(--_0x232a26){_0x24d9cf['push'](_0x24d9cf['shift']());}};_0x3844ba(++_0x7b8910);}(_0xa9e0,0x123));var _0x0a9e=function(_0xbb091,_0x3fe7ee){_0xbb091=_0xbb091-0x0;var _0x467a04=_0xa9e0[_0xbb091];return _0x467a04;};'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 76ad106..f85d597 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 _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x17f57a,_0x38b2c4){var _0x38049c=function(_0x522e3a){while(--_0x522e3a){_0x17f57a['push'](_0x17f57a['shift']());}};_0x38049c(++_0x38b2c4);}(_0x70e0,0x17b));var _0x070e=function(_0x505ec0,_0x5c6123){_0x505ec0=_0x505ec0-0x0;var _0x5b6218=_0x70e0[_0x505ec0];return _0x5b6218;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router; \ No newline at end of file +var _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x49a141,_0x201be4){var _0xc3c314=function(_0x548692){while(--_0x548692){_0x49a141['push'](_0x49a141['shift']());}};_0xc3c314(++_0x201be4);}(_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/userVoiceQueue/userVoiceQueue.attributes.js b/server/api/userVoiceQueue/userVoiceQueue.attributes.js index 13e09c7..2842b83 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 _0xd68c=['sequelize'];(function(_0xb6a022,_0x51bd1e){var _0x5d0024=function(_0xe10563){while(--_0xe10563){_0xb6a022['push'](_0xb6a022['shift']());}};_0x5d0024(++_0x51bd1e);}(_0xd68c,0x113));var _0xcd68=function(_0xec9262,_0x3e62bd){_0xec9262=_0xec9262-0x0;var _0x19aeff=_0xd68c[_0xec9262];return _0x19aeff;};'use strict';var Sequelize=require(_0xcd68('0x0'));module['exports']={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x7732=['exports','sequelize'];(function(_0x143d85,_0x587c2f){var _0x733316=function(_0x5806d7){while(--_0x5806d7){_0x143d85['push'](_0x143d85['shift']());}};_0x733316(++_0x587c2f);}(_0x7732,0x135));var _0x2773=function(_0x3e3bee,_0x4f91fe){_0x3e3bee=_0x3e3bee-0x0;var _0x3ae14c=_0x7732[_0x3e3bee];return _0x3ae14c;};'use strict';var Sequelize=require(_0x2773('0x0'));module[_0x2773('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userVoiceQueue/userVoiceQueue.model.js b/server/api/userVoiceQueue/userVoiceQueue.model.js index 12dae60..e4e9041 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 _0xd83b=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','UserVoiceQueue','user_has_voice_queues'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xd83b,0xea));var _0xbd83=function(_0xf50d55,_0x37166b){_0xf50d55=_0xf50d55-0x0;var _0x3a8cf8=_0xd83b[_0xf50d55];return _0x3a8cf8;};'use strict';var _=require(_0xbd83('0x0'));var util=require(_0xbd83('0x1'));var logger=require(_0xbd83('0x2'))(_0xbd83('0x3'));var moment=require(_0xbd83('0x4'));var BPromise=require(_0xbd83('0x5'));var rp=require(_0xbd83('0x6'));var fs=require('fs');var path=require(_0xbd83('0x7'));var rimraf=require(_0xbd83('0x8'));var config=require(_0xbd83('0x9'));var attributes=require('./userVoiceQueue.attributes');module[_0xbd83('0xa')]=function(_0xc20248,_0x8a572d){return _0xc20248['define'](_0xbd83('0xb'),attributes,{'tableName':_0xbd83('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x49f9=['../../config/environment','./userVoiceQueue.attributes','exports','define','UserVoiceQueue','user_has_voice_queues','lodash','../../config/logger','request-promise','rimraf'];(function(_0xadaf72,_0x190c5e){var _0x3c9164=function(_0x1f56fd){while(--_0x1f56fd){_0xadaf72['push'](_0xadaf72['shift']());}};_0x3c9164(++_0x190c5e);}(_0x49f9,0x1aa));var _0x949f=function(_0x2f42d3,_0x362e7a){_0x2f42d3=_0x2f42d3-0x0;var _0x25a67e=_0x49f9[_0x2f42d3];return _0x25a67e;};'use strict';var _=require(_0x949f('0x0'));var util=require('util');var logger=require(_0x949f('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x949f('0x2'));var fs=require('fs');var path=require('path');var rimraf=require(_0x949f('0x3'));var config=require(_0x949f('0x4'));var attributes=require(_0x949f('0x5'));module[_0x949f('0x6')]=function(_0x5b131,_0x1eebf3){return _0x5b131[_0x949f('0x7')](_0x949f('0x8'),attributes,{'tableName':_0x949f('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userVoiceQueue/userVoiceQueue.rpc.js b/server/api/userVoiceQueue/userVoiceQueue.rpc.js index 7280f5c..99a2227 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 _0xd1d0=['jayson/promise','request','info','request\x20sent','debug','UserVoiceQueue,\x20%s,\x20%s,\x20%s','error','code','message','UserVoiceQueue,\x20%s,\x20%s','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x4c65b1,_0x29cd57){var _0xd33502=function(_0x217529){while(--_0x217529){_0x4c65b1['push'](_0x4c65b1['shift']());}};_0xd33502(++_0x29cd57);}(_0xd1d0,0x12a));var _0x0d1d=function(_0x23dcf1,_0x4a56b4){_0x23dcf1=_0x23dcf1-0x0;var _0x53d91a=_0xd1d0[_0x23dcf1];return _0x53d91a;};'use strict';var _=require('lodash');var util=require(_0x0d1d('0x0'));var moment=require(_0x0d1d('0x1'));var BPromise=require(_0x0d1d('0x2'));var rs=require(_0x0d1d('0x3'));var fs=require('fs');var Redis=require(_0x0d1d('0x4'));var db=require(_0x0d1d('0x5'))['db'];var utils=require(_0x0d1d('0x6'));var logger=require(_0x0d1d('0x7'))(_0x0d1d('0x8'));var config=require(_0x0d1d('0x9'));var jayson=require(_0x0d1d('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x5d4461,_0x566a77,_0xc0e227){return new BPromise(function(_0x204862,_0x3f1a9b){return client[_0x0d1d('0xb')](_0x5d4461,_0xc0e227)['then'](function(_0x54afa1){logger[_0x0d1d('0xc')]('UserVoiceQueue,\x20%s,\x20%s',_0x566a77,_0x0d1d('0xd'));logger[_0x0d1d('0xe')](_0x0d1d('0xf'),_0x566a77,_0x0d1d('0xd'),JSON['stringify'](_0x54afa1));if(_0x54afa1[_0x0d1d('0x10')]){if(_0x54afa1[_0x0d1d('0x10')][_0x0d1d('0x11')]===0x1f4){logger['error']('UserVoiceQueue,\x20%s,\x20%s',_0x566a77,_0x54afa1[_0x0d1d('0x10')]['message']);return _0x3f1a9b(_0x54afa1[_0x0d1d('0x10')][_0x0d1d('0x12')]);}logger[_0x0d1d('0x10')](_0x0d1d('0x13'),_0x566a77,_0x54afa1[_0x0d1d('0x10')][_0x0d1d('0x12')]);return _0x204862(_0x54afa1[_0x0d1d('0x10')][_0x0d1d('0x12')]);}else{logger['info'](_0x0d1d('0x13'),_0x566a77,'request\x20sent');_0x204862(_0x54afa1[_0x0d1d('0x14')][_0x0d1d('0x12')]);}})[_0x0d1d('0x15')](function(_0x2e8d0d){logger[_0x0d1d('0x10')](_0x0d1d('0x13'),_0x566a77,_0x2e8d0d);_0x3f1a9b(_0x2e8d0d);});});} \ No newline at end of file +var _0xfa03=['../../config/environment','then','info','UserVoiceQueue,\x20%s,\x20%s','request\x20sent','debug','UserVoiceQueue,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc'];(function(_0x44924c,_0x35a69e){var _0x1c9d5e=function(_0x15f227){while(--_0x15f227){_0x44924c['push'](_0x44924c['shift']());}};_0x1c9d5e(++_0x35a69e);}(_0xfa03,0xd4));var _0x3fa0=function(_0x3a99c9,_0x20e43d){_0x3a99c9=_0x3a99c9-0x0;var _0x596b6f=_0xfa03[_0x3a99c9];return _0x596b6f;};'use strict';var _=require(_0x3fa0('0x0'));var util=require(_0x3fa0('0x1'));var moment=require('moment');var BPromise=require(_0x3fa0('0x2'));var rs=require(_0x3fa0('0x3'));var fs=require('fs');var Redis=require(_0x3fa0('0x4'));var db=require(_0x3fa0('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x3fa0('0x6'))(_0x3fa0('0x7'));var config=require(_0x3fa0('0x8'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x49e4ad,_0x1e2235,_0x11b1d1){return new BPromise(function(_0x2db914,_0x33ed44){return client['request'](_0x49e4ad,_0x11b1d1)[_0x3fa0('0x9')](function(_0x23c345){logger[_0x3fa0('0xa')](_0x3fa0('0xb'),_0x1e2235,_0x3fa0('0xc'));logger[_0x3fa0('0xd')](_0x3fa0('0xe'),_0x1e2235,_0x3fa0('0xc'),JSON['stringify'](_0x23c345));if(_0x23c345['error']){if(_0x23c345['error'][_0x3fa0('0xf')]===0x1f4){logger[_0x3fa0('0x10')](_0x3fa0('0xb'),_0x1e2235,_0x23c345[_0x3fa0('0x10')][_0x3fa0('0x11')]);return _0x33ed44(_0x23c345['error'][_0x3fa0('0x11')]);}logger['error'](_0x3fa0('0xb'),_0x1e2235,_0x23c345[_0x3fa0('0x10')][_0x3fa0('0x11')]);return _0x2db914(_0x23c345[_0x3fa0('0x10')][_0x3fa0('0x11')]);}else{logger[_0x3fa0('0xa')](_0x3fa0('0xb'),_0x1e2235,_0x3fa0('0xc'));_0x2db914(_0x23c345[_0x3fa0('0x12')][_0x3fa0('0x11')]);}})[_0x3fa0('0x13')](function(_0x560a3e){logger[_0x3fa0('0x10')](_0x3fa0('0xb'),_0x1e2235,_0x560a3e);_0x33ed44(_0x560a3e);});});} \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/index.js b/server/api/userVoiceQueueRt/index.js index 8e901e8..26dae06 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 _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x419121,_0x274c1f){var _0x5b0309=function(_0x4138fc){while(--_0x4138fc){_0x419121['push'](_0x419121['shift']());}};_0x5b0309(++_0x274c1f);}(_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(_0x1a0139,_0xf3f49b){var _0x111033=function(_0x4ce1ae){while(--_0x4ce1ae){_0x1a0139['push'](_0x1a0139['shift']());}};_0x111033(++_0xf3f49b);}(_0x9c44,0x178));var _0x49c4=function(_0x565c49,_0x54acd0){_0x565c49=_0x565c49-0x0;var _0x20ca34=_0x9c44[_0x565c49];return _0x20ca34;};'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/userVoiceQueueRt/userVoiceQueueRt.attributes.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.attributes.js index d84f446..b4b201f 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 _0x8a87=['Required\x20by\x20Asterisk','STRING','queue_interface','sequelize','exports','INTEGER'];(function(_0xfd2cdf,_0x2cd792){var _0x14ee0b=function(_0x389840){while(--_0x389840){_0xfd2cdf['push'](_0xfd2cdf['shift']());}};_0x14ee0b(++_0x2cd792);}(_0x8a87,0x1b9));var _0x78a8=function(_0x219729,_0x19f07d){_0x219729=_0x219729-0x0;var _0x35c464=_0x8a87[_0x219729];return _0x35c464;};'use strict';var Sequelize=require(_0x78a8('0x0'));module[_0x78a8('0x1')]={'uniqueid':{'type':Sequelize[_0x78a8('0x2')],'primaryKey':!![],'autoIncrement':!![],'comment':_0x78a8('0x3')},'membername':{'type':Sequelize[_0x78a8('0x4')],'allowNull':![],'comment':_0x78a8('0x3')},'UserId':{'type':Sequelize[_0x78a8('0x2')],'allowNull':![]},'queue_name':{'type':Sequelize[_0x78a8('0x4')],'allowNull':![],'unique':'queue_interface','comment':_0x78a8('0x3')},'VoiceQueueId':{'type':Sequelize[_0x78a8('0x2')],'allowNull':![]},'interface':{'type':Sequelize[_0x78a8('0x4')],'allowNull':![],'unique':_0x78a8('0x5'),'comment':_0x78a8('0x3')},'penalty':{'type':Sequelize[_0x78a8('0x2')](0xb),'defaultValue':0x0,'comment':_0x78a8('0x3')},'paused':{'type':Sequelize[_0x78a8('0x2')](0xb),'defaultValue':0x0,'comment':'Required\x20by\x20Asterisk'}}; \ No newline at end of file +var _0x25fa=['sequelize','INTEGER','Required\x20by\x20Asterisk','STRING','queue_interface'];(function(_0x3a8422,_0x375c5b){var _0xf6e2b2=function(_0x57c13a){while(--_0x57c13a){_0x3a8422['push'](_0x3a8422['shift']());}};_0xf6e2b2(++_0x375c5b);}(_0x25fa,0x109));var _0xa25f=function(_0x1ea7ec,_0x41d130){_0x1ea7ec=_0x1ea7ec-0x0;var _0x4b91af=_0x25fa[_0x1ea7ec];return _0x4b91af;};'use strict';var Sequelize=require(_0xa25f('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0xa25f('0x1')],'primaryKey':!![],'autoIncrement':!![],'comment':_0xa25f('0x2')},'membername':{'type':Sequelize['STRING'],'allowNull':![],'comment':_0xa25f('0x2')},'UserId':{'type':Sequelize[_0xa25f('0x1')],'allowNull':![]},'queue_name':{'type':Sequelize[_0xa25f('0x3')],'allowNull':![],'unique':'queue_interface','comment':'Required\x20by\x20Asterisk'},'VoiceQueueId':{'type':Sequelize[_0xa25f('0x1')],'allowNull':![]},'interface':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xa25f('0x4'),'comment':_0xa25f('0x2')},'penalty':{'type':Sequelize[_0xa25f('0x1')](0xb),'defaultValue':0x0,'comment':_0xa25f('0x2')},'paused':{'type':Sequelize[_0xa25f('0x1')](0xb),'defaultValue':0x0,'comment':_0xa25f('0x2')}}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js index 2a72803..a35550e 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 _0x5d80=['setMaxListeners','save','update','remove','emit','hasOwnProperty','exports','../../mysqldb','UserVoiceQueueRt'];(function(_0x23371e,_0xb01919){var _0x4cdec5=function(_0x4257b7){while(--_0x4257b7){_0x23371e['push'](_0x23371e['shift']());}};_0x4cdec5(++_0xb01919);}(_0x5d80,0x139));var _0x05d8=function(_0x84fc4b,_0x27af7d){_0x84fc4b=_0x84fc4b-0x0;var _0x396fa7=_0x5d80[_0x84fc4b];return _0x396fa7;};'use strict';var EventEmitter=require('events');var UserVoiceQueueRt=require(_0x05d8('0x0'))['db'][_0x05d8('0x1')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0x05d8('0x2')](0x0);var events={'afterCreate':_0x05d8('0x3'),'afterUpdate':_0x05d8('0x4'),'afterDestroy':_0x05d8('0x5')};function emitEvent(_0x227f12){return function(_0x3f7ea7,_0x3556e9,_0x127cd0){UserVoiceQueueRtEvents[_0x05d8('0x6')](_0x227f12+':'+_0x3f7ea7['id'],_0x3f7ea7);UserVoiceQueueRtEvents[_0x05d8('0x6')](_0x227f12,_0x3f7ea7);_0x127cd0(null);};}for(var e in events){if(events[_0x05d8('0x7')](e)){var event=events[e];UserVoiceQueueRt['hook'](e,emitEvent(event));}}module[_0x05d8('0x8')]=UserVoiceQueueRtEvents; \ No newline at end of file +var _0x0510=['events','UserVoiceQueueRt','save','update','emit','hasOwnProperty','hook'];(function(_0x258aae,_0x2b168c){var _0x2eb624=function(_0x25ebc3){while(--_0x25ebc3){_0x258aae['push'](_0x258aae['shift']());}};_0x2eb624(++_0x2b168c);}(_0x0510,0x1a4));var _0x0051=function(_0x1baf15,_0x6f41b6){_0x1baf15=_0x1baf15-0x0;var _0xe0d5d8=_0x0510[_0x1baf15];return _0xe0d5d8;};'use strict';var EventEmitter=require(_0x0051('0x0'));var UserVoiceQueueRt=require('../../mysqldb')['db'][_0x0051('0x1')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x0051('0x2'),'afterUpdate':_0x0051('0x3'),'afterDestroy':'remove'};function emitEvent(_0x3ac0b2){return function(_0x435dee,_0x4f316b,_0x5642f8){UserVoiceQueueRtEvents[_0x0051('0x4')](_0x3ac0b2+':'+_0x435dee['id'],_0x435dee);UserVoiceQueueRtEvents[_0x0051('0x4')](_0x3ac0b2,_0x435dee);_0x5642f8(null);};}for(var e in events){if(events[_0x0051('0x5')](e)){var event=events[e];UserVoiceQueueRt[_0x0051('0x6')](e,emitEvent(event));}}module['exports']=UserVoiceQueueRtEvents; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.model.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.model.js index c66fcec..eadd43f 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 _0x3393=['bluebird','rimraf','../../config/environment','./userVoiceQueueRt.attributes','exports','UserVoiceQueueRt','user_has_voice_queues_rt','lodash','util','api','moment'];(function(_0x280a1f,_0x45f745){var _0x2f3965=function(_0x2ca10e){while(--_0x2ca10e){_0x280a1f['push'](_0x280a1f['shift']());}};_0x2f3965(++_0x45f745);}(_0x3393,0x13b));var _0x3339=function(_0x37e144,_0x392e17){_0x37e144=_0x37e144-0x0;var _0xa2e39e=_0x3393[_0x37e144];return _0xa2e39e;};'use strict';var _=require(_0x3339('0x0'));var util=require(_0x3339('0x1'));var logger=require('../../config/logger')(_0x3339('0x2'));var moment=require(_0x3339('0x3'));var BPromise=require(_0x3339('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x3339('0x5'));var config=require(_0x3339('0x6'));var attributes=require(_0x3339('0x7'));module[_0x3339('0x8')]=function(_0x26aa6b,_0x44b54e){return _0x26aa6b['define'](_0x3339('0x9'),attributes,{'tableName':_0x3339('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8338=['../../config/logger','api','moment','path','../../config/environment','./userVoiceQueueRt.attributes','exports','define','UserVoiceQueueRt','user_has_voice_queues_rt','lodash','util'];(function(_0x2c1a68,_0x161f70){var _0x5c932a=function(_0x5883ad){while(--_0x5883ad){_0x2c1a68['push'](_0x2c1a68['shift']());}};_0x5c932a(++_0x161f70);}(_0x8338,0x17e));var _0x8833=function(_0x5b5ce5,_0x2baab3){_0x5b5ce5=_0x5b5ce5-0x0;var _0x27fc49=_0x8338[_0x5b5ce5];return _0x27fc49;};'use strict';var _=require(_0x8833('0x0'));var util=require(_0x8833('0x1'));var logger=require(_0x8833('0x2'))(_0x8833('0x3'));var moment=require(_0x8833('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x8833('0x5'));var rimraf=require('rimraf');var config=require(_0x8833('0x6'));var attributes=require(_0x8833('0x7'));module[_0x8833('0x8')]=function(_0x1c4a4b,_0x2385fc){return _0x1c4a4b[_0x8833('0x9')](_0x8833('0xa'),attributes,{'tableName':_0x8833('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.rpc.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.rpc.js index 6236754..a9b265b 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 _0x9dcf=['defaults','redis','localhost','socket.io-emitter','./userVoiceQueueRt.socket','request','info','request\x20sent','debug','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s','stringify','error','message','UserVoiceQueueRt,\x20%s,\x20%s','result','catch','GetVoiceQueueRtPauses','findAll','options','raw','where','sequelize','COUNT','literal','`paused`\x20=\x201,\x201,\x20null','then','lodash','util','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise'];(function(_0x4ccd29,_0x3badcf){var _0x4a9565=function(_0xb2e1af){while(--_0xb2e1af){_0x4ccd29['push'](_0x4ccd29['shift']());}};_0x4a9565(++_0x3badcf);}(_0x9dcf,0x1a6));var _0xf9dc=function(_0xbcb09a,_0x4ce38b){_0xbcb09a=_0xbcb09a-0x0;var _0x2cf112=_0x9dcf[_0xbcb09a];return _0x2cf112;};'use strict';var _=require(_0xf9dc('0x0'));var util=require(_0xf9dc('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf9dc('0x2'));var db=require(_0xf9dc('0x3'))['db'];var utils=require(_0xf9dc('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0xf9dc('0x5'));var jayson=require(_0xf9dc('0x6'));var client=jayson['client']['http']({'port':0x232a});config['redis']=_[_0xf9dc('0x7')](config[_0xf9dc('0x8')],{'host':_0xf9dc('0x9'),'port':0x18eb});var socket=require(_0xf9dc('0xa'))(new Redis(config['redis']));require(_0xf9dc('0xb'))['register'](socket);function respondWithRpcPromise(_0x1646c4,_0x1b498c,_0x4d99b6){return new BPromise(function(_0x26f0ad,_0x2342f4){return client[_0xf9dc('0xc')](_0x1646c4,_0x4d99b6)['then'](function(_0x153c18){logger[_0xf9dc('0xd')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x1b498c,_0xf9dc('0xe'));logger[_0xf9dc('0xf')](_0xf9dc('0x10'),_0x1b498c,_0xf9dc('0xe'),JSON[_0xf9dc('0x11')](_0x153c18));if(_0x153c18[_0xf9dc('0x12')]){if(_0x153c18[_0xf9dc('0x12')]['code']===0x1f4){logger[_0xf9dc('0x12')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x1b498c,_0x153c18[_0xf9dc('0x12')][_0xf9dc('0x13')]);return _0x2342f4(_0x153c18['error']['message']);}logger[_0xf9dc('0x12')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x1b498c,_0x153c18[_0xf9dc('0x12')][_0xf9dc('0x13')]);return _0x26f0ad(_0x153c18[_0xf9dc('0x12')][_0xf9dc('0x13')]);}else{logger['info'](_0xf9dc('0x14'),_0x1b498c,_0xf9dc('0xe'));_0x26f0ad(_0x153c18[_0xf9dc('0x15')][_0xf9dc('0x13')]);}})[_0xf9dc('0x16')](function(_0x5ec058){logger['error'](_0xf9dc('0x14'),_0x1b498c,_0x5ec058);_0x2342f4(_0x5ec058);});});}exports[_0xf9dc('0x17')]=function(_0x414adc){var _0x105633=this;return new Promise(function(_0x4893cb,_0x4d1dc5){return db['UserVoiceQueueRt'][_0xf9dc('0x18')]({'raw':_0x414adc[_0xf9dc('0x19')]?_0x414adc[_0xf9dc('0x19')][_0xf9dc('0x1a')]===undefined?!![]:![]:!![],'where':_0x414adc[_0xf9dc('0x19')]?_0x414adc[_0xf9dc('0x19')][_0xf9dc('0x1b')]||null:null,'attributes':[[db[_0xf9dc('0x1c')]['fn'](_0xf9dc('0x1d'),db[_0xf9dc('0x1c')]['fn']('IF',db['sequelize'][_0xf9dc('0x1e')](_0xf9dc('0x1f')))),'outboundQueuePauses']]})[_0xf9dc('0x20')](function(_0x2136db){logger[_0xf9dc('0xd')]('GetVoiceQueueRtPauses',_0x414adc);logger[_0xf9dc('0xf')]('GetVoiceQueueRtPauses',_0x414adc,JSON['stringify'](_0x2136db));_0x4893cb(_0x2136db);})[_0xf9dc('0x16')](function(_0x278352){logger['error'](_0xf9dc('0x17'),_0x278352[_0xf9dc('0x13')],_0x414adc);_0x4d1dc5(_0x105633[_0xf9dc('0x12')](0x1f4,_0x278352['message']));});});}; \ No newline at end of file +var _0x22d0=['debug','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s','error','code','message','GetVoiceQueueRtPauses','findAll','options','raw','where','COUNT','sequelize','literal','`paused`\x20=\x201,\x201,\x20null','outboundQueuePauses','info','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./userVoiceQueueRt.socket','request','then','UserVoiceQueueRt,\x20%s,\x20%s','request\x20sent'];(function(_0x2a9f60,_0x51ec39){var _0x6560d4=function(_0x5d780e){while(--_0x5d780e){_0x2a9f60['push'](_0x2a9f60['shift']());}};_0x6560d4(++_0x51ec39);}(_0x22d0,0x141));var _0x022d=function(_0x3311ae,_0x362cee){_0x3311ae=_0x3311ae-0x0;var _0x107949=_0x22d0[_0x3311ae];return _0x107949;};'use strict';var _=require('lodash');var util=require(_0x022d('0x0'));var moment=require(_0x022d('0x1'));var BPromise=require('bluebird');var rs=require(_0x022d('0x2'));var fs=require('fs');var Redis=require(_0x022d('0x3'));var db=require(_0x022d('0x4'))['db'];var utils=require(_0x022d('0x5'));var logger=require(_0x022d('0x6'))(_0x022d('0x7'));var config=require(_0x022d('0x8'));var jayson=require(_0x022d('0x9'));var client=jayson[_0x022d('0xa')][_0x022d('0xb')]({'port':0x232a});config[_0x022d('0xc')]=_[_0x022d('0xd')](config[_0x022d('0xc')],{'host':_0x022d('0xe'),'port':0x18eb});var socket=require(_0x022d('0xf'))(new Redis(config[_0x022d('0xc')]));require(_0x022d('0x10'))['register'](socket);function respondWithRpcPromise(_0x1a77e4,_0x15a7ea,_0x5db82e){return new BPromise(function(_0x14c691,_0x320c5c){return client[_0x022d('0x11')](_0x1a77e4,_0x5db82e)[_0x022d('0x12')](function(_0x53f52c){logger['info'](_0x022d('0x13'),_0x15a7ea,_0x022d('0x14'));logger[_0x022d('0x15')](_0x022d('0x16'),_0x15a7ea,_0x022d('0x14'),JSON['stringify'](_0x53f52c));if(_0x53f52c['error']){if(_0x53f52c[_0x022d('0x17')][_0x022d('0x18')]===0x1f4){logger[_0x022d('0x17')](_0x022d('0x13'),_0x15a7ea,_0x53f52c[_0x022d('0x17')]['message']);return _0x320c5c(_0x53f52c[_0x022d('0x17')][_0x022d('0x19')]);}logger[_0x022d('0x17')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x15a7ea,_0x53f52c[_0x022d('0x17')][_0x022d('0x19')]);return _0x14c691(_0x53f52c[_0x022d('0x17')][_0x022d('0x19')]);}else{logger['info']('UserVoiceQueueRt,\x20%s,\x20%s',_0x15a7ea,_0x022d('0x14'));_0x14c691(_0x53f52c['result'][_0x022d('0x19')]);}})['catch'](function(_0x58cdb6){logger[_0x022d('0x17')](_0x022d('0x13'),_0x15a7ea,_0x58cdb6);_0x320c5c(_0x58cdb6);});});}exports[_0x022d('0x1a')]=function(_0x3afab9){var _0x5b5d29=this;return new Promise(function(_0x225a44,_0x339c69){return db['UserVoiceQueueRt'][_0x022d('0x1b')]({'raw':_0x3afab9[_0x022d('0x1c')]?_0x3afab9[_0x022d('0x1c')][_0x022d('0x1d')]===undefined?!![]:![]:!![],'where':_0x3afab9[_0x022d('0x1c')]?_0x3afab9[_0x022d('0x1c')][_0x022d('0x1e')]||null:null,'attributes':[[db['sequelize']['fn'](_0x022d('0x1f'),db[_0x022d('0x20')]['fn']('IF',db['sequelize'][_0x022d('0x21')](_0x022d('0x22')))),_0x022d('0x23')]]})[_0x022d('0x12')](function(_0x2d2ff5){logger[_0x022d('0x24')](_0x022d('0x1a'),_0x3afab9);logger[_0x022d('0x15')](_0x022d('0x1a'),_0x3afab9,JSON['stringify'](_0x2d2ff5));_0x225a44(_0x2d2ff5);})[_0x022d('0x25')](function(_0x1f9223){logger['error'](_0x022d('0x1a'),_0x1f9223[_0x022d('0x19')],_0x3afab9);_0x339c69(_0x5b5d29['error'](0x1f4,_0x1f9223[_0x022d('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js index 1e4521d..1f47999 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 _0xb194=['remove','update','register','length','./userVoiceQueueRt.events'];(function(_0x307d86,_0x9264f2){var _0x361745=function(_0x1b64e1){while(--_0x1b64e1){_0x307d86['push'](_0x307d86['shift']());}};_0x361745(++_0x9264f2);}(_0xb194,0x1b2));var _0x4b19=function(_0x49f85a,_0x3b00a1){_0x49f85a=_0x49f85a-0x0;var _0x1f188b=_0xb194[_0x49f85a];return _0x1f188b;};'use strict';var UserVoiceQueueRtEvents=require(_0x4b19('0x0'));var events=['save',_0x4b19('0x1'),_0x4b19('0x2')];function createListener(_0x10bd69,_0x2e77f6){return function(_0x3ba6e4){_0x2e77f6['emit'](_0x10bd69,_0x3ba6e4);};}function removeListener(_0x46faa3,_0x3a4700){return function(){UserVoiceQueueRtEvents['removeListener'](_0x46faa3,_0x3a4700);};}exports[_0x4b19('0x3')]=function(_0x570374){for(var _0x22033b=0x0,_0x5070da=events[_0x4b19('0x4')];_0x22033b<_0x5070da;_0x22033b++){var _0x3fb52e=events[_0x22033b];var _0x1dae50=createListener('userVoiceQueueRt:'+_0x3fb52e,_0x570374);UserVoiceQueueRtEvents['on'](_0x3fb52e,_0x1dae50);}}; \ No newline at end of file +var _0x565f=['remove','update','emit','length','save'];(function(_0x209fcd,_0x1ecccc){var _0x501d5e=function(_0x8d74fe){while(--_0x8d74fe){_0x209fcd['push'](_0x209fcd['shift']());}};_0x501d5e(++_0x1ecccc);}(_0x565f,0x68));var _0xf565=function(_0x57c40a,_0x3eb72){_0x57c40a=_0x57c40a-0x0;var _0x3f1ba4=_0x565f[_0x57c40a];return _0x3f1ba4;};'use strict';var UserVoiceQueueRtEvents=require('./userVoiceQueueRt.events');var events=[_0xf565('0x0'),_0xf565('0x1'),_0xf565('0x2')];function createListener(_0x5956e1,_0x2abeda){return function(_0x24f0ad){_0x2abeda[_0xf565('0x3')](_0x5956e1,_0x24f0ad);};}function removeListener(_0x44400f,_0x35e885){return function(){UserVoiceQueueRtEvents['removeListener'](_0x44400f,_0x35e885);};}exports['register']=function(_0x570631){for(var _0x19f3f8=0x0,_0x4cc0ea=events[_0xf565('0x4')];_0x19f3f8<_0x4cc0ea;_0x19f3f8++){var _0x45db1b=events[_0x19f3f8];var _0x43b686=createListener('userVoiceQueueRt:'+_0x45db1b,_0x570631);UserVoiceQueueRtEvents['on'](_0x45db1b,_0x43b686);}}; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/index.js b/server/api/userWhatsappQueue/index.js index 66e14fd..743f89c 100644 --- a/server/api/userWhatsappQueue/index.js +++ b/server/api/userWhatsappQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x592fe4,_0xa3d75d){var _0x48b30c=function(_0x4a29da){while(--_0x4a29da){_0x592fe4['push'](_0x592fe4['shift']());}};_0x48b30c(++_0xa3d75d);}(_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 +var _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x3a9b37,_0x17de7c){var _0x5dda80=function(_0x19e620){while(--_0x19e620){_0x3a9b37['push'](_0x3a9b37['shift']());}};_0x5dda80(++_0x17de7c);}(_0xe706,0xa3));var _0x6e70=function(_0x26b8b5,_0xf5c2c1){_0x26b8b5=_0x26b8b5-0x0;var _0x2150a9=_0xe706[_0x26b8b5];return _0x2150a9;};'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 f1aabae..c25cf2f 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 _0xbffa=['exports'];(function(_0x2c0ec4,_0x130d03){var _0x23fc3c=function(_0x691aec){while(--_0x691aec){_0x2c0ec4['push'](_0x2c0ec4['shift']());}};_0x23fc3c(++_0x130d03);}(_0xbffa,0x189));var _0xabff=function(_0x3fc81f,_0x325076){_0x3fc81f=_0x3fc81f-0x0;var _0x1a629e=_0xbffa[_0x3fc81f];return _0x1a629e;};'use strict';var Sequelize=require('sequelize');module[_0xabff('0x0')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x3122=['exports'];(function(_0x3658f9,_0x3e92b0){var _0x17718b=function(_0x113c6f){while(--_0x113c6f){_0x3658f9['push'](_0x3658f9['shift']());}};_0x17718b(++_0x3e92b0);}(_0x3122,0xe5));var _0x2312=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x3122[_0x167cc1];return _0x10bc4b;};'use strict';var Sequelize=require('sequelize');module[_0x2312('0x0')]={'penalty':{'type':Sequelize['INTEGER'],'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 3dc3311..cc16a15 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 _0x4d97=['lodash','util','api','moment','bluebird','request-promise','rimraf','../../config/environment','exports','define','UserWhatsappQueue','user_has_whatsapp_queues'];(function(_0x22541c,_0x5e7c24){var _0x2c5667=function(_0x45db16){while(--_0x45db16){_0x22541c['push'](_0x22541c['shift']());}};_0x2c5667(++_0x5e7c24);}(_0x4d97,0x1e0));var _0x74d9=function(_0x449230,_0x2f7418){_0x449230=_0x449230-0x0;var _0x71733=_0x4d97[_0x449230];return _0x71733;};'use strict';var _=require(_0x74d9('0x0'));var util=require(_0x74d9('0x1'));var logger=require('../../config/logger')(_0x74d9('0x2'));var moment=require(_0x74d9('0x3'));var BPromise=require(_0x74d9('0x4'));var rp=require(_0x74d9('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x74d9('0x6'));var config=require(_0x74d9('0x7'));var attributes=require('./userWhatsappQueue.attributes');module[_0x74d9('0x8')]=function(_0x36bd8b,_0x15442c){return _0x36bd8b[_0x74d9('0x9')](_0x74d9('0xa'),attributes,{'tableName':_0x74d9('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x695e=['define','UserWhatsappQueue','user_has_whatsapp_queues','lodash','util','../../config/logger','api','moment','path','rimraf','../../config/environment','exports'];(function(_0x38a88a,_0x3b659c){var _0x3e9952=function(_0x842a1d){while(--_0x842a1d){_0x38a88a['push'](_0x38a88a['shift']());}};_0x3e9952(++_0x3b659c);}(_0x695e,0x123));var _0xe695=function(_0x4c41c4,_0x75bc8a){_0x4c41c4=_0x4c41c4-0x0;var _0x2bdc48=_0x695e[_0x4c41c4];return _0x2bdc48;};'use strict';var _=require(_0xe695('0x0'));var util=require(_0xe695('0x1'));var logger=require(_0xe695('0x2'))(_0xe695('0x3'));var moment=require(_0xe695('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xe695('0x5'));var rimraf=require(_0xe695('0x6'));var config=require(_0xe695('0x7'));var attributes=require('./userWhatsappQueue.attributes');module[_0xe695('0x8')]=function(_0x4a6fee,_0x1911e2){return _0x4a6fee[_0xe695('0x9')](_0xe695('0xa'),attributes,{'tableName':_0xe695('0xb'),'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 0db8a7e..540b76c 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 _0xc009=['debug','UserWhatsappQueue,\x20%s,\x20%s,\x20%s','stringify','error','UserWhatsappQueue,\x20%s,\x20%s','message','request\x20sent','result','catch','lodash','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xc009,0x1ad));var _0x9c00=function(_0x57127b,_0x359e14){_0x57127b=_0x57127b-0x0;var _0x4e1dfc=_0xc009[_0x57127b];return _0x4e1dfc;};'use strict';var _=require(_0x9c00('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x9c00('0x1'));var rs=require(_0x9c00('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x9c00('0x3'));var logger=require(_0x9c00('0x4'))(_0x9c00('0x5'));var config=require(_0x9c00('0x6'));var jayson=require(_0x9c00('0x7'));var client=jayson[_0x9c00('0x8')][_0x9c00('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x50d3ba,_0x11b195,_0x177762){return new BPromise(function(_0x198a0c,_0xe8d436){return client['request'](_0x50d3ba,_0x177762)[_0x9c00('0xa')](function(_0x13a069){logger[_0x9c00('0xb')]('UserWhatsappQueue,\x20%s,\x20%s',_0x11b195,'request\x20sent');logger[_0x9c00('0xc')](_0x9c00('0xd'),_0x11b195,'request\x20sent',JSON[_0x9c00('0xe')](_0x13a069));if(_0x13a069[_0x9c00('0xf')]){if(_0x13a069['error']['code']===0x1f4){logger[_0x9c00('0xf')](_0x9c00('0x10'),_0x11b195,_0x13a069['error'][_0x9c00('0x11')]);return _0xe8d436(_0x13a069[_0x9c00('0xf')][_0x9c00('0x11')]);}logger[_0x9c00('0xf')]('UserWhatsappQueue,\x20%s,\x20%s',_0x11b195,_0x13a069[_0x9c00('0xf')][_0x9c00('0x11')]);return _0x198a0c(_0x13a069['error']['message']);}else{logger['info'](_0x9c00('0x10'),_0x11b195,_0x9c00('0x12'));_0x198a0c(_0x13a069[_0x9c00('0x13')][_0x9c00('0x11')]);}})[_0x9c00('0x14')](function(_0x304fc9){logger['error'](_0x9c00('0x10'),_0x11b195,_0x304fc9);_0xe8d436(_0x304fc9);});});} \ No newline at end of file +var _0x57d5=['moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','request\x20sent','debug','UserWhatsappQueue,\x20%s,\x20%s,\x20%s','error','code','UserWhatsappQueue,\x20%s,\x20%s','message','catch','util'];(function(_0x498fae,_0x13bbce){var _0x5b7623=function(_0x2b65e5){while(--_0x2b65e5){_0x498fae['push'](_0x498fae['shift']());}};_0x5b7623(++_0x13bbce);}(_0x57d5,0x1cd));var _0x557d=function(_0x1147ab,_0x10e72b){_0x1147ab=_0x1147ab-0x0;var _0x55cb5a=_0x57d5[_0x1147ab];return _0x55cb5a;};'use strict';var _=require('lodash');var util=require(_0x557d('0x0'));var moment=require(_0x557d('0x1'));var BPromise=require(_0x557d('0x2'));var rs=require(_0x557d('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x557d('0x4'))['db'];var utils=require(_0x557d('0x5'));var logger=require(_0x557d('0x6'))(_0x557d('0x7'));var config=require('../../config/environment');var jayson=require(_0x557d('0x8'));var client=jayson[_0x557d('0x9')][_0x557d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x37658c,_0x379378,_0x24bd71){return new BPromise(function(_0x4ff851,_0x1c868f){return client[_0x557d('0xb')](_0x37658c,_0x24bd71)[_0x557d('0xc')](function(_0x35ef84){logger[_0x557d('0xd')]('UserWhatsappQueue,\x20%s,\x20%s',_0x379378,_0x557d('0xe'));logger[_0x557d('0xf')](_0x557d('0x10'),_0x379378,_0x557d('0xe'),JSON['stringify'](_0x35ef84));if(_0x35ef84['error']){if(_0x35ef84[_0x557d('0x11')][_0x557d('0x12')]===0x1f4){logger[_0x557d('0x11')](_0x557d('0x13'),_0x379378,_0x35ef84[_0x557d('0x11')]['message']);return _0x1c868f(_0x35ef84[_0x557d('0x11')]['message']);}logger[_0x557d('0x11')](_0x557d('0x13'),_0x379378,_0x35ef84['error'][_0x557d('0x14')]);return _0x4ff851(_0x35ef84[_0x557d('0x11')]['message']);}else{logger[_0x557d('0xd')](_0x557d('0x13'),_0x379378,_0x557d('0xe'));_0x4ff851(_0x35ef84['result'][_0x557d('0x14')]);}})[_0x557d('0x15')](function(_0x2ffe7d){logger[_0x557d('0x11')](_0x557d('0x13'),_0x379378,_0x2ffe7d);_0x1c868f(_0x2ffe7d);});});} \ No newline at end of file diff --git a/server/api/variable/index.js b/server/api/variable/index.js index 7df4ffa..12bf79a 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 _0x55d2=['../../config/environment','./variable.controller','get','isAuthenticated','/:id','show','post','update','destroy','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x100682,_0x11afec){var _0xcb6e87=function(_0x3ef421){while(--_0x3ef421){_0x100682['push'](_0x100682['shift']());}};_0xcb6e87(++_0x11afec);}(_0x55d2,0x9f));var _0x255d=function(_0x1d4929,_0x6f0475){_0x1d4929=_0x1d4929-0x0;var _0x161ace=_0x55d2[_0x1d4929];return _0x161ace;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x255d('0x0'));var timeout=require(_0x255d('0x1'));var express=require(_0x255d('0x2'));var router=express[_0x255d('0x3')]();var fs_extra=require(_0x255d('0x4'));var auth=require(_0x255d('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x255d('0x6'));var controller=require(_0x255d('0x7'));router[_0x255d('0x8')]('/',auth[_0x255d('0x9')](),controller['index']);router['get'](_0x255d('0xa'),auth[_0x255d('0x9')](),controller[_0x255d('0xb')]);router[_0x255d('0xc')]('/',auth[_0x255d('0x9')](),controller['create']);router['put']('/:id',auth['isAuthenticated'](),controller[_0x255d('0xd')]);router['delete'](_0x255d('0xa'),auth[_0x255d('0x9')](),controller[_0x255d('0xe')]);module['exports']=router; \ No newline at end of file +var _0xccdc=['isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./variable.controller','get'];(function(_0x344a3f,_0x579a22){var _0x264712=function(_0x34c9f0){while(--_0x34c9f0){_0x344a3f['push'](_0x344a3f['shift']());}};_0x264712(++_0x579a22);}(_0xccdc,0x1c4));var _0xcccd=function(_0x455c6c,_0x1e78b7){_0x455c6c=_0x455c6c-0x0;var _0x488242=_0xccdc[_0x455c6c];return _0x488242;};'use strict';var multer=require(_0xcccd('0x0'));var util=require(_0xcccd('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xcccd('0x2'));var router=express[_0xcccd('0x3')]();var fs_extra=require(_0xcccd('0x4'));var auth=require(_0xcccd('0x5'));var interaction=require(_0xcccd('0x6'));var config=require(_0xcccd('0x7'));var controller=require(_0xcccd('0x8'));router[_0xcccd('0x9')]('/',auth[_0xcccd('0xa')](),controller[_0xcccd('0xb')]);router['get'](_0xcccd('0xc'),auth[_0xcccd('0xa')](),controller[_0xcccd('0xd')]);router[_0xcccd('0xe')]('/',auth[_0xcccd('0xa')](),controller[_0xcccd('0xf')]);router[_0xcccd('0x10')](_0xcccd('0xc'),auth['isAuthenticated'](),controller[_0xcccd('0x11')]);router[_0xcccd('0x12')](_0xcccd('0xc'),auth[_0xcccd('0xa')](),controller[_0xcccd('0x13')]);module[_0xcccd('0x14')]=router; \ No newline at end of file diff --git a/server/api/variable/variable.attributes.js b/server/api/variable/variable.attributes.js index 6ab550e..185ebe4 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 _0xe914=['exports','name','STRING','sequelize'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0xe914,0x7f));var _0x4e91=function(_0x59eff1,_0x32f796){_0x59eff1=_0x59eff1-0x0;var _0x15cac7=_0xe914[_0x59eff1];return _0x15cac7;};'use strict';var Sequelize=require(_0x4e91('0x0'));module[_0x4e91('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x4e91('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x4e91('0x3')]}}; \ No newline at end of file +var _0x663c=['sequelize','STRING','name'];(function(_0x426d81,_0x477f48){var _0x141f19=function(_0x20ef4d){while(--_0x20ef4d){_0x426d81['push'](_0x426d81['shift']());}};_0x141f19(++_0x477f48);}(_0x663c,0x1ef));var _0xc663=function(_0xe37f58,_0x1a167b){_0xe37f58=_0xe37f58-0x0;var _0x4dfcef=_0x663c[_0xe37f58];return _0x4dfcef;};'use strict';var Sequelize=require(_0xc663('0x0'));module['exports']={'name':{'type':Sequelize[_0xc663('0x1')],'unique':_0xc663('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xc663('0x1')]}}; \ No newline at end of file diff --git a/server/api/variable/variable.controller.js b/server/api/variable/variable.controller.js index 9f9247c..16da135 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 _0x7e1c=['UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','end','json','undefined','limit','count','offset','set','Content-Range','reject','then','destroy','get','name','send','index','map','fieldName','model','query','keys','filters','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','type','options','includeAll','include','Variable','rows','catch','show','params','rawAttributes','fields','find','create','user','role','Variables','UserProfileSection','userProfileId','autoAssociation'];(function(_0x48a874,_0x162412){var _0x465108=function(_0x28989b){while(--_0x28989b){_0x48a874['push'](_0x48a874['shift']());}};_0x465108(++_0x162412);}(_0x7e1c,0x1a4));var _0xc7e1=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7e1c[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xc7e1('0x0'));var rimraf=require(_0xc7e1('0x1'));var zipdir=require(_0xc7e1('0x2'));var jsonpatch=require(_0xc7e1('0x3'));var rp=require(_0xc7e1('0x4'));var moment=require(_0xc7e1('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xc7e1('0x6'));var util=require('util');var path=require(_0xc7e1('0x7'));var sox=require(_0xc7e1('0x8'));var csv=require(_0xc7e1('0x9'));var ejs=require(_0xc7e1('0xa'));var fs=require('fs');var fs_extra=require(_0xc7e1('0xb'));var _=require('lodash');var squel=require(_0xc7e1('0xc'));var crypto=require(_0xc7e1('0xd'));var jsforce=require(_0xc7e1('0xe'));var deskjs=require(_0xc7e1('0xf'));var toCsv=require(_0xc7e1('0x9'));var querystring=require(_0xc7e1('0x10'));var Papa=require(_0xc7e1('0x11'));var Redis=require(_0xc7e1('0x12'));var authService=require(_0xc7e1('0x13'));var qs=require(_0xc7e1('0x14'));var as=require(_0xc7e1('0x15'));var hardwareService=require(_0xc7e1('0x16'));var logger=require(_0xc7e1('0x17'))(_0xc7e1('0x18'));var utils=require(_0xc7e1('0x19'));var config=require(_0xc7e1('0x1a'));var licenseUtil=require(_0xc7e1('0x1b'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2d7fdc,_0x1994a1){_0x1994a1=_0x1994a1||0xcc;return function(_0x4591a8){if(_0x4591a8){return _0x2d7fdc['sendStatus'](_0x1994a1);}return _0x2d7fdc[_0xc7e1('0x1c')](_0x1994a1)[_0xc7e1('0x1d')]();};}function respondWithResult(_0x497cbc,_0x1c844b){_0x1c844b=_0x1c844b||0xc8;return function(_0x1dc252){if(_0x1dc252){return _0x497cbc[_0xc7e1('0x1c')](_0x1c844b)[_0xc7e1('0x1e')](_0x1dc252);}};}function respondWithFilteredResult(_0xc9c26,_0x3239ad){return function(_0x48f5bd){if(_0x48f5bd){var _0x212722=typeof _0x3239ad['offset']===_0xc7e1('0x1f')&&typeof _0x3239ad[_0xc7e1('0x20')]===_0xc7e1('0x1f');var _0x28af57=_0x48f5bd[_0xc7e1('0x21')];var _0xdc1383=_0x212722?0x0:_0x3239ad[_0xc7e1('0x22')];var _0x408593=_0x212722?_0x48f5bd[_0xc7e1('0x21')]:_0x3239ad[_0xc7e1('0x22')]+_0x3239ad[_0xc7e1('0x20')];var _0xc29c8b;if(_0x408593>=_0x28af57){_0x408593=_0x28af57;_0xc29c8b=0xc8;}else{_0xc29c8b=0xce;}_0xc9c26[_0xc7e1('0x1c')](_0xc29c8b);return _0xc9c26[_0xc7e1('0x23')](_0xc7e1('0x24'),_0xdc1383+'-'+_0x408593+'/'+_0x28af57)[_0xc7e1('0x1e')](_0x48f5bd);}return null;};}function patchUpdates(_0x258e46){return function(_0x22d8ca){try{jsonpatch['apply'](_0x22d8ca,_0x258e46,!![]);}catch(_0x9d11a){return BPromise[_0xc7e1('0x25')](_0x9d11a);}return _0x22d8ca['save']();};}function saveUpdates(_0x4342f2,_0xdd233f){return function(_0x2c8d0d){if(_0x2c8d0d){return _0x2c8d0d['update'](_0x4342f2)[_0xc7e1('0x26')](function(_0x1871d3){return _0x1871d3;});}return null;};}function removeEntity(_0x501e52,_0x4d28c0){return function(_0x3929f6){if(_0x3929f6){return _0x3929f6[_0xc7e1('0x27')]()[_0xc7e1('0x26')](function(){var _0x2d04d0=_0x3929f6[_0xc7e1('0x28')]({'plain':!![]});var _0x1e2b20='Variables';return db['UserProfileResource'][_0xc7e1('0x27')]({'where':{'type':_0x1e2b20,'resourceId':_0x2d04d0['id']}})[_0xc7e1('0x26')](function(){return _0x3929f6;});})[_0xc7e1('0x26')](function(){_0x501e52[_0xc7e1('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2d1d6c,_0x371769){return function(_0x286419){if(!_0x286419){_0x2d1d6c['sendStatus'](0x194);}return _0x286419;};}function handleError(_0x140f28,_0x4c1068){_0x4c1068=_0x4c1068||0x1f4;return function(_0x25e6fc){logger['error'](_0x25e6fc['stack']);if(_0x25e6fc[_0xc7e1('0x29')]){delete _0x25e6fc['name'];}_0x140f28[_0xc7e1('0x1c')](_0x4c1068)[_0xc7e1('0x2a')](_0x25e6fc);};}exports[_0xc7e1('0x2b')]=function(_0x454f87,_0x5da786){var _0x3f2479={},_0x5294ec={},_0x1f5930={'count':0x0,'rows':[]};var _0x44a7aa=_[_0xc7e1('0x2c')](db['Variable']['rawAttributes'],function(_0x4f64a0){return{'name':_0x4f64a0[_0xc7e1('0x2d')],'type':_0x4f64a0['type']['key']};});_0x5294ec[_0xc7e1('0x2e')]=_[_0xc7e1('0x2c')](_0x44a7aa,_0xc7e1('0x29'));_0x5294ec[_0xc7e1('0x2f')]=_[_0xc7e1('0x30')](_0x454f87[_0xc7e1('0x2f')]);_0x5294ec[_0xc7e1('0x31')]=_['intersection'](_0x5294ec[_0xc7e1('0x2e')],_0x5294ec[_0xc7e1('0x2f')]);_0x3f2479['attributes']=_['intersection'](_0x5294ec[_0xc7e1('0x2e')],qs['fields'](_0x454f87[_0xc7e1('0x2f')]['fields']));_0x3f2479[_0xc7e1('0x32')]=_0x3f2479[_0xc7e1('0x32')][_0xc7e1('0x33')]?_0x3f2479['attributes']:_0x5294ec[_0xc7e1('0x2e')];if(!_0x454f87[_0xc7e1('0x2f')][_0xc7e1('0x34')]('nolimit')){_0x3f2479['limit']=qs[_0xc7e1('0x20')](_0x454f87[_0xc7e1('0x2f')][_0xc7e1('0x20')]);_0x3f2479[_0xc7e1('0x22')]=qs[_0xc7e1('0x22')](_0x454f87[_0xc7e1('0x2f')][_0xc7e1('0x22')]);}_0x3f2479[_0xc7e1('0x35')]=qs[_0xc7e1('0x36')](_0x454f87[_0xc7e1('0x2f')][_0xc7e1('0x36')]);_0x3f2479[_0xc7e1('0x37')]=qs[_0xc7e1('0x31')](_[_0xc7e1('0x38')](_0x454f87[_0xc7e1('0x2f')],_0x5294ec['filters']),_0x44a7aa);if(_0x454f87[_0xc7e1('0x2f')][_0xc7e1('0x39')]){_0x3f2479[_0xc7e1('0x37')]=_[_0xc7e1('0x3a')](_0x3f2479[_0xc7e1('0x37')],{'$or':_['map'](_0x44a7aa,function(_0x4b91a2){if(_0x4b91a2[_0xc7e1('0x3b')]!=='VIRTUAL'){var _0x58f4bb={};_0x58f4bb[_0x4b91a2[_0xc7e1('0x29')]]={'$like':'%'+_0x454f87[_0xc7e1('0x2f')][_0xc7e1('0x39')]+'%'};return _0x58f4bb;}})});}_0x3f2479=_[_0xc7e1('0x3a')]({},_0x3f2479,_0x454f87[_0xc7e1('0x3c')]);var _0x5d1962={'where':_0x3f2479[_0xc7e1('0x37')]};return db['Variable'][_0xc7e1('0x21')](_0x5d1962)[_0xc7e1('0x26')](function(_0x4471df){_0x1f5930[_0xc7e1('0x21')]=_0x4471df;if(_0x454f87[_0xc7e1('0x2f')][_0xc7e1('0x3d')]){_0x3f2479[_0xc7e1('0x3e')]=[{'all':!![]}];}return db[_0xc7e1('0x3f')]['findAll'](_0x3f2479);})[_0xc7e1('0x26')](function(_0x54a8f7){_0x1f5930[_0xc7e1('0x40')]=_0x54a8f7;return _0x1f5930;})['then'](respondWithFilteredResult(_0x5da786,_0x3f2479))[_0xc7e1('0x41')](handleError(_0x5da786,null));};exports[_0xc7e1('0x42')]=function(_0xe8af0e,_0x2e4603){var _0x4ac115={'raw':!![],'where':{'id':_0xe8af0e[_0xc7e1('0x43')]['id']}},_0x3f4f16={};_0x3f4f16['model']=_[_0xc7e1('0x30')](db[_0xc7e1('0x3f')][_0xc7e1('0x44')]);_0x3f4f16[_0xc7e1('0x2f')]=_[_0xc7e1('0x30')](_0xe8af0e[_0xc7e1('0x2f')]);_0x3f4f16[_0xc7e1('0x31')]=_['intersection'](_0x3f4f16['model'],_0x3f4f16[_0xc7e1('0x2f')]);_0x4ac115['attributes']=_['intersection'](_0x3f4f16[_0xc7e1('0x2e')],qs[_0xc7e1('0x45')](_0xe8af0e[_0xc7e1('0x2f')][_0xc7e1('0x45')]));_0x4ac115['attributes']=_0x4ac115['attributes'][_0xc7e1('0x33')]?_0x4ac115[_0xc7e1('0x32')]:_0x3f4f16[_0xc7e1('0x2e')];if(_0xe8af0e[_0xc7e1('0x2f')][_0xc7e1('0x3d')]){_0x4ac115[_0xc7e1('0x3e')]=[{'all':!![]}];}_0x4ac115=_[_0xc7e1('0x3a')]({},_0x4ac115,_0xe8af0e[_0xc7e1('0x3c')]);return db['Variable'][_0xc7e1('0x46')](_0x4ac115)[_0xc7e1('0x26')](handleEntityNotFound(_0x2e4603,null))['then'](respondWithResult(_0x2e4603,null))[_0xc7e1('0x41')](handleError(_0x2e4603,null));};exports[_0xc7e1('0x47')]=function(_0x4fdbfd,_0x49f959){return db[_0xc7e1('0x3f')][_0xc7e1('0x47')](_0x4fdbfd['body'],{})[_0xc7e1('0x26')](function(_0x1c4f9a){var _0x241e48=_0x4fdbfd[_0xc7e1('0x48')]['get']({'plain':!![]});if(!_0x241e48)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x241e48[_0xc7e1('0x49')]==='user'){var _0x13f0bf=_0x1c4f9a[_0xc7e1('0x28')]({'plain':!![]});var _0x2b9895=_0xc7e1('0x4a');return db[_0xc7e1('0x4b')][_0xc7e1('0x46')]({'where':{'name':_0x2b9895,'userProfileId':_0x241e48[_0xc7e1('0x4c')]},'raw':!![]})[_0xc7e1('0x26')](function(_0x2fe192){if(_0x2fe192&&_0x2fe192[_0xc7e1('0x4d')]===0x0){return db[_0xc7e1('0x4e')]['create']({'name':_0x13f0bf[_0xc7e1('0x29')],'resourceId':_0x13f0bf['id'],'type':_0x2fe192[_0xc7e1('0x29')],'sectionId':_0x2fe192['id']},{})[_0xc7e1('0x26')](function(){return _0x1c4f9a;});}else{return _0x1c4f9a;}})[_0xc7e1('0x41')](function(_0x19dc26){logger[_0xc7e1('0x4f')](_0xc7e1('0x50'),_0x19dc26);throw _0x19dc26;});}return _0x1c4f9a;})[_0xc7e1('0x26')](respondWithResult(_0x49f959,0xc9))['catch'](handleError(_0x49f959,null));};exports[_0xc7e1('0x51')]=function(_0x44e506,_0x374ebc){if(_0x44e506[_0xc7e1('0x52')]['id']){delete _0x44e506[_0xc7e1('0x52')]['id'];}return db[_0xc7e1('0x3f')][_0xc7e1('0x46')]({'where':{'id':_0x44e506[_0xc7e1('0x43')]['id']}})[_0xc7e1('0x26')](handleEntityNotFound(_0x374ebc,null))[_0xc7e1('0x26')](saveUpdates(_0x44e506[_0xc7e1('0x52')],null))[_0xc7e1('0x26')](respondWithResult(_0x374ebc,null))[_0xc7e1('0x41')](handleError(_0x374ebc,null));};exports[_0xc7e1('0x27')]=function(_0x200867,_0x468b0){return db['Variable'][_0xc7e1('0x46')]({'where':{'id':_0x200867['params']['id']}})[_0xc7e1('0x26')](handleEntityNotFound(_0x468b0,null))[_0xc7e1('0x26')](removeEntity(_0x468b0,null))[_0xc7e1('0x41')](handleError(_0x468b0,null));}; \ No newline at end of file +var _0xf745=['keys','filters','intersection','attributes','fields','order','sort','where','filter','merge','map','type','options','Variable','includeAll','include','findAll','catch','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','destroy','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','json','offset','undefined','limit','count','apply','save','then','Variables','sendStatus','error','stack','name','send','index','rawAttributes','fieldName','key','model','query'];(function(_0x2b89f4,_0x1c8ba5){var _0x264891=function(_0xf8c7e0){while(--_0xf8c7e0){_0x2b89f4['push'](_0x2b89f4['shift']());}};_0x264891(++_0x1c8ba5);}(_0xf745,0x6d));var _0x5f74=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xf745[_0x19e35c];return _0x3e1fe8;};'use strict';var emlformat=require(_0x5f74('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x5f74('0x1'));var rp=require(_0x5f74('0x2'));var moment=require(_0x5f74('0x3'));var BPromise=require(_0x5f74('0x4'));var Mustache=require(_0x5f74('0x5'));var util=require(_0x5f74('0x6'));var path=require(_0x5f74('0x7'));var sox=require(_0x5f74('0x8'));var csv=require(_0x5f74('0x9'));var ejs=require(_0x5f74('0xa'));var fs=require('fs');var fs_extra=require(_0x5f74('0xb'));var _=require('lodash');var squel=require(_0x5f74('0xc'));var crypto=require(_0x5f74('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x5f74('0xe'));var toCsv=require(_0x5f74('0x9'));var querystring=require(_0x5f74('0xf'));var Papa=require(_0x5f74('0x10'));var Redis=require(_0x5f74('0x11'));var authService=require(_0x5f74('0x12'));var qs=require(_0x5f74('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5f74('0x14'));var logger=require(_0x5f74('0x15'))(_0x5f74('0x16'));var utils=require(_0x5f74('0x17'));var config=require(_0x5f74('0x18'));var licenseUtil=require(_0x5f74('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x593344,_0x1c9a00){_0x1c9a00=_0x1c9a00||0xcc;return function(_0x3b468f){if(_0x3b468f){return _0x593344['sendStatus'](_0x1c9a00);}return _0x593344[_0x5f74('0x1a')](_0x1c9a00)['end']();};}function respondWithResult(_0x11e9d5,_0x5e5585){_0x5e5585=_0x5e5585||0xc8;return function(_0x2afe84){if(_0x2afe84){return _0x11e9d5[_0x5f74('0x1a')](_0x5e5585)[_0x5f74('0x1b')](_0x2afe84);}};}function respondWithFilteredResult(_0x31e86b,_0x69f889){return function(_0x3d48e3){if(_0x3d48e3){var _0x101603=typeof _0x69f889[_0x5f74('0x1c')]===_0x5f74('0x1d')&&typeof _0x69f889[_0x5f74('0x1e')]===_0x5f74('0x1d');var _0x211bc5=_0x3d48e3[_0x5f74('0x1f')];var _0x17f1db=_0x101603?0x0:_0x69f889['offset'];var _0x490497=_0x101603?_0x3d48e3[_0x5f74('0x1f')]:_0x69f889['offset']+_0x69f889[_0x5f74('0x1e')];var _0x45b518;if(_0x490497>=_0x211bc5){_0x490497=_0x211bc5;_0x45b518=0xc8;}else{_0x45b518=0xce;}_0x31e86b[_0x5f74('0x1a')](_0x45b518);return _0x31e86b['set']('Content-Range',_0x17f1db+'-'+_0x490497+'/'+_0x211bc5)[_0x5f74('0x1b')](_0x3d48e3);}return null;};}function patchUpdates(_0x2c501c){return function(_0x312af8){try{jsonpatch[_0x5f74('0x20')](_0x312af8,_0x2c501c,!![]);}catch(_0x21b43a){return BPromise['reject'](_0x21b43a);}return _0x312af8[_0x5f74('0x21')]();};}function saveUpdates(_0x13f35c,_0x13ef3a){return function(_0x2b12df){if(_0x2b12df){return _0x2b12df['update'](_0x13f35c)[_0x5f74('0x22')](function(_0x1f0f92){return _0x1f0f92;});}return null;};}function removeEntity(_0x3fc0df,_0x12b46f){return function(_0x275aa4){if(_0x275aa4){return _0x275aa4['destroy']()[_0x5f74('0x22')](function(){var _0x5809e9=_0x275aa4['get']({'plain':!![]});var _0x182c62=_0x5f74('0x23');return db['UserProfileResource']['destroy']({'where':{'type':_0x182c62,'resourceId':_0x5809e9['id']}})['then'](function(){return _0x275aa4;});})[_0x5f74('0x22')](function(){_0x3fc0df[_0x5f74('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1bcb68,_0x211ad3){return function(_0x5362d5){if(!_0x5362d5){_0x1bcb68[_0x5f74('0x24')](0x194);}return _0x5362d5;};}function handleError(_0x5b25e1,_0xaff000){_0xaff000=_0xaff000||0x1f4;return function(_0x4e8770){logger[_0x5f74('0x25')](_0x4e8770[_0x5f74('0x26')]);if(_0x4e8770[_0x5f74('0x27')]){delete _0x4e8770[_0x5f74('0x27')];}_0x5b25e1[_0x5f74('0x1a')](_0xaff000)[_0x5f74('0x28')](_0x4e8770);};}exports[_0x5f74('0x29')]=function(_0x52dcd8,_0x567a11){var _0x267e2d={},_0x566529={},_0x1c02be={'count':0x0,'rows':[]};var _0x3b4398=_['map'](db['Variable'][_0x5f74('0x2a')],function(_0xf2c389){return{'name':_0xf2c389[_0x5f74('0x2b')],'type':_0xf2c389['type'][_0x5f74('0x2c')]};});_0x566529[_0x5f74('0x2d')]=_['map'](_0x3b4398,_0x5f74('0x27'));_0x566529[_0x5f74('0x2e')]=_[_0x5f74('0x2f')](_0x52dcd8[_0x5f74('0x2e')]);_0x566529[_0x5f74('0x30')]=_[_0x5f74('0x31')](_0x566529[_0x5f74('0x2d')],_0x566529[_0x5f74('0x2e')]);_0x267e2d[_0x5f74('0x32')]=_[_0x5f74('0x31')](_0x566529[_0x5f74('0x2d')],qs[_0x5f74('0x33')](_0x52dcd8['query'][_0x5f74('0x33')]));_0x267e2d[_0x5f74('0x32')]=_0x267e2d[_0x5f74('0x32')]['length']?_0x267e2d[_0x5f74('0x32')]:_0x566529[_0x5f74('0x2d')];if(!_0x52dcd8[_0x5f74('0x2e')]['hasOwnProperty']('nolimit')){_0x267e2d[_0x5f74('0x1e')]=qs['limit'](_0x52dcd8[_0x5f74('0x2e')][_0x5f74('0x1e')]);_0x267e2d['offset']=qs[_0x5f74('0x1c')](_0x52dcd8[_0x5f74('0x2e')][_0x5f74('0x1c')]);}_0x267e2d[_0x5f74('0x34')]=qs[_0x5f74('0x35')](_0x52dcd8[_0x5f74('0x2e')][_0x5f74('0x35')]);_0x267e2d[_0x5f74('0x36')]=qs[_0x5f74('0x30')](_['pick'](_0x52dcd8['query'],_0x566529[_0x5f74('0x30')]),_0x3b4398);if(_0x52dcd8[_0x5f74('0x2e')][_0x5f74('0x37')]){_0x267e2d[_0x5f74('0x36')]=_[_0x5f74('0x38')](_0x267e2d[_0x5f74('0x36')],{'$or':_[_0x5f74('0x39')](_0x3b4398,function(_0x538660){if(_0x538660[_0x5f74('0x3a')]!=='VIRTUAL'){var _0x3bd4c5={};_0x3bd4c5[_0x538660['name']]={'$like':'%'+_0x52dcd8[_0x5f74('0x2e')]['filter']+'%'};return _0x3bd4c5;}})});}_0x267e2d=_[_0x5f74('0x38')]({},_0x267e2d,_0x52dcd8[_0x5f74('0x3b')]);var _0x5ca87a={'where':_0x267e2d[_0x5f74('0x36')]};return db[_0x5f74('0x3c')][_0x5f74('0x1f')](_0x5ca87a)['then'](function(_0x2a9fd4){_0x1c02be[_0x5f74('0x1f')]=_0x2a9fd4;if(_0x52dcd8[_0x5f74('0x2e')][_0x5f74('0x3d')]){_0x267e2d[_0x5f74('0x3e')]=[{'all':!![]}];}return db[_0x5f74('0x3c')][_0x5f74('0x3f')](_0x267e2d);})[_0x5f74('0x22')](function(_0x53d3e4){_0x1c02be['rows']=_0x53d3e4;return _0x1c02be;})[_0x5f74('0x22')](respondWithFilteredResult(_0x567a11,_0x267e2d))[_0x5f74('0x40')](handleError(_0x567a11,null));};exports['show']=function(_0x11a80d,_0x1b4f76){var _0x3985d4={'raw':!![],'where':{'id':_0x11a80d[_0x5f74('0x41')]['id']}},_0x13ef5a={};_0x13ef5a[_0x5f74('0x2d')]=_[_0x5f74('0x2f')](db['Variable'][_0x5f74('0x2a')]);_0x13ef5a['query']=_[_0x5f74('0x2f')](_0x11a80d[_0x5f74('0x2e')]);_0x13ef5a[_0x5f74('0x30')]=_[_0x5f74('0x31')](_0x13ef5a['model'],_0x13ef5a[_0x5f74('0x2e')]);_0x3985d4[_0x5f74('0x32')]=_[_0x5f74('0x31')](_0x13ef5a['model'],qs[_0x5f74('0x33')](_0x11a80d['query'][_0x5f74('0x33')]));_0x3985d4[_0x5f74('0x32')]=_0x3985d4[_0x5f74('0x32')]['length']?_0x3985d4[_0x5f74('0x32')]:_0x13ef5a[_0x5f74('0x2d')];if(_0x11a80d[_0x5f74('0x2e')]['includeAll']){_0x3985d4[_0x5f74('0x3e')]=[{'all':!![]}];}_0x3985d4=_[_0x5f74('0x38')]({},_0x3985d4,_0x11a80d[_0x5f74('0x3b')]);return db[_0x5f74('0x3c')][_0x5f74('0x42')](_0x3985d4)['then'](handleEntityNotFound(_0x1b4f76,null))[_0x5f74('0x22')](respondWithResult(_0x1b4f76,null))[_0x5f74('0x40')](handleError(_0x1b4f76,null));};exports['create']=function(_0x358f15,_0x5791b1){return db['Variable'][_0x5f74('0x43')](_0x358f15[_0x5f74('0x44')],{})['then'](function(_0x6206c4){var _0x52cb37=_0x358f15[_0x5f74('0x45')]['get']({'plain':!![]});if(!_0x52cb37)throw new Error(_0x5f74('0x46'));if(_0x52cb37[_0x5f74('0x47')]===_0x5f74('0x45')){var _0x4d0a91=_0x6206c4[_0x5f74('0x48')]({'plain':!![]});var _0x324ad5='Variables';return db[_0x5f74('0x49')][_0x5f74('0x42')]({'where':{'name':_0x324ad5,'userProfileId':_0x52cb37['userProfileId']},'raw':!![]})[_0x5f74('0x22')](function(_0x338410){if(_0x338410&&_0x338410[_0x5f74('0x4a')]===0x0){return db['UserProfileResource'][_0x5f74('0x43')]({'name':_0x4d0a91[_0x5f74('0x27')],'resourceId':_0x4d0a91['id'],'type':_0x338410[_0x5f74('0x27')],'sectionId':_0x338410['id']},{})[_0x5f74('0x22')](function(){return _0x6206c4;});}else{return _0x6206c4;}})[_0x5f74('0x40')](function(_0xfd7485){logger[_0x5f74('0x25')](_0x5f74('0x4b'),_0xfd7485);throw _0xfd7485;});}return _0x6206c4;})[_0x5f74('0x22')](respondWithResult(_0x5791b1,0xc9))['catch'](handleError(_0x5791b1,null));};exports[_0x5f74('0x4c')]=function(_0x44b66a,_0x330158){if(_0x44b66a[_0x5f74('0x44')]['id']){delete _0x44b66a['body']['id'];}return db[_0x5f74('0x3c')][_0x5f74('0x42')]({'where':{'id':_0x44b66a[_0x5f74('0x41')]['id']}})[_0x5f74('0x22')](handleEntityNotFound(_0x330158,null))[_0x5f74('0x22')](saveUpdates(_0x44b66a['body'],null))[_0x5f74('0x22')](respondWithResult(_0x330158,null))[_0x5f74('0x40')](handleError(_0x330158,null));};exports[_0x5f74('0x4d')]=function(_0x14469a,_0x1876df){return db[_0x5f74('0x3c')]['find']({'where':{'id':_0x14469a['params']['id']}})[_0x5f74('0x22')](handleEntityNotFound(_0x1876df,null))['then'](removeEntity(_0x1876df,null))[_0x5f74('0x40')](handleError(_0x1876df,null));}; \ No newline at end of file diff --git a/server/api/variable/variable.model.js b/server/api/variable/variable.model.js index cf097bb..3ced67e 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 _0xb647=['./variable.attributes','exports','define','Variable','tools_variables','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x18a79d,_0x57bd2c){var _0x4f8848=function(_0x28af80){while(--_0x28af80){_0x18a79d['push'](_0x18a79d['shift']());}};_0x4f8848(++_0x57bd2c);}(_0xb647,0x12b));var _0x7b64=function(_0x25a8b0,_0x1ade0f){_0x25a8b0=_0x25a8b0-0x0;var _0x3f58d4=_0xb647[_0x25a8b0];return _0x3f58d4;};'use strict';var _=require(_0x7b64('0x0'));var util=require(_0x7b64('0x1'));var logger=require(_0x7b64('0x2'))(_0x7b64('0x3'));var moment=require('moment');var BPromise=require(_0x7b64('0x4'));var rp=require(_0x7b64('0x5'));var fs=require('fs');var path=require(_0x7b64('0x6'));var rimraf=require(_0x7b64('0x7'));var config=require(_0x7b64('0x8'));var attributes=require(_0x7b64('0x9'));module[_0x7b64('0xa')]=function(_0x746442,_0x1fc4f5){return _0x746442[_0x7b64('0xb')](_0x7b64('0xc'),attributes,{'tableName':_0x7b64('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3f0c=['lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./variable.attributes','exports','define','Variable','tools_variables'];(function(_0x173441,_0x26b0d9){var _0x2423a8=function(_0x4d96c2){while(--_0x4d96c2){_0x173441['push'](_0x173441['shift']());}};_0x2423a8(++_0x26b0d9);}(_0x3f0c,0xd0));var _0xc3f0=function(_0x3254a8,_0x1401c9){_0x3254a8=_0x3254a8-0x0;var _0x42ebf3=_0x3f0c[_0x3254a8];return _0x42ebf3;};'use strict';var _=require(_0xc3f0('0x0'));var util=require(_0xc3f0('0x1'));var logger=require(_0xc3f0('0x2'))('api');var moment=require(_0xc3f0('0x3'));var BPromise=require(_0xc3f0('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc3f0('0x5'));var rimraf=require(_0xc3f0('0x6'));var config=require(_0xc3f0('0x7'));var attributes=require(_0xc3f0('0x8'));module[_0xc3f0('0x9')]=function(_0xa3f82,_0xaec131){return _0xa3f82[_0xc3f0('0xa')](_0xc3f0('0xb'),attributes,{'tableName':_0xc3f0('0xc'),'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 2276da7..a3ed2f2 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 _0xe14b=['ioredis','../../config/utils','../../config/environment','jayson/promise','client','http','then','info','Variable,\x20%s,\x20%s','Variable,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','ShowVariable','Variable','find','options','raw','where','attributes','map','include','model','stringify','lodash','util','randomstring'];(function(_0x31c0e3,_0x3c5cd6){var _0xf34e31=function(_0x312d15){while(--_0x312d15){_0x31c0e3['push'](_0x31c0e3['shift']());}};_0xf34e31(++_0x3c5cd6);}(_0xe14b,0x93));var _0xbe14=function(_0x33c76a,_0x19c946){_0x33c76a=_0x33c76a-0x0;var _0x44d502=_0xe14b[_0x33c76a];return _0x44d502;};'use strict';var _=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xbe14('0x2'));var fs=require('fs');var Redis=require(_0xbe14('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xbe14('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0xbe14('0x5'));var jayson=require(_0xbe14('0x6'));var client=jayson[_0xbe14('0x7')][_0xbe14('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1d9ade,_0x39387e,_0x196fca){return new BPromise(function(_0x566ae7,_0x50f909){return client['request'](_0x1d9ade,_0x196fca)[_0xbe14('0x9')](function(_0x6fceff){logger[_0xbe14('0xa')](_0xbe14('0xb'),_0x39387e,'request\x20sent');logger['debug'](_0xbe14('0xc'),_0x39387e,_0xbe14('0xd'),JSON['stringify'](_0x6fceff));if(_0x6fceff[_0xbe14('0xe')]){if(_0x6fceff[_0xbe14('0xe')][_0xbe14('0xf')]===0x1f4){logger[_0xbe14('0xe')](_0xbe14('0xb'),_0x39387e,_0x6fceff[_0xbe14('0xe')][_0xbe14('0x10')]);return _0x50f909(_0x6fceff[_0xbe14('0xe')][_0xbe14('0x10')]);}logger[_0xbe14('0xe')](_0xbe14('0xb'),_0x39387e,_0x6fceff[_0xbe14('0xe')][_0xbe14('0x10')]);return _0x566ae7(_0x6fceff['error']['message']);}else{logger[_0xbe14('0xa')](_0xbe14('0xb'),_0x39387e,_0xbe14('0xd'));_0x566ae7(_0x6fceff[_0xbe14('0x11')]['message']);}})[_0xbe14('0x12')](function(_0xe9c3ec){logger[_0xbe14('0xe')](_0xbe14('0xb'),_0x39387e,_0xe9c3ec);_0x50f909(_0xe9c3ec);});});}exports[_0xbe14('0x13')]=function(_0x29ab73){var _0x17ae86=this;return new Promise(function(_0x5ea1f8,_0x137ee5){return db[_0xbe14('0x14')][_0xbe14('0x15')]({'raw':_0x29ab73[_0xbe14('0x16')]?_0x29ab73[_0xbe14('0x16')][_0xbe14('0x17')]===undefined?!![]:![]:!![],'where':_0x29ab73['options']?_0x29ab73[_0xbe14('0x16')][_0xbe14('0x18')]||null:null,'attributes':_0x29ab73[_0xbe14('0x16')]?_0x29ab73[_0xbe14('0x16')][_0xbe14('0x19')]||null:null,'include':_0x29ab73['options']?_0x29ab73[_0xbe14('0x16')]['include']?_[_0xbe14('0x1a')](_0x29ab73['options'][_0xbe14('0x1b')],function(_0x4a25fa){return{'model':db[_0x4a25fa[_0xbe14('0x1c')]],'as':_0x4a25fa['as'],'attributes':_0x4a25fa[_0xbe14('0x19')],'include':_0x4a25fa['include']?_[_0xbe14('0x1a')](_0x4a25fa['include'],function(_0x4587a8){return{'model':db[_0x4587a8['model']],'as':_0x4587a8['as'],'attributes':_0x4587a8[_0xbe14('0x19')],'include':_0x4587a8[_0xbe14('0x1b')]?_[_0xbe14('0x1a')](_0x4587a8[_0xbe14('0x1b')],function(_0x15ef02){return{'model':db[_0x15ef02[_0xbe14('0x1c')]],'as':_0x15ef02['as'],'attributes':_0x15ef02['attributes']};}):[]};}):[]};}):[]:[]})[_0xbe14('0x9')](function(_0x1ba46a){logger[_0xbe14('0xa')](_0xbe14('0x13'),_0x29ab73);logger['debug'](_0xbe14('0x13'),_0x29ab73,JSON[_0xbe14('0x1d')](_0x1ba46a));_0x5ea1f8(_0x1ba46a);})['catch'](function(_0x3c3613){logger[_0xbe14('0xe')](_0xbe14('0x13'),_0x3c3613[_0xbe14('0x10')],_0x29ab73);_0x137ee5(_0x17ae86[_0xbe14('0xe')](0x1f4,_0x3c3613[_0xbe14('0x10')]));});});}; \ No newline at end of file +var _0x6aa7=['include','model','attributes','map','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','client','request','then','info','Variable,\x20%s,\x20%s','request\x20sent','debug','Variable,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','ShowVariable','find','options','raw','where'];(function(_0x32aea9,_0x19a5f0){var _0x5bcf7a=function(_0x1a8645){while(--_0x1a8645){_0x32aea9['push'](_0x32aea9['shift']());}};_0x5bcf7a(++_0x19a5f0);}(_0x6aa7,0x178));var _0x76aa=function(_0x54d4e6,_0xdc1982){_0x54d4e6=_0x54d4e6-0x0;var _0x12fe8a=_0x6aa7[_0x54d4e6];return _0x12fe8a;};'use strict';var _=require(_0x76aa('0x0'));var util=require('util');var moment=require(_0x76aa('0x1'));var BPromise=require(_0x76aa('0x2'));var rs=require(_0x76aa('0x3'));var fs=require('fs');var Redis=require(_0x76aa('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x76aa('0x5'));var logger=require(_0x76aa('0x6'))(_0x76aa('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x76aa('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x32dee5,_0x36d12b,_0xa9b695){return new BPromise(function(_0x56d6bc,_0x3dae33){return client[_0x76aa('0x9')](_0x32dee5,_0xa9b695)[_0x76aa('0xa')](function(_0x557d69){logger[_0x76aa('0xb')](_0x76aa('0xc'),_0x36d12b,_0x76aa('0xd'));logger[_0x76aa('0xe')](_0x76aa('0xf'),_0x36d12b,_0x76aa('0xd'),JSON[_0x76aa('0x10')](_0x557d69));if(_0x557d69[_0x76aa('0x11')]){if(_0x557d69[_0x76aa('0x11')][_0x76aa('0x12')]===0x1f4){logger['error'](_0x76aa('0xc'),_0x36d12b,_0x557d69['error'][_0x76aa('0x13')]);return _0x3dae33(_0x557d69[_0x76aa('0x11')][_0x76aa('0x13')]);}logger[_0x76aa('0x11')](_0x76aa('0xc'),_0x36d12b,_0x557d69['error']['message']);return _0x56d6bc(_0x557d69[_0x76aa('0x11')]['message']);}else{logger[_0x76aa('0xb')](_0x76aa('0xc'),_0x36d12b,'request\x20sent');_0x56d6bc(_0x557d69[_0x76aa('0x14')]['message']);}})[_0x76aa('0x15')](function(_0x5181d2){logger[_0x76aa('0x11')](_0x76aa('0xc'),_0x36d12b,_0x5181d2);_0x3dae33(_0x5181d2);});});}exports[_0x76aa('0x16')]=function(_0x21c16d){var _0xa1bc7=this;return new Promise(function(_0x3ead3f,_0x496902){return db['Variable'][_0x76aa('0x17')]({'raw':_0x21c16d[_0x76aa('0x18')]?_0x21c16d[_0x76aa('0x18')][_0x76aa('0x19')]===undefined?!![]:![]:!![],'where':_0x21c16d[_0x76aa('0x18')]?_0x21c16d[_0x76aa('0x18')][_0x76aa('0x1a')]||null:null,'attributes':_0x21c16d[_0x76aa('0x18')]?_0x21c16d[_0x76aa('0x18')]['attributes']||null:null,'include':_0x21c16d[_0x76aa('0x18')]?_0x21c16d[_0x76aa('0x18')][_0x76aa('0x1b')]?_['map'](_0x21c16d[_0x76aa('0x18')][_0x76aa('0x1b')],function(_0x31252f){return{'model':db[_0x31252f[_0x76aa('0x1c')]],'as':_0x31252f['as'],'attributes':_0x31252f[_0x76aa('0x1d')],'include':_0x31252f[_0x76aa('0x1b')]?_[_0x76aa('0x1e')](_0x31252f[_0x76aa('0x1b')],function(_0x32bf9f){return{'model':db[_0x32bf9f[_0x76aa('0x1c')]],'as':_0x32bf9f['as'],'attributes':_0x32bf9f[_0x76aa('0x1d')],'include':_0x32bf9f[_0x76aa('0x1b')]?_[_0x76aa('0x1e')](_0x32bf9f['include'],function(_0xb5e8a9){return{'model':db[_0xb5e8a9[_0x76aa('0x1c')]],'as':_0xb5e8a9['as'],'attributes':_0xb5e8a9[_0x76aa('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x76aa('0xa')](function(_0xa1e6){logger[_0x76aa('0xb')](_0x76aa('0x16'),_0x21c16d);logger[_0x76aa('0xe')](_0x76aa('0x16'),_0x21c16d,JSON[_0x76aa('0x10')](_0xa1e6));_0x3ead3f(_0xa1e6);})['catch'](function(_0x3fcb7f){logger['error'](_0x76aa('0x16'),_0x3fcb7f[_0x76aa('0x13')],_0x21c16d);_0x496902(_0xa1bc7[_0x76aa('0x11')](0x1f4,_0x3fcb7f[_0x76aa('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/version/index.js b/server/api/version/index.js index 4c20441..9b252e1 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 _0x2f40=['index','/fetch','isAuthenticated','canUpdate','fetch','reset','pull','/restart','restart','/migrations','migrations','express','./version.controller','get'];(function(_0x595578,_0x2c6c27){var _0xa99eaf=function(_0x425b38){while(--_0x425b38){_0x595578['push'](_0x595578['shift']());}};_0xa99eaf(++_0x2c6c27);}(_0x2f40,0x1e7));var _0x02f4=function(_0x550d12,_0x5384bd){_0x550d12=_0x550d12-0x0;var _0x12103d=_0x2f40[_0x550d12];return _0x12103d;};'use strict';var express=require(_0x02f4('0x0'));var router=express['Router']();var auth=require('../../components/auth/service');var controller=require(_0x02f4('0x1'));router[_0x02f4('0x2')]('/',controller[_0x02f4('0x3')]);router[_0x02f4('0x2')](_0x02f4('0x4'),auth[_0x02f4('0x5')](),auth[_0x02f4('0x6')](),controller[_0x02f4('0x7')]);router[_0x02f4('0x2')]('/reset',auth[_0x02f4('0x5')](),auth['canUpdate'](),controller[_0x02f4('0x8')]);router[_0x02f4('0x2')]('/pull',auth[_0x02f4('0x5')](),auth[_0x02f4('0x6')](),controller[_0x02f4('0x9')]);router[_0x02f4('0x2')](_0x02f4('0xa'),auth[_0x02f4('0x5')](),controller[_0x02f4('0xb')]);router['get'](_0x02f4('0xc'),controller[_0x02f4('0xd')]);module['exports']=router; \ No newline at end of file +var _0x8023=['canUpdate','exports','Router','../../components/auth/service','get','index','/fetch','fetch','isAuthenticated','reset','/pull'];(function(_0x2ea408,_0x5f2579){var _0x1cad53=function(_0x389a8b){while(--_0x389a8b){_0x2ea408['push'](_0x2ea408['shift']());}};_0x1cad53(++_0x5f2579);}(_0x8023,0x70));var _0x3802=function(_0x1760da,_0x4162b1){_0x1760da=_0x1760da-0x0;var _0x27e18c=_0x8023[_0x1760da];return _0x27e18c;};'use strict';var express=require('express');var router=express[_0x3802('0x0')]();var auth=require(_0x3802('0x1'));var controller=require('./version.controller');router[_0x3802('0x2')]('/',controller[_0x3802('0x3')]);router[_0x3802('0x2')](_0x3802('0x4'),auth['isAuthenticated'](),auth['canUpdate'](),controller[_0x3802('0x5')]);router[_0x3802('0x2')]('/reset',auth[_0x3802('0x6')](),auth['canUpdate'](),controller[_0x3802('0x7')]);router[_0x3802('0x2')](_0x3802('0x8'),auth[_0x3802('0x6')](),auth[_0x3802('0x9')](),controller['pull']);router[_0x3802('0x2')]('/restart',auth[_0x3802('0x6')](),controller['restart']);router['get']('/migrations',controller['migrations']);module[_0x3802('0xa')]=router; \ No newline at end of file diff --git a/server/api/version/version.controller.js b/server/api/version/version.controller.js index 7bd2910..ab4aea1 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 _0x954d=['join','server','migrations','push','length','sort','sequelize','Migration','getQueryInterface','constructor','Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.','\x20to\x20','last','Database\x20already\x20up-to-date','path','lodash','pkginfo','version','compare-versions','child_process','exec','../../mysqldb','../../config/environment','../../config/pm2','../../config/logger','simple-git','root','index','exports','query','latest','fetch','tags','2.0.0','json','origin','master','error','status','info','git\x20fetch','reset','--hard','FETCH_HEAD','git\x20reset\x20--hard','npm\x20install\x20--production','restart','motion2','then','catch'];(function(_0x29e0dd,_0x10c91b){var _0x16f3be=function(_0x48a38a){while(--_0x48a38a){_0x29e0dd['push'](_0x29e0dd['shift']());}};_0x16f3be(++_0x10c91b);}(_0x954d,0x13a));var _0xd954=function(_0x627cb8,_0x2b89d6){_0x627cb8=_0x627cb8-0x0;var _0x5629b5=_0x954d[_0x627cb8];return _0x5629b5;};'use strict';var Umzug=require('umzug');var path=require(_0xd954('0x0'));var fs=require('fs');var _=require(_0xd954('0x1'));var pkginfo=require(_0xd954('0x2'))(module,_0xd954('0x3'));var compareVersions=require(_0xd954('0x4'));var exec=require(_0xd954('0x5'))[_0xd954('0x6')];var db=require(_0xd954('0x7'))['db'];var config=require(_0xd954('0x8'));var pm2=require(_0xd954('0x9'));var logger=require(_0xd954('0xa'))('update');var git=require(_0xd954('0xb'))(config[_0xd954('0xc')]);exports[_0xd954('0xd')]=function(_0x352215,_0x6d0662){var _0xbaebef={'current':module[_0xd954('0xe')][_0xd954('0x3')],'phonebar':0x2};if(_0x352215[_0xd954('0xf')]&&_0x352215[_0xd954('0xf')][_0xd954('0x10')]){return git[_0xd954('0x11')]()[_0xd954('0x12')](function(_0x550b4a,_0x36148a){_0xbaebef[_0xd954('0x10')]=(_0x550b4a?module[_0xd954('0xe')][_0xd954('0x3')]:_0x36148a[_0xd954('0x10')])||_0xd954('0x13');return _0x6d0662['status'](0xc8)[_0xd954('0x14')](_0xbaebef);});}else{return _0x6d0662['status'](0xc8)[_0xd954('0x14')](_0xbaebef);}};exports[_0xd954('0x11')]=function(_0x252f6e,_0x43fd68){return git['fetch']([_0xd954('0x15'),_0xd954('0x16')],function(_0x5b45b6){if(_0x5b45b6){logger[_0xd954('0x17')](_0x5b45b6);return _0x43fd68[_0xd954('0x18')](0x1f4)[_0xd954('0x14')](_0x5b45b6);}logger[_0xd954('0x19')](_0xd954('0x1a'));return _0x43fd68[_0xd954('0x18')](0xc8)[_0xd954('0x14')]({'output':'git\x20fetch\x20origin\x20master'});});};exports[_0xd954('0x1b')]=function(_0x56cecd,_0x241dd7){return git['reset']([_0xd954('0x1c'),_0xd954('0x1d')],function(_0x54e83c){if(_0x54e83c){logger[_0xd954('0x17')](_0x54e83c);return _0x241dd7['status'](0x1f4)['json'](_0x54e83c);}logger[_0xd954('0x19')]('git\x20reset\x20--hard\x20FETCH_HEAD');return _0x241dd7[_0xd954('0x18')](0xc8)[_0xd954('0x14')]({'output':_0xd954('0x1e')});});};exports['pull']=function(_0x524b76,_0x193bc2){exec(_0xd954('0x1f'),function(_0x59fa4a,_0x1a0847,_0x1d847e){logger['info'](_0x1a0847);logger[_0xd954('0x19')](_0x1d847e);if(_0x59fa4a){logger[_0xd954('0x17')](_0x59fa4a);return _0x193bc2[_0xd954('0x18')](0x1f4)['json'](_0x59fa4a);}return _0x193bc2[_0xd954('0x18')](0xc8)[_0xd954('0x14')]({'output':_0x1a0847});});};exports[_0xd954('0x20')]=function(_0x3b5de5,_0x5871ad){return pm2[_0xd954('0x20')](_0xd954('0x21'))[_0xd954('0x22')](function(_0x42863f){logger[_0xd954('0x19')]('pm2\x20restart\x20motion\x20%s',_0x42863f);return _0x5871ad[_0xd954('0x18')](0xc8)[_0xd954('0x14')]({'output':'Your\x20system\x20has\x20been\x20restart\x20successfully'});})[_0xd954('0x23')](function(_0x17bb87){logger[_0xd954('0x17')](_0x17bb87);return _0x5871ad[_0xd954('0x18')](0x1f4)[_0xd954('0x14')](_0x17bb87);});};exports['migrations']=function(_0x525429,_0x46f7ac){var _0x1b289b=fs['readdirSync'](path[_0xd954('0x24')](config[_0xd954('0xc')],_0xd954('0x25'),_0xd954('0x26')));var _0x36714e=[];for(var _0x2a639d=0x0;_0x2a639d<_0x1b289b['length'];_0x2a639d++){var _0x5723e1=_0x1b289b[_0x2a639d]['replace']('.js','');if(compareVersions(module['exports']['version'],_0x5723e1)===-0x1){_0x36714e[_0xd954('0x27')](_0x5723e1);}}if(_0x36714e[_0xd954('0x28')]){var _0x1619b8=_0x36714e[_0xd954('0x29')](compareVersions);var _0x5f4e90=new Umzug({'storage':_0xd954('0x2a'),'storageOptions':{'model':db[_0xd954('0x2b')],'modelName':_0xd954('0x2b'),'columnName':_0xd954('0x3')},'migrations':{'params':[db[_0xd954('0x2a')][_0xd954('0x2c')](),db[_0xd954('0x2a')][_0xd954('0x2d')],function(){throw new Error(_0xd954('0x2e'));}],'path':path[_0xd954('0x24')](config['root'],_0xd954('0x25'),_0xd954('0x26')),'pattern':/\.js$/}});_0x5f4e90['up']({'migrations':_['map'](_0x1619b8,function(_0x507382){return _0x507382+'.js';})})['then'](function(){return _0x46f7ac[_0xd954('0x18')](0xc8)[_0xd954('0x14')]({'output':'Database\x20migrated\x20successfully\x20from\x20version\x20'+module[_0xd954('0xe')][_0xd954('0x3')]+_0xd954('0x2f')+_[_0xd954('0x30')](_0x1619b8),'migrations':_[_0xd954('0x24')](_0x1619b8)});})[_0xd954('0x23')](function(_0x5f051a){if(_0x5f051a instanceof db[_0xd954('0x2a')]['UniqueConstraintError']){return _0x46f7ac[_0xd954('0x18')](0xc8)[_0xd954('0x14')]({'output':_0xd954('0x31')});}else{return _0x46f7ac[_0xd954('0x18')](0x1f4)['json'](_0x5f051a);}});}else{return _0x46f7ac[_0xd954('0x18')](0xc8)[_0xd954('0x14')]({'output':'Database\x20already\x20up-to-date'});}}; \ No newline at end of file +var _0xeca7=['pkginfo','version','compare-versions','child_process','exec','../../mysqldb','../../config/environment','update','root','index','exports','query','latest','fetch','tags','2.0.0','status','json','origin','master','git\x20fetch','git\x20fetch\x20origin\x20master','reset','--hard','FETCH_HEAD','info','pull','npm\x20install\x20--production','error','restart','motion2','then','Your\x20system\x20has\x20been\x20restart\x20successfully','migrations','readdirSync','join','server','length','replace','push','Migration','getQueryInterface','sequelize','constructor','Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.','map','.js','Database\x20migrated\x20successfully\x20from\x20version\x20','\x20to\x20','last','catch','UniqueConstraintError','Database\x20already\x20up-to-date','path','lodash'];(function(_0x2b5eae,_0x55010d){var _0x5f3ac9=function(_0x397bfc){while(--_0x397bfc){_0x2b5eae['push'](_0x2b5eae['shift']());}};_0x5f3ac9(++_0x55010d);}(_0xeca7,0x148));var _0x7eca=function(_0x3e23fd,_0x324cb8){_0x3e23fd=_0x3e23fd-0x0;var _0x23e70d=_0xeca7[_0x3e23fd];return _0x23e70d;};'use strict';var Umzug=require('umzug');var path=require(_0x7eca('0x0'));var fs=require('fs');var _=require(_0x7eca('0x1'));var pkginfo=require(_0x7eca('0x2'))(module,_0x7eca('0x3'));var compareVersions=require(_0x7eca('0x4'));var exec=require(_0x7eca('0x5'))[_0x7eca('0x6')];var db=require(_0x7eca('0x7'))['db'];var config=require(_0x7eca('0x8'));var pm2=require('../../config/pm2');var logger=require('../../config/logger')(_0x7eca('0x9'));var git=require('simple-git')(config[_0x7eca('0xa')]);exports[_0x7eca('0xb')]=function(_0x39f862,_0x71a2c8){var _0x51736e={'current':module[_0x7eca('0xc')][_0x7eca('0x3')],'phonebar':0x2};if(_0x39f862[_0x7eca('0xd')]&&_0x39f862[_0x7eca('0xd')][_0x7eca('0xe')]){return git[_0x7eca('0xf')]()[_0x7eca('0x10')](function(_0x34122c,_0x18651c){_0x51736e[_0x7eca('0xe')]=(_0x34122c?module['exports'][_0x7eca('0x3')]:_0x18651c[_0x7eca('0xe')])||_0x7eca('0x11');return _0x71a2c8[_0x7eca('0x12')](0xc8)[_0x7eca('0x13')](_0x51736e);});}else{return _0x71a2c8[_0x7eca('0x12')](0xc8)[_0x7eca('0x13')](_0x51736e);}};exports[_0x7eca('0xf')]=function(_0x3415b2,_0x44b0c2){return git[_0x7eca('0xf')]([_0x7eca('0x14'),_0x7eca('0x15')],function(_0x3b622c){if(_0x3b622c){logger['error'](_0x3b622c);return _0x44b0c2[_0x7eca('0x12')](0x1f4)[_0x7eca('0x13')](_0x3b622c);}logger['info'](_0x7eca('0x16'));return _0x44b0c2[_0x7eca('0x12')](0xc8)[_0x7eca('0x13')]({'output':_0x7eca('0x17')});});};exports['reset']=function(_0xd3acdc,_0x163a33){return git[_0x7eca('0x18')]([_0x7eca('0x19'),_0x7eca('0x1a')],function(_0x33b5e4){if(_0x33b5e4){logger['error'](_0x33b5e4);return _0x163a33[_0x7eca('0x12')](0x1f4)[_0x7eca('0x13')](_0x33b5e4);}logger[_0x7eca('0x1b')]('git\x20reset\x20--hard\x20FETCH_HEAD');return _0x163a33[_0x7eca('0x12')](0xc8)['json']({'output':'git\x20reset\x20--hard'});});};exports[_0x7eca('0x1c')]=function(_0x1f4b8a,_0x301761){exec(_0x7eca('0x1d'),function(_0x435be8,_0x44fb27,_0x38c54d){logger['info'](_0x44fb27);logger[_0x7eca('0x1b')](_0x38c54d);if(_0x435be8){logger[_0x7eca('0x1e')](_0x435be8);return _0x301761['status'](0x1f4)[_0x7eca('0x13')](_0x435be8);}return _0x301761[_0x7eca('0x12')](0xc8)[_0x7eca('0x13')]({'output':_0x44fb27});});};exports[_0x7eca('0x1f')]=function(_0x17c3d7,_0x175cda){return pm2[_0x7eca('0x1f')](_0x7eca('0x20'))[_0x7eca('0x21')](function(_0x4938dc){logger[_0x7eca('0x1b')]('pm2\x20restart\x20motion\x20%s',_0x4938dc);return _0x175cda['status'](0xc8)[_0x7eca('0x13')]({'output':_0x7eca('0x22')});})['catch'](function(_0x174f53){logger['error'](_0x174f53);return _0x175cda[_0x7eca('0x12')](0x1f4)[_0x7eca('0x13')](_0x174f53);});};exports[_0x7eca('0x23')]=function(_0x1c6538,_0x5a6270){var _0x199c2e=fs[_0x7eca('0x24')](path[_0x7eca('0x25')](config[_0x7eca('0xa')],_0x7eca('0x26'),_0x7eca('0x23')));var _0x40c738=[];for(var _0x1ed9c7=0x0;_0x1ed9c7<_0x199c2e[_0x7eca('0x27')];_0x1ed9c7++){var _0x52f878=_0x199c2e[_0x1ed9c7][_0x7eca('0x28')]('.js','');if(compareVersions(module[_0x7eca('0xc')][_0x7eca('0x3')],_0x52f878)===-0x1){_0x40c738[_0x7eca('0x29')](_0x52f878);}}if(_0x40c738['length']){var _0x348954=_0x40c738['sort'](compareVersions);var _0x167723=new Umzug({'storage':'sequelize','storageOptions':{'model':db[_0x7eca('0x2a')],'modelName':_0x7eca('0x2a'),'columnName':_0x7eca('0x3')},'migrations':{'params':[db['sequelize'][_0x7eca('0x2b')](),db[_0x7eca('0x2c')][_0x7eca('0x2d')],function(){throw new Error(_0x7eca('0x2e'));}],'path':path[_0x7eca('0x25')](config[_0x7eca('0xa')],'server',_0x7eca('0x23')),'pattern':/\.js$/}});_0x167723['up']({'migrations':_[_0x7eca('0x2f')](_0x348954,function(_0x2b0c37){return _0x2b0c37+_0x7eca('0x30');})})[_0x7eca('0x21')](function(){return _0x5a6270[_0x7eca('0x12')](0xc8)[_0x7eca('0x13')]({'output':_0x7eca('0x31')+module[_0x7eca('0xc')][_0x7eca('0x3')]+_0x7eca('0x32')+_[_0x7eca('0x33')](_0x348954),'migrations':_[_0x7eca('0x25')](_0x348954)});})[_0x7eca('0x34')](function(_0x540745){if(_0x540745 instanceof db[_0x7eca('0x2c')][_0x7eca('0x35')]){return _0x5a6270[_0x7eca('0x12')](0xc8)[_0x7eca('0x13')]({'output':_0x7eca('0x36')});}else{return _0x5a6270[_0x7eca('0x12')](0x1f4)[_0x7eca('0x13')](_0x540745);}});}else{return _0x5a6270[_0x7eca('0x12')](0xc8)[_0x7eca('0x13')]({'output':_0x7eca('0x36')});}}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/index.js b/server/api/voiceAgentReport/index.js index ff0b132..9b64b36 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 _0x0a5b=['./voiceAgentReport.controller','get','isAuthenticated','index','/describe','/:id','exports','util','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment'];(function(_0x344a3f,_0x579a22){var _0x264712=function(_0x34c9f0){while(--_0x34c9f0){_0x344a3f['push'](_0x344a3f['shift']());}};_0x264712(++_0x579a22);}(_0x0a5b,0x13f));var _0xb0a5=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0a5b[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require(_0xb0a5('0x0'));var path=require('path');var timeout=require(_0xb0a5('0x1'));var express=require(_0xb0a5('0x2'));var router=express['Router']();var fs_extra=require(_0xb0a5('0x3'));var auth=require(_0xb0a5('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xb0a5('0x5'));var controller=require(_0xb0a5('0x6'));router[_0xb0a5('0x7')]('/',auth[_0xb0a5('0x8')](),controller[_0xb0a5('0x9')]);router['get'](_0xb0a5('0xa'),auth[_0xb0a5('0x8')](),controller['describe']);router[_0xb0a5('0x7')](_0xb0a5('0xb'),auth[_0xb0a5('0x8')](),controller['show']);router['post']('/',auth[_0xb0a5('0x8')](),controller['create']);router['put'](_0xb0a5('0xb'),auth['isAuthenticated'](),controller['update']);router['delete'](_0xb0a5('0xb'),auth[_0xb0a5('0x8')](),controller['destroy']);module[_0xb0a5('0xc')]=router; \ No newline at end of file +var _0x0dab=['isAuthenticated','index','/describe','describe','show','update','delete','/:id','destroy','exports','multer','express','Router','fs-extra','../../config/environment','./voiceAgentReport.controller','get'];(function(_0x105d88,_0x15236b){var _0x5ca6b0=function(_0x5a3d5b){while(--_0x5a3d5b){_0x105d88['push'](_0x105d88['shift']());}};_0x5ca6b0(++_0x15236b);}(_0x0dab,0x12b));var _0xb0da=function(_0x46e283,_0x17090f){_0x46e283=_0x46e283-0x0;var _0x3ab828=_0x0dab[_0x46e283];return _0x3ab828;};'use strict';var multer=require(_0xb0da('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0xb0da('0x1'));var router=express[_0xb0da('0x2')]();var fs_extra=require(_0xb0da('0x3'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xb0da('0x4'));var controller=require(_0xb0da('0x5'));router[_0xb0da('0x6')]('/',auth[_0xb0da('0x7')](),controller[_0xb0da('0x8')]);router['get'](_0xb0da('0x9'),auth[_0xb0da('0x7')](),controller[_0xb0da('0xa')]);router[_0xb0da('0x6')]('/:id',auth[_0xb0da('0x7')](),controller[_0xb0da('0xb')]);router['post']('/',auth[_0xb0da('0x7')](),controller['create']);router['put']('/:id',auth[_0xb0da('0x7')](),controller[_0xb0da('0xc')]);router[_0xb0da('0xd')](_0xb0da('0xe'),auth[_0xb0da('0x7')](),controller[_0xb0da('0xf')]);module[_0xb0da('0x10')]=router; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.attributes.js b/server/api/voiceAgentReport/voiceAgentReport.attributes.js index e0b6fd4..f350d56 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 _0xd237=['exports','STRING','DATE','BOOLEAN','INTEGER','FORWARD,\x20BLIND,\x20ATTENDED','sequelize'];(function(_0x5e73eb,_0x13040f){var _0xecb737=function(_0xc46bf9){while(--_0xc46bf9){_0x5e73eb['push'](_0x5e73eb['shift']());}};_0xecb737(++_0x13040f);}(_0xd237,0x14f));var _0x7d23=function(_0xb11807,_0x3ad4d8){_0xb11807=_0xb11807-0x0;var _0x4e0025=_0xd237[_0xb11807];return _0x4e0025;};'use strict';var Sequelize=require(_0x7d23('0x0'));module[_0x7d23('0x1')]={'type':{'type':Sequelize[_0x7d23('0x2')]},'uniqueid':{'type':Sequelize[_0x7d23('0x2')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x7d23('0x2')]},'queue':{'type':Sequelize[_0x7d23('0x2')]},'interface':{'type':Sequelize[_0x7d23('0x2')]},'membername':{'type':Sequelize[_0x7d23('0x2')]},'agentcalledAt':{'type':Sequelize[_0x7d23('0x3')]},'agentconnectAt':{'type':Sequelize[_0x7d23('0x3')]},'agentcompleteAt':{'type':Sequelize['DATE']},'agentringnoanswerAt':{'type':Sequelize[_0x7d23('0x3')]},'agentdumpAt':{'type':Sequelize['DATE']},'holdtime':{'type':Sequelize['INTEGER']},'agentcomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0x7d23('0x4')],'defaultValue':![]},'agentdump':{'type':Sequelize[_0x7d23('0x4')],'defaultValue':![]},'talktime':{'type':Sequelize[_0x7d23('0x5')]},'agentacw':{'type':Sequelize[_0x7d23('0x4')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x7d23('0x5')]},'reason':{'type':Sequelize[_0x7d23('0x2')]},'lastevent':{'type':Sequelize[_0x7d23('0x2')]},'channel':{'type':Sequelize[_0x7d23('0x2')]},'channelstate':{'type':Sequelize['INTEGER']},'channelstatedesc':{'type':Sequelize[_0x7d23('0x2')]},'connectedlinenum':{'type':Sequelize[_0x7d23('0x2')]},'connectedlinename':{'type':Sequelize[_0x7d23('0x2')]},'language':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x7d23('0x2')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0x7d23('0x2')]},'priority':{'type':Sequelize[_0x7d23('0x2')]},'destchannel':{'type':Sequelize[_0x7d23('0x2')]},'destchannelstate':{'type':Sequelize[_0x7d23('0x5')]},'destchannelstatedesc':{'type':Sequelize[_0x7d23('0x2')]},'destcalleridnum':{'type':Sequelize[_0x7d23('0x2')]},'destcalleridname':{'type':Sequelize[_0x7d23('0x2')]},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize[_0x7d23('0x2')]},'destaccountcode':{'type':Sequelize[_0x7d23('0x2')]},'destcontext':{'type':Sequelize[_0x7d23('0x2')]},'destexten':{'type':Sequelize[_0x7d23('0x2')]},'destpriority':{'type':Sequelize['STRING']},'destuniqueid':{'type':Sequelize[_0x7d23('0x2')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize['STRING']},'answeredelsewheremembername':{'type':Sequelize[_0x7d23('0x2')]},'transfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x7d23('0x2')],'comment':_0x7d23('0x6')},'transferexten':{'type':Sequelize[_0x7d23('0x2')]},'transferuniqueid':{'type':Sequelize[_0x7d23('0x2')]},'agententerreason':{'type':Sequelize[_0x7d23('0x5')],'defaultValue':0x0}}; \ No newline at end of file +var _0x87d9=['STRING','DATE','INTEGER','BOOLEAN','FORWARD,\x20BLIND,\x20ATTENDED','sequelize'];(function(_0x5e5c65,_0x432191){var _0x5ae21d=function(_0x4e0d5c){while(--_0x4e0d5c){_0x5e5c65['push'](_0x5e5c65['shift']());}};_0x5ae21d(++_0x432191);}(_0x87d9,0x143));var _0x987d=function(_0x1de3a0,_0x17593c){_0x1de3a0=_0x1de3a0-0x0;var _0x396141=_0x87d9[_0x1de3a0];return _0x396141;};'use strict';var Sequelize=require(_0x987d('0x0'));module['exports']={'type':{'type':Sequelize[_0x987d('0x1')]},'uniqueid':{'type':Sequelize[_0x987d('0x1')]},'calleridnum':{'type':Sequelize[_0x987d('0x1')]},'calleridname':{'type':Sequelize[_0x987d('0x1')]},'queue':{'type':Sequelize[_0x987d('0x1')]},'interface':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0x987d('0x1')]},'agentcalledAt':{'type':Sequelize['DATE']},'agentconnectAt':{'type':Sequelize[_0x987d('0x2')]},'agentcompleteAt':{'type':Sequelize[_0x987d('0x2')]},'agentringnoanswerAt':{'type':Sequelize['DATE']},'agentdumpAt':{'type':Sequelize[_0x987d('0x2')]},'holdtime':{'type':Sequelize[_0x987d('0x3')]},'agentcomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0x987d('0x4')],'defaultValue':![]},'agentdump':{'type':Sequelize[_0x987d('0x4')],'defaultValue':![]},'talktime':{'type':Sequelize[_0x987d('0x3')]},'agentacw':{'type':Sequelize[_0x987d('0x4')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x987d('0x3')]},'reason':{'type':Sequelize[_0x987d('0x1')]},'lastevent':{'type':Sequelize[_0x987d('0x1')]},'channel':{'type':Sequelize['STRING']},'channelstate':{'type':Sequelize[_0x987d('0x3')]},'channelstatedesc':{'type':Sequelize[_0x987d('0x1')]},'connectedlinenum':{'type':Sequelize[_0x987d('0x1')]},'connectedlinename':{'type':Sequelize[_0x987d('0x1')]},'language':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x987d('0x1')]},'context':{'type':Sequelize[_0x987d('0x1')]},'exten':{'type':Sequelize[_0x987d('0x1')]},'priority':{'type':Sequelize[_0x987d('0x1')]},'destchannel':{'type':Sequelize[_0x987d('0x1')]},'destchannelstate':{'type':Sequelize[_0x987d('0x3')]},'destchannelstatedesc':{'type':Sequelize[_0x987d('0x1')]},'destcalleridnum':{'type':Sequelize[_0x987d('0x1')]},'destcalleridname':{'type':Sequelize[_0x987d('0x1')]},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize[_0x987d('0x1')]},'destaccountcode':{'type':Sequelize[_0x987d('0x1')]},'destcontext':{'type':Sequelize[_0x987d('0x1')]},'destexten':{'type':Sequelize[_0x987d('0x1')]},'destpriority':{'type':Sequelize[_0x987d('0x1')]},'destuniqueid':{'type':Sequelize[_0x987d('0x1')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0x987d('0x1')]},'answeredelsewheremembername':{'type':Sequelize[_0x987d('0x1')]},'transfer':{'type':Sequelize[_0x987d('0x4')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x987d('0x1')],'comment':_0x987d('0x5')},'transferexten':{'type':Sequelize[_0x987d('0x1')]},'transferuniqueid':{'type':Sequelize[_0x987d('0x1')]},'agententerreason':{'type':Sequelize[_0x987d('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 f1e1289..18552ec 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(_0x119d5a,_0x19b457){var _0x15bff4=function(_0x1b7c78){while(--_0x1b7c78){_0x119d5a['push'](_0x119d5a['shift']());}};_0x15bff4(++_0x19b457);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2763f2,_0x416af8){_0x2763f2=_0x2763f2-0x0;var _0x3ef471=_0xa9e0[_0x2763f2];return _0x3ef471;};'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(_0x25e7cb,_0x3579b7){var _0x375d92=function(_0xe8cf3b){while(--_0xe8cf3b){_0x25e7cb['push'](_0x25e7cb['shift']());}};_0x375d92(++_0x3579b7);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5447fd,_0x52a6b5){_0x5447fd=_0x5447fd-0x0;var _0x15b28a=_0xa9e0[_0x5447fd];return _0x15b28a;};'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 a73ecf9..bf9ceac 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 _0x5089=['util','api','moment','bluebird','request-promise','path','../../config/environment','exports','VoiceAgentReport','report_agent','destuniqueid','lodash'];(function(_0x34f178,_0x473b1d){var _0x281c93=function(_0x53ef91){while(--_0x53ef91){_0x34f178['push'](_0x34f178['shift']());}};_0x281c93(++_0x473b1d);}(_0x5089,0x1bb));var _0x9508=function(_0x1c289a,_0x277fe7){_0x1c289a=_0x1c289a-0x0;var _0x28d68e=_0x5089[_0x1c289a];return _0x28d68e;};'use strict';var _=require(_0x9508('0x0'));var util=require(_0x9508('0x1'));var logger=require('../../config/logger')(_0x9508('0x2'));var moment=require(_0x9508('0x3'));var BPromise=require(_0x9508('0x4'));var rp=require(_0x9508('0x5'));var fs=require('fs');var path=require(_0x9508('0x6'));var rimraf=require('rimraf');var config=require(_0x9508('0x7'));var attributes=require('./voiceAgentReport.attributes');module[_0x9508('0x8')]=function(_0x4538dd,_0x257318){return _0x4538dd['define'](_0x9508('0x9'),attributes,{'tableName':_0x9508('0xa'),'paranoid':![],'indexes':[{'fields':['uniqueid',_0x9508('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xe14b=['bluebird','path','./voiceAgentReport.attributes','exports','define','VoiceAgentReport','report_agent','lodash','util','moment'];(function(_0x55f8fa,_0x616528){var _0x20a9a9=function(_0x337bb5){while(--_0x337bb5){_0x55f8fa['push'](_0x55f8fa['shift']());}};_0x20a9a9(++_0x616528);}(_0xe14b,0x93));var _0xbe14=function(_0x554040,_0x19de65){_0x554040=_0x554040-0x0;var _0x4a9eb7=_0xe14b[_0x554040];return _0x4a9eb7;};'use strict';var _=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xbe14('0x2'));var BPromise=require(_0xbe14('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbe14('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xbe14('0x5'));module[_0xbe14('0x6')]=function(_0x1fe204,_0x1ff100){return _0x1fe204[_0xbe14('0x7')](_0xbe14('0x8'),attributes,{'tableName':_0xbe14('0x9'),'paranoid':![],'indexes':[{'fields':['uniqueid','destuniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.rpc.js b/server/api/voiceAgentReport/voiceAgentReport.rpc.js index 4bd57bf..a08346a 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 _0xfce8=['update','where','attributes','limit','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','VoiceAgentReport,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','CreateVoiceAgentReport','VoiceAgentReport','create','body','options','raw','debug','UpdateVoiceAgentReport'];(function(_0x31b751,_0x450ee3){var _0x2e316e=function(_0x1c15b1){while(--_0x1c15b1){_0x31b751['push'](_0x31b751['shift']());}};_0x2e316e(++_0x450ee3);}(_0xfce8,0x1cb));var _0x8fce=function(_0x169669,_0x1c7094){_0x169669=_0x169669-0x0;var _0x12e24d=_0xfce8[_0x169669];return _0x12e24d;};'use strict';var _=require(_0x8fce('0x0'));var util=require(_0x8fce('0x1'));var moment=require(_0x8fce('0x2'));var BPromise=require(_0x8fce('0x3'));var rs=require(_0x8fce('0x4'));var fs=require('fs');var Redis=require(_0x8fce('0x5'));var db=require(_0x8fce('0x6'))['db'];var utils=require(_0x8fce('0x7'));var logger=require(_0x8fce('0x8'))(_0x8fce('0x9'));var config=require(_0x8fce('0xa'));var jayson=require('jayson/promise');var client=jayson[_0x8fce('0xb')][_0x8fce('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x807466,_0x25ac6e,_0xdd6f85){return new BPromise(function(_0x4cb8a4,_0x58cfad){return client[_0x8fce('0xd')](_0x807466,_0xdd6f85)[_0x8fce('0xe')](function(_0x2eef12){logger[_0x8fce('0xf')](_0x8fce('0x10'),_0x25ac6e,_0x8fce('0x11'));logger['debug']('VoiceAgentReport,\x20%s,\x20%s,\x20%s',_0x25ac6e,_0x8fce('0x11'),JSON[_0x8fce('0x12')](_0x2eef12));if(_0x2eef12[_0x8fce('0x13')]){if(_0x2eef12[_0x8fce('0x13')]['code']===0x1f4){logger['error']('VoiceAgentReport,\x20%s,\x20%s',_0x25ac6e,_0x2eef12[_0x8fce('0x13')]['message']);return _0x58cfad(_0x2eef12[_0x8fce('0x13')]['message']);}logger[_0x8fce('0x13')](_0x8fce('0x10'),_0x25ac6e,_0x2eef12[_0x8fce('0x13')][_0x8fce('0x14')]);return _0x4cb8a4(_0x2eef12[_0x8fce('0x13')][_0x8fce('0x14')]);}else{logger[_0x8fce('0xf')](_0x8fce('0x10'),_0x25ac6e,_0x8fce('0x11'));_0x4cb8a4(_0x2eef12[_0x8fce('0x15')][_0x8fce('0x14')]);}})[_0x8fce('0x16')](function(_0x2ba8cf){logger[_0x8fce('0x13')](_0x8fce('0x10'),_0x25ac6e,_0x2ba8cf);_0x58cfad(_0x2ba8cf);});});}exports[_0x8fce('0x17')]=function(_0x18ca4e){var _0x5548db=this;return new Promise(function(_0x684562,_0x346b88){return db[_0x8fce('0x18')][_0x8fce('0x19')](_0x18ca4e[_0x8fce('0x1a')],{'raw':_0x18ca4e[_0x8fce('0x1b')]?_0x18ca4e['options'][_0x8fce('0x1c')]===undefined?!![]:![]:!![]})[_0x8fce('0xe')](function(_0x379cc2){logger[_0x8fce('0xf')](_0x8fce('0x17'),_0x18ca4e);logger[_0x8fce('0x1d')](_0x8fce('0x17'),_0x18ca4e,JSON[_0x8fce('0x12')](_0x379cc2));_0x684562(_0x379cc2);})[_0x8fce('0x16')](function(_0x3b67b3){logger[_0x8fce('0x13')](_0x8fce('0x17'),_0x3b67b3[_0x8fce('0x14')],_0x18ca4e);_0x346b88(_0x5548db['error'](0x1f4,_0x3b67b3[_0x8fce('0x14')]));});});};exports[_0x8fce('0x1e')]=function(_0x16c99d){var _0x2d7344=this;return new Promise(function(_0xbb3dd5,_0x18f646){return db[_0x8fce('0x18')][_0x8fce('0x1f')](_0x16c99d[_0x8fce('0x1a')],{'raw':_0x16c99d[_0x8fce('0x1b')]?_0x16c99d['options'][_0x8fce('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x16c99d['options']?_0x16c99d[_0x8fce('0x1b')][_0x8fce('0x20')]||null:null,'attributes':_0x16c99d[_0x8fce('0x1b')]?_0x16c99d[_0x8fce('0x1b')][_0x8fce('0x21')]||null:null,'limit':_0x16c99d['options']?_0x16c99d[_0x8fce('0x1b')][_0x8fce('0x22')]||null:null})[_0x8fce('0xe')](function(_0x39b524){logger[_0x8fce('0xf')](_0x8fce('0x1e'),_0x16c99d);logger[_0x8fce('0x1d')](_0x8fce('0x1e'),_0x16c99d,JSON['stringify'](_0x39b524));_0xbb3dd5(_0x39b524);})['catch'](function(_0x4b31c6){logger['error'](_0x8fce('0x1e'),_0x4b31c6[_0x8fce('0x14')],_0x16c99d);_0x18f646(_0x2d7344[_0x8fce('0x13')](0x1f4,_0x4b31c6['message']));});});}; \ No newline at end of file +var _0x208a=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','VoiceAgentReport,\x20%s,\x20%s','request\x20sent','debug','VoiceAgentReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','CreateVoiceAgentReport','VoiceAgentReport','body','options','raw','UpdateVoiceAgentReport','update','attributes','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x208a,0x1c8));var _0xa208=function(_0x1f9fc0,_0x498807){_0x1f9fc0=_0x1f9fc0-0x0;var _0x3a20e8=_0x208a[_0x1f9fc0];return _0x3a20e8;};'use strict';var _=require(_0xa208('0x0'));var util=require(_0xa208('0x1'));var moment=require(_0xa208('0x2'));var BPromise=require(_0xa208('0x3'));var rs=require(_0xa208('0x4'));var fs=require('fs');var Redis=require(_0xa208('0x5'));var db=require(_0xa208('0x6'))['db'];var utils=require(_0xa208('0x7'));var logger=require(_0xa208('0x8'))(_0xa208('0x9'));var config=require(_0xa208('0xa'));var jayson=require(_0xa208('0xb'));var client=jayson['client'][_0xa208('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x138917,_0xee8209,_0x4ab4e0){return new BPromise(function(_0x4ed868,_0x23dd78){return client[_0xa208('0xd')](_0x138917,_0x4ab4e0)[_0xa208('0xe')](function(_0x154280){logger[_0xa208('0xf')](_0xa208('0x10'),_0xee8209,_0xa208('0x11'));logger[_0xa208('0x12')](_0xa208('0x13'),_0xee8209,_0xa208('0x11'),JSON['stringify'](_0x154280));if(_0x154280[_0xa208('0x14')]){if(_0x154280[_0xa208('0x14')][_0xa208('0x15')]===0x1f4){logger[_0xa208('0x14')]('VoiceAgentReport,\x20%s,\x20%s',_0xee8209,_0x154280['error'][_0xa208('0x16')]);return _0x23dd78(_0x154280['error'][_0xa208('0x16')]);}logger[_0xa208('0x14')](_0xa208('0x10'),_0xee8209,_0x154280[_0xa208('0x14')]['message']);return _0x4ed868(_0x154280[_0xa208('0x14')]['message']);}else{logger[_0xa208('0xf')](_0xa208('0x10'),_0xee8209,_0xa208('0x11'));_0x4ed868(_0x154280[_0xa208('0x17')][_0xa208('0x16')]);}})[_0xa208('0x18')](function(_0xe685f0){logger[_0xa208('0x14')](_0xa208('0x10'),_0xee8209,_0xe685f0);_0x23dd78(_0xe685f0);});});}exports[_0xa208('0x19')]=function(_0x10bc35){var _0x56753e=this;return new Promise(function(_0x42885a,_0x22fb70){return db[_0xa208('0x1a')]['create'](_0x10bc35[_0xa208('0x1b')],{'raw':_0x10bc35[_0xa208('0x1c')]?_0x10bc35[_0xa208('0x1c')][_0xa208('0x1d')]===undefined?!![]:![]:!![]})['then'](function(_0x3bb6ca){logger[_0xa208('0xf')]('CreateVoiceAgentReport',_0x10bc35);logger[_0xa208('0x12')](_0xa208('0x19'),_0x10bc35,JSON['stringify'](_0x3bb6ca));_0x42885a(_0x3bb6ca);})['catch'](function(_0x1efcad){logger['error'](_0xa208('0x19'),_0x1efcad[_0xa208('0x16')],_0x10bc35);_0x22fb70(_0x56753e['error'](0x1f4,_0x1efcad[_0xa208('0x16')]));});});};exports[_0xa208('0x1e')]=function(_0x54e2cb){var _0x2ba30f=this;return new Promise(function(_0x26912c,_0x5965f6){return db[_0xa208('0x1a')][_0xa208('0x1f')](_0x54e2cb[_0xa208('0x1b')],{'raw':_0x54e2cb[_0xa208('0x1c')]?_0x54e2cb['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x54e2cb[_0xa208('0x1c')]?_0x54e2cb['options']['where']||null:null,'attributes':_0x54e2cb[_0xa208('0x1c')]?_0x54e2cb['options'][_0xa208('0x20')]||null:null,'limit':_0x54e2cb[_0xa208('0x1c')]?_0x54e2cb[_0xa208('0x1c')]['limit']||null:null})[_0xa208('0xe')](function(_0xc5e4c8){logger[_0xa208('0xf')](_0xa208('0x1e'),_0x54e2cb);logger[_0xa208('0x12')](_0xa208('0x1e'),_0x54e2cb,JSON['stringify'](_0xc5e4c8));_0x26912c(_0xc5e4c8);})[_0xa208('0x18')](function(_0x3649cd){logger['error']('UpdateVoiceAgentReport',_0x3649cd['message'],_0x54e2cb);_0x5965f6(_0x2ba30f[_0xa208('0x14')](0x1f4,_0x3649cd['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/index.js b/server/api/voiceCallReport/index.js index 2127d65..ced7f55 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 _0xf006=['post','create','put','update','destroy','exports','path','connect-timeout','Router','../../components/auth/service','./voiceCallReport.controller','get','isAuthenticated','describe','/:id','show'];(function(_0x358c86,_0x38a8a2){var _0x52edc5=function(_0x560096){while(--_0x560096){_0x358c86['push'](_0x358c86['shift']());}};_0x52edc5(++_0x38a8a2);}(_0xf006,0x146));var _0x6f00=function(_0x23e726,_0x14634f){_0x23e726=_0x23e726-0x0;var _0x4e401f=_0xf006[_0x23e726];return _0x4e401f;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x6f00('0x0'));var timeout=require(_0x6f00('0x1'));var express=require('express');var router=express[_0x6f00('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x6f00('0x3'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x6f00('0x4'));router[_0x6f00('0x5')]('/',auth[_0x6f00('0x6')](),controller['index']);router[_0x6f00('0x5')]('/describe',auth[_0x6f00('0x6')](),controller[_0x6f00('0x7')]);router[_0x6f00('0x5')](_0x6f00('0x8'),auth[_0x6f00('0x6')](),controller[_0x6f00('0x9')]);router[_0x6f00('0xa')]('/',auth[_0x6f00('0x6')](),controller[_0x6f00('0xb')]);router[_0x6f00('0xc')](_0x6f00('0x8'),auth[_0x6f00('0x6')](),controller[_0x6f00('0xd')]);router['delete'](_0x6f00('0x8'),auth[_0x6f00('0x6')](),controller[_0x6f00('0xe')]);module[_0x6f00('0xf')]=router; \ No newline at end of file +var _0x98a8=['multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./voiceCallReport.controller','get','isAuthenticated','/:id','show','post','create','put','update','destroy','exports'];(function(_0x57725a,_0x5d5aab){var _0x39d204=function(_0x3f1646){while(--_0x3f1646){_0x57725a['push'](_0x57725a['shift']());}};_0x39d204(++_0x5d5aab);}(_0x98a8,0x12c));var _0x898a=function(_0x2fb55c,_0xdbd552){_0x2fb55c=_0x2fb55c-0x0;var _0x4a8f25=_0x98a8[_0x2fb55c];return _0x4a8f25;};'use strict';var multer=require(_0x898a('0x0'));var util=require(_0x898a('0x1'));var path=require(_0x898a('0x2'));var timeout=require(_0x898a('0x3'));var express=require(_0x898a('0x4'));var router=express[_0x898a('0x5')]();var fs_extra=require(_0x898a('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x898a('0x7'));var config=require(_0x898a('0x8'));var controller=require(_0x898a('0x9'));router[_0x898a('0xa')]('/',auth[_0x898a('0xb')](),controller['index']);router[_0x898a('0xa')]('/describe',auth[_0x898a('0xb')](),controller['describe']);router[_0x898a('0xa')](_0x898a('0xc'),auth[_0x898a('0xb')](),controller[_0x898a('0xd')]);router[_0x898a('0xe')]('/',auth[_0x898a('0xb')](),controller[_0x898a('0xf')]);router[_0x898a('0x10')](_0x898a('0xc'),auth['isAuthenticated'](),controller[_0x898a('0x11')]);router['delete'](_0x898a('0xc'),auth['isAuthenticated'](),controller[_0x898a('0x12')]);module[_0x898a('0x13')]=router; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.attributes.js b/server/api/voiceCallReport/voiceCallReport.attributes.js index bef2186..960186a 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 _0x2c02=['DATE','INTEGER','sequelize','ENUM','internal','inbound-fax','outbound-fax','dialer','STRING'];(function(_0x47e549,_0x2e53d6){var _0x251374=function(_0x400458){while(--_0x400458){_0x47e549['push'](_0x47e549['shift']());}};_0x251374(++_0x2e53d6);}(_0x2c02,0x18e));var _0x22c0=function(_0xf24de9,_0x3ff93b){_0xf24de9=_0xf24de9-0x0;var _0x1b927e=_0x2c02[_0xf24de9];return _0x1b927e;};'use strict';var Sequelize=require(_0x22c0('0x0'));module['exports']={'uniqueid':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x22c0('0x1')]('inbound',_0x22c0('0x2'),'outbound',_0x22c0('0x3'),_0x22c0('0x4'),_0x22c0('0x5'))},'tag':{'type':Sequelize[_0x22c0('0x6')]},'accountcode':{'type':Sequelize[_0x22c0('0x6')]},'source':{'type':Sequelize[_0x22c0('0x6')]},'destination':{'type':Sequelize[_0x22c0('0x6')]},'destinationcontext':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0x22c0('0x6')]},'channel':{'type':Sequelize[_0x22c0('0x6')]},'destinationchannel':{'type':Sequelize[_0x22c0('0x6')]},'lastapplication':{'type':Sequelize[_0x22c0('0x6')]},'lastdata':{'type':Sequelize['TEXT']},'starttime':{'type':Sequelize[_0x22c0('0x7')]},'systemanswertime':{'type':Sequelize[_0x22c0('0x7')]},'answertime':{'type':Sequelize[_0x22c0('0x7')]},'endtime':{'type':Sequelize[_0x22c0('0x7')]},'duration':{'type':Sequelize[_0x22c0('0x8')]},'billableseconds':{'type':Sequelize[_0x22c0('0x8')]},'mohtime':{'type':Sequelize[_0x22c0('0x8')],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x22c0('0x6')]},'amaflags':{'type':Sequelize[_0x22c0('0x6')]},'userfield':{'type':Sequelize[_0x22c0('0x6')]},'userDisposition':{'type':Sequelize[_0x22c0('0x6')]},'userSecondDisposition':{'type':Sequelize[_0x22c0('0x6')]},'userThirdDisposition':{'type':Sequelize[_0x22c0('0x6')]},'note':{'type':Sequelize[_0x22c0('0x6')]},'prefix':{'type':Sequelize[_0x22c0('0x6')]},'routeid':{'type':Sequelize[_0x22c0('0x8')]},'sipcallid':{'type':Sequelize[_0x22c0('0x6')]}}; \ No newline at end of file +var _0x4178=['internal','outbound','inbound-fax','outbound-fax','dialer','DATE','INTEGER','exports','STRING','ENUM'];(function(_0x157b77,_0x455997){var _0x563e60=function(_0x4b69ac){while(--_0x4b69ac){_0x157b77['push'](_0x157b77['shift']());}};_0x563e60(++_0x455997);}(_0x4178,0x7f));var _0x8417=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x4178[_0x3ab51d];return _0x29a04e;};'use strict';var Sequelize=require('sequelize');module[_0x8417('0x0')]={'uniqueid':{'type':Sequelize[_0x8417('0x1')]},'type':{'type':Sequelize[_0x8417('0x2')]('inbound',_0x8417('0x3'),_0x8417('0x4'),_0x8417('0x5'),_0x8417('0x6'),_0x8417('0x7'))},'tag':{'type':Sequelize[_0x8417('0x1')]},'accountcode':{'type':Sequelize[_0x8417('0x1')]},'source':{'type':Sequelize[_0x8417('0x1')]},'destination':{'type':Sequelize[_0x8417('0x1')]},'destinationcontext':{'type':Sequelize[_0x8417('0x1')]},'callerid':{'type':Sequelize[_0x8417('0x1')]},'channel':{'type':Sequelize['STRING']},'destinationchannel':{'type':Sequelize[_0x8417('0x1')]},'lastapplication':{'type':Sequelize[_0x8417('0x1')]},'lastdata':{'type':Sequelize['TEXT']},'starttime':{'type':Sequelize[_0x8417('0x8')]},'systemanswertime':{'type':Sequelize[_0x8417('0x8')]},'answertime':{'type':Sequelize[_0x8417('0x8')]},'endtime':{'type':Sequelize[_0x8417('0x8')]},'duration':{'type':Sequelize[_0x8417('0x9')]},'billableseconds':{'type':Sequelize[_0x8417('0x9')]},'mohtime':{'type':Sequelize[_0x8417('0x9')],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize[_0x8417('0x1')]},'userfield':{'type':Sequelize[_0x8417('0x1')]},'userDisposition':{'type':Sequelize[_0x8417('0x1')]},'userSecondDisposition':{'type':Sequelize[_0x8417('0x1')]},'userThirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x8417('0x1')]},'prefix':{'type':Sequelize[_0x8417('0x1')]},'routeid':{'type':Sequelize[_0x8417('0x9')]},'sipcallid':{'type':Sequelize[_0x8417('0x1')]}}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.controller.js b/server/api/voiceCallReport/voiceCallReport.controller.js index 1b3735f..87cd93f 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 _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(_0x473738,_0x15ea31){var _0x1df4ae=function(_0x417a72){while(--_0x417a72){_0x473738['push'](_0x473738['shift']());}};_0x1df4ae(++_0x15ea31);}(_0xadb5,0xad));var _0x5adb=function(_0x1b72d7,_0x34836f){_0x1b72d7=_0x1b72d7-0x0;var _0x16b87c=_0xadb5[_0x1b72d7];return _0x16b87c;};'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 +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(_0x266dd9,_0x2172c0){var _0x418c1c=function(_0x5d4c87){while(--_0x5d4c87){_0x266dd9['push'](_0x266dd9['shift']());}};_0x418c1c(++_0x2172c0);}(_0x0b0e,0x187));var _0xe0b0=function(_0x14477e,_0x44d4da){_0x14477e=_0x14477e-0x0;var _0x5d4a05=_0x0b0e[_0x14477e];return _0x5d4a05;};'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 diff --git a/server/api/voiceCallReport/voiceCallReport.model.js b/server/api/voiceCallReport/voiceCallReport.model.js index ae9ca82..8cc6e34 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 _0xcc11=['moment','rimraf','../../config/environment','exports','define','VoiceCallReport','lodash','../../config/logger','api'];(function(_0x1af5cf,_0x6bbd9e){var _0x46cbc0=function(_0x250ea0){while(--_0x250ea0){_0x1af5cf['push'](_0x1af5cf['shift']());}};_0x46cbc0(++_0x6bbd9e);}(_0xcc11,0x1c8));var _0x1cc1=function(_0x9f295b,_0x5d274d){_0x9f295b=_0x9f295b-0x0;var _0x36d06d=_0xcc11[_0x9f295b];return _0x36d06d;};'use strict';var _=require(_0x1cc1('0x0'));var util=require('util');var logger=require(_0x1cc1('0x1'))(_0x1cc1('0x2'));var moment=require(_0x1cc1('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x1cc1('0x4'));var config=require(_0x1cc1('0x5'));var attributes=require('./voiceCallReport.attributes');module[_0x1cc1('0x6')]=function(_0x165e2f,_0x1424ca){return _0x165e2f[_0x1cc1('0x7')](_0x1cc1('0x8'),attributes,{'tableName':'report_call','paranoid':![],'indexes':[{'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0xf1b6=['uniqueid','util','api','moment','bluebird','request-promise','path','../../config/environment','./voiceCallReport.attributes','exports','define','VoiceCallReport','report_call'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0xf1b6,0xd1));var _0x6f1b=function(_0x337858,_0x434dc7){_0x337858=_0x337858-0x0;var _0x1f6d20=_0xf1b6[_0x337858];return _0x1f6d20;};'use strict';var _=require('lodash');var util=require(_0x6f1b('0x0'));var logger=require('../../config/logger')(_0x6f1b('0x1'));var moment=require(_0x6f1b('0x2'));var BPromise=require(_0x6f1b('0x3'));var rp=require(_0x6f1b('0x4'));var fs=require('fs');var path=require(_0x6f1b('0x5'));var rimraf=require('rimraf');var config=require(_0x6f1b('0x6'));var attributes=require(_0x6f1b('0x7'));module[_0x6f1b('0x8')]=function(_0x25425d,_0x29734c){return _0x25425d[_0x6f1b('0x9')](_0x6f1b('0xa'),attributes,{'tableName':_0x6f1b('0xb'),'paranoid':![],'indexes':[{'fields':[_0x6f1b('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.rpc.js b/server/api/voiceCallReport/voiceCallReport.rpc.js index 12dfcab..31f958f 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 _0x7b07=['bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','client','http','request','VoiceCallReport,\x20%s,\x20%s','request\x20sent','debug','VoiceCallReport,\x20%s,\x20%s,\x20%s','stringify','error','message','info','catch','VoiceCallReport','options','raw','where','map','model','attributes','include','GetVoiceCallReport','CreateVoiceCallReport','create','body','then','UpdateVoiceCallReport','update','util','moment'];(function(_0x379bdd,_0x3250b2){var _0x9a5afe=function(_0x240a2f){while(--_0x240a2f){_0x379bdd['push'](_0x379bdd['shift']());}};_0x9a5afe(++_0x3250b2);}(_0x7b07,0x67));var _0x77b0=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x7b07[_0x20a584];return _0x4b41a8;};'use strict';var _=require('lodash');var util=require(_0x77b0('0x0'));var moment=require(_0x77b0('0x1'));var BPromise=require(_0x77b0('0x2'));var rs=require(_0x77b0('0x3'));var fs=require('fs');var Redis=require(_0x77b0('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x77b0('0x5'));var logger=require('../../config/logger')(_0x77b0('0x6'));var config=require(_0x77b0('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x77b0('0x8')][_0x77b0('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2d511b,_0x109ed9,_0x2891b6){return new BPromise(function(_0x3eb428,_0x3ae0fb){return client[_0x77b0('0xa')](_0x2d511b,_0x2891b6)['then'](function(_0x4b00bd){logger['info'](_0x77b0('0xb'),_0x109ed9,_0x77b0('0xc'));logger[_0x77b0('0xd')](_0x77b0('0xe'),_0x109ed9,_0x77b0('0xc'),JSON[_0x77b0('0xf')](_0x4b00bd));if(_0x4b00bd['error']){if(_0x4b00bd[_0x77b0('0x10')]['code']===0x1f4){logger[_0x77b0('0x10')](_0x77b0('0xb'),_0x109ed9,_0x4b00bd[_0x77b0('0x10')]['message']);return _0x3ae0fb(_0x4b00bd[_0x77b0('0x10')]['message']);}logger[_0x77b0('0x10')](_0x77b0('0xb'),_0x109ed9,_0x4b00bd[_0x77b0('0x10')][_0x77b0('0x11')]);return _0x3eb428(_0x4b00bd[_0x77b0('0x10')][_0x77b0('0x11')]);}else{logger[_0x77b0('0x12')](_0x77b0('0xb'),_0x109ed9,'request\x20sent');_0x3eb428(_0x4b00bd['result'][_0x77b0('0x11')]);}})[_0x77b0('0x13')](function(_0x517b7){logger[_0x77b0('0x10')]('VoiceCallReport,\x20%s,\x20%s',_0x109ed9,_0x517b7);_0x3ae0fb(_0x517b7);});});}exports['GetVoiceCallReport']=function(_0x38d76a){var _0x150eb3=this;return new Promise(function(_0x6a3771,_0x54df4b){return db[_0x77b0('0x14')]['findAll']({'raw':_0x38d76a[_0x77b0('0x15')]?_0x38d76a['options'][_0x77b0('0x16')]===undefined?!![]:![]:!![],'where':_0x38d76a[_0x77b0('0x15')]?_0x38d76a[_0x77b0('0x15')][_0x77b0('0x17')]||null:null,'attributes':_0x38d76a['options']?_0x38d76a[_0x77b0('0x15')]['attributes']||null:null,'limit':_0x38d76a['options']?_0x38d76a['options']['limit']||null:null,'include':_0x38d76a['options']?_0x38d76a['options']['include']?_[_0x77b0('0x18')](_0x38d76a['options']['include'],function(_0xacb803){return{'model':db[_0xacb803[_0x77b0('0x19')]],'as':_0xacb803['as'],'attributes':_0xacb803[_0x77b0('0x1a')],'include':_0xacb803['include']?_[_0x77b0('0x18')](_0xacb803['include'],function(_0x1a5f5e){return{'model':db[_0x1a5f5e[_0x77b0('0x19')]],'as':_0x1a5f5e['as'],'attributes':_0x1a5f5e['attributes'],'include':_0x1a5f5e[_0x77b0('0x1b')]?_[_0x77b0('0x18')](_0x1a5f5e[_0x77b0('0x1b')],function(_0x5e78b6){return{'model':db[_0x5e78b6[_0x77b0('0x19')]],'as':_0x5e78b6['as'],'attributes':_0x5e78b6[_0x77b0('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x319cb8){logger[_0x77b0('0x12')]('GetVoiceCallReport',_0x38d76a);logger[_0x77b0('0xd')]('GetVoiceCallReport',_0x38d76a,JSON[_0x77b0('0xf')](_0x319cb8));_0x6a3771(_0x319cb8);})[_0x77b0('0x13')](function(_0x3f2d18){logger[_0x77b0('0x10')](_0x77b0('0x1c'),_0x3f2d18[_0x77b0('0x11')],_0x38d76a);_0x54df4b(_0x150eb3[_0x77b0('0x10')](0x1f4,_0x3f2d18[_0x77b0('0x11')]));});});};exports[_0x77b0('0x1d')]=function(_0x3ec1b2){var _0x520513=this;return new Promise(function(_0x237962,_0x25b4df){return db['VoiceCallReport'][_0x77b0('0x1e')](_0x3ec1b2[_0x77b0('0x1f')],{'raw':_0x3ec1b2[_0x77b0('0x15')]?_0x3ec1b2['options'][_0x77b0('0x16')]===undefined?!![]:![]:!![]})[_0x77b0('0x20')](function(_0x4e3d86){logger[_0x77b0('0x12')](_0x77b0('0x1d'),_0x3ec1b2);logger[_0x77b0('0xd')](_0x77b0('0x1d'),_0x3ec1b2,JSON[_0x77b0('0xf')](_0x4e3d86));_0x237962(_0x4e3d86);})[_0x77b0('0x13')](function(_0x425227){logger[_0x77b0('0x10')](_0x77b0('0x1d'),_0x425227[_0x77b0('0x11')],_0x3ec1b2);_0x25b4df(_0x520513[_0x77b0('0x10')](0x1f4,_0x425227[_0x77b0('0x11')]));});});};exports[_0x77b0('0x21')]=function(_0x3a49a2){var _0x49c712=this;return new Promise(function(_0x2084b1,_0x1d2443){return db[_0x77b0('0x14')][_0x77b0('0x22')](_0x3a49a2['body'],{'raw':_0x3a49a2[_0x77b0('0x15')]?_0x3a49a2['options'][_0x77b0('0x16')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3a49a2['options']?_0x3a49a2['options'][_0x77b0('0x17')]||null:null,'attributes':_0x3a49a2['options']?_0x3a49a2[_0x77b0('0x15')][_0x77b0('0x1a')]||null:null,'limit':_0x3a49a2[_0x77b0('0x15')]?_0x3a49a2[_0x77b0('0x15')]['limit']||null:null})['then'](function(_0x4627db){logger[_0x77b0('0x12')]('UpdateVoiceCallReport',_0x3a49a2);logger[_0x77b0('0xd')]('UpdateVoiceCallReport',_0x3a49a2,JSON[_0x77b0('0xf')](_0x4627db));_0x2084b1(_0x4627db);})[_0x77b0('0x13')](function(_0x1c3875){logger[_0x77b0('0x10')](_0x77b0('0x21'),_0x1c3875[_0x77b0('0x11')],_0x3a49a2);_0x1d2443(_0x49c712[_0x77b0('0x10')](0x1f4,_0x1c3875[_0x77b0('0x11')]));});});}; \ No newline at end of file +var _0x8e04=['UpdateVoiceCallReport','update','body','lodash','moment','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','info','request\x20sent','error','message','VoiceCallReport,\x20%s,\x20%s','result','GetVoiceCallReport','findAll','options','raw','where','attributes','include','map','model','debug','VoiceCallReport','CreateVoiceCallReport','stringify','catch'];(function(_0x5460aa,_0x48b3c3){var _0x66394d=function(_0x133e60){while(--_0x133e60){_0x5460aa['push'](_0x5460aa['shift']());}};_0x66394d(++_0x48b3c3);}(_0x8e04,0x183));var _0x48e0=function(_0x56b891,_0x2f117e){_0x56b891=_0x56b891-0x0;var _0x41d994=_0x8e04[_0x56b891];return _0x41d994;};'use strict';var _=require(_0x48e0('0x0'));var util=require('util');var moment=require(_0x48e0('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x48e0('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0x48e0('0x3'))(_0x48e0('0x4'));var config=require(_0x48e0('0x5'));var jayson=require(_0x48e0('0x6'));var client=jayson[_0x48e0('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3db963,_0x5447d1,_0x44326f){return new BPromise(function(_0xdd37aa,_0x1c910e){return client['request'](_0x3db963,_0x44326f)[_0x48e0('0x8')](function(_0x5bcb44){logger[_0x48e0('0x9')]('VoiceCallReport,\x20%s,\x20%s',_0x5447d1,_0x48e0('0xa'));logger['debug']('VoiceCallReport,\x20%s,\x20%s,\x20%s',_0x5447d1,_0x48e0('0xa'),JSON['stringify'](_0x5bcb44));if(_0x5bcb44[_0x48e0('0xb')]){if(_0x5bcb44[_0x48e0('0xb')]['code']===0x1f4){logger['error']('VoiceCallReport,\x20%s,\x20%s',_0x5447d1,_0x5bcb44[_0x48e0('0xb')][_0x48e0('0xc')]);return _0x1c910e(_0x5bcb44['error'][_0x48e0('0xc')]);}logger[_0x48e0('0xb')](_0x48e0('0xd'),_0x5447d1,_0x5bcb44[_0x48e0('0xb')][_0x48e0('0xc')]);return _0xdd37aa(_0x5bcb44['error'][_0x48e0('0xc')]);}else{logger[_0x48e0('0x9')]('VoiceCallReport,\x20%s,\x20%s',_0x5447d1,'request\x20sent');_0xdd37aa(_0x5bcb44[_0x48e0('0xe')][_0x48e0('0xc')]);}})['catch'](function(_0x3cfa61){logger['error'](_0x48e0('0xd'),_0x5447d1,_0x3cfa61);_0x1c910e(_0x3cfa61);});});}exports[_0x48e0('0xf')]=function(_0x356cf8){var _0x4aaf9f=this;return new Promise(function(_0x132cbb,_0x355a91){return db['VoiceCallReport'][_0x48e0('0x10')]({'raw':_0x356cf8[_0x48e0('0x11')]?_0x356cf8['options'][_0x48e0('0x12')]===undefined?!![]:![]:!![],'where':_0x356cf8[_0x48e0('0x11')]?_0x356cf8[_0x48e0('0x11')][_0x48e0('0x13')]||null:null,'attributes':_0x356cf8['options']?_0x356cf8[_0x48e0('0x11')][_0x48e0('0x14')]||null:null,'limit':_0x356cf8['options']?_0x356cf8['options']['limit']||null:null,'include':_0x356cf8['options']?_0x356cf8[_0x48e0('0x11')][_0x48e0('0x15')]?_[_0x48e0('0x16')](_0x356cf8[_0x48e0('0x11')][_0x48e0('0x15')],function(_0x23a3c8){return{'model':db[_0x23a3c8[_0x48e0('0x17')]],'as':_0x23a3c8['as'],'attributes':_0x23a3c8[_0x48e0('0x14')],'include':_0x23a3c8[_0x48e0('0x15')]?_[_0x48e0('0x16')](_0x23a3c8[_0x48e0('0x15')],function(_0x3a46b0){return{'model':db[_0x3a46b0['model']],'as':_0x3a46b0['as'],'attributes':_0x3a46b0[_0x48e0('0x14')],'include':_0x3a46b0['include']?_[_0x48e0('0x16')](_0x3a46b0[_0x48e0('0x15')],function(_0x1ab9d0){return{'model':db[_0x1ab9d0[_0x48e0('0x17')]],'as':_0x1ab9d0['as'],'attributes':_0x1ab9d0[_0x48e0('0x14')]};}):[]};}):[]};}):[]:[]})[_0x48e0('0x8')](function(_0x2b43b3){logger[_0x48e0('0x9')]('GetVoiceCallReport',_0x356cf8);logger[_0x48e0('0x18')](_0x48e0('0xf'),_0x356cf8,JSON['stringify'](_0x2b43b3));_0x132cbb(_0x2b43b3);})['catch'](function(_0x91061c){logger[_0x48e0('0xb')]('GetVoiceCallReport',_0x91061c['message'],_0x356cf8);_0x355a91(_0x4aaf9f[_0x48e0('0xb')](0x1f4,_0x91061c['message']));});});};exports['CreateVoiceCallReport']=function(_0x37b475){var _0x15524c=this;return new Promise(function(_0x1e3e44,_0x7eb502){return db[_0x48e0('0x19')]['create'](_0x37b475['body'],{'raw':_0x37b475[_0x48e0('0x11')]?_0x37b475[_0x48e0('0x11')]['raw']===undefined?!![]:![]:!![]})[_0x48e0('0x8')](function(_0x1e9091){logger[_0x48e0('0x9')]('CreateVoiceCallReport',_0x37b475);logger['debug'](_0x48e0('0x1a'),_0x37b475,JSON[_0x48e0('0x1b')](_0x1e9091));_0x1e3e44(_0x1e9091);})[_0x48e0('0x1c')](function(_0x511920){logger[_0x48e0('0xb')](_0x48e0('0x1a'),_0x511920[_0x48e0('0xc')],_0x37b475);_0x7eb502(_0x15524c[_0x48e0('0xb')](0x1f4,_0x511920[_0x48e0('0xc')]));});});};exports[_0x48e0('0x1d')]=function(_0xa96dfd){var _0x4a6929=this;return new Promise(function(_0x5d8a67,_0x455fcb){return db['VoiceCallReport'][_0x48e0('0x1e')](_0xa96dfd[_0x48e0('0x1f')],{'raw':_0xa96dfd['options']?_0xa96dfd['options'][_0x48e0('0x12')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xa96dfd['options']?_0xa96dfd['options'][_0x48e0('0x13')]||null:null,'attributes':_0xa96dfd[_0x48e0('0x11')]?_0xa96dfd[_0x48e0('0x11')][_0x48e0('0x14')]||null:null,'limit':_0xa96dfd[_0x48e0('0x11')]?_0xa96dfd['options']['limit']||null:null})['then'](function(_0x315364){logger['info'](_0x48e0('0x1d'),_0xa96dfd);logger[_0x48e0('0x18')](_0x48e0('0x1d'),_0xa96dfd,JSON[_0x48e0('0x1b')](_0x315364));_0x5d8a67(_0x315364);})['catch'](function(_0x4e44c0){logger[_0x48e0('0xb')](_0x48e0('0x1d'),_0x4e44c0[_0x48e0('0xc')],_0xa96dfd);_0x455fcb(_0x4a6929[_0x48e0('0xb')](0x1f4,_0x4e44c0[_0x48e0('0xc')]));});});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/index.js b/server/api/voiceChanSpy/index.js index 2024b32..fbf74e6 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 _0xa11c=['index','/:id','isAuthenticated','show','post','put','update','delete','exports','multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./voiceChanSpy.controller','get'];(function(_0x79288c,_0xdeee0d){var _0x13014d=function(_0x6bb0d7){while(--_0x6bb0d7){_0x79288c['push'](_0x79288c['shift']());}};_0x13014d(++_0xdeee0d);}(_0xa11c,0x183));var _0xca11=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0xa11c[_0x21a9d9];return _0x46adce;};'use strict';var multer=require(_0xca11('0x0'));var util=require(_0xca11('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xca11('0x2'));var router=express[_0xca11('0x3')]();var fs_extra=require(_0xca11('0x4'));var auth=require(_0xca11('0x5'));var interaction=require(_0xca11('0x6'));var config=require('../../config/environment');var controller=require(_0xca11('0x7'));router[_0xca11('0x8')]('/',auth['isAuthenticated'](),controller[_0xca11('0x9')]);router[_0xca11('0x8')](_0xca11('0xa'),auth[_0xca11('0xb')](),controller[_0xca11('0xc')]);router[_0xca11('0xd')]('/',auth[_0xca11('0xb')](),controller['create']);router[_0xca11('0xe')](_0xca11('0xa'),auth['isAuthenticated'](),controller[_0xca11('0xf')]);router[_0xca11('0x10')](_0xca11('0xa'),auth[_0xca11('0xb')](),controller['destroy']);module[_0xca11('0x11')]=router; \ No newline at end of file +var _0xe1ad=['fs-extra','get','isAuthenticated','index','/:id','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0xe1ad,0x13d));var _0xde1a=function(_0x4684cd,_0x3de778){_0x4684cd=_0x4684cd-0x0;var _0x3de680=_0xe1ad[_0x4684cd];return _0x3de680;};'use strict';var multer=require(_0xde1a('0x0'));var util=require(_0xde1a('0x1'));var path=require(_0xde1a('0x2'));var timeout=require(_0xde1a('0x3'));var express=require(_0xde1a('0x4'));var router=express[_0xde1a('0x5')]();var fs_extra=require(_0xde1a('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./voiceChanSpy.controller');router[_0xde1a('0x7')]('/',auth[_0xde1a('0x8')](),controller[_0xde1a('0x9')]);router['get'](_0xde1a('0xa'),auth[_0xde1a('0x8')](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0xde1a('0xb')]);router[_0xde1a('0xc')](_0xde1a('0xa'),auth[_0xde1a('0x8')](),controller[_0xde1a('0xd')]);router[_0xde1a('0xe')](_0xde1a('0xa'),auth[_0xde1a('0x8')](),controller[_0xde1a('0xf')]);module[_0xde1a('0x10')]=router; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.attributes.js b/server/api/voiceChanSpy/voiceChanSpy.attributes.js index 150fc28..c055230 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 _0x9d0d=['getDataValue','split','BOOLEAN','sequelize','STRING','name','setDataValue','options'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x9d0d,0x123));var _0xd9d0=function(_0x5c03f7,_0x2f8ce3){_0x5c03f7=_0x5c03f7-0x0;var _0xfdc33f=_0x9d0d[_0x5c03f7];return _0xfdc33f;};'use strict';var Sequelize=require(_0xd9d0('0x0'));module['exports']={'name':{'type':Sequelize[_0xd9d0('0x1')]},'prefix':{'type':Sequelize['STRING'],'unique':_0xd9d0('0x2'),'allowNull':![]},'options':{'type':Sequelize[_0xd9d0('0x1')],'set':function(_0x261c22){this[_0xd9d0('0x3')](_0xd9d0('0x4'),_0x261c22?_0x261c22['join'](''):[]);},'get':function(){return this[_0xd9d0('0x5')](_0xd9d0('0x4'))?this['getDataValue']('options')[_0xd9d0('0x6')](''):[];}},'auth':{'type':Sequelize[_0xd9d0('0x7')],'defaultValue':![]},'password':{'type':Sequelize['STRING']},'record':{'type':Sequelize[_0xd9d0('0x7')],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0xd9d0('0x1')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x200b=['join','getDataValue','options','split','BOOLEAN','sequelize','exports','STRING','name','setDataValue'];(function(_0x47047b,_0x665711){var _0x197211=function(_0x7ab707){while(--_0x7ab707){_0x47047b['push'](_0x47047b['shift']());}};_0x197211(++_0x665711);}(_0x200b,0x159));var _0xb200=function(_0x14c1b6,_0x1fc98b){_0x14c1b6=_0x14c1b6-0x0;var _0x1317df=_0x200b[_0x14c1b6];return _0x1317df;};'use strict';var Sequelize=require(_0xb200('0x0'));module[_0xb200('0x1')]={'name':{'type':Sequelize[_0xb200('0x2')]},'prefix':{'type':Sequelize[_0xb200('0x2')],'unique':_0xb200('0x3'),'allowNull':![]},'options':{'type':Sequelize[_0xb200('0x2')],'set':function(_0x2bf9a3){this[_0xb200('0x4')]('options',_0x2bf9a3?_0x2bf9a3[_0xb200('0x5')](''):[]);},'get':function(){return this[_0xb200('0x6')](_0xb200('0x7'))?this[_0xb200('0x6')](_0xb200('0x7'))[_0xb200('0x8')](''):[];}},'auth':{'type':Sequelize[_0xb200('0x9')],'defaultValue':![]},'password':{'type':Sequelize['STRING']},'record':{'type':Sequelize[_0xb200('0x9')],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0xb200('0x2')]},'description':{'type':Sequelize[_0xb200('0x2')]}}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.controller.js b/server/api/voiceChanSpy/voiceChanSpy.controller.js index b751e41..498f25f 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 _0x430e=['type','options','includeAll','include','params','merge','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','catch','update','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','undefined','count','offset','limit','apply','reject','then','destroy','get','ChanSpies','UserProfileResource','stack','name','send','index','map','VoiceChanSpy','rawAttributes','fieldName','key','query','keys','filters','intersection','model','attributes','fields','length','nolimit','order','sort','where','pick'];(function(_0x31cb5f,_0x2df766){var _0x586042=function(_0x53c807){while(--_0x53c807){_0x31cb5f['push'](_0x31cb5f['shift']());}};_0x586042(++_0x2df766);}(_0x430e,0x105));var _0xe430=function(_0x1ceb7b,_0x894d3d){_0x1ceb7b=_0x1ceb7b-0x0;var _0x57c016=_0x430e[_0x1ceb7b];return _0x57c016;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe430('0x0'));var zipdir=require(_0xe430('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe430('0x2'));var moment=require(_0xe430('0x3'));var BPromise=require(_0xe430('0x4'));var Mustache=require(_0xe430('0x5'));var util=require('util');var path=require(_0xe430('0x6'));var sox=require(_0xe430('0x7'));var csv=require(_0xe430('0x8'));var ejs=require(_0xe430('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe430('0xa'));var squel=require(_0xe430('0xb'));var crypto=require(_0xe430('0xc'));var jsforce=require(_0xe430('0xd'));var deskjs=require(_0xe430('0xe'));var toCsv=require('to-csv');var querystring=require(_0xe430('0xf'));var Papa=require(_0xe430('0x10'));var Redis=require(_0xe430('0x11'));var authService=require(_0xe430('0x12'));var qs=require(_0xe430('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe430('0x14'));var logger=require(_0xe430('0x15'))(_0xe430('0x16'));var utils=require(_0xe430('0x17'));var config=require(_0xe430('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xe430('0x19'))['db'];function respondWithStatusCode(_0x4c0ff7,_0x53d365){_0x53d365=_0x53d365||0xcc;return function(_0x40f53a){if(_0x40f53a){return _0x4c0ff7[_0xe430('0x1a')](_0x53d365);}return _0x4c0ff7[_0xe430('0x1b')](_0x53d365)[_0xe430('0x1c')]();};}function respondWithResult(_0x340cd4,_0x3c8205){_0x3c8205=_0x3c8205||0xc8;return function(_0x24e898){if(_0x24e898){return _0x340cd4['status'](_0x3c8205)[_0xe430('0x1d')](_0x24e898);}};}function respondWithFilteredResult(_0xe36466,_0x9e577b){return function(_0x1d96bd){if(_0x1d96bd){var _0x4ac5f9=typeof _0x9e577b['offset']===_0xe430('0x1e')&&typeof _0x9e577b['limit']==='undefined';var _0x321479=_0x1d96bd[_0xe430('0x1f')];var _0x1e36f9=_0x4ac5f9?0x0:_0x9e577b[_0xe430('0x20')];var _0x161575=_0x4ac5f9?_0x1d96bd['count']:_0x9e577b['offset']+_0x9e577b[_0xe430('0x21')];var _0x2cb25f;if(_0x161575>=_0x321479){_0x161575=_0x321479;_0x2cb25f=0xc8;}else{_0x2cb25f=0xce;}_0xe36466[_0xe430('0x1b')](_0x2cb25f);return _0xe36466['set']('Content-Range',_0x1e36f9+'-'+_0x161575+'/'+_0x321479)['json'](_0x1d96bd);}return null;};}function patchUpdates(_0x167c65){return function(_0x2d1560){try{jsonpatch[_0xe430('0x22')](_0x2d1560,_0x167c65,!![]);}catch(_0x53b8e3){return BPromise[_0xe430('0x23')](_0x53b8e3);}return _0x2d1560['save']();};}function saveUpdates(_0x599d04,_0x2d7f76){return function(_0xe267cf){if(_0xe267cf){return _0xe267cf['update'](_0x599d04)[_0xe430('0x24')](function(_0x55276b){return _0x55276b;});}return null;};}function removeEntity(_0x58a9a3,_0x5359b1){return function(_0x3f26cb){if(_0x3f26cb){return _0x3f26cb[_0xe430('0x25')]()[_0xe430('0x24')](function(){var _0x11f050=_0x3f26cb[_0xe430('0x26')]({'plain':!![]});var _0x41628d=_0xe430('0x27');return db[_0xe430('0x28')][_0xe430('0x25')]({'where':{'type':_0x41628d,'resourceId':_0x11f050['id']}})['then'](function(){return _0x3f26cb;});})[_0xe430('0x24')](function(){_0x58a9a3[_0xe430('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1b02b5,_0x418c5a){return function(_0x2f93d1){if(!_0x2f93d1){_0x1b02b5['sendStatus'](0x194);}return _0x2f93d1;};}function handleError(_0x4c6769,_0x2e7ed5){_0x2e7ed5=_0x2e7ed5||0x1f4;return function(_0x13214d){logger['error'](_0x13214d[_0xe430('0x29')]);if(_0x13214d['name']){delete _0x13214d[_0xe430('0x2a')];}_0x4c6769[_0xe430('0x1b')](_0x2e7ed5)[_0xe430('0x2b')](_0x13214d);};}exports[_0xe430('0x2c')]=function(_0x479ee1,_0x1763d4){var _0x371cd7={},_0x1d108c={},_0x29663a={'count':0x0,'rows':[]};var _0x4ca5b2=_[_0xe430('0x2d')](db[_0xe430('0x2e')][_0xe430('0x2f')],function(_0x538fb3){return{'name':_0x538fb3[_0xe430('0x30')],'type':_0x538fb3['type'][_0xe430('0x31')]};});_0x1d108c['model']=_['map'](_0x4ca5b2,_0xe430('0x2a'));_0x1d108c[_0xe430('0x32')]=_[_0xe430('0x33')](_0x479ee1[_0xe430('0x32')]);_0x1d108c[_0xe430('0x34')]=_[_0xe430('0x35')](_0x1d108c[_0xe430('0x36')],_0x1d108c[_0xe430('0x32')]);_0x371cd7[_0xe430('0x37')]=_[_0xe430('0x35')](_0x1d108c['model'],qs['fields'](_0x479ee1[_0xe430('0x32')][_0xe430('0x38')]));_0x371cd7[_0xe430('0x37')]=_0x371cd7[_0xe430('0x37')][_0xe430('0x39')]?_0x371cd7[_0xe430('0x37')]:_0x1d108c[_0xe430('0x36')];if(!_0x479ee1[_0xe430('0x32')]['hasOwnProperty'](_0xe430('0x3a'))){_0x371cd7[_0xe430('0x21')]=qs[_0xe430('0x21')](_0x479ee1[_0xe430('0x32')][_0xe430('0x21')]);_0x371cd7[_0xe430('0x20')]=qs[_0xe430('0x20')](_0x479ee1[_0xe430('0x32')][_0xe430('0x20')]);}_0x371cd7[_0xe430('0x3b')]=qs['sort'](_0x479ee1[_0xe430('0x32')][_0xe430('0x3c')]);_0x371cd7[_0xe430('0x3d')]=qs[_0xe430('0x34')](_[_0xe430('0x3e')](_0x479ee1[_0xe430('0x32')],_0x1d108c[_0xe430('0x34')]),_0x4ca5b2);if(_0x479ee1[_0xe430('0x32')]['filter']){_0x371cd7['where']=_['merge'](_0x371cd7[_0xe430('0x3d')],{'$or':_['map'](_0x4ca5b2,function(_0x5d985f){if(_0x5d985f[_0xe430('0x3f')]!=='VIRTUAL'){var _0x185347={};_0x185347[_0x5d985f[_0xe430('0x2a')]]={'$like':'%'+_0x479ee1[_0xe430('0x32')]['filter']+'%'};return _0x185347;}})});}_0x371cd7=_['merge']({},_0x371cd7,_0x479ee1[_0xe430('0x40')]);var _0x3287e9={'where':_0x371cd7[_0xe430('0x3d')]};return db[_0xe430('0x2e')]['count'](_0x3287e9)[_0xe430('0x24')](function(_0x45c5a7){_0x29663a[_0xe430('0x1f')]=_0x45c5a7;if(_0x479ee1['query'][_0xe430('0x41')]){_0x371cd7[_0xe430('0x42')]=[{'all':!![]}];}return db[_0xe430('0x2e')]['findAll'](_0x371cd7);})['then'](function(_0x2d8f75){_0x29663a['rows']=_0x2d8f75;return _0x29663a;})[_0xe430('0x24')](respondWithFilteredResult(_0x1763d4,_0x371cd7))['catch'](handleError(_0x1763d4,null));};exports['show']=function(_0x25e45e,_0x1fa925){var _0x1ac3a6={'raw':![],'where':{'id':_0x25e45e[_0xe430('0x43')]['id']}},_0x2d5371={};_0x2d5371['model']=_[_0xe430('0x33')](db[_0xe430('0x2e')][_0xe430('0x2f')]);_0x2d5371[_0xe430('0x32')]=_['keys'](_0x25e45e['query']);_0x2d5371[_0xe430('0x34')]=_[_0xe430('0x35')](_0x2d5371[_0xe430('0x36')],_0x2d5371[_0xe430('0x32')]);_0x1ac3a6[_0xe430('0x37')]=_[_0xe430('0x35')](_0x2d5371[_0xe430('0x36')],qs[_0xe430('0x38')](_0x25e45e[_0xe430('0x32')][_0xe430('0x38')]));_0x1ac3a6[_0xe430('0x37')]=_0x1ac3a6[_0xe430('0x37')][_0xe430('0x39')]?_0x1ac3a6[_0xe430('0x37')]:_0x2d5371['model'];if(_0x25e45e[_0xe430('0x32')][_0xe430('0x41')]){_0x1ac3a6[_0xe430('0x42')]=[{'all':!![]}];}_0x1ac3a6=_[_0xe430('0x44')]({},_0x1ac3a6,_0x25e45e['options']);return db[_0xe430('0x2e')][_0xe430('0x45')](_0x1ac3a6)[_0xe430('0x24')](handleEntityNotFound(_0x1fa925,null))[_0xe430('0x24')](respondWithResult(_0x1fa925,null))['catch'](handleError(_0x1fa925,null));};exports['create']=function(_0xd35246,_0x534ea2){return db[_0xe430('0x2e')][_0xe430('0x46')](_0xd35246[_0xe430('0x47')],{})[_0xe430('0x24')](function(_0x3867ae){var _0x2b7379=_0xd35246[_0xe430('0x48')][_0xe430('0x26')]({'plain':!![]});if(!_0x2b7379)throw new Error(_0xe430('0x49'));if(_0x2b7379[_0xe430('0x4a')]===_0xe430('0x48')){var _0x9504ce=_0x3867ae[_0xe430('0x26')]({'plain':!![]});var _0x563b2e='ChanSpies';return db[_0xe430('0x4b')][_0xe430('0x45')]({'where':{'name':_0x563b2e,'userProfileId':_0x2b7379[_0xe430('0x4c')]},'raw':!![]})[_0xe430('0x24')](function(_0x2eecdd){if(_0x2eecdd&&_0x2eecdd[_0xe430('0x4d')]===0x0){return db[_0xe430('0x28')][_0xe430('0x46')]({'name':_0x9504ce[_0xe430('0x2a')],'resourceId':_0x9504ce['id'],'type':_0x2eecdd[_0xe430('0x2a')],'sectionId':_0x2eecdd['id']},{})[_0xe430('0x24')](function(){return _0x3867ae;});}else{return _0x3867ae;}})['catch'](function(_0x5a5171){logger['error'](_0xe430('0x4e'),_0x5a5171);throw _0x5a5171;});}return _0x3867ae;})['then'](respondWithResult(_0x534ea2,0xc9))[_0xe430('0x4f')](handleError(_0x534ea2,null));};exports[_0xe430('0x50')]=function(_0x541eb4,_0x6f45ea){if(_0x541eb4[_0xe430('0x47')]['id']){delete _0x541eb4['body']['id'];}return db[_0xe430('0x2e')][_0xe430('0x45')]({'where':{'id':_0x541eb4[_0xe430('0x43')]['id']}})[_0xe430('0x24')](handleEntityNotFound(_0x6f45ea,null))[_0xe430('0x24')](saveUpdates(_0x541eb4['body'],null))[_0xe430('0x24')](respondWithResult(_0x6f45ea,null))[_0xe430('0x4f')](handleError(_0x6f45ea,null));};exports[_0xe430('0x25')]=function(_0xb5d6d2,_0x5e3140){return db[_0xe430('0x2e')][_0xe430('0x45')]({'where':{'id':_0xb5d6d2['params']['id']}})['then'](handleEntityNotFound(_0x5e3140,null))[_0xe430('0x24')](removeEntity(_0x5e3140,null))[_0xe430('0x4f')](handleError(_0x5e3140,null));}; \ No newline at end of file +var _0x92d7=['save','update','then','destroy','get','ChanSpies','error','stack','name','send','map','VoiceChanSpy','rawAttributes','fieldName','type','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','options','findAll','rows','catch','show','params','keys','include','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','find','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject'];(function(_0x904972,_0x414817){var _0xae0e42=function(_0x46d790){while(--_0x46d790){_0x904972['push'](_0x904972['shift']());}};_0xae0e42(++_0x414817);}(_0x92d7,0x17b));var _0x792d=function(_0x32d48d,_0x42516f){_0x32d48d=_0x32d48d-0x0;var _0x1a4023=_0x92d7[_0x32d48d];return _0x1a4023;};'use strict';var emlformat=require(_0x792d('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x792d('0x1'));var jsonpatch=require(_0x792d('0x2'));var rp=require(_0x792d('0x3'));var moment=require(_0x792d('0x4'));var BPromise=require(_0x792d('0x5'));var Mustache=require(_0x792d('0x6'));var util=require(_0x792d('0x7'));var path=require(_0x792d('0x8'));var sox=require(_0x792d('0x9'));var csv=require(_0x792d('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x792d('0xb'));var _=require(_0x792d('0xc'));var squel=require(_0x792d('0xd'));var crypto=require(_0x792d('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x792d('0xf'));var toCsv=require(_0x792d('0xa'));var querystring=require(_0x792d('0x10'));var Papa=require(_0x792d('0x11'));var Redis=require(_0x792d('0x12'));var authService=require(_0x792d('0x13'));var qs=require(_0x792d('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x792d('0x15'));var logger=require('../../config/logger')(_0x792d('0x16'));var utils=require(_0x792d('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x792d('0x18'))['db'];function respondWithStatusCode(_0x323eb4,_0x3eb656){_0x3eb656=_0x3eb656||0xcc;return function(_0x551214){if(_0x551214){return _0x323eb4[_0x792d('0x19')](_0x3eb656);}return _0x323eb4[_0x792d('0x1a')](_0x3eb656)[_0x792d('0x1b')]();};}function respondWithResult(_0x2003c1,_0x150022){_0x150022=_0x150022||0xc8;return function(_0x3ead79){if(_0x3ead79){return _0x2003c1[_0x792d('0x1a')](_0x150022)[_0x792d('0x1c')](_0x3ead79);}};}function respondWithFilteredResult(_0x369a9b,_0x1a1f96){return function(_0x2d238f){if(_0x2d238f){var _0x252b34=typeof _0x1a1f96[_0x792d('0x1d')]===_0x792d('0x1e')&&typeof _0x1a1f96[_0x792d('0x1f')]==='undefined';var _0x4069f3=_0x2d238f[_0x792d('0x20')];var _0x451f0d=_0x252b34?0x0:_0x1a1f96[_0x792d('0x1d')];var _0x5dd610=_0x252b34?_0x2d238f[_0x792d('0x20')]:_0x1a1f96['offset']+_0x1a1f96['limit'];var _0x5260e7;if(_0x5dd610>=_0x4069f3){_0x5dd610=_0x4069f3;_0x5260e7=0xc8;}else{_0x5260e7=0xce;}_0x369a9b['status'](_0x5260e7);return _0x369a9b[_0x792d('0x21')](_0x792d('0x22'),_0x451f0d+'-'+_0x5dd610+'/'+_0x4069f3)[_0x792d('0x1c')](_0x2d238f);}return null;};}function patchUpdates(_0x14794c){return function(_0x5b089a){try{jsonpatch['apply'](_0x5b089a,_0x14794c,!![]);}catch(_0x12a5f1){return BPromise[_0x792d('0x23')](_0x12a5f1);}return _0x5b089a[_0x792d('0x24')]();};}function saveUpdates(_0x3f1f84,_0x1f3708){return function(_0x11a51a){if(_0x11a51a){return _0x11a51a[_0x792d('0x25')](_0x3f1f84)[_0x792d('0x26')](function(_0x77a89f){return _0x77a89f;});}return null;};}function removeEntity(_0x3d0c0f,_0x206a64){return function(_0x101a5c){if(_0x101a5c){return _0x101a5c[_0x792d('0x27')]()[_0x792d('0x26')](function(){var _0x7cd3fb=_0x101a5c[_0x792d('0x28')]({'plain':!![]});var _0x49258e=_0x792d('0x29');return db['UserProfileResource'][_0x792d('0x27')]({'where':{'type':_0x49258e,'resourceId':_0x7cd3fb['id']}})['then'](function(){return _0x101a5c;});})['then'](function(){_0x3d0c0f[_0x792d('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0xa9c20b,_0x4e55df){return function(_0x13f00b){if(!_0x13f00b){_0xa9c20b[_0x792d('0x19')](0x194);}return _0x13f00b;};}function handleError(_0x3543d4,_0x53ef0b){_0x53ef0b=_0x53ef0b||0x1f4;return function(_0x161c65){logger[_0x792d('0x2a')](_0x161c65[_0x792d('0x2b')]);if(_0x161c65[_0x792d('0x2c')]){delete _0x161c65[_0x792d('0x2c')];}_0x3543d4[_0x792d('0x1a')](_0x53ef0b)[_0x792d('0x2d')](_0x161c65);};}exports['index']=function(_0x276a5d,_0xce423e){var _0x2e3284={},_0x558681={},_0x474775={'count':0x0,'rows':[]};var _0x485463=_[_0x792d('0x2e')](db[_0x792d('0x2f')][_0x792d('0x30')],function(_0x31ed20){return{'name':_0x31ed20[_0x792d('0x31')],'type':_0x31ed20[_0x792d('0x32')][_0x792d('0x33')]};});_0x558681['model']=_['map'](_0x485463,_0x792d('0x2c'));_0x558681[_0x792d('0x34')]=_['keys'](_0x276a5d[_0x792d('0x34')]);_0x558681[_0x792d('0x35')]=_[_0x792d('0x36')](_0x558681[_0x792d('0x37')],_0x558681[_0x792d('0x34')]);_0x2e3284[_0x792d('0x38')]=_[_0x792d('0x36')](_0x558681[_0x792d('0x37')],qs[_0x792d('0x39')](_0x276a5d[_0x792d('0x34')][_0x792d('0x39')]));_0x2e3284[_0x792d('0x38')]=_0x2e3284[_0x792d('0x38')][_0x792d('0x3a')]?_0x2e3284['attributes']:_0x558681[_0x792d('0x37')];if(!_0x276a5d[_0x792d('0x34')][_0x792d('0x3b')](_0x792d('0x3c'))){_0x2e3284['limit']=qs[_0x792d('0x1f')](_0x276a5d[_0x792d('0x34')][_0x792d('0x1f')]);_0x2e3284[_0x792d('0x1d')]=qs['offset'](_0x276a5d[_0x792d('0x34')][_0x792d('0x1d')]);}_0x2e3284[_0x792d('0x3d')]=qs[_0x792d('0x3e')](_0x276a5d['query'][_0x792d('0x3e')]);_0x2e3284[_0x792d('0x3f')]=qs[_0x792d('0x35')](_['pick'](_0x276a5d[_0x792d('0x34')],_0x558681['filters']),_0x485463);if(_0x276a5d[_0x792d('0x34')][_0x792d('0x40')]){_0x2e3284['where']=_[_0x792d('0x41')](_0x2e3284['where'],{'$or':_['map'](_0x485463,function(_0x2d6492){if(_0x2d6492[_0x792d('0x32')]!=='VIRTUAL'){var _0x49d824={};_0x49d824[_0x2d6492[_0x792d('0x2c')]]={'$like':'%'+_0x276a5d[_0x792d('0x34')][_0x792d('0x40')]+'%'};return _0x49d824;}})});}_0x2e3284=_[_0x792d('0x41')]({},_0x2e3284,_0x276a5d[_0x792d('0x42')]);var _0x5b0bf8={'where':_0x2e3284[_0x792d('0x3f')]};return db['VoiceChanSpy']['count'](_0x5b0bf8)['then'](function(_0x23c711){_0x474775['count']=_0x23c711;if(_0x276a5d[_0x792d('0x34')]['includeAll']){_0x2e3284['include']=[{'all':!![]}];}return db[_0x792d('0x2f')][_0x792d('0x43')](_0x2e3284);})[_0x792d('0x26')](function(_0x356c19){_0x474775[_0x792d('0x44')]=_0x356c19;return _0x474775;})[_0x792d('0x26')](respondWithFilteredResult(_0xce423e,_0x2e3284))[_0x792d('0x45')](handleError(_0xce423e,null));};exports[_0x792d('0x46')]=function(_0x16ac50,_0x5681dc){var _0x21fc50={'raw':![],'where':{'id':_0x16ac50[_0x792d('0x47')]['id']}},_0x277d57={};_0x277d57['model']=_[_0x792d('0x48')](db['VoiceChanSpy'][_0x792d('0x30')]);_0x277d57[_0x792d('0x34')]=_['keys'](_0x16ac50[_0x792d('0x34')]);_0x277d57[_0x792d('0x35')]=_['intersection'](_0x277d57[_0x792d('0x37')],_0x277d57['query']);_0x21fc50[_0x792d('0x38')]=_[_0x792d('0x36')](_0x277d57[_0x792d('0x37')],qs[_0x792d('0x39')](_0x16ac50[_0x792d('0x34')]['fields']));_0x21fc50[_0x792d('0x38')]=_0x21fc50[_0x792d('0x38')][_0x792d('0x3a')]?_0x21fc50[_0x792d('0x38')]:_0x277d57[_0x792d('0x37')];if(_0x16ac50[_0x792d('0x34')]['includeAll']){_0x21fc50[_0x792d('0x49')]=[{'all':!![]}];}_0x21fc50=_[_0x792d('0x41')]({},_0x21fc50,_0x16ac50[_0x792d('0x42')]);return db['VoiceChanSpy']['find'](_0x21fc50)[_0x792d('0x26')](handleEntityNotFound(_0x5681dc,null))[_0x792d('0x26')](respondWithResult(_0x5681dc,null))[_0x792d('0x45')](handleError(_0x5681dc,null));};exports[_0x792d('0x4a')]=function(_0x3f127c,_0x2ad22e){return db[_0x792d('0x2f')]['create'](_0x3f127c['body'],{})[_0x792d('0x26')](function(_0x3d211b){var _0x1a4682=_0x3f127c['user'][_0x792d('0x28')]({'plain':!![]});if(!_0x1a4682)throw new Error(_0x792d('0x4b'));if(_0x1a4682[_0x792d('0x4c')]===_0x792d('0x4d')){var _0x5d4aac=_0x3d211b[_0x792d('0x28')]({'plain':!![]});var _0x4c50f6=_0x792d('0x29');return db['UserProfileSection'][_0x792d('0x4e')]({'where':{'name':_0x4c50f6,'userProfileId':_0x1a4682[_0x792d('0x4f')]},'raw':!![]})['then'](function(_0x22819a){if(_0x22819a&&_0x22819a['autoAssociation']===0x0){return db[_0x792d('0x50')]['create']({'name':_0x5d4aac[_0x792d('0x2c')],'resourceId':_0x5d4aac['id'],'type':_0x22819a['name'],'sectionId':_0x22819a['id']},{})[_0x792d('0x26')](function(){return _0x3d211b;});}else{return _0x3d211b;}})['catch'](function(_0x28aa93){logger[_0x792d('0x2a')](_0x792d('0x51'),_0x28aa93);throw _0x28aa93;});}return _0x3d211b;})[_0x792d('0x26')](respondWithResult(_0x2ad22e,0xc9))['catch'](handleError(_0x2ad22e,null));};exports[_0x792d('0x25')]=function(_0x399e61,_0x58859e){if(_0x399e61['body']['id']){delete _0x399e61[_0x792d('0x52')]['id'];}return db[_0x792d('0x2f')][_0x792d('0x4e')]({'where':{'id':_0x399e61[_0x792d('0x47')]['id']}})[_0x792d('0x26')](handleEntityNotFound(_0x58859e,null))['then'](saveUpdates(_0x399e61['body'],null))['then'](respondWithResult(_0x58859e,null))[_0x792d('0x45')](handleError(_0x58859e,null));};exports[_0x792d('0x27')]=function(_0x151a9c,_0x37d434){return db[_0x792d('0x2f')]['find']({'where':{'id':_0x151a9c['params']['id']}})[_0x792d('0x26')](handleEntityNotFound(_0x37d434,null))[_0x792d('0x26')](removeEntity(_0x37d434,null))[_0x792d('0x45')](handleError(_0x37d434,null));}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.model.js b/server/api/voiceChanSpy/voiceChanSpy.model.js index fc3a0a2..79634ea 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 _0xd2ca=['then','catch','voice_chanspy','length','VoiceExtension','destroy','bulkCreate','util','bluebird','./voiceChanSpy.attributes','context','from-sip','format','%s%s','prefix','system','push','merge','Set','CDR(type)=%s','chanspy','record','${UNIQUEID}.%s,a','recordingFormat','auth','Authenticate','password','ChanSpy','SIP/%s,%s','name','options','StopMixMonitor','concat','internal','User','findAll','agent'];(function(_0x114d1c,_0x514f55){var _0x2752cd=function(_0xab808e){while(--_0xab808e){_0x114d1c['push'](_0x114d1c['shift']());}};_0x2752cd(++_0x514f55);}(_0xd2ca,0x10a));var _0xad2c=function(_0x3d74a,_0x556736){_0x3d74a=_0x3d74a-0x0;var _0x28e85e=_0xd2ca[_0x3d74a];return _0x28e85e;};'use strict';var _=require('lodash');var util=require(_0xad2c('0x0'));var BPromise=require(_0xad2c('0x1'));var attributes=require(_0xad2c('0x2'));var getUserApplications=function(_0x551471,_0x2ee9f2,_0x3f14f1){var _0x1113cd=0x1;var _0x2e9f29=[];var _0x57cf27={'context':_0x2ee9f2[_0xad2c('0x3')]||_0xad2c('0x4'),'exten':util[_0xad2c('0x5')](_0xad2c('0x6'),_0x551471[_0xad2c('0x7')],_0x3f14f1),'type':_0xad2c('0x8'),'isApp':![],'ChanSpyId':_0x551471['id'],'UserId':_0x2ee9f2['id']};_0x2e9f29[_0xad2c('0x9')](_[_0xad2c('0xa')]({'app':_0xad2c('0xb'),'appdata':util[_0xad2c('0x5')](_0xad2c('0xc'),_0xad2c('0xd')),'priority':_0x1113cd++},_0x57cf27));if(_0x551471[_0xad2c('0xe')]){_0x2e9f29[_0xad2c('0x9')](_[_0xad2c('0xa')]({'app':'MixMonitor','appdata':util[_0xad2c('0x5')](_0xad2c('0xf'),_0x551471[_0xad2c('0x10')]),'priority':_0x1113cd++},_0x57cf27));}if(_0x551471[_0xad2c('0x11')]){_0x2e9f29[_0xad2c('0x9')](_[_0xad2c('0xa')]({'app':_0xad2c('0x12'),'appdata':_0x551471[_0xad2c('0x13')],'priority':_0x1113cd++},_0x57cf27));}_0x2e9f29['push'](_[_0xad2c('0xa')]({'app':_0xad2c('0x14'),'appdata':util['format'](_0xad2c('0x15'),_0x2ee9f2[_0xad2c('0x16')],_0x551471[_0xad2c('0x17')]?_0x551471[_0xad2c('0x17')]['join'](''):''),'priority':_0x1113cd++},_0x57cf27));if(_0x551471['record']){_0x2e9f29['push'](_[_0xad2c('0xa')]({'app':_0xad2c('0x18'),'priority':_0x1113cd++},_0x57cf27));}return _0x2e9f29;};var getChanSpyApplications=function(_0x358cd1,_0x21ed33){var _0x17b5c4=[];for(var _0x1f3737=0x0,_0x4421d8=0x1;_0x1f3737<_0x21ed33['length'];_0x1f3737++,_0x4421d8=0x1){_0x17b5c4=_0x17b5c4[_0xad2c('0x19')](getUserApplications(_0x358cd1,_0x21ed33[_0x1f3737],_0x21ed33[_0x1f3737][_0xad2c('0x1a')]));if(_0x21ed33[_0x1f3737][_0xad2c('0x1a')]!=_0x21ed33[_0x1f3737][_0xad2c('0x16')]){_0x17b5c4=_0x17b5c4[_0xad2c('0x19')](getUserApplications(_0x358cd1,_0x21ed33[_0x1f3737],_0x21ed33[_0x1f3737][_0xad2c('0x16')]));}}return _0x17b5c4;};var getChanSpyPromise=function(_0x7e916f,_0xff00a5){return new BPromise(function(_0x2a02d0,_0x18f81d){return _0x7e916f[_0xad2c('0x1b')][_0xad2c('0x1c')]({'attributes':['id',_0xad2c('0x16'),_0xad2c('0x1a')],'where':{'role':_0xad2c('0x1d'),'chanspy':!![]},'raw':!![]})[_0xad2c('0x1e')](function(_0x396697){if(_0x396697){return _0x2a02d0(getChanSpyApplications(_0xff00a5,_0x396697));}return _0x2a02d0([]);})[_0xad2c('0x1f')](function(_0xe6bb99){_0x18f81d(_0xe6bb99);});});};module['exports']=function(_0x214213,_0x12bf36){var _0x3e5c88=_0x214213['models'];return _0x214213['define']('VoiceChanSpy',attributes,{'tableName':_0xad2c('0x20'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x840c0b,_0x50a9c0,_0x3bc625){return getChanSpyPromise(_0x3e5c88,_0x840c0b)[_0xad2c('0x1e')](function(_0x36b878){if(_0x36b878&&_0x36b878[_0xad2c('0x21')]){return _0x3e5c88[_0xad2c('0x22')]['bulkCreate'](_0x36b878);}})['then'](function(){_0x3bc625();})[_0xad2c('0x1f')](function(_0x2a40dd){_0x3bc625(_0x2a40dd);});},'afterUpdate':function(_0x29a7d5,_0x544a03,_0x4354be){return _0x3e5c88[_0xad2c('0x22')][_0xad2c('0x23')]({'where':{'ChanSpyId':_0x29a7d5['id']}})[_0xad2c('0x1e')](function(){return getChanSpyPromise(_0x3e5c88,_0x29a7d5);})[_0xad2c('0x1e')](function(_0x59dcb3){if(_0x59dcb3&&_0x59dcb3[_0xad2c('0x21')]){return _0x3e5c88['VoiceExtension'][_0xad2c('0x24')](_0x59dcb3);}})[_0xad2c('0x1e')](function(){_0x4354be();})[_0xad2c('0x1f')](function(_0x53b14b){_0x4354be(_0x53b14b);});},'afterDestroy':function(_0x1b08f5,_0x5e658a,_0x21c69d){return _0x3e5c88[_0xad2c('0x22')]['destroy']({'where':{'ChanSpyId':_0x1b08f5['id']}})[_0xad2c('0x1e')](function(){_0x21c69d();})[_0xad2c('0x1f')](function(_0x5f2d1c){_0x21c69d(_0x5f2d1c);});}}});}; \ No newline at end of file +var _0xdfb2=['recordingFormat','auth','Authenticate','password','SIP/%s,%s','options','join','record','StopMixMonitor','length','internal','name','concat','User','then','define','VoiceChanSpy','voice_chanspy','VoiceExtension','bulkCreate','catch','destroy','lodash','util','./voiceChanSpy.attributes','context','format','prefix','system','push','merge','Set','CDR(type)=%s','chanspy','MixMonitor','${UNIQUEID}.%s,a'];(function(_0x376147,_0x125af9){var _0x20dc06=function(_0x5a2de1){while(--_0x5a2de1){_0x376147['push'](_0x376147['shift']());}};_0x20dc06(++_0x125af9);}(_0xdfb2,0xca));var _0x2dfb=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xdfb2[_0x501510];return _0x1e6ee5;};'use strict';var _=require(_0x2dfb('0x0'));var util=require(_0x2dfb('0x1'));var BPromise=require('bluebird');var attributes=require(_0x2dfb('0x2'));var getUserApplications=function(_0x192f08,_0x2cef15,_0x3e6ef4){var _0x5583a5=0x1;var _0x120f65=[];var _0x1ff6cc={'context':_0x2cef15[_0x2dfb('0x3')]||'from-sip','exten':util[_0x2dfb('0x4')]('%s%s',_0x192f08[_0x2dfb('0x5')],_0x3e6ef4),'type':_0x2dfb('0x6'),'isApp':![],'ChanSpyId':_0x192f08['id'],'UserId':_0x2cef15['id']};_0x120f65[_0x2dfb('0x7')](_[_0x2dfb('0x8')]({'app':_0x2dfb('0x9'),'appdata':util[_0x2dfb('0x4')](_0x2dfb('0xa'),_0x2dfb('0xb')),'priority':_0x5583a5++},_0x1ff6cc));if(_0x192f08['record']){_0x120f65[_0x2dfb('0x7')](_[_0x2dfb('0x8')]({'app':_0x2dfb('0xc'),'appdata':util[_0x2dfb('0x4')](_0x2dfb('0xd'),_0x192f08[_0x2dfb('0xe')]),'priority':_0x5583a5++},_0x1ff6cc));}if(_0x192f08[_0x2dfb('0xf')]){_0x120f65[_0x2dfb('0x7')](_['merge']({'app':_0x2dfb('0x10'),'appdata':_0x192f08[_0x2dfb('0x11')],'priority':_0x5583a5++},_0x1ff6cc));}_0x120f65[_0x2dfb('0x7')](_['merge']({'app':'ChanSpy','appdata':util[_0x2dfb('0x4')](_0x2dfb('0x12'),_0x2cef15['name'],_0x192f08['options']?_0x192f08[_0x2dfb('0x13')][_0x2dfb('0x14')](''):''),'priority':_0x5583a5++},_0x1ff6cc));if(_0x192f08[_0x2dfb('0x15')]){_0x120f65[_0x2dfb('0x7')](_[_0x2dfb('0x8')]({'app':_0x2dfb('0x16'),'priority':_0x5583a5++},_0x1ff6cc));}return _0x120f65;};var getChanSpyApplications=function(_0x1e2e58,_0x5c0cc5){var _0x4aaa47=[];for(var _0xf94d85=0x0,_0xb077fc=0x1;_0xf94d85<_0x5c0cc5[_0x2dfb('0x17')];_0xf94d85++,_0xb077fc=0x1){_0x4aaa47=_0x4aaa47['concat'](getUserApplications(_0x1e2e58,_0x5c0cc5[_0xf94d85],_0x5c0cc5[_0xf94d85][_0x2dfb('0x18')]));if(_0x5c0cc5[_0xf94d85][_0x2dfb('0x18')]!=_0x5c0cc5[_0xf94d85][_0x2dfb('0x19')]){_0x4aaa47=_0x4aaa47[_0x2dfb('0x1a')](getUserApplications(_0x1e2e58,_0x5c0cc5[_0xf94d85],_0x5c0cc5[_0xf94d85][_0x2dfb('0x19')]));}}return _0x4aaa47;};var getChanSpyPromise=function(_0x2c60b1,_0x4d14a3){return new BPromise(function(_0x4a11c2,_0xb4ad88){return _0x2c60b1[_0x2dfb('0x1b')]['findAll']({'attributes':['id',_0x2dfb('0x19'),_0x2dfb('0x18')],'where':{'role':'agent','chanspy':!![]},'raw':!![]})[_0x2dfb('0x1c')](function(_0x1b85f2){if(_0x1b85f2){return _0x4a11c2(getChanSpyApplications(_0x4d14a3,_0x1b85f2));}return _0x4a11c2([]);})['catch'](function(_0xc85f18){_0xb4ad88(_0xc85f18);});});};module['exports']=function(_0x2d2da9,_0x48f492){var _0x4d0b73=_0x2d2da9['models'];return _0x2d2da9[_0x2dfb('0x1d')](_0x2dfb('0x1e'),attributes,{'tableName':_0x2dfb('0x1f'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x17309b,_0x27a28b,_0x250912){return getChanSpyPromise(_0x4d0b73,_0x17309b)['then'](function(_0x2dd25f){if(_0x2dd25f&&_0x2dd25f[_0x2dfb('0x17')]){return _0x4d0b73[_0x2dfb('0x20')][_0x2dfb('0x21')](_0x2dd25f);}})['then'](function(){_0x250912();})[_0x2dfb('0x22')](function(_0x58c991){_0x250912(_0x58c991);});},'afterUpdate':function(_0x432fd0,_0x9e0f82,_0x271f8c){return _0x4d0b73[_0x2dfb('0x20')]['destroy']({'where':{'ChanSpyId':_0x432fd0['id']}})[_0x2dfb('0x1c')](function(){return getChanSpyPromise(_0x4d0b73,_0x432fd0);})['then'](function(_0x556c6d){if(_0x556c6d&&_0x556c6d[_0x2dfb('0x17')]){return _0x4d0b73[_0x2dfb('0x20')][_0x2dfb('0x21')](_0x556c6d);}})[_0x2dfb('0x1c')](function(){_0x271f8c();})[_0x2dfb('0x22')](function(_0xf87b3d){_0x271f8c(_0xf87b3d);});},'afterDestroy':function(_0x4e9b9d,_0xb0a56f,_0x260042){return _0x4d0b73[_0x2dfb('0x20')][_0x2dfb('0x23')]({'where':{'ChanSpyId':_0x4e9b9d['id']}})[_0x2dfb('0x1c')](function(){_0x260042();})[_0x2dfb('0x22')](function(_0x44b572){_0x260042(_0x44b572);});}}});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.rpc.js b/server/api/voiceChanSpy/voiceChanSpy.rpc.js index 1b74861..a7519ef 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 _0x00b3=['util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','VoiceChanSpy,\x20%s,\x20%s','request\x20sent','debug','VoiceChanSpy,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result'];(function(_0xc52c80,_0x5dcd73){var _0x5f1c38=function(_0x3b4a24){while(--_0x3b4a24){_0xc52c80['push'](_0xc52c80['shift']());}};_0x5f1c38(++_0x5dcd73);}(_0x00b3,0x17a));var _0x300b=function(_0x4e653b,_0x1cd838){_0x4e653b=_0x4e653b-0x0;var _0x41da09=_0x00b3[_0x4e653b];return _0x41da09;};'use strict';var _=require('lodash');var util=require(_0x300b('0x0'));var moment=require(_0x300b('0x1'));var BPromise=require(_0x300b('0x2'));var rs=require(_0x300b('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x300b('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x300b('0x5'))('rpc');var config=require(_0x300b('0x6'));var jayson=require(_0x300b('0x7'));var client=jayson[_0x300b('0x8')][_0x300b('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5af470,_0x5dabb9,_0x30b3fe){return new BPromise(function(_0x590c4d,_0x5e283c){return client[_0x300b('0xa')](_0x5af470,_0x30b3fe)[_0x300b('0xb')](function(_0x457aa3){logger['info'](_0x300b('0xc'),_0x5dabb9,_0x300b('0xd'));logger[_0x300b('0xe')](_0x300b('0xf'),_0x5dabb9,'request\x20sent',JSON[_0x300b('0x10')](_0x457aa3));if(_0x457aa3[_0x300b('0x11')]){if(_0x457aa3[_0x300b('0x11')]['code']===0x1f4){logger[_0x300b('0x11')](_0x300b('0xc'),_0x5dabb9,_0x457aa3[_0x300b('0x11')][_0x300b('0x12')]);return _0x5e283c(_0x457aa3[_0x300b('0x11')][_0x300b('0x12')]);}logger[_0x300b('0x11')](_0x300b('0xc'),_0x5dabb9,_0x457aa3['error']['message']);return _0x590c4d(_0x457aa3['error']['message']);}else{logger[_0x300b('0x13')](_0x300b('0xc'),_0x5dabb9,_0x300b('0xd'));_0x590c4d(_0x457aa3[_0x300b('0x14')]['message']);}})['catch'](function(_0x35b1d7){logger[_0x300b('0x11')](_0x300b('0xc'),_0x5dabb9,_0x35b1d7);_0x5e283c(_0x35b1d7);});});} \ No newline at end of file +var _0x4483=['stringify','error','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','VoiceChanSpy,\x20%s,\x20%s','request\x20sent','debug','VoiceChanSpy,\x20%s,\x20%s,\x20%s'];(function(_0x189d55,_0x3e69f2){var _0x34e807=function(_0x2d2bd9){while(--_0x2d2bd9){_0x189d55['push'](_0x189d55['shift']());}};_0x34e807(++_0x3e69f2);}(_0x4483,0x1a3));var _0x3448=function(_0x505965,_0x36805a){_0x505965=_0x505965-0x0;var _0xa65c27=_0x4483[_0x505965];return _0xa65c27;};'use strict';var _=require(_0x3448('0x0'));var util=require(_0x3448('0x1'));var moment=require(_0x3448('0x2'));var BPromise=require('bluebird');var rs=require(_0x3448('0x3'));var fs=require('fs');var Redis=require(_0x3448('0x4'));var db=require(_0x3448('0x5'))['db'];var utils=require(_0x3448('0x6'));var logger=require(_0x3448('0x7'))('rpc');var config=require(_0x3448('0x8'));var jayson=require(_0x3448('0x9'));var client=jayson[_0x3448('0xa')][_0x3448('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1bb7e5,_0x2caa81,_0x3cc81d){return new BPromise(function(_0x34b926,_0x5923ee){return client['request'](_0x1bb7e5,_0x3cc81d)[_0x3448('0xc')](function(_0x25c152){logger[_0x3448('0xd')](_0x3448('0xe'),_0x2caa81,_0x3448('0xf'));logger[_0x3448('0x10')](_0x3448('0x11'),_0x2caa81,_0x3448('0xf'),JSON[_0x3448('0x12')](_0x25c152));if(_0x25c152[_0x3448('0x13')]){if(_0x25c152[_0x3448('0x13')]['code']===0x1f4){logger['error'](_0x3448('0xe'),_0x2caa81,_0x25c152[_0x3448('0x13')]['message']);return _0x5923ee(_0x25c152[_0x3448('0x13')][_0x3448('0x14')]);}logger[_0x3448('0x13')]('VoiceChanSpy,\x20%s,\x20%s',_0x2caa81,_0x25c152[_0x3448('0x13')][_0x3448('0x14')]);return _0x34b926(_0x25c152['error'][_0x3448('0x14')]);}else{logger[_0x3448('0xd')](_0x3448('0xe'),_0x2caa81,'request\x20sent');_0x34b926(_0x25c152[_0x3448('0x15')][_0x3448('0x14')]);}})[_0x3448('0x16')](function(_0x30f8dd){logger[_0x3448('0x13')](_0x3448('0xe'),_0x2caa81,_0x30f8dd);_0x5923ee(_0x30f8dd);});});} \ No newline at end of file diff --git a/server/api/voiceContext/index.js b/server/api/voiceContext/index.js index b8fb30c..5a9b3ef 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 _0xcba5=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','create','put','update','delete','exports','path','connect-timeout','express'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xcba5,0x1a6));var _0x5cba=function(_0x465a0c,_0x19d4d5){_0x465a0c=_0x465a0c-0x0;var _0x1e202e=_0xcba5[_0x465a0c];return _0x1e202e;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x5cba('0x0'));var timeout=require(_0x5cba('0x1'));var express=require(_0x5cba('0x2'));var router=express[_0x5cba('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x5cba('0x4'));var interaction=require(_0x5cba('0x5'));var config=require(_0x5cba('0x6'));var controller=require('./voiceContext.controller');router[_0x5cba('0x7')]('/',auth[_0x5cba('0x8')](),controller[_0x5cba('0x9')]);router[_0x5cba('0x7')](_0x5cba('0xa'),auth[_0x5cba('0x8')](),controller[_0x5cba('0xb')]);router['post']('/',auth[_0x5cba('0x8')](),controller[_0x5cba('0xc')]);router[_0x5cba('0xd')]('/:id',auth[_0x5cba('0x8')](),controller[_0x5cba('0xe')]);router[_0x5cba('0xf')](_0x5cba('0xa'),auth['isAuthenticated'](),controller['destroy']);module[_0x5cba('0x10')]=router; \ No newline at end of file +var _0xb49a=['show','create','put','update','delete','/:id','destroy','exports','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./voiceContext.controller','index','get','isAuthenticated'];(function(_0x3cc4c8,_0x114636){var _0xdc0123=function(_0x1c3078){while(--_0x1c3078){_0x3cc4c8['push'](_0x3cc4c8['shift']());}};_0xdc0123(++_0x114636);}(_0xb49a,0x125));var _0xab49=function(_0x1cb84c,_0x576b00){_0x1cb84c=_0x1cb84c-0x0;var _0x1ff4ed=_0xb49a[_0x1cb84c];return _0x1ff4ed;};'use strict';var multer=require('multer');var util=require(_0xab49('0x0'));var path=require('path');var timeout=require(_0xab49('0x1'));var express=require(_0xab49('0x2'));var router=express[_0xab49('0x3')]();var fs_extra=require(_0xab49('0x4'));var auth=require(_0xab49('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xab49('0x6'));var controller=require(_0xab49('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0xab49('0x8')]);router[_0xab49('0x9')]('/:id',auth[_0xab49('0xa')](),controller[_0xab49('0xb')]);router['post']('/',auth[_0xab49('0xa')](),controller[_0xab49('0xc')]);router[_0xab49('0xd')]('/:id',auth[_0xab49('0xa')](),controller[_0xab49('0xe')]);router[_0xab49('0xf')](_0xab49('0x10'),auth[_0xab49('0xa')](),controller[_0xab49('0x11')]);module[_0xab49('0x12')]=router; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.attributes.js b/server/api/voiceContext/voiceContext.attributes.js index 0c00df1..e4d5ec3 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 _0xf346=['name','exports','STRING'];(function(_0x51b7bd,_0x2896b4){var _0x422feb=function(_0x414a2e){while(--_0x414a2e){_0x51b7bd['push'](_0x51b7bd['shift']());}};_0x422feb(++_0x2896b4);}(_0xf346,0x118));var _0x6f34=function(_0x1b6186,_0x1ec7f2){_0x1b6186=_0x1b6186-0x0;var _0x186121=_0xf346[_0x1b6186];return _0x186121;};'use strict';var Sequelize=require('sequelize');module[_0x6f34('0x0')]={'name':{'type':Sequelize[_0x6f34('0x1')],'unique':_0x6f34('0x2')},'description':{'type':Sequelize[_0x6f34('0x1')],'allowNull':!![]},'defaultEntry':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0}}; \ No newline at end of file +var _0xf453=['STRING','sequelize','name'];(function(_0x14e27a,_0x3b4136){var _0x288688=function(_0x3d7ab1){while(--_0x3d7ab1){_0x14e27a['push'](_0x14e27a['shift']());}};_0x288688(++_0x3b4136);}(_0xf453,0x1e1));var _0x3f45=function(_0x245994,_0x4a8c9d){_0x245994=_0x245994-0x0;var _0x3476f6=_0xf453[_0x245994];return _0x3476f6;};'use strict';var Sequelize=require(_0x3f45('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0x3f45('0x1')},'description':{'type':Sequelize[_0x3f45('0x2')],'allowNull':!![]},'defaultEntry':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.controller.js b/server/api/voiceContext/voiceContext.controller.js index 2047aa0..c25defa 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 _0xfe3a=['filter','where','VIRTUAL','merge','VoiceContext','findAll','rows','params','rawAttributes','includeAll','options','find','create','body','readFileSync','root','server/files/templates/context.ejs','render','writeFileSync','/etc/asterisk/extensions_xcally_contexts.conf','chan_sip.so','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Contexts','userProfileId','autoAssociation','join','utf8','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','request','then','VoiceContext,\x20%s,\x20%s','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','end','status','json','offset','limit','count','set','Content-Range','apply','reject','save','update','get','UserProfileResource','destroy','sendStatus','stack','name','send','index','map','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','pick'];(function(_0x240c31,_0x3e2d43){var _0x478e85=function(_0xbd2146){while(--_0xbd2146){_0x240c31['push'](_0x240c31['shift']());}};_0x478e85(++_0x3e2d43);}(_0xfe3a,0x152));var _0xafe3=function(_0x1bab98,_0x139eea){_0x1bab98=_0x1bab98-0x0;var _0x2c4d91=_0xfe3a[_0x1bab98];return _0x2c4d91;};'use strict';var emlformat=require(_0xafe3('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xafe3('0x1'));var jsonpatch=require(_0xafe3('0x2'));var rp=require(_0xafe3('0x3'));var moment=require(_0xafe3('0x4'));var BPromise=require(_0xafe3('0x5'));var Mustache=require(_0xafe3('0x6'));var util=require(_0xafe3('0x7'));var path=require(_0xafe3('0x8'));var sox=require(_0xafe3('0x9'));var csv=require(_0xafe3('0xa'));var ejs=require(_0xafe3('0xb'));var fs=require('fs');var fs_extra=require(_0xafe3('0xc'));var _=require(_0xafe3('0xd'));var squel=require(_0xafe3('0xe'));var crypto=require(_0xafe3('0xf'));var jsforce=require(_0xafe3('0x10'));var deskjs=require('desk.js');var toCsv=require(_0xafe3('0xa'));var querystring=require(_0xafe3('0x11'));var Papa=require('papaparse');var Redis=require(_0xafe3('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xafe3('0x13'));var as=require(_0xafe3('0x14'));var hardwareService=require(_0xafe3('0x15'));var logger=require(_0xafe3('0x16'))(_0xafe3('0x17'));var utils=require(_0xafe3('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0xafe3('0x19'));var db=require(_0xafe3('0x1a'))['db'];var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x59cc09,_0xe35c0e,_0x349c6a,_0x4fa349){return new BPromise(function(_0x14db8c,_0x232bdb){var _0x3746c3=_0x4fa349||client;return _0x3746c3[_0xafe3('0x1b')](_0x59cc09,_0x349c6a)[_0xafe3('0x1c')](function(_0x106a85){logger['info'](_0xafe3('0x1d'),_0xe35c0e,_0xafe3('0x1e'));logger[_0xafe3('0x1f')](_0xafe3('0x20'),_0xe35c0e,_0xafe3('0x1e'),JSON['stringify'](_0x106a85));if(_0x106a85[_0xafe3('0x21')]){if(_0x106a85[_0xafe3('0x21')][_0xafe3('0x22')]===0x1f4){logger['error'](_0xafe3('0x1d'),_0xe35c0e,_0x106a85[_0xafe3('0x21')][_0xafe3('0x23')]);return _0x232bdb(_0x106a85['error'][_0xafe3('0x23')]);}logger[_0xafe3('0x21')](_0xafe3('0x1d'),_0xe35c0e,_0x106a85[_0xafe3('0x21')][_0xafe3('0x23')]);return _0x14db8c(_0x106a85[_0xafe3('0x21')]['message']);}else{logger[_0xafe3('0x24')]('VoiceContext,\x20%s,\x20%s',_0xe35c0e,_0xafe3('0x1e'));_0x14db8c(_0x106a85[_0xafe3('0x25')][_0xafe3('0x23')]);}})[_0xafe3('0x26')](function(_0x43ec87){logger[_0xafe3('0x21')](_0xafe3('0x1d'),_0xe35c0e,_0x43ec87);_0x232bdb(_0x43ec87);});});}function respondWithStatusCode(_0x3b35bc,_0x787e74){_0x787e74=_0x787e74||0xcc;return function(_0x1c0b66){if(_0x1c0b66){return _0x3b35bc['sendStatus'](_0x787e74);}return _0x3b35bc['status'](_0x787e74)[_0xafe3('0x27')]();};}function respondWithResult(_0x20e95e,_0x401621){_0x401621=_0x401621||0xc8;return function(_0xa724f4){if(_0xa724f4){return _0x20e95e[_0xafe3('0x28')](_0x401621)[_0xafe3('0x29')](_0xa724f4);}};}function respondWithFilteredResult(_0x456fb,_0xd8bdc){return function(_0x49d586){if(_0x49d586){var _0x51786e=typeof _0xd8bdc[_0xafe3('0x2a')]==='undefined'&&typeof _0xd8bdc[_0xafe3('0x2b')]==='undefined';var _0x1e7507=_0x49d586[_0xafe3('0x2c')];var _0x28661d=_0x51786e?0x0:_0xd8bdc['offset'];var _0xa65136=_0x51786e?_0x49d586['count']:_0xd8bdc[_0xafe3('0x2a')]+_0xd8bdc[_0xafe3('0x2b')];var _0x5037ce;if(_0xa65136>=_0x1e7507){_0xa65136=_0x1e7507;_0x5037ce=0xc8;}else{_0x5037ce=0xce;}_0x456fb['status'](_0x5037ce);return _0x456fb[_0xafe3('0x2d')](_0xafe3('0x2e'),_0x28661d+'-'+_0xa65136+'/'+_0x1e7507)[_0xafe3('0x29')](_0x49d586);}return null;};}function patchUpdates(_0x2b7eaa){return function(_0x437d17){try{jsonpatch[_0xafe3('0x2f')](_0x437d17,_0x2b7eaa,!![]);}catch(_0x3ba1e4){return BPromise[_0xafe3('0x30')](_0x3ba1e4);}return _0x437d17[_0xafe3('0x31')]();};}function saveUpdates(_0x4c8d13,_0x4dde94){return function(_0x2dc5e9){if(_0x2dc5e9){return _0x2dc5e9[_0xafe3('0x32')](_0x4c8d13)['then'](function(_0x11bad9){return _0x11bad9;});}return null;};}function removeEntity(_0x472b75,_0x2904f5){return function(_0x1f7304){if(_0x1f7304){return _0x1f7304['destroy']()['then'](function(){var _0x4992e3=_0x1f7304[_0xafe3('0x33')]({'plain':!![]});var _0x12a56f='Contexts';return db[_0xafe3('0x34')][_0xafe3('0x35')]({'where':{'type':_0x12a56f,'resourceId':_0x4992e3['id']}})['then'](function(){return _0x1f7304;});})[_0xafe3('0x1c')](function(){_0x472b75['status'](0xcc)[_0xafe3('0x27')]();});}};}function handleEntityNotFound(_0x86580a,_0xc059ca){return function(_0x10c010){if(!_0x10c010){_0x86580a[_0xafe3('0x36')](0x194);}return _0x10c010;};}function handleError(_0xd1d5b8,_0x2f0640){_0x2f0640=_0x2f0640||0x1f4;return function(_0x2a4c4d){logger['error'](_0x2a4c4d[_0xafe3('0x37')]);if(_0x2a4c4d['name']){delete _0x2a4c4d[_0xafe3('0x38')];}_0xd1d5b8[_0xafe3('0x28')](_0x2f0640)[_0xafe3('0x39')](_0x2a4c4d);};}exports[_0xafe3('0x3a')]=function(_0x30c462,_0x98f4a3){var _0x25169d={},_0x4ef8aa={},_0x2f2b3e={'count':0x0,'rows':[]};var _0x54a57e=_[_0xafe3('0x3b')](db['VoiceContext']['rawAttributes'],function(_0x16064b){return{'name':_0x16064b[_0xafe3('0x3c')],'type':_0x16064b[_0xafe3('0x3d')][_0xafe3('0x3e')]};});_0x4ef8aa[_0xafe3('0x3f')]=_[_0xafe3('0x3b')](_0x54a57e,'name');_0x4ef8aa[_0xafe3('0x40')]=_[_0xafe3('0x41')](_0x30c462['query']);_0x4ef8aa[_0xafe3('0x42')]=_[_0xafe3('0x43')](_0x4ef8aa[_0xafe3('0x3f')],_0x4ef8aa['query']);_0x25169d[_0xafe3('0x44')]=_[_0xafe3('0x43')](_0x4ef8aa[_0xafe3('0x3f')],qs['fields'](_0x30c462['query'][_0xafe3('0x45')]));_0x25169d[_0xafe3('0x44')]=_0x25169d[_0xafe3('0x44')]['length']?_0x25169d[_0xafe3('0x44')]:_0x4ef8aa[_0xafe3('0x3f')];if(!_0x30c462[_0xafe3('0x40')][_0xafe3('0x46')](_0xafe3('0x47'))){_0x25169d['limit']=qs[_0xafe3('0x2b')](_0x30c462[_0xafe3('0x40')][_0xafe3('0x2b')]);_0x25169d['offset']=qs[_0xafe3('0x2a')](_0x30c462[_0xafe3('0x40')][_0xafe3('0x2a')]);}_0x25169d['order']=qs[_0xafe3('0x48')](_0x30c462[_0xafe3('0x40')][_0xafe3('0x48')]);_0x25169d['where']=qs[_0xafe3('0x42')](_[_0xafe3('0x49')](_0x30c462['query'],_0x4ef8aa[_0xafe3('0x42')]),_0x54a57e);if(_0x30c462[_0xafe3('0x40')][_0xafe3('0x4a')]){_0x25169d[_0xafe3('0x4b')]=_['merge'](_0x25169d['where'],{'$or':_['map'](_0x54a57e,function(_0x36de61){if(_0x36de61[_0xafe3('0x3d')]!==_0xafe3('0x4c')){var _0x4da336={};_0x4da336[_0x36de61[_0xafe3('0x38')]]={'$like':'%'+_0x30c462[_0xafe3('0x40')][_0xafe3('0x4a')]+'%'};return _0x4da336;}})});}_0x25169d=_[_0xafe3('0x4d')]({},_0x25169d,_0x30c462['options']);var _0x502a70={'where':_0x25169d[_0xafe3('0x4b')]};return db[_0xafe3('0x4e')][_0xafe3('0x2c')](_0x502a70)['then'](function(_0x3809df){_0x2f2b3e['count']=_0x3809df;if(_0x30c462[_0xafe3('0x40')]['includeAll']){_0x25169d['include']=[{'all':!![]}];}return db['VoiceContext'][_0xafe3('0x4f')](_0x25169d);})[_0xafe3('0x1c')](function(_0x8aa0b3){_0x2f2b3e[_0xafe3('0x50')]=_0x8aa0b3;return _0x2f2b3e;})[_0xafe3('0x1c')](respondWithFilteredResult(_0x98f4a3,_0x25169d))['catch'](handleError(_0x98f4a3,null));};exports['show']=function(_0x1da8c7,_0x274c33){var _0x358c53={'raw':![],'where':{'id':_0x1da8c7[_0xafe3('0x51')]['id']}},_0x10df81={};_0x10df81['model']=_[_0xafe3('0x41')](db[_0xafe3('0x4e')][_0xafe3('0x52')]);_0x10df81[_0xafe3('0x40')]=_[_0xafe3('0x41')](_0x1da8c7[_0xafe3('0x40')]);_0x10df81[_0xafe3('0x42')]=_[_0xafe3('0x43')](_0x10df81[_0xafe3('0x3f')],_0x10df81[_0xafe3('0x40')]);_0x358c53[_0xafe3('0x44')]=_[_0xafe3('0x43')](_0x10df81[_0xafe3('0x3f')],qs[_0xafe3('0x45')](_0x1da8c7['query'][_0xafe3('0x45')]));_0x358c53[_0xafe3('0x44')]=_0x358c53['attributes']['length']?_0x358c53[_0xafe3('0x44')]:_0x10df81[_0xafe3('0x3f')];if(_0x1da8c7[_0xafe3('0x40')][_0xafe3('0x53')]){_0x358c53['include']=[{'all':!![]}];}_0x358c53=_[_0xafe3('0x4d')]({},_0x358c53,_0x1da8c7[_0xafe3('0x54')]);return db[_0xafe3('0x4e')][_0xafe3('0x55')](_0x358c53)['then'](handleEntityNotFound(_0x274c33,null))[_0xafe3('0x1c')](respondWithResult(_0x274c33,null))[_0xafe3('0x26')](handleError(_0x274c33,null));};exports[_0xafe3('0x56')]=function(_0x3f1b0e,_0x3b7dff,_0x21361e){var _0x41a867;return db['VoiceContext'][_0xafe3('0x56')](_0x3f1b0e[_0xafe3('0x57')],{'raw':!![]})['then'](function(_0x190ce8){_0x41a867=_0x190ce8;return db[_0xafe3('0x4e')][_0xafe3('0x4f')]({'raw':!![]});})[_0xafe3('0x1c')](function(_0x10130e){var _0x77d85=fs[_0xafe3('0x58')](path['join'](config[_0xafe3('0x59')],_0xafe3('0x5a')),'utf8');var _0x6d70b5=ejs[_0xafe3('0x5b')](_0x77d85,{'contexts':_0x10130e||[]});fs[_0xafe3('0x5c')](_0xafe3('0x5d'),_0x6d70b5);})[_0xafe3('0x1c')](function(){return respondWithRpcPromise('Reload',_0xafe3('0x56'),{'module':_0xafe3('0x5e')});})[_0xafe3('0x1c')](function(){var _0x50c435=_0x3f1b0e[_0xafe3('0x5f')]['get']({'plain':!![]});if(!_0x50c435)throw new Error(_0xafe3('0x60'));if(_0x50c435[_0xafe3('0x61')]===_0xafe3('0x5f')){var _0x2198d2=_0x41a867[_0xafe3('0x33')]({'plain':!![]});return db['UserProfileSection'][_0xafe3('0x55')]({'where':{'name':_0xafe3('0x62'),'userProfileId':_0x50c435[_0xafe3('0x63')]},'raw':!![]})[_0xafe3('0x1c')](function(_0x4fdce0){if(_0x4fdce0&&_0x4fdce0[_0xafe3('0x64')]===0x0){return db[_0xafe3('0x34')][_0xafe3('0x56')]({'name':_0x2198d2[_0xafe3('0x38')],'resourceId':_0x2198d2['id'],'type':_0x4fdce0['name'],'sectionId':_0x4fdce0['id']},{})[_0xafe3('0x1c')](function(){return _0x41a867;});}else{return _0x41a867;}})['catch'](function(_0x4236c6){logger[_0xafe3('0x21')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4236c6);throw _0x4236c6;});}return _0x41a867;})['then'](respondWithResult(_0x3b7dff,0xc9))[_0xafe3('0x26')](handleError(_0x3b7dff,null));};exports[_0xafe3('0x32')]=function(_0x364cb2,_0x454ba9,_0x7aa2c1){var _0x3e598b;return db[_0xafe3('0x4e')][_0xafe3('0x55')]({'where':{'id':_0x364cb2[_0xafe3('0x51')]['id']}})[_0xafe3('0x1c')](handleEntityNotFound(_0x454ba9,null))[_0xafe3('0x1c')](saveUpdates(_0x364cb2['body'],null))[_0xafe3('0x1c')](function(_0x30ed1f){if(_0x30ed1f){_0x3e598b=_0x30ed1f;return db[_0xafe3('0x4e')][_0xafe3('0x4f')]({'raw':!![]});}})[_0xafe3('0x1c')](function(_0x54d7de){var _0x1383f7=fs['readFileSync'](path[_0xafe3('0x65')](config[_0xafe3('0x59')],_0xafe3('0x5a')),_0xafe3('0x66'));var _0x19cb05=ejs['render'](_0x1383f7,{'contexts':_0x54d7de||[]});fs[_0xafe3('0x5c')](_0xafe3('0x5d'),_0x19cb05);})['then'](function(){return respondWithRpcPromise('Reload',_0xafe3('0x32'),{'module':_0xafe3('0x5e')});})[_0xafe3('0x1c')](function(){return _0x3e598b;})[_0xafe3('0x1c')](respondWithResult(_0x454ba9,null))[_0xafe3('0x26')](handleError(_0x454ba9,null));};exports['destroy']=function(_0x4ab724,_0x59e4ff,_0x438e9b){var _0x3bb5d7;return db['VoiceContext'][_0xafe3('0x55')]({'where':{'id':_0x4ab724['params']['id']}})[_0xafe3('0x1c')](handleEntityNotFound(_0x59e4ff,null))[_0xafe3('0x1c')](removeEntity(_0x59e4ff,null))[_0xafe3('0x1c')](function(){return db[_0xafe3('0x4e')][_0xafe3('0x4f')]({'raw':!![]});})[_0xafe3('0x1c')](function(_0xd68306){var _0xa5b4fb=fs[_0xafe3('0x58')](path['join'](config[_0xafe3('0x59')],_0xafe3('0x5a')),'utf8');var _0x51f6e7=ejs[_0xafe3('0x5b')](_0xa5b4fb,{'contexts':_0xd68306});fs['writeFileSync'](_0xafe3('0x5d'),_0x51f6e7);return respondWithRpcPromise('Reload',_0xafe3('0x35'),{'module':'chan_sip.so'});})['catch'](handleError(_0x59e4ff,null));}; \ No newline at end of file +var _0x064f=['limit','count','set','apply','reject','save','update','get','UserProfileResource','destroy','name','index','VoiceContext','fieldName','type','model','keys','query','filters','intersection','attributes','fields','length','order','sort','where','pick','filter','map','VIRTUAL','then','includeAll','include','show','params','rawAttributes','merge','options','find','create','body','findAll','readFileSync','join','root','utf8','render','writeFileSync','/etc/asterisk/extensions_xcally_contexts.conf','Reload','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','server/files/templates/context.ejs','chan_sip.so','rimraf','zip-dir','request-promise','moment','path','to-csv','ejs','fs-extra','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','jayson/promise','client','http','request','info','VoiceContext,\x20%s,\x20%s','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','sendStatus','end','status','offset','undefined'];(function(_0x34fed3,_0x371036){var _0x3f415d=function(_0x1ec886){while(--_0x1ec886){_0x34fed3['push'](_0x34fed3['shift']());}};_0x3f415d(++_0x371036);}(_0x064f,0x1c7));var _0xf064=function(_0x12fc8d,_0x19ee33){_0x12fc8d=_0x12fc8d-0x0;var _0x3f9d04=_0x064f[_0x12fc8d];return _0x3f9d04;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf064('0x0'));var zipdir=require(_0xf064('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf064('0x2'));var moment=require(_0xf064('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xf064('0x4'));var sox=require('sox');var csv=require(_0xf064('0x5'));var ejs=require(_0xf064('0x6'));var fs=require('fs');var fs_extra=require(_0xf064('0x7'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xf064('0x8'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xf064('0x9'));var Papa=require(_0xf064('0xa'));var Redis=require(_0xf064('0xb'));var authService=require(_0xf064('0xc'));var qs=require(_0xf064('0xd'));var as=require(_0xf064('0xe'));var hardwareService=require(_0xf064('0xf'));var logger=require(_0xf064('0x10'))(_0xf064('0x11'));var utils=require('../../config/utils');var config=require(_0xf064('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0xf064('0x13'))['db'];var jayson=require(_0xf064('0x14'));var client=jayson[_0xf064('0x15')][_0xf064('0x16')]({'port':0x232a});function respondWithRpcPromise(_0x3d87f1,_0x3c1cbc,_0xa049b0,_0x1716bf){return new BPromise(function(_0x96e3e5,_0x344c6c){var _0x37e265=_0x1716bf||client;return _0x37e265[_0xf064('0x17')](_0x3d87f1,_0xa049b0)['then'](function(_0x352488){logger[_0xf064('0x18')](_0xf064('0x19'),_0x3c1cbc,_0xf064('0x1a'));logger[_0xf064('0x1b')](_0xf064('0x1c'),_0x3c1cbc,_0xf064('0x1a'),JSON[_0xf064('0x1d')](_0x352488));if(_0x352488['error']){if(_0x352488['error'][_0xf064('0x1e')]===0x1f4){logger['error'](_0xf064('0x19'),_0x3c1cbc,_0x352488[_0xf064('0x1f')][_0xf064('0x20')]);return _0x344c6c(_0x352488[_0xf064('0x1f')][_0xf064('0x20')]);}logger[_0xf064('0x1f')](_0xf064('0x19'),_0x3c1cbc,_0x352488[_0xf064('0x1f')]['message']);return _0x96e3e5(_0x352488['error'][_0xf064('0x20')]);}else{logger[_0xf064('0x18')](_0xf064('0x19'),_0x3c1cbc,_0xf064('0x1a'));_0x96e3e5(_0x352488[_0xf064('0x21')]['message']);}})[_0xf064('0x22')](function(_0x54963c){logger['error'](_0xf064('0x19'),_0x3c1cbc,_0x54963c);_0x344c6c(_0x54963c);});});}function respondWithStatusCode(_0x3da656,_0xf85b23){_0xf85b23=_0xf85b23||0xcc;return function(_0x58a881){if(_0x58a881){return _0x3da656[_0xf064('0x23')](_0xf85b23);}return _0x3da656['status'](_0xf85b23)[_0xf064('0x24')]();};}function respondWithResult(_0x187acd,_0x36f1eb){_0x36f1eb=_0x36f1eb||0xc8;return function(_0xfe774d){if(_0xfe774d){return _0x187acd[_0xf064('0x25')](_0x36f1eb)['json'](_0xfe774d);}};}function respondWithFilteredResult(_0xc53abf,_0x1ad1c1){return function(_0x5299f3){if(_0x5299f3){var _0x279cbb=typeof _0x1ad1c1[_0xf064('0x26')]===_0xf064('0x27')&&typeof _0x1ad1c1[_0xf064('0x28')]===_0xf064('0x27');var _0x731722=_0x5299f3[_0xf064('0x29')];var _0x41888b=_0x279cbb?0x0:_0x1ad1c1[_0xf064('0x26')];var _0x51ec45=_0x279cbb?_0x5299f3[_0xf064('0x29')]:_0x1ad1c1[_0xf064('0x26')]+_0x1ad1c1['limit'];var _0x93d537;if(_0x51ec45>=_0x731722){_0x51ec45=_0x731722;_0x93d537=0xc8;}else{_0x93d537=0xce;}_0xc53abf[_0xf064('0x25')](_0x93d537);return _0xc53abf[_0xf064('0x2a')]('Content-Range',_0x41888b+'-'+_0x51ec45+'/'+_0x731722)['json'](_0x5299f3);}return null;};}function patchUpdates(_0x3feb9a){return function(_0x122331){try{jsonpatch[_0xf064('0x2b')](_0x122331,_0x3feb9a,!![]);}catch(_0x51ed36){return BPromise[_0xf064('0x2c')](_0x51ed36);}return _0x122331[_0xf064('0x2d')]();};}function saveUpdates(_0x1bbd3f,_0x519ef0){return function(_0x5d0170){if(_0x5d0170){return _0x5d0170[_0xf064('0x2e')](_0x1bbd3f)['then'](function(_0x252071){return _0x252071;});}return null;};}function removeEntity(_0x3524db,_0x488019){return function(_0x209289){if(_0x209289){return _0x209289['destroy']()['then'](function(){var _0x182cd9=_0x209289[_0xf064('0x2f')]({'plain':!![]});var _0x335a23='Contexts';return db[_0xf064('0x30')][_0xf064('0x31')]({'where':{'type':_0x335a23,'resourceId':_0x182cd9['id']}})['then'](function(){return _0x209289;});})['then'](function(){_0x3524db[_0xf064('0x25')](0xcc)[_0xf064('0x24')]();});}};}function handleEntityNotFound(_0x6925ba,_0x536e0b){return function(_0x21413a){if(!_0x21413a){_0x6925ba[_0xf064('0x23')](0x194);}return _0x21413a;};}function handleError(_0x5bff8b,_0x27b5f2){_0x27b5f2=_0x27b5f2||0x1f4;return function(_0x1b9227){logger[_0xf064('0x1f')](_0x1b9227['stack']);if(_0x1b9227['name']){delete _0x1b9227[_0xf064('0x32')];}_0x5bff8b[_0xf064('0x25')](_0x27b5f2)['send'](_0x1b9227);};}exports[_0xf064('0x33')]=function(_0x5c1086,_0x23a467){var _0x4655fe={},_0x59db2={},_0x3b3853={'count':0x0,'rows':[]};var _0x345438=_['map'](db[_0xf064('0x34')]['rawAttributes'],function(_0x525da9){return{'name':_0x525da9[_0xf064('0x35')],'type':_0x525da9[_0xf064('0x36')]['key']};});_0x59db2[_0xf064('0x37')]=_['map'](_0x345438,_0xf064('0x32'));_0x59db2['query']=_[_0xf064('0x38')](_0x5c1086[_0xf064('0x39')]);_0x59db2[_0xf064('0x3a')]=_[_0xf064('0x3b')](_0x59db2[_0xf064('0x37')],_0x59db2[_0xf064('0x39')]);_0x4655fe[_0xf064('0x3c')]=_['intersection'](_0x59db2['model'],qs[_0xf064('0x3d')](_0x5c1086['query'][_0xf064('0x3d')]));_0x4655fe[_0xf064('0x3c')]=_0x4655fe['attributes'][_0xf064('0x3e')]?_0x4655fe['attributes']:_0x59db2[_0xf064('0x37')];if(!_0x5c1086[_0xf064('0x39')]['hasOwnProperty']('nolimit')){_0x4655fe[_0xf064('0x28')]=qs[_0xf064('0x28')](_0x5c1086[_0xf064('0x39')][_0xf064('0x28')]);_0x4655fe[_0xf064('0x26')]=qs[_0xf064('0x26')](_0x5c1086[_0xf064('0x39')][_0xf064('0x26')]);}_0x4655fe[_0xf064('0x3f')]=qs[_0xf064('0x40')](_0x5c1086[_0xf064('0x39')][_0xf064('0x40')]);_0x4655fe[_0xf064('0x41')]=qs[_0xf064('0x3a')](_[_0xf064('0x42')](_0x5c1086[_0xf064('0x39')],_0x59db2[_0xf064('0x3a')]),_0x345438);if(_0x5c1086['query'][_0xf064('0x43')]){_0x4655fe['where']=_['merge'](_0x4655fe[_0xf064('0x41')],{'$or':_[_0xf064('0x44')](_0x345438,function(_0x59c75b){if(_0x59c75b[_0xf064('0x36')]!==_0xf064('0x45')){var _0x2db2ed={};_0x2db2ed[_0x59c75b[_0xf064('0x32')]]={'$like':'%'+_0x5c1086['query']['filter']+'%'};return _0x2db2ed;}})});}_0x4655fe=_['merge']({},_0x4655fe,_0x5c1086['options']);var _0x8130e0={'where':_0x4655fe[_0xf064('0x41')]};return db[_0xf064('0x34')]['count'](_0x8130e0)[_0xf064('0x46')](function(_0x2c72d9){_0x3b3853[_0xf064('0x29')]=_0x2c72d9;if(_0x5c1086[_0xf064('0x39')][_0xf064('0x47')]){_0x4655fe[_0xf064('0x48')]=[{'all':!![]}];}return db[_0xf064('0x34')]['findAll'](_0x4655fe);})[_0xf064('0x46')](function(_0x3d91d5){_0x3b3853['rows']=_0x3d91d5;return _0x3b3853;})[_0xf064('0x46')](respondWithFilteredResult(_0x23a467,_0x4655fe))[_0xf064('0x22')](handleError(_0x23a467,null));};exports[_0xf064('0x49')]=function(_0x5d8999,_0x1b34c7){var _0xa7e3d8={'raw':![],'where':{'id':_0x5d8999[_0xf064('0x4a')]['id']}},_0x345357={};_0x345357[_0xf064('0x37')]=_[_0xf064('0x38')](db[_0xf064('0x34')][_0xf064('0x4b')]);_0x345357['query']=_[_0xf064('0x38')](_0x5d8999[_0xf064('0x39')]);_0x345357[_0xf064('0x3a')]=_[_0xf064('0x3b')](_0x345357[_0xf064('0x37')],_0x345357[_0xf064('0x39')]);_0xa7e3d8[_0xf064('0x3c')]=_[_0xf064('0x3b')](_0x345357[_0xf064('0x37')],qs[_0xf064('0x3d')](_0x5d8999[_0xf064('0x39')][_0xf064('0x3d')]));_0xa7e3d8['attributes']=_0xa7e3d8[_0xf064('0x3c')]['length']?_0xa7e3d8['attributes']:_0x345357['model'];if(_0x5d8999[_0xf064('0x39')]['includeAll']){_0xa7e3d8[_0xf064('0x48')]=[{'all':!![]}];}_0xa7e3d8=_[_0xf064('0x4c')]({},_0xa7e3d8,_0x5d8999[_0xf064('0x4d')]);return db['VoiceContext'][_0xf064('0x4e')](_0xa7e3d8)[_0xf064('0x46')](handleEntityNotFound(_0x1b34c7,null))[_0xf064('0x46')](respondWithResult(_0x1b34c7,null))[_0xf064('0x22')](handleError(_0x1b34c7,null));};exports[_0xf064('0x4f')]=function(_0xcd750f,_0x289b6a,_0x40caec){var _0x895be2;return db[_0xf064('0x34')]['create'](_0xcd750f[_0xf064('0x50')],{'raw':!![]})[_0xf064('0x46')](function(_0x50b231){_0x895be2=_0x50b231;return db[_0xf064('0x34')][_0xf064('0x51')]({'raw':!![]});})[_0xf064('0x46')](function(_0x3bbc70){var _0x3500bc=fs[_0xf064('0x52')](path[_0xf064('0x53')](config[_0xf064('0x54')],'server/files/templates/context.ejs'),_0xf064('0x55'));var _0x19ba28=ejs[_0xf064('0x56')](_0x3500bc,{'contexts':_0x3bbc70||[]});fs[_0xf064('0x57')](_0xf064('0x58'),_0x19ba28);})[_0xf064('0x46')](function(){return respondWithRpcPromise(_0xf064('0x59'),_0xf064('0x4f'),{'module':'chan_sip.so'});})[_0xf064('0x46')](function(){var _0xd236e7=_0xcd750f[_0xf064('0x5a')][_0xf064('0x2f')]({'plain':!![]});if(!_0xd236e7)throw new Error(_0xf064('0x5b'));if(_0xd236e7[_0xf064('0x5c')]===_0xf064('0x5a')){var _0x45c709=_0x895be2[_0xf064('0x2f')]({'plain':!![]});return db[_0xf064('0x5d')][_0xf064('0x4e')]({'where':{'name':'Contexts','userProfileId':_0xd236e7[_0xf064('0x5e')]},'raw':!![]})[_0xf064('0x46')](function(_0x5f1e50){if(_0x5f1e50&&_0x5f1e50[_0xf064('0x5f')]===0x0){return db[_0xf064('0x30')]['create']({'name':_0x45c709['name'],'resourceId':_0x45c709['id'],'type':_0x5f1e50[_0xf064('0x32')],'sectionId':_0x5f1e50['id']},{})[_0xf064('0x46')](function(){return _0x895be2;});}else{return _0x895be2;}})[_0xf064('0x22')](function(_0xbdacaf){logger[_0xf064('0x1f')](_0xf064('0x60'),_0xbdacaf);throw _0xbdacaf;});}return _0x895be2;})[_0xf064('0x46')](respondWithResult(_0x289b6a,0xc9))[_0xf064('0x22')](handleError(_0x289b6a,null));};exports['update']=function(_0x1d8426,_0x57dc0b,_0x57ffd6){var _0x455678;return db[_0xf064('0x34')][_0xf064('0x4e')]({'where':{'id':_0x1d8426[_0xf064('0x4a')]['id']}})[_0xf064('0x46')](handleEntityNotFound(_0x57dc0b,null))['then'](saveUpdates(_0x1d8426[_0xf064('0x50')],null))[_0xf064('0x46')](function(_0x3c6774){if(_0x3c6774){_0x455678=_0x3c6774;return db['VoiceContext'][_0xf064('0x51')]({'raw':!![]});}})[_0xf064('0x46')](function(_0x56bd6b){var _0x5c7caa=fs[_0xf064('0x52')](path[_0xf064('0x53')](config[_0xf064('0x54')],_0xf064('0x61')),_0xf064('0x55'));var _0x4fad75=ejs[_0xf064('0x56')](_0x5c7caa,{'contexts':_0x56bd6b||[]});fs[_0xf064('0x57')]('/etc/asterisk/extensions_xcally_contexts.conf',_0x4fad75);})[_0xf064('0x46')](function(){return respondWithRpcPromise('Reload',_0xf064('0x2e'),{'module':_0xf064('0x62')});})[_0xf064('0x46')](function(){return _0x455678;})['then'](respondWithResult(_0x57dc0b,null))[_0xf064('0x22')](handleError(_0x57dc0b,null));};exports[_0xf064('0x31')]=function(_0x7eda0d,_0x431eb0,_0x4d1983){var _0x3a35cb;return db[_0xf064('0x34')][_0xf064('0x4e')]({'where':{'id':_0x7eda0d['params']['id']}})[_0xf064('0x46')](handleEntityNotFound(_0x431eb0,null))[_0xf064('0x46')](removeEntity(_0x431eb0,null))[_0xf064('0x46')](function(){return db[_0xf064('0x34')][_0xf064('0x51')]({'raw':!![]});})[_0xf064('0x46')](function(_0xbd722){var _0x5818e3=fs['readFileSync'](path[_0xf064('0x53')](config[_0xf064('0x54')],_0xf064('0x61')),'utf8');var _0x3a7a64=ejs[_0xf064('0x56')](_0x5818e3,{'contexts':_0xbd722});fs[_0xf064('0x57')](_0xf064('0x58'),_0x3a7a64);return respondWithRpcPromise(_0xf064('0x59'),'destroy',{'module':_0xf064('0x62')});})['catch'](handleError(_0x431eb0,null));}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.model.js b/server/api/voiceContext/voiceContext.model.js index dd0c1cb..65a0451 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 _0xaea5=['rimraf','exports','voice_contexts','lodash','api','request-promise'];(function(_0x489b4a,_0x43c90a){var _0xbe1425=function(_0x477839){while(--_0x477839){_0x489b4a['push'](_0x489b4a['shift']());}};_0xbe1425(++_0x43c90a);}(_0xaea5,0xb7));var _0x5aea=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xaea5[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0x5aea('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x5aea('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x5aea('0x2'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5aea('0x3'));var config=require('../../config/environment');var attributes=require('./voiceContext.attributes');module[_0x5aea('0x4')]=function(_0x5efdbb,_0x46629f){return _0x5efdbb['define']('VoiceContext',attributes,{'tableName':_0x5aea('0x5'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xcb2a=['VoiceContext','voice_contexts','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','exports','define'];(function(_0x34ed96,_0x497918){var _0x21acaf=function(_0x35340e){while(--_0x35340e){_0x34ed96['push'](_0x34ed96['shift']());}};_0x21acaf(++_0x497918);}(_0xcb2a,0x147));var _0xacb2=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xcb2a[_0x19e35c];return _0x3e1fe8;};'use strict';var _=require(_0xacb2('0x0'));var util=require(_0xacb2('0x1'));var logger=require(_0xacb2('0x2'))(_0xacb2('0x3'));var moment=require('moment');var BPromise=require(_0xacb2('0x4'));var rp=require(_0xacb2('0x5'));var fs=require('fs');var path=require(_0xacb2('0x6'));var rimraf=require(_0xacb2('0x7'));var config=require(_0xacb2('0x8'));var attributes=require('./voiceContext.attributes');module[_0xacb2('0x9')]=function(_0x7b78d0,_0x1769db){return _0x7b78d0[_0xacb2('0xa')](_0xacb2('0xb'),attributes,{'tableName':_0xacb2('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.rpc.js b/server/api/voiceContext/voiceContext.rpc.js index 014f124..5419e36 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 _0x85de=['randomstring','../../mysqldb','rpc','../../config/environment','client','http','request','info','VoiceContext,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','lodash','util','moment','bluebird'];(function(_0x11e7f4,_0x176bd0){var _0x2204bb=function(_0x13f8d2){while(--_0x13f8d2){_0x11e7f4['push'](_0x11e7f4['shift']());}};_0x2204bb(++_0x176bd0);}(_0x85de,0x1f0));var _0xe85d=function(_0xbd60c1,_0x5c8e96){_0xbd60c1=_0xbd60c1-0x0;var _0x595ea3=_0x85de[_0xbd60c1];return _0x595ea3;};'use strict';var _=require(_0xe85d('0x0'));var util=require(_0xe85d('0x1'));var moment=require(_0xe85d('0x2'));var BPromise=require(_0xe85d('0x3'));var rs=require(_0xe85d('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe85d('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xe85d('0x6'));var config=require(_0xe85d('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xe85d('0x8')][_0xe85d('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x220e10,_0xd468f9,_0x4608f4){return new BPromise(function(_0x888738,_0xc86467){return client[_0xe85d('0xa')](_0x220e10,_0x4608f4)['then'](function(_0x4128d5){logger[_0xe85d('0xb')](_0xe85d('0xc'),_0xd468f9,_0xe85d('0xd'));logger[_0xe85d('0xe')]('VoiceContext,\x20%s,\x20%s,\x20%s',_0xd468f9,_0xe85d('0xd'),JSON['stringify'](_0x4128d5));if(_0x4128d5[_0xe85d('0xf')]){if(_0x4128d5['error'][_0xe85d('0x10')]===0x1f4){logger['error'](_0xe85d('0xc'),_0xd468f9,_0x4128d5[_0xe85d('0xf')][_0xe85d('0x11')]);return _0xc86467(_0x4128d5[_0xe85d('0xf')][_0xe85d('0x11')]);}logger[_0xe85d('0xf')](_0xe85d('0xc'),_0xd468f9,_0x4128d5['error'][_0xe85d('0x11')]);return _0x888738(_0x4128d5[_0xe85d('0xf')]['message']);}else{logger[_0xe85d('0xb')](_0xe85d('0xc'),_0xd468f9,_0xe85d('0xd'));_0x888738(_0x4128d5[_0xe85d('0x12')][_0xe85d('0x11')]);}})[_0xe85d('0x13')](function(_0x136fe6){logger[_0xe85d('0xf')](_0xe85d('0xc'),_0xd468f9,_0x136fe6);_0xc86467(_0x136fe6);});});} \ No newline at end of file +var _0xf269=['info','debug','VoiceContext,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','VoiceContext,\x20%s,\x20%s','message','result','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http'];(function(_0x1f8037,_0x3e60f2){var _0x251275=function(_0x14e9ad){while(--_0x14e9ad){_0x1f8037['push'](_0x1f8037['shift']());}};_0x251275(++_0x3e60f2);}(_0xf269,0xd2));var _0x9f26=function(_0x4a096a,_0x11e36c){_0x4a096a=_0x4a096a-0x0;var _0x3f14ee=_0xf269[_0x4a096a];return _0x3f14ee;};'use strict';var _=require('lodash');var util=require(_0x9f26('0x0'));var moment=require(_0x9f26('0x1'));var BPromise=require('bluebird');var rs=require(_0x9f26('0x2'));var fs=require('fs');var Redis=require(_0x9f26('0x3'));var db=require(_0x9f26('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x9f26('0x5'))('rpc');var config=require(_0x9f26('0x6'));var jayson=require(_0x9f26('0x7'));var client=jayson[_0x9f26('0x8')][_0x9f26('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xfa0f44,_0x10b905,_0x4700a8){return new BPromise(function(_0x14a6ba,_0x5bece0){return client['request'](_0xfa0f44,_0x4700a8)['then'](function(_0x19f7b8){logger[_0x9f26('0xa')]('VoiceContext,\x20%s,\x20%s',_0x10b905,'request\x20sent');logger[_0x9f26('0xb')](_0x9f26('0xc'),_0x10b905,_0x9f26('0xd'),JSON[_0x9f26('0xe')](_0x19f7b8));if(_0x19f7b8['error']){if(_0x19f7b8['error']['code']===0x1f4){logger[_0x9f26('0xf')](_0x9f26('0x10'),_0x10b905,_0x19f7b8['error'][_0x9f26('0x11')]);return _0x5bece0(_0x19f7b8[_0x9f26('0xf')][_0x9f26('0x11')]);}logger[_0x9f26('0xf')](_0x9f26('0x10'),_0x10b905,_0x19f7b8['error'][_0x9f26('0x11')]);return _0x14a6ba(_0x19f7b8[_0x9f26('0xf')][_0x9f26('0x11')]);}else{logger['info'](_0x9f26('0x10'),_0x10b905,_0x9f26('0xd'));_0x14a6ba(_0x19f7b8[_0x9f26('0x12')][_0x9f26('0x11')]);}})[_0x9f26('0x13')](function(_0x542567){logger[_0x9f26('0xf')](_0x9f26('0x10'),_0x10b905,_0x542567);_0x5bece0(_0x542567);});});} \ No newline at end of file diff --git a/server/api/voiceDialReport/index.js b/server/api/voiceDialReport/index.js index c8d97e3..dde9e8f 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 _0x93f0=['connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./voiceDialReport.controller','get','isAuthenticated','index','/describe','/:id','show','create','put','update','delete','destroy','exports','multer','util','path'];(function(_0x2b2cce,_0x582b1c){var _0x2b78b3=function(_0x557d61){while(--_0x557d61){_0x2b2cce['push'](_0x2b2cce['shift']());}};_0x2b78b3(++_0x582b1c);}(_0x93f0,0x14d));var _0x093f=function(_0x36a867,_0x216806){_0x36a867=_0x36a867-0x0;var _0x4363b3=_0x93f0[_0x36a867];return _0x4363b3;};'use strict';var multer=require(_0x093f('0x0'));var util=require(_0x093f('0x1'));var path=require(_0x093f('0x2'));var timeout=require(_0x093f('0x3'));var express=require('express');var router=express[_0x093f('0x4')]();var fs_extra=require(_0x093f('0x5'));var auth=require(_0x093f('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x093f('0x7'));var controller=require(_0x093f('0x8'));router[_0x093f('0x9')]('/',auth[_0x093f('0xa')](),controller[_0x093f('0xb')]);router['get'](_0x093f('0xc'),auth[_0x093f('0xa')](),controller['describe']);router[_0x093f('0x9')](_0x093f('0xd'),auth[_0x093f('0xa')](),controller[_0x093f('0xe')]);router['post']('/',auth[_0x093f('0xa')](),controller[_0x093f('0xf')]);router[_0x093f('0x10')](_0x093f('0xd'),auth['isAuthenticated'](),controller[_0x093f('0x11')]);router[_0x093f('0x12')](_0x093f('0xd'),auth[_0x093f('0xa')](),controller[_0x093f('0x13')]);module[_0x093f('0x14')]=router; \ No newline at end of file +var _0x1393=['/:id','create','put','update','destroy','exports','util','path','connect-timeout','Router','fs-extra','isAuthenticated','/describe','get'];(function(_0x4e3d28,_0x352109){var _0x4f95e6=function(_0x596716){while(--_0x596716){_0x4e3d28['push'](_0x4e3d28['shift']());}};_0x4f95e6(++_0x352109);}(_0x1393,0x92));var _0x3139=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x1393[_0x20a584];return _0x4b41a8;};'use strict';var multer=require('multer');var util=require(_0x3139('0x0'));var path=require(_0x3139('0x1'));var timeout=require(_0x3139('0x2'));var express=require('express');var router=express[_0x3139('0x3')]();var fs_extra=require(_0x3139('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./voiceDialReport.controller');router['get']('/',auth[_0x3139('0x5')](),controller['index']);router['get'](_0x3139('0x6'),auth[_0x3139('0x5')](),controller['describe']);router[_0x3139('0x7')](_0x3139('0x8'),auth[_0x3139('0x5')](),controller['show']);router['post']('/',auth[_0x3139('0x5')](),controller[_0x3139('0x9')]);router[_0x3139('0xa')]('/:id',auth['isAuthenticated'](),controller[_0x3139('0xb')]);router['delete'](_0x3139('0x8'),auth[_0x3139('0x5')](),controller[_0x3139('0xc')]);module[_0x3139('0xd')]=router; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.attributes.js b/server/api/voiceDialReport/voiceDialReport.attributes.js index c2a4888..76f3b92 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 _0xf3cd=['exports','STRING','INTEGER','DATE','sequelize'];(function(_0x2eb2eb,_0x433f14){var _0x14448f=function(_0x54c1ca){while(--_0x54c1ca){_0x2eb2eb['push'](_0x2eb2eb['shift']());}};_0x14448f(++_0x433f14);}(_0xf3cd,0xfe));var _0xdf3c=function(_0x1bbc08,_0x444008){_0x1bbc08=_0x1bbc08-0x0;var _0x5d825b=_0xf3cd[_0x1bbc08];return _0x5d825b;};'use strict';var Sequelize=require(_0xdf3c('0x0'));module[_0xdf3c('0x1')]={'privilege':{'type':Sequelize[_0xdf3c('0x2')]},'channel':{'type':Sequelize[_0xdf3c('0x2')]},'channelstate':{'type':Sequelize[_0xdf3c('0x3')]},'channelstatedesc':{'type':Sequelize[_0xdf3c('0x2')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0xdf3c('0x2')]},'connectedlinenum':{'type':Sequelize[_0xdf3c('0x2')]},'connectedlinename':{'type':Sequelize[_0xdf3c('0x2')]},'language':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0xdf3c('0x2')]},'context':{'type':Sequelize[_0xdf3c('0x2')]},'exten':{'type':Sequelize[_0xdf3c('0x2')]},'priority':{'type':Sequelize[_0xdf3c('0x3')]},'uniqueid':{'type':Sequelize[_0xdf3c('0x2')]},'linkedid':{'type':Sequelize[_0xdf3c('0x2')]},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize[_0xdf3c('0x3')]},'destchannelstatedesc':{'type':Sequelize['STRING']},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize[_0xdf3c('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0xdf3c('0x2')]},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize[_0xdf3c('0x2')]},'destaccountcode':{'type':Sequelize[_0xdf3c('0x2')]},'destcontext':{'type':Sequelize[_0xdf3c('0x2')]},'destexten':{'type':Sequelize[_0xdf3c('0x2')]},'destpriority':{'type':Sequelize[_0xdf3c('0x3')]},'destuniqueid':{'type':Sequelize[_0xdf3c('0x2')]},'destlinkedid':{'type':Sequelize[_0xdf3c('0x2')]},'dialstring':{'type':Sequelize[_0xdf3c('0x2')]},'dialstatus':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0xdf3c('0x4')]},'answertime':{'type':Sequelize[_0xdf3c('0x4')]},'endtime':{'type':Sequelize[_0xdf3c('0x4')]},'lastevent':{'type':Sequelize[_0xdf3c('0x2')],'comment':'called,connect,complete'},'routeId':{'type':Sequelize[_0xdf3c('0x3')]},'duration':{'type':Sequelize[_0xdf3c('0x3')]},'holdtime':{'type':Sequelize[_0xdf3c('0x3')]},'billableseconds':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0x9f62=['exports','STRING','INTEGER','DATE','called,connect,complete'];(function(_0x1085db,_0x41e087){var _0x392a60=function(_0xc7f75d){while(--_0xc7f75d){_0x1085db['push'](_0x1085db['shift']());}};_0x392a60(++_0x41e087);}(_0x9f62,0x154));var _0x29f6=function(_0x19b5a8,_0x4fe258){_0x19b5a8=_0x19b5a8-0x0;var _0x5c005a=_0x9f62[_0x19b5a8];return _0x5c005a;};'use strict';var Sequelize=require('sequelize');module[_0x29f6('0x0')]={'privilege':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x29f6('0x1')]},'channelstate':{'type':Sequelize[_0x29f6('0x2')]},'channelstatedesc':{'type':Sequelize[_0x29f6('0x1')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0x29f6('0x1')]},'connectedlinename':{'type':Sequelize[_0x29f6('0x1')]},'language':{'type':Sequelize[_0x29f6('0x1')]},'accountcode':{'type':Sequelize[_0x29f6('0x1')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0x29f6('0x1')]},'priority':{'type':Sequelize[_0x29f6('0x2')]},'uniqueid':{'type':Sequelize[_0x29f6('0x1')]},'linkedid':{'type':Sequelize[_0x29f6('0x1')]},'destchannel':{'type':Sequelize[_0x29f6('0x1')]},'destchannelstate':{'type':Sequelize['INTEGER']},'destchannelstatedesc':{'type':Sequelize['STRING']},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize[_0x29f6('0x1')]},'destconnectedlinename':{'type':Sequelize[_0x29f6('0x1')]},'destlanguage':{'type':Sequelize['STRING']},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize[_0x29f6('0x1')]},'destexten':{'type':Sequelize[_0x29f6('0x1')]},'destpriority':{'type':Sequelize['INTEGER']},'destuniqueid':{'type':Sequelize[_0x29f6('0x1')]},'destlinkedid':{'type':Sequelize[_0x29f6('0x1')]},'dialstring':{'type':Sequelize['STRING']},'dialstatus':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0x29f6('0x3')]},'lastevent':{'type':Sequelize[_0x29f6('0x1')],'comment':_0x29f6('0x4')},'routeId':{'type':Sequelize[_0x29f6('0x2')]},'duration':{'type':Sequelize[_0x29f6('0x2')]},'holdtime':{'type':Sequelize[_0x29f6('0x2')]},'billableseconds':{'type':Sequelize[_0x29f6('0x2')]}}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.controller.js b/server/api/voiceDialReport/voiceDialReport.controller.js index f479d8c..f1a71cc 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 _0x7312=['key','model','map','keys','filters','intersection','query','fields','attributes','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','rows','catch','params','length','find','create','body','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','squel','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','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','VoiceDialReport','rawAttributes','type'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x7312,0xf9));var _0x2731=function(_0x4792c8,_0x5158a1){_0x4792c8=_0x4792c8-0x0;var _0x35edb1=_0x7312[_0x4792c8];return _0x35edb1;};'use strict';var emlformat=require(_0x2731('0x0'));var rimraf=require(_0x2731('0x1'));var zipdir=require(_0x2731('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2731('0x3'));var moment=require(_0x2731('0x4'));var BPromise=require(_0x2731('0x5'));var Mustache=require(_0x2731('0x6'));var util=require(_0x2731('0x7'));var path=require(_0x2731('0x8'));var sox=require(_0x2731('0x9'));var csv=require(_0x2731('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2731('0xb'));var _=require('lodash');var squel=require(_0x2731('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x2731('0xd'));var toCsv=require(_0x2731('0xa'));var querystring=require(_0x2731('0xe'));var Papa=require(_0x2731('0xf'));var Redis=require(_0x2731('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x2731('0x11'));var as=require(_0x2731('0x12'));var hardwareService=require(_0x2731('0x13'));var logger=require(_0x2731('0x14'))('api');var utils=require('../../config/utils');var config=require(_0x2731('0x15'));var licenseUtil=require(_0x2731('0x16'));var db=require(_0x2731('0x17'))['db'];function respondWithStatusCode(_0x55bc92,_0x30ca13){_0x30ca13=_0x30ca13||0xcc;return function(_0x537e35){if(_0x537e35){return _0x55bc92[_0x2731('0x18')](_0x30ca13);}return _0x55bc92[_0x2731('0x19')](_0x30ca13)[_0x2731('0x1a')]();};}function respondWithResult(_0x2ef228,_0x25cf42){_0x25cf42=_0x25cf42||0xc8;return function(_0x4fe2c7){if(_0x4fe2c7){return _0x2ef228['status'](_0x25cf42)[_0x2731('0x1b')](_0x4fe2c7);}};}function respondWithFilteredResult(_0x45b03a,_0x431c95){return function(_0x4a6c63){if(_0x4a6c63){var _0x4b5d2f=typeof _0x431c95[_0x2731('0x1c')]===_0x2731('0x1d')&&typeof _0x431c95[_0x2731('0x1e')]===_0x2731('0x1d');var _0x2f901e=_0x4a6c63[_0x2731('0x1f')];var _0x140dec=_0x4b5d2f?0x0:_0x431c95[_0x2731('0x1c')];var _0x39b5ac=_0x4b5d2f?_0x4a6c63['count']:_0x431c95[_0x2731('0x1c')]+_0x431c95[_0x2731('0x1e')];var _0x20cf9d;if(_0x39b5ac>=_0x2f901e){_0x39b5ac=_0x2f901e;_0x20cf9d=0xc8;}else{_0x20cf9d=0xce;}_0x45b03a[_0x2731('0x19')](_0x20cf9d);return _0x45b03a[_0x2731('0x20')](_0x2731('0x21'),_0x140dec+'-'+_0x39b5ac+'/'+_0x2f901e)[_0x2731('0x1b')](_0x4a6c63);}return null;};}function patchUpdates(_0x1fc3ca){return function(_0x5879ad){try{jsonpatch['apply'](_0x5879ad,_0x1fc3ca,!![]);}catch(_0x1f44b4){return BPromise[_0x2731('0x22')](_0x1f44b4);}return _0x5879ad[_0x2731('0x23')]();};}function saveUpdates(_0x545756,_0x4e2e65){return function(_0x1d0bd0){if(_0x1d0bd0){return _0x1d0bd0[_0x2731('0x24')](_0x545756)[_0x2731('0x25')](function(_0x207d88){return _0x207d88;});}return null;};}function removeEntity(_0x23567,_0x13d0f7){return function(_0x373a41){if(_0x373a41){return _0x373a41[_0x2731('0x26')]()[_0x2731('0x25')](function(){_0x23567[_0x2731('0x19')](0xcc)[_0x2731('0x1a')]();});}};}function handleEntityNotFound(_0x1a7ab1,_0x20beca){return function(_0x5368a9){if(!_0x5368a9){_0x1a7ab1['sendStatus'](0x194);}return _0x5368a9;};}function handleError(_0x45b93b,_0x1fc90b){_0x1fc90b=_0x1fc90b||0x1f4;return function(_0xb47adb){logger[_0x2731('0x27')](_0xb47adb[_0x2731('0x28')]);if(_0xb47adb[_0x2731('0x29')]){delete _0xb47adb[_0x2731('0x29')];}_0x45b93b['status'](_0x1fc90b)[_0x2731('0x2a')](_0xb47adb);};}exports[_0x2731('0x2b')]=function(_0x32b3a9,_0x5e2a03){var _0x255755={},_0x1add82={},_0x89251f={'count':0x0,'rows':[]};var _0xb40464=_['map'](db[_0x2731('0x2c')][_0x2731('0x2d')],function(_0x41b48d){return{'name':_0x41b48d['fieldName'],'type':_0x41b48d[_0x2731('0x2e')][_0x2731('0x2f')]};});_0x1add82[_0x2731('0x30')]=_[_0x2731('0x31')](_0xb40464,_0x2731('0x29'));_0x1add82['query']=_[_0x2731('0x32')](_0x32b3a9['query']);_0x1add82[_0x2731('0x33')]=_[_0x2731('0x34')](_0x1add82['model'],_0x1add82[_0x2731('0x35')]);_0x255755['attributes']=_['intersection'](_0x1add82['model'],qs['fields'](_0x32b3a9[_0x2731('0x35')][_0x2731('0x36')]));_0x255755[_0x2731('0x37')]=_0x255755[_0x2731('0x37')]['length']?_0x255755['attributes']:_0x1add82['model'];if(!_0x32b3a9['query']['hasOwnProperty'](_0x2731('0x38'))){_0x255755[_0x2731('0x1e')]=qs[_0x2731('0x1e')](_0x32b3a9[_0x2731('0x35')][_0x2731('0x1e')]);_0x255755[_0x2731('0x1c')]=qs[_0x2731('0x1c')](_0x32b3a9[_0x2731('0x35')][_0x2731('0x1c')]);}_0x255755[_0x2731('0x39')]=qs[_0x2731('0x3a')](_0x32b3a9[_0x2731('0x35')][_0x2731('0x3a')]);_0x255755[_0x2731('0x3b')]=qs[_0x2731('0x33')](_[_0x2731('0x3c')](_0x32b3a9['query'],_0x1add82['filters']),_0xb40464);if(_0x32b3a9['query'][_0x2731('0x3d')]){_0x255755[_0x2731('0x3b')]=_[_0x2731('0x3e')](_0x255755['where'],{'$or':_['map'](_0xb40464,function(_0x36f8e2){if(_0x36f8e2[_0x2731('0x2e')]!=='VIRTUAL'){var _0x5cd72c={};_0x5cd72c[_0x36f8e2['name']]={'$like':'%'+_0x32b3a9['query'][_0x2731('0x3d')]+'%'};return _0x5cd72c;}})});}_0x255755=_['merge']({},_0x255755,_0x32b3a9[_0x2731('0x3f')]);var _0x4a55c5={'where':_0x255755[_0x2731('0x3b')]};return db[_0x2731('0x2c')][_0x2731('0x1f')](_0x4a55c5)[_0x2731('0x25')](function(_0x1f0322){_0x89251f[_0x2731('0x1f')]=_0x1f0322;if(_0x32b3a9[_0x2731('0x35')][_0x2731('0x40')]){_0x255755[_0x2731('0x41')]=[{'all':!![]}];}return db[_0x2731('0x2c')]['findAll'](_0x255755);})[_0x2731('0x25')](function(_0x3e31b4){_0x89251f[_0x2731('0x42')]=_0x3e31b4;return _0x89251f;})[_0x2731('0x25')](respondWithFilteredResult(_0x5e2a03,_0x255755))[_0x2731('0x43')](handleError(_0x5e2a03,null));};exports['show']=function(_0x2f476e,_0x1cd84d){var _0x3372e1={'raw':!![],'where':{'id':_0x2f476e[_0x2731('0x44')]['id']}},_0x43140b={};_0x43140b[_0x2731('0x30')]=_['keys'](db['VoiceDialReport']['rawAttributes']);_0x43140b[_0x2731('0x35')]=_[_0x2731('0x32')](_0x2f476e[_0x2731('0x35')]);_0x43140b['filters']=_[_0x2731('0x34')](_0x43140b[_0x2731('0x30')],_0x43140b[_0x2731('0x35')]);_0x3372e1['attributes']=_[_0x2731('0x34')](_0x43140b[_0x2731('0x30')],qs[_0x2731('0x36')](_0x2f476e[_0x2731('0x35')][_0x2731('0x36')]));_0x3372e1['attributes']=_0x3372e1['attributes'][_0x2731('0x45')]?_0x3372e1[_0x2731('0x37')]:_0x43140b['model'];if(_0x2f476e[_0x2731('0x35')][_0x2731('0x40')]){_0x3372e1[_0x2731('0x41')]=[{'all':!![]}];}_0x3372e1=_[_0x2731('0x3e')]({},_0x3372e1,_0x2f476e[_0x2731('0x3f')]);return db[_0x2731('0x2c')][_0x2731('0x46')](_0x3372e1)[_0x2731('0x25')](handleEntityNotFound(_0x1cd84d,null))[_0x2731('0x25')](respondWithResult(_0x1cd84d,null))[_0x2731('0x43')](handleError(_0x1cd84d,null));};exports[_0x2731('0x47')]=function(_0xa811af,_0x44b4b7){return db['VoiceDialReport']['create'](_0xa811af[_0x2731('0x48')],{})['then'](respondWithResult(_0x44b4b7,0xc9))['catch'](handleError(_0x44b4b7,null));};exports[_0x2731('0x24')]=function(_0x2ab9b0,_0x49478f){if(_0x2ab9b0[_0x2731('0x48')]['id']){delete _0x2ab9b0[_0x2731('0x48')]['id'];}return db[_0x2731('0x2c')][_0x2731('0x46')]({'where':{'id':_0x2ab9b0['params']['id']}})['then'](handleEntityNotFound(_0x49478f,null))[_0x2731('0x25')](saveUpdates(_0x2ab9b0['body'],null))[_0x2731('0x25')](respondWithResult(_0x49478f,null))[_0x2731('0x43')](handleError(_0x49478f,null));};exports[_0x2731('0x26')]=function(_0x7445dc,_0x5162d5){return db[_0x2731('0x2c')][_0x2731('0x46')]({'where':{'id':_0x7445dc[_0x2731('0x44')]['id']}})[_0x2731('0x25')](handleEntityNotFound(_0x5162d5,null))[_0x2731('0x25')](removeEntity(_0x5162d5,null))['catch'](handleError(_0x5162d5,null));};exports[_0x2731('0x49')]=function(_0x19c52b,_0x28c58b){return db['VoiceDialReport'][_0x2731('0x49')]()[_0x2731('0x25')](respondWithResult(_0x28c58b,null))[_0x2731('0x43')](handleError(_0x28c58b,null));}; \ No newline at end of file +var _0x644d=['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','then','destroy','error','stack','name','index','VoiceDialReport','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','catch','show','params','include','find','create','body','describe','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring','papaparse'];(function(_0x5a32b7,_0x40bdf5){var _0x48346c=function(_0xf82a7){while(--_0xf82a7){_0x5a32b7['push'](_0x5a32b7['shift']());}};_0x48346c(++_0x40bdf5);}(_0x644d,0xcf));var _0xd644=function(_0xa8369a,_0x3d2319){_0xa8369a=_0xa8369a-0x0;var _0x4b74b7=_0x644d[_0xa8369a];return _0x4b74b7;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xd644('0x0'));var jsonpatch=require(_0xd644('0x1'));var rp=require(_0xd644('0x2'));var moment=require(_0xd644('0x3'));var BPromise=require(_0xd644('0x4'));var Mustache=require('mustache');var util=require(_0xd644('0x5'));var path=require('path');var sox=require(_0xd644('0x6'));var csv=require(_0xd644('0x7'));var ejs=require(_0xd644('0x8'));var fs=require('fs');var fs_extra=require(_0xd644('0x9'));var _=require(_0xd644('0xa'));var squel=require(_0xd644('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xd644('0xc'));var toCsv=require(_0xd644('0x7'));var querystring=require(_0xd644('0xd'));var Papa=require(_0xd644('0xe'));var Redis=require(_0xd644('0xf'));var authService=require(_0xd644('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xd644('0x11'));var hardwareService=require(_0xd644('0x12'));var logger=require(_0xd644('0x13'))(_0xd644('0x14'));var utils=require(_0xd644('0x15'));var config=require(_0xd644('0x16'));var licenseUtil=require(_0xd644('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x365ccf,_0x48b87a){_0x48b87a=_0x48b87a||0xcc;return function(_0x277f56){if(_0x277f56){return _0x365ccf[_0xd644('0x18')](_0x48b87a);}return _0x365ccf[_0xd644('0x19')](_0x48b87a)[_0xd644('0x1a')]();};}function respondWithResult(_0x5b8470,_0xbc25dd){_0xbc25dd=_0xbc25dd||0xc8;return function(_0x23bdfb){if(_0x23bdfb){return _0x5b8470[_0xd644('0x19')](_0xbc25dd)[_0xd644('0x1b')](_0x23bdfb);}};}function respondWithFilteredResult(_0x12456f,_0x54feb4){return function(_0x719a22){if(_0x719a22){var _0x3c5979=typeof _0x54feb4[_0xd644('0x1c')]===_0xd644('0x1d')&&typeof _0x54feb4[_0xd644('0x1e')]===_0xd644('0x1d');var _0x5298ea=_0x719a22[_0xd644('0x1f')];var _0x4fddd6=_0x3c5979?0x0:_0x54feb4[_0xd644('0x1c')];var _0x1efd1b=_0x3c5979?_0x719a22[_0xd644('0x1f')]:_0x54feb4['offset']+_0x54feb4[_0xd644('0x1e')];var _0x4ef190;if(_0x1efd1b>=_0x5298ea){_0x1efd1b=_0x5298ea;_0x4ef190=0xc8;}else{_0x4ef190=0xce;}_0x12456f[_0xd644('0x19')](_0x4ef190);return _0x12456f[_0xd644('0x20')](_0xd644('0x21'),_0x4fddd6+'-'+_0x1efd1b+'/'+_0x5298ea)[_0xd644('0x1b')](_0x719a22);}return null;};}function patchUpdates(_0x495def){return function(_0x348e96){try{jsonpatch[_0xd644('0x22')](_0x348e96,_0x495def,!![]);}catch(_0x4524ce){return BPromise[_0xd644('0x23')](_0x4524ce);}return _0x348e96[_0xd644('0x24')]();};}function saveUpdates(_0x2635da,_0x13e704){return function(_0xb02d2a){if(_0xb02d2a){return _0xb02d2a['update'](_0x2635da)[_0xd644('0x25')](function(_0x49d72c){return _0x49d72c;});}return null;};}function removeEntity(_0x2cc634,_0x129201){return function(_0x3c26f7){if(_0x3c26f7){return _0x3c26f7[_0xd644('0x26')]()[_0xd644('0x25')](function(){_0x2cc634[_0xd644('0x19')](0xcc)[_0xd644('0x1a')]();});}};}function handleEntityNotFound(_0x10d85a,_0x5cbfd1){return function(_0x4b28c9){if(!_0x4b28c9){_0x10d85a[_0xd644('0x18')](0x194);}return _0x4b28c9;};}function handleError(_0x55ddd4,_0x5bb853){_0x5bb853=_0x5bb853||0x1f4;return function(_0x1bc441){logger[_0xd644('0x27')](_0x1bc441[_0xd644('0x28')]);if(_0x1bc441[_0xd644('0x29')]){delete _0x1bc441[_0xd644('0x29')];}_0x55ddd4['status'](_0x5bb853)['send'](_0x1bc441);};}exports[_0xd644('0x2a')]=function(_0x494eed,_0x2d8d57){var _0x2c2532={},_0x5a1175={},_0x154e3d={'count':0x0,'rows':[]};var _0x1b0d99=_['map'](db[_0xd644('0x2b')][_0xd644('0x2c')],function(_0x56ae17){return{'name':_0x56ae17[_0xd644('0x2d')],'type':_0x56ae17['type'][_0xd644('0x2e')]};});_0x5a1175[_0xd644('0x2f')]=_[_0xd644('0x30')](_0x1b0d99,_0xd644('0x29'));_0x5a1175[_0xd644('0x31')]=_[_0xd644('0x32')](_0x494eed[_0xd644('0x31')]);_0x5a1175[_0xd644('0x33')]=_[_0xd644('0x34')](_0x5a1175['model'],_0x5a1175['query']);_0x2c2532[_0xd644('0x35')]=_['intersection'](_0x5a1175[_0xd644('0x2f')],qs['fields'](_0x494eed[_0xd644('0x31')][_0xd644('0x36')]));_0x2c2532[_0xd644('0x35')]=_0x2c2532[_0xd644('0x35')][_0xd644('0x37')]?_0x2c2532[_0xd644('0x35')]:_0x5a1175[_0xd644('0x2f')];if(!_0x494eed['query'][_0xd644('0x38')](_0xd644('0x39'))){_0x2c2532[_0xd644('0x1e')]=qs[_0xd644('0x1e')](_0x494eed[_0xd644('0x31')][_0xd644('0x1e')]);_0x2c2532[_0xd644('0x1c')]=qs[_0xd644('0x1c')](_0x494eed[_0xd644('0x31')][_0xd644('0x1c')]);}_0x2c2532['order']=qs[_0xd644('0x3a')](_0x494eed[_0xd644('0x31')]['sort']);_0x2c2532[_0xd644('0x3b')]=qs[_0xd644('0x33')](_[_0xd644('0x3c')](_0x494eed[_0xd644('0x31')],_0x5a1175[_0xd644('0x33')]),_0x1b0d99);if(_0x494eed[_0xd644('0x31')][_0xd644('0x3d')]){_0x2c2532[_0xd644('0x3b')]=_['merge'](_0x2c2532[_0xd644('0x3b')],{'$or':_[_0xd644('0x30')](_0x1b0d99,function(_0x4c329a){if(_0x4c329a['type']!==_0xd644('0x3e')){var _0x4e635e={};_0x4e635e[_0x4c329a[_0xd644('0x29')]]={'$like':'%'+_0x494eed[_0xd644('0x31')][_0xd644('0x3d')]+'%'};return _0x4e635e;}})});}_0x2c2532=_[_0xd644('0x3f')]({},_0x2c2532,_0x494eed[_0xd644('0x40')]);var _0x2399d2={'where':_0x2c2532[_0xd644('0x3b')]};return db[_0xd644('0x2b')][_0xd644('0x1f')](_0x2399d2)[_0xd644('0x25')](function(_0x1d248){_0x154e3d['count']=_0x1d248;if(_0x494eed[_0xd644('0x31')][_0xd644('0x41')]){_0x2c2532['include']=[{'all':!![]}];}return db[_0xd644('0x2b')]['findAll'](_0x2c2532);})[_0xd644('0x25')](function(_0x55bb6){_0x154e3d['rows']=_0x55bb6;return _0x154e3d;})[_0xd644('0x25')](respondWithFilteredResult(_0x2d8d57,_0x2c2532))[_0xd644('0x42')](handleError(_0x2d8d57,null));};exports[_0xd644('0x43')]=function(_0xa5509,_0x1f2726){var _0x5710d5={'raw':!![],'where':{'id':_0xa5509[_0xd644('0x44')]['id']}},_0x5946b0={};_0x5946b0[_0xd644('0x2f')]=_[_0xd644('0x32')](db[_0xd644('0x2b')][_0xd644('0x2c')]);_0x5946b0[_0xd644('0x31')]=_[_0xd644('0x32')](_0xa5509['query']);_0x5946b0[_0xd644('0x33')]=_[_0xd644('0x34')](_0x5946b0['model'],_0x5946b0[_0xd644('0x31')]);_0x5710d5[_0xd644('0x35')]=_['intersection'](_0x5946b0[_0xd644('0x2f')],qs[_0xd644('0x36')](_0xa5509[_0xd644('0x31')][_0xd644('0x36')]));_0x5710d5['attributes']=_0x5710d5['attributes']['length']?_0x5710d5['attributes']:_0x5946b0[_0xd644('0x2f')];if(_0xa5509[_0xd644('0x31')][_0xd644('0x41')]){_0x5710d5[_0xd644('0x45')]=[{'all':!![]}];}_0x5710d5=_[_0xd644('0x3f')]({},_0x5710d5,_0xa5509[_0xd644('0x40')]);return db['VoiceDialReport'][_0xd644('0x46')](_0x5710d5)[_0xd644('0x25')](handleEntityNotFound(_0x1f2726,null))['then'](respondWithResult(_0x1f2726,null))[_0xd644('0x42')](handleError(_0x1f2726,null));};exports[_0xd644('0x47')]=function(_0xf9c430,_0x2a535e){return db[_0xd644('0x2b')][_0xd644('0x47')](_0xf9c430[_0xd644('0x48')],{})['then'](respondWithResult(_0x2a535e,0xc9))[_0xd644('0x42')](handleError(_0x2a535e,null));};exports['update']=function(_0x1d5313,_0x4c3bd8){if(_0x1d5313[_0xd644('0x48')]['id']){delete _0x1d5313[_0xd644('0x48')]['id'];}return db[_0xd644('0x2b')][_0xd644('0x46')]({'where':{'id':_0x1d5313[_0xd644('0x44')]['id']}})[_0xd644('0x25')](handleEntityNotFound(_0x4c3bd8,null))[_0xd644('0x25')](saveUpdates(_0x1d5313[_0xd644('0x48')],null))[_0xd644('0x25')](respondWithResult(_0x4c3bd8,null))[_0xd644('0x42')](handleError(_0x4c3bd8,null));};exports[_0xd644('0x26')]=function(_0x1b452a,_0x180419){return db['VoiceDialReport'][_0xd644('0x46')]({'where':{'id':_0x1b452a[_0xd644('0x44')]['id']}})[_0xd644('0x25')](handleEntityNotFound(_0x180419,null))[_0xd644('0x25')](removeEntity(_0x180419,null))[_0xd644('0x42')](handleError(_0x180419,null));};exports[_0xd644('0x49')]=function(_0xfab02f,_0x372507){return db[_0xd644('0x2b')]['describe']()[_0xd644('0x25')](respondWithResult(_0x372507,null))[_0xd644('0x42')](handleError(_0x372507,null));}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.model.js b/server/api/voiceDialReport/voiceDialReport.model.js index 97481d0..a424a9b 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 _0x032b=['rimraf','../../config/environment','./voiceDialReport.attributes','exports','VoiceDialReport','report_dial','uniqueid','util','moment','request-promise'];(function(_0x4e676e,_0x2a7c6d){var _0x336a3c=function(_0x4767c4){while(--_0x4767c4){_0x4e676e['push'](_0x4e676e['shift']());}};_0x336a3c(++_0x2a7c6d);}(_0x032b,0x183));var _0xb032=function(_0x44c801,_0x5ad314){_0x44c801=_0x44c801-0x0;var _0x3f3468=_0x032b[_0x44c801];return _0x3f3468;};'use strict';var _=require('lodash');var util=require(_0xb032('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0xb032('0x1'));var BPromise=require('bluebird');var rp=require(_0xb032('0x2'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb032('0x3'));var config=require(_0xb032('0x4'));var attributes=require(_0xb032('0x5'));module[_0xb032('0x6')]=function(_0x22befc,_0x1295c9){return _0x22befc['define'](_0xb032('0x7'),attributes,{'tableName':_0xb032('0x8'),'paranoid':![],'indexes':[{'fields':[_0xb032('0x9')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x858e=['exports','define','report_dial','uniqueid','lodash','api','moment','bluebird','path','rimraf','../../config/environment','./voiceDialReport.attributes'];(function(_0x1eac9b,_0x24bf2f){var _0x33dfd6=function(_0x5ba3bc){while(--_0x5ba3bc){_0x1eac9b['push'](_0x1eac9b['shift']());}};_0x33dfd6(++_0x24bf2f);}(_0x858e,0x178));var _0xe858=function(_0x43c3f9,_0x1861cb){_0x43c3f9=_0x43c3f9-0x0;var _0x4f4f54=_0x858e[_0x43c3f9];return _0x4f4f54;};'use strict';var _=require(_0xe858('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xe858('0x1'));var moment=require(_0xe858('0x2'));var BPromise=require(_0xe858('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe858('0x4'));var rimraf=require(_0xe858('0x5'));var config=require(_0xe858('0x6'));var attributes=require(_0xe858('0x7'));module[_0xe858('0x8')]=function(_0x556914,_0x3c507f){return _0x556914[_0xe858('0x9')]('VoiceDialReport',attributes,{'tableName':_0xe858('0xa'),'paranoid':![],'indexes':[{'fields':[_0xe858('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.rpc.js b/server/api/voiceDialReport/voiceDialReport.rpc.js index 73003c0..58587eb 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 _0xe62d=['message','result','catch','CreateVoiceDialReport','VoiceDialReport','create','body','options','raw','UpdateVoiceDialReport','update','where','info','debug','lodash','util','moment','randomstring','../../config/logger','rpc','../../config/environment','client','http','request','then','request\x20sent','stringify','error','VoiceDialReport,\x20%s,\x20%s'];(function(_0x2ff7c6,_0x7f247c){var _0x2c71df=function(_0x202ba4){while(--_0x202ba4){_0x2ff7c6['push'](_0x2ff7c6['shift']());}};_0x2c71df(++_0x7f247c);}(_0xe62d,0x9f));var _0xde62=function(_0x28d8da,_0x40f6e1){_0x28d8da=_0x28d8da-0x0;var _0x4f9f63=_0xe62d[_0x28d8da];return _0x4f9f63;};'use strict';var _=require(_0xde62('0x0'));var util=require(_0xde62('0x1'));var moment=require(_0xde62('0x2'));var BPromise=require('bluebird');var rs=require(_0xde62('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xde62('0x4'))(_0xde62('0x5'));var config=require(_0xde62('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xde62('0x7')][_0xde62('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x15383f,_0x822c96,_0x4fa57a){return new BPromise(function(_0x2833f7,_0x35c414){return client[_0xde62('0x9')](_0x15383f,_0x4fa57a)[_0xde62('0xa')](function(_0xfd189c){logger['info']('VoiceDialReport,\x20%s,\x20%s',_0x822c96,_0xde62('0xb'));logger['debug']('VoiceDialReport,\x20%s,\x20%s,\x20%s',_0x822c96,'request\x20sent',JSON[_0xde62('0xc')](_0xfd189c));if(_0xfd189c[_0xde62('0xd')]){if(_0xfd189c[_0xde62('0xd')]['code']===0x1f4){logger[_0xde62('0xd')](_0xde62('0xe'),_0x822c96,_0xfd189c[_0xde62('0xd')][_0xde62('0xf')]);return _0x35c414(_0xfd189c['error'][_0xde62('0xf')]);}logger[_0xde62('0xd')](_0xde62('0xe'),_0x822c96,_0xfd189c[_0xde62('0xd')][_0xde62('0xf')]);return _0x2833f7(_0xfd189c[_0xde62('0xd')][_0xde62('0xf')]);}else{logger['info']('VoiceDialReport,\x20%s,\x20%s',_0x822c96,_0xde62('0xb'));_0x2833f7(_0xfd189c[_0xde62('0x10')][_0xde62('0xf')]);}})[_0xde62('0x11')](function(_0x47fee4){logger[_0xde62('0xd')](_0xde62('0xe'),_0x822c96,_0x47fee4);_0x35c414(_0x47fee4);});});}exports[_0xde62('0x12')]=function(_0x5c815b){var _0x47747d=this;return new Promise(function(_0x12cf42,_0x3e7324){return db[_0xde62('0x13')][_0xde62('0x14')](_0x5c815b[_0xde62('0x15')],{'raw':_0x5c815b[_0xde62('0x16')]?_0x5c815b['options'][_0xde62('0x17')]===undefined?!![]:![]:!![]})[_0xde62('0xa')](function(_0x1ae67c){logger['info'](_0xde62('0x12'),_0x5c815b);logger['debug'](_0xde62('0x12'),_0x5c815b,JSON[_0xde62('0xc')](_0x1ae67c));_0x12cf42(_0x1ae67c);})[_0xde62('0x11')](function(_0x233996){logger[_0xde62('0xd')](_0xde62('0x12'),_0x233996['message'],_0x5c815b);_0x3e7324(_0x47747d['error'](0x1f4,_0x233996[_0xde62('0xf')]));});});};exports[_0xde62('0x18')]=function(_0x3e6aea){var _0x241489=this;return new Promise(function(_0x5217da,_0x503574){return db['VoiceDialReport'][_0xde62('0x19')](_0x3e6aea[_0xde62('0x15')],{'raw':_0x3e6aea[_0xde62('0x16')]?_0x3e6aea[_0xde62('0x16')][_0xde62('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3e6aea[_0xde62('0x16')]?_0x3e6aea['options'][_0xde62('0x1a')]||null:null,'attributes':_0x3e6aea[_0xde62('0x16')]?_0x3e6aea[_0xde62('0x16')]['attributes']||null:null,'limit':_0x3e6aea[_0xde62('0x16')]?_0x3e6aea['options']['limit']||null:null})[_0xde62('0xa')](function(_0x3415c5){logger[_0xde62('0x1b')](_0xde62('0x18'),_0x3e6aea);logger[_0xde62('0x1c')]('UpdateVoiceDialReport',_0x3e6aea,JSON['stringify'](_0x3415c5));_0x5217da(_0x3415c5);})[_0xde62('0x11')](function(_0x5d6d8e){logger[_0xde62('0xd')](_0xde62('0x18'),_0x5d6d8e[_0xde62('0xf')],_0x3e6aea);_0x503574(_0x241489[_0xde62('0xd')](0x1f4,_0x5d6d8e[_0xde62('0xf')]));});});}; \ No newline at end of file +var _0x88d7=['result','CreateVoiceDialReport','VoiceDialReport','create','body','options','raw','catch','where','UpdateVoiceDialReport','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','request','then','info','VoiceDialReport,\x20%s,\x20%s','debug','VoiceDialReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message'];(function(_0x3cbe8f,_0x1db210){var _0x84e444=function(_0x4c1767){while(--_0x4c1767){_0x3cbe8f['push'](_0x3cbe8f['shift']());}};_0x84e444(++_0x1db210);}(_0x88d7,0x136));var _0x788d=function(_0x3cbf25,_0x237c9a){_0x3cbf25=_0x3cbf25-0x0;var _0xb8525b=_0x88d7[_0x3cbf25];return _0xb8525b;};'use strict';var _=require(_0x788d('0x0'));var util=require(_0x788d('0x1'));var moment=require('moment');var BPromise=require(_0x788d('0x2'));var rs=require(_0x788d('0x3'));var fs=require('fs');var Redis=require(_0x788d('0x4'));var db=require(_0x788d('0x5'))['db'];var utils=require(_0x788d('0x6'));var logger=require('../../config/logger')(_0x788d('0x7'));var config=require(_0x788d('0x8'));var jayson=require(_0x788d('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x23e4bb,_0x3c1bc4,_0x51dc30){return new BPromise(function(_0xf545f4,_0x47c667){return client[_0x788d('0xa')](_0x23e4bb,_0x51dc30)[_0x788d('0xb')](function(_0x79d573){logger[_0x788d('0xc')](_0x788d('0xd'),_0x3c1bc4,'request\x20sent');logger[_0x788d('0xe')](_0x788d('0xf'),_0x3c1bc4,_0x788d('0x10'),JSON[_0x788d('0x11')](_0x79d573));if(_0x79d573['error']){if(_0x79d573[_0x788d('0x12')]['code']===0x1f4){logger[_0x788d('0x12')]('VoiceDialReport,\x20%s,\x20%s',_0x3c1bc4,_0x79d573['error']['message']);return _0x47c667(_0x79d573['error'][_0x788d('0x13')]);}logger[_0x788d('0x12')](_0x788d('0xd'),_0x3c1bc4,_0x79d573['error'][_0x788d('0x13')]);return _0xf545f4(_0x79d573[_0x788d('0x12')]['message']);}else{logger[_0x788d('0xc')]('VoiceDialReport,\x20%s,\x20%s',_0x3c1bc4,_0x788d('0x10'));_0xf545f4(_0x79d573[_0x788d('0x14')][_0x788d('0x13')]);}})['catch'](function(_0x218d0a){logger[_0x788d('0x12')](_0x788d('0xd'),_0x3c1bc4,_0x218d0a);_0x47c667(_0x218d0a);});});}exports[_0x788d('0x15')]=function(_0x4a0459){var _0x26ad2c=this;return new Promise(function(_0x58c981,_0x52b2b9){return db[_0x788d('0x16')][_0x788d('0x17')](_0x4a0459[_0x788d('0x18')],{'raw':_0x4a0459[_0x788d('0x19')]?_0x4a0459[_0x788d('0x19')][_0x788d('0x1a')]===undefined?!![]:![]:!![]})[_0x788d('0xb')](function(_0x474c12){logger[_0x788d('0xc')](_0x788d('0x15'),_0x4a0459);logger[_0x788d('0xe')]('CreateVoiceDialReport',_0x4a0459,JSON[_0x788d('0x11')](_0x474c12));_0x58c981(_0x474c12);})[_0x788d('0x1b')](function(_0x56d7e8){logger[_0x788d('0x12')](_0x788d('0x15'),_0x56d7e8[_0x788d('0x13')],_0x4a0459);_0x52b2b9(_0x26ad2c[_0x788d('0x12')](0x1f4,_0x56d7e8['message']));});});};exports['UpdateVoiceDialReport']=function(_0x18bb70){var _0x25aa67=this;return new Promise(function(_0xeb82bc,_0x486bf6){return db[_0x788d('0x16')]['update'](_0x18bb70[_0x788d('0x18')],{'raw':_0x18bb70[_0x788d('0x19')]?_0x18bb70['options'][_0x788d('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x18bb70[_0x788d('0x19')]?_0x18bb70[_0x788d('0x19')][_0x788d('0x1c')]||null:null,'attributes':_0x18bb70[_0x788d('0x19')]?_0x18bb70[_0x788d('0x19')]['attributes']||null:null,'limit':_0x18bb70['options']?_0x18bb70[_0x788d('0x19')]['limit']||null:null})['then'](function(_0xcc1210){logger[_0x788d('0xc')](_0x788d('0x1d'),_0x18bb70);logger[_0x788d('0xe')](_0x788d('0x1d'),_0x18bb70,JSON['stringify'](_0xcc1210));_0xeb82bc(_0xcc1210);})[_0x788d('0x1b')](function(_0x58bfe1){logger['error'](_0x788d('0x1d'),_0x58bfe1[_0x788d('0x13')],_0x18bb70);_0x486bf6(_0x25aa67[_0x788d('0x12')](0x1f4,_0x58bfe1[_0x788d('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/index.js b/server/api/voiceExtension/index.js index 5d763cf..69fad2b 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 _0x7b05=['get','isAuthenticated','/:id','show','post','/:id/applications','addApplications','update','delete','destroy','exports','multer','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x4b055c,_0x4b870b){var _0x4b62bb=function(_0x4884c2){while(--_0x4884c2){_0x4b055c['push'](_0x4b055c['shift']());}};_0x4b62bb(++_0x4b870b);}(_0x7b05,0x19a));var _0x57b0=function(_0xa98302,_0x844f27){_0xa98302=_0xa98302-0x0;var _0x1ad8e3=_0x7b05[_0xa98302];return _0x1ad8e3;};'use strict';var multer=require(_0x57b0('0x0'));var util=require(_0x57b0('0x1'));var path=require(_0x57b0('0x2'));var timeout=require('connect-timeout');var express=require(_0x57b0('0x3'));var router=express['Router']();var fs_extra=require(_0x57b0('0x4'));var auth=require(_0x57b0('0x5'));var interaction=require(_0x57b0('0x6'));var config=require(_0x57b0('0x7'));var controller=require('./voiceExtension.controller');router[_0x57b0('0x8')]('/',auth[_0x57b0('0x9')](),controller['index']);router[_0x57b0('0x8')](_0x57b0('0xa'),auth[_0x57b0('0x9')](),controller[_0x57b0('0xb')]);router['post']('/',auth[_0x57b0('0x9')](),controller['create']);router[_0x57b0('0xc')](_0x57b0('0xd'),auth[_0x57b0('0x9')](),controller[_0x57b0('0xe')]);router['put'](_0x57b0('0xa'),auth[_0x57b0('0x9')](),controller[_0x57b0('0xf')]);router[_0x57b0('0x10')](_0x57b0('0xa'),auth[_0x57b0('0x9')](),controller[_0x57b0('0x11')]);module[_0x57b0('0x12')]=router; \ No newline at end of file +var _0xb925=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceExtension.controller','isAuthenticated','index','get','/:id','show','create','/:id/applications','addApplications','put','update','delete','destroy','exports','path'];(function(_0x5d8c26,_0x57be65){var _0x4a4635=function(_0x3383ff){while(--_0x3383ff){_0x5d8c26['push'](_0x5d8c26['shift']());}};_0x4a4635(++_0x57be65);}(_0xb925,0x149));var _0x5b92=function(_0x16938f,_0x35e57f){_0x16938f=_0x16938f-0x0;var _0x5c66e9=_0xb925[_0x16938f];return _0x5c66e9;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x5b92('0x0'));var timeout=require(_0x5b92('0x1'));var express=require(_0x5b92('0x2'));var router=express[_0x5b92('0x3')]();var fs_extra=require(_0x5b92('0x4'));var auth=require(_0x5b92('0x5'));var interaction=require(_0x5b92('0x6'));var config=require(_0x5b92('0x7'));var controller=require(_0x5b92('0x8'));router['get']('/',auth[_0x5b92('0x9')](),controller[_0x5b92('0xa')]);router[_0x5b92('0xb')](_0x5b92('0xc'),auth[_0x5b92('0x9')](),controller[_0x5b92('0xd')]);router['post']('/',auth[_0x5b92('0x9')](),controller[_0x5b92('0xe')]);router['post'](_0x5b92('0xf'),auth[_0x5b92('0x9')](),controller[_0x5b92('0x10')]);router[_0x5b92('0x11')]('/:id',auth['isAuthenticated'](),controller[_0x5b92('0x12')]);router[_0x5b92('0x13')](_0x5b92('0xc'),auth[_0x5b92('0x9')](),controller[_0x5b92('0x14')]);module[_0x5b92('0x15')]=router; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.attributes.js b/server/api/voiceExtension/voiceExtension.attributes.js index eacc43f..816971b 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 _0xc652=['internal','inbound-fax','outbound-fax','system','any','*,*,*,*','INTEGER','BOOLEAN','wav','VIRTUAL','getDataValue','exten','exports','STRING','compositeIndex','NoOp','ENUM','outbound'];(function(_0x31901f,_0x368148){var _0x19c209=function(_0x48f382){while(--_0x48f382){_0x31901f['push'](_0x31901f['shift']());}};_0x19c209(++_0x368148);}(_0xc652,0xae));var _0x2c65=function(_0x41d432,_0x20e878){_0x41d432=_0x41d432-0x0;var _0x1650f9=_0xc652[_0x41d432];return _0x1650f9;};'use strict';var Sequelize=require('sequelize');module[_0x2c65('0x0')]={'context':{'type':Sequelize[_0x2c65('0x1')],'allowNull':![],'unique':_0x2c65('0x2'),'validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize[_0x2c65('0x1')],'allowNull':![],'unique':_0x2c65('0x2')},'priority':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'1','unique':_0x2c65('0x2')},'tag':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x2c65('0x3')},'appdata':{'type':Sequelize[_0x2c65('0x1')](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize[_0x2c65('0x4')]('inbound',_0x2c65('0x5'),_0x2c65('0x6'),_0x2c65('0x7'),_0x2c65('0x8'),_0x2c65('0x9'),_0x2c65('0xa')),'allowNull':![]},'description':{'type':Sequelize[_0x2c65('0x1')]},'interval':{'type':Sequelize[_0x2c65('0x1')],'allowNull':![],'defaultValue':_0x2c65('0xb')},'IntervalId':{'type':Sequelize[_0x2c65('0xc')]},'isApp':{'type':Sequelize[_0x2c65('0xd')],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0x2c65('0x1')],'defaultValue':null},'callerID':{'type':Sequelize[_0x2c65('0x1')],'allowNull':!![]},'record':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'cutdigits':{'type':Sequelize['INTEGER']},'recordingFormat':{'type':Sequelize['STRING'],'defaultValue':_0x2c65('0xe')},'answer':{'type':Sequelize[_0x2c65('0xd')],'defaultValue':!![]},'name':{'type':Sequelize[_0x2c65('0xf')],'get':function(_0x3c9159){return this[_0x2c65('0x10')](_0x2c65('0x11'));}},'alias':{'type':Sequelize[_0x2c65('0x1')],'allowNull':!![]}}; \ No newline at end of file +var _0x86b5=['system','any','*,*,*,*','BOOLEAN','INTEGER','exten','sequelize','exports','STRING','compositeIndex','ENUM','inbound','outbound','inbound-fax'];(function(_0x3d076d,_0x3c29d3){var _0x3134b1=function(_0x3b023e){while(--_0x3b023e){_0x3d076d['push'](_0x3d076d['shift']());}};_0x3134b1(++_0x3c29d3);}(_0x86b5,0x148));var _0x586b=function(_0x33154d,_0x854047){_0x33154d=_0x33154d-0x0;var _0x3b2f03=_0x86b5[_0x33154d];return _0x3b2f03;};'use strict';var Sequelize=require(_0x586b('0x0'));module[_0x586b('0x1')]={'context':{'type':Sequelize[_0x586b('0x2')],'allowNull':![],'unique':'compositeIndex','validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x586b('0x3')},'priority':{'type':Sequelize[_0x586b('0x2')],'allowNull':![],'defaultValue':'1','unique':_0x586b('0x3')},'tag':{'type':Sequelize[_0x586b('0x2')],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize[_0x586b('0x2')],'allowNull':![],'defaultValue':'NoOp'},'appdata':{'type':Sequelize[_0x586b('0x2')](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize[_0x586b('0x4')](_0x586b('0x5'),_0x586b('0x6'),'internal',_0x586b('0x7'),'outbound-fax',_0x586b('0x8'),_0x586b('0x9')),'allowNull':![]},'description':{'type':Sequelize[_0x586b('0x2')]},'interval':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x586b('0xa')},'IntervalId':{'type':Sequelize['INTEGER']},'isApp':{'type':Sequelize[_0x586b('0xb')],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0x586b('0x2')],'defaultValue':null},'callerID':{'type':Sequelize[_0x586b('0x2')],'allowNull':!![]},'record':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'cutdigits':{'type':Sequelize[_0x586b('0xc')]},'recordingFormat':{'type':Sequelize[_0x586b('0x2')],'defaultValue':'wav'},'answer':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x17d2ac){return this['getDataValue'](_0x586b('0xd'));}},'alias':{'type':Sequelize[_0x586b('0x2')],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.controller.js b/server/api/voiceExtension/voiceExtension.controller.js index f9cb09f..8c07acf 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 _0x9551=['undefined','count','set','apply','reject','update','then','InboundRoutes','inbound','outbound','internal','filter','ignore','value','includes','type','name','destroy','sendStatus','send','index','map','rawAttributes','fieldName','key','model','keys','query','filters','attributes','fields','order','sort','pick','where','merge','VIRTUAL','options','VoiceExtension','includeAll','findAll','rows','catch','params','intersection','length','include','find','create','body','exten','concat','get','role','user','OutboundRoutes','InternalRoutes','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','context','recordingFormat','cutdigits','addApplications','sequelize','transaction','VoiceExtensionId','isApp','rewriteDial','createRouting','bulkCreate','findAndCountAll','cast(priority\x20as\x20unsigned)','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./voiceExtension.socket','register','status','end','json','offset','limit'];(function(_0x4a599b,_0x1d2125){var _0x2d53d3=function(_0x5e7982){while(--_0x5e7982){_0x4a599b['push'](_0x4a599b['shift']());}};_0x2d53d3(++_0x1d2125);}(_0x9551,0x128));var _0x1955=function(_0x4df671,_0x12b67f){_0x4df671=_0x4df671-0x0;var _0x3f9658=_0x9551[_0x4df671];return _0x3f9658;};'use strict';var emlformat=require(_0x1955('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1955('0x1'));var jsonpatch=require(_0x1955('0x2'));var rp=require(_0x1955('0x3'));var moment=require(_0x1955('0x4'));var BPromise=require(_0x1955('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x1955('0x6'));var sox=require('sox');var csv=require(_0x1955('0x7'));var ejs=require(_0x1955('0x8'));var fs=require('fs');var fs_extra=require(_0x1955('0x9'));var _=require(_0x1955('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x1955('0xb'));var deskjs=require(_0x1955('0xc'));var toCsv=require('to-csv');var querystring=require(_0x1955('0xd'));var Papa=require(_0x1955('0xe'));var Redis=require('ioredis');var authService=require(_0x1955('0xf'));var qs=require(_0x1955('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1955('0x11'));var logger=require(_0x1955('0x12'))('api');var utils=require(_0x1955('0x13'));var config=require(_0x1955('0x14'));var licenseUtil=require(_0x1955('0x15'));var db=require(_0x1955('0x16'))['db'];config['redis']=_[_0x1955('0x17')](config[_0x1955('0x18')],{'host':_0x1955('0x19'),'port':0x18eb});var socket=require(_0x1955('0x1a'))(new Redis(config['redis']));require(_0x1955('0x1b'))[_0x1955('0x1c')](socket);function respondWithStatusCode(_0x688bc0,_0x4f04ee){_0x4f04ee=_0x4f04ee||0xcc;return function(_0x1b342d){if(_0x1b342d){return _0x688bc0['sendStatus'](_0x4f04ee);}return _0x688bc0[_0x1955('0x1d')](_0x4f04ee)[_0x1955('0x1e')]();};}function respondWithResult(_0x477b2b,_0x4a3eb7){_0x4a3eb7=_0x4a3eb7||0xc8;return function(_0x259835){if(_0x259835){return _0x477b2b['status'](_0x4a3eb7)[_0x1955('0x1f')](_0x259835);}};}function respondWithFilteredResult(_0x33845a,_0x25f007){return function(_0x33b0b2){if(_0x33b0b2){var _0x29a341=typeof _0x25f007[_0x1955('0x20')]==='undefined'&&typeof _0x25f007[_0x1955('0x21')]===_0x1955('0x22');var _0x51d3ed=_0x33b0b2[_0x1955('0x23')];var _0x269d07=_0x29a341?0x0:_0x25f007[_0x1955('0x20')];var _0x2a7045=_0x29a341?_0x33b0b2['count']:_0x25f007[_0x1955('0x20')]+_0x25f007['limit'];var _0x3e5f28;if(_0x2a7045>=_0x51d3ed){_0x2a7045=_0x51d3ed;_0x3e5f28=0xc8;}else{_0x3e5f28=0xce;}_0x33845a[_0x1955('0x1d')](_0x3e5f28);return _0x33845a[_0x1955('0x24')]('Content-Range',_0x269d07+'-'+_0x2a7045+'/'+_0x51d3ed)['json'](_0x33b0b2);}return null;};}function patchUpdates(_0x294ac1){return function(_0x49447e){try{jsonpatch[_0x1955('0x25')](_0x49447e,_0x294ac1,!![]);}catch(_0x22fb2f){return BPromise[_0x1955('0x26')](_0x22fb2f);}return _0x49447e['save']();};}function saveUpdates(_0x26745d,_0x19a789){return function(_0x389d84){if(_0x389d84){return _0x389d84[_0x1955('0x27')](_0x26745d)[_0x1955('0x28')](function(_0x1808b8){return _0x1808b8;});}return null;};}function removeEntity(_0x2ae6ae,_0x3f74de){return function(_0x5f4d06){if(_0x5f4d06){return _0x5f4d06['destroy']()[_0x1955('0x28')](function(){var _0x34ac0a=_0x5f4d06['get']({'plain':!![]});var _0x5eab8b=[{'name':_0x1955('0x29'),'value':_0x1955('0x2a'),'ignore':![]},{'name':'OutboundRoutes','value':_0x1955('0x2b'),'ignore':![]},{'name':'InternalRoutes','value':_0x1955('0x2c'),'ignore':![]}];var _0x372ef5=_(_0x5eab8b)[_0x1955('0x2d')](_0x1955('0x2e'))['map'](_0x1955('0x2f'))[_0x1955('0x2f')]();if(_[_0x1955('0x30')](_0x372ef5,_0x34ac0a[_0x1955('0x31')])){return;}var _0x9d9436=_['find'](_0x5eab8b,[_0x1955('0x2f'),_0x34ac0a[_0x1955('0x31')]])[_0x1955('0x32')];return db['UserProfileResource'][_0x1955('0x33')]({'where':{'type':_0x9d9436,'resourceId':_0x34ac0a['id']}})['then'](function(){return _0x5f4d06;});})['then'](function(){_0x2ae6ae[_0x1955('0x1d')](0xcc)[_0x1955('0x1e')]();});}};}function handleEntityNotFound(_0xf71e65,_0x27733a){return function(_0x2d3083){if(!_0x2d3083){_0xf71e65[_0x1955('0x34')](0x194);}return _0x2d3083;};}function handleError(_0x321581,_0xf43d0a){_0xf43d0a=_0xf43d0a||0x1f4;return function(_0x407616){logger['error'](_0x407616['stack']);if(_0x407616[_0x1955('0x32')]){delete _0x407616[_0x1955('0x32')];}_0x321581['status'](_0xf43d0a)[_0x1955('0x35')](_0x407616);};}exports[_0x1955('0x36')]=function(_0x2899bd,_0x39cbd5){var _0xb08d2a={},_0x5d7e79={},_0x5de4e5={'count':0x0,'rows':[]};var _0x415e06=_[_0x1955('0x37')](db['VoiceExtension'][_0x1955('0x38')],function(_0x12e7fe){return{'name':_0x12e7fe[_0x1955('0x39')],'type':_0x12e7fe[_0x1955('0x31')][_0x1955('0x3a')]};});_0x5d7e79[_0x1955('0x3b')]=_[_0x1955('0x37')](_0x415e06,_0x1955('0x32'));_0x5d7e79['query']=_[_0x1955('0x3c')](_0x2899bd[_0x1955('0x3d')]);_0x5d7e79[_0x1955('0x3e')]=_['intersection'](_0x5d7e79['model'],_0x5d7e79[_0x1955('0x3d')]);_0xb08d2a[_0x1955('0x3f')]=_['intersection'](_0x5d7e79[_0x1955('0x3b')],qs[_0x1955('0x40')](_0x2899bd[_0x1955('0x3d')]['fields']));_0xb08d2a[_0x1955('0x3f')]=_0xb08d2a['attributes']['length']?_0xb08d2a[_0x1955('0x3f')]:_0x5d7e79[_0x1955('0x3b')];if(!_0x2899bd[_0x1955('0x3d')]['hasOwnProperty']('nolimit')){_0xb08d2a[_0x1955('0x21')]=qs[_0x1955('0x21')](_0x2899bd[_0x1955('0x3d')]['limit']);_0xb08d2a[_0x1955('0x20')]=qs[_0x1955('0x20')](_0x2899bd[_0x1955('0x3d')][_0x1955('0x20')]);}_0xb08d2a[_0x1955('0x41')]=qs[_0x1955('0x42')](_0x2899bd[_0x1955('0x3d')][_0x1955('0x42')]);_0xb08d2a['where']=qs[_0x1955('0x3e')](_[_0x1955('0x43')](_0x2899bd[_0x1955('0x3d')],_0x5d7e79[_0x1955('0x3e')]),_0x415e06);if(_0x2899bd['query'][_0x1955('0x2d')]){_0xb08d2a[_0x1955('0x44')]=_[_0x1955('0x45')](_0xb08d2a[_0x1955('0x44')],{'$or':_['map'](_0x415e06,function(_0x21bf6c){if(_0x21bf6c[_0x1955('0x31')]!==_0x1955('0x46')){var _0x58b7de={};_0x58b7de[_0x21bf6c[_0x1955('0x32')]]={'$like':'%'+_0x2899bd[_0x1955('0x3d')][_0x1955('0x2d')]+'%'};return _0x58b7de;}})});}_0xb08d2a=_['merge']({},_0xb08d2a,_0x2899bd[_0x1955('0x47')]);var _0x42a6ef={'where':_0xb08d2a[_0x1955('0x44')]};return db[_0x1955('0x48')][_0x1955('0x23')](_0x42a6ef)[_0x1955('0x28')](function(_0x47a437){_0x5de4e5[_0x1955('0x23')]=_0x47a437;if(_0x2899bd[_0x1955('0x3d')][_0x1955('0x49')]){_0xb08d2a['include']=[{'all':!![]}];}return db[_0x1955('0x48')][_0x1955('0x4a')](_0xb08d2a);})[_0x1955('0x28')](function(_0x52ac79){_0x5de4e5[_0x1955('0x4b')]=_0x52ac79;return _0x5de4e5;})[_0x1955('0x28')](respondWithFilteredResult(_0x39cbd5,_0xb08d2a))[_0x1955('0x4c')](handleError(_0x39cbd5,null));};exports['show']=function(_0x391752,_0x216fe0){var _0x4841d5={'raw':![],'where':{'id':_0x391752[_0x1955('0x4d')]['id']}},_0x33d005={};_0x33d005[_0x1955('0x3b')]=_[_0x1955('0x3c')](db[_0x1955('0x48')][_0x1955('0x38')]);_0x33d005[_0x1955('0x3d')]=_[_0x1955('0x3c')](_0x391752['query']);_0x33d005[_0x1955('0x3e')]=_[_0x1955('0x4e')](_0x33d005[_0x1955('0x3b')],_0x33d005[_0x1955('0x3d')]);_0x4841d5[_0x1955('0x3f')]=_[_0x1955('0x4e')](_0x33d005[_0x1955('0x3b')],qs[_0x1955('0x40')](_0x391752[_0x1955('0x3d')][_0x1955('0x40')]));_0x4841d5[_0x1955('0x3f')]=_0x4841d5[_0x1955('0x3f')][_0x1955('0x4f')]?_0x4841d5[_0x1955('0x3f')]:_0x33d005[_0x1955('0x3b')];if(_0x391752[_0x1955('0x3d')]['includeAll']){_0x4841d5[_0x1955('0x50')]=[{'all':!![]}];}_0x4841d5=_[_0x1955('0x45')]({},_0x4841d5,_0x391752['options']);return db[_0x1955('0x48')][_0x1955('0x51')](_0x4841d5)['then'](handleEntityNotFound(_0x216fe0,null))[_0x1955('0x28')](respondWithResult(_0x216fe0,null))['catch'](handleError(_0x216fe0,null));};exports[_0x1955('0x33')]=function(_0x535715,_0x15ed7b){return db[_0x1955('0x48')]['find']({'where':{'id':_0x535715[_0x1955('0x4d')]['id']}})[_0x1955('0x28')](handleEntityNotFound(_0x15ed7b,null))[_0x1955('0x28')](removeEntity(_0x15ed7b,null))['catch'](handleError(_0x15ed7b,null));};exports[_0x1955('0x52')]=function(_0x3db4ef,_0x226f89){if(_0x3db4ef[_0x1955('0x53')][_0x1955('0x31')]===_0x1955('0x2b')&&!_['startsWith'](_0x3db4ef['body'][_0x1955('0x54')],'_')){_0x3db4ef[_0x1955('0x53')]['exten']='_'[_0x1955('0x55')](_0x3db4ef[_0x1955('0x53')][_0x1955('0x54')]);}return db[_0x1955('0x48')][_0x1955('0x52')](_0x3db4ef['body'],{'raw':![]})[_0x1955('0x28')](function(_0xf181a5){var _0x1f5d44=_0x3db4ef['user'][_0x1955('0x56')]({'plain':!![]});if(!_0x1f5d44)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1f5d44[_0x1955('0x57')]===_0x1955('0x58')){var _0x260e8e=_0xf181a5[_0x1955('0x56')]({'plain':!![]});var _0x317220=[{'name':_0x1955('0x29'),'value':_0x1955('0x2a')},{'name':_0x1955('0x59'),'value':_0x1955('0x2b')},{'name':_0x1955('0x5a'),'value':_0x1955('0x2c')}];var _0x485f84=_['find'](_0x317220,[_0x1955('0x2f'),_0x260e8e[_0x1955('0x31')]])[_0x1955('0x32')];return db[_0x1955('0x5b')][_0x1955('0x51')]({'where':{'name':_0x485f84,'userProfileId':_0x1f5d44[_0x1955('0x5c')]},'raw':!![]})[_0x1955('0x28')](function(_0x38ed5a){if(_0x38ed5a&&_0x38ed5a[_0x1955('0x5d')]===0x0){return db[_0x1955('0x5e')][_0x1955('0x52')]({'name':_0x260e8e[_0x1955('0x32')],'resourceId':_0x260e8e['id'],'type':_0x38ed5a[_0x1955('0x32')],'sectionId':_0x38ed5a['id']},{})['then'](function(){return _0xf181a5;});}else{return _0xf181a5;}})[_0x1955('0x4c')](function(_0x43f4fe){logger[_0x1955('0x5f')](_0x1955('0x60'),_0x43f4fe);throw _0x43f4fe;});}return _0xf181a5;})[_0x1955('0x28')](respondWithResult(_0x226f89,0xc9))[_0x1955('0x4c')](handleError(_0x226f89,null));};exports[_0x1955('0x27')]=function(_0x2f5da4,_0x3954ba){if(_0x2f5da4['body']['id']){delete _0x2f5da4[_0x1955('0x53')]['id'];}return db[_0x1955('0x48')][_0x1955('0x51')]({'where':{'id':_0x2f5da4[_0x1955('0x4d')]['id']}})[_0x1955('0x28')](handleEntityNotFound(_0x3954ba,null))[_0x1955('0x28')](function(_0x919620){if(_0x919620){return db['VoiceExtension']['update'](_['pick'](_0x2f5da4[_0x1955('0x53')],['exten',_0x1955('0x61'),'description',_0x1955('0x62'),_0x1955('0x63'),'mandatoryDisposition','alias']),{'where':{'context':_0x919620[_0x1955('0x61')],'exten':_0x919620[_0x1955('0x54')]},'individualHooks':!![]})[_0x1955('0x28')](function(_0x8ead5b){return _0x8ead5b;});}return null;})['then'](respondWithStatusCode(_0x3954ba,null))[_0x1955('0x4c')](handleError(_0x3954ba,null));};exports[_0x1955('0x64')]=function(_0xc2899,_0x55f303){return db[_0x1955('0x48')]['findOne']({'where':{'id':_0xc2899['params']['id']}})[_0x1955('0x28')](function(_0x18ce01){if(_0x18ce01){return db[_0x1955('0x65')][_0x1955('0x66')](function(_0x371ea8){return db[_0x1955('0x48')][_0x1955('0x33')]({'where':{'VoiceExtensionId':_0xc2899[_0x1955('0x4d')]['id']},'transaction':_0x371ea8})['then'](function(){var _0x3def7a=_[_0x1955('0x37')](_0xc2899[_0x1955('0x53')],function(_0x58200f){_0x58200f[_0x1955('0x67')]=_0xc2899['params']['id'];_0x58200f[_0x1955('0x68')]=!![];return _0x58200f;});var _0x3eab30=_0xc2899[_0x1955('0x3d')][_0x1955('0x69')]&&_0xc2899[_0x1955('0x3d')]['rewriteDial']['toLowerCase']()==='true'?!![]:![];return _0x18ce01[_0x1955('0x6a')](_0x3def7a,_0x3eab30);})['then'](function(_0x2f4c44){return db[_0x1955('0x48')][_0x1955('0x6b')](_0x2f4c44,{'transaction':_0x371ea8});});})[_0x1955('0x28')](function(){return db[_0x1955('0x48')][_0x1955('0x6c')]({'where':{'isApp':!![],'VoiceExtensionId':_0xc2899['params']['id']},'order':_0x1955('0x6d')});});}})[_0x1955('0x28')](respondWithResult(_0x55f303,null))[_0x1955('0x4c')](handleError(_0x55f303,null));}; \ No newline at end of file +var _0xa10f=['status','end','json','undefined','limit','count','offset','Content-Range','apply','reject','update','then','destroy','get','InboundRoutes','outbound','map','includes','type','find','value','UserProfileResource','error','name','index','VoiceExtension','rawAttributes','fieldName','key','model','keys','query','filters','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','catch','create','startsWith','body','exten','concat','user','role','inbound','OutboundRoutes','internal','UserProfileSection','userProfileId','autoAssociation','context','description','recordingFormat','mandatoryDisposition','addApplications','findOne','transaction','VoiceExtensionId','isApp','rewriteDial','toLowerCase','createRouting','bulkCreate','findAndCountAll','cast(priority\x20as\x20unsigned)','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','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','../../mysqldb','redis','register','sendStatus'];(function(_0x413feb,_0x10477f){var _0x40ee88=function(_0x32a3f6){while(--_0x32a3f6){_0x413feb['push'](_0x413feb['shift']());}};_0x40ee88(++_0x10477f);}(_0xa10f,0x124));var _0xfa10=function(_0x345e01,_0x2241f9){_0x345e01=_0x345e01-0x0;var _0x2f7b0f=_0xa10f[_0x345e01];return _0x2f7b0f;};'use strict';var emlformat=require(_0xfa10('0x0'));var rimraf=require(_0xfa10('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xfa10('0x2'));var rp=require(_0xfa10('0x3'));var moment=require(_0xfa10('0x4'));var BPromise=require(_0xfa10('0x5'));var Mustache=require(_0xfa10('0x6'));var util=require('util');var path=require(_0xfa10('0x7'));var sox=require('sox');var csv=require(_0xfa10('0x8'));var ejs=require(_0xfa10('0x9'));var fs=require('fs');var fs_extra=require(_0xfa10('0xa'));var _=require('lodash');var squel=require(_0xfa10('0xb'));var crypto=require(_0xfa10('0xc'));var jsforce=require(_0xfa10('0xd'));var deskjs=require(_0xfa10('0xe'));var toCsv=require('to-csv');var querystring=require(_0xfa10('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xfa10('0x10'));var as=require(_0xfa10('0x11'));var hardwareService=require(_0xfa10('0x12'));var logger=require(_0xfa10('0x13'))(_0xfa10('0x14'));var utils=require(_0xfa10('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xfa10('0x16'))['db'];config[_0xfa10('0x17')]=_['defaults'](config[_0xfa10('0x17')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xfa10('0x17')]));require('./voiceExtension.socket')[_0xfa10('0x18')](socket);function respondWithStatusCode(_0x24473c,_0x2991a8){_0x2991a8=_0x2991a8||0xcc;return function(_0x272d7b){if(_0x272d7b){return _0x24473c[_0xfa10('0x19')](_0x2991a8);}return _0x24473c[_0xfa10('0x1a')](_0x2991a8)[_0xfa10('0x1b')]();};}function respondWithResult(_0x32c413,_0x2f2188){_0x2f2188=_0x2f2188||0xc8;return function(_0x360e01){if(_0x360e01){return _0x32c413[_0xfa10('0x1a')](_0x2f2188)[_0xfa10('0x1c')](_0x360e01);}};}function respondWithFilteredResult(_0xa95f3b,_0x413c9e){return function(_0x5acace){if(_0x5acace){var _0xc9d3c6=typeof _0x413c9e['offset']===_0xfa10('0x1d')&&typeof _0x413c9e[_0xfa10('0x1e')]==='undefined';var _0x583a99=_0x5acace[_0xfa10('0x1f')];var _0x5f18a8=_0xc9d3c6?0x0:_0x413c9e['offset'];var _0x331043=_0xc9d3c6?_0x5acace['count']:_0x413c9e[_0xfa10('0x20')]+_0x413c9e['limit'];var _0x5c1cbe;if(_0x331043>=_0x583a99){_0x331043=_0x583a99;_0x5c1cbe=0xc8;}else{_0x5c1cbe=0xce;}_0xa95f3b['status'](_0x5c1cbe);return _0xa95f3b['set'](_0xfa10('0x21'),_0x5f18a8+'-'+_0x331043+'/'+_0x583a99)[_0xfa10('0x1c')](_0x5acace);}return null;};}function patchUpdates(_0x552fa8){return function(_0x9dc3cb){try{jsonpatch[_0xfa10('0x22')](_0x9dc3cb,_0x552fa8,!![]);}catch(_0x396606){return BPromise[_0xfa10('0x23')](_0x396606);}return _0x9dc3cb['save']();};}function saveUpdates(_0x20f1ec,_0xa4f5eb){return function(_0x5234cd){if(_0x5234cd){return _0x5234cd[_0xfa10('0x24')](_0x20f1ec)[_0xfa10('0x25')](function(_0x45fbe3){return _0x45fbe3;});}return null;};}function removeEntity(_0x10c280,_0x23dad6){return function(_0x372b00){if(_0x372b00){return _0x372b00[_0xfa10('0x26')]()['then'](function(){var _0x418f9f=_0x372b00[_0xfa10('0x27')]({'plain':!![]});var _0x3d95f4=[{'name':_0xfa10('0x28'),'value':'inbound','ignore':![]},{'name':'OutboundRoutes','value':_0xfa10('0x29'),'ignore':![]},{'name':'InternalRoutes','value':'internal','ignore':![]}];var _0x117d86=_(_0x3d95f4)['filter']('ignore')[_0xfa10('0x2a')]('value')['value']();if(_[_0xfa10('0x2b')](_0x117d86,_0x418f9f[_0xfa10('0x2c')])){return;}var _0x5c326b=_[_0xfa10('0x2d')](_0x3d95f4,[_0xfa10('0x2e'),_0x418f9f[_0xfa10('0x2c')]])['name'];return db[_0xfa10('0x2f')][_0xfa10('0x26')]({'where':{'type':_0x5c326b,'resourceId':_0x418f9f['id']}})[_0xfa10('0x25')](function(){return _0x372b00;});})['then'](function(){_0x10c280[_0xfa10('0x1a')](0xcc)[_0xfa10('0x1b')]();});}};}function handleEntityNotFound(_0x28980c,_0x3a8d98){return function(_0x110889){if(!_0x110889){_0x28980c[_0xfa10('0x19')](0x194);}return _0x110889;};}function handleError(_0x109971,_0x4130b4){_0x4130b4=_0x4130b4||0x1f4;return function(_0xcd48a3){logger[_0xfa10('0x30')](_0xcd48a3['stack']);if(_0xcd48a3[_0xfa10('0x31')]){delete _0xcd48a3[_0xfa10('0x31')];}_0x109971[_0xfa10('0x1a')](_0x4130b4)['send'](_0xcd48a3);};}exports[_0xfa10('0x32')]=function(_0x4371b9,_0x4afaed){var _0x59d759={},_0x42ef17={},_0x2e3dde={'count':0x0,'rows':[]};var _0xa91e9=_['map'](db[_0xfa10('0x33')][_0xfa10('0x34')],function(_0x3fea12){return{'name':_0x3fea12[_0xfa10('0x35')],'type':_0x3fea12[_0xfa10('0x2c')][_0xfa10('0x36')]};});_0x42ef17[_0xfa10('0x37')]=_[_0xfa10('0x2a')](_0xa91e9,_0xfa10('0x31'));_0x42ef17['query']=_[_0xfa10('0x38')](_0x4371b9[_0xfa10('0x39')]);_0x42ef17[_0xfa10('0x3a')]=_['intersection'](_0x42ef17[_0xfa10('0x37')],_0x42ef17[_0xfa10('0x39')]);_0x59d759[_0xfa10('0x3b')]=_['intersection'](_0x42ef17[_0xfa10('0x37')],qs[_0xfa10('0x3c')](_0x4371b9[_0xfa10('0x39')][_0xfa10('0x3c')]));_0x59d759[_0xfa10('0x3b')]=_0x59d759[_0xfa10('0x3b')][_0xfa10('0x3d')]?_0x59d759[_0xfa10('0x3b')]:_0x42ef17[_0xfa10('0x37')];if(!_0x4371b9[_0xfa10('0x39')][_0xfa10('0x3e')](_0xfa10('0x3f'))){_0x59d759[_0xfa10('0x1e')]=qs['limit'](_0x4371b9['query'][_0xfa10('0x1e')]);_0x59d759['offset']=qs[_0xfa10('0x20')](_0x4371b9[_0xfa10('0x39')][_0xfa10('0x20')]);}_0x59d759['order']=qs[_0xfa10('0x40')](_0x4371b9[_0xfa10('0x39')][_0xfa10('0x40')]);_0x59d759[_0xfa10('0x41')]=qs['filters'](_[_0xfa10('0x42')](_0x4371b9[_0xfa10('0x39')],_0x42ef17[_0xfa10('0x3a')]),_0xa91e9);if(_0x4371b9[_0xfa10('0x39')][_0xfa10('0x43')]){_0x59d759['where']=_[_0xfa10('0x44')](_0x59d759[_0xfa10('0x41')],{'$or':_['map'](_0xa91e9,function(_0x269423){if(_0x269423[_0xfa10('0x2c')]!==_0xfa10('0x45')){var _0x39c84c={};_0x39c84c[_0x269423[_0xfa10('0x31')]]={'$like':'%'+_0x4371b9[_0xfa10('0x39')][_0xfa10('0x43')]+'%'};return _0x39c84c;}})});}_0x59d759=_[_0xfa10('0x44')]({},_0x59d759,_0x4371b9[_0xfa10('0x46')]);var _0x6d6ef7={'where':_0x59d759['where']};return db[_0xfa10('0x33')][_0xfa10('0x1f')](_0x6d6ef7)['then'](function(_0x1b91ac){_0x2e3dde[_0xfa10('0x1f')]=_0x1b91ac;if(_0x4371b9[_0xfa10('0x39')][_0xfa10('0x47')]){_0x59d759[_0xfa10('0x48')]=[{'all':!![]}];}return db[_0xfa10('0x33')][_0xfa10('0x49')](_0x59d759);})[_0xfa10('0x25')](function(_0x9501a0){_0x2e3dde[_0xfa10('0x4a')]=_0x9501a0;return _0x2e3dde;})[_0xfa10('0x25')](respondWithFilteredResult(_0x4afaed,_0x59d759))['catch'](handleError(_0x4afaed,null));};exports[_0xfa10('0x4b')]=function(_0x198f0a,_0xe00a53){var _0x5ef462={'raw':![],'where':{'id':_0x198f0a[_0xfa10('0x4c')]['id']}},_0x12e169={};_0x12e169['model']=_['keys'](db['VoiceExtension'][_0xfa10('0x34')]);_0x12e169[_0xfa10('0x39')]=_[_0xfa10('0x38')](_0x198f0a['query']);_0x12e169['filters']=_['intersection'](_0x12e169[_0xfa10('0x37')],_0x12e169[_0xfa10('0x39')]);_0x5ef462[_0xfa10('0x3b')]=_['intersection'](_0x12e169[_0xfa10('0x37')],qs['fields'](_0x198f0a['query'][_0xfa10('0x3c')]));_0x5ef462[_0xfa10('0x3b')]=_0x5ef462['attributes']['length']?_0x5ef462['attributes']:_0x12e169[_0xfa10('0x37')];if(_0x198f0a[_0xfa10('0x39')][_0xfa10('0x47')]){_0x5ef462['include']=[{'all':!![]}];}_0x5ef462=_[_0xfa10('0x44')]({},_0x5ef462,_0x198f0a[_0xfa10('0x46')]);return db[_0xfa10('0x33')][_0xfa10('0x2d')](_0x5ef462)['then'](handleEntityNotFound(_0xe00a53,null))[_0xfa10('0x25')](respondWithResult(_0xe00a53,null))['catch'](handleError(_0xe00a53,null));};exports[_0xfa10('0x26')]=function(_0x562d51,_0x5eb1b2){return db[_0xfa10('0x33')][_0xfa10('0x2d')]({'where':{'id':_0x562d51[_0xfa10('0x4c')]['id']}})[_0xfa10('0x25')](handleEntityNotFound(_0x5eb1b2,null))['then'](removeEntity(_0x5eb1b2,null))[_0xfa10('0x4d')](handleError(_0x5eb1b2,null));};exports[_0xfa10('0x4e')]=function(_0x4c5976,_0x2e1658){if(_0x4c5976['body'][_0xfa10('0x2c')]===_0xfa10('0x29')&&!_[_0xfa10('0x4f')](_0x4c5976['body']['exten'],'_')){_0x4c5976[_0xfa10('0x50')][_0xfa10('0x51')]='_'[_0xfa10('0x52')](_0x4c5976[_0xfa10('0x50')][_0xfa10('0x51')]);}return db[_0xfa10('0x33')]['create'](_0x4c5976['body'],{'raw':![]})['then'](function(_0x1303aa){var _0x1bb711=_0x4c5976[_0xfa10('0x53')][_0xfa10('0x27')]({'plain':!![]});if(!_0x1bb711)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1bb711[_0xfa10('0x54')]==='user'){var _0x11c8fd=_0x1303aa[_0xfa10('0x27')]({'plain':!![]});var _0x376a24=[{'name':_0xfa10('0x28'),'value':_0xfa10('0x55')},{'name':_0xfa10('0x56'),'value':'outbound'},{'name':'InternalRoutes','value':_0xfa10('0x57')}];var _0xf7372f=_[_0xfa10('0x2d')](_0x376a24,[_0xfa10('0x2e'),_0x11c8fd[_0xfa10('0x2c')]])[_0xfa10('0x31')];return db[_0xfa10('0x58')][_0xfa10('0x2d')]({'where':{'name':_0xf7372f,'userProfileId':_0x1bb711[_0xfa10('0x59')]},'raw':!![]})[_0xfa10('0x25')](function(_0x52af73){if(_0x52af73&&_0x52af73[_0xfa10('0x5a')]===0x0){return db[_0xfa10('0x2f')][_0xfa10('0x4e')]({'name':_0x11c8fd[_0xfa10('0x31')],'resourceId':_0x11c8fd['id'],'type':_0x52af73['name'],'sectionId':_0x52af73['id']},{})[_0xfa10('0x25')](function(){return _0x1303aa;});}else{return _0x1303aa;}})[_0xfa10('0x4d')](function(_0x2a61a7){logger[_0xfa10('0x30')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2a61a7);throw _0x2a61a7;});}return _0x1303aa;})[_0xfa10('0x25')](respondWithResult(_0x2e1658,0xc9))[_0xfa10('0x4d')](handleError(_0x2e1658,null));};exports[_0xfa10('0x24')]=function(_0x4d800d,_0x1e6540){if(_0x4d800d[_0xfa10('0x50')]['id']){delete _0x4d800d[_0xfa10('0x50')]['id'];}return db[_0xfa10('0x33')][_0xfa10('0x2d')]({'where':{'id':_0x4d800d[_0xfa10('0x4c')]['id']}})['then'](handleEntityNotFound(_0x1e6540,null))[_0xfa10('0x25')](function(_0x268f6f){if(_0x268f6f){return db[_0xfa10('0x33')][_0xfa10('0x24')](_['pick'](_0x4d800d['body'],[_0xfa10('0x51'),_0xfa10('0x5b'),_0xfa10('0x5c'),_0xfa10('0x5d'),'cutdigits',_0xfa10('0x5e'),'alias']),{'where':{'context':_0x268f6f[_0xfa10('0x5b')],'exten':_0x268f6f[_0xfa10('0x51')]},'individualHooks':!![]})[_0xfa10('0x25')](function(_0x4fd064){return _0x4fd064;});}return null;})['then'](respondWithStatusCode(_0x1e6540,null))[_0xfa10('0x4d')](handleError(_0x1e6540,null));};exports[_0xfa10('0x5f')]=function(_0x4a84a3,_0x3c3f3d){return db[_0xfa10('0x33')][_0xfa10('0x60')]({'where':{'id':_0x4a84a3[_0xfa10('0x4c')]['id']}})[_0xfa10('0x25')](function(_0x2928ae){if(_0x2928ae){return db['sequelize'][_0xfa10('0x61')](function(_0x4398ff){return db[_0xfa10('0x33')][_0xfa10('0x26')]({'where':{'VoiceExtensionId':_0x4a84a3[_0xfa10('0x4c')]['id']},'transaction':_0x4398ff})[_0xfa10('0x25')](function(){var _0x447366=_[_0xfa10('0x2a')](_0x4a84a3[_0xfa10('0x50')],function(_0x28d44e){_0x28d44e[_0xfa10('0x62')]=_0x4a84a3[_0xfa10('0x4c')]['id'];_0x28d44e[_0xfa10('0x63')]=!![];return _0x28d44e;});var _0x1d59c9=_0x4a84a3['query'][_0xfa10('0x64')]&&_0x4a84a3[_0xfa10('0x39')]['rewriteDial'][_0xfa10('0x65')]()==='true'?!![]:![];return _0x2928ae[_0xfa10('0x66')](_0x447366,_0x1d59c9);})['then'](function(_0x5980a3){return db[_0xfa10('0x33')][_0xfa10('0x67')](_0x5980a3,{'transaction':_0x4398ff});});})[_0xfa10('0x25')](function(){return db['VoiceExtension'][_0xfa10('0x68')]({'where':{'isApp':!![],'VoiceExtensionId':_0x4a84a3[_0xfa10('0x4c')]['id']},'order':_0xfa10('0x69')});});}})[_0xfa10('0x25')](respondWithResult(_0x3c3f3d,null))[_0xfa10('0x4d')](handleError(_0x3c3f3d,null));}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.events.js b/server/api/voiceExtension/voiceExtension.events.js index 2f55eef..1aa68d3 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 _0x63b2=['../../mysqldb','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x39e164,_0x2cb93b){var _0x13fa6b=function(_0x511cb2){while(--_0x511cb2){_0x39e164['push'](_0x39e164['shift']());}};_0x13fa6b(++_0x2cb93b);}(_0x63b2,0x15d));var _0x263b=function(_0x248a91,_0x11ff28){_0x248a91=_0x248a91-0x0;var _0x18a303=_0x63b2[_0x248a91];return _0x18a303;};'use strict';var EventEmitter=require(_0x263b('0x0'));var VoiceExtension=require(_0x263b('0x1'))['db']['VoiceExtension'];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0x263b('0x2')](0x0);var events={'afterCreate':_0x263b('0x3'),'afterUpdate':_0x263b('0x4'),'afterDestroy':_0x263b('0x5')};function emitEvent(_0x3cb70f){return function(_0x5be0e7,_0x33821e,_0x33a3bd){VoiceExtensionEvents[_0x263b('0x6')](_0x3cb70f+':'+_0x5be0e7['id'],_0x5be0e7);VoiceExtensionEvents[_0x263b('0x6')](_0x3cb70f,_0x5be0e7);_0x33a3bd(null);};}for(var e in events){if(events[_0x263b('0x7')](e)){var event=events[e];VoiceExtension[_0x263b('0x8')](e,emitEvent(event));}}module[_0x263b('0x9')]=VoiceExtensionEvents; \ No newline at end of file +var _0x0abe=['emit','events','../../mysqldb','VoiceExtension','setMaxListeners','update','remove'];(function(_0x4a3bba,_0x3e0670){var _0x3f9596=function(_0x3bf6a2){while(--_0x3bf6a2){_0x4a3bba['push'](_0x4a3bba['shift']());}};_0x3f9596(++_0x3e0670);}(_0x0abe,0x1eb));var _0xe0ab=function(_0x467724,_0x5b68cb){_0x467724=_0x467724-0x0;var _0x2f93e1=_0x0abe[_0x467724];return _0x2f93e1;};'use strict';var EventEmitter=require(_0xe0ab('0x0'));var VoiceExtension=require(_0xe0ab('0x1'))['db'][_0xe0ab('0x2')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0xe0ab('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xe0ab('0x4'),'afterDestroy':_0xe0ab('0x5')};function emitEvent(_0x5651bb){return function(_0x46f887,_0x215272,_0x437d76){VoiceExtensionEvents[_0xe0ab('0x6')](_0x5651bb+':'+_0x46f887['id'],_0x46f887);VoiceExtensionEvents['emit'](_0x5651bb,_0x46f887);_0x437d76(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceExtension['hook'](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 4bd205b..4dd7167 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 _0x6d83=['VoiceExtension','Hangup','util','lodash','./voiceExtension.attributes','models','type','CDR(type)=','context','exten','Set','NoOp','alias','CDR(routeAlias)=','No\x20alias\x20set','inbound','push','CDR(routeid)=','XCALLY-MOTION-ANSWER=0','MONITOR_OPTIONS=ab','outbound','CDR(type)=outbound','CDR(destination)=','cutdigits','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=noprefix','hasOwnProperty','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','wav','timeout','options','split','length','trunk','phone','param','prefix','${EXTEN:','join','indexOf','U(xcally-mixmonitor-context)','replace','isEmpty','findAll','interval','IntervalId','then','*,*,*,*','intervals','map','toLowerCase','tag','CDR(tag)=','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):','callerID','Set(CALLERID(all)=','NoOp(No\x20number\x20available)','queue','playback','includes','app','custom','ExecIf','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice','GotoIfTime',',${EXTEN},','appType','outboundDial','appdata','priority','concat','last','define'];(function(_0x43876e,_0x3be644){var _0x440760=function(_0x472cad){while(--_0x472cad){_0x43876e['push'](_0x43876e['shift']());}};_0x440760(++_0x3be644);}(_0x6d83,0xa2));var _0x36d8=function(_0x1eb47a,_0x56d5c9){_0x1eb47a=_0x1eb47a-0x0;var _0x40a156=_0x6d83[_0x1eb47a];return _0x40a156;};'use strict';var util=require(_0x36d8('0x0'));var _=require(_0x36d8('0x1'));var attributes=require(_0x36d8('0x2'));module['exports']=function(_0x2d89f1){var _0x5f4465=_0x2d89f1[_0x36d8('0x3')];function _0x4904e5(_0x956053){var _0x1e1816=0x2;var _0x3b7b5d=[{'type':_0x956053[_0x36d8('0x4')],'app':'Set','appdata':_0x36d8('0x5')+_0x956053[_0x36d8('0x4')],'context':_0x956053[_0x36d8('0x6')],'exten':_0x956053[_0x36d8('0x7')],'priority':_0x1e1816++,'VoiceExtensionId':_0x956053['id']},{'type':_0x956053[_0x36d8('0x4')],'app':_0x956053['alias']?_0x36d8('0x8'):_0x36d8('0x9'),'appdata':_0x956053[_0x36d8('0xa')]?_0x36d8('0xb')+_0x956053[_0x36d8('0xa')]:_0x36d8('0xc'),'context':_0x956053[_0x36d8('0x6')],'exten':_0x956053[_0x36d8('0x7')],'priority':_0x1e1816++,'VoiceExtensionId':_0x956053['id']}];if(_0x956053[_0x36d8('0x4')]===_0x36d8('0xd')){_0x3b7b5d[_0x36d8('0xe')]({'type':_0x36d8('0xd'),'app':_0x36d8('0x8'),'appdata':_0x36d8('0xf')+_0x956053['id'],'context':_0x956053[_0x36d8('0x6')],'exten':_0x956053[_0x36d8('0x7')],'priority':_0x1e1816++,'VoiceExtensionId':_0x956053['id']});}_0x3b7b5d[_0x36d8('0xe')]({'type':_0x956053[_0x36d8('0x4')],'app':_0x36d8('0x8'),'appdata':_0x36d8('0x10'),'context':_0x956053[_0x36d8('0x6')],'exten':_0x956053[_0x36d8('0x7')],'priority':_0x1e1816++,'VoiceExtensionId':_0x956053['id']},{'type':_0x956053['type'],'app':_0x36d8('0x8'),'appdata':'XCALLY-MOTION-PROGRESS=0','context':_0x956053[_0x36d8('0x6')],'exten':_0x956053[_0x36d8('0x7')],'priority':_0x1e1816++,'VoiceExtensionId':_0x956053['id']},{'type':_0x956053['type'],'app':_0x36d8('0x8'),'appdata':_0x36d8('0x11'),'context':_0x956053[_0x36d8('0x6')],'exten':_0x956053[_0x36d8('0x7')],'priority':_0x1e1816++,'VoiceExtensionId':_0x956053['id']});return _0x3b7b5d;}function _0x453c4e(_0x504126){var _0x448a15=0x2;var _0x10a8d8=[{'type':_0x36d8('0x12'),'app':_0x36d8('0x8'),'appdata':_0x36d8('0x13'),'context':_0x504126[_0x36d8('0x6')],'exten':_0x504126[_0x36d8('0x7')],'priority':_0x448a15++,'VoiceExtensionId':_0x504126['id']},{'type':_0x36d8('0x12'),'app':_0x504126[_0x36d8('0xa')]?_0x36d8('0x8'):_0x36d8('0x9'),'appdata':_0x504126['alias']?_0x36d8('0xb')+_0x504126[_0x36d8('0xa')]:_0x36d8('0xc'),'context':_0x504126[_0x36d8('0x6')],'exten':_0x504126['exten'],'priority':_0x448a15++,'VoiceExtensionId':_0x504126['id']},{'type':_0x36d8('0x12'),'app':_0x36d8('0x8'),'appdata':_0x36d8('0x14')+(_0x504126[_0x36d8('0x15')]?'${EXTEN:'+_0x504126[_0x36d8('0x15')]+'}':'${EXTEN}'),'context':_0x504126[_0x36d8('0x6')],'exten':_0x504126[_0x36d8('0x7')],'priority':_0x448a15++,'VoiceExtensionId':_0x504126['id']},{'type':_0x36d8('0x12'),'app':_0x36d8('0x8'),'appdata':_0x36d8('0xf')+_0x504126['id'],'context':_0x504126[_0x36d8('0x6')],'exten':_0x504126[_0x36d8('0x7')],'priority':_0x448a15++,'VoiceExtensionId':_0x504126['id']},{'type':_0x36d8('0x12'),'app':'ExecIf','appdata':_0x36d8('0x16')+(_0x448a15+0x2)+_0x36d8('0x17')+(_0x448a15+0x1)+')','context':_0x504126['context'],'exten':_0x504126[_0x36d8('0x7')],'priority':_0x448a15++,'VoiceExtensionId':_0x504126['id']},{'type':_0x36d8('0x12'),'app':_0x36d8('0x8'),'appdata':_0x504126[_0x36d8('0x15')]?'CDR(prefix)=${EXTEN:0:'+_0x504126[_0x36d8('0x15')]+'}':_0x36d8('0x18'),'context':_0x504126['context'],'exten':_0x504126[_0x36d8('0x7')],'priority':_0x448a15++,'VoiceExtensionId':_0x504126['id']},{'type':'outbound','app':_0x36d8('0x8'),'appdata':_0x36d8('0x10'),'context':_0x504126[_0x36d8('0x6')],'exten':_0x504126[_0x36d8('0x7')],'priority':_0x448a15++,'VoiceExtensionId':_0x504126['id']},{'type':_0x36d8('0x12'),'app':'Set','appdata':'XCALLY-MOTION-PROGRESS=0','context':_0x504126['context'],'exten':_0x504126[_0x36d8('0x7')],'priority':_0x448a15++,'VoiceExtensionId':_0x504126['id']},{'type':_0x36d8('0x12'),'app':'Set','appdata':'MONITOR_OPTIONS=ab','context':_0x504126['context'],'exten':_0x504126[_0x36d8('0x7')],'priority':_0x448a15++,'VoiceExtensionId':_0x504126['id']},{'type':'outbound','app':_0x36d8('0x8'),'appdata':'outboundrouteid='+_0x504126['id'],'context':_0x504126[_0x36d8('0x6')],'exten':_0x504126[_0x36d8('0x7')],'priority':_0x448a15++,'VoiceExtensionId':_0x504126['id']}];if(_0x504126[_0x36d8('0x19')](_0x36d8('0x1a'))&&_0x504126[_0x36d8('0x1a')]!==_0x36d8('0x1b')){_0x10a8d8[_0x36d8('0xe')]({'type':_0x36d8('0x12'),'app':'Set','appdata':_0x36d8('0x1c'),'context':_0x504126[_0x36d8('0x6')],'exten':_0x504126[_0x36d8('0x7')],'priority':_0x448a15++,'VoiceExtensionId':_0x504126['id']},{'type':_0x36d8('0x12'),'app':'Set','appdata':_0x36d8('0x1d')+_0x504126['recordingFormat']||_0x36d8('0x1e'),'context':_0x504126[_0x36d8('0x6')],'exten':_0x504126[_0x36d8('0x7')],'priority':_0x448a15++,'VoiceExtensionId':_0x504126['id']});}return _0x10a8d8;}function _0x280dbd(_0x34c390){var _0x270b59=[{'name':'trunk','param':0x0},{'name':_0x36d8('0x1f'),'param':0x1},{'name':_0x36d8('0x20'),'param':0x2},{'name':'url','param':0x3}];var _0x4a2a7a={};var _0xde0bec=_0x34c390[_0x36d8('0x21')](',');var _0x22080d=[];for(var _0x22640e=0x0;_0x22640e<_0x270b59[_0x36d8('0x22')];_0x22640e++){switch(_0x270b59[_0x22640e]['name']){case _0x36d8('0x23'):_0x4a2a7a[_0x36d8('0x23')]=_0xde0bec[_0x270b59[_0x22640e]['param']][_0x36d8('0x21')]('/')[0x1];_0x4a2a7a[_0x36d8('0x24')]=_0xde0bec[_0x270b59[_0x22640e][_0x36d8('0x25')]][_0x36d8('0x21')]('/')[0x2];_0x4a2a7a[_0x36d8('0x26')]=_0x4a2a7a['phone']?_0x4a2a7a[_0x36d8('0x24')][_0x36d8('0x21')]('$')[0x0]:undefined;_0x4a2a7a[_0x36d8('0x24')]=route[_0x36d8('0x15')]?(_0x4a2a7a[_0x36d8('0x26')]||'')+_0x36d8('0x27')+route[_0x36d8('0x15')]+'}':(_0x4a2a7a[_0x36d8('0x26')]||'')+'${EXTEN}';_0x22080d[_0x270b59[_0x22640e][_0x36d8('0x25')]]=['SIP',_0x4a2a7a[_0x36d8('0x23')],_0x4a2a7a[_0x36d8('0x24')]][_0x36d8('0x28')]('/');break;case'options':_0x4a2a7a[_0x36d8('0x20')]=_0xde0bec[_0x270b59[_0x22640e][_0x36d8('0x25')]];if(route['recordingFormat']!=='none'){if(_0x4a2a7a[_0x36d8('0x20')][_0x36d8('0x29')](_0x36d8('0x2a'))<0x0){_0x4a2a7a[_0x36d8('0x20')]+=_0x36d8('0x2a');}}else{_0x4a2a7a[_0x36d8('0x20')]=_0x4a2a7a[_0x36d8('0x20')][_0x36d8('0x2b')](_0x36d8('0x2a'),'');}_0x22080d[_0x270b59[_0x22640e][_0x36d8('0x25')]]=_0x4a2a7a['options'];break;default:_0x22080d[_0x270b59[_0x22640e][_0x36d8('0x25')]]=_0xde0bec[_0x270b59[_0x22640e][_0x36d8('0x25')]];}}return _0x22080d[_0x36d8('0x28')](',');}function _0x39c02f(_0x5a13ef,_0xd1ae1d,_0x5bb79c,_0x109f68){return new Promise(function(_0xd082ba,_0x6070fa){var _0x146cef=[];if(_[_0x36d8('0x2c')](_0xd1ae1d))return _0xd082ba(_0x146cef);_0x5f4465['Interval'][_0x36d8('0x2d')]({'attributes':['id',_0x36d8('0x2e'),_0x36d8('0x2f')],'raw':!![]})[_0x36d8('0x30')](function(_0x1ae7d4){for(var _0x44ff0b=0x0,_0x1ec10d=0x0;_0x44ff0b<_0xd1ae1d[_0x36d8('0x22')];_0x44ff0b++,_0x1ec10d=0x0){var _0x150536=_0xd1ae1d[_0x44ff0b];var _0x2c232a=[];var _0x1a1db5=[];if(_0x150536[_0x36d8('0x2e')]!==_0x36d8('0x31')){_0x150536[_0x36d8('0x32')]=[_0x150536[_0x36d8('0x2e')]];}else{_0x150536[_0x36d8('0x32')]=_0x150536['IntervalId']?_[_0x36d8('0x33')](_['filter'](_0x1ae7d4,{'IntervalId':_0x150536[_0x36d8('0x2f')]}),_0x36d8('0x2e')):[];}_0x150536[_0x36d8('0x6')]=_0x5a13ef[_0x36d8('0x6')];_0x150536[_0x36d8('0x7')]=_0x5a13ef[_0x36d8('0x7')];if(_0x150536[_0x36d8('0x4')])_0x150536[_0x36d8('0x4')]=_0x150536['type'][_0x36d8('0x34')]();if(_0x5a13ef[_0x36d8('0x4')]===_0x36d8('0x12')){if(_0x150536[_0x36d8('0x19')]('tag')&&_0x150536['tag']&&_0x150536[_0x36d8('0x35')]!=='--'){_0x2c232a[_0x36d8('0xe')]({'type':_0x150536[_0x36d8('0x4')][_0x36d8('0x34')](),'app':_0x36d8('0x8'),'appdata':_0x36d8('0x36')+_0x150536[_0x36d8('0x35')],'context':_0x5a13ef['context'],'exten':_0x5a13ef['exten'],'priority':_0x150536['intervals'][_0x36d8('0x22')]+_0x5bb79c+_0x1ec10d++,'VoiceExtensionId':_0x5a13ef['id']});}_0x2c232a['push']({'type':_0x150536[_0x36d8('0x4')]['toLowerCase'](),'app':'ExecIf','appdata':_0x36d8('0x37')+(_0x150536[_0x36d8('0x38')]?_0x36d8('0x39')+_0x150536[_0x36d8('0x38')]+')':_0x36d8('0x3a')),'context':_0x5a13ef[_0x36d8('0x6')],'exten':_0x5a13ef['exten'],'priority':_0x150536[_0x36d8('0x32')]['length']+_0x5bb79c+_0x1ec10d++,'VoiceExtensionId':_0x5a13ef['id']});}else{if(_0x150536[_0x36d8('0x19')]('answer')){if([_0x36d8('0x3b'),_0x36d8('0x3c')][_0x36d8('0x3d')](_0x150536[_0x36d8('0x3e')][_0x36d8('0x34')]())&&_0x150536['appType']!==_0x36d8('0x3f')){if(_0x150536['answer']){_0x2c232a[_0x36d8('0xe')]({'type':_0x150536[_0x36d8('0x4')][_0x36d8('0x34')](),'app':_0x36d8('0x40'),'appdata':'$[${XCALLY-MOTION-ANSWER}=0]?Answer','context':_0x5a13ef[_0x36d8('0x6')],'exten':_0x5a13ef['exten'],'priority':_0x150536[_0x36d8('0x32')][_0x36d8('0x22')]+_0x5bb79c+_0x1ec10d++,'VoiceExtensionId':_0x5a13ef['id']});_0x2c232a[_0x36d8('0xe')]({'type':_0x150536[_0x36d8('0x4')][_0x36d8('0x34')](),'app':'Set','appdata':_0x36d8('0x41'),'context':_0x5a13ef['context'],'exten':_0x5a13ef[_0x36d8('0x7')],'priority':_0x150536[_0x36d8('0x32')][_0x36d8('0x22')]+_0x5bb79c+_0x1ec10d++,'VoiceExtensionId':_0x5a13ef['id']});}else{_0x2c232a[_0x36d8('0xe')]({'type':_0x150536[_0x36d8('0x4')][_0x36d8('0x34')](),'app':_0x36d8('0x40'),'appdata':_0x36d8('0x42'),'context':_0x5a13ef[_0x36d8('0x6')],'exten':_0x5a13ef[_0x36d8('0x7')],'priority':_0x150536['intervals'][_0x36d8('0x22')]+_0x5bb79c+_0x1ec10d++,'VoiceExtensionId':_0x5a13ef['id']});_0x2c232a['push']({'type':_0x150536[_0x36d8('0x4')][_0x36d8('0x34')](),'app':_0x36d8('0x8'),'appdata':_0x36d8('0x43'),'context':_0x5a13ef[_0x36d8('0x6')],'exten':_0x5a13ef[_0x36d8('0x7')],'priority':_0x150536[_0x36d8('0x32')][_0x36d8('0x22')]+_0x5bb79c+_0x1ec10d++,'VoiceExtensionId':_0x5a13ef['id']});}}}}for(var _0x413cdf=0x0;_0x413cdf<_0x150536[_0x36d8('0x32')][_0x36d8('0x22')];_0x413cdf++){var _0x1e4492=_0x5bb79c+_0x150536[_0x36d8('0x32')][_0x36d8('0x22')];var _0x297aa8=_0x413cdf===_0x150536[_0x36d8('0x32')][_0x36d8('0x22')]-0x1?_0x5bb79c+_0x2c232a[_0x36d8('0x22')]+_0x1a1db5[_0x36d8('0x22')]+0x2:_0x5bb79c+_0x413cdf+0x1;_0x2c232a[_0x36d8('0x44')](_0x413cdf,0x0,{'type':_0x5a13ef['type'],'app':_0x36d8('0x45'),'appdata':_0x150536['intervals'][_0x413cdf]+'?'+_0x5a13ef[_0x36d8('0x6')]+',${EXTEN},'+_0x1e4492+':'+_0x5a13ef[_0x36d8('0x6')]+_0x36d8('0x46')+_0x297aa8,'exten':_0x5a13ef[_0x36d8('0x7')],'context':_0x5a13ef[_0x36d8('0x6')],'priority':_0x5bb79c+_0x413cdf,'VoiceExtensionId':_0x5a13ef['id']});}if(_0x109f68&&_0x150536[_0x36d8('0x47')]===_0x36d8('0x48'))_0x150536[_0x36d8('0x49')]=_0x280dbd(_0x150536[_0x36d8('0x49')]);_0x150536['priority']=_0x2c232a[_0x36d8('0x22')]?_['last'](_0x2c232a)[_0x36d8('0x4a')]+0x1:_0x5bb79c;_0x146cef=_[_0x36d8('0x4b')](_0x146cef,_0x2c232a,[_0x150536],_0x1a1db5);_0x5bb79c=_[_0x36d8('0x4c')](_0x146cef)[_0x36d8('0x4a')]+0x1;}return _0xd082ba(_0x146cef);})['catch'](function(_0xfc4244){_0x6070fa(_0xfc4244);});});}return _0x2d89f1[_0x36d8('0x4d')](_0x36d8('0x4e'),attributes,{'tableName':'voice_extensions','paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0x664313,_0x2f2469){var _0x19d148=this;var _0x165552=_0x19d148[_0x36d8('0x4')]===_0x36d8('0x12')?_0x453c4e(_0x19d148):_0x4904e5(_0x19d148);return _0x39c02f(_0x19d148,_0x664313,_['last'](_0x165552)['priority']+0x1,_0x2f2469)[_0x36d8('0x30')](function(_0xeb3af2){var _0x3de295=_['concat'](_0x165552,_0xeb3af2);_0x3de295['push']({'type':_0x19d148[_0x36d8('0x4')],'app':_0x36d8('0x4f'),'exten':_0x19d148[_0x36d8('0x7')],'context':_0x19d148[_0x36d8('0x6')],'priority':_[_0x36d8('0x4c')](_0x3de295)[_0x36d8('0x4a')]+0x1,'VoiceExtensionId':_0x19d148['id']});return _0x3de295;});}}});}; \ No newline at end of file +var _0xd704=['name','param','prefix','phone','cutdigits','${EXTEN}','join','none','indexOf','U(xcally-mixmonitor-context)','replace','isEmpty','findAll','interval','then','*,*,*,*','intervals','IntervalId','map','filter','toLowerCase','tag','CDR(tag)=','callerID','Set(CALLERID(all)=','answer','queue','playback','includes','app','appType','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice',',${EXTEN},','outboundDial','appdata','last','priority','concat','catch','define','VoiceExtension','voice_extensions','Hangup','util','lodash','./voiceExtension.attributes','exports','models','type','Set','exten','alias','NoOp','No\x20alias\x20set','context','push','CDR(routeid)=','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','outbound','CDR(routeAlias)=','CDR(destination)=','${EXTEN:','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','outboundrouteid=','hasOwnProperty','recordingFormat','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','wav','trunk','timeout','options','url','split','length'];(function(_0x2b5a72,_0x23aa5a){var _0x15de6b=function(_0x33d1aa){while(--_0x33d1aa){_0x2b5a72['push'](_0x2b5a72['shift']());}};_0x15de6b(++_0x23aa5a);}(_0xd704,0x132));var _0x4d70=function(_0x1d8295,_0x348dd5){_0x1d8295=_0x1d8295-0x0;var _0x5b5611=_0xd704[_0x1d8295];return _0x5b5611;};'use strict';var util=require(_0x4d70('0x0'));var _=require(_0x4d70('0x1'));var attributes=require(_0x4d70('0x2'));module[_0x4d70('0x3')]=function(_0x23ef00){var _0x36e62f=_0x23ef00[_0x4d70('0x4')];function _0x34a795(_0x540b79){var _0x300e97=0x2;var _0x2ff01c=[{'type':_0x540b79[_0x4d70('0x5')],'app':_0x4d70('0x6'),'appdata':'CDR(type)='+_0x540b79[_0x4d70('0x5')],'context':_0x540b79['context'],'exten':_0x540b79[_0x4d70('0x7')],'priority':_0x300e97++,'VoiceExtensionId':_0x540b79['id']},{'type':_0x540b79[_0x4d70('0x5')],'app':_0x540b79[_0x4d70('0x8')]?_0x4d70('0x6'):_0x4d70('0x9'),'appdata':_0x540b79['alias']?'CDR(routeAlias)='+_0x540b79[_0x4d70('0x8')]:_0x4d70('0xa'),'context':_0x540b79[_0x4d70('0xb')],'exten':_0x540b79[_0x4d70('0x7')],'priority':_0x300e97++,'VoiceExtensionId':_0x540b79['id']}];if(_0x540b79['type']==='inbound'){_0x2ff01c[_0x4d70('0xc')]({'type':'inbound','app':_0x4d70('0x6'),'appdata':_0x4d70('0xd')+_0x540b79['id'],'context':_0x540b79[_0x4d70('0xb')],'exten':_0x540b79[_0x4d70('0x7')],'priority':_0x300e97++,'VoiceExtensionId':_0x540b79['id']});}_0x2ff01c[_0x4d70('0xc')]({'type':_0x540b79[_0x4d70('0x5')],'app':_0x4d70('0x6'),'appdata':_0x4d70('0xe'),'context':_0x540b79['context'],'exten':_0x540b79[_0x4d70('0x7')],'priority':_0x300e97++,'VoiceExtensionId':_0x540b79['id']},{'type':_0x540b79[_0x4d70('0x5')],'app':_0x4d70('0x6'),'appdata':_0x4d70('0xf'),'context':_0x540b79[_0x4d70('0xb')],'exten':_0x540b79[_0x4d70('0x7')],'priority':_0x300e97++,'VoiceExtensionId':_0x540b79['id']},{'type':_0x540b79[_0x4d70('0x5')],'app':_0x4d70('0x6'),'appdata':_0x4d70('0x10'),'context':_0x540b79['context'],'exten':_0x540b79[_0x4d70('0x7')],'priority':_0x300e97++,'VoiceExtensionId':_0x540b79['id']});return _0x2ff01c;}function _0x108476(_0x481e37){var _0x23edb0=0x2;var _0x1cfc75=[{'type':_0x4d70('0x11'),'app':_0x4d70('0x6'),'appdata':'CDR(type)=outbound','context':_0x481e37[_0x4d70('0xb')],'exten':_0x481e37[_0x4d70('0x7')],'priority':_0x23edb0++,'VoiceExtensionId':_0x481e37['id']},{'type':'outbound','app':_0x481e37[_0x4d70('0x8')]?'Set':_0x4d70('0x9'),'appdata':_0x481e37['alias']?_0x4d70('0x12')+_0x481e37[_0x4d70('0x8')]:'No\x20alias\x20set','context':_0x481e37[_0x4d70('0xb')],'exten':_0x481e37['exten'],'priority':_0x23edb0++,'VoiceExtensionId':_0x481e37['id']},{'type':'outbound','app':_0x4d70('0x6'),'appdata':_0x4d70('0x13')+(_0x481e37['cutdigits']?_0x4d70('0x14')+_0x481e37['cutdigits']+'}':'${EXTEN}'),'context':_0x481e37[_0x4d70('0xb')],'exten':_0x481e37['exten'],'priority':_0x23edb0++,'VoiceExtensionId':_0x481e37['id']},{'type':_0x4d70('0x11'),'app':'Set','appdata':_0x4d70('0xd')+_0x481e37['id'],'context':_0x481e37[_0x4d70('0xb')],'exten':_0x481e37['exten'],'priority':_0x23edb0++,'VoiceExtensionId':_0x481e37['id']},{'type':_0x4d70('0x11'),'app':_0x4d70('0x15'),'appdata':_0x4d70('0x16')+(_0x23edb0+0x2)+_0x4d70('0x17')+(_0x23edb0+0x1)+')','context':_0x481e37[_0x4d70('0xb')],'exten':_0x481e37[_0x4d70('0x7')],'priority':_0x23edb0++,'VoiceExtensionId':_0x481e37['id']},{'type':_0x4d70('0x11'),'app':_0x4d70('0x6'),'appdata':_0x481e37['cutdigits']?_0x4d70('0x18')+_0x481e37['cutdigits']+'}':_0x4d70('0x19'),'context':_0x481e37['context'],'exten':_0x481e37[_0x4d70('0x7')],'priority':_0x23edb0++,'VoiceExtensionId':_0x481e37['id']},{'type':'outbound','app':_0x4d70('0x6'),'appdata':'XCALLY-MOTION-ANSWER=0','context':_0x481e37['context'],'exten':_0x481e37['exten'],'priority':_0x23edb0++,'VoiceExtensionId':_0x481e37['id']},{'type':_0x4d70('0x11'),'app':_0x4d70('0x6'),'appdata':_0x4d70('0xf'),'context':_0x481e37[_0x4d70('0xb')],'exten':_0x481e37[_0x4d70('0x7')],'priority':_0x23edb0++,'VoiceExtensionId':_0x481e37['id']},{'type':_0x4d70('0x11'),'app':_0x4d70('0x6'),'appdata':'MONITOR_OPTIONS=ab','context':_0x481e37[_0x4d70('0xb')],'exten':_0x481e37[_0x4d70('0x7')],'priority':_0x23edb0++,'VoiceExtensionId':_0x481e37['id']},{'type':_0x4d70('0x11'),'app':_0x4d70('0x6'),'appdata':_0x4d70('0x1a')+_0x481e37['id'],'context':_0x481e37[_0x4d70('0xb')],'exten':_0x481e37[_0x4d70('0x7')],'priority':_0x23edb0++,'VoiceExtensionId':_0x481e37['id']}];if(_0x481e37[_0x4d70('0x1b')](_0x4d70('0x1c'))&&_0x481e37[_0x4d70('0x1c')]!=='none'){_0x1cfc75[_0x4d70('0xc')]({'type':'outbound','app':_0x4d70('0x6'),'appdata':_0x4d70('0x1d'),'context':_0x481e37[_0x4d70('0xb')],'exten':_0x481e37[_0x4d70('0x7')],'priority':_0x23edb0++,'VoiceExtensionId':_0x481e37['id']},{'type':_0x4d70('0x11'),'app':'Set','appdata':_0x4d70('0x1e')+_0x481e37[_0x4d70('0x1c')]||_0x4d70('0x1f'),'context':_0x481e37[_0x4d70('0xb')],'exten':_0x481e37[_0x4d70('0x7')],'priority':_0x23edb0++,'VoiceExtensionId':_0x481e37['id']});}return _0x1cfc75;}function _0x3e63dd(_0x3a2333){var _0x26f85e=[{'name':_0x4d70('0x20'),'param':0x0},{'name':_0x4d70('0x21'),'param':0x1},{'name':_0x4d70('0x22'),'param':0x2},{'name':_0x4d70('0x23'),'param':0x3}];var _0x22942a={};var _0x3ed2e8=_0x3a2333[_0x4d70('0x24')](',');var _0x117624=[];for(var _0x1f7fb2=0x0;_0x1f7fb2<_0x26f85e[_0x4d70('0x25')];_0x1f7fb2++){switch(_0x26f85e[_0x1f7fb2][_0x4d70('0x26')]){case _0x4d70('0x20'):_0x22942a[_0x4d70('0x20')]=_0x3ed2e8[_0x26f85e[_0x1f7fb2][_0x4d70('0x27')]][_0x4d70('0x24')]('/')[0x1];_0x22942a['phone']=_0x3ed2e8[_0x26f85e[_0x1f7fb2][_0x4d70('0x27')]][_0x4d70('0x24')]('/')[0x2];_0x22942a[_0x4d70('0x28')]=_0x22942a[_0x4d70('0x29')]?_0x22942a[_0x4d70('0x29')][_0x4d70('0x24')]('$')[0x0]:undefined;_0x22942a[_0x4d70('0x29')]=route[_0x4d70('0x2a')]?(_0x22942a['prefix']||'')+_0x4d70('0x14')+route[_0x4d70('0x2a')]+'}':(_0x22942a[_0x4d70('0x28')]||'')+_0x4d70('0x2b');_0x117624[_0x26f85e[_0x1f7fb2][_0x4d70('0x27')]]=['SIP',_0x22942a[_0x4d70('0x20')],_0x22942a[_0x4d70('0x29')]][_0x4d70('0x2c')]('/');break;case _0x4d70('0x22'):_0x22942a[_0x4d70('0x22')]=_0x3ed2e8[_0x26f85e[_0x1f7fb2][_0x4d70('0x27')]];if(route['recordingFormat']!==_0x4d70('0x2d')){if(_0x22942a['options'][_0x4d70('0x2e')](_0x4d70('0x2f'))<0x0){_0x22942a[_0x4d70('0x22')]+='U(xcally-mixmonitor-context)';}}else{_0x22942a[_0x4d70('0x22')]=_0x22942a['options'][_0x4d70('0x30')]('U(xcally-mixmonitor-context)','');}_0x117624[_0x26f85e[_0x1f7fb2][_0x4d70('0x27')]]=_0x22942a[_0x4d70('0x22')];break;default:_0x117624[_0x26f85e[_0x1f7fb2][_0x4d70('0x27')]]=_0x3ed2e8[_0x26f85e[_0x1f7fb2][_0x4d70('0x27')]];}}return _0x117624[_0x4d70('0x2c')](',');}function _0xfb317(_0x238ffe,_0x48b1e4,_0x471be4,_0x2ac7f8){return new Promise(function(_0x32cb4e,_0x35cc62){var _0x594548=[];if(_[_0x4d70('0x31')](_0x48b1e4))return _0x32cb4e(_0x594548);_0x36e62f['Interval'][_0x4d70('0x32')]({'attributes':['id',_0x4d70('0x33'),'IntervalId'],'raw':!![]})[_0x4d70('0x34')](function(_0x38b2d9){for(var _0x447a9e=0x0,_0x150133=0x0;_0x447a9e<_0x48b1e4['length'];_0x447a9e++,_0x150133=0x0){var _0x20caff=_0x48b1e4[_0x447a9e];var _0x53da6f=[];var _0x2287d1=[];if(_0x20caff[_0x4d70('0x33')]!==_0x4d70('0x35')){_0x20caff[_0x4d70('0x36')]=[_0x20caff[_0x4d70('0x33')]];}else{_0x20caff[_0x4d70('0x36')]=_0x20caff[_0x4d70('0x37')]?_[_0x4d70('0x38')](_[_0x4d70('0x39')](_0x38b2d9,{'IntervalId':_0x20caff[_0x4d70('0x37')]}),_0x4d70('0x33')):[];}_0x20caff[_0x4d70('0xb')]=_0x238ffe[_0x4d70('0xb')];_0x20caff[_0x4d70('0x7')]=_0x238ffe[_0x4d70('0x7')];if(_0x20caff['type'])_0x20caff[_0x4d70('0x5')]=_0x20caff[_0x4d70('0x5')][_0x4d70('0x3a')]();if(_0x238ffe[_0x4d70('0x5')]===_0x4d70('0x11')){if(_0x20caff[_0x4d70('0x1b')](_0x4d70('0x3b'))&&_0x20caff[_0x4d70('0x3b')]&&_0x20caff[_0x4d70('0x3b')]!=='--'){_0x53da6f[_0x4d70('0xc')]({'type':_0x20caff['type'][_0x4d70('0x3a')](),'app':'Set','appdata':_0x4d70('0x3c')+_0x20caff[_0x4d70('0x3b')],'context':_0x238ffe[_0x4d70('0xb')],'exten':_0x238ffe[_0x4d70('0x7')],'priority':_0x20caff[_0x4d70('0x36')][_0x4d70('0x25')]+_0x471be4+_0x150133++,'VoiceExtensionId':_0x238ffe['id']});}_0x53da6f['push']({'type':_0x20caff['type'][_0x4d70('0x3a')](),'app':'ExecIf','appdata':'$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):'+(_0x20caff[_0x4d70('0x3d')]?_0x4d70('0x3e')+_0x20caff[_0x4d70('0x3d')]+')':'NoOp(No\x20number\x20available)'),'context':_0x238ffe['context'],'exten':_0x238ffe[_0x4d70('0x7')],'priority':_0x20caff[_0x4d70('0x36')][_0x4d70('0x25')]+_0x471be4+_0x150133++,'VoiceExtensionId':_0x238ffe['id']});}else{if(_0x20caff['hasOwnProperty'](_0x4d70('0x3f'))){if([_0x4d70('0x40'),_0x4d70('0x41')][_0x4d70('0x42')](_0x20caff[_0x4d70('0x43')][_0x4d70('0x3a')]())&&_0x20caff[_0x4d70('0x44')]!==_0x4d70('0x45')){if(_0x20caff['answer']){_0x53da6f['push']({'type':_0x20caff[_0x4d70('0x5')][_0x4d70('0x3a')](),'app':_0x4d70('0x15'),'appdata':_0x4d70('0x46'),'context':_0x238ffe[_0x4d70('0xb')],'exten':_0x238ffe[_0x4d70('0x7')],'priority':_0x20caff[_0x4d70('0x36')][_0x4d70('0x25')]+_0x471be4+_0x150133++,'VoiceExtensionId':_0x238ffe['id']});_0x53da6f[_0x4d70('0xc')]({'type':_0x20caff['type']['toLowerCase'](),'app':_0x4d70('0x6'),'appdata':_0x4d70('0x47'),'context':_0x238ffe['context'],'exten':_0x238ffe[_0x4d70('0x7')],'priority':_0x20caff[_0x4d70('0x36')][_0x4d70('0x25')]+_0x471be4+_0x150133++,'VoiceExtensionId':_0x238ffe['id']});}else{_0x53da6f[_0x4d70('0xc')]({'type':_0x20caff[_0x4d70('0x5')]['toLowerCase'](),'app':_0x4d70('0x15'),'appdata':_0x4d70('0x48'),'context':_0x238ffe[_0x4d70('0xb')],'exten':_0x238ffe[_0x4d70('0x7')],'priority':_0x20caff[_0x4d70('0x36')][_0x4d70('0x25')]+_0x471be4+_0x150133++,'VoiceExtensionId':_0x238ffe['id']});_0x53da6f[_0x4d70('0xc')]({'type':_0x20caff[_0x4d70('0x5')][_0x4d70('0x3a')](),'app':'Set','appdata':_0x4d70('0x49'),'context':_0x238ffe[_0x4d70('0xb')],'exten':_0x238ffe[_0x4d70('0x7')],'priority':_0x20caff[_0x4d70('0x36')][_0x4d70('0x25')]+_0x471be4+_0x150133++,'VoiceExtensionId':_0x238ffe['id']});}}}}for(var _0x5b385d=0x0;_0x5b385d<_0x20caff[_0x4d70('0x36')][_0x4d70('0x25')];_0x5b385d++){var _0x475750=_0x471be4+_0x20caff[_0x4d70('0x36')][_0x4d70('0x25')];var _0x39d913=_0x5b385d===_0x20caff[_0x4d70('0x36')]['length']-0x1?_0x471be4+_0x53da6f[_0x4d70('0x25')]+_0x2287d1[_0x4d70('0x25')]+0x2:_0x471be4+_0x5b385d+0x1;_0x53da6f[_0x4d70('0x4a')](_0x5b385d,0x0,{'type':_0x238ffe[_0x4d70('0x5')],'app':'GotoIfTime','appdata':_0x20caff['intervals'][_0x5b385d]+'?'+_0x238ffe[_0x4d70('0xb')]+_0x4d70('0x4b')+_0x475750+':'+_0x238ffe[_0x4d70('0xb')]+_0x4d70('0x4b')+_0x39d913,'exten':_0x238ffe[_0x4d70('0x7')],'context':_0x238ffe[_0x4d70('0xb')],'priority':_0x471be4+_0x5b385d,'VoiceExtensionId':_0x238ffe['id']});}if(_0x2ac7f8&&_0x20caff['appType']===_0x4d70('0x4c'))_0x20caff[_0x4d70('0x4d')]=_0x3e63dd(_0x20caff[_0x4d70('0x4d')]);_0x20caff['priority']=_0x53da6f['length']?_[_0x4d70('0x4e')](_0x53da6f)[_0x4d70('0x4f')]+0x1:_0x471be4;_0x594548=_[_0x4d70('0x50')](_0x594548,_0x53da6f,[_0x20caff],_0x2287d1);_0x471be4=_[_0x4d70('0x4e')](_0x594548)[_0x4d70('0x4f')]+0x1;}return _0x32cb4e(_0x594548);})[_0x4d70('0x51')](function(_0x2b408a){_0x35cc62(_0x2b408a);});});}return _0x23ef00[_0x4d70('0x52')](_0x4d70('0x53'),attributes,{'tableName':_0x4d70('0x54'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0x53a21c,_0x57ee0f){var _0x490f12=this;var _0x247e39=_0x490f12[_0x4d70('0x5')]==='outbound'?_0x108476(_0x490f12):_0x34a795(_0x490f12);return _0xfb317(_0x490f12,_0x53a21c,_[_0x4d70('0x4e')](_0x247e39)[_0x4d70('0x4f')]+0x1,_0x57ee0f)['then'](function(_0x454187){var _0x2e1e42=_[_0x4d70('0x50')](_0x247e39,_0x454187);_0x2e1e42[_0x4d70('0xc')]({'type':_0x490f12['type'],'app':_0x4d70('0x55'),'exten':_0x490f12[_0x4d70('0x7')],'context':_0x490f12[_0x4d70('0xb')],'priority':_['last'](_0x2e1e42)[_0x4d70('0x4f')]+0x1,'VoiceExtensionId':_0x490f12['id']});return _0x2e1e42;});}}});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.rpc.js b/server/api/voiceExtension/voiceExtension.rpc.js index 38aa764..acecb25 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 _0x4d49=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./voiceExtension.socket','register','then','info','VoiceExtension,\x20%s,\x20%s','request\x20sent','debug','error','message','result','catch','GetVoiceExtension','VoiceExtension','options','raw','where','attributes','limit','map','include','model','util','bluebird','randomstring'];(function(_0xd2c332,_0x1b5f38){var _0x4efc6f=function(_0x56d70c){while(--_0x56d70c){_0xd2c332['push'](_0xd2c332['shift']());}};_0x4efc6f(++_0x1b5f38);}(_0x4d49,0x141));var _0x94d4=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x4d49[_0x3947c9];return _0x2e7871;};'use strict';var _=require('lodash');var util=require(_0x94d4('0x0'));var moment=require('moment');var BPromise=require(_0x94d4('0x1'));var rs=require(_0x94d4('0x2'));var fs=require('fs');var Redis=require(_0x94d4('0x3'));var db=require(_0x94d4('0x4'))['db'];var utils=require(_0x94d4('0x5'));var logger=require(_0x94d4('0x6'))(_0x94d4('0x7'));var config=require(_0x94d4('0x8'));var jayson=require(_0x94d4('0x9'));var client=jayson['client'][_0x94d4('0xa')]({'port':0x232a});config[_0x94d4('0xb')]=_[_0x94d4('0xc')](config[_0x94d4('0xb')],{'host':_0x94d4('0xd'),'port':0x18eb});var socket=require(_0x94d4('0xe'))(new Redis(config['redis']));require(_0x94d4('0xf'))[_0x94d4('0x10')](socket);function respondWithRpcPromise(_0x562265,_0x23ef86,_0x283f63){return new BPromise(function(_0xd7820d,_0x2720dd){return client['request'](_0x562265,_0x283f63)[_0x94d4('0x11')](function(_0xe7f878){logger[_0x94d4('0x12')](_0x94d4('0x13'),_0x23ef86,_0x94d4('0x14'));logger[_0x94d4('0x15')]('VoiceExtension,\x20%s,\x20%s,\x20%s',_0x23ef86,'request\x20sent',JSON['stringify'](_0xe7f878));if(_0xe7f878[_0x94d4('0x16')]){if(_0xe7f878[_0x94d4('0x16')]['code']===0x1f4){logger[_0x94d4('0x16')](_0x94d4('0x13'),_0x23ef86,_0xe7f878['error'][_0x94d4('0x17')]);return _0x2720dd(_0xe7f878['error'][_0x94d4('0x17')]);}logger['error']('VoiceExtension,\x20%s,\x20%s',_0x23ef86,_0xe7f878['error'][_0x94d4('0x17')]);return _0xd7820d(_0xe7f878[_0x94d4('0x16')][_0x94d4('0x17')]);}else{logger['info']('VoiceExtension,\x20%s,\x20%s',_0x23ef86,'request\x20sent');_0xd7820d(_0xe7f878[_0x94d4('0x18')][_0x94d4('0x17')]);}})[_0x94d4('0x19')](function(_0x47b760){logger[_0x94d4('0x16')](_0x94d4('0x13'),_0x23ef86,_0x47b760);_0x2720dd(_0x47b760);});});}exports[_0x94d4('0x1a')]=function(_0x58fbb2){var _0x1d61b7=this;return new Promise(function(_0x3e1482,_0x38486e){return db[_0x94d4('0x1b')]['findAll']({'raw':_0x58fbb2[_0x94d4('0x1c')]?_0x58fbb2['options'][_0x94d4('0x1d')]===undefined?!![]:![]:!![],'where':_0x58fbb2[_0x94d4('0x1c')]?_0x58fbb2[_0x94d4('0x1c')][_0x94d4('0x1e')]||null:null,'attributes':_0x58fbb2['options']?_0x58fbb2[_0x94d4('0x1c')][_0x94d4('0x1f')]||null:null,'limit':_0x58fbb2['options']?_0x58fbb2['options'][_0x94d4('0x20')]||null:null,'include':_0x58fbb2[_0x94d4('0x1c')]?_0x58fbb2[_0x94d4('0x1c')]['include']?_[_0x94d4('0x21')](_0x58fbb2['options'][_0x94d4('0x22')],function(_0x5e3f3b){return{'model':db[_0x5e3f3b[_0x94d4('0x23')]],'as':_0x5e3f3b['as'],'attributes':_0x5e3f3b[_0x94d4('0x1f')],'include':_0x5e3f3b[_0x94d4('0x22')]?_[_0x94d4('0x21')](_0x5e3f3b[_0x94d4('0x22')],function(_0x20d947){return{'model':db[_0x20d947['model']],'as':_0x20d947['as'],'attributes':_0x20d947[_0x94d4('0x1f')],'include':_0x20d947[_0x94d4('0x22')]?_[_0x94d4('0x21')](_0x20d947[_0x94d4('0x22')],function(_0x2c22c0){return{'model':db[_0x2c22c0[_0x94d4('0x23')]],'as':_0x2c22c0['as'],'attributes':_0x2c22c0[_0x94d4('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x94d4('0x11')](function(_0x1cd705){logger[_0x94d4('0x12')]('GetVoiceExtension',_0x58fbb2);logger[_0x94d4('0x15')](_0x94d4('0x1a'),_0x58fbb2,JSON['stringify'](_0x1cd705));_0x3e1482(_0x1cd705);})[_0x94d4('0x19')](function(_0x459af8){logger[_0x94d4('0x16')](_0x94d4('0x1a'),_0x459af8[_0x94d4('0x17')],_0x58fbb2);_0x38486e(_0x1d61b7[_0x94d4('0x16')](0x1f4,_0x459af8[_0x94d4('0x17')]));});});}; \ No newline at end of file +var _0x9f5a=['util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./voiceExtension.socket','info','VoiceExtension,\x20%s,\x20%s','request\x20sent','VoiceExtension,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetVoiceExtension','VoiceExtension','findAll','options','raw','where','attributes','limit','include','map','model','then','debug','lodash'];(function(_0x4aae2d,_0x2c16d7){var _0x4494d2=function(_0x1a776c){while(--_0x1a776c){_0x4aae2d['push'](_0x4aae2d['shift']());}};_0x4494d2(++_0x2c16d7);}(_0x9f5a,0xbd));var _0xa9f5=function(_0x3efa55,_0x55291b){_0x3efa55=_0x3efa55-0x0;var _0x5fa483=_0x9f5a[_0x3efa55];return _0x5fa483;};'use strict';var _=require(_0xa9f5('0x0'));var util=require(_0xa9f5('0x1'));var moment=require(_0xa9f5('0x2'));var BPromise=require(_0xa9f5('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa9f5('0x4'));var db=require(_0xa9f5('0x5'))['db'];var utils=require(_0xa9f5('0x6'));var logger=require('../../config/logger')(_0xa9f5('0x7'));var config=require('../../config/environment');var jayson=require(_0xa9f5('0x8'));var client=jayson[_0xa9f5('0x9')]['http']({'port':0x232a});config[_0xa9f5('0xa')]=_[_0xa9f5('0xb')](config[_0xa9f5('0xa')],{'host':_0xa9f5('0xc'),'port':0x18eb});var socket=require(_0xa9f5('0xd'))(new Redis(config[_0xa9f5('0xa')]));require(_0xa9f5('0xe'))['register'](socket);function respondWithRpcPromise(_0x2e0ff8,_0x2ec4a7,_0x4bb362){return new BPromise(function(_0x194d0d,_0x1f6e40){return client['request'](_0x2e0ff8,_0x4bb362)['then'](function(_0x418ba3){logger[_0xa9f5('0xf')](_0xa9f5('0x10'),_0x2ec4a7,_0xa9f5('0x11'));logger['debug'](_0xa9f5('0x12'),_0x2ec4a7,_0xa9f5('0x11'),JSON[_0xa9f5('0x13')](_0x418ba3));if(_0x418ba3['error']){if(_0x418ba3[_0xa9f5('0x14')][_0xa9f5('0x15')]===0x1f4){logger['error']('VoiceExtension,\x20%s,\x20%s',_0x2ec4a7,_0x418ba3['error'][_0xa9f5('0x16')]);return _0x1f6e40(_0x418ba3['error']['message']);}logger[_0xa9f5('0x14')](_0xa9f5('0x10'),_0x2ec4a7,_0x418ba3[_0xa9f5('0x14')][_0xa9f5('0x16')]);return _0x194d0d(_0x418ba3['error'][_0xa9f5('0x16')]);}else{logger[_0xa9f5('0xf')](_0xa9f5('0x10'),_0x2ec4a7,_0xa9f5('0x11'));_0x194d0d(_0x418ba3[_0xa9f5('0x17')][_0xa9f5('0x16')]);}})[_0xa9f5('0x18')](function(_0x430acb){logger[_0xa9f5('0x14')](_0xa9f5('0x10'),_0x2ec4a7,_0x430acb);_0x1f6e40(_0x430acb);});});}exports[_0xa9f5('0x19')]=function(_0x27a7b0){var _0x4e0c93=this;return new Promise(function(_0x2fb5a3,_0x131f21){return db[_0xa9f5('0x1a')][_0xa9f5('0x1b')]({'raw':_0x27a7b0[_0xa9f5('0x1c')]?_0x27a7b0[_0xa9f5('0x1c')][_0xa9f5('0x1d')]===undefined?!![]:![]:!![],'where':_0x27a7b0['options']?_0x27a7b0[_0xa9f5('0x1c')][_0xa9f5('0x1e')]||null:null,'attributes':_0x27a7b0[_0xa9f5('0x1c')]?_0x27a7b0[_0xa9f5('0x1c')][_0xa9f5('0x1f')]||null:null,'limit':_0x27a7b0[_0xa9f5('0x1c')]?_0x27a7b0[_0xa9f5('0x1c')][_0xa9f5('0x20')]||null:null,'include':_0x27a7b0['options']?_0x27a7b0[_0xa9f5('0x1c')][_0xa9f5('0x21')]?_[_0xa9f5('0x22')](_0x27a7b0[_0xa9f5('0x1c')][_0xa9f5('0x21')],function(_0x31b517){return{'model':db[_0x31b517['model']],'as':_0x31b517['as'],'attributes':_0x31b517[_0xa9f5('0x1f')],'include':_0x31b517['include']?_['map'](_0x31b517['include'],function(_0x3449b6){return{'model':db[_0x3449b6[_0xa9f5('0x23')]],'as':_0x3449b6['as'],'attributes':_0x3449b6[_0xa9f5('0x1f')],'include':_0x3449b6[_0xa9f5('0x21')]?_[_0xa9f5('0x22')](_0x3449b6[_0xa9f5('0x21')],function(_0x51741f){return{'model':db[_0x51741f[_0xa9f5('0x23')]],'as':_0x51741f['as'],'attributes':_0x51741f[_0xa9f5('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xa9f5('0x24')](function(_0x5faf64){logger[_0xa9f5('0xf')](_0xa9f5('0x19'),_0x27a7b0);logger[_0xa9f5('0x25')](_0xa9f5('0x19'),_0x27a7b0,JSON['stringify'](_0x5faf64));_0x2fb5a3(_0x5faf64);})['catch'](function(_0x4a4386){logger[_0xa9f5('0x14')](_0xa9f5('0x19'),_0x4a4386[_0xa9f5('0x16')],_0x27a7b0);_0x131f21(_0x4e0c93[_0xa9f5('0x14')](0x1f4,_0x4a4386[_0xa9f5('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.socket.js b/server/api/voiceExtension/voiceExtension.socket.js index 5bb293c..b89ba71 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 _0xe14b=['removeListener','register','length','./voiceExtension.events','save','emit'];(function(_0x5c0613,_0x307c0c){var _0x3af273=function(_0x1c03f7){while(--_0x1c03f7){_0x5c0613['push'](_0x5c0613['shift']());}};_0x3af273(++_0x307c0c);}(_0xe14b,0x93));var _0xbe14=function(_0x58cf3b,_0x24240b){_0x58cf3b=_0x58cf3b-0x0;var _0x588d6c=_0xe14b[_0x58cf3b];return _0x588d6c;};'use strict';var VoiceExtensionEvents=require(_0xbe14('0x0'));var events=[_0xbe14('0x1'),'remove','update'];function createListener(_0x11c3a0,_0x36393a){return function(_0x48a116){_0x36393a[_0xbe14('0x2')](_0x11c3a0,_0x48a116);};}function removeListener(_0x5ce8fb,_0x496c04){return function(){VoiceExtensionEvents[_0xbe14('0x3')](_0x5ce8fb,_0x496c04);};}exports[_0xbe14('0x4')]=function(_0x1fe204){for(var _0x1ff100=0x0,_0x1d9ade=events[_0xbe14('0x5')];_0x1ff100<_0x1d9ade;_0x1ff100++){var _0x196fca=events[_0x1ff100];var _0x566ae7=createListener('voiceExtension:'+_0x196fca,_0x1fe204);VoiceExtensionEvents['on'](_0x196fca,_0x566ae7);}}; \ No newline at end of file +var _0xabce=['voiceExtension:','./voiceExtension.events','save','remove','update','emit'];(function(_0x2f0e37,_0x1f1706){var _0x84af02=function(_0x37ae06){while(--_0x37ae06){_0x2f0e37['push'](_0x2f0e37['shift']());}};_0x84af02(++_0x1f1706);}(_0xabce,0x103));var _0xeabc=function(_0x2d7f0e,_0x3e6fbd){_0x2d7f0e=_0x2d7f0e-0x0;var _0x110b07=_0xabce[_0x2d7f0e];return _0x110b07;};'use strict';var VoiceExtensionEvents=require(_0xeabc('0x0'));var events=[_0xeabc('0x1'),_0xeabc('0x2'),_0xeabc('0x3')];function createListener(_0x49dbcc,_0x5bd1a4){return function(_0x5ebc95){_0x5bd1a4[_0xeabc('0x4')](_0x49dbcc,_0x5ebc95);};}function removeListener(_0x1d9f37,_0x1a88a7){return function(){VoiceExtensionEvents['removeListener'](_0x1d9f37,_0x1a88a7);};}exports['register']=function(_0x1b07a8){for(var _0x52a4d7=0x0,_0x229ba4=events['length'];_0x52a4d7<_0x229ba4;_0x52a4d7++){var _0x3bdc29=events[_0x52a4d7];var _0x9417af=createListener(_0xeabc('0x5')+_0x3bdc29,_0x1b07a8);VoiceExtensionEvents['on'](_0x3bdc29,_0x9417af);}}; \ No newline at end of file diff --git a/server/api/voiceMail/index.js b/server/api/voiceMail/index.js index 1ac589a..1c72c05 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 _0x53ec=['update','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./voiceMail.controller','isAuthenticated','get','/:id','show','/:id/messages','getMessages','post','create','put'];(function(_0xa6050a,_0x368a6b){var _0x542b24=function(_0x1c9ed3){while(--_0x1c9ed3){_0xa6050a['push'](_0xa6050a['shift']());}};_0x542b24(++_0x368a6b);}(_0x53ec,0x192));var _0xc53e=function(_0x1653b1,_0x35b7d1){_0x1653b1=_0x1653b1-0x0;var _0x3e0b17=_0x53ec[_0x1653b1];return _0x3e0b17;};'use strict';var multer=require(_0xc53e('0x0'));var util=require(_0xc53e('0x1'));var path=require(_0xc53e('0x2'));var timeout=require(_0xc53e('0x3'));var express=require(_0xc53e('0x4'));var router=express[_0xc53e('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xc53e('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xc53e('0x7'));var controller=require(_0xc53e('0x8'));router['get']('/',auth[_0xc53e('0x9')](),controller['index']);router[_0xc53e('0xa')](_0xc53e('0xb'),auth['isAuthenticated'](),controller[_0xc53e('0xc')]);router[_0xc53e('0xa')](_0xc53e('0xd'),auth[_0xc53e('0x9')](),controller[_0xc53e('0xe')]);router[_0xc53e('0xf')]('/',auth[_0xc53e('0x9')](),controller[_0xc53e('0x10')]);router[_0xc53e('0x11')]('/:id',auth['isAuthenticated'](),controller[_0xc53e('0x12')]);router['delete']('/:id',auth[_0xc53e('0x9')](),controller[_0xc53e('0x13')]);module[_0xc53e('0x14')]=router; \ No newline at end of file +var _0xe3da=['exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMail.controller','get','isAuthenticated','index','/:id','show','getMessages','post','create','put','update','destroy'];(function(_0x258061,_0x118acd){var _0x1ff00=function(_0x49cb37){while(--_0x49cb37){_0x258061['push'](_0x258061['shift']());}};_0x1ff00(++_0x118acd);}(_0xe3da,0x1cd));var _0xae3d=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0xe3da[_0x4a9fb1];return _0x348672;};'use strict';var multer=require(_0xae3d('0x0'));var util=require(_0xae3d('0x1'));var path=require(_0xae3d('0x2'));var timeout=require(_0xae3d('0x3'));var express=require(_0xae3d('0x4'));var router=express[_0xae3d('0x5')]();var fs_extra=require(_0xae3d('0x6'));var auth=require(_0xae3d('0x7'));var interaction=require(_0xae3d('0x8'));var config=require(_0xae3d('0x9'));var controller=require(_0xae3d('0xa'));router[_0xae3d('0xb')]('/',auth[_0xae3d('0xc')](),controller[_0xae3d('0xd')]);router[_0xae3d('0xb')](_0xae3d('0xe'),auth['isAuthenticated'](),controller[_0xae3d('0xf')]);router[_0xae3d('0xb')]('/:id/messages',auth['isAuthenticated'](),controller[_0xae3d('0x10')]);router[_0xae3d('0x11')]('/',auth[_0xae3d('0xc')](),controller[_0xae3d('0x12')]);router[_0xae3d('0x13')](_0xae3d('0xe'),auth['isAuthenticated'](),controller[_0xae3d('0x14')]);router['delete'](_0xae3d('0xe'),auth[_0xae3d('0xc')](),controller[_0xae3d('0x15')]);module[_0xae3d('0x16')]=router; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.attributes.js b/server/api/voiceMail/voiceMail.attributes.js index 45fa922..442093f 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 _0x9d37=['contest_mailbox','email','trim','ENUM','yes','TINYINT(4)','TIMESTAMP','INTEGER','VIRTUAL','getDataValue','fullname','\x20-\x20','sequelize','exports','STRING','from-voicemail'];(function(_0x3c1e0a,_0x428fc9){var _0xd7a87d=function(_0x478835){while(--_0x478835){_0x3c1e0a['push'](_0x3c1e0a['shift']());}};_0xd7a87d(++_0x428fc9);}(_0x9d37,0x1bc));var _0x79d3=function(_0x4322c4,_0x3abe77){_0x4322c4=_0x4322c4-0x0;var _0x36f55e=_0x9d37[_0x4322c4];return _0x36f55e;};'use strict';var Sequelize=require(_0x79d3('0x0'));module[_0x79d3('0x1')]={'customer_id':{'type':Sequelize[_0x79d3('0x2')]},'context':{'type':Sequelize['STRING'],'defaultValue':_0x79d3('0x3'),'unique':_0x79d3('0x4')},'mailbox':{'type':Sequelize[_0x79d3('0x2')],'defaultValue':'','allowNull':![],'unique':_0x79d3('0x4')},'password':{'type':Sequelize[_0x79d3('0x2')]},'fullname':{'type':Sequelize[_0x79d3('0x2')]},'email':{'type':Sequelize[_0x79d3('0x2')],'validate':{'isEmail':!![]},'set':function(_0x37aeb8){this['setDataValue'](_0x79d3('0x5'),typeof _0x37aeb8==='string'&&_0x37aeb8[_0x79d3('0x6')]()?_0x37aeb8[_0x79d3('0x6')]():null);}},'pager':{'type':Sequelize['STRING']},'tz':{'type':Sequelize[_0x79d3('0x2')],'defaultValue':'central'},'attach':{'type':Sequelize[_0x79d3('0x7')](_0x79d3('0x8'),'no'),'defaultValue':_0x79d3('0x8'),'allowNull':![]},'saycid':{'type':Sequelize[_0x79d3('0x7')](_0x79d3('0x8'),'no'),'defaultValue':'yes','allowNull':![]},'dialout':{'type':Sequelize[_0x79d3('0x2')]},'callback':{'type':Sequelize['STRING']},'review':{'type':Sequelize[_0x79d3('0x7')](_0x79d3('0x8'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize[_0x79d3('0x7')]('yes','no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0x79d3('0x7')](_0x79d3('0x8'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0x79d3('0x7')](_0x79d3('0x8'),'no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0x79d3('0x9'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0x79d3('0x7')]('yes','no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'yes','allowNull':![]},'forcename':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0x79d3('0x7')](_0x79d3('0x8'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize[_0x79d3('0x7')]('yes','no'),'defaultValue':_0x79d3('0x8'),'allowNull':![]},'stamp':{'type':_0x79d3('0xa')},'emailsubject':{'type':Sequelize[_0x79d3('0x2')]},'emailbody':{'type':Sequelize[_0x79d3('0x2')]},'maxsecs':{'type':Sequelize[_0x79d3('0xb')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0x79d3('0xb')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0x79d3('0xc')],'get':function(){return this[_0x79d3('0xd')](_0x79d3('0xe'))+_0x79d3('0xf')+this[_0x79d3('0xd')]('mailbox');}}}; \ No newline at end of file +var _0xb532=['VIRTUAL','getDataValue','\x20-\x20','sequelize','exports','STRING','from-voicemail','contest_mailbox','setDataValue','email','string','trim','central','ENUM','yes','TINYINT(4)','INTEGER'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0xb532,0x1f0));var _0x2b53=function(_0x180e11,_0x24bfb8){_0x180e11=_0x180e11-0x0;var _0x330930=_0xb532[_0x180e11];return _0x330930;};'use strict';var Sequelize=require(_0x2b53('0x0'));module[_0x2b53('0x1')]={'customer_id':{'type':Sequelize[_0x2b53('0x2')]},'context':{'type':Sequelize[_0x2b53('0x2')],'defaultValue':_0x2b53('0x3'),'unique':_0x2b53('0x4')},'mailbox':{'type':Sequelize[_0x2b53('0x2')],'defaultValue':'','allowNull':![],'unique':_0x2b53('0x4')},'password':{'type':Sequelize['STRING']},'fullname':{'type':Sequelize[_0x2b53('0x2')]},'email':{'type':Sequelize[_0x2b53('0x2')],'validate':{'isEmail':!![]},'set':function(_0x448305){this[_0x2b53('0x5')](_0x2b53('0x6'),typeof _0x448305===_0x2b53('0x7')&&_0x448305['trim']()?_0x448305[_0x2b53('0x8')]():null);}},'pager':{'type':Sequelize[_0x2b53('0x2')]},'tz':{'type':Sequelize[_0x2b53('0x2')],'defaultValue':_0x2b53('0x9')},'attach':{'type':Sequelize[_0x2b53('0xa')](_0x2b53('0xb'),'no'),'defaultValue':'yes','allowNull':![]},'saycid':{'type':Sequelize['ENUM'](_0x2b53('0xb'),'no'),'defaultValue':'yes','allowNull':![]},'dialout':{'type':Sequelize['STRING']},'callback':{'type':Sequelize[_0x2b53('0x2')]},'review':{'type':Sequelize[_0x2b53('0xa')](_0x2b53('0xb'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize[_0x2b53('0xa')](_0x2b53('0xb'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize['ENUM'](_0x2b53('0xb'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0x2b53('0xa')](_0x2b53('0xb'),'no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0x2b53('0xc'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0x2b53('0xa')](_0x2b53('0xb'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0x2b53('0xa')]('yes','no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0x2b53('0xa')]('yes','no'),'defaultValue':_0x2b53('0xb'),'allowNull':![]},'forcename':{'type':Sequelize[_0x2b53('0xa')](_0x2b53('0xb'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize[_0x2b53('0xa')]('yes','no'),'defaultValue':_0x2b53('0xb'),'allowNull':![]},'stamp':{'type':'TIMESTAMP'},'emailsubject':{'type':Sequelize['STRING']},'emailbody':{'type':Sequelize['STRING']},'maxsecs':{'type':Sequelize['INTEGER'](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0x2b53('0xd')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0x2b53('0xe')],'get':function(){return this[_0x2b53('0xf')]('fullname')+_0x2b53('0x10')+this[_0x2b53('0xf')]('mailbox');}}}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.controller.js b/server/api/voiceMail/voiceMail.controller.js index ecf02a2..5fe0d86 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 _0xe5b5=['stack','name','map','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','limit','sort','filter','where','merge','options','VoiceMail','includeAll','include','findAll','catch','length','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','getMessages','VoiceMailMessage','pick','mailbox','findAndCountAll','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','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','sendStatus','status','end','offset','undefined','count','Content-Range','json','apply','reject','save','update','then','destroy','get','Voicemails','UserProfileResource','error'];(function(_0xaa1b3e,_0x47d976){var _0x454d7d=function(_0x575b32){while(--_0x575b32){_0xaa1b3e['push'](_0xaa1b3e['shift']());}};_0x454d7d(++_0x47d976);}(_0xe5b5,0x12b));var _0x5e5b=function(_0x45fc6a,_0x166adb){_0x45fc6a=_0x45fc6a-0x0;var _0x14bcfd=_0xe5b5[_0x45fc6a];return _0x14bcfd;};'use strict';var emlformat=require(_0x5e5b('0x0'));var rimraf=require(_0x5e5b('0x1'));var zipdir=require(_0x5e5b('0x2'));var jsonpatch=require(_0x5e5b('0x3'));var rp=require(_0x5e5b('0x4'));var moment=require(_0x5e5b('0x5'));var BPromise=require(_0x5e5b('0x6'));var Mustache=require(_0x5e5b('0x7'));var util=require(_0x5e5b('0x8'));var path=require(_0x5e5b('0x9'));var sox=require(_0x5e5b('0xa'));var csv=require(_0x5e5b('0xb'));var ejs=require(_0x5e5b('0xc'));var fs=require('fs');var fs_extra=require(_0x5e5b('0xd'));var _=require(_0x5e5b('0xe'));var squel=require(_0x5e5b('0xf'));var crypto=require(_0x5e5b('0x10'));var jsforce=require(_0x5e5b('0x11'));var deskjs=require(_0x5e5b('0x12'));var toCsv=require(_0x5e5b('0xb'));var querystring=require(_0x5e5b('0x13'));var Papa=require(_0x5e5b('0x14'));var Redis=require(_0x5e5b('0x15'));var authService=require('../../components/auth/service');var qs=require(_0x5e5b('0x16'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5e5b('0x17'));var logger=require(_0x5e5b('0x18'))(_0x5e5b('0x19'));var utils=require(_0x5e5b('0x1a'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x310f71,_0x18434e){_0x18434e=_0x18434e||0xcc;return function(_0x4559a0){if(_0x4559a0){return _0x310f71[_0x5e5b('0x1b')](_0x18434e);}return _0x310f71[_0x5e5b('0x1c')](_0x18434e)[_0x5e5b('0x1d')]();};}function respondWithResult(_0x2e331d,_0x49edd0){_0x49edd0=_0x49edd0||0xc8;return function(_0x2b37fa){if(_0x2b37fa){return _0x2e331d[_0x5e5b('0x1c')](_0x49edd0)['json'](_0x2b37fa);}};}function respondWithFilteredResult(_0x227417,_0x578c14){return function(_0x4e9509){if(_0x4e9509){var _0x13a1cb=typeof _0x578c14[_0x5e5b('0x1e')]===_0x5e5b('0x1f')&&typeof _0x578c14['limit']===_0x5e5b('0x1f');var _0x4d490c=_0x4e9509[_0x5e5b('0x20')];var _0x45a091=_0x13a1cb?0x0:_0x578c14['offset'];var _0xe5aa6b=_0x13a1cb?_0x4e9509[_0x5e5b('0x20')]:_0x578c14[_0x5e5b('0x1e')]+_0x578c14['limit'];var _0x2bf0b7;if(_0xe5aa6b>=_0x4d490c){_0xe5aa6b=_0x4d490c;_0x2bf0b7=0xc8;}else{_0x2bf0b7=0xce;}_0x227417[_0x5e5b('0x1c')](_0x2bf0b7);return _0x227417['set'](_0x5e5b('0x21'),_0x45a091+'-'+_0xe5aa6b+'/'+_0x4d490c)[_0x5e5b('0x22')](_0x4e9509);}return null;};}function patchUpdates(_0x3c488e){return function(_0x2d8252){try{jsonpatch[_0x5e5b('0x23')](_0x2d8252,_0x3c488e,!![]);}catch(_0x33d61b){return BPromise[_0x5e5b('0x24')](_0x33d61b);}return _0x2d8252[_0x5e5b('0x25')]();};}function saveUpdates(_0x4a78e3,_0x512e46){return function(_0x256a00){if(_0x256a00){return _0x256a00[_0x5e5b('0x26')](_0x4a78e3)[_0x5e5b('0x27')](function(_0xe1c268){return _0xe1c268;});}return null;};}function removeEntity(_0x2e38ed,_0x28cd95){return function(_0x135c6c){if(_0x135c6c){return _0x135c6c[_0x5e5b('0x28')]()[_0x5e5b('0x27')](function(){var _0x26bc02=_0x135c6c[_0x5e5b('0x29')]({'plain':!![]});var _0x4da321=_0x5e5b('0x2a');return db[_0x5e5b('0x2b')][_0x5e5b('0x28')]({'where':{'type':_0x4da321,'resourceId':_0x26bc02['id']}})['then'](function(){return _0x135c6c;});})[_0x5e5b('0x27')](function(){_0x2e38ed[_0x5e5b('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x13ff91,_0x21c74b){return function(_0x39ce16){if(!_0x39ce16){_0x13ff91[_0x5e5b('0x1b')](0x194);}return _0x39ce16;};}function handleError(_0x31af09,_0x250fbd){_0x250fbd=_0x250fbd||0x1f4;return function(_0x2cb695){logger[_0x5e5b('0x2c')](_0x2cb695[_0x5e5b('0x2d')]);if(_0x2cb695[_0x5e5b('0x2e')]){delete _0x2cb695[_0x5e5b('0x2e')];}_0x31af09[_0x5e5b('0x1c')](_0x250fbd)['send'](_0x2cb695);};}exports['index']=function(_0x365f6f,_0x289f54){var _0xb68419={},_0x3dcdab={},_0x12f1ee={'count':0x0,'rows':[]};var _0x4b9be8=_[_0x5e5b('0x2f')](db['VoiceMail'][_0x5e5b('0x30')],function(_0x384d8f){return{'name':_0x384d8f[_0x5e5b('0x31')],'type':_0x384d8f[_0x5e5b('0x32')]['key']};});_0x3dcdab[_0x5e5b('0x33')]=_[_0x5e5b('0x2f')](_0x4b9be8,'name');_0x3dcdab[_0x5e5b('0x34')]=_[_0x5e5b('0x35')](_0x365f6f[_0x5e5b('0x34')]);_0x3dcdab[_0x5e5b('0x36')]=_[_0x5e5b('0x37')](_0x3dcdab[_0x5e5b('0x33')],_0x3dcdab[_0x5e5b('0x34')]);_0xb68419[_0x5e5b('0x38')]=_['intersection'](_0x3dcdab[_0x5e5b('0x33')],qs[_0x5e5b('0x39')](_0x365f6f[_0x5e5b('0x34')][_0x5e5b('0x39')]));_0xb68419[_0x5e5b('0x38')]=_0xb68419[_0x5e5b('0x38')]['length']?_0xb68419['attributes']:_0x3dcdab[_0x5e5b('0x33')];if(!_0x365f6f[_0x5e5b('0x34')][_0x5e5b('0x3a')]('nolimit')){_0xb68419[_0x5e5b('0x3b')]=qs[_0x5e5b('0x3b')](_0x365f6f[_0x5e5b('0x34')][_0x5e5b('0x3b')]);_0xb68419['offset']=qs[_0x5e5b('0x1e')](_0x365f6f[_0x5e5b('0x34')]['offset']);}_0xb68419['order']=qs[_0x5e5b('0x3c')](_0x365f6f[_0x5e5b('0x34')][_0x5e5b('0x3c')]);_0xb68419['where']=qs[_0x5e5b('0x36')](_['pick'](_0x365f6f['query'],_0x3dcdab[_0x5e5b('0x36')]),_0x4b9be8);if(_0x365f6f[_0x5e5b('0x34')][_0x5e5b('0x3d')]){_0xb68419[_0x5e5b('0x3e')]=_[_0x5e5b('0x3f')](_0xb68419[_0x5e5b('0x3e')],{'$or':_[_0x5e5b('0x2f')](_0x4b9be8,function(_0x14ac35){if(_0x14ac35[_0x5e5b('0x32')]!=='VIRTUAL'){var _0x1f1907={};_0x1f1907[_0x14ac35[_0x5e5b('0x2e')]]={'$like':'%'+_0x365f6f['query'][_0x5e5b('0x3d')]+'%'};return _0x1f1907;}})});}_0xb68419=_['merge']({},_0xb68419,_0x365f6f[_0x5e5b('0x40')]);var _0x14b152={'where':_0xb68419[_0x5e5b('0x3e')]};return db[_0x5e5b('0x41')][_0x5e5b('0x20')](_0x14b152)[_0x5e5b('0x27')](function(_0x371550){_0x12f1ee[_0x5e5b('0x20')]=_0x371550;if(_0x365f6f[_0x5e5b('0x34')][_0x5e5b('0x42')]){_0xb68419[_0x5e5b('0x43')]=[{'all':!![]}];}return db['VoiceMail'][_0x5e5b('0x44')](_0xb68419);})[_0x5e5b('0x27')](function(_0x46fec9){_0x12f1ee['rows']=_0x46fec9;return _0x12f1ee;})[_0x5e5b('0x27')](respondWithFilteredResult(_0x289f54,_0xb68419))[_0x5e5b('0x45')](handleError(_0x289f54,null));};exports['show']=function(_0x6672d9,_0x44b7be){var _0x5d3135={'raw':!![],'where':{'id':_0x6672d9['params']['id']}},_0x257bb7={};_0x257bb7['model']=_['keys'](db[_0x5e5b('0x41')]['rawAttributes']);_0x257bb7[_0x5e5b('0x34')]=_['keys'](_0x6672d9[_0x5e5b('0x34')]);_0x257bb7[_0x5e5b('0x36')]=_[_0x5e5b('0x37')](_0x257bb7[_0x5e5b('0x33')],_0x257bb7[_0x5e5b('0x34')]);_0x5d3135[_0x5e5b('0x38')]=_[_0x5e5b('0x37')](_0x257bb7['model'],qs['fields'](_0x6672d9[_0x5e5b('0x34')]['fields']));_0x5d3135['attributes']=_0x5d3135['attributes'][_0x5e5b('0x46')]?_0x5d3135['attributes']:_0x257bb7[_0x5e5b('0x33')];if(_0x6672d9[_0x5e5b('0x34')][_0x5e5b('0x42')]){_0x5d3135[_0x5e5b('0x43')]=[{'all':!![]}];}_0x5d3135=_[_0x5e5b('0x3f')]({},_0x5d3135,_0x6672d9[_0x5e5b('0x40')]);return db['VoiceMail'][_0x5e5b('0x47')](_0x5d3135)[_0x5e5b('0x27')](handleEntityNotFound(_0x44b7be,null))['then'](respondWithResult(_0x44b7be,null))[_0x5e5b('0x45')](handleError(_0x44b7be,null));};exports['create']=function(_0x41e4b3,_0x36d8fa){return db[_0x5e5b('0x41')][_0x5e5b('0x48')](_0x41e4b3['body'],{})[_0x5e5b('0x27')](function(_0x1c4efe){var _0x4f4ea3=_0x41e4b3[_0x5e5b('0x49')][_0x5e5b('0x29')]({'plain':!![]});if(!_0x4f4ea3)throw new Error(_0x5e5b('0x4a'));if(_0x4f4ea3[_0x5e5b('0x4b')]===_0x5e5b('0x49')){var _0x5ae8d0=_0x1c4efe['get']({'plain':!![]});var _0x690f8c=_0x5e5b('0x2a');return db['UserProfileSection'][_0x5e5b('0x47')]({'where':{'name':_0x690f8c,'userProfileId':_0x4f4ea3[_0x5e5b('0x4c')]},'raw':!![]})[_0x5e5b('0x27')](function(_0x5a9eae){if(_0x5a9eae&&_0x5a9eae[_0x5e5b('0x4d')]===0x0){return db[_0x5e5b('0x2b')][_0x5e5b('0x48')]({'name':_0x5ae8d0['name'],'resourceId':_0x5ae8d0['id'],'type':_0x5a9eae[_0x5e5b('0x2e')],'sectionId':_0x5a9eae['id']},{})[_0x5e5b('0x27')](function(){return _0x1c4efe;});}else{return _0x1c4efe;}})[_0x5e5b('0x45')](function(_0x4a4e0f){logger['error'](_0x5e5b('0x4e'),_0x4a4e0f);throw _0x4a4e0f;});}return _0x1c4efe;})['then'](respondWithResult(_0x36d8fa,0xc9))['catch'](handleError(_0x36d8fa,null));};exports[_0x5e5b('0x26')]=function(_0x13eee9,_0x4774ee){if(_0x13eee9['body']['id']){delete _0x13eee9[_0x5e5b('0x4f')]['id'];}return db[_0x5e5b('0x41')][_0x5e5b('0x47')]({'where':{'id':_0x13eee9[_0x5e5b('0x50')]['id']}})[_0x5e5b('0x27')](handleEntityNotFound(_0x4774ee,null))[_0x5e5b('0x27')](saveUpdates(_0x13eee9['body'],null))['then'](respondWithResult(_0x4774ee,null))[_0x5e5b('0x45')](handleError(_0x4774ee,null));};exports[_0x5e5b('0x28')]=function(_0x1cc741,_0x357e55){return db['VoiceMail'][_0x5e5b('0x47')]({'where':{'id':_0x1cc741['params']['id']}})[_0x5e5b('0x27')](handleEntityNotFound(_0x357e55,null))[_0x5e5b('0x27')](removeEntity(_0x357e55,null))[_0x5e5b('0x45')](handleError(_0x357e55,null));};exports[_0x5e5b('0x51')]=function(_0x2d17b0,_0x30b010,_0x275930){return db[_0x5e5b('0x41')]['findOne']({'where':{'id':_0x2d17b0[_0x5e5b('0x50')]['id']}})[_0x5e5b('0x27')](handleEntityNotFound(_0x30b010,null))[_0x5e5b('0x27')](function(_0x1aea38){var _0x129026;var _0x5543eb={},_0x2ccee2={};_0x2ccee2[_0x5e5b('0x33')]=_[_0x5e5b('0x35')](db[_0x5e5b('0x52')][_0x5e5b('0x30')]);_0x2ccee2['query']=_[_0x5e5b('0x35')](_0x2d17b0['query']);_0x2ccee2[_0x5e5b('0x36')]=_['intersection'](_0x2ccee2[_0x5e5b('0x33')],_0x2ccee2[_0x5e5b('0x34')]);_0x5543eb[_0x5e5b('0x38')]=_[_0x5e5b('0x37')](_0x2ccee2[_0x5e5b('0x33')],qs[_0x5e5b('0x39')](_0x2d17b0['query'][_0x5e5b('0x39')]));_0x5543eb[_0x5e5b('0x38')]=_0x5543eb[_0x5e5b('0x38')][_0x5e5b('0x46')]?_0x5543eb['attributes']:_0x2ccee2['model'];if(!_0x2d17b0[_0x5e5b('0x34')][_0x5e5b('0x3a')]('nolimit')){_0x5543eb[_0x5e5b('0x3b')]=qs[_0x5e5b('0x3b')](_0x2d17b0[_0x5e5b('0x34')][_0x5e5b('0x3b')]);_0x5543eb[_0x5e5b('0x1e')]=qs['offset'](_0x2d17b0[_0x5e5b('0x34')][_0x5e5b('0x1e')]);}_0x5543eb['order']=qs['sort'](_0x2d17b0['query'][_0x5e5b('0x3c')]);_0x5543eb[_0x5e5b('0x3e')]=qs[_0x5e5b('0x36')](_[_0x5e5b('0x53')](_0x2d17b0[_0x5e5b('0x34')],_0x2ccee2['filters']));if(_0x2d17b0[_0x5e5b('0x34')][_0x5e5b('0x3d')]){_0x5543eb['where']=_[_0x5e5b('0x3f')](_0x5543eb['where'],{'$or':_['map'](_0x5543eb[_0x5e5b('0x38')],function(_0x4fa0db){var _0x454026={};_0x454026[_0x4fa0db]={'$like':'%'+_0x2d17b0[_0x5e5b('0x34')][_0x5e5b('0x3d')]+'%'};return _0x454026;})});}_0x5543eb[_0x5e5b('0x3e')]=_[_0x5e5b('0x3f')](_0x5543eb['where'],{'mailboxuser':_0x1aea38[_0x5e5b('0x54')]});_0x5543eb=_[_0x5e5b('0x3f')]({},_0x5543eb,_0x2d17b0[_0x5e5b('0x40')]);return db[_0x5e5b('0x52')][_0x5e5b('0x55')](_0x5543eb)[_0x5e5b('0x27')](respondWithFilteredResult(_0x30b010,_0x5543eb));})[_0x5e5b('0x45')](handleError(_0x30b010,null));}; \ No newline at end of file +var _0x373d=['count','set','Content-Range','apply','reject','save','update','then','destroy','get','Voicemails','UserProfileResource','error','stack','name','index','map','rawAttributes','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','merge','filter','VoiceMail','include','findAll','catch','show','includeAll','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','getMessages','findOne','VoiceMailMessage','nolimit','pick','mailbox','options','findAndCountAll','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','ejs','fs-extra','lodash','squel','jsforce','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','json','offset','undefined','limit'];(function(_0x51216f,_0x256e7e){var _0x48c2bc=function(_0x54a075){while(--_0x54a075){_0x51216f['push'](_0x51216f['shift']());}};_0x48c2bc(++_0x256e7e);}(_0x373d,0x1e2));var _0xd373=function(_0x3cadbd,_0x12bc43){_0x3cadbd=_0x3cadbd-0x0;var _0x296da9=_0x373d[_0x3cadbd];return _0x296da9;};'use strict';var emlformat=require(_0xd373('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd373('0x1'));var jsonpatch=require(_0xd373('0x2'));var rp=require(_0xd373('0x3'));var moment=require(_0xd373('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xd373('0x5'));var util=require(_0xd373('0x6'));var path=require(_0xd373('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xd373('0x8'));var fs=require('fs');var fs_extra=require(_0xd373('0x9'));var _=require(_0xd373('0xa'));var squel=require(_0xd373('0xb'));var crypto=require('crypto');var jsforce=require(_0xd373('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xd373('0xd'));var Redis=require(_0xd373('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xd373('0xf'));var as=require(_0xd373('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xd373('0x11'));var utils=require(_0xd373('0x12'));var config=require(_0xd373('0x13'));var licenseUtil=require(_0xd373('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4c7f91,_0x5ab89c){_0x5ab89c=_0x5ab89c||0xcc;return function(_0xcd9b8c){if(_0xcd9b8c){return _0x4c7f91[_0xd373('0x15')](_0x5ab89c);}return _0x4c7f91['status'](_0x5ab89c)[_0xd373('0x16')]();};}function respondWithResult(_0x129475,_0x27c161){_0x27c161=_0x27c161||0xc8;return function(_0x23ed86){if(_0x23ed86){return _0x129475[_0xd373('0x17')](_0x27c161)[_0xd373('0x18')](_0x23ed86);}};}function respondWithFilteredResult(_0x20aca5,_0x2eacb1){return function(_0x5a286a){if(_0x5a286a){var _0x2c5854=typeof _0x2eacb1[_0xd373('0x19')]===_0xd373('0x1a')&&typeof _0x2eacb1[_0xd373('0x1b')]==='undefined';var _0x1e26cf=_0x5a286a['count'];var _0x460259=_0x2c5854?0x0:_0x2eacb1[_0xd373('0x19')];var _0x55c5c7=_0x2c5854?_0x5a286a[_0xd373('0x1c')]:_0x2eacb1['offset']+_0x2eacb1['limit'];var _0x23fada;if(_0x55c5c7>=_0x1e26cf){_0x55c5c7=_0x1e26cf;_0x23fada=0xc8;}else{_0x23fada=0xce;}_0x20aca5[_0xd373('0x17')](_0x23fada);return _0x20aca5[_0xd373('0x1d')](_0xd373('0x1e'),_0x460259+'-'+_0x55c5c7+'/'+_0x1e26cf)[_0xd373('0x18')](_0x5a286a);}return null;};}function patchUpdates(_0x181eb2){return function(_0x4ba510){try{jsonpatch[_0xd373('0x1f')](_0x4ba510,_0x181eb2,!![]);}catch(_0xd808f8){return BPromise[_0xd373('0x20')](_0xd808f8);}return _0x4ba510[_0xd373('0x21')]();};}function saveUpdates(_0x165e21,_0x3aa1c5){return function(_0x4f64bd){if(_0x4f64bd){return _0x4f64bd[_0xd373('0x22')](_0x165e21)[_0xd373('0x23')](function(_0x157f81){return _0x157f81;});}return null;};}function removeEntity(_0x209ca7,_0x217ee7){return function(_0x238ffd){if(_0x238ffd){return _0x238ffd[_0xd373('0x24')]()[_0xd373('0x23')](function(){var _0x1ab540=_0x238ffd[_0xd373('0x25')]({'plain':!![]});var _0x437110=_0xd373('0x26');return db[_0xd373('0x27')][_0xd373('0x24')]({'where':{'type':_0x437110,'resourceId':_0x1ab540['id']}})[_0xd373('0x23')](function(){return _0x238ffd;});})[_0xd373('0x23')](function(){_0x209ca7[_0xd373('0x17')](0xcc)[_0xd373('0x16')]();});}};}function handleEntityNotFound(_0x3e657b,_0x470612){return function(_0x45ee58){if(!_0x45ee58){_0x3e657b[_0xd373('0x15')](0x194);}return _0x45ee58;};}function handleError(_0x71c5c,_0x3384a5){_0x3384a5=_0x3384a5||0x1f4;return function(_0xf85ca8){logger[_0xd373('0x28')](_0xf85ca8[_0xd373('0x29')]);if(_0xf85ca8[_0xd373('0x2a')]){delete _0xf85ca8[_0xd373('0x2a')];}_0x71c5c[_0xd373('0x17')](_0x3384a5)['send'](_0xf85ca8);};}exports[_0xd373('0x2b')]=function(_0x490842,_0x498aaa){var _0xedc8f3={},_0x15da6c={},_0x25e016={'count':0x0,'rows':[]};var _0x23024c=_[_0xd373('0x2c')](db['VoiceMail'][_0xd373('0x2d')],function(_0x104156){return{'name':_0x104156['fieldName'],'type':_0x104156[_0xd373('0x2e')][_0xd373('0x2f')]};});_0x15da6c[_0xd373('0x30')]=_[_0xd373('0x2c')](_0x23024c,_0xd373('0x2a'));_0x15da6c[_0xd373('0x31')]=_[_0xd373('0x32')](_0x490842[_0xd373('0x31')]);_0x15da6c[_0xd373('0x33')]=_['intersection'](_0x15da6c[_0xd373('0x30')],_0x15da6c[_0xd373('0x31')]);_0xedc8f3[_0xd373('0x34')]=_[_0xd373('0x35')](_0x15da6c[_0xd373('0x30')],qs[_0xd373('0x36')](_0x490842[_0xd373('0x31')][_0xd373('0x36')]));_0xedc8f3[_0xd373('0x34')]=_0xedc8f3[_0xd373('0x34')][_0xd373('0x37')]?_0xedc8f3[_0xd373('0x34')]:_0x15da6c[_0xd373('0x30')];if(!_0x490842[_0xd373('0x31')][_0xd373('0x38')]('nolimit')){_0xedc8f3[_0xd373('0x1b')]=qs[_0xd373('0x1b')](_0x490842[_0xd373('0x31')][_0xd373('0x1b')]);_0xedc8f3['offset']=qs[_0xd373('0x19')](_0x490842[_0xd373('0x31')][_0xd373('0x19')]);}_0xedc8f3[_0xd373('0x39')]=qs[_0xd373('0x3a')](_0x490842[_0xd373('0x31')]['sort']);_0xedc8f3['where']=qs[_0xd373('0x33')](_['pick'](_0x490842[_0xd373('0x31')],_0x15da6c[_0xd373('0x33')]),_0x23024c);if(_0x490842[_0xd373('0x31')]['filter']){_0xedc8f3[_0xd373('0x3b')]=_[_0xd373('0x3c')](_0xedc8f3[_0xd373('0x3b')],{'$or':_[_0xd373('0x2c')](_0x23024c,function(_0x504450){if(_0x504450['type']!=='VIRTUAL'){var _0x11ec1b={};_0x11ec1b[_0x504450['name']]={'$like':'%'+_0x490842[_0xd373('0x31')][_0xd373('0x3d')]+'%'};return _0x11ec1b;}})});}_0xedc8f3=_['merge']({},_0xedc8f3,_0x490842['options']);var _0x5f3dd5={'where':_0xedc8f3[_0xd373('0x3b')]};return db[_0xd373('0x3e')][_0xd373('0x1c')](_0x5f3dd5)['then'](function(_0x5c3b22){_0x25e016[_0xd373('0x1c')]=_0x5c3b22;if(_0x490842[_0xd373('0x31')]['includeAll']){_0xedc8f3[_0xd373('0x3f')]=[{'all':!![]}];}return db[_0xd373('0x3e')][_0xd373('0x40')](_0xedc8f3);})[_0xd373('0x23')](function(_0x2d8c7d){_0x25e016['rows']=_0x2d8c7d;return _0x25e016;})['then'](respondWithFilteredResult(_0x498aaa,_0xedc8f3))[_0xd373('0x41')](handleError(_0x498aaa,null));};exports[_0xd373('0x42')]=function(_0x30b423,_0x302f65){var _0x5d4dd2={'raw':!![],'where':{'id':_0x30b423['params']['id']}},_0x29725c={};_0x29725c[_0xd373('0x30')]=_[_0xd373('0x32')](db[_0xd373('0x3e')][_0xd373('0x2d')]);_0x29725c[_0xd373('0x31')]=_['keys'](_0x30b423[_0xd373('0x31')]);_0x29725c[_0xd373('0x33')]=_['intersection'](_0x29725c[_0xd373('0x30')],_0x29725c[_0xd373('0x31')]);_0x5d4dd2[_0xd373('0x34')]=_[_0xd373('0x35')](_0x29725c[_0xd373('0x30')],qs[_0xd373('0x36')](_0x30b423[_0xd373('0x31')][_0xd373('0x36')]));_0x5d4dd2[_0xd373('0x34')]=_0x5d4dd2[_0xd373('0x34')]['length']?_0x5d4dd2['attributes']:_0x29725c[_0xd373('0x30')];if(_0x30b423['query'][_0xd373('0x43')]){_0x5d4dd2['include']=[{'all':!![]}];}_0x5d4dd2=_['merge']({},_0x5d4dd2,_0x30b423['options']);return db[_0xd373('0x3e')][_0xd373('0x44')](_0x5d4dd2)[_0xd373('0x23')](handleEntityNotFound(_0x302f65,null))[_0xd373('0x23')](respondWithResult(_0x302f65,null))[_0xd373('0x41')](handleError(_0x302f65,null));};exports[_0xd373('0x45')]=function(_0x1855aa,_0x4d1088){return db[_0xd373('0x3e')]['create'](_0x1855aa[_0xd373('0x46')],{})[_0xd373('0x23')](function(_0x5502e5){var _0x4517ab=_0x1855aa['user'][_0xd373('0x25')]({'plain':!![]});if(!_0x4517ab)throw new Error(_0xd373('0x47'));if(_0x4517ab[_0xd373('0x48')]===_0xd373('0x49')){var _0xe22cbd=_0x5502e5['get']({'plain':!![]});var _0x4971a0='Voicemails';return db[_0xd373('0x4a')][_0xd373('0x44')]({'where':{'name':_0x4971a0,'userProfileId':_0x4517ab['userProfileId']},'raw':!![]})[_0xd373('0x23')](function(_0x3e6766){if(_0x3e6766&&_0x3e6766['autoAssociation']===0x0){return db[_0xd373('0x27')][_0xd373('0x45')]({'name':_0xe22cbd[_0xd373('0x2a')],'resourceId':_0xe22cbd['id'],'type':_0x3e6766[_0xd373('0x2a')],'sectionId':_0x3e6766['id']},{})[_0xd373('0x23')](function(){return _0x5502e5;});}else{return _0x5502e5;}})[_0xd373('0x41')](function(_0xc255ec){logger[_0xd373('0x28')](_0xd373('0x4b'),_0xc255ec);throw _0xc255ec;});}return _0x5502e5;})[_0xd373('0x23')](respondWithResult(_0x4d1088,0xc9))[_0xd373('0x41')](handleError(_0x4d1088,null));};exports['update']=function(_0x4b2645,_0x51ca73){if(_0x4b2645['body']['id']){delete _0x4b2645['body']['id'];}return db['VoiceMail'][_0xd373('0x44')]({'where':{'id':_0x4b2645[_0xd373('0x4c')]['id']}})['then'](handleEntityNotFound(_0x51ca73,null))['then'](saveUpdates(_0x4b2645['body'],null))[_0xd373('0x23')](respondWithResult(_0x51ca73,null))[_0xd373('0x41')](handleError(_0x51ca73,null));};exports['destroy']=function(_0x52fa5b,_0x2230d6){return db[_0xd373('0x3e')][_0xd373('0x44')]({'where':{'id':_0x52fa5b[_0xd373('0x4c')]['id']}})[_0xd373('0x23')](handleEntityNotFound(_0x2230d6,null))['then'](removeEntity(_0x2230d6,null))[_0xd373('0x41')](handleError(_0x2230d6,null));};exports[_0xd373('0x4d')]=function(_0x386e4c,_0x213da6,_0xc607fb){return db[_0xd373('0x3e')][_0xd373('0x4e')]({'where':{'id':_0x386e4c[_0xd373('0x4c')]['id']}})[_0xd373('0x23')](handleEntityNotFound(_0x213da6,null))[_0xd373('0x23')](function(_0x1c21d2){var _0x3ad1ec;var _0x213b3c={},_0x42e45d={};_0x42e45d[_0xd373('0x30')]=_['keys'](db[_0xd373('0x4f')][_0xd373('0x2d')]);_0x42e45d[_0xd373('0x31')]=_['keys'](_0x386e4c[_0xd373('0x31')]);_0x42e45d['filters']=_[_0xd373('0x35')](_0x42e45d['model'],_0x42e45d[_0xd373('0x31')]);_0x213b3c[_0xd373('0x34')]=_[_0xd373('0x35')](_0x42e45d[_0xd373('0x30')],qs[_0xd373('0x36')](_0x386e4c[_0xd373('0x31')][_0xd373('0x36')]));_0x213b3c[_0xd373('0x34')]=_0x213b3c[_0xd373('0x34')][_0xd373('0x37')]?_0x213b3c[_0xd373('0x34')]:_0x42e45d[_0xd373('0x30')];if(!_0x386e4c[_0xd373('0x31')][_0xd373('0x38')](_0xd373('0x50'))){_0x213b3c[_0xd373('0x1b')]=qs[_0xd373('0x1b')](_0x386e4c[_0xd373('0x31')][_0xd373('0x1b')]);_0x213b3c[_0xd373('0x19')]=qs[_0xd373('0x19')](_0x386e4c[_0xd373('0x31')][_0xd373('0x19')]);}_0x213b3c[_0xd373('0x39')]=qs[_0xd373('0x3a')](_0x386e4c[_0xd373('0x31')]['sort']);_0x213b3c[_0xd373('0x3b')]=qs[_0xd373('0x33')](_[_0xd373('0x51')](_0x386e4c['query'],_0x42e45d[_0xd373('0x33')]));if(_0x386e4c[_0xd373('0x31')][_0xd373('0x3d')]){_0x213b3c[_0xd373('0x3b')]=_[_0xd373('0x3c')](_0x213b3c[_0xd373('0x3b')],{'$or':_[_0xd373('0x2c')](_0x213b3c['attributes'],function(_0x1afe12){var _0x356820={};_0x356820[_0x1afe12]={'$like':'%'+_0x386e4c[_0xd373('0x31')][_0xd373('0x3d')]+'%'};return _0x356820;})});}_0x213b3c[_0xd373('0x3b')]=_[_0xd373('0x3c')](_0x213b3c[_0xd373('0x3b')],{'mailboxuser':_0x1c21d2[_0xd373('0x52')]});_0x213b3c=_['merge']({},_0x213b3c,_0x386e4c[_0xd373('0x53')]);return db['VoiceMailMessage'][_0xd373('0x54')](_0x213b3c)[_0xd373('0x23')](respondWithFilteredResult(_0x213da6,_0x213b3c));})[_0xd373('0x41')](handleError(_0x213da6,null));}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.model.js b/server/api/voiceMail/voiceMail.model.js index cd890fb..8c621d3 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 _0x7e46=['path','rimraf','../../config/environment','./voiceMail.attributes','exports','define','VoiceMail','voice_voicemail','mailbox_context','mailbox','context','lodash','api','moment','bluebird','request-promise'];(function(_0x5d0fa7,_0x3c4c0a){var _0x421811=function(_0x5196fc){while(--_0x5196fc){_0x5d0fa7['push'](_0x5d0fa7['shift']());}};_0x421811(++_0x3c4c0a);}(_0x7e46,0x13b));var _0x67e4=function(_0x568749,_0x1e8375){_0x568749=_0x568749-0x0;var _0xe7408e=_0x7e46[_0x568749];return _0xe7408e;};'use strict';var _=require(_0x67e4('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x67e4('0x1'));var moment=require(_0x67e4('0x2'));var BPromise=require(_0x67e4('0x3'));var rp=require(_0x67e4('0x4'));var fs=require('fs');var path=require(_0x67e4('0x5'));var rimraf=require(_0x67e4('0x6'));var config=require(_0x67e4('0x7'));var attributes=require(_0x67e4('0x8'));module[_0x67e4('0x9')]=function(_0x12e40f,_0x36becf){return _0x12e40f[_0x67e4('0xa')](_0x67e4('0xb'),attributes,{'tableName':_0x67e4('0xc'),'paranoid':![],'indexes':[{'name':_0x67e4('0xd'),'fields':[_0x67e4('0xe'),_0x67e4('0xf')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x48a5=['moment','path','../../config/environment','./voiceMail.attributes','exports','VoiceMail','voice_voicemail','mailbox','context','util','../../config/logger','api'];(function(_0x234c1c,_0x5579c3){var _0x324258=function(_0x16d2a7){while(--_0x16d2a7){_0x234c1c['push'](_0x234c1c['shift']());}};_0x324258(++_0x5579c3);}(_0x48a5,0xf9));var _0x548a=function(_0x4d9adb,_0x5f8f27){_0x4d9adb=_0x4d9adb-0x0;var _0x3462e9=_0x48a5[_0x4d9adb];return _0x3462e9;};'use strict';var _=require('lodash');var util=require(_0x548a('0x0'));var logger=require(_0x548a('0x1'))(_0x548a('0x2'));var moment=require(_0x548a('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x548a('0x4'));var rimraf=require('rimraf');var config=require(_0x548a('0x5'));var attributes=require(_0x548a('0x6'));module[_0x548a('0x7')]=function(_0x49c479,_0x1715e9){return _0x49c479['define'](_0x548a('0x8'),attributes,{'tableName':_0x548a('0x9'),'paranoid':![],'indexes':[{'name':'mailbox_context','fields':[_0x548a('0xa'),_0x548a('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.rpc.js b/server/api/voiceMail/voiceMail.rpc.js index 0576c09..d5778e5 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 _0xa20b=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','debug','stringify','error','code','message','VoiceMail,\x20%s,\x20%s','result','lodash','util','bluebird'];(function(_0x53c98f,_0x537882){var _0xa605d3=function(_0x3e8d57){while(--_0x3e8d57){_0x53c98f['push'](_0x53c98f['shift']());}};_0xa605d3(++_0x537882);}(_0xa20b,0x70));var _0xba20=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xa20b[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0xba20('0x0'));var util=require(_0xba20('0x1'));var moment=require('moment');var BPromise=require(_0xba20('0x2'));var rs=require(_0xba20('0x3'));var fs=require('fs');var Redis=require(_0xba20('0x4'));var db=require(_0xba20('0x5'))['db'];var utils=require(_0xba20('0x6'));var logger=require(_0xba20('0x7'))(_0xba20('0x8'));var config=require(_0xba20('0x9'));var jayson=require(_0xba20('0xa'));var client=jayson[_0xba20('0xb')][_0xba20('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x16d1cd,_0x453605,_0x27e572){return new BPromise(function(_0x28062e,_0x46f131){return client[_0xba20('0xd')](_0x16d1cd,_0x27e572)['then'](function(_0x212d6b){logger[_0xba20('0xe')]('VoiceMail,\x20%s,\x20%s',_0x453605,_0xba20('0xf'));logger[_0xba20('0x10')]('VoiceMail,\x20%s,\x20%s,\x20%s',_0x453605,_0xba20('0xf'),JSON[_0xba20('0x11')](_0x212d6b));if(_0x212d6b['error']){if(_0x212d6b[_0xba20('0x12')][_0xba20('0x13')]===0x1f4){logger['error']('VoiceMail,\x20%s,\x20%s',_0x453605,_0x212d6b[_0xba20('0x12')][_0xba20('0x14')]);return _0x46f131(_0x212d6b['error'][_0xba20('0x14')]);}logger[_0xba20('0x12')]('VoiceMail,\x20%s,\x20%s',_0x453605,_0x212d6b[_0xba20('0x12')][_0xba20('0x14')]);return _0x28062e(_0x212d6b[_0xba20('0x12')][_0xba20('0x14')]);}else{logger[_0xba20('0xe')](_0xba20('0x15'),_0x453605,_0xba20('0xf'));_0x28062e(_0x212d6b[_0xba20('0x16')][_0xba20('0x14')]);}})['catch'](function(_0x4a69f4){logger[_0xba20('0x12')](_0xba20('0x15'),_0x453605,_0x4a69f4);_0x46f131(_0x4a69f4);});});} \ No newline at end of file +var _0x9a41=['message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','VoiceMail,\x20%s,\x20%s','debug','VoiceMail,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x456fb1,_0x859a1d){var _0x4083d6=function(_0xe1d0f2){while(--_0xe1d0f2){_0x456fb1['push'](_0x456fb1['shift']());}};_0x4083d6(++_0x859a1d);}(_0x9a41,0x14e));var _0x19a4=function(_0x7510de,_0x1197f4){_0x7510de=_0x7510de-0x0;var _0x1672e4=_0x9a41[_0x7510de];return _0x1672e4;};'use strict';var _=require(_0x19a4('0x0'));var util=require(_0x19a4('0x1'));var moment=require(_0x19a4('0x2'));var BPromise=require(_0x19a4('0x3'));var rs=require(_0x19a4('0x4'));var fs=require('fs');var Redis=require(_0x19a4('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x19a4('0x6'));var logger=require('../../config/logger')(_0x19a4('0x7'));var config=require(_0x19a4('0x8'));var jayson=require(_0x19a4('0x9'));var client=jayson[_0x19a4('0xa')][_0x19a4('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1596e5,_0x534385,_0x11f71f){return new BPromise(function(_0x372035,_0xa4add5){return client['request'](_0x1596e5,_0x11f71f)['then'](function(_0x5ee996){logger['info'](_0x19a4('0xc'),_0x534385,'request\x20sent');logger[_0x19a4('0xd')](_0x19a4('0xe'),_0x534385,_0x19a4('0xf'),JSON[_0x19a4('0x10')](_0x5ee996));if(_0x5ee996[_0x19a4('0x11')]){if(_0x5ee996[_0x19a4('0x11')]['code']===0x1f4){logger[_0x19a4('0x11')](_0x19a4('0xc'),_0x534385,_0x5ee996[_0x19a4('0x11')][_0x19a4('0x12')]);return _0xa4add5(_0x5ee996['error'][_0x19a4('0x12')]);}logger[_0x19a4('0x11')]('VoiceMail,\x20%s,\x20%s',_0x534385,_0x5ee996[_0x19a4('0x11')][_0x19a4('0x12')]);return _0x372035(_0x5ee996[_0x19a4('0x11')]['message']);}else{logger[_0x19a4('0x13')]('VoiceMail,\x20%s,\x20%s',_0x534385,_0x19a4('0xf'));_0x372035(_0x5ee996[_0x19a4('0x14')][_0x19a4('0x12')]);}})[_0x19a4('0x15')](function(_0x31be43){logger['error']('VoiceMail,\x20%s,\x20%s',_0x534385,_0x31be43);_0xa4add5(_0x31be43);});});} \ No newline at end of file diff --git a/server/api/voiceMailMessage/index.js b/server/api/voiceMailMessage/index.js index 0ff897b..496df86 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 _0xce20=['get','isAuthenticated','/:id','show','/:id/download','put','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment'];(function(_0x2a20ae,_0x13326b){var _0x5824cf=function(_0x4cade6){while(--_0x4cade6){_0x2a20ae['push'](_0x2a20ae['shift']());}};_0x5824cf(++_0x13326b);}(_0xce20,0x88));var _0x0ce2=function(_0x36921d,_0x3ab800){_0x36921d=_0x36921d-0x0;var _0x2be767=_0xce20[_0x36921d];return _0x2be767;};'use strict';var multer=require(_0x0ce2('0x0'));var util=require(_0x0ce2('0x1'));var path=require(_0x0ce2('0x2'));var timeout=require(_0x0ce2('0x3'));var express=require(_0x0ce2('0x4'));var router=express['Router']();var fs_extra=require(_0x0ce2('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x0ce2('0x6'));var config=require(_0x0ce2('0x7'));var controller=require('./voiceMailMessage.controller');router[_0x0ce2('0x8')]('/',auth[_0x0ce2('0x9')](),controller['index']);router[_0x0ce2('0x8')](_0x0ce2('0xa'),auth['isAuthenticated'](),controller[_0x0ce2('0xb')]);router[_0x0ce2('0x8')](_0x0ce2('0xc'),auth[_0x0ce2('0x9')](),controller['download']);router['post']('/',auth[_0x0ce2('0x9')](),controller['create']);router[_0x0ce2('0xd')]('/:id',auth[_0x0ce2('0x9')](),controller['update']);router['delete'](_0x0ce2('0xa'),auth[_0x0ce2('0x9')](),controller[_0x0ce2('0xe')]);module[_0x0ce2('0xf')]=router; \ No newline at end of file +var _0x0f02=['update','delete','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/:id','isAuthenticated','show','download','create','put'];(function(_0x24259d,_0x64a194){var _0x5a701=function(_0x204516){while(--_0x204516){_0x24259d['push'](_0x24259d['shift']());}};_0x5a701(++_0x64a194);}(_0x0f02,0x1a7));var _0x20f0=function(_0x19a524,_0x223b78){_0x19a524=_0x19a524-0x0;var _0x1882e9=_0x0f02[_0x19a524];return _0x1882e9;};'use strict';var multer=require(_0x20f0('0x0'));var util=require('util');var path=require(_0x20f0('0x1'));var timeout=require(_0x20f0('0x2'));var express=require(_0x20f0('0x3'));var router=express[_0x20f0('0x4')]();var fs_extra=require(_0x20f0('0x5'));var auth=require(_0x20f0('0x6'));var interaction=require(_0x20f0('0x7'));var config=require(_0x20f0('0x8'));var controller=require('./voiceMailMessage.controller');router[_0x20f0('0x9')]('/',auth['isAuthenticated'](),controller[_0x20f0('0xa')]);router['get'](_0x20f0('0xb'),auth[_0x20f0('0xc')](),controller[_0x20f0('0xd')]);router['get']('/:id/download',auth[_0x20f0('0xc')](),controller[_0x20f0('0xe')]);router['post']('/',auth[_0x20f0('0xc')](),controller[_0x20f0('0xf')]);router[_0x20f0('0x10')](_0x20f0('0xb'),auth[_0x20f0('0xc')](),controller[_0x20f0('0x11')]);router[_0x20f0('0x12')](_0x20f0('0xb'),auth['isAuthenticated'](),controller['destroy']);module[_0x20f0('0x13')]=router; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.attributes.js b/server/api/voiceMailMessage/voiceMailMessage.attributes.js index dd5a8ea..76019d7 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 _0x46ef=['STRING','BLOB','sequelize','VIRTUAL','getDataValue'];(function(_0x236ddc,_0x273645){var _0x5d6f00=function(_0x1fbc8d){while(--_0x1fbc8d){_0x236ddc['push'](_0x236ddc['shift']());}};_0x5d6f00(++_0x273645);}(_0x46ef,0x93));var _0xf46e=function(_0x560f7f,_0x1a34f6){_0x560f7f=_0x560f7f-0x0;var _0x57517b=_0x46ef[_0x560f7f];return _0x57517b;};'use strict';var Sequelize=require(_0xf46e('0x0'));module['exports']={'name':{'type':Sequelize[_0xf46e('0x1')],'get':function(_0x35f665){return this[_0xf46e('0x2')]('id');}},'msgnum':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0xf46e('0x3')],'defaultValue':''},'context':{'type':Sequelize[_0xf46e('0x3')],'defaultValue':''},'macrocontext':{'type':Sequelize[_0xf46e('0x3')],'defaultValue':''},'callerid':{'type':Sequelize[_0xf46e('0x3')],'defaultValue':''},'origtime':{'type':Sequelize[_0xf46e('0x3')],'defaultValue':''},'duration':{'type':Sequelize[_0xf46e('0x3')],'defaultValue':''},'mailboxuser':{'type':Sequelize[_0xf46e('0x3')],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0xf46e('0x3')],'defaultValue':''},'recording':{'type':Sequelize[_0xf46e('0x4')]('long'),'defaultValue':null},'flag':{'type':Sequelize['STRING'],'defaultValue':''},'msg_id':{'type':Sequelize[_0xf46e('0x3')],'defaultValue':''},'stamp':{'type':'TIMESTAMP','defaultValue':Sequelize['literal']('CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP')}}; \ No newline at end of file +var _0x66cf=['STRING','BLOB','long','literal','CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP','sequelize','exports','getDataValue','INTEGER'];(function(_0x3c4737,_0x2329ec){var _0x2bb926=function(_0x3b9605){while(--_0x3b9605){_0x3c4737['push'](_0x3c4737['shift']());}};_0x2bb926(++_0x2329ec);}(_0x66cf,0x12e));var _0xf66c=function(_0x43e821,_0x5397d4){_0x43e821=_0x43e821-0x0;var _0x38cbf5=_0x66cf[_0x43e821];return _0x38cbf5;};'use strict';var Sequelize=require(_0xf66c('0x0'));module[_0xf66c('0x1')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x5abe0f){return this[_0xf66c('0x2')]('id');}},'msgnum':{'type':Sequelize[_0xf66c('0x3')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0xf66c('0x4')],'defaultValue':''},'context':{'type':Sequelize[_0xf66c('0x4')],'defaultValue':''},'macrocontext':{'type':Sequelize[_0xf66c('0x4')],'defaultValue':''},'callerid':{'type':Sequelize[_0xf66c('0x4')],'defaultValue':''},'origtime':{'type':Sequelize[_0xf66c('0x4')],'defaultValue':''},'duration':{'type':Sequelize[_0xf66c('0x4')],'defaultValue':''},'mailboxuser':{'type':Sequelize[_0xf66c('0x4')],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0xf66c('0x4')],'defaultValue':''},'recording':{'type':Sequelize[_0xf66c('0x5')](_0xf66c('0x6')),'defaultValue':null},'flag':{'type':Sequelize[_0xf66c('0x4')],'defaultValue':''},'msg_id':{'type':Sequelize[_0xf66c('0x4')],'defaultValue':''},'stamp':{'type':'TIMESTAMP','defaultValue':Sequelize[_0xf66c('0x7')](_0xf66c('0x8'))}}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.controller.js b/server/api/voiceMailMessage/voiceMailMessage.controller.js index 9f048f1..3c5334a 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 _0xfbe1=['VoiceMailMessage','rawAttributes','fieldName','type','differenceBy','map','query','filters','intersection','model','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','download','msg_id','recording','Sequelize','ValidationError','audio/wav','attachment','Content-Disposition','attachment;\x20filename=\x22','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index'];(function(_0x492acf,_0x16d12f){var _0x2ddd5b=function(_0x362e98){while(--_0x362e98){_0x492acf['push'](_0x492acf['shift']());}};_0x2ddd5b(++_0x16d12f);}(_0xfbe1,0x80));var _0x1fbe=function(_0x5e4d68,_0x538a3a){_0x5e4d68=_0x5e4d68-0x0;var _0x421445=_0xfbe1[_0x5e4d68];return _0x421445;};'use strict';var emlformat=require(_0x1fbe('0x0'));var rimraf=require(_0x1fbe('0x1'));var zipdir=require(_0x1fbe('0x2'));var jsonpatch=require(_0x1fbe('0x3'));var rp=require(_0x1fbe('0x4'));var moment=require(_0x1fbe('0x5'));var BPromise=require(_0x1fbe('0x6'));var Mustache=require(_0x1fbe('0x7'));var util=require(_0x1fbe('0x8'));var path=require(_0x1fbe('0x9'));var sox=require('sox');var csv=require(_0x1fbe('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1fbe('0xb'));var _=require(_0x1fbe('0xc'));var squel=require(_0x1fbe('0xd'));var crypto=require(_0x1fbe('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x1fbe('0xf'));var toCsv=require(_0x1fbe('0xa'));var querystring=require(_0x1fbe('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x1fbe('0x11'));var qs=require(_0x1fbe('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1fbe('0x13'));var logger=require(_0x1fbe('0x14'))('api');var utils=require('../../config/utils');var config=require(_0x1fbe('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x1fbe('0x16'))['db'];function respondWithStatusCode(_0x1e577a,_0x37cd2d){_0x37cd2d=_0x37cd2d||0xcc;return function(_0x35c1e8){if(_0x35c1e8){return _0x1e577a[_0x1fbe('0x17')](_0x37cd2d);}return _0x1e577a[_0x1fbe('0x18')](_0x37cd2d)[_0x1fbe('0x19')]();};}function respondWithResult(_0x34519b,_0x30d463){_0x30d463=_0x30d463||0xc8;return function(_0x4d04ef){if(_0x4d04ef){return _0x34519b['status'](_0x30d463)[_0x1fbe('0x1a')](_0x4d04ef);}};}function respondWithFilteredResult(_0x21692e,_0x4cb7da){return function(_0x54a3d7){if(_0x54a3d7){var _0x53a670=typeof _0x4cb7da[_0x1fbe('0x1b')]===_0x1fbe('0x1c')&&typeof _0x4cb7da[_0x1fbe('0x1d')]==='undefined';var _0x53b230=_0x54a3d7[_0x1fbe('0x1e')];var _0x16f85d=_0x53a670?0x0:_0x4cb7da[_0x1fbe('0x1b')];var _0x2025e2=_0x53a670?_0x54a3d7[_0x1fbe('0x1e')]:_0x4cb7da['offset']+_0x4cb7da[_0x1fbe('0x1d')];var _0x15a52b;if(_0x2025e2>=_0x53b230){_0x2025e2=_0x53b230;_0x15a52b=0xc8;}else{_0x15a52b=0xce;}_0x21692e[_0x1fbe('0x18')](_0x15a52b);return _0x21692e[_0x1fbe('0x1f')](_0x1fbe('0x20'),_0x16f85d+'-'+_0x2025e2+'/'+_0x53b230)['json'](_0x54a3d7);}return null;};}function patchUpdates(_0x4353ef){return function(_0x4149af){try{jsonpatch[_0x1fbe('0x21')](_0x4149af,_0x4353ef,!![]);}catch(_0x6a23a5){return BPromise[_0x1fbe('0x22')](_0x6a23a5);}return _0x4149af[_0x1fbe('0x23')]();};}function saveUpdates(_0x1a5273,_0x5ab23f){return function(_0x59a970){if(_0x59a970){return _0x59a970[_0x1fbe('0x24')](_0x1a5273)[_0x1fbe('0x25')](function(_0x584788){return _0x584788;});}return null;};}function removeEntity(_0x435b51,_0x4f6375){return function(_0x1ff844){if(_0x1ff844){return _0x1ff844[_0x1fbe('0x26')]()['then'](function(){_0x435b51[_0x1fbe('0x18')](0xcc)[_0x1fbe('0x19')]();});}};}function handleEntityNotFound(_0x196508,_0x1fd99f){return function(_0x164b8a){if(!_0x164b8a){_0x196508[_0x1fbe('0x17')](0x194);}return _0x164b8a;};}function handleError(_0x42fdd1,_0x103aae){_0x103aae=_0x103aae||0x1f4;return function(_0x265825){logger[_0x1fbe('0x27')](_0x265825[_0x1fbe('0x28')]);if(_0x265825[_0x1fbe('0x29')]){delete _0x265825[_0x1fbe('0x29')];}_0x42fdd1[_0x1fbe('0x18')](_0x103aae)[_0x1fbe('0x2a')](_0x265825);};}exports[_0x1fbe('0x2b')]=function(_0x2e8524,_0x4e7db9){var _0x415532={},_0x300476={},_0x32e533={'count':0x0,'rows':[]};var _0x210fac=_['map'](db[_0x1fbe('0x2c')][_0x1fbe('0x2d')],function(_0x4ba7cc){return{'name':_0x4ba7cc[_0x1fbe('0x2e')],'type':_0x4ba7cc[_0x1fbe('0x2f')]['key']};});_0x300476['model']=_[_0x1fbe('0x30')](_[_0x1fbe('0x31')](_0x210fac,_0x1fbe('0x29')),['name']);_0x300476[_0x1fbe('0x32')]=_['keys'](_0x2e8524[_0x1fbe('0x32')]);_0x300476[_0x1fbe('0x33')]=_[_0x1fbe('0x34')](_0x300476[_0x1fbe('0x35')],_0x300476[_0x1fbe('0x32')]);_0x415532[_0x1fbe('0x36')]=_[_0x1fbe('0x34')](_0x300476[_0x1fbe('0x35')],qs[_0x1fbe('0x37')](_0x2e8524[_0x1fbe('0x32')][_0x1fbe('0x37')]));_0x415532['attributes']=_0x415532[_0x1fbe('0x36')][_0x1fbe('0x38')]?_0x415532[_0x1fbe('0x36')]:_0x300476[_0x1fbe('0x35')];if(!_0x2e8524['query']['hasOwnProperty'](_0x1fbe('0x39'))){_0x415532['limit']=qs['limit'](_0x2e8524[_0x1fbe('0x32')][_0x1fbe('0x1d')]);_0x415532[_0x1fbe('0x1b')]=qs[_0x1fbe('0x1b')](_0x2e8524[_0x1fbe('0x32')][_0x1fbe('0x1b')]);}_0x415532[_0x1fbe('0x3a')]=qs[_0x1fbe('0x3b')](_0x2e8524[_0x1fbe('0x32')][_0x1fbe('0x3b')]);_0x415532[_0x1fbe('0x3c')]=qs[_0x1fbe('0x33')](_[_0x1fbe('0x3d')](_0x2e8524[_0x1fbe('0x32')],_0x300476[_0x1fbe('0x33')]),_0x210fac);if(_0x2e8524[_0x1fbe('0x32')][_0x1fbe('0x3e')]){_0x415532[_0x1fbe('0x3c')]=_[_0x1fbe('0x3f')](_0x415532[_0x1fbe('0x3c')],{'$or':_[_0x1fbe('0x31')](_0x210fac,function(_0x355802){if(_0x355802[_0x1fbe('0x2f')]!==_0x1fbe('0x40')){var _0x39c05f={};_0x39c05f[_0x355802[_0x1fbe('0x29')]]={'$like':'%'+_0x2e8524[_0x1fbe('0x32')][_0x1fbe('0x3e')]+'%'};return _0x39c05f;}})});}_0x415532=_['merge']({},_0x415532,_0x2e8524[_0x1fbe('0x41')]);var _0x2f9bc6={'where':_0x415532['where']};return db[_0x1fbe('0x2c')][_0x1fbe('0x1e')](_0x2f9bc6)[_0x1fbe('0x25')](function(_0x748386){_0x32e533[_0x1fbe('0x1e')]=_0x748386;if(_0x2e8524[_0x1fbe('0x32')][_0x1fbe('0x42')]){_0x415532[_0x1fbe('0x43')]=[{'all':!![]}];}return db[_0x1fbe('0x2c')][_0x1fbe('0x44')](_0x415532);})[_0x1fbe('0x25')](function(_0x117421){_0x32e533[_0x1fbe('0x45')]=_0x117421;return _0x32e533;})[_0x1fbe('0x25')](respondWithFilteredResult(_0x4e7db9,_0x415532))[_0x1fbe('0x46')](handleError(_0x4e7db9,null));};exports[_0x1fbe('0x47')]=function(_0x597e41,_0x300f5b){var _0x1a46f3={'raw':!![],'where':{'id':_0x597e41[_0x1fbe('0x48')]['id']}},_0x5a0fb0={};_0x5a0fb0[_0x1fbe('0x35')]=_['keys'](db[_0x1fbe('0x2c')][_0x1fbe('0x2d')]);_0x5a0fb0[_0x1fbe('0x32')]=_[_0x1fbe('0x49')](_0x597e41['query']);_0x5a0fb0['filters']=_[_0x1fbe('0x34')](_0x5a0fb0[_0x1fbe('0x35')],_0x5a0fb0[_0x1fbe('0x32')]);_0x1a46f3[_0x1fbe('0x36')]=_[_0x1fbe('0x34')](_0x5a0fb0['model'],qs['fields'](_0x597e41['query'][_0x1fbe('0x37')]));_0x1a46f3['attributes']=_0x1a46f3[_0x1fbe('0x36')][_0x1fbe('0x38')]?_0x1a46f3['attributes']:_0x5a0fb0[_0x1fbe('0x35')];if(_0x597e41[_0x1fbe('0x32')][_0x1fbe('0x42')]){_0x1a46f3[_0x1fbe('0x43')]=[{'all':!![]}];}_0x1a46f3=_[_0x1fbe('0x3f')]({},_0x1a46f3,_0x597e41[_0x1fbe('0x41')]);return db[_0x1fbe('0x2c')][_0x1fbe('0x4a')](_0x1a46f3)[_0x1fbe('0x25')](handleEntityNotFound(_0x300f5b,null))[_0x1fbe('0x25')](respondWithResult(_0x300f5b,null))[_0x1fbe('0x46')](handleError(_0x300f5b,null));};exports[_0x1fbe('0x4b')]=function(_0x4ad14a,_0x3941c8){return db[_0x1fbe('0x2c')][_0x1fbe('0x4b')](_0x4ad14a[_0x1fbe('0x4c')],{})[_0x1fbe('0x25')](respondWithResult(_0x3941c8,0xc9))[_0x1fbe('0x46')](handleError(_0x3941c8,null));};exports[_0x1fbe('0x24')]=function(_0x3e7c32,_0xc4baae){if(_0x3e7c32[_0x1fbe('0x4c')]['id']){delete _0x3e7c32[_0x1fbe('0x4c')]['id'];}return db[_0x1fbe('0x2c')][_0x1fbe('0x4a')]({'where':{'id':_0x3e7c32['params']['id']}})[_0x1fbe('0x25')](handleEntityNotFound(_0xc4baae,null))['then'](saveUpdates(_0x3e7c32[_0x1fbe('0x4c')],null))[_0x1fbe('0x25')](respondWithResult(_0xc4baae,null))['catch'](handleError(_0xc4baae,null));};exports['destroy']=function(_0x4c8ddd,_0x4e797b){return db[_0x1fbe('0x2c')]['find']({'where':{'id':_0x4c8ddd[_0x1fbe('0x48')]['id']}})[_0x1fbe('0x25')](handleEntityNotFound(_0x4e797b,null))[_0x1fbe('0x25')](removeEntity(_0x4e797b,null))[_0x1fbe('0x46')](handleError(_0x4e797b,null));};exports[_0x1fbe('0x4d')]=function(_0x45dee4,_0xe592b5,_0x473838){return db[_0x1fbe('0x2c')]['find']({'where':{'id':_0x45dee4[_0x1fbe('0x48')]['id']},'attributes':['id','recording',_0x1fbe('0x4e')]})[_0x1fbe('0x25')](handleEntityNotFound(_0xe592b5,null))[_0x1fbe('0x25')](function(_0x2dbb69){if(_0x2dbb69){if(!_0x2dbb69[_0x1fbe('0x4f')]){throw new db[(_0x1fbe('0x50'))][(_0x1fbe('0x51'))]('VoiceMailMessage\x20not\x20found');}var _0x3ce1e1={'Content-Type':_0x1fbe('0x52'),'Content-Disposition':_0x1fbe('0x53')};if(_0x2dbb69['msg_id']){_0x3ce1e1[_0x1fbe('0x54')]=_0x1fbe('0x55')+_0x2dbb69['msg_id']+'.wav\x22';}_0xe592b5[_0x1fbe('0x1f')](_0x3ce1e1);return _0xe592b5[_0x1fbe('0x2a')](new Buffer(_0x2dbb69[_0x1fbe('0x4f')]));}})['catch'](handleError(_0xe592b5,null));}; \ No newline at end of file +var _0xbd90=['options','VoiceMailMessage','includeAll','include','findAll','catch','find','create','body','params','download','recording','msg_id','Sequelize','ValidationError','VoiceMailMessage\x20not\x20found','audio/wav','Content-Disposition','attachment;\x20filename=\x22','.wav\x22','set','eml-format','rimraf','fast-json-patch','request-promise','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','update','then','destroy','error','name','send','index','map','rawAttributes','fieldName','type','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','where','pick','filter','merge'];(function(_0x5a3e69,_0x346f71){var _0x27073b=function(_0x36283e){while(--_0x36283e){_0x5a3e69['push'](_0x5a3e69['shift']());}};_0x27073b(++_0x346f71);}(_0xbd90,0x10e));var _0x0bd9=function(_0x3e2654,_0x3d7af7){_0x3e2654=_0x3e2654-0x0;var _0x934d5c=_0xbd90[_0x3e2654];return _0x934d5c;};'use strict';var emlformat=require(_0x0bd9('0x0'));var rimraf=require(_0x0bd9('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0bd9('0x2'));var rp=require(_0x0bd9('0x3'));var moment=require('moment');var BPromise=require(_0x0bd9('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x0bd9('0x5'));var sox=require(_0x0bd9('0x6'));var csv=require(_0x0bd9('0x7'));var ejs=require(_0x0bd9('0x8'));var fs=require('fs');var fs_extra=require(_0x0bd9('0x9'));var _=require(_0x0bd9('0xa'));var squel=require(_0x0bd9('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0bd9('0xc'));var toCsv=require(_0x0bd9('0x7'));var querystring=require(_0x0bd9('0xd'));var Papa=require(_0x0bd9('0xe'));var Redis=require(_0x0bd9('0xf'));var authService=require(_0x0bd9('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x0bd9('0x11'));var hardwareService=require(_0x0bd9('0x12'));var logger=require(_0x0bd9('0x13'))(_0x0bd9('0x14'));var utils=require(_0x0bd9('0x15'));var config=require(_0x0bd9('0x16'));var licenseUtil=require(_0x0bd9('0x17'));var db=require(_0x0bd9('0x18'))['db'];function respondWithStatusCode(_0x559209,_0x2809a5){_0x2809a5=_0x2809a5||0xcc;return function(_0x2f8b0d){if(_0x2f8b0d){return _0x559209[_0x0bd9('0x19')](_0x2809a5);}return _0x559209[_0x0bd9('0x1a')](_0x2809a5)[_0x0bd9('0x1b')]();};}function respondWithResult(_0x4949ba,_0x43a1fa){_0x43a1fa=_0x43a1fa||0xc8;return function(_0x55e616){if(_0x55e616){return _0x4949ba[_0x0bd9('0x1a')](_0x43a1fa)[_0x0bd9('0x1c')](_0x55e616);}};}function respondWithFilteredResult(_0x196b0f,_0x18e920){return function(_0x1d8cf5){if(_0x1d8cf5){var _0x3271f6=typeof _0x18e920[_0x0bd9('0x1d')]===_0x0bd9('0x1e')&&typeof _0x18e920[_0x0bd9('0x1f')]===_0x0bd9('0x1e');var _0xdc90fe=_0x1d8cf5[_0x0bd9('0x20')];var _0x13b880=_0x3271f6?0x0:_0x18e920['offset'];var _0x5c8c1d=_0x3271f6?_0x1d8cf5['count']:_0x18e920[_0x0bd9('0x1d')]+_0x18e920[_0x0bd9('0x1f')];var _0x2c5b1e;if(_0x5c8c1d>=_0xdc90fe){_0x5c8c1d=_0xdc90fe;_0x2c5b1e=0xc8;}else{_0x2c5b1e=0xce;}_0x196b0f[_0x0bd9('0x1a')](_0x2c5b1e);return _0x196b0f['set'](_0x0bd9('0x21'),_0x13b880+'-'+_0x5c8c1d+'/'+_0xdc90fe)['json'](_0x1d8cf5);}return null;};}function patchUpdates(_0x44d569){return function(_0x8b2bd7){try{jsonpatch[_0x0bd9('0x22')](_0x8b2bd7,_0x44d569,!![]);}catch(_0x5e7c20){return BPromise[_0x0bd9('0x23')](_0x5e7c20);}return _0x8b2bd7['save']();};}function saveUpdates(_0x29636c,_0x4d54eb){return function(_0x5c4fbb){if(_0x5c4fbb){return _0x5c4fbb[_0x0bd9('0x24')](_0x29636c)[_0x0bd9('0x25')](function(_0x48fede){return _0x48fede;});}return null;};}function removeEntity(_0x613f65,_0x1990b7){return function(_0x2f01b5){if(_0x2f01b5){return _0x2f01b5[_0x0bd9('0x26')]()['then'](function(){_0x613f65['status'](0xcc)[_0x0bd9('0x1b')]();});}};}function handleEntityNotFound(_0x8b41e,_0x11fbe4){return function(_0x14e734){if(!_0x14e734){_0x8b41e['sendStatus'](0x194);}return _0x14e734;};}function handleError(_0x2eefd0,_0x9ef59f){_0x9ef59f=_0x9ef59f||0x1f4;return function(_0xd18873){logger[_0x0bd9('0x27')](_0xd18873['stack']);if(_0xd18873[_0x0bd9('0x28')]){delete _0xd18873[_0x0bd9('0x28')];}_0x2eefd0[_0x0bd9('0x1a')](_0x9ef59f)[_0x0bd9('0x29')](_0xd18873);};}exports[_0x0bd9('0x2a')]=function(_0x24df76,_0x1b4f65){var _0x68f302={},_0x59513c={},_0x54b5a8={'count':0x0,'rows':[]};var _0x3f0af4=_[_0x0bd9('0x2b')](db['VoiceMailMessage'][_0x0bd9('0x2c')],function(_0x1c2e84){return{'name':_0x1c2e84[_0x0bd9('0x2d')],'type':_0x1c2e84[_0x0bd9('0x2e')]['key']};});_0x59513c['model']=_['differenceBy'](_['map'](_0x3f0af4,_0x0bd9('0x28')),[_0x0bd9('0x28')]);_0x59513c[_0x0bd9('0x2f')]=_[_0x0bd9('0x30')](_0x24df76[_0x0bd9('0x2f')]);_0x59513c[_0x0bd9('0x31')]=_[_0x0bd9('0x32')](_0x59513c[_0x0bd9('0x33')],_0x59513c[_0x0bd9('0x2f')]);_0x68f302[_0x0bd9('0x34')]=_[_0x0bd9('0x32')](_0x59513c[_0x0bd9('0x33')],qs[_0x0bd9('0x35')](_0x24df76[_0x0bd9('0x2f')][_0x0bd9('0x35')]));_0x68f302[_0x0bd9('0x34')]=_0x68f302['attributes'][_0x0bd9('0x36')]?_0x68f302[_0x0bd9('0x34')]:_0x59513c['model'];if(!_0x24df76[_0x0bd9('0x2f')][_0x0bd9('0x37')](_0x0bd9('0x38'))){_0x68f302[_0x0bd9('0x1f')]=qs[_0x0bd9('0x1f')](_0x24df76['query']['limit']);_0x68f302[_0x0bd9('0x1d')]=qs[_0x0bd9('0x1d')](_0x24df76[_0x0bd9('0x2f')]['offset']);}_0x68f302[_0x0bd9('0x39')]=qs['sort'](_0x24df76[_0x0bd9('0x2f')]['sort']);_0x68f302[_0x0bd9('0x3a')]=qs[_0x0bd9('0x31')](_[_0x0bd9('0x3b')](_0x24df76[_0x0bd9('0x2f')],_0x59513c[_0x0bd9('0x31')]),_0x3f0af4);if(_0x24df76[_0x0bd9('0x2f')][_0x0bd9('0x3c')]){_0x68f302[_0x0bd9('0x3a')]=_[_0x0bd9('0x3d')](_0x68f302[_0x0bd9('0x3a')],{'$or':_[_0x0bd9('0x2b')](_0x3f0af4,function(_0x13543a){if(_0x13543a[_0x0bd9('0x2e')]!=='VIRTUAL'){var _0x25362d={};_0x25362d[_0x13543a[_0x0bd9('0x28')]]={'$like':'%'+_0x24df76[_0x0bd9('0x2f')]['filter']+'%'};return _0x25362d;}})});}_0x68f302=_[_0x0bd9('0x3d')]({},_0x68f302,_0x24df76[_0x0bd9('0x3e')]);var _0x46cf73={'where':_0x68f302[_0x0bd9('0x3a')]};return db[_0x0bd9('0x3f')][_0x0bd9('0x20')](_0x46cf73)[_0x0bd9('0x25')](function(_0x1d7626){_0x54b5a8[_0x0bd9('0x20')]=_0x1d7626;if(_0x24df76[_0x0bd9('0x2f')][_0x0bd9('0x40')]){_0x68f302[_0x0bd9('0x41')]=[{'all':!![]}];}return db['VoiceMailMessage'][_0x0bd9('0x42')](_0x68f302);})[_0x0bd9('0x25')](function(_0x5cb5c3){_0x54b5a8['rows']=_0x5cb5c3;return _0x54b5a8;})[_0x0bd9('0x25')](respondWithFilteredResult(_0x1b4f65,_0x68f302))[_0x0bd9('0x43')](handleError(_0x1b4f65,null));};exports['show']=function(_0x21badb,_0x4c440b){var _0x23a081={'raw':!![],'where':{'id':_0x21badb['params']['id']}},_0x45c784={};_0x45c784[_0x0bd9('0x33')]=_[_0x0bd9('0x30')](db['VoiceMailMessage'][_0x0bd9('0x2c')]);_0x45c784[_0x0bd9('0x2f')]=_['keys'](_0x21badb[_0x0bd9('0x2f')]);_0x45c784[_0x0bd9('0x31')]=_[_0x0bd9('0x32')](_0x45c784[_0x0bd9('0x33')],_0x45c784[_0x0bd9('0x2f')]);_0x23a081[_0x0bd9('0x34')]=_[_0x0bd9('0x32')](_0x45c784[_0x0bd9('0x33')],qs[_0x0bd9('0x35')](_0x21badb[_0x0bd9('0x2f')][_0x0bd9('0x35')]));_0x23a081[_0x0bd9('0x34')]=_0x23a081[_0x0bd9('0x34')][_0x0bd9('0x36')]?_0x23a081[_0x0bd9('0x34')]:_0x45c784[_0x0bd9('0x33')];if(_0x21badb[_0x0bd9('0x2f')][_0x0bd9('0x40')]){_0x23a081[_0x0bd9('0x41')]=[{'all':!![]}];}_0x23a081=_['merge']({},_0x23a081,_0x21badb[_0x0bd9('0x3e')]);return db[_0x0bd9('0x3f')][_0x0bd9('0x44')](_0x23a081)['then'](handleEntityNotFound(_0x4c440b,null))[_0x0bd9('0x25')](respondWithResult(_0x4c440b,null))[_0x0bd9('0x43')](handleError(_0x4c440b,null));};exports[_0x0bd9('0x45')]=function(_0x2a8bc9,_0x3ec75b){return db[_0x0bd9('0x3f')][_0x0bd9('0x45')](_0x2a8bc9[_0x0bd9('0x46')],{})[_0x0bd9('0x25')](respondWithResult(_0x3ec75b,0xc9))[_0x0bd9('0x43')](handleError(_0x3ec75b,null));};exports[_0x0bd9('0x24')]=function(_0x52995c,_0x4f31cc){if(_0x52995c['body']['id']){delete _0x52995c[_0x0bd9('0x46')]['id'];}return db[_0x0bd9('0x3f')][_0x0bd9('0x44')]({'where':{'id':_0x52995c[_0x0bd9('0x47')]['id']}})['then'](handleEntityNotFound(_0x4f31cc,null))[_0x0bd9('0x25')](saveUpdates(_0x52995c[_0x0bd9('0x46')],null))['then'](respondWithResult(_0x4f31cc,null))[_0x0bd9('0x43')](handleError(_0x4f31cc,null));};exports['destroy']=function(_0x5b4ee8,_0x30b6bf){return db[_0x0bd9('0x3f')][_0x0bd9('0x44')]({'where':{'id':_0x5b4ee8[_0x0bd9('0x47')]['id']}})[_0x0bd9('0x25')](handleEntityNotFound(_0x30b6bf,null))[_0x0bd9('0x25')](removeEntity(_0x30b6bf,null))[_0x0bd9('0x43')](handleError(_0x30b6bf,null));};exports[_0x0bd9('0x48')]=function(_0x11d071,_0x32f0d8,_0x40ed16){return db[_0x0bd9('0x3f')][_0x0bd9('0x44')]({'where':{'id':_0x11d071[_0x0bd9('0x47')]['id']},'attributes':['id',_0x0bd9('0x49'),_0x0bd9('0x4a')]})[_0x0bd9('0x25')](handleEntityNotFound(_0x32f0d8,null))['then'](function(_0x1f202c){if(_0x1f202c){if(!_0x1f202c[_0x0bd9('0x49')]){throw new db[(_0x0bd9('0x4b'))][(_0x0bd9('0x4c'))](_0x0bd9('0x4d'));}var _0x588cdc={'Content-Type':_0x0bd9('0x4e'),'Content-Disposition':'attachment'};if(_0x1f202c[_0x0bd9('0x4a')]){_0x588cdc[_0x0bd9('0x4f')]=_0x0bd9('0x50')+_0x1f202c['msg_id']+_0x0bd9('0x51');}_0x32f0d8[_0x0bd9('0x52')](_0x588cdc);return _0x32f0d8[_0x0bd9('0x29')](new Buffer(_0x1f202c[_0x0bd9('0x49')]));}})[_0x0bd9('0x43')](handleError(_0x32f0d8,null));}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.model.js b/server/api/voiceMailMessage/voiceMailMessage.model.js index 1c47ee0..fc1115e 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 _0xf434=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceMailMessage.attributes','exports','define','VoiceMailMessage','voice_voicemail_messages','dir','lodash','util'];(function(_0x2e2662,_0x1ee1c2){var _0x51fbac=function(_0x4c7e58){while(--_0x4c7e58){_0x2e2662['push'](_0x2e2662['shift']());}};_0x51fbac(++_0x1ee1c2);}(_0xf434,0x9e));var _0x4f43=function(_0x22529c,_0x52704b){_0x22529c=_0x22529c-0x0;var _0x78a911=_0xf434[_0x22529c];return _0x78a911;};'use strict';var _=require(_0x4f43('0x0'));var util=require(_0x4f43('0x1'));var logger=require(_0x4f43('0x2'))(_0x4f43('0x3'));var moment=require(_0x4f43('0x4'));var BPromise=require(_0x4f43('0x5'));var rp=require(_0x4f43('0x6'));var fs=require('fs');var path=require(_0x4f43('0x7'));var rimraf=require(_0x4f43('0x8'));var config=require(_0x4f43('0x9'));var attributes=require(_0x4f43('0xa'));module[_0x4f43('0xb')]=function(_0x4713bd,_0x38427b){return _0x4713bd[_0x4f43('0xc')](_0x4f43('0xd'),attributes,{'tableName':_0x4f43('0xe'),'paranoid':![],'indexes':[{'name':_0x4f43('0xf'),'fields':[_0x4f43('0xf')]}],'timestamps':![]});}; \ No newline at end of file +var _0xf1a2=['util','api','bluebird','request-promise','path','rimraf','../../config/environment','./voiceMailMessage.attributes','define','VoiceMailMessage'];(function(_0x3fa7d3,_0x37f83c){var _0x4c51bd=function(_0x59e85b){while(--_0x59e85b){_0x3fa7d3['push'](_0x3fa7d3['shift']());}};_0x4c51bd(++_0x37f83c);}(_0xf1a2,0xe6));var _0x2f1a=function(_0x5c858f,_0x5e4fbb){_0x5c858f=_0x5c858f-0x0;var _0x1aa645=_0xf1a2[_0x5c858f];return _0x1aa645;};'use strict';var _=require('lodash');var util=require(_0x2f1a('0x0'));var logger=require('../../config/logger')(_0x2f1a('0x1'));var moment=require('moment');var BPromise=require(_0x2f1a('0x2'));var rp=require(_0x2f1a('0x3'));var fs=require('fs');var path=require(_0x2f1a('0x4'));var rimraf=require(_0x2f1a('0x5'));var config=require(_0x2f1a('0x6'));var attributes=require(_0x2f1a('0x7'));module['exports']=function(_0x2a489c,_0x2ed9f9){return _0x2a489c[_0x2f1a('0x8')](_0x2f1a('0x9'),attributes,{'tableName':'voice_voicemail_messages','paranoid':![],'indexes':[{'name':'dir','fields':['dir']}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.rpc.js b/server/api/voiceMailMessage/voiceMailMessage.rpc.js index 28987b2..aab007a 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 _0xc178=['client','request','then','info','VoiceMailMessage,\x20%s,\x20%s','debug','VoiceMailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x36a749,_0x4af1eb){var _0x1bda5b=function(_0x1d319e){while(--_0x1d319e){_0x36a749['push'](_0x36a749['shift']());}};_0x1bda5b(++_0x4af1eb);}(_0xc178,0x1c5));var _0x8c17=function(_0x255aaf,_0x282056){_0x255aaf=_0x255aaf-0x0;var _0x145bd2=_0xc178[_0x255aaf];return _0x145bd2;};'use strict';var _=require(_0x8c17('0x0'));var util=require('util');var moment=require(_0x8c17('0x1'));var BPromise=require(_0x8c17('0x2'));var rs=require(_0x8c17('0x3'));var fs=require('fs');var Redis=require(_0x8c17('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x8c17('0x5'))(_0x8c17('0x6'));var config=require(_0x8c17('0x7'));var jayson=require(_0x8c17('0x8'));var client=jayson[_0x8c17('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x458c91,_0x316fe6,_0x1862f5){return new BPromise(function(_0xd75b05,_0x5d795e){return client[_0x8c17('0xa')](_0x458c91,_0x1862f5)[_0x8c17('0xb')](function(_0x3b8168){logger[_0x8c17('0xc')](_0x8c17('0xd'),_0x316fe6,'request\x20sent');logger[_0x8c17('0xe')](_0x8c17('0xf'),_0x316fe6,'request\x20sent',JSON[_0x8c17('0x10')](_0x3b8168));if(_0x3b8168[_0x8c17('0x11')]){if(_0x3b8168[_0x8c17('0x11')][_0x8c17('0x12')]===0x1f4){logger['error'](_0x8c17('0xd'),_0x316fe6,_0x3b8168[_0x8c17('0x11')][_0x8c17('0x13')]);return _0x5d795e(_0x3b8168[_0x8c17('0x11')][_0x8c17('0x13')]);}logger['error'](_0x8c17('0xd'),_0x316fe6,_0x3b8168[_0x8c17('0x11')]['message']);return _0xd75b05(_0x3b8168[_0x8c17('0x11')][_0x8c17('0x13')]);}else{logger[_0x8c17('0xc')](_0x8c17('0xd'),_0x316fe6,_0x8c17('0x14'));_0xd75b05(_0x3b8168['result']['message']);}})[_0x8c17('0x15')](function(_0x3d6da7){logger[_0x8c17('0x11')](_0x8c17('0xd'),_0x316fe6,_0x3d6da7);_0x5d795e(_0x3d6da7);});});} \ No newline at end of file +var _0x482d=['then','info','VoiceMailMessage,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0xe9f48,_0x36f02a){var _0x3a6c2b=function(_0x2d53d5){while(--_0x2d53d5){_0xe9f48['push'](_0xe9f48['shift']());}};_0x3a6c2b(++_0x36f02a);}(_0x482d,0xaa));var _0xd482=function(_0x243ff6,_0x5bfa05){_0x243ff6=_0x243ff6-0x0;var _0x327ccf=_0x482d[_0x243ff6];return _0x327ccf;};'use strict';var _=require(_0xd482('0x0'));var util=require(_0xd482('0x1'));var moment=require(_0xd482('0x2'));var BPromise=require(_0xd482('0x3'));var rs=require(_0xd482('0x4'));var fs=require('fs');var Redis=require(_0xd482('0x5'));var db=require(_0xd482('0x6'))['db'];var utils=require(_0xd482('0x7'));var logger=require('../../config/logger')(_0xd482('0x8'));var config=require(_0xd482('0x9'));var jayson=require(_0xd482('0xa'));var client=jayson[_0xd482('0xb')][_0xd482('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x2ac071,_0x536179,_0x13e68e){return new BPromise(function(_0x91b497,_0x1d11e6){return client[_0xd482('0xd')](_0x2ac071,_0x13e68e)[_0xd482('0xe')](function(_0x5905f5){logger[_0xd482('0xf')](_0xd482('0x10'),_0x536179,_0xd482('0x11'));logger['debug']('VoiceMailMessage,\x20%s,\x20%s,\x20%s',_0x536179,_0xd482('0x11'),JSON[_0xd482('0x12')](_0x5905f5));if(_0x5905f5[_0xd482('0x13')]){if(_0x5905f5['error'][_0xd482('0x14')]===0x1f4){logger[_0xd482('0x13')](_0xd482('0x10'),_0x536179,_0x5905f5['error']['message']);return _0x1d11e6(_0x5905f5[_0xd482('0x13')][_0xd482('0x15')]);}logger['error'](_0xd482('0x10'),_0x536179,_0x5905f5['error'][_0xd482('0x15')]);return _0x91b497(_0x5905f5[_0xd482('0x13')][_0xd482('0x15')]);}else{logger[_0xd482('0xf')](_0xd482('0x10'),_0x536179,_0xd482('0x11'));_0x91b497(_0x5905f5['result'][_0xd482('0x15')]);}})[_0xd482('0x16')](function(_0x45c20c){logger[_0xd482('0x13')](_0xd482('0x10'),_0x536179,_0x45c20c);_0x1d11e6(_0x45c20c);});});} \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/index.js b/server/api/voiceMusicOnHold/index.js index d74a827..3f14cb5 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 _0x4a1e=['post','create','addSound','put','update','delete','destroy','/:id/sounds/:id2','removeSound','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','/:id/sounds','getSounds'];(function(_0x4f6186,_0x156bbe){var _0x1e3c25=function(_0x38ed02){while(--_0x38ed02){_0x4f6186['push'](_0x4f6186['shift']());}};_0x1e3c25(++_0x156bbe);}(_0x4a1e,0xca));var _0xe4a1=function(_0x53a7af,_0x1408a5){_0x53a7af=_0x53a7af-0x0;var _0x3cc7f6=_0x4a1e[_0x53a7af];return _0x3cc7f6;};'use strict';var multer=require(_0xe4a1('0x0'));var util=require(_0xe4a1('0x1'));var path=require('path');var timeout=require(_0xe4a1('0x2'));var express=require(_0xe4a1('0x3'));var router=express[_0xe4a1('0x4')]();var fs_extra=require(_0xe4a1('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xe4a1('0x6'));var config=require(_0xe4a1('0x7'));var controller=require('./voiceMusicOnHold.controller');router[_0xe4a1('0x8')]('/',auth[_0xe4a1('0x9')](),controller[_0xe4a1('0xa')]);router[_0xe4a1('0x8')](_0xe4a1('0xb'),auth[_0xe4a1('0x9')](),controller['show']);router[_0xe4a1('0x8')](_0xe4a1('0xc'),auth[_0xe4a1('0x9')](),controller[_0xe4a1('0xd')]);router[_0xe4a1('0xe')]('/',auth[_0xe4a1('0x9')](),controller[_0xe4a1('0xf')]);router['post'](_0xe4a1('0xc'),auth['isAuthenticated'](),controller[_0xe4a1('0x10')]);router[_0xe4a1('0x11')]('/:id',auth[_0xe4a1('0x9')](),controller[_0xe4a1('0x12')]);router[_0xe4a1('0x13')](_0xe4a1('0xb'),auth['isAuthenticated'](),controller[_0xe4a1('0x14')]);router['delete'](_0xe4a1('0x15'),auth[_0xe4a1('0x9')](),controller[_0xe4a1('0x16')]);module[_0xe4a1('0x17')]=router; \ No newline at end of file +var _0xf725=['fs-extra','../../components/interaction/service','../../config/environment','./voiceMusicOnHold.controller','index','get','/:id','isAuthenticated','show','/:id/sounds','getSounds','post','create','addSound','put','update','destroy','delete','/:id/sounds/:id2','removeSound','exports','multer','util','path','Router'];(function(_0x59d188,_0x43f129){var _0x2604bf=function(_0x39fe69){while(--_0x39fe69){_0x59d188['push'](_0x59d188['shift']());}};_0x2604bf(++_0x43f129);}(_0xf725,0xf6));var _0x5f72=function(_0x1b7f7e,_0x13e390){_0x1b7f7e=_0x1b7f7e-0x0;var _0x2ca3d0=_0xf725[_0x1b7f7e];return _0x2ca3d0;};'use strict';var multer=require(_0x5f72('0x0'));var util=require(_0x5f72('0x1'));var path=require(_0x5f72('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x5f72('0x3')]();var fs_extra=require(_0x5f72('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x5f72('0x5'));var config=require(_0x5f72('0x6'));var controller=require(_0x5f72('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x5f72('0x8')]);router[_0x5f72('0x9')](_0x5f72('0xa'),auth[_0x5f72('0xb')](),controller[_0x5f72('0xc')]);router['get'](_0x5f72('0xd'),auth[_0x5f72('0xb')](),controller[_0x5f72('0xe')]);router[_0x5f72('0xf')]('/',auth[_0x5f72('0xb')](),controller[_0x5f72('0x10')]);router[_0x5f72('0xf')]('/:id/sounds',auth[_0x5f72('0xb')](),controller[_0x5f72('0x11')]);router[_0x5f72('0x12')](_0x5f72('0xa'),auth[_0x5f72('0xb')](),controller[_0x5f72('0x13')]);router['delete'](_0x5f72('0xa'),auth[_0x5f72('0xb')](),controller[_0x5f72('0x14')]);router[_0x5f72('0x15')](_0x5f72('0x16'),auth[_0x5f72('0xb')](),controller[_0x5f72('0x17')]);module[_0x5f72('0x18')]=router; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js index 912ebdd..d07ff51 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 _0x715e=['alpha','TIMESTAMP','exports','name','ENUM','custom','files','mp3nb','quietmp3nb','quietmp3','mp3','STRING'];(function(_0x44946b,_0xf874ec){var _0x249bc4=function(_0x40a23e){while(--_0x40a23e){_0x44946b['push'](_0x44946b['shift']());}};_0x249bc4(++_0xf874ec);}(_0x715e,0x92));var _0xe715=function(_0x243217,_0x522951){_0x243217=_0x243217-0x0;var _0x478029=_0x715e[_0x243217];return _0x478029;};'use strict';var Sequelize=require('sequelize');module[_0xe715('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xe715('0x1')},'mode':{'type':Sequelize[_0xe715('0x2')](_0xe715('0x3'),_0xe715('0x4'),_0xe715('0x5'),_0xe715('0x6'),_0xe715('0x7'),_0xe715('0x8')),'allowNull':!![],'defaultValue':_0xe715('0x4')},'directory':{'type':Sequelize[_0xe715('0x9')],'allowNull':!![]},'application':{'type':Sequelize[_0xe715('0x9')],'allowNull':!![]},'digit':{'type':Sequelize[_0xe715('0x9')],'allowNull':!![]},'sort':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0xe715('0xa')},'format':{'type':Sequelize[_0xe715('0x9')],'allowNull':!![]},'stamp':{'type':_0xe715('0xb')},'defaultEntry':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0}}; \ No newline at end of file +var _0xc9f7=['TIMESTAMP','BOOLEAN','sequelize','exports','STRING','name','ENUM','custom','mp3nb','quietmp3nb','quietmp3','files','alpha'];(function(_0x26d6ad,_0x257917){var _0x4125dc=function(_0xad5ee3){while(--_0xad5ee3){_0x26d6ad['push'](_0x26d6ad['shift']());}};_0x4125dc(++_0x257917);}(_0xc9f7,0x1c9));var _0x7c9f=function(_0x33fba3,_0x3f1137){_0x33fba3=_0x33fba3-0x0;var _0x113467=_0xc9f7[_0x33fba3];return _0x113467;};'use strict';var Sequelize=require(_0x7c9f('0x0'));module[_0x7c9f('0x1')]={'name':{'type':Sequelize[_0x7c9f('0x2')],'allowNull':![],'unique':_0x7c9f('0x3')},'mode':{'type':Sequelize[_0x7c9f('0x4')](_0x7c9f('0x5'),'files',_0x7c9f('0x6'),_0x7c9f('0x7'),_0x7c9f('0x8'),'mp3'),'allowNull':!![],'defaultValue':_0x7c9f('0x9')},'directory':{'type':Sequelize[_0x7c9f('0x2')],'allowNull':!![]},'application':{'type':Sequelize[_0x7c9f('0x2')],'allowNull':!![]},'digit':{'type':Sequelize['STRING'],'allowNull':!![]},'sort':{'type':Sequelize[_0x7c9f('0x2')],'allowNull':!![],'defaultValue':_0x7c9f('0xa')},'format':{'type':Sequelize[_0x7c9f('0x2')],'allowNull':!![]},'stamp':{'type':_0x7c9f('0xb')},'defaultEntry':{'type':Sequelize[_0x7c9f('0xc')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.controller.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.controller.js index 7db3bfc..ea74631 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 _0xa61d=['get','MusicOnHolds','UserProfileResource','destroy','error','stack','name','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','pick','filter','where','merge','VIRTUAL','options','VoiceMusicOnHold','include','rows','catch','show','params','keys','includeAll','find','update','body','transaction','files','directory','join','create','mode','mkdirSync','0777','user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','sequelize','readdirSync','forEach','unlinkSync','rmdirSync','Sequelize','ValidationError','addSound','findOne','save_name','converted_format','createdAt','root','server/files/sounds/converted','format','%s.%s','basename','extname','server/files/moh','symlinkSync','removeSound','id2','message','getSounds','Sound','length','order','sort','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','apply','reject','save','then'];(function(_0x2c44db,_0x1c9475){var _0x484250=function(_0x2c73e0){while(--_0x2c73e0){_0x2c44db['push'](_0x2c44db['shift']());}};_0x484250(++_0x1c9475);}(_0xa61d,0x1a0));var _0xda61=function(_0x4214af,_0x197efd){_0x4214af=_0x4214af-0x0;var _0x1f6b1e=_0xa61d[_0x4214af];return _0x1f6b1e;};'use strict';var emlformat=require(_0xda61('0x0'));var rimraf=require(_0xda61('0x1'));var zipdir=require(_0xda61('0x2'));var jsonpatch=require(_0xda61('0x3'));var rp=require(_0xda61('0x4'));var moment=require(_0xda61('0x5'));var BPromise=require(_0xda61('0x6'));var Mustache=require(_0xda61('0x7'));var util=require(_0xda61('0x8'));var path=require('path');var sox=require('sox');var csv=require(_0xda61('0x9'));var ejs=require(_0xda61('0xa'));var fs=require('fs');var fs_extra=require(_0xda61('0xb'));var _=require(_0xda61('0xc'));var squel=require(_0xda61('0xd'));var crypto=require('crypto');var jsforce=require(_0xda61('0xe'));var deskjs=require(_0xda61('0xf'));var toCsv=require(_0xda61('0x9'));var querystring=require('querystring');var Papa=require(_0xda61('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xda61('0x11'));var logger=require(_0xda61('0x12'))(_0xda61('0x13'));var utils=require('../../config/utils');var config=require(_0xda61('0x14'));var licenseUtil=require(_0xda61('0x15'));var db=require(_0xda61('0x16'))['db'];function respondWithStatusCode(_0x316142,_0x4ee19a){_0x4ee19a=_0x4ee19a||0xcc;return function(_0xcaf7cb){if(_0xcaf7cb){return _0x316142[_0xda61('0x17')](_0x4ee19a);}return _0x316142[_0xda61('0x18')](_0x4ee19a)[_0xda61('0x19')]();};}function respondWithResult(_0x1c6a85,_0x149817){_0x149817=_0x149817||0xc8;return function(_0x232fdb){if(_0x232fdb){return _0x1c6a85[_0xda61('0x18')](_0x149817)[_0xda61('0x1a')](_0x232fdb);}};}function respondWithFilteredResult(_0x3b263d,_0x35cb16){return function(_0x2e0ec4){if(_0x2e0ec4){var _0x48c844=typeof _0x35cb16[_0xda61('0x1b')]==='undefined'&&typeof _0x35cb16[_0xda61('0x1c')]===_0xda61('0x1d');var _0x435b50=_0x2e0ec4['count'];var _0x293dce=_0x48c844?0x0:_0x35cb16['offset'];var _0x559d54=_0x48c844?_0x2e0ec4[_0xda61('0x1e')]:_0x35cb16[_0xda61('0x1b')]+_0x35cb16[_0xda61('0x1c')];var _0x50cb50;if(_0x559d54>=_0x435b50){_0x559d54=_0x435b50;_0x50cb50=0xc8;}else{_0x50cb50=0xce;}_0x3b263d[_0xda61('0x18')](_0x50cb50);return _0x3b263d[_0xda61('0x1f')]('Content-Range',_0x293dce+'-'+_0x559d54+'/'+_0x435b50)['json'](_0x2e0ec4);}return null;};}function patchUpdates(_0x368ebd){return function(_0x1b972c){try{jsonpatch[_0xda61('0x20')](_0x1b972c,_0x368ebd,!![]);}catch(_0x55e51a){return BPromise[_0xda61('0x21')](_0x55e51a);}return _0x1b972c[_0xda61('0x22')]();};}function saveUpdates(_0x3643f8,_0x59b27b){return function(_0x14ffd5){if(_0x14ffd5){return _0x14ffd5['update'](_0x3643f8)[_0xda61('0x23')](function(_0x4a5fac){return _0x4a5fac;});}return null;};}function removeEntity(_0x3e5b4e,_0x3d0d13){return function(_0x1a7aff){if(_0x1a7aff){return _0x1a7aff['destroy']()[_0xda61('0x23')](function(){var _0x1842d2=_0x1a7aff[_0xda61('0x24')]({'plain':!![]});var _0x1f5e9d=_0xda61('0x25');return db[_0xda61('0x26')][_0xda61('0x27')]({'where':{'type':_0x1f5e9d,'resourceId':_0x1842d2['id']}})['then'](function(){return _0x1a7aff;});})['then'](function(){_0x3e5b4e[_0xda61('0x18')](0xcc)[_0xda61('0x19')]();});}};}function handleEntityNotFound(_0x3451ec,_0xcd5402){return function(_0x37a37e){if(!_0x37a37e){_0x3451ec[_0xda61('0x17')](0x194);}return _0x37a37e;};}function handleError(_0x3f0a23,_0x2286d6){_0x2286d6=_0x2286d6||0x1f4;return function(_0x214af2){logger[_0xda61('0x28')](_0x214af2[_0xda61('0x29')]);if(_0x214af2[_0xda61('0x2a')]){delete _0x214af2[_0xda61('0x2a')];}_0x3f0a23[_0xda61('0x18')](_0x2286d6)['send'](_0x214af2);};}exports['index']=function(_0x4fd354,_0x53a934){var _0x78f382={},_0x2937d7={},_0x3fb0d3={'count':0x0,'rows':[]};var _0xc4785e=_['map'](db['VoiceMusicOnHold'][_0xda61('0x2b')],function(_0x5ca99f){return{'name':_0x5ca99f[_0xda61('0x2c')],'type':_0x5ca99f[_0xda61('0x2d')][_0xda61('0x2e')]};});_0x2937d7[_0xda61('0x2f')]=_[_0xda61('0x30')](_0xc4785e,'name');_0x2937d7[_0xda61('0x31')]=_['keys'](_0x4fd354[_0xda61('0x31')]);_0x2937d7[_0xda61('0x32')]=_[_0xda61('0x33')](_0x2937d7['model'],_0x2937d7['query']);_0x78f382[_0xda61('0x34')]=_['intersection'](_0x2937d7[_0xda61('0x2f')],qs[_0xda61('0x35')](_0x4fd354[_0xda61('0x31')][_0xda61('0x35')]));_0x78f382['attributes']=_0x78f382[_0xda61('0x34')]['length']?_0x78f382['attributes']:_0x2937d7[_0xda61('0x2f')];if(!_0x4fd354[_0xda61('0x31')][_0xda61('0x36')](_0xda61('0x37'))){_0x78f382['limit']=qs[_0xda61('0x1c')](_0x4fd354['query']['limit']);_0x78f382['offset']=qs['offset'](_0x4fd354[_0xda61('0x31')][_0xda61('0x1b')]);}_0x78f382['order']=qs['sort'](_0x4fd354[_0xda61('0x31')]['sort']);delete _0x4fd354[_0xda61('0x31')]['sort'];_0x78f382['where']=qs[_0xda61('0x32')](_[_0xda61('0x38')](_0x4fd354[_0xda61('0x31')],_0x2937d7['filters']),_0xc4785e);if(_0x4fd354[_0xda61('0x31')][_0xda61('0x39')]){_0x78f382[_0xda61('0x3a')]=_[_0xda61('0x3b')](_0x78f382[_0xda61('0x3a')],{'$or':_[_0xda61('0x30')](_0xc4785e,function(_0x1a473d){if(_0x1a473d[_0xda61('0x2d')]!==_0xda61('0x3c')){var _0x51b112={};_0x51b112[_0x1a473d[_0xda61('0x2a')]]={'$like':'%'+_0x4fd354['query'][_0xda61('0x39')]+'%'};return _0x51b112;}})});}_0x78f382=_[_0xda61('0x3b')]({},_0x78f382,_0x4fd354[_0xda61('0x3d')]);var _0x4b2280={'where':_0x78f382[_0xda61('0x3a')]};return db[_0xda61('0x3e')]['count'](_0x4b2280)[_0xda61('0x23')](function(_0x47921d){_0x3fb0d3[_0xda61('0x1e')]=_0x47921d;if(_0x4fd354['query']['includeAll']){_0x78f382[_0xda61('0x3f')]=[{'all':!![]}];}return db[_0xda61('0x3e')]['findAll'](_0x78f382);})[_0xda61('0x23')](function(_0x1b4f65){_0x3fb0d3[_0xda61('0x40')]=_0x1b4f65;return _0x3fb0d3;})[_0xda61('0x23')](respondWithFilteredResult(_0x53a934,_0x78f382))[_0xda61('0x41')](handleError(_0x53a934,null));};exports[_0xda61('0x42')]=function(_0x568a64,_0x2c67ef){var _0xf636c1={'raw':![],'where':{'id':_0x568a64[_0xda61('0x43')]['id']}},_0x1dd544={};_0x1dd544[_0xda61('0x2f')]=_[_0xda61('0x44')](db[_0xda61('0x3e')]['rawAttributes']);_0x1dd544[_0xda61('0x31')]=_[_0xda61('0x44')](_0x568a64[_0xda61('0x31')]);_0x1dd544[_0xda61('0x32')]=_[_0xda61('0x33')](_0x1dd544['model'],_0x1dd544[_0xda61('0x31')]);_0xf636c1['attributes']=_[_0xda61('0x33')](_0x1dd544[_0xda61('0x2f')],qs[_0xda61('0x35')](_0x568a64[_0xda61('0x31')][_0xda61('0x35')]));_0xf636c1['attributes']=_0xf636c1[_0xda61('0x34')]['length']?_0xf636c1[_0xda61('0x34')]:_0x1dd544[_0xda61('0x2f')];if(_0x568a64['query'][_0xda61('0x45')]){_0xf636c1[_0xda61('0x3f')]=[{'all':!![]}];}_0xf636c1=_[_0xda61('0x3b')]({},_0xf636c1,_0x568a64['options']);return db['VoiceMusicOnHold'][_0xda61('0x46')](_0xf636c1)[_0xda61('0x23')](handleEntityNotFound(_0x2c67ef,null))['then'](respondWithResult(_0x2c67ef,null))[_0xda61('0x41')](handleError(_0x2c67ef,null));};exports[_0xda61('0x47')]=function(_0x51ebf6,_0x350d04){if(_0x51ebf6[_0xda61('0x48')]['id']){delete _0x51ebf6[_0xda61('0x48')]['id'];}return db[_0xda61('0x3e')][_0xda61('0x46')]({'where':{'id':_0x51ebf6[_0xda61('0x43')]['id']}})[_0xda61('0x23')](handleEntityNotFound(_0x350d04,null))[_0xda61('0x23')](saveUpdates(_0x51ebf6[_0xda61('0x48')],null))[_0xda61('0x23')](respondWithResult(_0x350d04,null))['catch'](handleError(_0x350d04,null));};exports['create']=function(_0x4e4a7e,_0x3eaf23,_0x37764d){return db['sequelize'][_0xda61('0x49')](function(_0x49afd7){if(_0x4e4a7e[_0xda61('0x48')]['mode']===_0xda61('0x4a')){_0x4e4a7e[_0xda61('0x48')][_0xda61('0x4b')]=path[_0xda61('0x4c')](config['root'],'server/files/moh',_0x4e4a7e[_0xda61('0x48')][_0xda61('0x2a')]);}return db[_0xda61('0x3e')][_0xda61('0x4d')](_0x4e4a7e[_0xda61('0x48')],{'transaction':_0x49afd7})['then'](function(_0x813ef){if(_0x4e4a7e[_0xda61('0x48')][_0xda61('0x4e')]===_0xda61('0x4a')){fs[_0xda61('0x4f')](_0x813ef[_0xda61('0x4b')],parseInt(_0xda61('0x50'),0x8));}var _0x518da0=_0x4e4a7e[_0xda61('0x51')][_0xda61('0x24')]({'plain':!![]});if(!_0x518da0)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x518da0['role']===_0xda61('0x51')){var _0x3a7f70=_0x813ef[_0xda61('0x24')]({'plain':!![]});return db[_0xda61('0x52')][_0xda61('0x46')]({'where':{'name':'MusicOnHolds','userProfileId':_0x518da0['userProfileId']},'raw':!![]})[_0xda61('0x23')](function(_0xbf35cc){if(_0xbf35cc&&_0xbf35cc[_0xda61('0x53')]===0x0){return db[_0xda61('0x26')][_0xda61('0x4d')]({'name':_0x3a7f70[_0xda61('0x2a')],'resourceId':_0x3a7f70['id'],'type':_0xbf35cc['name'],'sectionId':_0xbf35cc['id']},{})[_0xda61('0x23')](function(){return _0x813ef;});}else{return _0x813ef;}})[_0xda61('0x41')](function(_0x4dd516){logger['error'](_0xda61('0x54'),_0x4dd516);});}return _0x813ef;});})[_0xda61('0x23')](respondWithResult(_0x3eaf23,0xc9))[_0xda61('0x41')](handleError(_0x3eaf23,null));};exports[_0xda61('0x27')]=function(_0x374c0d,_0x5225c8,_0x2c1543){var _0x424e19;return db[_0xda61('0x3e')][_0xda61('0x46')]({'where':{'id':_0x374c0d[_0xda61('0x43')]['id']}})[_0xda61('0x23')](function(_0x5cb18f){if(_0x5cb18f){return db[_0xda61('0x55')]['transaction'](function(_0x459a34){return _0x5cb18f[_0xda61('0x27')]({'transaction':_0x459a34,'raw':!![]})[_0xda61('0x23')](function(_0x3e34fc){if(_0x3e34fc['directory']){fs[_0xda61('0x56')](_0x3e34fc[_0xda61('0x4b')])[_0xda61('0x57')](function(_0x22ec43){fs[_0xda61('0x58')](path[_0xda61('0x4c')](_0x3e34fc['directory'],_0x22ec43));});fs[_0xda61('0x59')](_0x3e34fc[_0xda61('0x4b')]);}return _0x3e34fc;});})[_0xda61('0x41')](function(_0x4f0167){throw new db[(_0xda61('0x5a'))][(_0xda61('0x5b'))](_0x4f0167['message']);});}})[_0xda61('0x23')](handleEntityNotFound(_0x5225c8,null))[_0xda61('0x23')](removeEntity(_0x5225c8,null))[_0xda61('0x41')](handleError(_0x5225c8,null));};exports[_0xda61('0x5c')]=function(_0x54d2d0,_0x103a6b,_0x20a100){return db[_0xda61('0x55')]['transaction'](function(_0x5336a1){var _0x4a1f51;return db[_0xda61('0x3e')][_0xda61('0x46')]({'where':{'id':_0x54d2d0[_0xda61('0x43')]['id']}})[_0xda61('0x23')](function(_0x352b7d){if(_0x352b7d){_0x4a1f51=_0x352b7d;return _0x352b7d[_0xda61('0x5c')](_0x54d2d0[_0xda61('0x48')]['id'],{'transaction':_0x5336a1});}})[_0xda61('0x23')](function(_0x2b7576){if(_0x2b7576){return db['Sound'][_0xda61('0x5d')]({'where':{'id':_0x54d2d0[_0xda61('0x48')]['id']},'attributes':['id','name',_0xda61('0x5e'),_0xda61('0x5f'),_0xda61('0x60')],'raw':!![]});}})[_0xda61('0x23')](function(_0x5e7880){if(_0x5e7880){var _0x557761=path[_0xda61('0x4c')](config[_0xda61('0x61')],_0xda61('0x62'),util[_0xda61('0x63')](_0xda61('0x64'),path[_0xda61('0x65')](_0x5e7880[_0xda61('0x5e')],path[_0xda61('0x66')](_0x5e7880[_0xda61('0x5e')])),_0x5e7880[_0xda61('0x5f')]));var _0x1d97be=path[_0xda61('0x4c')](config['root'],_0xda61('0x67'),_0x4a1f51['name'],util[_0xda61('0x63')](_0xda61('0x64'),_0x5e7880[_0xda61('0x2a')],_0x5e7880['converted_format']));fs[_0xda61('0x68')](_0x557761,_0x1d97be);return _0x5e7880;}})['catch'](function(_0x12b15f){throw new db[(_0xda61('0x5a'))][(_0xda61('0x5b'))](_0x12b15f['message']);});})[_0xda61('0x23')](handleEntityNotFound(_0x103a6b,null))[_0xda61('0x23')](respondWithResult(_0x103a6b,0xc9))[_0xda61('0x41')](handleError(_0x103a6b,null));};exports[_0xda61('0x69')]=function(_0x2e19b2,_0x5db386,_0x499d00){return db['sequelize'][_0xda61('0x49')](function(_0x4b0bbf){var _0x781e77;return db['VoiceMusicOnHold'][_0xda61('0x5d')]({'where':{'id':_0x2e19b2['params']['id']}})[_0xda61('0x23')](handleEntityNotFound(_0x5db386,null))[_0xda61('0x23')](function(_0x290d81){if(_0x290d81){_0x781e77=_0x290d81;return _0x290d81[_0xda61('0x69')](_0x2e19b2['params'][_0xda61('0x6a')]);}})[_0xda61('0x23')](function(_0x10193c){if(_0x10193c){return db['Sound']['findOne']({'where':{'id':_0x2e19b2[_0xda61('0x43')][_0xda61('0x6a')]},'attributes':['id',_0xda61('0x2a'),_0xda61('0x5e'),_0xda61('0x5f'),'createdAt'],'raw':!![]});}})['then'](function(_0x483bf4){if(_0x483bf4){fs[_0xda61('0x58')](path['join'](_0x781e77[_0xda61('0x4b')],util[_0xda61('0x63')]('%s.%s',_0x483bf4[_0xda61('0x2a')],_0x483bf4[_0xda61('0x5f')])));return _0x483bf4;}})['catch'](function(_0x155667){throw new db[(_0xda61('0x5a'))]['ValidationError'](_0x155667[_0xda61('0x6b')]);});})[_0xda61('0x23')](handleEntityNotFound(_0x5db386,null))['then'](respondWithStatusCode(_0x5db386,0xcc))[_0xda61('0x41')](handleError(_0x5db386,null));};exports[_0xda61('0x6c')]=function(_0x56d1f7,_0x291ac7,_0x537b57){var _0x37237d={};var _0x2021fc={};var _0x42d113;var _0x5cfdf4;return db[_0xda61('0x3e')]['findOne']({'where':{'id':_0x56d1f7['params']['id']}})[_0xda61('0x23')](handleEntityNotFound(_0x291ac7,null))[_0xda61('0x23')](function(_0x14b95c){if(_0x14b95c){_0x42d113=_0x14b95c;_0x2021fc[_0xda61('0x2f')]=_[_0xda61('0x44')](db[_0xda61('0x6d')][_0xda61('0x2b')]);_0x2021fc['query']=_[_0xda61('0x44')](_0x56d1f7[_0xda61('0x31')]);_0x2021fc[_0xda61('0x32')]=_['intersection'](_0x2021fc[_0xda61('0x2f')],_0x2021fc['query']);_0x37237d[_0xda61('0x34')]=_[_0xda61('0x33')](_0x2021fc[_0xda61('0x2f')],qs['fields'](_0x56d1f7[_0xda61('0x31')][_0xda61('0x35')]));_0x37237d[_0xda61('0x34')]=_0x37237d[_0xda61('0x34')][_0xda61('0x6e')]?_0x37237d[_0xda61('0x34')]:_0x2021fc[_0xda61('0x2f')];_0x37237d[_0xda61('0x6f')]=qs[_0xda61('0x70')](_0x56d1f7['query']['sort']);_0x37237d['where']=qs[_0xda61('0x32')](_[_0xda61('0x38')](_0x56d1f7[_0xda61('0x31')],_0x2021fc['filters']));if(_0x56d1f7[_0xda61('0x31')][_0xda61('0x39')]){_0x37237d[_0xda61('0x3a')]=_[_0xda61('0x3b')](_0x37237d[_0xda61('0x3a')],{'$or':_[_0xda61('0x30')](_0x37237d[_0xda61('0x34')],function(_0x168c44){var _0xad7f66={};_0xad7f66[_0x168c44]={'$like':'%'+_0x56d1f7[_0xda61('0x31')]['filter']+'%'};return _0xad7f66;})});}_0x37237d=_['merge']({},_0x37237d,_0x56d1f7[_0xda61('0x3d')]);return _0x42d113[_0xda61('0x6c')](_0x37237d);}})[_0xda61('0x23')](function(_0x275104){if(_0x275104){_0x5cfdf4=_0x275104[_0xda61('0x6e')];if(!_0x56d1f7[_0xda61('0x31')][_0xda61('0x36')](_0xda61('0x37'))){_0x37237d['limit']=qs[_0xda61('0x1c')](_0x56d1f7[_0xda61('0x31')][_0xda61('0x1c')]);_0x37237d[_0xda61('0x1b')]=qs['offset'](_0x56d1f7[_0xda61('0x31')]['offset']);}return _0x42d113[_0xda61('0x6c')](_0x37237d);}})[_0xda61('0x23')](function(_0x11563d){if(_0x11563d){return _0x11563d?{'count':_0x5cfdf4,'rows':_0x11563d}:null;}})[_0xda61('0x23')](respondWithResult(_0x291ac7,null))['catch'](handleError(_0x291ac7,null));}; \ No newline at end of file +var _0xa1b1=['limit','count','set','apply','reject','save','update','then','destroy','get','MusicOnHolds','UserProfileResource','error','name','send','index','map','rawAttributes','type','key','model','filters','query','fields','attributes','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','VoiceMusicOnHold','includeAll','include','findAll','rows','catch','show','params','keys','intersection','find','body','sequelize','transaction','mode','files','directory','join','root','server/files/moh','create','mkdirSync','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','forEach','rmdirSync','Sequelize','ValidationError','message','addSound','findOne','createdAt','server/files/sounds/converted','format','%s.%s','basename','save_name','extname','converted_format','symlinkSync','removeSound','id2','Sound','unlinkSync','getSounds','order','pick','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined'];(function(_0x5b561d,_0x422b7c){var _0x431060=function(_0x401409){while(--_0x401409){_0x5b561d['push'](_0x5b561d['shift']());}};_0x431060(++_0x422b7c);}(_0xa1b1,0x1a9));var _0x1a1b=function(_0x2a0755,_0xdf6bac){_0x2a0755=_0x2a0755-0x0;var _0x3eaf4f=_0xa1b1[_0x2a0755];return _0x3eaf4f;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x1a1b('0x0'));var jsonpatch=require(_0x1a1b('0x1'));var rp=require('request-promise');var moment=require(_0x1a1b('0x2'));var BPromise=require(_0x1a1b('0x3'));var Mustache=require(_0x1a1b('0x4'));var util=require(_0x1a1b('0x5'));var path=require(_0x1a1b('0x6'));var sox=require('sox');var csv=require(_0x1a1b('0x7'));var ejs=require(_0x1a1b('0x8'));var fs=require('fs');var fs_extra=require(_0x1a1b('0x9'));var _=require(_0x1a1b('0xa'));var squel=require(_0x1a1b('0xb'));var crypto=require(_0x1a1b('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x1a1b('0xd'));var toCsv=require(_0x1a1b('0x7'));var querystring=require(_0x1a1b('0xe'));var Papa=require(_0x1a1b('0xf'));var Redis=require('ioredis');var authService=require(_0x1a1b('0x10'));var qs=require(_0x1a1b('0x11'));var as=require(_0x1a1b('0x12'));var hardwareService=require(_0x1a1b('0x13'));var logger=require(_0x1a1b('0x14'))(_0x1a1b('0x15'));var utils=require(_0x1a1b('0x16'));var config=require(_0x1a1b('0x17'));var licenseUtil=require(_0x1a1b('0x18'));var db=require(_0x1a1b('0x19'))['db'];function respondWithStatusCode(_0x194422,_0xdf0398){_0xdf0398=_0xdf0398||0xcc;return function(_0x58419e){if(_0x58419e){return _0x194422[_0x1a1b('0x1a')](_0xdf0398);}return _0x194422['status'](_0xdf0398)['end']();};}function respondWithResult(_0x22f754,_0x135815){_0x135815=_0x135815||0xc8;return function(_0x56286b){if(_0x56286b){return _0x22f754[_0x1a1b('0x1b')](_0x135815)[_0x1a1b('0x1c')](_0x56286b);}};}function respondWithFilteredResult(_0x301240,_0x2572a1){return function(_0x54bf83){if(_0x54bf83){var _0x937568=typeof _0x2572a1[_0x1a1b('0x1d')]===_0x1a1b('0x1e')&&typeof _0x2572a1[_0x1a1b('0x1f')]===_0x1a1b('0x1e');var _0x544647=_0x54bf83['count'];var _0x3ee0c1=_0x937568?0x0:_0x2572a1[_0x1a1b('0x1d')];var _0x46e51e=_0x937568?_0x54bf83[_0x1a1b('0x20')]:_0x2572a1['offset']+_0x2572a1['limit'];var _0x4a7bb8;if(_0x46e51e>=_0x544647){_0x46e51e=_0x544647;_0x4a7bb8=0xc8;}else{_0x4a7bb8=0xce;}_0x301240[_0x1a1b('0x1b')](_0x4a7bb8);return _0x301240[_0x1a1b('0x21')]('Content-Range',_0x3ee0c1+'-'+_0x46e51e+'/'+_0x544647)[_0x1a1b('0x1c')](_0x54bf83);}return null;};}function patchUpdates(_0x39c002){return function(_0x37b9ee){try{jsonpatch[_0x1a1b('0x22')](_0x37b9ee,_0x39c002,!![]);}catch(_0x579555){return BPromise[_0x1a1b('0x23')](_0x579555);}return _0x37b9ee[_0x1a1b('0x24')]();};}function saveUpdates(_0x4cfb87,_0x330978){return function(_0x196dc1){if(_0x196dc1){return _0x196dc1[_0x1a1b('0x25')](_0x4cfb87)[_0x1a1b('0x26')](function(_0x30556f){return _0x30556f;});}return null;};}function removeEntity(_0x5f8069,_0x4c0ddb){return function(_0x617f9){if(_0x617f9){return _0x617f9[_0x1a1b('0x27')]()[_0x1a1b('0x26')](function(){var _0x24f9e7=_0x617f9[_0x1a1b('0x28')]({'plain':!![]});var _0x2ed8ba=_0x1a1b('0x29');return db[_0x1a1b('0x2a')][_0x1a1b('0x27')]({'where':{'type':_0x2ed8ba,'resourceId':_0x24f9e7['id']}})[_0x1a1b('0x26')](function(){return _0x617f9;});})[_0x1a1b('0x26')](function(){_0x5f8069['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4c52dd,_0x35ac3b){return function(_0x506980){if(!_0x506980){_0x4c52dd[_0x1a1b('0x1a')](0x194);}return _0x506980;};}function handleError(_0x29dea7,_0x4b4135){_0x4b4135=_0x4b4135||0x1f4;return function(_0x4a8938){logger[_0x1a1b('0x2b')](_0x4a8938['stack']);if(_0x4a8938[_0x1a1b('0x2c')]){delete _0x4a8938[_0x1a1b('0x2c')];}_0x29dea7[_0x1a1b('0x1b')](_0x4b4135)[_0x1a1b('0x2d')](_0x4a8938);};}exports[_0x1a1b('0x2e')]=function(_0x2113c4,_0x177c5d){var _0x35711e={},_0x438afb={},_0x2fe04c={'count':0x0,'rows':[]};var _0x271ef5=_[_0x1a1b('0x2f')](db['VoiceMusicOnHold'][_0x1a1b('0x30')],function(_0x5a9e24){return{'name':_0x5a9e24['fieldName'],'type':_0x5a9e24[_0x1a1b('0x31')][_0x1a1b('0x32')]};});_0x438afb[_0x1a1b('0x33')]=_['map'](_0x271ef5,_0x1a1b('0x2c'));_0x438afb['query']=_['keys'](_0x2113c4['query']);_0x438afb[_0x1a1b('0x34')]=_['intersection'](_0x438afb['model'],_0x438afb[_0x1a1b('0x35')]);_0x35711e['attributes']=_['intersection'](_0x438afb['model'],qs[_0x1a1b('0x36')](_0x2113c4[_0x1a1b('0x35')][_0x1a1b('0x36')]));_0x35711e['attributes']=_0x35711e[_0x1a1b('0x37')]['length']?_0x35711e[_0x1a1b('0x37')]:_0x438afb[_0x1a1b('0x33')];if(!_0x2113c4[_0x1a1b('0x35')][_0x1a1b('0x38')](_0x1a1b('0x39'))){_0x35711e[_0x1a1b('0x1f')]=qs[_0x1a1b('0x1f')](_0x2113c4[_0x1a1b('0x35')][_0x1a1b('0x1f')]);_0x35711e['offset']=qs[_0x1a1b('0x1d')](_0x2113c4[_0x1a1b('0x35')][_0x1a1b('0x1d')]);}_0x35711e['order']=qs[_0x1a1b('0x3a')](_0x2113c4[_0x1a1b('0x35')][_0x1a1b('0x3a')]);delete _0x2113c4[_0x1a1b('0x35')]['sort'];_0x35711e[_0x1a1b('0x3b')]=qs[_0x1a1b('0x34')](_['pick'](_0x2113c4[_0x1a1b('0x35')],_0x438afb[_0x1a1b('0x34')]),_0x271ef5);if(_0x2113c4[_0x1a1b('0x35')][_0x1a1b('0x3c')]){_0x35711e['where']=_[_0x1a1b('0x3d')](_0x35711e[_0x1a1b('0x3b')],{'$or':_[_0x1a1b('0x2f')](_0x271ef5,function(_0x186fa1){if(_0x186fa1['type']!==_0x1a1b('0x3e')){var _0x192dc9={};_0x192dc9[_0x186fa1[_0x1a1b('0x2c')]]={'$like':'%'+_0x2113c4[_0x1a1b('0x35')]['filter']+'%'};return _0x192dc9;}})});}_0x35711e=_[_0x1a1b('0x3d')]({},_0x35711e,_0x2113c4[_0x1a1b('0x3f')]);var _0x272afa={'where':_0x35711e[_0x1a1b('0x3b')]};return db[_0x1a1b('0x40')][_0x1a1b('0x20')](_0x272afa)['then'](function(_0x12038f){_0x2fe04c['count']=_0x12038f;if(_0x2113c4[_0x1a1b('0x35')][_0x1a1b('0x41')]){_0x35711e[_0x1a1b('0x42')]=[{'all':!![]}];}return db[_0x1a1b('0x40')][_0x1a1b('0x43')](_0x35711e);})[_0x1a1b('0x26')](function(_0x1c0563){_0x2fe04c[_0x1a1b('0x44')]=_0x1c0563;return _0x2fe04c;})['then'](respondWithFilteredResult(_0x177c5d,_0x35711e))[_0x1a1b('0x45')](handleError(_0x177c5d,null));};exports[_0x1a1b('0x46')]=function(_0x38be37,_0x10a030){var _0x45358e={'raw':![],'where':{'id':_0x38be37[_0x1a1b('0x47')]['id']}},_0x22d32f={};_0x22d32f['model']=_[_0x1a1b('0x48')](db[_0x1a1b('0x40')][_0x1a1b('0x30')]);_0x22d32f[_0x1a1b('0x35')]=_[_0x1a1b('0x48')](_0x38be37[_0x1a1b('0x35')]);_0x22d32f[_0x1a1b('0x34')]=_[_0x1a1b('0x49')](_0x22d32f[_0x1a1b('0x33')],_0x22d32f[_0x1a1b('0x35')]);_0x45358e[_0x1a1b('0x37')]=_[_0x1a1b('0x49')](_0x22d32f[_0x1a1b('0x33')],qs[_0x1a1b('0x36')](_0x38be37[_0x1a1b('0x35')][_0x1a1b('0x36')]));_0x45358e[_0x1a1b('0x37')]=_0x45358e[_0x1a1b('0x37')]['length']?_0x45358e[_0x1a1b('0x37')]:_0x22d32f['model'];if(_0x38be37[_0x1a1b('0x35')][_0x1a1b('0x41')]){_0x45358e[_0x1a1b('0x42')]=[{'all':!![]}];}_0x45358e=_[_0x1a1b('0x3d')]({},_0x45358e,_0x38be37[_0x1a1b('0x3f')]);return db[_0x1a1b('0x40')][_0x1a1b('0x4a')](_0x45358e)['then'](handleEntityNotFound(_0x10a030,null))[_0x1a1b('0x26')](respondWithResult(_0x10a030,null))[_0x1a1b('0x45')](handleError(_0x10a030,null));};exports[_0x1a1b('0x25')]=function(_0x4dae64,_0x448af3){if(_0x4dae64[_0x1a1b('0x4b')]['id']){delete _0x4dae64[_0x1a1b('0x4b')]['id'];}return db[_0x1a1b('0x40')]['find']({'where':{'id':_0x4dae64[_0x1a1b('0x47')]['id']}})[_0x1a1b('0x26')](handleEntityNotFound(_0x448af3,null))[_0x1a1b('0x26')](saveUpdates(_0x4dae64[_0x1a1b('0x4b')],null))[_0x1a1b('0x26')](respondWithResult(_0x448af3,null))['catch'](handleError(_0x448af3,null));};exports['create']=function(_0x19d46c,_0x32cfd3,_0x3c2035){return db[_0x1a1b('0x4c')][_0x1a1b('0x4d')](function(_0xa4d8a1){if(_0x19d46c[_0x1a1b('0x4b')][_0x1a1b('0x4e')]===_0x1a1b('0x4f')){_0x19d46c[_0x1a1b('0x4b')][_0x1a1b('0x50')]=path[_0x1a1b('0x51')](config[_0x1a1b('0x52')],_0x1a1b('0x53'),_0x19d46c[_0x1a1b('0x4b')]['name']);}return db[_0x1a1b('0x40')][_0x1a1b('0x54')](_0x19d46c[_0x1a1b('0x4b')],{'transaction':_0xa4d8a1})['then'](function(_0x4cfd67){if(_0x19d46c[_0x1a1b('0x4b')][_0x1a1b('0x4e')]==='files'){fs[_0x1a1b('0x55')](_0x4cfd67[_0x1a1b('0x50')],parseInt('0777',0x8));}var _0x2d7535=_0x19d46c[_0x1a1b('0x56')][_0x1a1b('0x28')]({'plain':!![]});if(!_0x2d7535)throw new Error(_0x1a1b('0x57'));if(_0x2d7535['role']===_0x1a1b('0x56')){var _0x5789bd=_0x4cfd67[_0x1a1b('0x28')]({'plain':!![]});return db[_0x1a1b('0x58')][_0x1a1b('0x4a')]({'where':{'name':_0x1a1b('0x29'),'userProfileId':_0x2d7535[_0x1a1b('0x59')]},'raw':!![]})[_0x1a1b('0x26')](function(_0x4cc8d9){if(_0x4cc8d9&&_0x4cc8d9[_0x1a1b('0x5a')]===0x0){return db['UserProfileResource'][_0x1a1b('0x54')]({'name':_0x5789bd['name'],'resourceId':_0x5789bd['id'],'type':_0x4cc8d9[_0x1a1b('0x2c')],'sectionId':_0x4cc8d9['id']},{})['then'](function(){return _0x4cfd67;});}else{return _0x4cfd67;}})[_0x1a1b('0x45')](function(_0x3eca59){logger[_0x1a1b('0x2b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3eca59);});}return _0x4cfd67;});})[_0x1a1b('0x26')](respondWithResult(_0x32cfd3,0xc9))[_0x1a1b('0x45')](handleError(_0x32cfd3,null));};exports[_0x1a1b('0x27')]=function(_0x169fb5,_0x2fc2b6,_0x276453){var _0x5095fe;return db[_0x1a1b('0x40')][_0x1a1b('0x4a')]({'where':{'id':_0x169fb5[_0x1a1b('0x47')]['id']}})[_0x1a1b('0x26')](function(_0x21ccef){if(_0x21ccef){return db[_0x1a1b('0x4c')][_0x1a1b('0x4d')](function(_0x482c18){return _0x21ccef[_0x1a1b('0x27')]({'transaction':_0x482c18,'raw':!![]})[_0x1a1b('0x26')](function(_0x573e1d){if(_0x573e1d[_0x1a1b('0x50')]){fs['readdirSync'](_0x573e1d[_0x1a1b('0x50')])[_0x1a1b('0x5b')](function(_0x2af724){fs['unlinkSync'](path[_0x1a1b('0x51')](_0x573e1d[_0x1a1b('0x50')],_0x2af724));});fs[_0x1a1b('0x5c')](_0x573e1d[_0x1a1b('0x50')]);}return _0x573e1d;});})[_0x1a1b('0x45')](function(_0x3565ca){throw new db[(_0x1a1b('0x5d'))][(_0x1a1b('0x5e'))](_0x3565ca[_0x1a1b('0x5f')]);});}})[_0x1a1b('0x26')](handleEntityNotFound(_0x2fc2b6,null))[_0x1a1b('0x26')](removeEntity(_0x2fc2b6,null))[_0x1a1b('0x45')](handleError(_0x2fc2b6,null));};exports['addSound']=function(_0x5a2a99,_0x36692b,_0xa0be37){return db[_0x1a1b('0x4c')]['transaction'](function(_0x5395ab){var _0x426705;return db['VoiceMusicOnHold'][_0x1a1b('0x4a')]({'where':{'id':_0x5a2a99['params']['id']}})[_0x1a1b('0x26')](function(_0xa4fa57){if(_0xa4fa57){_0x426705=_0xa4fa57;return _0xa4fa57[_0x1a1b('0x60')](_0x5a2a99[_0x1a1b('0x4b')]['id'],{'transaction':_0x5395ab});}})[_0x1a1b('0x26')](function(_0x24b76a){if(_0x24b76a){return db['Sound'][_0x1a1b('0x61')]({'where':{'id':_0x5a2a99[_0x1a1b('0x4b')]['id']},'attributes':['id',_0x1a1b('0x2c'),'save_name','converted_format',_0x1a1b('0x62')],'raw':!![]});}})['then'](function(_0x2131f7){if(_0x2131f7){var _0x5208d7=path[_0x1a1b('0x51')](config[_0x1a1b('0x52')],_0x1a1b('0x63'),util[_0x1a1b('0x64')](_0x1a1b('0x65'),path[_0x1a1b('0x66')](_0x2131f7[_0x1a1b('0x67')],path[_0x1a1b('0x68')](_0x2131f7[_0x1a1b('0x67')])),_0x2131f7[_0x1a1b('0x69')]));var _0x5239ca=path[_0x1a1b('0x51')](config[_0x1a1b('0x52')],_0x1a1b('0x53'),_0x426705[_0x1a1b('0x2c')],util[_0x1a1b('0x64')](_0x1a1b('0x65'),_0x2131f7[_0x1a1b('0x2c')],_0x2131f7[_0x1a1b('0x69')]));fs[_0x1a1b('0x6a')](_0x5208d7,_0x5239ca);return _0x2131f7;}})[_0x1a1b('0x45')](function(_0x5becd8){throw new db[(_0x1a1b('0x5d'))][(_0x1a1b('0x5e'))](_0x5becd8[_0x1a1b('0x5f')]);});})[_0x1a1b('0x26')](handleEntityNotFound(_0x36692b,null))[_0x1a1b('0x26')](respondWithResult(_0x36692b,0xc9))[_0x1a1b('0x45')](handleError(_0x36692b,null));};exports[_0x1a1b('0x6b')]=function(_0x137be2,_0x128d04,_0xb070d1){return db['sequelize'][_0x1a1b('0x4d')](function(_0x376afe){var _0x4a01c2;return db[_0x1a1b('0x40')][_0x1a1b('0x61')]({'where':{'id':_0x137be2[_0x1a1b('0x47')]['id']}})[_0x1a1b('0x26')](handleEntityNotFound(_0x128d04,null))[_0x1a1b('0x26')](function(_0x6c8975){if(_0x6c8975){_0x4a01c2=_0x6c8975;return _0x6c8975[_0x1a1b('0x6b')](_0x137be2[_0x1a1b('0x47')][_0x1a1b('0x6c')]);}})['then'](function(_0x410cdd){if(_0x410cdd){return db[_0x1a1b('0x6d')][_0x1a1b('0x61')]({'where':{'id':_0x137be2[_0x1a1b('0x47')]['id2']},'attributes':['id',_0x1a1b('0x2c'),_0x1a1b('0x67'),_0x1a1b('0x69'),_0x1a1b('0x62')],'raw':!![]});}})[_0x1a1b('0x26')](function(_0x284b4c){if(_0x284b4c){fs[_0x1a1b('0x6e')](path[_0x1a1b('0x51')](_0x4a01c2[_0x1a1b('0x50')],util[_0x1a1b('0x64')](_0x1a1b('0x65'),_0x284b4c[_0x1a1b('0x2c')],_0x284b4c[_0x1a1b('0x69')])));return _0x284b4c;}})[_0x1a1b('0x45')](function(_0xb56828){throw new db[(_0x1a1b('0x5d'))]['ValidationError'](_0xb56828['message']);});})['then'](handleEntityNotFound(_0x128d04,null))[_0x1a1b('0x26')](respondWithStatusCode(_0x128d04,0xcc))['catch'](handleError(_0x128d04,null));};exports[_0x1a1b('0x6f')]=function(_0x2b7cbf,_0x6b8ff5,_0x42b08c){var _0x293d6f={};var _0x1cb71d={};var _0x328479;var _0x48c8e6;return db[_0x1a1b('0x40')]['findOne']({'where':{'id':_0x2b7cbf[_0x1a1b('0x47')]['id']}})[_0x1a1b('0x26')](handleEntityNotFound(_0x6b8ff5,null))[_0x1a1b('0x26')](function(_0x20adc1){if(_0x20adc1){_0x328479=_0x20adc1;_0x1cb71d[_0x1a1b('0x33')]=_[_0x1a1b('0x48')](db['Sound'][_0x1a1b('0x30')]);_0x1cb71d['query']=_[_0x1a1b('0x48')](_0x2b7cbf[_0x1a1b('0x35')]);_0x1cb71d['filters']=_['intersection'](_0x1cb71d[_0x1a1b('0x33')],_0x1cb71d[_0x1a1b('0x35')]);_0x293d6f[_0x1a1b('0x37')]=_[_0x1a1b('0x49')](_0x1cb71d['model'],qs[_0x1a1b('0x36')](_0x2b7cbf[_0x1a1b('0x35')][_0x1a1b('0x36')]));_0x293d6f['attributes']=_0x293d6f[_0x1a1b('0x37')]['length']?_0x293d6f[_0x1a1b('0x37')]:_0x1cb71d[_0x1a1b('0x33')];_0x293d6f[_0x1a1b('0x70')]=qs[_0x1a1b('0x3a')](_0x2b7cbf[_0x1a1b('0x35')][_0x1a1b('0x3a')]);_0x293d6f[_0x1a1b('0x3b')]=qs[_0x1a1b('0x34')](_[_0x1a1b('0x71')](_0x2b7cbf[_0x1a1b('0x35')],_0x1cb71d[_0x1a1b('0x34')]));if(_0x2b7cbf['query']['filter']){_0x293d6f[_0x1a1b('0x3b')]=_[_0x1a1b('0x3d')](_0x293d6f[_0x1a1b('0x3b')],{'$or':_[_0x1a1b('0x2f')](_0x293d6f[_0x1a1b('0x37')],function(_0x3e464c){var _0x22d74d={};_0x22d74d[_0x3e464c]={'$like':'%'+_0x2b7cbf[_0x1a1b('0x35')]['filter']+'%'};return _0x22d74d;})});}_0x293d6f=_[_0x1a1b('0x3d')]({},_0x293d6f,_0x2b7cbf[_0x1a1b('0x3f')]);return _0x328479[_0x1a1b('0x6f')](_0x293d6f);}})[_0x1a1b('0x26')](function(_0x531f51){if(_0x531f51){_0x48c8e6=_0x531f51['length'];if(!_0x2b7cbf[_0x1a1b('0x35')]['hasOwnProperty']('nolimit')){_0x293d6f[_0x1a1b('0x1f')]=qs[_0x1a1b('0x1f')](_0x2b7cbf[_0x1a1b('0x35')][_0x1a1b('0x1f')]);_0x293d6f[_0x1a1b('0x1d')]=qs[_0x1a1b('0x1d')](_0x2b7cbf[_0x1a1b('0x35')][_0x1a1b('0x1d')]);}return _0x328479[_0x1a1b('0x6f')](_0x293d6f);}})[_0x1a1b('0x26')](function(_0x49d736){if(_0x49d736){return _0x49d736?{'count':_0x48c8e6,'rows':_0x49d736}:null;}})['then'](respondWithResult(_0x6b8ff5,null))[_0x1a1b('0x45')](handleError(_0x6b8ff5,null));}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js index 1c05470..c8d38c2 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 _0xdb41=['../../config/environment','./voiceMusicOnHold.attributes','exports','define','VoiceMusicOnHold','voice_musiconhold','util','bluebird','request-promise','path'];(function(_0x2bece8,_0x27c181){var _0xc01f33=function(_0x343e2b){while(--_0x343e2b){_0x2bece8['push'](_0x2bece8['shift']());}};_0xc01f33(++_0x27c181);}(_0xdb41,0x7e));var _0x1db4=function(_0x362a04,_0x3d71ae){_0x362a04=_0x362a04-0x0;var _0x17a8b0=_0xdb41[_0x362a04];return _0x17a8b0;};'use strict';var _=require('lodash');var util=require(_0x1db4('0x0'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x1db4('0x1'));var rp=require(_0x1db4('0x2'));var fs=require('fs');var path=require(_0x1db4('0x3'));var rimraf=require('rimraf');var config=require(_0x1db4('0x4'));var attributes=require(_0x1db4('0x5'));module[_0x1db4('0x6')]=function(_0x4d2019,_0x4aa9e9){return _0x4d2019[_0x1db4('0x7')](_0x1db4('0x8'),attributes,{'tableName':_0x1db4('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7ac2=['request-promise','path','rimraf','exports','define','voice_musiconhold','util','../../config/logger'];(function(_0x2d147c,_0x1c88b6){var _0x43ef9d=function(_0x229e09){while(--_0x229e09){_0x2d147c['push'](_0x2d147c['shift']());}};_0x43ef9d(++_0x1c88b6);}(_0x7ac2,0x15e));var _0x27ac=function(_0x44d3ad,_0x52f9cd){_0x44d3ad=_0x44d3ad-0x0;var _0x4f635c=_0x7ac2[_0x44d3ad];return _0x4f635c;};'use strict';var _=require('lodash');var util=require(_0x27ac('0x0'));var logger=require(_0x27ac('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x27ac('0x2'));var fs=require('fs');var path=require(_0x27ac('0x3'));var rimraf=require(_0x27ac('0x4'));var config=require('../../config/environment');var attributes=require('./voiceMusicOnHold.attributes');module[_0x27ac('0x5')]=function(_0x50c688,_0x18cfd7){return _0x50c688[_0x27ac('0x6')]('VoiceMusicOnHold',attributes,{'tableName':_0x27ac('0x7'),'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 7830310..1f8d8df 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 _0x9c44=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','client','http','request','then','request\x20sent','debug','stringify','code','error','message','VoiceMusicOnHold,\x20%s,\x20%s','info','result','catch','moment','bluebird'];(function(_0x211644,_0x45b6ef){var _0x11132e=function(_0x53250d){while(--_0x53250d){_0x211644['push'](_0x211644['shift']());}};_0x11132e(++_0x45b6ef);}(_0x9c44,0x178));var _0x49c4=function(_0x3d42d8,_0x4cffaa){_0x3d42d8=_0x3d42d8-0x0;var _0x27fc41=_0x9c44[_0x3d42d8];return _0x27fc41;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x49c4('0x0'));var BPromise=require(_0x49c4('0x1'));var rs=require(_0x49c4('0x2'));var fs=require('fs');var Redis=require(_0x49c4('0x3'));var db=require(_0x49c4('0x4'))['db'];var utils=require(_0x49c4('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x49c4('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x49c4('0x7')][_0x49c4('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x69bc41,_0x2c4e2e,_0x436234){return new BPromise(function(_0x511d53,_0x11c586){return client[_0x49c4('0x9')](_0x69bc41,_0x436234)[_0x49c4('0xa')](function(_0x4487ca){logger['info']('VoiceMusicOnHold,\x20%s,\x20%s',_0x2c4e2e,_0x49c4('0xb'));logger[_0x49c4('0xc')]('VoiceMusicOnHold,\x20%s,\x20%s,\x20%s',_0x2c4e2e,_0x49c4('0xb'),JSON[_0x49c4('0xd')](_0x4487ca));if(_0x4487ca['error']){if(_0x4487ca['error'][_0x49c4('0xe')]===0x1f4){logger[_0x49c4('0xf')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x2c4e2e,_0x4487ca[_0x49c4('0xf')][_0x49c4('0x10')]);return _0x11c586(_0x4487ca['error'][_0x49c4('0x10')]);}logger[_0x49c4('0xf')](_0x49c4('0x11'),_0x2c4e2e,_0x4487ca[_0x49c4('0xf')][_0x49c4('0x10')]);return _0x511d53(_0x4487ca[_0x49c4('0xf')][_0x49c4('0x10')]);}else{logger[_0x49c4('0x12')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x2c4e2e,_0x49c4('0xb'));_0x511d53(_0x4487ca[_0x49c4('0x13')][_0x49c4('0x10')]);}})[_0x49c4('0x14')](function(_0x2abc78){logger['error'](_0x49c4('0x11'),_0x2c4e2e,_0x2abc78);_0x11c586(_0x2abc78);});});} \ 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','VoiceMusicOnHold,\x20%s,\x20%s','request\x20sent','debug','VoiceMusicOnHold,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch'];(function(_0x19ccbf,_0x16760a){var _0x268c0e=function(_0x56249a){while(--_0x56249a){_0x19ccbf['push'](_0x19ccbf['shift']());}};_0x268c0e(++_0x16760a);}(_0x34e8,0x12c));var _0x834e=function(_0x4fd6d9,_0x31af6f){_0x4fd6d9=_0x4fd6d9-0x0;var _0x32e823=_0x34e8[_0x4fd6d9];return _0x32e823;};'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')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x3e16d2,_0x834e('0x10'));_0x3a3ef6(_0x363786[_0x834e('0x17')]['message']);}})[_0x834e('0x18')](function(_0x22106e){logger[_0x834e('0x14')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x3e16d2,_0x22106e);_0x2e69e2(_0x22106e);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/index.js b/server/api/voicePrefix/index.js index 64910c6..c59e905 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 _0xeed7=['isAuthenticated','getAgents','/:id/teams','getTeams','post','create','addAgents','addTeams','put','update','destroy','removeAgents','delete','removeTeams','exports','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./voicePrefix.controller','get','index','/describe','/:id'];(function(_0xac151d,_0x4ea1d2){var _0x111dba=function(_0x13d7f4){while(--_0x13d7f4){_0xac151d['push'](_0xac151d['shift']());}};_0x111dba(++_0x4ea1d2);}(_0xeed7,0xdf));var _0x7eed=function(_0x160c05,_0x4f2e4f){_0x160c05=_0x160c05-0x0;var _0x1af111=_0xeed7[_0x160c05];return _0x1af111;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x7eed('0x0'));var timeout=require(_0x7eed('0x1'));var express=require('express');var router=express[_0x7eed('0x2')]();var fs_extra=require(_0x7eed('0x3'));var auth=require(_0x7eed('0x4'));var interaction=require(_0x7eed('0x5'));var config=require('../../config/environment');var controller=require(_0x7eed('0x6'));router[_0x7eed('0x7')]('/',auth['isAuthenticated'](),controller[_0x7eed('0x8')]);router[_0x7eed('0x7')](_0x7eed('0x9'),auth['isAuthenticated'](),controller['describe']);router[_0x7eed('0x7')](_0x7eed('0xa'),auth[_0x7eed('0xb')](),controller['show']);router[_0x7eed('0x7')]('/:id/users',auth['isAuthenticated'](),controller[_0x7eed('0xc')]);router[_0x7eed('0x7')](_0x7eed('0xd'),auth[_0x7eed('0xb')](),controller[_0x7eed('0xe')]);router[_0x7eed('0xf')]('/',auth[_0x7eed('0xb')](),controller[_0x7eed('0x10')]);router[_0x7eed('0xf')]('/:id/users',auth[_0x7eed('0xb')](),controller[_0x7eed('0x11')]);router[_0x7eed('0xf')]('/:id/teams',auth['isAuthenticated'](),controller[_0x7eed('0x12')]);router[_0x7eed('0x13')](_0x7eed('0xa'),auth[_0x7eed('0xb')](),controller[_0x7eed('0x14')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x7eed('0x15')]);router['delete']('/:id/users',auth['isAuthenticated'](),controller[_0x7eed('0x16')]);router[_0x7eed('0x17')](_0x7eed('0xd'),auth[_0x7eed('0xb')](),controller[_0x7eed('0x18')]);module[_0x7eed('0x19')]=router; \ No newline at end of file +var _0x04f1=['/:id','show','getAgents','/:id/teams','getTeams','post','create','addAgents','addTeams','put','update','delete','destroy','/:id/users','removeAgents','removeTeams','multer','util','path','Router','fs-extra','../../components/auth/service','index','get','/describe','isAuthenticated'];(function(_0x313dd0,_0x20a25b){var _0x18d342=function(_0x4bdb43){while(--_0x4bdb43){_0x313dd0['push'](_0x313dd0['shift']());}};_0x18d342(++_0x20a25b);}(_0x04f1,0x92));var _0x104f=function(_0x4a874c,_0x33eed2){_0x4a874c=_0x4a874c-0x0;var _0x4eb7db=_0x04f1[_0x4a874c];return _0x4eb7db;};'use strict';var multer=require(_0x104f('0x0'));var util=require(_0x104f('0x1'));var path=require(_0x104f('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x104f('0x3')]();var fs_extra=require(_0x104f('0x4'));var auth=require(_0x104f('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./voicePrefix.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x104f('0x6')]);router[_0x104f('0x7')](_0x104f('0x8'),auth[_0x104f('0x9')](),controller['describe']);router[_0x104f('0x7')](_0x104f('0xa'),auth[_0x104f('0x9')](),controller[_0x104f('0xb')]);router['get']('/:id/users',auth[_0x104f('0x9')](),controller[_0x104f('0xc')]);router[_0x104f('0x7')](_0x104f('0xd'),auth[_0x104f('0x9')](),controller[_0x104f('0xe')]);router[_0x104f('0xf')]('/',auth[_0x104f('0x9')](),controller[_0x104f('0x10')]);router[_0x104f('0xf')]('/:id/users',auth[_0x104f('0x9')](),controller[_0x104f('0x11')]);router[_0x104f('0xf')](_0x104f('0xd'),auth[_0x104f('0x9')](),controller[_0x104f('0x12')]);router[_0x104f('0x13')](_0x104f('0xa'),auth[_0x104f('0x9')](),controller[_0x104f('0x14')]);router[_0x104f('0x15')](_0x104f('0xa'),auth[_0x104f('0x9')](),controller[_0x104f('0x16')]);router['delete'](_0x104f('0x17'),auth[_0x104f('0x9')](),controller[_0x104f('0x18')]);router[_0x104f('0x15')]('/:id/teams',auth[_0x104f('0x9')](),controller[_0x104f('0x19')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.attributes.js b/server/api/voicePrefix/voicePrefix.attributes.js index 6de4cf1..a751837 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 _0xc2f7=['exports','STRING','name','INTEGER','sequelize'];(function(_0x565d34,_0x4176da){var _0x3751e7=function(_0x42428b){while(--_0x42428b){_0x565d34['push'](_0x565d34['shift']());}};_0x3751e7(++_0x4176da);}(_0xc2f7,0xc2));var _0x7c2f=function(_0xb17878,_0x1ce0ba){_0xb17878=_0xb17878-0x0;var _0x5da255=_0xc2f7[_0xb17878];return _0x5da255;};'use strict';var Sequelize=require(_0x7c2f('0x0'));module[_0x7c2f('0x1')]={'name':{'type':Sequelize[_0x7c2f('0x2')],'allowNull':![],'unique':_0x7c2f('0x3')},'prefix':{'type':Sequelize['VIRTUAL'],'get':function(_0x22f7b5){return'system-'+this['getDataValue'](_0x7c2f('0x3'))+'-';}},'description':{'type':Sequelize[_0x7c2f('0x2')]},'callerIdAll':{'type':Sequelize[_0x7c2f('0x2')]},'VoiceExtensionId':{'type':Sequelize[_0x7c2f('0x4')]}}; \ No newline at end of file +var _0x9384=['VIRTUAL','system-','getDataValue','INTEGER','exports','STRING','name'];(function(_0x2b0074,_0x42d50b){var _0x25b012=function(_0x53d3b9){while(--_0x53d3b9){_0x2b0074['push'](_0x2b0074['shift']());}};_0x25b012(++_0x42d50b);}(_0x9384,0x11c));var _0x4938=function(_0x45d3f0,_0x4be53f){_0x45d3f0=_0x45d3f0-0x0;var _0x314b79=_0x9384[_0x45d3f0];return _0x314b79;};'use strict';var Sequelize=require('sequelize');module[_0x4938('0x0')]={'name':{'type':Sequelize[_0x4938('0x1')],'allowNull':![],'unique':_0x4938('0x2')},'prefix':{'type':Sequelize[_0x4938('0x3')],'get':function(_0x14a534){return _0x4938('0x4')+this[_0x4938('0x5')](_0x4938('0x2'))+'-';}},'description':{'type':Sequelize[_0x4938('0x1')]},'callerIdAll':{'type':Sequelize[_0x4938('0x1')]},'VoiceExtensionId':{'type':Sequelize[_0x4938('0x6')]}}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.controller.js b/server/api/voicePrefix/voicePrefix.controller.js index b6f6e7e..c1c5b59 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 _0x236c=['User','getAgents','getTeams','Team','pick','addTeams','findAll','Agents','online','interface','flatMap','each','TeamVoicePrefix','UserVoicePrefix','findOrCreate','forEach','removeTeams','select','team_has_voice_prefixes','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','VoicePrefixId\x20=\x20?','clone','ut.UserId\x20=\x20?','toString','QueryTypes','TeamId','includes','all','union','compact','value','isEmpty','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','defaults','socket.io-emitter','redis','./voicePrefix.socket','register','status','end','undefined','count','offset','limit','set','json','apply','reject','save','update','then','UserProfileResource','sendStatus','stack','name','send','index','map','VoicePrefix','rawAttributes','fieldName','query','keys','filters','intersection','attributes','fields','length','model','hasOwnProperty','nolimit','order','sort','filter','where','merge','type','VIRTUAL','options','includeAll','include','rows','catch','show','find','destroy','params','describe','create','sequelize','transaction','get','VoiceExtension','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','error','context','exten','system','description','Voice\x20Prefix\x20Extension','appdata','prefix','NoOp','Voice\x20Prefix','bulkCreate','push','Set','CDR(prefix)=','callerIdAll','No\x20callerid\x20available','goto','${EXTEN:','charAt','body','system-','findById','addAgents','ids','omit','spread','removeAgents','isArray','emit','userVoicePrefix:remove','findOne'];(function(_0x2aec52,_0x59d962){var _0x3b8835=function(_0x3e2604){while(--_0x3e2604){_0x2aec52['push'](_0x2aec52['shift']());}};_0x3b8835(++_0x59d962);}(_0x236c,0x155));var _0xc236=function(_0x15b56e,_0x2aa3fe){_0x15b56e=_0x15b56e-0x0;var _0x3807c2=_0x236c[_0x15b56e];return _0x3807c2;};'use strict';var emlformat=require(_0xc236('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xc236('0x1'));var jsonpatch=require(_0xc236('0x2'));var rp=require(_0xc236('0x3'));var moment=require(_0xc236('0x4'));var BPromise=require(_0xc236('0x5'));var Mustache=require('mustache');var util=require(_0xc236('0x6'));var path=require(_0xc236('0x7'));var sox=require(_0xc236('0x8'));var csv=require(_0xc236('0x9'));var ejs=require(_0xc236('0xa'));var fs=require('fs');var fs_extra=require(_0xc236('0xb'));var _=require('lodash');var squel=require(_0xc236('0xc'));var crypto=require(_0xc236('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xc236('0xe'));var Papa=require('papaparse');var Redis=require(_0xc236('0xf'));var authService=require(_0xc236('0x10'));var qs=require(_0xc236('0x11'));var as=require(_0xc236('0x12'));var hardwareService=require(_0xc236('0x13'));var logger=require('../../config/logger')(_0xc236('0x14'));var utils=require(_0xc236('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xc236('0x16'));var db=require(_0xc236('0x17'))['db'];config['redis']=_[_0xc236('0x18')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xc236('0x19'))(new Redis(config[_0xc236('0x1a')]));require(_0xc236('0x1b'))[_0xc236('0x1c')](socket);function respondWithStatusCode(_0x5052db,_0x13a42b){_0x13a42b=_0x13a42b||0xcc;return function(_0x55b188){if(_0x55b188){return _0x5052db['sendStatus'](_0x13a42b);}return _0x5052db[_0xc236('0x1d')](_0x13a42b)[_0xc236('0x1e')]();};}function respondWithResult(_0x443a46,_0x1aeafc){_0x1aeafc=_0x1aeafc||0xc8;return function(_0x267913){if(_0x267913){return _0x443a46['status'](_0x1aeafc)['json'](_0x267913);}};}function respondWithFilteredResult(_0x57355b,_0x3f5884){return function(_0x76f45){if(_0x76f45){var _0x11ec65=typeof _0x3f5884['offset']===_0xc236('0x1f')&&typeof _0x3f5884['limit']==='undefined';var _0x1eafba=_0x76f45[_0xc236('0x20')];var _0x3a6183=_0x11ec65?0x0:_0x3f5884[_0xc236('0x21')];var _0x2b6d3f=_0x11ec65?_0x76f45[_0xc236('0x20')]:_0x3f5884[_0xc236('0x21')]+_0x3f5884[_0xc236('0x22')];var _0x54ffac;if(_0x2b6d3f>=_0x1eafba){_0x2b6d3f=_0x1eafba;_0x54ffac=0xc8;}else{_0x54ffac=0xce;}_0x57355b[_0xc236('0x1d')](_0x54ffac);return _0x57355b[_0xc236('0x23')]('Content-Range',_0x3a6183+'-'+_0x2b6d3f+'/'+_0x1eafba)[_0xc236('0x24')](_0x76f45);}return null;};}function patchUpdates(_0x34d73a){return function(_0x3bd41b){try{jsonpatch[_0xc236('0x25')](_0x3bd41b,_0x34d73a,!![]);}catch(_0x27afba){return BPromise[_0xc236('0x26')](_0x27afba);}return _0x3bd41b[_0xc236('0x27')]();};}function saveUpdates(_0xf921e6,_0x1d65e2){return function(_0x3b4059){if(_0x3b4059){return _0x3b4059[_0xc236('0x28')](_0xf921e6)['then'](function(_0x308cd6){return _0x308cd6;});}return null;};}function removeEntity(_0x21d78f,_0x356042){return function(_0x9017ec){if(_0x9017ec){return _0x9017ec['destroy']()[_0xc236('0x29')](function(){var _0x5da4b2=_0x9017ec['get']({'plain':!![]});var _0x15ead8='VoicePrefixes';return db[_0xc236('0x2a')]['destroy']({'where':{'type':_0x15ead8,'resourceId':_0x5da4b2['id']}})[_0xc236('0x29')](function(){return _0x9017ec;});})['then'](function(){_0x21d78f[_0xc236('0x1d')](0xcc)[_0xc236('0x1e')]();});}};}function handleEntityNotFound(_0x4f5175,_0x5a61b5){return function(_0x265c8d){if(!_0x265c8d){_0x4f5175[_0xc236('0x2b')](0x194);}return _0x265c8d;};}function handleError(_0x1f4995,_0x6ad83f){_0x6ad83f=_0x6ad83f||0x1f4;return function(_0x5f3891){logger['error'](_0x5f3891[_0xc236('0x2c')]);if(_0x5f3891['name']){delete _0x5f3891[_0xc236('0x2d')];}_0x1f4995['status'](_0x6ad83f)[_0xc236('0x2e')](_0x5f3891);};}exports[_0xc236('0x2f')]=function(_0x57c99e,_0x5a5ec3){var _0x2537f9={},_0x3053a3={},_0xbda858={'count':0x0,'rows':[]};var _0x2f64bd=_[_0xc236('0x30')](db[_0xc236('0x31')][_0xc236('0x32')],function(_0x22a2ca){return{'name':_0x22a2ca[_0xc236('0x33')],'type':_0x22a2ca['type']['key']};});_0x3053a3['model']=_[_0xc236('0x30')](_0x2f64bd,_0xc236('0x2d'));_0x3053a3[_0xc236('0x34')]=_[_0xc236('0x35')](_0x57c99e[_0xc236('0x34')]);_0x3053a3[_0xc236('0x36')]=_[_0xc236('0x37')](_0x3053a3['model'],_0x3053a3[_0xc236('0x34')]);_0x2537f9[_0xc236('0x38')]=_[_0xc236('0x37')](_0x3053a3['model'],qs[_0xc236('0x39')](_0x57c99e[_0xc236('0x34')][_0xc236('0x39')]));_0x2537f9[_0xc236('0x38')]=_0x2537f9['attributes'][_0xc236('0x3a')]?_0x2537f9[_0xc236('0x38')]:_0x3053a3[_0xc236('0x3b')];if(!_0x57c99e[_0xc236('0x34')][_0xc236('0x3c')](_0xc236('0x3d'))){_0x2537f9[_0xc236('0x22')]=qs[_0xc236('0x22')](_0x57c99e[_0xc236('0x34')][_0xc236('0x22')]);_0x2537f9[_0xc236('0x21')]=qs[_0xc236('0x21')](_0x57c99e[_0xc236('0x34')][_0xc236('0x21')]);}_0x2537f9[_0xc236('0x3e')]=qs[_0xc236('0x3f')](_0x57c99e[_0xc236('0x34')]['sort']);_0x2537f9['where']=qs['filters'](_['pick'](_0x57c99e[_0xc236('0x34')],_0x3053a3['filters']),_0x2f64bd);if(_0x57c99e[_0xc236('0x34')][_0xc236('0x40')]){_0x2537f9[_0xc236('0x41')]=_[_0xc236('0x42')](_0x2537f9[_0xc236('0x41')],{'$or':_[_0xc236('0x30')](_0x2f64bd,function(_0x427de1){if(_0x427de1[_0xc236('0x43')]!==_0xc236('0x44')){var _0x12a270={};_0x12a270[_0x427de1[_0xc236('0x2d')]]={'$like':'%'+_0x57c99e[_0xc236('0x34')][_0xc236('0x40')]+'%'};return _0x12a270;}})});}_0x2537f9=_[_0xc236('0x42')]({},_0x2537f9,_0x57c99e[_0xc236('0x45')]);var _0x594ffc={'where':_0x2537f9[_0xc236('0x41')]};return db[_0xc236('0x31')]['count'](_0x594ffc)[_0xc236('0x29')](function(_0x5b0bc5){_0xbda858[_0xc236('0x20')]=_0x5b0bc5;if(_0x57c99e['query'][_0xc236('0x46')]){_0x2537f9[_0xc236('0x47')]=[{'all':!![]}];}return db[_0xc236('0x31')]['findAll'](_0x2537f9);})[_0xc236('0x29')](function(_0x429e08){_0xbda858[_0xc236('0x48')]=_0x429e08;return _0xbda858;})['then'](respondWithFilteredResult(_0x5a5ec3,_0x2537f9))[_0xc236('0x49')](handleError(_0x5a5ec3,null));};exports[_0xc236('0x4a')]=function(_0x317431,_0x408312){var _0xc35ef9={'raw':![],'where':{'id':_0x317431['params']['id']}},_0x3235b0={};_0x3235b0[_0xc236('0x3b')]=_['keys'](db[_0xc236('0x31')][_0xc236('0x32')]);_0x3235b0[_0xc236('0x34')]=_[_0xc236('0x35')](_0x317431[_0xc236('0x34')]);_0x3235b0[_0xc236('0x36')]=_[_0xc236('0x37')](_0x3235b0['model'],_0x3235b0[_0xc236('0x34')]);_0xc35ef9['attributes']=_[_0xc236('0x37')](_0x3235b0[_0xc236('0x3b')],qs['fields'](_0x317431[_0xc236('0x34')][_0xc236('0x39')]));_0xc35ef9[_0xc236('0x38')]=_0xc35ef9[_0xc236('0x38')][_0xc236('0x3a')]?_0xc35ef9[_0xc236('0x38')]:_0x3235b0[_0xc236('0x3b')];if(_0x317431['query']['includeAll']){_0xc35ef9[_0xc236('0x47')]=[{'all':!![]}];}_0xc35ef9=_[_0xc236('0x42')]({},_0xc35ef9,_0x317431['options']);return db[_0xc236('0x31')][_0xc236('0x4b')](_0xc35ef9)[_0xc236('0x29')](handleEntityNotFound(_0x408312,null))[_0xc236('0x29')](respondWithResult(_0x408312,null))[_0xc236('0x49')](handleError(_0x408312,null));};exports[_0xc236('0x4c')]=function(_0x300523,_0x14a83d){return db[_0xc236('0x31')]['find']({'where':{'id':_0x300523[_0xc236('0x4d')]['id']}})[_0xc236('0x29')](handleEntityNotFound(_0x14a83d,null))[_0xc236('0x29')](removeEntity(_0x14a83d,null))[_0xc236('0x49')](handleError(_0x14a83d,null));};exports[_0xc236('0x4e')]=function(_0x28e6b4,_0x3ea045){return db['VoicePrefix'][_0xc236('0x4e')]()[_0xc236('0x29')](respondWithResult(_0x3ea045,null))[_0xc236('0x49')](handleError(_0x3ea045,null));};exports[_0xc236('0x4f')]=function(_0x4860d8,_0xa34c01){var _0x3e6da6;return db[_0xc236('0x50')][_0xc236('0x51')](function(_0x9d81c8){return db['VoicePrefix'][_0xc236('0x4f')](_0x4860d8['body'],{'transaction':_0x9d81c8})[_0xc236('0x29')](function(_0x93904b){_0x3e6da6=_0x93904b[_0xc236('0x52')]({'plain':!![]});return db[_0xc236('0x53')][_0xc236('0x4b')]({'where':{'id':_0x3e6da6['VoiceExtensionId']},'raw':!![]})['then'](function(_0x3bee67){return createVoicePrefixExtensions(_0x3e6da6,_0x3bee67,_0x9d81c8);});});})[_0xc236('0x29')](function(){var _0x205d09=_0x4860d8[_0xc236('0x54')][_0xc236('0x52')]({'plain':!![]});if(!_0x205d09)throw new Error(_0xc236('0x55'));if(_0x205d09[_0xc236('0x56')]===_0xc236('0x54')){var _0x24af08=_0x3e6da6;return db[_0xc236('0x57')]['find']({'where':{'name':'VoicePrefixes','userProfileId':_0x205d09[_0xc236('0x58')]},'raw':!![]})[_0xc236('0x29')](function(_0x8e19c6){if(_0x8e19c6&&_0x8e19c6[_0xc236('0x59')]===0x0){return db['UserProfileResource'][_0xc236('0x4f')]({'name':_0x24af08[_0xc236('0x2d')],'resourceId':_0x24af08['id'],'type':_0x8e19c6['name'],'sectionId':_0x8e19c6['id']},{})[_0xc236('0x29')](function(){return _0x3e6da6;});}else{return _0x3e6da6;}})[_0xc236('0x49')](function(_0x445f03){logger[_0xc236('0x5a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x445f03);throw _0x445f03;});}return _0x3e6da6;})[_0xc236('0x29')](respondWithResult(_0xa34c01,null))[_0xc236('0x49')](handleError(_0xa34c01,null));};function Extension(_0x35955c,_0x2602f8,_0x41a160,_0x1edbae){this[_0xc236('0x5b')]='from-sip';this[_0xc236('0x5c')]=_0x35955c;this['app']=_0x41a160;this[_0xc236('0x43')]=_0xc236('0x5d');this[_0xc236('0x5e')]=_0xc236('0x5f');this['priority']=_0x2602f8;this[_0xc236('0x60')]=_0x1edbae;}function createVoicePrefixExtensions(_0x3f1a5f,_0x379e99,_0x4ed4fc){return new BPromise(function(_0x175d5d,_0x2bc7f0){var _0x2ecad1=new Extension(formatPrefixName(_0x3f1a5f[_0xc236('0x61')]),0x1,_0xc236('0x62'),_0xc236('0x63'));_0x2ecad1['VoicePrefixId']=_0x3f1a5f['id'];return db['VoiceExtension'][_0xc236('0x4f')](_0x2ecad1,{'transaction':_0x4ed4fc})[_0xc236('0x29')](function(_0x125f9a){var _0x1e9ad8=_0x125f9a[_0xc236('0x52')]({'plain':!![]});var _0x4649a3=_[_0xc236('0x30')](addVoicePrefixExtensions(_0x3f1a5f,_0x379e99),function(_0x553f58){_0x553f58['VoiceExtensionId']=_0x1e9ad8['id'];_0x553f58['VoicePrefixId']=_0x3f1a5f['id'];return _0x553f58;});return db[_0xc236('0x53')][_0xc236('0x64')](_0x4649a3,{'transaction':_0x4ed4fc})[_0xc236('0x29')](function(_0x2d6b00){if(!_0x2d6b00){return _0x2bc7f0('Extensions\x20creation\x20failed');}else{return _0x175d5d(_0x2d6b00);}})['catch'](function(_0x506910){return _0x2bc7f0(_0x506910);});});;});};function addVoicePrefixExtensions(_0x528d3d,_0x145e86){var _0x5df2ba=[];var _0x20a1eb=formatPrefixName(_0x528d3d['prefix']);_0x5df2ba[_0xc236('0x65')](new Extension(_0x20a1eb,0x2,_0xc236('0x66'),_0xc236('0x67')+_0x528d3d[_0xc236('0x2d')]));if(_0x528d3d[_0xc236('0x68')]){_0x5df2ba[_0xc236('0x65')](new Extension(_0x20a1eb,0x3,_0xc236('0x66'),'PREFIX-CALLERIDALL='+_0x528d3d[_0xc236('0x68')]));}else{_0x5df2ba['push'](new Extension(_0x20a1eb,0x3,_0xc236('0x62'),_0xc236('0x69')));}_0x5df2ba[_0xc236('0x65')](new Extension(_0x20a1eb,0x4,_0xc236('0x6a'),_0x145e86[_0xc236('0x5b')]+','+_0xc236('0x6b')+(0x8+_0x528d3d['name'][_0xc236('0x3a')])+'}'+','+0x1));return _0x5df2ba;}function formatPrefixName(_0x94f65d){var _0x4bb0c6='_';for(var _0x2fb86f=0x0;_0x2fb86f<_0x94f65d[_0xc236('0x3a')];_0x2fb86f++){if(_0x94f65d[_0xc236('0x6c')](_0x2fb86f)=='-'){_0x4bb0c6+=_0x94f65d['charAt'](_0x2fb86f);}else{_0x4bb0c6+='['+_0x94f65d[_0xc236('0x6c')](_0x2fb86f)+']';}}_0x4bb0c6+='.';return _0x4bb0c6;}exports[_0xc236('0x28')]=function(_0x5897a1,_0x2c8f89,_0x340f7c){var _0x1c07d7=_0x5897a1[_0xc236('0x6d')];_0x1c07d7[_0xc236('0x61')]=_0xc236('0x6e')+_0x1c07d7[_0xc236('0x2d')]+'-';return db[_0xc236('0x50')][_0xc236('0x51')](function(_0x5d627d){return db[_0xc236('0x31')][_0xc236('0x28')](_0x1c07d7,{'where':{'id':_0x1c07d7['id']},'transaction':_0x5d627d})[_0xc236('0x29')](function(){return db['VoiceExtension'][_0xc236('0x4c')]({'where':{'VoicePrefixId':_0x1c07d7['id']},'transaction':_0x5d627d})[_0xc236('0x29')](function(){return db[_0xc236('0x53')][_0xc236('0x4b')]({'where':{'id':_0x1c07d7['VoiceExtensionId']},'raw':!![]})[_0xc236('0x29')](function(_0x4a433e){return createVoicePrefixExtensions(_0x1c07d7,_0x4a433e,_0x5d627d);});});});})[_0xc236('0x29')](function(){return db['VoicePrefix'][_0xc236('0x6f')](_0x1c07d7['id']);})[_0xc236('0x29')](respondWithResult(_0x2c8f89,null))['catch'](handleError(_0x2c8f89,null));};exports['addAgents']=function(_0x4ec6d1,_0x930527,_0x4e9624){return db[_0xc236('0x31')][_0xc236('0x4b')]({'where':{'id':_0x4ec6d1['params']['id']}})[_0xc236('0x29')](handleEntityNotFound(_0x930527,null))[_0xc236('0x29')](function(_0x4d7e8d){if(_0x4d7e8d){return _0x4d7e8d[_0xc236('0x70')](_0x4ec6d1[_0xc236('0x6d')][_0xc236('0x71')],_[_0xc236('0x72')](_0x4ec6d1['body'],[_0xc236('0x71'),'id'])||{})[_0xc236('0x73')](function(_0x14cbad){for(var _0x1a27c9=0x0;_0x1a27c9<_0x4ec6d1[_0xc236('0x6d')][_0xc236('0x71')][_0xc236('0x3a')];_0x1a27c9+=0x1){socket['emit']('userVoicePrefix:save',{'UserId':Number(_0x4ec6d1[_0xc236('0x6d')][_0xc236('0x71')][_0x1a27c9]),'VoicePrefixId':Number(_0x4ec6d1[_0xc236('0x4d')]['id'])});}return _0x14cbad;});}})[_0xc236('0x29')](respondWithResult(_0x930527,null))[_0xc236('0x49')](handleError(_0x930527,null));};exports[_0xc236('0x74')]=function(_0x8967c,_0x1c6923,_0x4df1a5){return db['VoicePrefix'][_0xc236('0x4b')]({'where':{'id':_0x8967c['params']['id']}})[_0xc236('0x29')](handleEntityNotFound(_0x1c6923,null))[_0xc236('0x29')](function(_0x25d982){if(_0x25d982){return _0x25d982['removeAgents'](_0x8967c[_0xc236('0x34')]['ids'])[_0xc236('0x29')](function(){if(_[_0xc236('0x75')](_0x8967c[_0xc236('0x34')][_0xc236('0x71')])){for(var _0x48cf03=0x0;_0x48cf03<_0x8967c[_0xc236('0x34')][_0xc236('0x71')]['length'];_0x48cf03+=0x1){socket[_0xc236('0x76')](_0xc236('0x77'),{'UserId':Number(_0x8967c[_0xc236('0x34')][_0xc236('0x71')][_0x48cf03]),'VoicePrefixId':Number(_0x8967c[_0xc236('0x4d')]['id'])});}}else{socket[_0xc236('0x76')](_0xc236('0x77'),{'UserId':Number(_0x8967c['query'][_0xc236('0x71')]),'VoicePrefixId':Number(_0x8967c[_0xc236('0x4d')]['id'])});}});}})[_0xc236('0x29')](respondWithStatusCode(_0x1c6923,null))[_0xc236('0x49')](handleError(_0x1c6923,null));};exports['getAgents']=function(_0x3646c6,_0x1ee8d0,_0x50d1c6){var _0x40fd6d={};var _0x593b62={};var _0x25f91e;var _0xfc94e8;return db['VoicePrefix'][_0xc236('0x78')]({'where':{'id':_0x3646c6[_0xc236('0x4d')]['id']}})['then'](handleEntityNotFound(_0x1ee8d0,null))['then'](function(_0x2a9308){if(_0x2a9308){_0x25f91e=_0x2a9308;_0x593b62[_0xc236('0x3b')]=_[_0xc236('0x35')](db[_0xc236('0x79')][_0xc236('0x32')]);_0x593b62[_0xc236('0x34')]=_['keys'](_0x3646c6[_0xc236('0x34')]);_0x593b62[_0xc236('0x36')]=_[_0xc236('0x37')](_0x593b62[_0xc236('0x3b')],_0x593b62['query']);_0x40fd6d[_0xc236('0x38')]=_[_0xc236('0x37')](_0x593b62[_0xc236('0x3b')],qs[_0xc236('0x39')](_0x3646c6[_0xc236('0x34')]['fields']));_0x40fd6d['attributes']=_0x40fd6d[_0xc236('0x38')]['length']?_0x40fd6d[_0xc236('0x38')]:_0x593b62[_0xc236('0x3b')];_0x40fd6d[_0xc236('0x3e')]=qs[_0xc236('0x3f')](_0x3646c6['query'][_0xc236('0x3f')]);_0x40fd6d['where']=qs[_0xc236('0x36')](_['pick'](_0x3646c6[_0xc236('0x34')],_0x593b62[_0xc236('0x36')]));if(_0x3646c6[_0xc236('0x34')][_0xc236('0x40')]){_0x40fd6d[_0xc236('0x41')]=_[_0xc236('0x42')](_0x40fd6d[_0xc236('0x41')],{'$or':_[_0xc236('0x30')](_0x40fd6d[_0xc236('0x38')],function(_0x577ace){var _0x4849a6={};_0x4849a6[_0x577ace]={'$like':'%'+_0x3646c6[_0xc236('0x34')][_0xc236('0x40')]+'%'};return _0x4849a6;})});}_0x40fd6d=_[_0xc236('0x42')]({},_0x40fd6d,_0x3646c6[_0xc236('0x45')]);return _0x25f91e[_0xc236('0x7a')](_0x40fd6d);}})[_0xc236('0x29')](function(_0x557ad9){if(_0x557ad9){_0xfc94e8=_0x557ad9[_0xc236('0x3a')];if(!_0x3646c6[_0xc236('0x34')][_0xc236('0x3c')](_0xc236('0x3d'))){_0x40fd6d[_0xc236('0x22')]=qs[_0xc236('0x22')](_0x3646c6[_0xc236('0x34')][_0xc236('0x22')]);_0x40fd6d[_0xc236('0x21')]=qs[_0xc236('0x21')](_0x3646c6[_0xc236('0x34')][_0xc236('0x21')]);}return _0x25f91e[_0xc236('0x7a')](_0x40fd6d);}})[_0xc236('0x29')](function(_0x475c8f){if(_0x475c8f){return _0x475c8f?{'count':_0xfc94e8,'rows':_0x475c8f}:null;}})['then'](respondWithResult(_0x1ee8d0,null))[_0xc236('0x49')](handleError(_0x1ee8d0,null));};exports[_0xc236('0x7b')]=function(_0x17080e,_0x1070a3,_0x2bc6ed){var _0x4ed695={};var _0x424b51={};var _0x7bbb2c;var _0x1a938e;return db['VoicePrefix'][_0xc236('0x78')]({'where':{'id':_0x17080e['params']['id']}})['then'](handleEntityNotFound(_0x1070a3,null))[_0xc236('0x29')](function(_0x436845){if(_0x436845){_0x7bbb2c=_0x436845;_0x424b51[_0xc236('0x3b')]=_[_0xc236('0x35')](db[_0xc236('0x7c')]['rawAttributes']);_0x424b51[_0xc236('0x34')]=_[_0xc236('0x35')](_0x17080e[_0xc236('0x34')]);_0x424b51[_0xc236('0x36')]=_[_0xc236('0x37')](_0x424b51['model'],_0x424b51['query']);_0x4ed695[_0xc236('0x38')]=_[_0xc236('0x37')](_0x424b51[_0xc236('0x3b')],qs[_0xc236('0x39')](_0x17080e['query'][_0xc236('0x39')]));_0x4ed695[_0xc236('0x38')]=_0x4ed695[_0xc236('0x38')][_0xc236('0x3a')]?_0x4ed695[_0xc236('0x38')]:_0x424b51['model'];_0x4ed695[_0xc236('0x3e')]=qs[_0xc236('0x3f')](_0x17080e[_0xc236('0x34')][_0xc236('0x3f')]);_0x4ed695[_0xc236('0x41')]=qs['filters'](_[_0xc236('0x7d')](_0x17080e[_0xc236('0x34')],_0x424b51['filters']));if(_0x17080e[_0xc236('0x34')][_0xc236('0x40')]){_0x4ed695[_0xc236('0x41')]=_[_0xc236('0x42')](_0x4ed695[_0xc236('0x41')],{'$or':_['map'](_0x4ed695[_0xc236('0x38')],function(_0x182750){var _0x32f936={};_0x32f936[_0x182750]={'$like':'%'+_0x17080e[_0xc236('0x34')][_0xc236('0x40')]+'%'};return _0x32f936;})});}_0x4ed695=_[_0xc236('0x42')]({},_0x4ed695,_0x17080e['options']);return _0x7bbb2c[_0xc236('0x7b')](_0x4ed695);}})['then'](function(_0x391ad3){if(_0x391ad3){_0x1a938e=_0x391ad3['length'];if(!_0x17080e[_0xc236('0x34')]['hasOwnProperty'](_0xc236('0x3d'))){_0x4ed695['limit']=qs[_0xc236('0x22')](_0x17080e[_0xc236('0x34')][_0xc236('0x22')]);_0x4ed695[_0xc236('0x21')]=qs[_0xc236('0x21')](_0x17080e[_0xc236('0x34')]['offset']);}return _0x7bbb2c[_0xc236('0x7b')](_0x4ed695);}})[_0xc236('0x29')](function(_0x32d1cc){if(_0x32d1cc){return _0x32d1cc?{'count':_0x1a938e,'rows':_0x32d1cc}:null;}})[_0xc236('0x29')](respondWithResult(_0x1070a3,null))[_0xc236('0x49')](handleError(_0x1070a3,null));};exports[_0xc236('0x7e')]=function(_0x424875,_0x14177d,_0x30e7b3){var _0x23fc57=_0x424875[_0xc236('0x6d')][_0xc236('0x71')];var _0x2bed4b;return db[_0xc236('0x7c')][_0xc236('0x7f')]({'where':{'id':_0x23fc57},'attributes':['id'],'include':[{'model':db[_0xc236('0x79')],'as':_0xc236('0x80'),'attributes':['id',_0xc236('0x2d'),_0xc236('0x81'),'voicePause',_0xc236('0x82')],'raw':!![]}]})[_0xc236('0x29')](function(_0x210989){if(_0x210989){_0x2bed4b=_0x210989;var _0x5164e5=_[_0xc236('0x83')](_0x210989,function(_0x32765e){var _0x4f9faf=_0x32765e[_0xc236('0x52')]({'plain':!![]});return _0x4f9faf[_0xc236('0x80')];});return db['VoicePrefix'][_0xc236('0x4b')]({'where':{'id':_0x424875[_0xc236('0x4d')]['id']}})[_0xc236('0x29')](function(_0xfb7a98){return db['sequelize'][_0xc236('0x51')](function(_0x53287f){return _0xfb7a98[_0xc236('0x7e')](_0x23fc57,{'transaction':_0x53287f})[_0xc236('0x29')](function(){return BPromise[_0xc236('0x84')](_0x2bed4b,function(_0x2900ed){return db[_0xc236('0x85')]['upsert']({'TeamId':_0x2900ed['id'],'VoicePrefixId':_0x424875[_0xc236('0x4d')]['id']},{'transaction':_0x53287f});});})[_0xc236('0x29')](function(){return BPromise[_0xc236('0x84')](_0x5164e5,function(_0x29131a){return db[_0xc236('0x86')][_0xc236('0x87')]({'where':{'UserId':_0x29131a['id'],'VoicePrefixId':_0x424875[_0xc236('0x4d')]['id']},'transaction':_0x53287f});});})[_0xc236('0x29')](function(){_0x5164e5[_0xc236('0x88')](function(_0x833f85){socket[_0xc236('0x76')]('userVoicePrefix:save',{'UserId':_0x833f85['id'],'VoicePrefixId':_0xfb7a98['id']});});});});});}})['then'](respondWithStatusCode(_0x14177d,null))[_0xc236('0x49')](handleError(_0x14177d,null));};exports[_0xc236('0x89')]=function(_0x2207a8,_0x36fd37,_0x2494d9){return db[_0xc236('0x7c')][_0xc236('0x7f')]({'where':{'id':_0x2207a8[_0xc236('0x34')][_0xc236('0x71')]},'attributes':['id'],'include':[{'model':db[_0xc236('0x79')],'as':_0xc236('0x80'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x36fd37,null))[_0xc236('0x29')](function(_0x1669c4){var _0x29ae97=_[_0xc236('0x30')](_0x1669c4,'id');var _0x2a8f63=[];var _0x38aecf=[];var _0x2b46e4=squel[_0xc236('0x8a')]();_0x2b46e4['field']('tq.TeamId')['from'](_0xc236('0x8b'),'tq')['join'](_0xc236('0x8c'),'ut',_0xc236('0x8d'))[_0xc236('0x41')](_0xc236('0x8e'),_0x2207a8[_0xc236('0x4d')]['id']);for(var _0x43216e=0x0;_0x43216e<_0x1669c4[_0xc236('0x3a')];_0x43216e+=0x1){let _0x49d232=_0x1669c4[_0x43216e];for(var _0x870908=0x0;_0x870908<_0x49d232[_0xc236('0x80')][_0xc236('0x3a')];_0x870908+=0x1){let _0x364d8d=_0x49d232[_0xc236('0x80')][_0x870908];var _0x53cd27=_0x2b46e4[_0xc236('0x8f')]();_0x53cd27[_0xc236('0x41')](_0xc236('0x90'),_0x364d8d['id']);_0x38aecf[_0xc236('0x65')](db[_0xc236('0x50')][_0xc236('0x34')](_0x53cd27[_0xc236('0x91')](),{'type':db[_0xc236('0x50')][_0xc236('0x92')]['SELECT']})[_0xc236('0x29')](function(_0x281d3c){if(_0x281d3c[_0xc236('0x3a')]===0x1){return _0x364d8d['id'];}else{var _0x33cdb2=_['every'](_[_0xc236('0x30')](_0x281d3c,_0xc236('0x93')),function(_0x5ca99c){return _[_0xc236('0x94')](_0x29ae97,_0x5ca99c);});if(_0x33cdb2){return _0x364d8d['id'];}}}));}}return BPromise[_0xc236('0x95')](_0x38aecf)[_0xc236('0x29')](function(_0x32658a){_0x2a8f63=_(_0x2a8f63)[_0xc236('0x96')](_0x32658a)[_0xc236('0x97')]()[_0xc236('0x98')]();return db[_0xc236('0x31')]['find']({'where':{'id':_0x2207a8[_0xc236('0x4d')]['id']}})[_0xc236('0x29')](function(_0x26c461){return db[_0xc236('0x50')][_0xc236('0x51')](function(_0x57a83b){return _0x26c461[_0xc236('0x89')](_0x2207a8['query'][_0xc236('0x71')],{'transaction':_0x57a83b})[_0xc236('0x29')](function(){if(!_[_0xc236('0x99')](_0x2a8f63)){return _0x26c461[_0xc236('0x74')](_0x2a8f63,{'transaction':_0x57a83b});}})[_0xc236('0x29')](function(){_0x2a8f63[_0xc236('0x88')](function(_0x2e4215){socket[_0xc236('0x76')](_0xc236('0x77'),{'UserId':_0x2e4215,'VoicePrefixId':_0x26c461['id']});});});});});});})[_0xc236('0x29')](respondWithStatusCode(_0x36fd37,null))[_0xc236('0x49')](handleError(_0x36fd37,null));}; \ No newline at end of file +var _0x160f=['forEach','removeTeams','tq.TeamId','from','team_has_voice_prefixes','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','VoicePrefixId\x20=\x20?','clone','ut.UserId\x20=\x20?','toString','QueryTypes','SELECT','includes','all','value','isEmpty','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./voicePrefix.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','get','VoicePrefixes','UserProfileResource','name','send','index','map','VoicePrefix','rawAttributes','model','query','keys','filters','intersection','attributes','fields','length','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','describe','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','context','exten','app','type','system','description','Voice\x20Prefix\x20Extension','appdata','NoOp','Voice\x20Prefix','VoicePrefixId','VoiceExtension','bulkCreate','Extensions\x20creation\x20failed','prefix','push','Set','CDR(prefix)=','callerIdAll','PREFIX-CALLERIDALL=','No\x20callerid\x20available','goto','${EXTEN:','charAt','system-','sequelize','VoiceExtensionId','findById','addAgents','ids','spread','emit','userVoicePrefix:save','removeAgents','isArray','userVoicePrefix:remove','getAgents','findOne','User','hasOwnProperty','nolimit','Team','getTeams','Agents','online','voicePause','interface','transaction','addTeams','each','TeamVoicePrefix','upsert','UserVoicePrefix','findOrCreate'];(function(_0x128d68,_0x555a32){var _0x24ad4d=function(_0x101a3a){while(--_0x101a3a){_0x128d68['push'](_0x128d68['shift']());}};_0x24ad4d(++_0x555a32);}(_0x160f,0x1ef));var _0xf160=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x160f[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xf160('0x0'));var rimraf=require(_0xf160('0x1'));var zipdir=require(_0xf160('0x2'));var jsonpatch=require(_0xf160('0x3'));var rp=require('request-promise');var moment=require(_0xf160('0x4'));var BPromise=require(_0xf160('0x5'));var Mustache=require(_0xf160('0x6'));var util=require(_0xf160('0x7'));var path=require(_0xf160('0x8'));var sox=require(_0xf160('0x9'));var csv=require('to-csv');var ejs=require(_0xf160('0xa'));var fs=require('fs');var fs_extra=require(_0xf160('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xf160('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xf160('0xd'));var Papa=require(_0xf160('0xe'));var Redis=require(_0xf160('0xf'));var authService=require(_0xf160('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf160('0x11'));var logger=require(_0xf160('0x12'))(_0xf160('0x13'));var utils=require('../../config/utils');var config=require(_0xf160('0x14'));var licenseUtil=require(_0xf160('0x15'));var db=require(_0xf160('0x16'))['db'];config[_0xf160('0x17')]=_[_0xf160('0x18')](config['redis'],{'host':_0xf160('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xf160('0x17')]));require(_0xf160('0x1a'))[_0xf160('0x1b')](socket);function respondWithStatusCode(_0x2bb6c7,_0x3a4faa){_0x3a4faa=_0x3a4faa||0xcc;return function(_0x31f7ae){if(_0x31f7ae){return _0x2bb6c7[_0xf160('0x1c')](_0x3a4faa);}return _0x2bb6c7[_0xf160('0x1d')](_0x3a4faa)[_0xf160('0x1e')]();};}function respondWithResult(_0x59ac02,_0x477e4d){_0x477e4d=_0x477e4d||0xc8;return function(_0x400bda){if(_0x400bda){return _0x59ac02[_0xf160('0x1d')](_0x477e4d)[_0xf160('0x1f')](_0x400bda);}};}function respondWithFilteredResult(_0x51824b,_0x36a978){return function(_0x4b8185){if(_0x4b8185){var _0x5388c7=typeof _0x36a978[_0xf160('0x20')]===_0xf160('0x21')&&typeof _0x36a978[_0xf160('0x22')]===_0xf160('0x21');var _0x205afa=_0x4b8185[_0xf160('0x23')];var _0x2a8cb4=_0x5388c7?0x0:_0x36a978[_0xf160('0x20')];var _0x4a58d9=_0x5388c7?_0x4b8185[_0xf160('0x23')]:_0x36a978[_0xf160('0x20')]+_0x36a978[_0xf160('0x22')];var _0x5ad173;if(_0x4a58d9>=_0x205afa){_0x4a58d9=_0x205afa;_0x5ad173=0xc8;}else{_0x5ad173=0xce;}_0x51824b[_0xf160('0x1d')](_0x5ad173);return _0x51824b[_0xf160('0x24')](_0xf160('0x25'),_0x2a8cb4+'-'+_0x4a58d9+'/'+_0x205afa)[_0xf160('0x1f')](_0x4b8185);}return null;};}function patchUpdates(_0x2e03c8){return function(_0x1b0081){try{jsonpatch[_0xf160('0x26')](_0x1b0081,_0x2e03c8,!![]);}catch(_0x5a72d1){return BPromise[_0xf160('0x27')](_0x5a72d1);}return _0x1b0081[_0xf160('0x28')]();};}function saveUpdates(_0x305f6a,_0x49bb5c){return function(_0x578f7d){if(_0x578f7d){return _0x578f7d[_0xf160('0x29')](_0x305f6a)[_0xf160('0x2a')](function(_0x4a8003){return _0x4a8003;});}return null;};}function removeEntity(_0x487c0c,_0x168a09){return function(_0x1cc04c){if(_0x1cc04c){return _0x1cc04c[_0xf160('0x2b')]()['then'](function(){var _0xcfa9bd=_0x1cc04c[_0xf160('0x2c')]({'plain':!![]});var _0x2851e8=_0xf160('0x2d');return db[_0xf160('0x2e')][_0xf160('0x2b')]({'where':{'type':_0x2851e8,'resourceId':_0xcfa9bd['id']}})['then'](function(){return _0x1cc04c;});})['then'](function(){_0x487c0c['status'](0xcc)[_0xf160('0x1e')]();});}};}function handleEntityNotFound(_0x16a5fa,_0xcaab39){return function(_0x26e06b){if(!_0x26e06b){_0x16a5fa[_0xf160('0x1c')](0x194);}return _0x26e06b;};}function handleError(_0x563103,_0x55f9c3){_0x55f9c3=_0x55f9c3||0x1f4;return function(_0x329d6b){logger['error'](_0x329d6b['stack']);if(_0x329d6b[_0xf160('0x2f')]){delete _0x329d6b[_0xf160('0x2f')];}_0x563103['status'](_0x55f9c3)[_0xf160('0x30')](_0x329d6b);};}exports[_0xf160('0x31')]=function(_0x4ab048,_0x528dff){var _0x4b3ef4={},_0x54d17f={},_0x3e7720={'count':0x0,'rows':[]};var _0x2bb5c4=_[_0xf160('0x32')](db[_0xf160('0x33')][_0xf160('0x34')],function(_0x26fc8b){return{'name':_0x26fc8b['fieldName'],'type':_0x26fc8b['type']['key']};});_0x54d17f[_0xf160('0x35')]=_['map'](_0x2bb5c4,'name');_0x54d17f[_0xf160('0x36')]=_[_0xf160('0x37')](_0x4ab048['query']);_0x54d17f[_0xf160('0x38')]=_[_0xf160('0x39')](_0x54d17f[_0xf160('0x35')],_0x54d17f[_0xf160('0x36')]);_0x4b3ef4[_0xf160('0x3a')]=_['intersection'](_0x54d17f[_0xf160('0x35')],qs[_0xf160('0x3b')](_0x4ab048[_0xf160('0x36')]['fields']));_0x4b3ef4[_0xf160('0x3a')]=_0x4b3ef4[_0xf160('0x3a')][_0xf160('0x3c')]?_0x4b3ef4[_0xf160('0x3a')]:_0x54d17f[_0xf160('0x35')];if(!_0x4ab048[_0xf160('0x36')]['hasOwnProperty']('nolimit')){_0x4b3ef4[_0xf160('0x22')]=qs[_0xf160('0x22')](_0x4ab048[_0xf160('0x36')][_0xf160('0x22')]);_0x4b3ef4[_0xf160('0x20')]=qs[_0xf160('0x20')](_0x4ab048[_0xf160('0x36')][_0xf160('0x20')]);}_0x4b3ef4[_0xf160('0x3d')]=qs[_0xf160('0x3e')](_0x4ab048[_0xf160('0x36')][_0xf160('0x3e')]);_0x4b3ef4[_0xf160('0x3f')]=qs[_0xf160('0x38')](_[_0xf160('0x40')](_0x4ab048[_0xf160('0x36')],_0x54d17f[_0xf160('0x38')]),_0x2bb5c4);if(_0x4ab048[_0xf160('0x36')][_0xf160('0x41')]){_0x4b3ef4[_0xf160('0x3f')]=_[_0xf160('0x42')](_0x4b3ef4[_0xf160('0x3f')],{'$or':_[_0xf160('0x32')](_0x2bb5c4,function(_0x1bdc44){if(_0x1bdc44['type']!==_0xf160('0x43')){var _0x476c31={};_0x476c31[_0x1bdc44[_0xf160('0x2f')]]={'$like':'%'+_0x4ab048[_0xf160('0x36')][_0xf160('0x41')]+'%'};return _0x476c31;}})});}_0x4b3ef4=_[_0xf160('0x42')]({},_0x4b3ef4,_0x4ab048[_0xf160('0x44')]);var _0x4f65c9={'where':_0x4b3ef4[_0xf160('0x3f')]};return db['VoicePrefix'][_0xf160('0x23')](_0x4f65c9)[_0xf160('0x2a')](function(_0x530fc5){_0x3e7720[_0xf160('0x23')]=_0x530fc5;if(_0x4ab048[_0xf160('0x36')][_0xf160('0x45')]){_0x4b3ef4[_0xf160('0x46')]=[{'all':!![]}];}return db[_0xf160('0x33')][_0xf160('0x47')](_0x4b3ef4);})[_0xf160('0x2a')](function(_0x4f5eba){_0x3e7720[_0xf160('0x48')]=_0x4f5eba;return _0x3e7720;})[_0xf160('0x2a')](respondWithFilteredResult(_0x528dff,_0x4b3ef4))[_0xf160('0x49')](handleError(_0x528dff,null));};exports[_0xf160('0x4a')]=function(_0x3e4f0e,_0x2caefa){var _0x33bef9={'raw':![],'where':{'id':_0x3e4f0e[_0xf160('0x4b')]['id']}},_0x15b31a={};_0x15b31a[_0xf160('0x35')]=_[_0xf160('0x37')](db['VoicePrefix']['rawAttributes']);_0x15b31a[_0xf160('0x36')]=_[_0xf160('0x37')](_0x3e4f0e[_0xf160('0x36')]);_0x15b31a[_0xf160('0x38')]=_[_0xf160('0x39')](_0x15b31a[_0xf160('0x35')],_0x15b31a['query']);_0x33bef9[_0xf160('0x3a')]=_['intersection'](_0x15b31a['model'],qs[_0xf160('0x3b')](_0x3e4f0e[_0xf160('0x36')]['fields']));_0x33bef9['attributes']=_0x33bef9[_0xf160('0x3a')][_0xf160('0x3c')]?_0x33bef9[_0xf160('0x3a')]:_0x15b31a[_0xf160('0x35')];if(_0x3e4f0e['query']['includeAll']){_0x33bef9['include']=[{'all':!![]}];}_0x33bef9=_['merge']({},_0x33bef9,_0x3e4f0e[_0xf160('0x44')]);return db['VoicePrefix'][_0xf160('0x4c')](_0x33bef9)[_0xf160('0x2a')](handleEntityNotFound(_0x2caefa,null))[_0xf160('0x2a')](respondWithResult(_0x2caefa,null))[_0xf160('0x49')](handleError(_0x2caefa,null));};exports['destroy']=function(_0x45af83,_0x283f55){return db[_0xf160('0x33')]['find']({'where':{'id':_0x45af83[_0xf160('0x4b')]['id']}})[_0xf160('0x2a')](handleEntityNotFound(_0x283f55,null))[_0xf160('0x2a')](removeEntity(_0x283f55,null))['catch'](handleError(_0x283f55,null));};exports[_0xf160('0x4d')]=function(_0x6d8c9b,_0x409e7d){return db[_0xf160('0x33')][_0xf160('0x4d')]()['then'](respondWithResult(_0x409e7d,null))['catch'](handleError(_0x409e7d,null));};exports[_0xf160('0x4e')]=function(_0x5d81b9,_0x1d5168){var _0xf31056;return db['sequelize']['transaction'](function(_0x321309){return db[_0xf160('0x33')]['create'](_0x5d81b9[_0xf160('0x4f')],{'transaction':_0x321309})[_0xf160('0x2a')](function(_0x28605d){_0xf31056=_0x28605d[_0xf160('0x2c')]({'plain':!![]});return db['VoiceExtension'][_0xf160('0x4c')]({'where':{'id':_0xf31056['VoiceExtensionId']},'raw':!![]})[_0xf160('0x2a')](function(_0x1b3ec0){return createVoicePrefixExtensions(_0xf31056,_0x1b3ec0,_0x321309);});});})[_0xf160('0x2a')](function(){var _0x170ca4=_0x5d81b9[_0xf160('0x50')]['get']({'plain':!![]});if(!_0x170ca4)throw new Error(_0xf160('0x51'));if(_0x170ca4['role']===_0xf160('0x50')){var _0x1229cd=_0xf31056;return db[_0xf160('0x52')][_0xf160('0x4c')]({'where':{'name':_0xf160('0x2d'),'userProfileId':_0x170ca4[_0xf160('0x53')]},'raw':!![]})[_0xf160('0x2a')](function(_0x12c22){if(_0x12c22&&_0x12c22[_0xf160('0x54')]===0x0){return db[_0xf160('0x2e')]['create']({'name':_0x1229cd['name'],'resourceId':_0x1229cd['id'],'type':_0x12c22[_0xf160('0x2f')],'sectionId':_0x12c22['id']},{})[_0xf160('0x2a')](function(){return _0xf31056;});}else{return _0xf31056;}})['catch'](function(_0x12083d){logger[_0xf160('0x55')](_0xf160('0x56'),_0x12083d);throw _0x12083d;});}return _0xf31056;})['then'](respondWithResult(_0x1d5168,null))['catch'](handleError(_0x1d5168,null));};function Extension(_0x12ab32,_0x352ddb,_0x5eeab6,_0x3243c6){this[_0xf160('0x57')]='from-sip';this[_0xf160('0x58')]=_0x12ab32;this[_0xf160('0x59')]=_0x5eeab6;this[_0xf160('0x5a')]=_0xf160('0x5b');this[_0xf160('0x5c')]=_0xf160('0x5d');this['priority']=_0x352ddb;this[_0xf160('0x5e')]=_0x3243c6;}function createVoicePrefixExtensions(_0x3dc02f,_0x30f750,_0x1364bc){return new BPromise(function(_0x38ee0f,_0x5a1be3){var _0x1d22bb=new Extension(formatPrefixName(_0x3dc02f['prefix']),0x1,_0xf160('0x5f'),_0xf160('0x60'));_0x1d22bb[_0xf160('0x61')]=_0x3dc02f['id'];return db[_0xf160('0x62')][_0xf160('0x4e')](_0x1d22bb,{'transaction':_0x1364bc})[_0xf160('0x2a')](function(_0x492d5b){var _0x32ec90=_0x492d5b[_0xf160('0x2c')]({'plain':!![]});var _0x291320=_[_0xf160('0x32')](addVoicePrefixExtensions(_0x3dc02f,_0x30f750),function(_0x40e5a1){_0x40e5a1['VoiceExtensionId']=_0x32ec90['id'];_0x40e5a1['VoicePrefixId']=_0x3dc02f['id'];return _0x40e5a1;});return db[_0xf160('0x62')][_0xf160('0x63')](_0x291320,{'transaction':_0x1364bc})[_0xf160('0x2a')](function(_0x3d8c6c){if(!_0x3d8c6c){return _0x5a1be3(_0xf160('0x64'));}else{return _0x38ee0f(_0x3d8c6c);}})[_0xf160('0x49')](function(_0x4c151f){return _0x5a1be3(_0x4c151f);});});;});};function addVoicePrefixExtensions(_0x25f79e,_0x27332f){var _0x351fa9=[];var _0x352063=formatPrefixName(_0x25f79e[_0xf160('0x65')]);_0x351fa9[_0xf160('0x66')](new Extension(_0x352063,0x2,_0xf160('0x67'),_0xf160('0x68')+_0x25f79e['name']));if(_0x25f79e[_0xf160('0x69')]){_0x351fa9['push'](new Extension(_0x352063,0x3,_0xf160('0x67'),_0xf160('0x6a')+_0x25f79e[_0xf160('0x69')]));}else{_0x351fa9[_0xf160('0x66')](new Extension(_0x352063,0x3,_0xf160('0x5f'),_0xf160('0x6b')));}_0x351fa9['push'](new Extension(_0x352063,0x4,_0xf160('0x6c'),_0x27332f[_0xf160('0x57')]+','+_0xf160('0x6d')+(0x8+_0x25f79e['name'][_0xf160('0x3c')])+'}'+','+0x1));return _0x351fa9;}function formatPrefixName(_0x407a4a){var _0x4db1df='_';for(var _0x1db588=0x0;_0x1db588<_0x407a4a[_0xf160('0x3c')];_0x1db588++){if(_0x407a4a[_0xf160('0x6e')](_0x1db588)=='-'){_0x4db1df+=_0x407a4a['charAt'](_0x1db588);}else{_0x4db1df+='['+_0x407a4a[_0xf160('0x6e')](_0x1db588)+']';}}_0x4db1df+='.';return _0x4db1df;}exports[_0xf160('0x29')]=function(_0x4265e1,_0x4b9d21,_0xc78642){var _0x136919=_0x4265e1[_0xf160('0x4f')];_0x136919[_0xf160('0x65')]=_0xf160('0x6f')+_0x136919[_0xf160('0x2f')]+'-';return db[_0xf160('0x70')]['transaction'](function(_0x797ba1){return db[_0xf160('0x33')][_0xf160('0x29')](_0x136919,{'where':{'id':_0x136919['id']},'transaction':_0x797ba1})['then'](function(){return db[_0xf160('0x62')][_0xf160('0x2b')]({'where':{'VoicePrefixId':_0x136919['id']},'transaction':_0x797ba1})[_0xf160('0x2a')](function(){return db[_0xf160('0x62')][_0xf160('0x4c')]({'where':{'id':_0x136919[_0xf160('0x71')]},'raw':!![]})[_0xf160('0x2a')](function(_0x59b63c){return createVoicePrefixExtensions(_0x136919,_0x59b63c,_0x797ba1);});});});})['then'](function(){return db[_0xf160('0x33')][_0xf160('0x72')](_0x136919['id']);})[_0xf160('0x2a')](respondWithResult(_0x4b9d21,null))[_0xf160('0x49')](handleError(_0x4b9d21,null));};exports[_0xf160('0x73')]=function(_0x722f3a,_0x2f434c,_0x484b18){return db[_0xf160('0x33')][_0xf160('0x4c')]({'where':{'id':_0x722f3a['params']['id']}})['then'](handleEntityNotFound(_0x2f434c,null))[_0xf160('0x2a')](function(_0x14d69d){if(_0x14d69d){return _0x14d69d['addAgents'](_0x722f3a[_0xf160('0x4f')][_0xf160('0x74')],_['omit'](_0x722f3a[_0xf160('0x4f')],['ids','id'])||{})[_0xf160('0x75')](function(_0x355226){for(var _0x74028e=0x0;_0x74028e<_0x722f3a[_0xf160('0x4f')]['ids'][_0xf160('0x3c')];_0x74028e+=0x1){socket[_0xf160('0x76')](_0xf160('0x77'),{'UserId':Number(_0x722f3a[_0xf160('0x4f')][_0xf160('0x74')][_0x74028e]),'VoicePrefixId':Number(_0x722f3a['params']['id'])});}return _0x355226;});}})[_0xf160('0x2a')](respondWithResult(_0x2f434c,null))[_0xf160('0x49')](handleError(_0x2f434c,null));};exports[_0xf160('0x78')]=function(_0x5275b4,_0x2396f6,_0x1165f5){return db[_0xf160('0x33')][_0xf160('0x4c')]({'where':{'id':_0x5275b4[_0xf160('0x4b')]['id']}})[_0xf160('0x2a')](handleEntityNotFound(_0x2396f6,null))[_0xf160('0x2a')](function(_0x543534){if(_0x543534){return _0x543534[_0xf160('0x78')](_0x5275b4[_0xf160('0x36')][_0xf160('0x74')])[_0xf160('0x2a')](function(){if(_[_0xf160('0x79')](_0x5275b4['query'][_0xf160('0x74')])){for(var _0x3526cd=0x0;_0x3526cd<_0x5275b4[_0xf160('0x36')][_0xf160('0x74')][_0xf160('0x3c')];_0x3526cd+=0x1){socket[_0xf160('0x76')](_0xf160('0x7a'),{'UserId':Number(_0x5275b4[_0xf160('0x36')][_0xf160('0x74')][_0x3526cd]),'VoicePrefixId':Number(_0x5275b4[_0xf160('0x4b')]['id'])});}}else{socket[_0xf160('0x76')]('userVoicePrefix:remove',{'UserId':Number(_0x5275b4[_0xf160('0x36')]['ids']),'VoicePrefixId':Number(_0x5275b4[_0xf160('0x4b')]['id'])});}});}})[_0xf160('0x2a')](respondWithStatusCode(_0x2396f6,null))[_0xf160('0x49')](handleError(_0x2396f6,null));};exports[_0xf160('0x7b')]=function(_0x6ff6b1,_0x59281e,_0x3f873a){var _0x38426d={};var _0x2a992a={};var _0x185268;var _0x5927c9;return db['VoicePrefix'][_0xf160('0x7c')]({'where':{'id':_0x6ff6b1['params']['id']}})[_0xf160('0x2a')](handleEntityNotFound(_0x59281e,null))['then'](function(_0x21b93a){if(_0x21b93a){_0x185268=_0x21b93a;_0x2a992a['model']=_['keys'](db[_0xf160('0x7d')][_0xf160('0x34')]);_0x2a992a[_0xf160('0x36')]=_[_0xf160('0x37')](_0x6ff6b1[_0xf160('0x36')]);_0x2a992a[_0xf160('0x38')]=_[_0xf160('0x39')](_0x2a992a[_0xf160('0x35')],_0x2a992a[_0xf160('0x36')]);_0x38426d['attributes']=_['intersection'](_0x2a992a[_0xf160('0x35')],qs[_0xf160('0x3b')](_0x6ff6b1[_0xf160('0x36')][_0xf160('0x3b')]));_0x38426d[_0xf160('0x3a')]=_0x38426d['attributes'][_0xf160('0x3c')]?_0x38426d[_0xf160('0x3a')]:_0x2a992a[_0xf160('0x35')];_0x38426d[_0xf160('0x3d')]=qs['sort'](_0x6ff6b1['query']['sort']);_0x38426d[_0xf160('0x3f')]=qs['filters'](_[_0xf160('0x40')](_0x6ff6b1['query'],_0x2a992a[_0xf160('0x38')]));if(_0x6ff6b1[_0xf160('0x36')]['filter']){_0x38426d[_0xf160('0x3f')]=_[_0xf160('0x42')](_0x38426d[_0xf160('0x3f')],{'$or':_[_0xf160('0x32')](_0x38426d[_0xf160('0x3a')],function(_0x39ec7e){var _0x2558b8={};_0x2558b8[_0x39ec7e]={'$like':'%'+_0x6ff6b1['query']['filter']+'%'};return _0x2558b8;})});}_0x38426d=_[_0xf160('0x42')]({},_0x38426d,_0x6ff6b1[_0xf160('0x44')]);return _0x185268[_0xf160('0x7b')](_0x38426d);}})['then'](function(_0x5316c5){if(_0x5316c5){_0x5927c9=_0x5316c5[_0xf160('0x3c')];if(!_0x6ff6b1[_0xf160('0x36')][_0xf160('0x7e')](_0xf160('0x7f'))){_0x38426d[_0xf160('0x22')]=qs[_0xf160('0x22')](_0x6ff6b1[_0xf160('0x36')][_0xf160('0x22')]);_0x38426d[_0xf160('0x20')]=qs[_0xf160('0x20')](_0x6ff6b1['query'][_0xf160('0x20')]);}return _0x185268[_0xf160('0x7b')](_0x38426d);}})[_0xf160('0x2a')](function(_0x3ee8d8){if(_0x3ee8d8){return _0x3ee8d8?{'count':_0x5927c9,'rows':_0x3ee8d8}:null;}})[_0xf160('0x2a')](respondWithResult(_0x59281e,null))[_0xf160('0x49')](handleError(_0x59281e,null));};exports['getTeams']=function(_0x336560,_0x120282,_0x2b6e56){var _0x362718={};var _0xcf5dee={};var _0x2a8af4;var _0x224dcc;return db[_0xf160('0x33')]['findOne']({'where':{'id':_0x336560['params']['id']}})[_0xf160('0x2a')](handleEntityNotFound(_0x120282,null))[_0xf160('0x2a')](function(_0x55865d){if(_0x55865d){_0x2a8af4=_0x55865d;_0xcf5dee[_0xf160('0x35')]=_[_0xf160('0x37')](db[_0xf160('0x80')][_0xf160('0x34')]);_0xcf5dee[_0xf160('0x36')]=_[_0xf160('0x37')](_0x336560[_0xf160('0x36')]);_0xcf5dee[_0xf160('0x38')]=_[_0xf160('0x39')](_0xcf5dee[_0xf160('0x35')],_0xcf5dee['query']);_0x362718[_0xf160('0x3a')]=_[_0xf160('0x39')](_0xcf5dee[_0xf160('0x35')],qs[_0xf160('0x3b')](_0x336560[_0xf160('0x36')]['fields']));_0x362718[_0xf160('0x3a')]=_0x362718[_0xf160('0x3a')][_0xf160('0x3c')]?_0x362718[_0xf160('0x3a')]:_0xcf5dee['model'];_0x362718[_0xf160('0x3d')]=qs[_0xf160('0x3e')](_0x336560['query']['sort']);_0x362718['where']=qs['filters'](_['pick'](_0x336560[_0xf160('0x36')],_0xcf5dee[_0xf160('0x38')]));if(_0x336560['query']['filter']){_0x362718[_0xf160('0x3f')]=_[_0xf160('0x42')](_0x362718['where'],{'$or':_[_0xf160('0x32')](_0x362718['attributes'],function(_0x32fb34){var _0x3b1d1a={};_0x3b1d1a[_0x32fb34]={'$like':'%'+_0x336560[_0xf160('0x36')]['filter']+'%'};return _0x3b1d1a;})});}_0x362718=_[_0xf160('0x42')]({},_0x362718,_0x336560['options']);return _0x2a8af4[_0xf160('0x81')](_0x362718);}})['then'](function(_0x308dd9){if(_0x308dd9){_0x224dcc=_0x308dd9['length'];if(!_0x336560[_0xf160('0x36')]['hasOwnProperty'](_0xf160('0x7f'))){_0x362718[_0xf160('0x22')]=qs['limit'](_0x336560[_0xf160('0x36')][_0xf160('0x22')]);_0x362718['offset']=qs[_0xf160('0x20')](_0x336560[_0xf160('0x36')][_0xf160('0x20')]);}return _0x2a8af4[_0xf160('0x81')](_0x362718);}})['then'](function(_0x5cdecf){if(_0x5cdecf){return _0x5cdecf?{'count':_0x224dcc,'rows':_0x5cdecf}:null;}})[_0xf160('0x2a')](respondWithResult(_0x120282,null))[_0xf160('0x49')](handleError(_0x120282,null));};exports['addTeams']=function(_0x28b2cb,_0x24e3b5,_0x5c0dc8){var _0x182ed8=_0x28b2cb['body'][_0xf160('0x74')];var _0x2eada8;return db[_0xf160('0x80')]['findAll']({'where':{'id':_0x182ed8},'attributes':['id'],'include':[{'model':db[_0xf160('0x7d')],'as':_0xf160('0x82'),'attributes':['id',_0xf160('0x2f'),_0xf160('0x83'),_0xf160('0x84'),_0xf160('0x85')],'raw':!![]}]})[_0xf160('0x2a')](function(_0x2dbb52){if(_0x2dbb52){_0x2eada8=_0x2dbb52;var _0x5b29e0=_['flatMap'](_0x2dbb52,function(_0x2ae1dc){var _0x50912b=_0x2ae1dc['get']({'plain':!![]});return _0x50912b[_0xf160('0x82')];});return db['VoicePrefix'][_0xf160('0x4c')]({'where':{'id':_0x28b2cb[_0xf160('0x4b')]['id']}})[_0xf160('0x2a')](function(_0x26aa72){return db[_0xf160('0x70')][_0xf160('0x86')](function(_0x1bef1a){return _0x26aa72[_0xf160('0x87')](_0x182ed8,{'transaction':_0x1bef1a})[_0xf160('0x2a')](function(){return BPromise[_0xf160('0x88')](_0x2eada8,function(_0x154789){return db[_0xf160('0x89')][_0xf160('0x8a')]({'TeamId':_0x154789['id'],'VoicePrefixId':_0x28b2cb['params']['id']},{'transaction':_0x1bef1a});});})[_0xf160('0x2a')](function(){return BPromise[_0xf160('0x88')](_0x5b29e0,function(_0x3e46d1){return db[_0xf160('0x8b')][_0xf160('0x8c')]({'where':{'UserId':_0x3e46d1['id'],'VoicePrefixId':_0x28b2cb[_0xf160('0x4b')]['id']},'transaction':_0x1bef1a});});})[_0xf160('0x2a')](function(){_0x5b29e0[_0xf160('0x8d')](function(_0x3e9116){socket[_0xf160('0x76')](_0xf160('0x77'),{'UserId':_0x3e9116['id'],'VoicePrefixId':_0x26aa72['id']});});});});});}})[_0xf160('0x2a')](respondWithStatusCode(_0x24e3b5,null))[_0xf160('0x49')](handleError(_0x24e3b5,null));};exports[_0xf160('0x8e')]=function(_0x481f96,_0x4186f7,_0x37579a){return db[_0xf160('0x80')][_0xf160('0x47')]({'where':{'id':_0x481f96[_0xf160('0x36')][_0xf160('0x74')]},'attributes':['id'],'include':[{'model':db[_0xf160('0x7d')],'as':_0xf160('0x82'),'attributes':['id'],'raw':!![]}]})[_0xf160('0x2a')](handleEntityNotFound(_0x4186f7,null))[_0xf160('0x2a')](function(_0x36c1c5){var _0x4753d6=_[_0xf160('0x32')](_0x36c1c5,'id');var _0x2c486d=[];var _0x26332b=[];var _0x539056=squel['select']();_0x539056['field'](_0xf160('0x8f'))[_0xf160('0x90')](_0xf160('0x91'),'tq')[_0xf160('0x92')](_0xf160('0x93'),'ut',_0xf160('0x94'))['where'](_0xf160('0x95'),_0x481f96[_0xf160('0x4b')]['id']);for(var _0x1d308e=0x0;_0x1d308e<_0x36c1c5[_0xf160('0x3c')];_0x1d308e+=0x1){let _0x5bc8a3=_0x36c1c5[_0x1d308e];for(var _0x19dc59=0x0;_0x19dc59<_0x5bc8a3[_0xf160('0x82')][_0xf160('0x3c')];_0x19dc59+=0x1){let _0x35de2b=_0x5bc8a3[_0xf160('0x82')][_0x19dc59];var _0x446548=_0x539056[_0xf160('0x96')]();_0x446548[_0xf160('0x3f')](_0xf160('0x97'),_0x35de2b['id']);_0x26332b[_0xf160('0x66')](db[_0xf160('0x70')][_0xf160('0x36')](_0x446548[_0xf160('0x98')](),{'type':db[_0xf160('0x70')][_0xf160('0x99')][_0xf160('0x9a')]})[_0xf160('0x2a')](function(_0x258ad9){if(_0x258ad9['length']===0x1){return _0x35de2b['id'];}else{var _0x27d3ef=_['every'](_['map'](_0x258ad9,'TeamId'),function(_0x191d89){return _[_0xf160('0x9b')](_0x4753d6,_0x191d89);});if(_0x27d3ef){return _0x35de2b['id'];}}}));}}return BPromise[_0xf160('0x9c')](_0x26332b)[_0xf160('0x2a')](function(_0x2391f9){_0x2c486d=_(_0x2c486d)['union'](_0x2391f9)['compact']()[_0xf160('0x9d')]();return db[_0xf160('0x33')]['find']({'where':{'id':_0x481f96[_0xf160('0x4b')]['id']}})[_0xf160('0x2a')](function(_0x3d9b9b){return db[_0xf160('0x70')][_0xf160('0x86')](function(_0x563e5d){return _0x3d9b9b[_0xf160('0x8e')](_0x481f96['query'][_0xf160('0x74')],{'transaction':_0x563e5d})[_0xf160('0x2a')](function(){if(!_[_0xf160('0x9e')](_0x2c486d)){return _0x3d9b9b['removeAgents'](_0x2c486d,{'transaction':_0x563e5d});}})[_0xf160('0x2a')](function(){_0x2c486d[_0xf160('0x8d')](function(_0xfb5d28){socket[_0xf160('0x76')](_0xf160('0x7a'),{'UserId':_0xfb5d28,'VoicePrefixId':_0x3d9b9b['id']});});});});});});})[_0xf160('0x2a')](respondWithStatusCode(_0x4186f7,null))[_0xf160('0x49')](handleError(_0x4186f7,null));}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.events.js b/server/api/voicePrefix/voicePrefix.events.js index 9be85ea..01e74e9 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 _0x3cc6=['../../mysqldb','VoicePrefix','setMaxListeners','update','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x30e7ca,_0x1135e2){var _0x1a65ec=function(_0x3c9a72){while(--_0x3c9a72){_0x30e7ca['push'](_0x30e7ca['shift']());}};_0x1a65ec(++_0x1135e2);}(_0x3cc6,0xdb));var _0x63cc=function(_0x3b9603,_0x183395){_0x3b9603=_0x3b9603-0x0;var _0x44759a=_0x3cc6[_0x3b9603];return _0x44759a;};'use strict';var EventEmitter=require(_0x63cc('0x0'));var VoicePrefix=require(_0x63cc('0x1'))['db'][_0x63cc('0x2')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0x63cc('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x63cc('0x4'),'afterDestroy':_0x63cc('0x5')};function emitEvent(_0x1a4486){return function(_0x7e21ed,_0xbd717d,_0x29c0ce){VoicePrefixEvents[_0x63cc('0x6')](_0x1a4486+':'+_0x7e21ed['id'],_0x7e21ed);VoicePrefixEvents[_0x63cc('0x6')](_0x1a4486,_0x7e21ed);_0x29c0ce(null);};}for(var e in events){if(events[_0x63cc('0x7')](e)){var event=events[e];VoicePrefix[_0x63cc('0x8')](e,emitEvent(event));}}module[_0x63cc('0x9')]=VoicePrefixEvents; \ No newline at end of file +var _0x79ac=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','VoicePrefix','setMaxListeners','update'];(function(_0x507965,_0x4944f4){var _0x3608fc=function(_0x14c8d0){while(--_0x14c8d0){_0x507965['push'](_0x507965['shift']());}};_0x3608fc(++_0x4944f4);}(_0x79ac,0xaf));var _0xc79a=function(_0x3b4bd2,_0xd4f924){_0x3b4bd2=_0x3b4bd2-0x0;var _0x236709=_0x79ac[_0x3b4bd2];return _0x236709;};'use strict';var EventEmitter=require(_0xc79a('0x0'));var VoicePrefix=require(_0xc79a('0x1'))['db'][_0xc79a('0x2')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0xc79a('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xc79a('0x4'),'afterDestroy':_0xc79a('0x5')};function emitEvent(_0x327276){return function(_0x1dbbe7,_0x62584c,_0x497d4f){VoicePrefixEvents[_0xc79a('0x6')](_0x327276+':'+_0x1dbbe7['id'],_0x1dbbe7);VoicePrefixEvents[_0xc79a('0x6')](_0x327276,_0x1dbbe7);_0x497d4f(null);};}for(var e in events){if(events[_0xc79a('0x7')](e)){var event=events[e];VoicePrefix[_0xc79a('0x8')](e,emitEvent(event));}}module[_0xc79a('0x9')]=VoicePrefixEvents; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.model.js b/server/api/voicePrefix/voicePrefix.model.js index 50223ad..5d49346 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 _0x2c7e=['define','VoicePrefix','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voicePrefix.attributes'];(function(_0x1d1779,_0x284147){var _0x2377e9=function(_0x299f6f){while(--_0x299f6f){_0x1d1779['push'](_0x1d1779['shift']());}};_0x2377e9(++_0x284147);}(_0x2c7e,0x1ca));var _0xe2c7=function(_0x39418d,_0x3c1bc0){_0x39418d=_0x39418d-0x0;var _0x2bf70e=_0x2c7e[_0x39418d];return _0x2bf70e;};'use strict';var _=require(_0xe2c7('0x0'));var util=require(_0xe2c7('0x1'));var logger=require(_0xe2c7('0x2'))('api');var moment=require(_0xe2c7('0x3'));var BPromise=require(_0xe2c7('0x4'));var rp=require(_0xe2c7('0x5'));var fs=require('fs');var path=require(_0xe2c7('0x6'));var rimraf=require(_0xe2c7('0x7'));var config=require(_0xe2c7('0x8'));var attributes=require(_0xe2c7('0x9'));module['exports']=function(_0x3077e8,_0x15c996){return _0x3077e8[_0xe2c7('0xa')](_0xe2c7('0xb'),attributes,{'tableName':'voice_prefixes','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc420=['util','request-promise','path','./voicePrefix.attributes','exports','define','VoicePrefix','voice_prefixes','lodash'];(function(_0x40bd87,_0x2691d4){var _0x3cc1b2=function(_0x131add){while(--_0x131add){_0x40bd87['push'](_0x40bd87['shift']());}};_0x3cc1b2(++_0x2691d4);}(_0xc420,0x104));var _0x0c42=function(_0x3b050f,_0x163d0){_0x3b050f=_0x3b050f-0x0;var _0x10637d=_0xc420[_0x3b050f];return _0x10637d;};'use strict';var _=require(_0x0c42('0x0'));var util=require(_0x0c42('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x0c42('0x2'));var fs=require('fs');var path=require(_0x0c42('0x3'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x0c42('0x4'));module[_0x0c42('0x5')]=function(_0x4508b6,_0x28e53c){return _0x4508b6[_0x0c42('0x6')](_0x0c42('0x7'),attributes,{'tableName':_0x0c42('0x8'),'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 21f1feb..e4db9ec 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 _0x323f=['register','request','then','info','request\x20sent','debug','VoicePrefix,\x20%s,\x20%s,\x20%s','stringify','error','code','VoicePrefix,\x20%s,\x20%s','message','result','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./voicePrefix.socket'];(function(_0x4e48ac,_0x33469e){var _0x4c9709=function(_0x155e74){while(--_0x155e74){_0x4e48ac['push'](_0x4e48ac['shift']());}};_0x4c9709(++_0x33469e);}(_0x323f,0x1ee));var _0xf323=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x323f[_0xbca1b1];return _0x4e1686;};'use strict';var _=require('lodash');var util=require(_0xf323('0x0'));var moment=require('moment');var BPromise=require(_0xf323('0x1'));var rs=require(_0xf323('0x2'));var fs=require('fs');var Redis=require(_0xf323('0x3'));var db=require(_0xf323('0x4'))['db'];var utils=require(_0xf323('0x5'));var logger=require(_0xf323('0x6'))(_0xf323('0x7'));var config=require(_0xf323('0x8'));var jayson=require(_0xf323('0x9'));var client=jayson[_0xf323('0xa')]['http']({'port':0x232a});config[_0xf323('0xb')]=_[_0xf323('0xc')](config[_0xf323('0xb')],{'host':_0xf323('0xd'),'port':0x18eb});var socket=require(_0xf323('0xe'))(new Redis(config[_0xf323('0xb')]));require(_0xf323('0xf'))[_0xf323('0x10')](socket);function respondWithRpcPromise(_0x10d1ff,_0x21e82e,_0x22fd48){return new BPromise(function(_0x4196b5,_0x8825ef){return client[_0xf323('0x11')](_0x10d1ff,_0x22fd48)[_0xf323('0x12')](function(_0xb6ec37){logger[_0xf323('0x13')]('VoicePrefix,\x20%s,\x20%s',_0x21e82e,_0xf323('0x14'));logger[_0xf323('0x15')](_0xf323('0x16'),_0x21e82e,'request\x20sent',JSON[_0xf323('0x17')](_0xb6ec37));if(_0xb6ec37[_0xf323('0x18')]){if(_0xb6ec37[_0xf323('0x18')][_0xf323('0x19')]===0x1f4){logger[_0xf323('0x18')](_0xf323('0x1a'),_0x21e82e,_0xb6ec37['error']['message']);return _0x8825ef(_0xb6ec37[_0xf323('0x18')][_0xf323('0x1b')]);}logger[_0xf323('0x18')](_0xf323('0x1a'),_0x21e82e,_0xb6ec37[_0xf323('0x18')]['message']);return _0x4196b5(_0xb6ec37[_0xf323('0x18')][_0xf323('0x1b')]);}else{logger[_0xf323('0x13')](_0xf323('0x1a'),_0x21e82e,'request\x20sent');_0x4196b5(_0xb6ec37[_0xf323('0x1c')][_0xf323('0x1b')]);}})[_0xf323('0x1d')](function(_0x41b2cb){logger['error'](_0xf323('0x1a'),_0x21e82e,_0x41b2cb);_0x8825ef(_0x41b2cb);});});} \ No newline at end of file +var _0xeba2=['debug','VoicePrefix,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','http','redis','defaults','localhost','socket.io-emitter','./voicePrefix.socket','register','then','VoicePrefix,\x20%s,\x20%s','request\x20sent'];(function(_0x3eb713,_0x437874){var _0x1d7128=function(_0x2b9cea){while(--_0x2b9cea){_0x3eb713['push'](_0x3eb713['shift']());}};_0x1d7128(++_0x437874);}(_0xeba2,0x70));var _0x2eba=function(_0x42f270,_0x452dec){_0x42f270=_0x42f270-0x0;var _0x57bc5b=_0xeba2[_0x42f270];return _0x57bc5b;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x2eba('0x0'));var BPromise=require(_0x2eba('0x1'));var rs=require(_0x2eba('0x2'));var fs=require('fs');var Redis=require(_0x2eba('0x3'));var db=require(_0x2eba('0x4'))['db'];var utils=require(_0x2eba('0x5'));var logger=require(_0x2eba('0x6'))(_0x2eba('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x2eba('0x8')]({'port':0x232a});config[_0x2eba('0x9')]=_[_0x2eba('0xa')](config['redis'],{'host':_0x2eba('0xb'),'port':0x18eb});var socket=require(_0x2eba('0xc'))(new Redis(config[_0x2eba('0x9')]));require(_0x2eba('0xd'))[_0x2eba('0xe')](socket);function respondWithRpcPromise(_0x3a5bfe,_0x32b1d0,_0xd336b6){return new BPromise(function(_0x40b678,_0x38939a){return client['request'](_0x3a5bfe,_0xd336b6)[_0x2eba('0xf')](function(_0x669096){logger['info'](_0x2eba('0x10'),_0x32b1d0,_0x2eba('0x11'));logger[_0x2eba('0x12')](_0x2eba('0x13'),_0x32b1d0,_0x2eba('0x11'),JSON[_0x2eba('0x14')](_0x669096));if(_0x669096[_0x2eba('0x15')]){if(_0x669096['error']['code']===0x1f4){logger[_0x2eba('0x15')](_0x2eba('0x10'),_0x32b1d0,_0x669096[_0x2eba('0x15')][_0x2eba('0x16')]);return _0x38939a(_0x669096[_0x2eba('0x15')]['message']);}logger[_0x2eba('0x15')](_0x2eba('0x10'),_0x32b1d0,_0x669096[_0x2eba('0x15')][_0x2eba('0x16')]);return _0x40b678(_0x669096[_0x2eba('0x15')]['message']);}else{logger[_0x2eba('0x17')]('VoicePrefix,\x20%s,\x20%s',_0x32b1d0,'request\x20sent');_0x40b678(_0x669096[_0x2eba('0x18')][_0x2eba('0x16')]);}})[_0x2eba('0x19')](function(_0x354265){logger[_0x2eba('0x15')](_0x2eba('0x10'),_0x32b1d0,_0x354265);_0x38939a(_0x354265);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.socket.js b/server/api/voicePrefix/voicePrefix.socket.js index 0faeb5c..eba699b 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 _0x01d3=['removeListener','length','voicePrefix:','remove','update','emit'];(function(_0x58e3cb,_0x1e159c){var _0x209825=function(_0x27d3c6){while(--_0x27d3c6){_0x58e3cb['push'](_0x58e3cb['shift']());}};_0x209825(++_0x1e159c);}(_0x01d3,0xdb));var _0x301d=function(_0x23b991,_0x76ad57){_0x23b991=_0x23b991-0x0;var _0x387e44=_0x01d3[_0x23b991];return _0x387e44;};'use strict';var VoicePrefixEvents=require('./voicePrefix.events');var events=['save',_0x301d('0x0'),_0x301d('0x1')];function createListener(_0xc33ac5,_0x5912f4){return function(_0x33a51f){_0x5912f4[_0x301d('0x2')](_0xc33ac5,_0x33a51f);};}function removeListener(_0x2602ed,_0x11ba0e){return function(){VoicePrefixEvents[_0x301d('0x3')](_0x2602ed,_0x11ba0e);};}exports['register']=function(_0x44f428){for(var _0x3b1992=0x0,_0x859328=events[_0x301d('0x4')];_0x3b1992<_0x859328;_0x3b1992++){var _0x12b21b=events[_0x3b1992];var _0x49a253=createListener(_0x301d('0x5')+_0x12b21b,_0x44f428);VoicePrefixEvents['on'](_0x12b21b,_0x49a253);}}; \ No newline at end of file +var _0x682e=['register','length','voicePrefix:','./voicePrefix.events','save','remove','update','emit','removeListener'];(function(_0x36ed48,_0x1ee0d4){var _0x51c63a=function(_0x2d0a40){while(--_0x2d0a40){_0x36ed48['push'](_0x36ed48['shift']());}};_0x51c63a(++_0x1ee0d4);}(_0x682e,0x1ce));var _0xe682=function(_0x4861e1,_0x209eb6){_0x4861e1=_0x4861e1-0x0;var _0x54c61b=_0x682e[_0x4861e1];return _0x54c61b;};'use strict';var VoicePrefixEvents=require(_0xe682('0x0'));var events=[_0xe682('0x1'),_0xe682('0x2'),_0xe682('0x3')];function createListener(_0x1fc41a,_0x31f019){return function(_0x5cbf47){_0x31f019[_0xe682('0x4')](_0x1fc41a,_0x5cbf47);};}function removeListener(_0x10c8cd,_0x3705a2){return function(){VoicePrefixEvents[_0xe682('0x5')](_0x10c8cd,_0x3705a2);};}exports[_0xe682('0x6')]=function(_0x51e786){for(var _0x3b4c98=0x0,_0xd6995=events[_0xe682('0x7')];_0x3b4c98<_0xd6995;_0x3b4c98++){var _0x1ab428=events[_0x3b4c98];var _0x4e7e7d=createListener(_0xe682('0x8')+_0x1ab428,_0x51e786);VoicePrefixEvents['on'](_0x1ab428,_0x4e7e7d);}}; \ No newline at end of file diff --git a/server/api/voiceQueue/index.js b/server/api/voiceQueue/index.js index 80d47c8..e72628d 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 _0xfd69=['removeLists','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./voiceQueue.controller','get','isAuthenticated','index','/:id','/:id/hoppers','getHoppers','/:id/hopper_histories','/:id/teams','getTeams','/:id/users','getAgents','/:id/members','/:id/lists','/:id/blacklists','getBlackLists','post','create','/:id/clone','clone','addTeams','addLists','addBlackLists','delete','destroy','removeTeams','removeAgents'];(function(_0x50f0f4,_0x3e0e0d){var _0x3d435f=function(_0x3cb025){while(--_0x3cb025){_0x50f0f4['push'](_0x50f0f4['shift']());}};_0x3d435f(++_0x3e0e0d);}(_0xfd69,0x158));var _0x9fd6=function(_0x245de1,_0x15202b){_0x245de1=_0x245de1-0x0;var _0x5fa033=_0xfd69[_0x245de1];return _0x5fa033;};'use strict';var multer=require(_0x9fd6('0x0'));var util=require(_0x9fd6('0x1'));var path=require(_0x9fd6('0x2'));var timeout=require(_0x9fd6('0x3'));var express=require(_0x9fd6('0x4'));var router=express[_0x9fd6('0x5')]();var fs_extra=require(_0x9fd6('0x6'));var auth=require(_0x9fd6('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x9fd6('0x8'));var controller=require(_0x9fd6('0x9'));router[_0x9fd6('0xa')]('/',auth[_0x9fd6('0xb')](),controller[_0x9fd6('0xc')]);router['get'](_0x9fd6('0xd'),auth['isAuthenticated'](),controller['show']);router[_0x9fd6('0xa')](_0x9fd6('0xe'),auth['isAuthenticated'](),controller[_0x9fd6('0xf')]);router[_0x9fd6('0xa')](_0x9fd6('0x10'),auth['isAuthenticated'](),controller['getHopperHistories']);router[_0x9fd6('0xa')]('/:id/hopper_finals',auth[_0x9fd6('0xb')](),controller['getHopperFinals']);router[_0x9fd6('0xa')]('/:id/hopper_black',auth[_0x9fd6('0xb')](),controller['getHopperBlacks']);router[_0x9fd6('0xa')](_0x9fd6('0x11'),auth[_0x9fd6('0xb')](),controller[_0x9fd6('0x12')]);router[_0x9fd6('0xa')](_0x9fd6('0x13'),auth[_0x9fd6('0xb')](),controller[_0x9fd6('0x14')]);router[_0x9fd6('0xa')](_0x9fd6('0x15'),auth['isAuthenticated'](),controller['getMembers']);router['get'](_0x9fd6('0x16'),auth[_0x9fd6('0xb')](),controller['getLists']);router['get'](_0x9fd6('0x17'),auth[_0x9fd6('0xb')](),controller[_0x9fd6('0x18')]);router[_0x9fd6('0x19')]('/',auth[_0x9fd6('0xb')](),controller[_0x9fd6('0x1a')]);router[_0x9fd6('0x19')](_0x9fd6('0x1b'),auth['isAuthenticated'](),controller[_0x9fd6('0x1c')]);router[_0x9fd6('0x19')](_0x9fd6('0x11'),auth[_0x9fd6('0xb')](),controller[_0x9fd6('0x1d')]);router[_0x9fd6('0x19')]('/:id/users',auth['isAuthenticated'](),controller['addAgents']);router[_0x9fd6('0x19')](_0x9fd6('0x16'),auth['isAuthenticated'](),controller[_0x9fd6('0x1e')]);router[_0x9fd6('0x19')](_0x9fd6('0x17'),auth[_0x9fd6('0xb')](),controller[_0x9fd6('0x1f')]);router['put'](_0x9fd6('0xd'),auth[_0x9fd6('0xb')](),controller['update']);router[_0x9fd6('0x20')](_0x9fd6('0xd'),auth[_0x9fd6('0xb')](),controller[_0x9fd6('0x21')]);router[_0x9fd6('0x20')](_0x9fd6('0x11'),auth[_0x9fd6('0xb')](),controller[_0x9fd6('0x22')]);router[_0x9fd6('0x20')](_0x9fd6('0x13'),auth[_0x9fd6('0xb')](),controller[_0x9fd6('0x23')]);router[_0x9fd6('0x20')](_0x9fd6('0x16'),auth[_0x9fd6('0xb')](),controller[_0x9fd6('0x24')]);router[_0x9fd6('0x20')]('/:id/blacklists',auth[_0x9fd6('0xb')](),controller['removeBlackLists']);module[_0x9fd6('0x25')]=router; \ No newline at end of file +var _0xf97e=['getHopperFinals','/:id/hopper_black','getHopperBlacks','/:id/teams','getTeams','getAgents','/:id/members','getMembers','/:id/lists','getLists','/:id/blacklists','getBlackLists','post','create','/:id/clone','clone','addTeams','addAgents','addLists','addBlackLists','update','delete','destroy','removeTeams','/:id/users','removeAgents','removeLists','exports','multer','util','path','fs-extra','../../components/interaction/service','./voiceQueue.controller','get','isAuthenticated','index','/:id','show','/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals'];(function(_0x1f2010,_0x183444){var _0x31621b=function(_0x532dac){while(--_0x532dac){_0x1f2010['push'](_0x1f2010['shift']());}};_0x31621b(++_0x183444);}(_0xf97e,0x74));var _0xef97=function(_0xee8438,_0x261ac6){_0xee8438=_0xee8438-0x0;var _0x251ee8=_0xf97e[_0xee8438];return _0x251ee8;};'use strict';var multer=require(_0xef97('0x0'));var util=require(_0xef97('0x1'));var path=require(_0xef97('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0xef97('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xef97('0x4'));var config=require('../../config/environment');var controller=require(_0xef97('0x5'));router[_0xef97('0x6')]('/',auth[_0xef97('0x7')](),controller[_0xef97('0x8')]);router[_0xef97('0x6')](_0xef97('0x9'),auth['isAuthenticated'](),controller[_0xef97('0xa')]);router[_0xef97('0x6')](_0xef97('0xb'),auth[_0xef97('0x7')](),controller[_0xef97('0xc')]);router[_0xef97('0x6')](_0xef97('0xd'),auth[_0xef97('0x7')](),controller[_0xef97('0xe')]);router[_0xef97('0x6')](_0xef97('0xf'),auth[_0xef97('0x7')](),controller[_0xef97('0x10')]);router['get'](_0xef97('0x11'),auth[_0xef97('0x7')](),controller[_0xef97('0x12')]);router[_0xef97('0x6')](_0xef97('0x13'),auth[_0xef97('0x7')](),controller[_0xef97('0x14')]);router['get']('/:id/users',auth['isAuthenticated'](),controller[_0xef97('0x15')]);router[_0xef97('0x6')](_0xef97('0x16'),auth['isAuthenticated'](),controller[_0xef97('0x17')]);router['get'](_0xef97('0x18'),auth[_0xef97('0x7')](),controller[_0xef97('0x19')]);router[_0xef97('0x6')](_0xef97('0x1a'),auth[_0xef97('0x7')](),controller[_0xef97('0x1b')]);router[_0xef97('0x1c')]('/',auth[_0xef97('0x7')](),controller[_0xef97('0x1d')]);router['post'](_0xef97('0x1e'),auth[_0xef97('0x7')](),controller[_0xef97('0x1f')]);router[_0xef97('0x1c')](_0xef97('0x13'),auth[_0xef97('0x7')](),controller[_0xef97('0x20')]);router[_0xef97('0x1c')]('/:id/users',auth[_0xef97('0x7')](),controller[_0xef97('0x21')]);router[_0xef97('0x1c')](_0xef97('0x18'),auth[_0xef97('0x7')](),controller[_0xef97('0x22')]);router['post'](_0xef97('0x1a'),auth['isAuthenticated'](),controller[_0xef97('0x23')]);router['put'](_0xef97('0x9'),auth[_0xef97('0x7')](),controller[_0xef97('0x24')]);router[_0xef97('0x25')](_0xef97('0x9'),auth[_0xef97('0x7')](),controller[_0xef97('0x26')]);router['delete']('/:id/teams',auth['isAuthenticated'](),controller[_0xef97('0x27')]);router[_0xef97('0x25')](_0xef97('0x28'),auth[_0xef97('0x7')](),controller[_0xef97('0x29')]);router[_0xef97('0x25')](_0xef97('0x18'),auth[_0xef97('0x7')](),controller[_0xef97('0x2a')]);router[_0xef97('0x25')]('/:id/blacklists',auth[_0xef97('0x7')](),controller['removeBlackLists']);module[_0xef97('0x2b')]=router; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.attributes.js b/server/api/voiceQueue/voiceQueue.attributes.js index 71344d0..89a7e40 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 _0x53bb=['Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','tTxX','#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)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','never','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\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','AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','exports','name','ENUM','inbound','outbound','STRING','ringall','leastrecent','fewestcalls','random','rrmemory','linear','wrandom','rrordered','setDataValue','strategy','getDataValue','type','dialMethod','booked','roundrobin','progressive','predictive','power','INTEGER','yes','all','once','TEXT','periodic_announce','join','split','joinempty','leavewhenempty','BOOLEAN','wrapuptime','preview','UNSIGNED','Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.','Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).','agentBusyFactor','dropRate','FLOAT','Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x53bb,0x168));var _0xb53b=function(_0x596e20,_0x2a5f10){_0x596e20=_0x596e20-0x0;var _0x45bd48=_0x53bb[_0x596e20];return _0x45bd48;};'use strict';var Sequelize=require(_0xb53b('0x0'));module[_0xb53b('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xb53b('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0xb53b('0x3')](_0xb53b('0x4'),_0xb53b('0x5')),'allowNull':![],'defaultValue':_0xb53b('0x4')},'musiconhold':{'type':Sequelize['STRING'],'defaultValue':'default'},'announce':{'type':Sequelize[_0xb53b('0x6')],'defaultValue':''},'strategy':{'type':Sequelize[_0xb53b('0x3')]('rr',_0xb53b('0x7'),_0xb53b('0x8'),_0xb53b('0x9'),_0xb53b('0xa'),_0xb53b('0xb'),_0xb53b('0xc'),_0xb53b('0xd'),_0xb53b('0xe')),'allowNull':![],'defaultValue':_0xb53b('0x7'),'set':function(_0x187fb9){this[_0xb53b('0xf')](_0xb53b('0x10'),_0x187fb9?_0x187fb9:'rrmemory');},'get':function(){var _0x33e0fb=this[_0xb53b('0x11')](_0xb53b('0x12'));var _0x4247e2=this[_0xb53b('0x11')](_0xb53b('0x13'));var _0x5a471e=this['getDataValue'](_0xb53b('0x10'));if(_0x33e0fb===_0xb53b('0x4')){return _0x5a471e;}if(_0x4247e2===_0xb53b('0x14')&&_0x5a471e===_0xb53b('0xb')||_0x4247e2===_0xb53b('0x14')&&_0x5a471e===_0xb53b('0x15')){return _0x5a471e;}if(_0x4247e2===_0xb53b('0x16')||_0x4247e2===_0xb53b('0x17')||_0x4247e2===_0xb53b('0x18')){return _0x5a471e;}return null;}},'servicelevel':{'type':Sequelize[_0xb53b('0x19')](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0xb53b('0x6')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize['INTEGER'](0xb)},'timeout':{'type':Sequelize[_0xb53b('0x19')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize[_0xb53b('0x19')](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0xb53b('0x6')]},'weight':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize[_0xb53b('0x19')](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize[_0xb53b('0x3')](_0xb53b('0x1a'),'no'),'defaultValue':_0xb53b('0x1a')},'autopause':{'type':Sequelize['ENUM'](_0xb53b('0x1a'),'no',_0xb53b('0x1b')),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0xb53b('0x19')](0xb)},'autopausebusy':{'type':Sequelize['ENUM'](_0xb53b('0x1a'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize['ENUM'](_0xb53b('0x1a'),'no'),'defaultValue':'no'},'maxlen':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize[_0xb53b('0x3')](_0xb53b('0x1a'),'no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize['ENUM'](_0xb53b('0x1a'),'no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize[_0xb53b('0x3')]('yes','no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize[_0xb53b('0x3')]('yes','no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0xb53b('0x6')],'allowNull':!![]},'membergosub':{'type':Sequelize['STRING'],'allowNull':!![]},'announce_frequency':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0xb53b('0x19')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0xb53b('0x19')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize[_0xb53b('0x3')](_0xb53b('0x1a'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize[_0xb53b('0x3')]('yes','no'),'defaultValue':'yes'},'announce_holdtime':{'type':Sequelize[_0xb53b('0x3')](_0xb53b('0x1a'),'no',_0xb53b('0x1c')),'defaultValue':'no'},'announce_position':{'type':Sequelize[_0xb53b('0x6')],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize['ENUM'](_0xb53b('0x1a'),'no')},'announce_position_limit':{'type':Sequelize[_0xb53b('0x19')](0xb)},'announce_round_seconds':{'type':Sequelize[_0xb53b('0x3')]('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize[_0xb53b('0x6')],'defaultValue':''},'monitor_type':{'type':Sequelize['STRING']},'queue_youarenext':{'type':Sequelize[_0xb53b('0x6')],'defaultValue':null},'queue_thereare':{'type':Sequelize[_0xb53b('0x6')],'defaultValue':null},'queue_callswaiting':{'type':Sequelize['STRING'],'defaultValue':null},'queue_holdtime':{'type':Sequelize[_0xb53b('0x6')],'defaultValue':null},'queue_minute':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize[_0xb53b('0x6')],'defaultValue':null},'queue_seconds':{'type':Sequelize[_0xb53b('0x6')],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0xb53b('0x6')],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0xb53b('0x6')]},'queue_quantity1':{'type':Sequelize['STRING']},'queue_quantity2':{'type':Sequelize[_0xb53b('0x6')]},'queue_periodic_announce':{'type':Sequelize[_0xb53b('0x6')]},'queue_less_than':{'type':Sequelize[_0xb53b('0x6')]},'periodic_announce':{'type':Sequelize[_0xb53b('0x1d')],'set':function(_0x41696d){this['setDataValue'](_0xb53b('0x1e'),_0x41696d?_0x41696d[_0xb53b('0x1f')](','):[]);},'get':function(){return this[_0xb53b('0x11')]('periodic_announce')?this['getDataValue'](_0xb53b('0x1e'))[_0xb53b('0x20')](','):[];}},'joinempty':{'type':Sequelize[_0xb53b('0x6')],'defaultValue':_0xb53b('0x1a'),'set':function(_0x462d56){this[_0xb53b('0xf')](_0xb53b('0x21'),_0x462d56?_0x462d56[_0xb53b('0x1f')](','):undefined);},'get':function(){return this[_0xb53b('0x11')](_0xb53b('0x21'))?this[_0xb53b('0x11')]('joinempty')[_0xb53b('0x20')](','):undefined;}},'leavewhenempty':{'type':Sequelize[_0xb53b('0x6')],'defaultValue':'no','set':function(_0x3bb017){this[_0xb53b('0xf')](_0xb53b('0x22'),_0x3bb017?_0x3bb017[_0xb53b('0x1f')](','):undefined);},'get':function(){return this[_0xb53b('0x11')](_0xb53b('0x22'))?this[_0xb53b('0x11')](_0xb53b('0x22'))['split'](','):undefined;}},'reportholdtime':{'type':Sequelize[_0xb53b('0x3')]('yes','no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize['ENUM'](_0xb53b('0x1a'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize[_0xb53b('0x19')](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize[_0xb53b('0x3')](_0xb53b('0x1a'),'no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0xb53b('0x6')]},'description':{'type':Sequelize[_0xb53b('0x6')]},'acw':{'type':Sequelize[_0xb53b('0x23')],'defaultValue':0x0,'set':function(_0x449ba2){this[_0xb53b('0xf')]('acw',_0x449ba2);if(_0x449ba2){if(this[_0xb53b('0x11')](_0xb53b('0x24'))<0x2){this[_0xb53b('0xf')](_0xb53b('0x24'),0x2);}}}},'acwTimeout':{'type':Sequelize[_0xb53b('0x19')](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize[_0xb53b('0x23')],'defaultValue':0x0,'comment':'Active/Disactive\x20Campaign'},'dialMethod':{'type':Sequelize[_0xb53b('0x3')](_0xb53b('0x25'),_0xb53b('0x16'),_0xb53b('0x18'),_0xb53b('0x17'),_0xb53b('0x14')),'defaultValue':_0xb53b('0x16'),'comment':'Dial\x20Method.'},'dialLimitChannel':{'type':Sequelize[_0xb53b('0x19')](0x4)['UNSIGNED'],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':'Max\x209999\x20channels,\x200\x20means\x20unlimited.'},'dialLimitQueue':{'type':Sequelize[_0xb53b('0x19')](0x4)[_0xb53b('0x26')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0xb53b('0x27')},'dialPowerLevel':{'type':Sequelize['FLOAT'](0x2)[_0xb53b('0x26')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':_0xb53b('0x28')},'dialPredictiveOptimization':{'type':Sequelize['ENUM'](_0xb53b('0x29'),_0xb53b('0x2a')),'defaultValue':_0xb53b('0x2a'),'comment':'Only\x20for\x20predictive\x20method.'},'dialPredictiveOptimizationPercentage':{'type':Sequelize[_0xb53b('0x2b')](0x2)[_0xb53b('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0xb53b('0x2c')},'dialPredictiveInterval':{'type':Sequelize[_0xb53b('0x19')](0x3)[_0xb53b('0x26')],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':_0xb53b('0x2d')},'dialOriginateCallerIdName':{'type':Sequelize[_0xb53b('0x6')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xb53b('0x6')]},'dialOriginateTimeout':{'type':Sequelize[_0xb53b('0x19')](0x3)[_0xb53b('0x26')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xb53b('0x2e')},'dialQueueOptions':{'type':Sequelize[_0xb53b('0x6')],'defaultValue':_0xb53b('0x2f'),'comment':'https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue'},'dialQueueTimeout':{'type':Sequelize[_0xb53b('0x19')](0x3)[_0xb53b('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialQueueProject':{'type':Sequelize['STRING'],'comment':'AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)'},'dialCongestionMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xb53b('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xb53b('0x30')},'dialCongestionRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xb53b('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialBusyMaxRetry':{'type':Sequelize[_0xb53b('0x19')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xb53b('0x31')},'dialBusyRetryFrequency':{'type':Sequelize[_0xb53b('0x19')](0x5)[_0xb53b('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xb53b('0x32')},'dialNoAnswerMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xb53b('0x26')],'defaultValue':0x3,'comment':_0xb53b('0x33')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xb53b('0x19')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialGlobalMaxRetry':{'type':Sequelize[_0xb53b('0x19')](0x3)['UNSIGNED'],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xb53b('0x34')},'dialTimezone':{'type':Sequelize[_0xb53b('0x6')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xb53b('0x6')],'defaultValue':_0xb53b('0x35')},'dialPrefix':{'type':Sequelize[_0xb53b('0x6')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize[_0xb53b('0x3')](_0xb53b('0x36'),_0xb53b('0x37'),_0xb53b('0x38')),'defaultValue':_0xb53b('0x36')},'dialAMDActive':{'type':Sequelize[_0xb53b('0x23')],'defaultValue':0x0,'comment':_0xb53b('0x39')},'dialAMDInitialSilence':{'type':Sequelize['INTEGER'](0x9)[_0xb53b('0x26')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xb53b('0x3a')},'dialAMDGreeting':{'type':Sequelize[_0xb53b('0x19')](0x9)['UNSIGNED'],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':'#AMD\x20Greeting'},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xb53b('0x19')](0x9)[_0xb53b('0x26')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0xb53b('0x3b')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xb53b('0x19')](0x9)[_0xb53b('0x26')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xb53b('0x3c')},'dialAMDMinWordLength':{'type':Sequelize[_0xb53b('0x19')](0x9)['UNSIGNED'],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xb53b('0x3d')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xb53b('0x19')](0x9)[_0xb53b('0x26')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xb53b('0x3e')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xb53b('0x19')](0x9)[_0xb53b('0x26')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0xb53b('0x3f')},'dialAMDSilenceThreshold':{'type':Sequelize['INTEGER'](0x5)[_0xb53b('0x26')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xb53b('0x40')},'dialAMDMaximumWordLength':{'type':Sequelize[_0xb53b('0x19')](0x9)[_0xb53b('0x26')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xb53b('0x41')},'dialRecallMeTimeout':{'type':Sequelize[_0xb53b('0x19')](0x5)[_0xb53b('0x26')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0xb53b('0x42')},'dialRecallInQueue':{'type':Sequelize[_0xb53b('0x23')],'defaultValue':0x0,'comment':_0xb53b('0x43')},'dialOrderByScheduledAt':{'type':Sequelize['ENUM']('DESC',_0xb53b('0x44')),'defaultValue':'DESC'},'dialQueueProject2':{'type':Sequelize[_0xb53b('0x6')],'comment':_0xb53b('0x45')},'dialAgiAfterHangupClient':{'type':Sequelize[_0xb53b('0x23')],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0xb53b('0x23')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xb53b('0x19')](0x3)[_0xb53b('0x26')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xb53b('0x46')},'dialCutDigit':{'type':Sequelize[_0xb53b('0x19')](0x3)[_0xb53b('0x26')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xb53b('0x47')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0xb53b('0x19')](0x3)[_0xb53b('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xb53b('0x48')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0xb53b('0x19')](0x5)[_0xb53b('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xb53b('0x49')},'dialDropMaxRetry':{'type':Sequelize[_0xb53b('0x19')](0x3)[_0xb53b('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Drop\x20Retry\x20(min:1,\x20max:999)'},'dialDropRetryFrequency':{'type':Sequelize[_0xb53b('0x19')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAbandonedMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xb53b('0x26')],'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':_0xb53b('0x4a')},'dialMachineMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xb53b('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xb53b('0x4b')},'dialMachineRetryFrequency':{'type':Sequelize[_0xb53b('0x19')](0x5)[_0xb53b('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAgentRejectMaxRetry':{'type':Sequelize[_0xb53b('0x19')](0x3)[_0xb53b('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xb53b('0x4c')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0xb53b('0x19')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xb53b('0x4d')},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0xb53b('0x23')],'defaultValue':![],'comment':_0xb53b('0x4e'),'set':function(_0x33b662){if(!_0x33b662)this[_0xb53b('0xf')](_0xb53b('0x4f'),null);this[_0xb53b('0xf')](_0xb53b('0x50'),_0x33b662);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize[_0xb53b('0x19')](0x3)[_0xb53b('0x26')],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize[_0xb53b('0x19')](0x3)[_0xb53b('0x26')],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}}}; \ No newline at end of file +var _0x31c2=['wrandom','rrordered','setDataValue','strategy','rrmemory','getDataValue','type','dialMethod','booked','roundrobin','progressive','predictive','power','INTEGER','yes','all','periodic_announce','join','joinempty','split','leavewhenempty','BOOLEAN','acw','wrapuptime','Active/Disactive\x20Campaign','preview','Dial\x20Method.','Max\x209999\x20channels,\x200\x20means\x20unlimited.','UNSIGNED','Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.','FLOAT','Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).','agentBusyFactor','dropRate','Only\x20for\x20predictive\x20method.','Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)','Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','tTxX','Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)','#Congestion\x20Retry\x20(min:1,\x20max:999)','#Busy\x20Retry\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\x20Greeting','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Maximum\x20Word\x20Length','#RecallMe\x20Timeout\x20(min:1)','Active/Disactive\x20Recall\x20In\x20Queue','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','exports','STRING','name','ENUM','inbound','outbound','ringall','leastrecent','random','linear'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x31c2,0x1e1));var _0x231c=function(_0x252922,_0x4cefac){_0x252922=_0x252922-0x0;var _0x54e151=_0x31c2[_0x252922];return _0x54e151;};'use strict';var Sequelize=require(_0x231c('0x0'));module[_0x231c('0x1')]={'name':{'type':Sequelize[_0x231c('0x2')],'allowNull':![],'unique':_0x231c('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x231c('0x4')](_0x231c('0x5'),_0x231c('0x6')),'allowNull':![],'defaultValue':_0x231c('0x5')},'musiconhold':{'type':Sequelize['STRING'],'defaultValue':'default'},'announce':{'type':Sequelize[_0x231c('0x2')],'defaultValue':''},'strategy':{'type':Sequelize[_0x231c('0x4')]('rr',_0x231c('0x7'),_0x231c('0x8'),'fewestcalls',_0x231c('0x9'),'rrmemory',_0x231c('0xa'),_0x231c('0xb'),_0x231c('0xc')),'allowNull':![],'defaultValue':'ringall','set':function(_0x2524bf){this[_0x231c('0xd')](_0x231c('0xe'),_0x2524bf?_0x2524bf:_0x231c('0xf'));},'get':function(){var _0x6a5f85=this[_0x231c('0x10')](_0x231c('0x11'));var _0x4b5833=this[_0x231c('0x10')](_0x231c('0x12'));var _0x58bd0f=this[_0x231c('0x10')](_0x231c('0xe'));if(_0x6a5f85===_0x231c('0x5')){return _0x58bd0f;}if(_0x4b5833===_0x231c('0x13')&&_0x58bd0f===_0x231c('0xf')||_0x4b5833===_0x231c('0x13')&&_0x58bd0f===_0x231c('0x14')){return _0x58bd0f;}if(_0x4b5833===_0x231c('0x15')||_0x4b5833===_0x231c('0x16')||_0x4b5833===_0x231c('0x17')){return _0x58bd0f;}return null;}},'servicelevel':{'type':Sequelize[_0x231c('0x18')](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0x231c('0x2')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize[_0x231c('0x18')](0xb)},'timeout':{'type':Sequelize[_0x231c('0x18')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize[_0x231c('0x18')](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0x231c('0x2')]},'weight':{'type':Sequelize[_0x231c('0x18')](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize[_0x231c('0x18')](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize[_0x231c('0x4')](_0x231c('0x19'),'no'),'defaultValue':'yes'},'autopause':{'type':Sequelize[_0x231c('0x4')](_0x231c('0x19'),'no',_0x231c('0x1a')),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0x231c('0x18')](0xb)},'autopausebusy':{'type':Sequelize[_0x231c('0x4')](_0x231c('0x19'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize[_0x231c('0x4')](_0x231c('0x19'),'no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0x231c('0x18')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize[_0x231c('0x4')]('yes','no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize[_0x231c('0x4')]('yes','no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize[_0x231c('0x4')]('yes','no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize[_0x231c('0x4')](_0x231c('0x19'),'no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0x231c('0x2')],'allowNull':!![]},'membergosub':{'type':Sequelize[_0x231c('0x2')],'allowNull':!![]},'announce_frequency':{'type':Sequelize[_0x231c('0x18')](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0x231c('0x18')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0x231c('0x18')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize[_0x231c('0x4')]('yes','no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize[_0x231c('0x4')](_0x231c('0x19'),'no'),'defaultValue':'yes'},'announce_holdtime':{'type':Sequelize[_0x231c('0x4')](_0x231c('0x19'),'no','once'),'defaultValue':'no'},'announce_position':{'type':Sequelize[_0x231c('0x2')],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize['ENUM'](_0x231c('0x19'),'no')},'announce_position_limit':{'type':Sequelize[_0x231c('0x18')](0xb)},'announce_round_seconds':{'type':Sequelize[_0x231c('0x4')]('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize[_0x231c('0x2')],'defaultValue':''},'monitor_type':{'type':Sequelize[_0x231c('0x2')]},'queue_youarenext':{'type':Sequelize[_0x231c('0x2')],'defaultValue':null},'queue_thereare':{'type':Sequelize[_0x231c('0x2')],'defaultValue':null},'queue_callswaiting':{'type':Sequelize['STRING'],'defaultValue':null},'queue_holdtime':{'type':Sequelize[_0x231c('0x2')],'defaultValue':null},'queue_minute':{'type':Sequelize[_0x231c('0x2')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize['STRING'],'defaultValue':null},'queue_seconds':{'type':Sequelize[_0x231c('0x2')],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0x231c('0x2')],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0x231c('0x2')]},'queue_quantity1':{'type':Sequelize[_0x231c('0x2')]},'queue_quantity2':{'type':Sequelize[_0x231c('0x2')]},'queue_periodic_announce':{'type':Sequelize[_0x231c('0x2')]},'queue_less_than':{'type':Sequelize[_0x231c('0x2')]},'periodic_announce':{'type':Sequelize['TEXT'],'set':function(_0x37e519){this[_0x231c('0xd')]('periodic_announce',_0x37e519?_0x37e519['join'](','):[]);},'get':function(){return this['getDataValue'](_0x231c('0x1b'))?this['getDataValue'](_0x231c('0x1b'))['split'](','):[];}},'joinempty':{'type':Sequelize[_0x231c('0x2')],'defaultValue':_0x231c('0x19'),'set':function(_0x6fb073){this[_0x231c('0xd')]('joinempty',_0x6fb073?_0x6fb073[_0x231c('0x1c')](','):undefined);},'get':function(){return this[_0x231c('0x10')](_0x231c('0x1d'))?this[_0x231c('0x10')](_0x231c('0x1d'))[_0x231c('0x1e')](','):undefined;}},'leavewhenempty':{'type':Sequelize[_0x231c('0x2')],'defaultValue':'no','set':function(_0xa097e){this['setDataValue']('leavewhenempty',_0xa097e?_0xa097e[_0x231c('0x1c')](','):undefined);},'get':function(){return this[_0x231c('0x10')](_0x231c('0x1f'))?this[_0x231c('0x10')](_0x231c('0x1f'))[_0x231c('0x1e')](','):undefined;}},'reportholdtime':{'type':Sequelize['ENUM'](_0x231c('0x19'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize[_0x231c('0x4')]('yes','no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize[_0x231c('0x4')]('yes','no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0x231c('0x2')]},'description':{'type':Sequelize['STRING']},'acw':{'type':Sequelize[_0x231c('0x20')],'defaultValue':0x0,'set':function(_0x2c7c22){this['setDataValue'](_0x231c('0x21'),_0x2c7c22);if(_0x2c7c22){if(this[_0x231c('0x10')](_0x231c('0x22'))<0x2){this['setDataValue'](_0x231c('0x22'),0x2);}}}},'acwTimeout':{'type':Sequelize[_0x231c('0x18')](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize[_0x231c('0x20')],'defaultValue':0x0,'comment':_0x231c('0x23')},'dialMethod':{'type':Sequelize[_0x231c('0x4')](_0x231c('0x24'),_0x231c('0x15'),_0x231c('0x17'),_0x231c('0x16'),_0x231c('0x13')),'defaultValue':_0x231c('0x15'),'comment':_0x231c('0x25')},'dialLimitChannel':{'type':Sequelize[_0x231c('0x18')](0x4)['UNSIGNED'],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x231c('0x26')},'dialLimitQueue':{'type':Sequelize[_0x231c('0x18')](0x4)[_0x231c('0x27')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x231c('0x28')},'dialPowerLevel':{'type':Sequelize[_0x231c('0x29')](0x2)['UNSIGNED'],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':_0x231c('0x2a')},'dialPredictiveOptimization':{'type':Sequelize[_0x231c('0x4')](_0x231c('0x2b'),'dropRate'),'defaultValue':_0x231c('0x2c'),'comment':_0x231c('0x2d')},'dialPredictiveOptimizationPercentage':{'type':Sequelize[_0x231c('0x29')](0x2)[_0x231c('0x27')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0x231c('0x2e')},'dialPredictiveInterval':{'type':Sequelize[_0x231c('0x18')](0x3)['UNSIGNED'],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':_0x231c('0x2f')},'dialOriginateCallerIdName':{'type':Sequelize[_0x231c('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x231c('0x2')]},'dialOriginateTimeout':{'type':Sequelize[_0x231c('0x18')](0x3)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x231c('0x30')},'dialQueueOptions':{'type':Sequelize['STRING'],'defaultValue':_0x231c('0x31'),'comment':'https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue'},'dialQueueTimeout':{'type':Sequelize[_0x231c('0x18')](0x3)[_0x231c('0x27')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x231c('0x32')},'dialQueueProject':{'type':Sequelize[_0x231c('0x2')],'comment':_0x231c('0x33')},'dialCongestionMaxRetry':{'type':Sequelize[_0x231c('0x18')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x231c('0x34')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x231c('0x18')](0x5)[_0x231c('0x27')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialBusyMaxRetry':{'type':Sequelize[_0x231c('0x18')](0x3)[_0x231c('0x27')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x231c('0x35')},'dialBusyRetryFrequency':{'type':Sequelize[_0x231c('0x18')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x231c('0x36')},'dialNoAnswerMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x231c('0x27')],'defaultValue':0x3,'comment':_0x231c('0x37')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x231c('0x18')](0x5)[_0x231c('0x27')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x231c('0x38')},'dialGlobalMaxRetry':{'type':Sequelize[_0x231c('0x18')](0x3)[_0x231c('0x27')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x231c('0x39')},'dialTimezone':{'type':Sequelize[_0x231c('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x231c('0x2')],'defaultValue':_0x231c('0x3a')},'dialPrefix':{'type':Sequelize[_0x231c('0x2')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize[_0x231c('0x4')](_0x231c('0x3b'),'never',_0x231c('0x3c')),'defaultValue':_0x231c('0x3b')},'dialAMDActive':{'type':Sequelize[_0x231c('0x20')],'defaultValue':0x0,'comment':_0x231c('0x3d')},'dialAMDInitialSilence':{'type':Sequelize[_0x231c('0x18')](0x9)['UNSIGNED'],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':'#AMD\x20Initial\x20Silence'},'dialAMDGreeting':{'type':Sequelize[_0x231c('0x18')](0x9)['UNSIGNED'],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x231c('0x3e')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x231c('0x18')](0x9)[_0x231c('0x27')],'defaultValue':0x320,'validate':{'min':0x0},'comment':'#AMD\x20After\x20Greeting\x20Silence'},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x231c('0x18')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x231c('0x3f')},'dialAMDMinWordLength':{'type':Sequelize[_0x231c('0x18')](0x9)['UNSIGNED'],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x231c('0x40')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x231c('0x18')](0x9)[_0x231c('0x27')],'defaultValue':0x32,'validate':{'min':0x0},'comment':'#AMD\x20Between\x20Words\x20Silence'},'dialAMDMaximumNumberOfWords':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x231c('0x41')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x231c('0x18')](0x5)[_0x231c('0x27')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':'#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)'},'dialAMDMaximumWordLength':{'type':Sequelize[_0x231c('0x18')](0x9)[_0x231c('0x27')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x231c('0x42')},'dialRecallMeTimeout':{'type':Sequelize[_0x231c('0x18')](0x5)[_0x231c('0x27')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0x231c('0x43')},'dialRecallInQueue':{'type':Sequelize[_0x231c('0x20')],'defaultValue':0x0,'comment':_0x231c('0x44')},'dialOrderByScheduledAt':{'type':Sequelize[_0x231c('0x4')](_0x231c('0x45'),_0x231c('0x46')),'defaultValue':'DESC'},'dialQueueProject2':{'type':Sequelize[_0x231c('0x2')],'comment':_0x231c('0x33')},'dialAgiAfterHangupClient':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0x231c('0x20')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize['INTEGER'](0x3)[_0x231c('0x27')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x231c('0x47')},'dialCutDigit':{'type':Sequelize[_0x231c('0x18')](0x3)[_0x231c('0x27')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x231c('0x48')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x231c('0x18')](0x3)[_0x231c('0x27')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x231c('0x49')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x231c('0x18')](0x5)[_0x231c('0x27')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialDropMaxRetry':{'type':Sequelize[_0x231c('0x18')](0x3)[_0x231c('0x27')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x231c('0x4a')},'dialDropRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x231c('0x27')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x231c('0x4b')},'dialAbandonedMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x231c('0x27')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Abandoned\x20Retry\x20(min:1,\x20max:999)'},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x231c('0x18')](0x5)[_0x231c('0x27')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x231c('0x4c')},'dialMachineMaxRetry':{'type':Sequelize[_0x231c('0x18')](0x3)[_0x231c('0x27')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Machine\x20Retry\x20(min:1,\x20max:999)'},'dialMachineRetryFrequency':{'type':Sequelize[_0x231c('0x18')](0x5)[_0x231c('0x27')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x231c('0x4d')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x231c('0x18')](0x3)[_0x231c('0x27')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x231c('0x4e')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x231c('0x18')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'comment':_0x231c('0x4f')},'mandatoryDisposition':{'type':Sequelize[_0x231c('0x20')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x28ce15){if(!_0x28ce15)this['setDataValue'](_0x231c('0x50'),null);this[_0x231c('0xd')](_0x231c('0x51'),_0x28ce15);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize[_0x231c('0x18')](0x3)['UNSIGNED'],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize[_0x231c('0x18')](0x3)['UNSIGNED'],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}}}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.controller.js b/server/api/voiceQueue/voiceQueue.controller.js index 74b58f2..56af187 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 _0x59b8=['to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','defaults','redis','localhost','./voiceQueue.socket','register','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','save','then','destroy','get','VoiceQueues','QueueCampaigns','outbound','filter','ignore','map','value','includes','type','find','UserProfileResource','error','stack','name','send','index','VoiceQueue','rawAttributes','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','merge','options','include','findAll','catch','params','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','inbound','UserProfileSection','userProfileId','omit','createdAt','updatedAt','includeAll','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','findOne','hasOwnProperty','CmHopper','rows','getHopperHistories','VoiceQueueId','CmHopperHistory','CmHopperFinal','getHopperBlacks','CmHopperBlack','getTeams','Team','User','Agents','voicePause','interface','transaction','addTeams','each','penalty','UserVoiceQueue','findOrCreate','isNil','format','SIP/%s','emit','removeTeams','ids','select','from','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','VoiceQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','sequelize','toString','QueryTypes','SELECT','every','TeamId','all','union','isEmpty','removeAgents','UserVoiceQueueRt','forEach','userVoiceQueue:remove','addAgents','userVoiceQueue:save','online','upsert','isArray','getAgents','getMembers','getLists','CmList','addLists','dialCheckDuplicateType','always','cm_hopper','fromQuery','phone','ContactId','ListId','field','NOW()','scheduledAt','CmListId','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','COALESCE(phone,\x27\x27)','onlyIfOpen','insert','into','removeLists','getBlackLists','addBlackLists','cm_hopper_black','removeBlackLists','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path'];(function(_0x5350c3,_0x550a99){var _0x2da492=function(_0x1c5fdc){while(--_0x1c5fdc){_0x5350c3['push'](_0x5350c3['shift']());}};_0x2da492(++_0x550a99);}(_0x59b8,0xaf));var _0x859b=function(_0x955678,_0x4e28df){_0x955678=_0x955678-0x0;var _0x3e2a29=_0x59b8[_0x955678];return _0x3e2a29;};'use strict';var emlformat=require(_0x859b('0x0'));var rimraf=require(_0x859b('0x1'));var zipdir=require(_0x859b('0x2'));var jsonpatch=require(_0x859b('0x3'));var rp=require(_0x859b('0x4'));var moment=require(_0x859b('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x859b('0x6'));var util=require(_0x859b('0x7'));var path=require(_0x859b('0x8'));var sox=require('sox');var csv=require(_0x859b('0x9'));var ejs=require(_0x859b('0xa'));var fs=require('fs');var fs_extra=require(_0x859b('0xb'));var _=require(_0x859b('0xc'));var squel=require(_0x859b('0xd'));var crypto=require(_0x859b('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x859b('0xf'));var toCsv=require(_0x859b('0x9'));var querystring=require('querystring');var Papa=require(_0x859b('0x10'));var Redis=require(_0x859b('0x11'));var authService=require(_0x859b('0x12'));var qs=require(_0x859b('0x13'));var as=require(_0x859b('0x14'));var hardwareService=require(_0x859b('0x15'));var logger=require('../../config/logger')(_0x859b('0x16'));var utils=require(_0x859b('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x859b('0x18'))['db'];config['redis']=_[_0x859b('0x19')](config[_0x859b('0x1a')],{'host':_0x859b('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x859b('0x1a')]));require(_0x859b('0x1c'))[_0x859b('0x1d')](socket);function respondWithStatusCode(_0x2dfba3,_0x418ac2){_0x418ac2=_0x418ac2||0xcc;return function(_0x755c3a){if(_0x755c3a){return _0x2dfba3[_0x859b('0x1e')](_0x418ac2);}return _0x2dfba3[_0x859b('0x1f')](_0x418ac2)[_0x859b('0x20')]();};}function respondWithResult(_0x876c01,_0xf4b44a){_0xf4b44a=_0xf4b44a||0xc8;return function(_0x3d3e48){if(_0x3d3e48){return _0x876c01[_0x859b('0x1f')](_0xf4b44a)['json'](_0x3d3e48);}};}function respondWithFilteredResult(_0x48d19c,_0x27ba09){return function(_0x2f7455){if(_0x2f7455){var _0x4556d5=typeof _0x27ba09[_0x859b('0x21')]===_0x859b('0x22')&&typeof _0x27ba09[_0x859b('0x23')]===_0x859b('0x22');var _0x22dfc3=_0x2f7455[_0x859b('0x24')];var _0x53c37d=_0x4556d5?0x0:_0x27ba09[_0x859b('0x21')];var _0x3705bb=_0x4556d5?_0x2f7455[_0x859b('0x24')]:_0x27ba09[_0x859b('0x21')]+_0x27ba09[_0x859b('0x23')];var _0x534694;if(_0x3705bb>=_0x22dfc3){_0x3705bb=_0x22dfc3;_0x534694=0xc8;}else{_0x534694=0xce;}_0x48d19c[_0x859b('0x1f')](_0x534694);return _0x48d19c[_0x859b('0x25')](_0x859b('0x26'),_0x53c37d+'-'+_0x3705bb+'/'+_0x22dfc3)[_0x859b('0x27')](_0x2f7455);}return null;};}function patchUpdates(_0x4b6cd5){return function(_0x1cf3f1){try{jsonpatch[_0x859b('0x28')](_0x1cf3f1,_0x4b6cd5,!![]);}catch(_0x391527){return BPromise['reject'](_0x391527);}return _0x1cf3f1[_0x859b('0x29')]();};}function saveUpdates(_0x48b9d3,_0x5a9baa){return function(_0x29fc84){if(_0x29fc84){return _0x29fc84['update'](_0x48b9d3)[_0x859b('0x2a')](function(_0x46fe81){return _0x46fe81;});}return null;};}function removeEntity(_0x1fd6c9,_0x25ec31){return function(_0x2518a7){if(_0x2518a7){return _0x2518a7[_0x859b('0x2b')]()[_0x859b('0x2a')](function(){var _0x12db7=_0x2518a7[_0x859b('0x2c')]({'plain':!![]});var _0x3f6447=[{'name':_0x859b('0x2d'),'value':'inbound','ignore':![]},{'name':_0x859b('0x2e'),'value':_0x859b('0x2f'),'ignore':![]}];var _0x32dcc5=_(_0x3f6447)[_0x859b('0x30')](_0x859b('0x31'))[_0x859b('0x32')](_0x859b('0x33'))[_0x859b('0x33')]();if(_[_0x859b('0x34')](_0x32dcc5,_0x12db7[_0x859b('0x35')])){return;}var _0x121be5=_[_0x859b('0x36')](_0x3f6447,[_0x859b('0x33'),_0x12db7[_0x859b('0x35')]])['name'];return db[_0x859b('0x37')][_0x859b('0x2b')]({'where':{'type':_0x121be5,'resourceId':_0x12db7['id']}})[_0x859b('0x2a')](function(){return _0x2518a7;});})[_0x859b('0x2a')](function(){_0x1fd6c9['status'](0xcc)[_0x859b('0x20')]();});}};}function handleEntityNotFound(_0x181e2c,_0x5a0fc0){return function(_0x5a2cd4){if(!_0x5a2cd4){_0x181e2c['sendStatus'](0x194);}return _0x5a2cd4;};}function handleError(_0x1ebb88,_0x57c970){_0x57c970=_0x57c970||0x1f4;return function(_0x5317f3){logger[_0x859b('0x38')](_0x5317f3[_0x859b('0x39')]);if(_0x5317f3['name']){delete _0x5317f3[_0x859b('0x3a')];}_0x1ebb88[_0x859b('0x1f')](_0x57c970)[_0x859b('0x3b')](_0x5317f3);};}exports[_0x859b('0x3c')]=function(_0x3f5a8d,_0x272375){var _0x2d3426={},_0x5e52c2={},_0x558e05={'count':0x0,'rows':[]};var _0x47f355=_[_0x859b('0x32')](db[_0x859b('0x3d')][_0x859b('0x3e')],function(_0x15f602){return{'name':_0x15f602['fieldName'],'type':_0x15f602[_0x859b('0x35')][_0x859b('0x3f')]};});_0x5e52c2[_0x859b('0x40')]=_[_0x859b('0x32')](_0x47f355,_0x859b('0x3a'));_0x5e52c2[_0x859b('0x41')]=_[_0x859b('0x42')](_0x3f5a8d[_0x859b('0x41')]);_0x5e52c2[_0x859b('0x43')]=_[_0x859b('0x44')](_0x5e52c2[_0x859b('0x40')],_0x5e52c2[_0x859b('0x41')]);_0x2d3426[_0x859b('0x45')]=_[_0x859b('0x44')](_0x5e52c2[_0x859b('0x40')],qs[_0x859b('0x46')](_0x3f5a8d['query']['fields']));_0x2d3426[_0x859b('0x45')]=_0x2d3426['attributes'][_0x859b('0x47')]?_0x2d3426['attributes']:_0x5e52c2[_0x859b('0x40')];if(!_0x3f5a8d[_0x859b('0x41')]['hasOwnProperty'](_0x859b('0x48'))){_0x2d3426[_0x859b('0x23')]=qs['limit'](_0x3f5a8d['query']['limit']);_0x2d3426[_0x859b('0x21')]=qs[_0x859b('0x21')](_0x3f5a8d[_0x859b('0x41')][_0x859b('0x21')]);}_0x2d3426[_0x859b('0x49')]=qs[_0x859b('0x4a')](_0x3f5a8d[_0x859b('0x41')]['sort']);_0x2d3426[_0x859b('0x4b')]=qs[_0x859b('0x43')](_[_0x859b('0x4c')](_0x3f5a8d['query'],_0x5e52c2[_0x859b('0x43')]),_0x47f355);if(_0x3f5a8d[_0x859b('0x41')][_0x859b('0x30')]){_0x2d3426[_0x859b('0x4b')]=_[_0x859b('0x4d')](_0x2d3426[_0x859b('0x4b')],{'$or':_[_0x859b('0x32')](_0x47f355,function(_0x2c22f8){if(_0x2c22f8[_0x859b('0x35')]!=='VIRTUAL'){var _0x509414={};_0x509414[_0x2c22f8[_0x859b('0x3a')]]={'$like':'%'+_0x3f5a8d[_0x859b('0x41')][_0x859b('0x30')]+'%'};return _0x509414;}})});}_0x2d3426=_[_0x859b('0x4d')]({},_0x2d3426,_0x3f5a8d[_0x859b('0x4e')]);var _0x26e10d={'where':_0x2d3426[_0x859b('0x4b')]};return db[_0x859b('0x3d')]['count'](_0x26e10d)[_0x859b('0x2a')](function(_0x446912){_0x558e05[_0x859b('0x24')]=_0x446912;if(_0x3f5a8d[_0x859b('0x41')]['includeAll']){_0x2d3426[_0x859b('0x4f')]=[{'all':!![]}];}return db[_0x859b('0x3d')][_0x859b('0x50')](_0x2d3426);})[_0x859b('0x2a')](function(_0xa6e0ba){_0x558e05['rows']=_0xa6e0ba;return _0x558e05;})[_0x859b('0x2a')](respondWithFilteredResult(_0x272375,_0x2d3426))[_0x859b('0x51')](handleError(_0x272375,null));};exports['show']=function(_0x1c03a8,_0x3f5feb){var _0x171a7f={'raw':![],'where':{'id':_0x1c03a8[_0x859b('0x52')]['id']}},_0x27f0ff={};_0x27f0ff[_0x859b('0x40')]=_[_0x859b('0x42')](db[_0x859b('0x3d')]['rawAttributes']);_0x27f0ff[_0x859b('0x41')]=_[_0x859b('0x42')](_0x1c03a8[_0x859b('0x41')]);_0x27f0ff['filters']=_[_0x859b('0x44')](_0x27f0ff['model'],_0x27f0ff[_0x859b('0x41')]);_0x171a7f['attributes']=_[_0x859b('0x44')](_0x27f0ff[_0x859b('0x40')],qs[_0x859b('0x46')](_0x1c03a8[_0x859b('0x41')]['fields']));_0x171a7f[_0x859b('0x45')]=_0x171a7f[_0x859b('0x45')][_0x859b('0x47')]?_0x171a7f['attributes']:_0x27f0ff[_0x859b('0x40')];if(_0x1c03a8[_0x859b('0x41')]['includeAll']){_0x171a7f[_0x859b('0x4f')]=[{'all':!![]}];}_0x171a7f=_[_0x859b('0x4d')]({},_0x171a7f,_0x1c03a8[_0x859b('0x4e')]);return db['VoiceQueue'][_0x859b('0x36')](_0x171a7f)[_0x859b('0x2a')](handleEntityNotFound(_0x3f5feb,null))[_0x859b('0x2a')](respondWithResult(_0x3f5feb,null))['catch'](handleError(_0x3f5feb,null));};exports[_0x859b('0x53')]=function(_0x82e192,_0x2a13b4){return db[_0x859b('0x3d')][_0x859b('0x53')](_0x82e192[_0x859b('0x54')],{})['then'](function(_0x166e93){var _0x343776=_0x82e192['user'][_0x859b('0x2c')]({'plain':!![]});if(!_0x343776)throw new Error(_0x859b('0x55'));if(_0x343776[_0x859b('0x56')]===_0x859b('0x57')){var _0x3d805a=_0x166e93[_0x859b('0x2c')]({'plain':!![]});var _0x2cef8e=[{'name':_0x859b('0x2d'),'value':_0x859b('0x58')},{'name':'QueueCampaigns','value':_0x859b('0x2f')}];var _0x13291f=_[_0x859b('0x36')](_0x2cef8e,[_0x859b('0x33'),_0x3d805a['type']])[_0x859b('0x3a')];return db[_0x859b('0x59')][_0x859b('0x36')]({'where':{'name':_0x13291f,'userProfileId':_0x343776[_0x859b('0x5a')]},'raw':!![]})[_0x859b('0x2a')](function(_0x2f1807){if(_0x2f1807&&_0x2f1807['autoAssociation']===0x0){return db[_0x859b('0x37')][_0x859b('0x53')]({'name':_0x3d805a[_0x859b('0x3a')],'resourceId':_0x3d805a['id'],'type':_0x2f1807['name'],'sectionId':_0x2f1807['id']},{})[_0x859b('0x2a')](function(){return _0x166e93;});}else{return _0x166e93;}})[_0x859b('0x51')](function(_0x559dae){logger[_0x859b('0x38')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x559dae);throw _0x559dae;});}return _0x166e93;})[_0x859b('0x2a')](respondWithResult(_0x2a13b4,0xc9))[_0x859b('0x51')](handleError(_0x2a13b4,null));};exports['clone']=function(_0x146b0f,_0x4cd3a4){var _0x348f83={'where':{'id':_0x146b0f['params']['id']}},_0x2bef97={};_0x2bef97[_0x859b('0x40')]=_[_0x859b('0x42')](db['VoiceQueue'][_0x859b('0x3e')]);_0x348f83[_0x859b('0x45')]=_['intersection'](_0x2bef97['model'],qs['fields'](_0x146b0f['query'][_0x859b('0x46')]));_0x348f83[_0x859b('0x45')]=_0x348f83[_0x859b('0x45')]['length']?_0x348f83['attributes']:_0x2bef97[_0x859b('0x40')];if(_0x146b0f[_0x859b('0x41')]['includeAll']){_0x348f83[_0x859b('0x4f')]=[{'all':!![]}];}_0x348f83=_['merge']({},_0x348f83,_0x146b0f['options']);return db['VoiceQueue'][_0x859b('0x36')](_0x348f83)[_0x859b('0x2a')](handleEntityNotFound(_0x4cd3a4,null))[_0x859b('0x2a')](function(_0x253efc){if(_0x253efc){var _0x5933ef=_0x253efc[_0x859b('0x2c')]({'plain':!![]});_0x5933ef=qs[_0x859b('0x5b')](_0x5933ef,['id',_0x859b('0x5c'),_0x859b('0x5d')]);_0x146b0f['body']=_['omit'](_0x146b0f['body'],['id','createdAt',_0x859b('0x5d')]);return db['VoiceQueue']['create'](_[_0x859b('0x4d')](_0x5933ef,_0x146b0f['body']),{'include':_0x146b0f[_0x859b('0x41')][_0x859b('0x5e')]?[{'all':!![]}]:undefined})['then'](function(_0x43826e){var _0x4a9625=_0x146b0f['user'][_0x859b('0x2c')]({'plain':!![]});if(!_0x4a9625)throw new Error(_0x859b('0x55'));if(_0x4a9625[_0x859b('0x56')]===_0x859b('0x57')){var _0x2b99d8=_0x43826e['get']({'plain':!![]});var _0x3320bd=[{'name':_0x859b('0x2d'),'value':'inbound'},{'name':_0x859b('0x2e'),'value':_0x859b('0x2f')}];var _0x4fdf3c=_[_0x859b('0x36')](_0x3320bd,['value',_0x2b99d8[_0x859b('0x35')]])[_0x859b('0x3a')];return db[_0x859b('0x59')]['find']({'where':{'name':_0x4fdf3c,'userProfileId':_0x4a9625[_0x859b('0x5a')]},'raw':!![]})[_0x859b('0x2a')](function(_0x5d7491){if(_0x5d7491&&_0x5d7491[_0x859b('0x5f')]===0x0){return db[_0x859b('0x37')][_0x859b('0x53')]({'name':_0x2b99d8['name'],'resourceId':_0x2b99d8['id'],'type':_0x5d7491[_0x859b('0x3a')],'sectionId':_0x5d7491['id']},{})[_0x859b('0x2a')](function(){return _0x43826e;});}else{return _0x43826e;}})[_0x859b('0x51')](function(_0x32daa7){logger[_0x859b('0x38')](_0x859b('0x60'),_0x32daa7);throw _0x32daa7;});}return _0x43826e;});}})[_0x859b('0x2a')](respondWithResult(_0x4cd3a4,0xc9))[_0x859b('0x51')](handleError(_0x4cd3a4,null));};exports[_0x859b('0x61')]=function(_0x1fa050,_0x3a301f){if(_0x1fa050[_0x859b('0x54')]['id']){delete _0x1fa050[_0x859b('0x54')]['id'];}return db['VoiceQueue'][_0x859b('0x36')]({'where':{'id':_0x1fa050[_0x859b('0x52')]['id']}})[_0x859b('0x2a')](handleEntityNotFound(_0x3a301f,null))['then'](saveUpdates(_0x1fa050['body'],null))[_0x859b('0x2a')](respondWithResult(_0x3a301f,null))[_0x859b('0x51')](handleError(_0x3a301f,null));};exports[_0x859b('0x2b')]=function(_0x761e1,_0x571d1e){return db[_0x859b('0x3d')]['find']({'where':{'id':_0x761e1[_0x859b('0x52')]['id']}})[_0x859b('0x2a')](handleEntityNotFound(_0x571d1e,null))[_0x859b('0x2a')](removeEntity(_0x571d1e,null))['catch'](handleError(_0x571d1e,null));};exports['getHoppers']=function(_0x377f3a,_0x205cfd,_0x273fe8){var _0x56062a={'raw':![],'where':{}};var _0x46a344={};var _0x173930={'count':0x0,'rows':[]};return db[_0x859b('0x3d')][_0x859b('0x62')]({'where':{'id':_0x377f3a[_0x859b('0x52')]['id']}})[_0x859b('0x2a')](handleEntityNotFound(_0x205cfd,null))[_0x859b('0x2a')](function(_0x1467e2){if(_0x1467e2){_0x46a344[_0x859b('0x40')]=_[_0x859b('0x42')](db['CmHopper'][_0x859b('0x3e')]);_0x46a344[_0x859b('0x41')]=_[_0x859b('0x42')](_0x377f3a[_0x859b('0x41')]);_0x46a344[_0x859b('0x43')]=_[_0x859b('0x44')](_0x46a344['model'],_0x46a344[_0x859b('0x41')]);_0x56062a[_0x859b('0x45')]=_[_0x859b('0x44')](_0x46a344[_0x859b('0x40')],qs['fields'](_0x377f3a[_0x859b('0x41')][_0x859b('0x46')]));_0x56062a[_0x859b('0x45')]=_0x56062a[_0x859b('0x45')][_0x859b('0x47')]?_0x56062a[_0x859b('0x45')]:_0x46a344[_0x859b('0x40')];if(!_0x377f3a['query'][_0x859b('0x63')]('nolimit')){_0x56062a['limit']=qs[_0x859b('0x23')](_0x377f3a[_0x859b('0x41')]['limit']);_0x56062a[_0x859b('0x21')]=qs[_0x859b('0x21')](_0x377f3a['query'][_0x859b('0x21')]);}_0x56062a[_0x859b('0x49')]=qs['sort'](_0x377f3a[_0x859b('0x41')]['sort']);_0x56062a['where']=qs[_0x859b('0x43')](_[_0x859b('0x4c')](_0x377f3a['query'],_0x46a344['filters']));_0x56062a[_0x859b('0x4b')]['VoiceQueueId']=_0x1467e2['id'];if(_0x377f3a[_0x859b('0x41')][_0x859b('0x30')]){_0x56062a[_0x859b('0x4b')]=_['merge'](_0x56062a[_0x859b('0x4b')],{'$or':_[_0x859b('0x32')](_0x56062a['attributes'],function(_0x5f2c0b){var _0x157ff8={};_0x157ff8[_0x5f2c0b]={'$like':'%'+_0x377f3a['query'][_0x859b('0x30')]+'%'};return _0x157ff8;})});}_0x56062a=_['merge']({},_0x56062a,_0x377f3a[_0x859b('0x4e')]);return db[_0x859b('0x64')][_0x859b('0x24')]({'where':_0x56062a[_0x859b('0x4b')]})['then'](function(_0x1a78ec){_0x173930['count']=_0x1a78ec;if(_0x377f3a[_0x859b('0x41')]['includeAll']){_0x56062a[_0x859b('0x4f')]=[{'all':!![]}];}return db['CmHopper'][_0x859b('0x50')](_0x56062a);})[_0x859b('0x2a')](function(_0x23cb14){_0x173930[_0x859b('0x65')]=_0x23cb14;return _0x173930;});}})['then'](respondWithFilteredResult(_0x205cfd,_0x56062a))[_0x859b('0x51')](handleError(_0x205cfd,null));};exports[_0x859b('0x66')]=function(_0x1905fe,_0x2f1095,_0x90719d){var _0x5684e4={'raw':!![],'where':{}};var _0x139c0b={};var _0x1a847b={'count':0x0,'rows':[]};return db[_0x859b('0x3d')][_0x859b('0x62')]({'where':{'id':_0x1905fe[_0x859b('0x52')]['id']}})[_0x859b('0x2a')](handleEntityNotFound(_0x2f1095,null))['then'](function(_0x237492){if(_0x237492){_0x139c0b[_0x859b('0x40')]=_[_0x859b('0x42')](db['CmHopperHistory'][_0x859b('0x3e')]);_0x139c0b['query']=_[_0x859b('0x42')](_0x1905fe[_0x859b('0x41')]);_0x139c0b['filters']=_[_0x859b('0x44')](_0x139c0b[_0x859b('0x40')],_0x139c0b[_0x859b('0x41')]);_0x5684e4[_0x859b('0x45')]=_['intersection'](_0x139c0b[_0x859b('0x40')],qs['fields'](_0x1905fe[_0x859b('0x41')][_0x859b('0x46')]));_0x5684e4[_0x859b('0x45')]=_0x5684e4[_0x859b('0x45')][_0x859b('0x47')]?_0x5684e4[_0x859b('0x45')]:_0x139c0b[_0x859b('0x40')];if(!_0x1905fe[_0x859b('0x41')][_0x859b('0x63')](_0x859b('0x48'))){_0x5684e4[_0x859b('0x23')]=qs['limit'](_0x1905fe[_0x859b('0x41')][_0x859b('0x23')]);_0x5684e4['offset']=qs['offset'](_0x1905fe[_0x859b('0x41')][_0x859b('0x21')]);}_0x5684e4[_0x859b('0x49')]=qs[_0x859b('0x4a')](_0x1905fe[_0x859b('0x41')]['sort']);_0x5684e4[_0x859b('0x4b')]=qs[_0x859b('0x43')](_['pick'](_0x1905fe['query'],_0x139c0b[_0x859b('0x43')]));_0x5684e4[_0x859b('0x4b')][_0x859b('0x67')]=_0x237492['id'];if(_0x1905fe[_0x859b('0x41')][_0x859b('0x30')]){_0x5684e4[_0x859b('0x4b')]=_[_0x859b('0x4d')](_0x5684e4[_0x859b('0x4b')],{'$or':_[_0x859b('0x32')](_0x5684e4[_0x859b('0x45')],function(_0x143ed8){var _0x3daf20={};_0x3daf20[_0x143ed8]={'$like':'%'+_0x1905fe[_0x859b('0x41')][_0x859b('0x30')]+'%'};return _0x3daf20;})});}_0x5684e4=_[_0x859b('0x4d')]({},_0x5684e4,_0x1905fe['options']);return db[_0x859b('0x68')]['count']({'where':_0x5684e4[_0x859b('0x4b')]})[_0x859b('0x2a')](function(_0x586c6f){_0x1a847b['count']=_0x586c6f;if(_0x1905fe[_0x859b('0x41')][_0x859b('0x5e')]){_0x5684e4[_0x859b('0x4f')]=[{'all':!![]}];}return db[_0x859b('0x68')][_0x859b('0x50')](_0x5684e4);})[_0x859b('0x2a')](function(_0x4c4e9f){_0x1a847b['rows']=_0x4c4e9f;return _0x1a847b;});}})[_0x859b('0x2a')](respondWithFilteredResult(_0x2f1095,_0x5684e4))[_0x859b('0x51')](handleError(_0x2f1095,null));};exports['getHopperFinals']=function(_0x2ee166,_0x520de7,_0x39bc3e){var _0x209323={'raw':!![],'where':{}};var _0x1920ad={};var _0x13f993={'count':0x0,'rows':[]};return db[_0x859b('0x3d')]['findOne']({'where':{'id':_0x2ee166[_0x859b('0x52')]['id']}})[_0x859b('0x2a')](handleEntityNotFound(_0x520de7,null))[_0x859b('0x2a')](function(_0x84d339){if(_0x84d339){_0x1920ad[_0x859b('0x40')]=_[_0x859b('0x42')](db[_0x859b('0x69')][_0x859b('0x3e')]);_0x1920ad[_0x859b('0x41')]=_[_0x859b('0x42')](_0x2ee166[_0x859b('0x41')]);_0x1920ad[_0x859b('0x43')]=_['intersection'](_0x1920ad[_0x859b('0x40')],_0x1920ad[_0x859b('0x41')]);_0x209323[_0x859b('0x45')]=_[_0x859b('0x44')](_0x1920ad['model'],qs['fields'](_0x2ee166[_0x859b('0x41')][_0x859b('0x46')]));_0x209323[_0x859b('0x45')]=_0x209323[_0x859b('0x45')]['length']?_0x209323[_0x859b('0x45')]:_0x1920ad[_0x859b('0x40')];if(!_0x2ee166[_0x859b('0x41')][_0x859b('0x63')](_0x859b('0x48'))){_0x209323[_0x859b('0x23')]=qs[_0x859b('0x23')](_0x2ee166['query'][_0x859b('0x23')]);_0x209323[_0x859b('0x21')]=qs['offset'](_0x2ee166[_0x859b('0x41')][_0x859b('0x21')]);}_0x209323[_0x859b('0x49')]=qs[_0x859b('0x4a')](_0x2ee166[_0x859b('0x41')][_0x859b('0x4a')]);_0x209323[_0x859b('0x4b')]=qs['filters'](_[_0x859b('0x4c')](_0x2ee166[_0x859b('0x41')],_0x1920ad[_0x859b('0x43')]));_0x209323[_0x859b('0x4b')]['VoiceQueueId']=_0x84d339['id'];if(_0x2ee166[_0x859b('0x41')]['filter']){_0x209323['where']=_[_0x859b('0x4d')](_0x209323[_0x859b('0x4b')],{'$or':_[_0x859b('0x32')](_0x209323['attributes'],function(_0x9158d2){var _0x30287e={};_0x30287e[_0x9158d2]={'$like':'%'+_0x2ee166['query'][_0x859b('0x30')]+'%'};return _0x30287e;})});}_0x209323=_[_0x859b('0x4d')]({},_0x209323,_0x2ee166[_0x859b('0x4e')]);return db[_0x859b('0x69')][_0x859b('0x24')]({'where':_0x209323[_0x859b('0x4b')]})[_0x859b('0x2a')](function(_0x2fc98e){_0x13f993[_0x859b('0x24')]=_0x2fc98e;if(_0x2ee166[_0x859b('0x41')][_0x859b('0x5e')]){_0x209323['include']=[{'all':!![]}];}return db['CmHopperFinal']['findAll'](_0x209323);})[_0x859b('0x2a')](function(_0x4e0129){_0x13f993['rows']=_0x4e0129;return _0x13f993;});}})[_0x859b('0x2a')](respondWithFilteredResult(_0x520de7,_0x209323))[_0x859b('0x51')](handleError(_0x520de7,null));};exports[_0x859b('0x6a')]=function(_0x4ec230,_0x2967fd,_0x5c01a7){var _0x33afbf={'raw':!![],'where':{}};var _0x1b731e={};var _0x29e401={'count':0x0,'rows':[]};return db['VoiceQueue'][_0x859b('0x62')]({'where':{'id':_0x4ec230[_0x859b('0x52')]['id']}})[_0x859b('0x2a')](handleEntityNotFound(_0x2967fd,null))[_0x859b('0x2a')](function(_0x1cd43e){if(_0x1cd43e){_0x1b731e[_0x859b('0x40')]=_[_0x859b('0x42')](db[_0x859b('0x6b')][_0x859b('0x3e')]);_0x1b731e['query']=_[_0x859b('0x42')](_0x4ec230[_0x859b('0x41')]);_0x1b731e[_0x859b('0x43')]=_[_0x859b('0x44')](_0x1b731e['model'],_0x1b731e[_0x859b('0x41')]);_0x33afbf[_0x859b('0x45')]=_[_0x859b('0x44')](_0x1b731e[_0x859b('0x40')],qs[_0x859b('0x46')](_0x4ec230['query'][_0x859b('0x46')]));_0x33afbf[_0x859b('0x45')]=_0x33afbf[_0x859b('0x45')]['length']?_0x33afbf[_0x859b('0x45')]:_0x1b731e[_0x859b('0x40')];if(!_0x4ec230['query'][_0x859b('0x63')](_0x859b('0x48'))){_0x33afbf[_0x859b('0x23')]=qs[_0x859b('0x23')](_0x4ec230['query'][_0x859b('0x23')]);_0x33afbf[_0x859b('0x21')]=qs[_0x859b('0x21')](_0x4ec230[_0x859b('0x41')][_0x859b('0x21')]);}_0x33afbf['order']=qs[_0x859b('0x4a')](_0x4ec230[_0x859b('0x41')][_0x859b('0x4a')]);_0x33afbf[_0x859b('0x4b')]=qs[_0x859b('0x43')](_[_0x859b('0x4c')](_0x4ec230[_0x859b('0x41')],_0x1b731e['filters']));_0x33afbf[_0x859b('0x4b')][_0x859b('0x67')]=_0x1cd43e['id'];if(_0x4ec230[_0x859b('0x41')]['filter']){_0x33afbf['where']=_[_0x859b('0x4d')](_0x33afbf['where'],{'$or':_['map'](_0x33afbf[_0x859b('0x45')],function(_0x58a601){var _0x5093fe={};_0x5093fe[_0x58a601]={'$like':'%'+_0x4ec230[_0x859b('0x41')][_0x859b('0x30')]+'%'};return _0x5093fe;})});}_0x33afbf=_[_0x859b('0x4d')]({},_0x33afbf,_0x4ec230[_0x859b('0x4e')]);return db[_0x859b('0x6b')][_0x859b('0x24')]({'where':_0x33afbf[_0x859b('0x4b')]})[_0x859b('0x2a')](function(_0x3596e2){_0x29e401[_0x859b('0x24')]=_0x3596e2;if(_0x4ec230[_0x859b('0x41')][_0x859b('0x5e')]){_0x33afbf[_0x859b('0x4f')]=[{'all':!![]}];}return db['CmHopperBlack']['findAll'](_0x33afbf);})['then'](function(_0x498f82){_0x29e401[_0x859b('0x65')]=_0x498f82;return _0x29e401;});}})['then'](respondWithFilteredResult(_0x2967fd,_0x33afbf))['catch'](handleError(_0x2967fd,null));};exports[_0x859b('0x6c')]=function(_0x5e30b8,_0x4e16c4,_0x3079ed){var _0x38f70e={};var _0x5a0930={};var _0x20a518;var _0x20a85e;return db[_0x859b('0x3d')][_0x859b('0x62')]({'where':{'id':_0x5e30b8[_0x859b('0x52')]['id']}})[_0x859b('0x2a')](handleEntityNotFound(_0x4e16c4,null))[_0x859b('0x2a')](function(_0x12f3a5){if(_0x12f3a5){_0x20a518=_0x12f3a5;_0x5a0930['model']=_[_0x859b('0x42')](db['Team'][_0x859b('0x3e')]);_0x5a0930[_0x859b('0x41')]=_[_0x859b('0x42')](_0x5e30b8[_0x859b('0x41')]);_0x5a0930[_0x859b('0x43')]=_['intersection'](_0x5a0930[_0x859b('0x40')],_0x5a0930['query']);_0x38f70e[_0x859b('0x45')]=_[_0x859b('0x44')](_0x5a0930[_0x859b('0x40')],qs[_0x859b('0x46')](_0x5e30b8[_0x859b('0x41')]['fields']));_0x38f70e[_0x859b('0x45')]=_0x38f70e[_0x859b('0x45')][_0x859b('0x47')]?_0x38f70e[_0x859b('0x45')]:_0x5a0930[_0x859b('0x40')];_0x38f70e['order']=qs['sort'](_0x5e30b8[_0x859b('0x41')][_0x859b('0x4a')]);_0x38f70e['where']=qs['filters'](_[_0x859b('0x4c')](_0x5e30b8[_0x859b('0x41')],_0x5a0930[_0x859b('0x43')]));if(_0x5e30b8[_0x859b('0x41')]['filter']){_0x38f70e[_0x859b('0x4b')]=_[_0x859b('0x4d')](_0x38f70e['where'],{'$or':_[_0x859b('0x32')](_0x38f70e[_0x859b('0x45')],function(_0x5959e7){var _0x479755={};_0x479755[_0x5959e7]={'$like':'%'+_0x5e30b8[_0x859b('0x41')][_0x859b('0x30')]+'%'};return _0x479755;})});}_0x38f70e=_['merge']({},_0x38f70e,_0x5e30b8[_0x859b('0x4e')]);return _0x20a518[_0x859b('0x6c')](_0x38f70e);}})[_0x859b('0x2a')](function(_0x255086){if(_0x255086){_0x20a85e=_0x255086[_0x859b('0x47')];if(!_0x5e30b8['query'][_0x859b('0x63')](_0x859b('0x48'))){_0x38f70e[_0x859b('0x23')]=qs[_0x859b('0x23')](_0x5e30b8[_0x859b('0x41')][_0x859b('0x23')]);_0x38f70e[_0x859b('0x21')]=qs['offset'](_0x5e30b8[_0x859b('0x41')]['offset']);}return _0x20a518[_0x859b('0x6c')](_0x38f70e);}})[_0x859b('0x2a')](function(_0x3d0808){if(_0x3d0808){return _0x3d0808?{'count':_0x20a85e,'rows':_0x3d0808}:null;}})[_0x859b('0x2a')](respondWithResult(_0x4e16c4,null))['catch'](handleError(_0x4e16c4,null));};exports['addTeams']=function(_0x4ff788,_0x246bc3,_0x50e5f3){var _0x5781ac=_0x4ff788[_0x859b('0x54')]['teams'];var _0x101090=_['map'](_0x5781ac,'id');return db[_0x859b('0x6d')][_0x859b('0x50')]({'where':{'id':_0x101090},'attributes':['id'],'include':[{'model':db[_0x859b('0x6e')],'as':_0x859b('0x6f'),'attributes':['id',_0x859b('0x3a'),'online',_0x859b('0x70'),_0x859b('0x71')],'raw':!![]}]})[_0x859b('0x2a')](function(_0x3e0235){if(_0x3e0235){var _0x5d4316=_['flatMap'](_0x3e0235,function(_0x28d366){var _0x4fbd79=_0x28d366['get']({'plain':!![]});_0x4fbd79[_0x859b('0x6f')]['forEach'](function(_0x4274c2){_0x4274c2['penalty']=_['find'](_0x5781ac,{'id':_0x4fbd79['id']})['penalty'];});return _0x4fbd79[_0x859b('0x6f')];});return db[_0x859b('0x3d')][_0x859b('0x36')]({'where':{'id':_0x4ff788[_0x859b('0x52')]['id']}})[_0x859b('0x2a')](function(_0x11b570){return db['sequelize'][_0x859b('0x72')](function(_0x510cbf){return _0x11b570[_0x859b('0x73')](_0x101090,{'transaction':_0x510cbf})[_0x859b('0x2a')](function(){return BPromise[_0x859b('0x74')](_0x5781ac,function(_0x143daa){return db['TeamVoiceQueue']['upsert']({'TeamId':_0x143daa['id'],'VoiceQueueId':_0x4ff788[_0x859b('0x52')]['id'],'penalty':_0x143daa[_0x859b('0x75')]},{'transaction':_0x510cbf});});})['then'](function(){return BPromise['each'](_0x5d4316,function(_0x2a33f6){return db[_0x859b('0x76')][_0x859b('0x77')]({'where':{'UserId':_0x2a33f6['id'],'VoiceQueueId':_0x4ff788['params']['id']},'defaults':{'penalty':_0x2a33f6[_0x859b('0x75')]},'transaction':_0x510cbf});});})['then'](function(){return BPromise[_0x859b('0x74')](_[_0x859b('0x30')](_0x5d4316,{'online':!![]}),function(_0x4c2296){return db['UserVoiceQueueRt']['upsert']({'membername':_0x4c2296['name'],'UserId':_0x4c2296['id'],'queue_name':_0x11b570[_0x859b('0x3a')],'VoiceQueueId':_0x11b570['id'],'interface':_[_0x859b('0x78')](_0x4c2296[_0x859b('0x71')])?util[_0x859b('0x79')](_0x859b('0x7a'),_0x4c2296[_0x859b('0x3a')]):_0x4c2296[_0x859b('0x71')],'paused':_0x4c2296['voicePause']||![],'penalty':_0x4c2296['penalty']},{'transaction':_0x510cbf});});})['then'](function(){_0x5d4316['forEach'](function(_0x5b3f21){socket[_0x859b('0x7b')]('userVoiceQueue:save',{'UserId':_0x5b3f21['id'],'VoiceQueueId':_0x11b570['id']});});});});});}})[_0x859b('0x2a')](respondWithStatusCode(_0x246bc3,null))[_0x859b('0x51')](handleError(_0x246bc3,null));};exports[_0x859b('0x7c')]=function(_0x31e832,_0x5b3712,_0x1dbd36){return db['Team'][_0x859b('0x50')]({'where':{'id':_0x31e832[_0x859b('0x41')][_0x859b('0x7d')]},'attributes':['id'],'include':[{'model':db[_0x859b('0x6e')],'as':_0x859b('0x6f'),'attributes':['id'],'raw':!![]}]})[_0x859b('0x2a')](handleEntityNotFound(_0x5b3712,null))[_0x859b('0x2a')](function(_0x16f27e){var _0xd39370=_[_0x859b('0x32')](_0x16f27e,'id');var _0x284181=[];var _0x2f9ae1=[];var _0x3e0d7d=squel[_0x859b('0x7e')]();_0x3e0d7d['field']('tq.TeamId')[_0x859b('0x7f')]('team_has_voice_queues','tq')[_0x859b('0x80')](_0x859b('0x81'),'ut',_0x859b('0x82'))[_0x859b('0x4b')](_0x859b('0x83'),_0x31e832[_0x859b('0x52')]['id']);for(var _0xa0731b=0x0;_0xa0731b<_0x16f27e[_0x859b('0x47')];_0xa0731b+=0x1){let _0x33de52=_0x16f27e[_0xa0731b];for(var _0x44087e=0x0;_0x44087e<_0x33de52['Agents'][_0x859b('0x47')];_0x44087e+=0x1){let _0x1ace21=_0x33de52[_0x859b('0x6f')][_0x44087e];var _0x4b53fc=_0x3e0d7d[_0x859b('0x84')]();_0x4b53fc['where'](_0x859b('0x85'),_0x1ace21['id']);_0x2f9ae1[_0x859b('0x86')](db[_0x859b('0x87')][_0x859b('0x41')](_0x4b53fc[_0x859b('0x88')](),{'type':db[_0x859b('0x87')][_0x859b('0x89')][_0x859b('0x8a')]})[_0x859b('0x2a')](function(_0x34eb56){if(_0x34eb56[_0x859b('0x47')]===0x1){return _0x1ace21['id'];}else{var _0x268c06=_[_0x859b('0x8b')](_[_0x859b('0x32')](_0x34eb56,_0x859b('0x8c')),function(_0x35a561){return _['includes'](_0xd39370,_0x35a561);});if(_0x268c06){return _0x1ace21['id'];}}}));}}return BPromise[_0x859b('0x8d')](_0x2f9ae1)[_0x859b('0x2a')](function(_0x157c4b){_0x284181=_(_0x284181)[_0x859b('0x8e')](_0x157c4b)['compact']()[_0x859b('0x33')]();return db[_0x859b('0x3d')][_0x859b('0x36')]({'where':{'id':_0x31e832[_0x859b('0x52')]['id']}})[_0x859b('0x2a')](function(_0x2b8776){return db[_0x859b('0x87')][_0x859b('0x72')](function(_0x1d0fba){return _0x2b8776[_0x859b('0x7c')](_0x31e832[_0x859b('0x41')][_0x859b('0x7d')],{'transaction':_0x1d0fba})[_0x859b('0x2a')](function(){if(!_[_0x859b('0x8f')](_0x284181)){return _0x2b8776[_0x859b('0x90')](_0x284181,{'transaction':_0x1d0fba})[_0x859b('0x2a')](function(){return db[_0x859b('0x91')][_0x859b('0x2b')]({'where':{'VoiceQueueId':_0x31e832[_0x859b('0x52')]['id'],'UserId':_0x284181},'transaction':_0x1d0fba});});}})[_0x859b('0x2a')](function(){_0x284181[_0x859b('0x92')](function(_0x114e1f){socket[_0x859b('0x7b')](_0x859b('0x93'),{'UserId':_0x114e1f,'VoiceQueueId':_0x2b8776['id']});});});});});});})[_0x859b('0x2a')](respondWithStatusCode(_0x5b3712,null))[_0x859b('0x51')](handleError(_0x5b3712,null));};exports[_0x859b('0x94')]=function(_0x2186ff,_0x5edfc2,_0x5875dd){var _0x2dfc2,_0x722f4d;return db[_0x859b('0x3d')][_0x859b('0x36')]({'where':{'id':_0x2186ff['params']['id']}})[_0x859b('0x2a')](handleEntityNotFound(_0x5edfc2,null))['then'](function(_0x5d7055){if(_0x5d7055){_0x722f4d=_0x5d7055;return _0x5d7055[_0x859b('0x94')](_0x2186ff[_0x859b('0x54')][_0x859b('0x7d')],_[_0x859b('0x5b')](_0x2186ff[_0x859b('0x54')],[_0x859b('0x7d'),'id'])||{})['spread'](function(_0x460bbc){for(var _0x21f7d7=0x0;_0x21f7d7<_0x2186ff[_0x859b('0x54')][_0x859b('0x7d')][_0x859b('0x47')];_0x21f7d7+=0x1){socket[_0x859b('0x7b')](_0x859b('0x95'),{'UserId':Number(_0x2186ff[_0x859b('0x54')]['ids'][_0x21f7d7]),'VoiceQueueId':Number(_0x2186ff[_0x859b('0x52')]['id'])});}return _0x460bbc;});}})['then'](function(_0x3cfa8c){_0x2dfc2=_0x3cfa8c||[];if(_0x722f4d){return db[_0x859b('0x6e')][_0x859b('0x50')]({'where':{'id':_0x2186ff[_0x859b('0x54')][_0x859b('0x7d')]},'attributes':['id',_0x859b('0x3a'),_0x859b('0x96'),_0x859b('0x70'),'interface'],'raw':!![]});}})[_0x859b('0x2a')](function(_0x129edb){if(!_[_0x859b('0x8f')](_0x129edb)){var _0x3ec378=[];for(var _0x3848d6=0x0;_0x3848d6<_0x129edb[_0x859b('0x47')];_0x3848d6++){if(_0x129edb[_0x3848d6][_0x859b('0x96')]){_0x3ec378[_0x859b('0x86')](db[_0x859b('0x91')][_0x859b('0x97')]({'membername':_0x129edb[_0x3848d6][_0x859b('0x3a')],'UserId':_0x129edb[_0x3848d6]['id'],'queue_name':_0x722f4d[_0x859b('0x3a')],'VoiceQueueId':_0x722f4d['id'],'interface':_[_0x859b('0x78')](_0x129edb[_0x3848d6][_0x859b('0x71')])?util['format'](_0x859b('0x7a'),_0x129edb[_0x3848d6][_0x859b('0x3a')]):_0x129edb[_0x3848d6][_0x859b('0x71')],'paused':_0x129edb[_0x3848d6][_0x859b('0x70')]||![],'penalty':_0x2186ff['body']['penalty']||0x0}));}}return BPromise['all'](_0x3ec378);}})[_0x859b('0x2a')](function(){return _0x2dfc2;})[_0x859b('0x2a')](respondWithResult(_0x5edfc2,null))['catch'](handleError(_0x5edfc2,null));};exports['removeAgents']=function(_0x6816e2,_0x69410c,_0x118c4b){return db['VoiceQueue'][_0x859b('0x36')]({'where':{'id':_0x6816e2[_0x859b('0x52')]['id']}})[_0x859b('0x2a')](handleEntityNotFound(_0x69410c,null))[_0x859b('0x2a')](function(_0xfcf268){if(_0xfcf268){return _0xfcf268[_0x859b('0x90')](_0x6816e2['query'][_0x859b('0x7d')])['then'](function(){if(_[_0x859b('0x98')](_0x6816e2[_0x859b('0x41')][_0x859b('0x7d')])){for(var _0xc3fcb4=0x0;_0xc3fcb4<_0x6816e2[_0x859b('0x41')][_0x859b('0x7d')][_0x859b('0x47')];_0xc3fcb4+=0x1){socket[_0x859b('0x7b')](_0x859b('0x93'),{'UserId':Number(_0x6816e2[_0x859b('0x41')]['ids'][_0xc3fcb4]),'VoiceQueueId':Number(_0x6816e2['params']['id'])});}}else{socket[_0x859b('0x7b')](_0x859b('0x93'),{'UserId':Number(_0x6816e2['query'][_0x859b('0x7d')]),'VoiceQueueId':Number(_0x6816e2['params']['id'])});}});}})['then'](function(_0x529813){return db[_0x859b('0x91')][_0x859b('0x2b')]({'where':{'VoiceQueueId':_0x6816e2['params']['id'],'UserId':_0x6816e2[_0x859b('0x41')][_0x859b('0x7d')]}})[_0x859b('0x2a')](function(){return _0x529813;});})[_0x859b('0x2a')](respondWithStatusCode(_0x69410c,null))[_0x859b('0x51')](handleError(_0x69410c,null));};exports[_0x859b('0x99')]=function(_0x2ab26c,_0x4a5745,_0x5dbcad){var _0x1f94f2={};var _0x528d12={};var _0x481ef2;var _0x27ce29;return db[_0x859b('0x3d')][_0x859b('0x62')]({'where':{'id':_0x2ab26c[_0x859b('0x52')]['id']}})[_0x859b('0x2a')](handleEntityNotFound(_0x4a5745,null))[_0x859b('0x2a')](function(_0x336956){if(_0x336956){_0x481ef2=_0x336956;_0x528d12[_0x859b('0x40')]=_[_0x859b('0x42')](db[_0x859b('0x6e')]['rawAttributes']);_0x528d12[_0x859b('0x41')]=_[_0x859b('0x42')](_0x2ab26c[_0x859b('0x41')]);_0x528d12[_0x859b('0x43')]=_[_0x859b('0x44')](_0x528d12[_0x859b('0x40')],_0x528d12[_0x859b('0x41')]);_0x1f94f2[_0x859b('0x45')]=_[_0x859b('0x44')](_0x528d12[_0x859b('0x40')],qs[_0x859b('0x46')](_0x2ab26c[_0x859b('0x41')]['fields']));_0x1f94f2[_0x859b('0x45')]=_0x1f94f2[_0x859b('0x45')][_0x859b('0x47')]?_0x1f94f2[_0x859b('0x45')]:_0x528d12[_0x859b('0x40')];_0x1f94f2['order']=qs[_0x859b('0x4a')](_0x2ab26c['query'][_0x859b('0x4a')]);_0x1f94f2[_0x859b('0x4b')]=qs['filters'](_[_0x859b('0x4c')](_0x2ab26c[_0x859b('0x41')],_0x528d12[_0x859b('0x43')]));if(_0x2ab26c['query']['filter']){_0x1f94f2['where']=_[_0x859b('0x4d')](_0x1f94f2[_0x859b('0x4b')],{'$or':_[_0x859b('0x32')](_0x1f94f2[_0x859b('0x45')],function(_0x313c2e){var _0x34b8b2={};_0x34b8b2[_0x313c2e]={'$like':'%'+_0x2ab26c[_0x859b('0x41')][_0x859b('0x30')]+'%'};return _0x34b8b2;})});}_0x1f94f2=_['merge']({},_0x1f94f2,_0x2ab26c[_0x859b('0x4e')]);return _0x481ef2[_0x859b('0x99')](_0x1f94f2);}})[_0x859b('0x2a')](function(_0x49287a){if(_0x49287a){_0x27ce29=_0x49287a[_0x859b('0x47')];if(!_0x2ab26c[_0x859b('0x41')][_0x859b('0x63')](_0x859b('0x48'))){_0x1f94f2[_0x859b('0x23')]=qs[_0x859b('0x23')](_0x2ab26c[_0x859b('0x41')][_0x859b('0x23')]);_0x1f94f2[_0x859b('0x21')]=qs['offset'](_0x2ab26c[_0x859b('0x41')][_0x859b('0x21')]);}return _0x481ef2['getAgents'](_0x1f94f2);}})['then'](function(_0x449f72){if(_0x449f72){return _0x449f72?{'count':_0x27ce29,'rows':_0x449f72}:null;}})[_0x859b('0x2a')](respondWithResult(_0x4a5745,null))['catch'](handleError(_0x4a5745,null));};exports['getMembers']=function(_0x54b1ab,_0x35bd25,_0x34127e){var _0x51c7dc={};var _0x5d19c2={};var _0x49209a;var _0x42387a;return db['VoiceQueue'][_0x859b('0x62')]({'where':{'id':_0x54b1ab[_0x859b('0x52')]['id']}})[_0x859b('0x2a')](handleEntityNotFound(_0x35bd25,null))['then'](function(_0x495b45){if(_0x495b45){_0x49209a=_0x495b45;_0x5d19c2[_0x859b('0x40')]=_[_0x859b('0x42')](db[_0x859b('0x91')][_0x859b('0x3e')]);_0x5d19c2[_0x859b('0x41')]=_['keys'](_0x54b1ab['query']);_0x5d19c2['filters']=_[_0x859b('0x44')](_0x5d19c2[_0x859b('0x40')],_0x5d19c2['query']);_0x51c7dc[_0x859b('0x45')]=_[_0x859b('0x44')](_0x5d19c2[_0x859b('0x40')],qs[_0x859b('0x46')](_0x54b1ab[_0x859b('0x41')]['fields']));_0x51c7dc[_0x859b('0x45')]=_0x51c7dc[_0x859b('0x45')][_0x859b('0x47')]?_0x51c7dc[_0x859b('0x45')]:_0x5d19c2[_0x859b('0x40')];_0x51c7dc[_0x859b('0x49')]=qs[_0x859b('0x4a')](_0x54b1ab[_0x859b('0x41')][_0x859b('0x4a')]);_0x51c7dc[_0x859b('0x4b')]=qs[_0x859b('0x43')](_['pick'](_0x54b1ab['query'],_0x5d19c2[_0x859b('0x43')]));if(_0x54b1ab[_0x859b('0x41')][_0x859b('0x30')]){_0x51c7dc['where']=_[_0x859b('0x4d')](_0x51c7dc[_0x859b('0x4b')],{'$or':_[_0x859b('0x32')](_0x51c7dc[_0x859b('0x45')],function(_0x46deb7){var _0x3546c7={};_0x3546c7[_0x46deb7]={'$like':'%'+_0x54b1ab[_0x859b('0x41')][_0x859b('0x30')]+'%'};return _0x3546c7;})});}_0x51c7dc=_[_0x859b('0x4d')]({},_0x51c7dc,_0x54b1ab['options']);return _0x49209a[_0x859b('0x9a')](_0x51c7dc);}})[_0x859b('0x2a')](function(_0x4a915f){if(_0x4a915f){_0x42387a=_0x4a915f[_0x859b('0x47')];if(!_0x54b1ab[_0x859b('0x41')]['hasOwnProperty'](_0x859b('0x48'))){_0x51c7dc[_0x859b('0x23')]=qs[_0x859b('0x23')](_0x54b1ab[_0x859b('0x41')][_0x859b('0x23')]);_0x51c7dc[_0x859b('0x21')]=qs['offset'](_0x54b1ab[_0x859b('0x41')][_0x859b('0x21')]);}return _0x49209a[_0x859b('0x9a')](_0x51c7dc);}})['then'](function(_0x7d26b1){return _0x7d26b1?{'count':_0x42387a,'rows':_0x7d26b1}:null;})[_0x859b('0x2a')](respondWithResult(_0x35bd25,null))[_0x859b('0x51')](handleError(_0x35bd25,null));};exports[_0x859b('0x9b')]=function(_0x5ecbb6,_0x2b5083,_0x403155){var _0x2dd8a5={};var _0x1795ed={};var _0x2c5fb4;var _0x297600;return db['VoiceQueue'][_0x859b('0x62')]({'where':{'id':_0x5ecbb6[_0x859b('0x52')]['id']}})[_0x859b('0x2a')](handleEntityNotFound(_0x2b5083,null))[_0x859b('0x2a')](function(_0x444a27){if(_0x444a27){_0x2c5fb4=_0x444a27;_0x1795ed['model']=_[_0x859b('0x42')](db[_0x859b('0x9c')]['rawAttributes']);_0x1795ed[_0x859b('0x41')]=_[_0x859b('0x42')](_0x5ecbb6['query']);_0x1795ed[_0x859b('0x43')]=_['intersection'](_0x1795ed[_0x859b('0x40')],_0x1795ed[_0x859b('0x41')]);_0x2dd8a5[_0x859b('0x45')]=_['intersection'](_0x1795ed['model'],qs['fields'](_0x5ecbb6[_0x859b('0x41')][_0x859b('0x46')]));_0x2dd8a5['attributes']=_0x2dd8a5[_0x859b('0x45')]['length']?_0x2dd8a5['attributes']:_0x1795ed['model'];_0x2dd8a5[_0x859b('0x49')]=qs[_0x859b('0x4a')](_0x5ecbb6[_0x859b('0x41')][_0x859b('0x4a')]);_0x2dd8a5[_0x859b('0x4b')]=qs['filters'](_['pick'](_0x5ecbb6['query'],_0x1795ed['filters']));if(_0x5ecbb6[_0x859b('0x41')][_0x859b('0x30')]){_0x2dd8a5['where']=_[_0x859b('0x4d')](_0x2dd8a5['where'],{'$or':_[_0x859b('0x32')](_0x2dd8a5[_0x859b('0x45')],function(_0x2b894a){var _0x17d341={};_0x17d341[_0x2b894a]={'$like':'%'+_0x5ecbb6[_0x859b('0x41')][_0x859b('0x30')]+'%'};return _0x17d341;})});}_0x2dd8a5=_[_0x859b('0x4d')]({},_0x2dd8a5,_0x5ecbb6[_0x859b('0x4e')]);return _0x2c5fb4[_0x859b('0x9b')](_0x2dd8a5);}})[_0x859b('0x2a')](function(_0xff02d1){if(_0xff02d1){_0x297600=_0xff02d1[_0x859b('0x47')];if(!_0x5ecbb6[_0x859b('0x41')]['hasOwnProperty'](_0x859b('0x48'))){_0x2dd8a5[_0x859b('0x23')]=qs[_0x859b('0x23')](_0x5ecbb6[_0x859b('0x41')][_0x859b('0x23')]);_0x2dd8a5[_0x859b('0x21')]=qs[_0x859b('0x21')](_0x5ecbb6['query'][_0x859b('0x21')]);}return _0x2c5fb4[_0x859b('0x9b')](_0x2dd8a5);}})[_0x859b('0x2a')](function(_0x1ae059){if(_0x1ae059){return _0x1ae059?{'count':_0x297600,'rows':_0x1ae059}:null;}})['then'](respondWithResult(_0x2b5083,null))[_0x859b('0x51')](handleError(_0x2b5083,null));};exports[_0x859b('0x9d')]=function(_0x263148,_0x236777,_0x4ed13b){var _0x2ba585,_0x344fff;return db['VoiceQueue'][_0x859b('0x36')]({'where':{'id':_0x263148['params']['id']}})[_0x859b('0x2a')](handleEntityNotFound(_0x236777,null))[_0x859b('0x2a')](function(_0x2dc90d){if(_0x2dc90d){_0x344fff=_0x2dc90d;return _0x2dc90d[_0x859b('0x9d')](_0x263148[_0x859b('0x54')][_0x859b('0x7d')],_[_0x859b('0x5b')](_0x263148[_0x859b('0x54')],[_0x859b('0x7d'),'id'])||{});}return null;})['spread'](function(_0x80b23a){var _0x58704a;_0x2ba585=_0x80b23a||[];var _0x56fb72=[];if(_0x80b23a){for(var _0x408ef7=0x0;_0x408ef7<_0x80b23a[_0x859b('0x47')];_0x408ef7+=0x1){var _0x1d66bd=_0x80b23a[_0x408ef7][_0x859b('0x2c')]({'plain':!![]});_0x344fff[_0x859b('0x9e')]=_0x263148[_0x859b('0x54')][_0x859b('0x9e')]?_0x263148[_0x859b('0x54')][_0x859b('0x9e')]:_0x344fff[_0x859b('0x9e')];switch(_0x344fff[_0x859b('0x9e')]){case _0x859b('0x9f'):_0x58704a=squel['insert']()['into'](_0x859b('0xa0'))[_0x859b('0xa1')]([_0x859b('0xa2'),'scheduledAt',_0x859b('0xa3'),_0x859b('0xa4'),_0x859b('0x67'),_0x859b('0x5c'),_0x859b('0x5d')],squel[_0x859b('0x7e')]()[_0x859b('0xa5')](_0x859b('0xa2'),_0x859b('0xa2'))[_0x859b('0xa5')](_0x859b('0xa6'),_0x859b('0xa7'))['field']('id','ContactId')[_0x859b('0xa5')](_0x1d66bd[_0x859b('0xa8')][_0x859b('0x88')](),_0x859b('0xa4'))[_0x859b('0xa5')](_0x263148[_0x859b('0x52')]['id'][_0x859b('0x88')](),_0x859b('0x67'))[_0x859b('0xa5')](_0x859b('0xa6'),_0x859b('0x5c'))[_0x859b('0xa5')]('NOW()',_0x859b('0x5d'))[_0x859b('0x7f')](_0x859b('0xa9'))[_0x859b('0x4b')](_0x859b('0xaa'))[_0x859b('0x4b')](_0x859b('0xab'),_0x1d66bd[_0x859b('0xa8')][_0x859b('0x88')]())['where'](_0x859b('0xac'))[_0x859b('0x4b')](_0x859b('0xad'),squel[_0x859b('0x7e')]()['field'](_0x859b('0xae'))[_0x859b('0x7f')]('cm_hopper_final')['where'](_0x859b('0x83'),_0x263148['params']['id']['toString']()))['where'](_0x859b('0xad'),squel['select']()[_0x859b('0xa5')](_0x859b('0xaf'))[_0x859b('0x7f')](_0x859b('0xa0'))[_0x859b('0x4b')]('VoiceQueueId\x20=\x20?',_0x263148['params']['id'][_0x859b('0x88')]())))[_0x859b('0x88')]();break;case _0x859b('0xb0'):_0x58704a=squel[_0x859b('0xb1')]()['into'](_0x859b('0xa0'))[_0x859b('0xa1')]([_0x859b('0xa2'),_0x859b('0xa7'),_0x859b('0xa3'),_0x859b('0xa4'),'VoiceQueueId','createdAt',_0x859b('0x5d')],squel['select']()[_0x859b('0xa5')](_0x859b('0xa2'),'phone')[_0x859b('0xa5')](_0x859b('0xa6'),'scheduledAt')[_0x859b('0xa5')]('id','ContactId')['field'](_0x1d66bd[_0x859b('0xa8')][_0x859b('0x88')](),_0x859b('0xa4'))[_0x859b('0xa5')](_0x263148['params']['id']['toString'](),_0x859b('0x67'))[_0x859b('0xa5')](_0x859b('0xa6'),'createdAt')['field']('NOW()',_0x859b('0x5d'))[_0x859b('0x7f')](_0x859b('0xa9'))[_0x859b('0x4b')](_0x859b('0xaa'))[_0x859b('0x4b')](_0x859b('0xab'),_0x1d66bd[_0x859b('0xa8')][_0x859b('0x88')]())[_0x859b('0x4b')](_0x859b('0xac'))[_0x859b('0x4b')](_0x859b('0xad'),squel[_0x859b('0x7e')]()[_0x859b('0xa5')]('COALESCE(phone,\x27\x27)')[_0x859b('0x7f')](_0x859b('0xa0'))[_0x859b('0x4b')](_0x859b('0x83'),_0x263148[_0x859b('0x52')]['id']['toString']())))[_0x859b('0x88')]();break;default:_0x58704a=squel['insert']()[_0x859b('0xb2')](_0x859b('0xa0'))['fromQuery']([_0x859b('0xa2'),_0x859b('0xa7'),_0x859b('0xa3'),_0x859b('0xa4'),_0x859b('0x67'),_0x859b('0x5c'),_0x859b('0x5d')],squel['select']()[_0x859b('0xa5')](_0x859b('0xa2'),_0x859b('0xa2'))['field'](_0x859b('0xa6'),_0x859b('0xa7'))['field']('id',_0x859b('0xa3'))[_0x859b('0xa5')](_0x1d66bd[_0x859b('0xa8')]['toString'](),_0x859b('0xa4'))['field'](_0x263148[_0x859b('0x52')]['id'][_0x859b('0x88')](),_0x859b('0x67'))[_0x859b('0xa5')](_0x859b('0xa6'),_0x859b('0x5c'))['field']('NOW()',_0x859b('0x5d'))[_0x859b('0x7f')](_0x859b('0xa9'))[_0x859b('0x4b')](_0x859b('0xaa'))[_0x859b('0x4b')]('ListId\x20=\x20?',_0x1d66bd[_0x859b('0xa8')][_0x859b('0x88')]())[_0x859b('0x4b')](_0x859b('0xac')))['toString']();}_0x56fb72[_0x859b('0x86')](db[_0x859b('0x87')][_0x859b('0x41')](_0x58704a));}return BPromise[_0x859b('0x8d')](_0x56fb72);}})[_0x859b('0x2a')](function(){return _0x2ba585;})[_0x859b('0x2a')](respondWithResult(_0x236777,null))[_0x859b('0x51')](handleError(_0x236777,null));};exports[_0x859b('0xb3')]=function(_0x4999f6,_0x9f960a,_0xeed742){return db[_0x859b('0x3d')][_0x859b('0x36')]({'where':{'id':_0x4999f6[_0x859b('0x52')]['id']}})[_0x859b('0x2a')](handleEntityNotFound(_0x9f960a,null))['then'](function(_0x11fb20){if(_0x11fb20){return _0x11fb20[_0x859b('0xb3')](_0x4999f6[_0x859b('0x41')][_0x859b('0x7d')]);}})['then'](function(_0x3410e7){if(_0x3410e7){return db['CmHopper'][_0x859b('0x2b')]({'where':{'ListId':_0x4999f6['query'][_0x859b('0x7d')],'VoiceQueueId':_0x4999f6[_0x859b('0x52')]['id']}})['then'](function(){return _0x3410e7;});}})['then'](respondWithStatusCode(_0x9f960a,null))[_0x859b('0x51')](handleError(_0x9f960a,null));};exports[_0x859b('0xb4')]=function(_0x141759,_0x18548a,_0x47fbd0){var _0x545b3d={};var _0x315a3c={};var _0x72c36b;var _0x570e0f;return db[_0x859b('0x3d')]['findOne']({'where':{'id':_0x141759['params']['id']}})[_0x859b('0x2a')](handleEntityNotFound(_0x18548a,null))[_0x859b('0x2a')](function(_0x5b3fd7){if(_0x5b3fd7){_0x72c36b=_0x5b3fd7;_0x315a3c[_0x859b('0x40')]=_[_0x859b('0x42')](db[_0x859b('0x9c')][_0x859b('0x3e')]);_0x315a3c[_0x859b('0x41')]=_[_0x859b('0x42')](_0x141759[_0x859b('0x41')]);_0x315a3c[_0x859b('0x43')]=_[_0x859b('0x44')](_0x315a3c[_0x859b('0x40')],_0x315a3c[_0x859b('0x41')]);_0x545b3d['attributes']=_['intersection'](_0x315a3c[_0x859b('0x40')],qs[_0x859b('0x46')](_0x141759[_0x859b('0x41')][_0x859b('0x46')]));_0x545b3d[_0x859b('0x45')]=_0x545b3d[_0x859b('0x45')][_0x859b('0x47')]?_0x545b3d['attributes']:_0x315a3c[_0x859b('0x40')];_0x545b3d[_0x859b('0x49')]=qs[_0x859b('0x4a')](_0x141759[_0x859b('0x41')][_0x859b('0x4a')]);_0x545b3d[_0x859b('0x4b')]=qs[_0x859b('0x43')](_[_0x859b('0x4c')](_0x141759[_0x859b('0x41')],_0x315a3c[_0x859b('0x43')]));if(_0x141759[_0x859b('0x41')][_0x859b('0x30')]){_0x545b3d[_0x859b('0x4b')]=_[_0x859b('0x4d')](_0x545b3d[_0x859b('0x4b')],{'$or':_['map'](_0x545b3d[_0x859b('0x45')],function(_0x37cd1f){var _0xc9cee9={};_0xc9cee9[_0x37cd1f]={'$like':'%'+_0x141759[_0x859b('0x41')][_0x859b('0x30')]+'%'};return _0xc9cee9;})});}_0x545b3d=_['merge']({},_0x545b3d,_0x141759[_0x859b('0x4e')]);return _0x72c36b['getBlackLists'](_0x545b3d);}})['then'](function(_0x1e3596){if(_0x1e3596){_0x570e0f=_0x1e3596['length'];if(!_0x141759[_0x859b('0x41')][_0x859b('0x63')](_0x859b('0x48'))){_0x545b3d[_0x859b('0x23')]=qs['limit'](_0x141759[_0x859b('0x41')][_0x859b('0x23')]);_0x545b3d['offset']=qs[_0x859b('0x21')](_0x141759['query'][_0x859b('0x21')]);}return _0x72c36b[_0x859b('0xb4')](_0x545b3d);}})[_0x859b('0x2a')](function(_0x24ca5e){if(_0x24ca5e){return _0x24ca5e?{'count':_0x570e0f,'rows':_0x24ca5e}:null;}})['then'](respondWithResult(_0x18548a,null))[_0x859b('0x51')](handleError(_0x18548a,null));};exports[_0x859b('0xb5')]=function(_0x53f09c,_0x3e6c33,_0x87f034){var _0x303a35,_0x2e67d7;return db['VoiceQueue'][_0x859b('0x36')]({'where':{'id':_0x53f09c[_0x859b('0x52')]['id']}})['then'](handleEntityNotFound(_0x3e6c33,null))[_0x859b('0x2a')](function(_0x3d6e5d){if(_0x3d6e5d){_0x2e67d7=_0x3d6e5d;return _0x3d6e5d['addBlackLists'](_0x53f09c[_0x859b('0x54')][_0x859b('0x7d')],_[_0x859b('0x5b')](_0x53f09c[_0x859b('0x54')],[_0x859b('0x7d'),'id'])||{});}return null;})['spread'](function(_0x28ec50){var _0x494fd2;_0x303a35=_0x28ec50||[];var _0xf55065=[];if(_0x28ec50){for(var _0x2d9f7d=0x0;_0x2d9f7d<_0x28ec50['length'];_0x2d9f7d+=0x1){var _0x247156=_0x28ec50[_0x2d9f7d][_0x859b('0x2c')]({'plain':!![]});_0x494fd2=squel[_0x859b('0xb1')]()['into'](_0x859b('0xb6'))[_0x859b('0xa1')]([_0x859b('0xa2'),_0x859b('0xa3'),'ListId',_0x859b('0x67'),_0x859b('0x5c'),_0x859b('0x5d')],squel['select']()[_0x859b('0xa5')](_0x859b('0xa2'),_0x859b('0xa2'))[_0x859b('0xa5')]('id',_0x859b('0xa3'))[_0x859b('0xa5')](_0x247156[_0x859b('0xa8')][_0x859b('0x88')](),_0x859b('0xa4'))['field'](_0x53f09c[_0x859b('0x52')]['id']['toString'](),_0x859b('0x67'))[_0x859b('0xa5')](_0x859b('0xa6'),_0x859b('0x5c'))[_0x859b('0xa5')](_0x859b('0xa6'),'updatedAt')[_0x859b('0x7f')]('cm_contacts')[_0x859b('0x4b')]('deletedAt\x20IS\x20NULL')['where']('ListId\x20=\x20?',_0x247156[_0x859b('0xa8')][_0x859b('0x88')]())['where'](_0x859b('0xac')))[_0x859b('0x88')]();_0xf55065[_0x859b('0x86')](db[_0x859b('0x87')]['query'](_0x494fd2));}return BPromise[_0x859b('0x8d')](_0xf55065);}})['then'](function(){return _0x303a35;})[_0x859b('0x2a')](respondWithResult(_0x3e6c33,null))['catch'](handleError(_0x3e6c33,null));};exports[_0x859b('0xb7')]=function(_0x422c40,_0x57b968,_0x7887d9){return db[_0x859b('0x3d')][_0x859b('0x36')]({'where':{'id':_0x422c40[_0x859b('0x52')]['id']}})[_0x859b('0x2a')](handleEntityNotFound(_0x57b968,null))[_0x859b('0x2a')](function(_0x32ee05){if(_0x32ee05){return _0x32ee05[_0x859b('0xb7')](_0x422c40[_0x859b('0x41')][_0x859b('0x7d')]);}})[_0x859b('0x2a')](function(_0x1b108b){if(_0x1b108b){return db[_0x859b('0x6b')][_0x859b('0x2b')]({'where':{'ListId':_0x422c40[_0x859b('0x41')]['ids'],'VoiceQueueId':_0x422c40[_0x859b('0x52')]['id']}})[_0x859b('0x2a')](function(){return _0x1b108b;});}})['then'](respondWithStatusCode(_0x57b968,null))[_0x859b('0x51')](handleError(_0x57b968,null));}; \ No newline at end of file +var _0x897b=['count','rows','catch','show','params','includeAll','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','updatedAt','inbound','autoAssociation','error','findOne','CmHopper','VoiceQueueId','findAll','CmHopperHistory','getHopperFinals','CmHopperFinal','CmHopperBlack','Team','getTeams','addTeams','User','Agents','online','voicePause','interface','flatMap','forEach','penalty','sequelize','each','TeamVoiceQueue','upsert','UserVoiceQueue','findOrCreate','UserVoiceQueueRt','format','SIP/%s','userVoiceQueue:save','removeTeams','ids','select','field','tq.TeamId','from','join','ut.TeamId\x20=\x20tq.TeamId','push','toString','QueryTypes','SELECT','every','TeamId','all','transaction','isEmpty','removeAgents','emit','addAgents','isArray','userVoiceQueue:remove','getAgents','getMembers','getLists','CmList','addLists','dialCheckDuplicateType','into','cm_hopper','fromQuery','phone','scheduledAt','ContactId','ListId','NOW()','CmListId','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','COALESCE(phone,\x27\x27)','VoiceQueueId\x20=\x20?','onlyIfOpen','insert','cm_contacts','removeLists','getBlackLists','addBlackLists','spread','cm_hopper_black','eml-format','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','redis','defaults','localhost','./voiceQueue.socket','register','sendStatus','status','end','json','undefined','limit','offset','set','apply','reject','save','update','then','destroy','get','VoiceQueues','QueueCampaigns','outbound','filter','ignore','map','value','includes','type','name','UserProfileResource','send','index','VoiceQueue','rawAttributes','fieldName','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','options'];(function(_0x5a88a3,_0x390636){var _0x7faf3d=function(_0x1ae8d4){while(--_0x1ae8d4){_0x5a88a3['push'](_0x5a88a3['shift']());}};_0x7faf3d(++_0x390636);}(_0x897b,0x11b));var _0xb897=function(_0xff1027,_0x9fac3c){_0xff1027=_0xff1027-0x0;var _0x2cdf54=_0x897b[_0xff1027];return _0x2cdf54;};'use strict';var emlformat=require(_0xb897('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xb897('0x1'));var jsonpatch=require(_0xb897('0x2'));var rp=require(_0xb897('0x3'));var moment=require(_0xb897('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xb897('0x5'));var path=require(_0xb897('0x6'));var sox=require(_0xb897('0x7'));var csv=require(_0xb897('0x8'));var ejs=require(_0xb897('0x9'));var fs=require('fs');var fs_extra=require(_0xb897('0xa'));var _=require(_0xb897('0xb'));var squel=require(_0xb897('0xc'));var crypto=require('crypto');var jsforce=require(_0xb897('0xd'));var deskjs=require(_0xb897('0xe'));var toCsv=require(_0xb897('0x8'));var querystring=require(_0xb897('0xf'));var Papa=require('papaparse');var Redis=require(_0xb897('0x10'));var authService=require(_0xb897('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xb897('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb897('0x13'))(_0xb897('0x14'));var utils=require('../../config/utils');var config=require(_0xb897('0x15'));var licenseUtil=require(_0xb897('0x16'));var db=require('../../mysqldb')['db'];config[_0xb897('0x17')]=_[_0xb897('0x18')](config['redis'],{'host':_0xb897('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xb897('0x1a'))[_0xb897('0x1b')](socket);function respondWithStatusCode(_0x473dae,_0x156601){_0x156601=_0x156601||0xcc;return function(_0x4da8f2){if(_0x4da8f2){return _0x473dae[_0xb897('0x1c')](_0x156601);}return _0x473dae[_0xb897('0x1d')](_0x156601)[_0xb897('0x1e')]();};}function respondWithResult(_0x7f50e2,_0x5b3dda){_0x5b3dda=_0x5b3dda||0xc8;return function(_0xde0118){if(_0xde0118){return _0x7f50e2[_0xb897('0x1d')](_0x5b3dda)[_0xb897('0x1f')](_0xde0118);}};}function respondWithFilteredResult(_0x52214b,_0x195848){return function(_0x5340e9){if(_0x5340e9){var _0xe04df5=typeof _0x195848['offset']===_0xb897('0x20')&&typeof _0x195848[_0xb897('0x21')]===_0xb897('0x20');var _0x1a0a5f=_0x5340e9['count'];var _0x2207ac=_0xe04df5?0x0:_0x195848[_0xb897('0x22')];var _0x2f45b1=_0xe04df5?_0x5340e9['count']:_0x195848[_0xb897('0x22')]+_0x195848['limit'];var _0x5b51c8;if(_0x2f45b1>=_0x1a0a5f){_0x2f45b1=_0x1a0a5f;_0x5b51c8=0xc8;}else{_0x5b51c8=0xce;}_0x52214b[_0xb897('0x1d')](_0x5b51c8);return _0x52214b[_0xb897('0x23')]('Content-Range',_0x2207ac+'-'+_0x2f45b1+'/'+_0x1a0a5f)[_0xb897('0x1f')](_0x5340e9);}return null;};}function patchUpdates(_0x186ea1){return function(_0x107c7a){try{jsonpatch[_0xb897('0x24')](_0x107c7a,_0x186ea1,!![]);}catch(_0x1b5d5f){return BPromise[_0xb897('0x25')](_0x1b5d5f);}return _0x107c7a[_0xb897('0x26')]();};}function saveUpdates(_0x368783,_0xb6f52a){return function(_0x5a9a47){if(_0x5a9a47){return _0x5a9a47[_0xb897('0x27')](_0x368783)[_0xb897('0x28')](function(_0x89067c){return _0x89067c;});}return null;};}function removeEntity(_0x4f5866,_0x1096b4){return function(_0x3b81b8){if(_0x3b81b8){return _0x3b81b8[_0xb897('0x29')]()[_0xb897('0x28')](function(){var _0x462f48=_0x3b81b8[_0xb897('0x2a')]({'plain':!![]});var _0x29f96a=[{'name':_0xb897('0x2b'),'value':'inbound','ignore':![]},{'name':_0xb897('0x2c'),'value':_0xb897('0x2d'),'ignore':![]}];var _0x43dddc=_(_0x29f96a)[_0xb897('0x2e')](_0xb897('0x2f'))[_0xb897('0x30')](_0xb897('0x31'))[_0xb897('0x31')]();if(_[_0xb897('0x32')](_0x43dddc,_0x462f48[_0xb897('0x33')])){return;}var _0x1c3b7e=_['find'](_0x29f96a,[_0xb897('0x31'),_0x462f48[_0xb897('0x33')]])[_0xb897('0x34')];return db[_0xb897('0x35')][_0xb897('0x29')]({'where':{'type':_0x1c3b7e,'resourceId':_0x462f48['id']}})[_0xb897('0x28')](function(){return _0x3b81b8;});})[_0xb897('0x28')](function(){_0x4f5866[_0xb897('0x1d')](0xcc)[_0xb897('0x1e')]();});}};}function handleEntityNotFound(_0xb96ca1,_0x4386fd){return function(_0x22bf02){if(!_0x22bf02){_0xb96ca1[_0xb897('0x1c')](0x194);}return _0x22bf02;};}function handleError(_0x2f2b52,_0x2327f8){_0x2327f8=_0x2327f8||0x1f4;return function(_0x563f71){logger['error'](_0x563f71['stack']);if(_0x563f71['name']){delete _0x563f71[_0xb897('0x34')];}_0x2f2b52['status'](_0x2327f8)[_0xb897('0x36')](_0x563f71);};}exports[_0xb897('0x37')]=function(_0x32463c,_0x3339a7){var _0xf209a9={},_0x11c962={},_0x1222ff={'count':0x0,'rows':[]};var _0x9e2984=_[_0xb897('0x30')](db[_0xb897('0x38')][_0xb897('0x39')],function(_0x5beaad){return{'name':_0x5beaad[_0xb897('0x3a')],'type':_0x5beaad['type'][_0xb897('0x3b')]};});_0x11c962[_0xb897('0x3c')]=_[_0xb897('0x30')](_0x9e2984,_0xb897('0x34'));_0x11c962[_0xb897('0x3d')]=_[_0xb897('0x3e')](_0x32463c[_0xb897('0x3d')]);_0x11c962[_0xb897('0x3f')]=_[_0xb897('0x40')](_0x11c962[_0xb897('0x3c')],_0x11c962[_0xb897('0x3d')]);_0xf209a9['attributes']=_[_0xb897('0x40')](_0x11c962[_0xb897('0x3c')],qs[_0xb897('0x41')](_0x32463c['query'][_0xb897('0x41')]));_0xf209a9[_0xb897('0x42')]=_0xf209a9[_0xb897('0x42')][_0xb897('0x43')]?_0xf209a9[_0xb897('0x42')]:_0x11c962[_0xb897('0x3c')];if(!_0x32463c[_0xb897('0x3d')][_0xb897('0x44')](_0xb897('0x45'))){_0xf209a9[_0xb897('0x21')]=qs[_0xb897('0x21')](_0x32463c[_0xb897('0x3d')][_0xb897('0x21')]);_0xf209a9[_0xb897('0x22')]=qs[_0xb897('0x22')](_0x32463c[_0xb897('0x3d')][_0xb897('0x22')]);}_0xf209a9[_0xb897('0x46')]=qs[_0xb897('0x47')](_0x32463c['query'][_0xb897('0x47')]);_0xf209a9[_0xb897('0x48')]=qs['filters'](_[_0xb897('0x49')](_0x32463c[_0xb897('0x3d')],_0x11c962[_0xb897('0x3f')]),_0x9e2984);if(_0x32463c[_0xb897('0x3d')][_0xb897('0x2e')]){_0xf209a9['where']=_[_0xb897('0x4a')](_0xf209a9[_0xb897('0x48')],{'$or':_[_0xb897('0x30')](_0x9e2984,function(_0x35fc55){if(_0x35fc55[_0xb897('0x33')]!==_0xb897('0x4b')){var _0x3a3a16={};_0x3a3a16[_0x35fc55['name']]={'$like':'%'+_0x32463c[_0xb897('0x3d')][_0xb897('0x2e')]+'%'};return _0x3a3a16;}})});}_0xf209a9=_['merge']({},_0xf209a9,_0x32463c[_0xb897('0x4c')]);var _0xb5f353={'where':_0xf209a9['where']};return db[_0xb897('0x38')][_0xb897('0x4d')](_0xb5f353)[_0xb897('0x28')](function(_0x22f7d8){_0x1222ff[_0xb897('0x4d')]=_0x22f7d8;if(_0x32463c[_0xb897('0x3d')]['includeAll']){_0xf209a9['include']=[{'all':!![]}];}return db[_0xb897('0x38')]['findAll'](_0xf209a9);})[_0xb897('0x28')](function(_0x6dfca1){_0x1222ff[_0xb897('0x4e')]=_0x6dfca1;return _0x1222ff;})[_0xb897('0x28')](respondWithFilteredResult(_0x3339a7,_0xf209a9))[_0xb897('0x4f')](handleError(_0x3339a7,null));};exports[_0xb897('0x50')]=function(_0x4432a1,_0x3b37d){var _0x25cbbe={'raw':![],'where':{'id':_0x4432a1[_0xb897('0x51')]['id']}},_0x235d00={};_0x235d00[_0xb897('0x3c')]=_[_0xb897('0x3e')](db[_0xb897('0x38')][_0xb897('0x39')]);_0x235d00[_0xb897('0x3d')]=_[_0xb897('0x3e')](_0x4432a1[_0xb897('0x3d')]);_0x235d00['filters']=_[_0xb897('0x40')](_0x235d00['model'],_0x235d00[_0xb897('0x3d')]);_0x25cbbe[_0xb897('0x42')]=_[_0xb897('0x40')](_0x235d00[_0xb897('0x3c')],qs[_0xb897('0x41')](_0x4432a1[_0xb897('0x3d')][_0xb897('0x41')]));_0x25cbbe['attributes']=_0x25cbbe[_0xb897('0x42')][_0xb897('0x43')]?_0x25cbbe[_0xb897('0x42')]:_0x235d00[_0xb897('0x3c')];if(_0x4432a1[_0xb897('0x3d')][_0xb897('0x52')]){_0x25cbbe[_0xb897('0x53')]=[{'all':!![]}];}_0x25cbbe=_['merge']({},_0x25cbbe,_0x4432a1[_0xb897('0x4c')]);return db[_0xb897('0x38')][_0xb897('0x54')](_0x25cbbe)[_0xb897('0x28')](handleEntityNotFound(_0x3b37d,null))[_0xb897('0x28')](respondWithResult(_0x3b37d,null))[_0xb897('0x4f')](handleError(_0x3b37d,null));};exports['create']=function(_0x504679,_0x118f1e){return db['VoiceQueue'][_0xb897('0x55')](_0x504679[_0xb897('0x56')],{})['then'](function(_0xdd9ce1){var _0x112562=_0x504679[_0xb897('0x57')][_0xb897('0x2a')]({'plain':!![]});if(!_0x112562)throw new Error(_0xb897('0x58'));if(_0x112562[_0xb897('0x59')]==='user'){var _0xe1c0ce=_0xdd9ce1[_0xb897('0x2a')]({'plain':!![]});var _0x5be30a=[{'name':_0xb897('0x2b'),'value':'inbound'},{'name':_0xb897('0x2c'),'value':_0xb897('0x2d')}];var _0x64dac=_[_0xb897('0x54')](_0x5be30a,[_0xb897('0x31'),_0xe1c0ce['type']])[_0xb897('0x34')];return db['UserProfileSection'][_0xb897('0x54')]({'where':{'name':_0x64dac,'userProfileId':_0x112562[_0xb897('0x5a')]},'raw':!![]})[_0xb897('0x28')](function(_0x477222){if(_0x477222&&_0x477222['autoAssociation']===0x0){return db[_0xb897('0x35')]['create']({'name':_0xe1c0ce[_0xb897('0x34')],'resourceId':_0xe1c0ce['id'],'type':_0x477222['name'],'sectionId':_0x477222['id']},{})['then'](function(){return _0xdd9ce1;});}else{return _0xdd9ce1;}})['catch'](function(_0x50654e){logger['error'](_0xb897('0x5b'),_0x50654e);throw _0x50654e;});}return _0xdd9ce1;})[_0xb897('0x28')](respondWithResult(_0x118f1e,0xc9))[_0xb897('0x4f')](handleError(_0x118f1e,null));};exports[_0xb897('0x5c')]=function(_0x26ebda,_0x4f62c3){var _0x32f260={'where':{'id':_0x26ebda[_0xb897('0x51')]['id']}},_0x3c017a={};_0x3c017a[_0xb897('0x3c')]=_[_0xb897('0x3e')](db['VoiceQueue'][_0xb897('0x39')]);_0x32f260[_0xb897('0x42')]=_[_0xb897('0x40')](_0x3c017a[_0xb897('0x3c')],qs[_0xb897('0x41')](_0x26ebda[_0xb897('0x3d')][_0xb897('0x41')]));_0x32f260['attributes']=_0x32f260[_0xb897('0x42')][_0xb897('0x43')]?_0x32f260[_0xb897('0x42')]:_0x3c017a['model'];if(_0x26ebda[_0xb897('0x3d')][_0xb897('0x52')]){_0x32f260[_0xb897('0x53')]=[{'all':!![]}];}_0x32f260=_[_0xb897('0x4a')]({},_0x32f260,_0x26ebda['options']);return db['VoiceQueue'][_0xb897('0x54')](_0x32f260)['then'](handleEntityNotFound(_0x4f62c3,null))[_0xb897('0x28')](function(_0x4d0ad8){if(_0x4d0ad8){var _0x25e1e7=_0x4d0ad8[_0xb897('0x2a')]({'plain':!![]});_0x25e1e7=qs[_0xb897('0x5d')](_0x25e1e7,['id',_0xb897('0x5e'),'updatedAt']);_0x26ebda[_0xb897('0x56')]=_[_0xb897('0x5d')](_0x26ebda[_0xb897('0x56')],['id','createdAt',_0xb897('0x5f')]);return db[_0xb897('0x38')][_0xb897('0x55')](_[_0xb897('0x4a')](_0x25e1e7,_0x26ebda[_0xb897('0x56')]),{'include':_0x26ebda[_0xb897('0x3d')][_0xb897('0x52')]?[{'all':!![]}]:undefined})[_0xb897('0x28')](function(_0x55dbff){var _0x4ad653=_0x26ebda[_0xb897('0x57')][_0xb897('0x2a')]({'plain':!![]});if(!_0x4ad653)throw new Error(_0xb897('0x58'));if(_0x4ad653[_0xb897('0x59')]===_0xb897('0x57')){var _0x30db74=_0x55dbff[_0xb897('0x2a')]({'plain':!![]});var _0x4ab011=[{'name':_0xb897('0x2b'),'value':_0xb897('0x60')},{'name':_0xb897('0x2c'),'value':_0xb897('0x2d')}];var _0x2756f4=_[_0xb897('0x54')](_0x4ab011,[_0xb897('0x31'),_0x30db74[_0xb897('0x33')]])['name'];return db['UserProfileSection'][_0xb897('0x54')]({'where':{'name':_0x2756f4,'userProfileId':_0x4ad653[_0xb897('0x5a')]},'raw':!![]})[_0xb897('0x28')](function(_0x37637b){if(_0x37637b&&_0x37637b[_0xb897('0x61')]===0x0){return db[_0xb897('0x35')][_0xb897('0x55')]({'name':_0x30db74[_0xb897('0x34')],'resourceId':_0x30db74['id'],'type':_0x37637b['name'],'sectionId':_0x37637b['id']},{})[_0xb897('0x28')](function(){return _0x55dbff;});}else{return _0x55dbff;}})[_0xb897('0x4f')](function(_0x4a2298){logger[_0xb897('0x62')](_0xb897('0x5b'),_0x4a2298);throw _0x4a2298;});}return _0x55dbff;});}})[_0xb897('0x28')](respondWithResult(_0x4f62c3,0xc9))[_0xb897('0x4f')](handleError(_0x4f62c3,null));};exports[_0xb897('0x27')]=function(_0x184aa6,_0x1fc0b0){if(_0x184aa6[_0xb897('0x56')]['id']){delete _0x184aa6[_0xb897('0x56')]['id'];}return db['VoiceQueue'][_0xb897('0x54')]({'where':{'id':_0x184aa6[_0xb897('0x51')]['id']}})[_0xb897('0x28')](handleEntityNotFound(_0x1fc0b0,null))['then'](saveUpdates(_0x184aa6['body'],null))[_0xb897('0x28')](respondWithResult(_0x1fc0b0,null))[_0xb897('0x4f')](handleError(_0x1fc0b0,null));};exports[_0xb897('0x29')]=function(_0x414f3d,_0x2141cd){return db[_0xb897('0x38')]['find']({'where':{'id':_0x414f3d[_0xb897('0x51')]['id']}})[_0xb897('0x28')](handleEntityNotFound(_0x2141cd,null))[_0xb897('0x28')](removeEntity(_0x2141cd,null))['catch'](handleError(_0x2141cd,null));};exports['getHoppers']=function(_0x376a30,_0x44eb17,_0x317976){var _0xece650={'raw':![],'where':{}};var _0x120b21={};var _0x2560d6={'count':0x0,'rows':[]};return db[_0xb897('0x38')][_0xb897('0x63')]({'where':{'id':_0x376a30[_0xb897('0x51')]['id']}})[_0xb897('0x28')](handleEntityNotFound(_0x44eb17,null))[_0xb897('0x28')](function(_0x1a1816){if(_0x1a1816){_0x120b21[_0xb897('0x3c')]=_[_0xb897('0x3e')](db[_0xb897('0x64')]['rawAttributes']);_0x120b21['query']=_[_0xb897('0x3e')](_0x376a30['query']);_0x120b21[_0xb897('0x3f')]=_[_0xb897('0x40')](_0x120b21[_0xb897('0x3c')],_0x120b21[_0xb897('0x3d')]);_0xece650[_0xb897('0x42')]=_[_0xb897('0x40')](_0x120b21[_0xb897('0x3c')],qs[_0xb897('0x41')](_0x376a30[_0xb897('0x3d')]['fields']));_0xece650[_0xb897('0x42')]=_0xece650['attributes'][_0xb897('0x43')]?_0xece650[_0xb897('0x42')]:_0x120b21['model'];if(!_0x376a30[_0xb897('0x3d')][_0xb897('0x44')](_0xb897('0x45'))){_0xece650[_0xb897('0x21')]=qs[_0xb897('0x21')](_0x376a30['query']['limit']);_0xece650[_0xb897('0x22')]=qs[_0xb897('0x22')](_0x376a30[_0xb897('0x3d')][_0xb897('0x22')]);}_0xece650[_0xb897('0x46')]=qs[_0xb897('0x47')](_0x376a30[_0xb897('0x3d')][_0xb897('0x47')]);_0xece650[_0xb897('0x48')]=qs[_0xb897('0x3f')](_[_0xb897('0x49')](_0x376a30[_0xb897('0x3d')],_0x120b21[_0xb897('0x3f')]));_0xece650[_0xb897('0x48')][_0xb897('0x65')]=_0x1a1816['id'];if(_0x376a30[_0xb897('0x3d')][_0xb897('0x2e')]){_0xece650[_0xb897('0x48')]=_['merge'](_0xece650[_0xb897('0x48')],{'$or':_[_0xb897('0x30')](_0xece650[_0xb897('0x42')],function(_0x4e9b89){var _0x361b82={};_0x361b82[_0x4e9b89]={'$like':'%'+_0x376a30[_0xb897('0x3d')][_0xb897('0x2e')]+'%'};return _0x361b82;})});}_0xece650=_['merge']({},_0xece650,_0x376a30[_0xb897('0x4c')]);return db[_0xb897('0x64')][_0xb897('0x4d')]({'where':_0xece650[_0xb897('0x48')]})['then'](function(_0xdfe484){_0x2560d6['count']=_0xdfe484;if(_0x376a30[_0xb897('0x3d')][_0xb897('0x52')]){_0xece650[_0xb897('0x53')]=[{'all':!![]}];}return db['CmHopper'][_0xb897('0x66')](_0xece650);})[_0xb897('0x28')](function(_0x43ac27){_0x2560d6['rows']=_0x43ac27;return _0x2560d6;});}})[_0xb897('0x28')](respondWithFilteredResult(_0x44eb17,_0xece650))[_0xb897('0x4f')](handleError(_0x44eb17,null));};exports['getHopperHistories']=function(_0x55fd59,_0x4292e8,_0x41299f){var _0x2e51ed={'raw':!![],'where':{}};var _0x2063c7={};var _0x15dfae={'count':0x0,'rows':[]};return db['VoiceQueue'][_0xb897('0x63')]({'where':{'id':_0x55fd59[_0xb897('0x51')]['id']}})[_0xb897('0x28')](handleEntityNotFound(_0x4292e8,null))['then'](function(_0x519a3c){if(_0x519a3c){_0x2063c7['model']=_[_0xb897('0x3e')](db['CmHopperHistory'][_0xb897('0x39')]);_0x2063c7[_0xb897('0x3d')]=_['keys'](_0x55fd59[_0xb897('0x3d')]);_0x2063c7[_0xb897('0x3f')]=_[_0xb897('0x40')](_0x2063c7[_0xb897('0x3c')],_0x2063c7[_0xb897('0x3d')]);_0x2e51ed['attributes']=_['intersection'](_0x2063c7[_0xb897('0x3c')],qs[_0xb897('0x41')](_0x55fd59['query'][_0xb897('0x41')]));_0x2e51ed[_0xb897('0x42')]=_0x2e51ed['attributes'][_0xb897('0x43')]?_0x2e51ed['attributes']:_0x2063c7[_0xb897('0x3c')];if(!_0x55fd59['query'][_0xb897('0x44')](_0xb897('0x45'))){_0x2e51ed[_0xb897('0x21')]=qs['limit'](_0x55fd59[_0xb897('0x3d')][_0xb897('0x21')]);_0x2e51ed[_0xb897('0x22')]=qs[_0xb897('0x22')](_0x55fd59[_0xb897('0x3d')]['offset']);}_0x2e51ed[_0xb897('0x46')]=qs[_0xb897('0x47')](_0x55fd59[_0xb897('0x3d')]['sort']);_0x2e51ed['where']=qs[_0xb897('0x3f')](_[_0xb897('0x49')](_0x55fd59[_0xb897('0x3d')],_0x2063c7[_0xb897('0x3f')]));_0x2e51ed[_0xb897('0x48')][_0xb897('0x65')]=_0x519a3c['id'];if(_0x55fd59[_0xb897('0x3d')][_0xb897('0x2e')]){_0x2e51ed[_0xb897('0x48')]=_['merge'](_0x2e51ed[_0xb897('0x48')],{'$or':_['map'](_0x2e51ed[_0xb897('0x42')],function(_0xba508e){var _0x137d6c={};_0x137d6c[_0xba508e]={'$like':'%'+_0x55fd59[_0xb897('0x3d')][_0xb897('0x2e')]+'%'};return _0x137d6c;})});}_0x2e51ed=_[_0xb897('0x4a')]({},_0x2e51ed,_0x55fd59[_0xb897('0x4c')]);return db['CmHopperHistory'][_0xb897('0x4d')]({'where':_0x2e51ed[_0xb897('0x48')]})[_0xb897('0x28')](function(_0x57890e){_0x15dfae[_0xb897('0x4d')]=_0x57890e;if(_0x55fd59[_0xb897('0x3d')][_0xb897('0x52')]){_0x2e51ed['include']=[{'all':!![]}];}return db[_0xb897('0x67')]['findAll'](_0x2e51ed);})[_0xb897('0x28')](function(_0x2abfa6){_0x15dfae['rows']=_0x2abfa6;return _0x15dfae;});}})[_0xb897('0x28')](respondWithFilteredResult(_0x4292e8,_0x2e51ed))[_0xb897('0x4f')](handleError(_0x4292e8,null));};exports[_0xb897('0x68')]=function(_0x519180,_0x15a47c,_0x23bce3){var _0xe834e7={'raw':!![],'where':{}};var _0x11a285={};var _0x18d736={'count':0x0,'rows':[]};return db[_0xb897('0x38')][_0xb897('0x63')]({'where':{'id':_0x519180['params']['id']}})[_0xb897('0x28')](handleEntityNotFound(_0x15a47c,null))[_0xb897('0x28')](function(_0x42d6a0){if(_0x42d6a0){_0x11a285[_0xb897('0x3c')]=_['keys'](db[_0xb897('0x69')]['rawAttributes']);_0x11a285[_0xb897('0x3d')]=_[_0xb897('0x3e')](_0x519180['query']);_0x11a285[_0xb897('0x3f')]=_[_0xb897('0x40')](_0x11a285[_0xb897('0x3c')],_0x11a285[_0xb897('0x3d')]);_0xe834e7[_0xb897('0x42')]=_[_0xb897('0x40')](_0x11a285['model'],qs[_0xb897('0x41')](_0x519180[_0xb897('0x3d')][_0xb897('0x41')]));_0xe834e7['attributes']=_0xe834e7[_0xb897('0x42')][_0xb897('0x43')]?_0xe834e7[_0xb897('0x42')]:_0x11a285[_0xb897('0x3c')];if(!_0x519180[_0xb897('0x3d')][_0xb897('0x44')]('nolimit')){_0xe834e7[_0xb897('0x21')]=qs[_0xb897('0x21')](_0x519180[_0xb897('0x3d')][_0xb897('0x21')]);_0xe834e7[_0xb897('0x22')]=qs['offset'](_0x519180[_0xb897('0x3d')]['offset']);}_0xe834e7[_0xb897('0x46')]=qs[_0xb897('0x47')](_0x519180[_0xb897('0x3d')][_0xb897('0x47')]);_0xe834e7[_0xb897('0x48')]=qs[_0xb897('0x3f')](_[_0xb897('0x49')](_0x519180[_0xb897('0x3d')],_0x11a285[_0xb897('0x3f')]));_0xe834e7[_0xb897('0x48')][_0xb897('0x65')]=_0x42d6a0['id'];if(_0x519180[_0xb897('0x3d')][_0xb897('0x2e')]){_0xe834e7[_0xb897('0x48')]=_[_0xb897('0x4a')](_0xe834e7['where'],{'$or':_[_0xb897('0x30')](_0xe834e7[_0xb897('0x42')],function(_0x288d02){var _0x16c8c0={};_0x16c8c0[_0x288d02]={'$like':'%'+_0x519180[_0xb897('0x3d')][_0xb897('0x2e')]+'%'};return _0x16c8c0;})});}_0xe834e7=_['merge']({},_0xe834e7,_0x519180[_0xb897('0x4c')]);return db['CmHopperFinal']['count']({'where':_0xe834e7['where']})['then'](function(_0xa82c85){_0x18d736[_0xb897('0x4d')]=_0xa82c85;if(_0x519180[_0xb897('0x3d')]['includeAll']){_0xe834e7['include']=[{'all':!![]}];}return db[_0xb897('0x69')][_0xb897('0x66')](_0xe834e7);})[_0xb897('0x28')](function(_0x10dc62){_0x18d736[_0xb897('0x4e')]=_0x10dc62;return _0x18d736;});}})['then'](respondWithFilteredResult(_0x15a47c,_0xe834e7))[_0xb897('0x4f')](handleError(_0x15a47c,null));};exports['getHopperBlacks']=function(_0x43a1a8,_0x326c60,_0x136f3e){var _0x5a9f76={'raw':!![],'where':{}};var _0x11c676={};var _0x26e2eb={'count':0x0,'rows':[]};return db[_0xb897('0x38')][_0xb897('0x63')]({'where':{'id':_0x43a1a8[_0xb897('0x51')]['id']}})[_0xb897('0x28')](handleEntityNotFound(_0x326c60,null))[_0xb897('0x28')](function(_0x1e16fd){if(_0x1e16fd){_0x11c676[_0xb897('0x3c')]=_[_0xb897('0x3e')](db[_0xb897('0x6a')][_0xb897('0x39')]);_0x11c676[_0xb897('0x3d')]=_['keys'](_0x43a1a8['query']);_0x11c676[_0xb897('0x3f')]=_[_0xb897('0x40')](_0x11c676[_0xb897('0x3c')],_0x11c676[_0xb897('0x3d')]);_0x5a9f76['attributes']=_[_0xb897('0x40')](_0x11c676['model'],qs[_0xb897('0x41')](_0x43a1a8[_0xb897('0x3d')][_0xb897('0x41')]));_0x5a9f76[_0xb897('0x42')]=_0x5a9f76[_0xb897('0x42')][_0xb897('0x43')]?_0x5a9f76[_0xb897('0x42')]:_0x11c676[_0xb897('0x3c')];if(!_0x43a1a8[_0xb897('0x3d')][_0xb897('0x44')](_0xb897('0x45'))){_0x5a9f76[_0xb897('0x21')]=qs['limit'](_0x43a1a8[_0xb897('0x3d')][_0xb897('0x21')]);_0x5a9f76['offset']=qs[_0xb897('0x22')](_0x43a1a8['query'][_0xb897('0x22')]);}_0x5a9f76[_0xb897('0x46')]=qs[_0xb897('0x47')](_0x43a1a8[_0xb897('0x3d')][_0xb897('0x47')]);_0x5a9f76[_0xb897('0x48')]=qs[_0xb897('0x3f')](_[_0xb897('0x49')](_0x43a1a8[_0xb897('0x3d')],_0x11c676[_0xb897('0x3f')]));_0x5a9f76[_0xb897('0x48')][_0xb897('0x65')]=_0x1e16fd['id'];if(_0x43a1a8['query'][_0xb897('0x2e')]){_0x5a9f76['where']=_[_0xb897('0x4a')](_0x5a9f76[_0xb897('0x48')],{'$or':_[_0xb897('0x30')](_0x5a9f76[_0xb897('0x42')],function(_0x5ea4a9){var _0x27d8c2={};_0x27d8c2[_0x5ea4a9]={'$like':'%'+_0x43a1a8[_0xb897('0x3d')]['filter']+'%'};return _0x27d8c2;})});}_0x5a9f76=_['merge']({},_0x5a9f76,_0x43a1a8[_0xb897('0x4c')]);return db[_0xb897('0x6a')][_0xb897('0x4d')]({'where':_0x5a9f76[_0xb897('0x48')]})['then'](function(_0x199054){_0x26e2eb[_0xb897('0x4d')]=_0x199054;if(_0x43a1a8[_0xb897('0x3d')][_0xb897('0x52')]){_0x5a9f76[_0xb897('0x53')]=[{'all':!![]}];}return db[_0xb897('0x6a')]['findAll'](_0x5a9f76);})[_0xb897('0x28')](function(_0x1420c9){_0x26e2eb['rows']=_0x1420c9;return _0x26e2eb;});}})[_0xb897('0x28')](respondWithFilteredResult(_0x326c60,_0x5a9f76))[_0xb897('0x4f')](handleError(_0x326c60,null));};exports['getTeams']=function(_0x196722,_0x7752df,_0x30f572){var _0xa7e747={};var _0x2d43db={};var _0x4b674b;var _0x369e05;return db[_0xb897('0x38')][_0xb897('0x63')]({'where':{'id':_0x196722['params']['id']}})['then'](handleEntityNotFound(_0x7752df,null))[_0xb897('0x28')](function(_0x57734f){if(_0x57734f){_0x4b674b=_0x57734f;_0x2d43db['model']=_[_0xb897('0x3e')](db[_0xb897('0x6b')][_0xb897('0x39')]);_0x2d43db[_0xb897('0x3d')]=_[_0xb897('0x3e')](_0x196722[_0xb897('0x3d')]);_0x2d43db[_0xb897('0x3f')]=_[_0xb897('0x40')](_0x2d43db['model'],_0x2d43db[_0xb897('0x3d')]);_0xa7e747['attributes']=_[_0xb897('0x40')](_0x2d43db[_0xb897('0x3c')],qs[_0xb897('0x41')](_0x196722[_0xb897('0x3d')][_0xb897('0x41')]));_0xa7e747[_0xb897('0x42')]=_0xa7e747[_0xb897('0x42')][_0xb897('0x43')]?_0xa7e747[_0xb897('0x42')]:_0x2d43db['model'];_0xa7e747[_0xb897('0x46')]=qs[_0xb897('0x47')](_0x196722[_0xb897('0x3d')][_0xb897('0x47')]);_0xa7e747[_0xb897('0x48')]=qs[_0xb897('0x3f')](_['pick'](_0x196722[_0xb897('0x3d')],_0x2d43db[_0xb897('0x3f')]));if(_0x196722['query'][_0xb897('0x2e')]){_0xa7e747['where']=_[_0xb897('0x4a')](_0xa7e747[_0xb897('0x48')],{'$or':_[_0xb897('0x30')](_0xa7e747[_0xb897('0x42')],function(_0x2a8bf5){var _0x36f304={};_0x36f304[_0x2a8bf5]={'$like':'%'+_0x196722[_0xb897('0x3d')]['filter']+'%'};return _0x36f304;})});}_0xa7e747=_[_0xb897('0x4a')]({},_0xa7e747,_0x196722['options']);return _0x4b674b[_0xb897('0x6c')](_0xa7e747);}})['then'](function(_0x5783ad){if(_0x5783ad){_0x369e05=_0x5783ad[_0xb897('0x43')];if(!_0x196722[_0xb897('0x3d')][_0xb897('0x44')](_0xb897('0x45'))){_0xa7e747[_0xb897('0x21')]=qs[_0xb897('0x21')](_0x196722['query'][_0xb897('0x21')]);_0xa7e747['offset']=qs[_0xb897('0x22')](_0x196722[_0xb897('0x3d')]['offset']);}return _0x4b674b[_0xb897('0x6c')](_0xa7e747);}})[_0xb897('0x28')](function(_0x2385fc){if(_0x2385fc){return _0x2385fc?{'count':_0x369e05,'rows':_0x2385fc}:null;}})['then'](respondWithResult(_0x7752df,null))[_0xb897('0x4f')](handleError(_0x7752df,null));};exports[_0xb897('0x6d')]=function(_0x5f4314,_0x1ed234,_0x570f89){var _0x4f5f96=_0x5f4314[_0xb897('0x56')]['teams'];var _0x240ea8=_['map'](_0x4f5f96,'id');return db[_0xb897('0x6b')][_0xb897('0x66')]({'where':{'id':_0x240ea8},'attributes':['id'],'include':[{'model':db[_0xb897('0x6e')],'as':_0xb897('0x6f'),'attributes':['id','name',_0xb897('0x70'),_0xb897('0x71'),_0xb897('0x72')],'raw':!![]}]})[_0xb897('0x28')](function(_0x1cbbc2){if(_0x1cbbc2){var _0x7515ca=_[_0xb897('0x73')](_0x1cbbc2,function(_0x4a75c8){var _0x172b98=_0x4a75c8[_0xb897('0x2a')]({'plain':!![]});_0x172b98['Agents'][_0xb897('0x74')](function(_0x3baaa0){_0x3baaa0['penalty']=_[_0xb897('0x54')](_0x4f5f96,{'id':_0x172b98['id']})[_0xb897('0x75')];});return _0x172b98['Agents'];});return db[_0xb897('0x38')][_0xb897('0x54')]({'where':{'id':_0x5f4314['params']['id']}})[_0xb897('0x28')](function(_0xdbf3c4){return db[_0xb897('0x76')]['transaction'](function(_0xb9a3d4){return _0xdbf3c4[_0xb897('0x6d')](_0x240ea8,{'transaction':_0xb9a3d4})['then'](function(){return BPromise[_0xb897('0x77')](_0x4f5f96,function(_0x3a9564){return db[_0xb897('0x78')][_0xb897('0x79')]({'TeamId':_0x3a9564['id'],'VoiceQueueId':_0x5f4314['params']['id'],'penalty':_0x3a9564['penalty']},{'transaction':_0xb9a3d4});});})[_0xb897('0x28')](function(){return BPromise['each'](_0x7515ca,function(_0x3dda2b){return db[_0xb897('0x7a')][_0xb897('0x7b')]({'where':{'UserId':_0x3dda2b['id'],'VoiceQueueId':_0x5f4314['params']['id']},'defaults':{'penalty':_0x3dda2b['penalty']},'transaction':_0xb9a3d4});});})[_0xb897('0x28')](function(){return BPromise[_0xb897('0x77')](_['filter'](_0x7515ca,{'online':!![]}),function(_0x35eabb){return db[_0xb897('0x7c')][_0xb897('0x79')]({'membername':_0x35eabb[_0xb897('0x34')],'UserId':_0x35eabb['id'],'queue_name':_0xdbf3c4[_0xb897('0x34')],'VoiceQueueId':_0xdbf3c4['id'],'interface':_['isNil'](_0x35eabb[_0xb897('0x72')])?util[_0xb897('0x7d')](_0xb897('0x7e'),_0x35eabb[_0xb897('0x34')]):_0x35eabb[_0xb897('0x72')],'paused':_0x35eabb[_0xb897('0x71')]||![],'penalty':_0x35eabb[_0xb897('0x75')]},{'transaction':_0xb9a3d4});});})[_0xb897('0x28')](function(){_0x7515ca[_0xb897('0x74')](function(_0x6eff62){socket['emit'](_0xb897('0x7f'),{'UserId':_0x6eff62['id'],'VoiceQueueId':_0xdbf3c4['id']});});});});});}})[_0xb897('0x28')](respondWithStatusCode(_0x1ed234,null))[_0xb897('0x4f')](handleError(_0x1ed234,null));};exports[_0xb897('0x80')]=function(_0x1d47e0,_0xd10e92,_0x2fe984){return db[_0xb897('0x6b')][_0xb897('0x66')]({'where':{'id':_0x1d47e0[_0xb897('0x3d')][_0xb897('0x81')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0xb897('0x6f'),'attributes':['id'],'raw':!![]}]})[_0xb897('0x28')](handleEntityNotFound(_0xd10e92,null))[_0xb897('0x28')](function(_0x5c47b3){var _0x24468c=_[_0xb897('0x30')](_0x5c47b3,'id');var _0x57ac2a=[];var _0x5d7527=[];var _0x2abb50=squel[_0xb897('0x82')]();_0x2abb50[_0xb897('0x83')](_0xb897('0x84'))[_0xb897('0x85')]('team_has_voice_queues','tq')[_0xb897('0x86')]('user_has_teams','ut',_0xb897('0x87'))['where']('VoiceQueueId\x20=\x20?',_0x1d47e0[_0xb897('0x51')]['id']);for(var _0x4b3662=0x0;_0x4b3662<_0x5c47b3['length'];_0x4b3662+=0x1){let _0x2ed1ed=_0x5c47b3[_0x4b3662];for(var _0x56290b=0x0;_0x56290b<_0x2ed1ed['Agents']['length'];_0x56290b+=0x1){let _0x28ad9f=_0x2ed1ed['Agents'][_0x56290b];var _0x3eee16=_0x2abb50[_0xb897('0x5c')]();_0x3eee16['where']('ut.UserId\x20=\x20?',_0x28ad9f['id']);_0x5d7527[_0xb897('0x88')](db[_0xb897('0x76')][_0xb897('0x3d')](_0x3eee16[_0xb897('0x89')](),{'type':db[_0xb897('0x76')][_0xb897('0x8a')][_0xb897('0x8b')]})[_0xb897('0x28')](function(_0x351480){if(_0x351480[_0xb897('0x43')]===0x1){return _0x28ad9f['id'];}else{var _0x4f7dc2=_[_0xb897('0x8c')](_[_0xb897('0x30')](_0x351480,_0xb897('0x8d')),function(_0xa76b65){return _[_0xb897('0x32')](_0x24468c,_0xa76b65);});if(_0x4f7dc2){return _0x28ad9f['id'];}}}));}}return BPromise[_0xb897('0x8e')](_0x5d7527)[_0xb897('0x28')](function(_0x3e9b79){_0x57ac2a=_(_0x57ac2a)['union'](_0x3e9b79)['compact']()[_0xb897('0x31')]();return db[_0xb897('0x38')]['find']({'where':{'id':_0x1d47e0[_0xb897('0x51')]['id']}})[_0xb897('0x28')](function(_0x522449){return db[_0xb897('0x76')][_0xb897('0x8f')](function(_0x4c7d38){return _0x522449[_0xb897('0x80')](_0x1d47e0[_0xb897('0x3d')][_0xb897('0x81')],{'transaction':_0x4c7d38})[_0xb897('0x28')](function(){if(!_[_0xb897('0x90')](_0x57ac2a)){return _0x522449[_0xb897('0x91')](_0x57ac2a,{'transaction':_0x4c7d38})[_0xb897('0x28')](function(){return db[_0xb897('0x7c')]['destroy']({'where':{'VoiceQueueId':_0x1d47e0[_0xb897('0x51')]['id'],'UserId':_0x57ac2a},'transaction':_0x4c7d38});});}})[_0xb897('0x28')](function(){_0x57ac2a[_0xb897('0x74')](function(_0x1c8fc0){socket[_0xb897('0x92')]('userVoiceQueue:remove',{'UserId':_0x1c8fc0,'VoiceQueueId':_0x522449['id']});});});});});});})[_0xb897('0x28')](respondWithStatusCode(_0xd10e92,null))[_0xb897('0x4f')](handleError(_0xd10e92,null));};exports[_0xb897('0x93')]=function(_0x1f053c,_0x3f8c2b,_0x23e0d5){var _0x2d7034,_0x333d53;return db[_0xb897('0x38')][_0xb897('0x54')]({'where':{'id':_0x1f053c[_0xb897('0x51')]['id']}})[_0xb897('0x28')](handleEntityNotFound(_0x3f8c2b,null))[_0xb897('0x28')](function(_0x141468){if(_0x141468){_0x333d53=_0x141468;return _0x141468['addAgents'](_0x1f053c[_0xb897('0x56')][_0xb897('0x81')],_['omit'](_0x1f053c[_0xb897('0x56')],[_0xb897('0x81'),'id'])||{})['spread'](function(_0x8d461e){for(var _0x240f0c=0x0;_0x240f0c<_0x1f053c['body']['ids'][_0xb897('0x43')];_0x240f0c+=0x1){socket[_0xb897('0x92')](_0xb897('0x7f'),{'UserId':Number(_0x1f053c[_0xb897('0x56')][_0xb897('0x81')][_0x240f0c]),'VoiceQueueId':Number(_0x1f053c['params']['id'])});}return _0x8d461e;});}})[_0xb897('0x28')](function(_0x3f1a56){_0x2d7034=_0x3f1a56||[];if(_0x333d53){return db['User'][_0xb897('0x66')]({'where':{'id':_0x1f053c[_0xb897('0x56')][_0xb897('0x81')]},'attributes':['id',_0xb897('0x34'),'online',_0xb897('0x71'),_0xb897('0x72')],'raw':!![]});}})[_0xb897('0x28')](function(_0x1e0e55){if(!_[_0xb897('0x90')](_0x1e0e55)){var _0x23aa5e=[];for(var _0x21da25=0x0;_0x21da25<_0x1e0e55['length'];_0x21da25++){if(_0x1e0e55[_0x21da25][_0xb897('0x70')]){_0x23aa5e['push'](db['UserVoiceQueueRt'][_0xb897('0x79')]({'membername':_0x1e0e55[_0x21da25][_0xb897('0x34')],'UserId':_0x1e0e55[_0x21da25]['id'],'queue_name':_0x333d53[_0xb897('0x34')],'VoiceQueueId':_0x333d53['id'],'interface':_['isNil'](_0x1e0e55[_0x21da25][_0xb897('0x72')])?util[_0xb897('0x7d')](_0xb897('0x7e'),_0x1e0e55[_0x21da25][_0xb897('0x34')]):_0x1e0e55[_0x21da25][_0xb897('0x72')],'paused':_0x1e0e55[_0x21da25]['voicePause']||![],'penalty':_0x1f053c[_0xb897('0x56')]['penalty']||0x0}));}}return BPromise[_0xb897('0x8e')](_0x23aa5e);}})[_0xb897('0x28')](function(){return _0x2d7034;})[_0xb897('0x28')](respondWithResult(_0x3f8c2b,null))[_0xb897('0x4f')](handleError(_0x3f8c2b,null));};exports[_0xb897('0x91')]=function(_0x245bfa,_0x2bc0a2,_0x1fd861){return db['VoiceQueue'][_0xb897('0x54')]({'where':{'id':_0x245bfa[_0xb897('0x51')]['id']}})[_0xb897('0x28')](handleEntityNotFound(_0x2bc0a2,null))[_0xb897('0x28')](function(_0x3b1b5b){if(_0x3b1b5b){return _0x3b1b5b[_0xb897('0x91')](_0x245bfa[_0xb897('0x3d')]['ids'])['then'](function(){if(_[_0xb897('0x94')](_0x245bfa[_0xb897('0x3d')]['ids'])){for(var _0x34efb3=0x0;_0x34efb3<_0x245bfa[_0xb897('0x3d')]['ids']['length'];_0x34efb3+=0x1){socket[_0xb897('0x92')](_0xb897('0x95'),{'UserId':Number(_0x245bfa['query'][_0xb897('0x81')][_0x34efb3]),'VoiceQueueId':Number(_0x245bfa[_0xb897('0x51')]['id'])});}}else{socket[_0xb897('0x92')](_0xb897('0x95'),{'UserId':Number(_0x245bfa[_0xb897('0x3d')][_0xb897('0x81')]),'VoiceQueueId':Number(_0x245bfa[_0xb897('0x51')]['id'])});}});}})[_0xb897('0x28')](function(_0x4a83ce){return db[_0xb897('0x7c')]['destroy']({'where':{'VoiceQueueId':_0x245bfa[_0xb897('0x51')]['id'],'UserId':_0x245bfa[_0xb897('0x3d')][_0xb897('0x81')]}})[_0xb897('0x28')](function(){return _0x4a83ce;});})[_0xb897('0x28')](respondWithStatusCode(_0x2bc0a2,null))[_0xb897('0x4f')](handleError(_0x2bc0a2,null));};exports[_0xb897('0x96')]=function(_0x43a038,_0x1cf80c,_0x372103){var _0x4f3dc0={};var _0x4078f7={};var _0x418e4b;var _0x20e728;return db[_0xb897('0x38')]['findOne']({'where':{'id':_0x43a038[_0xb897('0x51')]['id']}})['then'](handleEntityNotFound(_0x1cf80c,null))[_0xb897('0x28')](function(_0x11c9d2){if(_0x11c9d2){_0x418e4b=_0x11c9d2;_0x4078f7['model']=_[_0xb897('0x3e')](db[_0xb897('0x6e')]['rawAttributes']);_0x4078f7[_0xb897('0x3d')]=_[_0xb897('0x3e')](_0x43a038['query']);_0x4078f7[_0xb897('0x3f')]=_[_0xb897('0x40')](_0x4078f7[_0xb897('0x3c')],_0x4078f7[_0xb897('0x3d')]);_0x4f3dc0[_0xb897('0x42')]=_['intersection'](_0x4078f7[_0xb897('0x3c')],qs[_0xb897('0x41')](_0x43a038['query']['fields']));_0x4f3dc0[_0xb897('0x42')]=_0x4f3dc0[_0xb897('0x42')][_0xb897('0x43')]?_0x4f3dc0[_0xb897('0x42')]:_0x4078f7['model'];_0x4f3dc0['order']=qs[_0xb897('0x47')](_0x43a038[_0xb897('0x3d')]['sort']);_0x4f3dc0[_0xb897('0x48')]=qs[_0xb897('0x3f')](_[_0xb897('0x49')](_0x43a038['query'],_0x4078f7[_0xb897('0x3f')]));if(_0x43a038[_0xb897('0x3d')][_0xb897('0x2e')]){_0x4f3dc0[_0xb897('0x48')]=_[_0xb897('0x4a')](_0x4f3dc0[_0xb897('0x48')],{'$or':_[_0xb897('0x30')](_0x4f3dc0[_0xb897('0x42')],function(_0x5aac14){var _0x14f343={};_0x14f343[_0x5aac14]={'$like':'%'+_0x43a038[_0xb897('0x3d')]['filter']+'%'};return _0x14f343;})});}_0x4f3dc0=_['merge']({},_0x4f3dc0,_0x43a038[_0xb897('0x4c')]);return _0x418e4b[_0xb897('0x96')](_0x4f3dc0);}})['then'](function(_0x3d9970){if(_0x3d9970){_0x20e728=_0x3d9970['length'];if(!_0x43a038['query']['hasOwnProperty']('nolimit')){_0x4f3dc0[_0xb897('0x21')]=qs['limit'](_0x43a038[_0xb897('0x3d')][_0xb897('0x21')]);_0x4f3dc0[_0xb897('0x22')]=qs['offset'](_0x43a038[_0xb897('0x3d')][_0xb897('0x22')]);}return _0x418e4b[_0xb897('0x96')](_0x4f3dc0);}})[_0xb897('0x28')](function(_0x5a4a3f){if(_0x5a4a3f){return _0x5a4a3f?{'count':_0x20e728,'rows':_0x5a4a3f}:null;}})[_0xb897('0x28')](respondWithResult(_0x1cf80c,null))[_0xb897('0x4f')](handleError(_0x1cf80c,null));};exports[_0xb897('0x97')]=function(_0x45dd9e,_0x39b5b2,_0x5c90f0){var _0x7f99fc={};var _0x28596a={};var _0x428f6f;var _0x38b5ad;return db[_0xb897('0x38')][_0xb897('0x63')]({'where':{'id':_0x45dd9e['params']['id']}})[_0xb897('0x28')](handleEntityNotFound(_0x39b5b2,null))['then'](function(_0xa394ce){if(_0xa394ce){_0x428f6f=_0xa394ce;_0x28596a[_0xb897('0x3c')]=_[_0xb897('0x3e')](db[_0xb897('0x7c')][_0xb897('0x39')]);_0x28596a[_0xb897('0x3d')]=_[_0xb897('0x3e')](_0x45dd9e[_0xb897('0x3d')]);_0x28596a[_0xb897('0x3f')]=_[_0xb897('0x40')](_0x28596a['model'],_0x28596a[_0xb897('0x3d')]);_0x7f99fc[_0xb897('0x42')]=_[_0xb897('0x40')](_0x28596a[_0xb897('0x3c')],qs[_0xb897('0x41')](_0x45dd9e[_0xb897('0x3d')]['fields']));_0x7f99fc[_0xb897('0x42')]=_0x7f99fc[_0xb897('0x42')][_0xb897('0x43')]?_0x7f99fc['attributes']:_0x28596a[_0xb897('0x3c')];_0x7f99fc['order']=qs[_0xb897('0x47')](_0x45dd9e['query']['sort']);_0x7f99fc[_0xb897('0x48')]=qs['filters'](_['pick'](_0x45dd9e[_0xb897('0x3d')],_0x28596a[_0xb897('0x3f')]));if(_0x45dd9e[_0xb897('0x3d')][_0xb897('0x2e')]){_0x7f99fc['where']=_['merge'](_0x7f99fc[_0xb897('0x48')],{'$or':_[_0xb897('0x30')](_0x7f99fc[_0xb897('0x42')],function(_0x20a605){var _0x945ab={};_0x945ab[_0x20a605]={'$like':'%'+_0x45dd9e[_0xb897('0x3d')][_0xb897('0x2e')]+'%'};return _0x945ab;})});}_0x7f99fc=_[_0xb897('0x4a')]({},_0x7f99fc,_0x45dd9e[_0xb897('0x4c')]);return _0x428f6f[_0xb897('0x97')](_0x7f99fc);}})[_0xb897('0x28')](function(_0x4579c6){if(_0x4579c6){_0x38b5ad=_0x4579c6[_0xb897('0x43')];if(!_0x45dd9e[_0xb897('0x3d')]['hasOwnProperty'](_0xb897('0x45'))){_0x7f99fc[_0xb897('0x21')]=qs[_0xb897('0x21')](_0x45dd9e[_0xb897('0x3d')]['limit']);_0x7f99fc[_0xb897('0x22')]=qs['offset'](_0x45dd9e[_0xb897('0x3d')]['offset']);}return _0x428f6f[_0xb897('0x97')](_0x7f99fc);}})[_0xb897('0x28')](function(_0x321fae){return _0x321fae?{'count':_0x38b5ad,'rows':_0x321fae}:null;})['then'](respondWithResult(_0x39b5b2,null))[_0xb897('0x4f')](handleError(_0x39b5b2,null));};exports[_0xb897('0x98')]=function(_0x23840a,_0x2abc14,_0x4671a1){var _0x4cb933={};var _0x5e7b4b={};var _0x5989f7;var _0x209bab;return db[_0xb897('0x38')][_0xb897('0x63')]({'where':{'id':_0x23840a[_0xb897('0x51')]['id']}})[_0xb897('0x28')](handleEntityNotFound(_0x2abc14,null))[_0xb897('0x28')](function(_0x5a3ed6){if(_0x5a3ed6){_0x5989f7=_0x5a3ed6;_0x5e7b4b[_0xb897('0x3c')]=_[_0xb897('0x3e')](db[_0xb897('0x99')]['rawAttributes']);_0x5e7b4b[_0xb897('0x3d')]=_[_0xb897('0x3e')](_0x23840a['query']);_0x5e7b4b['filters']=_[_0xb897('0x40')](_0x5e7b4b[_0xb897('0x3c')],_0x5e7b4b[_0xb897('0x3d')]);_0x4cb933['attributes']=_[_0xb897('0x40')](_0x5e7b4b[_0xb897('0x3c')],qs[_0xb897('0x41')](_0x23840a['query'][_0xb897('0x41')]));_0x4cb933[_0xb897('0x42')]=_0x4cb933[_0xb897('0x42')][_0xb897('0x43')]?_0x4cb933[_0xb897('0x42')]:_0x5e7b4b[_0xb897('0x3c')];_0x4cb933[_0xb897('0x46')]=qs['sort'](_0x23840a[_0xb897('0x3d')][_0xb897('0x47')]);_0x4cb933[_0xb897('0x48')]=qs[_0xb897('0x3f')](_[_0xb897('0x49')](_0x23840a[_0xb897('0x3d')],_0x5e7b4b[_0xb897('0x3f')]));if(_0x23840a[_0xb897('0x3d')][_0xb897('0x2e')]){_0x4cb933[_0xb897('0x48')]=_[_0xb897('0x4a')](_0x4cb933[_0xb897('0x48')],{'$or':_['map'](_0x4cb933[_0xb897('0x42')],function(_0x578fa0){var _0x1d4bc8={};_0x1d4bc8[_0x578fa0]={'$like':'%'+_0x23840a['query'][_0xb897('0x2e')]+'%'};return _0x1d4bc8;})});}_0x4cb933=_[_0xb897('0x4a')]({},_0x4cb933,_0x23840a['options']);return _0x5989f7['getLists'](_0x4cb933);}})['then'](function(_0x3c7470){if(_0x3c7470){_0x209bab=_0x3c7470[_0xb897('0x43')];if(!_0x23840a['query'][_0xb897('0x44')](_0xb897('0x45'))){_0x4cb933[_0xb897('0x21')]=qs[_0xb897('0x21')](_0x23840a[_0xb897('0x3d')][_0xb897('0x21')]);_0x4cb933['offset']=qs[_0xb897('0x22')](_0x23840a['query']['offset']);}return _0x5989f7[_0xb897('0x98')](_0x4cb933);}})[_0xb897('0x28')](function(_0x12242b){if(_0x12242b){return _0x12242b?{'count':_0x209bab,'rows':_0x12242b}:null;}})[_0xb897('0x28')](respondWithResult(_0x2abc14,null))['catch'](handleError(_0x2abc14,null));};exports['addLists']=function(_0x2d0111,_0x2d54d5,_0x3f694c){var _0x4f6861,_0x547573;return db[_0xb897('0x38')][_0xb897('0x54')]({'where':{'id':_0x2d0111[_0xb897('0x51')]['id']}})[_0xb897('0x28')](handleEntityNotFound(_0x2d54d5,null))[_0xb897('0x28')](function(_0x1ee876){if(_0x1ee876){_0x547573=_0x1ee876;return _0x1ee876[_0xb897('0x9a')](_0x2d0111[_0xb897('0x56')][_0xb897('0x81')],_[_0xb897('0x5d')](_0x2d0111[_0xb897('0x56')],[_0xb897('0x81'),'id'])||{});}return null;})['spread'](function(_0x2c6eed){var _0x3525b2;_0x4f6861=_0x2c6eed||[];var _0x39f3c1=[];if(_0x2c6eed){for(var _0x21b92c=0x0;_0x21b92c<_0x2c6eed[_0xb897('0x43')];_0x21b92c+=0x1){var _0x3ecd6b=_0x2c6eed[_0x21b92c]['get']({'plain':!![]});_0x547573[_0xb897('0x9b')]=_0x2d0111[_0xb897('0x56')][_0xb897('0x9b')]?_0x2d0111[_0xb897('0x56')][_0xb897('0x9b')]:_0x547573[_0xb897('0x9b')];switch(_0x547573[_0xb897('0x9b')]){case'always':_0x3525b2=squel['insert']()[_0xb897('0x9c')](_0xb897('0x9d'))[_0xb897('0x9e')]([_0xb897('0x9f'),_0xb897('0xa0'),_0xb897('0xa1'),_0xb897('0xa2'),_0xb897('0x65'),_0xb897('0x5e'),_0xb897('0x5f')],squel[_0xb897('0x82')]()['field'](_0xb897('0x9f'),_0xb897('0x9f'))[_0xb897('0x83')](_0xb897('0xa3'),'scheduledAt')[_0xb897('0x83')]('id',_0xb897('0xa1'))['field'](_0x3ecd6b[_0xb897('0xa4')][_0xb897('0x89')](),'ListId')[_0xb897('0x83')](_0x2d0111[_0xb897('0x51')]['id'][_0xb897('0x89')](),_0xb897('0x65'))[_0xb897('0x83')](_0xb897('0xa3'),_0xb897('0x5e'))[_0xb897('0x83')](_0xb897('0xa3'),'updatedAt')[_0xb897('0x85')]('cm_contacts')[_0xb897('0x48')](_0xb897('0xa5'))['where'](_0xb897('0xa6'),_0x3ecd6b[_0xb897('0xa4')][_0xb897('0x89')]())[_0xb897('0x48')](_0xb897('0xa7'))[_0xb897('0x48')](_0xb897('0xa8'),squel[_0xb897('0x82')]()[_0xb897('0x83')](_0xb897('0xa9'))['from']('cm_hopper_final')[_0xb897('0x48')]('VoiceQueueId\x20=\x20?',_0x2d0111[_0xb897('0x51')]['id'][_0xb897('0x89')]()))[_0xb897('0x48')](_0xb897('0xa8'),squel[_0xb897('0x82')]()[_0xb897('0x83')](_0xb897('0xaa'))[_0xb897('0x85')]('cm_hopper')[_0xb897('0x48')](_0xb897('0xab'),_0x2d0111[_0xb897('0x51')]['id'][_0xb897('0x89')]())))[_0xb897('0x89')]();break;case _0xb897('0xac'):_0x3525b2=squel[_0xb897('0xad')]()[_0xb897('0x9c')]('cm_hopper')[_0xb897('0x9e')](['phone',_0xb897('0xa0'),'ContactId',_0xb897('0xa2'),'VoiceQueueId',_0xb897('0x5e'),'updatedAt'],squel[_0xb897('0x82')]()[_0xb897('0x83')](_0xb897('0x9f'),_0xb897('0x9f'))[_0xb897('0x83')](_0xb897('0xa3'),_0xb897('0xa0'))[_0xb897('0x83')]('id',_0xb897('0xa1'))[_0xb897('0x83')](_0x3ecd6b[_0xb897('0xa4')][_0xb897('0x89')](),_0xb897('0xa2'))['field'](_0x2d0111['params']['id'][_0xb897('0x89')](),'VoiceQueueId')[_0xb897('0x83')](_0xb897('0xa3'),_0xb897('0x5e'))[_0xb897('0x83')](_0xb897('0xa3'),_0xb897('0x5f'))['from']('cm_contacts')[_0xb897('0x48')](_0xb897('0xa5'))[_0xb897('0x48')](_0xb897('0xa6'),_0x3ecd6b[_0xb897('0xa4')][_0xb897('0x89')]())[_0xb897('0x48')](_0xb897('0xa7'))[_0xb897('0x48')](_0xb897('0xa8'),squel[_0xb897('0x82')]()['field'](_0xb897('0xaa'))['from'](_0xb897('0x9d'))[_0xb897('0x48')](_0xb897('0xab'),_0x2d0111[_0xb897('0x51')]['id']['toString']())))[_0xb897('0x89')]();break;default:_0x3525b2=squel['insert']()[_0xb897('0x9c')](_0xb897('0x9d'))[_0xb897('0x9e')]([_0xb897('0x9f'),_0xb897('0xa0'),_0xb897('0xa1'),_0xb897('0xa2'),_0xb897('0x65'),_0xb897('0x5e'),_0xb897('0x5f')],squel[_0xb897('0x82')]()[_0xb897('0x83')]('phone',_0xb897('0x9f'))[_0xb897('0x83')]('NOW()','scheduledAt')[_0xb897('0x83')]('id',_0xb897('0xa1'))[_0xb897('0x83')](_0x3ecd6b[_0xb897('0xa4')][_0xb897('0x89')](),_0xb897('0xa2'))[_0xb897('0x83')](_0x2d0111[_0xb897('0x51')]['id'][_0xb897('0x89')](),'VoiceQueueId')[_0xb897('0x83')]('NOW()','createdAt')[_0xb897('0x83')](_0xb897('0xa3'),_0xb897('0x5f'))[_0xb897('0x85')](_0xb897('0xae'))[_0xb897('0x48')](_0xb897('0xa5'))[_0xb897('0x48')](_0xb897('0xa6'),_0x3ecd6b[_0xb897('0xa4')][_0xb897('0x89')]())[_0xb897('0x48')](_0xb897('0xa7')))[_0xb897('0x89')]();}_0x39f3c1['push'](db[_0xb897('0x76')][_0xb897('0x3d')](_0x3525b2));}return BPromise['all'](_0x39f3c1);}})[_0xb897('0x28')](function(){return _0x4f6861;})[_0xb897('0x28')](respondWithResult(_0x2d54d5,null))[_0xb897('0x4f')](handleError(_0x2d54d5,null));};exports[_0xb897('0xaf')]=function(_0x2086c8,_0x1ee1b9,_0x2c3e84){return db[_0xb897('0x38')]['find']({'where':{'id':_0x2086c8[_0xb897('0x51')]['id']}})[_0xb897('0x28')](handleEntityNotFound(_0x1ee1b9,null))[_0xb897('0x28')](function(_0x262552){if(_0x262552){return _0x262552[_0xb897('0xaf')](_0x2086c8['query']['ids']);}})['then'](function(_0x2c9e57){if(_0x2c9e57){return db[_0xb897('0x64')][_0xb897('0x29')]({'where':{'ListId':_0x2086c8[_0xb897('0x3d')]['ids'],'VoiceQueueId':_0x2086c8[_0xb897('0x51')]['id']}})['then'](function(){return _0x2c9e57;});}})[_0xb897('0x28')](respondWithStatusCode(_0x1ee1b9,null))[_0xb897('0x4f')](handleError(_0x1ee1b9,null));};exports['getBlackLists']=function(_0x274541,_0x447110,_0x1e38a5){var _0x2dcae1={};var _0x1f0499={};var _0x3dcddd;var _0x4ac876;return db[_0xb897('0x38')]['findOne']({'where':{'id':_0x274541['params']['id']}})['then'](handleEntityNotFound(_0x447110,null))[_0xb897('0x28')](function(_0x3b3ef4){if(_0x3b3ef4){_0x3dcddd=_0x3b3ef4;_0x1f0499['model']=_['keys'](db[_0xb897('0x99')][_0xb897('0x39')]);_0x1f0499[_0xb897('0x3d')]=_['keys'](_0x274541[_0xb897('0x3d')]);_0x1f0499[_0xb897('0x3f')]=_['intersection'](_0x1f0499[_0xb897('0x3c')],_0x1f0499[_0xb897('0x3d')]);_0x2dcae1['attributes']=_[_0xb897('0x40')](_0x1f0499[_0xb897('0x3c')],qs['fields'](_0x274541[_0xb897('0x3d')][_0xb897('0x41')]));_0x2dcae1[_0xb897('0x42')]=_0x2dcae1[_0xb897('0x42')]['length']?_0x2dcae1[_0xb897('0x42')]:_0x1f0499[_0xb897('0x3c')];_0x2dcae1[_0xb897('0x46')]=qs['sort'](_0x274541[_0xb897('0x3d')]['sort']);_0x2dcae1[_0xb897('0x48')]=qs[_0xb897('0x3f')](_[_0xb897('0x49')](_0x274541[_0xb897('0x3d')],_0x1f0499[_0xb897('0x3f')]));if(_0x274541[_0xb897('0x3d')]['filter']){_0x2dcae1[_0xb897('0x48')]=_[_0xb897('0x4a')](_0x2dcae1[_0xb897('0x48')],{'$or':_['map'](_0x2dcae1[_0xb897('0x42')],function(_0x2d9d05){var _0x9660c1={};_0x9660c1[_0x2d9d05]={'$like':'%'+_0x274541[_0xb897('0x3d')]['filter']+'%'};return _0x9660c1;})});}_0x2dcae1=_[_0xb897('0x4a')]({},_0x2dcae1,_0x274541['options']);return _0x3dcddd[_0xb897('0xb0')](_0x2dcae1);}})[_0xb897('0x28')](function(_0xddbef6){if(_0xddbef6){_0x4ac876=_0xddbef6[_0xb897('0x43')];if(!_0x274541[_0xb897('0x3d')][_0xb897('0x44')](_0xb897('0x45'))){_0x2dcae1[_0xb897('0x21')]=qs[_0xb897('0x21')](_0x274541['query'][_0xb897('0x21')]);_0x2dcae1[_0xb897('0x22')]=qs['offset'](_0x274541[_0xb897('0x3d')][_0xb897('0x22')]);}return _0x3dcddd[_0xb897('0xb0')](_0x2dcae1);}})[_0xb897('0x28')](function(_0x202389){if(_0x202389){return _0x202389?{'count':_0x4ac876,'rows':_0x202389}:null;}})['then'](respondWithResult(_0x447110,null))[_0xb897('0x4f')](handleError(_0x447110,null));};exports[_0xb897('0xb1')]=function(_0x26c126,_0x3f6389,_0x416bd0){var _0x16336a,_0x54c7a7;return db['VoiceQueue'][_0xb897('0x54')]({'where':{'id':_0x26c126[_0xb897('0x51')]['id']}})[_0xb897('0x28')](handleEntityNotFound(_0x3f6389,null))[_0xb897('0x28')](function(_0x2c07cf){if(_0x2c07cf){_0x54c7a7=_0x2c07cf;return _0x2c07cf[_0xb897('0xb1')](_0x26c126['body']['ids'],_[_0xb897('0x5d')](_0x26c126[_0xb897('0x56')],[_0xb897('0x81'),'id'])||{});}return null;})[_0xb897('0xb2')](function(_0x14a95a){var _0x27a4d9;_0x16336a=_0x14a95a||[];var _0x2b833e=[];if(_0x14a95a){for(var _0x3f63a6=0x0;_0x3f63a6<_0x14a95a[_0xb897('0x43')];_0x3f63a6+=0x1){var _0x579a51=_0x14a95a[_0x3f63a6][_0xb897('0x2a')]({'plain':!![]});_0x27a4d9=squel[_0xb897('0xad')]()['into'](_0xb897('0xb3'))[_0xb897('0x9e')]([_0xb897('0x9f'),'ContactId','ListId',_0xb897('0x65'),'createdAt',_0xb897('0x5f')],squel['select']()[_0xb897('0x83')](_0xb897('0x9f'),'phone')[_0xb897('0x83')]('id',_0xb897('0xa1'))['field'](_0x579a51['CmListId'][_0xb897('0x89')](),_0xb897('0xa2'))[_0xb897('0x83')](_0x26c126['params']['id'][_0xb897('0x89')](),_0xb897('0x65'))[_0xb897('0x83')](_0xb897('0xa3'),_0xb897('0x5e'))[_0xb897('0x83')]('NOW()',_0xb897('0x5f'))[_0xb897('0x85')](_0xb897('0xae'))[_0xb897('0x48')]('deletedAt\x20IS\x20NULL')[_0xb897('0x48')](_0xb897('0xa6'),_0x579a51['CmListId'][_0xb897('0x89')]())[_0xb897('0x48')]('phone\x20IS\x20NOT\x20NULL'))['toString']();_0x2b833e[_0xb897('0x88')](db[_0xb897('0x76')][_0xb897('0x3d')](_0x27a4d9));}return BPromise[_0xb897('0x8e')](_0x2b833e);}})['then'](function(){return _0x16336a;})[_0xb897('0x28')](respondWithResult(_0x3f6389,null))[_0xb897('0x4f')](handleError(_0x3f6389,null));};exports['removeBlackLists']=function(_0x3e3eb4,_0x422a65,_0x5a28a8){return db['VoiceQueue'][_0xb897('0x54')]({'where':{'id':_0x3e3eb4[_0xb897('0x51')]['id']}})[_0xb897('0x28')](handleEntityNotFound(_0x422a65,null))['then'](function(_0x4c111c){if(_0x4c111c){return _0x4c111c['removeBlackLists'](_0x3e3eb4['query']['ids']);}})[_0xb897('0x28')](function(_0x28798f){if(_0x28798f){return db[_0xb897('0x6a')][_0xb897('0x29')]({'where':{'ListId':_0x3e3eb4[_0xb897('0x3d')][_0xb897('0x81')],'VoiceQueueId':_0x3e3eb4[_0xb897('0x51')]['id']}})[_0xb897('0x28')](function(){return _0x28798f;});}})[_0xb897('0x28')](respondWithStatusCode(_0x422a65,null))['catch'](handleError(_0x422a65,null));}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.events.js b/server/api/voiceQueue/voiceQueue.events.js index 82a691c..861b2b3 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 _0x956f=['events','../../mysqldb','save','remove','emit','hasOwnProperty','hook'];(function(_0x4a82ac,_0x1fb931){var _0x58ee97=function(_0xc7050a){while(--_0xc7050a){_0x4a82ac['push'](_0x4a82ac['shift']());}};_0x58ee97(++_0x1fb931);}(_0x956f,0x1ce));var _0xf956=function(_0x475aa9,_0x439aab){_0x475aa9=_0x475aa9-0x0;var _0x360bbc=_0x956f[_0x475aa9];return _0x360bbc;};'use strict';var EventEmitter=require(_0xf956('0x0'));var VoiceQueue=require(_0xf956('0x1'))['db']['VoiceQueue'];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xf956('0x2'),'afterUpdate':'update','afterDestroy':_0xf956('0x3')};function emitEvent(_0x3dbea6){return function(_0x10cfd2,_0x3d4c73,_0x4855a5){VoiceQueueEvents[_0xf956('0x4')](_0x3dbea6+':'+_0x10cfd2['id'],_0x10cfd2);VoiceQueueEvents[_0xf956('0x4')](_0x3dbea6,_0x10cfd2);_0x4855a5(null);};}for(var e in events){if(events[_0xf956('0x5')](e)){var event=events[e];VoiceQueue[_0xf956('0x6')](e,emitEvent(event));}}module['exports']=VoiceQueueEvents; \ No newline at end of file +var _0x3891=['hasOwnProperty','hook','exports','events','setMaxListeners','save','update','emit'];(function(_0x1d5fa8,_0x3ce250){var _0x5b7a39=function(_0x197e44){while(--_0x197e44){_0x1d5fa8['push'](_0x1d5fa8['shift']());}};_0x5b7a39(++_0x3ce250);}(_0x3891,0xcb));var _0x1389=function(_0xf0bc07,_0x510ebf){_0xf0bc07=_0xf0bc07-0x0;var _0x1c50c2=_0x3891[_0xf0bc07];return _0x1c50c2;};'use strict';var EventEmitter=require(_0x1389('0x0'));var VoiceQueue=require('../../mysqldb')['db']['VoiceQueue'];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0x1389('0x1')](0x0);var events={'afterCreate':_0x1389('0x2'),'afterUpdate':_0x1389('0x3'),'afterDestroy':'remove'};function emitEvent(_0x793a07){return function(_0xbd440a,_0x562852,_0x55c562){VoiceQueueEvents[_0x1389('0x4')](_0x793a07+':'+_0xbd440a['id'],_0xbd440a);VoiceQueueEvents['emit'](_0x793a07,_0xbd440a);_0x55c562(null);};}for(var e in events){if(events[_0x1389('0x5')](e)){var event=events[e];VoiceQueue[_0x1389('0x6')](e,emitEvent(event));}}module[_0x1389('0x7')]=VoiceQueueEvents; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.model.js b/server/api/voiceQueue/voiceQueue.model.js index 047aa4a..2c23734 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 _0xa9e0=['../../config/environment','./voiceQueue.attributes','exports','define','VoiceQueue','lodash','util','../../config/logger','bluebird','path','rimraf'];(function(_0x4007a4,_0x4c5b76){var _0x740ccc=function(_0x4ca65b){while(--_0x4ca65b){_0x4007a4['push'](_0x4007a4['shift']());}};_0x740ccc(++_0x4c5b76);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1b349a,_0x22222c){_0x1b349a=_0x1b349a-0x0;var _0x5d1f7c=_0xa9e0[_0x1b349a];return _0x5d1f7c;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var logger=require(_0x0a9e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0a9e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0a9e('0x4'));var rimraf=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var attributes=require(_0x0a9e('0x7'));module[_0x0a9e('0x8')]=function(_0x57b080,_0x219af0){return _0x57b080[_0x0a9e('0x9')](_0x0a9e('0xa'),attributes,{'tableName':'voice_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xedd9=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./voiceQueue.attributes','exports','VoiceQueue','util'];(function(_0x29e48a,_0x44ac3f){var _0x16a417=function(_0x4b7f31){while(--_0x4b7f31){_0x29e48a['push'](_0x29e48a['shift']());}};_0x16a417(++_0x44ac3f);}(_0xedd9,0xfc));var _0x9edd=function(_0x46fb50,_0x218e20){_0x46fb50=_0x46fb50-0x0;var _0x2c2940=_0xedd9[_0x46fb50];return _0x2c2940;};'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 0edaaf1..cb2d1b1 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 _0x9c07=['limit','include','model','map','debug','find','ShowVoiceQueue','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','client','redis','localhost','./voiceQueue.socket','register','request','then','info','VoiceQueue,\x20%s,\x20%s','request\x20sent','stringify','error','message','catch','GetVoiceQueue','VoiceQueue','findAll','options','raw','where','attributes'];(function(_0x49ebe8,_0xf60226){var _0x4290b0=function(_0x21f2b3){while(--_0x21f2b3){_0x49ebe8['push'](_0x49ebe8['shift']());}};_0x4290b0(++_0xf60226);}(_0x9c07,0xbb));var _0x79c0=function(_0x248031,_0x1eb4ea){_0x248031=_0x248031-0x0;var _0x2feafd=_0x9c07[_0x248031];return _0x2feafd;};'use strict';var _=require(_0x79c0('0x0'));var util=require(_0x79c0('0x1'));var moment=require(_0x79c0('0x2'));var BPromise=require(_0x79c0('0x3'));var rs=require(_0x79c0('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x79c0('0x5'))['db'];var utils=require(_0x79c0('0x6'));var logger=require('../../config/logger')(_0x79c0('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x79c0('0x8')]['http']({'port':0x232a});config[_0x79c0('0x9')]=_['defaults'](config['redis'],{'host':_0x79c0('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x79c0('0xb'))[_0x79c0('0xc')](socket);function respondWithRpcPromise(_0xb05c8b,_0x648c2a,_0x2c8273){return new BPromise(function(_0xcabee8,_0x19ab2d){return client[_0x79c0('0xd')](_0xb05c8b,_0x2c8273)[_0x79c0('0xe')](function(_0x52c386){logger[_0x79c0('0xf')](_0x79c0('0x10'),_0x648c2a,_0x79c0('0x11'));logger['debug']('VoiceQueue,\x20%s,\x20%s,\x20%s',_0x648c2a,_0x79c0('0x11'),JSON[_0x79c0('0x12')](_0x52c386));if(_0x52c386['error']){if(_0x52c386[_0x79c0('0x13')]['code']===0x1f4){logger[_0x79c0('0x13')](_0x79c0('0x10'),_0x648c2a,_0x52c386['error'][_0x79c0('0x14')]);return _0x19ab2d(_0x52c386['error'][_0x79c0('0x14')]);}logger[_0x79c0('0x13')](_0x79c0('0x10'),_0x648c2a,_0x52c386['error']['message']);return _0xcabee8(_0x52c386['error'][_0x79c0('0x14')]);}else{logger[_0x79c0('0xf')]('VoiceQueue,\x20%s,\x20%s',_0x648c2a,_0x79c0('0x11'));_0xcabee8(_0x52c386['result'][_0x79c0('0x14')]);}})[_0x79c0('0x15')](function(_0x105e77){logger[_0x79c0('0x13')]('VoiceQueue,\x20%s,\x20%s',_0x648c2a,_0x105e77);_0x19ab2d(_0x105e77);});});}exports[_0x79c0('0x16')]=function(_0x34af6b){var _0x30ab7f=this;return new Promise(function(_0x4f99b8,_0x82d7d0){return db[_0x79c0('0x17')][_0x79c0('0x18')]({'raw':_0x34af6b['options']?_0x34af6b[_0x79c0('0x19')][_0x79c0('0x1a')]===undefined?!![]:![]:!![],'where':_0x34af6b[_0x79c0('0x19')]?_0x34af6b[_0x79c0('0x19')][_0x79c0('0x1b')]||null:null,'attributes':_0x34af6b[_0x79c0('0x19')]?_0x34af6b[_0x79c0('0x19')][_0x79c0('0x1c')]||null:null,'limit':_0x34af6b[_0x79c0('0x19')]?_0x34af6b['options'][_0x79c0('0x1d')]||null:null,'include':_0x34af6b[_0x79c0('0x19')]?_0x34af6b[_0x79c0('0x19')]['include']?_['map'](_0x34af6b[_0x79c0('0x19')][_0x79c0('0x1e')],function(_0x22c9f5){return{'model':db[_0x22c9f5[_0x79c0('0x1f')]],'as':_0x22c9f5['as'],'attributes':_0x22c9f5['attributes'],'include':_0x22c9f5['include']?_[_0x79c0('0x20')](_0x22c9f5['include'],function(_0x415c2d){return{'model':db[_0x415c2d[_0x79c0('0x1f')]],'as':_0x415c2d['as'],'attributes':_0x415c2d['attributes'],'include':_0x415c2d[_0x79c0('0x1e')]?_[_0x79c0('0x20')](_0x415c2d[_0x79c0('0x1e')],function(_0xcce5e5){return{'model':db[_0xcce5e5[_0x79c0('0x1f')]],'as':_0xcce5e5['as'],'attributes':_0xcce5e5['attributes']};}):[]};}):[]};}):[]:[]})[_0x79c0('0xe')](function(_0x1795bc){logger[_0x79c0('0xf')]('GetVoiceQueue',_0x34af6b);logger[_0x79c0('0x21')](_0x79c0('0x16'),_0x34af6b,JSON[_0x79c0('0x12')](_0x1795bc));_0x4f99b8(_0x1795bc);})[_0x79c0('0x15')](function(_0xd81193){logger[_0x79c0('0x13')](_0x79c0('0x16'),_0xd81193[_0x79c0('0x14')],_0x34af6b);_0x82d7d0(_0x30ab7f[_0x79c0('0x13')](0x1f4,_0xd81193['message']));});});};exports['ShowVoiceQueue']=function(_0xb90733){var _0x1467fa=this;return new Promise(function(_0x1ff28e,_0x4bd5f9){return db[_0x79c0('0x17')][_0x79c0('0x22')]({'raw':_0xb90733['options']?_0xb90733[_0x79c0('0x19')][_0x79c0('0x1a')]===undefined?!![]:![]:!![],'where':_0xb90733[_0x79c0('0x19')]?_0xb90733[_0x79c0('0x19')][_0x79c0('0x1b')]||null:null,'attributes':_0xb90733['options']?_0xb90733[_0x79c0('0x19')]['attributes']||null:null,'include':_0xb90733['options']?_0xb90733[_0x79c0('0x19')][_0x79c0('0x1e')]?_['map'](_0xb90733[_0x79c0('0x19')][_0x79c0('0x1e')],function(_0x453a41){return{'model':db[_0x453a41[_0x79c0('0x1f')]],'as':_0x453a41['as'],'attributes':_0x453a41['attributes'],'include':_0x453a41[_0x79c0('0x1e')]?_[_0x79c0('0x20')](_0x453a41[_0x79c0('0x1e')],function(_0x5928cc){return{'model':db[_0x5928cc[_0x79c0('0x1f')]],'as':_0x5928cc['as'],'attributes':_0x5928cc[_0x79c0('0x1c')],'include':_0x5928cc['include']?_[_0x79c0('0x20')](_0x5928cc[_0x79c0('0x1e')],function(_0x5c6d26){return{'model':db[_0x5c6d26[_0x79c0('0x1f')]],'as':_0x5c6d26['as'],'attributes':_0x5c6d26[_0x79c0('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x79c0('0xe')](function(_0xedfff8){logger[_0x79c0('0xf')]('ShowVoiceQueue',_0xb90733);logger['debug'](_0x79c0('0x23'),_0xb90733,JSON[_0x79c0('0x12')](_0xedfff8));_0x1ff28e(_0xedfff8);})['catch'](function(_0x25bcb6){logger['error'](_0x79c0('0x23'),_0x25bcb6[_0x79c0('0x14')],_0xb90733);_0x4bd5f9(_0x1467fa[_0x79c0('0x13')](0x1f4,_0x25bcb6['message']));});});}; \ No newline at end of file +var _0x4c4b=['code','error','message','catch','GetVoiceQueue','VoiceQueue','findAll','options','raw','where','attributes','limit','include','model','map','ShowVoiceQueue','find','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','defaults','redis','socket.io-emitter','./voiceQueue.socket','register','request','then','info','VoiceQueue,\x20%s,\x20%s','debug','VoiceQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x4c4b,0x1df));var _0xb4c4=function(_0x32efcb,_0x55523f){_0x32efcb=_0x32efcb-0x0;var _0x1dae88=_0x4c4b[_0x32efcb];return _0x1dae88;};'use strict';var _=require(_0xb4c4('0x0'));var util=require(_0xb4c4('0x1'));var moment=require(_0xb4c4('0x2'));var BPromise=require(_0xb4c4('0x3'));var rs=require(_0xb4c4('0x4'));var fs=require('fs');var Redis=require(_0xb4c4('0x5'));var db=require(_0xb4c4('0x6'))['db'];var utils=require(_0xb4c4('0x7'));var logger=require(_0xb4c4('0x8'))('rpc');var config=require(_0xb4c4('0x9'));var jayson=require(_0xb4c4('0xa'));var client=jayson[_0xb4c4('0xb')]['http']({'port':0x232a});config['redis']=_[_0xb4c4('0xc')](config[_0xb4c4('0xd')],{'host':'localhost','port':0x18eb});var socket=require(_0xb4c4('0xe'))(new Redis(config[_0xb4c4('0xd')]));require(_0xb4c4('0xf'))[_0xb4c4('0x10')](socket);function respondWithRpcPromise(_0x2159b2,_0x433f86,_0x15bb35){return new BPromise(function(_0x462d7f,_0x42999e){return client[_0xb4c4('0x11')](_0x2159b2,_0x15bb35)[_0xb4c4('0x12')](function(_0x49caf9){logger[_0xb4c4('0x13')](_0xb4c4('0x14'),_0x433f86,'request\x20sent');logger[_0xb4c4('0x15')](_0xb4c4('0x16'),_0x433f86,_0xb4c4('0x17'),JSON[_0xb4c4('0x18')](_0x49caf9));if(_0x49caf9['error']){if(_0x49caf9['error'][_0xb4c4('0x19')]===0x1f4){logger[_0xb4c4('0x1a')](_0xb4c4('0x14'),_0x433f86,_0x49caf9['error'][_0xb4c4('0x1b')]);return _0x42999e(_0x49caf9[_0xb4c4('0x1a')][_0xb4c4('0x1b')]);}logger['error'](_0xb4c4('0x14'),_0x433f86,_0x49caf9[_0xb4c4('0x1a')][_0xb4c4('0x1b')]);return _0x462d7f(_0x49caf9['error']['message']);}else{logger['info'](_0xb4c4('0x14'),_0x433f86,'request\x20sent');_0x462d7f(_0x49caf9['result'][_0xb4c4('0x1b')]);}})[_0xb4c4('0x1c')](function(_0x461503){logger[_0xb4c4('0x1a')](_0xb4c4('0x14'),_0x433f86,_0x461503);_0x42999e(_0x461503);});});}exports[_0xb4c4('0x1d')]=function(_0x300884){var _0x4562f2=this;return new Promise(function(_0x710a7d,_0xc6efa3){return db[_0xb4c4('0x1e')][_0xb4c4('0x1f')]({'raw':_0x300884[_0xb4c4('0x20')]?_0x300884[_0xb4c4('0x20')][_0xb4c4('0x21')]===undefined?!![]:![]:!![],'where':_0x300884[_0xb4c4('0x20')]?_0x300884[_0xb4c4('0x20')][_0xb4c4('0x22')]||null:null,'attributes':_0x300884['options']?_0x300884['options'][_0xb4c4('0x23')]||null:null,'limit':_0x300884[_0xb4c4('0x20')]?_0x300884['options'][_0xb4c4('0x24')]||null:null,'include':_0x300884[_0xb4c4('0x20')]?_0x300884[_0xb4c4('0x20')][_0xb4c4('0x25')]?_['map'](_0x300884[_0xb4c4('0x20')][_0xb4c4('0x25')],function(_0x114042){return{'model':db[_0x114042[_0xb4c4('0x26')]],'as':_0x114042['as'],'attributes':_0x114042[_0xb4c4('0x23')],'include':_0x114042[_0xb4c4('0x25')]?_[_0xb4c4('0x27')](_0x114042[_0xb4c4('0x25')],function(_0x3340cd){return{'model':db[_0x3340cd[_0xb4c4('0x26')]],'as':_0x3340cd['as'],'attributes':_0x3340cd['attributes'],'include':_0x3340cd[_0xb4c4('0x25')]?_[_0xb4c4('0x27')](_0x3340cd['include'],function(_0x4cf812){return{'model':db[_0x4cf812[_0xb4c4('0x26')]],'as':_0x4cf812['as'],'attributes':_0x4cf812[_0xb4c4('0x23')]};}):[]};}):[]};}):[]:[]})[_0xb4c4('0x12')](function(_0x331daa){logger[_0xb4c4('0x13')]('GetVoiceQueue',_0x300884);logger[_0xb4c4('0x15')](_0xb4c4('0x1d'),_0x300884,JSON[_0xb4c4('0x18')](_0x331daa));_0x710a7d(_0x331daa);})[_0xb4c4('0x1c')](function(_0x371519){logger['error'](_0xb4c4('0x1d'),_0x371519[_0xb4c4('0x1b')],_0x300884);_0xc6efa3(_0x4562f2[_0xb4c4('0x1a')](0x1f4,_0x371519[_0xb4c4('0x1b')]));});});};exports[_0xb4c4('0x28')]=function(_0x20794d){var _0x3410d7=this;return new Promise(function(_0x1a26f7,_0x1834a4){return db[_0xb4c4('0x1e')][_0xb4c4('0x29')]({'raw':_0x20794d['options']?_0x20794d[_0xb4c4('0x20')][_0xb4c4('0x21')]===undefined?!![]:![]:!![],'where':_0x20794d['options']?_0x20794d[_0xb4c4('0x20')]['where']||null:null,'attributes':_0x20794d[_0xb4c4('0x20')]?_0x20794d[_0xb4c4('0x20')][_0xb4c4('0x23')]||null:null,'include':_0x20794d[_0xb4c4('0x20')]?_0x20794d[_0xb4c4('0x20')][_0xb4c4('0x25')]?_['map'](_0x20794d[_0xb4c4('0x20')][_0xb4c4('0x25')],function(_0x32540f){return{'model':db[_0x32540f['model']],'as':_0x32540f['as'],'attributes':_0x32540f[_0xb4c4('0x23')],'include':_0x32540f[_0xb4c4('0x25')]?_[_0xb4c4('0x27')](_0x32540f[_0xb4c4('0x25')],function(_0x4852ef){return{'model':db[_0x4852ef[_0xb4c4('0x26')]],'as':_0x4852ef['as'],'attributes':_0x4852ef[_0xb4c4('0x23')],'include':_0x4852ef[_0xb4c4('0x25')]?_[_0xb4c4('0x27')](_0x4852ef[_0xb4c4('0x25')],function(_0x1913c5){return{'model':db[_0x1913c5[_0xb4c4('0x26')]],'as':_0x1913c5['as'],'attributes':_0x1913c5['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x5f3919){logger[_0xb4c4('0x13')](_0xb4c4('0x28'),_0x20794d);logger[_0xb4c4('0x15')]('ShowVoiceQueue',_0x20794d,JSON[_0xb4c4('0x18')](_0x5f3919));_0x1a26f7(_0x5f3919);})['catch'](function(_0x16cd92){logger[_0xb4c4('0x1a')](_0xb4c4('0x28'),_0x16cd92[_0xb4c4('0x1b')],_0x20794d);_0x1834a4(_0x3410d7[_0xb4c4('0x1a')](0x1f4,_0x16cd92[_0xb4c4('0x1b')]));});});}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.socket.js b/server/api/voiceQueue/voiceQueue.socket.js index aaba52b..df6ec38 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 _0x057c=['save','remove','update','emit','removeListener','register','length','voiceQueue:','./voiceQueue.events'];(function(_0x41413a,_0x29f12a){var _0x36fac4=function(_0x48fb96){while(--_0x48fb96){_0x41413a['push'](_0x41413a['shift']());}};_0x36fac4(++_0x29f12a);}(_0x057c,0x1ee));var _0xc057=function(_0x1f75c5,_0x37dbdb){_0x1f75c5=_0x1f75c5-0x0;var _0x58278f=_0x057c[_0x1f75c5];return _0x58278f;};'use strict';var VoiceQueueEvents=require(_0xc057('0x0'));var events=[_0xc057('0x1'),_0xc057('0x2'),_0xc057('0x3')];function createListener(_0x4d92c7,_0x3d05d5){return function(_0x163132){_0x3d05d5[_0xc057('0x4')](_0x4d92c7,_0x163132);};}function removeListener(_0x223e74,_0x4c534b){return function(){VoiceQueueEvents[_0xc057('0x5')](_0x223e74,_0x4c534b);};}exports[_0xc057('0x6')]=function(_0x1d4242){for(var _0x185af2=0x0,_0xe61982=events[_0xc057('0x7')];_0x185af2<_0xe61982;_0x185af2++){var _0xbd0af8=events[_0x185af2];var _0x221891=createListener(_0xc057('0x8')+_0xbd0af8,_0x1d4242);VoiceQueueEvents['on'](_0xbd0af8,_0x221891);}}; \ No newline at end of file +var _0xe4e4=['save','remove','update','removeListener','register','length','voiceQueue:'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe4e4,0x7e));var _0x4e4e=function(_0x18b6f8,_0x2787e6){_0x18b6f8=_0x18b6f8-0x0;var _0x42f3c8=_0xe4e4[_0x18b6f8];return _0x42f3c8;};'use strict';var VoiceQueueEvents=require('./voiceQueue.events');var events=[_0x4e4e('0x0'),_0x4e4e('0x1'),_0x4e4e('0x2')];function createListener(_0x2e4d6f,_0x5663b4){return function(_0x28dbf7){_0x5663b4['emit'](_0x2e4d6f,_0x28dbf7);};}function removeListener(_0xe358f3,_0x59e14a){return function(){VoiceQueueEvents[_0x4e4e('0x3')](_0xe358f3,_0x59e14a);};}exports[_0x4e4e('0x4')]=function(_0x4eef47){for(var _0x34888b=0x0,_0x26f882=events[_0x4e4e('0x5')];_0x34888b<_0x26f882;_0x34888b++){var _0x2dad6a=events[_0x34888b];var _0xf70a82=createListener(_0x4e4e('0x6')+_0x2dad6a,_0x4eef47);VoiceQueueEvents['on'](_0x2dad6a,_0xf70a82);}}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/index.js b/server/api/voiceQueueReport/index.js index 67f38cb..4180978 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 _0x2a45=['destroy','multer','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/index','getVoiceQueuesReport','show','post','create','put','/:id','delete'];(function(_0x41db7b,_0x204cfa){var _0x3f80ec=function(_0x5c68f8){while(--_0x5c68f8){_0x41db7b['push'](_0x41db7b['shift']());}};_0x3f80ec(++_0x204cfa);}(_0x2a45,0xfd));var _0x52a4=function(_0x1928c9,_0x13a6d1){_0x1928c9=_0x1928c9-0x0;var _0x51b5fb=_0x2a45[_0x1928c9];return _0x51b5fb;};'use strict';var multer=require(_0x52a4('0x0'));var util=require('util');var path=require(_0x52a4('0x1'));var timeout=require(_0x52a4('0x2'));var express=require(_0x52a4('0x3'));var router=express[_0x52a4('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x52a4('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x52a4('0x6'));var controller=require('./voiceQueueReport.controller');router[_0x52a4('0x7')]('/',auth[_0x52a4('0x8')](),controller[_0x52a4('0x9')]);router[_0x52a4('0x7')](_0x52a4('0xa'),auth[_0x52a4('0x8')](),controller[_0x52a4('0xb')]);router[_0x52a4('0x7')](_0x52a4('0xc'),auth['isAuthenticated'](),controller[_0x52a4('0xd')]);router[_0x52a4('0x7')]('/:id',auth['isAuthenticated'](),controller[_0x52a4('0xe')]);router[_0x52a4('0xf')]('/',auth[_0x52a4('0x8')](),controller[_0x52a4('0x10')]);router[_0x52a4('0x11')](_0x52a4('0x12'),auth[_0x52a4('0x8')](),controller['update']);router[_0x52a4('0x13')](_0x52a4('0x12'),auth[_0x52a4('0x8')](),controller[_0x52a4('0x14')]);module['exports']=router; \ No newline at end of file +var _0xb60c=['../../config/environment','./voiceQueueReport.controller','get','isAuthenticated','index','/describe','describe','/index','getVoiceQueuesReport','/:id','show','post','create','put','update','destroy','exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x28bcbc,_0x30ec21){var _0x3a814e=function(_0x175dc0){while(--_0x175dc0){_0x28bcbc['push'](_0x28bcbc['shift']());}};_0x3a814e(++_0x30ec21);}(_0xb60c,0x84));var _0xcb60=function(_0x477d71,_0x393bd2){_0x477d71=_0x477d71-0x0;var _0x4c71a4=_0xb60c[_0x477d71];return _0x4c71a4;};'use strict';var multer=require(_0xcb60('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xcb60('0x1'));var express=require(_0xcb60('0x2'));var router=express[_0xcb60('0x3')]();var fs_extra=require(_0xcb60('0x4'));var auth=require(_0xcb60('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xcb60('0x6'));var controller=require(_0xcb60('0x7'));router[_0xcb60('0x8')]('/',auth[_0xcb60('0x9')](),controller[_0xcb60('0xa')]);router[_0xcb60('0x8')](_0xcb60('0xb'),auth[_0xcb60('0x9')](),controller[_0xcb60('0xc')]);router[_0xcb60('0x8')](_0xcb60('0xd'),auth['isAuthenticated'](),controller[_0xcb60('0xe')]);router[_0xcb60('0x8')](_0xcb60('0xf'),auth[_0xcb60('0x9')](),controller[_0xcb60('0x10')]);router[_0xcb60('0x11')]('/',auth[_0xcb60('0x9')](),controller[_0xcb60('0x12')]);router[_0xcb60('0x13')](_0xcb60('0xf'),auth[_0xcb60('0x9')](),controller[_0xcb60('0x14')]);router['delete'](_0xcb60('0xf'),auth[_0xcb60('0x9')](),controller[_0xcb60('0x15')]);module[_0xcb60('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 8ed91cb..9a0c15d 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 _0xe1ca=['setDataValue','holdtime','INTEGER','BOOLEAN','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','STRING','DATE','getDataValue','queuecallerjoinAt','format','YYYY-MM-DD\x20HH:mm:ss','diff','seconds'];(function(_0x3bd2c8,_0x395b96){var _0x25374f=function(_0x5ee528){while(--_0x5ee528){_0x3bd2c8['push'](_0x3bd2c8['shift']());}};_0x25374f(++_0x395b96);}(_0xe1ca,0x12b));var _0xae1c=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xe1ca[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0xae1c('0x0'));var moment=require('moment');module['exports']={'type':{'type':Sequelize[_0xae1c('0x1')]},'uniqueid':{'type':Sequelize[_0xae1c('0x1')]},'calleridnum':{'type':Sequelize[_0xae1c('0x1')]},'calleridname':{'type':Sequelize[_0xae1c('0x1')]},'queue':{'type':Sequelize[_0xae1c('0x1')]},'queuecallerjoinAt':{'type':Sequelize[_0xae1c('0x2')]},'queuecallerleaveAt':{'type':Sequelize['DATE'],'set':function(_0x1eca35){var _0x23c7bf=moment(_0x1eca35);var _0x1383e1=moment(this[_0xae1c('0x3')](_0xae1c('0x4')))[_0xae1c('0x5')](_0xae1c('0x6'));var _0x3ebedc=_0x23c7bf[_0xae1c('0x7')](_0x1383e1,_0xae1c('0x8'));this[_0xae1c('0x9')]('queuecallerleaveAt',_0x1eca35);this[_0xae1c('0x9')](_0xae1c('0xa'),_0x3ebedc||null);}},'position':{'type':Sequelize[_0xae1c('0xb')]},'count':{'type':Sequelize[_0xae1c('0xb')]},'queuecallerabandon':{'type':Sequelize[_0xae1c('0xc')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize[_0xae1c('0x2')]},'queuecallercomplete':{'type':Sequelize[_0xae1c('0xc')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0xae1c('0x2')]},'queuecallerexit':{'type':Sequelize[_0xae1c('0xc')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize[_0xae1c('0x2')]},'queuecallerexitreason':{'type':Sequelize[_0xae1c('0x1')],'comment':'COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT'},'originalposition':{'type':Sequelize[_0xae1c('0xb')]},'channel':{'type':Sequelize[_0xae1c('0x1')]},'connectedlinenum':{'type':Sequelize[_0xae1c('0x1')]},'connectedlinename':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0xae1c('0x1')]},'context':{'type':Sequelize[_0xae1c('0x1')]},'exten':{'type':Sequelize[_0xae1c('0x1')]},'priority':{'type':Sequelize[_0xae1c('0x1')]},'holdtime':{'type':Sequelize[_0xae1c('0xb')]},'mohtime':{'type':Sequelize[_0xae1c('0xb')],'defaultValue':0x0},'assigned':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize[_0xae1c('0x1')]},'transfer':{'type':Sequelize[_0xae1c('0xc')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0xae1c('0x1')],'comment':_0xae1c('0xd')},'transferexten':{'type':Sequelize[_0xae1c('0x1')]},'transferuniqueid':{'type':Sequelize[_0xae1c('0x1')]},'disposition':{'type':Sequelize[_0xae1c('0x1')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0xae1c('0x1')]},'queuecallerenterreason':{'type':Sequelize[_0xae1c('0xb')],'defaultValue':0x0}}; \ No newline at end of file +var _0xb96a=['STRING','DATE','getDataValue','queuecallerjoinAt','format','YYYY-MM-DD\x20HH:mm:ss','diff','seconds','setDataValue','queuecallerleaveAt','holdtime','INTEGER','BOOLEAN','COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','exports'];(function(_0x6131cd,_0x4c26a1){var _0x47e916=function(_0x1f2bce){while(--_0x1f2bce){_0x6131cd['push'](_0x6131cd['shift']());}};_0x47e916(++_0x4c26a1);}(_0xb96a,0x196));var _0xab96=function(_0x16675d,_0x1e957f){_0x16675d=_0x16675d-0x0;var _0x558145=_0xb96a[_0x16675d];return _0x558145;};'use strict';var Sequelize=require(_0xab96('0x0'));var moment=require('moment');module[_0xab96('0x1')]={'type':{'type':Sequelize[_0xab96('0x2')]},'uniqueid':{'type':Sequelize[_0xab96('0x2')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0xab96('0x2')]},'queue':{'type':Sequelize[_0xab96('0x2')]},'queuecallerjoinAt':{'type':Sequelize['DATE']},'queuecallerleaveAt':{'type':Sequelize[_0xab96('0x3')],'set':function(_0x219489){var _0x593c84=moment(_0x219489);var _0x5d4eee=moment(this[_0xab96('0x4')](_0xab96('0x5')))[_0xab96('0x6')](_0xab96('0x7'));var _0xf62c9f=_0x593c84[_0xab96('0x8')](_0x5d4eee,_0xab96('0x9'));this[_0xab96('0xa')](_0xab96('0xb'),_0x219489);this[_0xab96('0xa')](_0xab96('0xc'),_0xf62c9f||null);}},'position':{'type':Sequelize['INTEGER']},'count':{'type':Sequelize[_0xab96('0xd')]},'queuecallerabandon':{'type':Sequelize[_0xab96('0xe')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize[_0xab96('0x3')]},'queuecallercomplete':{'type':Sequelize[_0xab96('0xe')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0xab96('0x3')]},'queuecallerexit':{'type':Sequelize[_0xab96('0xe')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize[_0xab96('0x3')]},'queuecallerexitreason':{'type':Sequelize[_0xab96('0x2')],'comment':_0xab96('0xf')},'originalposition':{'type':Sequelize[_0xab96('0xd')]},'channel':{'type':Sequelize[_0xab96('0x2')]},'connectedlinenum':{'type':Sequelize[_0xab96('0x2')]},'connectedlinename':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0xab96('0x2')]},'context':{'type':Sequelize[_0xab96('0x2')]},'exten':{'type':Sequelize[_0xab96('0x2')]},'priority':{'type':Sequelize[_0xab96('0x2')]},'holdtime':{'type':Sequelize[_0xab96('0xd')]},'mohtime':{'type':Sequelize[_0xab96('0xd')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0xab96('0xe')],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize[_0xab96('0x2')]},'transfer':{'type':Sequelize[_0xab96('0xe')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0xab96('0x2')],'comment':_0xab96('0x10')},'transferexten':{'type':Sequelize[_0xab96('0x2')]},'transferuniqueid':{'type':Sequelize['STRING']},'disposition':{'type':Sequelize[_0xab96('0x2')]},'secondDisposition':{'type':Sequelize[_0xab96('0x2')]},'thirdDisposition':{'type':Sequelize[_0xab96('0x2')]},'queuecallerenterreason':{'type':Sequelize[_0xab96('0xd')],'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 f3e98d1..4490d20 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 _0xef27=['show','params','rawAttributes','find','create','body','update','destroy','describe','getVoiceQueuesReport','hasOwnProperty','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','status','offset','undefined','count','limit','set','Content-Range','json','apply','reject','save','then','end','sendStatus','name','send','index','map','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','order','sort','where','pick','filter','merge','options','VoiceQueueReport','includeAll','include','findAll','catch'];(function(_0x531f78,_0x547c01){var _0x3feabd=function(_0xfa56e3){while(--_0xfa56e3){_0x531f78['push'](_0x531f78['shift']());}};_0x3feabd(++_0x547c01);}(_0xef27,0xaf));var _0x7ef2=function(_0x23448c,_0x527d1a){_0x23448c=_0x23448c-0x0;var _0x5f32b8=_0xef27[_0x23448c];return _0x5f32b8;};'use strict';var emlformat=require(_0x7ef2('0x0'));var rimraf=require(_0x7ef2('0x1'));var zipdir=require(_0x7ef2('0x2'));var jsonpatch=require(_0x7ef2('0x3'));var rp=require(_0x7ef2('0x4'));var moment=require(_0x7ef2('0x5'));var BPromise=require(_0x7ef2('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0x7ef2('0x7'));var sox=require(_0x7ef2('0x8'));var csv=require(_0x7ef2('0x9'));var ejs=require(_0x7ef2('0xa'));var fs=require('fs');var fs_extra=require(_0x7ef2('0xb'));var _=require(_0x7ef2('0xc'));var squel=require('squel');var crypto=require(_0x7ef2('0xd'));var jsforce=require(_0x7ef2('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x7ef2('0xf'));var Papa=require(_0x7ef2('0x10'));var Redis=require(_0x7ef2('0x11'));var authService=require(_0x7ef2('0x12'));var qs=require(_0x7ef2('0x13'));var as=require(_0x7ef2('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x7ef2('0x15'));var utils=require('../../config/utils');var config=require(_0x7ef2('0x16'));var licenseUtil=require(_0x7ef2('0x17'));var db=require(_0x7ef2('0x18'))['db'];config[_0x7ef2('0x19')]=_[_0x7ef2('0x1a')](config[_0x7ef2('0x19')],{'host':_0x7ef2('0x1b'),'port':0x18eb});var socket=require(_0x7ef2('0x1c'))(new Redis(config[_0x7ef2('0x19')]));require('./voiceQueueReport.socket')[_0x7ef2('0x1d')](socket);function respondWithStatusCode(_0x2d6b04,_0x568c15){_0x568c15=_0x568c15||0xcc;return function(_0x3c810a){if(_0x3c810a){return _0x2d6b04['sendStatus'](_0x568c15);}return _0x2d6b04[_0x7ef2('0x1e')](_0x568c15)['end']();};}function respondWithResult(_0x306dce,_0x1b85c4){_0x1b85c4=_0x1b85c4||0xc8;return function(_0x398e37){if(_0x398e37){return _0x306dce[_0x7ef2('0x1e')](_0x1b85c4)['json'](_0x398e37);}};}function respondWithFilteredResult(_0x1e63a1,_0x7183fa){return function(_0x3a5e3e){if(_0x3a5e3e){var _0x192a5a=typeof _0x7183fa[_0x7ef2('0x1f')]===_0x7ef2('0x20')&&typeof _0x7183fa['limit']===_0x7ef2('0x20');var _0x40aa35=_0x3a5e3e[_0x7ef2('0x21')];var _0x3fecae=_0x192a5a?0x0:_0x7183fa[_0x7ef2('0x1f')];var _0x4386e6=_0x192a5a?_0x3a5e3e[_0x7ef2('0x21')]:_0x7183fa[_0x7ef2('0x1f')]+_0x7183fa[_0x7ef2('0x22')];var _0x81cb;if(_0x4386e6>=_0x40aa35){_0x4386e6=_0x40aa35;_0x81cb=0xc8;}else{_0x81cb=0xce;}_0x1e63a1[_0x7ef2('0x1e')](_0x81cb);return _0x1e63a1[_0x7ef2('0x23')](_0x7ef2('0x24'),_0x3fecae+'-'+_0x4386e6+'/'+_0x40aa35)[_0x7ef2('0x25')](_0x3a5e3e);}return null;};}function patchUpdates(_0x2e97e8){return function(_0xb0703b){try{jsonpatch[_0x7ef2('0x26')](_0xb0703b,_0x2e97e8,!![]);}catch(_0x53aad6){return BPromise[_0x7ef2('0x27')](_0x53aad6);}return _0xb0703b[_0x7ef2('0x28')]();};}function saveUpdates(_0x179b5c,_0x41102b){return function(_0x386756){if(_0x386756){return _0x386756['update'](_0x179b5c)['then'](function(_0x1ba0e0){return _0x1ba0e0;});}return null;};}function removeEntity(_0x390fc3,_0x36649b){return function(_0x423b90){if(_0x423b90){return _0x423b90['destroy']()[_0x7ef2('0x29')](function(){_0x390fc3[_0x7ef2('0x1e')](0xcc)[_0x7ef2('0x2a')]();});}};}function handleEntityNotFound(_0x4a3c2d,_0x171d15){return function(_0x2b76f1){if(!_0x2b76f1){_0x4a3c2d[_0x7ef2('0x2b')](0x194);}return _0x2b76f1;};}function handleError(_0x1c5fa1,_0x1ad1ff){_0x1ad1ff=_0x1ad1ff||0x1f4;return function(_0x23ebea){logger['error'](_0x23ebea['stack']);if(_0x23ebea[_0x7ef2('0x2c')]){delete _0x23ebea[_0x7ef2('0x2c')];}_0x1c5fa1[_0x7ef2('0x1e')](_0x1ad1ff)[_0x7ef2('0x2d')](_0x23ebea);};}exports[_0x7ef2('0x2e')]=function(_0x384e32,_0x48386b){var _0x5f18c2={},_0x20ab67={},_0xfa59d0={'count':0x0,'rows':[]};var _0xbbc5ea=_[_0x7ef2('0x2f')](db['VoiceQueueReport']['rawAttributes'],function(_0x32b84f){return{'name':_0x32b84f[_0x7ef2('0x30')],'type':_0x32b84f[_0x7ef2('0x31')][_0x7ef2('0x32')]};});_0x20ab67['model']=_[_0x7ef2('0x2f')](_0xbbc5ea,_0x7ef2('0x2c'));_0x20ab67[_0x7ef2('0x33')]=_[_0x7ef2('0x34')](_0x384e32[_0x7ef2('0x33')]);_0x20ab67[_0x7ef2('0x35')]=_[_0x7ef2('0x36')](_0x20ab67[_0x7ef2('0x37')],_0x20ab67['query']);_0x5f18c2[_0x7ef2('0x38')]=_[_0x7ef2('0x36')](_0x20ab67[_0x7ef2('0x37')],qs[_0x7ef2('0x39')](_0x384e32[_0x7ef2('0x33')][_0x7ef2('0x39')]));_0x5f18c2['attributes']=_0x5f18c2[_0x7ef2('0x38')][_0x7ef2('0x3a')]?_0x5f18c2['attributes']:_0x20ab67[_0x7ef2('0x37')];if(!_0x384e32[_0x7ef2('0x33')]['hasOwnProperty']('nolimit')){_0x5f18c2[_0x7ef2('0x22')]=qs[_0x7ef2('0x22')](_0x384e32[_0x7ef2('0x33')][_0x7ef2('0x22')]);_0x5f18c2['offset']=qs['offset'](_0x384e32['query'][_0x7ef2('0x1f')]);}_0x5f18c2[_0x7ef2('0x3b')]=qs['sort'](_0x384e32[_0x7ef2('0x33')][_0x7ef2('0x3c')]);_0x5f18c2[_0x7ef2('0x3d')]=qs[_0x7ef2('0x35')](_[_0x7ef2('0x3e')](_0x384e32['query'],_0x20ab67[_0x7ef2('0x35')]),_0xbbc5ea);if(_0x384e32[_0x7ef2('0x33')][_0x7ef2('0x3f')]){_0x5f18c2[_0x7ef2('0x3d')]=_[_0x7ef2('0x40')](_0x5f18c2[_0x7ef2('0x3d')],{'$or':_[_0x7ef2('0x2f')](_0xbbc5ea,function(_0x253a28){if(_0x253a28['type']!=='VIRTUAL'){var _0x2af799={};_0x2af799[_0x253a28['name']]={'$like':'%'+_0x384e32[_0x7ef2('0x33')][_0x7ef2('0x3f')]+'%'};return _0x2af799;}})});}_0x5f18c2=_[_0x7ef2('0x40')]({},_0x5f18c2,_0x384e32[_0x7ef2('0x41')]);var _0x5a8aa2={'where':_0x5f18c2[_0x7ef2('0x3d')]};return db[_0x7ef2('0x42')][_0x7ef2('0x21')](_0x5a8aa2)['then'](function(_0x23d8f8){_0xfa59d0[_0x7ef2('0x21')]=_0x23d8f8;if(_0x384e32['query'][_0x7ef2('0x43')]){_0x5f18c2[_0x7ef2('0x44')]=[{'all':!![]}];}return db[_0x7ef2('0x42')][_0x7ef2('0x45')](_0x5f18c2);})[_0x7ef2('0x29')](function(_0xcd82c9){_0xfa59d0['rows']=_0xcd82c9;return _0xfa59d0;})[_0x7ef2('0x29')](respondWithFilteredResult(_0x48386b,_0x5f18c2))[_0x7ef2('0x46')](handleError(_0x48386b,null));};exports[_0x7ef2('0x47')]=function(_0x1c707b,_0xed4a6d){var _0x28ce68={'raw':![],'where':{'id':_0x1c707b[_0x7ef2('0x48')]['id']}},_0x3225de={};_0x3225de[_0x7ef2('0x37')]=_['keys'](db['VoiceQueueReport'][_0x7ef2('0x49')]);_0x3225de[_0x7ef2('0x33')]=_['keys'](_0x1c707b['query']);_0x3225de[_0x7ef2('0x35')]=_['intersection'](_0x3225de[_0x7ef2('0x37')],_0x3225de['query']);_0x28ce68[_0x7ef2('0x38')]=_[_0x7ef2('0x36')](_0x3225de[_0x7ef2('0x37')],qs['fields'](_0x1c707b[_0x7ef2('0x33')][_0x7ef2('0x39')]));_0x28ce68[_0x7ef2('0x38')]=_0x28ce68['attributes'][_0x7ef2('0x3a')]?_0x28ce68['attributes']:_0x3225de[_0x7ef2('0x37')];if(_0x1c707b[_0x7ef2('0x33')][_0x7ef2('0x43')]){_0x28ce68[_0x7ef2('0x44')]=[{'all':!![]}];}_0x28ce68=_[_0x7ef2('0x40')]({},_0x28ce68,_0x1c707b[_0x7ef2('0x41')]);return db[_0x7ef2('0x42')][_0x7ef2('0x4a')](_0x28ce68)[_0x7ef2('0x29')](handleEntityNotFound(_0xed4a6d,null))[_0x7ef2('0x29')](respondWithResult(_0xed4a6d,null))[_0x7ef2('0x46')](handleError(_0xed4a6d,null));};exports[_0x7ef2('0x4b')]=function(_0x84bf6b,_0x2b01d1){return db[_0x7ef2('0x42')][_0x7ef2('0x4b')](_0x84bf6b[_0x7ef2('0x4c')],{})[_0x7ef2('0x29')](respondWithResult(_0x2b01d1,0xc9))[_0x7ef2('0x46')](handleError(_0x2b01d1,null));};exports[_0x7ef2('0x4d')]=function(_0x130c2a,_0x24fd78){if(_0x130c2a[_0x7ef2('0x4c')]['id']){delete _0x130c2a[_0x7ef2('0x4c')]['id'];}return db[_0x7ef2('0x42')][_0x7ef2('0x4a')]({'where':{'id':_0x130c2a['params']['id']}})[_0x7ef2('0x29')](handleEntityNotFound(_0x24fd78,null))['then'](saveUpdates(_0x130c2a[_0x7ef2('0x4c')],null))['then'](respondWithResult(_0x24fd78,null))['catch'](handleError(_0x24fd78,null));};exports[_0x7ef2('0x4e')]=function(_0x1f5b5b,_0x18282d){return db['VoiceQueueReport']['find']({'where':{'id':_0x1f5b5b[_0x7ef2('0x48')]['id']}})[_0x7ef2('0x29')](handleEntityNotFound(_0x18282d,null))['then'](removeEntity(_0x18282d,null))[_0x7ef2('0x46')](handleError(_0x18282d,null));};exports[_0x7ef2('0x4f')]=function(_0xb25b04,_0x491d0c){return db[_0x7ef2('0x42')][_0x7ef2('0x4f')]()[_0x7ef2('0x29')](respondWithResult(_0x491d0c,null))[_0x7ef2('0x46')](handleError(_0x491d0c,null));};exports[_0x7ef2('0x50')]=function(_0x5c9614,_0x350d8b){var _0x616771={},_0x2e2ce1={},_0x24be5a={'count':0x0,'rows':[]};_0x2e2ce1[_0x7ef2('0x37')]=_[_0x7ef2('0x34')](db[_0x7ef2('0x42')][_0x7ef2('0x49')]);_0x2e2ce1[_0x7ef2('0x33')]=_['keys'](_0x5c9614[_0x7ef2('0x33')]);_0x2e2ce1[_0x7ef2('0x35')]=_[_0x7ef2('0x36')](_0x2e2ce1[_0x7ef2('0x37')],_0x2e2ce1[_0x7ef2('0x33')]);_0x616771[_0x7ef2('0x38')]=_[_0x7ef2('0x36')](_0x2e2ce1[_0x7ef2('0x37')],qs[_0x7ef2('0x39')](_0x5c9614[_0x7ef2('0x33')][_0x7ef2('0x39')]));_0x616771[_0x7ef2('0x38')]=_0x616771[_0x7ef2('0x38')][_0x7ef2('0x3a')]?_0x616771[_0x7ef2('0x38')]:_0x2e2ce1[_0x7ef2('0x37')];if(!_0x5c9614[_0x7ef2('0x33')][_0x7ef2('0x51')]('nolimit')){_0x616771[_0x7ef2('0x22')]=qs[_0x7ef2('0x22')](_0x5c9614[_0x7ef2('0x33')][_0x7ef2('0x22')]);_0x616771[_0x7ef2('0x1f')]=qs['offset'](_0x5c9614['query'][_0x7ef2('0x1f')]);}_0x616771['order']=qs[_0x7ef2('0x3c')](_0x5c9614[_0x7ef2('0x33')][_0x7ef2('0x3c')]);_0x616771['where']=qs[_0x7ef2('0x35')](_[_0x7ef2('0x3e')](_0x5c9614['query'],_0x2e2ce1[_0x7ef2('0x35')]));if(_0x5c9614['query'][_0x7ef2('0x3f')]){_0x616771[_0x7ef2('0x3d')]=_[_0x7ef2('0x40')](_0x616771[_0x7ef2('0x3d')],{'$or':_['map'](_0x616771[_0x7ef2('0x38')],function(_0x48b251){var _0x5850ee={};_0x5850ee[_0x48b251]={'$like':'%'+_0x5c9614[_0x7ef2('0x33')]['filter']+'%'};return _0x5850ee;})});}_0x616771=_['merge']({},_0x616771,_0x5c9614['options']);var _0x742ea0={'where':_0x616771[_0x7ef2('0x3d')]};return db[_0x7ef2('0x42')][_0x7ef2('0x21')](_0x742ea0)[_0x7ef2('0x29')](function(_0x28de1d){_0x24be5a[_0x7ef2('0x21')]=_0x28de1d;if(_0x5c9614['query'][_0x7ef2('0x43')]){_0x616771['include']=[{'all':!![]}];}return db[_0x7ef2('0x42')][_0x7ef2('0x45')](_0x616771);})[_0x7ef2('0x29')](function(_0x109319){_0x24be5a['rows']=_0x109319;return _0x24be5a;})[_0x7ef2('0x29')](respondWithFilteredResult(_0x350d8b,_0x616771,_0x7ef2('0x50')))[_0x7ef2('0x46')](handleError(_0x350d8b,null,'getVoiceQueuesReport'));}; \ No newline at end of file +var _0xdd47=['options','includeAll','include','findAll','rows','catch','show','params','find','create','body','describe','getVoiceQueuesReport','nolimit','order','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./voiceQueueReport.socket','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','update','then','destroy','stack','name','send','index','map','VoiceQueueReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','sort','pick','filter','where','merge','VIRTUAL'];(function(_0x298ed3,_0x4ab5e1){var _0x5aad28=function(_0x168687){while(--_0x168687){_0x298ed3['push'](_0x298ed3['shift']());}};_0x5aad28(++_0x4ab5e1);}(_0xdd47,0xb3));var _0x7dd4=function(_0x385c76,_0xb97335){_0x385c76=_0x385c76-0x0;var _0x5c8367=_0xdd47[_0x385c76];return _0x5c8367;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x7dd4('0x0'));var jsonpatch=require(_0x7dd4('0x1'));var rp=require(_0x7dd4('0x2'));var moment=require('moment');var BPromise=require(_0x7dd4('0x3'));var Mustache=require(_0x7dd4('0x4'));var util=require('util');var path=require(_0x7dd4('0x5'));var sox=require(_0x7dd4('0x6'));var csv=require('to-csv');var ejs=require(_0x7dd4('0x7'));var fs=require('fs');var fs_extra=require(_0x7dd4('0x8'));var _=require(_0x7dd4('0x9'));var squel=require(_0x7dd4('0xa'));var crypto=require(_0x7dd4('0xb'));var jsforce=require(_0x7dd4('0xc'));var deskjs=require(_0x7dd4('0xd'));var toCsv=require(_0x7dd4('0xe'));var querystring=require(_0x7dd4('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x7dd4('0x10'));var qs=require(_0x7dd4('0x11'));var as=require(_0x7dd4('0x12'));var hardwareService=require(_0x7dd4('0x13'));var logger=require('../../config/logger')(_0x7dd4('0x14'));var utils=require(_0x7dd4('0x15'));var config=require(_0x7dd4('0x16'));var licenseUtil=require(_0x7dd4('0x17'));var db=require('../../mysqldb')['db'];config[_0x7dd4('0x18')]=_[_0x7dd4('0x19')](config[_0x7dd4('0x18')],{'host':_0x7dd4('0x1a'),'port':0x18eb});var socket=require(_0x7dd4('0x1b'))(new Redis(config['redis']));require(_0x7dd4('0x1c'))['register'](socket);function respondWithStatusCode(_0x5b0b2a,_0x5089a5){_0x5089a5=_0x5089a5||0xcc;return function(_0x35ccf9){if(_0x35ccf9){return _0x5b0b2a[_0x7dd4('0x1d')](_0x5089a5);}return _0x5b0b2a[_0x7dd4('0x1e')](_0x5089a5)[_0x7dd4('0x1f')]();};}function respondWithResult(_0x2bcd67,_0x354d11){_0x354d11=_0x354d11||0xc8;return function(_0x11995b){if(_0x11995b){return _0x2bcd67['status'](_0x354d11)[_0x7dd4('0x20')](_0x11995b);}};}function respondWithFilteredResult(_0x3ba0fd,_0x2bbc53){return function(_0x108799){if(_0x108799){var _0x3eb00c=typeof _0x2bbc53[_0x7dd4('0x21')]==='undefined'&&typeof _0x2bbc53[_0x7dd4('0x22')]===_0x7dd4('0x23');var _0x23124c=_0x108799[_0x7dd4('0x24')];var _0x2438df=_0x3eb00c?0x0:_0x2bbc53['offset'];var _0x15269e=_0x3eb00c?_0x108799[_0x7dd4('0x24')]:_0x2bbc53['offset']+_0x2bbc53['limit'];var _0x50a3be;if(_0x15269e>=_0x23124c){_0x15269e=_0x23124c;_0x50a3be=0xc8;}else{_0x50a3be=0xce;}_0x3ba0fd[_0x7dd4('0x1e')](_0x50a3be);return _0x3ba0fd[_0x7dd4('0x25')](_0x7dd4('0x26'),_0x2438df+'-'+_0x15269e+'/'+_0x23124c)[_0x7dd4('0x20')](_0x108799);}return null;};}function patchUpdates(_0x220b76){return function(_0x4bed69){try{jsonpatch[_0x7dd4('0x27')](_0x4bed69,_0x220b76,!![]);}catch(_0x2db57d){return BPromise['reject'](_0x2db57d);}return _0x4bed69['save']();};}function saveUpdates(_0x441be1,_0x19fb0c){return function(_0x1d4539){if(_0x1d4539){return _0x1d4539[_0x7dd4('0x28')](_0x441be1)[_0x7dd4('0x29')](function(_0x1edaeb){return _0x1edaeb;});}return null;};}function removeEntity(_0x3479cf,_0x5f0b01){return function(_0x1edf78){if(_0x1edf78){return _0x1edf78[_0x7dd4('0x2a')]()['then'](function(){_0x3479cf[_0x7dd4('0x1e')](0xcc)[_0x7dd4('0x1f')]();});}};}function handleEntityNotFound(_0x832de5,_0x227233){return function(_0x129851){if(!_0x129851){_0x832de5['sendStatus'](0x194);}return _0x129851;};}function handleError(_0x44bd71,_0x484dbc){_0x484dbc=_0x484dbc||0x1f4;return function(_0x3f21fe){logger['error'](_0x3f21fe[_0x7dd4('0x2b')]);if(_0x3f21fe[_0x7dd4('0x2c')]){delete _0x3f21fe[_0x7dd4('0x2c')];}_0x44bd71[_0x7dd4('0x1e')](_0x484dbc)[_0x7dd4('0x2d')](_0x3f21fe);};}exports[_0x7dd4('0x2e')]=function(_0x9c8ae3,_0x554be2){var _0x16b0c4={},_0x367f88={},_0x2e9991={'count':0x0,'rows':[]};var _0x6f4efb=_[_0x7dd4('0x2f')](db[_0x7dd4('0x30')][_0x7dd4('0x31')],function(_0x14d2fd){return{'name':_0x14d2fd[_0x7dd4('0x32')],'type':_0x14d2fd[_0x7dd4('0x33')][_0x7dd4('0x34')]};});_0x367f88[_0x7dd4('0x35')]=_[_0x7dd4('0x2f')](_0x6f4efb,'name');_0x367f88[_0x7dd4('0x36')]=_[_0x7dd4('0x37')](_0x9c8ae3[_0x7dd4('0x36')]);_0x367f88[_0x7dd4('0x38')]=_[_0x7dd4('0x39')](_0x367f88[_0x7dd4('0x35')],_0x367f88[_0x7dd4('0x36')]);_0x16b0c4['attributes']=_['intersection'](_0x367f88[_0x7dd4('0x35')],qs[_0x7dd4('0x3a')](_0x9c8ae3[_0x7dd4('0x36')][_0x7dd4('0x3a')]));_0x16b0c4[_0x7dd4('0x3b')]=_0x16b0c4[_0x7dd4('0x3b')][_0x7dd4('0x3c')]?_0x16b0c4['attributes']:_0x367f88[_0x7dd4('0x35')];if(!_0x9c8ae3[_0x7dd4('0x36')]['hasOwnProperty']('nolimit')){_0x16b0c4[_0x7dd4('0x22')]=qs[_0x7dd4('0x22')](_0x9c8ae3[_0x7dd4('0x36')][_0x7dd4('0x22')]);_0x16b0c4[_0x7dd4('0x21')]=qs[_0x7dd4('0x21')](_0x9c8ae3['query'][_0x7dd4('0x21')]);}_0x16b0c4['order']=qs[_0x7dd4('0x3d')](_0x9c8ae3[_0x7dd4('0x36')][_0x7dd4('0x3d')]);_0x16b0c4['where']=qs['filters'](_[_0x7dd4('0x3e')](_0x9c8ae3[_0x7dd4('0x36')],_0x367f88[_0x7dd4('0x38')]),_0x6f4efb);if(_0x9c8ae3[_0x7dd4('0x36')][_0x7dd4('0x3f')]){_0x16b0c4[_0x7dd4('0x40')]=_[_0x7dd4('0x41')](_0x16b0c4[_0x7dd4('0x40')],{'$or':_['map'](_0x6f4efb,function(_0x25c1f0){if(_0x25c1f0[_0x7dd4('0x33')]!==_0x7dd4('0x42')){var _0x29024d={};_0x29024d[_0x25c1f0[_0x7dd4('0x2c')]]={'$like':'%'+_0x9c8ae3[_0x7dd4('0x36')]['filter']+'%'};return _0x29024d;}})});}_0x16b0c4=_['merge']({},_0x16b0c4,_0x9c8ae3[_0x7dd4('0x43')]);var _0x4c40f4={'where':_0x16b0c4['where']};return db['VoiceQueueReport'][_0x7dd4('0x24')](_0x4c40f4)['then'](function(_0x2bd666){_0x2e9991[_0x7dd4('0x24')]=_0x2bd666;if(_0x9c8ae3[_0x7dd4('0x36')][_0x7dd4('0x44')]){_0x16b0c4[_0x7dd4('0x45')]=[{'all':!![]}];}return db[_0x7dd4('0x30')][_0x7dd4('0x46')](_0x16b0c4);})[_0x7dd4('0x29')](function(_0x210055){_0x2e9991[_0x7dd4('0x47')]=_0x210055;return _0x2e9991;})[_0x7dd4('0x29')](respondWithFilteredResult(_0x554be2,_0x16b0c4))[_0x7dd4('0x48')](handleError(_0x554be2,null));};exports[_0x7dd4('0x49')]=function(_0x139767,_0x54d8b7){var _0x11f5bb={'raw':![],'where':{'id':_0x139767[_0x7dd4('0x4a')]['id']}},_0x4f9e83={};_0x4f9e83[_0x7dd4('0x35')]=_[_0x7dd4('0x37')](db['VoiceQueueReport'][_0x7dd4('0x31')]);_0x4f9e83['query']=_['keys'](_0x139767[_0x7dd4('0x36')]);_0x4f9e83['filters']=_[_0x7dd4('0x39')](_0x4f9e83[_0x7dd4('0x35')],_0x4f9e83[_0x7dd4('0x36')]);_0x11f5bb['attributes']=_['intersection'](_0x4f9e83['model'],qs[_0x7dd4('0x3a')](_0x139767[_0x7dd4('0x36')][_0x7dd4('0x3a')]));_0x11f5bb[_0x7dd4('0x3b')]=_0x11f5bb[_0x7dd4('0x3b')][_0x7dd4('0x3c')]?_0x11f5bb['attributes']:_0x4f9e83[_0x7dd4('0x35')];if(_0x139767['query']['includeAll']){_0x11f5bb[_0x7dd4('0x45')]=[{'all':!![]}];}_0x11f5bb=_[_0x7dd4('0x41')]({},_0x11f5bb,_0x139767['options']);return db[_0x7dd4('0x30')][_0x7dd4('0x4b')](_0x11f5bb)['then'](handleEntityNotFound(_0x54d8b7,null))[_0x7dd4('0x29')](respondWithResult(_0x54d8b7,null))[_0x7dd4('0x48')](handleError(_0x54d8b7,null));};exports[_0x7dd4('0x4c')]=function(_0x1c05cc,_0x40cb5c){return db[_0x7dd4('0x30')][_0x7dd4('0x4c')](_0x1c05cc[_0x7dd4('0x4d')],{})['then'](respondWithResult(_0x40cb5c,0xc9))[_0x7dd4('0x48')](handleError(_0x40cb5c,null));};exports[_0x7dd4('0x28')]=function(_0x257f9e,_0x43355a){if(_0x257f9e[_0x7dd4('0x4d')]['id']){delete _0x257f9e[_0x7dd4('0x4d')]['id'];}return db[_0x7dd4('0x30')]['find']({'where':{'id':_0x257f9e['params']['id']}})[_0x7dd4('0x29')](handleEntityNotFound(_0x43355a,null))[_0x7dd4('0x29')](saveUpdates(_0x257f9e[_0x7dd4('0x4d')],null))[_0x7dd4('0x29')](respondWithResult(_0x43355a,null))[_0x7dd4('0x48')](handleError(_0x43355a,null));};exports['destroy']=function(_0x199351,_0x5eb0ff){return db[_0x7dd4('0x30')]['find']({'where':{'id':_0x199351['params']['id']}})[_0x7dd4('0x29')](handleEntityNotFound(_0x5eb0ff,null))[_0x7dd4('0x29')](removeEntity(_0x5eb0ff,null))['catch'](handleError(_0x5eb0ff,null));};exports['describe']=function(_0x3e01d8,_0x1d3c67){return db['VoiceQueueReport'][_0x7dd4('0x4e')]()[_0x7dd4('0x29')](respondWithResult(_0x1d3c67,null))['catch'](handleError(_0x1d3c67,null));};exports[_0x7dd4('0x4f')]=function(_0x3aeee7,_0x17f70d){var _0xa87aa0={},_0x4fceb7={},_0x2e7360={'count':0x0,'rows':[]};_0x4fceb7[_0x7dd4('0x35')]=_[_0x7dd4('0x37')](db[_0x7dd4('0x30')][_0x7dd4('0x31')]);_0x4fceb7[_0x7dd4('0x36')]=_[_0x7dd4('0x37')](_0x3aeee7[_0x7dd4('0x36')]);_0x4fceb7[_0x7dd4('0x38')]=_[_0x7dd4('0x39')](_0x4fceb7['model'],_0x4fceb7['query']);_0xa87aa0[_0x7dd4('0x3b')]=_[_0x7dd4('0x39')](_0x4fceb7[_0x7dd4('0x35')],qs[_0x7dd4('0x3a')](_0x3aeee7['query'][_0x7dd4('0x3a')]));_0xa87aa0[_0x7dd4('0x3b')]=_0xa87aa0[_0x7dd4('0x3b')][_0x7dd4('0x3c')]?_0xa87aa0['attributes']:_0x4fceb7[_0x7dd4('0x35')];if(!_0x3aeee7[_0x7dd4('0x36')]['hasOwnProperty'](_0x7dd4('0x50'))){_0xa87aa0[_0x7dd4('0x22')]=qs[_0x7dd4('0x22')](_0x3aeee7[_0x7dd4('0x36')][_0x7dd4('0x22')]);_0xa87aa0['offset']=qs['offset'](_0x3aeee7['query'][_0x7dd4('0x21')]);}_0xa87aa0[_0x7dd4('0x51')]=qs[_0x7dd4('0x3d')](_0x3aeee7[_0x7dd4('0x36')][_0x7dd4('0x3d')]);_0xa87aa0['where']=qs[_0x7dd4('0x38')](_[_0x7dd4('0x3e')](_0x3aeee7[_0x7dd4('0x36')],_0x4fceb7['filters']));if(_0x3aeee7[_0x7dd4('0x36')][_0x7dd4('0x3f')]){_0xa87aa0[_0x7dd4('0x40')]=_['merge'](_0xa87aa0['where'],{'$or':_['map'](_0xa87aa0[_0x7dd4('0x3b')],function(_0x4d1f18){var _0xc9e5b={};_0xc9e5b[_0x4d1f18]={'$like':'%'+_0x3aeee7[_0x7dd4('0x36')]['filter']+'%'};return _0xc9e5b;})});}_0xa87aa0=_[_0x7dd4('0x41')]({},_0xa87aa0,_0x3aeee7[_0x7dd4('0x43')]);var _0x1fdce4={'where':_0xa87aa0['where']};return db[_0x7dd4('0x30')]['count'](_0x1fdce4)[_0x7dd4('0x29')](function(_0x315c3f){_0x2e7360[_0x7dd4('0x24')]=_0x315c3f;if(_0x3aeee7[_0x7dd4('0x36')]['includeAll']){_0xa87aa0[_0x7dd4('0x45')]=[{'all':!![]}];}return db[_0x7dd4('0x30')][_0x7dd4('0x46')](_0xa87aa0);})[_0x7dd4('0x29')](function(_0x4a39a2){_0x2e7360['rows']=_0x4a39a2;return _0x2e7360;})[_0x7dd4('0x29')](respondWithFilteredResult(_0x17f70d,_0xa87aa0,_0x7dd4('0x4f')))[_0x7dd4('0x48')](handleError(_0x17f70d,null,_0x7dd4('0x4f')));}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.events.js b/server/api/voiceQueueReport/voiceQueueReport.events.js index f1e4bc8..d057b1a 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 _0x50ea=['VoiceQueueReport','save','update','emit','hook','../../mysqldb'];(function(_0x5dcc79,_0x2f278d){var _0x24d7b1=function(_0x2fbc8e){while(--_0x2fbc8e){_0x5dcc79['push'](_0x5dcc79['shift']());}};_0x24d7b1(++_0x2f278d);}(_0x50ea,0x131));var _0xa50e=function(_0x17038a,_0xfbda08){_0x17038a=_0x17038a-0x0;var _0x1a0aa1=_0x50ea[_0x17038a];return _0x1a0aa1;};'use strict';var EventEmitter=require('events');var VoiceQueueReport=require(_0xa50e('0x0'))['db'][_0xa50e('0x1')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xa50e('0x2'),'afterUpdate':_0xa50e('0x3'),'afterDestroy':'remove'};function emitEvent(_0x12cbaa){return function(_0x231c90,_0x38c68d,_0x1fbc5d){VoiceQueueReportEvents['emit'](_0x12cbaa+':'+_0x231c90['id'],_0x231c90);VoiceQueueReportEvents[_0xa50e('0x4')](_0x12cbaa,_0x231c90);_0x1fbc5d(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceQueueReport[_0xa50e('0x5')](e,emitEvent(event));}}module['exports']=VoiceQueueReportEvents; \ No newline at end of file +var _0x16ab=['save','remove','emit','exports','events','../../mysqldb','VoiceQueueReport','setMaxListeners'];(function(_0x56aa6c,_0x360d1c){var _0x580b72=function(_0x708e73){while(--_0x708e73){_0x56aa6c['push'](_0x56aa6c['shift']());}};_0x580b72(++_0x360d1c);}(_0x16ab,0x94));var _0xb16a=function(_0x5ddaac,_0x2697a8){_0x5ddaac=_0x5ddaac-0x0;var _0x2a9c58=_0x16ab[_0x5ddaac];return _0x2a9c58;};'use strict';var EventEmitter=require(_0xb16a('0x0'));var VoiceQueueReport=require(_0xb16a('0x1'))['db'][_0xb16a('0x2')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0xb16a('0x3')](0x0);var events={'afterCreate':_0xb16a('0x4'),'afterUpdate':'update','afterDestroy':_0xb16a('0x5')};function emitEvent(_0x565967){return function(_0xb33114,_0x3275a1,_0x148930){VoiceQueueReportEvents[_0xb16a('0x6')](_0x565967+':'+_0xb33114['id'],_0xb33114);VoiceQueueReportEvents[_0xb16a('0x6')](_0x565967,_0xb33114);_0x148930(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceQueueReport['hook'](e,emitEvent(event));}}module[_0xb16a('0x7')]=VoiceQueueReportEvents; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.model.js b/server/api/voiceQueueReport/voiceQueueReport.model.js index 2c03ec8..408763d 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 _0x0f4d=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./voiceQueueReport.attributes','define','VoiceQueueReport','uniqueid','calleridnum'];(function(_0xb725be,_0x45bd01){var _0x2f2424=function(_0x2566ca){while(--_0x2566ca){_0xb725be['push'](_0xb725be['shift']());}};_0x2f2424(++_0x45bd01);}(_0x0f4d,0x7e));var _0xd0f4=function(_0x3cc082,_0x222c84){_0x3cc082=_0x3cc082-0x0;var _0x5403f9=_0x0f4d[_0x3cc082];return _0x5403f9;};'use strict';var _=require(_0xd0f4('0x0'));var util=require(_0xd0f4('0x1'));var logger=require(_0xd0f4('0x2'))(_0xd0f4('0x3'));var moment=require(_0xd0f4('0x4'));var BPromise=require(_0xd0f4('0x5'));var rp=require(_0xd0f4('0x6'));var fs=require('fs');var path=require(_0xd0f4('0x7'));var rimraf=require('rimraf');var config=require(_0xd0f4('0x8'));var attributes=require(_0xd0f4('0x9'));module['exports']=function(_0x27af4f,_0x307476){return _0x27af4f[_0xd0f4('0xa')](_0xd0f4('0xb'),attributes,{'tableName':'report_queue','paranoid':![],'indexes':[{'fields':[_0xd0f4('0xc')]},{'fields':[_0xd0f4('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x319b=['request-promise','path','rimraf','../../config/environment','exports','define','VoiceQueueReport','uniqueid','lodash','../../config/logger','api','bluebird'];(function(_0x47e549,_0x2e53d6){var _0x251374=function(_0x400458){while(--_0x400458){_0x47e549['push'](_0x47e549['shift']());}};_0x251374(++_0x2e53d6);}(_0x319b,0xbc));var _0xb319=function(_0x4ef582,_0x307619){_0x4ef582=_0x4ef582-0x0;var _0x38970c=_0x319b[_0x4ef582];return _0x38970c;};'use strict';var _=require(_0xb319('0x0'));var util=require('util');var logger=require(_0xb319('0x1'))(_0xb319('0x2'));var moment=require('moment');var BPromise=require(_0xb319('0x3'));var rp=require(_0xb319('0x4'));var fs=require('fs');var path=require(_0xb319('0x5'));var rimraf=require(_0xb319('0x6'));var config=require(_0xb319('0x7'));var attributes=require('./voiceQueueReport.attributes');module[_0xb319('0x8')]=function(_0x3250fe,_0x563d70){return _0x3250fe[_0xb319('0x9')](_0xb319('0xa'),attributes,{'tableName':'report_queue','paranoid':![],'indexes':[{'fields':[_0xb319('0xb')]},{'fields':['calleridnum']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.rpc.js b/server/api/voiceQueueReport/voiceQueueReport.rpc.js index 7cf06ad..a1df8cd 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 _0xa37b=['update','where','UpdateVoiceQueueReport','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./voiceQueueReport.socket','request','info','VoiceQueueReport,\x20%s,\x20%s','request\x20sent','VoiceQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','GetVoiceQueueReport','VoiceQueueReport','findAll','options','attributes','limit','map','include','model','then','debug','CreateVoiceQueueReport','body','raw'];(function(_0x10c969,_0xf21a5c){var _0x2b3509=function(_0x5d36e5){while(--_0x5d36e5){_0x10c969['push'](_0x10c969['shift']());}};_0x2b3509(++_0xf21a5c);}(_0xa37b,0x1a7));var _0xba37=function(_0x44d45a,_0x150d47){_0x44d45a=_0x44d45a-0x0;var _0x2e6c05=_0xa37b[_0x44d45a];return _0x2e6c05;};'use strict';var _=require(_0xba37('0x0'));var util=require('util');var moment=require(_0xba37('0x1'));var BPromise=require(_0xba37('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xba37('0x3'));var db=require(_0xba37('0x4'))['db'];var utils=require(_0xba37('0x5'));var logger=require(_0xba37('0x6'))('rpc');var config=require(_0xba37('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xba37('0x8')][_0xba37('0x9')]({'port':0x232a});config[_0xba37('0xa')]=_[_0xba37('0xb')](config[_0xba37('0xa')],{'host':_0xba37('0xc'),'port':0x18eb});var socket=require(_0xba37('0xd'))(new Redis(config['redis']));require(_0xba37('0xe'))['register'](socket);function respondWithRpcPromise(_0x21b91f,_0x507a97,_0x1ec3dc){return new BPromise(function(_0x388dee,_0x247913){return client[_0xba37('0xf')](_0x21b91f,_0x1ec3dc)['then'](function(_0x2f0b0b){logger[_0xba37('0x10')](_0xba37('0x11'),_0x507a97,_0xba37('0x12'));logger['debug'](_0xba37('0x13'),_0x507a97,'request\x20sent',JSON[_0xba37('0x14')](_0x2f0b0b));if(_0x2f0b0b[_0xba37('0x15')]){if(_0x2f0b0b['error']['code']===0x1f4){logger[_0xba37('0x15')](_0xba37('0x11'),_0x507a97,_0x2f0b0b[_0xba37('0x15')][_0xba37('0x16')]);return _0x247913(_0x2f0b0b['error'][_0xba37('0x16')]);}logger[_0xba37('0x15')](_0xba37('0x11'),_0x507a97,_0x2f0b0b[_0xba37('0x15')][_0xba37('0x16')]);return _0x388dee(_0x2f0b0b['error'][_0xba37('0x16')]);}else{logger[_0xba37('0x10')](_0xba37('0x11'),_0x507a97,_0xba37('0x12'));_0x388dee(_0x2f0b0b[_0xba37('0x17')][_0xba37('0x16')]);}})[_0xba37('0x18')](function(_0x853b4a){logger['error'](_0xba37('0x11'),_0x507a97,_0x853b4a);_0x247913(_0x853b4a);});});}exports[_0xba37('0x19')]=function(_0x52e2ff){var _0xaf9a34=this;return new Promise(function(_0x3e084d,_0x2f7073){return db[_0xba37('0x1a')][_0xba37('0x1b')]({'raw':_0x52e2ff[_0xba37('0x1c')]?_0x52e2ff[_0xba37('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x52e2ff[_0xba37('0x1c')]?_0x52e2ff[_0xba37('0x1c')]['where']||null:null,'attributes':_0x52e2ff['options']?_0x52e2ff[_0xba37('0x1c')][_0xba37('0x1d')]||null:null,'limit':_0x52e2ff['options']?_0x52e2ff[_0xba37('0x1c')][_0xba37('0x1e')]||null:null,'include':_0x52e2ff['options']?_0x52e2ff[_0xba37('0x1c')]['include']?_[_0xba37('0x1f')](_0x52e2ff[_0xba37('0x1c')][_0xba37('0x20')],function(_0x126580){return{'model':db[_0x126580[_0xba37('0x21')]],'as':_0x126580['as'],'attributes':_0x126580[_0xba37('0x1d')],'include':_0x126580[_0xba37('0x20')]?_[_0xba37('0x1f')](_0x126580[_0xba37('0x20')],function(_0x292d9b){return{'model':db[_0x292d9b[_0xba37('0x21')]],'as':_0x292d9b['as'],'attributes':_0x292d9b[_0xba37('0x1d')],'include':_0x292d9b[_0xba37('0x20')]?_[_0xba37('0x1f')](_0x292d9b[_0xba37('0x20')],function(_0x52f8c9){return{'model':db[_0x52f8c9[_0xba37('0x21')]],'as':_0x52f8c9['as'],'attributes':_0x52f8c9[_0xba37('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xba37('0x22')](function(_0x4194c2){logger[_0xba37('0x10')](_0xba37('0x19'),_0x52e2ff);logger[_0xba37('0x23')](_0xba37('0x19'),_0x52e2ff,JSON[_0xba37('0x14')](_0x4194c2));_0x3e084d(_0x4194c2);})[_0xba37('0x18')](function(_0x1fbb78){logger[_0xba37('0x15')]('GetVoiceQueueReport',_0x1fbb78[_0xba37('0x16')],_0x52e2ff);_0x2f7073(_0xaf9a34['error'](0x1f4,_0x1fbb78[_0xba37('0x16')]));});});};exports[_0xba37('0x24')]=function(_0x38a99d){var _0x1a8cf7=this;return new Promise(function(_0x5edefd,_0x591c51){return db[_0xba37('0x1a')]['create'](_0x38a99d[_0xba37('0x25')],{'raw':_0x38a99d[_0xba37('0x1c')]?_0x38a99d[_0xba37('0x1c')][_0xba37('0x26')]===undefined?!![]:![]:!![]})[_0xba37('0x22')](function(_0x38f005){logger[_0xba37('0x10')](_0xba37('0x24'),_0x38a99d);logger['debug'](_0xba37('0x24'),_0x38a99d,JSON['stringify'](_0x38f005));_0x5edefd(_0x38f005);})[_0xba37('0x18')](function(_0x4f34b0){logger['error'](_0xba37('0x24'),_0x4f34b0[_0xba37('0x16')],_0x38a99d);_0x591c51(_0x1a8cf7['error'](0x1f4,_0x4f34b0[_0xba37('0x16')]));});});};exports['UpdateVoiceQueueReport']=function(_0x3f4c19){var _0x1f4b2d=this;return new Promise(function(_0x1f98b2,_0x46c53a){return db[_0xba37('0x1a')][_0xba37('0x27')](_0x3f4c19['body'],{'raw':_0x3f4c19['options']?_0x3f4c19[_0xba37('0x1c')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3f4c19[_0xba37('0x1c')]?_0x3f4c19[_0xba37('0x1c')][_0xba37('0x28')]||null:null,'attributes':_0x3f4c19[_0xba37('0x1c')]?_0x3f4c19[_0xba37('0x1c')]['attributes']||null:null,'limit':_0x3f4c19[_0xba37('0x1c')]?_0x3f4c19['options'][_0xba37('0x1e')]||null:null})[_0xba37('0x22')](function(_0x55d5f0){logger[_0xba37('0x10')](_0xba37('0x29'),_0x3f4c19);logger[_0xba37('0x23')](_0xba37('0x29'),_0x3f4c19,JSON['stringify'](_0x55d5f0));_0x1f98b2(_0x55d5f0);})[_0xba37('0x18')](function(_0x27c1f3){logger['error'](_0xba37('0x29'),_0x27c1f3[_0xba37('0x16')],_0x3f4c19);_0x46c53a(_0x1f4b2d[_0xba37('0x15')](0x1f4,_0x27c1f3[_0xba37('0x16')]));});});}; \ No newline at end of file +var _0xbbd3=['options','raw','where','attributes','include','map','model','CreateVoiceQueueReport','create','UpdateVoiceQueueReport','limit','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','register','then','info','VoiceQueueReport,\x20%s,\x20%s','request\x20sent','debug','VoiceQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetVoiceQueueReport','VoiceQueueReport','findAll'];(function(_0x583a0a,_0x2d1dd6){var _0x4e6481=function(_0x43340c){while(--_0x43340c){_0x583a0a['push'](_0x583a0a['shift']());}};_0x4e6481(++_0x2d1dd6);}(_0xbbd3,0xbb));var _0x3bbd=function(_0x1caf6a,_0x26a5bf){_0x1caf6a=_0x1caf6a-0x0;var _0x1bf493=_0xbbd3[_0x1caf6a];return _0x1bf493;};'use strict';var _=require(_0x3bbd('0x0'));var util=require(_0x3bbd('0x1'));var moment=require(_0x3bbd('0x2'));var BPromise=require(_0x3bbd('0x3'));var rs=require(_0x3bbd('0x4'));var fs=require('fs');var Redis=require(_0x3bbd('0x5'));var db=require(_0x3bbd('0x6'))['db'];var utils=require(_0x3bbd('0x7'));var logger=require(_0x3bbd('0x8'))(_0x3bbd('0x9'));var config=require(_0x3bbd('0xa'));var jayson=require(_0x3bbd('0xb'));var client=jayson[_0x3bbd('0xc')][_0x3bbd('0xd')]({'port':0x232a});config[_0x3bbd('0xe')]=_[_0x3bbd('0xf')](config[_0x3bbd('0xe')],{'host':'localhost','port':0x18eb});var socket=require(_0x3bbd('0x10'))(new Redis(config[_0x3bbd('0xe')]));require('./voiceQueueReport.socket')[_0x3bbd('0x11')](socket);function respondWithRpcPromise(_0xc50c71,_0x2d8408,_0x61359a){return new BPromise(function(_0x74e5f7,_0x274989){return client['request'](_0xc50c71,_0x61359a)[_0x3bbd('0x12')](function(_0x19cc27){logger[_0x3bbd('0x13')](_0x3bbd('0x14'),_0x2d8408,_0x3bbd('0x15'));logger[_0x3bbd('0x16')](_0x3bbd('0x17'),_0x2d8408,'request\x20sent',JSON[_0x3bbd('0x18')](_0x19cc27));if(_0x19cc27[_0x3bbd('0x19')]){if(_0x19cc27[_0x3bbd('0x19')][_0x3bbd('0x1a')]===0x1f4){logger[_0x3bbd('0x19')](_0x3bbd('0x14'),_0x2d8408,_0x19cc27[_0x3bbd('0x19')][_0x3bbd('0x1b')]);return _0x274989(_0x19cc27['error']['message']);}logger['error'](_0x3bbd('0x14'),_0x2d8408,_0x19cc27[_0x3bbd('0x19')][_0x3bbd('0x1b')]);return _0x74e5f7(_0x19cc27['error'][_0x3bbd('0x1b')]);}else{logger[_0x3bbd('0x13')](_0x3bbd('0x14'),_0x2d8408,_0x3bbd('0x15'));_0x74e5f7(_0x19cc27[_0x3bbd('0x1c')][_0x3bbd('0x1b')]);}})[_0x3bbd('0x1d')](function(_0x5b1aca){logger[_0x3bbd('0x19')](_0x3bbd('0x14'),_0x2d8408,_0x5b1aca);_0x274989(_0x5b1aca);});});}exports[_0x3bbd('0x1e')]=function(_0x4eae0a){var _0x8ce40f=this;return new Promise(function(_0x15604a,_0x480471){return db[_0x3bbd('0x1f')][_0x3bbd('0x20')]({'raw':_0x4eae0a[_0x3bbd('0x21')]?_0x4eae0a[_0x3bbd('0x21')][_0x3bbd('0x22')]===undefined?!![]:![]:!![],'where':_0x4eae0a[_0x3bbd('0x21')]?_0x4eae0a[_0x3bbd('0x21')][_0x3bbd('0x23')]||null:null,'attributes':_0x4eae0a[_0x3bbd('0x21')]?_0x4eae0a['options'][_0x3bbd('0x24')]||null:null,'limit':_0x4eae0a[_0x3bbd('0x21')]?_0x4eae0a[_0x3bbd('0x21')]['limit']||null:null,'include':_0x4eae0a[_0x3bbd('0x21')]?_0x4eae0a[_0x3bbd('0x21')][_0x3bbd('0x25')]?_[_0x3bbd('0x26')](_0x4eae0a[_0x3bbd('0x21')][_0x3bbd('0x25')],function(_0x4bf867){return{'model':db[_0x4bf867[_0x3bbd('0x27')]],'as':_0x4bf867['as'],'attributes':_0x4bf867['attributes'],'include':_0x4bf867[_0x3bbd('0x25')]?_[_0x3bbd('0x26')](_0x4bf867[_0x3bbd('0x25')],function(_0x46aaa6){return{'model':db[_0x46aaa6[_0x3bbd('0x27')]],'as':_0x46aaa6['as'],'attributes':_0x46aaa6['attributes'],'include':_0x46aaa6[_0x3bbd('0x25')]?_[_0x3bbd('0x26')](_0x46aaa6[_0x3bbd('0x25')],function(_0x4210ae){return{'model':db[_0x4210ae[_0x3bbd('0x27')]],'as':_0x4210ae['as'],'attributes':_0x4210ae[_0x3bbd('0x24')]};}):[]};}):[]};}):[]:[]})[_0x3bbd('0x12')](function(_0x1d82f0){logger['info']('GetVoiceQueueReport',_0x4eae0a);logger[_0x3bbd('0x16')](_0x3bbd('0x1e'),_0x4eae0a,JSON['stringify'](_0x1d82f0));_0x15604a(_0x1d82f0);})[_0x3bbd('0x1d')](function(_0x44db49){logger[_0x3bbd('0x19')](_0x3bbd('0x1e'),_0x44db49[_0x3bbd('0x1b')],_0x4eae0a);_0x480471(_0x8ce40f[_0x3bbd('0x19')](0x1f4,_0x44db49['message']));});});};exports[_0x3bbd('0x28')]=function(_0x80af9f){var _0x136516=this;return new Promise(function(_0xcff74,_0x427a81){return db[_0x3bbd('0x1f')][_0x3bbd('0x29')](_0x80af9f['body'],{'raw':_0x80af9f[_0x3bbd('0x21')]?_0x80af9f[_0x3bbd('0x21')][_0x3bbd('0x22')]===undefined?!![]:![]:!![]})[_0x3bbd('0x12')](function(_0x32cfe2){logger[_0x3bbd('0x13')](_0x3bbd('0x28'),_0x80af9f);logger[_0x3bbd('0x16')](_0x3bbd('0x28'),_0x80af9f,JSON[_0x3bbd('0x18')](_0x32cfe2));_0xcff74(_0x32cfe2);})[_0x3bbd('0x1d')](function(_0x49b326){logger[_0x3bbd('0x19')](_0x3bbd('0x28'),_0x49b326[_0x3bbd('0x1b')],_0x80af9f);_0x427a81(_0x136516['error'](0x1f4,_0x49b326[_0x3bbd('0x1b')]));});});};exports[_0x3bbd('0x2a')]=function(_0x3a6f03){var _0x338b8b=this;return new Promise(function(_0x505f99,_0x1c4e37){return db[_0x3bbd('0x1f')]['update'](_0x3a6f03['body'],{'raw':_0x3a6f03[_0x3bbd('0x21')]?_0x3a6f03[_0x3bbd('0x21')][_0x3bbd('0x22')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3a6f03[_0x3bbd('0x21')]?_0x3a6f03[_0x3bbd('0x21')][_0x3bbd('0x23')]||null:null,'attributes':_0x3a6f03['options']?_0x3a6f03[_0x3bbd('0x21')][_0x3bbd('0x24')]||null:null,'limit':_0x3a6f03[_0x3bbd('0x21')]?_0x3a6f03[_0x3bbd('0x21')][_0x3bbd('0x2b')]||null:null})[_0x3bbd('0x12')](function(_0x2bf254){logger[_0x3bbd('0x13')](_0x3bbd('0x2a'),_0x3a6f03);logger[_0x3bbd('0x16')](_0x3bbd('0x2a'),_0x3a6f03,JSON[_0x3bbd('0x18')](_0x2bf254));_0x505f99(_0x2bf254);})[_0x3bbd('0x1d')](function(_0x259a8b){logger['error'](_0x3bbd('0x2a'),_0x259a8b['message'],_0x3a6f03);_0x1c4e37(_0x338b8b[_0x3bbd('0x19')](0x1f4,_0x259a8b[_0x3bbd('0x1b')]));});});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.socket.js b/server/api/voiceQueueReport/voiceQueueReport.socket.js index b6e5a0c..ca2e625 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 _0x95d9=['remove','update','emit','removeListener','register','length','voiceQueueReport:','./voiceQueueReport.events','save'];(function(_0x57e1e6,_0x2eb057){var _0x1ffdd5=function(_0x5b4c58){while(--_0x5b4c58){_0x57e1e6['push'](_0x57e1e6['shift']());}};_0x1ffdd5(++_0x2eb057);}(_0x95d9,0x97));var _0x995d=function(_0x40220a,_0x22feb1){_0x40220a=_0x40220a-0x0;var _0x3903cc=_0x95d9[_0x40220a];return _0x3903cc;};'use strict';var VoiceQueueReportEvents=require(_0x995d('0x0'));var events=[_0x995d('0x1'),_0x995d('0x2'),_0x995d('0x3')];function createListener(_0x568331,_0x3d6fa5){return function(_0x3b9a11){_0x3d6fa5[_0x995d('0x4')](_0x568331,_0x3b9a11);};}function removeListener(_0x5b44d3,_0x225c17){return function(){VoiceQueueReportEvents[_0x995d('0x5')](_0x5b44d3,_0x225c17);};}exports[_0x995d('0x6')]=function(_0x226250){for(var _0xe6d244=0x0,_0x4a4d21=events[_0x995d('0x7')];_0xe6d244<_0x4a4d21;_0xe6d244++){var _0x464e22=events[_0xe6d244];var _0x351a63=createListener(_0x995d('0x8')+_0x464e22,_0x226250);VoiceQueueReportEvents['on'](_0x464e22,_0x351a63);}}; \ No newline at end of file +var _0x1353=['removeListener','register','voiceQueueReport:','./voiceQueueReport.events','save','remove','update','emit'];(function(_0x90d16c,_0x92f05a){var _0x16b1e7=function(_0x14821d){while(--_0x14821d){_0x90d16c['push'](_0x90d16c['shift']());}};_0x16b1e7(++_0x92f05a);}(_0x1353,0xb3));var _0x3135=function(_0xbd08b4,_0x4790ed){_0xbd08b4=_0xbd08b4-0x0;var _0x314f1e=_0x1353[_0xbd08b4];return _0x314f1e;};'use strict';var VoiceQueueReportEvents=require(_0x3135('0x0'));var events=[_0x3135('0x1'),_0x3135('0x2'),_0x3135('0x3')];function createListener(_0x1baacd,_0x9c33bd){return function(_0x513cb1){_0x9c33bd[_0x3135('0x4')](_0x1baacd,_0x513cb1);};}function removeListener(_0x3abfa0,_0x3f2e77){return function(){VoiceQueueReportEvents[_0x3135('0x5')](_0x3abfa0,_0x3f2e77);};}exports[_0x3135('0x6')]=function(_0x4fd947){for(var _0x2106cb=0x0,_0x399326=events['length'];_0x2106cb<_0x399326;_0x2106cb++){var _0x35ff62=events[_0x2106cb];var _0x3ff071=createListener(_0x3135('0x7')+_0x35ff62,_0x4fd947);VoiceQueueReportEvents['on'](_0x35ff62,_0x3ff071);}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/index.js b/server/api/voiceQueuesLog/index.js index c74e717..a232535 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 _0x0e85=['create','update','delete','destroy','exports','multer','util','connect-timeout','express','../../components/interaction/service','./voiceQueuesLog.controller','get','isAuthenticated','index','/:id','show','post'];(function(_0xd9be91,_0x50af7f){var _0x5a2c6c=function(_0x60cda2){while(--_0x60cda2){_0xd9be91['push'](_0xd9be91['shift']());}};_0x5a2c6c(++_0x50af7f);}(_0x0e85,0x7c));var _0x50e8=function(_0x20ef64,_0x4a8fe9){_0x20ef64=_0x20ef64-0x0;var _0x3707d8=_0x0e85[_0x20ef64];return _0x3707d8;};'use strict';var multer=require(_0x50e8('0x0'));var util=require(_0x50e8('0x1'));var path=require('path');var timeout=require(_0x50e8('0x2'));var express=require(_0x50e8('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x50e8('0x4'));var config=require('../../config/environment');var controller=require(_0x50e8('0x5'));router[_0x50e8('0x6')]('/',auth[_0x50e8('0x7')](),controller[_0x50e8('0x8')]);router['get'](_0x50e8('0x9'),auth[_0x50e8('0x7')](),controller[_0x50e8('0xa')]);router[_0x50e8('0xb')]('/',auth[_0x50e8('0x7')](),controller[_0x50e8('0xc')]);router['put'](_0x50e8('0x9'),auth[_0x50e8('0x7')](),controller[_0x50e8('0xd')]);router[_0x50e8('0xe')](_0x50e8('0x9'),auth[_0x50e8('0x7')](),controller[_0x50e8('0xf')]);module[_0x50e8('0x10')]=router; \ No newline at end of file +var _0x37c3=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','show','post','create','put','/:id','update','destroy','exports','multer'];(function(_0x47aa64,_0xfb8a07){var _0x549c7a=function(_0x266165){while(--_0x266165){_0x47aa64['push'](_0x47aa64['shift']());}};_0x549c7a(++_0xfb8a07);}(_0x37c3,0xd1));var _0x337c=function(_0x49d3c8,_0xc7146f){_0x49d3c8=_0x49d3c8-0x0;var _0x32ffd7=_0x37c3[_0x49d3c8];return _0x32ffd7;};'use strict';var multer=require(_0x337c('0x0'));var util=require(_0x337c('0x1'));var path=require(_0x337c('0x2'));var timeout=require(_0x337c('0x3'));var express=require(_0x337c('0x4'));var router=express[_0x337c('0x5')]();var fs_extra=require(_0x337c('0x6'));var auth=require(_0x337c('0x7'));var interaction=require(_0x337c('0x8'));var config=require(_0x337c('0x9'));var controller=require('./voiceQueuesLog.controller');router['get']('/',auth[_0x337c('0xa')](),controller[_0x337c('0xb')]);router[_0x337c('0xc')]('/:id',auth['isAuthenticated'](),controller[_0x337c('0xd')]);router[_0x337c('0xe')]('/',auth[_0x337c('0xa')](),controller[_0x337c('0xf')]);router[_0x337c('0x10')](_0x337c('0x11'),auth[_0x337c('0xa')](),controller[_0x337c('0x12')]);router['delete'](_0x337c('0x11'),auth[_0x337c('0xa')](),controller[_0x337c('0x13')]);module[_0x337c('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 35efab6..eb108c7 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 _0xb5ba=['YYYY-MM-DD\x20HH:mm:ss','sequelize','STRING','DATE'];(function(_0x77c363,_0x20b66a){var _0x3646c8=function(_0x89959f){while(--_0x89959f){_0x77c363['push'](_0x77c363['shift']());}};_0x3646c8(++_0x20b66a);}(_0xb5ba,0xe9));var _0xab5b=function(_0x40f9a0,_0x3458cc){_0x40f9a0=_0x40f9a0-0x0;var _0x3e3144=_0xb5ba[_0x40f9a0];return _0x3e3144;};'use strict';var Sequelize=require(_0xab5b('0x0'));var moment=require('moment');module['exports']={'time':{'type':Sequelize[_0xab5b('0x1')]},'callid':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize[_0xab5b('0x1')],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0xab5b('0x1')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0xab5b('0x1')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize[_0xab5b('0x1')],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0xab5b('0x1')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize[_0xab5b('0x1')],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize[_0xab5b('0x1')],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0xab5b('0x2')],'allowNull':![],'defaultValue':moment()['format'](_0xab5b('0x3'))}}; \ No newline at end of file +var _0x847f=['format','YYYY-MM-DD\x20HH:mm:ss','sequelize','moment','exports','STRING'];(function(_0x157978,_0x160335){var _0x119cbd=function(_0x5df3d4){while(--_0x5df3d4){_0x157978['push'](_0x157978['shift']());}};_0x119cbd(++_0x160335);}(_0x847f,0x182));var _0xf847=function(_0x380c7f,_0x234003){_0x380c7f=_0x380c7f-0x0;var _0x57f3c2=_0x847f[_0x380c7f];return _0x57f3c2;};'use strict';var Sequelize=require(_0xf847('0x0'));var moment=require(_0xf847('0x1'));module[_0xf847('0x2')]={'time':{'type':Sequelize['STRING']},'callid':{'type':Sequelize[_0xf847('0x3')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize[_0xf847('0x3')],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0xf847('0x3')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0xf847('0x3')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0xf847('0x3')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize[_0xf847('0x3')],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0xf847('0x3')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':moment()[_0xf847('0x4')](_0xf847('0x5'))}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.controller.js b/server/api/voiceQueuesLog/voiceQueuesLog.controller.js index 9702e27..1c4abc6 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 _0x2fa4=['sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','error','name','VoiceQueuesLog','rawAttributes','fieldName','type','key','map','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','includeAll','include','rows','catch','show','params','find','create','body','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util'];(function(_0x1f98a7,_0x42f75e){var _0x2aecc9=function(_0x3ae664){while(--_0x3ae664){_0x1f98a7['push'](_0x1f98a7['shift']());}};_0x2aecc9(++_0x42f75e);}(_0x2fa4,0x7b));var _0x42fa=function(_0x5cce1e,_0x378f97){_0x5cce1e=_0x5cce1e-0x0;var _0x39107b=_0x2fa4[_0x5cce1e];return _0x39107b;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x42fa('0x0'));var jsonpatch=require(_0x42fa('0x1'));var rp=require(_0x42fa('0x2'));var moment=require(_0x42fa('0x3'));var BPromise=require(_0x42fa('0x4'));var Mustache=require(_0x42fa('0x5'));var util=require(_0x42fa('0x6'));var path=require(_0x42fa('0x7'));var sox=require(_0x42fa('0x8'));var csv=require('to-csv');var ejs=require(_0x42fa('0x9'));var fs=require('fs');var fs_extra=require(_0x42fa('0xa'));var _=require(_0x42fa('0xb'));var squel=require('squel');var crypto=require(_0x42fa('0xc'));var jsforce=require(_0x42fa('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x42fa('0xe'));var querystring=require(_0x42fa('0xf'));var Papa=require(_0x42fa('0x10'));var Redis=require(_0x42fa('0x11'));var authService=require(_0x42fa('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x42fa('0x13'));var logger=require(_0x42fa('0x14'))(_0x42fa('0x15'));var utils=require(_0x42fa('0x16'));var config=require(_0x42fa('0x17'));var licenseUtil=require(_0x42fa('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x17a692,_0x578a01){_0x578a01=_0x578a01||0xcc;return function(_0x4316ac){if(_0x4316ac){return _0x17a692[_0x42fa('0x19')](_0x578a01);}return _0x17a692[_0x42fa('0x1a')](_0x578a01)[_0x42fa('0x1b')]();};}function respondWithResult(_0x7dd7c2,_0x4e1aec){_0x4e1aec=_0x4e1aec||0xc8;return function(_0x503db4){if(_0x503db4){return _0x7dd7c2['status'](_0x4e1aec)[_0x42fa('0x1c')](_0x503db4);}};}function respondWithFilteredResult(_0x4d4018,_0x1451ce){return function(_0x446db8){if(_0x446db8){var _0xfc416e=typeof _0x1451ce[_0x42fa('0x1d')]==='undefined'&&typeof _0x1451ce[_0x42fa('0x1e')]===_0x42fa('0x1f');var _0x11ba03=_0x446db8[_0x42fa('0x20')];var _0x4c1d5d=_0xfc416e?0x0:_0x1451ce[_0x42fa('0x1d')];var _0x274918=_0xfc416e?_0x446db8[_0x42fa('0x20')]:_0x1451ce[_0x42fa('0x1d')]+_0x1451ce['limit'];var _0x240542;if(_0x274918>=_0x11ba03){_0x274918=_0x11ba03;_0x240542=0xc8;}else{_0x240542=0xce;}_0x4d4018['status'](_0x240542);return _0x4d4018[_0x42fa('0x21')](_0x42fa('0x22'),_0x4c1d5d+'-'+_0x274918+'/'+_0x11ba03)[_0x42fa('0x1c')](_0x446db8);}return null;};}function patchUpdates(_0x204445){return function(_0x3246e3){try{jsonpatch[_0x42fa('0x23')](_0x3246e3,_0x204445,!![]);}catch(_0x58abd2){return BPromise[_0x42fa('0x24')](_0x58abd2);}return _0x3246e3[_0x42fa('0x25')]();};}function saveUpdates(_0x3dfb69,_0x4b3f0a){return function(_0x2241c2){if(_0x2241c2){return _0x2241c2[_0x42fa('0x26')](_0x3dfb69)[_0x42fa('0x27')](function(_0x1d815f){return _0x1d815f;});}return null;};}function removeEntity(_0xa268cd,_0x2fa322){return function(_0x517125){if(_0x517125){return _0x517125[_0x42fa('0x28')]()[_0x42fa('0x27')](function(){_0xa268cd['status'](0xcc)[_0x42fa('0x1b')]();});}};}function handleEntityNotFound(_0x492de8,_0x26ffb8){return function(_0x46d0e9){if(!_0x46d0e9){_0x492de8[_0x42fa('0x19')](0x194);}return _0x46d0e9;};}function handleError(_0xba9439,_0xd518bb){_0xd518bb=_0xd518bb||0x1f4;return function(_0x17bab8){logger[_0x42fa('0x29')](_0x17bab8['stack']);if(_0x17bab8[_0x42fa('0x2a')]){delete _0x17bab8['name'];}_0xba9439[_0x42fa('0x1a')](_0xd518bb)['send'](_0x17bab8);};}exports['index']=function(_0x2891a5,_0x364a40){var _0x36d9de={},_0x108744={},_0x42a98b={'count':0x0,'rows':[]};var _0x475e18=_['map'](db[_0x42fa('0x2b')][_0x42fa('0x2c')],function(_0x501212){return{'name':_0x501212[_0x42fa('0x2d')],'type':_0x501212[_0x42fa('0x2e')][_0x42fa('0x2f')]};});_0x108744['model']=_[_0x42fa('0x30')](_0x475e18,_0x42fa('0x2a'));_0x108744[_0x42fa('0x31')]=_[_0x42fa('0x32')](_0x2891a5[_0x42fa('0x31')]);_0x108744[_0x42fa('0x33')]=_[_0x42fa('0x34')](_0x108744[_0x42fa('0x35')],_0x108744[_0x42fa('0x31')]);_0x36d9de['attributes']=_[_0x42fa('0x34')](_0x108744[_0x42fa('0x35')],qs[_0x42fa('0x36')](_0x2891a5[_0x42fa('0x31')][_0x42fa('0x36')]));_0x36d9de['attributes']=_0x36d9de[_0x42fa('0x37')][_0x42fa('0x38')]?_0x36d9de[_0x42fa('0x37')]:_0x108744[_0x42fa('0x35')];if(!_0x2891a5['query'][_0x42fa('0x39')](_0x42fa('0x3a'))){_0x36d9de[_0x42fa('0x1e')]=qs[_0x42fa('0x1e')](_0x2891a5[_0x42fa('0x31')][_0x42fa('0x1e')]);_0x36d9de[_0x42fa('0x1d')]=qs[_0x42fa('0x1d')](_0x2891a5['query'][_0x42fa('0x1d')]);}_0x36d9de['order']=qs[_0x42fa('0x3b')](_0x2891a5[_0x42fa('0x31')][_0x42fa('0x3b')]);_0x36d9de[_0x42fa('0x3c')]=qs['filters'](_[_0x42fa('0x3d')](_0x2891a5[_0x42fa('0x31')],_0x108744[_0x42fa('0x33')]),_0x475e18);if(_0x2891a5[_0x42fa('0x31')][_0x42fa('0x3e')]){_0x36d9de['where']=_[_0x42fa('0x3f')](_0x36d9de[_0x42fa('0x3c')],{'$or':_[_0x42fa('0x30')](_0x475e18,function(_0x21f119){if(_0x21f119['type']!=='VIRTUAL'){var _0x7a204e={};_0x7a204e[_0x21f119[_0x42fa('0x2a')]]={'$like':'%'+_0x2891a5[_0x42fa('0x31')][_0x42fa('0x3e')]+'%'};return _0x7a204e;}})});}_0x36d9de=_['merge']({},_0x36d9de,_0x2891a5[_0x42fa('0x40')]);var _0x6be2f4={'where':_0x36d9de[_0x42fa('0x3c')]};return db[_0x42fa('0x2b')][_0x42fa('0x20')](_0x6be2f4)[_0x42fa('0x27')](function(_0x45140d){_0x42a98b[_0x42fa('0x20')]=_0x45140d;if(_0x2891a5['query'][_0x42fa('0x41')]){_0x36d9de[_0x42fa('0x42')]=[{'all':!![]}];}return db['VoiceQueuesLog']['findAll'](_0x36d9de);})[_0x42fa('0x27')](function(_0x286b5e){_0x42a98b[_0x42fa('0x43')]=_0x286b5e;return _0x42a98b;})[_0x42fa('0x27')](respondWithFilteredResult(_0x364a40,_0x36d9de))[_0x42fa('0x44')](handleError(_0x364a40,null));};exports[_0x42fa('0x45')]=function(_0x41546b,_0x329368){var _0x4a6c62={'raw':!![],'where':{'id':_0x41546b[_0x42fa('0x46')]['id']}},_0x3e6e37={};_0x3e6e37[_0x42fa('0x35')]=_[_0x42fa('0x32')](db[_0x42fa('0x2b')]['rawAttributes']);_0x3e6e37[_0x42fa('0x31')]=_[_0x42fa('0x32')](_0x41546b['query']);_0x3e6e37[_0x42fa('0x33')]=_[_0x42fa('0x34')](_0x3e6e37[_0x42fa('0x35')],_0x3e6e37['query']);_0x4a6c62['attributes']=_['intersection'](_0x3e6e37['model'],qs[_0x42fa('0x36')](_0x41546b['query'][_0x42fa('0x36')]));_0x4a6c62['attributes']=_0x4a6c62[_0x42fa('0x37')][_0x42fa('0x38')]?_0x4a6c62[_0x42fa('0x37')]:_0x3e6e37[_0x42fa('0x35')];if(_0x41546b[_0x42fa('0x31')]['includeAll']){_0x4a6c62[_0x42fa('0x42')]=[{'all':!![]}];}_0x4a6c62=_[_0x42fa('0x3f')]({},_0x4a6c62,_0x41546b[_0x42fa('0x40')]);return db[_0x42fa('0x2b')][_0x42fa('0x47')](_0x4a6c62)[_0x42fa('0x27')](handleEntityNotFound(_0x329368,null))[_0x42fa('0x27')](respondWithResult(_0x329368,null))['catch'](handleError(_0x329368,null));};exports[_0x42fa('0x48')]=function(_0x6de199,_0x1432f3){return db[_0x42fa('0x2b')]['create'](_0x6de199[_0x42fa('0x49')],{})[_0x42fa('0x27')](respondWithResult(_0x1432f3,0xc9))[_0x42fa('0x44')](handleError(_0x1432f3,null));};exports['update']=function(_0x89e70d,_0x27f6de){if(_0x89e70d[_0x42fa('0x49')]['id']){delete _0x89e70d[_0x42fa('0x49')]['id'];}return db[_0x42fa('0x2b')]['find']({'where':{'id':_0x89e70d['params']['id']}})[_0x42fa('0x27')](handleEntityNotFound(_0x27f6de,null))[_0x42fa('0x27')](saveUpdates(_0x89e70d[_0x42fa('0x49')],null))[_0x42fa('0x27')](respondWithResult(_0x27f6de,null))[_0x42fa('0x44')](handleError(_0x27f6de,null));};exports[_0x42fa('0x28')]=function(_0x573e1a,_0x25b7a3){return db[_0x42fa('0x2b')]['find']({'where':{'id':_0x573e1a[_0x42fa('0x46')]['id']}})[_0x42fa('0x27')](handleEntityNotFound(_0x25b7a3,null))[_0x42fa('0x27')](removeEntity(_0x25b7a3,null))[_0x42fa('0x44')](handleError(_0x25b7a3,null));}; \ No newline at end of file +var _0x5481=['map','keys','filters','intersection','query','fields','attributes','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','include','catch','show','length','includeAll','options','create','body','update','find','params','eml-format','rimraf','zip-dir','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','undefined','limit','count','status','set','Content-Range','save','then','destroy','error','stack','name','send','index','VoiceQueuesLog','rawAttributes','type','key','model'];(function(_0x2fa895,_0x44b2c3){var _0x2df77a=function(_0x149070){while(--_0x149070){_0x2fa895['push'](_0x2fa895['shift']());}};_0x2df77a(++_0x44b2c3);}(_0x5481,0x182));var _0x1548=function(_0x17d69a,_0x2edf2f){_0x17d69a=_0x17d69a-0x0;var _0x371ef5=_0x5481[_0x17d69a];return _0x371ef5;};'use strict';var emlformat=require(_0x1548('0x0'));var rimraf=require(_0x1548('0x1'));var zipdir=require(_0x1548('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x1548('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x1548('0x4'));var util=require(_0x1548('0x5'));var path=require(_0x1548('0x6'));var sox=require(_0x1548('0x7'));var csv=require(_0x1548('0x8'));var ejs=require(_0x1548('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x1548('0xa'));var squel=require(_0x1548('0xb'));var crypto=require(_0x1548('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x1548('0xd'));var Papa=require(_0x1548('0xe'));var Redis=require(_0x1548('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x1548('0x10'));var as=require(_0x1548('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1548('0x12'))(_0x1548('0x13'));var utils=require('../../config/utils');var config=require(_0x1548('0x14'));var licenseUtil=require(_0x1548('0x15'));var db=require(_0x1548('0x16'))['db'];function respondWithStatusCode(_0x207666,_0x4183aa){_0x4183aa=_0x4183aa||0xcc;return function(_0x17b896){if(_0x17b896){return _0x207666[_0x1548('0x17')](_0x4183aa);}return _0x207666['status'](_0x4183aa)[_0x1548('0x18')]();};}function respondWithResult(_0x1a90f2,_0x4cb620){_0x4cb620=_0x4cb620||0xc8;return function(_0x40e1c4){if(_0x40e1c4){return _0x1a90f2['status'](_0x4cb620)[_0x1548('0x19')](_0x40e1c4);}};}function respondWithFilteredResult(_0x15a5ea,_0x5db552){return function(_0x260fb7){if(_0x260fb7){var _0x4b014f=typeof _0x5db552[_0x1548('0x1a')]===_0x1548('0x1b')&&typeof _0x5db552[_0x1548('0x1c')]===_0x1548('0x1b');var _0x27d3d4=_0x260fb7[_0x1548('0x1d')];var _0x3c1005=_0x4b014f?0x0:_0x5db552[_0x1548('0x1a')];var _0x44c420=_0x4b014f?_0x260fb7[_0x1548('0x1d')]:_0x5db552[_0x1548('0x1a')]+_0x5db552[_0x1548('0x1c')];var _0x435920;if(_0x44c420>=_0x27d3d4){_0x44c420=_0x27d3d4;_0x435920=0xc8;}else{_0x435920=0xce;}_0x15a5ea[_0x1548('0x1e')](_0x435920);return _0x15a5ea[_0x1548('0x1f')](_0x1548('0x20'),_0x3c1005+'-'+_0x44c420+'/'+_0x27d3d4)[_0x1548('0x19')](_0x260fb7);}return null;};}function patchUpdates(_0x2a4ced){return function(_0x144f73){try{jsonpatch['apply'](_0x144f73,_0x2a4ced,!![]);}catch(_0x3760ad){return BPromise['reject'](_0x3760ad);}return _0x144f73[_0x1548('0x21')]();};}function saveUpdates(_0x4e3b5d,_0x59fceb){return function(_0x2c334d){if(_0x2c334d){return _0x2c334d['update'](_0x4e3b5d)[_0x1548('0x22')](function(_0x1dfb0e){return _0x1dfb0e;});}return null;};}function removeEntity(_0x500983,_0x46e7e8){return function(_0x39e227){if(_0x39e227){return _0x39e227[_0x1548('0x23')]()[_0x1548('0x22')](function(){_0x500983['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x30317c,_0x32bf8b){return function(_0x115c62){if(!_0x115c62){_0x30317c['sendStatus'](0x194);}return _0x115c62;};}function handleError(_0x25f780,_0x2ac9be){_0x2ac9be=_0x2ac9be||0x1f4;return function(_0x50c4d4){logger[_0x1548('0x24')](_0x50c4d4[_0x1548('0x25')]);if(_0x50c4d4[_0x1548('0x26')]){delete _0x50c4d4[_0x1548('0x26')];}_0x25f780[_0x1548('0x1e')](_0x2ac9be)[_0x1548('0x27')](_0x50c4d4);};}exports[_0x1548('0x28')]=function(_0x579a9c,_0x480f94){var _0xd58cc5={},_0x393707={},_0x56011c={'count':0x0,'rows':[]};var _0x220eb7=_['map'](db[_0x1548('0x29')][_0x1548('0x2a')],function(_0x3103fb){return{'name':_0x3103fb['fieldName'],'type':_0x3103fb[_0x1548('0x2b')][_0x1548('0x2c')]};});_0x393707[_0x1548('0x2d')]=_[_0x1548('0x2e')](_0x220eb7,_0x1548('0x26'));_0x393707['query']=_[_0x1548('0x2f')](_0x579a9c['query']);_0x393707[_0x1548('0x30')]=_[_0x1548('0x31')](_0x393707[_0x1548('0x2d')],_0x393707[_0x1548('0x32')]);_0xd58cc5['attributes']=_[_0x1548('0x31')](_0x393707[_0x1548('0x2d')],qs[_0x1548('0x33')](_0x579a9c[_0x1548('0x32')][_0x1548('0x33')]));_0xd58cc5[_0x1548('0x34')]=_0xd58cc5[_0x1548('0x34')]['length']?_0xd58cc5[_0x1548('0x34')]:_0x393707[_0x1548('0x2d')];if(!_0x579a9c[_0x1548('0x32')][_0x1548('0x35')](_0x1548('0x36'))){_0xd58cc5['limit']=qs[_0x1548('0x1c')](_0x579a9c[_0x1548('0x32')][_0x1548('0x1c')]);_0xd58cc5[_0x1548('0x1a')]=qs[_0x1548('0x1a')](_0x579a9c[_0x1548('0x32')][_0x1548('0x1a')]);}_0xd58cc5['order']=qs[_0x1548('0x37')](_0x579a9c['query'][_0x1548('0x37')]);_0xd58cc5[_0x1548('0x38')]=qs[_0x1548('0x30')](_[_0x1548('0x39')](_0x579a9c[_0x1548('0x32')],_0x393707[_0x1548('0x30')]),_0x220eb7);if(_0x579a9c[_0x1548('0x32')][_0x1548('0x3a')]){_0xd58cc5[_0x1548('0x38')]=_[_0x1548('0x3b')](_0xd58cc5['where'],{'$or':_[_0x1548('0x2e')](_0x220eb7,function(_0x24f997){if(_0x24f997['type']!==_0x1548('0x3c')){var _0x3ca77b={};_0x3ca77b[_0x24f997[_0x1548('0x26')]]={'$like':'%'+_0x579a9c['query']['filter']+'%'};return _0x3ca77b;}})});}_0xd58cc5=_[_0x1548('0x3b')]({},_0xd58cc5,_0x579a9c['options']);var _0x396683={'where':_0xd58cc5[_0x1548('0x38')]};return db[_0x1548('0x29')][_0x1548('0x1d')](_0x396683)[_0x1548('0x22')](function(_0x1da68){_0x56011c['count']=_0x1da68;if(_0x579a9c['query']['includeAll']){_0xd58cc5[_0x1548('0x3d')]=[{'all':!![]}];}return db[_0x1548('0x29')]['findAll'](_0xd58cc5);})['then'](function(_0x1c711b){_0x56011c['rows']=_0x1c711b;return _0x56011c;})['then'](respondWithFilteredResult(_0x480f94,_0xd58cc5))[_0x1548('0x3e')](handleError(_0x480f94,null));};exports[_0x1548('0x3f')]=function(_0x4163f,_0xe8c45a){var _0x36d4a9={'raw':!![],'where':{'id':_0x4163f['params']['id']}},_0x11221c={};_0x11221c[_0x1548('0x2d')]=_['keys'](db[_0x1548('0x29')][_0x1548('0x2a')]);_0x11221c['query']=_['keys'](_0x4163f[_0x1548('0x32')]);_0x11221c[_0x1548('0x30')]=_[_0x1548('0x31')](_0x11221c['model'],_0x11221c[_0x1548('0x32')]);_0x36d4a9[_0x1548('0x34')]=_[_0x1548('0x31')](_0x11221c['model'],qs['fields'](_0x4163f[_0x1548('0x32')][_0x1548('0x33')]));_0x36d4a9[_0x1548('0x34')]=_0x36d4a9['attributes'][_0x1548('0x40')]?_0x36d4a9[_0x1548('0x34')]:_0x11221c[_0x1548('0x2d')];if(_0x4163f[_0x1548('0x32')][_0x1548('0x41')]){_0x36d4a9[_0x1548('0x3d')]=[{'all':!![]}];}_0x36d4a9=_[_0x1548('0x3b')]({},_0x36d4a9,_0x4163f[_0x1548('0x42')]);return db['VoiceQueuesLog']['find'](_0x36d4a9)['then'](handleEntityNotFound(_0xe8c45a,null))[_0x1548('0x22')](respondWithResult(_0xe8c45a,null))[_0x1548('0x3e')](handleError(_0xe8c45a,null));};exports['create']=function(_0x414179,_0x496dd8){return db[_0x1548('0x29')][_0x1548('0x43')](_0x414179[_0x1548('0x44')],{})['then'](respondWithResult(_0x496dd8,0xc9))['catch'](handleError(_0x496dd8,null));};exports[_0x1548('0x45')]=function(_0x550e4a,_0x27b42e){if(_0x550e4a[_0x1548('0x44')]['id']){delete _0x550e4a[_0x1548('0x44')]['id'];}return db[_0x1548('0x29')][_0x1548('0x46')]({'where':{'id':_0x550e4a[_0x1548('0x47')]['id']}})[_0x1548('0x22')](handleEntityNotFound(_0x27b42e,null))[_0x1548('0x22')](saveUpdates(_0x550e4a[_0x1548('0x44')],null))[_0x1548('0x22')](respondWithResult(_0x27b42e,null))[_0x1548('0x3e')](handleError(_0x27b42e,null));};exports[_0x1548('0x23')]=function(_0x1985e0,_0x10c8f4){return db[_0x1548('0x29')]['find']({'where':{'id':_0x1985e0['params']['id']}})[_0x1548('0x22')](handleEntityNotFound(_0x10c8f4,null))['then'](removeEntity(_0x10c8f4,null))[_0x1548('0x3e')](handleError(_0x10c8f4,null));}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.model.js b/server/api/voiceQueuesLog/voiceQueuesLog.model.js index 5c634f6..cb038d1 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 _0xc6e6=['bluebird','request-promise','path','./voiceQueuesLog.attributes','exports','event','dtm','lodash','util','../../config/logger','api'];(function(_0x1aa92a,_0x5a0fe8){var _0x165352=function(_0x534831){while(--_0x534831){_0x1aa92a['push'](_0x1aa92a['shift']());}};_0x165352(++_0x5a0fe8);}(_0xc6e6,0xc2));var _0x6c6e=function(_0xabf730,_0x25d27f){_0xabf730=_0xabf730-0x0;var _0x9a272c=_0xc6e6[_0xabf730];return _0x9a272c;};'use strict';var _=require(_0x6c6e('0x0'));var util=require(_0x6c6e('0x1'));var logger=require(_0x6c6e('0x2'))(_0x6c6e('0x3'));var moment=require('moment');var BPromise=require(_0x6c6e('0x4'));var rp=require(_0x6c6e('0x5'));var fs=require('fs');var path=require(_0x6c6e('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x6c6e('0x7'));module[_0x6c6e('0x8')]=function(_0x4d2b66,_0x32c759){return _0x4d2b66['define']('VoiceQueuesLog',attributes,{'tableName':'voice_queues_log','paranoid':![],'indexes':[{'name':'event_dtm','fields':[_0x6c6e('0x9'),_0x6c6e('0xa')]}],'timestamps':![]});}; \ No newline at end of file +var _0x038d=['moment','bluebird','rimraf','../../config/environment','./voiceQueuesLog.attributes','define','VoiceQueuesLog','event_dtm','event','../../config/logger','api'];(function(_0x209fcd,_0x1ecccc){var _0x501d5e=function(_0x8d74fe){while(--_0x8d74fe){_0x209fcd['push'](_0x209fcd['shift']());}};_0x501d5e(++_0x1ecccc);}(_0x038d,0xae));var _0xd038=function(_0x2e834c,_0x273c5e){_0x2e834c=_0x2e834c-0x0;var _0x4ae616=_0x038d[_0x2e834c];return _0x4ae616;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xd038('0x0'))(_0xd038('0x1'));var moment=require(_0xd038('0x2'));var BPromise=require(_0xd038('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xd038('0x4'));var config=require(_0xd038('0x5'));var attributes=require(_0xd038('0x6'));module['exports']=function(_0x5b709c,_0x5d549e){return _0x5b709c[_0xd038('0x7')](_0xd038('0x8'),attributes,{'tableName':'voice_queues_log','paranoid':![],'indexes':[{'name':_0xd038('0x9'),'fields':[_0xd038('0xa'),'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 22453c9..41a1655 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 _0x4641=['../../config/logger','../../config/environment','client','http','request','then','info','request\x20sent','debug','stringify','error','code','message','VoiceQueuesLog,\x20%s,\x20%s','result','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0xd8233f,_0xe33360){var _0x19dd37=function(_0x34bd14){while(--_0x34bd14){_0xd8233f['push'](_0xd8233f['shift']());}};_0x19dd37(++_0xe33360);}(_0x4641,0x185));var _0x1464=function(_0x13d07a,_0x41efc3){_0x13d07a=_0x13d07a-0x0;var _0x5ee0ee=_0x4641[_0x13d07a];return _0x5ee0ee;};'use strict';var _=require('lodash');var util=require(_0x1464('0x0'));var moment=require(_0x1464('0x1'));var BPromise=require(_0x1464('0x2'));var rs=require(_0x1464('0x3'));var fs=require('fs');var Redis=require(_0x1464('0x4'));var db=require(_0x1464('0x5'))['db'];var utils=require(_0x1464('0x6'));var logger=require(_0x1464('0x7'))('rpc');var config=require(_0x1464('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x1464('0x9')][_0x1464('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1c2e86,_0x5a40d9,_0x1d298a){return new BPromise(function(_0x226cde,_0x1b711b){return client[_0x1464('0xb')](_0x1c2e86,_0x1d298a)[_0x1464('0xc')](function(_0x1e1c85){logger[_0x1464('0xd')]('VoiceQueuesLog,\x20%s,\x20%s',_0x5a40d9,_0x1464('0xe'));logger[_0x1464('0xf')]('VoiceQueuesLog,\x20%s,\x20%s,\x20%s',_0x5a40d9,'request\x20sent',JSON[_0x1464('0x10')](_0x1e1c85));if(_0x1e1c85[_0x1464('0x11')]){if(_0x1e1c85[_0x1464('0x11')][_0x1464('0x12')]===0x1f4){logger['error']('VoiceQueuesLog,\x20%s,\x20%s',_0x5a40d9,_0x1e1c85[_0x1464('0x11')]['message']);return _0x1b711b(_0x1e1c85[_0x1464('0x11')][_0x1464('0x13')]);}logger[_0x1464('0x11')](_0x1464('0x14'),_0x5a40d9,_0x1e1c85[_0x1464('0x11')]['message']);return _0x226cde(_0x1e1c85[_0x1464('0x11')][_0x1464('0x13')]);}else{logger['info']('VoiceQueuesLog,\x20%s,\x20%s',_0x5a40d9,_0x1464('0xe'));_0x226cde(_0x1e1c85[_0x1464('0x15')]['message']);}})['catch'](function(_0x1bcb38){logger[_0x1464('0x11')](_0x1464('0x14'),_0x5a40d9,_0x1bcb38);_0x1b711b(_0x1bcb38);});});} \ No newline at end of file +var _0x6c38=['then','request\x20sent','debug','error','code','VoiceQueuesLog,\x20%s,\x20%s','message','info','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/environment','client','request'];(function(_0x56ba92,_0xb3c986){var _0x8fe94d=function(_0x23b21c){while(--_0x23b21c){_0x56ba92['push'](_0x56ba92['shift']());}};_0x8fe94d(++_0xb3c986);}(_0x6c38,0x8f));var _0x86c3=function(_0x1bca50,_0x5ae547){_0x1bca50=_0x1bca50-0x0;var _0x49352b=_0x6c38[_0x1bca50];return _0x49352b;};'use strict';var _=require(_0x86c3('0x0'));var util=require(_0x86c3('0x1'));var moment=require(_0x86c3('0x2'));var BPromise=require(_0x86c3('0x3'));var rs=require(_0x86c3('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x86c3('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x86c3('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x86c3('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x49ff58,_0x3a8924,_0xbde89c){return new BPromise(function(_0x224109,_0x5e6afe){return client[_0x86c3('0x8')](_0x49ff58,_0xbde89c)[_0x86c3('0x9')](function(_0x4df76e){logger['info']('VoiceQueuesLog,\x20%s,\x20%s',_0x3a8924,_0x86c3('0xa'));logger[_0x86c3('0xb')]('VoiceQueuesLog,\x20%s,\x20%s,\x20%s',_0x3a8924,_0x86c3('0xa'),JSON['stringify'](_0x4df76e));if(_0x4df76e[_0x86c3('0xc')]){if(_0x4df76e[_0x86c3('0xc')][_0x86c3('0xd')]===0x1f4){logger[_0x86c3('0xc')](_0x86c3('0xe'),_0x3a8924,_0x4df76e[_0x86c3('0xc')]['message']);return _0x5e6afe(_0x4df76e[_0x86c3('0xc')][_0x86c3('0xf')]);}logger['error'](_0x86c3('0xe'),_0x3a8924,_0x4df76e[_0x86c3('0xc')]['message']);return _0x224109(_0x4df76e[_0x86c3('0xc')]['message']);}else{logger[_0x86c3('0x10')](_0x86c3('0xe'),_0x3a8924,_0x86c3('0xa'));_0x224109(_0x4df76e[_0x86c3('0x11')][_0x86c3('0xf')]);}})[_0x86c3('0x12')](function(_0x2153dc){logger['error'](_0x86c3('0xe'),_0x3a8924,_0x2153dc);_0x5e6afe(_0x2153dc);});});} \ No newline at end of file diff --git a/server/api/voiceRecording/index.js b/server/api/voiceRecording/index.js index cca2000..0b6003d 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 _0x80c6=['put','update','delete','/:id','destroy','exports','multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceRecording.controller','get','isAuthenticated','/describe','show','download','/:id/downloads','/:id/transcribe','downloadTranscribe','create','post'];(function(_0x38bc80,_0x1e9f2d){var _0x378790=function(_0xad16da){while(--_0xad16da){_0x38bc80['push'](_0x38bc80['shift']());}};_0x378790(++_0x1e9f2d);}(_0x80c6,0x1e1));var _0x680c=function(_0x1b0cc8,_0x6e3392){_0x1b0cc8=_0x1b0cc8-0x0;var _0x441d1a=_0x80c6[_0x1b0cc8];return _0x441d1a;};'use strict';var multer=require(_0x680c('0x0'));var util=require(_0x680c('0x1'));var path=require('path');var timeout=require(_0x680c('0x2'));var express=require('express');var router=express[_0x680c('0x3')]();var fs_extra=require(_0x680c('0x4'));var auth=require(_0x680c('0x5'));var interaction=require(_0x680c('0x6'));var config=require(_0x680c('0x7'));var controller=require(_0x680c('0x8'));router[_0x680c('0x9')]('/',auth[_0x680c('0xa')](),controller['index']);router[_0x680c('0x9')](_0x680c('0xb'),auth[_0x680c('0xa')](),controller['describe']);router['get']('/:id',auth[_0x680c('0xa')](),controller[_0x680c('0xc')]);router['get']('/:id/download',auth[_0x680c('0xa')](),controller[_0x680c('0xd')]);router[_0x680c('0x9')](_0x680c('0xe'),controller['downloads']);router[_0x680c('0x9')](_0x680c('0xf'),auth[_0x680c('0xa')](),controller[_0x680c('0x10')]);router['post']('/',auth['isAuthenticated'](),controller[_0x680c('0x11')]);router[_0x680c('0x12')](_0x680c('0xf'),auth[_0x680c('0xa')](),controller['runTranscribe']);router[_0x680c('0x13')]('/:id',auth['isAuthenticated'](),controller[_0x680c('0x14')]);router[_0x680c('0x15')](_0x680c('0x16'),auth[_0x680c('0xa')](),controller[_0x680c('0x17')]);module[_0x680c('0x18')]=router; \ No newline at end of file +var _0x4522=['index','/describe','describe','/:id','show','/:id/download','download','/:id/downloads','downloadTranscribe','create','runTranscribe','update','destroy','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./voiceRecording.controller','get','isAuthenticated'];(function(_0x29969b,_0x2982c4){var _0x16bdad=function(_0x4ad3b5){while(--_0x4ad3b5){_0x29969b['push'](_0x29969b['shift']());}};_0x16bdad(++_0x2982c4);}(_0x4522,0x85));var _0x2452=function(_0x26b88e,_0x178047){_0x26b88e=_0x26b88e-0x0;var _0x55d2d3=_0x4522[_0x26b88e];return _0x55d2d3;};'use strict';var multer=require(_0x2452('0x0'));var util=require('util');var path=require(_0x2452('0x1'));var timeout=require(_0x2452('0x2'));var express=require(_0x2452('0x3'));var router=express[_0x2452('0x4')]();var fs_extra=require(_0x2452('0x5'));var auth=require(_0x2452('0x6'));var interaction=require(_0x2452('0x7'));var config=require('../../config/environment');var controller=require(_0x2452('0x8'));router[_0x2452('0x9')]('/',auth[_0x2452('0xa')](),controller[_0x2452('0xb')]);router['get'](_0x2452('0xc'),auth[_0x2452('0xa')](),controller[_0x2452('0xd')]);router[_0x2452('0x9')](_0x2452('0xe'),auth[_0x2452('0xa')](),controller[_0x2452('0xf')]);router['get'](_0x2452('0x10'),auth['isAuthenticated'](),controller[_0x2452('0x11')]);router['get'](_0x2452('0x12'),controller['downloads']);router[_0x2452('0x9')]('/:id/transcribe',auth['isAuthenticated'](),controller[_0x2452('0x13')]);router['post']('/',auth[_0x2452('0xa')](),controller[_0x2452('0x14')]);router['post']('/:id/transcribe',auth[_0x2452('0xa')](),controller[_0x2452('0x15')]);router['put'](_0x2452('0xe'),auth[_0x2452('0xa')](),controller[_0x2452('0x16')]);router['delete']('/:id',auth[_0x2452('0xa')](),controller[_0x2452('0x17')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.attributes.js b/server/api/voiceRecording/voiceRecording.attributes.js index 1eafc4b..a950dbb 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(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3a6efd,_0x2a5102){_0x3a6efd=_0x3a6efd-0x0;var _0x487b9a=_0xa9e0[_0x3a6efd];return _0x487b9a;};'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(_0x243b59,_0x3f9495){var _0x3e1676=function(_0x354052){while(--_0x354052){_0x243b59['push'](_0x243b59['shift']());}};_0x3e1676(++_0x3f9495);}(_0xa9e0,0x123));var _0x0a9e=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xa9e0[_0x19e35c];return _0x3e1fe8;};'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 f407fd4..9d2a918 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 _0x5936=['Name','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available','NEW','[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested','IN_PROGRESS','tempSentiment','updateAttributes','writeFile','fileText','root','/server/files/transcribes/transcribe_','.txt','Transcript\x20not\x20available','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','lodash','crypto','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','reject','save','then','destroy','error','stack','name','index','VoiceRecording','type','key','model','differenceBy','format','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','merge','map','VIRTUAL','filter','options','count','include','findAll','rows','catch','rawAttributes','includeAll','find','create','body','update','params','describe','../../components/encryptor','uniqueid','value','existsSync','decryptFile','recording','Sequelize','ValidationError','download','filename','extname','unlink','message','VoiceRecording\x20not\x20found','send','Not\x20found','downloads','sequelize','token','push','$and','%s.cypher','secrets','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','isNil','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','.cypher','unlinkSync','listBuckets','TranscribeService','[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s','basename','readFileSync','Location','bucket','Bucket','location','[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request','[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created','TranscriptionJob','TranscriptionJobName','transcribeName','transcribeStatus','TranscriptionJobStatus','runTranscribe','findOne','Voice\x20Recording\x20not\x20found','Setting','transcribe','transcribeAccountId','language','Transcribe\x20not\x20configured','sentimentAccountId','Sentiment\x20Analysis\x20not\x20configured','CloudProvider','Cloud\x20Provider\x20not\x20available','data1','Cloud\x20Provider\x20not\x20configured','data2','transcribeRegion'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x5936,0x137));var _0x6593=function(_0x177a54,_0x5752c5){_0x177a54=_0x177a54-0x0;var _0xe21798=_0x5936[_0x177a54];return _0xe21798;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6593('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6593('0x1'));var rp=require(_0x6593('0x2'));var moment=require(_0x6593('0x3'));var BPromise=require(_0x6593('0x4'));var Mustache=require(_0x6593('0x5'));var util=require('util');var path=require(_0x6593('0x6'));var sox=require('sox');var csv=require(_0x6593('0x7'));var ejs=require(_0x6593('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6593('0x9'));var squel=require('squel');var crypto=require(_0x6593('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x6593('0xb'));var toCsv=require(_0x6593('0x7'));var querystring=require('querystring');var Papa=require(_0x6593('0xc'));var AWS=require('aws-sdk');var uuidv4=require('uuid/v4');var Redis=require('ioredis');var authService=require(_0x6593('0xd'));var qs=require(_0x6593('0xe'));var as=require(_0x6593('0xf'));var hardwareService=require(_0x6593('0x10'));var logger=require(_0x6593('0x11'))('api');var utils=require(_0x6593('0x12'));var config=require(_0x6593('0x13'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x39e774,_0x53e799){_0x53e799=_0x53e799||0xcc;return function(_0x271e7b){if(_0x271e7b){return _0x39e774[_0x6593('0x14')](_0x53e799);}return _0x39e774[_0x6593('0x15')](_0x53e799)[_0x6593('0x16')]();};}function respondWithResult(_0x1d3ee4,_0x42662a){_0x42662a=_0x42662a||0xc8;return function(_0x3a01aa){if(_0x3a01aa){return _0x1d3ee4[_0x6593('0x15')](_0x42662a)[_0x6593('0x17')](_0x3a01aa);}};}function respondWithFilteredResult(_0x96cca4,_0x587792){return function(_0x1627b7){if(_0x1627b7){var _0x21e7f6=typeof _0x587792[_0x6593('0x18')]===_0x6593('0x19')&&typeof _0x587792[_0x6593('0x1a')]===_0x6593('0x19');var _0x2327ce=_0x1627b7['count'];var _0x2c76fc=_0x21e7f6?0x0:_0x587792[_0x6593('0x18')];var _0x1b51ce=_0x21e7f6?_0x1627b7['count']:_0x587792['offset']+_0x587792[_0x6593('0x1a')];var _0x37c8b6;if(_0x1b51ce>=_0x2327ce){_0x1b51ce=_0x2327ce;_0x37c8b6=0xc8;}else{_0x37c8b6=0xce;}_0x96cca4[_0x6593('0x15')](_0x37c8b6);return _0x96cca4[_0x6593('0x1b')](_0x6593('0x1c'),_0x2c76fc+'-'+_0x1b51ce+'/'+_0x2327ce)['json'](_0x1627b7);}return null;};}function patchUpdates(_0x3c118a){return function(_0x57f5ef){try{jsonpatch['apply'](_0x57f5ef,_0x3c118a,!![]);}catch(_0x410912){return BPromise[_0x6593('0x1d')](_0x410912);}return _0x57f5ef[_0x6593('0x1e')]();};}function saveUpdates(_0x351e7c,_0x14016d){return function(_0x4315ca){if(_0x4315ca){return _0x4315ca['update'](_0x351e7c)[_0x6593('0x1f')](function(_0x32d4bd){return _0x32d4bd;});}return null;};}function removeEntity(_0x4bd246,_0x1b375c){return function(_0x33ff2f){if(_0x33ff2f){return _0x33ff2f[_0x6593('0x20')]()[_0x6593('0x1f')](function(){_0x4bd246['status'](0xcc)[_0x6593('0x16')]();});}};}function handleEntityNotFound(_0x10fb5f,_0x278fda){return function(_0x7e2ef8){if(!_0x7e2ef8){_0x10fb5f['sendStatus'](0x194);}return _0x7e2ef8;};}function handleError(_0x3c0e28,_0x37bbd2){_0x37bbd2=_0x37bbd2||0x1f4;return function(_0x522446){logger[_0x6593('0x21')](_0x522446[_0x6593('0x22')]);if(_0x522446['name']){delete _0x522446[_0x6593('0x23')];}_0x3c0e28['status'](_0x37bbd2)['send'](_0x522446);};}exports[_0x6593('0x24')]=function(_0x2119e9,_0x713d65){var _0x388a3c={},_0x10d18b={},_0x3b6540={'count':0x0,'rows':[]};var _0x3e5746=_['map'](db[_0x6593('0x25')]['rawAttributes'],function(_0x38cc6b){return{'name':_0x38cc6b['fieldName'],'type':_0x38cc6b[_0x6593('0x26')][_0x6593('0x27')]};});_0x10d18b[_0x6593('0x28')]=_[_0x6593('0x29')](_['map'](_0x3e5746,'name'),[_0x6593('0x2a')]);_0x10d18b[_0x6593('0x2b')]=_[_0x6593('0x2c')](_0x2119e9[_0x6593('0x2b')]);_0x10d18b['filters']=_[_0x6593('0x2d')](_0x10d18b[_0x6593('0x28')],_0x10d18b[_0x6593('0x2b')]);_0x388a3c[_0x6593('0x2e')]=_['intersection'](_0x10d18b[_0x6593('0x28')],qs[_0x6593('0x2f')](_0x2119e9['query'][_0x6593('0x2f')]));_0x388a3c[_0x6593('0x2e')]=_0x388a3c[_0x6593('0x2e')][_0x6593('0x30')]?_0x388a3c['attributes']:_0x10d18b[_0x6593('0x28')];if(!_0x2119e9[_0x6593('0x2b')][_0x6593('0x31')](_0x6593('0x32'))){_0x388a3c[_0x6593('0x1a')]=qs[_0x6593('0x1a')](_0x2119e9[_0x6593('0x2b')][_0x6593('0x1a')]);_0x388a3c[_0x6593('0x18')]=qs[_0x6593('0x18')](_0x2119e9['query'][_0x6593('0x18')]);}_0x388a3c[_0x6593('0x33')]=qs[_0x6593('0x34')](_0x2119e9[_0x6593('0x2b')][_0x6593('0x34')]);_0x388a3c[_0x6593('0x35')]=qs[_0x6593('0x36')](_['pick'](_0x2119e9['query'],_0x10d18b[_0x6593('0x36')]),_0x3e5746);if(_0x2119e9[_0x6593('0x2b')]['filter']){_0x388a3c[_0x6593('0x35')]=_[_0x6593('0x37')](_0x388a3c['where'],{'$or':_[_0x6593('0x38')](_0x3e5746,function(_0x2fbb9f){if(_0x2fbb9f[_0x6593('0x26')]!==_0x6593('0x39')){var _0x28d0bb={};_0x28d0bb[_0x2fbb9f[_0x6593('0x23')]]={'$like':'%'+_0x2119e9[_0x6593('0x2b')][_0x6593('0x3a')]+'%'};return _0x28d0bb;}})});}_0x388a3c=_['merge']({},_0x388a3c,_0x2119e9[_0x6593('0x3b')]);var _0x153e71={'where':_0x388a3c['where']};return db['VoiceRecording'][_0x6593('0x3c')](_0x153e71)['then'](function(_0x5d66c5){_0x3b6540[_0x6593('0x3c')]=_0x5d66c5;if(_0x2119e9[_0x6593('0x2b')]['includeAll']){_0x388a3c[_0x6593('0x3d')]=[{'all':!![]}];}return db[_0x6593('0x25')][_0x6593('0x3e')](_0x388a3c);})['then'](function(_0x2820e2){_0x3b6540[_0x6593('0x3f')]=_0x2820e2;return _0x3b6540;})['then'](respondWithFilteredResult(_0x713d65,_0x388a3c))[_0x6593('0x40')](handleError(_0x713d65,null));};exports['show']=function(_0x2cf8b5,_0x529fd5){var _0x504e0d={'raw':![],'where':{'id':_0x2cf8b5['params']['id']}},_0x2cc82b={};_0x2cc82b[_0x6593('0x28')]=_[_0x6593('0x2c')](db[_0x6593('0x25')][_0x6593('0x41')]);_0x2cc82b[_0x6593('0x2b')]=_[_0x6593('0x2c')](_0x2cf8b5[_0x6593('0x2b')]);_0x2cc82b[_0x6593('0x36')]=_['intersection'](_0x2cc82b[_0x6593('0x28')],_0x2cc82b[_0x6593('0x2b')]);_0x504e0d['attributes']=_['intersection'](_0x2cc82b['model'],qs['fields'](_0x2cf8b5[_0x6593('0x2b')][_0x6593('0x2f')]));_0x504e0d['attributes']=_0x504e0d['attributes'][_0x6593('0x30')]?_0x504e0d[_0x6593('0x2e')]:_0x2cc82b[_0x6593('0x28')];if(_0x2cf8b5[_0x6593('0x2b')][_0x6593('0x42')]){_0x504e0d[_0x6593('0x3d')]=[{'all':!![]}];}_0x504e0d=_['merge']({},_0x504e0d,_0x2cf8b5[_0x6593('0x3b')]);return db[_0x6593('0x25')][_0x6593('0x43')](_0x504e0d)['then'](handleEntityNotFound(_0x529fd5,null))[_0x6593('0x1f')](respondWithResult(_0x529fd5,null))[_0x6593('0x40')](handleError(_0x529fd5,null));};exports[_0x6593('0x44')]=function(_0x15c75f,_0x2c53e7){return db[_0x6593('0x25')][_0x6593('0x44')](_0x15c75f[_0x6593('0x45')],{})[_0x6593('0x1f')](respondWithResult(_0x2c53e7,0xc9))[_0x6593('0x40')](handleError(_0x2c53e7,null));};exports[_0x6593('0x46')]=function(_0x5ee0c8,_0x778a31){if(_0x5ee0c8['body']['id']){delete _0x5ee0c8[_0x6593('0x45')]['id'];}return db['VoiceRecording']['find']({'where':{'id':_0x5ee0c8[_0x6593('0x47')]['id']}})[_0x6593('0x1f')](handleEntityNotFound(_0x778a31,null))[_0x6593('0x1f')](saveUpdates(_0x5ee0c8['body'],null))[_0x6593('0x1f')](respondWithResult(_0x778a31,null))['catch'](handleError(_0x778a31,null));};exports[_0x6593('0x48')]=function(_0x34efc9,_0x1c59c3){return db['VoiceRecording'][_0x6593('0x48')]()[_0x6593('0x1f')](respondWithResult(_0x1c59c3,null))['catch'](handleError(_0x1c59c3,null));};exports['download']=function(_0x1cbd12,_0xf21ff4,_0x51975b){var _0x2b18d8=require(_0x6593('0x49'));var _0x54d7be=![];var _0x1f5b81={};if(_0x1cbd12[_0x6593('0x2b')][_0x6593('0x26')]&&_0x1cbd12[_0x6593('0x2b')]['type']==='uniqueid'){_0x1f5b81[_0x6593('0x4a')]=_0x1cbd12['params']['id'];}else{_0x1f5b81['id']=_0x1cbd12[_0x6593('0x47')]['id'];}return db[_0x6593('0x25')]['find']({'where':_0x1f5b81,'attributes':['id',_0x6593('0x4b')],'raw':!![]})[_0x6593('0x1f')](handleEntityNotFound(_0xf21ff4,null))[_0x6593('0x1f')](function(_0x1b8781){if(_0x1b8781){var _0x308c80=_0x1b8781[_0x6593('0x4b')];var _0x1b81be=util[_0x6593('0x2a')]('%s.cypher',_0x308c80);if(fs[_0x6593('0x4c')](_0x1b81be)){_0x54d7be=!![];return _0x2b18d8[_0x6593('0x4d')](_0x1b81be,_0x308c80,config['secrets'][_0x6593('0x4e')])['then'](function(){return _0x1b8781;});}return _0x1b8781;}})[_0x6593('0x1f')](function(_0x48d5dd){if(_0x48d5dd){var _0x3b7a65=_0x48d5dd[_0x6593('0x4b')];if(!fs[_0x6593('0x4c')](_0x3b7a65)){throw new db[(_0x6593('0x4f'))][(_0x6593('0x50'))]('VoiceRecording\x20not\x20found');}if(_0x48d5dd['filename']){return _0xf21ff4[_0x6593('0x51')](_0x3b7a65,_0x48d5dd[_0x6593('0x52')]+path[_0x6593('0x53')](_0x3b7a65),function(){if(_0x54d7be){fs['unlink'](_0x3b7a65);}});}else{return _0xf21ff4['download'](_0x3b7a65,function(_0x691eb0){if(_0x54d7be){fs[_0x6593('0x54')](_0x3b7a65);}});}}})[_0x6593('0x40')](function(_0xcfc50b){if(_0xcfc50b[_0x6593('0x55')]===_0x6593('0x56')){_0xf21ff4[_0x6593('0x15')](0x194)[_0x6593('0x57')](_0x6593('0x58'));}else{return handleError(_0xf21ff4,null);}});};exports[_0x6593('0x59')]=function(_0x169861,_0xf53808,_0x47ee4b){var _0x33a537=require('../../components/encryptor');var _0x5e2b64=![];var _0x23e53c={'$and':[db[_0x6593('0x5a')][_0x6593('0x35')](db[_0x6593('0x5a')]['fn']('MD5',db[_0x6593('0x5a')]['col'](_0x6593('0x4a'))),_0x169861[_0x6593('0x2b')][_0x6593('0x5b')])]};if(_0x169861[_0x6593('0x2b')][_0x6593('0x26')]&&_0x169861['query'][_0x6593('0x26')]==='uniqueid'){_0x23e53c['$and'][_0x6593('0x5c')]({'uniqueid':_0x169861[_0x6593('0x47')]['id']});}else{_0x23e53c[_0x6593('0x5d')][_0x6593('0x5c')]({'id':_0x169861['params']['id']});}return db[_0x6593('0x25')]['find']({'where':_0x23e53c,'attributes':['id',_0x6593('0x4b')],'raw':!![]})['then'](handleEntityNotFound(_0xf53808,null))[_0x6593('0x1f')](function(_0x1bbf1b){if(_0x1bbf1b){var _0x55dc6c=util[_0x6593('0x2a')](_0x6593('0x5e'),_0x1bbf1b[_0x6593('0x4b')]);if(fs[_0x6593('0x4c')](_0x55dc6c)){_0x5e2b64=!![];return _0x33a537[_0x6593('0x4d')](_0x55dc6c,_0x1bbf1b[_0x6593('0x4b')],config[_0x6593('0x5f')][_0x6593('0x4e')])[_0x6593('0x1f')](function(){return _0x1bbf1b;});}return _0x1bbf1b;}})[_0x6593('0x1f')](function(_0x4520f6){if(_0x4520f6){if(!fs[_0x6593('0x4c')](_0x4520f6['value'])){throw new db[(_0x6593('0x4f'))]['ValidationError'](_0x6593('0x56'));}if(_0x4520f6[_0x6593('0x52')]){return _0xf53808[_0x6593('0x51')](_0x4520f6[_0x6593('0x4b')],_0x4520f6[_0x6593('0x52')]+path['extname'](_0x4520f6[_0x6593('0x4b')]),function(){if(_0x5e2b64){fs['unlink'](_0x4520f6['value']);}});}else{return _0xf53808[_0x6593('0x51')](_0x4520f6['value'],function(_0x316513){if(_0x5e2b64){fs[_0x6593('0x54')](_0x4520f6[_0x6593('0x4b')]);}});}}})[_0x6593('0x40')](handleError(_0xf53808,null));};exports['destroy']=function(_0xbfa0f,_0x5799a2){return db['VoiceRecording'][_0x6593('0x43')]({'where':{'id':_0xbfa0f[_0x6593('0x47')]['id']}})['then'](function(_0x23a226){if(_['isNil'](_0x23a226)){throw new ReferenceError(_0x6593('0x60'));}return _0x23a226;})[_0x6593('0x1f')](function(_0x4503bc){var _0x1fdbc4=_0x4503bc[_0x6593('0x4b')];logger[_0x6593('0x61')](_0x6593('0x62'),_0x1fdbc4);if(!_[_0x6593('0x63')](_0x4503bc[_0x6593('0x4b')])&&fs[_0x6593('0x4c')](_0x1fdbc4)){logger[_0x6593('0x61')](_0x6593('0x64')+_0x1fdbc4+_0x6593('0x65'));fs['unlinkSync'](_0x1fdbc4);}_0x1fdbc4=_0x1fdbc4+_0x6593('0x66');if(!_['isNil'](_0x4503bc['value'])&&fs[_0x6593('0x4c')](_0x1fdbc4)){logger[_0x6593('0x61')](_0x6593('0x64')+_0x1fdbc4+_0x6593('0x65'));fs[_0x6593('0x67')](_0x1fdbc4);}return _0x4503bc;})[_0x6593('0x1f')](function(_0x1e29a1){if(!_0x1e29a1)throw new InternalError();return _0x1e29a1['destroy']();})['then'](function(){_0x5799a2[_0x6593('0x15')](0xcc)[_0x6593('0x16')]();})[_0x6593('0x40')](handleError(_0x5799a2,null));};function getBucketslist(_0x2850d2,_0x4ecb3a,_0x357a79){return new Promise(function(_0xd014e0,_0xdcbfde){var _0x135fb0=new AWS['S3']({'accessKeyId':_0x4ecb3a,'secretAccessKey':_0x2850d2,'region':_0x357a79});_0x135fb0[_0x6593('0x68')]({},function(_0x5e525e,_0x357bf4){if(_0x5e525e){return _0xdcbfde(_0x5e525e);}else{return _0xd014e0(_0x357bf4);}});});}function createBucket(_0x5f23e9,_0x3f4d4f,_0x3eecce,_0x34ad73){return new Promise(function(_0x1bb59b,_0x14a5e4){var _0x21b25e=new AWS['S3']({'accessKeyId':_0x3f4d4f,'secretAccessKey':_0x5f23e9,'region':_0x3eecce});_0x21b25e['createBucket']({'Bucket':_0x34ad73},function(_0x471c8a,_0x4edd81){if(_0x471c8a){return _0x14a5e4(_0x471c8a);}else{return _0x1bb59b(_0x4edd81);}});});}function uploadFile(_0x2e295e,_0x25cb0d,_0x279b58,_0x4eccd1,_0x30b869,_0x4fabd7){return new Promise(function(_0x3f96d8,_0x334ed3){var _0x354c91=new AWS['S3']({'accessKeyId':_0x25cb0d,'secretAccessKey':_0x2e295e,'region':_0x279b58});_0x354c91['upload']({'Bucket':_0x4eccd1,'Key':_0x30b869,'Body':_0x4fabd7},function(_0x3e270f,_0x1050a9){if(_0x3e270f){return _0x334ed3(_0x3e270f);}else{return _0x3f96d8(_0x1050a9);}});});}function startTranscribe(_0x183a5f,_0x4b2aa2,_0x1e0afd,_0xc7c0fa,_0xb34e7d,_0x159c37){return new Promise(function(_0xc32044,_0x149747){var _0x2c9116=new AWS[(_0x6593('0x69'))]({'accessKeyId':_0x4b2aa2,'secretAccessKey':_0x183a5f,'region':_0x1e0afd});_0x2c9116['startTranscriptionJob']({'TranscriptionJobName':_0xc7c0fa,'LanguageCode':_0xb34e7d,'Media':{'MediaFileUri':_0x159c37}},function(_0x50f9d8,_0x30e4f1){if(_0x50f9d8){return _0x149747(_0x50f9d8);}else{return _0xc32044(_0x30e4f1);}});});}function transcribe(_0x189c4b,_0x18fd91,_0x1503a6,_0x24e537,_0x4640c2,_0xd97fb1,_0x58ab9a){return new Promise(function(_0x2f05d0,_0xe0e2a6){var _0x4f7531={};logger[_0x6593('0x61')](util[_0x6593('0x2a')](_0x6593('0x6a'),_0x189c4b,_0x4640c2));return uploadFile(_0x18fd91,_0x1503a6,_0x24e537,_0x4640c2,path[_0x6593('0x6b')](_0xd97fb1),fs[_0x6593('0x6c')](_0xd97fb1))[_0x6593('0x1f')](function(_0x388c15){logger[_0x6593('0x61')](util[_0x6593('0x2a')]('[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)',_0x189c4b,_0x4640c2,_0x388c15[_0x6593('0x6d')]));_0x4f7531[_0x6593('0x6e')]=_0x388c15[_0x6593('0x6f')];_0x4f7531[_0x6593('0x70')]=_0x388c15[_0x6593('0x6d')];logger[_0x6593('0x61')](util[_0x6593('0x2a')](_0x6593('0x71'),_0x189c4b));return startTranscribe(_0x18fd91,_0x1503a6,_0x24e537,uuidv4(),_0x58ab9a,_0x388c15[_0x6593('0x6d')]);})['then'](function(_0x48eb98){logger[_0x6593('0x61')](util['format'](_0x6593('0x72'),_0x189c4b,_0x48eb98[_0x6593('0x73')][_0x6593('0x74')]));_0x4f7531[_0x6593('0x75')]=_0x48eb98['TranscriptionJob'][_0x6593('0x74')];_0x4f7531[_0x6593('0x76')]=_0x48eb98['TranscriptionJob'][_0x6593('0x77')];return _0x2f05d0(_0x4f7531);})['catch'](function(_0x8138a5){return _0xe0e2a6(_0x8138a5);});});}exports[_0x6593('0x78')]=function(_0x30445e,_0xcbabe2,_0xd4787f){var _0x317d6d;var _0x14e729;var _0x1ff8b7;var _0x186730=require('../../components/encryptor');return db[_0x6593('0x25')][_0x6593('0x79')]({'where':{'id':_0x30445e['params']['id']}})[_0x6593('0x1f')](function(_0x16b5fb){if(_0x16b5fb){var _0x512e30=util[_0x6593('0x2a')](_0x6593('0x5e'),_0x16b5fb[_0x6593('0x4b')]);if(fs[_0x6593('0x4c')](_0x512e30)){cypher=!![];return _0x186730['decryptFile'](_0x512e30,_0x16b5fb['value'],config[_0x6593('0x5f')][_0x6593('0x4e')])[_0x6593('0x1f')](function(){return _0x16b5fb;});}return _0x16b5fb;}})['then'](function(_0x98c188){if(!_0x98c188){throw new db[(_0x6593('0x4f'))][(_0x6593('0x50'))](_0x6593('0x7a'));}_0x14e729=_0x98c188;return db[_0x6593('0x7b')]['findOne']({'where':{'id':0x1}});})['then'](handleEntityNotFound(_0xcbabe2,null))[_0x6593('0x1f')](function(_0x1a917d){if(_0x1a917d){_0x317d6d=_0x1a917d;if(!_0x317d6d[_0x6593('0x7c')]||!_0x317d6d[_0x6593('0x7d')]||!_0x317d6d['transcribeRegion']||!_0x317d6d[_0x6593('0x7e')]||!_0x317d6d['bucket']){throw new db[(_0x6593('0x4f'))][(_0x6593('0x50'))](_0x6593('0x7f'));}if(_0x30445e[_0x6593('0x45')]['runSentiment']&&(!_0x317d6d['sentiment']||!_0x317d6d[_0x6593('0x80')]||!_0x317d6d['sentimentRegion']||!_0x317d6d[_0x6593('0x7e')]||!_0x317d6d[_0x6593('0x6e')])){throw new db[(_0x6593('0x4f'))][(_0x6593('0x50'))](_0x6593('0x81'));}return db[_0x6593('0x82')][_0x6593('0x79')]({'where':{'id':_0x317d6d['transcribeAccountId']}});}})['then'](function(_0x43a043){if(!_0x43a043){throw new db['Sequelize'][(_0x6593('0x50'))](_0x6593('0x83'));}if(!_0x43a043[_0x6593('0x84')]||!_0x43a043['data2']){throw new db[(_0x6593('0x4f'))][(_0x6593('0x50'))](_0x6593('0x85'));}_0x1ff8b7=_0x43a043;return getBucketslist(_0x1ff8b7[_0x6593('0x84')],_0x1ff8b7[_0x6593('0x86')],_0x317d6d[_0x6593('0x87')]);})['then'](function(_0x470627){if(_0x470627&&_0x470627['Buckets']){var _0xf74934=_[_0x6593('0x43')](_0x470627['Buckets'],function(_0x438fed){return _0x438fed[_0x6593('0x88')]===_0x317d6d[_0x6593('0x6e')];});if(!_0xf74934){logger[_0x6593('0x61')](util[_0x6593('0x2a')]('[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available',_0x30445e[_0x6593('0x47')]['id'],_0x317d6d[_0x6593('0x6e')]));return createBucket(_0x1ff8b7[_0x6593('0x84')],_0x1ff8b7['data2'],_0x317d6d['transcribeRegion'],_0x317d6d['bucket']);}logger[_0x6593('0x61')](util[_0x6593('0x2a')](_0x6593('0x89'),_0x30445e[_0x6593('0x47')]['id'],_0x317d6d[_0x6593('0x6e')]));return;}})['then'](function(_0x54863b){if(_0x14e729[_0x6593('0x76')]===_0x6593('0x8a')){return transcribe(_0x30445e[_0x6593('0x47')]['id'],_0x1ff8b7[_0x6593('0x84')],_0x1ff8b7[_0x6593('0x86')],_0x317d6d[_0x6593('0x87')],_0x317d6d['bucket'],_0x14e729[_0x6593('0x4b')],_0x317d6d[_0x6593('0x7e')]);}else{logger['info'](util[_0x6593('0x2a')](_0x6593('0x8b'),_0x30445e[_0x6593('0x47')]['id']));return{'transcribeStatus':_0x6593('0x8c')};}})[_0x6593('0x1f')](function(_0x24c4a1){if(_0x24c4a1){_0x24c4a1[_0x6593('0x8d')]=_0x30445e[_0x6593('0x45')]['runSentiment'];return _0x14e729[_0x6593('0x8e')](_0x24c4a1);}})['then'](respondWithResult(_0xcbabe2,null))[_0x6593('0x40')](handleError(_0xcbabe2,null));};function writeFile(_0x3e9907,_0x2d15f8){return new Promise(function(_0x1d72c1,_0xb9414){fs[_0x6593('0x8f')](_0x2d15f8,_0x3e9907,function(_0x4719f0,_0x4ab7d0){if(_0x4719f0){return _0xb9414(_0x4719f0);}else{return _0x1d72c1(_0x4ab7d0);}});});}exports['downloadTranscribe']=function(_0x43bbaa,_0x3acca2,_0x3c2890){return db[_0x6593('0x25')][_0x6593('0x79')]({'where':{'id':_0x43bbaa[_0x6593('0x47')]['id']}})[_0x6593('0x1f')](handleEntityNotFound(_0x3acca2))['then'](function(_0x542608){if(_0x542608&&_0x542608[_0x6593('0x90')]){var _0x3ea670=_0x542608[_0x6593('0x90')];var _0x31d2bf=config[_0x6593('0x91')]+_0x6593('0x92')+_0x542608['id']+_0x6593('0x93');if(fs['existsSync'](_0x31d2bf)){return _0x31d2bf;}return writeFile(_0x3ea670,_0x31d2bf)[_0x6593('0x1f')](function(){return _0x31d2bf;});}else{throw new db[(_0x6593('0x4f'))][(_0x6593('0x50'))](_0x6593('0x94'));}})[_0x6593('0x1f')](function(_0x2e82e6){return _0x3acca2['download'](_0x2e82e6);})[_0x6593('0x40')](handleError(_0x3acca2));}; \ No newline at end of file +var _0x1acc=['%s.cypher','existsSync','decryptFile','secrets','Sequelize','VoiceRecording\x20not\x20found','unlink','message','send','Not\x20found','downloads','sequelize','col','token','$and','push','recording','ValidationError','filename','extname','isNil','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','unlinkSync','.cypher','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','createBucket','upload','startTranscriptionJob','[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s','basename','[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)','bucket','Bucket','Location','[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created','TranscriptionJobName','transcribeName','TranscriptionJob','transcribeStatus','TranscriptionJobStatus','findOne','Setting','transcribeAccountId','transcribeRegion','language','Transcribe\x20not\x20configured','runSentiment','sentiment','sentimentAccountId','sentimentRegion','Sentiment\x20Analysis\x20not\x20configured','CloudProvider','Cloud\x20Provider\x20not\x20available','data1','Cloud\x20Provider\x20not\x20configured','Buckets','Name','data2','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available','[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested','IN_PROGRESS','tempSentiment','updateAttributes','writeFile','fileText','root','.txt','eml-format','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','aws-sdk','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','undefined','count','offset','limit','set','Content-Range','apply','reject','update','then','destroy','name','map','VoiceRecording','fieldName','type','key','differenceBy','format','query','filters','intersection','attributes','fields','length','model','hasOwnProperty','nolimit','order','sort','pick','filter','merge','options','where','includeAll','include','findAll','catch','show','params','keys','rawAttributes','find','create','body','describe','download','../../components/encryptor','uniqueid','value'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x1acc,0xdf));var _0xc1ac=function(_0x43bc99,_0x1cb43b){_0x43bc99=_0x43bc99-0x0;var _0x5bd4bf=_0x1acc[_0x43bc99];return _0x5bd4bf;};'use strict';var emlformat=require(_0xc1ac('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xc1ac('0x1'));var rp=require(_0xc1ac('0x2'));var moment=require(_0xc1ac('0x3'));var BPromise=require(_0xc1ac('0x4'));var Mustache=require('mustache');var util=require(_0xc1ac('0x5'));var path=require(_0xc1ac('0x6'));var sox=require(_0xc1ac('0x7'));var csv=require(_0xc1ac('0x8'));var ejs=require(_0xc1ac('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc1ac('0xa'));var squel=require(_0xc1ac('0xb'));var crypto=require(_0xc1ac('0xc'));var jsforce=require(_0xc1ac('0xd'));var deskjs=require(_0xc1ac('0xe'));var toCsv=require(_0xc1ac('0x8'));var querystring=require(_0xc1ac('0xf'));var Papa=require(_0xc1ac('0x10'));var AWS=require(_0xc1ac('0x11'));var uuidv4=require('uuid/v4');var Redis=require(_0xc1ac('0x12'));var authService=require(_0xc1ac('0x13'));var qs=require(_0xc1ac('0x14'));var as=require(_0xc1ac('0x15'));var hardwareService=require(_0xc1ac('0x16'));var logger=require(_0xc1ac('0x17'))(_0xc1ac('0x18'));var utils=require(_0xc1ac('0x19'));var config=require(_0xc1ac('0x1a'));var licenseUtil=require(_0xc1ac('0x1b'));var db=require(_0xc1ac('0x1c'))['db'];function respondWithStatusCode(_0x190544,_0x108c30){_0x108c30=_0x108c30||0xcc;return function(_0x5d23b5){if(_0x5d23b5){return _0x190544['sendStatus'](_0x108c30);}return _0x190544['status'](_0x108c30)[_0xc1ac('0x1d')]();};}function respondWithResult(_0x5a64da,_0x42e284){_0x42e284=_0x42e284||0xc8;return function(_0x1a5749){if(_0x1a5749){return _0x5a64da[_0xc1ac('0x1e')](_0x42e284)[_0xc1ac('0x1f')](_0x1a5749);}};}function respondWithFilteredResult(_0x20d5fe,_0x168202){return function(_0x19fea8){if(_0x19fea8){var _0x5c130f=typeof _0x168202['offset']===_0xc1ac('0x20')&&typeof _0x168202['limit']===_0xc1ac('0x20');var _0x3ffa47=_0x19fea8[_0xc1ac('0x21')];var _0x335769=_0x5c130f?0x0:_0x168202[_0xc1ac('0x22')];var _0x9dc929=_0x5c130f?_0x19fea8[_0xc1ac('0x21')]:_0x168202[_0xc1ac('0x22')]+_0x168202[_0xc1ac('0x23')];var _0x1715cb;if(_0x9dc929>=_0x3ffa47){_0x9dc929=_0x3ffa47;_0x1715cb=0xc8;}else{_0x1715cb=0xce;}_0x20d5fe[_0xc1ac('0x1e')](_0x1715cb);return _0x20d5fe[_0xc1ac('0x24')](_0xc1ac('0x25'),_0x335769+'-'+_0x9dc929+'/'+_0x3ffa47)[_0xc1ac('0x1f')](_0x19fea8);}return null;};}function patchUpdates(_0x23ea4d){return function(_0x479bd8){try{jsonpatch[_0xc1ac('0x26')](_0x479bd8,_0x23ea4d,!![]);}catch(_0x428f2e){return BPromise[_0xc1ac('0x27')](_0x428f2e);}return _0x479bd8['save']();};}function saveUpdates(_0x417421,_0x8c6d91){return function(_0x14d4d9){if(_0x14d4d9){return _0x14d4d9[_0xc1ac('0x28')](_0x417421)[_0xc1ac('0x29')](function(_0x589ada){return _0x589ada;});}return null;};}function removeEntity(_0x39e3ee,_0x4da65c){return function(_0x176c20){if(_0x176c20){return _0x176c20[_0xc1ac('0x2a')]()[_0xc1ac('0x29')](function(){_0x39e3ee['status'](0xcc)[_0xc1ac('0x1d')]();});}};}function handleEntityNotFound(_0x151132,_0x1ba464){return function(_0x9778c5){if(!_0x9778c5){_0x151132['sendStatus'](0x194);}return _0x9778c5;};}function handleError(_0x5744b3,_0x229fbe){_0x229fbe=_0x229fbe||0x1f4;return function(_0x1f77cf){logger['error'](_0x1f77cf['stack']);if(_0x1f77cf[_0xc1ac('0x2b')]){delete _0x1f77cf[_0xc1ac('0x2b')];}_0x5744b3[_0xc1ac('0x1e')](_0x229fbe)['send'](_0x1f77cf);};}exports['index']=function(_0xac0069,_0x1e55ca){var _0x67c143={},_0x5aa8ea={},_0xaffbdf={'count':0x0,'rows':[]};var _0x18b44f=_[_0xc1ac('0x2c')](db[_0xc1ac('0x2d')]['rawAttributes'],function(_0x451221){return{'name':_0x451221[_0xc1ac('0x2e')],'type':_0x451221[_0xc1ac('0x2f')][_0xc1ac('0x30')]};});_0x5aa8ea['model']=_[_0xc1ac('0x31')](_['map'](_0x18b44f,_0xc1ac('0x2b')),[_0xc1ac('0x32')]);_0x5aa8ea[_0xc1ac('0x33')]=_['keys'](_0xac0069[_0xc1ac('0x33')]);_0x5aa8ea[_0xc1ac('0x34')]=_[_0xc1ac('0x35')](_0x5aa8ea['model'],_0x5aa8ea['query']);_0x67c143[_0xc1ac('0x36')]=_[_0xc1ac('0x35')](_0x5aa8ea['model'],qs[_0xc1ac('0x37')](_0xac0069[_0xc1ac('0x33')]['fields']));_0x67c143[_0xc1ac('0x36')]=_0x67c143[_0xc1ac('0x36')][_0xc1ac('0x38')]?_0x67c143[_0xc1ac('0x36')]:_0x5aa8ea[_0xc1ac('0x39')];if(!_0xac0069[_0xc1ac('0x33')][_0xc1ac('0x3a')](_0xc1ac('0x3b'))){_0x67c143['limit']=qs['limit'](_0xac0069[_0xc1ac('0x33')][_0xc1ac('0x23')]);_0x67c143['offset']=qs[_0xc1ac('0x22')](_0xac0069[_0xc1ac('0x33')]['offset']);}_0x67c143[_0xc1ac('0x3c')]=qs['sort'](_0xac0069['query'][_0xc1ac('0x3d')]);_0x67c143['where']=qs[_0xc1ac('0x34')](_[_0xc1ac('0x3e')](_0xac0069[_0xc1ac('0x33')],_0x5aa8ea[_0xc1ac('0x34')]),_0x18b44f);if(_0xac0069['query'][_0xc1ac('0x3f')]){_0x67c143['where']=_[_0xc1ac('0x40')](_0x67c143['where'],{'$or':_['map'](_0x18b44f,function(_0xa3ed31){if(_0xa3ed31['type']!=='VIRTUAL'){var _0x1cd085={};_0x1cd085[_0xa3ed31[_0xc1ac('0x2b')]]={'$like':'%'+_0xac0069[_0xc1ac('0x33')][_0xc1ac('0x3f')]+'%'};return _0x1cd085;}})});}_0x67c143=_[_0xc1ac('0x40')]({},_0x67c143,_0xac0069[_0xc1ac('0x41')]);var _0x1893bc={'where':_0x67c143[_0xc1ac('0x42')]};return db[_0xc1ac('0x2d')]['count'](_0x1893bc)[_0xc1ac('0x29')](function(_0x231d97){_0xaffbdf[_0xc1ac('0x21')]=_0x231d97;if(_0xac0069[_0xc1ac('0x33')][_0xc1ac('0x43')]){_0x67c143[_0xc1ac('0x44')]=[{'all':!![]}];}return db[_0xc1ac('0x2d')][_0xc1ac('0x45')](_0x67c143);})['then'](function(_0x1a21ce){_0xaffbdf['rows']=_0x1a21ce;return _0xaffbdf;})[_0xc1ac('0x29')](respondWithFilteredResult(_0x1e55ca,_0x67c143))[_0xc1ac('0x46')](handleError(_0x1e55ca,null));};exports[_0xc1ac('0x47')]=function(_0x43cc5a,_0x32ee26){var _0x2402cc={'raw':![],'where':{'id':_0x43cc5a[_0xc1ac('0x48')]['id']}},_0x465e7b={};_0x465e7b[_0xc1ac('0x39')]=_[_0xc1ac('0x49')](db['VoiceRecording'][_0xc1ac('0x4a')]);_0x465e7b[_0xc1ac('0x33')]=_['keys'](_0x43cc5a[_0xc1ac('0x33')]);_0x465e7b[_0xc1ac('0x34')]=_[_0xc1ac('0x35')](_0x465e7b[_0xc1ac('0x39')],_0x465e7b[_0xc1ac('0x33')]);_0x2402cc[_0xc1ac('0x36')]=_[_0xc1ac('0x35')](_0x465e7b['model'],qs['fields'](_0x43cc5a['query'][_0xc1ac('0x37')]));_0x2402cc['attributes']=_0x2402cc[_0xc1ac('0x36')][_0xc1ac('0x38')]?_0x2402cc[_0xc1ac('0x36')]:_0x465e7b['model'];if(_0x43cc5a[_0xc1ac('0x33')][_0xc1ac('0x43')]){_0x2402cc[_0xc1ac('0x44')]=[{'all':!![]}];}_0x2402cc=_['merge']({},_0x2402cc,_0x43cc5a[_0xc1ac('0x41')]);return db[_0xc1ac('0x2d')][_0xc1ac('0x4b')](_0x2402cc)[_0xc1ac('0x29')](handleEntityNotFound(_0x32ee26,null))[_0xc1ac('0x29')](respondWithResult(_0x32ee26,null))[_0xc1ac('0x46')](handleError(_0x32ee26,null));};exports[_0xc1ac('0x4c')]=function(_0x161f76,_0x599584){return db[_0xc1ac('0x2d')][_0xc1ac('0x4c')](_0x161f76[_0xc1ac('0x4d')],{})['then'](respondWithResult(_0x599584,0xc9))[_0xc1ac('0x46')](handleError(_0x599584,null));};exports[_0xc1ac('0x28')]=function(_0x153ec5,_0x3c0050){if(_0x153ec5['body']['id']){delete _0x153ec5[_0xc1ac('0x4d')]['id'];}return db[_0xc1ac('0x2d')]['find']({'where':{'id':_0x153ec5[_0xc1ac('0x48')]['id']}})[_0xc1ac('0x29')](handleEntityNotFound(_0x3c0050,null))[_0xc1ac('0x29')](saveUpdates(_0x153ec5[_0xc1ac('0x4d')],null))[_0xc1ac('0x29')](respondWithResult(_0x3c0050,null))[_0xc1ac('0x46')](handleError(_0x3c0050,null));};exports['describe']=function(_0x542063,_0x13e5e3){return db[_0xc1ac('0x2d')][_0xc1ac('0x4e')]()[_0xc1ac('0x29')](respondWithResult(_0x13e5e3,null))['catch'](handleError(_0x13e5e3,null));};exports[_0xc1ac('0x4f')]=function(_0xed5f3b,_0x295dda,_0x5afda8){var _0x45298e=require(_0xc1ac('0x50'));var _0x4f9afd=![];var _0x44a110={};if(_0xed5f3b['query']['type']&&_0xed5f3b[_0xc1ac('0x33')][_0xc1ac('0x2f')]===_0xc1ac('0x51')){_0x44a110[_0xc1ac('0x51')]=_0xed5f3b[_0xc1ac('0x48')]['id'];}else{_0x44a110['id']=_0xed5f3b[_0xc1ac('0x48')]['id'];}return db[_0xc1ac('0x2d')][_0xc1ac('0x4b')]({'where':_0x44a110,'attributes':['id',_0xc1ac('0x52')],'raw':!![]})['then'](handleEntityNotFound(_0x295dda,null))['then'](function(_0x493082){if(_0x493082){var _0x74f3e=_0x493082['value'];var _0x5570f4=util[_0xc1ac('0x32')](_0xc1ac('0x53'),_0x74f3e);if(fs[_0xc1ac('0x54')](_0x5570f4)){_0x4f9afd=!![];return _0x45298e[_0xc1ac('0x55')](_0x5570f4,_0x74f3e,config[_0xc1ac('0x56')]['recording'])['then'](function(){return _0x493082;});}return _0x493082;}})['then'](function(_0x25f521){if(_0x25f521){var _0x303d58=_0x25f521['value'];if(!fs[_0xc1ac('0x54')](_0x303d58)){throw new db[(_0xc1ac('0x57'))]['ValidationError'](_0xc1ac('0x58'));}if(_0x25f521['filename']){return _0x295dda[_0xc1ac('0x4f')](_0x303d58,_0x25f521['filename']+path['extname'](_0x303d58),function(){if(_0x4f9afd){fs[_0xc1ac('0x59')](_0x303d58);}});}else{return _0x295dda['download'](_0x303d58,function(_0x3bc753){if(_0x4f9afd){fs['unlink'](_0x303d58);}});}}})['catch'](function(_0x1410dd){if(_0x1410dd[_0xc1ac('0x5a')]==='VoiceRecording\x20not\x20found'){_0x295dda[_0xc1ac('0x1e')](0x194)[_0xc1ac('0x5b')](_0xc1ac('0x5c'));}else{return handleError(_0x295dda,null);}});};exports[_0xc1ac('0x5d')]=function(_0x46fcdd,_0x342415,_0x47af24){var _0x4653d3=require('../../components/encryptor');var _0x18a379=![];var _0xc9a072={'$and':[db['sequelize']['where'](db[_0xc1ac('0x5e')]['fn']('MD5',db[_0xc1ac('0x5e')][_0xc1ac('0x5f')](_0xc1ac('0x51'))),_0x46fcdd[_0xc1ac('0x33')][_0xc1ac('0x60')])]};if(_0x46fcdd['query'][_0xc1ac('0x2f')]&&_0x46fcdd['query'][_0xc1ac('0x2f')]==='uniqueid'){_0xc9a072[_0xc1ac('0x61')][_0xc1ac('0x62')]({'uniqueid':_0x46fcdd[_0xc1ac('0x48')]['id']});}else{_0xc9a072['$and'][_0xc1ac('0x62')]({'id':_0x46fcdd[_0xc1ac('0x48')]['id']});}return db[_0xc1ac('0x2d')][_0xc1ac('0x4b')]({'where':_0xc9a072,'attributes':['id',_0xc1ac('0x52')],'raw':!![]})['then'](handleEntityNotFound(_0x342415,null))['then'](function(_0x29fff3){if(_0x29fff3){var _0x2ecdc1=util[_0xc1ac('0x32')]('%s.cypher',_0x29fff3['value']);if(fs[_0xc1ac('0x54')](_0x2ecdc1)){_0x18a379=!![];return _0x4653d3['decryptFile'](_0x2ecdc1,_0x29fff3[_0xc1ac('0x52')],config['secrets'][_0xc1ac('0x63')])[_0xc1ac('0x29')](function(){return _0x29fff3;});}return _0x29fff3;}})['then'](function(_0x5bc692){if(_0x5bc692){if(!fs[_0xc1ac('0x54')](_0x5bc692['value'])){throw new db['Sequelize'][(_0xc1ac('0x64'))](_0xc1ac('0x58'));}if(_0x5bc692['filename']){return _0x342415['download'](_0x5bc692[_0xc1ac('0x52')],_0x5bc692[_0xc1ac('0x65')]+path[_0xc1ac('0x66')](_0x5bc692[_0xc1ac('0x52')]),function(){if(_0x18a379){fs[_0xc1ac('0x59')](_0x5bc692[_0xc1ac('0x52')]);}});}else{return _0x342415[_0xc1ac('0x4f')](_0x5bc692['value'],function(_0x31632d){if(_0x18a379){fs[_0xc1ac('0x59')](_0x5bc692[_0xc1ac('0x52')]);}});}}})['catch'](handleError(_0x342415,null));};exports[_0xc1ac('0x2a')]=function(_0x3ca530,_0x27c1e3){return db[_0xc1ac('0x2d')][_0xc1ac('0x4b')]({'where':{'id':_0x3ca530[_0xc1ac('0x48')]['id']}})['then'](function(_0x536a2d){if(_[_0xc1ac('0x67')](_0x536a2d)){throw new ReferenceError(_0xc1ac('0x68'));}return _0x536a2d;})[_0xc1ac('0x29')](function(_0x25965f){var _0x33f024=_0x25965f[_0xc1ac('0x52')];logger[_0xc1ac('0x69')](_0xc1ac('0x6a'),_0x33f024);if(!_[_0xc1ac('0x67')](_0x25965f[_0xc1ac('0x52')])&&fs[_0xc1ac('0x54')](_0x33f024)){logger[_0xc1ac('0x69')](_0xc1ac('0x6b')+_0x33f024+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0xc1ac('0x6c')](_0x33f024);}_0x33f024=_0x33f024+_0xc1ac('0x6d');if(!_[_0xc1ac('0x67')](_0x25965f[_0xc1ac('0x52')])&&fs[_0xc1ac('0x54')](_0x33f024)){logger['info'](_0xc1ac('0x6b')+_0x33f024+_0xc1ac('0x6e'));fs['unlinkSync'](_0x33f024);}return _0x25965f;})['then'](function(_0x5cbd9f){if(!_0x5cbd9f)throw new InternalError();return _0x5cbd9f[_0xc1ac('0x2a')]();})[_0xc1ac('0x29')](function(){_0x27c1e3[_0xc1ac('0x1e')](0xcc)['end']();})[_0xc1ac('0x46')](handleError(_0x27c1e3,null));};function getBucketslist(_0xf1b759,_0x46d82f,_0x377e64){return new Promise(function(_0x39bcd5,_0x950b97){var _0x50bc2f=new AWS['S3']({'accessKeyId':_0x46d82f,'secretAccessKey':_0xf1b759,'region':_0x377e64});_0x50bc2f['listBuckets']({},function(_0xf9e34,_0x406ca5){if(_0xf9e34){return _0x950b97(_0xf9e34);}else{return _0x39bcd5(_0x406ca5);}});});}function createBucket(_0x57f758,_0x278ab8,_0x24fbd2,_0x43fd45){return new Promise(function(_0x47d9cb,_0x396cba){var _0x4cd1d5=new AWS['S3']({'accessKeyId':_0x278ab8,'secretAccessKey':_0x57f758,'region':_0x24fbd2});_0x4cd1d5[_0xc1ac('0x6f')]({'Bucket':_0x43fd45},function(_0x78107b,_0x5235ed){if(_0x78107b){return _0x396cba(_0x78107b);}else{return _0x47d9cb(_0x5235ed);}});});}function uploadFile(_0x2d8042,_0x2b9d7d,_0x797407,_0x4c020f,_0x1b2f64,_0x697446){return new Promise(function(_0x5572b5,_0x28fbda){var _0x51af78=new AWS['S3']({'accessKeyId':_0x2b9d7d,'secretAccessKey':_0x2d8042,'region':_0x797407});_0x51af78[_0xc1ac('0x70')]({'Bucket':_0x4c020f,'Key':_0x1b2f64,'Body':_0x697446},function(_0x2b9e76,_0x32130e){if(_0x2b9e76){return _0x28fbda(_0x2b9e76);}else{return _0x5572b5(_0x32130e);}});});}function startTranscribe(_0x1fd483,_0x136467,_0x2e6b66,_0x122382,_0x2d10f2,_0x4300af){return new Promise(function(_0x22c8d1,_0x263032){var _0x5e7e55=new AWS['TranscribeService']({'accessKeyId':_0x136467,'secretAccessKey':_0x1fd483,'region':_0x2e6b66});_0x5e7e55[_0xc1ac('0x71')]({'TranscriptionJobName':_0x122382,'LanguageCode':_0x2d10f2,'Media':{'MediaFileUri':_0x4300af}},function(_0x5e6847,_0xf25fcf){if(_0x5e6847){return _0x263032(_0x5e6847);}else{return _0x22c8d1(_0xf25fcf);}});});}function transcribe(_0x4ad600,_0x1ab66b,_0x301589,_0x23bdd3,_0x7efb6d,_0x495a0b,_0x381bf2){return new Promise(function(_0x696ee6,_0x40018d){var _0x206ec0={};logger['info'](util[_0xc1ac('0x32')](_0xc1ac('0x72'),_0x4ad600,_0x7efb6d));return uploadFile(_0x1ab66b,_0x301589,_0x23bdd3,_0x7efb6d,path[_0xc1ac('0x73')](_0x495a0b),fs['readFileSync'](_0x495a0b))['then'](function(_0x5cc121){logger['info'](util[_0xc1ac('0x32')](_0xc1ac('0x74'),_0x4ad600,_0x7efb6d,_0x5cc121['Location']));_0x206ec0[_0xc1ac('0x75')]=_0x5cc121[_0xc1ac('0x76')];_0x206ec0['location']=_0x5cc121[_0xc1ac('0x77')];logger[_0xc1ac('0x69')](util[_0xc1ac('0x32')]('[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request',_0x4ad600));return startTranscribe(_0x1ab66b,_0x301589,_0x23bdd3,uuidv4(),_0x381bf2,_0x5cc121['Location']);})['then'](function(_0xd4b84){logger[_0xc1ac('0x69')](util['format'](_0xc1ac('0x78'),_0x4ad600,_0xd4b84['TranscriptionJob'][_0xc1ac('0x79')]));_0x206ec0[_0xc1ac('0x7a')]=_0xd4b84[_0xc1ac('0x7b')][_0xc1ac('0x79')];_0x206ec0[_0xc1ac('0x7c')]=_0xd4b84[_0xc1ac('0x7b')][_0xc1ac('0x7d')];return _0x696ee6(_0x206ec0);})[_0xc1ac('0x46')](function(_0x28f78b){return _0x40018d(_0x28f78b);});});}exports['runTranscribe']=function(_0x4cbb6c,_0x21e614,_0x3cce68){var _0x50ec78;var _0x359d2d;var _0x2614df;var _0x372eed=require('../../components/encryptor');return db[_0xc1ac('0x2d')][_0xc1ac('0x7e')]({'where':{'id':_0x4cbb6c['params']['id']}})[_0xc1ac('0x29')](function(_0x3ef913){if(_0x3ef913){var _0x4bb31f=util[_0xc1ac('0x32')](_0xc1ac('0x53'),_0x3ef913[_0xc1ac('0x52')]);if(fs[_0xc1ac('0x54')](_0x4bb31f)){cypher=!![];return _0x372eed[_0xc1ac('0x55')](_0x4bb31f,_0x3ef913['value'],config['secrets'][_0xc1ac('0x63')])[_0xc1ac('0x29')](function(){return _0x3ef913;});}return _0x3ef913;}})['then'](function(_0x2b2bb5){if(!_0x2b2bb5){throw new db['Sequelize'][(_0xc1ac('0x64'))]('Voice\x20Recording\x20not\x20found');}_0x359d2d=_0x2b2bb5;return db[_0xc1ac('0x7f')][_0xc1ac('0x7e')]({'where':{'id':0x1}});})['then'](handleEntityNotFound(_0x21e614,null))[_0xc1ac('0x29')](function(_0x516d02){if(_0x516d02){_0x50ec78=_0x516d02;if(!_0x50ec78['transcribe']||!_0x50ec78[_0xc1ac('0x80')]||!_0x50ec78[_0xc1ac('0x81')]||!_0x50ec78[_0xc1ac('0x82')]||!_0x50ec78[_0xc1ac('0x75')]){throw new db[(_0xc1ac('0x57'))][(_0xc1ac('0x64'))](_0xc1ac('0x83'));}if(_0x4cbb6c[_0xc1ac('0x4d')][_0xc1ac('0x84')]&&(!_0x50ec78[_0xc1ac('0x85')]||!_0x50ec78[_0xc1ac('0x86')]||!_0x50ec78[_0xc1ac('0x87')]||!_0x50ec78[_0xc1ac('0x82')]||!_0x50ec78[_0xc1ac('0x75')])){throw new db[(_0xc1ac('0x57'))][(_0xc1ac('0x64'))](_0xc1ac('0x88'));}return db[_0xc1ac('0x89')][_0xc1ac('0x7e')]({'where':{'id':_0x50ec78['transcribeAccountId']}});}})[_0xc1ac('0x29')](function(_0x28f57c){if(!_0x28f57c){throw new db[(_0xc1ac('0x57'))][(_0xc1ac('0x64'))](_0xc1ac('0x8a'));}if(!_0x28f57c[_0xc1ac('0x8b')]||!_0x28f57c['data2']){throw new db['Sequelize']['ValidationError'](_0xc1ac('0x8c'));}_0x2614df=_0x28f57c;return getBucketslist(_0x2614df[_0xc1ac('0x8b')],_0x2614df['data2'],_0x50ec78[_0xc1ac('0x81')]);})['then'](function(_0x5a1a92){if(_0x5a1a92&&_0x5a1a92['Buckets']){var _0x113530=_['find'](_0x5a1a92[_0xc1ac('0x8d')],function(_0x2c6db4){return _0x2c6db4[_0xc1ac('0x8e')]===_0x50ec78['bucket'];});if(!_0x113530){logger[_0xc1ac('0x69')](util['format']('[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available',_0x4cbb6c[_0xc1ac('0x48')]['id'],_0x50ec78[_0xc1ac('0x75')]));return createBucket(_0x2614df['data1'],_0x2614df[_0xc1ac('0x8f')],_0x50ec78[_0xc1ac('0x81')],_0x50ec78['bucket']);}logger['info'](util[_0xc1ac('0x32')](_0xc1ac('0x90'),_0x4cbb6c[_0xc1ac('0x48')]['id'],_0x50ec78[_0xc1ac('0x75')]));return;}})[_0xc1ac('0x29')](function(_0x1f9872){if(_0x359d2d[_0xc1ac('0x7c')]==='NEW'){return transcribe(_0x4cbb6c['params']['id'],_0x2614df[_0xc1ac('0x8b')],_0x2614df['data2'],_0x50ec78[_0xc1ac('0x81')],_0x50ec78['bucket'],_0x359d2d[_0xc1ac('0x52')],_0x50ec78[_0xc1ac('0x82')]);}else{logger['info'](util[_0xc1ac('0x32')](_0xc1ac('0x91'),_0x4cbb6c['params']['id']));return{'transcribeStatus':_0xc1ac('0x92')};}})['then'](function(_0x3d906e){if(_0x3d906e){_0x3d906e[_0xc1ac('0x93')]=_0x4cbb6c['body'][_0xc1ac('0x84')];return _0x359d2d[_0xc1ac('0x94')](_0x3d906e);}})['then'](respondWithResult(_0x21e614,null))[_0xc1ac('0x46')](handleError(_0x21e614,null));};function writeFile(_0x241b84,_0x304dfb){return new Promise(function(_0xed8d7d,_0xb6a793){fs[_0xc1ac('0x95')](_0x304dfb,_0x241b84,function(_0x4f4a0b,_0x1e6900){if(_0x4f4a0b){return _0xb6a793(_0x4f4a0b);}else{return _0xed8d7d(_0x1e6900);}});});}exports['downloadTranscribe']=function(_0x2d3b1c,_0x25172d,_0x53f57c){return db[_0xc1ac('0x2d')][_0xc1ac('0x7e')]({'where':{'id':_0x2d3b1c['params']['id']}})['then'](handleEntityNotFound(_0x25172d))[_0xc1ac('0x29')](function(_0x2167ec){if(_0x2167ec&&_0x2167ec[_0xc1ac('0x96')]){var _0xe4ba3f=_0x2167ec[_0xc1ac('0x96')];var _0x196be4=config[_0xc1ac('0x97')]+'/server/files/transcribes/transcribe_'+_0x2167ec['id']+_0xc1ac('0x98');if(fs[_0xc1ac('0x54')](_0x196be4)){return _0x196be4;}return writeFile(_0xe4ba3f,_0x196be4)['then'](function(){return _0x196be4;});}else{throw new db['Sequelize'][(_0xc1ac('0x64'))]('Transcript\x20not\x20available');}})[_0xc1ac('0x29')](function(_0x9721c7){return _0x25172d['download'](_0x9721c7);})['catch'](handleError(_0x25172d));}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.model.js b/server/api/voiceRecording/voiceRecording.model.js index 384030d..2929f0b 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 _0x080e=['bluebird','request-promise','path','rimraf','../../config/environment','./voiceRecording.attributes','exports','define','VoiceRecording','voice_recordings','uniqueid','lodash','util','moment'];(function(_0x9b993d,_0x16efcc){var _0x2c30fb=function(_0x4c9abf){while(--_0x4c9abf){_0x9b993d['push'](_0x9b993d['shift']());}};_0x2c30fb(++_0x16efcc);}(_0x080e,0x123));var _0xe080=function(_0x5d88be,_0x5a9a0d){_0x5d88be=_0x5d88be-0x0;var _0x27b2e7=_0x080e[_0x5d88be];return _0x27b2e7;};'use strict';var _=require(_0xe080('0x0'));var util=require(_0xe080('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xe080('0x2'));var BPromise=require(_0xe080('0x3'));var rp=require(_0xe080('0x4'));var fs=require('fs');var path=require(_0xe080('0x5'));var rimraf=require(_0xe080('0x6'));var config=require(_0xe080('0x7'));var attributes=require(_0xe080('0x8'));module[_0xe080('0x9')]=function(_0x56180,_0x5e80f1){return _0x56180[_0xe080('0xa')](_0xe080('0xb'),attributes,{'tableName':_0xe080('0xc'),'paranoid':![],'indexes':[{'name':_0xe080('0xd'),'fields':[_0xe080('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x0d89=['define','VoiceRecording','voice_recordings','uniqueid','util','api','moment','bluebird','path','rimraf','../../config/environment','./voiceRecording.attributes'];(function(_0x2b10c6,_0x185590){var _0x3789d2=function(_0x272987){while(--_0x272987){_0x2b10c6['push'](_0x2b10c6['shift']());}};_0x3789d2(++_0x185590);}(_0x0d89,0x190));var _0x90d8=function(_0x14ba43,_0x48e2ca){_0x14ba43=_0x14ba43-0x0;var _0x22776f=_0x0d89[_0x14ba43];return _0x22776f;};'use strict';var _=require('lodash');var util=require(_0x90d8('0x0'));var logger=require('../../config/logger')(_0x90d8('0x1'));var moment=require(_0x90d8('0x2'));var BPromise=require(_0x90d8('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x90d8('0x4'));var rimraf=require(_0x90d8('0x5'));var config=require(_0x90d8('0x6'));var attributes=require(_0x90d8('0x7'));module['exports']=function(_0x589658,_0x29d6ad){return _0x589658[_0x90d8('0x8')](_0x90d8('0x9'),attributes,{'tableName':_0x90d8('0xa'),'paranoid':![],'indexes':[{'name':_0x90d8('0xb'),'fields':[_0x90d8('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.rpc.js b/server/api/voiceRecording/voiceRecording.rpc.js index 6d56d23..18865f1 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 _0xffd6=['catch','UpdateVoiceRecording','update','body','options','raw','where','attributes','CreateVoiceRecording','../../components/encryptor','Setting','VoiceRecording','create','callRecordingEncryption','existsSync','value','format','%s.cypher','encryptFile','secrets','recording','CreateVoiceRecording\x20file\x20encrypted','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','then','VoiceRecording,\x20%s,\x20%s','request\x20sent','debug','VoiceRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result'];(function(_0x56c56c,_0x5f288d){var _0x180c7b=function(_0x1769b0){while(--_0x1769b0){_0x56c56c['push'](_0x56c56c['shift']());}};_0x180c7b(++_0x5f288d);}(_0xffd6,0x97));var _0x6ffd=function(_0x1fc122,_0x5e2c17){_0x1fc122=_0x1fc122-0x0;var _0xa2cb13=_0xffd6[_0x1fc122];return _0xa2cb13;};'use strict';var _=require(_0x6ffd('0x0'));var util=require(_0x6ffd('0x1'));var moment=require(_0x6ffd('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6ffd('0x3'));var db=require(_0x6ffd('0x4'))['db'];var utils=require(_0x6ffd('0x5'));var logger=require('../../config/logger')(_0x6ffd('0x6'));var config=require(_0x6ffd('0x7'));var jayson=require(_0x6ffd('0x8'));var client=jayson[_0x6ffd('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x122b71,_0xeefe34,_0x2445a0){return new BPromise(function(_0x1fbbe6,_0x1d8b50){return client['request'](_0x122b71,_0x2445a0)[_0x6ffd('0xa')](function(_0x417f34){logger['info'](_0x6ffd('0xb'),_0xeefe34,_0x6ffd('0xc'));logger[_0x6ffd('0xd')](_0x6ffd('0xe'),_0xeefe34,_0x6ffd('0xc'),JSON[_0x6ffd('0xf')](_0x417f34));if(_0x417f34[_0x6ffd('0x10')]){if(_0x417f34['error'][_0x6ffd('0x11')]===0x1f4){logger[_0x6ffd('0x10')]('VoiceRecording,\x20%s,\x20%s',_0xeefe34,_0x417f34[_0x6ffd('0x10')][_0x6ffd('0x12')]);return _0x1d8b50(_0x417f34[_0x6ffd('0x10')][_0x6ffd('0x12')]);}logger['error'](_0x6ffd('0xb'),_0xeefe34,_0x417f34['error'][_0x6ffd('0x12')]);return _0x1fbbe6(_0x417f34['error'][_0x6ffd('0x12')]);}else{logger[_0x6ffd('0x13')](_0x6ffd('0xb'),_0xeefe34,'request\x20sent');_0x1fbbe6(_0x417f34[_0x6ffd('0x14')][_0x6ffd('0x12')]);}})[_0x6ffd('0x15')](function(_0x3394b2){logger[_0x6ffd('0x10')](_0x6ffd('0xb'),_0xeefe34,_0x3394b2);_0x1d8b50(_0x3394b2);});});}exports[_0x6ffd('0x16')]=function(_0x889a4b){var _0x545576=this;return new Promise(function(_0x11a609,_0x56c541){return db['VoiceRecording'][_0x6ffd('0x17')](_0x889a4b[_0x6ffd('0x18')],{'raw':_0x889a4b['options']?_0x889a4b[_0x6ffd('0x19')][_0x6ffd('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x889a4b['options']?_0x889a4b['options'][_0x6ffd('0x1b')]||null:null,'attributes':_0x889a4b[_0x6ffd('0x19')]?_0x889a4b['options'][_0x6ffd('0x1c')]||null:null,'limit':_0x889a4b[_0x6ffd('0x19')]?_0x889a4b[_0x6ffd('0x19')]['limit']||null:null})[_0x6ffd('0xa')](function(_0x2efeb5){logger['info'](_0x6ffd('0x16'),_0x889a4b);logger[_0x6ffd('0xd')]('UpdateVoiceRecording',_0x889a4b,JSON[_0x6ffd('0xf')](_0x2efeb5));_0x11a609(_0x2efeb5);})[_0x6ffd('0x15')](function(_0xb504e5){logger['error'](_0x6ffd('0x16'),_0xb504e5[_0x6ffd('0x12')],_0x889a4b);_0x56c541(_0x545576[_0x6ffd('0x10')](0x1f4,_0xb504e5['message']));});});};exports[_0x6ffd('0x1d')]=function(_0x5a55e2){var _0x41ab4a=this;return new Promise(function(_0x43269c,_0x56c6de){var _0x520258=require(_0x6ffd('0x1e'));var _0x2a0391;return db[_0x6ffd('0x1f')]['findOne']({'attributes':['id','callRecordingEncryption'],'where':{'id':0x1},'raw':!![]})[_0x6ffd('0xa')](function(_0x48feb4){_0x2a0391=_0x48feb4;return db[_0x6ffd('0x20')][_0x6ffd('0x21')](_0x5a55e2['body']);})[_0x6ffd('0xa')](function(_0xc790b2){if(_0x2a0391[_0x6ffd('0x22')]&&fs[_0x6ffd('0x23')](_0xc790b2[_0x6ffd('0x24')])){var _0x31c609=util[_0x6ffd('0x25')](_0x6ffd('0x26'),_0xc790b2[_0x6ffd('0x24')]);return _0x520258[_0x6ffd('0x27')](_0xc790b2[_0x6ffd('0x24')],_0x31c609,config[_0x6ffd('0x28')][_0x6ffd('0x29')])['then'](function(){fs['unlink'](_0xc790b2['value']);logger[_0x6ffd('0x13')](_0x6ffd('0x2a'));return _0xc790b2;});}return _0xc790b2;})[_0x6ffd('0xa')](function(_0x528a3f){logger[_0x6ffd('0x13')](_0x6ffd('0x1d'),_0x5a55e2);logger[_0x6ffd('0xd')](_0x6ffd('0x1d'),_0x5a55e2,JSON[_0x6ffd('0xf')](_0x528a3f));_0x43269c(_0x528a3f);})[_0x6ffd('0x15')](function(_0x26394c){logger[_0x6ffd('0x10')](_0x6ffd('0x1d'),_0x26394c['message'],_0x5a55e2);_0x56c6de(_0x41ab4a[_0x6ffd('0x10')](0x1f4,_0x26394c[_0x6ffd('0x12')]));});});}; \ No newline at end of file +var _0xda2d=['update','body','options','raw','where','attributes','limit','catch','../../components/encryptor','Setting','findOne','callRecordingEncryption','create','existsSync','format','value','unlink','CreateVoiceRecording','util','moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','then','VoiceRecording,\x20%s,\x20%s','request\x20sent','debug','VoiceRecording,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','UpdateVoiceRecording','VoiceRecording'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xda2d,0x102));var _0xdda2=function(_0x474411,_0x106f32){_0x474411=_0x474411-0x0;var _0x3ccb73=_0xda2d[_0x474411];return _0x3ccb73;};'use strict';var _=require('lodash');var util=require(_0xdda2('0x0'));var moment=require(_0xdda2('0x1'));var BPromise=require(_0xdda2('0x2'));var rs=require(_0xdda2('0x3'));var fs=require('fs');var Redis=require(_0xdda2('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xdda2('0x5'));var config=require(_0xdda2('0x6'));var jayson=require(_0xdda2('0x7'));var client=jayson[_0xdda2('0x8')][_0xdda2('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xf38e58,_0x2f55dc,_0x436676){return new BPromise(function(_0x2e2523,_0x341c7b){return client['request'](_0xf38e58,_0x436676)[_0xdda2('0xa')](function(_0x22c6e5){logger['info'](_0xdda2('0xb'),_0x2f55dc,_0xdda2('0xc'));logger[_0xdda2('0xd')](_0xdda2('0xe'),_0x2f55dc,_0xdda2('0xc'),JSON[_0xdda2('0xf')](_0x22c6e5));if(_0x22c6e5[_0xdda2('0x10')]){if(_0x22c6e5[_0xdda2('0x10')]['code']===0x1f4){logger['error']('VoiceRecording,\x20%s,\x20%s',_0x2f55dc,_0x22c6e5[_0xdda2('0x10')][_0xdda2('0x11')]);return _0x341c7b(_0x22c6e5[_0xdda2('0x10')][_0xdda2('0x11')]);}logger[_0xdda2('0x10')](_0xdda2('0xb'),_0x2f55dc,_0x22c6e5[_0xdda2('0x10')]['message']);return _0x2e2523(_0x22c6e5[_0xdda2('0x10')]['message']);}else{logger[_0xdda2('0x12')](_0xdda2('0xb'),_0x2f55dc,_0xdda2('0xc'));_0x2e2523(_0x22c6e5[_0xdda2('0x13')][_0xdda2('0x11')]);}})['catch'](function(_0x55d674){logger[_0xdda2('0x10')]('VoiceRecording,\x20%s,\x20%s',_0x2f55dc,_0x55d674);_0x341c7b(_0x55d674);});});}exports[_0xdda2('0x14')]=function(_0x1a3b35){var _0x335fb5=this;return new Promise(function(_0x2b6ee8,_0x8d44b7){return db[_0xdda2('0x15')][_0xdda2('0x16')](_0x1a3b35[_0xdda2('0x17')],{'raw':_0x1a3b35[_0xdda2('0x18')]?_0x1a3b35[_0xdda2('0x18')][_0xdda2('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1a3b35[_0xdda2('0x18')]?_0x1a3b35['options'][_0xdda2('0x1a')]||null:null,'attributes':_0x1a3b35['options']?_0x1a3b35[_0xdda2('0x18')][_0xdda2('0x1b')]||null:null,'limit':_0x1a3b35[_0xdda2('0x18')]?_0x1a3b35['options'][_0xdda2('0x1c')]||null:null})['then'](function(_0x425489){logger[_0xdda2('0x12')]('UpdateVoiceRecording',_0x1a3b35);logger[_0xdda2('0xd')](_0xdda2('0x14'),_0x1a3b35,JSON[_0xdda2('0xf')](_0x425489));_0x2b6ee8(_0x425489);})[_0xdda2('0x1d')](function(_0x45ee9d){logger['error'](_0xdda2('0x14'),_0x45ee9d[_0xdda2('0x11')],_0x1a3b35);_0x8d44b7(_0x335fb5[_0xdda2('0x10')](0x1f4,_0x45ee9d[_0xdda2('0x11')]));});});};exports['CreateVoiceRecording']=function(_0x4e97dc){var _0x28da54=this;return new Promise(function(_0x4567e7,_0x2e8591){var _0x5e9e74=require(_0xdda2('0x1e'));var _0x5d26ae;return db[_0xdda2('0x1f')][_0xdda2('0x20')]({'attributes':['id',_0xdda2('0x21')],'where':{'id':0x1},'raw':!![]})[_0xdda2('0xa')](function(_0x4bb8a4){_0x5d26ae=_0x4bb8a4;return db[_0xdda2('0x15')][_0xdda2('0x22')](_0x4e97dc['body']);})[_0xdda2('0xa')](function(_0x2cfaca){if(_0x5d26ae[_0xdda2('0x21')]&&fs[_0xdda2('0x23')](_0x2cfaca['value'])){var _0x129eba=util[_0xdda2('0x24')]('%s.cypher',_0x2cfaca[_0xdda2('0x25')]);return _0x5e9e74['encryptFile'](_0x2cfaca[_0xdda2('0x25')],_0x129eba,config['secrets']['recording'])['then'](function(){fs[_0xdda2('0x26')](_0x2cfaca['value']);logger[_0xdda2('0x12')]('CreateVoiceRecording\x20file\x20encrypted');return _0x2cfaca;});}return _0x2cfaca;})['then'](function(_0x52a509){logger[_0xdda2('0x12')](_0xdda2('0x27'),_0x4e97dc);logger[_0xdda2('0xd')](_0xdda2('0x27'),_0x4e97dc,JSON[_0xdda2('0xf')](_0x52a509));_0x4567e7(_0x52a509);})[_0xdda2('0x1d')](function(_0x2bcfba){logger[_0xdda2('0x10')](_0xdda2('0x27'),_0x2bcfba[_0xdda2('0x11')],_0x4e97dc);_0x2e8591(_0x28da54['error'](0x1f4,_0x2bcfba[_0xdda2('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/index.js b/server/api/voiceTransferReport/index.js index d8c9285..1d99d9e 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 _0xb273=['../../config/environment','./voiceTransferReport.controller','get','isAuthenticated','index','/describe','/:id','show','post','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x3a0a14,_0x3a1216){var _0x2844ee=function(_0x35cc97){while(--_0x35cc97){_0x3a0a14['push'](_0x3a0a14['shift']());}};_0x2844ee(++_0x3a1216);}(_0xb273,0x123));var _0x3b27=function(_0x2a7156,_0x621e23){_0x2a7156=_0x2a7156-0x0;var _0x250a7b=_0xb273[_0x2a7156];return _0x250a7b;};'use strict';var multer=require(_0x3b27('0x0'));var util=require(_0x3b27('0x1'));var path=require(_0x3b27('0x2'));var timeout=require(_0x3b27('0x3'));var express=require(_0x3b27('0x4'));var router=express[_0x3b27('0x5')]();var fs_extra=require(_0x3b27('0x6'));var auth=require(_0x3b27('0x7'));var interaction=require(_0x3b27('0x8'));var config=require(_0x3b27('0x9'));var controller=require(_0x3b27('0xa'));router[_0x3b27('0xb')]('/',auth[_0x3b27('0xc')](),controller[_0x3b27('0xd')]);router[_0x3b27('0xb')](_0x3b27('0xe'),auth['isAuthenticated'](),controller['describe']);router[_0x3b27('0xb')](_0x3b27('0xf'),auth[_0x3b27('0xc')](),controller[_0x3b27('0x10')]);router[_0x3b27('0x11')]('/',auth[_0x3b27('0xc')](),controller['create']);router['put'](_0x3b27('0xf'),auth['isAuthenticated'](),controller['update']);router[_0x3b27('0x12')](_0x3b27('0xf'),auth[_0x3b27('0xc')](),controller[_0x3b27('0x13')]);module['exports']=router; \ No newline at end of file +var _0x9549=['express','Router','../../components/auth/service','../../config/environment','get','index','/describe','isAuthenticated','describe','show','create','/:id','update','delete','destroy','exports','util','path','connect-timeout'];(function(_0x5c3b5d,_0x361f68){var _0x41e939=function(_0x17bd46){while(--_0x17bd46){_0x5c3b5d['push'](_0x5c3b5d['shift']());}};_0x41e939(++_0x361f68);}(_0x9549,0x11a));var _0x9954=function(_0x23648b,_0x51a25f){_0x23648b=_0x23648b-0x0;var _0x2b5a63=_0x9549[_0x23648b];return _0x2b5a63;};'use strict';var multer=require('multer');var util=require(_0x9954('0x0'));var path=require(_0x9954('0x1'));var timeout=require(_0x9954('0x2'));var express=require(_0x9954('0x3'));var router=express[_0x9954('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x9954('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x9954('0x6'));var controller=require('./voiceTransferReport.controller');router[_0x9954('0x7')]('/',auth['isAuthenticated'](),controller[_0x9954('0x8')]);router[_0x9954('0x7')](_0x9954('0x9'),auth[_0x9954('0xa')](),controller[_0x9954('0xb')]);router[_0x9954('0x7')]('/:id',auth[_0x9954('0xa')](),controller[_0x9954('0xc')]);router['post']('/',auth['isAuthenticated'](),controller[_0x9954('0xd')]);router['put'](_0x9954('0xe'),auth['isAuthenticated'](),controller[_0x9954('0xf')]);router[_0x9954('0x10')]('/:id',auth[_0x9954('0xa')](),controller[_0x9954('0x11')]);module[_0x9954('0x12')]=router; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.attributes.js b/server/api/voiceTransferReport/voiceTransferReport.attributes.js index 85e6c59..60c9a5c 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 _0x8c26=['Yes','sequelize','exports','blind','attended','STRING','ENUM'];(function(_0x503dd5,_0x23107f){var _0x1dd2a3=function(_0x1db002){while(--_0x1db002){_0x503dd5['push'](_0x503dd5['shift']());}};_0x1dd2a3(++_0x23107f);}(_0x8c26,0x119));var _0x68c2=function(_0x328f7d,_0xa5dee4){_0x328f7d=_0x328f7d-0x0;var _0x4d9442=_0x8c26[_0x328f7d];return _0x4d9442;};'use strict';var Sequelize=require(_0x68c2('0x0'));var moment=require('moment');module[_0x68c2('0x1')]={'type':{'type':Sequelize['ENUM'](_0x68c2('0x2'),_0x68c2('0x3'))},'result':{'type':Sequelize[_0x68c2('0x4')]},'transfererchannel':{'type':Sequelize[_0x68c2('0x4')]},'transferercalleridnum':{'type':Sequelize['STRING']},'transferercalleridname':{'type':Sequelize[_0x68c2('0x4')]},'transfererconnectedlinenum':{'type':Sequelize[_0x68c2('0x4')]},'transfererconnectedlinename':{'type':Sequelize[_0x68c2('0x4')]},'transfereraccountcode':{'type':Sequelize[_0x68c2('0x4')]},'transferercontext':{'type':Sequelize['STRING']},'transfererexten':{'type':Sequelize[_0x68c2('0x4')]},'transfererlinkedid':{'type':Sequelize['STRING']},'transfereechannel':{'type':Sequelize[_0x68c2('0x4')]},'transfereecalleridnum':{'type':Sequelize[_0x68c2('0x4')]},'transfereecalleridname':{'type':Sequelize[_0x68c2('0x4')]},'transfereeconnectedlinenum':{'type':Sequelize[_0x68c2('0x4')]},'transfereeconnectedlinename':{'type':Sequelize[_0x68c2('0x4')]},'transfereeaccountcode':{'type':Sequelize[_0x68c2('0x4')]},'transfereecontext':{'type':Sequelize[_0x68c2('0x4')]},'transfereeexten':{'type':Sequelize[_0x68c2('0x4')]},'transfereelinkedid':{'type':Sequelize[_0x68c2('0x4')]},'isexternal':{'type':Sequelize[_0x68c2('0x5')](_0x68c2('0x6'),'No')},'context':{'type':Sequelize[_0x68c2('0x4')]},'extension':{'type':Sequelize[_0x68c2('0x4')]}}; \ No newline at end of file +var _0x8041=['sequelize','exports','ENUM','blind','attended','STRING','Yes'];(function(_0x1f1314,_0x283736){var _0x54930f=function(_0x357b4d){while(--_0x357b4d){_0x1f1314['push'](_0x1f1314['shift']());}};_0x54930f(++_0x283736);}(_0x8041,0x118));var _0x1804=function(_0x51499b,_0x22523f){_0x51499b=_0x51499b-0x0;var _0x19fec7=_0x8041[_0x51499b];return _0x19fec7;};'use strict';var Sequelize=require(_0x1804('0x0'));var moment=require('moment');module[_0x1804('0x1')]={'type':{'type':Sequelize[_0x1804('0x2')](_0x1804('0x3'),_0x1804('0x4'))},'result':{'type':Sequelize['STRING']},'transfererchannel':{'type':Sequelize['STRING']},'transferercalleridnum':{'type':Sequelize[_0x1804('0x5')]},'transferercalleridname':{'type':Sequelize[_0x1804('0x5')]},'transfererconnectedlinenum':{'type':Sequelize[_0x1804('0x5')]},'transfererconnectedlinename':{'type':Sequelize[_0x1804('0x5')]},'transfereraccountcode':{'type':Sequelize['STRING']},'transferercontext':{'type':Sequelize['STRING']},'transfererexten':{'type':Sequelize[_0x1804('0x5')]},'transfererlinkedid':{'type':Sequelize[_0x1804('0x5')]},'transfereechannel':{'type':Sequelize[_0x1804('0x5')]},'transfereecalleridnum':{'type':Sequelize[_0x1804('0x5')]},'transfereecalleridname':{'type':Sequelize[_0x1804('0x5')]},'transfereeconnectedlinenum':{'type':Sequelize[_0x1804('0x5')]},'transfereeconnectedlinename':{'type':Sequelize[_0x1804('0x5')]},'transfereeaccountcode':{'type':Sequelize[_0x1804('0x5')]},'transfereecontext':{'type':Sequelize[_0x1804('0x5')]},'transfereeexten':{'type':Sequelize[_0x1804('0x5')]},'transfereelinkedid':{'type':Sequelize[_0x1804('0x5')]},'isexternal':{'type':Sequelize[_0x1804('0x2')](_0x1804('0x6'),'No')},'context':{'type':Sequelize[_0x1804('0x5')]},'extension':{'type':Sequelize[_0x1804('0x5')]}}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.controller.js b/server/api/voiceTransferReport/voiceTransferReport.controller.js index 9197fcf..7b3ab35 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 _0xb237=['papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/license/util','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','update','then','destroy','error','stack','index','map','VoiceTransferReport','fieldName','type','key','model','name','query','keys','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filters','filter','merge','VIRTUAL','options','includeAll','include','findAll','params','rawAttributes','find','create','body','catch','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel'];(function(_0x567f47,_0x21c905){var _0x8d70c3=function(_0x2df639){while(--_0x2df639){_0x567f47['push'](_0x567f47['shift']());}};_0x8d70c3(++_0x21c905);}(_0xb237,0x15a));var _0x7b23=function(_0x57f0e7,_0x24075e){_0x57f0e7=_0x57f0e7-0x0;var _0x4f278c=_0xb237[_0x57f0e7];return _0x4f278c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7b23('0x0'));var zipdir=require(_0x7b23('0x1'));var jsonpatch=require(_0x7b23('0x2'));var rp=require(_0x7b23('0x3'));var moment=require(_0x7b23('0x4'));var BPromise=require(_0x7b23('0x5'));var Mustache=require(_0x7b23('0x6'));var util=require(_0x7b23('0x7'));var path=require('path');var sox=require(_0x7b23('0x8'));var csv=require(_0x7b23('0x9'));var ejs=require(_0x7b23('0xa'));var fs=require('fs');var fs_extra=require(_0x7b23('0xb'));var _=require(_0x7b23('0xc'));var squel=require(_0x7b23('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x7b23('0xe'));var Redis=require(_0x7b23('0xf'));var authService=require(_0x7b23('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x7b23('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x7b23('0x12'));var utils=require(_0x7b23('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x7b23('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x36e2b8,_0xe27ece){_0xe27ece=_0xe27ece||0xcc;return function(_0x1d6942){if(_0x1d6942){return _0x36e2b8[_0x7b23('0x15')](_0xe27ece);}return _0x36e2b8[_0x7b23('0x16')](_0xe27ece)[_0x7b23('0x17')]();};}function respondWithResult(_0x498da9,_0x2ea801){_0x2ea801=_0x2ea801||0xc8;return function(_0x57e605){if(_0x57e605){return _0x498da9['status'](_0x2ea801)[_0x7b23('0x18')](_0x57e605);}};}function respondWithFilteredResult(_0x48431e,_0x39e459){return function(_0x1fdaab){if(_0x1fdaab){var _0x574773=typeof _0x39e459['offset']===_0x7b23('0x19')&&typeof _0x39e459[_0x7b23('0x1a')]===_0x7b23('0x19');var _0x2f39f3=_0x1fdaab[_0x7b23('0x1b')];var _0x118542=_0x574773?0x0:_0x39e459[_0x7b23('0x1c')];var _0x4b4048=_0x574773?_0x1fdaab[_0x7b23('0x1b')]:_0x39e459[_0x7b23('0x1c')]+_0x39e459[_0x7b23('0x1a')];var _0x5a9cf9;if(_0x4b4048>=_0x2f39f3){_0x4b4048=_0x2f39f3;_0x5a9cf9=0xc8;}else{_0x5a9cf9=0xce;}_0x48431e[_0x7b23('0x16')](_0x5a9cf9);return _0x48431e[_0x7b23('0x1d')](_0x7b23('0x1e'),_0x118542+'-'+_0x4b4048+'/'+_0x2f39f3)[_0x7b23('0x18')](_0x1fdaab);}return null;};}function patchUpdates(_0x53e2fe){return function(_0xf08678){try{jsonpatch[_0x7b23('0x1f')](_0xf08678,_0x53e2fe,!![]);}catch(_0x1f04a8){return BPromise[_0x7b23('0x20')](_0x1f04a8);}return _0xf08678['save']();};}function saveUpdates(_0x4295f5,_0x5e9d6a){return function(_0x397951){if(_0x397951){return _0x397951[_0x7b23('0x21')](_0x4295f5)[_0x7b23('0x22')](function(_0x2ec640){return _0x2ec640;});}return null;};}function removeEntity(_0x2af31b,_0x26ee4c){return function(_0x171b58){if(_0x171b58){return _0x171b58[_0x7b23('0x23')]()[_0x7b23('0x22')](function(){_0x2af31b[_0x7b23('0x16')](0xcc)[_0x7b23('0x17')]();});}};}function handleEntityNotFound(_0x14a81c,_0x3ffda9){return function(_0x1c9542){if(!_0x1c9542){_0x14a81c[_0x7b23('0x15')](0x194);}return _0x1c9542;};}function handleError(_0x5bad6a,_0x1c9280){_0x1c9280=_0x1c9280||0x1f4;return function(_0x4af698){logger[_0x7b23('0x24')](_0x4af698[_0x7b23('0x25')]);if(_0x4af698['name']){delete _0x4af698['name'];}_0x5bad6a['status'](_0x1c9280)['send'](_0x4af698);};}exports[_0x7b23('0x26')]=function(_0x522db4,_0xd11b23){var _0x30d071={},_0x20ec61={},_0x1c2bba={'count':0x0,'rows':[]};var _0x376c04=_[_0x7b23('0x27')](db[_0x7b23('0x28')]['rawAttributes'],function(_0x56814b){return{'name':_0x56814b[_0x7b23('0x29')],'type':_0x56814b[_0x7b23('0x2a')][_0x7b23('0x2b')]};});_0x20ec61[_0x7b23('0x2c')]=_[_0x7b23('0x27')](_0x376c04,_0x7b23('0x2d'));_0x20ec61[_0x7b23('0x2e')]=_[_0x7b23('0x2f')](_0x522db4[_0x7b23('0x2e')]);_0x20ec61['filters']=_['intersection'](_0x20ec61[_0x7b23('0x2c')],_0x20ec61[_0x7b23('0x2e')]);_0x30d071['attributes']=_[_0x7b23('0x30')](_0x20ec61['model'],qs[_0x7b23('0x31')](_0x522db4[_0x7b23('0x2e')][_0x7b23('0x31')]));_0x30d071[_0x7b23('0x32')]=_0x30d071[_0x7b23('0x32')][_0x7b23('0x33')]?_0x30d071['attributes']:_0x20ec61[_0x7b23('0x2c')];if(!_0x522db4['query'][_0x7b23('0x34')]('nolimit')){_0x30d071[_0x7b23('0x1a')]=qs[_0x7b23('0x1a')](_0x522db4[_0x7b23('0x2e')][_0x7b23('0x1a')]);_0x30d071[_0x7b23('0x1c')]=qs[_0x7b23('0x1c')](_0x522db4[_0x7b23('0x2e')][_0x7b23('0x1c')]);}_0x30d071[_0x7b23('0x35')]=qs['sort'](_0x522db4['query'][_0x7b23('0x36')]);_0x30d071[_0x7b23('0x37')]=qs['filters'](_[_0x7b23('0x38')](_0x522db4[_0x7b23('0x2e')],_0x20ec61[_0x7b23('0x39')]),_0x376c04);if(_0x522db4[_0x7b23('0x2e')][_0x7b23('0x3a')]){_0x30d071[_0x7b23('0x37')]=_[_0x7b23('0x3b')](_0x30d071[_0x7b23('0x37')],{'$or':_[_0x7b23('0x27')](_0x376c04,function(_0x19f407){if(_0x19f407[_0x7b23('0x2a')]!==_0x7b23('0x3c')){var _0x5706bc={};_0x5706bc[_0x19f407[_0x7b23('0x2d')]]={'$like':'%'+_0x522db4[_0x7b23('0x2e')][_0x7b23('0x3a')]+'%'};return _0x5706bc;}})});}_0x30d071=_[_0x7b23('0x3b')]({},_0x30d071,_0x522db4[_0x7b23('0x3d')]);var _0x23a8cf={'where':_0x30d071[_0x7b23('0x37')]};return db[_0x7b23('0x28')][_0x7b23('0x1b')](_0x23a8cf)[_0x7b23('0x22')](function(_0x2a88da){_0x1c2bba['count']=_0x2a88da;if(_0x522db4[_0x7b23('0x2e')][_0x7b23('0x3e')]){_0x30d071[_0x7b23('0x3f')]=[{'all':!![]}];}return db['VoiceTransferReport'][_0x7b23('0x40')](_0x30d071);})['then'](function(_0x4f8dad){_0x1c2bba['rows']=_0x4f8dad;return _0x1c2bba;})[_0x7b23('0x22')](respondWithFilteredResult(_0xd11b23,_0x30d071))['catch'](handleError(_0xd11b23,null));};exports['show']=function(_0x11b962,_0xa45006){var _0x3f7615={'raw':!![],'where':{'id':_0x11b962[_0x7b23('0x41')]['id']}},_0x153418={};_0x153418['model']=_[_0x7b23('0x2f')](db[_0x7b23('0x28')][_0x7b23('0x42')]);_0x153418['query']=_[_0x7b23('0x2f')](_0x11b962[_0x7b23('0x2e')]);_0x153418['filters']=_['intersection'](_0x153418[_0x7b23('0x2c')],_0x153418[_0x7b23('0x2e')]);_0x3f7615['attributes']=_[_0x7b23('0x30')](_0x153418['model'],qs[_0x7b23('0x31')](_0x11b962['query'][_0x7b23('0x31')]));_0x3f7615[_0x7b23('0x32')]=_0x3f7615[_0x7b23('0x32')][_0x7b23('0x33')]?_0x3f7615[_0x7b23('0x32')]:_0x153418[_0x7b23('0x2c')];if(_0x11b962[_0x7b23('0x2e')][_0x7b23('0x3e')]){_0x3f7615['include']=[{'all':!![]}];}_0x3f7615=_[_0x7b23('0x3b')]({},_0x3f7615,_0x11b962[_0x7b23('0x3d')]);return db['VoiceTransferReport'][_0x7b23('0x43')](_0x3f7615)[_0x7b23('0x22')](handleEntityNotFound(_0xa45006,null))[_0x7b23('0x22')](respondWithResult(_0xa45006,null))['catch'](handleError(_0xa45006,null));};exports[_0x7b23('0x44')]=function(_0x529d0d,_0x53d69f){return db[_0x7b23('0x28')][_0x7b23('0x44')](_0x529d0d[_0x7b23('0x45')],{})[_0x7b23('0x22')](respondWithResult(_0x53d69f,0xc9))[_0x7b23('0x46')](handleError(_0x53d69f,null));};exports[_0x7b23('0x21')]=function(_0x4f1b4a,_0x48db40){if(_0x4f1b4a[_0x7b23('0x45')]['id']){delete _0x4f1b4a[_0x7b23('0x45')]['id'];}return db['VoiceTransferReport'][_0x7b23('0x43')]({'where':{'id':_0x4f1b4a[_0x7b23('0x41')]['id']}})[_0x7b23('0x22')](handleEntityNotFound(_0x48db40,null))['then'](saveUpdates(_0x4f1b4a[_0x7b23('0x45')],null))[_0x7b23('0x22')](respondWithResult(_0x48db40,null))[_0x7b23('0x46')](handleError(_0x48db40,null));};exports[_0x7b23('0x23')]=function(_0x279dff,_0x511268){return db[_0x7b23('0x28')]['find']({'where':{'id':_0x279dff['params']['id']}})[_0x7b23('0x22')](handleEntityNotFound(_0x511268,null))[_0x7b23('0x22')](removeEntity(_0x511268,null))[_0x7b23('0x46')](handleError(_0x511268,null));};exports[_0x7b23('0x47')]=function(_0x32161d,_0x7c4e70){return db[_0x7b23('0x28')][_0x7b23('0x47')]()[_0x7b23('0x22')](respondWithResult(_0x7c4e70,null))[_0x7b23('0x46')](handleError(_0x7c4e70,null));}; \ No newline at end of file +var _0xb03a=['name','send','index','map','VoiceTransferReport','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','fields','length','sort','filter','where','merge','options','count','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','Content-Range','apply','save','update','then','destroy','stack'];(function(_0xa1a326,_0x5030e4){var _0x9e116e=function(_0x26b36b){while(--_0x26b36b){_0xa1a326['push'](_0xa1a326['shift']());}};_0x9e116e(++_0x5030e4);}(_0xb03a,0x1d1));var _0xab03=function(_0x5f2715,_0x49f7d9){_0x5f2715=_0x5f2715-0x0;var _0x5ad7d5=_0xb03a[_0x5f2715];return _0x5ad7d5;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xab03('0x0'));var zipdir=require(_0xab03('0x1'));var jsonpatch=require(_0xab03('0x2'));var rp=require(_0xab03('0x3'));var moment=require(_0xab03('0x4'));var BPromise=require(_0xab03('0x5'));var Mustache=require('mustache');var util=require(_0xab03('0x6'));var path=require(_0xab03('0x7'));var sox=require(_0xab03('0x8'));var csv=require(_0xab03('0x9'));var ejs=require(_0xab03('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xab03('0xb'));var squel=require(_0xab03('0xc'));var crypto=require('crypto');var jsforce=require(_0xab03('0xd'));var deskjs=require(_0xab03('0xe'));var toCsv=require(_0xab03('0x9'));var querystring=require(_0xab03('0xf'));var Papa=require('papaparse');var Redis=require(_0xab03('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xab03('0x11'));var as=require(_0xab03('0x12'));var hardwareService=require(_0xab03('0x13'));var logger=require(_0xab03('0x14'))(_0xab03('0x15'));var utils=require(_0xab03('0x16'));var config=require(_0xab03('0x17'));var licenseUtil=require(_0xab03('0x18'));var db=require(_0xab03('0x19'))['db'];function respondWithStatusCode(_0x45d620,_0x1f9b3d){_0x1f9b3d=_0x1f9b3d||0xcc;return function(_0x31613b){if(_0x31613b){return _0x45d620['sendStatus'](_0x1f9b3d);}return _0x45d620[_0xab03('0x1a')](_0x1f9b3d)[_0xab03('0x1b')]();};}function respondWithResult(_0x57b6f1,_0x21d913){_0x21d913=_0x21d913||0xc8;return function(_0x469c24){if(_0x469c24){return _0x57b6f1[_0xab03('0x1a')](_0x21d913)[_0xab03('0x1c')](_0x469c24);}};}function respondWithFilteredResult(_0x2dcb77,_0x41db9d){return function(_0x4fcc9e){if(_0x4fcc9e){var _0x2c2b55=typeof _0x41db9d[_0xab03('0x1d')]===_0xab03('0x1e')&&typeof _0x41db9d[_0xab03('0x1f')]===_0xab03('0x1e');var _0x40159c=_0x4fcc9e['count'];var _0x33ca33=_0x2c2b55?0x0:_0x41db9d['offset'];var _0x2b80d9=_0x2c2b55?_0x4fcc9e['count']:_0x41db9d['offset']+_0x41db9d[_0xab03('0x1f')];var _0x397680;if(_0x2b80d9>=_0x40159c){_0x2b80d9=_0x40159c;_0x397680=0xc8;}else{_0x397680=0xce;}_0x2dcb77[_0xab03('0x1a')](_0x397680);return _0x2dcb77['set'](_0xab03('0x20'),_0x33ca33+'-'+_0x2b80d9+'/'+_0x40159c)[_0xab03('0x1c')](_0x4fcc9e);}return null;};}function patchUpdates(_0x417486){return function(_0x477608){try{jsonpatch[_0xab03('0x21')](_0x477608,_0x417486,!![]);}catch(_0x40f900){return BPromise['reject'](_0x40f900);}return _0x477608[_0xab03('0x22')]();};}function saveUpdates(_0xd2fbb3,_0x155d99){return function(_0x4ba633){if(_0x4ba633){return _0x4ba633[_0xab03('0x23')](_0xd2fbb3)[_0xab03('0x24')](function(_0x18791f){return _0x18791f;});}return null;};}function removeEntity(_0x811d89,_0xd4e52){return function(_0x4f936d){if(_0x4f936d){return _0x4f936d[_0xab03('0x25')]()[_0xab03('0x24')](function(){_0x811d89[_0xab03('0x1a')](0xcc)[_0xab03('0x1b')]();});}};}function handleEntityNotFound(_0x2a1566,_0x1f21fe){return function(_0x2ed514){if(!_0x2ed514){_0x2a1566['sendStatus'](0x194);}return _0x2ed514;};}function handleError(_0x5690ff,_0x547159){_0x547159=_0x547159||0x1f4;return function(_0x2ed3d4){logger['error'](_0x2ed3d4[_0xab03('0x26')]);if(_0x2ed3d4[_0xab03('0x27')]){delete _0x2ed3d4['name'];}_0x5690ff['status'](_0x547159)[_0xab03('0x28')](_0x2ed3d4);};}exports[_0xab03('0x29')]=function(_0x378b8d,_0x111547){var _0x33935c={},_0x5f1c3d={},_0x5a4e8d={'count':0x0,'rows':[]};var _0x331663=_[_0xab03('0x2a')](db[_0xab03('0x2b')][_0xab03('0x2c')],function(_0x3e81b1){return{'name':_0x3e81b1[_0xab03('0x2d')],'type':_0x3e81b1['type'][_0xab03('0x2e')]};});_0x5f1c3d[_0xab03('0x2f')]=_[_0xab03('0x2a')](_0x331663,'name');_0x5f1c3d['query']=_['keys'](_0x378b8d[_0xab03('0x30')]);_0x5f1c3d[_0xab03('0x31')]=_[_0xab03('0x32')](_0x5f1c3d[_0xab03('0x2f')],_0x5f1c3d[_0xab03('0x30')]);_0x33935c[_0xab03('0x33')]=_[_0xab03('0x32')](_0x5f1c3d[_0xab03('0x2f')],qs[_0xab03('0x34')](_0x378b8d['query'][_0xab03('0x34')]));_0x33935c[_0xab03('0x33')]=_0x33935c[_0xab03('0x33')][_0xab03('0x35')]?_0x33935c['attributes']:_0x5f1c3d[_0xab03('0x2f')];if(!_0x378b8d[_0xab03('0x30')]['hasOwnProperty']('nolimit')){_0x33935c['limit']=qs[_0xab03('0x1f')](_0x378b8d[_0xab03('0x30')][_0xab03('0x1f')]);_0x33935c[_0xab03('0x1d')]=qs[_0xab03('0x1d')](_0x378b8d[_0xab03('0x30')][_0xab03('0x1d')]);}_0x33935c['order']=qs['sort'](_0x378b8d[_0xab03('0x30')][_0xab03('0x36')]);_0x33935c['where']=qs[_0xab03('0x31')](_['pick'](_0x378b8d['query'],_0x5f1c3d[_0xab03('0x31')]),_0x331663);if(_0x378b8d[_0xab03('0x30')][_0xab03('0x37')]){_0x33935c[_0xab03('0x38')]=_[_0xab03('0x39')](_0x33935c[_0xab03('0x38')],{'$or':_[_0xab03('0x2a')](_0x331663,function(_0x3a04c2){if(_0x3a04c2['type']!=='VIRTUAL'){var _0x260606={};_0x260606[_0x3a04c2[_0xab03('0x27')]]={'$like':'%'+_0x378b8d['query'][_0xab03('0x37')]+'%'};return _0x260606;}})});}_0x33935c=_['merge']({},_0x33935c,_0x378b8d[_0xab03('0x3a')]);var _0x58f01b={'where':_0x33935c['where']};return db[_0xab03('0x2b')][_0xab03('0x3b')](_0x58f01b)['then'](function(_0x257456){_0x5a4e8d[_0xab03('0x3b')]=_0x257456;if(_0x378b8d[_0xab03('0x30')][_0xab03('0x3c')]){_0x33935c[_0xab03('0x3d')]=[{'all':!![]}];}return db[_0xab03('0x2b')][_0xab03('0x3e')](_0x33935c);})['then'](function(_0x358c1a){_0x5a4e8d[_0xab03('0x3f')]=_0x358c1a;return _0x5a4e8d;})['then'](respondWithFilteredResult(_0x111547,_0x33935c))[_0xab03('0x40')](handleError(_0x111547,null));};exports[_0xab03('0x41')]=function(_0x5d3a61,_0x108bd0){var _0x1c112a={'raw':!![],'where':{'id':_0x5d3a61[_0xab03('0x42')]['id']}},_0xf8de6={};_0xf8de6[_0xab03('0x2f')]=_[_0xab03('0x43')](db[_0xab03('0x2b')][_0xab03('0x2c')]);_0xf8de6[_0xab03('0x30')]=_[_0xab03('0x43')](_0x5d3a61['query']);_0xf8de6[_0xab03('0x31')]=_[_0xab03('0x32')](_0xf8de6[_0xab03('0x2f')],_0xf8de6['query']);_0x1c112a[_0xab03('0x33')]=_[_0xab03('0x32')](_0xf8de6[_0xab03('0x2f')],qs[_0xab03('0x34')](_0x5d3a61['query'][_0xab03('0x34')]));_0x1c112a[_0xab03('0x33')]=_0x1c112a[_0xab03('0x33')]['length']?_0x1c112a[_0xab03('0x33')]:_0xf8de6[_0xab03('0x2f')];if(_0x5d3a61['query']['includeAll']){_0x1c112a[_0xab03('0x3d')]=[{'all':!![]}];}_0x1c112a=_[_0xab03('0x39')]({},_0x1c112a,_0x5d3a61[_0xab03('0x3a')]);return db['VoiceTransferReport'][_0xab03('0x44')](_0x1c112a)[_0xab03('0x24')](handleEntityNotFound(_0x108bd0,null))['then'](respondWithResult(_0x108bd0,null))['catch'](handleError(_0x108bd0,null));};exports[_0xab03('0x45')]=function(_0x5ea1d6,_0x15b5e9){return db['VoiceTransferReport'][_0xab03('0x45')](_0x5ea1d6['body'],{})[_0xab03('0x24')](respondWithResult(_0x15b5e9,0xc9))[_0xab03('0x40')](handleError(_0x15b5e9,null));};exports[_0xab03('0x23')]=function(_0x2b5266,_0x81c6d6){if(_0x2b5266[_0xab03('0x46')]['id']){delete _0x2b5266['body']['id'];}return db[_0xab03('0x2b')]['find']({'where':{'id':_0x2b5266[_0xab03('0x42')]['id']}})['then'](handleEntityNotFound(_0x81c6d6,null))[_0xab03('0x24')](saveUpdates(_0x2b5266[_0xab03('0x46')],null))[_0xab03('0x24')](respondWithResult(_0x81c6d6,null))[_0xab03('0x40')](handleError(_0x81c6d6,null));};exports[_0xab03('0x25')]=function(_0x2ef039,_0x26d5dd){return db['VoiceTransferReport'][_0xab03('0x44')]({'where':{'id':_0x2ef039[_0xab03('0x42')]['id']}})[_0xab03('0x24')](handleEntityNotFound(_0x26d5dd,null))[_0xab03('0x24')](removeEntity(_0x26d5dd,null))[_0xab03('0x40')](handleError(_0x26d5dd,null));};exports[_0xab03('0x47')]=function(_0x517401,_0x93b125){return db[_0xab03('0x2b')][_0xab03('0x47')]()[_0xab03('0x24')](respondWithResult(_0x93b125,null))[_0xab03('0x40')](handleError(_0x93b125,null));}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.model.js b/server/api/voiceTransferReport/voiceTransferReport.model.js index 376a546..830299e 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 _0x5a8c=['./voiceTransferReport.attributes','exports','define','report_call_transfer','util','api','moment','bluebird','request-promise'];(function(_0x394268,_0x13f0ff){var _0x736a21=function(_0x71e22d){while(--_0x71e22d){_0x394268['push'](_0x394268['shift']());}};_0x736a21(++_0x13f0ff);}(_0x5a8c,0x1c6));var _0xc5a8=function(_0x35ebae,_0x4f86c4){_0x35ebae=_0x35ebae-0x0;var _0x1924cf=_0x5a8c[_0x35ebae];return _0x1924cf;};'use strict';var _=require('lodash');var util=require(_0xc5a8('0x0'));var logger=require('../../config/logger')(_0xc5a8('0x1'));var moment=require(_0xc5a8('0x2'));var BPromise=require(_0xc5a8('0x3'));var rp=require(_0xc5a8('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xc5a8('0x5'));module[_0xc5a8('0x6')]=function(_0x2615c2,_0x3a2eba){return _0x2615c2[_0xc5a8('0x7')]('VoiceTransferReport',attributes,{'tableName':_0xc5a8('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8126=['define','VoiceTransferReport','util','../../config/logger','api','moment','path','rimraf','../../config/environment','./voiceTransferReport.attributes','exports'];(function(_0x22b833,_0x3856df){var _0x4d3c68=function(_0x4aeb11){while(--_0x4aeb11){_0x22b833['push'](_0x22b833['shift']());}};_0x4d3c68(++_0x3856df);}(_0x8126,0x1a4));var _0x6812=function(_0x37e8e8,_0x1be63e){_0x37e8e8=_0x37e8e8-0x0;var _0x2c3c9e=_0x8126[_0x37e8e8];return _0x2c3c9e;};'use strict';var _=require('lodash');var util=require(_0x6812('0x0'));var logger=require(_0x6812('0x1'))(_0x6812('0x2'));var moment=require(_0x6812('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x6812('0x4'));var rimraf=require(_0x6812('0x5'));var config=require(_0x6812('0x6'));var attributes=require(_0x6812('0x7'));module[_0x6812('0x8')]=function(_0x5634b1,_0x38af5b){return _0x5634b1[_0x6812('0x9')](_0x6812('0xa'),attributes,{'tableName':'report_call_transfer','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.rpc.js b/server/api/voiceTransferReport/voiceTransferReport.rpc.js index 94e7d0b..99d78ab 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 _0xab59=['lodash','util','moment','ioredis','rpc','../../config/environment','client','http','request','then','info','VoiceTransferReport,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','CreateVoiceTransferReport','create','body','options','raw'];(function(_0x3c4f40,_0x302e0b){var _0x12032f=function(_0x159d92){while(--_0x159d92){_0x3c4f40['push'](_0x3c4f40['shift']());}};_0x12032f(++_0x302e0b);}(_0xab59,0x1c8));var _0x9ab5=function(_0x1dc01f,_0x157a75){_0x1dc01f=_0x1dc01f-0x0;var _0x298041=_0xab59[_0x1dc01f];return _0x298041;};'use strict';var _=require(_0x9ab5('0x0'));var util=require(_0x9ab5('0x1'));var moment=require(_0x9ab5('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9ab5('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x9ab5('0x4'));var config=require(_0x9ab5('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x9ab5('0x6')][_0x9ab5('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x2c3b85,_0x3bff6d,_0x35076e){return new BPromise(function(_0x46623a,_0x581913){return client[_0x9ab5('0x8')](_0x2c3b85,_0x35076e)[_0x9ab5('0x9')](function(_0x676386){logger[_0x9ab5('0xa')](_0x9ab5('0xb'),_0x3bff6d,'request\x20sent');logger[_0x9ab5('0xc')]('VoiceTransferReport,\x20%s,\x20%s,\x20%s',_0x3bff6d,_0x9ab5('0xd'),JSON[_0x9ab5('0xe')](_0x676386));if(_0x676386[_0x9ab5('0xf')]){if(_0x676386[_0x9ab5('0xf')][_0x9ab5('0x10')]===0x1f4){logger[_0x9ab5('0xf')](_0x9ab5('0xb'),_0x3bff6d,_0x676386['error'][_0x9ab5('0x11')]);return _0x581913(_0x676386[_0x9ab5('0xf')]['message']);}logger[_0x9ab5('0xf')](_0x9ab5('0xb'),_0x3bff6d,_0x676386[_0x9ab5('0xf')][_0x9ab5('0x11')]);return _0x46623a(_0x676386[_0x9ab5('0xf')][_0x9ab5('0x11')]);}else{logger[_0x9ab5('0xa')](_0x9ab5('0xb'),_0x3bff6d,_0x9ab5('0xd'));_0x46623a(_0x676386[_0x9ab5('0x12')][_0x9ab5('0x11')]);}})['catch'](function(_0x1ff9a5){logger['error'](_0x9ab5('0xb'),_0x3bff6d,_0x1ff9a5);_0x581913(_0x1ff9a5);});});}exports[_0x9ab5('0x13')]=function(_0x41b060){var _0x4db16b=this;return new Promise(function(_0x506186,_0x20e608){return db['VoiceTransferReport'][_0x9ab5('0x14')](_0x41b060[_0x9ab5('0x15')],{'raw':_0x41b060[_0x9ab5('0x16')]?_0x41b060[_0x9ab5('0x16')][_0x9ab5('0x17')]===undefined?!![]:![]:!![]})[_0x9ab5('0x9')](function(_0x39e011){logger['info'](_0x9ab5('0x13'),_0x41b060);logger[_0x9ab5('0xc')]('CreateVoiceTransferReport',_0x41b060,JSON['stringify'](_0x39e011));_0x506186(_0x39e011);})['catch'](function(_0x288733){logger['error'](_0x9ab5('0x13'),_0x288733[_0x9ab5('0x11')],_0x41b060);_0x20e608(_0x4db16b[_0x9ab5('0xf')](0x1f4,_0x288733[_0x9ab5('0x11')]));});});}; \ No newline at end of file +var _0xeff6=['CreateVoiceTransferReport','util','moment','bluebird','ioredis','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','VoiceTransferReport,\x20%s,\x20%s','request\x20sent','debug','VoiceTransferReport,\x20%s,\x20%s,\x20%s','error','message','result','catch','create','body','options','raw','then'];(function(_0x44f974,_0x4db616){var _0x805dbd=function(_0x1a56b7){while(--_0x1a56b7){_0x44f974['push'](_0x44f974['shift']());}};_0x805dbd(++_0x4db616);}(_0xeff6,0x114));var _0x6eff=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xeff6[_0x20a584];return _0x4b41a8;};'use strict';var _=require('lodash');var util=require(_0x6eff('0x0'));var moment=require(_0x6eff('0x1'));var BPromise=require(_0x6eff('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6eff('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x6eff('0x4'))('rpc');var config=require(_0x6eff('0x5'));var jayson=require(_0x6eff('0x6'));var client=jayson[_0x6eff('0x7')][_0x6eff('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x436d2,_0x277de,_0x3aa012){return new BPromise(function(_0x3580ac,_0x3e11e1){return client[_0x6eff('0x9')](_0x436d2,_0x3aa012)['then'](function(_0x25111c){logger[_0x6eff('0xa')](_0x6eff('0xb'),_0x277de,_0x6eff('0xc'));logger[_0x6eff('0xd')](_0x6eff('0xe'),_0x277de,'request\x20sent',JSON['stringify'](_0x25111c));if(_0x25111c[_0x6eff('0xf')]){if(_0x25111c['error']['code']===0x1f4){logger[_0x6eff('0xf')](_0x6eff('0xb'),_0x277de,_0x25111c[_0x6eff('0xf')]['message']);return _0x3e11e1(_0x25111c['error'][_0x6eff('0x10')]);}logger[_0x6eff('0xf')](_0x6eff('0xb'),_0x277de,_0x25111c[_0x6eff('0xf')][_0x6eff('0x10')]);return _0x3580ac(_0x25111c[_0x6eff('0xf')][_0x6eff('0x10')]);}else{logger['info'](_0x6eff('0xb'),_0x277de,_0x6eff('0xc'));_0x3580ac(_0x25111c[_0x6eff('0x11')][_0x6eff('0x10')]);}})[_0x6eff('0x12')](function(_0x1e4db4){logger[_0x6eff('0xf')](_0x6eff('0xb'),_0x277de,_0x1e4db4);_0x3e11e1(_0x1e4db4);});});}exports['CreateVoiceTransferReport']=function(_0x533d54){var _0x249ce4=this;return new Promise(function(_0x3291c4,_0x27ab6d){return db['VoiceTransferReport'][_0x6eff('0x13')](_0x533d54[_0x6eff('0x14')],{'raw':_0x533d54[_0x6eff('0x15')]?_0x533d54[_0x6eff('0x15')][_0x6eff('0x16')]===undefined?!![]:![]:!![]})[_0x6eff('0x17')](function(_0x24bb77){logger[_0x6eff('0xa')](_0x6eff('0x18'),_0x533d54);logger[_0x6eff('0xd')](_0x6eff('0x18'),_0x533d54,JSON['stringify'](_0x24bb77));_0x3291c4(_0x24bb77);})['catch'](function(_0x2f066e){logger['error'](_0x6eff('0x18'),_0x2f066e[_0x6eff('0x10')],_0x533d54);_0x27ab6d(_0x249ce4[_0x6eff('0xf')](0x1f4,_0x2f066e[_0x6eff('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/webbar/index.js b/server/api/webbar/index.js index 929f426..64cf73f 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 _0x767a=['isAuthenticated','canUpdate','originate','hangup','answer','/hold','/unhold','unhold','/calls','calls','/transfer','exports','express','Router','./webbar.controller','post','/originate'];(function(_0x594e01,_0x44f35f){var _0x1c3489=function(_0x36f757){while(--_0x36f757){_0x594e01['push'](_0x594e01['shift']());}};_0x1c3489(++_0x44f35f);}(_0x767a,0x193));var _0xa767=function(_0x13d07a,_0x41efc3){_0x13d07a=_0x13d07a-0x0;var _0x5ee0ee=_0x767a[_0x13d07a];return _0x5ee0ee;};'use strict';var express=require(_0xa767('0x0'));var router=express[_0xa767('0x1')]();var auth=require('../../components/auth/service');var controller=require(_0xa767('0x2'));router[_0xa767('0x3')](_0xa767('0x4'),auth[_0xa767('0x5')](),auth[_0xa767('0x6')](),controller[_0xa767('0x7')]);router['post']('/hangup',auth[_0xa767('0x5')](),auth[_0xa767('0x6')](),controller[_0xa767('0x8')]);router[_0xa767('0x3')]('/answer',auth['isAuthenticated'](),auth[_0xa767('0x6')](),controller[_0xa767('0x9')]);router['post'](_0xa767('0xa'),auth[_0xa767('0x5')](),auth[_0xa767('0x6')](),controller['hold']);router[_0xa767('0x3')](_0xa767('0xb'),auth['isAuthenticated'](),auth[_0xa767('0x6')](),controller[_0xa767('0xc')]);router[_0xa767('0x3')](_0xa767('0xd'),auth['isAuthenticated'](),auth['canUpdate'](),controller[_0xa767('0xe')]);router[_0xa767('0x3')](_0xa767('0xf'),auth[_0xa767('0x5')](),auth['canUpdate'](),controller['transfer']);module[_0xa767('0x10')]=router; \ No newline at end of file +var _0x5d9a=['isAuthenticated','canUpdate','originate','/hangup','/answer','/hold','hold','/unhold','unhold','calls','/transfer','exports','express','../../components/auth/service','./webbar.controller','post','/originate'];(function(_0x3f48c8,_0x299d53){var _0x4c7512=function(_0x526393){while(--_0x526393){_0x3f48c8['push'](_0x3f48c8['shift']());}};_0x4c7512(++_0x299d53);}(_0x5d9a,0x160));var _0xa5d9=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5d9a[_0x3dd15e];return _0x231fd0;};'use strict';var express=require(_0xa5d9('0x0'));var router=express['Router']();var auth=require(_0xa5d9('0x1'));var controller=require(_0xa5d9('0x2'));router[_0xa5d9('0x3')](_0xa5d9('0x4'),auth[_0xa5d9('0x5')](),auth[_0xa5d9('0x6')](),controller[_0xa5d9('0x7')]);router[_0xa5d9('0x3')](_0xa5d9('0x8'),auth[_0xa5d9('0x5')](),auth[_0xa5d9('0x6')](),controller['hangup']);router[_0xa5d9('0x3')](_0xa5d9('0x9'),auth['isAuthenticated'](),auth[_0xa5d9('0x6')](),controller['answer']);router[_0xa5d9('0x3')](_0xa5d9('0xa'),auth['isAuthenticated'](),auth[_0xa5d9('0x6')](),controller[_0xa5d9('0xb')]);router[_0xa5d9('0x3')](_0xa5d9('0xc'),auth[_0xa5d9('0x5')](),auth[_0xa5d9('0x6')](),controller[_0xa5d9('0xd')]);router[_0xa5d9('0x3')]('/calls',auth[_0xa5d9('0x5')](),auth[_0xa5d9('0x6')](),controller[_0xa5d9('0xe')]);router[_0xa5d9('0x3')](_0xa5d9('0xf'),auth['isAuthenticated'](),auth[_0xa5d9('0x6')](),controller['transfer']);module[_0xa5d9('0x10')]=router; \ No newline at end of file diff --git a/server/api/webbar/webbar.controller.js b/server/api/webbar/webbar.controller.js index 562f8b5..7a537e0 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 _0x6921=['string','sessionId\x20is\x20required','transferNumber\x20is\x20required','stringify','emit','handleError:','error','name','status','send','NotFound','request','then','code','result','User','findOne','agent','all','rows','UserId','sessionId','length','sessionId\x20','\x20not\x20found!','originate','originate\x20fired:','body','json','userId','callNumber','callerId','callbackUrl','info','entityFound:','format','webbar:originate','originate\x20executed!','catch','hangup','hangup\x20fired:','user:%s','webbar:hangup','hangup\x20executed!','answer','answer\x20fired:','webbar:answer','answer\x20executed!','hold','hold\x20fired:','unhold','unhold\x20fired:','webbar:unhold','unhold\x20executed!','calls','calls\x20fired:','VoiceChannels','filter','conference','webbar:conference','conference\x20executed!','transfer','transfer\x20fired:','transferNumber','transfer\x20executed!','lodash','../../config/environment','bluebird','jayson/promise','http','webbarapi','ioredis','redis','defaults','localhost','socket.io-emitter','validate','number','userId\x20is\x20required','callNumber\x20is\x20required'];(function(_0x5c096f,_0x35ea9d){var _0x3c24f3=function(_0x21c657){while(--_0x21c657){_0x5c096f['push'](_0x5c096f['shift']());}};_0x3c24f3(++_0x35ea9d);}(_0x6921,0x1d1));var _0x1692=function(_0x3f8cf4,_0x3e41a2){_0x3f8cf4=_0x3f8cf4-0x0;var _0x399d58=_0x6921[_0x3f8cf4];return _0x399d58;};'use strict';var path=require('path');var fs=require('fs');var _=require(_0x1692('0x0'));var db=require('../../mysqldb')['db'];var config=require(_0x1692('0x1'));var util=require('util');var BPromise=require(_0x1692('0x2'));var jayson=require(_0x1692('0x3'));var amiClient=jayson['client'][_0x1692('0x4')]({'port':0x232a});var logger=require('../../config/logger')(_0x1692('0x5'));var Redis=require(_0x1692('0x6'));config[_0x1692('0x7')]=_[_0x1692('0x8')](config[_0x1692('0x7')],{'host':_0x1692('0x9'),'port':0x18eb});var io=require(_0x1692('0xa'))(new Redis(config[_0x1692('0x7')]));var Schema=require(_0x1692('0xb'));var originateValidation=new Schema({'userId':{'type':_0x1692('0xc'),'required':[!![],_0x1692('0xd')]},'callNumber':{'type':'string','required':[!![],_0x1692('0xe')]},'callerId':{'type':'string'},'callbackUrl':{'type':_0x1692('0xf')}});var hangupValidation=new Schema({'userId':{'type':_0x1692('0xc'),'required':[!![],_0x1692('0xd')]},'sessionId':{'type':_0x1692('0xf'),'required':![]}});var answerValidation=new Schema({'userId':{'type':_0x1692('0xc'),'required':[!![],_0x1692('0xd')]},'sessionId':{'type':'string','required':![]}});var transferValidation=new Schema({'userId':{'type':_0x1692('0xc'),'required':[!![],_0x1692('0xd')]},'sessionId':{'type':_0x1692('0xf'),'required':[!![],_0x1692('0x10')]},'transferNumber':{'type':_0x1692('0xf'),'required':[!![],_0x1692('0x11')]}});var holdValidation=new Schema({'userId':{'type':'number','required':[!![],_0x1692('0xd')]},'sessionId':{'type':_0x1692('0xf'),'required':![]}});var unholdValidation=new Schema({'userId':{'type':_0x1692('0xc'),'required':[!![],_0x1692('0xd')]},'sessionId':{'type':_0x1692('0xf'),'required':![]}});var callsValidation=new Schema({'userId':{'type':_0x1692('0xc'),'required':[!![],_0x1692('0xd')]}});var conferenceValidation=new Schema({'userId':{'type':_0x1692('0xc'),'required':[!![],'userId\x20is\x20required']}});function emit(_0x12989e,_0x4990b1,_0x450509){logger['info'](_0x12989e,_0x4990b1,JSON[_0x1692('0x12')](_0x450509));io['to'](_0x12989e)[_0x1692('0x13')](_0x4990b1,_0x450509);}function handleError(_0x188026){return function(_0x4ea36d){console['log'](_0x1692('0x14'),_0x4ea36d,_0x4ea36d instanceof RangeError);logger[_0x1692('0x15')](_0x4ea36d['stack']);if(_0x4ea36d instanceof RangeError){if(_0x4ea36d[_0x1692('0x16')]){delete _0x4ea36d['name'];}_0x188026[_0x1692('0x17')](0x194)['send'](_0x4ea36d);}else{if(_0x4ea36d['name']){delete _0x4ea36d[_0x1692('0x16')];}_0x188026['status'](0x1f4)[_0x1692('0x18')](_0x4ea36d);}};}function checkError(){return function(_0x3c4d2f){if(!_0x3c4d2f){throw new RangeError(_0x1692('0x19'));}return _0x3c4d2f;};}function respondWithRpcPromise(_0x4c24c1,_0x234073){return new BPromise(function(_0x1d156a,_0x477e9d){var _0x1bc519=amiClient;return _0x1bc519[_0x1692('0x1a')](_0x4c24c1,_0x234073)[_0x1692('0x1b')](function(_0x4146af){if(_0x4146af['error']){if(_0x4146af[_0x1692('0x15')][_0x1692('0x1c')]===0x1f4){return _0x477e9d(_0x4146af['error']['message']);}return _0x1d156a(_0x4146af['error']['message']);}else{_0x1d156a(_0x4146af[_0x1692('0x1d')]);}})['catch'](function(_0x1a6a71){_0x477e9d(_0x1a6a71);});});}function getAgent(_0xf78abe){return db[_0x1692('0x1e')][_0x1692('0x1f')]({'where':{'id':_0xf78abe,'role':_0x1692('0x20')}})[_0x1692('0x1b')](checkError());}function getAgentCheckSession(_0x5a355b,_0x1a6708){return new BPromise(function(_0x1a4e1c,_0x429687){var _0x46fec4=respondWithRpcPromise('VoiceChannels');var _0x5364cd=getAgent(_0x5a355b);Promise[_0x1692('0x21')]([_0x46fec4,_0x5364cd])[_0x1692('0x1b')](function(_0x3d0d78){var _0x32b5c4=_0x3d0d78[0x0];var _0x4a2dba=_0x3d0d78[0x1];var _0x5341c8=_['filter'](_0x32b5c4[_0x1692('0x22')],function(_0x274dba){return _0x274dba[_0x1692('0x23')]==_0x4a2dba['id']&&_0x274dba[_0x1692('0x24')]==_0x1a6708;});if(_0x5341c8[_0x1692('0x25')]==0x1){_0x1a4e1c(_0x4a2dba);}else{_0x429687(new RangeError(_0x1692('0x26')+_0x1a6708+_0x1692('0x27')));}});});}exports[_0x1692('0x28')]=function(_0x5eb05b,_0x170884){logger['info'](_0x1692('0x29'),_0x5eb05b[_0x1692('0x2a')]);var _0x30bd6d=originateValidation[_0x1692('0xb')](_0x5eb05b['body']);if(_0x30bd6d[_0x1692('0x25')]>0x0){return _0x170884[_0x1692('0x17')](0x190)[_0x1692('0x2b')](_0x30bd6d);}var _0x2cc16f=_0x5eb05b[_0x1692('0x2a')][_0x1692('0x2c')];var _0x5d466e=_0x5eb05b[_0x1692('0x2a')][_0x1692('0x2d')];var _0x2fef78=_0x5eb05b[_0x1692('0x2a')][_0x1692('0x2e')];var _0x1dc18e=_0x5eb05b[_0x1692('0x2a')][_0x1692('0x2f')];return getAgent(_0x2cc16f)[_0x1692('0x1b')](function(_0x3fc4d0){logger[_0x1692('0x30')](_0x1692('0x31'),_0x3fc4d0[_0x1692('0x16')]);emit(util[_0x1692('0x32')]('user:%s',_0x3fc4d0[_0x1692('0x16')]),_0x1692('0x33'),{'callNumber':_0x5d466e,'callerId':_0x2fef78,'callbackUrl':_0x1dc18e});return _0x170884[_0x1692('0x17')](0xc8)['json']({'error':![],'message':_0x1692('0x34')});})[_0x1692('0x35')](handleError(_0x170884));};exports[_0x1692('0x36')]=function(_0x4f0116,_0x5260c6){logger['info'](_0x1692('0x37'),_0x4f0116[_0x1692('0x2a')]);var _0x1c8a42=hangupValidation[_0x1692('0xb')](_0x4f0116[_0x1692('0x2a')]);if(_0x1c8a42[_0x1692('0x25')]>0x0){return _0x5260c6[_0x1692('0x17')](0x190)[_0x1692('0x2b')](_0x1c8a42);}var _0x168ba7=_0x4f0116[_0x1692('0x2a')][_0x1692('0x2c')];var _0x1f113c=_0x4f0116['body'][_0x1692('0x24')];return getAgent(_0x168ba7)[_0x1692('0x1b')](function(_0xdb4303){logger['info'](_0x1692('0x31'),_0xdb4303[_0x1692('0x16')]);emit(util['format'](_0x1692('0x38'),_0xdb4303[_0x1692('0x16')]),_0x1692('0x39'),{'sessionId':_0x1f113c});return _0x5260c6['status'](0xc8)[_0x1692('0x2b')]({'error':![],'message':_0x1692('0x3a')});})[_0x1692('0x35')](handleError(_0x5260c6));};exports[_0x1692('0x3b')]=function(_0x193b6b,_0x2743c4){logger[_0x1692('0x30')](_0x1692('0x3c'),_0x193b6b[_0x1692('0x2a')]);var _0x45eec0=answerValidation[_0x1692('0xb')](_0x193b6b[_0x1692('0x2a')]);if(_0x45eec0[_0x1692('0x25')]>0x0){return _0x2743c4[_0x1692('0x17')](0x190)[_0x1692('0x2b')](_0x45eec0);}var _0x17c965=_0x193b6b[_0x1692('0x2a')][_0x1692('0x2c')];var _0x125396=_0x193b6b[_0x1692('0x2a')][_0x1692('0x24')];return getAgent(_0x17c965)[_0x1692('0x1b')](function(_0x3e40b3){logger['info'](_0x1692('0x31'),_0x3e40b3['name']);emit(util[_0x1692('0x32')](_0x1692('0x38'),_0x3e40b3[_0x1692('0x16')]),_0x1692('0x3d'),{'sessionId':_0x125396});return _0x2743c4['status'](0xc8)[_0x1692('0x2b')]({'error':![],'message':_0x1692('0x3e')});})[_0x1692('0x35')](handleError(_0x2743c4));};exports[_0x1692('0x3f')]=function(_0x3046f6,_0x41a1b4){logger[_0x1692('0x30')](_0x1692('0x40'),_0x3046f6[_0x1692('0x2a')]);var _0x6224a7=holdValidation['validate'](_0x3046f6['body']);if(_0x6224a7[_0x1692('0x25')]>0x0){return _0x41a1b4[_0x1692('0x17')](0x190)[_0x1692('0x2b')](_0x6224a7);}var _0x2521c5=_0x3046f6[_0x1692('0x2a')][_0x1692('0x2c')];var _0x4cb62b=_0x3046f6['body']['sessionId'];return getAgent(_0x2521c5)[_0x1692('0x1b')](function(_0xffbb6){logger[_0x1692('0x30')](_0x1692('0x31'),_0xffbb6[_0x1692('0x16')]);emit(util['format']('user:%s',_0xffbb6[_0x1692('0x16')]),'webbar:hold',{'sessionId':_0x4cb62b});return _0x41a1b4[_0x1692('0x17')](0xc8)[_0x1692('0x2b')]({'error':![],'message':'hold\x20executed!'});})[_0x1692('0x35')](handleError(_0x41a1b4));};exports[_0x1692('0x41')]=function(_0x302daa,_0x73e1b5){logger[_0x1692('0x30')](_0x1692('0x42'),_0x302daa[_0x1692('0x2a')]);var _0x243882=unholdValidation[_0x1692('0xb')](_0x302daa[_0x1692('0x2a')]);if(_0x243882[_0x1692('0x25')]>0x0){return _0x73e1b5[_0x1692('0x17')](0x190)['json'](_0x243882);}var _0x2bbddf=_0x302daa[_0x1692('0x2a')][_0x1692('0x2c')];var _0xa81da9=_0x302daa[_0x1692('0x2a')][_0x1692('0x24')];return getAgent(_0x2bbddf)['then'](function(_0x56ac1b){logger[_0x1692('0x30')](_0x1692('0x31'),_0x56ac1b['name']);emit(util[_0x1692('0x32')](_0x1692('0x38'),_0x56ac1b['name']),_0x1692('0x43'),{'sessionId':_0xa81da9});return _0x73e1b5[_0x1692('0x17')](0xc8)[_0x1692('0x2b')]({'error':![],'message':_0x1692('0x44')});})['catch'](handleError(_0x73e1b5));};exports[_0x1692('0x45')]=function(_0xf08614,_0x35771e){logger[_0x1692('0x30')](_0x1692('0x46'),_0x35771e[_0x1692('0x2a')]);var _0x4eec6a=callsValidation[_0x1692('0xb')](_0xf08614[_0x1692('0x2a')]);if(_0x4eec6a['length']>0x0){return _0x35771e[_0x1692('0x17')](0x190)['json'](_0x4eec6a);}var _0x13a73f=_0xf08614[_0x1692('0x2a')][_0x1692('0x2c')];var _0x5cd581=respondWithRpcPromise(_0x1692('0x47'));var _0x332952=getAgent(_0x13a73f);return Promise[_0x1692('0x21')]([_0x5cd581,_0x332952])[_0x1692('0x1b')](function(_0x59a9dd){var _0xae2489=_0x59a9dd[0x0];var _0x4b82db=_0x59a9dd[0x1];var _0xd1e4c1=_[_0x1692('0x48')](_0xae2489['rows'],function(_0x5b3013){return _0x5b3013[_0x1692('0x23')]==_0x4b82db['id'];});return _0x35771e[_0x1692('0x17')](0xc8)[_0x1692('0x2b')]({'count':_0xd1e4c1['length'],'rows':_0xd1e4c1});})[_0x1692('0x35')](handleError(_0x35771e));};exports[_0x1692('0x49')]=function(_0x5ac42f,_0x21ff8e){logger[_0x1692('0x30')]('conference\x20fired:',_0x5ac42f[_0x1692('0x2a')]);var _0x519c3a=conferenceValidation[_0x1692('0xb')](_0x5ac42f[_0x1692('0x2a')]);if(_0x519c3a[_0x1692('0x25')]>0x0){return _0x21ff8e[_0x1692('0x17')](0x190)[_0x1692('0x2b')](_0x519c3a);}var _0x15d5ee=_0x5ac42f[_0x1692('0x2a')][_0x1692('0x2c')];return getAgent(_0x15d5ee)[_0x1692('0x1b')](function(_0x4976ac){logger['info']('entityFound:',_0x4976ac['name']);emit(util[_0x1692('0x32')](_0x1692('0x38'),_0x4976ac[_0x1692('0x16')]),_0x1692('0x4a'));return _0x21ff8e['status'](0xc8)['json']({'error':![],'message':_0x1692('0x4b')});})[_0x1692('0x35')](handleError(_0x21ff8e));};exports[_0x1692('0x4c')]=function(_0x333158,_0x183ad){logger[_0x1692('0x30')](_0x1692('0x4d'),_0x333158['body']);var _0xd5cc0c=transferValidation['validate'](_0x333158[_0x1692('0x2a')]);if(_0xd5cc0c[_0x1692('0x25')]>0x0){return _0x183ad[_0x1692('0x17')](0x190)['json'](_0xd5cc0c);}var _0x4ce7d3=_0x333158['body'][_0x1692('0x2c')];var _0x4603ca=_0x333158[_0x1692('0x2a')]['sessionId'];var _0x3a4b0a=_0x333158[_0x1692('0x2a')][_0x1692('0x4e')];return getAgent(_0x4ce7d3)[_0x1692('0x1b')](function(_0x36dd89){logger[_0x1692('0x30')](_0x1692('0x31'),_0x36dd89[_0x1692('0x16')]);emit(util[_0x1692('0x32')](_0x1692('0x38'),_0x36dd89[_0x1692('0x16')]),'webbar:transfer',{'sessionId':_0x4603ca,'transferNumber':_0x3a4b0a});return _0x183ad[_0x1692('0x17')](0xc8)[_0x1692('0x2b')]({'error':![],'message':_0x1692('0x4f')});})[_0x1692('0x35')](handleError(_0x183ad));}; \ No newline at end of file +var _0xfa2b=['send','NotFound','request','result','catch','User','agent','then','filter','UserId','sessionId','sessionId\x20','\x20not\x20found!','originate','originate\x20fired:','body','validate','length','callNumber','callerId','callbackUrl','entityFound:','format','user:%s','webbar:originate','originate\x20executed!','hangup','json','userId','webbar:hangup','hangup\x20executed!','answer','answer\x20fired:','webbar:answer','answer\x20executed!','hold','hold\x20fired:','hold\x20executed!','unhold\x20executed!','calls\x20fired:','VoiceChannels','all','rows','conference','conference\x20fired:','conference\x20executed!','transfer\x20fired:','transferNumber','transfer\x20executed!','path','lodash','../../mysqldb','../../config/environment','util','bluebird','jayson/promise','client','http','../../config/logger','webbarapi','ioredis','redis','defaults','localhost','number','userId\x20is\x20required','string','callNumber\x20is\x20required','sessionId\x20is\x20required','transferNumber\x20is\x20required','info','stringify','log','handleError:','error','stack','name','status'];(function(_0x263ffd,_0x140cf8){var _0x2b3b8b=function(_0x36331e){while(--_0x36331e){_0x263ffd['push'](_0x263ffd['shift']());}};_0x2b3b8b(++_0x140cf8);}(_0xfa2b,0x1b7));var _0xbfa2=function(_0x1ce0e5,_0x5a47eb){_0x1ce0e5=_0x1ce0e5-0x0;var _0x8ec090=_0xfa2b[_0x1ce0e5];return _0x8ec090;};'use strict';var path=require(_0xbfa2('0x0'));var fs=require('fs');var _=require(_0xbfa2('0x1'));var db=require(_0xbfa2('0x2'))['db'];var config=require(_0xbfa2('0x3'));var util=require(_0xbfa2('0x4'));var BPromise=require(_0xbfa2('0x5'));var jayson=require(_0xbfa2('0x6'));var amiClient=jayson[_0xbfa2('0x7')][_0xbfa2('0x8')]({'port':0x232a});var logger=require(_0xbfa2('0x9'))(_0xbfa2('0xa'));var Redis=require(_0xbfa2('0xb'));config[_0xbfa2('0xc')]=_[_0xbfa2('0xd')](config[_0xbfa2('0xc')],{'host':_0xbfa2('0xe'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xbfa2('0xc')]));var Schema=require('validate');var originateValidation=new Schema({'userId':{'type':_0xbfa2('0xf'),'required':[!![],_0xbfa2('0x10')]},'callNumber':{'type':_0xbfa2('0x11'),'required':[!![],_0xbfa2('0x12')]},'callerId':{'type':_0xbfa2('0x11')},'callbackUrl':{'type':_0xbfa2('0x11')}});var hangupValidation=new Schema({'userId':{'type':_0xbfa2('0xf'),'required':[!![],_0xbfa2('0x10')]},'sessionId':{'type':_0xbfa2('0x11'),'required':![]}});var answerValidation=new Schema({'userId':{'type':'number','required':[!![],'userId\x20is\x20required']},'sessionId':{'type':'string','required':![]}});var transferValidation=new Schema({'userId':{'type':_0xbfa2('0xf'),'required':[!![],_0xbfa2('0x10')]},'sessionId':{'type':_0xbfa2('0x11'),'required':[!![],_0xbfa2('0x13')]},'transferNumber':{'type':_0xbfa2('0x11'),'required':[!![],_0xbfa2('0x14')]}});var holdValidation=new Schema({'userId':{'type':'number','required':[!![],_0xbfa2('0x10')]},'sessionId':{'type':_0xbfa2('0x11'),'required':![]}});var unholdValidation=new Schema({'userId':{'type':_0xbfa2('0xf'),'required':[!![],_0xbfa2('0x10')]},'sessionId':{'type':_0xbfa2('0x11'),'required':![]}});var callsValidation=new Schema({'userId':{'type':'number','required':[!![],_0xbfa2('0x10')]}});var conferenceValidation=new Schema({'userId':{'type':'number','required':[!![],'userId\x20is\x20required']}});function emit(_0xee34b8,_0x55c9fe,_0x560190){logger[_0xbfa2('0x15')](_0xee34b8,_0x55c9fe,JSON[_0xbfa2('0x16')](_0x560190));io['to'](_0xee34b8)['emit'](_0x55c9fe,_0x560190);}function handleError(_0xb9b6a3){return function(_0x12627a){console[_0xbfa2('0x17')](_0xbfa2('0x18'),_0x12627a,_0x12627a instanceof RangeError);logger[_0xbfa2('0x19')](_0x12627a[_0xbfa2('0x1a')]);if(_0x12627a instanceof RangeError){if(_0x12627a[_0xbfa2('0x1b')]){delete _0x12627a['name'];}_0xb9b6a3[_0xbfa2('0x1c')](0x194)[_0xbfa2('0x1d')](_0x12627a);}else{if(_0x12627a[_0xbfa2('0x1b')]){delete _0x12627a['name'];}_0xb9b6a3[_0xbfa2('0x1c')](0x1f4)[_0xbfa2('0x1d')](_0x12627a);}};}function checkError(){return function(_0x4a14a4){if(!_0x4a14a4){throw new RangeError(_0xbfa2('0x1e'));}return _0x4a14a4;};}function respondWithRpcPromise(_0x5278d8,_0x50d9df){return new BPromise(function(_0xc42b51,_0xdb059b){var _0x1ec19f=amiClient;return _0x1ec19f[_0xbfa2('0x1f')](_0x5278d8,_0x50d9df)['then'](function(_0x5bb514){if(_0x5bb514[_0xbfa2('0x19')]){if(_0x5bb514[_0xbfa2('0x19')]['code']===0x1f4){return _0xdb059b(_0x5bb514[_0xbfa2('0x19')]['message']);}return _0xc42b51(_0x5bb514[_0xbfa2('0x19')]['message']);}else{_0xc42b51(_0x5bb514[_0xbfa2('0x20')]);}})[_0xbfa2('0x21')](function(_0x8488e1){_0xdb059b(_0x8488e1);});});}function getAgent(_0x38c5dc){return db[_0xbfa2('0x22')]['findOne']({'where':{'id':_0x38c5dc,'role':_0xbfa2('0x23')}})[_0xbfa2('0x24')](checkError());}function getAgentCheckSession(_0x4f782b,_0x37ec27){return new BPromise(function(_0x14f142,_0x4ccdb5){var _0x2cbc51=respondWithRpcPromise('VoiceChannels');var _0x16bc84=getAgent(_0x4f782b);Promise['all']([_0x2cbc51,_0x16bc84])[_0xbfa2('0x24')](function(_0x596e72){var _0x37ca3a=_0x596e72[0x0];var _0x33e5af=_0x596e72[0x1];var _0x49d563=_[_0xbfa2('0x25')](_0x37ca3a['rows'],function(_0xb95429){return _0xb95429[_0xbfa2('0x26')]==_0x33e5af['id']&&_0xb95429[_0xbfa2('0x27')]==_0x37ec27;});if(_0x49d563['length']==0x1){_0x14f142(_0x33e5af);}else{_0x4ccdb5(new RangeError(_0xbfa2('0x28')+_0x37ec27+_0xbfa2('0x29')));}});});}exports[_0xbfa2('0x2a')]=function(_0x5db6ae,_0x47fd5a){logger['info'](_0xbfa2('0x2b'),_0x5db6ae[_0xbfa2('0x2c')]);var _0x55e318=originateValidation[_0xbfa2('0x2d')](_0x5db6ae[_0xbfa2('0x2c')]);if(_0x55e318[_0xbfa2('0x2e')]>0x0){return _0x47fd5a[_0xbfa2('0x1c')](0x190)['json'](_0x55e318);}var _0x2d20fe=_0x5db6ae[_0xbfa2('0x2c')]['userId'];var _0x63ed08=_0x5db6ae[_0xbfa2('0x2c')][_0xbfa2('0x2f')];var _0xa8eac2=_0x5db6ae[_0xbfa2('0x2c')][_0xbfa2('0x30')];var _0x151855=_0x5db6ae[_0xbfa2('0x2c')][_0xbfa2('0x31')];return getAgent(_0x2d20fe)['then'](function(_0x79c2bd){logger['info'](_0xbfa2('0x32'),_0x79c2bd['name']);emit(util[_0xbfa2('0x33')](_0xbfa2('0x34'),_0x79c2bd[_0xbfa2('0x1b')]),_0xbfa2('0x35'),{'callNumber':_0x63ed08,'callerId':_0xa8eac2,'callbackUrl':_0x151855});return _0x47fd5a[_0xbfa2('0x1c')](0xc8)['json']({'error':![],'message':_0xbfa2('0x36')});})[_0xbfa2('0x21')](handleError(_0x47fd5a));};exports[_0xbfa2('0x37')]=function(_0xf53cdb,_0xa6f846){logger['info']('hangup\x20fired:',_0xf53cdb[_0xbfa2('0x2c')]);var _0x1558a7=hangupValidation[_0xbfa2('0x2d')](_0xf53cdb['body']);if(_0x1558a7['length']>0x0){return _0xa6f846[_0xbfa2('0x1c')](0x190)[_0xbfa2('0x38')](_0x1558a7);}var _0x5f2257=_0xf53cdb['body'][_0xbfa2('0x39')];var _0x1fd877=_0xf53cdb['body'][_0xbfa2('0x27')];return getAgent(_0x5f2257)[_0xbfa2('0x24')](function(_0x2a541a){logger[_0xbfa2('0x15')](_0xbfa2('0x32'),_0x2a541a[_0xbfa2('0x1b')]);emit(util[_0xbfa2('0x33')](_0xbfa2('0x34'),_0x2a541a[_0xbfa2('0x1b')]),_0xbfa2('0x3a'),{'sessionId':_0x1fd877});return _0xa6f846[_0xbfa2('0x1c')](0xc8)[_0xbfa2('0x38')]({'error':![],'message':_0xbfa2('0x3b')});})[_0xbfa2('0x21')](handleError(_0xa6f846));};exports[_0xbfa2('0x3c')]=function(_0xd6f2e7,_0x3f57df){logger['info'](_0xbfa2('0x3d'),_0xd6f2e7[_0xbfa2('0x2c')]);var _0x157a0a=answerValidation[_0xbfa2('0x2d')](_0xd6f2e7[_0xbfa2('0x2c')]);if(_0x157a0a[_0xbfa2('0x2e')]>0x0){return _0x3f57df['status'](0x190)[_0xbfa2('0x38')](_0x157a0a);}var _0x49c967=_0xd6f2e7[_0xbfa2('0x2c')][_0xbfa2('0x39')];var _0x56a917=_0xd6f2e7[_0xbfa2('0x2c')][_0xbfa2('0x27')];return getAgent(_0x49c967)[_0xbfa2('0x24')](function(_0x14669c){logger[_0xbfa2('0x15')]('entityFound:',_0x14669c[_0xbfa2('0x1b')]);emit(util[_0xbfa2('0x33')](_0xbfa2('0x34'),_0x14669c[_0xbfa2('0x1b')]),_0xbfa2('0x3e'),{'sessionId':_0x56a917});return _0x3f57df[_0xbfa2('0x1c')](0xc8)[_0xbfa2('0x38')]({'error':![],'message':_0xbfa2('0x3f')});})['catch'](handleError(_0x3f57df));};exports[_0xbfa2('0x40')]=function(_0xba5a16,_0x4ede82){logger[_0xbfa2('0x15')](_0xbfa2('0x41'),_0xba5a16[_0xbfa2('0x2c')]);var _0x3879ac=holdValidation[_0xbfa2('0x2d')](_0xba5a16[_0xbfa2('0x2c')]);if(_0x3879ac[_0xbfa2('0x2e')]>0x0){return _0x4ede82[_0xbfa2('0x1c')](0x190)[_0xbfa2('0x38')](_0x3879ac);}var _0x59d61b=_0xba5a16[_0xbfa2('0x2c')][_0xbfa2('0x39')];var _0x109aaa=_0xba5a16['body']['sessionId'];return getAgent(_0x59d61b)[_0xbfa2('0x24')](function(_0x51fd07){logger[_0xbfa2('0x15')](_0xbfa2('0x32'),_0x51fd07['name']);emit(util[_0xbfa2('0x33')](_0xbfa2('0x34'),_0x51fd07[_0xbfa2('0x1b')]),'webbar:hold',{'sessionId':_0x109aaa});return _0x4ede82[_0xbfa2('0x1c')](0xc8)['json']({'error':![],'message':_0xbfa2('0x42')});})[_0xbfa2('0x21')](handleError(_0x4ede82));};exports['unhold']=function(_0x3f8e7c,_0x59dc56){logger[_0xbfa2('0x15')]('unhold\x20fired:',_0x3f8e7c[_0xbfa2('0x2c')]);var _0x78bc3b=unholdValidation[_0xbfa2('0x2d')](_0x3f8e7c[_0xbfa2('0x2c')]);if(_0x78bc3b[_0xbfa2('0x2e')]>0x0){return _0x59dc56['status'](0x190)['json'](_0x78bc3b);}var _0x4f1d75=_0x3f8e7c[_0xbfa2('0x2c')][_0xbfa2('0x39')];var _0x221f5a=_0x3f8e7c['body'][_0xbfa2('0x27')];return getAgent(_0x4f1d75)[_0xbfa2('0x24')](function(_0x5d24c1){logger[_0xbfa2('0x15')](_0xbfa2('0x32'),_0x5d24c1['name']);emit(util[_0xbfa2('0x33')](_0xbfa2('0x34'),_0x5d24c1['name']),'webbar:unhold',{'sessionId':_0x221f5a});return _0x59dc56[_0xbfa2('0x1c')](0xc8)['json']({'error':![],'message':_0xbfa2('0x43')});})[_0xbfa2('0x21')](handleError(_0x59dc56));};exports['calls']=function(_0x3b4a49,_0x455fe0){logger[_0xbfa2('0x15')](_0xbfa2('0x44'),_0x455fe0[_0xbfa2('0x2c')]);var _0x28d7c5=callsValidation[_0xbfa2('0x2d')](_0x3b4a49[_0xbfa2('0x2c')]);if(_0x28d7c5[_0xbfa2('0x2e')]>0x0){return _0x455fe0[_0xbfa2('0x1c')](0x190)[_0xbfa2('0x38')](_0x28d7c5);}var _0x229e2a=_0x3b4a49[_0xbfa2('0x2c')][_0xbfa2('0x39')];var _0x4ad53e=respondWithRpcPromise(_0xbfa2('0x45'));var _0x4e43c7=getAgent(_0x229e2a);return Promise[_0xbfa2('0x46')]([_0x4ad53e,_0x4e43c7])[_0xbfa2('0x24')](function(_0x2ec15b){var _0x3885db=_0x2ec15b[0x0];var _0x459451=_0x2ec15b[0x1];var _0x2b05b5=_[_0xbfa2('0x25')](_0x3885db[_0xbfa2('0x47')],function(_0x41749d){return _0x41749d[_0xbfa2('0x26')]==_0x459451['id'];});return _0x455fe0[_0xbfa2('0x1c')](0xc8)['json']({'count':_0x2b05b5[_0xbfa2('0x2e')],'rows':_0x2b05b5});})[_0xbfa2('0x21')](handleError(_0x455fe0));};exports[_0xbfa2('0x48')]=function(_0x26ff5e,_0x56dcc0){logger[_0xbfa2('0x15')](_0xbfa2('0x49'),_0x26ff5e[_0xbfa2('0x2c')]);var _0xd26622=conferenceValidation[_0xbfa2('0x2d')](_0x26ff5e['body']);if(_0xd26622[_0xbfa2('0x2e')]>0x0){return _0x56dcc0[_0xbfa2('0x1c')](0x190)[_0xbfa2('0x38')](_0xd26622);}var _0x2b6617=_0x26ff5e[_0xbfa2('0x2c')][_0xbfa2('0x39')];return getAgent(_0x2b6617)['then'](function(_0x31cc63){logger[_0xbfa2('0x15')](_0xbfa2('0x32'),_0x31cc63[_0xbfa2('0x1b')]);emit(util[_0xbfa2('0x33')]('user:%s',_0x31cc63[_0xbfa2('0x1b')]),'webbar:conference');return _0x56dcc0[_0xbfa2('0x1c')](0xc8)[_0xbfa2('0x38')]({'error':![],'message':_0xbfa2('0x4a')});})[_0xbfa2('0x21')](handleError(_0x56dcc0));};exports['transfer']=function(_0x4d38fc,_0x31a579){logger[_0xbfa2('0x15')](_0xbfa2('0x4b'),_0x4d38fc['body']);var _0x1ab345=transferValidation[_0xbfa2('0x2d')](_0x4d38fc[_0xbfa2('0x2c')]);if(_0x1ab345[_0xbfa2('0x2e')]>0x0){return _0x31a579['status'](0x190)[_0xbfa2('0x38')](_0x1ab345);}var _0x4350b9=_0x4d38fc['body'][_0xbfa2('0x39')];var _0x217ca5=_0x4d38fc[_0xbfa2('0x2c')][_0xbfa2('0x27')];var _0x57239c=_0x4d38fc['body'][_0xbfa2('0x4c')];return getAgent(_0x4350b9)[_0xbfa2('0x24')](function(_0x8de0a6){logger[_0xbfa2('0x15')](_0xbfa2('0x32'),_0x8de0a6['name']);emit(util[_0xbfa2('0x33')](_0xbfa2('0x34'),_0x8de0a6[_0xbfa2('0x1b')]),'webbar:transfer',{'sessionId':_0x217ca5,'transferNumber':_0x57239c});return _0x31a579[_0xbfa2('0x1c')](0xc8)[_0xbfa2('0x38')]({'error':![],'message':_0xbfa2('0x4d')});})[_0xbfa2('0x21')](handleError(_0x31a579));}; \ No newline at end of file diff --git a/server/api/whatsappAccount/index.js b/server/api/whatsappAccount/index.js index 7caf56a..78f1782 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 _0xacf4=['./whatsappAccount.controller','get','index','/describe','isAuthenticated','describe','/:id/dispositions','/:id/canned_answers','getAgents','/:id/applications','getApplications','post','create','addAnswer','addAgents','addApplications','/:id/notify','notify','/:id/send','send','put','/:id','delete','destroy','removeDispositions','removeAnswers','removeAgents','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x13d5dd,_0x3aee51){var _0x3b9ade=function(_0x13259e){while(--_0x13259e){_0x13d5dd['push'](_0x13d5dd['shift']());}};_0x3b9ade(++_0x3aee51);}(_0xacf4,0xe7));var _0x4acf=function(_0x292d5b,_0x509862){_0x292d5b=_0x292d5b-0x0;var _0x4a7849=_0xacf4[_0x292d5b];return _0x4a7849;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x4acf('0x0'));var timeout=require(_0x4acf('0x1'));var express=require(_0x4acf('0x2'));var router=express[_0x4acf('0x3')]();var fs_extra=require(_0x4acf('0x4'));var auth=require(_0x4acf('0x5'));var interaction=require(_0x4acf('0x6'));var config=require('../../config/environment');var controller=require(_0x4acf('0x7'));router[_0x4acf('0x8')]('/',auth['isAuthenticated'](),controller[_0x4acf('0x9')]);router[_0x4acf('0x8')](_0x4acf('0xa'),auth[_0x4acf('0xb')](),controller[_0x4acf('0xc')]);router['get']('/:id',auth[_0x4acf('0xb')](),controller['show']);router[_0x4acf('0x8')](_0x4acf('0xd'),auth[_0x4acf('0xb')](),controller['getDispositions']);router[_0x4acf('0x8')](_0x4acf('0xe'),auth['isAuthenticated'](),controller['getAnswers']);router[_0x4acf('0x8')]('/:id/users',auth['isAuthenticated'](),controller[_0x4acf('0xf')]);router[_0x4acf('0x8')](_0x4acf('0x10'),auth[_0x4acf('0xb')](),controller[_0x4acf('0x11')]);router[_0x4acf('0x12')]('/',auth[_0x4acf('0xb')](),controller[_0x4acf('0x13')]);router[_0x4acf('0x12')](_0x4acf('0xd'),auth[_0x4acf('0xb')](),controller['addDisposition']);router[_0x4acf('0x12')]('/:id/canned_answers',auth[_0x4acf('0xb')](),controller[_0x4acf('0x14')]);router[_0x4acf('0x12')]('/:id/users',auth['isAuthenticated'](),controller[_0x4acf('0x15')]);router[_0x4acf('0x12')](_0x4acf('0x10'),auth['isAuthenticated'](),controller[_0x4acf('0x16')]);router[_0x4acf('0x12')](_0x4acf('0x17'),controller[_0x4acf('0x18')]);router[_0x4acf('0x12')](_0x4acf('0x19'),auth[_0x4acf('0xb')](),controller[_0x4acf('0x1a')]);router[_0x4acf('0x1b')](_0x4acf('0x1c'),auth[_0x4acf('0xb')](),controller['update']);router[_0x4acf('0x1d')](_0x4acf('0x1c'),auth['isAuthenticated'](),controller[_0x4acf('0x1e')]);router[_0x4acf('0x1d')]('/:id/dispositions',auth[_0x4acf('0xb')](),controller[_0x4acf('0x1f')]);router[_0x4acf('0x1d')](_0x4acf('0xe'),auth['isAuthenticated'](),controller[_0x4acf('0x20')]);router[_0x4acf('0x1d')]('/:id/users',auth[_0x4acf('0xb')](),controller[_0x4acf('0x21')]);module['exports']=router; \ No newline at end of file +var _0xda2d=['/:id','removeDispositions','removeAnswers','/:id/users','removeAgents','exports','util','path','connect-timeout','express','Router','../../config/environment','./whatsappAccount.controller','get','isAuthenticated','index','/describe','describe','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/applications','getApplications','post','create','addDisposition','addAnswer','addApplications','/:id/notify','notify','/:id/send','send','put','delete'];(function(_0x1d5b3f,_0x14fbc9){var _0x3b079b=function(_0x2e580e){while(--_0x2e580e){_0x1d5b3f['push'](_0x1d5b3f['shift']());}};_0x3b079b(++_0x14fbc9);}(_0xda2d,0x102));var _0xdda2=function(_0x30c6b3,_0x56316e){_0x30c6b3=_0x30c6b3-0x0;var _0x42052d=_0xda2d[_0x30c6b3];return _0x42052d;};'use strict';var multer=require('multer');var util=require(_0xdda2('0x0'));var path=require(_0xdda2('0x1'));var timeout=require(_0xdda2('0x2'));var express=require(_0xdda2('0x3'));var router=express[_0xdda2('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xdda2('0x5'));var controller=require(_0xdda2('0x6'));router[_0xdda2('0x7')]('/',auth[_0xdda2('0x8')](),controller[_0xdda2('0x9')]);router[_0xdda2('0x7')](_0xdda2('0xa'),auth[_0xdda2('0x8')](),controller[_0xdda2('0xb')]);router[_0xdda2('0x7')]('/:id',auth[_0xdda2('0x8')](),controller[_0xdda2('0xc')]);router['get'](_0xdda2('0xd'),auth[_0xdda2('0x8')](),controller[_0xdda2('0xe')]);router[_0xdda2('0x7')](_0xdda2('0xf'),auth[_0xdda2('0x8')](),controller[_0xdda2('0x10')]);router[_0xdda2('0x7')]('/:id/users',auth['isAuthenticated'](),controller['getAgents']);router[_0xdda2('0x7')](_0xdda2('0x11'),auth[_0xdda2('0x8')](),controller[_0xdda2('0x12')]);router[_0xdda2('0x13')]('/',auth[_0xdda2('0x8')](),controller[_0xdda2('0x14')]);router['post'](_0xdda2('0xd'),auth['isAuthenticated'](),controller[_0xdda2('0x15')]);router[_0xdda2('0x13')](_0xdda2('0xf'),auth[_0xdda2('0x8')](),controller[_0xdda2('0x16')]);router['post']('/:id/users',auth[_0xdda2('0x8')](),controller['addAgents']);router[_0xdda2('0x13')](_0xdda2('0x11'),auth[_0xdda2('0x8')](),controller[_0xdda2('0x17')]);router[_0xdda2('0x13')](_0xdda2('0x18'),controller[_0xdda2('0x19')]);router[_0xdda2('0x13')](_0xdda2('0x1a'),auth[_0xdda2('0x8')](),controller[_0xdda2('0x1b')]);router[_0xdda2('0x1c')]('/:id',auth[_0xdda2('0x8')](),controller['update']);router[_0xdda2('0x1d')](_0xdda2('0x1e'),auth[_0xdda2('0x8')](),controller['destroy']);router[_0xdda2('0x1d')]('/:id/dispositions',auth[_0xdda2('0x8')](),controller[_0xdda2('0x1f')]);router['delete'](_0xdda2('0xf'),auth[_0xdda2('0x8')](),controller[_0xdda2('0x20')]);router[_0xdda2('0x1d')](_0xdda2('0x21'),auth['isAuthenticated'](),controller[_0xdda2('0x22')]);module[_0xdda2('0x23')]=router; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.attributes.js b/server/api/whatsappAccount/whatsappAccount.attributes.js index a9ffc82..a814fb7 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 _0x3c98=['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','ENUM','twilio','TEXT'];(function(_0x57c2ac,_0x16ad1){var _0x33a620=function(_0x3a6cb8){while(--_0x3a6cb8){_0x57c2ac['push'](_0x57c2ac['shift']());}};_0x33a620(++_0x16ad1);}(_0x3c98,0x1cd));var _0x83c9=function(_0x38c110,_0x428d5c){_0x38c110=_0x38c110-0x0;var _0x536ce5=_0x3c98[_0x38c110];return _0x536ce5;};'use strict';var Sequelize=require(_0x83c9('0x0'));var rs=require(_0x83c9('0x1'));module['exports']={'name':{'type':Sequelize[_0x83c9('0x2')],'unique':_0x83c9('0x3'),'allowNull':![]},'key':{'type':Sequelize['STRING'],'allowNull':![]},'remote':{'type':Sequelize[_0x83c9('0x2')],'allowNull':![]},'token':{'type':Sequelize[_0x83c9('0x2')],'defaultValue':function(){return rs['generate']();}},'phone':{'type':Sequelize[_0x83c9('0x2')]},'type':{'type':Sequelize[_0x83c9('0x4')](_0x83c9('0x5'))},'accountSid':{'type':Sequelize[_0x83c9('0x2')]},'authToken':{'type':Sequelize[_0x83c9('0x2')]},'notificationTemplate':{'type':Sequelize[_0x83c9('0x6')],'defaultValue':function(){return _0x83c9('0x7');}},'notificationSound':{'type':Sequelize[_0x83c9('0x8')],'defaultValue':![]},'notificationShake':{'type':Sequelize[_0x83c9('0x8')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x83c9('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x83c9('0x8')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x83c9('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x83c9('0x8')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':_0x83c9('0xa')},'mandatoryDisposition':{'type':Sequelize[_0x83c9('0x8')],'defaultValue':![],'comment':_0x83c9('0xb'),'set':function(_0x5db5bb){if(!_0x5db5bb){this['setDataValue']('mandatoryDispositionPauseId',null);}this[_0x83c9('0xc')]('mandatoryDisposition',_0x5db5bb);}},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xb59f=['setDataValue','mandatoryDisposition','sequelize','randomstring','exports','name','STRING','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','mandatoryDispositionPauseId'];(function(_0x22fee5,_0x3b0609){var _0x3b96f3=function(_0x386de6){while(--_0x386de6){_0x22fee5['push'](_0x22fee5['shift']());}};_0x3b96f3(++_0x3b0609);}(_0xb59f,0x110));var _0xfb59=function(_0x3a7a35,_0x410944){_0x3a7a35=_0x3a7a35-0x0;var _0x588fd0=_0xb59f[_0x3a7a35];return _0x588fd0;};'use strict';var Sequelize=require(_0xfb59('0x0'));var rs=require(_0xfb59('0x1'));module[_0xfb59('0x2')]={'name':{'type':Sequelize['STRING'],'unique':_0xfb59('0x3'),'allowNull':![]},'key':{'type':Sequelize[_0xfb59('0x4')],'allowNull':![]},'remote':{'type':Sequelize[_0xfb59('0x4')],'allowNull':![]},'token':{'type':Sequelize[_0xfb59('0x4')],'defaultValue':function(){return rs['generate']();}},'phone':{'type':Sequelize[_0xfb59('0x4')]},'type':{'type':Sequelize[_0xfb59('0x5')]('twilio')},'accountSid':{'type':Sequelize[_0xfb59('0x4')]},'authToken':{'type':Sequelize[_0xfb59('0x4')]},'notificationTemplate':{'type':Sequelize[_0xfb59('0x6')],'defaultValue':function(){return _0xfb59('0x7');}},'notificationSound':{'type':Sequelize[_0xfb59('0x8')],'defaultValue':![]},'notificationShake':{'type':Sequelize[_0xfb59('0x8')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xfb59('0x8')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xfb59('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xfb59('0x8')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xfb59('0x9')],'comment':_0xfb59('0xa')},'mandatoryDisposition':{'type':Sequelize[_0xfb59('0x8')],'defaultValue':![],'comment':_0xfb59('0xb'),'set':function(_0x4b31ad){if(!_0x4b31ad){this['setDataValue'](_0xfb59('0xc'),null);}this[_0xfb59('0xd')](_0xfb59('0xe'),_0x4b31ad);}},'description':{'type':Sequelize[_0xfb59('0x4')]}}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.controller.js b/server/api/whatsappAccount/whatsappAccount.controller.js index 29e7c37..11cae3c 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 _0xeb7a=['UserProfileResource','destroy','sendStatus','stack','send','index','Pause','mandatoryDispositionPause','map','WhatsappAccount','rawAttributes','fieldName','type','key','query','filters','attributes','model','fields','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','include','findAll','rows','intersection','includeAll','find','create','body','user','get','role','WhatsappAccounts','UserProfileSection','name','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','describe','addDisposition','Disposition','getDispositions','findOne','keys','length','options','removeDispositions','ids','addAnswer','WhatsappAccountId','CannedAnswer','getAnswers','removeAnswers','addAgents','spread','emit','userWhatsappAccount:save','removeAgents','userWhatsappAccount:remove','User','getAgents','sequelize','transaction','WhatsappApplication','priority','getApplications','whatsapp','Applications','account','orderBy','CmContact','ValidationError','createdAt','updatedAt','CompanyId','mobile','From','replace','messageId','MessageSid','isNil','from','from\x20is\x20mandatory','mapKey','Sequelize','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','DESC','omit','Contacts','WhatsappInteraction','interaction','created','autoclose','applications','push','*,*,*,*','AttachmentId','UserId','unshift','agent','waitForTheAssignedAgent','startRouting','Start','receiveMessage','entity\x20found','WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s','twilio','Content-Type','text/xml','\x0a','body\x20is\x20mandatory\x20and\x20not\x20empty','List','out','WhatsappMessage','Messages','dataValues','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','register','jayson/promise','client','http','then','info','WhatsappAccount,\x20%s,\x20%s','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','end','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save'];(function(_0x4fab0f,_0x57113e){var _0x2469f3=function(_0x25e6b5){while(--_0x25e6b5){_0x4fab0f['push'](_0x4fab0f['shift']());}};_0x2469f3(++_0x57113e);}(_0xeb7a,0x1ec));var _0xaeb7=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xeb7a[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xaeb7('0x0'));var jsonpatch=require(_0xaeb7('0x1'));var rp=require(_0xaeb7('0x2'));var moment=require(_0xaeb7('0x3'));var BPromise=require(_0xaeb7('0x4'));var Mustache=require(_0xaeb7('0x5'));var util=require(_0xaeb7('0x6'));var path=require(_0xaeb7('0x7'));var sox=require(_0xaeb7('0x8'));var csv=require(_0xaeb7('0x9'));var ejs=require(_0xaeb7('0xa'));var fs=require('fs');var fs_extra=require(_0xaeb7('0xb'));var _=require(_0xaeb7('0xc'));var squel=require(_0xaeb7('0xd'));var crypto=require(_0xaeb7('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xaeb7('0xf'));var toCsv=require(_0xaeb7('0x9'));var querystring=require(_0xaeb7('0x10'));var Papa=require(_0xaeb7('0x11'));var Redis=require(_0xaeb7('0x12'));var authService=require(_0xaeb7('0x13'));var qs=require(_0xaeb7('0x14'));var as=require(_0xaeb7('0x15'));var hardwareService=require(_0xaeb7('0x16'));var logger=require(_0xaeb7('0x17'))(_0xaeb7('0x18'));var utils=require(_0xaeb7('0x19'));var config=require(_0xaeb7('0x1a'));var licenseUtil=require(_0xaeb7('0x1b'));var db=require(_0xaeb7('0x1c'))['db'];config['redis']=_[_0xaeb7('0x1d')](config[_0xaeb7('0x1e')],{'host':_0xaeb7('0x1f'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xaeb7('0x1e')]));require('./whatsappAccount.socket')[_0xaeb7('0x20')](socket);var jayson=require(_0xaeb7('0x21'));var client=jayson[_0xaeb7('0x22')][_0xaeb7('0x23')]({'port':0x232c});function respondWithRpcPromise(_0x29cfdd,_0xf93524,_0x27fd32,_0x29af7c){return new BPromise(function(_0x400a3b,_0x34d2da){var _0x561cf2=_0x29af7c||client;return _0x561cf2['request'](_0x29cfdd,_0x27fd32)[_0xaeb7('0x24')](function(_0x3db63b){logger[_0xaeb7('0x25')](_0xaeb7('0x26'),_0xf93524,'request\x20sent');logger[_0xaeb7('0x27')](_0xaeb7('0x28'),_0xf93524,_0xaeb7('0x29'),JSON[_0xaeb7('0x2a')](_0x3db63b));if(_0x3db63b[_0xaeb7('0x2b')]){if(_0x3db63b['error'][_0xaeb7('0x2c')]===0x1f4){logger[_0xaeb7('0x2b')]('WhatsappAccount,\x20%s,\x20%s',_0xf93524,_0x3db63b[_0xaeb7('0x2b')][_0xaeb7('0x2d')]);return _0x34d2da(_0x3db63b['error'][_0xaeb7('0x2d')]);}logger[_0xaeb7('0x2b')](_0xaeb7('0x26'),_0xf93524,_0x3db63b[_0xaeb7('0x2b')]['message']);return _0x400a3b(_0x3db63b[_0xaeb7('0x2b')][_0xaeb7('0x2d')]);}else{logger[_0xaeb7('0x25')](_0xaeb7('0x26'),_0xf93524,'request\x20sent');_0x400a3b(_0x3db63b[_0xaeb7('0x2e')][_0xaeb7('0x2d')]);}})[_0xaeb7('0x2f')](function(_0x4ca9d2){logger[_0xaeb7('0x2b')](_0xaeb7('0x26'),_0xf93524,_0x4ca9d2);_0x34d2da(_0x4ca9d2);});});}function respondWithStatusCode(_0x1cf9ef,_0x186b60){_0x186b60=_0x186b60||0xcc;return function(_0x4e577c){if(_0x4e577c){return _0x1cf9ef['sendStatus'](_0x186b60);}return _0x1cf9ef['status'](_0x186b60)[_0xaeb7('0x30')]();};}function respondWithResult(_0x3dc404,_0x5a8996){_0x5a8996=_0x5a8996||0xc8;return function(_0x46a6b5){if(_0x46a6b5){return _0x3dc404[_0xaeb7('0x31')](_0x5a8996)['json'](_0x46a6b5);}};}function respondWithFilteredResult(_0x582124,_0xe8d5a4){return function(_0x53261e){if(_0x53261e){var _0x423960=typeof _0xe8d5a4[_0xaeb7('0x32')]===_0xaeb7('0x33')&&typeof _0xe8d5a4[_0xaeb7('0x34')]===_0xaeb7('0x33');var _0x5e717b=_0x53261e[_0xaeb7('0x35')];var _0x576b9a=_0x423960?0x0:_0xe8d5a4[_0xaeb7('0x32')];var _0x47780e=_0x423960?_0x53261e['count']:_0xe8d5a4['offset']+_0xe8d5a4[_0xaeb7('0x34')];var _0x384b4b;if(_0x47780e>=_0x5e717b){_0x47780e=_0x5e717b;_0x384b4b=0xc8;}else{_0x384b4b=0xce;}_0x582124[_0xaeb7('0x31')](_0x384b4b);return _0x582124[_0xaeb7('0x36')](_0xaeb7('0x37'),_0x576b9a+'-'+_0x47780e+'/'+_0x5e717b)[_0xaeb7('0x38')](_0x53261e);}return null;};}function patchUpdates(_0x4b161a){return function(_0x1c709b){try{jsonpatch[_0xaeb7('0x39')](_0x1c709b,_0x4b161a,!![]);}catch(_0x1c46bf){return BPromise[_0xaeb7('0x3a')](_0x1c46bf);}return _0x1c709b[_0xaeb7('0x3b')]();};}function saveUpdates(_0x5c8a86,_0xffb4c){return function(_0x5d7226){if(_0x5d7226){return _0x5d7226['update'](_0x5c8a86)[_0xaeb7('0x24')](function(_0x57804f){return _0x57804f;});}return null;};}function removeEntity(_0xabb207,_0x5da78f){return function(_0x12c55d){if(_0x12c55d){return _0x12c55d['destroy']()[_0xaeb7('0x24')](function(){var _0xb6d570=_0x12c55d['get']({'plain':!![]});var _0x59528e='WhatsappAccounts';return db[_0xaeb7('0x3c')][_0xaeb7('0x3d')]({'where':{'type':_0x59528e,'resourceId':_0xb6d570['id']}})[_0xaeb7('0x24')](function(){return _0x12c55d;});})['then'](function(){_0xabb207[_0xaeb7('0x31')](0xcc)[_0xaeb7('0x30')]();});}};}function handleEntityNotFound(_0x4fc285,_0x8ca7b2){return function(_0x4c83f0){if(!_0x4c83f0){_0x4fc285[_0xaeb7('0x3e')](0x194);}return _0x4c83f0;};}function handleError(_0xa1cb94,_0x3f8f8c){_0x3f8f8c=_0x3f8f8c||0x1f4;return function(_0x9b7783){logger[_0xaeb7('0x2b')](_0x9b7783[_0xaeb7('0x3f')]);if(_0x9b7783['name']){delete _0x9b7783['name'];}_0xa1cb94['status'](_0x3f8f8c)[_0xaeb7('0x40')](_0x9b7783);};}exports[_0xaeb7('0x41')]=function(_0x15297e,_0x232499){var _0x2f5858={'include':[{'model':db[_0xaeb7('0x42')],'as':_0xaeb7('0x43')}]},_0x3c6cca={},_0x4cee7a={'count':0x0,'rows':[]};var _0x572c36=_[_0xaeb7('0x44')](db[_0xaeb7('0x45')][_0xaeb7('0x46')],function(_0x34eb85){return{'name':_0x34eb85[_0xaeb7('0x47')],'type':_0x34eb85[_0xaeb7('0x48')][_0xaeb7('0x49')]};});_0x3c6cca['model']=_[_0xaeb7('0x44')](_0x572c36,'name');_0x3c6cca[_0xaeb7('0x4a')]=_['keys'](_0x15297e[_0xaeb7('0x4a')]);_0x3c6cca[_0xaeb7('0x4b')]=_['intersection'](_0x3c6cca['model'],_0x3c6cca['query']);_0x2f5858[_0xaeb7('0x4c')]=_['intersection'](_0x3c6cca[_0xaeb7('0x4d')],qs[_0xaeb7('0x4e')](_0x15297e[_0xaeb7('0x4a')][_0xaeb7('0x4e')]));_0x2f5858[_0xaeb7('0x4c')]=_0x2f5858['attributes']['length']?_0x2f5858[_0xaeb7('0x4c')]:_0x3c6cca[_0xaeb7('0x4d')];if(!_0x15297e['query'][_0xaeb7('0x4f')](_0xaeb7('0x50'))){_0x2f5858[_0xaeb7('0x34')]=qs[_0xaeb7('0x34')](_0x15297e['query']['limit']);_0x2f5858[_0xaeb7('0x32')]=qs[_0xaeb7('0x32')](_0x15297e[_0xaeb7('0x4a')][_0xaeb7('0x32')]);}_0x2f5858[_0xaeb7('0x51')]=qs[_0xaeb7('0x52')](_0x15297e[_0xaeb7('0x4a')][_0xaeb7('0x52')]);_0x2f5858[_0xaeb7('0x53')]=qs[_0xaeb7('0x4b')](_[_0xaeb7('0x54')](_0x15297e[_0xaeb7('0x4a')],_0x3c6cca[_0xaeb7('0x4b')]),_0x572c36);if(_0x15297e['query']['filter']){_0x2f5858['where']=_[_0xaeb7('0x55')](_0x2f5858[_0xaeb7('0x53')],{'$or':_['map'](_0x572c36,function(_0x17d64f){if(_0x17d64f[_0xaeb7('0x48')]!==_0xaeb7('0x56')){var _0x257c31={};_0x257c31[_0x17d64f['name']]={'$like':'%'+_0x15297e[_0xaeb7('0x4a')][_0xaeb7('0x57')]+'%'};return _0x257c31;}})});}_0x2f5858=_[_0xaeb7('0x55')]({},_0x2f5858,_0x15297e['options']);var _0x5d87a3={'where':_0x2f5858['where']};return db[_0xaeb7('0x45')][_0xaeb7('0x35')](_0x5d87a3)[_0xaeb7('0x24')](function(_0x2915dd){_0x4cee7a[_0xaeb7('0x35')]=_0x2915dd;if(_0x15297e[_0xaeb7('0x4a')]['includeAll']){_0x2f5858[_0xaeb7('0x58')]=[{'all':!![]}];}return db[_0xaeb7('0x45')][_0xaeb7('0x59')](_0x2f5858);})[_0xaeb7('0x24')](function(_0xdb30bd){_0x4cee7a[_0xaeb7('0x5a')]=_0xdb30bd;return _0x4cee7a;})[_0xaeb7('0x24')](respondWithFilteredResult(_0x232499,_0x2f5858))[_0xaeb7('0x2f')](handleError(_0x232499,null));};exports['show']=function(_0x4e0f94,_0x1f0ec7){var _0xd9f305={'raw':![],'where':{'id':_0x4e0f94['params']['id']},'include':[{'model':db[_0xaeb7('0x42')],'as':'mandatoryDispositionPause'}]},_0x4106d2={};_0x4106d2[_0xaeb7('0x4d')]=_['keys'](db[_0xaeb7('0x45')][_0xaeb7('0x46')]);_0x4106d2['query']=_['keys'](_0x4e0f94['query']);_0x4106d2[_0xaeb7('0x4b')]=_[_0xaeb7('0x5b')](_0x4106d2[_0xaeb7('0x4d')],_0x4106d2[_0xaeb7('0x4a')]);_0xd9f305[_0xaeb7('0x4c')]=_[_0xaeb7('0x5b')](_0x4106d2['model'],qs['fields'](_0x4e0f94[_0xaeb7('0x4a')][_0xaeb7('0x4e')]));_0xd9f305[_0xaeb7('0x4c')]=_0xd9f305['attributes']['length']?_0xd9f305[_0xaeb7('0x4c')]:_0x4106d2[_0xaeb7('0x4d')];if(_0x4e0f94[_0xaeb7('0x4a')][_0xaeb7('0x5c')]){_0xd9f305[_0xaeb7('0x58')]=[{'all':!![]}];}_0xd9f305=_[_0xaeb7('0x55')]({},_0xd9f305,_0x4e0f94['options']);return db[_0xaeb7('0x45')][_0xaeb7('0x5d')](_0xd9f305)['then'](handleEntityNotFound(_0x1f0ec7,null))[_0xaeb7('0x24')](respondWithResult(_0x1f0ec7,null))['catch'](handleError(_0x1f0ec7,null));};exports[_0xaeb7('0x5e')]=function(_0x1e7c0a,_0x34b788){return db[_0xaeb7('0x45')][_0xaeb7('0x5e')](_0x1e7c0a[_0xaeb7('0x5f')],{})[_0xaeb7('0x24')](function(_0x513da7){var _0x4a7eb5=_0x1e7c0a[_0xaeb7('0x60')][_0xaeb7('0x61')]({'plain':!![]});if(!_0x4a7eb5)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4a7eb5[_0xaeb7('0x62')]===_0xaeb7('0x60')){var _0x32a6d9=_0x513da7[_0xaeb7('0x61')]({'plain':!![]});var _0x6ff934=_0xaeb7('0x63');return db[_0xaeb7('0x64')][_0xaeb7('0x5d')]({'where':{'name':_0x6ff934,'userProfileId':_0x4a7eb5['userProfileId']},'raw':!![]})['then'](function(_0x3af584){if(_0x3af584&&_0x3af584['autoAssociation']===0x0){return db[_0xaeb7('0x3c')][_0xaeb7('0x5e')]({'name':_0x32a6d9[_0xaeb7('0x65')],'resourceId':_0x32a6d9['id'],'type':_0x3af584[_0xaeb7('0x65')],'sectionId':_0x3af584['id']},{})[_0xaeb7('0x24')](function(){return _0x513da7;});}else{return _0x513da7;}})['catch'](function(_0x154ef7){logger[_0xaeb7('0x2b')](_0xaeb7('0x66'),_0x154ef7);throw _0x154ef7;});}return _0x513da7;})[_0xaeb7('0x24')](respondWithResult(_0x34b788,0xc9))[_0xaeb7('0x2f')](handleError(_0x34b788,null));};exports[_0xaeb7('0x67')]=function(_0x52e5e5,_0x37363a){if(_0x52e5e5['body']['id']){delete _0x52e5e5[_0xaeb7('0x5f')]['id'];}return db[_0xaeb7('0x45')][_0xaeb7('0x5d')]({'where':{'id':_0x52e5e5[_0xaeb7('0x68')]['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]})[_0xaeb7('0x24')](handleEntityNotFound(_0x37363a,null))['then'](saveUpdates(_0x52e5e5[_0xaeb7('0x5f')],null))[_0xaeb7('0x24')](respondWithResult(_0x37363a,null))[_0xaeb7('0x2f')](handleError(_0x37363a,null));};exports[_0xaeb7('0x3d')]=function(_0x56d9a0,_0x4d4e7a){return db[_0xaeb7('0x45')][_0xaeb7('0x5d')]({'where':{'id':_0x56d9a0[_0xaeb7('0x68')]['id']}})[_0xaeb7('0x24')](handleEntityNotFound(_0x4d4e7a,null))[_0xaeb7('0x24')](removeEntity(_0x4d4e7a,null))['catch'](handleError(_0x4d4e7a,null));};exports[_0xaeb7('0x69')]=function(_0x4f7c64,_0x32ab26){return db['WhatsappAccount'][_0xaeb7('0x69')]()[_0xaeb7('0x24')](respondWithResult(_0x32ab26,null))[_0xaeb7('0x2f')](handleError(_0x32ab26,null));};exports[_0xaeb7('0x6a')]=function(_0x34a38b,_0x1fb6fe,_0x186268){if(_0x34a38b[_0xaeb7('0x5f')]['id']){delete _0x34a38b[_0xaeb7('0x5f')]['id'];}return db[_0xaeb7('0x45')]['find']({'where':{'id':_0x34a38b[_0xaeb7('0x68')]['id']}})[_0xaeb7('0x24')](handleEntityNotFound(_0x1fb6fe,null))[_0xaeb7('0x24')](function(_0xfd409){if(_0xfd409){_0x34a38b[_0xaeb7('0x5f')]['WhatsappAccountId']=_0xfd409['id'];return db[_0xaeb7('0x6b')][_0xaeb7('0x5e')](_0x34a38b['body']);}})[_0xaeb7('0x24')](respondWithResult(_0x1fb6fe,null))[_0xaeb7('0x2f')](handleError(_0x1fb6fe,null));};exports[_0xaeb7('0x6c')]=function(_0xf7bee9,_0x38a64b,_0x4c7e0d){var _0x3b4004={'raw':![],'where':{}};var _0x1f0784={};var _0x49de56={'count':0x0,'rows':[]};return db['WhatsappAccount'][_0xaeb7('0x6d')]({'where':{'id':_0xf7bee9[_0xaeb7('0x68')]['id']}})[_0xaeb7('0x24')](handleEntityNotFound(_0x38a64b,null))[_0xaeb7('0x24')](function(_0x4afbee){if(_0x4afbee){_0x1f0784[_0xaeb7('0x4d')]=_[_0xaeb7('0x6e')](db[_0xaeb7('0x6b')][_0xaeb7('0x46')]);_0x1f0784['query']=_[_0xaeb7('0x6e')](_0xf7bee9[_0xaeb7('0x4a')]);_0x1f0784[_0xaeb7('0x4b')]=_[_0xaeb7('0x5b')](_0x1f0784[_0xaeb7('0x4d')],_0x1f0784[_0xaeb7('0x4a')]);_0x3b4004[_0xaeb7('0x4c')]=_[_0xaeb7('0x5b')](_0x1f0784[_0xaeb7('0x4d')],qs['fields'](_0xf7bee9['query'][_0xaeb7('0x4e')]));_0x3b4004[_0xaeb7('0x4c')]=_0x3b4004[_0xaeb7('0x4c')][_0xaeb7('0x6f')]?_0x3b4004[_0xaeb7('0x4c')]:_0x1f0784[_0xaeb7('0x4d')];if(!_0xf7bee9[_0xaeb7('0x4a')][_0xaeb7('0x4f')](_0xaeb7('0x50'))){_0x3b4004[_0xaeb7('0x34')]=qs[_0xaeb7('0x34')](_0xf7bee9[_0xaeb7('0x4a')]['limit']);_0x3b4004[_0xaeb7('0x32')]=qs[_0xaeb7('0x32')](_0xf7bee9[_0xaeb7('0x4a')][_0xaeb7('0x32')]);}_0x3b4004[_0xaeb7('0x51')]=qs['sort'](_0xf7bee9[_0xaeb7('0x4a')]['sort']);_0x3b4004['where']=qs[_0xaeb7('0x4b')](_[_0xaeb7('0x54')](_0xf7bee9['query'],_0x1f0784[_0xaeb7('0x4b')]));_0x3b4004[_0xaeb7('0x53')]['WhatsappAccountId']=_0x4afbee['id'];if(_0xf7bee9['query'][_0xaeb7('0x57')]){_0x3b4004['where']=_[_0xaeb7('0x55')](_0x3b4004['where'],{'$or':_['map'](_0x3b4004['attributes'],function(_0x2f0ab7){var _0x2c11fc={};_0x2c11fc[_0x2f0ab7]={'$like':'%'+_0xf7bee9[_0xaeb7('0x4a')][_0xaeb7('0x57')]+'%'};return _0x2c11fc;})});}_0x3b4004=_[_0xaeb7('0x55')]({},_0x3b4004,_0xf7bee9[_0xaeb7('0x70')]);return db[_0xaeb7('0x6b')][_0xaeb7('0x35')]({'where':_0x3b4004[_0xaeb7('0x53')]})[_0xaeb7('0x24')](function(_0x19f347){_0x49de56['count']=_0x19f347;if(_0xf7bee9[_0xaeb7('0x4a')][_0xaeb7('0x5c')]){_0x3b4004[_0xaeb7('0x58')]=[{'all':!![]}];}return db['Disposition'][_0xaeb7('0x59')](_0x3b4004);})[_0xaeb7('0x24')](function(_0x967f89){_0x49de56['rows']=_0x967f89;return _0x49de56;});}})[_0xaeb7('0x24')](respondWithFilteredResult(_0x38a64b,_0x3b4004))[_0xaeb7('0x2f')](handleError(_0x38a64b,null));};exports[_0xaeb7('0x71')]=function(_0x20e23c,_0x589989,_0x41f297){return db[_0xaeb7('0x45')][_0xaeb7('0x5d')]({'where':{'id':_0x20e23c['params']['id']}})[_0xaeb7('0x24')](handleEntityNotFound(_0x589989,null))[_0xaeb7('0x24')](function(_0x265f35){if(_0x265f35){return _0x265f35['removeDispositions'](_0x20e23c[_0xaeb7('0x4a')][_0xaeb7('0x72')]);}})['then'](respondWithStatusCode(_0x589989,null))[_0xaeb7('0x2f')](handleError(_0x589989,null));};exports[_0xaeb7('0x73')]=function(_0x56a206,_0x21e56f,_0x41957f){if(_0x56a206[_0xaeb7('0x5f')]['id']){delete _0x56a206[_0xaeb7('0x5f')]['id'];}return db[_0xaeb7('0x45')][_0xaeb7('0x5d')]({'where':{'id':_0x56a206[_0xaeb7('0x68')]['id']}})['then'](handleEntityNotFound(_0x21e56f,null))['then'](function(_0x20c7c9){if(_0x20c7c9){_0x56a206['body'][_0xaeb7('0x74')]=_0x20c7c9['id'];return db[_0xaeb7('0x75')][_0xaeb7('0x5e')](_0x56a206['body']);}})['then'](respondWithResult(_0x21e56f,null))[_0xaeb7('0x2f')](handleError(_0x21e56f,null));};exports[_0xaeb7('0x76')]=function(_0x5dd61b,_0x323b17,_0x4ba69b){var _0x1cdd65={'raw':![],'where':{}};var _0x4bafc5={};var _0x28d904={'count':0x0,'rows':[]};return db[_0xaeb7('0x45')][_0xaeb7('0x6d')]({'where':{'id':_0x5dd61b[_0xaeb7('0x68')]['id']}})['then'](handleEntityNotFound(_0x323b17,null))[_0xaeb7('0x24')](function(_0x361187){if(_0x361187){_0x4bafc5[_0xaeb7('0x4d')]=_[_0xaeb7('0x6e')](db[_0xaeb7('0x75')][_0xaeb7('0x46')]);_0x4bafc5[_0xaeb7('0x4a')]=_[_0xaeb7('0x6e')](_0x5dd61b[_0xaeb7('0x4a')]);_0x4bafc5[_0xaeb7('0x4b')]=_[_0xaeb7('0x5b')](_0x4bafc5[_0xaeb7('0x4d')],_0x4bafc5[_0xaeb7('0x4a')]);_0x1cdd65[_0xaeb7('0x4c')]=_[_0xaeb7('0x5b')](_0x4bafc5[_0xaeb7('0x4d')],qs[_0xaeb7('0x4e')](_0x5dd61b[_0xaeb7('0x4a')][_0xaeb7('0x4e')]));_0x1cdd65['attributes']=_0x1cdd65[_0xaeb7('0x4c')][_0xaeb7('0x6f')]?_0x1cdd65[_0xaeb7('0x4c')]:_0x4bafc5[_0xaeb7('0x4d')];if(!_0x5dd61b['query']['hasOwnProperty'](_0xaeb7('0x50'))){_0x1cdd65[_0xaeb7('0x34')]=qs[_0xaeb7('0x34')](_0x5dd61b[_0xaeb7('0x4a')][_0xaeb7('0x34')]);_0x1cdd65[_0xaeb7('0x32')]=qs[_0xaeb7('0x32')](_0x5dd61b[_0xaeb7('0x4a')][_0xaeb7('0x32')]);}_0x1cdd65[_0xaeb7('0x51')]=qs['sort'](_0x5dd61b['query'][_0xaeb7('0x52')]);_0x1cdd65[_0xaeb7('0x53')]=qs[_0xaeb7('0x4b')](_['pick'](_0x5dd61b['query'],_0x4bafc5[_0xaeb7('0x4b')]));_0x1cdd65['where'][_0xaeb7('0x74')]=_0x361187['id'];if(_0x5dd61b[_0xaeb7('0x4a')][_0xaeb7('0x57')]){_0x1cdd65[_0xaeb7('0x53')]=_[_0xaeb7('0x55')](_0x1cdd65[_0xaeb7('0x53')],{'$or':_[_0xaeb7('0x44')](_0x1cdd65[_0xaeb7('0x4c')],function(_0x5aa309){var _0x188243={};_0x188243[_0x5aa309]={'$like':'%'+_0x5dd61b[_0xaeb7('0x4a')][_0xaeb7('0x57')]+'%'};return _0x188243;})});}_0x1cdd65=_[_0xaeb7('0x55')]({},_0x1cdd65,_0x5dd61b[_0xaeb7('0x70')]);return db[_0xaeb7('0x75')][_0xaeb7('0x35')]({'where':_0x1cdd65[_0xaeb7('0x53')]})[_0xaeb7('0x24')](function(_0x45e93c){_0x28d904[_0xaeb7('0x35')]=_0x45e93c;if(_0x5dd61b[_0xaeb7('0x4a')][_0xaeb7('0x5c')]){_0x1cdd65['include']=[{'all':!![]}];}return db['CannedAnswer']['findAll'](_0x1cdd65);})[_0xaeb7('0x24')](function(_0x2cbefc){_0x28d904[_0xaeb7('0x5a')]=_0x2cbefc;return _0x28d904;});}})[_0xaeb7('0x24')](respondWithFilteredResult(_0x323b17,_0x1cdd65))['catch'](handleError(_0x323b17,null));};exports[_0xaeb7('0x77')]=function(_0x3a1e3d,_0x3010a1,_0x2c934a){return db[_0xaeb7('0x45')][_0xaeb7('0x5d')]({'where':{'id':_0x3a1e3d[_0xaeb7('0x68')]['id']}})[_0xaeb7('0x24')](handleEntityNotFound(_0x3010a1,null))['then'](function(_0x4235bf){if(_0x4235bf){return _0x4235bf['removeAnswers'](_0x3a1e3d['query']['ids']);}})[_0xaeb7('0x24')](respondWithStatusCode(_0x3010a1,null))[_0xaeb7('0x2f')](handleError(_0x3010a1,null));};exports[_0xaeb7('0x78')]=function(_0x409ad2,_0x4dc723,_0x395056){return db[_0xaeb7('0x45')][_0xaeb7('0x5d')]({'where':{'id':_0x409ad2[_0xaeb7('0x68')]['id']}})['then'](handleEntityNotFound(_0x4dc723,null))[_0xaeb7('0x24')](function(_0x2dbea7){if(_0x2dbea7){return _0x2dbea7['addAgents'](_0x409ad2[_0xaeb7('0x5f')][_0xaeb7('0x72')],_['omit'](_0x409ad2[_0xaeb7('0x5f')],['ids','id'])||{})[_0xaeb7('0x79')](function(_0x432dee){for(var _0x3088c8=0x0;_0x3088c8<_0x409ad2['body']['ids'][_0xaeb7('0x6f')];_0x3088c8+=0x1){socket[_0xaeb7('0x7a')](_0xaeb7('0x7b'),{'UserId':Number(_0x409ad2['body']['ids'][_0x3088c8]),'WhatsappAccountId':Number(_0x409ad2['params']['id'])});}return _0x432dee;});}})[_0xaeb7('0x24')](respondWithResult(_0x4dc723,null))[_0xaeb7('0x2f')](handleError(_0x4dc723,null));};exports[_0xaeb7('0x7c')]=function(_0x21fe53,_0x1b27a0,_0x1a825a){return db[_0xaeb7('0x45')]['find']({'where':{'id':_0x21fe53[_0xaeb7('0x68')]['id']}})[_0xaeb7('0x24')](handleEntityNotFound(_0x1b27a0,null))['then'](function(_0x19f5dc){if(_0x19f5dc){return _0x19f5dc[_0xaeb7('0x7c')](_0x21fe53[_0xaeb7('0x4a')][_0xaeb7('0x72')])[_0xaeb7('0x24')](function(){if(_['isArray'](_0x21fe53[_0xaeb7('0x4a')][_0xaeb7('0x72')])){for(var _0x39bd17=0x0;_0x39bd17<_0x21fe53[_0xaeb7('0x4a')]['ids'][_0xaeb7('0x6f')];_0x39bd17+=0x1){socket['emit'](_0xaeb7('0x7d'),{'UserId':Number(_0x21fe53[_0xaeb7('0x4a')][_0xaeb7('0x72')][_0x39bd17]),'WhatsappAccountId':Number(_0x21fe53[_0xaeb7('0x68')]['id'])});}}else{socket[_0xaeb7('0x7a')](_0xaeb7('0x7d'),{'UserId':Number(_0x21fe53['query']['ids']),'WhatsappAccountId':Number(_0x21fe53[_0xaeb7('0x68')]['id'])});}});}})[_0xaeb7('0x24')](respondWithStatusCode(_0x1b27a0,null))['catch'](handleError(_0x1b27a0,null));};exports['getAgents']=function(_0x423446,_0x179451,_0x5c4220){var _0x46e321={};var _0x558d79={};var _0x4d24ff;var _0x5e8424;return db[_0xaeb7('0x45')][_0xaeb7('0x6d')]({'where':{'id':_0x423446['params']['id']}})['then'](handleEntityNotFound(_0x179451,null))[_0xaeb7('0x24')](function(_0x5243b2){if(_0x5243b2){_0x4d24ff=_0x5243b2;_0x558d79[_0xaeb7('0x4d')]=_[_0xaeb7('0x6e')](db[_0xaeb7('0x7e')]['rawAttributes']);_0x558d79['query']=_['keys'](_0x423446[_0xaeb7('0x4a')]);_0x558d79['filters']=_[_0xaeb7('0x5b')](_0x558d79[_0xaeb7('0x4d')],_0x558d79[_0xaeb7('0x4a')]);_0x46e321[_0xaeb7('0x4c')]=_[_0xaeb7('0x5b')](_0x558d79[_0xaeb7('0x4d')],qs[_0xaeb7('0x4e')](_0x423446[_0xaeb7('0x4a')][_0xaeb7('0x4e')]));_0x46e321[_0xaeb7('0x4c')]=_0x46e321[_0xaeb7('0x4c')][_0xaeb7('0x6f')]?_0x46e321[_0xaeb7('0x4c')]:_0x558d79['model'];_0x46e321[_0xaeb7('0x51')]=qs[_0xaeb7('0x52')](_0x423446[_0xaeb7('0x4a')][_0xaeb7('0x52')]);_0x46e321['where']=qs['filters'](_['pick'](_0x423446['query'],_0x558d79['filters']));if(_0x423446[_0xaeb7('0x4a')][_0xaeb7('0x57')]){_0x46e321[_0xaeb7('0x53')]=_[_0xaeb7('0x55')](_0x46e321['where'],{'$or':_[_0xaeb7('0x44')](_0x46e321[_0xaeb7('0x4c')],function(_0x5ea2db){var _0x5e45f4={};_0x5e45f4[_0x5ea2db]={'$like':'%'+_0x423446[_0xaeb7('0x4a')][_0xaeb7('0x57')]+'%'};return _0x5e45f4;})});}_0x46e321=_[_0xaeb7('0x55')]({},_0x46e321,_0x423446[_0xaeb7('0x70')]);return _0x4d24ff[_0xaeb7('0x7f')](_0x46e321);}})[_0xaeb7('0x24')](function(_0x3803d4){if(_0x3803d4){_0x5e8424=_0x3803d4['length'];if(!_0x423446['query'][_0xaeb7('0x4f')](_0xaeb7('0x50'))){_0x46e321[_0xaeb7('0x34')]=qs[_0xaeb7('0x34')](_0x423446[_0xaeb7('0x4a')][_0xaeb7('0x34')]);_0x46e321['offset']=qs[_0xaeb7('0x32')](_0x423446[_0xaeb7('0x4a')][_0xaeb7('0x32')]);}return _0x4d24ff[_0xaeb7('0x7f')](_0x46e321);}})['then'](function(_0x5b3161){if(_0x5b3161){return _0x5b3161?{'count':_0x5e8424,'rows':_0x5b3161}:null;}})[_0xaeb7('0x24')](respondWithResult(_0x179451,null))[_0xaeb7('0x2f')](handleError(_0x179451,null));};exports['addApplications']=function(_0x591fe4,_0x54c391,_0x26ce39){return db[_0xaeb7('0x45')][_0xaeb7('0x6d')]({'where':{'id':_0x591fe4[_0xaeb7('0x68')]['id']}})[_0xaeb7('0x24')](handleEntityNotFound(_0x54c391,null))['then'](function(_0x5d5b31){if(_0x5d5b31){return db[_0xaeb7('0x80')][_0xaeb7('0x81')](function(_0x15f165){return db[_0xaeb7('0x82')][_0xaeb7('0x3d')]({'where':{'WhatsappAccountId':_0x591fe4[_0xaeb7('0x68')]['id']},'transaction':_0x15f165})['then'](function(_0x5827bb){var _0x47ca79=_['map'](_0x591fe4[_0xaeb7('0x5f')],function(_0x2d999e){_0x2d999e[_0xaeb7('0x74')]=_0x591fe4[_0xaeb7('0x68')]['id'];return _0x2d999e;});return db['WhatsappApplication']['bulkCreate'](_0x47ca79,{'transaction':_0x15f165});});})[_0xaeb7('0x24')](function(){return db[_0xaeb7('0x82')]['findAndCountAll']({'where':{'WhatsappAccountId':_0x591fe4[_0xaeb7('0x68')]['id']},'order':_0xaeb7('0x83')});});}})[_0xaeb7('0x24')](respondWithResult(_0x54c391,null))[_0xaeb7('0x2f')](handleError(_0x54c391,null));};exports[_0xaeb7('0x84')]=function(_0x27d790,_0x228321,_0x201de2){var _0x52df8e={};var _0x2340d5={};var _0x1c7856;var _0x2128d1;return db[_0xaeb7('0x45')][_0xaeb7('0x6d')]({'where':{'id':_0x27d790[_0xaeb7('0x68')]['id']}})[_0xaeb7('0x24')](handleEntityNotFound(_0x228321,null))['then'](function(_0x5558af){if(_0x5558af){_0x1c7856=_0x5558af;_0x2340d5[_0xaeb7('0x4d')]=_[_0xaeb7('0x6e')](db[_0xaeb7('0x82')][_0xaeb7('0x46')]);_0x2340d5[_0xaeb7('0x4a')]=_['keys'](_0x27d790[_0xaeb7('0x4a')]);_0x2340d5[_0xaeb7('0x4b')]=_[_0xaeb7('0x5b')](_0x2340d5[_0xaeb7('0x4d')],_0x2340d5[_0xaeb7('0x4a')]);_0x52df8e[_0xaeb7('0x4c')]=_[_0xaeb7('0x5b')](_0x2340d5[_0xaeb7('0x4d')],qs[_0xaeb7('0x4e')](_0x27d790[_0xaeb7('0x4a')]['fields']));_0x52df8e[_0xaeb7('0x4c')]=_0x52df8e[_0xaeb7('0x4c')][_0xaeb7('0x6f')]?_0x52df8e[_0xaeb7('0x4c')]:_0x2340d5[_0xaeb7('0x4d')];_0x52df8e['order']=qs['sort'](_0x27d790[_0xaeb7('0x4a')][_0xaeb7('0x52')]);_0x52df8e[_0xaeb7('0x53')]=qs[_0xaeb7('0x4b')](_[_0xaeb7('0x54')](_0x27d790[_0xaeb7('0x4a')],_0x2340d5[_0xaeb7('0x4b')]));if(_0x27d790[_0xaeb7('0x4a')]['filter']){_0x52df8e[_0xaeb7('0x53')]=_[_0xaeb7('0x55')](_0x52df8e[_0xaeb7('0x53')],{'$or':_[_0xaeb7('0x44')](_0x52df8e[_0xaeb7('0x4c')],function(_0x4ab214){var _0xe4a2a9={};_0xe4a2a9[_0x4ab214]={'$like':'%'+_0x27d790['query']['filter']+'%'};return _0xe4a2a9;})});}_0x52df8e=_['merge']({},_0x52df8e,_0x27d790['options']);return _0x1c7856[_0xaeb7('0x84')](_0x52df8e);}})[_0xaeb7('0x24')](function(_0x1c3913){if(_0x1c3913){_0x2128d1=_0x1c3913[_0xaeb7('0x6f')];if(!_0x27d790[_0xaeb7('0x4a')][_0xaeb7('0x4f')](_0xaeb7('0x50'))){_0x52df8e['limit']=qs[_0xaeb7('0x34')](_0x27d790[_0xaeb7('0x4a')][_0xaeb7('0x34')]);_0x52df8e[_0xaeb7('0x32')]=qs['offset'](_0x27d790['query'][_0xaeb7('0x32')]);}return _0x1c7856[_0xaeb7('0x84')](_0x52df8e);}})['then'](function(_0x14b962){if(_0x14b962){return _0x14b962?{'count':_0x2128d1,'rows':_0x14b962}:null;}})[_0xaeb7('0x24')](respondWithResult(_0x228321,null))[_0xaeb7('0x2f')](handleError(_0x228321,null));};exports['notify']=function(_0x498682,_0x21e615,_0x1664a9){var _0x3e5954={'channel':_0xaeb7('0x85')};var _0x1f5622=[];var _0x9d4dea=[];var _0x23067d={};return db['WhatsappAccount']['find']({'where':{'id':_0x498682[_0xaeb7('0x68')]['id']},'include':[{'model':db[_0xaeb7('0x82')],'as':_0xaeb7('0x86')}]})[_0xaeb7('0x24')](handleEntityNotFound(_0x21e615,null))[_0xaeb7('0x24')](function(_0x4e5de4){_0x3e5954[_0xaeb7('0x87')]=_0x4e5de4;_0x3e5954['applications']=_[_0xaeb7('0x88')](_0x4e5de4[_0xaeb7('0x86')],[_0xaeb7('0x83')],['asc']);if(_0x3e5954[_0xaeb7('0x87')][_0xaeb7('0x86')]){delete _0x3e5954['account'][_0xaeb7('0x86')];}return db[_0xaeb7('0x89')][_0xaeb7('0x69')]();})[_0xaeb7('0x24')](function(_0xe03266){if(!_0xe03266){throw new db['Sequelize'][(_0xaeb7('0x8a'))]('no\x20available\x20attributes');}_0x1f5622=_['difference'](_['keys'](_0xe03266),[_0xaeb7('0x8b'),_0xaeb7('0x8c')]);_0x9d4dea=_['difference'](_[_0xaeb7('0x6e')](_0xe03266),['createdAt',_0xaeb7('0x8c'),_0xaeb7('0x8d'),'ListId']);_0x3e5954[_0xaeb7('0x5f')]={'mapKey':_0xaeb7('0x8e')};if(_0x3e5954['account'][_0xaeb7('0x48')]&&_0x3e5954[_0xaeb7('0x87')][_0xaeb7('0x48')]==='twilio'){_0x3e5954[_0xaeb7('0x5f')]['from']=_0x498682['body'][_0xaeb7('0x8f')][_0xaeb7('0x90')]('whatsapp:','');_0x3e5954[_0xaeb7('0x5f')][_0xaeb7('0x5f')]=_0x498682['body']['Body'];_0x3e5954['body'][_0xaeb7('0x91')]=_0x498682[_0xaeb7('0x5f')][_0xaeb7('0x92')];}if(_0x3e5954['body']['id']){delete _0x3e5954['body']['id'];}if(_[_0xaeb7('0x93')](_0x3e5954[_0xaeb7('0x5f')][_0xaeb7('0x94')])){throw new db['Sequelize'][(_0xaeb7('0x8a'))](_0xaeb7('0x95'));}if(_[_0xaeb7('0x93')](_0x3e5954[_0xaeb7('0x5f')][_0xaeb7('0x5f')])||_0x3e5954['body']['body']===''){throw new db['Sequelize'][(_0xaeb7('0x8a'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0xaeb7('0x93')](_0x3e5954[_0xaeb7('0x5f')][_0xaeb7('0x96')])){throw new db[(_0xaeb7('0x97'))][(_0xaeb7('0x8a'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x9d4dea);}if(!_[_0xaeb7('0x98')](_0x9d4dea,_0x3e5954[_0xaeb7('0x5f')][_0xaeb7('0x96')])){throw new db[(_0xaeb7('0x97'))]['ValidationError'](_0xaeb7('0x99')+_0x9d4dea);}_0x23067d[_0x3e5954[_0xaeb7('0x5f')][_0xaeb7('0x96')]]=_0x3e5954['body']['from'];return db['CmList'][_0xaeb7('0x5d')]({'where':{'id':_0x3e5954[_0xaeb7('0x87')]['ListId']},'include':[{'model':db['CmContact'],'as':'Contacts','where':_0x23067d,'limit':0x1,'order':[['updatedAt',_0xaeb7('0x9a')]]}]});})[_0xaeb7('0x24')](handleEntityNotFound(_0x21e615,null))[_0xaeb7('0x24')](function(_0x431d0e){if(_0x431d0e){_0x3e5954['list']=_[_0xaeb7('0x9b')](_0x431d0e,[_0xaeb7('0x9c')]);if(_0x431d0e[_0xaeb7('0x9c')][_0xaeb7('0x6f')]){return _0x431d0e['Contacts'][0x0];}var _0xcc9af=_[_0xaeb7('0x1d')](_0x3e5954[_0xaeb7('0x5f')],{'firstName':_0x3e5954['body'][_0xaeb7('0x94')],'ListId':_0x431d0e['id']});_0xcc9af[_0x3e5954['body'][_0xaeb7('0x96')]]=_0x3e5954[_0xaeb7('0x5f')]['from'];return db[_0xaeb7('0x89')]['create'](_0xcc9af,{'fields':_0x1f5622,'raw':!![]});}})[_0xaeb7('0x24')](handleEntityNotFound(_0x21e615,null))[_0xaeb7('0x24')](function(_0xef8f87){if(_0xef8f87){_0x3e5954['contact']=_0xef8f87;var _0x3af7db={'ContactId':_0xef8f87['id'],'phone':_0x3e5954[_0xaeb7('0x5f')][_0xaeb7('0x94')],'WhatsappAccountId':_0x498682['params']['id']};var _0x486442={'ContactId':_0xef8f87['id'],'WhatsappAccountId':_0x498682[_0xaeb7('0x68')]['id'],'closed':![]};return db['WhatsappInteraction']['find']({'where':_0x486442})[_0xaeb7('0x24')](function(_0x523587){if(_0x523587){return[_0x523587,![]];}return db[_0xaeb7('0x9d')][_0xaeb7('0x5e')](_0x3af7db)[_0xaeb7('0x24')](function(_0x1db82e){return[_0x1db82e,!![]];});});}})[_0xaeb7('0x79')](function(_0x5c8df9,_0x336dbb){_0x3e5954['interaction']=_0x5c8df9[_0xaeb7('0x61')]({'plain':!![]});_0x3e5954[_0xaeb7('0x9e')][_0xaeb7('0x9f')]=![];if(_0x336dbb){if(_0x3e5954[_0xaeb7('0x87')][_0xaeb7('0xa0')]){_0x3e5954[_0xaeb7('0xa1')][_0xaeb7('0xa2')]({'id':0x0,'priority':_0x3e5954['applications'][_0xaeb7('0x6f')]+0x1,'app':'close','appdata':'unmanaged','interval':_0xaeb7('0xa3')});}_0x3e5954[_0xaeb7('0x9e')][_0xaeb7('0x9f')]=!![];}return db['WhatsappMessage'][_0xaeb7('0x5e')]({'phone':_0x3e5954['body']['from'],'messageId':_0x3e5954[_0xaeb7('0x5f')]['messageId'],'body':_0x3e5954[_0xaeb7('0x5f')]['body'],'WhatsappAccountId':_0x498682[_0xaeb7('0x68')]['id'],'WhatsappInteractionId':_0x5c8df9['id'],'direction':'in','ContactId':_0x5c8df9['ContactId'],'AttachmentId':_0x3e5954[_0xaeb7('0x5f')][_0xaeb7('0xa4')]});})[_0xaeb7('0x24')](function(_0x5cafe5){_0x3e5954[_0xaeb7('0x2d')]=_0x5cafe5;if(_0x3e5954[_0xaeb7('0x9e')]['UserId']){return db['User'][_0xaeb7('0x5d')]({'attributes':['id',_0xaeb7('0x65')],'where':{'id':_0x3e5954['interaction'][_0xaeb7('0xa5')]}})[_0xaeb7('0x24')](function(_0x40d525){if(_0x40d525){_0x3e5954['applications'][_0xaeb7('0xa6')]({'id':0x0,'priority':0x0,'app':_0xaeb7('0xa7'),'appdata':_0x40d525[_0xaeb7('0x65')]+','+(_0x3e5954[_0xaeb7('0x87')][_0xaeb7('0xa8')]||0xa),'interval':_0xaeb7('0xa3')});}return respondWithRpcPromise('Start',_0xaeb7('0xa9'),_0x3e5954);});}return respondWithRpcPromise(_0xaeb7('0xaa'),_0xaeb7('0xa9'),_0x3e5954);})[_0xaeb7('0x24')](function(_0x40fdad){if(_0x40fdad){var _0x310a89=0xc8;var _0xcb093c=_0xaeb7('0xab');logger[_0xaeb7('0x25')]('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0xcb093c,_0x310a89,_0xaeb7('0xac'));logger[_0xaeb7('0x27')](_0xaeb7('0xad'),_0xcb093c,_0x310a89,_0xaeb7('0xac'),JSON[_0xaeb7('0x2a')](_0x40fdad));if(_0x3e5954[_0xaeb7('0x87')][_0xaeb7('0x48')]===_0xaeb7('0xae')){return _0x21e615[_0xaeb7('0x31')](_0x310a89)['set'](_0xaeb7('0xaf'),_0xaeb7('0xb0'))[_0xaeb7('0x40')](_0xaeb7('0xb1'));}else{return _0x21e615[_0xaeb7('0x31')](_0x310a89)[_0xaeb7('0x38')](_0x40fdad);}}})['catch'](handleError(_0x21e615,null));};exports[_0xaeb7('0x40')]=function(_0x206bf2,_0x1046f2,_0x2b423a){var _0x3c3983,_0x130066,_0x49f7ea;if(_[_0xaeb7('0x93')](_0x206bf2['body'][_0xaeb7('0x5f')])||_0x206bf2[_0xaeb7('0x5f')][_0xaeb7('0x5f')]===''){throw new db['Sequelize'][(_0xaeb7('0x8a'))](_0xaeb7('0xb2'));}if(_[_0xaeb7('0x93')](_0x206bf2[_0xaeb7('0x5f')]['to'])){throw new db[(_0xaeb7('0x97'))]['ValidationError']('to\x20is\x20mandatory');}_0x3c3983=_0x206bf2['body']['to'];return db[_0xaeb7('0x45')][_0xaeb7('0x5d')]({'where':{'id':_0x206bf2[_0xaeb7('0x68')]['id']},'include':[{'model':db['CmList'],'as':'List','include':[{'model':db[_0xaeb7('0x89')],'as':_0xaeb7('0x9c'),'where':{'mobile':_0x3c3983},'limit':0x1,'order':[['updatedAt','DESC']]}]}]})[_0xaeb7('0x24')](handleEntityNotFound(_0x1046f2,null))[_0xaeb7('0x24')](function(_0x50cf1c){if(_0x50cf1c&&_0x50cf1c['List']){_0x130066=_0x50cf1c[_0xaeb7('0x61')]({'plain':!![]});if(_0x130066[_0xaeb7('0xb3')]&&_0x130066['List'][_0xaeb7('0x9c')]['length']){return _0x130066[_0xaeb7('0xb3')]['Contacts'][0x0];}return db[_0xaeb7('0x89')]['create'](_[_0xaeb7('0x1d')](_0x206bf2[_0xaeb7('0x5f')],{'firstName':_0x3c3983,'mobile':_0x3c3983,'phone':_0x3c3983,'ListId':_0x130066['ListId']}));}})[_0xaeb7('0x24')](handleEntityNotFound(_0x1046f2,null))[_0xaeb7('0x24')](function(_0x2eaa61){if(_0x2eaa61){_0x49f7ea=_0x2eaa61;return db[_0xaeb7('0x9d')][_0xaeb7('0x5d')]({'where':{'ContactId':_0x49f7ea['id'],'closed':![],'WhatsappAccountId':_0x130066['id']}})[_0xaeb7('0x24')](function(_0x2b8f8f){if(_0x2b8f8f){return[_0x2b8f8f,![]];}return db['WhatsappInteraction'][_0xaeb7('0x5e')]({'UserId':_0x206bf2['user']['id'],'ContactId':_0x49f7ea['id'],'WhatsappAccountId':_0x130066['id'],'phone':_0x3c3983,'firstMsgDirection':_0xaeb7('0xb4'),'Messages':[_[_0xaeb7('0x55')](_0x206bf2['body'],{'read':![],'body':_0x206bf2[_0xaeb7('0x5f')][_0xaeb7('0x5f')],'phone':_0x3c3983,'WhatsappAccountId':_0x130066['id'],'UserId':_0x206bf2['user']['id'],'ContactId':_0x49f7ea['id']})]},{'include':[{'model':db[_0xaeb7('0xb5')],'as':_0xaeb7('0xb6')}]})[_0xaeb7('0x24')](function(_0x5ca4b2){return[_0x5ca4b2,!![]];});});}})[_0xaeb7('0x79')](function(_0x492d54,_0x2b6679){if(_0x2b6679){return _0x492d54;}return db['WhatsappMessage']['create'](_[_0xaeb7('0x55')](_0x206bf2[_0xaeb7('0x5f')],{'read':![],'body':_0x206bf2['body']['body'],'phone':_0x3c3983,'WhatsappAccountId':_0x130066['id'],'WhatsappInteractionId':_0x492d54['id'],'UserId':_0x206bf2[_0xaeb7('0x60')]['id'],'ContactId':_0x49f7ea['id']}))[_0xaeb7('0x24')](function(_0x5b6fe0){_0x492d54['dataValues'][_0xaeb7('0xb6')]=[];_0x492d54['dataValues'][_0xaeb7('0xb6')][_0xaeb7('0xa2')](_0x5b6fe0[_0xaeb7('0xb7')]);return _0x492d54;});})['then'](respondWithResult(_0x1046f2,null))[_0xaeb7('0x2f')](handleError(_0x1046f2,null));}; \ No newline at end of file +var _0x1ecf=['./whatsappAccount.socket','register','jayson/promise','client','http','info','WhatsappAccount,\x20%s,\x20%s','request\x20sent','WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','get','destroy','sendStatus','name','send','index','Pause','mandatoryDispositionPause','map','WhatsappAccount','rawAttributes','fieldName','type','key','keys','query','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','includeAll','include','findAll','params','length','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','WhatsappAccounts','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addDisposition','Disposition','getDispositions','WhatsappAccountId','rows','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','pick','removeAnswers','addAgents','omit','spread','emit','isArray','userWhatsappAccount:remove','getAgents','findOne','addApplications','sequelize','transaction','WhatsappApplication','bulkCreate','priority','getApplications','whatsapp','Applications','applications','orderBy','asc','account','describe','Sequelize','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','mobile','replace','whatsapp:','messageId','MessageSid','isNil','ValidationError','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','from','CmList','CmContact','Contacts','DESC','list','defaults','contact','WhatsappInteraction','created','autoclose','*,*,*,*','interaction','ContactId','AttachmentId','User','unshift','agent','waitForTheAssignedAgent','Start','startRouting','receiveMessage','entity\x20found','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s','Content-Type','to\x20is\x20mandatory','List','WhatsappMessage','Messages','dataValues','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','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','redis','socket.io-emitter'];(function(_0x6131cd,_0x4c26a1){var _0x47e916=function(_0x1f2bce){while(--_0x1f2bce){_0x6131cd['push'](_0x6131cd['shift']());}};_0x47e916(++_0x4c26a1);}(_0x1ecf,0x15d));var _0xf1ec=function(_0x279368,_0x41c002){_0x279368=_0x279368-0x0;var _0x40b6d0=_0x1ecf[_0x279368];return _0x40b6d0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf1ec('0x0'));var zipdir=require(_0xf1ec('0x1'));var jsonpatch=require(_0xf1ec('0x2'));var rp=require('request-promise');var moment=require(_0xf1ec('0x3'));var BPromise=require(_0xf1ec('0x4'));var Mustache=require(_0xf1ec('0x5'));var util=require(_0xf1ec('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0xf1ec('0x7'));var ejs=require(_0xf1ec('0x8'));var fs=require('fs');var fs_extra=require(_0xf1ec('0x9'));var _=require(_0xf1ec('0xa'));var squel=require(_0xf1ec('0xb'));var crypto=require(_0xf1ec('0xc'));var jsforce=require(_0xf1ec('0xd'));var deskjs=require(_0xf1ec('0xe'));var toCsv=require(_0xf1ec('0x7'));var querystring=require(_0xf1ec('0xf'));var Papa=require(_0xf1ec('0x10'));var Redis=require('ioredis');var authService=require(_0xf1ec('0x11'));var qs=require(_0xf1ec('0x12'));var as=require(_0xf1ec('0x13'));var hardwareService=require(_0xf1ec('0x14'));var logger=require(_0xf1ec('0x15'))(_0xf1ec('0x16'));var utils=require(_0xf1ec('0x17'));var config=require(_0xf1ec('0x18'));var licenseUtil=require(_0xf1ec('0x19'));var db=require(_0xf1ec('0x1a'))['db'];config[_0xf1ec('0x1b')]=_['defaults'](config[_0xf1ec('0x1b')],{'host':'localhost','port':0x18eb});var socket=require(_0xf1ec('0x1c'))(new Redis(config[_0xf1ec('0x1b')]));require(_0xf1ec('0x1d'))[_0xf1ec('0x1e')](socket);var jayson=require(_0xf1ec('0x1f'));var client=jayson[_0xf1ec('0x20')][_0xf1ec('0x21')]({'port':0x232c});function respondWithRpcPromise(_0x4da2e1,_0x28ba93,_0x172869,_0x354ea3){return new BPromise(function(_0xfdc258,_0x40118e){var _0x286e0f=_0x354ea3||client;return _0x286e0f['request'](_0x4da2e1,_0x172869)['then'](function(_0x3bcb45){logger[_0xf1ec('0x22')](_0xf1ec('0x23'),_0x28ba93,_0xf1ec('0x24'));logger['debug'](_0xf1ec('0x25'),_0x28ba93,_0xf1ec('0x24'),JSON[_0xf1ec('0x26')](_0x3bcb45));if(_0x3bcb45[_0xf1ec('0x27')]){if(_0x3bcb45[_0xf1ec('0x27')][_0xf1ec('0x28')]===0x1f4){logger['error'](_0xf1ec('0x23'),_0x28ba93,_0x3bcb45[_0xf1ec('0x27')][_0xf1ec('0x29')]);return _0x40118e(_0x3bcb45['error']['message']);}logger[_0xf1ec('0x27')](_0xf1ec('0x23'),_0x28ba93,_0x3bcb45[_0xf1ec('0x27')][_0xf1ec('0x29')]);return _0xfdc258(_0x3bcb45[_0xf1ec('0x27')][_0xf1ec('0x29')]);}else{logger[_0xf1ec('0x22')](_0xf1ec('0x23'),_0x28ba93,'request\x20sent');_0xfdc258(_0x3bcb45[_0xf1ec('0x2a')][_0xf1ec('0x29')]);}})[_0xf1ec('0x2b')](function(_0x5cb676){logger[_0xf1ec('0x27')](_0xf1ec('0x23'),_0x28ba93,_0x5cb676);_0x40118e(_0x5cb676);});});}function respondWithStatusCode(_0x3b1286,_0x27dcb1){_0x27dcb1=_0x27dcb1||0xcc;return function(_0x4dd9bb){if(_0x4dd9bb){return _0x3b1286['sendStatus'](_0x27dcb1);}return _0x3b1286[_0xf1ec('0x2c')](_0x27dcb1)[_0xf1ec('0x2d')]();};}function respondWithResult(_0x58c772,_0x30ddbb){_0x30ddbb=_0x30ddbb||0xc8;return function(_0x12839d){if(_0x12839d){return _0x58c772['status'](_0x30ddbb)[_0xf1ec('0x2e')](_0x12839d);}};}function respondWithFilteredResult(_0x55b9f8,_0x4260d0){return function(_0x522c3f){if(_0x522c3f){var _0x1b6005=typeof _0x4260d0[_0xf1ec('0x2f')]===_0xf1ec('0x30')&&typeof _0x4260d0[_0xf1ec('0x31')]===_0xf1ec('0x30');var _0x2ab306=_0x522c3f[_0xf1ec('0x32')];var _0x346b3f=_0x1b6005?0x0:_0x4260d0['offset'];var _0x1e3f69=_0x1b6005?_0x522c3f[_0xf1ec('0x32')]:_0x4260d0[_0xf1ec('0x2f')]+_0x4260d0['limit'];var _0x20c581;if(_0x1e3f69>=_0x2ab306){_0x1e3f69=_0x2ab306;_0x20c581=0xc8;}else{_0x20c581=0xce;}_0x55b9f8[_0xf1ec('0x2c')](_0x20c581);return _0x55b9f8[_0xf1ec('0x33')](_0xf1ec('0x34'),_0x346b3f+'-'+_0x1e3f69+'/'+_0x2ab306)[_0xf1ec('0x2e')](_0x522c3f);}return null;};}function patchUpdates(_0x1c299c){return function(_0x45759c){try{jsonpatch[_0xf1ec('0x35')](_0x45759c,_0x1c299c,!![]);}catch(_0x252ff4){return BPromise[_0xf1ec('0x36')](_0x252ff4);}return _0x45759c[_0xf1ec('0x37')]();};}function saveUpdates(_0x3d7983,_0x17e49c){return function(_0xfb4ecb){if(_0xfb4ecb){return _0xfb4ecb[_0xf1ec('0x38')](_0x3d7983)[_0xf1ec('0x39')](function(_0x2b3aaf){return _0x2b3aaf;});}return null;};}function removeEntity(_0x48d7d0,_0x45d292){return function(_0x5042d8){if(_0x5042d8){return _0x5042d8['destroy']()['then'](function(){var _0x4d9b65=_0x5042d8[_0xf1ec('0x3a')]({'plain':!![]});var _0x54cbe1='WhatsappAccounts';return db['UserProfileResource'][_0xf1ec('0x3b')]({'where':{'type':_0x54cbe1,'resourceId':_0x4d9b65['id']}})[_0xf1ec('0x39')](function(){return _0x5042d8;});})[_0xf1ec('0x39')](function(){_0x48d7d0[_0xf1ec('0x2c')](0xcc)[_0xf1ec('0x2d')]();});}};}function handleEntityNotFound(_0x5d716c,_0x5d9bfe){return function(_0x5d07af){if(!_0x5d07af){_0x5d716c[_0xf1ec('0x3c')](0x194);}return _0x5d07af;};}function handleError(_0x3c9789,_0x3245c3){_0x3245c3=_0x3245c3||0x1f4;return function(_0x2eaff9){logger[_0xf1ec('0x27')](_0x2eaff9['stack']);if(_0x2eaff9['name']){delete _0x2eaff9[_0xf1ec('0x3d')];}_0x3c9789[_0xf1ec('0x2c')](_0x3245c3)[_0xf1ec('0x3e')](_0x2eaff9);};}exports[_0xf1ec('0x3f')]=function(_0x4150d3,_0x4cecd9){var _0x639214={'include':[{'model':db[_0xf1ec('0x40')],'as':_0xf1ec('0x41')}]},_0x1f3e89={},_0x5f2764={'count':0x0,'rows':[]};var _0x4a7170=_[_0xf1ec('0x42')](db[_0xf1ec('0x43')][_0xf1ec('0x44')],function(_0x523762){return{'name':_0x523762[_0xf1ec('0x45')],'type':_0x523762[_0xf1ec('0x46')][_0xf1ec('0x47')]};});_0x1f3e89['model']=_[_0xf1ec('0x42')](_0x4a7170,_0xf1ec('0x3d'));_0x1f3e89['query']=_[_0xf1ec('0x48')](_0x4150d3[_0xf1ec('0x49')]);_0x1f3e89[_0xf1ec('0x4a')]=_[_0xf1ec('0x4b')](_0x1f3e89[_0xf1ec('0x4c')],_0x1f3e89[_0xf1ec('0x49')]);_0x639214[_0xf1ec('0x4d')]=_[_0xf1ec('0x4b')](_0x1f3e89[_0xf1ec('0x4c')],qs[_0xf1ec('0x4e')](_0x4150d3[_0xf1ec('0x49')][_0xf1ec('0x4e')]));_0x639214[_0xf1ec('0x4d')]=_0x639214[_0xf1ec('0x4d')]['length']?_0x639214[_0xf1ec('0x4d')]:_0x1f3e89[_0xf1ec('0x4c')];if(!_0x4150d3[_0xf1ec('0x49')][_0xf1ec('0x4f')](_0xf1ec('0x50'))){_0x639214[_0xf1ec('0x31')]=qs[_0xf1ec('0x31')](_0x4150d3[_0xf1ec('0x49')][_0xf1ec('0x31')]);_0x639214['offset']=qs[_0xf1ec('0x2f')](_0x4150d3[_0xf1ec('0x49')][_0xf1ec('0x2f')]);}_0x639214[_0xf1ec('0x51')]=qs['sort'](_0x4150d3['query'][_0xf1ec('0x52')]);_0x639214[_0xf1ec('0x53')]=qs[_0xf1ec('0x4a')](_['pick'](_0x4150d3[_0xf1ec('0x49')],_0x1f3e89[_0xf1ec('0x4a')]),_0x4a7170);if(_0x4150d3[_0xf1ec('0x49')][_0xf1ec('0x54')]){_0x639214[_0xf1ec('0x53')]=_[_0xf1ec('0x55')](_0x639214[_0xf1ec('0x53')],{'$or':_['map'](_0x4a7170,function(_0x3c8b45){if(_0x3c8b45['type']!==_0xf1ec('0x56')){var _0x5b3823={};_0x5b3823[_0x3c8b45['name']]={'$like':'%'+_0x4150d3['query'][_0xf1ec('0x54')]+'%'};return _0x5b3823;}})});}_0x639214=_[_0xf1ec('0x55')]({},_0x639214,_0x4150d3['options']);var _0x3cca6c={'where':_0x639214[_0xf1ec('0x53')]};return db[_0xf1ec('0x43')][_0xf1ec('0x32')](_0x3cca6c)[_0xf1ec('0x39')](function(_0x38a456){_0x5f2764[_0xf1ec('0x32')]=_0x38a456;if(_0x4150d3[_0xf1ec('0x49')][_0xf1ec('0x57')]){_0x639214[_0xf1ec('0x58')]=[{'all':!![]}];}return db['WhatsappAccount'][_0xf1ec('0x59')](_0x639214);})[_0xf1ec('0x39')](function(_0x59dac0){_0x5f2764['rows']=_0x59dac0;return _0x5f2764;})[_0xf1ec('0x39')](respondWithFilteredResult(_0x4cecd9,_0x639214))['catch'](handleError(_0x4cecd9,null));};exports['show']=function(_0x540209,_0x5dbfb9){var _0x5e68c6={'raw':![],'where':{'id':_0x540209[_0xf1ec('0x5a')]['id']},'include':[{'model':db[_0xf1ec('0x40')],'as':'mandatoryDispositionPause'}]},_0x3a0c42={};_0x3a0c42['model']=_[_0xf1ec('0x48')](db['WhatsappAccount']['rawAttributes']);_0x3a0c42[_0xf1ec('0x49')]=_[_0xf1ec('0x48')](_0x540209[_0xf1ec('0x49')]);_0x3a0c42[_0xf1ec('0x4a')]=_[_0xf1ec('0x4b')](_0x3a0c42[_0xf1ec('0x4c')],_0x3a0c42[_0xf1ec('0x49')]);_0x5e68c6[_0xf1ec('0x4d')]=_[_0xf1ec('0x4b')](_0x3a0c42[_0xf1ec('0x4c')],qs[_0xf1ec('0x4e')](_0x540209['query'][_0xf1ec('0x4e')]));_0x5e68c6['attributes']=_0x5e68c6['attributes'][_0xf1ec('0x5b')]?_0x5e68c6[_0xf1ec('0x4d')]:_0x3a0c42[_0xf1ec('0x4c')];if(_0x540209[_0xf1ec('0x49')]['includeAll']){_0x5e68c6['include']=[{'all':!![]}];}_0x5e68c6=_['merge']({},_0x5e68c6,_0x540209[_0xf1ec('0x5c')]);return db[_0xf1ec('0x43')][_0xf1ec('0x5d')](_0x5e68c6)[_0xf1ec('0x39')](handleEntityNotFound(_0x5dbfb9,null))[_0xf1ec('0x39')](respondWithResult(_0x5dbfb9,null))['catch'](handleError(_0x5dbfb9,null));};exports[_0xf1ec('0x5e')]=function(_0xd2cc06,_0x549fee){return db[_0xf1ec('0x43')][_0xf1ec('0x5e')](_0xd2cc06[_0xf1ec('0x5f')],{})['then'](function(_0x352556){var _0x3f490d=_0xd2cc06[_0xf1ec('0x60')]['get']({'plain':!![]});if(!_0x3f490d)throw new Error(_0xf1ec('0x61'));if(_0x3f490d[_0xf1ec('0x62')]==='user'){var _0x163398=_0x352556['get']({'plain':!![]});var _0x37c609=_0xf1ec('0x63');return db[_0xf1ec('0x64')][_0xf1ec('0x5d')]({'where':{'name':_0x37c609,'userProfileId':_0x3f490d[_0xf1ec('0x65')]},'raw':!![]})['then'](function(_0x14c1fa){if(_0x14c1fa&&_0x14c1fa[_0xf1ec('0x66')]===0x0){return db[_0xf1ec('0x67')]['create']({'name':_0x163398[_0xf1ec('0x3d')],'resourceId':_0x163398['id'],'type':_0x14c1fa[_0xf1ec('0x3d')],'sectionId':_0x14c1fa['id']},{})[_0xf1ec('0x39')](function(){return _0x352556;});}else{return _0x352556;}})[_0xf1ec('0x2b')](function(_0x317a65){logger['error'](_0xf1ec('0x68'),_0x317a65);throw _0x317a65;});}return _0x352556;})[_0xf1ec('0x39')](respondWithResult(_0x549fee,0xc9))[_0xf1ec('0x2b')](handleError(_0x549fee,null));};exports[_0xf1ec('0x38')]=function(_0x501485,_0x32eb42){if(_0x501485[_0xf1ec('0x5f')]['id']){delete _0x501485[_0xf1ec('0x5f')]['id'];}return db[_0xf1ec('0x43')][_0xf1ec('0x5d')]({'where':{'id':_0x501485[_0xf1ec('0x5a')]['id']},'include':[{'model':db[_0xf1ec('0x40')],'as':_0xf1ec('0x41')}]})[_0xf1ec('0x39')](handleEntityNotFound(_0x32eb42,null))['then'](saveUpdates(_0x501485[_0xf1ec('0x5f')],null))[_0xf1ec('0x39')](respondWithResult(_0x32eb42,null))['catch'](handleError(_0x32eb42,null));};exports[_0xf1ec('0x3b')]=function(_0x3073ab,_0x31b9cb){return db[_0xf1ec('0x43')][_0xf1ec('0x5d')]({'where':{'id':_0x3073ab[_0xf1ec('0x5a')]['id']}})[_0xf1ec('0x39')](handleEntityNotFound(_0x31b9cb,null))[_0xf1ec('0x39')](removeEntity(_0x31b9cb,null))[_0xf1ec('0x2b')](handleError(_0x31b9cb,null));};exports['describe']=function(_0x2fadf4,_0x47533d){return db['WhatsappAccount']['describe']()[_0xf1ec('0x39')](respondWithResult(_0x47533d,null))[_0xf1ec('0x2b')](handleError(_0x47533d,null));};exports[_0xf1ec('0x69')]=function(_0x8c8117,_0x1ab4a5,_0x33df5f){if(_0x8c8117[_0xf1ec('0x5f')]['id']){delete _0x8c8117['body']['id'];}return db[_0xf1ec('0x43')][_0xf1ec('0x5d')]({'where':{'id':_0x8c8117[_0xf1ec('0x5a')]['id']}})['then'](handleEntityNotFound(_0x1ab4a5,null))[_0xf1ec('0x39')](function(_0x842b42){if(_0x842b42){_0x8c8117[_0xf1ec('0x5f')]['WhatsappAccountId']=_0x842b42['id'];return db[_0xf1ec('0x6a')][_0xf1ec('0x5e')](_0x8c8117[_0xf1ec('0x5f')]);}})['then'](respondWithResult(_0x1ab4a5,null))[_0xf1ec('0x2b')](handleError(_0x1ab4a5,null));};exports[_0xf1ec('0x6b')]=function(_0x525a39,_0xf9a162,_0x50cc5a){var _0x22aeea={'raw':![],'where':{}};var _0x5b12f5={};var _0x48f47b={'count':0x0,'rows':[]};return db[_0xf1ec('0x43')]['findOne']({'where':{'id':_0x525a39[_0xf1ec('0x5a')]['id']}})[_0xf1ec('0x39')](handleEntityNotFound(_0xf9a162,null))['then'](function(_0x59add1){if(_0x59add1){_0x5b12f5[_0xf1ec('0x4c')]=_['keys'](db['Disposition']['rawAttributes']);_0x5b12f5[_0xf1ec('0x49')]=_['keys'](_0x525a39[_0xf1ec('0x49')]);_0x5b12f5[_0xf1ec('0x4a')]=_['intersection'](_0x5b12f5[_0xf1ec('0x4c')],_0x5b12f5[_0xf1ec('0x49')]);_0x22aeea['attributes']=_['intersection'](_0x5b12f5[_0xf1ec('0x4c')],qs['fields'](_0x525a39['query'][_0xf1ec('0x4e')]));_0x22aeea['attributes']=_0x22aeea[_0xf1ec('0x4d')][_0xf1ec('0x5b')]?_0x22aeea[_0xf1ec('0x4d')]:_0x5b12f5[_0xf1ec('0x4c')];if(!_0x525a39[_0xf1ec('0x49')]['hasOwnProperty'](_0xf1ec('0x50'))){_0x22aeea['limit']=qs[_0xf1ec('0x31')](_0x525a39[_0xf1ec('0x49')][_0xf1ec('0x31')]);_0x22aeea[_0xf1ec('0x2f')]=qs[_0xf1ec('0x2f')](_0x525a39['query'][_0xf1ec('0x2f')]);}_0x22aeea[_0xf1ec('0x51')]=qs[_0xf1ec('0x52')](_0x525a39[_0xf1ec('0x49')]['sort']);_0x22aeea[_0xf1ec('0x53')]=qs[_0xf1ec('0x4a')](_['pick'](_0x525a39[_0xf1ec('0x49')],_0x5b12f5['filters']));_0x22aeea[_0xf1ec('0x53')][_0xf1ec('0x6c')]=_0x59add1['id'];if(_0x525a39[_0xf1ec('0x49')][_0xf1ec('0x54')]){_0x22aeea['where']=_[_0xf1ec('0x55')](_0x22aeea['where'],{'$or':_['map'](_0x22aeea[_0xf1ec('0x4d')],function(_0x3ca57d){var _0x4523ef={};_0x4523ef[_0x3ca57d]={'$like':'%'+_0x525a39[_0xf1ec('0x49')][_0xf1ec('0x54')]+'%'};return _0x4523ef;})});}_0x22aeea=_['merge']({},_0x22aeea,_0x525a39[_0xf1ec('0x5c')]);return db[_0xf1ec('0x6a')][_0xf1ec('0x32')]({'where':_0x22aeea['where']})[_0xf1ec('0x39')](function(_0x5252cf){_0x48f47b['count']=_0x5252cf;if(_0x525a39[_0xf1ec('0x49')][_0xf1ec('0x57')]){_0x22aeea[_0xf1ec('0x58')]=[{'all':!![]}];}return db[_0xf1ec('0x6a')][_0xf1ec('0x59')](_0x22aeea);})['then'](function(_0x1e0a57){_0x48f47b[_0xf1ec('0x6d')]=_0x1e0a57;return _0x48f47b;});}})['then'](respondWithFilteredResult(_0xf9a162,_0x22aeea))[_0xf1ec('0x2b')](handleError(_0xf9a162,null));};exports[_0xf1ec('0x6e')]=function(_0x23ed27,_0x33378a,_0x3aecbb){return db['WhatsappAccount'][_0xf1ec('0x5d')]({'where':{'id':_0x23ed27[_0xf1ec('0x5a')]['id']}})['then'](handleEntityNotFound(_0x33378a,null))['then'](function(_0x554091){if(_0x554091){return _0x554091['removeDispositions'](_0x23ed27[_0xf1ec('0x49')][_0xf1ec('0x6f')]);}})[_0xf1ec('0x39')](respondWithStatusCode(_0x33378a,null))[_0xf1ec('0x2b')](handleError(_0x33378a,null));};exports[_0xf1ec('0x70')]=function(_0xc76f4c,_0x40e19c,_0x3be3d5){if(_0xc76f4c[_0xf1ec('0x5f')]['id']){delete _0xc76f4c['body']['id'];}return db[_0xf1ec('0x43')]['find']({'where':{'id':_0xc76f4c[_0xf1ec('0x5a')]['id']}})['then'](handleEntityNotFound(_0x40e19c,null))['then'](function(_0x46e95a){if(_0x46e95a){_0xc76f4c[_0xf1ec('0x5f')][_0xf1ec('0x6c')]=_0x46e95a['id'];return db[_0xf1ec('0x71')]['create'](_0xc76f4c[_0xf1ec('0x5f')]);}})['then'](respondWithResult(_0x40e19c,null))[_0xf1ec('0x2b')](handleError(_0x40e19c,null));};exports[_0xf1ec('0x72')]=function(_0x154c9a,_0x415e1d,_0x55b99d){var _0x16e00f={'raw':![],'where':{}};var _0x560dbb={};var _0x36c7d3={'count':0x0,'rows':[]};return db[_0xf1ec('0x43')]['findOne']({'where':{'id':_0x154c9a[_0xf1ec('0x5a')]['id']}})[_0xf1ec('0x39')](handleEntityNotFound(_0x415e1d,null))['then'](function(_0x3b945f){if(_0x3b945f){_0x560dbb[_0xf1ec('0x4c')]=_['keys'](db[_0xf1ec('0x71')][_0xf1ec('0x44')]);_0x560dbb[_0xf1ec('0x49')]=_[_0xf1ec('0x48')](_0x154c9a[_0xf1ec('0x49')]);_0x560dbb[_0xf1ec('0x4a')]=_[_0xf1ec('0x4b')](_0x560dbb[_0xf1ec('0x4c')],_0x560dbb['query']);_0x16e00f[_0xf1ec('0x4d')]=_[_0xf1ec('0x4b')](_0x560dbb[_0xf1ec('0x4c')],qs[_0xf1ec('0x4e')](_0x154c9a['query'][_0xf1ec('0x4e')]));_0x16e00f[_0xf1ec('0x4d')]=_0x16e00f[_0xf1ec('0x4d')][_0xf1ec('0x5b')]?_0x16e00f[_0xf1ec('0x4d')]:_0x560dbb[_0xf1ec('0x4c')];if(!_0x154c9a[_0xf1ec('0x49')][_0xf1ec('0x4f')](_0xf1ec('0x50'))){_0x16e00f[_0xf1ec('0x31')]=qs['limit'](_0x154c9a[_0xf1ec('0x49')][_0xf1ec('0x31')]);_0x16e00f['offset']=qs[_0xf1ec('0x2f')](_0x154c9a[_0xf1ec('0x49')][_0xf1ec('0x2f')]);}_0x16e00f[_0xf1ec('0x51')]=qs[_0xf1ec('0x52')](_0x154c9a[_0xf1ec('0x49')][_0xf1ec('0x52')]);_0x16e00f[_0xf1ec('0x53')]=qs['filters'](_[_0xf1ec('0x73')](_0x154c9a[_0xf1ec('0x49')],_0x560dbb[_0xf1ec('0x4a')]));_0x16e00f[_0xf1ec('0x53')][_0xf1ec('0x6c')]=_0x3b945f['id'];if(_0x154c9a[_0xf1ec('0x49')][_0xf1ec('0x54')]){_0x16e00f[_0xf1ec('0x53')]=_[_0xf1ec('0x55')](_0x16e00f['where'],{'$or':_['map'](_0x16e00f[_0xf1ec('0x4d')],function(_0x30fa79){var _0xddb708={};_0xddb708[_0x30fa79]={'$like':'%'+_0x154c9a[_0xf1ec('0x49')][_0xf1ec('0x54')]+'%'};return _0xddb708;})});}_0x16e00f=_[_0xf1ec('0x55')]({},_0x16e00f,_0x154c9a[_0xf1ec('0x5c')]);return db['CannedAnswer'][_0xf1ec('0x32')]({'where':_0x16e00f['where']})['then'](function(_0x4237c9){_0x36c7d3['count']=_0x4237c9;if(_0x154c9a[_0xf1ec('0x49')]['includeAll']){_0x16e00f['include']=[{'all':!![]}];}return db[_0xf1ec('0x71')][_0xf1ec('0x59')](_0x16e00f);})[_0xf1ec('0x39')](function(_0x4d4c7f){_0x36c7d3[_0xf1ec('0x6d')]=_0x4d4c7f;return _0x36c7d3;});}})[_0xf1ec('0x39')](respondWithFilteredResult(_0x415e1d,_0x16e00f))[_0xf1ec('0x2b')](handleError(_0x415e1d,null));};exports['removeAnswers']=function(_0x1a0afa,_0x115b73,_0x1be266){return db[_0xf1ec('0x43')]['find']({'where':{'id':_0x1a0afa['params']['id']}})['then'](handleEntityNotFound(_0x115b73,null))[_0xf1ec('0x39')](function(_0x17dd51){if(_0x17dd51){return _0x17dd51[_0xf1ec('0x74')](_0x1a0afa[_0xf1ec('0x49')][_0xf1ec('0x6f')]);}})[_0xf1ec('0x39')](respondWithStatusCode(_0x115b73,null))['catch'](handleError(_0x115b73,null));};exports[_0xf1ec('0x75')]=function(_0x1c4780,_0x40f680,_0x6c6ba7){return db['WhatsappAccount']['find']({'where':{'id':_0x1c4780[_0xf1ec('0x5a')]['id']}})['then'](handleEntityNotFound(_0x40f680,null))['then'](function(_0x4f72e5){if(_0x4f72e5){return _0x4f72e5[_0xf1ec('0x75')](_0x1c4780['body'][_0xf1ec('0x6f')],_[_0xf1ec('0x76')](_0x1c4780[_0xf1ec('0x5f')],['ids','id'])||{})[_0xf1ec('0x77')](function(_0x357c8a){for(var _0xbfe63e=0x0;_0xbfe63e<_0x1c4780[_0xf1ec('0x5f')]['ids']['length'];_0xbfe63e+=0x1){socket[_0xf1ec('0x78')]('userWhatsappAccount:save',{'UserId':Number(_0x1c4780[_0xf1ec('0x5f')][_0xf1ec('0x6f')][_0xbfe63e]),'WhatsappAccountId':Number(_0x1c4780[_0xf1ec('0x5a')]['id'])});}return _0x357c8a;});}})[_0xf1ec('0x39')](respondWithResult(_0x40f680,null))[_0xf1ec('0x2b')](handleError(_0x40f680,null));};exports['removeAgents']=function(_0x1f93e6,_0x30237c,_0x5d69ac){return db[_0xf1ec('0x43')]['find']({'where':{'id':_0x1f93e6[_0xf1ec('0x5a')]['id']}})[_0xf1ec('0x39')](handleEntityNotFound(_0x30237c,null))['then'](function(_0x349139){if(_0x349139){return _0x349139['removeAgents'](_0x1f93e6[_0xf1ec('0x49')][_0xf1ec('0x6f')])[_0xf1ec('0x39')](function(){if(_[_0xf1ec('0x79')](_0x1f93e6['query'][_0xf1ec('0x6f')])){for(var _0x15db44=0x0;_0x15db44<_0x1f93e6[_0xf1ec('0x49')][_0xf1ec('0x6f')][_0xf1ec('0x5b')];_0x15db44+=0x1){socket[_0xf1ec('0x78')](_0xf1ec('0x7a'),{'UserId':Number(_0x1f93e6[_0xf1ec('0x49')][_0xf1ec('0x6f')][_0x15db44]),'WhatsappAccountId':Number(_0x1f93e6[_0xf1ec('0x5a')]['id'])});}}else{socket[_0xf1ec('0x78')](_0xf1ec('0x7a'),{'UserId':Number(_0x1f93e6[_0xf1ec('0x49')][_0xf1ec('0x6f')]),'WhatsappAccountId':Number(_0x1f93e6[_0xf1ec('0x5a')]['id'])});}});}})[_0xf1ec('0x39')](respondWithStatusCode(_0x30237c,null))[_0xf1ec('0x2b')](handleError(_0x30237c,null));};exports[_0xf1ec('0x7b')]=function(_0x4a671a,_0x1c4ce9,_0x3183d8){var _0x3681e6={};var _0x4fb349={};var _0x2b74bb;var _0x25258a;return db[_0xf1ec('0x43')][_0xf1ec('0x7c')]({'where':{'id':_0x4a671a[_0xf1ec('0x5a')]['id']}})[_0xf1ec('0x39')](handleEntityNotFound(_0x1c4ce9,null))[_0xf1ec('0x39')](function(_0x156b7c){if(_0x156b7c){_0x2b74bb=_0x156b7c;_0x4fb349[_0xf1ec('0x4c')]=_[_0xf1ec('0x48')](db['User'][_0xf1ec('0x44')]);_0x4fb349[_0xf1ec('0x49')]=_[_0xf1ec('0x48')](_0x4a671a[_0xf1ec('0x49')]);_0x4fb349['filters']=_[_0xf1ec('0x4b')](_0x4fb349[_0xf1ec('0x4c')],_0x4fb349['query']);_0x3681e6[_0xf1ec('0x4d')]=_['intersection'](_0x4fb349[_0xf1ec('0x4c')],qs[_0xf1ec('0x4e')](_0x4a671a[_0xf1ec('0x49')][_0xf1ec('0x4e')]));_0x3681e6[_0xf1ec('0x4d')]=_0x3681e6[_0xf1ec('0x4d')]['length']?_0x3681e6['attributes']:_0x4fb349[_0xf1ec('0x4c')];_0x3681e6[_0xf1ec('0x51')]=qs[_0xf1ec('0x52')](_0x4a671a[_0xf1ec('0x49')]['sort']);_0x3681e6[_0xf1ec('0x53')]=qs[_0xf1ec('0x4a')](_[_0xf1ec('0x73')](_0x4a671a[_0xf1ec('0x49')],_0x4fb349[_0xf1ec('0x4a')]));if(_0x4a671a[_0xf1ec('0x49')]['filter']){_0x3681e6[_0xf1ec('0x53')]=_[_0xf1ec('0x55')](_0x3681e6[_0xf1ec('0x53')],{'$or':_[_0xf1ec('0x42')](_0x3681e6[_0xf1ec('0x4d')],function(_0x2d9c8b){var _0x48b4ad={};_0x48b4ad[_0x2d9c8b]={'$like':'%'+_0x4a671a[_0xf1ec('0x49')][_0xf1ec('0x54')]+'%'};return _0x48b4ad;})});}_0x3681e6=_['merge']({},_0x3681e6,_0x4a671a[_0xf1ec('0x5c')]);return _0x2b74bb[_0xf1ec('0x7b')](_0x3681e6);}})[_0xf1ec('0x39')](function(_0x35e131){if(_0x35e131){_0x25258a=_0x35e131['length'];if(!_0x4a671a['query'][_0xf1ec('0x4f')]('nolimit')){_0x3681e6[_0xf1ec('0x31')]=qs[_0xf1ec('0x31')](_0x4a671a[_0xf1ec('0x49')][_0xf1ec('0x31')]);_0x3681e6['offset']=qs['offset'](_0x4a671a[_0xf1ec('0x49')]['offset']);}return _0x2b74bb[_0xf1ec('0x7b')](_0x3681e6);}})['then'](function(_0x3bd8ab){if(_0x3bd8ab){return _0x3bd8ab?{'count':_0x25258a,'rows':_0x3bd8ab}:null;}})['then'](respondWithResult(_0x1c4ce9,null))[_0xf1ec('0x2b')](handleError(_0x1c4ce9,null));};exports[_0xf1ec('0x7d')]=function(_0x26d069,_0x148fe4,_0x3edc7d){return db[_0xf1ec('0x43')][_0xf1ec('0x7c')]({'where':{'id':_0x26d069[_0xf1ec('0x5a')]['id']}})[_0xf1ec('0x39')](handleEntityNotFound(_0x148fe4,null))[_0xf1ec('0x39')](function(_0x358ddf){if(_0x358ddf){return db[_0xf1ec('0x7e')][_0xf1ec('0x7f')](function(_0x2e1675){return db[_0xf1ec('0x80')][_0xf1ec('0x3b')]({'where':{'WhatsappAccountId':_0x26d069[_0xf1ec('0x5a')]['id']},'transaction':_0x2e1675})[_0xf1ec('0x39')](function(_0x3802b0){var _0x46488b=_[_0xf1ec('0x42')](_0x26d069[_0xf1ec('0x5f')],function(_0x58cf5a){_0x58cf5a[_0xf1ec('0x6c')]=_0x26d069['params']['id'];return _0x58cf5a;});return db[_0xf1ec('0x80')][_0xf1ec('0x81')](_0x46488b,{'transaction':_0x2e1675});});})[_0xf1ec('0x39')](function(){return db[_0xf1ec('0x80')]['findAndCountAll']({'where':{'WhatsappAccountId':_0x26d069[_0xf1ec('0x5a')]['id']},'order':_0xf1ec('0x82')});});}})[_0xf1ec('0x39')](respondWithResult(_0x148fe4,null))[_0xf1ec('0x2b')](handleError(_0x148fe4,null));};exports['getApplications']=function(_0x21aa42,_0x55e08c,_0x3a7169){var _0x412d3b={};var _0x61614c={};var _0x524669;var _0x28f16e;return db['WhatsappAccount']['findOne']({'where':{'id':_0x21aa42['params']['id']}})[_0xf1ec('0x39')](handleEntityNotFound(_0x55e08c,null))[_0xf1ec('0x39')](function(_0x435ed5){if(_0x435ed5){_0x524669=_0x435ed5;_0x61614c[_0xf1ec('0x4c')]=_[_0xf1ec('0x48')](db[_0xf1ec('0x80')][_0xf1ec('0x44')]);_0x61614c['query']=_[_0xf1ec('0x48')](_0x21aa42[_0xf1ec('0x49')]);_0x61614c[_0xf1ec('0x4a')]=_[_0xf1ec('0x4b')](_0x61614c['model'],_0x61614c[_0xf1ec('0x49')]);_0x412d3b[_0xf1ec('0x4d')]=_[_0xf1ec('0x4b')](_0x61614c[_0xf1ec('0x4c')],qs['fields'](_0x21aa42['query'][_0xf1ec('0x4e')]));_0x412d3b['attributes']=_0x412d3b['attributes'][_0xf1ec('0x5b')]?_0x412d3b[_0xf1ec('0x4d')]:_0x61614c[_0xf1ec('0x4c')];_0x412d3b[_0xf1ec('0x51')]=qs[_0xf1ec('0x52')](_0x21aa42['query'][_0xf1ec('0x52')]);_0x412d3b[_0xf1ec('0x53')]=qs[_0xf1ec('0x4a')](_[_0xf1ec('0x73')](_0x21aa42[_0xf1ec('0x49')],_0x61614c['filters']));if(_0x21aa42[_0xf1ec('0x49')]['filter']){_0x412d3b['where']=_['merge'](_0x412d3b[_0xf1ec('0x53')],{'$or':_[_0xf1ec('0x42')](_0x412d3b[_0xf1ec('0x4d')],function(_0x55f643){var _0x4374fa={};_0x4374fa[_0x55f643]={'$like':'%'+_0x21aa42['query'][_0xf1ec('0x54')]+'%'};return _0x4374fa;})});}_0x412d3b=_['merge']({},_0x412d3b,_0x21aa42[_0xf1ec('0x5c')]);return _0x524669[_0xf1ec('0x83')](_0x412d3b);}})[_0xf1ec('0x39')](function(_0x250232){if(_0x250232){_0x28f16e=_0x250232[_0xf1ec('0x5b')];if(!_0x21aa42[_0xf1ec('0x49')][_0xf1ec('0x4f')]('nolimit')){_0x412d3b[_0xf1ec('0x31')]=qs[_0xf1ec('0x31')](_0x21aa42[_0xf1ec('0x49')][_0xf1ec('0x31')]);_0x412d3b[_0xf1ec('0x2f')]=qs['offset'](_0x21aa42['query'][_0xf1ec('0x2f')]);}return _0x524669['getApplications'](_0x412d3b);}})['then'](function(_0x2baed2){if(_0x2baed2){return _0x2baed2?{'count':_0x28f16e,'rows':_0x2baed2}:null;}})[_0xf1ec('0x39')](respondWithResult(_0x55e08c,null))['catch'](handleError(_0x55e08c,null));};exports['notify']=function(_0x39c35b,_0x3c5014,_0x3152dd){var _0x4cb2bf={'channel':_0xf1ec('0x84')};var _0x54fbce=[];var _0x185b1d=[];var _0x1e48e6={};return db[_0xf1ec('0x43')][_0xf1ec('0x5d')]({'where':{'id':_0x39c35b['params']['id']},'include':[{'model':db[_0xf1ec('0x80')],'as':_0xf1ec('0x85')}]})['then'](handleEntityNotFound(_0x3c5014,null))[_0xf1ec('0x39')](function(_0x49034b){_0x4cb2bf['account']=_0x49034b;_0x4cb2bf[_0xf1ec('0x86')]=_[_0xf1ec('0x87')](_0x49034b[_0xf1ec('0x85')],[_0xf1ec('0x82')],[_0xf1ec('0x88')]);if(_0x4cb2bf[_0xf1ec('0x89')]['Applications']){delete _0x4cb2bf[_0xf1ec('0x89')][_0xf1ec('0x85')];}return db['CmContact'][_0xf1ec('0x8a')]();})[_0xf1ec('0x39')](function(_0xa07b82){if(!_0xa07b82){throw new db[(_0xf1ec('0x8b'))]['ValidationError'](_0xf1ec('0x8c'));}_0x54fbce=_[_0xf1ec('0x8d')](_[_0xf1ec('0x48')](_0xa07b82),[_0xf1ec('0x8e'),_0xf1ec('0x8f')]);_0x185b1d=_[_0xf1ec('0x8d')](_[_0xf1ec('0x48')](_0xa07b82),[_0xf1ec('0x8e'),_0xf1ec('0x8f'),_0xf1ec('0x90'),_0xf1ec('0x91')]);_0x4cb2bf['body']={'mapKey':_0xf1ec('0x92')};if(_0x4cb2bf[_0xf1ec('0x89')][_0xf1ec('0x46')]&&_0x4cb2bf[_0xf1ec('0x89')]['type']==='twilio'){_0x4cb2bf['body']['from']=_0x39c35b[_0xf1ec('0x5f')]['From'][_0xf1ec('0x93')](_0xf1ec('0x94'),'');_0x4cb2bf[_0xf1ec('0x5f')]['body']=_0x39c35b[_0xf1ec('0x5f')]['Body'];_0x4cb2bf['body'][_0xf1ec('0x95')]=_0x39c35b[_0xf1ec('0x5f')][_0xf1ec('0x96')];}if(_0x4cb2bf[_0xf1ec('0x5f')]['id']){delete _0x4cb2bf[_0xf1ec('0x5f')]['id'];}if(_[_0xf1ec('0x97')](_0x4cb2bf[_0xf1ec('0x5f')]['from'])){throw new db[(_0xf1ec('0x8b'))][(_0xf1ec('0x98'))](_0xf1ec('0x99'));}if(_['isNil'](_0x4cb2bf[_0xf1ec('0x5f')][_0xf1ec('0x5f')])||_0x4cb2bf['body'][_0xf1ec('0x5f')]===''){throw new db[(_0xf1ec('0x8b'))]['ValidationError'](_0xf1ec('0x9a'));}if(_[_0xf1ec('0x97')](_0x4cb2bf['body'][_0xf1ec('0x9b')])){throw new db['Sequelize'][(_0xf1ec('0x98'))](_0xf1ec('0x9c')+_0x185b1d);}if(!_['includes'](_0x185b1d,_0x4cb2bf['body'][_0xf1ec('0x9b')])){throw new db['Sequelize'][(_0xf1ec('0x98'))](_0xf1ec('0x9d')+_0x185b1d);}_0x1e48e6[_0x4cb2bf[_0xf1ec('0x5f')]['mapKey']]=_0x4cb2bf[_0xf1ec('0x5f')][_0xf1ec('0x9e')];return db[_0xf1ec('0x9f')][_0xf1ec('0x5d')]({'where':{'id':_0x4cb2bf['account'][_0xf1ec('0x91')]},'include':[{'model':db[_0xf1ec('0xa0')],'as':_0xf1ec('0xa1'),'where':_0x1e48e6,'limit':0x1,'order':[[_0xf1ec('0x8f'),_0xf1ec('0xa2')]]}]});})['then'](handleEntityNotFound(_0x3c5014,null))['then'](function(_0x2e1442){if(_0x2e1442){_0x4cb2bf[_0xf1ec('0xa3')]=_['omit'](_0x2e1442,[_0xf1ec('0xa1')]);if(_0x2e1442['Contacts'][_0xf1ec('0x5b')]){return _0x2e1442['Contacts'][0x0];}var _0x1ba65b=_[_0xf1ec('0xa4')](_0x4cb2bf[_0xf1ec('0x5f')],{'firstName':_0x4cb2bf[_0xf1ec('0x5f')][_0xf1ec('0x9e')],'ListId':_0x2e1442['id']});_0x1ba65b[_0x4cb2bf[_0xf1ec('0x5f')][_0xf1ec('0x9b')]]=_0x4cb2bf[_0xf1ec('0x5f')]['from'];return db[_0xf1ec('0xa0')][_0xf1ec('0x5e')](_0x1ba65b,{'fields':_0x54fbce,'raw':!![]});}})[_0xf1ec('0x39')](handleEntityNotFound(_0x3c5014,null))[_0xf1ec('0x39')](function(_0x49c993){if(_0x49c993){_0x4cb2bf[_0xf1ec('0xa5')]=_0x49c993;var _0x37661d={'ContactId':_0x49c993['id'],'phone':_0x4cb2bf[_0xf1ec('0x5f')][_0xf1ec('0x9e')],'WhatsappAccountId':_0x39c35b[_0xf1ec('0x5a')]['id']};var _0x2d1715={'ContactId':_0x49c993['id'],'WhatsappAccountId':_0x39c35b[_0xf1ec('0x5a')]['id'],'closed':![]};return db[_0xf1ec('0xa6')][_0xf1ec('0x5d')]({'where':_0x2d1715})[_0xf1ec('0x39')](function(_0x527fa7){if(_0x527fa7){return[_0x527fa7,![]];}return db[_0xf1ec('0xa6')][_0xf1ec('0x5e')](_0x37661d)['then'](function(_0x2b0083){return[_0x2b0083,!![]];});});}})[_0xf1ec('0x77')](function(_0x371520,_0x60113d){_0x4cb2bf['interaction']=_0x371520[_0xf1ec('0x3a')]({'plain':!![]});_0x4cb2bf['interaction'][_0xf1ec('0xa7')]=![];if(_0x60113d){if(_0x4cb2bf['account'][_0xf1ec('0xa8')]){_0x4cb2bf[_0xf1ec('0x86')]['push']({'id':0x0,'priority':_0x4cb2bf['applications']['length']+0x1,'app':'close','appdata':'unmanaged','interval':_0xf1ec('0xa9')});}_0x4cb2bf[_0xf1ec('0xaa')][_0xf1ec('0xa7')]=!![];}return db['WhatsappMessage'][_0xf1ec('0x5e')]({'phone':_0x4cb2bf[_0xf1ec('0x5f')][_0xf1ec('0x9e')],'messageId':_0x4cb2bf[_0xf1ec('0x5f')][_0xf1ec('0x95')],'body':_0x4cb2bf[_0xf1ec('0x5f')][_0xf1ec('0x5f')],'WhatsappAccountId':_0x39c35b[_0xf1ec('0x5a')]['id'],'WhatsappInteractionId':_0x371520['id'],'direction':'in','ContactId':_0x371520[_0xf1ec('0xab')],'AttachmentId':_0x4cb2bf[_0xf1ec('0x5f')][_0xf1ec('0xac')]});})[_0xf1ec('0x39')](function(_0x4ff937){_0x4cb2bf[_0xf1ec('0x29')]=_0x4ff937;if(_0x4cb2bf[_0xf1ec('0xaa')]['UserId']){return db[_0xf1ec('0xad')][_0xf1ec('0x5d')]({'attributes':['id',_0xf1ec('0x3d')],'where':{'id':_0x4cb2bf[_0xf1ec('0xaa')]['UserId']}})[_0xf1ec('0x39')](function(_0x1b1c9a){if(_0x1b1c9a){_0x4cb2bf[_0xf1ec('0x86')][_0xf1ec('0xae')]({'id':0x0,'priority':0x0,'app':_0xf1ec('0xaf'),'appdata':_0x1b1c9a[_0xf1ec('0x3d')]+','+(_0x4cb2bf[_0xf1ec('0x89')][_0xf1ec('0xb0')]||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise(_0xf1ec('0xb1'),_0xf1ec('0xb2'),_0x4cb2bf);});}return respondWithRpcPromise(_0xf1ec('0xb1'),_0xf1ec('0xb2'),_0x4cb2bf);})[_0xf1ec('0x39')](function(_0x5be764){if(_0x5be764){var _0x89c140=0xc8;var _0x3d9288=_0xf1ec('0xb3');logger[_0xf1ec('0x22')](_0xf1ec('0x25'),_0x3d9288,_0x89c140,_0xf1ec('0xb4'));logger[_0xf1ec('0xb5')](_0xf1ec('0xb6'),_0x3d9288,_0x89c140,_0xf1ec('0xb4'),JSON[_0xf1ec('0x26')](_0x5be764));if(_0x4cb2bf[_0xf1ec('0x89')][_0xf1ec('0x46')]==='twilio'){return _0x3c5014[_0xf1ec('0x2c')](_0x89c140)[_0xf1ec('0x33')](_0xf1ec('0xb7'),'text/xml')['send']('\x0a');}else{return _0x3c5014['status'](_0x89c140)[_0xf1ec('0x2e')](_0x5be764);}}})[_0xf1ec('0x2b')](handleError(_0x3c5014,null));};exports[_0xf1ec('0x3e')]=function(_0x238551,_0x596cf7,_0x461240){var _0x351845,_0x39ce7c,_0x5a21ec;if(_['isNil'](_0x238551[_0xf1ec('0x5f')]['body'])||_0x238551['body']['body']===''){throw new db[(_0xf1ec('0x8b'))]['ValidationError'](_0xf1ec('0x9a'));}if(_[_0xf1ec('0x97')](_0x238551[_0xf1ec('0x5f')]['to'])){throw new db[(_0xf1ec('0x8b'))]['ValidationError'](_0xf1ec('0xb8'));}_0x351845=_0x238551[_0xf1ec('0x5f')]['to'];return db[_0xf1ec('0x43')][_0xf1ec('0x5d')]({'where':{'id':_0x238551[_0xf1ec('0x5a')]['id']},'include':[{'model':db['CmList'],'as':_0xf1ec('0xb9'),'include':[{'model':db[_0xf1ec('0xa0')],'as':'Contacts','where':{'mobile':_0x351845},'limit':0x1,'order':[[_0xf1ec('0x8f'),_0xf1ec('0xa2')]]}]}]})['then'](handleEntityNotFound(_0x596cf7,null))[_0xf1ec('0x39')](function(_0x107949){if(_0x107949&&_0x107949[_0xf1ec('0xb9')]){_0x39ce7c=_0x107949['get']({'plain':!![]});if(_0x39ce7c[_0xf1ec('0xb9')]&&_0x39ce7c['List'][_0xf1ec('0xa1')][_0xf1ec('0x5b')]){return _0x39ce7c[_0xf1ec('0xb9')][_0xf1ec('0xa1')][0x0];}return db[_0xf1ec('0xa0')][_0xf1ec('0x5e')](_[_0xf1ec('0xa4')](_0x238551[_0xf1ec('0x5f')],{'firstName':_0x351845,'mobile':_0x351845,'phone':_0x351845,'ListId':_0x39ce7c[_0xf1ec('0x91')]}));}})[_0xf1ec('0x39')](handleEntityNotFound(_0x596cf7,null))[_0xf1ec('0x39')](function(_0x1665ee){if(_0x1665ee){_0x5a21ec=_0x1665ee;return db[_0xf1ec('0xa6')]['find']({'where':{'ContactId':_0x5a21ec['id'],'closed':![],'WhatsappAccountId':_0x39ce7c['id']}})[_0xf1ec('0x39')](function(_0x3fc2f6){if(_0x3fc2f6){return[_0x3fc2f6,![]];}return db['WhatsappInteraction'][_0xf1ec('0x5e')]({'UserId':_0x238551[_0xf1ec('0x60')]['id'],'ContactId':_0x5a21ec['id'],'WhatsappAccountId':_0x39ce7c['id'],'phone':_0x351845,'firstMsgDirection':'out','Messages':[_[_0xf1ec('0x55')](_0x238551[_0xf1ec('0x5f')],{'read':![],'body':_0x238551['body'][_0xf1ec('0x5f')],'phone':_0x351845,'WhatsappAccountId':_0x39ce7c['id'],'UserId':_0x238551[_0xf1ec('0x60')]['id'],'ContactId':_0x5a21ec['id']})]},{'include':[{'model':db[_0xf1ec('0xba')],'as':_0xf1ec('0xbb')}]})['then'](function(_0x137550){return[_0x137550,!![]];});});}})[_0xf1ec('0x77')](function(_0x383bd9,_0xb93731){if(_0xb93731){return _0x383bd9;}return db['WhatsappMessage'][_0xf1ec('0x5e')](_[_0xf1ec('0x55')](_0x238551[_0xf1ec('0x5f')],{'read':![],'body':_0x238551[_0xf1ec('0x5f')]['body'],'phone':_0x351845,'WhatsappAccountId':_0x39ce7c['id'],'WhatsappInteractionId':_0x383bd9['id'],'UserId':_0x238551['user']['id'],'ContactId':_0x5a21ec['id']}))[_0xf1ec('0x39')](function(_0x30e708){_0x383bd9['dataValues'][_0xf1ec('0xbb')]=[];_0x383bd9[_0xf1ec('0xbc')][_0xf1ec('0xbb')]['push'](_0x30e708[_0xf1ec('0xbc')]);return _0x383bd9;});})['then'](respondWithResult(_0x596cf7,null))[_0xf1ec('0x2b')](handleError(_0x596cf7,null));}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.events.js b/server/api/whatsappAccount/whatsappAccount.events.js index c7ec9c6..444149b 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 _0x347f=['hasOwnProperty','exports','events','WhatsappAccount','setMaxListeners','save','update','remove','emit'];(function(_0xf54abe,_0x215158){var _0x1c579f=function(_0x557ec2){while(--_0x557ec2){_0xf54abe['push'](_0xf54abe['shift']());}};_0x1c579f(++_0x215158);}(_0x347f,0x14f));var _0xf347=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x347f[_0xa464c9];return _0x3d73c4;};'use strict';var EventEmitter=require(_0xf347('0x0'));var WhatsappAccount=require('../../mysqldb')['db'][_0xf347('0x1')];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents[_0xf347('0x2')](0x0);var events={'afterCreate':_0xf347('0x3'),'afterUpdate':_0xf347('0x4'),'afterDestroy':_0xf347('0x5')};function emitEvent(_0x48d103){return function(_0x18cf22,_0x445063,_0x4187d0){WhatsappAccountEvents[_0xf347('0x6')](_0x48d103+':'+_0x18cf22['id'],_0x18cf22);WhatsappAccountEvents[_0xf347('0x6')](_0x48d103,_0x18cf22);_0x4187d0(null);};}for(var e in events){if(events[_0xf347('0x7')](e)){var event=events[e];WhatsappAccount['hook'](e,emitEvent(event));}}module[_0xf347('0x8')]=WhatsappAccountEvents; \ No newline at end of file +var _0xb464=['save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','WhatsappAccount','setMaxListeners'];(function(_0x34f9a6,_0x4bf60b){var _0x5a94a2=function(_0x12e12a){while(--_0x12e12a){_0x34f9a6['push'](_0x34f9a6['shift']());}};_0x5a94a2(++_0x4bf60b);}(_0xb464,0x8b));var _0x4b46=function(_0xb19521,_0xe3a196){_0xb19521=_0xb19521-0x0;var _0x1d4ac6=_0xb464[_0xb19521];return _0x1d4ac6;};'use strict';var EventEmitter=require(_0x4b46('0x0'));var WhatsappAccount=require(_0x4b46('0x1'))['db'][_0x4b46('0x2')];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents[_0x4b46('0x3')](0x0);var events={'afterCreate':_0x4b46('0x4'),'afterUpdate':_0x4b46('0x5'),'afterDestroy':_0x4b46('0x6')};function emitEvent(_0x5634ff){return function(_0x39d3f8,_0x376af4,_0x409f7b){WhatsappAccountEvents[_0x4b46('0x7')](_0x5634ff+':'+_0x39d3f8['id'],_0x39d3f8);WhatsappAccountEvents[_0x4b46('0x7')](_0x5634ff,_0x39d3f8);_0x409f7b(null);};}for(var e in events){if(events[_0x4b46('0x8')](e)){var event=events[e];WhatsappAccount[_0x4b46('0x9')](e,emitEvent(event));}}module[_0x4b46('0xa')]=WhatsappAccountEvents; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.model.js b/server/api/whatsappAccount/whatsappAccount.model.js index 9b7143f..dee67ef 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 _0x7440=['define','WhatsappAccount','whatsapp_accounts','lodash','util','../../config/logger','api','request-promise','../../config/environment','exports'];(function(_0x5a52d5,_0x4186a8){var _0x1d5ef3=function(_0x329bca){while(--_0x329bca){_0x5a52d5['push'](_0x5a52d5['shift']());}};_0x1d5ef3(++_0x4186a8);}(_0x7440,0x1c5));var _0x0744=function(_0x5b8bb0,_0x1d91fa){_0x5b8bb0=_0x5b8bb0-0x0;var _0x1f1e5a=_0x7440[_0x5b8bb0];return _0x1f1e5a;};'use strict';var _=require(_0x0744('0x0'));var util=require(_0x0744('0x1'));var logger=require(_0x0744('0x2'))(_0x0744('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x0744('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x0744('0x5'));var attributes=require('./whatsappAccount.attributes');module[_0x0744('0x6')]=function(_0x39b833,_0x511b0a){return _0x39b833[_0x0744('0x7')](_0x0744('0x8'),attributes,{'tableName':_0x0744('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2d38=['request-promise','../../config/environment','./whatsappAccount.attributes','define','WhatsappAccount','lodash','util','moment'];(function(_0x4ed32d,_0x327695){var _0xf624df=function(_0x29518c){while(--_0x29518c){_0x4ed32d['push'](_0x4ed32d['shift']());}};_0xf624df(++_0x327695);}(_0x2d38,0x85));var _0x82d3=function(_0x59e7e0,_0x3ec148){_0x59e7e0=_0x59e7e0-0x0;var _0x26b058=_0x2d38[_0x59e7e0];return _0x26b058;};'use strict';var _=require(_0x82d3('0x0'));var util=require(_0x82d3('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x82d3('0x2'));var BPromise=require('bluebird');var rp=require(_0x82d3('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x82d3('0x4'));var attributes=require(_0x82d3('0x5'));module['exports']=function(_0x591150,_0x9341aa){return _0x591150[_0x82d3('0x6')](_0x82d3('0x7'),attributes,{'tableName':'whatsapp_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.rpc.js b/server/api/whatsappAccount/whatsappAccount.rpc.js index 25b39e6..7712d86 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 _0x44df=['model','then','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','defaults','localhost','socket.io-emitter','redis','./whatsappAccount.socket','register','request','WhatsappAccount,\x20%s,\x20%s','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','ShowWhatsappAccount','WhatsappAccount','find','options','raw','where','attributes','include','map'];(function(_0x867683,_0x5912bb){var _0x271eee=function(_0x57d889){while(--_0x57d889){_0x867683['push'](_0x867683['shift']());}};_0x271eee(++_0x5912bb);}(_0x44df,0x16a));var _0xf44d=function(_0x239a26,_0x43f0dd){_0x239a26=_0x239a26-0x0;var _0x79fc70=_0x44df[_0x239a26];return _0x79fc70;};'use strict';var _=require(_0xf44d('0x0'));var util=require('util');var moment=require(_0xf44d('0x1'));var BPromise=require(_0xf44d('0x2'));var rs=require(_0xf44d('0x3'));var fs=require('fs');var Redis=require(_0xf44d('0x4'));var db=require(_0xf44d('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xf44d('0x6'))(_0xf44d('0x7'));var config=require(_0xf44d('0x8'));var jayson=require(_0xf44d('0x9'));var client=jayson[_0xf44d('0xa')]['http']({'port':0x232a});config['redis']=_[_0xf44d('0xb')](config['redis'],{'host':_0xf44d('0xc'),'port':0x18eb});var socket=require(_0xf44d('0xd'))(new Redis(config[_0xf44d('0xe')]));require(_0xf44d('0xf'))[_0xf44d('0x10')](socket);function respondWithRpcPromise(_0x1fbbce,_0xd83d74,_0x189075){return new BPromise(function(_0x31c93b,_0x4be008){return client[_0xf44d('0x11')](_0x1fbbce,_0x189075)['then'](function(_0x1edc24){logger['info'](_0xf44d('0x12'),_0xd83d74,'request\x20sent');logger[_0xf44d('0x13')](_0xf44d('0x14'),_0xd83d74,_0xf44d('0x15'),JSON[_0xf44d('0x16')](_0x1edc24));if(_0x1edc24['error']){if(_0x1edc24[_0xf44d('0x17')][_0xf44d('0x18')]===0x1f4){logger['error'](_0xf44d('0x12'),_0xd83d74,_0x1edc24[_0xf44d('0x17')][_0xf44d('0x19')]);return _0x4be008(_0x1edc24[_0xf44d('0x17')][_0xf44d('0x19')]);}logger['error'](_0xf44d('0x12'),_0xd83d74,_0x1edc24[_0xf44d('0x17')][_0xf44d('0x19')]);return _0x31c93b(_0x1edc24[_0xf44d('0x17')]['message']);}else{logger[_0xf44d('0x1a')](_0xf44d('0x12'),_0xd83d74,_0xf44d('0x15'));_0x31c93b(_0x1edc24[_0xf44d('0x1b')]['message']);}})[_0xf44d('0x1c')](function(_0x7c38db){logger[_0xf44d('0x17')](_0xf44d('0x12'),_0xd83d74,_0x7c38db);_0x4be008(_0x7c38db);});});}exports[_0xf44d('0x1d')]=function(_0x5b7e1b){var _0x577212=this;return new Promise(function(_0x4569f5,_0x4f3b06){return db[_0xf44d('0x1e')][_0xf44d('0x1f')]({'raw':_0x5b7e1b[_0xf44d('0x20')]?_0x5b7e1b[_0xf44d('0x20')][_0xf44d('0x21')]===undefined?!![]:![]:!![],'where':_0x5b7e1b[_0xf44d('0x20')]?_0x5b7e1b[_0xf44d('0x20')][_0xf44d('0x22')]||null:null,'attributes':_0x5b7e1b[_0xf44d('0x20')]?_0x5b7e1b[_0xf44d('0x20')][_0xf44d('0x23')]||null:null,'include':_0x5b7e1b[_0xf44d('0x20')]?_0x5b7e1b['options'][_0xf44d('0x24')]?_[_0xf44d('0x25')](_0x5b7e1b[_0xf44d('0x20')]['include'],function(_0x4a0a8b){return{'model':db[_0x4a0a8b['model']],'as':_0x4a0a8b['as'],'attributes':_0x4a0a8b['attributes'],'include':_0x4a0a8b[_0xf44d('0x24')]?_[_0xf44d('0x25')](_0x4a0a8b['include'],function(_0x65c000){return{'model':db[_0x65c000[_0xf44d('0x26')]],'as':_0x65c000['as'],'attributes':_0x65c000[_0xf44d('0x23')],'include':_0x65c000['include']?_[_0xf44d('0x25')](_0x65c000[_0xf44d('0x24')],function(_0x1ab920){return{'model':db[_0x1ab920[_0xf44d('0x26')]],'as':_0x1ab920['as'],'attributes':_0x1ab920[_0xf44d('0x23')]};}):[]};}):[]};}):[]:[]})[_0xf44d('0x27')](function(_0x4a3618){logger['info'](_0xf44d('0x1d'),_0x5b7e1b);logger[_0xf44d('0x13')](_0xf44d('0x1d'),_0x5b7e1b,JSON['stringify'](_0x4a3618));_0x4569f5(_0x4a3618);})[_0xf44d('0x1c')](function(_0x4e9b26){logger[_0xf44d('0x17')]('ShowWhatsappAccount',_0x4e9b26[_0xf44d('0x19')],_0x5b7e1b);_0x4f3b06(_0x577212[_0xf44d('0x17')](0x1f4,_0x4e9b26['message']));});});}; \ No newline at end of file +var _0x4603=['WhatsappAccount','find','raw','options','attributes','include','map','model','then','lodash','util','moment','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./whatsappAccount.socket','request','info','WhatsappAccount,\x20%s,\x20%s','request\x20sent','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','ShowWhatsappAccount'];(function(_0x4c1f13,_0x1542c8){var _0x1a05a4=function(_0x28fdf7){while(--_0x28fdf7){_0x4c1f13['push'](_0x4c1f13['shift']());}};_0x1a05a4(++_0x1542c8);}(_0x4603,0x1a0));var _0x3460=function(_0x4ae38d,_0x1a4900){_0x4ae38d=_0x4ae38d-0x0;var _0x37e91a=_0x4603[_0x4ae38d];return _0x37e91a;};'use strict';var _=require(_0x3460('0x0'));var util=require(_0x3460('0x1'));var moment=require(_0x3460('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3460('0x3'));var db=require(_0x3460('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x3460('0x5'))(_0x3460('0x6'));var config=require(_0x3460('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x3460('0x8')][_0x3460('0x9')]({'port':0x232a});config[_0x3460('0xa')]=_[_0x3460('0xb')](config[_0x3460('0xa')],{'host':_0x3460('0xc'),'port':0x18eb});var socket=require(_0x3460('0xd'))(new Redis(config[_0x3460('0xa')]));require(_0x3460('0xe'))['register'](socket);function respondWithRpcPromise(_0x22011b,_0x5bfd86,_0x7afe02){return new BPromise(function(_0x18ee07,_0x5ccb5a){return client[_0x3460('0xf')](_0x22011b,_0x7afe02)['then'](function(_0x34c7e4){logger[_0x3460('0x10')](_0x3460('0x11'),_0x5bfd86,_0x3460('0x12'));logger[_0x3460('0x13')](_0x3460('0x14'),_0x5bfd86,_0x3460('0x12'),JSON[_0x3460('0x15')](_0x34c7e4));if(_0x34c7e4[_0x3460('0x16')]){if(_0x34c7e4[_0x3460('0x16')][_0x3460('0x17')]===0x1f4){logger[_0x3460('0x16')]('WhatsappAccount,\x20%s,\x20%s',_0x5bfd86,_0x34c7e4[_0x3460('0x16')][_0x3460('0x18')]);return _0x5ccb5a(_0x34c7e4['error']['message']);}logger[_0x3460('0x16')]('WhatsappAccount,\x20%s,\x20%s',_0x5bfd86,_0x34c7e4[_0x3460('0x16')][_0x3460('0x18')]);return _0x18ee07(_0x34c7e4[_0x3460('0x16')][_0x3460('0x18')]);}else{logger[_0x3460('0x10')](_0x3460('0x11'),_0x5bfd86,_0x3460('0x12'));_0x18ee07(_0x34c7e4[_0x3460('0x19')]['message']);}})[_0x3460('0x1a')](function(_0x380714){logger[_0x3460('0x16')](_0x3460('0x11'),_0x5bfd86,_0x380714);_0x5ccb5a(_0x380714);});});}exports[_0x3460('0x1b')]=function(_0x28d2c4){var _0x566234=this;return new Promise(function(_0x46b414,_0x39e5f7){return db[_0x3460('0x1c')][_0x3460('0x1d')]({'raw':_0x28d2c4['options']?_0x28d2c4['options'][_0x3460('0x1e')]===undefined?!![]:![]:!![],'where':_0x28d2c4[_0x3460('0x1f')]?_0x28d2c4['options']['where']||null:null,'attributes':_0x28d2c4[_0x3460('0x1f')]?_0x28d2c4[_0x3460('0x1f')][_0x3460('0x20')]||null:null,'include':_0x28d2c4['options']?_0x28d2c4[_0x3460('0x1f')][_0x3460('0x21')]?_[_0x3460('0x22')](_0x28d2c4[_0x3460('0x1f')][_0x3460('0x21')],function(_0xc6fcfe){return{'model':db[_0xc6fcfe[_0x3460('0x23')]],'as':_0xc6fcfe['as'],'attributes':_0xc6fcfe[_0x3460('0x20')],'include':_0xc6fcfe[_0x3460('0x21')]?_[_0x3460('0x22')](_0xc6fcfe['include'],function(_0x50c470){return{'model':db[_0x50c470['model']],'as':_0x50c470['as'],'attributes':_0x50c470['attributes'],'include':_0x50c470['include']?_[_0x3460('0x22')](_0x50c470['include'],function(_0x585e38){return{'model':db[_0x585e38['model']],'as':_0x585e38['as'],'attributes':_0x585e38[_0x3460('0x20')]};}):[]};}):[]};}):[]:[]})[_0x3460('0x24')](function(_0x1b9e82){logger[_0x3460('0x10')]('ShowWhatsappAccount',_0x28d2c4);logger['debug']('ShowWhatsappAccount',_0x28d2c4,JSON[_0x3460('0x15')](_0x1b9e82));_0x46b414(_0x1b9e82);})[_0x3460('0x1a')](function(_0x42569e){logger['error'](_0x3460('0x1b'),_0x42569e[_0x3460('0x18')],_0x28d2c4);_0x39e5f7(_0x566234[_0x3460('0x16')](0x1f4,_0x42569e[_0x3460('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.socket.js b/server/api/whatsappAccount/whatsappAccount.socket.js index 3eaef54..76947fc 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 _0xa9f3=['save','remove','update','removeListener','register','length','./whatsappAccount.events'];(function(_0x56f819,_0x4c5d0d){var _0x559026=function(_0x452787){while(--_0x452787){_0x56f819['push'](_0x56f819['shift']());}};_0x559026(++_0x4c5d0d);}(_0xa9f3,0x164));var _0x3a9f=function(_0x543d57,_0x12f714){_0x543d57=_0x543d57-0x0;var _0x463c33=_0xa9f3[_0x543d57];return _0x463c33;};'use strict';var WhatsappAccountEvents=require(_0x3a9f('0x0'));var events=[_0x3a9f('0x1'),_0x3a9f('0x2'),_0x3a9f('0x3')];function createListener(_0x2a3266,_0x486dfb){return function(_0x4471fd){_0x486dfb['emit'](_0x2a3266,_0x4471fd);};}function removeListener(_0x42c08e,_0x28a42d){return function(){WhatsappAccountEvents[_0x3a9f('0x4')](_0x42c08e,_0x28a42d);};}exports[_0x3a9f('0x5')]=function(_0x461572){for(var _0x325908=0x0,_0x2f501a=events[_0x3a9f('0x6')];_0x325908<_0x2f501a;_0x325908++){var _0x23a50c=events[_0x325908];var _0x4deb59=createListener('whatsappAccount:'+_0x23a50c,_0x461572);WhatsappAccountEvents['on'](_0x23a50c,_0x4deb59);}}; \ No newline at end of file +var _0xc316=['length','whatsappAccount:','./whatsappAccount.events','save','remove','emit','register'];(function(_0x3c0617,_0x9077fc){var _0x2e08b8=function(_0x370d46){while(--_0x370d46){_0x3c0617['push'](_0x3c0617['shift']());}};_0x2e08b8(++_0x9077fc);}(_0xc316,0xaa));var _0x6c31=function(_0x3b2f10,_0x34dc5f){_0x3b2f10=_0x3b2f10-0x0;var _0x563d79=_0xc316[_0x3b2f10];return _0x563d79;};'use strict';var WhatsappAccountEvents=require(_0x6c31('0x0'));var events=[_0x6c31('0x1'),_0x6c31('0x2'),'update'];function createListener(_0x3a3e3e,_0x4f09b8){return function(_0x3c0b61){_0x4f09b8[_0x6c31('0x3')](_0x3a3e3e,_0x3c0b61);};}function removeListener(_0x34a84c,_0x11ba3c){return function(){WhatsappAccountEvents['removeListener'](_0x34a84c,_0x11ba3c);};}exports[_0x6c31('0x4')]=function(_0x44f0af){for(var _0x3a1d4f=0x0,_0x2ac887=events[_0x6c31('0x5')];_0x3a1d4f<_0x2ac887;_0x3a1d4f++){var _0x5476e4=events[_0x3a1d4f];var _0x11ada2=createListener(_0x6c31('0x6')+_0x5476e4,_0x44f0af);WhatsappAccountEvents['on'](_0x5476e4,_0x11ada2);}}; \ No newline at end of file diff --git a/server/api/whatsappApplication/index.js b/server/api/whatsappApplication/index.js index c8af87f..b3d35da 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 _0x0c7a=['../../components/interaction/service','./whatsappApplication.controller','isAuthenticated','index','get','/:id','post','create','put','update','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service'];(function(_0x5d2ca9,_0x477b33){var _0x4378cb=function(_0x4b4ba2){while(--_0x4b4ba2){_0x5d2ca9['push'](_0x5d2ca9['shift']());}};_0x4378cb(++_0x477b33);}(_0x0c7a,0x188));var _0xa0c7=function(_0x30811c,_0x35c2c0){_0x30811c=_0x30811c-0x0;var _0x15b6b6=_0x0c7a[_0x30811c];return _0x15b6b6;};'use strict';var multer=require(_0xa0c7('0x0'));var util=require(_0xa0c7('0x1'));var path=require(_0xa0c7('0x2'));var timeout=require(_0xa0c7('0x3'));var express=require(_0xa0c7('0x4'));var router=express['Router']();var fs_extra=require(_0xa0c7('0x5'));var auth=require(_0xa0c7('0x6'));var interaction=require(_0xa0c7('0x7'));var config=require('../../config/environment');var controller=require(_0xa0c7('0x8'));router['get']('/',auth[_0xa0c7('0x9')](),controller[_0xa0c7('0xa')]);router[_0xa0c7('0xb')](_0xa0c7('0xc'),auth[_0xa0c7('0x9')](),controller['show']);router[_0xa0c7('0xd')]('/',auth[_0xa0c7('0x9')](),controller[_0xa0c7('0xe')]);router[_0xa0c7('0xf')](_0xa0c7('0xc'),auth[_0xa0c7('0x9')](),controller[_0xa0c7('0x10')]);router['delete']('/:id',auth[_0xa0c7('0x9')](),controller[_0xa0c7('0x11')]);module[_0xa0c7('0x12')]=router; \ No newline at end of file +var _0xd6a4=['path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','show','post','isAuthenticated','update','/:id','destroy','exports','multer','util'];(function(_0x463f89,_0xf317cf){var _0x1e0849=function(_0x1cd10b){while(--_0x1cd10b){_0x463f89['push'](_0x463f89['shift']());}};_0x1e0849(++_0xf317cf);}(_0xd6a4,0x1da));var _0x4d6a=function(_0x344aa4,_0x48570a){_0x344aa4=_0x344aa4-0x0;var _0x78b21e=_0xd6a4[_0x344aa4];return _0x78b21e;};'use strict';var multer=require(_0x4d6a('0x0'));var util=require(_0x4d6a('0x1'));var path=require(_0x4d6a('0x2'));var timeout=require('connect-timeout');var express=require(_0x4d6a('0x3'));var router=express['Router']();var fs_extra=require(_0x4d6a('0x4'));var auth=require(_0x4d6a('0x5'));var interaction=require(_0x4d6a('0x6'));var config=require(_0x4d6a('0x7'));var controller=require('./whatsappApplication.controller');router[_0x4d6a('0x8')]('/',auth['isAuthenticated'](),controller[_0x4d6a('0x9')]);router[_0x4d6a('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x4d6a('0xa')]);router[_0x4d6a('0xb')]('/',auth['isAuthenticated'](),controller['create']);router['put']('/:id',auth[_0x4d6a('0xc')](),controller[_0x4d6a('0xd')]);router['delete'](_0x4d6a('0xe'),auth[_0x4d6a('0xc')](),controller[_0x4d6a('0xf')]);module[_0x4d6a('0x10')]=router; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.attributes.js b/server/api/whatsappApplication/whatsappApplication.attributes.js index 0192d13..89881d1 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 _0x412e=['exports','INTEGER','STRING','TEXT','sequelize'];(function(_0xc4001c,_0x1bf8f0){var _0x49f7bc=function(_0x1059b8){while(--_0x1059b8){_0xc4001c['push'](_0xc4001c['shift']());}};_0x49f7bc(++_0x1bf8f0);}(_0x412e,0x19e));var _0xe412=function(_0x5f2637,_0x1eec28){_0x5f2637=_0x5f2637-0x0;var _0x4c1c9d=_0x412e[_0x5f2637];return _0x4c1c9d;};'use strict';var Sequelize=require(_0xe412('0x0'));module[_0xe412('0x1')]={'priority':{'type':Sequelize[_0xe412('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0xe412('0x3')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0xe412('0x4')]()},'description':{'type':Sequelize[_0xe412('0x3')]},'interval':{'type':Sequelize['STRING'],'defaultValue':'*,*,*,*'}}; \ No newline at end of file +var _0xbba5=['*,*,*,*','sequelize','exports','INTEGER','TEXT','STRING'];(function(_0x103b91,_0x25f9da){var _0x281218=function(_0x51f68a){while(--_0x51f68a){_0x103b91['push'](_0x103b91['shift']());}};_0x281218(++_0x25f9da);}(_0xbba5,0x12d));var _0x5bba=function(_0x54bc3a,_0x399303){_0x54bc3a=_0x54bc3a-0x0;var _0x48bc30=_0xbba5[_0x54bc3a];return _0x48bc30;};'use strict';var Sequelize=require(_0x5bba('0x0'));module[_0x5bba('0x1')]={'priority':{'type':Sequelize[_0x5bba('0x2')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0x5bba('0x3')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x5bba('0x4')],'defaultValue':_0x5bba('0x5')}}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.controller.js b/server/api/whatsappApplication/whatsappApplication.controller.js index 3f98ce6..5083076 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 _0xaa64=['type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','map','VIRTUAL','includeAll','findAll','rows','catch','show','params','keys','find','create','body','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','index','WhatsappApplication','rawAttributes'];(function(_0x828292,_0x59c064){var _0x4bce04=function(_0x4f9619){while(--_0x4f9619){_0x828292['push'](_0x828292['shift']());}};_0x4bce04(++_0x59c064);}(_0xaa64,0xf7));var _0x4aa6=function(_0x38a730,_0x2e2b96){_0x38a730=_0x38a730-0x0;var _0x29ee99=_0xaa64[_0x38a730];return _0x29ee99;};'use strict';var emlformat=require(_0x4aa6('0x0'));var rimraf=require(_0x4aa6('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4aa6('0x2'));var rp=require('request-promise');var moment=require(_0x4aa6('0x3'));var BPromise=require(_0x4aa6('0x4'));var Mustache=require(_0x4aa6('0x5'));var util=require('util');var path=require(_0x4aa6('0x6'));var sox=require(_0x4aa6('0x7'));var csv=require(_0x4aa6('0x8'));var ejs=require(_0x4aa6('0x9'));var fs=require('fs');var fs_extra=require(_0x4aa6('0xa'));var _=require(_0x4aa6('0xb'));var squel=require(_0x4aa6('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x4aa6('0xd'));var toCsv=require(_0x4aa6('0x8'));var querystring=require('querystring');var Papa=require(_0x4aa6('0xe'));var Redis=require('ioredis');var authService=require(_0x4aa6('0xf'));var qs=require(_0x4aa6('0x10'));var as=require(_0x4aa6('0x11'));var hardwareService=require(_0x4aa6('0x12'));var logger=require('../../config/logger')(_0x4aa6('0x13'));var utils=require(_0x4aa6('0x14'));var config=require(_0x4aa6('0x15'));var licenseUtil=require(_0x4aa6('0x16'));var db=require(_0x4aa6('0x17'))['db'];function respondWithStatusCode(_0xa8dd06,_0x32401e){_0x32401e=_0x32401e||0xcc;return function(_0x14a12a){if(_0x14a12a){return _0xa8dd06[_0x4aa6('0x18')](_0x32401e);}return _0xa8dd06[_0x4aa6('0x19')](_0x32401e)['end']();};}function respondWithResult(_0x413222,_0x5b0133){_0x5b0133=_0x5b0133||0xc8;return function(_0x561f5d){if(_0x561f5d){return _0x413222[_0x4aa6('0x19')](_0x5b0133)[_0x4aa6('0x1a')](_0x561f5d);}};}function respondWithFilteredResult(_0x326953,_0x11e4d7){return function(_0x375c09){if(_0x375c09){var _0x238f10=typeof _0x11e4d7[_0x4aa6('0x1b')]===_0x4aa6('0x1c')&&typeof _0x11e4d7['limit']===_0x4aa6('0x1c');var _0x5458ad=_0x375c09[_0x4aa6('0x1d')];var _0x5c6d3c=_0x238f10?0x0:_0x11e4d7['offset'];var _0x266707=_0x238f10?_0x375c09[_0x4aa6('0x1d')]:_0x11e4d7[_0x4aa6('0x1b')]+_0x11e4d7[_0x4aa6('0x1e')];var _0x2aa5d7;if(_0x266707>=_0x5458ad){_0x266707=_0x5458ad;_0x2aa5d7=0xc8;}else{_0x2aa5d7=0xce;}_0x326953[_0x4aa6('0x19')](_0x2aa5d7);return _0x326953[_0x4aa6('0x1f')](_0x4aa6('0x20'),_0x5c6d3c+'-'+_0x266707+'/'+_0x5458ad)[_0x4aa6('0x1a')](_0x375c09);}return null;};}function patchUpdates(_0x4c9159){return function(_0x313e73){try{jsonpatch[_0x4aa6('0x21')](_0x313e73,_0x4c9159,!![]);}catch(_0x9a1a7e){return BPromise[_0x4aa6('0x22')](_0x9a1a7e);}return _0x313e73[_0x4aa6('0x23')]();};}function saveUpdates(_0x1e121f,_0x594665){return function(_0xa0f5be){if(_0xa0f5be){return _0xa0f5be[_0x4aa6('0x24')](_0x1e121f)[_0x4aa6('0x25')](function(_0x3af19f){return _0x3af19f;});}return null;};}function removeEntity(_0xa18442,_0x44d151){return function(_0x568a5c){if(_0x568a5c){return _0x568a5c[_0x4aa6('0x26')]()[_0x4aa6('0x25')](function(){_0xa18442['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x347856,_0x109a7c){return function(_0x3efa6b){if(!_0x3efa6b){_0x347856[_0x4aa6('0x18')](0x194);}return _0x3efa6b;};}function handleError(_0x2001ce,_0x5e53a7){_0x5e53a7=_0x5e53a7||0x1f4;return function(_0x44c6cf){logger[_0x4aa6('0x27')](_0x44c6cf[_0x4aa6('0x28')]);if(_0x44c6cf[_0x4aa6('0x29')]){delete _0x44c6cf[_0x4aa6('0x29')];}_0x2001ce[_0x4aa6('0x19')](_0x5e53a7)['send'](_0x44c6cf);};}exports[_0x4aa6('0x2a')]=function(_0x41bdc8,_0x5bc756){var _0x149c9a={},_0x121b97={},_0x2b629e={'count':0x0,'rows':[]};var _0x1fe9cb=_['map'](db[_0x4aa6('0x2b')][_0x4aa6('0x2c')],function(_0x3646c8){return{'name':_0x3646c8['fieldName'],'type':_0x3646c8[_0x4aa6('0x2d')][_0x4aa6('0x2e')]};});_0x121b97[_0x4aa6('0x2f')]=_['map'](_0x1fe9cb,_0x4aa6('0x29'));_0x121b97[_0x4aa6('0x30')]=_['keys'](_0x41bdc8[_0x4aa6('0x30')]);_0x121b97[_0x4aa6('0x31')]=_[_0x4aa6('0x32')](_0x121b97[_0x4aa6('0x2f')],_0x121b97[_0x4aa6('0x30')]);_0x149c9a['attributes']=_['intersection'](_0x121b97[_0x4aa6('0x2f')],qs[_0x4aa6('0x33')](_0x41bdc8[_0x4aa6('0x30')]['fields']));_0x149c9a['attributes']=_0x149c9a[_0x4aa6('0x34')][_0x4aa6('0x35')]?_0x149c9a[_0x4aa6('0x34')]:_0x121b97[_0x4aa6('0x2f')];if(!_0x41bdc8[_0x4aa6('0x30')][_0x4aa6('0x36')](_0x4aa6('0x37'))){_0x149c9a[_0x4aa6('0x1e')]=qs['limit'](_0x41bdc8[_0x4aa6('0x30')][_0x4aa6('0x1e')]);_0x149c9a[_0x4aa6('0x1b')]=qs[_0x4aa6('0x1b')](_0x41bdc8[_0x4aa6('0x30')][_0x4aa6('0x1b')]);}_0x149c9a['order']=qs[_0x4aa6('0x38')](_0x41bdc8[_0x4aa6('0x30')]['sort']);_0x149c9a[_0x4aa6('0x39')]=qs[_0x4aa6('0x31')](_[_0x4aa6('0x3a')](_0x41bdc8[_0x4aa6('0x30')],_0x121b97['filters']),_0x1fe9cb);if(_0x41bdc8['query'][_0x4aa6('0x3b')]){_0x149c9a[_0x4aa6('0x39')]=_[_0x4aa6('0x3c')](_0x149c9a['where'],{'$or':_[_0x4aa6('0x3d')](_0x1fe9cb,function(_0x2ad949){if(_0x2ad949['type']!==_0x4aa6('0x3e')){var _0x394319={};_0x394319[_0x2ad949[_0x4aa6('0x29')]]={'$like':'%'+_0x41bdc8[_0x4aa6('0x30')][_0x4aa6('0x3b')]+'%'};return _0x394319;}})});}_0x149c9a=_[_0x4aa6('0x3c')]({},_0x149c9a,_0x41bdc8['options']);var _0x47daed={'where':_0x149c9a[_0x4aa6('0x39')]};return db[_0x4aa6('0x2b')][_0x4aa6('0x1d')](_0x47daed)[_0x4aa6('0x25')](function(_0x14fb78){_0x2b629e['count']=_0x14fb78;if(_0x41bdc8[_0x4aa6('0x30')][_0x4aa6('0x3f')]){_0x149c9a['include']=[{'all':!![]}];}return db[_0x4aa6('0x2b')][_0x4aa6('0x40')](_0x149c9a);})[_0x4aa6('0x25')](function(_0x47787d){_0x2b629e[_0x4aa6('0x41')]=_0x47787d;return _0x2b629e;})['then'](respondWithFilteredResult(_0x5bc756,_0x149c9a))[_0x4aa6('0x42')](handleError(_0x5bc756,null));};exports[_0x4aa6('0x43')]=function(_0x599921,_0x3fefa6){var _0xb9572a={'raw':!![],'where':{'id':_0x599921[_0x4aa6('0x44')]['id']}},_0x5968d9={};_0x5968d9[_0x4aa6('0x2f')]=_['keys'](db[_0x4aa6('0x2b')][_0x4aa6('0x2c')]);_0x5968d9[_0x4aa6('0x30')]=_[_0x4aa6('0x45')](_0x599921[_0x4aa6('0x30')]);_0x5968d9[_0x4aa6('0x31')]=_[_0x4aa6('0x32')](_0x5968d9['model'],_0x5968d9[_0x4aa6('0x30')]);_0xb9572a[_0x4aa6('0x34')]=_[_0x4aa6('0x32')](_0x5968d9[_0x4aa6('0x2f')],qs[_0x4aa6('0x33')](_0x599921[_0x4aa6('0x30')][_0x4aa6('0x33')]));_0xb9572a[_0x4aa6('0x34')]=_0xb9572a['attributes'][_0x4aa6('0x35')]?_0xb9572a['attributes']:_0x5968d9[_0x4aa6('0x2f')];if(_0x599921[_0x4aa6('0x30')][_0x4aa6('0x3f')]){_0xb9572a['include']=[{'all':!![]}];}_0xb9572a=_[_0x4aa6('0x3c')]({},_0xb9572a,_0x599921['options']);return db['WhatsappApplication'][_0x4aa6('0x46')](_0xb9572a)[_0x4aa6('0x25')](handleEntityNotFound(_0x3fefa6,null))['then'](respondWithResult(_0x3fefa6,null))[_0x4aa6('0x42')](handleError(_0x3fefa6,null));};exports[_0x4aa6('0x47')]=function(_0x5788ae,_0x10affb){return db['WhatsappApplication']['create'](_0x5788ae[_0x4aa6('0x48')],{})['then'](respondWithResult(_0x10affb,0xc9))[_0x4aa6('0x42')](handleError(_0x10affb,null));};exports[_0x4aa6('0x24')]=function(_0x2fd2b8,_0x5a844f){if(_0x2fd2b8[_0x4aa6('0x48')]['id']){delete _0x2fd2b8[_0x4aa6('0x48')]['id'];}return db[_0x4aa6('0x2b')]['find']({'where':{'id':_0x2fd2b8['params']['id']}})[_0x4aa6('0x25')](handleEntityNotFound(_0x5a844f,null))[_0x4aa6('0x25')](saveUpdates(_0x2fd2b8[_0x4aa6('0x48')],null))['then'](respondWithResult(_0x5a844f,null))[_0x4aa6('0x42')](handleError(_0x5a844f,null));};exports[_0x4aa6('0x26')]=function(_0x23b33f,_0x25b9cc){return db['WhatsappApplication']['find']({'where':{'id':_0x23b33f[_0x4aa6('0x44')]['id']}})[_0x4aa6('0x25')](handleEntityNotFound(_0x25b9cc,null))[_0x4aa6('0x25')](removeEntity(_0x25b9cc,null))[_0x4aa6('0x42')](handleError(_0x25b9cc,null));}; \ No newline at end of file +var _0x980e=['catch','update','eml-format','fast-json-patch','moment','mustache','util','to-csv','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','then','sendStatus','error','stack','name','send','index','WhatsappApplication','rawAttributes','fieldName','type','map','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','show','params','includeAll','find','create','body'];(function(_0x4a7931,_0x4a19ce){var _0x37568d=function(_0x363fa1){while(--_0x363fa1){_0x4a7931['push'](_0x4a7931['shift']());}};_0x37568d(++_0x4a19ce);}(_0x980e,0x1a6));var _0xe980=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x980e[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xe980('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xe980('0x1'));var rp=require('request-promise');var moment=require(_0xe980('0x2'));var BPromise=require('bluebird');var Mustache=require(_0xe980('0x3'));var util=require(_0xe980('0x4'));var path=require('path');var sox=require('sox');var csv=require(_0xe980('0x5'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe980('0x6'));var squel=require(_0xe980('0x7'));var crypto=require(_0xe980('0x8'));var jsforce=require(_0xe980('0x9'));var deskjs=require(_0xe980('0xa'));var toCsv=require(_0xe980('0x5'));var querystring=require('querystring');var Papa=require(_0xe980('0xb'));var Redis=require(_0xe980('0xc'));var authService=require(_0xe980('0xd'));var qs=require('../../components/parsers/qs');var as=require(_0xe980('0xe'));var hardwareService=require(_0xe980('0xf'));var logger=require(_0xe980('0x10'))(_0xe980('0x11'));var utils=require(_0xe980('0x12'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x23c9cc,_0x234b1b){_0x234b1b=_0x234b1b||0xcc;return function(_0x58c367){if(_0x58c367){return _0x23c9cc['sendStatus'](_0x234b1b);}return _0x23c9cc[_0xe980('0x13')](_0x234b1b)[_0xe980('0x14')]();};}function respondWithResult(_0x22dc7b,_0x278b95){_0x278b95=_0x278b95||0xc8;return function(_0x21c5ff){if(_0x21c5ff){return _0x22dc7b[_0xe980('0x13')](_0x278b95)[_0xe980('0x15')](_0x21c5ff);}};}function respondWithFilteredResult(_0x4c3661,_0x5e7691){return function(_0x49771e){if(_0x49771e){var _0x594116=typeof _0x5e7691[_0xe980('0x16')]===_0xe980('0x17')&&typeof _0x5e7691[_0xe980('0x18')]===_0xe980('0x17');var _0x551a2c=_0x49771e[_0xe980('0x19')];var _0x1c6354=_0x594116?0x0:_0x5e7691[_0xe980('0x16')];var _0x538d32=_0x594116?_0x49771e['count']:_0x5e7691[_0xe980('0x16')]+_0x5e7691[_0xe980('0x18')];var _0x13e839;if(_0x538d32>=_0x551a2c){_0x538d32=_0x551a2c;_0x13e839=0xc8;}else{_0x13e839=0xce;}_0x4c3661[_0xe980('0x13')](_0x13e839);return _0x4c3661[_0xe980('0x1a')](_0xe980('0x1b'),_0x1c6354+'-'+_0x538d32+'/'+_0x551a2c)[_0xe980('0x15')](_0x49771e);}return null;};}function patchUpdates(_0x2b4c75){return function(_0x5f4db2){try{jsonpatch['apply'](_0x5f4db2,_0x2b4c75,!![]);}catch(_0x12ddc4){return BPromise[_0xe980('0x1c')](_0x12ddc4);}return _0x5f4db2[_0xe980('0x1d')]();};}function saveUpdates(_0x4f929f,_0x399973){return function(_0x31916b){if(_0x31916b){return _0x31916b['update'](_0x4f929f)[_0xe980('0x1e')](function(_0x261931){return _0x261931;});}return null;};}function removeEntity(_0x190d12,_0x4b7888){return function(_0xb9e91d){if(_0xb9e91d){return _0xb9e91d['destroy']()[_0xe980('0x1e')](function(){_0x190d12[_0xe980('0x13')](0xcc)[_0xe980('0x14')]();});}};}function handleEntityNotFound(_0x40a34e,_0x533ed6){return function(_0x11e5dd){if(!_0x11e5dd){_0x40a34e[_0xe980('0x1f')](0x194);}return _0x11e5dd;};}function handleError(_0xdc9ad7,_0x4ac608){_0x4ac608=_0x4ac608||0x1f4;return function(_0x54e755){logger[_0xe980('0x20')](_0x54e755[_0xe980('0x21')]);if(_0x54e755['name']){delete _0x54e755[_0xe980('0x22')];}_0xdc9ad7['status'](_0x4ac608)[_0xe980('0x23')](_0x54e755);};}exports[_0xe980('0x24')]=function(_0x10f084,_0x3ef831){var _0x2a6e8a={},_0x43a7c2={},_0x4caf7c={'count':0x0,'rows':[]};var _0x36aa1d=_['map'](db[_0xe980('0x25')][_0xe980('0x26')],function(_0x421ef9){return{'name':_0x421ef9[_0xe980('0x27')],'type':_0x421ef9[_0xe980('0x28')]['key']};});_0x43a7c2['model']=_[_0xe980('0x29')](_0x36aa1d,_0xe980('0x22'));_0x43a7c2[_0xe980('0x2a')]=_[_0xe980('0x2b')](_0x10f084[_0xe980('0x2a')]);_0x43a7c2[_0xe980('0x2c')]=_[_0xe980('0x2d')](_0x43a7c2[_0xe980('0x2e')],_0x43a7c2[_0xe980('0x2a')]);_0x2a6e8a[_0xe980('0x2f')]=_[_0xe980('0x2d')](_0x43a7c2['model'],qs['fields'](_0x10f084[_0xe980('0x2a')][_0xe980('0x30')]));_0x2a6e8a[_0xe980('0x2f')]=_0x2a6e8a['attributes'][_0xe980('0x31')]?_0x2a6e8a[_0xe980('0x2f')]:_0x43a7c2[_0xe980('0x2e')];if(!_0x10f084[_0xe980('0x2a')][_0xe980('0x32')](_0xe980('0x33'))){_0x2a6e8a[_0xe980('0x18')]=qs[_0xe980('0x18')](_0x10f084[_0xe980('0x2a')][_0xe980('0x18')]);_0x2a6e8a['offset']=qs['offset'](_0x10f084[_0xe980('0x2a')][_0xe980('0x16')]);}_0x2a6e8a['order']=qs[_0xe980('0x34')](_0x10f084['query'][_0xe980('0x34')]);_0x2a6e8a[_0xe980('0x35')]=qs[_0xe980('0x2c')](_[_0xe980('0x36')](_0x10f084[_0xe980('0x2a')],_0x43a7c2[_0xe980('0x2c')]),_0x36aa1d);if(_0x10f084['query'][_0xe980('0x37')]){_0x2a6e8a[_0xe980('0x35')]=_[_0xe980('0x38')](_0x2a6e8a[_0xe980('0x35')],{'$or':_[_0xe980('0x29')](_0x36aa1d,function(_0x51cf67){if(_0x51cf67[_0xe980('0x28')]!==_0xe980('0x39')){var _0x1faffe={};_0x1faffe[_0x51cf67['name']]={'$like':'%'+_0x10f084[_0xe980('0x2a')]['filter']+'%'};return _0x1faffe;}})});}_0x2a6e8a=_[_0xe980('0x38')]({},_0x2a6e8a,_0x10f084[_0xe980('0x3a')]);var _0x577d17={'where':_0x2a6e8a['where']};return db[_0xe980('0x25')][_0xe980('0x19')](_0x577d17)[_0xe980('0x1e')](function(_0x1a1d1f){_0x4caf7c[_0xe980('0x19')]=_0x1a1d1f;if(_0x10f084[_0xe980('0x2a')]['includeAll']){_0x2a6e8a[_0xe980('0x3b')]=[{'all':!![]}];}return db[_0xe980('0x25')][_0xe980('0x3c')](_0x2a6e8a);})['then'](function(_0x8e9b17){_0x4caf7c[_0xe980('0x3d')]=_0x8e9b17;return _0x4caf7c;})[_0xe980('0x1e')](respondWithFilteredResult(_0x3ef831,_0x2a6e8a))['catch'](handleError(_0x3ef831,null));};exports[_0xe980('0x3e')]=function(_0x710f6a,_0x528161){var _0x110c26={'raw':!![],'where':{'id':_0x710f6a[_0xe980('0x3f')]['id']}},_0x27d09d={};_0x27d09d[_0xe980('0x2e')]=_[_0xe980('0x2b')](db[_0xe980('0x25')]['rawAttributes']);_0x27d09d[_0xe980('0x2a')]=_[_0xe980('0x2b')](_0x710f6a[_0xe980('0x2a')]);_0x27d09d[_0xe980('0x2c')]=_['intersection'](_0x27d09d[_0xe980('0x2e')],_0x27d09d[_0xe980('0x2a')]);_0x110c26[_0xe980('0x2f')]=_[_0xe980('0x2d')](_0x27d09d[_0xe980('0x2e')],qs[_0xe980('0x30')](_0x710f6a['query'][_0xe980('0x30')]));_0x110c26[_0xe980('0x2f')]=_0x110c26[_0xe980('0x2f')][_0xe980('0x31')]?_0x110c26[_0xe980('0x2f')]:_0x27d09d[_0xe980('0x2e')];if(_0x710f6a[_0xe980('0x2a')][_0xe980('0x40')]){_0x110c26[_0xe980('0x3b')]=[{'all':!![]}];}_0x110c26=_[_0xe980('0x38')]({},_0x110c26,_0x710f6a[_0xe980('0x3a')]);return db[_0xe980('0x25')][_0xe980('0x41')](_0x110c26)[_0xe980('0x1e')](handleEntityNotFound(_0x528161,null))['then'](respondWithResult(_0x528161,null))['catch'](handleError(_0x528161,null));};exports[_0xe980('0x42')]=function(_0x40b9da,_0x5b2b7d){return db['WhatsappApplication'][_0xe980('0x42')](_0x40b9da[_0xe980('0x43')],{})[_0xe980('0x1e')](respondWithResult(_0x5b2b7d,0xc9))[_0xe980('0x44')](handleError(_0x5b2b7d,null));};exports[_0xe980('0x45')]=function(_0x5e1b39,_0x146208){if(_0x5e1b39[_0xe980('0x43')]['id']){delete _0x5e1b39[_0xe980('0x43')]['id'];}return db['WhatsappApplication']['find']({'where':{'id':_0x5e1b39[_0xe980('0x3f')]['id']}})[_0xe980('0x1e')](handleEntityNotFound(_0x146208,null))['then'](saveUpdates(_0x5e1b39[_0xe980('0x43')],null))['then'](respondWithResult(_0x146208,null))[_0xe980('0x44')](handleError(_0x146208,null));};exports['destroy']=function(_0x52c1b3,_0x4096f2){return db[_0xe980('0x25')][_0xe980('0x41')]({'where':{'id':_0x52c1b3[_0xe980('0x3f')]['id']}})[_0xe980('0x1e')](handleEntityNotFound(_0x4096f2,null))[_0xe980('0x1e')](removeEntity(_0x4096f2,null))['catch'](handleError(_0x4096f2,null));}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.model.js b/server/api/whatsappApplication/whatsappApplication.model.js index 55059c3..aabb9ef 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 _0xed1f=['request-promise','path','rimraf','../../config/environment','./whatsappApplication.attributes','exports','define','WhatsappApplication','whatsapp_applications','utf8mb4','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xed1f,0x6a));var _0xfed1=function(_0x556927,_0x34b53f){_0x556927=_0x556927-0x0;var _0x5f1235=_0xed1f[_0x556927];return _0x5f1235;};'use strict';var _=require(_0xfed1('0x0'));var util=require(_0xfed1('0x1'));var logger=require(_0xfed1('0x2'))(_0xfed1('0x3'));var moment=require(_0xfed1('0x4'));var BPromise=require(_0xfed1('0x5'));var rp=require(_0xfed1('0x6'));var fs=require('fs');var path=require(_0xfed1('0x7'));var rimraf=require(_0xfed1('0x8'));var config=require(_0xfed1('0x9'));var attributes=require(_0xfed1('0xa'));module[_0xfed1('0xb')]=function(_0x3d6706,_0x42751d){return _0x3d6706[_0xfed1('0xc')](_0xfed1('0xd'),attributes,{'tableName':_0xfed1('0xe'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xfed1('0xf'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0xd737=['utf8mb4_unicode_ci','lodash','../../config/logger','moment','bluebird','request-promise','../../config/environment','define','WhatsappApplication','whatsapp_applications','utf8mb4'];(function(_0x58fbb0,_0xe497b5){var _0x1783d2=function(_0x5554a8){while(--_0x5554a8){_0x58fbb0['push'](_0x58fbb0['shift']());}};_0x1783d2(++_0xe497b5);}(_0xd737,0x85));var _0x7d73=function(_0x45cd35,_0x41147c){_0x45cd35=_0x45cd35-0x0;var _0x16db84=_0xd737[_0x45cd35];return _0x16db84;};'use strict';var _=require(_0x7d73('0x0'));var util=require('util');var logger=require(_0x7d73('0x1'))('api');var moment=require(_0x7d73('0x2'));var BPromise=require(_0x7d73('0x3'));var rp=require(_0x7d73('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x7d73('0x5'));var attributes=require('./whatsappApplication.attributes');module['exports']=function(_0xaa37cc,_0x20b8a9){return _0xaa37cc[_0x7d73('0x6')](_0x7d73('0x7'),attributes,{'tableName':_0x7d73('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x7d73('0x9'),'collate':_0x7d73('0xa')});}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.rpc.js b/server/api/whatsappApplication/whatsappApplication.rpc.js index 57f9821..dc3fb5b 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 _0x0a9a=['WhatsappApplication,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','result','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request','then'];(function(_0x547302,_0x5c1853){var _0x120aa6=function(_0x54de1c){while(--_0x54de1c){_0x547302['push'](_0x547302['shift']());}};_0x120aa6(++_0x5c1853);}(_0x0a9a,0x183));var _0xa0a9=function(_0x2cea79,_0x4e0235){_0x2cea79=_0x2cea79-0x0;var _0x1ec338=_0x0a9a[_0x2cea79];return _0x1ec338;};'use strict';var _=require('lodash');var util=require(_0xa0a9('0x0'));var moment=require('moment');var BPromise=require(_0xa0a9('0x1'));var rs=require(_0xa0a9('0x2'));var fs=require('fs');var Redis=require(_0xa0a9('0x3'));var db=require(_0xa0a9('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xa0a9('0x5'))(_0xa0a9('0x6'));var config=require('../../config/environment');var jayson=require(_0xa0a9('0x7'));var client=jayson[_0xa0a9('0x8')][_0xa0a9('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x31d689,_0x499a29,_0x2b2eb4){return new BPromise(function(_0x520f42,_0x10aa8a){return client[_0xa0a9('0xa')](_0x31d689,_0x2b2eb4)[_0xa0a9('0xb')](function(_0x2d6ac0){logger['info'](_0xa0a9('0xc'),_0x499a29,_0xa0a9('0xd'));logger['debug']('WhatsappApplication,\x20%s,\x20%s,\x20%s',_0x499a29,_0xa0a9('0xd'),JSON[_0xa0a9('0xe')](_0x2d6ac0));if(_0x2d6ac0['error']){if(_0x2d6ac0[_0xa0a9('0xf')]['code']===0x1f4){logger[_0xa0a9('0xf')]('WhatsappApplication,\x20%s,\x20%s',_0x499a29,_0x2d6ac0[_0xa0a9('0xf')][_0xa0a9('0x10')]);return _0x10aa8a(_0x2d6ac0[_0xa0a9('0xf')][_0xa0a9('0x10')]);}logger[_0xa0a9('0xf')]('WhatsappApplication,\x20%s,\x20%s',_0x499a29,_0x2d6ac0[_0xa0a9('0xf')][_0xa0a9('0x10')]);return _0x520f42(_0x2d6ac0[_0xa0a9('0xf')][_0xa0a9('0x10')]);}else{logger[_0xa0a9('0x11')](_0xa0a9('0xc'),_0x499a29,'request\x20sent');_0x520f42(_0x2d6ac0[_0xa0a9('0x12')]['message']);}})['catch'](function(_0x347092){logger[_0xa0a9('0xf')](_0xa0a9('0xc'),_0x499a29,_0x347092);_0x10aa8a(_0x347092);});});} \ No newline at end of file +var _0x5c12=['../../config/environment','client','http','request','then','WhatsappApplication,\x20%s,\x20%s','request\x20sent','debug','WhatsappApplication,\x20%s,\x20%s,\x20%s','error','message','info','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x256422,_0x367394){var _0x55dddc=function(_0x1594bc){while(--_0x1594bc){_0x256422['push'](_0x256422['shift']());}};_0x55dddc(++_0x367394);}(_0x5c12,0x188));var _0x25c1=function(_0x523adf,_0x3e1620){_0x523adf=_0x523adf-0x0;var _0x283870=_0x5c12[_0x523adf];return _0x283870;};'use strict';var _=require('lodash');var util=require(_0x25c1('0x0'));var moment=require(_0x25c1('0x1'));var BPromise=require('bluebird');var rs=require(_0x25c1('0x2'));var fs=require('fs');var Redis=require(_0x25c1('0x3'));var db=require(_0x25c1('0x4'))['db'];var utils=require(_0x25c1('0x5'));var logger=require(_0x25c1('0x6'))(_0x25c1('0x7'));var config=require(_0x25c1('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x25c1('0x9')][_0x25c1('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x382922,_0x4ab674,_0x5c69b1){return new BPromise(function(_0x24981c,_0x3b69ba){return client[_0x25c1('0xb')](_0x382922,_0x5c69b1)[_0x25c1('0xc')](function(_0xf8363f){logger['info'](_0x25c1('0xd'),_0x4ab674,_0x25c1('0xe'));logger[_0x25c1('0xf')](_0x25c1('0x10'),_0x4ab674,_0x25c1('0xe'),JSON['stringify'](_0xf8363f));if(_0xf8363f[_0x25c1('0x11')]){if(_0xf8363f[_0x25c1('0x11')]['code']===0x1f4){logger[_0x25c1('0x11')](_0x25c1('0xd'),_0x4ab674,_0xf8363f[_0x25c1('0x11')][_0x25c1('0x12')]);return _0x3b69ba(_0xf8363f['error']['message']);}logger['error']('WhatsappApplication,\x20%s,\x20%s',_0x4ab674,_0xf8363f[_0x25c1('0x11')][_0x25c1('0x12')]);return _0x24981c(_0xf8363f[_0x25c1('0x11')][_0x25c1('0x12')]);}else{logger[_0x25c1('0x13')]('WhatsappApplication,\x20%s,\x20%s',_0x4ab674,_0x25c1('0xe'));_0x24981c(_0xf8363f['result']['message']);}})['catch'](function(_0x284712){logger[_0x25c1('0x11')]('WhatsappApplication,\x20%s,\x20%s',_0x4ab674,_0x284712);_0x3b69ba(_0x284712);});});} \ No newline at end of file diff --git a/server/api/whatsappInteraction/index.js b/server/api/whatsappInteraction/index.js index 5f968c6..299c35e 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 _0xd8fb=['/describe','describe','show','/:id/messages','getMessages','download','post','isAuthenticated','addMessage','/:id/tags','tracked','whatsapp','addTags','put','/:id','whatsappinteraction:update','delete','removeTags','multer','util','path','connect-timeout','../../components/auth/service','../../components/interaction/service','./whatsappInteraction.controller','get','index'];(function(_0x119670,_0x145fec){var _0x397a4f=function(_0x46aa27){while(--_0x46aa27){_0x119670['push'](_0x119670['shift']());}};_0x397a4f(++_0x145fec);}(_0xd8fb,0x99));var _0xbd8f=function(_0x5cc62f,_0x4f6d0f){_0x5cc62f=_0x5cc62f-0x0;var _0x3682f3=_0xd8fb[_0x5cc62f];return _0x3682f3;};'use strict';var multer=require(_0xbd8f('0x0'));var util=require(_0xbd8f('0x1'));var path=require(_0xbd8f('0x2'));var timeout=require(_0xbd8f('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xbd8f('0x4'));var interaction=require(_0xbd8f('0x5'));var config=require('../../config/environment');var controller=require(_0xbd8f('0x6'));router[_0xbd8f('0x7')]('/',auth['isAuthenticated'](),controller[_0xbd8f('0x8')]);router['get'](_0xbd8f('0x9'),auth['isAuthenticated'](),controller[_0xbd8f('0xa')]);router[_0xbd8f('0x7')]('/:id',auth['isAuthenticated'](),controller[_0xbd8f('0xb')]);router[_0xbd8f('0x7')](_0xbd8f('0xc'),auth['isAuthenticated'](),controller[_0xbd8f('0xd')]);router[_0xbd8f('0x7')]('/:id/download',auth['isAuthenticated'](),controller[_0xbd8f('0xe')]);router[_0xbd8f('0xf')]('/',auth[_0xbd8f('0x10')](),controller['create']);router[_0xbd8f('0xf')](_0xbd8f('0xc'),auth[_0xbd8f('0x10')](),controller[_0xbd8f('0x11')]);router[_0xbd8f('0xf')](_0xbd8f('0x12'),auth[_0xbd8f('0x10')](),interaction[_0xbd8f('0x13')](_0xbd8f('0x14'),'whatsappinteraction:addtags'),controller[_0xbd8f('0x15')]);router[_0xbd8f('0x16')](_0xbd8f('0x17'),auth[_0xbd8f('0x10')](),interaction['tracked'](_0xbd8f('0x14'),_0xbd8f('0x18')),controller['update']);router[_0xbd8f('0x19')](_0xbd8f('0x17'),auth['isAuthenticated'](),interaction[_0xbd8f('0x13')](_0xbd8f('0x14'),'whatsappinteraction:destroy'),controller['destroy']);router[_0xbd8f('0x19')]('/:id/tags',auth['isAuthenticated'](),controller[_0xbd8f('0x1a')]);module['exports']=router; \ No newline at end of file +var _0x0af5=['/:id/tags','removeTags','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappInteraction.controller','get','isAuthenticated','/describe','/:id','/:id/messages','/:id/download','download','create','post','addMessage','tracked','whatsappinteraction:addtags','addTags','update','delete','whatsapp','whatsappinteraction:destroy','destroy'];(function(_0x5abb22,_0xfa4088){var _0x5f09a6=function(_0x724e7c){while(--_0x724e7c){_0x5abb22['push'](_0x5abb22['shift']());}};_0x5f09a6(++_0xfa4088);}(_0x0af5,0x158));var _0x50af=function(_0x68f80f,_0x39dcd5){_0x68f80f=_0x68f80f-0x0;var _0x3889b8=_0x0af5[_0x68f80f];return _0x3889b8;};'use strict';var multer=require('multer');var util=require(_0x50af('0x0'));var path=require(_0x50af('0x1'));var timeout=require(_0x50af('0x2'));var express=require(_0x50af('0x3'));var router=express[_0x50af('0x4')]();var fs_extra=require(_0x50af('0x5'));var auth=require(_0x50af('0x6'));var interaction=require(_0x50af('0x7'));var config=require(_0x50af('0x8'));var controller=require(_0x50af('0x9'));router[_0x50af('0xa')]('/',auth[_0x50af('0xb')](),controller['index']);router['get'](_0x50af('0xc'),auth[_0x50af('0xb')](),controller['describe']);router['get'](_0x50af('0xd'),auth[_0x50af('0xb')](),controller['show']);router['get'](_0x50af('0xe'),auth[_0x50af('0xb')](),controller['getMessages']);router[_0x50af('0xa')](_0x50af('0xf'),auth[_0x50af('0xb')](),controller[_0x50af('0x10')]);router['post']('/',auth[_0x50af('0xb')](),controller[_0x50af('0x11')]);router[_0x50af('0x12')](_0x50af('0xe'),auth[_0x50af('0xb')](),controller[_0x50af('0x13')]);router['post']('/:id/tags',auth['isAuthenticated'](),interaction[_0x50af('0x14')]('whatsapp',_0x50af('0x15')),controller[_0x50af('0x16')]);router['put']('/:id',auth[_0x50af('0xb')](),interaction[_0x50af('0x14')]('whatsapp','whatsappinteraction:update'),controller[_0x50af('0x17')]);router[_0x50af('0x18')](_0x50af('0xd'),auth[_0x50af('0xb')](),interaction[_0x50af('0x14')](_0x50af('0x19'),_0x50af('0x1a')),controller[_0x50af('0x1b')]);router[_0x50af('0x18')](_0x50af('0x1c'),auth['isAuthenticated'](),controller[_0x50af('0x1d')]);module[_0x50af('0x1e')]=router; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.attributes.js b/server/api/whatsappInteraction/whatsappInteraction.attributes.js index 1a5fcda..d26fb67 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 _0x7a3e=['ENUM','BOOLEAN','sequelize','moment','exports','DATE','STRING','out'];(function(_0x41d58a,_0x1111e4){var _0x335202=function(_0x51fa27){while(--_0x51fa27){_0x41d58a['push'](_0x41d58a['shift']());}};_0x335202(++_0x1111e4);}(_0x7a3e,0x18a));var _0xe7a3=function(_0xbf3aba,_0x3f13e0){_0xbf3aba=_0xbf3aba-0x0;var _0xb7ed60=_0x7a3e[_0xbf3aba];return _0xb7ed60;};'use strict';var Sequelize=require(_0xe7a3('0x0'));var moment=require(_0xe7a3('0x1'));module[_0xe7a3('0x2')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xe7a3('0x3')]},'disposition':{'type':Sequelize[_0xe7a3('0x4')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0xe7a3('0x4')]},'phone':{'type':Sequelize[_0xe7a3('0x4')]},'read1stAt':{'type':Sequelize[_0xe7a3('0x3')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0xe7a3('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xe7a3('0x3')]},'lastMsgDirection':{'type':Sequelize[_0xe7a3('0x6')]('in',_0xe7a3('0x5')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0xe7a3('0x7')],'defaultValue':![]}}; \ No newline at end of file +var _0x7e4b=['moment','BOOLEAN','DATE','STRING','ENUM','out','sequelize'];(function(_0x2bfa32,_0x5acf11){var _0x4fc509=function(_0x46aa83){while(--_0x46aa83){_0x2bfa32['push'](_0x2bfa32['shift']());}};_0x4fc509(++_0x5acf11);}(_0x7e4b,0x84));var _0xb7e4=function(_0x88ee5c,_0x4289ad){_0x88ee5c=_0x88ee5c-0x0;var _0x27ba9f=_0x7e4b[_0x88ee5c];return _0x27ba9f;};'use strict';var Sequelize=require(_0xb7e4('0x0'));var moment=require(_0xb7e4('0x1'));module['exports']={'closed':{'type':Sequelize[_0xb7e4('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xb7e4('0x3')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0xb7e4('0x4')]},'thirdDisposition':{'type':Sequelize[_0xb7e4('0x4')]},'note':{'type':Sequelize[_0xb7e4('0x4')]},'phone':{'type':Sequelize[_0xb7e4('0x4')]},'read1stAt':{'type':Sequelize[_0xb7e4('0x3')]},'firstMsgDirection':{'type':Sequelize[_0xb7e4('0x5')]('in',_0xb7e4('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xb7e4('0x3')]},'lastMsgDirection':{'type':Sequelize[_0xb7e4('0x5')]('in','out'),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0xb7e4('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 b30fb6c..7826aa3 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 _0xa25a=['UserId','body','some','compact','isEmpty','WhatsappAccountId','where','i.WhatsappAccountId\x20IN\x20?','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','replace','isNumeric','i.phone\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','i.id','Sequelize','QueryTypes','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','t.id\x20IN\x20?','resolve','i.WhatsappAccountId\x20IS\x20NOT\x20NULL','user','role','getWhatsappAccounts','i.WhatsappAccountId\x20IS\x20NULL','agent','sequelize','toString','merge','a.key','Account.key','a.mandatoryDisposition','i.*','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.mobile','c.fax','Contact.fax','o.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','groupBy','WhatsappInteractionId','push','all','show','include','options','create','update','describe','addMessage','WhatsappMessage','params','ids','omit','getMessages','findOne','nolimit','filter','$gte','format','findAll','rows','addTags','spread','color','emit','whatsappInteractionTags:save','removeTags','download','unix','join','server','files','tmp','root','attachments','transcript-%d-%s.zip','firstName','lastName','Attachment','Messages','createdAt','direction','secret','WhatsappAccount','Account','get','Whatsapp','Owner','N.A.','YYYY-MM-DD\x20HH:mm:ss','basename','existsSync','createReadStream','pipe','createWriteStream','out','System','renderFile','transcript-','.pdf','createPdfFromHTML','log','err','unlinkSync','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','lodash','squel','desk.js','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/logger','api','../../config/environment','redis','defaults','localhost','register','sendStatus','end','status','json','undefined','count','offset','limit','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','send','map','fullname','Tags','TagIds','split','forEach','catch','index','WhatsappInteraction','rawAttributes','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','pick','select','field','from','u.id','u.fullname','ui.WhatsappInteractionId','user_has_whatsapp_interactions','left_join','u.id\x20=\x20ui.UserId','cm_contacts','o.id\x20=\x20i.UserId','whatsapp_accounts','a.id\x20=\x20i.WhatsappAccountId','whatsapp_messages','me.WhatsappInteractionId\x20=\x20i.id','whatsapp_interaction_has_tags','tools_tags','expr','search','parseSearch','sqlOperator','conditions','unreadMessages','value','having','`\x20=\x200','`\x20>\x200','Contact','operator','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','text','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','User','$substring','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','find'];(function(_0x4bd76e,_0x260c31){var _0x96a285=function(_0x28176d){while(--_0x28176d){_0x4bd76e['push'](_0x4bd76e['shift']());}};_0x96a285(++_0x260c31);}(_0xa25a,0x160));var _0xaa25=function(_0x149a9c,_0x571c3d){_0x149a9c=_0x149a9c-0x0;var _0x3e2c6a=_0xa25a[_0x149a9c];return _0x3e2c6a;};'use strict';var emlformat=require(_0xaa25('0x0'));var rimraf=require(_0xaa25('0x1'));var zipdir=require(_0xaa25('0x2'));var jsonpatch=require(_0xaa25('0x3'));var rp=require(_0xaa25('0x4'));var moment=require(_0xaa25('0x5'));var BPromise=require(_0xaa25('0x6'));var Mustache=require(_0xaa25('0x7'));var util=require(_0xaa25('0x8'));var path=require('path');var sox=require('sox');var csv=require(_0xaa25('0x9'));var ejs=require(_0xaa25('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xaa25('0xb'));var squel=require(_0xaa25('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xaa25('0xd'));var toCsv=require(_0xaa25('0x9'));var querystring=require('querystring');var Papa=require(_0xaa25('0xe'));var Redis=require('ioredis');var authService=require(_0xaa25('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xaa25('0x10'));var pdf=require(_0xaa25('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xaa25('0x12'))(_0xaa25('0x13'));var utils=require('../../config/utils');var config=require(_0xaa25('0x14'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0xaa25('0x15')]=_[_0xaa25('0x16')](config['redis'],{'host':_0xaa25('0x17'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xaa25('0x15')]));require('./whatsappInteraction.socket')[_0xaa25('0x18')](socket);function respondWithStatusCode(_0x47b953,_0x3ae3ab){_0x3ae3ab=_0x3ae3ab||0xcc;return function(_0x452084){if(_0x452084){return _0x47b953[_0xaa25('0x19')](_0x3ae3ab);}return _0x47b953['status'](_0x3ae3ab)[_0xaa25('0x1a')]();};}function respondWithResult(_0x18aad4,_0x9df15f){_0x9df15f=_0x9df15f||0xc8;return function(_0x475436){if(_0x475436){return _0x18aad4[_0xaa25('0x1b')](_0x9df15f)[_0xaa25('0x1c')](_0x475436);}};}function respondWithFilteredResult(_0x896a57,_0x40eac5){return function(_0x4d72d8){if(_0x4d72d8){var _0x4dd7f8=typeof _0x40eac5['offset']===_0xaa25('0x1d')&&typeof _0x40eac5['limit']==='undefined';var _0x5717dd=_0x4d72d8[_0xaa25('0x1e')];var _0x469947=_0x4dd7f8?0x0:_0x40eac5[_0xaa25('0x1f')];var _0x6b1964=_0x4dd7f8?_0x4d72d8[_0xaa25('0x1e')]:_0x40eac5['offset']+_0x40eac5[_0xaa25('0x20')];var _0x30e60e;if(_0x6b1964>=_0x5717dd){_0x6b1964=_0x5717dd;_0x30e60e=0xc8;}else{_0x30e60e=0xce;}_0x896a57[_0xaa25('0x1b')](_0x30e60e);return _0x896a57[_0xaa25('0x21')](_0xaa25('0x22'),_0x469947+'-'+_0x6b1964+'/'+_0x5717dd)['json'](_0x4d72d8);}return null;};}function patchUpdates(_0x445aa5){return function(_0x28dbbf){try{jsonpatch[_0xaa25('0x23')](_0x28dbbf,_0x445aa5,!![]);}catch(_0xcf1316){return BPromise[_0xaa25('0x24')](_0xcf1316);}return _0x28dbbf[_0xaa25('0x25')]();};}function saveUpdates(_0x143a5c,_0x5cd5f1){return function(_0xbdfabc){if(_0xbdfabc){return _0xbdfabc['update'](_0x143a5c)[_0xaa25('0x26')](function(_0x630afe){return _0x630afe;});}return null;};}function removeEntity(_0x51a974,_0x4d3863){return function(_0x430d0a){if(_0x430d0a){return _0x430d0a[_0xaa25('0x27')]()[_0xaa25('0x26')](function(){_0x51a974[_0xaa25('0x1b')](0xcc)[_0xaa25('0x1a')]();});}};}function handleEntityNotFound(_0x171c24,_0x27ff13){return function(_0x280856){if(!_0x280856){_0x171c24[_0xaa25('0x19')](0x194);}return _0x280856;};}function handleError(_0x8eb714,_0x1dcb09){_0x1dcb09=_0x1dcb09||0x1f4;return function(_0x146e28){logger[_0xaa25('0x28')](_0x146e28[_0xaa25('0x29')]);if(_0x146e28[_0xaa25('0x2a')]){delete _0x146e28[_0xaa25('0x2a')];}_0x8eb714[_0xaa25('0x1b')](_0x1dcb09)[_0xaa25('0x2b')](_0x146e28);};}function getInteractionUsers(_0x43f129,_0x681671){return new BPromise(function(_0xe7ed55,_0x4c7904){try{if(_0x681671[_0x43f129['id']]){_0x43f129['Users']=_[_0xaa25('0x2c')](_0x681671[_0x43f129['id']],function(_0x210b22){return{'id':_0x210b22['id'],'fullname':_0x210b22[_0xaa25('0x2d')]};});}}catch(_0x220bb6){_0x4c7904(_0x220bb6);}_0xe7ed55(_0x43f129);});}function getInteractionTags(_0x3ace3b,_0xe45ef6){return new BPromise(function(_0x1bbbe7,_0x5c7209){try{if(_0x3ace3b['TagIds']){_0x3ace3b[_0xaa25('0x2e')]=[];_0x3ace3b[_0xaa25('0x2f')][_0xaa25('0x30')](',')[_0xaa25('0x31')](function(_0x258cb9){_0x3ace3b[_0xaa25('0x2e')]['push'](_0xe45ef6[_0x258cb9]);});}delete _0x3ace3b[_0xaa25('0x2f')];}catch(_0x31cdf6){_0x5c7209(_0x31cdf6);}_0x1bbbe7(_0x3ace3b);});}function updateWhatsappInteraction(_0xcc157e,_0x49b733,_0x549ce4){return new BPromise(function(_0x5c80c7,_0x4c10db){return getInteractionUsers(_0xcc157e,_0x549ce4)[_0xaa25('0x26')](function(_0x4758d1){return getInteractionTags(_0x4758d1,_0x49b733);})[_0xaa25('0x26')](function(_0x625c24){_0x5c80c7(_0x625c24);})[_0xaa25('0x32')](function(_0x98ba31){_0x4c10db(_0x98ba31);});});}exports[_0xaa25('0x33')]=function(_0x1eba53,_0x481f70){var _0x301b0f={},_0x2579eb={},_0xe7503c={'count':0x0,'rows':[]};var _0xaff2ed=_[_0xaa25('0x2c')](db[_0xaa25('0x34')][_0xaa25('0x35')],function(_0x4e8e8c){return{'name':_0x4e8e8c['fieldName'],'type':_0x4e8e8c[_0xaa25('0x36')][_0xaa25('0x37')]};});_0x2579eb[_0xaa25('0x38')]=_[_0xaa25('0x2c')](_0xaff2ed,'name');_0x2579eb[_0xaa25('0x39')]=_[_0xaa25('0x3a')](_0x1eba53[_0xaa25('0x39')]);_0x2579eb[_0xaa25('0x3b')]=_['intersection'](_0x2579eb[_0xaa25('0x38')],_0x2579eb[_0xaa25('0x39')]);_0x301b0f[_0xaa25('0x3c')]=_[_0xaa25('0x3d')](_0x2579eb[_0xaa25('0x38')],qs[_0xaa25('0x3e')](_0x1eba53[_0xaa25('0x39')]['fields']));_0x301b0f[_0xaa25('0x3c')]=_0x301b0f[_0xaa25('0x3c')][_0xaa25('0x3f')]?_0x301b0f['attributes']:_0x2579eb[_0xaa25('0x38')];if(!_0x1eba53['query'][_0xaa25('0x40')]('nolimit')){_0x301b0f['limit']=qs['limit'](_0x1eba53['query'][_0xaa25('0x20')]);_0x301b0f[_0xaa25('0x1f')]=qs[_0xaa25('0x1f')](_0x1eba53[_0xaa25('0x39')][_0xaa25('0x1f')]);}_0x301b0f[_0xaa25('0x41')]=qs[_0xaa25('0x42')](_0x1eba53[_0xaa25('0x39')][_0xaa25('0x42')]);_0x301b0f['where']=qs[_0xaa25('0x3b')](_[_0xaa25('0x43')](_0x1eba53[_0xaa25('0x39')],_0x2579eb['filters']),_0xaff2ed);var _0x554b02=[];var _0x177d6d=squel[_0xaa25('0x44')]()[_0xaa25('0x45')]('id')[_0xaa25('0x45')]('name')['field']('color')[_0xaa25('0x46')]('tools_tags');var _0x57b043=squel[_0xaa25('0x44')]()[_0xaa25('0x45')](_0xaa25('0x47'))[_0xaa25('0x45')](_0xaa25('0x48'))[_0xaa25('0x45')](_0xaa25('0x49'))['from'](_0xaa25('0x4a'),'ui')[_0xaa25('0x4b')]('users','u',_0xaa25('0x4c'));var _0x20a276=squel[_0xaa25('0x44')]()[_0xaa25('0x46')]('whatsapp_interactions','i')['left_join'](_0xaa25('0x4d'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0xaa25('0x4b')]('users','o',_0xaa25('0x4e'))['left_join'](_0xaa25('0x4f'),'a',_0xaa25('0x50'))['left_join'](_0xaa25('0x51'),'me',_0xaa25('0x52'))[_0xaa25('0x4b')](_0xaa25('0x53'),'it','it.WhatsappInteractionId\x20=\x20i.id')[_0xaa25('0x4b')](_0xaa25('0x54'),'t','t.id\x20=\x20it.TagId');var _0x2834a6=squel[_0xaa25('0x55')]();var _0xd53b6b=[];var _0x14b6d4=squel[_0xaa25('0x55')]();var _0x181c61;if(_0x1eba53[_0xaa25('0x39')][_0xaa25('0x56')]){_0x181c61=as[_0xaa25('0x57')](_0x1eba53[_0xaa25('0x39')][_0xaa25('0x56')]);var _0x2aaa32=_0x181c61[_0xaa25('0x58')];for(var _0x25ae56=0x0;_0x25ae56<_0x181c61[_0xaa25('0x59')]['length'];_0x25ae56++){var _0x2b24eb=_0x181c61['conditions'][_0x25ae56];var _0x25278a='i';var _0x832eb4=_['find'](_0xaff2ed,['name',_0x2b24eb[_0xaa25('0x45')]]);if(!_0x832eb4){switch(_0x2b24eb[_0xaa25('0x45')]){case _0xaa25('0x5a'):if(_0x2b24eb[_0xaa25('0x5b')]==0x1){_0x20a276[_0xaa25('0x5c')]('`'+_0x2b24eb[_0xaa25('0x45')]+_0xaa25('0x5d'));}else{_0x20a276[_0xaa25('0x5c')]('`'+_0x2b24eb['field']+_0xaa25('0x5e'));}break;case _0xaa25('0x5f'):if(_0x2b24eb[_0xaa25('0x60')]==='$substring'){if(_0x2b24eb[_0xaa25('0x5b')][_0xaa25('0x30')]('\x20')[_0xaa25('0x3f')]>0x1){_0x2834a6[_0x2aaa32](_0xaa25('0x61'),qs[_0xaa25('0x62')](_0x2b24eb[_0xaa25('0x5b')]),null);}else{var _0x166df3='%'+_0x2b24eb['value']+'%';_0x2834a6[_0x2aaa32](_0xaa25('0x63'),_0x166df3,_0x166df3,_0x166df3);}}else{_0x832eb4=_['find'](_0xaff2ed,[_0xaa25('0x2a'),_0xaa25('0x64')]);_0x2b24eb[_0xaa25('0x45')]=_0xaa25('0x64');_0x21075e=as[_0xaa25('0x65')](_0x25278a,_0x832eb4['type'],_0x2b24eb);_0x2834a6[_0x2aaa32](_0x21075e[_0xaa25('0x66')],_0x21075e[_0xaa25('0x5b')][_0xaa25('0x67')],_0x21075e[_0xaa25('0x5b')]['end']);}break;case _0xaa25('0x68'):var _0x48907f=_0x2b24eb[_0xaa25('0x5b')]['split'](',')[_0xaa25('0x2c')](function(_0x1e0c68){return Number(_0x1e0c68);});_0x48907f['forEach'](function(_0x470504){_0x14b6d4['or'](_0xaa25('0x69'),'%,'+_0x470504+',%');});_0xd53b6b=_['union'](_0xd53b6b,_0x48907f);break;case _0xaa25('0x6a'):if(_0x2b24eb['operator']===_0xaa25('0x6b')){_0x2834a6[_0x2aaa32](_0xaa25('0x6c'),'%'+_0x2b24eb[_0xaa25('0x5b')]+'%',null);}else{_0x832eb4=_[_0xaa25('0x6d')](_0xaff2ed,[_0xaa25('0x2a'),_0xaa25('0x6e')]);_0x2b24eb['field']=_0xaa25('0x6e');_0x21075e=as[_0xaa25('0x65')](_0x25278a,_0x832eb4[_0xaa25('0x36')],_0x2b24eb);_0x2834a6[_0x2aaa32](_0x21075e[_0xaa25('0x66')],_0x21075e[_0xaa25('0x5b')][_0xaa25('0x67')],_0x21075e[_0xaa25('0x5b')]['end']);}break;case _0xaa25('0x6f'):_0x21075e=as['buildExpression']('me',null,_0x2b24eb);_0x2834a6[_0x2aaa32](_0x21075e['text'],_0x21075e['value']['start'],_0x21075e[_0xaa25('0x5b')][_0xaa25('0x1a')]);break;}}else{var _0x21075e=as['buildExpression'](_0x25278a,_0x832eb4[_0xaa25('0x36')],_0x2b24eb);_0x2834a6[_0x2aaa32](_0x21075e[_0xaa25('0x66')],_0x21075e['value']['start'],_0x21075e[_0xaa25('0x5b')][_0xaa25('0x1a')]);}}}else{var _0x3f76d6=_(_0x1eba53[_0xaa25('0x39')])[_0xaa25('0x3a')]()['map'](function(_0x3a6cf5){return _[_0xaa25('0x70')](_0xaff2ed,[_0xaa25('0x2a'),_0x3a6cf5])?_0x3a6cf5:undefined;})[_0xaa25('0x71')]()['value']();if(!_[_0xaa25('0x72')](_0x3f76d6)){_0x3f76d6[_0xaa25('0x31')](function(_0x213ef4){if(_0x213ef4===_0xaa25('0x73')){_0x20a276[_0xaa25('0x74')](_0xaa25('0x75'),[]['concat'](_0x1eba53[_0xaa25('0x39')][_0x213ef4]));}else if(_0x213ef4==='createdAt'){var _0x13e099=JSON[_0xaa25('0x76')](_0x1eba53['query'][_0x213ef4])['$gte'];var _0x1239e2=JSON[_0xaa25('0x76')](_0x1eba53[_0xaa25('0x39')][_0x213ef4])[_0xaa25('0x77')];_0x20a276[_0xaa25('0x74')](_0xaa25('0x78'),_0x13e099,_0x1239e2);}else{if(_0x1eba53[_0xaa25('0x39')][_0x213ef4]==='null'){_0x20a276['where']('i.'+_0x213ef4+_0xaa25('0x79'));}else{_0x20a276[_0xaa25('0x74')]('i.'+_0x213ef4+_0xaa25('0x7a'),_0x1eba53[_0xaa25('0x39')][_0x213ef4]);}}});}if(_0x1eba53[_0xaa25('0x39')][_0xaa25('0x7b')]){if(_0x1eba53['query'][_0xaa25('0x7b')]==0x1){_0x20a276[_0xaa25('0x5c')](_0xaa25('0x7c'));}else{_0x20a276[_0xaa25('0x5c')](_0xaa25('0x7d'));}}if(_0x1eba53[_0xaa25('0x39')][_0xaa25('0x7e')]){_0xd53b6b=_[_0xaa25('0x7f')](_0x1eba53[_0xaa25('0x39')][_0xaa25('0x7e')])?_0x1eba53[_0xaa25('0x39')][_0xaa25('0x7e')]:new Array(_0x1eba53[_0xaa25('0x39')][_0xaa25('0x7e')]);_0xd53b6b[_0xaa25('0x31')](function(_0x37e4c9){_0x14b6d4['or'](_0xaa25('0x69'),'%,'+_0x37e4c9+',%');});}if(_0x1eba53['query']['filter']){var _0x288fe6=_0x1eba53['query']['filter'][_0xaa25('0x80')]('\x5c','\x5c\x5c')[_0xaa25('0x80')](/'/g,'\x27\x27');if(qs[_0xaa25('0x81')](_0x288fe6)){_0x2834a6['or']('i.id\x20LIKE\x20?',_0x288fe6+'%')['or'](_0xaa25('0x82'),_0x288fe6+'%');}else{_0x2834a6['or'](_0xaa25('0x83'),qs[_0xaa25('0x62')](_0x288fe6))['or'](_0xaa25('0x84'),_0x288fe6+'%');}}}_0x20a276[_0xaa25('0x74')](_0x2834a6);_0x20a276['group'](_0xaa25('0x85'));var _0x1e5855={'type':db[_0xaa25('0x86')][_0xaa25('0x87')]['SELECT'],'raw':!![]};var _0x183731=_0x20a276['clone']();_0x183731[_0xaa25('0x45')](_0xaa25('0x85'));_0x183731[_0xaa25('0x45')](_0xaa25('0x88'),_0xaa25('0x5a'));if(_0x301b0f['order']){_0x301b0f[_0xaa25('0x41')]['forEach'](function(_0x2b2111){var _0x59bd6c=_0x2b2111[0x0]===_0xaa25('0x89')?_0x2b2111[0x0]:'i.'+_0x2b2111[0x0];_0x20a276[_0xaa25('0x41')](_0x59bd6c,_0x2b2111[0x1]==='DESC'?![]:!![]);});}if(!_[_0xaa25('0x72')](_0xd53b6b)){_0x20a276['having'](_0x14b6d4);_0x183731[_0xaa25('0x74')](_0xaa25('0x8a'),_0xd53b6b);}BPromise[_0xaa25('0x8b')]()[_0xaa25('0x26')](function(){if(!_0x181c61){if(_0x1eba53[_0xaa25('0x39')][_0xaa25('0x73')])return;_0x183731['where'](_0xaa25('0x8c'));_0x20a276['where'](_0xaa25('0x8c'));return;}if(_0x1eba53[_0xaa25('0x8d')][_0xaa25('0x8e')]!=='agent')return;return _0x1eba53['user'][_0xaa25('0x8f')]({'attributes':['id'],'raw':!![]})[_0xaa25('0x26')](function(_0x42b167){if(_[_0xaa25('0x72')](_0x42b167)){_0x183731['where'](_0xaa25('0x90'));_0x20a276[_0xaa25('0x74')](_0xaa25('0x90'));}else{_0x183731[_0xaa25('0x74')]('i.WhatsappAccountId\x20IN\x20?',_[_0xaa25('0x2c')](_0x42b167,'id'));_0x20a276[_0xaa25('0x74')](_0xaa25('0x75'),_[_0xaa25('0x2c')](_0x42b167,'id'));}});})[_0xaa25('0x26')](function(){if(_0x1eba53[_0xaa25('0x8d')]['role']===_0xaa25('0x91')&&!_0x181c61&&!_0x1eba53[_0xaa25('0x39')]['WhatsappAccountId'])return[];return db[_0xaa25('0x92')][_0xaa25('0x39')](_0x183731[_0xaa25('0x93')](),_0x1e5855);})['then'](function(_0x1c25c5){_0xe7503c[_0xaa25('0x1e')]=_0x1c25c5[_0xaa25('0x3f')];if(_0xe7503c['count']===0x0)return[];return db[_0xaa25('0x92')][_0xaa25('0x39')](_0x177d6d[_0xaa25('0x93')](),_0x1e5855)[_0xaa25('0x26')](function(_0x1d4090){_0x554b02=_['keyBy'](_0x1d4090,'id');_0x1e5855=_[_0xaa25('0x94')](_0x1e5855,{'model':db[_0xaa25('0x34')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x1eba53[_0xaa25('0x39')][_0xaa25('0x3e')]){_0x301b0f['attributes'][_0xaa25('0x31')](function(_0x129514){_0x20a276[_0xaa25('0x45')]('i.'+_0x129514);});}else{_0x20a276[_0xaa25('0x45')](_0xaa25('0x88'),_0xaa25('0x5a'));_0x20a276[_0xaa25('0x45')](_0xaa25('0x95'),_0xaa25('0x96'));_0x20a276[_0xaa25('0x45')](_0xaa25('0x97'),'Account.mandatoryDisposition');_0x20a276['field']('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',_0xaa25('0x89'));_0x20a276[_0xaa25('0x45')](_0xaa25('0x98'));_0x20a276[_0xaa25('0x45')]('c.firstName',_0xaa25('0x99'));_0x20a276[_0xaa25('0x45')](_0xaa25('0x9a'),_0xaa25('0x9b'));_0x20a276[_0xaa25('0x45')](_0xaa25('0x9c'),_0xaa25('0x9d'));_0x20a276['field']('c.phone','Contact.phone');_0x20a276['field'](_0xaa25('0x9e'),'Contact.mobile');_0x20a276[_0xaa25('0x45')](_0xaa25('0x9f'),_0xaa25('0xa0'));_0x20a276['field'](_0xaa25('0xa1'),'Owner.fullname');_0x20a276[_0xaa25('0x45')](_0xaa25('0xa2'),_0xaa25('0xa3'));_0x20a276[_0xaa25('0x45')](_0xaa25('0xa4'),_0xaa25('0x2f'));}if(_0x301b0f[_0xaa25('0x20')])_0x20a276[_0xaa25('0x20')](_0x301b0f[_0xaa25('0x20')]);if(_0x301b0f[_0xaa25('0x1f')])_0x20a276[_0xaa25('0x1f')](_0x301b0f[_0xaa25('0x1f')]);return db[_0xaa25('0x92')]['query'](_0x20a276[_0xaa25('0x93')](),_0x1e5855);})['then'](function(_0x3efa37){if(_0x3efa37[_0xaa25('0x3f')]>0x0)_0x57b043[_0xaa25('0x74')]('ui.WhatsappInteractionId\x20IN\x20?',_[_0xaa25('0x2c')](_0x3efa37,'id'));return db['sequelize']['query'](_0x57b043[_0xaa25('0x93')](),_0x1e5855)[_0xaa25('0x26')](function(_0x36c161){var _0x224f44=_[_0xaa25('0xa5')](_0x36c161,_0xaa25('0xa6'));var _0x7be15d=[];_0x3efa37['forEach'](function(_0x4ea678){_0x7be15d[_0xaa25('0xa7')](updateWhatsappInteraction(_0x4ea678,_0x554b02,_0x224f44));});return BPromise[_0xaa25('0xa8')](_0x7be15d);});});})['then'](function(_0x360876){_0xe7503c['rows']=_0x360876;return _0xe7503c;})[_0xaa25('0x26')](respondWithFilteredResult(_0x481f70,_0x301b0f))[_0xaa25('0x32')](handleError(_0x481f70,null));};exports[_0xaa25('0xa9')]=function(_0x18204b,_0x311662){var _0x178d4b={'raw':![],'where':{'id':_0x18204b['params']['id']}},_0x251627={};_0x251627[_0xaa25('0x38')]=_[_0xaa25('0x3a')](db[_0xaa25('0x34')]['rawAttributes']);_0x251627[_0xaa25('0x39')]=_[_0xaa25('0x3a')](_0x18204b[_0xaa25('0x39')]);_0x251627[_0xaa25('0x3b')]=_[_0xaa25('0x3d')](_0x251627[_0xaa25('0x38')],_0x251627[_0xaa25('0x39')]);_0x178d4b[_0xaa25('0x3c')]=_[_0xaa25('0x3d')](_0x251627[_0xaa25('0x38')],qs['fields'](_0x18204b[_0xaa25('0x39')][_0xaa25('0x3e')]));_0x178d4b[_0xaa25('0x3c')]=_0x178d4b[_0xaa25('0x3c')][_0xaa25('0x3f')]?_0x178d4b['attributes']:_0x251627[_0xaa25('0x38')];if(_0x18204b[_0xaa25('0x39')]['includeAll']){_0x178d4b[_0xaa25('0xaa')]=[{'all':!![]}];}_0x178d4b=_[_0xaa25('0x94')]({},_0x178d4b,_0x18204b[_0xaa25('0xab')]);return db[_0xaa25('0x34')][_0xaa25('0x6d')](_0x178d4b)[_0xaa25('0x26')](handleEntityNotFound(_0x311662,null))[_0xaa25('0x26')](respondWithResult(_0x311662,null))[_0xaa25('0x32')](handleError(_0x311662,null));};exports[_0xaa25('0xac')]=function(_0x1a5b66,_0x3803b3){return db[_0xaa25('0x34')]['create'](_0x1a5b66[_0xaa25('0x6f')],{})[_0xaa25('0x26')](respondWithResult(_0x3803b3,0xc9))[_0xaa25('0x32')](handleError(_0x3803b3,null));};exports[_0xaa25('0xad')]=function(_0x2ea384,_0x1b1621){if(_0x2ea384[_0xaa25('0x6f')]['id']){delete _0x2ea384[_0xaa25('0x6f')]['id'];}return db['WhatsappInteraction'][_0xaa25('0x6d')]({'where':{'id':_0x2ea384['params']['id']}})[_0xaa25('0x26')](handleEntityNotFound(_0x1b1621,null))['then'](saveUpdates(_0x2ea384['body'],null))['then'](respondWithResult(_0x1b1621,null))[_0xaa25('0x32')](handleError(_0x1b1621,null));};exports['destroy']=function(_0x3b25d7,_0x265acd){return db['WhatsappInteraction'][_0xaa25('0x6d')]({'where':{'id':_0x3b25d7['params']['id']}})[_0xaa25('0x26')](handleEntityNotFound(_0x265acd,null))[_0xaa25('0x26')](removeEntity(_0x265acd,null))[_0xaa25('0x32')](handleError(_0x265acd,null));};exports[_0xaa25('0xae')]=function(_0x28f418,_0xef2bc3){return db[_0xaa25('0x34')][_0xaa25('0xae')]()[_0xaa25('0x26')](respondWithResult(_0xef2bc3,null))[_0xaa25('0x32')](handleError(_0xef2bc3,null));};exports[_0xaa25('0xaf')]=function(_0x22b3a9,_0x132a7c,_0x4ee49b){return db[_0xaa25('0xb0')][_0xaa25('0x6d')]({'where':{'id':_0x22b3a9[_0xaa25('0xb1')]['id']}})[_0xaa25('0x26')](handleEntityNotFound(_0x132a7c,null))['then'](function(_0x1425a4){if(_0x1425a4){return _0x1425a4[_0xaa25('0xaf')](_0x22b3a9[_0xaa25('0x6f')][_0xaa25('0xb2')],_[_0xaa25('0xb3')](_0x22b3a9[_0xaa25('0x6f')],['ids','id'])||{});}})[_0xaa25('0x26')](respondWithResult(_0x132a7c,null))[_0xaa25('0x32')](handleError(_0x132a7c,null));};exports[_0xaa25('0xb4')]=function(_0x4603a2,_0x4224c5,_0x346414){var _0x4632dc={'raw':![],'where':{}};var _0x52c30c={};var _0x5994fa={'count':0x0,'rows':[]};return db['WhatsappInteraction'][_0xaa25('0xb5')]({'where':{'id':_0x4603a2['params']['id']}})[_0xaa25('0x26')](handleEntityNotFound(_0x4224c5,null))[_0xaa25('0x26')](function(_0x2273b0){if(_0x2273b0){_0x52c30c[_0xaa25('0x38')]=_[_0xaa25('0x3a')](db[_0xaa25('0xb0')][_0xaa25('0x35')]);_0x52c30c[_0xaa25('0x39')]=_[_0xaa25('0x3a')](_0x4603a2['query']);_0x52c30c[_0xaa25('0x3b')]=_['intersection'](_0x52c30c[_0xaa25('0x38')],_0x52c30c[_0xaa25('0x39')]);_0x4632dc[_0xaa25('0x3c')]=_[_0xaa25('0x3d')](_0x52c30c[_0xaa25('0x38')],qs['fields'](_0x4603a2[_0xaa25('0x39')][_0xaa25('0x3e')]));_0x4632dc[_0xaa25('0x3c')]=_0x4632dc['attributes'][_0xaa25('0x3f')]?_0x4632dc[_0xaa25('0x3c')]:_0x52c30c['model'];if(!_0x4603a2[_0xaa25('0x39')]['hasOwnProperty'](_0xaa25('0xb6'))){_0x4632dc[_0xaa25('0x20')]=qs[_0xaa25('0x20')](_0x4603a2[_0xaa25('0x39')]['limit']);_0x4632dc[_0xaa25('0x1f')]=qs[_0xaa25('0x1f')](_0x4603a2[_0xaa25('0x39')]['offset']);}_0x4632dc[_0xaa25('0x41')]=qs[_0xaa25('0x42')](_0x4603a2['query'][_0xaa25('0x42')]);_0x4632dc[_0xaa25('0x74')]=qs[_0xaa25('0x3b')](_[_0xaa25('0x43')](_0x4603a2['query'],_0x52c30c[_0xaa25('0x3b')]));_0x4632dc[_0xaa25('0x74')]['WhatsappInteractionId']=_0x2273b0['id'];if(_0x4603a2['query'][_0xaa25('0xb7')]){_0x4632dc[_0xaa25('0x74')]=_['merge'](_0x4632dc[_0xaa25('0x74')],{'$or':_['map'](_0x4632dc[_0xaa25('0x3c')],function(_0x4cc11e){var _0x5ea41c={};_0x5ea41c[_0x4cc11e]={'$like':'%'+_0x4603a2[_0xaa25('0x39')][_0xaa25('0xb7')]+'%'};return _0x5ea41c;})});}if(_0x4603a2[_0xaa25('0x39')]['$gte']){var _0x57639c=_0x4603a2['query'][_0xaa25('0xb8')][_0xaa25('0x30')](',');var _0x779c6d={};_0x779c6d[_0x57639c[0x0]]={'$gte':moment(_0x57639c[0x1])[_0xaa25('0xb9')]('YYYY-MM-DD\x20HH:mm:ss')};_0x4632dc[_0xaa25('0x74')]=_[_0xaa25('0x94')](_0x4632dc[_0xaa25('0x74')],_0x779c6d);}_0x4632dc=_[_0xaa25('0x94')]({},_0x4632dc,_0x4603a2[_0xaa25('0xab')]);return db[_0xaa25('0xb0')][_0xaa25('0x1e')]({'where':_0x4632dc[_0xaa25('0x74')]})[_0xaa25('0x26')](function(_0x35d97d){_0x5994fa[_0xaa25('0x1e')]=_0x35d97d;if(_0x4603a2[_0xaa25('0x39')]['includeAll']){_0x4632dc[_0xaa25('0xaa')]=[{'all':!![]}];}return db[_0xaa25('0xb0')][_0xaa25('0xba')](_0x4632dc);})[_0xaa25('0x26')](function(_0x4bf077){_0x5994fa[_0xaa25('0xbb')]=_0x4bf077;return _0x5994fa;});}})[_0xaa25('0x26')](respondWithFilteredResult(_0x4224c5,_0x4632dc))[_0xaa25('0x32')](handleError(_0x4224c5,null));};exports[_0xaa25('0xbc')]=function(_0x34e376,_0x524a9c,_0x2077f1){return db[_0xaa25('0x34')]['find']({'where':{'id':_0x34e376[_0xaa25('0xb1')]['id']}})[_0xaa25('0x26')](handleEntityNotFound(_0x524a9c,null))['then'](function(_0x1e56e8){if(_0x1e56e8){return _0x1e56e8['setTags'](_0x34e376[_0xaa25('0x6f')]['ids'],_[_0xaa25('0xb3')](_0x34e376['body'],[_0xaa25('0xb2'),'id'])||{})[_0xaa25('0xbd')](function(){return db['Tag'][_0xaa25('0xba')]({'attributes':['id','name',_0xaa25('0xbe')],'where':{'id':_0x34e376['body'][_0xaa25('0xb2')]}});})['then'](function(_0x385c3f){socket[_0xaa25('0xbf')](_0xaa25('0xc0'),{'id':Number(_0x34e376[_0xaa25('0xb1')]['id']),'tags':_0x385c3f||[]});return{'id':Number(_0x34e376['params']['id']),'tags':_0x385c3f||[]};});}})[_0xaa25('0x26')](respondWithResult(_0x524a9c,null))[_0xaa25('0x32')](handleError(_0x524a9c,null));};exports[_0xaa25('0xc1')]=function(_0x451805,_0x95857a,_0x4f1d22){return db[_0xaa25('0x34')][_0xaa25('0x6d')]({'where':{'id':_0x451805[_0xaa25('0xb1')]['id']}})[_0xaa25('0x26')](handleEntityNotFound(_0x95857a,null))['then'](function(_0x451564){if(_0x451564){return _0x451564['removeTags'](_0x451805[_0xaa25('0x39')]['ids']);}})['then'](respondWithStatusCode(_0x95857a,null))['catch'](handleError(_0x95857a,null));};exports[_0xaa25('0xc2')]=function(_0x20ba50,_0x3a5ca3){var _0x2e67f5=moment()[_0xaa25('0xc3')]()[_0xaa25('0x93')]();var _0x2205df=path[_0xaa25('0xc4')](config['root'],_0xaa25('0xc5'),_0xaa25('0xc6'),_0xaa25('0xc7'));var _0x5070c6=path['join'](config[_0xaa25('0xc8')],_0xaa25('0xc5'),_0xaa25('0xc6'),_0xaa25('0xc9'));var _0x137972=path['join'](_0x2205df,_0x2e67f5);var _0x4346cb=util[_0xaa25('0xb9')](_0xaa25('0xca'),_0x20ba50['params']['id'],_0x2e67f5);var _0xa30511=path[_0xaa25('0xc4')](_0x2205df,_0x4346cb);var _0x3d8738=[];_0x3d8738[_0xaa25('0xa7')]({'model':db['User'],'as':_0xaa25('0x6a'),'attributes':['id',_0xaa25('0x2d')],'raw':!![]});_0x3d8738[_0xaa25('0xa7')]({'model':db['CmContact'],'as':'Contact','attributes':['id',_0xaa25('0xcb'),_0xaa25('0xcc')],'raw':!![]});if(_0x20ba50[_0xaa25('0x39')][_0xaa25('0xc9')]){_0x3d8738[_0xaa25('0xa7')]({'model':db[_0xaa25('0xcd')],'as':_0xaa25('0xcd'),'raw':!![]});}var _0x537664=[{'model':db[_0xaa25('0xb0')],'as':_0xaa25('0xce'),'attributes':['id',_0xaa25('0x6f'),_0xaa25('0xcf'),_0xaa25('0xd0'),_0xaa25('0xd1'),_0xaa25('0x7b')],'include':_0x3d8738}];_0x537664[_0xaa25('0xa7')]({'model':db[_0xaa25('0xd2')],'as':_0xaa25('0xd3'),'attributes':['id',_0xaa25('0x2a')]});_0x537664[_0xaa25('0xa7')]({'model':db['User'],'as':'Owner','attributes':['id',_0xaa25('0x2d')]});return db['WhatsappInteraction'][_0xaa25('0x6d')]({'where':{'id':_0x20ba50[_0xaa25('0xb1')]['id']},'include':_0x537664})['then'](handleEntityNotFound(_0x3a5ca3,null))['then'](function(_0x20f523){if(_0x20f523){var _0x131802=_0x20f523[_0xaa25('0xd4')]({'plain':!![]});fs['mkdirSync'](_0x137972);var _0x5edb66={'channel':_0xaa25('0xd5'),'account':_0x131802['Account'][_0xaa25('0x2a')],'agent':_0x131802[_0xaa25('0xd6')]?_0x131802['Owner']['fullname']:_0xaa25('0xd7'),'createdAt':moment(_0x131802[_0xaa25('0xcf')])[_0xaa25('0xb9')](_0xaa25('0xd8'))[_0xaa25('0x93')](),'closedAt':_0x131802['closed']?moment(_0x131802['closedAt'])[_0xaa25('0xb9')](_0xaa25('0xd8'))['toString']():'','disposition':_0x131802['disposition'],'messages':_(_0x131802[_0xaa25('0xce')])[_0xaa25('0xb7')]({'secret':![]})[_0xaa25('0x2c')](function(_0x26c5b3){if(_0x26c5b3[_0xaa25('0xcd')]){var _0x39b341=path[_0xaa25('0xc4')](_0x5070c6,_0x26c5b3[_0xaa25('0xcd')][_0xaa25('0xd9')]);if(fs[_0xaa25('0xda')](_0x39b341)){fs[_0xaa25('0xdb')](_0x39b341)[_0xaa25('0xdc')](fs[_0xaa25('0xdd')](path[_0xaa25('0xc4')](_0x137972,_0x26c5b3['Attachment']['basename'])));}}return{'date':moment(_0x26c5b3[_0xaa25('0xcf')])[_0xaa25('0xb9')](_0xaa25('0xd8'))['toString'](),'sender':_0x26c5b3['direction']===_0xaa25('0xde')?_0x26c5b3[_0xaa25('0x6a')]?_0x26c5b3[_0xaa25('0x6a')][_0xaa25('0x2d')]:_0xaa25('0xdf'):_0x26c5b3[_0xaa25('0x5f')][_0xaa25('0xcb')]+(_0x26c5b3[_0xaa25('0x5f')]['lastName']?'\x20'+_0x26c5b3['Contact'][_0xaa25('0xcc')]:''),'body':_0x26c5b3['Attachment']?_0x26c5b3[_0xaa25('0xcd')]['basename']:_0x26c5b3[_0xaa25('0x6f')],'direction':_0x26c5b3[_0xaa25('0xd0')]===_0xaa25('0xde')?'A':'C','secret':_0x26c5b3['secret'],'read':_0x26c5b3[_0xaa25('0x7b')],'attachment':_0x26c5b3['Attachment']};})[_0xaa25('0x5b')]()};return ejs[_0xaa25('0xe0')](path[_0xaa25('0xc4')](config[_0xaa25('0xc8')],'server','views','downloadInteraction.ejs'),{'interaction':_0x5edb66})[_0xaa25('0x26')](function(_0x388dad){var _0x275475=path[_0xaa25('0xc4')](_0x137972,_0xaa25('0xe1')+_0x131802['id']+'-'+_0x2e67f5+_0xaa25('0xe2'));var _0x1796f6={'path':_0x275475,'channel':_0xaa25('0xd5'),'interactionId':_0x131802['id']};return pdf[_0xaa25('0xe3')](_0x388dad,_0x1796f6);})[_0xaa25('0x26')](function(){return new BPromise(function(_0x34b29e,_0x2aaeaa){zipdir(_0x137972,{'saveTo':_0xa30511},function(_0x4f1e94,_0x2be357){if(_0x4f1e94)return _0x2aaeaa(_0x4f1e94);return _0x34b29e(_0x2be357);});})[_0xaa25('0x26')](function(){return new BPromise(function(_0x1af2a5,_0x2c1a26){rimraf(_0x137972,function(_0x4c350b){if(_0x4c350b)_0x2c1a26(_0x4c350b);return _0x1af2a5();});});})['then'](function(){return _0x3a5ca3['download'](_0xa30511,_0x4346cb,function(_0x427884){if(_0x427884){console[_0xaa25('0xe4')](_0xaa25('0xe5'),_0x427884);}else{fs[_0xaa25('0xe6')](_0xa30511);}});});});}else{return _0x3a5ca3[_0xaa25('0x19')](0xc8);}})[_0xaa25('0x32')](handleError(_0x3a5ca3,null));}; \ No newline at end of file +var _0x177a=['api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./whatsappInteraction.socket','register','sendStatus','status','end','json','offset','count','limit','set','Content-Range','apply','update','then','destroy','error','name','send','Users','map','Tags','TagIds','forEach','catch','index','WhatsappInteraction','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','sort','where','pick','select','field','from','tools_tags','u.id','u.fullname','ui.WhatsappInteractionId','user_has_whatsapp_interactions','left_join','users','u.id\x20=\x20ui.UserId','whatsapp_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','whatsapp_accounts','a.id\x20=\x20i.WhatsappAccountId','me.WhatsappInteractionId\x20=\x20i.id','it.WhatsappInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','find','unreadMessages','value','having','`\x20=\x200','`\x20>\x200','Contact','operator','$substring','split','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','text','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','body','some','isEmpty','i.WhatsappAccountId\x20IN\x20?','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','\x20IS\x20NULL','\x20=\x20?','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','isNumeric','i.phone\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','i.id','Sequelize','QueryTypes','SELECT','clone','order','contactName','DESC','t.id\x20IN\x20?','resolve','WhatsappAccountId','user','role','agent','getWhatsappAccounts','i.WhatsappAccountId\x20IS\x20NULL','sequelize','toString','keyBy','merge','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','a.key','Account.key','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','Contact.firstName','c.lastName','c.email','c.phone','Contact.phone','c.mobile','Contact.fax','o.fullname','Owner.fullname','o.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.WhatsappInteractionId\x20IN\x20?','WhatsappInteractionId','push','all','rows','show','params','includeAll','include','create','describe','addMessage','WhatsappMessage','ids','findOne','rawAttributes','nolimit','$gte','format','YYYY-MM-DD\x20HH:mm:ss','options','findAll','addTags','setTags','omit','spread','color','emit','whatsappInteractionTags:save','removeTags','download','unix','join','server','tmp','root','attachments','transcript-%d-%s.zip','fullname','CmContact','firstName','Attachment','Messages','createdAt','direction','secret','read','WhatsappAccount','Owner','get','mkdirSync','Whatsapp','Account','N.A.','closed','closedAt','basename','createReadStream','pipe','createWriteStream','out','System','lastName','views','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','log','err','unlinkSync','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/license/hardware'];(function(_0x29d4b5,_0x1913e2){var _0x3fbb01=function(_0x8b0a41){while(--_0x8b0a41){_0x29d4b5['push'](_0x29d4b5['shift']());}};_0x3fbb01(++_0x1913e2);}(_0x177a,0xdd));var _0xa177=function(_0x2b2401,_0x2ffd10){_0x2b2401=_0x2b2401-0x0;var _0x1792a6=_0x177a[_0x2b2401];return _0x1792a6;};'use strict';var emlformat=require(_0xa177('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xa177('0x1'));var rp=require(_0xa177('0x2'));var moment=require(_0xa177('0x3'));var BPromise=require(_0xa177('0x4'));var Mustache=require(_0xa177('0x5'));var util=require(_0xa177('0x6'));var path=require('path');var sox=require(_0xa177('0x7'));var csv=require(_0xa177('0x8'));var ejs=require(_0xa177('0x9'));var fs=require('fs');var fs_extra=require(_0xa177('0xa'));var _=require(_0xa177('0xb'));var squel=require(_0xa177('0xc'));var crypto=require(_0xa177('0xd'));var jsforce=require(_0xa177('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xa177('0x8'));var querystring=require('querystring');var Papa=require(_0xa177('0xf'));var Redis=require(_0xa177('0x10'));var authService=require(_0xa177('0x11'));var qs=require(_0xa177('0x12'));var as=require(_0xa177('0x13'));var pdf=require(_0xa177('0x14'));var hardwareService=require(_0xa177('0x15'));var logger=require('../../config/logger')(_0xa177('0x16'));var utils=require(_0xa177('0x17'));var config=require(_0xa177('0x18'));var licenseUtil=require(_0xa177('0x19'));var db=require(_0xa177('0x1a'))['db'];config[_0xa177('0x1b')]=_[_0xa177('0x1c')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xa177('0x1d'))(new Redis(config[_0xa177('0x1b')]));require(_0xa177('0x1e'))[_0xa177('0x1f')](socket);function respondWithStatusCode(_0xef81bb,_0x1beaa0){_0x1beaa0=_0x1beaa0||0xcc;return function(_0x258985){if(_0x258985){return _0xef81bb[_0xa177('0x20')](_0x1beaa0);}return _0xef81bb[_0xa177('0x21')](_0x1beaa0)[_0xa177('0x22')]();};}function respondWithResult(_0x26be7a,_0x24a35e){_0x24a35e=_0x24a35e||0xc8;return function(_0x5445da){if(_0x5445da){return _0x26be7a[_0xa177('0x21')](_0x24a35e)[_0xa177('0x23')](_0x5445da);}};}function respondWithFilteredResult(_0x4b5404,_0x5e6ae3){return function(_0x2f30d4){if(_0x2f30d4){var _0x11b060=typeof _0x5e6ae3[_0xa177('0x24')]==='undefined'&&typeof _0x5e6ae3['limit']==='undefined';var _0x2acb84=_0x2f30d4[_0xa177('0x25')];var _0x3b7c5e=_0x11b060?0x0:_0x5e6ae3[_0xa177('0x24')];var _0x50a957=_0x11b060?_0x2f30d4[_0xa177('0x25')]:_0x5e6ae3['offset']+_0x5e6ae3[_0xa177('0x26')];var _0x52599e;if(_0x50a957>=_0x2acb84){_0x50a957=_0x2acb84;_0x52599e=0xc8;}else{_0x52599e=0xce;}_0x4b5404[_0xa177('0x21')](_0x52599e);return _0x4b5404[_0xa177('0x27')](_0xa177('0x28'),_0x3b7c5e+'-'+_0x50a957+'/'+_0x2acb84)[_0xa177('0x23')](_0x2f30d4);}return null;};}function patchUpdates(_0x58d4bd){return function(_0x1cfe9){try{jsonpatch[_0xa177('0x29')](_0x1cfe9,_0x58d4bd,!![]);}catch(_0x1ad5da){return BPromise['reject'](_0x1ad5da);}return _0x1cfe9['save']();};}function saveUpdates(_0x4e0159,_0x5c57f2){return function(_0x440d3d){if(_0x440d3d){return _0x440d3d[_0xa177('0x2a')](_0x4e0159)[_0xa177('0x2b')](function(_0x1b7cec){return _0x1b7cec;});}return null;};}function removeEntity(_0xf5d168,_0x57f58f){return function(_0x31608c){if(_0x31608c){return _0x31608c[_0xa177('0x2c')]()['then'](function(){_0xf5d168['status'](0xcc)[_0xa177('0x22')]();});}};}function handleEntityNotFound(_0x5b42a1,_0x55f460){return function(_0x59d40d){if(!_0x59d40d){_0x5b42a1[_0xa177('0x20')](0x194);}return _0x59d40d;};}function handleError(_0x4c8a61,_0x216cab){_0x216cab=_0x216cab||0x1f4;return function(_0x3ae38f){logger[_0xa177('0x2d')](_0x3ae38f['stack']);if(_0x3ae38f[_0xa177('0x2e')]){delete _0x3ae38f[_0xa177('0x2e')];}_0x4c8a61['status'](_0x216cab)[_0xa177('0x2f')](_0x3ae38f);};}function getInteractionUsers(_0x1681b4,_0x2514f7){return new BPromise(function(_0x1e4002,_0x253efa){try{if(_0x2514f7[_0x1681b4['id']]){_0x1681b4[_0xa177('0x30')]=_[_0xa177('0x31')](_0x2514f7[_0x1681b4['id']],function(_0x423ed7){return{'id':_0x423ed7['id'],'fullname':_0x423ed7['fullname']};});}}catch(_0x384281){_0x253efa(_0x384281);}_0x1e4002(_0x1681b4);});}function getInteractionTags(_0x40ca8f,_0x4c4ce4){return new BPromise(function(_0x5b8f10,_0x40cd9d){try{if(_0x40ca8f['TagIds']){_0x40ca8f[_0xa177('0x32')]=[];_0x40ca8f[_0xa177('0x33')]['split'](',')[_0xa177('0x34')](function(_0x3c003a){_0x40ca8f[_0xa177('0x32')]['push'](_0x4c4ce4[_0x3c003a]);});}delete _0x40ca8f['TagIds'];}catch(_0x5a4f52){_0x40cd9d(_0x5a4f52);}_0x5b8f10(_0x40ca8f);});}function updateWhatsappInteraction(_0x4cf7fd,_0x54bce7,_0x280acd){return new BPromise(function(_0xd57ceb,_0x1efed3){return getInteractionUsers(_0x4cf7fd,_0x280acd)[_0xa177('0x2b')](function(_0x27c2ae){return getInteractionTags(_0x27c2ae,_0x54bce7);})[_0xa177('0x2b')](function(_0x4c0890){_0xd57ceb(_0x4c0890);})[_0xa177('0x35')](function(_0x186359){_0x1efed3(_0x186359);});});}exports[_0xa177('0x36')]=function(_0x407fc4,_0x30115d){var _0x33aecc={},_0x3d2350={},_0x3d141c={'count':0x0,'rows':[]};var _0x5ca2a2=_[_0xa177('0x31')](db[_0xa177('0x37')]['rawAttributes'],function(_0x258896){return{'name':_0x258896['fieldName'],'type':_0x258896[_0xa177('0x38')][_0xa177('0x39')]};});_0x3d2350['model']=_[_0xa177('0x31')](_0x5ca2a2,_0xa177('0x2e'));_0x3d2350[_0xa177('0x3a')]=_[_0xa177('0x3b')](_0x407fc4[_0xa177('0x3a')]);_0x3d2350[_0xa177('0x3c')]=_[_0xa177('0x3d')](_0x3d2350[_0xa177('0x3e')],_0x3d2350[_0xa177('0x3a')]);_0x33aecc[_0xa177('0x3f')]=_[_0xa177('0x3d')](_0x3d2350[_0xa177('0x3e')],qs['fields'](_0x407fc4['query'][_0xa177('0x40')]));_0x33aecc[_0xa177('0x3f')]=_0x33aecc[_0xa177('0x3f')][_0xa177('0x41')]?_0x33aecc[_0xa177('0x3f')]:_0x3d2350[_0xa177('0x3e')];if(!_0x407fc4[_0xa177('0x3a')][_0xa177('0x42')]('nolimit')){_0x33aecc['limit']=qs[_0xa177('0x26')](_0x407fc4[_0xa177('0x3a')][_0xa177('0x26')]);_0x33aecc[_0xa177('0x24')]=qs[_0xa177('0x24')](_0x407fc4[_0xa177('0x3a')][_0xa177('0x24')]);}_0x33aecc['order']=qs[_0xa177('0x43')](_0x407fc4['query'][_0xa177('0x43')]);_0x33aecc[_0xa177('0x44')]=qs[_0xa177('0x3c')](_[_0xa177('0x45')](_0x407fc4[_0xa177('0x3a')],_0x3d2350[_0xa177('0x3c')]),_0x5ca2a2);var _0x4f2d41=[];var _0x2d3014=squel[_0xa177('0x46')]()[_0xa177('0x47')]('id')[_0xa177('0x47')](_0xa177('0x2e'))[_0xa177('0x47')]('color')[_0xa177('0x48')](_0xa177('0x49'));var _0x2ef46d=squel[_0xa177('0x46')]()[_0xa177('0x47')](_0xa177('0x4a'))['field'](_0xa177('0x4b'))[_0xa177('0x47')](_0xa177('0x4c'))[_0xa177('0x48')](_0xa177('0x4d'),'ui')[_0xa177('0x4e')](_0xa177('0x4f'),'u',_0xa177('0x50'));var _0x26d84b=squel[_0xa177('0x46')]()[_0xa177('0x48')](_0xa177('0x51'),'i')[_0xa177('0x4e')](_0xa177('0x52'),'c',_0xa177('0x53'))[_0xa177('0x4e')]('users','o',_0xa177('0x54'))[_0xa177('0x4e')](_0xa177('0x55'),'a',_0xa177('0x56'))[_0xa177('0x4e')]('whatsapp_messages','me',_0xa177('0x57'))[_0xa177('0x4e')]('whatsapp_interaction_has_tags','it',_0xa177('0x58'))[_0xa177('0x4e')](_0xa177('0x49'),'t',_0xa177('0x59'));var _0x21f3df=squel[_0xa177('0x5a')]();var _0x55b44d=[];var _0x2304b1=squel[_0xa177('0x5a')]();var _0x42946c;if(_0x407fc4['query'][_0xa177('0x5b')]){_0x42946c=as[_0xa177('0x5c')](_0x407fc4[_0xa177('0x3a')][_0xa177('0x5b')]);var _0x3c70fa=_0x42946c[_0xa177('0x5d')];for(var _0x31de80=0x0;_0x31de80<_0x42946c['conditions'][_0xa177('0x41')];_0x31de80++){var _0x1dd3bb=_0x42946c['conditions'][_0x31de80];var _0xe02326='i';var _0x48b0b6=_[_0xa177('0x5e')](_0x5ca2a2,['name',_0x1dd3bb[_0xa177('0x47')]]);if(!_0x48b0b6){switch(_0x1dd3bb[_0xa177('0x47')]){case _0xa177('0x5f'):if(_0x1dd3bb[_0xa177('0x60')]==0x1){_0x26d84b[_0xa177('0x61')]('`'+_0x1dd3bb[_0xa177('0x47')]+_0xa177('0x62'));}else{_0x26d84b[_0xa177('0x61')]('`'+_0x1dd3bb[_0xa177('0x47')]+_0xa177('0x63'));}break;case _0xa177('0x64'):if(_0x1dd3bb[_0xa177('0x65')]===_0xa177('0x66')){if(_0x1dd3bb['value'][_0xa177('0x67')]('\x20')[_0xa177('0x41')]>0x1){_0x21f3df[_0x3c70fa](_0xa177('0x68'),qs['getFullTextValue'](_0x1dd3bb['value']),null);}else{var _0x5a7534='%'+_0x1dd3bb[_0xa177('0x60')]+'%';_0x21f3df[_0x3c70fa](_0xa177('0x69'),_0x5a7534,_0x5a7534,_0x5a7534);}}else{_0x48b0b6=_[_0xa177('0x5e')](_0x5ca2a2,['name',_0xa177('0x6a')]);_0x1dd3bb[_0xa177('0x47')]=_0xa177('0x6a');_0x315c15=as[_0xa177('0x6b')](_0xe02326,_0x48b0b6[_0xa177('0x38')],_0x1dd3bb);_0x21f3df[_0x3c70fa](_0x315c15[_0xa177('0x6c')],_0x315c15[_0xa177('0x60')][_0xa177('0x6d')],_0x315c15[_0xa177('0x60')][_0xa177('0x22')]);}break;case _0xa177('0x6e'):var _0x3b23fe=_0x1dd3bb[_0xa177('0x60')]['split'](',')['map'](function(_0x126261){return Number(_0x126261);});_0x3b23fe[_0xa177('0x34')](function(_0x381afc){_0x2304b1['or'](_0xa177('0x6f'),'%,'+_0x381afc+',%');});_0x55b44d=_[_0xa177('0x70')](_0x55b44d,_0x3b23fe);break;case _0xa177('0x71'):if(_0x1dd3bb[_0xa177('0x65')]==='$substring'){_0x21f3df[_0x3c70fa](_0xa177('0x72'),'%'+_0x1dd3bb[_0xa177('0x60')]+'%',null);}else{_0x48b0b6=_['find'](_0x5ca2a2,[_0xa177('0x2e'),_0xa177('0x73')]);_0x1dd3bb[_0xa177('0x47')]='UserId';_0x315c15=as['buildExpression'](_0xe02326,_0x48b0b6[_0xa177('0x38')],_0x1dd3bb);_0x21f3df[_0x3c70fa](_0x315c15[_0xa177('0x6c')],_0x315c15[_0xa177('0x60')][_0xa177('0x6d')],_0x315c15[_0xa177('0x60')][_0xa177('0x22')]);}break;case _0xa177('0x74'):_0x315c15=as['buildExpression']('me',null,_0x1dd3bb);_0x21f3df[_0x3c70fa](_0x315c15[_0xa177('0x6c')],_0x315c15[_0xa177('0x60')][_0xa177('0x6d')],_0x315c15[_0xa177('0x60')][_0xa177('0x22')]);break;}}else{var _0x315c15=as['buildExpression'](_0xe02326,_0x48b0b6['type'],_0x1dd3bb);_0x21f3df[_0x3c70fa](_0x315c15[_0xa177('0x6c')],_0x315c15[_0xa177('0x60')]['start'],_0x315c15['value'][_0xa177('0x22')]);}}}else{var _0x22a1af=_(_0x407fc4[_0xa177('0x3a')])[_0xa177('0x3b')]()[_0xa177('0x31')](function(_0xfceddd){return _[_0xa177('0x75')](_0x5ca2a2,[_0xa177('0x2e'),_0xfceddd])?_0xfceddd:undefined;})['compact']()[_0xa177('0x60')]();if(!_[_0xa177('0x76')](_0x22a1af)){_0x22a1af['forEach'](function(_0x407d1f){if(_0x407d1f==='WhatsappAccountId'){_0x26d84b['where'](_0xa177('0x77'),[]['concat'](_0x407fc4['query'][_0x407d1f]));}else if(_0x407d1f==='createdAt'){var _0x222559=JSON[_0xa177('0x78')](_0x407fc4[_0xa177('0x3a')][_0x407d1f])['$gte'];var _0x585cd8=JSON['parse'](_0x407fc4[_0xa177('0x3a')][_0x407d1f])[_0xa177('0x79')];_0x26d84b[_0xa177('0x44')](_0xa177('0x7a'),_0x222559,_0x585cd8);}else{if(_0x407fc4['query'][_0x407d1f]==='null'){_0x26d84b[_0xa177('0x44')]('i.'+_0x407d1f+_0xa177('0x7b'));}else{_0x26d84b['where']('i.'+_0x407d1f+_0xa177('0x7c'),_0x407fc4[_0xa177('0x3a')][_0x407d1f]);}}});}if(_0x407fc4[_0xa177('0x3a')]['read']){if(_0x407fc4['query']['read']==0x1){_0x26d84b[_0xa177('0x61')](_0xa177('0x7d'));}else{_0x26d84b[_0xa177('0x61')](_0xa177('0x7e'));}}if(_0x407fc4[_0xa177('0x3a')][_0xa177('0x7f')]){_0x55b44d=_[_0xa177('0x80')](_0x407fc4[_0xa177('0x3a')][_0xa177('0x7f')])?_0x407fc4[_0xa177('0x3a')][_0xa177('0x7f')]:new Array(_0x407fc4[_0xa177('0x3a')][_0xa177('0x7f')]);_0x55b44d[_0xa177('0x34')](function(_0x22358b){_0x2304b1['or'](_0xa177('0x6f'),'%,'+_0x22358b+',%');});}if(_0x407fc4[_0xa177('0x3a')][_0xa177('0x81')]){var _0x5900a0=_0x407fc4[_0xa177('0x3a')][_0xa177('0x81')]['replace']('\x5c','\x5c\x5c')[_0xa177('0x82')](/'/g,'\x27\x27');if(qs[_0xa177('0x83')](_0x5900a0)){_0x21f3df['or']('i.id\x20LIKE\x20?',_0x5900a0+'%')['or'](_0xa177('0x84'),_0x5900a0+'%');}else{_0x21f3df['or'](_0xa177('0x85'),qs[_0xa177('0x86')](_0x5900a0))['or'](_0xa177('0x87'),_0x5900a0+'%');}}}_0x26d84b[_0xa177('0x44')](_0x21f3df);_0x26d84b['group'](_0xa177('0x88'));var _0x525977={'type':db[_0xa177('0x89')][_0xa177('0x8a')][_0xa177('0x8b')],'raw':!![]};var _0x5acf52=_0x26d84b[_0xa177('0x8c')]();_0x5acf52[_0xa177('0x47')](_0xa177('0x88'));_0x5acf52[_0xa177('0x47')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0xa177('0x5f'));if(_0x33aecc[_0xa177('0x8d')]){_0x33aecc['order']['forEach'](function(_0x230b35){var _0x436d28=_0x230b35[0x0]===_0xa177('0x8e')?_0x230b35[0x0]:'i.'+_0x230b35[0x0];_0x26d84b[_0xa177('0x8d')](_0x436d28,_0x230b35[0x1]===_0xa177('0x8f')?![]:!![]);});}if(!_['isEmpty'](_0x55b44d)){_0x26d84b['having'](_0x2304b1);_0x5acf52[_0xa177('0x44')](_0xa177('0x90'),_0x55b44d);}BPromise[_0xa177('0x91')]()['then'](function(){if(!_0x42946c){if(_0x407fc4[_0xa177('0x3a')][_0xa177('0x92')])return;_0x5acf52['where']('i.WhatsappAccountId\x20IS\x20NOT\x20NULL');_0x26d84b[_0xa177('0x44')]('i.WhatsappAccountId\x20IS\x20NOT\x20NULL');return;}if(_0x407fc4[_0xa177('0x93')][_0xa177('0x94')]!==_0xa177('0x95'))return;return _0x407fc4['user'][_0xa177('0x96')]({'attributes':['id'],'raw':!![]})['then'](function(_0x1e8f4c){if(_['isEmpty'](_0x1e8f4c)){_0x5acf52[_0xa177('0x44')]('i.WhatsappAccountId\x20IS\x20NULL');_0x26d84b[_0xa177('0x44')](_0xa177('0x97'));}else{_0x5acf52[_0xa177('0x44')](_0xa177('0x77'),_['map'](_0x1e8f4c,'id'));_0x26d84b[_0xa177('0x44')](_0xa177('0x77'),_[_0xa177('0x31')](_0x1e8f4c,'id'));}});})[_0xa177('0x2b')](function(){if(_0x407fc4[_0xa177('0x93')][_0xa177('0x94')]===_0xa177('0x95')&&!_0x42946c&&!_0x407fc4[_0xa177('0x3a')][_0xa177('0x92')])return[];return db[_0xa177('0x98')][_0xa177('0x3a')](_0x5acf52[_0xa177('0x99')](),_0x525977);})[_0xa177('0x2b')](function(_0x4760a4){_0x3d141c[_0xa177('0x25')]=_0x4760a4[_0xa177('0x41')];if(_0x3d141c[_0xa177('0x25')]===0x0)return[];return db[_0xa177('0x98')][_0xa177('0x3a')](_0x2d3014[_0xa177('0x99')](),_0x525977)[_0xa177('0x2b')](function(_0x33402d){_0x4f2d41=_[_0xa177('0x9a')](_0x33402d,'id');_0x525977=_[_0xa177('0x9b')](_0x525977,{'model':db['WhatsappInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x407fc4[_0xa177('0x3a')][_0xa177('0x40')]){_0x33aecc[_0xa177('0x3f')][_0xa177('0x34')](function(_0x2935cb){_0x26d84b[_0xa177('0x47')]('i.'+_0x2935cb);});}else{_0x26d84b['field'](_0xa177('0x9c'),'unreadMessages');_0x26d84b[_0xa177('0x47')](_0xa177('0x9d'),_0xa177('0x9e'));_0x26d84b[_0xa177('0x47')]('a.mandatoryDisposition','Account.mandatoryDisposition');_0x26d84b[_0xa177('0x47')](_0xa177('0x9f'),_0xa177('0x8e'));_0x26d84b[_0xa177('0x47')](_0xa177('0xa0'));_0x26d84b[_0xa177('0x47')]('c.firstName',_0xa177('0xa1'));_0x26d84b[_0xa177('0x47')](_0xa177('0xa2'),'Contact.lastName');_0x26d84b['field'](_0xa177('0xa3'),'Contact.email');_0x26d84b['field'](_0xa177('0xa4'),_0xa177('0xa5'));_0x26d84b['field'](_0xa177('0xa6'),'Contact.mobile');_0x26d84b[_0xa177('0x47')]('c.fax',_0xa177('0xa7'));_0x26d84b[_0xa177('0x47')](_0xa177('0xa8'),_0xa177('0xa9'));_0x26d84b[_0xa177('0x47')](_0xa177('0xaa'),'Owner.internal');_0x26d84b['field'](_0xa177('0xab'),_0xa177('0x33'));}if(_0x33aecc[_0xa177('0x26')])_0x26d84b['limit'](_0x33aecc[_0xa177('0x26')]);if(_0x33aecc[_0xa177('0x24')])_0x26d84b[_0xa177('0x24')](_0x33aecc[_0xa177('0x24')]);return db['sequelize']['query'](_0x26d84b[_0xa177('0x99')](),_0x525977);})[_0xa177('0x2b')](function(_0x230ed5){if(_0x230ed5['length']>0x0)_0x2ef46d[_0xa177('0x44')](_0xa177('0xac'),_[_0xa177('0x31')](_0x230ed5,'id'));return db['sequelize'][_0xa177('0x3a')](_0x2ef46d[_0xa177('0x99')](),_0x525977)[_0xa177('0x2b')](function(_0x1d381d){var _0x11a7e4=_['groupBy'](_0x1d381d,_0xa177('0xad'));var _0x2260e2=[];_0x230ed5[_0xa177('0x34')](function(_0x669328){_0x2260e2[_0xa177('0xae')](updateWhatsappInteraction(_0x669328,_0x4f2d41,_0x11a7e4));});return BPromise[_0xa177('0xaf')](_0x2260e2);});});})[_0xa177('0x2b')](function(_0x2b988a){_0x3d141c[_0xa177('0xb0')]=_0x2b988a;return _0x3d141c;})[_0xa177('0x2b')](respondWithFilteredResult(_0x30115d,_0x33aecc))[_0xa177('0x35')](handleError(_0x30115d,null));};exports[_0xa177('0xb1')]=function(_0x21d568,_0x295667){var _0xd55038={'raw':![],'where':{'id':_0x21d568[_0xa177('0xb2')]['id']}},_0x2f0d53={};_0x2f0d53[_0xa177('0x3e')]=_[_0xa177('0x3b')](db[_0xa177('0x37')]['rawAttributes']);_0x2f0d53[_0xa177('0x3a')]=_['keys'](_0x21d568['query']);_0x2f0d53[_0xa177('0x3c')]=_[_0xa177('0x3d')](_0x2f0d53[_0xa177('0x3e')],_0x2f0d53[_0xa177('0x3a')]);_0xd55038[_0xa177('0x3f')]=_['intersection'](_0x2f0d53[_0xa177('0x3e')],qs[_0xa177('0x40')](_0x21d568[_0xa177('0x3a')]['fields']));_0xd55038['attributes']=_0xd55038['attributes'][_0xa177('0x41')]?_0xd55038[_0xa177('0x3f')]:_0x2f0d53['model'];if(_0x21d568[_0xa177('0x3a')][_0xa177('0xb3')]){_0xd55038[_0xa177('0xb4')]=[{'all':!![]}];}_0xd55038=_[_0xa177('0x9b')]({},_0xd55038,_0x21d568['options']);return db[_0xa177('0x37')][_0xa177('0x5e')](_0xd55038)[_0xa177('0x2b')](handleEntityNotFound(_0x295667,null))['then'](respondWithResult(_0x295667,null))['catch'](handleError(_0x295667,null));};exports['create']=function(_0x1a199d,_0x4bb72d){return db[_0xa177('0x37')][_0xa177('0xb5')](_0x1a199d[_0xa177('0x74')],{})[_0xa177('0x2b')](respondWithResult(_0x4bb72d,0xc9))['catch'](handleError(_0x4bb72d,null));};exports[_0xa177('0x2a')]=function(_0x58306e,_0x579920){if(_0x58306e[_0xa177('0x74')]['id']){delete _0x58306e['body']['id'];}return db['WhatsappInteraction']['find']({'where':{'id':_0x58306e[_0xa177('0xb2')]['id']}})[_0xa177('0x2b')](handleEntityNotFound(_0x579920,null))[_0xa177('0x2b')](saveUpdates(_0x58306e[_0xa177('0x74')],null))['then'](respondWithResult(_0x579920,null))[_0xa177('0x35')](handleError(_0x579920,null));};exports['destroy']=function(_0x499be5,_0x1ffdb8){return db[_0xa177('0x37')][_0xa177('0x5e')]({'where':{'id':_0x499be5['params']['id']}})[_0xa177('0x2b')](handleEntityNotFound(_0x1ffdb8,null))[_0xa177('0x2b')](removeEntity(_0x1ffdb8,null))[_0xa177('0x35')](handleError(_0x1ffdb8,null));};exports[_0xa177('0xb6')]=function(_0x11f240,_0x3f7efd){return db[_0xa177('0x37')]['describe']()['then'](respondWithResult(_0x3f7efd,null))['catch'](handleError(_0x3f7efd,null));};exports[_0xa177('0xb7')]=function(_0x237a07,_0x2ad4ef,_0x4f4330){return db[_0xa177('0xb8')]['find']({'where':{'id':_0x237a07[_0xa177('0xb2')]['id']}})[_0xa177('0x2b')](handleEntityNotFound(_0x2ad4ef,null))[_0xa177('0x2b')](function(_0x2253ae){if(_0x2253ae){return _0x2253ae[_0xa177('0xb7')](_0x237a07[_0xa177('0x74')][_0xa177('0xb9')],_['omit'](_0x237a07['body'],['ids','id'])||{});}})[_0xa177('0x2b')](respondWithResult(_0x2ad4ef,null))[_0xa177('0x35')](handleError(_0x2ad4ef,null));};exports['getMessages']=function(_0x2e2d11,_0x5396d4,_0x2fafa5){var _0x422e18={'raw':![],'where':{}};var _0x2efe00={};var _0x31a621={'count':0x0,'rows':[]};return db[_0xa177('0x37')][_0xa177('0xba')]({'where':{'id':_0x2e2d11['params']['id']}})[_0xa177('0x2b')](handleEntityNotFound(_0x5396d4,null))[_0xa177('0x2b')](function(_0x2e41d1){if(_0x2e41d1){_0x2efe00[_0xa177('0x3e')]=_[_0xa177('0x3b')](db['WhatsappMessage'][_0xa177('0xbb')]);_0x2efe00[_0xa177('0x3a')]=_['keys'](_0x2e2d11[_0xa177('0x3a')]);_0x2efe00[_0xa177('0x3c')]=_['intersection'](_0x2efe00[_0xa177('0x3e')],_0x2efe00['query']);_0x422e18[_0xa177('0x3f')]=_['intersection'](_0x2efe00[_0xa177('0x3e')],qs[_0xa177('0x40')](_0x2e2d11[_0xa177('0x3a')][_0xa177('0x40')]));_0x422e18[_0xa177('0x3f')]=_0x422e18[_0xa177('0x3f')][_0xa177('0x41')]?_0x422e18['attributes']:_0x2efe00['model'];if(!_0x2e2d11['query'][_0xa177('0x42')](_0xa177('0xbc'))){_0x422e18[_0xa177('0x26')]=qs[_0xa177('0x26')](_0x2e2d11[_0xa177('0x3a')][_0xa177('0x26')]);_0x422e18[_0xa177('0x24')]=qs[_0xa177('0x24')](_0x2e2d11[_0xa177('0x3a')][_0xa177('0x24')]);}_0x422e18[_0xa177('0x8d')]=qs[_0xa177('0x43')](_0x2e2d11[_0xa177('0x3a')][_0xa177('0x43')]);_0x422e18[_0xa177('0x44')]=qs['filters'](_[_0xa177('0x45')](_0x2e2d11[_0xa177('0x3a')],_0x2efe00['filters']));_0x422e18[_0xa177('0x44')][_0xa177('0xad')]=_0x2e41d1['id'];if(_0x2e2d11[_0xa177('0x3a')][_0xa177('0x81')]){_0x422e18[_0xa177('0x44')]=_[_0xa177('0x9b')](_0x422e18[_0xa177('0x44')],{'$or':_[_0xa177('0x31')](_0x422e18[_0xa177('0x3f')],function(_0x21aa7c){var _0x3eb268={};_0x3eb268[_0x21aa7c]={'$like':'%'+_0x2e2d11[_0xa177('0x3a')][_0xa177('0x81')]+'%'};return _0x3eb268;})});}if(_0x2e2d11[_0xa177('0x3a')][_0xa177('0xbd')]){var _0x2c27c8=_0x2e2d11[_0xa177('0x3a')][_0xa177('0xbd')]['split'](',');var _0x147bcb={};_0x147bcb[_0x2c27c8[0x0]]={'$gte':moment(_0x2c27c8[0x1])[_0xa177('0xbe')](_0xa177('0xbf'))};_0x422e18['where']=_['merge'](_0x422e18[_0xa177('0x44')],_0x147bcb);}_0x422e18=_[_0xa177('0x9b')]({},_0x422e18,_0x2e2d11[_0xa177('0xc0')]);return db[_0xa177('0xb8')][_0xa177('0x25')]({'where':_0x422e18['where']})[_0xa177('0x2b')](function(_0x16a134){_0x31a621[_0xa177('0x25')]=_0x16a134;if(_0x2e2d11['query'][_0xa177('0xb3')]){_0x422e18['include']=[{'all':!![]}];}return db[_0xa177('0xb8')][_0xa177('0xc1')](_0x422e18);})['then'](function(_0x138710){_0x31a621[_0xa177('0xb0')]=_0x138710;return _0x31a621;});}})['then'](respondWithFilteredResult(_0x5396d4,_0x422e18))[_0xa177('0x35')](handleError(_0x5396d4,null));};exports[_0xa177('0xc2')]=function(_0x4771e3,_0x5a804c,_0x531cc6){return db[_0xa177('0x37')][_0xa177('0x5e')]({'where':{'id':_0x4771e3[_0xa177('0xb2')]['id']}})[_0xa177('0x2b')](handleEntityNotFound(_0x5a804c,null))[_0xa177('0x2b')](function(_0x468b85){if(_0x468b85){return _0x468b85[_0xa177('0xc3')](_0x4771e3[_0xa177('0x74')]['ids'],_[_0xa177('0xc4')](_0x4771e3['body'],['ids','id'])||{})[_0xa177('0xc5')](function(){return db['Tag']['findAll']({'attributes':['id',_0xa177('0x2e'),_0xa177('0xc6')],'where':{'id':_0x4771e3['body'][_0xa177('0xb9')]}});})[_0xa177('0x2b')](function(_0xe9f2e3){socket[_0xa177('0xc7')](_0xa177('0xc8'),{'id':Number(_0x4771e3[_0xa177('0xb2')]['id']),'tags':_0xe9f2e3||[]});return{'id':Number(_0x4771e3[_0xa177('0xb2')]['id']),'tags':_0xe9f2e3||[]};});}})[_0xa177('0x2b')](respondWithResult(_0x5a804c,null))[_0xa177('0x35')](handleError(_0x5a804c,null));};exports[_0xa177('0xc9')]=function(_0x59e0cf,_0x3469f7,_0x1c356c){return db['WhatsappInteraction'][_0xa177('0x5e')]({'where':{'id':_0x59e0cf[_0xa177('0xb2')]['id']}})[_0xa177('0x2b')](handleEntityNotFound(_0x3469f7,null))[_0xa177('0x2b')](function(_0x5ccbb6){if(_0x5ccbb6){return _0x5ccbb6[_0xa177('0xc9')](_0x59e0cf[_0xa177('0x3a')][_0xa177('0xb9')]);}})['then'](respondWithStatusCode(_0x3469f7,null))[_0xa177('0x35')](handleError(_0x3469f7,null));};exports[_0xa177('0xca')]=function(_0x14362a,_0x31a44e){var _0x18fbc1=moment()[_0xa177('0xcb')]()[_0xa177('0x99')]();var _0x3fcdcf=path[_0xa177('0xcc')](config['root'],_0xa177('0xcd'),'files',_0xa177('0xce'));var _0xe4c647=path[_0xa177('0xcc')](config[_0xa177('0xcf')],_0xa177('0xcd'),'files',_0xa177('0xd0'));var _0x1c3bc8=path[_0xa177('0xcc')](_0x3fcdcf,_0x18fbc1);var _0x5ad141=util[_0xa177('0xbe')](_0xa177('0xd1'),_0x14362a[_0xa177('0xb2')]['id'],_0x18fbc1);var _0x8eaac8=path['join'](_0x3fcdcf,_0x5ad141);var _0x23ee49=[];_0x23ee49[_0xa177('0xae')]({'model':db[_0xa177('0x71')],'as':_0xa177('0x71'),'attributes':['id',_0xa177('0xd2')],'raw':!![]});_0x23ee49[_0xa177('0xae')]({'model':db[_0xa177('0xd3')],'as':_0xa177('0x64'),'attributes':['id',_0xa177('0xd4'),'lastName'],'raw':!![]});if(_0x14362a[_0xa177('0x3a')]['attachments']){_0x23ee49[_0xa177('0xae')]({'model':db[_0xa177('0xd5')],'as':_0xa177('0xd5'),'raw':!![]});}var _0x23ac5c=[{'model':db[_0xa177('0xb8')],'as':_0xa177('0xd6'),'attributes':['id',_0xa177('0x74'),_0xa177('0xd7'),_0xa177('0xd8'),_0xa177('0xd9'),_0xa177('0xda')],'include':_0x23ee49}];_0x23ac5c[_0xa177('0xae')]({'model':db[_0xa177('0xdb')],'as':'Account','attributes':['id',_0xa177('0x2e')]});_0x23ac5c[_0xa177('0xae')]({'model':db[_0xa177('0x71')],'as':_0xa177('0xdc'),'attributes':['id',_0xa177('0xd2')]});return db['WhatsappInteraction']['find']({'where':{'id':_0x14362a[_0xa177('0xb2')]['id']},'include':_0x23ac5c})['then'](handleEntityNotFound(_0x31a44e,null))[_0xa177('0x2b')](function(_0x33b458){if(_0x33b458){var _0x4a4992=_0x33b458[_0xa177('0xdd')]({'plain':!![]});fs[_0xa177('0xde')](_0x1c3bc8);var _0x27a1fd={'channel':_0xa177('0xdf'),'account':_0x4a4992[_0xa177('0xe0')]['name'],'agent':_0x4a4992['Owner']?_0x4a4992['Owner'][_0xa177('0xd2')]:_0xa177('0xe1'),'createdAt':moment(_0x4a4992[_0xa177('0xd7')])[_0xa177('0xbe')](_0xa177('0xbf'))[_0xa177('0x99')](),'closedAt':_0x4a4992[_0xa177('0xe2')]?moment(_0x4a4992[_0xa177('0xe3')])[_0xa177('0xbe')](_0xa177('0xbf'))['toString']():'','disposition':_0x4a4992['disposition'],'messages':_(_0x4a4992[_0xa177('0xd6')])[_0xa177('0x81')]({'secret':![]})[_0xa177('0x31')](function(_0x2b341b){if(_0x2b341b['Attachment']){var _0x39c6b2=path[_0xa177('0xcc')](_0xe4c647,_0x2b341b[_0xa177('0xd5')][_0xa177('0xe4')]);if(fs['existsSync'](_0x39c6b2)){fs[_0xa177('0xe5')](_0x39c6b2)[_0xa177('0xe6')](fs[_0xa177('0xe7')](path[_0xa177('0xcc')](_0x1c3bc8,_0x2b341b[_0xa177('0xd5')]['basename'])));}}return{'date':moment(_0x2b341b[_0xa177('0xd7')])[_0xa177('0xbe')](_0xa177('0xbf'))[_0xa177('0x99')](),'sender':_0x2b341b[_0xa177('0xd8')]===_0xa177('0xe8')?_0x2b341b[_0xa177('0x71')]?_0x2b341b[_0xa177('0x71')][_0xa177('0xd2')]:_0xa177('0xe9'):_0x2b341b[_0xa177('0x64')][_0xa177('0xd4')]+(_0x2b341b[_0xa177('0x64')][_0xa177('0xea')]?'\x20'+_0x2b341b['Contact'][_0xa177('0xea')]:''),'body':_0x2b341b[_0xa177('0xd5')]?_0x2b341b[_0xa177('0xd5')][_0xa177('0xe4')]:_0x2b341b[_0xa177('0x74')],'direction':_0x2b341b[_0xa177('0xd8')]===_0xa177('0xe8')?'A':'C','secret':_0x2b341b[_0xa177('0xd9')],'read':_0x2b341b[_0xa177('0xda')],'attachment':_0x2b341b[_0xa177('0xd5')]};})[_0xa177('0x60')]()};return ejs['renderFile'](path[_0xa177('0xcc')](config[_0xa177('0xcf')],_0xa177('0xcd'),_0xa177('0xeb'),_0xa177('0xec')),{'interaction':_0x27a1fd})[_0xa177('0x2b')](function(_0x17be10){var _0x504842=path['join'](_0x1c3bc8,_0xa177('0xed')+_0x4a4992['id']+'-'+_0x18fbc1+_0xa177('0xee'));var _0x1c5e04={'path':_0x504842,'channel':_0xa177('0xdf'),'interactionId':_0x4a4992['id']};return pdf[_0xa177('0xef')](_0x17be10,_0x1c5e04);})[_0xa177('0x2b')](function(){return new BPromise(function(_0x20690d,_0x1f9847){zipdir(_0x1c3bc8,{'saveTo':_0x8eaac8},function(_0x452b9a,_0x523da4){if(_0x452b9a)return _0x1f9847(_0x452b9a);return _0x20690d(_0x523da4);});})['then'](function(){return new BPromise(function(_0x126fbc,_0x5639b7){rimraf(_0x1c3bc8,function(_0x4fb856){if(_0x4fb856)_0x5639b7(_0x4fb856);return _0x126fbc();});});})[_0xa177('0x2b')](function(){return _0x31a44e['download'](_0x8eaac8,_0x5ad141,function(_0x3ad2fb){if(_0x3ad2fb){console[_0xa177('0xf0')](_0xa177('0xf1'),_0x3ad2fb);}else{fs[_0xa177('0xf2')](_0x8eaac8);}});});});}else{return _0x31a44e[_0xa177('0x20')](0xc8);}})[_0xa177('0x35')](handleError(_0x31a44e,null));}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.events.js b/server/api/whatsappInteraction/whatsappInteraction.events.js index 4e96b01..69f3a37 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 _0x7dc2=['setDataValue','map','findAll','then','length','emit','hook','exports','WhatsappInteraction','../../mysqldb','WhatsappMessage','setMaxListeners','update','remove','getUsers'];(function(_0x333723,_0x3ff765){var _0x12871d=function(_0x38bb38){while(--_0x38bb38){_0x333723['push'](_0x333723['shift']());}};_0x12871d(++_0x3ff765);}(_0x7dc2,0x19d));var _0x27dc=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x7dc2[_0x321bb2];return _0x9c12ed;};'use strict';var EventEmitter=require('events');var WhatsappInteraction=require('../../mysqldb')['db'][_0x27dc('0x0')];var WhatsappMessage=require(_0x27dc('0x1'))['db'][_0x27dc('0x2')];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents[_0x27dc('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x27dc('0x4'),'afterDestroy':_0x27dc('0x5')};function emitEvent(_0x52337b){return function(_0x1d16ae,_0x23bbbe,_0x5a442a){_0x1d16ae[_0x27dc('0x6')]({'attributes':['id'],'raw':!![]})['then'](function(_0x95bbb6){_0x1d16ae[_0x27dc('0x7')]('Users',_0x95bbb6[_0x27dc('0x8')](function(_0x1039b1){return{'id':_0x1039b1['id']};}));return WhatsappMessage[_0x27dc('0x9')]({'where':{'WhatsappInteractionId':_0x1d16ae['id'],'direction':'in','read':![]},'raw':!![]});})[_0x27dc('0xa')](function(_0x50e11b){_0x1d16ae[_0x27dc('0x7')]('unreadMessages',_0x50e11b[_0x27dc('0xb')]);WhatsappInteractionEvents[_0x27dc('0xc')](_0x52337b+':'+_0x1d16ae['id'],_0x1d16ae);WhatsappInteractionEvents[_0x27dc('0xc')](_0x52337b,_0x1d16ae);_0x5a442a(null);})['catch'](_0x5a442a(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappInteraction[_0x27dc('0xd')](e,emitEvent(event));}}module[_0x27dc('0xe')]=WhatsappInteractionEvents; \ No newline at end of file +var _0xf257=['getUsers','then','setDataValue','Users','map','findAll','emit','catch','hasOwnProperty','hook','exports','WhatsappInteraction','../../mysqldb','WhatsappMessage','setMaxListeners','update','remove'];(function(_0x2f23a4,_0x5c9334){var _0x1e7557=function(_0x55a2f3){while(--_0x55a2f3){_0x2f23a4['push'](_0x2f23a4['shift']());}};_0x1e7557(++_0x5c9334);}(_0xf257,0x82));var _0x7f25=function(_0xa43d10,_0x536153){_0xa43d10=_0xa43d10-0x0;var _0x20a6fb=_0xf257[_0xa43d10];return _0x20a6fb;};'use strict';var EventEmitter=require('events');var WhatsappInteraction=require('../../mysqldb')['db'][_0x7f25('0x0')];var WhatsappMessage=require(_0x7f25('0x1'))['db'][_0x7f25('0x2')];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents[_0x7f25('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x7f25('0x4'),'afterDestroy':_0x7f25('0x5')};function emitEvent(_0xd94d7a){return function(_0x4059b2,_0x2829d7,_0x36b013){_0x4059b2[_0x7f25('0x6')]({'attributes':['id'],'raw':!![]})[_0x7f25('0x7')](function(_0x369a09){_0x4059b2[_0x7f25('0x8')](_0x7f25('0x9'),_0x369a09[_0x7f25('0xa')](function(_0x245602){return{'id':_0x245602['id']};}));return WhatsappMessage[_0x7f25('0xb')]({'where':{'WhatsappInteractionId':_0x4059b2['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x1b9268){_0x4059b2[_0x7f25('0x8')]('unreadMessages',_0x1b9268['length']);WhatsappInteractionEvents[_0x7f25('0xc')](_0xd94d7a+':'+_0x4059b2['id'],_0x4059b2);WhatsappInteractionEvents['emit'](_0xd94d7a,_0x4059b2);_0x36b013(null);})[_0x7f25('0xd')](_0x36b013(null));};}for(var e in events){if(events[_0x7f25('0xe')](e)){var event=events[e];WhatsappInteraction[_0x7f25('0xf')](e,emitEvent(event));}}module[_0x7f25('0x10')]=WhatsappInteractionEvents; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.model.js b/server/api/whatsappInteraction/whatsappInteraction.model.js index ab72eb3..89b3faa 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 _0xc50c=['changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./whatsappInteraction.attributes','exports','define','WhatsappInteraction','whatsapp_interactions'];(function(_0xda5421,_0x5634ab){var _0x4e8336=function(_0x2c72db){while(--_0x2c72db){_0xda5421['push'](_0xda5421['shift']());}};_0x4e8336(++_0x5634ab);}(_0xc50c,0x11d));var _0xcc50=function(_0x4b7895,_0x3c4f5d){_0x4b7895=_0x4b7895-0x0;var _0x264180=_0xc50c[_0x4b7895];return _0x264180;};'use strict';var _=require(_0xcc50('0x0'));var util=require(_0xcc50('0x1'));var logger=require(_0xcc50('0x2'))(_0xcc50('0x3'));var moment=require(_0xcc50('0x4'));var BPromise=require(_0xcc50('0x5'));var rp=require(_0xcc50('0x6'));var fs=require('fs');var path=require(_0xcc50('0x7'));var rimraf=require(_0xcc50('0x8'));var config=require(_0xcc50('0x9'));var attributes=require(_0xcc50('0xa'));module[_0xcc50('0xb')]=function(_0x48312b,_0x394bda){return _0x48312b[_0xcc50('0xc')](_0xcc50('0xd'),attributes,{'tableName':_0xcc50('0xe'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x42e947,_0x5a2c2d,_0x1a996d){if(_0x42e947[_0xcc50('0xf')](_0xcc50('0x10'))){_0x42e947[_0xcc50('0x11')]=moment()[_0xcc50('0x12')](_0xcc50('0x13'));}_0x1a996d(null,_0x42e947);}}});}; \ No newline at end of file +var _0x25e7=['request-promise','path','rimraf','../../config/environment','WhatsappInteraction','whatsapp_interactions','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x383c6c,_0x599ab9){var _0x4e2172=function(_0x2d5909){while(--_0x2d5909){_0x383c6c['push'](_0x383c6c['shift']());}};_0x4e2172(++_0x599ab9);}(_0x25e7,0x1d6));var _0x725e=function(_0x489730,_0x5226b9){_0x489730=_0x489730-0x0;var _0x7855d1=_0x25e7[_0x489730];return _0x7855d1;};'use strict';var _=require(_0x725e('0x0'));var util=require(_0x725e('0x1'));var logger=require(_0x725e('0x2'))(_0x725e('0x3'));var moment=require(_0x725e('0x4'));var BPromise=require(_0x725e('0x5'));var rp=require(_0x725e('0x6'));var fs=require('fs');var path=require(_0x725e('0x7'));var rimraf=require(_0x725e('0x8'));var config=require(_0x725e('0x9'));var attributes=require('./whatsappInteraction.attributes');module['exports']=function(_0x2497a5,_0x480945){return _0x2497a5['define'](_0x725e('0xa'),attributes,{'tableName':_0x725e('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x216b33,_0x67de0c,_0x40d238){if(_0x216b33[_0x725e('0xc')](_0x725e('0xd'))){_0x216b33[_0x725e('0xe')]=moment()[_0x725e('0xf')](_0x725e('0x10'));}_0x40d238(null,_0x216b33);}}});}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.rpc.js b/server/api/whatsappInteraction/whatsappInteraction.rpc.js index b8ae3d1..cf59579 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 _0x2bc0=['jayson/promise','client','http','defaults','redis','localhost','./whatsappInteraction.socket','register','WhatsappInteraction,\x20%s,\x20%s','request\x20sent','WhatsappInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','WhatsappInteraction','update','options','raw','attributes','limit','then','UpdateWhatsappInteraction','debug','catch','find','where','addTags','body','ids','omit','AddTags','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/environment'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x2bc0,0x118));var _0x02bc=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x2bc0[_0x432682];return _0x463d05;};'use strict';var _=require(_0x02bc('0x0'));var util=require('util');var moment=require(_0x02bc('0x1'));var BPromise=require(_0x02bc('0x2'));var rs=require(_0x02bc('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x02bc('0x4'))['db'];var utils=require(_0x02bc('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x02bc('0x6'));var jayson=require(_0x02bc('0x7'));var client=jayson[_0x02bc('0x8')][_0x02bc('0x9')]({'port':0x232a});config['redis']=_[_0x02bc('0xa')](config[_0x02bc('0xb')],{'host':_0x02bc('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x02bc('0xb')]));require(_0x02bc('0xd'))[_0x02bc('0xe')](socket);function respondWithRpcPromise(_0x2fcb27,_0x5e9747,_0x33e01e){return new BPromise(function(_0x456f28,_0x41f5d9){return client['request'](_0x2fcb27,_0x33e01e)['then'](function(_0x33dc85){logger['info'](_0x02bc('0xf'),_0x5e9747,_0x02bc('0x10'));logger['debug'](_0x02bc('0x11'),_0x5e9747,_0x02bc('0x10'),JSON[_0x02bc('0x12')](_0x33dc85));if(_0x33dc85[_0x02bc('0x13')]){if(_0x33dc85[_0x02bc('0x13')][_0x02bc('0x14')]===0x1f4){logger[_0x02bc('0x13')](_0x02bc('0xf'),_0x5e9747,_0x33dc85[_0x02bc('0x13')][_0x02bc('0x15')]);return _0x41f5d9(_0x33dc85[_0x02bc('0x13')][_0x02bc('0x15')]);}logger[_0x02bc('0x13')](_0x02bc('0xf'),_0x5e9747,_0x33dc85['error'][_0x02bc('0x15')]);return _0x456f28(_0x33dc85[_0x02bc('0x13')][_0x02bc('0x15')]);}else{logger[_0x02bc('0x16')]('WhatsappInteraction,\x20%s,\x20%s',_0x5e9747,_0x02bc('0x10'));_0x456f28(_0x33dc85[_0x02bc('0x17')][_0x02bc('0x15')]);}})['catch'](function(_0x384cb8){logger[_0x02bc('0x13')]('WhatsappInteraction,\x20%s,\x20%s',_0x5e9747,_0x384cb8);_0x41f5d9(_0x384cb8);});});}exports['UpdateWhatsappInteraction']=function(_0x12a66e){var _0x5b59ff=this;return new Promise(function(_0x4d469,_0xc8ed12){return db[_0x02bc('0x18')][_0x02bc('0x19')](_0x12a66e['body'],{'raw':_0x12a66e[_0x02bc('0x1a')]?_0x12a66e[_0x02bc('0x1a')][_0x02bc('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x12a66e[_0x02bc('0x1a')]?_0x12a66e[_0x02bc('0x1a')]['where']||null:null,'attributes':_0x12a66e['options']?_0x12a66e['options'][_0x02bc('0x1c')]||null:null,'limit':_0x12a66e[_0x02bc('0x1a')]?_0x12a66e[_0x02bc('0x1a')][_0x02bc('0x1d')]||null:null})[_0x02bc('0x1e')](function(_0x52d5f1){logger['info'](_0x02bc('0x1f'),_0x12a66e);logger[_0x02bc('0x20')](_0x02bc('0x1f'),_0x12a66e,JSON['stringify'](_0x52d5f1));_0x4d469(_0x52d5f1);})[_0x02bc('0x21')](function(_0x10714c){logger[_0x02bc('0x13')](_0x02bc('0x1f'),_0x10714c[_0x02bc('0x15')],_0x12a66e);_0xc8ed12(_0x5b59ff[_0x02bc('0x13')](0x1f4,_0x10714c['message']));});});};exports['AddTagsToWhatsappInteraction']=function(_0x1aa5ad){return new Promise(function(_0x5dc614,_0x519aa8){return db['WhatsappInteraction'][_0x02bc('0x22')]({'where':_0x1aa5ad[_0x02bc('0x1a')]?_0x1aa5ad[_0x02bc('0x1a')][_0x02bc('0x23')]||null:null})[_0x02bc('0x1e')](function(_0x53a037){if(_0x53a037){return _0x53a037[_0x02bc('0x24')](_0x1aa5ad[_0x02bc('0x25')][_0x02bc('0x26')],_[_0x02bc('0x27')](_0x1aa5ad[_0x02bc('0x25')],[_0x02bc('0x26'),'id'])||{});}})['spread'](function(_0x2afe35){logger[_0x02bc('0x16')]('AddTags',_0x1aa5ad);logger[_0x02bc('0x20')](_0x02bc('0x28'),_0x1aa5ad,JSON[_0x02bc('0x12')](_0x2afe35));_0x5dc614(_0x2afe35);})[_0x02bc('0x21')](function(_0x16c3e5){logger[_0x02bc('0x13')]('AddTags',_0x16c3e5[_0x02bc('0x15')],_0x1aa5ad);_0x519aa8(_this[_0x02bc('0x13')](0x1f4,_0x16c3e5[_0x02bc('0x15')]));});});}; \ No newline at end of file +var _0x0a34=['redis','localhost','./whatsappInteraction.socket','register','info','WhatsappInteraction,\x20%s,\x20%s','WhatsappInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','UpdateWhatsappInteraction','WhatsappInteraction','options','raw','limit','then','debug','AddTagsToWhatsappInteraction','find','addTags','body','ids','spread','AddTags','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/environment','jayson/promise','client'];(function(_0xb301d4,_0x27ed18){var _0x3b5bde=function(_0x1fbc5f){while(--_0x1fbc5f){_0xb301d4['push'](_0xb301d4['shift']());}};_0x3b5bde(++_0x27ed18);}(_0x0a34,0xf3));var _0x40a3=function(_0x4d613c,_0x55f220){_0x4d613c=_0x4d613c-0x0;var _0x301fe3=_0x0a34[_0x4d613c];return _0x301fe3;};'use strict';var _=require(_0x40a3('0x0'));var util=require(_0x40a3('0x1'));var moment=require(_0x40a3('0x2'));var BPromise=require('bluebird');var rs=require(_0x40a3('0x3'));var fs=require('fs');var Redis=require(_0x40a3('0x4'));var db=require(_0x40a3('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x40a3('0x6'));var jayson=require(_0x40a3('0x7'));var client=jayson[_0x40a3('0x8')]['http']({'port':0x232a});config[_0x40a3('0x9')]=_['defaults'](config[_0x40a3('0x9')],{'host':_0x40a3('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x40a3('0x9')]));require(_0x40a3('0xb'))[_0x40a3('0xc')](socket);function respondWithRpcPromise(_0x2794e7,_0x4a2cae,_0x2cf4c3){return new BPromise(function(_0x4ba703,_0x5839b5){return client['request'](_0x2794e7,_0x2cf4c3)['then'](function(_0x574ba0){logger[_0x40a3('0xd')](_0x40a3('0xe'),_0x4a2cae,'request\x20sent');logger['debug'](_0x40a3('0xf'),_0x4a2cae,_0x40a3('0x10'),JSON[_0x40a3('0x11')](_0x574ba0));if(_0x574ba0['error']){if(_0x574ba0[_0x40a3('0x12')][_0x40a3('0x13')]===0x1f4){logger['error'](_0x40a3('0xe'),_0x4a2cae,_0x574ba0[_0x40a3('0x12')][_0x40a3('0x14')]);return _0x5839b5(_0x574ba0[_0x40a3('0x12')][_0x40a3('0x14')]);}logger[_0x40a3('0x12')](_0x40a3('0xe'),_0x4a2cae,_0x574ba0[_0x40a3('0x12')][_0x40a3('0x14')]);return _0x4ba703(_0x574ba0[_0x40a3('0x12')][_0x40a3('0x14')]);}else{logger[_0x40a3('0xd')](_0x40a3('0xe'),_0x4a2cae,_0x40a3('0x10'));_0x4ba703(_0x574ba0['result'][_0x40a3('0x14')]);}})[_0x40a3('0x15')](function(_0x489e14){logger[_0x40a3('0x12')](_0x40a3('0xe'),_0x4a2cae,_0x489e14);_0x5839b5(_0x489e14);});});}exports[_0x40a3('0x16')]=function(_0x12ed9d){var _0x64bb4b=this;return new Promise(function(_0x36ebfc,_0xdce2be){return db[_0x40a3('0x17')]['update'](_0x12ed9d['body'],{'raw':_0x12ed9d[_0x40a3('0x18')]?_0x12ed9d[_0x40a3('0x18')][_0x40a3('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x12ed9d['options']?_0x12ed9d[_0x40a3('0x18')]['where']||null:null,'attributes':_0x12ed9d[_0x40a3('0x18')]?_0x12ed9d[_0x40a3('0x18')]['attributes']||null:null,'limit':_0x12ed9d['options']?_0x12ed9d['options'][_0x40a3('0x1a')]||null:null})[_0x40a3('0x1b')](function(_0x3d0d38){logger[_0x40a3('0xd')](_0x40a3('0x16'),_0x12ed9d);logger[_0x40a3('0x1c')](_0x40a3('0x16'),_0x12ed9d,JSON['stringify'](_0x3d0d38));_0x36ebfc(_0x3d0d38);})[_0x40a3('0x15')](function(_0x5b500c){logger['error'](_0x40a3('0x16'),_0x5b500c[_0x40a3('0x14')],_0x12ed9d);_0xdce2be(_0x64bb4b['error'](0x1f4,_0x5b500c[_0x40a3('0x14')]));});});};exports[_0x40a3('0x1d')]=function(_0x37c125){return new Promise(function(_0x3aebab,_0x5b902c){return db[_0x40a3('0x17')][_0x40a3('0x1e')]({'where':_0x37c125['options']?_0x37c125['options']['where']||null:null})[_0x40a3('0x1b')](function(_0x321c6b){if(_0x321c6b){return _0x321c6b[_0x40a3('0x1f')](_0x37c125[_0x40a3('0x20')][_0x40a3('0x21')],_['omit'](_0x37c125[_0x40a3('0x20')],['ids','id'])||{});}})[_0x40a3('0x22')](function(_0x25ac26){logger[_0x40a3('0xd')](_0x40a3('0x23'),_0x37c125);logger[_0x40a3('0x1c')](_0x40a3('0x23'),_0x37c125,JSON['stringify'](_0x25ac26));_0x3aebab(_0x25ac26);})[_0x40a3('0x15')](function(_0x373ae9){logger['error'](_0x40a3('0x23'),_0x373ae9['message'],_0x37c125);_0x5b902c(_this[_0x40a3('0x12')](0x1f4,_0x373ae9[_0x40a3('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.socket.js b/server/api/whatsappInteraction/whatsappInteraction.socket.js index 46fa61c..2e88a8b 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 _0x97d5=['register','length','whatsappInteraction:','save','update','emit','removeListener'];(function(_0x1dd4c9,_0x2e30de){var _0x210d08=function(_0x5d1ac1){while(--_0x5d1ac1){_0x1dd4c9['push'](_0x1dd4c9['shift']());}};_0x210d08(++_0x2e30de);}(_0x97d5,0x161));var _0x597d=function(_0x50d282,_0x9e3c1e){_0x50d282=_0x50d282-0x0;var _0x8dc146=_0x97d5[_0x50d282];return _0x8dc146;};'use strict';var WhatsappInteractionEvents=require('./whatsappInteraction.events');var events=[_0x597d('0x0'),'remove',_0x597d('0x1')];function createListener(_0x428449,_0xfbb0ba){return function(_0x580fc2){_0xfbb0ba[_0x597d('0x2')](_0x428449,_0x580fc2);};}function removeListener(_0xa9cc64,_0x25efaf){return function(){WhatsappInteractionEvents[_0x597d('0x3')](_0xa9cc64,_0x25efaf);};}exports[_0x597d('0x4')]=function(_0x2a4284){for(var _0x14478c=0x0,_0x44510c=events[_0x597d('0x5')];_0x14478c<_0x44510c;_0x14478c++){var _0xf3def7=events[_0x14478c];var _0x2ee19d=createListener(_0x597d('0x6')+_0xf3def7,_0x2a4284);WhatsappInteractionEvents['on'](_0xf3def7,_0x2ee19d);}}; \ No newline at end of file +var _0xf2de=['save','emit','removeListener','length','whatsappInteraction:','./whatsappInteraction.events'];(function(_0x80eef3,_0x2de4f9){var _0x2961ab=function(_0x4f8e4b){while(--_0x4f8e4b){_0x80eef3['push'](_0x80eef3['shift']());}};_0x2961ab(++_0x2de4f9);}(_0xf2de,0xcb));var _0xef2d=function(_0x455c6c,_0x1e78b7){_0x455c6c=_0x455c6c-0x0;var _0x488242=_0xf2de[_0x455c6c];return _0x488242;};'use strict';var WhatsappInteractionEvents=require(_0xef2d('0x0'));var events=[_0xef2d('0x1'),'remove','update'];function createListener(_0x3b7ae6,_0x2423b9){return function(_0x6821e1){_0x2423b9[_0xef2d('0x2')](_0x3b7ae6,_0x6821e1);};}function removeListener(_0x1964a5,_0x19ef33){return function(){WhatsappInteractionEvents[_0xef2d('0x3')](_0x1964a5,_0x19ef33);};}exports['register']=function(_0x5bfc58){for(var _0x39f9bb=0x0,_0x4582ef=events[_0xef2d('0x4')];_0x39f9bb<_0x4582ef;_0x39f9bb++){var _0x2914e2=events[_0x39f9bb];var _0x3e5786=createListener(_0xef2d('0x5')+_0x2914e2,_0x5bfc58);WhatsappInteractionEvents['on'](_0x2914e2,_0x3e5786);}}; \ No newline at end of file diff --git a/server/api/whatsappMessage/index.js b/server/api/whatsappMessage/index.js index 2f74248..2199fbe 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 _0x1060=['/:id','show','tracked','whatsappmessage:create','post','/:id/status','put','update','/:id/accept','accept','delete','exports','multer','path','connect-timeout','fs-extra','../../components/auth/service','../../config/environment','./whatsappMessage.controller','isAuthenticated','get','describe'];(function(_0xd4a657,_0x377ee7){var _0x4fe743=function(_0x51575d){while(--_0x51575d){_0xd4a657['push'](_0xd4a657['shift']());}};_0x4fe743(++_0x377ee7);}(_0x1060,0x1da));var _0x0106=function(_0x3511d3,_0x4107ae){_0x3511d3=_0x3511d3-0x0;var _0x5d6321=_0x1060[_0x3511d3];return _0x5d6321;};'use strict';var multer=require(_0x0106('0x0'));var util=require('util');var path=require(_0x0106('0x1'));var timeout=require(_0x0106('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x0106('0x3'));var auth=require(_0x0106('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x0106('0x5'));var controller=require(_0x0106('0x6'));router['get']('/',auth[_0x0106('0x7')](),controller['index']);router[_0x0106('0x8')]('/describe',auth[_0x0106('0x7')](),controller[_0x0106('0x9')]);router[_0x0106('0x8')](_0x0106('0xa'),auth[_0x0106('0x7')](),controller[_0x0106('0xb')]);router['post']('/',auth['isAuthenticated'](),interaction[_0x0106('0xc')]('whatsapp',_0x0106('0xd')),controller['create']);router[_0x0106('0xe')](_0x0106('0xf'),controller['status']);router[_0x0106('0x10')](_0x0106('0xa'),auth[_0x0106('0x7')](),controller[_0x0106('0x11')]);router['put'](_0x0106('0x12'),auth[_0x0106('0x7')](),controller[_0x0106('0x13')]);router[_0x0106('0x10')]('/:id/reject',auth[_0x0106('0x7')](),controller['reject']);router[_0x0106('0x14')](_0x0106('0xa'),auth[_0x0106('0x7')](),controller['destroy']);module[_0x0106('0x15')]=router; \ No newline at end of file +var _0xdf12=['/:id/reject','destroy','exports','util','path','fs-extra','../../components/interaction/service','../../config/environment','./whatsappMessage.controller','isAuthenticated','index','get','/describe','describe','/:id','show','post','tracked','whatsappmessage:create','create','/:id/status','status','update','put','/:id/accept'];(function(_0x39542e,_0x31421d){var _0x3506a1=function(_0x59d684){while(--_0x59d684){_0x39542e['push'](_0x39542e['shift']());}};_0x3506a1(++_0x31421d);}(_0xdf12,0xcb));var _0x2df1=function(_0xe4c5b7,_0x32d765){_0xe4c5b7=_0xe4c5b7-0x0;var _0xbdfedd=_0xdf12[_0xe4c5b7];return _0xbdfedd;};'use strict';var multer=require('multer');var util=require(_0x2df1('0x0'));var path=require(_0x2df1('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x2df1('0x2'));var auth=require('../../components/auth/service');var interaction=require(_0x2df1('0x3'));var config=require(_0x2df1('0x4'));var controller=require(_0x2df1('0x5'));router['get']('/',auth[_0x2df1('0x6')](),controller[_0x2df1('0x7')]);router[_0x2df1('0x8')](_0x2df1('0x9'),auth[_0x2df1('0x6')](),controller[_0x2df1('0xa')]);router['get'](_0x2df1('0xb'),auth['isAuthenticated'](),controller[_0x2df1('0xc')]);router[_0x2df1('0xd')]('/',auth['isAuthenticated'](),interaction[_0x2df1('0xe')]('whatsapp',_0x2df1('0xf')),controller[_0x2df1('0x10')]);router[_0x2df1('0xd')](_0x2df1('0x11'),controller[_0x2df1('0x12')]);router['put']('/:id',auth[_0x2df1('0x6')](),controller[_0x2df1('0x13')]);router[_0x2df1('0x14')](_0x2df1('0x15'),auth[_0x2df1('0x6')](),controller['accept']);router[_0x2df1('0x14')](_0x2df1('0x16'),auth[_0x2df1('0x6')](),controller['reject']);router['delete'](_0x2df1('0xb'),auth[_0x2df1('0x6')](),controller[_0x2df1('0x17')]);module[_0x2df1('0x18')]=router; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.attributes.js b/server/api/whatsappMessage/whatsappMessage.attributes.js index 5ed0314..49b5975 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 _0x0b99=['sequelize','medium','out','STRING','DATE','BOOLEAN','TEXT'];(function(_0x2a1b6d,_0x3da85c){var _0x7b481a=function(_0x5b051a){while(--_0x5b051a){_0x2a1b6d['push'](_0x2a1b6d['shift']());}};_0x7b481a(++_0x3da85c);}(_0x0b99,0xd9));var _0x90b9=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x0b99[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require(_0x90b9('0x0'));module['exports']={'body':{'type':Sequelize['TEXT'](_0x90b9('0x1')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0x90b9('0x2')),'defaultValue':_0x90b9('0x2'),'allowNull':![]},'messageId':{'type':Sequelize['STRING'](0xbe)},'phone':{'type':Sequelize[_0x90b9('0x3')]},'readAt':{'type':Sequelize[_0x90b9('0x4')]},'secret':{'type':Sequelize[_0x90b9('0x5')],'defaultValue':![]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0x90b9('0x6')]}}; \ No newline at end of file +var _0x8d48=['STRING','DATE','TEXT','exports','medium','BOOLEAN','out'];(function(_0xa148b7,_0x2f3eb2){var _0x51efd3=function(_0x34bcec){while(--_0x34bcec){_0xa148b7['push'](_0xa148b7['shift']());}};_0x51efd3(++_0x2f3eb2);}(_0x8d48,0x18b));var _0x88d4=function(_0x3cc05d,_0x4b8f88){_0x3cc05d=_0x3cc05d-0x0;var _0x28b736=_0x8d48[_0x3cc05d];return _0x28b736;};'use strict';var Sequelize=require('sequelize');module[_0x88d4('0x0')]={'body':{'type':Sequelize['TEXT'](_0x88d4('0x1')),'allowNull':![]},'read':{'type':Sequelize[_0x88d4('0x2')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0x88d4('0x3')),'defaultValue':_0x88d4('0x3'),'allowNull':![]},'messageId':{'type':Sequelize[_0x88d4('0x4')](0xbe)},'phone':{'type':Sequelize[_0x88d4('0x4')]},'readAt':{'type':Sequelize[_0x88d4('0x5')]},'secret':{'type':Sequelize[_0x88d4('0x2')],'defaultValue':![]},'providerName':{'type':Sequelize[_0x88d4('0x4')]},'providerResponse':{'type':Sequelize[_0x88d4('0x6')]}}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.controller.js b/server/api/whatsappMessage/whatsappMessage.controller.js index fb28760..a54e26c 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 _0x4944=['WhatsappMessage,\x20%s,\x20%s,\x20%s','error','code','WhatsappMessage,\x20%s,\x20%s','message','result','sendStatus','end','status','json','undefined','limit','count','offset','set','Content-Range','apply','save','update','then','destroy','stack','send','index','map','WhatsappMessage','rawAttributes','type','key','model','name','query','keys','filters','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','attributes','body','find','describe','whatsapp-interactions','accept','whatsapp','read','readAt','format','UserId','user','agent','get','isNil','read1stAt','YYYY-MM-DD\x20HH:mm:ss','interaction','[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','stringify','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','Sequelize','QueryTypes','SELECT','User','email','internal','manual','SIP/%s','channel','motionChannel','event','reject','WhatsappInteraction','[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','rejectMessage','sequelize','contact','fullname','interface','EventManager','rejectmessage','WhatsappAccount','WhatsappAccountId','debug','WhatsppMessage,\x20%s,\x20%s,\x20%s','received\x20delivery\x20report\x20from','twilio','MessageSid','messageId','MessageStatus','WhatsappAccount,\x20%s,\x20%s,\x20%s','inspect','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','redis','defaults','localhost','./whatsappMessage.socket','register','jayson/promise','client','http','request','info','request\x20sent'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x4944,0x6d));var _0x4494=function(_0x566add,_0x52c807){_0x566add=_0x566add-0x0;var _0x431f95=_0x4944[_0x566add];return _0x431f95;};'use strict';var emlformat=require(_0x4494('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4494('0x1'));var jsonpatch=require(_0x4494('0x2'));var rp=require(_0x4494('0x3'));var moment=require(_0x4494('0x4'));var BPromise=require(_0x4494('0x5'));var Mustache=require('mustache');var util=require(_0x4494('0x6'));var path=require('path');var sox=require(_0x4494('0x7'));var csv=require(_0x4494('0x8'));var ejs=require(_0x4494('0x9'));var fs=require('fs');var fs_extra=require(_0x4494('0xa'));var _=require(_0x4494('0xb'));var squel=require(_0x4494('0xc'));var crypto=require(_0x4494('0xd'));var jsforce=require(_0x4494('0xe'));var deskjs=require(_0x4494('0xf'));var toCsv=require('to-csv');var querystring=require(_0x4494('0x10'));var Papa=require(_0x4494('0x11'));var Redis=require(_0x4494('0x12'));var authService=require(_0x4494('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4494('0x14'));var logger=require(_0x4494('0x15'))(_0x4494('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x4494('0x17'));var db=require(_0x4494('0x18'))['db'];config[_0x4494('0x19')]=_[_0x4494('0x1a')](config[_0x4494('0x19')],{'host':_0x4494('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x4494('0x19')]));require(_0x4494('0x1c'))[_0x4494('0x1d')](socket);var jayson=require(_0x4494('0x1e'));var client=jayson[_0x4494('0x1f')][_0x4494('0x20')]({'port':0x232c});var client9002=jayson[_0x4494('0x1f')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2caa38,_0x5a0985,_0x5570a4,_0x1a93bc){return new BPromise(function(_0x267d0b,_0x5abaa9){var _0x49350a=_0x1a93bc||client;return _0x49350a[_0x4494('0x21')](_0x2caa38,_0x5570a4)['then'](function(_0x4655ce){logger[_0x4494('0x22')]('WhatsappMessage,\x20%s,\x20%s',_0x5a0985,_0x4494('0x23'));logger['debug'](_0x4494('0x24'),_0x5a0985,_0x4494('0x23'),JSON['stringify'](_0x4655ce));if(_0x4655ce['error']){if(_0x4655ce[_0x4494('0x25')][_0x4494('0x26')]===0x1f4){logger[_0x4494('0x25')](_0x4494('0x27'),_0x5a0985,_0x4655ce[_0x4494('0x25')][_0x4494('0x28')]);return _0x5abaa9(_0x4655ce[_0x4494('0x25')][_0x4494('0x28')]);}logger['error']('WhatsappMessage,\x20%s,\x20%s',_0x5a0985,_0x4655ce['error']['message']);return _0x267d0b(_0x4655ce[_0x4494('0x25')][_0x4494('0x28')]);}else{logger[_0x4494('0x22')](_0x4494('0x27'),_0x5a0985,'request\x20sent');_0x267d0b(_0x4655ce[_0x4494('0x29')][_0x4494('0x28')]);}})['catch'](function(_0x10b231){logger[_0x4494('0x25')](_0x4494('0x27'),_0x5a0985,_0x10b231);_0x5abaa9(_0x10b231);});});}function respondWithStatusCode(_0x4abe3c,_0xfc1631){_0xfc1631=_0xfc1631||0xcc;return function(_0x5926fc){if(_0x5926fc){return _0x4abe3c[_0x4494('0x2a')](_0xfc1631);}return _0x4abe3c['status'](_0xfc1631)[_0x4494('0x2b')]();};}function respondWithResult(_0x2fcc43,_0xce3c8d){_0xce3c8d=_0xce3c8d||0xc8;return function(_0x54f1ea){if(_0x54f1ea){return _0x2fcc43[_0x4494('0x2c')](_0xce3c8d)[_0x4494('0x2d')](_0x54f1ea);}};}function respondWithFilteredResult(_0x491027,_0x268f14){return function(_0x303321){if(_0x303321){var _0x3efe5d=typeof _0x268f14['offset']===_0x4494('0x2e')&&typeof _0x268f14[_0x4494('0x2f')]===_0x4494('0x2e');var _0x19f483=_0x303321[_0x4494('0x30')];var _0x13ea90=_0x3efe5d?0x0:_0x268f14[_0x4494('0x31')];var _0xcce4da=_0x3efe5d?_0x303321['count']:_0x268f14[_0x4494('0x31')]+_0x268f14[_0x4494('0x2f')];var _0x51c69d;if(_0xcce4da>=_0x19f483){_0xcce4da=_0x19f483;_0x51c69d=0xc8;}else{_0x51c69d=0xce;}_0x491027['status'](_0x51c69d);return _0x491027[_0x4494('0x32')](_0x4494('0x33'),_0x13ea90+'-'+_0xcce4da+'/'+_0x19f483)[_0x4494('0x2d')](_0x303321);}return null;};}function patchUpdates(_0x34121b){return function(_0x1e4b74){try{jsonpatch[_0x4494('0x34')](_0x1e4b74,_0x34121b,!![]);}catch(_0x279631){return BPromise['reject'](_0x279631);}return _0x1e4b74[_0x4494('0x35')]();};}function saveUpdates(_0x1c6ff8,_0x2f4740){return function(_0x1f3306){if(_0x1f3306){return _0x1f3306[_0x4494('0x36')](_0x1c6ff8)[_0x4494('0x37')](function(_0x5bba31){return _0x5bba31;});}return null;};}function removeEntity(_0x302108,_0x1009a4){return function(_0x3b3cae){if(_0x3b3cae){return _0x3b3cae[_0x4494('0x38')]()[_0x4494('0x37')](function(){_0x302108['status'](0xcc)[_0x4494('0x2b')]();});}};}function handleEntityNotFound(_0x4dbe69,_0x506e6f){return function(_0x3660ea){if(!_0x3660ea){_0x4dbe69['sendStatus'](0x194);}return _0x3660ea;};}function handleError(_0x5e7a33,_0x5f3612){_0x5f3612=_0x5f3612||0x1f4;return function(_0x477848){logger[_0x4494('0x25')](_0x477848[_0x4494('0x39')]);if(_0x477848['name']){delete _0x477848['name'];}_0x5e7a33[_0x4494('0x2c')](_0x5f3612)[_0x4494('0x3a')](_0x477848);};}exports[_0x4494('0x3b')]=function(_0x166d29,_0xa80999){var _0x260561={},_0x9c1605={},_0x45e88f={'count':0x0,'rows':[]};var _0x180aa9=_[_0x4494('0x3c')](db[_0x4494('0x3d')][_0x4494('0x3e')],function(_0x27d93f){return{'name':_0x27d93f['fieldName'],'type':_0x27d93f[_0x4494('0x3f')][_0x4494('0x40')]};});_0x9c1605[_0x4494('0x41')]=_[_0x4494('0x3c')](_0x180aa9,_0x4494('0x42'));_0x9c1605[_0x4494('0x43')]=_[_0x4494('0x44')](_0x166d29[_0x4494('0x43')]);_0x9c1605[_0x4494('0x45')]=_['intersection'](_0x9c1605['model'],_0x9c1605[_0x4494('0x43')]);_0x260561['attributes']=_[_0x4494('0x46')](_0x9c1605[_0x4494('0x41')],qs[_0x4494('0x47')](_0x166d29[_0x4494('0x43')][_0x4494('0x47')]));_0x260561['attributes']=_0x260561['attributes'][_0x4494('0x48')]?_0x260561['attributes']:_0x9c1605[_0x4494('0x41')];if(!_0x166d29[_0x4494('0x43')][_0x4494('0x49')](_0x4494('0x4a'))){_0x260561[_0x4494('0x2f')]=qs[_0x4494('0x2f')](_0x166d29[_0x4494('0x43')]['limit']);_0x260561[_0x4494('0x31')]=qs[_0x4494('0x31')](_0x166d29['query'][_0x4494('0x31')]);}_0x260561[_0x4494('0x4b')]=qs[_0x4494('0x4c')](_0x166d29['query'][_0x4494('0x4c')]);_0x260561[_0x4494('0x4d')]=qs[_0x4494('0x45')](_[_0x4494('0x4e')](_0x166d29['query'],_0x9c1605['filters']),_0x180aa9);if(_0x166d29[_0x4494('0x43')][_0x4494('0x4f')]){_0x260561[_0x4494('0x4d')]=_['merge'](_0x260561['where'],{'$or':_[_0x4494('0x3c')](_0x180aa9,function(_0x79e98c){if(_0x79e98c[_0x4494('0x3f')]!=='VIRTUAL'){var _0x311414={};_0x311414[_0x79e98c[_0x4494('0x42')]]={'$like':'%'+_0x166d29['query'][_0x4494('0x4f')]+'%'};return _0x311414;}})});}_0x260561=_[_0x4494('0x50')]({},_0x260561,_0x166d29[_0x4494('0x51')]);var _0x3d6647={'where':_0x260561[_0x4494('0x4d')]};return db['WhatsappMessage'][_0x4494('0x30')](_0x3d6647)[_0x4494('0x37')](function(_0x127053){_0x45e88f[_0x4494('0x30')]=_0x127053;if(_0x166d29[_0x4494('0x43')][_0x4494('0x52')]){_0x260561[_0x4494('0x53')]=[{'all':!![]}];}return db[_0x4494('0x3d')][_0x4494('0x54')](_0x260561);})[_0x4494('0x37')](function(_0x4a2d84){_0x45e88f[_0x4494('0x55')]=_0x4a2d84;return _0x45e88f;})['then'](respondWithFilteredResult(_0xa80999,_0x260561))[_0x4494('0x56')](handleError(_0xa80999,null));};exports[_0x4494('0x57')]=function(_0x702ab7,_0x35071a){var _0x473b00={'raw':!![],'where':{'id':_0x702ab7[_0x4494('0x58')]['id']}},_0x4f2af4={};_0x4f2af4['model']=_['keys'](db['WhatsappMessage']['rawAttributes']);_0x4f2af4['query']=_[_0x4494('0x44')](_0x702ab7[_0x4494('0x43')]);_0x4f2af4[_0x4494('0x45')]=_[_0x4494('0x46')](_0x4f2af4[_0x4494('0x41')],_0x4f2af4[_0x4494('0x43')]);_0x473b00[_0x4494('0x59')]=_['intersection'](_0x4f2af4['model'],qs['fields'](_0x702ab7[_0x4494('0x43')][_0x4494('0x47')]));_0x473b00['attributes']=_0x473b00[_0x4494('0x59')][_0x4494('0x48')]?_0x473b00[_0x4494('0x59')]:_0x4f2af4[_0x4494('0x41')];if(_0x702ab7[_0x4494('0x43')]['includeAll']){_0x473b00[_0x4494('0x53')]=[{'all':!![]}];}_0x473b00=_['merge']({},_0x473b00,_0x702ab7['options']);return db[_0x4494('0x3d')]['find'](_0x473b00)[_0x4494('0x37')](handleEntityNotFound(_0x35071a,null))[_0x4494('0x37')](respondWithResult(_0x35071a,null))['catch'](handleError(_0x35071a,null));};exports['create']=function(_0x2a91c2,_0x2fb2f3){return db[_0x4494('0x3d')]['create'](_0x2a91c2[_0x4494('0x5a')],{})[_0x4494('0x37')](respondWithResult(_0x2fb2f3,0xc9))[_0x4494('0x56')](handleError(_0x2fb2f3,null));};exports[_0x4494('0x36')]=function(_0x282b45,_0x238b30){if(_0x282b45['body']['id']){delete _0x282b45['body']['id'];}return db[_0x4494('0x3d')]['find']({'where':{'id':_0x282b45[_0x4494('0x58')]['id']}})[_0x4494('0x37')](handleEntityNotFound(_0x238b30,null))[_0x4494('0x37')](saveUpdates(_0x282b45['body'],null))['then'](respondWithResult(_0x238b30,null))[_0x4494('0x56')](handleError(_0x238b30,null));};exports[_0x4494('0x38')]=function(_0x4766dd,_0x2c7c18){return db[_0x4494('0x3d')][_0x4494('0x5b')]({'where':{'id':_0x4766dd[_0x4494('0x58')]['id']}})['then'](handleEntityNotFound(_0x2c7c18,null))[_0x4494('0x37')](removeEntity(_0x2c7c18,null))[_0x4494('0x56')](handleError(_0x2c7c18,null));};exports['describe']=function(_0x414655,_0x395e58){return db[_0x4494('0x3d')][_0x4494('0x5c')]()[_0x4494('0x37')](respondWithResult(_0x395e58,null))[_0x4494('0x56')](handleError(_0x395e58,null));};var interaction_log=require(_0x4494('0x15'))(_0x4494('0x5d'));exports[_0x4494('0x5e')]=function(_0x567269,_0x3f35e8,_0x588528){var _0x5ed118={'agent':{},'channel':_0x4494('0x5f')};if(_0x567269[_0x4494('0x5a')]['id']){delete _0x567269['body']['id'];}_0x567269[_0x4494('0x5a')][_0x4494('0x60')]=!![];_0x567269[_0x4494('0x5a')][_0x4494('0x61')]=moment()[_0x4494('0x62')]('YYYY-MM-DD\x20HH:mm:ss');_0x567269[_0x4494('0x5a')][_0x4494('0x63')]=_0x567269[_0x4494('0x5a')][_0x4494('0x63')]||_0x567269[_0x4494('0x64')]['id'];_0x5ed118[_0x4494('0x65')]['id']=_0x567269['body']['UserId'];return db[_0x4494('0x3d')][_0x4494('0x5b')]({'where':{'id':_0x567269[_0x4494('0x58')]['id'],'UserId':null}})[_0x4494('0x37')](handleEntityNotFound(_0x3f35e8,null))[_0x4494('0x37')](saveUpdates(_0x567269[_0x4494('0x5a')],null))[_0x4494('0x37')](function(_0x15c6c1){if(_0x15c6c1){_0x5ed118[_0x4494('0x28')]=_0x15c6c1[_0x4494('0x66')]({'plain':!![]});return db['WhatsappInteraction']['find']({'where':{'id':_0x15c6c1['WhatsappInteractionId']}});}return null;})[_0x4494('0x37')](handleEntityNotFound(_0x3f35e8,null))[_0x4494('0x37')](function(_0x5b7a0a){if(_0x5b7a0a){return _0x5b7a0a[_0x4494('0x36')]({'UserId':_0x567269[_0x4494('0x5a')][_0x4494('0x63')],'read1stAt':_[_0x4494('0x67')](_0x5b7a0a[_0x4494('0x68')])?moment()[_0x4494('0x62')](_0x4494('0x69')):undefined});}return null;})['then'](function(_0x5dc19c){if(_0x5dc19c){_0x5ed118[_0x4494('0x6a')]=_0x5dc19c[_0x4494('0x66')]({'plain':!![]});interaction_log[_0x4494('0x22')](_0x4494('0x6b'),_0x567269[_0x4494('0x64')]['id'],_0x567269[_0x4494('0x64')][_0x4494('0x42')],_0x567269['user'][_0x4494('0x6c')],_0x5ed118['interaction']['id'],_0x567269['body']?JSON[_0x4494('0x6d')](_0x567269[_0x4494('0x5a')]):'null');return respondWithRpcPromise('AcceptMessage',_0x4494('0x6e'),_0x5ed118);}return null;})[_0x4494('0x37')](function(_0x4f6387){var _0x1a6c03=_0x4494('0x6f')+_0x4f6387[_0x4494('0x28')]['ContactId'];return db['sequelize']['query'](_0x1a6c03,{'type':db[_0x4494('0x70')][_0x4494('0x71')][_0x4494('0x72')],'raw':!![]})[_0x4494('0x37')](function(_0x119bc4){return _0x119bc4;});})['then'](function(_0x2382e3){if(_0x2382e3){_0x5ed118['message']['contact']=_0x2382e3[0x0];if(!_0x567269[_0x4494('0x5a')]['UserId'])return;return db[_0x4494('0x73')]['find']({'where':{'id':_0x567269[_0x4494('0x5a')]['UserId'],'role':'agent'},'attributes':['id','name','fullname',_0x4494('0x74'),_0x4494('0x75')],'raw':!![]});}return null;})[_0x4494('0x37')](function(_0x3a7491){if(!_0x3a7491)return null;_0x5ed118[_0x4494('0x28')][_0x4494('0x65')]=_0x3a7491;return _0x5ed118;})[_0x4494('0x37')](function(_0x46ec48){if(_0x46ec48){if(_0x567269[_0x4494('0x5a')][_0x4494('0x76')]){_0x5ed118['message']['interface']=util['format'](_0x4494('0x77'),_0x567269[_0x4494('0x64')][_0x4494('0x42')]);_0x5ed118['message'][_0x4494('0x78')]=_0x5ed118[_0x4494('0x78')];_0x5ed118[_0x4494('0x28')][_0x4494('0x79')]=_0x5ed118[_0x4494('0x78')];_0x5ed118['message'][_0x4494('0x7a')]=_0x4494('0x5e');return respondWithRpcPromise('EventManager','EventManager',{'event':'acceptmessage','message':_0x5ed118['message']},client9002)['then'](function(){return _0x5ed118;});}return _0x5ed118;}return null;})['then'](respondWithResult(_0x3f35e8,null))[_0x4494('0x56')](handleError(_0x3f35e8,null));};var interaction_log=require(_0x4494('0x15'))(_0x4494('0x5d'));exports[_0x4494('0x7b')]=function(_0x421cb5,_0x39595b,_0x4fcef9){var _0x5b0345={'agent':{},'channel':_0x4494('0x5f')};if(_0x421cb5['body']['id']){delete _0x421cb5[_0x4494('0x5a')]['id'];}_0x421cb5[_0x4494('0x5a')][_0x4494('0x63')]=_0x421cb5[_0x4494('0x5a')][_0x4494('0x63')]||_0x421cb5['user']['id'];_0x5b0345[_0x4494('0x65')]['id']=_0x421cb5[_0x4494('0x5a')]['UserId'];return db['WhatsappMessage'][_0x4494('0x5b')]({'where':{'id':_0x421cb5[_0x4494('0x58')]['id'],'UserId':null}})[_0x4494('0x37')](handleEntityNotFound(_0x39595b,null))[_0x4494('0x37')](function(_0xc67379){if(_0xc67379){_0x5b0345[_0x4494('0x28')]=_0xc67379[_0x4494('0x66')]({'plain':!![]});return db[_0x4494('0x7c')][_0x4494('0x5b')]({'where':{'id':_0xc67379['WhatsappInteractionId']}});}return null;})[_0x4494('0x37')](handleEntityNotFound(_0x39595b,null))['then'](function(_0x344817){if(_0x344817){_0x5b0345[_0x4494('0x6a')]=_0x344817[_0x4494('0x66')]({'plain':!![]});interaction_log['info'](_0x4494('0x7d'),_0x421cb5['user']['id'],_0x421cb5[_0x4494('0x64')][_0x4494('0x42')],_0x421cb5[_0x4494('0x64')][_0x4494('0x6c')],_0x5b0345[_0x4494('0x6a')]['id'],_0x421cb5[_0x4494('0x5a')]?JSON['stringify'](_0x421cb5[_0x4494('0x5a')]):_0x4494('0x7e'));return respondWithRpcPromise('RejectMessage',_0x4494('0x7f'),_0x5b0345);}return null;})['then'](function(_0xd4c3fe){var _0x3e5551=_0x4494('0x6f')+_0xd4c3fe[_0x4494('0x28')]['ContactId'];return db[_0x4494('0x80')]['query'](_0x3e5551,{'type':db[_0x4494('0x70')][_0x4494('0x71')][_0x4494('0x72')],'raw':!![]})[_0x4494('0x37')](function(_0x2d1a9c){return _0x2d1a9c;});})['then'](function(_0x5618af){if(_0x5618af){_0x5b0345[_0x4494('0x28')][_0x4494('0x81')]=_0x5618af[0x0];if(!_0x421cb5['body'][_0x4494('0x63')])return;return db[_0x4494('0x73')][_0x4494('0x5b')]({'where':{'id':_0x421cb5['body'][_0x4494('0x63')],'role':_0x4494('0x65')},'attributes':['id',_0x4494('0x42'),_0x4494('0x82'),_0x4494('0x74'),'internal'],'raw':!![]});}return null;})[_0x4494('0x37')](function(_0x47677d){if(!_0x47677d)return null;_0x5b0345[_0x4494('0x28')]['agent']=_0x47677d;return _0x5b0345;})['then'](function(_0x431d01){if(_0x431d01){_0x431d01[_0x4494('0x28')][_0x4494('0x83')]=util['format'](_0x4494('0x77'),_0x421cb5['user'][_0x4494('0x42')]);_0x431d01[_0x4494('0x28')][_0x4494('0x78')]=_0x5b0345[_0x4494('0x78')];_0x431d01[_0x4494('0x28')][_0x4494('0x79')]=_0x5b0345[_0x4494('0x78')];_0x431d01[_0x4494('0x28')][_0x4494('0x7a')]=_0x4494('0x7b');respondWithRpcPromise(_0x4494('0x84'),'EventManager',{'event':_0x4494('0x85'),'message':_0x431d01[_0x4494('0x28')]},client9002);return _0x5b0345;}return null;})[_0x4494('0x37')](respondWithResult(_0x39595b,null))[_0x4494('0x56')](handleError(_0x39595b,null));};exports[_0x4494('0x2c')]=function(_0x2b7a69,_0x1c235a,_0x465c4e){if(_0x2b7a69[_0x4494('0x5a')]['id']){delete _0x2b7a69['body']['id'];}var _0x5f589c;return db[_0x4494('0x3d')][_0x4494('0x5b')]({'where':{'id':_0x2b7a69[_0x4494('0x58')]['id']}})[_0x4494('0x37')](handleEntityNotFound(_0x1c235a,null))[_0x4494('0x37')](function(_0x46c002){if(_0x46c002){_0x5f589c=_0x46c002;return db[_0x4494('0x86')][_0x4494('0x5b')]({'where':{'id':_0x46c002[_0x4494('0x87')]}});}})[_0x4494('0x37')](handleEntityNotFound(_0x1c235a,null))[_0x4494('0x37')](function(_0x3c5c68){if(_0x3c5c68){logger[_0x4494('0x88')](_0x4494('0x89'),_0x4494('0x2c'),_0x4494('0x8a'),_0x3c5c68['type'],util['inspect'](_0x2b7a69[_0x4494('0x5a')],{'showHidden':![],'depth':null}));switch(_0x3c5c68[_0x4494('0x3f')]){case _0x4494('0x8b'):if(_0x2b7a69['body'][_0x4494('0x8c')]&&_0x2b7a69[_0x4494('0x5a')]['MessageSid']===_0x5f589c[_0x4494('0x8d')]&&_0x2b7a69[_0x4494('0x5a')][_0x4494('0x8e')]&&_0x2b7a69[_0x4494('0x5a')]['MessageStatus']===_0x4494('0x60')){return _0x5f589c[_0x4494('0x36')]({'read':!![]});}else{logger[_0x4494('0x25')](_0x4494('0x8f'),_0x4494('0x2c'),_0x4494('0x8b'),util[_0x4494('0x90')](_0x2b7a69['body'],{'showHidden':![],'depth':null}));}break;}return _0x5f589c;}})[_0x4494('0x37')](respondWithResult(_0x1c235a,null))[_0x4494('0x56')](handleError(_0x1c235a,null));}; \ No newline at end of file +var _0x4071=['SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','QueryTypes','contact','User','fullname','internal','manual','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','reject','WhatsappInteraction','WhatsappInteractionId','[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','SELECT','email','interface','WhatsappAccountId','WhatsppMessage,\x20%s,\x20%s,\x20%s','received\x20delivery\x20report\x20from','twilio','messageId','MessageStatus','WhatsappAccount,\x20%s,\x20%s,\x20%s','inspect','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','redis','defaults','localhost','socket.io-emitter','./whatsappMessage.socket','register','http','request','then','info','WhatsappMessage,\x20%s,\x20%s','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','end','status','json','limit','undefined','count','offset','set','Content-Range','save','destroy','sendStatus','stack','name','send','index','WhatsappMessage','type','key','model','map','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','params','rawAttributes','length','includeAll','find','create','body','update','describe','../../config/logger','whatsapp-interactions','accept','whatsapp','read','readAt','format','UserId','user','agent','get','isNil','YYYY-MM-DD\x20HH:mm:ss','[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','interaction','AcceptMessage','acceptMessage'];(function(_0xfdd504,_0x517227){var _0x58b6f9=function(_0x12a151){while(--_0x12a151){_0xfdd504['push'](_0xfdd504['shift']());}};_0x58b6f9(++_0x517227);}(_0x4071,0x1c0));var _0x1407=function(_0x36ddfa,_0x34d4fb){_0x36ddfa=_0x36ddfa-0x0;var _0x227b9e=_0x4071[_0x36ddfa];return _0x227b9e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1407('0x0'));var zipdir=require(_0x1407('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1407('0x2'));var moment=require(_0x1407('0x3'));var BPromise=require(_0x1407('0x4'));var Mustache=require(_0x1407('0x5'));var util=require(_0x1407('0x6'));var path=require(_0x1407('0x7'));var sox=require(_0x1407('0x8'));var csv=require(_0x1407('0x9'));var ejs=require(_0x1407('0xa'));var fs=require('fs');var fs_extra=require(_0x1407('0xb'));var _=require(_0x1407('0xc'));var squel=require(_0x1407('0xd'));var crypto=require(_0x1407('0xe'));var jsforce=require(_0x1407('0xf'));var deskjs=require(_0x1407('0x10'));var toCsv=require(_0x1407('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x1407('0x11'));var as=require(_0x1407('0x12'));var hardwareService=require(_0x1407('0x13'));var logger=require('../../config/logger')(_0x1407('0x14'));var utils=require(_0x1407('0x15'));var config=require(_0x1407('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0x1407('0x17')]=_[_0x1407('0x18')](config[_0x1407('0x17')],{'host':_0x1407('0x19'),'port':0x18eb});var socket=require(_0x1407('0x1a'))(new Redis(config[_0x1407('0x17')]));require(_0x1407('0x1b'))[_0x1407('0x1c')](socket);var jayson=require('jayson/promise');var client=jayson['client'][_0x1407('0x1d')]({'port':0x232c});var client9002=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x552136,_0x57ab28,_0x29cdf7,_0x1c7f89){return new BPromise(function(_0x3e0f9e,_0x5a62ed){var _0x3f9b09=_0x1c7f89||client;return _0x3f9b09[_0x1407('0x1e')](_0x552136,_0x29cdf7)[_0x1407('0x1f')](function(_0x2c7acc){logger[_0x1407('0x20')](_0x1407('0x21'),_0x57ab28,'request\x20sent');logger[_0x1407('0x22')](_0x1407('0x23'),_0x57ab28,_0x1407('0x24'),JSON[_0x1407('0x25')](_0x2c7acc));if(_0x2c7acc['error']){if(_0x2c7acc[_0x1407('0x26')]['code']===0x1f4){logger[_0x1407('0x26')](_0x1407('0x21'),_0x57ab28,_0x2c7acc[_0x1407('0x26')][_0x1407('0x27')]);return _0x5a62ed(_0x2c7acc['error'][_0x1407('0x27')]);}logger['error']('WhatsappMessage,\x20%s,\x20%s',_0x57ab28,_0x2c7acc[_0x1407('0x26')][_0x1407('0x27')]);return _0x3e0f9e(_0x2c7acc[_0x1407('0x26')][_0x1407('0x27')]);}else{logger[_0x1407('0x20')]('WhatsappMessage,\x20%s,\x20%s',_0x57ab28,_0x1407('0x24'));_0x3e0f9e(_0x2c7acc[_0x1407('0x28')][_0x1407('0x27')]);}})[_0x1407('0x29')](function(_0x4ebdeb){logger[_0x1407('0x26')](_0x1407('0x21'),_0x57ab28,_0x4ebdeb);_0x5a62ed(_0x4ebdeb);});});}function respondWithStatusCode(_0x50d0a2,_0x3ab275){_0x3ab275=_0x3ab275||0xcc;return function(_0x5443fe){if(_0x5443fe){return _0x50d0a2['sendStatus'](_0x3ab275);}return _0x50d0a2['status'](_0x3ab275)[_0x1407('0x2a')]();};}function respondWithResult(_0xc9e1b3,_0x18a941){_0x18a941=_0x18a941||0xc8;return function(_0x19b514){if(_0x19b514){return _0xc9e1b3[_0x1407('0x2b')](_0x18a941)[_0x1407('0x2c')](_0x19b514);}};}function respondWithFilteredResult(_0x3cba92,_0x370afb){return function(_0x478ac0){if(_0x478ac0){var _0x44f2df=typeof _0x370afb['offset']==='undefined'&&typeof _0x370afb[_0x1407('0x2d')]===_0x1407('0x2e');var _0x36f8c5=_0x478ac0[_0x1407('0x2f')];var _0xb2a8f1=_0x44f2df?0x0:_0x370afb[_0x1407('0x30')];var _0x505ebe=_0x44f2df?_0x478ac0['count']:_0x370afb[_0x1407('0x30')]+_0x370afb[_0x1407('0x2d')];var _0x24cbc5;if(_0x505ebe>=_0x36f8c5){_0x505ebe=_0x36f8c5;_0x24cbc5=0xc8;}else{_0x24cbc5=0xce;}_0x3cba92['status'](_0x24cbc5);return _0x3cba92[_0x1407('0x31')](_0x1407('0x32'),_0xb2a8f1+'-'+_0x505ebe+'/'+_0x36f8c5)[_0x1407('0x2c')](_0x478ac0);}return null;};}function patchUpdates(_0x21814d){return function(_0x397f90){try{jsonpatch['apply'](_0x397f90,_0x21814d,!![]);}catch(_0x43273a){return BPromise['reject'](_0x43273a);}return _0x397f90[_0x1407('0x33')]();};}function saveUpdates(_0x4f7480,_0x570e80){return function(_0x3a11fd){if(_0x3a11fd){return _0x3a11fd['update'](_0x4f7480)[_0x1407('0x1f')](function(_0x39ad98){return _0x39ad98;});}return null;};}function removeEntity(_0x2a6b7f,_0x593e32){return function(_0x5f0f03){if(_0x5f0f03){return _0x5f0f03[_0x1407('0x34')]()[_0x1407('0x1f')](function(){_0x2a6b7f[_0x1407('0x2b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x36a30f,_0x3df260){return function(_0x302683){if(!_0x302683){_0x36a30f[_0x1407('0x35')](0x194);}return _0x302683;};}function handleError(_0x5275c2,_0x2fbe67){_0x2fbe67=_0x2fbe67||0x1f4;return function(_0xb9da93){logger[_0x1407('0x26')](_0xb9da93[_0x1407('0x36')]);if(_0xb9da93[_0x1407('0x37')]){delete _0xb9da93[_0x1407('0x37')];}_0x5275c2[_0x1407('0x2b')](_0x2fbe67)[_0x1407('0x38')](_0xb9da93);};}exports[_0x1407('0x39')]=function(_0x2fc6ab,_0x326c80){var _0x258e3f={},_0x47238a={},_0x13bc72={'count':0x0,'rows':[]};var _0x56db63=_['map'](db[_0x1407('0x3a')]['rawAttributes'],function(_0x49b8fd){return{'name':_0x49b8fd['fieldName'],'type':_0x49b8fd[_0x1407('0x3b')][_0x1407('0x3c')]};});_0x47238a[_0x1407('0x3d')]=_[_0x1407('0x3e')](_0x56db63,_0x1407('0x37'));_0x47238a[_0x1407('0x3f')]=_[_0x1407('0x40')](_0x2fc6ab[_0x1407('0x3f')]);_0x47238a[_0x1407('0x41')]=_[_0x1407('0x42')](_0x47238a['model'],_0x47238a['query']);_0x258e3f[_0x1407('0x43')]=_[_0x1407('0x42')](_0x47238a[_0x1407('0x3d')],qs[_0x1407('0x44')](_0x2fc6ab[_0x1407('0x3f')][_0x1407('0x44')]));_0x258e3f[_0x1407('0x43')]=_0x258e3f[_0x1407('0x43')]['length']?_0x258e3f['attributes']:_0x47238a[_0x1407('0x3d')];if(!_0x2fc6ab['query'][_0x1407('0x45')](_0x1407('0x46'))){_0x258e3f[_0x1407('0x2d')]=qs[_0x1407('0x2d')](_0x2fc6ab[_0x1407('0x3f')][_0x1407('0x2d')]);_0x258e3f['offset']=qs[_0x1407('0x30')](_0x2fc6ab[_0x1407('0x3f')][_0x1407('0x30')]);}_0x258e3f[_0x1407('0x47')]=qs['sort'](_0x2fc6ab[_0x1407('0x3f')][_0x1407('0x48')]);_0x258e3f[_0x1407('0x49')]=qs['filters'](_[_0x1407('0x4a')](_0x2fc6ab['query'],_0x47238a[_0x1407('0x41')]),_0x56db63);if(_0x2fc6ab[_0x1407('0x3f')][_0x1407('0x4b')]){_0x258e3f['where']=_[_0x1407('0x4c')](_0x258e3f[_0x1407('0x49')],{'$or':_[_0x1407('0x3e')](_0x56db63,function(_0x4e65c3){if(_0x4e65c3['type']!==_0x1407('0x4d')){var _0x359192={};_0x359192[_0x4e65c3[_0x1407('0x37')]]={'$like':'%'+_0x2fc6ab[_0x1407('0x3f')][_0x1407('0x4b')]+'%'};return _0x359192;}})});}_0x258e3f=_['merge']({},_0x258e3f,_0x2fc6ab[_0x1407('0x4e')]);var _0x185633={'where':_0x258e3f[_0x1407('0x49')]};return db[_0x1407('0x3a')][_0x1407('0x2f')](_0x185633)[_0x1407('0x1f')](function(_0x5d06bb){_0x13bc72[_0x1407('0x2f')]=_0x5d06bb;if(_0x2fc6ab['query']['includeAll']){_0x258e3f[_0x1407('0x4f')]=[{'all':!![]}];}return db[_0x1407('0x3a')][_0x1407('0x50')](_0x258e3f);})[_0x1407('0x1f')](function(_0x593d04){_0x13bc72['rows']=_0x593d04;return _0x13bc72;})[_0x1407('0x1f')](respondWithFilteredResult(_0x326c80,_0x258e3f))['catch'](handleError(_0x326c80,null));};exports['show']=function(_0x61dc07,_0xbf615a){var _0xdb2e84={'raw':!![],'where':{'id':_0x61dc07[_0x1407('0x51')]['id']}},_0x1284c4={};_0x1284c4[_0x1407('0x3d')]=_['keys'](db[_0x1407('0x3a')][_0x1407('0x52')]);_0x1284c4[_0x1407('0x3f')]=_[_0x1407('0x40')](_0x61dc07[_0x1407('0x3f')]);_0x1284c4[_0x1407('0x41')]=_[_0x1407('0x42')](_0x1284c4[_0x1407('0x3d')],_0x1284c4[_0x1407('0x3f')]);_0xdb2e84[_0x1407('0x43')]=_[_0x1407('0x42')](_0x1284c4[_0x1407('0x3d')],qs[_0x1407('0x44')](_0x61dc07[_0x1407('0x3f')][_0x1407('0x44')]));_0xdb2e84['attributes']=_0xdb2e84[_0x1407('0x43')][_0x1407('0x53')]?_0xdb2e84[_0x1407('0x43')]:_0x1284c4[_0x1407('0x3d')];if(_0x61dc07['query'][_0x1407('0x54')]){_0xdb2e84[_0x1407('0x4f')]=[{'all':!![]}];}_0xdb2e84=_[_0x1407('0x4c')]({},_0xdb2e84,_0x61dc07[_0x1407('0x4e')]);return db['WhatsappMessage'][_0x1407('0x55')](_0xdb2e84)['then'](handleEntityNotFound(_0xbf615a,null))[_0x1407('0x1f')](respondWithResult(_0xbf615a,null))['catch'](handleError(_0xbf615a,null));};exports['create']=function(_0x48bdaa,_0x1668fa){return db[_0x1407('0x3a')][_0x1407('0x56')](_0x48bdaa[_0x1407('0x57')],{})['then'](respondWithResult(_0x1668fa,0xc9))['catch'](handleError(_0x1668fa,null));};exports[_0x1407('0x58')]=function(_0x269855,_0x3ae911){if(_0x269855[_0x1407('0x57')]['id']){delete _0x269855[_0x1407('0x57')]['id'];}return db['WhatsappMessage'][_0x1407('0x55')]({'where':{'id':_0x269855[_0x1407('0x51')]['id']}})[_0x1407('0x1f')](handleEntityNotFound(_0x3ae911,null))[_0x1407('0x1f')](saveUpdates(_0x269855['body'],null))[_0x1407('0x1f')](respondWithResult(_0x3ae911,null))[_0x1407('0x29')](handleError(_0x3ae911,null));};exports[_0x1407('0x34')]=function(_0xc2928b,_0x2840c3){return db['WhatsappMessage'][_0x1407('0x55')]({'where':{'id':_0xc2928b[_0x1407('0x51')]['id']}})['then'](handleEntityNotFound(_0x2840c3,null))[_0x1407('0x1f')](removeEntity(_0x2840c3,null))[_0x1407('0x29')](handleError(_0x2840c3,null));};exports[_0x1407('0x59')]=function(_0x512921,_0x21f8e9){return db[_0x1407('0x3a')][_0x1407('0x59')]()[_0x1407('0x1f')](respondWithResult(_0x21f8e9,null))[_0x1407('0x29')](handleError(_0x21f8e9,null));};var interaction_log=require(_0x1407('0x5a'))(_0x1407('0x5b'));exports[_0x1407('0x5c')]=function(_0xe1b8ed,_0x29c65c,_0x541732){var _0x5209a2={'agent':{},'channel':_0x1407('0x5d')};if(_0xe1b8ed[_0x1407('0x57')]['id']){delete _0xe1b8ed[_0x1407('0x57')]['id'];}_0xe1b8ed[_0x1407('0x57')][_0x1407('0x5e')]=!![];_0xe1b8ed[_0x1407('0x57')][_0x1407('0x5f')]=moment()[_0x1407('0x60')]('YYYY-MM-DD\x20HH:mm:ss');_0xe1b8ed[_0x1407('0x57')][_0x1407('0x61')]=_0xe1b8ed[_0x1407('0x57')]['UserId']||_0xe1b8ed[_0x1407('0x62')]['id'];_0x5209a2[_0x1407('0x63')]['id']=_0xe1b8ed[_0x1407('0x57')][_0x1407('0x61')];return db[_0x1407('0x3a')]['find']({'where':{'id':_0xe1b8ed[_0x1407('0x51')]['id'],'UserId':null}})[_0x1407('0x1f')](handleEntityNotFound(_0x29c65c,null))[_0x1407('0x1f')](saveUpdates(_0xe1b8ed[_0x1407('0x57')],null))['then'](function(_0x1cbc81){if(_0x1cbc81){_0x5209a2[_0x1407('0x27')]=_0x1cbc81[_0x1407('0x64')]({'plain':!![]});return db['WhatsappInteraction']['find']({'where':{'id':_0x1cbc81['WhatsappInteractionId']}});}return null;})[_0x1407('0x1f')](handleEntityNotFound(_0x29c65c,null))[_0x1407('0x1f')](function(_0xc0670a){if(_0xc0670a){return _0xc0670a[_0x1407('0x58')]({'UserId':_0xe1b8ed[_0x1407('0x57')][_0x1407('0x61')],'read1stAt':_[_0x1407('0x65')](_0xc0670a['read1stAt'])?moment()[_0x1407('0x60')](_0x1407('0x66')):undefined});}return null;})[_0x1407('0x1f')](function(_0x48a6a9){if(_0x48a6a9){_0x5209a2['interaction']=_0x48a6a9[_0x1407('0x64')]({'plain':!![]});interaction_log[_0x1407('0x20')](_0x1407('0x67'),_0xe1b8ed[_0x1407('0x62')]['id'],_0xe1b8ed[_0x1407('0x62')][_0x1407('0x37')],_0xe1b8ed[_0x1407('0x62')][_0x1407('0x68')],_0x5209a2[_0x1407('0x69')]['id'],_0xe1b8ed[_0x1407('0x57')]?JSON[_0x1407('0x25')](_0xe1b8ed[_0x1407('0x57')]):'null');return respondWithRpcPromise(_0x1407('0x6a'),_0x1407('0x6b'),_0x5209a2);}return null;})[_0x1407('0x1f')](function(_0x589a86){var _0x1a0ba9=_0x1407('0x6c')+_0x589a86[_0x1407('0x27')][_0x1407('0x6d')];return db[_0x1407('0x6e')][_0x1407('0x3f')](_0x1a0ba9,{'type':db['Sequelize'][_0x1407('0x6f')]['SELECT'],'raw':!![]})[_0x1407('0x1f')](function(_0x23dfe0){return _0x23dfe0;});})['then'](function(_0x8455ac){if(_0x8455ac){_0x5209a2[_0x1407('0x27')][_0x1407('0x70')]=_0x8455ac[0x0];if(!_0xe1b8ed[_0x1407('0x57')][_0x1407('0x61')])return;return db[_0x1407('0x71')]['find']({'where':{'id':_0xe1b8ed[_0x1407('0x57')][_0x1407('0x61')],'role':_0x1407('0x63')},'attributes':['id',_0x1407('0x37'),_0x1407('0x72'),'email',_0x1407('0x73')],'raw':!![]});}return null;})['then'](function(_0x38aebb){if(!_0x38aebb)return null;_0x5209a2['message'][_0x1407('0x63')]=_0x38aebb;return _0x5209a2;})['then'](function(_0xcd5b32){if(_0xcd5b32){if(_0xe1b8ed[_0x1407('0x57')][_0x1407('0x74')]){_0x5209a2[_0x1407('0x27')]['interface']=util[_0x1407('0x60')](_0x1407('0x75'),_0xe1b8ed[_0x1407('0x62')][_0x1407('0x37')]);_0x5209a2[_0x1407('0x27')][_0x1407('0x76')]=_0x5209a2[_0x1407('0x76')];_0x5209a2[_0x1407('0x27')][_0x1407('0x77')]=_0x5209a2[_0x1407('0x76')];_0x5209a2['message'][_0x1407('0x78')]=_0x1407('0x5c');return respondWithRpcPromise(_0x1407('0x79'),_0x1407('0x79'),{'event':_0x1407('0x7a'),'message':_0x5209a2[_0x1407('0x27')]},client9002)[_0x1407('0x1f')](function(){return _0x5209a2;});}return _0x5209a2;}return null;})[_0x1407('0x1f')](respondWithResult(_0x29c65c,null))['catch'](handleError(_0x29c65c,null));};var interaction_log=require(_0x1407('0x5a'))(_0x1407('0x5b'));exports[_0x1407('0x7b')]=function(_0x51caba,_0x588d6e,_0x3fd8d4){var _0x2a39bd={'agent':{},'channel':_0x1407('0x5d')};if(_0x51caba['body']['id']){delete _0x51caba['body']['id'];}_0x51caba[_0x1407('0x57')][_0x1407('0x61')]=_0x51caba[_0x1407('0x57')][_0x1407('0x61')]||_0x51caba[_0x1407('0x62')]['id'];_0x2a39bd[_0x1407('0x63')]['id']=_0x51caba[_0x1407('0x57')][_0x1407('0x61')];return db['WhatsappMessage'][_0x1407('0x55')]({'where':{'id':_0x51caba['params']['id'],'UserId':null}})[_0x1407('0x1f')](handleEntityNotFound(_0x588d6e,null))[_0x1407('0x1f')](function(_0x19ef9b){if(_0x19ef9b){_0x2a39bd[_0x1407('0x27')]=_0x19ef9b['get']({'plain':!![]});return db[_0x1407('0x7c')]['find']({'where':{'id':_0x19ef9b[_0x1407('0x7d')]}});}return null;})['then'](handleEntityNotFound(_0x588d6e,null))[_0x1407('0x1f')](function(_0x5bbe38){if(_0x5bbe38){_0x2a39bd[_0x1407('0x69')]=_0x5bbe38[_0x1407('0x64')]({'plain':!![]});interaction_log[_0x1407('0x20')](_0x1407('0x7e'),_0x51caba[_0x1407('0x62')]['id'],_0x51caba['user']['name'],_0x51caba['user']['role'],_0x2a39bd[_0x1407('0x69')]['id'],_0x51caba[_0x1407('0x57')]?JSON[_0x1407('0x25')](_0x51caba[_0x1407('0x57')]):_0x1407('0x7f'));return respondWithRpcPromise('RejectMessage','rejectMessage',_0x2a39bd);}return null;})['then'](function(_0x11d63c){var _0x3167ed='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x11d63c[_0x1407('0x27')][_0x1407('0x6d')];return db[_0x1407('0x6e')][_0x1407('0x3f')](_0x3167ed,{'type':db['Sequelize'][_0x1407('0x6f')][_0x1407('0x80')],'raw':!![]})[_0x1407('0x1f')](function(_0xaa3944){return _0xaa3944;});})[_0x1407('0x1f')](function(_0x41e029){if(_0x41e029){_0x2a39bd[_0x1407('0x27')][_0x1407('0x70')]=_0x41e029[0x0];if(!_0x51caba[_0x1407('0x57')]['UserId'])return;return db[_0x1407('0x71')][_0x1407('0x55')]({'where':{'id':_0x51caba[_0x1407('0x57')][_0x1407('0x61')],'role':_0x1407('0x63')},'attributes':['id',_0x1407('0x37'),_0x1407('0x72'),_0x1407('0x81'),_0x1407('0x73')],'raw':!![]});}return null;})['then'](function(_0x1f1063){if(!_0x1f1063)return null;_0x2a39bd[_0x1407('0x27')][_0x1407('0x63')]=_0x1f1063;return _0x2a39bd;})['then'](function(_0x1f6350){if(_0x1f6350){_0x1f6350[_0x1407('0x27')][_0x1407('0x82')]=util[_0x1407('0x60')]('SIP/%s',_0x51caba[_0x1407('0x62')][_0x1407('0x37')]);_0x1f6350['message'][_0x1407('0x76')]=_0x2a39bd[_0x1407('0x76')];_0x1f6350[_0x1407('0x27')][_0x1407('0x77')]=_0x2a39bd[_0x1407('0x76')];_0x1f6350[_0x1407('0x27')][_0x1407('0x78')]=_0x1407('0x7b');respondWithRpcPromise(_0x1407('0x79'),_0x1407('0x79'),{'event':'rejectmessage','message':_0x1f6350[_0x1407('0x27')]},client9002);return _0x2a39bd;}return null;})['then'](respondWithResult(_0x588d6e,null))[_0x1407('0x29')](handleError(_0x588d6e,null));};exports[_0x1407('0x2b')]=function(_0x114875,_0x610ac7,_0x44c039){if(_0x114875[_0x1407('0x57')]['id']){delete _0x114875[_0x1407('0x57')]['id'];}var _0x4a5c41;return db[_0x1407('0x3a')][_0x1407('0x55')]({'where':{'id':_0x114875[_0x1407('0x51')]['id']}})[_0x1407('0x1f')](handleEntityNotFound(_0x610ac7,null))[_0x1407('0x1f')](function(_0x384226){if(_0x384226){_0x4a5c41=_0x384226;return db['WhatsappAccount'][_0x1407('0x55')]({'where':{'id':_0x384226[_0x1407('0x83')]}});}})['then'](handleEntityNotFound(_0x610ac7,null))[_0x1407('0x1f')](function(_0x3dbd1f){if(_0x3dbd1f){logger['debug'](_0x1407('0x84'),'status',_0x1407('0x85'),_0x3dbd1f['type'],util['inspect'](_0x114875['body'],{'showHidden':![],'depth':null}));switch(_0x3dbd1f[_0x1407('0x3b')]){case _0x1407('0x86'):if(_0x114875[_0x1407('0x57')]['MessageSid']&&_0x114875[_0x1407('0x57')]['MessageSid']===_0x4a5c41[_0x1407('0x87')]&&_0x114875[_0x1407('0x57')][_0x1407('0x88')]&&_0x114875['body'][_0x1407('0x88')]===_0x1407('0x5e')){return _0x4a5c41[_0x1407('0x58')]({'read':!![]});}else{logger['error'](_0x1407('0x89'),_0x1407('0x2b'),_0x1407('0x86'),util[_0x1407('0x8a')](_0x114875[_0x1407('0x57')],{'showHidden':![],'depth':null}));}break;}return _0x4a5c41;}})['then'](respondWithResult(_0x610ac7,null))[_0x1407('0x29')](handleError(_0x610ac7,null));}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.events.js b/server/api/whatsappMessage/whatsappMessage.events.js index fedc14a..5607046 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 _0x0db9=['hook','exports','events','save','update','emit','hasOwnProperty'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x0db9,0xa3));var _0x90db=function(_0xa148b7,_0x2f3eb2){_0xa148b7=_0xa148b7-0x0;var _0x51efd3=_0x0db9[_0xa148b7];return _0x51efd3;};'use strict';var EventEmitter=require(_0x90db('0x0'));var WhatsappMessage=require('../../mysqldb')['db']['WhatsappMessage'];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x90db('0x1'),'afterUpdate':_0x90db('0x2'),'afterDestroy':'remove'};function emitEvent(_0x2da262){return function(_0x500dcf,_0x1e0f41,_0x29b59f){WhatsappMessageEvents['emit'](_0x2da262+':'+_0x500dcf['id'],_0x500dcf);WhatsappMessageEvents[_0x90db('0x3')](_0x2da262,_0x500dcf);_0x29b59f(null);};}for(var e in events){if(events[_0x90db('0x4')](e)){var event=events[e];WhatsappMessage[_0x90db('0x5')](e,emitEvent(event));}}module[_0x90db('0x6')]=WhatsappMessageEvents; \ No newline at end of file +var _0x16d2=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','WhatsappMessage','setMaxListeners','save','update'];(function(_0x5182f9,_0x4acf0c){var _0x4c9fad=function(_0x453b0e){while(--_0x453b0e){_0x5182f9['push'](_0x5182f9['shift']());}};_0x4c9fad(++_0x4acf0c);}(_0x16d2,0x123));var _0x216d=function(_0x1bb07c,_0x43cd16){_0x1bb07c=_0x1bb07c-0x0;var _0x30bb8a=_0x16d2[_0x1bb07c];return _0x30bb8a;};'use strict';var EventEmitter=require(_0x216d('0x0'));var WhatsappMessage=require(_0x216d('0x1'))['db'][_0x216d('0x2')];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents[_0x216d('0x3')](0x0);var events={'afterCreate':_0x216d('0x4'),'afterUpdate':_0x216d('0x5'),'afterDestroy':_0x216d('0x6')};function emitEvent(_0x239b49){return function(_0xfd7306,_0x593bb0,_0x2c662d){WhatsappMessageEvents[_0x216d('0x7')](_0x239b49+':'+_0xfd7306['id'],_0xfd7306);WhatsappMessageEvents[_0x216d('0x7')](_0x239b49,_0xfd7306);_0x2c662d(null);};}for(var e in events){if(events[_0x216d('0x8')](e)){var event=events[e];WhatsappMessage[_0x216d('0x9')](e,emitEvent(event));}}module[_0x216d('0xa')]=WhatsappMessageEvents; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.model.js b/server/api/whatsappMessage/whatsappMessage.model.js index 31e691d..9dfdaa8 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 _0x08bf=['models','get','direction','toLowerCase','out','secret','isNil','UserId','findOne','WhatsappInteractionId','then','update','createdAt','catch','error','WhatsappAccount','WhatsappAccountId','type','twilio','accountSid','phone','authToken','create','whatsapp:','remote','/api/whatsapp/messages/','/status?token=','token','sid','WhatsappMessage,\x20%s,\x20%s,\x20%s','afterCreate','inspect','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','finally','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','bluebird','path','rimraf','../../config/environment','./whatsappMessage.attributes','exports','define','whatsapp_messages','fti_whatsapp_messages','body','FULLTEXT'];(function(_0x73b24a,_0x2ba1b9){var _0x48d5e2=function(_0x4efa3f){while(--_0x4efa3f){_0x73b24a['push'](_0x73b24a['shift']());}};_0x48d5e2(++_0x2ba1b9);}(_0x08bf,0x1e6));var _0xf08b=function(_0x41a748,_0x3f2e25){_0x41a748=_0x41a748-0x0;var _0x551fc4=_0x08bf[_0x41a748];return _0x551fc4;};'use strict';var _=require(_0xf08b('0x0'));var util=require(_0xf08b('0x1'));var logger=require(_0xf08b('0x2'))('api');var moment=require('moment');var BPromise=require(_0xf08b('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf08b('0x4'));var rimraf=require(_0xf08b('0x5'));var config=require(_0xf08b('0x6'));var attributes=require(_0xf08b('0x7'));module[_0xf08b('0x8')]=function(_0x5f1f13,_0x418200){return _0x5f1f13[_0xf08b('0x9')]('WhatsappMessage',attributes,{'tableName':_0xf08b('0xa'),'paranoid':![],'indexes':[{'name':'messageId','fields':['messageId']},{'name':_0xf08b('0xb'),'fields':[_0xf08b('0xc')],'type':_0xf08b('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x5ef561,_0x218ce4,_0x5e8bd8){var _0x5dcf30=_0x5f1f13[_0xf08b('0xe')];var _0x1cf0e7=_0x5ef561[_0xf08b('0xf')]({'plain':!![]});if(_0x1cf0e7[_0xf08b('0x10')][_0xf08b('0x11')]()==='in'||_0x1cf0e7[_0xf08b('0x10')][_0xf08b('0x11')]()===_0xf08b('0x12')&&!_0x1cf0e7[_0xf08b('0x13')]&&!_[_0xf08b('0x14')](_0x1cf0e7[_0xf08b('0x15')])){_0x5dcf30['WhatsappInteraction'][_0xf08b('0x16')]({'where':{'id':_0x1cf0e7[_0xf08b('0x17')]}})[_0xf08b('0x18')](function(_0x5dda65){if(_0x5dda65){_0x5dda65[_0xf08b('0x19')]({'lastMsgAt':_0x1cf0e7[_0xf08b('0x1a')],'lastMsgDirection':_0x1cf0e7[_0xf08b('0x10')][_0xf08b('0x11')]()});}})[_0xf08b('0x1b')](function(_0x356244){console[_0xf08b('0x1c')](_0x356244);});}if(_0x1cf0e7[_0xf08b('0x10')]===_0xf08b('0x12')&&!_0x1cf0e7['secret']){var _0x116d7b;_0x5dcf30[_0xf08b('0x1d')]['find']({'where':{'id':_0x1cf0e7[_0xf08b('0x1e')]},'raw':!![]})[_0xf08b('0x18')](function(_0x43a3bb){_0x116d7b=_0x43a3bb;if(_0x116d7b&&_0x116d7b[_0xf08b('0x1f')]){switch(_0x116d7b[_0xf08b('0x1f')]){case'twilio':var _0x569dae=require(_0xf08b('0x20'));if(_0x116d7b[_0xf08b('0x21')]&&_0x116d7b['authToken']&&_0x116d7b[_0xf08b('0x22')]){var _0x54feb2=new _0x569dae(_0x116d7b['accountSid'],_0x116d7b[_0xf08b('0x23')]);_0x54feb2['messages'][_0xf08b('0x24')]({'body':_0x1cf0e7[_0xf08b('0xc')],'to':_0xf08b('0x25')+_0x1cf0e7[_0xf08b('0x22')],'from':_0xf08b('0x25')+_0x116d7b[_0xf08b('0x22')],'statusCallback':_0x116d7b[_0xf08b('0x26')]+_0xf08b('0x27')+_0x1cf0e7['id']+_0xf08b('0x28')+_0x116d7b[_0xf08b('0x29')]})[_0xf08b('0x18')](function(_0x543739){if(_0x543739[_0xf08b('0x2a')]){return _0x5ef561[_0xf08b('0x19')]({'messageId':_0x543739[_0xf08b('0x2a')]});}})['catch'](function(_0xf85329){logger[_0xf08b('0x1c')](_0xf08b('0x2b'),_0xf08b('0x2c'),_0xf08b('0x20'),util[_0xf08b('0x2d')](_0xf85329,{'showHidden':![],'depth':null}));});}else{logger[_0xf08b('0x1c')](_0xf08b('0x2b'),'afterCreate',_0xf08b('0x20'),_0xf08b('0x2e'));}break;}}})[_0xf08b('0x2f')](function(){_0x5e8bd8();});}else{_0x5e8bd8();}}},'charset':_0xf08b('0x30'),'collate':_0xf08b('0x31')});}; \ No newline at end of file +var _0xb11e=['WhatsappMessage,\x20%s,\x20%s,\x20%s','afterCreate','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','path','rimraf','../../config/environment','./whatsappMessage.attributes','WhatsappMessage','messageId','fti_whatsapp_messages','body','models','get','direction','toLowerCase','out','isNil','WhatsappInteraction','then','update','createdAt','catch','error','WhatsappAccount','find','twilio','authToken','phone','whatsapp:','remote','/status?token=','token','sid'];(function(_0x59ed12,_0xf96ab6){var _0x3b6f60=function(_0x32b409){while(--_0x32b409){_0x59ed12['push'](_0x59ed12['shift']());}};_0x3b6f60(++_0xf96ab6);}(_0xb11e,0x7d));var _0xeb11=function(_0x4e2dbd,_0x141e05){_0x4e2dbd=_0x4e2dbd-0x0;var _0x4865ac=_0xb11e[_0x4e2dbd];return _0x4865ac;};'use strict';var _=require(_0xeb11('0x0'));var util=require(_0xeb11('0x1'));var logger=require(_0xeb11('0x2'))(_0xeb11('0x3'));var moment=require(_0xeb11('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xeb11('0x5'));var rimraf=require(_0xeb11('0x6'));var config=require(_0xeb11('0x7'));var attributes=require(_0xeb11('0x8'));module['exports']=function(_0x252e4f,_0x5c54d8){return _0x252e4f['define'](_0xeb11('0x9'),attributes,{'tableName':'whatsapp_messages','paranoid':![],'indexes':[{'name':'messageId','fields':[_0xeb11('0xa')]},{'name':_0xeb11('0xb'),'fields':[_0xeb11('0xc')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x35ce4c,_0x2e3052,_0x3f3dbd){var _0x137756=_0x252e4f[_0xeb11('0xd')];var _0x29fe6d=_0x35ce4c[_0xeb11('0xe')]({'plain':!![]});if(_0x29fe6d[_0xeb11('0xf')]['toLowerCase']()==='in'||_0x29fe6d[_0xeb11('0xf')][_0xeb11('0x10')]()===_0xeb11('0x11')&&!_0x29fe6d['secret']&&!_[_0xeb11('0x12')](_0x29fe6d['UserId'])){_0x137756[_0xeb11('0x13')]['findOne']({'where':{'id':_0x29fe6d['WhatsappInteractionId']}})[_0xeb11('0x14')](function(_0x2e0d2c){if(_0x2e0d2c){_0x2e0d2c[_0xeb11('0x15')]({'lastMsgAt':_0x29fe6d[_0xeb11('0x16')],'lastMsgDirection':_0x29fe6d['direction']['toLowerCase']()});}})[_0xeb11('0x17')](function(_0xd1a9bf){console[_0xeb11('0x18')](_0xd1a9bf);});}if(_0x29fe6d['direction']===_0xeb11('0x11')&&!_0x29fe6d['secret']){var _0x33a996;_0x137756[_0xeb11('0x19')][_0xeb11('0x1a')]({'where':{'id':_0x29fe6d['WhatsappAccountId']},'raw':!![]})[_0xeb11('0x14')](function(_0x2ef18b){_0x33a996=_0x2ef18b;if(_0x33a996&&_0x33a996['type']){switch(_0x33a996['type']){case _0xeb11('0x1b'):var _0x1872d4=require('twilio');if(_0x33a996['accountSid']&&_0x33a996[_0xeb11('0x1c')]&&_0x33a996[_0xeb11('0x1d')]){var _0x4dfe03=new _0x1872d4(_0x33a996['accountSid'],_0x33a996[_0xeb11('0x1c')]);_0x4dfe03['messages']['create']({'body':_0x29fe6d['body'],'to':_0xeb11('0x1e')+_0x29fe6d[_0xeb11('0x1d')],'from':'whatsapp:'+_0x33a996[_0xeb11('0x1d')],'statusCallback':_0x33a996[_0xeb11('0x1f')]+'/api/whatsapp/messages/'+_0x29fe6d['id']+_0xeb11('0x20')+_0x33a996[_0xeb11('0x21')]})[_0xeb11('0x14')](function(_0x52b059){if(_0x52b059[_0xeb11('0x22')]){return _0x35ce4c['update']({'messageId':_0x52b059['sid']});}})[_0xeb11('0x17')](function(_0x2a4fc6){logger[_0xeb11('0x18')]('WhatsappMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0xeb11('0x1b'),util['inspect'](_0x2a4fc6,{'showHidden':![],'depth':null}));});}else{logger[_0xeb11('0x18')](_0xeb11('0x23'),_0xeb11('0x24'),_0xeb11('0x1b'),_0xeb11('0x25'));}break;}}})['finally'](function(){_0x3f3dbd();});}else{_0x3f3dbd();}}},'charset':_0xeb11('0x26'),'collate':_0xeb11('0x27')});}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.rpc.js b/server/api/whatsappMessage/whatsappMessage.rpc.js index 29b2fa5..fe5afde 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 _0xe936=['catch','CreateWhatsappMessage','WhatsappMessage','body','options','raw','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./whatsappMessage.socket','register','request','then','info','request\x20sent','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','WhatsappMessage,\x20%s,\x20%s','message','result'];(function(_0x5bcc60,_0x30cba5){var _0xb734af=function(_0x1b3ffc){while(--_0x1b3ffc){_0x5bcc60['push'](_0x5bcc60['shift']());}};_0xb734af(++_0x30cba5);}(_0xe936,0x92));var _0x6e93=function(_0x16cc36,_0x178ccd){_0x16cc36=_0x16cc36-0x0;var _0x43d8ca=_0xe936[_0x16cc36];return _0x43d8ca;};'use strict';var _=require('lodash');var util=require(_0x6e93('0x0'));var moment=require(_0x6e93('0x1'));var BPromise=require('bluebird');var rs=require(_0x6e93('0x2'));var fs=require('fs');var Redis=require(_0x6e93('0x3'));var db=require(_0x6e93('0x4'))['db'];var utils=require(_0x6e93('0x5'));var logger=require(_0x6e93('0x6'))('rpc');var config=require(_0x6e93('0x7'));var jayson=require(_0x6e93('0x8'));var client=jayson[_0x6e93('0x9')][_0x6e93('0xa')]({'port':0x232a});config[_0x6e93('0xb')]=_[_0x6e93('0xc')](config[_0x6e93('0xb')],{'host':_0x6e93('0xd'),'port':0x18eb});var socket=require(_0x6e93('0xe'))(new Redis(config['redis']));require(_0x6e93('0xf'))[_0x6e93('0x10')](socket);function respondWithRpcPromise(_0x756ee0,_0x4b744b,_0x506949){return new BPromise(function(_0x7c30a8,_0x36a5c8){return client[_0x6e93('0x11')](_0x756ee0,_0x506949)[_0x6e93('0x12')](function(_0x595229){logger[_0x6e93('0x13')]('WhatsappMessage,\x20%s,\x20%s',_0x4b744b,_0x6e93('0x14'));logger[_0x6e93('0x15')](_0x6e93('0x16'),_0x4b744b,'request\x20sent',JSON[_0x6e93('0x17')](_0x595229));if(_0x595229[_0x6e93('0x18')]){if(_0x595229['error'][_0x6e93('0x19')]===0x1f4){logger['error'](_0x6e93('0x1a'),_0x4b744b,_0x595229[_0x6e93('0x18')][_0x6e93('0x1b')]);return _0x36a5c8(_0x595229[_0x6e93('0x18')][_0x6e93('0x1b')]);}logger[_0x6e93('0x18')](_0x6e93('0x1a'),_0x4b744b,_0x595229[_0x6e93('0x18')][_0x6e93('0x1b')]);return _0x7c30a8(_0x595229[_0x6e93('0x18')][_0x6e93('0x1b')]);}else{logger['info'](_0x6e93('0x1a'),_0x4b744b,_0x6e93('0x14'));_0x7c30a8(_0x595229[_0x6e93('0x1c')]['message']);}})[_0x6e93('0x1d')](function(_0x4bbdb8){logger[_0x6e93('0x18')](_0x6e93('0x1a'),_0x4b744b,_0x4bbdb8);_0x36a5c8(_0x4bbdb8);});});}exports[_0x6e93('0x1e')]=function(_0x467649){var _0x488632=this;return new Promise(function(_0x388b3f,_0x260a47){return db[_0x6e93('0x1f')]['create'](_0x467649[_0x6e93('0x20')],{'raw':_0x467649[_0x6e93('0x21')]?_0x467649['options'][_0x6e93('0x22')]===undefined?!![]:![]:!![]})['then'](function(_0x116c97){logger[_0x6e93('0x13')]('CreateWhatsappMessage',_0x467649);logger[_0x6e93('0x15')](_0x6e93('0x1e'),_0x467649,JSON[_0x6e93('0x17')](_0x116c97));_0x388b3f(_0x116c97);})[_0x6e93('0x1d')](function(_0x4fb74c){logger[_0x6e93('0x18')](_0x6e93('0x1e'),_0x4fb74c[_0x6e93('0x1b')],_0x467649);_0x260a47(_0x488632[_0x6e93('0x18')](0x1f4,_0x4fb74c[_0x6e93('0x1b')]));});});}; \ No newline at end of file +var _0xa59e=['localhost','socket.io-emitter','./whatsappMessage.socket','request','WhatsappMessage,\x20%s,\x20%s','request\x20sent','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','WhatsappMessage','create','options','raw','then','CreateWhatsappMessage','lodash','util','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','redis','defaults'];(function(_0x1f5e33,_0x10f720){var _0x28aadf=function(_0x58c6f8){while(--_0x58c6f8){_0x1f5e33['push'](_0x1f5e33['shift']());}};_0x28aadf(++_0x10f720);}(_0xa59e,0x10c));var _0xea59=function(_0x9c4732,_0x42f224){_0x9c4732=_0x9c4732-0x0;var _0x4fa73b=_0xa59e[_0x9c4732];return _0x4fa73b;};'use strict';var _=require(_0xea59('0x0'));var util=require(_0xea59('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xea59('0x2'));var fs=require('fs');var Redis=require(_0xea59('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xea59('0x4'));var logger=require(_0xea59('0x5'))(_0xea59('0x6'));var config=require(_0xea59('0x7'));var jayson=require(_0xea59('0x8'));var client=jayson['client']['http']({'port':0x232a});config[_0xea59('0x9')]=_[_0xea59('0xa')](config['redis'],{'host':_0xea59('0xb'),'port':0x18eb});var socket=require(_0xea59('0xc'))(new Redis(config[_0xea59('0x9')]));require(_0xea59('0xd'))['register'](socket);function respondWithRpcPromise(_0x506442,_0x9b0361,_0x59bf91){return new BPromise(function(_0x51f194,_0x7b89ad){return client[_0xea59('0xe')](_0x506442,_0x59bf91)['then'](function(_0x298f32){logger['info'](_0xea59('0xf'),_0x9b0361,_0xea59('0x10'));logger[_0xea59('0x11')](_0xea59('0x12'),_0x9b0361,_0xea59('0x10'),JSON['stringify'](_0x298f32));if(_0x298f32['error']){if(_0x298f32[_0xea59('0x13')][_0xea59('0x14')]===0x1f4){logger[_0xea59('0x13')](_0xea59('0xf'),_0x9b0361,_0x298f32[_0xea59('0x13')][_0xea59('0x15')]);return _0x7b89ad(_0x298f32[_0xea59('0x13')]['message']);}logger['error'](_0xea59('0xf'),_0x9b0361,_0x298f32[_0xea59('0x13')][_0xea59('0x15')]);return _0x51f194(_0x298f32[_0xea59('0x13')][_0xea59('0x15')]);}else{logger[_0xea59('0x16')](_0xea59('0xf'),_0x9b0361,'request\x20sent');_0x51f194(_0x298f32[_0xea59('0x17')][_0xea59('0x15')]);}})[_0xea59('0x18')](function(_0x578741){logger[_0xea59('0x13')](_0xea59('0xf'),_0x9b0361,_0x578741);_0x7b89ad(_0x578741);});});}exports['CreateWhatsappMessage']=function(_0x37cb4b){var _0x3b9079=this;return new Promise(function(_0x56b867,_0x107575){return db[_0xea59('0x19')][_0xea59('0x1a')](_0x37cb4b['body'],{'raw':_0x37cb4b[_0xea59('0x1b')]?_0x37cb4b[_0xea59('0x1b')][_0xea59('0x1c')]===undefined?!![]:![]:!![]})[_0xea59('0x1d')](function(_0x36681c){logger[_0xea59('0x16')](_0xea59('0x1e'),_0x37cb4b);logger[_0xea59('0x11')](_0xea59('0x1e'),_0x37cb4b,JSON['stringify'](_0x36681c));_0x56b867(_0x36681c);})[_0xea59('0x18')](function(_0x314cf5){logger[_0xea59('0x13')](_0xea59('0x1e'),_0x314cf5[_0xea59('0x15')],_0x37cb4b);_0x107575(_0x3b9079['error'](0x1f4,_0x314cf5['message']));});});}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.socket.js b/server/api/whatsappMessage/whatsappMessage.socket.js index 048bea0..48eed62 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 _0xa449=['save','remove','update','removeListener','register','length','./whatsappMessage.events'];(function(_0x3461b7,_0xac6c52){var _0x545ff9=function(_0x4bf3ee){while(--_0x4bf3ee){_0x3461b7['push'](_0x3461b7['shift']());}};_0x545ff9(++_0xac6c52);}(_0xa449,0x92));var _0x9a44=function(_0x46e363,_0x45d7e2){_0x46e363=_0x46e363-0x0;var _0x3fb059=_0xa449[_0x46e363];return _0x3fb059;};'use strict';var WhatsappMessageEvents=require(_0x9a44('0x0'));var events=[_0x9a44('0x1'),_0x9a44('0x2'),_0x9a44('0x3')];function createListener(_0x48d406,_0x1f2234){return function(_0x18ae68){_0x1f2234['emit'](_0x48d406,_0x18ae68);};}function removeListener(_0x30085c,_0x5b0c6c){return function(){WhatsappMessageEvents[_0x9a44('0x4')](_0x30085c,_0x5b0c6c);};}exports[_0x9a44('0x5')]=function(_0xf7e996){for(var _0xfd9287=0x0,_0x3b9e30=events[_0x9a44('0x6')];_0xfd9287<_0x3b9e30;_0xfd9287++){var _0x37e75d=events[_0xfd9287];var _0x3bca65=createListener('whatsappMessage:'+_0x37e75d,_0xf7e996);WhatsappMessageEvents['on'](_0x37e75d,_0x3bca65);}}; \ No newline at end of file +var _0xdf1f=['removeListener','whatsappMessage:','./whatsappMessage.events','update','emit'];(function(_0x3c7cc4,_0x358aa5){var _0x2ccad1=function(_0xcaa069){while(--_0xcaa069){_0x3c7cc4['push'](_0x3c7cc4['shift']());}};_0x2ccad1(++_0x358aa5);}(_0xdf1f,0x165));var _0xfdf1=function(_0x16f533,_0x12df0a){_0x16f533=_0x16f533-0x0;var _0x3d0cd3=_0xdf1f[_0x16f533];return _0x3d0cd3;};'use strict';var WhatsappMessageEvents=require(_0xfdf1('0x0'));var events=['save','remove',_0xfdf1('0x1')];function createListener(_0xdad06c,_0x179d1d){return function(_0x58fc5d){_0x179d1d[_0xfdf1('0x2')](_0xdad06c,_0x58fc5d);};}function removeListener(_0x55d2f3,_0xdc051c){return function(){WhatsappMessageEvents[_0xfdf1('0x3')](_0x55d2f3,_0xdc051c);};}exports['register']=function(_0x396fb6){for(var _0x4dc37f=0x0,_0x23b081=events['length'];_0x4dc37f<_0x23b081;_0x4dc37f++){var _0xa84cc7=events[_0x4dc37f];var _0x44309e=createListener(_0xfdf1('0x4')+_0xa84cc7,_0x396fb6);WhatsappMessageEvents['on'](_0xa84cc7,_0x44309e);}}; \ No newline at end of file diff --git a/server/api/whatsappQueue/index.js b/server/api/whatsappQueue/index.js index 6af92c0..6c59b28 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 _0xc21a=['/:id','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','create','addAgents','put','update','delete','destroy','removeAgents','exports','multer','util','express','Router','fs-extra','../../components/auth/service','get','isAuthenticated','index','describe'];(function(_0x68ee8b,_0x3cc6c5){var _0x5148f7=function(_0x5dcbd5){while(--_0x5dcbd5){_0x68ee8b['push'](_0x68ee8b['shift']());}};_0x5148f7(++_0x3cc6c5);}(_0xc21a,0x1dc));var _0xac21=function(_0x4d7526,_0x3d79b3){_0x4d7526=_0x4d7526-0x0;var _0x57ac7e=_0xc21a[_0x4d7526];return _0x57ac7e;};'use strict';var multer=require(_0xac21('0x0'));var util=require(_0xac21('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xac21('0x2'));var router=express[_0xac21('0x3')]();var fs_extra=require(_0xac21('0x4'));var auth=require(_0xac21('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./whatsappQueue.controller');router[_0xac21('0x6')]('/',auth[_0xac21('0x7')](),controller[_0xac21('0x8')]);router[_0xac21('0x6')]('/describe',auth[_0xac21('0x7')](),controller[_0xac21('0x9')]);router['get'](_0xac21('0xa'),auth[_0xac21('0x7')](),controller[_0xac21('0xb')]);router[_0xac21('0x6')](_0xac21('0xc'),auth[_0xac21('0x7')](),controller[_0xac21('0xd')]);router[_0xac21('0x6')](_0xac21('0xe'),auth[_0xac21('0x7')](),controller[_0xac21('0xf')]);router['get'](_0xac21('0x10'),auth[_0xac21('0x7')](),controller[_0xac21('0x11')]);router[_0xac21('0x12')]('/',auth['isAuthenticated'](),controller[_0xac21('0x13')]);router[_0xac21('0x12')](_0xac21('0xe'),auth[_0xac21('0x7')](),controller['addTeams']);router[_0xac21('0x12')](_0xac21('0x10'),auth['isAuthenticated'](),controller[_0xac21('0x14')]);router[_0xac21('0x15')](_0xac21('0xa'),auth[_0xac21('0x7')](),controller[_0xac21('0x16')]);router[_0xac21('0x17')](_0xac21('0xa'),auth[_0xac21('0x7')](),controller[_0xac21('0x18')]);router[_0xac21('0x17')]('/:id/teams',auth[_0xac21('0x7')](),controller['removeTeams']);router[_0xac21('0x17')](_0xac21('0x10'),auth[_0xac21('0x7')](),controller[_0xac21('0x19')]);module[_0xac21('0x1a')]=router; \ No newline at end of file +var _0x6261=['/:id','getMembers','/:id/teams','getTeams','getAgents','addTeams','post','addAgents','put','update','delete','destroy','removeTeams','/:id/users','removeAgents','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappQueue.controller','isAuthenticated','/describe','describe','get'];(function(_0xe55225,_0x45db6f){var _0x58dc93=function(_0x763807){while(--_0x763807){_0xe55225['push'](_0xe55225['shift']());}};_0x58dc93(++_0x45db6f);}(_0x6261,0x1a3));var _0x1626=function(_0x533476,_0x35bd10){_0x533476=_0x533476-0x0;var _0x165d7f=_0x6261[_0x533476];return _0x165d7f;};'use strict';var multer=require(_0x1626('0x0'));var util=require(_0x1626('0x1'));var path=require(_0x1626('0x2'));var timeout=require(_0x1626('0x3'));var express=require(_0x1626('0x4'));var router=express[_0x1626('0x5')]();var fs_extra=require(_0x1626('0x6'));var auth=require(_0x1626('0x7'));var interaction=require(_0x1626('0x8'));var config=require(_0x1626('0x9'));var controller=require(_0x1626('0xa'));router['get']('/',auth[_0x1626('0xb')](),controller['index']);router['get'](_0x1626('0xc'),auth[_0x1626('0xb')](),controller[_0x1626('0xd')]);router[_0x1626('0xe')](_0x1626('0xf'),auth['isAuthenticated'](),controller['show']);router[_0x1626('0xe')]('/:id/members',auth[_0x1626('0xb')](),controller[_0x1626('0x10')]);router[_0x1626('0xe')](_0x1626('0x11'),auth[_0x1626('0xb')](),controller[_0x1626('0x12')]);router[_0x1626('0xe')]('/:id/users',auth[_0x1626('0xb')](),controller[_0x1626('0x13')]);router['post']('/',auth[_0x1626('0xb')](),controller['create']);router['post'](_0x1626('0x11'),auth[_0x1626('0xb')](),controller[_0x1626('0x14')]);router[_0x1626('0x15')]('/:id/users',auth[_0x1626('0xb')](),controller[_0x1626('0x16')]);router[_0x1626('0x17')]('/:id',auth[_0x1626('0xb')](),controller[_0x1626('0x18')]);router[_0x1626('0x19')](_0x1626('0xf'),auth['isAuthenticated'](),controller[_0x1626('0x1a')]);router[_0x1626('0x19')](_0x1626('0x11'),auth['isAuthenticated'](),controller[_0x1626('0x1b')]);router[_0x1626('0x19')](_0x1626('0x1c'),auth[_0x1626('0xb')](),controller[_0x1626('0x1d')]);module[_0x1626('0x1e')]=router; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.attributes.js b/server/api/whatsappQueue/whatsappQueue.attributes.js index 05e7541..1c0e8dc 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 _0x6584=['rrmemory','beepall','sequelize','exports','STRING','name','ENUM'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6584,0x175));var _0x4658=function(_0x45e98e,_0x169b60){_0x45e98e=_0x45e98e-0x0;var _0x374dba=_0x6584[_0x45e98e];return _0x374dba;};'use strict';var Sequelize=require(_0x4658('0x0'));module[_0x4658('0x1')]={'name':{'type':Sequelize[_0x4658('0x2')],'unique':_0x4658('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x4658('0x4')](_0x4658('0x5'),_0x4658('0x6'),'roundrobin')},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x4711=['INTEGER','ENUM','rrmemory','roundrobin','sequelize','exports','STRING','name'];(function(_0xa1bf55,_0xc0f3f){var _0x51a788=function(_0x5d46fc){while(--_0x5d46fc){_0xa1bf55['push'](_0xa1bf55['shift']());}};_0x51a788(++_0xc0f3f);}(_0x4711,0x10c));var _0x1471=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4711[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x1471('0x0'));module[_0x1471('0x1')]={'name':{'type':Sequelize[_0x1471('0x2')],'unique':_0x1471('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize[_0x1471('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x1471('0x5')](_0x1471('0x6'),'beepall',_0x1471('0x7'))},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.controller.js b/server/api/whatsappQueue/whatsappQueue.controller.js index 210b2c6..3ea508b 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 _0x1e02=['body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','UserWhatsappQueue','hasOwnProperty','order','WhatsappQueueId','findAndCountAll','format','%s/%s','whatsappPause','updatedAt','getTeams','findOne','addTeams','ids','Team','findAll','User','Agents','online','voicePause','interface','flatMap','each','forEach','emit','userWhatsappQueue:save','select','field','tq.TeamId','team_has_whatsapp_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','clone','push','sequelize','toString','SELECT','TeamId','all','removeTeams','isEmpty','removeAgents','userWhatsappQueue:remove','addAgents','omit','spread','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../config/license/util','defaults','redis','localhost','socket.io-emitter','./whatsappQueue.socket','register','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','save','update','then','destroy','get','UserProfileResource','end','error','stack','name','index','map','WhatsappQueue','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','sort','where','pick','filter','type','VIRTUAL','merge','options','includeAll','include','rows','catch','show','params','find','create'];(function(_0x5070a4,_0x1db896){var _0x179668=function(_0x43b757){while(--_0x43b757){_0x5070a4['push'](_0x5070a4['shift']());}};_0x179668(++_0x1db896);}(_0x1e02,0xbe));var _0x21e0=function(_0x331a5b,_0x414c56){_0x331a5b=_0x331a5b-0x0;var _0x48bead=_0x1e02[_0x331a5b];return _0x48bead;};'use strict';var emlformat=require(_0x21e0('0x0'));var rimraf=require(_0x21e0('0x1'));var zipdir=require(_0x21e0('0x2'));var jsonpatch=require(_0x21e0('0x3'));var rp=require('request-promise');var moment=require(_0x21e0('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x21e0('0x5'));var util=require(_0x21e0('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x21e0('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x21e0('0x8'));var _=require(_0x21e0('0x9'));var squel=require(_0x21e0('0xa'));var crypto=require('crypto');var jsforce=require(_0x21e0('0xb'));var deskjs=require(_0x21e0('0xc'));var toCsv=require(_0x21e0('0x7'));var querystring=require(_0x21e0('0xd'));var Papa=require(_0x21e0('0xe'));var Redis=require('ioredis');var authService=require(_0x21e0('0xf'));var qs=require(_0x21e0('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x21e0('0x11'));var utils=require(_0x21e0('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0x21e0('0x13'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x21e0('0x14')](config[_0x21e0('0x15')],{'host':_0x21e0('0x16'),'port':0x18eb});var socket=require(_0x21e0('0x17'))(new Redis(config[_0x21e0('0x15')]));require(_0x21e0('0x18'))[_0x21e0('0x19')](socket);function respondWithStatusCode(_0x47dd2b,_0xc99b48){_0xc99b48=_0xc99b48||0xcc;return function(_0x2336c8){if(_0x2336c8){return _0x47dd2b[_0x21e0('0x1a')](_0xc99b48);}return _0x47dd2b[_0x21e0('0x1b')](_0xc99b48)['end']();};}function respondWithResult(_0x36ff52,_0x3b20be){_0x3b20be=_0x3b20be||0xc8;return function(_0x461a55){if(_0x461a55){return _0x36ff52['status'](_0x3b20be)[_0x21e0('0x1c')](_0x461a55);}};}function respondWithFilteredResult(_0x53ff12,_0x2f188e){return function(_0x49cf23){if(_0x49cf23){var _0x3f9d7f=typeof _0x2f188e[_0x21e0('0x1d')]===_0x21e0('0x1e')&&typeof _0x2f188e['limit']===_0x21e0('0x1e');var _0x2241cf=_0x49cf23[_0x21e0('0x1f')];var _0x9c923f=_0x3f9d7f?0x0:_0x2f188e[_0x21e0('0x1d')];var _0x23a319=_0x3f9d7f?_0x49cf23[_0x21e0('0x1f')]:_0x2f188e[_0x21e0('0x1d')]+_0x2f188e[_0x21e0('0x20')];var _0x4d4bec;if(_0x23a319>=_0x2241cf){_0x23a319=_0x2241cf;_0x4d4bec=0xc8;}else{_0x4d4bec=0xce;}_0x53ff12['status'](_0x4d4bec);return _0x53ff12[_0x21e0('0x21')](_0x21e0('0x22'),_0x9c923f+'-'+_0x23a319+'/'+_0x2241cf)[_0x21e0('0x1c')](_0x49cf23);}return null;};}function patchUpdates(_0x5eda36){return function(_0x5b1eb2){try{jsonpatch['apply'](_0x5b1eb2,_0x5eda36,!![]);}catch(_0x3d0b68){return BPromise['reject'](_0x3d0b68);}return _0x5b1eb2[_0x21e0('0x23')]();};}function saveUpdates(_0x494497,_0x49fc85){return function(_0x5de994){if(_0x5de994){return _0x5de994[_0x21e0('0x24')](_0x494497)[_0x21e0('0x25')](function(_0xe3fce3){return _0xe3fce3;});}return null;};}function removeEntity(_0x54a0b1,_0x431939){return function(_0x30e7cc){if(_0x30e7cc){return _0x30e7cc[_0x21e0('0x26')]()['then'](function(){var _0x5bedd0=_0x30e7cc[_0x21e0('0x27')]({'plain':!![]});var _0x9c25d2='WhatsappQueues';return db[_0x21e0('0x28')][_0x21e0('0x26')]({'where':{'type':_0x9c25d2,'resourceId':_0x5bedd0['id']}})['then'](function(){return _0x30e7cc;});})[_0x21e0('0x25')](function(){_0x54a0b1[_0x21e0('0x1b')](0xcc)[_0x21e0('0x29')]();});}};}function handleEntityNotFound(_0x59ee85,_0x595e8d){return function(_0x499cae){if(!_0x499cae){_0x59ee85[_0x21e0('0x1a')](0x194);}return _0x499cae;};}function handleError(_0x2b889e,_0x363e8e){_0x363e8e=_0x363e8e||0x1f4;return function(_0x1a46d4){logger[_0x21e0('0x2a')](_0x1a46d4[_0x21e0('0x2b')]);if(_0x1a46d4[_0x21e0('0x2c')]){delete _0x1a46d4[_0x21e0('0x2c')];}_0x2b889e[_0x21e0('0x1b')](_0x363e8e)['send'](_0x1a46d4);};}exports[_0x21e0('0x2d')]=function(_0x294a31,_0x36dee8){var _0x558276={},_0x1c7754={},_0x391a7d={'count':0x0,'rows':[]};var _0x731622=_[_0x21e0('0x2e')](db[_0x21e0('0x2f')][_0x21e0('0x30')],function(_0x5e435f){return{'name':_0x5e435f[_0x21e0('0x31')],'type':_0x5e435f['type'][_0x21e0('0x32')]};});_0x1c7754[_0x21e0('0x33')]=_[_0x21e0('0x2e')](_0x731622,'name');_0x1c7754[_0x21e0('0x34')]=_[_0x21e0('0x35')](_0x294a31[_0x21e0('0x34')]);_0x1c7754[_0x21e0('0x36')]=_[_0x21e0('0x37')](_0x1c7754[_0x21e0('0x33')],_0x1c7754[_0x21e0('0x34')]);_0x558276[_0x21e0('0x38')]=_[_0x21e0('0x37')](_0x1c7754[_0x21e0('0x33')],qs[_0x21e0('0x39')](_0x294a31[_0x21e0('0x34')][_0x21e0('0x39')]));_0x558276[_0x21e0('0x38')]=_0x558276[_0x21e0('0x38')][_0x21e0('0x3a')]?_0x558276[_0x21e0('0x38')]:_0x1c7754[_0x21e0('0x33')];if(!_0x294a31[_0x21e0('0x34')]['hasOwnProperty'](_0x21e0('0x3b'))){_0x558276['limit']=qs[_0x21e0('0x20')](_0x294a31[_0x21e0('0x34')][_0x21e0('0x20')]);_0x558276['offset']=qs[_0x21e0('0x1d')](_0x294a31['query'][_0x21e0('0x1d')]);}_0x558276['order']=qs['sort'](_0x294a31[_0x21e0('0x34')][_0x21e0('0x3c')]);_0x558276[_0x21e0('0x3d')]=qs[_0x21e0('0x36')](_[_0x21e0('0x3e')](_0x294a31[_0x21e0('0x34')],_0x1c7754[_0x21e0('0x36')]),_0x731622);if(_0x294a31[_0x21e0('0x34')][_0x21e0('0x3f')]){_0x558276[_0x21e0('0x3d')]=_['merge'](_0x558276[_0x21e0('0x3d')],{'$or':_['map'](_0x731622,function(_0x31086b){if(_0x31086b[_0x21e0('0x40')]!==_0x21e0('0x41')){var _0x1f27dc={};_0x1f27dc[_0x31086b[_0x21e0('0x2c')]]={'$like':'%'+_0x294a31['query'][_0x21e0('0x3f')]+'%'};return _0x1f27dc;}})});}_0x558276=_[_0x21e0('0x42')]({},_0x558276,_0x294a31[_0x21e0('0x43')]);var _0x43635b={'where':_0x558276[_0x21e0('0x3d')]};return db[_0x21e0('0x2f')][_0x21e0('0x1f')](_0x43635b)['then'](function(_0x4f6878){_0x391a7d[_0x21e0('0x1f')]=_0x4f6878;if(_0x294a31['query'][_0x21e0('0x44')]){_0x558276[_0x21e0('0x45')]=[{'all':!![]}];}return db[_0x21e0('0x2f')]['findAll'](_0x558276);})[_0x21e0('0x25')](function(_0x3e9b28){_0x391a7d[_0x21e0('0x46')]=_0x3e9b28;return _0x391a7d;})[_0x21e0('0x25')](respondWithFilteredResult(_0x36dee8,_0x558276))[_0x21e0('0x47')](handleError(_0x36dee8,null));};exports[_0x21e0('0x48')]=function(_0x922ce3,_0x16e60d){var _0x309a48={'raw':!![],'where':{'id':_0x922ce3[_0x21e0('0x49')]['id']}},_0x4fe330={};_0x4fe330['model']=_[_0x21e0('0x35')](db[_0x21e0('0x2f')]['rawAttributes']);_0x4fe330['query']=_['keys'](_0x922ce3[_0x21e0('0x34')]);_0x4fe330['filters']=_[_0x21e0('0x37')](_0x4fe330[_0x21e0('0x33')],_0x4fe330[_0x21e0('0x34')]);_0x309a48[_0x21e0('0x38')]=_[_0x21e0('0x37')](_0x4fe330['model'],qs['fields'](_0x922ce3['query'][_0x21e0('0x39')]));_0x309a48[_0x21e0('0x38')]=_0x309a48[_0x21e0('0x38')]['length']?_0x309a48['attributes']:_0x4fe330['model'];if(_0x922ce3[_0x21e0('0x34')][_0x21e0('0x44')]){_0x309a48[_0x21e0('0x45')]=[{'all':!![]}];}_0x309a48=_[_0x21e0('0x42')]({},_0x309a48,_0x922ce3[_0x21e0('0x43')]);return db[_0x21e0('0x2f')][_0x21e0('0x4a')](_0x309a48)[_0x21e0('0x25')](handleEntityNotFound(_0x16e60d,null))[_0x21e0('0x25')](respondWithResult(_0x16e60d,null))[_0x21e0('0x47')](handleError(_0x16e60d,null));};exports['create']=function(_0x310c49,_0x4e7404){return db['WhatsappQueue'][_0x21e0('0x4b')](_0x310c49[_0x21e0('0x4c')],{})[_0x21e0('0x25')](function(_0x1f508f){var _0x14d291=_0x310c49[_0x21e0('0x4d')][_0x21e0('0x27')]({'plain':!![]});if(!_0x14d291)throw new Error(_0x21e0('0x4e'));if(_0x14d291[_0x21e0('0x4f')]===_0x21e0('0x4d')){var _0x16febd=_0x1f508f[_0x21e0('0x27')]({'plain':!![]});var _0x3552e9='WhatsappQueues';return db[_0x21e0('0x50')][_0x21e0('0x4a')]({'where':{'name':_0x3552e9,'userProfileId':_0x14d291[_0x21e0('0x51')]},'raw':!![]})['then'](function(_0x26281e){if(_0x26281e&&_0x26281e[_0x21e0('0x52')]===0x0){return db[_0x21e0('0x28')][_0x21e0('0x4b')]({'name':_0x16febd[_0x21e0('0x2c')],'resourceId':_0x16febd['id'],'type':_0x26281e[_0x21e0('0x2c')],'sectionId':_0x26281e['id']},{})['then'](function(){return _0x1f508f;});}else{return _0x1f508f;}})[_0x21e0('0x47')](function(_0x158430){logger['error'](_0x21e0('0x53'),_0x158430);throw _0x158430;});}return _0x1f508f;})[_0x21e0('0x25')](respondWithResult(_0x4e7404,0xc9))[_0x21e0('0x47')](handleError(_0x4e7404,null));};exports[_0x21e0('0x24')]=function(_0xbdd3a2,_0x7734d0){if(_0xbdd3a2[_0x21e0('0x4c')]['id']){delete _0xbdd3a2[_0x21e0('0x4c')]['id'];}return db[_0x21e0('0x2f')][_0x21e0('0x4a')]({'where':{'id':_0xbdd3a2[_0x21e0('0x49')]['id']}})['then'](handleEntityNotFound(_0x7734d0,null))[_0x21e0('0x25')](saveUpdates(_0xbdd3a2[_0x21e0('0x4c')],null))[_0x21e0('0x25')](respondWithResult(_0x7734d0,null))[_0x21e0('0x47')](handleError(_0x7734d0,null));};exports[_0x21e0('0x26')]=function(_0x410b0a,_0x44b256){return db['WhatsappQueue']['find']({'where':{'id':_0x410b0a[_0x21e0('0x49')]['id']}})[_0x21e0('0x25')](handleEntityNotFound(_0x44b256,null))['then'](removeEntity(_0x44b256,null))[_0x21e0('0x47')](handleError(_0x44b256,null));};exports[_0x21e0('0x54')]=function(_0x1cbc65,_0x5583ac){return db[_0x21e0('0x2f')][_0x21e0('0x54')]()[_0x21e0('0x25')](respondWithResult(_0x5583ac,null))['catch'](handleError(_0x5583ac,null));};exports[_0x21e0('0x55')]=function(_0x3041f2,_0x342dbc,_0x73f55){var _0x3889aa={'raw':!![],'where':{}},_0x560bee={},_0x963fd3;return db[_0x21e0('0x2f')]['findOne']({'where':{'id':_0x3041f2[_0x21e0('0x49')]['id']}})[_0x21e0('0x25')](handleEntityNotFound(_0x342dbc,null))['then'](function(_0x57ac0f){if(_0x57ac0f){_0x963fd3=_0x57ac0f[_0x21e0('0x27')]({'plain':!![]});_0x560bee[_0x21e0('0x33')]=_[_0x21e0('0x35')](db[_0x21e0('0x56')][_0x21e0('0x30')]);_0x560bee[_0x21e0('0x34')]=_[_0x21e0('0x35')](_0x3041f2[_0x21e0('0x34')]);_0x560bee['filters']=_['intersection'](_0x560bee[_0x21e0('0x33')],_0x560bee[_0x21e0('0x34')]);_0x3889aa[_0x21e0('0x38')]=_[_0x21e0('0x37')](_0x560bee[_0x21e0('0x33')],qs['fields'](_0x3041f2[_0x21e0('0x34')][_0x21e0('0x39')]));_0x3889aa['attributes']=_0x3889aa[_0x21e0('0x38')][_0x21e0('0x3a')]?_0x3889aa['attributes']:_0x560bee['model'];if(!_0x3041f2[_0x21e0('0x34')][_0x21e0('0x57')](_0x21e0('0x3b'))){_0x3889aa['limit']=qs[_0x21e0('0x20')](_0x3041f2[_0x21e0('0x34')][_0x21e0('0x20')]);_0x3889aa[_0x21e0('0x1d')]=qs[_0x21e0('0x1d')](_0x3041f2[_0x21e0('0x34')][_0x21e0('0x1d')]);}_0x3889aa[_0x21e0('0x58')]=qs['sort'](_0x3041f2[_0x21e0('0x34')]['sort']);_0x3889aa[_0x21e0('0x3d')]=qs[_0x21e0('0x36')](_[_0x21e0('0x3e')](_0x3041f2['query'],_0x560bee[_0x21e0('0x36')]));_0x3889aa[_0x21e0('0x3d')][_0x21e0('0x59')]=_0x57ac0f['id'];if(_0x3041f2['query'][_0x21e0('0x3f')]){_0x3889aa[_0x21e0('0x3d')]=_['merge'](_0x3889aa[_0x21e0('0x3d')],{'$or':_['map'](_0x3889aa[_0x21e0('0x38')],function(_0x2d8feb){var _0x25c6c9={};_0x25c6c9[_0x2d8feb]={'$like':'%'+_0x3041f2['query'][_0x21e0('0x3f')]+'%'};return _0x25c6c9;})});}_0x3889aa=_[_0x21e0('0x42')]({},_0x3889aa,_0x3041f2[_0x21e0('0x43')]);return db[_0x21e0('0x56')]['findAll'](_0x3889aa);}})['then'](function(_0x1d098f){if(_0x1d098f){return db['User'][_0x21e0('0x5a')]({'where':{'id':_['map'](_0x1d098f,'UserId'),'role':'agent'},'attributes':['id',_0x21e0('0x2c'),'whatsappPause','updatedAt','createdAt']});}})['then'](function(_0x3bf1ad){if(_0x3bf1ad){return{'count':_0x3bf1ad[_0x21e0('0x1f')],'rows':_[_0x21e0('0x2e')](_0x3bf1ad[_0x21e0('0x46')],function(_0x486565){return{'membername':_0x486565['name'],'UserId':_0x486565['id'],'queue_name':_0x963fd3[_0x21e0('0x2c')],'WhatsappQueueId':_0x963fd3['id'],'interface':util[_0x21e0('0x5b')](_0x21e0('0x5c'),'SIP',_0x486565[_0x21e0('0x2c')]),'penalty':0x0,'paused':_0x486565[_0x21e0('0x5d')],'createdAt':_0x486565['createdAt'],'updatedAt':_0x486565[_0x21e0('0x5e')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x342dbc,_0x3889aa))[_0x21e0('0x47')](handleError(_0x342dbc,null));};exports[_0x21e0('0x5f')]=function(_0x57f3b7,_0x4c9176,_0x4f9ad8){var _0x297b48={};var _0x2cd85b={};var _0x452b40;var _0x2c5901;return db[_0x21e0('0x2f')][_0x21e0('0x60')]({'where':{'id':_0x57f3b7[_0x21e0('0x49')]['id']}})['then'](handleEntityNotFound(_0x4c9176,null))[_0x21e0('0x25')](function(_0x2512dd){if(_0x2512dd){_0x452b40=_0x2512dd;_0x2cd85b[_0x21e0('0x33')]=_[_0x21e0('0x35')](db['Team'][_0x21e0('0x30')]);_0x2cd85b['query']=_[_0x21e0('0x35')](_0x57f3b7[_0x21e0('0x34')]);_0x2cd85b[_0x21e0('0x36')]=_[_0x21e0('0x37')](_0x2cd85b[_0x21e0('0x33')],_0x2cd85b[_0x21e0('0x34')]);_0x297b48[_0x21e0('0x38')]=_['intersection'](_0x2cd85b[_0x21e0('0x33')],qs[_0x21e0('0x39')](_0x57f3b7[_0x21e0('0x34')]['fields']));_0x297b48[_0x21e0('0x38')]=_0x297b48[_0x21e0('0x38')][_0x21e0('0x3a')]?_0x297b48[_0x21e0('0x38')]:_0x2cd85b['model'];_0x297b48['order']=qs[_0x21e0('0x3c')](_0x57f3b7[_0x21e0('0x34')][_0x21e0('0x3c')]);_0x297b48['where']=qs[_0x21e0('0x36')](_['pick'](_0x57f3b7[_0x21e0('0x34')],_0x2cd85b[_0x21e0('0x36')]));if(_0x57f3b7['query'][_0x21e0('0x3f')]){_0x297b48['where']=_[_0x21e0('0x42')](_0x297b48[_0x21e0('0x3d')],{'$or':_[_0x21e0('0x2e')](_0x297b48[_0x21e0('0x38')],function(_0x4f7300){var _0x318c6e={};_0x318c6e[_0x4f7300]={'$like':'%'+_0x57f3b7[_0x21e0('0x34')][_0x21e0('0x3f')]+'%'};return _0x318c6e;})});}_0x297b48=_[_0x21e0('0x42')]({},_0x297b48,_0x57f3b7[_0x21e0('0x43')]);return _0x452b40[_0x21e0('0x5f')](_0x297b48);}})[_0x21e0('0x25')](function(_0x885f8a){if(_0x885f8a){_0x2c5901=_0x885f8a[_0x21e0('0x3a')];if(!_0x57f3b7[_0x21e0('0x34')][_0x21e0('0x57')](_0x21e0('0x3b'))){_0x297b48[_0x21e0('0x20')]=qs[_0x21e0('0x20')](_0x57f3b7[_0x21e0('0x34')]['limit']);_0x297b48['offset']=qs[_0x21e0('0x1d')](_0x57f3b7[_0x21e0('0x34')][_0x21e0('0x1d')]);}return _0x452b40['getTeams'](_0x297b48);}})[_0x21e0('0x25')](function(_0x9f4d59){if(_0x9f4d59){return _0x9f4d59?{'count':_0x2c5901,'rows':_0x9f4d59}:null;}})[_0x21e0('0x25')](respondWithResult(_0x4c9176,null))[_0x21e0('0x47')](handleError(_0x4c9176,null));};exports[_0x21e0('0x61')]=function(_0x3fb330,_0x292653,_0x3f5ae2){var _0x31ff02=_0x3fb330['body'][_0x21e0('0x62')];return db[_0x21e0('0x63')][_0x21e0('0x64')]({'where':{'id':_0x31ff02},'attributes':['id'],'include':[{'model':db[_0x21e0('0x65')],'as':_0x21e0('0x66'),'attributes':['id',_0x21e0('0x2c'),_0x21e0('0x67'),_0x21e0('0x68'),_0x21e0('0x69')],'raw':!![]}]})['then'](function(_0x23e9c8){if(_0x23e9c8){var _0x1f5f95=_[_0x21e0('0x6a')](_0x23e9c8,function(_0x5e183b){var _0xc17ae1=_0x5e183b[_0x21e0('0x27')]({'plain':!![]});return _0xc17ae1[_0x21e0('0x66')];});return db[_0x21e0('0x2f')][_0x21e0('0x4a')]({'where':{'id':_0x3fb330[_0x21e0('0x49')]['id']}})[_0x21e0('0x25')](function(_0x51f4d6){return db['sequelize']['transaction'](function(_0x2d7228){return _0x51f4d6[_0x21e0('0x61')](_0x31ff02,{'transaction':_0x2d7228})[_0x21e0('0x25')](function(){return BPromise[_0x21e0('0x6b')](_0x1f5f95,function(_0x5bcb25){return db[_0x21e0('0x56')]['findOrCreate']({'where':{'UserId':_0x5bcb25['id'],'WhatsappQueueId':_0x3fb330[_0x21e0('0x49')]['id']},'transaction':_0x2d7228});});})['then'](function(){_0x1f5f95[_0x21e0('0x6c')](function(_0x26e0b5){socket[_0x21e0('0x6d')](_0x21e0('0x6e'),{'UserId':_0x26e0b5['id'],'WhatsappQueueId':_0x51f4d6['id']});});});});});}})['then'](respondWithStatusCode(_0x292653,null))[_0x21e0('0x47')](handleError(_0x292653,null));};exports['removeTeams']=function(_0x548af6,_0x1a58be,_0x31e8ca){return db[_0x21e0('0x63')][_0x21e0('0x64')]({'where':{'id':_0x548af6[_0x21e0('0x34')][_0x21e0('0x62')]},'attributes':['id'],'include':[{'model':db[_0x21e0('0x65')],'as':_0x21e0('0x66'),'attributes':['id'],'raw':!![]}]})[_0x21e0('0x25')](handleEntityNotFound(_0x1a58be,null))['then'](function(_0x2f4171){var _0x5d5797=_['map'](_0x2f4171,'id');var _0x356be9=[];var _0x42dfd1=[];var _0x948de4=squel[_0x21e0('0x6f')]();_0x948de4[_0x21e0('0x70')](_0x21e0('0x71'))['from'](_0x21e0('0x72'),'tq')[_0x21e0('0x73')](_0x21e0('0x74'),'ut',_0x21e0('0x75'))[_0x21e0('0x3d')]('WhatsappQueueId\x20=\x20?',_0x548af6['params']['id']);for(var _0x33bc5f=0x0;_0x33bc5f<_0x2f4171['length'];_0x33bc5f+=0x1){let _0x47fa0b=_0x2f4171[_0x33bc5f];for(var _0x2f9a3d=0x0;_0x2f9a3d<_0x47fa0b[_0x21e0('0x66')]['length'];_0x2f9a3d+=0x1){let _0x846ca7=_0x47fa0b[_0x21e0('0x66')][_0x2f9a3d];var _0x57f4b8=_0x948de4[_0x21e0('0x76')]();_0x57f4b8[_0x21e0('0x3d')]('ut.UserId\x20=\x20?',_0x846ca7['id']);_0x42dfd1[_0x21e0('0x77')](db[_0x21e0('0x78')][_0x21e0('0x34')](_0x57f4b8[_0x21e0('0x79')](),{'type':db['sequelize']['QueryTypes'][_0x21e0('0x7a')]})[_0x21e0('0x25')](function(_0x100f78){if(_0x100f78['length']===0x1){return _0x846ca7['id'];}else{var _0x219050=_['every'](_[_0x21e0('0x2e')](_0x100f78,_0x21e0('0x7b')),function(_0xff5920){return _['includes'](_0x5d5797,_0xff5920);});if(_0x219050){return _0x846ca7['id'];}}}));}}return BPromise[_0x21e0('0x7c')](_0x42dfd1)[_0x21e0('0x25')](function(_0xfe5f70){_0x356be9=_(_0x356be9)['union'](_0xfe5f70)['compact']()['value']();return db['WhatsappQueue'][_0x21e0('0x4a')]({'where':{'id':_0x548af6[_0x21e0('0x49')]['id']}})[_0x21e0('0x25')](function(_0x4b6136){return db['sequelize']['transaction'](function(_0x48ff90){return _0x4b6136[_0x21e0('0x7d')](_0x548af6['query']['ids'],{'transaction':_0x48ff90})[_0x21e0('0x25')](function(){if(!_[_0x21e0('0x7e')](_0x356be9)){return _0x4b6136[_0x21e0('0x7f')](_0x356be9,{'transaction':_0x48ff90});}})['then'](function(){_0x356be9[_0x21e0('0x6c')](function(_0x4995bd){socket[_0x21e0('0x6d')](_0x21e0('0x80'),{'UserId':_0x4995bd,'WhatsappQueueId':_0x4b6136['id']});});});});});});})['then'](respondWithStatusCode(_0x1a58be,null))['catch'](handleError(_0x1a58be,null));};exports['addAgents']=function(_0x8686ad,_0x217279,_0x19176b){return db[_0x21e0('0x2f')][_0x21e0('0x4a')]({'where':{'id':_0x8686ad['params']['id']}})[_0x21e0('0x25')](handleEntityNotFound(_0x217279,null))['then'](function(_0xb25812){if(_0xb25812){return _0xb25812[_0x21e0('0x81')](_0x8686ad[_0x21e0('0x4c')][_0x21e0('0x62')],_[_0x21e0('0x82')](_0x8686ad[_0x21e0('0x4c')],[_0x21e0('0x62'),'id'])||{})[_0x21e0('0x83')](function(_0x3606bd){for(var _0x2ca1de=0x0;_0x2ca1de<_0x8686ad[_0x21e0('0x4c')][_0x21e0('0x62')][_0x21e0('0x3a')];_0x2ca1de+=0x1){socket['emit'](_0x21e0('0x6e'),{'UserId':Number(_0x8686ad['body'][_0x21e0('0x62')][_0x2ca1de]),'WhatsappQueueId':Number(_0x8686ad[_0x21e0('0x49')]['id'])});}return _0x3606bd;});}})[_0x21e0('0x25')](respondWithResult(_0x217279,null))[_0x21e0('0x47')](handleError(_0x217279,null));};exports[_0x21e0('0x7f')]=function(_0x42477b,_0x22ae3d,_0x2f859a){return db[_0x21e0('0x2f')][_0x21e0('0x4a')]({'where':{'id':_0x42477b[_0x21e0('0x49')]['id']}})[_0x21e0('0x25')](handleEntityNotFound(_0x22ae3d,null))[_0x21e0('0x25')](function(_0x5364ea){if(_0x5364ea){return _0x5364ea[_0x21e0('0x7f')](_0x42477b[_0x21e0('0x34')][_0x21e0('0x62')])['then'](function(){if(_['isArray'](_0x42477b[_0x21e0('0x34')][_0x21e0('0x62')])){for(var _0xcfd385=0x0;_0xcfd385<_0x42477b['query']['ids'][_0x21e0('0x3a')];_0xcfd385+=0x1){socket[_0x21e0('0x6d')](_0x21e0('0x80'),{'UserId':Number(_0x42477b[_0x21e0('0x34')][_0x21e0('0x62')][_0xcfd385]),'WhatsappQueueId':Number(_0x42477b['params']['id'])});}}else{socket[_0x21e0('0x6d')](_0x21e0('0x80'),{'UserId':Number(_0x42477b[_0x21e0('0x34')]['ids']),'WhatsappQueueId':Number(_0x42477b['params']['id'])});}});}})['then'](respondWithStatusCode(_0x22ae3d,null))[_0x21e0('0x47')](handleError(_0x22ae3d,null));};exports['getAgents']=function(_0x546d54,_0x84b1f,_0x54132e){var _0xea8af6={};var _0x54e59e={};var _0xe8521a;var _0x1417ed;return db[_0x21e0('0x2f')][_0x21e0('0x60')]({'where':{'id':_0x546d54[_0x21e0('0x49')]['id']}})['then'](handleEntityNotFound(_0x84b1f,null))[_0x21e0('0x25')](function(_0x11f342){if(_0x11f342){_0xe8521a=_0x11f342;_0x54e59e[_0x21e0('0x33')]=_[_0x21e0('0x35')](db[_0x21e0('0x65')]['rawAttributes']);_0x54e59e[_0x21e0('0x34')]=_[_0x21e0('0x35')](_0x546d54['query']);_0x54e59e[_0x21e0('0x36')]=_[_0x21e0('0x37')](_0x54e59e[_0x21e0('0x33')],_0x54e59e['query']);_0xea8af6[_0x21e0('0x38')]=_[_0x21e0('0x37')](_0x54e59e[_0x21e0('0x33')],qs[_0x21e0('0x39')](_0x546d54[_0x21e0('0x34')][_0x21e0('0x39')]));_0xea8af6[_0x21e0('0x38')]=_0xea8af6[_0x21e0('0x38')][_0x21e0('0x3a')]?_0xea8af6[_0x21e0('0x38')]:_0x54e59e[_0x21e0('0x33')];_0xea8af6[_0x21e0('0x58')]=qs[_0x21e0('0x3c')](_0x546d54[_0x21e0('0x34')][_0x21e0('0x3c')]);_0xea8af6[_0x21e0('0x3d')]=qs[_0x21e0('0x36')](_[_0x21e0('0x3e')](_0x546d54[_0x21e0('0x34')],_0x54e59e[_0x21e0('0x36')]));if(_0x546d54['query'][_0x21e0('0x3f')]){_0xea8af6[_0x21e0('0x3d')]=_['merge'](_0xea8af6['where'],{'$or':_['map'](_0xea8af6['attributes'],function(_0x51df6c){var _0x12a81e={};_0x12a81e[_0x51df6c]={'$like':'%'+_0x546d54[_0x21e0('0x34')][_0x21e0('0x3f')]+'%'};return _0x12a81e;})});}_0xea8af6=_['merge']({},_0xea8af6,_0x546d54[_0x21e0('0x43')]);return _0xe8521a[_0x21e0('0x84')](_0xea8af6);}})[_0x21e0('0x25')](function(_0x4ee564){if(_0x4ee564){_0x1417ed=_0x4ee564[_0x21e0('0x3a')];if(!_0x546d54['query'][_0x21e0('0x57')](_0x21e0('0x3b'))){_0xea8af6[_0x21e0('0x20')]=qs[_0x21e0('0x20')](_0x546d54['query']['limit']);_0xea8af6[_0x21e0('0x1d')]=qs[_0x21e0('0x1d')](_0x546d54[_0x21e0('0x34')][_0x21e0('0x1d')]);}return _0xe8521a[_0x21e0('0x84')](_0xea8af6);}})[_0x21e0('0x25')](function(_0x387e72){if(_0x387e72){return _0x387e72?{'count':_0x1417ed,'rows':_0x387e72}:null;}})[_0x21e0('0x25')](respondWithResult(_0x84b1f,null))['catch'](handleError(_0x84b1f,null));}; \ No newline at end of file +var _0xd31f=['merge','VIRTUAL','options','includeAll','include','rows','catch','params','intersection','find','create','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','getMembers','findOne','pick','WhatsappQueueId','UserWhatsappQueue','findAndCountAll','UserId','agent','whatsappPause','updatedAt','createdAt','format','%s/%s','SIP','Team','getTeams','ids','findAll','Agents','online','voicePause','interface','sequelize','transaction','addTeams','findOrCreate','forEach','emit','userWhatsappQueue:save','removeTeams','User','select','tq.TeamId','from','join','user_has_teams','clone','ut.UserId\x20=\x20?','push','SELECT','every','includes','all','union','compact','isEmpty','removeAgents','addAgents','omit','spread','isArray','userWhatsappQueue:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./whatsappQueue.socket','status','end','json','offset','undefined','count','set','reject','save','update','then','destroy','get','WhatsappQueues','UserProfileResource','sendStatus','error','stack','name','send','map','WhatsappQueue','rawAttributes','fieldName','type','key','model','keys','filters','query','attributes','fields','length','hasOwnProperty','nolimit','limit','sort','where','filter'];(function(_0x3878e9,_0x14fcf2){var _0x2ad526=function(_0x1bd76b){while(--_0x1bd76b){_0x3878e9['push'](_0x3878e9['shift']());}};_0x2ad526(++_0x14fcf2);}(_0xd31f,0xd3));var _0xfd31=function(_0x1c3627,_0x2cbb5d){_0x1c3627=_0x1c3627-0x0;var _0x4422ac=_0xd31f[_0x1c3627];return _0x4422ac;};'use strict';var emlformat=require(_0xfd31('0x0'));var rimraf=require(_0xfd31('0x1'));var zipdir=require(_0xfd31('0x2'));var jsonpatch=require(_0xfd31('0x3'));var rp=require(_0xfd31('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xfd31('0x5'));var util=require(_0xfd31('0x6'));var path=require(_0xfd31('0x7'));var sox=require(_0xfd31('0x8'));var csv=require(_0xfd31('0x9'));var ejs=require(_0xfd31('0xa'));var fs=require('fs');var fs_extra=require(_0xfd31('0xb'));var _=require(_0xfd31('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xfd31('0xd'));var deskjs=require(_0xfd31('0xe'));var toCsv=require(_0xfd31('0x9'));var querystring=require('querystring');var Papa=require(_0xfd31('0xf'));var Redis=require('ioredis');var authService=require(_0xfd31('0x10'));var qs=require(_0xfd31('0x11'));var as=require(_0xfd31('0x12'));var hardwareService=require(_0xfd31('0x13'));var logger=require('../../config/logger')(_0xfd31('0x14'));var utils=require(_0xfd31('0x15'));var config=require(_0xfd31('0x16'));var licenseUtil=require(_0xfd31('0x17'));var db=require(_0xfd31('0x18'))['db'];config[_0xfd31('0x19')]=_[_0xfd31('0x1a')](config['redis'],{'host':_0xfd31('0x1b'),'port':0x18eb});var socket=require(_0xfd31('0x1c'))(new Redis(config['redis']));require(_0xfd31('0x1d'))['register'](socket);function respondWithStatusCode(_0x29a702,_0x294c62){_0x294c62=_0x294c62||0xcc;return function(_0x47e35b){if(_0x47e35b){return _0x29a702['sendStatus'](_0x294c62);}return _0x29a702[_0xfd31('0x1e')](_0x294c62)[_0xfd31('0x1f')]();};}function respondWithResult(_0x3cc01b,_0x149a1f){_0x149a1f=_0x149a1f||0xc8;return function(_0x1f314c){if(_0x1f314c){return _0x3cc01b[_0xfd31('0x1e')](_0x149a1f)[_0xfd31('0x20')](_0x1f314c);}};}function respondWithFilteredResult(_0x2ac969,_0xf2177b){return function(_0x1b5cc8){if(_0x1b5cc8){var _0x4f2b2d=typeof _0xf2177b[_0xfd31('0x21')]==='undefined'&&typeof _0xf2177b['limit']===_0xfd31('0x22');var _0x5d3533=_0x1b5cc8[_0xfd31('0x23')];var _0x3ec710=_0x4f2b2d?0x0:_0xf2177b['offset'];var _0x3cda15=_0x4f2b2d?_0x1b5cc8[_0xfd31('0x23')]:_0xf2177b[_0xfd31('0x21')]+_0xf2177b['limit'];var _0x1388cb;if(_0x3cda15>=_0x5d3533){_0x3cda15=_0x5d3533;_0x1388cb=0xc8;}else{_0x1388cb=0xce;}_0x2ac969[_0xfd31('0x1e')](_0x1388cb);return _0x2ac969[_0xfd31('0x24')]('Content-Range',_0x3ec710+'-'+_0x3cda15+'/'+_0x5d3533)[_0xfd31('0x20')](_0x1b5cc8);}return null;};}function patchUpdates(_0x54f0bb){return function(_0x15983e){try{jsonpatch['apply'](_0x15983e,_0x54f0bb,!![]);}catch(_0x127fd1){return BPromise[_0xfd31('0x25')](_0x127fd1);}return _0x15983e[_0xfd31('0x26')]();};}function saveUpdates(_0x48f027,_0x4bf43f){return function(_0x37ae48){if(_0x37ae48){return _0x37ae48[_0xfd31('0x27')](_0x48f027)[_0xfd31('0x28')](function(_0x493baa){return _0x493baa;});}return null;};}function removeEntity(_0x3ffbd9,_0x466aed){return function(_0x1a0e99){if(_0x1a0e99){return _0x1a0e99[_0xfd31('0x29')]()[_0xfd31('0x28')](function(){var _0x23262a=_0x1a0e99[_0xfd31('0x2a')]({'plain':!![]});var _0x1441bb=_0xfd31('0x2b');return db[_0xfd31('0x2c')]['destroy']({'where':{'type':_0x1441bb,'resourceId':_0x23262a['id']}})[_0xfd31('0x28')](function(){return _0x1a0e99;});})[_0xfd31('0x28')](function(){_0x3ffbd9[_0xfd31('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x41c069,_0x4bad89){return function(_0x41e881){if(!_0x41e881){_0x41c069[_0xfd31('0x2d')](0x194);}return _0x41e881;};}function handleError(_0x4363c0,_0x407525){_0x407525=_0x407525||0x1f4;return function(_0x10f407){logger[_0xfd31('0x2e')](_0x10f407[_0xfd31('0x2f')]);if(_0x10f407['name']){delete _0x10f407[_0xfd31('0x30')];}_0x4363c0[_0xfd31('0x1e')](_0x407525)[_0xfd31('0x31')](_0x10f407);};}exports['index']=function(_0xb2dcac,_0x19faf2){var _0x1cb2cd={},_0x260b1f={},_0x47687f={'count':0x0,'rows':[]};var _0x5cad1e=_[_0xfd31('0x32')](db[_0xfd31('0x33')][_0xfd31('0x34')],function(_0x4fbacc){return{'name':_0x4fbacc[_0xfd31('0x35')],'type':_0x4fbacc[_0xfd31('0x36')][_0xfd31('0x37')]};});_0x260b1f[_0xfd31('0x38')]=_[_0xfd31('0x32')](_0x5cad1e,_0xfd31('0x30'));_0x260b1f['query']=_[_0xfd31('0x39')](_0xb2dcac['query']);_0x260b1f[_0xfd31('0x3a')]=_['intersection'](_0x260b1f[_0xfd31('0x38')],_0x260b1f[_0xfd31('0x3b')]);_0x1cb2cd[_0xfd31('0x3c')]=_['intersection'](_0x260b1f['model'],qs[_0xfd31('0x3d')](_0xb2dcac[_0xfd31('0x3b')]['fields']));_0x1cb2cd['attributes']=_0x1cb2cd[_0xfd31('0x3c')][_0xfd31('0x3e')]?_0x1cb2cd['attributes']:_0x260b1f['model'];if(!_0xb2dcac['query'][_0xfd31('0x3f')](_0xfd31('0x40'))){_0x1cb2cd[_0xfd31('0x41')]=qs[_0xfd31('0x41')](_0xb2dcac['query'][_0xfd31('0x41')]);_0x1cb2cd['offset']=qs[_0xfd31('0x21')](_0xb2dcac[_0xfd31('0x3b')][_0xfd31('0x21')]);}_0x1cb2cd['order']=qs[_0xfd31('0x42')](_0xb2dcac[_0xfd31('0x3b')]['sort']);_0x1cb2cd[_0xfd31('0x43')]=qs[_0xfd31('0x3a')](_['pick'](_0xb2dcac[_0xfd31('0x3b')],_0x260b1f[_0xfd31('0x3a')]),_0x5cad1e);if(_0xb2dcac[_0xfd31('0x3b')][_0xfd31('0x44')]){_0x1cb2cd[_0xfd31('0x43')]=_[_0xfd31('0x45')](_0x1cb2cd[_0xfd31('0x43')],{'$or':_[_0xfd31('0x32')](_0x5cad1e,function(_0x32288b){if(_0x32288b[_0xfd31('0x36')]!==_0xfd31('0x46')){var _0x2fc389={};_0x2fc389[_0x32288b[_0xfd31('0x30')]]={'$like':'%'+_0xb2dcac[_0xfd31('0x3b')][_0xfd31('0x44')]+'%'};return _0x2fc389;}})});}_0x1cb2cd=_[_0xfd31('0x45')]({},_0x1cb2cd,_0xb2dcac[_0xfd31('0x47')]);var _0x32dde6={'where':_0x1cb2cd[_0xfd31('0x43')]};return db[_0xfd31('0x33')][_0xfd31('0x23')](_0x32dde6)[_0xfd31('0x28')](function(_0x332f21){_0x47687f[_0xfd31('0x23')]=_0x332f21;if(_0xb2dcac[_0xfd31('0x3b')][_0xfd31('0x48')]){_0x1cb2cd[_0xfd31('0x49')]=[{'all':!![]}];}return db['WhatsappQueue']['findAll'](_0x1cb2cd);})[_0xfd31('0x28')](function(_0x1324ca){_0x47687f[_0xfd31('0x4a')]=_0x1324ca;return _0x47687f;})[_0xfd31('0x28')](respondWithFilteredResult(_0x19faf2,_0x1cb2cd))[_0xfd31('0x4b')](handleError(_0x19faf2,null));};exports['show']=function(_0x48ad40,_0x1e9e08){var _0x3dfc4c={'raw':!![],'where':{'id':_0x48ad40[_0xfd31('0x4c')]['id']}},_0x2fda9e={};_0x2fda9e[_0xfd31('0x38')]=_[_0xfd31('0x39')](db[_0xfd31('0x33')][_0xfd31('0x34')]);_0x2fda9e['query']=_[_0xfd31('0x39')](_0x48ad40[_0xfd31('0x3b')]);_0x2fda9e[_0xfd31('0x3a')]=_[_0xfd31('0x4d')](_0x2fda9e[_0xfd31('0x38')],_0x2fda9e[_0xfd31('0x3b')]);_0x3dfc4c[_0xfd31('0x3c')]=_[_0xfd31('0x4d')](_0x2fda9e[_0xfd31('0x38')],qs[_0xfd31('0x3d')](_0x48ad40[_0xfd31('0x3b')][_0xfd31('0x3d')]));_0x3dfc4c[_0xfd31('0x3c')]=_0x3dfc4c['attributes'][_0xfd31('0x3e')]?_0x3dfc4c[_0xfd31('0x3c')]:_0x2fda9e[_0xfd31('0x38')];if(_0x48ad40[_0xfd31('0x3b')]['includeAll']){_0x3dfc4c[_0xfd31('0x49')]=[{'all':!![]}];}_0x3dfc4c=_['merge']({},_0x3dfc4c,_0x48ad40[_0xfd31('0x47')]);return db['WhatsappQueue'][_0xfd31('0x4e')](_0x3dfc4c)[_0xfd31('0x28')](handleEntityNotFound(_0x1e9e08,null))['then'](respondWithResult(_0x1e9e08,null))['catch'](handleError(_0x1e9e08,null));};exports['create']=function(_0x408474,_0x5a62c3){return db['WhatsappQueue'][_0xfd31('0x4f')](_0x408474['body'],{})['then'](function(_0x3a6b58){var _0xed673b=_0x408474[_0xfd31('0x50')][_0xfd31('0x2a')]({'plain':!![]});if(!_0xed673b)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xed673b['role']===_0xfd31('0x50')){var _0x5b8b7d=_0x3a6b58[_0xfd31('0x2a')]({'plain':!![]});var _0x3f0af5='WhatsappQueues';return db[_0xfd31('0x51')]['find']({'where':{'name':_0x3f0af5,'userProfileId':_0xed673b[_0xfd31('0x52')]},'raw':!![]})['then'](function(_0x526ce5){if(_0x526ce5&&_0x526ce5[_0xfd31('0x53')]===0x0){return db['UserProfileResource'][_0xfd31('0x4f')]({'name':_0x5b8b7d[_0xfd31('0x30')],'resourceId':_0x5b8b7d['id'],'type':_0x526ce5[_0xfd31('0x30')],'sectionId':_0x526ce5['id']},{})[_0xfd31('0x28')](function(){return _0x3a6b58;});}else{return _0x3a6b58;}})[_0xfd31('0x4b')](function(_0x14680c){logger[_0xfd31('0x2e')](_0xfd31('0x54'),_0x14680c);throw _0x14680c;});}return _0x3a6b58;})[_0xfd31('0x28')](respondWithResult(_0x5a62c3,0xc9))[_0xfd31('0x4b')](handleError(_0x5a62c3,null));};exports[_0xfd31('0x27')]=function(_0x59db4f,_0x49fcd9){if(_0x59db4f[_0xfd31('0x55')]['id']){delete _0x59db4f['body']['id'];}return db['WhatsappQueue'][_0xfd31('0x4e')]({'where':{'id':_0x59db4f[_0xfd31('0x4c')]['id']}})['then'](handleEntityNotFound(_0x49fcd9,null))[_0xfd31('0x28')](saveUpdates(_0x59db4f['body'],null))[_0xfd31('0x28')](respondWithResult(_0x49fcd9,null))[_0xfd31('0x4b')](handleError(_0x49fcd9,null));};exports[_0xfd31('0x29')]=function(_0x1e81b1,_0x36daac){return db[_0xfd31('0x33')][_0xfd31('0x4e')]({'where':{'id':_0x1e81b1[_0xfd31('0x4c')]['id']}})['then'](handleEntityNotFound(_0x36daac,null))['then'](removeEntity(_0x36daac,null))['catch'](handleError(_0x36daac,null));};exports[_0xfd31('0x56')]=function(_0x549f31,_0xdb767){return db[_0xfd31('0x33')][_0xfd31('0x56')]()[_0xfd31('0x28')](respondWithResult(_0xdb767,null))['catch'](handleError(_0xdb767,null));};exports[_0xfd31('0x57')]=function(_0x877ce4,_0x24ede4,_0x3d16a6){var _0x24d999={'raw':!![],'where':{}},_0x384c8f={},_0xebb220;return db['WhatsappQueue'][_0xfd31('0x58')]({'where':{'id':_0x877ce4['params']['id']}})[_0xfd31('0x28')](handleEntityNotFound(_0x24ede4,null))[_0xfd31('0x28')](function(_0x2d91a8){if(_0x2d91a8){_0xebb220=_0x2d91a8[_0xfd31('0x2a')]({'plain':!![]});_0x384c8f['model']=_[_0xfd31('0x39')](db['UserWhatsappQueue'][_0xfd31('0x34')]);_0x384c8f[_0xfd31('0x3b')]=_[_0xfd31('0x39')](_0x877ce4['query']);_0x384c8f[_0xfd31('0x3a')]=_['intersection'](_0x384c8f[_0xfd31('0x38')],_0x384c8f[_0xfd31('0x3b')]);_0x24d999[_0xfd31('0x3c')]=_['intersection'](_0x384c8f[_0xfd31('0x38')],qs['fields'](_0x877ce4[_0xfd31('0x3b')]['fields']));_0x24d999[_0xfd31('0x3c')]=_0x24d999[_0xfd31('0x3c')]['length']?_0x24d999['attributes']:_0x384c8f[_0xfd31('0x38')];if(!_0x877ce4['query']['hasOwnProperty'](_0xfd31('0x40'))){_0x24d999[_0xfd31('0x41')]=qs['limit'](_0x877ce4[_0xfd31('0x3b')][_0xfd31('0x41')]);_0x24d999['offset']=qs[_0xfd31('0x21')](_0x877ce4[_0xfd31('0x3b')][_0xfd31('0x21')]);}_0x24d999['order']=qs[_0xfd31('0x42')](_0x877ce4[_0xfd31('0x3b')][_0xfd31('0x42')]);_0x24d999[_0xfd31('0x43')]=qs[_0xfd31('0x3a')](_[_0xfd31('0x59')](_0x877ce4[_0xfd31('0x3b')],_0x384c8f[_0xfd31('0x3a')]));_0x24d999['where'][_0xfd31('0x5a')]=_0x2d91a8['id'];if(_0x877ce4['query'][_0xfd31('0x44')]){_0x24d999[_0xfd31('0x43')]=_['merge'](_0x24d999['where'],{'$or':_['map'](_0x24d999[_0xfd31('0x3c')],function(_0x9385b6){var _0x179c4c={};_0x179c4c[_0x9385b6]={'$like':'%'+_0x877ce4['query'][_0xfd31('0x44')]+'%'};return _0x179c4c;})});}_0x24d999=_[_0xfd31('0x45')]({},_0x24d999,_0x877ce4[_0xfd31('0x47')]);return db[_0xfd31('0x5b')]['findAll'](_0x24d999);}})[_0xfd31('0x28')](function(_0x5e3f1d){if(_0x5e3f1d){return db['User'][_0xfd31('0x5c')]({'where':{'id':_[_0xfd31('0x32')](_0x5e3f1d,_0xfd31('0x5d')),'role':_0xfd31('0x5e')},'attributes':['id',_0xfd31('0x30'),_0xfd31('0x5f'),_0xfd31('0x60'),_0xfd31('0x61')]});}})[_0xfd31('0x28')](function(_0x20e9c9){if(_0x20e9c9){return{'count':_0x20e9c9[_0xfd31('0x23')],'rows':_[_0xfd31('0x32')](_0x20e9c9[_0xfd31('0x4a')],function(_0x52570e){return{'membername':_0x52570e['name'],'UserId':_0x52570e['id'],'queue_name':_0xebb220['name'],'WhatsappQueueId':_0xebb220['id'],'interface':util[_0xfd31('0x62')](_0xfd31('0x63'),_0xfd31('0x64'),_0x52570e[_0xfd31('0x30')]),'penalty':0x0,'paused':_0x52570e[_0xfd31('0x5f')],'createdAt':_0x52570e[_0xfd31('0x61')],'updatedAt':_0x52570e[_0xfd31('0x60')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xfd31('0x28')](respondWithFilteredResult(_0x24ede4,_0x24d999))[_0xfd31('0x4b')](handleError(_0x24ede4,null));};exports['getTeams']=function(_0x17644c,_0x363a8d,_0x3630d7){var _0x5c8a5d={};var _0x777443={};var _0x15f7f0;var _0x5bf9b1;return db[_0xfd31('0x33')][_0xfd31('0x58')]({'where':{'id':_0x17644c[_0xfd31('0x4c')]['id']}})[_0xfd31('0x28')](handleEntityNotFound(_0x363a8d,null))['then'](function(_0xbea871){if(_0xbea871){_0x15f7f0=_0xbea871;_0x777443[_0xfd31('0x38')]=_[_0xfd31('0x39')](db[_0xfd31('0x65')][_0xfd31('0x34')]);_0x777443[_0xfd31('0x3b')]=_[_0xfd31('0x39')](_0x17644c[_0xfd31('0x3b')]);_0x777443['filters']=_['intersection'](_0x777443['model'],_0x777443[_0xfd31('0x3b')]);_0x5c8a5d[_0xfd31('0x3c')]=_['intersection'](_0x777443[_0xfd31('0x38')],qs[_0xfd31('0x3d')](_0x17644c['query'][_0xfd31('0x3d')]));_0x5c8a5d[_0xfd31('0x3c')]=_0x5c8a5d[_0xfd31('0x3c')][_0xfd31('0x3e')]?_0x5c8a5d[_0xfd31('0x3c')]:_0x777443['model'];_0x5c8a5d['order']=qs[_0xfd31('0x42')](_0x17644c['query'][_0xfd31('0x42')]);_0x5c8a5d[_0xfd31('0x43')]=qs[_0xfd31('0x3a')](_[_0xfd31('0x59')](_0x17644c[_0xfd31('0x3b')],_0x777443[_0xfd31('0x3a')]));if(_0x17644c[_0xfd31('0x3b')]['filter']){_0x5c8a5d[_0xfd31('0x43')]=_['merge'](_0x5c8a5d['where'],{'$or':_[_0xfd31('0x32')](_0x5c8a5d[_0xfd31('0x3c')],function(_0x144281){var _0x4b9610={};_0x4b9610[_0x144281]={'$like':'%'+_0x17644c[_0xfd31('0x3b')][_0xfd31('0x44')]+'%'};return _0x4b9610;})});}_0x5c8a5d=_['merge']({},_0x5c8a5d,_0x17644c[_0xfd31('0x47')]);return _0x15f7f0['getTeams'](_0x5c8a5d);}})[_0xfd31('0x28')](function(_0x36e2bd){if(_0x36e2bd){_0x5bf9b1=_0x36e2bd['length'];if(!_0x17644c['query'][_0xfd31('0x3f')](_0xfd31('0x40'))){_0x5c8a5d[_0xfd31('0x41')]=qs[_0xfd31('0x41')](_0x17644c[_0xfd31('0x3b')][_0xfd31('0x41')]);_0x5c8a5d[_0xfd31('0x21')]=qs[_0xfd31('0x21')](_0x17644c['query'][_0xfd31('0x21')]);}return _0x15f7f0[_0xfd31('0x66')](_0x5c8a5d);}})['then'](function(_0x28f6f0){if(_0x28f6f0){return _0x28f6f0?{'count':_0x5bf9b1,'rows':_0x28f6f0}:null;}})['then'](respondWithResult(_0x363a8d,null))[_0xfd31('0x4b')](handleError(_0x363a8d,null));};exports['addTeams']=function(_0x36b1bf,_0x80a314,_0x1519cc){var _0x27c7d3=_0x36b1bf[_0xfd31('0x55')][_0xfd31('0x67')];return db[_0xfd31('0x65')][_0xfd31('0x68')]({'where':{'id':_0x27c7d3},'attributes':['id'],'include':[{'model':db['User'],'as':_0xfd31('0x69'),'attributes':['id',_0xfd31('0x30'),_0xfd31('0x6a'),_0xfd31('0x6b'),_0xfd31('0x6c')],'raw':!![]}]})[_0xfd31('0x28')](function(_0x108cb2){if(_0x108cb2){var _0x2626a5=_['flatMap'](_0x108cb2,function(_0x26e51e){var _0xa8b20b=_0x26e51e['get']({'plain':!![]});return _0xa8b20b[_0xfd31('0x69')];});return db[_0xfd31('0x33')][_0xfd31('0x4e')]({'where':{'id':_0x36b1bf[_0xfd31('0x4c')]['id']}})['then'](function(_0x146e87){return db[_0xfd31('0x6d')][_0xfd31('0x6e')](function(_0x517866){return _0x146e87[_0xfd31('0x6f')](_0x27c7d3,{'transaction':_0x517866})['then'](function(){return BPromise['each'](_0x2626a5,function(_0x389d32){return db[_0xfd31('0x5b')][_0xfd31('0x70')]({'where':{'UserId':_0x389d32['id'],'WhatsappQueueId':_0x36b1bf[_0xfd31('0x4c')]['id']},'transaction':_0x517866});});})[_0xfd31('0x28')](function(){_0x2626a5[_0xfd31('0x71')](function(_0x17c227){socket[_0xfd31('0x72')](_0xfd31('0x73'),{'UserId':_0x17c227['id'],'WhatsappQueueId':_0x146e87['id']});});});});});}})[_0xfd31('0x28')](respondWithStatusCode(_0x80a314,null))[_0xfd31('0x4b')](handleError(_0x80a314,null));};exports[_0xfd31('0x74')]=function(_0x3fe984,_0xea70d2,_0x55fa4c){return db['Team'][_0xfd31('0x68')]({'where':{'id':_0x3fe984[_0xfd31('0x3b')][_0xfd31('0x67')]},'attributes':['id'],'include':[{'model':db[_0xfd31('0x75')],'as':_0xfd31('0x69'),'attributes':['id'],'raw':!![]}]})[_0xfd31('0x28')](handleEntityNotFound(_0xea70d2,null))[_0xfd31('0x28')](function(_0x1ae6a4){var _0x1b20cd=_[_0xfd31('0x32')](_0x1ae6a4,'id');var _0x8c127b=[];var _0x3ae84a=[];var _0x9b8ae7=squel[_0xfd31('0x76')]();_0x9b8ae7['field'](_0xfd31('0x77'))[_0xfd31('0x78')]('team_has_whatsapp_queues','tq')[_0xfd31('0x79')](_0xfd31('0x7a'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0xfd31('0x43')]('WhatsappQueueId\x20=\x20?',_0x3fe984[_0xfd31('0x4c')]['id']);for(var _0x45058b=0x0;_0x45058b<_0x1ae6a4[_0xfd31('0x3e')];_0x45058b+=0x1){let _0x19a310=_0x1ae6a4[_0x45058b];for(var _0x4cf690=0x0;_0x4cf690<_0x19a310[_0xfd31('0x69')][_0xfd31('0x3e')];_0x4cf690+=0x1){let _0x218f8b=_0x19a310['Agents'][_0x4cf690];var _0x25a7ca=_0x9b8ae7[_0xfd31('0x7b')]();_0x25a7ca[_0xfd31('0x43')](_0xfd31('0x7c'),_0x218f8b['id']);_0x3ae84a[_0xfd31('0x7d')](db[_0xfd31('0x6d')][_0xfd31('0x3b')](_0x25a7ca['toString'](),{'type':db[_0xfd31('0x6d')]['QueryTypes'][_0xfd31('0x7e')]})[_0xfd31('0x28')](function(_0x4b4a6e){if(_0x4b4a6e[_0xfd31('0x3e')]===0x1){return _0x218f8b['id'];}else{var _0x3217d0=_[_0xfd31('0x7f')](_[_0xfd31('0x32')](_0x4b4a6e,'TeamId'),function(_0x52703f){return _[_0xfd31('0x80')](_0x1b20cd,_0x52703f);});if(_0x3217d0){return _0x218f8b['id'];}}}));}}return BPromise[_0xfd31('0x81')](_0x3ae84a)[_0xfd31('0x28')](function(_0x571954){_0x8c127b=_(_0x8c127b)[_0xfd31('0x82')](_0x571954)[_0xfd31('0x83')]()['value']();return db[_0xfd31('0x33')][_0xfd31('0x4e')]({'where':{'id':_0x3fe984['params']['id']}})[_0xfd31('0x28')](function(_0x2a3f03){return db['sequelize']['transaction'](function(_0x20a7ad){return _0x2a3f03['removeTeams'](_0x3fe984[_0xfd31('0x3b')][_0xfd31('0x67')],{'transaction':_0x20a7ad})[_0xfd31('0x28')](function(){if(!_[_0xfd31('0x84')](_0x8c127b)){return _0x2a3f03[_0xfd31('0x85')](_0x8c127b,{'transaction':_0x20a7ad});}})['then'](function(){_0x8c127b[_0xfd31('0x71')](function(_0x52c868){socket[_0xfd31('0x72')]('userWhatsappQueue:remove',{'UserId':_0x52c868,'WhatsappQueueId':_0x2a3f03['id']});});});});});});})[_0xfd31('0x28')](respondWithStatusCode(_0xea70d2,null))[_0xfd31('0x4b')](handleError(_0xea70d2,null));};exports[_0xfd31('0x86')]=function(_0xf63c1,_0x39ac92,_0x5de272){return db[_0xfd31('0x33')]['find']({'where':{'id':_0xf63c1[_0xfd31('0x4c')]['id']}})['then'](handleEntityNotFound(_0x39ac92,null))['then'](function(_0x435f93){if(_0x435f93){return _0x435f93[_0xfd31('0x86')](_0xf63c1[_0xfd31('0x55')][_0xfd31('0x67')],_[_0xfd31('0x87')](_0xf63c1[_0xfd31('0x55')],[_0xfd31('0x67'),'id'])||{})[_0xfd31('0x88')](function(_0x403c0e){for(var _0x26cacc=0x0;_0x26cacc<_0xf63c1['body']['ids'][_0xfd31('0x3e')];_0x26cacc+=0x1){socket['emit']('userWhatsappQueue:save',{'UserId':Number(_0xf63c1[_0xfd31('0x55')]['ids'][_0x26cacc]),'WhatsappQueueId':Number(_0xf63c1[_0xfd31('0x4c')]['id'])});}return _0x403c0e;});}})[_0xfd31('0x28')](respondWithResult(_0x39ac92,null))[_0xfd31('0x4b')](handleError(_0x39ac92,null));};exports[_0xfd31('0x85')]=function(_0x3ec241,_0xe1b0f0,_0xce0923){return db[_0xfd31('0x33')][_0xfd31('0x4e')]({'where':{'id':_0x3ec241[_0xfd31('0x4c')]['id']}})[_0xfd31('0x28')](handleEntityNotFound(_0xe1b0f0,null))[_0xfd31('0x28')](function(_0x377131){if(_0x377131){return _0x377131['removeAgents'](_0x3ec241[_0xfd31('0x3b')][_0xfd31('0x67')])[_0xfd31('0x28')](function(){if(_[_0xfd31('0x89')](_0x3ec241[_0xfd31('0x3b')][_0xfd31('0x67')])){for(var _0x24e6cf=0x0;_0x24e6cf<_0x3ec241[_0xfd31('0x3b')]['ids']['length'];_0x24e6cf+=0x1){socket['emit'](_0xfd31('0x8a'),{'UserId':Number(_0x3ec241[_0xfd31('0x3b')]['ids'][_0x24e6cf]),'WhatsappQueueId':Number(_0x3ec241['params']['id'])});}}else{socket[_0xfd31('0x72')](_0xfd31('0x8a'),{'UserId':Number(_0x3ec241[_0xfd31('0x3b')][_0xfd31('0x67')]),'WhatsappQueueId':Number(_0x3ec241[_0xfd31('0x4c')]['id'])});}});}})[_0xfd31('0x28')](respondWithStatusCode(_0xe1b0f0,null))[_0xfd31('0x4b')](handleError(_0xe1b0f0,null));};exports[_0xfd31('0x8b')]=function(_0x1d9b6a,_0x253c90,_0x281bbd){var _0x5bc67f={};var _0x1282f3={};var _0x52e48b;var _0x50b667;return db[_0xfd31('0x33')][_0xfd31('0x58')]({'where':{'id':_0x1d9b6a['params']['id']}})['then'](handleEntityNotFound(_0x253c90,null))[_0xfd31('0x28')](function(_0x35dee8){if(_0x35dee8){_0x52e48b=_0x35dee8;_0x1282f3[_0xfd31('0x38')]=_[_0xfd31('0x39')](db['User'][_0xfd31('0x34')]);_0x1282f3[_0xfd31('0x3b')]=_[_0xfd31('0x39')](_0x1d9b6a['query']);_0x1282f3[_0xfd31('0x3a')]=_[_0xfd31('0x4d')](_0x1282f3[_0xfd31('0x38')],_0x1282f3[_0xfd31('0x3b')]);_0x5bc67f[_0xfd31('0x3c')]=_[_0xfd31('0x4d')](_0x1282f3['model'],qs['fields'](_0x1d9b6a[_0xfd31('0x3b')][_0xfd31('0x3d')]));_0x5bc67f['attributes']=_0x5bc67f[_0xfd31('0x3c')][_0xfd31('0x3e')]?_0x5bc67f[_0xfd31('0x3c')]:_0x1282f3[_0xfd31('0x38')];_0x5bc67f['order']=qs[_0xfd31('0x42')](_0x1d9b6a[_0xfd31('0x3b')][_0xfd31('0x42')]);_0x5bc67f[_0xfd31('0x43')]=qs[_0xfd31('0x3a')](_['pick'](_0x1d9b6a['query'],_0x1282f3[_0xfd31('0x3a')]));if(_0x1d9b6a['query'][_0xfd31('0x44')]){_0x5bc67f[_0xfd31('0x43')]=_[_0xfd31('0x45')](_0x5bc67f[_0xfd31('0x43')],{'$or':_[_0xfd31('0x32')](_0x5bc67f[_0xfd31('0x3c')],function(_0x52ee21){var _0x3813b4={};_0x3813b4[_0x52ee21]={'$like':'%'+_0x1d9b6a[_0xfd31('0x3b')][_0xfd31('0x44')]+'%'};return _0x3813b4;})});}_0x5bc67f=_[_0xfd31('0x45')]({},_0x5bc67f,_0x1d9b6a[_0xfd31('0x47')]);return _0x52e48b[_0xfd31('0x8b')](_0x5bc67f);}})[_0xfd31('0x28')](function(_0x594d8c){if(_0x594d8c){_0x50b667=_0x594d8c[_0xfd31('0x3e')];if(!_0x1d9b6a[_0xfd31('0x3b')][_0xfd31('0x3f')](_0xfd31('0x40'))){_0x5bc67f[_0xfd31('0x41')]=qs[_0xfd31('0x41')](_0x1d9b6a[_0xfd31('0x3b')]['limit']);_0x5bc67f['offset']=qs[_0xfd31('0x21')](_0x1d9b6a[_0xfd31('0x3b')][_0xfd31('0x21')]);}return _0x52e48b['getAgents'](_0x5bc67f);}})[_0xfd31('0x28')](function(_0x2bc377){if(_0x2bc377){return _0x2bc377?{'count':_0x50b667,'rows':_0x2bc377}:null;}})[_0xfd31('0x28')](respondWithResult(_0x253c90,null))[_0xfd31('0x4b')](handleError(_0x253c90,null));}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.events.js b/server/api/whatsappQueue/whatsappQueue.events.js index 5c22c73..af24dfd 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 _0x3af3=['setMaxListeners','save','remove','emit','hook','exports','events','../../mysqldb','WhatsappQueue'];(function(_0x43c4b2,_0x592841){var _0x1d4516=function(_0x230f00){while(--_0x230f00){_0x43c4b2['push'](_0x43c4b2['shift']());}};_0x1d4516(++_0x592841);}(_0x3af3,0x12f));var _0x33af=function(_0x38ae4f,_0x1d3180){_0x38ae4f=_0x38ae4f-0x0;var _0x1e92db=_0x3af3[_0x38ae4f];return _0x1e92db;};'use strict';var EventEmitter=require(_0x33af('0x0'));var WhatsappQueue=require(_0x33af('0x1'))['db'][_0x33af('0x2')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0x33af('0x3')](0x0);var events={'afterCreate':_0x33af('0x4'),'afterUpdate':'update','afterDestroy':_0x33af('0x5')};function emitEvent(_0x3b8402){return function(_0xfa0e31,_0xac3134,_0x4ba6d9){WhatsappQueueEvents[_0x33af('0x6')](_0x3b8402+':'+_0xfa0e31['id'],_0xfa0e31);WhatsappQueueEvents[_0x33af('0x6')](_0x3b8402,_0xfa0e31);_0x4ba6d9(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappQueue[_0x33af('0x7')](e,emitEvent(event));}}module[_0x33af('0x8')]=WhatsappQueueEvents; \ No newline at end of file +var _0xfd9a=['update','remove','emit','hasOwnProperty','hook','exports','events','WhatsappQueue','setMaxListeners'];(function(_0x3154c0,_0x160162){var _0x5e53eb=function(_0x3e8583){while(--_0x3e8583){_0x3154c0['push'](_0x3154c0['shift']());}};_0x5e53eb(++_0x160162);}(_0xfd9a,0x180));var _0xafd9=function(_0x466d65,_0x2fbaa1){_0x466d65=_0x466d65-0x0;var _0x25077b=_0xfd9a[_0x466d65];return _0x25077b;};'use strict';var EventEmitter=require(_0xafd9('0x0'));var WhatsappQueue=require('../../mysqldb')['db'][_0xafd9('0x1')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0xafd9('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xafd9('0x3'),'afterDestroy':_0xafd9('0x4')};function emitEvent(_0x3bde3c){return function(_0xf3f42f,_0x124b25,_0x163f21){WhatsappQueueEvents[_0xafd9('0x5')](_0x3bde3c+':'+_0xf3f42f['id'],_0xf3f42f);WhatsappQueueEvents[_0xafd9('0x5')](_0x3bde3c,_0xf3f42f);_0x163f21(null);};}for(var e in events){if(events[_0xafd9('0x6')](e)){var event=events[e];WhatsappQueue[_0xafd9('0x7')](e,emitEvent(event));}}module[_0xafd9('0x8')]=WhatsappQueueEvents; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.model.js b/server/api/whatsappQueue/whatsappQueue.model.js index b49a3ed..b8dc05b 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 _0x8f87=['./whatsappQueue.attributes','WhatsappQueue','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x923991,_0x481465){var _0x191cfc=function(_0x6412e1){while(--_0x6412e1){_0x923991['push'](_0x923991['shift']());}};_0x191cfc(++_0x481465);}(_0x8f87,0x136));var _0x78f8=function(_0x4c3ffe,_0x457374){_0x4c3ffe=_0x4c3ffe-0x0;var _0x28d3eb=_0x8f87[_0x4c3ffe];return _0x28d3eb;};'use strict';var _=require(_0x78f8('0x0'));var util=require(_0x78f8('0x1'));var logger=require(_0x78f8('0x2'))('api');var moment=require(_0x78f8('0x3'));var BPromise=require(_0x78f8('0x4'));var rp=require(_0x78f8('0x5'));var fs=require('fs');var path=require(_0x78f8('0x6'));var rimraf=require(_0x78f8('0x7'));var config=require(_0x78f8('0x8'));var attributes=require(_0x78f8('0x9'));module['exports']=function(_0x30ca99,_0x1730c3){return _0x30ca99['define'](_0x78f8('0xa'),attributes,{'tableName':'whatsapp_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x02dc=['rimraf','../../config/environment','./whatsappQueue.attributes','exports','define','WhatsappQueue','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x3d3c7b,_0x4c3a7b){var _0x3dd92f=function(_0x50e16e){while(--_0x50e16e){_0x3d3c7b['push'](_0x3d3c7b['shift']());}};_0x3dd92f(++_0x4c3a7b);}(_0x02dc,0x68));var _0xc02d=function(_0x71d691,_0x4f9dca){_0x71d691=_0x71d691-0x0;var _0x506429=_0x02dc[_0x71d691];return _0x506429;};'use strict';var _=require(_0xc02d('0x0'));var util=require(_0xc02d('0x1'));var logger=require(_0xc02d('0x2'))(_0xc02d('0x3'));var moment=require(_0xc02d('0x4'));var BPromise=require(_0xc02d('0x5'));var rp=require(_0xc02d('0x6'));var fs=require('fs');var path=require(_0xc02d('0x7'));var rimraf=require(_0xc02d('0x8'));var config=require(_0xc02d('0x9'));var attributes=require(_0xc02d('0xa'));module[_0xc02d('0xb')]=function(_0x542371,_0x1ab5ed){return _0x542371[_0xc02d('0xc')](_0xc02d('0xd'),attributes,{'tableName':'whatsapp_queues','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 ecc51e1..e3b24f8 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 _0x1083=['options','attributes','limit','include','map','model','info','stringify','ShowWhatsappQueue','find','raw','bluebird','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','redis','defaults','localhost','socket.io-emitter','./whatsappQueue.socket','request','then','WhatsappQueue,\x20%s,\x20%s','request\x20sent','debug','error','code','message','catch','GetWhatsappQueue','WhatsappQueue','findAll'];(function(_0x18619f,_0x58bc30){var _0x5d22fd=function(_0x378a63){while(--_0x378a63){_0x18619f['push'](_0x18619f['shift']());}};_0x5d22fd(++_0x58bc30);}(_0x1083,0xd7));var _0x3108=function(_0x13b70b,_0x9e4c3b){_0x13b70b=_0x13b70b-0x0;var _0x59dc4a=_0x1083[_0x13b70b];return _0x59dc4a;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x3108('0x0'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3108('0x1'))['db'];var utils=require('../../config/utils');var logger=require(_0x3108('0x2'))(_0x3108('0x3'));var config=require(_0x3108('0x4'));var jayson=require(_0x3108('0x5'));var client=jayson['client']['http']({'port':0x232a});config[_0x3108('0x6')]=_[_0x3108('0x7')](config[_0x3108('0x6')],{'host':_0x3108('0x8'),'port':0x18eb});var socket=require(_0x3108('0x9'))(new Redis(config[_0x3108('0x6')]));require(_0x3108('0xa'))['register'](socket);function respondWithRpcPromise(_0x531537,_0x5dc588,_0x3a37cd){return new BPromise(function(_0x2b2c76,_0x48cfba){return client[_0x3108('0xb')](_0x531537,_0x3a37cd)[_0x3108('0xc')](function(_0x33dba5){logger['info'](_0x3108('0xd'),_0x5dc588,_0x3108('0xe'));logger[_0x3108('0xf')]('WhatsappQueue,\x20%s,\x20%s,\x20%s',_0x5dc588,_0x3108('0xe'),JSON['stringify'](_0x33dba5));if(_0x33dba5[_0x3108('0x10')]){if(_0x33dba5[_0x3108('0x10')][_0x3108('0x11')]===0x1f4){logger['error'](_0x3108('0xd'),_0x5dc588,_0x33dba5['error'][_0x3108('0x12')]);return _0x48cfba(_0x33dba5[_0x3108('0x10')][_0x3108('0x12')]);}logger['error'](_0x3108('0xd'),_0x5dc588,_0x33dba5[_0x3108('0x10')][_0x3108('0x12')]);return _0x2b2c76(_0x33dba5['error'][_0x3108('0x12')]);}else{logger['info'](_0x3108('0xd'),_0x5dc588,_0x3108('0xe'));_0x2b2c76(_0x33dba5['result'][_0x3108('0x12')]);}})[_0x3108('0x13')](function(_0x537237){logger[_0x3108('0x10')](_0x3108('0xd'),_0x5dc588,_0x537237);_0x48cfba(_0x537237);});});}exports[_0x3108('0x14')]=function(_0x4acee8){var _0x183522=this;return new Promise(function(_0x562a0d,_0x48b548){return db[_0x3108('0x15')][_0x3108('0x16')]({'raw':_0x4acee8[_0x3108('0x17')]?_0x4acee8[_0x3108('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x4acee8['options']?_0x4acee8[_0x3108('0x17')]['where']||null:null,'attributes':_0x4acee8['options']?_0x4acee8[_0x3108('0x17')][_0x3108('0x18')]||null:null,'limit':_0x4acee8[_0x3108('0x17')]?_0x4acee8[_0x3108('0x17')][_0x3108('0x19')]||null:null,'include':_0x4acee8[_0x3108('0x17')]?_0x4acee8[_0x3108('0x17')][_0x3108('0x1a')]?_[_0x3108('0x1b')](_0x4acee8[_0x3108('0x17')][_0x3108('0x1a')],function(_0x5d9782){return{'model':db[_0x5d9782[_0x3108('0x1c')]],'as':_0x5d9782['as'],'attributes':_0x5d9782[_0x3108('0x18')],'include':_0x5d9782[_0x3108('0x1a')]?_[_0x3108('0x1b')](_0x5d9782['include'],function(_0x2ad465){return{'model':db[_0x2ad465[_0x3108('0x1c')]],'as':_0x2ad465['as'],'attributes':_0x2ad465[_0x3108('0x18')],'include':_0x2ad465[_0x3108('0x1a')]?_[_0x3108('0x1b')](_0x2ad465[_0x3108('0x1a')],function(_0x19fdfd){return{'model':db[_0x19fdfd[_0x3108('0x1c')]],'as':_0x19fdfd['as'],'attributes':_0x19fdfd[_0x3108('0x18')]};}):[]};}):[]};}):[]:[]})[_0x3108('0xc')](function(_0x2c01fc){logger[_0x3108('0x1d')](_0x3108('0x14'),_0x4acee8);logger[_0x3108('0xf')](_0x3108('0x14'),_0x4acee8,JSON[_0x3108('0x1e')](_0x2c01fc));_0x562a0d(_0x2c01fc);})[_0x3108('0x13')](function(_0x3de869){logger['error'](_0x3108('0x14'),_0x3de869['message'],_0x4acee8);_0x48b548(_0x183522[_0x3108('0x10')](0x1f4,_0x3de869[_0x3108('0x12')]));});});};exports[_0x3108('0x1f')]=function(_0x4a763c){var _0x3a6f9a=this;return new Promise(function(_0x3459c8,_0x50733e){return db[_0x3108('0x15')][_0x3108('0x20')]({'raw':_0x4a763c[_0x3108('0x17')]?_0x4a763c[_0x3108('0x17')][_0x3108('0x21')]===undefined?!![]:![]:!![],'where':_0x4a763c[_0x3108('0x17')]?_0x4a763c['options']['where']||null:null,'attributes':_0x4a763c[_0x3108('0x17')]?_0x4a763c['options'][_0x3108('0x18')]||null:null,'include':_0x4a763c['options']?_0x4a763c[_0x3108('0x17')][_0x3108('0x1a')]?_['map'](_0x4a763c[_0x3108('0x17')][_0x3108('0x1a')],function(_0xa45da5){return{'model':db[_0xa45da5[_0x3108('0x1c')]],'as':_0xa45da5['as'],'attributes':_0xa45da5['attributes'],'include':_0xa45da5['include']?_['map'](_0xa45da5[_0x3108('0x1a')],function(_0x207bb0){return{'model':db[_0x207bb0[_0x3108('0x1c')]],'as':_0x207bb0['as'],'attributes':_0x207bb0['attributes'],'include':_0x207bb0[_0x3108('0x1a')]?_['map'](_0x207bb0['include'],function(_0x3516b5){return{'model':db[_0x3516b5[_0x3108('0x1c')]],'as':_0x3516b5['as'],'attributes':_0x3516b5[_0x3108('0x18')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x111c12){logger[_0x3108('0x1d')](_0x3108('0x1f'),_0x4a763c);logger['debug'](_0x3108('0x1f'),_0x4a763c,JSON[_0x3108('0x1e')](_0x111c12));_0x3459c8(_0x111c12);})[_0x3108('0x13')](function(_0x1721e2){logger[_0x3108('0x10')](_0x3108('0x1f'),_0x1721e2[_0x3108('0x12')],_0x4a763c);_0x50733e(_0x3a6f9a[_0x3108('0x10')](0x1f4,_0x1721e2[_0x3108('0x12')]));});});}; \ No newline at end of file +var _0xc7e1=['options','where','attributes','limit','map','include','model','stringify','ShowWhatsappQueue','find','raw','lodash','util','bluebird','randomstring','../../mysqldb','rpc','../../config/environment','jayson/promise','client','defaults','redis','localhost','socket.io-emitter','./whatsappQueue.socket','register','request','then','info','request\x20sent','debug','WhatsappQueue,\x20%s,\x20%s,\x20%s','error','code','WhatsappQueue,\x20%s,\x20%s','message','catch','GetWhatsappQueue','WhatsappQueue','findAll'];(function(_0x233d30,_0x563080){var _0x3988b3=function(_0xbacbbb){while(--_0xbacbbb){_0x233d30['push'](_0x233d30['shift']());}};_0x3988b3(++_0x563080);}(_0xc7e1,0x1eb));var _0x1c7e=function(_0x44039a,_0x19b1f5){_0x44039a=_0x44039a-0x0;var _0x2c6c9b=_0xc7e1[_0x44039a];return _0x2c6c9b;};'use strict';var _=require(_0x1c7e('0x0'));var util=require(_0x1c7e('0x1'));var moment=require('moment');var BPromise=require(_0x1c7e('0x2'));var rs=require(_0x1c7e('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1c7e('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x1c7e('0x5'));var config=require(_0x1c7e('0x6'));var jayson=require(_0x1c7e('0x7'));var client=jayson[_0x1c7e('0x8')]['http']({'port':0x232a});config['redis']=_[_0x1c7e('0x9')](config[_0x1c7e('0xa')],{'host':_0x1c7e('0xb'),'port':0x18eb});var socket=require(_0x1c7e('0xc'))(new Redis(config[_0x1c7e('0xa')]));require(_0x1c7e('0xd'))[_0x1c7e('0xe')](socket);function respondWithRpcPromise(_0x5ab0c1,_0x2a6004,_0x3bf8b5){return new BPromise(function(_0x3cd590,_0x570765){return client[_0x1c7e('0xf')](_0x5ab0c1,_0x3bf8b5)[_0x1c7e('0x10')](function(_0xda84b9){logger[_0x1c7e('0x11')]('WhatsappQueue,\x20%s,\x20%s',_0x2a6004,_0x1c7e('0x12'));logger[_0x1c7e('0x13')](_0x1c7e('0x14'),_0x2a6004,_0x1c7e('0x12'),JSON['stringify'](_0xda84b9));if(_0xda84b9['error']){if(_0xda84b9[_0x1c7e('0x15')][_0x1c7e('0x16')]===0x1f4){logger[_0x1c7e('0x15')](_0x1c7e('0x17'),_0x2a6004,_0xda84b9[_0x1c7e('0x15')]['message']);return _0x570765(_0xda84b9['error'][_0x1c7e('0x18')]);}logger['error']('WhatsappQueue,\x20%s,\x20%s',_0x2a6004,_0xda84b9[_0x1c7e('0x15')][_0x1c7e('0x18')]);return _0x3cd590(_0xda84b9[_0x1c7e('0x15')][_0x1c7e('0x18')]);}else{logger['info']('WhatsappQueue,\x20%s,\x20%s',_0x2a6004,'request\x20sent');_0x3cd590(_0xda84b9['result'][_0x1c7e('0x18')]);}})[_0x1c7e('0x19')](function(_0x17a781){logger[_0x1c7e('0x15')]('WhatsappQueue,\x20%s,\x20%s',_0x2a6004,_0x17a781);_0x570765(_0x17a781);});});}exports[_0x1c7e('0x1a')]=function(_0x463725){var _0x40fe0f=this;return new Promise(function(_0x679b9e,_0x351112){return db[_0x1c7e('0x1b')][_0x1c7e('0x1c')]({'raw':_0x463725[_0x1c7e('0x1d')]?_0x463725[_0x1c7e('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x463725[_0x1c7e('0x1d')]?_0x463725['options'][_0x1c7e('0x1e')]||null:null,'attributes':_0x463725[_0x1c7e('0x1d')]?_0x463725['options'][_0x1c7e('0x1f')]||null:null,'limit':_0x463725[_0x1c7e('0x1d')]?_0x463725[_0x1c7e('0x1d')][_0x1c7e('0x20')]||null:null,'include':_0x463725[_0x1c7e('0x1d')]?_0x463725[_0x1c7e('0x1d')]['include']?_[_0x1c7e('0x21')](_0x463725[_0x1c7e('0x1d')][_0x1c7e('0x22')],function(_0x2f9f1f){return{'model':db[_0x2f9f1f[_0x1c7e('0x23')]],'as':_0x2f9f1f['as'],'attributes':_0x2f9f1f['attributes'],'include':_0x2f9f1f[_0x1c7e('0x22')]?_[_0x1c7e('0x21')](_0x2f9f1f[_0x1c7e('0x22')],function(_0x18662d){return{'model':db[_0x18662d[_0x1c7e('0x23')]],'as':_0x18662d['as'],'attributes':_0x18662d[_0x1c7e('0x1f')],'include':_0x18662d[_0x1c7e('0x22')]?_['map'](_0x18662d[_0x1c7e('0x22')],function(_0x3686cb){return{'model':db[_0x3686cb[_0x1c7e('0x23')]],'as':_0x3686cb['as'],'attributes':_0x3686cb[_0x1c7e('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x1c7e('0x10')](function(_0x27604b){logger[_0x1c7e('0x11')](_0x1c7e('0x1a'),_0x463725);logger[_0x1c7e('0x13')]('GetWhatsappQueue',_0x463725,JSON[_0x1c7e('0x24')](_0x27604b));_0x679b9e(_0x27604b);})[_0x1c7e('0x19')](function(_0x1aacdc){logger[_0x1c7e('0x15')](_0x1c7e('0x1a'),_0x1aacdc[_0x1c7e('0x18')],_0x463725);_0x351112(_0x40fe0f[_0x1c7e('0x15')](0x1f4,_0x1aacdc[_0x1c7e('0x18')]));});});};exports[_0x1c7e('0x25')]=function(_0x5bd2db){var _0x2af7f3=this;return new Promise(function(_0x1034f4,_0xb509e8){return db[_0x1c7e('0x1b')][_0x1c7e('0x26')]({'raw':_0x5bd2db[_0x1c7e('0x1d')]?_0x5bd2db[_0x1c7e('0x1d')][_0x1c7e('0x27')]===undefined?!![]:![]:!![],'where':_0x5bd2db[_0x1c7e('0x1d')]?_0x5bd2db[_0x1c7e('0x1d')][_0x1c7e('0x1e')]||null:null,'attributes':_0x5bd2db[_0x1c7e('0x1d')]?_0x5bd2db['options'][_0x1c7e('0x1f')]||null:null,'include':_0x5bd2db[_0x1c7e('0x1d')]?_0x5bd2db[_0x1c7e('0x1d')][_0x1c7e('0x22')]?_[_0x1c7e('0x21')](_0x5bd2db[_0x1c7e('0x1d')][_0x1c7e('0x22')],function(_0x5baa27){return{'model':db[_0x5baa27[_0x1c7e('0x23')]],'as':_0x5baa27['as'],'attributes':_0x5baa27[_0x1c7e('0x1f')],'include':_0x5baa27[_0x1c7e('0x22')]?_['map'](_0x5baa27[_0x1c7e('0x22')],function(_0x40ad05){return{'model':db[_0x40ad05[_0x1c7e('0x23')]],'as':_0x40ad05['as'],'attributes':_0x40ad05[_0x1c7e('0x1f')],'include':_0x40ad05['include']?_[_0x1c7e('0x21')](_0x40ad05[_0x1c7e('0x22')],function(_0x109dab){return{'model':db[_0x109dab['model']],'as':_0x109dab['as'],'attributes':_0x109dab[_0x1c7e('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x1c7e('0x10')](function(_0x371c3f){logger[_0x1c7e('0x11')](_0x1c7e('0x25'),_0x5bd2db);logger[_0x1c7e('0x13')](_0x1c7e('0x25'),_0x5bd2db,JSON[_0x1c7e('0x24')](_0x371c3f));_0x1034f4(_0x371c3f);})[_0x1c7e('0x19')](function(_0x33b353){logger[_0x1c7e('0x15')]('ShowWhatsappQueue',_0x33b353[_0x1c7e('0x18')],_0x5bd2db);_0xb509e8(_0x2af7f3[_0x1c7e('0x15')](0x1f4,_0x33b353[_0x1c7e('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.socket.js b/server/api/whatsappQueue/whatsappQueue.socket.js index 9501d05..2649855 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 _0x89bb=['remove','update','emit','removeListener','register','length','whatsappQueue:','./whatsappQueue.events','save'];(function(_0x41c697,_0x32db5b){var _0x4a7fa4=function(_0x4a3318){while(--_0x4a3318){_0x41c697['push'](_0x41c697['shift']());}};_0x4a7fa4(++_0x32db5b);}(_0x89bb,0x15d));var _0xb89b=function(_0x9edf63,_0x2658e6){_0x9edf63=_0x9edf63-0x0;var _0x4f1b68=_0x89bb[_0x9edf63];return _0x4f1b68;};'use strict';var WhatsappQueueEvents=require(_0xb89b('0x0'));var events=[_0xb89b('0x1'),_0xb89b('0x2'),_0xb89b('0x3')];function createListener(_0x3499d5,_0x5f3bd3){return function(_0x205e37){_0x5f3bd3[_0xb89b('0x4')](_0x3499d5,_0x205e37);};}function removeListener(_0x4b709d,_0x47ef1f){return function(){WhatsappQueueEvents[_0xb89b('0x5')](_0x4b709d,_0x47ef1f);};}exports[_0xb89b('0x6')]=function(_0x2f2f58){for(var _0x53485d=0x0,_0x576a2d=events[_0xb89b('0x7')];_0x53485d<_0x576a2d;_0x53485d++){var _0x5bb467=events[_0x53485d];var _0x217845=createListener(_0xb89b('0x8')+_0x5bb467,_0x2f2f58);WhatsappQueueEvents['on'](_0x5bb467,_0x217845);}}; \ No newline at end of file +var _0x9361=['emit','register','length','whatsappQueue:','save','update'];(function(_0x159152,_0x174251){var _0x50a4aa=function(_0x1a46f7){while(--_0x1a46f7){_0x159152['push'](_0x159152['shift']());}};_0x50a4aa(++_0x174251);}(_0x9361,0xee));var _0x1936=function(_0x52b9b6,_0x2e1340){_0x52b9b6=_0x52b9b6-0x0;var _0x122353=_0x9361[_0x52b9b6];return _0x122353;};'use strict';var WhatsappQueueEvents=require('./whatsappQueue.events');var events=[_0x1936('0x0'),'remove',_0x1936('0x1')];function createListener(_0x30480f,_0x1fbe7a){return function(_0xfe531c){_0x1fbe7a[_0x1936('0x2')](_0x30480f,_0xfe531c);};}function removeListener(_0x3ce70e,_0x289236){return function(){WhatsappQueueEvents['removeListener'](_0x3ce70e,_0x289236);};}exports[_0x1936('0x3')]=function(_0x280e70){for(var _0x1c8f79=0x0,_0x1deb50=events[_0x1936('0x4')];_0x1c8f79<_0x1deb50;_0x1c8f79++){var _0x5cde09=events[_0x1c8f79];var _0x2dfb91=createListener(_0x1936('0x5')+_0x5cde09,_0x280e70);WhatsappQueueEvents['on'](_0x5cde09,_0x2dfb91);}}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/index.js b/server/api/whatsappQueueReport/index.js index c07af08..520bc42 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 _0x006d=['exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./whatsappQueueReport.controller','get','isAuthenticated','/describe','describe','/:id','show','post','create','put','update','delete','destroy'];(function(_0x4a784a,_0x16c156){var _0x337ef0=function(_0x440182){while(--_0x440182){_0x4a784a['push'](_0x4a784a['shift']());}};_0x337ef0(++_0x16c156);}(_0x006d,0xfd));var _0xd006=function(_0x2433eb,_0x1891d9){_0x2433eb=_0x2433eb-0x0;var _0x1429c1=_0x006d[_0x2433eb];return _0x1429c1;};'use strict';var multer=require(_0xd006('0x0'));var util=require(_0xd006('0x1'));var path=require('path');var timeout=require(_0xd006('0x2'));var express=require(_0xd006('0x3'));var router=express[_0xd006('0x4')]();var fs_extra=require(_0xd006('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xd006('0x6'));var config=require('../../config/environment');var controller=require(_0xd006('0x7'));router[_0xd006('0x8')]('/',auth[_0xd006('0x9')](),controller['index']);router['get'](_0xd006('0xa'),auth['isAuthenticated'](),controller[_0xd006('0xb')]);router[_0xd006('0x8')](_0xd006('0xc'),auth[_0xd006('0x9')](),controller[_0xd006('0xd')]);router[_0xd006('0xe')]('/',auth[_0xd006('0x9')](),controller[_0xd006('0xf')]);router[_0xd006('0x10')](_0xd006('0xc'),auth[_0xd006('0x9')](),controller[_0xd006('0x11')]);router[_0xd006('0x12')](_0xd006('0xc'),auth[_0xd006('0x9')](),controller[_0xd006('0x13')]);module[_0xd006('0x14')]=router; \ No newline at end of file +var _0x34d1=['/describe','describe','/:id','show','post','put','update','delete','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappQueueReport.controller','get','isAuthenticated','index'];(function(_0x4f7ae0,_0x416d26){var _0x57f529=function(_0x43640d){while(--_0x43640d){_0x4f7ae0['push'](_0x4f7ae0['shift']());}};_0x57f529(++_0x416d26);}(_0x34d1,0x180));var _0x134d=function(_0x47f952,_0x5025d9){_0x47f952=_0x47f952-0x0;var _0x55b074=_0x34d1[_0x47f952];return _0x55b074;};'use strict';var multer=require(_0x134d('0x0'));var util=require('util');var path=require(_0x134d('0x1'));var timeout=require(_0x134d('0x2'));var express=require(_0x134d('0x3'));var router=express['Router']();var fs_extra=require(_0x134d('0x4'));var auth=require(_0x134d('0x5'));var interaction=require(_0x134d('0x6'));var config=require(_0x134d('0x7'));var controller=require(_0x134d('0x8'));router[_0x134d('0x9')]('/',auth[_0x134d('0xa')](),controller[_0x134d('0xb')]);router[_0x134d('0x9')](_0x134d('0xc'),auth[_0x134d('0xa')](),controller[_0x134d('0xd')]);router['get'](_0x134d('0xe'),auth[_0x134d('0xa')](),controller[_0x134d('0xf')]);router[_0x134d('0x10')]('/',auth[_0x134d('0xa')](),controller['create']);router[_0x134d('0x11')](_0x134d('0xe'),auth[_0x134d('0xa')](),controller[_0x134d('0x12')]);router[_0x134d('0x13')](_0x134d('0xe'),auth['isAuthenticated'](),controller[_0x134d('0x14')]);module[_0x134d('0x15')]=router; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js b/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js index 5fbf52d..35efdb9 100644 --- a/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js +++ b/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['exports','STRING','DATE','sequelize'];(function(_0x5015be,_0x5d2d79){var _0x140d14=function(_0x43160c){while(--_0x43160c){_0x5015be['push'](_0x5015be['shift']());}};_0x140d14(++_0x5d2d79);}(_0x9957,0x93));var _0x7995=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x9957[_0x1facfa];return _0x9ec701;};'use strict';var Sequelize=require(_0x7995('0x0'));module[_0x7995('0x1')]={'uniqueid':{'type':Sequelize[_0x7995('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x7995('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x7995('0x3')]},'acceptAt':{'type':Sequelize[_0x7995('0x3')]},'exitAt':{'type':Sequelize[_0x7995('0x3')]},'reason':{'type':Sequelize[_0x7995('0x2')]}}; \ No newline at end of file +var _0x9957=['exports','STRING','DATE','sequelize'];(function(_0x3174e4,_0x2d29fc){var _0x12a291=function(_0x323341){while(--_0x323341){_0x3174e4['push'](_0x3174e4['shift']());}};_0x12a291(++_0x2d29fc);}(_0x9957,0x93));var _0x7995=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x9957[_0x501510];return _0x1e6ee5;};'use strict';var Sequelize=require(_0x7995('0x0'));module[_0x7995('0x1')]={'uniqueid':{'type':Sequelize[_0x7995('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x7995('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x7995('0x3')]},'acceptAt':{'type':Sequelize[_0x7995('0x3')]},'exitAt':{'type':Sequelize[_0x7995('0x3')]},'reason':{'type':Sequelize[_0x7995('0x2')]}}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.controller.js b/server/api/whatsappQueueReport/whatsappQueueReport.controller.js index 3b4b8e1..4cb5caf 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 _0x1775=['ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','apply','reject','save','then','destroy','error','name','send','index','map','WhatsappQueueReport','rawAttributes','fieldName','key','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','show','find','catch','create','update','params','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv'];(function(_0x431db6,_0x39e17b){var _0x34674e=function(_0x5d146f){while(--_0x5d146f){_0x431db6['push'](_0x431db6['shift']());}};_0x34674e(++_0x39e17b);}(_0x1775,0x1db));var _0x5177=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x1775[_0x432682];return _0x463d05;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5177('0x0'));var zipdir=require(_0x5177('0x1'));var jsonpatch=require(_0x5177('0x2'));var rp=require(_0x5177('0x3'));var moment=require(_0x5177('0x4'));var BPromise=require(_0x5177('0x5'));var Mustache=require(_0x5177('0x6'));var util=require(_0x5177('0x7'));var path=require(_0x5177('0x8'));var sox=require(_0x5177('0x9'));var csv=require(_0x5177('0xa'));var ejs=require(_0x5177('0xb'));var fs=require('fs');var fs_extra=require(_0x5177('0xc'));var _=require(_0x5177('0xd'));var squel=require(_0x5177('0xe'));var crypto=require(_0x5177('0xf'));var jsforce=require(_0x5177('0x10'));var deskjs=require(_0x5177('0x11'));var toCsv=require(_0x5177('0xa'));var querystring=require(_0x5177('0x12'));var Papa=require(_0x5177('0x13'));var Redis=require(_0x5177('0x14'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x5177('0x15'));var hardwareService=require(_0x5177('0x16'));var logger=require(_0x5177('0x17'))(_0x5177('0x18'));var utils=require(_0x5177('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0x5177('0x1a'));var db=require(_0x5177('0x1b'))['db'];function respondWithStatusCode(_0xc613b9,_0x3c4ced){_0x3c4ced=_0x3c4ced||0xcc;return function(_0x111e99){if(_0x111e99){return _0xc613b9[_0x5177('0x1c')](_0x3c4ced);}return _0xc613b9[_0x5177('0x1d')](_0x3c4ced)[_0x5177('0x1e')]();};}function respondWithResult(_0x3e6224,_0x1eb9dd){_0x1eb9dd=_0x1eb9dd||0xc8;return function(_0x41bef4){if(_0x41bef4){return _0x3e6224[_0x5177('0x1d')](_0x1eb9dd)[_0x5177('0x1f')](_0x41bef4);}};}function respondWithFilteredResult(_0x31aff8,_0x1b32e6){return function(_0x175ca6){if(_0x175ca6){var _0x2ab5e5=typeof _0x1b32e6[_0x5177('0x20')]===_0x5177('0x21')&&typeof _0x1b32e6['limit']===_0x5177('0x21');var _0x41e687=_0x175ca6[_0x5177('0x22')];var _0x1b4102=_0x2ab5e5?0x0:_0x1b32e6['offset'];var _0x3e6944=_0x2ab5e5?_0x175ca6[_0x5177('0x22')]:_0x1b32e6[_0x5177('0x20')]+_0x1b32e6['limit'];var _0x86f5f8;if(_0x3e6944>=_0x41e687){_0x3e6944=_0x41e687;_0x86f5f8=0xc8;}else{_0x86f5f8=0xce;}_0x31aff8['status'](_0x86f5f8);return _0x31aff8[_0x5177('0x23')](_0x5177('0x24'),_0x1b4102+'-'+_0x3e6944+'/'+_0x41e687)[_0x5177('0x1f')](_0x175ca6);}return null;};}function patchUpdates(_0x27b732){return function(_0x451e5c){try{jsonpatch[_0x5177('0x25')](_0x451e5c,_0x27b732,!![]);}catch(_0x174c4f){return BPromise[_0x5177('0x26')](_0x174c4f);}return _0x451e5c[_0x5177('0x27')]();};}function saveUpdates(_0x2a95cc,_0x23dad2){return function(_0x3b0c37){if(_0x3b0c37){return _0x3b0c37['update'](_0x2a95cc)[_0x5177('0x28')](function(_0x556f96){return _0x556f96;});}return null;};}function removeEntity(_0x30b60f,_0x2c68d8){return function(_0x3b39b5){if(_0x3b39b5){return _0x3b39b5[_0x5177('0x29')]()['then'](function(){_0x30b60f[_0x5177('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x564139,_0x19a0c2){return function(_0x15cb93){if(!_0x15cb93){_0x564139['sendStatus'](0x194);}return _0x15cb93;};}function handleError(_0x3285b3,_0x4eba3a){_0x4eba3a=_0x4eba3a||0x1f4;return function(_0x231d35){logger[_0x5177('0x2a')](_0x231d35['stack']);if(_0x231d35[_0x5177('0x2b')]){delete _0x231d35[_0x5177('0x2b')];}_0x3285b3[_0x5177('0x1d')](_0x4eba3a)[_0x5177('0x2c')](_0x231d35);};}exports[_0x5177('0x2d')]=function(_0x1cef5d,_0x5577bb){var _0x498fcd={},_0x45cf20={},_0x1c660e={'count':0x0,'rows':[]};var _0x7dae59=_[_0x5177('0x2e')](db[_0x5177('0x2f')][_0x5177('0x30')],function(_0x31eb9f){return{'name':_0x31eb9f[_0x5177('0x31')],'type':_0x31eb9f['type'][_0x5177('0x32')]};});_0x45cf20[_0x5177('0x33')]=_['map'](_0x7dae59,_0x5177('0x2b'));_0x45cf20['query']=_[_0x5177('0x34')](_0x1cef5d[_0x5177('0x35')]);_0x45cf20[_0x5177('0x36')]=_['intersection'](_0x45cf20['model'],_0x45cf20[_0x5177('0x35')]);_0x498fcd[_0x5177('0x37')]=_[_0x5177('0x38')](_0x45cf20[_0x5177('0x33')],qs[_0x5177('0x39')](_0x1cef5d[_0x5177('0x35')][_0x5177('0x39')]));_0x498fcd[_0x5177('0x37')]=_0x498fcd['attributes'][_0x5177('0x3a')]?_0x498fcd[_0x5177('0x37')]:_0x45cf20['model'];if(!_0x1cef5d[_0x5177('0x35')][_0x5177('0x3b')](_0x5177('0x3c'))){_0x498fcd[_0x5177('0x3d')]=qs[_0x5177('0x3d')](_0x1cef5d[_0x5177('0x35')]['limit']);_0x498fcd[_0x5177('0x20')]=qs[_0x5177('0x20')](_0x1cef5d[_0x5177('0x35')][_0x5177('0x20')]);}_0x498fcd[_0x5177('0x3e')]=qs[_0x5177('0x3f')](_0x1cef5d[_0x5177('0x35')]['sort']);_0x498fcd[_0x5177('0x40')]=qs[_0x5177('0x36')](_['pick'](_0x1cef5d['query'],_0x45cf20[_0x5177('0x36')]),_0x7dae59);if(_0x1cef5d[_0x5177('0x35')][_0x5177('0x41')]){_0x498fcd[_0x5177('0x40')]=_[_0x5177('0x42')](_0x498fcd[_0x5177('0x40')],{'$or':_[_0x5177('0x2e')](_0x7dae59,function(_0x24fd92){if(_0x24fd92[_0x5177('0x43')]!==_0x5177('0x44')){var _0x16fabc={};_0x16fabc[_0x24fd92[_0x5177('0x2b')]]={'$like':'%'+_0x1cef5d[_0x5177('0x35')]['filter']+'%'};return _0x16fabc;}})});}_0x498fcd=_[_0x5177('0x42')]({},_0x498fcd,_0x1cef5d[_0x5177('0x45')]);var _0x4e3677={'where':_0x498fcd[_0x5177('0x40')]};return db['WhatsappQueueReport'][_0x5177('0x22')](_0x4e3677)[_0x5177('0x28')](function(_0x3f02f1){_0x1c660e['count']=_0x3f02f1;if(_0x1cef5d['query'][_0x5177('0x46')]){_0x498fcd[_0x5177('0x47')]=[{'all':!![]}];}return db[_0x5177('0x2f')][_0x5177('0x48')](_0x498fcd);})[_0x5177('0x28')](function(_0x3e710d){_0x1c660e[_0x5177('0x49')]=_0x3e710d;return _0x1c660e;})[_0x5177('0x28')](respondWithFilteredResult(_0x5577bb,_0x498fcd))['catch'](handleError(_0x5577bb,null));};exports[_0x5177('0x4a')]=function(_0x51ecc0,_0x5e3d30){var _0x30e4f3={'raw':!![],'where':{'id':_0x51ecc0['params']['id']}},_0x17dc98={};_0x17dc98[_0x5177('0x33')]=_['keys'](db['WhatsappQueueReport'][_0x5177('0x30')]);_0x17dc98[_0x5177('0x35')]=_[_0x5177('0x34')](_0x51ecc0[_0x5177('0x35')]);_0x17dc98[_0x5177('0x36')]=_[_0x5177('0x38')](_0x17dc98[_0x5177('0x33')],_0x17dc98['query']);_0x30e4f3['attributes']=_[_0x5177('0x38')](_0x17dc98['model'],qs[_0x5177('0x39')](_0x51ecc0[_0x5177('0x35')][_0x5177('0x39')]));_0x30e4f3[_0x5177('0x37')]=_0x30e4f3['attributes'][_0x5177('0x3a')]?_0x30e4f3[_0x5177('0x37')]:_0x17dc98[_0x5177('0x33')];if(_0x51ecc0[_0x5177('0x35')][_0x5177('0x46')]){_0x30e4f3[_0x5177('0x47')]=[{'all':!![]}];}_0x30e4f3=_[_0x5177('0x42')]({},_0x30e4f3,_0x51ecc0[_0x5177('0x45')]);return db[_0x5177('0x2f')][_0x5177('0x4b')](_0x30e4f3)[_0x5177('0x28')](handleEntityNotFound(_0x5e3d30,null))['then'](respondWithResult(_0x5e3d30,null))[_0x5177('0x4c')](handleError(_0x5e3d30,null));};exports['create']=function(_0x58a4e6,_0x5bda8a){return db[_0x5177('0x2f')][_0x5177('0x4d')](_0x58a4e6['body'],{})[_0x5177('0x28')](respondWithResult(_0x5bda8a,0xc9))[_0x5177('0x4c')](handleError(_0x5bda8a,null));};exports[_0x5177('0x4e')]=function(_0x4891fe,_0x1d4ae4){if(_0x4891fe['body']['id']){delete _0x4891fe['body']['id'];}return db['WhatsappQueueReport'][_0x5177('0x4b')]({'where':{'id':_0x4891fe[_0x5177('0x4f')]['id']}})[_0x5177('0x28')](handleEntityNotFound(_0x1d4ae4,null))['then'](saveUpdates(_0x4891fe['body'],null))[_0x5177('0x28')](respondWithResult(_0x1d4ae4,null))['catch'](handleError(_0x1d4ae4,null));};exports[_0x5177('0x29')]=function(_0x9dd7a2,_0x430e8e){return db[_0x5177('0x2f')][_0x5177('0x4b')]({'where':{'id':_0x9dd7a2[_0x5177('0x4f')]['id']}})[_0x5177('0x28')](handleEntityNotFound(_0x430e8e,null))[_0x5177('0x28')](removeEntity(_0x430e8e,null))[_0x5177('0x4c')](handleError(_0x430e8e,null));};exports[_0x5177('0x50')]=function(_0x89fe3a,_0xb08267){return db[_0x5177('0x2f')]['describe']()['then'](respondWithResult(_0xb08267,null))[_0x5177('0x4c')](handleError(_0xb08267,null));}; \ No newline at end of file +var _0x4e81=['limit','count','Content-Range','apply','reject','save','then','end','error','stack','name','send','index','WhatsappQueueReport','rawAttributes','fieldName','key','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','type','VIRTUAL','merge','options','includeAll','include','findAll','rows','params','keys','find','catch','create','body','update','destroy','describe','eml-format','rimraf','zip-dir','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','offset','undefined'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x4e81,0x1bc));var _0x14e8=function(_0x413feb,_0x10477f){_0x413feb=_0x413feb-0x0;var _0x40ee88=_0x4e81[_0x413feb];return _0x40ee88;};'use strict';var emlformat=require(_0x14e8('0x0'));var rimraf=require(_0x14e8('0x1'));var zipdir=require(_0x14e8('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x14e8('0x3'));var Mustache=require(_0x14e8('0x4'));var util=require(_0x14e8('0x5'));var path=require(_0x14e8('0x6'));var sox=require(_0x14e8('0x7'));var csv=require(_0x14e8('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x14e8('0x9'));var squel=require(_0x14e8('0xa'));var crypto=require(_0x14e8('0xb'));var jsforce=require(_0x14e8('0xc'));var deskjs=require(_0x14e8('0xd'));var toCsv=require(_0x14e8('0x8'));var querystring=require(_0x14e8('0xe'));var Papa=require(_0x14e8('0xf'));var Redis=require(_0x14e8('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x14e8('0x11'));var as=require(_0x14e8('0x12'));var hardwareService=require(_0x14e8('0x13'));var logger=require(_0x14e8('0x14'))(_0x14e8('0x15'));var utils=require(_0x14e8('0x16'));var config=require(_0x14e8('0x17'));var licenseUtil=require(_0x14e8('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x37eccb,_0x59c6c9){_0x59c6c9=_0x59c6c9||0xcc;return function(_0x2607ef){if(_0x2607ef){return _0x37eccb[_0x14e8('0x19')](_0x59c6c9);}return _0x37eccb[_0x14e8('0x1a')](_0x59c6c9)['end']();};}function respondWithResult(_0x22fa86,_0x4e1064){_0x4e1064=_0x4e1064||0xc8;return function(_0x458e4a){if(_0x458e4a){return _0x22fa86['status'](_0x4e1064)[_0x14e8('0x1b')](_0x458e4a);}};}function respondWithFilteredResult(_0x3761a1,_0xc6101f){return function(_0x135996){if(_0x135996){var _0x52e64f=typeof _0xc6101f[_0x14e8('0x1c')]===_0x14e8('0x1d')&&typeof _0xc6101f[_0x14e8('0x1e')]===_0x14e8('0x1d');var _0xd4d6b2=_0x135996[_0x14e8('0x1f')];var _0x10dc8b=_0x52e64f?0x0:_0xc6101f[_0x14e8('0x1c')];var _0x5a38c1=_0x52e64f?_0x135996[_0x14e8('0x1f')]:_0xc6101f[_0x14e8('0x1c')]+_0xc6101f[_0x14e8('0x1e')];var _0x7b10f2;if(_0x5a38c1>=_0xd4d6b2){_0x5a38c1=_0xd4d6b2;_0x7b10f2=0xc8;}else{_0x7b10f2=0xce;}_0x3761a1[_0x14e8('0x1a')](_0x7b10f2);return _0x3761a1['set'](_0x14e8('0x20'),_0x10dc8b+'-'+_0x5a38c1+'/'+_0xd4d6b2)[_0x14e8('0x1b')](_0x135996);}return null;};}function patchUpdates(_0x2abfec){return function(_0x48e30a){try{jsonpatch[_0x14e8('0x21')](_0x48e30a,_0x2abfec,!![]);}catch(_0x47f060){return BPromise[_0x14e8('0x22')](_0x47f060);}return _0x48e30a[_0x14e8('0x23')]();};}function saveUpdates(_0x3e8d5c,_0x117b00){return function(_0xcf673){if(_0xcf673){return _0xcf673['update'](_0x3e8d5c)[_0x14e8('0x24')](function(_0x5b11f9){return _0x5b11f9;});}return null;};}function removeEntity(_0x31bdd3,_0x185a0e){return function(_0x4ffc8b){if(_0x4ffc8b){return _0x4ffc8b['destroy']()['then'](function(){_0x31bdd3[_0x14e8('0x1a')](0xcc)[_0x14e8('0x25')]();});}};}function handleEntityNotFound(_0x3eae0b,_0x20bfe8){return function(_0x333d44){if(!_0x333d44){_0x3eae0b['sendStatus'](0x194);}return _0x333d44;};}function handleError(_0x23a9dc,_0x3fd96d){_0x3fd96d=_0x3fd96d||0x1f4;return function(_0x3c09cb){logger[_0x14e8('0x26')](_0x3c09cb[_0x14e8('0x27')]);if(_0x3c09cb[_0x14e8('0x28')]){delete _0x3c09cb[_0x14e8('0x28')];}_0x23a9dc['status'](_0x3fd96d)[_0x14e8('0x29')](_0x3c09cb);};}exports[_0x14e8('0x2a')]=function(_0x393ab0,_0x5f5abb){var _0x48eed0={},_0x5cacd7={},_0x8fe0e2={'count':0x0,'rows':[]};var _0x2a408d=_['map'](db[_0x14e8('0x2b')][_0x14e8('0x2c')],function(_0x176e8f){return{'name':_0x176e8f[_0x14e8('0x2d')],'type':_0x176e8f['type'][_0x14e8('0x2e')]};});_0x5cacd7[_0x14e8('0x2f')]=_[_0x14e8('0x30')](_0x2a408d,_0x14e8('0x28'));_0x5cacd7[_0x14e8('0x31')]=_['keys'](_0x393ab0[_0x14e8('0x31')]);_0x5cacd7[_0x14e8('0x32')]=_[_0x14e8('0x33')](_0x5cacd7[_0x14e8('0x2f')],_0x5cacd7['query']);_0x48eed0[_0x14e8('0x34')]=_['intersection'](_0x5cacd7[_0x14e8('0x2f')],qs[_0x14e8('0x35')](_0x393ab0[_0x14e8('0x31')][_0x14e8('0x35')]));_0x48eed0[_0x14e8('0x34')]=_0x48eed0[_0x14e8('0x34')][_0x14e8('0x36')]?_0x48eed0[_0x14e8('0x34')]:_0x5cacd7[_0x14e8('0x2f')];if(!_0x393ab0[_0x14e8('0x31')][_0x14e8('0x37')](_0x14e8('0x38'))){_0x48eed0['limit']=qs['limit'](_0x393ab0['query'][_0x14e8('0x1e')]);_0x48eed0['offset']=qs[_0x14e8('0x1c')](_0x393ab0['query'][_0x14e8('0x1c')]);}_0x48eed0[_0x14e8('0x39')]=qs[_0x14e8('0x3a')](_0x393ab0[_0x14e8('0x31')]['sort']);_0x48eed0[_0x14e8('0x3b')]=qs['filters'](_[_0x14e8('0x3c')](_0x393ab0[_0x14e8('0x31')],_0x5cacd7[_0x14e8('0x32')]),_0x2a408d);if(_0x393ab0[_0x14e8('0x31')][_0x14e8('0x3d')]){_0x48eed0[_0x14e8('0x3b')]=_['merge'](_0x48eed0[_0x14e8('0x3b')],{'$or':_['map'](_0x2a408d,function(_0x30baf1){if(_0x30baf1[_0x14e8('0x3e')]!==_0x14e8('0x3f')){var _0x4cafe6={};_0x4cafe6[_0x30baf1[_0x14e8('0x28')]]={'$like':'%'+_0x393ab0[_0x14e8('0x31')]['filter']+'%'};return _0x4cafe6;}})});}_0x48eed0=_[_0x14e8('0x40')]({},_0x48eed0,_0x393ab0[_0x14e8('0x41')]);var _0x1f429a={'where':_0x48eed0[_0x14e8('0x3b')]};return db[_0x14e8('0x2b')][_0x14e8('0x1f')](_0x1f429a)[_0x14e8('0x24')](function(_0x38ec58){_0x8fe0e2[_0x14e8('0x1f')]=_0x38ec58;if(_0x393ab0[_0x14e8('0x31')][_0x14e8('0x42')]){_0x48eed0[_0x14e8('0x43')]=[{'all':!![]}];}return db[_0x14e8('0x2b')][_0x14e8('0x44')](_0x48eed0);})[_0x14e8('0x24')](function(_0x596ac7){_0x8fe0e2[_0x14e8('0x45')]=_0x596ac7;return _0x8fe0e2;})['then'](respondWithFilteredResult(_0x5f5abb,_0x48eed0))['catch'](handleError(_0x5f5abb,null));};exports['show']=function(_0x3d2d95,_0x5ed821){var _0x46a3c4={'raw':!![],'where':{'id':_0x3d2d95[_0x14e8('0x46')]['id']}},_0x45bff0={};_0x45bff0[_0x14e8('0x2f')]=_[_0x14e8('0x47')](db[_0x14e8('0x2b')][_0x14e8('0x2c')]);_0x45bff0[_0x14e8('0x31')]=_[_0x14e8('0x47')](_0x3d2d95[_0x14e8('0x31')]);_0x45bff0[_0x14e8('0x32')]=_['intersection'](_0x45bff0[_0x14e8('0x2f')],_0x45bff0[_0x14e8('0x31')]);_0x46a3c4[_0x14e8('0x34')]=_[_0x14e8('0x33')](_0x45bff0['model'],qs[_0x14e8('0x35')](_0x3d2d95[_0x14e8('0x31')]['fields']));_0x46a3c4['attributes']=_0x46a3c4[_0x14e8('0x34')]['length']?_0x46a3c4['attributes']:_0x45bff0[_0x14e8('0x2f')];if(_0x3d2d95[_0x14e8('0x31')]['includeAll']){_0x46a3c4[_0x14e8('0x43')]=[{'all':!![]}];}_0x46a3c4=_[_0x14e8('0x40')]({},_0x46a3c4,_0x3d2d95['options']);return db[_0x14e8('0x2b')][_0x14e8('0x48')](_0x46a3c4)[_0x14e8('0x24')](handleEntityNotFound(_0x5ed821,null))[_0x14e8('0x24')](respondWithResult(_0x5ed821,null))[_0x14e8('0x49')](handleError(_0x5ed821,null));};exports[_0x14e8('0x4a')]=function(_0x343529,_0x2541ad){return db[_0x14e8('0x2b')][_0x14e8('0x4a')](_0x343529[_0x14e8('0x4b')],{})[_0x14e8('0x24')](respondWithResult(_0x2541ad,0xc9))[_0x14e8('0x49')](handleError(_0x2541ad,null));};exports[_0x14e8('0x4c')]=function(_0x1bf742,_0x1f50bc){if(_0x1bf742['body']['id']){delete _0x1bf742[_0x14e8('0x4b')]['id'];}return db['WhatsappQueueReport'][_0x14e8('0x48')]({'where':{'id':_0x1bf742[_0x14e8('0x46')]['id']}})[_0x14e8('0x24')](handleEntityNotFound(_0x1f50bc,null))[_0x14e8('0x24')](saveUpdates(_0x1bf742['body'],null))['then'](respondWithResult(_0x1f50bc,null))['catch'](handleError(_0x1f50bc,null));};exports[_0x14e8('0x4d')]=function(_0x49657e,_0x55f9b0){return db[_0x14e8('0x2b')][_0x14e8('0x48')]({'where':{'id':_0x49657e['params']['id']}})[_0x14e8('0x24')](handleEntityNotFound(_0x55f9b0,null))[_0x14e8('0x24')](removeEntity(_0x55f9b0,null))[_0x14e8('0x49')](handleError(_0x55f9b0,null));};exports[_0x14e8('0x4e')]=function(_0x4cc86a,_0x519c9c){return db[_0x14e8('0x2b')][_0x14e8('0x4e')]()[_0x14e8('0x24')](respondWithResult(_0x519c9c,null))[_0x14e8('0x49')](handleError(_0x519c9c,null));}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.model.js b/server/api/whatsappQueueReport/whatsappQueueReport.model.js index ee9204d..dc5cc41 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 _0x5928=['util','../../config/logger','api','moment','bluebird','request-promise','rimraf','./whatsappQueueReport.attributes','define','report_whatsapp_queue','uniqueid'];(function(_0x2605dc,_0x50cf7e){var _0x4568c9=function(_0x447f7c){while(--_0x447f7c){_0x2605dc['push'](_0x2605dc['shift']());}};_0x4568c9(++_0x50cf7e);}(_0x5928,0x160));var _0x8592=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5928[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x8592('0x0'));var logger=require(_0x8592('0x1'))(_0x8592('0x2'));var moment=require(_0x8592('0x3'));var BPromise=require(_0x8592('0x4'));var rp=require(_0x8592('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8592('0x6'));var config=require('../../config/environment');var attributes=require(_0x8592('0x7'));module['exports']=function(_0x246161,_0xc2b54){return _0x246161[_0x8592('0x8')]('WhatsappQueueReport',attributes,{'tableName':_0x8592('0x9'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x8592('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xeada=['report_whatsapp_queue','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./whatsappQueueReport.attributes','exports','WhatsappQueueReport'];(function(_0x5af197,_0x3ee4b5){var _0x416718=function(_0xb51c3){while(--_0xb51c3){_0x5af197['push'](_0x5af197['shift']());}};_0x416718(++_0x3ee4b5);}(_0xeada,0x72));var _0xaead=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xeada[_0x2641f9];return _0x585741;};'use strict';var _=require(_0xaead('0x0'));var util=require(_0xaead('0x1'));var logger=require(_0xaead('0x2'))(_0xaead('0x3'));var moment=require('moment');var BPromise=require(_0xaead('0x4'));var rp=require(_0xaead('0x5'));var fs=require('fs');var path=require(_0xaead('0x6'));var rimraf=require(_0xaead('0x7'));var config=require(_0xaead('0x8'));var attributes=require(_0xaead('0x9'));module[_0xaead('0xa')]=function(_0x531811,_0x30ce92){return _0x531811['define'](_0xaead('0xb'),attributes,{'tableName':_0xaead('0xc'),'paranoid':![],'indexes':[{'name':_0xaead('0xd'),'fields':[_0xaead('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.rpc.js b/server/api/whatsappQueueReport/whatsappQueueReport.rpc.js index 77e60e4..d111119 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 _0x142c=['options','raw','info','catch','UpdateWhatsappQueueReport','update','attributes','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','request','then','WhatsappQueueReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','CreateWhatsappQueueReport','WhatsappQueueReport','create'];(function(_0x5c5ad3,_0x1f96b9){var _0x5d130f=function(_0x57e21c){while(--_0x57e21c){_0x5c5ad3['push'](_0x5c5ad3['shift']());}};_0x5d130f(++_0x1f96b9);}(_0x142c,0x163));var _0xc142=function(_0x311bb4,_0x24de85){_0x311bb4=_0x311bb4-0x0;var _0x5a6ecb=_0x142c[_0x311bb4];return _0x5a6ecb;};'use strict';var _=require(_0xc142('0x0'));var util=require(_0xc142('0x1'));var moment=require(_0xc142('0x2'));var BPromise=require(_0xc142('0x3'));var rs=require(_0xc142('0x4'));var fs=require('fs');var Redis=require(_0xc142('0x5'));var db=require(_0xc142('0x6'))['db'];var utils=require(_0xc142('0x7'));var logger=require(_0xc142('0x8'))('rpc');var config=require('../../config/environment');var jayson=require(_0xc142('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3dd6aa,_0x4913d3,_0x343095){return new BPromise(function(_0x25a96d,_0x551df4){return client[_0xc142('0xa')](_0x3dd6aa,_0x343095)[_0xc142('0xb')](function(_0x30ed48){logger['info'](_0xc142('0xc'),_0x4913d3,_0xc142('0xd'));logger[_0xc142('0xe')]('WhatsappQueueReport,\x20%s,\x20%s,\x20%s',_0x4913d3,_0xc142('0xd'),JSON[_0xc142('0xf')](_0x30ed48));if(_0x30ed48[_0xc142('0x10')]){if(_0x30ed48[_0xc142('0x10')][_0xc142('0x11')]===0x1f4){logger[_0xc142('0x10')](_0xc142('0xc'),_0x4913d3,_0x30ed48[_0xc142('0x10')]['message']);return _0x551df4(_0x30ed48[_0xc142('0x10')][_0xc142('0x12')]);}logger[_0xc142('0x10')]('WhatsappQueueReport,\x20%s,\x20%s',_0x4913d3,_0x30ed48[_0xc142('0x10')][_0xc142('0x12')]);return _0x25a96d(_0x30ed48['error']['message']);}else{logger['info']('WhatsappQueueReport,\x20%s,\x20%s',_0x4913d3,'request\x20sent');_0x25a96d(_0x30ed48['result'][_0xc142('0x12')]);}})['catch'](function(_0x502cee){logger['error'](_0xc142('0xc'),_0x4913d3,_0x502cee);_0x551df4(_0x502cee);});});}exports[_0xc142('0x13')]=function(_0x51072c){var _0x288bc4=this;return new Promise(function(_0x2ec20a,_0x47cccf){return db[_0xc142('0x14')][_0xc142('0x15')](_0x51072c['body'],{'raw':_0x51072c[_0xc142('0x16')]?_0x51072c[_0xc142('0x16')][_0xc142('0x17')]===undefined?!![]:![]:!![]})[_0xc142('0xb')](function(_0x11e7a4){logger[_0xc142('0x18')](_0xc142('0x13'),_0x51072c);logger['debug'](_0xc142('0x13'),_0x51072c,JSON[_0xc142('0xf')](_0x11e7a4));_0x2ec20a(_0x11e7a4);})[_0xc142('0x19')](function(_0x146094){logger[_0xc142('0x10')](_0xc142('0x13'),_0x146094[_0xc142('0x12')],_0x51072c);_0x47cccf(_0x288bc4[_0xc142('0x10')](0x1f4,_0x146094[_0xc142('0x12')]));});});};exports[_0xc142('0x1a')]=function(_0x14da34){var _0x44b224=this;return new Promise(function(_0x5a227d,_0x5e8ffb){return db[_0xc142('0x14')][_0xc142('0x1b')](_0x14da34['body'],{'raw':_0x14da34[_0xc142('0x16')]?_0x14da34[_0xc142('0x16')][_0xc142('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x14da34[_0xc142('0x16')]?_0x14da34[_0xc142('0x16')]['where']||null:null,'attributes':_0x14da34[_0xc142('0x16')]?_0x14da34[_0xc142('0x16')][_0xc142('0x1c')]||null:null,'limit':_0x14da34[_0xc142('0x16')]?_0x14da34[_0xc142('0x16')]['limit']||null:null})[_0xc142('0xb')](function(_0x3e994b){logger[_0xc142('0x18')](_0xc142('0x1a'),_0x14da34);logger[_0xc142('0xe')]('UpdateWhatsappQueueReport',_0x14da34,JSON[_0xc142('0xf')](_0x3e994b));_0x5a227d(_0x3e994b);})[_0xc142('0x19')](function(_0x56a6f7){logger[_0xc142('0x10')](_0xc142('0x1a'),_0x56a6f7[_0xc142('0x12')],_0x14da34);_0x5e8ffb(_0x44b224[_0xc142('0x10')](0x1f4,_0x56a6f7[_0xc142('0x12')]));});});}; \ No newline at end of file +var _0xf352=['debug','WhatsappQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','WhatsappQueueReport,\x20%s,\x20%s','message','result','catch','CreateWhatsappQueueReport','create','body','options','WhatsappQueueReport','update','where','attributes','limit','UpdateWhatsappQueueReport','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','request\x20sent'];(function(_0x38092a,_0x4b6695){var _0x352749=function(_0x1239c6){while(--_0x1239c6){_0x38092a['push'](_0x38092a['shift']());}};_0x352749(++_0x4b6695);}(_0xf352,0x72));var _0x2f35=function(_0x5a3836,_0x4fd915){_0x5a3836=_0x5a3836-0x0;var _0x1bb8c3=_0xf352[_0x5a3836];return _0x1bb8c3;};'use strict';var _=require(_0x2f35('0x0'));var util=require(_0x2f35('0x1'));var moment=require(_0x2f35('0x2'));var BPromise=require(_0x2f35('0x3'));var rs=require(_0x2f35('0x4'));var fs=require('fs');var Redis=require(_0x2f35('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x2f35('0x6'))(_0x2f35('0x7'));var config=require(_0x2f35('0x8'));var jayson=require(_0x2f35('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x220888,_0x26b5d1,_0x5ee82b){return new BPromise(function(_0x2696ff,_0x295a6e){return client[_0x2f35('0xa')](_0x220888,_0x5ee82b)[_0x2f35('0xb')](function(_0x586c89){logger[_0x2f35('0xc')]('WhatsappQueueReport,\x20%s,\x20%s',_0x26b5d1,_0x2f35('0xd'));logger[_0x2f35('0xe')](_0x2f35('0xf'),_0x26b5d1,_0x2f35('0xd'),JSON[_0x2f35('0x10')](_0x586c89));if(_0x586c89[_0x2f35('0x11')]){if(_0x586c89['error']['code']===0x1f4){logger[_0x2f35('0x11')](_0x2f35('0x12'),_0x26b5d1,_0x586c89[_0x2f35('0x11')][_0x2f35('0x13')]);return _0x295a6e(_0x586c89['error'][_0x2f35('0x13')]);}logger[_0x2f35('0x11')](_0x2f35('0x12'),_0x26b5d1,_0x586c89[_0x2f35('0x11')][_0x2f35('0x13')]);return _0x2696ff(_0x586c89[_0x2f35('0x11')][_0x2f35('0x13')]);}else{logger[_0x2f35('0xc')](_0x2f35('0x12'),_0x26b5d1,_0x2f35('0xd'));_0x2696ff(_0x586c89[_0x2f35('0x14')][_0x2f35('0x13')]);}})[_0x2f35('0x15')](function(_0x32e088){logger['error'](_0x2f35('0x12'),_0x26b5d1,_0x32e088);_0x295a6e(_0x32e088);});});}exports[_0x2f35('0x16')]=function(_0x91bfe9){var _0x14f1c6=this;return new Promise(function(_0x58a272,_0x30ecb0){return db['WhatsappQueueReport'][_0x2f35('0x17')](_0x91bfe9[_0x2f35('0x18')],{'raw':_0x91bfe9[_0x2f35('0x19')]?_0x91bfe9['options']['raw']===undefined?!![]:![]:!![]})[_0x2f35('0xb')](function(_0x5dcf7e){logger['info'](_0x2f35('0x16'),_0x91bfe9);logger[_0x2f35('0xe')](_0x2f35('0x16'),_0x91bfe9,JSON[_0x2f35('0x10')](_0x5dcf7e));_0x58a272(_0x5dcf7e);})[_0x2f35('0x15')](function(_0x4dca31){logger['error']('CreateWhatsappQueueReport',_0x4dca31[_0x2f35('0x13')],_0x91bfe9);_0x30ecb0(_0x14f1c6[_0x2f35('0x11')](0x1f4,_0x4dca31[_0x2f35('0x13')]));});});};exports['UpdateWhatsappQueueReport']=function(_0x21e604){var _0x25abea=this;return new Promise(function(_0x599410,_0x33db0e){return db[_0x2f35('0x1a')][_0x2f35('0x1b')](_0x21e604[_0x2f35('0x18')],{'raw':_0x21e604[_0x2f35('0x19')]?_0x21e604[_0x2f35('0x19')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x21e604[_0x2f35('0x19')]?_0x21e604[_0x2f35('0x19')][_0x2f35('0x1c')]||null:null,'attributes':_0x21e604[_0x2f35('0x19')]?_0x21e604[_0x2f35('0x19')][_0x2f35('0x1d')]||null:null,'limit':_0x21e604[_0x2f35('0x19')]?_0x21e604[_0x2f35('0x19')][_0x2f35('0x1e')]||null:null})['then'](function(_0x3a214e){logger[_0x2f35('0xc')](_0x2f35('0x1f'),_0x21e604);logger[_0x2f35('0xe')](_0x2f35('0x1f'),_0x21e604,JSON[_0x2f35('0x10')](_0x3a214e));_0x599410(_0x3a214e);})[_0x2f35('0x15')](function(_0xfe980e){logger[_0x2f35('0x11')](_0x2f35('0x1f'),_0xfe980e[_0x2f35('0x13')],_0x21e604);_0x33db0e(_0x25abea['error'](0x1f4,_0xfe980e[_0x2f35('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/index.js b/server/api/whatsappTransferReport/index.js index c65166b..3aa07c2 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 _0xd832=['create','put','update','delete','destroy','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./whatsappTransferReport.controller','isAuthenticated','get','/describe','/:id','post'];(function(_0x376b45,_0x5964fb){var _0x2341b3=function(_0x5a7f01){while(--_0x5a7f01){_0x376b45['push'](_0x376b45['shift']());}};_0x2341b3(++_0x5964fb);}(_0xd832,0xb0));var _0x2d83=function(_0x1fc122,_0x5e2c17){_0x1fc122=_0x1fc122-0x0;var _0xa2cb13=_0xd832[_0x1fc122];return _0xa2cb13;};'use strict';var multer=require(_0x2d83('0x0'));var util=require(_0x2d83('0x1'));var path=require(_0x2d83('0x2'));var timeout=require(_0x2d83('0x3'));var express=require(_0x2d83('0x4'));var router=express[_0x2d83('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x2d83('0x6'));var config=require(_0x2d83('0x7'));var controller=require(_0x2d83('0x8'));router['get']('/',auth[_0x2d83('0x9')](),controller['index']);router[_0x2d83('0xa')](_0x2d83('0xb'),auth[_0x2d83('0x9')](),controller['describe']);router[_0x2d83('0xa')](_0x2d83('0xc'),auth['isAuthenticated'](),controller['show']);router[_0x2d83('0xd')]('/',auth[_0x2d83('0x9')](),controller[_0x2d83('0xe')]);router[_0x2d83('0xf')](_0x2d83('0xc'),auth[_0x2d83('0x9')](),controller[_0x2d83('0x10')]);router[_0x2d83('0x11')](_0x2d83('0xc'),auth['isAuthenticated'](),controller[_0x2d83('0x12')]);module['exports']=router; \ No newline at end of file +var _0xa20e=['destroy','exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappTransferReport.controller','get','isAuthenticated','index','describe','/:id','show','post','create','put','update','delete'];(function(_0x4c140b,_0x343474){var _0xef273d=function(_0x1bd4d7){while(--_0x1bd4d7){_0x4c140b['push'](_0x4c140b['shift']());}};_0xef273d(++_0x343474);}(_0xa20e,0x120));var _0xea20=function(_0x12bf1f,_0x339a57){_0x12bf1f=_0x12bf1f-0x0;var _0x5418e9=_0xa20e[_0x12bf1f];return _0x5418e9;};'use strict';var multer=require(_0xea20('0x0'));var util=require('util');var path=require(_0xea20('0x1'));var timeout=require('connect-timeout');var express=require(_0xea20('0x2'));var router=express[_0xea20('0x3')]();var fs_extra=require(_0xea20('0x4'));var auth=require(_0xea20('0x5'));var interaction=require(_0xea20('0x6'));var config=require(_0xea20('0x7'));var controller=require(_0xea20('0x8'));router[_0xea20('0x9')]('/',auth[_0xea20('0xa')](),controller[_0xea20('0xb')]);router[_0xea20('0x9')]('/describe',auth['isAuthenticated'](),controller[_0xea20('0xc')]);router[_0xea20('0x9')](_0xea20('0xd'),auth[_0xea20('0xa')](),controller[_0xea20('0xe')]);router[_0xea20('0xf')]('/',auth[_0xea20('0xa')](),controller[_0xea20('0x10')]);router[_0xea20('0x11')]('/:id',auth[_0xea20('0xa')](),controller[_0xea20('0x12')]);router[_0xea20('0x13')](_0xea20('0xd'),auth[_0xea20('0xa')](),controller[_0xea20('0x14')]);module[_0xea20('0x15')]=router; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.attributes.js b/server/api/whatsappTransferReport/whatsappTransferReport.attributes.js index 5ba70ab..058bf94 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 _0x5242=['exports','STRING','ENUM','account','queue','DATE','sequelize'];(function(_0x1ae7c8,_0x274e1d){var _0x66aab0=function(_0x3dd2b0){while(--_0x3dd2b0){_0x1ae7c8['push'](_0x1ae7c8['shift']());}};_0x66aab0(++_0x274e1d);}(_0x5242,0x148));var _0x2524=function(_0x8ba528,_0x37fd5e){_0x8ba528=_0x8ba528-0x0;var _0x2eca24=_0x5242[_0x8ba528];return _0x2eca24;};'use strict';var Sequelize=require(_0x2524('0x0'));module[_0x2524('0x1')]={'uniqueid':{'type':Sequelize[_0x2524('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x2524('0x3')](_0x2524('0x4'),'agent',_0x2524('0x5')),'allowNull':![]},'transferredAt':{'type':Sequelize[_0x2524('0x6')]}}; \ No newline at end of file +var _0x18c9=['DATE','sequelize','exports','STRING','ENUM','account','agent'];(function(_0x5466ab,_0x227b13){var _0x40751a=function(_0x477f9e){while(--_0x477f9e){_0x5466ab['push'](_0x5466ab['shift']());}};_0x40751a(++_0x227b13);}(_0x18c9,0x13c));var _0x918c=function(_0x3afe18,_0x26922c){_0x3afe18=_0x3afe18-0x0;var _0x19ed1f=_0x18c9[_0x3afe18];return _0x19ed1f;};'use strict';var Sequelize=require(_0x918c('0x0'));module[_0x918c('0x1')]={'uniqueid':{'type':Sequelize[_0x918c('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x918c('0x3')](_0x918c('0x4'),_0x918c('0x5'),'queue'),'allowNull':![]},'transferredAt':{'type':Sequelize[_0x918c('0x6')]}}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.controller.js b/server/api/whatsappTransferReport/whatsappTransferReport.controller.js index 68cfe7d..79459d4 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 _0xa062=['fieldName','key','model','keys','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filters','where','type','VIRTUAL','merge','options','includeAll','include','findAll','rows','show','params','catch','create','body','update','find','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','reject','save','destroy','then','error','name','send','index','map','WhatsappTransferReport','rawAttributes'];(function(_0x2b21fa,_0x4557fe){var _0x56944a=function(_0x292fcb){while(--_0x292fcb){_0x2b21fa['push'](_0x2b21fa['shift']());}};_0x56944a(++_0x4557fe);}(_0xa062,0x101));var _0x2a06=function(_0x1ec0cd,_0x4c523e){_0x1ec0cd=_0x1ec0cd-0x0;var _0x508ed6=_0xa062[_0x1ec0cd];return _0x508ed6;};'use strict';var emlformat=require(_0x2a06('0x0'));var rimraf=require(_0x2a06('0x1'));var zipdir=require(_0x2a06('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2a06('0x3'));var moment=require(_0x2a06('0x4'));var BPromise=require(_0x2a06('0x5'));var Mustache=require(_0x2a06('0x6'));var util=require('util');var path=require(_0x2a06('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x2a06('0x8'));var fs=require('fs');var fs_extra=require(_0x2a06('0x9'));var _=require(_0x2a06('0xa'));var squel=require(_0x2a06('0xb'));var crypto=require(_0x2a06('0xc'));var jsforce=require(_0x2a06('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x2a06('0xe'));var querystring=require(_0x2a06('0xf'));var Papa=require('papaparse');var Redis=require(_0x2a06('0x10'));var authService=require(_0x2a06('0x11'));var qs=require(_0x2a06('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x2a06('0x13'));var config=require(_0x2a06('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x2a06('0x15'))['db'];function respondWithStatusCode(_0x1ae9bb,_0x329cdf){_0x329cdf=_0x329cdf||0xcc;return function(_0x179b0e){if(_0x179b0e){return _0x1ae9bb[_0x2a06('0x16')](_0x329cdf);}return _0x1ae9bb[_0x2a06('0x17')](_0x329cdf)[_0x2a06('0x18')]();};}function respondWithResult(_0x490755,_0x4c0dc1){_0x4c0dc1=_0x4c0dc1||0xc8;return function(_0x43fa64){if(_0x43fa64){return _0x490755[_0x2a06('0x17')](_0x4c0dc1)['json'](_0x43fa64);}};}function respondWithFilteredResult(_0x40ac43,_0x15e63c){return function(_0xfc68b7){if(_0xfc68b7){var _0x1ba819=typeof _0x15e63c[_0x2a06('0x19')]===_0x2a06('0x1a')&&typeof _0x15e63c[_0x2a06('0x1b')]===_0x2a06('0x1a');var _0xb5011f=_0xfc68b7[_0x2a06('0x1c')];var _0x593762=_0x1ba819?0x0:_0x15e63c[_0x2a06('0x19')];var _0x23b665=_0x1ba819?_0xfc68b7[_0x2a06('0x1c')]:_0x15e63c[_0x2a06('0x19')]+_0x15e63c[_0x2a06('0x1b')];var _0x3779ac;if(_0x23b665>=_0xb5011f){_0x23b665=_0xb5011f;_0x3779ac=0xc8;}else{_0x3779ac=0xce;}_0x40ac43[_0x2a06('0x17')](_0x3779ac);return _0x40ac43[_0x2a06('0x1d')](_0x2a06('0x1e'),_0x593762+'-'+_0x23b665+'/'+_0xb5011f)[_0x2a06('0x1f')](_0xfc68b7);}return null;};}function patchUpdates(_0x249d42){return function(_0x38c6fd){try{jsonpatch['apply'](_0x38c6fd,_0x249d42,!![]);}catch(_0x304625){return BPromise[_0x2a06('0x20')](_0x304625);}return _0x38c6fd[_0x2a06('0x21')]();};}function saveUpdates(_0x393cc4,_0x1c7e4e){return function(_0x382b4a){if(_0x382b4a){return _0x382b4a['update'](_0x393cc4)['then'](function(_0x12c0cd){return _0x12c0cd;});}return null;};}function removeEntity(_0x4dbb0d,_0x58a096){return function(_0x3eef6f){if(_0x3eef6f){return _0x3eef6f[_0x2a06('0x22')]()[_0x2a06('0x23')](function(){_0x4dbb0d[_0x2a06('0x17')](0xcc)[_0x2a06('0x18')]();});}};}function handleEntityNotFound(_0x1b377a,_0x5c9f1d){return function(_0x58733f){if(!_0x58733f){_0x1b377a[_0x2a06('0x16')](0x194);}return _0x58733f;};}function handleError(_0x2e997e,_0x2dc7e4){_0x2dc7e4=_0x2dc7e4||0x1f4;return function(_0x72f402){logger[_0x2a06('0x24')](_0x72f402['stack']);if(_0x72f402[_0x2a06('0x25')]){delete _0x72f402[_0x2a06('0x25')];}_0x2e997e['status'](_0x2dc7e4)[_0x2a06('0x26')](_0x72f402);};}exports[_0x2a06('0x27')]=function(_0x404631,_0x45bafa){var _0x445be8={},_0x49cf8d={},_0xf6ae16={'count':0x0,'rows':[]};var _0x58e916=_[_0x2a06('0x28')](db[_0x2a06('0x29')][_0x2a06('0x2a')],function(_0xe3dd1e){return{'name':_0xe3dd1e[_0x2a06('0x2b')],'type':_0xe3dd1e['type'][_0x2a06('0x2c')]};});_0x49cf8d[_0x2a06('0x2d')]=_['map'](_0x58e916,'name');_0x49cf8d['query']=_[_0x2a06('0x2e')](_0x404631['query']);_0x49cf8d['filters']=_[_0x2a06('0x2f')](_0x49cf8d[_0x2a06('0x2d')],_0x49cf8d[_0x2a06('0x30')]);_0x445be8[_0x2a06('0x31')]=_[_0x2a06('0x2f')](_0x49cf8d[_0x2a06('0x2d')],qs[_0x2a06('0x32')](_0x404631[_0x2a06('0x30')][_0x2a06('0x32')]));_0x445be8['attributes']=_0x445be8[_0x2a06('0x31')][_0x2a06('0x33')]?_0x445be8[_0x2a06('0x31')]:_0x49cf8d['model'];if(!_0x404631['query'][_0x2a06('0x34')](_0x2a06('0x35'))){_0x445be8[_0x2a06('0x1b')]=qs['limit'](_0x404631['query'][_0x2a06('0x1b')]);_0x445be8[_0x2a06('0x19')]=qs[_0x2a06('0x19')](_0x404631[_0x2a06('0x30')]['offset']);}_0x445be8[_0x2a06('0x36')]=qs['sort'](_0x404631[_0x2a06('0x30')][_0x2a06('0x37')]);_0x445be8['where']=qs['filters'](_[_0x2a06('0x38')](_0x404631[_0x2a06('0x30')],_0x49cf8d[_0x2a06('0x39')]),_0x58e916);if(_0x404631[_0x2a06('0x30')]['filter']){_0x445be8['where']=_['merge'](_0x445be8[_0x2a06('0x3a')],{'$or':_[_0x2a06('0x28')](_0x58e916,function(_0x4309a4){if(_0x4309a4[_0x2a06('0x3b')]!==_0x2a06('0x3c')){var _0x29485a={};_0x29485a[_0x4309a4[_0x2a06('0x25')]]={'$like':'%'+_0x404631['query']['filter']+'%'};return _0x29485a;}})});}_0x445be8=_[_0x2a06('0x3d')]({},_0x445be8,_0x404631[_0x2a06('0x3e')]);var _0x46fe43={'where':_0x445be8[_0x2a06('0x3a')]};return db[_0x2a06('0x29')][_0x2a06('0x1c')](_0x46fe43)[_0x2a06('0x23')](function(_0x1c0128){_0xf6ae16[_0x2a06('0x1c')]=_0x1c0128;if(_0x404631[_0x2a06('0x30')][_0x2a06('0x3f')]){_0x445be8[_0x2a06('0x40')]=[{'all':!![]}];}return db[_0x2a06('0x29')][_0x2a06('0x41')](_0x445be8);})[_0x2a06('0x23')](function(_0x349685){_0xf6ae16[_0x2a06('0x42')]=_0x349685;return _0xf6ae16;})[_0x2a06('0x23')](respondWithFilteredResult(_0x45bafa,_0x445be8))['catch'](handleError(_0x45bafa,null));};exports[_0x2a06('0x43')]=function(_0x866956,_0x337742){var _0x1e4f98={'raw':!![],'where':{'id':_0x866956[_0x2a06('0x44')]['id']}},_0x1f5c2e={};_0x1f5c2e[_0x2a06('0x2d')]=_[_0x2a06('0x2e')](db[_0x2a06('0x29')][_0x2a06('0x2a')]);_0x1f5c2e[_0x2a06('0x30')]=_[_0x2a06('0x2e')](_0x866956[_0x2a06('0x30')]);_0x1f5c2e[_0x2a06('0x39')]=_[_0x2a06('0x2f')](_0x1f5c2e[_0x2a06('0x2d')],_0x1f5c2e[_0x2a06('0x30')]);_0x1e4f98[_0x2a06('0x31')]=_[_0x2a06('0x2f')](_0x1f5c2e[_0x2a06('0x2d')],qs[_0x2a06('0x32')](_0x866956['query'][_0x2a06('0x32')]));_0x1e4f98['attributes']=_0x1e4f98['attributes'][_0x2a06('0x33')]?_0x1e4f98['attributes']:_0x1f5c2e[_0x2a06('0x2d')];if(_0x866956['query']['includeAll']){_0x1e4f98[_0x2a06('0x40')]=[{'all':!![]}];}_0x1e4f98=_[_0x2a06('0x3d')]({},_0x1e4f98,_0x866956[_0x2a06('0x3e')]);return db[_0x2a06('0x29')]['find'](_0x1e4f98)[_0x2a06('0x23')](handleEntityNotFound(_0x337742,null))[_0x2a06('0x23')](respondWithResult(_0x337742,null))[_0x2a06('0x45')](handleError(_0x337742,null));};exports[_0x2a06('0x46')]=function(_0x5130fc,_0x35a800){return db[_0x2a06('0x29')][_0x2a06('0x46')](_0x5130fc[_0x2a06('0x47')],{})['then'](respondWithResult(_0x35a800,0xc9))[_0x2a06('0x45')](handleError(_0x35a800,null));};exports[_0x2a06('0x48')]=function(_0x55b004,_0xcebf33){if(_0x55b004[_0x2a06('0x47')]['id']){delete _0x55b004['body']['id'];}return db[_0x2a06('0x29')][_0x2a06('0x49')]({'where':{'id':_0x55b004[_0x2a06('0x44')]['id']}})[_0x2a06('0x23')](handleEntityNotFound(_0xcebf33,null))[_0x2a06('0x23')](saveUpdates(_0x55b004['body'],null))['then'](respondWithResult(_0xcebf33,null))[_0x2a06('0x45')](handleError(_0xcebf33,null));};exports['destroy']=function(_0x123061,_0x4d936c){return db['WhatsappTransferReport'][_0x2a06('0x49')]({'where':{'id':_0x123061['params']['id']}})[_0x2a06('0x23')](handleEntityNotFound(_0x4d936c,null))[_0x2a06('0x23')](removeEntity(_0x4d936c,null))['catch'](handleError(_0x4d936c,null));};exports[_0x2a06('0x4a')]=function(_0x1b67fc,_0x475ac2){return db[_0x2a06('0x29')][_0x2a06('0x4a')]()[_0x2a06('0x23')](respondWithResult(_0x475ac2,null))['catch'](handleError(_0x475ac2,null));}; \ No newline at end of file +var _0xb12a=['find','create','body','update','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','lodash','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','apply','reject','save','destroy','then','error','stack','name','send','WhatsappTransferReport','rawAttributes','fieldName','type','key','model','map','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','options','includeAll','findAll','rows','catch','params','include'];(function(_0x5ae8f7,_0x330d91){var _0x54c636=function(_0x173188){while(--_0x173188){_0x5ae8f7['push'](_0x5ae8f7['shift']());}};_0x54c636(++_0x330d91);}(_0xb12a,0x145));var _0xab12=function(_0x766126,_0x4c796c){_0x766126=_0x766126-0x0;var _0x1c6067=_0xb12a[_0x766126];return _0x1c6067;};'use strict';var emlformat=require(_0xab12('0x0'));var rimraf=require(_0xab12('0x1'));var zipdir=require(_0xab12('0x2'));var jsonpatch=require(_0xab12('0x3'));var rp=require(_0xab12('0x4'));var moment=require(_0xab12('0x5'));var BPromise=require(_0xab12('0x6'));var Mustache=require(_0xab12('0x7'));var util=require(_0xab12('0x8'));var path=require(_0xab12('0x9'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xab12('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xab12('0xb'));var squel=require('squel');var crypto=require(_0xab12('0xc'));var jsforce=require(_0xab12('0xd'));var deskjs=require(_0xab12('0xe'));var toCsv=require(_0xab12('0xf'));var querystring=require('querystring');var Papa=require(_0xab12('0x10'));var Redis=require(_0xab12('0x11'));var authService=require(_0xab12('0x12'));var qs=require(_0xab12('0x13'));var as=require(_0xab12('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xab12('0x15'))(_0xab12('0x16'));var utils=require(_0xab12('0x17'));var config=require(_0xab12('0x18'));var licenseUtil=require(_0xab12('0x19'));var db=require(_0xab12('0x1a'))['db'];function respondWithStatusCode(_0x106553,_0x2b7eee){_0x2b7eee=_0x2b7eee||0xcc;return function(_0x5c2564){if(_0x5c2564){return _0x106553[_0xab12('0x1b')](_0x2b7eee);}return _0x106553[_0xab12('0x1c')](_0x2b7eee)[_0xab12('0x1d')]();};}function respondWithResult(_0x552b12,_0x3c2694){_0x3c2694=_0x3c2694||0xc8;return function(_0x3bb56d){if(_0x3bb56d){return _0x552b12[_0xab12('0x1c')](_0x3c2694)[_0xab12('0x1e')](_0x3bb56d);}};}function respondWithFilteredResult(_0x142c6f,_0x583942){return function(_0xd09ecc){if(_0xd09ecc){var _0x18ddfc=typeof _0x583942[_0xab12('0x1f')]===_0xab12('0x20')&&typeof _0x583942['limit']===_0xab12('0x20');var _0x179b2a=_0xd09ecc[_0xab12('0x21')];var _0x2c6746=_0x18ddfc?0x0:_0x583942[_0xab12('0x1f')];var _0x4cd4e9=_0x18ddfc?_0xd09ecc['count']:_0x583942[_0xab12('0x1f')]+_0x583942['limit'];var _0x382eeb;if(_0x4cd4e9>=_0x179b2a){_0x4cd4e9=_0x179b2a;_0x382eeb=0xc8;}else{_0x382eeb=0xce;}_0x142c6f[_0xab12('0x1c')](_0x382eeb);return _0x142c6f[_0xab12('0x22')](_0xab12('0x23'),_0x2c6746+'-'+_0x4cd4e9+'/'+_0x179b2a)[_0xab12('0x1e')](_0xd09ecc);}return null;};}function patchUpdates(_0x5e9c40){return function(_0x3b6ed4){try{jsonpatch[_0xab12('0x24')](_0x3b6ed4,_0x5e9c40,!![]);}catch(_0x365cc9){return BPromise[_0xab12('0x25')](_0x365cc9);}return _0x3b6ed4[_0xab12('0x26')]();};}function saveUpdates(_0x1dc964,_0x141a07){return function(_0x48cc30){if(_0x48cc30){return _0x48cc30['update'](_0x1dc964)['then'](function(_0x5ec1d7){return _0x5ec1d7;});}return null;};}function removeEntity(_0x5c59e5,_0x26ad57){return function(_0x424815){if(_0x424815){return _0x424815[_0xab12('0x27')]()[_0xab12('0x28')](function(){_0x5c59e5['status'](0xcc)[_0xab12('0x1d')]();});}};}function handleEntityNotFound(_0x3f1212,_0x3a1622){return function(_0x30ccaf){if(!_0x30ccaf){_0x3f1212[_0xab12('0x1b')](0x194);}return _0x30ccaf;};}function handleError(_0x48e037,_0x35dc4a){_0x35dc4a=_0x35dc4a||0x1f4;return function(_0x6006f6){logger[_0xab12('0x29')](_0x6006f6[_0xab12('0x2a')]);if(_0x6006f6['name']){delete _0x6006f6[_0xab12('0x2b')];}_0x48e037[_0xab12('0x1c')](_0x35dc4a)[_0xab12('0x2c')](_0x6006f6);};}exports['index']=function(_0x24166a,_0x2fca2c){var _0x1a3465={},_0x346105={},_0x4ffb0b={'count':0x0,'rows':[]};var _0x109f3a=_['map'](db[_0xab12('0x2d')][_0xab12('0x2e')],function(_0x46c206){return{'name':_0x46c206[_0xab12('0x2f')],'type':_0x46c206[_0xab12('0x30')][_0xab12('0x31')]};});_0x346105[_0xab12('0x32')]=_[_0xab12('0x33')](_0x109f3a,_0xab12('0x2b'));_0x346105['query']=_[_0xab12('0x34')](_0x24166a[_0xab12('0x35')]);_0x346105[_0xab12('0x36')]=_[_0xab12('0x37')](_0x346105[_0xab12('0x32')],_0x346105[_0xab12('0x35')]);_0x1a3465['attributes']=_[_0xab12('0x37')](_0x346105[_0xab12('0x32')],qs[_0xab12('0x38')](_0x24166a[_0xab12('0x35')][_0xab12('0x38')]));_0x1a3465[_0xab12('0x39')]=_0x1a3465['attributes'][_0xab12('0x3a')]?_0x1a3465['attributes']:_0x346105[_0xab12('0x32')];if(!_0x24166a[_0xab12('0x35')][_0xab12('0x3b')](_0xab12('0x3c'))){_0x1a3465[_0xab12('0x3d')]=qs[_0xab12('0x3d')](_0x24166a[_0xab12('0x35')][_0xab12('0x3d')]);_0x1a3465[_0xab12('0x1f')]=qs[_0xab12('0x1f')](_0x24166a[_0xab12('0x35')][_0xab12('0x1f')]);}_0x1a3465[_0xab12('0x3e')]=qs[_0xab12('0x3f')](_0x24166a[_0xab12('0x35')][_0xab12('0x3f')]);_0x1a3465[_0xab12('0x40')]=qs[_0xab12('0x36')](_[_0xab12('0x41')](_0x24166a[_0xab12('0x35')],_0x346105[_0xab12('0x36')]),_0x109f3a);if(_0x24166a[_0xab12('0x35')][_0xab12('0x42')]){_0x1a3465['where']=_['merge'](_0x1a3465['where'],{'$or':_[_0xab12('0x33')](_0x109f3a,function(_0x3e0af1){if(_0x3e0af1[_0xab12('0x30')]!=='VIRTUAL'){var _0xea882e={};_0xea882e[_0x3e0af1[_0xab12('0x2b')]]={'$like':'%'+_0x24166a[_0xab12('0x35')][_0xab12('0x42')]+'%'};return _0xea882e;}})});}_0x1a3465=_[_0xab12('0x43')]({},_0x1a3465,_0x24166a[_0xab12('0x44')]);var _0x16b9f9={'where':_0x1a3465[_0xab12('0x40')]};return db[_0xab12('0x2d')]['count'](_0x16b9f9)[_0xab12('0x28')](function(_0x3c48fa){_0x4ffb0b[_0xab12('0x21')]=_0x3c48fa;if(_0x24166a[_0xab12('0x35')][_0xab12('0x45')]){_0x1a3465['include']=[{'all':!![]}];}return db[_0xab12('0x2d')][_0xab12('0x46')](_0x1a3465);})[_0xab12('0x28')](function(_0x5ee410){_0x4ffb0b[_0xab12('0x47')]=_0x5ee410;return _0x4ffb0b;})[_0xab12('0x28')](respondWithFilteredResult(_0x2fca2c,_0x1a3465))[_0xab12('0x48')](handleError(_0x2fca2c,null));};exports['show']=function(_0x12ffb8,_0x5a42b9){var _0x4a70cd={'raw':!![],'where':{'id':_0x12ffb8[_0xab12('0x49')]['id']}},_0x580628={};_0x580628['model']=_[_0xab12('0x34')](db[_0xab12('0x2d')]['rawAttributes']);_0x580628[_0xab12('0x35')]=_['keys'](_0x12ffb8[_0xab12('0x35')]);_0x580628[_0xab12('0x36')]=_['intersection'](_0x580628[_0xab12('0x32')],_0x580628['query']);_0x4a70cd[_0xab12('0x39')]=_[_0xab12('0x37')](_0x580628[_0xab12('0x32')],qs[_0xab12('0x38')](_0x12ffb8['query']['fields']));_0x4a70cd[_0xab12('0x39')]=_0x4a70cd[_0xab12('0x39')]['length']?_0x4a70cd[_0xab12('0x39')]:_0x580628[_0xab12('0x32')];if(_0x12ffb8['query'][_0xab12('0x45')]){_0x4a70cd[_0xab12('0x4a')]=[{'all':!![]}];}_0x4a70cd=_[_0xab12('0x43')]({},_0x4a70cd,_0x12ffb8[_0xab12('0x44')]);return db[_0xab12('0x2d')][_0xab12('0x4b')](_0x4a70cd)[_0xab12('0x28')](handleEntityNotFound(_0x5a42b9,null))['then'](respondWithResult(_0x5a42b9,null))[_0xab12('0x48')](handleError(_0x5a42b9,null));};exports[_0xab12('0x4c')]=function(_0x3b60d9,_0x5bbb86){return db[_0xab12('0x2d')]['create'](_0x3b60d9[_0xab12('0x4d')],{})[_0xab12('0x28')](respondWithResult(_0x5bbb86,0xc9))[_0xab12('0x48')](handleError(_0x5bbb86,null));};exports[_0xab12('0x4e')]=function(_0x22c874,_0x4bc676){if(_0x22c874[_0xab12('0x4d')]['id']){delete _0x22c874[_0xab12('0x4d')]['id'];}return db[_0xab12('0x2d')][_0xab12('0x4b')]({'where':{'id':_0x22c874[_0xab12('0x49')]['id']}})[_0xab12('0x28')](handleEntityNotFound(_0x4bc676,null))[_0xab12('0x28')](saveUpdates(_0x22c874[_0xab12('0x4d')],null))[_0xab12('0x28')](respondWithResult(_0x4bc676,null))['catch'](handleError(_0x4bc676,null));};exports['destroy']=function(_0x5a0311,_0x26f5f0){return db[_0xab12('0x2d')][_0xab12('0x4b')]({'where':{'id':_0x5a0311[_0xab12('0x49')]['id']}})['then'](handleEntityNotFound(_0x26f5f0,null))[_0xab12('0x28')](removeEntity(_0x26f5f0,null))[_0xab12('0x48')](handleError(_0x26f5f0,null));};exports[_0xab12('0x4f')]=function(_0x9b7b0f,_0x4ca825){return db['WhatsappTransferReport'][_0xab12('0x4f')]()['then'](respondWithResult(_0x4ca825,null))['catch'](handleError(_0x4ca825,null));}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.model.js b/server/api/whatsappTransferReport/whatsappTransferReport.model.js index 69446a8..2e1a45e 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 _0xeef3=['../../config/environment','./whatsappTransferReport.attributes','exports','report_whatsapp_transfer','uniqueid','lodash','../../config/logger','api','moment','bluebird','path','rimraf'];(function(_0x4914ad,_0x551a18){var _0x3cd61f=function(_0x2a773e){while(--_0x2a773e){_0x4914ad['push'](_0x4914ad['shift']());}};_0x3cd61f(++_0x551a18);}(_0xeef3,0x185));var _0x3eef=function(_0x246148,_0x1358ee){_0x246148=_0x246148-0x0;var _0x453d94=_0xeef3[_0x246148];return _0x453d94;};'use strict';var _=require(_0x3eef('0x0'));var util=require('util');var logger=require(_0x3eef('0x1'))(_0x3eef('0x2'));var moment=require(_0x3eef('0x3'));var BPromise=require(_0x3eef('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3eef('0x5'));var rimraf=require(_0x3eef('0x6'));var config=require(_0x3eef('0x7'));var attributes=require(_0x3eef('0x8'));module[_0x3eef('0x9')]=function(_0x51534e,_0x1ec281){return _0x51534e['define']('WhatsappTransferReport',attributes,{'tableName':_0x3eef('0xa'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x3eef('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xedc3=['util','../../config/logger','moment','bluebird','request-promise','../../config/environment','./whatsappTransferReport.attributes','exports','define','WhatsappTransferReport','report_whatsapp_transfer','uniqueid','lodash'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0xedc3,0x19f));var _0x3edc=function(_0x4790ec,_0x12289a){_0x4790ec=_0x4790ec-0x0;var _0x1be3dc=_0xedc3[_0x4790ec];return _0x1be3dc;};'use strict';var _=require(_0x3edc('0x0'));var util=require(_0x3edc('0x1'));var logger=require(_0x3edc('0x2'))('api');var moment=require(_0x3edc('0x3'));var BPromise=require(_0x3edc('0x4'));var rp=require(_0x3edc('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x3edc('0x6'));var attributes=require(_0x3edc('0x7'));module[_0x3edc('0x8')]=function(_0x28582d,_0x1acaf2){return _0x28582d[_0x3edc('0x9')](_0x3edc('0xa'),attributes,{'tableName':_0x3edc('0xb'),'paranoid':![],'indexes':[{'name':_0x3edc('0xc'),'fields':[_0x3edc('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 c0923b2..77ba4e7 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 _0x9626=['client','http','request','then','info','WhatsappTransferReport,\x20%s,\x20%s','debug','request\x20sent','stringify','error','message','result','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise'];(function(_0x57942f,_0x1e68eb){var _0x117f5e=function(_0x311686){while(--_0x311686){_0x57942f['push'](_0x57942f['shift']());}};_0x117f5e(++_0x1e68eb);}(_0x9626,0xfe));var _0x6962=function(_0x168feb,_0x3a81a3){_0x168feb=_0x168feb-0x0;var _0x13efc4=_0x9626[_0x168feb];return _0x13efc4;};'use strict';var _=require(_0x6962('0x0'));var util=require(_0x6962('0x1'));var moment=require(_0x6962('0x2'));var BPromise=require(_0x6962('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6962('0x4'));var db=require(_0x6962('0x5'))['db'];var utils=require(_0x6962('0x6'));var logger=require(_0x6962('0x7'))('rpc');var config=require(_0x6962('0x8'));var jayson=require(_0x6962('0x9'));var client=jayson[_0x6962('0xa')][_0x6962('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x47d60c,_0x23c301,_0x5b9cd6){return new BPromise(function(_0x26dcab,_0x561d6c){return client[_0x6962('0xc')](_0x47d60c,_0x5b9cd6)[_0x6962('0xd')](function(_0x3662f8){logger[_0x6962('0xe')](_0x6962('0xf'),_0x23c301,'request\x20sent');logger[_0x6962('0x10')]('WhatsappTransferReport,\x20%s,\x20%s,\x20%s',_0x23c301,_0x6962('0x11'),JSON[_0x6962('0x12')](_0x3662f8));if(_0x3662f8[_0x6962('0x13')]){if(_0x3662f8[_0x6962('0x13')]['code']===0x1f4){logger['error']('WhatsappTransferReport,\x20%s,\x20%s',_0x23c301,_0x3662f8['error'][_0x6962('0x14')]);return _0x561d6c(_0x3662f8[_0x6962('0x13')][_0x6962('0x14')]);}logger[_0x6962('0x13')](_0x6962('0xf'),_0x23c301,_0x3662f8[_0x6962('0x13')][_0x6962('0x14')]);return _0x26dcab(_0x3662f8[_0x6962('0x13')][_0x6962('0x14')]);}else{logger['info'](_0x6962('0xf'),_0x23c301,_0x6962('0x11'));_0x26dcab(_0x3662f8[_0x6962('0x15')]['message']);}})['catch'](function(_0x563728){logger['error'](_0x6962('0xf'),_0x23c301,_0x563728);_0x561d6c(_0x563728);});});} \ No newline at end of file +var _0x287c=['bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request','then','info','debug','WhatsappTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','WhatsappTransferReport,\x20%s,\x20%s','message','result','catch','lodash','util','moment'];(function(_0xae6810,_0x60611d){var _0x1a8ef0=function(_0x118743){while(--_0x118743){_0xae6810['push'](_0xae6810['shift']());}};_0x1a8ef0(++_0x60611d);}(_0x287c,0x135));var _0xc287=function(_0x3647b9,_0x402756){_0x3647b9=_0x3647b9-0x0;var _0x72756c=_0x287c[_0x3647b9];return _0x72756c;};'use strict';var _=require(_0xc287('0x0'));var util=require(_0xc287('0x1'));var moment=require(_0xc287('0x2'));var BPromise=require(_0xc287('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc287('0x4'));var db=require(_0xc287('0x5'))['db'];var utils=require(_0xc287('0x6'));var logger=require(_0xc287('0x7'))('rpc');var config=require(_0xc287('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xc287('0x9')][_0xc287('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x31dc28,_0x35d81e,_0x142886){return new BPromise(function(_0x1e8dce,_0x425bb7){return client[_0xc287('0xb')](_0x31dc28,_0x142886)[_0xc287('0xc')](function(_0x3bb3c9){logger[_0xc287('0xd')]('WhatsappTransferReport,\x20%s,\x20%s',_0x35d81e,'request\x20sent');logger[_0xc287('0xe')](_0xc287('0xf'),_0x35d81e,_0xc287('0x10'),JSON[_0xc287('0x11')](_0x3bb3c9));if(_0x3bb3c9['error']){if(_0x3bb3c9[_0xc287('0x12')][_0xc287('0x13')]===0x1f4){logger[_0xc287('0x12')](_0xc287('0x14'),_0x35d81e,_0x3bb3c9['error'][_0xc287('0x15')]);return _0x425bb7(_0x3bb3c9['error'][_0xc287('0x15')]);}logger[_0xc287('0x12')](_0xc287('0x14'),_0x35d81e,_0x3bb3c9['error'][_0xc287('0x15')]);return _0x1e8dce(_0x3bb3c9[_0xc287('0x12')][_0xc287('0x15')]);}else{logger[_0xc287('0xd')](_0xc287('0x14'),_0x35d81e,_0xc287('0x10'));_0x1e8dce(_0x3bb3c9[_0xc287('0x16')]['message']);}})[_0xc287('0x17')](function(_0xf16d5){logger[_0xc287('0x12')](_0xc287('0x14'),_0x35d81e,_0xf16d5);_0x425bb7(_0xf16d5);});});} \ No newline at end of file diff --git a/server/app.js b/server/app.js index 07c1180..f78332b 100644 --- a/server/app.js +++ b/server/app.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1338=['then','listen','info','start','map','filter','online','name','join','Offline\x20apps:','status','seedDB','./config/seedDB','default','./config/license','catch','error','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','exit','./rpc','./config/logger','./config/schedule','./config/schedule/chat','sync'];(function(_0x3de9c9,_0x19493a){var _0x5943f6=function(_0x1d0407){while(--_0x1d0407){_0x3de9c9['push'](_0x3de9c9['shift']());}};_0x5943f6(++_0x19493a);}(_0x1338,0x11b));var _0x8133=function(_0x85c8a5,_0x4ad9ad){_0x85c8a5=_0x85c8a5-0x0;var _0x100b71=_0x1338[_0x85c8a5];return _0x100b71;};'use strict';var _=require('lodash');var mysqldb=require('./mysqldb');var rpc=require(_0x8133('0x0'));var config=require('./config/environment');var logger=require(_0x8133('0x1'))('app');var pm2=require('./config/pm2');var pm2Config=require('./config/pm2/config');var schedule=require(_0x8133('0x2'));var chat=require(_0x8133('0x3'));var whatsapp=require('./config/schedule/whatsapp');var transcribe=require('./config/schedule/transcribe');function main(){return mysqldb['db']['sequelize'][_0x8133('0x4')]()[_0x8133('0x5')](function(){return rpc[_0x8133('0x6')]();})[_0x8133('0x5')](function(_0x29b0ef){logger[_0x8133('0x7')](_0x29b0ef);return chat[_0x8133('0x8')]();})[_0x8133('0x5')](function(){return whatsapp[_0x8133('0x8')]();})[_0x8133('0x5')](function(){return schedule[_0x8133('0x8')]();})['then'](function(){return transcribe[_0x8133('0x8')]();})['then'](function(_0x108242){logger['info'](_0x108242);return pm2[_0x8133('0x8')](pm2Config);})[_0x8133('0x5')](function(_0x4a5840){logger[_0x8133('0x7')]('Online\x20apps:',_[_0x8133('0x9')](_[_0x8133('0xa')](_0x4a5840,{'status':_0x8133('0xb')}),_0x8133('0xc'))[_0x8133('0xd')]());logger[_0x8133('0x7')](_0x8133('0xe'),_[_0x8133('0x9')](_['filter'](_0x4a5840,function(_0x1a9185){return _0x1a9185[_0x8133('0xf')]!=='online';}),_0x8133('0xc'))[_0x8133('0xd')]()||'None');config[_0x8133('0x10')]&&require(_0x8133('0x11'))[_0x8133('0x12')]();require(_0x8133('0x13'))[_0x8133('0x12')]();})[_0x8133('0x14')](function(_0x105804){logger[_0x8133('0x15')](_0x8133('0x16'),_0x105804);process[_0x8133('0x17')](0x1);});}main(); \ No newline at end of file +var _0xf4c4=['./config/logger','app','./config/pm2/config','./config/schedule','./config/schedule/chat','./config/schedule/whatsapp','./config/schedule/transcribe','sequelize','sync','then','listen','info','start','Online\x20apps:','map','online','name','Offline\x20apps:','filter','status','join','None','seedDB','./config/seedDB','default','./config/license','catch','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','./mysqldb','./rpc'];(function(_0x5949b8,_0x1f4610){var _0x50ddb3=function(_0x4d097f){while(--_0x4d097f){_0x5949b8['push'](_0x5949b8['shift']());}};_0x50ddb3(++_0x1f4610);}(_0xf4c4,0xee));var _0x4f4c=function(_0x44ca6e,_0x5e2c91){_0x44ca6e=_0x44ca6e-0x0;var _0x2edab2=_0xf4c4[_0x44ca6e];return _0x2edab2;};'use strict';var _=require('lodash');var mysqldb=require(_0x4f4c('0x0'));var rpc=require(_0x4f4c('0x1'));var config=require('./config/environment');var logger=require(_0x4f4c('0x2'))(_0x4f4c('0x3'));var pm2=require('./config/pm2');var pm2Config=require(_0x4f4c('0x4'));var schedule=require(_0x4f4c('0x5'));var chat=require(_0x4f4c('0x6'));var whatsapp=require(_0x4f4c('0x7'));var transcribe=require(_0x4f4c('0x8'));function main(){return mysqldb['db'][_0x4f4c('0x9')][_0x4f4c('0xa')]()[_0x4f4c('0xb')](function(){return rpc[_0x4f4c('0xc')]();})['then'](function(_0x4cd894){logger[_0x4f4c('0xd')](_0x4cd894);return chat['start']();})['then'](function(){return whatsapp[_0x4f4c('0xe')]();})['then'](function(){return schedule['start']();})[_0x4f4c('0xb')](function(){return transcribe[_0x4f4c('0xe')]();})[_0x4f4c('0xb')](function(_0x33b6ff){logger[_0x4f4c('0xd')](_0x33b6ff);return pm2[_0x4f4c('0xe')](pm2Config);})[_0x4f4c('0xb')](function(_0x105fa1){logger[_0x4f4c('0xd')](_0x4f4c('0xf'),_[_0x4f4c('0x10')](_['filter'](_0x105fa1,{'status':_0x4f4c('0x11')}),_0x4f4c('0x12'))['join']());logger[_0x4f4c('0xd')](_0x4f4c('0x13'),_[_0x4f4c('0x10')](_[_0x4f4c('0x14')](_0x105fa1,function(_0x26b9fd){return _0x26b9fd[_0x4f4c('0x15')]!==_0x4f4c('0x11');}),'name')[_0x4f4c('0x16')]()||_0x4f4c('0x17'));config[_0x4f4c('0x18')]&&require(_0x4f4c('0x19'))[_0x4f4c('0x1a')]();require(_0x4f4c('0x1b'))[_0x4f4c('0x1a')]();})[_0x4f4c('0x1c')](function(_0x34e081){logger['error'](_0x4f4c('0x1d'),_0x34e081);process['exit'](0x1);});}main(); \ No newline at end of file diff --git a/server/components/auth/service.js b/server/components/auth/service.js index de970d7..cde98c5 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 _0xc019=['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~!@#$%^&-_=+[{]}.','validatePasswordHistory','decryptString','split','toLowerCase','format','The\x20password\x20must\x20be\x20different\x20from\x20the\x20last\x20one.\x20Please\x20choose\x20another\x20one.','length','splice','unshift','encryptString','join','promisify','sign','payload','options','verify','randomBytes','toString','hex','floor','now','../../config/environment','../../config/license/util','../encryptor','lodash','jsonwebtoken','basic-auth','crypto','bluebird','util','secrets','session','role','name','internal','email','userpic','permissions','md5secret','chatPause','mailPause','faxPause','smsPause','openchannelPause','pauseType','showWebBar','lastLoginAt','lastPauseAt','crudPermissions','allowmessenger','passwordResetAt','alias','phoneBarDnd','phoneBarEnableDtmfTone','phoneBarEnableSettings','phoneBarPrefixRequired','phoneBarRemoteControlPort','interface','userProfileId','privacyEnabled','downloadOmnichannelInteractions','downloadAttachments','use','user','ChatInteraction','findOne','closed','then','status','disposition','unmanaged','json','Unmanaged.','Forbidden.','isAuthenticated','headers','authorization','Basic','User','find','authenticate','pass','Wrong\x20credentials.','catch','startsWith','Bearer','Unknown\x20authorization\x20format','query','apikey','getUuid','sub','Setting','allowedLoginAttempts','blockDuration','isEqual','apiKeyNonce','nonce','disabled','Invalid\x20API\x20access\x20key','blockedAt','add','User\x20object\x20not\x20found.','canUpdate','getLicense','update','Forbidden','isMiddleware','signToken','setTokenCookie','It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.','cookie','motion.token','redirect','send','retrieveApiKey','isNil','apiKeyIat'];(function(_0x2448c4,_0x44220e){var _0x3f2e84=function(_0x183cda){while(--_0x183cda){_0x2448c4['push'](_0x2448c4['shift']());}};_0x3f2e84(++_0x44220e);}(_0xc019,0x117));var _0x9c01=function(_0x49af93,_0x35505c){_0x49af93=_0x49af93-0x0;var _0x4b5b8f=_0xc019[_0x49af93];return _0x4b5b8f;};'use strict';var db=require('../../mysqldb')['db'];var config=require(_0x9c01('0x0'));var hardwareConf=require('../../config/license/hardware');var licenseUtil=require(_0x9c01('0x1'));var encryptor=require(_0x9c01('0x2'));var _=require(_0x9c01('0x3'));var jwt=require(_0x9c01('0x4'));var expressJwt=require('express-jwt');var compose=require('composable-middleware');var basicAuth=require(_0x9c01('0x5'));var crypto=require(_0x9c01('0x6'));var BPromise=require(_0x9c01('0x7'));var util=require(_0x9c01('0x8'));var moment=require('moment');var validateJwt=expressJwt({'secret':config[_0x9c01('0x9')][_0x9c01('0xa')]});var userAttributes=['id',_0x9c01('0xb'),'fullname',_0x9c01('0xc'),_0x9c01('0xd'),_0x9c01('0xe'),_0x9c01('0xf'),_0x9c01('0x10'),_0x9c01('0x11'),'voicePause',_0x9c01('0x12'),_0x9c01('0x13'),_0x9c01('0x14'),_0x9c01('0x15'),_0x9c01('0x16'),_0x9c01('0x17'),_0x9c01('0x18'),_0x9c01('0x19'),_0x9c01('0x1a'),_0x9c01('0x1b'),_0x9c01('0x1c'),_0x9c01('0x1d'),_0x9c01('0x1e'),'phoneBarAutoAnswer','phoneBarAutoAnswerDelay',_0x9c01('0x1f'),'phoneBarEnableRecording',_0x9c01('0x20'),_0x9c01('0x21'),'phoneBarExpires',_0x9c01('0x22'),'phoneBarRemoteControl',_0x9c01('0x23'),'hotdesk',_0x9c01('0x24'),_0x9c01('0x25'),_0x9c01('0x26'),'settingsEnabled','wssPort','downloadVoiceRecordings',_0x9c01('0x27'),_0x9c01('0x28')];exports['isChatInteractionAuthorized']=function(){return this['isAuthenticated'](!![])[_0x9c01('0x29')](function(_0x45e171,_0x23d577,_0x4d840a){if(_0x45e171[_0x9c01('0x2a')]){_0x4d840a();}else{return db[_0x9c01('0x2b')][_0x9c01('0x2c')]({'where':{'id':_0x45e171['params']['id']},'attributes':['id',_0x9c01('0x2d'),'disposition'],'raw':!![]})[_0x9c01('0x2e')](function(_0x52c05c){if(_0x52c05c&&_0x52c05c[_0x9c01('0x2d')]){return _0x23d577[_0x9c01('0x2f')](_0x52c05c[_0x9c01('0x30')]===_0x9c01('0x31')?0x195:0x193)[_0x9c01('0x32')]({'message':_0x52c05c[_0x9c01('0x30')]===_0x9c01('0x31')?_0x9c01('0x33'):_0x9c01('0x34')});}else{_0x4d840a();}})['catch'](function(_0xcd00c5){_0x4d840a(_0xcd00c5);});}});};exports[_0x9c01('0x35')]=function isAuthenticated(_0x45b8fe){return compose()[_0x9c01('0x29')](function(_0x4af058,_0x339ec9,_0x262a54){var _0x461c9b;if(_0x4af058[_0x9c01('0x36')][_0x9c01('0x37')]){if(_['startsWith'](_0x4af058[_0x9c01('0x36')][_0x9c01('0x37')],_0x9c01('0x38'))){var _0x3e7d59=basicAuth(_0x4af058);db[_0x9c01('0x39')][_0x9c01('0x3a')]({'where':{'name':_0x3e7d59[_0x9c01('0xc')]}})[_0x9c01('0x2e')](function(_0x40853b){if(!_0x40853b||!_0x40853b[_0x9c01('0x3b')](_0x3e7d59[_0x9c01('0x3c')])){return _0x339ec9[_0x9c01('0x2f')](0x191)[_0x9c01('0x32')]({'message':_0x9c01('0x3d')});}_0x4af058['user']={'id':_0x40853b['id']};_0x262a54();})[_0x9c01('0x3e')](function(_0x117730){_0x262a54(_0x117730);});}else if(_[_0x9c01('0x3f')](_0x4af058['headers']['authorization'],_0x9c01('0x40'))){validateJwt(_0x4af058,_0x339ec9,_0x262a54);}else{if(_0x45b8fe){_0x262a54();}else{return _0x339ec9['status'](0x193)[_0x9c01('0x32')]({'message':_0x9c01('0x41')});}}}else if(_0x4af058[_0x9c01('0x42')][_0x9c01('0x43')]){try{var _0x2a245a={'audience':hardwareConf['getUuid'](),'issuer':hardwareConf[_0x9c01('0x44')]()};verifyJwt(_0x4af058[_0x9c01('0x42')][_0x9c01('0x43')],_0x2a245a)[_0x9c01('0x2e')](function(_0x289024){return db[_0x9c01('0x39')][_0x9c01('0x3a')]({'where':{'id':_0x289024[_0x9c01('0x45')]}})['then'](function(_0x3af232){_0x461c9b=_0x3af232;return db[_0x9c01('0x46')][_0x9c01('0x2c')]({'where':{'id':0x1},'attributes':[_0x9c01('0x47'),_0x9c01('0x48')],'raw':!![]});})[_0x9c01('0x2e')](function(_0x2a0e73){if(!_0x461c9b||!_[_0x9c01('0x49')](_0x461c9b[_0x9c01('0x4a')],_0x289024[_0x9c01('0x4b')])){return _0x339ec9[_0x9c01('0x2f')](0x191)[_0x9c01('0x32')]({'message':'API\x20access\x20key\x20is\x20not\x20valid\x20anymore'});}if(_0x461c9b[_0x9c01('0x4c')]){return _0x339ec9[_0x9c01('0x2f')](0x191)[_0x9c01('0x32')]({'message':_0x9c01('0x4d')});}if(_0x461c9b['blocked']){if(_0x2a0e73[_0x9c01('0x48')]>0x0){if(moment(_0x461c9b[_0x9c01('0x4e')])[_0x9c01('0x4f')](_0x2a0e73[_0x9c01('0x48')],'minutes')>moment()){return _0x339ec9[_0x9c01('0x2f')](0x191)[_0x9c01('0x32')]({'message':'Invalid\x20API\x20access\x20key'});}}else{return _0x339ec9[_0x9c01('0x2f')](0x191)[_0x9c01('0x32')]({'message':_0x9c01('0x4d')});}}_0x4af058[_0x9c01('0x2a')]={'id':_0x461c9b['id']};_0x262a54();});})[_0x9c01('0x3e')](function(){return _0x339ec9[_0x9c01('0x2f')](0x191)[_0x9c01('0x32')]({'message':'Invalid\x20API\x20access\x20key'});});}catch(_0x9bd08e){_0x262a54(_0x9bd08e);}}else if(_0x45b8fe){_0x262a54();}else{return _0x339ec9[_0x9c01('0x2f')](0x193)[_0x9c01('0x32')]({'message':_0x9c01('0x41')});}})[_0x9c01('0x29')](function(_0x42887f,_0x1fa31f,_0x489154){if(_0x42887f['user']){db[_0x9c01('0x39')][_0x9c01('0x3a')]({'where':{'id':_0x42887f[_0x9c01('0x2a')]['id']},'attributes':userAttributes})[_0x9c01('0x2e')](function(_0x220341){if(!_0x220341){return _0x1fa31f['status'](0x194)[_0x9c01('0x32')]({'message':'User\x20not\x20found.'});}_0x42887f['user']=_0x220341;_0x489154();})[_0x9c01('0x3e')](function(_0x16d682){_0x489154(_0x16d682);});}else if(_0x45b8fe){_0x489154();}else{return _0x1fa31f[_0x9c01('0x2f')](0x194)[_0x9c01('0x32')]({'message':_0x9c01('0x50')});}});};exports[_0x9c01('0x51')]=function canUpdate(){return compose()[_0x9c01('0x29')](function(_0x4f50ce,_0x31cd52,_0x207223){return licenseUtil[_0x9c01('0x52')]()[_0x9c01('0x2e')](function(_0x48978d){if(_0x48978d[_0x9c01('0x53')]){_0x207223();}else{return _0x31cd52[_0x9c01('0x2f')](0x193)[_0x9c01('0x32')]({'message':_0x9c01('0x54')});}})[_0x9c01('0x3e')](function(_0x486453){_0x207223(_0x486453);});});};exports[_0x9c01('0x55')]=function(_0x14e968,_0x2c5051,_0x40d1fc){_0x14e968[_0x9c01('0x55')]=!![];return _0x40d1fc();};exports[_0x9c01('0x56')]=function signToken(_0x41eef1){return signJwt(_0x41eef1);};exports[_0x9c01('0x57')]=function(_0x351f4d,_0x21c634){if(!_0x351f4d[_0x9c01('0x2a')]){return _0x21c634['status'](0x194)[_0x9c01('0x32')]({'message':_0x9c01('0x58')});}var _0x2c7075={'payload':{'id':_0x351f4d['user']['id'],'role':_0x351f4d[_0x9c01('0x2a')]['role']},'options':{'expiresIn':0x15180}};return signJwt(_0x2c7075)['then'](function(_0x383c29){_0x21c634[_0x9c01('0x59')](_0x9c01('0x5a'),_0x383c29);_0x21c634[_0x9c01('0x5b')]('/dashboards/general');})[_0x9c01('0x3e')](function(_0x2a9088){return _0x21c634[_0x9c01('0x2f')](0x1f4)[_0x9c01('0x5c')](_0x2a9088);});};exports[_0x9c01('0x5d')]=function(_0x34abf5){if(_[_0x9c01('0x5e')](_0x34abf5['apiKeyNonce'])||_[_0x9c01('0x5e')](_0x34abf5[_0x9c01('0x5f')])){return null;}else{return createJwt(_0x34abf5);}};exports[_0x9c01('0x60')]=function(_0x327337){_0x327337['apiKeyNonce']=generateNonce();_0x327337[_0x9c01('0x5f')]=generateIssuedAt();return createJwt(_0x327337);};exports[_0x9c01('0x61')]=function(_0x5ab391,_0x568724){var _0x5c3d91=_0x5ab391['query'][_0x9c01('0x43')];if(_0x5c3d91){var _0x56ac34={'nonce':_0x568724['apiKeyNonce'],'iat':_0x568724[_0x9c01('0x5f')],'audience':hardwareConf[_0x9c01('0x44')](),'issuer':hardwareConf[_0x9c01('0x44')]()};return verifyJwt(_0x5c3d91,_0x56ac34)[_0x9c01('0x2e')](function(){return generateApiKey(_0x568724);});}else{throw{'message':_0x9c01('0x62')};}};exports[_0x9c01('0x63')]=function(_0x4869ee){var _0xff007f=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0xff007f[_0x9c01('0x64')](_0x4869ee))throw new db[(_0x9c01('0x65'))][(_0x9c01('0x66'))](_0x9c01('0x67'));return;};exports[_0x9c01('0x68')]=function(_0x5bd6fd,_0x512a60,_0x31f394){var _0x39214f=encryptor[_0x9c01('0x69')](_0x512a60)[_0x9c01('0x6a')](',');for(var _0x524647=0x0;_0x524647<_0x31f394;_0x524647++){if(!_0x39214f[_0x524647])break;if(_0x5bd6fd[_0x9c01('0x6b')]()===_0x39214f[_0x524647][_0x9c01('0x6b')]()){var _0x41489c=util[_0x9c01('0x6c')]('The\x20password\x20must\x20be\x20different\x20from\x20the\x20previous\x20%d\x20passwords.\x20Please\x20choose\x20another\x20one.',_0x31f394);if(_0x31f394===0x1){_0x41489c=_0x9c01('0x6d');}throw new db[(_0x9c01('0x65'))]['ValidationError'](_0x41489c);}}return;};exports['updatePasswordsHistory']=function(_0x4477fd,_0x5a07ae){var _0x1992c0=_0x5a07ae?encryptor[_0x9c01('0x69')](_0x5a07ae)[_0x9c01('0x6a')](','):[];if(_0x1992c0[_0x9c01('0x6e')]===0x5){_0x1992c0[_0x9c01('0x6f')](-0x1,0x1);}_0x1992c0[_0x9c01('0x70')](_0x4477fd);return encryptor[_0x9c01('0x71')](_0x1992c0[_0x9c01('0x72')](','));};function signJwt(_0x5641df){var _0x23ca17=BPromise[_0x9c01('0x73')](jwt[_0x9c01('0x74')],{'context':jwt});var _0x3904e9=_0x5641df['secret']||config[_0x9c01('0x9')]['session'];return new BPromise(function(_0x4c0939,_0x1e4984){_0x23ca17(_0x5641df[_0x9c01('0x75')],_0x3904e9,_0x5641df[_0x9c01('0x76')])[_0x9c01('0x2e')](function(_0x3bfbc5){_0x4c0939(_0x3bfbc5);})[_0x9c01('0x3e')](function(_0x41a38d){_0x1e4984(_0x41a38d);});});}function verifyJwt(_0x3ded2e,_0x5e552e,_0x387285){var _0x20f87b=BPromise['promisify'](jwt[_0x9c01('0x77')],{'context':jwt});var _0x5778ec=_0x387285||config['secrets'][_0x9c01('0xa')];return new BPromise(function(_0xe56881,_0x5121e0){_0x20f87b(_0x3ded2e,_0x5778ec,_0x5e552e)[_0x9c01('0x2e')](function(_0x457bbd){_0xe56881(_0x457bbd);})[_0x9c01('0x3e')](function(_0x80139c){_0x5121e0(_0x80139c);});});}function generateNonce(){return crypto[_0x9c01('0x78')](0x10)[_0x9c01('0x79')](_0x9c01('0x7a'));}function generateIssuedAt(){return Math[_0x9c01('0x7b')](Date[_0x9c01('0x7c')]()/0x3e8)['toString']();}function createJwt(_0xd685ca){var _0xad4c00={'payload':{'iat':_0xd685ca['apiKeyIat'],'nonce':_0xd685ca[_0x9c01('0x4a')]},'options':{'algorithm':'HS512','subject':_0xd685ca['id']['toString'](),'issuer':hardwareConf[_0x9c01('0x44')](),'audience':hardwareConf[_0x9c01('0x44')]()}};return signJwt(_0xad4c00)['then'](function(_0x108b76){return{'iat':_0xd685ca[_0x9c01('0x5f')],'nonce':_0xd685ca[_0x9c01('0x4a')],'token':_0x108b76};});} \ No newline at end of file +var _0x4c9f=['retrieveApiKey','isNil','apiKeyIat','Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one','validatePasswordPattern','test','Sequelize','ValidationError','split','toLowerCase','format','The\x20password\x20must\x20be\x20different\x20from\x20the\x20previous\x20%d\x20passwords.\x20Please\x20choose\x20another\x20one.','The\x20password\x20must\x20be\x20different\x20from\x20the\x20last\x20one.\x20Please\x20choose\x20another\x20one.','updatePasswordsHistory','length','splice','unshift','encryptString','join','promisify','secret','payload','verify','randomBytes','toString','hex','floor','now','../../config/environment','../../config/license/hardware','../../config/license/util','../encryptor','lodash','jsonwebtoken','express-jwt','composable-middleware','util','moment','secrets','session','role','name','email','userpic','permissions','md5secret','voicePause','mailPause','faxPause','openchannelPause','pauseType','showWebBar','lastLoginAt','lastPauseAt','crudPermissions','allowmessenger','passwordResetAt','phoneBarAutoAnswer','phoneBarAutoAnswerDelay','phoneBarEnableDtmfTone','phoneBarPrefixRequired','phoneBarRemoteControl','hotdesk','interface','userProfileId','privacyEnabled','settingsEnabled','wssPort','downloadVoiceRecordings','downloadOmnichannelInteractions','isChatInteractionAuthorized','isAuthenticated','use','ChatInteraction','params','closed','disposition','status','json','Unmanaged.','Forbidden.','catch','headers','authorization','startsWith','Basic','then','authenticate','pass','Wrong\x20credentials.','user','Bearer','query','getUuid','apikey','User','find','findOne','allowedLoginAttempts','isEqual','apiKeyNonce','nonce','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','disabled','Invalid\x20API\x20access\x20key','blocked','blockDuration','blockedAt','minutes','User\x20object\x20not\x20found.','canUpdate','getLicense','update','Forbidden','isMiddleware','signToken','setTokenCookie','It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.','cookie','motion.token','redirect','/dashboards/general','send'];(function(_0x45edcd,_0x16b159){var _0xea0a8f=function(_0x3679e6){while(--_0x3679e6){_0x45edcd['push'](_0x45edcd['shift']());}};_0xea0a8f(++_0x16b159);}(_0x4c9f,0x112));var _0xf4c9=function(_0x3ced2d,_0x3d85e7){_0x3ced2d=_0x3ced2d-0x0;var _0xa582d4=_0x4c9f[_0x3ced2d];return _0xa582d4;};'use strict';var db=require('../../mysqldb')['db'];var config=require(_0xf4c9('0x0'));var hardwareConf=require(_0xf4c9('0x1'));var licenseUtil=require(_0xf4c9('0x2'));var encryptor=require(_0xf4c9('0x3'));var _=require(_0xf4c9('0x4'));var jwt=require(_0xf4c9('0x5'));var expressJwt=require(_0xf4c9('0x6'));var compose=require(_0xf4c9('0x7'));var basicAuth=require('basic-auth');var crypto=require('crypto');var BPromise=require('bluebird');var util=require(_0xf4c9('0x8'));var moment=require(_0xf4c9('0x9'));var validateJwt=expressJwt({'secret':config[_0xf4c9('0xa')][_0xf4c9('0xb')]});var userAttributes=['id',_0xf4c9('0xc'),'fullname',_0xf4c9('0xd'),'internal',_0xf4c9('0xe'),_0xf4c9('0xf'),_0xf4c9('0x10'),_0xf4c9('0x11'),_0xf4c9('0x12'),'chatPause',_0xf4c9('0x13'),_0xf4c9('0x14'),'smsPause',_0xf4c9('0x15'),_0xf4c9('0x16'),_0xf4c9('0x17'),_0xf4c9('0x18'),_0xf4c9('0x19'),_0xf4c9('0x1a'),_0xf4c9('0x1b'),_0xf4c9('0x1c'),'alias',_0xf4c9('0x1d'),_0xf4c9('0x1e'),'phoneBarDnd','phoneBarEnableRecording',_0xf4c9('0x1f'),'phoneBarEnableSettings','phoneBarExpires',_0xf4c9('0x20'),_0xf4c9('0x21'),'phoneBarRemoteControlPort',_0xf4c9('0x22'),_0xf4c9('0x23'),_0xf4c9('0x24'),_0xf4c9('0x25'),_0xf4c9('0x26'),_0xf4c9('0x27'),_0xf4c9('0x28'),_0xf4c9('0x29'),'downloadAttachments'];exports[_0xf4c9('0x2a')]=function(){return this[_0xf4c9('0x2b')](!![])[_0xf4c9('0x2c')](function(_0xe0042d,_0x5d919d,_0x3e4cdc){if(_0xe0042d['user']){_0x3e4cdc();}else{return db[_0xf4c9('0x2d')]['findOne']({'where':{'id':_0xe0042d[_0xf4c9('0x2e')]['id']},'attributes':['id',_0xf4c9('0x2f'),_0xf4c9('0x30')],'raw':!![]})['then'](function(_0x4fe591){if(_0x4fe591&&_0x4fe591[_0xf4c9('0x2f')]){return _0x5d919d[_0xf4c9('0x31')](_0x4fe591[_0xf4c9('0x30')]==='unmanaged'?0x195:0x193)[_0xf4c9('0x32')]({'message':_0x4fe591[_0xf4c9('0x30')]==='unmanaged'?_0xf4c9('0x33'):_0xf4c9('0x34')});}else{_0x3e4cdc();}})[_0xf4c9('0x35')](function(_0x479d5f){_0x3e4cdc(_0x479d5f);});}});};exports['isAuthenticated']=function isAuthenticated(_0x227672){return compose()['use'](function(_0x308ebb,_0x48a9de,_0xdcab89){var _0x231429;if(_0x308ebb[_0xf4c9('0x36')][_0xf4c9('0x37')]){if(_[_0xf4c9('0x38')](_0x308ebb[_0xf4c9('0x36')][_0xf4c9('0x37')],_0xf4c9('0x39'))){var _0x466d62=basicAuth(_0x308ebb);db['User']['find']({'where':{'name':_0x466d62['name']}})[_0xf4c9('0x3a')](function(_0x253812){if(!_0x253812||!_0x253812[_0xf4c9('0x3b')](_0x466d62[_0xf4c9('0x3c')])){return _0x48a9de[_0xf4c9('0x31')](0x191)[_0xf4c9('0x32')]({'message':_0xf4c9('0x3d')});}_0x308ebb[_0xf4c9('0x3e')]={'id':_0x253812['id']};_0xdcab89();})[_0xf4c9('0x35')](function(_0x33d859){_0xdcab89(_0x33d859);});}else if(_[_0xf4c9('0x38')](_0x308ebb[_0xf4c9('0x36')]['authorization'],_0xf4c9('0x3f'))){validateJwt(_0x308ebb,_0x48a9de,_0xdcab89);}else{if(_0x227672){_0xdcab89();}else{return _0x48a9de[_0xf4c9('0x31')](0x193)[_0xf4c9('0x32')]({'message':'Unknown\x20authorization\x20format'});}}}else if(_0x308ebb[_0xf4c9('0x40')]['apikey']){try{var _0x3b47bf={'audience':hardwareConf[_0xf4c9('0x41')](),'issuer':hardwareConf[_0xf4c9('0x41')]()};verifyJwt(_0x308ebb[_0xf4c9('0x40')][_0xf4c9('0x42')],_0x3b47bf)[_0xf4c9('0x3a')](function(_0x3fc27d){return db[_0xf4c9('0x43')][_0xf4c9('0x44')]({'where':{'id':_0x3fc27d['sub']}})['then'](function(_0x189741){_0x231429=_0x189741;return db['Setting'][_0xf4c9('0x45')]({'where':{'id':0x1},'attributes':[_0xf4c9('0x46'),'blockDuration'],'raw':!![]});})['then'](function(_0x1f6003){if(!_0x231429||!_[_0xf4c9('0x47')](_0x231429[_0xf4c9('0x48')],_0x3fc27d[_0xf4c9('0x49')])){return _0x48a9de[_0xf4c9('0x31')](0x191)[_0xf4c9('0x32')]({'message':_0xf4c9('0x4a')});}if(_0x231429[_0xf4c9('0x4b')]){return _0x48a9de[_0xf4c9('0x31')](0x191)[_0xf4c9('0x32')]({'message':_0xf4c9('0x4c')});}if(_0x231429[_0xf4c9('0x4d')]){if(_0x1f6003[_0xf4c9('0x4e')]>0x0){if(moment(_0x231429[_0xf4c9('0x4f')])['add'](_0x1f6003['blockDuration'],_0xf4c9('0x50'))>moment()){return _0x48a9de[_0xf4c9('0x31')](0x191)[_0xf4c9('0x32')]({'message':_0xf4c9('0x4c')});}}else{return _0x48a9de[_0xf4c9('0x31')](0x191)[_0xf4c9('0x32')]({'message':_0xf4c9('0x4c')});}}_0x308ebb[_0xf4c9('0x3e')]={'id':_0x231429['id']};_0xdcab89();});})[_0xf4c9('0x35')](function(){return _0x48a9de[_0xf4c9('0x31')](0x191)['json']({'message':'Invalid\x20API\x20access\x20key'});});}catch(_0x451f10){_0xdcab89(_0x451f10);}}else if(_0x227672){_0xdcab89();}else{return _0x48a9de[_0xf4c9('0x31')](0x193)[_0xf4c9('0x32')]({'message':'Unknown\x20authorization\x20format'});}})['use'](function(_0x2aeffd,_0x3f8147,_0x5620b2){if(_0x2aeffd[_0xf4c9('0x3e')]){db[_0xf4c9('0x43')][_0xf4c9('0x44')]({'where':{'id':_0x2aeffd[_0xf4c9('0x3e')]['id']},'attributes':userAttributes})[_0xf4c9('0x3a')](function(_0x1c869d){if(!_0x1c869d){return _0x3f8147[_0xf4c9('0x31')](0x194)[_0xf4c9('0x32')]({'message':'User\x20not\x20found.'});}_0x2aeffd[_0xf4c9('0x3e')]=_0x1c869d;_0x5620b2();})['catch'](function(_0x18c94e){_0x5620b2(_0x18c94e);});}else if(_0x227672){_0x5620b2();}else{return _0x3f8147['status'](0x194)[_0xf4c9('0x32')]({'message':_0xf4c9('0x51')});}});};exports[_0xf4c9('0x52')]=function canUpdate(){return compose()[_0xf4c9('0x2c')](function(_0xfe49bd,_0x46aff5,_0x14af48){return licenseUtil[_0xf4c9('0x53')]()['then'](function(_0x784b07){if(_0x784b07[_0xf4c9('0x54')]){_0x14af48();}else{return _0x46aff5['status'](0x193)[_0xf4c9('0x32')]({'message':_0xf4c9('0x55')});}})[_0xf4c9('0x35')](function(_0x2c4c0b){_0x14af48(_0x2c4c0b);});});};exports[_0xf4c9('0x56')]=function(_0x1c1d69,_0x26a7be,_0x35281f){_0x1c1d69[_0xf4c9('0x56')]=!![];return _0x35281f();};exports[_0xf4c9('0x57')]=function signToken(_0x5e3fc2){return signJwt(_0x5e3fc2);};exports[_0xf4c9('0x58')]=function(_0x2c8f5a,_0x1a3523){if(!_0x2c8f5a[_0xf4c9('0x3e')]){return _0x1a3523[_0xf4c9('0x31')](0x194)[_0xf4c9('0x32')]({'message':_0xf4c9('0x59')});}var _0x3f5d86={'payload':{'id':_0x2c8f5a[_0xf4c9('0x3e')]['id'],'role':_0x2c8f5a[_0xf4c9('0x3e')][_0xf4c9('0xc')]},'options':{'expiresIn':0x15180}};return signJwt(_0x3f5d86)[_0xf4c9('0x3a')](function(_0x16355c){_0x1a3523[_0xf4c9('0x5a')](_0xf4c9('0x5b'),_0x16355c);_0x1a3523[_0xf4c9('0x5c')](_0xf4c9('0x5d'));})[_0xf4c9('0x35')](function(_0xbb2986){return _0x1a3523['status'](0x1f4)[_0xf4c9('0x5e')](_0xbb2986);});};exports[_0xf4c9('0x5f')]=function(_0xf7f3a4){if(_['isNil'](_0xf7f3a4['apiKeyNonce'])||_[_0xf4c9('0x60')](_0xf7f3a4[_0xf4c9('0x61')])){return null;}else{return createJwt(_0xf7f3a4);}};exports['generateApiKey']=function(_0x43615a){_0x43615a[_0xf4c9('0x48')]=generateNonce();_0x43615a[_0xf4c9('0x61')]=generateIssuedAt();return createJwt(_0x43615a);};exports['regenerateApiKey']=function(_0x3a9ece,_0x3ef8a4){var _0xe3a68f=_0x3a9ece['query'][_0xf4c9('0x42')];if(_0xe3a68f){var _0x360fc3={'nonce':_0x3ef8a4[_0xf4c9('0x48')],'iat':_0x3ef8a4[_0xf4c9('0x61')],'audience':hardwareConf[_0xf4c9('0x41')](),'issuer':hardwareConf[_0xf4c9('0x41')]()};return verifyJwt(_0xe3a68f,_0x360fc3)[_0xf4c9('0x3a')](function(){return generateApiKey(_0x3ef8a4);});}else{throw{'message':_0xf4c9('0x62')};}};exports[_0xf4c9('0x63')]=function(_0x41321a){var _0x332f4f=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0x332f4f[_0xf4c9('0x64')](_0x41321a))throw new db[(_0xf4c9('0x65'))][(_0xf4c9('0x66'))]('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');return;};exports['validatePasswordHistory']=function(_0x5b8c90,_0x524a88,_0x39538c){var _0x121770=encryptor['decryptString'](_0x524a88)[_0xf4c9('0x67')](',');for(var _0x376b6e=0x0;_0x376b6e<_0x39538c;_0x376b6e++){if(!_0x121770[_0x376b6e])break;if(_0x5b8c90['toLowerCase']()===_0x121770[_0x376b6e][_0xf4c9('0x68')]()){var _0x7b69ad=util[_0xf4c9('0x69')](_0xf4c9('0x6a'),_0x39538c);if(_0x39538c===0x1){_0x7b69ad=_0xf4c9('0x6b');}throw new db[(_0xf4c9('0x65'))][(_0xf4c9('0x66'))](_0x7b69ad);}}return;};exports[_0xf4c9('0x6c')]=function(_0x206552,_0x335bff){var _0x36cef3=_0x335bff?encryptor['decryptString'](_0x335bff)[_0xf4c9('0x67')](','):[];if(_0x36cef3[_0xf4c9('0x6d')]===0x5){_0x36cef3[_0xf4c9('0x6e')](-0x1,0x1);}_0x36cef3[_0xf4c9('0x6f')](_0x206552);return encryptor[_0xf4c9('0x70')](_0x36cef3[_0xf4c9('0x71')](','));};function signJwt(_0x1278be){var _0x9f6299=BPromise[_0xf4c9('0x72')](jwt['sign'],{'context':jwt});var _0x18b8eb=_0x1278be[_0xf4c9('0x73')]||config[_0xf4c9('0xa')][_0xf4c9('0xb')];return new BPromise(function(_0x403a3a,_0x81f9ad){_0x9f6299(_0x1278be[_0xf4c9('0x74')],_0x18b8eb,_0x1278be['options'])['then'](function(_0x299acf){_0x403a3a(_0x299acf);})[_0xf4c9('0x35')](function(_0x1f38f6){_0x81f9ad(_0x1f38f6);});});}function verifyJwt(_0x1cd36a,_0x2592cb,_0x1d051e){var _0x1c1ac0=BPromise[_0xf4c9('0x72')](jwt[_0xf4c9('0x75')],{'context':jwt});var _0x5a49ff=_0x1d051e||config[_0xf4c9('0xa')][_0xf4c9('0xb')];return new BPromise(function(_0x19a026,_0x57cb13){_0x1c1ac0(_0x1cd36a,_0x5a49ff,_0x2592cb)['then'](function(_0x53a17e){_0x19a026(_0x53a17e);})[_0xf4c9('0x35')](function(_0x4f71e1){_0x57cb13(_0x4f71e1);});});}function generateNonce(){return crypto[_0xf4c9('0x76')](0x10)[_0xf4c9('0x77')](_0xf4c9('0x78'));}function generateIssuedAt(){return Math[_0xf4c9('0x79')](Date[_0xf4c9('0x7a')]()/0x3e8)['toString']();}function createJwt(_0x45bbf9){var _0x91d307={'payload':{'iat':_0x45bbf9[_0xf4c9('0x61')],'nonce':_0x45bbf9[_0xf4c9('0x48')]},'options':{'algorithm':'HS512','subject':_0x45bbf9['id']['toString'](),'issuer':hardwareConf['getUuid'](),'audience':hardwareConf['getUuid']()}};return signJwt(_0x91d307)['then'](function(_0x4ff586){return{'iat':_0x45bbf9['apiKeyIat'],'nonce':_0x45bbf9[_0xf4c9('0x48')],'token':_0x4ff586};});} \ No newline at end of file diff --git a/server/components/encryptor/index.js b/server/components/encryptor/index.js index cbe38f9..e8de9a2 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 _0x01cb=['indexOf','hasOwnProperty','createReadStream','createWriteStream','data','update','binary','write','end','final','unlink','decryptFile','close','encryptString','secret','createCipher','base64','utf8','bluebird','lodash','../../config/environment','app','secrets','session','aes192','encrypt','algorithm','join','error','is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:','test','getCiphers'];(function(_0x4a00b3,_0x55bde8){var _0x4c0eb4=function(_0x560906){while(--_0x560906){_0x4a00b3['push'](_0x4a00b3['shift']());}};_0x4c0eb4(++_0x55bde8);}(_0x01cb,0x192));var _0xb01c=function(_0x1f36bb,_0x8af718){_0x1f36bb=_0x1f36bb-0x0;var _0xaf97fa=_0x01cb[_0x1f36bb];return _0xaf97fa;};'use strict';var crypto=require('crypto');var fs=require('fs');var BPromise=require(_0xb01c('0x0'));var _=require(_0xb01c('0x1'));var config=require(_0xb01c('0x2'));var logger=require('../../config/logger')(_0xb01c('0x3'));const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config[_0xb01c('0x4')][_0xb01c('0x5')],'algorithm':'aes-256-ctr'};const fileOptions={'algorithm':_0xb01c('0x6')};if(config[_0xb01c('0x7')]&&config['encrypt'][_0xb01c('0x8')]){var isSupported=isAlgorithmSupported(config['encrypt']['algorithm']);if(isSupported){fileOptions[_0xb01c('0x8')]=config[_0xb01c('0x7')][_0xb01c('0x8')];}else{var supportedAlgorithms=getSupportedCiphers()[_0xb01c('0x9')](',\x20');logger[_0xb01c('0xa')](config[_0xb01c('0x7')][_0xb01c('0x8')],_0xb01c('0xb'),supportedAlgorithms);}}function isASupportedCipher(_0x39144d){return AES_SUPPORTED_RX[_0xb01c('0xc')](_0x39144d);}function getSupportedCiphers(){return crypto[_0xb01c('0xd')]()['filter'](isASupportedCipher);}function isAlgorithmSupported(_0x9e513d){return getSupportedCiphers()[_0xb01c('0xe')](_0x9e513d)>-0x1;}function combineOptions(_0x497064){var _0x15ccdf={};for(var _0x375485 in fileOptions){if(fileOptions[_0xb01c('0xf')](_0x375485)){_0x15ccdf[_0x375485]=fileOptions[_0x375485];}}if(_0x497064){for(var _0x2d5880 in _0x497064){if(_0x497064['hasOwnProperty'](_0x2d5880)){_0x15ccdf[_0x2d5880]=_0x497064[_0x2d5880];}}}return _0x15ccdf;}exports['encryptFile']=function(_0x2afbc0,_0x51592c,_0x2e89e2,_0x492c5c){return new BPromise(function(_0x11e538,_0x3b87de){_0x492c5c=combineOptions(_0x492c5c);var _0x1a6d24=new Buffer(_0x2e89e2);var _0x44febc=fs[_0xb01c('0x10')](_0x2afbc0);var _0x5c0123=fs[_0xb01c('0x11')](_0x51592c);var _0x245c80=crypto['createCipher'](_0x492c5c['algorithm'],_0x1a6d24);_0x44febc['on'](_0xb01c('0x12'),function(_0x4ac3f3){var _0xed858f=new Buffer(_0x245c80[_0xb01c('0x13')](_0x4ac3f3),_0xb01c('0x14'));_0x5c0123[_0xb01c('0x15')](_0xed858f);});_0x44febc['on'](_0xb01c('0x16'),function(){try{var _0x24237d=new Buffer(_0x245c80[_0xb01c('0x17')](_0xb01c('0x14')),_0xb01c('0x14'));_0x5c0123[_0xb01c('0x15')](_0x24237d);_0x5c0123['end']();_0x5c0123['on']('close',function(){return _0x11e538(_0x51592c);});}catch(_0x17f74a){fs[_0xb01c('0x18')](_0x51592c);return _0x3b87de(_0x17f74a);}});});};exports[_0xb01c('0x19')]=function(_0x4a5c2d,_0x44dfed,_0x4ded82,_0x722884){return new BPromise(function(_0x3a050f,_0x5e868c){_0x722884=combineOptions(_0x722884);var _0x46fb8e=new Buffer(_0x4ded82);var _0x3c65ef=fs['createReadStream'](_0x4a5c2d);var _0xa05341=fs['createWriteStream'](_0x44dfed);var _0x245fb9=crypto['createDecipher'](_0x722884[_0xb01c('0x8')],_0x46fb8e);_0x3c65ef['on'](_0xb01c('0x12'),function(_0xae127b){var _0x54273d=new Buffer(_0x245fb9['update'](_0xae127b),'binary');_0xa05341[_0xb01c('0x15')](_0x54273d);});_0x3c65ef['on'](_0xb01c('0x16'),function(){try{var _0x59a599=new Buffer(_0x245fb9['final'](_0xb01c('0x14')),_0xb01c('0x14'));_0xa05341[_0xb01c('0x15')](_0x59a599);_0xa05341[_0xb01c('0x16')]();_0xa05341['on'](_0xb01c('0x1a'),function(){return _0x3a050f(_0x44dfed);});}catch(_0x2e9a1f){fs[_0xb01c('0x18')](_0x44dfed);return _0x5e868c(_0x2e9a1f);}});});};exports[_0xb01c('0x1b')]=function(_0x144d82,_0x5714f9,_0x247813){var _0x236825=_0x247813||stringOptions[_0xb01c('0x8')];var _0x14ffed=_0x5714f9||stringOptions[_0xb01c('0x1c')];var _0x18f3fb=crypto[_0xb01c('0x1d')](_0x236825,_0x14ffed);var _0x8a851a=_0x18f3fb[_0xb01c('0x13')](_0x144d82,'utf8',_0xb01c('0x1e'));_0x8a851a+=_0x18f3fb[_0xb01c('0x17')]('base64');return _0x8a851a;};exports['decryptString']=function(_0x45f3f3,_0x140a89,_0x292e82){var _0x3ffd35=_0x292e82||stringOptions[_0xb01c('0x8')];var _0xdd0216=_0x140a89||stringOptions[_0xb01c('0x1c')];var _0x1e0f39=crypto['createDecipher'](_0x3ffd35,_0xdd0216);var _0x5a51fd=_0x1e0f39[_0xb01c('0x13')](_0x45f3f3,_0xb01c('0x1e'),_0xb01c('0x1f'));_0x5a51fd+=_0x1e0f39[_0xb01c('0x17')]('utf8');return _0x5a51fd;}; \ No newline at end of file +var _0x3377=['lodash','../../config/environment','../../config/logger','app','secrets','aes-256-ctr','aes192','encrypt','algorithm','error','is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:','test','getCiphers','hasOwnProperty','encryptFile','createReadStream','createWriteStream','update','binary','write','end','final','close','unlink','decryptFile','createDecipher','encryptString','secret','createCipher','base64','utf8','crypto','bluebird'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3377,0x127));var _0x7337=function(_0x5cfc97,_0x5552c6){_0x5cfc97=_0x5cfc97-0x0;var _0x53a795=_0x3377[_0x5cfc97];return _0x53a795;};'use strict';var crypto=require(_0x7337('0x0'));var fs=require('fs');var BPromise=require(_0x7337('0x1'));var _=require(_0x7337('0x2'));var config=require(_0x7337('0x3'));var logger=require(_0x7337('0x4'))(_0x7337('0x5'));const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config[_0x7337('0x6')]['session'],'algorithm':_0x7337('0x7')};const fileOptions={'algorithm':_0x7337('0x8')};if(config[_0x7337('0x9')]&&config['encrypt'][_0x7337('0xa')]){var isSupported=isAlgorithmSupported(config[_0x7337('0x9')][_0x7337('0xa')]);if(isSupported){fileOptions['algorithm']=config[_0x7337('0x9')][_0x7337('0xa')];}else{var supportedAlgorithms=getSupportedCiphers()['join'](',\x20');logger[_0x7337('0xb')](config['encrypt'][_0x7337('0xa')],_0x7337('0xc'),supportedAlgorithms);}}function isASupportedCipher(_0xee6c6c){return AES_SUPPORTED_RX[_0x7337('0xd')](_0xee6c6c);}function getSupportedCiphers(){return crypto[_0x7337('0xe')]()['filter'](isASupportedCipher);}function isAlgorithmSupported(_0x2be82e){return getSupportedCiphers()['indexOf'](_0x2be82e)>-0x1;}function combineOptions(_0x31f695){var _0x22112f={};for(var _0x1c066e in fileOptions){if(fileOptions[_0x7337('0xf')](_0x1c066e)){_0x22112f[_0x1c066e]=fileOptions[_0x1c066e];}}if(_0x31f695){for(var _0x13b680 in _0x31f695){if(_0x31f695[_0x7337('0xf')](_0x13b680)){_0x22112f[_0x13b680]=_0x31f695[_0x13b680];}}}return _0x22112f;}exports[_0x7337('0x10')]=function(_0x527f71,_0x25ecc2,_0x11af84,_0x21e428){return new BPromise(function(_0x1c3d40,_0xcb1a31){_0x21e428=combineOptions(_0x21e428);var _0x291e2e=new Buffer(_0x11af84);var _0x5500c6=fs[_0x7337('0x11')](_0x527f71);var _0x120d42=fs[_0x7337('0x12')](_0x25ecc2);var _0x448f0a=crypto['createCipher'](_0x21e428[_0x7337('0xa')],_0x291e2e);_0x5500c6['on']('data',function(_0x2c36e1){var _0x2a909f=new Buffer(_0x448f0a[_0x7337('0x13')](_0x2c36e1),_0x7337('0x14'));_0x120d42[_0x7337('0x15')](_0x2a909f);});_0x5500c6['on'](_0x7337('0x16'),function(){try{var _0x3b63db=new Buffer(_0x448f0a[_0x7337('0x17')]('binary'),_0x7337('0x14'));_0x120d42[_0x7337('0x15')](_0x3b63db);_0x120d42[_0x7337('0x16')]();_0x120d42['on'](_0x7337('0x18'),function(){return _0x1c3d40(_0x25ecc2);});}catch(_0x170825){fs[_0x7337('0x19')](_0x25ecc2);return _0xcb1a31(_0x170825);}});});};exports[_0x7337('0x1a')]=function(_0x244313,_0x5183e6,_0x3e7b41,_0x6ec034){return new BPromise(function(_0x4ad01b,_0x4d4b7c){_0x6ec034=combineOptions(_0x6ec034);var _0x5af01e=new Buffer(_0x3e7b41);var _0x4ea234=fs[_0x7337('0x11')](_0x244313);var _0x1d9e61=fs['createWriteStream'](_0x5183e6);var _0x152f8c=crypto[_0x7337('0x1b')](_0x6ec034[_0x7337('0xa')],_0x5af01e);_0x4ea234['on']('data',function(_0x228253){var _0xd078ea=new Buffer(_0x152f8c['update'](_0x228253),_0x7337('0x14'));_0x1d9e61['write'](_0xd078ea);});_0x4ea234['on'](_0x7337('0x16'),function(){try{var _0x3de1f2=new Buffer(_0x152f8c['final'](_0x7337('0x14')),_0x7337('0x14'));_0x1d9e61[_0x7337('0x15')](_0x3de1f2);_0x1d9e61['end']();_0x1d9e61['on'](_0x7337('0x18'),function(){return _0x4ad01b(_0x5183e6);});}catch(_0xee4ba){fs[_0x7337('0x19')](_0x5183e6);return _0x4d4b7c(_0xee4ba);}});});};exports[_0x7337('0x1c')]=function(_0x367579,_0x237932,_0x5e9e90){var _0xf87f4f=_0x5e9e90||stringOptions[_0x7337('0xa')];var _0x188832=_0x237932||stringOptions[_0x7337('0x1d')];var _0x29c0a0=crypto[_0x7337('0x1e')](_0xf87f4f,_0x188832);var _0x28f4bd=_0x29c0a0['update'](_0x367579,'utf8',_0x7337('0x1f'));_0x28f4bd+=_0x29c0a0[_0x7337('0x17')]('base64');return _0x28f4bd;};exports['decryptString']=function(_0x363aa5,_0x42a704,_0x24a194){var _0x48dd02=_0x24a194||stringOptions[_0x7337('0xa')];var _0xc41f96=_0x42a704||stringOptions[_0x7337('0x1d')];var _0x5b0805=crypto[_0x7337('0x1b')](_0x48dd02,_0xc41f96);var _0x459dd0=_0x5b0805['update'](_0x363aa5,_0x7337('0x1f'),_0x7337('0x20'));_0x459dd0+=_0x5b0805[_0x7337('0x17')](_0x7337('0x20'));return _0x459dd0;}; \ No newline at end of file diff --git a/server/components/export/csv.js b/server/components/export/csv.js index 9e11c79..91a6e9d 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 _0x466b=['then','sequelize','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','SELECT','Empty','split','range','num','isInteger','forEach','push','%s\x20limit\x20%d\x20OFFSET\x20%d','dirname','basename','.csv','length','existsSync','join','each','%s.%s','zip','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','CSV','Completed','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','finally','exit','util','path','lodash','to-csv','bluebird','rimraf','../../mysqldb','../../config/logger','analytics','argv','savename','update','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','Setting','find','splitSizeCsv'];(function(_0x2dac73,_0x230464){var _0x4ab134=function(_0x2dce7c){while(--_0x2dce7c){_0x2dac73['push'](_0x2dac73['shift']());}};_0x4ab134(++_0x230464);}(_0x466b,0xb6));var _0xb466=function(_0x97bd06,_0x59d9cf){_0x97bd06=_0x97bd06-0x0;var _0x189970=_0x466b[_0x97bd06];return _0x189970;};'use strict';var util=require(_0xb466('0x0'));var path=require(_0xb466('0x1'));var _=require(_0xb466('0x2'));var csv=require(_0xb466('0x3'));var fs=require('fs');var BPromise=require(_0xb466('0x4'));var zipdir=require('zip-dir');var rimraf=require(_0xb466('0x5'));var db=require(_0xb466('0x6'))['db'];var dbH=require(_0xb466('0x6'))['dbH'];var logger=require(_0xb466('0x7'))(_0xb466('0x8'));var EXTRACTED_REPORT_ID=Number(process[_0xb466('0x9')][0x2]);var QUERY=process[_0xb466('0x9')][0x3];var PATH=process[_0xb466('0x9')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x21d11a,_0x35eae9){var _0x7cabf={'status':_0x21d11a};var _0x4fa9ba={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x35eae9){_0x7cabf[_0xb466('0xa')]=_0x35eae9;}return db['AnalyticExtractedReport'][_0xb466('0xb')](_0x7cabf,_0x4fa9ba);}function main(){var _0x3890e9=0x1388;var _0x992583;logger[_0xb466('0xc')](util[_0xb466('0xd')](_0xb466('0xe'),EXTRACTED_REPORT_ID,'CSV'));return db[_0xb466('0xf')][_0xb466('0x10')]({'where':{'id':0x1},'raw':!![],'attributes':['id','split',_0xb466('0x11')]})[_0xb466('0x12')](function(_0x27e134){if(_0x27e134){_0x992583=_0x27e134;_0x3890e9=_0x992583[_0xb466('0x11')]||0x1388;}})[_0xb466('0x12')](function(){return dbH[_0xb466('0x13')][_0xb466('0x14')](util[_0xb466('0xd')](_0xb466('0x15'),QUERY),{'type':dbH[_0xb466('0x13')][_0xb466('0x16')][_0xb466('0x17')]});})[_0xb466('0x12')](function(_0x23ad3c){if(!_0x23ad3c[0x0]['num']){return analyticExtractedReport(_0xb466('0x18'));}var _0x287406=[];var _0x114cab=0x0;if(_0x992583[_0xb466('0x19')]){if(_0x23ad3c&&_0x23ad3c['length']){var _0x58a6a6=_[_0xb466('0x1a')](_0x23ad3c[0x0][_0xb466('0x1b')]/_0x3890e9);var _0x431caa=Number[_0xb466('0x1c')](_0x23ad3c[0x0][_0xb466('0x1b')]/_0x3890e9)?_0x23ad3c[0x0][_0xb466('0x1b')]%_0x3890e9:0x0;_0x58a6a6[_0xb466('0x1d')](function(_0x275109){if(_0x275109>0x0){_0x114cab+=_0x3890e9;}_0x287406[_0xb466('0x1e')](dbH[_0xb466('0x13')]['query'](util[_0xb466('0xd')](_0xb466('0x1f'),QUERY,_0x3890e9,_0x114cab),{'type':dbH['sequelize'][_0xb466('0x16')][_0xb466('0x17')]}));});if(_0x431caa>0x0){_0x114cab+=_0x3890e9;_0x287406[_0xb466('0x1e')](dbH[_0xb466('0x13')][_0xb466('0x14')](util[_0xb466('0xd')](_0xb466('0x1f'),QUERY,_0x431caa,_0x114cab),{'type':dbH[_0xb466('0x13')][_0xb466('0x16')][_0xb466('0x17')]}));}}}else{_0x287406[_0xb466('0x1e')](dbH[_0xb466('0x13')]['query'](QUERY,{'type':dbH['sequelize'][_0xb466('0x16')][_0xb466('0x17')]}));}var _0x281590=path[_0xb466('0x20')](PATH);var _0x40e208=path[_0xb466('0x21')](PATH,_0xb466('0x22'));var _0x4e93e8=_0x992583[_0xb466('0x19')]&&_0x287406[_0xb466('0x23')]>0x1;var _0x1fa82c=[];if(!fs[_0xb466('0x24')](path[_0xb466('0x25')](_0x281590,_0x40e208))&&_0x4e93e8){fs['mkdirSync'](path[_0xb466('0x25')](_0x281590,_0x40e208));}return BPromise[_0xb466('0x26')](_0x287406,function(_0x461b79){_0x1fa82c[_0xb466('0x1e')](_0x461b79);})[_0xb466('0x12')](function(){for(var _0x3657bb=0x0;_0x3657bb<_0x1fa82c['length'];_0x3657bb+=0x1){var _0x1b911e;var _0x12885d=_0x1fa82c[_0x3657bb];if(_0x4e93e8){_0x1b911e=path[_0xb466('0x25')](_0x281590,_0x40e208,util['format']('%s%d.%s',_0x40e208,_0x3657bb,'csv'));}else{_0x1b911e=path[_0xb466('0x25')](_0x281590,util[_0xb466('0xd')](_0xb466('0x27'),_0x40e208,'csv'));}fs['writeFileSync'](_0x1b911e,csv(_0x12885d));}})[_0xb466('0x12')](function(){if(_0x4e93e8){return new Promise(function(_0x844f79){zipdir(path[_0xb466('0x25')](_0x281590,_0x40e208),{'saveTo':path[_0xb466('0x25')](_0x281590,util[_0xb466('0xd')]('%s.%s',_0x40e208,_0xb466('0x28')))},function(_0x2ccb18,_0x2884b3){rimraf(path[_0xb466('0x25')](_0x281590,_0x40e208),function(){});_0x844f79('zip\x20finished');});});}})[_0xb466('0x12')](function(){logger[_0xb466('0xc')](util['format'](_0xb466('0x29'),EXTRACTED_REPORT_ID,_0xb466('0x2a')));return analyticExtractedReport(_0xb466('0x2b'),_0x4e93e8?util['format'](_0xb466('0x27'),_0x40e208,_0x4e93e8?_0xb466('0x28'):'csv'):null);});})[_0xb466('0x2c')](function(_0x22ecc2){logger[_0xb466('0xc')](util['format'](_0xb466('0x2d'),EXTRACTED_REPORT_ID,_0xb466('0x2a')),util[_0xb466('0x2e')](_0x22ecc2,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0xb466('0x2f'));})[_0xb466('0x30')](function(){process[_0xb466('0x31')](EXIT_CODE);});}main(); \ No newline at end of file +var _0xd0c7=['num','forEach','push','%s\x20limit\x20%d\x20OFFSET\x20%d','SELECT','dirname','basename','join','mkdirSync','each','%s%d.%s','writeFileSync','%s.%s','zip\x20finished','info','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','zip','catch','CSV','inspect','Failed','finally','exit','util','path','lodash','bluebird','rimraf','../../mysqldb','../../config/logger','analytics','argv','savename','AnalyticExtractedReport','update','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','split','then','splitSizeCsv','query','format','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','sequelize','QueryTypes','length'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd0c7,0x188));var _0x7d0c=function(_0x3774f9,_0xe865df){_0x3774f9=_0x3774f9-0x0;var _0x24d982=_0xd0c7[_0x3774f9];return _0x24d982;};'use strict';var util=require(_0x7d0c('0x0'));var path=require(_0x7d0c('0x1'));var _=require(_0x7d0c('0x2'));var csv=require('to-csv');var fs=require('fs');var BPromise=require(_0x7d0c('0x3'));var zipdir=require('zip-dir');var rimraf=require(_0x7d0c('0x4'));var db=require(_0x7d0c('0x5'))['db'];var dbH=require('../../mysqldb')['dbH'];var logger=require(_0x7d0c('0x6'))(_0x7d0c('0x7'));var EXTRACTED_REPORT_ID=Number(process[_0x7d0c('0x8')][0x2]);var QUERY=process[_0x7d0c('0x8')][0x3];var PATH=process[_0x7d0c('0x8')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x20108b,_0x35bfa9){var _0x5a50cf={'status':_0x20108b};var _0x23b9a3={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x35bfa9){_0x5a50cf[_0x7d0c('0x9')]=_0x35bfa9;}return db[_0x7d0c('0xa')][_0x7d0c('0xb')](_0x5a50cf,_0x23b9a3);}function main(){var _0x93b182=0x1388;var _0x4cfb71;logger['info'](util['format'](_0x7d0c('0xc'),EXTRACTED_REPORT_ID,'CSV'));return db['Setting']['find']({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x7d0c('0xd'),'splitSizeCsv']})[_0x7d0c('0xe')](function(_0x545fa1){if(_0x545fa1){_0x4cfb71=_0x545fa1;_0x93b182=_0x4cfb71[_0x7d0c('0xf')]||0x1388;}})['then'](function(){return dbH['sequelize'][_0x7d0c('0x10')](util[_0x7d0c('0x11')](_0x7d0c('0x12'),QUERY),{'type':dbH[_0x7d0c('0x13')][_0x7d0c('0x14')]['SELECT']});})['then'](function(_0x37a145){if(!_0x37a145[0x0]['num']){return analyticExtractedReport('Empty');}var _0x214af5=[];var _0x3e5e58=0x0;if(_0x4cfb71['split']){if(_0x37a145&&_0x37a145[_0x7d0c('0x15')]){var _0x2a6c38=_['range'](_0x37a145[0x0][_0x7d0c('0x16')]/_0x93b182);var _0x289fb7=Number['isInteger'](_0x37a145[0x0][_0x7d0c('0x16')]/_0x93b182)?_0x37a145[0x0][_0x7d0c('0x16')]%_0x93b182:0x0;_0x2a6c38[_0x7d0c('0x17')](function(_0x52e5e5){if(_0x52e5e5>0x0){_0x3e5e58+=_0x93b182;}_0x214af5[_0x7d0c('0x18')](dbH['sequelize']['query'](util[_0x7d0c('0x11')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x93b182,_0x3e5e58),{'type':dbH[_0x7d0c('0x13')][_0x7d0c('0x14')]['SELECT']}));});if(_0x289fb7>0x0){_0x3e5e58+=_0x93b182;_0x214af5[_0x7d0c('0x18')](dbH[_0x7d0c('0x13')][_0x7d0c('0x10')](util['format'](_0x7d0c('0x19'),QUERY,_0x289fb7,_0x3e5e58),{'type':dbH[_0x7d0c('0x13')][_0x7d0c('0x14')]['SELECT']}));}}}else{_0x214af5['push'](dbH[_0x7d0c('0x13')][_0x7d0c('0x10')](QUERY,{'type':dbH[_0x7d0c('0x13')][_0x7d0c('0x14')][_0x7d0c('0x1a')]}));}var _0x34bc1b=path[_0x7d0c('0x1b')](PATH);var _0x148457=path[_0x7d0c('0x1c')](PATH,'.csv');var _0x588a81=_0x4cfb71[_0x7d0c('0xd')]&&_0x214af5['length']>0x1;var _0x18c14b=[];if(!fs['existsSync'](path[_0x7d0c('0x1d')](_0x34bc1b,_0x148457))&&_0x588a81){fs[_0x7d0c('0x1e')](path[_0x7d0c('0x1d')](_0x34bc1b,_0x148457));}return BPromise[_0x7d0c('0x1f')](_0x214af5,function(_0x51438b){_0x18c14b[_0x7d0c('0x18')](_0x51438b);})[_0x7d0c('0xe')](function(){for(var _0x248e24=0x0;_0x248e24<_0x18c14b[_0x7d0c('0x15')];_0x248e24+=0x1){var _0x18b96f;var _0x313512=_0x18c14b[_0x248e24];if(_0x588a81){_0x18b96f=path['join'](_0x34bc1b,_0x148457,util[_0x7d0c('0x11')](_0x7d0c('0x20'),_0x148457,_0x248e24,'csv'));}else{_0x18b96f=path[_0x7d0c('0x1d')](_0x34bc1b,util[_0x7d0c('0x11')]('%s.%s',_0x148457,'csv'));}fs[_0x7d0c('0x21')](_0x18b96f,csv(_0x313512));}})[_0x7d0c('0xe')](function(){if(_0x588a81){return new Promise(function(_0x39b68e){zipdir(path[_0x7d0c('0x1d')](_0x34bc1b,_0x148457),{'saveTo':path[_0x7d0c('0x1d')](_0x34bc1b,util['format'](_0x7d0c('0x22'),_0x148457,'zip'))},function(_0x316bf6,_0x5069ea){rimraf(path[_0x7d0c('0x1d')](_0x34bc1b,_0x148457),function(){});_0x39b68e(_0x7d0c('0x23'));});});}})['then'](function(){logger[_0x7d0c('0x24')](util[_0x7d0c('0x11')](_0x7d0c('0x25'),EXTRACTED_REPORT_ID,'CSV'));return analyticExtractedReport(_0x7d0c('0x26'),_0x588a81?util[_0x7d0c('0x11')](_0x7d0c('0x22'),_0x148457,_0x588a81?_0x7d0c('0x27'):'csv'):null);});})[_0x7d0c('0x28')](function(_0x5f120b){logger[_0x7d0c('0x24')](util[_0x7d0c('0x11')]('Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0x7d0c('0x29')),util[_0x7d0c('0x2a')](_0x5f120b,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x7d0c('0x2b'));})[_0x7d0c('0x2c')](function(){process[_0x7d0c('0x2d')](EXIT_CODE);});}main(); \ No newline at end of file diff --git a/server/components/export/pdf.js b/server/components/export/pdf.js index 5cb4a69..2bacb84 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 _0xaae8=['update','map','tableHeader','pick','toString','value','fill','length','auto','body','push','concat','forEach','format','Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','startDate','endDate','pageBreak','margin','landscape','\x20/\x20','footer','Arial','black','right','num','Empty','split','splitSizePdf','query','sequelize','QueryTypes','%s\x20limit\x20%d\x20OFFSET\x20%d','SELECT','basename','join','each','flatten','%s%d.%s','pdf','all','%s.%s','then','info','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','PDF','zip','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','exit','/fonts/arial-regular.ttf','/fonts/arial-italic.ttf','/fonts/arial-bold-italic.ttf','channel','YYYY-MM-DD','center','Interaction\x20Transcript','header','\x09\x09XCALLY\x20Motion\x20-\x20%s\x09\x09\x09\x09%d/%d\x09\x09\x09\x09%s','pipe','createWriteStream','finish','createPdfFromHTML','lodash','util','path','moment','pdfmake/src/printer','jsdom','bluebird','../../mysqldb','../../config/logger','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','savename','AnalyticExtractedReport'];(function(_0x214120,_0x492dee){var _0x22693c=function(_0x2a7404){while(--_0x2a7404){_0x214120['push'](_0x214120['shift']());}};_0x22693c(++_0x492dee);}(_0xaae8,0x93));var _0x8aae=function(_0x101998,_0x30822e){_0x101998=_0x101998-0x0;var _0x55e3b2=_0xaae8[_0x101998];return _0x55e3b2;};'use strict';var _=require(_0x8aae('0x0'));var fs=require('fs');var util=require(_0x8aae('0x1'));var path=require(_0x8aae('0x2'));var moment=require(_0x8aae('0x3'));var htmlToPdfmake=require('html-to-pdfmake');var PdfPrinter=require(_0x8aae('0x4'));var zipdir=require('zip-dir');var rimraf=require('rimraf');var JSDOM=require(_0x8aae('0x5'))['JSDOM'];var window=new JSDOM('')['window'];var BPromise=require(_0x8aae('0x6'));var db=require('../../mysqldb')['db'];var dbH=require(_0x8aae('0x7'))['dbH'];var logger=require(_0x8aae('0x8'))('analytics');var EXTRACTED_REPORT_ID=Number(process[_0x8aae('0x9')][0x2]);var QUERY=process['argv'][0x3];var PATH=process[_0x8aae('0x9')][0x4];var NAME=process[_0x8aae('0x9')][0x5];var FORMAT=_0x8aae('0xa');var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x14b88c,_0x40ba4a){var _0x5be36d={'status':_0x14b88c};var _0xf3742f={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x40ba4a){_0x5be36d[_0x8aae('0xb')]=_0x40ba4a;}return db[_0x8aae('0xc')][_0x8aae('0xd')](_0x5be36d,_0xf3742f);}function getHeaders(_0x10a5cd){return _[_0x8aae('0xe')](_0x10a5cd,function(_0x1bd0ec){return{'text':_0x1bd0ec,'style':_0x8aae('0xf')};});}function getRows(_0x399493,_0x32a9c0){return _[_0x8aae('0xe')](_0x32a9c0,function(_0x50f923){return _(_0x50f923)[_0x8aae('0x10')](_0x399493)[_0x8aae('0xe')](function(_0x30f35d){return _0x30f35d?_[_0x8aae('0x11')](_0x30f35d):'';})[_0x8aae('0x12')]();});}function createTable(_0x3849a4,_0x54de30){var _0x55ea4b={'widths':_[_0x8aae('0x13')](Array(_0x3849a4[_0x8aae('0x14')]),0x91),'heights':function(_0x50aa5a){return _0x50aa5a===0x0?_0x8aae('0x15'):0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0xa24028=getHeaders(_0x3849a4);_0x55ea4b[_0x8aae('0x16')][_0x8aae('0x17')](_0xa24028);var _0x43f8e1=getRows(_0x3849a4,_0x54de30);_0x55ea4b[_0x8aae('0x16')]=_0x55ea4b[_0x8aae('0x16')][_0x8aae('0x18')](_0x43f8e1);return _0x55ea4b;}function createTables(_0x4678b1){var _0x222668=[];var _0x504d7e=_['chunk'](Object['keys'](_0x4678b1[0x0]),0x5);_0x504d7e[_0x8aae('0x19')](function(_0x21bfb3){_0x222668['push'](createTable(_0x21bfb3,_0x4678b1));});return _0x222668;}function getPDFDocDefinition(_0x14f874){var _0x1a41ff=util[_0x8aae('0x1a')](_0x8aae('0x1b'),NAME,EXTRACTED_REPORT['name'],moment(EXTRACTED_REPORT[_0x8aae('0x1c')])['format'](FORMAT),moment(EXTRACTED_REPORT[_0x8aae('0x1d')])[_0x8aae('0x1a')](FORMAT));var _0x578d58=[];for(var _0x51eb77=0x0;_0x51eb77<_0x14f874[_0x8aae('0x14')];_0x51eb77++){var _0x329044=[];if(_0x51eb77===0x0){_0x329044[_0x8aae('0x17')]({'text':_0x1a41ff,'style':'header'});}var _0x4f76e8={'table':_0x14f874[_0x51eb77]};if(_0x51eb77>0x0){_0x4f76e8[_0x8aae('0x1e')]='before';_0x4f76e8[_0x8aae('0x1f')]=[0x0,0x46,0x0,0x0];}_0x329044[_0x8aae('0x17')](_0x4f76e8);_0x578d58[_0x8aae('0x17')](_0x329044);}return{'pageSize':'A4','pageOrientation':_0x8aae('0x20'),'content':_0x578d58,'footer':function(_0x13c9e7,_0x57506d){return{'text':_0x13c9e7['toString']()+_0x8aae('0x21')+_0x57506d,'style':_0x8aae('0x22')};},'defaultStyle':{'font':_0x8aae('0x23')},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':_0x8aae('0x24')},'footer':{'alignment':_0x8aae('0x25'),'margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0x1c0fb7){var _0x44d0d5=0x1388;var _0x5928e4;if(!_0x1c0fb7[0x0][_0x8aae('0x26')]){return analyticExtractedReport(_0x8aae('0x27'));}return db['Setting']['find']({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x8aae('0x28'),'splitSizePdf']})['then'](function(_0x3fa46e){if(_0x3fa46e){_0x5928e4=_0x3fa46e;_0x44d0d5=_0x5928e4[_0x8aae('0x29')]||0x3e8;}})['then'](function(){var _0x335519=[];var _0x59c511=0x0;if(_0x5928e4[_0x8aae('0x28')]){if(_0x1c0fb7&&_0x1c0fb7['length']){var _0x491ffa=_['range'](_0x1c0fb7[0x0][_0x8aae('0x26')]/_0x44d0d5);var _0x565981=Number['isInteger'](_0x1c0fb7[0x0][_0x8aae('0x26')]/_0x44d0d5)?_0x1c0fb7[0x0][_0x8aae('0x26')]%_0x44d0d5:0x0;_0x491ffa[_0x8aae('0x19')](function(_0x1022e4){if(_0x1022e4>0x0){_0x59c511+=_0x44d0d5;}_0x335519['push'](dbH['sequelize'][_0x8aae('0x2a')](util[_0x8aae('0x1a')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x44d0d5,_0x59c511),{'type':dbH[_0x8aae('0x2b')][_0x8aae('0x2c')]['SELECT']}));});if(_0x565981>0x0){_0x59c511+=_0x44d0d5;_0x335519[_0x8aae('0x17')](dbH['sequelize'][_0x8aae('0x2a')](util[_0x8aae('0x1a')](_0x8aae('0x2d'),QUERY,_0x565981,_0x59c511),{'type':dbH[_0x8aae('0x2b')][_0x8aae('0x2c')]['SELECT']}));}}}else{_0x335519[_0x8aae('0x17')](dbH['sequelize'][_0x8aae('0x2a')](QUERY,{'type':dbH[_0x8aae('0x2b')][_0x8aae('0x2c')][_0x8aae('0x2e')]}));}var _0x45e797=path['dirname'](PATH);var _0x194c20=path[_0x8aae('0x2f')](PATH,'.pdf');var _0x431a20=_0x5928e4['split']&&_0x335519['length']>0x1;var _0x5af20b=[];if(!fs['existsSync'](path['join'](_0x45e797,_0x194c20))&&_0x431a20){fs['mkdirSync'](path[_0x8aae('0x30')](_0x45e797,_0x194c20));}return BPromise[_0x8aae('0x31')](_0x335519,function(_0x35bd3a){_0x5af20b['push'](_0x35bd3a);})['then'](function(){var _0x5a7857=[];for(var _0x5e7b08=0x0;_0x5e7b08<_0x5af20b[_0x8aae('0x14')];_0x5e7b08+=0x1){var _0x213d4d=_0x5af20b[_0x5e7b08];var _0x5861a2=createTables(_[_0x8aae('0x32')](_0x213d4d));var _0x4060b9;var _0x2b5306=getPDFDocDefinition(_0x5861a2);var _0x30eb8c=getPDFPrinter();var _0x539807=_0x30eb8c['createPdfKitDocument'](_0x2b5306);if(_0x431a20){_0x4060b9=path[_0x8aae('0x30')](_0x45e797,_0x194c20,util[_0x8aae('0x1a')](_0x8aae('0x33'),_0x194c20,_0x5e7b08,_0x8aae('0x34')));}else{_0x4060b9=path[_0x8aae('0x30')](_0x45e797,util['format']('%s.%s',_0x194c20,'pdf'));}_0x5a7857['push'](writePDFDocument(_0x539807,_0x4060b9));}return Promise[_0x8aae('0x35')](_0x5a7857);})['then'](function(){if(_0x431a20){return new Promise(function(_0x3031b0){zipdir(path[_0x8aae('0x30')](_0x45e797,_0x194c20),{'saveTo':path[_0x8aae('0x30')](_0x45e797,util[_0x8aae('0x1a')](_0x8aae('0x36'),_0x194c20,'zip'))},function(){rimraf(path[_0x8aae('0x30')](_0x45e797,_0x194c20),function(){});_0x3031b0('zip\x20finished');});});}})[_0x8aae('0x37')](function(){if(!_0x431a20)return;rimraf(path['join'](_0x45e797,_0x194c20),function(){});})[_0x8aae('0x37')](function(){logger[_0x8aae('0x38')](util[_0x8aae('0x1a')](_0x8aae('0x39'),EXTRACTED_REPORT_ID,_0x8aae('0x3a')));return analyticExtractedReport('Completed',_0x431a20?util[_0x8aae('0x1a')]('%s.%s',_0x194c20,_0x431a20?_0x8aae('0x3b'):_0x8aae('0x34')):null);});});}function main(){if(!EXTRACTED_REPORT_ID)return;logger[_0x8aae('0x38')](util[_0x8aae('0x1a')](_0x8aae('0x3c'),EXTRACTED_REPORT_ID,_0x8aae('0x3a')));return db[_0x8aae('0xc')][_0x8aae('0x3d')]({'where':{'id':EXTRACTED_REPORT_ID}})[_0x8aae('0x37')](function(_0x49fd41){EXTRACTED_REPORT=_0x49fd41;return dbH[_0x8aae('0x2b')][_0x8aae('0x2a')](util['format'](_0x8aae('0x3e'),QUERY),{'type':dbH[_0x8aae('0x2b')][_0x8aae('0x2c')][_0x8aae('0x2e')]});})[_0x8aae('0x37')](extractReport)[_0x8aae('0x3f')](function(_0x4f3844){logger[_0x8aae('0x38')](util['format'](_0x8aae('0x40'),EXTRACTED_REPORT_ID,_0x8aae('0x3a')),util[_0x8aae('0x41')](_0x4f3844,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport('Failed');})['finally'](function(){process[_0x8aae('0x42')](EXIT_CODE);});}main();function getPDFPrinter(){var _0x2221b3=new PdfPrinter({'Arial':{'normal':__dirname+_0x8aae('0x43'),'bold':__dirname+'/fonts/arial-bold.ttf','italics':__dirname+_0x8aae('0x44'),'bolditalics':__dirname+_0x8aae('0x45')}});return _0x2221b3;}function getPDFDocDefinitionFromHTML(_0x233c5a,_0x3bfd08){var _0x33cb79=util['format']('%s\x20#%d',_0x3bfd08[_0x8aae('0x46')],_0x3bfd08['interactionId']);var _0x519c74=moment()[_0x8aae('0x1a')](_0x8aae('0x47'))['toString']();var _0x91a6b4=htmlToPdfmake(_0x233c5a,{'window':window,'tableAutoSize':!![]});return{'content':[_0x91a6b4],'defaultStyle':{'font':_0x8aae('0x23')},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':_0x8aae('0x48'),'margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':_0x8aae('0x48'),'margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':_0x8aae('0x48')}},'header':function(){return[{'text':_0x8aae('0x49'),'style':_0x8aae('0x4a')}];},'footer':function(_0x51b288,_0x5dc5cb){return[{'text':util[_0x8aae('0x1a')](_0x8aae('0x4b'),_0x33cb79,_0x51b288,_0x5dc5cb,_0x519c74),'style':'footer'}];}};}function writePDFDocument(_0x2a3287,_0xc89042){return new Promise(function(_0xcc1d05,_0x3b8a05){var _0x2588f2=_0x2a3287[_0x8aae('0x4c')](fs[_0x8aae('0x4d')](_0xc89042));_0x2588f2['on'](_0x8aae('0x4e'),function(){_0xcc1d05('finish');});_0x2588f2['on']('error',function(_0x48c3e2){_0x3b8a05(_0x48c3e2);});_0x2a3287['end']();});}exports[_0x8aae('0x4f')]=function(_0x4747ca,_0x41c624){var _0x102283=getPDFPrinter();var _0x3958be=getPDFDocDefinitionFromHTML(_0x4747ca,_0x41c624);var _0x12b24b=_0x102283['createPdfKitDocument'](_0x3958be);return writePDFDocument(_0x12b24b,_0x41c624['path'])[_0x8aae('0x3f')](function(_0x4c3f95){throw _0x4c3f95;});}; \ No newline at end of file +var _0x5839=['flatten','createPdfKitDocument','%s%d.%s','pdf','%s.%s','all','zip','PDF','Completed','info','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','findOne','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','Failed','finally','/fonts/arial-regular.ttf','/fonts/arial-bold.ttf','/fonts/arial-bold-italic.ttf','%s\x20#%d','channel','interactionId','YYYY-MM-DD','center','header','pipe','finish','end','createPdfFromHTML','catch','lodash','util','path','html-to-pdfmake','pdfmake/src/printer','zip-dir','rimraf','jsdom','JSDOM','window','bluebird','../../mysqldb','dbH','analytics','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','AnalyticExtractedReport','update','tableHeader','pick','map','toString','value','fill','length','auto','push','body','concat','forEach','format','Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','name','startDate','pageBreak','margin','landscape','\x20/\x20','footer','Arial','black','right','num','find','splitSizePdf','then','range','isInteger','sequelize','query','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','SELECT','dirname','.pdf','split','existsSync','mkdirSync','join','each'];(function(_0x4e676e,_0x2a7c6d){var _0x336a3c=function(_0x4767c4){while(--_0x4767c4){_0x4e676e['push'](_0x4e676e['shift']());}};_0x336a3c(++_0x2a7c6d);}(_0x5839,0x12c));var _0x9583=function(_0x5d1b02,_0xbcf431){_0x5d1b02=_0x5d1b02-0x0;var _0x33fca0=_0x5839[_0x5d1b02];return _0x33fca0;};'use strict';var _=require(_0x9583('0x0'));var fs=require('fs');var util=require(_0x9583('0x1'));var path=require(_0x9583('0x2'));var moment=require('moment');var htmlToPdfmake=require(_0x9583('0x3'));var PdfPrinter=require(_0x9583('0x4'));var zipdir=require(_0x9583('0x5'));var rimraf=require(_0x9583('0x6'));var JSDOM=require(_0x9583('0x7'))[_0x9583('0x8')];var window=new JSDOM('')[_0x9583('0x9')];var BPromise=require(_0x9583('0xa'));var db=require(_0x9583('0xb'))['db'];var dbH=require(_0x9583('0xb'))[_0x9583('0xc')];var logger=require('../../config/logger')(_0x9583('0xd'));var EXTRACTED_REPORT_ID=Number(process[_0x9583('0xe')][0x2]);var QUERY=process[_0x9583('0xe')][0x3];var PATH=process[_0x9583('0xe')][0x4];var NAME=process[_0x9583('0xe')][0x5];var FORMAT=_0x9583('0xf');var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x292d7e,_0x5d6bed){var _0x2a1f97={'status':_0x292d7e};var _0x1eeed8={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x5d6bed){_0x2a1f97['savename']=_0x5d6bed;}return db[_0x9583('0x10')][_0x9583('0x11')](_0x2a1f97,_0x1eeed8);}function getHeaders(_0xd30060){return _['map'](_0xd30060,function(_0x3e1431){return{'text':_0x3e1431,'style':_0x9583('0x12')};});}function getRows(_0x1a4545,_0x482a74){return _['map'](_0x482a74,function(_0x151b0d){return _(_0x151b0d)[_0x9583('0x13')](_0x1a4545)[_0x9583('0x14')](function(_0x58010b){return _0x58010b?_[_0x9583('0x15')](_0x58010b):'';})[_0x9583('0x16')]();});}function createTable(_0x2673ae,_0x3e2559){var _0x3360fc={'widths':_[_0x9583('0x17')](Array(_0x2673ae[_0x9583('0x18')]),0x91),'heights':function(_0x1c02cc){return _0x1c02cc===0x0?_0x9583('0x19'):0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0x32ff4e=getHeaders(_0x2673ae);_0x3360fc['body'][_0x9583('0x1a')](_0x32ff4e);var _0x338eb6=getRows(_0x2673ae,_0x3e2559);_0x3360fc[_0x9583('0x1b')]=_0x3360fc[_0x9583('0x1b')][_0x9583('0x1c')](_0x338eb6);return _0x3360fc;}function createTables(_0x57e506){var _0x380220=[];var _0x2be6ad=_['chunk'](Object['keys'](_0x57e506[0x0]),0x5);_0x2be6ad[_0x9583('0x1d')](function(_0x37362d){_0x380220[_0x9583('0x1a')](createTable(_0x37362d,_0x57e506));});return _0x380220;}function getPDFDocDefinition(_0x50094c){var _0x7322f3=util[_0x9583('0x1e')](_0x9583('0x1f'),NAME,EXTRACTED_REPORT[_0x9583('0x20')],moment(EXTRACTED_REPORT[_0x9583('0x21')])[_0x9583('0x1e')](FORMAT),moment(EXTRACTED_REPORT['endDate'])['format'](FORMAT));var _0x20dc80=[];for(var _0x422326=0x0;_0x422326<_0x50094c[_0x9583('0x18')];_0x422326++){var _0x3f354b=[];if(_0x422326===0x0){_0x3f354b['push']({'text':_0x7322f3,'style':'header'});}var _0x2740bb={'table':_0x50094c[_0x422326]};if(_0x422326>0x0){_0x2740bb[_0x9583('0x22')]='before';_0x2740bb[_0x9583('0x23')]=[0x0,0x46,0x0,0x0];}_0x3f354b['push'](_0x2740bb);_0x20dc80[_0x9583('0x1a')](_0x3f354b);}return{'pageSize':'A4','pageOrientation':_0x9583('0x24'),'content':_0x20dc80,'footer':function(_0x2e3333,_0x1dcc1f){return{'text':_0x2e3333[_0x9583('0x15')]()+_0x9583('0x25')+_0x1dcc1f,'style':_0x9583('0x26')};},'defaultStyle':{'font':_0x9583('0x27')},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':_0x9583('0x28')},'footer':{'alignment':_0x9583('0x29'),'margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0x2e7d96){var _0x31eb1d=0x1388;var _0x237b01;if(!_0x2e7d96[0x0][_0x9583('0x2a')]){return analyticExtractedReport('Empty');}return db['Setting'][_0x9583('0x2b')]({'where':{'id':0x1},'raw':!![],'attributes':['id','split',_0x9583('0x2c')]})[_0x9583('0x2d')](function(_0x5bc7d2){if(_0x5bc7d2){_0x237b01=_0x5bc7d2;_0x31eb1d=_0x237b01['splitSizePdf']||0x3e8;}})[_0x9583('0x2d')](function(){var _0x12a435=[];var _0x362c62=0x0;if(_0x237b01['split']){if(_0x2e7d96&&_0x2e7d96[_0x9583('0x18')]){var _0x2dcbc0=_[_0x9583('0x2e')](_0x2e7d96[0x0][_0x9583('0x2a')]/_0x31eb1d);var _0x1bff50=Number[_0x9583('0x2f')](_0x2e7d96[0x0][_0x9583('0x2a')]/_0x31eb1d)?_0x2e7d96[0x0][_0x9583('0x2a')]%_0x31eb1d:0x0;_0x2dcbc0['forEach'](function(_0x383029){if(_0x383029>0x0){_0x362c62+=_0x31eb1d;}_0x12a435[_0x9583('0x1a')](dbH[_0x9583('0x30')][_0x9583('0x31')](util[_0x9583('0x1e')](_0x9583('0x32'),QUERY,_0x31eb1d,_0x362c62),{'type':dbH[_0x9583('0x30')][_0x9583('0x33')][_0x9583('0x34')]}));});if(_0x1bff50>0x0){_0x362c62+=_0x31eb1d;_0x12a435['push'](dbH['sequelize'][_0x9583('0x31')](util[_0x9583('0x1e')](_0x9583('0x32'),QUERY,_0x1bff50,_0x362c62),{'type':dbH[_0x9583('0x30')][_0x9583('0x33')][_0x9583('0x34')]}));}}}else{_0x12a435[_0x9583('0x1a')](dbH[_0x9583('0x30')][_0x9583('0x31')](QUERY,{'type':dbH[_0x9583('0x30')][_0x9583('0x33')][_0x9583('0x34')]}));}var _0x3d172a=path[_0x9583('0x35')](PATH);var _0x5458e1=path['basename'](PATH,_0x9583('0x36'));var _0x48c96a=_0x237b01[_0x9583('0x37')]&&_0x12a435[_0x9583('0x18')]>0x1;var _0x53f4cc=[];if(!fs[_0x9583('0x38')](path['join'](_0x3d172a,_0x5458e1))&&_0x48c96a){fs[_0x9583('0x39')](path[_0x9583('0x3a')](_0x3d172a,_0x5458e1));}return BPromise[_0x9583('0x3b')](_0x12a435,function(_0x30babb){_0x53f4cc[_0x9583('0x1a')](_0x30babb);})['then'](function(){var _0x2c3aa5=[];for(var _0x3278bf=0x0;_0x3278bf<_0x53f4cc['length'];_0x3278bf+=0x1){var _0x22f475=_0x53f4cc[_0x3278bf];var _0x5e11dc=createTables(_[_0x9583('0x3c')](_0x22f475));var _0x421411;var _0x1ca9a5=getPDFDocDefinition(_0x5e11dc);var _0x16bf80=getPDFPrinter();var _0x16b28a=_0x16bf80[_0x9583('0x3d')](_0x1ca9a5);if(_0x48c96a){_0x421411=path[_0x9583('0x3a')](_0x3d172a,_0x5458e1,util[_0x9583('0x1e')](_0x9583('0x3e'),_0x5458e1,_0x3278bf,_0x9583('0x3f')));}else{_0x421411=path[_0x9583('0x3a')](_0x3d172a,util[_0x9583('0x1e')](_0x9583('0x40'),_0x5458e1,'pdf'));}_0x2c3aa5[_0x9583('0x1a')](writePDFDocument(_0x16b28a,_0x421411));}return Promise[_0x9583('0x41')](_0x2c3aa5);})[_0x9583('0x2d')](function(){if(_0x48c96a){return new Promise(function(_0x2373ed){zipdir(path[_0x9583('0x3a')](_0x3d172a,_0x5458e1),{'saveTo':path[_0x9583('0x3a')](_0x3d172a,util['format'](_0x9583('0x40'),_0x5458e1,_0x9583('0x42')))},function(){rimraf(path[_0x9583('0x3a')](_0x3d172a,_0x5458e1),function(){});_0x2373ed('zip\x20finished');});});}})[_0x9583('0x2d')](function(){if(!_0x48c96a)return;rimraf(path[_0x9583('0x3a')](_0x3d172a,_0x5458e1),function(){});})[_0x9583('0x2d')](function(){logger['info'](util['format']('Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed',EXTRACTED_REPORT_ID,_0x9583('0x43')));return analyticExtractedReport(_0x9583('0x44'),_0x48c96a?util[_0x9583('0x1e')](_0x9583('0x40'),_0x5458e1,_0x48c96a?'zip':_0x9583('0x3f')):null);});});}function main(){if(!EXTRACTED_REPORT_ID)return;logger[_0x9583('0x45')](util[_0x9583('0x1e')](_0x9583('0x46'),EXTRACTED_REPORT_ID,'PDF'));return db[_0x9583('0x10')][_0x9583('0x47')]({'where':{'id':EXTRACTED_REPORT_ID}})[_0x9583('0x2d')](function(_0x96019){EXTRACTED_REPORT=_0x96019;return dbH[_0x9583('0x30')][_0x9583('0x31')](util[_0x9583('0x1e')](_0x9583('0x48'),QUERY),{'type':dbH[_0x9583('0x30')][_0x9583('0x33')]['SELECT']});})['then'](extractReport)['catch'](function(_0x1492a0){logger[_0x9583('0x45')](util['format'](_0x9583('0x49'),EXTRACTED_REPORT_ID,_0x9583('0x43')),util['inspect'](_0x1492a0,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x9583('0x4a'));})[_0x9583('0x4b')](function(){process['exit'](EXIT_CODE);});}main();function getPDFPrinter(){var _0x5c40cf=new PdfPrinter({'Arial':{'normal':__dirname+_0x9583('0x4c'),'bold':__dirname+_0x9583('0x4d'),'italics':__dirname+'/fonts/arial-italic.ttf','bolditalics':__dirname+_0x9583('0x4e')}});return _0x5c40cf;}function getPDFDocDefinitionFromHTML(_0xc3e6fe,_0x146e67){var _0x924c35=util['format'](_0x9583('0x4f'),_0x146e67[_0x9583('0x50')],_0x146e67[_0x9583('0x51')]);var _0x73e36b=moment()['format'](_0x9583('0x52'))[_0x9583('0x15')]();var _0x251d5b=htmlToPdfmake(_0xc3e6fe,{'window':window,'tableAutoSize':!![]});return{'content':[_0x251d5b],'defaultStyle':{'font':_0x9583('0x27')},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':_0x9583('0x53'),'margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':_0x9583('0x53'),'margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':_0x9583('0x53')}},'header':function(){return[{'text':'Interaction\x20Transcript','style':_0x9583('0x54')}];},'footer':function(_0x26c281,_0x4b3397){return[{'text':util['format']('\x09\x09XCALLY\x20Motion\x20-\x20%s\x09\x09\x09\x09%d/%d\x09\x09\x09\x09%s',_0x924c35,_0x26c281,_0x4b3397,_0x73e36b),'style':_0x9583('0x26')}];}};}function writePDFDocument(_0x4a7936,_0x2f0b0c){return new Promise(function(_0x267f9,_0x1e78c4){var _0x52a707=_0x4a7936[_0x9583('0x55')](fs['createWriteStream'](_0x2f0b0c));_0x52a707['on'](_0x9583('0x56'),function(){_0x267f9(_0x9583('0x56'));});_0x52a707['on']('error',function(_0x24162e){_0x1e78c4(_0x24162e);});_0x4a7936[_0x9583('0x57')]();});}exports[_0x9583('0x58')]=function(_0x24c52a,_0x34b69b){var _0x5b337e=getPDFPrinter();var _0x1aa915=getPDFDocDefinitionFromHTML(_0x24c52a,_0x34b69b);var _0x24ab9e=_0x5b337e[_0x9583('0x3d')](_0x1aa915);return writePDFDocument(_0x24ab9e,_0x34b69b['path'])[_0x9583('0x59')](function(_0x145c83){throw _0x145c83;});}; \ No newline at end of file diff --git a/server/components/export/xlsx.js b/server/components/export/xlsx.js index 59ee97c..96cfcf4 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 _0x8747=['push','%s\x20limit\x20%d\x20OFFSET\x20%d','SELECT','dirname','basename','.xlsx','existsSync','join','mkdirSync','each','xlsx','%s.%s','zip','zip\x20finished','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','catch','info','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','Failed','finally','exit','util','lodash','bluebird','zip-dir','rimraf','../../mysqldb','dbH','../../config/logger','argv','savename','AnalyticExtractedReport','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','XLSX','Setting','find','split','splitSizeXlsx','then','sequelize','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','Empty','length','range','isInteger','num','forEach'];(function(_0x16b4b5,_0xa29114){var _0x1fc751=function(_0x3fa4c9){while(--_0x3fa4c9){_0x16b4b5['push'](_0x16b4b5['shift']());}};_0x1fc751(++_0xa29114);}(_0x8747,0xab));var _0x7874=function(_0x32e7d6,_0x682bc5){_0x32e7d6=_0x32e7d6-0x0;var _0x5427cf=_0x8747[_0x32e7d6];return _0x5427cf;};'use strict';var util=require(_0x7874('0x0'));var path=require('path');var _=require(_0x7874('0x1'));var fs=require('fs');var json2xls=require('json2xls');var BPromise=require(_0x7874('0x2'));var zipdir=require(_0x7874('0x3'));var rimraf=require(_0x7874('0x4'));var db=require(_0x7874('0x5'))['db'];var dbH=require(_0x7874('0x5'))[_0x7874('0x6')];var logger=require(_0x7874('0x7'))('analytics');var EXTRACTED_REPORT_ID=Number(process[_0x7874('0x8')][0x2]);var QUERY=process[_0x7874('0x8')][0x3];var PATH=process[_0x7874('0x8')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x31bc7a,_0xe4d823){var _0x51cfe6={'status':_0x31bc7a};var _0x3b0755={'where':{'id':EXTRACTED_REPORT_ID}};if(_0xe4d823){_0x51cfe6[_0x7874('0x9')]=_0xe4d823;}return db[_0x7874('0xa')]['update'](_0x51cfe6,_0x3b0755);}function main(){var _0x4bc21c=0x1388;var _0x2e2112;logger['info'](util[_0x7874('0xb')](_0x7874('0xc'),EXTRACTED_REPORT_ID,_0x7874('0xd')));return db[_0x7874('0xe')][_0x7874('0xf')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x7874('0x10'),_0x7874('0x11')]})['then'](function(_0x54b095){if(_0x54b095){_0x2e2112=_0x54b095;_0x4bc21c=_0x2e2112[_0x7874('0x11')]||0x1388;}})[_0x7874('0x12')](function(){return dbH[_0x7874('0x13')][_0x7874('0x14')](util[_0x7874('0xb')](_0x7874('0x15'),QUERY),{'type':dbH[_0x7874('0x13')][_0x7874('0x16')]['SELECT']});})[_0x7874('0x12')](function(_0x54a8ac){if(!_0x54a8ac[0x0]['num']){return analyticExtractedReport(_0x7874('0x17'));}var _0x7ebfef=[];var _0x5e9b48=0x0;if(_0x2e2112[_0x7874('0x10')]){if(_0x54a8ac&&_0x54a8ac[_0x7874('0x18')]){var _0x1f6503=_[_0x7874('0x19')](_0x54a8ac[0x0]['num']/_0x4bc21c);var _0x284d4a=Number[_0x7874('0x1a')](_0x54a8ac[0x0][_0x7874('0x1b')]/_0x4bc21c)?_0x54a8ac[0x0][_0x7874('0x1b')]%_0x4bc21c:0x0;_0x1f6503[_0x7874('0x1c')](function(_0x14991c){if(_0x14991c>0x0){_0x5e9b48+=_0x4bc21c;}_0x7ebfef[_0x7874('0x1d')](dbH[_0x7874('0x13')]['query'](util[_0x7874('0xb')](_0x7874('0x1e'),QUERY,_0x4bc21c,_0x5e9b48),{'type':dbH[_0x7874('0x13')]['QueryTypes'][_0x7874('0x1f')]}));});if(_0x284d4a>0x0){_0x5e9b48+=_0x4bc21c;_0x7ebfef[_0x7874('0x1d')](dbH[_0x7874('0x13')]['query'](util[_0x7874('0xb')](_0x7874('0x1e'),QUERY,_0x284d4a,_0x5e9b48),{'type':dbH[_0x7874('0x13')][_0x7874('0x16')]['SELECT']}));}}}else{_0x7ebfef[_0x7874('0x1d')](dbH[_0x7874('0x13')]['query'](QUERY,{'type':dbH['sequelize'][_0x7874('0x16')][_0x7874('0x1f')]}));}var _0x2eb853=path[_0x7874('0x20')](PATH);var _0x10ad9f=path[_0x7874('0x21')](PATH,_0x7874('0x22'));var _0x58c91c=_0x2e2112['split']&&_0x7ebfef[_0x7874('0x18')]>0x1;var _0x1eb494=[];if(!fs[_0x7874('0x23')](path[_0x7874('0x24')](_0x2eb853,_0x10ad9f))&&_0x58c91c){fs[_0x7874('0x25')](path['join'](_0x2eb853,_0x10ad9f));}return BPromise[_0x7874('0x26')](_0x7ebfef,function(_0x149598){_0x1eb494[_0x7874('0x1d')](_0x149598);})['then'](function(){for(var _0x3957a4=0x0;_0x3957a4<_0x1eb494[_0x7874('0x18')];_0x3957a4+=0x1){var _0x452887;var _0x216204=_0x1eb494[_0x3957a4];if(_0x58c91c){_0x452887=path[_0x7874('0x24')](_0x2eb853,_0x10ad9f,util['format']('%s%d.%s',_0x10ad9f,_0x3957a4,_0x7874('0x27')));}else{_0x452887=path[_0x7874('0x24')](_0x2eb853,util[_0x7874('0xb')](_0x7874('0x28'),_0x10ad9f,_0x7874('0x27')));}fs['writeFileSync'](_0x452887,json2xls(_0x216204),'binary');}})['then'](function(){if(_0x58c91c){return new Promise(function(_0x426f07){zipdir(path['join'](_0x2eb853,_0x10ad9f),{'saveTo':path['join'](_0x2eb853,util[_0x7874('0xb')]('%s.%s',_0x10ad9f,_0x7874('0x29')))},function(_0x4f2319,_0x48ece8){rimraf(path[_0x7874('0x24')](_0x2eb853,_0x10ad9f),function(){});_0x426f07(_0x7874('0x2a'));});});}})['then'](function(){logger['info'](util[_0x7874('0xb')](_0x7874('0x2b'),EXTRACTED_REPORT_ID,_0x7874('0xd')));return analyticExtractedReport('Completed',_0x58c91c?util[_0x7874('0xb')](_0x7874('0x28'),_0x10ad9f,_0x58c91c?_0x7874('0x29'):_0x7874('0x27')):null);});})[_0x7874('0x2c')](function(_0x315495){logger[_0x7874('0x2d')](util[_0x7874('0xb')](_0x7874('0x2e'),EXTRACTED_REPORT_ID,'XLSX'),util['inspect'](_0x315495,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x7874('0x2f'));})[_0x7874('0x30')](function(){process[_0x7874('0x31')](EXIT_CODE);});}main(); \ No newline at end of file +var _0x4091=['QueryTypes','SELECT','num','Empty','isInteger','forEach','push','%s\x20limit\x20%d\x20OFFSET\x20%d','basename','split','length','existsSync','join','mkdirSync','each','%s%d.%s','xlsx','binary','%s.%s','zip','zip\x20finished','catch','Failed','finally','exit','lodash','json2xls','bluebird','rimraf','../../mysqldb','dbH','analytics','argv','AnalyticExtractedReport','update','info','XLSX','Setting','find','splitSizeXlsx','then','sequelize','query','format','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t'];(function(_0x1f9c91,_0x21ca4){var _0x446b78=function(_0x39a9bf){while(--_0x39a9bf){_0x1f9c91['push'](_0x1f9c91['shift']());}};_0x446b78(++_0x21ca4);}(_0x4091,0x181));var _0x1409=function(_0x1306f3,_0x1da761){_0x1306f3=_0x1306f3-0x0;var _0xc1c7bf=_0x4091[_0x1306f3];return _0xc1c7bf;};'use strict';var util=require('util');var path=require('path');var _=require(_0x1409('0x0'));var fs=require('fs');var json2xls=require(_0x1409('0x1'));var BPromise=require(_0x1409('0x2'));var zipdir=require('zip-dir');var rimraf=require(_0x1409('0x3'));var db=require(_0x1409('0x4'))['db'];var dbH=require(_0x1409('0x4'))[_0x1409('0x5')];var logger=require('../../config/logger')(_0x1409('0x6'));var EXTRACTED_REPORT_ID=Number(process[_0x1409('0x7')][0x2]);var QUERY=process[_0x1409('0x7')][0x3];var PATH=process[_0x1409('0x7')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x322d36,_0x380e11){var _0x749046={'status':_0x322d36};var _0x27bc2e={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x380e11){_0x749046['savename']=_0x380e11;}return db[_0x1409('0x8')][_0x1409('0x9')](_0x749046,_0x27bc2e);}function main(){var _0x55462d=0x1388;var _0x318648;logger[_0x1409('0xa')](util['format']('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0x1409('0xb')));return db[_0x1409('0xc')][_0x1409('0xd')]({'where':{'id':0x1},'raw':!![],'attributes':['id','split',_0x1409('0xe')]})[_0x1409('0xf')](function(_0xf121fa){if(_0xf121fa){_0x318648=_0xf121fa;_0x55462d=_0x318648['splitSizeXlsx']||0x1388;}})[_0x1409('0xf')](function(){return dbH[_0x1409('0x10')][_0x1409('0x11')](util[_0x1409('0x12')](_0x1409('0x13'),QUERY),{'type':dbH[_0x1409('0x10')][_0x1409('0x14')][_0x1409('0x15')]});})[_0x1409('0xf')](function(_0x5cc902){if(!_0x5cc902[0x0][_0x1409('0x16')]){return analyticExtractedReport(_0x1409('0x17'));}var _0x48c7f9=[];var _0x2fca43=0x0;if(_0x318648['split']){if(_0x5cc902&&_0x5cc902['length']){var _0x1032d6=_['range'](_0x5cc902[0x0][_0x1409('0x16')]/_0x55462d);var _0xadcdf4=Number[_0x1409('0x18')](_0x5cc902[0x0][_0x1409('0x16')]/_0x55462d)?_0x5cc902[0x0][_0x1409('0x16')]%_0x55462d:0x0;_0x1032d6[_0x1409('0x19')](function(_0x452ac8){if(_0x452ac8>0x0){_0x2fca43+=_0x55462d;}_0x48c7f9[_0x1409('0x1a')](dbH[_0x1409('0x10')][_0x1409('0x11')](util['format'](_0x1409('0x1b'),QUERY,_0x55462d,_0x2fca43),{'type':dbH[_0x1409('0x10')]['QueryTypes'][_0x1409('0x15')]}));});if(_0xadcdf4>0x0){_0x2fca43+=_0x55462d;_0x48c7f9[_0x1409('0x1a')](dbH['sequelize'][_0x1409('0x11')](util[_0x1409('0x12')](_0x1409('0x1b'),QUERY,_0xadcdf4,_0x2fca43),{'type':dbH['sequelize'][_0x1409('0x14')][_0x1409('0x15')]}));}}}else{_0x48c7f9['push'](dbH[_0x1409('0x10')]['query'](QUERY,{'type':dbH[_0x1409('0x10')]['QueryTypes'][_0x1409('0x15')]}));}var _0x58a956=path['dirname'](PATH);var _0x1b0931=path[_0x1409('0x1c')](PATH,'.xlsx');var _0x17a2b3=_0x318648[_0x1409('0x1d')]&&_0x48c7f9[_0x1409('0x1e')]>0x1;var _0x4e62c8=[];if(!fs[_0x1409('0x1f')](path[_0x1409('0x20')](_0x58a956,_0x1b0931))&&_0x17a2b3){fs[_0x1409('0x21')](path['join'](_0x58a956,_0x1b0931));}return BPromise[_0x1409('0x22')](_0x48c7f9,function(_0x2dfb0a){_0x4e62c8[_0x1409('0x1a')](_0x2dfb0a);})[_0x1409('0xf')](function(){for(var _0x5343ce=0x0;_0x5343ce<_0x4e62c8[_0x1409('0x1e')];_0x5343ce+=0x1){var _0x4268ec;var _0x36f7a7=_0x4e62c8[_0x5343ce];if(_0x17a2b3){_0x4268ec=path[_0x1409('0x20')](_0x58a956,_0x1b0931,util[_0x1409('0x12')](_0x1409('0x23'),_0x1b0931,_0x5343ce,'xlsx'));}else{_0x4268ec=path[_0x1409('0x20')](_0x58a956,util[_0x1409('0x12')]('%s.%s',_0x1b0931,_0x1409('0x24')));}fs['writeFileSync'](_0x4268ec,json2xls(_0x36f7a7),_0x1409('0x25'));}})[_0x1409('0xf')](function(){if(_0x17a2b3){return new Promise(function(_0x2b4ea9){zipdir(path[_0x1409('0x20')](_0x58a956,_0x1b0931),{'saveTo':path['join'](_0x58a956,util[_0x1409('0x12')](_0x1409('0x26'),_0x1b0931,_0x1409('0x27')))},function(_0x2ae156,_0x1fcd13){rimraf(path['join'](_0x58a956,_0x1b0931),function(){});_0x2b4ea9(_0x1409('0x28'));});});}})[_0x1409('0xf')](function(){logger[_0x1409('0xa')](util[_0x1409('0x12')]('Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed',EXTRACTED_REPORT_ID,_0x1409('0xb')));return analyticExtractedReport('Completed',_0x17a2b3?util[_0x1409('0x12')]('%s.%s',_0x1b0931,_0x17a2b3?_0x1409('0x27'):_0x1409('0x24')):null);});})[_0x1409('0x29')](function(_0x2cc3a4){logger[_0x1409('0xa')](util[_0x1409('0x12')]('Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0x1409('0xb')),util['inspect'](_0x2cc3a4,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x1409('0x2a'));})[_0x1409('0x2b')](function(){process[_0x1409('0x2c')](EXIT_CODE);});}main(); \ No newline at end of file diff --git a/server/components/extensions/rewrite.js b/server/components/extensions/rewrite.js index c318d9f..8e56b56 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 _0x3f3c=['$[${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','splice',',${EXTEN},','last','concat','Hangup','transaction','destroy','VoiceExtension','sortBy','rewrite','lodash','Interval','findAll','then','intervals','models','exten','filter','groupBy','queue','playback','hasOwnProperty','priority','extensions','extension','find','push','type','format','context','VoiceExtensionId','inbound','CDR(routeid)=','CDR(destination)=','cutdigits','${EXTEN:','${EXTEN}','Set','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=noprefix','outboundrouteid=','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','wav','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','length','toLowerCase','createdAt','interval','*,*,*,*','IntervalId','map','tag','CDR(tag)=','outbound','callerID'];(function(_0x912ed1,_0x36b232){var _0x28c16b=function(_0xfe008){while(--_0xfe008){_0x912ed1['push'](_0x912ed1['shift']());}};_0x28c16b(++_0x36b232);}(_0x3f3c,0x9c));var _0xc3f3=function(_0x1d5ce6,_0x2d9205){_0x1d5ce6=_0x1d5ce6-0x0;var _0x4db2d7=_0x3f3c[_0x1d5ce6];return _0x4db2d7;};'use strict';var _=require(_0xc3f3('0x0'));var util=require('util');function rewrite(_0x372aa1,_0x3963c4){var _0x268717=this;return _0x372aa1['models'][_0xc3f3('0x1')][_0xc3f3('0x2')]({'raw':!![]})[_0xc3f3('0x3')](function(_0x5d6328){_0x268717[_0xc3f3('0x4')]=_0x5d6328;return _0x372aa1[_0xc3f3('0x5')]['VoiceExtension'][_0xc3f3('0x2')]({'where':{'IntervalId':_0x3963c4['IntervalId']},'raw':!![]});})[_0xc3f3('0x3')](function(_0x1c8e4e){return _0x372aa1[_0xc3f3('0x5')]['VoiceExtension'][_0xc3f3('0x2')]({'where':{'exten':{'$in':_['uniq'](_['map'](_0x1c8e4e,_0xc3f3('0x6')))}},'order':[{'raw':'CAST(priority\x20AS\x20UNSIGNED)'}],'raw':!![]});})['then'](function(_0x453b35){var _0x20d7df=_[_0xc3f3('0x7')](_0x453b35,{'priority':'1'});var _0x594082=_[_0xc3f3('0x7')](_0x453b35,{'isApp':0x1});var _0x5aeb0f=_[_0xc3f3('0x8')](_0x594082,_0xc3f3('0x6'));var _0x2a61d1=[_0xc3f3('0x9'),_0xc3f3('0xa')];var _0x3d4f19=[];var _0x40dea1=[];for(var _0x4531fd in _0x5aeb0f){if(_0x5aeb0f[_0xc3f3('0xb')](_0x4531fd)){_0x268717[_0xc3f3('0xc')]=0x2;_0x268717[_0xc3f3('0xd')]=[];_0x268717[_0xc3f3('0xe')]=_[_0xc3f3('0xf')](_0x20d7df,{'exten':_0x5aeb0f[_0x4531fd][0x0][_0xc3f3('0x6')]});_0x268717[_0xc3f3('0xd')][_0xc3f3('0x10')]({'type':_0x5aeb0f[_0x4531fd][0x0][_0xc3f3('0x11')],'app':'Set','appdata':util[_0xc3f3('0x12')]('CDR(type)=%s',_0x5aeb0f[_0x4531fd][0x0]['type']),'context':_0x5aeb0f[_0x4531fd][0x0][_0xc3f3('0x13')],'exten':_0x5aeb0f[_0x4531fd][0x0][_0xc3f3('0x6')],'priority':_0x268717['priority']++,'VoiceExtensionId':_0x5aeb0f[_0x4531fd][0x0][_0xc3f3('0x14')]});if(_0x5aeb0f[_0x4531fd][0x0][_0xc3f3('0x11')]===_0xc3f3('0x15')){_0x268717['extensions'][_0xc3f3('0x10')]({'type':_0x5aeb0f[_0x4531fd][0x0][_0xc3f3('0x11')],'app':'Set','appdata':_0xc3f3('0x16')+_0x5aeb0f[_0x4531fd][0x0][_0xc3f3('0x14')],'context':_0x5aeb0f[_0x4531fd][0x0][_0xc3f3('0x13')],'exten':_0x5aeb0f[_0x4531fd][0x0][_0xc3f3('0x6')],'priority':_0x268717['priority']++,'VoiceExtensionId':_0x5aeb0f[_0x4531fd][0x0][_0xc3f3('0x14')]});}else if(_0x5aeb0f[_0x4531fd][0x0]['type']==='outbound'){if(_0x268717[_0xc3f3('0xe')]){_0x268717[_0xc3f3('0xd')][_0xc3f3('0x10')]({'type':_0x5aeb0f[_0x4531fd][0x0][_0xc3f3('0x11')],'app':'Set','appdata':_0xc3f3('0x17')+(_0x268717[_0xc3f3('0xe')][_0xc3f3('0x18')]?_0xc3f3('0x19')+_0x268717[_0xc3f3('0xe')]['cutdigits']+'}':_0xc3f3('0x1a')),'context':_0x5aeb0f[_0x4531fd][0x0][_0xc3f3('0x13')],'exten':_0x5aeb0f[_0x4531fd][0x0][_0xc3f3('0x6')],'priority':_0x268717[_0xc3f3('0xc')]++,'VoiceExtensionId':_0x5aeb0f[_0x4531fd][0x0][_0xc3f3('0x14')]});}_0x268717['extensions'][_0xc3f3('0x10')]({'type':_0x5aeb0f[_0x4531fd][0x0][_0xc3f3('0x11')],'app':_0xc3f3('0x1b'),'appdata':'CDR(routeid)='+_0x5aeb0f[_0x4531fd][0x0][_0xc3f3('0x14')],'context':_0x5aeb0f[_0x4531fd][0x0][_0xc3f3('0x13')],'exten':_0x5aeb0f[_0x4531fd][0x0][_0xc3f3('0x6')],'priority':_0x268717['priority']++,'VoiceExtensionId':_0x5aeb0f[_0x4531fd][0x0][_0xc3f3('0x14')]});var _0x362a40=_0x268717[_0xc3f3('0xc')]++;_0x268717[_0xc3f3('0xd')][_0xc3f3('0x10')]({'type':_0x5aeb0f[_0x4531fd][0x0]['type'],'app':_0xc3f3('0x1c'),'appdata':_0xc3f3('0x1d')+(_0x362a40+0x2)+_0xc3f3('0x1e')+(_0x362a40+0x1)+')','context':_0x5aeb0f[_0x4531fd][0x0]['context'],'exten':_0x5aeb0f[_0x4531fd][0x0][_0xc3f3('0x6')],'priority':_0x362a40,'VoiceExtensionId':_0x5aeb0f[_0x4531fd][0x0]['VoiceExtensionId']});if(_0x268717[_0xc3f3('0xe')]){_0x268717['extensions'][_0xc3f3('0x10')]({'type':_0x5aeb0f[_0x4531fd][0x0][_0xc3f3('0x11')],'app':_0xc3f3('0x1b'),'appdata':_0x268717[_0xc3f3('0xe')]['cutdigits']?'CDR(prefix)=${EXTEN:0:'+_0x268717[_0xc3f3('0xe')][_0xc3f3('0x18')]+'}':_0xc3f3('0x1f'),'context':_0x5aeb0f[_0x4531fd][0x0][_0xc3f3('0x13')],'exten':_0x5aeb0f[_0x4531fd][0x0]['exten'],'priority':_0x268717[_0xc3f3('0xc')]++,'VoiceExtensionId':_0x5aeb0f[_0x4531fd][0x0]['VoiceExtensionId']});}_0x268717[_0xc3f3('0xd')][_0xc3f3('0x10')]({'type':_0x5aeb0f[_0x4531fd][0x0]['type'],'app':_0xc3f3('0x1b'),'appdata':_0xc3f3('0x20')+_0x5aeb0f[_0x4531fd][0x0][_0xc3f3('0x14')],'context':_0x5aeb0f[_0x4531fd][0x0][_0xc3f3('0x13')],'exten':_0x5aeb0f[_0x4531fd][0x0][_0xc3f3('0x6')],'priority':_0x268717['priority']++,'VoiceExtensionId':_0x5aeb0f[_0x4531fd][0x0]['VoiceExtensionId']});if(_0x268717[_0xc3f3('0xe')]&&_0x268717[_0xc3f3('0xe')][_0xc3f3('0xb')](_0xc3f3('0x21'))&&_0x268717[_0xc3f3('0xe')][_0xc3f3('0x21')]!==_0xc3f3('0x22')){_0x268717[_0xc3f3('0xd')][_0xc3f3('0x10')]({'type':_0x5aeb0f[_0x4531fd][0x0][_0xc3f3('0x11')],'app':_0xc3f3('0x1b'),'appdata':_0xc3f3('0x23'),'context':_0x5aeb0f[_0x4531fd][0x0]['context'],'exten':_0x5aeb0f[_0x4531fd][0x0][_0xc3f3('0x6')],'priority':_0x268717[_0xc3f3('0xc')]++,'VoiceExtensionId':_0x5aeb0f[_0x4531fd][0x0][_0xc3f3('0x14')]});_0x268717[_0xc3f3('0xd')]['push']({'type':_0x5aeb0f[_0x4531fd][0x0][_0xc3f3('0x11')],'app':_0xc3f3('0x1b'),'appdata':_0xc3f3('0x24')+_0x268717[_0xc3f3('0xe')]['recordingFormat']||_0xc3f3('0x25'),'context':_0x5aeb0f[_0x4531fd][0x0]['context'],'exten':_0x5aeb0f[_0x4531fd][0x0]['exten'],'priority':_0x268717[_0xc3f3('0xc')]++,'VoiceExtensionId':_0x5aeb0f[_0x4531fd][0x0]['VoiceExtensionId']});}}_0x268717['extensions'][_0xc3f3('0x10')]({'type':_0x5aeb0f[_0x4531fd][0x0][_0xc3f3('0x11')],'app':_0xc3f3('0x1b'),'appdata':_0xc3f3('0x26'),'context':_0x5aeb0f[_0x4531fd][0x0]['context'],'exten':_0x5aeb0f[_0x4531fd][0x0][_0xc3f3('0x6')],'priority':_0x268717['priority']++,'VoiceExtensionId':_0x5aeb0f[_0x4531fd][0x0][_0xc3f3('0x14')]});_0x268717['extensions'][_0xc3f3('0x10')]({'type':_0x5aeb0f[_0x4531fd][0x0][_0xc3f3('0x11')],'app':_0xc3f3('0x1b'),'appdata':_0xc3f3('0x27'),'context':_0x5aeb0f[_0x4531fd][0x0][_0xc3f3('0x13')],'exten':_0x5aeb0f[_0x4531fd][0x0][_0xc3f3('0x6')],'priority':_0x268717[_0xc3f3('0xc')]++,'VoiceExtensionId':_0x5aeb0f[_0x4531fd][0x0][_0xc3f3('0x14')]});_0x268717['extensions'][_0xc3f3('0x10')]({'type':_0x5aeb0f[_0x4531fd][0x0][_0xc3f3('0x11')],'app':'Set','appdata':'MONITOR_OPTIONS=ab','context':_0x5aeb0f[_0x4531fd][0x0][_0xc3f3('0x13')],'exten':_0x5aeb0f[_0x4531fd][0x0][_0xc3f3('0x6')],'priority':_0x268717[_0xc3f3('0xc')]++,'VoiceExtensionId':_0x5aeb0f[_0x4531fd][0x0][_0xc3f3('0x14')]});for(var _0x3666bf=0x0,_0x3510d4=0x0;_0x3666bf<_0x5aeb0f[_0x4531fd][_0xc3f3('0x28')];_0x3666bf+=0x1,_0x3510d4=0x0){var _0x260ca7=_0x5aeb0f[_0x4531fd][_0x3666bf];if(_0x260ca7['type']){_0x260ca7[_0xc3f3('0x11')]=_0x260ca7['type'][_0xc3f3('0x29')]();}var _0x512c13=[];var _0x4cf6d8=[];delete _0x260ca7['id'];delete _0x260ca7[_0xc3f3('0x2a')];delete _0x260ca7['updatedAt'];var _0x35363c=_0x260ca7[_0xc3f3('0x2b')]!==_0xc3f3('0x2c')?[_0x260ca7[_0xc3f3('0x2b')]]:_0x260ca7[_0xc3f3('0x2d')]?_[_0xc3f3('0x2e')](_['filter'](_0x268717['intervals'],{'IntervalId':_0x260ca7[_0xc3f3('0x2d')]}),_0xc3f3('0x2b')):[];if(_0x260ca7['hasOwnProperty'](_0xc3f3('0x2f'))){if(_0x260ca7[_0xc3f3('0x2f')]&&_0x260ca7['tag']!=='--'){_0x512c13['push']({'type':_0x260ca7[_0xc3f3('0x11')],'app':_0xc3f3('0x1b'),'appdata':_0xc3f3('0x30')+_0x260ca7['tag'],'context':_0x260ca7['context'],'exten':_0x260ca7[_0xc3f3('0x6')],'priority':_0x35363c['length']+_0x268717[_0xc3f3('0xc')]+_0x3510d4++,'VoiceExtensionId':_0x260ca7[_0xc3f3('0x14')]});}}if(_0x260ca7[_0xc3f3('0x11')]===_0xc3f3('0x31')&&_0x260ca7[_0xc3f3('0xb')]('callerID')){if(_0x260ca7[_0xc3f3('0x32')]){_0x512c13[_0xc3f3('0x10')]({'type':_0x260ca7[_0xc3f3('0x11')],'app':_0xc3f3('0x1c'),'appdata':_0xc3f3('0x33')+_0x260ca7[_0xc3f3('0x32')]+')','context':_0x260ca7[_0xc3f3('0x13')],'exten':_0x260ca7['exten'],'priority':_0x35363c['length']+_0x268717[_0xc3f3('0xc')]+_0x3510d4++,'VoiceExtensionId':_0x260ca7['VoiceExtensionId']});}else{_0x512c13[_0xc3f3('0x10')]({'type':_0x260ca7[_0xc3f3('0x11')],'app':_0xc3f3('0x1c'),'appdata':_0xc3f3('0x34'),'context':_0x260ca7['context'],'exten':_0x260ca7[_0xc3f3('0x6')],'priority':_0x35363c[_0xc3f3('0x28')]+_0x268717[_0xc3f3('0xc')]+_0x3510d4++,'VoiceExtensionId':_0x260ca7[_0xc3f3('0x14')]});}}if(_0x260ca7[_0xc3f3('0xb')](_0xc3f3('0x35'))){if(_0x2a61d1[_0xc3f3('0x36')](_0x260ca7[_0xc3f3('0x37')][_0xc3f3('0x29')]())>=0x0&&_0x260ca7['appType']!==_0xc3f3('0x38')){if(_0x260ca7['answer']){_0x512c13[_0xc3f3('0x10')]({'type':_0x260ca7['type'],'app':_0xc3f3('0x1c'),'appdata':_0xc3f3('0x39'),'context':_0x260ca7[_0xc3f3('0x13')],'exten':_0x260ca7[_0xc3f3('0x6')],'priority':_0x35363c[_0xc3f3('0x28')]+_0x268717[_0xc3f3('0xc')]+_0x3510d4++,'VoiceExtensionId':_0x260ca7[_0xc3f3('0x14')]});_0x512c13['push']({'type':_0x260ca7[_0xc3f3('0x11')],'app':_0xc3f3('0x1b'),'appdata':_0xc3f3('0x3a'),'context':_0x260ca7[_0xc3f3('0x13')],'exten':_0x260ca7[_0xc3f3('0x6')],'priority':_0x35363c['length']+_0x268717[_0xc3f3('0xc')]+_0x3510d4++,'VoiceExtensionId':_0x260ca7[_0xc3f3('0x14')]});}else{_0x512c13[_0xc3f3('0x10')]({'type':_0x260ca7[_0xc3f3('0x11')],'app':_0xc3f3('0x1c'),'appdata':'$[${XCALLY-MOTION-PROGRESS}=0]?Progress','context':_0x260ca7[_0xc3f3('0x13')],'exten':_0x260ca7[_0xc3f3('0x6')],'priority':_0x35363c[_0xc3f3('0x28')]+_0x268717[_0xc3f3('0xc')]+_0x3510d4++,'VoiceExtensionId':_0x260ca7[_0xc3f3('0x14')]});_0x512c13[_0xc3f3('0x10')]({'type':_0x260ca7[_0xc3f3('0x11')],'app':_0xc3f3('0x1b'),'appdata':'XCALLY-MOTION-PROGRESS=1','context':_0x260ca7['context'],'exten':_0x260ca7[_0xc3f3('0x6')],'priority':_0x35363c[_0xc3f3('0x28')]+_0x268717[_0xc3f3('0xc')]+_0x3510d4++,'VoiceExtensionId':_0x260ca7[_0xc3f3('0x14')]});}}}for(var _0xd29388=0x0;_0xd29388<_0x35363c['length'];_0xd29388+=0x1){var _0x19a3b3=_0x268717[_0xc3f3('0xc')]+_0x35363c[_0xc3f3('0x28')];var _0x5dc398=_0xd29388===_0x35363c['length']-0x1?_0x268717[_0xc3f3('0xc')]+_0x512c13['length']+_0x4cf6d8['length']+0x2:_0x268717[_0xc3f3('0xc')]+_0xd29388+0x1;_0x512c13[_0xc3f3('0x3b')](_0xd29388,0x0,{'type':_0x260ca7['type'],'app':'GotoIfTime','appdata':_0x35363c[_0xd29388]+'?'+_0x260ca7['context']+_0xc3f3('0x3c')+_0x19a3b3+':'+_0x260ca7[_0xc3f3('0x13')]+',${EXTEN},'+_0x5dc398,'exten':_0x260ca7['exten'],'context':_0x260ca7['context'],'priority':_0x268717[_0xc3f3('0xc')]+_0xd29388,'VoiceExtensionId':_0x5aeb0f[_0x4531fd][0x0][_0xc3f3('0x14')]});}_0x260ca7[_0xc3f3('0xc')]=_0x512c13['length']?_[_0xc3f3('0x3d')](_0x512c13)[_0xc3f3('0xc')]+0x1:_0x268717[_0xc3f3('0xc')];_0x268717[_0xc3f3('0xc')]=(_0x4cf6d8[_0xc3f3('0x28')]?_['last'](_0x4cf6d8)[_0xc3f3('0xc')]:_0x260ca7['priority'])+0x1;_0x268717[_0xc3f3('0xd')]=_[_0xc3f3('0x3e')](_0x268717[_0xc3f3('0xd')],_0x512c13,[_0x260ca7],_0x4cf6d8);}_0x268717[_0xc3f3('0xd')][_0xc3f3('0x10')]({'type':_0x5aeb0f[_0x4531fd][0x0][_0xc3f3('0x11')],'app':_0xc3f3('0x3f'),'exten':_0x5aeb0f[_0x4531fd][0x0]['exten'],'context':_0x5aeb0f[_0x4531fd][0x0][_0xc3f3('0x13')],'priority':_0x268717[_0xc3f3('0xc')],'VoiceExtensionId':_0x5aeb0f[_0x4531fd][0x0][_0xc3f3('0x14')]});_0x3d4f19[_0xc3f3('0x10')](_0x5aeb0f[_0x4531fd][0x0][_0xc3f3('0x14')]);_0x40dea1=_[_0xc3f3('0x3e')](_0x40dea1,_0x268717[_0xc3f3('0xd')]);}}return _0x372aa1[_0xc3f3('0x40')](function(_0xfa7e52){return _0x372aa1[_0xc3f3('0x5')]['VoiceExtension'][_0xc3f3('0x41')]({'where':{'VoiceExtensionId':{'$in':_0x3d4f19}},'transaction':_0xfa7e52})['then'](function(_0x47f41f){return _0x372aa1[_0xc3f3('0x5')][_0xc3f3('0x42')]['bulkCreate'](_[_0xc3f3('0x43')](_0x40dea1,_0xc3f3('0xc')),{'transaction':_0xfa7e52});});});})['catch'](function(_0x48fc3e){console['error'](_0x48fc3e);});}exports[_0xc3f3('0x44')]=rewrite; \ No newline at end of file +var _0xb744=['extension','find','extensions','Set','format','CDR(type)=%s','context','VoiceExtensionId','type','CDR(routeid)=','outbound','push','CDR(destination)=','cutdigits','${EXTEN:','${EXTEN}','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=${EXTEN:0:','hasOwnProperty','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','wav','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','length','toLowerCase','createdAt','*,*,*,*','interval','map','intervals','tag','callerID','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)=','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','answer','indexOf','app','appType','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice','GotoIfTime',',${EXTEN},','last','concat','transaction','models','destroy','bulkCreate','sortBy','catch','error','rewrite','lodash','util','Interval','findAll','then','VoiceExtension','IntervalId','exten','CAST(priority\x20AS\x20UNSIGNED)','filter','groupBy','queue','playback','priority'];(function(_0x2bd211,_0x522300){var _0x5b963e=function(_0x553314){while(--_0x553314){_0x2bd211['push'](_0x2bd211['shift']());}};_0x5b963e(++_0x522300);}(_0xb744,0x11e));var _0x4b74=function(_0x4db930,_0x48c12b){_0x4db930=_0x4db930-0x0;var _0x25fe04=_0xb744[_0x4db930];return _0x25fe04;};'use strict';var _=require(_0x4b74('0x0'));var util=require(_0x4b74('0x1'));function rewrite(_0x3db289,_0x3dcd9f){var _0x2795df=this;return _0x3db289['models'][_0x4b74('0x2')][_0x4b74('0x3')]({'raw':!![]})[_0x4b74('0x4')](function(_0x207618){_0x2795df['intervals']=_0x207618;return _0x3db289['models'][_0x4b74('0x5')][_0x4b74('0x3')]({'where':{'IntervalId':_0x3dcd9f[_0x4b74('0x6')]},'raw':!![]});})[_0x4b74('0x4')](function(_0x5a6f2a){return _0x3db289['models'][_0x4b74('0x5')][_0x4b74('0x3')]({'where':{'exten':{'$in':_['uniq'](_['map'](_0x5a6f2a,_0x4b74('0x7')))}},'order':[{'raw':_0x4b74('0x8')}],'raw':!![]});})[_0x4b74('0x4')](function(_0x36661e){var _0x2758d0=_[_0x4b74('0x9')](_0x36661e,{'priority':'1'});var _0x56d751=_[_0x4b74('0x9')](_0x36661e,{'isApp':0x1});var _0x105f26=_[_0x4b74('0xa')](_0x56d751,_0x4b74('0x7'));var _0x4fa62a=[_0x4b74('0xb'),_0x4b74('0xc')];var _0x61db1a=[];var _0x215186=[];for(var _0x27dca8 in _0x105f26){if(_0x105f26['hasOwnProperty'](_0x27dca8)){_0x2795df[_0x4b74('0xd')]=0x2;_0x2795df['extensions']=[];_0x2795df[_0x4b74('0xe')]=_[_0x4b74('0xf')](_0x2758d0,{'exten':_0x105f26[_0x27dca8][0x0][_0x4b74('0x7')]});_0x2795df[_0x4b74('0x10')]['push']({'type':_0x105f26[_0x27dca8][0x0]['type'],'app':_0x4b74('0x11'),'appdata':util[_0x4b74('0x12')](_0x4b74('0x13'),_0x105f26[_0x27dca8][0x0]['type']),'context':_0x105f26[_0x27dca8][0x0][_0x4b74('0x14')],'exten':_0x105f26[_0x27dca8][0x0]['exten'],'priority':_0x2795df[_0x4b74('0xd')]++,'VoiceExtensionId':_0x105f26[_0x27dca8][0x0][_0x4b74('0x15')]});if(_0x105f26[_0x27dca8][0x0][_0x4b74('0x16')]==='inbound'){_0x2795df[_0x4b74('0x10')]['push']({'type':_0x105f26[_0x27dca8][0x0][_0x4b74('0x16')],'app':_0x4b74('0x11'),'appdata':_0x4b74('0x17')+_0x105f26[_0x27dca8][0x0][_0x4b74('0x15')],'context':_0x105f26[_0x27dca8][0x0][_0x4b74('0x14')],'exten':_0x105f26[_0x27dca8][0x0][_0x4b74('0x7')],'priority':_0x2795df[_0x4b74('0xd')]++,'VoiceExtensionId':_0x105f26[_0x27dca8][0x0][_0x4b74('0x15')]});}else if(_0x105f26[_0x27dca8][0x0][_0x4b74('0x16')]===_0x4b74('0x18')){if(_0x2795df[_0x4b74('0xe')]){_0x2795df['extensions'][_0x4b74('0x19')]({'type':_0x105f26[_0x27dca8][0x0][_0x4b74('0x16')],'app':'Set','appdata':_0x4b74('0x1a')+(_0x2795df[_0x4b74('0xe')][_0x4b74('0x1b')]?_0x4b74('0x1c')+_0x2795df[_0x4b74('0xe')][_0x4b74('0x1b')]+'}':_0x4b74('0x1d')),'context':_0x105f26[_0x27dca8][0x0][_0x4b74('0x14')],'exten':_0x105f26[_0x27dca8][0x0]['exten'],'priority':_0x2795df[_0x4b74('0xd')]++,'VoiceExtensionId':_0x105f26[_0x27dca8][0x0]['VoiceExtensionId']});}_0x2795df['extensions'][_0x4b74('0x19')]({'type':_0x105f26[_0x27dca8][0x0]['type'],'app':'Set','appdata':_0x4b74('0x17')+_0x105f26[_0x27dca8][0x0]['VoiceExtensionId'],'context':_0x105f26[_0x27dca8][0x0][_0x4b74('0x14')],'exten':_0x105f26[_0x27dca8][0x0]['exten'],'priority':_0x2795df[_0x4b74('0xd')]++,'VoiceExtensionId':_0x105f26[_0x27dca8][0x0][_0x4b74('0x15')]});var _0x5c28cb=_0x2795df[_0x4b74('0xd')]++;_0x2795df[_0x4b74('0x10')][_0x4b74('0x19')]({'type':_0x105f26[_0x27dca8][0x0][_0x4b74('0x16')],'app':_0x4b74('0x1e'),'appdata':_0x4b74('0x1f')+(_0x5c28cb+0x2)+_0x4b74('0x20')+(_0x5c28cb+0x1)+')','context':_0x105f26[_0x27dca8][0x0][_0x4b74('0x14')],'exten':_0x105f26[_0x27dca8][0x0][_0x4b74('0x7')],'priority':_0x5c28cb,'VoiceExtensionId':_0x105f26[_0x27dca8][0x0][_0x4b74('0x15')]});if(_0x2795df['extension']){_0x2795df[_0x4b74('0x10')][_0x4b74('0x19')]({'type':_0x105f26[_0x27dca8][0x0][_0x4b74('0x16')],'app':_0x4b74('0x11'),'appdata':_0x2795df[_0x4b74('0xe')][_0x4b74('0x1b')]?_0x4b74('0x21')+_0x2795df[_0x4b74('0xe')][_0x4b74('0x1b')]+'}':'CDR(prefix)=noprefix','context':_0x105f26[_0x27dca8][0x0]['context'],'exten':_0x105f26[_0x27dca8][0x0]['exten'],'priority':_0x2795df[_0x4b74('0xd')]++,'VoiceExtensionId':_0x105f26[_0x27dca8][0x0]['VoiceExtensionId']});}_0x2795df[_0x4b74('0x10')]['push']({'type':_0x105f26[_0x27dca8][0x0][_0x4b74('0x16')],'app':_0x4b74('0x11'),'appdata':'outboundrouteid='+_0x105f26[_0x27dca8][0x0][_0x4b74('0x15')],'context':_0x105f26[_0x27dca8][0x0][_0x4b74('0x14')],'exten':_0x105f26[_0x27dca8][0x0][_0x4b74('0x7')],'priority':_0x2795df['priority']++,'VoiceExtensionId':_0x105f26[_0x27dca8][0x0][_0x4b74('0x15')]});if(_0x2795df[_0x4b74('0xe')]&&_0x2795df[_0x4b74('0xe')][_0x4b74('0x22')](_0x4b74('0x23'))&&_0x2795df['extension'][_0x4b74('0x23')]!==_0x4b74('0x24')){_0x2795df['extensions'][_0x4b74('0x19')]({'type':_0x105f26[_0x27dca8][0x0][_0x4b74('0x16')],'app':_0x4b74('0x11'),'appdata':_0x4b74('0x25'),'context':_0x105f26[_0x27dca8][0x0][_0x4b74('0x14')],'exten':_0x105f26[_0x27dca8][0x0][_0x4b74('0x7')],'priority':_0x2795df[_0x4b74('0xd')]++,'VoiceExtensionId':_0x105f26[_0x27dca8][0x0][_0x4b74('0x15')]});_0x2795df[_0x4b74('0x10')][_0x4b74('0x19')]({'type':_0x105f26[_0x27dca8][0x0]['type'],'app':'Set','appdata':_0x4b74('0x26')+_0x2795df[_0x4b74('0xe')]['recordingFormat']||_0x4b74('0x27'),'context':_0x105f26[_0x27dca8][0x0][_0x4b74('0x14')],'exten':_0x105f26[_0x27dca8][0x0][_0x4b74('0x7')],'priority':_0x2795df[_0x4b74('0xd')]++,'VoiceExtensionId':_0x105f26[_0x27dca8][0x0][_0x4b74('0x15')]});}}_0x2795df[_0x4b74('0x10')][_0x4b74('0x19')]({'type':_0x105f26[_0x27dca8][0x0][_0x4b74('0x16')],'app':_0x4b74('0x11'),'appdata':'XCALLY-MOTION-ANSWER=0','context':_0x105f26[_0x27dca8][0x0][_0x4b74('0x14')],'exten':_0x105f26[_0x27dca8][0x0][_0x4b74('0x7')],'priority':_0x2795df[_0x4b74('0xd')]++,'VoiceExtensionId':_0x105f26[_0x27dca8][0x0]['VoiceExtensionId']});_0x2795df[_0x4b74('0x10')]['push']({'type':_0x105f26[_0x27dca8][0x0][_0x4b74('0x16')],'app':'Set','appdata':_0x4b74('0x28'),'context':_0x105f26[_0x27dca8][0x0]['context'],'exten':_0x105f26[_0x27dca8][0x0][_0x4b74('0x7')],'priority':_0x2795df[_0x4b74('0xd')]++,'VoiceExtensionId':_0x105f26[_0x27dca8][0x0]['VoiceExtensionId']});_0x2795df[_0x4b74('0x10')][_0x4b74('0x19')]({'type':_0x105f26[_0x27dca8][0x0][_0x4b74('0x16')],'app':'Set','appdata':_0x4b74('0x29'),'context':_0x105f26[_0x27dca8][0x0][_0x4b74('0x14')],'exten':_0x105f26[_0x27dca8][0x0]['exten'],'priority':_0x2795df['priority']++,'VoiceExtensionId':_0x105f26[_0x27dca8][0x0][_0x4b74('0x15')]});for(var _0x27d981=0x0,_0xb1b626=0x0;_0x27d981<_0x105f26[_0x27dca8][_0x4b74('0x2a')];_0x27d981+=0x1,_0xb1b626=0x0){var _0xc89f7f=_0x105f26[_0x27dca8][_0x27d981];if(_0xc89f7f[_0x4b74('0x16')]){_0xc89f7f[_0x4b74('0x16')]=_0xc89f7f[_0x4b74('0x16')][_0x4b74('0x2b')]();}var _0x238d3c=[];var _0xfb43cd=[];delete _0xc89f7f['id'];delete _0xc89f7f[_0x4b74('0x2c')];delete _0xc89f7f['updatedAt'];var _0x164e73=_0xc89f7f['interval']!==_0x4b74('0x2d')?[_0xc89f7f[_0x4b74('0x2e')]]:_0xc89f7f['IntervalId']?_[_0x4b74('0x2f')](_[_0x4b74('0x9')](_0x2795df[_0x4b74('0x30')],{'IntervalId':_0xc89f7f[_0x4b74('0x6')]}),_0x4b74('0x2e')):[];if(_0xc89f7f[_0x4b74('0x22')]('tag')){if(_0xc89f7f['tag']&&_0xc89f7f[_0x4b74('0x31')]!=='--'){_0x238d3c['push']({'type':_0xc89f7f[_0x4b74('0x16')],'app':_0x4b74('0x11'),'appdata':'CDR(tag)='+_0xc89f7f[_0x4b74('0x31')],'context':_0xc89f7f[_0x4b74('0x14')],'exten':_0xc89f7f[_0x4b74('0x7')],'priority':_0x164e73[_0x4b74('0x2a')]+_0x2795df['priority']+_0xb1b626++,'VoiceExtensionId':_0xc89f7f['VoiceExtensionId']});}}if(_0xc89f7f[_0x4b74('0x16')]==='outbound'&&_0xc89f7f[_0x4b74('0x22')](_0x4b74('0x32'))){if(_0xc89f7f['callerID']){_0x238d3c[_0x4b74('0x19')]({'type':_0xc89f7f[_0x4b74('0x16')],'app':'ExecIf','appdata':_0x4b74('0x33')+_0xc89f7f['callerID']+')','context':_0xc89f7f[_0x4b74('0x14')],'exten':_0xc89f7f['exten'],'priority':_0x164e73[_0x4b74('0x2a')]+_0x2795df[_0x4b74('0xd')]+_0xb1b626++,'VoiceExtensionId':_0xc89f7f[_0x4b74('0x15')]});}else{_0x238d3c[_0x4b74('0x19')]({'type':_0xc89f7f[_0x4b74('0x16')],'app':'ExecIf','appdata':_0x4b74('0x34'),'context':_0xc89f7f[_0x4b74('0x14')],'exten':_0xc89f7f[_0x4b74('0x7')],'priority':_0x164e73[_0x4b74('0x2a')]+_0x2795df['priority']+_0xb1b626++,'VoiceExtensionId':_0xc89f7f[_0x4b74('0x15')]});}}if(_0xc89f7f['hasOwnProperty'](_0x4b74('0x35'))){if(_0x4fa62a[_0x4b74('0x36')](_0xc89f7f[_0x4b74('0x37')][_0x4b74('0x2b')]())>=0x0&&_0xc89f7f[_0x4b74('0x38')]!==_0x4b74('0x39')){if(_0xc89f7f[_0x4b74('0x35')]){_0x238d3c['push']({'type':_0xc89f7f[_0x4b74('0x16')],'app':'ExecIf','appdata':_0x4b74('0x3a'),'context':_0xc89f7f[_0x4b74('0x14')],'exten':_0xc89f7f[_0x4b74('0x7')],'priority':_0x164e73['length']+_0x2795df[_0x4b74('0xd')]+_0xb1b626++,'VoiceExtensionId':_0xc89f7f[_0x4b74('0x15')]});_0x238d3c['push']({'type':_0xc89f7f[_0x4b74('0x16')],'app':_0x4b74('0x11'),'appdata':_0x4b74('0x3b'),'context':_0xc89f7f['context'],'exten':_0xc89f7f[_0x4b74('0x7')],'priority':_0x164e73[_0x4b74('0x2a')]+_0x2795df[_0x4b74('0xd')]+_0xb1b626++,'VoiceExtensionId':_0xc89f7f['VoiceExtensionId']});}else{_0x238d3c['push']({'type':_0xc89f7f[_0x4b74('0x16')],'app':_0x4b74('0x1e'),'appdata':_0x4b74('0x3c'),'context':_0xc89f7f[_0x4b74('0x14')],'exten':_0xc89f7f['exten'],'priority':_0x164e73[_0x4b74('0x2a')]+_0x2795df[_0x4b74('0xd')]+_0xb1b626++,'VoiceExtensionId':_0xc89f7f['VoiceExtensionId']});_0x238d3c[_0x4b74('0x19')]({'type':_0xc89f7f['type'],'app':_0x4b74('0x11'),'appdata':_0x4b74('0x3d'),'context':_0xc89f7f[_0x4b74('0x14')],'exten':_0xc89f7f[_0x4b74('0x7')],'priority':_0x164e73[_0x4b74('0x2a')]+_0x2795df[_0x4b74('0xd')]+_0xb1b626++,'VoiceExtensionId':_0xc89f7f[_0x4b74('0x15')]});}}}for(var _0x205489=0x0;_0x205489<_0x164e73[_0x4b74('0x2a')];_0x205489+=0x1){var _0x1614a3=_0x2795df[_0x4b74('0xd')]+_0x164e73[_0x4b74('0x2a')];var _0x2369b2=_0x205489===_0x164e73['length']-0x1?_0x2795df[_0x4b74('0xd')]+_0x238d3c[_0x4b74('0x2a')]+_0xfb43cd[_0x4b74('0x2a')]+0x2:_0x2795df[_0x4b74('0xd')]+_0x205489+0x1;_0x238d3c[_0x4b74('0x3e')](_0x205489,0x0,{'type':_0xc89f7f[_0x4b74('0x16')],'app':_0x4b74('0x3f'),'appdata':_0x164e73[_0x205489]+'?'+_0xc89f7f[_0x4b74('0x14')]+_0x4b74('0x40')+_0x1614a3+':'+_0xc89f7f['context']+_0x4b74('0x40')+_0x2369b2,'exten':_0xc89f7f['exten'],'context':_0xc89f7f['context'],'priority':_0x2795df[_0x4b74('0xd')]+_0x205489,'VoiceExtensionId':_0x105f26[_0x27dca8][0x0][_0x4b74('0x15')]});}_0xc89f7f[_0x4b74('0xd')]=_0x238d3c[_0x4b74('0x2a')]?_['last'](_0x238d3c)['priority']+0x1:_0x2795df[_0x4b74('0xd')];_0x2795df['priority']=(_0xfb43cd[_0x4b74('0x2a')]?_[_0x4b74('0x41')](_0xfb43cd)['priority']:_0xc89f7f['priority'])+0x1;_0x2795df['extensions']=_['concat'](_0x2795df[_0x4b74('0x10')],_0x238d3c,[_0xc89f7f],_0xfb43cd);}_0x2795df[_0x4b74('0x10')][_0x4b74('0x19')]({'type':_0x105f26[_0x27dca8][0x0]['type'],'app':'Hangup','exten':_0x105f26[_0x27dca8][0x0][_0x4b74('0x7')],'context':_0x105f26[_0x27dca8][0x0][_0x4b74('0x14')],'priority':_0x2795df[_0x4b74('0xd')],'VoiceExtensionId':_0x105f26[_0x27dca8][0x0][_0x4b74('0x15')]});_0x61db1a[_0x4b74('0x19')](_0x105f26[_0x27dca8][0x0][_0x4b74('0x15')]);_0x215186=_[_0x4b74('0x42')](_0x215186,_0x2795df[_0x4b74('0x10')]);}}return _0x3db289[_0x4b74('0x43')](function(_0x2ec147){return _0x3db289[_0x4b74('0x44')]['VoiceExtension'][_0x4b74('0x45')]({'where':{'VoiceExtensionId':{'$in':_0x61db1a}},'transaction':_0x2ec147})[_0x4b74('0x4')](function(_0x5c7477){return _0x3db289['models']['VoiceExtension'][_0x4b74('0x46')](_[_0x4b74('0x47')](_0x215186,'priority'),{'transaction':_0x2ec147});});});})[_0x4b74('0x48')](function(_0x2c3016){console[_0x4b74('0x49')](_0x2c3016);});}exports[_0x4b74('0x4a')]=rewrite; \ No newline at end of file diff --git a/server/components/import/cm/csv.js b/server/components/import/cm/csv.js index b91609e..430915b 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 _0x0238=['bluebird','util','lodash','squel','papaparse','../../../mysqldb','../../../config/environment','../../../config/logger','api','redis','localhost','socket.io-emitter','register','argv','undefined','null','Missing\x20filepath\x20parameter!','Missing\x20binding\x20parameters!','zipObject','split','Missing\x20ListId\x20parameter!','Missing\x20socket_timestamp\x20parameter!','error','index','test','isNil','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!','errors','map','join','hasOwnProperty','firstName\x20not\x20specified!','phone\x20not\x20specified!','birthDate','YYYY-MM-DD','isValid','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!','email\x20format\x20is\x20not\x20valid!','length','Duplicate\x20Contact','CmContact','create','push','pick','Error\x20while\x20creating\x20contact:\x20','stringify','cmContact','checkHopper','insert','cm_hopper','scheduledAt','ContactId','ListId','updatedAt','select','phone','field','NOW()','toString','createdAt','from','cm_contacts','where','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20NOT\x20IN\x20(?)','into','fromQuery','str','phone\x20IS\x20NOT\x20NULL','\x20=\x20?','id\x20IN\x20?','VoiceQueue','findAll','outbound','dialCheckDuplicateType','CmList','then','get','sequelize','VoiceQueueId','catch','query','all','BlackLists','Campaign','Lists','always','onlyIfOpen','CampaignId','cmContact,\x20%s,\x20%s','generalCheckHopper','finally','emit','contact:csv_','resume','resolve','unlinkSync','Unable\x20to\x20delete\x20temp\x20file:','exit','SIGINT','CSV\x20import\x20process\x20stopped!','createReadStream','parse','info','CSV\x20parsed\x20correctly!','CSV\x20parse\x20error','Error\x20executing\x20contact\x20csv\x20import:'];(function(_0xee5d2a,_0x534134){var _0x346948=function(_0x458fdf){while(--_0x458fdf){_0xee5d2a['push'](_0xee5d2a['shift']());}};_0x346948(++_0x534134);}(_0x0238,0x1b0));var _0x8023=function(_0xa041de,_0x3600e2){_0xa041de=_0xa041de-0x0;var _0x1d654c=_0x0238[_0xa041de];return _0x1d654c;};'use strict';var BPromise=require(_0x8023('0x0'));var util=require(_0x8023('0x1'));var _=require(_0x8023('0x2'));var fs=require('fs');var squel=require(_0x8023('0x3'));var Papa=require(_0x8023('0x4'));var Redis=require('ioredis');var db=require(_0x8023('0x5'))['db'];var config=require(_0x8023('0x6'));var logger=require(_0x8023('0x7'))(_0x8023('0x8'));config[_0x8023('0x9')]=_['defaults'](config[_0x8023('0x9')],{'host':_0x8023('0xa'),'port':0x18eb});var socket=require(_0x8023('0xb'))(new Redis(config[_0x8023('0x9')]));require('../../../api/cmContact/cmContact.socket')[_0x8023('0xc')](socket);try{if(!process[_0x8023('0xd')][0x2]||process[_0x8023('0xd')][0x2]===_0x8023('0xe')||process[_0x8023('0xd')][0x2]===_0x8023('0xf')){throw new Error(_0x8023('0x10'));}var FILEPATH=process[_0x8023('0xd')][0x2];if(!process[_0x8023('0xd')][0x3]||process[_0x8023('0xd')][0x3]===_0x8023('0xe')||process[_0x8023('0xd')][0x3]===_0x8023('0xf')||!process[_0x8023('0xd')][0x4]||process[_0x8023('0xd')][0x4]===_0x8023('0xe')||process[_0x8023('0xd')][0x4]==='null'){throw new Error(_0x8023('0x11'));}var FIELDS=_[_0x8023('0x12')](process[_0x8023('0xd')][0x3]['split'](','),process[_0x8023('0xd')][0x4][_0x8023('0x13')](','));if(!process['argv'][0x5]||process[_0x8023('0xd')][0x5]==='undefined'||process['argv'][0x5]==='null'){throw new Error(_0x8023('0x14'));}var LISTID=process[_0x8023('0xd')][0x5];var COMPANYID=process[_0x8023('0xd')][0x6]&&process['argv'][0x6]!==_0x8023('0xe')&&process[_0x8023('0xd')][0x6]!==_0x8023('0xf')?process[_0x8023('0xd')][0x6]:null;var DUPLICATES=process[_0x8023('0xd')][0x7]&&process[_0x8023('0xd')][0x7]!=='undefined'&&process[_0x8023('0xd')][0x7]!==_0x8023('0xf')?process[_0x8023('0xd')][0x7]:null;if(!process[_0x8023('0xd')][0x8]||process[_0x8023('0xd')][0x8]===_0x8023('0xe')||process[_0x8023('0xd')][0x8]===_0x8023('0xf')){throw new Error(_0x8023('0x15'));}var SOCKET_TIMESTAMP=process['argv'][0x8];}catch(_0x5092c1){logger[_0x8023('0x16')](_0x5092c1);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(_0x242ff8,_0x289297,_0x53ec1f,_0x53134b){var _0xbb43c8={'message':_0x289297};_0xbb43c8[_0x242ff8]=!![];if(_0x53ec1f){_0xbb43c8['contact']=_0x53ec1f;}if(_0x53134b){_0xbb43c8[_0x8023('0x17')]=_0x53134b;}return _0xbb43c8;}function isEmail(_0x48a928){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))*$/[_0x8023('0x18')](_0x48a928);}function checkRow(_0x520900,_0x81f137,_0x5cb756){return new BPromise(function(_0x4a64ba,_0x5d4a0f){if(_[_0x8023('0x19')](_0x520900)){return _0x5d4a0f(handleCheckRowError(_0x8023('0x16'),_0x8023('0x1a'),null,_0x5cb756));}if(_0x520900[_0x8023('0x1b')]&&_0x520900[_0x8023('0x1b')]['length']){var _0x25dbc4=_[_0x8023('0x1c')](_0x520900['errors'],'message')[_0x8023('0x1d')](';');return _0x5d4a0f(handleCheckRowError(_0x8023('0x16'),_0x25dbc4,null,_0x5cb756));}var _0x3c5eeb={};for(var _0x21c5cd in FIELDS){if(FIELDS[_0x8023('0x1e')](_0x21c5cd)&&FIELDS[_0x21c5cd]){_0x3c5eeb[_0x21c5cd]=_0x520900['data'][0x0][FIELDS[_0x21c5cd]]||_0x520900['data'][0x0]['\ufeff'+FIELDS[_0x21c5cd]];}}if(!_0x3c5eeb['firstName']){return _0x5d4a0f(handleCheckRowError(_0x8023('0x16'),_0x8023('0x1f'),null,_0x5cb756));}if(!_0x3c5eeb['phone']){return _0x5d4a0f(handleCheckRowError(_0x8023('0x16'),_0x8023('0x20'),null,_0x5cb756));}if(_0x3c5eeb[_0x8023('0x21')]){var _0x10b264=moment(_0x3c5eeb[_0x8023('0x21')],_0x8023('0x22'));if(!_0x10b264[_0x8023('0x23')]()){return _0x5d4a0f(handleCheckRowError(_0x8023('0x16'),_0x8023('0x24'),null,_0x5cb756));}}if(_0x3c5eeb['email']){if(!isEmail(_0x3c5eeb['email'])){return _0x5d4a0f(handleCheckRowError(_0x8023('0x16'),_0x8023('0x25'),null,_0x5cb756));}}_0x3c5eeb['ListId']=LISTID;_0x3c5eeb['CompanyId']=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0x8023('0x26')]&&_0x81f137){var _0xa84c3e={};for(var _0x1a4072=0x0,_0x314fa8=DUPLICATES[_0x8023('0x26')];_0x1a4072<_0x314fa8;_0x1a4072+=0x1){_0xa84c3e[DUPLICATES[_0x1a4072]]=_0x3c5eeb[DUPLICATES[_0x1a4072]];}var _0x419a93=_['find'](_0x81f137,_0xa84c3e);if(_0x419a93){return _0x5d4a0f(handleCheckRowError('duplicate',_0x8023('0x27'),_0x419a93,_0x5cb756));}}return db[_0x8023('0x28')][_0x8023('0x29')](_0x3c5eeb,{'raw':!![],'hooks':![],'fields':_['keys'](_0x3c5eeb)})['then'](function(_0x335004){if(DUPLICATES&&DUPLICATES[_0x8023('0x26')]&&_0x81f137){_0x81f137[_0x8023('0x2a')](_[_0x8023('0x2b')](_0x3c5eeb,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x335004['id'];return _0x4a64ba();})['catch'](function(_0x290f36){return _0x5d4a0f(handleCheckRowError(_0x8023('0x16'),_0x8023('0x2c')+(_0x290f36['message']||JSON[_0x8023('0x2d')](_0x290f36)),null,_0x5cb756));});});}function checkHopper(){function _0x1d8c48(){return function(_0x5eb5f5){logger['error'](_0x8023('0x2e'),_0x8023('0x2f'),util['inspect'](_0x5eb5f5,{'showHidden':![],'depth':null}));};}var _0x190313=function(_0x1595c4,_0x1d6157){var _0x245a69=squel[_0x8023('0x30')]()['into'](_0x8023('0x31'))['fromQuery'](['phone',_0x8023('0x32'),_0x8023('0x33'),_0x8023('0x34'),_0x1d6157,'createdAt',_0x8023('0x35')],squel[_0x8023('0x36')]()['field'](_0x8023('0x37'),'phone')[_0x8023('0x38')](_0x8023('0x39'),_0x8023('0x32'))[_0x8023('0x38')]('id','ContactId')[_0x8023('0x38')](LISTID[_0x8023('0x3a')](),'ListId')[_0x8023('0x38')](_0x1595c4['id'][_0x8023('0x3a')](),_0x1d6157)[_0x8023('0x38')](_0x8023('0x39'),_0x8023('0x3b'))[_0x8023('0x38')](_0x8023('0x39'),_0x8023('0x35'))[_0x8023('0x3c')](_0x8023('0x3d'))[_0x8023('0x3e')](_0x8023('0x3f'))[_0x8023('0x3e')](_0x8023('0x40'),LISTID[_0x8023('0x3a')]())[_0x8023('0x3e')]('phone\x20IS\x20NOT\x20NULL')[_0x8023('0x3e')](_0x8023('0x41'),squel[_0x8023('0x36')]()[_0x8023('0x38')](_0x8023('0x37'))[_0x8023('0x3c')](_0x8023('0x31'))[_0x8023('0x3e')](_0x1d6157+'\x20=\x20?',_0x1595c4['id'][_0x8023('0x3a')]())))[_0x8023('0x3a')]();return _0x245a69;};var _0x1ae5e0=function(_0x5f07aa,_0x10f0ef){var _0x48833d=squel[_0x8023('0x30')]()[_0x8023('0x42')](_0x8023('0x31'))[_0x8023('0x43')](['phone','scheduledAt',_0x8023('0x33'),_0x8023('0x34'),_0x10f0ef,_0x8023('0x3b'),_0x8023('0x35')],squel[_0x8023('0x36')]()[_0x8023('0x38')](_0x8023('0x37'),'phone')[_0x8023('0x38')](_0x8023('0x39'),'scheduledAt')[_0x8023('0x38')]('id','ContactId')[_0x8023('0x38')](LISTID[_0x8023('0x3a')](),_0x8023('0x34'))['field'](_0x5f07aa['id'][_0x8023('0x3a')](),_0x10f0ef)[_0x8023('0x38')]('NOW()',_0x8023('0x3b'))['field'](_0x8023('0x39'),_0x8023('0x35'))[_0x8023('0x3c')](_0x8023('0x3d'))[_0x8023('0x3e')](_0x8023('0x3f'))[_0x8023('0x3e')](_0x8023('0x40'),LISTID['toString']())[_0x8023('0x3e')]('id\x20IN\x20?',squel[_0x8023('0x44')](hopperContacts))['where'](_0x8023('0x45'))['where']('phone\x20NOT\x20IN\x20(?)',squel[_0x8023('0x36')]()[_0x8023('0x38')]('calleridnum')[_0x8023('0x3c')]('cm_hopper_final')[_0x8023('0x3e')](_0x10f0ef+_0x8023('0x46'),_0x5f07aa['id'][_0x8023('0x3a')]()))['where']('phone\x20NOT\x20IN\x20(?)',squel[_0x8023('0x36')]()[_0x8023('0x38')](_0x8023('0x37'))['from']('cm_hopper')[_0x8023('0x3e')](_0x10f0ef+_0x8023('0x46'),_0x5f07aa['id'][_0x8023('0x3a')]())))[_0x8023('0x3a')]();return _0x48833d;};function _0x3dbc0e(_0x45d824,_0x29e2bd){var _0x2fc407=squel[_0x8023('0x30')]()[_0x8023('0x42')]('cm_hopper')[_0x8023('0x43')]([_0x8023('0x37'),_0x8023('0x32'),'ContactId',_0x8023('0x34'),_0x29e2bd,'createdAt','updatedAt'],squel['select']()['field'](_0x8023('0x37'),'phone')[_0x8023('0x38')]('NOW()',_0x8023('0x32'))[_0x8023('0x38')]('id',_0x8023('0x33'))['field'](LISTID[_0x8023('0x3a')](),_0x8023('0x34'))[_0x8023('0x38')](_0x45d824['id'][_0x8023('0x3a')](),_0x29e2bd)['field'](_0x8023('0x39'),_0x8023('0x3b'))['field']('NOW()',_0x8023('0x35'))[_0x8023('0x3c')](_0x8023('0x3d'))['where'](_0x8023('0x3f'))[_0x8023('0x3e')](_0x8023('0x40'),LISTID[_0x8023('0x3a')]())[_0x8023('0x3e')](_0x8023('0x47'),squel[_0x8023('0x44')](hopperContacts))[_0x8023('0x3e')](_0x8023('0x45')))['toString']();return _0x2fc407;}function _0x1e83e4(_0x2da168,_0x5530a6){var _0x2a459f=squel[_0x8023('0x30')]()[_0x8023('0x42')]('cm_hopper_black')['fromQuery']([_0x8023('0x37'),_0x8023('0x33'),_0x8023('0x34'),_0x5530a6,_0x8023('0x3b'),'updatedAt'],squel['select']()['field'](_0x8023('0x37'),_0x8023('0x37'))[_0x8023('0x38')]('id','ContactId')['field'](LISTID[_0x8023('0x3a')](),_0x8023('0x34'))['field'](_0x2da168['id'][_0x8023('0x3a')](),_0x5530a6)['field'](_0x8023('0x39'),_0x8023('0x3b'))['field']('NOW()',_0x8023('0x35'))[_0x8023('0x3c')](_0x8023('0x3d'))['where'](_0x8023('0x3f'))[_0x8023('0x3e')](_0x8023('0x40'),LISTID[_0x8023('0x3a')]())['where'](_0x8023('0x47'),squel[_0x8023('0x44')](hopperContacts))[_0x8023('0x3e')](_0x8023('0x45')))[_0x8023('0x3a')]();return _0x2a459f;}return db[_0x8023('0x48')][_0x8023('0x49')]({'where':{'type':_0x8023('0x4a')},'attributes':['id',_0x8023('0x4b')],'include':[{'model':db[_0x8023('0x4c')],'as':'Lists','where':{'id':LISTID}}]})[_0x8023('0x4d')](function(_0x1e7af9){var _0x1237ab=[];if(_0x1e7af9){var _0x593019;for(var _0x9e81c2=0x0,_0x1d7dd2;_0x9e81c2<_0x1e7af9['length'];_0x9e81c2+=0x1){_0x1d7dd2=_0x1e7af9[_0x9e81c2][_0x8023('0x4e')]({'plain':!![]});switch(_0x1d7dd2[_0x8023('0x4b')]){case'always':_0x1237ab[_0x8023('0x2a')](db[_0x8023('0x4f')]['query'](_0x1ae5e0(_0x1d7dd2,_0x8023('0x50')))['then'](function(){})[_0x8023('0x51')](_0x1d8c48()));break;case'onlyIfOpen':_0x1237ab[_0x8023('0x2a')](db[_0x8023('0x4f')][_0x8023('0x52')](_0x190313(_0x1d7dd2,_0x8023('0x50')))[_0x8023('0x4d')](function(){})[_0x8023('0x51')](_0x1d8c48()));break;default:_0x1237ab[_0x8023('0x2a')](db[_0x8023('0x4f')][_0x8023('0x52')](_0x3dbc0e(_0x1d7dd2,_0x8023('0x50')))[_0x8023('0x4d')](function(){})[_0x8023('0x51')](_0x1d8c48()));}}}return _0x1237ab;})[_0x8023('0x53')]()[_0x8023('0x4d')](function(){return db[_0x8023('0x48')]['findAll']({'where':{'type':_0x8023('0x4a')},'attributes':['id'],'include':[{'model':db['CmList'],'as':_0x8023('0x54'),'where':{'id':LISTID}}]})[_0x8023('0x4d')](function(_0x3aaf25){var _0x3e3537=[];if(_0x3aaf25){var _0x187de4;for(var _0x13bcc3=0x0,_0x807a77;_0x13bcc3<_0x3aaf25['length'];_0x13bcc3+=0x1){_0x807a77=_0x3aaf25[_0x13bcc3][_0x8023('0x4e')]({'plain':!![]});_0x3e3537[_0x8023('0x2a')](db[_0x8023('0x4f')][_0x8023('0x52')](_0x1e83e4(_0x807a77,_0x8023('0x50')))[_0x8023('0x4d')](function(){})[_0x8023('0x51')](_0x1d8c48()));}}return _0x3e3537;})[_0x8023('0x53')]();})[_0x8023('0x4d')](function(){return db[_0x8023('0x55')][_0x8023('0x49')]({'attributes':['id',_0x8023('0x4b')],'include':[{'model':db['CmList'],'as':_0x8023('0x56'),'where':{'id':LISTID}}]})['then'](function(_0x77bb4c){var _0x28ecaf=[];if(_0x77bb4c){for(var _0x3a95a4=0x0,_0x1aa741;_0x3a95a4<_0x77bb4c[_0x8023('0x26')];_0x3a95a4+=0x1){_0x1aa741=_0x77bb4c[_0x3a95a4][_0x8023('0x4e')]({'plain':!![]});switch(_0x1aa741['dialCheckDuplicateType']){case _0x8023('0x57'):_0x28ecaf[_0x8023('0x2a')](db['sequelize'][_0x8023('0x52')](_0x1ae5e0(_0x1aa741,'CampaignId'))[_0x8023('0x4d')](function(){})[_0x8023('0x51')](_0x1d8c48()));break;case _0x8023('0x58'):_0x28ecaf[_0x8023('0x2a')](db[_0x8023('0x4f')][_0x8023('0x52')](_0x190313(_0x1aa741,_0x8023('0x59')))[_0x8023('0x4d')](function(){})['catch'](_0x1d8c48()));break;default:_0x28ecaf[_0x8023('0x2a')](db['sequelize'][_0x8023('0x52')](_0x3dbc0e(_0x1aa741,_0x8023('0x59')))[_0x8023('0x4d')](function(){})[_0x8023('0x51')](_0x1d8c48()));}}}return _0x28ecaf;})[_0x8023('0x53')]();})[_0x8023('0x4d')](function(){return db[_0x8023('0x55')]['findAll']({'attributes':['id'],'include':[{'model':db[_0x8023('0x4c')],'as':'BlackLists','where':{'id':LISTID}}]})[_0x8023('0x4d')](function(_0x5713a5){var _0x46abd6=[];if(_0x5713a5){for(var _0x21b3d6=0x0,_0x2b0d9f;_0x21b3d6<_0x5713a5[_0x8023('0x26')];_0x21b3d6+=0x1){_0x2b0d9f=_0x5713a5[_0x21b3d6]['get']({'plain':!![]});_0x46abd6[_0x8023('0x2a')](db[_0x8023('0x4f')]['query'](_0x1e83e4(_0x2b0d9f,'CampaignId'))[_0x8023('0x4d')](function(){})['catch'](_0x1d8c48()));}}return _0x46abd6;})[_0x8023('0x53')]();})[_0x8023('0x51')](function(_0x472065){logger[_0x8023('0x16')](_0x8023('0x5a'),_0x8023('0x5b'),_0x472065['message']);});}var processPromises=function(_0x260a5f){return BPromise['all'](promises)['then'](function(_0x274d63){})[_0x8023('0x51')](function(_0x193e8b){logger[_0x8023('0x16')]('Error\x20processing\x20rows\x20block:',JSON[_0x8023('0x2d')](_0x193e8b));})[_0x8023('0x5c')](function(){socket[_0x8023('0x5d')](_0x8023('0x5e')+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x260a5f){return _0x260a5f[_0x8023('0x5f')]();}});};var endCsv=function(){return BPromise[_0x8023('0x60')]()[_0x8023('0x4d')](function(){if(hopperContacts){return checkHopper();}})[_0x8023('0x4d')](function(){socket[_0x8023('0x5d')](_0x8023('0x5e')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0x8023('0x61')](FILEPATH);}catch(_0x39c23c){logger[_0x8023('0x16')](_0x8023('0x62'),JSON['stringify'](_0x39c23c));}finally{process[_0x8023('0x63')](0x0);}});};process['on'](_0x8023('0x64'),function(){logger['info'](_0x8023('0x65'));endCsv();});function main(){return BPromise[_0x8023('0x60')]()[_0x8023('0x4d')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0x8023('0x13')](',');return db[_0x8023('0x28')][_0x8023('0x49')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})[_0x8023('0x4d')](function(_0x14e0a4){var _0x14c790=fs[_0x8023('0x66')](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0x8023('0x67')](_0x14c790,{'header':!![],'skipEmptyLines':!![],'step':function(_0x1f3d74,_0x3dd027){total+=0x1;var _0x37bd22=total;promises[_0x8023('0x2a')](checkRow(_0x1f3d74,_0x14e0a4,_0x37bd22)['then'](function(){success+=0x1;})[_0x8023('0x51')](function(_0x437361){if(_0x437361[_0x8023('0x16')]){errors+=0x1;delete _0x437361[_0x8023('0x16')];}else if(_0x437361['duplicate']){duplicates+=0x1;delete _0x437361['duplicate'];}rows[_0x8023('0x2a')](_0x437361);}));if(total%0xc8===0x0){_0x3dd027['pause']();return processPromises(_0x3dd027);}},'complete':function(){return processPromises()[_0x8023('0x4d')](function(){logger[_0x8023('0x68')](_0x8023('0x69'));endCsv();});},'error':function(_0x2a5269,_0x191d3b){logger[_0x8023('0x68')](_0x8023('0x6a'),JSON[_0x8023('0x2d')](_0x2a5269));endCsv();}});})[_0x8023('0x51')](function(_0x440c3c){logger[_0x8023('0x16')](_0x8023('0x6b'),JSON[_0x8023('0x2d')](_0x440c3c));});}main(); \ No newline at end of file +var _0xe24f=['undefined','argv','null','Missing\x20filepath\x20parameter!','Missing\x20binding\x20parameters!','zipObject','Missing\x20ListId\x20parameter!','Missing\x20socket_timestamp\x20parameter!','index','test','isNil','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!','errors','message','join','error','hasOwnProperty','data','firstName','firstName\x20not\x20specified!','phone','birthDate','YYYY-MM-DD','isValid','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!','email','ListId','CompanyId','length','find','duplicate','Duplicate\x20Contact','CmContact','then','push','pick','Error\x20while\x20creating\x20contact:\x20','stringify','cmContact','checkHopper','inspect','into','cm_hopper','fromQuery','scheduledAt','ContactId','createdAt','updatedAt','field','NOW()','toString','cm_contacts','where','ListId\x20=\x20?','phone\x20NOT\x20IN\x20(?)','select','from','\x20=\x20?','insert','deletedAt\x20IS\x20NULL','calleridnum','cm_hopper_final','id\x20IN\x20?','phone\x20IS\x20NOT\x20NULL','findAll','outbound','dialCheckDuplicateType','CmList','Lists','get','always','query','VoiceQueueId','catch','onlyIfOpen','sequelize','all','BlackLists','Campaign','CampaignId','cmContact,\x20%s,\x20%s','generalCheckHopper','finally','emit','contact:csv_','resume','resolve','unlinkSync','Unable\x20to\x20delete\x20temp\x20file:','exit','SIGINT','info','createReadStream','pause','CSV\x20parsed\x20correctly!','CSV\x20parse\x20error','Error\x20executing\x20contact\x20csv\x20import:','bluebird','util','lodash','squel','papaparse','ioredis','../../../mysqldb','../../../config/environment','../../../config/logger','api','defaults','localhost','socket.io-emitter','redis','../../../api/cmContact/cmContact.socket'];(function(_0x52d19a,_0x29696a){var _0x8d3079=function(_0x4bbca6){while(--_0x4bbca6){_0x52d19a['push'](_0x52d19a['shift']());}};_0x8d3079(++_0x29696a);}(_0xe24f,0x141));var _0xfe24=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xe24f[_0x321bb2];return _0x9c12ed;};'use strict';var BPromise=require(_0xfe24('0x0'));var util=require(_0xfe24('0x1'));var _=require(_0xfe24('0x2'));var fs=require('fs');var squel=require(_0xfe24('0x3'));var Papa=require(_0xfe24('0x4'));var Redis=require(_0xfe24('0x5'));var db=require(_0xfe24('0x6'))['db'];var config=require(_0xfe24('0x7'));var logger=require(_0xfe24('0x8'))(_0xfe24('0x9'));config['redis']=_[_0xfe24('0xa')](config['redis'],{'host':_0xfe24('0xb'),'port':0x18eb});var socket=require(_0xfe24('0xc'))(new Redis(config[_0xfe24('0xd')]));require(_0xfe24('0xe'))['register'](socket);try{if(!process['argv'][0x2]||process['argv'][0x2]===_0xfe24('0xf')||process[_0xfe24('0x10')][0x2]===_0xfe24('0x11')){throw new Error(_0xfe24('0x12'));}var FILEPATH=process['argv'][0x2];if(!process['argv'][0x3]||process[_0xfe24('0x10')][0x3]===_0xfe24('0xf')||process[_0xfe24('0x10')][0x3]===_0xfe24('0x11')||!process[_0xfe24('0x10')][0x4]||process[_0xfe24('0x10')][0x4]===_0xfe24('0xf')||process[_0xfe24('0x10')][0x4]===_0xfe24('0x11')){throw new Error(_0xfe24('0x13'));}var FIELDS=_[_0xfe24('0x14')](process['argv'][0x3]['split'](','),process[_0xfe24('0x10')][0x4]['split'](','));if(!process['argv'][0x5]||process[_0xfe24('0x10')][0x5]===_0xfe24('0xf')||process['argv'][0x5]===_0xfe24('0x11')){throw new Error(_0xfe24('0x15'));}var LISTID=process['argv'][0x5];var COMPANYID=process[_0xfe24('0x10')][0x6]&&process[_0xfe24('0x10')][0x6]!==_0xfe24('0xf')&&process['argv'][0x6]!=='null'?process[_0xfe24('0x10')][0x6]:null;var DUPLICATES=process[_0xfe24('0x10')][0x7]&&process[_0xfe24('0x10')][0x7]!==_0xfe24('0xf')&&process[_0xfe24('0x10')][0x7]!=='null'?process[_0xfe24('0x10')][0x7]:null;if(!process[_0xfe24('0x10')][0x8]||process[_0xfe24('0x10')][0x8]==='undefined'||process[_0xfe24('0x10')][0x8]===_0xfe24('0x11')){throw new Error(_0xfe24('0x16'));}var SOCKET_TIMESTAMP=process[_0xfe24('0x10')][0x8];}catch(_0x1ad1c2){logger['error'](_0x1ad1c2);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(_0x567709,_0x4c92b7,_0x38cb72,_0x57f305){var _0x263ff4={'message':_0x4c92b7};_0x263ff4[_0x567709]=!![];if(_0x38cb72){_0x263ff4['contact']=_0x38cb72;}if(_0x57f305){_0x263ff4[_0xfe24('0x17')]=_0x57f305;}return _0x263ff4;}function isEmail(_0x50d1e8){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))*$/[_0xfe24('0x18')](_0x50d1e8);}function checkRow(_0x511c6d,_0x5f1c50,_0x22172e){return new BPromise(function(_0x3bbc00,_0x33b36c){if(_[_0xfe24('0x19')](_0x511c6d)){return _0x33b36c(handleCheckRowError('error',_0xfe24('0x1a'),null,_0x22172e));}if(_0x511c6d[_0xfe24('0x1b')]&&_0x511c6d[_0xfe24('0x1b')]['length']){var _0x34dbdd=_['map'](_0x511c6d[_0xfe24('0x1b')],_0xfe24('0x1c'))[_0xfe24('0x1d')](';');return _0x33b36c(handleCheckRowError(_0xfe24('0x1e'),_0x34dbdd,null,_0x22172e));}var _0x1df348={};for(var _0x3ca5c1 in FIELDS){if(FIELDS[_0xfe24('0x1f')](_0x3ca5c1)&&FIELDS[_0x3ca5c1]){_0x1df348[_0x3ca5c1]=_0x511c6d[_0xfe24('0x20')][0x0][FIELDS[_0x3ca5c1]]||_0x511c6d['data'][0x0]['\ufeff'+FIELDS[_0x3ca5c1]];}}if(!_0x1df348[_0xfe24('0x21')]){return _0x33b36c(handleCheckRowError(_0xfe24('0x1e'),_0xfe24('0x22'),null,_0x22172e));}if(!_0x1df348[_0xfe24('0x23')]){return _0x33b36c(handleCheckRowError(_0xfe24('0x1e'),'phone\x20not\x20specified!',null,_0x22172e));}if(_0x1df348[_0xfe24('0x24')]){var _0x8696e6=moment(_0x1df348[_0xfe24('0x24')],_0xfe24('0x25'));if(!_0x8696e6[_0xfe24('0x26')]()){return _0x33b36c(handleCheckRowError(_0xfe24('0x1e'),_0xfe24('0x27'),null,_0x22172e));}}if(_0x1df348[_0xfe24('0x28')]){if(!isEmail(_0x1df348['email'])){return _0x33b36c(handleCheckRowError('error','email\x20format\x20is\x20not\x20valid!',null,_0x22172e));}}_0x1df348[_0xfe24('0x29')]=LISTID;_0x1df348[_0xfe24('0x2a')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0xfe24('0x2b')]&&_0x5f1c50){var _0x65b6fa={};for(var _0x22ec1d=0x0,_0x2e9ebc=DUPLICATES[_0xfe24('0x2b')];_0x22ec1d<_0x2e9ebc;_0x22ec1d+=0x1){_0x65b6fa[DUPLICATES[_0x22ec1d]]=_0x1df348[DUPLICATES[_0x22ec1d]];}var _0x347285=_[_0xfe24('0x2c')](_0x5f1c50,_0x65b6fa);if(_0x347285){return _0x33b36c(handleCheckRowError(_0xfe24('0x2d'),_0xfe24('0x2e'),_0x347285,_0x22172e));}}return db[_0xfe24('0x2f')]['create'](_0x1df348,{'raw':!![],'hooks':![],'fields':_['keys'](_0x1df348)})[_0xfe24('0x30')](function(_0x4a1424){if(DUPLICATES&&DUPLICATES['length']&&_0x5f1c50){_0x5f1c50[_0xfe24('0x31')](_[_0xfe24('0x32')](_0x1df348,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x4a1424['id'];return _0x3bbc00();})['catch'](function(_0x39b252){return _0x33b36c(handleCheckRowError('error',_0xfe24('0x33')+(_0x39b252['message']||JSON[_0xfe24('0x34')](_0x39b252)),null,_0x22172e));});});}function checkHopper(){function _0x2247fb(){return function(_0xd6d07a){logger[_0xfe24('0x1e')](_0xfe24('0x35'),_0xfe24('0x36'),util[_0xfe24('0x37')](_0xd6d07a,{'showHidden':![],'depth':null}));};}var _0x220bc7=function(_0x10c06c,_0x365cfe){var _0x386821=squel['insert']()[_0xfe24('0x38')](_0xfe24('0x39'))[_0xfe24('0x3a')](['phone',_0xfe24('0x3b'),_0xfe24('0x3c'),'ListId',_0x365cfe,_0xfe24('0x3d'),_0xfe24('0x3e')],squel['select']()[_0xfe24('0x3f')](_0xfe24('0x23'),'phone')[_0xfe24('0x3f')](_0xfe24('0x40'),_0xfe24('0x3b'))[_0xfe24('0x3f')]('id',_0xfe24('0x3c'))['field'](LISTID[_0xfe24('0x41')](),_0xfe24('0x29'))[_0xfe24('0x3f')](_0x10c06c['id'][_0xfe24('0x41')](),_0x365cfe)[_0xfe24('0x3f')](_0xfe24('0x40'),_0xfe24('0x3d'))[_0xfe24('0x3f')](_0xfe24('0x40'),_0xfe24('0x3e'))['from'](_0xfe24('0x42'))[_0xfe24('0x43')]('deletedAt\x20IS\x20NULL')['where'](_0xfe24('0x44'),LISTID[_0xfe24('0x41')]())[_0xfe24('0x43')]('phone\x20IS\x20NOT\x20NULL')[_0xfe24('0x43')](_0xfe24('0x45'),squel[_0xfe24('0x46')]()[_0xfe24('0x3f')](_0xfe24('0x23'))[_0xfe24('0x47')]('cm_hopper')[_0xfe24('0x43')](_0x365cfe+_0xfe24('0x48'),_0x10c06c['id'][_0xfe24('0x41')]())))['toString']();return _0x386821;};var _0x562e5c=function(_0x8c280,_0x401ef9){var _0x34d4b6=squel[_0xfe24('0x49')]()[_0xfe24('0x38')](_0xfe24('0x39'))[_0xfe24('0x3a')]([_0xfe24('0x23'),_0xfe24('0x3b'),_0xfe24('0x3c'),_0xfe24('0x29'),_0x401ef9,_0xfe24('0x3d'),'updatedAt'],squel[_0xfe24('0x46')]()[_0xfe24('0x3f')](_0xfe24('0x23'),_0xfe24('0x23'))['field'](_0xfe24('0x40'),_0xfe24('0x3b'))[_0xfe24('0x3f')]('id','ContactId')[_0xfe24('0x3f')](LISTID[_0xfe24('0x41')](),_0xfe24('0x29'))[_0xfe24('0x3f')](_0x8c280['id'][_0xfe24('0x41')](),_0x401ef9)['field']('NOW()',_0xfe24('0x3d'))['field'](_0xfe24('0x40'),'updatedAt')[_0xfe24('0x47')](_0xfe24('0x42'))[_0xfe24('0x43')](_0xfe24('0x4a'))[_0xfe24('0x43')](_0xfe24('0x44'),LISTID[_0xfe24('0x41')]())[_0xfe24('0x43')]('id\x20IN\x20?',squel['str'](hopperContacts))[_0xfe24('0x43')]('phone\x20IS\x20NOT\x20NULL')['where']('phone\x20NOT\x20IN\x20(?)',squel[_0xfe24('0x46')]()[_0xfe24('0x3f')](_0xfe24('0x4b'))[_0xfe24('0x47')](_0xfe24('0x4c'))[_0xfe24('0x43')](_0x401ef9+'\x20=\x20?',_0x8c280['id']['toString']()))[_0xfe24('0x43')](_0xfe24('0x45'),squel[_0xfe24('0x46')]()[_0xfe24('0x3f')](_0xfe24('0x23'))[_0xfe24('0x47')](_0xfe24('0x39'))[_0xfe24('0x43')](_0x401ef9+_0xfe24('0x48'),_0x8c280['id'][_0xfe24('0x41')]())))['toString']();return _0x34d4b6;};function _0x5ed4a0(_0x254342,_0x3a16e7){var _0x3bbe54=squel[_0xfe24('0x49')]()[_0xfe24('0x38')]('cm_hopper')[_0xfe24('0x3a')]([_0xfe24('0x23'),_0xfe24('0x3b'),'ContactId',_0xfe24('0x29'),_0x3a16e7,_0xfe24('0x3d'),_0xfe24('0x3e')],squel[_0xfe24('0x46')]()[_0xfe24('0x3f')](_0xfe24('0x23'),_0xfe24('0x23'))[_0xfe24('0x3f')]('NOW()',_0xfe24('0x3b'))[_0xfe24('0x3f')]('id',_0xfe24('0x3c'))['field'](LISTID['toString'](),_0xfe24('0x29'))[_0xfe24('0x3f')](_0x254342['id'][_0xfe24('0x41')](),_0x3a16e7)[_0xfe24('0x3f')](_0xfe24('0x40'),_0xfe24('0x3d'))['field']('NOW()',_0xfe24('0x3e'))[_0xfe24('0x47')](_0xfe24('0x42'))[_0xfe24('0x43')](_0xfe24('0x4a'))[_0xfe24('0x43')](_0xfe24('0x44'),LISTID[_0xfe24('0x41')]())['where'](_0xfe24('0x4d'),squel['str'](hopperContacts))[_0xfe24('0x43')](_0xfe24('0x4e')))['toString']();return _0x3bbe54;}function _0x171c7e(_0x206d6a,_0x1c8597){var _0x3162f7=squel[_0xfe24('0x49')]()[_0xfe24('0x38')]('cm_hopper_black')[_0xfe24('0x3a')](['phone',_0xfe24('0x3c'),_0xfe24('0x29'),_0x1c8597,_0xfe24('0x3d'),_0xfe24('0x3e')],squel['select']()[_0xfe24('0x3f')](_0xfe24('0x23'),'phone')[_0xfe24('0x3f')]('id',_0xfe24('0x3c'))[_0xfe24('0x3f')](LISTID[_0xfe24('0x41')](),'ListId')['field'](_0x206d6a['id'][_0xfe24('0x41')](),_0x1c8597)[_0xfe24('0x3f')]('NOW()','createdAt')[_0xfe24('0x3f')](_0xfe24('0x40'),_0xfe24('0x3e'))[_0xfe24('0x47')](_0xfe24('0x42'))[_0xfe24('0x43')](_0xfe24('0x4a'))[_0xfe24('0x43')]('ListId\x20=\x20?',LISTID[_0xfe24('0x41')]())['where']('id\x20IN\x20?',squel['str'](hopperContacts))[_0xfe24('0x43')](_0xfe24('0x4e')))[_0xfe24('0x41')]();return _0x3162f7;}return db['VoiceQueue'][_0xfe24('0x4f')]({'where':{'type':_0xfe24('0x50')},'attributes':['id',_0xfe24('0x51')],'include':[{'model':db[_0xfe24('0x52')],'as':_0xfe24('0x53'),'where':{'id':LISTID}}]})['then'](function(_0x20c38b){var _0x390410=[];if(_0x20c38b){var _0x333b1f;for(var _0x3ba576=0x0,_0x222f2b;_0x3ba576<_0x20c38b['length'];_0x3ba576+=0x1){_0x222f2b=_0x20c38b[_0x3ba576][_0xfe24('0x54')]({'plain':!![]});switch(_0x222f2b[_0xfe24('0x51')]){case _0xfe24('0x55'):_0x390410[_0xfe24('0x31')](db['sequelize'][_0xfe24('0x56')](_0x562e5c(_0x222f2b,_0xfe24('0x57')))['then'](function(){})[_0xfe24('0x58')](_0x2247fb()));break;case _0xfe24('0x59'):_0x390410[_0xfe24('0x31')](db[_0xfe24('0x5a')][_0xfe24('0x56')](_0x220bc7(_0x222f2b,_0xfe24('0x57')))['then'](function(){})[_0xfe24('0x58')](_0x2247fb()));break;default:_0x390410[_0xfe24('0x31')](db[_0xfe24('0x5a')][_0xfe24('0x56')](_0x5ed4a0(_0x222f2b,_0xfe24('0x57')))['then'](function(){})[_0xfe24('0x58')](_0x2247fb()));}}}return _0x390410;})[_0xfe24('0x5b')]()[_0xfe24('0x30')](function(){return db['VoiceQueue'][_0xfe24('0x4f')]({'where':{'type':_0xfe24('0x50')},'attributes':['id'],'include':[{'model':db[_0xfe24('0x52')],'as':_0xfe24('0x5c'),'where':{'id':LISTID}}]})[_0xfe24('0x30')](function(_0x40ded6){var _0x465e70=[];if(_0x40ded6){var _0x10f364;for(var _0x3218b5=0x0,_0x4c3d66;_0x3218b5<_0x40ded6[_0xfe24('0x2b')];_0x3218b5+=0x1){_0x4c3d66=_0x40ded6[_0x3218b5][_0xfe24('0x54')]({'plain':!![]});_0x465e70[_0xfe24('0x31')](db[_0xfe24('0x5a')][_0xfe24('0x56')](_0x171c7e(_0x4c3d66,'VoiceQueueId'))['then'](function(){})[_0xfe24('0x58')](_0x2247fb()));}}return _0x465e70;})[_0xfe24('0x5b')]();})['then'](function(){return db[_0xfe24('0x5d')][_0xfe24('0x4f')]({'attributes':['id',_0xfe24('0x51')],'include':[{'model':db[_0xfe24('0x52')],'as':'Lists','where':{'id':LISTID}}]})[_0xfe24('0x30')](function(_0x49084d){var _0x11c31a=[];if(_0x49084d){for(var _0x41e382=0x0,_0x430b74;_0x41e382<_0x49084d[_0xfe24('0x2b')];_0x41e382+=0x1){_0x430b74=_0x49084d[_0x41e382][_0xfe24('0x54')]({'plain':!![]});switch(_0x430b74[_0xfe24('0x51')]){case _0xfe24('0x55'):_0x11c31a['push'](db[_0xfe24('0x5a')][_0xfe24('0x56')](_0x562e5c(_0x430b74,_0xfe24('0x5e')))['then'](function(){})[_0xfe24('0x58')](_0x2247fb()));break;case _0xfe24('0x59'):_0x11c31a[_0xfe24('0x31')](db[_0xfe24('0x5a')]['query'](_0x220bc7(_0x430b74,_0xfe24('0x5e')))[_0xfe24('0x30')](function(){})['catch'](_0x2247fb()));break;default:_0x11c31a[_0xfe24('0x31')](db[_0xfe24('0x5a')]['query'](_0x5ed4a0(_0x430b74,_0xfe24('0x5e')))[_0xfe24('0x30')](function(){})[_0xfe24('0x58')](_0x2247fb()));}}}return _0x11c31a;})[_0xfe24('0x5b')]();})[_0xfe24('0x30')](function(){return db['Campaign']['findAll']({'attributes':['id'],'include':[{'model':db[_0xfe24('0x52')],'as':'BlackLists','where':{'id':LISTID}}]})[_0xfe24('0x30')](function(_0x2221ce){var _0x1e3016=[];if(_0x2221ce){for(var _0x245e22=0x0,_0x588888;_0x245e22<_0x2221ce[_0xfe24('0x2b')];_0x245e22+=0x1){_0x588888=_0x2221ce[_0x245e22][_0xfe24('0x54')]({'plain':!![]});_0x1e3016[_0xfe24('0x31')](db[_0xfe24('0x5a')][_0xfe24('0x56')](_0x171c7e(_0x588888,_0xfe24('0x5e')))[_0xfe24('0x30')](function(){})[_0xfe24('0x58')](_0x2247fb()));}}return _0x1e3016;})[_0xfe24('0x5b')]();})[_0xfe24('0x58')](function(_0x4b1c56){logger[_0xfe24('0x1e')](_0xfe24('0x5f'),_0xfe24('0x60'),_0x4b1c56[_0xfe24('0x1c')]);});}var processPromises=function(_0x20dbb1){return BPromise[_0xfe24('0x5b')](promises)[_0xfe24('0x30')](function(_0x180a2c){})[_0xfe24('0x58')](function(_0x53bcf0){logger['error']('Error\x20processing\x20rows\x20block:',JSON[_0xfe24('0x34')](_0x53bcf0));})[_0xfe24('0x61')](function(){socket[_0xfe24('0x62')](_0xfe24('0x63')+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x20dbb1){return _0x20dbb1[_0xfe24('0x64')]();}});};var endCsv=function(){return BPromise[_0xfe24('0x65')]()[_0xfe24('0x30')](function(){if(hopperContacts){return checkHopper();}})['then'](function(){socket[_0xfe24('0x62')](_0xfe24('0x63')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0xfe24('0x66')](FILEPATH);}catch(_0x5289bf){logger[_0xfe24('0x1e')](_0xfe24('0x67'),JSON['stringify'](_0x5289bf));}finally{process[_0xfe24('0x68')](0x0);}});};process['on'](_0xfe24('0x69'),function(){logger[_0xfe24('0x6a')]('CSV\x20import\x20process\x20stopped!');endCsv();});function main(){return BPromise[_0xfe24('0x65')]()[_0xfe24('0x30')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES['split'](',');return db[_0xfe24('0x2f')]['findAll']({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})[_0xfe24('0x30')](function(_0x38cebb){var _0x7eaa7a=fs[_0xfe24('0x6b')](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa['parse'](_0x7eaa7a,{'header':!![],'skipEmptyLines':!![],'step':function(_0x7168b8,_0x3609e9){total+=0x1;var _0x4d31cd=total;promises['push'](checkRow(_0x7168b8,_0x38cebb,_0x4d31cd)[_0xfe24('0x30')](function(){success+=0x1;})[_0xfe24('0x58')](function(_0x18566e){if(_0x18566e[_0xfe24('0x1e')]){errors+=0x1;delete _0x18566e[_0xfe24('0x1e')];}else if(_0x18566e['duplicate']){duplicates+=0x1;delete _0x18566e[_0xfe24('0x2d')];}rows[_0xfe24('0x31')](_0x18566e);}));if(total%0xc8===0x0){_0x3609e9[_0xfe24('0x6c')]();return processPromises(_0x3609e9);}},'complete':function(){return processPromises()[_0xfe24('0x30')](function(){logger['info'](_0xfe24('0x6d'));endCsv();});},'error':function(_0x58ede7,_0x17aaae){logger['info'](_0xfe24('0x6e'),JSON[_0xfe24('0x34')](_0x58ede7));endCsv();}});})['catch'](function(_0x11fb9e){logger[_0xfe24('0x1e')](_0xfe24('0x6f'),JSON[_0xfe24('0x34')](_0x11fb9e));});}main(); \ No newline at end of file diff --git a/server/components/import/cm/csv2.js b/server/components/import/cm/csv2.js index 0561b19..97a6fa7 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 _0xe318=['CompanyId','createdAt','from',')\x20NOT\x20IN\x20?','ListId\x20=\x20?','deletedAt\x20IS\x20NULL','id\x20IN\x20?','MIN(id)','min_id','info','Received\x20SIGINT','error','message','exit','errors','push','code','spread','catch','send','start','binding','socket_timestamp','.csv','header','writeFileSync','createReadStream','data','length','rows','trim','replace','isValid','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','priority','isNaN','isNumber','includes','agent\x20not\x20exists','email\x20wrong\x20format','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','firstName','\x20not\x20specified','SystemRow','appendFileSync','emit','contact:import:','abort','SystemError','step','cm_contacts_','CREATE\x20TABLE\x20','LOAD\x20DATA\x20LOCAL\x20INFILE\x20\x27%s\x27\x20INTO\x20TABLE\x20%s\x20CHARACTER\x20SET\x20UTF8\x20FIELDS\x20TERMINATED\x20BY\x20\x27,\x27\x20ENCLOSED\x20BY\x20\x27\x22\x27\x20LINES\x20TERMINATED\x20BY\x20\x27\x0a\x27\x20IGNORE\x201\x20ROWS\x20(%s)\x20SET\x20id\x20=\x20NULL,\x20ListId\x20=\x20%s,\x20CompanyId\x20=\x20%s,\x20createdAt\x20=\x20\x27%s\x27,\x20updatedAt\x20=\x20\x27%s\x27','isNil',',\x20scheduledAt\x20=\x20NOW()','duplicates','DROP\x20TABLE\x20','voice_queues_has_cm_lists','voice_queues','voice_queues_has_cm_blacklists','VoiceQueueId','campaigns_has_cm_lists','CampaignId','campaigns','each','then','finish','affectedRows','complete','argv','root','server/files/tmp','existsSync','file\x20doesn\x27t\x20exists','parse','binding\x20doesn\x27t\x20exists','phone\x20is\x20mandatory','firstName\x20is\x20mandatory','ListId\x20is\x20mandatory','body\x20id\x20mandatory','map','SIGINT','uncaughtException','path','lodash','papaparse','util','moment','ioredis','../../../config/environment','import','redis','localhost','format','YYYY-MM-DD\x20HH:mm:ss','select','field','phone','join','where','\x20=\x20','.dialCheckDuplicateType\x20IN\x20(','cm_contacts.phone','cm_contacts.scheduledat','cm_contacts.id','cm_contacts.updatedAt','cm_contacts.priority','cm_contacts.UserId','insert','cm_hopper','fromQuery','scheduledat','ContactId','ListId','updatedAt','UserId','recallme','fields','cm_contacts','cm_contacts.ListId\x20=\x20','.CmListId','.id\x20=\x20','.CmListId\x20=\x20?','cm_contacts.createdAt\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22onlyIfOpen\x22','\x22always\x22','toString','cm_contacts.ListId','cm_contacts.createdAt','into','cm_hopper_black','\x20=\x20?','concat','keys'];(function(_0x1fb338,_0x1fb2a3){var _0x4c7233=function(_0x392a64){while(--_0x392a64){_0x1fb338['push'](_0x1fb338['shift']());}};_0x4c7233(++_0x1fb2a3);}(_0xe318,0x1e8));var _0x8e31=function(_0xa533c1,_0x4f5b85){_0xa533c1=_0xa533c1-0x0;var _0x54c288=_0xe318[_0xa533c1];return _0x54c288;};'use strict';var fs=require('fs');var path=require(_0x8e31('0x0'));var _=require(_0x8e31('0x1'));var Papa=require(_0x8e31('0x2'));var util=require(_0x8e31('0x3'));var BPromise=require('bluebird');var moment=require(_0x8e31('0x4'));var squel=require('squel');var Redis=require(_0x8e31('0x5'));var db=require('../../../mysqldb')['db'];var config=require(_0x8e31('0x6'));var logger=require('../../../config/logger')(_0x8e31('0x7'));config[_0x8e31('0x8')]=_['defaults'](config[_0x8e31('0x8')],{'host':_0x8e31('0x9'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x8e31('0x8')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var stopped=![];var NOW=moment()[_0x8e31('0xa')](_0x8e31('0xb'));function isEmail(_0x4a7cad){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'](_0x4a7cad);}function selectNotIn(_0x350149,_0x32d0d4,_0x384737,_0x2823f2,_0x293003){return squel[_0x8e31('0xc')]()[_0x8e31('0xd')](_0x8e31('0xe'))['from'](_0x2823f2)[_0x8e31('0xf')](_0x32d0d4,null,_0x32d0d4+'.id\x20=\x20'+_0x2823f2+'.'+_0x384737)[_0x8e31('0x10')](_0x2823f2+'.'+_0x384737+_0x8e31('0x11')+_0x350149+'.'+_0x384737)[_0x8e31('0x10')](_0x32d0d4+_0x8e31('0x12')+_0x293003['join']()+')');}function insertCmHopper(_0xc79c,_0x267bcc,_0x5a578b,_0x4dc435,_0x21ec72){var _0x639398=[_0x8e31('0x13'),_0x8e31('0x14'),_0x8e31('0x15'),'cm_contacts.ListId',_0x267bcc+'.'+_0x4dc435,'cm_contacts.createdAt',_0x8e31('0x16'),_0x8e31('0x17'),_0x8e31('0x18'),'\x22'+_0x21ec72+'\x22'];return squel[_0x8e31('0x19')]()['into'](_0x8e31('0x1a'))[_0x8e31('0x1b')]([_0x8e31('0xe'),_0x8e31('0x1c'),_0x8e31('0x1d'),_0x8e31('0x1e'),_0x4dc435,'createdAt',_0x8e31('0x1f'),'priority',_0x8e31('0x20'),_0x8e31('0x21')],squel[_0x8e31('0xc')]()[_0x8e31('0x22')](_0x639398)['from'](_0x267bcc)[_0x8e31('0xf')](_0x8e31('0x23'),null,_0x8e31('0x24')+_0x267bcc+_0x8e31('0x25'))[_0x8e31('0xf')](_0x5a578b,null,_0x5a578b+_0x8e31('0x26')+_0x267bcc+'.'+_0x4dc435)[_0x8e31('0x10')](_0x267bcc+_0x8e31('0x27'),_0xc79c)[_0x8e31('0x10')](_0x8e31('0x28'),NOW)['where'](_0x8e31('0x29'),selectNotIn(_0x267bcc,_0x5a578b,_0x4dc435,'cm_hopper',['\x22always\x22',_0x8e31('0x2a')]))[_0x8e31('0x10')](_0x8e31('0x29'),selectNotIn(_0x267bcc,_0x5a578b,_0x4dc435,_0x8e31('0x1a'),[_0x8e31('0x2b')])))[_0x8e31('0x2c')]();}function insertCmHopperBlack(_0x58d9d7,_0x3866a4,_0x28c005,_0x1f7850){var _0x23517a=[_0x8e31('0x13'),'cm_contacts.id',_0x8e31('0x2d'),_0x3866a4+'.'+_0x1f7850,_0x8e31('0x2e'),_0x8e31('0x16')];return squel[_0x8e31('0x19')]()[_0x8e31('0x2f')](_0x8e31('0x30'))[_0x8e31('0x1b')]([_0x8e31('0xe'),_0x8e31('0x1d'),_0x8e31('0x1e'),_0x1f7850,'createdAt','updatedAt'],squel['select']()[_0x8e31('0x22')](_0x23517a)['from'](_0x3866a4)[_0x8e31('0xf')](_0x8e31('0x23'),null,_0x8e31('0x24')+_0x3866a4+_0x8e31('0x25'))[_0x8e31('0xf')](_0x28c005,null,_0x28c005+_0x8e31('0x26')+_0x3866a4+'.'+_0x1f7850)['where'](_0x3866a4+'.CmListId\x20=\x20?',_0x58d9d7)[_0x8e31('0x10')]('cm_contacts.createdAt\x20=\x20?',NOW)[_0x8e31('0x10')](_0x8e31('0x29'),squel['select']()[_0x8e31('0xd')](_0x8e31('0xe'))['from']('cm_hopper_black')['where']('ListId\x20=\x20?',_0x58d9d7)[_0x8e31('0x10')](_0x1f7850+_0x8e31('0x31'),_0x3866a4+'.'+_0x1f7850)))['toString']();}function insertCmContact(_0x13af16,_0x2ed9f6,_0x484931,_0x2a5fca){var _0x5cbbbc=_[_0x8e31('0x32')](_[_0x8e31('0x33')](_0x2a5fca),[_0x8e31('0x1e'),_0x8e31('0x34'),_0x8e31('0x35'),'updatedAt']);return squel[_0x8e31('0x19')]()[_0x8e31('0x2f')](_0x8e31('0x23'))[_0x8e31('0x1b')](_0x5cbbbc,squel['select']()[_0x8e31('0x22')](_0x5cbbbc)[_0x8e31('0x36')](_0x2ed9f6)[_0x8e31('0x10')]('('+_0x484931[_0x8e31('0xf')](',')+_0x8e31('0x37'),squel[_0x8e31('0xc')]()[_0x8e31('0x22')](_0x484931)[_0x8e31('0x36')](_0x8e31('0x23'))['where'](_0x8e31('0x38'),_0x13af16)['where'](_0x8e31('0x39')))[_0x8e31('0x10')](_0x8e31('0x3a'),squel[_0x8e31('0xc')]()[_0x8e31('0xd')](_0x8e31('0x3b'),_0x8e31('0x3c'))[_0x8e31('0x36')](_0x2ed9f6)['group'](_0x484931[_0x8e31('0xf')](','))))[_0x8e31('0x2c')]();}function handleStop(){logger[_0x8e31('0x3d')](_0x8e31('0x3e'));stopped=!![];}function handleUncaughtException(_0x4858d8){logger[_0x8e31('0x3f')](_0x4858d8[_0x8e31('0x40')]);process[_0x8e31('0x41')](0x1);}function handleError(_0x402105,_0x4b6645){stats[_0x8e31('0x42')][_0x8e31('0x43')]({'name':_0x4b6645[_0x8e31('0x44')],'message':_0x4b6645['message'],'row':_0x402105});}function handleQuery(_0x3fab5d){logger['info'](_0x3fab5d);return db['sequelize']['query'](_0x3fab5d)[_0x8e31('0x45')](function(_0x205508){results[_0x8e31('0x43')](_0x205508);})[_0x8e31('0x46')](function(_0x17357e){logger[_0x8e31('0x3f')](_0x17357e[_0x8e31('0x40')]);});}function main(_0xce225b,_0x43d59d,_0x105515,_0x21bc15){logger[_0x8e31('0x3d')]('main',_0xce225b,JSON['stringify'](_0x43d59d));process[_0x8e31('0x47')](_0x8e31('0x48'));var _0x16f83c=_0x43d59d[_0x8e31('0x49')];var _0x27eaa0=_0x43d59d[_0x8e31('0x4a')];var _0x5f4c70=path[_0x8e31('0xf')](config['root'],'server/files/tmp',_0x27eaa0+_0x8e31('0x4b'));var _0x18a7c6=_[_0x8e31('0x33')](_0x16f83c)['join']();logger[_0x8e31('0x3d')](_0x8e31('0x4c'),_0x18a7c6);fs[_0x8e31('0x4d')](_0x5f4c70,_0x18a7c6+'\x0a');Papa['parse'](fs[_0x8e31('0x4e')](_0xce225b),{'header':!![],'skipEmptyLines':!![],'step':function(_0x111df0,_0x5106f0){try{for(var _0x18241b=0x0,_0x3520bd=[];_0x18241b<_0x111df0[_0x8e31('0x4f')][_0x8e31('0x50')];_0x18241b++){stats[_0x8e31('0x51')]+=0x1;if(_0x111df0[_0x8e31('0x42')][_0x18241b]){handleError(_0x111df0[_0x8e31('0x4f')][_0x18241b],_0x111df0['errors'][_0x18241b]);}else{var _0x5c4bed=[];for(var _0x4456a5 in _0x16f83c){if(_0x16f83c['hasOwnProperty'](_0x4456a5)){if(_0x111df0[_0x8e31('0x4f')][_0x18241b][_0x16f83c[_0x4456a5]]){var _0xd26437=_[_0x8e31('0x52')](_0x111df0[_0x8e31('0x4f')][_0x18241b][_0x16f83c[_0x4456a5]][_0x8e31('0x53')](/"/g,'\x27'));switch(_0x4456a5){case _0x8e31('0x1c'):var _0x351acb=moment(_0xd26437,_0x8e31('0xb'),!![]);if(_0x351acb[_0x8e31('0x54')]()){_0x3520bd[_0x8e31('0x43')]('\x22'+_0xd26437+'\x22');}else{_0x5c4bed['push'](_0x8e31('0x55'));}break;case _0x8e31('0x56'):var _0x42d341=parseInt(_0xd26437);_0xd26437=_[_0x8e31('0x57')](_0x42d341)||_0x42d341<0x0||_0x42d341>0x4?_0x21bc15?0x3:0x2:_0x42d341;_0x3520bd[_0x8e31('0x43')]('\x22'+_0xd26437+'\x22');break;case _0x8e31('0x20'):var _0x2a2e24=parseInt(_0xd26437);if(_[_0x8e31('0x58')](_0x2a2e24)&&_[_0x8e31('0x59')](_0x105515,_0x2a2e24)){_0x3520bd['push']('\x22'+_0x2a2e24+'\x22');}else{_0x5c4bed['push'](_0x8e31('0x5a'));}break;case'email':if(isEmail(_0xd26437)){_0x3520bd[_0x8e31('0x43')]('\x22'+_0xd26437+'\x22');}else{_0x5c4bed[_0x8e31('0x43')](_0x8e31('0x5b'));}break;case'dateOfBirth':var _0xb28b06=moment(_0xd26437,'YYYY-MM-DD',!![]);if(_0xb28b06[_0x8e31('0x54')]()){_0x3520bd[_0x8e31('0x43')]('\x22'+_0xd26437+'\x22');}else{_0x5c4bed['push'](_0x8e31('0x5c'));}break;default:_0x3520bd['push']('\x22'+_0xd26437+'\x22');}}else{switch(_0x4456a5){case _0x8e31('0x5d'):case _0x8e31('0xe'):_0x5c4bed[_0x8e31('0x43')](_0x4456a5+_0x8e31('0x5e'));break;default:_0x3520bd[_0x8e31('0x43')]('\x22\x22');}}}}if(_0x5c4bed[_0x8e31('0x50')]){handleError(_0x111df0[_0x8e31('0x4f')][_0x18241b],{'code':_0x8e31('0x5f'),'message':_0x5c4bed[_0x8e31('0xf')]()});}else{fs[_0x8e31('0x60')](_0x5f4c70,_0x3520bd[_0x8e31('0xf')]()+'\x0a');}_0x3520bd=[];}if(!(stats['rows']%0xc8)){socket[_0x8e31('0x61')](_0x8e31('0x62')+_0x27eaa0,stats);stats[_0x8e31('0x42')]=[];}}if(stopped){logger['info']('Abort\x20parser');_0x5106f0[_0x8e31('0x63')]();}}catch(_0x39136f){handleError(_0x111df0[_0x8e31('0x4f')][_0x18241b],{'code':_0x8e31('0x64'),'message':_0x39136f[_0x8e31('0x40')]});logger[_0x8e31('0x3f')](_0x8e31('0x65'),_0x39136f[_0x8e31('0x40')]);}},'complete':function(){try{var _0x4eaf76=[];var _0x522e14='cm_contacts';if(_0x43d59d['duplicates']&&_0x43d59d['duplicates'][_0x8e31('0x50')]){_0x522e14=_0x8e31('0x66')+_0x27eaa0;_0x4eaf76[_0x8e31('0x43')](_0x8e31('0x67')+_0x522e14+'\x20LIKE\x20cm_contacts;');}var _0x55e2b7=util['format'](_0x8e31('0x68'),_0x5f4c70,_0x522e14,_0x18a7c6,_0x43d59d[_0x8e31('0x1e')],_0x43d59d[_0x8e31('0x34')]||null,NOW,NOW);if(_[_0x8e31('0x69')](_0x16f83c['scheduledat'])){_0x55e2b7+=_0x8e31('0x6a');}_0x4eaf76[_0x8e31('0x43')](_0x55e2b7);if(_0x43d59d[_0x8e31('0x6b')]&&_0x43d59d[_0x8e31('0x6b')][_0x8e31('0x50')]){_0x4eaf76['push'](insertCmContact(_0x43d59d[_0x8e31('0x1e')],_0x522e14,_0x43d59d[_0x8e31('0x6b')],_0x16f83c));_0x4eaf76[_0x8e31('0x43')](_0x8e31('0x6c')+_0x522e14+';');}_0x4eaf76[_0x8e31('0x43')](insertCmHopper(_0x43d59d[_0x8e31('0x1e')],_0x8e31('0x6d'),_0x8e31('0x6e'),'VoiceQueueId',_0x21bc15));_0x4eaf76[_0x8e31('0x43')](insertCmHopperBlack(_0x43d59d[_0x8e31('0x1e')],_0x8e31('0x6f'),_0x8e31('0x6e'),_0x8e31('0x70')));_0x4eaf76[_0x8e31('0x43')](insertCmHopper(_0x43d59d[_0x8e31('0x1e')],_0x8e31('0x71'),'campaigns',_0x8e31('0x72'),_0x21bc15));_0x4eaf76[_0x8e31('0x43')](insertCmHopperBlack(_0x43d59d[_0x8e31('0x1e')],'campaigns_has_cm_blacklists',_0x8e31('0x73'),_0x8e31('0x72')));BPromise[_0x8e31('0x74')](_0x4eaf76,handleQuery)[_0x8e31('0x75')](function(_0x2a64d1){stats[_0x8e31('0x76')]=!![];stats[_0x8e31('0x77')]=_0x43d59d[_0x8e31('0x6b')]&&_0x43d59d[_0x8e31('0x6b')][_0x8e31('0x50')]?results[0x2][_0x8e31('0x77')]:results[0x0][_0x8e31('0x77')];socket['emit']('contact:import:'+_0x27eaa0,stats);fs['unlink'](_0xce225b);fs['unlink'](_0x5f4c70);process['exit'](0x0);})[_0x8e31('0x46')](function(_0x4afe4b){logger[_0x8e31('0x3f')](_0x4afe4b['message']);process[_0x8e31('0x41')](0x1);});}catch(_0xe44c70){logger['error'](_0x8e31('0x78'),_0xe44c70[_0x8e31('0x40')]);process[_0x8e31('0x41')](0x1);}},'error':function(_0x4de553,_0x42d95e,_0x262e7e,_0x2eea73){throw new Error(_0x2eea73);}});}function validate(){if(process['argv']&&process[_0x8e31('0x79')][_0x8e31('0x50')]<0x4){throw new Error('arguments\x20\x20\x20');}var _0x15bbbf=path[_0x8e31('0xf')](config[_0x8e31('0x7a')],_0x8e31('0x7b'),process[_0x8e31('0x79')][0x2]);if(!fs[_0x8e31('0x7c')](_0x15bbbf)){throw new Error(_0x8e31('0x7d'));}var _0x441ba9={};try{_0x441ba9=JSON[_0x8e31('0x7e')](process['argv'][0x3]);if(!_0x441ba9[_0x8e31('0x49')]){throw new Error(_0x8e31('0x7f'));}if(!_0x441ba9[_0x8e31('0x49')]['phone']){throw new Error(_0x8e31('0x80'));}if(!_0x441ba9[_0x8e31('0x49')][_0x8e31('0x5d')]){throw new Error(_0x8e31('0x81'));}var _0x5f1dd1=0x0;if(_0x441ba9[_0x8e31('0x49')][_0x8e31('0x20')]){_0x5f1dd1=0x1;}if(!_0x441ba9['ListId']){throw new Error(_0x8e31('0x82'));}}catch(_0x1cf1a8){throw new Error(_0x8e31('0x83'));}var _0x3c46be=[];try{_0x3c46be=_[_0x8e31('0x84')](JSON[_0x8e31('0x7e')](process[_0x8e31('0x79')][0x4]),'id');}catch(_0x299b4f){logger[_0x8e31('0x3d')]('No\x20agent\x20available');}main(_0x15bbbf,_0x441ba9,_0x3c46be,_0x5f1dd1);}validate();process['on'](_0x8e31('0x85'),handleStop);process['on'](_0x8e31('0x86'),handleUncaughtException); \ No newline at end of file +var _0x1160=['lodash','papaparse','util','bluebird','moment','../../../mysqldb','../../../config/logger','import','redis','defaults','socket.io-emitter','format','YYYY-MM-DD\x20HH:mm:ss','test','select','field','phone','from','join','.id\x20=\x20','where','\x20=\x20','.dialCheckDuplicateType\x20IN\x20(','cm_contacts.phone','cm_contacts.scheduledat','cm_contacts.ListId','cm_contacts.createdAt','cm_contacts.updatedAt','cm_contacts.UserId','cm_hopper','scheduledat','ListId','createdAt','updatedAt','fields','cm_contacts.ListId\x20=\x20','.CmListId','.CmListId\x20=\x20?','cm_contacts.createdAt\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22always\x22','\x22onlyIfOpen\x22','toString','cm_contacts.id','insert','into','cm_hopper_black','fromQuery','ContactId','cm_contacts','\x20=\x20?','concat','keys','ListId\x20=\x20?','deletedAt\x20IS\x20NULL','id\x20IN\x20?','MIN(id)','group','info','Received\x20SIGINT','message','code','sequelize','spread','push','error','binding','socket_timestamp','root','server/files/tmp','.csv','header','writeFileSync','parse','createReadStream','length','rows','data','errors','hasOwnProperty','replace','isValid','priority','isNaN','UserId','isNumber','includes','agent\x20not\x20exists','email\x20wrong\x20format','dateOfBirth','YYYY-MM-DD','firstName','\x20not\x20specified','SystemRow','appendFileSync','emit','contact:import:','Abort\x20parser','step','duplicates','cm_contacts_','CREATE\x20TABLE\x20','\x20LIKE\x20cm_contacts;','LOAD\x20DATA\x20LOCAL\x20INFILE\x20\x27%s\x27\x20INTO\x20TABLE\x20%s\x20CHARACTER\x20SET\x20UTF8\x20FIELDS\x20TERMINATED\x20BY\x20\x27,\x27\x20ENCLOSED\x20BY\x20\x27\x22\x27\x20LINES\x20TERMINATED\x20BY\x20\x27\x0a\x27\x20IGNORE\x201\x20ROWS\x20(%s)\x20SET\x20id\x20=\x20NULL,\x20ListId\x20=\x20%s,\x20CompanyId\x20=\x20%s,\x20createdAt\x20=\x20\x27%s\x27,\x20updatedAt\x20=\x20\x27%s\x27','CompanyId','DROP\x20TABLE\x20','voice_queues_has_cm_lists','voice_queues','voice_queues_has_cm_blacklists','VoiceQueueId','campaigns_has_cm_lists','campaigns','CampaignId','campaigns_has_cm_blacklists','each','then','finish','affectedRows','unlink','exit','catch','complete','argv','arguments\x20\x20\x20','existsSync','file\x20doesn\x27t\x20exists','binding\x20doesn\x27t\x20exists','firstName\x20is\x20mandatory','body\x20id\x20mandatory','map','No\x20agent\x20available','uncaughtException','path'];(function(_0x56fa13,_0x4f870e){var _0x5815b6=function(_0x18b96e){while(--_0x18b96e){_0x56fa13['push'](_0x56fa13['shift']());}};_0x5815b6(++_0x4f870e);}(_0x1160,0x109));var _0x0116=function(_0x12d812,_0x496bb7){_0x12d812=_0x12d812-0x0;var _0x3711ab=_0x1160[_0x12d812];return _0x3711ab;};'use strict';var fs=require('fs');var path=require(_0x0116('0x0'));var _=require(_0x0116('0x1'));var Papa=require(_0x0116('0x2'));var util=require(_0x0116('0x3'));var BPromise=require(_0x0116('0x4'));var moment=require(_0x0116('0x5'));var squel=require('squel');var Redis=require('ioredis');var db=require(_0x0116('0x6'))['db'];var config=require('../../../config/environment');var logger=require(_0x0116('0x7'))(_0x0116('0x8'));config[_0x0116('0x9')]=_[_0x0116('0xa')](config[_0x0116('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0x0116('0xb'))(new Redis(config[_0x0116('0x9')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var stopped=![];var NOW=moment()[_0x0116('0xc')](_0x0116('0xd'));function isEmail(_0x45df58){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))*$/[_0x0116('0xe')](_0x45df58);}function selectNotIn(_0x4a75e7,_0xd3b9f9,_0x18bdb8,_0xc5f35f,_0x72c1bb){return squel[_0x0116('0xf')]()[_0x0116('0x10')](_0x0116('0x11'))[_0x0116('0x12')](_0xc5f35f)[_0x0116('0x13')](_0xd3b9f9,null,_0xd3b9f9+_0x0116('0x14')+_0xc5f35f+'.'+_0x18bdb8)[_0x0116('0x15')](_0xc5f35f+'.'+_0x18bdb8+_0x0116('0x16')+_0x4a75e7+'.'+_0x18bdb8)[_0x0116('0x15')](_0xd3b9f9+_0x0116('0x17')+_0x72c1bb['join']()+')');}function insertCmHopper(_0x3279c0,_0x1472e2,_0x3bdbbc,_0x17cb8f,_0x4a7458){var _0x46da41=[_0x0116('0x18'),_0x0116('0x19'),'cm_contacts.id',_0x0116('0x1a'),_0x1472e2+'.'+_0x17cb8f,_0x0116('0x1b'),_0x0116('0x1c'),'cm_contacts.priority',_0x0116('0x1d'),'\x22'+_0x4a7458+'\x22'];return squel['insert']()['into'](_0x0116('0x1e'))['fromQuery'](['phone',_0x0116('0x1f'),'ContactId',_0x0116('0x20'),_0x17cb8f,_0x0116('0x21'),_0x0116('0x22'),'priority','UserId','recallme'],squel['select']()[_0x0116('0x23')](_0x46da41)['from'](_0x1472e2)[_0x0116('0x13')]('cm_contacts',null,_0x0116('0x24')+_0x1472e2+_0x0116('0x25'))['join'](_0x3bdbbc,null,_0x3bdbbc+_0x0116('0x14')+_0x1472e2+'.'+_0x17cb8f)[_0x0116('0x15')](_0x1472e2+_0x0116('0x26'),_0x3279c0)['where'](_0x0116('0x27'),NOW)[_0x0116('0x15')](_0x0116('0x28'),selectNotIn(_0x1472e2,_0x3bdbbc,_0x17cb8f,_0x0116('0x1e'),[_0x0116('0x29'),_0x0116('0x2a')]))[_0x0116('0x15')](_0x0116('0x28'),selectNotIn(_0x1472e2,_0x3bdbbc,_0x17cb8f,'cm_hopper',[_0x0116('0x29')])))[_0x0116('0x2b')]();}function insertCmHopperBlack(_0x404a51,_0x5058cc,_0x8ae389,_0x1c4db2){var _0x53465b=[_0x0116('0x18'),_0x0116('0x2c'),_0x0116('0x1a'),_0x5058cc+'.'+_0x1c4db2,_0x0116('0x1b'),_0x0116('0x1c')];return squel[_0x0116('0x2d')]()[_0x0116('0x2e')](_0x0116('0x2f'))[_0x0116('0x30')](['phone',_0x0116('0x31'),_0x0116('0x20'),_0x1c4db2,_0x0116('0x21'),_0x0116('0x22')],squel['select']()[_0x0116('0x23')](_0x53465b)[_0x0116('0x12')](_0x5058cc)[_0x0116('0x13')](_0x0116('0x32'),null,'cm_contacts.ListId\x20=\x20'+_0x5058cc+'.CmListId')[_0x0116('0x13')](_0x8ae389,null,_0x8ae389+_0x0116('0x14')+_0x5058cc+'.'+_0x1c4db2)['where'](_0x5058cc+_0x0116('0x26'),_0x404a51)[_0x0116('0x15')](_0x0116('0x27'),NOW)[_0x0116('0x15')](_0x0116('0x28'),squel[_0x0116('0xf')]()[_0x0116('0x10')](_0x0116('0x11'))[_0x0116('0x12')](_0x0116('0x2f'))[_0x0116('0x15')]('ListId\x20=\x20?',_0x404a51)[_0x0116('0x15')](_0x1c4db2+_0x0116('0x33'),_0x5058cc+'.'+_0x1c4db2)))['toString']();}function insertCmContact(_0xf8359b,_0x39e47f,_0x1cba79,_0x3805e9){var _0x129194=_[_0x0116('0x34')](_[_0x0116('0x35')](_0x3805e9),['ListId','CompanyId','createdAt',_0x0116('0x22')]);return squel[_0x0116('0x2d')]()[_0x0116('0x2e')](_0x0116('0x32'))[_0x0116('0x30')](_0x129194,squel[_0x0116('0xf')]()['fields'](_0x129194)[_0x0116('0x12')](_0x39e47f)[_0x0116('0x15')]('('+_0x1cba79[_0x0116('0x13')](',')+')\x20NOT\x20IN\x20?',squel[_0x0116('0xf')]()[_0x0116('0x23')](_0x1cba79)[_0x0116('0x12')]('cm_contacts')[_0x0116('0x15')](_0x0116('0x36'),_0xf8359b)[_0x0116('0x15')](_0x0116('0x37')))[_0x0116('0x15')](_0x0116('0x38'),squel[_0x0116('0xf')]()['field'](_0x0116('0x39'),'min_id')[_0x0116('0x12')](_0x39e47f)[_0x0116('0x3a')](_0x1cba79[_0x0116('0x13')](','))))[_0x0116('0x2b')]();}function handleStop(){logger[_0x0116('0x3b')](_0x0116('0x3c'));stopped=!![];}function handleUncaughtException(_0x40b68f){logger['error'](_0x40b68f[_0x0116('0x3d')]);process['exit'](0x1);}function handleError(_0x15d31c,_0x33783e){stats['errors']['push']({'name':_0x33783e[_0x0116('0x3e')],'message':_0x33783e[_0x0116('0x3d')],'row':_0x15d31c});}function handleQuery(_0x36d613){logger['info'](_0x36d613);return db[_0x0116('0x3f')]['query'](_0x36d613)[_0x0116('0x40')](function(_0x25669d){results[_0x0116('0x41')](_0x25669d);})['catch'](function(_0x4d43c3){logger[_0x0116('0x42')](_0x4d43c3[_0x0116('0x3d')]);});}function main(_0xa1fcb3,_0x5975ab,_0x1e08d6,_0x42afde){logger[_0x0116('0x3b')]('main',_0xa1fcb3,JSON['stringify'](_0x5975ab));process['send']('start');var _0x588040=_0x5975ab[_0x0116('0x43')];var _0x29043c=_0x5975ab[_0x0116('0x44')];var _0x2e7c4d=path['join'](config[_0x0116('0x45')],_0x0116('0x46'),_0x29043c+_0x0116('0x47'));var _0x58c1b9=_[_0x0116('0x35')](_0x588040)['join']();logger['info'](_0x0116('0x48'),_0x58c1b9);fs[_0x0116('0x49')](_0x2e7c4d,_0x58c1b9+'\x0a');Papa[_0x0116('0x4a')](fs[_0x0116('0x4b')](_0xa1fcb3),{'header':!![],'skipEmptyLines':!![],'step':function(_0x1ba445,_0x4a7efd){try{for(var _0xa3ac40=0x0,_0x4ba96e=[];_0xa3ac40<_0x1ba445['data'][_0x0116('0x4c')];_0xa3ac40++){stats[_0x0116('0x4d')]+=0x1;if(_0x1ba445['errors'][_0xa3ac40]){handleError(_0x1ba445[_0x0116('0x4e')][_0xa3ac40],_0x1ba445[_0x0116('0x4f')][_0xa3ac40]);}else{var _0x2b1f34=[];for(var _0x15a8ba in _0x588040){if(_0x588040[_0x0116('0x50')](_0x15a8ba)){if(_0x1ba445[_0x0116('0x4e')][_0xa3ac40][_0x588040[_0x15a8ba]]){var _0x38695d=_['trim'](_0x1ba445[_0x0116('0x4e')][_0xa3ac40][_0x588040[_0x15a8ba]][_0x0116('0x51')](/"/g,'\x27'));switch(_0x15a8ba){case _0x0116('0x1f'):var _0x13403c=moment(_0x38695d,'YYYY-MM-DD\x20HH:mm:ss',!![]);if(_0x13403c[_0x0116('0x52')]()){_0x4ba96e['push']('\x22'+_0x38695d+'\x22');}else{_0x2b1f34[_0x0116('0x41')]('scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)');}break;case _0x0116('0x53'):var _0x43eacd=parseInt(_0x38695d);_0x38695d=_[_0x0116('0x54')](_0x43eacd)||_0x43eacd<0x0||_0x43eacd>0x4?_0x42afde?0x3:0x2:_0x43eacd;_0x4ba96e[_0x0116('0x41')]('\x22'+_0x38695d+'\x22');break;case _0x0116('0x55'):var _0x3ef62b=parseInt(_0x38695d);if(_[_0x0116('0x56')](_0x3ef62b)&&_[_0x0116('0x57')](_0x1e08d6,_0x3ef62b)){_0x4ba96e[_0x0116('0x41')]('\x22'+_0x3ef62b+'\x22');}else{_0x2b1f34[_0x0116('0x41')](_0x0116('0x58'));}break;case'email':if(isEmail(_0x38695d)){_0x4ba96e[_0x0116('0x41')]('\x22'+_0x38695d+'\x22');}else{_0x2b1f34[_0x0116('0x41')](_0x0116('0x59'));}break;case _0x0116('0x5a'):var _0x18983f=moment(_0x38695d,_0x0116('0x5b'),!![]);if(_0x18983f[_0x0116('0x52')]()){_0x4ba96e[_0x0116('0x41')]('\x22'+_0x38695d+'\x22');}else{_0x2b1f34[_0x0116('0x41')]('dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)');}break;default:_0x4ba96e[_0x0116('0x41')]('\x22'+_0x38695d+'\x22');}}else{switch(_0x15a8ba){case _0x0116('0x5c'):case'phone':_0x2b1f34[_0x0116('0x41')](_0x15a8ba+_0x0116('0x5d'));break;default:_0x4ba96e[_0x0116('0x41')]('\x22\x22');}}}}if(_0x2b1f34[_0x0116('0x4c')]){handleError(_0x1ba445['data'][_0xa3ac40],{'code':_0x0116('0x5e'),'message':_0x2b1f34[_0x0116('0x13')]()});}else{fs[_0x0116('0x5f')](_0x2e7c4d,_0x4ba96e[_0x0116('0x13')]()+'\x0a');}_0x4ba96e=[];}if(!(stats['rows']%0xc8)){socket[_0x0116('0x60')](_0x0116('0x61')+_0x29043c,stats);stats[_0x0116('0x4f')]=[];}}if(stopped){logger['info'](_0x0116('0x62'));_0x4a7efd['abort']();}}catch(_0x25e559){handleError(_0x1ba445[_0x0116('0x4e')][_0xa3ac40],{'code':'SystemError','message':_0x25e559[_0x0116('0x3d')]});logger[_0x0116('0x42')](_0x0116('0x63'),_0x25e559[_0x0116('0x3d')]);}},'complete':function(){try{var _0x33252d=[];var _0x34b85b='cm_contacts';if(_0x5975ab['duplicates']&&_0x5975ab[_0x0116('0x64')][_0x0116('0x4c')]){_0x34b85b=_0x0116('0x65')+_0x29043c;_0x33252d['push'](_0x0116('0x66')+_0x34b85b+_0x0116('0x67'));}var _0x5bb297=util[_0x0116('0xc')](_0x0116('0x68'),_0x2e7c4d,_0x34b85b,_0x58c1b9,_0x5975ab[_0x0116('0x20')],_0x5975ab[_0x0116('0x69')]||null,NOW,NOW);if(_['isNil'](_0x588040['scheduledat'])){_0x5bb297+=',\x20scheduledAt\x20=\x20NOW()';}_0x33252d[_0x0116('0x41')](_0x5bb297);if(_0x5975ab[_0x0116('0x64')]&&_0x5975ab['duplicates'][_0x0116('0x4c')]){_0x33252d[_0x0116('0x41')](insertCmContact(_0x5975ab[_0x0116('0x20')],_0x34b85b,_0x5975ab[_0x0116('0x64')],_0x588040));_0x33252d[_0x0116('0x41')](_0x0116('0x6a')+_0x34b85b+';');}_0x33252d[_0x0116('0x41')](insertCmHopper(_0x5975ab[_0x0116('0x20')],_0x0116('0x6b'),_0x0116('0x6c'),'VoiceQueueId',_0x42afde));_0x33252d[_0x0116('0x41')](insertCmHopperBlack(_0x5975ab[_0x0116('0x20')],_0x0116('0x6d'),_0x0116('0x6c'),_0x0116('0x6e')));_0x33252d[_0x0116('0x41')](insertCmHopper(_0x5975ab[_0x0116('0x20')],_0x0116('0x6f'),_0x0116('0x70'),_0x0116('0x71'),_0x42afde));_0x33252d[_0x0116('0x41')](insertCmHopperBlack(_0x5975ab[_0x0116('0x20')],_0x0116('0x72'),_0x0116('0x70'),'CampaignId'));BPromise[_0x0116('0x73')](_0x33252d,handleQuery)[_0x0116('0x74')](function(_0x2fb13c){stats[_0x0116('0x75')]=!![];stats[_0x0116('0x76')]=_0x5975ab['duplicates']&&_0x5975ab[_0x0116('0x64')][_0x0116('0x4c')]?results[0x2][_0x0116('0x76')]:results[0x0][_0x0116('0x76')];socket['emit'](_0x0116('0x61')+_0x29043c,stats);fs[_0x0116('0x77')](_0xa1fcb3);fs[_0x0116('0x77')](_0x2e7c4d);process[_0x0116('0x78')](0x0);})[_0x0116('0x79')](function(_0x2aea16){logger[_0x0116('0x42')](_0x2aea16[_0x0116('0x3d')]);process[_0x0116('0x78')](0x1);});}catch(_0x5dbf19){logger[_0x0116('0x42')](_0x0116('0x7a'),_0x5dbf19[_0x0116('0x3d')]);process['exit'](0x1);}},'error':function(_0x2c2220,_0x1f9160,_0x11789e,_0x3225b4){throw new Error(_0x3225b4);}});}function validate(){if(process[_0x0116('0x7b')]&&process['argv'][_0x0116('0x4c')]<0x4){throw new Error(_0x0116('0x7c'));}var _0x4ccfd7=path['join'](config[_0x0116('0x45')],_0x0116('0x46'),process[_0x0116('0x7b')][0x2]);if(!fs[_0x0116('0x7d')](_0x4ccfd7)){throw new Error(_0x0116('0x7e'));}var _0x27da5b={};try{_0x27da5b=JSON[_0x0116('0x4a')](process[_0x0116('0x7b')][0x3]);if(!_0x27da5b['binding']){throw new Error(_0x0116('0x7f'));}if(!_0x27da5b['binding'][_0x0116('0x11')]){throw new Error('phone\x20is\x20mandatory');}if(!_0x27da5b[_0x0116('0x43')]['firstName']){throw new Error(_0x0116('0x80'));}var _0x1fcad2=0x0;if(_0x27da5b['binding'][_0x0116('0x55')]){_0x1fcad2=0x1;}if(!_0x27da5b['ListId']){throw new Error('ListId\x20is\x20mandatory');}}catch(_0x3fb25b){throw new Error(_0x0116('0x81'));}var _0x2b061f=[];try{_0x2b061f=_[_0x0116('0x82')](JSON[_0x0116('0x4a')](process[_0x0116('0x7b')][0x4]),'id');}catch(_0x2cc3d4){logger[_0x0116('0x3b')](_0x0116('0x83'));}main(_0x4ccfd7,_0x27da5b,_0x2b061f,_0x1fcad2);}validate();process['on']('SIGINT',handleStop);process['on'](_0x0116('0x84'),handleUncaughtException); \ No newline at end of file diff --git a/server/components/integrations/configuration.js b/server/components/integrations/configuration.js index 2f6a8fe..ca67cca 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 _0x639b=['***\x20Call\x20Info\x20***','keyValue','Caller\x20Name','destexten','agentcalledAt','Agent\x20Number','***\x20Time\x20Info\x20***','Agent\x20Ring','Agent\x20Connect','agentconnectAt','Agent\x20Complete','agentcompleteAt','Hold\x20Time','holdtime','Talk\x20Time','talktime','Called\x20Number','membername','UniqueId','uniqueid','Date','starttime','Answer\x20Time','answertime','Complete\x20Time','Duration','Billable\x20Time','billableseconds','getSubjects','string','[xCALLY\x20Ticket]','toLowerCase','voice','inbound','push','variable','queue','outbound','destcalleridnum'];(function(_0x5207d8,_0x3193e8){var _0x184e53=function(_0x437437){while(--_0x437437){_0x5207d8['push'](_0x5207d8['shift']());}};_0x184e53(++_0x3193e8);}(_0x639b,0x1f0));var _0xb639=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x639b[_0x122ef9];return _0x42fba0;};'use strict';exports[_0xb639('0x0')]=function(_0x1118dd,_0x19fd26){var _0x4d5b73=[{'type':_0xb639('0x1'),'content':_0xb639('0x2'),'variableName':null}];switch(_0x1118dd[_0xb639('0x3')]()){case _0xb639('0x4'):switch(_0x19fd26[_0xb639('0x3')]()){case _0xb639('0x5'):_0x4d5b73[_0xb639('0x6')]({'type':_0xb639('0x7'),'content':'','variableName':_0xb639('0x8')});_0x4d5b73[_0xb639('0x6')]({'type':_0xb639('0x7'),'content':'','variableName':'calleridnum'});break;case _0xb639('0x9'):_0x4d5b73[_0xb639('0x6')]({'type':_0xb639('0x1'),'content':'Outbound\x20Call','variableName':null});_0x4d5b73['push']({'type':_0xb639('0x7'),'content':'','variableName':_0xb639('0xa')});break;}}return _0x4d5b73;};exports['getDescriptions']=function(_0x6005b,_0x4fd0a1){var _0x56529e=[];switch(_0x6005b[_0xb639('0x3')]()){case _0xb639('0x4'):switch(_0x4fd0a1[_0xb639('0x3')]()){case _0xb639('0x5'):_0x56529e=[{'type':_0xb639('0x1'),'content':_0xb639('0xb'),'key':null,'keyType':null,'variableName':null},{'type':_0xb639('0xc'),'content':'','key':'Caller\x20Number','keyType':'variable','variableName':'calleridnum'},{'type':_0xb639('0xc'),'content':'','key':_0xb639('0xd'),'keyType':_0xb639('0x7'),'variableName':'calleridname'},{'type':_0xb639('0xc'),'content':'','key':'Call\x20To','keyType':'variable','variableName':_0xb639('0xe')},{'type':_0xb639('0xc'),'content':'','key':'Queue','keyType':'variable','variableName':_0xb639('0x8')},{'type':_0xb639('0xc'),'content':'','key':'UniqueId','keyType':_0xb639('0x7'),'variableName':'uniqueid'},{'type':_0xb639('0xc'),'content':'','key':'Date','keyType':_0xb639('0x7'),'variableName':_0xb639('0xf')},{'type':_0xb639('0x1'),'content':'***\x20Agent\x20Info\x20***','key':null,'keyType':null,'variableName':null},{'type':'keyValue','content':'','key':'Agent\x20Name','keyType':'variable','variableName':'destcalleridname'},{'type':'keyValue','content':'','key':_0xb639('0x10'),'keyType':_0xb639('0x7'),'variableName':_0xb639('0xa')},{'type':_0xb639('0x1'),'content':_0xb639('0x11'),'key':null,'keyType':null,'variableName':null},{'type':'keyValue','content':'','key':_0xb639('0x12'),'keyType':_0xb639('0x7'),'variableName':_0xb639('0xf')},{'type':_0xb639('0xc'),'content':'','key':_0xb639('0x13'),'keyType':_0xb639('0x7'),'variableName':_0xb639('0x14')},{'type':_0xb639('0xc'),'content':'','key':_0xb639('0x15'),'keyType':_0xb639('0x7'),'variableName':_0xb639('0x16')},{'type':_0xb639('0xc'),'content':'','key':_0xb639('0x17'),'keyType':'variable','variableName':_0xb639('0x18')},{'type':_0xb639('0xc'),'content':'','key':_0xb639('0x19'),'keyType':'variable','variableName':_0xb639('0x1a')}];break;case _0xb639('0x9'):_0x56529e=[{'type':_0xb639('0x1'),'content':'***\x20Call\x20Info\x20***','variableName':null},{'type':'keyValue','content':'','key':_0xb639('0x1b'),'keyType':_0xb639('0x7'),'keyContent':'','variableName':_0xb639('0xa')},{'type':'keyValue','content':'','key':'Member\x20Name','keyType':'variable','keyContent':'','variableName':_0xb639('0x1c')},{'type':'keyValue','content':'','key':_0xb639('0x1d'),'keyType':_0xb639('0x7'),'keyContent':'','variableName':_0xb639('0x1e')},{'type':_0xb639('0xc'),'content':'','key':_0xb639('0x1f'),'keyType':_0xb639('0x7'),'keyContent':'','variableName':_0xb639('0x20')},{'type':_0xb639('0x1'),'content':_0xb639('0x11')},{'type':_0xb639('0xc'),'content':'','key':_0xb639('0x21'),'keyType':_0xb639('0x7'),'keyContent':'','variableName':_0xb639('0x22')},{'type':_0xb639('0xc'),'content':'','key':_0xb639('0x23'),'keyType':_0xb639('0x7'),'keyContent':'','variableName':'endtime'},{'type':_0xb639('0xc'),'content':'','key':_0xb639('0x24'),'keyType':_0xb639('0x7'),'keyContent':'','variableName':'duration'},{'type':'keyValue','content':'','key':_0xb639('0x25'),'keyType':'variable','keyContent':'','variableName':_0xb639('0x26')}];break;}}return _0x56529e;}; \ No newline at end of file +var _0x13fe=['toLowerCase','variable','push','calleridnum','outbound','Outbound\x20Call','destcalleridnum','getDescriptions','inbound','***\x20Call\x20Info\x20***','keyValue','Caller\x20Name','Call\x20To','destexten','Queue','UniqueId','uniqueid','Date','agentcalledAt','***\x20Agent\x20Info\x20***','Agent\x20Name','destcalleridname','Agent\x20Number','Agent\x20Ring','agentconnectAt','Agent\x20Complete','agentcompleteAt','talktime','Called\x20Number','Member\x20Name','membername','starttime','***\x20Time\x20Info\x20***','answertime','Duration','duration','getSubjects','string','[xCALLY\x20Ticket]','voice'];(function(_0x39b6a3,_0x4d6330){var _0xc83019=function(_0x1ab92c){while(--_0x1ab92c){_0x39b6a3['push'](_0x39b6a3['shift']());}};_0xc83019(++_0x4d6330);}(_0x13fe,0x9c));var _0xe13f=function(_0x187ee1,_0x3fd1e6){_0x187ee1=_0x187ee1-0x0;var _0x388160=_0x13fe[_0x187ee1];return _0x388160;};'use strict';exports[_0xe13f('0x0')]=function(_0x5466dd,_0x5bd713){var _0x2fb8ec=[{'type':_0xe13f('0x1'),'content':_0xe13f('0x2'),'variableName':null}];switch(_0x5466dd['toLowerCase']()){case _0xe13f('0x3'):switch(_0x5bd713[_0xe13f('0x4')]()){case'inbound':_0x2fb8ec['push']({'type':_0xe13f('0x5'),'content':'','variableName':'queue'});_0x2fb8ec[_0xe13f('0x6')]({'type':_0xe13f('0x5'),'content':'','variableName':_0xe13f('0x7')});break;case _0xe13f('0x8'):_0x2fb8ec[_0xe13f('0x6')]({'type':_0xe13f('0x1'),'content':_0xe13f('0x9'),'variableName':null});_0x2fb8ec[_0xe13f('0x6')]({'type':_0xe13f('0x5'),'content':'','variableName':_0xe13f('0xa')});break;}}return _0x2fb8ec;};exports[_0xe13f('0xb')]=function(_0x1899b7,_0xc3bc88){var _0x1ab7e0=[];switch(_0x1899b7[_0xe13f('0x4')]()){case _0xe13f('0x3'):switch(_0xc3bc88[_0xe13f('0x4')]()){case _0xe13f('0xc'):_0x1ab7e0=[{'type':'string','content':_0xe13f('0xd'),'key':null,'keyType':null,'variableName':null},{'type':_0xe13f('0xe'),'content':'','key':'Caller\x20Number','keyType':_0xe13f('0x5'),'variableName':_0xe13f('0x7')},{'type':_0xe13f('0xe'),'content':'','key':_0xe13f('0xf'),'keyType':_0xe13f('0x5'),'variableName':'calleridname'},{'type':'keyValue','content':'','key':_0xe13f('0x10'),'keyType':'variable','variableName':_0xe13f('0x11')},{'type':_0xe13f('0xe'),'content':'','key':_0xe13f('0x12'),'keyType':_0xe13f('0x5'),'variableName':'queue'},{'type':_0xe13f('0xe'),'content':'','key':_0xe13f('0x13'),'keyType':_0xe13f('0x5'),'variableName':_0xe13f('0x14')},{'type':_0xe13f('0xe'),'content':'','key':_0xe13f('0x15'),'keyType':'variable','variableName':_0xe13f('0x16')},{'type':'string','content':_0xe13f('0x17'),'key':null,'keyType':null,'variableName':null},{'type':_0xe13f('0xe'),'content':'','key':_0xe13f('0x18'),'keyType':_0xe13f('0x5'),'variableName':_0xe13f('0x19')},{'type':_0xe13f('0xe'),'content':'','key':_0xe13f('0x1a'),'keyType':_0xe13f('0x5'),'variableName':_0xe13f('0xa')},{'type':_0xe13f('0x1'),'content':'***\x20Time\x20Info\x20***','key':null,'keyType':null,'variableName':null},{'type':_0xe13f('0xe'),'content':'','key':_0xe13f('0x1b'),'keyType':'variable','variableName':_0xe13f('0x16')},{'type':_0xe13f('0xe'),'content':'','key':'Agent\x20Connect','keyType':_0xe13f('0x5'),'variableName':_0xe13f('0x1c')},{'type':_0xe13f('0xe'),'content':'','key':_0xe13f('0x1d'),'keyType':_0xe13f('0x5'),'variableName':_0xe13f('0x1e')},{'type':_0xe13f('0xe'),'content':'','key':'Hold\x20Time','keyType':_0xe13f('0x5'),'variableName':'holdtime'},{'type':_0xe13f('0xe'),'content':'','key':'Talk\x20Time','keyType':_0xe13f('0x5'),'variableName':_0xe13f('0x1f')}];break;case _0xe13f('0x8'):_0x1ab7e0=[{'type':_0xe13f('0x1'),'content':_0xe13f('0xd'),'variableName':null},{'type':_0xe13f('0xe'),'content':'','key':_0xe13f('0x20'),'keyType':'variable','keyContent':'','variableName':_0xe13f('0xa')},{'type':'keyValue','content':'','key':_0xe13f('0x21'),'keyType':_0xe13f('0x5'),'keyContent':'','variableName':_0xe13f('0x22')},{'type':_0xe13f('0xe'),'content':'','key':_0xe13f('0x13'),'keyType':_0xe13f('0x5'),'keyContent':'','variableName':_0xe13f('0x14')},{'type':_0xe13f('0xe'),'content':'','key':_0xe13f('0x15'),'keyType':_0xe13f('0x5'),'keyContent':'','variableName':_0xe13f('0x23')},{'type':_0xe13f('0x1'),'content':_0xe13f('0x24')},{'type':_0xe13f('0xe'),'content':'','key':'Answer\x20Time','keyType':'variable','keyContent':'','variableName':_0xe13f('0x25')},{'type':_0xe13f('0xe'),'content':'','key':'Complete\x20Time','keyType':'variable','keyContent':'','variableName':'endtime'},{'type':_0xe13f('0xe'),'content':'','key':_0xe13f('0x26'),'keyType':_0xe13f('0x5'),'keyContent':'','variableName':_0xe13f('0x27')},{'type':_0xe13f('0xe'),'content':'','key':'Billable\x20Time','keyType':_0xe13f('0x5'),'keyContent':'','variableName':'billableseconds'}];break;}}return _0x1ab7e0;}; \ No newline at end of file diff --git a/server/components/interaction/service.js b/server/components/interaction/service.js index 7a432a8..a3a3af2 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 _0x5e1a=['omit','body','html','fax','mobile','lodash','../../config/logger','openchannel-interactions','mail-interactions','fax-interactions','sms-interactions','chat-interactions','upperFirst','InteractionId','unknown','toLowerCase','toUpperCase','name','role','null','Interaction','findOne','then','update','error','tracked','user','query','clone'];(function(_0x56ba9,_0x1af179){var _0x25e6f5=function(_0x3b6ce7){while(--_0x3b6ce7){_0x56ba9['push'](_0x56ba9['shift']());}};_0x25e6f5(++_0x1af179);}(_0x5e1a,0x161));var _0xa5e1=function(_0x1fc1f9,_0x454fb2){_0x1fc1f9=_0x1fc1f9-0x0;var _0x4987ca=_0x5e1a[_0x1fc1f9];return _0x4987ca;};'use strict';var _=require(_0xa5e1('0x0'));var db=require('../../mysqldb')['db'];var loggers={'openchannel':require(_0xa5e1('0x1'))(_0xa5e1('0x2')),'mail':require(_0xa5e1('0x1'))(_0xa5e1('0x3')),'fax':require(_0xa5e1('0x1'))(_0xa5e1('0x4')),'sms':require(_0xa5e1('0x1'))(_0xa5e1('0x5')),'chat':require('../../config/logger')(_0xa5e1('0x6')),'whatsapp':require('../../config/logger')('whatsapp-interactions')};function getInteractionId(_0x4a3b99,_0x450120,_0x108c9c){if(_0x4a3b99&&_0x4a3b99[_[_0xa5e1('0x7')](_0x108c9c)+_0xa5e1('0x8')]){return _0x4a3b99[_[_0xa5e1('0x7')](_0x108c9c)+_0xa5e1('0x8')];}else if(_0x4a3b99&&_0x4a3b99['id']){return _0x4a3b99['id'];}else if(_0x450120&&_0x450120['id']){return _0x450120['id'];}else{return _0xa5e1('0x9');}}function log(_0x1515d3,_0x221a0c,_0x17d057,_0x2ee32a,_0x406c9d,_0x4726a2){loggers[_0x406c9d[_0xa5e1('0xa')]()][_0x1515d3]('[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x4726a2[_0xa5e1('0xb')](),_0x221a0c?_0x221a0c['id']:null,_0x221a0c?_0x221a0c[_0xa5e1('0xc')]:null,_0x221a0c?_0x221a0c[_0xa5e1('0xd')]:null,getInteractionId(_0x17d057,_0x2ee32a,_0x406c9d),_0x17d057?JSON['stringify'](_0x17d057):_0xa5e1('0xe'));}function updateUser(_0x194a0e,_0x5cb912,_0xe788f3,_0x46827f,_0x368f30){db[_['upperFirst'](_0x46827f)+_0xa5e1('0xf')][_0xa5e1('0x10')]({'where':{'id':getInteractionId(_0x5cb912,_0xe788f3,_0x46827f)}})[_0xa5e1('0x11')](function(_0x2ac2e3){if(_0x2ac2e3){return _0x2ac2e3[_0xa5e1('0x12')]({'UserId':_0x194a0e?_0x194a0e['id']:null});}})[_0xa5e1('0x11')](function(_0x48d906){if(_0x48d906){log('info',_0x194a0e,_0x5cb912,_0xe788f3,_0x46827f,_0x368f30);}})['catch'](function(){log(_0xa5e1('0x13'),_0x194a0e,_0x5cb912,_0xe788f3,_0x46827f,_0x368f30);});}exports[_0xa5e1('0x14')]=function(_0x4e5f65,_0x19ba89){return function(_0x1f8983,_0x41f196,_0x3fe97f){var _0x22ceae=_0x1f8983[_0xa5e1('0x15')];var _0x1559e7={};var _0x4cb985=_0x1f8983[_0xa5e1('0x16')];if(_0x1559e7){_0x1559e7=_[_0xa5e1('0x17')](_0x1f8983['body']);_0x1559e7=_[_0xa5e1('0x18')](_0x1559e7,[_0xa5e1('0x19'),_0xa5e1('0x1a'),'phone',_0xa5e1('0x1b'),_0xa5e1('0x1c')]);}updateUser(_0x22ceae,_0x1559e7,_0x4cb985,_0x4e5f65,_0x19ba89);_0x3fe97f(null);};}; \ No newline at end of file +var _0x009d=['omit','body','html','phone','mobile','lodash','../../mysqldb','openchannel-interactions','../../config/logger','mail-interactions','fax-interactions','sms-interactions','chat-interactions','upperFirst','InteractionId','unknown','toLowerCase','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','name','null','Interaction','findOne','then','info','catch','tracked','query'];(function(_0x4ff09b,_0x53f67d){var _0x3f5c2e=function(_0x124592){while(--_0x124592){_0x4ff09b['push'](_0x4ff09b['shift']());}};_0x3f5c2e(++_0x53f67d);}(_0x009d,0x71));var _0xd009=function(_0xd64975,_0x109747){_0xd64975=_0xd64975-0x0;var _0x50500f=_0x009d[_0xd64975];return _0x50500f;};'use strict';var _=require(_0xd009('0x0'));var db=require(_0xd009('0x1'))['db'];var loggers={'openchannel':require('../../config/logger')(_0xd009('0x2')),'mail':require(_0xd009('0x3'))(_0xd009('0x4')),'fax':require(_0xd009('0x3'))(_0xd009('0x5')),'sms':require(_0xd009('0x3'))(_0xd009('0x6')),'chat':require(_0xd009('0x3'))(_0xd009('0x7')),'whatsapp':require(_0xd009('0x3'))('whatsapp-interactions')};function getInteractionId(_0x283208,_0x3b50fa,_0x5e86fc){if(_0x283208&&_0x283208[_[_0xd009('0x8')](_0x5e86fc)+'InteractionId']){return _0x283208[_[_0xd009('0x8')](_0x5e86fc)+_0xd009('0x9')];}else if(_0x283208&&_0x283208['id']){return _0x283208['id'];}else if(_0x3b50fa&&_0x3b50fa['id']){return _0x3b50fa['id'];}else{return _0xd009('0xa');}}function log(_0x213f97,_0x3e4fe7,_0x3c02a5,_0x18eed0,_0x2f76c4,_0x43db27){loggers[_0x2f76c4[_0xd009('0xb')]()][_0x213f97](_0xd009('0xc'),_0x43db27['toUpperCase'](),_0x3e4fe7?_0x3e4fe7['id']:null,_0x3e4fe7?_0x3e4fe7[_0xd009('0xd')]:null,_0x3e4fe7?_0x3e4fe7['role']:null,getInteractionId(_0x3c02a5,_0x18eed0,_0x2f76c4),_0x3c02a5?JSON['stringify'](_0x3c02a5):_0xd009('0xe'));}function updateUser(_0xedcb23,_0x3657f9,_0xae8f45,_0x20d0e9,_0x4c8b30){db[_[_0xd009('0x8')](_0x20d0e9)+_0xd009('0xf')][_0xd009('0x10')]({'where':{'id':getInteractionId(_0x3657f9,_0xae8f45,_0x20d0e9)}})[_0xd009('0x11')](function(_0x2b109e){if(_0x2b109e){return _0x2b109e['update']({'UserId':_0xedcb23?_0xedcb23['id']:null});}})[_0xd009('0x11')](function(_0x45aef0){if(_0x45aef0){log(_0xd009('0x12'),_0xedcb23,_0x3657f9,_0xae8f45,_0x20d0e9,_0x4c8b30);}})[_0xd009('0x13')](function(){log('error',_0xedcb23,_0x3657f9,_0xae8f45,_0x20d0e9,_0x4c8b30);});}exports[_0xd009('0x14')]=function(_0x180fc0,_0x56c5b7){return function(_0x1c4d1e,_0xe6805b,_0x3fa923){var _0x11c6ba=_0x1c4d1e['user'];var _0x27e3cd={};var _0x251d0b=_0x1c4d1e[_0xd009('0x15')];if(_0x27e3cd){_0x27e3cd=_['clone'](_0x1c4d1e['body']);_0x27e3cd=_[_0xd009('0x16')](_0x27e3cd,[_0xd009('0x17'),_0xd009('0x18'),_0xd009('0x19'),'fax',_0xd009('0x1a')]);}updateUser(_0x11c6ba,_0x27e3cd,_0x251d0b,_0x180fc0,_0x56c5b7);_0x3fa923(null);};}; \ No newline at end of file diff --git a/server/components/license/service.js b/server/components/license/service.js index 1612528..fe91765 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 _0x722b=['isUserLimit','util','composable-middleware','../../mysqldb','data1','split','createDecipher','aes-256-ctr','%s:%s:%s','update','base64','final','utf8','parse','hasOwnProperty','use','findOne','then','status','json','format','Maximum\x20%s\x20limit\x20have\x20been\x20reached','catch','User','user'];(function(_0x2c7618,_0x26be9c){var _0x5ce3f0=function(_0x1837b3){while(--_0x1837b3){_0x2c7618['push'](_0x2c7618['shift']());}};_0x5ce3f0(++_0x26be9c);}(_0x722b,0x1dc));var _0xb722=function(_0x5d099b,_0x588a69){_0x5d099b=_0x5d099b-0x0;var _0x1526cb=_0x722b[_0x5d099b];return _0x1526cb;};'use strict';var crypto=require('crypto');var util=require(_0xb722('0x0'));var compose=require(_0xb722('0x1'));var db=require(_0xb722('0x2'))['db'];var config=require('../../config/environment');function getValueFromLicense(_0x3294ca,_0x3aba70){if(_0x3294ca&&_0x3aba70){if(_0x3aba70[_0xb722('0x3')]&&_0x3aba70['license']){var _0x1affa6=_0x3aba70['data1'];var _0x1c6d8f=_0x3aba70['license'];var _0x14367c=_0x1affa6[_0xb722('0x4')]('-')[0x4];var _0xcb4d2c=_0x1affa6[_0xb722('0x4')]('-')[0x0];var _0x4580c9=crypto[_0xb722('0x5')](_0xb722('0x6'),util['format'](_0xb722('0x7'),_0x14367c,_0x1affa6,_0xcb4d2c));var _0x149c27=_0x4580c9[_0xb722('0x8')](_0x1c6d8f,_0xb722('0x9'),'utf8');_0x149c27+=_0x4580c9[_0xb722('0xa')](_0xb722('0xb'));var _0x31fd6c=JSON[_0xb722('0xc')](_0x149c27);return _0x31fd6c[_0xb722('0xd')](_0x3294ca)?_0x31fd6c[_0x3294ca]:null;}}return null;}function isLimit(_0x194b48,_0x5a87b0,_0x2089dd,_0x29dc2d){var _0x3580bd=_0x5a87b0;return compose()[_0xb722('0xe')](function(_0x129ee0,_0x1daed0,_0x18fd5f){return db['License'][_0xb722('0xf')]({'where':{'id':0x1},'raw':!![]})[_0xb722('0x10')](function(_0xe7e60c){var _0x1b54d9=getValueFromLicense(_0x194b48,_0xe7e60c);return _0x1b54d9?_0x1b54d9:_0x3580bd;})[_0xb722('0x10')](function(_0x5bd501){_0x3580bd=_0x5bd501;return _0x2089dd['count'](_0x29dc2d);})[_0xb722('0x10')](function(_0x33f9ee){if(_0x33f9ee>=_0x3580bd){return _0x1daed0[_0xb722('0x11')](0x193)[_0xb722('0x12')]({'message':util[_0xb722('0x13')](_0xb722('0x14'),_0x194b48)});}_0x18fd5f();})[_0xb722('0x15')](function(_0x59e07a){_0x18fd5f(_0x59e07a);});});}function isUserLimit(){return isLimit('users',0x1,db[_0xb722('0x16')],{'where':{'$or':[{'role':'admin'},{'role':_0xb722('0x17')}]}});}exports[_0xb722('0x18')]=isUserLimit; \ No newline at end of file +var _0x244e=['base64','utf8','parse','hasOwnProperty','use','findOne','then','count','status','json','users','User','admin','isUserLimit','crypto','util','composable-middleware','../../mysqldb','data1','split','aes-256-ctr','format','%s:%s:%s'];(function(_0x4bf50f,_0x578e28){var _0x559a54=function(_0x91f49a){while(--_0x91f49a){_0x4bf50f['push'](_0x4bf50f['shift']());}};_0x559a54(++_0x578e28);}(_0x244e,0x1da));var _0xe244=function(_0x3098a7,_0x59084e){_0x3098a7=_0x3098a7-0x0;var _0x5ea2d2=_0x244e[_0x3098a7];return _0x5ea2d2;};'use strict';var crypto=require(_0xe244('0x0'));var util=require(_0xe244('0x1'));var compose=require(_0xe244('0x2'));var db=require(_0xe244('0x3'))['db'];var config=require('../../config/environment');function getValueFromLicense(_0x13cb76,_0x29e373){if(_0x13cb76&&_0x29e373){if(_0x29e373['data1']&&_0x29e373['license']){var _0x2ce3a4=_0x29e373[_0xe244('0x4')];var _0x456a38=_0x29e373['license'];var _0x3d6a9d=_0x2ce3a4[_0xe244('0x5')]('-')[0x4];var _0x32a827=_0x2ce3a4['split']('-')[0x0];var _0x33f039=crypto['createDecipher'](_0xe244('0x6'),util[_0xe244('0x7')](_0xe244('0x8'),_0x3d6a9d,_0x2ce3a4,_0x32a827));var _0x31e14b=_0x33f039['update'](_0x456a38,_0xe244('0x9'),'utf8');_0x31e14b+=_0x33f039['final'](_0xe244('0xa'));var _0x40d836=JSON[_0xe244('0xb')](_0x31e14b);return _0x40d836[_0xe244('0xc')](_0x13cb76)?_0x40d836[_0x13cb76]:null;}}return null;}function isLimit(_0x3db152,_0x5ea1db,_0xdd2d41,_0x3fb37f){var _0x429684=_0x5ea1db;return compose()[_0xe244('0xd')](function(_0xbb8831,_0x1d89ab,_0x179d27){return db['License'][_0xe244('0xe')]({'where':{'id':0x1},'raw':!![]})['then'](function(_0x369575){var _0x276146=getValueFromLicense(_0x3db152,_0x369575);return _0x276146?_0x276146:_0x429684;})[_0xe244('0xf')](function(_0x3533e7){_0x429684=_0x3533e7;return _0xdd2d41[_0xe244('0x10')](_0x3fb37f);})[_0xe244('0xf')](function(_0x39efec){if(_0x39efec>=_0x429684){return _0x1d89ab[_0xe244('0x11')](0x193)[_0xe244('0x12')]({'message':util[_0xe244('0x7')]('Maximum\x20%s\x20limit\x20have\x20been\x20reached',_0x3db152)});}_0x179d27();})['catch'](function(_0x199e84){_0x179d27(_0x199e84);});});}function isUserLimit(){return isLimit(_0xe244('0x13'),0x1,db[_0xe244('0x14')],{'where':{'$or':[{'role':_0xe244('0x15')},{'role':'user'}]}});}exports[_0xe244('0x16')]=isUserLimit; \ No newline at end of file diff --git a/server/components/parsers/advancedSearch.js b/server/components/parsers/advancedSearch.js index 32bb83d..3763f0c 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 _0xa278=['sqlOperator','startsWith','and','replace','[$and]','[$or]','split','slice','shift','match','forEach','filter','indexOf','map','conditions','push','buildExpression','DATE','operator','$eq','value','$gt','$lte','add','format','YYYY-MM-DD','castTo','text','CAST(','\x20AS\x20','field','$ne','$notIn','\x20OR\x20','\x20IS\x20NULL)','$in','IN\x20?','NOT\x20IN\x20?','<>\x20?','$substring','$endsWith','LIKE\x20?','$lt','<\x20?','<=\x20?','>=\x20?','$between','start','utcOffset','minutes','seconds','moment','parseSearch'];(function(_0x2a1b6e,_0x211b9a){var _0x16a00d=function(_0x4e3bb2){while(--_0x4e3bb2){_0x2a1b6e['push'](_0x2a1b6e['shift']());}};_0x16a00d(++_0x211b9a);}(_0xa278,0x9d));var _0x8a27=function(_0x43a5c7,_0x2286bf){_0x43a5c7=_0x43a5c7-0x0;var _0x3b12a2=_0xa278[_0x43a5c7];return _0x3b12a2;};'use strict';var _=require('lodash');var moment=require(_0x8a27('0x0'));exports[_0x8a27('0x1')]=function(_0x19e075){var _0xf7b540={'conditions':[]};_0xf7b540[_0x8a27('0x2')]=_[_0x8a27('0x3')](_0x19e075,'[$or]')?'or':_0x8a27('0x4');var _0x141c54=_0x19e075[_0x8a27('0x5')](_0x8a27('0x6'),'')[_0x8a27('0x5')](_0x8a27('0x7'),'')['split']('||');for(var _0x2a79cc=0x0;_0x2a79cc<_0x141c54['length'];_0x2a79cc++){var _0x5ca5c0=_0x141c54[_0x2a79cc][_0x8a27('0x8')](':=');var _0x4fdfeb=_0x5ca5c0[0x0];var _0x2d327e=_0x5ca5c0[_0x8a27('0x9')](0x1);_0x2d327e['forEach'](function(_0x34f827){var _0xda5235=_0x34f827[_0x8a27('0x8')]('[')[_0x8a27('0xa')]();var _0x14e6ed=_0x34f827[_0x8a27('0xb')](/\[(.*?)\]/g);_0x14e6ed[_0x8a27('0xc')](function(_0x1bde4c){var _0x345140=_0x1bde4c[_0x8a27('0x8')]('[')[_0x8a27('0xd')](function(_0x5a66b2){return _0x5a66b2[_0x8a27('0xe')](']')>-0x1;})[_0x8a27('0xf')](function(_0x49e1df){return _0x49e1df[_0x8a27('0x8')](']')[0x0];})[0x0];_0xf7b540[_0x8a27('0x10')][_0x8a27('0x11')]({'field':_0x4fdfeb,'operator':_0xda5235,'value':_0x345140});});});}return _0xf7b540;};exports[_0x8a27('0x12')]=function(_0x3c9236,_0x377706,_0x66c141){var _0x3da1cf={};if(_0x377706===_0x8a27('0x13')){if(_0x66c141[_0x8a27('0x14')]===_0x8a27('0x15')){_0x66c141['operator']='$between';_0x66c141[_0x8a27('0x16')]+=','+_0x66c141[_0x8a27('0x16')];}else if(_['includes']([_0x8a27('0x17'),_0x8a27('0x18')],_0x66c141[_0x8a27('0x14')])){_0x66c141[_0x8a27('0x16')]=moment(_0x66c141[_0x8a27('0x16')])[_0x8a27('0x19')](0x1,'days')[_0x8a27('0x1a')](_0x8a27('0x1b'));}}if(_0x66c141[_0x8a27('0x1c')]){_0x377706=_0x66c141[_0x8a27('0x1c')];_0x3da1cf[_0x8a27('0x1d')]=_0x8a27('0x1e')+_0x3c9236+'.'+_0x66c141['field']+_0x8a27('0x1f')+_0x66c141[_0x8a27('0x1c')]+')\x20'+parseOperator(_0x66c141['operator']);}else{_0x3da1cf[_0x8a27('0x1d')]=_0x3c9236+'.'+_0x66c141[_0x8a27('0x20')]+'\x20'+parseOperator(_0x66c141[_0x8a27('0x14')]);}if(_['includes']([_0x8a27('0x21'),_0x8a27('0x22')],_0x66c141[_0x8a27('0x14')]))_0x3da1cf[_0x8a27('0x1d')]='('+_0x3da1cf['text']+_0x8a27('0x23')+_0x3c9236+'.'+_0x66c141['field']+_0x8a27('0x24');_0x3da1cf['value']=parseValue(_0x377706,_0x66c141[_0x8a27('0x14')],_0x66c141[_0x8a27('0x16')]);return _0x3da1cf;};function parseOperator(_0x1873c3){var _0x20abd1;switch(_0x1873c3){case _0x8a27('0x25'):_0x20abd1=_0x8a27('0x26');break;case _0x8a27('0x22'):_0x20abd1=_0x8a27('0x27');break;case _0x8a27('0x15'):_0x20abd1='=\x20?';break;case _0x8a27('0x21'):_0x20abd1=_0x8a27('0x28');break;case _0x8a27('0x29'):case'$startsWith':case _0x8a27('0x2a'):_0x20abd1=_0x8a27('0x2b');break;case _0x8a27('0x2c'):_0x20abd1=_0x8a27('0x2d');break;case'$gt':_0x20abd1='>\x20?';break;case _0x8a27('0x18'):_0x20abd1=_0x8a27('0x2e');break;case'$gte':_0x20abd1=_0x8a27('0x2f');break;case _0x8a27('0x30'):_0x20abd1='BETWEEN\x20?\x20AND\x20?';break;}return _0x20abd1;}function parseValue(_0x142a8a,_0xf309a2,_0x3fc83f){var _0x309a6b={'start':undefined,'end':undefined};switch(_0xf309a2){case _0x8a27('0x25'):case'$notIn':_0x309a6b[_0x8a27('0x31')]=_0x3fc83f['split'](',');break;case'$substring':_0x309a6b[_0x8a27('0x31')]='%'+_0x3fc83f+'%';break;case'$startsWith':_0x309a6b['start']=_0x3fc83f+'%';break;case _0x8a27('0x2a'):_0x309a6b['start']='%'+_0x3fc83f;break;case _0x8a27('0x30'):var _0x2dcc9f=_0x3fc83f['split'](',');var _0x3fc83f=_0x2dcc9f[_0x8a27('0xa')]();var _0x218f8e=_0x2dcc9f['pop']();if(_0x142a8a===_0x8a27('0x13')){_0x3fc83f=moment(_0x3fc83f)[_0x8a27('0x32')](0x0,!![])[_0x8a27('0x1a')]();_0x218f8e=moment(_0x218f8e)[_0x8a27('0x32')](0x0,!![])[_0x8a27('0x19')](0x17,'hours')['add'](0x3b,_0x8a27('0x33'))['add'](0x3b,_0x8a27('0x34'))[_0x8a27('0x1a')]();}_0x309a6b={'start':_0x3fc83f,'end':_0x218f8e};break;default:_0x309a6b['start']=_0x3fc83f;break;}return _0x309a6b;} \ No newline at end of file +var _0xc10d=['NOT\x20IN\x20?','<>\x20?','$substring','$startsWith','$endsWith','LIKE\x20?','$lt','>\x20?','$gte','>=\x20?','$between','BETWEEN\x20?\x20AND\x20?','start','pop','utcOffset','hours','minutes','seconds','lodash','parseSearch','sqlOperator','startsWith','[$or]','and','replace','[$and]','split','length','slice','forEach','shift','match','indexOf','map','buildExpression','DATE','$eq','operator','value','$lte','add','days','format','YYYY-MM-DD','castTo','text','CAST(','field','$ne','\x20OR\x20','\x20IS\x20NULL)','$in','IN\x20?','$notIn'];(function(_0x1df18a,_0x1dabbc){var _0x499d3d=function(_0x54b968){while(--_0x54b968){_0x1df18a['push'](_0x1df18a['shift']());}};_0x499d3d(++_0x1dabbc);}(_0xc10d,0x1c2));var _0xdc10=function(_0x20714a,_0x7de591){_0x20714a=_0x20714a-0x0;var _0x15e877=_0xc10d[_0x20714a];return _0x15e877;};'use strict';var _=require(_0xdc10('0x0'));var moment=require('moment');exports[_0xdc10('0x1')]=function(_0x432e47){var _0x4a92cb={'conditions':[]};_0x4a92cb[_0xdc10('0x2')]=_[_0xdc10('0x3')](_0x432e47,_0xdc10('0x4'))?'or':_0xdc10('0x5');var _0x3cf84b=_0x432e47[_0xdc10('0x6')](_0xdc10('0x7'),'')[_0xdc10('0x6')](_0xdc10('0x4'),'')[_0xdc10('0x8')]('||');for(var _0x5b8956=0x0;_0x5b8956<_0x3cf84b[_0xdc10('0x9')];_0x5b8956++){var _0x1f475b=_0x3cf84b[_0x5b8956][_0xdc10('0x8')](':=');var _0x4b3ae3=_0x1f475b[0x0];var _0x54fd13=_0x1f475b[_0xdc10('0xa')](0x1);_0x54fd13[_0xdc10('0xb')](function(_0x32bb6b){var _0x3d3467=_0x32bb6b[_0xdc10('0x8')]('[')[_0xdc10('0xc')]();var _0x2180d7=_0x32bb6b[_0xdc10('0xd')](/\[(.*?)\]/g);_0x2180d7[_0xdc10('0xb')](function(_0x1c204f){var _0x191bd0=_0x1c204f[_0xdc10('0x8')]('[')['filter'](function(_0x5474be){return _0x5474be[_0xdc10('0xe')](']')>-0x1;})[_0xdc10('0xf')](function(_0x468ab6){return _0x468ab6[_0xdc10('0x8')](']')[0x0];})[0x0];_0x4a92cb['conditions']['push']({'field':_0x4b3ae3,'operator':_0x3d3467,'value':_0x191bd0});});});}return _0x4a92cb;};exports[_0xdc10('0x10')]=function(_0x5a548c,_0x465380,_0xdaf426){var _0x41c51e={};if(_0x465380===_0xdc10('0x11')){if(_0xdaf426['operator']===_0xdc10('0x12')){_0xdaf426[_0xdc10('0x13')]='$between';_0xdaf426[_0xdc10('0x14')]+=','+_0xdaf426[_0xdc10('0x14')];}else if(_['includes'](['$gt',_0xdc10('0x15')],_0xdaf426[_0xdc10('0x13')])){_0xdaf426[_0xdc10('0x14')]=moment(_0xdaf426[_0xdc10('0x14')])[_0xdc10('0x16')](0x1,_0xdc10('0x17'))[_0xdc10('0x18')](_0xdc10('0x19'));}}if(_0xdaf426['castTo']){_0x465380=_0xdaf426[_0xdc10('0x1a')];_0x41c51e[_0xdc10('0x1b')]=_0xdc10('0x1c')+_0x5a548c+'.'+_0xdaf426[_0xdc10('0x1d')]+'\x20AS\x20'+_0xdaf426[_0xdc10('0x1a')]+')\x20'+parseOperator(_0xdaf426['operator']);}else{_0x41c51e[_0xdc10('0x1b')]=_0x5a548c+'.'+_0xdaf426[_0xdc10('0x1d')]+'\x20'+parseOperator(_0xdaf426[_0xdc10('0x13')]);}if(_['includes']([_0xdc10('0x1e'),'$notIn'],_0xdaf426['operator']))_0x41c51e[_0xdc10('0x1b')]='('+_0x41c51e[_0xdc10('0x1b')]+_0xdc10('0x1f')+_0x5a548c+'.'+_0xdaf426[_0xdc10('0x1d')]+_0xdc10('0x20');_0x41c51e[_0xdc10('0x14')]=parseValue(_0x465380,_0xdaf426['operator'],_0xdaf426[_0xdc10('0x14')]);return _0x41c51e;};function parseOperator(_0x2d5427){var _0x2884a4;switch(_0x2d5427){case _0xdc10('0x21'):_0x2884a4=_0xdc10('0x22');break;case _0xdc10('0x23'):_0x2884a4=_0xdc10('0x24');break;case'$eq':_0x2884a4='=\x20?';break;case _0xdc10('0x1e'):_0x2884a4=_0xdc10('0x25');break;case _0xdc10('0x26'):case _0xdc10('0x27'):case _0xdc10('0x28'):_0x2884a4=_0xdc10('0x29');break;case _0xdc10('0x2a'):_0x2884a4='<\x20?';break;case'$gt':_0x2884a4=_0xdc10('0x2b');break;case _0xdc10('0x15'):_0x2884a4='<=\x20?';break;case _0xdc10('0x2c'):_0x2884a4=_0xdc10('0x2d');break;case _0xdc10('0x2e'):_0x2884a4=_0xdc10('0x2f');break;}return _0x2884a4;}function parseValue(_0x16a0c3,_0x5ed14e,_0x560439){var _0x54ef00={'start':undefined,'end':undefined};switch(_0x5ed14e){case _0xdc10('0x21'):case _0xdc10('0x23'):_0x54ef00[_0xdc10('0x30')]=_0x560439[_0xdc10('0x8')](',');break;case _0xdc10('0x26'):_0x54ef00[_0xdc10('0x30')]='%'+_0x560439+'%';break;case'$startsWith':_0x54ef00['start']=_0x560439+'%';break;case _0xdc10('0x28'):_0x54ef00[_0xdc10('0x30')]='%'+_0x560439;break;case _0xdc10('0x2e'):var _0x336069=_0x560439['split'](',');var _0x560439=_0x336069[_0xdc10('0xc')]();var _0x5d3681=_0x336069[_0xdc10('0x31')]();if(_0x16a0c3==='DATE'){_0x560439=moment(_0x560439)[_0xdc10('0x32')](0x0,!![])['format']();_0x5d3681=moment(_0x5d3681)[_0xdc10('0x32')](0x0,!![])['add'](0x17,_0xdc10('0x33'))['add'](0x3b,_0xdc10('0x34'))['add'](0x3b,_0xdc10('0x35'))[_0xdc10('0x18')]();}_0x54ef00={'start':_0x560439,'end':_0x5d3681};break;default:_0x54ef00[_0xdc10('0x30')]=_0x560439;break;}return _0x54ef00;} \ No newline at end of file diff --git a/server/components/parsers/qs.js b/server/components/parsers/qs.js index 15d08d6..db3f910 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 _0x771c=['parse','keys','includes','split','filters','DATE','isPlainObject','$gte','format','utc','$lte','YYYY-MM-DD','subtract','name','isArray','offset','map','indexOf','priority','cast','substr','DESC','unsigned','ASC','omit','isEmpty','length','isObject','isString','unset','hasOwnProperty','isNumeric','^[+]?[0-9]*$','isEmail','getFullTextValue','forEach','replace','push','join','getOptions','query','$id','intersection','attributes','fields','nolimit','limit','order','sort','pick','where','merge','type','VIRTUAL','col','lower','filter','options','lodash','sequelize'];(function(_0x354fba,_0x3bc0f8){var _0x324127=function(_0x741213){while(--_0x741213){_0x354fba['push'](_0x354fba['shift']());}};_0x324127(++_0x3bc0f8);}(_0x771c,0x76));var _0xc771=function(_0x59a14c,_0x149c53){_0x59a14c=_0x59a14c-0x0;var _0x5be3e8=_0x771c[_0x59a14c];return _0x5be3e8;};'use strict';var _=require(_0xc771('0x0'));var sequelize=require(_0xc771('0x1'));var moment=require('moment');var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0xfd50ca){var _0x5880ef=['ne'];try{var _0x4d9b43=JSON[_0xc771('0x2')](_0xfd50ca);var _0x30824a=Object[_0xc771('0x3')](_0x4d9b43)[0x0];return _0x5880ef[_0xc771('0x4')](_0x30824a);}catch(_0x7d36c1){return![];}}function getOperatorValue(_0x4aee95){var _0x30f20c=JSON[_0xc771('0x2')](_0x4aee95);var _0x173d12=Object['keys'](_0x30f20c)[0x0];var _0x9113ca=_0x30f20c[_0x173d12];return{['$'+_0x173d12]:_0x9113ca};}exports['fields']=function(_0x32d6cc){var _0x230a12=null;if(_0x32d6cc){_0x230a12=_0x32d6cc[_0xc771('0x5')](',');}return _0x230a12;};exports[_0xc771('0x6')]=function(_0x1fc671,_0x49d6ca){var _0x4b7de5={};if(!_['isEmpty'](_0x1fc671)){_['forOwn'](_0x1fc671,function(_0x2a58bf,_0xffa9b7){try{if(_0x49d6ca){var _0x4e9031=_['find'](_0x49d6ca,{'name':_0xffa9b7})||{};if(hasSequelizeOperator(_0x2a58bf)){_0x4b7de5[_0xffa9b7]=getOperatorValue(_0x2a58bf);}else if(_0x4e9031['type']===_0xc771('0x7')&&_[_0xc771('0x8')](_0x2a58bf)){var _0x4f3a0b=JSON['parse'](_0x2a58bf);var _0x2c41b5={'$gte':moment(moment(_0x4f3a0b[_0xc771('0x9')])[_0xc771('0xa')]('YYYY-MM-DD'))[_0xc771('0xb')]()[_0xc771('0xa')](),'$lte':moment(moment(_0x4f3a0b[_0xc771('0xc')])[_0xc771('0xa')](_0xc771('0xd')))['utc']()[_0xc771('0xe')](0x1,'s')[_0xc771('0xa')]()};_0x4b7de5[_0xffa9b7]=_0x2c41b5;}else if(_0x4e9031[_0xc771('0xf')]==='uniqueid'){_0x4b7de5[_0xffa9b7]=_0x2a58bf;}else{_0x4b7de5[_0xffa9b7]=_[_0xc771('0x10')](_0x2a58bf)?_0x2a58bf:JSON[_0xc771('0x2')](_0x2a58bf);}}else{_0x4b7de5[_0xffa9b7]=_[_0xc771('0x10')](_0x2a58bf)?_0x2a58bf:JSON['parse'](_0x2a58bf);}}catch(_0x596250){_0x4b7de5[_0xffa9b7]=_0x2a58bf[_0xc771('0x5')](',');}});}return _0x4b7de5;};exports['limit']=function(_0x38d08e){_0x38d08e=parseInt(_0x38d08e,0xa);if(!_0x38d08e||_0x38d08e<0x0){_0x38d08e=LIMIT_VALUE;}return _0x38d08e;};exports[_0xc771('0x11')]=function(_0x18d224){_0x18d224=parseInt(_0x18d224,0xa);if(!_0x18d224||_0x18d224<0x0){_0x18d224=0x0;}return _0x18d224;};exports['sort']=function(_0x1120ce){var _0x3e1a20,_0x367013=null;if(_0x1120ce){_0x3e1a20=_0x1120ce[_0xc771('0x5')](',');_0x367013=_[_0xc771('0x12')](_0x3e1a20,function(_0x7c902d){if(_0x7c902d[_0xc771('0x13')]('-')===0x0){return[_0x7c902d===_0xc771('0x14')?sequelize[_0xc771('0x15')](sequelize['col'](_0xc771('0x14')),'unsigned'):_0x7c902d[_0xc771('0x16')](0x1),_0xc771('0x17')];}else{return[_0x7c902d===_0xc771('0x14')?sequelize[_0xc771('0x15')](sequelize['col'](_0xc771('0x14')),_0xc771('0x18')):_0x7c902d,_0xc771('0x19')];}});}return _0x367013;};exports[_0xc771('0x1a')]=function(_0xb421c7,_0xfc22d6){if(_[_0xc771('0x1b')](_0xb421c7)){return _0xb421c7;}if(_[_0xc771('0x10')](_0xb421c7)){for(var _0x557eca=0x0;_0x557eca<_0xb421c7[_0xc771('0x1c')];_0x557eca+=0x1){_0xb421c7[_0x557eca]=this[_0xc771('0x1a')](_0xb421c7[_0x557eca],_0xfc22d6);}return _0xb421c7;}if(!_[_0xc771('0x1d')](_0xb421c7)){return _0xb421c7;}if(_[_0xc771('0x1e')](_0xfc22d6)){_0xfc22d6=[_0xfc22d6];}if(!_[_0xc771('0x10')](_0xfc22d6)){return _0xb421c7;}for(var _0x22cd53=0x0;_0x22cd53<_0xfc22d6[_0xc771('0x1c')];_0x22cd53+=0x1){_[_0xc771('0x1f')](_0xb421c7,_0xfc22d6[_0x22cd53]);}for(var _0x3d9b24 in _0xb421c7){if(_0xb421c7[_0xc771('0x20')](_0x3d9b24)){_0xb421c7[_0x3d9b24]=this[_0xc771('0x1a')](_0xb421c7[_0x3d9b24],_0xfc22d6);}}return _0xb421c7;};exports[_0xc771('0x21')]=function(_0xdbb7f5){return _0xdbb7f5['match'](RegExp(_0xc771('0x22')))?!![]:![];};exports[_0xc771('0x23')]=function(_0x38541c){return _0x38541c['match'](/^\S+@\S+$/)?!![]:![];};exports[_0xc771('0x24')]=function(_0x241097){var _0x3b7a76=[];_0x241097[_0xc771('0x5')](/[ ,]+/)[_0xc771('0x25')](function(_0x40d6d0){_0x40d6d0=_0x40d6d0[_0xc771('0x26')](/([^:]")"+/g,'$1');_0x40d6d0='+'+_0x40d6d0+'*';if(_0x40d6d0[_0xc771('0x4')]('@'))_0x40d6d0='\x22'+_0x40d6d0+'\x22';_0x3b7a76[_0xc771('0x27')](_0x40d6d0);});return _0x3b7a76[_0xc771('0x28')]('\x20');};exports[_0xc771('0x29')]=function(_0x1e156b,_0x28702c,_0x392635){var _0x4070af={},_0x203004={};if(_0x28702c[_0xc771('0x2a')][_0xc771('0x2b')]){_0x28702c[_0xc771('0x2a')]['id']=_0x28702c[_0xc771('0x2a')]['$id'];delete _0x28702c['query']['$id'];}_0x4070af['model']=_[_0xc771('0x12')](_0x1e156b,_0xc771('0xf'));_0x4070af['query']=_[_0xc771('0x3')](_0x28702c[_0xc771('0x2a')]);_0x4070af['filters']=_[_0xc771('0x2c')](_0x4070af['model'],_0x4070af[_0xc771('0x2a')]);_0x203004[_0xc771('0x2d')]=_[_0xc771('0x2c')](_0x4070af['model'],this[_0xc771('0x2e')](_0x28702c[_0xc771('0x2a')][_0xc771('0x2e')]));_0x203004['attributes']=_0x203004['attributes'][_0xc771('0x1c')]?_0x203004['attributes']:_0x4070af['model'];if(!_0x28702c[_0xc771('0x2a')][_0xc771('0x20')](_0xc771('0x2f'))){_0x203004[_0xc771('0x30')]=this[_0xc771('0x30')](_0x28702c[_0xc771('0x2a')][_0xc771('0x30')]);_0x203004[_0xc771('0x11')]=this[_0xc771('0x11')](_0x28702c[_0xc771('0x2a')][_0xc771('0x11')]);}_0x203004[_0xc771('0x31')]=this[_0xc771('0x32')](_0x28702c[_0xc771('0x2a')][_0xc771('0x32')]);_0x203004['where']=this[_0xc771('0x6')](_[_0xc771('0x33')](_0x28702c[_0xc771('0x2a')],_0x4070af[_0xc771('0x6')]),_0x1e156b);if(_0x28702c[_0xc771('0x2a')]['filter']){_0x203004[_0xc771('0x34')]=_[_0xc771('0x35')](_0x203004[_0xc771('0x34')],{'$or':_[_0xc771('0x12')](_0x1e156b,function(_0x38407d){if(_0x38407d[_0xc771('0x36')]!==_0xc771('0x37')){if(_0x392635){return sequelize[_0xc771('0x34')](sequelize['fn']('lower',sequelize[_0xc771('0x38')](_0x38407d[_0xc771('0xf')])),{'$like':sequelize['fn'](_0xc771('0x39'),'%'+_0x28702c[_0xc771('0x2a')]['filter']+'%')});}else{var _0x32f908={};_0x32f908[_0x38407d['name']]={'$like':'%'+_0x28702c['query'][_0xc771('0x3a')]+'%'};return _0x32f908;}}})});}_0x203004=_[_0xc771('0x35')]({},_0x203004,_0x28702c[_0xc771('0x3b')]);return _0x203004;}; \ No newline at end of file +var _0x60ac=['forEach','replace','join','getOptions','$id','query','model','intersection','attributes','hasOwnProperty','nolimit','where','VIRTUAL','lower','filter','merge','options','sequelize','moment','parse','includes','keys','fields','split','filters','isEmpty','forOwn','type','DATE','isPlainObject','$gte','format','utc','$lte','YYYY-MM-DD','subtract','name','uniqueid','isArray','limit','offset','sort','map','indexOf','priority','cast','col','substr','DESC','unsigned','omit','isObject','isString','length','unset','isNumeric','^[+]?[0-9]*$','match','getFullTextValue'];(function(_0x371a1d,_0x30cf66){var _0x40afb9=function(_0x3618db){while(--_0x3618db){_0x371a1d['push'](_0x371a1d['shift']());}};_0x40afb9(++_0x30cf66);}(_0x60ac,0x1e9));var _0xc60a=function(_0x71deed,_0x21ee99){_0x71deed=_0x71deed-0x0;var _0x20ae29=_0x60ac[_0x71deed];return _0x20ae29;};'use strict';var _=require('lodash');var sequelize=require(_0xc60a('0x0'));var moment=require(_0xc60a('0x1'));var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x1362dc){var _0x47ddd6=['ne'];try{var _0x2c4ec2=JSON[_0xc60a('0x2')](_0x1362dc);var _0x1d7532=Object['keys'](_0x2c4ec2)[0x0];return _0x47ddd6[_0xc60a('0x3')](_0x1d7532);}catch(_0x10efa4){return![];}}function getOperatorValue(_0x80887d){var _0x2a84e1=JSON[_0xc60a('0x2')](_0x80887d);var _0x25aae8=Object[_0xc60a('0x4')](_0x2a84e1)[0x0];var _0x224e25=_0x2a84e1[_0x25aae8];return{['$'+_0x25aae8]:_0x224e25};}exports[_0xc60a('0x5')]=function(_0x1d9cdb){var _0x513d4e=null;if(_0x1d9cdb){_0x513d4e=_0x1d9cdb[_0xc60a('0x6')](',');}return _0x513d4e;};exports[_0xc60a('0x7')]=function(_0xbc0e11,_0x1e764c){var _0x22c69d={};if(!_[_0xc60a('0x8')](_0xbc0e11)){_[_0xc60a('0x9')](_0xbc0e11,function(_0x237f54,_0x586a2c){try{if(_0x1e764c){var _0x1b9617=_['find'](_0x1e764c,{'name':_0x586a2c})||{};if(hasSequelizeOperator(_0x237f54)){_0x22c69d[_0x586a2c]=getOperatorValue(_0x237f54);}else if(_0x1b9617[_0xc60a('0xa')]===_0xc60a('0xb')&&_[_0xc60a('0xc')](_0x237f54)){var _0xf4efd6=JSON['parse'](_0x237f54);var _0x4bf307={'$gte':moment(moment(_0xf4efd6[_0xc60a('0xd')])[_0xc60a('0xe')]('YYYY-MM-DD'))[_0xc60a('0xf')]()['format'](),'$lte':moment(moment(_0xf4efd6[_0xc60a('0x10')])[_0xc60a('0xe')](_0xc60a('0x11')))[_0xc60a('0xf')]()[_0xc60a('0x12')](0x1,'s')['format']()};_0x22c69d[_0x586a2c]=_0x4bf307;}else if(_0x1b9617[_0xc60a('0x13')]===_0xc60a('0x14')){_0x22c69d[_0x586a2c]=_0x237f54;}else{_0x22c69d[_0x586a2c]=_[_0xc60a('0x15')](_0x237f54)?_0x237f54:JSON[_0xc60a('0x2')](_0x237f54);}}else{_0x22c69d[_0x586a2c]=_[_0xc60a('0x15')](_0x237f54)?_0x237f54:JSON[_0xc60a('0x2')](_0x237f54);}}catch(_0x1de60f){_0x22c69d[_0x586a2c]=_0x237f54[_0xc60a('0x6')](',');}});}return _0x22c69d;};exports[_0xc60a('0x16')]=function(_0x145ce4){_0x145ce4=parseInt(_0x145ce4,0xa);if(!_0x145ce4||_0x145ce4<0x0){_0x145ce4=LIMIT_VALUE;}return _0x145ce4;};exports[_0xc60a('0x17')]=function(_0x38f6c8){_0x38f6c8=parseInt(_0x38f6c8,0xa);if(!_0x38f6c8||_0x38f6c8<0x0){_0x38f6c8=0x0;}return _0x38f6c8;};exports[_0xc60a('0x18')]=function(_0x65e9c0){var _0x5865e9,_0x341df7=null;if(_0x65e9c0){_0x5865e9=_0x65e9c0[_0xc60a('0x6')](',');_0x341df7=_[_0xc60a('0x19')](_0x5865e9,function(_0x5a6796){if(_0x5a6796[_0xc60a('0x1a')]('-')===0x0){return[_0x5a6796===_0xc60a('0x1b')?sequelize[_0xc60a('0x1c')](sequelize[_0xc60a('0x1d')](_0xc60a('0x1b')),'unsigned'):_0x5a6796[_0xc60a('0x1e')](0x1),_0xc60a('0x1f')];}else{return[_0x5a6796===_0xc60a('0x1b')?sequelize[_0xc60a('0x1c')](sequelize[_0xc60a('0x1d')](_0xc60a('0x1b')),_0xc60a('0x20')):_0x5a6796,'ASC'];}});}return _0x341df7;};exports[_0xc60a('0x21')]=function(_0x490118,_0x18b09c){if(_['isEmpty'](_0x490118)){return _0x490118;}if(_['isArray'](_0x490118)){for(var _0x5673de=0x0;_0x5673de<_0x490118['length'];_0x5673de+=0x1){_0x490118[_0x5673de]=this[_0xc60a('0x21')](_0x490118[_0x5673de],_0x18b09c);}return _0x490118;}if(!_[_0xc60a('0x22')](_0x490118)){return _0x490118;}if(_[_0xc60a('0x23')](_0x18b09c)){_0x18b09c=[_0x18b09c];}if(!_[_0xc60a('0x15')](_0x18b09c)){return _0x490118;}for(var _0x1066ad=0x0;_0x1066ad<_0x18b09c[_0xc60a('0x24')];_0x1066ad+=0x1){_[_0xc60a('0x25')](_0x490118,_0x18b09c[_0x1066ad]);}for(var _0x16821c in _0x490118){if(_0x490118['hasOwnProperty'](_0x16821c)){_0x490118[_0x16821c]=this[_0xc60a('0x21')](_0x490118[_0x16821c],_0x18b09c);}}return _0x490118;};exports[_0xc60a('0x26')]=function(_0x52fa7e){return _0x52fa7e['match'](RegExp(_0xc60a('0x27')))?!![]:![];};exports['isEmail']=function(_0x4ecaec){return _0x4ecaec[_0xc60a('0x28')](/^\S+@\S+$/)?!![]:![];};exports[_0xc60a('0x29')]=function(_0x543a45){var _0x3e43d0=[];_0x543a45['split'](/[ ,]+/)[_0xc60a('0x2a')](function(_0x4a669f){_0x4a669f=_0x4a669f[_0xc60a('0x2b')](/([^:]")"+/g,'$1');_0x4a669f='+'+_0x4a669f+'*';if(_0x4a669f[_0xc60a('0x3')]('@'))_0x4a669f='\x22'+_0x4a669f+'\x22';_0x3e43d0['push'](_0x4a669f);});return _0x3e43d0[_0xc60a('0x2c')]('\x20');};exports[_0xc60a('0x2d')]=function(_0x4d4f87,_0x67ac91,_0x3aa8e7){var _0x20b9d2={},_0x1fe284={};if(_0x67ac91['query'][_0xc60a('0x2e')]){_0x67ac91[_0xc60a('0x2f')]['id']=_0x67ac91[_0xc60a('0x2f')][_0xc60a('0x2e')];delete _0x67ac91['query']['$id'];}_0x20b9d2[_0xc60a('0x30')]=_[_0xc60a('0x19')](_0x4d4f87,_0xc60a('0x13'));_0x20b9d2[_0xc60a('0x2f')]=_['keys'](_0x67ac91[_0xc60a('0x2f')]);_0x20b9d2[_0xc60a('0x7')]=_[_0xc60a('0x31')](_0x20b9d2[_0xc60a('0x30')],_0x20b9d2['query']);_0x1fe284['attributes']=_[_0xc60a('0x31')](_0x20b9d2[_0xc60a('0x30')],this[_0xc60a('0x5')](_0x67ac91[_0xc60a('0x2f')][_0xc60a('0x5')]));_0x1fe284[_0xc60a('0x32')]=_0x1fe284[_0xc60a('0x32')]['length']?_0x1fe284[_0xc60a('0x32')]:_0x20b9d2['model'];if(!_0x67ac91[_0xc60a('0x2f')][_0xc60a('0x33')](_0xc60a('0x34'))){_0x1fe284['limit']=this[_0xc60a('0x16')](_0x67ac91[_0xc60a('0x2f')][_0xc60a('0x16')]);_0x1fe284[_0xc60a('0x17')]=this['offset'](_0x67ac91[_0xc60a('0x2f')][_0xc60a('0x17')]);}_0x1fe284['order']=this['sort'](_0x67ac91[_0xc60a('0x2f')][_0xc60a('0x18')]);_0x1fe284['where']=this[_0xc60a('0x7')](_['pick'](_0x67ac91[_0xc60a('0x2f')],_0x20b9d2['filters']),_0x4d4f87);if(_0x67ac91[_0xc60a('0x2f')]['filter']){_0x1fe284['where']=_['merge'](_0x1fe284[_0xc60a('0x35')],{'$or':_[_0xc60a('0x19')](_0x4d4f87,function(_0x465151){if(_0x465151[_0xc60a('0xa')]!==_0xc60a('0x36')){if(_0x3aa8e7){return sequelize[_0xc60a('0x35')](sequelize['fn'](_0xc60a('0x37'),sequelize[_0xc60a('0x1d')](_0x465151[_0xc60a('0x13')])),{'$like':sequelize['fn'](_0xc60a('0x37'),'%'+_0x67ac91[_0xc60a('0x2f')][_0xc60a('0x38')]+'%')});}else{var _0x28a19b={};_0x28a19b[_0x465151[_0xc60a('0x13')]]={'$like':'%'+_0x67ac91['query']['filter']+'%'};return _0x28a19b;}}})});}_0x1fe284=_[_0xc60a('0x39')]({},_0x1fe284,_0x67ac91[_0xc60a('0x3a')]);return _0x1fe284;}; \ No newline at end of file diff --git a/server/config/express.js b/server/config/express.js index e8f7272..2f50559 100644 --- a/server/config/express.js +++ b/server/config/express.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc308=['../mysqldb','default','env','production','appPath','join','root','development','test','use','json\x20replacer','toISOString','static','/server/views','html','renderFile','set','json','50mb','express','body-parser','cookie-parser','errorhandler','path','passport','cors','moment'];(function(_0xd0883f,_0x45b6de){var _0x736c83=function(_0x17fa18){while(--_0x17fa18){_0xd0883f['push'](_0xd0883f['shift']());}};_0x736c83(++_0x45b6de);}(_0xc308,0x1c3));var _0x8c30=function(_0x15681c,_0x1de42e){_0x15681c=_0x15681c-0x0;var _0x1cddf6=_0xc308[_0x15681c];return _0x1cddf6;};'use strict';var express=require(_0x8c30('0x0'));var favicon=require('serve-favicon');var bodyParser=require(_0x8c30('0x1'));var methodOverride=require('method-override');var cookieParser=require(_0x8c30('0x2'));var errorHandler=require(_0x8c30('0x3'));var path=require(_0x8c30('0x4'));var passport=require(_0x8c30('0x5'));var cors=require(_0x8c30('0x6'));var moment=require(_0x8c30('0x7'));var config=require('./environment');var db=require(_0x8c30('0x8'))['db'];exports[_0x8c30('0x9')]=function(_0x2b5f51){var _0x3bbbbb=_0x2b5f51['get'](_0x8c30('0xa'));if(_0x3bbbbb===_0x8c30('0xb')){_0x2b5f51['set'](_0x8c30('0xc'),path[_0x8c30('0xd')](config[_0x8c30('0xe')],'public'));}if(_0x3bbbbb===_0x8c30('0xf')||_0x3bbbbb===_0x8c30('0x10')){_0x2b5f51['set']('appPath',path[_0x8c30('0xd')](config['root'],'client'));_0x2b5f51[_0x8c30('0x11')](errorHandler());}_0x2b5f51['set'](_0x8c30('0x12'),function(_0x4f8810,_0x4f7e49){if(this[_0x4f8810]instanceof Date){_0x4f7e49=this[_0x4f8810][_0x8c30('0x13')]()['split']('.')[0x0]+'Z';}return _0x4f7e49;});_0x2b5f51[_0x8c30('0x11')](express[_0x8c30('0x14')](_0x2b5f51['get'](_0x8c30('0xc'))));_0x2b5f51['set']('views',config[_0x8c30('0xe')]+_0x8c30('0x15'));_0x2b5f51['engine'](_0x8c30('0x16'),require('ejs')[_0x8c30('0x17')]);_0x2b5f51[_0x8c30('0x18')]('view\x20engine',_0x8c30('0x16'));_0x2b5f51['use'](bodyParser['urlencoded']({'limit':'50mb','extended':!![]}));_0x2b5f51[_0x8c30('0x11')](bodyParser[_0x8c30('0x19')]({'limit':_0x8c30('0x1a')}));_0x2b5f51[_0x8c30('0x11')](cors());_0x2b5f51[_0x8c30('0x11')](methodOverride());_0x2b5f51[_0x8c30('0x11')](cookieParser());_0x2b5f51['use'](passport['initialize']());}; \ No newline at end of file +var _0xa1d4=['views','engine','html','ejs','renderFile','view\x20engine','urlencoded','json','50mb','initialize','express','body-parser','method-override','cookie-parser','path','passport','cors','moment','./environment','../mysqldb','default','get','set','appPath','join','root','public','development','test','client','json\x20replacer','split','use'];(function(_0x45a648,_0x44141a){var _0x8c3a88=function(_0x5b1993){while(--_0x5b1993){_0x45a648['push'](_0x45a648['shift']());}};_0x8c3a88(++_0x44141a);}(_0xa1d4,0x1b7));var _0x4a1d=function(_0x12f2fe,_0x16f760){_0x12f2fe=_0x12f2fe-0x0;var _0x39e2a4=_0xa1d4[_0x12f2fe];return _0x39e2a4;};'use strict';var express=require(_0x4a1d('0x0'));var favicon=require('serve-favicon');var bodyParser=require(_0x4a1d('0x1'));var methodOverride=require(_0x4a1d('0x2'));var cookieParser=require(_0x4a1d('0x3'));var errorHandler=require('errorhandler');var path=require(_0x4a1d('0x4'));var passport=require(_0x4a1d('0x5'));var cors=require(_0x4a1d('0x6'));var moment=require(_0x4a1d('0x7'));var config=require(_0x4a1d('0x8'));var db=require(_0x4a1d('0x9'))['db'];exports[_0x4a1d('0xa')]=function(_0x509b68){var _0x5ba022=_0x509b68[_0x4a1d('0xb')]('env');if(_0x5ba022==='production'){_0x509b68[_0x4a1d('0xc')](_0x4a1d('0xd'),path[_0x4a1d('0xe')](config[_0x4a1d('0xf')],_0x4a1d('0x10')));}if(_0x5ba022===_0x4a1d('0x11')||_0x5ba022===_0x4a1d('0x12')){_0x509b68[_0x4a1d('0xc')](_0x4a1d('0xd'),path[_0x4a1d('0xe')](config[_0x4a1d('0xf')],_0x4a1d('0x13')));_0x509b68['use'](errorHandler());}_0x509b68[_0x4a1d('0xc')](_0x4a1d('0x14'),function(_0x5db801,_0x4bb6f0){if(this[_0x5db801]instanceof Date){_0x4bb6f0=this[_0x5db801]['toISOString']()[_0x4a1d('0x15')]('.')[0x0]+'Z';}return _0x4bb6f0;});_0x509b68[_0x4a1d('0x16')](express['static'](_0x509b68[_0x4a1d('0xb')](_0x4a1d('0xd'))));_0x509b68[_0x4a1d('0xc')](_0x4a1d('0x17'),config[_0x4a1d('0xf')]+'/server/views');_0x509b68[_0x4a1d('0x18')](_0x4a1d('0x19'),require(_0x4a1d('0x1a'))[_0x4a1d('0x1b')]);_0x509b68[_0x4a1d('0xc')](_0x4a1d('0x1c'),_0x4a1d('0x19'));_0x509b68[_0x4a1d('0x16')](bodyParser[_0x4a1d('0x1d')]({'limit':'50mb','extended':!![]}));_0x509b68['use'](bodyParser[_0x4a1d('0x1e')]({'limit':_0x4a1d('0x1f')}));_0x509b68[_0x4a1d('0x16')](cors());_0x509b68['use'](methodOverride());_0x509b68['use'](cookieParser());_0x509b68[_0x4a1d('0x16')](passport[_0x4a1d('0x20')]());}; \ No newline at end of file diff --git a/server/config/license/hardware.js b/server/config/license/hardware.js index edfeb85..03d443e 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 _0xc169=['hex','substring','lodash','crypto','bimedia-machine-uuid','child_process','../environment','networkInterfaces','orderBy','keys','filter','IPv4','internal','concat','mac','00:00:00:00:00:00','address','getFirstInterface','cpus','model','join','createHash','update','digest','getUuid','platform','licenseToken','test','dmidecode\x20--string\x20system-uuid','utf8','hostname','macAddress','md5'];(function(_0x3fbebd,_0xd765b5){var _0x4aba4f=function(_0xe8a147){while(--_0xe8a147){_0x3fbebd['push'](_0x3fbebd['shift']());}};_0x4aba4f(++_0xd765b5);}(_0xc169,0xc8));var _0x9c16=function(_0xe077c0,_0x220fa4){_0xe077c0=_0xe077c0-0x0;var _0x4e724d=_0xc169[_0xe077c0];return _0x4e724d;};'use strict';var _=require(_0x9c16('0x0'));var os=require('os');var crypto=require(_0x9c16('0x1'));var machine=require(_0x9c16('0x2'));var exec=require(_0x9c16('0x3'))['execSync'];var config=require(_0x9c16('0x4'));function getInterfaces(){var _0x5bc5b4=[];var _0x452eaf=os[_0x9c16('0x5')]();var _0x274d69=_[_0x9c16('0x6')](_[_0x9c16('0x7')](_0x452eaf));for(var _0x5b5228=0x0;_0x5b5228<_0x274d69['length'];_0x5b5228++){var _0x37c804=_0x452eaf[_0x274d69[_0x5b5228]][_0x9c16('0x8')](function(_0x583691){return _0x583691['family']===_0x9c16('0x9')&&_0x583691[_0x9c16('0xa')]===![];});_0x5bc5b4=_0x5bc5b4[_0x9c16('0xb')](_0x37c804);}return _0x5bc5b4;}function getFirstInterface(){var _0x5d40ff=_['head'](getInterfaces());return{'macAddress':_0x5d40ff&&_0x5d40ff[_0x9c16('0xc')]?_0x5d40ff[_0x9c16('0xc')]:_0x9c16('0xd'),'ipAddress':_0x5d40ff&&_0x5d40ff['address']?_0x5d40ff[_0x9c16('0xe')]:'127.0.0.1'};}exports[_0x9c16('0xf')]=getFirstInterface;function getCPUhash(){var _0x122339=_[_0x9c16('0x6')](os[_0x9c16('0x10')]()['map'](function(_0x2d1b71){return _0x2d1b71[_0x9c16('0x11')];}))[_0x9c16('0x12')](':');return crypto[_0x9c16('0x13')]('md5')[_0x9c16('0x14')](_0x122339)[_0x9c16('0x15')]('hex');}exports[_0x9c16('0x16')]=function(){var _0x565b49=os[_0x9c16('0x17')]();var _0x2f7b6d=/[0-9a-f-]{36}/;if(config[_0x9c16('0x18')]&&_0x2f7b6d[_0x9c16('0x19')](config[_0x9c16('0x18')])){return config[_0x9c16('0x18')];}else if(_0x565b49==='win32'){return exec(_0x9c16('0x1a'),{'encoding':_0x9c16('0x1b')})['replace']('\x0d\x0a','');}else{var _0x161c05=getFirstInterface();var _0x2f973b=getCPUhash();var _0x1524b1=_0x2f973b+'|'+os[_0x9c16('0x1c')]()+'|'+_0x161c05[_0x9c16('0x1d')]+'|'+_0x161c05['ipAddress'];var _0x336426=crypto[_0x9c16('0x13')](_0x9c16('0x1e'))[_0x9c16('0x14')](_0x1524b1)[_0x9c16('0x15')](_0x9c16('0x1f'));return _0x336426[_0x9c16('0x20')](0x0,0x8)+'-'+_0x336426[_0x9c16('0x20')](0x8,0xc)+'-'+_0x336426['substring'](0xc,0x10)+'-'+_0x336426[_0x9c16('0x20')](0x10,0x14)+'-'+_0x336426[_0x9c16('0x20')](0x14);}}; \ No newline at end of file +var _0x9a01=['digest','substring','lodash','crypto','bimedia-machine-uuid','child_process','execSync','../environment','orderBy','keys','filter','family','IPv4','internal','head','mac','address','127.0.0.1','getFirstInterface','cpus','model','join','createHash','md5','update','hex','getUuid','platform','licenseToken','win32','dmidecode\x20--string\x20system-uuid','utf8','replace','macAddress','ipAddress'];(function(_0xafdec6,_0x3d94df){var _0x372bdb=function(_0x5b3fd6){while(--_0x5b3fd6){_0xafdec6['push'](_0xafdec6['shift']());}};_0x372bdb(++_0x3d94df);}(_0x9a01,0xd4));var _0x19a0=function(_0xfc81ea,_0xf6df71){_0xfc81ea=_0xfc81ea-0x0;var _0x16511f=_0x9a01[_0xfc81ea];return _0x16511f;};'use strict';var _=require(_0x19a0('0x0'));var os=require('os');var crypto=require(_0x19a0('0x1'));var machine=require(_0x19a0('0x2'));var exec=require(_0x19a0('0x3'))[_0x19a0('0x4')];var config=require(_0x19a0('0x5'));function getInterfaces(){var _0x19ba0b=[];var _0x3efc1c=os['networkInterfaces']();var _0x4598d2=_[_0x19a0('0x6')](_[_0x19a0('0x7')](_0x3efc1c));for(var _0xd02fb3=0x0;_0xd02fb3<_0x4598d2['length'];_0xd02fb3++){var _0x508b43=_0x3efc1c[_0x4598d2[_0xd02fb3]][_0x19a0('0x8')](function(_0x58d903){return _0x58d903[_0x19a0('0x9')]===_0x19a0('0xa')&&_0x58d903[_0x19a0('0xb')]===![];});_0x19ba0b=_0x19ba0b['concat'](_0x508b43);}return _0x19ba0b;}function getFirstInterface(){var _0x1cc78c=_[_0x19a0('0xc')](getInterfaces());return{'macAddress':_0x1cc78c&&_0x1cc78c[_0x19a0('0xd')]?_0x1cc78c[_0x19a0('0xd')]:'00:00:00:00:00:00','ipAddress':_0x1cc78c&&_0x1cc78c['address']?_0x1cc78c[_0x19a0('0xe')]:_0x19a0('0xf')};}exports[_0x19a0('0x10')]=getFirstInterface;function getCPUhash(){var _0x32ca10=_[_0x19a0('0x6')](os[_0x19a0('0x11')]()['map'](function(_0x47f086){return _0x47f086[_0x19a0('0x12')];}))[_0x19a0('0x13')](':');return crypto[_0x19a0('0x14')](_0x19a0('0x15'))[_0x19a0('0x16')](_0x32ca10)['digest'](_0x19a0('0x17'));}exports[_0x19a0('0x18')]=function(){var _0x147cf6=os[_0x19a0('0x19')]();var _0x3ec601=/[0-9a-f-]{36}/;if(config['licenseToken']&&_0x3ec601['test'](config[_0x19a0('0x1a')])){return config['licenseToken'];}else if(_0x147cf6===_0x19a0('0x1b')){return exec(_0x19a0('0x1c'),{'encoding':_0x19a0('0x1d')})[_0x19a0('0x1e')]('\x0d\x0a','');}else{var _0x49030b=getFirstInterface();var _0x407343=getCPUhash();var _0x1f985f=_0x407343+'|'+os['hostname']()+'|'+_0x49030b[_0x19a0('0x1f')]+'|'+_0x49030b[_0x19a0('0x20')];var _0x54e5d9=crypto['createHash'](_0x19a0('0x15'))['update'](_0x1f985f)[_0x19a0('0x21')](_0x19a0('0x17'));return _0x54e5d9[_0x19a0('0x22')](0x0,0x8)+'-'+_0x54e5d9[_0x19a0('0x22')](0x8,0xc)+'-'+_0x54e5d9[_0x19a0('0x22')](0xc,0x10)+'-'+_0x54e5d9[_0x19a0('0x22')](0x10,0x14)+'-'+_0x54e5d9[_0x19a0('0x22')](0x14);}}; \ No newline at end of file diff --git a/server/config/license/index.js b/server/config/license/index.js index a64e76d..eef5e36 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 _0x990c=['DEMO\x20START\x20AT\x20%s','catch','error','message','finally','getUuid','findOrCreate','spread','default','moment','request-promise','bluebird','pkginfo','version','../../mysqldb','../../components/encryptor','./hardware','license','%s/api/servers/%s/check?version=%s','exports','format','GET','then','get','data2','data1','active','info','THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED','update','THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s','toUpperCase','YYYY-MM-DD\x20HH:mm','encryptString','diff','decryptString','days'];(function(_0x3cb300,_0x4d7a99){var _0x3e0cd9=function(_0x21d5b7){while(--_0x21d5b7){_0x3cb300['push'](_0x3cb300['shift']());}};_0x3e0cd9(++_0x4d7a99);}(_0x990c,0x11a));var _0xc990=function(_0x48eb84,_0x1764c0){_0x48eb84=_0x48eb84-0x0;var _0x1234f5=_0x990c[_0x48eb84];return _0x1234f5;};'use strict';var util=require('util');var moment=require(_0xc990('0x0'));var rp=require(_0xc990('0x1'));var BPromise=require(_0xc990('0x2'));var pkginfo=require(_0xc990('0x3'))(module,_0xc990('0x4'));var db=require(_0xc990('0x5'))['db'];var encryptor=require(_0xc990('0x6'));var hardware=require(_0xc990('0x7'));var logger=require('../logger')(_0xc990('0x8'));var HOST='https://www.xcallymotion.com';var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0x23535b){return new BPromise(function(_0x465319,_0x10c44f){var _0xaf10bb=util['format'](_0xc990('0x9'),HOST,_0x23535b,module[_0xc990('0xa')]['version']);if(oldToken){_0xaf10bb=util[_0xc990('0xb')]('%s/api/servers/%s/check?version=%s&oldtoken=%s',HOST,_0x23535b,module[_0xc990('0xa')][_0xc990('0x4')],oldToken);}var _0x32ccdd={'uri':_0xaf10bb,'method':_0xc990('0xc'),'timeout':0xea60,'json':!![]};return rp(_0x32ccdd)[_0xc990('0xd')](function(_0x5cf0e4){_0x465319(_0x5cf0e4);})['catch'](function(_0x250fac){_0x10c44f(_0x250fac);});});}function manageLicense(_0x152ea5,_0x2f5976){var _0x2c58b9=_0x2f5976[_0xc990('0xe')]({'plain':!![]});if(!isOldTokenSent&&_0x2c58b9['data1']!==_0x152ea5&&!_0x2c58b9[_0xc990('0xf')]){oldToken=_0x2c58b9[_0xc990('0x10')];}httpRequest(_0x152ea5)[_0xc990('0xd')](function(_0x58e7aa){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x58e7aa[_0xc990('0x11')]){isOldTokenSent=![];if(!_0x2c58b9['license']&&_0x2c58b9[_0xc990('0x8')]!=_0x58e7aa['license']||_0x2c58b9[_0xc990('0x8')]&&_0x2c58b9['data2']){logger[_0xc990('0x12')](_0xc990('0x13'));}if(_0x2c58b9[_0xc990('0x8')]&&!_0x2c58b9[_0xc990('0xf')]&&_0x2c58b9['license']!=_0x58e7aa[_0xc990('0x8')]){logger['info']('THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED');}if(_0x2c58b9[_0xc990('0x8')]&&!_0x2c58b9[_0xc990('0xf')]&&_0x2c58b9[_0xc990('0x8')]==_0x58e7aa[_0xc990('0x8')]){return _0x2f5976;}return _0x2f5976[_0xc990('0x14')]({'data1':_0x152ea5,'data2':null,'license':_0x58e7aa[_0xc990('0x8')]});}else{if(_0x58e7aa[_0xc990('0x8')]||_0x2c58b9['license']){if(!_0x2c58b9[_0xc990('0xf')]){if(_0x2c58b9[_0xc990('0x10')]==_0x152ea5){GRAY_PERIOD_REASON='Disabled';logger['info'](_0xc990('0x15'));}else{GRAY_PERIOD_REASON='Changed';logger[_0xc990('0x12')](_0xc990('0x16'),_0x2c58b9[_0xc990('0x10')],_0x152ea5);}logger[_0xc990('0x12')](_0xc990('0x17'),GRAY_PERIOD_REASON[_0xc990('0x18')](),moment()['format'](_0xc990('0x19')));return _0x2f5976[_0xc990('0x14')]({'data2':encryptor[_0xc990('0x1a')](moment()[_0xc990('0xb')]('YYYY-MM-DD\x20HH:mm'))});}else{if(moment()[_0xc990('0x1b')](encryptor[_0xc990('0x1c')](_0x2c58b9[_0xc990('0xf')]),_0xc990('0x1d'))>DAYS){logger[_0xc990('0x12')](_0xc990('0x1e'),moment()[_0xc990('0xb')](_0xc990('0x19')));isOldTokenSent=![];return _0x2f5976[_0xc990('0x14')]({'data1':_0x152ea5,'data2':null,'license':null});}}}else{if(_0x2c58b9['data1']!=_0x152ea5){logger[_0xc990('0x12')]('NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s',_0x2c58b9[_0xc990('0x10')],_0x152ea5);return _0x2f5976[_0xc990('0x14')]({'data1':_0x152ea5,'data2':null,'license':null});}}}return _0x2f5976;})[_0xc990('0xd')](function(_0x2b5fc8){_0x2f5976=_0x2b5fc8;})[_0xc990('0x1f')](function(_0x4806e9){logger[_0xc990('0x20')](_0x4806e9[_0xc990('0x21')]);})[_0xc990('0x22')](function(){setTimeout(function(){manageLicense(hardware[_0xc990('0x23')](),_0x2f5976);},TIME);});}function defaultLicense(){var _0xfaa1a1=hardware[_0xc990('0x23')]();if(_0xfaa1a1){return db['License'][_0xc990('0x24')]({'where':{'id':0x1},'defaults':{'data1':_0xfaa1a1}})[_0xc990('0x25')](function(_0x1d03bf,_0x233af7){logger['info']('SERVICE\x20LICENSE\x20STARTED\x20%s',_0xfaa1a1);manageLicense(_0xfaa1a1,_0x1d03bf);})[_0xc990('0x1f')](function(_0x4949c7){logger[_0xc990('0x20')](_0x4949c7[_0xc990('0x21')]);});}}exports[_0xc990('0x26')]=defaultLicense; \ No newline at end of file +var _0x22ef=['spread','SERVICE\x20LICENSE\x20STARTED\x20%s','default','util','request-promise','bluebird','pkginfo','../../components/encryptor','./hardware','license','https://www.xcallymotion.com','format','%s/api/servers/%s/check?version=%s','exports','%s/api/servers/%s/check?version=%s&oldtoken=%s','version','GET','then','catch','get','data1','data2','active','info','Disabled','THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s','YYYY-MM-DD\x20HH:mm','update','decryptString','DEMO\x20START\x20AT\x20%s','message','finally','getUuid','License','findOrCreate'];(function(_0x5a76f2,_0x1fa794){var _0x2ab3d3=function(_0x436579){while(--_0x436579){_0x5a76f2['push'](_0x5a76f2['shift']());}};_0x2ab3d3(++_0x1fa794);}(_0x22ef,0x106));var _0xf22e=function(_0xd833e9,_0x3bfea3){_0xd833e9=_0xd833e9-0x0;var _0xaa0a46=_0x22ef[_0xd833e9];return _0xaa0a46;};'use strict';var util=require(_0xf22e('0x0'));var moment=require('moment');var rp=require(_0xf22e('0x1'));var BPromise=require(_0xf22e('0x2'));var pkginfo=require(_0xf22e('0x3'))(module,'version');var db=require('../../mysqldb')['db'];var encryptor=require(_0xf22e('0x4'));var hardware=require(_0xf22e('0x5'));var logger=require('../logger')(_0xf22e('0x6'));var HOST=_0xf22e('0x7');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0x56befe){return new BPromise(function(_0x557945,_0x379fe5){var _0x899d85=util[_0xf22e('0x8')](_0xf22e('0x9'),HOST,_0x56befe,module[_0xf22e('0xa')]['version']);if(oldToken){_0x899d85=util[_0xf22e('0x8')](_0xf22e('0xb'),HOST,_0x56befe,module[_0xf22e('0xa')][_0xf22e('0xc')],oldToken);}var _0x1d4077={'uri':_0x899d85,'method':_0xf22e('0xd'),'timeout':0xea60,'json':!![]};return rp(_0x1d4077)[_0xf22e('0xe')](function(_0x7deee7){_0x557945(_0x7deee7);})[_0xf22e('0xf')](function(_0x30cb0d){_0x379fe5(_0x30cb0d);});});}function manageLicense(_0x110416,_0x3380b1){var _0x48cd5d=_0x3380b1[_0xf22e('0x10')]({'plain':!![]});if(!isOldTokenSent&&_0x48cd5d[_0xf22e('0x11')]!==_0x110416&&!_0x48cd5d[_0xf22e('0x12')]){oldToken=_0x48cd5d[_0xf22e('0x11')];}httpRequest(_0x110416)[_0xf22e('0xe')](function(_0x276fbc){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x276fbc[_0xf22e('0x13')]){isOldTokenSent=![];if(!_0x48cd5d[_0xf22e('0x6')]&&_0x48cd5d[_0xf22e('0x6')]!=_0x276fbc[_0xf22e('0x6')]||_0x48cd5d['license']&&_0x48cd5d[_0xf22e('0x12')]){logger[_0xf22e('0x14')]('THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED');}if(_0x48cd5d[_0xf22e('0x6')]&&!_0x48cd5d['data2']&&_0x48cd5d['license']!=_0x276fbc[_0xf22e('0x6')]){logger['info']('THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED');}if(_0x48cd5d['license']&&!_0x48cd5d[_0xf22e('0x12')]&&_0x48cd5d[_0xf22e('0x6')]==_0x276fbc[_0xf22e('0x6')]){return _0x3380b1;}return _0x3380b1['update']({'data1':_0x110416,'data2':null,'license':_0x276fbc['license']});}else{if(_0x276fbc[_0xf22e('0x6')]||_0x48cd5d[_0xf22e('0x6')]){if(!_0x48cd5d[_0xf22e('0x12')]){if(_0x48cd5d[_0xf22e('0x11')]==_0x110416){GRAY_PERIOD_REASON=_0xf22e('0x15');logger[_0xf22e('0x14')](_0xf22e('0x16'));}else{GRAY_PERIOD_REASON='Changed';logger[_0xf22e('0x14')](_0xf22e('0x17'),_0x48cd5d[_0xf22e('0x11')],_0x110416);}logger['info'](_0xf22e('0x18'),GRAY_PERIOD_REASON['toUpperCase'](),moment()[_0xf22e('0x8')](_0xf22e('0x19')));return _0x3380b1[_0xf22e('0x1a')]({'data2':encryptor['encryptString'](moment()[_0xf22e('0x8')](_0xf22e('0x19')))});}else{if(moment()['diff'](encryptor[_0xf22e('0x1b')](_0x48cd5d[_0xf22e('0x12')]),'days')>DAYS){logger[_0xf22e('0x14')](_0xf22e('0x1c'),moment()[_0xf22e('0x8')](_0xf22e('0x19')));isOldTokenSent=![];return _0x3380b1[_0xf22e('0x1a')]({'data1':_0x110416,'data2':null,'license':null});}}}else{if(_0x48cd5d[_0xf22e('0x11')]!=_0x110416){logger['info'](_0xf22e('0x17'),_0x48cd5d[_0xf22e('0x11')],_0x110416);return _0x3380b1[_0xf22e('0x1a')]({'data1':_0x110416,'data2':null,'license':null});}}}return _0x3380b1;})[_0xf22e('0xe')](function(_0x36dcef){_0x3380b1=_0x36dcef;})[_0xf22e('0xf')](function(_0x479a7b){logger['error'](_0x479a7b[_0xf22e('0x1d')]);})[_0xf22e('0x1e')](function(){setTimeout(function(){manageLicense(hardware[_0xf22e('0x1f')](),_0x3380b1);},TIME);});}function defaultLicense(){var _0x23f585=hardware[_0xf22e('0x1f')]();if(_0x23f585){return db[_0xf22e('0x20')][_0xf22e('0x21')]({'where':{'id':0x1},'defaults':{'data1':_0x23f585}})[_0xf22e('0x22')](function(_0x29fa7d,_0x13c4bd){logger[_0xf22e('0x14')](_0xf22e('0x23'),_0x23f585);manageLicense(_0x23f585,_0x29fa7d);})[_0xf22e('0xf')](function(_0x23b0ad){logger['error'](_0x23b0ad[_0xf22e('0x1d')]);});}}exports[_0xf22e('0x24')]=defaultLicense; \ No newline at end of file diff --git a/server/config/license/util.js b/server/config/license/util.js index a21910a..e1395f8 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 _0xe32a=['moment','bluebird','./hardware','../../components/encryptor','../../mysqldb','2027-01-01T00:00:00.000Z','Demo\x20license','getUuid','Breaking\x20license','License','find','defaults','then','catch','data1','license','isEmpty','License\x20key\x20value\x20not\x20found','data2','split','format','%s:%s:%s','parse','demo','uuid','deadline','add','days','machineUuid','changed','disabled','message','User','findAll','role','sequelize','col','count','admin','user','telephone','users','telephones','forEach','pick','countBy','lodash'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0xe32a,0x119));var _0xae32=function(_0x38b2d9,_0x19fd42){_0x38b2d9=_0x38b2d9-0x0;var _0x23a3e1=_0xe32a[_0x38b2d9];return _0x23a3e1;};'use strict';var util=require('util');var _=require(_0xae32('0x0'));var moment=require(_0xae32('0x1'));var BPromise=require(_0xae32('0x2'));var hardware=require(_0xae32('0x3'));var encryptor=require(_0xae32('0x4'));var db=require(_0xae32('0x5'))['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0xae32('0x6'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':_0xae32('0x7'),'machineUuid':hardware[_0xae32('0x8')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};const breakingLicense={'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0xae32('0x6'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':_0xae32('0x9'),'machineUuid':hardware[_0xae32('0x8')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0x11ebb7){return new BPromise(function(_0x42bf3a,_0x4994e8){return db[_0xae32('0xa')][_0xae32('0xb')](_[_0xae32('0xc')](_0x11ebb7,{'raw':!![],'where':{'id':0x1}}))[_0xae32('0xd')](function(_0x592278){return checkLicense(_0x592278,null);})[_0xae32('0xd')](function(_0x25031a){_0x42bf3a(_0x25031a);return;})[_0xae32('0xe')](function(_0x43ab8e){_0x4994e8(_0x43ab8e);});});}function checkLicense(_0x138be4,_0x5b995c){if(!_0x138be4){demoLicense['uuid']=_0x138be4[_0xae32('0xf')];return demoLicense;}try{var _0x48492e=_0x5b995c||_0x138be4[_0xae32('0x10')];if(_[_0xae32('0x11')](_0x48492e)){throw new Error(_0xae32('0x12'));}var _0x5628f6=_0x138be4[_0xae32('0xf')];var _0x5ba58f=_0x138be4[_0xae32('0x13')];var _0x4dffae=_0x5628f6['split']('-')[0x4];var _0x511244=_0x5628f6[_0xae32('0x14')]('-')[0x0];var _0x12dca1=encryptor['decryptString'](_0x48492e,util[_0xae32('0x15')](_0xae32('0x16'),_0x4dffae,_0x5628f6,_0x511244));var _0x6d1166=JSON[_0xae32('0x17')](_0x12dca1);_0x6d1166[_0xae32('0x18')]=![];_0x6d1166[_0xae32('0x19')]=_0x5628f6;_0x6d1166['machineUuid']=hardware['getUuid']();if(_0x5ba58f){var _0x4adbfd=encryptor['decryptString'](_0x5ba58f);_0x6d1166['gray']=_0x4adbfd;_0x6d1166[_0xae32('0x1a')]=moment(_0x4adbfd)[_0xae32('0x1b')](0x7,_0xae32('0x1c'))['format']();_0x6d1166['grayReason']=_0x6d1166['uuid']!=_0x6d1166[_0xae32('0x1d')]?_0xae32('0x1e'):_0xae32('0x1f');}return _0x6d1166;}catch(_0x3e0fe0){breakingLicense['uuid']=_0x138be4['data1'];breakingLicense[_0xae32('0x20')]=_0x3e0fe0['message'];return breakingLicense;}}function getLimits(){return new BPromise(function(_0x1abd12,_0x402c77){getLicense()[_0xae32('0xd')](function(_0x2fc7c1){return db[_0xae32('0x21')][_0xae32('0x22')]({'attributes':[_0xae32('0x23'),[db[_0xae32('0x24')]['fn']('COUNT',db[_0xae32('0x24')][_0xae32('0x25')](_0xae32('0x23'))),_0xae32('0x26')]],'group':'role','where':{'role':{'$or':[_0xae32('0x27'),_0xae32('0x28'),_0xae32('0x29')]}},'raw':!![]})[_0xae32('0xd')](function(_0x13f975){var _0x449dbc={'user':_0x2fc7c1[_0xae32('0x2a')]||0x0,'telephone':_0x2fc7c1[_0xae32('0x2b')]||0x0};_0x13f975[_0xae32('0x2c')](function(_0x2fe15c){var _0x40cf33=_0x2fe15c[_0xae32('0x23')]===_0xae32('0x27')?_0xae32('0x28'):_0x2fe15c['role'];_0x449dbc[_0x40cf33]-=_0x2fe15c['count'];if(_0x449dbc[_0x40cf33]<0x0)_0x449dbc[_0x40cf33]=0x0;});_0x1abd12(_0x449dbc);return;});})[_0xae32('0xe')](function(_0x231004){_0x402c77(_0x231004);});});}function checkUserLimits(_0x1ef1d5){return new BPromise(function(_0x14f7a5,_0xd62a6f){getLimits()['then'](function(_0x16c826){var _0x29f4d9=_[_0xae32('0x2d')](_[_0xae32('0x2e')](_0x1ef1d5,_0xae32('0x23')),[_0xae32('0x27'),_0xae32('0x28'),_0xae32('0x29')]);var _0x59546d=(_0x29f4d9[_0xae32('0x27')]||0x0)+(_0x29f4d9[_0xae32('0x28')]||0x0);var _0x3e6a92=_0x29f4d9[_0xae32('0x29')]||0x0;if(_0x59546d>_0x16c826['user'])return _0xd62a6f('License\x20limit\x20reached\x20for\x20users');if(_0x3e6a92>_0x16c826['telephone'])return _0xd62a6f('License\x20limit\x20reached\x20for\x20telephones');return _0x14f7a5();})[_0xae32('0xe')](function(_0x33ac95){_0xd62a6f(_0x33ac95);});});}module['exports']={'checkLicense':checkLicense,'checkUserLimits':checkUserLimits,'getLicense':getLicense}; \ No newline at end of file +var _0x4228=['License','find','defaults','then','catch','uuid','data1','license','isEmpty','License\x20key\x20value\x20not\x20found','data2','split','decryptString','%s:%s:%s','parse','demo','gray','deadline','days','format','grayReason','machineUuid','changed','message','findAll','role','sequelize','count','admin','users','telephones','forEach','user','pick','telephone','License\x20limit\x20reached\x20for\x20users','exports','lodash','moment','bluebird','./hardware','../../components/encryptor','../../mysqldb','2027-01-01T00:00:00.000Z','Demo\x20license','getUuid','Breaking\x20license'];(function(_0x363104,_0x3c060d){var _0x316c35=function(_0x42562f){while(--_0x42562f){_0x363104['push'](_0x363104['shift']());}};_0x316c35(++_0x3c060d);}(_0x4228,0x13f));var _0x8422=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4228[_0x3dd15e];return _0x231fd0;};'use strict';var util=require('util');var _=require(_0x8422('0x0'));var moment=require(_0x8422('0x1'));var BPromise=require(_0x8422('0x2'));var hardware=require(_0x8422('0x3'));var encryptor=require(_0x8422('0x4'));var db=require(_0x8422('0x5'))['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x8422('0x6'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':_0x8422('0x7'),'machineUuid':hardware[_0x8422('0x8')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};const breakingLicense={'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x8422('0x6'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':_0x8422('0x9'),'machineUuid':hardware[_0x8422('0x8')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0x64ce41){return new BPromise(function(_0x574c61,_0x3d1f64){return db[_0x8422('0xa')][_0x8422('0xb')](_[_0x8422('0xc')](_0x64ce41,{'raw':!![],'where':{'id':0x1}}))[_0x8422('0xd')](function(_0x1f2878){return checkLicense(_0x1f2878,null);})[_0x8422('0xd')](function(_0x445148){_0x574c61(_0x445148);return;})[_0x8422('0xe')](function(_0xceacfe){_0x3d1f64(_0xceacfe);});});}function checkLicense(_0x4e520f,_0x280e42){if(!_0x4e520f){demoLicense[_0x8422('0xf')]=_0x4e520f[_0x8422('0x10')];return demoLicense;}try{var _0x25077b=_0x280e42||_0x4e520f[_0x8422('0x11')];if(_[_0x8422('0x12')](_0x25077b)){throw new Error(_0x8422('0x13'));}var _0x41988b=_0x4e520f['data1'];var _0x110106=_0x4e520f[_0x8422('0x14')];var _0x13c762=_0x41988b[_0x8422('0x15')]('-')[0x4];var _0x2d8c01=_0x41988b[_0x8422('0x15')]('-')[0x0];var _0x43fbaf=encryptor[_0x8422('0x16')](_0x25077b,util['format'](_0x8422('0x17'),_0x13c762,_0x41988b,_0x2d8c01));var _0x3a13db=JSON[_0x8422('0x18')](_0x43fbaf);_0x3a13db[_0x8422('0x19')]=![];_0x3a13db['uuid']=_0x41988b;_0x3a13db['machineUuid']=hardware[_0x8422('0x8')]();if(_0x110106){var _0x2dccdd=encryptor[_0x8422('0x16')](_0x110106);_0x3a13db[_0x8422('0x1a')]=_0x2dccdd;_0x3a13db[_0x8422('0x1b')]=moment(_0x2dccdd)['add'](0x7,_0x8422('0x1c'))[_0x8422('0x1d')]();_0x3a13db[_0x8422('0x1e')]=_0x3a13db['uuid']!=_0x3a13db[_0x8422('0x1f')]?_0x8422('0x20'):'disabled';}return _0x3a13db;}catch(_0x48eb90){breakingLicense[_0x8422('0xf')]=_0x4e520f[_0x8422('0x10')];breakingLicense[_0x8422('0x21')]=_0x48eb90[_0x8422('0x21')];return breakingLicense;}}function getLimits(){return new BPromise(function(_0x31cc15,_0x32e871){getLicense()[_0x8422('0xd')](function(_0x5d7841){return db['User'][_0x8422('0x22')]({'attributes':[_0x8422('0x23'),[db[_0x8422('0x24')]['fn']('COUNT',db[_0x8422('0x24')]['col']('role')),_0x8422('0x25')]],'group':_0x8422('0x23'),'where':{'role':{'$or':[_0x8422('0x26'),'user','telephone']}},'raw':!![]})[_0x8422('0xd')](function(_0x47b9cc){var _0x26f8b1={'user':_0x5d7841[_0x8422('0x27')]||0x0,'telephone':_0x5d7841[_0x8422('0x28')]||0x0};_0x47b9cc[_0x8422('0x29')](function(_0x2239e8){var _0x2365ad=_0x2239e8[_0x8422('0x23')]===_0x8422('0x26')?_0x8422('0x2a'):_0x2239e8[_0x8422('0x23')];_0x26f8b1[_0x2365ad]-=_0x2239e8[_0x8422('0x25')];if(_0x26f8b1[_0x2365ad]<0x0)_0x26f8b1[_0x2365ad]=0x0;});_0x31cc15(_0x26f8b1);return;});})[_0x8422('0xe')](function(_0x548406){_0x32e871(_0x548406);});});}function checkUserLimits(_0x3f7f98){return new BPromise(function(_0x1c4529,_0x38e80f){getLimits()[_0x8422('0xd')](function(_0x5ce58d){var _0x2a7cea=_[_0x8422('0x2b')](_['countBy'](_0x3f7f98,_0x8422('0x23')),[_0x8422('0x26'),_0x8422('0x2a'),_0x8422('0x2c')]);var _0x3b610e=(_0x2a7cea[_0x8422('0x26')]||0x0)+(_0x2a7cea[_0x8422('0x2a')]||0x0);var _0x45ad61=_0x2a7cea['telephone']||0x0;if(_0x3b610e>_0x5ce58d[_0x8422('0x2a')])return _0x38e80f(_0x8422('0x2d'));if(_0x45ad61>_0x5ce58d[_0x8422('0x2c')])return _0x38e80f('License\x20limit\x20reached\x20for\x20telephones');return _0x1c4529();})[_0x8422('0xe')](function(_0x1933b4){_0x38e80f(_0x1933b4);});});}module[_0x8422('0x2e')]={'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 70dd66d..be16d05 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 _0xb9be=['app-id','secret','exports','http://localhost:9000','myappanuglar-secret'];(function(_0x3a6167,_0x2aa09f){var _0x31fb82=function(_0x2701a7){while(--_0x2701a7){_0x3a6167['push'](_0x3a6167['shift']());}};_0x31fb82(++_0x2aa09f);}(_0xb9be,0xc5));var _0xeb9b=function(_0x16e57d,_0x2cb7ba){_0x16e57d=_0x16e57d-0x0;var _0x40239c=_0xb9be[_0x16e57d];return _0x40239c;};'use strict';module[_0xeb9b('0x0')]={'DOMAIN':_0xeb9b('0x1'),'SESSION_SECRET':_0xeb9b('0x2'),'GOOGLE_ID':_0xeb9b('0x3'),'GOOGLE_SECRET':_0xeb9b('0x4'),'DEBUG':''}; \ No newline at end of file +var _0xda2d=['app-id','secret','http://localhost:9000','myappanuglar-secret'];(function(_0x4b2342,_0x5cff6c){var _0x253e7b=function(_0x4cf5a2){while(--_0x4cf5a2){_0x4b2342['push'](_0x4b2342['shift']());}};_0x253e7b(++_0x5cff6c);}(_0xda2d,0x102));var _0xdda2=function(_0x4a4799,_0x562f84){_0x4a4799=_0x4a4799-0x0;var _0x28838b=_0xda2d[_0x4a4799];return _0x28838b;};'use strict';module['exports']={'DOMAIN':_0xdda2('0x0'),'SESSION_SECRET':_0xdda2('0x1'),'GOOGLE_ID':_0xdda2('0x2'),'GOOGLE_SECRET':_0xdda2('0x3'),'DEBUG':''}; \ No newline at end of file diff --git a/server/config/logger.js b/server/config/logger.js index 43b3671..d687c62 100644 --- a/server/config/logger.js +++ b/server/config/logger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe106=['[%s]\x20[%s]\x20%s\x20-\x20%s','YYYY-MM-DD\x20HH:mm:ss','toUpperCase','Logger','transports','File','%s-%s','error','info','Console','env','debugLevel','moment','util','INFO','join','/var','log','xcally','format','message','replace','{{{','}}}'];(function(_0x7d6d5a,_0x54f0c4){var _0x2d2f64=function(_0x5e04a1){while(--_0x5e04a1){_0x7d6d5a['push'](_0x7d6d5a['shift']());}};_0x2d2f64(++_0x54f0c4);}(_0xe106,0x15c));var _0x6e10=function(_0x27ccb6,_0x103913){_0x27ccb6=_0x27ccb6-0x0;var _0x412043=_0xe106[_0x27ccb6];return _0x412043;};'use strict';var moment=require(_0x6e10('0x0'));var winston=require('winston');var util=require(_0x6e10('0x1'));var path=require('path');var debugLevel=_0x6e10('0x2');function filename(_0x193861,_0x163c8b){return path[_0x6e10('0x3')](_0x6e10('0x4'),_0x6e10('0x5'),_0x6e10('0x6'),util[_0x6e10('0x7')]('%s-%s.log',_0x193861,_0x163c8b));}function formatter(_0x2c7132,_0x42f9ce){_0x42f9ce['message']=_0x42f9ce[_0x6e10('0x8')][_0x6e10('0x9')](/@@{/g,_0x6e10('0xa'))[_0x6e10('0x9')](/}@@/g,_0x6e10('0xb'))[_0x6e10('0x9')](/@{/g,'{{')[_0x6e10('0x9')](/}@/g,'}}');return util[_0x6e10('0x7')](_0x6e10('0xc'),moment()[_0x6e10('0x7')](_0x6e10('0xd')),_0x42f9ce['level'][_0x6e10('0xe')](),_0x2c7132,_0x42f9ce[_0x6e10('0x8')]);}module['exports']=function(_0x241f21){return new winston[(_0x6e10('0xf'))]({'transports':[new winston[(_0x6e10('0x10'))][(_0x6e10('0x11'))]({'name':util['format'](_0x6e10('0x12'),_0x241f21,_0x6e10('0x13')),'filename':filename(_0x241f21,_0x6e10('0x13')),'level':_0x6e10('0x13'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0xce4aa5){return formatter(_0x241f21,_0xce4aa5);}}),new winston[(_0x6e10('0x10'))][(_0x6e10('0x11'))]({'name':util['format'](_0x6e10('0x12'),_0x241f21,_0x6e10('0x14')),'filename':filename(_0x241f21,_0x6e10('0x14')),'level':_0x6e10('0x14'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x1c98db){return formatter(_0x241f21,_0x1c98db);}}),new winston[(_0x6e10('0x10'))][(_0x6e10('0x15'))]({'level':process[_0x6e10('0x16')][_0x6e10('0x17')]||debugLevel,'json':![],'formatter':function(_0x318456){return formatter(_0x241f21,_0x318456);}})]});}; \ No newline at end of file +var _0x43ba=['}}}','[%s]\x20[%s]\x20%s\x20-\x20%s','YYYY-MM-DD\x20HH:mm:ss','exports','File','%s-%s','error','transports','info','Console','env','debugLevel','moment','winston','util','path','INFO','join','/var','log','xcally','format','message','{{{'];(function(_0x285ab3,_0x2d9de7){var _0x5a7b64=function(_0xd3f49c){while(--_0xd3f49c){_0x285ab3['push'](_0x285ab3['shift']());}};_0x5a7b64(++_0x2d9de7);}(_0x43ba,0x114));var _0xa43b=function(_0x3d7e29,_0x4b19b9){_0x3d7e29=_0x3d7e29-0x0;var _0x480345=_0x43ba[_0x3d7e29];return _0x480345;};'use strict';var moment=require(_0xa43b('0x0'));var winston=require(_0xa43b('0x1'));var util=require(_0xa43b('0x2'));var path=require(_0xa43b('0x3'));var debugLevel=_0xa43b('0x4');function filename(_0x277119,_0x5aeecf){return path[_0xa43b('0x5')](_0xa43b('0x6'),_0xa43b('0x7'),_0xa43b('0x8'),util[_0xa43b('0x9')]('%s-%s.log',_0x277119,_0x5aeecf));}function formatter(_0x1f2ec4,_0x7a6848){_0x7a6848['message']=_0x7a6848[_0xa43b('0xa')]['replace'](/@@{/g,_0xa43b('0xb'))['replace'](/}@@/g,_0xa43b('0xc'))['replace'](/@{/g,'{{')['replace'](/}@/g,'}}');return util[_0xa43b('0x9')](_0xa43b('0xd'),moment()[_0xa43b('0x9')](_0xa43b('0xe')),_0x7a6848['level']['toUpperCase'](),_0x1f2ec4,_0x7a6848[_0xa43b('0xa')]);}module[_0xa43b('0xf')]=function(_0x2a1cd9){return new winston['Logger']({'transports':[new winston['transports'][(_0xa43b('0x10'))]({'name':util['format'](_0xa43b('0x11'),_0x2a1cd9,_0xa43b('0x12')),'filename':filename(_0x2a1cd9,'error'),'level':_0xa43b('0x12'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x2e4f68){return formatter(_0x2a1cd9,_0x2e4f68);}}),new winston[(_0xa43b('0x13'))]['File']({'name':util[_0xa43b('0x9')](_0xa43b('0x11'),_0x2a1cd9,_0xa43b('0x14')),'filename':filename(_0x2a1cd9,_0xa43b('0x14')),'level':_0xa43b('0x14'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x58b80a){return formatter(_0x2a1cd9,_0x58b80a);}}),new winston[(_0xa43b('0x13'))][(_0xa43b('0x15'))]({'level':process[_0xa43b('0x16')][_0xa43b('0x17')]||debugLevel,'json':![],'formatter':function(_0x106f5b){return formatter(_0x2a1cd9,_0x106f5b);}})]});}; \ No newline at end of file diff --git a/server/config/pm2/config.js b/server/config/pm2/config.js index 5b51c04..81b81a5 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 _0x5063=['email','../../services/email/index.js','routing','../../services/routing/index.js','xdr','path','express','ami','join','../../services/ami/index.js','agi','../../services/agi/index.js'];(function(_0x43ba50,_0x4cfa7e){var _0x1ad110=function(_0x13dfb7){while(--_0x13dfb7){_0x43ba50['push'](_0x43ba50['shift']());}};_0x1ad110(++_0x4cfa7e);}(_0x5063,0xa1));var _0x3506=function(_0x1766a9,_0x269ab5){_0x1766a9=_0x1766a9-0x0;var _0x1388ab=_0x5063[_0x1766a9];return _0x1388ab;};'use strict';var path=require(_0x3506('0x0'));var os=require('os');var config={'apps':[{'name':_0x3506('0x1'),'script':path['join'](__dirname,'../../services/express/index.js')},{'name':_0x3506('0x2'),'script':path[_0x3506('0x3')](__dirname,_0x3506('0x4'))},{'name':_0x3506('0x5'),'script':path[_0x3506('0x3')](__dirname,_0x3506('0x6'))},{'name':_0x3506('0x7'),'script':path[_0x3506('0x3')](__dirname,_0x3506('0x8'))},{'name':_0x3506('0x9'),'script':path['join'](__dirname,_0x3506('0xa'))},{'name':_0x3506('0xb'),'script':path[_0x3506('0x3')](__dirname,'../../services/xdr/index.js')}]};module['exports']=config; \ No newline at end of file +var _0xa99f=['email','routing','../../services/routing/index.js','xdr','../../services/xdr/index.js','path','join','../../services/express/index.js','ami','../../services/ami/index.js','agi'];(function(_0x28cdcb,_0x51045f){var _0x1fa8ef=function(_0x4fd2d1){while(--_0x4fd2d1){_0x28cdcb['push'](_0x28cdcb['shift']());}};_0x1fa8ef(++_0x51045f);}(_0xa99f,0x10d));var _0xfa99=function(_0x49eec0,_0x28c301){_0x49eec0=_0x49eec0-0x0;var _0x41cd87=_0xa99f[_0x49eec0];return _0x41cd87;};'use strict';var path=require(_0xfa99('0x0'));var os=require('os');var config={'apps':[{'name':'express','script':path[_0xfa99('0x1')](__dirname,_0xfa99('0x2'))},{'name':_0xfa99('0x3'),'script':path[_0xfa99('0x1')](__dirname,_0xfa99('0x4'))},{'name':_0xfa99('0x5'),'script':path[_0xfa99('0x1')](__dirname,'../../services/agi/index.js')},{'name':_0xfa99('0x6'),'script':path['join'](__dirname,'../../services/email/index.js')},{'name':_0xfa99('0x7'),'script':path[_0xfa99('0x1')](__dirname,_0xfa99('0x8'))},{'name':_0xfa99('0x9'),'script':path[_0xfa99('0x1')](__dirname,_0xfa99('0xa'))}]};module['exports']=config; \ No newline at end of file diff --git a/server/config/pm2/index.js b/server/config/pm2/index.js index 60a188c..9752df0 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 _0x98c2=['./config','connect','connected','start','then','disconnect','stop','restart','list','describe','delete','dump','saved','pm2'];(function(_0x5c1932,_0x5b1a24){var _0x2e8728=function(_0x495742){while(--_0x495742){_0x5c1932['push'](_0x5c1932['shift']());}};_0x2e8728(++_0x5b1a24);}(_0x98c2,0x8b));var _0x298c=function(_0x297fd3,_0x115406){_0x297fd3=_0x297fd3-0x0;var _0x2af381=_0x98c2[_0x297fd3];return _0x2af381;};'use strict';var pm2=require(_0x298c('0x0'));var BPromise=require('bluebird');var config=require(_0x298c('0x1'));function connect(){return new BPromise(function(_0x1b5ffc,_0x1f7e59){return pm2[_0x298c('0x2')](function(_0x43493e){if(_0x43493e){return _0x1f7e59(_0x43493e);}return _0x1b5ffc(_0x298c('0x3'));});});};exports[_0x298c('0x4')]=function(_0x4cdc42){return connect()[_0x298c('0x5')](function(){return new BPromise(function(_0x116b68,_0xf4d9ca){return pm2[_0x298c('0x4')](_0x4cdc42,function(_0x581b39,_0xb5d51a){if(_0x581b39){return _0xf4d9ca(_0x581b39);}pm2[_0x298c('0x6')]();return _0x116b68(_0xb5d51a);});});});};exports['stop']=function(_0x37714c){return connect()[_0x298c('0x5')](function(){return new BPromise(function(_0x376a5b,_0x6c8009){return pm2[_0x298c('0x7')](_0x37714c,function(_0x1f404c,_0x1a21b5){if(_0x1f404c){return _0x6c8009(_0x1f404c);}pm2['disconnect']();return _0x376a5b(_0x1a21b5);});});});};exports[_0x298c('0x8')]=function(_0x2d3edc){return connect()['then'](function(){return new BPromise(function(_0x15104b,_0x1b6e29){return pm2[_0x298c('0x8')](_0x2d3edc,function(_0x2a6c2e,_0x2b1504){if(_0x2a6c2e){return _0x1b6e29(_0x2a6c2e);}pm2['disconnect']();return _0x15104b(_0x2b1504);});});});};exports['list']=function(){return connect()['then'](function(){return new BPromise(function(_0x367c60,_0x3262da){return pm2[_0x298c('0x9')](function(_0x52c698,_0x258250){if(_0x52c698){return _0x3262da(_0x52c698);}pm2[_0x298c('0x6')]();return _0x367c60(_0x258250);});});});};exports[_0x298c('0xa')]=function(_0x262ae4){return connect()[_0x298c('0x5')](function(){return new BPromise(function(_0xbab029,_0x1f4b65){return pm2['describe'](_0x262ae4,function(_0x1221e4,_0x535719){if(_0x1221e4){return _0x1f4b65(_0x1221e4);}pm2[_0x298c('0x6')]();return _0xbab029(_0x535719);});});});};exports[_0x298c('0xb')]=function(_0x1c44f3){return connect()[_0x298c('0x5')](function(){return new BPromise(function(_0x2ad8d0,_0x476a20){return pm2[_0x298c('0xb')](_0x1c44f3,function(_0x16b7af,_0xdeeb91){if(_0x16b7af){return _0x476a20(_0x16b7af);}pm2[_0x298c('0x6')]();return _0x2ad8d0(_0xdeeb91);});});});};exports[_0x298c('0xc')]=function(){return connect()[_0x298c('0x5')](function(){return new BPromise(function(_0x53038d,_0x29483a){return pm2['dump'](function(_0x4b1345){if(_0x4b1345){return _0x29483a(_0x4b1345);}return _0x53038d(_0x298c('0xd'));});});});}; \ No newline at end of file +var _0x4618=['restart','list','describe','delete','dump','saved','pm2','bluebird','./config','connect','connected','then','disconnect','stop'];(function(_0x229f8d,_0x48402c){var _0x3e193c=function(_0x58009d){while(--_0x58009d){_0x229f8d['push'](_0x229f8d['shift']());}};_0x3e193c(++_0x48402c);}(_0x4618,0xd8));var _0x8461=function(_0xc0a3d3,_0x2c8d00){_0xc0a3d3=_0xc0a3d3-0x0;var _0x3386e8=_0x4618[_0xc0a3d3];return _0x3386e8;};'use strict';var pm2=require(_0x8461('0x0'));var BPromise=require(_0x8461('0x1'));var config=require(_0x8461('0x2'));function connect(){return new BPromise(function(_0x54ecca,_0x2b5952){return pm2[_0x8461('0x3')](function(_0x5edaca){if(_0x5edaca){return _0x2b5952(_0x5edaca);}return _0x54ecca(_0x8461('0x4'));});});};exports['start']=function(_0x52dc00){return connect()[_0x8461('0x5')](function(){return new BPromise(function(_0x5a0c3b,_0x931f1c){return pm2['start'](_0x52dc00,function(_0x452572,_0x4987f3){if(_0x452572){return _0x931f1c(_0x452572);}pm2[_0x8461('0x6')]();return _0x5a0c3b(_0x4987f3);});});});};exports['stop']=function(_0x234319){return connect()[_0x8461('0x5')](function(){return new BPromise(function(_0x57d55d,_0xedd546){return pm2[_0x8461('0x7')](_0x234319,function(_0x4e805c,_0x25b706){if(_0x4e805c){return _0xedd546(_0x4e805c);}pm2[_0x8461('0x6')]();return _0x57d55d(_0x25b706);});});});};exports[_0x8461('0x8')]=function(_0x5217ab){return connect()[_0x8461('0x5')](function(){return new BPromise(function(_0x485c8c,_0x76573a){return pm2['restart'](_0x5217ab,function(_0x3e204a,_0x56a06d){if(_0x3e204a){return _0x76573a(_0x3e204a);}pm2[_0x8461('0x6')]();return _0x485c8c(_0x56a06d);});});});};exports[_0x8461('0x9')]=function(){return connect()['then'](function(){return new BPromise(function(_0x183ad5,_0x43d627){return pm2[_0x8461('0x9')](function(_0x5bd288,_0x351587){if(_0x5bd288){return _0x43d627(_0x5bd288);}pm2[_0x8461('0x6')]();return _0x183ad5(_0x351587);});});});};exports['describe']=function(_0x51dcb3){return connect()['then'](function(){return new BPromise(function(_0x5e2159,_0xda6d72){return pm2[_0x8461('0xa')](_0x51dcb3,function(_0x49545b,_0x1d1eb5){if(_0x49545b){return _0xda6d72(_0x49545b);}pm2[_0x8461('0x6')]();return _0x5e2159(_0x1d1eb5);});});});};exports[_0x8461('0xb')]=function(_0x4aeae0){return connect()[_0x8461('0x5')](function(){return new BPromise(function(_0x458683,_0x466240){return pm2[_0x8461('0xb')](_0x4aeae0,function(_0x12c10a,_0x1708cc){if(_0x12c10a){return _0x466240(_0x12c10a);}pm2['disconnect']();return _0x458683(_0x1708cc);});});});};exports[_0x8461('0xc')]=function(){return connect()['then'](function(){return new BPromise(function(_0x4c003f,_0x2b15e4){return pm2[_0x8461('0xc')](function(_0x259af5){if(_0x259af5){return _0x2b15e4(_0x259af5);}return _0x4c003f(_0x8461('0xd'));});});});}; \ No newline at end of file diff --git a/server/config/schedule/chat.js b/server/config/schedule/chat.js index 18b6eac..80b6f32 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 _0x72ce=['Setting','find','chatTimeout','then','findAll','lastMsgAt','subtract','minutes','length','map','[CHAT]\x20Interactions\x20to\x20close:','ChatInteraction','update','system','timeout','YYYY-MM-DD\x20HH:mm:ss','info','[CHAT]\x20Sending\x20updates\x20for\x20interactions:','join','emit','chatInteraction:update','catch','[CHAT]\x20Error\x20closing\x20interactions','start','lodash','util','../../config/environment','../logger','schedule','redis','defaults','localhost','socket.io-emitter'];(function(_0xa9dd88,_0x358002){var _0x33678d=function(_0x13b817){while(--_0x13b817){_0xa9dd88['push'](_0xa9dd88['shift']());}};_0x33678d(++_0x358002);}(_0x72ce,0xde));var _0xe72c=function(_0x5acda8,_0xcd0365){_0x5acda8=_0x5acda8-0x0;var _0x5a4439=_0x72ce[_0x5acda8];return _0x5a4439;};'use strict';var _=require(_0xe72c('0x0'));var moment=require('moment');var Redis=require('ioredis');var util=require(_0xe72c('0x1'));var config=require(_0xe72c('0x2'));var db=require('../../mysqldb')['db'];var logger=require(_0xe72c('0x3'))(_0xe72c('0x4'));config[_0xe72c('0x5')]=_[_0xe72c('0x6')](config[_0xe72c('0x5')],{'host':_0xe72c('0x7'),'port':0x18eb});var io=require(_0xe72c('0x8'))(new Redis(config[_0xe72c('0x5')]));function closeInteractions(){var _0x530157=0x0;var _0x3cd36a=[];return db[_0xe72c('0x9')][_0xe72c('0xa')]({'raw':!![],'attributes':['id',_0xe72c('0xb')],'where':{'id':0x1}})[_0xe72c('0xc')](function(_0x40f74a){_0x530157=_0x40f74a[_0xe72c('0xb')];if(_0x530157){return db['ChatInteraction'][_0xe72c('0xd')]({'raw':!![],'attributes':['id',_0xe72c('0xe')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()[_0xe72c('0xf')](_0x40f74a[_0xe72c('0xb')],_0xe72c('0x10'))}}});}else{return[];}})[_0xe72c('0xc')](function(_0x89416){if(_0x89416&&_0x89416[_0xe72c('0x11')]){_0x3cd36a=_[_0xe72c('0x12')](_0x89416||[],'id');logger['info'](_0xe72c('0x13'),_0x3cd36a['join']());return db[_0xe72c('0x14')][_0xe72c('0x15')]({'closeReason':_0xe72c('0x16'),'disposition':_0xe72c('0x17'),'closed':!![],'closedAt':moment()['format'](_0xe72c('0x18'))},{'where':{'id':_0x3cd36a}});}})[_0xe72c('0xc')](function(){if(_0x3cd36a&&_0x3cd36a[_0xe72c('0x11')]){logger[_0xe72c('0x19')](_0xe72c('0x1a'),_0x3cd36a[_0xe72c('0x1b')]());for(var _0x8f38a3=0x0;_0x8f38a3<_0x3cd36a['length'];_0x8f38a3++){io[_0xe72c('0x1c')](_0xe72c('0x1d'),{'id':_0x3cd36a[_0x8f38a3],'closed':!![]});}}})[_0xe72c('0x1e')](function(_0x1aa097){logger['error'](_0xe72c('0x1f'),_0x1aa097?util['inspect'](_0x1aa097,{'showHidden':![],'depth':null}):'');});}exports[_0xe72c('0x20')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0x9dd9=['chatTimeout','then','ChatInteraction','findAll','lastMsgAt','subtract','length','map','info','[CHAT]\x20Interactions\x20to\x20close:','join','update','system','YYYY-MM-DD\x20HH:mm:ss','chatInteraction:update','catch','[CHAT]\x20Error\x20closing\x20interactions','inspect','lodash','moment','util','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','Setting'];(function(_0x17202c,_0x3977ae){var _0x120c7f=function(_0xcc1552){while(--_0xcc1552){_0x17202c['push'](_0x17202c['shift']());}};_0x120c7f(++_0x3977ae);}(_0x9dd9,0x171));var _0x99dd=function(_0x4e95f9,_0x3fa5b0){_0x4e95f9=_0x4e95f9-0x0;var _0xc65bc8=_0x9dd9[_0x4e95f9];return _0xc65bc8;};'use strict';var _=require(_0x99dd('0x0'));var moment=require(_0x99dd('0x1'));var Redis=require('ioredis');var util=require(_0x99dd('0x2'));var config=require(_0x99dd('0x3'));var db=require(_0x99dd('0x4'))['db'];var logger=require('../logger')('schedule');config[_0x99dd('0x5')]=_[_0x99dd('0x6')](config[_0x99dd('0x5')],{'host':'localhost','port':0x18eb});var io=require(_0x99dd('0x7'))(new Redis(config['redis']));function closeInteractions(){var _0x23fadd=0x0;var _0x25ffb3=[];return db[_0x99dd('0x8')]['find']({'raw':!![],'attributes':['id',_0x99dd('0x9')],'where':{'id':0x1}})[_0x99dd('0xa')](function(_0x1ab5f4){_0x23fadd=_0x1ab5f4[_0x99dd('0x9')];if(_0x23fadd){return db[_0x99dd('0xb')][_0x99dd('0xc')]({'raw':!![],'attributes':['id',_0x99dd('0xd')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()[_0x99dd('0xe')](_0x1ab5f4[_0x99dd('0x9')],'minutes')}}});}else{return[];}})['then'](function(_0x3bc27d){if(_0x3bc27d&&_0x3bc27d[_0x99dd('0xf')]){_0x25ffb3=_[_0x99dd('0x10')](_0x3bc27d||[],'id');logger[_0x99dd('0x11')](_0x99dd('0x12'),_0x25ffb3[_0x99dd('0x13')]());return db[_0x99dd('0xb')][_0x99dd('0x14')]({'closeReason':_0x99dd('0x15'),'disposition':'timeout','closed':!![],'closedAt':moment()['format'](_0x99dd('0x16'))},{'where':{'id':_0x25ffb3}});}})[_0x99dd('0xa')](function(){if(_0x25ffb3&&_0x25ffb3[_0x99dd('0xf')]){logger[_0x99dd('0x11')]('[CHAT]\x20Sending\x20updates\x20for\x20interactions:',_0x25ffb3['join']());for(var _0x4453c3=0x0;_0x4453c3<_0x25ffb3[_0x99dd('0xf')];_0x4453c3++){io['emit'](_0x99dd('0x17'),{'id':_0x25ffb3[_0x4453c3],'closed':!![]});}}})[_0x99dd('0x18')](function(_0xf3c056){logger['error'](_0x99dd('0x19'),_0xf3c056?util[_0x99dd('0x1a')](_0xf3c056,{'showHidden':![],'depth':null}):'');});}exports['start']=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file diff --git a/server/config/schedule/index.js b/server/config/schedule/index.js index 548ba5d..ad3f6b6 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 _0x5da0=['output','exec\x20defaul\x20report\x20id:%s','DefaultReportId','CustomReportId','exec\x20custom\x20report\x20id:%s','runReport','no\x20report\x20id','Schedule','findAll','MailServerOut','keys','map','keyBy','difference','intersection','toString','exists','stop','deleteJob','toRun','length','index','my\x20id','resolve','run\x20job','cron','active','isBetween','startAt','add','start','add\x20cron','update','stop\x20cron','util','lodash','moment','cron-job-manager','jayson/promise','bluebird','../logger','schedule','../../mysqldb','../../api/analyticCustomReport/analyticCustomReport.controller','../../api/analyticDefaultReport/analyticDefaultReport.controller','client','http','Try\x20to\x20send\x20a\x20mail\x20to','email','MailAccount','Smtp','service','port','secure','user','pass','format','\x22%s\x22\x20<%s>','name','Report\x20%s\x20last\x20%s\x20%s','subtractUnit','join','../../files/reports','savename','%s.%s','basename','extname','existsSync','status','Sent','message','attachments','text','Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a','stringify','Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a','sendIfEmpty','info','then','error','catch','error\x20mail','data','isNil','subtractNumber','subtractUnit\x20null\x20or\x20undefined','subtract','YYYY-MM-DD\x20HH:mm:ss','scheduled'];(function(_0x4bcd6e,_0x59e227){var _0x515795=function(_0x106be6){while(--_0x106be6){_0x4bcd6e['push'](_0x4bcd6e['shift']());}};_0x515795(++_0x59e227);}(_0x5da0,0x186));var _0x05da=function(_0x572736,_0x1690c7){_0x572736=_0x572736-0x0;var _0x9912bd=_0x5da0[_0x572736];return _0x9912bd;};'use strict';var fs=require('fs');var util=require(_0x05da('0x0'));var path=require('path');var _=require(_0x05da('0x1'));var moment=require(_0x05da('0x2'));var CronJobManager=require(_0x05da('0x3'));var jayson=require(_0x05da('0x4'));var BPromise=require(_0x05da('0x5'));var logger=require(_0x05da('0x6'))(_0x05da('0x7'));var db=require(_0x05da('0x8'))['db'];var analyticCustomReportController=require(_0x05da('0x9'));var analyticDefaultReportController=require(_0x05da('0xa'));var client=jayson[_0x05da('0xb')][_0x05da('0xc')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x388201,_0xdf5255){return function(){logger['info'](_0x05da('0xd'),_0x388201[_0x05da('0xe')]);var _0x1c5c02=!![];var _0x825cab={'tls':{'rejectUnauthorized':![]}};if(_0x388201[_0x05da('0xf')][_0x05da('0x10')][_0x05da('0x11')]){_0x825cab[_0x05da('0x11')]=_0x388201[_0x05da('0xf')][_0x05da('0x10')][_0x05da('0x11')];}else{_0x825cab['host']=_0x388201[_0x05da('0xf')][_0x05da('0x10')]['host'];_0x825cab[_0x05da('0x12')]=_0x388201['MailAccount'][_0x05da('0x10')][_0x05da('0x12')];_0x825cab[_0x05da('0x13')]=_0x388201[_0x05da('0xf')]['Smtp'][_0x05da('0x13')];}if(_0x388201['MailAccount'][_0x05da('0x10')]['authentication']){_0x825cab['auth']={'user':_0x388201[_0x05da('0xf')]['Smtp'][_0x05da('0x14')],'pass':_0x388201[_0x05da('0xf')]['Smtp'][_0x05da('0x15')]};}var _0x21d60c={'account':_0x825cab,'message':{'from':util[_0x05da('0x16')](_0x05da('0x17'),_0x388201['MailAccount'][_0x05da('0x18')],_0x388201[_0x05da('0xf')]['email']||_0x388201[_0x05da('0xf')][_0x05da('0x10')][_0x05da('0x14')]),'to':_0x388201[_0x05da('0xe')],'cc':_0x388201['cc'],'bcc':_0x388201['bcc'],'subject':util[_0x05da('0x16')](_0x05da('0x19'),_0xdf5255[_0x05da('0x18')],_0x388201['subtractNumber'],_0x388201[_0x05da('0x1a')])}};var _0x49db01=path[_0x05da('0x1b')](__dirname,_0x05da('0x1c'));var _0x155274=_0xdf5255[_0x05da('0x1d')];var _0x5d6f17=util['format'](_0x05da('0x1e'),path[_0x05da('0x1f')](_0xdf5255[_0x05da('0x1d')],path[_0x05da('0x20')](_0xdf5255[_0x05da('0x1d')])),'zip');var _0x1a101d=path['join'](_0x49db01,_0x155274);var _0x3d1e5b=path[_0x05da('0x1b')](_0x49db01,_0x5d6f17);if(fs[_0x05da('0x21')](_0x1a101d)){_0xdf5255[_0x05da('0x22')]=_0x05da('0x23');_0x21d60c[_0x05da('0x24')][_0x05da('0x25')]=[{'filename':_0x155274,'path':_0x1a101d}];_0x21d60c[_0x05da('0x24')][_0x05da('0x26')]=util['format'](_0x05da('0x27'),JSON[_0x05da('0x28')](_0xdf5255,null,0x2));}else if(fs[_0x05da('0x21')](_0x3d1e5b)){_0xdf5255[_0x05da('0x22')]='Sent';_0x21d60c['message']['attachments']=[{'filename':_0x5d6f17,'path':_0x3d1e5b}];}else{_0x21d60c[_0x05da('0x24')][_0x05da('0x26')]=_0x05da('0x29');if(!_0x388201[_0x05da('0x2a')]){_0x1c5c02=![];logger[_0x05da('0x2b')]('empty\x20file,\x20email\x20not\x20sent');}}if(_0x1c5c02){return client['request']('SendMail',_0x21d60c)[_0x05da('0x2c')](function(_0x1298cd){if(_0x1298cd['error']){return logger[_0x05da('0x2d')]('error\x20mail',JSON[_0x05da('0x28')](_0x1298cd));}return logger[_0x05da('0x2b')]('email\x20sent');})[_0x05da('0x2e')](function(_0x5cd99a){return logger[_0x05da('0x2d')](_0x05da('0x2f'),JSON[_0x05da('0x28')](_0x5cd99a));});}};}function handleError(){return function(_0x1cfbc1){return logger[_0x05da('0x2d')](JSON[_0x05da('0x28')](_0x1cfbc1));};}function handleResult(_0x3c6808){return function(_0x42b64f){logger[_0x05da('0x2b')](_0x05da('0x30'),JSON[_0x05da('0x28')](_0x42b64f));if(_0x3c6808[_0x05da('0xf')]&&_0x3c6808[_0x05da('0xf')][_0x05da('0x10')]&&!_[_0x05da('0x31')](_0x3c6808[_0x05da('0xe')])){setTimeout(handleSendEmail(_0x3c6808,_0x42b64f),0x3c*0x3e8);}};}function handleJob(_0x5905ef){return function(){try{if(_['isNil'](_0x5905ef[_0x05da('0x32')])){return logger[_0x05da('0x2b')]('subtractNumber\x20null\x20or\x20undefined');}if(_[_0x05da('0x31')](_0x5905ef['subtractUnit'])){return logger[_0x05da('0x2b')](_0x05da('0x33'));}var _0x1b85cd={'startDate':moment()[_0x05da('0x34')](_0x5905ef['subtractNumber'],_0x5905ef['subtractUnit'])[_0x05da('0x16')](_0x05da('0x35')),'endDate':moment()[_0x05da('0x16')](_0x05da('0x35')),'type':_0x05da('0x36'),'output':_0x5905ef[_0x05da('0x37')],'name':_0x5905ef[_0x05da('0x18')]};if(!_[_0x05da('0x31')](_0x5905ef['DefaultReportId'])){logger[_0x05da('0x2b')](_0x05da('0x38'),_0x5905ef[_0x05da('0x39')]);return analyticDefaultReportController['runReport']({'id':_0x5905ef[_0x05da('0x39')]},_0x1b85cd)[_0x05da('0x2c')](handleResult(_0x5905ef))[_0x05da('0x2e')](handleError());}if(!_[_0x05da('0x31')](_0x5905ef[_0x05da('0x3a')])){logger[_0x05da('0x2b')](_0x05da('0x3b'),_0x5905ef[_0x05da('0x3a')]);return analyticCustomReportController[_0x05da('0x3c')]({'id':_0x5905ef[_0x05da('0x3a')]},_0x1b85cd)[_0x05da('0x2c')](handleResult(_0x5905ef))[_0x05da('0x2e')](handleError());}}catch(_0x507f38){logger[_0x05da('0x2d')](JSON[_0x05da('0x28')](_0x507f38));}return logger[_0x05da('0x2b')](_0x05da('0x3d'));};}function getJobs(_0x1b6578){var _0x3cb48c={};if(_0x1b6578){_0x3cb48c['id']=_0x1b6578;}return db[_0x05da('0x3e')][_0x05da('0x3f')]({'where':_0x3cb48c,'include':[{'model':db[_0x05da('0xf')],'attributes':['id',_0x05da('0x18'),_0x05da('0xe')],'include':[{'model':db[_0x05da('0x40')],'as':_0x05da('0x10')}]}]})[_0x05da('0x2c')](function(_0x601b62){var _0x5c0d3c=_[_0x05da('0x41')](manager['jobs']);var _0x1a8f07=_[_0x05da('0x42')](_0x601b62,function(_0x2fa874){return _0x2fa874['id']['toString']();});var _0x4a6468=_[_0x05da('0x43')](_0x601b62,function(_0x4c078b){return _0x4c078b['id']['toString']();});var _0x2ef5e9=_0x1b6578?_0x1a8f07:_[_0x05da('0x44')](_0x1a8f07,_0x5c0d3c);var _0x284caa=_[_0x05da('0x45')](_0x1a8f07,_0x5c0d3c);var _0x530eb5=_[_0x05da('0x44')](_0x5c0d3c,_0x1a8f07);var _0x176c9d;var _0x22a663;for(_0x176c9d=0x0;_0x176c9d<_0x530eb5['length']&&!_0x1b6578;_0x176c9d+=0x1){_0x22a663=_0x530eb5[_0x176c9d][_0x05da('0x46')]();if(manager[_0x05da('0x47')](_0x22a663)){manager[_0x05da('0x48')](_0x22a663);manager[_0x05da('0x49')](_0x22a663);logger[_0x05da('0x2b')]('delete\x20cron',_0x22a663);}}logger[_0x05da('0x2b')](_0x05da('0x4a'),JSON['stringify'](_0x2ef5e9));for(_0x176c9d=0x0;_0x176c9d<_0x2ef5e9[_0x05da('0x4b')];_0x176c9d+=0x1){_0x22a663=_0x2ef5e9[_0x176c9d][_0x05da('0x46')]();logger['info'](_0x05da('0x4c'),_0x22a663);if(_0x1b6578){logger['info'](_0x05da('0x4d'),_0x1b6578);logger[_0x05da('0x2b')](JSON[_0x05da('0x28')](_0x4a6468[_0x22a663]));BPromise[_0x05da('0x4e')]()['then'](handleJob(_0x4a6468[_0x22a663]));logger['info'](_0x05da('0x4f'),_0x4a6468[_0x22a663][_0x05da('0x18')],_0x4a6468[_0x22a663][_0x05da('0x50')]);}else if(_0x4a6468[_0x22a663]['cron']&&_0x4a6468[_0x22a663][_0x05da('0x51')]&&moment()[_0x05da('0x52')](_0x4a6468[_0x22a663][_0x05da('0x53')],_0x4a6468[_0x22a663]['endAt'])){manager[_0x05da('0x54')](_0x22a663,_0x4a6468[_0x22a663]['cron'],handleJob(_0x4a6468[_0x22a663]));manager[_0x05da('0x55')](_0x22a663);logger[_0x05da('0x2b')](_0x05da('0x56'),_0x4a6468[_0x22a663]['name'],_0x4a6468[_0x22a663]['cron']);}else if(manager[_0x05da('0x47')](_0x22a663)){manager[_0x05da('0x48')](_0x22a663);manager['deleteJob'](_0x22a663);logger[_0x05da('0x2b')]('stop\x20cron',_0x4a6468[_0x22a663][_0x05da('0x18')],_0x4a6468[_0x22a663][_0x05da('0x50')]);}}for(_0x176c9d=0x0,_0x22a663;_0x176c9d<_0x284caa['length']&&!_0x1b6578;_0x176c9d+=0x1){_0x22a663=_0x284caa[_0x176c9d][_0x05da('0x46')]();if(manager[_0x05da('0x47')](_0x22a663)){if(_0x4a6468[_0x22a663][_0x05da('0x50')]&&_0x4a6468[_0x22a663][_0x05da('0x51')]&&moment()['isBetween'](_0x4a6468[_0x22a663]['startAt'],_0x4a6468[_0x22a663]['endAt'])){manager[_0x05da('0x57')](_0x22a663,_0x4a6468[_0x22a663][_0x05da('0x50')],handleJob(_0x4a6468[_0x22a663]));logger[_0x05da('0x2b')]('update\x20cron',_0x4a6468[_0x22a663][_0x05da('0x18')],_0x4a6468[_0x22a663][_0x05da('0x50')]);}else{manager['stop'](_0x22a663);manager[_0x05da('0x49')](_0x22a663);logger[_0x05da('0x2b')](_0x05da('0x58'),_0x4a6468[_0x22a663]['name'],_0x4a6468[_0x22a663][_0x05da('0x50')]);}}}})[_0x05da('0x2e')](function(_0x2ea669){logger[_0x05da('0x2d')](JSON[_0x05da('0x28')](_0x2ea669));});}exports['run']=function(_0x16cad5){return getJobs(_0x16cad5);};exports['start']=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();}; \ No newline at end of file +var _0x1bce=['findAll','MailServerOut','keys','map','toString','difference','intersection','length','exists','deleteJob','delete\x20cron','toRun','index','my\x20id','run\x20job','cron','active','isBetween','startAt','add','start','add\x20cron','endAt','stop','stop\x20cron','run','util','path','lodash','moment','cron-job-manager','jayson/promise','bluebird','schedule','../../mysqldb','../../api/analyticCustomReport/analyticCustomReport.controller','client','info','Try\x20to\x20send\x20a\x20mail\x20to','email','MailAccount','Smtp','service','host','port','secure','authentication','auth','user','pass','format','\x22%s\x22\x20<%s>','name','subtractNumber','../../files/reports','savename','%s.%s','zip','join','existsSync','Sent','message','text','Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a','stringify','status','attachments','Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a','request','error','error\x20mail','email\x20sent','catch','data','isNil','subtractNumber\x20null\x20or\x20undefined','subtract','YYYY-MM-DD\x20HH:mm:ss','scheduled','output','DefaultReportId','exec\x20defaul\x20report\x20id:%s','runReport','then','CustomReportId','exec\x20custom\x20report\x20id:%s','no\x20report\x20id','Schedule'];(function(_0x31043d,_0x1609f3){var _0x3eb512=function(_0x53d9bc){while(--_0x53d9bc){_0x31043d['push'](_0x31043d['shift']());}};_0x3eb512(++_0x1609f3);}(_0x1bce,0x1d2));var _0xe1bc=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x1bce[_0x2641f9];return _0x585741;};'use strict';var fs=require('fs');var util=require(_0xe1bc('0x0'));var path=require(_0xe1bc('0x1'));var _=require(_0xe1bc('0x2'));var moment=require(_0xe1bc('0x3'));var CronJobManager=require(_0xe1bc('0x4'));var jayson=require(_0xe1bc('0x5'));var BPromise=require(_0xe1bc('0x6'));var logger=require('../logger')(_0xe1bc('0x7'));var db=require(_0xe1bc('0x8'))['db'];var analyticCustomReportController=require(_0xe1bc('0x9'));var analyticDefaultReportController=require('../../api/analyticDefaultReport/analyticDefaultReport.controller');var client=jayson[_0xe1bc('0xa')]['http']({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x30ee13,_0x120a00){return function(){logger[_0xe1bc('0xb')](_0xe1bc('0xc'),_0x30ee13[_0xe1bc('0xd')]);var _0xeaa117=!![];var _0x1e166f={'tls':{'rejectUnauthorized':![]}};if(_0x30ee13[_0xe1bc('0xe')][_0xe1bc('0xf')][_0xe1bc('0x10')]){_0x1e166f['service']=_0x30ee13[_0xe1bc('0xe')][_0xe1bc('0xf')][_0xe1bc('0x10')];}else{_0x1e166f[_0xe1bc('0x11')]=_0x30ee13[_0xe1bc('0xe')]['Smtp']['host'];_0x1e166f[_0xe1bc('0x12')]=_0x30ee13[_0xe1bc('0xe')][_0xe1bc('0xf')][_0xe1bc('0x12')];_0x1e166f[_0xe1bc('0x13')]=_0x30ee13[_0xe1bc('0xe')]['Smtp'][_0xe1bc('0x13')];}if(_0x30ee13['MailAccount'][_0xe1bc('0xf')][_0xe1bc('0x14')]){_0x1e166f[_0xe1bc('0x15')]={'user':_0x30ee13['MailAccount'][_0xe1bc('0xf')][_0xe1bc('0x16')],'pass':_0x30ee13[_0xe1bc('0xe')]['Smtp'][_0xe1bc('0x17')]};}var _0x4118f0={'account':_0x1e166f,'message':{'from':util[_0xe1bc('0x18')](_0xe1bc('0x19'),_0x30ee13[_0xe1bc('0xe')][_0xe1bc('0x1a')],_0x30ee13[_0xe1bc('0xe')][_0xe1bc('0xd')]||_0x30ee13[_0xe1bc('0xe')]['Smtp'][_0xe1bc('0x16')]),'to':_0x30ee13[_0xe1bc('0xd')],'cc':_0x30ee13['cc'],'bcc':_0x30ee13['bcc'],'subject':util[_0xe1bc('0x18')]('Report\x20%s\x20last\x20%s\x20%s',_0x120a00[_0xe1bc('0x1a')],_0x30ee13[_0xe1bc('0x1b')],_0x30ee13['subtractUnit'])}};var _0x4e74eb=path['join'](__dirname,_0xe1bc('0x1c'));var _0x3ff4ea=_0x120a00[_0xe1bc('0x1d')];var _0x1efbfb=util[_0xe1bc('0x18')](_0xe1bc('0x1e'),path['basename'](_0x120a00[_0xe1bc('0x1d')],path['extname'](_0x120a00[_0xe1bc('0x1d')])),_0xe1bc('0x1f'));var _0x207d1b=path[_0xe1bc('0x20')](_0x4e74eb,_0x3ff4ea);var _0x45903e=path[_0xe1bc('0x20')](_0x4e74eb,_0x1efbfb);if(fs[_0xe1bc('0x21')](_0x207d1b)){_0x120a00['status']=_0xe1bc('0x22');_0x4118f0[_0xe1bc('0x23')]['attachments']=[{'filename':_0x3ff4ea,'path':_0x207d1b}];_0x4118f0['message'][_0xe1bc('0x24')]=util['format'](_0xe1bc('0x25'),JSON[_0xe1bc('0x26')](_0x120a00,null,0x2));}else if(fs[_0xe1bc('0x21')](_0x45903e)){_0x120a00[_0xe1bc('0x27')]=_0xe1bc('0x22');_0x4118f0[_0xe1bc('0x23')][_0xe1bc('0x28')]=[{'filename':_0x1efbfb,'path':_0x45903e}];}else{_0x4118f0[_0xe1bc('0x23')]['text']=_0xe1bc('0x29');if(!_0x30ee13['sendIfEmpty']){_0xeaa117=![];logger[_0xe1bc('0xb')]('empty\x20file,\x20email\x20not\x20sent');}}if(_0xeaa117){return client[_0xe1bc('0x2a')]('SendMail',_0x4118f0)['then'](function(_0x51912d){if(_0x51912d[_0xe1bc('0x2b')]){return logger[_0xe1bc('0x2b')](_0xe1bc('0x2c'),JSON[_0xe1bc('0x26')](_0x51912d));}return logger[_0xe1bc('0xb')](_0xe1bc('0x2d'));})[_0xe1bc('0x2e')](function(_0x4bd187){return logger[_0xe1bc('0x2b')](_0xe1bc('0x2c'),JSON[_0xe1bc('0x26')](_0x4bd187));});}};}function handleError(){return function(_0x5ad2c8){return logger[_0xe1bc('0x2b')](JSON[_0xe1bc('0x26')](_0x5ad2c8));};}function handleResult(_0x43c745){return function(_0x169d61){logger[_0xe1bc('0xb')](_0xe1bc('0x2f'),JSON[_0xe1bc('0x26')](_0x169d61));if(_0x43c745['MailAccount']&&_0x43c745[_0xe1bc('0xe')][_0xe1bc('0xf')]&&!_[_0xe1bc('0x30')](_0x43c745[_0xe1bc('0xd')])){setTimeout(handleSendEmail(_0x43c745,_0x169d61),0x3c*0x3e8);}};}function handleJob(_0x1a56d3){return function(){try{if(_[_0xe1bc('0x30')](_0x1a56d3[_0xe1bc('0x1b')])){return logger[_0xe1bc('0xb')](_0xe1bc('0x31'));}if(_['isNil'](_0x1a56d3['subtractUnit'])){return logger[_0xe1bc('0xb')]('subtractUnit\x20null\x20or\x20undefined');}var _0x3a6ba3={'startDate':moment()[_0xe1bc('0x32')](_0x1a56d3[_0xe1bc('0x1b')],_0x1a56d3['subtractUnit'])[_0xe1bc('0x18')](_0xe1bc('0x33')),'endDate':moment()[_0xe1bc('0x18')](_0xe1bc('0x33')),'type':_0xe1bc('0x34'),'output':_0x1a56d3[_0xe1bc('0x35')],'name':_0x1a56d3[_0xe1bc('0x1a')]};if(!_['isNil'](_0x1a56d3[_0xe1bc('0x36')])){logger[_0xe1bc('0xb')](_0xe1bc('0x37'),_0x1a56d3[_0xe1bc('0x36')]);return analyticDefaultReportController[_0xe1bc('0x38')]({'id':_0x1a56d3[_0xe1bc('0x36')]},_0x3a6ba3)[_0xe1bc('0x39')](handleResult(_0x1a56d3))[_0xe1bc('0x2e')](handleError());}if(!_[_0xe1bc('0x30')](_0x1a56d3[_0xe1bc('0x3a')])){logger[_0xe1bc('0xb')](_0xe1bc('0x3b'),_0x1a56d3[_0xe1bc('0x3a')]);return analyticCustomReportController[_0xe1bc('0x38')]({'id':_0x1a56d3[_0xe1bc('0x3a')]},_0x3a6ba3)[_0xe1bc('0x39')](handleResult(_0x1a56d3))['catch'](handleError());}}catch(_0x2af3cf){logger['error'](JSON['stringify'](_0x2af3cf));}return logger[_0xe1bc('0xb')](_0xe1bc('0x3c'));};}function getJobs(_0x3d3ccf){var _0x5f331e={};if(_0x3d3ccf){_0x5f331e['id']=_0x3d3ccf;}return db[_0xe1bc('0x3d')][_0xe1bc('0x3e')]({'where':_0x5f331e,'include':[{'model':db['MailAccount'],'attributes':['id',_0xe1bc('0x1a'),_0xe1bc('0xd')],'include':[{'model':db[_0xe1bc('0x3f')],'as':_0xe1bc('0xf')}]}]})[_0xe1bc('0x39')](function(_0x1455f6){var _0x44c7a0=_[_0xe1bc('0x40')](manager['jobs']);var _0x197e1c=_[_0xe1bc('0x41')](_0x1455f6,function(_0x460d77){return _0x460d77['id'][_0xe1bc('0x42')]();});var _0x2ac2f2=_['keyBy'](_0x1455f6,function(_0x43722c){return _0x43722c['id'][_0xe1bc('0x42')]();});var _0x57a56c=_0x3d3ccf?_0x197e1c:_[_0xe1bc('0x43')](_0x197e1c,_0x44c7a0);var _0x25a0e6=_[_0xe1bc('0x44')](_0x197e1c,_0x44c7a0);var _0xa96ef3=_[_0xe1bc('0x43')](_0x44c7a0,_0x197e1c);var _0x232482;var _0x42fa80;for(_0x232482=0x0;_0x232482<_0xa96ef3[_0xe1bc('0x45')]&&!_0x3d3ccf;_0x232482+=0x1){_0x42fa80=_0xa96ef3[_0x232482][_0xe1bc('0x42')]();if(manager[_0xe1bc('0x46')](_0x42fa80)){manager['stop'](_0x42fa80);manager[_0xe1bc('0x47')](_0x42fa80);logger[_0xe1bc('0xb')](_0xe1bc('0x48'),_0x42fa80);}}logger[_0xe1bc('0xb')](_0xe1bc('0x49'),JSON[_0xe1bc('0x26')](_0x57a56c));for(_0x232482=0x0;_0x232482<_0x57a56c[_0xe1bc('0x45')];_0x232482+=0x1){_0x42fa80=_0x57a56c[_0x232482][_0xe1bc('0x42')]();logger[_0xe1bc('0xb')](_0xe1bc('0x4a'),_0x42fa80);if(_0x3d3ccf){logger[_0xe1bc('0xb')](_0xe1bc('0x4b'),_0x3d3ccf);logger['info'](JSON['stringify'](_0x2ac2f2[_0x42fa80]));BPromise['resolve']()[_0xe1bc('0x39')](handleJob(_0x2ac2f2[_0x42fa80]));logger[_0xe1bc('0xb')](_0xe1bc('0x4c'),_0x2ac2f2[_0x42fa80][_0xe1bc('0x1a')],_0x2ac2f2[_0x42fa80][_0xe1bc('0x4d')]);}else if(_0x2ac2f2[_0x42fa80][_0xe1bc('0x4d')]&&_0x2ac2f2[_0x42fa80][_0xe1bc('0x4e')]&&moment()[_0xe1bc('0x4f')](_0x2ac2f2[_0x42fa80][_0xe1bc('0x50')],_0x2ac2f2[_0x42fa80]['endAt'])){manager[_0xe1bc('0x51')](_0x42fa80,_0x2ac2f2[_0x42fa80][_0xe1bc('0x4d')],handleJob(_0x2ac2f2[_0x42fa80]));manager[_0xe1bc('0x52')](_0x42fa80);logger['info'](_0xe1bc('0x53'),_0x2ac2f2[_0x42fa80]['name'],_0x2ac2f2[_0x42fa80][_0xe1bc('0x4d')]);}else if(manager['exists'](_0x42fa80)){manager['stop'](_0x42fa80);manager[_0xe1bc('0x47')](_0x42fa80);logger['info']('stop\x20cron',_0x2ac2f2[_0x42fa80][_0xe1bc('0x1a')],_0x2ac2f2[_0x42fa80][_0xe1bc('0x4d')]);}}for(_0x232482=0x0,_0x42fa80;_0x232482<_0x25a0e6['length']&&!_0x3d3ccf;_0x232482+=0x1){_0x42fa80=_0x25a0e6[_0x232482]['toString']();if(manager[_0xe1bc('0x46')](_0x42fa80)){if(_0x2ac2f2[_0x42fa80][_0xe1bc('0x4d')]&&_0x2ac2f2[_0x42fa80][_0xe1bc('0x4e')]&&moment()[_0xe1bc('0x4f')](_0x2ac2f2[_0x42fa80][_0xe1bc('0x50')],_0x2ac2f2[_0x42fa80][_0xe1bc('0x54')])){manager['update'](_0x42fa80,_0x2ac2f2[_0x42fa80][_0xe1bc('0x4d')],handleJob(_0x2ac2f2[_0x42fa80]));logger[_0xe1bc('0xb')]('update\x20cron',_0x2ac2f2[_0x42fa80][_0xe1bc('0x1a')],_0x2ac2f2[_0x42fa80][_0xe1bc('0x4d')]);}else{manager[_0xe1bc('0x55')](_0x42fa80);manager[_0xe1bc('0x47')](_0x42fa80);logger[_0xe1bc('0xb')](_0xe1bc('0x56'),_0x2ac2f2[_0x42fa80][_0xe1bc('0x1a')],_0x2ac2f2[_0x42fa80][_0xe1bc('0x4d')]);}}}})[_0xe1bc('0x2e')](function(_0x23780f){logger[_0xe1bc('0x2b')](JSON[_0xe1bc('0x26')](_0x23780f));});}exports[_0xe1bc('0x57')]=function(_0x20795e){return getJobs(_0x20795e);};exports[_0xe1bc('0x52')]=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 d6f9f98..a7524cb 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 _0x04b8=['[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)','transcribeName','data1','data2','then','[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s','TranscriptionJob','TranscriptionJobStatus','fileText','TranscriptFileUri','format','[RECORDING:%d]\x20Get\x20transcript','Transcript','results','transcripts','length','transcript','update','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','tempSentiment','Sequelize','ValidationError','sentiment','sentimentAccountId','sentimentRegion','bucket','Transcript\x20not\x20available','CloudProvider','findOne','Cloud\x20Provider\x20not\x20available','Cloud\x20Provider\x20not\x20configured','[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis','language','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','Sentiment','SentimentScore','Positive','Negative','Neutral','FAILED','FailureReason','[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed','resolve','Sentiment\x20Analysis\x20not\x20requested','Mixed','COMPLETED','catch','name','SequelizeValidationError','error','[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis','inspect','VoiceRecording','Setting','transcribeAccountId','transcribeRegion','Transcribe\x20not\x20configured','forEach','push','all','start','aws-sdk','util','bluebird','../../config/logger','transcribe','TranscribeService','Comprehend','detectSentiment','substring','info'];(function(_0xdc382c,_0x5cf5b7){var _0x346864=function(_0x5eae04){while(--_0x5eae04){_0xdc382c['push'](_0xdc382c['shift']());}};_0x346864(++_0x5cf5b7);}(_0x04b8,0x159));var _0x804b=function(_0x31091e,_0x46ae3d){_0x31091e=_0x31091e-0x0;var _0x3961c7=_0x04b8[_0x31091e];return _0x3961c7;};var _=require('lodash');var AWS=require(_0x804b('0x0'));var rp=require('request-promise');var util=require(_0x804b('0x1'));var BPromise=require(_0x804b('0x2'));var db=require('../../mysqldb')['db'];var logger=require(_0x804b('0x3'))(_0x804b('0x4'));function getTranscriptionJob(_0x5857dc,_0x3530f6,_0x1c3474,_0x2b0392){return new Promise(function(_0x5a8a5b,_0x2c22e3){var _0x3c5404=new AWS[(_0x804b('0x5'))]({'accessKeyId':_0x3530f6,'secretAccessKey':_0x5857dc,'region':_0x1c3474});_0x3c5404['getTranscriptionJob']({'TranscriptionJobName':_0x2b0392},function(_0x27e950,_0x1071b4){if(_0x27e950){return _0x2c22e3(_0x27e950);}else{return _0x5a8a5b(_0x1071b4);}});});}function sentiment(_0x592e14,_0x2a5a68,_0x336325,_0x222487,_0x22c59a){return new Promise(function(_0x1c5c15,_0x5c1a40){var _0x22c98d=new AWS[(_0x804b('0x6'))]({'accessKeyId':_0x2a5a68,'secretAccessKey':_0x592e14,'region':_0x336325});_0x22c98d[_0x804b('0x7')]({'Text':_0x222487,'LanguageCode':_0x22c59a[_0x804b('0x8')](0x0,0x2)},function(_0x2d13ba,_0x12e7b4){if(_0x2d13ba){return _0x5c1a40(_0x2d13ba);}else{return _0x1c5c15(_0x12e7b4);}});});}function checkTranscribeJob(_0x50ba27,_0x15a4eb,_0x5303cc){var _0x23ee57;return new BPromise(function(_0x3a2702,_0xfa2ddd){logger[_0x804b('0x9')](util['format'](_0x804b('0xa'),_0x50ba27['id'],_0x50ba27[_0x804b('0xb')]));return getTranscriptionJob(_0x5303cc[_0x804b('0xc')],_0x5303cc[_0x804b('0xd')],_0x15a4eb['transcribeRegion'],_0x50ba27[_0x804b('0xb')])[_0x804b('0xe')](function(_0x5e1cfe){logger[_0x804b('0x9')](util['format'](_0x804b('0xf'),_0x50ba27['id'],_0x50ba27[_0x804b('0xb')],_0x5e1cfe[_0x804b('0x10')][_0x804b('0x11')]));if(!_0x50ba27[_0x804b('0x12')]){switch(_0x5e1cfe['TranscriptionJob'][_0x804b('0x11')]){case'COMPLETED':var _0x247380={'transcribeStatus':_0x5e1cfe[_0x804b('0x10')][_0x804b('0x11')],'fileUri':_0x5e1cfe[_0x804b('0x10')]['Transcript'][_0x804b('0x13')]};logger[_0x804b('0x9')](util[_0x804b('0x14')](_0x804b('0x15'),_0x50ba27['id']));return rp({'uri':_0x5e1cfe[_0x804b('0x10')][_0x804b('0x16')][_0x804b('0x13')],'json':!![]})[_0x804b('0xe')](function(_0xaa9521){logger[_0x804b('0x9')](util[_0x804b('0x14')]('[RECORDING:%d]\x20Transcript\x20downloaded',_0x50ba27['id']));if(_0xaa9521&&_0xaa9521[_0x804b('0x17')]&&_0xaa9521[_0x804b('0x17')]['transcripts']&&_0xaa9521[_0x804b('0x17')][_0x804b('0x18')][_0x804b('0x19')]){_0x247380[_0x804b('0x12')]='';for(var _0x9080c2=0x0;_0x9080c2<_0xaa9521['results'][_0x804b('0x18')][_0x804b('0x19')];_0x9080c2++){_0x247380['fileText']+=_0xaa9521[_0x804b('0x17')][_0x804b('0x18')][_0x9080c2][_0x804b('0x1a')]+'';}}return _0x50ba27[_0x804b('0x1b')](_0x247380);})[_0x804b('0xe')](function(){logger['info'](util[_0x804b('0x14')](_0x804b('0x1c'),_0x50ba27['id']));if(!_0x50ba27[_0x804b('0x1d')]){throw new db[(_0x804b('0x1e'))][(_0x804b('0x1f'))]('Sentiment\x20Analysis\x20not\x20requested');}if(!_0x15a4eb[_0x804b('0x20')]||!_0x15a4eb[_0x804b('0x21')]||!_0x15a4eb[_0x804b('0x22')]||!_0x15a4eb['language']||!_0x15a4eb[_0x804b('0x23')]){throw new db[(_0x804b('0x1e'))][(_0x804b('0x1f'))]('Sentiment\x20Analysis\x20not\x20configured');}if(!_0x247380[_0x804b('0x12')]){throw new Error(_0x804b('0x24'));}if(_0x15a4eb['sentimentAccountId']===_0x5303cc['id']){return _0x5303cc;}else{return db[_0x804b('0x25')][_0x804b('0x26')]({'where':{'id':_settings[_0x804b('0x21')]}});}})[_0x804b('0xe')](function(_0x46de73){if(!_0x46de73){throw new db[(_0x804b('0x1e'))]['ValidationError'](_0x804b('0x27'));}if(!_0x46de73[_0x804b('0xc')]||!_0x46de73[_0x804b('0xd')]){throw new db[(_0x804b('0x1e'))][(_0x804b('0x1f'))](_0x804b('0x28'));}_0x23ee57=_0x46de73;logger[_0x804b('0x9')](util[_0x804b('0x14')](_0x804b('0x29'),_0x50ba27['id']));return sentiment(_0x23ee57[_0x804b('0xc')],_0x23ee57[_0x804b('0xd')],_0x15a4eb[_0x804b('0x22')],_0x247380[_0x804b('0x12')],_0x15a4eb[_0x804b('0x2a')]);})[_0x804b('0xe')](function(_0x384c44){logger[_0x804b('0x9')](util[_0x804b('0x14')](_0x804b('0x2b'),_0x50ba27['id']));return _0x50ba27[_0x804b('0x1b')]({'sentiment':_0x384c44[_0x804b('0x2c')],'sPositive':_0x384c44[_0x804b('0x2d')][_0x804b('0x2e')],'sNegative':_0x384c44[_0x804b('0x2d')][_0x804b('0x2f')],'sMixed':_0x384c44['SentimentScore']['Mixed'],'sNeutral':_0x384c44['SentimentScore'][_0x804b('0x30')]});})[_0x804b('0xe')](function(){logger[_0x804b('0x9')](util['format']('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x50ba27['id']));_0x3a2702();});case'FAILED':return _0x50ba27[_0x804b('0x1b')]({'transcribeStatus':_0x804b('0x31'),'failureReason':_0x5e1cfe[_0x804b('0x10')][_0x804b('0x32')]})[_0x804b('0xe')](function(){logger[_0x804b('0x9')](util[_0x804b('0x14')](_0x804b('0x1c'),_0x50ba27['id']));_0x3a2702();});default:logger[_0x804b('0x9')](util[_0x804b('0x14')](_0x804b('0x33'),_0x50ba27['id']));break;}}else{return BPromise[_0x804b('0x34')]()[_0x804b('0xe')](function(){if(!_0x50ba27['tempSentiment']){throw new db[(_0x804b('0x1e'))][(_0x804b('0x1f'))](_0x804b('0x35'));}if(!_0x15a4eb[_0x804b('0x20')]||!_0x15a4eb[_0x804b('0x21')]||!_0x15a4eb['sentimentRegion']||!_0x15a4eb['language']||!_0x15a4eb[_0x804b('0x23')]){throw new db[(_0x804b('0x1e'))][(_0x804b('0x1f'))]('Sentiment\x20Analysis\x20not\x20configured');}if(!_0x50ba27[_0x804b('0x12')]){throw new Error('Transcript\x20not\x20available');}if(_0x15a4eb[_0x804b('0x21')]===_0x5303cc['id']){return _0x5303cc;}else{return db[_0x804b('0x25')][_0x804b('0x26')]({'where':{'id':_settings[_0x804b('0x21')]}});}})[_0x804b('0xe')](function(_0x13b986){if(!_0x13b986){throw new db[(_0x804b('0x1e'))]['ValidationError'](_0x804b('0x27'));}if(!_0x13b986[_0x804b('0xc')]||!_0x13b986[_0x804b('0xd')]){throw new db[(_0x804b('0x1e'))]['ValidationError'](_0x804b('0x28'));}_0x23ee57=_0x13b986;logger[_0x804b('0x9')](util[_0x804b('0x14')](_0x804b('0x29'),_0x50ba27['id']));return sentiment(_0x23ee57[_0x804b('0xc')],_0x23ee57[_0x804b('0xd')],_0x15a4eb[_0x804b('0x22')],_0x50ba27[_0x804b('0x12')],_0x15a4eb['language']);})[_0x804b('0xe')](function(_0x4e9cd8){logger['info'](util['format'](_0x804b('0x2b'),_0x50ba27['id']));return _0x50ba27['update']({'sentiment':_0x4e9cd8[_0x804b('0x2c')],'sPositive':_0x4e9cd8[_0x804b('0x2d')][_0x804b('0x2e')],'sNegative':_0x4e9cd8[_0x804b('0x2d')]['Negative'],'sMixed':_0x4e9cd8[_0x804b('0x2d')][_0x804b('0x36')],'sNeutral':_0x4e9cd8[_0x804b('0x2d')]['Neutral'],'transcribeStatus':_0x804b('0x37')});})[_0x804b('0xe')](function(){logger[_0x804b('0x9')](util['format'](_0x804b('0x1c'),_0x50ba27['id']));_0x3a2702();});}})[_0x804b('0x38')](function(_0x18e90b){if(_0x18e90b){if(!_0x18e90b[_0x804b('0x39')]||_0x18e90b[_0x804b('0x39')]!==_0x804b('0x3a')){logger[_0x804b('0x3b')](util[_0x804b('0x14')](_0x804b('0x3c'),_0x50ba27['id']),util[_0x804b('0x3d')](_0x18e90b,{'showHidden':![],'depth':null}));}}_0x3a2702();});});}function checkTranscribe(){var _0x376ece;var _0x456f6b;var _0x20862f;return db[_0x804b('0x3e')]['findAll']({'where':{'transcribeStatus':'IN_PROGRESS'}})[_0x804b('0xe')](function(_0x179d38){if(!_0x179d38||!_0x179d38[_0x804b('0x19')]){throw new db[(_0x804b('0x1e'))][(_0x804b('0x1f'))]('No\x20transcribe\x20job\x20to\x20check');}_0x376ece=_0x179d38;return db[_0x804b('0x3f')][_0x804b('0x26')]({'where':{'id':0x1}});})[_0x804b('0xe')](function(_0x3ca9ff){if(!_0x3ca9ff){throw new db[(_0x804b('0x1e'))][(_0x804b('0x1f'))]('Settings\x20not\x20available');}_0x456f6b=_0x3ca9ff;if(!_0x456f6b['transcribe']||!_0x456f6b[_0x804b('0x40')]||!_0x456f6b[_0x804b('0x41')]||!_0x456f6b['language']||!_0x456f6b['bucket']){throw new db[(_0x804b('0x1e'))][(_0x804b('0x1f'))](_0x804b('0x42'));}return db['CloudProvider'][_0x804b('0x26')]({'where':{'id':_0x456f6b[_0x804b('0x40')]}});})['then'](function(_0x2756de){if(!_0x2756de){throw new db['Sequelize'][(_0x804b('0x1f'))]('Cloud\x20Provider\x20not\x20available');}if(!_0x2756de[_0x804b('0xc')]||!_0x2756de[_0x804b('0xd')]){throw new db['Sequelize'][(_0x804b('0x1f'))]('Cloud\x20Provider\x20not\x20configured');}_0x20862f=_0x2756de;var _0x36b417=[];_0x376ece[_0x804b('0x43')](function(_0x33944c){_0x36b417[_0x804b('0x44')](checkTranscribeJob(_0x33944c,_0x456f6b,_0x20862f));});return BPromise[_0x804b('0x45')](_0x36b417);})[_0x804b('0x38')](function(_0x3a3a59){if(_0x3a3a59){if(!_0x3a3a59[_0x804b('0x39')]||_0x3a3a59[_0x804b('0x39')]!==_0x804b('0x3a')){logger['error'](util['inspect'](_0x3a3a59,{'showHidden':![],'depth':null}));}}});}exports[_0x804b('0x46')]=function(){setInterval(function(){return checkTranscribe();},0x3c*0x3e8);return checkTranscribe();}; \ No newline at end of file +var _0xf089=['update','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','tempSentiment','Sequelize','ValidationError','Sentiment\x20Analysis\x20not\x20requested','sentiment','sentimentAccountId','language','Sentiment\x20Analysis\x20not\x20configured','Transcript\x20not\x20available','CloudProvider','findOne','Cloud\x20Provider\x20not\x20available','Cloud\x20Provider\x20not\x20configured','[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis','SentimentScore','Positive','Negative','Neutral','FAILED','FailureReason','[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed','resolve','bucket','sentimentRegion','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','Sentiment','catch','name','SequelizeValidationError','error','inspect','VoiceRecording','findAll','IN_PROGRESS','Setting','Settings\x20not\x20available','transcribeAccountId','Transcribe\x20not\x20configured','forEach','push','all','start','aws-sdk','request-promise','bluebird','../../mysqldb','../../config/logger','transcribe','getTranscriptionJob','substring','info','format','[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)','data1','data2','transcribeRegion','transcribeName','then','TranscriptionJob','TranscriptionJobStatus','fileText','COMPLETED','Transcript','TranscriptFileUri','[RECORDING:%d]\x20Get\x20transcript','results','transcripts','length','transcript'];(function(_0x364cf8,_0x146b9b){var _0x6a59ee=function(_0x3d81eb){while(--_0x3d81eb){_0x364cf8['push'](_0x364cf8['shift']());}};_0x6a59ee(++_0x146b9b);}(_0xf089,0xba));var _0x9f08=function(_0x511014,_0x48d1fa){_0x511014=_0x511014-0x0;var _0x26591c=_0xf089[_0x511014];return _0x26591c;};var _=require('lodash');var AWS=require(_0x9f08('0x0'));var rp=require(_0x9f08('0x1'));var util=require('util');var BPromise=require(_0x9f08('0x2'));var db=require(_0x9f08('0x3'))['db'];var logger=require(_0x9f08('0x4'))(_0x9f08('0x5'));function getTranscriptionJob(_0x48bf89,_0x11d64c,_0x1dced2,_0x352879){return new Promise(function(_0x13768c,_0x38c9ea){var _0x39abe2=new AWS['TranscribeService']({'accessKeyId':_0x11d64c,'secretAccessKey':_0x48bf89,'region':_0x1dced2});_0x39abe2[_0x9f08('0x6')]({'TranscriptionJobName':_0x352879},function(_0x4b37fc,_0x39e238){if(_0x4b37fc){return _0x38c9ea(_0x4b37fc);}else{return _0x13768c(_0x39e238);}});});}function sentiment(_0x4ce5b6,_0x4358e7,_0x286809,_0x3868b6,_0x4dc012){return new Promise(function(_0x2ae155,_0x3e5d2b){var _0x447a85=new AWS['Comprehend']({'accessKeyId':_0x4358e7,'secretAccessKey':_0x4ce5b6,'region':_0x286809});_0x447a85['detectSentiment']({'Text':_0x3868b6,'LanguageCode':_0x4dc012[_0x9f08('0x7')](0x0,0x2)},function(_0x1e6f42,_0x52ab70){if(_0x1e6f42){return _0x3e5d2b(_0x1e6f42);}else{return _0x2ae155(_0x52ab70);}});});}function checkTranscribeJob(_0x2b7e6f,_0x2b32c7,_0x251b84){var _0x597ae8;return new BPromise(function(_0x582be0,_0x9cd154){logger[_0x9f08('0x8')](util[_0x9f08('0x9')](_0x9f08('0xa'),_0x2b7e6f['id'],_0x2b7e6f['transcribeName']));return getTranscriptionJob(_0x251b84[_0x9f08('0xb')],_0x251b84[_0x9f08('0xc')],_0x2b32c7[_0x9f08('0xd')],_0x2b7e6f[_0x9f08('0xe')])[_0x9f08('0xf')](function(_0x4cec58){logger[_0x9f08('0x8')](util['format']('[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s',_0x2b7e6f['id'],_0x2b7e6f[_0x9f08('0xe')],_0x4cec58[_0x9f08('0x10')][_0x9f08('0x11')]));if(!_0x2b7e6f[_0x9f08('0x12')]){switch(_0x4cec58[_0x9f08('0x10')][_0x9f08('0x11')]){case _0x9f08('0x13'):var _0x20163c={'transcribeStatus':_0x4cec58[_0x9f08('0x10')][_0x9f08('0x11')],'fileUri':_0x4cec58[_0x9f08('0x10')][_0x9f08('0x14')][_0x9f08('0x15')]};logger[_0x9f08('0x8')](util[_0x9f08('0x9')](_0x9f08('0x16'),_0x2b7e6f['id']));return rp({'uri':_0x4cec58['TranscriptionJob'][_0x9f08('0x14')][_0x9f08('0x15')],'json':!![]})[_0x9f08('0xf')](function(_0x3d4574){logger[_0x9f08('0x8')](util[_0x9f08('0x9')]('[RECORDING:%d]\x20Transcript\x20downloaded',_0x2b7e6f['id']));if(_0x3d4574&&_0x3d4574[_0x9f08('0x17')]&&_0x3d4574[_0x9f08('0x17')][_0x9f08('0x18')]&&_0x3d4574[_0x9f08('0x17')][_0x9f08('0x18')][_0x9f08('0x19')]){_0x20163c[_0x9f08('0x12')]='';for(var _0x4a2f0b=0x0;_0x4a2f0b<_0x3d4574['results'][_0x9f08('0x18')][_0x9f08('0x19')];_0x4a2f0b++){_0x20163c[_0x9f08('0x12')]+=_0x3d4574[_0x9f08('0x17')][_0x9f08('0x18')][_0x4a2f0b][_0x9f08('0x1a')]+'';}}return _0x2b7e6f[_0x9f08('0x1b')](_0x20163c);})[_0x9f08('0xf')](function(){logger['info'](util[_0x9f08('0x9')](_0x9f08('0x1c'),_0x2b7e6f['id']));if(!_0x2b7e6f[_0x9f08('0x1d')]){throw new db[(_0x9f08('0x1e'))][(_0x9f08('0x1f'))](_0x9f08('0x20'));}if(!_0x2b32c7[_0x9f08('0x21')]||!_0x2b32c7[_0x9f08('0x22')]||!_0x2b32c7['sentimentRegion']||!_0x2b32c7[_0x9f08('0x23')]||!_0x2b32c7['bucket']){throw new db[(_0x9f08('0x1e'))][(_0x9f08('0x1f'))](_0x9f08('0x24'));}if(!_0x20163c[_0x9f08('0x12')]){throw new Error(_0x9f08('0x25'));}if(_0x2b32c7['sentimentAccountId']===_0x251b84['id']){return _0x251b84;}else{return db[_0x9f08('0x26')][_0x9f08('0x27')]({'where':{'id':_settings[_0x9f08('0x22')]}});}})[_0x9f08('0xf')](function(_0x55417){if(!_0x55417){throw new db[(_0x9f08('0x1e'))][(_0x9f08('0x1f'))](_0x9f08('0x28'));}if(!_0x55417[_0x9f08('0xb')]||!_0x55417['data2']){throw new db[(_0x9f08('0x1e'))]['ValidationError'](_0x9f08('0x29'));}_0x597ae8=_0x55417;logger[_0x9f08('0x8')](util[_0x9f08('0x9')](_0x9f08('0x2a'),_0x2b7e6f['id']));return sentiment(_0x597ae8[_0x9f08('0xb')],_0x597ae8[_0x9f08('0xc')],_0x2b32c7['sentimentRegion'],_0x20163c[_0x9f08('0x12')],_0x2b32c7[_0x9f08('0x23')]);})[_0x9f08('0xf')](function(_0x46cb57){logger[_0x9f08('0x8')](util[_0x9f08('0x9')]('[RECORDING:%d]\x20Sentiment\x20Analysis\x20available',_0x2b7e6f['id']));return _0x2b7e6f[_0x9f08('0x1b')]({'sentiment':_0x46cb57['Sentiment'],'sPositive':_0x46cb57[_0x9f08('0x2b')][_0x9f08('0x2c')],'sNegative':_0x46cb57[_0x9f08('0x2b')][_0x9f08('0x2d')],'sMixed':_0x46cb57[_0x9f08('0x2b')]['Mixed'],'sNeutral':_0x46cb57[_0x9f08('0x2b')][_0x9f08('0x2e')]});})[_0x9f08('0xf')](function(){logger['info'](util[_0x9f08('0x9')](_0x9f08('0x1c'),_0x2b7e6f['id']));_0x582be0();});case _0x9f08('0x2f'):return _0x2b7e6f[_0x9f08('0x1b')]({'transcribeStatus':_0x9f08('0x2f'),'failureReason':_0x4cec58['TranscriptionJob'][_0x9f08('0x30')]})[_0x9f08('0xf')](function(){logger[_0x9f08('0x8')](util[_0x9f08('0x9')](_0x9f08('0x1c'),_0x2b7e6f['id']));_0x582be0();});default:logger[_0x9f08('0x8')](util[_0x9f08('0x9')](_0x9f08('0x31'),_0x2b7e6f['id']));break;}}else{return BPromise[_0x9f08('0x32')]()[_0x9f08('0xf')](function(){if(!_0x2b7e6f[_0x9f08('0x1d')]){throw new db[(_0x9f08('0x1e'))][(_0x9f08('0x1f'))]('Sentiment\x20Analysis\x20not\x20requested');}if(!_0x2b32c7[_0x9f08('0x21')]||!_0x2b32c7[_0x9f08('0x22')]||!_0x2b32c7['sentimentRegion']||!_0x2b32c7[_0x9f08('0x23')]||!_0x2b32c7[_0x9f08('0x33')]){throw new db[(_0x9f08('0x1e'))][(_0x9f08('0x1f'))]('Sentiment\x20Analysis\x20not\x20configured');}if(!_0x2b7e6f[_0x9f08('0x12')]){throw new Error(_0x9f08('0x25'));}if(_0x2b32c7[_0x9f08('0x22')]===_0x251b84['id']){return _0x251b84;}else{return db[_0x9f08('0x26')][_0x9f08('0x27')]({'where':{'id':_settings[_0x9f08('0x22')]}});}})['then'](function(_0x23c43f){if(!_0x23c43f){throw new db[(_0x9f08('0x1e'))][(_0x9f08('0x1f'))]('Cloud\x20Provider\x20not\x20available');}if(!_0x23c43f[_0x9f08('0xb')]||!_0x23c43f['data2']){throw new db[(_0x9f08('0x1e'))][(_0x9f08('0x1f'))](_0x9f08('0x29'));}_0x597ae8=_0x23c43f;logger['info'](util[_0x9f08('0x9')](_0x9f08('0x2a'),_0x2b7e6f['id']));return sentiment(_0x597ae8[_0x9f08('0xb')],_0x597ae8[_0x9f08('0xc')],_0x2b32c7[_0x9f08('0x34')],_0x2b7e6f[_0x9f08('0x12')],_0x2b32c7['language']);})[_0x9f08('0xf')](function(_0x5ef1fa){logger[_0x9f08('0x8')](util[_0x9f08('0x9')](_0x9f08('0x35'),_0x2b7e6f['id']));return _0x2b7e6f[_0x9f08('0x1b')]({'sentiment':_0x5ef1fa[_0x9f08('0x36')],'sPositive':_0x5ef1fa[_0x9f08('0x2b')][_0x9f08('0x2c')],'sNegative':_0x5ef1fa['SentimentScore']['Negative'],'sMixed':_0x5ef1fa['SentimentScore']['Mixed'],'sNeutral':_0x5ef1fa['SentimentScore'][_0x9f08('0x2e')],'transcribeStatus':_0x9f08('0x13')});})['then'](function(){logger[_0x9f08('0x8')](util['format'](_0x9f08('0x1c'),_0x2b7e6f['id']));_0x582be0();});}})[_0x9f08('0x37')](function(_0x16756b){if(_0x16756b){if(!_0x16756b[_0x9f08('0x38')]||_0x16756b['name']!==_0x9f08('0x39')){logger[_0x9f08('0x3a')](util[_0x9f08('0x9')]('[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis',_0x2b7e6f['id']),util[_0x9f08('0x3b')](_0x16756b,{'showHidden':![],'depth':null}));}}_0x582be0();});});}function checkTranscribe(){var _0x585c14;var _0x55d98d;var _0x4b7c5f;return db[_0x9f08('0x3c')][_0x9f08('0x3d')]({'where':{'transcribeStatus':_0x9f08('0x3e')}})[_0x9f08('0xf')](function(_0x14a6b6){if(!_0x14a6b6||!_0x14a6b6['length']){throw new db['Sequelize'][(_0x9f08('0x1f'))]('No\x20transcribe\x20job\x20to\x20check');}_0x585c14=_0x14a6b6;return db[_0x9f08('0x3f')][_0x9f08('0x27')]({'where':{'id':0x1}});})['then'](function(_0x3fb332){if(!_0x3fb332){throw new db[(_0x9f08('0x1e'))][(_0x9f08('0x1f'))](_0x9f08('0x40'));}_0x55d98d=_0x3fb332;if(!_0x55d98d['transcribe']||!_0x55d98d[_0x9f08('0x41')]||!_0x55d98d[_0x9f08('0xd')]||!_0x55d98d['language']||!_0x55d98d['bucket']){throw new db[(_0x9f08('0x1e'))]['ValidationError'](_0x9f08('0x42'));}return db[_0x9f08('0x26')][_0x9f08('0x27')]({'where':{'id':_0x55d98d['transcribeAccountId']}});})[_0x9f08('0xf')](function(_0x22e513){if(!_0x22e513){throw new db[(_0x9f08('0x1e'))][(_0x9f08('0x1f'))](_0x9f08('0x28'));}if(!_0x22e513[_0x9f08('0xb')]||!_0x22e513[_0x9f08('0xc')]){throw new db[(_0x9f08('0x1e'))][(_0x9f08('0x1f'))](_0x9f08('0x29'));}_0x4b7c5f=_0x22e513;var _0x2c9231=[];_0x585c14[_0x9f08('0x43')](function(_0x21ddd9){_0x2c9231[_0x9f08('0x44')](checkTranscribeJob(_0x21ddd9,_0x55d98d,_0x4b7c5f));});return BPromise[_0x9f08('0x45')](_0x2c9231);})[_0x9f08('0x37')](function(_0x5ebc5e){if(_0x5ebc5e){if(!_0x5ebc5e[_0x9f08('0x38')]||_0x5ebc5e[_0x9f08('0x38')]!=='SequelizeValidationError'){logger[_0x9f08('0x3a')](util[_0x9f08('0x3b')](_0x5ebc5e,{'showHidden':![],'depth':null}));}}});}exports[_0x9f08('0x46')]=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 553b343..ba72439 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 _0x4bf6=['then','length','map','info','join','update','timeout','format','YYYY-MM-DD\x20HH:mm:ss','[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:','emit','whatsappInteraction:update','catch','inspect','moment','util','../../config/environment','../../mysqldb','../logger','schedule','redis','localhost','socket.io-emitter','WhatsappInteraction','findAll','lastMsgAt','hours'];(function(_0x180cd0,_0x386c6e){var _0x49fc32=function(_0x551c2c){while(--_0x551c2c){_0x180cd0['push'](_0x180cd0['shift']());}};_0x49fc32(++_0x386c6e);}(_0x4bf6,0xcb));var _0x64bf=function(_0x45531e,_0x43d9fd){_0x45531e=_0x45531e-0x0;var _0xbdba54=_0x4bf6[_0x45531e];return _0xbdba54;};'use strict';var _=require('lodash');var moment=require(_0x64bf('0x0'));var Redis=require('ioredis');var util=require(_0x64bf('0x1'));var config=require(_0x64bf('0x2'));var db=require(_0x64bf('0x3'))['db'];var logger=require(_0x64bf('0x4'))(_0x64bf('0x5'));config['redis']=_['defaults'](config[_0x64bf('0x6')],{'host':_0x64bf('0x7'),'port':0x18eb});var io=require(_0x64bf('0x8'))(new Redis(config[_0x64bf('0x6')]));function closeInteractions(){var _0x166cca=[];return db[_0x64bf('0x9')][_0x64bf('0xa')]({'raw':!![],'attributes':['id',_0x64bf('0xb')],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()['subtract'](0x18,_0x64bf('0xc'))}}})[_0x64bf('0xd')](function(_0xe62642){if(_0xe62642&&_0xe62642[_0x64bf('0xe')]){_0x166cca=_[_0x64bf('0xf')](_0xe62642||[],'id');logger[_0x64bf('0x10')]('[WHATSAPP]\x20Interactions\x20to\x20close:',_0x166cca[_0x64bf('0x11')]());return db[_0x64bf('0x9')][_0x64bf('0x12')]({'closeReason':'system','disposition':_0x64bf('0x13'),'closed':!![],'closedAt':moment()[_0x64bf('0x14')](_0x64bf('0x15'))},{'where':{'id':_0x166cca}});}})[_0x64bf('0xd')](function(){if(_0x166cca&&_0x166cca[_0x64bf('0xe')]){logger[_0x64bf('0x10')](_0x64bf('0x16'),_0x166cca[_0x64bf('0x11')]());for(var _0x39ee31=0x0;_0x39ee31<_0x166cca['length'];_0x39ee31++){io[_0x64bf('0x17')](_0x64bf('0x18'),{'id':_0x166cca[_0x39ee31],'closed':!![]});}}})[_0x64bf('0x19')](function(_0x20f11f){logger['error']('[WHATSAPP]\x20Error\x20closing\x20interactions',_0x20f11f?util[_0x64bf('0x1a')](_0x20f11f,{'showHidden':![],'depth':null}):'');});}exports['start']=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0x8761=['join','update','format','YYYY-MM-DD\x20HH:mm:ss','whatsappInteraction:update','catch','error','[WHATSAPP]\x20Error\x20closing\x20interactions','ioredis','util','../../config/environment','../../mysqldb','../logger','schedule','defaults','redis','localhost','socket.io-emitter','WhatsappInteraction','findAll','lastMsgAt','subtract','hours','then','length','map','info','[WHATSAPP]\x20Interactions\x20to\x20close:'];(function(_0x3de8a4,_0x289a5c){var _0x4635cf=function(_0x2bddb8){while(--_0x2bddb8){_0x3de8a4['push'](_0x3de8a4['shift']());}};_0x4635cf(++_0x289a5c);}(_0x8761,0x78));var _0x1876=function(_0x1e0fa7,_0x4e4791){_0x1e0fa7=_0x1e0fa7-0x0;var _0x4cc219=_0x8761[_0x1e0fa7];return _0x4cc219;};'use strict';var _=require('lodash');var moment=require('moment');var Redis=require(_0x1876('0x0'));var util=require(_0x1876('0x1'));var config=require(_0x1876('0x2'));var db=require(_0x1876('0x3'))['db'];var logger=require(_0x1876('0x4'))(_0x1876('0x5'));config['redis']=_[_0x1876('0x6')](config[_0x1876('0x7')],{'host':_0x1876('0x8'),'port':0x18eb});var io=require(_0x1876('0x9'))(new Redis(config[_0x1876('0x7')]));function closeInteractions(){var _0x242ecc=[];return db[_0x1876('0xa')][_0x1876('0xb')]({'raw':!![],'attributes':['id',_0x1876('0xc')],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()[_0x1876('0xd')](0x18,_0x1876('0xe'))}}})[_0x1876('0xf')](function(_0xa016e){if(_0xa016e&&_0xa016e[_0x1876('0x10')]){_0x242ecc=_[_0x1876('0x11')](_0xa016e||[],'id');logger[_0x1876('0x12')](_0x1876('0x13'),_0x242ecc[_0x1876('0x14')]());return db[_0x1876('0xa')][_0x1876('0x15')]({'closeReason':'system','disposition':'timeout','closed':!![],'closedAt':moment()[_0x1876('0x16')](_0x1876('0x17'))},{'where':{'id':_0x242ecc}});}})[_0x1876('0xf')](function(){if(_0x242ecc&&_0x242ecc[_0x1876('0x10')]){logger[_0x1876('0x12')]('[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:',_0x242ecc[_0x1876('0x14')]());for(var _0x40a9a7=0x0;_0x40a9a7<_0x242ecc[_0x1876('0x10')];_0x40a9a7++){io['emit'](_0x1876('0x18'),{'id':_0x242ecc[_0x40a9a7],'closed':!![]});}}})[_0x1876('0x19')](function(_0x5d1220){logger[_0x1876('0x1a')](_0x1876('0x1b'),_0x5d1220?util['inspect'](_0x5d1220,{'showHidden':![],'depth':null}):'');});}exports['start']=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 a0df3b2..b6f1015 100644 --- a/server/config/seedContact.js +++ b/server/config/seedContact.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1e9a=['hopper2','catch','util','../mysqldb','push','Innocenzo','Biondo','innocenzo.biondo','@xcally.com','now','CmContact','destroy','then','bulkCreate','log','finished\x20populating','contacts1','CmHopper','hopper1'];(function(_0x495942,_0x9be2d8){var _0x210623=function(_0x4684d6){while(--_0x4684d6){_0x495942['push'](_0x495942['shift']());}};_0x210623(++_0x9be2d8);}(_0x1e9a,0x1f0));var _0xa1e9=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x1e9a[_0x4565bf];return _0x5610ba;};'use strict';var util=require(_0xa1e9('0x0'));var db=require(_0xa1e9('0x1'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0xa1e9('0x2')]({'id':i,'firstName':_0xa1e9('0x3')+i,'lastName':_0xa1e9('0x4')+i,'phone':0xf879fb460+i,'email':_0xa1e9('0x5')+i+_0xa1e9('0x6')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper['push']({'id':i,'active':![],'scheduledat':Date['now'](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0xa1e9('0x7')](),'updatedAt':Date[_0xa1e9('0x7')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2['push']({'id':i,'firstName':'Innocenzo'+i,'lastName':_0xa1e9('0x4')+i,'phone':0xf879fb460+i,'email':_0xa1e9('0x5')+i+_0xa1e9('0x6')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0xa1e9('0x2')]({'id':i,'active':![],'scheduledat':Date[_0xa1e9('0x7')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0xa1e9('0x7')](),'updatedAt':Date[_0xa1e9('0x7')]()});}db[_0xa1e9('0x8')][_0xa1e9('0x9')]({'where':{}})[_0xa1e9('0xa')](function(){return db['CmContact'][_0xa1e9('0xb')](contacts);})[_0xa1e9('0xa')](function(){console[_0xa1e9('0xc')](_0xa1e9('0xd'),_0xa1e9('0xe'));return db[_0xa1e9('0xf')][_0xa1e9('0x9')]({'where':{}});})[_0xa1e9('0xa')](function(){return db[_0xa1e9('0xf')][_0xa1e9('0xb')](hopper);})[_0xa1e9('0xa')](function(){console[_0xa1e9('0xc')](_0xa1e9('0xd'),_0xa1e9('0x10'));return db[_0xa1e9('0x8')][_0xa1e9('0xb')](contacts2);})[_0xa1e9('0xa')](function(){console[_0xa1e9('0xc')](_0xa1e9('0xd'),'contacts2');return db[_0xa1e9('0xf')][_0xa1e9('0xb')](hopper2);})[_0xa1e9('0xa')](function(){console[_0xa1e9('0xc')](_0xa1e9('0xd'),_0xa1e9('0x11'));})[_0xa1e9('0x12')](function(_0x17e4b6){console[_0xa1e9('0xc')](_0x17e4b6);}); \ No newline at end of file +var _0xb96e=['bulkCreate','then','log','finished\x20populating','contacts1','destroy','CmHopper','hopper1','contacts2','hopper2','catch','../mysqldb','push','Innocenzo','Biondo','innocenzo.biondo','@xcally.com','now','CmContact'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xb96e,0xa3));var _0xeb96=function(_0x17526d,_0x9efe1f){_0x17526d=_0x17526d-0x0;var _0x167201=_0xb96e[_0x17526d];return _0x167201;};'use strict';var util=require('util');var db=require(_0xeb96('0x0'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0xeb96('0x1')]({'id':i,'firstName':_0xeb96('0x2')+i,'lastName':_0xeb96('0x3')+i,'phone':0xf879fb460+i,'email':_0xeb96('0x4')+i+_0xeb96('0x5')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper[_0xeb96('0x1')]({'id':i,'active':![],'scheduledat':Date['now'](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0xeb96('0x6')](),'updatedAt':Date['now']()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2['push']({'id':i,'firstName':_0xeb96('0x2')+i,'lastName':_0xeb96('0x3')+i,'phone':0xf879fb460+i,'email':_0xeb96('0x4')+i+'@xcally.com'});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0xeb96('0x1')]({'id':i,'active':![],'scheduledat':Date['now'](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0xeb96('0x6')](),'updatedAt':Date[_0xeb96('0x6')]()});}db[_0xeb96('0x7')]['destroy']({'where':{}})['then'](function(){return db[_0xeb96('0x7')][_0xeb96('0x8')](contacts);})[_0xeb96('0x9')](function(){console[_0xeb96('0xa')](_0xeb96('0xb'),_0xeb96('0xc'));return db['CmHopper'][_0xeb96('0xd')]({'where':{}});})[_0xeb96('0x9')](function(){return db[_0xeb96('0xe')][_0xeb96('0x8')](hopper);})[_0xeb96('0x9')](function(){console['log'](_0xeb96('0xb'),_0xeb96('0xf'));return db[_0xeb96('0x7')][_0xeb96('0x8')](contacts2);})[_0xeb96('0x9')](function(){console['log'](_0xeb96('0xb'),_0xeb96('0x10'));return db[_0xeb96('0xe')][_0xeb96('0x8')](hopper2);})[_0xeb96('0x9')](function(){console['log'](_0xeb96('0xb'),_0xeb96('0x11'));})[_0xeb96('0x12')](function(_0x5d3352){console[_0xeb96('0xa')](_0x5d3352);}); \ No newline at end of file diff --git a/server/config/seedUsers.js b/server/config/seedUsers.js index ec21e5d..e2743db 100644 --- a/server/config/seedUsers.js +++ b/server/config/seedUsers.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1611=['%s%s@xcally.com','friend','udp','wss','all','yes','/etc/pki/tls/certs/motion.crt','actpass','\x22%s\x22\x20<%s>','User','then','add\x20user','catch','util','push','agent','%s%s','format'];(function(_0x2b0bfe,_0x11f9da){var _0x385d94=function(_0x2e2a9c){while(--_0x2e2a9c){_0x2b0bfe['push'](_0x2b0bfe['shift']());}};_0x385d94(++_0x11f9da);}(_0x1611,0x8b));var _0x1161=function(_0xa3981a,_0x5062bd){_0xa3981a=_0xa3981a-0x0;var _0x3d137e=_0x1611[_0xa3981a];return _0x3d137e;};'use strict';var util=require(_0x1161('0x0'));var db=require('../mysqldb')['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0x1161('0x1')]({'name':util['format']('%s%s',_0x1161('0x2'),i),'fullname':util['format'](_0x1161('0x3'),_0x1161('0x2'),i),'email':util[_0x1161('0x4')](_0x1161('0x5'),_0x1161('0x2'),i),'role':_0x1161('0x2'),'password':'password','internal':0xfa0+i,'type':_0x1161('0x6'),'transport':[_0x1161('0x7'),'ws',_0x1161('0x8')],'disallow':[_0x1161('0x9')],'allow':['ulaw'],'defaultuser':util[_0x1161('0x4')](_0x1161('0x3'),_0x1161('0x2'),i),'encryption':_0x1161('0xa'),'avpf':_0x1161('0xa'),'force_avp':_0x1161('0xa'),'icesupport':'yes','dtlsenable':_0x1161('0xa'),'dtlsverify':'no','dtlscertfile':_0x1161('0xb'),'dtlsprivatekey':'/etc/pki/tls/private/motion.key','dtlssetup':_0x1161('0xc'),'callerid':util[_0x1161('0x4')](_0x1161('0xd'),util[_0x1161('0x4')]('%s%s','agent',i),0xfa0+i)});}db[_0x1161('0xe')]['bulkCreate'](users)[_0x1161('0xf')](function(){console['log'](_0x1161('0x10'));})[_0x1161('0x11')](function(_0x56d11e){console['log'](_0x56d11e);}); \ No newline at end of file +var _0x9743=['add\x20user','catch','util','../mysqldb','agent','format','%s%s','%s%s@xcally.com','password','friend','udp','wss','yes','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','\x22%s\x22\x20<%s>','bulkCreate'];(function(_0x46efd7,_0x43f84d){var _0x5637e4=function(_0x54e078){while(--_0x54e078){_0x46efd7['push'](_0x46efd7['shift']());}};_0x5637e4(++_0x43f84d);}(_0x9743,0xbd));var _0x3974=function(_0x25700d,_0x9f77c6){_0x25700d=_0x25700d-0x0;var _0x10e356=_0x9743[_0x25700d];return _0x10e356;};'use strict';var util=require(_0x3974('0x0'));var db=require(_0x3974('0x1'))['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users['push']({'name':util['format']('%s%s',_0x3974('0x2'),i),'fullname':util[_0x3974('0x3')](_0x3974('0x4'),_0x3974('0x2'),i),'email':util[_0x3974('0x3')](_0x3974('0x5'),'agent',i),'role':_0x3974('0x2'),'password':_0x3974('0x6'),'internal':0xfa0+i,'type':_0x3974('0x7'),'transport':[_0x3974('0x8'),'ws',_0x3974('0x9')],'disallow':['all'],'allow':['ulaw'],'defaultuser':util['format'](_0x3974('0x4'),_0x3974('0x2'),i),'encryption':_0x3974('0xa'),'avpf':_0x3974('0xa'),'force_avp':_0x3974('0xa'),'icesupport':_0x3974('0xa'),'dtlsenable':_0x3974('0xa'),'dtlsverify':'no','dtlscertfile':_0x3974('0xb'),'dtlsprivatekey':_0x3974('0xc'),'dtlssetup':'actpass','callerid':util[_0x3974('0x3')](_0x3974('0xd'),util['format'](_0x3974('0x4'),_0x3974('0x2'),i),0xfa0+i)});}db['User'][_0x3974('0xe')](users)['then'](function(){console['log'](_0x3974('0xf'));})[_0x3974('0x10')](function(_0x14e886){console['log'](_0x14e886);}); \ No newline at end of file diff --git a/server/config/socketio.js b/server/config/socketio.js index 7c0dcf2..db177f8 100644 --- a/server/config/socketio.js +++ b/server/config/socketio.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xdf55=['role','telephone:%s','campaign:%s:%s','leave','removeChatInteractions','emit','user_has_chat_interactions:remove','user_has_mail_interactions:remove','FaxInteractions','removeFaxInteractions','user_has_fax_interactions:remove','SmsInteractions','removeSmsInteractions','user_has_sms_interactions:remove','removeOpenchannelInteractions','removeWhatsappInteractions','user_has_whatsapp_interactions:remove','catch','log','join','default','connection','setMaxListeners','address','remoteAddress','remotePort','connectedAt','SocketIO\x20','disconnect','CONNECTED','lodash','util','../mysqldb','./environment','Agents','User','name','agent','telephone','type','then','autoAssociation','VoiceQueues','SmsQueues','MailQueues','OpenchannelQueues','WhatsappQueues','findAll','Telephones','Trunks','IvrCampaigns','UserProfileResource','resourceId','map','where','Campaign','ivr','format','%s:queue:%s','length','user:%s','handshake','query','userProfileId','ChatInteraction','ChatInteractions','MailInteraction','MailInteractions','FaxInteraction','SmsInteraction','OpenchannelInteraction','OpenchannelInteractions','WhatsappInteractions','admin','voice:inbound','voice:outbound','include','push','VoiceQueue','ChatQueue','FaxQueue','SmsQueue','OpenchannelQueue','WhatsappQueue','user','ChatQueues','FaxQueues','MailQueue','Trunk','getVoiceQueues','getChatQueues','getFaxQueues','getSmsQueues','getMailQueues','getOpenchannelQueues','getWhatsappQueues','all','fax','mail','openchannel','whatsapp'];(function(_0x21d9de,_0x33bbfc){var _0x4c3e8e=function(_0x3a2f07){while(--_0x3a2f07){_0x21d9de['push'](_0x21d9de['shift']());}};_0x4c3e8e(++_0x33bbfc);}(_0xdf55,0x83));var _0x5df5=function(_0x2e748c,_0x55ec8e){_0x2e748c=_0x2e748c-0x0;var _0x37e219=_0xdf55[_0x2e748c];return _0x37e219;};'use strict';var _=require(_0x5df5('0x0'));var util=require(_0x5df5('0x1'));var BPromise=require('bluebird');var db=require(_0x5df5('0x2'))['db'];var config=require(_0x5df5('0x3'));var queryQueues={'attributes':['id','name'],'include':[{'as':_0x5df5('0x4'),'model':db[_0x5df5('0x5')],'attributes':['id',_0x5df5('0x6'),'role'],'raw':!![],'where':{'role':_0x5df5('0x7')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id',_0x5df5('0x6')],'where':{'role':_0x5df5('0x8')}};var queryTrunks={'raw':!![],'attributes':['id',_0x5df5('0x6')]};var queryAgents={'raw':!![],'attributes':['id',_0x5df5('0x6')],'where':{'role':_0x5df5('0x7')}};var queryCampaigns={'raw':!![],'attributes':['id',_0x5df5('0x6'),_0x5df5('0x9')],'where':{'type':'ivr'}};function getAssociatedResources(_0x338f2b,_0x403d8b,_0x41941e){return db['UserProfileSection']['findOne']({'where':{'name':_0x338f2b,'userProfileId':_0x403d8b},'raw':!![]})[_0x5df5('0xa')](function(_0x4e80bd){if(_0x4e80bd){if(_0x4e80bd[_0x5df5('0xb')]){switch(_0x338f2b){case _0x5df5('0xc'):case'ChatQueues':case'FaxQueues':case _0x5df5('0xd'):case _0x5df5('0xe'):case _0x5df5('0xf'):case _0x5df5('0x10'):return db[_0x41941e][_0x5df5('0x11')](queryQueues);case _0x5df5('0x12'):return db[_0x41941e][_0x5df5('0x11')](queryTelephones);case _0x5df5('0x13'):return db[_0x41941e][_0x5df5('0x11')](queryTrunks);case _0x5df5('0x14'):return db[_0x41941e]['findAll'](queryCampaigns);}}else{return db[_0x5df5('0x15')]['findAll']({'attributes':[_0x5df5('0x16')],'where':{'sectionId':_0x4e80bd['id']},'raw':!![]})[_0x5df5('0xa')](function(_0x5b0ad9){if(_0x5b0ad9){var _0x3657c8={'where':{'id':_[_0x5df5('0x17')](_0x5b0ad9,'resourceId')},'raw':!![]};switch(_0x41941e){case _0x5df5('0x5'):_0x3657c8[_0x5df5('0x18')]['role']=_0x5df5('0x8');break;case _0x5df5('0x19'):_0x3657c8[_0x5df5('0x18')][_0x5df5('0x9')]=_0x5df5('0x1a');break;}return db[_0x41941e]['findAll'](_0x3657c8);}else{return[];}});}}else{return[];}})['then'](function(_0x48c824){return _0x48c824;});}function joinOrLeaveQueues(_0x5d8dfd,_0x58152a,_0x40a8f5,_0xa939e4){_0x5d8dfd[_0x58152a](util[_0x5df5('0x1b')](_0x5df5('0x1c'),_0x40a8f5,_0xa939e4['name']));if(_0xa939e4[_0x5df5('0x4')]){for(var _0x39d8a1=0x0;_0x39d8a1<_0xa939e4[_0x5df5('0x4')][_0x5df5('0x1d')];_0x39d8a1+=0x1){_0x5d8dfd[_0x58152a](util[_0x5df5('0x1b')](_0x5df5('0x1e'),_0xa939e4['Agents'][_0x39d8a1][_0x5df5('0x6')]));}}}function joinOrLeave(_0x2e862d,_0x8742a7,_0x446bba){var _0x5ca542;if(_0x2e862d[_0x5df5('0x1f')][_0x5df5('0x20')]['id']){db[_0x5df5('0x5')]['find']({'attributes':['id','name','role',_0x5df5('0x21')],'where':{'id':_0x2e862d[_0x5df5('0x1f')][_0x5df5('0x20')]['id']},'include':[{'model':db[_0x5df5('0x22')],'as':_0x5df5('0x23'),'attributes':['id'],'raw':!![]},{'model':db[_0x5df5('0x24')],'as':_0x5df5('0x25'),'attributes':['id'],'raw':!![]},{'model':db[_0x5df5('0x26')],'as':'FaxInteractions','attributes':['id'],'raw':!![]},{'model':db[_0x5df5('0x27')],'as':'SmsInteractions','attributes':['id'],'raw':!![]},{'model':db[_0x5df5('0x28')],'as':_0x5df5('0x29'),'attributes':['id'],'raw':!![]},{'model':db['WhatsappInteraction'],'as':_0x5df5('0x2a'),'attributes':['id'],'raw':!![]}]})['then'](function(_0xd2b213){if(_0xd2b213){_0x5ca542=_0xd2b213;_0x2e862d[_0x8742a7](util['format'](_0x5df5('0x1e'),_0xd2b213['name']));var _0x309506=[];switch(_0xd2b213['role']){case _0x5df5('0x2b'):_0x2e862d[_0x8742a7](_0x5df5('0x2c'));_0x2e862d[_0x8742a7](_0x5df5('0x2d'));if(queryQueues['hasOwnProperty'](_0x5df5('0x2e'))){delete queryQueues[_0x5df5('0x2e')];}_0x309506[_0x5df5('0x2f')](db[_0x5df5('0x30')][_0x5df5('0x11')](queryQueues));_0x309506[_0x5df5('0x2f')](db[_0x5df5('0x31')]['findAll'](queryQueues));_0x309506['push'](db[_0x5df5('0x32')][_0x5df5('0x11')](queryQueues));_0x309506[_0x5df5('0x2f')](db[_0x5df5('0x33')][_0x5df5('0x11')](queryQueues));_0x309506[_0x5df5('0x2f')](db['MailQueue'][_0x5df5('0x11')](queryQueues));_0x309506[_0x5df5('0x2f')](db[_0x5df5('0x34')][_0x5df5('0x11')](queryQueues));_0x309506['push'](db[_0x5df5('0x35')]['findAll'](queryQueues));_0x309506[_0x5df5('0x2f')](db[_0x5df5('0x5')]['findAll'](queryTelephones));_0x309506[_0x5df5('0x2f')](db['Trunk'][_0x5df5('0x11')](queryTrunks));_0x309506[_0x5df5('0x2f')](db[_0x5df5('0x19')][_0x5df5('0x11')](queryCampaigns));_0x309506['push'](db[_0x5df5('0x5')][_0x5df5('0x11')](queryAgents));break;case _0x5df5('0x36'):_0x2e862d[_0x8742a7](_0x5df5('0x2c'));_0x2e862d[_0x8742a7]('voice:outbound');_0x309506[_0x5df5('0x2f')](getAssociatedResources(_0x5df5('0xc'),_0xd2b213[_0x5df5('0x21')],_0x5df5('0x30')));_0x309506[_0x5df5('0x2f')](getAssociatedResources(_0x5df5('0x37'),_0xd2b213[_0x5df5('0x21')],'ChatQueue'));_0x309506[_0x5df5('0x2f')](getAssociatedResources(_0x5df5('0x38'),_0xd2b213['userProfileId'],_0x5df5('0x32')));_0x309506[_0x5df5('0x2f')](getAssociatedResources('SmsQueues',_0xd2b213[_0x5df5('0x21')],_0x5df5('0x33')));_0x309506[_0x5df5('0x2f')](getAssociatedResources(_0x5df5('0xe'),_0xd2b213[_0x5df5('0x21')],_0x5df5('0x39')));_0x309506[_0x5df5('0x2f')](getAssociatedResources(_0x5df5('0xf'),_0xd2b213['userProfileId'],'OpenchannelQueue'));_0x309506[_0x5df5('0x2f')](getAssociatedResources('WhatsappQueues',_0xd2b213[_0x5df5('0x21')],_0x5df5('0x35')));_0x309506['push'](getAssociatedResources(_0x5df5('0x12'),_0xd2b213[_0x5df5('0x21')],_0x5df5('0x5')));_0x309506[_0x5df5('0x2f')](getAssociatedResources(_0x5df5('0x13'),_0xd2b213[_0x5df5('0x21')],_0x5df5('0x3a')));_0x309506[_0x5df5('0x2f')](getAssociatedResources('IvrCampaigns',_0xd2b213[_0x5df5('0x21')],'Campaign'));_0x309506[_0x5df5('0x2f')](db[_0x5df5('0x5')][_0x5df5('0x11')](queryAgents));break;case _0x5df5('0x7'):_0x2e862d[_0x8742a7](_0x5df5('0x2c'));_0x2e862d[_0x8742a7]('voice:outbound');_0x309506[_0x5df5('0x2f')](_0xd2b213[_0x5df5('0x3b')]({'attributes':['id',_0x5df5('0x6')]}));_0x309506['push'](_0xd2b213[_0x5df5('0x3c')]({'attributes':['id',_0x5df5('0x6')]}));_0x309506['push'](_0xd2b213[_0x5df5('0x3d')]({'attributes':['id',_0x5df5('0x6')]}));_0x309506[_0x5df5('0x2f')](_0xd2b213[_0x5df5('0x3e')]({'attributes':['id','name']}));_0x309506[_0x5df5('0x2f')](_0xd2b213[_0x5df5('0x3f')]({'attributes':['id','name']}));_0x309506[_0x5df5('0x2f')](_0xd2b213[_0x5df5('0x40')]({'attributes':['id',_0x5df5('0x6')]}));_0x309506['push'](_0xd2b213[_0x5df5('0x41')]({'attributes':['id',_0x5df5('0x6')]}));break;}return BPromise[_0x5df5('0x42')](_0x309506);}})[_0x5df5('0xa')](function(_0x50bdf0){if(_0x50bdf0&&_0x50bdf0[_0x5df5('0x1d')]){for(var _0xcdf101=0x0;_0xcdf101<_0x50bdf0[_0x5df5('0x1d')];_0xcdf101+=0x1){for(var _0x3bbb73=0x0;_0x3bbb73<_0x50bdf0[_0xcdf101][_0x5df5('0x1d')];_0x3bbb73+=0x1){switch(_0xcdf101){case 0x0:joinOrLeaveQueues(_0x2e862d,_0x8742a7,'voice',_0x50bdf0[_0xcdf101][_0x3bbb73]);break;case 0x1:joinOrLeaveQueues(_0x2e862d,_0x8742a7,'chat',_0x50bdf0[_0xcdf101][_0x3bbb73]);break;case 0x2:joinOrLeaveQueues(_0x2e862d,_0x8742a7,_0x5df5('0x43'),_0x50bdf0[_0xcdf101][_0x3bbb73]);break;case 0x3:joinOrLeaveQueues(_0x2e862d,_0x8742a7,'sms',_0x50bdf0[_0xcdf101][_0x3bbb73]);break;case 0x4:joinOrLeaveQueues(_0x2e862d,_0x8742a7,_0x5df5('0x44'),_0x50bdf0[_0xcdf101][_0x3bbb73]);break;case 0x5:joinOrLeaveQueues(_0x2e862d,_0x8742a7,_0x5df5('0x45'),_0x50bdf0[_0xcdf101][_0x3bbb73]);break;case 0x6:joinOrLeaveQueues(_0x2e862d,_0x8742a7,_0x5df5('0x46'),_0x50bdf0[_0xcdf101][_0x3bbb73]);break;case 0x7:if(_0x5ca542[_0x5df5('0x47')]!=='agent')_0x2e862d[_0x8742a7](util[_0x5df5('0x1b')](_0x5df5('0x48'),_0x50bdf0[_0xcdf101][_0x3bbb73][_0x5df5('0x6')]));break;case 0x8:if(_0x5ca542[_0x5df5('0x47')]!==_0x5df5('0x7'))_0x2e862d[_0x8742a7](util[_0x5df5('0x1b')]('trunk:%s',_0x50bdf0[_0xcdf101][_0x3bbb73][_0x5df5('0x6')]));break;case 0x9:if(_0x5ca542['role']!==_0x5df5('0x7'))_0x2e862d[_0x8742a7](util[_0x5df5('0x1b')](_0x5df5('0x49'),_0x50bdf0[_0xcdf101][_0x3bbb73]['type'],_0x50bdf0[_0xcdf101][_0x3bbb73][_0x5df5('0x6')]));break;case 0xa:_0x2e862d[_0x8742a7](util['format'](_0x5df5('0x1e'),_0x50bdf0[_0xcdf101][_0x3bbb73]['name']));break;}}}}})[_0x5df5('0xa')](function(){if(_0x8742a7===_0x5df5('0x4a')){var _0x34e4cc=_['map'](_0x5ca542[_0x5df5('0x23')],'id');return _0x5ca542[_0x5df5('0x4b')](_0x34e4cc)['then'](function(){for(var _0x429768=0x0;_0x429768<_0x34e4cc[_0x5df5('0x1d')];_0x429768+=0x1){_0x446bba[_0x5df5('0x4c')](_0x5df5('0x4d'),{'ChatInteractionId':Number(_0x34e4cc[_0x429768]),'UserId':Number(_0x5ca542['id'])});}});}})[_0x5df5('0xa')](function(){if(_0x8742a7===_0x5df5('0x4a')){var _0x16fc86=_['map'](_0x5ca542[_0x5df5('0x25')],'id');return _0x5ca542['removeMailInteractions'](_0x16fc86)[_0x5df5('0xa')](function(){for(var _0x24db09=0x0;_0x24db09<_0x16fc86[_0x5df5('0x1d')];_0x24db09+=0x1){_0x446bba[_0x5df5('0x4c')](_0x5df5('0x4e'),{'MailInteractionId':Number(_0x16fc86[_0x24db09]),'UserId':Number(_0x5ca542['id'])});}});}})[_0x5df5('0xa')](function(){if(_0x8742a7===_0x5df5('0x4a')){var _0x23e5ca=_['map'](_0x5ca542[_0x5df5('0x4f')],'id');return _0x5ca542[_0x5df5('0x50')](_0x23e5ca)[_0x5df5('0xa')](function(){for(var _0x134a28=0x0;_0x134a28<_0x23e5ca[_0x5df5('0x1d')];_0x134a28+=0x1){_0x446bba['emit'](_0x5df5('0x51'),{'FaxInteractionId':Number(_0x23e5ca[_0x134a28]),'UserId':Number(_0x5ca542['id'])});}});}})['then'](function(){if(_0x8742a7==='leave'){var _0x3c05b2=_[_0x5df5('0x17')](_0x5ca542[_0x5df5('0x52')],'id');return _0x5ca542[_0x5df5('0x53')](_0x3c05b2)[_0x5df5('0xa')](function(){for(var _0x1da6bf=0x0;_0x1da6bf<_0x3c05b2['length'];_0x1da6bf+=0x1){_0x446bba[_0x5df5('0x4c')](_0x5df5('0x54'),{'SmsInteractionId':Number(_0x3c05b2[_0x1da6bf]),'UserId':Number(_0x5ca542['id'])});}});}})['then'](function(){if(_0x8742a7==='leave'){var _0x7fdce7=_[_0x5df5('0x17')](_0x5ca542[_0x5df5('0x29')],'id');return _0x5ca542[_0x5df5('0x55')](_0x7fdce7)[_0x5df5('0xa')](function(){for(var _0x6d374=0x0;_0x6d374<_0x7fdce7['length'];_0x6d374+=0x1){_0x446bba['emit']('user_has_openchannel_interactions:remove',{'OpenchannelInteractionId':Number(_0x7fdce7[_0x6d374]),'UserId':Number(_0x5ca542['id'])});}});}})[_0x5df5('0xa')](function(){if(_0x8742a7===_0x5df5('0x4a')){var _0x57e3ea=_[_0x5df5('0x17')](_0x5ca542[_0x5df5('0x2a')],'id');return _0x5ca542[_0x5df5('0x56')](_0x57e3ea)[_0x5df5('0xa')](function(){for(var _0xe99dfd=0x0;_0xe99dfd<_0x57e3ea[_0x5df5('0x1d')];_0xe99dfd+=0x1){_0x446bba[_0x5df5('0x4c')](_0x5df5('0x57'),{'WhatsappInteractionId':Number(_0x57e3ea[_0xe99dfd]),'UserId':Number(_0x5ca542['id'])});}});}})[_0x5df5('0x58')](function(_0x59ecf7){_0x2e862d[_0x5df5('0x59')](_0x59ecf7);});}}function onDisconnect(_0x10286e,_0x113f9e){joinOrLeave(_0x10286e,_0x5df5('0x4a'),_0x113f9e);}function onConnect(_0x2fc9b4){joinOrLeave(_0x2fc9b4,_0x5df5('0x5a'));}exports[_0x5df5('0x5b')]=function(_0x457fb4){_0x457fb4['on'](_0x5df5('0x5c'),function(_0xf3e0ac){_0xf3e0ac[_0x5df5('0x5d')](0x0);_0xf3e0ac[_0x5df5('0x5e')]=_0xf3e0ac['request'][_0x5df5('0x5c')][_0x5df5('0x5f')]+':'+_0xf3e0ac['request'][_0x5df5('0x5c')][_0x5df5('0x60')];_0xf3e0ac[_0x5df5('0x61')]=new Date();_0xf3e0ac[_0x5df5('0x59')]=function(_0x5137fb){console[_0x5df5('0x59')](_0x5df5('0x62')+_0xf3e0ac['nsp']['name']+'['+_0xf3e0ac[_0x5df5('0x5e')]+']',_0x5137fb);};_0xf3e0ac['on'](_0x5df5('0x63'),function(){onDisconnect(_0xf3e0ac,_0x457fb4);_0xf3e0ac[_0x5df5('0x59')]('DISCONNECTED');});onConnect(_0xf3e0ac);_0xf3e0ac['log'](_0x5df5('0x64'));});}; \ No newline at end of file +var _0x0309=['getSmsQueues','getMailQueues','getOpenchannelQueues','all','length','voice','chat','fax','sms','mail','whatsapp','telephone:%s','campaign:%s:%s','leave','map','removeChatInteractions','emit','user_has_chat_interactions:remove','MailInteractions','removeMailInteractions','removeFaxInteractions','user_has_fax_interactions:remove','SmsInteractions','removeSmsInteractions','OpenchannelInteractions','removeWhatsappInteractions','user_has_whatsapp_interactions:remove','catch','join','default','setMaxListeners','address','request','connection','remoteAddress','remotePort','connectedAt','log','SocketIO\x20','disconnect','DISCONNECTED','CONNECTED','lodash','util','bluebird','../mysqldb','./environment','Agents','User','agent','name','type','ivr','UserProfileSection','findOne','then','autoAssociation','ChatQueues','FaxQueues','MailQueues','WhatsappQueues','Telephones','Trunks','findAll','IvrCampaigns','resourceId','role','Campaign','format','%s:queue:%s','user:%s','handshake','query','find','userProfileId','ChatInteraction','MailInteraction','FaxInteraction','FaxInteractions','SmsInteraction','OpenchannelInteraction','WhatsappInteractions','admin','voice:inbound','voice:outbound','include','push','VoiceQueue','SmsQueue','MailQueue','Trunk','user','VoiceQueues','FaxQueue','SmsQueues','OpenchannelQueues','getVoiceQueues','getChatQueues','getFaxQueues'];(function(_0x3286e6,_0x1b1dd2){var _0x5705d7=function(_0x555291){while(--_0x555291){_0x3286e6['push'](_0x3286e6['shift']());}};_0x5705d7(++_0x1b1dd2);}(_0x0309,0x8d));var _0x9030=function(_0x5db9cf,_0x927f87){_0x5db9cf=_0x5db9cf-0x0;var _0x1c5186=_0x0309[_0x5db9cf];return _0x1c5186;};'use strict';var _=require(_0x9030('0x0'));var util=require(_0x9030('0x1'));var BPromise=require(_0x9030('0x2'));var db=require(_0x9030('0x3'))['db'];var config=require(_0x9030('0x4'));var queryQueues={'attributes':['id','name'],'include':[{'as':_0x9030('0x5'),'model':db[_0x9030('0x6')],'attributes':['id','name','role'],'raw':!![],'where':{'role':_0x9030('0x7')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id','name'],'where':{'role':'telephone'}};var queryTrunks={'raw':!![],'attributes':['id','name']};var queryAgents={'raw':!![],'attributes':['id',_0x9030('0x8')],'where':{'role':'agent'}};var queryCampaigns={'raw':!![],'attributes':['id',_0x9030('0x8'),_0x9030('0x9')],'where':{'type':_0x9030('0xa')}};function getAssociatedResources(_0x2eda72,_0x2b33d0,_0x29936b){return db[_0x9030('0xb')][_0x9030('0xc')]({'where':{'name':_0x2eda72,'userProfileId':_0x2b33d0},'raw':!![]})[_0x9030('0xd')](function(_0x56d7cb){if(_0x56d7cb){if(_0x56d7cb[_0x9030('0xe')]){switch(_0x2eda72){case'VoiceQueues':case _0x9030('0xf'):case _0x9030('0x10'):case'SmsQueues':case _0x9030('0x11'):case'OpenchannelQueues':case _0x9030('0x12'):return db[_0x29936b]['findAll'](queryQueues);case _0x9030('0x13'):return db[_0x29936b]['findAll'](queryTelephones);case _0x9030('0x14'):return db[_0x29936b][_0x9030('0x15')](queryTrunks);case _0x9030('0x16'):return db[_0x29936b][_0x9030('0x15')](queryCampaigns);}}else{return db['UserProfileResource']['findAll']({'attributes':['resourceId'],'where':{'sectionId':_0x56d7cb['id']},'raw':!![]})['then'](function(_0x14eb75){if(_0x14eb75){var _0x3b61cc={'where':{'id':_['map'](_0x14eb75,_0x9030('0x17'))},'raw':!![]};switch(_0x29936b){case _0x9030('0x6'):_0x3b61cc['where'][_0x9030('0x18')]='telephone';break;case _0x9030('0x19'):_0x3b61cc['where']['type']=_0x9030('0xa');break;}return db[_0x29936b][_0x9030('0x15')](_0x3b61cc);}else{return[];}});}}else{return[];}})[_0x9030('0xd')](function(_0x3a66f3){return _0x3a66f3;});}function joinOrLeaveQueues(_0x42207a,_0x175e61,_0x3207ad,_0x4a2551){_0x42207a[_0x175e61](util[_0x9030('0x1a')](_0x9030('0x1b'),_0x3207ad,_0x4a2551[_0x9030('0x8')]));if(_0x4a2551[_0x9030('0x5')]){for(var _0x56c9a5=0x0;_0x56c9a5<_0x4a2551[_0x9030('0x5')]['length'];_0x56c9a5+=0x1){_0x42207a[_0x175e61](util['format'](_0x9030('0x1c'),_0x4a2551[_0x9030('0x5')][_0x56c9a5]['name']));}}}function joinOrLeave(_0x23ae15,_0x2c26ed,_0x39fd02){var _0x303885;if(_0x23ae15[_0x9030('0x1d')][_0x9030('0x1e')]['id']){db[_0x9030('0x6')][_0x9030('0x1f')]({'attributes':['id',_0x9030('0x8'),_0x9030('0x18'),_0x9030('0x20')],'where':{'id':_0x23ae15['handshake'][_0x9030('0x1e')]['id']},'include':[{'model':db[_0x9030('0x21')],'as':'ChatInteractions','attributes':['id'],'raw':!![]},{'model':db[_0x9030('0x22')],'as':'MailInteractions','attributes':['id'],'raw':!![]},{'model':db[_0x9030('0x23')],'as':_0x9030('0x24'),'attributes':['id'],'raw':!![]},{'model':db[_0x9030('0x25')],'as':'SmsInteractions','attributes':['id'],'raw':!![]},{'model':db[_0x9030('0x26')],'as':'OpenchannelInteractions','attributes':['id'],'raw':!![]},{'model':db['WhatsappInteraction'],'as':_0x9030('0x27'),'attributes':['id'],'raw':!![]}]})[_0x9030('0xd')](function(_0x1afa08){if(_0x1afa08){_0x303885=_0x1afa08;_0x23ae15[_0x2c26ed](util['format'](_0x9030('0x1c'),_0x1afa08['name']));var _0x494a77=[];switch(_0x1afa08[_0x9030('0x18')]){case _0x9030('0x28'):_0x23ae15[_0x2c26ed](_0x9030('0x29'));_0x23ae15[_0x2c26ed](_0x9030('0x2a'));if(queryQueues['hasOwnProperty'](_0x9030('0x2b'))){delete queryQueues['include'];}_0x494a77[_0x9030('0x2c')](db[_0x9030('0x2d')][_0x9030('0x15')](queryQueues));_0x494a77[_0x9030('0x2c')](db['ChatQueue']['findAll'](queryQueues));_0x494a77[_0x9030('0x2c')](db['FaxQueue'][_0x9030('0x15')](queryQueues));_0x494a77[_0x9030('0x2c')](db[_0x9030('0x2e')][_0x9030('0x15')](queryQueues));_0x494a77[_0x9030('0x2c')](db[_0x9030('0x2f')][_0x9030('0x15')](queryQueues));_0x494a77['push'](db['OpenchannelQueue'][_0x9030('0x15')](queryQueues));_0x494a77[_0x9030('0x2c')](db['WhatsappQueue'][_0x9030('0x15')](queryQueues));_0x494a77[_0x9030('0x2c')](db[_0x9030('0x6')][_0x9030('0x15')](queryTelephones));_0x494a77[_0x9030('0x2c')](db[_0x9030('0x30')][_0x9030('0x15')](queryTrunks));_0x494a77['push'](db[_0x9030('0x19')][_0x9030('0x15')](queryCampaigns));_0x494a77[_0x9030('0x2c')](db['User'][_0x9030('0x15')](queryAgents));break;case _0x9030('0x31'):_0x23ae15[_0x2c26ed](_0x9030('0x29'));_0x23ae15[_0x2c26ed](_0x9030('0x2a'));_0x494a77[_0x9030('0x2c')](getAssociatedResources(_0x9030('0x32'),_0x1afa08['userProfileId'],_0x9030('0x2d')));_0x494a77['push'](getAssociatedResources('ChatQueues',_0x1afa08['userProfileId'],'ChatQueue'));_0x494a77['push'](getAssociatedResources(_0x9030('0x10'),_0x1afa08[_0x9030('0x20')],_0x9030('0x33')));_0x494a77[_0x9030('0x2c')](getAssociatedResources(_0x9030('0x34'),_0x1afa08[_0x9030('0x20')],_0x9030('0x2e')));_0x494a77[_0x9030('0x2c')](getAssociatedResources(_0x9030('0x11'),_0x1afa08[_0x9030('0x20')],'MailQueue'));_0x494a77['push'](getAssociatedResources(_0x9030('0x35'),_0x1afa08[_0x9030('0x20')],'OpenchannelQueue'));_0x494a77[_0x9030('0x2c')](getAssociatedResources(_0x9030('0x12'),_0x1afa08[_0x9030('0x20')],'WhatsappQueue'));_0x494a77[_0x9030('0x2c')](getAssociatedResources(_0x9030('0x13'),_0x1afa08[_0x9030('0x20')],_0x9030('0x6')));_0x494a77[_0x9030('0x2c')](getAssociatedResources(_0x9030('0x14'),_0x1afa08['userProfileId'],_0x9030('0x30')));_0x494a77[_0x9030('0x2c')](getAssociatedResources(_0x9030('0x16'),_0x1afa08[_0x9030('0x20')],'Campaign'));_0x494a77['push'](db[_0x9030('0x6')][_0x9030('0x15')](queryAgents));break;case _0x9030('0x7'):_0x23ae15[_0x2c26ed](_0x9030('0x29'));_0x23ae15[_0x2c26ed](_0x9030('0x2a'));_0x494a77[_0x9030('0x2c')](_0x1afa08[_0x9030('0x36')]({'attributes':['id',_0x9030('0x8')]}));_0x494a77[_0x9030('0x2c')](_0x1afa08[_0x9030('0x37')]({'attributes':['id',_0x9030('0x8')]}));_0x494a77[_0x9030('0x2c')](_0x1afa08[_0x9030('0x38')]({'attributes':['id',_0x9030('0x8')]}));_0x494a77[_0x9030('0x2c')](_0x1afa08[_0x9030('0x39')]({'attributes':['id','name']}));_0x494a77['push'](_0x1afa08[_0x9030('0x3a')]({'attributes':['id','name']}));_0x494a77[_0x9030('0x2c')](_0x1afa08[_0x9030('0x3b')]({'attributes':['id',_0x9030('0x8')]}));_0x494a77[_0x9030('0x2c')](_0x1afa08['getWhatsappQueues']({'attributes':['id',_0x9030('0x8')]}));break;}return BPromise[_0x9030('0x3c')](_0x494a77);}})[_0x9030('0xd')](function(_0x4be75b){if(_0x4be75b&&_0x4be75b[_0x9030('0x3d')]){for(var _0x4038c3=0x0;_0x4038c3<_0x4be75b['length'];_0x4038c3+=0x1){for(var _0x5269ee=0x0;_0x5269ee<_0x4be75b[_0x4038c3]['length'];_0x5269ee+=0x1){switch(_0x4038c3){case 0x0:joinOrLeaveQueues(_0x23ae15,_0x2c26ed,_0x9030('0x3e'),_0x4be75b[_0x4038c3][_0x5269ee]);break;case 0x1:joinOrLeaveQueues(_0x23ae15,_0x2c26ed,_0x9030('0x3f'),_0x4be75b[_0x4038c3][_0x5269ee]);break;case 0x2:joinOrLeaveQueues(_0x23ae15,_0x2c26ed,_0x9030('0x40'),_0x4be75b[_0x4038c3][_0x5269ee]);break;case 0x3:joinOrLeaveQueues(_0x23ae15,_0x2c26ed,_0x9030('0x41'),_0x4be75b[_0x4038c3][_0x5269ee]);break;case 0x4:joinOrLeaveQueues(_0x23ae15,_0x2c26ed,_0x9030('0x42'),_0x4be75b[_0x4038c3][_0x5269ee]);break;case 0x5:joinOrLeaveQueues(_0x23ae15,_0x2c26ed,'openchannel',_0x4be75b[_0x4038c3][_0x5269ee]);break;case 0x6:joinOrLeaveQueues(_0x23ae15,_0x2c26ed,_0x9030('0x43'),_0x4be75b[_0x4038c3][_0x5269ee]);break;case 0x7:if(_0x303885[_0x9030('0x18')]!==_0x9030('0x7'))_0x23ae15[_0x2c26ed](util[_0x9030('0x1a')](_0x9030('0x44'),_0x4be75b[_0x4038c3][_0x5269ee]['name']));break;case 0x8:if(_0x303885[_0x9030('0x18')]!=='agent')_0x23ae15[_0x2c26ed](util[_0x9030('0x1a')]('trunk:%s',_0x4be75b[_0x4038c3][_0x5269ee][_0x9030('0x8')]));break;case 0x9:if(_0x303885[_0x9030('0x18')]!==_0x9030('0x7'))_0x23ae15[_0x2c26ed](util[_0x9030('0x1a')](_0x9030('0x45'),_0x4be75b[_0x4038c3][_0x5269ee]['type'],_0x4be75b[_0x4038c3][_0x5269ee]['name']));break;case 0xa:_0x23ae15[_0x2c26ed](util[_0x9030('0x1a')](_0x9030('0x1c'),_0x4be75b[_0x4038c3][_0x5269ee][_0x9030('0x8')]));break;}}}}})[_0x9030('0xd')](function(){if(_0x2c26ed===_0x9030('0x46')){var _0x587e6a=_[_0x9030('0x47')](_0x303885['ChatInteractions'],'id');return _0x303885[_0x9030('0x48')](_0x587e6a)[_0x9030('0xd')](function(){for(var _0x5739ac=0x0;_0x5739ac<_0x587e6a['length'];_0x5739ac+=0x1){_0x39fd02[_0x9030('0x49')](_0x9030('0x4a'),{'ChatInteractionId':Number(_0x587e6a[_0x5739ac]),'UserId':Number(_0x303885['id'])});}});}})[_0x9030('0xd')](function(){if(_0x2c26ed===_0x9030('0x46')){var _0x1b762e=_[_0x9030('0x47')](_0x303885[_0x9030('0x4b')],'id');return _0x303885[_0x9030('0x4c')](_0x1b762e)[_0x9030('0xd')](function(){for(var _0x5c030b=0x0;_0x5c030b<_0x1b762e[_0x9030('0x3d')];_0x5c030b+=0x1){_0x39fd02[_0x9030('0x49')]('user_has_mail_interactions:remove',{'MailInteractionId':Number(_0x1b762e[_0x5c030b]),'UserId':Number(_0x303885['id'])});}});}})[_0x9030('0xd')](function(){if(_0x2c26ed===_0x9030('0x46')){var _0x4acda3=_['map'](_0x303885[_0x9030('0x24')],'id');return _0x303885[_0x9030('0x4d')](_0x4acda3)[_0x9030('0xd')](function(){for(var _0x303811=0x0;_0x303811<_0x4acda3[_0x9030('0x3d')];_0x303811+=0x1){_0x39fd02[_0x9030('0x49')](_0x9030('0x4e'),{'FaxInteractionId':Number(_0x4acda3[_0x303811]),'UserId':Number(_0x303885['id'])});}});}})['then'](function(){if(_0x2c26ed===_0x9030('0x46')){var _0x4444d7=_['map'](_0x303885[_0x9030('0x4f')],'id');return _0x303885[_0x9030('0x50')](_0x4444d7)[_0x9030('0xd')](function(){for(var _0x5cd453=0x0;_0x5cd453<_0x4444d7[_0x9030('0x3d')];_0x5cd453+=0x1){_0x39fd02['emit']('user_has_sms_interactions:remove',{'SmsInteractionId':Number(_0x4444d7[_0x5cd453]),'UserId':Number(_0x303885['id'])});}});}})['then'](function(){if(_0x2c26ed==='leave'){var _0x595e04=_[_0x9030('0x47')](_0x303885[_0x9030('0x51')],'id');return _0x303885['removeOpenchannelInteractions'](_0x595e04)[_0x9030('0xd')](function(){for(var _0x444b76=0x0;_0x444b76<_0x595e04[_0x9030('0x3d')];_0x444b76+=0x1){_0x39fd02[_0x9030('0x49')]('user_has_openchannel_interactions:remove',{'OpenchannelInteractionId':Number(_0x595e04[_0x444b76]),'UserId':Number(_0x303885['id'])});}});}})[_0x9030('0xd')](function(){if(_0x2c26ed==='leave'){var _0x919d6f=_[_0x9030('0x47')](_0x303885[_0x9030('0x27')],'id');return _0x303885[_0x9030('0x52')](_0x919d6f)[_0x9030('0xd')](function(){for(var _0x1935fc=0x0;_0x1935fc<_0x919d6f[_0x9030('0x3d')];_0x1935fc+=0x1){_0x39fd02[_0x9030('0x49')](_0x9030('0x53'),{'WhatsappInteractionId':Number(_0x919d6f[_0x1935fc]),'UserId':Number(_0x303885['id'])});}});}})[_0x9030('0x54')](function(_0x2ffd14){_0x23ae15['log'](_0x2ffd14);});}}function onDisconnect(_0x2f1970,_0x3d75fb){joinOrLeave(_0x2f1970,_0x9030('0x46'),_0x3d75fb);}function onConnect(_0x1d8f45){joinOrLeave(_0x1d8f45,_0x9030('0x55'));}exports[_0x9030('0x56')]=function(_0x607792){_0x607792['on']('connection',function(_0x2b0220){_0x2b0220[_0x9030('0x57')](0x0);_0x2b0220[_0x9030('0x58')]=_0x2b0220[_0x9030('0x59')][_0x9030('0x5a')][_0x9030('0x5b')]+':'+_0x2b0220[_0x9030('0x59')][_0x9030('0x5a')][_0x9030('0x5c')];_0x2b0220[_0x9030('0x5d')]=new Date();_0x2b0220[_0x9030('0x5e')]=function(_0x103561){console['log'](_0x9030('0x5f')+_0x2b0220['nsp']['name']+'['+_0x2b0220[_0x9030('0x58')]+']',_0x103561);};_0x2b0220['on'](_0x9030('0x60'),function(){onDisconnect(_0x2b0220,_0x607792);_0x2b0220[_0x9030('0x5e')](_0x9030('0x61'));});onConnect(_0x2b0220);_0x2b0220[_0x9030('0x5e')](_0x9030('0x62'));});}; \ No newline at end of file diff --git a/server/config/triggers/index.js b/server/config/triggers/index.js index d535fe1..24088a9 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 _0x79d0=['MailInteraction','Mail','substatus','MailMessage','Openchannel','OpenchannelMessage','request','EventManager','then','info','Trigger,\x20%s','error','code','catch','get','channel','motionChannel','direction','ContactId','query','Sequelize','QueryTypes','SELECT','contact','find','name','email','interface','format','SIP/%s','agent','incomingmessage','event','opened','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','changed','closed','UserId','fullname','User','internal','default','hasOwnProperty','model','toLowerCase','condition','jayson/promise','triggers','lodash','Chat','ChatInteraction','newinteraction','closedinteraction','ChatMessage','afterCreate','newmessage','Sms','SmsInteraction','Whatsapp','WhatsappInteraction','afterUpdate','WhatsappMessage','Fax','FaxInteraction','FaxMessage'];(function(_0x16d10f,_0x2ba2d5){var _0x50c823=function(_0x44e43f){while(--_0x44e43f){_0x16d10f['push'](_0x16d10f['shift']());}};_0x50c823(++_0x2ba2d5);}(_0x79d0,0xb3));var _0x079d=function(_0x465a0c,_0x19d4d5){_0x465a0c=_0x465a0c-0x0;var _0x1e202e=_0x79d0[_0x465a0c];return _0x1e202e;};'use strict';var util=require('util');var db=require('../../mysqldb')['db'];var jayson=require(_0x079d('0x0'));var logger=require('../logger')(_0x079d('0x1'));var _=require(_0x079d('0x2'));var client=jayson['client']['http']({'port':0x232a});var triggers=[{'channel':_0x079d('0x3'),'model':_0x079d('0x4'),'event':'afterCreate','condition':_0x079d('0x5'),'callback':afterCreate},{'channel':_0x079d('0x3'),'model':_0x079d('0x4'),'event':'afterUpdate','condition':_0x079d('0x6'),'callback':afterUpdate},{'channel':_0x079d('0x3'),'model':_0x079d('0x7'),'event':_0x079d('0x8'),'condition':_0x079d('0x9'),'callback':afterCreateMessage},{'channel':_0x079d('0xa'),'model':_0x079d('0xb'),'event':'afterCreate','condition':_0x079d('0x5'),'callback':afterCreate},{'channel':'Sms','model':_0x079d('0xb'),'event':'afterUpdate','condition':'closedinteraction','callback':afterUpdate},{'channel':'Sms','model':'SmsMessage','event':_0x079d('0x8'),'condition':_0x079d('0x9'),'callback':afterCreateMessage},{'channel':_0x079d('0xc'),'model':_0x079d('0xd'),'event':_0x079d('0x8'),'condition':_0x079d('0x5'),'callback':afterCreate},{'channel':_0x079d('0xc'),'model':_0x079d('0xd'),'event':_0x079d('0xe'),'condition':_0x079d('0x6'),'callback':afterUpdate},{'channel':_0x079d('0xc'),'model':_0x079d('0xf'),'event':_0x079d('0x8'),'condition':_0x079d('0x9'),'callback':afterCreateMessage},{'channel':_0x079d('0x10'),'model':_0x079d('0x11'),'event':_0x079d('0x8'),'condition':_0x079d('0x5'),'callback':afterCreate},{'channel':'Fax','model':'FaxInteraction','event':_0x079d('0xe'),'condition':_0x079d('0x6'),'callback':afterUpdate},{'channel':_0x079d('0x10'),'model':_0x079d('0x12'),'event':_0x079d('0x8'),'condition':_0x079d('0x9'),'callback':afterCreateMessage},{'channel':'Mail','model':_0x079d('0x13'),'event':_0x079d('0x8'),'condition':_0x079d('0x5'),'callback':afterCreate},{'channel':_0x079d('0x14'),'model':_0x079d('0x13'),'event':'afterUpdate','condition':_0x079d('0x6'),'callback':afterUpdate},{'channel':_0x079d('0x14'),'model':_0x079d('0x13'),'event':'substatus','condition':_0x079d('0x15'),'callback':afterUpdate},{'channel':'Mail','model':_0x079d('0x16'),'event':_0x079d('0x8'),'condition':_0x079d('0x9'),'callback':afterCreateMessage},{'channel':_0x079d('0x17'),'model':'OpenchannelInteraction','event':_0x079d('0x8'),'condition':_0x079d('0x5'),'callback':afterCreate},{'channel':_0x079d('0x17'),'model':'OpenchannelInteraction','event':_0x079d('0xe'),'condition':_0x079d('0x6'),'callback':afterUpdate},{'channel':'Openchannel','model':_0x079d('0x18'),'event':_0x079d('0x8'),'condition':_0x079d('0x9'),'callback':afterCreateMessage}];function request(_0x536aeb){return client[_0x079d('0x19')](_0x079d('0x1a'),_0x536aeb)[_0x079d('0x1b')](function(_0x376fe5){logger[_0x079d('0x1c')](_0x079d('0x1d'),_0x079d('0x1a'),_0x376fe5);if(_0x376fe5[_0x079d('0x1e')]){if(_0x376fe5[_0x079d('0x1e')][_0x079d('0x1f')]===0x1f4){logger[_0x079d('0x1e')](_0x079d('0x1d'),_0x079d('0x1a'),_0x376fe5[_0x079d('0x1e')]);}}})[_0x079d('0x20')](function(_0x3da9ad){logger[_0x079d('0x1e')](_0x079d('0x1d'),'EventManager',_0x3da9ad);});}function afterCreateMessage(_0x3e5b03,_0x4f851f){return function(_0x2058e3,_0x2c1670){_0x2058e3=_0x2058e3[_0x079d('0x21')]({'plain':!![]});_0x2058e3[_0x079d('0x22')]=_0x3e5b03;_0x2058e3[_0x079d('0x23')]=_0x3e5b03;_0x2058e3['event']=_0x2058e3[_0x079d('0x24')];var _0x462a69='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x2058e3[_0x079d('0x25')];return db['sequelize'][_0x079d('0x26')](_0x462a69,{'type':db[_0x079d('0x27')][_0x079d('0x28')][_0x079d('0x29')],'raw':!![]})['then'](function(_0x33c311){return _0x33c311;})['then'](function(_0x4391f7){if(_0x4391f7){_0x2058e3[_0x079d('0x2a')]=_0x4391f7[0x0];}if(_0x2058e3['UserId']){return db['User'][_0x079d('0x2b')]({'where':{'id':_0x2058e3['UserId']},'attributes':['id',_0x079d('0x2c'),'fullname',_0x079d('0x2d'),'internal'],'raw':!![]})['then'](function(_0x201a70){_0x2058e3[_0x079d('0x2e')]=util[_0x079d('0x2f')](_0x079d('0x30'),_0x201a70[_0x079d('0x2c')]);_0x2058e3['channel']=_0x3e5b03;_0x2058e3[_0x079d('0x31')]=_0x201a70;return request({'event':_0x079d('0x32'),'message':_0x2058e3});})['catch'](function(_0x279248){console[_0x079d('0x1e')](_0x279248);});}else{return request({'event':'outgoingmessage','message':_0x2058e3});}});};}function afterCreate(_0x58ac3d,_0x1fa1da){return function(_0x2e1e39,_0x4065c8){_0x2e1e39=_0x2e1e39[_0x079d('0x21')]({'plain':!![]});_0x2e1e39['channel']=_0x58ac3d;_0x2e1e39[_0x079d('0x23')]=_0x58ac3d;_0x2e1e39[_0x079d('0x33')]=_0x079d('0x34');var _0x302027=_0x079d('0x35')+_0x2e1e39[_0x079d('0x25')];return db[_0x079d('0x36')][_0x079d('0x26')](_0x302027,{'type':db[_0x079d('0x27')][_0x079d('0x28')]['SELECT'],'raw':!![]})[_0x079d('0x1b')](function(_0x54867f){return _0x54867f;})['then'](function(_0x5c40f6){if(_0x5c40f6){_0x2e1e39[_0x079d('0x2a')]=_0x5c40f6[0x0];}return request({'event':_0x1fa1da,'message':_0x2e1e39});});};}function afterUpdate(_0x22c916,_0x152e97){return function(_0xa35e9,_0x32f806){if(_0xa35e9[_0x079d('0x37')]('closed')&&_0xa35e9['closed']){_0xa35e9=_0xa35e9[_0x079d('0x21')]({'plain':!![]});_0xa35e9['channel']=_0x22c916;_0xa35e9[_0x079d('0x23')]=_0x22c916;_0xa35e9[_0x079d('0x33')]=_0x079d('0x38');var _0x73a71c=_0x079d('0x35')+_0xa35e9[_0x079d('0x25')];return db[_0x079d('0x36')][_0x079d('0x26')](_0x73a71c,{'type':db[_0x079d('0x27')][_0x079d('0x28')]['SELECT'],'raw':!![]})[_0x079d('0x1b')](function(_0x2e2402){return _0x2e2402;})[_0x079d('0x1b')](function(_0x59e2ac){if(_0x59e2ac){_0xa35e9[_0x079d('0x2a')]=_0x59e2ac[0x0];}if(_0xa35e9[_0x079d('0x39')]){return db['User'][_0x079d('0x2b')]({'where':{'id':_0xa35e9[_0x079d('0x39')]},'attributes':['id','name',_0x079d('0x3a'),_0x079d('0x2d'),'internal'],'raw':!![]})[_0x079d('0x1b')](function(_0x4ad591){_0xa35e9[_0x079d('0x2e')]=util[_0x079d('0x2f')](_0x079d('0x30'),_0x4ad591[_0x079d('0x2c')]);_0xa35e9[_0x079d('0x31')]=_0x4ad591;return request({'event':_0x152e97,'message':_0xa35e9});})[_0x079d('0x20')](function(_0x1eaaf5){console[_0x079d('0x1e')](_0x1eaaf5);});}else{return request({'event':_0x152e97,'message':_0xa35e9});}});}else if(_0xa35e9[_0x079d('0x37')](_0x079d('0x15'))){_0xa35e9=_0xa35e9['get']({'plain':!![]});_0xa35e9[_0x079d('0x22')]=_0x22c916;_0xa35e9[_0x079d('0x33')]=_0x079d('0x15');var _0x73a71c=_0x079d('0x35')+_0xa35e9['ContactId'];return db['sequelize'][_0x079d('0x26')](_0x73a71c,{'type':db[_0x079d('0x27')]['QueryTypes'][_0x079d('0x29')],'raw':!![]})[_0x079d('0x1b')](function(_0xdb73b7){return _0xdb73b7;})['then'](function(_0x5383d0){if(_0x5383d0){_0xa35e9['contact']=_0x5383d0[0x0];}if(_0xa35e9['UserId']){return db[_0x079d('0x3b')][_0x079d('0x2b')]({'where':{'id':_0xa35e9[_0x079d('0x39')]},'attributes':['id','name',_0x079d('0x3a'),_0x079d('0x2d'),_0x079d('0x3c')],'raw':!![]})['then'](function(_0x22dfb2){_0xa35e9[_0x079d('0x2e')]=util['format'](_0x079d('0x30'),_0x22dfb2[_0x079d('0x2c')]);_0xa35e9['agent']=_0x22dfb2;return request({'event':_0x152e97,'message':_0xa35e9});})[_0x079d('0x20')](function(_0x242e05){console[_0x079d('0x1e')](_0x242e05);});}else{return request({'event':_0x152e97,'message':_0xa35e9});}});}};}exports[_0x079d('0x3d')]=function(){for(var _0x2a594b=0x0;_0x2a594b=_0x329354[_0x3e35('0x13')]){throw Error(_0x3e35('0x14'));}_0x55bf59(_0x542731);})['catch'](function(_0x53efb1){_0x39bb5f(_0x53efb1);});});}; \ No newline at end of file +var _0x616e=['agent','User','then','agents','Maximum\x20login\x20has\x20been\x20reached','lodash','../mysqldb','voice','mail','chat','fax','sms','getChannels','isValidChannel','includes','clearBlockUser','isUndefined','blockedAt','updateAttributes','getLicense','role'];(function(_0x257017,_0x330627){var _0x38536d=function(_0xdf92e){while(--_0xdf92e){_0x257017['push'](_0x257017['shift']());}};_0x38536d(++_0x330627);}(_0x616e,0xec));var _0xe616=function(_0x416cdc,_0x213b87){_0x416cdc=_0x416cdc-0x0;var _0x1931ce=_0x616e[_0x416cdc];return _0x1931ce;};'use strict';var _=require(_0xe616('0x0'));var BPromise=require('bluebird');var db=require(_0xe616('0x1'))['db'];var util=require('./license/util');var channels=[_0xe616('0x2'),_0xe616('0x3'),_0xe616('0x4'),_0xe616('0x5'),_0xe616('0x6'),'whatsapp','openchannel'];exports[_0xe616('0x7')]=function(){return channels;};exports[_0xe616('0x8')]=function(_0x1b907d){_0x1b907d=_0x1b907d['toLowerCase']();return _[_0xe616('0x9')](channels,_0x1b907d);};exports[_0xe616('0xa')]=function(_0x4148a7,_0x49f0dd,_0x1b164f,_0x1c62e4){var _0x1fde2c={'loginAttempts':_0x49f0dd,'blocked':_0x1b164f};if(!_[_0xe616('0xb')](_0x1c62e4)){_0x1fde2c[_0xe616('0xc')]=_0x1c62e4;}return _0x4148a7[_0xe616('0xd')](_0x1fde2c);};exports[_0xe616('0xe')]=function(_0x531a09){return new BPromise(function(_0x50a891,_0x3acbb0){var _0xd33578=0x0;if(_0x531a09[_0xe616('0xf')]!==_0xe616('0x10')){_0x50a891(_0x531a09);}db[_0xe616('0x11')]['count']({'where':{'role':_0xe616('0x10'),'online':!![],'id':{'$ne':_0x531a09['id']}}})[_0xe616('0x12')](function(_0x382902){_0xd33578=_0x382902;return util[_0xe616('0xe')]();})[_0xe616('0x12')](function(_0x4e582e){if(_0x4e582e&&_0x4e582e[_0xe616('0x13')]&&_0xd33578>=_0x4e582e[_0xe616('0x13')]){throw Error(_0xe616('0x14'));}_0x50a891(_0x531a09);})['catch'](function(_0x5c5fcf){_0x3acbb0(_0x5c5fcf);});});}; \ No newline at end of file diff --git a/server/errors/index.js b/server/errors/index.js index 18a7a28..7de7879 100644 --- a/server/errors/index.js +++ b/server/errors/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x88ea=['exports','404','status','render','json','send'];(function(_0xd5906e,_0x536ade){var _0x441a7f=function(_0x595ce2){while(--_0x595ce2){_0xd5906e['push'](_0xd5906e['shift']());}};_0x441a7f(++_0x536ade);}(_0x88ea,0x1ec));var _0xa88e=function(_0x181ef7,_0x1145f2){_0x181ef7=_0x181ef7-0x0;var _0x56169e=_0x88ea[_0x181ef7];return _0x56169e;};'use strict';module[_0xa88e('0x0')][0x194]=function pageNotFound(_0x14ba68,_0x54314a){var _0x5b6336=_0xa88e('0x1');var _0x4aa09e=0x194;var _0x172fd1={'status':_0x4aa09e};_0x54314a['status'](_0x172fd1[_0xa88e('0x2')]);_0x54314a[_0xa88e('0x3')](_0x5b6336,{},function(_0x548fba,_0x169488){if(_0x548fba){return _0x54314a['status'](_0x172fd1['status'])[_0xa88e('0x4')](_0x172fd1);}_0x54314a[_0xa88e('0x5')](_0x169488);});}; \ No newline at end of file +var _0x0523=['json','exports','404','status','render'];(function(_0x5d320c,_0x5cb9f4){var _0x54588f=function(_0x4c0e5a){while(--_0x4c0e5a){_0x5d320c['push'](_0x5d320c['shift']());}};_0x54588f(++_0x5cb9f4);}(_0x0523,0xfb));var _0x3052=function(_0x1ae196,_0x3b0503){_0x1ae196=_0x1ae196-0x0;var _0x4d5933=_0x0523[_0x1ae196];return _0x4d5933;};'use strict';module[_0x3052('0x0')][0x194]=function pageNotFound(_0x303201,_0xda33e0){var _0x573f53=_0x3052('0x1');var _0x51022c=0x194;var _0x3b09df={'status':_0x51022c};_0xda33e0[_0x3052('0x2')](_0x3b09df[_0x3052('0x2')]);_0xda33e0[_0x3052('0x3')](_0x573f53,{},function(_0x5a816e,_0x5a86b3){if(_0x5a816e){return _0xda33e0[_0x3052('0x2')](_0x3b09df[_0x3052('0x2')])[_0x3052('0x4')](_0x3b09df);}_0xda33e0['send'](_0x5a86b3);});}; \ No newline at end of file diff --git a/server/mysqldb/index.js b/server/mysqldb/index.js index 92274b9..6e3eaf8 100644 --- a/server/mysqldb/index.js +++ b/server/mysqldb/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4483=['../api/smsInteraction/smsInteraction.model','SmsMessage','../api/smsMessage/smsMessage.model','SmsQueue','OpenchannelAccount','../api/openchannelAccount/openchannelAccount.model','../api/openchannelApplication/openchannelApplication.model','OpenchannelInteraction','../api/openchannelInteraction/openchannelInteraction.model','../api/chatWebsite/chatWebsite.model','OpenchannelQueueReport','../api/openchannelQueueReport/openchannelQueueReport.model','../api/chatApplication/chatApplication.model','ChatInteraction','../api/chatInteraction/chatInteraction.model','ChatOfflineMessage','../api/chatOfflineMessage/chatOfflineMessage.model','ChatQueue','../api/chatQueue/chatQueue.model','ChatGroup','ChatProactiveAction','../api/chatProactiveAction/chatProactiveAction.model','CmCompany','../api/cmCompany/cmCompany.model','../api/cmContact/cmContact.model','CmHopper','CmHopperBlack','CmHopperFinal','../api/cmHopperFinal/cmHopperFinal.model','CmHopperHistory','../api/cmHopperHistory/cmHopperHistory.model','ReportAgentPreview','../api/reportAgentPreview/reportAgentPreview.model','CmCustomField','../api/cmCustomField/cmCustomField.model','Action','../api/action/action.model','../api/automation/automation.model','CannedAnswer','../api/cannedAnswer/cannedAnswer.model','../api/interval/interval.model','Pause','../api/pause/pause.model','Cdr','../api/cdr/cdr.model','VoiceQueuesLog','Schedule','../api/schedule/schedule.model','Sound','../api/sound/sound.model','Tag','../api/tag/tag.model','../api/template/template.model','../api/trigger/trigger.model','../api/variable/variable.model','Integration','../api/integration/integration.model','../api/integrationReport/integrationReport.model','AnalyticCustomReport','../api/analyticCustomReport/analyticCustomReport.model','../api/analyticDefaultReport/analyticDefaultReport.model','AnalyticExtractedReport','../api/analyticExtractedReport/analyticExtractedReport.model','AnalyticMetric','../api/analyticMetric/analyticMetric.model','AnalyticFieldReport','../api/analyticFieldReport/analyticFieldReport.model','AnalyticTreeReport','SalesforceAccount','../api/intSalesforceAccount/intSalesforceAccount.model','../api/intSalesforceConfiguration/intSalesforceConfiguration.model','SalesforceField','../api/intSalesforceField/intSalesforceField.model','../api/intSugarcrmAccount/intSugarcrmAccount.model','../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model','DeskAccount','DeskConfiguration','DeskField','../api/intDeskField/intDeskField.model','ZohoAccount','../api/intZohoAccount/intZohoAccount.model','ZohoConfiguration','../api/intZohoConfiguration/intZohoConfiguration.model','../api/intZohoField/intZohoField.model','ZendeskAccount','../api/intZendeskAccount/intZendeskAccount.model','ZendeskConfiguration','../api/intZendeskField/intZendeskField.model','FreshdeskAccount','../api/intFreshdeskAccount/intFreshdeskAccount.model','FreshdeskConfiguration','../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model','FreshdeskField','../api/intFreshdeskField/intFreshdeskField.model','VtigerAccount','../api/intVtigerAccount/intVtigerAccount.model','../api/intVtigerConfiguration/intVtigerConfiguration.model','../api/intVtigerField/intVtigerField.model','ServicenowAccount','ServicenowConfiguration','ServicenowField','../api/intServicenowField/intServicenowField.model','../api/intDynamics365Configuration/intDynamics365Configuration.model','../api/intDynamics365Field/intDynamics365Field.model','FreshsalesAccount','../api/intFreshsalesAccount/intFreshsalesAccount.model','../api/intFreshsalesField/intFreshsalesField.model','Network','ChatQueueReport','ChatInternalMessage','../api/jscriptyAnswerReport/jscriptyAnswerReport.model','../api/jscriptySessionReport/jscriptySessionReport.model','SmsQueueReport','../api/smsQueueReport/smsQueueReport.model','SquareReport','SquareDetailsReport','JscriptyProject','../api/jscriptyProject/jscriptyProject.model','Setting','../api/setting/setting.model','SquareOdbc','../api/squareOdbc/squareOdbc.model','SquareProject','../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','Migration','../api/migration/migration.model','Attachment','Plugin','../api/plugin/plugin.model','../api/mailTransferReport/mailTransferReport.model','../api/chatTransferReport/chatTransferReport.model','FaxTransferReport','../api/faxTransferReport/faxTransferReport.model','OpenchannelTransferReport','../api/openchannelTransferReport/openchannelTransferReport.model','../api/smsTransferReport/smsTransferReport.model','CmList','../api/cmList/cmList.model','VoicePrefix','../api/voicePrefix/voicePrefix.model','../api/userProfile/userProfile.model','../api/userProfileSection/userProfileSection.model','UserProfileResource','../api/userProfileResource/userProfileResource.model','UserNotification','../api/userNotification/userNotification.model','WhatsappAccount','../api/whatsappApplication/whatsappApplication.model','../api/whatsappInteraction/whatsappInteraction.model','WhatsappMessage','../api/whatsappMessage/whatsappMessage.model','WhatsappQueueReport','../api/whatsappQueueReport/whatsappQueueReport.model','WhatsappTransferReport','../api/whatsappTransferReport/whatsappTransferReport.model','WhatsappQueue','../api/whatsappQueue/whatsappQueue.model','CloudProvider','../api/cloudProvider/cloudProvider.model','TeamVoiceQueue','../api/teamVoicePrefix/teamVoicePrefix.model','../api/userVoicePrefix/userVoicePrefix.model','cascade','UserId','hasMany','Recordings','VoiceQueuesRt','VoiceExtension','HopperFinals','HopperHistory','OpenchannelInteractions','ChatInteractions','SmsInteraction','SmsInteractions','FaxInteractions','MailInteractions','WhatsappInteraction','WhatsappInteractions','SenderId','belongsTo','UserProfile','userProfileId','belongsToMany','chat_group_has_users','CmContact','Contacts','cm_user_has_contacts','Lists','cm_user_has_lists','user_has_teams','user_has_mail_interactions','user_has_chat_interactions','user_has_sms_interactions','user_has_openchannel_interactions','UserVoiceQueue','VoicePrefixes','MailQueues','UserMailQueue','ChatQueues','FaxQueues','SmsQueues','OpenchannelQueue','OpenchannelQueues','WhatsappQueues','ChatWebsite','ChatWebsites','FaxAccounts','user_has_fax_accounts','MailAccounts','user_has_mail_accounts','OpenchannelAccounts','user_has_openchannel_accounts','SmsAccounts','user_has_sms_accounts','WhatsappAccounts','user_has_whatsapp_accounts','SquareProjects','user_has_square_projects','SpiedAgents','ChanSpyId','Applications','Sounds','moh_has_sounds','Members','Hoppers','VoiceQueueId','HopperHistories','JscriptySessionReport','JscriptySessions','TrunkId','TrunkBackup','TrunkBackupId','Interval','IntervalId','voice_queues_has_cm_lists','Agents','Teams','BlackLists','Messages','mailboxuser','mailbox','QueueCalls','uniqueid','AgentReports','ContactId','MailAccountId','hasOne','Imap','Smtp','Dispositions','List','ListId','Template','TemplateId','mandatoryDispositionPauseId','MailInteractionId','Account','Owner','mail_interaction_has_tags','ThroughTags','Contact','Interaction','ChatWebsiteId','ChatOfflineMessageId','restrict','Dashboard','Items','Disposition','FaxAccountId','Answers','Interactions','FaxApplication','mandatoryDispositionPause','TagId','FaxInteractionId','Tags','fax_interaction_has_tags','user_has_fax_interactions','team_has_fax_queues','FaxQueueReport','SmsAccountId','sms_interaction_has_tags','Users','SmsInteractionId','team_has_sms_queues','OpenchannelAccountId','OpenchannelMessage','OpenchannelApplication','OpenchannelInteractionId','openchannel_interaction_has_tags','AttachmentId','OpenchannelQueueId','team_has_openchannel_queues','ProactiveActions','ChatMessage','user_has_chat_websites','ChatApplication','Agent','Website','ChatInteractionId','chat_interaction_has_tags','UserChatQueue','team_has_chat_queues','CompanyId','Company','cm_contact_has_tags','Queue','CampaignId','OwnerId','Automation','Condition','All','OneAll','AutomationAllId','AutomationAnyId','Actions','ParentId','Intervals','Extensions','MailApplications','ChatApplications','SmsApplications','AnalyticDefaultReport','DefaultReportId','CustomReportId','Mohs','whatsapp_interaction_has_tags','Trigger','AllConditions','AllCondition','TriggerAllId','AnyConditions','AnyCondition','TriggerId','Fields','MetricId','Configurations','AccountId','Subjects','SubjectId','SalesforceConfiguration','Descriptions','DescriptionId','Description','Field','FieldId','Variable','VariableId','SugarcrmConfiguration','SugarcrmField','SugarcrmAccount','int_desk_configuration_has_tags','Subject','ZohoField','ZendeskField','int_zendesk_configuration_has_tags','int_freshdesk_configuration_has_tags','VtigerConfiguration','VtigerField','Dynamics365Account','Dynamics365Configuration','Dynamics365Field','FreshsalesConfiguration','FreshsalesField','FromId','ToId','JscriptyQuestionReport','SessionId','JscriptyAnswerReport','ProjectId','VoiceQueues','team_has_whatsapp_queues','TeamVoicePrefix','HopperBlacks','campaigns_has_cm_lists','MailTransferReport','FromAgent','ToUserId','ToAgent','ToMailQueueId','ToMailAccountId','ChatTransferReport','FromUserId','ToChatQueueId','ToChatWebsiteId','ToAccount','FromFaxAccountId','FromAccount','ToFaxQueueId','ToQueue','ToFaxAccountId','FromOpenchannelAccountId','ToOpenchannelQueueId','SmsTransferReport','FromSmsAccountId','ToSmsQueueId','ToSmsAccountId','UserVoicePrefix','UserProfileSection','UserProfileSections','Resources','sectionId','WhatsappAccountId','WhatsappApplication','user_has_whatsapp_interactions','WhatsappInteractionId','FromWhatsappAccountId','ToWhatsappAccountId','ToQueueId','../config/environment','sequelize','lodash','determine','defaultsDeep','motion2','xC@LL1234','127.0.0.1','mysql','utf8mb4','name','utf8','utf8_general_ci','sequelizeHistory','xcall','database','password','options','username','User','import','../api/user/user.model','VoiceChanSpy','../api/voiceChanSpy/voiceChanSpy.model','VoiceContext','../api/voiceContext/voiceContext.model','../api/voiceExtension/voiceExtension.model','VoiceMusicOnHold','../api/voiceMusicOnHold/voiceMusicOnHold.model','VoiceQueue','../api/voiceQueue/voiceQueue.model','VoiceRecording','ScreenRecording','VoiceMail','../api/voiceMail/voiceMail.model','VoiceMailMessage','../api/voiceMailMessage/voiceMailMessage.model','VoiceCallReport','VoiceDialReport','../api/voiceDialReport/voiceDialReport.model','VoiceAgentReport','../api/voiceAgentReport/voiceAgentReport.model','VoiceQueueReport','MemberReport','Trunk','VoiceTransferReport','UserVoiceQueueRt','../api/userVoiceQueueRt/userVoiceQueueRt.model','../api/userVoiceQueue/userVoiceQueue.model','../api/userMailQueue/userMailQueue.model','UserFaxQueue','../api/userFaxQueue/userFaxQueue.model','UserSmsQueue','../api/userSmsQueue/userSmsQueue.model','UserOpenchannelQueue','../api/userOpenchannelQueue/userOpenchannelQueue.model','UserWhatsappQueue','../api/userWhatsappQueue/userWhatsappQueue.model','MailServerIn','../api/mailServerOut/mailServerOut.model','MailAccount','MailQueue','../api/mailQueue/mailQueue.model','MailSubstatus','../api/mailSubstatus/mailSubstatus.model','MailInteraction','../api/mailInteraction/mailInteraction.model','MailMessage','MailApplication','../api/mailApplication/mailApplication.model','MailQueueReport','../api/mailQueueReport/mailQueueReport.model','../api/dashboard/dashboard.model','../api/dashboardItem/dashboardItem.model','FaxAccount','../api/faxAccount/faxAccount.model','../api/faxApplication/faxApplication.model','FaxInteraction','FaxMessage','../api/faxMessage/faxMessage.model','FaxQueue','../api/faxQueue/faxQueue.model','SmsAccount','../api/smsAccount/smsAccount.model','SmsApplication'];(function(_0x3597e1,_0x1d1cec){var _0x199f5=function(_0xd5a5c){while(--_0xd5a5c){_0x3597e1['push'](_0x3597e1['shift']());}};_0x199f5(++_0x1d1cec);}(_0x4483,0x1a3));var _0x3448=function(_0x698209,_0xf6d47a){_0x698209=_0x698209-0x0;var _0x498157=_0x4483[_0x698209];return _0x498157;};'use strict';var config=require(_0x3448('0x0'));var Sequelize=require(_0x3448('0x1'));var _=require(_0x3448('0x2'));var jstz=require('jstz');var timezone=jstz[_0x3448('0x3')]();config[_0x3448('0x1')]=_[_0x3448('0x4')](config[_0x3448('0x1')],{'database':_0x3448('0x5'),'username':'xcall','password':_0x3448('0x6'),'options':{'host':_0x3448('0x7'),'port':0xcea,'dialect':_0x3448('0x8'),'dialectOptions':{'charset':_0x3448('0x9')},'logging':![],'timezone':timezone[_0x3448('0xa')](),'define':{'charset':_0x3448('0xb'),'collate':_0x3448('0xc')}}});config[_0x3448('0xd')]=_['defaultsDeep'](config['sequelizeHistory'],{'database':_0x3448('0x5'),'username':_0x3448('0xe'),'password':_0x3448('0x6'),'options':{'host':_0x3448('0x7'),'port':0xcea,'dialect':_0x3448('0x8'),'dialectOptions':{'charset':_0x3448('0x9')},'logging':![],'timezone':timezone[_0x3448('0xa')](),'define':{'charset':_0x3448('0xb'),'collate':_0x3448('0xc')}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x3448('0x1')][_0x3448('0xf')],config['sequelize']['username'],config[_0x3448('0x1')][_0x3448('0x10')],config['sequelize'][_0x3448('0x11')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x3448('0xd')][_0x3448('0xf')],config['sequelizeHistory'][_0x3448('0x12')],config[_0x3448('0xd')]['password'],config[_0x3448('0xd')][_0x3448('0x11')])};db[_0x3448('0x13')]=db['sequelize'][_0x3448('0x14')](_0x3448('0x15'));db[_0x3448('0x16')]=db[_0x3448('0x1')][_0x3448('0x14')](_0x3448('0x17'));db[_0x3448('0x18')]=db[_0x3448('0x1')]['import'](_0x3448('0x19'));db['VoiceExtension']=db['sequelize']['import'](_0x3448('0x1a'));db[_0x3448('0x1b')]=db[_0x3448('0x1')]['import'](_0x3448('0x1c'));db[_0x3448('0x1d')]=db[_0x3448('0x1')][_0x3448('0x14')](_0x3448('0x1e'));db[_0x3448('0x1f')]=db['sequelize']['import']('../api/voiceRecording/voiceRecording.model');db[_0x3448('0x20')]=db[_0x3448('0x1')]['import']('../api/screenRecording/screenRecording.model');db[_0x3448('0x21')]=db[_0x3448('0x1')][_0x3448('0x14')](_0x3448('0x22'));db[_0x3448('0x23')]=db['sequelize'][_0x3448('0x14')](_0x3448('0x24'));db[_0x3448('0x25')]=db[_0x3448('0x1')][_0x3448('0x14')]('../api/voiceCallReport/voiceCallReport.model');db[_0x3448('0x26')]=db[_0x3448('0x1')]['import'](_0x3448('0x27'));db[_0x3448('0x28')]=db[_0x3448('0x1')][_0x3448('0x14')](_0x3448('0x29'));db[_0x3448('0x2a')]=db[_0x3448('0x1')][_0x3448('0x14')]('../api/voiceQueueReport/voiceQueueReport.model');db[_0x3448('0x2b')]=db[_0x3448('0x1')][_0x3448('0x14')]('../api/memberReport/memberReport.model');db[_0x3448('0x2c')]=db['sequelize']['import']('../api/trunk/trunk.model');db[_0x3448('0x2d')]=db[_0x3448('0x1')]['import']('../api/voiceTransferReport/voiceTransferReport.model');db[_0x3448('0x2e')]=db[_0x3448('0x1')][_0x3448('0x14')](_0x3448('0x2f'));db['UserVoiceQueue']=db[_0x3448('0x1')][_0x3448('0x14')](_0x3448('0x30'));db['UserChatQueue']=db[_0x3448('0x1')][_0x3448('0x14')]('../api/userChatQueue/userChatQueue.model');db['UserMailQueue']=db[_0x3448('0x1')][_0x3448('0x14')](_0x3448('0x31'));db[_0x3448('0x32')]=db['sequelize'][_0x3448('0x14')](_0x3448('0x33'));db[_0x3448('0x34')]=db[_0x3448('0x1')]['import'](_0x3448('0x35'));db[_0x3448('0x36')]=db['sequelize'][_0x3448('0x14')](_0x3448('0x37'));db[_0x3448('0x38')]=db[_0x3448('0x1')][_0x3448('0x14')](_0x3448('0x39'));db[_0x3448('0x3a')]=db[_0x3448('0x1')][_0x3448('0x14')]('../api/mailServerIn/mailServerIn.model');db['MailServerOut']=db[_0x3448('0x1')]['import'](_0x3448('0x3b'));db[_0x3448('0x3c')]=db[_0x3448('0x1')][_0x3448('0x14')]('../api/mailAccount/mailAccount.model');db[_0x3448('0x3d')]=db[_0x3448('0x1')][_0x3448('0x14')](_0x3448('0x3e'));db[_0x3448('0x3f')]=db[_0x3448('0x1')][_0x3448('0x14')](_0x3448('0x40'));db[_0x3448('0x41')]=db['sequelize'][_0x3448('0x14')](_0x3448('0x42'));db[_0x3448('0x43')]=db[_0x3448('0x1')][_0x3448('0x14')]('../api/mailMessage/mailMessage.model');db[_0x3448('0x44')]=db[_0x3448('0x1')][_0x3448('0x14')](_0x3448('0x45'));db[_0x3448('0x46')]=db[_0x3448('0x1')][_0x3448('0x14')](_0x3448('0x47'));db['Dashboard']=db[_0x3448('0x1')][_0x3448('0x14')](_0x3448('0x48'));db['DashboardItem']=db[_0x3448('0x1')][_0x3448('0x14')](_0x3448('0x49'));db[_0x3448('0x4a')]=db[_0x3448('0x1')][_0x3448('0x14')](_0x3448('0x4b'));db['FaxApplication']=db[_0x3448('0x1')][_0x3448('0x14')](_0x3448('0x4c'));db[_0x3448('0x4d')]=db[_0x3448('0x1')][_0x3448('0x14')]('../api/faxInteraction/faxInteraction.model');db[_0x3448('0x4e')]=db['sequelize']['import'](_0x3448('0x4f'));db[_0x3448('0x50')]=db['sequelize'][_0x3448('0x14')](_0x3448('0x51'));db['FaxQueueReport']=db[_0x3448('0x1')][_0x3448('0x14')]('../api/faxQueueReport/faxQueueReport.model');db[_0x3448('0x52')]=db[_0x3448('0x1')][_0x3448('0x14')](_0x3448('0x53'));db[_0x3448('0x54')]=db[_0x3448('0x1')][_0x3448('0x14')]('../api/smsApplication/smsApplication.model');db['SmsInteraction']=db[_0x3448('0x1')][_0x3448('0x14')](_0x3448('0x55'));db[_0x3448('0x56')]=db['sequelize'][_0x3448('0x14')](_0x3448('0x57'));db[_0x3448('0x58')]=db[_0x3448('0x1')][_0x3448('0x14')]('../api/smsQueue/smsQueue.model');db[_0x3448('0x59')]=db['sequelize'][_0x3448('0x14')](_0x3448('0x5a'));db['OpenchannelApplication']=db[_0x3448('0x1')][_0x3448('0x14')](_0x3448('0x5b'));db[_0x3448('0x5c')]=db[_0x3448('0x1')][_0x3448('0x14')](_0x3448('0x5d'));db['OpenchannelMessage']=db[_0x3448('0x1')][_0x3448('0x14')]('../api/openchannelMessage/openchannelMessage.model');db['OpenchannelQueue']=db[_0x3448('0x1')][_0x3448('0x14')]('../api/openchannelQueue/openchannelQueue.model');db['ChatWebsite']=db[_0x3448('0x1')][_0x3448('0x14')](_0x3448('0x5e'));db[_0x3448('0x5f')]=db[_0x3448('0x1')][_0x3448('0x14')](_0x3448('0x60'));db['ChatApplication']=db['sequelize']['import'](_0x3448('0x61'));db[_0x3448('0x62')]=db['sequelize'][_0x3448('0x14')](_0x3448('0x63'));db['ChatMessage']=db[_0x3448('0x1')][_0x3448('0x14')]('../api/chatMessage/chatMessage.model');db[_0x3448('0x64')]=db[_0x3448('0x1')][_0x3448('0x14')](_0x3448('0x65'));db[_0x3448('0x66')]=db[_0x3448('0x1')][_0x3448('0x14')](_0x3448('0x67'));db[_0x3448('0x68')]=db['sequelize'][_0x3448('0x14')]('../api/chatGroup/chatGroup.model');db[_0x3448('0x69')]=db[_0x3448('0x1')][_0x3448('0x14')](_0x3448('0x6a'));db[_0x3448('0x6b')]=db[_0x3448('0x1')]['import'](_0x3448('0x6c'));db['CmContact']=db[_0x3448('0x1')][_0x3448('0x14')](_0x3448('0x6d'));db[_0x3448('0x6e')]=db[_0x3448('0x1')]['import']('../api/cmHopper/cmHopper.model');db[_0x3448('0x6f')]=db[_0x3448('0x1')][_0x3448('0x14')]('../api/cmHopperBlack/cmHopperBlack.model');db[_0x3448('0x70')]=db[_0x3448('0x1')][_0x3448('0x14')](_0x3448('0x71'));db[_0x3448('0x72')]=db[_0x3448('0x1')][_0x3448('0x14')](_0x3448('0x73'));db[_0x3448('0x74')]=db[_0x3448('0x1')][_0x3448('0x14')](_0x3448('0x75'));db[_0x3448('0x76')]=db[_0x3448('0x1')][_0x3448('0x14')](_0x3448('0x77'));db[_0x3448('0x78')]=db[_0x3448('0x1')]['import'](_0x3448('0x79'));db['Automation']=db[_0x3448('0x1')]['import'](_0x3448('0x7a'));db[_0x3448('0x7b')]=db['sequelize'][_0x3448('0x14')](_0x3448('0x7c'));db['Disposition']=db['sequelize'][_0x3448('0x14')]('../api/disposition/disposition.model');db['Condition']=db[_0x3448('0x1')][_0x3448('0x14')]('../api/condition/condition.model');db['Interval']=db[_0x3448('0x1')][_0x3448('0x14')](_0x3448('0x7d'));db[_0x3448('0x7e')]=db[_0x3448('0x1')][_0x3448('0x14')](_0x3448('0x7f'));db[_0x3448('0x80')]=db[_0x3448('0x1')][_0x3448('0x14')](_0x3448('0x81'));db[_0x3448('0x82')]=db[_0x3448('0x1')][_0x3448('0x14')]('../api/voiceQueuesLog/voiceQueuesLog.model');db[_0x3448('0x83')]=db[_0x3448('0x1')]['import'](_0x3448('0x84'));db[_0x3448('0x85')]=db['sequelize'][_0x3448('0x14')](_0x3448('0x86'));db[_0x3448('0x87')]=db['sequelize']['import'](_0x3448('0x88'));db['Template']=db[_0x3448('0x1')][_0x3448('0x14')](_0x3448('0x89'));db['Trigger']=db[_0x3448('0x1')][_0x3448('0x14')](_0x3448('0x8a'));db['Variable']=db['sequelize'][_0x3448('0x14')](_0x3448('0x8b'));db[_0x3448('0x8c')]=db[_0x3448('0x1')][_0x3448('0x14')](_0x3448('0x8d'));db['IntegrationReport']=db[_0x3448('0x1')]['import'](_0x3448('0x8e'));db[_0x3448('0x8f')]=db['sequelize'][_0x3448('0x14')](_0x3448('0x90'));db['AnalyticDefaultReport']=db['sequelize'][_0x3448('0x14')](_0x3448('0x91'));db[_0x3448('0x92')]=db[_0x3448('0x1')][_0x3448('0x14')](_0x3448('0x93'));db[_0x3448('0x94')]=db[_0x3448('0x1')][_0x3448('0x14')](_0x3448('0x95'));db[_0x3448('0x96')]=db[_0x3448('0x1')][_0x3448('0x14')](_0x3448('0x97'));db[_0x3448('0x98')]=db[_0x3448('0x1')]['import']('../api/analyticTreeReport/analyticTreeReport.model');db[_0x3448('0x99')]=db['sequelize'][_0x3448('0x14')](_0x3448('0x9a'));db['SalesforceConfiguration']=db[_0x3448('0x1')]['import'](_0x3448('0x9b'));db[_0x3448('0x9c')]=db[_0x3448('0x1')][_0x3448('0x14')](_0x3448('0x9d'));db['SugarcrmAccount']=db[_0x3448('0x1')][_0x3448('0x14')](_0x3448('0x9e'));db['SugarcrmConfiguration']=db[_0x3448('0x1')][_0x3448('0x14')](_0x3448('0x9f'));db['SugarcrmField']=db[_0x3448('0x1')]['import']('../api/intSugarcrmField/intSugarcrmField.model');db[_0x3448('0xa0')]=db['sequelize'][_0x3448('0x14')]('../api/intDeskAccount/intDeskAccount.model');db[_0x3448('0xa1')]=db[_0x3448('0x1')]['import']('../api/intDeskConfiguration/intDeskConfiguration.model');db[_0x3448('0xa2')]=db[_0x3448('0x1')]['import'](_0x3448('0xa3'));db[_0x3448('0xa4')]=db['sequelize'][_0x3448('0x14')](_0x3448('0xa5'));db[_0x3448('0xa6')]=db[_0x3448('0x1')]['import'](_0x3448('0xa7'));db['ZohoField']=db[_0x3448('0x1')]['import'](_0x3448('0xa8'));db[_0x3448('0xa9')]=db[_0x3448('0x1')]['import'](_0x3448('0xaa'));db[_0x3448('0xab')]=db['sequelize'][_0x3448('0x14')]('../api/intZendeskConfiguration/intZendeskConfiguration.model');db['ZendeskField']=db[_0x3448('0x1')]['import'](_0x3448('0xac'));db[_0x3448('0xad')]=db[_0x3448('0x1')]['import'](_0x3448('0xae'));db[_0x3448('0xaf')]=db[_0x3448('0x1')][_0x3448('0x14')](_0x3448('0xb0'));db[_0x3448('0xb1')]=db[_0x3448('0x1')][_0x3448('0x14')](_0x3448('0xb2'));db[_0x3448('0xb3')]=db[_0x3448('0x1')][_0x3448('0x14')](_0x3448('0xb4'));db['VtigerConfiguration']=db['sequelize']['import'](_0x3448('0xb5'));db['VtigerField']=db['sequelize'][_0x3448('0x14')](_0x3448('0xb6'));db[_0x3448('0xb7')]=db[_0x3448('0x1')]['import']('../api/intServicenowAccount/intServicenowAccount.model');db[_0x3448('0xb8')]=db[_0x3448('0x1')][_0x3448('0x14')]('../api/intServicenowConfiguration/intServicenowConfiguration.model');db[_0x3448('0xb9')]=db[_0x3448('0x1')][_0x3448('0x14')](_0x3448('0xba'));db['Dynamics365Account']=db[_0x3448('0x1')][_0x3448('0x14')]('../api/intDynamics365Account/intDynamics365Account.model');db['Dynamics365Configuration']=db[_0x3448('0x1')][_0x3448('0x14')](_0x3448('0xbb'));db['Dynamics365Field']=db[_0x3448('0x1')][_0x3448('0x14')](_0x3448('0xbc'));db[_0x3448('0xbd')]=db['sequelize'][_0x3448('0x14')](_0x3448('0xbe'));db['FreshsalesConfiguration']=db[_0x3448('0x1')][_0x3448('0x14')]('../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model');db['FreshsalesField']=db[_0x3448('0x1')][_0x3448('0x14')](_0x3448('0xbf'));db[_0x3448('0x8c')]=db[_0x3448('0x1')][_0x3448('0x14')](_0x3448('0x8d'));db[_0x3448('0xc0')]=db[_0x3448('0x1')][_0x3448('0x14')]('../api/network/network.model');db[_0x3448('0xc1')]=db['sequelize'][_0x3448('0x14')]('../api/chatQueueReport/chatQueueReport.model');db[_0x3448('0xc2')]=db[_0x3448('0x1')]['import']('../api/chatInternalMessage/chatInternalMessage.model');db['JscriptyAnswerReport']=db[_0x3448('0x1')][_0x3448('0x14')](_0x3448('0xc3'));db['JscriptyQuestionReport']=db[_0x3448('0x1')][_0x3448('0x14')]('../api/jscriptyQuestionReport/jscriptyQuestionReport.model');db['JscriptySessionReport']=db[_0x3448('0x1')][_0x3448('0x14')](_0x3448('0xc4'));db[_0x3448('0xc5')]=db[_0x3448('0x1')][_0x3448('0x14')](_0x3448('0xc6'));db[_0x3448('0xc7')]=db[_0x3448('0x1')]['import']('../api/squareReport/squareReport.model');db[_0x3448('0xc8')]=db['sequelize'][_0x3448('0x14')]('../api/squareReportDetail/squareReportDetail.model');db[_0x3448('0xc9')]=db[_0x3448('0x1')]['import'](_0x3448('0xca'));db[_0x3448('0xcb')]=db[_0x3448('0x1')][_0x3448('0x14')](_0x3448('0xcc'));db[_0x3448('0xcd')]=db[_0x3448('0x1')][_0x3448('0x14')](_0x3448('0xce'));db[_0x3448('0xcf')]=db[_0x3448('0x1')]['import'](_0x3448('0xd0'));db[_0x3448('0xd1')]=db[_0x3448('0x1')]['import'](_0x3448('0xd2'));db[_0x3448('0xd3')]=db[_0x3448('0x1')][_0x3448('0x14')](_0x3448('0xd4'));db[_0x3448('0xd5')]=db['sequelize']['import'](_0x3448('0xd6'));db[_0x3448('0xd7')]=db[_0x3448('0x1')][_0x3448('0x14')](_0x3448('0xd8'));db[_0x3448('0xd9')]=db[_0x3448('0x1')][_0x3448('0x14')](_0x3448('0xda'));db[_0x3448('0xdb')]=db[_0x3448('0x1')][_0x3448('0x14')](_0x3448('0xdc'));db[_0x3448('0xdd')]=db['sequelize']['import']('../api/attachment/attachment.model');db[_0x3448('0xde')]=db[_0x3448('0x1')][_0x3448('0x14')](_0x3448('0xdf'));db['MailTransferReport']=db[_0x3448('0x1')]['import'](_0x3448('0xe0'));db['ChatTransferReport']=db[_0x3448('0x1')]['import'](_0x3448('0xe1'));db[_0x3448('0xe2')]=db[_0x3448('0x1')][_0x3448('0x14')](_0x3448('0xe3'));db[_0x3448('0xe4')]=db[_0x3448('0x1')][_0x3448('0x14')](_0x3448('0xe5'));db['SmsTransferReport']=db['sequelize'][_0x3448('0x14')](_0x3448('0xe6'));db[_0x3448('0xe7')]=db[_0x3448('0x1')]['import'](_0x3448('0xe8'));db[_0x3448('0xe9')]=db[_0x3448('0x1')]['import'](_0x3448('0xea'));db['UserProfile']=db[_0x3448('0x1')][_0x3448('0x14')](_0x3448('0xeb'));db['UserProfileSection']=db[_0x3448('0x1')][_0x3448('0x14')](_0x3448('0xec'));db[_0x3448('0xed')]=db[_0x3448('0x1')][_0x3448('0x14')](_0x3448('0xee'));db[_0x3448('0xef')]=db[_0x3448('0x1')][_0x3448('0x14')](_0x3448('0xf0'));db[_0x3448('0xf1')]=db[_0x3448('0x1')][_0x3448('0x14')]('../api/whatsappAccount/whatsappAccount.model');db['WhatsappApplication']=db[_0x3448('0x1')][_0x3448('0x14')](_0x3448('0xf2'));db['WhatsappInteraction']=db['sequelize'][_0x3448('0x14')](_0x3448('0xf3'));db[_0x3448('0xf4')]=db[_0x3448('0x1')][_0x3448('0x14')](_0x3448('0xf5'));db[_0x3448('0xf6')]=db[_0x3448('0x1')][_0x3448('0x14')](_0x3448('0xf7'));db[_0x3448('0xf8')]=db[_0x3448('0x1')]['import'](_0x3448('0xf9'));db[_0x3448('0xfa')]=db[_0x3448('0x1')][_0x3448('0x14')](_0x3448('0xfb'));db[_0x3448('0xfc')]=db[_0x3448('0x1')][_0x3448('0x14')](_0x3448('0xfd'));db[_0x3448('0xfe')]=db[_0x3448('0x1')][_0x3448('0x14')]('../api/teamVoiceQueue/teamVoiceQueue.model');db['TeamVoicePrefix']=db[_0x3448('0x1')][_0x3448('0x14')](_0x3448('0xff'));db['UserVoicePrefix']=db[_0x3448('0x1')][_0x3448('0x14')](_0x3448('0x100'));db['User']['hasOne'](db[_0x3448('0x21')],{'as':_0x3448('0x21'),'onDelete':_0x3448('0x101'),'foreignKey':_0x3448('0x102')});db[_0x3448('0x13')][_0x3448('0x103')](db[_0x3448('0x1f')],{'as':_0x3448('0x104'),'foreignKey':_0x3448('0x102')});db[_0x3448('0x13')][_0x3448('0x103')](db[_0x3448('0x2e')],{'as':_0x3448('0x105'),'foreignKey':_0x3448('0x102')});db['User'][_0x3448('0x103')](db[_0x3448('0x106')],{'as':'Extensions','onDelete':_0x3448('0x101'),'hooks':!![]});db[_0x3448('0x13')][_0x3448('0x103')](db[_0x3448('0x70')],{'as':_0x3448('0x107'),'foreignKey':_0x3448('0x102')});db['User'][_0x3448('0x103')](db[_0x3448('0x72')],{'as':_0x3448('0x108'),'foreignKey':'UserId'});db['User'][_0x3448('0x103')](db[_0x3448('0x74')],{'as':_0x3448('0x74'),'foreignKey':_0x3448('0x102')});db[_0x3448('0x13')][_0x3448('0x103')](db[_0x3448('0x5c')],{'as':_0x3448('0x109'),'foreignKey':_0x3448('0x102')});db['User'][_0x3448('0x103')](db[_0x3448('0x62')],{'as':_0x3448('0x10a'),'foreignKey':_0x3448('0x102')});db[_0x3448('0x13')]['hasMany'](db[_0x3448('0x10b')],{'as':_0x3448('0x10c'),'foreignKey':_0x3448('0x102')});db[_0x3448('0x13')][_0x3448('0x103')](db[_0x3448('0x4d')],{'as':_0x3448('0x10d'),'foreignKey':_0x3448('0x102')});db[_0x3448('0x13')][_0x3448('0x103')](db[_0x3448('0x41')],{'as':_0x3448('0x10e'),'foreignKey':_0x3448('0x102')});db[_0x3448('0x13')][_0x3448('0x103')](db[_0x3448('0x10f')],{'as':_0x3448('0x110'),'foreignKey':_0x3448('0x102')});db[_0x3448('0x13')][_0x3448('0x103')](db[_0x3448('0xef')],{'as':'UserNotifications','foreignKey':_0x3448('0x111')});db['User'][_0x3448('0x112')](db[_0x3448('0x113')],{'as':'UserProfile','foreignKey':_0x3448('0x114')});db['User'][_0x3448('0x115')](db[_0x3448('0x68')],{'as':'Groups','through':_0x3448('0x116')});db[_0x3448('0x13')]['belongsToMany'](db[_0x3448('0x117')],{'as':_0x3448('0x118'),'through':_0x3448('0x119')});db['User']['belongsToMany'](db[_0x3448('0xe7')],{'as':_0x3448('0x11a'),'through':_0x3448('0x11b')});db[_0x3448('0x13')][_0x3448('0x115')](db[_0x3448('0xd5')],{'through':_0x3448('0x11c')});db[_0x3448('0x13')]['belongsToMany'](db[_0x3448('0x41')],{'as':_0x3448('0x10e'),'through':_0x3448('0x11d')});db[_0x3448('0x13')][_0x3448('0x115')](db[_0x3448('0x62')],{'as':_0x3448('0x10a'),'through':_0x3448('0x11e')});db[_0x3448('0x13')][_0x3448('0x115')](db[_0x3448('0x4d')],{'as':'FaxInteractions','through':'user_has_fax_interactions'});db[_0x3448('0x13')]['belongsToMany'](db[_0x3448('0x10b')],{'as':'SmsInteractions','through':_0x3448('0x11f')});db['User'][_0x3448('0x115')](db[_0x3448('0x5c')],{'as':_0x3448('0x109'),'through':_0x3448('0x120')});db[_0x3448('0x13')]['belongsToMany'](db[_0x3448('0x10f')],{'as':_0x3448('0x110'),'through':'user_has_whatsapp_interactions'});db[_0x3448('0x13')][_0x3448('0x115')](db[_0x3448('0x1d')],{'as':'VoiceQueues','through':_0x3448('0x121'),'required':![]});db[_0x3448('0x13')]['belongsToMany'](db[_0x3448('0xe9')],{'as':_0x3448('0x122'),'through':'UserVoicePrefix','required':![]});db[_0x3448('0x13')]['belongsToMany'](db[_0x3448('0x3d')],{'as':_0x3448('0x123'),'through':_0x3448('0x124'),'required':![]});db[_0x3448('0x13')][_0x3448('0x115')](db[_0x3448('0x66')],{'as':_0x3448('0x125'),'through':'UserChatQueue','required':![],'hooks':!![]});db[_0x3448('0x13')][_0x3448('0x115')](db['FaxQueue'],{'as':_0x3448('0x126'),'through':'UserFaxQueue','required':![]});db[_0x3448('0x13')]['belongsToMany'](db[_0x3448('0x58')],{'as':_0x3448('0x127'),'through':_0x3448('0x34'),'required':![]});db[_0x3448('0x13')][_0x3448('0x115')](db[_0x3448('0x128')],{'as':_0x3448('0x129'),'through':_0x3448('0x36'),'required':![]});db[_0x3448('0x13')][_0x3448('0x115')](db[_0x3448('0xfa')],{'as':_0x3448('0x12a'),'through':_0x3448('0x38'),'required':![]});db['User'][_0x3448('0x115')](db['CmList'],{'through':_0x3448('0x11b')});db[_0x3448('0x13')]['belongsToMany'](db[_0x3448('0x12b')],{'as':_0x3448('0x12c'),'through':'user_has_chat_websites'});db[_0x3448('0x13')][_0x3448('0x115')](db[_0x3448('0x4a')],{'as':_0x3448('0x12d'),'through':_0x3448('0x12e')});db[_0x3448('0x13')][_0x3448('0x115')](db[_0x3448('0x3c')],{'as':_0x3448('0x12f'),'through':_0x3448('0x130')});db[_0x3448('0x13')][_0x3448('0x115')](db[_0x3448('0x59')],{'as':_0x3448('0x131'),'through':_0x3448('0x132')});db['User'][_0x3448('0x115')](db['SmsAccount'],{'as':_0x3448('0x133'),'through':_0x3448('0x134')});db[_0x3448('0x13')][_0x3448('0x115')](db[_0x3448('0xf1')],{'as':_0x3448('0x135'),'through':_0x3448('0x136')});db[_0x3448('0x13')]['belongsToMany'](db[_0x3448('0xcf')],{'as':_0x3448('0x137'),'through':_0x3448('0x138')});db[_0x3448('0x16')]['hasMany'](db[_0x3448('0x106')],{'as':_0x3448('0x139'),'onDelete':'cascade','foreignKey':_0x3448('0x13a')});db['VoiceContext'][_0x3448('0x103')](db['VoiceExtension'],{'onDelete':_0x3448('0x101')});db[_0x3448('0x106')][_0x3448('0x103')](db[_0x3448('0x106')],{'as':_0x3448('0x13b'),'onDelete':_0x3448('0x101')});db[_0x3448('0x1b')][_0x3448('0x115')](db[_0x3448('0x85')],{'as':_0x3448('0x13c'),'through':_0x3448('0x13d')});db[_0x3448('0x1d')][_0x3448('0x103')](db['UserVoiceQueueRt'],{'as':_0x3448('0x13e'),'foreignKey':'VoiceQueueId'});db[_0x3448('0x1d')][_0x3448('0x103')](db['CmHopper'],{'as':_0x3448('0x13f'),'foreignKey':'VoiceQueueId'});db[_0x3448('0x1d')][_0x3448('0x103')](db[_0x3448('0x70')],{'as':_0x3448('0x107'),'foreignKey':_0x3448('0x140')});db[_0x3448('0x1d')][_0x3448('0x103')](db[_0x3448('0x72')],{'as':_0x3448('0x141'),'foreignKey':_0x3448('0x140')});db[_0x3448('0x1d')][_0x3448('0x103')](db[_0x3448('0x74')],{'as':_0x3448('0x74'),'foreignKey':_0x3448('0x140')});db['VoiceQueue']['hasMany'](db[_0x3448('0x6f')],{'as':'HopperBlacks','foreignKey':_0x3448('0x140')});db[_0x3448('0x1d')][_0x3448('0x103')](db[_0x3448('0x142')],{'as':_0x3448('0x143'),'foreignKey':_0x3448('0x140')});db[_0x3448('0x1d')][_0x3448('0x112')](db[_0x3448('0x2c')],{'as':_0x3448('0x2c'),'foreignKey':_0x3448('0x144')});db[_0x3448('0x1d')]['belongsTo'](db['Trunk'],{'as':_0x3448('0x145'),'foreignKey':_0x3448('0x146')});db[_0x3448('0x1d')][_0x3448('0x112')](db[_0x3448('0x147')],{'as':'Interval','foreignKey':_0x3448('0x148')});db[_0x3448('0x1d')][_0x3448('0x112')](db[_0x3448('0x7e')],{'as':'mandatoryDispositionPause','foreignKey':'mandatoryDispositionPauseId'});db[_0x3448('0x1d')]['belongsToMany'](db[_0x3448('0xe7')],{'as':'Lists','through':_0x3448('0x149')});db[_0x3448('0x1d')]['belongsToMany'](db[_0x3448('0x13')],{'as':_0x3448('0x14a'),'through':_0x3448('0x121')});db[_0x3448('0x1d')][_0x3448('0x115')](db[_0x3448('0xd5')],{'as':_0x3448('0x14b'),'through':_0x3448('0xfe')});db[_0x3448('0x1d')][_0x3448('0x115')](db[_0x3448('0xe7')],{'as':_0x3448('0x14c'),'through':'voice_queues_has_cm_blacklists'});db[_0x3448('0x1f')][_0x3448('0x112')](db[_0x3448('0x13')],{'as':'User','foreignKey':'UserId'});db[_0x3448('0x20')][_0x3448('0x112')](db['User'],{'as':'User','foreignKey':'UserId'});db[_0x3448('0x21')][_0x3448('0x103')](db['VoiceMailMessage'],{'as':_0x3448('0x14d'),'onDelete':'cascade','foreignKey':_0x3448('0x14e'),'sourceKey':_0x3448('0x14f')});db['VoiceMailMessage'][_0x3448('0x112')](db['VoiceMail'],{'foreignKey':'mailboxuser','targetKey':_0x3448('0x14f')});db[_0x3448('0x25')][_0x3448('0x103')](db[_0x3448('0x2a')],{'as':_0x3448('0x150'),'foreignKey':_0x3448('0x151'),'constraints':![]});db[_0x3448('0x25')][_0x3448('0x103')](db['VoiceAgentReport'],{'as':_0x3448('0x152'),'foreignKey':_0x3448('0x151'),'constraints':![]});db[_0x3448('0x25')][_0x3448('0x112')](db[_0x3448('0x13')],{'as':_0x3448('0x13'),'foreignKey':_0x3448('0x102')});db[_0x3448('0x25')][_0x3448('0x112')](db[_0x3448('0x117')],{'as':'Contact','foreignKey':_0x3448('0x153')});db[_0x3448('0x3a')][_0x3448('0x112')](db['MailAccount'],{'as':_0x3448('0x3c'),'foreignKey':'MailAccountId'});db['MailServerOut'][_0x3448('0x112')](db[_0x3448('0x3c')],{'as':_0x3448('0x3c'),'foreignKey':_0x3448('0x154')});db[_0x3448('0x3c')][_0x3448('0x155')](db[_0x3448('0x3a')],{'as':_0x3448('0x156'),'onDelete':_0x3448('0x101')});db[_0x3448('0x3c')][_0x3448('0x155')](db['MailServerOut'],{'as':_0x3448('0x157'),'onDelete':_0x3448('0x101')});db[_0x3448('0x3c')][_0x3448('0x103')](db['Disposition'],{'as':_0x3448('0x158'),'foreignKey':_0x3448('0x154'),'onDelete':'cascade'});db['MailAccount'][_0x3448('0x103')](db[_0x3448('0x7b')],{'as':'Answers','foreignKey':'MailAccountId'});db[_0x3448('0x3c')][_0x3448('0x103')](db[_0x3448('0x43')],{'as':_0x3448('0x14d'),'foreignKey':_0x3448('0x154')});db[_0x3448('0x3c')][_0x3448('0x103')](db[_0x3448('0x41')],{'as':'Interactions'});db[_0x3448('0x3c')][_0x3448('0x103')](db[_0x3448('0x44')],{'as':'Applications'});db['MailAccount'][_0x3448('0x112')](db[_0x3448('0xe7')],{'as':_0x3448('0x159'),'foreignKey':_0x3448('0x15a')});db[_0x3448('0x3c')]['belongsTo'](db[_0x3448('0x15b')],{'as':_0x3448('0x15b'),'foreignKey':_0x3448('0x15c')});db[_0x3448('0x3c')][_0x3448('0x112')](db[_0x3448('0x7e')],{'as':'mandatoryDispositionPause','foreignKey':_0x3448('0x15d')});db[_0x3448('0x3c')][_0x3448('0x115')](db[_0x3448('0x13')],{'as':_0x3448('0x14a'),'through':_0x3448('0x130')});db['MailQueue'][_0x3448('0x115')](db[_0x3448('0x13')],{'as':_0x3448('0x14a'),'through':'UserMailQueue'});db[_0x3448('0x3d')][_0x3448('0x115')](db[_0x3448('0xd5')],{'through':'team_has_mail_queues','as':_0x3448('0x14b')});db[_0x3448('0x41')][_0x3448('0x103')](db[_0x3448('0x43')],{'as':'Messages','onDelete':_0x3448('0x101'),'foreignKey':_0x3448('0x15e')});db[_0x3448('0x41')]['belongsTo'](db[_0x3448('0x3c')],{'as':_0x3448('0x15f'),'foreignKey':'MailAccountId'});db['MailInteraction'][_0x3448('0x112')](db[_0x3448('0x117')],{'as':'Contact','foreignKey':_0x3448('0x153')});db['MailInteraction']['belongsTo'](db['User'],{'as':_0x3448('0x160'),'foreignKey':_0x3448('0x102')});db[_0x3448('0x41')]['belongsToMany'](db[_0x3448('0x87')],{'through':_0x3448('0x161'),'as':'Tags'});db['MailInteraction'][_0x3448('0x115')](db['Tag'],{'through':_0x3448('0x161'),'as':_0x3448('0x162')});db[_0x3448('0x41')][_0x3448('0x115')](db[_0x3448('0x13')],{'as':'Users','through':_0x3448('0x11d'),'foreignKey':_0x3448('0x15e')});db[_0x3448('0x43')][_0x3448('0x103')](db['Attachment'],{'as':'Attachments','onDelete':_0x3448('0x101')});db['MailMessage'][_0x3448('0x112')](db[_0x3448('0x13')],{'as':_0x3448('0x13')});db[_0x3448('0x43')][_0x3448('0x112')](db[_0x3448('0x117')],{'onDelete':'cascade','as':_0x3448('0x163')});db[_0x3448('0x43')][_0x3448('0x112')](db[_0x3448('0x41')],{'as':_0x3448('0x164'),'foreignKey':_0x3448('0x15e')});db[_0x3448('0x43')][_0x3448('0x112')](db[_0x3448('0x3c')],{'as':_0x3448('0x15f'),'foreignKey':_0x3448('0x154')});db[_0x3448('0x43')][_0x3448('0x112')](db['ChatWebsite'],{'as':_0x3448('0x12b'),'foreignKey':_0x3448('0x165')});db['MailMessage'][_0x3448('0x112')](db['ChatOfflineMessage'],{'as':'ChatOfflineMessage','foreignKey':_0x3448('0x166')});db[_0x3448('0x44')][_0x3448('0x112')](db[_0x3448('0x13')],{'onDelete':_0x3448('0x167')});db['MailApplication'][_0x3448('0x112')](db[_0x3448('0x3d')],{'onDelete':_0x3448('0x167')});db[_0x3448('0x44')][_0x3448('0x112')](db['MailAccount'],{'onDelete':_0x3448('0x167')});db[_0x3448('0x44')]['belongsTo'](db[_0x3448('0x147')],{'onDelete':_0x3448('0x167'),'foreignKey':'IntervalId'});db[_0x3448('0x44')][_0x3448('0x112')](db[_0x3448('0x87')],{'onDelete':_0x3448('0x167'),'foreignKey':'TagId'});db[_0x3448('0x46')][_0x3448('0x112')](db[_0x3448('0x3c')],{});db[_0x3448('0x46')]['belongsTo'](db[_0x3448('0xe7')],{'as':_0x3448('0x159'),'foreignKey':_0x3448('0x15a')});db['MailQueueReport'][_0x3448('0x112')](db['CmContact'],{'as':_0x3448('0x163'),'foreignKey':_0x3448('0x153')});db[_0x3448('0x46')][_0x3448('0x112')](db['MailInteraction'],{});db['MailQueueReport'][_0x3448('0x112')](db[_0x3448('0x43')],{});db[_0x3448('0x46')][_0x3448('0x112')](db[_0x3448('0x13')],{});db[_0x3448('0x46')][_0x3448('0x112')](db['MailQueue'],{});db[_0x3448('0x168')][_0x3448('0x103')](db['DashboardItem'],{'as':_0x3448('0x169'),'onDelete':_0x3448('0x101')});db[_0x3448('0x4a')][_0x3448('0x103')](db[_0x3448('0x16a')],{'as':_0x3448('0x158'),'foreignKey':_0x3448('0x16b'),'onDelete':_0x3448('0x101')});db[_0x3448('0x4a')]['hasMany'](db[_0x3448('0x7b')],{'as':_0x3448('0x16c'),'foreignKey':'FaxAccountId'});db[_0x3448('0x4a')]['hasMany'](db[_0x3448('0x4d')],{'as':_0x3448('0x16d')});db[_0x3448('0x4a')][_0x3448('0x103')](db[_0x3448('0x16e')],{'as':_0x3448('0x13b')});db['FaxAccount'][_0x3448('0x103')](db[_0x3448('0x106')],{'as':'Exntensions','onDelete':_0x3448('0x101')});db['FaxAccount'][_0x3448('0x103')](db['FaxMessage'],{'as':'Messages'});db[_0x3448('0x4a')][_0x3448('0x112')](db[_0x3448('0x2c')],{'as':'Trunk'});db['FaxAccount'][_0x3448('0x112')](db[_0x3448('0xe7')],{'as':'List','foreignKey':'ListId'});db[_0x3448('0x4a')]['belongsTo'](db['Pause'],{'as':_0x3448('0x16f'),'foreignKey':_0x3448('0x15d')});db['FaxAccount'][_0x3448('0x115')](db[_0x3448('0x13')],{'as':_0x3448('0x14a'),'through':'user_has_fax_accounts'});db[_0x3448('0x16e')][_0x3448('0x112')](db['User'],{'onDelete':_0x3448('0x167')});db[_0x3448('0x16e')][_0x3448('0x112')](db[_0x3448('0x50')],{'onDelete':_0x3448('0x167')});db[_0x3448('0x16e')][_0x3448('0x112')](db[_0x3448('0x4a')],{'onDelete':_0x3448('0x167')});db[_0x3448('0x16e')][_0x3448('0x112')](db[_0x3448('0x87')],{'onDelete':_0x3448('0x167'),'foreignKey':_0x3448('0x170')});db[_0x3448('0x4d')][_0x3448('0x103')](db[_0x3448('0x4e')],{'as':_0x3448('0x14d'),'onDelete':_0x3448('0x101'),'foreignKey':_0x3448('0x171')});db['FaxInteraction']['belongsTo'](db['FaxAccount'],{'as':'Account','foreignKey':'FaxAccountId'});db[_0x3448('0x4d')][_0x3448('0x112')](db[_0x3448('0x117')],{'as':_0x3448('0x163'),'foreignKey':_0x3448('0x153')});db['FaxInteraction'][_0x3448('0x112')](db[_0x3448('0x13')],{'as':_0x3448('0x160'),'foreignKey':_0x3448('0x102')});db[_0x3448('0x4d')][_0x3448('0x115')](db['Tag'],{'through':'fax_interaction_has_tags','as':_0x3448('0x172')});db['FaxInteraction'][_0x3448('0x115')](db[_0x3448('0x87')],{'through':_0x3448('0x173'),'as':'ThroughTags'});db[_0x3448('0x4d')]['belongsToMany'](db[_0x3448('0x13')],{'as':'Users','through':_0x3448('0x174'),'foreignKey':_0x3448('0x171')});db[_0x3448('0x4e')][_0x3448('0x112')](db['User'],{'onDelete':'cascade','as':_0x3448('0x13')});db[_0x3448('0x4e')]['belongsTo'](db[_0x3448('0x4d')],{'as':_0x3448('0x164'),'foreignKey':_0x3448('0x171')});db[_0x3448('0x4e')]['belongsTo'](db[_0x3448('0x117')],{'onDelete':'cascade','as':_0x3448('0x163')});db['FaxMessage'][_0x3448('0x112')](db[_0x3448('0xdd')],{'as':'Attachment','foreignKey':'AttachmentId'});db[_0x3448('0x4e')][_0x3448('0x112')](db[_0x3448('0x4a')],{'as':_0x3448('0x15f'),'foreignKey':_0x3448('0x16b')});db[_0x3448('0x50')][_0x3448('0x115')](db[_0x3448('0x13')],{'as':'Agents','through':_0x3448('0x32')});db['FaxQueue'][_0x3448('0x115')](db[_0x3448('0xd5')],{'through':_0x3448('0x175'),'as':_0x3448('0x14b')});db['FaxQueueReport'][_0x3448('0x112')](db['FaxAccount'],{});db['FaxQueueReport']['belongsTo'](db['CmList'],{'as':'List','foreignKey':_0x3448('0x15a')});db[_0x3448('0x176')][_0x3448('0x112')](db[_0x3448('0x117')],{'as':_0x3448('0x163'),'foreignKey':_0x3448('0x153')});db[_0x3448('0x176')]['belongsTo'](db['FaxInteraction'],{});db[_0x3448('0x176')][_0x3448('0x112')](db['FaxMessage'],{});db[_0x3448('0x176')][_0x3448('0x112')](db[_0x3448('0x13')],{});db[_0x3448('0x176')][_0x3448('0x112')](db[_0x3448('0x50')],{});db[_0x3448('0x52')]['hasMany'](db[_0x3448('0x16a')],{'as':_0x3448('0x158'),'foreignKey':_0x3448('0x177'),'onDelete':_0x3448('0x101')});db[_0x3448('0x52')][_0x3448('0x103')](db['CannedAnswer'],{'as':_0x3448('0x16c'),'foreignKey':_0x3448('0x177')});db[_0x3448('0x52')][_0x3448('0x103')](db[_0x3448('0x56')],{'as':_0x3448('0x14d'),'foreignKey':_0x3448('0x177')});db[_0x3448('0x52')]['hasMany'](db['SmsInteraction'],{'as':_0x3448('0x16d')});db[_0x3448('0x52')][_0x3448('0x103')](db['SmsApplication'],{'as':_0x3448('0x13b')});db[_0x3448('0x52')]['belongsTo'](db[_0x3448('0xe7')],{'as':_0x3448('0x159'),'foreignKey':_0x3448('0x15a')});db['SmsAccount'][_0x3448('0x112')](db[_0x3448('0x7e')],{'as':_0x3448('0x16f'),'foreignKey':'mandatoryDispositionPauseId'});db[_0x3448('0x52')]['belongsToMany'](db[_0x3448('0x13')],{'as':_0x3448('0x14a'),'through':'user_has_sms_accounts'});db[_0x3448('0x54')][_0x3448('0x112')](db[_0x3448('0x13')],{'onDelete':_0x3448('0x167')});db[_0x3448('0x54')][_0x3448('0x112')](db[_0x3448('0x58')],{'onDelete':_0x3448('0x167')});db[_0x3448('0x54')][_0x3448('0x112')](db['SmsAccount'],{'onDelete':'restrict'});db[_0x3448('0x54')][_0x3448('0x112')](db[_0x3448('0x147')],{'onDelete':_0x3448('0x167'),'foreignKey':_0x3448('0x148')});db['SmsApplication'][_0x3448('0x112')](db[_0x3448('0x87')],{'onDelete':_0x3448('0x167'),'foreignKey':'TagId'});db[_0x3448('0x10b')][_0x3448('0x103')](db[_0x3448('0x56')],{'as':_0x3448('0x14d'),'onDelete':'cascade','foreignKey':'SmsInteractionId'});db[_0x3448('0x10b')][_0x3448('0x112')](db[_0x3448('0x52')],{'as':'Account','foreignKey':_0x3448('0x177')});db['SmsInteraction'][_0x3448('0x112')](db[_0x3448('0x117')],{'as':_0x3448('0x163'),'foreignKey':'ContactId'});db[_0x3448('0x10b')][_0x3448('0x112')](db[_0x3448('0x13')],{'as':_0x3448('0x160'),'foreignKey':'UserId'});db[_0x3448('0x10b')][_0x3448('0x115')](db[_0x3448('0x87')],{'through':'sms_interaction_has_tags','as':_0x3448('0x172')});db[_0x3448('0x10b')]['belongsToMany'](db[_0x3448('0x87')],{'through':_0x3448('0x178'),'as':_0x3448('0x162')});db[_0x3448('0x10b')][_0x3448('0x115')](db[_0x3448('0x13')],{'as':_0x3448('0x179'),'through':_0x3448('0x11f'),'foreignKey':'SmsInteractionId'});db[_0x3448('0x56')][_0x3448('0x112')](db['User'],{'as':_0x3448('0x13')});db[_0x3448('0x56')][_0x3448('0x112')](db[_0x3448('0x117')],{'onDelete':_0x3448('0x101'),'as':_0x3448('0x163')});db[_0x3448('0x56')][_0x3448('0x112')](db[_0x3448('0x10b')],{'onDelete':'cascade','as':_0x3448('0x164'),'foreignKey':_0x3448('0x17a')});db['SmsMessage'][_0x3448('0x112')](db[_0x3448('0x52')],{'as':_0x3448('0x15f'),'foreignKey':_0x3448('0x177')});db[_0x3448('0x58')]['belongsToMany'](db[_0x3448('0x13')],{'as':_0x3448('0x14a'),'through':_0x3448('0x34'),'foreignKey':'SmsQueueId'});db[_0x3448('0x58')][_0x3448('0x115')](db[_0x3448('0xd5')],{'through':_0x3448('0x17b'),'as':_0x3448('0x14b')});db[_0x3448('0x59')][_0x3448('0x103')](db[_0x3448('0x16a')],{'as':_0x3448('0x158'),'foreignKey':_0x3448('0x17c'),'onDelete':_0x3448('0x101')});db[_0x3448('0x59')][_0x3448('0x103')](db[_0x3448('0x7b')],{'as':_0x3448('0x16c'),'foreignKey':'OpenchannelAccountId'});db[_0x3448('0x59')]['hasMany'](db[_0x3448('0x5c')],{'as':_0x3448('0x16d'),'foreignKey':_0x3448('0x17c')});db[_0x3448('0x59')][_0x3448('0x103')](db[_0x3448('0x17d')],{'as':_0x3448('0x14d'),'foreignKey':_0x3448('0x17c')});db[_0x3448('0x59')]['hasMany'](db[_0x3448('0x17e')],{'as':_0x3448('0x13b'),'foreignKey':'OpenchannelAccountId'});db[_0x3448('0x59')][_0x3448('0x112')](db[_0x3448('0xe7')],{'as':_0x3448('0x159'),'foreignKey':_0x3448('0x15a')});db['OpenchannelAccount'][_0x3448('0x112')](db['Pause'],{'as':_0x3448('0x16f'),'foreignKey':_0x3448('0x15d')});db[_0x3448('0x59')][_0x3448('0x115')](db[_0x3448('0x13')],{'as':_0x3448('0x14a'),'through':_0x3448('0x132')});db[_0x3448('0x17e')][_0x3448('0x112')](db['User'],{'onDelete':_0x3448('0x167')});db['OpenchannelApplication'][_0x3448('0x112')](db[_0x3448('0x128')],{'onDelete':_0x3448('0x167'),'foreignKey':'OpenchannelQueueId'});db['OpenchannelApplication']['belongsTo'](db['OpenchannelAccount'],{'onDelete':_0x3448('0x167'),'foreignKey':'OpenchannelAccountId'});db[_0x3448('0x17e')]['belongsTo'](db['Interval'],{'onDelete':_0x3448('0x167'),'foreignKey':_0x3448('0x148')});db[_0x3448('0x17e')][_0x3448('0x112')](db[_0x3448('0x87')],{'onDelete':'restrict','foreignKey':_0x3448('0x170')});db[_0x3448('0x5c')][_0x3448('0x103')](db[_0x3448('0x17d')],{'as':'Messages','onDelete':_0x3448('0x101'),'foreignKey':_0x3448('0x17f')});db[_0x3448('0x5c')][_0x3448('0x112')](db['OpenchannelAccount'],{'as':_0x3448('0x15f'),'foreignKey':_0x3448('0x17c')});db[_0x3448('0x5c')]['belongsTo'](db['CmContact'],{'as':'Contact','foreignKey':'ContactId'});db[_0x3448('0x5c')][_0x3448('0x112')](db[_0x3448('0x13')],{'as':_0x3448('0x160'),'foreignKey':_0x3448('0x102')});db[_0x3448('0x5c')][_0x3448('0x115')](db['Tag'],{'through':_0x3448('0x180'),'as':_0x3448('0x172')});db[_0x3448('0x5c')]['belongsToMany'](db[_0x3448('0x87')],{'through':'openchannel_interaction_has_tags','as':_0x3448('0x162')});db[_0x3448('0x5c')][_0x3448('0x115')](db[_0x3448('0x13')],{'as':'Users','through':_0x3448('0x120'),'foreignKey':'OpenchannelInteractionId'});db[_0x3448('0x17d')]['belongsTo'](db[_0x3448('0x13')],{'onDelete':_0x3448('0x101'),'as':_0x3448('0x13')});db[_0x3448('0x17d')]['belongsTo'](db[_0x3448('0x117')],{'onDelete':'cascade','as':_0x3448('0x163')});db[_0x3448('0x17d')]['belongsTo'](db['OpenchannelInteraction'],{'onDelete':'cascade','as':_0x3448('0x164'),'foreignKey':_0x3448('0x17f')});db[_0x3448('0x17d')][_0x3448('0x112')](db[_0x3448('0xdd')],{'as':_0x3448('0xdd'),'foreignKey':_0x3448('0x181')});db[_0x3448('0x17d')][_0x3448('0x112')](db[_0x3448('0x59')],{'as':_0x3448('0x15f'),'foreignKey':_0x3448('0x17c')});db[_0x3448('0x128')][_0x3448('0x115')](db[_0x3448('0x13')],{'as':_0x3448('0x14a'),'through':'UserOpenchannelQueue','foreignKey':_0x3448('0x182')});db['OpenchannelQueue']['belongsToMany'](db[_0x3448('0xd5')],{'through':_0x3448('0x183'),'as':'Teams'});db[_0x3448('0x12b')][_0x3448('0x103')](db[_0x3448('0x16a')],{'as':_0x3448('0x158'),'foreignKey':'ChatWebsiteId','onDelete':_0x3448('0x101')});db['ChatWebsite'][_0x3448('0x103')](db[_0x3448('0x7b')],{'as':_0x3448('0x16c'),'foreignKey':_0x3448('0x165')});db[_0x3448('0x12b')]['hasMany'](db['ChatProactiveAction'],{'as':_0x3448('0x184')});db[_0x3448('0x12b')][_0x3448('0x103')](db[_0x3448('0x62')],{'as':'Interactions'});db[_0x3448('0x12b')]['hasMany'](db['ChatApplication'],{'as':_0x3448('0x13b')});db[_0x3448('0x12b')][_0x3448('0x103')](db[_0x3448('0x185')],{'as':_0x3448('0x14d')});db[_0x3448('0x12b')][_0x3448('0x112')](db[_0x3448('0xe7')],{'as':_0x3448('0x159'),'foreignKey':'ListId'});db['ChatWebsite'][_0x3448('0x112')](db['Interval'],{'as':_0x3448('0x147'),'foreignKey':_0x3448('0x148')});db[_0x3448('0x12b')][_0x3448('0x112')](db[_0x3448('0x3c')],{'as':_0x3448('0x3c'),'foreignKey':_0x3448('0x154')});db['ChatWebsite']['belongsTo'](db[_0x3448('0x7e')],{'as':_0x3448('0x16f'),'foreignKey':_0x3448('0x15d')});db[_0x3448('0x12b')][_0x3448('0x115')](db['User'],{'as':_0x3448('0x14a'),'through':_0x3448('0x186')});db[_0x3448('0x5f')][_0x3448('0x112')](db[_0x3448('0x59')],{});db[_0x3448('0x5f')][_0x3448('0x112')](db['CmList'],{'as':_0x3448('0x159'),'foreignKey':'ListId'});db[_0x3448('0x5f')]['belongsTo'](db[_0x3448('0x117')],{'as':'Contact','foreignKey':_0x3448('0x153')});db[_0x3448('0x5f')]['belongsTo'](db['OpenchannelInteraction'],{});db[_0x3448('0x5f')][_0x3448('0x112')](db['OpenchannelMessage'],{});db['OpenchannelQueueReport'][_0x3448('0x112')](db[_0x3448('0x13')],{});db[_0x3448('0x5f')][_0x3448('0x112')](db[_0x3448('0x128')],{});db[_0x3448('0x187')][_0x3448('0x112')](db['User'],{'as':_0x3448('0x188'),'foreignKey':_0x3448('0x102'),'onDelete':_0x3448('0x167')});db['ChatApplication'][_0x3448('0x112')](db[_0x3448('0x66')],{'as':'Queue','foreignKey':'ChatQueueId','onDelete':'restrict'});db[_0x3448('0x187')][_0x3448('0x112')](db['ChatWebsite'],{'as':_0x3448('0x189'),'foreignKey':_0x3448('0x165'),'onDelete':_0x3448('0x167')});db[_0x3448('0x187')]['belongsTo'](db[_0x3448('0x87')],{'onDelete':_0x3448('0x167'),'foreignKey':'TagId'});db['ChatInteraction'][_0x3448('0x103')](db['ChatMessage'],{'as':_0x3448('0x14d'),'onDelete':_0x3448('0x101'),'foreignKey':_0x3448('0x18a')});db[_0x3448('0x62')][_0x3448('0x112')](db[_0x3448('0x12b')],{'as':_0x3448('0x15f'),'foreignKey':_0x3448('0x165')});db['ChatInteraction']['belongsTo'](db[_0x3448('0x117')],{'as':'Contact','foreignKey':'ContactId'});db[_0x3448('0x62')]['belongsTo'](db[_0x3448('0x13')],{'as':'Owner','foreignKey':_0x3448('0x102')});db[_0x3448('0x62')]['belongsToMany'](db[_0x3448('0x87')],{'through':'chat_interaction_has_tags','as':'Tags'});db['ChatInteraction'][_0x3448('0x115')](db[_0x3448('0x87')],{'through':_0x3448('0x18b'),'as':_0x3448('0x162')});db['ChatInteraction'][_0x3448('0x115')](db[_0x3448('0x13')],{'as':_0x3448('0x179'),'through':_0x3448('0x11e'),'foreignKey':_0x3448('0x18a')});db[_0x3448('0x185')]['belongsTo'](db[_0x3448('0x13')],{'onDelete':_0x3448('0x101'),'as':_0x3448('0x13')});db['ChatMessage'][_0x3448('0x112')](db[_0x3448('0x117')],{'onDelete':'cascade','as':'Contact','foreignKey':'ContactId'});db[_0x3448('0x185')]['belongsTo'](db[_0x3448('0x62')],{'onDelete':_0x3448('0x101'),'as':_0x3448('0x164'),'foreignKey':'ChatInteractionId'});db['ChatMessage'][_0x3448('0x112')](db[_0x3448('0xdd')],{'as':_0x3448('0xdd'),'foreignKey':_0x3448('0x181')});db['ChatMessage'][_0x3448('0x112')](db[_0x3448('0x12b')],{'as':_0x3448('0x15f'),'foreignKey':'ChatWebsiteId'});db[_0x3448('0x64')][_0x3448('0x103')](db[_0x3448('0xdd')],{'as':'Attachments','foreignKey':'ChatOfflineMessageId','onDelete':_0x3448('0x101'),'hooks':!![]});db['ChatOfflineMessage']['belongsTo'](db['CmContact'],{'onDelete':_0x3448('0x101'),'as':'Contact','foreignKey':'ContactId'});db[_0x3448('0x64')][_0x3448('0x112')](db[_0x3448('0x12b')],{'as':'Account','foreignKey':_0x3448('0x165')});db['ChatQueue'][_0x3448('0x115')](db[_0x3448('0x13')],{'as':_0x3448('0x14a'),'through':_0x3448('0x18c'),'hooks':!![]});db[_0x3448('0x66')][_0x3448('0x115')](db[_0x3448('0xd5')],{'through':_0x3448('0x18d'),'as':_0x3448('0x14b')});db[_0x3448('0x68')][_0x3448('0x103')](db[_0x3448('0xc2')],{'as':'Messages','foreignKey':'ChatGroupId','onDelete':'cascade'});db[_0x3448('0x68')][_0x3448('0x115')](db[_0x3448('0x13')],{'as':_0x3448('0x13e'),'through':'chat_group_has_users'});db[_0x3448('0x69')]['belongsTo'](db['ChatWebsite'],{'as':'Website','foreignKey':_0x3448('0x165')});db[_0x3448('0x6b')]['hasMany'](db[_0x3448('0x117')],{'as':_0x3448('0x118'),'foreignKey':_0x3448('0x18e')});db[_0x3448('0x117')]['hasMany'](db['CmHopper'],{'as':'Hoppers','foreignKey':'ContactId'});db['CmContact'][_0x3448('0x103')](db['CmHopperFinal'],{'as':_0x3448('0x107'),'foreignKey':_0x3448('0x153')});db[_0x3448('0x117')]['hasMany'](db[_0x3448('0x72')],{'as':_0x3448('0x141'),'foreignKey':_0x3448('0x153')});db['CmContact'][_0x3448('0x103')](db[_0x3448('0x74')],{'as':'ReportAgentPreview','foreignKey':_0x3448('0x153')});db[_0x3448('0x117')][_0x3448('0x103')](db[_0x3448('0x142')],{'as':_0x3448('0x143'),'foreignKey':_0x3448('0x153')});db[_0x3448('0x117')][_0x3448('0x103')](db[_0x3448('0x5c')],{'as':_0x3448('0x109'),'foreignKey':_0x3448('0x153'),'onDelete':_0x3448('0x167')});db[_0x3448('0x117')][_0x3448('0x103')](db[_0x3448('0x62')],{'as':_0x3448('0x10a'),'foreignKey':'ContactId','onDelete':_0x3448('0x167')});db['CmContact'][_0x3448('0x103')](db[_0x3448('0x10b')],{'as':_0x3448('0x10c'),'foreignKey':_0x3448('0x153'),'onDelete':_0x3448('0x167')});db[_0x3448('0x117')][_0x3448('0x103')](db[_0x3448('0x4d')],{'as':'FaxInteractions','foreignKey':_0x3448('0x153'),'onDelete':_0x3448('0x167')});db[_0x3448('0x117')]['hasMany'](db[_0x3448('0x41')],{'as':'MailInteractions','foreignKey':_0x3448('0x153'),'onDelete':'restrict'});db[_0x3448('0x117')]['belongsTo'](db[_0x3448('0x6b')],{'as':_0x3448('0x18f'),'foreignKey':'CompanyId'});db[_0x3448('0x117')][_0x3448('0x112')](db['CmList'],{'as':'List','foreignKey':_0x3448('0x15a'),'onDelete':_0x3448('0x101')});db[_0x3448('0x117')][_0x3448('0x115')](db[_0x3448('0x13')],{'as':_0x3448('0x179'),'through':_0x3448('0x119')});db[_0x3448('0x117')][_0x3448('0x115')](db[_0x3448('0x87')],{'as':_0x3448('0x172'),'through':'cm_contact_has_tags'});db['CmContact'][_0x3448('0x115')](db['Tag'],{'through':_0x3448('0x190'),'as':_0x3448('0x162')});db['CmHopper'][_0x3448('0x112')](db[_0x3448('0x117')],{'as':_0x3448('0x163'),'foreignKey':_0x3448('0x153'),'onDelete':_0x3448('0x101')});db[_0x3448('0x6e')][_0x3448('0x112')](db[_0x3448('0xe7')],{'as':_0x3448('0x159'),'foreignKey':_0x3448('0x15a'),'onDelete':_0x3448('0x101')});db[_0x3448('0x6e')][_0x3448('0x112')](db[_0x3448('0x13')],{'as':_0x3448('0x188'),'foreignKey':_0x3448('0x102')});db[_0x3448('0x6e')][_0x3448('0x112')](db[_0x3448('0x1d')],{'as':_0x3448('0x191'),'foreignKey':_0x3448('0x140'),'onDelete':_0x3448('0x101')});db['CmHopper']['belongsTo'](db[_0x3448('0xd9')],{'as':_0x3448('0xd9'),'foreignKey':_0x3448('0x192'),'onDelete':_0x3448('0x101')});db[_0x3448('0x6e')][_0x3448('0x112')](db[_0x3448('0x13')],{'as':_0x3448('0x160'),'foreignKey':_0x3448('0x193')});db[_0x3448('0x6f')][_0x3448('0x112')](db[_0x3448('0x117')],{'as':_0x3448('0x163'),'foreignKey':_0x3448('0x153'),'onDelete':_0x3448('0x101')});db[_0x3448('0x6f')]['belongsTo'](db[_0x3448('0xe7')],{'as':_0x3448('0x159'),'foreignKey':_0x3448('0x15a'),'onDelete':'cascade'});db[_0x3448('0x6f')]['belongsTo'](db[_0x3448('0x1d')],{'as':_0x3448('0x191'),'foreignKey':_0x3448('0x140'),'onDelete':_0x3448('0x101')});db['CmHopperBlack'][_0x3448('0x112')](db[_0x3448('0xd9')],{'as':_0x3448('0xd9'),'foreignKey':_0x3448('0x192'),'onDelete':_0x3448('0x101')});db[_0x3448('0x194')][_0x3448('0x103')](db[_0x3448('0x195')],{'as':{'plural':_0x3448('0x196'),'singular':_0x3448('0x197')},'foreignKey':_0x3448('0x198'),'onDelete':_0x3448('0x101'),'hooks':!![]});db[_0x3448('0x194')]['hasMany'](db[_0x3448('0x195')],{'as':{'plural':'Any','singular':'OneAny'},'foreignKey':_0x3448('0x199'),'onDelete':_0x3448('0x101'),'hooks':!![]});db['Automation'][_0x3448('0x103')](db[_0x3448('0x78')],{'as':_0x3448('0x19a'),'foreignKey':'AutomationId','onDelete':_0x3448('0x101'),'hooks':!![]});db[_0x3448('0x16a')]['hasMany'](db[_0x3448('0x16a')],{'as':_0x3448('0x158'),'foreignKey':_0x3448('0x19b'),'onDelete':'cascade'});db[_0x3448('0x147')][_0x3448('0x103')](db[_0x3448('0x147')],{'as':_0x3448('0x19c'),'foreignKey':_0x3448('0x148'),'onDelete':_0x3448('0x101'),'hooks':!![],'required':![]});db[_0x3448('0x147')][_0x3448('0x103')](db[_0x3448('0x106')],{'as':_0x3448('0x19d'),'foreignKey':_0x3448('0x148'),'onDelete':'restrict'});db[_0x3448('0x147')][_0x3448('0x103')](db[_0x3448('0x44')],{'as':_0x3448('0x19e'),'foreignKey':_0x3448('0x148')});db[_0x3448('0x147')][_0x3448('0x103')](db[_0x3448('0x187')],{'as':_0x3448('0x19f'),'foreignKey':_0x3448('0x148')});db[_0x3448('0x147')][_0x3448('0x103')](db['FaxApplication'],{'as':'FaxApplications','foreignKey':_0x3448('0x148')});db['Interval']['hasMany'](db['SmsApplication'],{'as':_0x3448('0x1a0'),'foreignKey':'IntervalId'});db['Schedule']['belongsTo'](db[_0x3448('0x3c')],{});db[_0x3448('0x83')][_0x3448('0x112')](db[_0x3448('0x1a1')],{'foreignKey':_0x3448('0x1a2')});db[_0x3448('0x83')][_0x3448('0x112')](db[_0x3448('0x8f')],{'foreignKey':_0x3448('0x1a3')});db[_0x3448('0x85')][_0x3448('0x115')](db[_0x3448('0x1b')],{'as':_0x3448('0x1a4'),'through':'moh_has_sounds','onDelete':_0x3448('0x167')});db[_0x3448('0x87')][_0x3448('0x115')](db['CmContact'],{'through':_0x3448('0x190')});db['Tag'][_0x3448('0x115')](db[_0x3448('0x62')],{'through':_0x3448('0x18b')});db['Tag'][_0x3448('0x115')](db['MailInteraction'],{'through':_0x3448('0x161')});db[_0x3448('0x87')][_0x3448('0x115')](db[_0x3448('0x10b')],{'through':_0x3448('0x178')});db[_0x3448('0x87')]['belongsToMany'](db['FaxInteraction'],{'through':_0x3448('0x173')});db[_0x3448('0x87')][_0x3448('0x115')](db[_0x3448('0x5c')],{'through':_0x3448('0x180')});db[_0x3448('0x87')][_0x3448('0x115')](db[_0x3448('0x10f')],{'through':_0x3448('0x1a5')});db[_0x3448('0x1a6')][_0x3448('0x103')](db[_0x3448('0x195')],{'as':{'plural':_0x3448('0x1a7'),'singular':_0x3448('0x1a8')},'foreignKey':_0x3448('0x1a9'),'onDelete':'cascade','hooks':!![]});db['Trigger'][_0x3448('0x103')](db[_0x3448('0x195')],{'as':{'plural':_0x3448('0x1aa'),'singular':_0x3448('0x1ab')},'foreignKey':'TriggerAnyId','onDelete':_0x3448('0x101'),'hooks':!![]});db['Trigger'][_0x3448('0x103')](db[_0x3448('0x78')],{'as':'Actions','foreignKey':_0x3448('0x1ac'),'onDelete':_0x3448('0x101'),'hooks':!![]});db[_0x3448('0x8f')][_0x3448('0x103')](db['AnalyticFieldReport'],{'as':'Fields','onDelete':_0x3448('0x101'),'foreignKey':_0x3448('0x1a3'),'hooks':!![]});db[_0x3448('0x1a1')]['hasMany'](db['AnalyticFieldReport'],{'as':_0x3448('0x1ad'),'onDelete':_0x3448('0x101'),'foreignKey':_0x3448('0x1a2')});db[_0x3448('0x94')]['hasMany'](db['AnalyticFieldReport'],{'as':_0x3448('0x1ad'),'onDelete':'cascade','foreignKey':'MetricId'});db[_0x3448('0x96')][_0x3448('0x112')](db['AnalyticMetric'],{'foreignKey':_0x3448('0x1ae')});db['SalesforceAccount']['hasMany'](db['SalesforceConfiguration'],{'as':_0x3448('0x1af'),'onDelete':_0x3448('0x101'),'foreignKey':_0x3448('0x1b0')});db['SalesforceConfiguration'][_0x3448('0x103')](db[_0x3448('0x9c')],{'as':_0x3448('0x1b1'),'onDelete':_0x3448('0x101'),'foreignKey':_0x3448('0x1b2')});db[_0x3448('0x1b3')][_0x3448('0x103')](db[_0x3448('0x9c')],{'as':_0x3448('0x1b4'),'onDelete':_0x3448('0x101'),'foreignKey':_0x3448('0x1b5')});db['SalesforceConfiguration'][_0x3448('0x103')](db[_0x3448('0x9c')],{'as':_0x3448('0x1ad'),'onDelete':'cascade','foreignKey':'FieldId'});db['SalesforceConfiguration'][_0x3448('0x112')](db[_0x3448('0x99')],{'as':'Account','foreignKey':_0x3448('0x1b0')});db[_0x3448('0x9c')]['hasMany'](db[_0x3448('0x9c')],{'as':'Subject','foreignKey':_0x3448('0x1b2')});db[_0x3448('0x9c')][_0x3448('0x103')](db[_0x3448('0x9c')],{'as':_0x3448('0x1b6'),'foreignKey':_0x3448('0x1b5')});db['SalesforceField'][_0x3448('0x103')](db[_0x3448('0x9c')],{'as':_0x3448('0x1b7'),'foreignKey':_0x3448('0x1b8')});db['SalesforceField'][_0x3448('0x112')](db[_0x3448('0x1b9')],{'as':'Variable','foreignKey':_0x3448('0x1ba')});db['SugarcrmAccount'][_0x3448('0x103')](db[_0x3448('0x1bb')],{'as':_0x3448('0x1af'),'onDelete':'cascade','foreignKey':_0x3448('0x1b0')});db[_0x3448('0x1bb')][_0x3448('0x103')](db[_0x3448('0x1bc')],{'as':'Subjects','onDelete':_0x3448('0x101'),'foreignKey':'SubjectId'});db[_0x3448('0x1bb')][_0x3448('0x103')](db['SugarcrmField'],{'as':_0x3448('0x1b4'),'onDelete':'cascade','foreignKey':'DescriptionId'});db[_0x3448('0x1bb')][_0x3448('0x103')](db['SugarcrmField'],{'as':'Fields','onDelete':'cascade','foreignKey':_0x3448('0x1b8')});db[_0x3448('0x1bb')][_0x3448('0x112')](db[_0x3448('0x1bd')],{'as':_0x3448('0x15f'),'foreignKey':_0x3448('0x1b0')});db['SugarcrmField'][_0x3448('0x103')](db[_0x3448('0x1bc')],{'as':'Subject','foreignKey':_0x3448('0x1b2')});db['SugarcrmField'][_0x3448('0x103')](db[_0x3448('0x1bc')],{'as':_0x3448('0x1b6'),'foreignKey':_0x3448('0x1b5')});db[_0x3448('0x1bc')][_0x3448('0x103')](db[_0x3448('0x1bc')],{'as':_0x3448('0x1b7'),'foreignKey':'FieldId'});db['SugarcrmField'][_0x3448('0x112')](db[_0x3448('0x1b9')],{'as':_0x3448('0x1b9'),'foreignKey':'VariableId'});db[_0x3448('0xa0')][_0x3448('0x103')](db[_0x3448('0xa1')],{'as':_0x3448('0x1af'),'onDelete':_0x3448('0x101'),'foreignKey':_0x3448('0x1b0')});db[_0x3448('0xa1')][_0x3448('0x103')](db[_0x3448('0xa2')],{'as':_0x3448('0x1b1'),'onDelete':'cascade','foreignKey':_0x3448('0x1b2')});db[_0x3448('0xa1')][_0x3448('0x103')](db['DeskField'],{'as':_0x3448('0x1b4'),'onDelete':_0x3448('0x101'),'foreignKey':_0x3448('0x1b5')});db[_0x3448('0xa1')]['hasMany'](db['DeskField'],{'as':_0x3448('0x1ad'),'onDelete':_0x3448('0x101'),'foreignKey':'FieldId'});db[_0x3448('0xa1')][_0x3448('0x112')](db[_0x3448('0xa0')],{'as':_0x3448('0x15f'),'foreignKey':_0x3448('0x1b0')});db['DeskConfiguration'][_0x3448('0x115')](db[_0x3448('0x87')],{'through':_0x3448('0x1be')});db[_0x3448('0xa2')][_0x3448('0x103')](db[_0x3448('0xa2')],{'as':_0x3448('0x1bf'),'foreignKey':'SubjectId'});db['DeskField']['hasMany'](db[_0x3448('0xa2')],{'as':_0x3448('0x1b6'),'foreignKey':_0x3448('0x1b5')});db[_0x3448('0xa2')][_0x3448('0x103')](db[_0x3448('0xa2')],{'as':_0x3448('0x1b7'),'foreignKey':_0x3448('0x1b8')});db[_0x3448('0xa2')]['belongsTo'](db[_0x3448('0x1b9')],{'as':_0x3448('0x1b9'),'foreignKey':'VariableId'});db[_0x3448('0xa4')][_0x3448('0x103')](db[_0x3448('0xa6')],{'as':_0x3448('0x1af'),'onDelete':_0x3448('0x101'),'foreignKey':_0x3448('0x1b0')});db[_0x3448('0xa6')][_0x3448('0x103')](db['ZohoField'],{'as':_0x3448('0x1b1'),'onDelete':_0x3448('0x101'),'foreignKey':'SubjectId'});db['ZohoConfiguration'][_0x3448('0x103')](db[_0x3448('0x1c0')],{'as':_0x3448('0x1b4'),'onDelete':'cascade','foreignKey':_0x3448('0x1b5')});db[_0x3448('0xa6')]['hasMany'](db[_0x3448('0x1c0')],{'as':_0x3448('0x1ad'),'onDelete':_0x3448('0x101'),'foreignKey':_0x3448('0x1b8')});db[_0x3448('0xa6')][_0x3448('0x112')](db[_0x3448('0xa4')],{'as':_0x3448('0x15f'),'foreignKey':_0x3448('0x1b0')});db[_0x3448('0x1c0')][_0x3448('0x103')](db[_0x3448('0x1c0')],{'as':_0x3448('0x1bf'),'foreignKey':'SubjectId'});db[_0x3448('0x1c0')][_0x3448('0x103')](db['ZohoField'],{'as':_0x3448('0x1b6'),'foreignKey':_0x3448('0x1b5')});db[_0x3448('0x1c0')][_0x3448('0x103')](db[_0x3448('0x1c0')],{'as':_0x3448('0x1b7'),'foreignKey':'FieldId'});db[_0x3448('0x1c0')][_0x3448('0x112')](db[_0x3448('0x1b9')],{'as':_0x3448('0x1b9'),'foreignKey':_0x3448('0x1ba')});db[_0x3448('0xa9')][_0x3448('0x103')](db['ZendeskConfiguration'],{'as':_0x3448('0x1af'),'onDelete':_0x3448('0x101'),'foreignKey':_0x3448('0x1b0')});db[_0x3448('0xab')]['hasMany'](db[_0x3448('0x1c1')],{'as':_0x3448('0x1b1'),'foreignKey':_0x3448('0x1b2')});db[_0x3448('0xab')][_0x3448('0x103')](db['ZendeskField'],{'as':_0x3448('0x1b4'),'foreignKey':_0x3448('0x1b5')});db[_0x3448('0xab')]['hasMany'](db[_0x3448('0x1c1')],{'as':_0x3448('0x1ad'),'foreignKey':'FieldId'});db[_0x3448('0xab')][_0x3448('0x112')](db['ZendeskAccount'],{'as':_0x3448('0x15f'),'foreignKey':_0x3448('0x1b0')});db['ZendeskConfiguration'][_0x3448('0x115')](db[_0x3448('0x87')],{'through':_0x3448('0x1c2')});db[_0x3448('0x1c1')][_0x3448('0x103')](db[_0x3448('0x1c1')],{'as':'Subject','foreignKey':'SubjectId'});db[_0x3448('0x1c1')][_0x3448('0x103')](db[_0x3448('0x1c1')],{'as':'Description','foreignKey':'DescriptionId'});db[_0x3448('0x1c1')][_0x3448('0x103')](db[_0x3448('0x1c1')],{'as':_0x3448('0x1b7'),'foreignKey':_0x3448('0x1b8')});db['ZendeskField'][_0x3448('0x112')](db['Variable'],{'as':_0x3448('0x1b9'),'foreignKey':'VariableId'});db['FreshdeskAccount'][_0x3448('0x103')](db['FreshdeskConfiguration'],{'as':'Configurations','onDelete':_0x3448('0x101'),'foreignKey':_0x3448('0x1b0')});db[_0x3448('0xaf')]['hasMany'](db['FreshdeskField'],{'as':_0x3448('0x1b1'),'onDelete':_0x3448('0x101'),'foreignKey':_0x3448('0x1b2')});db[_0x3448('0xaf')]['hasMany'](db['FreshdeskField'],{'as':_0x3448('0x1b4'),'onDelete':'cascade','foreignKey':_0x3448('0x1b5')});db[_0x3448('0xaf')][_0x3448('0x103')](db[_0x3448('0xb1')],{'as':_0x3448('0x1ad'),'onDelete':_0x3448('0x101'),'foreignKey':_0x3448('0x1b8')});db[_0x3448('0xaf')]['belongsTo'](db['FreshdeskAccount'],{'as':_0x3448('0x15f'),'foreignKey':'AccountId'});db[_0x3448('0xaf')][_0x3448('0x115')](db[_0x3448('0x87')],{'through':_0x3448('0x1c3')});db[_0x3448('0xb1')][_0x3448('0x103')](db['FreshdeskField'],{'as':_0x3448('0x1bf'),'foreignKey':'SubjectId'});db[_0x3448('0xb1')][_0x3448('0x103')](db[_0x3448('0xb1')],{'as':_0x3448('0x1b6'),'foreignKey':_0x3448('0x1b5')});db[_0x3448('0xb1')]['hasMany'](db[_0x3448('0xb1')],{'as':_0x3448('0x1b7'),'foreignKey':'FieldId'});db[_0x3448('0xb1')]['belongsTo'](db[_0x3448('0x1b9')],{'as':_0x3448('0x1b9'),'foreignKey':_0x3448('0x1ba')});db[_0x3448('0xb3')][_0x3448('0x103')](db['VtigerConfiguration'],{'as':_0x3448('0x1af'),'onDelete':_0x3448('0x101'),'foreignKey':_0x3448('0x1b0')});db[_0x3448('0x1c4')][_0x3448('0x103')](db[_0x3448('0x1c5')],{'as':_0x3448('0x1b1'),'foreignKey':_0x3448('0x1b2')});db['VtigerConfiguration'][_0x3448('0x103')](db['VtigerField'],{'as':'Descriptions','foreignKey':_0x3448('0x1b5')});db[_0x3448('0x1c4')][_0x3448('0x103')](db[_0x3448('0x1c5')],{'as':_0x3448('0x1ad'),'foreignKey':_0x3448('0x1b8')});db[_0x3448('0x1c4')][_0x3448('0x112')](db[_0x3448('0xb3')],{'as':_0x3448('0x15f'),'foreignKey':_0x3448('0x1b0')});db[_0x3448('0x1c5')][_0x3448('0x103')](db['VtigerField'],{'as':_0x3448('0x1bf'),'foreignKey':_0x3448('0x1b2')});db['VtigerField']['hasMany'](db[_0x3448('0x1c5')],{'as':_0x3448('0x1b6'),'foreignKey':_0x3448('0x1b5')});db[_0x3448('0x1c5')][_0x3448('0x103')](db[_0x3448('0x1c5')],{'as':'Field','foreignKey':_0x3448('0x1b8')});db[_0x3448('0x1c5')][_0x3448('0x112')](db[_0x3448('0x1b9')],{'as':'Variable','foreignKey':'VariableId'});db['ServicenowAccount'][_0x3448('0x103')](db[_0x3448('0xb8')],{'as':_0x3448('0x1af'),'onDelete':_0x3448('0x101'),'foreignKey':_0x3448('0x1b0')});db[_0x3448('0xb8')]['hasMany'](db['ServicenowField'],{'as':_0x3448('0x1b1'),'foreignKey':'SubjectId'});db['ServicenowConfiguration'][_0x3448('0x103')](db[_0x3448('0xb9')],{'as':'Descriptions','foreignKey':_0x3448('0x1b5')});db['ServicenowConfiguration'][_0x3448('0x103')](db[_0x3448('0xb9')],{'as':_0x3448('0x1ad'),'foreignKey':_0x3448('0x1b8')});db[_0x3448('0xb8')][_0x3448('0x112')](db[_0x3448('0xb7')],{'as':_0x3448('0x15f'),'foreignKey':_0x3448('0x1b0')});db[_0x3448('0xb9')]['hasMany'](db[_0x3448('0xb9')],{'as':_0x3448('0x1bf'),'foreignKey':_0x3448('0x1b2')});db['ServicenowField'][_0x3448('0x103')](db[_0x3448('0xb9')],{'as':'Description','foreignKey':'DescriptionId'});db[_0x3448('0xb9')][_0x3448('0x103')](db[_0x3448('0xb9')],{'as':'Field','foreignKey':_0x3448('0x1b8')});db[_0x3448('0xb9')][_0x3448('0x112')](db['Variable'],{'as':_0x3448('0x1b9'),'foreignKey':_0x3448('0x1ba')});db[_0x3448('0x1c6')][_0x3448('0x103')](db[_0x3448('0x1c7')],{'as':_0x3448('0x1af'),'onDelete':_0x3448('0x101'),'foreignKey':_0x3448('0x1b0')});db[_0x3448('0x1c7')]['hasMany'](db[_0x3448('0x1c8')],{'as':_0x3448('0x1b1'),'onDelete':'cascade','foreignKey':_0x3448('0x1b2')});db['Dynamics365Configuration'][_0x3448('0x103')](db[_0x3448('0x1c8')],{'as':_0x3448('0x1b4'),'onDelete':_0x3448('0x101'),'foreignKey':'DescriptionId'});db[_0x3448('0x1c7')][_0x3448('0x103')](db[_0x3448('0x1c8')],{'as':_0x3448('0x1ad'),'onDelete':_0x3448('0x101'),'foreignKey':_0x3448('0x1b8')});db[_0x3448('0x1c7')][_0x3448('0x112')](db['Dynamics365Account'],{'as':_0x3448('0x15f'),'foreignKey':_0x3448('0x1b0')});db['Dynamics365Field'][_0x3448('0x103')](db[_0x3448('0x1c8')],{'as':_0x3448('0x1bf'),'foreignKey':'SubjectId'});db['Dynamics365Field']['hasMany'](db[_0x3448('0x1c8')],{'as':_0x3448('0x1b6'),'foreignKey':'DescriptionId'});db[_0x3448('0x1c8')][_0x3448('0x103')](db[_0x3448('0x1c8')],{'as':'Field','foreignKey':_0x3448('0x1b8')});db[_0x3448('0x1c8')][_0x3448('0x112')](db[_0x3448('0x1b9')],{'as':'Variable','foreignKey':'VariableId'});db['FreshsalesAccount'][_0x3448('0x103')](db[_0x3448('0x1c9')],{'as':'Configurations','onDelete':_0x3448('0x101'),'foreignKey':_0x3448('0x1b0')});db[_0x3448('0x1c9')]['hasMany'](db[_0x3448('0x1ca')],{'as':_0x3448('0x1b1'),'foreignKey':_0x3448('0x1b2')});db[_0x3448('0x1c9')][_0x3448('0x103')](db['FreshsalesField'],{'as':_0x3448('0x1b4'),'foreignKey':'DescriptionId'});db['FreshsalesConfiguration'][_0x3448('0x103')](db['FreshsalesField'],{'as':'Fields','foreignKey':_0x3448('0x1b8')});db['FreshsalesConfiguration'][_0x3448('0x112')](db[_0x3448('0xbd')],{'as':'Account','foreignKey':_0x3448('0x1b0')});db[_0x3448('0x1ca')][_0x3448('0x103')](db['FreshsalesField'],{'as':_0x3448('0x1bf'),'foreignKey':'SubjectId'});db[_0x3448('0x1ca')][_0x3448('0x103')](db['FreshsalesField'],{'as':_0x3448('0x1b6'),'foreignKey':_0x3448('0x1b5')});db[_0x3448('0x1ca')][_0x3448('0x103')](db[_0x3448('0x1ca')],{'as':_0x3448('0x1b7'),'foreignKey':_0x3448('0x1b8')});db[_0x3448('0x1ca')][_0x3448('0x112')](db[_0x3448('0x1b9')],{'as':_0x3448('0x1b9'),'foreignKey':_0x3448('0x1ba')});db[_0x3448('0xc1')][_0x3448('0x112')](db[_0x3448('0x12b')],{});db['ChatQueueReport'][_0x3448('0x112')](db['CmList'],{'as':_0x3448('0x159'),'foreignKey':_0x3448('0x15a')});db['ChatQueueReport']['belongsTo'](db[_0x3448('0x117')],{'as':_0x3448('0x163'),'foreignKey':'ContactId'});db[_0x3448('0xc1')][_0x3448('0x112')](db[_0x3448('0x62')],{});db[_0x3448('0xc1')][_0x3448('0x112')](db[_0x3448('0x185')],{});db[_0x3448('0xc1')][_0x3448('0x112')](db['User'],{});db[_0x3448('0xc1')][_0x3448('0x112')](db['ChatQueue'],{});db['ChatInternalMessage'][_0x3448('0x112')](db[_0x3448('0x13')],{'onDelete':_0x3448('0x101'),'foreignKey':_0x3448('0x1cb')});db[_0x3448('0xc2')][_0x3448('0x112')](db[_0x3448('0x13')],{'onDelete':_0x3448('0x101'),'foreignKey':_0x3448('0x1cc')});db[_0x3448('0x142')][_0x3448('0x103')](db[_0x3448('0x1cd')],{'foreignKey':_0x3448('0x1ce'),'onDelete':_0x3448('0x101')});db[_0x3448('0x142')][_0x3448('0x103')](db[_0x3448('0x1cf')],{'foreignKey':_0x3448('0x1ce'),'onDelete':_0x3448('0x101')});db[_0x3448('0xc5')][_0x3448('0x112')](db[_0x3448('0x52')],{});db['SmsQueueReport']['belongsTo'](db[_0x3448('0xe7')],{'as':_0x3448('0x159'),'foreignKey':_0x3448('0x15a')});db[_0x3448('0xc5')]['belongsTo'](db['CmContact'],{'as':_0x3448('0x163'),'foreignKey':_0x3448('0x153')});db[_0x3448('0xc5')][_0x3448('0x112')](db[_0x3448('0x10b')],{});db['SmsQueueReport']['belongsTo'](db['SmsMessage'],{});db[_0x3448('0xc5')][_0x3448('0x112')](db[_0x3448('0x13')],{});db[_0x3448('0xc5')][_0x3448('0x112')](db[_0x3448('0x58')],{});db[_0x3448('0xc9')][_0x3448('0x103')](db[_0x3448('0x142')],{'foreignKey':'ProjectId'});db[_0x3448('0xc9')][_0x3448('0x103')](db[_0x3448('0x1cd')],{'foreignKey':_0x3448('0x1d0')});db['JscriptyProject']['hasMany'](db[_0x3448('0x1cf')],{'foreignKey':'ProjectId'});db[_0x3448('0xcf')]['belongsToMany'](db[_0x3448('0x13')],{'as':'Users','through':_0x3448('0x138')});db[_0x3448('0xd5')][_0x3448('0x115')](db[_0x3448('0x13')],{'as':_0x3448('0x14a'),'through':_0x3448('0x11c')});db['Team'][_0x3448('0x115')](db['VoiceQueue'],{'through':'TeamVoiceQueue','as':_0x3448('0x1d1')});db[_0x3448('0xd5')][_0x3448('0x115')](db['MailQueue'],{'through':'team_has_mail_queues','as':_0x3448('0x123')});db['Team'][_0x3448('0x115')](db['ChatQueue'],{'through':_0x3448('0x18d'),'as':_0x3448('0x125')});db[_0x3448('0xd5')][_0x3448('0x115')](db[_0x3448('0x50')],{'through':'team_has_fax_queues','as':'FaxQueues'});db['Team']['belongsToMany'](db[_0x3448('0x58')],{'through':_0x3448('0x17b'),'as':_0x3448('0x127')});db[_0x3448('0xd5')][_0x3448('0x115')](db[_0x3448('0x128')],{'through':_0x3448('0x183'),'as':_0x3448('0x129')});db[_0x3448('0xd5')][_0x3448('0x115')](db[_0x3448('0xfa')],{'through':_0x3448('0x1d2'),'as':_0x3448('0x12a')});db['Team'][_0x3448('0x115')](db[_0x3448('0xe9')],{'through':_0x3448('0x1d3'),'as':_0x3448('0x122')});db['Campaign'][_0x3448('0x103')](db[_0x3448('0x6e')],{'as':_0x3448('0x13f'),'foreignKey':_0x3448('0x192')});db[_0x3448('0xd9')]['hasMany'](db['CmHopperFinal'],{'as':_0x3448('0x107'),'foreignKey':_0x3448('0x192')});db[_0x3448('0xd9')][_0x3448('0x103')](db[_0x3448('0x72')],{'as':_0x3448('0x141'),'foreignKey':_0x3448('0x192')});db[_0x3448('0xd9')]['hasMany'](db[_0x3448('0x6f')],{'as':_0x3448('0x1d4'),'foreignKey':_0x3448('0x192')});db[_0x3448('0xd9')]['belongsTo'](db[_0x3448('0x2c')],{'as':'Trunk','foreignKey':_0x3448('0x144')});db['Campaign'][_0x3448('0x112')](db[_0x3448('0x2c')],{'as':_0x3448('0x145'),'foreignKey':_0x3448('0x146')});db[_0x3448('0xd9')]['belongsTo'](db[_0x3448('0x147')],{'as':_0x3448('0x147'),'foreignKey':'IntervalId'});db['Campaign'][_0x3448('0x112')](db[_0x3448('0xcf')],{'as':_0x3448('0xcf'),'foreignKey':'SquareProjectId'});db['Campaign']['belongsToMany'](db['CmList'],{'as':_0x3448('0x11a'),'through':_0x3448('0x1d5')});db['Campaign'][_0x3448('0x115')](db[_0x3448('0xe7')],{'as':'BlackLists','through':'campaigns_has_cm_blacklists'});db['Attachment']['belongsTo'](db[_0x3448('0x64')],{'as':_0x3448('0x64'),'foreignKey':_0x3448('0x166')});db[_0x3448('0x1d6')][_0x3448('0x112')](db[_0x3448('0x43')],{});db[_0x3448('0x1d6')][_0x3448('0x112')](db['MailInteraction'],{});db[_0x3448('0x1d6')]['belongsTo'](db['MailAccount'],{'foreignKey':'FromMailAccountId','as':'FromAccount'});db[_0x3448('0x1d6')][_0x3448('0x112')](db[_0x3448('0x13')],{'foreignKey':'FromUserId','as':_0x3448('0x1d7')});db['MailTransferReport'][_0x3448('0x112')](db[_0x3448('0x13')],{'foreignKey':_0x3448('0x1d8'),'as':_0x3448('0x1d9')});db[_0x3448('0x1d6')][_0x3448('0x112')](db[_0x3448('0x3d')],{'foreignKey':_0x3448('0x1da'),'as':'ToQueue'});db[_0x3448('0x1d6')]['belongsTo'](db[_0x3448('0x3c')],{'foreignKey':_0x3448('0x1db'),'as':'ToAccount'});db[_0x3448('0x1dc')][_0x3448('0x112')](db[_0x3448('0x185')],{});db[_0x3448('0x1dc')][_0x3448('0x112')](db[_0x3448('0x62')],{});db[_0x3448('0x1dc')][_0x3448('0x112')](db[_0x3448('0x12b')],{'foreignKey':'FromChatWebsiteId','as':'FromAccount'});db[_0x3448('0x1dc')]['belongsTo'](db['User'],{'foreignKey':_0x3448('0x1dd'),'as':'FromAgent'});db[_0x3448('0x1dc')][_0x3448('0x112')](db[_0x3448('0x13')],{'foreignKey':'ToUserId','as':'ToAgent'});db[_0x3448('0x1dc')][_0x3448('0x112')](db[_0x3448('0x66')],{'foreignKey':_0x3448('0x1de'),'as':'ToQueue'});db[_0x3448('0x1dc')][_0x3448('0x112')](db['ChatWebsite'],{'foreignKey':_0x3448('0x1df'),'as':_0x3448('0x1e0')});db['FaxTransferReport'][_0x3448('0x112')](db[_0x3448('0x4e')],{});db[_0x3448('0xe2')][_0x3448('0x112')](db['FaxInteraction'],{});db['FaxTransferReport'][_0x3448('0x112')](db['FaxAccount'],{'foreignKey':_0x3448('0x1e1'),'as':_0x3448('0x1e2')});db[_0x3448('0xe2')][_0x3448('0x112')](db[_0x3448('0x13')],{'foreignKey':'FromUserId','as':_0x3448('0x1d7')});db[_0x3448('0xe2')]['belongsTo'](db[_0x3448('0x13')],{'foreignKey':_0x3448('0x1d8'),'as':_0x3448('0x1d9')});db[_0x3448('0xe2')][_0x3448('0x112')](db[_0x3448('0x50')],{'foreignKey':_0x3448('0x1e3'),'as':_0x3448('0x1e4')});db[_0x3448('0xe2')][_0x3448('0x112')](db['FaxAccount'],{'foreignKey':_0x3448('0x1e5'),'as':'ToAccount'});db[_0x3448('0xe4')][_0x3448('0x112')](db[_0x3448('0x17d')],{});db[_0x3448('0xe4')][_0x3448('0x112')](db[_0x3448('0x5c')],{});db[_0x3448('0xe4')][_0x3448('0x112')](db['OpenchannelAccount'],{'foreignKey':_0x3448('0x1e6'),'as':_0x3448('0x1e2')});db[_0x3448('0xe4')]['belongsTo'](db[_0x3448('0x13')],{'foreignKey':_0x3448('0x1dd'),'as':_0x3448('0x1d7')});db[_0x3448('0xe4')][_0x3448('0x112')](db[_0x3448('0x13')],{'foreignKey':'ToUserId','as':_0x3448('0x1d9')});db[_0x3448('0xe4')][_0x3448('0x112')](db[_0x3448('0x128')],{'foreignKey':_0x3448('0x1e7'),'as':'ToQueue'});db[_0x3448('0xe4')][_0x3448('0x112')](db[_0x3448('0x59')],{'foreignKey':'ToOpenchannelAccountId','as':'ToAccount'});db[_0x3448('0x1e8')]['belongsTo'](db[_0x3448('0x56')],{});db[_0x3448('0x1e8')]['belongsTo'](db[_0x3448('0x10b')],{});db[_0x3448('0x1e8')][_0x3448('0x112')](db[_0x3448('0x52')],{'foreignKey':_0x3448('0x1e9'),'as':_0x3448('0x1e2')});db[_0x3448('0x1e8')][_0x3448('0x112')](db[_0x3448('0x13')],{'foreignKey':_0x3448('0x1dd'),'as':_0x3448('0x1d7')});db[_0x3448('0x1e8')]['belongsTo'](db[_0x3448('0x13')],{'foreignKey':_0x3448('0x1d8'),'as':_0x3448('0x1d9')});db[_0x3448('0x1e8')][_0x3448('0x112')](db[_0x3448('0x58')],{'foreignKey':_0x3448('0x1ea'),'as':_0x3448('0x1e4')});db[_0x3448('0x1e8')][_0x3448('0x112')](db['SmsAccount'],{'foreignKey':_0x3448('0x1eb'),'as':'ToAccount'});db[_0x3448('0xe7')][_0x3448('0x103')](db[_0x3448('0x16a')],{'as':_0x3448('0x158'),'foreignKey':_0x3448('0x15a'),'onDelete':'cascade'});db['CmList'][_0x3448('0x103')](db[_0x3448('0x76')],{'as':'CustomFields','foreignKey':_0x3448('0x15a')});db['CmList'][_0x3448('0x103')](db[_0x3448('0x117')],{'as':_0x3448('0x118'),'onDelete':_0x3448('0x101'),'foreignKey':_0x3448('0x15a')});db[_0x3448('0xe7')][_0x3448('0x103')](db['CmHopperFinal'],{'as':_0x3448('0x107'),'foreignKey':_0x3448('0x15a')});db[_0x3448('0xe7')][_0x3448('0x103')](db[_0x3448('0x72')],{'as':_0x3448('0x108'),'foreignKey':_0x3448('0x15a')});db[_0x3448('0xe7')][_0x3448('0x103')](db['ReportAgentPreview'],{'as':'ReportAgentPreview','foreignKey':_0x3448('0x15a')});db[_0x3448('0xe7')][_0x3448('0x115')](db[_0x3448('0x1d')],{'as':'Queues','through':_0x3448('0x149')});db[_0x3448('0xe7')]['belongsToMany'](db[_0x3448('0x13')],{'as':_0x3448('0x14a'),'through':_0x3448('0x11b')});db[_0x3448('0xe9')][_0x3448('0x103')](db[_0x3448('0x106')],{'as':_0x3448('0x19d'),'onDelete':_0x3448('0x101')});db[_0x3448('0xe9')][_0x3448('0x115')](db[_0x3448('0x13')],{'as':_0x3448('0x14a'),'through':_0x3448('0x1ec')});db[_0x3448('0xe9')][_0x3448('0x115')](db[_0x3448('0xd5')],{'through':'TeamVoicePrefix','as':'Teams'});db[_0x3448('0x113')][_0x3448('0x103')](db[_0x3448('0x13')],{'as':_0x3448('0x179'),'foreignKey':_0x3448('0x114')});db['UserProfile'][_0x3448('0x103')](db[_0x3448('0x1ed')],{'as':_0x3448('0x1ee'),'foreignKey':_0x3448('0x114'),'onDelete':_0x3448('0x101')});db['UserProfileSection'][_0x3448('0x103')](db[_0x3448('0xed')],{'as':_0x3448('0x1ef'),'foreignKey':_0x3448('0x1f0'),'onDelete':'cascade'});db[_0x3448('0xf1')]['hasMany'](db[_0x3448('0x16a')],{'as':_0x3448('0x158'),'foreignKey':_0x3448('0x1f1'),'onDelete':_0x3448('0x101')});db['WhatsappAccount'][_0x3448('0x103')](db[_0x3448('0x7b')],{'as':'Answers','foreignKey':_0x3448('0x1f1')});db['WhatsappAccount'][_0x3448('0x103')](db[_0x3448('0xf4')],{'as':_0x3448('0x14d'),'foreignKey':_0x3448('0x1f1')});db['WhatsappAccount']['hasMany'](db[_0x3448('0x10f')],{'as':_0x3448('0x16d')});db[_0x3448('0xf1')][_0x3448('0x103')](db[_0x3448('0x1f2')],{'as':_0x3448('0x13b')});db[_0x3448('0xf1')]['belongsTo'](db[_0x3448('0xe7')],{'as':'List','foreignKey':_0x3448('0x15a')});db['WhatsappAccount'][_0x3448('0x112')](db[_0x3448('0x7e')],{'as':'mandatoryDispositionPause','foreignKey':_0x3448('0x15d')});db[_0x3448('0xf1')]['belongsToMany'](db[_0x3448('0x13')],{'as':_0x3448('0x14a'),'through':_0x3448('0x136')});db[_0x3448('0x1f2')]['belongsTo'](db['User'],{'onDelete':_0x3448('0x167')});db['WhatsappApplication'][_0x3448('0x112')](db[_0x3448('0xfa')],{'onDelete':'restrict'});db[_0x3448('0x1f2')]['belongsTo'](db[_0x3448('0xf1')],{'onDelete':_0x3448('0x167')});db[_0x3448('0x1f2')][_0x3448('0x112')](db[_0x3448('0x147')],{'onDelete':_0x3448('0x167'),'foreignKey':_0x3448('0x148')});db[_0x3448('0x1f2')][_0x3448('0x112')](db[_0x3448('0x87')],{'onDelete':_0x3448('0x167'),'foreignKey':'TagId'});db[_0x3448('0x10f')][_0x3448('0x103')](db['WhatsappMessage'],{'as':'Messages','onDelete':_0x3448('0x101'),'foreignKey':'WhatsappInteractionId'});db['WhatsappInteraction']['belongsTo'](db[_0x3448('0xf1')],{'as':_0x3448('0x15f'),'foreignKey':'WhatsappAccountId'});db['WhatsappInteraction'][_0x3448('0x112')](db[_0x3448('0x117')],{'as':_0x3448('0x163'),'foreignKey':'ContactId'});db[_0x3448('0x10f')][_0x3448('0x112')](db[_0x3448('0x13')],{'as':_0x3448('0x160'),'foreignKey':_0x3448('0x102')});db[_0x3448('0x10f')][_0x3448('0x115')](db[_0x3448('0x87')],{'through':_0x3448('0x1a5'),'as':_0x3448('0x172')});db[_0x3448('0x10f')][_0x3448('0x115')](db[_0x3448('0x87')],{'through':'whatsapp_interaction_has_tags','as':'ThroughTags'});db[_0x3448('0x10f')]['belongsToMany'](db['User'],{'as':_0x3448('0x179'),'through':_0x3448('0x1f3'),'foreignKey':_0x3448('0x1f4')});db[_0x3448('0xf4')][_0x3448('0x112')](db[_0x3448('0x13')],{'as':_0x3448('0x13')});db[_0x3448('0xf4')][_0x3448('0x112')](db[_0x3448('0x117')],{'onDelete':_0x3448('0x101'),'as':'Contact'});db['WhatsappMessage'][_0x3448('0x112')](db[_0x3448('0x10f')],{'onDelete':_0x3448('0x101'),'as':_0x3448('0x164'),'foreignKey':'WhatsappInteractionId'});db[_0x3448('0xf4')][_0x3448('0x112')](db['WhatsappAccount'],{'as':_0x3448('0x15f'),'foreignKey':_0x3448('0x1f1')});db[_0x3448('0xf6')]['belongsTo'](db[_0x3448('0xf1')],{});db[_0x3448('0xf6')][_0x3448('0x112')](db['CmList'],{'as':_0x3448('0x159'),'foreignKey':_0x3448('0x15a')});db['WhatsappQueueReport']['belongsTo'](db[_0x3448('0x117')],{'as':_0x3448('0x163'),'foreignKey':_0x3448('0x153')});db['WhatsappQueueReport']['belongsTo'](db[_0x3448('0x10f')],{});db[_0x3448('0xf6')][_0x3448('0x112')](db[_0x3448('0xfa')],{});db[_0x3448('0xf6')][_0x3448('0x112')](db[_0x3448('0xf4')],{});db[_0x3448('0xf6')][_0x3448('0x112')](db[_0x3448('0x13')],{});db[_0x3448('0xf8')][_0x3448('0x112')](db[_0x3448('0xf4')],{});db['WhatsappTransferReport'][_0x3448('0x112')](db[_0x3448('0x10f')],{});db[_0x3448('0xf8')][_0x3448('0x112')](db['WhatsappAccount'],{'foreignKey':_0x3448('0x1f5'),'as':_0x3448('0x1e2')});db[_0x3448('0xf8')][_0x3448('0x112')](db[_0x3448('0xf1')],{'foreignKey':_0x3448('0x1f6'),'as':_0x3448('0x1e0')});db[_0x3448('0xf8')][_0x3448('0x112')](db[_0x3448('0xfa')],{'foreignKey':_0x3448('0x1f7'),'as':_0x3448('0x1e4')});db[_0x3448('0xf8')][_0x3448('0x112')](db[_0x3448('0x13')],{'foreignKey':_0x3448('0x1dd'),'as':_0x3448('0x1d7')});db[_0x3448('0xf8')]['belongsTo'](db[_0x3448('0x13')],{'foreignKey':_0x3448('0x1d8'),'as':_0x3448('0x1d9')});db['WhatsappQueue'][_0x3448('0x115')](db[_0x3448('0x13')],{'as':'Agents','through':'UserWhatsappQueue','foreignKey':'WhatsappQueueId'});db[_0x3448('0xfa')][_0x3448('0x115')](db['Team'],{'through':_0x3448('0x1d2'),'as':_0x3448('0x14b')});module['exports']={'db':db,'dbH':dbH}; \ No newline at end of file +var _0x2750=['VtigerAccount','../api/intVtigerAccount/intVtigerAccount.model','VtigerConfiguration','../api/intVtigerConfiguration/intVtigerConfiguration.model','VtigerField','../api/intVtigerField/intVtigerField.model','ServicenowAccount','../api/intServicenowAccount/intServicenowAccount.model','ServicenowConfiguration','../api/intServicenowConfiguration/intServicenowConfiguration.model','ServicenowField','../api/intServicenowField/intServicenowField.model','Dynamics365Account','Dynamics365Configuration','../api/intDynamics365Configuration/intDynamics365Configuration.model','Dynamics365Field','FreshsalesAccount','../api/intFreshsalesAccount/intFreshsalesAccount.model','../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model','FreshsalesField','../api/integration/integration.model','Network','../api/network/network.model','ChatQueueReport','../api/chatQueueReport/chatQueueReport.model','../api/chatInternalMessage/chatInternalMessage.model','JscriptyAnswerReport','../api/jscriptyAnswerReport/jscriptyAnswerReport.model','JscriptyQuestionReport','../api/jscriptyQuestionReport/jscriptyQuestionReport.model','JscriptySessionReport','../api/jscriptySessionReport/jscriptySessionReport.model','SquareReport','../api/squareReport/squareReport.model','SquareDetailsReport','../api/squareReportDetail/squareReportDetail.model','../api/jscriptyProject/jscriptyProject.model','../api/setting/setting.model','SquareOdbc','../api/squareOdbc/squareOdbc.model','SquareProject','SquareRecording','../api/squareRecording/squareRecording.model','SquareMessage','../api/squareMessage/squareMessage.model','Team','../api/team/team.model','License','../api/license/license.model','Campaign','../api/campaign/campaign.model','Migration','../api/migration/migration.model','Attachment','../api/attachment/attachment.model','Plugin','../api/plugin/plugin.model','MailTransferReport','../api/mailTransferReport/mailTransferReport.model','ChatTransferReport','FaxTransferReport','OpenchannelTransferReport','../api/openchannelTransferReport/openchannelTransferReport.model','SmsTransferReport','../api/smsTransferReport/smsTransferReport.model','CmList','VoicePrefix','../api/voicePrefix/voicePrefix.model','UserProfile','../api/userProfile/userProfile.model','UserProfileSection','../api/userProfileSection/userProfileSection.model','UserProfileResource','UserNotification','WhatsappAccount','../api/whatsappAccount/whatsappAccount.model','WhatsappApplication','../api/whatsappApplication/whatsappApplication.model','WhatsappMessage','../api/whatsappMessage/whatsappMessage.model','WhatsappQueueReport','../api/whatsappQueueReport/whatsappQueueReport.model','WhatsappTransferReport','WhatsappQueue','../api/whatsappQueue/whatsappQueue.model','CloudProvider','../api/cloudProvider/cloudProvider.model','TeamVoiceQueue','UserVoicePrefix','User','hasOne','cascade','UserId','hasMany','VoiceQueuesRt','Extensions','HopperFinals','CmHopperHistory','HopperHistory','ChatInteractions','SmsInteractions','FaxInteractions','MailInteractions','WhatsappInteraction','WhatsappInteractions','UserNotifications','SenderId','belongsTo','userProfileId','Groups','chat_group_has_users','belongsToMany','Contacts','Lists','cm_user_has_lists','user_has_teams','user_has_mail_interactions','user_has_chat_interactions','user_has_fax_interactions','user_has_sms_interactions','user_has_openchannel_interactions','user_has_whatsapp_interactions','VoiceQueues','MailQueues','ChatQueues','UserChatQueue','FaxQueues','UserOpenchannelQueue','ChatWebsites','user_has_chat_websites','FaxAccounts','user_has_fax_accounts','user_has_mail_accounts','OpenchannelAccounts','SmsAccounts','user_has_sms_accounts','WhatsappAccounts','user_has_whatsapp_accounts','SquareProjects','user_has_square_projects','SpiedAgents','ChanSpyId','VoiceContext','Sounds','moh_has_sounds','Members','VoiceQueueId','Hoppers','HopperHistories','JscriptySessions','Trunk','TrunkId','TrunkBackup','TrunkBackupId','Interval','mandatoryDispositionPauseId','voice_queues_has_cm_lists','Agents','Teams','BlackLists','voice_queues_has_cm_blacklists','Messages','mailbox','mailboxuser','QueueCalls','uniqueid','AgentReports','ContactId','MailAccountId','MailServerOut','Imap','Smtp','Dispositions','Interactions','Applications','ListId','TemplateId','mandatoryDispositionPause','team_has_mail_queues','MailInteractionId','Account','Owner','Tag','mail_interaction_has_tags','Tags','Users','Attachments','Contact','Interaction','ChatOfflineMessageId','restrict','TagId','List','DashboardItem','Items','FaxAccountId','Exntensions','fax_interaction_has_tags','ThroughTags','FaxInteractionId','AttachmentId','team_has_fax_queues','SmsAccountId','Answers','IntervalId','SmsInteractionId','sms_interaction_has_tags','OpenchannelAccountId','OpenchannelAccount','user_has_openchannel_accounts','OpenchannelQueueId','OpenchannelInteractionId','openchannel_interaction_has_tags','team_has_openchannel_queues','ChatWebsiteId','ChatProactiveAction','ProactiveActions','Agent','Queue','Website','ChatInteractionId','chat_interaction_has_tags','ChatInternalMessage','ChatGroupId','CompanyId','OpenchannelInteractions','cm_user_has_contacts','cm_contact_has_tags','CampaignId','OwnerId','All','OneAll','Any','OneAny','AutomationAnyId','Actions','AutomationId','ParentId','Intervals','MailApplications','ChatApplications','FaxApplications','DefaultReportId','CustomReportId','whatsapp_interaction_has_tags','AllConditions','AllCondition','TriggerAllId','AnyConditions','AnyCondition','TriggerAnyId','Action','TriggerId','AnalyticFieldReport','Fields','MetricId','Configurations','AccountId','DescriptionId','FieldId','Subject','SubjectId','Field','Subjects','Descriptions','Variable','VariableId','Description','ZendeskField','int_freshdesk_configuration_has_tags','FreshsalesConfiguration','FromId','SessionId','SmsQueueReport','ProjectId','JscriptyProject','team_has_chat_queues','team_has_sms_queues','SmsQueues','OpenchannelQueues','team_has_whatsapp_queues','WhatsappQueues','VoicePrefixes','HopperBlacks','SquareProjectId','campaigns_has_cm_blacklists','FromMailAccountId','FromAccount','FromAgent','ToUserId','ToAgent','ToMailQueueId','ToQueue','ToMailAccountId','ToAccount','FromChatWebsiteId','FromUserId','ToChatQueueId','ToChatWebsiteId','FromFaxAccountId','ToFaxQueueId','ToFaxAccountId','FromOpenchannelAccountId','ToOpenchannelAccountId','ToSmsQueueId','ToSmsAccountId','CustomFields','TeamVoicePrefix','sectionId','WhatsappAccountId','WhatsappInteractionId','FromWhatsappAccountId','ToWhatsappAccountId','WhatsappQueueId','exports','../config/environment','lodash','jstz','determine','sequelize','defaultsDeep','motion2','xcall','xC@LL1234','127.0.0.1','utf8mb4','name','utf8','utf8_general_ci','sequelizeHistory','username','options','database','import','VoiceChanSpy','../api/voiceContext/voiceContext.model','VoiceExtension','../api/voiceExtension/voiceExtension.model','VoiceMusicOnHold','../api/voiceMusicOnHold/voiceMusicOnHold.model','VoiceQueue','../api/voiceQueue/voiceQueue.model','VoiceRecording','../api/voiceRecording/voiceRecording.model','../api/screenRecording/screenRecording.model','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','../api/voiceTransferReport/voiceTransferReport.model','UserVoiceQueueRt','../api/userVoiceQueueRt/userVoiceQueueRt.model','UserVoiceQueue','../api/userVoiceQueue/userVoiceQueue.model','../api/userChatQueue/userChatQueue.model','UserMailQueue','../api/userMailQueue/userMailQueue.model','UserFaxQueue','../api/userFaxQueue/userFaxQueue.model','UserSmsQueue','../api/userSmsQueue/userSmsQueue.model','../api/userOpenchannelQueue/userOpenchannelQueue.model','UserWhatsappQueue','../api/userWhatsappQueue/userWhatsappQueue.model','MailServerIn','../api/mailServerIn/mailServerIn.model','../api/mailServerOut/mailServerOut.model','MailAccount','../api/mailAccount/mailAccount.model','MailQueue','../api/mailQueue/mailQueue.model','MailSubstatus','MailInteraction','../api/mailInteraction/mailInteraction.model','MailMessage','../api/mailMessage/mailMessage.model','MailApplication','../api/mailApplication/mailApplication.model','MailQueueReport','Dashboard','../api/dashboard/dashboard.model','../api/dashboardItem/dashboardItem.model','FaxAccount','FaxApplication','../api/faxApplication/faxApplication.model','FaxInteraction','../api/faxInteraction/faxInteraction.model','FaxMessage','../api/faxMessage/faxMessage.model','FaxQueue','../api/faxQueue/faxQueue.model','FaxQueueReport','../api/faxQueueReport/faxQueueReport.model','SmsAccount','../api/smsAccount/smsAccount.model','SmsApplication','../api/smsApplication/smsApplication.model','SmsInteraction','../api/smsInteraction/smsInteraction.model','SmsMessage','../api/smsMessage/smsMessage.model','SmsQueue','../api/smsQueue/smsQueue.model','../api/openchannelAccount/openchannelAccount.model','OpenchannelApplication','OpenchannelInteraction','OpenchannelMessage','../api/openchannelMessage/openchannelMessage.model','OpenchannelQueue','../api/openchannelQueue/openchannelQueue.model','ChatWebsite','OpenchannelQueueReport','../api/openchannelQueueReport/openchannelQueueReport.model','ChatApplication','../api/chatApplication/chatApplication.model','ChatInteraction','ChatMessage','../api/chatMessage/chatMessage.model','ChatOfflineMessage','../api/chatOfflineMessage/chatOfflineMessage.model','ChatQueue','../api/chatQueue/chatQueue.model','ChatGroup','../api/chatGroup/chatGroup.model','CmCompany','../api/cmCompany/cmCompany.model','CmContact','../api/cmContact/cmContact.model','CmHopper','../api/cmHopper/cmHopper.model','CmHopperBlack','../api/cmHopperBlack/cmHopperBlack.model','CmHopperFinal','../api/cmHopperFinal/cmHopperFinal.model','../api/cmHopperHistory/cmHopperHistory.model','ReportAgentPreview','CmCustomField','../api/cmCustomField/cmCustomField.model','Automation','CannedAnswer','Disposition','../api/disposition/disposition.model','Condition','../api/condition/condition.model','../api/interval/interval.model','Pause','Cdr','../api/cdr/cdr.model','VoiceQueuesLog','../api/voiceQueuesLog/voiceQueuesLog.model','Schedule','../api/schedule/schedule.model','Sound','../api/sound/sound.model','../api/tag/tag.model','Template','../api/template/template.model','Trigger','../api/trigger/trigger.model','../api/variable/variable.model','Integration','IntegrationReport','AnalyticCustomReport','../api/analyticCustomReport/analyticCustomReport.model','AnalyticDefaultReport','../api/analyticDefaultReport/analyticDefaultReport.model','../api/analyticExtractedReport/analyticExtractedReport.model','AnalyticMetric','../api/analyticMetric/analyticMetric.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','SugarcrmField','../api/intSugarcrmField/intSugarcrmField.model','DeskAccount','../api/intDeskAccount/intDeskAccount.model','DeskConfiguration','../api/intDeskConfiguration/intDeskConfiguration.model','DeskField','../api/intDeskField/intDeskField.model','ZohoAccount','ZohoConfiguration','../api/intZohoConfiguration/intZohoConfiguration.model','ZohoField','../api/intZohoField/intZohoField.model','ZendeskAccount','../api/intZendeskAccount/intZendeskAccount.model','ZendeskConfiguration','../api/intZendeskField/intZendeskField.model','FreshdeskAccount','../api/intFreshdeskAccount/intFreshdeskAccount.model','FreshdeskConfiguration','FreshdeskField'];(function(_0x2f8263,_0x540254){var _0x377b62=function(_0x1fd9aa){while(--_0x1fd9aa){_0x2f8263['push'](_0x2f8263['shift']());}};_0x377b62(++_0x540254);}(_0x2750,0x13b));var _0x0275=function(_0x5886e8,_0x12729d){_0x5886e8=_0x5886e8-0x0;var _0x111405=_0x2750[_0x5886e8];return _0x111405;};'use strict';var config=require(_0x0275('0x0'));var Sequelize=require('sequelize');var _=require(_0x0275('0x1'));var jstz=require(_0x0275('0x2'));var timezone=jstz[_0x0275('0x3')]();config[_0x0275('0x4')]=_[_0x0275('0x5')](config[_0x0275('0x4')],{'database':_0x0275('0x6'),'username':_0x0275('0x7'),'password':_0x0275('0x8'),'options':{'host':_0x0275('0x9'),'port':0xcea,'dialect':'mysql','dialectOptions':{'charset':_0x0275('0xa')},'logging':![],'timezone':timezone[_0x0275('0xb')](),'define':{'charset':_0x0275('0xc'),'collate':_0x0275('0xd')}}});config['sequelizeHistory']=_[_0x0275('0x5')](config[_0x0275('0xe')],{'database':_0x0275('0x6'),'username':'xcall','password':'xC@LL1234','options':{'host':_0x0275('0x9'),'port':0xcea,'dialect':'mysql','dialectOptions':{'charset':_0x0275('0xa')},'logging':![],'timezone':timezone[_0x0275('0xb')](),'define':{'charset':_0x0275('0xc'),'collate':_0x0275('0xd')}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x0275('0x4')]['database'],config[_0x0275('0x4')][_0x0275('0xf')],config[_0x0275('0x4')]['password'],config['sequelize'][_0x0275('0x10')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x0275('0xe')][_0x0275('0x11')],config[_0x0275('0xe')][_0x0275('0xf')],config[_0x0275('0xe')]['password'],config[_0x0275('0xe')][_0x0275('0x10')])};db['User']=db[_0x0275('0x4')][_0x0275('0x12')]('../api/user/user.model');db[_0x0275('0x13')]=db[_0x0275('0x4')]['import']('../api/voiceChanSpy/voiceChanSpy.model');db['VoiceContext']=db['sequelize']['import'](_0x0275('0x14'));db[_0x0275('0x15')]=db[_0x0275('0x4')]['import'](_0x0275('0x16'));db[_0x0275('0x17')]=db[_0x0275('0x4')]['import'](_0x0275('0x18'));db[_0x0275('0x19')]=db['sequelize']['import'](_0x0275('0x1a'));db[_0x0275('0x1b')]=db[_0x0275('0x4')]['import'](_0x0275('0x1c'));db['ScreenRecording']=db[_0x0275('0x4')]['import'](_0x0275('0x1d'));db[_0x0275('0x1e')]=db['sequelize'][_0x0275('0x12')](_0x0275('0x1f'));db[_0x0275('0x20')]=db['sequelize'][_0x0275('0x12')](_0x0275('0x21'));db[_0x0275('0x22')]=db[_0x0275('0x4')][_0x0275('0x12')](_0x0275('0x23'));db['VoiceDialReport']=db[_0x0275('0x4')][_0x0275('0x12')](_0x0275('0x24'));db[_0x0275('0x25')]=db[_0x0275('0x4')]['import'](_0x0275('0x26'));db[_0x0275('0x27')]=db[_0x0275('0x4')][_0x0275('0x12')](_0x0275('0x28'));db['MemberReport']=db[_0x0275('0x4')][_0x0275('0x12')](_0x0275('0x29'));db['Trunk']=db['sequelize'][_0x0275('0x12')](_0x0275('0x2a'));db['VoiceTransferReport']=db[_0x0275('0x4')][_0x0275('0x12')](_0x0275('0x2b'));db[_0x0275('0x2c')]=db['sequelize'][_0x0275('0x12')](_0x0275('0x2d'));db[_0x0275('0x2e')]=db[_0x0275('0x4')]['import'](_0x0275('0x2f'));db['UserChatQueue']=db[_0x0275('0x4')]['import'](_0x0275('0x30'));db[_0x0275('0x31')]=db['sequelize'][_0x0275('0x12')](_0x0275('0x32'));db[_0x0275('0x33')]=db[_0x0275('0x4')]['import'](_0x0275('0x34'));db[_0x0275('0x35')]=db[_0x0275('0x4')][_0x0275('0x12')](_0x0275('0x36'));db['UserOpenchannelQueue']=db[_0x0275('0x4')][_0x0275('0x12')](_0x0275('0x37'));db[_0x0275('0x38')]=db[_0x0275('0x4')][_0x0275('0x12')](_0x0275('0x39'));db[_0x0275('0x3a')]=db[_0x0275('0x4')][_0x0275('0x12')](_0x0275('0x3b'));db['MailServerOut']=db[_0x0275('0x4')][_0x0275('0x12')](_0x0275('0x3c'));db[_0x0275('0x3d')]=db[_0x0275('0x4')][_0x0275('0x12')](_0x0275('0x3e'));db[_0x0275('0x3f')]=db[_0x0275('0x4')][_0x0275('0x12')](_0x0275('0x40'));db[_0x0275('0x41')]=db[_0x0275('0x4')][_0x0275('0x12')]('../api/mailSubstatus/mailSubstatus.model');db[_0x0275('0x42')]=db[_0x0275('0x4')]['import'](_0x0275('0x43'));db[_0x0275('0x44')]=db[_0x0275('0x4')][_0x0275('0x12')](_0x0275('0x45'));db[_0x0275('0x46')]=db[_0x0275('0x4')]['import'](_0x0275('0x47'));db[_0x0275('0x48')]=db[_0x0275('0x4')][_0x0275('0x12')]('../api/mailQueueReport/mailQueueReport.model');db[_0x0275('0x49')]=db[_0x0275('0x4')][_0x0275('0x12')](_0x0275('0x4a'));db['DashboardItem']=db[_0x0275('0x4')]['import'](_0x0275('0x4b'));db[_0x0275('0x4c')]=db[_0x0275('0x4')][_0x0275('0x12')]('../api/faxAccount/faxAccount.model');db[_0x0275('0x4d')]=db[_0x0275('0x4')]['import'](_0x0275('0x4e'));db[_0x0275('0x4f')]=db[_0x0275('0x4')]['import'](_0x0275('0x50'));db[_0x0275('0x51')]=db['sequelize'][_0x0275('0x12')](_0x0275('0x52'));db[_0x0275('0x53')]=db[_0x0275('0x4')][_0x0275('0x12')](_0x0275('0x54'));db[_0x0275('0x55')]=db[_0x0275('0x4')][_0x0275('0x12')](_0x0275('0x56'));db[_0x0275('0x57')]=db['sequelize'][_0x0275('0x12')](_0x0275('0x58'));db[_0x0275('0x59')]=db[_0x0275('0x4')][_0x0275('0x12')](_0x0275('0x5a'));db[_0x0275('0x5b')]=db[_0x0275('0x4')][_0x0275('0x12')](_0x0275('0x5c'));db[_0x0275('0x5d')]=db['sequelize']['import'](_0x0275('0x5e'));db[_0x0275('0x5f')]=db[_0x0275('0x4')][_0x0275('0x12')](_0x0275('0x60'));db['OpenchannelAccount']=db[_0x0275('0x4')]['import'](_0x0275('0x61'));db[_0x0275('0x62')]=db[_0x0275('0x4')][_0x0275('0x12')]('../api/openchannelApplication/openchannelApplication.model');db[_0x0275('0x63')]=db['sequelize']['import']('../api/openchannelInteraction/openchannelInteraction.model');db[_0x0275('0x64')]=db['sequelize'][_0x0275('0x12')](_0x0275('0x65'));db[_0x0275('0x66')]=db[_0x0275('0x4')][_0x0275('0x12')](_0x0275('0x67'));db[_0x0275('0x68')]=db['sequelize'][_0x0275('0x12')]('../api/chatWebsite/chatWebsite.model');db[_0x0275('0x69')]=db[_0x0275('0x4')][_0x0275('0x12')](_0x0275('0x6a'));db[_0x0275('0x6b')]=db[_0x0275('0x4')][_0x0275('0x12')](_0x0275('0x6c'));db[_0x0275('0x6d')]=db[_0x0275('0x4')]['import']('../api/chatInteraction/chatInteraction.model');db[_0x0275('0x6e')]=db['sequelize']['import'](_0x0275('0x6f'));db[_0x0275('0x70')]=db[_0x0275('0x4')][_0x0275('0x12')](_0x0275('0x71'));db[_0x0275('0x72')]=db['sequelize'][_0x0275('0x12')](_0x0275('0x73'));db[_0x0275('0x74')]=db[_0x0275('0x4')][_0x0275('0x12')](_0x0275('0x75'));db['ChatProactiveAction']=db[_0x0275('0x4')][_0x0275('0x12')]('../api/chatProactiveAction/chatProactiveAction.model');db[_0x0275('0x76')]=db['sequelize'][_0x0275('0x12')](_0x0275('0x77'));db[_0x0275('0x78')]=db[_0x0275('0x4')][_0x0275('0x12')](_0x0275('0x79'));db[_0x0275('0x7a')]=db[_0x0275('0x4')][_0x0275('0x12')](_0x0275('0x7b'));db[_0x0275('0x7c')]=db['sequelize'][_0x0275('0x12')](_0x0275('0x7d'));db[_0x0275('0x7e')]=db['sequelize'][_0x0275('0x12')](_0x0275('0x7f'));db['CmHopperHistory']=db[_0x0275('0x4')]['import'](_0x0275('0x80'));db[_0x0275('0x81')]=db[_0x0275('0x4')][_0x0275('0x12')]('../api/reportAgentPreview/reportAgentPreview.model');db[_0x0275('0x82')]=db[_0x0275('0x4')][_0x0275('0x12')](_0x0275('0x83'));db['Action']=db[_0x0275('0x4')][_0x0275('0x12')]('../api/action/action.model');db[_0x0275('0x84')]=db[_0x0275('0x4')]['import']('../api/automation/automation.model');db[_0x0275('0x85')]=db[_0x0275('0x4')]['import']('../api/cannedAnswer/cannedAnswer.model');db[_0x0275('0x86')]=db[_0x0275('0x4')][_0x0275('0x12')](_0x0275('0x87'));db[_0x0275('0x88')]=db[_0x0275('0x4')][_0x0275('0x12')](_0x0275('0x89'));db['Interval']=db[_0x0275('0x4')][_0x0275('0x12')](_0x0275('0x8a'));db[_0x0275('0x8b')]=db[_0x0275('0x4')][_0x0275('0x12')]('../api/pause/pause.model');db[_0x0275('0x8c')]=db['sequelize'][_0x0275('0x12')](_0x0275('0x8d'));db[_0x0275('0x8e')]=db[_0x0275('0x4')]['import'](_0x0275('0x8f'));db[_0x0275('0x90')]=db[_0x0275('0x4')][_0x0275('0x12')](_0x0275('0x91'));db[_0x0275('0x92')]=db[_0x0275('0x4')][_0x0275('0x12')](_0x0275('0x93'));db['Tag']=db['sequelize']['import'](_0x0275('0x94'));db[_0x0275('0x95')]=db[_0x0275('0x4')]['import'](_0x0275('0x96'));db[_0x0275('0x97')]=db[_0x0275('0x4')][_0x0275('0x12')](_0x0275('0x98'));db['Variable']=db[_0x0275('0x4')]['import'](_0x0275('0x99'));db[_0x0275('0x9a')]=db[_0x0275('0x4')][_0x0275('0x12')]('../api/integration/integration.model');db[_0x0275('0x9b')]=db[_0x0275('0x4')][_0x0275('0x12')]('../api/integrationReport/integrationReport.model');db[_0x0275('0x9c')]=db[_0x0275('0x4')][_0x0275('0x12')](_0x0275('0x9d'));db[_0x0275('0x9e')]=db[_0x0275('0x4')][_0x0275('0x12')](_0x0275('0x9f'));db['AnalyticExtractedReport']=db['sequelize']['import'](_0x0275('0xa0'));db[_0x0275('0xa1')]=db[_0x0275('0x4')][_0x0275('0x12')](_0x0275('0xa2'));db['AnalyticFieldReport']=db[_0x0275('0x4')]['import']('../api/analyticFieldReport/analyticFieldReport.model');db[_0x0275('0xa3')]=db['sequelize'][_0x0275('0x12')](_0x0275('0xa4'));db[_0x0275('0xa5')]=db[_0x0275('0x4')][_0x0275('0x12')](_0x0275('0xa6'));db[_0x0275('0xa7')]=db[_0x0275('0x4')][_0x0275('0x12')](_0x0275('0xa8'));db[_0x0275('0xa9')]=db[_0x0275('0x4')][_0x0275('0x12')](_0x0275('0xaa'));db[_0x0275('0xab')]=db[_0x0275('0x4')][_0x0275('0x12')](_0x0275('0xac'));db[_0x0275('0xad')]=db[_0x0275('0x4')][_0x0275('0x12')]('../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model');db[_0x0275('0xae')]=db[_0x0275('0x4')][_0x0275('0x12')](_0x0275('0xaf'));db[_0x0275('0xb0')]=db[_0x0275('0x4')]['import'](_0x0275('0xb1'));db[_0x0275('0xb2')]=db['sequelize'][_0x0275('0x12')](_0x0275('0xb3'));db[_0x0275('0xb4')]=db[_0x0275('0x4')]['import'](_0x0275('0xb5'));db[_0x0275('0xb6')]=db['sequelize'][_0x0275('0x12')]('../api/intZohoAccount/intZohoAccount.model');db[_0x0275('0xb7')]=db[_0x0275('0x4')]['import'](_0x0275('0xb8'));db[_0x0275('0xb9')]=db[_0x0275('0x4')][_0x0275('0x12')](_0x0275('0xba'));db[_0x0275('0xbb')]=db[_0x0275('0x4')]['import'](_0x0275('0xbc'));db[_0x0275('0xbd')]=db['sequelize'][_0x0275('0x12')]('../api/intZendeskConfiguration/intZendeskConfiguration.model');db['ZendeskField']=db[_0x0275('0x4')]['import'](_0x0275('0xbe'));db[_0x0275('0xbf')]=db['sequelize'][_0x0275('0x12')](_0x0275('0xc0'));db[_0x0275('0xc1')]=db['sequelize'][_0x0275('0x12')]('../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model');db[_0x0275('0xc2')]=db[_0x0275('0x4')][_0x0275('0x12')]('../api/intFreshdeskField/intFreshdeskField.model');db[_0x0275('0xc3')]=db[_0x0275('0x4')][_0x0275('0x12')](_0x0275('0xc4'));db[_0x0275('0xc5')]=db[_0x0275('0x4')]['import'](_0x0275('0xc6'));db[_0x0275('0xc7')]=db[_0x0275('0x4')]['import'](_0x0275('0xc8'));db[_0x0275('0xc9')]=db[_0x0275('0x4')]['import'](_0x0275('0xca'));db[_0x0275('0xcb')]=db[_0x0275('0x4')]['import'](_0x0275('0xcc'));db[_0x0275('0xcd')]=db[_0x0275('0x4')][_0x0275('0x12')](_0x0275('0xce'));db[_0x0275('0xcf')]=db[_0x0275('0x4')]['import']('../api/intDynamics365Account/intDynamics365Account.model');db[_0x0275('0xd0')]=db[_0x0275('0x4')][_0x0275('0x12')](_0x0275('0xd1'));db[_0x0275('0xd2')]=db[_0x0275('0x4')][_0x0275('0x12')]('../api/intDynamics365Field/intDynamics365Field.model');db[_0x0275('0xd3')]=db[_0x0275('0x4')]['import'](_0x0275('0xd4'));db['FreshsalesConfiguration']=db[_0x0275('0x4')][_0x0275('0x12')](_0x0275('0xd5'));db[_0x0275('0xd6')]=db[_0x0275('0x4')][_0x0275('0x12')]('../api/intFreshsalesField/intFreshsalesField.model');db[_0x0275('0x9a')]=db[_0x0275('0x4')][_0x0275('0x12')](_0x0275('0xd7'));db[_0x0275('0xd8')]=db[_0x0275('0x4')]['import'](_0x0275('0xd9'));db[_0x0275('0xda')]=db[_0x0275('0x4')][_0x0275('0x12')](_0x0275('0xdb'));db['ChatInternalMessage']=db[_0x0275('0x4')]['import'](_0x0275('0xdc'));db[_0x0275('0xdd')]=db[_0x0275('0x4')][_0x0275('0x12')](_0x0275('0xde'));db[_0x0275('0xdf')]=db[_0x0275('0x4')][_0x0275('0x12')](_0x0275('0xe0'));db[_0x0275('0xe1')]=db['sequelize'][_0x0275('0x12')](_0x0275('0xe2'));db['SmsQueueReport']=db[_0x0275('0x4')][_0x0275('0x12')]('../api/smsQueueReport/smsQueueReport.model');db[_0x0275('0xe3')]=db['sequelize'][_0x0275('0x12')](_0x0275('0xe4'));db[_0x0275('0xe5')]=db[_0x0275('0x4')][_0x0275('0x12')](_0x0275('0xe6'));db['JscriptyProject']=db[_0x0275('0x4')][_0x0275('0x12')](_0x0275('0xe7'));db['Setting']=db[_0x0275('0x4')][_0x0275('0x12')](_0x0275('0xe8'));db[_0x0275('0xe9')]=db['sequelize'][_0x0275('0x12')](_0x0275('0xea'));db[_0x0275('0xeb')]=db[_0x0275('0x4')][_0x0275('0x12')]('../api/squareProject/squareProject.model');db[_0x0275('0xec')]=db[_0x0275('0x4')][_0x0275('0x12')](_0x0275('0xed'));db[_0x0275('0xee')]=db[_0x0275('0x4')][_0x0275('0x12')](_0x0275('0xef'));db[_0x0275('0xf0')]=db[_0x0275('0x4')]['import'](_0x0275('0xf1'));db[_0x0275('0xf2')]=db[_0x0275('0x4')][_0x0275('0x12')](_0x0275('0xf3'));db[_0x0275('0xf4')]=db[_0x0275('0x4')][_0x0275('0x12')](_0x0275('0xf5'));db[_0x0275('0xf6')]=db[_0x0275('0x4')][_0x0275('0x12')](_0x0275('0xf7'));db[_0x0275('0xf8')]=db[_0x0275('0x4')][_0x0275('0x12')](_0x0275('0xf9'));db[_0x0275('0xfa')]=db[_0x0275('0x4')][_0x0275('0x12')](_0x0275('0xfb'));db[_0x0275('0xfc')]=db[_0x0275('0x4')][_0x0275('0x12')](_0x0275('0xfd'));db[_0x0275('0xfe')]=db['sequelize'][_0x0275('0x12')]('../api/chatTransferReport/chatTransferReport.model');db[_0x0275('0xff')]=db[_0x0275('0x4')]['import']('../api/faxTransferReport/faxTransferReport.model');db[_0x0275('0x100')]=db[_0x0275('0x4')][_0x0275('0x12')](_0x0275('0x101'));db[_0x0275('0x102')]=db[_0x0275('0x4')][_0x0275('0x12')](_0x0275('0x103'));db[_0x0275('0x104')]=db[_0x0275('0x4')][_0x0275('0x12')]('../api/cmList/cmList.model');db[_0x0275('0x105')]=db[_0x0275('0x4')]['import'](_0x0275('0x106'));db[_0x0275('0x107')]=db['sequelize']['import'](_0x0275('0x108'));db[_0x0275('0x109')]=db[_0x0275('0x4')][_0x0275('0x12')](_0x0275('0x10a'));db[_0x0275('0x10b')]=db[_0x0275('0x4')][_0x0275('0x12')]('../api/userProfileResource/userProfileResource.model');db[_0x0275('0x10c')]=db[_0x0275('0x4')][_0x0275('0x12')]('../api/userNotification/userNotification.model');db[_0x0275('0x10d')]=db[_0x0275('0x4')][_0x0275('0x12')](_0x0275('0x10e'));db[_0x0275('0x10f')]=db[_0x0275('0x4')][_0x0275('0x12')](_0x0275('0x110'));db['WhatsappInteraction']=db['sequelize'][_0x0275('0x12')]('../api/whatsappInteraction/whatsappInteraction.model');db[_0x0275('0x111')]=db['sequelize']['import'](_0x0275('0x112'));db[_0x0275('0x113')]=db[_0x0275('0x4')][_0x0275('0x12')](_0x0275('0x114'));db[_0x0275('0x115')]=db['sequelize'][_0x0275('0x12')]('../api/whatsappTransferReport/whatsappTransferReport.model');db[_0x0275('0x116')]=db['sequelize']['import'](_0x0275('0x117'));db[_0x0275('0x118')]=db[_0x0275('0x4')]['import'](_0x0275('0x119'));db[_0x0275('0x11a')]=db[_0x0275('0x4')]['import']('../api/teamVoiceQueue/teamVoiceQueue.model');db['TeamVoicePrefix']=db['sequelize'][_0x0275('0x12')]('../api/teamVoicePrefix/teamVoicePrefix.model');db[_0x0275('0x11b')]=db['sequelize'][_0x0275('0x12')]('../api/userVoicePrefix/userVoicePrefix.model');db[_0x0275('0x11c')][_0x0275('0x11d')](db['VoiceMail'],{'as':'VoiceMail','onDelete':_0x0275('0x11e'),'foreignKey':_0x0275('0x11f')});db[_0x0275('0x11c')][_0x0275('0x120')](db[_0x0275('0x1b')],{'as':'Recordings','foreignKey':_0x0275('0x11f')});db[_0x0275('0x11c')][_0x0275('0x120')](db['UserVoiceQueueRt'],{'as':_0x0275('0x121'),'foreignKey':_0x0275('0x11f')});db[_0x0275('0x11c')][_0x0275('0x120')](db[_0x0275('0x15')],{'as':_0x0275('0x122'),'onDelete':_0x0275('0x11e'),'hooks':!![]});db[_0x0275('0x11c')][_0x0275('0x120')](db[_0x0275('0x7e')],{'as':_0x0275('0x123'),'foreignKey':_0x0275('0x11f')});db[_0x0275('0x11c')][_0x0275('0x120')](db[_0x0275('0x124')],{'as':_0x0275('0x125'),'foreignKey':_0x0275('0x11f')});db[_0x0275('0x11c')][_0x0275('0x120')](db['ReportAgentPreview'],{'as':'ReportAgentPreview','foreignKey':_0x0275('0x11f')});db[_0x0275('0x11c')][_0x0275('0x120')](db[_0x0275('0x63')],{'as':'OpenchannelInteractions','foreignKey':_0x0275('0x11f')});db[_0x0275('0x11c')][_0x0275('0x120')](db[_0x0275('0x6d')],{'as':_0x0275('0x126'),'foreignKey':_0x0275('0x11f')});db[_0x0275('0x11c')][_0x0275('0x120')](db[_0x0275('0x5b')],{'as':_0x0275('0x127'),'foreignKey':_0x0275('0x11f')});db['User'][_0x0275('0x120')](db[_0x0275('0x4f')],{'as':_0x0275('0x128'),'foreignKey':_0x0275('0x11f')});db[_0x0275('0x11c')][_0x0275('0x120')](db[_0x0275('0x42')],{'as':_0x0275('0x129'),'foreignKey':'UserId'});db['User'][_0x0275('0x120')](db[_0x0275('0x12a')],{'as':_0x0275('0x12b'),'foreignKey':'UserId'});db['User'][_0x0275('0x120')](db[_0x0275('0x10c')],{'as':_0x0275('0x12c'),'foreignKey':_0x0275('0x12d')});db[_0x0275('0x11c')][_0x0275('0x12e')](db[_0x0275('0x107')],{'as':_0x0275('0x107'),'foreignKey':_0x0275('0x12f')});db[_0x0275('0x11c')]['belongsToMany'](db['ChatGroup'],{'as':_0x0275('0x130'),'through':_0x0275('0x131')});db['User'][_0x0275('0x132')](db['CmContact'],{'as':_0x0275('0x133'),'through':'cm_user_has_contacts'});db[_0x0275('0x11c')][_0x0275('0x132')](db['CmList'],{'as':_0x0275('0x134'),'through':_0x0275('0x135')});db[_0x0275('0x11c')][_0x0275('0x132')](db['Team'],{'through':_0x0275('0x136')});db[_0x0275('0x11c')]['belongsToMany'](db['MailInteraction'],{'as':_0x0275('0x129'),'through':_0x0275('0x137')});db[_0x0275('0x11c')][_0x0275('0x132')](db[_0x0275('0x6d')],{'as':_0x0275('0x126'),'through':_0x0275('0x138')});db['User']['belongsToMany'](db['FaxInteraction'],{'as':_0x0275('0x128'),'through':_0x0275('0x139')});db[_0x0275('0x11c')][_0x0275('0x132')](db[_0x0275('0x5b')],{'as':_0x0275('0x127'),'through':_0x0275('0x13a')});db[_0x0275('0x11c')][_0x0275('0x132')](db[_0x0275('0x63')],{'as':'OpenchannelInteractions','through':_0x0275('0x13b')});db[_0x0275('0x11c')][_0x0275('0x132')](db[_0x0275('0x12a')],{'as':_0x0275('0x12b'),'through':_0x0275('0x13c')});db['User']['belongsToMany'](db[_0x0275('0x19')],{'as':_0x0275('0x13d'),'through':_0x0275('0x2e'),'required':![]});db[_0x0275('0x11c')]['belongsToMany'](db[_0x0275('0x105')],{'as':'VoicePrefixes','through':_0x0275('0x11b'),'required':![]});db['User'][_0x0275('0x132')](db[_0x0275('0x3f')],{'as':_0x0275('0x13e'),'through':_0x0275('0x31'),'required':![]});db[_0x0275('0x11c')][_0x0275('0x132')](db[_0x0275('0x72')],{'as':_0x0275('0x13f'),'through':_0x0275('0x140'),'required':![],'hooks':!![]});db['User'][_0x0275('0x132')](db['FaxQueue'],{'as':_0x0275('0x141'),'through':'UserFaxQueue','required':![]});db[_0x0275('0x11c')]['belongsToMany'](db[_0x0275('0x5f')],{'as':'SmsQueues','through':_0x0275('0x35'),'required':![]});db[_0x0275('0x11c')]['belongsToMany'](db[_0x0275('0x66')],{'as':'OpenchannelQueues','through':_0x0275('0x142'),'required':![]});db['User'][_0x0275('0x132')](db[_0x0275('0x116')],{'as':'WhatsappQueues','through':_0x0275('0x38'),'required':![]});db[_0x0275('0x11c')][_0x0275('0x132')](db[_0x0275('0x104')],{'through':_0x0275('0x135')});db[_0x0275('0x11c')][_0x0275('0x132')](db[_0x0275('0x68')],{'as':_0x0275('0x143'),'through':_0x0275('0x144')});db['User'][_0x0275('0x132')](db['FaxAccount'],{'as':_0x0275('0x145'),'through':_0x0275('0x146')});db[_0x0275('0x11c')][_0x0275('0x132')](db[_0x0275('0x3d')],{'as':'MailAccounts','through':_0x0275('0x147')});db['User'][_0x0275('0x132')](db['OpenchannelAccount'],{'as':_0x0275('0x148'),'through':'user_has_openchannel_accounts'});db['User'][_0x0275('0x132')](db[_0x0275('0x57')],{'as':_0x0275('0x149'),'through':_0x0275('0x14a')});db[_0x0275('0x11c')][_0x0275('0x132')](db[_0x0275('0x10d')],{'as':_0x0275('0x14b'),'through':_0x0275('0x14c')});db[_0x0275('0x11c')]['belongsToMany'](db[_0x0275('0xeb')],{'as':_0x0275('0x14d'),'through':_0x0275('0x14e')});db[_0x0275('0x13')][_0x0275('0x120')](db['VoiceExtension'],{'as':_0x0275('0x14f'),'onDelete':'cascade','foreignKey':_0x0275('0x150')});db[_0x0275('0x151')][_0x0275('0x120')](db[_0x0275('0x15')],{'onDelete':_0x0275('0x11e')});db[_0x0275('0x15')]['hasMany'](db[_0x0275('0x15')],{'as':'Applications','onDelete':_0x0275('0x11e')});db['VoiceMusicOnHold'][_0x0275('0x132')](db[_0x0275('0x92')],{'as':_0x0275('0x152'),'through':_0x0275('0x153')});db['VoiceQueue'][_0x0275('0x120')](db[_0x0275('0x2c')],{'as':_0x0275('0x154'),'foreignKey':_0x0275('0x155')});db[_0x0275('0x19')]['hasMany'](db['CmHopper'],{'as':_0x0275('0x156'),'foreignKey':_0x0275('0x155')});db[_0x0275('0x19')]['hasMany'](db[_0x0275('0x7e')],{'as':_0x0275('0x123'),'foreignKey':_0x0275('0x155')});db['VoiceQueue'][_0x0275('0x120')](db[_0x0275('0x124')],{'as':_0x0275('0x157'),'foreignKey':_0x0275('0x155')});db[_0x0275('0x19')][_0x0275('0x120')](db[_0x0275('0x81')],{'as':_0x0275('0x81'),'foreignKey':_0x0275('0x155')});db[_0x0275('0x19')]['hasMany'](db[_0x0275('0x7c')],{'as':'HopperBlacks','foreignKey':_0x0275('0x155')});db[_0x0275('0x19')][_0x0275('0x120')](db['JscriptySessionReport'],{'as':_0x0275('0x158'),'foreignKey':_0x0275('0x155')});db[_0x0275('0x19')]['belongsTo'](db[_0x0275('0x159')],{'as':'Trunk','foreignKey':_0x0275('0x15a')});db[_0x0275('0x19')][_0x0275('0x12e')](db[_0x0275('0x159')],{'as':_0x0275('0x15b'),'foreignKey':_0x0275('0x15c')});db[_0x0275('0x19')]['belongsTo'](db[_0x0275('0x15d')],{'as':_0x0275('0x15d'),'foreignKey':'IntervalId'});db['VoiceQueue'][_0x0275('0x12e')](db['Pause'],{'as':'mandatoryDispositionPause','foreignKey':_0x0275('0x15e')});db[_0x0275('0x19')][_0x0275('0x132')](db[_0x0275('0x104')],{'as':_0x0275('0x134'),'through':_0x0275('0x15f')});db[_0x0275('0x19')][_0x0275('0x132')](db[_0x0275('0x11c')],{'as':_0x0275('0x160'),'through':_0x0275('0x2e')});db[_0x0275('0x19')][_0x0275('0x132')](db[_0x0275('0xf0')],{'as':_0x0275('0x161'),'through':'TeamVoiceQueue'});db[_0x0275('0x19')][_0x0275('0x132')](db[_0x0275('0x104')],{'as':_0x0275('0x162'),'through':_0x0275('0x163')});db['VoiceRecording']['belongsTo'](db[_0x0275('0x11c')],{'as':_0x0275('0x11c'),'foreignKey':_0x0275('0x11f')});db['ScreenRecording'][_0x0275('0x12e')](db['User'],{'as':_0x0275('0x11c'),'foreignKey':_0x0275('0x11f')});db[_0x0275('0x1e')]['hasMany'](db[_0x0275('0x20')],{'as':_0x0275('0x164'),'onDelete':'cascade','foreignKey':'mailboxuser','sourceKey':_0x0275('0x165')});db[_0x0275('0x20')][_0x0275('0x12e')](db['VoiceMail'],{'foreignKey':_0x0275('0x166'),'targetKey':'mailbox'});db['VoiceCallReport'][_0x0275('0x120')](db[_0x0275('0x27')],{'as':_0x0275('0x167'),'foreignKey':_0x0275('0x168'),'constraints':![]});db[_0x0275('0x22')][_0x0275('0x120')](db[_0x0275('0x25')],{'as':_0x0275('0x169'),'foreignKey':'uniqueid','constraints':![]});db[_0x0275('0x22')][_0x0275('0x12e')](db[_0x0275('0x11c')],{'as':_0x0275('0x11c'),'foreignKey':'UserId'});db['VoiceCallReport'][_0x0275('0x12e')](db[_0x0275('0x78')],{'as':'Contact','foreignKey':_0x0275('0x16a')});db[_0x0275('0x3a')][_0x0275('0x12e')](db[_0x0275('0x3d')],{'as':_0x0275('0x3d'),'foreignKey':_0x0275('0x16b')});db[_0x0275('0x16c')][_0x0275('0x12e')](db[_0x0275('0x3d')],{'as':_0x0275('0x3d'),'foreignKey':_0x0275('0x16b')});db[_0x0275('0x3d')][_0x0275('0x11d')](db[_0x0275('0x3a')],{'as':_0x0275('0x16d'),'onDelete':_0x0275('0x11e')});db['MailAccount']['hasOne'](db[_0x0275('0x16c')],{'as':_0x0275('0x16e'),'onDelete':'cascade'});db[_0x0275('0x3d')][_0x0275('0x120')](db[_0x0275('0x86')],{'as':_0x0275('0x16f'),'foreignKey':_0x0275('0x16b'),'onDelete':_0x0275('0x11e')});db['MailAccount'][_0x0275('0x120')](db[_0x0275('0x85')],{'as':'Answers','foreignKey':'MailAccountId'});db[_0x0275('0x3d')][_0x0275('0x120')](db['MailMessage'],{'as':'Messages','foreignKey':_0x0275('0x16b')});db['MailAccount'][_0x0275('0x120')](db[_0x0275('0x42')],{'as':_0x0275('0x170')});db[_0x0275('0x3d')]['hasMany'](db[_0x0275('0x46')],{'as':_0x0275('0x171')});db[_0x0275('0x3d')]['belongsTo'](db[_0x0275('0x104')],{'as':'List','foreignKey':_0x0275('0x172')});db[_0x0275('0x3d')][_0x0275('0x12e')](db['Template'],{'as':_0x0275('0x95'),'foreignKey':_0x0275('0x173')});db[_0x0275('0x3d')][_0x0275('0x12e')](db[_0x0275('0x8b')],{'as':_0x0275('0x174'),'foreignKey':_0x0275('0x15e')});db[_0x0275('0x3d')][_0x0275('0x132')](db[_0x0275('0x11c')],{'as':_0x0275('0x160'),'through':'user_has_mail_accounts'});db[_0x0275('0x3f')][_0x0275('0x132')](db[_0x0275('0x11c')],{'as':_0x0275('0x160'),'through':'UserMailQueue'});db[_0x0275('0x3f')][_0x0275('0x132')](db[_0x0275('0xf0')],{'through':_0x0275('0x175'),'as':'Teams'});db[_0x0275('0x42')][_0x0275('0x120')](db[_0x0275('0x44')],{'as':'Messages','onDelete':_0x0275('0x11e'),'foreignKey':_0x0275('0x176')});db[_0x0275('0x42')][_0x0275('0x12e')](db[_0x0275('0x3d')],{'as':_0x0275('0x177'),'foreignKey':_0x0275('0x16b')});db[_0x0275('0x42')][_0x0275('0x12e')](db[_0x0275('0x78')],{'as':'Contact','foreignKey':_0x0275('0x16a')});db[_0x0275('0x42')]['belongsTo'](db[_0x0275('0x11c')],{'as':_0x0275('0x178'),'foreignKey':_0x0275('0x11f')});db[_0x0275('0x42')][_0x0275('0x132')](db[_0x0275('0x179')],{'through':_0x0275('0x17a'),'as':_0x0275('0x17b')});db[_0x0275('0x42')][_0x0275('0x132')](db[_0x0275('0x179')],{'through':'mail_interaction_has_tags','as':'ThroughTags'});db[_0x0275('0x42')]['belongsToMany'](db[_0x0275('0x11c')],{'as':_0x0275('0x17c'),'through':_0x0275('0x137'),'foreignKey':_0x0275('0x176')});db['MailMessage'][_0x0275('0x120')](db[_0x0275('0xf8')],{'as':_0x0275('0x17d'),'onDelete':_0x0275('0x11e')});db[_0x0275('0x44')][_0x0275('0x12e')](db[_0x0275('0x11c')],{'as':_0x0275('0x11c')});db[_0x0275('0x44')][_0x0275('0x12e')](db[_0x0275('0x78')],{'onDelete':'cascade','as':_0x0275('0x17e')});db[_0x0275('0x44')][_0x0275('0x12e')](db['MailInteraction'],{'as':_0x0275('0x17f'),'foreignKey':_0x0275('0x176')});db[_0x0275('0x44')]['belongsTo'](db[_0x0275('0x3d')],{'as':_0x0275('0x177'),'foreignKey':_0x0275('0x16b')});db['MailMessage'][_0x0275('0x12e')](db['ChatWebsite'],{'as':'ChatWebsite','foreignKey':'ChatWebsiteId'});db[_0x0275('0x44')][_0x0275('0x12e')](db['ChatOfflineMessage'],{'as':_0x0275('0x70'),'foreignKey':_0x0275('0x180')});db[_0x0275('0x46')][_0x0275('0x12e')](db[_0x0275('0x11c')],{'onDelete':_0x0275('0x181')});db[_0x0275('0x46')][_0x0275('0x12e')](db[_0x0275('0x3f')],{'onDelete':'restrict'});db[_0x0275('0x46')][_0x0275('0x12e')](db[_0x0275('0x3d')],{'onDelete':_0x0275('0x181')});db[_0x0275('0x46')][_0x0275('0x12e')](db[_0x0275('0x15d')],{'onDelete':_0x0275('0x181'),'foreignKey':'IntervalId'});db['MailApplication'][_0x0275('0x12e')](db[_0x0275('0x179')],{'onDelete':_0x0275('0x181'),'foreignKey':_0x0275('0x182')});db[_0x0275('0x48')][_0x0275('0x12e')](db[_0x0275('0x3d')],{});db['MailQueueReport'][_0x0275('0x12e')](db[_0x0275('0x104')],{'as':_0x0275('0x183'),'foreignKey':'ListId'});db[_0x0275('0x48')][_0x0275('0x12e')](db['CmContact'],{'as':_0x0275('0x17e'),'foreignKey':_0x0275('0x16a')});db['MailQueueReport'][_0x0275('0x12e')](db[_0x0275('0x42')],{});db[_0x0275('0x48')]['belongsTo'](db['MailMessage'],{});db['MailQueueReport'][_0x0275('0x12e')](db[_0x0275('0x11c')],{});db[_0x0275('0x48')][_0x0275('0x12e')](db[_0x0275('0x3f')],{});db[_0x0275('0x49')][_0x0275('0x120')](db[_0x0275('0x184')],{'as':_0x0275('0x185'),'onDelete':'cascade'});db[_0x0275('0x4c')]['hasMany'](db[_0x0275('0x86')],{'as':_0x0275('0x16f'),'foreignKey':_0x0275('0x186'),'onDelete':_0x0275('0x11e')});db[_0x0275('0x4c')]['hasMany'](db['CannedAnswer'],{'as':'Answers','foreignKey':_0x0275('0x186')});db[_0x0275('0x4c')][_0x0275('0x120')](db[_0x0275('0x4f')],{'as':_0x0275('0x170')});db[_0x0275('0x4c')][_0x0275('0x120')](db[_0x0275('0x4d')],{'as':_0x0275('0x171')});db[_0x0275('0x4c')]['hasMany'](db[_0x0275('0x15')],{'as':_0x0275('0x187'),'onDelete':_0x0275('0x11e')});db[_0x0275('0x4c')][_0x0275('0x120')](db[_0x0275('0x51')],{'as':_0x0275('0x164')});db['FaxAccount'][_0x0275('0x12e')](db[_0x0275('0x159')],{'as':_0x0275('0x159')});db[_0x0275('0x4c')][_0x0275('0x12e')](db[_0x0275('0x104')],{'as':_0x0275('0x183'),'foreignKey':_0x0275('0x172')});db[_0x0275('0x4c')][_0x0275('0x12e')](db['Pause'],{'as':_0x0275('0x174'),'foreignKey':_0x0275('0x15e')});db['FaxAccount'][_0x0275('0x132')](db[_0x0275('0x11c')],{'as':_0x0275('0x160'),'through':_0x0275('0x146')});db[_0x0275('0x4d')][_0x0275('0x12e')](db['User'],{'onDelete':_0x0275('0x181')});db['FaxApplication'][_0x0275('0x12e')](db[_0x0275('0x53')],{'onDelete':_0x0275('0x181')});db[_0x0275('0x4d')][_0x0275('0x12e')](db['FaxAccount'],{'onDelete':'restrict'});db[_0x0275('0x4d')]['belongsTo'](db[_0x0275('0x179')],{'onDelete':'restrict','foreignKey':'TagId'});db[_0x0275('0x4f')][_0x0275('0x120')](db[_0x0275('0x51')],{'as':_0x0275('0x164'),'onDelete':_0x0275('0x11e'),'foreignKey':'FaxInteractionId'});db[_0x0275('0x4f')][_0x0275('0x12e')](db[_0x0275('0x4c')],{'as':'Account','foreignKey':'FaxAccountId'});db[_0x0275('0x4f')][_0x0275('0x12e')](db[_0x0275('0x78')],{'as':_0x0275('0x17e'),'foreignKey':_0x0275('0x16a')});db[_0x0275('0x4f')][_0x0275('0x12e')](db[_0x0275('0x11c')],{'as':_0x0275('0x178'),'foreignKey':_0x0275('0x11f')});db['FaxInteraction']['belongsToMany'](db['Tag'],{'through':_0x0275('0x188'),'as':_0x0275('0x17b')});db[_0x0275('0x4f')][_0x0275('0x132')](db[_0x0275('0x179')],{'through':_0x0275('0x188'),'as':_0x0275('0x189')});db[_0x0275('0x4f')][_0x0275('0x132')](db[_0x0275('0x11c')],{'as':'Users','through':_0x0275('0x139'),'foreignKey':_0x0275('0x18a')});db[_0x0275('0x51')][_0x0275('0x12e')](db[_0x0275('0x11c')],{'onDelete':_0x0275('0x11e'),'as':_0x0275('0x11c')});db['FaxMessage']['belongsTo'](db[_0x0275('0x4f')],{'as':_0x0275('0x17f'),'foreignKey':_0x0275('0x18a')});db[_0x0275('0x51')]['belongsTo'](db[_0x0275('0x78')],{'onDelete':_0x0275('0x11e'),'as':_0x0275('0x17e')});db['FaxMessage'][_0x0275('0x12e')](db[_0x0275('0xf8')],{'as':_0x0275('0xf8'),'foreignKey':_0x0275('0x18b')});db[_0x0275('0x51')][_0x0275('0x12e')](db[_0x0275('0x4c')],{'as':_0x0275('0x177'),'foreignKey':_0x0275('0x186')});db['FaxQueue'][_0x0275('0x132')](db[_0x0275('0x11c')],{'as':_0x0275('0x160'),'through':_0x0275('0x33')});db[_0x0275('0x53')]['belongsToMany'](db[_0x0275('0xf0')],{'through':_0x0275('0x18c'),'as':_0x0275('0x161')});db[_0x0275('0x55')][_0x0275('0x12e')](db[_0x0275('0x4c')],{});db[_0x0275('0x55')][_0x0275('0x12e')](db[_0x0275('0x104')],{'as':_0x0275('0x183'),'foreignKey':_0x0275('0x172')});db[_0x0275('0x55')][_0x0275('0x12e')](db['CmContact'],{'as':'Contact','foreignKey':'ContactId'});db[_0x0275('0x55')][_0x0275('0x12e')](db['FaxInteraction'],{});db['FaxQueueReport']['belongsTo'](db[_0x0275('0x51')],{});db[_0x0275('0x55')][_0x0275('0x12e')](db[_0x0275('0x11c')],{});db[_0x0275('0x55')][_0x0275('0x12e')](db[_0x0275('0x53')],{});db[_0x0275('0x57')][_0x0275('0x120')](db[_0x0275('0x86')],{'as':_0x0275('0x16f'),'foreignKey':_0x0275('0x18d'),'onDelete':'cascade'});db[_0x0275('0x57')][_0x0275('0x120')](db['CannedAnswer'],{'as':_0x0275('0x18e'),'foreignKey':'SmsAccountId'});db[_0x0275('0x57')][_0x0275('0x120')](db[_0x0275('0x5d')],{'as':_0x0275('0x164'),'foreignKey':_0x0275('0x18d')});db[_0x0275('0x57')]['hasMany'](db[_0x0275('0x5b')],{'as':'Interactions'});db[_0x0275('0x57')][_0x0275('0x120')](db[_0x0275('0x59')],{'as':_0x0275('0x171')});db['SmsAccount'][_0x0275('0x12e')](db[_0x0275('0x104')],{'as':_0x0275('0x183'),'foreignKey':_0x0275('0x172')});db[_0x0275('0x57')]['belongsTo'](db['Pause'],{'as':'mandatoryDispositionPause','foreignKey':_0x0275('0x15e')});db['SmsAccount'][_0x0275('0x132')](db[_0x0275('0x11c')],{'as':_0x0275('0x160'),'through':_0x0275('0x14a')});db['SmsApplication'][_0x0275('0x12e')](db['User'],{'onDelete':'restrict'});db[_0x0275('0x59')]['belongsTo'](db['SmsQueue'],{'onDelete':_0x0275('0x181')});db[_0x0275('0x59')]['belongsTo'](db['SmsAccount'],{'onDelete':_0x0275('0x181')});db[_0x0275('0x59')][_0x0275('0x12e')](db[_0x0275('0x15d')],{'onDelete':_0x0275('0x181'),'foreignKey':_0x0275('0x18f')});db[_0x0275('0x59')][_0x0275('0x12e')](db[_0x0275('0x179')],{'onDelete':_0x0275('0x181'),'foreignKey':_0x0275('0x182')});db[_0x0275('0x5b')][_0x0275('0x120')](db[_0x0275('0x5d')],{'as':'Messages','onDelete':_0x0275('0x11e'),'foreignKey':_0x0275('0x190')});db['SmsInteraction'][_0x0275('0x12e')](db[_0x0275('0x57')],{'as':'Account','foreignKey':_0x0275('0x18d')});db[_0x0275('0x5b')]['belongsTo'](db['CmContact'],{'as':_0x0275('0x17e'),'foreignKey':_0x0275('0x16a')});db[_0x0275('0x5b')][_0x0275('0x12e')](db[_0x0275('0x11c')],{'as':_0x0275('0x178'),'foreignKey':_0x0275('0x11f')});db['SmsInteraction'][_0x0275('0x132')](db[_0x0275('0x179')],{'through':_0x0275('0x191'),'as':'Tags'});db[_0x0275('0x5b')][_0x0275('0x132')](db['Tag'],{'through':'sms_interaction_has_tags','as':_0x0275('0x189')});db['SmsInteraction'][_0x0275('0x132')](db[_0x0275('0x11c')],{'as':_0x0275('0x17c'),'through':'user_has_sms_interactions','foreignKey':_0x0275('0x190')});db[_0x0275('0x5d')][_0x0275('0x12e')](db[_0x0275('0x11c')],{'as':'User'});db[_0x0275('0x5d')][_0x0275('0x12e')](db[_0x0275('0x78')],{'onDelete':_0x0275('0x11e'),'as':_0x0275('0x17e')});db[_0x0275('0x5d')]['belongsTo'](db[_0x0275('0x5b')],{'onDelete':_0x0275('0x11e'),'as':'Interaction','foreignKey':_0x0275('0x190')});db['SmsMessage'][_0x0275('0x12e')](db[_0x0275('0x57')],{'as':_0x0275('0x177'),'foreignKey':_0x0275('0x18d')});db[_0x0275('0x5f')][_0x0275('0x132')](db[_0x0275('0x11c')],{'as':_0x0275('0x160'),'through':'UserSmsQueue','foreignKey':'SmsQueueId'});db[_0x0275('0x5f')][_0x0275('0x132')](db[_0x0275('0xf0')],{'through':'team_has_sms_queues','as':'Teams'});db['OpenchannelAccount'][_0x0275('0x120')](db['Disposition'],{'as':'Dispositions','foreignKey':_0x0275('0x192'),'onDelete':_0x0275('0x11e')});db[_0x0275('0x193')][_0x0275('0x120')](db[_0x0275('0x85')],{'as':_0x0275('0x18e'),'foreignKey':_0x0275('0x192')});db[_0x0275('0x193')]['hasMany'](db[_0x0275('0x63')],{'as':_0x0275('0x170'),'foreignKey':_0x0275('0x192')});db['OpenchannelAccount']['hasMany'](db[_0x0275('0x64')],{'as':_0x0275('0x164'),'foreignKey':_0x0275('0x192')});db[_0x0275('0x193')][_0x0275('0x120')](db['OpenchannelApplication'],{'as':_0x0275('0x171'),'foreignKey':_0x0275('0x192')});db[_0x0275('0x193')][_0x0275('0x12e')](db[_0x0275('0x104')],{'as':'List','foreignKey':'ListId'});db[_0x0275('0x193')][_0x0275('0x12e')](db['Pause'],{'as':'mandatoryDispositionPause','foreignKey':_0x0275('0x15e')});db['OpenchannelAccount'][_0x0275('0x132')](db[_0x0275('0x11c')],{'as':'Agents','through':_0x0275('0x194')});db['OpenchannelApplication']['belongsTo'](db[_0x0275('0x11c')],{'onDelete':_0x0275('0x181')});db[_0x0275('0x62')][_0x0275('0x12e')](db['OpenchannelQueue'],{'onDelete':_0x0275('0x181'),'foreignKey':_0x0275('0x195')});db[_0x0275('0x62')][_0x0275('0x12e')](db[_0x0275('0x193')],{'onDelete':_0x0275('0x181'),'foreignKey':'OpenchannelAccountId'});db[_0x0275('0x62')][_0x0275('0x12e')](db[_0x0275('0x15d')],{'onDelete':_0x0275('0x181'),'foreignKey':'IntervalId'});db['OpenchannelApplication'][_0x0275('0x12e')](db[_0x0275('0x179')],{'onDelete':'restrict','foreignKey':_0x0275('0x182')});db[_0x0275('0x63')]['hasMany'](db[_0x0275('0x64')],{'as':_0x0275('0x164'),'onDelete':_0x0275('0x11e'),'foreignKey':_0x0275('0x196')});db[_0x0275('0x63')][_0x0275('0x12e')](db[_0x0275('0x193')],{'as':'Account','foreignKey':_0x0275('0x192')});db[_0x0275('0x63')][_0x0275('0x12e')](db[_0x0275('0x78')],{'as':_0x0275('0x17e'),'foreignKey':_0x0275('0x16a')});db['OpenchannelInteraction']['belongsTo'](db[_0x0275('0x11c')],{'as':_0x0275('0x178'),'foreignKey':_0x0275('0x11f')});db[_0x0275('0x63')][_0x0275('0x132')](db[_0x0275('0x179')],{'through':_0x0275('0x197'),'as':_0x0275('0x17b')});db[_0x0275('0x63')][_0x0275('0x132')](db[_0x0275('0x179')],{'through':_0x0275('0x197'),'as':'ThroughTags'});db['OpenchannelInteraction'][_0x0275('0x132')](db[_0x0275('0x11c')],{'as':_0x0275('0x17c'),'through':'user_has_openchannel_interactions','foreignKey':_0x0275('0x196')});db[_0x0275('0x64')]['belongsTo'](db[_0x0275('0x11c')],{'onDelete':_0x0275('0x11e'),'as':_0x0275('0x11c')});db[_0x0275('0x64')][_0x0275('0x12e')](db[_0x0275('0x78')],{'onDelete':_0x0275('0x11e'),'as':_0x0275('0x17e')});db['OpenchannelMessage'][_0x0275('0x12e')](db[_0x0275('0x63')],{'onDelete':_0x0275('0x11e'),'as':'Interaction','foreignKey':_0x0275('0x196')});db[_0x0275('0x64')]['belongsTo'](db[_0x0275('0xf8')],{'as':_0x0275('0xf8'),'foreignKey':_0x0275('0x18b')});db[_0x0275('0x64')][_0x0275('0x12e')](db[_0x0275('0x193')],{'as':_0x0275('0x177'),'foreignKey':_0x0275('0x192')});db[_0x0275('0x66')][_0x0275('0x132')](db[_0x0275('0x11c')],{'as':'Agents','through':'UserOpenchannelQueue','foreignKey':_0x0275('0x195')});db['OpenchannelQueue'][_0x0275('0x132')](db[_0x0275('0xf0')],{'through':_0x0275('0x198'),'as':_0x0275('0x161')});db[_0x0275('0x68')][_0x0275('0x120')](db[_0x0275('0x86')],{'as':_0x0275('0x16f'),'foreignKey':_0x0275('0x199'),'onDelete':_0x0275('0x11e')});db[_0x0275('0x68')]['hasMany'](db[_0x0275('0x85')],{'as':_0x0275('0x18e'),'foreignKey':_0x0275('0x199')});db[_0x0275('0x68')]['hasMany'](db[_0x0275('0x19a')],{'as':_0x0275('0x19b')});db['ChatWebsite'][_0x0275('0x120')](db[_0x0275('0x6d')],{'as':_0x0275('0x170')});db[_0x0275('0x68')][_0x0275('0x120')](db['ChatApplication'],{'as':'Applications'});db['ChatWebsite']['hasMany'](db['ChatMessage'],{'as':_0x0275('0x164')});db['ChatWebsite'][_0x0275('0x12e')](db['CmList'],{'as':_0x0275('0x183'),'foreignKey':_0x0275('0x172')});db[_0x0275('0x68')][_0x0275('0x12e')](db[_0x0275('0x15d')],{'as':_0x0275('0x15d'),'foreignKey':'IntervalId'});db[_0x0275('0x68')][_0x0275('0x12e')](db[_0x0275('0x3d')],{'as':'MailAccount','foreignKey':_0x0275('0x16b')});db['ChatWebsite'][_0x0275('0x12e')](db[_0x0275('0x8b')],{'as':_0x0275('0x174'),'foreignKey':_0x0275('0x15e')});db['ChatWebsite'][_0x0275('0x132')](db[_0x0275('0x11c')],{'as':_0x0275('0x160'),'through':_0x0275('0x144')});db[_0x0275('0x69')][_0x0275('0x12e')](db[_0x0275('0x193')],{});db[_0x0275('0x69')][_0x0275('0x12e')](db[_0x0275('0x104')],{'as':_0x0275('0x183'),'foreignKey':_0x0275('0x172')});db['OpenchannelQueueReport'][_0x0275('0x12e')](db[_0x0275('0x78')],{'as':_0x0275('0x17e'),'foreignKey':_0x0275('0x16a')});db['OpenchannelQueueReport']['belongsTo'](db[_0x0275('0x63')],{});db[_0x0275('0x69')]['belongsTo'](db[_0x0275('0x64')],{});db[_0x0275('0x69')][_0x0275('0x12e')](db[_0x0275('0x11c')],{});db[_0x0275('0x69')][_0x0275('0x12e')](db[_0x0275('0x66')],{});db[_0x0275('0x6b')][_0x0275('0x12e')](db['User'],{'as':_0x0275('0x19c'),'foreignKey':_0x0275('0x11f'),'onDelete':_0x0275('0x181')});db['ChatApplication'][_0x0275('0x12e')](db['ChatQueue'],{'as':_0x0275('0x19d'),'foreignKey':'ChatQueueId','onDelete':_0x0275('0x181')});db[_0x0275('0x6b')][_0x0275('0x12e')](db['ChatWebsite'],{'as':_0x0275('0x19e'),'foreignKey':_0x0275('0x199'),'onDelete':_0x0275('0x181')});db[_0x0275('0x6b')]['belongsTo'](db['Tag'],{'onDelete':_0x0275('0x181'),'foreignKey':_0x0275('0x182')});db[_0x0275('0x6d')][_0x0275('0x120')](db['ChatMessage'],{'as':'Messages','onDelete':_0x0275('0x11e'),'foreignKey':_0x0275('0x19f')});db[_0x0275('0x6d')][_0x0275('0x12e')](db[_0x0275('0x68')],{'as':_0x0275('0x177'),'foreignKey':'ChatWebsiteId'});db[_0x0275('0x6d')][_0x0275('0x12e')](db['CmContact'],{'as':_0x0275('0x17e'),'foreignKey':_0x0275('0x16a')});db[_0x0275('0x6d')][_0x0275('0x12e')](db[_0x0275('0x11c')],{'as':_0x0275('0x178'),'foreignKey':_0x0275('0x11f')});db['ChatInteraction'][_0x0275('0x132')](db[_0x0275('0x179')],{'through':'chat_interaction_has_tags','as':_0x0275('0x17b')});db[_0x0275('0x6d')][_0x0275('0x132')](db[_0x0275('0x179')],{'through':_0x0275('0x1a0'),'as':_0x0275('0x189')});db[_0x0275('0x6d')]['belongsToMany'](db[_0x0275('0x11c')],{'as':_0x0275('0x17c'),'through':_0x0275('0x138'),'foreignKey':'ChatInteractionId'});db[_0x0275('0x6e')][_0x0275('0x12e')](db[_0x0275('0x11c')],{'onDelete':_0x0275('0x11e'),'as':_0x0275('0x11c')});db[_0x0275('0x6e')][_0x0275('0x12e')](db[_0x0275('0x78')],{'onDelete':_0x0275('0x11e'),'as':_0x0275('0x17e'),'foreignKey':_0x0275('0x16a')});db[_0x0275('0x6e')][_0x0275('0x12e')](db[_0x0275('0x6d')],{'onDelete':_0x0275('0x11e'),'as':_0x0275('0x17f'),'foreignKey':_0x0275('0x19f')});db[_0x0275('0x6e')]['belongsTo'](db['Attachment'],{'as':_0x0275('0xf8'),'foreignKey':_0x0275('0x18b')});db[_0x0275('0x6e')][_0x0275('0x12e')](db['ChatWebsite'],{'as':_0x0275('0x177'),'foreignKey':_0x0275('0x199')});db[_0x0275('0x70')][_0x0275('0x120')](db[_0x0275('0xf8')],{'as':_0x0275('0x17d'),'foreignKey':'ChatOfflineMessageId','onDelete':_0x0275('0x11e'),'hooks':!![]});db[_0x0275('0x70')][_0x0275('0x12e')](db[_0x0275('0x78')],{'onDelete':_0x0275('0x11e'),'as':_0x0275('0x17e'),'foreignKey':'ContactId'});db[_0x0275('0x70')][_0x0275('0x12e')](db[_0x0275('0x68')],{'as':'Account','foreignKey':_0x0275('0x199')});db[_0x0275('0x72')][_0x0275('0x132')](db['User'],{'as':'Agents','through':_0x0275('0x140'),'hooks':!![]});db[_0x0275('0x72')]['belongsToMany'](db[_0x0275('0xf0')],{'through':'team_has_chat_queues','as':_0x0275('0x161')});db[_0x0275('0x74')][_0x0275('0x120')](db[_0x0275('0x1a1')],{'as':'Messages','foreignKey':_0x0275('0x1a2'),'onDelete':_0x0275('0x11e')});db[_0x0275('0x74')][_0x0275('0x132')](db[_0x0275('0x11c')],{'as':_0x0275('0x154'),'through':_0x0275('0x131')});db[_0x0275('0x19a')][_0x0275('0x12e')](db[_0x0275('0x68')],{'as':_0x0275('0x19e'),'foreignKey':_0x0275('0x199')});db[_0x0275('0x76')][_0x0275('0x120')](db[_0x0275('0x78')],{'as':_0x0275('0x133'),'foreignKey':_0x0275('0x1a3')});db[_0x0275('0x78')][_0x0275('0x120')](db[_0x0275('0x7a')],{'as':_0x0275('0x156'),'foreignKey':_0x0275('0x16a')});db[_0x0275('0x78')][_0x0275('0x120')](db['CmHopperFinal'],{'as':_0x0275('0x123'),'foreignKey':_0x0275('0x16a')});db['CmContact'][_0x0275('0x120')](db[_0x0275('0x124')],{'as':_0x0275('0x157'),'foreignKey':_0x0275('0x16a')});db['CmContact'][_0x0275('0x120')](db[_0x0275('0x81')],{'as':_0x0275('0x81'),'foreignKey':_0x0275('0x16a')});db[_0x0275('0x78')][_0x0275('0x120')](db[_0x0275('0xe1')],{'as':_0x0275('0x158'),'foreignKey':_0x0275('0x16a')});db[_0x0275('0x78')]['hasMany'](db['OpenchannelInteraction'],{'as':_0x0275('0x1a4'),'foreignKey':'ContactId','onDelete':_0x0275('0x181')});db[_0x0275('0x78')][_0x0275('0x120')](db[_0x0275('0x6d')],{'as':_0x0275('0x126'),'foreignKey':'ContactId','onDelete':_0x0275('0x181')});db[_0x0275('0x78')][_0x0275('0x120')](db['SmsInteraction'],{'as':_0x0275('0x127'),'foreignKey':_0x0275('0x16a'),'onDelete':_0x0275('0x181')});db[_0x0275('0x78')]['hasMany'](db[_0x0275('0x4f')],{'as':_0x0275('0x128'),'foreignKey':_0x0275('0x16a'),'onDelete':_0x0275('0x181')});db[_0x0275('0x78')]['hasMany'](db[_0x0275('0x42')],{'as':'MailInteractions','foreignKey':_0x0275('0x16a'),'onDelete':_0x0275('0x181')});db['CmContact'][_0x0275('0x12e')](db[_0x0275('0x76')],{'as':'Company','foreignKey':'CompanyId'});db['CmContact']['belongsTo'](db[_0x0275('0x104')],{'as':_0x0275('0x183'),'foreignKey':_0x0275('0x172'),'onDelete':_0x0275('0x11e')});db[_0x0275('0x78')][_0x0275('0x132')](db[_0x0275('0x11c')],{'as':_0x0275('0x17c'),'through':_0x0275('0x1a5')});db[_0x0275('0x78')]['belongsToMany'](db['Tag'],{'as':_0x0275('0x17b'),'through':_0x0275('0x1a6')});db[_0x0275('0x78')][_0x0275('0x132')](db[_0x0275('0x179')],{'through':_0x0275('0x1a6'),'as':_0x0275('0x189')});db[_0x0275('0x7a')]['belongsTo'](db[_0x0275('0x78')],{'as':_0x0275('0x17e'),'foreignKey':_0x0275('0x16a'),'onDelete':'cascade'});db[_0x0275('0x7a')]['belongsTo'](db[_0x0275('0x104')],{'as':_0x0275('0x183'),'foreignKey':_0x0275('0x172'),'onDelete':_0x0275('0x11e')});db[_0x0275('0x7a')][_0x0275('0x12e')](db[_0x0275('0x11c')],{'as':_0x0275('0x19c'),'foreignKey':_0x0275('0x11f')});db[_0x0275('0x7a')][_0x0275('0x12e')](db[_0x0275('0x19')],{'as':_0x0275('0x19d'),'foreignKey':_0x0275('0x155'),'onDelete':_0x0275('0x11e')});db[_0x0275('0x7a')]['belongsTo'](db[_0x0275('0xf4')],{'as':'Campaign','foreignKey':_0x0275('0x1a7'),'onDelete':_0x0275('0x11e')});db['CmHopper'][_0x0275('0x12e')](db[_0x0275('0x11c')],{'as':_0x0275('0x178'),'foreignKey':_0x0275('0x1a8')});db[_0x0275('0x7c')][_0x0275('0x12e')](db[_0x0275('0x78')],{'as':_0x0275('0x17e'),'foreignKey':_0x0275('0x16a'),'onDelete':_0x0275('0x11e')});db['CmHopperBlack'][_0x0275('0x12e')](db[_0x0275('0x104')],{'as':'List','foreignKey':'ListId','onDelete':'cascade'});db['CmHopperBlack'][_0x0275('0x12e')](db[_0x0275('0x19')],{'as':_0x0275('0x19d'),'foreignKey':_0x0275('0x155'),'onDelete':_0x0275('0x11e')});db[_0x0275('0x7c')][_0x0275('0x12e')](db[_0x0275('0xf4')],{'as':_0x0275('0xf4'),'foreignKey':_0x0275('0x1a7'),'onDelete':_0x0275('0x11e')});db[_0x0275('0x84')][_0x0275('0x120')](db['Condition'],{'as':{'plural':_0x0275('0x1a9'),'singular':_0x0275('0x1aa')},'foreignKey':'AutomationAllId','onDelete':_0x0275('0x11e'),'hooks':!![]});db[_0x0275('0x84')]['hasMany'](db['Condition'],{'as':{'plural':_0x0275('0x1ab'),'singular':_0x0275('0x1ac')},'foreignKey':_0x0275('0x1ad'),'onDelete':_0x0275('0x11e'),'hooks':!![]});db['Automation'][_0x0275('0x120')](db['Action'],{'as':_0x0275('0x1ae'),'foreignKey':_0x0275('0x1af'),'onDelete':_0x0275('0x11e'),'hooks':!![]});db[_0x0275('0x86')][_0x0275('0x120')](db[_0x0275('0x86')],{'as':_0x0275('0x16f'),'foreignKey':_0x0275('0x1b0'),'onDelete':_0x0275('0x11e')});db['Interval'][_0x0275('0x120')](db[_0x0275('0x15d')],{'as':_0x0275('0x1b1'),'foreignKey':'IntervalId','onDelete':'cascade','hooks':!![],'required':![]});db[_0x0275('0x15d')][_0x0275('0x120')](db[_0x0275('0x15')],{'as':_0x0275('0x122'),'foreignKey':_0x0275('0x18f'),'onDelete':_0x0275('0x181')});db[_0x0275('0x15d')][_0x0275('0x120')](db[_0x0275('0x46')],{'as':_0x0275('0x1b2'),'foreignKey':'IntervalId'});db[_0x0275('0x15d')][_0x0275('0x120')](db[_0x0275('0x6b')],{'as':_0x0275('0x1b3'),'foreignKey':_0x0275('0x18f')});db[_0x0275('0x15d')][_0x0275('0x120')](db[_0x0275('0x4d')],{'as':_0x0275('0x1b4'),'foreignKey':_0x0275('0x18f')});db[_0x0275('0x15d')]['hasMany'](db[_0x0275('0x59')],{'as':'SmsApplications','foreignKey':'IntervalId'});db[_0x0275('0x90')][_0x0275('0x12e')](db['MailAccount'],{});db[_0x0275('0x90')][_0x0275('0x12e')](db['AnalyticDefaultReport'],{'foreignKey':_0x0275('0x1b5')});db[_0x0275('0x90')]['belongsTo'](db[_0x0275('0x9c')],{'foreignKey':_0x0275('0x1b6')});db[_0x0275('0x92')][_0x0275('0x132')](db[_0x0275('0x17')],{'as':'Mohs','through':_0x0275('0x153'),'onDelete':_0x0275('0x181')});db[_0x0275('0x179')][_0x0275('0x132')](db[_0x0275('0x78')],{'through':_0x0275('0x1a6')});db[_0x0275('0x179')][_0x0275('0x132')](db[_0x0275('0x6d')],{'through':_0x0275('0x1a0')});db[_0x0275('0x179')][_0x0275('0x132')](db['MailInteraction'],{'through':_0x0275('0x17a')});db['Tag'][_0x0275('0x132')](db[_0x0275('0x5b')],{'through':_0x0275('0x191')});db[_0x0275('0x179')][_0x0275('0x132')](db[_0x0275('0x4f')],{'through':_0x0275('0x188')});db[_0x0275('0x179')][_0x0275('0x132')](db[_0x0275('0x63')],{'through':_0x0275('0x197')});db['Tag'][_0x0275('0x132')](db[_0x0275('0x12a')],{'through':_0x0275('0x1b7')});db['Trigger'][_0x0275('0x120')](db[_0x0275('0x88')],{'as':{'plural':_0x0275('0x1b8'),'singular':_0x0275('0x1b9')},'foreignKey':_0x0275('0x1ba'),'onDelete':_0x0275('0x11e'),'hooks':!![]});db['Trigger'][_0x0275('0x120')](db['Condition'],{'as':{'plural':_0x0275('0x1bb'),'singular':_0x0275('0x1bc')},'foreignKey':_0x0275('0x1bd'),'onDelete':'cascade','hooks':!![]});db['Trigger'][_0x0275('0x120')](db[_0x0275('0x1be')],{'as':_0x0275('0x1ae'),'foreignKey':_0x0275('0x1bf'),'onDelete':_0x0275('0x11e'),'hooks':!![]});db[_0x0275('0x9c')][_0x0275('0x120')](db[_0x0275('0x1c0')],{'as':_0x0275('0x1c1'),'onDelete':_0x0275('0x11e'),'foreignKey':_0x0275('0x1b6'),'hooks':!![]});db[_0x0275('0x9e')][_0x0275('0x120')](db[_0x0275('0x1c0')],{'as':'Fields','onDelete':'cascade','foreignKey':_0x0275('0x1b5')});db[_0x0275('0xa1')]['hasMany'](db[_0x0275('0x1c0')],{'as':_0x0275('0x1c1'),'onDelete':_0x0275('0x11e'),'foreignKey':_0x0275('0x1c2')});db[_0x0275('0x1c0')][_0x0275('0x12e')](db['AnalyticMetric'],{'foreignKey':'MetricId'});db['SalesforceAccount'][_0x0275('0x120')](db['SalesforceConfiguration'],{'as':_0x0275('0x1c3'),'onDelete':_0x0275('0x11e'),'foreignKey':_0x0275('0x1c4')});db[_0x0275('0xa7')]['hasMany'](db['SalesforceField'],{'as':'Subjects','onDelete':'cascade','foreignKey':'SubjectId'});db[_0x0275('0xa7')]['hasMany'](db[_0x0275('0xa9')],{'as':'Descriptions','onDelete':'cascade','foreignKey':_0x0275('0x1c5')});db[_0x0275('0xa7')]['hasMany'](db['SalesforceField'],{'as':_0x0275('0x1c1'),'onDelete':'cascade','foreignKey':_0x0275('0x1c6')});db[_0x0275('0xa7')]['belongsTo'](db[_0x0275('0xa5')],{'as':_0x0275('0x177'),'foreignKey':_0x0275('0x1c4')});db[_0x0275('0xa9')][_0x0275('0x120')](db[_0x0275('0xa9')],{'as':_0x0275('0x1c7'),'foreignKey':_0x0275('0x1c8')});db['SalesforceField'][_0x0275('0x120')](db[_0x0275('0xa9')],{'as':'Description','foreignKey':'DescriptionId'});db[_0x0275('0xa9')][_0x0275('0x120')](db[_0x0275('0xa9')],{'as':_0x0275('0x1c9'),'foreignKey':_0x0275('0x1c6')});db[_0x0275('0xa9')][_0x0275('0x12e')](db['Variable'],{'as':'Variable','foreignKey':'VariableId'});db['SugarcrmAccount']['hasMany'](db[_0x0275('0xad')],{'as':_0x0275('0x1c3'),'onDelete':_0x0275('0x11e'),'foreignKey':_0x0275('0x1c4')});db[_0x0275('0xad')][_0x0275('0x120')](db[_0x0275('0xae')],{'as':_0x0275('0x1ca'),'onDelete':_0x0275('0x11e'),'foreignKey':'SubjectId'});db[_0x0275('0xad')]['hasMany'](db[_0x0275('0xae')],{'as':_0x0275('0x1cb'),'onDelete':_0x0275('0x11e'),'foreignKey':'DescriptionId'});db[_0x0275('0xad')][_0x0275('0x120')](db['SugarcrmField'],{'as':_0x0275('0x1c1'),'onDelete':_0x0275('0x11e'),'foreignKey':_0x0275('0x1c6')});db[_0x0275('0xad')][_0x0275('0x12e')](db[_0x0275('0xab')],{'as':_0x0275('0x177'),'foreignKey':_0x0275('0x1c4')});db[_0x0275('0xae')]['hasMany'](db[_0x0275('0xae')],{'as':'Subject','foreignKey':_0x0275('0x1c8')});db['SugarcrmField'][_0x0275('0x120')](db[_0x0275('0xae')],{'as':'Description','foreignKey':'DescriptionId'});db['SugarcrmField'][_0x0275('0x120')](db['SugarcrmField'],{'as':_0x0275('0x1c9'),'foreignKey':'FieldId'});db[_0x0275('0xae')][_0x0275('0x12e')](db[_0x0275('0x1cc')],{'as':_0x0275('0x1cc'),'foreignKey':_0x0275('0x1cd')});db[_0x0275('0xb0')][_0x0275('0x120')](db[_0x0275('0xb2')],{'as':'Configurations','onDelete':_0x0275('0x11e'),'foreignKey':_0x0275('0x1c4')});db[_0x0275('0xb2')][_0x0275('0x120')](db[_0x0275('0xb4')],{'as':'Subjects','onDelete':_0x0275('0x11e'),'foreignKey':'SubjectId'});db[_0x0275('0xb2')][_0x0275('0x120')](db['DeskField'],{'as':_0x0275('0x1cb'),'onDelete':'cascade','foreignKey':'DescriptionId'});db[_0x0275('0xb2')][_0x0275('0x120')](db[_0x0275('0xb4')],{'as':_0x0275('0x1c1'),'onDelete':_0x0275('0x11e'),'foreignKey':'FieldId'});db[_0x0275('0xb2')][_0x0275('0x12e')](db[_0x0275('0xb0')],{'as':_0x0275('0x177'),'foreignKey':_0x0275('0x1c4')});db[_0x0275('0xb2')][_0x0275('0x132')](db['Tag'],{'through':'int_desk_configuration_has_tags'});db[_0x0275('0xb4')][_0x0275('0x120')](db[_0x0275('0xb4')],{'as':_0x0275('0x1c7'),'foreignKey':_0x0275('0x1c8')});db[_0x0275('0xb4')]['hasMany'](db[_0x0275('0xb4')],{'as':_0x0275('0x1ce'),'foreignKey':_0x0275('0x1c5')});db[_0x0275('0xb4')][_0x0275('0x120')](db['DeskField'],{'as':_0x0275('0x1c9'),'foreignKey':_0x0275('0x1c6')});db[_0x0275('0xb4')][_0x0275('0x12e')](db['Variable'],{'as':'Variable','foreignKey':_0x0275('0x1cd')});db[_0x0275('0xb6')][_0x0275('0x120')](db[_0x0275('0xb7')],{'as':'Configurations','onDelete':_0x0275('0x11e'),'foreignKey':_0x0275('0x1c4')});db[_0x0275('0xb7')][_0x0275('0x120')](db[_0x0275('0xb9')],{'as':_0x0275('0x1ca'),'onDelete':_0x0275('0x11e'),'foreignKey':_0x0275('0x1c8')});db[_0x0275('0xb7')][_0x0275('0x120')](db[_0x0275('0xb9')],{'as':_0x0275('0x1cb'),'onDelete':_0x0275('0x11e'),'foreignKey':_0x0275('0x1c5')});db[_0x0275('0xb7')][_0x0275('0x120')](db[_0x0275('0xb9')],{'as':_0x0275('0x1c1'),'onDelete':_0x0275('0x11e'),'foreignKey':_0x0275('0x1c6')});db[_0x0275('0xb7')][_0x0275('0x12e')](db[_0x0275('0xb6')],{'as':'Account','foreignKey':_0x0275('0x1c4')});db[_0x0275('0xb9')][_0x0275('0x120')](db[_0x0275('0xb9')],{'as':_0x0275('0x1c7'),'foreignKey':_0x0275('0x1c8')});db['ZohoField'][_0x0275('0x120')](db[_0x0275('0xb9')],{'as':_0x0275('0x1ce'),'foreignKey':_0x0275('0x1c5')});db['ZohoField'][_0x0275('0x120')](db[_0x0275('0xb9')],{'as':_0x0275('0x1c9'),'foreignKey':'FieldId'});db[_0x0275('0xb9')]['belongsTo'](db[_0x0275('0x1cc')],{'as':_0x0275('0x1cc'),'foreignKey':_0x0275('0x1cd')});db[_0x0275('0xbb')]['hasMany'](db[_0x0275('0xbd')],{'as':_0x0275('0x1c3'),'onDelete':_0x0275('0x11e'),'foreignKey':_0x0275('0x1c4')});db[_0x0275('0xbd')][_0x0275('0x120')](db[_0x0275('0x1cf')],{'as':'Subjects','foreignKey':'SubjectId'});db[_0x0275('0xbd')][_0x0275('0x120')](db['ZendeskField'],{'as':'Descriptions','foreignKey':_0x0275('0x1c5')});db[_0x0275('0xbd')]['hasMany'](db[_0x0275('0x1cf')],{'as':_0x0275('0x1c1'),'foreignKey':_0x0275('0x1c6')});db[_0x0275('0xbd')][_0x0275('0x12e')](db[_0x0275('0xbb')],{'as':'Account','foreignKey':_0x0275('0x1c4')});db[_0x0275('0xbd')][_0x0275('0x132')](db[_0x0275('0x179')],{'through':'int_zendesk_configuration_has_tags'});db[_0x0275('0x1cf')][_0x0275('0x120')](db['ZendeskField'],{'as':_0x0275('0x1c7'),'foreignKey':_0x0275('0x1c8')});db[_0x0275('0x1cf')][_0x0275('0x120')](db['ZendeskField'],{'as':_0x0275('0x1ce'),'foreignKey':_0x0275('0x1c5')});db[_0x0275('0x1cf')]['hasMany'](db['ZendeskField'],{'as':_0x0275('0x1c9'),'foreignKey':_0x0275('0x1c6')});db[_0x0275('0x1cf')][_0x0275('0x12e')](db[_0x0275('0x1cc')],{'as':_0x0275('0x1cc'),'foreignKey':_0x0275('0x1cd')});db[_0x0275('0xbf')][_0x0275('0x120')](db[_0x0275('0xc1')],{'as':'Configurations','onDelete':_0x0275('0x11e'),'foreignKey':_0x0275('0x1c4')});db[_0x0275('0xc1')][_0x0275('0x120')](db[_0x0275('0xc2')],{'as':_0x0275('0x1ca'),'onDelete':_0x0275('0x11e'),'foreignKey':_0x0275('0x1c8')});db[_0x0275('0xc1')]['hasMany'](db[_0x0275('0xc2')],{'as':'Descriptions','onDelete':'cascade','foreignKey':_0x0275('0x1c5')});db['FreshdeskConfiguration'][_0x0275('0x120')](db[_0x0275('0xc2')],{'as':_0x0275('0x1c1'),'onDelete':'cascade','foreignKey':_0x0275('0x1c6')});db[_0x0275('0xc1')][_0x0275('0x12e')](db['FreshdeskAccount'],{'as':_0x0275('0x177'),'foreignKey':_0x0275('0x1c4')});db['FreshdeskConfiguration'][_0x0275('0x132')](db[_0x0275('0x179')],{'through':_0x0275('0x1d0')});db[_0x0275('0xc2')][_0x0275('0x120')](db[_0x0275('0xc2')],{'as':'Subject','foreignKey':'SubjectId'});db[_0x0275('0xc2')][_0x0275('0x120')](db['FreshdeskField'],{'as':_0x0275('0x1ce'),'foreignKey':_0x0275('0x1c5')});db['FreshdeskField'][_0x0275('0x120')](db[_0x0275('0xc2')],{'as':_0x0275('0x1c9'),'foreignKey':_0x0275('0x1c6')});db[_0x0275('0xc2')][_0x0275('0x12e')](db[_0x0275('0x1cc')],{'as':_0x0275('0x1cc'),'foreignKey':'VariableId'});db['VtigerAccount'][_0x0275('0x120')](db['VtigerConfiguration'],{'as':_0x0275('0x1c3'),'onDelete':'cascade','foreignKey':_0x0275('0x1c4')});db[_0x0275('0xc5')][_0x0275('0x120')](db[_0x0275('0xc7')],{'as':'Subjects','foreignKey':'SubjectId'});db[_0x0275('0xc5')][_0x0275('0x120')](db[_0x0275('0xc7')],{'as':_0x0275('0x1cb'),'foreignKey':'DescriptionId'});db[_0x0275('0xc5')][_0x0275('0x120')](db[_0x0275('0xc7')],{'as':'Fields','foreignKey':_0x0275('0x1c6')});db['VtigerConfiguration']['belongsTo'](db[_0x0275('0xc3')],{'as':'Account','foreignKey':'AccountId'});db[_0x0275('0xc7')]['hasMany'](db['VtigerField'],{'as':'Subject','foreignKey':_0x0275('0x1c8')});db['VtigerField'][_0x0275('0x120')](db[_0x0275('0xc7')],{'as':_0x0275('0x1ce'),'foreignKey':_0x0275('0x1c5')});db[_0x0275('0xc7')]['hasMany'](db[_0x0275('0xc7')],{'as':_0x0275('0x1c9'),'foreignKey':_0x0275('0x1c6')});db[_0x0275('0xc7')][_0x0275('0x12e')](db[_0x0275('0x1cc')],{'as':_0x0275('0x1cc'),'foreignKey':_0x0275('0x1cd')});db['ServicenowAccount'][_0x0275('0x120')](db[_0x0275('0xcb')],{'as':_0x0275('0x1c3'),'onDelete':'cascade','foreignKey':'AccountId'});db[_0x0275('0xcb')][_0x0275('0x120')](db[_0x0275('0xcd')],{'as':_0x0275('0x1ca'),'foreignKey':_0x0275('0x1c8')});db['ServicenowConfiguration'][_0x0275('0x120')](db[_0x0275('0xcd')],{'as':_0x0275('0x1cb'),'foreignKey':_0x0275('0x1c5')});db[_0x0275('0xcb')]['hasMany'](db[_0x0275('0xcd')],{'as':_0x0275('0x1c1'),'foreignKey':_0x0275('0x1c6')});db[_0x0275('0xcb')]['belongsTo'](db[_0x0275('0xc9')],{'as':_0x0275('0x177'),'foreignKey':_0x0275('0x1c4')});db[_0x0275('0xcd')][_0x0275('0x120')](db[_0x0275('0xcd')],{'as':_0x0275('0x1c7'),'foreignKey':'SubjectId'});db['ServicenowField'][_0x0275('0x120')](db[_0x0275('0xcd')],{'as':_0x0275('0x1ce'),'foreignKey':_0x0275('0x1c5')});db[_0x0275('0xcd')][_0x0275('0x120')](db[_0x0275('0xcd')],{'as':_0x0275('0x1c9'),'foreignKey':_0x0275('0x1c6')});db[_0x0275('0xcd')][_0x0275('0x12e')](db[_0x0275('0x1cc')],{'as':_0x0275('0x1cc'),'foreignKey':'VariableId'});db['Dynamics365Account'][_0x0275('0x120')](db[_0x0275('0xd0')],{'as':_0x0275('0x1c3'),'onDelete':_0x0275('0x11e'),'foreignKey':_0x0275('0x1c4')});db[_0x0275('0xd0')][_0x0275('0x120')](db[_0x0275('0xd2')],{'as':'Subjects','onDelete':_0x0275('0x11e'),'foreignKey':_0x0275('0x1c8')});db[_0x0275('0xd0')]['hasMany'](db[_0x0275('0xd2')],{'as':_0x0275('0x1cb'),'onDelete':'cascade','foreignKey':'DescriptionId'});db[_0x0275('0xd0')][_0x0275('0x120')](db[_0x0275('0xd2')],{'as':'Fields','onDelete':_0x0275('0x11e'),'foreignKey':_0x0275('0x1c6')});db['Dynamics365Configuration'][_0x0275('0x12e')](db[_0x0275('0xcf')],{'as':'Account','foreignKey':_0x0275('0x1c4')});db[_0x0275('0xd2')][_0x0275('0x120')](db[_0x0275('0xd2')],{'as':_0x0275('0x1c7'),'foreignKey':_0x0275('0x1c8')});db[_0x0275('0xd2')][_0x0275('0x120')](db[_0x0275('0xd2')],{'as':_0x0275('0x1ce'),'foreignKey':'DescriptionId'});db[_0x0275('0xd2')][_0x0275('0x120')](db['Dynamics365Field'],{'as':'Field','foreignKey':_0x0275('0x1c6')});db['Dynamics365Field'][_0x0275('0x12e')](db[_0x0275('0x1cc')],{'as':'Variable','foreignKey':'VariableId'});db['FreshsalesAccount'][_0x0275('0x120')](db[_0x0275('0x1d1')],{'as':'Configurations','onDelete':_0x0275('0x11e'),'foreignKey':_0x0275('0x1c4')});db[_0x0275('0x1d1')][_0x0275('0x120')](db['FreshsalesField'],{'as':_0x0275('0x1ca'),'foreignKey':_0x0275('0x1c8')});db[_0x0275('0x1d1')][_0x0275('0x120')](db[_0x0275('0xd6')],{'as':_0x0275('0x1cb'),'foreignKey':_0x0275('0x1c5')});db[_0x0275('0x1d1')][_0x0275('0x120')](db[_0x0275('0xd6')],{'as':_0x0275('0x1c1'),'foreignKey':'FieldId'});db[_0x0275('0x1d1')][_0x0275('0x12e')](db[_0x0275('0xd3')],{'as':'Account','foreignKey':_0x0275('0x1c4')});db[_0x0275('0xd6')][_0x0275('0x120')](db['FreshsalesField'],{'as':_0x0275('0x1c7'),'foreignKey':'SubjectId'});db['FreshsalesField'][_0x0275('0x120')](db['FreshsalesField'],{'as':_0x0275('0x1ce'),'foreignKey':_0x0275('0x1c5')});db[_0x0275('0xd6')][_0x0275('0x120')](db[_0x0275('0xd6')],{'as':_0x0275('0x1c9'),'foreignKey':'FieldId'});db[_0x0275('0xd6')]['belongsTo'](db[_0x0275('0x1cc')],{'as':_0x0275('0x1cc'),'foreignKey':_0x0275('0x1cd')});db[_0x0275('0xda')][_0x0275('0x12e')](db[_0x0275('0x68')],{});db['ChatQueueReport']['belongsTo'](db['CmList'],{'as':_0x0275('0x183'),'foreignKey':_0x0275('0x172')});db['ChatQueueReport'][_0x0275('0x12e')](db[_0x0275('0x78')],{'as':'Contact','foreignKey':_0x0275('0x16a')});db['ChatQueueReport'][_0x0275('0x12e')](db[_0x0275('0x6d')],{});db[_0x0275('0xda')][_0x0275('0x12e')](db[_0x0275('0x6e')],{});db[_0x0275('0xda')][_0x0275('0x12e')](db[_0x0275('0x11c')],{});db[_0x0275('0xda')]['belongsTo'](db['ChatQueue'],{});db[_0x0275('0x1a1')][_0x0275('0x12e')](db[_0x0275('0x11c')],{'onDelete':_0x0275('0x11e'),'foreignKey':_0x0275('0x1d2')});db[_0x0275('0x1a1')][_0x0275('0x12e')](db[_0x0275('0x11c')],{'onDelete':_0x0275('0x11e'),'foreignKey':'ToId'});db[_0x0275('0xe1')]['hasMany'](db[_0x0275('0xdf')],{'foreignKey':_0x0275('0x1d3'),'onDelete':'cascade'});db['JscriptySessionReport'][_0x0275('0x120')](db[_0x0275('0xdd')],{'foreignKey':'SessionId','onDelete':'cascade'});db[_0x0275('0x1d4')][_0x0275('0x12e')](db[_0x0275('0x57')],{});db[_0x0275('0x1d4')]['belongsTo'](db[_0x0275('0x104')],{'as':_0x0275('0x183'),'foreignKey':_0x0275('0x172')});db[_0x0275('0x1d4')]['belongsTo'](db[_0x0275('0x78')],{'as':_0x0275('0x17e'),'foreignKey':_0x0275('0x16a')});db[_0x0275('0x1d4')][_0x0275('0x12e')](db[_0x0275('0x5b')],{});db[_0x0275('0x1d4')][_0x0275('0x12e')](db[_0x0275('0x5d')],{});db['SmsQueueReport'][_0x0275('0x12e')](db[_0x0275('0x11c')],{});db[_0x0275('0x1d4')][_0x0275('0x12e')](db['SmsQueue'],{});db['JscriptyProject'][_0x0275('0x120')](db[_0x0275('0xe1')],{'foreignKey':_0x0275('0x1d5')});db[_0x0275('0x1d6')][_0x0275('0x120')](db[_0x0275('0xdf')],{'foreignKey':_0x0275('0x1d5')});db[_0x0275('0x1d6')]['hasMany'](db[_0x0275('0xdd')],{'foreignKey':'ProjectId'});db[_0x0275('0xeb')][_0x0275('0x132')](db[_0x0275('0x11c')],{'as':'Users','through':_0x0275('0x14e')});db[_0x0275('0xf0')][_0x0275('0x132')](db[_0x0275('0x11c')],{'as':'Agents','through':_0x0275('0x136')});db[_0x0275('0xf0')][_0x0275('0x132')](db[_0x0275('0x19')],{'through':_0x0275('0x11a'),'as':_0x0275('0x13d')});db['Team']['belongsToMany'](db[_0x0275('0x3f')],{'through':_0x0275('0x175'),'as':_0x0275('0x13e')});db['Team'][_0x0275('0x132')](db['ChatQueue'],{'through':_0x0275('0x1d7'),'as':_0x0275('0x13f')});db['Team'][_0x0275('0x132')](db[_0x0275('0x53')],{'through':_0x0275('0x18c'),'as':_0x0275('0x141')});db[_0x0275('0xf0')][_0x0275('0x132')](db[_0x0275('0x5f')],{'through':_0x0275('0x1d8'),'as':_0x0275('0x1d9')});db[_0x0275('0xf0')]['belongsToMany'](db[_0x0275('0x66')],{'through':'team_has_openchannel_queues','as':_0x0275('0x1da')});db[_0x0275('0xf0')][_0x0275('0x132')](db[_0x0275('0x116')],{'through':_0x0275('0x1db'),'as':_0x0275('0x1dc')});db[_0x0275('0xf0')][_0x0275('0x132')](db[_0x0275('0x105')],{'through':'TeamVoicePrefix','as':_0x0275('0x1dd')});db['Campaign'][_0x0275('0x120')](db[_0x0275('0x7a')],{'as':_0x0275('0x156'),'foreignKey':_0x0275('0x1a7')});db[_0x0275('0xf4')][_0x0275('0x120')](db['CmHopperFinal'],{'as':_0x0275('0x123'),'foreignKey':_0x0275('0x1a7')});db[_0x0275('0xf4')][_0x0275('0x120')](db[_0x0275('0x124')],{'as':_0x0275('0x157'),'foreignKey':'CampaignId'});db[_0x0275('0xf4')][_0x0275('0x120')](db[_0x0275('0x7c')],{'as':_0x0275('0x1de'),'foreignKey':_0x0275('0x1a7')});db[_0x0275('0xf4')]['belongsTo'](db[_0x0275('0x159')],{'as':_0x0275('0x159'),'foreignKey':'TrunkId'});db[_0x0275('0xf4')][_0x0275('0x12e')](db[_0x0275('0x159')],{'as':_0x0275('0x15b'),'foreignKey':_0x0275('0x15c')});db['Campaign'][_0x0275('0x12e')](db[_0x0275('0x15d')],{'as':'Interval','foreignKey':_0x0275('0x18f')});db[_0x0275('0xf4')][_0x0275('0x12e')](db['SquareProject'],{'as':_0x0275('0xeb'),'foreignKey':_0x0275('0x1df')});db[_0x0275('0xf4')][_0x0275('0x132')](db[_0x0275('0x104')],{'as':_0x0275('0x134'),'through':'campaigns_has_cm_lists'});db['Campaign']['belongsToMany'](db[_0x0275('0x104')],{'as':_0x0275('0x162'),'through':_0x0275('0x1e0')});db[_0x0275('0xf8')][_0x0275('0x12e')](db[_0x0275('0x70')],{'as':'ChatOfflineMessage','foreignKey':_0x0275('0x180')});db[_0x0275('0xfc')]['belongsTo'](db['MailMessage'],{});db[_0x0275('0xfc')][_0x0275('0x12e')](db[_0x0275('0x42')],{});db['MailTransferReport'][_0x0275('0x12e')](db[_0x0275('0x3d')],{'foreignKey':_0x0275('0x1e1'),'as':_0x0275('0x1e2')});db['MailTransferReport'][_0x0275('0x12e')](db[_0x0275('0x11c')],{'foreignKey':'FromUserId','as':_0x0275('0x1e3')});db[_0x0275('0xfc')][_0x0275('0x12e')](db[_0x0275('0x11c')],{'foreignKey':_0x0275('0x1e4'),'as':_0x0275('0x1e5')});db[_0x0275('0xfc')][_0x0275('0x12e')](db[_0x0275('0x3f')],{'foreignKey':_0x0275('0x1e6'),'as':_0x0275('0x1e7')});db[_0x0275('0xfc')][_0x0275('0x12e')](db[_0x0275('0x3d')],{'foreignKey':_0x0275('0x1e8'),'as':_0x0275('0x1e9')});db[_0x0275('0xfe')][_0x0275('0x12e')](db[_0x0275('0x6e')],{});db['ChatTransferReport'][_0x0275('0x12e')](db[_0x0275('0x6d')],{});db['ChatTransferReport'][_0x0275('0x12e')](db[_0x0275('0x68')],{'foreignKey':_0x0275('0x1ea'),'as':_0x0275('0x1e2')});db[_0x0275('0xfe')][_0x0275('0x12e')](db[_0x0275('0x11c')],{'foreignKey':_0x0275('0x1eb'),'as':_0x0275('0x1e3')});db[_0x0275('0xfe')][_0x0275('0x12e')](db[_0x0275('0x11c')],{'foreignKey':'ToUserId','as':_0x0275('0x1e5')});db[_0x0275('0xfe')][_0x0275('0x12e')](db[_0x0275('0x72')],{'foreignKey':_0x0275('0x1ec'),'as':_0x0275('0x1e7')});db[_0x0275('0xfe')][_0x0275('0x12e')](db['ChatWebsite'],{'foreignKey':_0x0275('0x1ed'),'as':_0x0275('0x1e9')});db[_0x0275('0xff')][_0x0275('0x12e')](db[_0x0275('0x51')],{});db[_0x0275('0xff')]['belongsTo'](db[_0x0275('0x4f')],{});db[_0x0275('0xff')]['belongsTo'](db[_0x0275('0x4c')],{'foreignKey':_0x0275('0x1ee'),'as':_0x0275('0x1e2')});db[_0x0275('0xff')][_0x0275('0x12e')](db[_0x0275('0x11c')],{'foreignKey':_0x0275('0x1eb'),'as':_0x0275('0x1e3')});db[_0x0275('0xff')]['belongsTo'](db[_0x0275('0x11c')],{'foreignKey':_0x0275('0x1e4'),'as':_0x0275('0x1e5')});db[_0x0275('0xff')][_0x0275('0x12e')](db[_0x0275('0x53')],{'foreignKey':_0x0275('0x1ef'),'as':_0x0275('0x1e7')});db['FaxTransferReport'][_0x0275('0x12e')](db[_0x0275('0x4c')],{'foreignKey':_0x0275('0x1f0'),'as':_0x0275('0x1e9')});db[_0x0275('0x100')][_0x0275('0x12e')](db[_0x0275('0x64')],{});db['OpenchannelTransferReport'][_0x0275('0x12e')](db['OpenchannelInteraction'],{});db[_0x0275('0x100')]['belongsTo'](db[_0x0275('0x193')],{'foreignKey':_0x0275('0x1f1'),'as':'FromAccount'});db[_0x0275('0x100')]['belongsTo'](db[_0x0275('0x11c')],{'foreignKey':_0x0275('0x1eb'),'as':_0x0275('0x1e3')});db[_0x0275('0x100')]['belongsTo'](db[_0x0275('0x11c')],{'foreignKey':_0x0275('0x1e4'),'as':_0x0275('0x1e5')});db[_0x0275('0x100')][_0x0275('0x12e')](db[_0x0275('0x66')],{'foreignKey':'ToOpenchannelQueueId','as':_0x0275('0x1e7')});db[_0x0275('0x100')]['belongsTo'](db[_0x0275('0x193')],{'foreignKey':_0x0275('0x1f2'),'as':_0x0275('0x1e9')});db[_0x0275('0x102')]['belongsTo'](db[_0x0275('0x5d')],{});db['SmsTransferReport'][_0x0275('0x12e')](db[_0x0275('0x5b')],{});db[_0x0275('0x102')][_0x0275('0x12e')](db[_0x0275('0x57')],{'foreignKey':'FromSmsAccountId','as':_0x0275('0x1e2')});db[_0x0275('0x102')][_0x0275('0x12e')](db[_0x0275('0x11c')],{'foreignKey':_0x0275('0x1eb'),'as':_0x0275('0x1e3')});db[_0x0275('0x102')][_0x0275('0x12e')](db[_0x0275('0x11c')],{'foreignKey':_0x0275('0x1e4'),'as':'ToAgent'});db[_0x0275('0x102')][_0x0275('0x12e')](db[_0x0275('0x5f')],{'foreignKey':_0x0275('0x1f3'),'as':_0x0275('0x1e7')});db[_0x0275('0x102')][_0x0275('0x12e')](db[_0x0275('0x57')],{'foreignKey':_0x0275('0x1f4'),'as':_0x0275('0x1e9')});db[_0x0275('0x104')][_0x0275('0x120')](db[_0x0275('0x86')],{'as':'Dispositions','foreignKey':_0x0275('0x172'),'onDelete':_0x0275('0x11e')});db[_0x0275('0x104')]['hasMany'](db[_0x0275('0x82')],{'as':_0x0275('0x1f5'),'foreignKey':'ListId'});db['CmList'][_0x0275('0x120')](db['CmContact'],{'as':_0x0275('0x133'),'onDelete':_0x0275('0x11e'),'foreignKey':'ListId'});db[_0x0275('0x104')][_0x0275('0x120')](db[_0x0275('0x7e')],{'as':_0x0275('0x123'),'foreignKey':_0x0275('0x172')});db[_0x0275('0x104')][_0x0275('0x120')](db[_0x0275('0x124')],{'as':'HopperHistory','foreignKey':_0x0275('0x172')});db[_0x0275('0x104')]['hasMany'](db[_0x0275('0x81')],{'as':_0x0275('0x81'),'foreignKey':_0x0275('0x172')});db[_0x0275('0x104')][_0x0275('0x132')](db[_0x0275('0x19')],{'as':'Queues','through':_0x0275('0x15f')});db[_0x0275('0x104')][_0x0275('0x132')](db[_0x0275('0x11c')],{'as':_0x0275('0x160'),'through':'cm_user_has_lists'});db[_0x0275('0x105')][_0x0275('0x120')](db[_0x0275('0x15')],{'as':_0x0275('0x122'),'onDelete':_0x0275('0x11e')});db[_0x0275('0x105')]['belongsToMany'](db['User'],{'as':_0x0275('0x160'),'through':_0x0275('0x11b')});db[_0x0275('0x105')][_0x0275('0x132')](db[_0x0275('0xf0')],{'through':_0x0275('0x1f6'),'as':_0x0275('0x161')});db[_0x0275('0x107')][_0x0275('0x120')](db[_0x0275('0x11c')],{'as':'Users','foreignKey':_0x0275('0x12f')});db['UserProfile']['hasMany'](db[_0x0275('0x109')],{'as':'UserProfileSections','foreignKey':_0x0275('0x12f'),'onDelete':'cascade'});db[_0x0275('0x109')][_0x0275('0x120')](db[_0x0275('0x10b')],{'as':'Resources','foreignKey':_0x0275('0x1f7'),'onDelete':_0x0275('0x11e')});db[_0x0275('0x10d')][_0x0275('0x120')](db[_0x0275('0x86')],{'as':_0x0275('0x16f'),'foreignKey':'WhatsappAccountId','onDelete':_0x0275('0x11e')});db['WhatsappAccount'][_0x0275('0x120')](db[_0x0275('0x85')],{'as':_0x0275('0x18e'),'foreignKey':'WhatsappAccountId'});db[_0x0275('0x10d')][_0x0275('0x120')](db[_0x0275('0x111')],{'as':'Messages','foreignKey':_0x0275('0x1f8')});db[_0x0275('0x10d')][_0x0275('0x120')](db[_0x0275('0x12a')],{'as':'Interactions'});db['WhatsappAccount'][_0x0275('0x120')](db[_0x0275('0x10f')],{'as':'Applications'});db[_0x0275('0x10d')][_0x0275('0x12e')](db[_0x0275('0x104')],{'as':'List','foreignKey':_0x0275('0x172')});db['WhatsappAccount'][_0x0275('0x12e')](db['Pause'],{'as':_0x0275('0x174'),'foreignKey':'mandatoryDispositionPauseId'});db[_0x0275('0x10d')]['belongsToMany'](db[_0x0275('0x11c')],{'as':_0x0275('0x160'),'through':'user_has_whatsapp_accounts'});db[_0x0275('0x10f')][_0x0275('0x12e')](db[_0x0275('0x11c')],{'onDelete':_0x0275('0x181')});db[_0x0275('0x10f')][_0x0275('0x12e')](db[_0x0275('0x116')],{'onDelete':'restrict'});db[_0x0275('0x10f')][_0x0275('0x12e')](db['WhatsappAccount'],{'onDelete':_0x0275('0x181')});db['WhatsappApplication'][_0x0275('0x12e')](db[_0x0275('0x15d')],{'onDelete':'restrict','foreignKey':'IntervalId'});db[_0x0275('0x10f')][_0x0275('0x12e')](db[_0x0275('0x179')],{'onDelete':_0x0275('0x181'),'foreignKey':'TagId'});db['WhatsappInteraction'][_0x0275('0x120')](db['WhatsappMessage'],{'as':'Messages','onDelete':'cascade','foreignKey':'WhatsappInteractionId'});db[_0x0275('0x12a')][_0x0275('0x12e')](db[_0x0275('0x10d')],{'as':_0x0275('0x177'),'foreignKey':_0x0275('0x1f8')});db[_0x0275('0x12a')][_0x0275('0x12e')](db[_0x0275('0x78')],{'as':_0x0275('0x17e'),'foreignKey':_0x0275('0x16a')});db['WhatsappInteraction'][_0x0275('0x12e')](db[_0x0275('0x11c')],{'as':_0x0275('0x178'),'foreignKey':'UserId'});db['WhatsappInteraction'][_0x0275('0x132')](db[_0x0275('0x179')],{'through':_0x0275('0x1b7'),'as':_0x0275('0x17b')});db[_0x0275('0x12a')][_0x0275('0x132')](db['Tag'],{'through':_0x0275('0x1b7'),'as':_0x0275('0x189')});db[_0x0275('0x12a')][_0x0275('0x132')](db[_0x0275('0x11c')],{'as':'Users','through':_0x0275('0x13c'),'foreignKey':_0x0275('0x1f9')});db[_0x0275('0x111')][_0x0275('0x12e')](db['User'],{'as':_0x0275('0x11c')});db[_0x0275('0x111')][_0x0275('0x12e')](db[_0x0275('0x78')],{'onDelete':_0x0275('0x11e'),'as':_0x0275('0x17e')});db['WhatsappMessage']['belongsTo'](db[_0x0275('0x12a')],{'onDelete':'cascade','as':_0x0275('0x17f'),'foreignKey':_0x0275('0x1f9')});db['WhatsappMessage']['belongsTo'](db[_0x0275('0x10d')],{'as':'Account','foreignKey':_0x0275('0x1f8')});db[_0x0275('0x113')]['belongsTo'](db[_0x0275('0x10d')],{});db[_0x0275('0x113')]['belongsTo'](db[_0x0275('0x104')],{'as':_0x0275('0x183'),'foreignKey':_0x0275('0x172')});db[_0x0275('0x113')][_0x0275('0x12e')](db[_0x0275('0x78')],{'as':_0x0275('0x17e'),'foreignKey':'ContactId'});db[_0x0275('0x113')][_0x0275('0x12e')](db['WhatsappInteraction'],{});db['WhatsappQueueReport'][_0x0275('0x12e')](db[_0x0275('0x116')],{});db['WhatsappQueueReport'][_0x0275('0x12e')](db[_0x0275('0x111')],{});db[_0x0275('0x113')][_0x0275('0x12e')](db['User'],{});db['WhatsappTransferReport'][_0x0275('0x12e')](db[_0x0275('0x111')],{});db[_0x0275('0x115')][_0x0275('0x12e')](db[_0x0275('0x12a')],{});db[_0x0275('0x115')]['belongsTo'](db[_0x0275('0x10d')],{'foreignKey':_0x0275('0x1fa'),'as':_0x0275('0x1e2')});db[_0x0275('0x115')][_0x0275('0x12e')](db['WhatsappAccount'],{'foreignKey':_0x0275('0x1fb'),'as':_0x0275('0x1e9')});db['WhatsappTransferReport']['belongsTo'](db['WhatsappQueue'],{'foreignKey':'ToQueueId','as':'ToQueue'});db[_0x0275('0x115')][_0x0275('0x12e')](db[_0x0275('0x11c')],{'foreignKey':'FromUserId','as':_0x0275('0x1e3')});db[_0x0275('0x115')][_0x0275('0x12e')](db['User'],{'foreignKey':_0x0275('0x1e4'),'as':'ToAgent'});db[_0x0275('0x116')][_0x0275('0x132')](db[_0x0275('0x11c')],{'as':_0x0275('0x160'),'through':_0x0275('0x38'),'foreignKey':_0x0275('0x1fc')});db['WhatsappQueue']['belongsToMany'](db[_0x0275('0xf0')],{'through':'team_has_whatsapp_queues','as':_0x0275('0x161')});module[_0x0275('0x1fd')]={'db':db,'dbH':dbH}; \ No newline at end of file diff --git a/server/routes.js b/server/routes.js index 64605d4..2771b96 100644 --- a/server/routes.js +++ b/server/routes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x33e7=['./api/intServicenowField','./api/intDynamics365Account','./api/intDynamics365Field','/api/integrations/freshsales/accounts','/api/integrations/freshsales/configurations','./api/intFreshsalesConfiguration','./api/intFreshsalesField','/api/networks','./api/network','/api/chat/reports/queue','/api/chat/internal/messages','./api/chatInternalMessage','/api/jscripty/answers/reports','./api/jscriptyAnswerReport','/api/jscripty/questions/reports','./api/jscriptyQuestionReport','/api/jscripty/sessions/reports','/api/sms/reports/queue','./api/squareReport','/api/square/details/reports','./api/jscriptyProject','./api/setting','./api/squareOdbc','/api/square/projects','./api/squareProject','/api/square/recordings','./api/squareMessage','/api/teams','./api/team','/api/license','./api/license','./api/campaign','/api/migrations','./api/migration','/api/attachments','./api/attachment','/api/plugins','./api/plugin','/api/mail/reports/transfer','./api/mailTransferReport','/api/chat/reports/transfer','./api/chatTransferReport','/api/fax/reports/transfer','/api/openchannel/reports/transfer','./api/openchannelTransferReport','./api/smsTransferReport','/api/cm/lists','/api/voice/prefixes','./api/userProfile','./api/userProfileSection','./api/userProfileResource','/api/userNotifications','./api/userNotification','/api/whatsapp/accounts','./api/whatsappAccount','/api/whatsapp/applications','./api/whatsappApplication','./api/whatsappInteraction','/api/whatsapp/messages','./api/whatsappMessage','/api/whatsapp/reports/queue','./api/whatsappTransferReport','/api/whatsapp/queues','./api/cloudProvider','/api/realtime','/api/auth/local','./api/authLocal','/api/auth/google','/api/jira','./api/jira','/api/version','/api/system','./api/system','/api/pm2','./api/pm2','/api/webbar','./api/webbar','/apidoc','static','join','root','/www','/demo','snippet','3.0.0','/plugins','route','/:url(api|auth|components|app|bower_components|assets)/*','get','sendFile','appPath','/index.html','username','password','newPassword','apiKey','firstName','lastName','street','mobile','email','clientSecret','securityToken','code','tenantId','token','channelSecret','accessToken','accessTokenSecret','authToken','consumerKey','consumerSecret','membername','calleridname','exten','vidaooApiKey','clientEmail','accesskeyid','secretaccesskey','key','pass','accountSid','localstationid','dsn','secret','registry','oldPassword','isPlainObject','isArray','isString','replace','}@@','includes','lodash','path','express','express-winston','util','./errors','./config/environment','api','./config/logger','auth','isEmpty','body','\x20body=%s','format','method','x-forwarded-for','headers','connection','remoteAddress','url','statusCode','responseTime','user','name','role','inspect','device','agent_id','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)','other','agent_name','test','use','/api/users','./api/user','./api/voiceChanSpy','/api/voice/contexts','./api/voiceContext','/api/voice/extensions','/api/voice/mohs','./api/voiceMusicOnHold','/api/voice/queues','./api/voiceQueue','./api/voiceRecording','/api/screen/recordings','./api/screenRecording','/api/voice/mails','./api/voiceMail','/api/voice/mails/messages','/api/voice/calls/reports','./api/voiceCallReport','/api/voice/dials/reports','./api/voiceDialReport','/api/voice/agents/reports','./api/voiceAgentReport','./api/voiceQueueReport','./api/memberReport','/api/trunks','./api/trunk','/api/voice/transfers/reports','./api/voiceTransferReport','./api/mailServerOut','./api/mailAccount','/api/mail/queues','./api/mailQueue','/api/mail/substatuses','./api/mailSubstatus','./api/mailInteraction','/api/mail/messages','./api/mailMessage','./api/mailApplication','/api/mail/reports/queue','./api/mailQueueReport','/api/dashboards','/api/dashboards/items','/api/fax/accounts','./api/faxAccount','/api/fax/applications','./api/faxApplication','/api/fax/interactions','./api/faxMessage','/api/fax/queues','./api/faxQueue','/api/fax/reports/queue','/api/sms/accounts','./api/smsAccount','/api/sms/applications','./api/smsApplication','/api/sms/interactions','./api/smsInteraction','/api/sms/messages','./api/smsMessage','/api/sms/queues','./api/smsQueue','./api/openchannelAccount','./api/openchannelApplication','./api/openchannelInteraction','./api/openchannelMessage','./api/openchannelQueue','/api/chat/websites','/api/openchannel/reports/queue','./api/openchannelQueueReport','/api/chat/interactions','./api/chatInteraction','./api/chatMessage','/api/chat/offline_messages','./api/chatOfflineMessage','/api/chat/queues','./api/chatQueue','/api/chat/groups','./api/chatGroup','/api/chat/proactive_actions','/api/cm/companies','/api/cm/contacts','/api/cm/hopper','/api/cm/hopper_black','./api/cmHopperBlack','/api/cm/hopper_final','./api/cmHopperFinal','./api/cmHopperHistory','/api/cm/custom_fields','./api/cmCustomField','./api/action','/api/automations','./api/automation','/api/canned_answers','./api/cannedAnswer','./api/disposition','./api/condition','/api/intervals','./api/interval','/api/pauses','./api/pause','/api/cdr','./api/cdr','/api/voiceQueuesLog','/api/schedules','./api/schedule','./api/sound','./api/template','/api/triggers','./api/trigger','./api/variable','/api/integrations','./api/integration','/api/integrations/reports','./api/integrationReport','./api/analyticCustomReport','./api/analyticDefaultReport','/api/analytics/extracted_reports','./api/analyticMetric','/api/analytics/field_reports','./api/analyticFieldReport','/api/analytics/tree_reports','./api/analyticTreeReport','./api/intSalesforceAccount','/api/integrations/salesforce/configurations','./api/intSalesforceConfiguration','/api/integrations/salesforce/fields','./api/intSalesforceField','/api/integrations/sugarcrm/accounts','./api/intSugarcrmAccount','/api/integrations/sugarcrm/fields','./api/intSugarcrmField','./api/intDeskAccount','/api/integrations/desk/configurations','./api/intDeskConfiguration','/api/integrations/desk/fields','./api/intDeskField','/api/integrations/zoho/accounts','./api/intZohoAccount','/api/integrations/zoho/configurations','./api/intZohoConfiguration','/api/integrations/zoho/fields','./api/intZohoField','/api/integrations/zendesk/accounts','./api/intZendeskAccount','/api/integrations/zendesk/configurations','./api/intZendeskConfiguration','/api/integrations/zendesk/fields','./api/intZendeskField','/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/intVtigerConfiguration','/api/integrations/vtiger/fields','./api/intVtigerField','/api/integrations/servicenow/configurations','/api/integrations/servicenow/fields'];(function(_0x41e4bd,_0x5efd0e){var _0x2b8b03=function(_0x2d423e){while(--_0x2d423e){_0x41e4bd['push'](_0x41e4bd['shift']());}};_0x2b8b03(++_0x5efd0e);}(_0x33e7,0x1cc));var _0x733e=function(_0x55ad30,_0x2ba77e){_0x55ad30=_0x55ad30-0x0;var _0x28676f=_0x33e7[_0x55ad30];return _0x28676f;};'use strict';var _=require(_0x733e('0x0'));var path=require(_0x733e('0x1'));var express=require(_0x733e('0x2'));var ewinston=require(_0x733e('0x3'));var util=require(_0x733e('0x4'));var errors=require(_0x733e('0x5'));var config=require(_0x733e('0x6'));var logger=require('./config/logger')(_0x733e('0x7'));var authLogger=require(_0x733e('0x8'))(_0x733e('0x9'));exports['default']=function(_0x279e98){_0x279e98['use'](ewinston['logger']({'winstonInstance':logger,'meta':![],'statusLevels':!![],'msg':function(_0x4b0dc5,_0xb06f5f){var _0x30c637='%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s';if(!_[_0x733e('0xa')](_0x4b0dc5[_0x733e('0xb')])){_0x30c637+=_0x733e('0xc');var _0x54bd82=_0x4b0dc5['body'];maskSensitiveData(_0x54bd82);}return util[_0x733e('0xd')](_0x30c637,_0x4b0dc5[_0x733e('0xe')],_0x4b0dc5['headers'][_0x733e('0xf')]?_0x4b0dc5[_0x733e('0x10')][_0x733e('0xf')]:_0x4b0dc5[_0x733e('0x11')][_0x733e('0x12')]||_0x4b0dc5['ip'],_0x4b0dc5[_0x733e('0x13')],_0xb06f5f[_0x733e('0x14')],_0xb06f5f[_0x733e('0x15')],_0x4b0dc5['user']?_0x4b0dc5[_0x733e('0x16')]['id']:null,_0x4b0dc5['user']?_0x4b0dc5[_0x733e('0x16')][_0x733e('0x17')]:null,_0x4b0dc5[_0x733e('0x16')]?_0x4b0dc5[_0x733e('0x16')][_0x733e('0x18')]:null,_0x54bd82?util[_0x733e('0x19')](_0x54bd82,![],null):'');}}));_0x279e98['use'](ewinston['logger']({'winstonInstance':authLogger,'meta':![],'statusLevels':!![],'msg':function(_0x3f0936,_0x148cb2){var _0x78661b='%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s';if(_0x3f0936[_0x733e('0xb')]&&_0x3f0936[_0x733e('0xb')][_0x733e('0x1a')]&&_0x3f0936[_0x733e('0xb')][_0x733e('0x1b')]){_0x78661b=_0x733e('0x1c');}return util['format'](_0x78661b,_0x3f0936[_0x733e('0xe')],_0x3f0936[_0x733e('0x10')][_0x733e('0xf')]?_0x3f0936[_0x733e('0x10')][_0x733e('0xf')]:_0x3f0936[_0x733e('0x11')]['remoteAddress']||_0x3f0936['ip'],_0x3f0936['url'],_0x148cb2[_0x733e('0x14')],_0x148cb2['responseTime'],_0x3f0936['user']?_0x3f0936[_0x733e('0x16')]['id']:null,_0x3f0936[_0x733e('0x16')]?_0x3f0936[_0x733e('0x16')][_0x733e('0x17')]:null,_0x3f0936[_0x733e('0x16')]?_0x3f0936[_0x733e('0x16')]['role']:null,_0x3f0936[_0x733e('0xb')]&&_0x3f0936[_0x733e('0xb')][_0x733e('0x1a')]?_0x3f0936[_0x733e('0xb')][_0x733e('0x1a')]:_0x733e('0x1d'),_0x3f0936['body']&&_0x3f0936[_0x733e('0xb')]['agent_id']?_0x3f0936['body'][_0x733e('0x1b')]:'',_0x3f0936['body']&&_0x3f0936['body']['agent_name']?_0x3f0936[_0x733e('0xb')][_0x733e('0x1e')]:'');},'ignoreRoute':function(_0x344451){var _0x248aa4=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x248aa4[_0x733e('0x1f')](_0x344451[_0x733e('0x13')]);}}));_0x279e98[_0x733e('0x20')](_0x733e('0x21'),require(_0x733e('0x22')));_0x279e98[_0x733e('0x20')]('/api/voice/chanspy',require(_0x733e('0x23')));_0x279e98[_0x733e('0x20')](_0x733e('0x24'),require(_0x733e('0x25')));_0x279e98[_0x733e('0x20')](_0x733e('0x26'),require('./api/voiceExtension'));_0x279e98[_0x733e('0x20')](_0x733e('0x27'),require(_0x733e('0x28')));_0x279e98['use'](_0x733e('0x29'),require(_0x733e('0x2a')));_0x279e98[_0x733e('0x20')]('/api/voice/recordings',require(_0x733e('0x2b')));_0x279e98[_0x733e('0x20')](_0x733e('0x2c'),require(_0x733e('0x2d')));_0x279e98[_0x733e('0x20')](_0x733e('0x2e'),require(_0x733e('0x2f')));_0x279e98['use'](_0x733e('0x30'),require('./api/voiceMailMessage'));_0x279e98[_0x733e('0x20')](_0x733e('0x31'),require(_0x733e('0x32')));_0x279e98[_0x733e('0x20')](_0x733e('0x33'),require(_0x733e('0x34')));_0x279e98[_0x733e('0x20')](_0x733e('0x35'),require(_0x733e('0x36')));_0x279e98[_0x733e('0x20')]('/api/voice/queues/reports',require(_0x733e('0x37')));_0x279e98[_0x733e('0x20')]('/api/members/reports',require(_0x733e('0x38')));_0x279e98[_0x733e('0x20')](_0x733e('0x39'),require(_0x733e('0x3a')));_0x279e98[_0x733e('0x20')](_0x733e('0x3b'),require(_0x733e('0x3c')));_0x279e98[_0x733e('0x20')]('/api/mail/out_servers',require(_0x733e('0x3d')));_0x279e98[_0x733e('0x20')]('/api/mail/accounts',require(_0x733e('0x3e')));_0x279e98[_0x733e('0x20')](_0x733e('0x3f'),require(_0x733e('0x40')));_0x279e98['use'](_0x733e('0x41'),require(_0x733e('0x42')));_0x279e98[_0x733e('0x20')]('/api/mail/interactions',require(_0x733e('0x43')));_0x279e98[_0x733e('0x20')](_0x733e('0x44'),require(_0x733e('0x45')));_0x279e98[_0x733e('0x20')]('/api/mail/applications',require(_0x733e('0x46')));_0x279e98[_0x733e('0x20')](_0x733e('0x47'),require(_0x733e('0x48')));_0x279e98['use'](_0x733e('0x49'),require('./api/dashboard'));_0x279e98['use'](_0x733e('0x4a'),require('./api/dashboardItem'));_0x279e98['use'](_0x733e('0x4b'),require(_0x733e('0x4c')));_0x279e98[_0x733e('0x20')](_0x733e('0x4d'),require(_0x733e('0x4e')));_0x279e98[_0x733e('0x20')](_0x733e('0x4f'),require('./api/faxInteraction'));_0x279e98['use']('/api/fax/messages',require(_0x733e('0x50')));_0x279e98[_0x733e('0x20')](_0x733e('0x51'),require(_0x733e('0x52')));_0x279e98[_0x733e('0x20')](_0x733e('0x53'),require('./api/faxQueueReport'));_0x279e98[_0x733e('0x20')](_0x733e('0x54'),require(_0x733e('0x55')));_0x279e98[_0x733e('0x20')](_0x733e('0x56'),require(_0x733e('0x57')));_0x279e98[_0x733e('0x20')](_0x733e('0x58'),require(_0x733e('0x59')));_0x279e98[_0x733e('0x20')](_0x733e('0x5a'),require(_0x733e('0x5b')));_0x279e98[_0x733e('0x20')](_0x733e('0x5c'),require(_0x733e('0x5d')));_0x279e98[_0x733e('0x20')]('/api/openchannel/accounts',require(_0x733e('0x5e')));_0x279e98[_0x733e('0x20')]('/api/openchannel/applications',require(_0x733e('0x5f')));_0x279e98[_0x733e('0x20')]('/api/openchannel/interactions',require(_0x733e('0x60')));_0x279e98[_0x733e('0x20')]('/api/openchannel/messages',require(_0x733e('0x61')));_0x279e98[_0x733e('0x20')]('/api/openchannel/queues',require(_0x733e('0x62')));_0x279e98[_0x733e('0x20')](_0x733e('0x63'),require('./api/chatWebsite'));_0x279e98[_0x733e('0x20')](_0x733e('0x64'),require(_0x733e('0x65')));_0x279e98['use']('/api/chat/applications',require('./api/chatApplication'));_0x279e98[_0x733e('0x20')](_0x733e('0x66'),require(_0x733e('0x67')));_0x279e98[_0x733e('0x20')]('/api/chat/messages',require(_0x733e('0x68')));_0x279e98[_0x733e('0x20')](_0x733e('0x69'),require(_0x733e('0x6a')));_0x279e98[_0x733e('0x20')](_0x733e('0x6b'),require(_0x733e('0x6c')));_0x279e98[_0x733e('0x20')](_0x733e('0x6d'),require(_0x733e('0x6e')));_0x279e98['use'](_0x733e('0x6f'),require('./api/chatProactiveAction'));_0x279e98[_0x733e('0x20')](_0x733e('0x70'),require('./api/cmCompany'));_0x279e98[_0x733e('0x20')](_0x733e('0x71'),require('./api/cmContact'));_0x279e98[_0x733e('0x20')](_0x733e('0x72'),require('./api/cmHopper'));_0x279e98[_0x733e('0x20')](_0x733e('0x73'),require(_0x733e('0x74')));_0x279e98[_0x733e('0x20')](_0x733e('0x75'),require(_0x733e('0x76')));_0x279e98[_0x733e('0x20')]('/api/cm/hopper_history',require(_0x733e('0x77')));_0x279e98[_0x733e('0x20')](_0x733e('0x78'),require(_0x733e('0x79')));_0x279e98[_0x733e('0x20')]('/api/actions',require(_0x733e('0x7a')));_0x279e98[_0x733e('0x20')](_0x733e('0x7b'),require(_0x733e('0x7c')));_0x279e98[_0x733e('0x20')](_0x733e('0x7d'),require(_0x733e('0x7e')));_0x279e98[_0x733e('0x20')]('/api/dispositions',require(_0x733e('0x7f')));_0x279e98['use']('/api/conditions',require(_0x733e('0x80')));_0x279e98[_0x733e('0x20')](_0x733e('0x81'),require(_0x733e('0x82')));_0x279e98[_0x733e('0x20')](_0x733e('0x83'),require(_0x733e('0x84')));_0x279e98[_0x733e('0x20')](_0x733e('0x85'),require(_0x733e('0x86')));_0x279e98[_0x733e('0x20')](_0x733e('0x87'),require('./api/voiceQueuesLog'));_0x279e98[_0x733e('0x20')](_0x733e('0x88'),require(_0x733e('0x89')));_0x279e98[_0x733e('0x20')]('/api/sounds',require(_0x733e('0x8a')));_0x279e98[_0x733e('0x20')]('/api/tags',require('./api/tag'));_0x279e98[_0x733e('0x20')]('/api/templates',require(_0x733e('0x8b')));_0x279e98[_0x733e('0x20')](_0x733e('0x8c'),require(_0x733e('0x8d')));_0x279e98['use']('/api/variables',require(_0x733e('0x8e')));_0x279e98[_0x733e('0x20')](_0x733e('0x8f'),require(_0x733e('0x90')));_0x279e98['use'](_0x733e('0x91'),require(_0x733e('0x92')));_0x279e98[_0x733e('0x20')]('/api/analytics/custom_reports',require(_0x733e('0x93')));_0x279e98['use']('/api/analytics/default_reports',require(_0x733e('0x94')));_0x279e98['use'](_0x733e('0x95'),require('./api/analyticExtractedReport'));_0x279e98[_0x733e('0x20')]('/api/analytics/metrics',require(_0x733e('0x96')));_0x279e98[_0x733e('0x20')](_0x733e('0x97'),require(_0x733e('0x98')));_0x279e98['use'](_0x733e('0x99'),require(_0x733e('0x9a')));_0x279e98[_0x733e('0x20')]('/api/integrations/salesforce/accounts',require(_0x733e('0x9b')));_0x279e98[_0x733e('0x20')](_0x733e('0x9c'),require(_0x733e('0x9d')));_0x279e98[_0x733e('0x20')](_0x733e('0x9e'),require(_0x733e('0x9f')));_0x279e98[_0x733e('0x20')](_0x733e('0xa0'),require(_0x733e('0xa1')));_0x279e98[_0x733e('0x20')]('/api/integrations/sugarcrm/configurations',require('./api/intSugarcrmConfiguration'));_0x279e98[_0x733e('0x20')](_0x733e('0xa2'),require(_0x733e('0xa3')));_0x279e98['use']('/api/integrations/desk/accounts',require(_0x733e('0xa4')));_0x279e98['use'](_0x733e('0xa5'),require(_0x733e('0xa6')));_0x279e98[_0x733e('0x20')](_0x733e('0xa7'),require(_0x733e('0xa8')));_0x279e98['use'](_0x733e('0xa9'),require(_0x733e('0xaa')));_0x279e98[_0x733e('0x20')](_0x733e('0xab'),require(_0x733e('0xac')));_0x279e98[_0x733e('0x20')](_0x733e('0xad'),require(_0x733e('0xae')));_0x279e98[_0x733e('0x20')](_0x733e('0xaf'),require(_0x733e('0xb0')));_0x279e98[_0x733e('0x20')](_0x733e('0xb1'),require(_0x733e('0xb2')));_0x279e98[_0x733e('0x20')](_0x733e('0xb3'),require(_0x733e('0xb4')));_0x279e98[_0x733e('0x20')](_0x733e('0xb5'),require(_0x733e('0xb6')));_0x279e98[_0x733e('0x20')](_0x733e('0xb7'),require(_0x733e('0xb8')));_0x279e98[_0x733e('0x20')](_0x733e('0xb9'),require('./api/intFreshdeskField'));_0x279e98[_0x733e('0x20')](_0x733e('0xba'),require(_0x733e('0xbb')));_0x279e98[_0x733e('0x20')](_0x733e('0xbc'),require(_0x733e('0xbd')));_0x279e98[_0x733e('0x20')](_0x733e('0xbe'),require(_0x733e('0xbf')));_0x279e98[_0x733e('0x20')]('/api/integrations/servicenow/accounts',require('./api/intServicenowAccount'));_0x279e98[_0x733e('0x20')](_0x733e('0xc0'),require('./api/intServicenowConfiguration'));_0x279e98['use'](_0x733e('0xc1'),require(_0x733e('0xc2')));_0x279e98['use']('/api/integrations/dynamics365/accounts',require(_0x733e('0xc3')));_0x279e98[_0x733e('0x20')]('/api/integrations/dynamics365/configurations',require('./api/intDynamics365Configuration'));_0x279e98['use']('/api/integrations/dynamics365/fields',require(_0x733e('0xc4')));_0x279e98[_0x733e('0x20')](_0x733e('0xc5'),require('./api/intFreshsalesAccount'));_0x279e98[_0x733e('0x20')](_0x733e('0xc6'),require(_0x733e('0xc7')));_0x279e98[_0x733e('0x20')]('/api/integrations/freshsales/fields',require(_0x733e('0xc8')));_0x279e98[_0x733e('0x20')](_0x733e('0xc9'),require(_0x733e('0xca')));_0x279e98['use'](_0x733e('0xcb'),require('./api/chatQueueReport'));_0x279e98[_0x733e('0x20')](_0x733e('0xcc'),require(_0x733e('0xcd')));_0x279e98['use'](_0x733e('0xce'),require(_0x733e('0xcf')));_0x279e98[_0x733e('0x20')](_0x733e('0xd0'),require(_0x733e('0xd1')));_0x279e98[_0x733e('0x20')](_0x733e('0xd2'),require('./api/jscriptySessionReport'));_0x279e98[_0x733e('0x20')](_0x733e('0xd3'),require('./api/smsQueueReport'));_0x279e98[_0x733e('0x20')]('/api/square/reports',require(_0x733e('0xd4')));_0x279e98[_0x733e('0x20')](_0x733e('0xd5'),require('./api/squareReportDetail'));_0x279e98[_0x733e('0x20')]('/api/jscripty/projects',require(_0x733e('0xd6')));_0x279e98['use']('/api/settings',require(_0x733e('0xd7')));_0x279e98[_0x733e('0x20')]('/api/square/odbc',require(_0x733e('0xd8')));_0x279e98['use'](_0x733e('0xd9'),require(_0x733e('0xda')));_0x279e98['use'](_0x733e('0xdb'),require('./api/squareRecording'));_0x279e98[_0x733e('0x20')]('/api/square/messages',require(_0x733e('0xdc')));_0x279e98[_0x733e('0x20')](_0x733e('0xdd'),require(_0x733e('0xde')));_0x279e98['use'](_0x733e('0xdf'),require(_0x733e('0xe0')));_0x279e98[_0x733e('0x20')]('/api/campaigns',require(_0x733e('0xe1')));_0x279e98['use'](_0x733e('0xe2'),require(_0x733e('0xe3')));_0x279e98[_0x733e('0x20')](_0x733e('0xe4'),require(_0x733e('0xe5')));_0x279e98[_0x733e('0x20')](_0x733e('0xe6'),require(_0x733e('0xe7')));_0x279e98['use'](_0x733e('0xe8'),require(_0x733e('0xe9')));_0x279e98[_0x733e('0x20')](_0x733e('0xea'),require(_0x733e('0xeb')));_0x279e98[_0x733e('0x20')](_0x733e('0xec'),require('./api/faxTransferReport'));_0x279e98[_0x733e('0x20')](_0x733e('0xed'),require(_0x733e('0xee')));_0x279e98[_0x733e('0x20')]('/api/sms/reports/transfer',require(_0x733e('0xef')));_0x279e98['use'](_0x733e('0xf0'),require('./api/cmList'));_0x279e98['use'](_0x733e('0xf1'),require('./api/voicePrefix'));_0x279e98[_0x733e('0x20')]('/api/userProfiles',require(_0x733e('0xf2')));_0x279e98['use']('/api/userProfile/sections',require(_0x733e('0xf3')));_0x279e98['use']('/api/userProfile/resources',require(_0x733e('0xf4')));_0x279e98[_0x733e('0x20')](_0x733e('0xf5'),require(_0x733e('0xf6')));_0x279e98[_0x733e('0x20')](_0x733e('0xf7'),require(_0x733e('0xf8')));_0x279e98['use'](_0x733e('0xf9'),require(_0x733e('0xfa')));_0x279e98[_0x733e('0x20')]('/api/whatsapp/interactions',require(_0x733e('0xfb')));_0x279e98['use'](_0x733e('0xfc'),require(_0x733e('0xfd')));_0x279e98[_0x733e('0x20')](_0x733e('0xfe'),require('./api/whatsappQueueReport'));_0x279e98[_0x733e('0x20')]('/api/whatsapp/reports/transfer',require(_0x733e('0xff')));_0x279e98['use'](_0x733e('0x100'),require('./api/whatsappQueue'));_0x279e98['use']('/api/cloudProviders',require(_0x733e('0x101')));_0x279e98[_0x733e('0x20')](_0x733e('0x102'),require('./api/realtime'));_0x279e98[_0x733e('0x20')](_0x733e('0x103'),require(_0x733e('0x104')));_0x279e98[_0x733e('0x20')](_0x733e('0x105'),require('./api/authGoogle'));_0x279e98[_0x733e('0x20')](_0x733e('0x106'),require(_0x733e('0x107')));_0x279e98['use']('/api/rpc',require('./api/rpc'));_0x279e98[_0x733e('0x20')](_0x733e('0x108'),require('./api/version'));_0x279e98[_0x733e('0x20')](_0x733e('0x109'),require(_0x733e('0x10a')));_0x279e98[_0x733e('0x20')](_0x733e('0x10b'),require(_0x733e('0x10c')));_0x279e98[_0x733e('0x20')](_0x733e('0x10d'),require(_0x733e('0x10e')));_0x279e98[_0x733e('0x20')](_0x733e('0x10f'),express[_0x733e('0x110')](path[_0x733e('0x111')](config[_0x733e('0x112')],'/apidoc')));_0x279e98['use'](_0x733e('0x113'),express[_0x733e('0x110')](path[_0x733e('0x111')](config[_0x733e('0x112')],'/www')));_0x279e98['use']('/demo',express['static'](path[_0x733e('0x111')](config[_0x733e('0x112')],_0x733e('0x114'))));_0x279e98[_0x733e('0x20')]('/snippet',express[_0x733e('0x110')](path[_0x733e('0x111')](config[_0x733e('0x112')],_0x733e('0x115'),_0x733e('0x116'))));_0x279e98['use'](_0x733e('0x117'),express['static'](path[_0x733e('0x111')](config[_0x733e('0x112')],'/server/files/plugins')));_0x279e98[_0x733e('0x118')](_0x733e('0x119'))[_0x733e('0x11a')](errors[0x194]);_0x279e98[_0x733e('0x118')]('/*')[_0x733e('0x11a')](function(_0x43139f,_0x5402e7){_0x5402e7[_0x733e('0x11b')](path['resolve'](_0x279e98[_0x733e('0x11a')](_0x733e('0x11c'))+_0x733e('0x11d')));});};var sensitiveFields=[_0x733e('0x11e'),_0x733e('0x11f'),_0x733e('0x120'),_0x733e('0x121'),_0x733e('0x122'),_0x733e('0x123'),_0x733e('0x124'),'phone',_0x733e('0x125'),'fax',_0x733e('0x126'),'clientId',_0x733e('0x127'),_0x733e('0x128'),_0x733e('0x129'),'accessKey',_0x733e('0x12a'),_0x733e('0x12b'),_0x733e('0x12c'),_0x733e('0x12d'),_0x733e('0x12e'),_0x733e('0x12f'),_0x733e('0x130'),_0x733e('0x131'),_0x733e('0x132'),_0x733e('0x133'),'calleridnum',_0x733e('0x134'),_0x733e('0x135'),_0x733e('0x136'),'privateKey',_0x733e('0x137'),_0x733e('0x138'),_0x733e('0x139'),_0x733e('0x16'),_0x733e('0x13a'),_0x733e('0x13b'),_0x733e('0x13c'),_0x733e('0x13d'),_0x733e('0x13e'),_0x733e('0x13f'),_0x733e('0x140')];function maskSensitiveData(_0x195f2c){var _0x398dd4=/(?!^)[\s\S](?!$)/g;if(!_[_0x733e('0x141')](_0x195f2c))return;for(var _0x34bb05 in _0x195f2c){if(_[_0x733e('0x142')](_0x195f2c[_0x34bb05])){for(var _0x117b12=0x0;_0x117b12<_0x195f2c[_0x34bb05]['length'];_0x117b12++){maskSensitiveData(_0x195f2c[_0x34bb05][_0x117b12]);}}else if(_['isPlainObject'](_0x195f2c[_0x34bb05])){maskSensitiveData(_0x195f2c[_0x34bb05]);}else if(_[_0x733e('0x143')](_0x195f2c[_0x34bb05])){_0x195f2c[_0x34bb05]=_0x195f2c[_0x34bb05]['replace'](/{{{/g,'@@{')[_0x733e('0x144')](/}}}/g,_0x733e('0x145'))[_0x733e('0x144')](/{{/g,'@{')[_0x733e('0x144')](/}}/g,'}@');if(_[_0x733e('0x146')](sensitiveFields,_0x34bb05)){_0x195f2c[_0x34bb05]=_0x195f2c[_0x34bb05][_0x733e('0x144')](_0x398dd4,'*');}}}} \ No newline at end of file +var _0x70d7=['token','channelSecret','accessToken','authToken','consumerKey','consumerSecret','membername','calleridname','exten','vidaooApiKey','accesskeyid','secretaccesskey','key','pass','dsn','secret','registry','oldPassword','isPlainObject','isArray','length','isString','replace','@@{','}@@','includes','lodash','path','express','express-winston','util','./errors','./config/environment','./config/logger','api','auth','default','use','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s','body','\x20body=%s','format','method','headers','connection','remoteAddress','url','statusCode','responseTime','user','name','role','inspect','logger','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s','device','agent_id','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)','x-forwarded-for','other','agent_name','test','/api/users','./api/user','/api/voice/chanspy','./api/voiceChanSpy','/api/voice/contexts','./api/voiceContext','./api/voiceExtension','/api/voice/mohs','./api/voiceMusicOnHold','/api/voice/queues','./api/voiceQueue','/api/voice/recordings','/api/voice/mails','./api/voiceMail','/api/voice/mails/messages','./api/voiceMailMessage','/api/voice/calls/reports','./api/voiceCallReport','./api/voiceDialReport','/api/voice/agents/reports','./api/voiceAgentReport','/api/voice/queues/reports','./api/voiceQueueReport','/api/members/reports','./api/memberReport','/api/trunks','./api/trunk','/api/voice/transfers/reports','./api/voiceTransferReport','/api/mail/out_servers','./api/mailServerOut','/api/mail/substatuses','./api/mailSubstatus','/api/mail/interactions','./api/mailInteraction','/api/mail/applications','./api/mailApplication','./api/mailQueueReport','/api/dashboards','./api/dashboard','/api/dashboards/items','./api/dashboardItem','/api/fax/accounts','./api/faxAccount','/api/fax/applications','./api/faxApplication','/api/fax/interactions','./api/faxInteraction','/api/fax/messages','/api/fax/queues','./api/faxQueue','/api/fax/reports/queue','./api/faxQueueReport','./api/smsAccount','/api/sms/applications','./api/smsApplication','/api/sms/interactions','./api/smsInteraction','/api/sms/messages','./api/smsMessage','/api/sms/queues','./api/smsQueue','/api/openchannel/accounts','/api/openchannel/applications','./api/openchannelApplication','/api/openchannel/interactions','./api/openchannelInteraction','/api/openchannel/messages','/api/openchannel/queues','./api/openchannelQueue','/api/chat/websites','./api/chatWebsite','/api/openchannel/reports/queue','./api/openchannelQueueReport','/api/chat/applications','/api/chat/interactions','./api/chatInteraction','/api/chat/messages','./api/chatMessage','./api/chatQueue','/api/chat/groups','./api/chatGroup','/api/chat/proactive_actions','./api/cmContact','/api/cm/hopper','/api/cm/hopper_black','/api/cm/hopper_final','./api/cmHopperFinal','/api/cm/hopper_history','./api/cmHopperHistory','/api/cm/custom_fields','./api/cmCustomField','/api/actions','./api/action','/api/automations','./api/automation','./api/cannedAnswer','/api/dispositions','/api/conditions','/api/intervals','./api/interval','/api/pauses','./api/pause','/api/cdr','./api/cdr','/api/schedules','./api/schedule','./api/sound','/api/tags','./api/tag','/api/templates','/api/variables','./api/variable','./api/integration','/api/analytics/custom_reports','./api/analyticCustomReport','/api/analytics/default_reports','./api/analyticDefaultReport','/api/analytics/extracted_reports','./api/analyticExtractedReport','/api/analytics/metrics','./api/analyticMetric','/api/analytics/field_reports','./api/analyticFieldReport','/api/analytics/tree_reports','./api/analyticTreeReport','./api/intSalesforceAccount','/api/integrations/salesforce/configurations','./api/intSalesforceConfiguration','./api/intSalesforceField','/api/integrations/sugarcrm/accounts','/api/integrations/sugarcrm/configurations','./api/intSugarcrmConfiguration','./api/intSugarcrmField','/api/integrations/desk/accounts','./api/intDeskAccount','/api/integrations/desk/configurations','./api/intDeskField','/api/integrations/zoho/accounts','/api/integrations/zoho/configurations','./api/intZohoConfiguration','/api/integrations/zoho/fields','./api/intZendeskAccount','/api/integrations/zendesk/configurations','./api/intZendeskConfiguration','/api/integrations/zendesk/fields','./api/intZendeskField','./api/intFreshdeskAccount','/api/integrations/freshdesk/configurations','./api/intFreshdeskConfiguration','/api/integrations/freshdesk/fields','/api/integrations/vtiger/accounts','./api/intVtigerAccount','./api/intVtigerConfiguration','/api/integrations/vtiger/fields','./api/intVtigerField','/api/integrations/servicenow/accounts','./api/intServicenowAccount','/api/integrations/servicenow/configurations','/api/integrations/servicenow/fields','/api/integrations/dynamics365/accounts','./api/intDynamics365Account','/api/integrations/dynamics365/configurations','./api/intDynamics365Configuration','/api/integrations/dynamics365/fields','./api/intDynamics365Field','/api/integrations/freshsales/configurations','./api/intFreshsalesConfiguration','/api/integrations/freshsales/fields','/api/networks','/api/chat/reports/queue','./api/chatQueueReport','/api/chat/internal/messages','./api/chatInternalMessage','/api/jscripty/questions/reports','./api/jscriptyQuestionReport','/api/jscripty/sessions/reports','./api/jscriptySessionReport','/api/square/reports','./api/squareReport','./api/squareReportDetail','/api/jscripty/projects','/api/square/odbc','./api/squareOdbc','/api/square/projects','./api/squareProject','/api/square/recordings','./api/squareRecording','/api/square/messages','./api/squareMessage','/api/teams','./api/license','/api/campaigns','/api/migrations','./api/migration','/api/attachments','./api/attachment','/api/plugins','./api/plugin','/api/mail/reports/transfer','./api/mailTransferReport','./api/chatTransferReport','/api/fax/reports/transfer','./api/faxTransferReport','/api/openchannel/reports/transfer','/api/sms/reports/transfer','./api/smsTransferReport','./api/cmList','/api/voice/prefixes','/api/userProfiles','./api/userProfile','/api/userProfile/sections','./api/userProfileSection','/api/userProfile/resources','./api/userProfileResource','/api/userNotifications','./api/userNotification','./api/whatsappAccount','/api/whatsapp/applications','./api/whatsappApplication','/api/whatsapp/interactions','./api/whatsappInteraction','./api/whatsappMessage','/api/whatsapp/reports/transfer','./api/whatsappTransferReport','/api/whatsapp/queues','./api/whatsappQueue','./api/cloudProvider','./api/realtime','/api/auth/local','./api/authLocal','/api/auth/google','./api/authGoogle','/api/jira','/api/version','./api/version','/api/system','./api/system','/apidoc','static','join','root','/www','/demo','/snippet','snippet','3.0.0','get','route','sendFile','resolve','appPath','/index.html','username','password','newPassword','lastName','phone','fax','email','clientId','securityToken','accessKey','tenantId'];(function(_0x4b055c,_0x4b870b){var _0x4b62bb=function(_0x4884c2){while(--_0x4884c2){_0x4b055c['push'](_0x4b055c['shift']());}};_0x4b62bb(++_0x4b870b);}(_0x70d7,0x160));var _0x770d=function(_0x33f542,_0xf3aa54){_0x33f542=_0x33f542-0x0;var _0x129d03=_0x70d7[_0x33f542];return _0x129d03;};'use strict';var _=require(_0x770d('0x0'));var path=require(_0x770d('0x1'));var express=require(_0x770d('0x2'));var ewinston=require(_0x770d('0x3'));var util=require(_0x770d('0x4'));var errors=require(_0x770d('0x5'));var config=require(_0x770d('0x6'));var logger=require(_0x770d('0x7'))(_0x770d('0x8'));var authLogger=require('./config/logger')(_0x770d('0x9'));exports[_0x770d('0xa')]=function(_0x55dcd1){_0x55dcd1[_0x770d('0xb')](ewinston['logger']({'winstonInstance':logger,'meta':![],'statusLevels':!![],'msg':function(_0x237850,_0x44ba3a){var _0x22f95c=_0x770d('0xc');if(!_['isEmpty'](_0x237850[_0x770d('0xd')])){_0x22f95c+=_0x770d('0xe');var _0x271a51=_0x237850[_0x770d('0xd')];maskSensitiveData(_0x271a51);}return util[_0x770d('0xf')](_0x22f95c,_0x237850[_0x770d('0x10')],_0x237850['headers']['x-forwarded-for']?_0x237850[_0x770d('0x11')]['x-forwarded-for']:_0x237850[_0x770d('0x12')][_0x770d('0x13')]||_0x237850['ip'],_0x237850[_0x770d('0x14')],_0x44ba3a[_0x770d('0x15')],_0x44ba3a[_0x770d('0x16')],_0x237850[_0x770d('0x17')]?_0x237850[_0x770d('0x17')]['id']:null,_0x237850[_0x770d('0x17')]?_0x237850[_0x770d('0x17')][_0x770d('0x18')]:null,_0x237850['user']?_0x237850[_0x770d('0x17')][_0x770d('0x19')]:null,_0x271a51?util[_0x770d('0x1a')](_0x271a51,![],null):'');}}));_0x55dcd1['use'](ewinston[_0x770d('0x1b')]({'winstonInstance':authLogger,'meta':![],'statusLevels':!![],'msg':function(_0xa24144,_0x2d51b1){var _0x41b3c5=_0x770d('0x1c');if(_0xa24144[_0x770d('0xd')]&&_0xa24144[_0x770d('0xd')][_0x770d('0x1d')]&&_0xa24144['body'][_0x770d('0x1e')]){_0x41b3c5=_0x770d('0x1f');}return util[_0x770d('0xf')](_0x41b3c5,_0xa24144[_0x770d('0x10')],_0xa24144[_0x770d('0x11')][_0x770d('0x20')]?_0xa24144[_0x770d('0x11')][_0x770d('0x20')]:_0xa24144[_0x770d('0x12')]['remoteAddress']||_0xa24144['ip'],_0xa24144[_0x770d('0x14')],_0x2d51b1['statusCode'],_0x2d51b1[_0x770d('0x16')],_0xa24144[_0x770d('0x17')]?_0xa24144['user']['id']:null,_0xa24144[_0x770d('0x17')]?_0xa24144[_0x770d('0x17')][_0x770d('0x18')]:null,_0xa24144['user']?_0xa24144[_0x770d('0x17')][_0x770d('0x19')]:null,_0xa24144[_0x770d('0xd')]&&_0xa24144[_0x770d('0xd')]['device']?_0xa24144[_0x770d('0xd')][_0x770d('0x1d')]:_0x770d('0x21'),_0xa24144['body']&&_0xa24144['body'][_0x770d('0x1e')]?_0xa24144[_0x770d('0xd')][_0x770d('0x1e')]:'',_0xa24144['body']&&_0xa24144[_0x770d('0xd')][_0x770d('0x22')]?_0xa24144[_0x770d('0xd')][_0x770d('0x22')]:'');},'ignoreRoute':function(_0x54bb8b){var _0x3dc486=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x3dc486[_0x770d('0x23')](_0x54bb8b[_0x770d('0x14')]);}}));_0x55dcd1['use'](_0x770d('0x24'),require(_0x770d('0x25')));_0x55dcd1['use'](_0x770d('0x26'),require(_0x770d('0x27')));_0x55dcd1[_0x770d('0xb')](_0x770d('0x28'),require(_0x770d('0x29')));_0x55dcd1[_0x770d('0xb')]('/api/voice/extensions',require(_0x770d('0x2a')));_0x55dcd1[_0x770d('0xb')](_0x770d('0x2b'),require(_0x770d('0x2c')));_0x55dcd1['use'](_0x770d('0x2d'),require(_0x770d('0x2e')));_0x55dcd1[_0x770d('0xb')](_0x770d('0x2f'),require('./api/voiceRecording'));_0x55dcd1[_0x770d('0xb')]('/api/screen/recordings',require('./api/screenRecording'));_0x55dcd1['use'](_0x770d('0x30'),require(_0x770d('0x31')));_0x55dcd1[_0x770d('0xb')](_0x770d('0x32'),require(_0x770d('0x33')));_0x55dcd1[_0x770d('0xb')](_0x770d('0x34'),require(_0x770d('0x35')));_0x55dcd1[_0x770d('0xb')]('/api/voice/dials/reports',require(_0x770d('0x36')));_0x55dcd1[_0x770d('0xb')](_0x770d('0x37'),require(_0x770d('0x38')));_0x55dcd1['use'](_0x770d('0x39'),require(_0x770d('0x3a')));_0x55dcd1[_0x770d('0xb')](_0x770d('0x3b'),require(_0x770d('0x3c')));_0x55dcd1['use'](_0x770d('0x3d'),require(_0x770d('0x3e')));_0x55dcd1['use'](_0x770d('0x3f'),require(_0x770d('0x40')));_0x55dcd1['use'](_0x770d('0x41'),require(_0x770d('0x42')));_0x55dcd1[_0x770d('0xb')]('/api/mail/accounts',require('./api/mailAccount'));_0x55dcd1['use']('/api/mail/queues',require('./api/mailQueue'));_0x55dcd1[_0x770d('0xb')](_0x770d('0x43'),require(_0x770d('0x44')));_0x55dcd1[_0x770d('0xb')](_0x770d('0x45'),require(_0x770d('0x46')));_0x55dcd1[_0x770d('0xb')]('/api/mail/messages',require('./api/mailMessage'));_0x55dcd1[_0x770d('0xb')](_0x770d('0x47'),require(_0x770d('0x48')));_0x55dcd1[_0x770d('0xb')]('/api/mail/reports/queue',require(_0x770d('0x49')));_0x55dcd1[_0x770d('0xb')](_0x770d('0x4a'),require(_0x770d('0x4b')));_0x55dcd1[_0x770d('0xb')](_0x770d('0x4c'),require(_0x770d('0x4d')));_0x55dcd1[_0x770d('0xb')](_0x770d('0x4e'),require(_0x770d('0x4f')));_0x55dcd1[_0x770d('0xb')](_0x770d('0x50'),require(_0x770d('0x51')));_0x55dcd1[_0x770d('0xb')](_0x770d('0x52'),require(_0x770d('0x53')));_0x55dcd1[_0x770d('0xb')](_0x770d('0x54'),require('./api/faxMessage'));_0x55dcd1[_0x770d('0xb')](_0x770d('0x55'),require(_0x770d('0x56')));_0x55dcd1['use'](_0x770d('0x57'),require(_0x770d('0x58')));_0x55dcd1[_0x770d('0xb')]('/api/sms/accounts',require(_0x770d('0x59')));_0x55dcd1[_0x770d('0xb')](_0x770d('0x5a'),require(_0x770d('0x5b')));_0x55dcd1['use'](_0x770d('0x5c'),require(_0x770d('0x5d')));_0x55dcd1[_0x770d('0xb')](_0x770d('0x5e'),require(_0x770d('0x5f')));_0x55dcd1[_0x770d('0xb')](_0x770d('0x60'),require(_0x770d('0x61')));_0x55dcd1['use'](_0x770d('0x62'),require('./api/openchannelAccount'));_0x55dcd1[_0x770d('0xb')](_0x770d('0x63'),require(_0x770d('0x64')));_0x55dcd1[_0x770d('0xb')](_0x770d('0x65'),require(_0x770d('0x66')));_0x55dcd1[_0x770d('0xb')](_0x770d('0x67'),require('./api/openchannelMessage'));_0x55dcd1[_0x770d('0xb')](_0x770d('0x68'),require(_0x770d('0x69')));_0x55dcd1[_0x770d('0xb')](_0x770d('0x6a'),require(_0x770d('0x6b')));_0x55dcd1[_0x770d('0xb')](_0x770d('0x6c'),require(_0x770d('0x6d')));_0x55dcd1['use'](_0x770d('0x6e'),require('./api/chatApplication'));_0x55dcd1[_0x770d('0xb')](_0x770d('0x6f'),require(_0x770d('0x70')));_0x55dcd1['use'](_0x770d('0x71'),require(_0x770d('0x72')));_0x55dcd1['use']('/api/chat/offline_messages',require('./api/chatOfflineMessage'));_0x55dcd1[_0x770d('0xb')]('/api/chat/queues',require(_0x770d('0x73')));_0x55dcd1[_0x770d('0xb')](_0x770d('0x74'),require(_0x770d('0x75')));_0x55dcd1[_0x770d('0xb')](_0x770d('0x76'),require('./api/chatProactiveAction'));_0x55dcd1[_0x770d('0xb')]('/api/cm/companies',require('./api/cmCompany'));_0x55dcd1[_0x770d('0xb')]('/api/cm/contacts',require(_0x770d('0x77')));_0x55dcd1[_0x770d('0xb')](_0x770d('0x78'),require('./api/cmHopper'));_0x55dcd1[_0x770d('0xb')](_0x770d('0x79'),require('./api/cmHopperBlack'));_0x55dcd1[_0x770d('0xb')](_0x770d('0x7a'),require(_0x770d('0x7b')));_0x55dcd1[_0x770d('0xb')](_0x770d('0x7c'),require(_0x770d('0x7d')));_0x55dcd1[_0x770d('0xb')](_0x770d('0x7e'),require(_0x770d('0x7f')));_0x55dcd1[_0x770d('0xb')](_0x770d('0x80'),require(_0x770d('0x81')));_0x55dcd1[_0x770d('0xb')](_0x770d('0x82'),require(_0x770d('0x83')));_0x55dcd1[_0x770d('0xb')]('/api/canned_answers',require(_0x770d('0x84')));_0x55dcd1[_0x770d('0xb')](_0x770d('0x85'),require('./api/disposition'));_0x55dcd1[_0x770d('0xb')](_0x770d('0x86'),require('./api/condition'));_0x55dcd1[_0x770d('0xb')](_0x770d('0x87'),require(_0x770d('0x88')));_0x55dcd1[_0x770d('0xb')](_0x770d('0x89'),require(_0x770d('0x8a')));_0x55dcd1[_0x770d('0xb')](_0x770d('0x8b'),require(_0x770d('0x8c')));_0x55dcd1[_0x770d('0xb')]('/api/voiceQueuesLog',require('./api/voiceQueuesLog'));_0x55dcd1[_0x770d('0xb')](_0x770d('0x8d'),require(_0x770d('0x8e')));_0x55dcd1[_0x770d('0xb')]('/api/sounds',require(_0x770d('0x8f')));_0x55dcd1[_0x770d('0xb')](_0x770d('0x90'),require(_0x770d('0x91')));_0x55dcd1[_0x770d('0xb')](_0x770d('0x92'),require('./api/template'));_0x55dcd1[_0x770d('0xb')]('/api/triggers',require('./api/trigger'));_0x55dcd1[_0x770d('0xb')](_0x770d('0x93'),require(_0x770d('0x94')));_0x55dcd1[_0x770d('0xb')]('/api/integrations',require(_0x770d('0x95')));_0x55dcd1['use']('/api/integrations/reports',require('./api/integrationReport'));_0x55dcd1['use'](_0x770d('0x96'),require(_0x770d('0x97')));_0x55dcd1[_0x770d('0xb')](_0x770d('0x98'),require(_0x770d('0x99')));_0x55dcd1[_0x770d('0xb')](_0x770d('0x9a'),require(_0x770d('0x9b')));_0x55dcd1[_0x770d('0xb')](_0x770d('0x9c'),require(_0x770d('0x9d')));_0x55dcd1[_0x770d('0xb')](_0x770d('0x9e'),require(_0x770d('0x9f')));_0x55dcd1['use'](_0x770d('0xa0'),require(_0x770d('0xa1')));_0x55dcd1[_0x770d('0xb')]('/api/integrations/salesforce/accounts',require(_0x770d('0xa2')));_0x55dcd1[_0x770d('0xb')](_0x770d('0xa3'),require(_0x770d('0xa4')));_0x55dcd1[_0x770d('0xb')]('/api/integrations/salesforce/fields',require(_0x770d('0xa5')));_0x55dcd1[_0x770d('0xb')](_0x770d('0xa6'),require('./api/intSugarcrmAccount'));_0x55dcd1['use'](_0x770d('0xa7'),require(_0x770d('0xa8')));_0x55dcd1['use']('/api/integrations/sugarcrm/fields',require(_0x770d('0xa9')));_0x55dcd1[_0x770d('0xb')](_0x770d('0xaa'),require(_0x770d('0xab')));_0x55dcd1[_0x770d('0xb')](_0x770d('0xac'),require('./api/intDeskConfiguration'));_0x55dcd1[_0x770d('0xb')]('/api/integrations/desk/fields',require(_0x770d('0xad')));_0x55dcd1[_0x770d('0xb')](_0x770d('0xae'),require('./api/intZohoAccount'));_0x55dcd1[_0x770d('0xb')](_0x770d('0xaf'),require(_0x770d('0xb0')));_0x55dcd1['use'](_0x770d('0xb1'),require('./api/intZohoField'));_0x55dcd1[_0x770d('0xb')]('/api/integrations/zendesk/accounts',require(_0x770d('0xb2')));_0x55dcd1[_0x770d('0xb')](_0x770d('0xb3'),require(_0x770d('0xb4')));_0x55dcd1[_0x770d('0xb')](_0x770d('0xb5'),require(_0x770d('0xb6')));_0x55dcd1[_0x770d('0xb')]('/api/integrations/freshdesk/accounts',require(_0x770d('0xb7')));_0x55dcd1['use'](_0x770d('0xb8'),require(_0x770d('0xb9')));_0x55dcd1[_0x770d('0xb')](_0x770d('0xba'),require('./api/intFreshdeskField'));_0x55dcd1[_0x770d('0xb')](_0x770d('0xbb'),require(_0x770d('0xbc')));_0x55dcd1[_0x770d('0xb')]('/api/integrations/vtiger/configurations',require(_0x770d('0xbd')));_0x55dcd1[_0x770d('0xb')](_0x770d('0xbe'),require(_0x770d('0xbf')));_0x55dcd1['use'](_0x770d('0xc0'),require(_0x770d('0xc1')));_0x55dcd1[_0x770d('0xb')](_0x770d('0xc2'),require('./api/intServicenowConfiguration'));_0x55dcd1[_0x770d('0xb')](_0x770d('0xc3'),require('./api/intServicenowField'));_0x55dcd1[_0x770d('0xb')](_0x770d('0xc4'),require(_0x770d('0xc5')));_0x55dcd1[_0x770d('0xb')](_0x770d('0xc6'),require(_0x770d('0xc7')));_0x55dcd1['use'](_0x770d('0xc8'),require(_0x770d('0xc9')));_0x55dcd1[_0x770d('0xb')]('/api/integrations/freshsales/accounts',require('./api/intFreshsalesAccount'));_0x55dcd1['use'](_0x770d('0xca'),require(_0x770d('0xcb')));_0x55dcd1[_0x770d('0xb')](_0x770d('0xcc'),require('./api/intFreshsalesField'));_0x55dcd1[_0x770d('0xb')](_0x770d('0xcd'),require('./api/network'));_0x55dcd1[_0x770d('0xb')](_0x770d('0xce'),require(_0x770d('0xcf')));_0x55dcd1[_0x770d('0xb')](_0x770d('0xd0'),require(_0x770d('0xd1')));_0x55dcd1[_0x770d('0xb')]('/api/jscripty/answers/reports',require('./api/jscriptyAnswerReport'));_0x55dcd1['use'](_0x770d('0xd2'),require(_0x770d('0xd3')));_0x55dcd1['use'](_0x770d('0xd4'),require(_0x770d('0xd5')));_0x55dcd1[_0x770d('0xb')]('/api/sms/reports/queue',require('./api/smsQueueReport'));_0x55dcd1['use'](_0x770d('0xd6'),require(_0x770d('0xd7')));_0x55dcd1[_0x770d('0xb')]('/api/square/details/reports',require(_0x770d('0xd8')));_0x55dcd1[_0x770d('0xb')](_0x770d('0xd9'),require('./api/jscriptyProject'));_0x55dcd1[_0x770d('0xb')]('/api/settings',require('./api/setting'));_0x55dcd1['use'](_0x770d('0xda'),require(_0x770d('0xdb')));_0x55dcd1['use'](_0x770d('0xdc'),require(_0x770d('0xdd')));_0x55dcd1[_0x770d('0xb')](_0x770d('0xde'),require(_0x770d('0xdf')));_0x55dcd1[_0x770d('0xb')](_0x770d('0xe0'),require(_0x770d('0xe1')));_0x55dcd1[_0x770d('0xb')](_0x770d('0xe2'),require('./api/team'));_0x55dcd1[_0x770d('0xb')]('/api/license',require(_0x770d('0xe3')));_0x55dcd1[_0x770d('0xb')](_0x770d('0xe4'),require('./api/campaign'));_0x55dcd1['use'](_0x770d('0xe5'),require(_0x770d('0xe6')));_0x55dcd1[_0x770d('0xb')](_0x770d('0xe7'),require(_0x770d('0xe8')));_0x55dcd1[_0x770d('0xb')](_0x770d('0xe9'),require(_0x770d('0xea')));_0x55dcd1[_0x770d('0xb')](_0x770d('0xeb'),require(_0x770d('0xec')));_0x55dcd1[_0x770d('0xb')]('/api/chat/reports/transfer',require(_0x770d('0xed')));_0x55dcd1[_0x770d('0xb')](_0x770d('0xee'),require(_0x770d('0xef')));_0x55dcd1[_0x770d('0xb')](_0x770d('0xf0'),require('./api/openchannelTransferReport'));_0x55dcd1[_0x770d('0xb')](_0x770d('0xf1'),require(_0x770d('0xf2')));_0x55dcd1[_0x770d('0xb')]('/api/cm/lists',require(_0x770d('0xf3')));_0x55dcd1[_0x770d('0xb')](_0x770d('0xf4'),require('./api/voicePrefix'));_0x55dcd1['use'](_0x770d('0xf5'),require(_0x770d('0xf6')));_0x55dcd1[_0x770d('0xb')](_0x770d('0xf7'),require(_0x770d('0xf8')));_0x55dcd1[_0x770d('0xb')](_0x770d('0xf9'),require(_0x770d('0xfa')));_0x55dcd1[_0x770d('0xb')](_0x770d('0xfb'),require(_0x770d('0xfc')));_0x55dcd1[_0x770d('0xb')]('/api/whatsapp/accounts',require(_0x770d('0xfd')));_0x55dcd1[_0x770d('0xb')](_0x770d('0xfe'),require(_0x770d('0xff')));_0x55dcd1[_0x770d('0xb')](_0x770d('0x100'),require(_0x770d('0x101')));_0x55dcd1[_0x770d('0xb')]('/api/whatsapp/messages',require(_0x770d('0x102')));_0x55dcd1[_0x770d('0xb')]('/api/whatsapp/reports/queue',require('./api/whatsappQueueReport'));_0x55dcd1[_0x770d('0xb')](_0x770d('0x103'),require(_0x770d('0x104')));_0x55dcd1[_0x770d('0xb')](_0x770d('0x105'),require(_0x770d('0x106')));_0x55dcd1[_0x770d('0xb')]('/api/cloudProviders',require(_0x770d('0x107')));_0x55dcd1[_0x770d('0xb')]('/api/realtime',require(_0x770d('0x108')));_0x55dcd1['use'](_0x770d('0x109'),require(_0x770d('0x10a')));_0x55dcd1[_0x770d('0xb')](_0x770d('0x10b'),require(_0x770d('0x10c')));_0x55dcd1[_0x770d('0xb')](_0x770d('0x10d'),require('./api/jira'));_0x55dcd1[_0x770d('0xb')]('/api/rpc',require('./api/rpc'));_0x55dcd1['use'](_0x770d('0x10e'),require(_0x770d('0x10f')));_0x55dcd1[_0x770d('0xb')](_0x770d('0x110'),require(_0x770d('0x111')));_0x55dcd1[_0x770d('0xb')]('/api/pm2',require('./api/pm2'));_0x55dcd1['use']('/api/webbar',require('./api/webbar'));_0x55dcd1[_0x770d('0xb')](_0x770d('0x112'),express[_0x770d('0x113')](path[_0x770d('0x114')](config[_0x770d('0x115')],'/apidoc')));_0x55dcd1['use'](_0x770d('0x116'),express[_0x770d('0x113')](path[_0x770d('0x114')](config[_0x770d('0x115')],_0x770d('0x116'))));_0x55dcd1[_0x770d('0xb')](_0x770d('0x117'),express[_0x770d('0x113')](path[_0x770d('0x114')](config[_0x770d('0x115')],_0x770d('0x117'))));_0x55dcd1[_0x770d('0xb')](_0x770d('0x118'),express[_0x770d('0x113')](path['join'](config[_0x770d('0x115')],_0x770d('0x119'),_0x770d('0x11a'))));_0x55dcd1[_0x770d('0xb')]('/plugins',express['static'](path[_0x770d('0x114')](config['root'],'/server/files/plugins')));_0x55dcd1['route']('/:url(api|auth|components|app|bower_components|assets)/*')[_0x770d('0x11b')](errors[0x194]);_0x55dcd1[_0x770d('0x11c')]('/*')['get'](function(_0x1ffce9,_0x35de9c){_0x35de9c[_0x770d('0x11d')](path[_0x770d('0x11e')](_0x55dcd1[_0x770d('0x11b')](_0x770d('0x11f'))+_0x770d('0x120')));});};var sensitiveFields=[_0x770d('0x121'),_0x770d('0x122'),_0x770d('0x123'),'apiKey','firstName',_0x770d('0x124'),'street',_0x770d('0x125'),'mobile',_0x770d('0x126'),_0x770d('0x127'),_0x770d('0x128'),'clientSecret',_0x770d('0x129'),'code',_0x770d('0x12a'),_0x770d('0x12b'),_0x770d('0x12c'),_0x770d('0x12d'),_0x770d('0x12e'),'accessTokenSecret',_0x770d('0x12f'),_0x770d('0x130'),_0x770d('0x131'),_0x770d('0x132'),_0x770d('0x133'),'calleridnum',_0x770d('0x134'),_0x770d('0x135'),'clientEmail','privateKey',_0x770d('0x136'),_0x770d('0x137'),_0x770d('0x138'),_0x770d('0x17'),_0x770d('0x139'),'accountSid','localstationid',_0x770d('0x13a'),_0x770d('0x13b'),_0x770d('0x13c'),_0x770d('0x13d')];function maskSensitiveData(_0x316234){var _0x5bc960=/(?!^)[\s\S](?!$)/g;if(!_[_0x770d('0x13e')](_0x316234))return;for(var _0x185311 in _0x316234){if(_[_0x770d('0x13f')](_0x316234[_0x185311])){for(var _0x4f8998=0x0;_0x4f8998<_0x316234[_0x185311][_0x770d('0x140')];_0x4f8998++){maskSensitiveData(_0x316234[_0x185311][_0x4f8998]);}}else if(_['isPlainObject'](_0x316234[_0x185311])){maskSensitiveData(_0x316234[_0x185311]);}else if(_[_0x770d('0x141')](_0x316234[_0x185311])){_0x316234[_0x185311]=_0x316234[_0x185311][_0x770d('0x142')](/{{{/g,_0x770d('0x143'))[_0x770d('0x142')](/}}}/g,_0x770d('0x144'))[_0x770d('0x142')](/{{/g,'@{')[_0x770d('0x142')](/}}/g,'}@');if(_[_0x770d('0x145')](sensitiveFields,_0x185311)){_0x316234[_0x185311]=_0x316234[_0x185311][_0x770d('0x142')](_0x5bc960,'*');}}}} \ No newline at end of file diff --git a/server/rpc/index.js b/server/rpc/index.js index 9b8fbca..2c551e4 100644 --- a/server/rpc/index.js +++ b/server/rpc/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf408=['../api/whatsappQueue/whatsappQueue.rpc','http','rpc','error','log','Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!','../config/triggers','default','RPC\x20listening\x20on\x20','jayson/promise','bluebird','lodash','../config/environment','merge','../api/user/user.rpc','../api/voiceQueue/voiceQueue.rpc','../api/voiceCallReport/voiceCallReport.rpc','../api/voiceDialReport/voiceDialReport.rpc','../api/voiceAgentReport/voiceAgentReport.rpc','../api/voiceQueueReport/voiceQueueReport.rpc','../api/memberReport/memberReport.rpc','../api/trunk/trunk.rpc','../api/voiceTransferReport/voiceTransferReport.rpc','../api/userVoiceQueueRt/userVoiceQueueRt.rpc','../api/mailServerIn/mailServerIn.rpc','../api/mailMessage/mailMessage.rpc','../api/faxApplication/faxApplication.rpc','../api/faxInteraction/faxInteraction.rpc','../api/faxQueue/faxQueue.rpc','../api/faxQueueReport/faxQueueReport.rpc','../api/smsAccount/smsAccount.rpc','../api/smsInteraction/smsInteraction.rpc','../api/openchannelApplication/openchannelApplication.rpc','../api/openchannelInteraction/openchannelInteraction.rpc','../api/openchannelMessage/openchannelMessage.rpc','../api/chatInteraction/chatInteraction.rpc','../api/chatQueue/chatQueue.rpc','../api/cmHopper/cmHopper.rpc','../api/cmHopperBlack/cmHopperBlack.rpc','../api/cmHopperFinal/cmHopperFinal.rpc','../api/reportAgentPreview/reportAgentPreview.rpc','../api/pause/pause.rpc','../api/sound/sound.rpc','../api/template/template.rpc','../api/trigger/trigger.rpc','../api/variable/variable.rpc','../api/intSalesforceAccount/intSalesforceAccount.rpc','../api/intSugarcrmAccount/intSugarcrmAccount.rpc','../api/intFreshdeskAccount/intFreshdeskAccount.rpc','../api/intVtigerAccount/intVtigerAccount.rpc','../api/intServicenowAccount/intServicenowAccount.rpc','../api/intDynamics365Account/intDynamics365Account.rpc','../api/intFreshsalesAccount/intFreshsalesAccount.rpc','../api/chatQueueReport/chatQueueReport.rpc','../api/squareReportDetail/squareReportDetail.rpc','../api/setting/setting.rpc','../api/squareOdbc/squareOdbc.rpc','../api/squareProject/squareProject.rpc','../api/campaign/campaign.rpc','../api/plugin/plugin.rpc','../api/whatsappAccount/whatsappAccount.rpc','../api/whatsappInteraction/whatsappInteraction.rpc','../api/whatsappMessage/whatsappMessage.rpc','../api/whatsappQueueReport/whatsappQueueReport.rpc'];(function(_0x593018,_0x1a17cd){var _0x3af5e6=function(_0x48e197){while(--_0x48e197){_0x593018['push'](_0x593018['shift']());}};_0x3af5e6(++_0x1a17cd);}(_0xf408,0x149));var _0x8f40=function(_0x5bf601,_0x8fb76d){_0x5bf601=_0x5bf601-0x0;var _0x4ea9b6=_0xf408[_0x5bf601];return _0x4ea9b6;};'use strict';var jayson=require(_0x8f40('0x0'));var BPromise=require(_0x8f40('0x1'));var _=require(_0x8f40('0x2'));var config=require(_0x8f40('0x3'));exports['listen']=function(){return new BPromise(function(_0x267360,_0x5c4a52){var _0x39f076={};_0x39f076=_[_0x8f40('0x4')](_0x39f076,require(_0x8f40('0x5')));_0x39f076=_[_0x8f40('0x4')](_0x39f076,require('../api/voiceExtension/voiceExtension.rpc'));_0x39f076=_['merge'](_0x39f076,require(_0x8f40('0x6')));_0x39f076=_[_0x8f40('0x4')](_0x39f076,require('../api/voiceRecording/voiceRecording.rpc'));_0x39f076=_['merge'](_0x39f076,require(_0x8f40('0x7')));_0x39f076=_[_0x8f40('0x4')](_0x39f076,require(_0x8f40('0x8')));_0x39f076=_['merge'](_0x39f076,require(_0x8f40('0x9')));_0x39f076=_[_0x8f40('0x4')](_0x39f076,require(_0x8f40('0xa')));_0x39f076=_[_0x8f40('0x4')](_0x39f076,require(_0x8f40('0xb')));_0x39f076=_[_0x8f40('0x4')](_0x39f076,require(_0x8f40('0xc')));_0x39f076=_[_0x8f40('0x4')](_0x39f076,require(_0x8f40('0xd')));_0x39f076=_[_0x8f40('0x4')](_0x39f076,require(_0x8f40('0xe')));_0x39f076=_[_0x8f40('0x4')](_0x39f076,require(_0x8f40('0xf')));_0x39f076=_[_0x8f40('0x4')](_0x39f076,require('../api/mailAccount/mailAccount.rpc'));_0x39f076=_['merge'](_0x39f076,require('../api/mailQueue/mailQueue.rpc'));_0x39f076=_[_0x8f40('0x4')](_0x39f076,require('../api/mailInteraction/mailInteraction.rpc'));_0x39f076=_[_0x8f40('0x4')](_0x39f076,require(_0x8f40('0x10')));_0x39f076=_[_0x8f40('0x4')](_0x39f076,require('../api/mailApplication/mailApplication.rpc'));_0x39f076=_['merge'](_0x39f076,require('../api/mailQueueReport/mailQueueReport.rpc'));_0x39f076=_[_0x8f40('0x4')](_0x39f076,require('../api/faxAccount/faxAccount.rpc'));_0x39f076=_[_0x8f40('0x4')](_0x39f076,require(_0x8f40('0x11')));_0x39f076=_['merge'](_0x39f076,require(_0x8f40('0x12')));_0x39f076=_[_0x8f40('0x4')](_0x39f076,require('../api/faxMessage/faxMessage.rpc'));_0x39f076=_[_0x8f40('0x4')](_0x39f076,require(_0x8f40('0x13')));_0x39f076=_[_0x8f40('0x4')](_0x39f076,require(_0x8f40('0x14')));_0x39f076=_[_0x8f40('0x4')](_0x39f076,require(_0x8f40('0x15')));_0x39f076=_['merge'](_0x39f076,require(_0x8f40('0x16')));_0x39f076=_[_0x8f40('0x4')](_0x39f076,require('../api/smsMessage/smsMessage.rpc'));_0x39f076=_['merge'](_0x39f076,require('../api/smsQueue/smsQueue.rpc'));_0x39f076=_[_0x8f40('0x4')](_0x39f076,require(_0x8f40('0x17')));_0x39f076=_['merge'](_0x39f076,require(_0x8f40('0x18')));_0x39f076=_[_0x8f40('0x4')](_0x39f076,require(_0x8f40('0x19')));_0x39f076=_[_0x8f40('0x4')](_0x39f076,require('../api/openchannelQueue/openchannelQueue.rpc'));_0x39f076=_['merge'](_0x39f076,require('../api/openchannelQueueReport/openchannelQueueReport.rpc'));_0x39f076=_['merge'](_0x39f076,require(_0x8f40('0x1a')));_0x39f076=_[_0x8f40('0x4')](_0x39f076,require('../api/chatMessage/chatMessage.rpc'));_0x39f076=_[_0x8f40('0x4')](_0x39f076,require(_0x8f40('0x1b')));_0x39f076=_[_0x8f40('0x4')](_0x39f076,require('../api/cmContact/cmContact.rpc'));_0x39f076=_[_0x8f40('0x4')](_0x39f076,require(_0x8f40('0x1c')));_0x39f076=_[_0x8f40('0x4')](_0x39f076,require(_0x8f40('0x1d')));_0x39f076=_[_0x8f40('0x4')](_0x39f076,require(_0x8f40('0x1e')));_0x39f076=_[_0x8f40('0x4')](_0x39f076,require('../api/cmHopperHistory/cmHopperHistory.rpc'));_0x39f076=_[_0x8f40('0x4')](_0x39f076,require(_0x8f40('0x1f')));_0x39f076=_['merge'](_0x39f076,require('../api/interval/interval.rpc'));_0x39f076=_[_0x8f40('0x4')](_0x39f076,require(_0x8f40('0x20')));_0x39f076=_['merge'](_0x39f076,require(_0x8f40('0x21')));_0x39f076=_[_0x8f40('0x4')](_0x39f076,require(_0x8f40('0x22')));_0x39f076=_[_0x8f40('0x4')](_0x39f076,require(_0x8f40('0x23')));_0x39f076=_[_0x8f40('0x4')](_0x39f076,require(_0x8f40('0x24')));_0x39f076=_[_0x8f40('0x4')](_0x39f076,require(_0x8f40('0x25')));_0x39f076=_[_0x8f40('0x4')](_0x39f076,require(_0x8f40('0x26')));_0x39f076=_[_0x8f40('0x4')](_0x39f076,require('../api/intDeskAccount/intDeskAccount.rpc'));_0x39f076=_['merge'](_0x39f076,require('../api/intZohoAccount/intZohoAccount.rpc'));_0x39f076=_['merge'](_0x39f076,require('../api/intZendeskAccount/intZendeskAccount.rpc'));_0x39f076=_['merge'](_0x39f076,require(_0x8f40('0x27')));_0x39f076=_[_0x8f40('0x4')](_0x39f076,require(_0x8f40('0x28')));_0x39f076=_[_0x8f40('0x4')](_0x39f076,require(_0x8f40('0x29')));_0x39f076=_[_0x8f40('0x4')](_0x39f076,require(_0x8f40('0x2a')));_0x39f076=_[_0x8f40('0x4')](_0x39f076,require(_0x8f40('0x2b')));_0x39f076=_['merge'](_0x39f076,require(_0x8f40('0x2c')));_0x39f076=_[_0x8f40('0x4')](_0x39f076,require('../api/smsQueueReport/smsQueueReport.rpc'));_0x39f076=_[_0x8f40('0x4')](_0x39f076,require('../api/squareReport/squareReport.rpc'));_0x39f076=_[_0x8f40('0x4')](_0x39f076,require(_0x8f40('0x2d')));_0x39f076=_[_0x8f40('0x4')](_0x39f076,require(_0x8f40('0x2e')));_0x39f076=_[_0x8f40('0x4')](_0x39f076,require(_0x8f40('0x2f')));_0x39f076=_[_0x8f40('0x4')](_0x39f076,require(_0x8f40('0x30')));_0x39f076=_['merge'](_0x39f076,require('../api/squareRecording/squareRecording.rpc'));_0x39f076=_[_0x8f40('0x4')](_0x39f076,require('../api/squareMessage/squareMessage.rpc'));_0x39f076=_[_0x8f40('0x4')](_0x39f076,require(_0x8f40('0x31')));_0x39f076=_['merge'](_0x39f076,require('../api/attachment/attachment.rpc'));_0x39f076=_[_0x8f40('0x4')](_0x39f076,require(_0x8f40('0x32')));_0x39f076=_[_0x8f40('0x4')](_0x39f076,require(_0x8f40('0x33')));_0x39f076=_[_0x8f40('0x4')](_0x39f076,require(_0x8f40('0x34')));_0x39f076=_[_0x8f40('0x4')](_0x39f076,require(_0x8f40('0x35')));_0x39f076=_[_0x8f40('0x4')](_0x39f076,require(_0x8f40('0x36')));_0x39f076=_['merge'](_0x39f076,require(_0x8f40('0x37')));var _0x1b9f88=jayson['server'](_0x39f076)[_0x8f40('0x38')]();var _0x55b3ba=config[_0x8f40('0x39')]['port']||config['port']+0x1;var _0x44c958=config[_0x8f40('0x39')]['ip']||'localhost';_0x1b9f88['on'](_0x8f40('0x3a'),function(_0x35b45a){return _0x5c4a52(_0x35b45a);});_0x1b9f88['listen'](_0x55b3ba,_0x44c958,function(){console[_0x8f40('0x3b')](_0x8f40('0x3c'),_0x44c958,_0x55b3ba);require(_0x8f40('0x3d'))[_0x8f40('0x3e')]();return _0x267360(_0x8f40('0x3f')+_0x44c958+':'+_0x55b3ba);});});}; \ No newline at end of file +var _0xd894=['../api/openchannelQueueReport/openchannelQueueReport.rpc','../api/chatInteraction/chatInteraction.rpc','../api/chatMessage/chatMessage.rpc','../api/chatQueue/chatQueue.rpc','../api/cmHopper/cmHopper.rpc','../api/cmHopperBlack/cmHopperBlack.rpc','../api/cmHopperHistory/cmHopperHistory.rpc','../api/interval/interval.rpc','../api/sound/sound.rpc','../api/template/template.rpc','../api/trigger/trigger.rpc','../api/intSugarcrmAccount/intSugarcrmAccount.rpc','../api/intDeskAccount/intDeskAccount.rpc','../api/intZohoAccount/intZohoAccount.rpc','../api/intFreshdeskAccount/intFreshdeskAccount.rpc','../api/intServicenowAccount/intServicenowAccount.rpc','../api/intDynamics365Account/intDynamics365Account.rpc','../api/intFreshsalesAccount/intFreshsalesAccount.rpc','../api/chatQueueReport/chatQueueReport.rpc','../api/squareReport/squareReport.rpc','../api/squareReportDetail/squareReportDetail.rpc','../api/setting/setting.rpc','../api/squareOdbc/squareOdbc.rpc','../api/squareProject/squareProject.rpc','../api/squareMessage/squareMessage.rpc','../api/campaign/campaign.rpc','../api/attachment/attachment.rpc','../api/plugin/plugin.rpc','../api/whatsappAccount/whatsappAccount.rpc','../api/whatsappMessage/whatsappMessage.rpc','../api/whatsappQueueReport/whatsappQueueReport.rpc','../api/whatsappQueue/whatsappQueue.rpc','server','http','rpc','port','localhost','error','default','RPC\x20listening\x20on\x20','jayson/promise','listen','merge','../api/user/user.rpc','../api/voiceExtension/voiceExtension.rpc','../api/voiceQueue/voiceQueue.rpc','../api/voiceRecording/voiceRecording.rpc','../api/voiceCallReport/voiceCallReport.rpc','../api/voiceDialReport/voiceDialReport.rpc','../api/voiceAgentReport/voiceAgentReport.rpc','../api/voiceQueueReport/voiceQueueReport.rpc','../api/memberReport/memberReport.rpc','../api/trunk/trunk.rpc','../api/userVoiceQueueRt/userVoiceQueueRt.rpc','../api/mailServerIn/mailServerIn.rpc','../api/mailAccount/mailAccount.rpc','../api/mailQueue/mailQueue.rpc','../api/mailInteraction/mailInteraction.rpc','../api/mailMessage/mailMessage.rpc','../api/mailApplication/mailApplication.rpc','../api/mailQueueReport/mailQueueReport.rpc','../api/faxMessage/faxMessage.rpc','../api/faxQueue/faxQueue.rpc','../api/faxQueueReport/faxQueueReport.rpc','../api/smsAccount/smsAccount.rpc','../api/smsInteraction/smsInteraction.rpc','../api/smsMessage/smsMessage.rpc','../api/openchannelApplication/openchannelApplication.rpc','../api/openchannelInteraction/openchannelInteraction.rpc','../api/openchannelMessage/openchannelMessage.rpc','../api/openchannelQueue/openchannelQueue.rpc'];(function(_0x43f16f,_0x5b99e5){var _0x66db51=function(_0x1b017b){while(--_0x1b017b){_0x43f16f['push'](_0x43f16f['shift']());}};_0x66db51(++_0x5b99e5);}(_0xd894,0x6f));var _0x4d89=function(_0x5ef278,_0x42b272){_0x5ef278=_0x5ef278-0x0;var _0x48f9dd=_0xd894[_0x5ef278];return _0x48f9dd;};'use strict';var jayson=require(_0x4d89('0x0'));var BPromise=require('bluebird');var _=require('lodash');var config=require('../config/environment');exports[_0x4d89('0x1')]=function(){return new BPromise(function(_0x59b750,_0x449824){var _0xd3b8eb={};_0xd3b8eb=_[_0x4d89('0x2')](_0xd3b8eb,require(_0x4d89('0x3')));_0xd3b8eb=_[_0x4d89('0x2')](_0xd3b8eb,require(_0x4d89('0x4')));_0xd3b8eb=_[_0x4d89('0x2')](_0xd3b8eb,require(_0x4d89('0x5')));_0xd3b8eb=_[_0x4d89('0x2')](_0xd3b8eb,require(_0x4d89('0x6')));_0xd3b8eb=_[_0x4d89('0x2')](_0xd3b8eb,require(_0x4d89('0x7')));_0xd3b8eb=_['merge'](_0xd3b8eb,require(_0x4d89('0x8')));_0xd3b8eb=_['merge'](_0xd3b8eb,require(_0x4d89('0x9')));_0xd3b8eb=_[_0x4d89('0x2')](_0xd3b8eb,require(_0x4d89('0xa')));_0xd3b8eb=_[_0x4d89('0x2')](_0xd3b8eb,require(_0x4d89('0xb')));_0xd3b8eb=_[_0x4d89('0x2')](_0xd3b8eb,require(_0x4d89('0xc')));_0xd3b8eb=_['merge'](_0xd3b8eb,require('../api/voiceTransferReport/voiceTransferReport.rpc'));_0xd3b8eb=_[_0x4d89('0x2')](_0xd3b8eb,require(_0x4d89('0xd')));_0xd3b8eb=_[_0x4d89('0x2')](_0xd3b8eb,require(_0x4d89('0xe')));_0xd3b8eb=_[_0x4d89('0x2')](_0xd3b8eb,require(_0x4d89('0xf')));_0xd3b8eb=_[_0x4d89('0x2')](_0xd3b8eb,require(_0x4d89('0x10')));_0xd3b8eb=_[_0x4d89('0x2')](_0xd3b8eb,require(_0x4d89('0x11')));_0xd3b8eb=_['merge'](_0xd3b8eb,require(_0x4d89('0x12')));_0xd3b8eb=_[_0x4d89('0x2')](_0xd3b8eb,require(_0x4d89('0x13')));_0xd3b8eb=_[_0x4d89('0x2')](_0xd3b8eb,require(_0x4d89('0x14')));_0xd3b8eb=_[_0x4d89('0x2')](_0xd3b8eb,require('../api/faxAccount/faxAccount.rpc'));_0xd3b8eb=_['merge'](_0xd3b8eb,require('../api/faxApplication/faxApplication.rpc'));_0xd3b8eb=_['merge'](_0xd3b8eb,require('../api/faxInteraction/faxInteraction.rpc'));_0xd3b8eb=_[_0x4d89('0x2')](_0xd3b8eb,require(_0x4d89('0x15')));_0xd3b8eb=_[_0x4d89('0x2')](_0xd3b8eb,require(_0x4d89('0x16')));_0xd3b8eb=_[_0x4d89('0x2')](_0xd3b8eb,require(_0x4d89('0x17')));_0xd3b8eb=_[_0x4d89('0x2')](_0xd3b8eb,require(_0x4d89('0x18')));_0xd3b8eb=_[_0x4d89('0x2')](_0xd3b8eb,require(_0x4d89('0x19')));_0xd3b8eb=_[_0x4d89('0x2')](_0xd3b8eb,require(_0x4d89('0x1a')));_0xd3b8eb=_[_0x4d89('0x2')](_0xd3b8eb,require('../api/smsQueue/smsQueue.rpc'));_0xd3b8eb=_[_0x4d89('0x2')](_0xd3b8eb,require(_0x4d89('0x1b')));_0xd3b8eb=_['merge'](_0xd3b8eb,require(_0x4d89('0x1c')));_0xd3b8eb=_[_0x4d89('0x2')](_0xd3b8eb,require(_0x4d89('0x1d')));_0xd3b8eb=_[_0x4d89('0x2')](_0xd3b8eb,require(_0x4d89('0x1e')));_0xd3b8eb=_[_0x4d89('0x2')](_0xd3b8eb,require(_0x4d89('0x1f')));_0xd3b8eb=_[_0x4d89('0x2')](_0xd3b8eb,require(_0x4d89('0x20')));_0xd3b8eb=_['merge'](_0xd3b8eb,require(_0x4d89('0x21')));_0xd3b8eb=_[_0x4d89('0x2')](_0xd3b8eb,require(_0x4d89('0x22')));_0xd3b8eb=_['merge'](_0xd3b8eb,require('../api/cmContact/cmContact.rpc'));_0xd3b8eb=_['merge'](_0xd3b8eb,require(_0x4d89('0x23')));_0xd3b8eb=_['merge'](_0xd3b8eb,require(_0x4d89('0x24')));_0xd3b8eb=_[_0x4d89('0x2')](_0xd3b8eb,require('../api/cmHopperFinal/cmHopperFinal.rpc'));_0xd3b8eb=_[_0x4d89('0x2')](_0xd3b8eb,require(_0x4d89('0x25')));_0xd3b8eb=_[_0x4d89('0x2')](_0xd3b8eb,require('../api/reportAgentPreview/reportAgentPreview.rpc'));_0xd3b8eb=_[_0x4d89('0x2')](_0xd3b8eb,require(_0x4d89('0x26')));_0xd3b8eb=_[_0x4d89('0x2')](_0xd3b8eb,require('../api/pause/pause.rpc'));_0xd3b8eb=_[_0x4d89('0x2')](_0xd3b8eb,require(_0x4d89('0x27')));_0xd3b8eb=_[_0x4d89('0x2')](_0xd3b8eb,require(_0x4d89('0x28')));_0xd3b8eb=_[_0x4d89('0x2')](_0xd3b8eb,require(_0x4d89('0x29')));_0xd3b8eb=_['merge'](_0xd3b8eb,require('../api/variable/variable.rpc'));_0xd3b8eb=_[_0x4d89('0x2')](_0xd3b8eb,require('../api/intSalesforceAccount/intSalesforceAccount.rpc'));_0xd3b8eb=_[_0x4d89('0x2')](_0xd3b8eb,require(_0x4d89('0x2a')));_0xd3b8eb=_[_0x4d89('0x2')](_0xd3b8eb,require(_0x4d89('0x2b')));_0xd3b8eb=_[_0x4d89('0x2')](_0xd3b8eb,require(_0x4d89('0x2c')));_0xd3b8eb=_[_0x4d89('0x2')](_0xd3b8eb,require('../api/intZendeskAccount/intZendeskAccount.rpc'));_0xd3b8eb=_[_0x4d89('0x2')](_0xd3b8eb,require(_0x4d89('0x2d')));_0xd3b8eb=_[_0x4d89('0x2')](_0xd3b8eb,require('../api/intVtigerAccount/intVtigerAccount.rpc'));_0xd3b8eb=_[_0x4d89('0x2')](_0xd3b8eb,require(_0x4d89('0x2e')));_0xd3b8eb=_[_0x4d89('0x2')](_0xd3b8eb,require(_0x4d89('0x2f')));_0xd3b8eb=_['merge'](_0xd3b8eb,require(_0x4d89('0x30')));_0xd3b8eb=_['merge'](_0xd3b8eb,require(_0x4d89('0x31')));_0xd3b8eb=_[_0x4d89('0x2')](_0xd3b8eb,require('../api/smsQueueReport/smsQueueReport.rpc'));_0xd3b8eb=_[_0x4d89('0x2')](_0xd3b8eb,require(_0x4d89('0x32')));_0xd3b8eb=_[_0x4d89('0x2')](_0xd3b8eb,require(_0x4d89('0x33')));_0xd3b8eb=_[_0x4d89('0x2')](_0xd3b8eb,require(_0x4d89('0x34')));_0xd3b8eb=_[_0x4d89('0x2')](_0xd3b8eb,require(_0x4d89('0x35')));_0xd3b8eb=_[_0x4d89('0x2')](_0xd3b8eb,require(_0x4d89('0x36')));_0xd3b8eb=_[_0x4d89('0x2')](_0xd3b8eb,require('../api/squareRecording/squareRecording.rpc'));_0xd3b8eb=_[_0x4d89('0x2')](_0xd3b8eb,require(_0x4d89('0x37')));_0xd3b8eb=_['merge'](_0xd3b8eb,require(_0x4d89('0x38')));_0xd3b8eb=_[_0x4d89('0x2')](_0xd3b8eb,require(_0x4d89('0x39')));_0xd3b8eb=_[_0x4d89('0x2')](_0xd3b8eb,require(_0x4d89('0x3a')));_0xd3b8eb=_['merge'](_0xd3b8eb,require(_0x4d89('0x3b')));_0xd3b8eb=_['merge'](_0xd3b8eb,require('../api/whatsappInteraction/whatsappInteraction.rpc'));_0xd3b8eb=_[_0x4d89('0x2')](_0xd3b8eb,require(_0x4d89('0x3c')));_0xd3b8eb=_[_0x4d89('0x2')](_0xd3b8eb,require(_0x4d89('0x3d')));_0xd3b8eb=_['merge'](_0xd3b8eb,require(_0x4d89('0x3e')));var _0x234a85=jayson[_0x4d89('0x3f')](_0xd3b8eb)[_0x4d89('0x40')]();var _0x3ce6ee=config[_0x4d89('0x41')][_0x4d89('0x42')]||config[_0x4d89('0x42')]+0x1;var _0x293e49=config[_0x4d89('0x41')]['ip']||_0x4d89('0x43');_0x234a85['on'](_0x4d89('0x44'),function(_0x169276){return _0x449824(_0x169276);});_0x234a85[_0x4d89('0x1')](_0x3ce6ee,_0x293e49,function(){console['log']('Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!',_0x293e49,_0x3ce6ee);require('../config/triggers')[_0x4d89('0x45')]();return _0x59b750(_0x4d89('0x46')+_0x293e49+':'+_0x3ce6ee);});});}; \ No newline at end of file diff --git a/server/services/agi/channel.js b/server/services/agi/channel.js index 1aa93d6..68f294a 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 _0x43a2=['write','inherits','prototype','sendRequest','sync','answer','getData','beep','format','GET\x20DATA\x20\x22%s\x22\x20%s\x20%s','NO\x20MESSAGE','VERBOSE\x20\x22%s\x22','exec','isArray','join','EXEC\x20%s\x20%s','setContext','setExtension','SET\x20EXTENSION\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','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','agi','AGI','wait','WAIT','ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s','label','exports','lodash','events','EventEmitter','./error','setEncoding','emit','ready','line','hangup','substring','520-Invalid','search','520\x20End\x20of\x20proper','function','no\x20code','replace','result=','substr','indexOf','startsWith','length','match','error','E_AGI_SOCKET_ERROR','code','close','E_AGI_SOCKET_CLOSE','timeout','E_AGI_SOCKET_TIMEOUT','destroy','pipe','command'];(function(_0x17406a,_0x1e2320){var _0x1501ff=function(_0x4b075a){while(--_0x4b075a){_0x17406a['push'](_0x17406a['shift']());}};_0x1501ff(++_0x1e2320);}(_0x43a2,0xd0));var _0x243a=function(_0x334d58,_0x1d346a){_0x334d58=_0x334d58-0x0;var _0x17c359=_0x43a2[_0x334d58];return _0x17c359;};'use strict';var util=require('util');var _=require(_0x243a('0x0'));var EventEmitter=require(_0x243a('0x1'))[_0x243a('0x2')];var AGIReply=require('./reply');var AGIError=require(_0x243a('0x3'));function AGIChannel(_0x48fe2f){var _0x37dba9=this,_0x29fb13=new AGIReply(),_0x3da3b5=![],_0xff53f9={};EventEmitter['call'](_0x37dba9);_0x48fe2f[_0x243a('0x4')]('utf8');_0x48fe2f['setTimeout'](0x8*0x3c*0x3c*0x3e8);_0x29fb13['setEncoding']('utf8');_0x29fb13['on']('headers',function(_0x339c47){for(var _0xcaef6f in _0x339c47){_0x37dba9[_0xcaef6f]=_0x339c47[_0xcaef6f];}_0x37dba9[_0x243a('0x5')](_0x243a('0x6'));});_0x29fb13['on'](_0x243a('0x7'),function(_0x41a114){if(_0x41a114['toLowerCase']()=='hangup'){_0x37dba9[_0x243a('0x5')](_0x243a('0x8'));return;}if(_0x41a114[_0x243a('0x9')](0x0,0xb)==_0x243a('0xa')){_0x3da3b5=!![];}if(_0x3da3b5){_0xff53f9['rx']+=_0x41a114+'\x0a';if(_0x41a114[_0x243a('0xb')](_0x243a('0xc'))!=-0x1){_0x3da3b5=![];}}else{_0xff53f9['rx']=_0x41a114;}if(_0x3da3b5){return;}if(typeof _0xff53f9['cb']==_0x243a('0xd')){var _0x31155f=_0xff53f9['rx'][_0x243a('0x9')](0x0,0x3),_0x43672a=null,_0x427280=null;_0x31155f=parseInt(_0x31155f);if(isNaN(_0x31155f)){_0xff53f9['cb'](null,{'code':0x1f4,'result':-0x1,'extra':_0x243a('0xe')});return;}if(_0x31155f!=0xc8){_0xff53f9['cb'](null,{'code':_0x31155f,'result':-0x1,'extra':'KO'});return;}_0x43672a=_0xff53f9['rx'][_0x243a('0x9')](0x4)[_0x243a('0xf')](_0x243a('0x10'),'');if(_0x43672a['indexOf']('\x20')!=-0x1){_0x43672a=_0x43672a[_0x243a('0x11')](0x0,_0x43672a[_0x243a('0x12')]('\x20'));}if(_[_0x243a('0x13')](_0x43672a,'-1')){_0x43672a=parseInt(_0x43672a);}_0x427280=_0xff53f9['rx']['split']('\x20');if(_0x427280[_0x243a('0x14')]==0x3){_0x427280=_0x427280[0x2][_0x243a('0x9')](0x1,_0x427280[0x2][_0x243a('0x14')]-0x1);}else if(_0x427280[_0x243a('0x14')]>0x3){var _0x505bf2=/\((.+)\)/;var _0x58c568=_0xff53f9['rx'][_0x243a('0x15')](_0x505bf2);if(_0x58c568){_0x427280=_0x58c568[0x1];}else{_0x427280=null;}}else{_0x427280=null;}_0xff53f9['cb'](null,{'code':_0x31155f,'result':_0x43672a,'extra':_0x427280});}});_0x48fe2f['on'](_0x243a('0x16'),function(_0x14dd8b){_0x37dba9['emit'](_0x243a('0x16'),new AGIError(_0x243a('0x17'),_0x14dd8b[_0x243a('0x18')]));});_0x48fe2f['on'](_0x243a('0x19'),function(){_0x37dba9[_0x243a('0x5')](_0x243a('0x19'),new AGIError(_0x243a('0x1a')));});_0x48fe2f['on'](_0x243a('0x1b'),function(){_0x37dba9[_0x243a('0x5')](_0x243a('0x1b'),new AGIError(_0x243a('0x1c')));_0x48fe2f[_0x243a('0x1d')]();});_0x48fe2f[_0x243a('0x1e')](_0x29fb13);this[_0x243a('0x1f')]=function(_0xa844e,_0x3a773f){var _0xa844e=_0xa844e||'',_0x3a773f=typeof _0x3a773f=='function'?_0x3a773f:new Function();_0xff53f9={'tx':_0xa844e,'rx':'','cb':_0x3a773f};_0x48fe2f[_0x243a('0x20')](_0xa844e+'\x0a');},this[_0x243a('0x19')]=function(){_0x48fe2f[_0x243a('0x1d')]();};}util[_0x243a('0x21')](AGIChannel,EventEmitter);AGIChannel[_0x243a('0x22')][_0x243a('0x23')]=function(_0x50d4f0){return this[_0x243a('0x1f')][_0x243a('0x24')](this,_0x50d4f0);};AGIChannel[_0x243a('0x22')][_0x243a('0x25')]=function(){return this[_0x243a('0x23')]('ANSWER');};AGIChannel[_0x243a('0x22')][_0x243a('0x26')]=function(_0x423016,_0x14dcff,_0x7cb6da){_0x423016=_0x423016===undefined?_0x243a('0x27'):_0x423016;_0x14dcff=_0x14dcff===undefined?'5':_0x14dcff;_0x7cb6da=_0x7cb6da===undefined?'1':_0x7cb6da;return this['sendRequest'](util[_0x243a('0x28')](_0x243a('0x29'),_0x423016,_0x14dcff*0x3e8,_0x7cb6da));};AGIChannel[_0x243a('0x22')]['noop']=function(_0x4cf06f){_0x4cf06f=_0x4cf06f||_0x243a('0x2a');return this['sendRequest'](util[_0x243a('0x28')](_0x243a('0x2b'),_0x4cf06f));};AGIChannel[_0x243a('0x22')][_0x243a('0x2c')]=function(_0x2151e8,_0x25f940){if(_[_0x243a('0x2d')](_0x25f940)){return this[_0x243a('0x23')](util[_0x243a('0x28')]('EXEC\x20%s\x20%s',_0x2151e8,_0x25f940[_0x243a('0x2e')](',')));}return this[_0x243a('0x23')](util[_0x243a('0x28')](_0x243a('0x2f'),_0x2151e8,_0x25f940));};AGIChannel['prototype'][_0x243a('0x30')]=function(_0x3b0519){return this[_0x243a('0x23')](util[_0x243a('0x28')]('SET\x20CONTEXT\x20%s',_0x3b0519));};AGIChannel[_0x243a('0x22')][_0x243a('0x31')]=function(_0x2984ac){return this[_0x243a('0x23')](util[_0x243a('0x28')](_0x243a('0x32'),_0x2984ac));};AGIChannel[_0x243a('0x22')][_0x243a('0x33')]=function(_0x43fa5e){return this['sendRequest'](util[_0x243a('0x28')](_0x243a('0x34'),_0x43fa5e));};AGIChannel['prototype'][_0x243a('0x8')]=function(){return this[_0x243a('0x23')]('HANGUP');};AGIChannel[_0x243a('0x22')][_0x243a('0x35')]=function(_0x4ce995,_0x5a5f05){var _0xaa6115=_[_0x243a('0x36')](_0x5a5f05)||_[_0x243a('0x37')](_0x5a5f05)?_0x5a5f05[_0x243a('0x38')]():_0x5a5f05;return this['sendRequest'](util[_0x243a('0x28')](_0x243a('0x39'),_0x4ce995,_0xaa6115?_0xaa6115['toString']()[_0x243a('0xf')](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel[_0x243a('0x22')][_0x243a('0x3a')]=function(_0x231b2b,_0x3fc0df){return this['sendRequest'](util[_0x243a('0x28')](_0x243a('0x3b'),_0x231b2b,_0x3fc0df));};AGIChannel['prototype'][_0x243a('0x3c')]=function(_0x3d6fe2,_0x4caafe){return this['sendRequest'](util[_0x243a('0x28')](_0x243a('0x3d'),_0x3d6fe2,_0x4caafe));};AGIChannel[_0x243a('0x22')][_0x243a('0x3e')]=function(_0x5c91e9,_0x4d0af4){return this[_0x243a('0x23')](util[_0x243a('0x28')](_0x243a('0x3f'),_0x5c91e9,_0x4d0af4));};AGIChannel[_0x243a('0x22')]['continueAt']=function(_0x44e677,_0x27413e,_0x2c1e59){_0x27413e=_0x27413e||this[_0x243a('0x40')];_0x2c1e59=_0x2c1e59||0x1;this['setContext'](_0x44e677);this[_0x243a('0x31')](_0x27413e);this[_0x243a('0x33')](_0x2c1e59);return this[_0x243a('0x41')](util[_0x243a('0x28')](_0x243a('0x42'),_0x44e677,_0x27413e,_0x2c1e59));};AGIChannel[_0x243a('0x22')][_0x243a('0x43')]=function(_0x255077){return this[_0x243a('0x23')](util['format'](_0x243a('0x44'),_0x255077));};AGIChannel[_0x243a('0x22')][_0x243a('0x45')]=function(_0x49f118,_0x13ce4b,_0x51eb7c,_0x375e75,_0x29b32f,_0x299e4a){_0x13ce4b=_0x13ce4b||'wav';_0x51eb7c=_0x51eb7c||'';_0x375e75=_0x375e75===undefined?-0x1:_0x375e75==='-1'?-0x1:_0x375e75*0x3e8;_0x29b32f=_0x29b32f===undefined?'':'s='+_0x29b32f;_0x299e4a=_0x299e4a?_0x243a('0x46'):'';return this[_0x243a('0x23')](util[_0x243a('0x28')](_0x243a('0x47'),_0x49f118,_0x13ce4b,_0x51eb7c,_0x375e75,_0x299e4a,_0x29b32f));};AGIChannel[_0x243a('0x22')][_0x243a('0x48')]=function(_0x2944d9,_0x4eb2ef){_0x4eb2ef=_0x4eb2ef||'';return this[_0x243a('0x23')](util[_0x243a('0x28')]('STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22',_0x2944d9,_0x4eb2ef));};AGIChannel[_0x243a('0x22')][_0x243a('0x49')]=function(_0xe44fdd){return this[_0x243a('0x2c')](_0x243a('0x4a'),_0xe44fdd);};AGIChannel[_0x243a('0x22')][_0x243a('0x4b')]=function(_0x296dad){return this[_0x243a('0x2c')](_0x243a('0x4c'),_0x296dad);};AGIChannel['prototype'][_0x243a('0x16')]=function(_0xd1f201,_0x4ad77f){this[_0x243a('0x41')](util[_0x243a('0x28')](_0x243a('0x4d'),_0xd1f201['id'],_0xd1f201[_0x243a('0x4e')],_0x4ad77f));return{'code':0x1f4,'result':'-1','extra':''};};module[_0x243a('0x4f')]=AGIChannel; \ No newline at end of file +var _0x5dd2=['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','GOTO\x20%s\x20%s\x20%s','getVariable','GET\x20VARIABLE\x20\x22%s\x22','recordFile','RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s','streamFile','AGI','wait','WAIT','label','exports','lodash','events','EventEmitter','./reply','./error','call','setEncoding','setTimeout','utf8','headers','emit','ready','line','hangup','substring','520-Invalid','search','520\x20End\x20of\x20proper','replace','indexOf','substr','startsWith','split','length','match','error','E_AGI_SOCKET_ERROR','code','close','E_AGI_SOCKET_CLOSE','timeout','E_AGI_SOCKET_TIMEOUT','destroy','command','function','write','inherits','prototype','sendRequest','sync','ANSWER','getData','format','noop','VERBOSE\x20\x22%s\x22','exec','isArray','EXEC\x20%s\x20%s','join','setContext','setExtension','setPriority','SET\x20PRIORITY\x20%s','HANGUP'];(function(_0x450c7d,_0x291e01){var _0x5eb7fb=function(_0x10032e){while(--_0x10032e){_0x450c7d['push'](_0x450c7d['shift']());}};_0x5eb7fb(++_0x291e01);}(_0x5dd2,0x19e));var _0x25dd=function(_0x17b6e3,_0x4522ed){_0x17b6e3=_0x17b6e3-0x0;var _0x3906f3=_0x5dd2[_0x17b6e3];return _0x3906f3;};'use strict';var util=require('util');var _=require(_0x25dd('0x0'));var EventEmitter=require(_0x25dd('0x1'))[_0x25dd('0x2')];var AGIReply=require(_0x25dd('0x3'));var AGIError=require(_0x25dd('0x4'));function AGIChannel(_0x29955a){var _0x5c25c5=this,_0x543b83=new AGIReply(),_0x291e4e=![],_0x2a56f9={};EventEmitter[_0x25dd('0x5')](_0x5c25c5);_0x29955a[_0x25dd('0x6')]('utf8');_0x29955a[_0x25dd('0x7')](0x8*0x3c*0x3c*0x3e8);_0x543b83['setEncoding'](_0x25dd('0x8'));_0x543b83['on'](_0x25dd('0x9'),function(_0x30b4f0){for(var _0x4f8ce3 in _0x30b4f0){_0x5c25c5[_0x4f8ce3]=_0x30b4f0[_0x4f8ce3];}_0x5c25c5[_0x25dd('0xa')](_0x25dd('0xb'));});_0x543b83['on'](_0x25dd('0xc'),function(_0x30b365){if(_0x30b365['toLowerCase']()==_0x25dd('0xd')){_0x5c25c5[_0x25dd('0xa')](_0x25dd('0xd'));return;}if(_0x30b365[_0x25dd('0xe')](0x0,0xb)==_0x25dd('0xf')){_0x291e4e=!![];}if(_0x291e4e){_0x2a56f9['rx']+=_0x30b365+'\x0a';if(_0x30b365[_0x25dd('0x10')](_0x25dd('0x11'))!=-0x1){_0x291e4e=![];}}else{_0x2a56f9['rx']=_0x30b365;}if(_0x291e4e){return;}if(typeof _0x2a56f9['cb']=='function'){var _0x368593=_0x2a56f9['rx'][_0x25dd('0xe')](0x0,0x3),_0x51313f=null,_0x5c29eb=null;_0x368593=parseInt(_0x368593);if(isNaN(_0x368593)){_0x2a56f9['cb'](null,{'code':0x1f4,'result':-0x1,'extra':'no\x20code'});return;}if(_0x368593!=0xc8){_0x2a56f9['cb'](null,{'code':_0x368593,'result':-0x1,'extra':'KO'});return;}_0x51313f=_0x2a56f9['rx'][_0x25dd('0xe')](0x4)[_0x25dd('0x12')]('result=','');if(_0x51313f[_0x25dd('0x13')]('\x20')!=-0x1){_0x51313f=_0x51313f[_0x25dd('0x14')](0x0,_0x51313f[_0x25dd('0x13')]('\x20'));}if(_[_0x25dd('0x15')](_0x51313f,'-1')){_0x51313f=parseInt(_0x51313f);}_0x5c29eb=_0x2a56f9['rx'][_0x25dd('0x16')]('\x20');if(_0x5c29eb[_0x25dd('0x17')]==0x3){_0x5c29eb=_0x5c29eb[0x2][_0x25dd('0xe')](0x1,_0x5c29eb[0x2][_0x25dd('0x17')]-0x1);}else if(_0x5c29eb[_0x25dd('0x17')]>0x3){var _0x9508d0=/\((.+)\)/;var _0x56610d=_0x2a56f9['rx'][_0x25dd('0x18')](_0x9508d0);if(_0x56610d){_0x5c29eb=_0x56610d[0x1];}else{_0x5c29eb=null;}}else{_0x5c29eb=null;}_0x2a56f9['cb'](null,{'code':_0x368593,'result':_0x51313f,'extra':_0x5c29eb});}});_0x29955a['on'](_0x25dd('0x19'),function(_0x2aa5ec){_0x5c25c5['emit'](_0x25dd('0x19'),new AGIError(_0x25dd('0x1a'),_0x2aa5ec[_0x25dd('0x1b')]));});_0x29955a['on'](_0x25dd('0x1c'),function(){_0x5c25c5[_0x25dd('0xa')](_0x25dd('0x1c'),new AGIError(_0x25dd('0x1d')));});_0x29955a['on'](_0x25dd('0x1e'),function(){_0x5c25c5[_0x25dd('0xa')](_0x25dd('0x1e'),new AGIError(_0x25dd('0x1f')));_0x29955a[_0x25dd('0x20')]();});_0x29955a['pipe'](_0x543b83);this[_0x25dd('0x21')]=function(_0x327f0f,_0x33259d){var _0x327f0f=_0x327f0f||'',_0x33259d=typeof _0x33259d==_0x25dd('0x22')?_0x33259d:new Function();_0x2a56f9={'tx':_0x327f0f,'rx':'','cb':_0x33259d};_0x29955a[_0x25dd('0x23')](_0x327f0f+'\x0a');},this[_0x25dd('0x1c')]=function(){_0x29955a[_0x25dd('0x20')]();};}util[_0x25dd('0x24')](AGIChannel,EventEmitter);AGIChannel[_0x25dd('0x25')][_0x25dd('0x26')]=function(_0x2ed845){return this['command'][_0x25dd('0x27')](this,_0x2ed845);};AGIChannel['prototype']['answer']=function(){return this[_0x25dd('0x26')](_0x25dd('0x28'));};AGIChannel[_0x25dd('0x25')][_0x25dd('0x29')]=function(_0x5146b3,_0x5836a2,_0x484afc){_0x5146b3=_0x5146b3===undefined?'beep':_0x5146b3;_0x5836a2=_0x5836a2===undefined?'5':_0x5836a2;_0x484afc=_0x484afc===undefined?'1':_0x484afc;return this['sendRequest'](util[_0x25dd('0x2a')]('GET\x20DATA\x20\x22%s\x22\x20%s\x20%s',_0x5146b3,_0x5836a2*0x3e8,_0x484afc));};AGIChannel[_0x25dd('0x25')][_0x25dd('0x2b')]=function(_0x3e8094){_0x3e8094=_0x3e8094||'NO\x20MESSAGE';return this[_0x25dd('0x26')](util[_0x25dd('0x2a')](_0x25dd('0x2c'),_0x3e8094));};AGIChannel[_0x25dd('0x25')][_0x25dd('0x2d')]=function(_0x4b583a,_0x1935ea){if(_[_0x25dd('0x2e')](_0x1935ea)){return this[_0x25dd('0x26')](util['format'](_0x25dd('0x2f'),_0x4b583a,_0x1935ea[_0x25dd('0x30')](',')));}return this[_0x25dd('0x26')](util[_0x25dd('0x2a')]('EXEC\x20%s\x20%s',_0x4b583a,_0x1935ea));};AGIChannel[_0x25dd('0x25')][_0x25dd('0x31')]=function(_0xe3af09){return this['sendRequest'](util['format']('SET\x20CONTEXT\x20%s',_0xe3af09));};AGIChannel['prototype'][_0x25dd('0x32')]=function(_0x1bd55d){return this[_0x25dd('0x26')](util['format']('SET\x20EXTENSION\x20%s',_0x1bd55d));};AGIChannel[_0x25dd('0x25')][_0x25dd('0x33')]=function(_0x44e6e8){return this[_0x25dd('0x26')](util[_0x25dd('0x2a')](_0x25dd('0x34'),_0x44e6e8));};AGIChannel['prototype']['hangup']=function(){return this['sendRequest'](_0x25dd('0x35'));};AGIChannel[_0x25dd('0x25')][_0x25dd('0x36')]=function(_0x46186f,_0x270071){var _0x595ab0=_[_0x25dd('0x37')](_0x270071)||_[_0x25dd('0x38')](_0x270071)?_0x270071[_0x25dd('0x39')]():_0x270071;return this['sendRequest'](util[_0x25dd('0x2a')](_0x25dd('0x3a'),_0x46186f,_0x595ab0?_0x595ab0[_0x25dd('0x39')]()[_0x25dd('0x12')](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel[_0x25dd('0x25')][_0x25dd('0x3b')]=function(_0x54358e,_0x182bfe){return this['sendRequest'](util[_0x25dd('0x2a')](_0x25dd('0x3c'),_0x54358e,_0x182bfe));};AGIChannel[_0x25dd('0x25')][_0x25dd('0x3d')]=function(_0x2b68ef,_0x73fa09){return this[_0x25dd('0x26')](util[_0x25dd('0x2a')](_0x25dd('0x3e'),_0x2b68ef,_0x73fa09));};AGIChannel[_0x25dd('0x25')][_0x25dd('0x3f')]=function(_0x2a78da,_0x17874c){return this[_0x25dd('0x26')](util['format'](_0x25dd('0x40'),_0x2a78da,_0x17874c));};AGIChannel['prototype'][_0x25dd('0x41')]=function(_0x20bcf6,_0x4d62dc,_0x3043ed){_0x4d62dc=_0x4d62dc||this[_0x25dd('0x42')];_0x3043ed=_0x3043ed||0x1;this[_0x25dd('0x31')](_0x20bcf6);this['setExtension'](_0x4d62dc);this[_0x25dd('0x33')](_0x3043ed);return this[_0x25dd('0x2b')](util[_0x25dd('0x2a')](_0x25dd('0x43'),_0x20bcf6,_0x4d62dc,_0x3043ed));};AGIChannel[_0x25dd('0x25')][_0x25dd('0x44')]=function(_0x5bdef5){return this[_0x25dd('0x26')](util[_0x25dd('0x2a')](_0x25dd('0x45'),_0x5bdef5));};AGIChannel['prototype'][_0x25dd('0x46')]=function(_0x32da49,_0x4b0d6e,_0x32835f,_0x3610a9,_0xea7b00,_0x1e1bd2){_0x4b0d6e=_0x4b0d6e||'wav';_0x32835f=_0x32835f||'';_0x3610a9=_0x3610a9===undefined?-0x1:_0x3610a9==='-1'?-0x1:_0x3610a9*0x3e8;_0xea7b00=_0xea7b00===undefined?'':'s='+_0xea7b00;_0x1e1bd2=_0x1e1bd2?'BEEP':'';return this[_0x25dd('0x26')](util[_0x25dd('0x2a')](_0x25dd('0x47'),_0x32da49,_0x4b0d6e,_0x32835f,_0x3610a9,_0x1e1bd2,_0xea7b00));};AGIChannel[_0x25dd('0x25')][_0x25dd('0x48')]=function(_0x28242e,_0x2b01f0){_0x2b01f0=_0x2b01f0||'';return this['sendRequest'](util['format']('STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22',_0x28242e,_0x2b01f0));};AGIChannel[_0x25dd('0x25')]['agi']=function(_0x196d6e){return this[_0x25dd('0x2d')](_0x25dd('0x49'),_0x196d6e);};AGIChannel['prototype'][_0x25dd('0x4a')]=function(_0x5b2641){return this[_0x25dd('0x2d')](_0x25dd('0x4b'),_0x5b2641);};AGIChannel[_0x25dd('0x25')][_0x25dd('0x19')]=function(_0x4dff08,_0x2373e4){this[_0x25dd('0x2b')](util[_0x25dd('0x2a')]('ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s',_0x4dff08['id'],_0x4dff08[_0x25dd('0x4c')],_0x2373e4));return{'code':0x1f4,'result':'-1','extra':''};};module[_0x25dd('0x4d')]=AGIChannel; \ No newline at end of file diff --git a/server/services/agi/error.js b/server/services/agi/error.js index 80b4414..f038fa5 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 _0x693b=['[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','Socket\x20closed.','Empty\x20command.','Missing\x20\x27ivr.agi_network_script\x27.','Missing\x20\x27ivr.entry\x27\x20menu.','E_AGI_UNDEFINED','push','apply','message','name','exports','util','Server\x20error.\x20Code:\x20%s.','[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.'];(function(_0x1a9ca4,_0x5115db){var _0x19a2c2=function(_0x13a68f){while(--_0x13a68f){_0x1a9ca4['push'](_0x1a9ca4['shift']());}};_0x19a2c2(++_0x5115db);}(_0x693b,0xcf));var _0xb693=function(_0x390228,_0x319481){_0x390228=_0x390228-0x0;var _0x1e3101=_0x693b[_0x390228];return _0x1e3101;};'use strict';var util=require(_0xb693('0x0'));var error={'E_AGI_UNDEFINED':'Undefined\x20error.','E_AGI_ARGUMENT_PORT':'Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','E_AGI_SERVER_ERROR':_0xb693('0x1'),'E_AGI_SERVER_CLOSE':'Server\x20closed.','E_AGI_SERVER_MAXCONNECTION':_0xb693('0x2'),'E_AGI_SERVER_VOICE_DISABLED':_0xb693('0x3'),'E_AGI_SOCKET_ERROR':'Socket\x20error.\x20Code:\x20%s.','E_AGI_SOCKET_CLOSE':_0xb693('0x4'),'E_AGI_SOCKET_TIMEOUT':'Socket\x20timeout.','E_AGI_COMMAND_EMPTY':_0xb693('0x5'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':_0xb693('0x6'),'E_AGI_IVR_ENTRY':_0xb693('0x7')};function AGIError(_0x121d1e){var _0x121d1e=_0x121d1e||null,_0x1075ba=_0x1075ba||[],_0x436399=0x1,_0x5e86bc='';if(!error[_0x121d1e]){_0x121d1e=_0xb693('0x8');}_0x1075ba['push'](error[_0x121d1e]);while(arguments[_0x436399]){_0x1075ba[_0xb693('0x9')](arguments[_0x436399]);_0x436399++;}_0x5e86bc=util['format'][_0xb693('0xa')](util,_0x1075ba);this[_0xb693('0xb')]=_0x5e86bc;this[_0xb693('0xc')]=_0x121d1e;}module[_0xb693('0xd')]=AGIError; \ No newline at end of file +var _0x1b6c=['Server\x20error.\x20Code:\x20%s.','Server\x20closed.','[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','Socket\x20error.\x20Code:\x20%s.','Socket\x20closed.','Socket\x20timeout.','Empty\x20command.','Missing\x20\x27ivr.agi_network_script\x27.','Missing\x20\x27ivr.entry\x27\x20menu.','push','format','message','name','Undefined\x20error.','Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.'];(function(_0x5317b5,_0x4dfd6e){var _0x3b7ce2=function(_0xc146d6){while(--_0xc146d6){_0x5317b5['push'](_0x5317b5['shift']());}};_0x3b7ce2(++_0x4dfd6e);}(_0x1b6c,0x13e));var _0xc1b6=function(_0x5538d5,_0x190032){_0x5538d5=_0x5538d5-0x0;var _0x323b1a=_0x1b6c[_0x5538d5];return _0x323b1a;};'use strict';var util=require('util');var error={'E_AGI_UNDEFINED':_0xc1b6('0x0'),'E_AGI_ARGUMENT_PORT':_0xc1b6('0x1'),'E_AGI_SERVER_ERROR':_0xc1b6('0x2'),'E_AGI_SERVER_CLOSE':_0xc1b6('0x3'),'E_AGI_SERVER_MAXCONNECTION':_0xc1b6('0x4'),'E_AGI_SERVER_VOICE_DISABLED':_0xc1b6('0x5'),'E_AGI_SOCKET_ERROR':_0xc1b6('0x6'),'E_AGI_SOCKET_CLOSE':_0xc1b6('0x7'),'E_AGI_SOCKET_TIMEOUT':_0xc1b6('0x8'),'E_AGI_COMMAND_EMPTY':_0xc1b6('0x9'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':_0xc1b6('0xa'),'E_AGI_IVR_ENTRY':_0xc1b6('0xb')};function AGIError(_0x2a6367){var _0x2a6367=_0x2a6367||null,_0x40e549=_0x40e549||[],_0x1622c1=0x1,_0x5525af='';if(!error[_0x2a6367]){_0x2a6367='E_AGI_UNDEFINED';}_0x40e549[_0xc1b6('0xc')](error[_0x2a6367]);while(arguments[_0x1622c1]){_0x40e549[_0xc1b6('0xc')](arguments[_0x1622c1]);_0x1622c1++;}_0x5525af=util[_0xc1b6('0xd')]['apply'](util,_0x40e549);this[_0xc1b6('0xe')]=_0x5525af;this[_0xc1b6('0xf')]=_0x2a6367;}module['exports']=AGIError; \ No newline at end of file diff --git a/server/services/agi/graph/index.js b/server/services/agi/graph/index.js index 13341f2..89340c7 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 _0x78f5=['menu','getdigits','getsecretdigits','edges','numberOfEdges','prototype','addEdge','push','size','relations','getVertex','info','no\x20vertex\x20found','vertices','stop\x20traverse','length','no\x20edge/s\x20available','condition','split','agicommand','target','default','invalid','traverseBFS','vswitch','default\x20on\x20switch\x20not\x20found','max\x20retry\x20reach','condition\x20not\x20found','exports','lodash','agi'];(function(_0x4fc9e6,_0xc51915){var _0x551d28=function(_0x1a603b){while(--_0x1a603b){_0x4fc9e6['push'](_0x4fc9e6['shift']());}};_0x551d28(++_0xc51915);}(_0x78f5,0xd7));var _0x578f=function(_0xc587ed,_0x11cbc2){_0xc587ed=_0xc587ed-0x0;var _0x41d137=_0x78f5[_0xc587ed];return _0x41d137;};'use strict';var _=require(_0x578f('0x0'));var logger=require('../../../config/logger')(_0x578f('0x1'));var verticesWithRetry=[_0x578f('0x2'),_0x578f('0x3'),_0x578f('0x4')];var Graph=function(){this['vertices']={};this[_0x578f('0x5')]={};this[_0x578f('0x6')]=0x0;};Graph[_0x578f('0x7')]['addVertex']=function(_0x4eca1a){this['vertices'][_0x4eca1a['id']]=_0x4eca1a;this[_0x578f('0x5')][_0x4eca1a['id']]=[];};Graph[_0x578f('0x7')][_0x578f('0x8')]=function(_0x5b7d01,_0x789118,_0x5be866){this[_0x578f('0x5')][_0x5b7d01][_0x578f('0x9')]({'target':_0x789118,'condition':_0x5be866});this[_0x578f('0x6')]+=0x1;};Graph['prototype'][_0x578f('0xa')]=function(){return _[_0x578f('0xa')](this['vertices']);};Graph[_0x578f('0x7')][_0x578f('0xb')]=function(){return this[_0x578f('0x6')];};Graph[_0x578f('0x7')][_0x578f('0xc')]=function(_0x3c1382){return this['vertices'][_0x3c1382];};Graph[_0x578f('0x7')]['traverseBFS']=function(_0x410ea9,_0x23c092){if(!this['vertices'][_0x410ea9]){return logger[_0x578f('0xd')](_0x578f('0xe'));}var _0x13cf53=_0x23c092(this[_0x578f('0xf')][_0x410ea9]);if(!_0x13cf53){return logger[_0x578f('0xd')](_0x578f('0x10'));}if(this[_0x578f('0x5')][_0x410ea9][_0x578f('0x11')]===0x0){return logger[_0x578f('0xd')](_0x578f('0x12'));}for(var _0x287365=0x0,_0x49c139=[],_0x3b6e4b=![];_0x287365\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','traverseBFS','vertex','stringify','gotoc','context','extension','priority','agicommand','response','result','toString','agicommand\x20not\x20found','finally','[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','clear','isUndefined','[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','continueAt','Project\x20%s\x20not\x20published','getLicense','callysquare','[LICENSE]\x20CHANNELS:\x20UNLIMITED','[LICENSE]\x20VOICE\x20IS\x20DISABLED','[LICENSE]','./server','listening','connection','xml2json','lodash','syncho','util','moment','agi','../../config/license/util','./rpc','./vertices','defaults','127.0.0.1','nextTick','error','log','Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!','port','info','format','[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d','message','name','stack','[CLOSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','calleridname','callerid','uniqueid','arg_1','dnid','toJson','mxGraphModel','root'];(function(_0x2d2c16,_0x4e88b6){var _0x53f2fb=function(_0x6b6dac){while(--_0x6b6dac){_0x2d2c16['push'](_0x2d2c16['shift']());}};_0x53f2fb(++_0x4e88b6);}(_0x2ad6,0x87));var _0x62ad=function(_0x4679e1,_0x13d56f){_0x4679e1=_0x4679e1-0x0;var _0x4bd60d=_0x2ad6[_0x4679e1];return _0x4bd60d;};'use strict';var parser=require(_0x62ad('0x0'));var _=require(_0x62ad('0x1'));var syncho=require(_0x62ad('0x2'));var util=require(_0x62ad('0x3'));var moment=require(_0x62ad('0x4'));var config=require('../../config/environment');var logger=require('../../config/logger')(_0x62ad('0x5'));var utilLicense=require(_0x62ad('0x6'));var rpc=require(_0x62ad('0x7'));var mailRpc=require('./mailRpc');var Graph=require('./graph');var Vertices=require(_0x62ad('0x8'));var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;config[_0x62ad('0x5')]=_[_0x62ad('0x9')](config['agi'],{'ip':_0x62ad('0xa'),'port':0x11dd});function connectionHandler(_0x28e4c6){process[_0x62ad('0xb')](function(){syncho(function(){try{setChannelVariables(_0x28e4c6);agiHandler(_0x28e4c6);}catch(_0x215550){logger[_0x62ad('0xc')](_0x215550['stack']);}});});}function listeningHandler(){console[_0x62ad('0xd')](_0x62ad('0xe'),config[_0x62ad('0x5')][_0x62ad('0xf')]);logger[_0x62ad('0x10')](util[_0x62ad('0x11')](_0x62ad('0x12'),config[_0x62ad('0x5')]['ip'],config[_0x62ad('0x5')][_0x62ad('0xf')]));}function errorHandler(_0x1b7f1f){if(_0x1b7f1f&&_0x1b7f1f['name']&&_0x1b7f1f[_0x62ad('0x13')]){logger[_0x62ad('0xc')](util[_0x62ad('0x11')]('[%s]\x20%s',_0x1b7f1f[_0x62ad('0x14')],_0x1b7f1f[_0x62ad('0x13')]));}else{logger[_0x62ad('0xc')](util['format']('[ERROR]\x20%s',_0x1b7f1f[_0x62ad('0x15')]));}}function closeHandler(){logger['info'](util[_0x62ad('0x11')](_0x62ad('0x16'),this['arg_1'],this[_0x62ad('0x17')],this[_0x62ad('0x18')],this['dnid'],this[_0x62ad('0x19')]));try{createSquareReport(this);}catch(_0x299ace){logger[_0x62ad('0xc')](_0x299ace['stack']);}}function timeoutHandler(){logger[_0x62ad('0x10')](util[_0x62ad('0x11')]('[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',this[_0x62ad('0x1a')],this['calleridname'],this[_0x62ad('0x18')],this[_0x62ad('0x1b')],this[_0x62ad('0x19')]));}function hangupHandler(){logger['info'](util['format']('[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',this[_0x62ad('0x1a')],this[_0x62ad('0x17')],this['callerid'],this[_0x62ad('0x1b')],this[_0x62ad('0x19')]));this['evtHangup']=!![];}function getRoot(_0x3ad428){return parser[_0x62ad('0x1c')](_0x3ad428,{'object':!![]})[_0x62ad('0x1d')][_0x62ad('0x1e')];}function addVertex(_0x54a8b1,_0x39b684,_0x1e0222){_0x39b684['agicommand']=_0x1e0222;if(_0x39b684['hasOwnProperty'](_0x62ad('0x1f'))){_0x39b684['maxRetry']=parseInt(_0x39b684[_0x62ad('0x1f')],0xa);}_0x54a8b1[_0x62ad('0x20')](_[_0x62ad('0x21')](_0x39b684,_0x62ad('0x22')));}function initGraph(_0x52ccc7,_0x3317a5){var _0x90d3aa=new Graph();for(var _0xc4d965 in _0x52ccc7){if(_0x52ccc7[_0x62ad('0x23')](_0xc4d965)){if(_['isArray'](_0x52ccc7[_0xc4d965])){for(var _0x51db74=0x0;_0x51db74<_0x52ccc7[_0xc4d965][_0x62ad('0x24')];_0x51db74+=0x1){addVertex(_0x90d3aa,_0x52ccc7[_0xc4d965][_0x51db74],_0xc4d965);}}else{addVertex(_0x90d3aa,_0x52ccc7[_0xc4d965],_0xc4d965);}}}for(var _0xb894a1=0x0;_0xb894a1<_0x3317a5[_0x62ad('0x24')];_0xb894a1+=0x1){if(_0x3317a5[_0xb894a1]['source']&&_0x3317a5[_0xb894a1][_0x62ad('0x25')]){_0x90d3aa[_0x62ad('0x26')](_0x3317a5[_0xb894a1][_0x62ad('0x27')],_0x3317a5[_0xb894a1][_0x62ad('0x25')],_0x3317a5[_0xb894a1][_0x62ad('0x28')]);}}return _0x90d3aa;}function getSquareProject(_0x2a86d5,_0x243a2a){rpc['getSquareProject'](_0x2a86d5)[_0x62ad('0x29')](function(_0x25cb88){_0x243a2a(null,_0x25cb88);})['catch'](function(_0x5c8018){_0x243a2a(null,_0x5c8018);});}function createSquareReport(_0xbe012d,_0x1929ba){rpc[_0x62ad('0x2a')](_0xbe012d)['then'](function(_0x13ce32){if(_0x1929ba){_0x1929ba(null,_0x13ce32);}})[_0x62ad('0x2b')](function(_0x19b3c0){if(_0x1929ba){_0x1929ba(null,_0x19b3c0);}});}function setChannelVariables(_0x3a3985){for(var _0x5449ea in _0x3a3985){if(_0x3a3985[_0x62ad('0x23')](_0x5449ea)){if(_0x5449ea[_0x62ad('0x2c')](_0x62ad('0x2d'))===0x0){_0x3a3985[_0x5449ea['substring'](0x4)]=_0x3a3985[_0x5449ea];delete _0x3a3985[_0x5449ea];}}}}function getLogFromObject(_0x34aec0){return util[_0x62ad('0x2e')](_0x34aec0,{'showHidden':![],'depth':null});}function agiHandler(_0x56ec5b){var _0x50a201,_0x37883a,_0x4239eb,_0x2ddf8e,_0x1cf4cb;logger[_0x62ad('0x2f')](_0x62ad('0x30'),JSON['stringify'](_0x56ec5b,null,0x2));logger['info'](util[_0x62ad('0x11')]('[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x56ec5b[_0x62ad('0x1a')],_0x56ec5b['calleridname'],_0x56ec5b[_0x62ad('0x18')],_0x56ec5b[_0x62ad('0x1b')],_0x56ec5b[_0x62ad('0x19')]));_0x56ec5b['on'](_0x62ad('0xc'),errorHandler);_0x56ec5b['on'](_0x62ad('0x31'),closeHandler);_0x56ec5b['on'](_0x62ad('0x32'),timeoutHandler);_0x56ec5b[_0x62ad('0x33')]=![];_0x56ec5b['on'](_0x62ad('0x34'),hangupHandler);var _0xace581=getSquareProject[_0x62ad('0x35')](null,_0x56ec5b[_0x62ad('0x1a')]);if(_0xace581){if(_0xace581[_0x62ad('0x36')]){_0x50a201=getRoot(_0xace581['production']);if(_0x50a201&&_0x50a201['start']){logger[_0x62ad('0x2f')]('root',JSON['stringify'](_0x50a201,null,0x2));_0x56ec5b['joinAt']=moment()[_0x62ad('0x11')]('YYYY-MM-DD\x20HH:mm:ss');_0x37883a=initGraph(_[_0x62ad('0x21')](_0x50a201,'mxCell'),_0x50a201[_0x62ad('0x22')]);_0x4239eb=new Vertices(_0x56ec5b,rpc,mailRpc);logger['info'](util[_0x62ad('0x11')](_0x62ad('0x37'),_0x56ec5b[_0x62ad('0x1a')],_0x56ec5b[_0x62ad('0x17')],_0x56ec5b[_0x62ad('0x18')],_0x56ec5b[_0x62ad('0x1b')],_0x56ec5b['uniqueid']));_0x37883a[_0x62ad('0x38')](_0x50a201['start']['id'],function(_0x368bb9){try{_0x368bb9=_0x4239eb['clear'](_0x368bb9);logger[_0x62ad('0x2f')](_0x62ad('0x39'),JSON[_0x62ad('0x3a')](_0x368bb9,null,0x2));if(_0x368bb9['agicommand']===_0x62ad('0x3b')){logger[_0x62ad('0x10')]('gotoc\x20block\x20stop\x20traverse\x20BFS');_0x56ec5b[_0x62ad('0x3c')]=_0x368bb9[_0x62ad('0x3c')]||_0x56ec5b[_0x62ad('0x3c')];_0x56ec5b[_0x62ad('0x3d')]=_0x368bb9['extension'];_0x56ec5b[_0x62ad('0x3e')]=_0x368bb9['priority']?_0x368bb9[_0x62ad('0x3e')]-0x1:0x1;return null;}else if(_0x368bb9&&_0x4239eb[_0x368bb9['agicommand']]){_0x1cf4cb=_0x4239eb[_0x368bb9[_0x62ad('0x3f')]](_0x368bb9);logger[_0x62ad('0x10')](_0x62ad('0x40'),JSON[_0x62ad('0x3a')](_0x1cf4cb,null,0x2));if(_0x1cf4cb&&_0x1cf4cb['code']===AGI_CODE_SUCCESS&&_0x1cf4cb[_0x62ad('0x41')]!==AGI_RESULT_ERROR&&!_0x56ec5b['evtHangup']){logger[_0x62ad('0x2f')](_0x62ad('0x40'),getLogFromObject(_0x1cf4cb));return _['isUndefined'](_0x1cf4cb[_0x62ad('0x41')])?null:_0x1cf4cb[_0x62ad('0x41')][_0x62ad('0x42')]();}else{logger['error'](_0x62ad('0x40'),getLogFromObject(_0x1cf4cb));return null;}}else{logger['error'](_0x62ad('0x43'));return null;}}catch(_0x38038d){logger[_0x62ad('0xc')](_0x38038d[_0x62ad('0x15')]);return null;}});if(_0x50a201[_0x62ad('0x44')]){logger['info'](util[_0x62ad('0x11')](_0x62ad('0x45'),_0x56ec5b[_0x62ad('0x1a')],_0x56ec5b[_0x62ad('0x17')],_0x56ec5b[_0x62ad('0x18')],_0x56ec5b['dnid'],_0x56ec5b[_0x62ad('0x19')]));_0x37883a[_0x62ad('0x38')](_0x50a201['finally']['id'],function(_0x2b542a){try{_0x2b542a=_0x4239eb[_0x62ad('0x46')](_0x2b542a);logger[_0x62ad('0x2f')](_0x62ad('0x39'),JSON['stringify'](_0x2b542a,null,0x2));if(_0x2b542a&&_0x4239eb[_0x2b542a[_0x62ad('0x3f')]]){_0x1cf4cb=_0x4239eb[_0x2b542a[_0x62ad('0x3f')]](_0x2b542a);if(_0x1cf4cb){logger[_0x62ad('0x2f')](_0x62ad('0x40'),getLogFromObject(_0x1cf4cb));return _[_0x62ad('0x47')](_0x1cf4cb[_0x62ad('0x41')])?null:_0x1cf4cb['result'][_0x62ad('0x42')]();}else{logger[_0x62ad('0xc')](_0x62ad('0x40'),getLogFromObject(_0x1cf4cb));return null;}}else{logger[_0x62ad('0xc')](_0x62ad('0x43'));return null;}}catch(_0x546403){logger[_0x62ad('0xc')](_0x546403[_0x62ad('0x15')]);return null;}});}logger['info'](util[_0x62ad('0x11')](_0x62ad('0x48'),_0x56ec5b[_0x62ad('0x1a')],_0x56ec5b['calleridname'],_0x56ec5b['callerid'],_0x56ec5b[_0x62ad('0x1b')],_0x56ec5b[_0x62ad('0x19')]));logger[_0x62ad('0x10')](util[_0x62ad('0x11')]('[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s',_0x56ec5b[_0x62ad('0x3c')],_0x56ec5b[_0x62ad('0x3d')],parseInt(_0x56ec5b[_0x62ad('0x3e')],0xa)+0x1));_0x56ec5b[_0x62ad('0x49')](_0x56ec5b[_0x62ad('0x3c')],_0x56ec5b[_0x62ad('0x3d')],parseInt(_0x56ec5b[_0x62ad('0x3e')],0xa)+0x1);_0x56ec5b['close']();}}else{logger['error'](util[_0x62ad('0x11')](_0x62ad('0x4a'),_0x56ec5b['arg_1']));_0x56ec5b[_0x62ad('0x49')](_0x56ec5b['context'],_0x56ec5b[_0x62ad('0x3d')],parseInt(_0x56ec5b['priority'],0xa)+0x1);_0x56ec5b[_0x62ad('0x31')]();}}else{logger[_0x62ad('0xc')](util[_0x62ad('0x11')]('Project\x20%s\x20not\x20found',_0x56ec5b[_0x62ad('0x1a')]));_0x56ec5b['continueAt'](_0x56ec5b[_0x62ad('0x3c')],_0x56ec5b['extension'],parseInt(_0x56ec5b[_0x62ad('0x3e')],0xa)+0x1);_0x56ec5b[_0x62ad('0x31')]();}}function main(){var _0x3deb0f;return utilLicense[_0x62ad('0x4b')]()['then'](function(_0x5d3e5e){if(_0x5d3e5e){if(_0x5d3e5e['voice']){if(_0x5d3e5e['callysquare']&&_0x5d3e5e[_0x62ad('0x4c')]>0x0){logger[_0x62ad('0x10')](util[_0x62ad('0x11')]('[LICENSE]\x20CHANNELS:\x20%s',_0x5d3e5e['callysquare']));_0x3deb0f=_0x5d3e5e[_0x62ad('0x4c')];}else{logger[_0x62ad('0x10')](_0x62ad('0x4d'));}}else{logger[_0x62ad('0x10')](_0x62ad('0x4e'));_0x3deb0f=-0x1;}}})[_0x62ad('0x2b')](function(_0x2f6b5a){logger[_0x62ad('0xc')](_0x62ad('0x4f'),_0x2f6b5a[_0x62ad('0x15')]);})[_0x62ad('0x44')](function(){var _0x2e4028=require(_0x62ad('0x50'))(config[_0x62ad('0x5')][_0x62ad('0xf')],config[_0x62ad('0x5')]['ip'],_0x3deb0f);_0x2e4028['on']('error',errorHandler);_0x2e4028['on'](_0x62ad('0x51'),listeningHandler);_0x2e4028['on'](_0x62ad('0x52'),connectionHandler);_0x2e4028['on'](_0x62ad('0x31'),closeHandler);});}main(); \ No newline at end of file +var _0x8b10=['defaults','127.0.0.1','nextTick','error','stack','Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!','port','info','format','[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d','message','[%s]\x20%s','name','[ERROR]\x20%s','arg_1','calleridname','dnid','uniqueid','[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','root','agicommand','hasOwnProperty','retry','maxRetry','addVertex','omit','mxCell','length','source','target','value','getSquareProject','then','createSquareReport','catch','indexOf','substring','inspect','debug','stringify','callerid','close','timeout','evtHangup','hangup','sync','production','start','YYYY-MM-DD\x20HH:mm:ss','traverseBFS','clear','vertex','context','extension','priority','response','code','result','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','[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s','continueAt','Project\x20%s\x20not\x20published','callysquare','[LICENSE]\x20CHANNELS:\x20%s','[LICENSE]\x20CHANNELS:\x20UNLIMITED','[LICENSE]','./server','listening','connection','lodash','syncho','../../config/logger','agi','../../config/license/util','./rpc','./mailRpc'];(function(_0x201280,_0x40f8d9){var _0x2bfba4=function(_0x4136c1){while(--_0x4136c1){_0x201280['push'](_0x201280['shift']());}};_0x2bfba4(++_0x40f8d9);}(_0x8b10,0x18e));var _0x08b1=function(_0x33fddf,_0x4e9276){_0x33fddf=_0x33fddf-0x0;var _0x1c4519=_0x8b10[_0x33fddf];return _0x1c4519;};'use strict';var parser=require('xml2json');var _=require(_0x08b1('0x0'));var syncho=require(_0x08b1('0x1'));var util=require('util');var moment=require('moment');var config=require('../../config/environment');var logger=require(_0x08b1('0x2'))(_0x08b1('0x3'));var utilLicense=require(_0x08b1('0x4'));var rpc=require(_0x08b1('0x5'));var mailRpc=require(_0x08b1('0x6'));var Graph=require('./graph');var Vertices=require('./vertices');var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;config[_0x08b1('0x3')]=_[_0x08b1('0x7')](config['agi'],{'ip':_0x08b1('0x8'),'port':0x11dd});function connectionHandler(_0x1ef7ec){process[_0x08b1('0x9')](function(){syncho(function(){try{setChannelVariables(_0x1ef7ec);agiHandler(_0x1ef7ec);}catch(_0x3018c0){logger[_0x08b1('0xa')](_0x3018c0[_0x08b1('0xb')]);}});});}function listeningHandler(){console['log'](_0x08b1('0xc'),config['agi'][_0x08b1('0xd')]);logger[_0x08b1('0xe')](util[_0x08b1('0xf')](_0x08b1('0x10'),config[_0x08b1('0x3')]['ip'],config['agi'][_0x08b1('0xd')]));}function errorHandler(_0x35d6b2){if(_0x35d6b2&&_0x35d6b2['name']&&_0x35d6b2[_0x08b1('0x11')]){logger[_0x08b1('0xa')](util[_0x08b1('0xf')](_0x08b1('0x12'),_0x35d6b2[_0x08b1('0x13')],_0x35d6b2['message']));}else{logger[_0x08b1('0xa')](util['format'](_0x08b1('0x14'),_0x35d6b2[_0x08b1('0xb')]));}}function closeHandler(){logger[_0x08b1('0xe')](util['format']('[CLOSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',this[_0x08b1('0x15')],this[_0x08b1('0x16')],this['callerid'],this[_0x08b1('0x17')],this[_0x08b1('0x18')]));try{createSquareReport(this);}catch(_0x8297e3){logger[_0x08b1('0xa')](_0x8297e3['stack']);}}function timeoutHandler(){logger[_0x08b1('0xe')](util[_0x08b1('0xf')](_0x08b1('0x19'),this[_0x08b1('0x15')],this[_0x08b1('0x16')],this['callerid'],this[_0x08b1('0x17')],this[_0x08b1('0x18')]));}function hangupHandler(){logger[_0x08b1('0xe')](util[_0x08b1('0xf')](_0x08b1('0x1a'),this[_0x08b1('0x15')],this['calleridname'],this['callerid'],this[_0x08b1('0x17')],this['uniqueid']));this['evtHangup']=!![];}function getRoot(_0x1279db){return parser['toJson'](_0x1279db,{'object':!![]})['mxGraphModel'][_0x08b1('0x1b')];}function addVertex(_0x59514b,_0xba17b5,_0xa68e25){_0xba17b5[_0x08b1('0x1c')]=_0xa68e25;if(_0xba17b5[_0x08b1('0x1d')](_0x08b1('0x1e'))){_0xba17b5[_0x08b1('0x1f')]=parseInt(_0xba17b5[_0x08b1('0x1e')],0xa);}_0x59514b[_0x08b1('0x20')](_[_0x08b1('0x21')](_0xba17b5,_0x08b1('0x22')));}function initGraph(_0x202d09,_0x3c1af2){var _0x48180c=new Graph();for(var _0x231c11 in _0x202d09){if(_0x202d09['hasOwnProperty'](_0x231c11)){if(_['isArray'](_0x202d09[_0x231c11])){for(var _0x221682=0x0;_0x221682<_0x202d09[_0x231c11][_0x08b1('0x23')];_0x221682+=0x1){addVertex(_0x48180c,_0x202d09[_0x231c11][_0x221682],_0x231c11);}}else{addVertex(_0x48180c,_0x202d09[_0x231c11],_0x231c11);}}}for(var _0x3f413c=0x0;_0x3f413c<_0x3c1af2['length'];_0x3f413c+=0x1){if(_0x3c1af2[_0x3f413c][_0x08b1('0x24')]&&_0x3c1af2[_0x3f413c]['target']){_0x48180c['addEdge'](_0x3c1af2[_0x3f413c][_0x08b1('0x24')],_0x3c1af2[_0x3f413c][_0x08b1('0x25')],_0x3c1af2[_0x3f413c][_0x08b1('0x26')]);}}return _0x48180c;}function getSquareProject(_0x14d3a0,_0x265c6a){rpc[_0x08b1('0x27')](_0x14d3a0)[_0x08b1('0x28')](function(_0x4e1d9d){_0x265c6a(null,_0x4e1d9d);})['catch'](function(_0x41caaf){_0x265c6a(null,_0x41caaf);});}function createSquareReport(_0x45e891,_0x41b829){rpc[_0x08b1('0x29')](_0x45e891)[_0x08b1('0x28')](function(_0x137e46){if(_0x41b829){_0x41b829(null,_0x137e46);}})[_0x08b1('0x2a')](function(_0x40bfa8){if(_0x41b829){_0x41b829(null,_0x40bfa8);}});}function setChannelVariables(_0x4e6190){for(var _0xbd0ee8 in _0x4e6190){if(_0x4e6190[_0x08b1('0x1d')](_0xbd0ee8)){if(_0xbd0ee8[_0x08b1('0x2b')]('agi_')===0x0){_0x4e6190[_0xbd0ee8[_0x08b1('0x2c')](0x4)]=_0x4e6190[_0xbd0ee8];delete _0x4e6190[_0xbd0ee8];}}}}function getLogFromObject(_0x1dc5e8){return util[_0x08b1('0x2d')](_0x1dc5e8,{'showHidden':![],'depth':null});}function agiHandler(_0x4b72a8){var _0x236f31,_0x14eaf2,_0x5f016c,_0x157690,_0x7e1b1a;logger[_0x08b1('0x2e')]('variables',JSON[_0x08b1('0x2f')](_0x4b72a8,null,0x2));logger[_0x08b1('0xe')](util['format']('[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x4b72a8[_0x08b1('0x15')],_0x4b72a8[_0x08b1('0x16')],_0x4b72a8[_0x08b1('0x30')],_0x4b72a8[_0x08b1('0x17')],_0x4b72a8[_0x08b1('0x18')]));_0x4b72a8['on'](_0x08b1('0xa'),errorHandler);_0x4b72a8['on'](_0x08b1('0x31'),closeHandler);_0x4b72a8['on'](_0x08b1('0x32'),timeoutHandler);_0x4b72a8[_0x08b1('0x33')]=![];_0x4b72a8['on'](_0x08b1('0x34'),hangupHandler);var _0x5d8084=getSquareProject[_0x08b1('0x35')](null,_0x4b72a8[_0x08b1('0x15')]);if(_0x5d8084){if(_0x5d8084[_0x08b1('0x36')]){_0x236f31=getRoot(_0x5d8084['production']);if(_0x236f31&&_0x236f31[_0x08b1('0x37')]){logger[_0x08b1('0x2e')]('root',JSON[_0x08b1('0x2f')](_0x236f31,null,0x2));_0x4b72a8['joinAt']=moment()[_0x08b1('0xf')](_0x08b1('0x38'));_0x14eaf2=initGraph(_[_0x08b1('0x21')](_0x236f31,_0x08b1('0x22')),_0x236f31[_0x08b1('0x22')]);_0x5f016c=new Vertices(_0x4b72a8,rpc,mailRpc);logger[_0x08b1('0xe')](util[_0x08b1('0xf')]('[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x4b72a8['arg_1'],_0x4b72a8[_0x08b1('0x16')],_0x4b72a8['callerid'],_0x4b72a8['dnid'],_0x4b72a8['uniqueid']));_0x14eaf2[_0x08b1('0x39')](_0x236f31[_0x08b1('0x37')]['id'],function(_0x18a146){try{_0x18a146=_0x5f016c[_0x08b1('0x3a')](_0x18a146);logger[_0x08b1('0x2e')](_0x08b1('0x3b'),JSON['stringify'](_0x18a146,null,0x2));if(_0x18a146[_0x08b1('0x1c')]==='gotoc'){logger[_0x08b1('0xe')]('gotoc\x20block\x20stop\x20traverse\x20BFS');_0x4b72a8['context']=_0x18a146['context']||_0x4b72a8[_0x08b1('0x3c')];_0x4b72a8[_0x08b1('0x3d')]=_0x18a146[_0x08b1('0x3d')];_0x4b72a8[_0x08b1('0x3e')]=_0x18a146[_0x08b1('0x3e')]?_0x18a146[_0x08b1('0x3e')]-0x1:0x1;return null;}else if(_0x18a146&&_0x5f016c[_0x18a146[_0x08b1('0x1c')]]){_0x7e1b1a=_0x5f016c[_0x18a146[_0x08b1('0x1c')]](_0x18a146);logger[_0x08b1('0xe')](_0x08b1('0x3f'),JSON[_0x08b1('0x2f')](_0x7e1b1a,null,0x2));if(_0x7e1b1a&&_0x7e1b1a[_0x08b1('0x40')]===AGI_CODE_SUCCESS&&_0x7e1b1a[_0x08b1('0x41')]!==AGI_RESULT_ERROR&&!_0x4b72a8['evtHangup']){logger['debug'](_0x08b1('0x3f'),getLogFromObject(_0x7e1b1a));return _['isUndefined'](_0x7e1b1a[_0x08b1('0x41')])?null:_0x7e1b1a[_0x08b1('0x41')]['toString']();}else{logger[_0x08b1('0xa')](_0x08b1('0x3f'),getLogFromObject(_0x7e1b1a));return null;}}else{logger[_0x08b1('0xa')]('agicommand\x20not\x20found');return null;}}catch(_0x5e98e7){logger['error'](_0x5e98e7['stack']);return null;}});if(_0x236f31[_0x08b1('0x42')]){logger[_0x08b1('0xe')](util[_0x08b1('0xf')](_0x08b1('0x43'),_0x4b72a8[_0x08b1('0x15')],_0x4b72a8[_0x08b1('0x16')],_0x4b72a8[_0x08b1('0x30')],_0x4b72a8[_0x08b1('0x17')],_0x4b72a8[_0x08b1('0x18')]));_0x14eaf2['traverseBFS'](_0x236f31['finally']['id'],function(_0x404008){try{_0x404008=_0x5f016c[_0x08b1('0x3a')](_0x404008);logger['debug'](_0x08b1('0x3b'),JSON[_0x08b1('0x2f')](_0x404008,null,0x2));if(_0x404008&&_0x5f016c[_0x404008[_0x08b1('0x1c')]]){_0x7e1b1a=_0x5f016c[_0x404008['agicommand']](_0x404008);if(_0x7e1b1a){logger['debug']('response',getLogFromObject(_0x7e1b1a));return _['isUndefined'](_0x7e1b1a['result'])?null:_0x7e1b1a[_0x08b1('0x41')][_0x08b1('0x44')]();}else{logger['error'](_0x08b1('0x3f'),getLogFromObject(_0x7e1b1a));return null;}}else{logger[_0x08b1('0xa')](_0x08b1('0x45'));return null;}}catch(_0x57f5ce){logger[_0x08b1('0xa')](_0x57f5ce[_0x08b1('0xb')]);return null;}});}logger['info'](util[_0x08b1('0xf')](_0x08b1('0x46'),_0x4b72a8[_0x08b1('0x15')],_0x4b72a8['calleridname'],_0x4b72a8[_0x08b1('0x30')],_0x4b72a8[_0x08b1('0x17')],_0x4b72a8[_0x08b1('0x18')]));logger[_0x08b1('0xe')](util[_0x08b1('0xf')](_0x08b1('0x47'),_0x4b72a8[_0x08b1('0x3c')],_0x4b72a8['extension'],parseInt(_0x4b72a8[_0x08b1('0x3e')],0xa)+0x1));_0x4b72a8[_0x08b1('0x48')](_0x4b72a8['context'],_0x4b72a8['extension'],parseInt(_0x4b72a8[_0x08b1('0x3e')],0xa)+0x1);_0x4b72a8['close']();}}else{logger[_0x08b1('0xa')](util['format'](_0x08b1('0x49'),_0x4b72a8['arg_1']));_0x4b72a8['continueAt'](_0x4b72a8['context'],_0x4b72a8[_0x08b1('0x3d')],parseInt(_0x4b72a8['priority'],0xa)+0x1);_0x4b72a8[_0x08b1('0x31')]();}}else{logger[_0x08b1('0xa')](util[_0x08b1('0xf')]('Project\x20%s\x20not\x20found',_0x4b72a8[_0x08b1('0x15')]));_0x4b72a8[_0x08b1('0x48')](_0x4b72a8[_0x08b1('0x3c')],_0x4b72a8['extension'],parseInt(_0x4b72a8['priority'],0xa)+0x1);_0x4b72a8[_0x08b1('0x31')]();}}function main(){var _0x1a1f67;return utilLicense['getLicense']()[_0x08b1('0x28')](function(_0x79cb95){if(_0x79cb95){if(_0x79cb95['voice']){if(_0x79cb95[_0x08b1('0x4a')]&&_0x79cb95[_0x08b1('0x4a')]>0x0){logger[_0x08b1('0xe')](util[_0x08b1('0xf')](_0x08b1('0x4b'),_0x79cb95[_0x08b1('0x4a')]));_0x1a1f67=_0x79cb95[_0x08b1('0x4a')];}else{logger[_0x08b1('0xe')](_0x08b1('0x4c'));}}else{logger[_0x08b1('0xe')]('[LICENSE]\x20VOICE\x20IS\x20DISABLED');_0x1a1f67=-0x1;}}})[_0x08b1('0x2a')](function(_0x24a463){logger[_0x08b1('0xa')](_0x08b1('0x4d'),_0x24a463[_0x08b1('0xb')]);})['finally'](function(){var _0x311b36=require(_0x08b1('0x4e'))(config[_0x08b1('0x3')][_0x08b1('0xd')],config[_0x08b1('0x3')]['ip'],_0x1a1f67);_0x311b36['on'](_0x08b1('0xa'),errorHandler);_0x311b36['on'](_0x08b1('0x4f'),listeningHandler);_0x311b36['on'](_0x08b1('0x50'),connectionHandler);_0x311b36['on'](_0x08b1('0x31'),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 baf9945..9162e8f 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 _0xab12=['bluebird','client','http','request','then','error','message','result','catch','SendMail'];(function(_0x4f8f3b,_0x43281b){var _0x4c250c=function(_0x19a7ff){while(--_0x19a7ff){_0x4f8f3b['push'](_0x4f8f3b['shift']());}};_0x4c250c(++_0x43281b);}(_0xab12,0x19a));var _0x2ab1=function(_0x4dfeb0,_0x4805cb){_0x4dfeb0=_0x4dfeb0-0x0;var _0x25330b=_0xab12[_0x4dfeb0];return _0x25330b;};'use strict';var BPromise=require(_0x2ab1('0x0'));var jayson=require('jayson/promise');var client=jayson[_0x2ab1('0x1')][_0x2ab1('0x2')]({'port':0x232b});function request(_0x5cf9b7,_0x138cbe){return new BPromise(function(_0x5f4949,_0x5888e4){return client[_0x2ab1('0x3')](_0x5cf9b7,_0x138cbe)[_0x2ab1('0x4')](function(_0x1bcffc){if(_0x1bcffc[_0x2ab1('0x5')]){return _0x5888e4(_0x1bcffc[_0x2ab1('0x5')][_0x2ab1('0x6')]);}else{return _0x5f4949(_0x1bcffc[_0x2ab1('0x7')]);}})[_0x2ab1('0x8')](function(_0x26d61a){return _0x5888e4(_0x26d61a);});});}exports['sendMailMessage']=function(_0x2d5b44,_0x1af1fe){return request(_0x2ab1('0x9'),{'account':_0x2d5b44,'message':_0x1af1fe});}; \ No newline at end of file +var _0x8cdd=['sendMailMessage','SendMail','bluebird','http','request','then','error','message','result','catch'];(function(_0x5eb3a5,_0x5cc120){var _0xd529ab=function(_0x1dc5f5){while(--_0x1dc5f5){_0x5eb3a5['push'](_0x5eb3a5['shift']());}};_0xd529ab(++_0x5cc120);}(_0x8cdd,0x98));var _0xd8cd=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x8cdd[_0x3b380d];return _0x54502b;};'use strict';var BPromise=require(_0xd8cd('0x0'));var jayson=require('jayson/promise');var client=jayson['client'][_0xd8cd('0x1')]({'port':0x232b});function request(_0x3ed97a,_0x552dca){return new BPromise(function(_0x1e5837,_0x141301){return client[_0xd8cd('0x2')](_0x3ed97a,_0x552dca)[_0xd8cd('0x3')](function(_0x5159f6){if(_0x5159f6[_0xd8cd('0x4')]){return _0x141301(_0x5159f6[_0xd8cd('0x4')][_0xd8cd('0x5')]);}else{return _0x1e5837(_0x5159f6[_0xd8cd('0x6')]);}})[_0xd8cd('0x7')](function(_0x2a3f0e){return _0x141301(_0x2a3f0e);});});}exports[_0xd8cd('0x8')]=function(_0x38ede7,_0x281960){return request(_0xd8cd('0x9'),{'account':_0x38ede7,'message':_0x281960});}; \ No newline at end of file diff --git a/server/services/agi/reply.js b/server/services/agi/reply.js index 1c5c41e..91d46e8 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 _0x188d=['split','slice','trim','length','headers','line','exports','call','_localBuffer','inherits','_transform','\x0d\x0a\x0d\x0a','toString','_inBody','indexOf','substring'];(function(_0x373ba3,_0x265ccc){var _0x151f21=function(_0x35f419){while(--_0x35f419){_0x373ba3['push'](_0x373ba3['shift']());}};_0x151f21(++_0x265ccc);}(_0x188d,0x77));var _0xd188=function(_0x1db562,_0x290e26){_0x1db562=_0x1db562-0x0;var _0xa58473=_0x188d[_0x1db562];return _0xa58473;};'use strict';var util=require('util');var Transform=require('stream')['Transform'];function AGIReply(_0x2c5c50){Transform[_0xd188('0x0')](this,_0x2c5c50);this[_0xd188('0x1')]='';this['_inBody']=![];}util[_0xd188('0x2')](AGIReply,Transform);AGIReply['prototype'][_0xd188('0x3')]=function(_0x46190b,_0x30de1a,_0x3ff489){var _0x509d61='\x0a',_0x599d82=['\x0a\x0a',_0xd188('0x4')],_0x20b65d=-0x1,_0x3f48a9=-0x1,_0x3c1ec5='',_0x319eb0=0x0,_0x153720='',_0x412f13='';this['_localBuffer']+=_0x46190b[_0xd188('0x5')]();_0x153720=this[_0xd188('0x1')];if(!this[_0xd188('0x6')]){_0x319eb0=0x0;while(_0x599d82[_0x319eb0]){while((_0x3f48a9=_0x153720[_0xd188('0x7')](_0x599d82[_0x319eb0]))!=-0x1){_0x3c1ec5=_0x599d82[_0x319eb0];_0x412f13=_0x153720[_0xd188('0x8')](0x0,_0x3f48a9);_0x153720=_0x153720[_0xd188('0x8')](_0x3f48a9+_0x3c1ec5['length']);var _0x1c688a=_0x412f13[_0xd188('0x9')](_0x509d61),_0x1cb4c3=0x0,_0x26bbd4={},_0xc73f47='',_0x23085b='',_0x550256=-0x1;while(_0x1c688a[_0x1cb4c3]){_0x550256=_0x1c688a[_0x1cb4c3][_0xd188('0x7')](':');if(_0x550256!=-0x1){_0xc73f47=_0x1c688a[_0x1cb4c3][_0xd188('0xa')](0x0,_0x550256)[_0xd188('0xb')]();_0x23085b=_0x1c688a[_0x1cb4c3][_0xd188('0xa')](_0x550256+0x1)[_0xd188('0xb')]();if(_0xc73f47[_0xd188('0xc')]>0x0){_0x26bbd4[_0xc73f47]=_0x23085b;}}else{}_0x1cb4c3++;}this['emit'](_0xd188('0xd'),_0x26bbd4);this['_inBody']=!![];}_0x319eb0++;}this[_0xd188('0x1')]=_0x153720;}else{while((_0x20b65d=_0x153720[_0xd188('0x7')](_0x509d61))!=-0x1){_0x412f13=_0x153720['substring'](0x0,_0x20b65d);this['emit'](_0xd188('0xe'),_0x412f13);_0x153720=_0x153720['substring'](_0x20b65d+_0x509d61[_0xd188('0xc')]);}this[_0xd188('0x1')]=_0x153720;}_0x3ff489();};module[_0xd188('0xf')]=AGIReply; \ No newline at end of file +var _0x1543=['call','_localBuffer','_inBody','prototype','_transform','\x0d\x0a\x0d\x0a','toString','indexOf','substring','length','split','slice','trim','emit','line','exports','util','stream','Transform'];(function(_0x3ab11a,_0x39737e){var _0x17e999=function(_0x5c6de4){while(--_0x5c6de4){_0x3ab11a['push'](_0x3ab11a['shift']());}};_0x17e999(++_0x39737e);}(_0x1543,0x1c5));var _0x3154=function(_0x311648,_0x50034f){_0x311648=_0x311648-0x0;var _0x256eb1=_0x1543[_0x311648];return _0x256eb1;};'use strict';var util=require(_0x3154('0x0'));var Transform=require(_0x3154('0x1'))[_0x3154('0x2')];function AGIReply(_0x361194){Transform[_0x3154('0x3')](this,_0x361194);this[_0x3154('0x4')]='';this[_0x3154('0x5')]=![];}util['inherits'](AGIReply,Transform);AGIReply[_0x3154('0x6')][_0x3154('0x7')]=function(_0x2bbb0e,_0x43c252,_0x37c77d){var _0x331b37='\x0a',_0xa8b04a=['\x0a\x0a',_0x3154('0x8')],_0x1c51c5=-0x1,_0x3fe198=-0x1,_0xcb65f7='',_0x5bcbff=0x0,_0x1aebde='',_0x1dbf35='';this[_0x3154('0x4')]+=_0x2bbb0e[_0x3154('0x9')]();_0x1aebde=this['_localBuffer'];if(!this['_inBody']){_0x5bcbff=0x0;while(_0xa8b04a[_0x5bcbff]){while((_0x3fe198=_0x1aebde[_0x3154('0xa')](_0xa8b04a[_0x5bcbff]))!=-0x1){_0xcb65f7=_0xa8b04a[_0x5bcbff];_0x1dbf35=_0x1aebde[_0x3154('0xb')](0x0,_0x3fe198);_0x1aebde=_0x1aebde[_0x3154('0xb')](_0x3fe198+_0xcb65f7[_0x3154('0xc')]);var _0x4cb3dc=_0x1dbf35[_0x3154('0xd')](_0x331b37),_0x3d5cce=0x0,_0x47ef3b={},_0x37b328='',_0x449e0e='',_0x12b91c=-0x1;while(_0x4cb3dc[_0x3d5cce]){_0x12b91c=_0x4cb3dc[_0x3d5cce][_0x3154('0xa')](':');if(_0x12b91c!=-0x1){_0x37b328=_0x4cb3dc[_0x3d5cce][_0x3154('0xe')](0x0,_0x12b91c)['trim']();_0x449e0e=_0x4cb3dc[_0x3d5cce][_0x3154('0xe')](_0x12b91c+0x1)[_0x3154('0xf')]();if(_0x37b328[_0x3154('0xc')]>0x0){_0x47ef3b[_0x37b328]=_0x449e0e;}}else{}_0x3d5cce++;}this[_0x3154('0x10')]('headers',_0x47ef3b);this['_inBody']=!![];}_0x5bcbff++;}this[_0x3154('0x4')]=_0x1aebde;}else{while((_0x1c51c5=_0x1aebde[_0x3154('0xa')](_0x331b37))!=-0x1){_0x1dbf35=_0x1aebde['substring'](0x0,_0x1c51c5);this[_0x3154('0x10')](_0x3154('0x11'),_0x1dbf35);_0x1aebde=_0x1aebde[_0x3154('0xb')](_0x1c51c5+_0x331b37[_0x3154('0xc')]);}this['_localBuffer']=_0x1aebde;}_0x37c77d();};module[_0x3154('0x12')]=AGIReply; \ No newline at end of file diff --git a/server/services/agi/rpc/index.js b/server/services/agi/rpc/index.js index 45af14b..e592f5e 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 _0xb12b=['ShowMailAccount','MailServerOut','Smtp','name','getSquareProjectById','ShowSquareProject','getVoiceQueueById','ShowVoiceQueue','getVariableById','ShowVariable','getSquareOdbcById','getUserById','ShowUser','ShowTrunk','getSoundById','ShowSound','ShowInterval','Interval','getSmsAccountById','ShowSmsAccount','createSmsMessage','CreateSmsMessage','createSquareDetailsReport','CreateSquareDetailsReport','createSquareReport','CreateSquareReport','merge','arg_2','format','YYYY-MM-DD\x20HH:mm:ss','createSquareRecording','CreateSquareRecording','createSquareMessage','CreateSquareMessage','ShowCmHopper','phone','CreateCmContact','getPauseById','ShowPause','agentLogin','LoginUser','agentPause','UnpauseUser','bluebird','lodash','jayson/promise','client','request','then','error','message','catch','getSquareProject','production','getMailAccountById'];(function(_0x2a6809,_0x44edde){var _0x11c371=function(_0x1a4888){while(--_0x1a4888){_0x2a6809['push'](_0x2a6809['shift']());}};_0x11c371(++_0x44edde);}(_0xb12b,0xd0));var _0xbb12=function(_0x243b00,_0x3131d8){_0x243b00=_0x243b00-0x0;var _0x33c4de=_0xb12b[_0x243b00];return _0x33c4de;};'use strict';var BPromise=require(_0xbb12('0x0'));var moment=require('moment');var _=require(_0xbb12('0x1'));var util=require('util');var jayson=require(_0xbb12('0x2'));var client=jayson[_0xbb12('0x3')]['http']({'port':0x2329});function request(_0x410ad1,_0x4b9fd6){return new BPromise(function(_0x1cff0a,_0x379f1a){return client[_0xbb12('0x4')](_0x410ad1,_0x4b9fd6)[_0xbb12('0x5')](function(_0x5ed0cb){if(_0x5ed0cb[_0xbb12('0x6')]){return _0x379f1a(_0x5ed0cb[_0xbb12('0x6')][_0xbb12('0x7')]);}else{return _0x1cff0a(_0x5ed0cb['result']);}})[_0xbb12('0x8')](function(_0x507706){return _0x379f1a(_0x507706);});});}exports[_0xbb12('0x9')]=function(_0x1a95ea){return request('ShowSquareProject',{'options':{'raw':![],'where':{'name':_0x1a95ea},'attributes':[_0xbb12('0xa')]}});};exports[_0xbb12('0xb')]=function(_0x252130){return request(_0xbb12('0xc'),{'options':{'raw':![],'where':{'id':_0x252130},'include':[{'model':_0xbb12('0xd'),'as':_0xbb12('0xe')}],'attributes':['id',_0xbb12('0xf'),'email']}});};exports[_0xbb12('0x10')]=function(_0x524576){return request(_0xbb12('0x11'),{'options':{'where':{'id':_0x524576},'attributes':[_0xbb12('0xf')]}});};exports[_0xbb12('0x12')]=function(_0x52ffd0){return request(_0xbb12('0x13'),{'options':{'where':{'id':_0x52ffd0},'attributes':[_0xbb12('0xf')]}});};exports[_0xbb12('0x14')]=function(_0x4b0664){return request(_0xbb12('0x15'),{'options':{'where':{'id':_0x4b0664},'attributes':['name']}});};exports[_0xbb12('0x16')]=function(_0x511e0b){return request('ShowSquareOdbc',{'options':{'where':{'id':_0x511e0b},'attributes':['dsn']}});};exports[_0xbb12('0x17')]=function(_0x7ddb16){return request(_0xbb12('0x18'),{'options':{'where':{'id':_0x7ddb16},'attributes':['name']}});};exports['getTrunkById']=function(_0x775237){return request(_0xbb12('0x19'),{'options':{'where':{'id':_0x775237},'attributes':[_0xbb12('0xf')]}});};exports[_0xbb12('0x1a')]=function(_0x976c75){return request(_0xbb12('0x1b'),{'options':{'where':{'id':_0x976c75},'attributes':['save_name']}});};exports['getIntervalById']=function(_0x114b63){return request(_0xbb12('0x1c'),{'options':{'raw':![],'where':{'id':_0x114b63},'include':[{'model':_0xbb12('0x1d'),'as':'Intervals'}]}});};exports[_0xbb12('0x1e')]=function(_0xb0eb8f){return request(_0xbb12('0x1f'),{'options':{'where':{'id':_0xb0eb8f},'attributes':['id',_0xbb12('0xf')]}});};exports[_0xbb12('0x20')]=function(_0x2f239c){return request(_0xbb12('0x21'),{'body':_0x2f239c});};exports[_0xbb12('0x22')]=function(_0x54a301){return request(_0xbb12('0x23'),{'body':_0x54a301});};exports[_0xbb12('0x24')]=function(_0x1667d7){return request(_0xbb12('0x25'),{'body':_[_0xbb12('0x26')](_0x1667d7,{'project_name':_0x1667d7['arg_1'],'prev_project_name':_0x1667d7[_0xbb12('0x27')]||'','is_subproject':_0x1667d7[_0xbb12('0x27')]?!![]:![],'leaveAt':moment()[_0xbb12('0x28')](_0xbb12('0x29'))})});};exports[_0xbb12('0x2a')]=function(_0xd221e5){return request(_0xbb12('0x2b'),{'body':_0xd221e5});};exports[_0xbb12('0x2c')]=function(_0x36eeb9){return request(_0xbb12('0x2d'),{'body':_0x36eeb9});};exports['createCmContact']=function(_0x52ddce){return request(_0xbb12('0x2e'),{'options':{'raw':![],'where':{'phone':_0x52ddce[_0xbb12('0x2f')],'ListId':_0x52ddce['ListId']}}})[_0xbb12('0x5')](function(_0x340440){if(_0x340440){return _0x340440;}return request(_0xbb12('0x30'),{'body':_0x52ddce});});};exports[_0xbb12('0x31')]=function(_0x54929f){return request(_0xbb12('0x32'),{'options':{'where':{'id':_0x54929f},'attributes':[_0xbb12('0xf')]}});};exports[_0xbb12('0x33')]=function(_0x314b1c,_0x421a50){return request(_0xbb12('0x34'),{'body':{'interface':_0x421a50},'options':{'where':_0x314b1c}});};exports[_0xbb12('0x35')]=function(_0x21aa02,_0x493b3c,_0x5c8aa0){return request('PauseUser',{'body':{'type':_0x493b3c,'uniqueid':_0x5c8aa0},'options':{'where':_0x21aa02}});};exports['agentUnpause']=function(_0x4ca223){return request(_0xbb12('0x36'),{'body':{},'options':{'where':_0x4ca223}});};exports['agentLogout']=function(_0x13cd48){return request('LogoutUser',{'body':{},'options':{'where':_0x13cd48}});}; \ No newline at end of file +var _0x9dd5=['CreateSquareReport','arg_1','arg_2','format','createSquareRecording','CreateSquareRecording','CreateSquareMessage','ShowCmHopper','phone','then','getPauseById','LoginUser','agentPause','PauseUser','UnpauseUser','agentLogout','bluebird','lodash','jayson/promise','client','http','request','error','message','getSquareProject','ShowSquareProject','production','ShowMailAccount','MailServerOut','Smtp','name','email','ShowVoiceQueue','getVariableById','ShowVariable','getSquareOdbcById','ShowSquareOdbc','getUserById','ShowUser','getTrunkById','ShowTrunk','getSoundById','ShowSound','save_name','getIntervalById','ShowInterval','Interval','Intervals','getSmsAccountById','ShowSmsAccount','CreateSmsMessage','createSquareDetailsReport','CreateSquareDetailsReport'];(function(_0x28919a,_0x5ac32e){var _0x4627a2=function(_0x40b8e7){while(--_0x40b8e7){_0x28919a['push'](_0x28919a['shift']());}};_0x4627a2(++_0x5ac32e);}(_0x9dd5,0x7a));var _0x59dd=function(_0x3ac8e5,_0x287fe4){_0x3ac8e5=_0x3ac8e5-0x0;var _0x4388e1=_0x9dd5[_0x3ac8e5];return _0x4388e1;};'use strict';var BPromise=require(_0x59dd('0x0'));var moment=require('moment');var _=require(_0x59dd('0x1'));var util=require('util');var jayson=require(_0x59dd('0x2'));var client=jayson[_0x59dd('0x3')][_0x59dd('0x4')]({'port':0x2329});function request(_0x3d27c7,_0x6a2b0e){return new BPromise(function(_0x42c1e8,_0x11a698){return client[_0x59dd('0x5')](_0x3d27c7,_0x6a2b0e)['then'](function(_0x571002){if(_0x571002[_0x59dd('0x6')]){return _0x11a698(_0x571002[_0x59dd('0x6')][_0x59dd('0x7')]);}else{return _0x42c1e8(_0x571002['result']);}})['catch'](function(_0x26b2fe){return _0x11a698(_0x26b2fe);});});}exports[_0x59dd('0x8')]=function(_0x3ef938){return request(_0x59dd('0x9'),{'options':{'raw':![],'where':{'name':_0x3ef938},'attributes':[_0x59dd('0xa')]}});};exports['getMailAccountById']=function(_0x3fde72){return request(_0x59dd('0xb'),{'options':{'raw':![],'where':{'id':_0x3fde72},'include':[{'model':_0x59dd('0xc'),'as':_0x59dd('0xd')}],'attributes':['id',_0x59dd('0xe'),_0x59dd('0xf')]}});};exports['getSquareProjectById']=function(_0x423f34){return request(_0x59dd('0x9'),{'options':{'where':{'id':_0x423f34},'attributes':[_0x59dd('0xe')]}});};exports['getVoiceQueueById']=function(_0x3aa792){return request(_0x59dd('0x10'),{'options':{'where':{'id':_0x3aa792},'attributes':[_0x59dd('0xe')]}});};exports[_0x59dd('0x11')]=function(_0x2fdbb7){return request(_0x59dd('0x12'),{'options':{'where':{'id':_0x2fdbb7},'attributes':[_0x59dd('0xe')]}});};exports[_0x59dd('0x13')]=function(_0x3f00b7){return request(_0x59dd('0x14'),{'options':{'where':{'id':_0x3f00b7},'attributes':['dsn']}});};exports[_0x59dd('0x15')]=function(_0x58ffc4){return request(_0x59dd('0x16'),{'options':{'where':{'id':_0x58ffc4},'attributes':[_0x59dd('0xe')]}});};exports[_0x59dd('0x17')]=function(_0x4036ae){return request(_0x59dd('0x18'),{'options':{'where':{'id':_0x4036ae},'attributes':[_0x59dd('0xe')]}});};exports[_0x59dd('0x19')]=function(_0x70e579){return request(_0x59dd('0x1a'),{'options':{'where':{'id':_0x70e579},'attributes':[_0x59dd('0x1b')]}});};exports[_0x59dd('0x1c')]=function(_0x1d67c7){return request(_0x59dd('0x1d'),{'options':{'raw':![],'where':{'id':_0x1d67c7},'include':[{'model':_0x59dd('0x1e'),'as':_0x59dd('0x1f')}]}});};exports[_0x59dd('0x20')]=function(_0x400c7e){return request(_0x59dd('0x21'),{'options':{'where':{'id':_0x400c7e},'attributes':['id',_0x59dd('0xe')]}});};exports['createSmsMessage']=function(_0x1df93b){return request(_0x59dd('0x22'),{'body':_0x1df93b});};exports[_0x59dd('0x23')]=function(_0x1fc659){return request(_0x59dd('0x24'),{'body':_0x1fc659});};exports['createSquareReport']=function(_0x3f6ad3){return request(_0x59dd('0x25'),{'body':_['merge'](_0x3f6ad3,{'project_name':_0x3f6ad3[_0x59dd('0x26')],'prev_project_name':_0x3f6ad3[_0x59dd('0x27')]||'','is_subproject':_0x3f6ad3[_0x59dd('0x27')]?!![]:![],'leaveAt':moment()[_0x59dd('0x28')]('YYYY-MM-DD\x20HH:mm:ss')})});};exports[_0x59dd('0x29')]=function(_0x43a09f){return request(_0x59dd('0x2a'),{'body':_0x43a09f});};exports['createSquareMessage']=function(_0x4f21c4){return request(_0x59dd('0x2b'),{'body':_0x4f21c4});};exports['createCmContact']=function(_0x2410c8){return request(_0x59dd('0x2c'),{'options':{'raw':![],'where':{'phone':_0x2410c8[_0x59dd('0x2d')],'ListId':_0x2410c8['ListId']}}})[_0x59dd('0x2e')](function(_0xec8cbd){if(_0xec8cbd){return _0xec8cbd;}return request('CreateCmContact',{'body':_0x2410c8});});};exports[_0x59dd('0x2f')]=function(_0x487657){return request('ShowPause',{'options':{'where':{'id':_0x487657},'attributes':[_0x59dd('0xe')]}});};exports['agentLogin']=function(_0x1af4b3,_0x1f5bce){return request(_0x59dd('0x30'),{'body':{'interface':_0x1f5bce},'options':{'where':_0x1af4b3}});};exports[_0x59dd('0x31')]=function(_0x28befb,_0x15258f,_0x491ad0){return request(_0x59dd('0x32'),{'body':{'type':_0x15258f,'uniqueid':_0x491ad0},'options':{'where':_0x28befb}});};exports['agentUnpause']=function(_0xfb2f4d){return request(_0x59dd('0x33'),{'body':{},'options':{'where':_0xfb2f4d}});};exports[_0x59dd('0x34')]=function(_0x2bac59){return request('LogoutUser',{'body':{},'options':{'where':_0x2bac59}});}; \ 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 7960899..f2aba39 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 _0x5e8d=['./polly','./lex','exports'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x5e8d,0x11a));var _0xd5e8=function(_0x499f59,_0x270ec7){_0x499f59=_0x499f59-0x0;var _0x493ff1=_0x5e8d[_0x499f59];return _0x493ff1;};var polly=require(_0xd5e8('0x0'));var lex=require(_0xd5e8('0x1'));module[_0xd5e8('0x2')]={'polly':polly,'lex':lex}; \ No newline at end of file +var _0xfa9f=['exports','./lex'];(function(_0x10dc64,_0x11bb29){var _0x9cf98d=function(_0x558d71){while(--_0x558d71){_0x10dc64['push'](_0x10dc64['shift']());}};_0x9cf98d(++_0x11bb29);}(_0xfa9f,0x93));var _0xffa9=function(_0x263f9d,_0x3d854e){_0x263f9d=_0x263f9d-0x0;var _0x4c4efa=_0xfa9f[_0x263f9d];return _0x4c4efa;};var polly=require('./polly');var lex=require(_0xffa9('0x0'));module[_0xffa9('0x1')]={'polly':polly,'lex':lex}; \ No newline at end of file diff --git a/server/services/agi/scripts/aws/lex/index.js b/server/services/agi/scripts/aws/lex/index.js index 3eb11e4..4a23e84 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 _0x5b02=['exports','./lib/api'];(function(_0x8b18e3,_0x2679cc){var _0x57fd6e=function(_0x4c1f2f){while(--_0x4c1f2f){_0x8b18e3['push'](_0x8b18e3['shift']());}};_0x57fd6e(++_0x2679cc);}(_0x5b02,0xe9));var _0x25b0=function(_0x68361b,_0x4bc916){_0x68361b=_0x68361b-0x0;var _0x53b180=_0x5b02[_0x68361b];return _0x53b180;};'use strict';var lex=require(_0x25b0('0x0'));module[_0x25b0('0x1')]=function(_0x428458,_0x1c3295,_0x4ef71c,_0x4cb227,_0x2b5f2d,_0x53493e){return lex(_0x428458,_0x1c3295,_0x4ef71c,_0x4cb227,_0x2b5f2d,_0x53493e);}; \ No newline at end of file +var _0x6f7a=['./lib/api','exports'];(function(_0x2c2572,_0x1035f6){var _0x19b430=function(_0x1b7311){while(--_0x1b7311){_0x2c2572['push'](_0x2c2572['shift']());}};_0x19b430(++_0x1035f6);}(_0x6f7a,0x1ae));var _0xa6f7=function(_0xb42425,_0x322e0d){_0xb42425=_0xb42425-0x0;var _0x347a4b=_0x6f7a[_0xb42425];return _0x347a4b;};'use strict';var lex=require(_0xa6f7('0x0'));module[_0xa6f7('0x1')]=function(_0x205e14,_0x982062,_0x4dd99d,_0x93614a,_0x407de3,_0x12ecb8){return lex(_0x205e14,_0x982062,_0x4dd99d,_0x93614a,_0x407de3,_0x12ecb8);}; \ No newline at end of file diff --git a/server/services/agi/scripts/aws/lex/lib/api.js b/server/services/agi/scripts/aws/lex/lib/api.js index 9b373a0..575cc85 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(_0x48ec35,_0x22bbf5){var _0x25f526=function(_0x2120a1){while(--_0x2120a1){_0x48ec35['push'](_0x48ec35['shift']());}};_0x25f526(++_0x22bbf5);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3a6efd,_0x2a5102){_0x3a6efd=_0x3a6efd-0x0;var _0x487b9a=_0xa9e0[_0x3a6efd];return _0x487b9a;};'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(_0x186bb3,_0x4d1ab1){var _0x1b6929=function(_0x5b5e83){while(--_0x5b5e83){_0x186bb3['push'](_0x186bb3['shift']());}};_0x1b6929(++_0x4d1ab1);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5b78e8,_0x55096b){_0x5b78e8=_0x5b78e8-0x0;var _0xf2c321=_0xa9e0[_0x5b78e8];return _0xf2c321;};'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 42d1dc7..74ddb3f 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. * // * * // ************************************************************************* -'use strict';var polly=require('./lib/api');module['exports']=function(_0x2b9aa0,_0x1b0826,_0x4e4318,_0xe081a4,_0x2ea789,_0x5d2d45,_0x31f5fc){return polly(_0x2b9aa0,_0x1b0826,_0x4e4318,_0xe081a4,_0x2ea789,_0x5d2d45,_0x31f5fc);}; \ No newline at end of file +var _0x59b7=['exports'];(function(_0x5d36dd,_0x3c38c1){var _0x52d18e=function(_0xe8c6b2){while(--_0xe8c6b2){_0x5d36dd['push'](_0x5d36dd['shift']());}};_0x52d18e(++_0x3c38c1);}(_0x59b7,0x1c1));var _0x759b=function(_0x4ae2d4,_0x4ac2e5){_0x4ae2d4=_0x4ae2d4-0x0;var _0x34e320=_0x59b7[_0x4ae2d4];return _0x34e320;};'use strict';var polly=require('./lib/api');module[_0x759b('0x0')]=function(_0x6bf87e,_0x54754d,_0x4b1756,_0x38845f,_0x407a95,_0x2d3e0a,_0x4c9d1a){return polly(_0x6bf87e,_0x54754d,_0x4b1756,_0x38845f,_0x407a95,_0x2d3e0a,_0x4c9d1a);}; \ 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 a8fda24..a24b949 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 _0x4cb2=['synthesizeSpeech','AudioStream','writeFile','Invalid\x20data\x20response\x20from\x20aws\x20Polly!','No\x20data\x20response\x20from\x20aws\x20Polly!','exports','Polly','text','mp3','path','bluebird','randomstring'];(function(_0x14647d,_0x20a244){var _0x3a0cae=function(_0x6f6909){while(--_0x6f6909){_0x14647d['push'](_0x14647d['shift']());}};_0x3a0cae(++_0x20a244);}(_0x4cb2,0x195));var _0x24cb=function(_0x381a9b,_0x19c7ec){_0x381a9b=_0x381a9b-0x0;var _0x361bdf=_0x4cb2[_0x381a9b];return _0x361bdf;};'use strict';var fs=require('fs');var path=require(_0x24cb('0x0'));var BPromise=require(_0x24cb('0x1'));var rs=require(_0x24cb('0x2'));var AWS=require('aws-sdk');function pollyResult(_0x117155,_0x2aaab1,_0x45655c){return new BPromise(function(_0x5d099d,_0x5b8320){_0x117155[_0x24cb('0x3')](_0x2aaab1,function(_0x4d704f,_0x59813b){if(_0x4d704f){_0x5b8320(_0x4d704f);}else if(_0x59813b){if(_0x59813b[_0x24cb('0x4')]instanceof Buffer){fs[_0x24cb('0x5')](_0x45655c,_0x59813b[_0x24cb('0x4')],function(_0x27ee88){if(_0x27ee88){_0x5b8320(_0x27ee88);}else{_0x5d099d();}});}else{_0x5b8320(new Error(_0x24cb('0x6')));}}else{_0x5b8320(new Error(_0x24cb('0x7')));}});});}module[_0x24cb('0x8')]=function(_0x3aa592,_0x149176,_0x393072,_0x352f76,_0x573778,_0x15c3b2,_0x259aa3){var _0x5e80f0=new AWS[(_0x24cb('0x9'))]({'accessKeyId':_0x3aa592,'secretAccessKey':_0x149176,'region':_0x393072});var _0x1be633={'Text':_0x573778,'TextType':_0x15c3b2||_0x24cb('0xa'),'OutputFormat':_0x24cb('0xb'),'VoiceId':_0x352f76};return pollyResult(_0x5e80f0,_0x1be633,_0x259aa3);}; \ No newline at end of file +var _0x7be4=['exports','Polly','text','mp3','path','bluebird','randomstring','aws-sdk','synthesizeSpeech','AudioStream','writeFile','Invalid\x20data\x20response\x20from\x20aws\x20Polly!','No\x20data\x20response\x20from\x20aws\x20Polly!'];(function(_0x2c79e5,_0x53abfd){var _0x58e0bd=function(_0x10dff3){while(--_0x10dff3){_0x2c79e5['push'](_0x2c79e5['shift']());}};_0x58e0bd(++_0x53abfd);}(_0x7be4,0x86));var _0x47be=function(_0x3f36f7,_0x1af18b){_0x3f36f7=_0x3f36f7-0x0;var _0x5a87c6=_0x7be4[_0x3f36f7];return _0x5a87c6;};'use strict';var fs=require('fs');var path=require(_0x47be('0x0'));var BPromise=require(_0x47be('0x1'));var rs=require(_0x47be('0x2'));var AWS=require(_0x47be('0x3'));function pollyResult(_0x1a6e35,_0x4a62fa,_0x12a88b){return new BPromise(function(_0x558bbb,_0x5a437e){_0x1a6e35[_0x47be('0x4')](_0x4a62fa,function(_0x1bf090,_0x8a1ca9){if(_0x1bf090){_0x5a437e(_0x1bf090);}else if(_0x8a1ca9){if(_0x8a1ca9[_0x47be('0x5')]instanceof Buffer){fs[_0x47be('0x6')](_0x12a88b,_0x8a1ca9[_0x47be('0x5')],function(_0x1af770){if(_0x1af770){_0x5a437e(_0x1af770);}else{_0x558bbb();}});}else{_0x5a437e(new Error(_0x47be('0x7')));}}else{_0x5a437e(new Error(_0x47be('0x8')));}});});}module[_0x47be('0x9')]=function(_0x3f7bd6,_0x403cac,_0xd54079,_0x5ab805,_0x2a1472,_0x43467f,_0x13baa6){var _0x38bcbb=new AWS[(_0x47be('0xa'))]({'accessKeyId':_0x3f7bd6,'secretAccessKey':_0x403cac,'region':_0xd54079});var _0x270280={'Text':_0x2a1472,'TextType':_0x43467f||_0x47be('0xb'),'OutputFormat':_0x47be('0xc'),'VoiceId':_0x5ab805};return pollyResult(_0x38bcbb,_0x270280,_0x13baa6);}; \ 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 c83c2a0..4d69715 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 _0x9bb4=['./lib/api'];(function(_0x4ec566,_0x3efc9d){var _0x23ed01=function(_0x42c96a){while(--_0x42c96a){_0x4ec566['push'](_0x4ec566['shift']());}};_0x23ed01(++_0x3efc9d);}(_0x9bb4,0x149));var _0x49bb=function(_0x6e3cf0,_0x300334){_0x6e3cf0=_0x6e3cf0-0x0;var _0x42aa81=_0x9bb4[_0x6e3cf0];return _0x42aa81;};'use strict';var asr=require(_0x49bb('0x0'));module['exports']=function(_0x1dec88,_0x7e812c,_0x5a5b52,_0x340d17){return asr(_0x1dec88,_0x7e812c,_0x5a5b52);}; \ No newline at end of file +var _0x1873=['exports','./lib/api'];(function(_0x39e279,_0x10d5d2){var _0x269ac9=function(_0x340d2c){while(--_0x340d2c){_0x39e279['push'](_0x39e279['shift']());}};_0x269ac9(++_0x10d5d2);}(_0x1873,0x11d));var _0x3187=function(_0x2efe4d,_0x200f94){_0x2efe4d=_0x2efe4d-0x0;var _0x8755f5=_0x1873[_0x2efe4d];return _0x8755f5;};'use strict';var asr=require(_0x3187('0x0'));module[_0x3187('0x1')]=function(_0x3960dd,_0xcdb895,_0x4d85f8,_0x482653){return asr(_0x3960dd,_0xcdb895,_0x4d85f8);}; \ 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 d3f3944..eb10be4 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 _0xd2ea=['LINEAR16','url','bluebird','https://speech.googleapis.com','exports','string','length','filepath\x20should\x20be\x20a\x20string','key\x20should\x20be\x20a\x20string','undefined','lang\x20should\x20be\x20a\x20string','toString','POST','/v1/speech:recognize?key='];(function(_0x139599,_0x1e0729){var _0x79cb15=function(_0x4276ca){while(--_0x4276ca){_0x139599['push'](_0x139599['shift']());}};_0x79cb15(++_0x1e0729);}(_0xd2ea,0x15f));var _0xad2e=function(_0x450c4e,_0x909468){_0x450c4e=_0x450c4e-0x0;var _0x59e9de=_0xd2ea[_0x450c4e];return _0x59e9de;};'use strict';var url=require(_0xad2e('0x0'));var BPromise=require(_0xad2e('0x1'));var fs=require('fs');var host=_0xad2e('0x2');module[_0xad2e('0x3')]=function(_0x44b30d,_0x5c9fa9,_0x3a9d11){return new BPromise(function(_0x46a911,_0xcba7cb){var _0x3e0741;if(typeof _0x44b30d!==_0xad2e('0x4')||_0x44b30d[_0xad2e('0x5')]===0x0){return _0xcba7cb(_0xad2e('0x6'));}if(typeof _0x5c9fa9!=='string'||_0x5c9fa9[_0xad2e('0x5')]===0x0){return _0xcba7cb(_0xad2e('0x7'));}if(typeof _0x3a9d11!==_0xad2e('0x8')&&(typeof _0x3a9d11!=='string'||_0x3a9d11[_0xad2e('0x5')]===0x0)){return _0xcba7cb(_0xad2e('0x9'));}try{_0x3e0741=fs['readFileSync'](_0x44b30d)[_0xad2e('0xa')]('base64');}catch(_0x430443){return _0xcba7cb(_0x430443);}return _0x46a911({'method':_0xad2e('0xb'),'uri':host+_0xad2e('0xc')+_0x5c9fa9,'body':{'config':{'encoding':_0xad2e('0xd'),'sampleRateHertz':'8000','languageCode':_0x3a9d11},'audio':{'content':_0x3e0741}},'json':!![]});});}; \ No newline at end of file +var _0x5645=['https://speech.googleapis.com','exports','string','length','filepath\x20should\x20be\x20a\x20string','lang\x20should\x20be\x20a\x20string','readFileSync','toString','POST','LINEAR16','8000','url','bluebird'];(function(_0x49cf30,_0x56ff7c){var _0x2fff22=function(_0x2382b1){while(--_0x2382b1){_0x49cf30['push'](_0x49cf30['shift']());}};_0x2fff22(++_0x56ff7c);}(_0x5645,0x19e));var _0x5564=function(_0x5cbea4,_0x41636d){_0x5cbea4=_0x5cbea4-0x0;var _0x5185ae=_0x5645[_0x5cbea4];return _0x5185ae;};'use strict';var url=require(_0x5564('0x0'));var BPromise=require(_0x5564('0x1'));var fs=require('fs');var host=_0x5564('0x2');module[_0x5564('0x3')]=function(_0x26c54d,_0x5ecd66,_0x241816){return new BPromise(function(_0x64ae4d,_0x1240cd){var _0x821a1a;if(typeof _0x26c54d!==_0x5564('0x4')||_0x26c54d[_0x5564('0x5')]===0x0){return _0x1240cd(_0x5564('0x6'));}if(typeof _0x5ecd66!==_0x5564('0x4')||_0x5ecd66[_0x5564('0x5')]===0x0){return _0x1240cd('key\x20should\x20be\x20a\x20string');}if(typeof _0x241816!=='undefined'&&(typeof _0x241816!==_0x5564('0x4')||_0x241816[_0x5564('0x5')]===0x0)){return _0x1240cd(_0x5564('0x7'));}try{_0x821a1a=fs[_0x5564('0x8')](_0x26c54d)[_0x5564('0x9')]('base64');}catch(_0x1ba45a){return _0x1240cd(_0x1ba45a);}return _0x64ae4d({'method':_0x5564('0xa'),'uri':host+'/v1/speech:recognize?key='+_0x5ecd66,'body':{'config':{'encoding':_0x5564('0xb'),'sampleRateHertz':_0x5564('0xc'),'languageCode':_0x241816},'audio':{'content':_0x821a1a}},'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 720fc46..e7e5440 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 _0xf690=['exports'];(function(_0x3256bb,_0xc5bb9a){var _0x550388=function(_0x4eda56){while(--_0x4eda56){_0x3256bb['push'](_0x3256bb['shift']());}};_0x550388(++_0xc5bb9a);}(_0xf690,0x133));var _0x0f69=function(_0x26721d,_0x448ba5){_0x26721d=_0x26721d-0x0;var _0x1035c5=_0xf690[_0x26721d];return _0x1035c5;};var asr=require('./asr');module[_0x0f69('0x0')]={'asr':asr}; \ No newline at end of file +var _0x4904=['exports','./asr'];(function(_0x3263fa,_0x447f91){var _0x293bba=function(_0x23f099){while(--_0x23f099){_0x3263fa['push'](_0x3263fa['shift']());}};_0x293bba(++_0x447f91);}(_0x4904,0x19d));var _0x4490=function(_0x1cd189,_0x3a697b){_0x1cd189=_0x1cd189-0x0;var _0x12abf0=_0x4904[_0x1cd189];return _0x12abf0;};var asr=require(_0x4490('0x0'));module[_0x4490('0x1')]={'asr':asr}; \ No newline at end of file diff --git a/server/services/agi/scripts/index.js b/server/services/agi/scripts/index.js index 3a688ce..fc3a64e 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 _0x3ec0=['length','lang\x20\x22','\x22\x20might\x20not\x20exist','parse\x20response\x20failed:\x0a','goggleTTS\x20path','googleASR','asr','uri','results','map','alternatives','transcript','join','confidence','catch','[%s]\x20%s:%s','name','googleDialogflow','textRequest','source','result','resolvedQuery','action','actionIncomplete','fulfillment','score','status','metadata','endConversation','isFallbackIntent','googleDialogflowV2','SessionsClient','detectIntent','queryResult','diagnosticInfo','fields','end_conversation','boolValue','fulfillmentText','intent','displayName','isFallback','languageCode','responseId','intentDetectionConfidence','tildeASR','Tilde\x20ASR\x20transcription','awsPolly','polly','awsLex','lex','ispeechTTS','ispeechASR','format','%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s','model=%s','freeform=3','parse','sestekNDA','text','channelData','CustomAction','CustomActionData','AudioFromTts','Data','audiofile','dirName','apiai-promise','bluebird','dialogflow','path','querystring','randomstring','sox','url','util','./aws','./sestek','./tilde','../../../config/logger','agi','https://api.ispeech.org/api/rest','https:','host','WHAT_EVER','statusCode','error','request\x20to\x20','\x20failed,\x20status\x20code\x20=\x20','statusMessage','createWriteStream','finish','info','finish\x20download\x20file','close','unlink','download\x20error','pipe','end','protocol','get','data','wav','error\x20convert','finish\x20to\x20convert','start','tmp','generate','.wav','writeFileSync','base64','then','chmodSync','split','toString','googleCloudTTS','https://texttospeech.googleapis.com/v1/','?key=','ssml','input','voice','audioConfig','MP3','text:synthesize','resolve','.mp3','from','audioContent','writeFile','777','googleCloudTTS\x20path','POST','application/x-www-form-urlencoded','f.req=','jQ1olc','stringify','slice'];(function(_0x5751e6,_0x125e5e){var _0x4199e4=function(_0x559843){while(--_0x559843){_0x5751e6['push'](_0x5751e6['shift']());}};_0x4199e4(++_0x125e5e);}(_0x3ec0,0x155));var _0x03ec=function(_0x3d9b41,_0x4329b3){_0x3d9b41=_0x3d9b41-0x0;var _0x1dd0c7=_0x3ec0[_0x3d9b41];return _0x1dd0c7;};'use strict';var apiai=require(_0x03ec('0x0'));var BPromise=require(_0x03ec('0x1'));var dialogflow=require(_0x03ec('0x2'));var fs=require('fs');var http=require('http');var https=require('https');var md5=require('md5');var path=require(_0x03ec('0x3'));var querystring=require(_0x03ec('0x4'));var rp=require('request-promise');var rs=require(_0x03ec('0x5'));var sox=require(_0x03ec('0x6'));var tts=require('google-tts-api');var urlParse=require(_0x03ec('0x7'))['parse'];var util=require(_0x03ec('0x8'));var aws=require(_0x03ec('0x9'));var google=require('./google');var sestek=require(_0x03ec('0xa'));var tilde=require(_0x03ec('0xb'));var logger=require(_0x03ec('0xc'))(_0x03ec('0xd'));var ISPEECH_API=_0x03ec('0xe');function downloadFile(_0x2c1783,_0x1b44a4){return new BPromise(function(_0x46cfbc,_0x254404){var _0x286bbd=urlParse(_0x2c1783);var _0x4c4383=_0x286bbd['protocol']===_0x03ec('0xf')?https:http;var _0x9db9bb={'host':_0x286bbd[_0x03ec('0x10')],'path':_0x286bbd['path'],'headers':{'user-agent':_0x03ec('0x11')}};_0x4c4383['get'](_0x9db9bb,function(_0x44d3c8){if(_0x44d3c8[_0x03ec('0x12')]!==0xc8){logger[_0x03ec('0x13')](_0x03ec('0x14')+_0x2c1783+_0x03ec('0x15')+_0x44d3c8[_0x03ec('0x12')]+'\x20('+_0x44d3c8[_0x03ec('0x16')]+')');_0x254404(new Error(_0x03ec('0x14')+_0x2c1783+_0x03ec('0x15')+_0x44d3c8[_0x03ec('0x12')]+'\x20('+_0x44d3c8[_0x03ec('0x16')]+')'));return;}var _0x352e4c=fs[_0x03ec('0x17')](_0x1b44a4);_0x352e4c['on'](_0x03ec('0x18'),function(){logger[_0x03ec('0x19')](_0x03ec('0x1a'));_0x352e4c[_0x03ec('0x1b')](_0x46cfbc);});_0x352e4c['on']('error',function(_0x194804){fs[_0x03ec('0x1c')](_0x1b44a4);logger[_0x03ec('0x13')](_0x03ec('0x1d'),_0x194804);_0x254404(_0x194804);});_0x44d3c8[_0x03ec('0x1e')](_0x352e4c);})['on'](_0x03ec('0x13'),function(_0x4281b7){logger[_0x03ec('0x13')](_0x4281b7);_0x254404(_0x4281b7);})[_0x03ec('0x1f')]();});}function uploadFile(_0x341ab1){return new BPromise(function(_0x20c627,_0x26532f){var _0x3a67d9=urlParse(_0x341ab1);var _0x5c8e9f=_0x3a67d9[_0x03ec('0x20')]===_0x03ec('0xf')?https:http;var _0xe09f4d={'host':_0x3a67d9[_0x03ec('0x10')],'path':_0x3a67d9[_0x03ec('0x3')],'headers':{'user-agent':_0x03ec('0x11')}};_0x5c8e9f[_0x03ec('0x21')](_0xe09f4d,function(_0x5b488a){if(_0x5b488a[_0x03ec('0x12')]!==0xc8){_0x26532f(new Error(_0x03ec('0x14')+_0x341ab1+_0x03ec('0x15')+_0x5b488a['statusCode']+'\x20('+_0x5b488a[_0x03ec('0x16')]+')'));return;}var _0x52637a='';_0x5b488a['on'](_0x03ec('0x22'),function(_0x5940fd){_0x52637a+=_0x5940fd;});_0x5b488a['on'](_0x03ec('0x1f'),function(){_0x20c627(_0x52637a);});})['on'](_0x03ec('0x13'),function(_0x1b50ca){_0x26532f(_0x1b50ca);})[_0x03ec('0x1f')]();});}function convertFile(_0x5380cd,_0x30f45a){return new BPromise(function(_0x201b0c,_0x24f691){var _0x5bd704=sox['transcode'](_0x5380cd,_0x30f45a,{'sampleRate':0x1f40,'format':_0x03ec('0x23'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x5bd704['on'](_0x03ec('0x13'),function(_0xc3da8c){logger[_0x03ec('0x13')](_0x03ec('0x24'),_0xc3da8c);_0x24f691(_0xc3da8c);});_0x5bd704['on']('end',function(){logger[_0x03ec('0x19')](_0x03ec('0x25'));_0x201b0c();});_0x5bd704[_0x03ec('0x26')]();});}function base64Decode(_0x25fb65,_0x2a017c){var _0x19c978=path['resolve'](__dirname,_0x03ec('0x27'),rs[_0x03ec('0x28')](0x4)+_0x03ec('0x29'));fs[_0x03ec('0x2a')](_0x19c978,_0x25fb65,_0x03ec('0x2b'));return convertFile(_0x19c978,_0x2a017c)[_0x03ec('0x2c')](function(){try{fs[_0x03ec('0x1c')](_0x19c978);fs[_0x03ec('0x2d')](_0x2a017c,'777');}catch(_0x59e336){logger[_0x03ec('0x13')](_0x59e336);}return _0x2a017c[_0x03ec('0x2e')]('.')[0x0];});}function base64Encode(_0x5c37bf){var _0x167791=fs['readFileSync'](_0x5c37bf);return new Buffer(_0x167791)[_0x03ec('0x2f')]('base64');}exports[_0x03ec('0x30')]=function(_0x1db580,_0x2184d0,_0x5646f4,_0x25d634,_0x3e6e31,_0x5eca71){var _0x4ac38c,_0xe5ac2d;var _0x28866b=_0x03ec('0x31');var _0x53b94d=_0x03ec('0x32')+_0x1db580;var _0x6cdd69={};if(_0x2184d0===_0x03ec('0x33')){_0x6cdd69['input']={'ssml':_0x5646f4};}else{_0x6cdd69[_0x03ec('0x34')]={'text':_0x5646f4};};_0x6cdd69[_0x03ec('0x35')]={'languageCode':_0x25d634,'ssmlGender':_0x3e6e31};_0x6cdd69[_0x03ec('0x36')]={'audioEncoding':_0x03ec('0x37'),'sampleRateHertz':0x1f40};var _0x5623ec={'url':_0x28866b+_0x03ec('0x38')+_0x53b94d,'method':'POST','json':!![],'body':_0x6cdd69};return rp(_0x5623ec)[_0x03ec('0x2c')](function(_0x1418d2){return new BPromise(function(_0x450d16,_0x16ea34){_0x4ac38c=path[_0x03ec('0x39')](__dirname,_0x03ec('0x27'),rs[_0x03ec('0x28')](0x4)+_0x03ec('0x3a'));var _0x57fc35=Buffer[_0x03ec('0x3b')](_0x1418d2[_0x03ec('0x3c')],_0x03ec('0x2b'));return fs[_0x03ec('0x3d')](_0x4ac38c,_0x57fc35,function(_0xa07319){_0x16ea34(_0xa07319);},function(_0x41ae25){fs[_0x03ec('0x2d')](_0x4ac38c,_0x03ec('0x3e'));_0x450d16(_0x41ae25);});});})[_0x03ec('0x2c')](function(_0x2cc061){_0xe5ac2d=path[_0x03ec('0x39')](__dirname,_0x03ec('0x27'),rs[_0x03ec('0x28')](0x4)+'.wav');return convertFile(_0x4ac38c,_0xe5ac2d);})[_0x03ec('0x2c')](function(){try{fs['unlink'](_0x4ac38c);fs[_0x03ec('0x2d')](_0xe5ac2d,'777');}catch(_0x466812){logger[_0x03ec('0x13')](_0x466812);}logger[_0x03ec('0x19')](_0x03ec('0x3f'),_0xe5ac2d[_0x03ec('0x2e')]('.')[0x0]);return _0xe5ac2d['split']('.')[0x0];});};exports['googleTTS']=function(_0x163806,_0x45c485){var _0x365928='https://translate.google.com/_/TranslateWebserverUi/data/batchexecute';var _0x5b3af7,_0x163407;var _0x5a3150;var _0x5910ab={'encoding':'utf8','method':_0x03ec('0x40'),'timeout':0x2710,'url':_0x365928,'headers':{'Content-Type':_0x03ec('0x41')},'body':_0x03ec('0x42')+encodeURIComponent(JSON['stringify']([[[_0x03ec('0x43'),JSON[_0x03ec('0x44')]([_0x163806,_0x45c485||'en',![],'null']),null,'generic']]]))};return rp(_0x5910ab)[_0x03ec('0x2c')](function(_0xbfeea0){try{_0x5a3150=eval(_0xbfeea0[_0x03ec('0x45')](0x5))[0x0][0x2];}catch(_0x2fd3ad){throw new Error('parse\x20response\x20failed:\x0a'+_0xbfeea0['data']);}if(!_0x5a3150){if(_0x163806[_0x03ec('0x46')]>0xc8){throw new Error('text\x20length\x20limit\x20reached');}else{throw new Error(_0x03ec('0x47')+_0x45c485+_0x03ec('0x48'));}}try{_0x5a3150=eval(_0x5a3150)[0x0];}catch(_0x2c3ced){throw new Error(_0x03ec('0x49')+res[_0x03ec('0x22')]);}const _0x20a297=_0x5a3150;_0x5b3af7=path[_0x03ec('0x39')](__dirname,_0x03ec('0x27'),rs[_0x03ec('0x28')](0x4)+_0x03ec('0x3a'));fs[_0x03ec('0x2a')](_0x5b3af7,_0x5a3150,{'encoding':_0x03ec('0x2b')});_0x163407=path[_0x03ec('0x39')](__dirname,_0x03ec('0x27'),rs[_0x03ec('0x28')](0x4)+_0x03ec('0x29'));return convertFile(_0x5b3af7,_0x163407);})[_0x03ec('0x2c')](function(){try{fs[_0x03ec('0x1c')](_0x5b3af7);fs['chmodSync'](_0x163407,'777');}catch(_0x31babd){logger[_0x03ec('0x13')](_0x31babd);}logger['info'](_0x03ec('0x4a'),_0x163407[_0x03ec('0x2e')]('.')[0x0]);return _0x163407[_0x03ec('0x2e')]('.')[0x0];});};exports[_0x03ec('0x4b')]=function(_0x54c05f,_0x4c90bb,_0x7d9256){return google[_0x03ec('0x4c')](_0x54c05f,_0x4c90bb,_0x7d9256)[_0x03ec('0x2c')](function(_0x617fee){logger['info'](_0x617fee[_0x03ec('0x4d')]);return rp(_0x617fee);})[_0x03ec('0x2c')](function(_0x352857){var _0x367277='';var _0x12e631=0x0;try{fs[_0x03ec('0x1c')](_0x54c05f);}catch(_0x49db2a){logger[_0x03ec('0x13')](_0x49db2a);}if(_0x352857&&_0x352857[_0x03ec('0x4e')]){_0x367277=_0x352857['results'][_0x03ec('0x4f')](function(_0x4cbc4d){return _0x4cbc4d&&_0x4cbc4d[_0x03ec('0x50')][0x0]&&_0x4cbc4d['alternatives'][0x0][_0x03ec('0x51')]?_0x4cbc4d['alternatives'][0x0][_0x03ec('0x51')]:'';})[_0x03ec('0x52')]('\x0a');_0x12e631=_0x352857[_0x03ec('0x4e')][_0x03ec('0x4f')](function(_0x23775d){return _0x23775d&&_0x23775d[_0x03ec('0x50')][0x0]&&_0x23775d['alternatives'][0x0][_0x03ec('0x53')]?_0x23775d['alternatives'][0x0]['confidence']:0x0;})['join']('\x0a');}logger[_0x03ec('0x19')]('googleASR\x20transcription',_0x367277);logger[_0x03ec('0x19')]('googleASR\x20confidence',_0x12e631);return{'transcript':_0x367277,'confidence':_0x12e631};})[_0x03ec('0x54')](function(_0x591969){logger[_0x03ec('0x13')](_0x03ec('0x55'),_0x591969[_0x03ec('0x12')],_0x591969[_0x03ec('0x56')],_0x591969['message']);});};exports[_0x03ec('0x57')]=function(_0x129300,_0x5060b7,_0x22ec43,_0x41087d){var _0x192a54=apiai(_0x5060b7,{'language':_0x41087d||'en'});return _0x192a54[_0x03ec('0x58')](_0x22ec43,{'sessionId':md5(_0x129300)})[_0x03ec('0x2c')](function(_0x271e3e){logger[_0x03ec('0x19')](JSON['stringify'](_0x271e3e));return{'source':_0x271e3e['result'][_0x03ec('0x59')],'resolvedQuery':_0x271e3e[_0x03ec('0x5a')][_0x03ec('0x5b')],'action':_0x271e3e[_0x03ec('0x5a')][_0x03ec('0x5c')],'actionIncomplete':_0x271e3e['result'][_0x03ec('0x5d')],'speech':_0x271e3e['result'][_0x03ec('0x5e')]['speech'],'score':_0x271e3e[_0x03ec('0x5a')][_0x03ec('0x5f')],'statusCode':_0x271e3e[_0x03ec('0x60')]['code'],'endConversation':_0x271e3e[_0x03ec('0x5a')][_0x03ec('0x61')][_0x03ec('0x62')]||![],'isFallbackIntent':_0x271e3e[_0x03ec('0x5a')][_0x03ec('0x61')][_0x03ec('0x63')]};});};exports[_0x03ec('0x64')]=function(_0x40131b,_0x550923,_0x14f1ec,_0xa2b638,_0x18887d,_0xb8dce){var _0x18c099=_0xa2b638['replace'](/\\n/g,'\x0a');var _0x1e6874={'credentials':{'private_key':_0x18c099,'client_email':_0x14f1ec}};var _0x28428c=new dialogflow[(_0x03ec('0x65'))](_0x1e6874);var _0x4a0610=_0x28428c['sessionPath'](_0x550923,md5(_0x40131b));var _0xa43a5f={'session':_0x4a0610,'queryInput':{'text':{'text':_0x18887d,'languageCode':_0xb8dce}}};return _0x28428c[_0x03ec('0x66')](_0xa43a5f)[_0x03ec('0x2c')](function(_0x2638e4){if(_0x2638e4&&_0x2638e4[_0x03ec('0x46')]){logger[_0x03ec('0x19')]('Dialogflow\x20V2\x20response:',JSON[_0x03ec('0x44')](_0x2638e4));var _0x1abdc5=_0x2638e4[0x0];if(_0x1abdc5){var _0x4141a6={'action':_0x1abdc5[_0x03ec('0x67')][_0x03ec('0x5c')],'allRequiredParamsPresent':_0x1abdc5['queryResult']['allRequiredParamsPresent'],'endConversation':_0x1abdc5[_0x03ec('0x67')][_0x03ec('0x68')]&&_0x1abdc5[_0x03ec('0x67')]['diagnosticInfo']['fields']?_0x1abdc5[_0x03ec('0x67')][_0x03ec('0x68')][_0x03ec('0x69')][_0x03ec('0x6a')][_0x03ec('0x6b')]:![],'fulfillmentText':_0x1abdc5['queryResult'][_0x03ec('0x6c')],'intentName':_0x1abdc5[_0x03ec('0x67')][_0x03ec('0x6d')][_0x03ec('0x56')],'intentDisplayName':_0x1abdc5[_0x03ec('0x67')]['intent'][_0x03ec('0x6e')],'isFallbackIntent':_0x1abdc5[_0x03ec('0x67')][_0x03ec('0x6d')][_0x03ec('0x6f')],'languageCode':_0x1abdc5[_0x03ec('0x67')][_0x03ec('0x70')],'queryText':_0x1abdc5[_0x03ec('0x67')]['queryText'],'responseId':_0x1abdc5[_0x03ec('0x71')],'score':_0x1abdc5[_0x03ec('0x67')][_0x03ec('0x72')],'speech':_0x1abdc5[_0x03ec('0x67')]['fulfillmentText'],'providerResponse':JSON['stringify'](_0x2638e4)};return _0x4141a6;}}});};exports[_0x03ec('0x73')]=function(_0x45bfbc,_0x37b302,_0x5d66a8,_0x42a149){return tilde[_0x03ec('0x4c')](_0x45bfbc,_0x37b302,_0x5d66a8,_0x42a149)['then'](function(_0x5e38c7){try{fs['unlink'](_0x45bfbc);}catch(_0x110e6e){logger[_0x03ec('0x13')](_0x110e6e);}logger[_0x03ec('0x19')](_0x03ec('0x74'),_0x5e38c7[_0x03ec('0x51')]);logger['info']('Tilde\x20ASR\x20confidence',_0x5e38c7[_0x03ec('0x53')]);return _0x5e38c7;});};exports[_0x03ec('0x75')]=function(_0x469d29,_0x34f01d,_0x4d165d,_0x2cfecd,_0x52adf9,_0x5ef9bc){var _0x59aea4=path[_0x03ec('0x39')](__dirname,_0x03ec('0x27'),rs[_0x03ec('0x28')](0x4)+_0x03ec('0x3a'));var _0x993103;return aws[_0x03ec('0x76')](_0x469d29,_0x34f01d,_0x4d165d,_0x2cfecd,_0x52adf9,_0x5ef9bc,_0x59aea4)[_0x03ec('0x2c')](function(){_0x993103=path[_0x03ec('0x39')](__dirname,_0x03ec('0x27'),rs[_0x03ec('0x28')](0x4)+'.wav');return convertFile(_0x59aea4,_0x993103);})[_0x03ec('0x2c')](function(){try{fs[_0x03ec('0x1c')](_0x59aea4);fs['chmodSync'](_0x993103,_0x03ec('0x3e'));}catch(_0x27a776){logger[_0x03ec('0x13')](_0x27a776);}return _0x993103[_0x03ec('0x2e')]('.')[0x0];});};exports[_0x03ec('0x77')]=function(_0x58026c,_0x37bdcb,_0x23bbff,_0x4c6f89,_0x142eda,_0x179b0f){return aws[_0x03ec('0x78')](_0x58026c,_0x37bdcb,_0x23bbff,_0x4c6f89,_0x142eda,_0x179b0f)[_0x03ec('0x2c')](function(_0xe6b42d){logger[_0x03ec('0x19')](JSON[_0x03ec('0x44')](_0xe6b42d));return _0xe6b42d;});};exports[_0x03ec('0x79')]=function(_0x3128ea,_0x4bf999,_0x5b3545,_0x22b9a3){var _0x43cbbd=util['format']('%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3',ISPEECH_API,_0x3128ea,encodeURIComponent(_0x4bf999),_0x5b3545,_0x22b9a3);var _0x345fee=path[_0x03ec('0x39')](__dirname,'tmp',rs[_0x03ec('0x28')](0x4)+'.mp3');var _0x388b09;return downloadFile(_0x43cbbd,_0x345fee)[_0x03ec('0x2c')](function(){_0x388b09=path[_0x03ec('0x39')](__dirname,'tmp',rs[_0x03ec('0x28')](0x4)+'.wav');return convertFile(_0x345fee,_0x388b09);})[_0x03ec('0x2c')](function(){try{fs[_0x03ec('0x1c')](_0x345fee);fs[_0x03ec('0x2d')](_0x388b09,_0x03ec('0x3e'));}catch(_0x4cf4e2){logger[_0x03ec('0x13')](_0x4cf4e2);}return _0x388b09[_0x03ec('0x2e')]('.')[0x0];});};exports[_0x03ec('0x7a')]=function(_0x1751a6,_0x4bf8c4,_0x4d4e6a,_0x5492be){var _0x26a084=util[_0x03ec('0x7b')](_0x03ec('0x7c'),ISPEECH_API,_0x4bf8c4,_0x4d4e6a,base64Encode(_0x1751a6),_0x5492be?util[_0x03ec('0x7b')](_0x03ec('0x7d'),encodeURIComponent(_0x5492be)):_0x03ec('0x7e'));return uploadFile(_0x26a084)[_0x03ec('0x2c')](function(_0x5b3a25){return querystring[_0x03ec('0x7f')](_0x5b3a25);});};exports[_0x03ec('0x80')]=function(_0x34d55a,_0xa9e246){return sestek['nda'](_0x34d55a,_0xa9e246)['then'](function(_0x1bf787){logger['info'](JSON[_0x03ec('0x44')](_0x1bf787));var _0x3ba9ab={'speech':_0x1bf787[_0x03ec('0x81')],'action':_0x1bf787[_0x03ec('0x82')]?_0x1bf787[_0x03ec('0x82')][_0x03ec('0x83')]:undefined,'actiondata':_0x1bf787[_0x03ec('0x82')]?_0x1bf787[_0x03ec('0x82')][_0x03ec('0x84')]:undefined};if(_0x1bf787[_0x03ec('0x82')]&&_0x1bf787[_0x03ec('0x82')][_0x03ec('0x85')]){return base64Decode(_0x1bf787['channelData']['AudioFromTts'][_0x03ec('0x86')],path[_0x03ec('0x39')](__dirname,_0x03ec('0x27'),rs[_0x03ec('0x28')](0x4)+_0x03ec('0x29')))[_0x03ec('0x2c')](function(_0x41dcc6){_0x3ba9ab[_0x03ec('0x87')]=_0x41dcc6;return _0x3ba9ab;});}return _0x3ba9ab;});};exports[_0x03ec('0x88')]=function(){return __dirname;}; \ No newline at end of file +var _0x5055=['.wav','writeFileSync','then','777','split','readFileSync','toString','base64','googleCloudTTS','?key=','ssml','input','voice','audioConfig','MP3','POST','.mp3','from','audioContent','writeFile','chmodSync','googleCloudTTS\x20path','googleTTS','https://translate.google.com/_/TranslateWebserverUi/data/batchexecute','application/x-www-form-urlencoded','f.req=','jQ1olc','stringify','null','parse\x20response\x20failed:\x0a','length','text\x20length\x20limit\x20reached','lang\x20\x22','unlink','googleASR','asr','results','map','alternatives','transcript','join','confidence','googleASR\x20transcription','googleASR\x20confidence','catch','[%s]\x20%s:%s','name','googleDialogflow','textRequest','result','resolvedQuery','actionIncomplete','score','code','metadata','endConversation','SessionsClient','sessionPath','detectIntent','Dialogflow\x20V2\x20response:','queryResult','action','allRequiredParamsPresent','diagnosticInfo','fields','boolValue','fulfillmentText','intent','displayName','isFallback','languageCode','queryText','responseId','intentDetectionConfidence','tildeASR','Tilde\x20ASR\x20transcription','awsPolly','polly','awsLex','lex','ispeechTTS','format','ispeechASR','%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s','model=%s','parse','sestekNDA','nda','text','channelData','CustomAction','CustomActionData','AudioFromTts','Data','bluebird','https','md5','path','querystring','request-promise','randomstring','sox','util','./aws','./sestek','./tilde','../../../config/logger','agi','https://api.ispeech.org/api/rest','protocol','https:','host','statusCode','error','request\x20to\x20','statusMessage','\x20failed,\x20status\x20code\x20=\x20','createWriteStream','info','finish\x20download\x20file','download\x20error','pipe','WHAT_EVER','get','data','end','transcode','resolve','tmp','generate'];(function(_0x41d432,_0x20e878){var _0x1650f9=function(_0x27f177){while(--_0x27f177){_0x41d432['push'](_0x41d432['shift']());}};_0x1650f9(++_0x20e878);}(_0x5055,0x1e4));var _0x5505=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5055[_0x3dd15e];return _0x231fd0;};'use strict';var apiai=require('apiai-promise');var BPromise=require(_0x5505('0x0'));var dialogflow=require('dialogflow');var fs=require('fs');var http=require('http');var https=require(_0x5505('0x1'));var md5=require(_0x5505('0x2'));var path=require(_0x5505('0x3'));var querystring=require(_0x5505('0x4'));var rp=require(_0x5505('0x5'));var rs=require(_0x5505('0x6'));var sox=require(_0x5505('0x7'));var tts=require('google-tts-api');var urlParse=require('url')['parse'];var util=require(_0x5505('0x8'));var aws=require(_0x5505('0x9'));var google=require('./google');var sestek=require(_0x5505('0xa'));var tilde=require(_0x5505('0xb'));var logger=require(_0x5505('0xc'))(_0x5505('0xd'));var ISPEECH_API=_0x5505('0xe');function downloadFile(_0x37e005,_0x1e4ace){return new BPromise(function(_0x3b6527,_0x4efab7){var _0x1a3c8b=urlParse(_0x37e005);var _0xbd0292=_0x1a3c8b[_0x5505('0xf')]===_0x5505('0x10')?https:http;var _0xd90df={'host':_0x1a3c8b[_0x5505('0x11')],'path':_0x1a3c8b[_0x5505('0x3')],'headers':{'user-agent':'WHAT_EVER'}};_0xbd0292['get'](_0xd90df,function(_0x4de7bb){if(_0x4de7bb[_0x5505('0x12')]!==0xc8){logger[_0x5505('0x13')](_0x5505('0x14')+_0x37e005+'\x20failed,\x20status\x20code\x20=\x20'+_0x4de7bb[_0x5505('0x12')]+'\x20('+_0x4de7bb[_0x5505('0x15')]+')');_0x4efab7(new Error(_0x5505('0x14')+_0x37e005+_0x5505('0x16')+_0x4de7bb['statusCode']+'\x20('+_0x4de7bb[_0x5505('0x15')]+')'));return;}var _0x320f19=fs[_0x5505('0x17')](_0x1e4ace);_0x320f19['on']('finish',function(){logger[_0x5505('0x18')](_0x5505('0x19'));_0x320f19['close'](_0x3b6527);});_0x320f19['on'](_0x5505('0x13'),function(_0x1d2547){fs['unlink'](_0x1e4ace);logger[_0x5505('0x13')](_0x5505('0x1a'),_0x1d2547);_0x4efab7(_0x1d2547);});_0x4de7bb[_0x5505('0x1b')](_0x320f19);})['on']('error',function(_0xbfe99c){logger[_0x5505('0x13')](_0xbfe99c);_0x4efab7(_0xbfe99c);})['end']();});}function uploadFile(_0x2493b8){return new BPromise(function(_0x4d7ae9,_0x35d559){var _0x28ebbd=urlParse(_0x2493b8);var _0x1ff721=_0x28ebbd[_0x5505('0xf')]==='https:'?https:http;var _0x46c99d={'host':_0x28ebbd[_0x5505('0x11')],'path':_0x28ebbd['path'],'headers':{'user-agent':_0x5505('0x1c')}};_0x1ff721[_0x5505('0x1d')](_0x46c99d,function(_0xd4bcf9){if(_0xd4bcf9['statusCode']!==0xc8){_0x35d559(new Error(_0x5505('0x14')+_0x2493b8+_0x5505('0x16')+_0xd4bcf9[_0x5505('0x12')]+'\x20('+_0xd4bcf9[_0x5505('0x15')]+')'));return;}var _0x3d1360='';_0xd4bcf9['on'](_0x5505('0x1e'),function(_0x356279){_0x3d1360+=_0x356279;});_0xd4bcf9['on'](_0x5505('0x1f'),function(){_0x4d7ae9(_0x3d1360);});})['on'](_0x5505('0x13'),function(_0x18e403){_0x35d559(_0x18e403);})['end']();});}function convertFile(_0x24119d,_0xea5c55){return new BPromise(function(_0x42e84b,_0x7bf7dc){var _0x41e24d=sox[_0x5505('0x20')](_0x24119d,_0xea5c55,{'sampleRate':0x1f40,'format':'wav','channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x41e24d['on'](_0x5505('0x13'),function(_0x471bd0){logger[_0x5505('0x13')]('error\x20convert',_0x471bd0);_0x7bf7dc(_0x471bd0);});_0x41e24d['on'](_0x5505('0x1f'),function(){logger[_0x5505('0x18')]('finish\x20to\x20convert');_0x42e84b();});_0x41e24d['start']();});}function base64Decode(_0x269fe3,_0x2f8ea1){var _0x311878=path[_0x5505('0x21')](__dirname,_0x5505('0x22'),rs[_0x5505('0x23')](0x4)+_0x5505('0x24'));fs[_0x5505('0x25')](_0x311878,_0x269fe3,'base64');return convertFile(_0x311878,_0x2f8ea1)[_0x5505('0x26')](function(){try{fs['unlink'](_0x311878);fs['chmodSync'](_0x2f8ea1,_0x5505('0x27'));}catch(_0x5b8f87){logger[_0x5505('0x13')](_0x5b8f87);}return _0x2f8ea1[_0x5505('0x28')]('.')[0x0];});}function base64Encode(_0x35587a){var _0x40be7c=fs[_0x5505('0x29')](_0x35587a);return new Buffer(_0x40be7c)[_0x5505('0x2a')](_0x5505('0x2b'));}exports[_0x5505('0x2c')]=function(_0x5edfd6,_0x52edf5,_0x48ef31,_0x43558f,_0x4ed136,_0x35e8d2){var _0x272b7d,_0xd24696;var _0x26ffec='https://texttospeech.googleapis.com/v1/';var _0x13b972=_0x5505('0x2d')+_0x5edfd6;var _0x2c9540={};if(_0x52edf5===_0x5505('0x2e')){_0x2c9540[_0x5505('0x2f')]={'ssml':_0x48ef31};}else{_0x2c9540[_0x5505('0x2f')]={'text':_0x48ef31};};_0x2c9540[_0x5505('0x30')]={'languageCode':_0x43558f,'ssmlGender':_0x4ed136};_0x2c9540[_0x5505('0x31')]={'audioEncoding':_0x5505('0x32'),'sampleRateHertz':0x1f40};var _0x1aade3={'url':_0x26ffec+'text:synthesize'+_0x13b972,'method':_0x5505('0x33'),'json':!![],'body':_0x2c9540};return rp(_0x1aade3)[_0x5505('0x26')](function(_0x850a57){return new BPromise(function(_0x19eab3,_0x3da838){_0x272b7d=path[_0x5505('0x21')](__dirname,_0x5505('0x22'),rs[_0x5505('0x23')](0x4)+_0x5505('0x34'));var _0xc1396d=Buffer[_0x5505('0x35')](_0x850a57[_0x5505('0x36')],_0x5505('0x2b'));return fs[_0x5505('0x37')](_0x272b7d,_0xc1396d,function(_0x5f1c94){_0x3da838(_0x5f1c94);},function(_0xa6058b){fs[_0x5505('0x38')](_0x272b7d,_0x5505('0x27'));_0x19eab3(_0xa6058b);});});})[_0x5505('0x26')](function(_0x601acd){_0xd24696=path[_0x5505('0x21')](__dirname,_0x5505('0x22'),rs[_0x5505('0x23')](0x4)+_0x5505('0x24'));return convertFile(_0x272b7d,_0xd24696);})[_0x5505('0x26')](function(){try{fs['unlink'](_0x272b7d);fs[_0x5505('0x38')](_0xd24696,_0x5505('0x27'));}catch(_0xf9dc40){logger[_0x5505('0x13')](_0xf9dc40);}logger[_0x5505('0x18')](_0x5505('0x39'),_0xd24696[_0x5505('0x28')]('.')[0x0]);return _0xd24696[_0x5505('0x28')]('.')[0x0];});};exports[_0x5505('0x3a')]=function(_0xc4a7b9,_0x328741){var _0x2cca36=_0x5505('0x3b');var _0x49e447,_0x665d79;var _0x3d51d2;var _0x556c02={'encoding':'utf8','method':_0x5505('0x33'),'timeout':0x2710,'url':_0x2cca36,'headers':{'Content-Type':_0x5505('0x3c')},'body':_0x5505('0x3d')+encodeURIComponent(JSON['stringify']([[[_0x5505('0x3e'),JSON[_0x5505('0x3f')]([_0xc4a7b9,_0x328741||'en',![],_0x5505('0x40')]),null,'generic']]]))};return rp(_0x556c02)[_0x5505('0x26')](function(_0xd008ac){try{_0x3d51d2=eval(_0xd008ac['slice'](0x5))[0x0][0x2];}catch(_0x87fdcf){throw new Error(_0x5505('0x41')+_0xd008ac[_0x5505('0x1e')]);}if(!_0x3d51d2){if(_0xc4a7b9[_0x5505('0x42')]>0xc8){throw new Error(_0x5505('0x43'));}else{throw new Error(_0x5505('0x44')+_0x328741+'\x22\x20might\x20not\x20exist');}}try{_0x3d51d2=eval(_0x3d51d2)[0x0];}catch(_0x19ff28){throw new Error(_0x5505('0x41')+res['data']);}const _0x20731d=_0x3d51d2;_0x49e447=path[_0x5505('0x21')](__dirname,_0x5505('0x22'),rs[_0x5505('0x23')](0x4)+_0x5505('0x34'));fs[_0x5505('0x25')](_0x49e447,_0x3d51d2,{'encoding':_0x5505('0x2b')});_0x665d79=path['resolve'](__dirname,_0x5505('0x22'),rs[_0x5505('0x23')](0x4)+_0x5505('0x24'));return convertFile(_0x49e447,_0x665d79);})[_0x5505('0x26')](function(){try{fs[_0x5505('0x45')](_0x49e447);fs['chmodSync'](_0x665d79,_0x5505('0x27'));}catch(_0x4300e0){logger[_0x5505('0x13')](_0x4300e0);}logger[_0x5505('0x18')]('goggleTTS\x20path',_0x665d79[_0x5505('0x28')]('.')[0x0]);return _0x665d79[_0x5505('0x28')]('.')[0x0];});};exports[_0x5505('0x46')]=function(_0x427b6d,_0x28c071,_0x350455){return google[_0x5505('0x47')](_0x427b6d,_0x28c071,_0x350455)[_0x5505('0x26')](function(_0x518342){logger[_0x5505('0x18')](_0x518342['uri']);return rp(_0x518342);})['then'](function(_0x369ce9){var _0x2c59a8='';var _0x5e36e0=0x0;try{fs[_0x5505('0x45')](_0x427b6d);}catch(_0x22e96d){logger[_0x5505('0x13')](_0x22e96d);}if(_0x369ce9&&_0x369ce9[_0x5505('0x48')]){_0x2c59a8=_0x369ce9[_0x5505('0x48')][_0x5505('0x49')](function(_0x1ba5eb){return _0x1ba5eb&&_0x1ba5eb[_0x5505('0x4a')][0x0]&&_0x1ba5eb[_0x5505('0x4a')][0x0]['transcript']?_0x1ba5eb[_0x5505('0x4a')][0x0][_0x5505('0x4b')]:'';})[_0x5505('0x4c')]('\x0a');_0x5e36e0=_0x369ce9[_0x5505('0x48')][_0x5505('0x49')](function(_0x39b43f){return _0x39b43f&&_0x39b43f[_0x5505('0x4a')][0x0]&&_0x39b43f[_0x5505('0x4a')][0x0][_0x5505('0x4d')]?_0x39b43f['alternatives'][0x0]['confidence']:0x0;})[_0x5505('0x4c')]('\x0a');}logger[_0x5505('0x18')](_0x5505('0x4e'),_0x2c59a8);logger[_0x5505('0x18')](_0x5505('0x4f'),_0x5e36e0);return{'transcript':_0x2c59a8,'confidence':_0x5e36e0};})[_0x5505('0x50')](function(_0x1c094b){logger['error'](_0x5505('0x51'),_0x1c094b[_0x5505('0x12')],_0x1c094b[_0x5505('0x52')],_0x1c094b['message']);});};exports[_0x5505('0x53')]=function(_0x52f1e4,_0x4c2e8e,_0x21867c,_0x95bf9e){var _0x4ea76b=apiai(_0x4c2e8e,{'language':_0x95bf9e||'en'});return _0x4ea76b[_0x5505('0x54')](_0x21867c,{'sessionId':md5(_0x52f1e4)})[_0x5505('0x26')](function(_0x3bcca2){logger[_0x5505('0x18')](JSON[_0x5505('0x3f')](_0x3bcca2));return{'source':_0x3bcca2[_0x5505('0x55')]['source'],'resolvedQuery':_0x3bcca2[_0x5505('0x55')][_0x5505('0x56')],'action':_0x3bcca2['result']['action'],'actionIncomplete':_0x3bcca2[_0x5505('0x55')][_0x5505('0x57')],'speech':_0x3bcca2[_0x5505('0x55')]['fulfillment']['speech'],'score':_0x3bcca2[_0x5505('0x55')][_0x5505('0x58')],'statusCode':_0x3bcca2['status'][_0x5505('0x59')],'endConversation':_0x3bcca2[_0x5505('0x55')][_0x5505('0x5a')][_0x5505('0x5b')]||![],'isFallbackIntent':_0x3bcca2[_0x5505('0x55')][_0x5505('0x5a')]['isFallbackIntent']};});};exports['googleDialogflowV2']=function(_0x4efede,_0x1a3135,_0x24ed0e,_0x3f29ae,_0x1afe7b,_0x1c7525){var _0x6f1ba3=_0x3f29ae['replace'](/\\n/g,'\x0a');var _0x51d880={'credentials':{'private_key':_0x6f1ba3,'client_email':_0x24ed0e}};var _0x1938e0=new dialogflow[(_0x5505('0x5c'))](_0x51d880);var _0x3ff3f4=_0x1938e0[_0x5505('0x5d')](_0x1a3135,md5(_0x4efede));var _0x18e2d3={'session':_0x3ff3f4,'queryInput':{'text':{'text':_0x1afe7b,'languageCode':_0x1c7525}}};return _0x1938e0[_0x5505('0x5e')](_0x18e2d3)[_0x5505('0x26')](function(_0x5556b7){if(_0x5556b7&&_0x5556b7[_0x5505('0x42')]){logger['info'](_0x5505('0x5f'),JSON[_0x5505('0x3f')](_0x5556b7));var _0x326f92=_0x5556b7[0x0];if(_0x326f92){var _0x96e33d={'action':_0x326f92[_0x5505('0x60')][_0x5505('0x61')],'allRequiredParamsPresent':_0x326f92['queryResult'][_0x5505('0x62')],'endConversation':_0x326f92[_0x5505('0x60')][_0x5505('0x63')]&&_0x326f92[_0x5505('0x60')][_0x5505('0x63')][_0x5505('0x64')]?_0x326f92[_0x5505('0x60')][_0x5505('0x63')][_0x5505('0x64')]['end_conversation'][_0x5505('0x65')]:![],'fulfillmentText':_0x326f92[_0x5505('0x60')][_0x5505('0x66')],'intentName':_0x326f92[_0x5505('0x60')]['intent']['name'],'intentDisplayName':_0x326f92[_0x5505('0x60')][_0x5505('0x67')][_0x5505('0x68')],'isFallbackIntent':_0x326f92['queryResult'][_0x5505('0x67')][_0x5505('0x69')],'languageCode':_0x326f92[_0x5505('0x60')][_0x5505('0x6a')],'queryText':_0x326f92[_0x5505('0x60')][_0x5505('0x6b')],'responseId':_0x326f92[_0x5505('0x6c')],'score':_0x326f92[_0x5505('0x60')][_0x5505('0x6d')],'speech':_0x326f92[_0x5505('0x60')][_0x5505('0x66')],'providerResponse':JSON[_0x5505('0x3f')](_0x5556b7)};return _0x96e33d;}}});};exports[_0x5505('0x6e')]=function(_0x55f7db,_0x4062b9,_0x469381,_0x1a7a7f){return tilde[_0x5505('0x47')](_0x55f7db,_0x4062b9,_0x469381,_0x1a7a7f)[_0x5505('0x26')](function(_0x80099d){try{fs[_0x5505('0x45')](_0x55f7db);}catch(_0x15dcff){logger[_0x5505('0x13')](_0x15dcff);}logger['info'](_0x5505('0x6f'),_0x80099d['transcript']);logger[_0x5505('0x18')]('Tilde\x20ASR\x20confidence',_0x80099d[_0x5505('0x4d')]);return _0x80099d;});};exports[_0x5505('0x70')]=function(_0x59caad,_0x2409a3,_0x3cf25d,_0x24fdeb,_0x8937f9,_0x4a7cc7){var _0x37e009=path[_0x5505('0x21')](__dirname,'tmp',rs[_0x5505('0x23')](0x4)+_0x5505('0x34'));var _0x530ca5;return aws[_0x5505('0x71')](_0x59caad,_0x2409a3,_0x3cf25d,_0x24fdeb,_0x8937f9,_0x4a7cc7,_0x37e009)[_0x5505('0x26')](function(){_0x530ca5=path[_0x5505('0x21')](__dirname,'tmp',rs[_0x5505('0x23')](0x4)+_0x5505('0x24'));return convertFile(_0x37e009,_0x530ca5);})[_0x5505('0x26')](function(){try{fs[_0x5505('0x45')](_0x37e009);fs[_0x5505('0x38')](_0x530ca5,'777');}catch(_0x590bb3){logger[_0x5505('0x13')](_0x590bb3);}return _0x530ca5['split']('.')[0x0];});};exports[_0x5505('0x72')]=function(_0x58e721,_0x499075,_0x572a26,_0x3dcc0e,_0x3fe4b1,_0x3fcabb){return aws[_0x5505('0x73')](_0x58e721,_0x499075,_0x572a26,_0x3dcc0e,_0x3fe4b1,_0x3fcabb)[_0x5505('0x26')](function(_0x202048){logger[_0x5505('0x18')](JSON[_0x5505('0x3f')](_0x202048));return _0x202048;});};exports[_0x5505('0x74')]=function(_0x3355f7,_0x8a58c6,_0x40e72e,_0x1a6651){var _0x1bd31d=util[_0x5505('0x75')]('%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3',ISPEECH_API,_0x3355f7,encodeURIComponent(_0x8a58c6),_0x40e72e,_0x1a6651);var _0x12206b=path[_0x5505('0x21')](__dirname,_0x5505('0x22'),rs[_0x5505('0x23')](0x4)+_0x5505('0x34'));var _0x596daa;return downloadFile(_0x1bd31d,_0x12206b)[_0x5505('0x26')](function(){_0x596daa=path['resolve'](__dirname,_0x5505('0x22'),rs[_0x5505('0x23')](0x4)+_0x5505('0x24'));return convertFile(_0x12206b,_0x596daa);})[_0x5505('0x26')](function(){try{fs[_0x5505('0x45')](_0x12206b);fs[_0x5505('0x38')](_0x596daa,'777');}catch(_0x3f44ef){logger['error'](_0x3f44ef);}return _0x596daa[_0x5505('0x28')]('.')[0x0];});};exports[_0x5505('0x76')]=function(_0x399e9a,_0x49048d,_0x43d6a1,_0x137894){var _0x54a23=util[_0x5505('0x75')](_0x5505('0x77'),ISPEECH_API,_0x49048d,_0x43d6a1,base64Encode(_0x399e9a),_0x137894?util[_0x5505('0x75')](_0x5505('0x78'),encodeURIComponent(_0x137894)):'freeform=3');return uploadFile(_0x54a23)[_0x5505('0x26')](function(_0x59927a){return querystring[_0x5505('0x79')](_0x59927a);});};exports[_0x5505('0x7a')]=function(_0x4ba9cf,_0x298b54){return sestek[_0x5505('0x7b')](_0x4ba9cf,_0x298b54)[_0x5505('0x26')](function(_0x23b9d6){logger[_0x5505('0x18')](JSON['stringify'](_0x23b9d6));var _0x359a6e={'speech':_0x23b9d6[_0x5505('0x7c')],'action':_0x23b9d6[_0x5505('0x7d')]?_0x23b9d6[_0x5505('0x7d')][_0x5505('0x7e')]:undefined,'actiondata':_0x23b9d6[_0x5505('0x7d')]?_0x23b9d6[_0x5505('0x7d')][_0x5505('0x7f')]:undefined};if(_0x23b9d6[_0x5505('0x7d')]&&_0x23b9d6[_0x5505('0x7d')][_0x5505('0x80')]){return base64Decode(_0x23b9d6[_0x5505('0x7d')][_0x5505('0x80')][_0x5505('0x81')],path[_0x5505('0x21')](__dirname,_0x5505('0x22'),rs['generate'](0x4)+_0x5505('0x24')))[_0x5505('0x26')](function(_0x30eceb){_0x359a6e['audiofile']=_0x30eceb;return _0x359a6e;});}return _0x359a6e;});};exports['dirName']=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 24775fe..a8b3f3d 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 _0xf50e=['./nda','exports'];(function(_0xb1bc,_0x1d3718){var _0x47ced2=function(_0x34264f){while(--_0x34264f){_0xb1bc['push'](_0xb1bc['shift']());}};_0x47ced2(++_0x1d3718);}(_0xf50e,0x178));var _0xef50=function(_0x406e46,_0x5799cb){_0x406e46=_0x406e46-0x0;var _0x4a3742=_0xf50e[_0x406e46];return _0x4a3742;};var nda=require(_0xef50('0x0'));module[_0xef50('0x1')]={'nda':nda}; \ No newline at end of file +var _0x9548=['exports'];(function(_0x51020b,_0x38c2c7){var _0x371e47=function(_0x2a538f){while(--_0x2a538f){_0x51020b['push'](_0x51020b['shift']());}};_0x371e47(++_0x38c2c7);}(_0x9548,0xe8));var _0x8954=function(_0x251556,_0xa03f4a){_0x251556=_0x251556-0x0;var _0x1801c8=_0x9548[_0x251556];return _0x1801c8;};var nda=require('./nda');module[_0x8954('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 fc65792..e62ed06 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 _0x22a4=['project','ndagenerate_audio','body','channelData','AudioOutputSettings','audio/wav','custom_action','CustomAction','custom_action_data','CustomActionData','info','request-promise','url','../../../../../config/logger','agi','exports','resolve','ndauth_url','/token','password','username','then','POST','ndassistant_url','/api/NaturalDialogAssistant/v1/Run','ndaactivity_type','uniqueid','callerid','calleridname','dnid','extension','text'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x22a4,0x1cb));var _0x422a=function(_0x12b2dc,_0x438883){_0x12b2dc=_0x12b2dc-0x0;var _0x51cba6=_0x22a4[_0x12b2dc];return _0x51cba6;};'use strict';var rp=require(_0x422a('0x0'));var url=require(_0x422a('0x1'));var logger=require(_0x422a('0x2'))(_0x422a('0x3'));module[_0x422a('0x4')]=function(_0x3835c8,_0x4725b0){var _0x401b67={'method':'POST','uri':url[_0x422a('0x5')](_0x4725b0[_0x422a('0x6')],_0x422a('0x7')),'form':{'grant_type':_0x422a('0x8'),'username':_0x4725b0[_0x422a('0x9')],'password':_0x4725b0['password']},'json':!![]};return rp(_0x401b67)[_0x422a('0xa')](function(_0x1b4b08){var _0x23b1b0={'method':_0x422a('0xb'),'uri':url[_0x422a('0x5')](_0x4725b0[_0x422a('0xc')],_0x422a('0xd')),'body':{'type':_0x4725b0[_0x422a('0xe')]||'message','channelId':'Nda','conversation':{'id':_0x3835c8[_0x422a('0xf')]},'from':{'id':_0x3835c8[_0x422a('0x10')],'name':_0x3835c8[_0x422a('0x11')]},'recipient':{'id':_0x3835c8[_0x422a('0x12')],'name':_0x3835c8[_0x422a('0x13')]},'text':_0x4725b0[_0x422a('0x14')],'channelData':{}},'headers':{'Authorization':'Bearer\x20'+_0x1b4b08['access_token']},'json':!![]};if(_0x4725b0[_0x422a('0x15')]){_0x23b1b0['body']['channelData']['ProjectName']=_0x4725b0[_0x422a('0x15')];}if(_0x4725b0[_0x422a('0x16')]=='1'){_0x23b1b0[_0x422a('0x17')][_0x422a('0x18')][_0x422a('0x19')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0x422a('0x1a')};}if(_0x4725b0[_0x422a('0x1b')]){_0x23b1b0[_0x422a('0x17')][_0x422a('0x18')][_0x422a('0x1c')]=_0x4725b0[_0x422a('0x1b')];if(_0x4725b0[_0x422a('0x1d')]){_0x23b1b0[_0x422a('0x17')][_0x422a('0x18')][_0x422a('0x1e')]=_0x4725b0[_0x422a('0x1d')];}}logger[_0x422a('0x1f')](JSON['stringify'](_0x23b1b0));return rp(_0x23b1b0);});}; \ No newline at end of file +var _0xa0bc=['channelData','ndagenerate_audio','AudioOutputSettings','audio/wav','custom_action','CustomAction','custom_action_data','CustomActionData','info','url','../../../../../config/logger','exports','POST','resolve','ndauth_url','/token','password','username','then','ndassistant_url','/api/NaturalDialogAssistant/v1/Run','ndaactivity_type','message','Nda','callerid','calleridname','dnid','extension','text','Bearer\x20','access_token','project','body'];(function(_0x2f5ac5,_0x1ee939){var _0x37c9a8=function(_0x15031f){while(--_0x15031f){_0x2f5ac5['push'](_0x2f5ac5['shift']());}};_0x37c9a8(++_0x1ee939);}(_0xa0bc,0x1b6));var _0xca0b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa0bc[_0x3dd15e];return _0x231fd0;};'use strict';var rp=require('request-promise');var url=require(_0xca0b('0x0'));var logger=require(_0xca0b('0x1'))('agi');module[_0xca0b('0x2')]=function(_0x3031b2,_0x113486){var _0x68ff4={'method':_0xca0b('0x3'),'uri':url[_0xca0b('0x4')](_0x113486[_0xca0b('0x5')],_0xca0b('0x6')),'form':{'grant_type':_0xca0b('0x7'),'username':_0x113486[_0xca0b('0x8')],'password':_0x113486[_0xca0b('0x7')]},'json':!![]};return rp(_0x68ff4)[_0xca0b('0x9')](function(_0xa506a4){var _0x19acc2={'method':'POST','uri':url[_0xca0b('0x4')](_0x113486[_0xca0b('0xa')],_0xca0b('0xb')),'body':{'type':_0x113486[_0xca0b('0xc')]||_0xca0b('0xd'),'channelId':_0xca0b('0xe'),'conversation':{'id':_0x3031b2['uniqueid']},'from':{'id':_0x3031b2[_0xca0b('0xf')],'name':_0x3031b2[_0xca0b('0x10')]},'recipient':{'id':_0x3031b2[_0xca0b('0x11')],'name':_0x3031b2[_0xca0b('0x12')]},'text':_0x113486[_0xca0b('0x13')],'channelData':{}},'headers':{'Authorization':_0xca0b('0x14')+_0xa506a4[_0xca0b('0x15')]},'json':!![]};if(_0x113486[_0xca0b('0x16')]){_0x19acc2[_0xca0b('0x17')][_0xca0b('0x18')]['ProjectName']=_0x113486[_0xca0b('0x16')];}if(_0x113486[_0xca0b('0x19')]=='1'){_0x19acc2[_0xca0b('0x17')]['channelData'][_0xca0b('0x1a')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0xca0b('0x1b')};}if(_0x113486[_0xca0b('0x1c')]){_0x19acc2[_0xca0b('0x17')][_0xca0b('0x18')][_0xca0b('0x1d')]=_0x113486['custom_action'];if(_0x113486[_0xca0b('0x1e')]){_0x19acc2[_0xca0b('0x17')]['channelData'][_0xca0b('0x1f')]=_0x113486['custom_action_data'];}}logger[_0xca0b('0x20')](JSON['stringify'](_0x19acc2));return rp(_0x19acc2);});}; \ 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 c4af826..0580279 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 _0xd78e=['exports','./lib/api'];(function(_0x199394,_0x3d0297){var _0x61e770=function(_0x4615ba){while(--_0x4615ba){_0x199394['push'](_0x199394['shift']());}};_0x61e770(++_0x3d0297);}(_0xd78e,0x13f));var _0xed78=function(_0x2d9c6a,_0x59393d){_0x2d9c6a=_0x2d9c6a-0x0;var _0xf3c918=_0xd78e[_0x2d9c6a];return _0xf3c918;};'use strict';var asr=require(_0xed78('0x0'));module[_0xed78('0x1')]=function(_0x4a51d3,_0x2172ec,_0x506088,_0x1b9c8d){return asr(_0x4a51d3,_0x2172ec,_0x506088,_0x1b9c8d);}; \ No newline at end of file +var _0x38e6=['exports','./lib/api'];(function(_0x2f47b6,_0x4ff626){var _0x1503f0=function(_0x1b2f63){while(--_0x1b2f63){_0x2f47b6['push'](_0x2f47b6['shift']());}};_0x1503f0(++_0x4ff626);}(_0x38e6,0xb5));var _0x638e=function(_0x9510f5,_0x3a0263){_0x9510f5=_0x9510f5-0x0;var _0x24b8d9=_0x38e6[_0x9510f5];return _0x24b8d9;};'use strict';var asr=require(_0x638e('0x0'));module[_0x638e('0x1')]=function(_0x51b5c9,_0xb827e1,_0x2b4e19,_0x716a49){return asr(_0x51b5c9,_0xb827e1,_0x2b4e19,_0x716a49);}; \ 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 491f2fe..17a25c3 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 _0xba16=['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','Error\x20Tilde\x20ASR\x20socket','isNil','bluebird','lodash','moment','crypto','../../../../../../config/logger','exports','info','Tilde\x20URI','wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE','No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech','sha1','digest','hex','Open\x20Tilde\x20ASR\x20socket','unix','stringify','createReadStream','data','send','close','EOS','error','terminate','status','result','Tilde\x20ASR\x20hypoteses','hypotheses','likelihood','Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.'];(function(_0x3563dc,_0x23363e){var _0x2bcee1=function(_0x1d12ea){while(--_0x1d12ea){_0x3563dc['push'](_0x3563dc['shift']());}};_0x2bcee1(++_0x23363e);}(_0xba16,0x1cd));var _0x6ba1=function(_0x3873bf,_0x1c0241){_0x3873bf=_0x3873bf-0x0;var _0x9e86c9=_0xba16[_0x3873bf];return _0x9e86c9;};'use strict';var BPromise=require(_0x6ba1('0x0'));var _=require(_0x6ba1('0x1'));var fs=require('fs');var WebSocket=require('ws');var moment=require(_0x6ba1('0x2'));var crypto=require(_0x6ba1('0x3'));var logger=require(_0x6ba1('0x4'))('agi');module[_0x6ba1('0x5')]=function(_0x3b0394,_0x5e2c77,_0x2cfaa0,_0x52bab8){return new BPromise(function(_0x5458cb,_0x4043ed){logger[_0x6ba1('0x6')](_0x6ba1('0x7'),_0x52bab8||_0x6ba1('0x8'));var _0x1cea42=new WebSocket(_0x52bab8||_0x6ba1('0x8'),{'perMessageDeflate':![]});var _0x8218c8='';var _0x23edff='0';var _0x233660='1';var _0x5a59a0=_0x6ba1('0x9');function _0x1d9eab(_0x5a0bf7){var _0x23acb7=crypto['createHash'](_0x6ba1('0xa'));_0x23acb7['update'](_0x5a0bf7);return _0x23acb7[_0x6ba1('0xb')](_0x6ba1('0xc'));}function _0x258d5d(){try{logger[_0x6ba1('0x6')](_0x6ba1('0xd'));var _0x4a860a=moment()[_0x6ba1('0xe')]();var _0x9fde6=_0x1d9eab(_0x4a860a+_0x5e2c77+_0x2cfaa0);_0x1cea42['send'](JSON[_0x6ba1('0xf')]({'appID':_0x5e2c77,'timestamp':_0x4a860a,'appKey':_0x9fde6}));var _0x23a805=fs[_0x6ba1('0x10')](_0x3b0394);_0x23a805['on'](_0x6ba1('0x11'),function(_0x5378c3){_0x1cea42[_0x6ba1('0x12')](_0x5378c3);});_0x23a805['on'](_0x6ba1('0x13'),function(){_0x1cea42[_0x6ba1('0x12')](_0x6ba1('0x14'));});}catch(_0x52efaf){logger[_0x6ba1('0x15')]('Tilde\x20ASR\x20send\x20error',JSON['stringify'](_0x52efaf));_0x1cea42[_0x6ba1('0x16')]();}}function _0x47b346(_0x1d9a9f){try{if(_0x1d9a9f){var _0x5d704e=JSON['parse'](_0x1d9a9f);switch(_0x5d704e[_0x6ba1('0x17')]){case 0x0:if(_0x5d704e[_0x6ba1('0x18')]){if(_0x5d704e[_0x6ba1('0x18')]['final']){logger['info'](_0x6ba1('0x19'),JSON['stringify'](_0x5d704e[_0x6ba1('0x18')][_0x6ba1('0x1a')]));_0x8218c8=_0x5d704e[_0x6ba1('0x18')][_0x6ba1('0x1a')][0x0]['transcript'];_0x23edff=_0x5d704e[_0x6ba1('0x18')][_0x6ba1('0x1a')][0x0][_0x6ba1('0x1b')];_0x233660='0';_0x5a59a0='Success.';_0x1cea42[_0x6ba1('0x16')]();}}break;case 0x1:logger['info']('No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech');_0x233660='1';_0x5a59a0=_0x6ba1('0x9');break;case 0x2:logger['info']('Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.');_0x233660='2';_0x5a59a0=_0x6ba1('0x1c');break;case 0x9:logger[_0x6ba1('0x6')]('Not\x20available.\x20Max\x20load\x20limit\x20reached.');_0x233660='9';_0x5a59a0=_0x6ba1('0x1d');break;case 0xa:logger[_0x6ba1('0x6')](_0x6ba1('0x1e'));_0x233660='10';_0x5a59a0=_0x6ba1('0x1e');break;case 0xb:logger[_0x6ba1('0x6')]('All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.');_0x233660='11';_0x5a59a0=_0x6ba1('0x1f');}}}catch(_0x3b7219){logger['error'](_0x6ba1('0x20'),JSON[_0x6ba1('0xf')](_0x3b7219));_0x1cea42[_0x6ba1('0x16')]();}}function _0x233f93(){logger[_0x6ba1('0x6')]('Close\x20Tilde\x20ASR\x20socket');_0x5458cb({'transcript':_0x8218c8,'confidence':_0x23edff,'status':_0x233660,'status_message':_0x5a59a0});}function _0x377468(_0x2826e6){logger[_0x6ba1('0x15')](_0x6ba1('0x21'));if(!_[_0x6ba1('0x22')](_0x2826e6)){logger[_0x6ba1('0x15')](_['isObject'](_0x2826e6)?JSON[_0x6ba1('0xf')](_0x2826e6):_0x2826e6);}}_0x1cea42['on']('open',_0x258d5d);_0x1cea42['on']('message',_0x47b346);_0x1cea42['on'](_0x6ba1('0x13'),_0x233f93);_0x1cea42['on'](_0x6ba1('0x15'),_0x377468);});}; \ No newline at end of file +var _0x18c3=['send','stringify','data','close','Tilde\x20ASR\x20send\x20error','terminate','status','result','final','info','Tilde\x20ASR\x20hypoteses','hypotheses','transcript','Success.','Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.','Authentication\x20failed.','All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.','error','Close\x20Tilde\x20ASR\x20socket','Error\x20Tilde\x20ASR\x20socket','isObject','open','message','bluebird','lodash','crypto','../../../../../../config/logger','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','hex','Open\x20Tilde\x20ASR\x20socket','unix'];(function(_0x4b97a5,_0x57560f){var _0x4fbfc1=function(_0x319fe9){while(--_0x319fe9){_0x4b97a5['push'](_0x4b97a5['shift']());}};_0x4fbfc1(++_0x57560f);}(_0x18c3,0x1eb));var _0x318c=function(_0x7d9142,_0x3d657f){_0x7d9142=_0x7d9142-0x0;var _0x579017=_0x18c3[_0x7d9142];return _0x579017;};'use strict';var BPromise=require(_0x318c('0x0'));var _=require(_0x318c('0x1'));var fs=require('fs');var WebSocket=require('ws');var moment=require('moment');var crypto=require(_0x318c('0x2'));var logger=require(_0x318c('0x3'))('agi');module['exports']=function(_0x10507f,_0x582bf9,_0x33c7b3,_0x6ad012){return new BPromise(function(_0xec1d92,_0x271148){logger['info'](_0x318c('0x4'),_0x6ad012||_0x318c('0x5'));var _0x5415b8=new WebSocket(_0x6ad012||_0x318c('0x5'),{'perMessageDeflate':![]});var _0xfab5b0='';var _0x37c5dc='0';var _0x4115e8='1';var _0x28f3ec=_0x318c('0x6');function _0x1d05f4(_0x578df8){var _0x51914b=crypto[_0x318c('0x7')](_0x318c('0x8'));_0x51914b[_0x318c('0x9')](_0x578df8);return _0x51914b['digest'](_0x318c('0xa'));}function _0x1c5cdd(){try{logger['info'](_0x318c('0xb'));var _0x10efa4=moment()[_0x318c('0xc')]();var _0x2c00af=_0x1d05f4(_0x10efa4+_0x582bf9+_0x33c7b3);_0x5415b8[_0x318c('0xd')](JSON[_0x318c('0xe')]({'appID':_0x582bf9,'timestamp':_0x10efa4,'appKey':_0x2c00af}));var _0x34624c=fs['createReadStream'](_0x10507f);_0x34624c['on'](_0x318c('0xf'),function(_0x219d2e){_0x5415b8[_0x318c('0xd')](_0x219d2e);});_0x34624c['on'](_0x318c('0x10'),function(){_0x5415b8[_0x318c('0xd')]('EOS');});}catch(_0x120b96){logger['error'](_0x318c('0x11'),JSON['stringify'](_0x120b96));_0x5415b8[_0x318c('0x12')]();}}function _0x971187(_0x431354){try{if(_0x431354){var _0x4d602a=JSON['parse'](_0x431354);switch(_0x4d602a[_0x318c('0x13')]){case 0x0:if(_0x4d602a[_0x318c('0x14')]){if(_0x4d602a[_0x318c('0x14')][_0x318c('0x15')]){logger[_0x318c('0x16')](_0x318c('0x17'),JSON[_0x318c('0xe')](_0x4d602a['result']['hypotheses']));_0xfab5b0=_0x4d602a['result'][_0x318c('0x18')][0x0][_0x318c('0x19')];_0x37c5dc=_0x4d602a[_0x318c('0x14')][_0x318c('0x18')][0x0]['likelihood'];_0x4115e8='0';_0x28f3ec=_0x318c('0x1a');_0x5415b8[_0x318c('0x12')]();}}break;case 0x1:logger[_0x318c('0x16')]('No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech');_0x4115e8='1';_0x28f3ec='No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech';break;case 0x2:logger[_0x318c('0x16')](_0x318c('0x1b'));_0x4115e8='2';_0x28f3ec=_0x318c('0x1b');break;case 0x9:logger[_0x318c('0x16')]('Not\x20available.\x20Max\x20load\x20limit\x20reached.');_0x4115e8='9';_0x28f3ec='Not\x20available.\x20Max\x20load\x20limit\x20reached.';break;case 0xa:logger['info']('Authentication\x20failed.');_0x4115e8='10';_0x28f3ec=_0x318c('0x1c');break;case 0xb:logger[_0x318c('0x16')](_0x318c('0x1d'));_0x4115e8='11';_0x28f3ec='All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.';}}}catch(_0x4ad738){logger[_0x318c('0x1e')]('Tilde\x20ASR\x20parse\x20error',JSON['stringify'](_0x4ad738));_0x5415b8['terminate']();}}function _0x6d45b0(){logger['info'](_0x318c('0x1f'));_0xec1d92({'transcript':_0xfab5b0,'confidence':_0x37c5dc,'status':_0x4115e8,'status_message':_0x28f3ec});}function _0x38ecd8(_0x328c2f){logger[_0x318c('0x1e')](_0x318c('0x20'));if(!_['isNil'](_0x328c2f)){logger[_0x318c('0x1e')](_[_0x318c('0x21')](_0x328c2f)?JSON[_0x318c('0xe')](_0x328c2f):_0x328c2f);}}_0x5415b8['on'](_0x318c('0x22'),_0x1c5cdd);_0x5415b8['on'](_0x318c('0x23'),_0x971187);_0x5415b8['on'](_0x318c('0x10'),_0x6d45b0);_0x5415b8['on'](_0x318c('0x1e'),_0x38ecd8);});}; \ 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 5b061d7..20fbd75 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 _0x1f68=['exports','./asr'];(function(_0x3c0fc6,_0x6962e){var _0x4440bd=function(_0x36654e){while(--_0x36654e){_0x3c0fc6['push'](_0x3c0fc6['shift']());}};_0x4440bd(++_0x6962e);}(_0x1f68,0x175));var _0x81f6=function(_0x433a86,_0x175b5c){_0x433a86=_0x433a86-0x0;var _0x23000c=_0x1f68[_0x433a86];return _0x23000c;};var asr=require(_0x81f6('0x0'));module[_0x81f6('0x1')]={'asr':asr}; \ No newline at end of file +var _0x19ab=['exports','./asr'];(function(_0x3e112d,_0x2bb132){var _0x531c31=function(_0x1954bc){while(--_0x1954bc){_0x3e112d['push'](_0x3e112d['shift']());}};_0x531c31(++_0x2bb132);}(_0x19ab,0x183));var _0xb19a=function(_0x48bb20,_0x33ba9f){_0x48bb20=_0x48bb20-0x0;var _0xdfa034=_0x19ab[_0x48bb20];return _0xdfa034;};var asr=require(_0xb19a('0x0'));module[_0xb19a('0x1')]={'asr':asr}; \ No newline at end of file diff --git a/server/services/agi/server.js b/server/services/agi/server.js index 61c9257..bd0bb13 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 _0x1820=['./channel','127.0.0.1','call','emit','E_AGI_ARGUMENT_PORT','createServer','listening','connection','getConnections','error','E_AGI_SERVER_VOICE_DISABLED','ready','code','close','E_AGI_SERVER_CLOSE','nextTick','inherits','exports','util','net','events'];(function(_0x403c20,_0x4a7b99){var _0x2b271a=function(_0x106ecb){while(--_0x106ecb){_0x403c20['push'](_0x403c20['shift']());}};_0x2b271a(++_0x4a7b99);}(_0x1820,0x1b6));var _0x0182=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x1820[_0x501510];return _0x1e6ee5;};'use strict';var util=require(_0x0182('0x0'));var net=require(_0x0182('0x1'));var EventEmitter=require(_0x0182('0x2'))['EventEmitter'];var AGIError=require('./error');var AGIChannel=require(_0x0182('0x3'));var AGIServer=function(_0x429ca3,_0x2e7969,_0x22ae32){var _0x41342a=this,_0x429ca3=_0x429ca3||0x11dd,_0x2e7969=_0x2e7969||_0x0182('0x4'),_0x1faa24=null,_0x29dc2d=0x0;EventEmitter[_0x0182('0x5')](_0x41342a);function _0x48b732(){if(!_0x429ca3){_0x41342a[_0x0182('0x6')]('error',new AGIError(_0x0182('0x7')));return![];}_0x1faa24=net[_0x0182('0x8')]();_0x1faa24['listen'](_0x429ca3,_0x2e7969);_0x1faa24['on'](_0x0182('0x9'),function(){_0x41342a[_0x0182('0x6')](_0x0182('0x9'));});_0x1faa24['on'](_0x0182('0xa'),function(_0x3d0f1a){_0x1faa24[_0x0182('0xb')](function(_0x1697e1,_0x2572d3){if(_0x1697e1){_0x41342a[_0x0182('0x6')](_0x0182('0xc'),new AGIError('E_AGI_SERVER_ERROR',_0x1697e1));}else if(_0x22ae32&&_0x22ae32<0x0){_0x41342a[_0x0182('0x6')]('error',new AGIError(_0x0182('0xd')));_0x3d0f1a['destroy']();}else if(_0x22ae32&&_0x22ae32>0x0&&_0x22ae32<_0x2572d3){_0x29dc2d+=0x1;_0x41342a[_0x0182('0x6')](_0x0182('0xc'),new AGIError('E_AGI_SERVER_MAXCONNECTION',_0x29dc2d));_0x3d0f1a['destroy']();}else{var _0x3243fc=new AGIChannel(_0x3d0f1a);_0x3243fc['on'](_0x0182('0xe'),function(){_0x41342a[_0x0182('0x6')](_0x0182('0xa'),_0x3243fc);});}});});_0x1faa24['on'](_0x0182('0xc'),function(_0x308a78){_0x41342a[_0x0182('0x6')](_0x0182('0xc'),new AGIError('E_AGI_SERVER_ERROR',_0x308a78[_0x0182('0xf')]));});_0x1faa24['on'](_0x0182('0x10'),function(){_0x41342a['emit'](_0x0182('0x10'),new AGIError(_0x0182('0x11')));});}process[_0x0182('0x12')](function(){_0x48b732();});};util[_0x0182('0x13')](AGIServer,EventEmitter);module[_0x0182('0x14')]=function(_0x13b134,_0x573bc6,_0x2b975a){return new AGIServer(_0x13b134,_0x573bc6,_0x2b975a);}; \ No newline at end of file +var _0xd0c1=['getConnections','E_AGI_SERVER_ERROR','destroy','E_AGI_SERVER_MAXCONNECTION','ready','connection','close','E_AGI_SERVER_CLOSE','nextTick','inherits','exports','util','net','events','./error','./channel','127.0.0.1','emit','error','E_AGI_ARGUMENT_PORT','createServer','listen','listening'];(function(_0x52a2b4,_0x245f13){var _0x11a2b5=function(_0x58381b){while(--_0x58381b){_0x52a2b4['push'](_0x52a2b4['shift']());}};_0x11a2b5(++_0x245f13);}(_0xd0c1,0x95));var _0x1d0c=function(_0x2816f7,_0x2bbcb){_0x2816f7=_0x2816f7-0x0;var _0x2490b8=_0xd0c1[_0x2816f7];return _0x2490b8;};'use strict';var util=require(_0x1d0c('0x0'));var net=require(_0x1d0c('0x1'));var EventEmitter=require(_0x1d0c('0x2'))['EventEmitter'];var AGIError=require(_0x1d0c('0x3'));var AGIChannel=require(_0x1d0c('0x4'));var AGIServer=function(_0x1109ab,_0x2feff9,_0x23bb64){var _0x534495=this,_0x1109ab=_0x1109ab||0x11dd,_0x2feff9=_0x2feff9||_0x1d0c('0x5'),_0x5c69ba=null,_0x2ff6db=0x0;EventEmitter['call'](_0x534495);function _0x5827af(){if(!_0x1109ab){_0x534495[_0x1d0c('0x6')](_0x1d0c('0x7'),new AGIError(_0x1d0c('0x8')));return![];}_0x5c69ba=net[_0x1d0c('0x9')]();_0x5c69ba[_0x1d0c('0xa')](_0x1109ab,_0x2feff9);_0x5c69ba['on'](_0x1d0c('0xb'),function(){_0x534495['emit'](_0x1d0c('0xb'));});_0x5c69ba['on']('connection',function(_0x37ae92){_0x5c69ba[_0x1d0c('0xc')](function(_0x5909e0,_0x40341a){if(_0x5909e0){_0x534495[_0x1d0c('0x6')](_0x1d0c('0x7'),new AGIError(_0x1d0c('0xd'),_0x5909e0));}else if(_0x23bb64&&_0x23bb64<0x0){_0x534495['emit'](_0x1d0c('0x7'),new AGIError('E_AGI_SERVER_VOICE_DISABLED'));_0x37ae92[_0x1d0c('0xe')]();}else if(_0x23bb64&&_0x23bb64>0x0&&_0x23bb64<_0x40341a){_0x2ff6db+=0x1;_0x534495[_0x1d0c('0x6')]('error',new AGIError(_0x1d0c('0xf'),_0x2ff6db));_0x37ae92['destroy']();}else{var _0x306ebc=new AGIChannel(_0x37ae92);_0x306ebc['on'](_0x1d0c('0x10'),function(){_0x534495[_0x1d0c('0x6')](_0x1d0c('0x11'),_0x306ebc);});}});});_0x5c69ba['on']('error',function(_0x558f82){_0x534495[_0x1d0c('0x6')]('error',new AGIError('E_AGI_SERVER_ERROR',_0x558f82['code']));});_0x5c69ba['on'](_0x1d0c('0x12'),function(){_0x534495[_0x1d0c('0x6')](_0x1d0c('0x12'),new AGIError(_0x1d0c('0x13')));});}process[_0x1d0c('0x14')](function(){_0x5827af();});};util[_0x1d0c('0x15')](AGIServer,EventEmitter);module[_0x1d0c('0x16')]=function(_0x12281f,_0x65b1a6,_0x15e1b7){return new AGIServer(_0x12281f,_0x65b1a6,_0x15e1b7);}; \ No newline at end of file diff --git a/server/services/agi/vertices.js b/server/services/agi/vertices.js index ebc94ba..fd3da3b 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 _0x5025=['no\x20private_key\x20configured','dialogflowV2_language','no\x20anguage\x20configured','providerResponse','DialogflowV2\x20Result\x20%s','DialogflowV2\x20is\x20unreachable','sesteknda','ndauth_url','no\x20ndauth\x20url\x20configured','username','no\x20username\x20configured','password','no\x20password\x20configured','ndassistant_url','Trying\x20SestekNDA:\x20%s','SESTEK_NDA_%s','audiofile','Sestek\x20NDA\x20%s\x20file\x20created','streamFile','.wav','SestekNDA\x20Result\x20%s','SestekNDA\x20is\x20unreachable','end','Enter\x20in\x20END\x20(%s)\x20block','ext_dial','Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block','trunk_id','no\x20trunk\x20selected','SIP/%s/%s','finally','Enter\x20in\x20FINALLY\x20(%s)\x20block','getdigits','Enter\x20in\x20GETDIGITS\x20(%s)\x20block','file_id','no\x20file\x20audio\x20found','getData','response','maxdigit','mindigit','hiddendigitsnum','hiddendigitspos','substr','Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block','goal','Enter\x20in\x20GOAL\x20(%s)\x20block','goalname','no\x20valid\x20credentials\x20configured','aws\x20Polly\x20%s\x20file\x20created','unlink','awslex','Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block','no\x20bot\x20name\x20configured','Trying\x20Amazon\x20Lex:\x20%s','AWS_LEX_%s','amazonlex','Amazon\x20Lex\x20Result\x20%s','Amazon\x20Lex\x20is\x20unreachable','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','no\x20key\x20configured','wav','%s/recordings/%s','generate','beep','NOBEEP','recordFile','GOOGLE_ASR_%s','GoogleASR\x20Result\x20%s','Enter\x20in\x20TILDEASR\x20(%s)\x20block','appid','no\x20appid\x20configured','no\x20appsecret\x20configured','intKey','tilde\x20%s\x20file\x20created','TILDE_ASR_%s','TildeASR\x20Result\x20%s','Enter\x20in\x20GOTO\x20(%s)\x20block','continueAt','priority','gotoif','Enter\x20in\x20GOTOIF\x20(%s)\x20block','condition','true','false','EVAL\x20CONDITION\x20%s\x20%s','Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block','interval_id','no\x20interval\x20configured','getIntervals','IFTIME(%s?true:false)','IFTIME\x20%s\x20%s','hangup','Enter\x20in\x20HANGUP\x20(%s)\x20block','ispeechasr','Enter\x20in\x20ISPEECHASR\x20(%s)\x20block','ispeech\x20%s\x20file\x20created','ispeechtts','Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block','ispeech\x20TTS\x20is\x20unreachable','Enter\x20in\x20LOGIN\x20(%s)\x20block','findBy','no\x20find\x20by\x20configured','FIND\x20AGENT\x20%s\x20BY\x20%s','AGENT\x20%s\x20FOUND\x20BY','AGENT\x20%s\x20NOT\x20FOUND\x20BY','logout','Enter\x20in\x20LOGOUT\x20(%s)\x20block','success','failure','math','Enter\x20in\x20MATH\x20(%s)\x20block','no\x20operation\x20configured','math\x20%s','operation','%s[%s]','variable\x20%s[key]\x20set','Enter\x20in\x20MENU\x20(%s)\x20block','no\x20file\x20audio\x20selected','Enter\x20in\x20NOOP\x20(%s)\x20block','output','pause','Enter\x20in\x20PAUSE\x20(%s)\x20block','playback','Enter\x20in\x20PLAYBACK\x20(%s)\x20block','PLAYBACK','queue','queue_id','no\x20queue\x20selected','no\x20queue\x20found','indexOf','XMCS-QUEUE','toLowerCase','QUEUE','macro','gosub','position','record','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','Response:','inspect','no\x20variable\x20selected\x20for\x20the\x20response','%s_STATUS_CODE','200','%s_STATUS_MESSAGE','Unable\x20to\x20set\x20result\x20in\x20variable\x20%s','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','sayDigits','saynumber','sayPhonetic','sendMail','Enter\x20in\x20SENDMAIL\x20(%s)\x20block','account_id','Smtp','no\x20mail\x20account\x20found','\x22%s\x22\x20<%s>','user','service','host','port','secure','auth','template_id','Trying\x20SendMail\x20with\x20account\x20%s','Mail\x20message\x20added\x20to\x20outgoing\x20process','sendFax','SENDFAX\x20block\x20not\x20implemented','sendSMS','Enter\x20in\x20SENDSMS\x20(%s)\x20block','sms_account_id','no\x20sms\x20account\x20configured','getSmsAccount','no\x20sms\x20account\x20found','sms_text','sendSMS\x20message','Trying\x20SendSMS\x20with\x20account\x20%s','Sms\x20message\x20added\x20to\x20outgoing\x20process','set','Enter\x20in\x20SET\x20(%s)\x20block','no\x20variable\x20selected','start','START\x20CALLY\x20SQUARE','Answer','Skipped\x20Answer','subproject','Enter\x20in\x20SUBPROJECT\x20(%s)\x20block','project_id','no\x20subproject\x20selected','no\x20subproject\x20found\x20with\x20id\x20%d','project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project','AGI','agi://%s/square,\x22%s\x22,\x22%s\x22','127.0.0.1','system','Enter\x20in\x20SYSTEM\x20(%s)\x20block','command','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','Trying\x20Google\x20TTS\x20%s','unpause','Enter\x20in\x20UNPAUSE\x20(%s)\x20block','voicemail','Enter\x20in\x20VOICEMAIL\x20(%s)\x20block','VOICEMAIL','mailbox','vswitch','Enter\x20in\x20SWITCH\x20(%s)\x20block','join','exports','path','util','lodash','shelljs','odbc','moment','mustache','request-promise','../../config/logger','agi','../../config/environment','/var/opt/motion2/server/files','rawHeaders','rawBody','menu','getsecretdigits','rpc','mailRpc','getVariable','getVariableById','then','name','prototype','getVoiceQueue','catch','getSquareProject','getSquareProjectById','getSquareOdbc','getSquareOdbcById','getUser','getUserById','getTrunk','getTrunkById','getSound','getSoundById','getSoundPath','save_name','getMailAccount','getMailAccountById','sendMailMessage','getIntervalById','IntervalId','interval','map','Intervals','format','%s/sounds/converted/%s','getQueryOdbc','open','error','Error\x20getting\x20ODBC\x20connection\x20%s','ODBC\x20connection\x20successfully','query','info','Error\x20executing\x20query\x20%s','Query\x20executed\x20correctly\x20%s','close','Error\x20closing\x20connection\x20to\x20odbc\x20%s','getSmsAccountById','createSmsMessage','createSquareDetailsReport','channel','uniqueid','agicommand','arg_1','callerid','createSquareRecording','calleridname','extension','dnid','file','callback_','random','isEmpty','lastName','isNil','phone','list_id','scheduledAt','callback','Callback\x20scheduled\x20at\x20','toString','getPause','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','en-US','ssmlGender','MALE','MP3','googleTTS','google_tts_language','url','method','number','timeout','includes','toUpperCase','body','An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function','headers','parse','computedVariables','uri','render','stringify','An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function','statusCode','statusMessage','message','500\x20-\x20Internal\x20Server\x20Error','options','googleDialogflow','key','dialogflowV2_project_id','sestekNDA','ispeechTTS','speed','ispeechASR','ispeech_asr_language','isConfigured','model','awsPolly','aws_polly_region','aws_polly_voice','Amy','aws_text_type','awsLex','aws_access_key_id','aws_secret_access_key','aws_lex_region','aws_bot_name','googleASR','google_asr_language','tildeASR','appsecret','clear','clone','hasOwnProperty','isString','replaceObjectAllVariables','replaceAllVariables','recursiveNodeIndex','isPlainObject','isArray','saveRestApiResult','%s.%s','length','split','extra','getAndSetVariable','result','setVariable','maxRetry','sync','retry','mrcpsynth','Enter\x20in\x20MRCPSynth\x20(%s)\x20block','label','noop','no\x20text\x20configured','MRCPSynth','Executed\x20command\x20MRCPSynth\x20%s','Enter\x20in\x20MRCPRecog\x20(%s)\x20block','grammar','no\x20grammar\x20configured','MRCPRecog','RECOG_CONFIDENCE()','MRCP_RECOG_CONFIDENCE','RECOG_INPUT()','MRCP_RECOG_TRANSCRIPT','RECOG_INSTANCE()','MRCP_RECOG_INSTANCE','Enter\x20in\x20AGI\x20(%s)\x20block','answer','Enter\x20in\x20ANSWER\x20(%s)\x20block','wait','Enter\x20in\x20CALLBACK\x20(%s)\x20block','no\x20list\x20selected','delay','minutes','callback_priority','CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s','custom_app','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','LUMENVOX_ASR_TRANSCRIPT','LUMENVOX_ASR_INSTANCE','Executed\x20command\x20MRCPRecog\x20%s','sestekasr','Enter\x20in\x20SESTEKASR\x20(%s)\x20block','SESTEK_ASR_CONFIDENCE','SESTEK_ASR_TRANSCRIPT','SESTEK_ASR_INSTANCE','database','Enter\x20in\x20DATABASE\x20(%s)\x20block','odbc_id','no\x20database\x20selected','no\x20odbc\x20database\x20found','no\x20query\x20configured','query:\x20%s','variable_id','no\x20variable\x20selected\x20for\x20the\x20result','no\x20variable\x20found','keys','forEach','%s_ROWS_COUNT','variable\x20%s\x20set','dial','debug','Enter\x20in\x20DIAL\x20(%s)\x20block','no\x20user\x20selected','sip_id','no\x20user\x20found','SIP/%s','opts','Executed\x20command\x20%s','DIAL','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','bot','createSquareMessage','Trying\x20Dialogflow:\x20%s','DIALOGFLOW_%s','speech','out','Dialogflow\x20Result\x20%s','Dialogflow\x20is\x20unreachable','dialogflowV2','Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block','no\x20project_id\x20configured','client_email','no\x20client_email\x20configured','private_key'];(function(_0x2e8418,_0x58c529){var _0x548fe6=function(_0x2b2877){while(--_0x2b2877){_0x2e8418['push'](_0x2e8418['shift']());}};_0x548fe6(++_0x58c529);}(_0x5025,0xdc));var _0x5502=function(_0x3c8f26,_0x453699){_0x3c8f26=_0x3c8f26-0x0;var _0x5a4dd7=_0x5025[_0x3c8f26];return _0x5a4dd7;};'use strict';var fs=require('fs');var path=require(_0x5502('0x0'));var util=require(_0x5502('0x1'));var _=require(_0x5502('0x2'));var sh=require(_0x5502('0x3'));var odbc=require(_0x5502('0x4'))();var rs=require('randomstring');var moment=require(_0x5502('0x5'));var Mustache=require(_0x5502('0x6'));var rp=require(_0x5502('0x7'));var logger=require(_0x5502('0x8'))(_0x5502('0x9'));var config=require(_0x5502('0xa'));var scripts=require('./scripts');var FILES_PATH=_0x5502('0xb');var recursiveMapAttributes=[_0x5502('0xc'),_0x5502('0xd')];var verticesWithRetry=[_0x5502('0xe'),'getdigits',_0x5502('0xf')];var AGIVertices=function(_0x156441,_0x24f542,_0xf4bdd0){this['channel']=_0x156441;this[_0x5502('0x10')]=_0x24f542;this[_0x5502('0x11')]=_0xf4bdd0;};AGIVertices['prototype'][_0x5502('0x12')]=function(_0x547b28,_0x58b7f1){this['rpc'][_0x5502('0x13')](_0x547b28)[_0x5502('0x14')](function(_0x5829c6){_0x58b7f1(null,_0x5829c6?_0x5829c6[_0x5502('0x15')]:![]);})['catch'](function(_0x429f98){_0x58b7f1(_0x429f98);});};AGIVertices[_0x5502('0x16')][_0x5502('0x17')]=function(_0x33b1e2,_0x3e6a16){this['rpc']['getVoiceQueueById'](_0x33b1e2)[_0x5502('0x14')](function(_0x8c8841){_0x3e6a16(null,_0x8c8841?_0x8c8841[_0x5502('0x15')]:![]);})[_0x5502('0x18')](function(_0x30e953){_0x3e6a16(_0x30e953);});};AGIVertices[_0x5502('0x16')][_0x5502('0x19')]=function(_0x2e85d9,_0xdf8b18){this[_0x5502('0x10')][_0x5502('0x1a')](_0x2e85d9)[_0x5502('0x14')](function(_0x46b568){_0xdf8b18(null,_0x46b568?_0x46b568[_0x5502('0x15')]:![]);})[_0x5502('0x18')](function(_0x1f05b6){_0xdf8b18(_0x1f05b6);});};AGIVertices['prototype'][_0x5502('0x1b')]=function(_0x2dc17b,_0x1e548c){this[_0x5502('0x10')][_0x5502('0x1c')](_0x2dc17b)[_0x5502('0x14')](function(_0x12de71){_0x1e548c(null,_0x12de71?_0x12de71['dsn']:![]);})[_0x5502('0x18')](function(_0x57ba24){_0x1e548c(_0x57ba24);});};AGIVertices[_0x5502('0x16')][_0x5502('0x1d')]=function(_0x3b81ee,_0x163117){this[_0x5502('0x10')][_0x5502('0x1e')](_0x3b81ee)[_0x5502('0x14')](function(_0x131ee7){_0x163117(null,_0x131ee7?_0x131ee7[_0x5502('0x15')]:![]);})['catch'](function(_0x4f6cf6){_0x163117(_0x4f6cf6);});};AGIVertices[_0x5502('0x16')][_0x5502('0x1f')]=function(_0x11775e,_0x58da7c){this[_0x5502('0x10')][_0x5502('0x20')](_0x11775e)['then'](function(_0x553592){_0x58da7c(null,_0x553592?_0x553592['name']:![]);})[_0x5502('0x18')](function(_0x52dfe6){_0x58da7c(_0x52dfe6);});};AGIVertices[_0x5502('0x16')][_0x5502('0x21')]=function(_0x488d8f,_0x2e45f8){var _0x36c3a6=this;this[_0x5502('0x10')][_0x5502('0x22')](_0x488d8f)['then'](function(_0x4007bb){_0x2e45f8(null,_0x4007bb?_0x36c3a6[_0x5502('0x23')](_0x4007bb[_0x5502('0x24')]):![]);})['catch'](function(_0x3ef97b){_0x2e45f8(_0x3ef97b);});};AGIVertices[_0x5502('0x16')][_0x5502('0x25')]=function(_0x49b552,_0x473986){this[_0x5502('0x10')][_0x5502('0x26')](_0x49b552)[_0x5502('0x14')](function(_0x557d9d){_0x473986(null,_0x557d9d?_0x557d9d:![]);})['catch'](function(_0x1589a4){_0x473986(_0x1589a4);});};AGIVertices[_0x5502('0x16')][_0x5502('0x27')]=function(_0x43849a,_0x5bc1f2,_0x1922a4){this[_0x5502('0x11')][_0x5502('0x27')](_0x43849a,_0x5bc1f2)[_0x5502('0x14')](function(){_0x1922a4(null);})[_0x5502('0x18')](function(_0x938803){_0x1922a4(_0x938803);});};AGIVertices[_0x5502('0x16')]['getIntervals']=function(_0x3a4c4e,_0x1e9aef){this['rpc'][_0x5502('0x28')](_0x3a4c4e)[_0x5502('0x14')](function(_0x2e6d7f){if(_0x2e6d7f){if(_0x2e6d7f[_0x5502('0x29')]){_0x1e9aef(null,[_0x2e6d7f[_0x5502('0x2a')]]);}else{_0x1e9aef(null,_[_0x5502('0x2b')](_0x2e6d7f[_0x5502('0x2c')],_0x5502('0x2a')));}}else{_0x1e9aef(null,![]);}})[_0x5502('0x18')](function(_0x5c374c){_0x1e9aef(_0x5c374c);});};AGIVertices[_0x5502('0x16')][_0x5502('0x23')]=function(_0x23b2f1){return util[_0x5502('0x2d')](_0x5502('0x2e'),FILES_PATH,_0x23b2f1);};AGIVertices[_0x5502('0x16')][_0x5502('0x2f')]=function(_0x462f05,_0x18c42d,_0x13218c){odbc[_0x5502('0x30')](_0x462f05,function(_0x458975){if(_0x458975){logger[_0x5502('0x31')](_0x5502('0x32'),_0x458975);_0x13218c(_0x458975);}else{logger['info'](_0x5502('0x33'));odbc[_0x5502('0x34')](_0x18c42d,function(_0x4b7611,_0x557d57){if(_0x4b7611){logger[_0x5502('0x35')](_0x5502('0x36'),_0x18c42d);_0x13218c(_0x4b7611);}else{logger[_0x5502('0x35')](_0x5502('0x37'),_0x18c42d);odbc[_0x5502('0x38')](function(_0x3c01c4){if(_0x3c01c4){logger[_0x5502('0x31')](_0x5502('0x39'),_0x3c01c4);}_0x13218c(null,_0x557d57);});}});}});};AGIVertices['prototype']['getSmsAccount']=function(_0x4f3bfe,_0x3b5676){this['rpc'][_0x5502('0x3a')](_0x4f3bfe)[_0x5502('0x14')](function(_0x5ddbe9){_0x3b5676(null,_0x5ddbe9?_0x5ddbe9:![]);})[_0x5502('0x18')](function(_0x4ba356){_0x3b5676(_0x4ba356);});};AGIVertices[_0x5502('0x16')][_0x5502('0x3b')]=function(_0x23e9c3,_0x501088){this[_0x5502('0x10')][_0x5502('0x3b')](_0x23e9c3)['then'](function(_0x55b1c){_0x501088(null,_0x55b1c);})[_0x5502('0x18')](function(_0xb3ed4c){_0x501088(_0xb3ed4c);});};AGIVertices['prototype'][_0x5502('0x3c')]=function(_0x57f2d0,_0x31e66d,_0x4c25d8){this[_0x5502('0x10')][_0x5502('0x3c')]({'uniqueid':this[_0x5502('0x3d')][_0x5502('0x3e')],'node':_0x57f2d0['label'],'application':_0x57f2d0[_0x5502('0x3f')],'data':_0x31e66d||null,'project_name':this['channel'][_0x5502('0x40')],'callerid':this['channel'][_0x5502('0x41')]})[_0x5502('0x14')](function(_0x59f86c){if(_0x4c25d8){_0x4c25d8(null,_0x59f86c);}})[_0x5502('0x18')](function(_0xd10fe){if(_0x4c25d8){_0x4c25d8(_0xd10fe);}});};AGIVertices[_0x5502('0x16')]['createSquareRecording']=function(_0x814d65,_0x23f839,_0x28cfd7,_0x4f2b5b){this['rpc'][_0x5502('0x42')]({'uniqueid':this[_0x5502('0x3d')]['uniqueid'],'callerid':this[_0x5502('0x3d')][_0x5502('0x41')],'calleridname':this['channel'][_0x5502('0x43')],'context':this[_0x5502('0x3d')]['context'],'extension':this[_0x5502('0x3d')][_0x5502('0x44')],'priority':this['channel']['priority'],'accountcode':this['channel']['accountcode'],'dnid':this[_0x5502('0x3d')][_0x5502('0x45')],'projectName':this[_0x5502('0x3d')]['arg_1'],'saveName':_0x23f839,'filename':_0x814d65[_0x5502('0x46')]||_0x23f839,'savePath':_0x28cfd7})[_0x5502('0x14')](function(_0x200062){_0x4f2b5b(null,_0x200062);})[_0x5502('0x18')](function(_0x2a2e8a){_0x4f2b5b(_0x2a2e8a);});};AGIVertices[_0x5502('0x16')]['createSquareMessage']=function(_0x52ae6b,_0x2a84a1,_0x22a933,_0x616cdb,_0x4c428f){this[_0x5502('0x10')]['createSquareMessage']({'uniqueid':this[_0x5502('0x3d')][_0x5502('0x3e')],'body':_0x52ae6b,'direction':_0x2a84a1,'providerName':_0x22a933,'providerResponse':_0x616cdb})[_0x5502('0x14')](function(_0x1ce03f){if(_0x4c428f){_0x4c428f(null,_0x1ce03f);}})[_0x5502('0x18')](function(_0x247f56){if(_0x4c428f){_0x4c428f(_0x247f56);}});};AGIVertices[_0x5502('0x16')]['createCmContact']=function(_0x157ed4,_0x3cac26){this['rpc']['createCmContact']({'firstName':_['isEmpty'](_0x157ed4[_0x5502('0x15')])||_['isNil'](_0x157ed4[_0x5502('0x15')])?_0x5502('0x47')+Math[_0x5502('0x48')]():_0x157ed4[_0x5502('0x15')],'lastName':_[_0x5502('0x49')](_0x157ed4[_0x5502('0x4a')])||_[_0x5502('0x4b')](_0x157ed4[_0x5502('0x4a')])?null:_0x157ed4['lastName'],'phone':_0x157ed4[_0x5502('0x4c')],'ListId':_0x157ed4[_0x5502('0x4d')],'scheduledat':_0x157ed4[_0x5502('0x4e')],'callbackUniqueid':this['channel'][_0x5502('0x3e')],'tags':_0x5502('0x4f'),'description':_0x5502('0x50')+_0x157ed4[_0x5502('0x4e')][_0x5502('0x51')](),'priority':_0x157ed4['callback_priority']})['then'](function(_0x21cb8d){_0x3cac26(null,_0x21cb8d);})[_0x5502('0x18')](function(_0x2c6cf2){_0x3cac26(_0x2c6cf2);});};AGIVertices[_0x5502('0x16')][_0x5502('0x52')]=function(_0x51d04f,_0x3465cf){this[_0x5502('0x10')][_0x5502('0x53')](_0x51d04f)[_0x5502('0x14')](function(_0x5a64cf){_0x3465cf(null,_0x5a64cf?_0x5a64cf[_0x5502('0x15')]:![]);})['catch'](function(_0x4087fe){_0x3465cf(_0x4087fe);});};AGIVertices[_0x5502('0x16')][_0x5502('0x54')]=function(_0xe23b8d,_0x337c43,_0x53ad06){var _0x1d2bc6={'role':_0x5502('0x55')};_0x1d2bc6[_0xe23b8d]=this[_0x5502('0x3d')][_0x5502('0x41')];this[_0x5502('0x10')][_0x5502('0x54')](_0x1d2bc6,_0x337c43,this[_0x5502('0x3d')]['uniqueid'])['then'](function(_0x53d8a8){_0x53ad06(null,_[_0x5502('0x4b')](_0x53d8a8)?![]:!![]);})[_0x5502('0x18')](function(_0x5e3e47){logger[_0x5502('0x31')](_0x5e3e47);_0x53ad06(null,![]);});};AGIVertices['prototype']['agentUnpause']=function(_0xe82e13,_0x359c1e){var _0x10d943={'role':_0x5502('0x55')};_0x10d943[_0xe82e13]=this[_0x5502('0x3d')]['callerid'];this[_0x5502('0x10')][_0x5502('0x56')](_0x10d943)['then'](function(_0x42638b){_0x359c1e(null,_['isNil'](_0x42638b)?![]:!![]);})[_0x5502('0x18')](function(_0x1a7c20){logger[_0x5502('0x31')](_0x1a7c20);_0x359c1e(null,![]);});};AGIVertices[_0x5502('0x16')][_0x5502('0x57')]=function(_0x101545,_0x543750){var _0xafbf3a={'role':'agent'};_0xafbf3a[_0x101545]=this[_0x5502('0x3d')]['callerid'];this['rpc']['agentLogout'](_0xafbf3a)[_0x5502('0x14')](function(_0x37d464){_0x543750(null,_[_0x5502('0x4b')](_0x37d464)?![]:!![]);})[_0x5502('0x18')](function(_0x264e38){logger['error'](_0x264e38);_0x543750(null,![]);});};AGIVertices[_0x5502('0x16')][_0x5502('0x58')]=function(_0x46d5d6,_0x3282d2){var _0x254b93={'role':_0x5502('0x55')};_0x254b93[_0x46d5d6]=this[_0x5502('0x3d')][_0x5502('0x41')];var _0x514695=_0x46d5d6!=_0x5502('0x59')?util['format'](_0x5502('0x5a'),_0x5502('0x5b'),this[_0x5502('0x3d')]['callerid']):undefined;this[_0x5502('0x10')][_0x5502('0x58')](_0x254b93,_0x514695)[_0x5502('0x14')](function(_0x1a7e0c){_0x3282d2(null,_[_0x5502('0x4b')](_0x1a7e0c)?![]:!![]);})[_0x5502('0x18')](function(_0x14be0c){logger[_0x5502('0x31')](_0x14be0c);_0x3282d2(null,![]);});};AGIVertices['prototype'][_0x5502('0x5c')]=function(_0x232862,_0x371c74){sh[_0x5502('0x5d')](_[_0x5502('0x5e')](_0x232862),function(_0x1b264f,_0x513d1e){var _0x368544=_0x513d1e[_0x5502('0x5f')](/(\r\n|\n|\r)/gm,'');_0x371c74(null,_0x368544);});};AGIVertices[_0x5502('0x16')][_0x5502('0x60')]=function(_0x1d7db1,_0x3b93db){scripts[_0x5502('0x60')](_0x1d7db1[_0x5502('0x61')],_0x1d7db1[_0x5502('0x62')]||'text',_0x1d7db1[_0x5502('0x63')],_0x1d7db1['languageCode']||_0x5502('0x64'),_0x1d7db1[_0x5502('0x65')]||_0x5502('0x66'),_0x1d7db1['audioEncoding']||_0x5502('0x67'))[_0x5502('0x14')](function(_0x4366dc){_0x3b93db(null,_0x4366dc);})[_0x5502('0x18')](function(_0x4ee8de){_0x3b93db(_0x4ee8de);});};AGIVertices['prototype'][_0x5502('0x68')]=function(_0x239b7e,_0x25461b){scripts[_0x5502('0x68')](_0x239b7e[_0x5502('0x63')],_0x239b7e[_0x5502('0x69')]||'en',0x1)['then'](function(_0x434cbf){_0x25461b(null,_0x434cbf);})[_0x5502('0x18')](function(_0x377770){_0x25461b(_0x377770);});};AGIVertices[_0x5502('0x16')]['restAPI']=function(_0x5b2746,_0x4bdb98){var _0xdf7962={'uri':_0x5b2746[_0x5502('0x6a')],'method':_0x5b2746[_0x5502('0x6b')],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x5b2746['timeout'])===_0x5502('0x6c')&&parseInt(_0x5b2746[_0x5502('0x6d')])>=0x1?parseInt(_0x5b2746[_0x5502('0x6d')])*0x3e8:0x5*0x3e8};if(_[_0x5502('0x6e')](['POST','PUT'],_0xdf7962[_0x5502('0x6b')][_0x5502('0x6f')]())){try{_0xdf7962[_0x5502('0x70')]=_0x5b2746[_0x5502('0xd')]?JSON['parse'](_0x5b2746[_0x5502('0xd')]):{};}catch(_0x504d4b){logger[_0x5502('0x31')](_0x5502('0x71'),_0x504d4b);}}try{_0xdf7962[_0x5502('0x72')]=_0x5b2746[_0x5502('0xc')]?JSON[_0x5502('0x73')](_0x5b2746[_0x5502('0xc')]):{};}catch(_0x1b45d4){logger[_0x5502('0x31')]('An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function',_0x1b45d4);}if(_0x5b2746[_0x5502('0x74')]){try{var _0x29cd0b=require(_0x5b2746[_0x5502('0x74')])['sync'](this,_0xdf7962);_0xdf7962[_0x5502('0x75')]=Mustache[_0x5502('0x76')](_0x5b2746['url'],_0x29cd0b,{},['$$','$$']);if(_0xdf7962[_0x5502('0x72')]){_0xdf7962[_0x5502('0x72')]=JSON[_0x5502('0x73')](Mustache['render'](JSON['stringify'](_0xdf7962[_0x5502('0x72')]),_0x29cd0b,{},['$$','$$']));}if(_0xdf7962[_0x5502('0x70')]){_0xdf7962[_0x5502('0x70')]=JSON[_0x5502('0x73')](Mustache[_0x5502('0x76')](JSON[_0x5502('0x77')](_0xdf7962[_0x5502('0x70')]),_0x29cd0b,{},['$$','$$']));}}catch(_0x8cd774){logger[_0x5502('0x31')](_0x5502('0x78'),_0x8cd774);}}rp(_0xdf7962)['then'](function(_0xec1d04){var _0x2dc7c4={'statusCode':_0xec1d04[_0x5502('0x79')]||0xc8,'statusMessage':_0xec1d04[_0x5502('0x7a')]||'OK','headers':_0xec1d04[_0x5502('0x72')]||{},'body':_0xec1d04[_0x5502('0x70')]||{}};_0x4bdb98(null,_0x2dc7c4);})[_0x5502('0x18')](function(_0x518323){var _0x4e155b={'statusCode':_0x518323['statusCode']||0x1f4,'statusMessage':_0x518323[_0x5502('0x7b')]||_0x5502('0x7c'),'headers':_0x518323[_0x5502('0x7d')][_0x5502('0x72')]||{},'body':_0x518323[_0x5502('0x7d')][_0x5502('0x70')]||{}};_0x4bdb98(null,_0x4e155b);});};AGIVertices[_0x5502('0x16')][_0x5502('0x7e')]=function(_0x2d55c3,_0xbcba7a){scripts[_0x5502('0x7e')](this['channel'][_0x5502('0x3e')],_0x2d55c3[_0x5502('0x7f')],_0x2d55c3[_0x5502('0x63')],_0x2d55c3['dialogflow_language']||'en')[_0x5502('0x14')](function(_0x42d02f){_0xbcba7a(null,_0x42d02f);})[_0x5502('0x18')](function(_0x1b763a){_0xbcba7a(_0x1b763a);});};AGIVertices['prototype']['googleDialogflowV2']=function(_0x43757c,_0x24c69e){scripts['googleDialogflowV2'](this[_0x5502('0x3d')]['uniqueid'],_0x43757c[_0x5502('0x80')],_0x43757c['client_email'],_0x43757c['private_key'],_0x43757c[_0x5502('0x63')],_0x43757c['dialogflowV2_language']||'en')[_0x5502('0x14')](function(_0xcdc7af){_0x24c69e(null,_0xcdc7af);})[_0x5502('0x18')](function(_0x3f505b){_0x24c69e(_0x3f505b);});};AGIVertices['prototype']['sestekNDA']=function(_0x4bb6ff,_0x354032){scripts[_0x5502('0x81')](this[_0x5502('0x3d')],_0x4bb6ff)[_0x5502('0x14')](function(_0x4233e9){_0x354032(null,_0x4233e9);})[_0x5502('0x18')](function(_0xabeca4){_0x354032(_0xabeca4);});};AGIVertices[_0x5502('0x16')][_0x5502('0x82')]=function(_0x158690,_0x36c908){scripts[_0x5502('0x82')](_0x158690[_0x5502('0x7f')],_0x158690[_0x5502('0x63')],_0x158690['ispeech_tts_language']||_0x5502('0x64'),_0x158690[_0x5502('0x83')])[_0x5502('0x14')](function(_0x20acf5){_0x36c908(null,_0x20acf5);})[_0x5502('0x18')](function(_0x17ee66){_0x36c908(_0x17ee66);});};AGIVertices[_0x5502('0x16')]['ispeechASR']=function(_0x3a13f,_0xe4f3cc,_0x3f94af){scripts[_0x5502('0x84')](_0xe4f3cc,_0x3a13f[_0x5502('0x7f')],_0x3a13f[_0x5502('0x85')]||'en-US',this[_0x5502('0x86')](_0x3a13f[_0x5502('0x87')])?_0x3a13f[_0x5502('0x87')]:undefined)[_0x5502('0x14')](function(_0x412d0a){_0x3f94af(null,_0x412d0a);})[_0x5502('0x18')](function(_0x3b65dc){_0x3f94af(_0x3b65dc);});};AGIVertices[_0x5502('0x16')][_0x5502('0x88')]=function(_0x22c3bf,_0x342711){scripts['awsPolly'](_0x22c3bf['aws_access_key_id'],_0x22c3bf['aws_secret_access_key'],_0x22c3bf[_0x5502('0x89')],_0x22c3bf[_0x5502('0x8a')]||_0x5502('0x8b'),_0x22c3bf[_0x5502('0x63')],_0x22c3bf[_0x5502('0x8c')]||'text')[_0x5502('0x14')](function(_0x13b80c){_0x342711(null,_0x13b80c);})['catch'](function(_0x2ec243){_0x342711(_0x2ec243);});};AGIVertices['prototype'][_0x5502('0x8d')]=function(_0x421b57,_0x3497e2){scripts[_0x5502('0x8d')](this[_0x5502('0x3d')]['uniqueid'],_0x421b57[_0x5502('0x8e')],_0x421b57[_0x5502('0x8f')],_0x421b57[_0x5502('0x90')],_0x421b57[_0x5502('0x63')],_0x421b57[_0x5502('0x91')])[_0x5502('0x14')](function(_0x4d4c11){_0x3497e2(null,_0x4d4c11);})[_0x5502('0x18')](function(_0x388b8f){_0x3497e2(_0x388b8f);});};AGIVertices[_0x5502('0x16')][_0x5502('0x92')]=function(_0x511938,_0xc0f0d9,_0x1e1c25){scripts['googleASR'](_0xc0f0d9,_0x511938['key'],_0x511938[_0x5502('0x93')]||_0x5502('0x64'))[_0x5502('0x14')](function(_0x544734){_0x1e1c25(null,_0x544734);})['catch'](function(_0x5493f2){_0x1e1c25(_0x5493f2);});};AGIVertices[_0x5502('0x16')]['tildeASR']=function(_0x50ec69,_0x427fa1,_0x2327e1){scripts[_0x5502('0x94')](_0x427fa1,_0x50ec69['appid'],_0x50ec69[_0x5502('0x95')],_0x50ec69['uri'])['then'](function(_0x49ad7f){_0x2327e1(null,_0x49ad7f);})[_0x5502('0x18')](function(_0x116957){_0x2327e1(_0x116957);});};AGIVertices[_0x5502('0x16')][_0x5502('0x96')]=function(_0x5b9f4a){var _0x9a0372=_['includes'](verticesWithRetry,_0x5b9f4a[_0x5502('0x3f')])?_0x5b9f4a:_[_0x5502('0x97')](_0x5b9f4a);for(var _0x36c877 in _0x9a0372){if(_0x9a0372[_0x5502('0x98')](_0x36c877)){if(_0x9a0372[_0x36c877]&&_[_0x5502('0x99')](_0x9a0372[_0x36c877])){if(_[_0x5502('0x6e')](recursiveMapAttributes,_0x36c877)){_0x9a0372[_0x36c877]=this[_0x5502('0x9a')](_0x9a0372[_0x36c877]);}else{_0x9a0372[_0x36c877]=this[_0x5502('0x9b')](_0x9a0372[_0x36c877]);}}}}return _0x9a0372;};AGIVertices[_0x5502('0x16')][_0x5502('0x9c')]=function(_0x2b5ac7){for(var _0x345811 in _0x2b5ac7){if(_0x2b5ac7[_0x5502('0x98')](_0x345811)){if(_[_0x5502('0x9d')](_0x2b5ac7[_0x345811])){this[_0x5502('0x9c')](_0x2b5ac7[_0x345811]);}else if(_[_0x5502('0x9e')](_0x2b5ac7[_0x345811])){for(var _0x618ab9=0x0;_0x618ab9<_0x2b5ac7[_0x345811]['length'];_0x618ab9++){this[_0x5502('0x9c')](_0x2b5ac7[_0x345811][_0x618ab9]);}}else if(_[_0x5502('0x99')](_0x2b5ac7[_0x345811])){_0x2b5ac7[_0x345811]=this[_0x5502('0x9b')](_0x2b5ac7[_0x345811]);}}}};AGIVertices[_0x5502('0x16')][_0x5502('0x9f')]=function(_0x37ff2a,_0x3e8560){for(var _0x4ec27d in _0x37ff2a){if(_0x37ff2a[_0x5502('0x98')](_0x4ec27d)){if(_[_0x5502('0x9d')](_0x37ff2a[_0x4ec27d])){if(!_[_0x5502('0x49')](_0x37ff2a[_0x4ec27d])){this['saveRestApiResult'](_0x37ff2a[_0x4ec27d],util[_0x5502('0x2d')](_0x5502('0xa0'),_0x3e8560,_0x4ec27d));}}else if(_[_0x5502('0x9e')](_0x37ff2a[_0x4ec27d])){for(var _0x4661e3=0x0;_0x4661e3<_0x37ff2a[_0x4ec27d][_0x5502('0xa1')];_0x4661e3++){this[_0x5502('0x9f')](_0x37ff2a[_0x4ec27d][_0x4661e3],util[_0x5502('0x2d')](_0x5502('0xa0'),_0x3e8560,_0x4ec27d+'['+_0x4661e3+']'));}}else{if(!_[_0x5502('0x4b')](_0x37ff2a[_0x4ec27d])){this['channel']['setVariable'](util['format']('%s.%s',_0x3e8560,_0x4ec27d),_0x37ff2a[_0x4ec27d]);}}}}};AGIVertices[_0x5502('0x16')]['replaceObjectAllVariables']=function(_0x2d9fa1){try{var _0x501318=JSON[_0x5502('0x73')](_0x2d9fa1);this['recursiveNodeIndex'](_0x501318);return JSON['stringify'](_0x501318);}catch(_0x94ffdb){return this[_0x5502('0x9b')](_0x2d9fa1);}};AGIVertices[_0x5502('0x16')]['replaceAllVariables']=function(_0x5b5ffc){var _0x32d7b1=_0x5b5ffc['split']('{');for(var _0x27811b=0x1;_0x27811b<_0x32d7b1[_0x5502('0xa1')];_0x27811b+=0x1){var _0xbcf5a=_0x32d7b1[_0x27811b][_0x5502('0xa2')]('}');if(_0xbcf5a['length']>0x1){_0x5b5ffc=_0x5b5ffc['replaceAll']('{'+_0xbcf5a[0x0]+'}',this[_0x5502('0x3d')][_0x5502('0x12')](_0xbcf5a[0x0])[_0x5502('0xa3')]||_0xbcf5a[0x0]);}}if(_0x32d7b1['length']===0x1){return _0x5b5ffc[_0x5502('0x51')]();}return this[_0x5502('0x9b')](_0x5b5ffc);};AGIVertices[_0x5502('0x16')][_0x5502('0xa4')]=function(_0x136bfb,_0x2dd62f){var _0x52ccd5=this[_0x5502('0x3d')]['getVariable'](_0x136bfb);if(_0x52ccd5[_0x5502('0xa5')]===-0x1){return _0x52ccd5;}logger[_0x5502('0x35')](util[_0x5502('0x2d')]('The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s',_0x2dd62f,_0x52ccd5[_0x5502('0xa3')]));return this[_0x5502('0x3d')][_0x5502('0xa6')](_0x2dd62f,_0x52ccd5[_0x5502('0xa3')]);};AGIVertices[_0x5502('0x16')]['isConfigured']=function(_0x139e6b){return _0x139e6b&&_0x139e6b!=='0'&&_0x139e6b!=='-1'&&_0x139e6b!=='';};AGIVertices['prototype'][_0x5502('0xa7')]=function(_0x19f9fc){this[_0x5502('0x3c')][_0x5502('0xa8')](this,_0x19f9fc,'-');_0x19f9fc[_0x5502('0xa9')]=_0x19f9fc[_0x5502('0xa7')];return{'code':0xc8,'result':'-'};};AGIVertices[_0x5502('0x16')][_0x5502('0xaa')]=function(_0xa291fa){logger[_0x5502('0x35')](util['format'](_0x5502('0xab'),_0xa291fa[_0x5502('0xac')]));if(!this[_0x5502('0x86')](_0xa291fa[_0x5502('0x63')])){return this[_0x5502('0x3d')][_0x5502('0xad')](_0x5502('0xae'));}var _0x2dd131='\x22'+_0xa291fa[_0x5502('0x63')]+'\x22';if(this[_0x5502('0x86')](_0xa291fa[_0x5502('0x7d')])){_0x2dd131+=','+_0xa291fa[_0x5502('0x7d')];}var _0x46a5fe=this[_0x5502('0x3d')][_0x5502('0x5d')](_0x5502('0xaf'),_0x2dd131);if(_0x46a5fe[_0x5502('0xa5')]===-0x1){return _0x46a5fe;}return this['channel'][_0x5502('0xad')](util[_0x5502('0x2d')](_0x5502('0xb0'),_0x2dd131));};AGIVertices[_0x5502('0x16')]['mrcprecog']=function(_0x447afd){logger[_0x5502('0x35')](util['format'](_0x5502('0xb1'),_0x447afd[_0x5502('0xac')]));if(!this['isConfigured'](_0x447afd[_0x5502('0xb2')])){return this[_0x5502('0x3d')][_0x5502('0xad')](_0x5502('0xb3'));}var _0x214688=_0x447afd[_0x5502('0xb2')];if(this[_0x5502('0x86')](_0x447afd[_0x5502('0x7d')])){_0x214688+=','+_0x447afd[_0x5502('0x7d')];}var _0xcaa990=this[_0x5502('0x3d')][_0x5502('0x5d')](_0x5502('0xb4'),_0x214688);if(_0xcaa990['result']===-0x1){return _0xcaa990;}var _0x5a5194=this[_0x5502('0xa4')](_0x5502('0xb5'),_0x5502('0xb6'));if(_0x5a5194[_0x5502('0xa5')]===-0x1){return _0x5a5194;}var _0x14612a=this[_0x5502('0xa4')](_0x5502('0xb7'),_0x5502('0xb8'));if(_0x14612a[_0x5502('0xa5')]===-0x1){return _0x14612a;}var _0x3a80bc=this[_0x5502('0xa4')](_0x5502('0xb9'),_0x5502('0xba'));if(_0x3a80bc[_0x5502('0xa5')]===-0x1){return _0x3a80bc;}return this[_0x5502('0x3d')]['noop'](util[_0x5502('0x2d')]('Executed\x20command\x20MRCPRecog\x20%s',_0x214688));};AGIVertices[_0x5502('0x16')]['agi']=function(_0x274ec4){logger[_0x5502('0x35')](util[_0x5502('0x2d')](_0x5502('0xbb'),_0x274ec4[_0x5502('0xac')]));return this[_0x5502('0x3d')][_0x5502('0x9')]([_0x274ec4['command'],_0x274ec4['args']]);};AGIVertices[_0x5502('0x16')][_0x5502('0xbc')]=function(_0x5e9929){logger[_0x5502('0x35')](util[_0x5502('0x2d')](_0x5502('0xbd'),_0x5e9929[_0x5502('0xac')]));if(this[_0x5502('0x86')](_0x5e9929[_0x5502('0x6d')])){logger[_0x5502('0x35')](util[_0x5502('0x2d')]('Wait\x20%s\x20seconds\x20before\x20answer',_0x5e9929[_0x5502('0x6d')]));var _0x43b777=this['channel'][_0x5502('0xbe')](_0x5e9929[_0x5502('0x6d')]);if(_0x43b777[_0x5502('0xa5')]===-0x1){return _0x43b777;}}return this[_0x5502('0x3d')][_0x5502('0xbc')]();};AGIVertices[_0x5502('0x16')][_0x5502('0x4f')]=function(_0x3a13bc){logger[_0x5502('0x35')](util['format'](_0x5502('0xbf'),_0x3a13bc['label']));if(!this['isConfigured'](_0x3a13bc[_0x5502('0x4d')])){return this[_0x5502('0x3d')][_0x5502('0x31')](_0x3a13bc,_0x5502('0xc0'));}_0x3a13bc['scheduledAt']=moment();if(this['isConfigured'](_0x3a13bc[_0x5502('0xc1')])){_0x3a13bc[_0x5502('0x4e')]=moment()['add'](_0x3a13bc[_0x5502('0xc1')],_0x5502('0xc2'));}if(!this[_0x5502('0x86')](_0x3a13bc[_0x5502('0xc3')])){_0x3a13bc[_0x5502('0xc3')]=0x2;}this['createCmContact'][_0x5502('0xa8')](this,_0x3a13bc);return this[_0x5502('0x3d')][_0x5502('0xad')](util['format'](_0x5502('0xc4'),_0x3a13bc[_0x5502('0x4c')],_0x3a13bc[_0x5502('0x4d')],_0x3a13bc['scheduledAt']));};AGIVertices[_0x5502('0x16')][_0x5502('0xc5')]=function(_0x2ff185){logger[_0x5502('0x35')](util[_0x5502('0x2d')]('Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block',_0x2ff185[_0x5502('0xac')]));var _0x50e8ce=this['channel']['exec'](_0x2ff185[_0x5502('0xc6')],_0x2ff185[_0x5502('0x7d')]);if(_0x50e8ce[_0x5502('0xa5')]===-0x1){return _0x50e8ce;}return this['channel'][_0x5502('0xad')](util['format'](_0x5502('0xc7'),_0x2ff185[_0x5502('0xc6')],_0x2ff185[_0x5502('0x7d')]));};AGIVertices[_0x5502('0x16')][_0x5502('0xc8')]=function(_0x3bc2bd){logger[_0x5502('0x35')](util[_0x5502('0x2d')](_0x5502('0xc9'),_0x3bc2bd[_0x5502('0xac')]));if(!this[_0x5502('0x86')](_0x3bc2bd[_0x5502('0x63')])){return this[_0x5502('0x3d')]['noop'](_0x5502('0xae'));}var _0x5cf998='\x22'+_0x3bc2bd[_0x5502('0x63')]+'\x22';if(this[_0x5502('0x86')](_0x3bc2bd[_0x5502('0x7d')])){_0x5cf998+=','+_0x3bc2bd[_0x5502('0x7d')];}var _0x27c2f8=this[_0x5502('0x3d')][_0x5502('0x5d')](_0x5502('0xaf'),_0x5cf998);if(_0x27c2f8[_0x5502('0xa5')]===-0x1){return _0x27c2f8;}return this[_0x5502('0x3d')][_0x5502('0xad')](util[_0x5502('0x2d')](_0x5502('0xb0'),_0x5cf998));};AGIVertices[_0x5502('0x16')][_0x5502('0xca')]=function(_0x404f03){logger[_0x5502('0x35')](util[_0x5502('0x2d')](_0x5502('0xcb'),_0x404f03[_0x5502('0xac')]));if(!this[_0x5502('0x86')](_0x404f03['text'])){return this[_0x5502('0x3d')][_0x5502('0xad')]('no\x20text\x20configured');}var _0x5db92b='\x22'+_0x404f03[_0x5502('0x63')]+'\x22';if(this[_0x5502('0x86')](_0x404f03['options'])){_0x5db92b+=','+_0x404f03['options'];}var _0x507edd=this[_0x5502('0x3d')][_0x5502('0x5d')]('MRCPSynth',_0x5db92b);if(_0x507edd[_0x5502('0xa5')]===-0x1){return _0x507edd;}return this[_0x5502('0x3d')]['noop'](util[_0x5502('0x2d')](_0x5502('0xb0'),_0x5db92b));};AGIVertices[_0x5502('0x16')][_0x5502('0xcc')]=function(_0x1e486f){logger[_0x5502('0x35')](util[_0x5502('0x2d')](_0x5502('0xcd'),_0x1e486f[_0x5502('0xac')]));if(!this[_0x5502('0x86')](_0x1e486f[_0x5502('0xb2')])){return this[_0x5502('0x3d')]['noop'](_0x5502('0xb3'));}var _0x3c9b9c=_0x1e486f[_0x5502('0xb2')];if(this[_0x5502('0x86')](_0x1e486f['options'])){_0x3c9b9c+=','+_0x1e486f['options'];}var _0xd78f8c=this[_0x5502('0x3d')][_0x5502('0x5d')](_0x5502('0xb4'),_0x3c9b9c);if(_0xd78f8c[_0x5502('0xa5')]===-0x1){return _0xd78f8c;}var _0x46fd40=this['getAndSetVariable'](_0x5502('0xb5'),'LUMENVOX_ASR_CONFIDENCE');if(_0x46fd40[_0x5502('0xa5')]===-0x1){return _0x46fd40;}var _0xe233d0=this[_0x5502('0xa4')]('RECOG_INPUT()',_0x5502('0xce'));if(_0xe233d0[_0x5502('0xa5')]===-0x1){return _0xe233d0;}var _0x2c9fcc=this[_0x5502('0xa4')]('RECOG_INSTANCE()',_0x5502('0xcf'));if(_0x2c9fcc[_0x5502('0xa5')]===-0x1){return _0x2c9fcc;}return this[_0x5502('0x3d')][_0x5502('0xad')](util[_0x5502('0x2d')](_0x5502('0xd0'),_0x3c9b9c));};AGIVertices[_0x5502('0x16')][_0x5502('0xd1')]=function(_0x37e370){logger['info'](util['format'](_0x5502('0xd2'),_0x37e370[_0x5502('0xac')]));if(!this[_0x5502('0x86')](_0x37e370[_0x5502('0xb2')])){return this[_0x5502('0x3d')][_0x5502('0xad')](_0x5502('0xb3'));}var _0x104c01=_0x37e370[_0x5502('0xb2')];if(this[_0x5502('0x86')](_0x37e370[_0x5502('0x7d')])){_0x104c01+=','+_0x37e370[_0x5502('0x7d')];}var _0x38e080=this[_0x5502('0x3d')]['exec'](_0x5502('0xb4'),_0x104c01);if(_0x38e080['result']===-0x1){return _0x38e080;}var _0xe909cf=this[_0x5502('0xa4')](_0x5502('0xb5'),_0x5502('0xd3'));if(_0xe909cf[_0x5502('0xa5')]===-0x1){return _0xe909cf;}var _0x4d650d=this[_0x5502('0xa4')]('RECOG_INPUT()',_0x5502('0xd4'));if(_0x4d650d[_0x5502('0xa5')]===-0x1){return _0x4d650d;}var _0x96e247=this[_0x5502('0xa4')](_0x5502('0xb9'),_0x5502('0xd5'));if(_0x96e247[_0x5502('0xa5')]===-0x1){return _0x96e247;}return this[_0x5502('0x3d')][_0x5502('0xad')](util[_0x5502('0x2d')](_0x5502('0xd0'),_0x104c01));};AGIVertices['prototype'][_0x5502('0xd6')]=function(_0x5a18da){logger['info'](util['format'](_0x5502('0xd7'),_0x5a18da['label']));if(!this[_0x5502('0x86')](_0x5a18da[_0x5502('0xd8')])){return this['channel'][_0x5502('0x31')](_0x5a18da,_0x5502('0xd9'));}var _0x47e735=this[_0x5502('0x1b')][_0x5502('0xa8')](this,_0x5a18da['odbc_id']);if(!_0x47e735){return this['channel']['error'](_0x5a18da,_0x5502('0xda'));}if(!this[_0x5502('0x86')](_0x5a18da[_0x5502('0x34')])){return this[_0x5502('0x3d')][_0x5502('0x31')](_0x5a18da,_0x5502('0xdb'));}var _0x395e90=_0x5a18da[_0x5502('0x34')][_0x5502('0x5f')](/(\r\n|\n|\r)/gm,'\x20');this[_0x5502('0x3d')][_0x5502('0xad')](util[_0x5502('0x2d')](_0x5502('0xdc'),_0x395e90));var _0x2a04ad=this[_0x5502('0x2f')][_0x5502('0xa8')](this,_0x47e735,_0x395e90);this[_0x5502('0x3c')][_0x5502('0xa8')](this,_0x5a18da,_0x395e90);if(!this[_0x5502('0x86')](_0x5a18da[_0x5502('0xdd')])){return this[_0x5502('0x3d')][_0x5502('0xad')](_0x5502('0xde'));}var _0x2a2314=this[_0x5502('0x12')]['sync'](this,_0x5a18da[_0x5502('0xdd')]);if(!_0x2a2314){return this['channel'][_0x5502('0x31')](_0x5a18da,_0x5502('0xdf'));}var _0x5f443b=this;_0x2a04ad['forEach'](function(_0x498d86,_0x540625){Object[_0x5502('0xe0')](_0x498d86)[_0x5502('0xe1')](function(_0x5daafb){_0x5f443b[_0x5502('0x3d')][_0x5502('0xa6')](util[_0x5502('0x2d')]('%s[%s][%s]',_0x2a2314,_0x540625,_0x5daafb),_0x498d86[_0x5daafb]);});});this[_0x5502('0x3d')]['setVariable'](util['format'](_0x5502('0xe2'),_0x2a2314),_0x2a04ad[_0x5502('0xa1')]);return this[_0x5502('0x3d')]['noop'](util[_0x5502('0x2d')](_0x5502('0xe3'),_0x2a2314));};AGIVertices['prototype'][_0x5502('0xe4')]=function(_0x28b59d){logger[_0x5502('0xe5')](util[_0x5502('0x2d')](_0x5502('0xe6'),_0x28b59d['label']));if(!this[_0x5502('0x86')](_0x28b59d['sip_id'])){return this[_0x5502('0x3d')][_0x5502('0x31')](_0x28b59d,_0x5502('0xe7'));}var _0x4d9c89=this['getUser'][_0x5502('0xa8')](this,_0x28b59d[_0x5502('0xe8')]);if(!_0x4d9c89){return this[_0x5502('0x3d')][_0x5502('0x31')](_0x28b59d,_0x5502('0xe9'));}var _0x541262=this['channel'][_0x5502('0x5d')]('DIAL',[util[_0x5502('0x2d')](_0x5502('0xea'),_0x4d9c89),_0x28b59d[_0x5502('0x6d')],_0x28b59d[_0x5502('0xeb')],_0x28b59d['url']]);if(_0x541262['result']===-0x1){return _0x541262;}return this[_0x5502('0x3d')]['noop'](util['format'](_0x5502('0xec'),_0x5502('0xed')));};AGIVertices[_0x5502('0x16')]['dialogflow']=function(_0x56ec81){logger[_0x5502('0x35')](util[_0x5502('0x2d')](_0x5502('0xee'),_0x56ec81[_0x5502('0xac')]));if(!this['isConfigured'](_0x56ec81[_0x5502('0x7f')])){return this['channel'][_0x5502('0xad')]('no\x20key\x20configured');}if(!this[_0x5502('0x86')](_0x56ec81[_0x5502('0x63')])){return this['channel'][_0x5502('0xad')](_0x5502('0xae'));}this[_0x5502('0x3d')][_0x5502('0xef')]=!![];this[_0x5502('0x3c')](_0x56ec81);this[_0x5502('0xf0')](_0x56ec81[_0x5502('0x63')],'in','','');this['channel'][_0x5502('0xad')](util['format'](_0x5502('0xf1'),_0x56ec81[_0x5502('0x63')]));var _0x4e75ce=this[_0x5502('0x7e')][_0x5502('0xa8')](this,_0x56ec81);if(_0x4e75ce){for(var _0x1d051c in _0x4e75ce){if(_0x4e75ce['hasOwnProperty'](_0x1d051c)){this['channel'][_0x5502('0xa6')](util[_0x5502('0x2d')](_0x5502('0xf2'),_0x1d051c[_0x5502('0x6f')]()),_0x4e75ce[_0x1d051c]);}}this[_0x5502('0xf0')](_0x4e75ce[_0x5502('0xf3')],_0x5502('0xf4'),'dialogflow','');return this['channel'][_0x5502('0xad')](util[_0x5502('0x2d')](_0x5502('0xf5'),_0x4e75ce[_0x5502('0xf3')]));}return this['channel']['error'](_0x56ec81,_0x5502('0xf6'));};AGIVertices[_0x5502('0x16')][_0x5502('0xf7')]=function(_0x26b6df){logger['info'](util[_0x5502('0x2d')](_0x5502('0xf8'),_0x26b6df[_0x5502('0xac')]));if(!this[_0x5502('0x86')](_0x26b6df[_0x5502('0x80')])){return this[_0x5502('0x3d')]['noop'](_0x5502('0xf9'));}if(!this['isConfigured'](_0x26b6df[_0x5502('0xfa')])){return this[_0x5502('0x3d')][_0x5502('0xad')](_0x5502('0xfb'));}if(!this[_0x5502('0x86')](_0x26b6df[_0x5502('0xfc')])){return this['channel'][_0x5502('0xad')](_0x5502('0xfd'));}if(!this[_0x5502('0x86')](_0x26b6df[_0x5502('0xfe')])){return this[_0x5502('0x3d')][_0x5502('0xad')](_0x5502('0xff'));}if(!this[_0x5502('0x86')](_0x26b6df[_0x5502('0x63')])){return this['channel'][_0x5502('0xad')](_0x5502('0xae'));}this[_0x5502('0x3d')][_0x5502('0xef')]=!![];this['createSquareDetailsReport'](_0x26b6df);this[_0x5502('0xf0')](_0x26b6df[_0x5502('0x63')],'in','','');this['channel'][_0x5502('0xad')](util[_0x5502('0x2d')]('Trying\x20DialogflowV2:\x20%s',_0x26b6df[_0x5502('0x63')]));var _0x4deae1=this['googleDialogflowV2'][_0x5502('0xa8')](this,_0x26b6df);if(_0x4deae1){for(var _0x371b44 in _0x4deae1){if(_0x4deae1['hasOwnProperty'](_0x371b44)){if(_0x371b44!==_0x5502('0x100')){this['channel'][_0x5502('0xa6')](util[_0x5502('0x2d')]('DIALOGFLOW_%s',_0x371b44[_0x5502('0x6f')]()),_0x4deae1[_0x371b44]);}}}this[_0x5502('0xf0')](_0x4deae1[_0x5502('0xf3')],_0x5502('0xf4'),'dialogflowV2',_0x4deae1['providerResponse']);return this[_0x5502('0x3d')][_0x5502('0xad')](util[_0x5502('0x2d')](_0x5502('0x101'),_0x4deae1[_0x5502('0xf3')]));}return this[_0x5502('0x3d')]['error'](_0x26b6df,_0x5502('0x102'));};AGIVertices[_0x5502('0x16')][_0x5502('0x103')]=function(_0x361fec){logger[_0x5502('0x35')](util[_0x5502('0x2d')]('Enter\x20in\x20SESTEKNDA\x20(%s)\x20block',_0x361fec[_0x5502('0xac')]));if(!this['isConfigured'](_0x361fec[_0x5502('0x104')])){return this[_0x5502('0x3d')]['noop'](_0x5502('0x105'));}if(!this[_0x5502('0x86')](_0x361fec[_0x5502('0x106')])){return this[_0x5502('0x3d')][_0x5502('0xad')](_0x5502('0x107'));}if(!this['isConfigured'](_0x361fec[_0x5502('0x108')])){return this[_0x5502('0x3d')][_0x5502('0xad')](_0x5502('0x109'));}if(!this[_0x5502('0x86')](_0x361fec[_0x5502('0x10a')])){return this[_0x5502('0x3d')]['noop'](_0x5502('0xae'));}this[_0x5502('0x3d')][_0x5502('0xef')]=!![];this[_0x5502('0x3c')](_0x361fec);this[_0x5502('0xf0')](_0x361fec[_0x5502('0x63')],'in','','');this[_0x5502('0x3d')][_0x5502('0xad')](util[_0x5502('0x2d')](_0x5502('0x10b'),_0x361fec[_0x5502('0x63')]));var _0x2832c4=this['sestekNDA']['sync'](this,_0x361fec);if(_0x2832c4){for(var _0x40025a in _0x2832c4){if(_0x2832c4[_0x5502('0x98')](_0x40025a)){this['channel'][_0x5502('0xa6')](util[_0x5502('0x2d')](_0x5502('0x10c'),_0x40025a['toUpperCase']()),_0x2832c4[_0x40025a]);}}this[_0x5502('0xf0')](_0x2832c4[_0x5502('0xf3')],'out',_0x5502('0x103'),'');if(_0x2832c4[_0x5502('0x10d')]){this[_0x5502('0x3d')][_0x5502('0xad')](util[_0x5502('0x2d')](_0x5502('0x10e'),_0x2832c4['audiofile']));var _0x4a5dba=this['channel'][_0x5502('0x10f')](_0x2832c4[_0x5502('0x10d')]);try{fs['unlink'](_0x2832c4[_0x5502('0x10d')]+_0x5502('0x110'));}catch(_0x4bd5ff){logger[_0x5502('0x31')](_0x4bd5ff);}return _0x4a5dba;}else{return this[_0x5502('0x3d')][_0x5502('0xad')](util[_0x5502('0x2d')](_0x5502('0x111'),_0x2832c4[_0x5502('0xf3')]));}}return this[_0x5502('0x3d')][_0x5502('0x31')](_0x361fec,_0x5502('0x112'));};AGIVertices[_0x5502('0x16')][_0x5502('0x113')]=function(_0x5e636b){logger[_0x5502('0x35')](util[_0x5502('0x2d')](_0x5502('0x114'),_0x5e636b[_0x5502('0xac')]));return this['channel'][_0x5502('0xad')](_0x5502('0x113'));};AGIVertices[_0x5502('0x16')][_0x5502('0x115')]=function(_0x4e2739){logger[_0x5502('0x35')](util[_0x5502('0x2d')](_0x5502('0x116'),_0x4e2739['label']));var _0x675122='';if(_0x4e2739[_0x5502('0x117')]){if(!this[_0x5502('0x86')](_0x4e2739[_0x5502('0x117')])){return this[_0x5502('0x3d')][_0x5502('0x31')](_0x4e2739,_0x5502('0x118'));}else{var _0x3b8311=parseInt(_0x4e2739[_0x5502('0x117')],0xa);if(isNaN(_0x3b8311)){_0x675122=_0x4e2739[_0x5502('0x117')];}else{_0x675122=this[_0x5502('0x1f')][_0x5502('0xa8')](this,_0x4e2739[_0x5502('0x117')]);if(!_0x675122){return this['channel'][_0x5502('0x31')](_0x4e2739,'no\x20trunk\x20found');}}}}else if(_0x4e2739['trunk_name']){_0x675122=_0x4e2739['trunk_name'];}else{return this[_0x5502('0x3d')][_0x5502('0x31')](_0x4e2739,'no\x20trunk\x20selected');}var _0xe6fa93=this['channel'][_0x5502('0x5d')]('DIAL',[util[_0x5502('0x2d')](_0x5502('0x119'),_0x675122,_0x4e2739[_0x5502('0x4c')]),_0x4e2739[_0x5502('0x6d')],_0x4e2739[_0x5502('0xeb')],_0x4e2739['url']]);if(_0xe6fa93['result']===-0x1){return _0xe6fa93;}return this[_0x5502('0x3d')][_0x5502('0xad')](util[_0x5502('0x2d')](_0x5502('0xec'),_0x5502('0xed')));};AGIVertices[_0x5502('0x16')][_0x5502('0x11a')]=function(_0xf02eba){logger[_0x5502('0x35')](util[_0x5502('0x2d')](_0x5502('0x11b'),_0xf02eba[_0x5502('0xac')]));return this[_0x5502('0x3d')][_0x5502('0xad')](_0x5502('0x11a'));};AGIVertices[_0x5502('0x16')][_0x5502('0x11c')]=function(_0x395959){logger['info'](util[_0x5502('0x2d')](_0x5502('0x11d'),_0x395959[_0x5502('0xac')]));if(_0x395959['retry']===0x0){return this[_0x5502('0xa7')](_0x395959);}_0x395959[_0x5502('0xa9')]-=0x1;if(!this['isConfigured'](_0x395959[_0x5502('0x11e')])){return this[_0x5502('0x3d')][_0x5502('0x31')](_0x395959,'no\x20file\x20audio\x20selected');}var _0x2b245d=this[_0x5502('0x21')][_0x5502('0xa8')](this,_0x395959['file_id']);if(!_0x2b245d){return this[_0x5502('0x3d')][_0x5502('0x31')](_0x395959,_0x5502('0x11f'));}if(!this['isConfigured'](_0x395959[_0x5502('0xdd')])){return this[_0x5502('0x3d')]['error'](_0x5502('0xde'));}var _0x4dfd17=this[_0x5502('0x3d')][_0x5502('0x120')](_0x2b245d,_0x395959[_0x5502('0x121')],_0x395959[_0x5502('0x122')]);var _0x5c243d=_0x4dfd17[_0x5502('0xa5')]?_0x4dfd17[_0x5502('0xa5')][_0x5502('0x51')]():'';logger[_0x5502('0x35')]('test',JSON[_0x5502('0x77')](_0x4dfd17));if(_0x4dfd17[_0x5502('0xa5')]===-0x1){this[_0x5502('0x3c')][_0x5502('0xa8')](this,_0x395959,_0x5c243d);return _0x4dfd17;}else if(_0x4dfd17[_0x5502('0xa3')]===_0x5502('0x6d')){_0x4dfd17[_0x5502('0xa5')]=_0x5c243d[_0x5502('0xa1')]>=parseInt(_0x395959[_0x5502('0x123')])?'x':'i';}else{_0x4dfd17[_0x5502('0xa5')]=_0x5c243d[_0x5502('0xa1')]>=parseInt(_0x395959['mindigit'])&&_0x5c243d[_0x5502('0xa1')]<=parseInt(_0x395959[_0x5502('0x122')])?'x':'i';}var _0x5a5439=this[_0x5502('0x12')][_0x5502('0xa8')](this,_0x395959[_0x5502('0xdd')]);if(!_0x5a5439){return this[_0x5502('0x3d')]['error'](_0x395959,_0x5502('0xdf'));}this[_0x5502('0x3d')][_0x5502('0xa6')](_0x5a5439,_0x5c243d);if(this[_0x5502('0x86')](_0x395959[_0x5502('0x124')])){var _0xf85993=parseInt(_0x395959[_0x5502('0x124')],0xa);var _0x114c5b=rs['generate']({'charset':'*','length':_0xf85993});var _0x502801=_0x5c243d['length'];if(_0x502801>0x0){if(_0x502801>_0xf85993){this[_0x5502('0x3c')][_0x5502('0xa8')](this,_0x395959,_0x395959[_0x5502('0x125')]==='first'?_0x114c5b+_0x5c243d[_0x5502('0x126')](_0xf85993):_0x5c243d['substr'](0x0,_0x502801-_0xf85993)+_0x114c5b);}else{this[_0x5502('0x3c')][_0x5502('0xa8')](this,_0x395959,rs['generate']({'charset':'*','length':_0x502801}));}}else{this[_0x5502('0x3c')][_0x5502('0xa8')](this,_0x395959,'');}}else{this[_0x5502('0x3c')][_0x5502('0xa8')](this,_0x395959,_0x5c243d);}return _0x4dfd17;};AGIVertices[_0x5502('0x16')][_0x5502('0xf')]=function(_0x1662cd){logger[_0x5502('0x35')](util[_0x5502('0x2d')](_0x5502('0x127'),_0x1662cd[_0x5502('0xac')]));return this[_0x5502('0x11c')](_0x1662cd);};AGIVertices[_0x5502('0x16')][_0x5502('0x128')]=function(_0x4e8975){logger[_0x5502('0x35')](util['format'](_0x5502('0x129'),_0x4e8975[_0x5502('0xac')]));this['createSquareDetailsReport'][_0x5502('0xa8')](this,_0x4e8975,_0x4e8975[_0x5502('0x12a')]);return this[_0x5502('0x3d')][_0x5502('0xad')](util[_0x5502('0x2d')]('GOAL\x20%s',_0x4e8975[_0x5502('0x12a')]));};AGIVertices[_0x5502('0x16')]['awspolly']=function(_0x869192){logger[_0x5502('0x35')](util[_0x5502('0x2d')]('[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block',_0x869192[_0x5502('0xac')]));if(!this['isConfigured'](_0x869192[_0x5502('0x8e')])||!this['isConfigured'](_0x869192[_0x5502('0x8f')])){return this[_0x5502('0x3d')][_0x5502('0xad')](_0x5502('0x12b'));}if(!this[_0x5502('0x86')](_0x869192[_0x5502('0x63')])){return this[_0x5502('0x3d')][_0x5502('0xad')](_0x5502('0xae'));}this[_0x5502('0x3d')][_0x5502('0xad')](util['format']('Trying\x20aws\x20Polly\x20%s',_0x869192[_0x5502('0x63')]));var _0x5d7f3e=this[_0x5502('0x88')][_0x5502('0xa8')](this,_0x869192);if(_0x5d7f3e){this[_0x5502('0x3d')][_0x5502('0xad')](util[_0x5502('0x2d')](_0x5502('0x12c'),_0x5d7f3e));var _0x2c19e1=this[_0x5502('0x3d')][_0x5502('0x10f')](_0x5d7f3e);try{fs[_0x5502('0x12d')](_0x5d7f3e+_0x5502('0x110'));}catch(_0x4eacb8){logger[_0x5502('0x31')](_0x4eacb8);}return _0x2c19e1;}return this[_0x5502('0x3d')]['error'](_0x869192,'aws\x20Polly\x20is\x20unreachable');};AGIVertices[_0x5502('0x16')][_0x5502('0x12e')]=function(_0x1b9eb0){logger[_0x5502('0x35')](util[_0x5502('0x2d')](_0x5502('0x12f'),_0x1b9eb0['label']));if(!this[_0x5502('0x86')](_0x1b9eb0[_0x5502('0x8e')])||!this[_0x5502('0x86')](_0x1b9eb0[_0x5502('0x8f')])){return this[_0x5502('0x3d')]['noop']('no\x20valid\x20credentials\x20configured');}if(!this[_0x5502('0x86')](_0x1b9eb0[_0x5502('0x91')])){return this[_0x5502('0x3d')]['noop'](_0x5502('0x130'));}if(!this[_0x5502('0x86')](_0x1b9eb0[_0x5502('0x63')])){return this[_0x5502('0x3d')][_0x5502('0xad')](_0x5502('0xae'));}this[_0x5502('0x3d')]['bot']=!![];this[_0x5502('0x3c')](_0x1b9eb0);this[_0x5502('0xf0')](_0x1b9eb0[_0x5502('0x63')],'in','','');this[_0x5502('0x3d')]['noop'](util[_0x5502('0x2d')](_0x5502('0x131'),_0x1b9eb0[_0x5502('0x63')]));var _0x2cf888=this['awsLex']['sync'](this,_0x1b9eb0);if(_0x2cf888){for(var _0x26e643 in _0x2cf888){if(_0x2cf888['hasOwnProperty'](_0x26e643)&&_['isString'](_0x2cf888[_0x26e643])){this[_0x5502('0x3d')][_0x5502('0xa6')](util[_0x5502('0x2d')](_0x5502('0x132'),_0x26e643['toUpperCase']()),_0x2cf888[_0x26e643]);}}if(_[_0x5502('0x4b')](_0x2cf888[_0x5502('0x7b')])){return this[_0x5502('0x3d')]['noop']('Amazon\x20Lex\x20ready\x20for\x20fulfillment');}else{this[_0x5502('0xf0')](_0x2cf888[_0x5502('0x7b')],'out',_0x5502('0x133'),'');return this[_0x5502('0x3d')][_0x5502('0xad')](util[_0x5502('0x2d')](_0x5502('0x134'),_0x2cf888['message']));}}return this[_0x5502('0x3d')][_0x5502('0x31')](_0x1b9eb0,_0x5502('0x135'));};AGIVertices[_0x5502('0x16')]['googleasr']=function(_0x5ef959){logger[_0x5502('0x35')](util[_0x5502('0x2d')](_0x5502('0x136'),_0x5ef959['label'],_0x5ef959['timeout']));if(!this['isConfigured'](_0x5ef959[_0x5502('0x7f')])){return this[_0x5502('0x3d')][_0x5502('0xad')](_0x5502('0x137'));}var _0x59a211=_0x5502('0x138');var _0x357dc4=util[_0x5502('0x2d')](_0x5502('0x139'),FILES_PATH,rs[_0x5502('0x13a')](0x4));var _0x303c9a=util[_0x5502('0x2d')](_0x5502('0xa0'),_0x357dc4,_0x59a211);var _0x54a477=!![];if(_0x5ef959[_0x5502('0x13b')]===_0x5502('0x13c')){_0x54a477=![];}var _0x20d9c6=this[_0x5502('0x3d')][_0x5502('0x13d')](_0x357dc4,_0x59a211,_0x5ef959['intKey'],_0x5ef959[_0x5502('0x6d')],undefined,_0x54a477);if(_0x20d9c6[_0x5502('0xa5')]!==-0x1){this[_0x5502('0x3d')]['noop'](util[_0x5502('0x2d')]('google\x20%s\x20file\x20created',_0x303c9a));var _0x4abc55=this[_0x5502('0x92')][_0x5502('0xa8')](this,_0x5ef959,_0x303c9a);if(_0x4abc55){for(var _0x39f60e in _0x4abc55){if(_0x4abc55[_0x5502('0x98')](_0x39f60e)){this['channel'][_0x5502('0xa6')](util[_0x5502('0x2d')](_0x5502('0x13e'),_0x39f60e['toUpperCase']()),_0x4abc55[_0x39f60e]);}}return this[_0x5502('0x3d')][_0x5502('0xad')](util[_0x5502('0x2d')](_0x5502('0x13f'),JSON[_0x5502('0x77')](_0x4abc55)));}}return _0x20d9c6;};AGIVertices['prototype']['tildeasr']=function(_0x1dc2c5){logger[_0x5502('0x35')](util[_0x5502('0x2d')](_0x5502('0x140'),_0x1dc2c5['label']));if(!this[_0x5502('0x86')](_0x1dc2c5[_0x5502('0x141')])){return this[_0x5502('0x3d')][_0x5502('0xad')](_0x5502('0x142'));}if(!this[_0x5502('0x86')](_0x1dc2c5['appsecret'])){return this[_0x5502('0x3d')][_0x5502('0xad')](_0x5502('0x143'));}var _0x58f90e=_0x5502('0x138');var _0x1e7702=util[_0x5502('0x2d')]('%s/recordings/%s',FILES_PATH,rs[_0x5502('0x13a')](0x4));var _0x45bff2=util[_0x5502('0x2d')](_0x5502('0xa0'),_0x1e7702,_0x58f90e);var _0x406461=!![];if(_0x1dc2c5['beep']===_0x5502('0x13c')){_0x406461=![];}var _0x5facf2=this['channel'][_0x5502('0x13d')](_0x1e7702,_0x58f90e,_0x1dc2c5[_0x5502('0x144')],_0x1dc2c5[_0x5502('0x6d')],undefined,_0x406461);if(_0x5facf2[_0x5502('0xa5')]!==-0x1){this[_0x5502('0x3d')]['noop'](util[_0x5502('0x2d')](_0x5502('0x145'),_0x45bff2));var _0x38a594=this[_0x5502('0x94')][_0x5502('0xa8')](this,_0x1dc2c5,_0x45bff2);if(_0x38a594){for(var _0x20ba48 in _0x38a594){if(_0x38a594[_0x5502('0x98')](_0x20ba48)){this[_0x5502('0x3d')][_0x5502('0xa6')](util[_0x5502('0x2d')](_0x5502('0x146'),_0x20ba48[_0x5502('0x6f')]()),_0x38a594[_0x20ba48]);}}return this[_0x5502('0x3d')]['noop'](util[_0x5502('0x2d')](_0x5502('0x147'),JSON[_0x5502('0x77')](_0x38a594)));}}return _0x5facf2;};AGIVertices[_0x5502('0x16')]['gotoc']=function(_0x16f71d){logger['info'](util[_0x5502('0x2d')](_0x5502('0x148'),_0x16f71d[_0x5502('0xac')]));return this[_0x5502('0x3d')][_0x5502('0x149')](_0x16f71d['context'],_0x16f71d[_0x5502('0x44')],_0x16f71d[_0x5502('0x14a')]);};AGIVertices[_0x5502('0x16')][_0x5502('0x14b')]=function(_0x1adfec){logger[_0x5502('0x35')](util[_0x5502('0x2d')](_0x5502('0x14c'),_0x1adfec[_0x5502('0xac')]));if(!this[_0x5502('0x86')](_0x1adfec[_0x5502('0x14d')])){return this[_0x5502('0x3d')][_0x5502('0x31')](_0x1adfec,'no\x20condition\x20configured');}try{var _0x326da4=eval(_0x1adfec[_0x5502('0x14d')])?_0x5502('0x14e'):_0x5502('0x14f');this['channel']['noop'](util[_0x5502('0x2d')](_0x5502('0x150'),_0x1adfec[_0x5502('0x14d')],_0x326da4));return{'code':0xc8,'result':_0x326da4};}catch(_0xf3cf95){return{'code':0xc8,'result':_0x5502('0x14f')};}};AGIVertices[_0x5502('0x16')]['gotoiftime']=function(_0x26ddc7){logger['info'](util[_0x5502('0x2d')](_0x5502('0x151'),_0x26ddc7[_0x5502('0xac')]));if(!this['isConfigured'](_0x26ddc7[_0x5502('0x152')])){return this[_0x5502('0x3d')][_0x5502('0x31')](_0x26ddc7,_0x5502('0x153'));}var _0x50b36c=this[_0x5502('0x154')][_0x5502('0xa8')](this,_0x26ddc7[_0x5502('0x152')]);if(!_0x50b36c){return this[_0x5502('0x3d')][_0x5502('0x31')](_0x26ddc7,'no\x20intervals\x20found');}for(var _0x1128cc=0x0;_0x1128cc<_0x50b36c[_0x5502('0xa1')];_0x1128cc+=0x1){var _0x368867=this[_0x5502('0x3d')][_0x5502('0x12')](util[_0x5502('0x2d')](_0x5502('0x155'),_0x50b36c[_0x1128cc]));if(_0x368867['result']===-0x1){return _0x368867;}logger[_0x5502('0x35')](util['format'](_0x5502('0x156'),_0x50b36c[_0x1128cc],_0x368867['extra']));if(_0x368867[_0x5502('0xa3')]==='true'){logger[_0x5502('0x35')](util['format'](_0x5502('0x156'),_0x50b36c[_0x1128cc],_0x5502('0x14e')));this['channel'][_0x5502('0xad')](util[_0x5502('0x2d')](_0x5502('0x156'),_0x50b36c[_0x1128cc],_0x5502('0x14e')));return{'code':0xc8,'result':_0x5502('0x14e')};}else{logger[_0x5502('0x35')](util[_0x5502('0x2d')](_0x5502('0x156'),_0x50b36c[_0x1128cc],_0x5502('0x14f')));this['channel']['noop'](util[_0x5502('0x2d')](_0x5502('0x156'),_0x50b36c[_0x1128cc],'false'));}}return{'code':0xc8,'result':'false'};};AGIVertices[_0x5502('0x16')][_0x5502('0x157')]=function(_0x3648f3){logger[_0x5502('0x35')](util[_0x5502('0x2d')](_0x5502('0x158'),_0x3648f3[_0x5502('0xac')]));return this[_0x5502('0x3d')]['hangup']();};AGIVertices[_0x5502('0x16')][_0x5502('0x159')]=function(_0x285fec){logger['info'](util['format'](_0x5502('0x15a'),_0x285fec[_0x5502('0xac')]));if(!this[_0x5502('0x86')](_0x285fec[_0x5502('0x7f')])){return this[_0x5502('0x3d')][_0x5502('0xad')](_0x5502('0x137'));}var _0x3229b6=_0x5502('0x138');var _0x3dd47b=util['format'](_0x5502('0x139'),FILES_PATH,rs['generate'](0x4));var _0x34fb44=util['format'](_0x5502('0xa0'),_0x3dd47b,_0x3229b6);var _0x24a811=!![];if(_0x285fec['beep']===_0x5502('0x13c')){_0x24a811=![];}var _0x2bece0=this[_0x5502('0x3d')][_0x5502('0x13d')](_0x3dd47b,_0x3229b6,_0x285fec[_0x5502('0x144')],_0x285fec[_0x5502('0x6d')],undefined,_0x24a811);if(_0x2bece0[_0x5502('0xa5')]!==-0x1){this[_0x5502('0x3d')][_0x5502('0xad')](util[_0x5502('0x2d')](_0x5502('0x15b'),_0x34fb44));var _0x2cdfde=this[_0x5502('0x84')][_0x5502('0xa8')](this,_0x285fec,_0x34fb44);if(_0x2cdfde){for(var _0x3fd950 in _0x2cdfde){if(_0x2cdfde[_0x5502('0x98')](_0x3fd950)){this['channel'][_0x5502('0xa6')](util[_0x5502('0x2d')]('ISPEECH_ASR_%s',_0x3fd950[_0x5502('0x6f')]()),_0x2cdfde[_0x3fd950]);}}return this[_0x5502('0x3d')]['noop'](util[_0x5502('0x2d')]('IspeechASR\x20Result\x20%s',JSON[_0x5502('0x77')](_0x2cdfde)));}}return _0x2bece0;};AGIVertices[_0x5502('0x16')][_0x5502('0x15c')]=function(_0x347a38){logger[_0x5502('0x35')](util[_0x5502('0x2d')](_0x5502('0x15d'),_0x347a38[_0x5502('0xac')]));if(!this['isConfigured'](_0x347a38[_0x5502('0x7f')])){return this[_0x5502('0x3d')][_0x5502('0xad')](_0x5502('0x137'));}if(!this[_0x5502('0x86')](_0x347a38[_0x5502('0x63')])){return this[_0x5502('0x3d')][_0x5502('0xad')](_0x5502('0xae'));}this['channel']['noop'](util[_0x5502('0x2d')]('Trying\x20ispeech\x20TTS\x20%s',_0x347a38[_0x5502('0x63')]));var _0x18b396=this[_0x5502('0x82')][_0x5502('0xa8')](this,_0x347a38);if(_0x18b396){this['channel']['noop'](util[_0x5502('0x2d')](_0x5502('0x15b'),_0x18b396));var _0x5bf677=this['channel']['streamFile'](_0x18b396,_0x347a38[_0x5502('0x144')]);try{fs[_0x5502('0x12d')](_0x18b396+_0x5502('0x110'));}catch(_0x4c44ff){logger[_0x5502('0x31')](_0x4c44ff);}return _0x5bf677;}return this[_0x5502('0x3d')][_0x5502('0x31')](_0x347a38,_0x5502('0x15e'));};AGIVertices['prototype']['login']=function(_0x57cbdc){logger[_0x5502('0x35')](util[_0x5502('0x2d')](_0x5502('0x15f'),_0x57cbdc['label']));if(!this['isConfigured'](_0x57cbdc[_0x5502('0x160')])){return this[_0x5502('0x3d')][_0x5502('0x31')](_0x57cbdc,_0x5502('0x161'));}logger['info'](util[_0x5502('0x2d')](_0x5502('0x162'),this[_0x5502('0x3d')]['callerid'],_0x57cbdc['findBy']));var _0x3afea9=this[_0x5502('0x58')][_0x5502('0xa8')](this,_0x57cbdc[_0x5502('0x160')]);if(_0x3afea9){logger[_0x5502('0x35')](util[_0x5502('0x2d')](_0x5502('0x163'),this['channel'][_0x5502('0x41')],_0x57cbdc[_0x5502('0x160')]));this[_0x5502('0x3d')]['noop'](util[_0x5502('0x2d')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x5502('0x3d')][_0x5502('0x41')],_0x57cbdc[_0x5502('0x160')]));return{'code':0xc8,'result':'success'};}else{logger[_0x5502('0x35')](util[_0x5502('0x2d')](_0x5502('0x164'),this[_0x5502('0x3d')][_0x5502('0x41')],_0x57cbdc[_0x5502('0x160')]));this[_0x5502('0x3d')][_0x5502('0xad')](util[_0x5502('0x2d')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x5502('0x3d')]['callerid'],_0x57cbdc[_0x5502('0x160')]));return{'code':0xc8,'result':'failure'};}};AGIVertices[_0x5502('0x16')][_0x5502('0x165')]=function(_0x20b9a6){logger[_0x5502('0x35')](util[_0x5502('0x2d')](_0x5502('0x166'),_0x20b9a6['label']));if(!this[_0x5502('0x86')](_0x20b9a6[_0x5502('0x160')])){return this[_0x5502('0x3d')][_0x5502('0x31')](_0x20b9a6,_0x5502('0x161'));}logger['info'](util['format'](_0x5502('0x162'),this[_0x5502('0x3d')][_0x5502('0x41')],_0x20b9a6[_0x5502('0x160')]));var _0x2d8252=this['agentLogout'][_0x5502('0xa8')](this,_0x20b9a6[_0x5502('0x160')]);if(_0x2d8252){logger[_0x5502('0x35')](util['format'](_0x5502('0x163'),this[_0x5502('0x3d')][_0x5502('0x41')],_0x20b9a6['findBy']));this[_0x5502('0x3d')]['noop'](util[_0x5502('0x2d')](_0x5502('0x163'),this[_0x5502('0x3d')][_0x5502('0x41')],_0x20b9a6[_0x5502('0x160')]));return{'code':0xc8,'result':_0x5502('0x167')};}else{logger[_0x5502('0x35')](util[_0x5502('0x2d')](_0x5502('0x164'),this[_0x5502('0x3d')][_0x5502('0x41')],_0x20b9a6['findBy']));this[_0x5502('0x3d')][_0x5502('0xad')](util[_0x5502('0x2d')](_0x5502('0x164'),this[_0x5502('0x3d')]['callerid'],_0x20b9a6[_0x5502('0x160')]));return{'code':0xc8,'result':_0x5502('0x168')};}};AGIVertices[_0x5502('0x16')][_0x5502('0x169')]=function(_0x245d85){logger[_0x5502('0x35')](util[_0x5502('0x2d')](_0x5502('0x16a'),_0x245d85[_0x5502('0xac')]));if(!this[_0x5502('0x86')](_0x245d85['operation'])){return this['channel'][_0x5502('0x31')](_0x245d85,_0x5502('0x16b'));}this[_0x5502('0x3d')][_0x5502('0xad')](util[_0x5502('0x2d')](_0x5502('0x16c'),_0x245d85['operation']));var _0x5bbbed=eval(_0x245d85[_0x5502('0x16d')]);if(!this[_0x5502('0x86')](_0x245d85[_0x5502('0xdd')])){return this[_0x5502('0x3d')]['noop'](_0x5502('0xde'));}var _0x51d152=this[_0x5502('0x12')][_0x5502('0xa8')](this,_0x245d85[_0x5502('0xdd')]);if(!_0x51d152){return this['channel'][_0x5502('0x31')](_0x245d85,'no\x20variable\x20found');}if(_[_0x5502('0x9e')](_0x5bbbed)){var _0x25b993=this;_0x5bbbed[_0x5502('0xe1')](function(_0x2459a8,_0x466351){_0x25b993[_0x5502('0x3d')]['setVariable'](util[_0x5502('0x2d')](_0x5502('0x16e'),_0x51d152,_0x466351),_0x2459a8);});return this[_0x5502('0x3d')][_0x5502('0xad')](util[_0x5502('0x2d')](_0x5502('0x16f'),_0x51d152));}else{return this[_0x5502('0x3d')]['setVariable'](_0x51d152,_0x5bbbed);}};AGIVertices[_0x5502('0x16')][_0x5502('0xe')]=function(_0x125573){logger['info'](util[_0x5502('0x2d')](_0x5502('0x170'),_0x125573[_0x5502('0xac')]));if(_0x125573['retry']===0x0){return this[_0x5502('0xa7')](_0x125573);}_0x125573[_0x5502('0xa9')]-=0x1;if(!this['isConfigured'](_0x125573[_0x5502('0x11e')])){return this[_0x5502('0x3d')][_0x5502('0x31')](_0x125573,_0x5502('0x171'));}var _0x5268a3=this['getSound'][_0x5502('0xa8')](this,_0x125573[_0x5502('0x11e')]);if(!_0x5268a3){return this[_0x5502('0x3d')][_0x5502('0x31')](_0x125573,'no\x20file\x20audio\x20found');}var _0x20d793=this['channel'][_0x5502('0x120')](_0x5268a3,_0x125573['response'],_0x125573['digit']);var _0x54809a=_0x20d793[_0x5502('0xa5')];if(_0x20d793['result']===-0x1){this[_0x5502('0x3c')][_0x5502('0xa8')](this,_0x125573,'-1');return _0x20d793;}else if(_0x20d793['extra']===_0x5502('0x6d')){_0x20d793[_0x5502('0xa5')]=_0x20d793[_0x5502('0xa5')][_0x5502('0xa1')]>0x0?_0x20d793[_0x5502('0xa5')]:'t';}else if(_[_0x5502('0x49')](_0x20d793[_0x5502('0xa5')])){_0x20d793[_0x5502('0xa5')]='#';_0x54809a='#';}if(!this[_0x5502('0x86')](_0x125573['variable_id'])){this[_0x5502('0x3d')][_0x5502('0xad')]('no\x20variable\x20selected\x20for\x20the\x20result');}else{var _0x3e724d=this[_0x5502('0x12')][_0x5502('0xa8')](this,_0x125573['variable_id']);if(!_0x3e724d){return this[_0x5502('0x3d')]['error'](_0x125573,_0x5502('0xdf'));}this[_0x5502('0x3d')][_0x5502('0xa6')](_0x3e724d,_0x54809a);}this[_0x5502('0x3c')][_0x5502('0xa8')](this,_0x125573,_0x54809a);return _0x20d793;};AGIVertices[_0x5502('0x16')]['noop']=function(_0x1ca400){logger['info'](util[_0x5502('0x2d')](_0x5502('0x172'),_0x1ca400[_0x5502('0xac')]));return this['channel'][_0x5502('0xad')](_0x1ca400[_0x5502('0x173')]||_0x1ca400[_0x5502('0xac')]);};AGIVertices[_0x5502('0x16')][_0x5502('0x174')]=function(_0x4a18f5){logger['info'](util['format'](_0x5502('0x175'),_0x4a18f5['label']));if(!this[_0x5502('0x86')](_0x4a18f5[_0x5502('0x160')])){return this[_0x5502('0x3d')][_0x5502('0x31')](_0x4a18f5,_0x5502('0x161'));}logger[_0x5502('0x35')](util[_0x5502('0x2d')](_0x5502('0x162'),this[_0x5502('0x3d')][_0x5502('0x41')],_0x4a18f5[_0x5502('0x160')]));var _0x2e092a=this[_0x5502('0x52')][_0x5502('0xa8')](this,_0x4a18f5['pause_id']);var _0x504ba0=this[_0x5502('0x54')]['sync'](this,_0x4a18f5['findBy'],_0x2e092a);if(_0x504ba0){logger[_0x5502('0x35')](util[_0x5502('0x2d')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x5502('0x3d')][_0x5502('0x41')],_0x4a18f5[_0x5502('0x160')]));this[_0x5502('0x3d')][_0x5502('0xad')](util[_0x5502('0x2d')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x5502('0x3d')]['callerid'],_0x4a18f5[_0x5502('0x160')]));return{'code':0xc8,'result':_0x5502('0x167')};}else{logger['info'](util[_0x5502('0x2d')](_0x5502('0x164'),this[_0x5502('0x3d')][_0x5502('0x41')],_0x4a18f5['findBy']));this['channel'][_0x5502('0xad')](util[_0x5502('0x2d')]('AGENT\x20%s\x20FOUND\x20BY',this['channel'][_0x5502('0x41')],_0x4a18f5[_0x5502('0x160')]));return{'code':0xc8,'result':'failure'};}};AGIVertices[_0x5502('0x16')][_0x5502('0x176')]=function(_0x389a3d){logger[_0x5502('0x35')](util[_0x5502('0x2d')](_0x5502('0x177'),_0x389a3d[_0x5502('0xac')]));if(!this[_0x5502('0x86')](_0x389a3d[_0x5502('0x11e')])){return this['channel'][_0x5502('0x31')](_0x389a3d,_0x5502('0x171'));}var _0x235dbc=this[_0x5502('0x21')][_0x5502('0xa8')](this,_0x389a3d[_0x5502('0x11e')]);if(!_0x235dbc){return this['channel']['error'](_0x389a3d,_0x5502('0x11f'));}var _0x5f2fcd=this[_0x5502('0x3d')]['exec'](_0x5502('0x178'),[_0x235dbc,_0x389a3d[_0x5502('0xeb')]]);if(_0x5f2fcd['result']===-0x1){return _0x5f2fcd;}return this[_0x5502('0x3d')][_0x5502('0xad')](util['format'](_0x5502('0xc7'),_0x5502('0x178'),_0x235dbc));};AGIVertices[_0x5502('0x16')][_0x5502('0x179')]=function(_0x4ca3d1){logger[_0x5502('0x35')](util['format']('Enter\x20in\x20QUEUE\x20(%s)\x20block',_0x4ca3d1[_0x5502('0xac')]));if(!this[_0x5502('0x86')](_0x4ca3d1[_0x5502('0x17a')])){return this[_0x5502('0x3d')][_0x5502('0x31')](_0x4ca3d1,_0x5502('0x17b'));}var _0x4640fc='';var _0x242796=parseInt(_0x4ca3d1[_0x5502('0x17a')],0xa);if(isNaN(_0x242796)){_0x4640fc=_0x4ca3d1['queue_id'];}else{_0x4640fc=this['getVoiceQueue']['sync'](this,_0x4ca3d1[_0x5502('0x17a')]);if(!_0x4640fc){return this[_0x5502('0x3d')][_0x5502('0x31')](_0x4ca3d1,_0x5502('0x17c'));}}var _0x57e3ae='';if(this[_0x5502('0x86')](_0x4ca3d1[_0x5502('0x11e')])){var _0x4fffd0=this[_0x5502('0x21')][_0x5502('0xa8')](this,_0x4ca3d1[_0x5502('0x11e')]);if(_0x4fffd0){_0x57e3ae=_0x4fffd0;}}this[_0x5502('0x3c')][_0x5502('0xa8')](this,_0x4ca3d1,_0x4640fc);if(_0x4ca3d1[_0x5502('0xeb')][_0x5502('0x17d')]('x')<0x0){_0x4ca3d1['opts']+='x';}if(_0x4ca3d1[_0x5502('0xeb')]['indexOf']('X')<0x0){_0x4ca3d1[_0x5502('0xeb')]+='X';}this[_0x5502('0x3d')][_0x5502('0xa6')](_0x5502('0x17e'),_0x4640fc?_0x4640fc[_0x5502('0x17f')]():'');var _0xc91b1=this[_0x5502('0x3d')][_0x5502('0x5d')](_0x5502('0x180'),[_0x4640fc,_0x4ca3d1[_0x5502('0xeb')],_0x4ca3d1[_0x5502('0x6a')],_0x57e3ae,_0x4ca3d1[_0x5502('0x6d')],_0x4ca3d1[_0x5502('0x9')],_0x4ca3d1[_0x5502('0x181')],_0x4ca3d1[_0x5502('0x182')],'',_0x4ca3d1[_0x5502('0x183')]]);if(_0xc91b1['result']===-0x1){return _0xc91b1;}return this['channel'][_0x5502('0xad')](util['format'](_0x5502('0xc7'),_0x5502('0x180'),_0x4640fc));};AGIVertices[_0x5502('0x16')][_0x5502('0x184')]=function(_0x3d13b0){logger[_0x5502('0x35')](util['format']('Enter\x20in\x20RECORD\x20(%s)\x20block',_0x3d13b0[_0x5502('0xac')]));var _0xe727c8=_0x3d13b0[_0x5502('0x185')]||'wav';var _0xffbdbd=util[_0x5502('0x2d')](_0x5502('0x186'),this[_0x5502('0x3d')]['uniqueid'],rs[_0x5502('0x13a')](0x5));var _0x333b9b=util[_0x5502('0x2d')](_0x5502('0x187'),FILES_PATH,_0xffbdbd,_0xe727c8);var _0x3d5868=util[_0x5502('0x2d')](_0x5502('0x139'),FILES_PATH,_0xffbdbd);this['createSquareRecording'][_0x5502('0xa8')](this,_0x3d13b0,_0xffbdbd,_0x333b9b);this['channel']['setVariable']('RECORDING_SAVENAME',_0xffbdbd);logger[_0x5502('0x35')](_0x5502('0x188'),_0x3d5868,_0xe727c8,_0x3d13b0[_0x5502('0x189')],_0x3d13b0[_0x5502('0x6d')]);return this['channel']['recordFile'](_0x3d5868,_0xe727c8,_0x3d13b0[_0x5502('0x189')],_0x3d13b0[_0x5502('0x6d')],undefined,!![]);};AGIVertices[_0x5502('0x16')][_0x5502('0x18a')]=function(_0x2450b4){logger[_0x5502('0x35')](util[_0x5502('0x2d')](_0x5502('0x18b'),_0x2450b4['label']));if(!this[_0x5502('0x86')](_0x2450b4[_0x5502('0x6a')])){return this[_0x5502('0x3d')][_0x5502('0xad')](_0x5502('0x18c'));}var _0x3fa256=this['restAPI'][_0x5502('0xa8')](this,_0x2450b4);logger[_0x5502('0x35')](util['format'](_0x5502('0x18d'),util[_0x5502('0x18e')](_0x3fa256,{'showHidden':![],'depth':null})));if(!this[_0x5502('0x86')](_0x2450b4[_0x5502('0xdd')])){return this[_0x5502('0x3d')]['noop'](_0x5502('0x18f'));}var _0x420410=this[_0x5502('0x12')][_0x5502('0xa8')](this,_0x2450b4[_0x5502('0xdd')]);if(!_0x420410){return this['channel'][_0x5502('0x31')](_0x2450b4,_0x5502('0xdf'));}this[_0x5502('0x3d')][_0x5502('0xa6')](util[_0x5502('0x2d')](_0x5502('0x190'),_0x420410),_0x3fa256['statusCode']?_0x3fa256['statusCode']:_0x5502('0x191'));this['channel']['setVariable'](util[_0x5502('0x2d')](_0x5502('0x192'),_0x420410),_0x3fa256['statusMessage']?_0x3fa256[_0x5502('0x7a')]:'OK');if(_0x3fa256[_0x5502('0x70')]){try{this[_0x5502('0x9f')](_0x3fa256[_0x5502('0x70')],_0x420410);}catch(_0x1df145){logger[_0x5502('0x31')](util['format'](_0x5502('0x193'),_0x420410));}}return this['channel']['noop'](util[_0x5502('0x2d')](_0x5502('0xe3'),_0x420410));};AGIVertices[_0x5502('0x16')]['saydigits']=function(_0x8f5162){logger[_0x5502('0x35')](util[_0x5502('0x2d')](_0x5502('0x194'),_0x8f5162[_0x5502('0xac')]));return this['channel'][_0x5502('0x195')](_0x8f5162['digits'][_0x5502('0x5f')](/\s+/g,''),_0x8f5162[_0x5502('0x189')]);};AGIVertices['prototype'][_0x5502('0x196')]=function(_0x20b86e){logger[_0x5502('0x35')](util['format']('Enter\x20in\x20SAYNUMBER\x20(%s)\x20block',_0x20b86e[_0x5502('0xac')]));return this['channel']['sayNumber'](_0x20b86e[_0x5502('0x6c')][_0x5502('0x5f')](/\s+/g,''),_0x20b86e['escape_digits']);};AGIVertices[_0x5502('0x16')]['sayphonetic']=function(_0x9b4542){logger['info'](util[_0x5502('0x2d')]('Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block',_0x9b4542[_0x5502('0xac')]));return this[_0x5502('0x3d')][_0x5502('0x197')](_0x9b4542[_0x5502('0x63')],_0x9b4542[_0x5502('0x189')]);};AGIVertices[_0x5502('0x16')][_0x5502('0x198')]=function(_0x27a2f4){logger['info'](util[_0x5502('0x2d')](_0x5502('0x199'),_0x27a2f4[_0x5502('0xac')]));if(!this[_0x5502('0x86')](_0x27a2f4[_0x5502('0x19a')])){return this[_0x5502('0x3d')][_0x5502('0xad')]('no\x20mail\x20account\x20configured');}var _0x49bb36=this[_0x5502('0x25')][_0x5502('0xa8')](this,_0x27a2f4[_0x5502('0x19a')]);if(!_0x49bb36||!_0x49bb36[_0x5502('0x19b')]){return this[_0x5502('0x3d')]['error'](_0x27a2f4,_0x5502('0x19c'));}var _0x3b7795={'from':util['format'](_0x5502('0x19d'),_0x49bb36[_0x5502('0x15')],_0x49bb36['email']||_0x49bb36[_0x5502('0x19b')][_0x5502('0x19e')]),'to':_0x27a2f4['to']||'','cc':_0x27a2f4['cc']||'','bcc':_0x27a2f4['bcc']||'','subject':_0x27a2f4['subject'],'html':_0x27a2f4[_0x5502('0x63')],'text':_0x27a2f4['text']};var _0x4baaa1={'tls':{'rejectUnauthorized':![]}};if(_0x49bb36[_0x5502('0x19b')][_0x5502('0x19f')]){_0x4baaa1[_0x5502('0x19f')]=_0x49bb36['Smtp'][_0x5502('0x19f')];}else{_0x4baaa1['host']=_0x49bb36['Smtp'][_0x5502('0x1a0')];_0x4baaa1['port']=_0x49bb36['Smtp'][_0x5502('0x1a1')];_0x4baaa1[_0x5502('0x1a2')]=_0x49bb36[_0x5502('0x19b')][_0x5502('0x1a2')];}if(_0x49bb36['Smtp']['authentication']){_0x4baaa1[_0x5502('0x1a3')]={'user':_0x49bb36['Smtp'][_0x5502('0x19e')],'pass':_0x49bb36[_0x5502('0x19b')]['pass']};}if(this[_0x5502('0x86')](_0x27a2f4[_0x5502('0x1a4')])){}logger[_0x5502('0xe5')]('sendMail\x20message',JSON['stringify'](_0x3b7795));this[_0x5502('0x3c')]['sync'](this,_0x27a2f4,_0x27a2f4['account_id']);this['channel'][_0x5502('0xad')](util['format'](_0x5502('0x1a5'),_0x49bb36[_0x5502('0x15')]));this[_0x5502('0x27')]['sync'](this,_0x4baaa1,_0x3b7795);return this[_0x5502('0x3d')]['noop'](_0x5502('0x1a6'));};AGIVertices[_0x5502('0x16')][_0x5502('0x1a7')]=function(_0x3e9cdd){logger[_0x5502('0x35')](util[_0x5502('0x2d')]('Enter\x20in\x20SENDFAX\x20(%s)\x20block',_0x3e9cdd[_0x5502('0xac')]));return this['channel'][_0x5502('0xad')](_0x5502('0x1a8'));};AGIVertices[_0x5502('0x16')][_0x5502('0x1a9')]=function(_0x4d1646){logger[_0x5502('0x35')](util[_0x5502('0x2d')](_0x5502('0x1aa'),_0x4d1646['label']));if(!this[_0x5502('0x86')](_0x4d1646[_0x5502('0x1ab')])){return this[_0x5502('0x3d')][_0x5502('0xad')](_0x5502('0x1ac'));}var _0x21044c=this[_0x5502('0x1ad')][_0x5502('0xa8')](this,_0x4d1646['sms_account_id']);if(!_0x21044c){return this['channel'][_0x5502('0x31')](_0x4d1646,_0x5502('0x1ae'));}var _0x3ae6ed={'body':_0x4d1646[_0x5502('0x1af')],'phone':_0x4d1646['to']||'','SmsAccountId':_0x21044c['id']};logger[_0x5502('0xe5')](_0x5502('0x1b0'),JSON[_0x5502('0x77')](_0x3ae6ed));this[_0x5502('0x3c')]['sync'](this,_0x4d1646,_0x4d1646[_0x5502('0x1ab')]);this[_0x5502('0x3d')][_0x5502('0xad')](util['format'](_0x5502('0x1b1'),_0x21044c['name']));this['createSmsMessage']['sync'](this,_0x3ae6ed);return this[_0x5502('0x3d')][_0x5502('0xad')](_0x5502('0x1b2'));};AGIVertices['prototype'][_0x5502('0x1b3')]=function(_0x2d9975){logger[_0x5502('0x35')](util[_0x5502('0x2d')](_0x5502('0x1b4'),_0x2d9975[_0x5502('0xac')]));if(!this[_0x5502('0x86')](_0x2d9975['variable_id'])){return this[_0x5502('0x3d')]['error'](_0x2d9975,_0x5502('0x1b5'));}var _0x4ad8e2=this['getVariable'][_0x5502('0xa8')](this,_0x2d9975['variable_id']);if(!_0x4ad8e2){return this[_0x5502('0x3d')][_0x5502('0x31')](_0x2d9975,_0x5502('0xdf'));}return this[_0x5502('0x3d')]['setVariable'](_0x4ad8e2,_0x2d9975['variable_value']);};AGIVertices[_0x5502('0x16')][_0x5502('0x1b6')]=function(_0x4e8a96){logger[_0x5502('0x35')](util[_0x5502('0x2d')]('Enter\x20in\x20START\x20(%s)\x20block',_0x4e8a96[_0x5502('0xac')]));this['channel'][_0x5502('0xad')](_0x5502('0x1b7'));if(_0x4e8a96[_0x5502('0xbc')]==='yes'){this[_0x5502('0x3d')][_0x5502('0xad')](_0x5502('0x1b8'));return this[_0x5502('0x3d')][_0x5502('0xbc')]();}return this[_0x5502('0x3d')]['noop'](_0x5502('0x1b9'));};AGIVertices[_0x5502('0x16')][_0x5502('0x1ba')]=function(_0x663293){logger['info'](util[_0x5502('0x2d')](_0x5502('0x1bb'),_0x663293[_0x5502('0xac')]));if(!this[_0x5502('0x86')](_0x663293[_0x5502('0x1bc')])){return this[_0x5502('0x3d')][_0x5502('0x31')](_0x663293,_0x5502('0x1bd'));}var _0x186309=this['getSquareProject'][_0x5502('0xa8')](this,_0x663293[_0x5502('0x1bc')]);if(!this[_0x5502('0x86')](_0x186309)){return this[_0x5502('0x3d')][_0x5502('0x31')](_0x663293,util[_0x5502('0x2d')](_0x5502('0x1be'),_0x663293['project_id']));}if(_0x186309===this[_0x5502('0x3d')]['arg_1']){return this[_0x5502('0x3d')]['error'](_0x663293,_0x5502('0x1bf'));}this[_0x5502('0x3c')]['sync'](this,_0x663293,_0x186309);var _0x319ac3=this[_0x5502('0x3d')][_0x5502('0x5d')](_0x5502('0x1c0'),util[_0x5502('0x2d')](_0x5502('0x1c1'),config['agi'][_0x5502('0x1a0')]||_0x5502('0x1c2'),_0x186309,this[_0x5502('0x3d')][_0x5502('0x40')]));if(_0x319ac3['result']===-0x1){return _0x319ac3;}return this['channel'][_0x5502('0xad')](util[_0x5502('0x2d')](_0x5502('0xc7'),_0x5502('0x1c0'),_0x186309));};AGIVertices['prototype'][_0x5502('0x1c3')]=function(_0x320ccb){logger['info'](util[_0x5502('0x2d')](_0x5502('0x1c4'),_0x320ccb['label']));var _0x5318e5=this['shellCommand'][_0x5502('0xa8')](this,_0x320ccb['command']);this['createSquareDetailsReport'][_0x5502('0xa8')](this,_0x320ccb,_0x320ccb[_0x5502('0x1c5')]);if(this['isConfigured'](_0x320ccb['variable_id'])){var _0x220e4b=this[_0x5502('0x12')][_0x5502('0xa8')](this,_0x320ccb['variable_id']);if(_0x220e4b){this[_0x5502('0x3d')]['setVariable'](_0x220e4b,_0x5318e5);return this['channel'][_0x5502('0xad')](util[_0x5502('0x2d')](_0x5502('0x1c6'),_0x320ccb[_0x5502('0x1c5')],_0x220e4b));}}return this['channel'][_0x5502('0xad')](util[_0x5502('0x2d')](_0x5502('0x1c7'),_0x320ccb[_0x5502('0x1c5')]));};AGIVertices[_0x5502('0x16')]['google_cloud_tts']=function(_0x5c7083){logger[_0x5502('0x35')](util['format'](_0x5502('0x1c8'),_0x5c7083[_0x5502('0xac')]));_0x5c7083[_0x5502('0x63')]=_0x5c7083[_0x5502('0x63')]['replace'](/(\r\n|\n|\r)/gm,'\x20');if(!this['isConfigured'](_0x5c7083['apiKey'])){return this[_0x5502('0x3d')][_0x5502('0xad')](_0x5502('0x1c9'));}if(!this[_0x5502('0x86')](_0x5c7083[_0x5502('0x63')])){return this[_0x5502('0x3d')][_0x5502('0xad')](_0x5502('0xae'));}this[_0x5502('0x3d')][_0x5502('0xad')](util[_0x5502('0x2d')]('Trying\x20Google\x20Cloud\x20TTS\x20%s',_0x5c7083[_0x5502('0x63')]));var _0x1d9d22=this[_0x5502('0x60')]['sync'](this,_0x5c7083);if(_0x1d9d22){this['channel'][_0x5502('0xad')](util[_0x5502('0x2d')](_0x5502('0x1ca'),_0x1d9d22));var _0xdc864e=this[_0x5502('0x3d')][_0x5502('0x10f')](_0x1d9d22);try{fs[_0x5502('0x12d')](_0x1d9d22+_0x5502('0x110'));}catch(_0x730d14){logger[_0x5502('0x31')](_0x730d14);}return _0xdc864e;}return this[_0x5502('0x3d')][_0x5502('0x31')](_0x5c7083,_0x5502('0x1cb'));};AGIVertices[_0x5502('0x16')][_0x5502('0x1cc')]=function(_0x330ce3){logger[_0x5502('0x35')](util[_0x5502('0x2d')](_0x5502('0x1cd'),_0x330ce3[_0x5502('0xac')]));_0x330ce3[_0x5502('0x63')]=_0x330ce3[_0x5502('0x63')][_0x5502('0x5f')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x5502('0x86')](_0x330ce3[_0x5502('0x63')])){return this[_0x5502('0x3d')][_0x5502('0xad')](_0x5502('0xae'));}this[_0x5502('0x3d')]['noop'](util[_0x5502('0x2d')](_0x5502('0x1ce'),_0x330ce3[_0x5502('0x63')]));var _0x5b9dfd=this[_0x5502('0x68')]['sync'](this,_0x330ce3);if(_0x5b9dfd){this[_0x5502('0x3d')]['noop'](util[_0x5502('0x2d')]('Google\x20TTS\x20%s\x20file\x20created',_0x5b9dfd));var _0x104805=this[_0x5502('0x3d')][_0x5502('0x10f')](_0x5b9dfd);try{fs['unlink'](_0x5b9dfd+_0x5502('0x110'));}catch(_0x514fa5){logger[_0x5502('0x31')](_0x514fa5);}return _0x104805;}return this[_0x5502('0x3d')][_0x5502('0x31')](_0x330ce3,'Google\x20TTS\x20is\x20unreachable');};AGIVertices[_0x5502('0x16')][_0x5502('0x1cf')]=function(_0x4f7a7f){logger[_0x5502('0x35')](util[_0x5502('0x2d')](_0x5502('0x1d0'),_0x4f7a7f[_0x5502('0xac')]));if(!this[_0x5502('0x86')](_0x4f7a7f[_0x5502('0x160')])){return this[_0x5502('0x3d')]['error'](_0x4f7a7f,_0x5502('0x161'));}logger[_0x5502('0x35')](util[_0x5502('0x2d')](_0x5502('0x162'),this[_0x5502('0x3d')][_0x5502('0x41')],_0x4f7a7f[_0x5502('0x160')]));var _0x227aad=this[_0x5502('0x56')][_0x5502('0xa8')](this,_0x4f7a7f[_0x5502('0x160')]);if(_0x227aad){logger[_0x5502('0x35')](util['format'](_0x5502('0x163'),this[_0x5502('0x3d')][_0x5502('0x41')],_0x4f7a7f['findBy']));this[_0x5502('0x3d')][_0x5502('0xad')](util[_0x5502('0x2d')](_0x5502('0x163'),this[_0x5502('0x3d')][_0x5502('0x41')],_0x4f7a7f[_0x5502('0x160')]));return{'code':0xc8,'result':_0x5502('0x167')};}else{logger['info'](util[_0x5502('0x2d')](_0x5502('0x164'),this['channel'][_0x5502('0x41')],_0x4f7a7f[_0x5502('0x160')]));this[_0x5502('0x3d')][_0x5502('0xad')](util[_0x5502('0x2d')](_0x5502('0x164'),this['channel'][_0x5502('0x41')],_0x4f7a7f['findBy']));return{'code':0xc8,'result':_0x5502('0x168')};}};AGIVertices['prototype'][_0x5502('0x1d1')]=function(_0x2d0cb0){logger[_0x5502('0x35')](util[_0x5502('0x2d')](_0x5502('0x1d2'),_0x2d0cb0[_0x5502('0xac')]));var _0x573d36=this[_0x5502('0x3d')]['exec'](_0x5502('0x1d3'),[_0x2d0cb0['mailbox'],_0x2d0cb0[_0x5502('0x7d')]]);if(_0x573d36[_0x5502('0xa5')]===-0x1){return _0x573d36;}return this['channel'][_0x5502('0xad')](util[_0x5502('0x2d')](_0x5502('0xc7'),'VOICEMAIL',_0x2d0cb0[_0x5502('0x1d4')]));};AGIVertices[_0x5502('0x16')][_0x5502('0x1d5')]=function(_0xd8f5b0){logger[_0x5502('0x35')](util[_0x5502('0x2d')](_0x5502('0x1d6'),_0xd8f5b0[_0x5502('0xac')]));if(!this[_0x5502('0x86')](_0xd8f5b0['variable_id'])){return this['channel'][_0x5502('0x31')](_0xd8f5b0,'no\x20variable\x20selected');}var _0x540c78=this['getVariable'][_0x5502('0xa8')](this,_0xd8f5b0[_0x5502('0xdd')]);if(!_0x540c78){return this['channel'][_0x5502('0x31')](_0xd8f5b0,_0x5502('0xdf'));}var _0x2ed533=this[_0x5502('0x3d')][_0x5502('0x12')](_0x540c78);return{'code':0xc8,'result':_0x2ed533[_0x5502('0xa3')]?_0x2ed533[_0x5502('0xa3')]:'-'};};String[_0x5502('0x16')]['replaceAll']=function(_0x4afbe8,_0x4abecf){return this['split'](_0x4afbe8)[_0x5502('0x1d7')](_0x4abecf);};module[_0x5502('0x1d8')]=AGIVertices; \ No newline at end of file +var _0x8889=['Google\x20TTS\x20%s\x20file\x20created','unpause','Enter\x20in\x20VOICEMAIL\x20(%s)\x20block','VOICEMAIL','Enter\x20in\x20SWITCH\x20(%s)\x20block','replaceAll','path','util','lodash','shelljs','odbc','randomstring','moment','mustache','request-promise','../../config/environment','./scripts','/var/opt/motion2/server/files','rawBody','menu','getsecretdigits','channel','rpc','mailRpc','getVariable','getVariableById','then','name','catch','prototype','getVoiceQueueById','getSquareProject','getSquareProjectById','dsn','getUserById','getSound','getSoundById','getSoundPath','getMailAccount','getMailAccountById','sendMailMessage','getIntervals','getIntervalById','IntervalId','interval','map','format','getQueryOdbc','Error\x20getting\x20ODBC\x20connection\x20%s','info','ODBC\x20connection\x20successfully','query','Error\x20executing\x20query\x20%s','Query\x20executed\x20correctly\x20%s','close','Error\x20closing\x20connection\x20to\x20odbc\x20%s','getSmsAccount','getSmsAccountById','createSmsMessage','createSquareDetailsReport','uniqueid','label','agicommand','arg_1','callerid','createSquareRecording','calleridname','context','extension','priority','accountcode','isEmpty','isNil','callback_','lastName','phone','list_id','callback','Callback\x20scheduled\x20at\x20','scheduledAt','toString','callback_priority','getPause','agentPause','agent','error','agentUnpause','agentLogout','agentLogin','LOCAL','shellCommand','exec','trim','replace','googleCloudTTS','apiKey','google_cloud_tts_text_type','text','languageCode','en-US','ssmlGender','MALE','audioEncoding','MP3','googleTTS','url','method','timeout','number','includes','PUT','toUpperCase','parse','An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function','headers','rawHeaders','computedVariables','sync','uri','render','stringify','body','statusCode','statusMessage','message','500\x20-\x20Internal\x20Server\x20Error','options','googleDialogflow','key','dialogflow_language','googleDialogflowV2','dialogflowV2_project_id','client_email','private_key','ispeechTTS','ispeech_tts_language','speed','ispeechASR','ispeech_asr_language','model','awsPolly','aws_access_key_id','aws_secret_access_key','aws_polly_region','aws_polly_voice','Amy','aws_text_type','awsLex','aws_lex_region','aws_bot_name','googleASR','tildeASR','appid','clear','clone','hasOwnProperty','isString','replaceObjectAllVariables','replaceAllVariables','recursiveNodeIndex','isPlainObject','isArray','length','saveRestApiResult','%s.%s','setVariable','split','extra','getAndSetVariable','result','The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s','maxRetry','mrcpsynth','Enter\x20in\x20MRCPSynth\x20(%s)\x20block','isConfigured','noop','Enter\x20in\x20MRCPRecog\x20(%s)\x20block','no\x20grammar\x20configured','grammar','MRCPRecog','RECOG_CONFIDENCE()','RECOG_INPUT()','MRCP_RECOG_TRANSCRIPT','RECOG_INSTANCE()','Enter\x20in\x20AGI\x20(%s)\x20block','agi','command','args','answer','Enter\x20in\x20ANSWER\x20(%s)\x20block','Wait\x20%s\x20seconds\x20before\x20answer','wait','Enter\x20in\x20CALLBACK\x20(%s)\x20block','delay','add','createCmContact','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','no\x20text\x20configured','MRCPSynth','Executed\x20command\x20MRCPSynth\x20%s','Enter\x20in\x20SESTEKTTS\x20(%s)\x20block','lumenvoxasr','Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block','LUMENVOX_ASR_CONFIDENCE','LUMENVOX_ASR_TRANSCRIPT','LUMENVOX_ASR_INSTANCE','Executed\x20command\x20MRCPRecog\x20%s','Enter\x20in\x20SESTEKASR\x20(%s)\x20block','SESTEK_ASR_CONFIDENCE','database','odbc_id','no\x20database\x20selected','getSquareOdbc','no\x20query\x20configured','variable_id','no\x20variable\x20selected\x20for\x20the\x20result','no\x20variable\x20found','forEach','keys','%s[%s][%s]','%s_ROWS_COUNT','variable\x20%s\x20set','dial','debug','Enter\x20in\x20DIAL\x20(%s)\x20block','sip_id','getUser','DIAL','SIP/%s','opts','dialogflow','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','no\x20key\x20configured','createSquareMessage','Trying\x20Dialogflow:\x20%s','DIALOGFLOW_%s','speech','out','Dialogflow\x20Result\x20%s','Dialogflow\x20is\x20unreachable','dialogflowV2','no\x20project_id\x20configured','no\x20private_key\x20configured','dialogflowV2_language','bot','Trying\x20DialogflowV2:\x20%s','providerResponse','DialogflowV2\x20Result\x20%s','DialogflowV2\x20is\x20unreachable','sesteknda','Enter\x20in\x20SESTEKNDA\x20(%s)\x20block','no\x20ndauth\x20url\x20configured','no\x20username\x20configured','password','no\x20password\x20configured','ndassistant_url','Trying\x20SestekNDA:\x20%s','sestekNDA','SESTEK_NDA_%s','audiofile','Sestek\x20NDA\x20%s\x20file\x20created','streamFile','unlink','.wav','SestekNDA\x20is\x20unreachable','end','Enter\x20in\x20END\x20(%s)\x20block','ext_dial','Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block','trunk_id','no\x20trunk\x20selected','getTrunk','no\x20trunk\x20found','trunk_name','SIP/%s/%s','finally','Enter\x20in\x20FINALLY\x20(%s)\x20block','getdigits','Enter\x20in\x20GETDIGITS\x20(%s)\x20block','retry','file_id','no\x20file\x20audio\x20selected','no\x20file\x20audio\x20found','getData','response','maxdigit','test','hiddendigitsnum','hiddendigitspos','first','substr','generate','Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block','Enter\x20in\x20GOAL\x20(%s)\x20block','goalname','GOAL\x20%s','[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block','no\x20valid\x20credentials\x20configured','Trying\x20aws\x20Polly\x20%s','aws\x20Polly\x20%s\x20file\x20created','aws\x20Polly\x20is\x20unreachable','awslex','Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block','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','beep','NOBEEP','recordFile','google\x20%s\x20file\x20created','GOOGLE_ASR_%s','GoogleASR\x20Result\x20%s','Enter\x20in\x20TILDEASR\x20(%s)\x20block','no\x20appid\x20configured','appsecret','no\x20appsecret\x20configured','wav','%s/recordings/%s','intKey','tilde\x20%s\x20file\x20created','TILDE_ASR_%s','TildeASR\x20Result\x20%s','gotoc','Enter\x20in\x20GOTO\x20(%s)\x20block','Enter\x20in\x20GOTOIF\x20(%s)\x20block','condition','no\x20condition\x20configured','true','false','EVAL\x20CONDITION\x20%s\x20%s','gotoiftime','Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block','interval_id','no\x20interval\x20configured','IFTIME(%s?true:false)','IFTIME\x20%s\x20%s','hangup','ispeechasr','IspeechASR\x20Result\x20%s','ispeechtts','Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block','Trying\x20ispeech\x20TTS\x20%s','ispeech\x20%s\x20file\x20created','ispeech\x20TTS\x20is\x20unreachable','login','findBy','no\x20find\x20by\x20configured','FIND\x20AGENT\x20%s\x20BY\x20%s','AGENT\x20%s\x20FOUND\x20BY','success','AGENT\x20%s\x20NOT\x20FOUND\x20BY','failure','logout','Enter\x20in\x20LOGOUT\x20(%s)\x20block','math','operation','math\x20%s','%s[%s]','variable\x20%s[key]\x20set','digit','Enter\x20in\x20NOOP\x20(%s)\x20block','output','pause','Enter\x20in\x20PAUSE\x20(%s)\x20block','pause_id','playback','Enter\x20in\x20PLAYBACK\x20(%s)\x20block','PLAYBACK','queue','Enter\x20in\x20QUEUE\x20(%s)\x20block','no\x20queue\x20selected','queue_id','getVoiceQueue','no\x20queue\x20found','indexOf','XMCS-QUEUE','QUEUE','macro','position','record','Enter\x20in\x20RECORD\x20(%s)\x20block','%s_%s','%s/recordings/%s.%s','Recording\x20%s\x20%s\x20%s\x20%s','escape_digits','restapi','Enter\x20in\x20RESTAPI\x20(%s)\x20block','restAPI','inspect','no\x20variable\x20selected\x20for\x20the\x20response','%s_STATUS_CODE','200','%s_STATUS_MESSAGE','saydigits','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','sayDigits','digits','Enter\x20in\x20SAYNUMBER\x20(%s)\x20block','sayNumber','sayphonetic','Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block','sayPhonetic','sendMail','Enter\x20in\x20SENDMAIL\x20(%s)\x20block','account_id','no\x20mail\x20account\x20configured','Smtp','\x22%s\x22\x20<%s>','email','user','bcc','service','host','port','secure','authentication','pass','template_id','sendMail\x20message','Trying\x20SendMail\x20with\x20account\x20%s','Mail\x20message\x20added\x20to\x20outgoing\x20process','sendFax','Enter\x20in\x20SENDFAX\x20(%s)\x20block','SENDFAX\x20block\x20not\x20implemented','sendSMS','sms_account_id','no\x20sms\x20account\x20configured','no\x20sms\x20account\x20found','sendSMS\x20message','Trying\x20SendSMS\x20with\x20account\x20%s','set','Enter\x20in\x20SET\x20(%s)\x20block','no\x20variable\x20selected','start','Enter\x20in\x20START\x20(%s)\x20block','yes','Answer','Skipped\x20Answer','subproject','Enter\x20in\x20SUBPROJECT\x20(%s)\x20block','project_id','no\x20subproject\x20selected','no\x20subproject\x20found\x20with\x20id\x20%d','project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project','AGI','agi://%s/square,\x22%s\x22,\x22%s\x22','127.0.0.1','system','Enter\x20in\x20SYSTEM\x20(%s)\x20block','sh\x20command:\x20%s\x20result\x20no\x20stored','Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block','no\x20apiKey\x20configured','Trying\x20Google\x20Cloud\x20TTS\x20%s','Google\x20Cloud\x20TTS\x20is\x20unreachable','tts','Trying\x20Google\x20TTS\x20%s'];(function(_0x5d39ca,_0x4e8788){var _0x2a100b=function(_0x314542){while(--_0x314542){_0x5d39ca['push'](_0x5d39ca['shift']());}};_0x2a100b(++_0x4e8788);}(_0x8889,0x1d9));var _0x9888=function(_0x9c37b6,_0x10dee8){_0x9c37b6=_0x9c37b6-0x0;var _0x5cdc09=_0x8889[_0x9c37b6];return _0x5cdc09;};'use strict';var fs=require('fs');var path=require(_0x9888('0x0'));var util=require(_0x9888('0x1'));var _=require(_0x9888('0x2'));var sh=require(_0x9888('0x3'));var odbc=require(_0x9888('0x4'))();var rs=require(_0x9888('0x5'));var moment=require(_0x9888('0x6'));var Mustache=require(_0x9888('0x7'));var rp=require(_0x9888('0x8'));var logger=require('../../config/logger')('agi');var config=require(_0x9888('0x9'));var scripts=require(_0x9888('0xa'));var FILES_PATH=_0x9888('0xb');var recursiveMapAttributes=['rawHeaders',_0x9888('0xc')];var verticesWithRetry=[_0x9888('0xd'),'getdigits',_0x9888('0xe')];var AGIVertices=function(_0x1449b2,_0x4cce43,_0x4a3937){this[_0x9888('0xf')]=_0x1449b2;this[_0x9888('0x10')]=_0x4cce43;this[_0x9888('0x11')]=_0x4a3937;};AGIVertices['prototype'][_0x9888('0x12')]=function(_0x452ffe,_0x44afb9){this[_0x9888('0x10')][_0x9888('0x13')](_0x452ffe)[_0x9888('0x14')](function(_0x2d7811){_0x44afb9(null,_0x2d7811?_0x2d7811[_0x9888('0x15')]:![]);})[_0x9888('0x16')](function(_0x7dbebb){_0x44afb9(_0x7dbebb);});};AGIVertices[_0x9888('0x17')]['getVoiceQueue']=function(_0x29eefa,_0x319d6a){this[_0x9888('0x10')][_0x9888('0x18')](_0x29eefa)[_0x9888('0x14')](function(_0x3124f8){_0x319d6a(null,_0x3124f8?_0x3124f8[_0x9888('0x15')]:![]);})['catch'](function(_0x8c8d04){_0x319d6a(_0x8c8d04);});};AGIVertices[_0x9888('0x17')][_0x9888('0x19')]=function(_0x1809c2,_0x14787f){this[_0x9888('0x10')][_0x9888('0x1a')](_0x1809c2)[_0x9888('0x14')](function(_0xdd68af){_0x14787f(null,_0xdd68af?_0xdd68af['name']:![]);})[_0x9888('0x16')](function(_0x34da08){_0x14787f(_0x34da08);});};AGIVertices[_0x9888('0x17')]['getSquareOdbc']=function(_0x5d58fe,_0x4f99cf){this[_0x9888('0x10')]['getSquareOdbcById'](_0x5d58fe)[_0x9888('0x14')](function(_0x2210f8){_0x4f99cf(null,_0x2210f8?_0x2210f8[_0x9888('0x1b')]:![]);})[_0x9888('0x16')](function(_0x5aa0d4){_0x4f99cf(_0x5aa0d4);});};AGIVertices['prototype']['getUser']=function(_0x1d770b,_0x1fc26d){this[_0x9888('0x10')][_0x9888('0x1c')](_0x1d770b)[_0x9888('0x14')](function(_0x465878){_0x1fc26d(null,_0x465878?_0x465878['name']:![]);})[_0x9888('0x16')](function(_0x55272a){_0x1fc26d(_0x55272a);});};AGIVertices[_0x9888('0x17')]['getTrunk']=function(_0x344e7c,_0x2db107){this[_0x9888('0x10')]['getTrunkById'](_0x344e7c)[_0x9888('0x14')](function(_0x91f1cb){_0x2db107(null,_0x91f1cb?_0x91f1cb['name']:![]);})[_0x9888('0x16')](function(_0x23f7d5){_0x2db107(_0x23f7d5);});};AGIVertices[_0x9888('0x17')][_0x9888('0x1d')]=function(_0x169a98,_0x1fac1a){var _0x21ef5f=this;this[_0x9888('0x10')][_0x9888('0x1e')](_0x169a98)[_0x9888('0x14')](function(_0xfd004){_0x1fac1a(null,_0xfd004?_0x21ef5f[_0x9888('0x1f')](_0xfd004['save_name']):![]);})[_0x9888('0x16')](function(_0x4b4174){_0x1fac1a(_0x4b4174);});};AGIVertices[_0x9888('0x17')][_0x9888('0x20')]=function(_0x56fe7a,_0x263c63){this['rpc'][_0x9888('0x21')](_0x56fe7a)[_0x9888('0x14')](function(_0x33623b){_0x263c63(null,_0x33623b?_0x33623b:![]);})[_0x9888('0x16')](function(_0x2a57fa){_0x263c63(_0x2a57fa);});};AGIVertices['prototype']['sendMailMessage']=function(_0x507304,_0x5d3815,_0x130d1b){this[_0x9888('0x11')][_0x9888('0x22')](_0x507304,_0x5d3815)[_0x9888('0x14')](function(){_0x130d1b(null);})[_0x9888('0x16')](function(_0x326259){_0x130d1b(_0x326259);});};AGIVertices[_0x9888('0x17')][_0x9888('0x23')]=function(_0x19091d,_0x3612e0){this[_0x9888('0x10')][_0x9888('0x24')](_0x19091d)[_0x9888('0x14')](function(_0x30d1dd){if(_0x30d1dd){if(_0x30d1dd[_0x9888('0x25')]){_0x3612e0(null,[_0x30d1dd[_0x9888('0x26')]]);}else{_0x3612e0(null,_[_0x9888('0x27')](_0x30d1dd['Intervals'],_0x9888('0x26')));}}else{_0x3612e0(null,![]);}})[_0x9888('0x16')](function(_0xcb3ce9){_0x3612e0(_0xcb3ce9);});};AGIVertices[_0x9888('0x17')][_0x9888('0x1f')]=function(_0x1a797d){return util[_0x9888('0x28')]('%s/sounds/converted/%s',FILES_PATH,_0x1a797d);};AGIVertices[_0x9888('0x17')][_0x9888('0x29')]=function(_0x299a7f,_0x4ac3e8,_0x2da93a){odbc['open'](_0x299a7f,function(_0x5b2596){if(_0x5b2596){logger['error'](_0x9888('0x2a'),_0x5b2596);_0x2da93a(_0x5b2596);}else{logger[_0x9888('0x2b')](_0x9888('0x2c'));odbc[_0x9888('0x2d')](_0x4ac3e8,function(_0x3c2260,_0xf8b359){if(_0x3c2260){logger[_0x9888('0x2b')](_0x9888('0x2e'),_0x4ac3e8);_0x2da93a(_0x3c2260);}else{logger[_0x9888('0x2b')](_0x9888('0x2f'),_0x4ac3e8);odbc[_0x9888('0x30')](function(_0x2a9f13){if(_0x2a9f13){logger['error'](_0x9888('0x31'),_0x2a9f13);}_0x2da93a(null,_0xf8b359);});}});}});};AGIVertices[_0x9888('0x17')][_0x9888('0x32')]=function(_0x40c753,_0x32c818){this[_0x9888('0x10')][_0x9888('0x33')](_0x40c753)['then'](function(_0x78bf46){_0x32c818(null,_0x78bf46?_0x78bf46:![]);})[_0x9888('0x16')](function(_0x267660){_0x32c818(_0x267660);});};AGIVertices[_0x9888('0x17')][_0x9888('0x34')]=function(_0x5c3f5d,_0x4cdc19){this[_0x9888('0x10')][_0x9888('0x34')](_0x5c3f5d)['then'](function(_0xf5b3e8){_0x4cdc19(null,_0xf5b3e8);})[_0x9888('0x16')](function(_0x203168){_0x4cdc19(_0x203168);});};AGIVertices[_0x9888('0x17')][_0x9888('0x35')]=function(_0x4fa50e,_0x1b07e6,_0x20fb7d){this['rpc'][_0x9888('0x35')]({'uniqueid':this[_0x9888('0xf')][_0x9888('0x36')],'node':_0x4fa50e[_0x9888('0x37')],'application':_0x4fa50e[_0x9888('0x38')],'data':_0x1b07e6||null,'project_name':this['channel'][_0x9888('0x39')],'callerid':this['channel'][_0x9888('0x3a')]})[_0x9888('0x14')](function(_0x15a109){if(_0x20fb7d){_0x20fb7d(null,_0x15a109);}})[_0x9888('0x16')](function(_0x1656ea){if(_0x20fb7d){_0x20fb7d(_0x1656ea);}});};AGIVertices[_0x9888('0x17')][_0x9888('0x3b')]=function(_0x2fe28e,_0x206af8,_0x39d2fe,_0x222e89){this[_0x9888('0x10')][_0x9888('0x3b')]({'uniqueid':this['channel'][_0x9888('0x36')],'callerid':this[_0x9888('0xf')][_0x9888('0x3a')],'calleridname':this[_0x9888('0xf')][_0x9888('0x3c')],'context':this[_0x9888('0xf')][_0x9888('0x3d')],'extension':this[_0x9888('0xf')][_0x9888('0x3e')],'priority':this['channel'][_0x9888('0x3f')],'accountcode':this[_0x9888('0xf')][_0x9888('0x40')],'dnid':this['channel']['dnid'],'projectName':this['channel']['arg_1'],'saveName':_0x206af8,'filename':_0x2fe28e['file']||_0x206af8,'savePath':_0x39d2fe})['then'](function(_0x5592f6){_0x222e89(null,_0x5592f6);})[_0x9888('0x16')](function(_0x32ccb7){_0x222e89(_0x32ccb7);});};AGIVertices[_0x9888('0x17')]['createSquareMessage']=function(_0x469bf0,_0x455a08,_0x428b07,_0x3f4550,_0x30967e){this['rpc']['createSquareMessage']({'uniqueid':this[_0x9888('0xf')][_0x9888('0x36')],'body':_0x469bf0,'direction':_0x455a08,'providerName':_0x428b07,'providerResponse':_0x3f4550})['then'](function(_0xe5e22d){if(_0x30967e){_0x30967e(null,_0xe5e22d);}})['catch'](function(_0x2b969f){if(_0x30967e){_0x30967e(_0x2b969f);}});};AGIVertices[_0x9888('0x17')]['createCmContact']=function(_0x1c4466,_0x7b5cad){this[_0x9888('0x10')]['createCmContact']({'firstName':_[_0x9888('0x41')](_0x1c4466['name'])||_[_0x9888('0x42')](_0x1c4466[_0x9888('0x15')])?_0x9888('0x43')+Math['random']():_0x1c4466[_0x9888('0x15')],'lastName':_['isEmpty'](_0x1c4466['lastName'])||_[_0x9888('0x42')](_0x1c4466[_0x9888('0x44')])?null:_0x1c4466[_0x9888('0x44')],'phone':_0x1c4466[_0x9888('0x45')],'ListId':_0x1c4466[_0x9888('0x46')],'scheduledat':_0x1c4466['scheduledAt'],'callbackUniqueid':this[_0x9888('0xf')][_0x9888('0x36')],'tags':_0x9888('0x47'),'description':_0x9888('0x48')+_0x1c4466[_0x9888('0x49')][_0x9888('0x4a')](),'priority':_0x1c4466[_0x9888('0x4b')]})['then'](function(_0x566423){_0x7b5cad(null,_0x566423);})[_0x9888('0x16')](function(_0x2785a2){_0x7b5cad(_0x2785a2);});};AGIVertices['prototype'][_0x9888('0x4c')]=function(_0x3a9f3e,_0x5b9b3a){this[_0x9888('0x10')]['getPauseById'](_0x3a9f3e)['then'](function(_0x102235){_0x5b9b3a(null,_0x102235?_0x102235[_0x9888('0x15')]:![]);})[_0x9888('0x16')](function(_0x4a0e0a){_0x5b9b3a(_0x4a0e0a);});};AGIVertices['prototype'][_0x9888('0x4d')]=function(_0x5b0063,_0x55c5bf,_0x4ba18f){var _0x28cb9c={'role':_0x9888('0x4e')};_0x28cb9c[_0x5b0063]=this[_0x9888('0xf')][_0x9888('0x3a')];this['rpc'][_0x9888('0x4d')](_0x28cb9c,_0x55c5bf,this[_0x9888('0xf')][_0x9888('0x36')])[_0x9888('0x14')](function(_0xdcd3a0){_0x4ba18f(null,_[_0x9888('0x42')](_0xdcd3a0)?![]:!![]);})['catch'](function(_0x234e96){logger[_0x9888('0x4f')](_0x234e96);_0x4ba18f(null,![]);});};AGIVertices[_0x9888('0x17')][_0x9888('0x50')]=function(_0x28c697,_0x21f779){var _0x318104={'role':_0x9888('0x4e')};_0x318104[_0x28c697]=this[_0x9888('0xf')]['callerid'];this[_0x9888('0x10')][_0x9888('0x50')](_0x318104)[_0x9888('0x14')](function(_0x32f31d){_0x21f779(null,_[_0x9888('0x42')](_0x32f31d)?![]:!![]);})['catch'](function(_0x5eb24e){logger[_0x9888('0x4f')](_0x5eb24e);_0x21f779(null,![]);});};AGIVertices[_0x9888('0x17')][_0x9888('0x51')]=function(_0x4ea17f,_0x20b8fa){var _0x165260={'role':_0x9888('0x4e')};_0x165260[_0x4ea17f]=this['channel']['callerid'];this[_0x9888('0x10')][_0x9888('0x51')](_0x165260)['then'](function(_0x1696b4){_0x20b8fa(null,_[_0x9888('0x42')](_0x1696b4)?![]:!![]);})[_0x9888('0x16')](function(_0x57f1fb){logger[_0x9888('0x4f')](_0x57f1fb);_0x20b8fa(null,![]);});};AGIVertices['prototype'][_0x9888('0x52')]=function(_0x10dad8,_0x1b266c){var _0xe19aee={'role':_0x9888('0x4e')};_0xe19aee[_0x10dad8]=this['channel']['callerid'];var _0x4ae0f6=_0x10dad8!='internal'?util[_0x9888('0x28')]('%s/%s@from-sip/n',_0x9888('0x53'),this['channel'][_0x9888('0x3a')]):undefined;this[_0x9888('0x10')][_0x9888('0x52')](_0xe19aee,_0x4ae0f6)[_0x9888('0x14')](function(_0x4b0267){_0x1b266c(null,_[_0x9888('0x42')](_0x4b0267)?![]:!![]);})[_0x9888('0x16')](function(_0x2b532b){logger['error'](_0x2b532b);_0x1b266c(null,![]);});};AGIVertices['prototype'][_0x9888('0x54')]=function(_0x3eaa8b,_0x5e7ffc){sh[_0x9888('0x55')](_[_0x9888('0x56')](_0x3eaa8b),function(_0x4045f5,_0x30e24d){var _0x27d626=_0x30e24d[_0x9888('0x57')](/(\r\n|\n|\r)/gm,'');_0x5e7ffc(null,_0x27d626);});};AGIVertices['prototype'][_0x9888('0x58')]=function(_0x57da1b,_0x4a298b){scripts[_0x9888('0x58')](_0x57da1b[_0x9888('0x59')],_0x57da1b[_0x9888('0x5a')]||_0x9888('0x5b'),_0x57da1b[_0x9888('0x5b')],_0x57da1b[_0x9888('0x5c')]||_0x9888('0x5d'),_0x57da1b[_0x9888('0x5e')]||_0x9888('0x5f'),_0x57da1b[_0x9888('0x60')]||_0x9888('0x61'))[_0x9888('0x14')](function(_0x3a3dcb){_0x4a298b(null,_0x3a3dcb);})[_0x9888('0x16')](function(_0x6675a7){_0x4a298b(_0x6675a7);});};AGIVertices[_0x9888('0x17')][_0x9888('0x62')]=function(_0x56ba13,_0x363a67){scripts['googleTTS'](_0x56ba13[_0x9888('0x5b')],_0x56ba13['google_tts_language']||'en',0x1)[_0x9888('0x14')](function(_0x51f3b0){_0x363a67(null,_0x51f3b0);})[_0x9888('0x16')](function(_0x355bea){_0x363a67(_0x355bea);});};AGIVertices[_0x9888('0x17')]['restAPI']=function(_0x2225a3,_0x19bd2a){var _0x3c63d9={'uri':_0x2225a3[_0x9888('0x63')],'method':_0x2225a3[_0x9888('0x64')],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x2225a3[_0x9888('0x65')])===_0x9888('0x66')&&parseInt(_0x2225a3[_0x9888('0x65')])>=0x1?parseInt(_0x2225a3[_0x9888('0x65')])*0x3e8:0x5*0x3e8};if(_[_0x9888('0x67')](['POST',_0x9888('0x68')],_0x3c63d9[_0x9888('0x64')][_0x9888('0x69')]())){try{_0x3c63d9['body']=_0x2225a3[_0x9888('0xc')]?JSON[_0x9888('0x6a')](_0x2225a3[_0x9888('0xc')]):{};}catch(_0x164fff){logger[_0x9888('0x4f')](_0x9888('0x6b'),_0x164fff);}}try{_0x3c63d9[_0x9888('0x6c')]=_0x2225a3[_0x9888('0x6d')]?JSON[_0x9888('0x6a')](_0x2225a3[_0x9888('0x6d')]):{};}catch(_0x1a509d){logger[_0x9888('0x4f')]('An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function',_0x1a509d);}if(_0x2225a3[_0x9888('0x6e')]){try{var _0x316d70=require(_0x2225a3[_0x9888('0x6e')])[_0x9888('0x6f')](this,_0x3c63d9);_0x3c63d9[_0x9888('0x70')]=Mustache[_0x9888('0x71')](_0x2225a3['url'],_0x316d70,{},['$$','$$']);if(_0x3c63d9[_0x9888('0x6c')]){_0x3c63d9[_0x9888('0x6c')]=JSON['parse'](Mustache[_0x9888('0x71')](JSON[_0x9888('0x72')](_0x3c63d9[_0x9888('0x6c')]),_0x316d70,{},['$$','$$']));}if(_0x3c63d9[_0x9888('0x73')]){_0x3c63d9['body']=JSON[_0x9888('0x6a')](Mustache['render'](JSON[_0x9888('0x72')](_0x3c63d9[_0x9888('0x73')]),_0x316d70,{},['$$','$$']));}}catch(_0x412f17){logger[_0x9888('0x4f')]('An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function',_0x412f17);}}rp(_0x3c63d9)[_0x9888('0x14')](function(_0x54053a){var _0x41ee9a={'statusCode':_0x54053a[_0x9888('0x74')]||0xc8,'statusMessage':_0x54053a[_0x9888('0x75')]||'OK','headers':_0x54053a[_0x9888('0x6c')]||{},'body':_0x54053a['body']||{}};_0x19bd2a(null,_0x41ee9a);})[_0x9888('0x16')](function(_0x44dd1c){var _0x5e6397={'statusCode':_0x44dd1c['statusCode']||0x1f4,'statusMessage':_0x44dd1c[_0x9888('0x76')]||_0x9888('0x77'),'headers':_0x44dd1c[_0x9888('0x78')]['headers']||{},'body':_0x44dd1c[_0x9888('0x78')]['body']||{}};_0x19bd2a(null,_0x5e6397);});};AGIVertices['prototype']['googleDialogflow']=function(_0x5f3d65,_0x30d48b){scripts[_0x9888('0x79')](this[_0x9888('0xf')]['uniqueid'],_0x5f3d65[_0x9888('0x7a')],_0x5f3d65['text'],_0x5f3d65[_0x9888('0x7b')]||'en')['then'](function(_0x1011f7){_0x30d48b(null,_0x1011f7);})['catch'](function(_0x55b834){_0x30d48b(_0x55b834);});};AGIVertices[_0x9888('0x17')][_0x9888('0x7c')]=function(_0x2ac1a4,_0x279835){scripts[_0x9888('0x7c')](this[_0x9888('0xf')][_0x9888('0x36')],_0x2ac1a4[_0x9888('0x7d')],_0x2ac1a4[_0x9888('0x7e')],_0x2ac1a4[_0x9888('0x7f')],_0x2ac1a4[_0x9888('0x5b')],_0x2ac1a4['dialogflowV2_language']||'en')['then'](function(_0x52e580){_0x279835(null,_0x52e580);})[_0x9888('0x16')](function(_0x3faab8){_0x279835(_0x3faab8);});};AGIVertices[_0x9888('0x17')]['sestekNDA']=function(_0x19ad51,_0x28544b){scripts['sestekNDA'](this[_0x9888('0xf')],_0x19ad51)[_0x9888('0x14')](function(_0x180195){_0x28544b(null,_0x180195);})[_0x9888('0x16')](function(_0x34ccc4){_0x28544b(_0x34ccc4);});};AGIVertices[_0x9888('0x17')][_0x9888('0x80')]=function(_0x27e40c,_0x252064){scripts[_0x9888('0x80')](_0x27e40c['key'],_0x27e40c[_0x9888('0x5b')],_0x27e40c[_0x9888('0x81')]||'en-US',_0x27e40c[_0x9888('0x82')])[_0x9888('0x14')](function(_0xf360bf){_0x252064(null,_0xf360bf);})['catch'](function(_0x450349){_0x252064(_0x450349);});};AGIVertices[_0x9888('0x17')][_0x9888('0x83')]=function(_0x238a65,_0x13e7a4,_0x34c973){scripts[_0x9888('0x83')](_0x13e7a4,_0x238a65[_0x9888('0x7a')],_0x238a65[_0x9888('0x84')]||_0x9888('0x5d'),this['isConfigured'](_0x238a65['model'])?_0x238a65[_0x9888('0x85')]:undefined)['then'](function(_0x57d705){_0x34c973(null,_0x57d705);})[_0x9888('0x16')](function(_0x532965){_0x34c973(_0x532965);});};AGIVertices[_0x9888('0x17')][_0x9888('0x86')]=function(_0x1e18e0,_0x2289da){scripts[_0x9888('0x86')](_0x1e18e0[_0x9888('0x87')],_0x1e18e0[_0x9888('0x88')],_0x1e18e0[_0x9888('0x89')],_0x1e18e0[_0x9888('0x8a')]||_0x9888('0x8b'),_0x1e18e0['text'],_0x1e18e0[_0x9888('0x8c')]||_0x9888('0x5b'))['then'](function(_0xb182ab){_0x2289da(null,_0xb182ab);})[_0x9888('0x16')](function(_0x1ae5f9){_0x2289da(_0x1ae5f9);});};AGIVertices['prototype']['awsLex']=function(_0x3ee556,_0x52a0db){scripts[_0x9888('0x8d')](this[_0x9888('0xf')][_0x9888('0x36')],_0x3ee556[_0x9888('0x87')],_0x3ee556[_0x9888('0x88')],_0x3ee556[_0x9888('0x8e')],_0x3ee556[_0x9888('0x5b')],_0x3ee556[_0x9888('0x8f')])['then'](function(_0x2b5bb8){_0x52a0db(null,_0x2b5bb8);})[_0x9888('0x16')](function(_0x1f97eb){_0x52a0db(_0x1f97eb);});};AGIVertices[_0x9888('0x17')][_0x9888('0x90')]=function(_0x6aa6f4,_0x34778f,_0x48ffa8){scripts[_0x9888('0x90')](_0x34778f,_0x6aa6f4[_0x9888('0x7a')],_0x6aa6f4['google_asr_language']||_0x9888('0x5d'))[_0x9888('0x14')](function(_0x1b71cd){_0x48ffa8(null,_0x1b71cd);})[_0x9888('0x16')](function(_0x48f67f){_0x48ffa8(_0x48f67f);});};AGIVertices[_0x9888('0x17')][_0x9888('0x91')]=function(_0x375ea4,_0x330369,_0x56be29){scripts[_0x9888('0x91')](_0x330369,_0x375ea4[_0x9888('0x92')],_0x375ea4['appsecret'],_0x375ea4['uri'])[_0x9888('0x14')](function(_0x26c755){_0x56be29(null,_0x26c755);})['catch'](function(_0x3a7ff7){_0x56be29(_0x3a7ff7);});};AGIVertices['prototype'][_0x9888('0x93')]=function(_0x51d269){var _0x4cdb5d=_['includes'](verticesWithRetry,_0x51d269[_0x9888('0x38')])?_0x51d269:_[_0x9888('0x94')](_0x51d269);for(var _0x3e6f02 in _0x4cdb5d){if(_0x4cdb5d[_0x9888('0x95')](_0x3e6f02)){if(_0x4cdb5d[_0x3e6f02]&&_[_0x9888('0x96')](_0x4cdb5d[_0x3e6f02])){if(_[_0x9888('0x67')](recursiveMapAttributes,_0x3e6f02)){_0x4cdb5d[_0x3e6f02]=this[_0x9888('0x97')](_0x4cdb5d[_0x3e6f02]);}else{_0x4cdb5d[_0x3e6f02]=this[_0x9888('0x98')](_0x4cdb5d[_0x3e6f02]);}}}}return _0x4cdb5d;};AGIVertices[_0x9888('0x17')][_0x9888('0x99')]=function(_0x41fad4){for(var _0x218b18 in _0x41fad4){if(_0x41fad4[_0x9888('0x95')](_0x218b18)){if(_[_0x9888('0x9a')](_0x41fad4[_0x218b18])){this['recursiveNodeIndex'](_0x41fad4[_0x218b18]);}else if(_[_0x9888('0x9b')](_0x41fad4[_0x218b18])){for(var _0x5b7311=0x0;_0x5b7311<_0x41fad4[_0x218b18][_0x9888('0x9c')];_0x5b7311++){this[_0x9888('0x99')](_0x41fad4[_0x218b18][_0x5b7311]);}}else if(_[_0x9888('0x96')](_0x41fad4[_0x218b18])){_0x41fad4[_0x218b18]=this['replaceAllVariables'](_0x41fad4[_0x218b18]);}}}};AGIVertices[_0x9888('0x17')]['saveRestApiResult']=function(_0x392954,_0x358a45){for(var _0x37d9ab in _0x392954){if(_0x392954[_0x9888('0x95')](_0x37d9ab)){if(_[_0x9888('0x9a')](_0x392954[_0x37d9ab])){if(!_[_0x9888('0x41')](_0x392954[_0x37d9ab])){this[_0x9888('0x9d')](_0x392954[_0x37d9ab],util[_0x9888('0x28')](_0x9888('0x9e'),_0x358a45,_0x37d9ab));}}else if(_[_0x9888('0x9b')](_0x392954[_0x37d9ab])){for(var _0x2c0f5a=0x0;_0x2c0f5a<_0x392954[_0x37d9ab][_0x9888('0x9c')];_0x2c0f5a++){this[_0x9888('0x9d')](_0x392954[_0x37d9ab][_0x2c0f5a],util[_0x9888('0x28')](_0x9888('0x9e'),_0x358a45,_0x37d9ab+'['+_0x2c0f5a+']'));}}else{if(!_[_0x9888('0x42')](_0x392954[_0x37d9ab])){this[_0x9888('0xf')][_0x9888('0x9f')](util[_0x9888('0x28')](_0x9888('0x9e'),_0x358a45,_0x37d9ab),_0x392954[_0x37d9ab]);}}}}};AGIVertices[_0x9888('0x17')][_0x9888('0x97')]=function(_0x557b3d){try{var _0x186921=JSON[_0x9888('0x6a')](_0x557b3d);this[_0x9888('0x99')](_0x186921);return JSON['stringify'](_0x186921);}catch(_0x202924){return this[_0x9888('0x98')](_0x557b3d);}};AGIVertices['prototype'][_0x9888('0x98')]=function(_0x2490ab){var _0x250231=_0x2490ab[_0x9888('0xa0')]('{');for(var _0x4e6680=0x1;_0x4e6680<_0x250231[_0x9888('0x9c')];_0x4e6680+=0x1){var _0x4fd7e3=_0x250231[_0x4e6680][_0x9888('0xa0')]('}');if(_0x4fd7e3[_0x9888('0x9c')]>0x1){_0x2490ab=_0x2490ab['replaceAll']('{'+_0x4fd7e3[0x0]+'}',this['channel']['getVariable'](_0x4fd7e3[0x0])[_0x9888('0xa1')]||_0x4fd7e3[0x0]);}}if(_0x250231[_0x9888('0x9c')]===0x1){return _0x2490ab['toString']();}return this['replaceAllVariables'](_0x2490ab);};AGIVertices[_0x9888('0x17')][_0x9888('0xa2')]=function(_0x3aa20b,_0x5a525f){var _0x5a825c=this[_0x9888('0xf')][_0x9888('0x12')](_0x3aa20b);if(_0x5a825c[_0x9888('0xa3')]===-0x1){return _0x5a825c;}logger[_0x9888('0x2b')](util[_0x9888('0x28')](_0x9888('0xa4'),_0x5a525f,_0x5a825c[_0x9888('0xa1')]));return this[_0x9888('0xf')][_0x9888('0x9f')](_0x5a525f,_0x5a825c[_0x9888('0xa1')]);};AGIVertices['prototype']['isConfigured']=function(_0x3005d5){return _0x3005d5&&_0x3005d5!=='0'&&_0x3005d5!=='-1'&&_0x3005d5!=='';};AGIVertices[_0x9888('0x17')][_0x9888('0xa5')]=function(_0x460396){this[_0x9888('0x35')][_0x9888('0x6f')](this,_0x460396,'-');_0x460396['retry']=_0x460396['maxRetry'];return{'code':0xc8,'result':'-'};};AGIVertices[_0x9888('0x17')][_0x9888('0xa6')]=function(_0xc86be5){logger[_0x9888('0x2b')](util[_0x9888('0x28')](_0x9888('0xa7'),_0xc86be5[_0x9888('0x37')]));if(!this[_0x9888('0xa8')](_0xc86be5[_0x9888('0x5b')])){return this[_0x9888('0xf')][_0x9888('0xa9')]('no\x20text\x20configured');}var _0x54ec0d='\x22'+_0xc86be5[_0x9888('0x5b')]+'\x22';if(this[_0x9888('0xa8')](_0xc86be5[_0x9888('0x78')])){_0x54ec0d+=','+_0xc86be5[_0x9888('0x78')];}var _0x4fcd04=this['channel'][_0x9888('0x55')]('MRCPSynth',_0x54ec0d);if(_0x4fcd04[_0x9888('0xa3')]===-0x1){return _0x4fcd04;}return this[_0x9888('0xf')][_0x9888('0xa9')](util[_0x9888('0x28')]('Executed\x20command\x20MRCPSynth\x20%s',_0x54ec0d));};AGIVertices['prototype']['mrcprecog']=function(_0x1697d0){logger[_0x9888('0x2b')](util[_0x9888('0x28')](_0x9888('0xaa'),_0x1697d0[_0x9888('0x37')]));if(!this[_0x9888('0xa8')](_0x1697d0['grammar'])){return this[_0x9888('0xf')][_0x9888('0xa9')](_0x9888('0xab'));}var _0x3b49c0=_0x1697d0[_0x9888('0xac')];if(this[_0x9888('0xa8')](_0x1697d0[_0x9888('0x78')])){_0x3b49c0+=','+_0x1697d0['options'];}var _0x2214e5=this[_0x9888('0xf')]['exec'](_0x9888('0xad'),_0x3b49c0);if(_0x2214e5[_0x9888('0xa3')]===-0x1){return _0x2214e5;}var _0x2bdced=this['getAndSetVariable'](_0x9888('0xae'),'MRCP_RECOG_CONFIDENCE');if(_0x2bdced['result']===-0x1){return _0x2bdced;}var _0x43e1b9=this[_0x9888('0xa2')](_0x9888('0xaf'),_0x9888('0xb0'));if(_0x43e1b9[_0x9888('0xa3')]===-0x1){return _0x43e1b9;}var _0x40a9ab=this[_0x9888('0xa2')](_0x9888('0xb1'),'MRCP_RECOG_INSTANCE');if(_0x40a9ab[_0x9888('0xa3')]===-0x1){return _0x40a9ab;}return this[_0x9888('0xf')]['noop'](util['format']('Executed\x20command\x20MRCPRecog\x20%s',_0x3b49c0));};AGIVertices[_0x9888('0x17')]['agi']=function(_0x2ffc06){logger[_0x9888('0x2b')](util[_0x9888('0x28')](_0x9888('0xb2'),_0x2ffc06[_0x9888('0x37')]));return this[_0x9888('0xf')][_0x9888('0xb3')]([_0x2ffc06[_0x9888('0xb4')],_0x2ffc06[_0x9888('0xb5')]]);};AGIVertices['prototype'][_0x9888('0xb6')]=function(_0x190020){logger[_0x9888('0x2b')](util[_0x9888('0x28')](_0x9888('0xb7'),_0x190020[_0x9888('0x37')]));if(this[_0x9888('0xa8')](_0x190020[_0x9888('0x65')])){logger[_0x9888('0x2b')](util[_0x9888('0x28')](_0x9888('0xb8'),_0x190020[_0x9888('0x65')]));var _0x3438de=this[_0x9888('0xf')][_0x9888('0xb9')](_0x190020[_0x9888('0x65')]);if(_0x3438de[_0x9888('0xa3')]===-0x1){return _0x3438de;}}return this[_0x9888('0xf')][_0x9888('0xb6')]();};AGIVertices[_0x9888('0x17')][_0x9888('0x47')]=function(_0x2da483){logger[_0x9888('0x2b')](util['format'](_0x9888('0xba'),_0x2da483[_0x9888('0x37')]));if(!this[_0x9888('0xa8')](_0x2da483['list_id'])){return this[_0x9888('0xf')]['error'](_0x2da483,'no\x20list\x20selected');}_0x2da483[_0x9888('0x49')]=moment();if(this[_0x9888('0xa8')](_0x2da483[_0x9888('0xbb')])){_0x2da483['scheduledAt']=moment()[_0x9888('0xbc')](_0x2da483[_0x9888('0xbb')],'minutes');}if(!this[_0x9888('0xa8')](_0x2da483[_0x9888('0x4b')])){_0x2da483[_0x9888('0x4b')]=0x2;}this[_0x9888('0xbd')][_0x9888('0x6f')](this,_0x2da483);return this[_0x9888('0xf')][_0x9888('0xa9')](util['format'](_0x9888('0xbe'),_0x2da483['phone'],_0x2da483[_0x9888('0x46')],_0x2da483[_0x9888('0x49')]));};AGIVertices['prototype'][_0x9888('0xbf')]=function(_0x1e62a1){logger[_0x9888('0x2b')](util['format'](_0x9888('0xc0'),_0x1e62a1[_0x9888('0x37')]));var _0x365db7=this[_0x9888('0xf')]['exec'](_0x1e62a1[_0x9888('0xc1')],_0x1e62a1[_0x9888('0x78')]);if(_0x365db7['result']===-0x1){return _0x365db7;}return this[_0x9888('0xf')][_0x9888('0xa9')](util[_0x9888('0x28')](_0x9888('0xc2'),_0x1e62a1[_0x9888('0xc1')],_0x1e62a1[_0x9888('0x78')]));};AGIVertices[_0x9888('0x17')][_0x9888('0xc3')]=function(_0x4f71a0){logger[_0x9888('0x2b')](util[_0x9888('0x28')]('Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block',_0x4f71a0['label']));if(!this[_0x9888('0xa8')](_0x4f71a0['text'])){return this['channel'][_0x9888('0xa9')](_0x9888('0xc4'));}var _0x1b4d44='\x22'+_0x4f71a0[_0x9888('0x5b')]+'\x22';if(this[_0x9888('0xa8')](_0x4f71a0[_0x9888('0x78')])){_0x1b4d44+=','+_0x4f71a0[_0x9888('0x78')];}var _0x1fd412=this[_0x9888('0xf')][_0x9888('0x55')](_0x9888('0xc5'),_0x1b4d44);if(_0x1fd412[_0x9888('0xa3')]===-0x1){return _0x1fd412;}return this['channel']['noop'](util[_0x9888('0x28')](_0x9888('0xc6'),_0x1b4d44));};AGIVertices['prototype']['sestektts']=function(_0x4ddfe0){logger[_0x9888('0x2b')](util['format'](_0x9888('0xc7'),_0x4ddfe0[_0x9888('0x37')]));if(!this[_0x9888('0xa8')](_0x4ddfe0[_0x9888('0x5b')])){return this[_0x9888('0xf')][_0x9888('0xa9')](_0x9888('0xc4'));}var _0x4e5fcd='\x22'+_0x4ddfe0[_0x9888('0x5b')]+'\x22';if(this[_0x9888('0xa8')](_0x4ddfe0[_0x9888('0x78')])){_0x4e5fcd+=','+_0x4ddfe0['options'];}var _0x4e6bda=this[_0x9888('0xf')][_0x9888('0x55')]('MRCPSynth',_0x4e5fcd);if(_0x4e6bda[_0x9888('0xa3')]===-0x1){return _0x4e6bda;}return this['channel'][_0x9888('0xa9')](util['format'](_0x9888('0xc6'),_0x4e5fcd));};AGIVertices[_0x9888('0x17')][_0x9888('0xc8')]=function(_0xd66dfe){logger[_0x9888('0x2b')](util[_0x9888('0x28')](_0x9888('0xc9'),_0xd66dfe[_0x9888('0x37')]));if(!this[_0x9888('0xa8')](_0xd66dfe[_0x9888('0xac')])){return this[_0x9888('0xf')][_0x9888('0xa9')](_0x9888('0xab'));}var _0x2432c9=_0xd66dfe['grammar'];if(this[_0x9888('0xa8')](_0xd66dfe['options'])){_0x2432c9+=','+_0xd66dfe[_0x9888('0x78')];}var _0x2f4089=this[_0x9888('0xf')][_0x9888('0x55')](_0x9888('0xad'),_0x2432c9);if(_0x2f4089[_0x9888('0xa3')]===-0x1){return _0x2f4089;}var _0x3a3191=this[_0x9888('0xa2')]('RECOG_CONFIDENCE()',_0x9888('0xca'));if(_0x3a3191[_0x9888('0xa3')]===-0x1){return _0x3a3191;}var _0x3144ea=this[_0x9888('0xa2')]('RECOG_INPUT()',_0x9888('0xcb'));if(_0x3144ea[_0x9888('0xa3')]===-0x1){return _0x3144ea;}var _0x4ec18b=this[_0x9888('0xa2')](_0x9888('0xb1'),_0x9888('0xcc'));if(_0x4ec18b[_0x9888('0xa3')]===-0x1){return _0x4ec18b;}return this[_0x9888('0xf')]['noop'](util[_0x9888('0x28')](_0x9888('0xcd'),_0x2432c9));};AGIVertices[_0x9888('0x17')]['sestekasr']=function(_0x56ea86){logger['info'](util['format'](_0x9888('0xce'),_0x56ea86[_0x9888('0x37')]));if(!this[_0x9888('0xa8')](_0x56ea86['grammar'])){return this[_0x9888('0xf')]['noop'](_0x9888('0xab'));}var _0x4f8113=_0x56ea86['grammar'];if(this[_0x9888('0xa8')](_0x56ea86[_0x9888('0x78')])){_0x4f8113+=','+_0x56ea86['options'];}var _0x27cb12=this['channel'][_0x9888('0x55')](_0x9888('0xad'),_0x4f8113);if(_0x27cb12[_0x9888('0xa3')]===-0x1){return _0x27cb12;}var _0x379eb0=this[_0x9888('0xa2')]('RECOG_CONFIDENCE()',_0x9888('0xcf'));if(_0x379eb0[_0x9888('0xa3')]===-0x1){return _0x379eb0;}var _0x57607c=this[_0x9888('0xa2')](_0x9888('0xaf'),'SESTEK_ASR_TRANSCRIPT');if(_0x57607c['result']===-0x1){return _0x57607c;}var _0x48b87a=this[_0x9888('0xa2')](_0x9888('0xb1'),'SESTEK_ASR_INSTANCE');if(_0x48b87a[_0x9888('0xa3')]===-0x1){return _0x48b87a;}return this[_0x9888('0xf')][_0x9888('0xa9')](util[_0x9888('0x28')](_0x9888('0xcd'),_0x4f8113));};AGIVertices[_0x9888('0x17')][_0x9888('0xd0')]=function(_0x3f1131){logger[_0x9888('0x2b')](util['format']('Enter\x20in\x20DATABASE\x20(%s)\x20block',_0x3f1131[_0x9888('0x37')]));if(!this[_0x9888('0xa8')](_0x3f1131[_0x9888('0xd1')])){return this[_0x9888('0xf')][_0x9888('0x4f')](_0x3f1131,_0x9888('0xd2'));}var _0x1bb575=this[_0x9888('0xd3')]['sync'](this,_0x3f1131['odbc_id']);if(!_0x1bb575){return this['channel'][_0x9888('0x4f')](_0x3f1131,'no\x20odbc\x20database\x20found');}if(!this['isConfigured'](_0x3f1131[_0x9888('0x2d')])){return this[_0x9888('0xf')][_0x9888('0x4f')](_0x3f1131,_0x9888('0xd4'));}var _0x4d2db6=_0x3f1131[_0x9888('0x2d')][_0x9888('0x57')](/(\r\n|\n|\r)/gm,'\x20');this[_0x9888('0xf')][_0x9888('0xa9')](util['format']('query:\x20%s',_0x4d2db6));var _0x5648b9=this[_0x9888('0x29')][_0x9888('0x6f')](this,_0x1bb575,_0x4d2db6);this['createSquareDetailsReport'][_0x9888('0x6f')](this,_0x3f1131,_0x4d2db6);if(!this[_0x9888('0xa8')](_0x3f1131[_0x9888('0xd5')])){return this['channel'][_0x9888('0xa9')](_0x9888('0xd6'));}var _0x43af9d=this[_0x9888('0x12')][_0x9888('0x6f')](this,_0x3f1131[_0x9888('0xd5')]);if(!_0x43af9d){return this[_0x9888('0xf')][_0x9888('0x4f')](_0x3f1131,_0x9888('0xd7'));}var _0x22a37d=this;_0x5648b9[_0x9888('0xd8')](function(_0x506758,_0x29e571){Object[_0x9888('0xd9')](_0x506758)[_0x9888('0xd8')](function(_0x4efe83){_0x22a37d[_0x9888('0xf')][_0x9888('0x9f')](util['format'](_0x9888('0xda'),_0x43af9d,_0x29e571,_0x4efe83),_0x506758[_0x4efe83]);});});this[_0x9888('0xf')][_0x9888('0x9f')](util[_0x9888('0x28')](_0x9888('0xdb'),_0x43af9d),_0x5648b9['length']);return this[_0x9888('0xf')][_0x9888('0xa9')](util['format'](_0x9888('0xdc'),_0x43af9d));};AGIVertices[_0x9888('0x17')][_0x9888('0xdd')]=function(_0x909c66){logger[_0x9888('0xde')](util[_0x9888('0x28')](_0x9888('0xdf'),_0x909c66[_0x9888('0x37')]));if(!this[_0x9888('0xa8')](_0x909c66[_0x9888('0xe0')])){return this[_0x9888('0xf')][_0x9888('0x4f')](_0x909c66,'no\x20user\x20selected');}var _0x4a21ce=this[_0x9888('0xe1')][_0x9888('0x6f')](this,_0x909c66[_0x9888('0xe0')]);if(!_0x4a21ce){return this[_0x9888('0xf')][_0x9888('0x4f')](_0x909c66,'no\x20user\x20found');}var _0x4e45f8=this[_0x9888('0xf')][_0x9888('0x55')](_0x9888('0xe2'),[util[_0x9888('0x28')](_0x9888('0xe3'),_0x4a21ce),_0x909c66['timeout'],_0x909c66[_0x9888('0xe4')],_0x909c66[_0x9888('0x63')]]);if(_0x4e45f8[_0x9888('0xa3')]===-0x1){return _0x4e45f8;}return this['channel'][_0x9888('0xa9')](util[_0x9888('0x28')]('Executed\x20command\x20%s',_0x9888('0xe2')));};AGIVertices[_0x9888('0x17')][_0x9888('0xe5')]=function(_0x100caf){logger[_0x9888('0x2b')](util[_0x9888('0x28')](_0x9888('0xe6'),_0x100caf[_0x9888('0x37')]));if(!this[_0x9888('0xa8')](_0x100caf[_0x9888('0x7a')])){return this[_0x9888('0xf')]['noop'](_0x9888('0xe7'));}if(!this[_0x9888('0xa8')](_0x100caf['text'])){return this[_0x9888('0xf')][_0x9888('0xa9')](_0x9888('0xc4'));}this['channel']['bot']=!![];this[_0x9888('0x35')](_0x100caf);this[_0x9888('0xe8')](_0x100caf['text'],'in','','');this[_0x9888('0xf')][_0x9888('0xa9')](util[_0x9888('0x28')](_0x9888('0xe9'),_0x100caf[_0x9888('0x5b')]));var _0x4d2817=this[_0x9888('0x79')][_0x9888('0x6f')](this,_0x100caf);if(_0x4d2817){for(var _0x2ad55c in _0x4d2817){if(_0x4d2817['hasOwnProperty'](_0x2ad55c)){this[_0x9888('0xf')][_0x9888('0x9f')](util[_0x9888('0x28')](_0x9888('0xea'),_0x2ad55c['toUpperCase']()),_0x4d2817[_0x2ad55c]);}}this[_0x9888('0xe8')](_0x4d2817[_0x9888('0xeb')],_0x9888('0xec'),'dialogflow','');return this[_0x9888('0xf')][_0x9888('0xa9')](util[_0x9888('0x28')](_0x9888('0xed'),_0x4d2817[_0x9888('0xeb')]));}return this[_0x9888('0xf')][_0x9888('0x4f')](_0x100caf,_0x9888('0xee'));};AGIVertices[_0x9888('0x17')][_0x9888('0xef')]=function(_0x5236c0){logger['info'](util[_0x9888('0x28')]('Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block',_0x5236c0['label']));if(!this['isConfigured'](_0x5236c0[_0x9888('0x7d')])){return this[_0x9888('0xf')][_0x9888('0xa9')](_0x9888('0xf0'));}if(!this[_0x9888('0xa8')](_0x5236c0[_0x9888('0x7e')])){return this[_0x9888('0xf')][_0x9888('0xa9')]('no\x20client_email\x20configured');}if(!this[_0x9888('0xa8')](_0x5236c0[_0x9888('0x7f')])){return this[_0x9888('0xf')][_0x9888('0xa9')](_0x9888('0xf1'));}if(!this[_0x9888('0xa8')](_0x5236c0[_0x9888('0xf2')])){return this[_0x9888('0xf')]['noop']('no\x20anguage\x20configured');}if(!this[_0x9888('0xa8')](_0x5236c0[_0x9888('0x5b')])){return this[_0x9888('0xf')][_0x9888('0xa9')](_0x9888('0xc4'));}this[_0x9888('0xf')][_0x9888('0xf3')]=!![];this['createSquareDetailsReport'](_0x5236c0);this[_0x9888('0xe8')](_0x5236c0[_0x9888('0x5b')],'in','','');this['channel'][_0x9888('0xa9')](util[_0x9888('0x28')](_0x9888('0xf4'),_0x5236c0[_0x9888('0x5b')]));var _0x2580d8=this['googleDialogflowV2']['sync'](this,_0x5236c0);if(_0x2580d8){for(var _0x581ced in _0x2580d8){if(_0x2580d8[_0x9888('0x95')](_0x581ced)){if(_0x581ced!==_0x9888('0xf5')){this[_0x9888('0xf')][_0x9888('0x9f')](util['format'](_0x9888('0xea'),_0x581ced['toUpperCase']()),_0x2580d8[_0x581ced]);}}}this['createSquareMessage'](_0x2580d8[_0x9888('0xeb')],_0x9888('0xec'),_0x9888('0xef'),_0x2580d8[_0x9888('0xf5')]);return this[_0x9888('0xf')][_0x9888('0xa9')](util[_0x9888('0x28')](_0x9888('0xf6'),_0x2580d8[_0x9888('0xeb')]));}return this[_0x9888('0xf')][_0x9888('0x4f')](_0x5236c0,_0x9888('0xf7'));};AGIVertices[_0x9888('0x17')][_0x9888('0xf8')]=function(_0xac42ff){logger['info'](util['format'](_0x9888('0xf9'),_0xac42ff['label']));if(!this[_0x9888('0xa8')](_0xac42ff['ndauth_url'])){return this[_0x9888('0xf')][_0x9888('0xa9')](_0x9888('0xfa'));}if(!this[_0x9888('0xa8')](_0xac42ff['username'])){return this[_0x9888('0xf')][_0x9888('0xa9')](_0x9888('0xfb'));}if(!this[_0x9888('0xa8')](_0xac42ff[_0x9888('0xfc')])){return this[_0x9888('0xf')][_0x9888('0xa9')](_0x9888('0xfd'));}if(!this[_0x9888('0xa8')](_0xac42ff[_0x9888('0xfe')])){return this[_0x9888('0xf')][_0x9888('0xa9')]('no\x20text\x20configured');}this[_0x9888('0xf')]['bot']=!![];this['createSquareDetailsReport'](_0xac42ff);this[_0x9888('0xe8')](_0xac42ff[_0x9888('0x5b')],'in','','');this[_0x9888('0xf')]['noop'](util[_0x9888('0x28')](_0x9888('0xff'),_0xac42ff[_0x9888('0x5b')]));var _0x3faa05=this[_0x9888('0x100')][_0x9888('0x6f')](this,_0xac42ff);if(_0x3faa05){for(var _0xb637e6 in _0x3faa05){if(_0x3faa05[_0x9888('0x95')](_0xb637e6)){this[_0x9888('0xf')][_0x9888('0x9f')](util[_0x9888('0x28')](_0x9888('0x101'),_0xb637e6['toUpperCase']()),_0x3faa05[_0xb637e6]);}}this[_0x9888('0xe8')](_0x3faa05[_0x9888('0xeb')],_0x9888('0xec'),_0x9888('0xf8'),'');if(_0x3faa05[_0x9888('0x102')]){this[_0x9888('0xf')][_0x9888('0xa9')](util[_0x9888('0x28')](_0x9888('0x103'),_0x3faa05[_0x9888('0x102')]));var _0x2e9e18=this[_0x9888('0xf')][_0x9888('0x104')](_0x3faa05[_0x9888('0x102')]);try{fs[_0x9888('0x105')](_0x3faa05[_0x9888('0x102')]+_0x9888('0x106'));}catch(_0x31fed9){logger[_0x9888('0x4f')](_0x31fed9);}return _0x2e9e18;}else{return this[_0x9888('0xf')][_0x9888('0xa9')](util[_0x9888('0x28')]('SestekNDA\x20Result\x20%s',_0x3faa05['speech']));}}return this['channel'][_0x9888('0x4f')](_0xac42ff,_0x9888('0x107'));};AGIVertices[_0x9888('0x17')][_0x9888('0x108')]=function(_0x1a376d){logger['info'](util[_0x9888('0x28')](_0x9888('0x109'),_0x1a376d[_0x9888('0x37')]));return this['channel']['noop'](_0x9888('0x108'));};AGIVertices[_0x9888('0x17')][_0x9888('0x10a')]=function(_0x5b8483){logger[_0x9888('0x2b')](util['format'](_0x9888('0x10b'),_0x5b8483[_0x9888('0x37')]));var _0x5e7ab4='';if(_0x5b8483['trunk_id']){if(!this[_0x9888('0xa8')](_0x5b8483[_0x9888('0x10c')])){return this[_0x9888('0xf')][_0x9888('0x4f')](_0x5b8483,_0x9888('0x10d'));}else{var _0x2f1daf=parseInt(_0x5b8483['trunk_id'],0xa);if(isNaN(_0x2f1daf)){_0x5e7ab4=_0x5b8483[_0x9888('0x10c')];}else{_0x5e7ab4=this[_0x9888('0x10e')]['sync'](this,_0x5b8483[_0x9888('0x10c')]);if(!_0x5e7ab4){return this['channel'][_0x9888('0x4f')](_0x5b8483,_0x9888('0x10f'));}}}}else if(_0x5b8483['trunk_name']){_0x5e7ab4=_0x5b8483[_0x9888('0x110')];}else{return this[_0x9888('0xf')][_0x9888('0x4f')](_0x5b8483,_0x9888('0x10d'));}var _0xfe9491=this[_0x9888('0xf')][_0x9888('0x55')](_0x9888('0xe2'),[util[_0x9888('0x28')](_0x9888('0x111'),_0x5e7ab4,_0x5b8483[_0x9888('0x45')]),_0x5b8483[_0x9888('0x65')],_0x5b8483[_0x9888('0xe4')],_0x5b8483[_0x9888('0x63')]]);if(_0xfe9491['result']===-0x1){return _0xfe9491;}return this[_0x9888('0xf')][_0x9888('0xa9')](util[_0x9888('0x28')]('Executed\x20command\x20%s',_0x9888('0xe2')));};AGIVertices[_0x9888('0x17')][_0x9888('0x112')]=function(_0x2a135a){logger[_0x9888('0x2b')](util[_0x9888('0x28')](_0x9888('0x113'),_0x2a135a[_0x9888('0x37')]));return this[_0x9888('0xf')][_0x9888('0xa9')]('finally');};AGIVertices['prototype'][_0x9888('0x114')]=function(_0x3035d9){logger[_0x9888('0x2b')](util[_0x9888('0x28')](_0x9888('0x115'),_0x3035d9[_0x9888('0x37')]));if(_0x3035d9[_0x9888('0x116')]===0x0){return this[_0x9888('0xa5')](_0x3035d9);}_0x3035d9[_0x9888('0x116')]-=0x1;if(!this[_0x9888('0xa8')](_0x3035d9[_0x9888('0x117')])){return this[_0x9888('0xf')][_0x9888('0x4f')](_0x3035d9,_0x9888('0x118'));}var _0x2dfb00=this[_0x9888('0x1d')][_0x9888('0x6f')](this,_0x3035d9[_0x9888('0x117')]);if(!_0x2dfb00){return this[_0x9888('0xf')][_0x9888('0x4f')](_0x3035d9,_0x9888('0x119'));}if(!this[_0x9888('0xa8')](_0x3035d9[_0x9888('0xd5')])){return this['channel'][_0x9888('0x4f')](_0x9888('0xd6'));}var _0x424940=this[_0x9888('0xf')][_0x9888('0x11a')](_0x2dfb00,_0x3035d9[_0x9888('0x11b')],_0x3035d9[_0x9888('0x11c')]);var _0x1ed273=_0x424940['result']?_0x424940[_0x9888('0xa3')]['toString']():'';logger[_0x9888('0x2b')](_0x9888('0x11d'),JSON[_0x9888('0x72')](_0x424940));if(_0x424940[_0x9888('0xa3')]===-0x1){this[_0x9888('0x35')][_0x9888('0x6f')](this,_0x3035d9,_0x1ed273);return _0x424940;}else if(_0x424940[_0x9888('0xa1')]===_0x9888('0x65')){_0x424940[_0x9888('0xa3')]=_0x1ed273[_0x9888('0x9c')]>=parseInt(_0x3035d9['mindigit'])?'x':'i';}else{_0x424940['result']=_0x1ed273[_0x9888('0x9c')]>=parseInt(_0x3035d9['mindigit'])&&_0x1ed273[_0x9888('0x9c')]<=parseInt(_0x3035d9[_0x9888('0x11c')])?'x':'i';}var _0x193640=this[_0x9888('0x12')]['sync'](this,_0x3035d9[_0x9888('0xd5')]);if(!_0x193640){return this['channel'][_0x9888('0x4f')](_0x3035d9,'no\x20variable\x20found');}this['channel']['setVariable'](_0x193640,_0x1ed273);if(this['isConfigured'](_0x3035d9[_0x9888('0x11e')])){var _0x12a6f9=parseInt(_0x3035d9[_0x9888('0x11e')],0xa);var _0x207808=rs['generate']({'charset':'*','length':_0x12a6f9});var _0x5b4f66=_0x1ed273[_0x9888('0x9c')];if(_0x5b4f66>0x0){if(_0x5b4f66>_0x12a6f9){this[_0x9888('0x35')][_0x9888('0x6f')](this,_0x3035d9,_0x3035d9[_0x9888('0x11f')]===_0x9888('0x120')?_0x207808+_0x1ed273['substr'](_0x12a6f9):_0x1ed273[_0x9888('0x121')](0x0,_0x5b4f66-_0x12a6f9)+_0x207808);}else{this[_0x9888('0x35')][_0x9888('0x6f')](this,_0x3035d9,rs[_0x9888('0x122')]({'charset':'*','length':_0x5b4f66}));}}else{this['createSquareDetailsReport'][_0x9888('0x6f')](this,_0x3035d9,'');}}else{this[_0x9888('0x35')][_0x9888('0x6f')](this,_0x3035d9,_0x1ed273);}return _0x424940;};AGIVertices['prototype'][_0x9888('0xe')]=function(_0x659304){logger[_0x9888('0x2b')](util[_0x9888('0x28')](_0x9888('0x123'),_0x659304[_0x9888('0x37')]));return this[_0x9888('0x114')](_0x659304);};AGIVertices[_0x9888('0x17')]['goal']=function(_0x130c57){logger[_0x9888('0x2b')](util['format'](_0x9888('0x124'),_0x130c57['label']));this[_0x9888('0x35')][_0x9888('0x6f')](this,_0x130c57,_0x130c57[_0x9888('0x125')]);return this[_0x9888('0xf')][_0x9888('0xa9')](util['format'](_0x9888('0x126'),_0x130c57[_0x9888('0x125')]));};AGIVertices[_0x9888('0x17')]['awspolly']=function(_0x1f1e80){logger[_0x9888('0x2b')](util['format'](_0x9888('0x127'),_0x1f1e80['label']));if(!this[_0x9888('0xa8')](_0x1f1e80[_0x9888('0x87')])||!this[_0x9888('0xa8')](_0x1f1e80[_0x9888('0x88')])){return this[_0x9888('0xf')][_0x9888('0xa9')](_0x9888('0x128'));}if(!this[_0x9888('0xa8')](_0x1f1e80[_0x9888('0x5b')])){return this[_0x9888('0xf')][_0x9888('0xa9')](_0x9888('0xc4'));}this[_0x9888('0xf')][_0x9888('0xa9')](util[_0x9888('0x28')](_0x9888('0x129'),_0x1f1e80['text']));var _0x3ae5fa=this[_0x9888('0x86')][_0x9888('0x6f')](this,_0x1f1e80);if(_0x3ae5fa){this[_0x9888('0xf')][_0x9888('0xa9')](util[_0x9888('0x28')](_0x9888('0x12a'),_0x3ae5fa));var _0x1efc23=this['channel'][_0x9888('0x104')](_0x3ae5fa);try{fs[_0x9888('0x105')](_0x3ae5fa+_0x9888('0x106'));}catch(_0x3f14ee){logger['error'](_0x3f14ee);}return _0x1efc23;}return this[_0x9888('0xf')][_0x9888('0x4f')](_0x1f1e80,_0x9888('0x12b'));};AGIVertices['prototype'][_0x9888('0x12c')]=function(_0x42c6b7){logger['info'](util[_0x9888('0x28')](_0x9888('0x12d'),_0x42c6b7['label']));if(!this[_0x9888('0xa8')](_0x42c6b7[_0x9888('0x87')])||!this[_0x9888('0xa8')](_0x42c6b7['aws_secret_access_key'])){return this[_0x9888('0xf')]['noop'](_0x9888('0x128'));}if(!this[_0x9888('0xa8')](_0x42c6b7[_0x9888('0x8f')])){return this[_0x9888('0xf')][_0x9888('0xa9')](_0x9888('0x12e'));}if(!this[_0x9888('0xa8')](_0x42c6b7[_0x9888('0x5b')])){return this[_0x9888('0xf')]['noop'](_0x9888('0xc4'));}this['channel']['bot']=!![];this[_0x9888('0x35')](_0x42c6b7);this[_0x9888('0xe8')](_0x42c6b7[_0x9888('0x5b')],'in','','');this[_0x9888('0xf')]['noop'](util[_0x9888('0x28')](_0x9888('0x12f'),_0x42c6b7[_0x9888('0x5b')]));var _0x160bb6=this[_0x9888('0x8d')][_0x9888('0x6f')](this,_0x42c6b7);if(_0x160bb6){for(var _0x57dc84 in _0x160bb6){if(_0x160bb6[_0x9888('0x95')](_0x57dc84)&&_[_0x9888('0x96')](_0x160bb6[_0x57dc84])){this[_0x9888('0xf')]['setVariable'](util[_0x9888('0x28')](_0x9888('0x130'),_0x57dc84['toUpperCase']()),_0x160bb6[_0x57dc84]);}}if(_[_0x9888('0x42')](_0x160bb6['message'])){return this[_0x9888('0xf')][_0x9888('0xa9')](_0x9888('0x131'));}else{this[_0x9888('0xe8')](_0x160bb6[_0x9888('0x76')],_0x9888('0xec'),_0x9888('0x132'),'');return this[_0x9888('0xf')][_0x9888('0xa9')](util[_0x9888('0x28')](_0x9888('0x133'),_0x160bb6[_0x9888('0x76')]));}}return this[_0x9888('0xf')][_0x9888('0x4f')](_0x42c6b7,_0x9888('0x134'));};AGIVertices[_0x9888('0x17')][_0x9888('0x135')]=function(_0x541166){logger[_0x9888('0x2b')](util[_0x9888('0x28')](_0x9888('0x136'),_0x541166[_0x9888('0x37')],_0x541166[_0x9888('0x65')]));if(!this[_0x9888('0xa8')](_0x541166['key'])){return this['channel'][_0x9888('0xa9')](_0x9888('0xe7'));}var _0x12873f='wav';var _0x1ee78a=util[_0x9888('0x28')]('%s/recordings/%s',FILES_PATH,rs[_0x9888('0x122')](0x4));var _0x35ed70=util[_0x9888('0x28')](_0x9888('0x9e'),_0x1ee78a,_0x12873f);var _0x4b603d=!![];if(_0x541166[_0x9888('0x137')]===_0x9888('0x138')){_0x4b603d=![];}var _0x50c378=this[_0x9888('0xf')][_0x9888('0x139')](_0x1ee78a,_0x12873f,_0x541166['intKey'],_0x541166['timeout'],undefined,_0x4b603d);if(_0x50c378['result']!==-0x1){this['channel'][_0x9888('0xa9')](util[_0x9888('0x28')](_0x9888('0x13a'),_0x35ed70));var _0x2382d4=this['googleASR'][_0x9888('0x6f')](this,_0x541166,_0x35ed70);if(_0x2382d4){for(var _0x541b14 in _0x2382d4){if(_0x2382d4[_0x9888('0x95')](_0x541b14)){this['channel']['setVariable'](util[_0x9888('0x28')](_0x9888('0x13b'),_0x541b14[_0x9888('0x69')]()),_0x2382d4[_0x541b14]);}}return this[_0x9888('0xf')]['noop'](util[_0x9888('0x28')](_0x9888('0x13c'),JSON[_0x9888('0x72')](_0x2382d4)));}}return _0x50c378;};AGIVertices[_0x9888('0x17')]['tildeasr']=function(_0x122c5c){logger['info'](util[_0x9888('0x28')](_0x9888('0x13d'),_0x122c5c[_0x9888('0x37')]));if(!this[_0x9888('0xa8')](_0x122c5c['appid'])){return this[_0x9888('0xf')][_0x9888('0xa9')](_0x9888('0x13e'));}if(!this[_0x9888('0xa8')](_0x122c5c[_0x9888('0x13f')])){return this[_0x9888('0xf')][_0x9888('0xa9')](_0x9888('0x140'));}var _0x12f8c0=_0x9888('0x141');var _0x38605e=util[_0x9888('0x28')](_0x9888('0x142'),FILES_PATH,rs[_0x9888('0x122')](0x4));var _0x39b2c4=util[_0x9888('0x28')]('%s.%s',_0x38605e,_0x12f8c0);var _0xdffc56=!![];if(_0x122c5c[_0x9888('0x137')]===_0x9888('0x138')){_0xdffc56=![];}var _0x53b71a=this[_0x9888('0xf')][_0x9888('0x139')](_0x38605e,_0x12f8c0,_0x122c5c[_0x9888('0x143')],_0x122c5c['timeout'],undefined,_0xdffc56);if(_0x53b71a[_0x9888('0xa3')]!==-0x1){this['channel'][_0x9888('0xa9')](util['format'](_0x9888('0x144'),_0x39b2c4));var _0x23076b=this[_0x9888('0x91')][_0x9888('0x6f')](this,_0x122c5c,_0x39b2c4);if(_0x23076b){for(var _0x468400 in _0x23076b){if(_0x23076b[_0x9888('0x95')](_0x468400)){this['channel'][_0x9888('0x9f')](util[_0x9888('0x28')](_0x9888('0x145'),_0x468400[_0x9888('0x69')]()),_0x23076b[_0x468400]);}}return this[_0x9888('0xf')][_0x9888('0xa9')](util[_0x9888('0x28')](_0x9888('0x146'),JSON[_0x9888('0x72')](_0x23076b)));}}return _0x53b71a;};AGIVertices[_0x9888('0x17')][_0x9888('0x147')]=function(_0x1644b7){logger[_0x9888('0x2b')](util[_0x9888('0x28')](_0x9888('0x148'),_0x1644b7['label']));return this[_0x9888('0xf')]['continueAt'](_0x1644b7[_0x9888('0x3d')],_0x1644b7[_0x9888('0x3e')],_0x1644b7[_0x9888('0x3f')]);};AGIVertices[_0x9888('0x17')]['gotoif']=function(_0x591be){logger['info'](util[_0x9888('0x28')](_0x9888('0x149'),_0x591be[_0x9888('0x37')]));if(!this[_0x9888('0xa8')](_0x591be[_0x9888('0x14a')])){return this[_0x9888('0xf')][_0x9888('0x4f')](_0x591be,_0x9888('0x14b'));}try{var _0x4c622c=eval(_0x591be[_0x9888('0x14a')])?_0x9888('0x14c'):_0x9888('0x14d');this['channel'][_0x9888('0xa9')](util[_0x9888('0x28')](_0x9888('0x14e'),_0x591be[_0x9888('0x14a')],_0x4c622c));return{'code':0xc8,'result':_0x4c622c};}catch(_0x1ae851){return{'code':0xc8,'result':_0x9888('0x14d')};}};AGIVertices[_0x9888('0x17')][_0x9888('0x14f')]=function(_0x4fa491){logger[_0x9888('0x2b')](util[_0x9888('0x28')](_0x9888('0x150'),_0x4fa491[_0x9888('0x37')]));if(!this['isConfigured'](_0x4fa491[_0x9888('0x151')])){return this['channel'][_0x9888('0x4f')](_0x4fa491,_0x9888('0x152'));}var _0x48977c=this[_0x9888('0x23')][_0x9888('0x6f')](this,_0x4fa491[_0x9888('0x151')]);if(!_0x48977c){return this[_0x9888('0xf')][_0x9888('0x4f')](_0x4fa491,'no\x20intervals\x20found');}for(var _0x26388d=0x0;_0x26388d<_0x48977c['length'];_0x26388d+=0x1){var _0x1b4cb2=this[_0x9888('0xf')]['getVariable'](util[_0x9888('0x28')](_0x9888('0x153'),_0x48977c[_0x26388d]));if(_0x1b4cb2[_0x9888('0xa3')]===-0x1){return _0x1b4cb2;}logger[_0x9888('0x2b')](util[_0x9888('0x28')](_0x9888('0x154'),_0x48977c[_0x26388d],_0x1b4cb2[_0x9888('0xa1')]));if(_0x1b4cb2[_0x9888('0xa1')]===_0x9888('0x14c')){logger['info'](util[_0x9888('0x28')]('IFTIME\x20%s\x20%s',_0x48977c[_0x26388d],_0x9888('0x14c')));this[_0x9888('0xf')][_0x9888('0xa9')](util[_0x9888('0x28')](_0x9888('0x154'),_0x48977c[_0x26388d],_0x9888('0x14c')));return{'code':0xc8,'result':'true'};}else{logger['info'](util[_0x9888('0x28')](_0x9888('0x154'),_0x48977c[_0x26388d],_0x9888('0x14d')));this[_0x9888('0xf')][_0x9888('0xa9')](util[_0x9888('0x28')](_0x9888('0x154'),_0x48977c[_0x26388d],_0x9888('0x14d')));}}return{'code':0xc8,'result':_0x9888('0x14d')};};AGIVertices[_0x9888('0x17')]['hangup']=function(_0x449cd9){logger[_0x9888('0x2b')](util[_0x9888('0x28')]('Enter\x20in\x20HANGUP\x20(%s)\x20block',_0x449cd9[_0x9888('0x37')]));return this[_0x9888('0xf')][_0x9888('0x155')]();};AGIVertices[_0x9888('0x17')][_0x9888('0x156')]=function(_0x174828){logger['info'](util[_0x9888('0x28')]('Enter\x20in\x20ISPEECHASR\x20(%s)\x20block',_0x174828[_0x9888('0x37')]));if(!this[_0x9888('0xa8')](_0x174828[_0x9888('0x7a')])){return this[_0x9888('0xf')][_0x9888('0xa9')](_0x9888('0xe7'));}var _0x3c4e00=_0x9888('0x141');var _0x138d05=util['format'](_0x9888('0x142'),FILES_PATH,rs[_0x9888('0x122')](0x4));var _0x14a509=util[_0x9888('0x28')](_0x9888('0x9e'),_0x138d05,_0x3c4e00);var _0x20056a=!![];if(_0x174828[_0x9888('0x137')]===_0x9888('0x138')){_0x20056a=![];}var _0x8fc0e6=this[_0x9888('0xf')][_0x9888('0x139')](_0x138d05,_0x3c4e00,_0x174828[_0x9888('0x143')],_0x174828[_0x9888('0x65')],undefined,_0x20056a);if(_0x8fc0e6[_0x9888('0xa3')]!==-0x1){this[_0x9888('0xf')]['noop'](util['format']('ispeech\x20%s\x20file\x20created',_0x14a509));var _0x5ec90c=this[_0x9888('0x83')][_0x9888('0x6f')](this,_0x174828,_0x14a509);if(_0x5ec90c){for(var _0x590b9d in _0x5ec90c){if(_0x5ec90c[_0x9888('0x95')](_0x590b9d)){this['channel'][_0x9888('0x9f')](util['format']('ISPEECH_ASR_%s',_0x590b9d[_0x9888('0x69')]()),_0x5ec90c[_0x590b9d]);}}return this[_0x9888('0xf')]['noop'](util[_0x9888('0x28')](_0x9888('0x157'),JSON[_0x9888('0x72')](_0x5ec90c)));}}return _0x8fc0e6;};AGIVertices[_0x9888('0x17')][_0x9888('0x158')]=function(_0x4b7c9c){logger[_0x9888('0x2b')](util[_0x9888('0x28')](_0x9888('0x159'),_0x4b7c9c['label']));if(!this['isConfigured'](_0x4b7c9c[_0x9888('0x7a')])){return this['channel'][_0x9888('0xa9')](_0x9888('0xe7'));}if(!this[_0x9888('0xa8')](_0x4b7c9c['text'])){return this[_0x9888('0xf')][_0x9888('0xa9')](_0x9888('0xc4'));}this[_0x9888('0xf')][_0x9888('0xa9')](util[_0x9888('0x28')](_0x9888('0x15a'),_0x4b7c9c[_0x9888('0x5b')]));var _0x75429=this[_0x9888('0x80')]['sync'](this,_0x4b7c9c);if(_0x75429){this[_0x9888('0xf')][_0x9888('0xa9')](util['format'](_0x9888('0x15b'),_0x75429));var _0x19d4a3=this[_0x9888('0xf')][_0x9888('0x104')](_0x75429,_0x4b7c9c[_0x9888('0x143')]);try{fs[_0x9888('0x105')](_0x75429+'.wav');}catch(_0x16b1fc){logger[_0x9888('0x4f')](_0x16b1fc);}return _0x19d4a3;}return this[_0x9888('0xf')][_0x9888('0x4f')](_0x4b7c9c,_0x9888('0x15c'));};AGIVertices[_0x9888('0x17')][_0x9888('0x15d')]=function(_0x389e9b){logger['info'](util[_0x9888('0x28')]('Enter\x20in\x20LOGIN\x20(%s)\x20block',_0x389e9b[_0x9888('0x37')]));if(!this['isConfigured'](_0x389e9b[_0x9888('0x15e')])){return this[_0x9888('0xf')]['error'](_0x389e9b,_0x9888('0x15f'));}logger[_0x9888('0x2b')](util[_0x9888('0x28')](_0x9888('0x160'),this[_0x9888('0xf')]['callerid'],_0x389e9b[_0x9888('0x15e')]));var _0x10e0a0=this[_0x9888('0x52')][_0x9888('0x6f')](this,_0x389e9b[_0x9888('0x15e')]);if(_0x10e0a0){logger[_0x9888('0x2b')](util[_0x9888('0x28')](_0x9888('0x161'),this[_0x9888('0xf')][_0x9888('0x3a')],_0x389e9b[_0x9888('0x15e')]));this[_0x9888('0xf')][_0x9888('0xa9')](util['format']('AGENT\x20%s\x20FOUND\x20BY',this[_0x9888('0xf')]['callerid'],_0x389e9b['findBy']));return{'code':0xc8,'result':_0x9888('0x162')};}else{logger[_0x9888('0x2b')](util[_0x9888('0x28')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x9888('0xf')]['callerid'],_0x389e9b[_0x9888('0x15e')]));this['channel'][_0x9888('0xa9')](util['format'](_0x9888('0x163'),this[_0x9888('0xf')][_0x9888('0x3a')],_0x389e9b[_0x9888('0x15e')]));return{'code':0xc8,'result':_0x9888('0x164')};}};AGIVertices[_0x9888('0x17')][_0x9888('0x165')]=function(_0x3ebe53){logger[_0x9888('0x2b')](util['format'](_0x9888('0x166'),_0x3ebe53[_0x9888('0x37')]));if(!this[_0x9888('0xa8')](_0x3ebe53[_0x9888('0x15e')])){return this[_0x9888('0xf')]['error'](_0x3ebe53,_0x9888('0x15f'));}logger[_0x9888('0x2b')](util['format'](_0x9888('0x160'),this[_0x9888('0xf')][_0x9888('0x3a')],_0x3ebe53[_0x9888('0x15e')]));var _0x6918ea=this[_0x9888('0x51')]['sync'](this,_0x3ebe53[_0x9888('0x15e')]);if(_0x6918ea){logger[_0x9888('0x2b')](util['format'](_0x9888('0x161'),this[_0x9888('0xf')][_0x9888('0x3a')],_0x3ebe53[_0x9888('0x15e')]));this[_0x9888('0xf')]['noop'](util[_0x9888('0x28')]('AGENT\x20%s\x20FOUND\x20BY',this['channel'][_0x9888('0x3a')],_0x3ebe53['findBy']));return{'code':0xc8,'result':_0x9888('0x162')};}else{logger[_0x9888('0x2b')](util[_0x9888('0x28')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x9888('0xf')][_0x9888('0x3a')],_0x3ebe53[_0x9888('0x15e')]));this[_0x9888('0xf')]['noop'](util['format'](_0x9888('0x163'),this[_0x9888('0xf')]['callerid'],_0x3ebe53[_0x9888('0x15e')]));return{'code':0xc8,'result':_0x9888('0x164')};}};AGIVertices[_0x9888('0x17')][_0x9888('0x167')]=function(_0x1e5160){logger[_0x9888('0x2b')](util[_0x9888('0x28')]('Enter\x20in\x20MATH\x20(%s)\x20block',_0x1e5160['label']));if(!this['isConfigured'](_0x1e5160[_0x9888('0x168')])){return this['channel'][_0x9888('0x4f')](_0x1e5160,'no\x20operation\x20configured');}this['channel'][_0x9888('0xa9')](util[_0x9888('0x28')](_0x9888('0x169'),_0x1e5160[_0x9888('0x168')]));var _0x255e1f=eval(_0x1e5160[_0x9888('0x168')]);if(!this[_0x9888('0xa8')](_0x1e5160[_0x9888('0xd5')])){return this[_0x9888('0xf')][_0x9888('0xa9')]('no\x20variable\x20selected\x20for\x20the\x20result');}var _0x31d407=this[_0x9888('0x12')][_0x9888('0x6f')](this,_0x1e5160[_0x9888('0xd5')]);if(!_0x31d407){return this[_0x9888('0xf')][_0x9888('0x4f')](_0x1e5160,_0x9888('0xd7'));}if(_[_0x9888('0x9b')](_0x255e1f)){var _0x14e4a9=this;_0x255e1f['forEach'](function(_0x2ee029,_0x315582){_0x14e4a9[_0x9888('0xf')][_0x9888('0x9f')](util[_0x9888('0x28')](_0x9888('0x16a'),_0x31d407,_0x315582),_0x2ee029);});return this[_0x9888('0xf')]['noop'](util[_0x9888('0x28')](_0x9888('0x16b'),_0x31d407));}else{return this[_0x9888('0xf')][_0x9888('0x9f')](_0x31d407,_0x255e1f);}};AGIVertices[_0x9888('0x17')]['menu']=function(_0x45ebc5){logger[_0x9888('0x2b')](util[_0x9888('0x28')]('Enter\x20in\x20MENU\x20(%s)\x20block',_0x45ebc5[_0x9888('0x37')]));if(_0x45ebc5[_0x9888('0x116')]===0x0){return this[_0x9888('0xa5')](_0x45ebc5);}_0x45ebc5[_0x9888('0x116')]-=0x1;if(!this[_0x9888('0xa8')](_0x45ebc5['file_id'])){return this[_0x9888('0xf')]['error'](_0x45ebc5,_0x9888('0x118'));}var _0x224143=this[_0x9888('0x1d')]['sync'](this,_0x45ebc5[_0x9888('0x117')]);if(!_0x224143){return this[_0x9888('0xf')][_0x9888('0x4f')](_0x45ebc5,_0x9888('0x119'));}var _0xab7151=this['channel'][_0x9888('0x11a')](_0x224143,_0x45ebc5['response'],_0x45ebc5[_0x9888('0x16c')]);var _0x313530=_0xab7151[_0x9888('0xa3')];if(_0xab7151[_0x9888('0xa3')]===-0x1){this[_0x9888('0x35')][_0x9888('0x6f')](this,_0x45ebc5,'-1');return _0xab7151;}else if(_0xab7151['extra']==='timeout'){_0xab7151[_0x9888('0xa3')]=_0xab7151[_0x9888('0xa3')]['length']>0x0?_0xab7151[_0x9888('0xa3')]:'t';}else if(_[_0x9888('0x41')](_0xab7151[_0x9888('0xa3')])){_0xab7151[_0x9888('0xa3')]='#';_0x313530='#';}if(!this[_0x9888('0xa8')](_0x45ebc5[_0x9888('0xd5')])){this['channel'][_0x9888('0xa9')](_0x9888('0xd6'));}else{var _0x37795d=this['getVariable'][_0x9888('0x6f')](this,_0x45ebc5[_0x9888('0xd5')]);if(!_0x37795d){return this[_0x9888('0xf')]['error'](_0x45ebc5,'no\x20variable\x20found');}this[_0x9888('0xf')]['setVariable'](_0x37795d,_0x313530);}this['createSquareDetailsReport'][_0x9888('0x6f')](this,_0x45ebc5,_0x313530);return _0xab7151;};AGIVertices[_0x9888('0x17')][_0x9888('0xa9')]=function(_0x17eccc){logger[_0x9888('0x2b')](util[_0x9888('0x28')](_0x9888('0x16d'),_0x17eccc[_0x9888('0x37')]));return this['channel'][_0x9888('0xa9')](_0x17eccc[_0x9888('0x16e')]||_0x17eccc['label']);};AGIVertices[_0x9888('0x17')][_0x9888('0x16f')]=function(_0x42ec99){logger[_0x9888('0x2b')](util[_0x9888('0x28')](_0x9888('0x170'),_0x42ec99['label']));if(!this['isConfigured'](_0x42ec99['findBy'])){return this[_0x9888('0xf')][_0x9888('0x4f')](_0x42ec99,_0x9888('0x15f'));}logger['info'](util['format']('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0x9888('0xf')][_0x9888('0x3a')],_0x42ec99[_0x9888('0x15e')]));var _0x1cf96d=this[_0x9888('0x4c')][_0x9888('0x6f')](this,_0x42ec99[_0x9888('0x171')]);var _0x1301e3=this[_0x9888('0x4d')]['sync'](this,_0x42ec99[_0x9888('0x15e')],_0x1cf96d);if(_0x1301e3){logger[_0x9888('0x2b')](util[_0x9888('0x28')](_0x9888('0x161'),this[_0x9888('0xf')]['callerid'],_0x42ec99[_0x9888('0x15e')]));this[_0x9888('0xf')][_0x9888('0xa9')](util[_0x9888('0x28')](_0x9888('0x161'),this[_0x9888('0xf')]['callerid'],_0x42ec99['findBy']));return{'code':0xc8,'result':_0x9888('0x162')};}else{logger['info'](util[_0x9888('0x28')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x9888('0xf')][_0x9888('0x3a')],_0x42ec99[_0x9888('0x15e')]));this['channel'][_0x9888('0xa9')](util[_0x9888('0x28')](_0x9888('0x161'),this[_0x9888('0xf')][_0x9888('0x3a')],_0x42ec99[_0x9888('0x15e')]));return{'code':0xc8,'result':_0x9888('0x164')};}};AGIVertices['prototype'][_0x9888('0x172')]=function(_0x4c2bf7){logger[_0x9888('0x2b')](util['format'](_0x9888('0x173'),_0x4c2bf7['label']));if(!this['isConfigured'](_0x4c2bf7[_0x9888('0x117')])){return this['channel'][_0x9888('0x4f')](_0x4c2bf7,_0x9888('0x118'));}var _0x441e03=this[_0x9888('0x1d')]['sync'](this,_0x4c2bf7['file_id']);if(!_0x441e03){return this[_0x9888('0xf')][_0x9888('0x4f')](_0x4c2bf7,_0x9888('0x119'));}var _0x2c998a=this[_0x9888('0xf')][_0x9888('0x55')](_0x9888('0x174'),[_0x441e03,_0x4c2bf7['opts']]);if(_0x2c998a[_0x9888('0xa3')]===-0x1){return _0x2c998a;}return this[_0x9888('0xf')]['noop'](util['format']('Executed\x20command\x20%s\x20%s',_0x9888('0x174'),_0x441e03));};AGIVertices['prototype'][_0x9888('0x175')]=function(_0x4c5851){logger[_0x9888('0x2b')](util[_0x9888('0x28')](_0x9888('0x176'),_0x4c5851[_0x9888('0x37')]));if(!this[_0x9888('0xa8')](_0x4c5851['queue_id'])){return this[_0x9888('0xf')][_0x9888('0x4f')](_0x4c5851,_0x9888('0x177'));}var _0x5efd25='';var _0x1bbca8=parseInt(_0x4c5851[_0x9888('0x178')],0xa);if(isNaN(_0x1bbca8)){_0x5efd25=_0x4c5851[_0x9888('0x178')];}else{_0x5efd25=this[_0x9888('0x179')]['sync'](this,_0x4c5851[_0x9888('0x178')]);if(!_0x5efd25){return this[_0x9888('0xf')][_0x9888('0x4f')](_0x4c5851,_0x9888('0x17a'));}}var _0x216dd7='';if(this[_0x9888('0xa8')](_0x4c5851['file_id'])){var _0x55a5d3=this[_0x9888('0x1d')][_0x9888('0x6f')](this,_0x4c5851[_0x9888('0x117')]);if(_0x55a5d3){_0x216dd7=_0x55a5d3;}}this[_0x9888('0x35')]['sync'](this,_0x4c5851,_0x5efd25);if(_0x4c5851[_0x9888('0xe4')][_0x9888('0x17b')]('x')<0x0){_0x4c5851[_0x9888('0xe4')]+='x';}if(_0x4c5851[_0x9888('0xe4')][_0x9888('0x17b')]('X')<0x0){_0x4c5851[_0x9888('0xe4')]+='X';}this[_0x9888('0xf')]['setVariable'](_0x9888('0x17c'),_0x5efd25?_0x5efd25['toLowerCase']():'');var _0x4f1999=this[_0x9888('0xf')][_0x9888('0x55')](_0x9888('0x17d'),[_0x5efd25,_0x4c5851['opts'],_0x4c5851['url'],_0x216dd7,_0x4c5851['timeout'],_0x4c5851[_0x9888('0xb3')],_0x4c5851[_0x9888('0x17e')],_0x4c5851['gosub'],'',_0x4c5851[_0x9888('0x17f')]]);if(_0x4f1999['result']===-0x1){return _0x4f1999;}return this[_0x9888('0xf')][_0x9888('0xa9')](util['format'](_0x9888('0xc2'),_0x9888('0x17d'),_0x5efd25));};AGIVertices[_0x9888('0x17')][_0x9888('0x180')]=function(_0x4a830f){logger[_0x9888('0x2b')](util[_0x9888('0x28')](_0x9888('0x181'),_0x4a830f[_0x9888('0x37')]));var _0x37d290=_0x4a830f['recordingFormat']||_0x9888('0x141');var _0x1b16d0=util[_0x9888('0x28')](_0x9888('0x182'),this['channel'][_0x9888('0x36')],rs['generate'](0x5));var _0x56654b=util['format'](_0x9888('0x183'),FILES_PATH,_0x1b16d0,_0x37d290);var _0x63b1a=util[_0x9888('0x28')](_0x9888('0x142'),FILES_PATH,_0x1b16d0);this[_0x9888('0x3b')][_0x9888('0x6f')](this,_0x4a830f,_0x1b16d0,_0x56654b);this[_0x9888('0xf')]['setVariable']('RECORDING_SAVENAME',_0x1b16d0);logger[_0x9888('0x2b')](_0x9888('0x184'),_0x63b1a,_0x37d290,_0x4a830f[_0x9888('0x185')],_0x4a830f[_0x9888('0x65')]);return this[_0x9888('0xf')][_0x9888('0x139')](_0x63b1a,_0x37d290,_0x4a830f[_0x9888('0x185')],_0x4a830f[_0x9888('0x65')],undefined,!![]);};AGIVertices['prototype'][_0x9888('0x186')]=function(_0x4d6996){logger[_0x9888('0x2b')](util[_0x9888('0x28')](_0x9888('0x187'),_0x4d6996[_0x9888('0x37')]));if(!this['isConfigured'](_0x4d6996[_0x9888('0x63')])){return this[_0x9888('0xf')]['noop']('no\x20url\x20configured');}var _0x574462=this[_0x9888('0x188')][_0x9888('0x6f')](this,_0x4d6996);logger['info'](util[_0x9888('0x28')]('Response:',util[_0x9888('0x189')](_0x574462,{'showHidden':![],'depth':null})));if(!this[_0x9888('0xa8')](_0x4d6996['variable_id'])){return this[_0x9888('0xf')]['noop'](_0x9888('0x18a'));}var _0xe069de=this['getVariable'][_0x9888('0x6f')](this,_0x4d6996[_0x9888('0xd5')]);if(!_0xe069de){return this[_0x9888('0xf')][_0x9888('0x4f')](_0x4d6996,'no\x20variable\x20found');}this[_0x9888('0xf')][_0x9888('0x9f')](util[_0x9888('0x28')](_0x9888('0x18b'),_0xe069de),_0x574462[_0x9888('0x74')]?_0x574462[_0x9888('0x74')]:_0x9888('0x18c'));this[_0x9888('0xf')]['setVariable'](util[_0x9888('0x28')](_0x9888('0x18d'),_0xe069de),_0x574462[_0x9888('0x75')]?_0x574462['statusMessage']:'OK');if(_0x574462['body']){try{this[_0x9888('0x9d')](_0x574462['body'],_0xe069de);}catch(_0x202c72){logger[_0x9888('0x4f')](util[_0x9888('0x28')]('Unable\x20to\x20set\x20result\x20in\x20variable\x20%s',_0xe069de));}}return this[_0x9888('0xf')][_0x9888('0xa9')](util[_0x9888('0x28')](_0x9888('0xdc'),_0xe069de));};AGIVertices['prototype'][_0x9888('0x18e')]=function(_0x398def){logger[_0x9888('0x2b')](util[_0x9888('0x28')](_0x9888('0x18f'),_0x398def[_0x9888('0x37')]));return this[_0x9888('0xf')][_0x9888('0x190')](_0x398def[_0x9888('0x191')][_0x9888('0x57')](/\s+/g,''),_0x398def['escape_digits']);};AGIVertices[_0x9888('0x17')]['saynumber']=function(_0x574fd2){logger[_0x9888('0x2b')](util[_0x9888('0x28')](_0x9888('0x192'),_0x574fd2[_0x9888('0x37')]));return this['channel'][_0x9888('0x193')](_0x574fd2[_0x9888('0x66')]['replace'](/\s+/g,''),_0x574fd2[_0x9888('0x185')]);};AGIVertices['prototype'][_0x9888('0x194')]=function(_0x4bed38){logger[_0x9888('0x2b')](util[_0x9888('0x28')](_0x9888('0x195'),_0x4bed38['label']));return this['channel'][_0x9888('0x196')](_0x4bed38[_0x9888('0x5b')],_0x4bed38[_0x9888('0x185')]);};AGIVertices['prototype'][_0x9888('0x197')]=function(_0x4267fa){logger[_0x9888('0x2b')](util[_0x9888('0x28')](_0x9888('0x198'),_0x4267fa[_0x9888('0x37')]));if(!this[_0x9888('0xa8')](_0x4267fa[_0x9888('0x199')])){return this[_0x9888('0xf')][_0x9888('0xa9')](_0x9888('0x19a'));}var _0x44701d=this[_0x9888('0x20')][_0x9888('0x6f')](this,_0x4267fa['account_id']);if(!_0x44701d||!_0x44701d[_0x9888('0x19b')]){return this[_0x9888('0xf')][_0x9888('0x4f')](_0x4267fa,'no\x20mail\x20account\x20found');}var _0x150c60={'from':util['format'](_0x9888('0x19c'),_0x44701d[_0x9888('0x15')],_0x44701d[_0x9888('0x19d')]||_0x44701d[_0x9888('0x19b')][_0x9888('0x19e')]),'to':_0x4267fa['to']||'','cc':_0x4267fa['cc']||'','bcc':_0x4267fa[_0x9888('0x19f')]||'','subject':_0x4267fa['subject'],'html':_0x4267fa[_0x9888('0x5b')],'text':_0x4267fa[_0x9888('0x5b')]};var _0x58b33e={'tls':{'rejectUnauthorized':![]}};if(_0x44701d['Smtp'][_0x9888('0x1a0')]){_0x58b33e[_0x9888('0x1a0')]=_0x44701d[_0x9888('0x19b')]['service'];}else{_0x58b33e[_0x9888('0x1a1')]=_0x44701d[_0x9888('0x19b')][_0x9888('0x1a1')];_0x58b33e[_0x9888('0x1a2')]=_0x44701d['Smtp'][_0x9888('0x1a2')];_0x58b33e[_0x9888('0x1a3')]=_0x44701d[_0x9888('0x19b')][_0x9888('0x1a3')];}if(_0x44701d['Smtp'][_0x9888('0x1a4')]){_0x58b33e['auth']={'user':_0x44701d[_0x9888('0x19b')][_0x9888('0x19e')],'pass':_0x44701d[_0x9888('0x19b')][_0x9888('0x1a5')]};}if(this[_0x9888('0xa8')](_0x4267fa[_0x9888('0x1a6')])){}logger['debug'](_0x9888('0x1a7'),JSON[_0x9888('0x72')](_0x150c60));this[_0x9888('0x35')][_0x9888('0x6f')](this,_0x4267fa,_0x4267fa['account_id']);this['channel'][_0x9888('0xa9')](util[_0x9888('0x28')](_0x9888('0x1a8'),_0x44701d[_0x9888('0x15')]));this[_0x9888('0x22')][_0x9888('0x6f')](this,_0x58b33e,_0x150c60);return this[_0x9888('0xf')][_0x9888('0xa9')](_0x9888('0x1a9'));};AGIVertices[_0x9888('0x17')][_0x9888('0x1aa')]=function(_0xfac770){logger['info'](util[_0x9888('0x28')](_0x9888('0x1ab'),_0xfac770[_0x9888('0x37')]));return this[_0x9888('0xf')][_0x9888('0xa9')](_0x9888('0x1ac'));};AGIVertices['prototype'][_0x9888('0x1ad')]=function(_0x445d00){logger[_0x9888('0x2b')](util['format']('Enter\x20in\x20SENDSMS\x20(%s)\x20block',_0x445d00['label']));if(!this[_0x9888('0xa8')](_0x445d00[_0x9888('0x1ae')])){return this['channel'][_0x9888('0xa9')](_0x9888('0x1af'));}var _0x3619ae=this[_0x9888('0x32')][_0x9888('0x6f')](this,_0x445d00[_0x9888('0x1ae')]);if(!_0x3619ae){return this['channel'][_0x9888('0x4f')](_0x445d00,_0x9888('0x1b0'));}var _0x4f1335={'body':_0x445d00['sms_text'],'phone':_0x445d00['to']||'','SmsAccountId':_0x3619ae['id']};logger[_0x9888('0xde')](_0x9888('0x1b1'),JSON['stringify'](_0x4f1335));this[_0x9888('0x35')][_0x9888('0x6f')](this,_0x445d00,_0x445d00[_0x9888('0x1ae')]);this[_0x9888('0xf')][_0x9888('0xa9')](util[_0x9888('0x28')](_0x9888('0x1b2'),_0x3619ae['name']));this[_0x9888('0x34')][_0x9888('0x6f')](this,_0x4f1335);return this['channel'][_0x9888('0xa9')]('Sms\x20message\x20added\x20to\x20outgoing\x20process');};AGIVertices['prototype'][_0x9888('0x1b3')]=function(_0x5d7f2e){logger[_0x9888('0x2b')](util[_0x9888('0x28')](_0x9888('0x1b4'),_0x5d7f2e[_0x9888('0x37')]));if(!this[_0x9888('0xa8')](_0x5d7f2e[_0x9888('0xd5')])){return this['channel'][_0x9888('0x4f')](_0x5d7f2e,_0x9888('0x1b5'));}var _0x1a8155=this[_0x9888('0x12')]['sync'](this,_0x5d7f2e[_0x9888('0xd5')]);if(!_0x1a8155){return this['channel'][_0x9888('0x4f')](_0x5d7f2e,_0x9888('0xd7'));}return this[_0x9888('0xf')][_0x9888('0x9f')](_0x1a8155,_0x5d7f2e['variable_value']);};AGIVertices[_0x9888('0x17')][_0x9888('0x1b6')]=function(_0x41d6a4){logger['info'](util[_0x9888('0x28')](_0x9888('0x1b7'),_0x41d6a4['label']));this[_0x9888('0xf')][_0x9888('0xa9')]('START\x20CALLY\x20SQUARE');if(_0x41d6a4[_0x9888('0xb6')]===_0x9888('0x1b8')){this['channel'][_0x9888('0xa9')](_0x9888('0x1b9'));return this[_0x9888('0xf')]['answer']();}return this[_0x9888('0xf')][_0x9888('0xa9')](_0x9888('0x1ba'));};AGIVertices[_0x9888('0x17')][_0x9888('0x1bb')]=function(_0x1688df){logger[_0x9888('0x2b')](util[_0x9888('0x28')](_0x9888('0x1bc'),_0x1688df[_0x9888('0x37')]));if(!this[_0x9888('0xa8')](_0x1688df[_0x9888('0x1bd')])){return this[_0x9888('0xf')]['error'](_0x1688df,_0x9888('0x1be'));}var _0x52ba4c=this[_0x9888('0x19')][_0x9888('0x6f')](this,_0x1688df[_0x9888('0x1bd')]);if(!this['isConfigured'](_0x52ba4c)){return this[_0x9888('0xf')][_0x9888('0x4f')](_0x1688df,util[_0x9888('0x28')](_0x9888('0x1bf'),_0x1688df[_0x9888('0x1bd')]));}if(_0x52ba4c===this[_0x9888('0xf')][_0x9888('0x39')]){return this[_0x9888('0xf')][_0x9888('0x4f')](_0x1688df,_0x9888('0x1c0'));}this['createSquareDetailsReport']['sync'](this,_0x1688df,_0x52ba4c);var _0x3e65e2=this[_0x9888('0xf')][_0x9888('0x55')](_0x9888('0x1c1'),util[_0x9888('0x28')](_0x9888('0x1c2'),config[_0x9888('0xb3')][_0x9888('0x1a1')]||_0x9888('0x1c3'),_0x52ba4c,this[_0x9888('0xf')]['arg_1']));if(_0x3e65e2[_0x9888('0xa3')]===-0x1){return _0x3e65e2;}return this[_0x9888('0xf')]['noop'](util['format']('Executed\x20command\x20%s\x20%s','AGI',_0x52ba4c));};AGIVertices[_0x9888('0x17')][_0x9888('0x1c4')]=function(_0x48e62e){logger[_0x9888('0x2b')](util[_0x9888('0x28')](_0x9888('0x1c5'),_0x48e62e['label']));var _0x578b4b=this[_0x9888('0x54')][_0x9888('0x6f')](this,_0x48e62e['command']);this['createSquareDetailsReport'][_0x9888('0x6f')](this,_0x48e62e,_0x48e62e[_0x9888('0xb4')]);if(this[_0x9888('0xa8')](_0x48e62e['variable_id'])){var _0x56527a=this['getVariable'][_0x9888('0x6f')](this,_0x48e62e[_0x9888('0xd5')]);if(_0x56527a){this[_0x9888('0xf')]['setVariable'](_0x56527a,_0x578b4b);return this[_0x9888('0xf')]['noop'](util[_0x9888('0x28')]('sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s',_0x48e62e[_0x9888('0xb4')],_0x56527a));}}return this[_0x9888('0xf')]['noop'](util[_0x9888('0x28')](_0x9888('0x1c6'),_0x48e62e[_0x9888('0xb4')]));};AGIVertices['prototype']['google_cloud_tts']=function(_0x45ddf2){logger[_0x9888('0x2b')](util[_0x9888('0x28')](_0x9888('0x1c7'),_0x45ddf2[_0x9888('0x37')]));_0x45ddf2['text']=_0x45ddf2[_0x9888('0x5b')][_0x9888('0x57')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x9888('0xa8')](_0x45ddf2[_0x9888('0x59')])){return this[_0x9888('0xf')]['noop'](_0x9888('0x1c8'));}if(!this[_0x9888('0xa8')](_0x45ddf2[_0x9888('0x5b')])){return this[_0x9888('0xf')][_0x9888('0xa9')](_0x9888('0xc4'));}this['channel']['noop'](util[_0x9888('0x28')](_0x9888('0x1c9'),_0x45ddf2['text']));var _0x3a7f13=this[_0x9888('0x58')][_0x9888('0x6f')](this,_0x45ddf2);if(_0x3a7f13){this['channel'][_0x9888('0xa9')](util[_0x9888('0x28')]('Google\x20Cloud\x20TTS\x20%s\x20file\x20created',_0x3a7f13));var _0x7c6d79=this['channel'][_0x9888('0x104')](_0x3a7f13);try{fs['unlink'](_0x3a7f13+_0x9888('0x106'));}catch(_0x3f5c58){logger[_0x9888('0x4f')](_0x3f5c58);}return _0x7c6d79;}return this[_0x9888('0xf')][_0x9888('0x4f')](_0x45ddf2,_0x9888('0x1ca'));};AGIVertices['prototype'][_0x9888('0x1cb')]=function(_0x3b893c){logger[_0x9888('0x2b')](util[_0x9888('0x28')]('Enter\x20in\x20GOOGLETTS\x20(%s)\x20block',_0x3b893c['label']));_0x3b893c[_0x9888('0x5b')]=_0x3b893c[_0x9888('0x5b')][_0x9888('0x57')](/(\r\n|\n|\r)/gm,'\x20');if(!this['isConfigured'](_0x3b893c['text'])){return this['channel'][_0x9888('0xa9')](_0x9888('0xc4'));}this[_0x9888('0xf')][_0x9888('0xa9')](util['format'](_0x9888('0x1cc'),_0x3b893c['text']));var _0x4264fe=this[_0x9888('0x62')][_0x9888('0x6f')](this,_0x3b893c);if(_0x4264fe){this[_0x9888('0xf')]['noop'](util[_0x9888('0x28')](_0x9888('0x1cd'),_0x4264fe));var _0x1b8e93=this['channel'][_0x9888('0x104')](_0x4264fe);try{fs[_0x9888('0x105')](_0x4264fe+'.wav');}catch(_0x19a6c4){logger[_0x9888('0x4f')](_0x19a6c4);}return _0x1b8e93;}return this['channel'][_0x9888('0x4f')](_0x3b893c,'Google\x20TTS\x20is\x20unreachable');};AGIVertices['prototype'][_0x9888('0x1ce')]=function(_0x328238){logger[_0x9888('0x2b')](util[_0x9888('0x28')]('Enter\x20in\x20UNPAUSE\x20(%s)\x20block',_0x328238[_0x9888('0x37')]));if(!this[_0x9888('0xa8')](_0x328238[_0x9888('0x15e')])){return this['channel'][_0x9888('0x4f')](_0x328238,'no\x20find\x20by\x20configured');}logger[_0x9888('0x2b')](util[_0x9888('0x28')](_0x9888('0x160'),this[_0x9888('0xf')][_0x9888('0x3a')],_0x328238[_0x9888('0x15e')]));var _0x5126b5=this['agentUnpause'][_0x9888('0x6f')](this,_0x328238['findBy']);if(_0x5126b5){logger[_0x9888('0x2b')](util['format'](_0x9888('0x161'),this['channel'][_0x9888('0x3a')],_0x328238[_0x9888('0x15e')]));this[_0x9888('0xf')][_0x9888('0xa9')](util[_0x9888('0x28')](_0x9888('0x161'),this[_0x9888('0xf')]['callerid'],_0x328238[_0x9888('0x15e')]));return{'code':0xc8,'result':_0x9888('0x162')};}else{logger['info'](util[_0x9888('0x28')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x9888('0xf')][_0x9888('0x3a')],_0x328238[_0x9888('0x15e')]));this[_0x9888('0xf')][_0x9888('0xa9')](util['format'](_0x9888('0x163'),this[_0x9888('0xf')][_0x9888('0x3a')],_0x328238[_0x9888('0x15e')]));return{'code':0xc8,'result':_0x9888('0x164')};}};AGIVertices['prototype']['voicemail']=function(_0x1506d9){logger['info'](util[_0x9888('0x28')](_0x9888('0x1cf'),_0x1506d9[_0x9888('0x37')]));var _0x298403=this[_0x9888('0xf')][_0x9888('0x55')](_0x9888('0x1d0'),[_0x1506d9['mailbox'],_0x1506d9[_0x9888('0x78')]]);if(_0x298403[_0x9888('0xa3')]===-0x1){return _0x298403;}return this[_0x9888('0xf')][_0x9888('0xa9')](util['format'](_0x9888('0xc2'),_0x9888('0x1d0'),_0x1506d9['mailbox']));};AGIVertices[_0x9888('0x17')]['vswitch']=function(_0x355ad3){logger[_0x9888('0x2b')](util[_0x9888('0x28')](_0x9888('0x1d1'),_0x355ad3['label']));if(!this[_0x9888('0xa8')](_0x355ad3['variable_id'])){return this['channel'][_0x9888('0x4f')](_0x355ad3,_0x9888('0x1b5'));}var _0x49b5d9=this[_0x9888('0x12')][_0x9888('0x6f')](this,_0x355ad3[_0x9888('0xd5')]);if(!_0x49b5d9){return this[_0x9888('0xf')][_0x9888('0x4f')](_0x355ad3,_0x9888('0xd7'));}var _0x7f488=this['channel'][_0x9888('0x12')](_0x49b5d9);return{'code':0xc8,'result':_0x7f488[_0x9888('0xa1')]?_0x7f488[_0x9888('0xa1')]:'-'};};String[_0x9888('0x17')][_0x9888('0x1d2')]=function(_0x190a79,_0x320f7c){return this[_0x9888('0xa0')](_0x190a79)['join'](_0x320f7c);};module['exports']=AGIVertices; \ No newline at end of file diff --git a/server/services/ami/acw/index.js b/server/services/ami/acw/index.js index 79d831e..4cb9899 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 _0x02ed=['[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','acwTimeout','timers','timer','stopAcw','format','YYYY-MM-DD\x20HH:mm:ss','updateAcw','lastPauseAt','update','uniqueid','[%s][UPDATE][ACWTIME:%s]','catch','error','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','finally','[%s][TIMER][STOP][AGENT:%s]','saveUnpause','[%s][UPDATE][ERRORS:%s]','[ACW][TIMERS]','stringify','message','interface','[ACW][syncAgentConnectPreview]\x20%s','isUndefined','startAcw','linkedid','[%s][HANGUP:LINKEDID]','[ACW][syncHangupRequest]\x20%s','[%s][HANGUPATTENDEDTRANSFER:LINKEDID]','[ACW][syncHangup]\x20%s','isNil','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','[ACW][syncAttendedTransfer]\x20%s','transfereruniqueid','[%s][BLINDTRANSFER:UNIQUEID]','transfererlinkedid','[ACW][syncBlindTransfer]\x20%s','[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]','Auto-Pause','[ACW][syncAgentRingNoAnswer]\x20%s','exports','util','lodash','moment','../ami','../../../config/logger','acw','../rpc/user','../rpc/voiceAgentReport','voiceQueues','agents','agentconnect','syncAgentConnect','bind','hanguprequest','syncHangupRequest','syncHangup','syncAgentRingNoAnswer','syncAttendedTransfer','syncBlindTransfer','custom:agentConnectPreview','syncAgentConnectPreview','milliseconds','prototype','queue','ACW','mandatoryDisposition','mandatoryDispositionPause','name','Action','QueuePause','then','getAgent','voicePause','[%s][START][AGENT:%s][QUEUE:%s]','channels','attended','destlinkedid','savePause','info'];(function(_0x36bc91,_0x42a880){var _0x1e2dc7=function(_0x66a156){while(--_0x66a156){_0x36bc91['push'](_0x36bc91['shift']());}};_0x1e2dc7(++_0x42a880);}(_0x02ed,0x129));var _0xd02e=function(_0x3449e7,_0x79e3d){_0x3449e7=_0x3449e7-0x0;var _0x255590=_0x02ed[_0x3449e7];return _0x255590;};'use strict';var util=require(_0xd02e('0x0'));var _=require(_0xd02e('0x1'));var moment=require(_0xd02e('0x2'));var ami=require(_0xd02e('0x3'));var logger=require(_0xd02e('0x4'))(_0xd02e('0x5'));var RpcUser=require(_0xd02e('0x6'));var RpcVoiceAgentReport=require(_0xd02e('0x7'));function Acw(_0x25181d){this[_0xd02e('0x8')]=_0x25181d[_0xd02e('0x8')];this[_0xd02e('0x9')]=_0x25181d['agents'];this['timers']=_0x25181d['timers'];this['channels']={};ami['on'](_0xd02e('0xa'),this[_0xd02e('0xb')][_0xd02e('0xc')](this));ami['on'](_0xd02e('0xd'),this[_0xd02e('0xe')][_0xd02e('0xc')](this));ami['on']('hangup',this[_0xd02e('0xf')][_0xd02e('0xc')](this));ami['on']('agentringnoanswer',this[_0xd02e('0x10')]['bind'](this));ami['on']('attendedtransfer',this[_0xd02e('0x11')]['bind'](this));ami['on']('blindtransfer',this[_0xd02e('0x12')]['bind'](this));ami['on'](_0xd02e('0x13'),this[_0xd02e('0x14')][_0xd02e('0xc')](this));}function getDiff(_0x43b4a7){var _0x51b836=moment()['milliseconds'](0x0);var _0x42b3c3=moment(_0x43b4a7)[_0xd02e('0x15')](0x0);return _0x51b836['diff'](_0x42b3c3,'seconds');}Acw[_0xd02e('0x16')]['startAcw']=function(_0x379993){try{var _0x186122=this;var _0x25a050=this['channels'][_0x379993]['interface'];var _0xaf1b89=this['channels'][_0x379993][_0xd02e('0x17')];var _0x3b0701=this[_0xd02e('0x8')][_0xaf1b89];var _0x37f14f=![];var _0x1b275d=_0xd02e('0x18');if(_0x3b0701[_0xd02e('0x19')]){if(_0x3b0701[_0xd02e('0x1a')][_0xd02e('0x1b')]){_0x37f14f=!![];_0x1b275d=_0x3b0701[_0xd02e('0x1a')]['name'];}}ami[_0xd02e('0x1c')]({'action':_0xd02e('0x1d'),'interface':_0x25a050,'paused':!![],'reason':_0x1b275d})[_0xd02e('0x1e')](function(_0xf87d6d){if(_0x186122[_0xd02e('0x9')][_0x25a050]){return RpcUser[_0xd02e('0x1f')](_0x186122[_0xd02e('0x9')][_0x25a050]['id'])['then'](function(_0x58420d){if(_0x58420d&&!_0x58420d[_0xd02e('0x20')]){logger['info'](_0xd02e('0x21'),_0x379993,_0x25a050,_0xaf1b89);var _0x16d6d3=_0x186122[_0xd02e('0x22')][_0x379993][_0xd02e('0x23')]&&_0x186122['channels'][_0x379993][_0xd02e('0x24')]?_0x186122[_0xd02e('0x22')][_0x379993]['destlinkedid']:_0x379993;return RpcUser[_0xd02e('0x25')](_0x186122[_0xd02e('0x9')][_0x25a050],_0x1b275d,_0x16d6d3)[_0xd02e('0x1e')](function(_0x21c9b6){if(!_0x37f14f){_0x186122['timers'][_0x25a050]={};logger[_0xd02e('0x26')](_0xd02e('0x27'),_0x379993,_0x186122[_0xd02e('0x8')][_0xaf1b89][_0xd02e('0x28')],_0x25a050,_0xaf1b89);_0x186122[_0xd02e('0x29')][_0x25a050][_0xd02e('0x2a')]=setTimeout(_0x186122[_0xd02e('0x2b')][_0xd02e('0xc')](_0x186122,_0x25a050),_0x186122[_0xd02e('0x8')][_0xaf1b89][_0xd02e('0x28')]*0x3e8);_0x186122[_0xd02e('0x29')][_0x25a050]['lastPauseAt']=moment()[_0xd02e('0x2c')](_0xd02e('0x2d'));_0x186122[_0xd02e('0x29')][_0x25a050]['uniqueid']=_0x379993;_0x186122[_0xd02e('0x29')][_0x25a050][_0xd02e('0x17')]=_0xaf1b89;_0x186122[_0xd02e('0x29')][_0x25a050][_0xd02e('0x2e')]=function(){var _0x7b8fe3=getDiff(_0x186122[_0xd02e('0x29')][_0x25a050][_0xd02e('0x2f')]);clearTimeout(_0x186122[_0xd02e('0x29')][_0x25a050]['timer']);_0x186122[_0xd02e('0x29')][_0x25a050]['timer']=![];RpcVoiceAgentReport[_0xd02e('0x30')]({'acwtime':_0x7b8fe3},_0x186122[_0xd02e('0x29')][_0x25a050][_0xd02e('0x31')],_0x25a050)[_0xd02e('0x1e')](function(_0x820c45){logger[_0xd02e('0x26')](_0xd02e('0x32'),_0x379993,_0x7b8fe3,_0x820c45);})[_0xd02e('0x33')](function(_0x2d17a1){logger[_0xd02e('0x34')]('[%s][UPDATE][ERRORS:%s]',_0x379993,_0x2d17a1);});delete _0x186122[_0xd02e('0x29')][_0x25a050];};}});}else{logger[_0xd02e('0x26')](_0xd02e('0x35'),_0x379993,_0x25a050,_0xaf1b89);}});}})['catch'](function(_0x2f0865){logger[_0xd02e('0x34')](_0xd02e('0x27'),_0x379993,_0x186122['voiceQueues'][_0xaf1b89][_0xd02e('0x28')],_0x25a050,_0xaf1b89);})[_0xd02e('0x36')](function(){delete _0x186122[_0xd02e('0x22')][_0x379993];});}catch(_0xd478ff){logger['error']('[ACW][START]\x20%s',_0xd478ff['message']);}};Acw[_0xd02e('0x16')][_0xd02e('0x2b')]=function(_0x159202){try{var _0x1174c0=this;if(_0x1174c0['timers'][_0x159202]){_0x1174c0[_0xd02e('0x29')][_0x159202][_0xd02e('0x2a')]=![];var _0x3dd39a=_0x1174c0[_0xd02e('0x29')][_0x159202][_0xd02e('0x31')];var _0x2276e5=_0x1174c0['timers'][_0x159202][_0xd02e('0x17')];var _0x58a52a=_0x1174c0[_0xd02e('0x8')][_0x2276e5][_0xd02e('0x28')];logger[_0xd02e('0x26')](_0xd02e('0x37'),_0x3dd39a,_0x159202);RpcUser[_0xd02e('0x38')](this['agents'][_0x159202]);RpcVoiceAgentReport['update']({'acwtime':_0x58a52a,'agentacw':!![]},_0x3dd39a,_0x159202)[_0xd02e('0x1e')](function(_0xebcc4a){logger[_0xd02e('0x26')](_0xd02e('0x32'),_0x3dd39a,_0x58a52a,_0xebcc4a);})[_0xd02e('0x33')](function(_0x46341b){logger[_0xd02e('0x34')](_0xd02e('0x39'),_0x3dd39a,_0x46341b);});}else{logger[_0xd02e('0x34')]('[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer',_0x159202);if(_0x1174c0[_0xd02e('0x29')]){logger[_0xd02e('0x26')](_0xd02e('0x3a'),JSON[_0xd02e('0x3b')](_0x1174c0[_0xd02e('0x29')]));}}}catch(_0x2e1564){logger[_0xd02e('0x34')]('[ACW][STOP]\x20%s',_0x2e1564[_0xd02e('0x3c')]);}};Acw[_0xd02e('0x16')]['syncAgentConnect']=function(_0x4a6d48){try{if(this[_0xd02e('0x8')][_0x4a6d48[_0xd02e('0x17')]]&&(this[_0xd02e('0x8')][_0x4a6d48[_0xd02e('0x17')]][_0xd02e('0x5')]||this[_0xd02e('0x8')][_0x4a6d48[_0xd02e('0x17')]]['mandatoryDisposition'])){if(this[_0xd02e('0x9')][_0x4a6d48['interface']]){this['channels'][_0x4a6d48['uniqueid']]={'queue':_0x4a6d48[_0xd02e('0x17')],'interface':_0x4a6d48[_0xd02e('0x3d')],'destlinkedid':_0x4a6d48[_0xd02e('0x24')]};}}}catch(_0x8dff29){logger[_0xd02e('0x34')]('[ACW][syncAgentConnect]\x20%s',_0x8dff29[_0xd02e('0x3c')]);}};Acw[_0xd02e('0x16')][_0xd02e('0x14')]=function(_0x37ef80){try{if(this[_0xd02e('0x8')][_0x37ef80['queue']]&&(this['voiceQueues'][_0x37ef80[_0xd02e('0x17')]][_0xd02e('0x5')]||this[_0xd02e('0x8')][_0x37ef80[_0xd02e('0x17')]][_0xd02e('0x19')])){if(this[_0xd02e('0x9')][_0x37ef80[_0xd02e('0x3d')]]){this[_0xd02e('0x22')][_0x37ef80[_0xd02e('0x31')]]={'queue':_0x37ef80[_0xd02e('0x17')],'interface':_0x37ef80[_0xd02e('0x3d')]};}}}catch(_0x6de469){logger[_0xd02e('0x34')](_0xd02e('0x3e'),_0x6de469['message']);}};Acw['prototype'][_0xd02e('0xe')]=function(_0xa8889d){try{if(this['channels'][_0xa8889d[_0xd02e('0x31')]]&&_[_0xd02e('0x3f')](this[_0xd02e('0x22')][_0xa8889d[_0xd02e('0x31')]][_0xd02e('0x23')])){logger[_0xd02e('0x26')]('[%s][HANGUP:UNIQUEID]',_0xa8889d[_0xd02e('0x31')]);this[_0xd02e('0x40')](_0xa8889d[_0xd02e('0x31')]);}else if(this[_0xd02e('0x22')][_0xa8889d[_0xd02e('0x41')]]&&_['isUndefined'](this[_0xd02e('0x22')][_0xa8889d[_0xd02e('0x41')]][_0xd02e('0x23')])){logger[_0xd02e('0x26')](_0xd02e('0x42'),_0xa8889d[_0xd02e('0x41')]);this['startAcw'](_0xa8889d[_0xd02e('0x41')]);}}catch(_0x582330){logger[_0xd02e('0x34')](_0xd02e('0x43'),_0x582330[_0xd02e('0x3c')]);}};Acw[_0xd02e('0x16')]['syncHangup']=function(_0x5b5551){try{if(this[_0xd02e('0x22')][_0x5b5551[_0xd02e('0x31')]]&&this[_0xd02e('0x22')][_0x5b5551[_0xd02e('0x31')]][_0xd02e('0x23')]){logger[_0xd02e('0x26')]('[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]',_0x5b5551[_0xd02e('0x31')]);this[_0xd02e('0x40')](_0x5b5551[_0xd02e('0x31')]);}else if(this[_0xd02e('0x22')][_0x5b5551[_0xd02e('0x41')]]&&this['channels'][_0x5b5551[_0xd02e('0x41')]][_0xd02e('0x23')]){logger[_0xd02e('0x26')](_0xd02e('0x44'),_0x5b5551[_0xd02e('0x41')]);this[_0xd02e('0x40')](_0x5b5551[_0xd02e('0x41')]);}}catch(_0x3da7ad){logger[_0xd02e('0x34')](_0xd02e('0x45'),_0x3da7ad['message']);}};Acw[_0xd02e('0x16')]['syncAttendedTransfer']=function(_0x590d6e){try{if(!_[_0xd02e('0x46')](this[_0xd02e('0x22')][_0x590d6e[_0xd02e('0x47')]])){this[_0xd02e('0x40')](_0x590d6e[_0xd02e('0x47')]);if(this[_0xd02e('0x22')][_0x590d6e[_0xd02e('0x48')]]){this[_0xd02e('0x22')][_0x590d6e['secondtransfereruniqueid']]['attended']=!![];this[_0xd02e('0x22')][_0x590d6e[_0xd02e('0x49')]]=this[_0xd02e('0x22')][_0x590d6e[_0xd02e('0x48')]];delete this['channels'][_0x590d6e['secondtransfereruniqueid']];}}else if(!_[_0xd02e('0x46')](this['channels'][_0x590d6e[_0xd02e('0x49')]])){this['startAcw'](_0x590d6e['transfertargetuniqueid']);if(this['channels'][_0x590d6e[_0xd02e('0x4a')]]){this[_0xd02e('0x22')][_0x590d6e[_0xd02e('0x4a')]][_0xd02e('0x23')]=!![];this[_0xd02e('0x22')][_0x590d6e[_0xd02e('0x47')]]=this[_0xd02e('0x22')][_0x590d6e['origtransfereruniqueid']];delete this['channels'][_0x590d6e[_0xd02e('0x4a')]];}}}catch(_0x25c518){logger[_0xd02e('0x34')](_0xd02e('0x4b'),_0x25c518[_0xd02e('0x3c')]);}};Acw[_0xd02e('0x16')]['syncBlindTransfer']=function(_0x141152){try{if(this['channels'][_0x141152[_0xd02e('0x4c')]]){logger['info'](_0xd02e('0x4d'),JSON[_0xd02e('0x3b')](_0x141152['transfereruniqueid']));this['startAcw'](_0x141152['transfereruniqueid']);}else if(this[_0xd02e('0x22')][_0x141152['transfererlinkedid']]){logger['info']('[%s][BLINDTRANSFER:LINKEDID]',JSON[_0xd02e('0x3b')](_0x141152[_0xd02e('0x4e')]));this[_0xd02e('0x40')](_0x141152[_0xd02e('0x4e')]);}}catch(_0x506f31){logger[_0xd02e('0x34')](_0xd02e('0x4f'),_0x506f31['message']);}};Acw[_0xd02e('0x16')][_0xd02e('0x10')]=function(_0x3b66d8){try{if(this[_0xd02e('0x8')][_0x3b66d8[_0xd02e('0x17')]]&&this[_0xd02e('0x8')][_0x3b66d8['queue']]['autopause']==='all'){if(this['agents'][_0x3b66d8[_0xd02e('0x3d')]]){logger[_0xd02e('0x26')](_0xd02e('0x50'),_0x3b66d8[_0xd02e('0x31')],_0x3b66d8[_0xd02e('0x3d')],_0x3b66d8['queue']);return RpcUser['savePause'](this[_0xd02e('0x9')][_0x3b66d8['interface']],_0xd02e('0x51'),_0x3b66d8['uniqueid']);}}}catch(_0x1617e7){logger[_0xd02e('0x34')](_0xd02e('0x52'),_0x1617e7[_0xd02e('0x3c')]);}};module[_0xd02e('0x53')]=Acw; \ No newline at end of file +var _0x30c6=['[ACW][START]\x20%s','message','[%s][TIMER][STOP][AGENT:%s]','saveUnpause','[%s][UPDATE][ERRORS:%s]','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','[ACW][TIMERS]','[ACW][STOP]\x20%s','[ACW][syncAgentConnect]\x20%s','[ACW][syncAgentConnectPreview]\x20%s','isUndefined','[%s][HANGUP:UNIQUEID]','linkedid','[%s][HANGUP:LINKEDID]','[ACW][syncHangupRequest]\x20%s','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]','[%s][HANGUPATTENDEDTRANSFER:LINKEDID]','[ACW][syncHangup]\x20%s','isNil','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','[ACW][syncAttendedTransfer]\x20%s','transfereruniqueid','[%s][BLINDTRANSFER:UNIQUEID]','stringify','transfererlinkedid','autopause','[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]','Auto-Pause','util','../ami','../../../config/logger','acw','../rpc/voiceAgentReport','voiceQueues','agents','timers','channels','agentconnect','syncAgentConnect','bind','hanguprequest','syncHangupRequest','hangup','syncHangup','agentringnoanswer','syncAgentRingNoAnswer','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','syncAgentConnectPreview','milliseconds','diff','seconds','prototype','startAcw','interface','ACW','mandatoryDisposition','mandatoryDispositionPause','name','Action','then','getAgent','info','[%s][START][AGENT:%s][QUEUE:%s]','attended','destlinkedid','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','acwTimeout','timer','stopAcw','lastPauseAt','format','YYYY-MM-DD\x20HH:mm:ss','uniqueid','queue','updateAcw','update','[%s][UPDATE][ACWTIME:%s]','catch','error','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','finally'];(function(_0x2642cb,_0x4b917f){var _0xe6e41=function(_0x281676){while(--_0x281676){_0x2642cb['push'](_0x2642cb['shift']());}};_0xe6e41(++_0x4b917f);}(_0x30c6,0x17b));var _0x630c=function(_0x1ff4d2,_0x14fd4d){_0x1ff4d2=_0x1ff4d2-0x0;var _0x2e3966=_0x30c6[_0x1ff4d2];return _0x2e3966;};'use strict';var util=require(_0x630c('0x0'));var _=require('lodash');var moment=require('moment');var ami=require(_0x630c('0x1'));var logger=require(_0x630c('0x2'))(_0x630c('0x3'));var RpcUser=require('../rpc/user');var RpcVoiceAgentReport=require(_0x630c('0x4'));function Acw(_0x28e3e8){this[_0x630c('0x5')]=_0x28e3e8['voiceQueues'];this[_0x630c('0x6')]=_0x28e3e8[_0x630c('0x6')];this[_0x630c('0x7')]=_0x28e3e8[_0x630c('0x7')];this[_0x630c('0x8')]={};ami['on'](_0x630c('0x9'),this[_0x630c('0xa')][_0x630c('0xb')](this));ami['on'](_0x630c('0xc'),this[_0x630c('0xd')]['bind'](this));ami['on'](_0x630c('0xe'),this[_0x630c('0xf')][_0x630c('0xb')](this));ami['on'](_0x630c('0x10'),this[_0x630c('0x11')][_0x630c('0xb')](this));ami['on'](_0x630c('0x12'),this[_0x630c('0x13')][_0x630c('0xb')](this));ami['on'](_0x630c('0x14'),this[_0x630c('0x15')]['bind'](this));ami['on']('custom:agentConnectPreview',this[_0x630c('0x16')]['bind'](this));}function getDiff(_0x19218b){var _0x1d7035=moment()[_0x630c('0x17')](0x0);var _0x2b4095=moment(_0x19218b)[_0x630c('0x17')](0x0);return _0x1d7035[_0x630c('0x18')](_0x2b4095,_0x630c('0x19'));}Acw[_0x630c('0x1a')][_0x630c('0x1b')]=function(_0x38a6ab){try{var _0x27cded=this;var _0x1261f3=this[_0x630c('0x8')][_0x38a6ab][_0x630c('0x1c')];var _0xfa7bb9=this[_0x630c('0x8')][_0x38a6ab]['queue'];var _0x3aebf3=this[_0x630c('0x5')][_0xfa7bb9];var _0x92a5f5=![];var _0x1aabcf=_0x630c('0x1d');if(_0x3aebf3[_0x630c('0x1e')]){if(_0x3aebf3[_0x630c('0x1f')][_0x630c('0x20')]){_0x92a5f5=!![];_0x1aabcf=_0x3aebf3['mandatoryDispositionPause'][_0x630c('0x20')];}}ami[_0x630c('0x21')]({'action':'QueuePause','interface':_0x1261f3,'paused':!![],'reason':_0x1aabcf})[_0x630c('0x22')](function(_0x248f9d){if(_0x27cded[_0x630c('0x6')][_0x1261f3]){return RpcUser[_0x630c('0x23')](_0x27cded[_0x630c('0x6')][_0x1261f3]['id'])[_0x630c('0x22')](function(_0x5de7ee){if(_0x5de7ee&&!_0x5de7ee['voicePause']){logger[_0x630c('0x24')](_0x630c('0x25'),_0x38a6ab,_0x1261f3,_0xfa7bb9);var _0x568340=_0x27cded['channels'][_0x38a6ab][_0x630c('0x26')]&&_0x27cded['channels'][_0x38a6ab][_0x630c('0x27')]?_0x27cded[_0x630c('0x8')][_0x38a6ab][_0x630c('0x27')]:_0x38a6ab;return RpcUser['savePause'](_0x27cded[_0x630c('0x6')][_0x1261f3],_0x1aabcf,_0x568340)[_0x630c('0x22')](function(_0x5c1ddd){if(!_0x92a5f5){_0x27cded['timers'][_0x1261f3]={};logger[_0x630c('0x24')](_0x630c('0x28'),_0x38a6ab,_0x27cded['voiceQueues'][_0xfa7bb9][_0x630c('0x29')],_0x1261f3,_0xfa7bb9);_0x27cded[_0x630c('0x7')][_0x1261f3][_0x630c('0x2a')]=setTimeout(_0x27cded[_0x630c('0x2b')][_0x630c('0xb')](_0x27cded,_0x1261f3),_0x27cded[_0x630c('0x5')][_0xfa7bb9][_0x630c('0x29')]*0x3e8);_0x27cded[_0x630c('0x7')][_0x1261f3][_0x630c('0x2c')]=moment()[_0x630c('0x2d')](_0x630c('0x2e'));_0x27cded[_0x630c('0x7')][_0x1261f3][_0x630c('0x2f')]=_0x38a6ab;_0x27cded['timers'][_0x1261f3][_0x630c('0x30')]=_0xfa7bb9;_0x27cded[_0x630c('0x7')][_0x1261f3][_0x630c('0x31')]=function(){var _0x52f2fa=getDiff(_0x27cded[_0x630c('0x7')][_0x1261f3][_0x630c('0x2c')]);clearTimeout(_0x27cded[_0x630c('0x7')][_0x1261f3]['timer']);_0x27cded[_0x630c('0x7')][_0x1261f3][_0x630c('0x2a')]=![];RpcVoiceAgentReport[_0x630c('0x32')]({'acwtime':_0x52f2fa},_0x27cded[_0x630c('0x7')][_0x1261f3][_0x630c('0x2f')],_0x1261f3)[_0x630c('0x22')](function(_0xe03734){logger[_0x630c('0x24')](_0x630c('0x33'),_0x38a6ab,_0x52f2fa,_0xe03734);})[_0x630c('0x34')](function(_0x366d0f){logger[_0x630c('0x35')]('[%s][UPDATE][ERRORS:%s]',_0x38a6ab,_0x366d0f);});delete _0x27cded[_0x630c('0x7')][_0x1261f3];};}});}else{logger['info'](_0x630c('0x36'),_0x38a6ab,_0x1261f3,_0xfa7bb9);}});}})[_0x630c('0x34')](function(_0x568394){logger[_0x630c('0x35')](_0x630c('0x28'),_0x38a6ab,_0x27cded[_0x630c('0x5')][_0xfa7bb9]['acwTimeout'],_0x1261f3,_0xfa7bb9);})[_0x630c('0x37')](function(){delete _0x27cded[_0x630c('0x8')][_0x38a6ab];});}catch(_0x20f49f){logger[_0x630c('0x35')](_0x630c('0x38'),_0x20f49f[_0x630c('0x39')]);}};Acw['prototype'][_0x630c('0x2b')]=function(_0x41f133){try{var _0x4eb6c2=this;if(_0x4eb6c2[_0x630c('0x7')][_0x41f133]){_0x4eb6c2[_0x630c('0x7')][_0x41f133][_0x630c('0x2a')]=![];var _0x6b9a7d=_0x4eb6c2[_0x630c('0x7')][_0x41f133][_0x630c('0x2f')];var _0x12f905=_0x4eb6c2[_0x630c('0x7')][_0x41f133][_0x630c('0x30')];var _0x5755b0=_0x4eb6c2[_0x630c('0x5')][_0x12f905]['acwTimeout'];logger[_0x630c('0x24')](_0x630c('0x3a'),_0x6b9a7d,_0x41f133);RpcUser[_0x630c('0x3b')](this[_0x630c('0x6')][_0x41f133]);RpcVoiceAgentReport[_0x630c('0x32')]({'acwtime':_0x5755b0,'agentacw':!![]},_0x6b9a7d,_0x41f133)[_0x630c('0x22')](function(_0x31734a){logger[_0x630c('0x24')](_0x630c('0x33'),_0x6b9a7d,_0x5755b0,_0x31734a);})[_0x630c('0x34')](function(_0x3fee89){logger[_0x630c('0x35')](_0x630c('0x3c'),_0x6b9a7d,_0x3fee89);});}else{logger['error'](_0x630c('0x3d'),_0x41f133);if(_0x4eb6c2['timers']){logger[_0x630c('0x24')](_0x630c('0x3e'),JSON['stringify'](_0x4eb6c2[_0x630c('0x7')]));}}}catch(_0x575187){logger[_0x630c('0x35')](_0x630c('0x3f'),_0x575187[_0x630c('0x39')]);}};Acw[_0x630c('0x1a')][_0x630c('0xa')]=function(_0x4ac1f8){try{if(this[_0x630c('0x5')][_0x4ac1f8['queue']]&&(this[_0x630c('0x5')][_0x4ac1f8['queue']][_0x630c('0x3')]||this[_0x630c('0x5')][_0x4ac1f8[_0x630c('0x30')]]['mandatoryDisposition'])){if(this[_0x630c('0x6')][_0x4ac1f8['interface']]){this[_0x630c('0x8')][_0x4ac1f8[_0x630c('0x2f')]]={'queue':_0x4ac1f8['queue'],'interface':_0x4ac1f8['interface'],'destlinkedid':_0x4ac1f8[_0x630c('0x27')]};}}}catch(_0x4c50e6){logger[_0x630c('0x35')](_0x630c('0x40'),_0x4c50e6[_0x630c('0x39')]);}};Acw[_0x630c('0x1a')][_0x630c('0x16')]=function(_0x10dd90){try{if(this[_0x630c('0x5')][_0x10dd90[_0x630c('0x30')]]&&(this[_0x630c('0x5')][_0x10dd90['queue']][_0x630c('0x3')]||this[_0x630c('0x5')][_0x10dd90[_0x630c('0x30')]][_0x630c('0x1e')])){if(this[_0x630c('0x6')][_0x10dd90[_0x630c('0x1c')]]){this['channels'][_0x10dd90[_0x630c('0x2f')]]={'queue':_0x10dd90['queue'],'interface':_0x10dd90[_0x630c('0x1c')]};}}}catch(_0x5786cc){logger['error'](_0x630c('0x41'),_0x5786cc['message']);}};Acw[_0x630c('0x1a')][_0x630c('0xd')]=function(_0x268e1d){try{if(this[_0x630c('0x8')][_0x268e1d[_0x630c('0x2f')]]&&_[_0x630c('0x42')](this[_0x630c('0x8')][_0x268e1d[_0x630c('0x2f')]][_0x630c('0x26')])){logger['info'](_0x630c('0x43'),_0x268e1d[_0x630c('0x2f')]);this[_0x630c('0x1b')](_0x268e1d[_0x630c('0x2f')]);}else if(this[_0x630c('0x8')][_0x268e1d[_0x630c('0x44')]]&&_[_0x630c('0x42')](this[_0x630c('0x8')][_0x268e1d[_0x630c('0x44')]][_0x630c('0x26')])){logger[_0x630c('0x24')](_0x630c('0x45'),_0x268e1d[_0x630c('0x44')]);this['startAcw'](_0x268e1d[_0x630c('0x44')]);}}catch(_0x53c474){logger[_0x630c('0x35')](_0x630c('0x46'),_0x53c474['message']);}};Acw[_0x630c('0x1a')]['syncHangup']=function(_0x5d7092){try{if(this[_0x630c('0x8')][_0x5d7092[_0x630c('0x2f')]]&&this['channels'][_0x5d7092[_0x630c('0x2f')]][_0x630c('0x26')]){logger[_0x630c('0x24')](_0x630c('0x47'),_0x5d7092[_0x630c('0x2f')]);this[_0x630c('0x1b')](_0x5d7092[_0x630c('0x2f')]);}else if(this['channels'][_0x5d7092['linkedid']]&&this[_0x630c('0x8')][_0x5d7092[_0x630c('0x44')]]['attended']){logger['info'](_0x630c('0x48'),_0x5d7092['linkedid']);this['startAcw'](_0x5d7092['linkedid']);}}catch(_0x5f455d){logger[_0x630c('0x35')](_0x630c('0x49'),_0x5f455d[_0x630c('0x39')]);}};Acw[_0x630c('0x1a')][_0x630c('0x13')]=function(_0x49b9ca){try{if(!_[_0x630c('0x4a')](this[_0x630c('0x8')][_0x49b9ca[_0x630c('0x4b')]])){this[_0x630c('0x1b')](_0x49b9ca[_0x630c('0x4b')]);if(this[_0x630c('0x8')][_0x49b9ca[_0x630c('0x4c')]]){this[_0x630c('0x8')][_0x49b9ca[_0x630c('0x4c')]][_0x630c('0x26')]=!![];this[_0x630c('0x8')][_0x49b9ca[_0x630c('0x4d')]]=this['channels'][_0x49b9ca[_0x630c('0x4c')]];delete this[_0x630c('0x8')][_0x49b9ca[_0x630c('0x4c')]];}}else if(!_[_0x630c('0x4a')](this[_0x630c('0x8')][_0x49b9ca['transfertargetuniqueid']])){this[_0x630c('0x1b')](_0x49b9ca[_0x630c('0x4d')]);if(this[_0x630c('0x8')][_0x49b9ca[_0x630c('0x4e')]]){this[_0x630c('0x8')][_0x49b9ca[_0x630c('0x4e')]][_0x630c('0x26')]=!![];this[_0x630c('0x8')][_0x49b9ca[_0x630c('0x4b')]]=this[_0x630c('0x8')][_0x49b9ca[_0x630c('0x4e')]];delete this[_0x630c('0x8')][_0x49b9ca['origtransfereruniqueid']];}}}catch(_0x27fe23){logger['error'](_0x630c('0x4f'),_0x27fe23[_0x630c('0x39')]);}};Acw[_0x630c('0x1a')]['syncBlindTransfer']=function(_0x57d4ea){try{if(this[_0x630c('0x8')][_0x57d4ea[_0x630c('0x50')]]){logger[_0x630c('0x24')](_0x630c('0x51'),JSON[_0x630c('0x52')](_0x57d4ea['transfereruniqueid']));this[_0x630c('0x1b')](_0x57d4ea[_0x630c('0x50')]);}else if(this['channels'][_0x57d4ea[_0x630c('0x53')]]){logger['info']('[%s][BLINDTRANSFER:LINKEDID]',JSON[_0x630c('0x52')](_0x57d4ea[_0x630c('0x53')]));this[_0x630c('0x1b')](_0x57d4ea[_0x630c('0x53')]);}}catch(_0x27db31){logger['error']('[ACW][syncBlindTransfer]\x20%s',_0x27db31[_0x630c('0x39')]);}};Acw['prototype']['syncAgentRingNoAnswer']=function(_0x4e6a87){try{if(this['voiceQueues'][_0x4e6a87[_0x630c('0x30')]]&&this[_0x630c('0x5')][_0x4e6a87['queue']][_0x630c('0x54')]==='all'){if(this[_0x630c('0x6')][_0x4e6a87['interface']]){logger[_0x630c('0x24')](_0x630c('0x55'),_0x4e6a87[_0x630c('0x2f')],_0x4e6a87[_0x630c('0x1c')],_0x4e6a87['queue']);return RpcUser['savePause'](this['agents'][_0x4e6a87[_0x630c('0x1c')]],_0x630c('0x56'),_0x4e6a87[_0x630c('0x2f')]);}}}catch(_0x3fa04e){logger[_0x630c('0x35')]('[ACW][syncAgentRingNoAnswer]\x20%s',_0x3fa04e[_0x630c('0x39')]);}};module['exports']=Acw; \ No newline at end of file diff --git a/server/services/ami/ami.js b/server/services/ami/ami.js index a6e8db3..2ef9492 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 _0x9dcf=['util','../../config/logger','ami','../../config/environment','asterisk','username','password','keepConnected','Action','action','error','Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','port','inspect','format','Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s','sipshowregistry','actionSipPeerStatus','sippeerstatus','actionQueueSummary','coreshowchannels','info','Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s','once','close','connect','shutdown','Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s','fullybooted','Fullybooted\x20\x22%s\x22\x20to\x20%s:%s','resolve','then','actionSipShowRegistry','actionDeviceStateList','actionCoreShowChannels','catch','log','exports','asterisk-manager','bluebird'];(function(_0x545885,_0xe68674){var _0x38faa5=function(_0x5d3c03){while(--_0x5d3c03){_0x545885['push'](_0x545885['shift']());}};_0x38faa5(++_0xe68674);}(_0x9dcf,0x76));var _0xf9dc=function(_0x2a03d0,_0x5eb084){_0x2a03d0=_0x2a03d0-0x0;var _0x582b3a=_0x9dcf[_0x2a03d0];return _0x582b3a;};'use strict';var Manager=require(_0xf9dc('0x0'));var BPromise=require(_0xf9dc('0x1'));var moment=require('moment');var util=require(_0xf9dc('0x2'));var _=require('lodash');var logger=require(_0xf9dc('0x3'))(_0xf9dc('0x4'));var config=require(_0xf9dc('0x5'));var ami=new Manager(config[_0xf9dc('0x6')]['port'],config['asterisk']['ip'],config[_0xf9dc('0x6')][_0xf9dc('0x7')],config['asterisk'][_0xf9dc('0x8')],!![]);ami[_0xf9dc('0x9')]();ami[_0xf9dc('0xa')]=BPromise['promisify'](ami[_0xf9dc('0xb')]);function error(_0x3cbe58){logger[_0xf9dc('0xc')](util['format'](_0xf9dc('0xd'),config[_0xf9dc('0x6')][_0xf9dc('0x7')],config[_0xf9dc('0x6')]['ip'],config[_0xf9dc('0x6')][_0xf9dc('0xe')],util[_0xf9dc('0xf')](_0x3cbe58,![],null)));}function close(){logger['error'](util[_0xf9dc('0x10')](_0xf9dc('0x11'),config[_0xf9dc('0x6')]['username'],config[_0xf9dc('0x6')]['ip'],config[_0xf9dc('0x6')][_0xf9dc('0xe')]));}ami['actionSipShowRegistry']=function(){return function(){return ami[_0xf9dc('0xa')]({'action':_0xf9dc('0x12')});};};ami['actionDeviceStateList']=function(){return function(){return ami[_0xf9dc('0xa')]({'action':'devicestatelist'});};};ami[_0xf9dc('0x13')]=function(){return function(){return ami[_0xf9dc('0xa')]({'action':_0xf9dc('0x14')});};};ami[_0xf9dc('0x15')]=function(){return function(){return ami[_0xf9dc('0xa')]({'action':'queuesummary'});};};ami['actionCoreShowChannels']=function(){return function(){return ami[_0xf9dc('0xa')]({'action':_0xf9dc('0x16')});};};function connect(_0x28ee32){logger[_0xf9dc('0x17')](util[_0xf9dc('0x10')](_0xf9dc('0x18'),config[_0xf9dc('0x6')]['username'],config[_0xf9dc('0x6')]['ip'],config[_0xf9dc('0x6')][_0xf9dc('0xe')]));ami[_0xf9dc('0x19')](_0xf9dc('0xc'),error);ami[_0xf9dc('0x19')](_0xf9dc('0x1a'),close);}ami['on'](_0xf9dc('0x1b'),connect);ami['on'](_0xf9dc('0x1c'),function(_0x5d61b7){logger['info'](util['format'](_0xf9dc('0x1d'),config[_0xf9dc('0x6')]['username'],config[_0xf9dc('0x6')]['ip'],config[_0xf9dc('0x6')][_0xf9dc('0xe')],util[_0xf9dc('0xf')](_0x5d61b7,![],null)));});ami['on'](_0xf9dc('0x1e'),function(_0x75b4e){logger['info'](util[_0xf9dc('0x10')](_0xf9dc('0x1f'),config[_0xf9dc('0x6')][_0xf9dc('0x7')],config[_0xf9dc('0x6')]['ip'],config[_0xf9dc('0x6')][_0xf9dc('0xe')]));return BPromise[_0xf9dc('0x20')]()[_0xf9dc('0x21')](ami[_0xf9dc('0x22')]())[_0xf9dc('0x21')](ami[_0xf9dc('0x23')]())[_0xf9dc('0x21')](ami[_0xf9dc('0x13')]())['then'](ami[_0xf9dc('0x15')]())[_0xf9dc('0x21')](ami[_0xf9dc('0x24')]())[_0xf9dc('0x25')](function(_0x473268){console[_0xf9dc('0x26')](_0x473268);});});ami[_0xf9dc('0x19')](_0xf9dc('0xc'),error);ami[_0xf9dc('0x19')]('close',close);module[_0xf9dc('0x27')]=ami; \ No newline at end of file +var _0x7ffc=['password','keepConnected','Action','promisify','action','format','Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','inspect','error','username','actionSipShowRegistry','sipshowregistry','actionDeviceStateList','devicestatelist','sippeerstatus','actionQueueSummary','actionCoreShowChannels','coreshowchannels','info','once','close','Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s','fullybooted','resolve','then','catch','log','bluebird','moment','util','../../config/logger','ami','../../config/environment','port','asterisk'];(function(_0x25a42a,_0x3d489b){var _0x1129b1=function(_0x4ae61b){while(--_0x4ae61b){_0x25a42a['push'](_0x25a42a['shift']());}};_0x1129b1(++_0x3d489b);}(_0x7ffc,0x179));var _0xc7ff=function(_0x11a05f,_0x38a6af){_0x11a05f=_0x11a05f-0x0;var _0xdfea63=_0x7ffc[_0x11a05f];return _0xdfea63;};'use strict';var Manager=require('asterisk-manager');var BPromise=require(_0xc7ff('0x0'));var moment=require(_0xc7ff('0x1'));var util=require(_0xc7ff('0x2'));var _=require('lodash');var logger=require(_0xc7ff('0x3'))(_0xc7ff('0x4'));var config=require(_0xc7ff('0x5'));var ami=new Manager(config['asterisk'][_0xc7ff('0x6')],config[_0xc7ff('0x7')]['ip'],config[_0xc7ff('0x7')]['username'],config[_0xc7ff('0x7')][_0xc7ff('0x8')],!![]);ami[_0xc7ff('0x9')]();ami[_0xc7ff('0xa')]=BPromise[_0xc7ff('0xb')](ami[_0xc7ff('0xc')]);function error(_0x4a974c){logger['error'](util[_0xc7ff('0xd')](_0xc7ff('0xe'),config[_0xc7ff('0x7')]['username'],config['asterisk']['ip'],config[_0xc7ff('0x7')][_0xc7ff('0x6')],util[_0xc7ff('0xf')](_0x4a974c,![],null)));}function close(){logger[_0xc7ff('0x10')](util[_0xc7ff('0xd')]('Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s',config[_0xc7ff('0x7')][_0xc7ff('0x11')],config[_0xc7ff('0x7')]['ip'],config[_0xc7ff('0x7')][_0xc7ff('0x6')]));}ami[_0xc7ff('0x12')]=function(){return function(){return ami[_0xc7ff('0xa')]({'action':_0xc7ff('0x13')});};};ami[_0xc7ff('0x14')]=function(){return function(){return ami[_0xc7ff('0xa')]({'action':_0xc7ff('0x15')});};};ami['actionSipPeerStatus']=function(){return function(){return ami[_0xc7ff('0xa')]({'action':_0xc7ff('0x16')});};};ami[_0xc7ff('0x17')]=function(){return function(){return ami['Action']({'action':'queuesummary'});};};ami[_0xc7ff('0x18')]=function(){return function(){return ami[_0xc7ff('0xa')]({'action':_0xc7ff('0x19')});};};function connect(_0x1b2ac3){logger[_0xc7ff('0x1a')](util['format']('Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s',config[_0xc7ff('0x7')][_0xc7ff('0x11')],config[_0xc7ff('0x7')]['ip'],config['asterisk']['port']));ami[_0xc7ff('0x1b')](_0xc7ff('0x10'),error);ami['once'](_0xc7ff('0x1c'),close);}ami['on']('connect',connect);ami['on']('shutdown',function(_0x2cb5b3){logger['info'](util['format'](_0xc7ff('0x1d'),config[_0xc7ff('0x7')][_0xc7ff('0x11')],config[_0xc7ff('0x7')]['ip'],config[_0xc7ff('0x7')][_0xc7ff('0x6')],util[_0xc7ff('0xf')](_0x2cb5b3,![],null)));});ami['on'](_0xc7ff('0x1e'),function(_0x4a1120){logger['info'](util[_0xc7ff('0xd')]('Fullybooted\x20\x22%s\x22\x20to\x20%s:%s',config[_0xc7ff('0x7')]['username'],config['asterisk']['ip'],config[_0xc7ff('0x7')][_0xc7ff('0x6')]));return BPromise[_0xc7ff('0x1f')]()['then'](ami['actionSipShowRegistry']())[_0xc7ff('0x20')](ami[_0xc7ff('0x14')]())[_0xc7ff('0x20')](ami['actionSipPeerStatus']())[_0xc7ff('0x20')](ami['actionQueueSummary']())['then'](ami[_0xc7ff('0x18')]())[_0xc7ff('0x21')](function(_0x4d8036){console[_0xc7ff('0x22')](_0x4d8036);});});ami[_0xc7ff('0x1b')](_0xc7ff('0x10'),error);ami[_0xc7ff('0x1b')](_0xc7ff('0x1c'),close);module['exports']=ami; \ No newline at end of file diff --git a/server/services/ami/client.js b/server/services/ami/client.js index 2150dcf..cf6c69c 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 _0xac4a=['ami','client','http','then','debug','memberReport','error','message','result','catch','rpc','jayson/promise','bluebird','../../config/logger'];(function(_0x307bf6,_0x55bdd5){var _0x2878fc=function(_0x4fa44f){while(--_0x4fa44f){_0x307bf6['push'](_0x307bf6['shift']());}};_0x2878fc(++_0x55bdd5);}(_0xac4a,0x13f));var _0xaac4=function(_0x11a310,_0x5a4ac6){_0x11a310=_0x11a310-0x0;var _0x3e9f79=_0xac4a[_0x11a310];return _0x3e9f79;};'use strict';var jayson=require(_0xaac4('0x0'));var BPromise=require(_0xaac4('0x1'));var logger=require(_0xaac4('0x2'))(_0xaac4('0x3'));var client=jayson[_0xaac4('0x4')][_0xaac4('0x5')]({'port':0x2329});client['Request']=function(_0x58626e,_0x2af0f6){return new BPromise(function(_0x2a5762,_0x32d34c){return client['request'](_0x58626e,_0x2af0f6)[_0xaac4('0x6')](function(_0x53d03a){logger[_0xaac4('0x7')]('rpc',_0xaac4('0x8'),_0x58626e,_0x2af0f6,_0x53d03a);if(_0x53d03a[_0xaac4('0x9')]){logger['error']('rpc',_0xaac4('0x8'),_0x58626e,_0x53d03a['error'][_0xaac4('0xa')],_0x2af0f6);return _0x32d34c(_0x53d03a['error']['message']);}else{return _0x2a5762(_0x53d03a[_0xaac4('0xb')]);}})[_0xaac4('0xc')](function(_0x38d1d0){logger[_0xaac4('0x9')](_0xaac4('0xd'),'memberReport',_0x58626e,_0x38d1d0,_0x2af0f6);return _0x32d34c(_0x38d1d0);});});};module['exports']=client; \ No newline at end of file +var _0xe706=['result','catch','exports','jayson/promise','bluebird','../../config/logger','client','http','Request','request','then','debug','rpc','memberReport','error','message'];(function(_0x2df1f2,_0x58d388){var _0x38652b=function(_0x18e322){while(--_0x18e322){_0x2df1f2['push'](_0x2df1f2['shift']());}};_0x38652b(++_0x58d388);}(_0xe706,0xa3));var _0x6e70=function(_0xaf52f9,_0x3608bc){_0xaf52f9=_0xaf52f9-0x0;var _0xd9e03e=_0xe706[_0xaf52f9];return _0xd9e03e;};'use strict';var jayson=require(_0x6e70('0x0'));var BPromise=require(_0x6e70('0x1'));var logger=require(_0x6e70('0x2'))('ami');var client=jayson[_0x6e70('0x3')][_0x6e70('0x4')]({'port':0x2329});client[_0x6e70('0x5')]=function(_0x7dfbc3,_0x142c27){return new BPromise(function(_0x2164a4,_0x376a8d){return client[_0x6e70('0x6')](_0x7dfbc3,_0x142c27)[_0x6e70('0x7')](function(_0x4381d1){logger[_0x6e70('0x8')](_0x6e70('0x9'),_0x6e70('0xa'),_0x7dfbc3,_0x142c27,_0x4381d1);if(_0x4381d1[_0x6e70('0xb')]){logger[_0x6e70('0xb')](_0x6e70('0x9'),_0x6e70('0xa'),_0x7dfbc3,_0x4381d1[_0x6e70('0xb')][_0x6e70('0xc')],_0x142c27);return _0x376a8d(_0x4381d1[_0x6e70('0xb')][_0x6e70('0xc')]);}else{return _0x2164a4(_0x4381d1[_0x6e70('0xd')]);}})[_0x6e70('0xe')](function(_0x4600f9){logger['error']('rpc',_0x6e70('0xa'),_0x7dfbc3,_0x4600f9,_0x142c27);return _0x376a8d(_0x4600f9);});});};module[_0x6e70('0xf')]=client; \ No newline at end of file diff --git a/server/services/ami/dialer/action.js b/server/services/ami/dialer/action.js index 34c3eca..67abe72 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 _0x4bfd=['lastName','number','queue','active','type','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countagentrejectretry','ContactId','ListId','UserId','idHopper','ContactFirstName','format','YYYY-MM-DD\x20HH:mm:ss','callback','callbackuniqueid','callbackat','recallme','originatecalleridnum','originatecalleridname','prototype','getCaller','\x22%s\x22\x20<%s>','substring','dialCutDigit','getQueue','exports','lodash','string','voiceQueue','uniqueid','name','Contact','phone'];(function(_0x19da4d,_0x260981){var _0xc71c77=function(_0x4edb82){while(--_0x4edb82){_0x19da4d['push'](_0x19da4d['shift']());}};_0xc71c77(++_0x260981);}(_0x4bfd,0x1e5));var _0xd4bf=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4bfd[_0x3dd15e];return _0x231fd0;};'use strict';var util=require('util');var _=require(_0xd4bf('0x0'));var moment=require('moment');function checkNameSurname(_0x2a2da3,_0x389cf9,_0x9e3014){var _0x13d10f='';if(!_['isNil'](_0x389cf9)&&_0xd4bf('0x1')===typeof _0x389cf9){_0x13d10f+=_0x389cf9;}if(!_['isNil'](_0x9e3014)&&_0xd4bf('0x1')===typeof _0x9e3014){_0x13d10f+='\x20'+_0x9e3014;}if(_0x13d10f!==''){return _0x13d10f;}return _0x2a2da3;}function Action(_0x5dcae3,_0x7d33c2,_0x20d17f){this[_0xd4bf('0x2')]=_0x5dcae3;this[_0xd4bf('0x3')]=_0x20d17f||undefined;this[_0xd4bf('0x4')]=checkNameSurname(_0x7d33c2[_0xd4bf('0x5')][_0xd4bf('0x6')],_0x7d33c2[_0xd4bf('0x5')]['firstName'],_0x7d33c2[_0xd4bf('0x5')][_0xd4bf('0x7')]);this[_0xd4bf('0x8')]=_0x7d33c2['Contact'][_0xd4bf('0x6')];this[_0xd4bf('0x9')]=_0x5dcae3[_0xd4bf('0x4')];this[_0xd4bf('0xa')]=_0x7d33c2[_0xd4bf('0xa')]||![];this[_0xd4bf('0xb')]=_0x5dcae3[_0xd4bf('0xb')];this['dialQueueTimeout']=_0x5dcae3[_0xd4bf('0xc')]||0x3;this[_0xd4bf('0xd')]=_0x7d33c2['scheduledat'];this['countbusyretry']=_0x7d33c2[_0xd4bf('0xe')];this['countcongestionretry']=_0x7d33c2[_0xd4bf('0xf')];this['countnoanswerretry']=_0x7d33c2[_0xd4bf('0x10')];this['countnosuchnumberretry']=_0x7d33c2[_0xd4bf('0x11')];this[_0xd4bf('0x12')]=_0x7d33c2[_0xd4bf('0x12')];this[_0xd4bf('0x13')]=_0x7d33c2[_0xd4bf('0x13')];this['countmachineretry']=_0x7d33c2['countmachineretry'];this['countagentrejectretry']=_0x7d33c2[_0xd4bf('0x14')];this[_0xd4bf('0x15')]=_0x7d33c2[_0xd4bf('0x15')];this[_0xd4bf('0x16')]=_0x7d33c2[_0xd4bf('0x16')];this['UserId']=_0x7d33c2[_0xd4bf('0x17')];this['VoiceQueueId']=_0x7d33c2['VoiceQueueId'];this['CampaignId']=_0x7d33c2['CampaignId'];this[_0xd4bf('0x18')]=_0x7d33c2['id'];this[_0xd4bf('0x19')]=_0x7d33c2[_0xd4bf('0x5')]['firstName']||'';this['starttime']=moment()[_0xd4bf('0x1a')](_0xd4bf('0x1b'));this[_0xd4bf('0x1c')]=_0x7d33c2['callback'];this[_0xd4bf('0x1d')]=_0x7d33c2['callbackuniqueid'];this[_0xd4bf('0x1e')]=_0x7d33c2[_0xd4bf('0x1e')];this[_0xd4bf('0x1f')]=_0x7d33c2[_0xd4bf('0x1f')];this[_0xd4bf('0x20')]='';this[_0xd4bf('0x21')]='';}Action[_0xd4bf('0x22')][_0xd4bf('0x23')]=function(){return util[_0xd4bf('0x1a')](_0xd4bf('0x24'),this[_0xd4bf('0x4')],this['voiceQueue']['dialCutDigit']>0x0?this[_0xd4bf('0x8')][_0xd4bf('0x25')](this[_0xd4bf('0x2')][_0xd4bf('0x26')]):this['number']);};Action['prototype'][_0xd4bf('0x27')]=function(){return this[_0xd4bf('0x9')];};module[_0xd4bf('0x28')]=Action; \ No newline at end of file +var _0xb0c9=['YYYY-MM-DD\x20HH:mm:ss','callback','callbackuniqueid','callbackat','recallme','originatecalleridname','prototype','getCaller','format','\x22%s\x22\x20<%s>','dialCutDigit','substring','getQueue','queue','util','lodash','moment','isNil','string','voiceQueue','uniqueid','name','Contact','phone','lastName','number','active','type','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','ContactId','ListId','UserId','VoiceQueueId','CampaignId','idHopper','ContactFirstName','firstName','starttime'];(function(_0x1d2486,_0x3f09e7){var _0x4368f1=function(_0x159368){while(--_0x159368){_0x1d2486['push'](_0x1d2486['shift']());}};_0x4368f1(++_0x3f09e7);}(_0xb0c9,0x1b5));var _0x9b0c=function(_0x53c493,_0x425909){_0x53c493=_0x53c493-0x0;var _0x1478ab=_0xb0c9[_0x53c493];return _0x1478ab;};'use strict';var util=require(_0x9b0c('0x0'));var _=require(_0x9b0c('0x1'));var moment=require(_0x9b0c('0x2'));function checkNameSurname(_0x231fb3,_0x28928b,_0xe62d61){var _0x4c659d='';if(!_[_0x9b0c('0x3')](_0x28928b)&&_0x9b0c('0x4')===typeof _0x28928b){_0x4c659d+=_0x28928b;}if(!_[_0x9b0c('0x3')](_0xe62d61)&&_0x9b0c('0x4')===typeof _0xe62d61){_0x4c659d+='\x20'+_0xe62d61;}if(_0x4c659d!==''){return _0x4c659d;}return _0x231fb3;}function Action(_0x4bf861,_0x16254a,_0x345aaf){this[_0x9b0c('0x5')]=_0x4bf861;this[_0x9b0c('0x6')]=_0x345aaf||undefined;this[_0x9b0c('0x7')]=checkNameSurname(_0x16254a[_0x9b0c('0x8')][_0x9b0c('0x9')],_0x16254a[_0x9b0c('0x8')]['firstName'],_0x16254a[_0x9b0c('0x8')][_0x9b0c('0xa')]);this[_0x9b0c('0xb')]=_0x16254a[_0x9b0c('0x8')]['phone'];this['queue']=_0x4bf861['name'];this[_0x9b0c('0xc')]=_0x16254a['active']||![];this['type']=_0x4bf861[_0x9b0c('0xd')];this[_0x9b0c('0xe')]=_0x4bf861[_0x9b0c('0xe')]||0x3;this[_0x9b0c('0xf')]=_0x16254a['scheduledat'];this[_0x9b0c('0x10')]=_0x16254a['countbusyretry'];this['countcongestionretry']=_0x16254a[_0x9b0c('0x11')];this[_0x9b0c('0x12')]=_0x16254a[_0x9b0c('0x12')];this[_0x9b0c('0x13')]=_0x16254a[_0x9b0c('0x13')];this[_0x9b0c('0x14')]=_0x16254a['countdropretry'];this[_0x9b0c('0x15')]=_0x16254a[_0x9b0c('0x15')];this[_0x9b0c('0x16')]=_0x16254a[_0x9b0c('0x16')];this[_0x9b0c('0x17')]=_0x16254a['countagentrejectretry'];this[_0x9b0c('0x18')]=_0x16254a[_0x9b0c('0x18')];this['ListId']=_0x16254a[_0x9b0c('0x19')];this[_0x9b0c('0x1a')]=_0x16254a[_0x9b0c('0x1a')];this[_0x9b0c('0x1b')]=_0x16254a[_0x9b0c('0x1b')];this[_0x9b0c('0x1c')]=_0x16254a[_0x9b0c('0x1c')];this[_0x9b0c('0x1d')]=_0x16254a['id'];this[_0x9b0c('0x1e')]=_0x16254a[_0x9b0c('0x8')][_0x9b0c('0x1f')]||'';this[_0x9b0c('0x20')]=moment()['format'](_0x9b0c('0x21'));this[_0x9b0c('0x22')]=_0x16254a['callback'];this[_0x9b0c('0x23')]=_0x16254a[_0x9b0c('0x23')];this[_0x9b0c('0x24')]=_0x16254a[_0x9b0c('0x24')];this[_0x9b0c('0x25')]=_0x16254a[_0x9b0c('0x25')];this['originatecalleridnum']='';this[_0x9b0c('0x26')]='';}Action[_0x9b0c('0x27')][_0x9b0c('0x28')]=function(){return util[_0x9b0c('0x29')](_0x9b0c('0x2a'),this[_0x9b0c('0x7')],this[_0x9b0c('0x5')][_0x9b0c('0x2b')]>0x0?this['number'][_0x9b0c('0x2c')](this[_0x9b0c('0x5')][_0x9b0c('0x2b')]):this['number']);};Action[_0x9b0c('0x27')][_0x9b0c('0x2d')]=function(){return this[_0x9b0c('0x2e')];};module['exports']=Action; \ No newline at end of file diff --git a/server/services/ami/dialer/agentComplete.js b/server/services/ami/dialer/agentComplete.js index daebede..dbea787 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 _0x134b=['originatecalleridnum','originatecalleridname','exports','util','moment','milliseconds','diff','state','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countdropretry','countabandonedretry','countnosuchnumberretry','countmachineretry','countagentrejectretry','uniqueid','name','calleridnum','number','starttime','responsetime','answertime','endtime','format','ringtime','holdtime','talktime','membername','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId'];(function(_0xe95aae,_0x59ccbe){var _0x367449=function(_0x283f45){while(--_0x283f45){_0xe95aae['push'](_0xe95aae['shift']());}};_0x367449(++_0x59ccbe);}(_0x134b,0xe4));var _0xb134=function(_0x52684f,_0xff73fc){_0x52684f=_0x52684f-0x0;var _0x4a55f0=_0x134b[_0x52684f];return _0x4a55f0;};'use strict';var util=require(_0xb134('0x0'));var _=require('lodash');var moment=require(_0xb134('0x1'));function getSeconds(_0x3b36dd,_0x3fff2d){var _0x1fdf80=moment(_0x3b36dd)[_0xb134('0x2')](0x0);var _0x93f5e4=moment(_0x3fff2d)[_0xb134('0x2')](0x0);return _0x1fdf80[_0xb134('0x3')](_0x93f5e4,'seconds');}function AgentComplete(_0x436256,_0x290828){this[_0xb134('0x4')]=0x4;this['statedesc']='Answer';this[_0xb134('0x5')]=_0x436256['scheduledat'];this[_0xb134('0x6')]=_0x436256[_0xb134('0x6')];this[_0xb134('0x7')]=_0x436256[_0xb134('0x6')]===_0xb134('0x8')?_0xb134('0x9'):_0x436256['type'];this['countbusyretry']=_0x436256[_0xb134('0xa')];this[_0xb134('0xb')]=_0x436256[_0xb134('0xb')];this[_0xb134('0xc')]=_0x436256[_0xb134('0xc')];this[_0xb134('0xd')]=_0x436256[_0xb134('0xa')]+_0x436256[_0xb134('0xb')]+_0x436256[_0xb134('0xc')]+_0x436256['countnosuchnumberretry']+_0x436256[_0xb134('0xe')]+_0x436256[_0xb134('0xf')]+_0x436256['countmachineretry']+_0x436256['countagentrejectretry'];this['countnosuchnumberretry']=_0x436256[_0xb134('0x10')];this[_0xb134('0xe')]=_0x436256['countdropretry'];this[_0xb134('0xf')]=_0x436256['countabandonedretry'];this['countmachineretry']=_0x436256[_0xb134('0x11')];this['countagentrejectretry']=_0x436256[_0xb134('0x12')];this[_0xb134('0x13')]=_0x290828[_0xb134('0x13')];this['calleridname']=_0x436256[_0xb134('0x14')];this[_0xb134('0x15')]=_0x436256[_0xb134('0x16')];this[_0xb134('0x17')]=_0x436256[_0xb134('0x17')];this[_0xb134('0x18')]=_0x436256[_0xb134('0x18')];this[_0xb134('0x19')]=_0x436256['answertime'];this[_0xb134('0x1a')]=moment()[_0xb134('0x1b')]('YYYY-MM-DD\x20HH:mm:ss');this[_0xb134('0x1c')]=getSeconds(_0x436256[_0xb134('0x18')],_0x436256[_0xb134('0x17')]);this[_0xb134('0x1d')]=getSeconds(_0x436256[_0xb134('0x19')],_0x436256[_0xb134('0x18')]);this[_0xb134('0x1e')]=getSeconds(this[_0xb134('0x1a')],_0x436256['answertime']);this['queue']=_0x290828[_0xb134('0x9')];this[_0xb134('0x1f')]=_0x290828[_0xb134('0x1f')];this[_0xb134('0x20')]=_0x290828[_0xb134('0x20')];this[_0xb134('0x21')]=_0x436256[_0xb134('0x21')];this[_0xb134('0x22')]=_0x436256[_0xb134('0x22')];this[_0xb134('0x23')]=_0x436256[_0xb134('0x23')];this[_0xb134('0x24')]=_0x436256['recallme'];this[_0xb134('0x25')]=_0x436256['ContactId'];this[_0xb134('0x26')]=_0x436256[_0xb134('0x26')];this[_0xb134('0x27')]=_0x436256[_0xb134('0x27')];this[_0xb134('0x28')]=_0x436256[_0xb134('0x28')];this['CampaignId']=_0x436256[_0xb134('0x29')];this[_0xb134('0x2a')]=_0x436256[_0xb134('0x2a')]||'';this['originatecalleridname']=_0x436256[_0xb134('0x2b')]||'';}module[_0xb134('0x2c')]=AgentComplete; \ No newline at end of file +var _0x470c=['queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','calleridname','name','calleridnum','starttime','answertime','YYYY-MM-DD\x20HH:mm:ss','ringtime','responsetime','holdtime','talktime','endtime','membername','reason','callback','callbackuniqueid','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','milliseconds','diff','seconds','state','statedesc','scheduledat','type','campaigntype'];(function(_0x43762e,_0x240dcc){var _0x4562dc=function(_0x377553){while(--_0x377553){_0x43762e['push'](_0x43762e['shift']());}};_0x4562dc(++_0x240dcc);}(_0x470c,0x7b));var _0xc470=function(_0x13d07a,_0x41efc3){_0x13d07a=_0x13d07a-0x0;var _0x5ee0ee=_0x470c[_0x13d07a];return _0x5ee0ee;};'use strict';var util=require(_0xc470('0x0'));var _=require('lodash');var moment=require('moment');function getSeconds(_0x63a320,_0x47632e){var _0x52bfac=moment(_0x63a320)[_0xc470('0x1')](0x0);var _0x4c86ec=moment(_0x47632e)[_0xc470('0x1')](0x0);return _0x52bfac[_0xc470('0x2')](_0x4c86ec,_0xc470('0x3'));}function AgentComplete(_0xd2e524,_0x2684be){this[_0xc470('0x4')]=0x4;this[_0xc470('0x5')]='Answer';this[_0xc470('0x6')]=_0xd2e524[_0xc470('0x6')];this['type']=_0xd2e524[_0xc470('0x7')];this[_0xc470('0x8')]=_0xd2e524[_0xc470('0x7')]==='outbound'?_0xc470('0x9'):_0xd2e524[_0xc470('0x7')];this[_0xc470('0xa')]=_0xd2e524[_0xc470('0xa')];this['countcongestionretry']=_0xd2e524[_0xc470('0xb')];this[_0xc470('0xc')]=_0xd2e524[_0xc470('0xc')];this[_0xc470('0xd')]=_0xd2e524[_0xc470('0xa')]+_0xd2e524[_0xc470('0xb')]+_0xd2e524[_0xc470('0xc')]+_0xd2e524[_0xc470('0xe')]+_0xd2e524[_0xc470('0xf')]+_0xd2e524[_0xc470('0x10')]+_0xd2e524[_0xc470('0x11')]+_0xd2e524[_0xc470('0x12')];this['countnosuchnumberretry']=_0xd2e524[_0xc470('0xe')];this[_0xc470('0xf')]=_0xd2e524[_0xc470('0xf')];this[_0xc470('0x10')]=_0xd2e524[_0xc470('0x10')];this['countmachineretry']=_0xd2e524[_0xc470('0x11')];this[_0xc470('0x12')]=_0xd2e524[_0xc470('0x12')];this[_0xc470('0x13')]=_0x2684be[_0xc470('0x13')];this[_0xc470('0x14')]=_0xd2e524[_0xc470('0x15')];this[_0xc470('0x16')]=_0xd2e524['number'];this[_0xc470('0x17')]=_0xd2e524[_0xc470('0x17')];this['responsetime']=_0xd2e524['responsetime'];this[_0xc470('0x18')]=_0xd2e524['answertime'];this['endtime']=moment()['format'](_0xc470('0x19'));this[_0xc470('0x1a')]=getSeconds(_0xd2e524[_0xc470('0x1b')],_0xd2e524[_0xc470('0x17')]);this[_0xc470('0x1c')]=getSeconds(_0xd2e524[_0xc470('0x18')],_0xd2e524[_0xc470('0x1b')]);this[_0xc470('0x1d')]=getSeconds(this[_0xc470('0x1e')],_0xd2e524[_0xc470('0x18')]);this[_0xc470('0x9')]=_0x2684be[_0xc470('0x9')];this[_0xc470('0x1f')]=_0x2684be[_0xc470('0x1f')];this[_0xc470('0x20')]=_0x2684be[_0xc470('0x20')];this['callback']=_0xd2e524[_0xc470('0x21')];this[_0xc470('0x22')]=_0xd2e524['callbackuniqueid'];this['callbackat']=_0xd2e524['callbackat'];this[_0xc470('0x23')]=_0xd2e524['recallme'];this[_0xc470('0x24')]=_0xd2e524[_0xc470('0x24')];this[_0xc470('0x25')]=_0xd2e524[_0xc470('0x25')];this[_0xc470('0x26')]=_0xd2e524[_0xc470('0x26')];this['VoiceQueueId']=_0xd2e524[_0xc470('0x27')];this[_0xc470('0x28')]=_0xd2e524[_0xc470('0x28')];this[_0xc470('0x29')]=_0xd2e524['originatecalleridnum']||'';this[_0xc470('0x2a')]=_0xd2e524[_0xc470('0x2a')]||'';}module[_0xc470('0x2b')]=AgentComplete; \ No newline at end of file diff --git a/server/services/ami/dialer/final.js b/server/services/ami/dialer/final.js index aeeb91d..0fed153 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 _0xeec6=['countmachineretry','countagentrejectretry','calleridname','calleridnum','starttime','responsetime','endtime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','util','lodash','moment','milliseconds','diff','seconds','uniqueid','scheduledat','type','campaigntype','outbound','queue','countcongestionretry','countnoanswerretry','countbusyretry','countnosuchnumberretry','countdropretry','countabandonedretry'];(function(_0x24e8db,_0x89fc47){var _0x576cc1=function(_0x58f214){while(--_0x58f214){_0x24e8db['push'](_0x24e8db['shift']());}};_0x576cc1(++_0x89fc47);}(_0xeec6,0x1c2));var _0x6eec=function(_0x35ba71,_0xa2fbbd){_0x35ba71=_0x35ba71-0x0;var _0x5f04f4=_0xeec6[_0x35ba71];return _0x5f04f4;};'use strict';var util=require(_0x6eec('0x0'));var _=require(_0x6eec('0x1'));var moment=require(_0x6eec('0x2'));function getSeconds(_0x33cc53,_0x535568){var _0x471d43=moment(_0x33cc53)[_0x6eec('0x3')](0x0);var _0x1699ce=moment(_0x535568)[_0x6eec('0x3')](0x0);return _0x471d43[_0x6eec('0x4')](_0x1699ce,_0x6eec('0x5'));}function Final(_0x4fedce){this[_0x6eec('0x6')]=_0x4fedce[_0x6eec('0x6')];this['scheduledat']=_0x4fedce[_0x6eec('0x7')];this[_0x6eec('0x8')]=_0x4fedce[_0x6eec('0x8')];this[_0x6eec('0x9')]=_0x4fedce['type']===_0x6eec('0xa')?_0x6eec('0xb'):_0x4fedce[_0x6eec('0x8')];this['countbusyretry']=_0x4fedce['countbusyretry'];this['countcongestionretry']=_0x4fedce[_0x6eec('0xc')];this[_0x6eec('0xd')]=_0x4fedce['countnoanswerretry'];this['countglobal']=_0x4fedce[_0x6eec('0xe')]+_0x4fedce['countcongestionretry']+_0x4fedce[_0x6eec('0xd')]+_0x4fedce[_0x6eec('0xf')]+_0x4fedce[_0x6eec('0x10')]+_0x4fedce[_0x6eec('0x11')]+_0x4fedce[_0x6eec('0x12')]+_0x4fedce['countagentrejectretry'];this[_0x6eec('0xf')]=_0x4fedce[_0x6eec('0xf')];this[_0x6eec('0x10')]=_0x4fedce[_0x6eec('0x10')];this[_0x6eec('0x11')]=_0x4fedce[_0x6eec('0x11')];this[_0x6eec('0x12')]=_0x4fedce[_0x6eec('0x12')];this[_0x6eec('0x13')]=_0x4fedce[_0x6eec('0x13')];this['queue']=_0x4fedce[_0x6eec('0xb')];this['calleridname']=_0x4fedce[_0x6eec('0x14')];this[_0x6eec('0x15')]=_0x4fedce['calleridnum'];this[_0x6eec('0x16')]=_0x4fedce[_0x6eec('0x16')];this[_0x6eec('0x17')]=_0x4fedce['responsetime'];this[_0x6eec('0x18')]=_0x4fedce[_0x6eec('0x17')];this[_0x6eec('0x19')]=_0x4fedce[_0x6eec('0x19')]||0x0;this[_0x6eec('0x1a')]=_0x4fedce[_0x6eec('0x1a')]||0x0;this['talktime']=_0x4fedce[_0x6eec('0x1b')]||0x0;this[_0x6eec('0x1c')]=_0x4fedce[_0x6eec('0x1c')];this[_0x6eec('0x1d')]=_0x4fedce[_0x6eec('0x1d')];this[_0x6eec('0x1e')]=_0x4fedce['callbackat'];this[_0x6eec('0x1f')]=_0x4fedce[_0x6eec('0x1f')];this[_0x6eec('0x20')]=_0x4fedce[_0x6eec('0x20')];this[_0x6eec('0x21')]=_0x4fedce[_0x6eec('0x21')];this['UserId']=_0x4fedce[_0x6eec('0x22')];this[_0x6eec('0x23')]=_0x4fedce[_0x6eec('0x23')];this[_0x6eec('0x24')]=_0x4fedce[_0x6eec('0x24')];this[_0x6eec('0x25')]=_0x4fedce[_0x6eec('0x25')]||'';this[_0x6eec('0x26')]=_0x4fedce[_0x6eec('0x26')]||'';}module['exports']=Final; \ No newline at end of file +var _0xd6d2=['countnoanswerretry','countnosuchnumberretry','countdropretry','countmachineretry','countagentrejectretry','countabandonedretry','calleridnum','starttime','responsetime','endtime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','UserId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','milliseconds','diff','seconds','uniqueid','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd6d2,0xcb));var _0x2d6d=function(_0x2a2543,_0xc58d4){_0x2a2543=_0x2a2543-0x0;var _0x58d88e=_0xd6d2[_0x2a2543];return _0x58d88e;};'use strict';var util=require(_0x2d6d('0x0'));var _=require(_0x2d6d('0x1'));var moment=require('moment');function getSeconds(_0x19be1a,_0x224caa){var _0x5b4a5b=moment(_0x19be1a)[_0x2d6d('0x2')](0x0);var _0x482d86=moment(_0x224caa)[_0x2d6d('0x2')](0x0);return _0x5b4a5b[_0x2d6d('0x3')](_0x482d86,_0x2d6d('0x4'));}function Final(_0x4a4c5e){this[_0x2d6d('0x5')]=_0x4a4c5e[_0x2d6d('0x5')];this[_0x2d6d('0x6')]=_0x4a4c5e[_0x2d6d('0x6')];this[_0x2d6d('0x7')]=_0x4a4c5e[_0x2d6d('0x7')];this[_0x2d6d('0x8')]=_0x4a4c5e[_0x2d6d('0x7')]===_0x2d6d('0x9')?_0x2d6d('0xa'):_0x4a4c5e[_0x2d6d('0x7')];this['countbusyretry']=_0x4a4c5e[_0x2d6d('0xb')];this[_0x2d6d('0xc')]=_0x4a4c5e[_0x2d6d('0xc')];this[_0x2d6d('0xd')]=_0x4a4c5e[_0x2d6d('0xd')];this['countglobal']=_0x4a4c5e[_0x2d6d('0xb')]+_0x4a4c5e[_0x2d6d('0xc')]+_0x4a4c5e[_0x2d6d('0xd')]+_0x4a4c5e[_0x2d6d('0xe')]+_0x4a4c5e[_0x2d6d('0xf')]+_0x4a4c5e['countabandonedretry']+_0x4a4c5e[_0x2d6d('0x10')]+_0x4a4c5e[_0x2d6d('0x11')];this[_0x2d6d('0xe')]=_0x4a4c5e[_0x2d6d('0xe')];this['countdropretry']=_0x4a4c5e[_0x2d6d('0xf')];this[_0x2d6d('0x12')]=_0x4a4c5e['countabandonedretry'];this['countmachineretry']=_0x4a4c5e[_0x2d6d('0x10')];this[_0x2d6d('0x11')]=_0x4a4c5e[_0x2d6d('0x11')];this['queue']=_0x4a4c5e[_0x2d6d('0xa')];this['calleridname']=_0x4a4c5e['calleridname'];this['calleridnum']=_0x4a4c5e[_0x2d6d('0x13')];this[_0x2d6d('0x14')]=_0x4a4c5e[_0x2d6d('0x14')];this[_0x2d6d('0x15')]=_0x4a4c5e[_0x2d6d('0x15')];this[_0x2d6d('0x16')]=_0x4a4c5e[_0x2d6d('0x15')];this[_0x2d6d('0x17')]=_0x4a4c5e[_0x2d6d('0x17')]||0x0;this['holdtime']=_0x4a4c5e[_0x2d6d('0x18')]||0x0;this[_0x2d6d('0x19')]=_0x4a4c5e['talktime']||0x0;this[_0x2d6d('0x1a')]=_0x4a4c5e[_0x2d6d('0x1a')];this[_0x2d6d('0x1b')]=_0x4a4c5e[_0x2d6d('0x1b')];this[_0x2d6d('0x1c')]=_0x4a4c5e[_0x2d6d('0x1c')];this['recallme']=_0x4a4c5e[_0x2d6d('0x1d')];this[_0x2d6d('0x1e')]=_0x4a4c5e[_0x2d6d('0x1e')];this['ListId']=_0x4a4c5e['ListId'];this[_0x2d6d('0x1f')]=_0x4a4c5e['UserId'];this['VoiceQueueId']=_0x4a4c5e['VoiceQueueId'];this[_0x2d6d('0x20')]=_0x4a4c5e[_0x2d6d('0x20')];this[_0x2d6d('0x21')]=_0x4a4c5e[_0x2d6d('0x21')]||'';this[_0x2d6d('0x22')]=_0x4a4c5e['originatecalleridname']||'';}module[_0x2d6d('0x23')]=Final; \ No newline at end of file diff --git a/server/services/ami/dialer/hangup.js b/server/services/ami/dialer/hangup.js index 269c24a..447ad7d 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 _0x1d80=['exports','util','milliseconds','diff','state','statedesc','Answer','scheduledat','type','campaigntype','outbound','queue','countnoanswerretry','countbusyretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','calleridname','name','calleridnum','number','starttime','responsetime','endtime','format','ringtime','talktime','membername','reason','cause-txt','callback','callbackuniqueid','callbackat','recallme','ContactId','UserId','VoiceQueueId','CampaignId'];(function(_0x1a4861,_0x510d80){var _0x55c004=function(_0x5c8dd0){while(--_0x5c8dd0){_0x1a4861['push'](_0x1a4861['shift']());}};_0x55c004(++_0x510d80);}(_0x1d80,0x172));var _0x01d8=function(_0x5da6cc,_0x2b9fdc){_0x5da6cc=_0x5da6cc-0x0;var _0x44e928=_0x1d80[_0x5da6cc];return _0x44e928;};'use strict';var util=require(_0x01d8('0x0'));var _=require('lodash');var moment=require('moment');function getSeconds(_0x22ccaa,_0xc0085c){var _0x31cdca=moment(_0x22ccaa)[_0x01d8('0x1')](0x0);var _0x10c6a9=moment(_0xc0085c)[_0x01d8('0x1')](0x0);return _0x31cdca[_0x01d8('0x2')](_0x10c6a9,'seconds');}function Hangup(_0x5377c1,_0x176b57){this[_0x01d8('0x3')]=0x4;this[_0x01d8('0x4')]=_0x01d8('0x5');this['scheduledat']=_0x5377c1[_0x01d8('0x6')];this[_0x01d8('0x7')]=_0x5377c1[_0x01d8('0x7')];this[_0x01d8('0x8')]=_0x5377c1[_0x01d8('0x7')]===_0x01d8('0x9')?_0x01d8('0xa'):_0x5377c1[_0x01d8('0x7')];this['countbusyretry']=_0x5377c1['countbusyretry'];this['countcongestionretry']=_0x5377c1['countcongestionretry'];this[_0x01d8('0xb')]=_0x5377c1['countnoanswerretry'];this['countglobal']=_0x5377c1[_0x01d8('0xc')]+_0x5377c1['countcongestionretry']+_0x5377c1[_0x01d8('0xb')]+_0x5377c1[_0x01d8('0xd')]+_0x5377c1[_0x01d8('0xe')]+_0x5377c1[_0x01d8('0xf')]+_0x5377c1[_0x01d8('0x10')]+_0x5377c1[_0x01d8('0x11')];this[_0x01d8('0xd')]=_0x5377c1[_0x01d8('0xd')];this['countdropretry']=_0x5377c1[_0x01d8('0xe')];this['countabandonedretry']=_0x5377c1[_0x01d8('0xf')];this[_0x01d8('0x10')]=_0x5377c1[_0x01d8('0x10')];this[_0x01d8('0x11')]=_0x5377c1[_0x01d8('0x11')];this[_0x01d8('0x12')]=_0x176b57['uniqueid'];this[_0x01d8('0x13')]=_0x5377c1[_0x01d8('0x14')];this[_0x01d8('0x15')]=_0x5377c1[_0x01d8('0x16')];this[_0x01d8('0x17')]=_0x5377c1['starttime'];this[_0x01d8('0x18')]=_0x5377c1[_0x01d8('0x18')];this[_0x01d8('0x19')]=moment()[_0x01d8('0x1a')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x01d8('0x1b')]=getSeconds(_0x5377c1[_0x01d8('0x18')],_0x5377c1[_0x01d8('0x17')]);this['holdtime']=0x0;this[_0x01d8('0x1c')]=getSeconds(this[_0x01d8('0x19')],_0x5377c1['responsetime']);this[_0x01d8('0xa')]=_0x5377c1['queue'];this[_0x01d8('0x1d')]='IVR';this[_0x01d8('0x1e')]=_0x176b57[_0x01d8('0x1f')];this['callback']=_0x5377c1[_0x01d8('0x20')];this[_0x01d8('0x21')]=_0x5377c1[_0x01d8('0x21')];this['callbackat']=_0x5377c1[_0x01d8('0x22')];this[_0x01d8('0x23')]=_0x5377c1[_0x01d8('0x23')];this[_0x01d8('0x24')]=_0x5377c1[_0x01d8('0x24')];this['ListId']=_0x5377c1['ListId'];this[_0x01d8('0x25')]=_0x5377c1[_0x01d8('0x25')];this[_0x01d8('0x26')]=_0x5377c1['VoiceQueueId'];this[_0x01d8('0x27')]=_0x5377c1[_0x01d8('0x27')];}module[_0x01d8('0x28')]=Hangup; \ No newline at end of file +var _0xf47a=['scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','calleridnum','starttime','responsetime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','holdtime','talktime','IVR','reason','callback','callbackuniqueid','callbackat','ListId','UserId','CampaignId','exports','util','milliseconds','diff','seconds','state','statedesc','Answer'];(function(_0x2e73cb,_0x3636a6){var _0x29fbad=function(_0x5554d9){while(--_0x5554d9){_0x2e73cb['push'](_0x2e73cb['shift']());}};_0x29fbad(++_0x3636a6);}(_0xf47a,0x189));var _0xaf47=function(_0x1ae387,_0x416bd4){_0x1ae387=_0x1ae387-0x0;var _0x297d84=_0xf47a[_0x1ae387];return _0x297d84;};'use strict';var util=require(_0xaf47('0x0'));var _=require('lodash');var moment=require('moment');function getSeconds(_0x429be4,_0x43fe80){var _0x34e9ec=moment(_0x429be4)[_0xaf47('0x1')](0x0);var _0x50e565=moment(_0x43fe80)[_0xaf47('0x1')](0x0);return _0x34e9ec[_0xaf47('0x2')](_0x50e565,_0xaf47('0x3'));}function Hangup(_0x40e53e,_0x26fc83){this[_0xaf47('0x4')]=0x4;this[_0xaf47('0x5')]=_0xaf47('0x6');this[_0xaf47('0x7')]=_0x40e53e[_0xaf47('0x7')];this[_0xaf47('0x8')]=_0x40e53e[_0xaf47('0x8')];this[_0xaf47('0x9')]=_0x40e53e[_0xaf47('0x8')]===_0xaf47('0xa')?_0xaf47('0xb'):_0x40e53e['type'];this[_0xaf47('0xc')]=_0x40e53e[_0xaf47('0xc')];this['countcongestionretry']=_0x40e53e[_0xaf47('0xd')];this[_0xaf47('0xe')]=_0x40e53e['countnoanswerretry'];this[_0xaf47('0xf')]=_0x40e53e[_0xaf47('0xc')]+_0x40e53e[_0xaf47('0xd')]+_0x40e53e[_0xaf47('0xe')]+_0x40e53e[_0xaf47('0x10')]+_0x40e53e[_0xaf47('0x11')]+_0x40e53e[_0xaf47('0x12')]+_0x40e53e[_0xaf47('0x13')]+_0x40e53e[_0xaf47('0x14')];this[_0xaf47('0x10')]=_0x40e53e['countnosuchnumberretry'];this[_0xaf47('0x11')]=_0x40e53e[_0xaf47('0x11')];this[_0xaf47('0x12')]=_0x40e53e[_0xaf47('0x12')];this[_0xaf47('0x13')]=_0x40e53e[_0xaf47('0x13')];this[_0xaf47('0x14')]=_0x40e53e[_0xaf47('0x14')];this[_0xaf47('0x15')]=_0x26fc83[_0xaf47('0x15')];this['calleridname']=_0x40e53e['name'];this[_0xaf47('0x16')]=_0x40e53e['number'];this[_0xaf47('0x17')]=_0x40e53e[_0xaf47('0x17')];this[_0xaf47('0x18')]=_0x40e53e[_0xaf47('0x18')];this[_0xaf47('0x19')]=moment()[_0xaf47('0x1a')](_0xaf47('0x1b'));this[_0xaf47('0x1c')]=getSeconds(_0x40e53e['responsetime'],_0x40e53e['starttime']);this[_0xaf47('0x1d')]=0x0;this[_0xaf47('0x1e')]=getSeconds(this[_0xaf47('0x19')],_0x40e53e[_0xaf47('0x18')]);this[_0xaf47('0xb')]=_0x40e53e['queue'];this['membername']=_0xaf47('0x1f');this[_0xaf47('0x20')]=_0x26fc83['cause-txt'];this[_0xaf47('0x21')]=_0x40e53e[_0xaf47('0x21')];this[_0xaf47('0x22')]=_0x40e53e[_0xaf47('0x22')];this['callbackat']=_0x40e53e[_0xaf47('0x23')];this['recallme']=_0x40e53e['recallme'];this['ContactId']=_0x40e53e['ContactId'];this['ListId']=_0x40e53e[_0xaf47('0x24')];this[_0xaf47('0x25')]=_0x40e53e[_0xaf47('0x25')];this['VoiceQueueId']=_0x40e53e['VoiceQueueId'];this[_0xaf47('0x26')]=_0x40e53e['CampaignId'];}module[_0xaf47('0x27')]=Hangup; \ No newline at end of file diff --git a/server/services/ami/dialer/history.js b/server/services/ami/dialer/history.js index c715616..3da0598 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 _0x7702=['callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','moment','milliseconds','diff','seconds','uniqueid','scheduledat','type','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','calleridname','name','calleridnum','starttime','responsetime','endtime','holdtime','talktime'];(function(_0x19b2bb,_0x411abf){var _0xbcc558=function(_0x459c45){while(--_0x459c45){_0x19b2bb['push'](_0x19b2bb['shift']());}};_0xbcc558(++_0x411abf);}(_0x7702,0x17d));var _0x2770=function(_0xdc5208,_0x5d93bf){_0xdc5208=_0xdc5208-0x0;var _0x423324=_0x7702[_0xdc5208];return _0x423324;};'use strict';var util=require('util');var _=require('lodash');var moment=require(_0x2770('0x0'));function getSeconds(_0x1592c2,_0x21afef){var _0x1daf55=moment(_0x1592c2)[_0x2770('0x1')](0x0);var _0x9d93dd=moment(_0x21afef)[_0x2770('0x1')](0x0);return _0x1daf55[_0x2770('0x2')](_0x9d93dd,_0x2770('0x3'));}function History(_0x3e527f){this[_0x2770('0x4')]=_0x3e527f['uniqueid'];this[_0x2770('0x5')]=_0x3e527f[_0x2770('0x5')]||undefined;this[_0x2770('0x6')]=_0x3e527f[_0x2770('0x6')];this['campaigntype']=_0x3e527f[_0x2770('0x6')]===_0x2770('0x7')?_0x2770('0x8'):_0x3e527f[_0x2770('0x6')];this[_0x2770('0x9')]=_0x3e527f[_0x2770('0x9')];this[_0x2770('0xa')]=_0x3e527f[_0x2770('0xa')];this[_0x2770('0xb')]=_0x3e527f[_0x2770('0xb')];this[_0x2770('0xc')]=_0x3e527f[_0x2770('0x9')]+_0x3e527f[_0x2770('0xa')]+_0x3e527f[_0x2770('0xb')]+_0x3e527f[_0x2770('0xd')]+_0x3e527f[_0x2770('0xe')]+_0x3e527f[_0x2770('0xf')]+_0x3e527f[_0x2770('0x10')]+_0x3e527f[_0x2770('0x11')];this['countnosuchnumberretry']=_0x3e527f['countnosuchnumberretry'];this['countdropretry']=_0x3e527f[_0x2770('0xe')];this[_0x2770('0xf')]=_0x3e527f[_0x2770('0xf')];this['countmachineretry']=_0x3e527f[_0x2770('0x10')];this['countagentrejectretry']=_0x3e527f['countagentrejectretry'];this[_0x2770('0x8')]=_0x3e527f[_0x2770('0x8')];this[_0x2770('0x12')]=_0x3e527f[_0x2770('0x13')];this[_0x2770('0x14')]=_0x3e527f['number'];this[_0x2770('0x15')]=_0x3e527f[_0x2770('0x15')];this[_0x2770('0x16')]=_0x3e527f['responsetime'];this[_0x2770('0x17')]=_0x3e527f[_0x2770('0x16')];this['ringtime']=getSeconds(_0x3e527f['responsetime'],_0x3e527f[_0x2770('0x15')]);this[_0x2770('0x18')]=0x0;this[_0x2770('0x19')]=0x0;this[_0x2770('0x1a')]=_0x3e527f[_0x2770('0x1a')];this[_0x2770('0x1b')]=_0x3e527f[_0x2770('0x1b')];this[_0x2770('0x1c')]=_0x3e527f['callbackat'];this[_0x2770('0x1d')]=_0x3e527f[_0x2770('0x1d')];this[_0x2770('0x1e')]=_0x3e527f[_0x2770('0x1e')];this['ListId']=_0x3e527f[_0x2770('0x1f')];this['UserId']=_0x3e527f[_0x2770('0x20')];this[_0x2770('0x21')]=_0x3e527f[_0x2770('0x21')];this[_0x2770('0x22')]=_0x3e527f[_0x2770('0x22')];this[_0x2770('0x23')]=_0x3e527f['originatecalleridnum']||'';this['originatecalleridname']=_0x3e527f[_0x2770('0x24')]||'';}module['exports']=History; \ No newline at end of file +var _0x1558=['moment','milliseconds','diff','seconds','uniqueid','scheduledat','type','campaigntype','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','calleridname','calleridnum','starttime','responsetime','endtime','ringtime','holdtime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','lodash'];(function(_0x296d1b,_0x1f0bf0){var _0x3c747f=function(_0x1d5096){while(--_0x1d5096){_0x296d1b['push'](_0x296d1b['shift']());}};_0x3c747f(++_0x1f0bf0);}(_0x1558,0x6b));var _0x8155=function(_0x411017,_0x4a8117){_0x411017=_0x411017-0x0;var _0x2adeea=_0x1558[_0x411017];return _0x2adeea;};'use strict';var util=require('util');var _=require(_0x8155('0x0'));var moment=require(_0x8155('0x1'));function getSeconds(_0x1e262b,_0x32b95c){var _0x4c95b8=moment(_0x1e262b)['milliseconds'](0x0);var _0x59e8b1=moment(_0x32b95c)[_0x8155('0x2')](0x0);return _0x4c95b8[_0x8155('0x3')](_0x59e8b1,_0x8155('0x4'));}function History(_0x5c0458){this[_0x8155('0x5')]=_0x5c0458[_0x8155('0x5')];this[_0x8155('0x6')]=_0x5c0458[_0x8155('0x6')]||undefined;this[_0x8155('0x7')]=_0x5c0458['type'];this[_0x8155('0x8')]=_0x5c0458['type']==='outbound'?'queue':_0x5c0458[_0x8155('0x7')];this['countbusyretry']=_0x5c0458['countbusyretry'];this[_0x8155('0x9')]=_0x5c0458[_0x8155('0x9')];this[_0x8155('0xa')]=_0x5c0458['countnoanswerretry'];this[_0x8155('0xb')]=_0x5c0458['countbusyretry']+_0x5c0458[_0x8155('0x9')]+_0x5c0458[_0x8155('0xa')]+_0x5c0458[_0x8155('0xc')]+_0x5c0458[_0x8155('0xd')]+_0x5c0458[_0x8155('0xe')]+_0x5c0458[_0x8155('0xf')]+_0x5c0458[_0x8155('0x10')];this[_0x8155('0xc')]=_0x5c0458['countnosuchnumberretry'];this[_0x8155('0xd')]=_0x5c0458[_0x8155('0xd')];this['countabandonedretry']=_0x5c0458[_0x8155('0xe')];this[_0x8155('0xf')]=_0x5c0458['countmachineretry'];this[_0x8155('0x10')]=_0x5c0458[_0x8155('0x10')];this['queue']=_0x5c0458['queue'];this[_0x8155('0x11')]=_0x5c0458['name'];this[_0x8155('0x12')]=_0x5c0458['number'];this[_0x8155('0x13')]=_0x5c0458[_0x8155('0x13')];this[_0x8155('0x14')]=_0x5c0458[_0x8155('0x14')];this[_0x8155('0x15')]=_0x5c0458[_0x8155('0x14')];this[_0x8155('0x16')]=getSeconds(_0x5c0458[_0x8155('0x14')],_0x5c0458[_0x8155('0x13')]);this[_0x8155('0x17')]=0x0;this['talktime']=0x0;this[_0x8155('0x18')]=_0x5c0458[_0x8155('0x18')];this[_0x8155('0x19')]=_0x5c0458['callbackuniqueid'];this['callbackat']=_0x5c0458[_0x8155('0x1a')];this[_0x8155('0x1b')]=_0x5c0458[_0x8155('0x1b')];this[_0x8155('0x1c')]=_0x5c0458[_0x8155('0x1c')];this[_0x8155('0x1d')]=_0x5c0458['ListId'];this[_0x8155('0x1e')]=_0x5c0458[_0x8155('0x1e')];this[_0x8155('0x1f')]=_0x5c0458['VoiceQueueId'];this[_0x8155('0x20')]=_0x5c0458[_0x8155('0x20')];this[_0x8155('0x21')]=_0x5c0458[_0x8155('0x21')]||'';this[_0x8155('0x22')]=_0x5c0458[_0x8155('0x22')]||'';}module[_0x8155('0x23')]=History; \ No newline at end of file diff --git a/server/services/ami/dialer/index.js b/server/services/ami/dialer/index.js index 9ec7306..c932c57 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 _0x60d7=['ListId','UserId','VoiceQueueId','CampaignId','[emptyContact]','Success','isTrunkReachable','SIP/%s','reachable','unmonitored','saveInDb','syncVarSet','variable','amdstatus','exten','xcally-motion-dialer','HANGUP','uniqueid','membername','AMD','custom:amd','buildObj','amd','[syncHangupInAMD][createHistory]','dialAMDActive','value','MACHINE','countmachineretry','countglobal','[syncAgentComplete][createHistory][0]','countnoanswerretry','countnosuchnumberretry','countagentrejectretry','dialGlobalMaxRetry','stateGlobal','reason19\x20machine....','createStateFinal','reason\x2019\x20machine....','add','dialMachineRetryFrequency','minutes','[rescheduleContact][Machine]','HangupInAMD','[syncHangupInAMDIvr][createHistory]','countbusyretry','countcongestionretry','dialMachineMaxRetry','YYYY-MM-DD\x20HH:mm:ss','ivrAnswerCallsDay','[syncHangupIvr][createHistory]','AnswerAGI','[syncHangupIvr]','dialQueueProject','cause-txt','Unknow','agiafterat','[syncAgentComplete][createHistory]','[syncAgentComplete]','syncAgentConnect','answertime','[syncQueueCallerAbandon]\x20[Drop]','droptime','responsetime','dialQueueProject2','queueCallerAbandonCreateState','countdropretry','[rescheduleContact][Drop]','Drop','calleridname','calleridnum','[syncAgentComplete][createHistory][10]','Abandoned','dropreason','countabandonedretry','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','[syncAgentComplete][createHistory][11]','roundrobin','actionid','paused','stateinterface','locked','queueStatusComplete','[unlockQueueStatus][undefined]','[booked][unlockQueueStatus]','finally','_rr','length','unlockRR','[booked][RR]','Agent:\x20','contactAgent-idHopper:\x20','idHopper','run','[Catch][Preview][syncQueueStatusComplete]','[booked][RR][finaly]','[booked][unlock]','[unlock][syncQueueStatusComplete]','[booked][unlock3]','[unlock3][syncQueueStatusComplete]','syncCampaigns','checkIsTrunkReachable','TrunkBackup','TRUNK_IS_NOT_REACHABLE','ifTime','checkIfTimeIntervals','Failure','INTERVAL_IS_EMPTY','\x20Intervals\x20is\x20empty\x20','timezones','TIMEZONE_UNKNOW','isArray','push','interval','content','indexOf','command','iftime\x20%s,%s','true','all','GLOBAL_INTERVAL_IS_OVERTIME','[ifTime][promiseAll]','Timezone:\x20','checkDialMethod','progressive','handlePower','power','Queue','method\x20not\x20recognized','handleIvr','loggedIn','dialTimezone','[syncQueueSummary]','dialGlobalInterval','launchHandleIvr','pow','replace','random','match','actionOriginate','originate','voiceQueue\x20is\x20undefine','Contact','phone','contact\x20is\x20undefine','getCaller','\x22agi://%s/square,%s\x22','NONE','dialQueueOptions','dialAgiAfterHangupAgent','dialQueueTimeout','XMD-AMDINITIALSILENCE','dialAMDInitialSilence','XMD-AMDGREETING','dialAMDGreeting','XMD-AMDAFTERGREETINGSILENCE','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','XMD-AMDBETWEENWORDSSILENCE','XMD-AMDMAXIMUMNUMBEROFWORDS','dialAMDMaximumNumberOfWords','XMD-AMDSILENCETHRESHOLD','dialAMDSilenceThreshold','XMD-AMDMAXIMUMWORDLENGTH','dialAMDMaximumWordLength','XMD-CAMPAIGNID','tags','createdAt','updatedAt','XMD-','toUpper','dialRandomLastDigitCallerIdNumber','XMD-ORIGINATECALLERIDNAME','originatecalleridname','SIP/%s/%s%s','trim','dialCutDigit','OriginateError','[originate][error]','originate\x20action\x20Error','isSuccess','response','callProgressDetecting','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','[rescheduleContact][NoAnswer]','dialBusyMaxRetry','[rescheduleContact]\x20[Busy]','dialCongestionMaxRetry','dialCongestionRetryFrequency','[rescheduleContact]\x20[Congestion]','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','[rescheduleContact][Abandoned]','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','[rescheduleContact][AgentReject]','object','[callProgressDetecting]','reason','NoSuchNumber','custom:agentnosuchnumber','checkRetriveMax','reason\x200\x20no\x20such\x20number....','NoAnswer','custom:agentnoanswer','noanswer','reason\x203\x20ringing\x20no\x20answer','custom:agentbusy','busy','reason\x205\x20busy','Congestion','custom:agentcongestion','congestion','[syncAgentComplete][createHistory][8]','reason\x2011\x20abandoned','AgentReject','[syncAgentComplete][createHistory][20]','reason\x2020\x20agentreject','[syncAgentComplete][createHistory][?]','Global','[moveContactManagedDialer][0]','dialPredictiveOptimizationPercentage','round','predictiveIntervalMaxThreshold','predictiveIntervalAvailable','predictiveIntervalMinThreshold','check\x20predictive\x20is\x20not\x20undefine','check\x20handlePredictive\x20is\x20not\x20undefine','collection\x20data\x20in\x20progressive\x20at','dialPredictiveInterval','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','Dropped\x20calls\x20day','dialPredictiveOptimization','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Max\x20Drop\x20','started\x20in\x20predictive\x20at','startMethodPredictive','Predictive\x20after\x20first\x20interval','recalculate\x20predictive\x20at','getDataPredictive','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20less\x20than\x20threshold\x20(',')\x20are\x20more\x20than\x20threshold\x20(','abandonmentRate','agentBusyFactor','busyFactor','[getDataPredictive]','Unknown\x20Predictive','check\x20failure','getDataPredictiveOld','predictiveIntervalPauses','outboundQueuePauses','[CatchErlangB]','floor','[handlePredictive]','checkContactBlack','recallme','[booked][checkContactBlack]','queueStatusComplete:\x20','Queue:\x20','queuestatus','[unlockOriginate][syncQueueStatusComplete]','[booked][checkContactBlack][else]','scheduledat','Agent','voicePause','dialRecallInQueue','RECALLINQUEUE','RecallInQueue','[Originate][HistoryDialRecallInQueue][historyCatch]','RECALLFAILEDTIMEOUT','RecallFailedTimeout','[Originate][HistoryRecallClose][historyCatch]','[Originate][HistoryRecallClose]','outboundBlacklistCallsDay','BLACKLIST','[Originate][historyBlacklist]','[Originate][MoveBlacklist]','limitCalls','dialOrderByScheduledAt','[getContactCampaign2][Empty]','ivrTotalCallsDays','[actionOriginate]\x20','loggerHandler','[actionOriginateIvr]\x20','[getContactCampaign2]','dialLimitQueue','pTalking','not_inuse','[countReScheduled]\x20','RUNNING','Contact.phone','[getContactDialer2]','tryOriginatePredictive','[handlePredictive][limitChannel]','Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','P:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[abandonmentRate]','Ts\x20=\x20','p\x20=\x20','interval\x20=\x20','Amax\x20=\x20','M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','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','md5','../preview/util/util','../../../config/environment/','../../../config/logger','dialer','booked','predictive','predictiveCalls','syncQueueSummary','../ami','redis','localhost','socket.io-emitter','../rpc/cmHopper','../rpc/cmHopperHistory','../rpc/voiceQueueRt','./action','./history','./final','./agentComplete','./queueCallerAbandon','./hangup','env','XCALLY_IP_AGI','127.0.0.1','rrmemory','prototype','tail','sequence','preview','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','channels','actions','contactsId','uniqueId','optionPredictive','startProgressive','ivrOriginated','queueBooked','queueBookedRR','agentconnect','bind','queuecallerabandon','syncQueueCallerAbandon','syncOriginateResponse','agentcomplete','syncAgentComplete','custom:queuesummary','syncHangup','newexten','syncNewExten','varset','queuemember','syncQueueMember','queuestatuscomplete','syncQueueStatusComplete','loopCampaigns','loopClearZombieChannels','isUndefined','message','\x20AGENTS\x20NOT\x20LOGGED','NOT_ACTIVE','name','\x20NOT\x20Active','Interval','INTERVAL_IS_NULL','Intervals','\x20INTERVAL_IS_NULL','Error','stringify','milliseconds','diff','seconds','emit','outbound','strategy','available','sumBillable','talking','total','type','loggedInDb','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundCongestionCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','originated','erlangCalls','erlangCallToSecond','erlangBusyFactor','startPredictive','Trunk','active','callerid','voice:queue:%s','voice_queue:save','ivr','format','campaign:ivr:%s','isEmpty','-----\x20Stats\x20Predictive\x20---','Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalTotalCalls','info','Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','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','One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangAbandonmentRate','---------------------------','merge','clearing\x20variable\x20start\x20predictive','handlePredictive','clearing\x20variable\x20handle\x20predictive','string','\x22%s\x22\x20<%s>','inspect','error','stack','undefined','contactsRescheduled','[getContactDialer2][ReScheduled]','contacts','AVAILABLE_CONTACTS_FINISHED','[getContactDialer2][Empty]','sendMessageOneNotActive','waiting','[syncQueueSummary]\x20Campaign\x20Queue:\x20','IS_DISACTIVED','is\x20disactive','is\x20not\x20active','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','state','statedesc','endtime','starttime','clearZombieChannels','[actions]','enqueue','isNil','Action','status','channel','catch','No\x20such\x20channel','updateOriginated','queue','[Dialer][checkChannel][ivr]','countReScheduled','resolve','then','checkIsBlackList','checkIsBlackListIvr','[checkIsBlackListIvr]\x20','averageHandleTime','[averageHandleTime]\x20','rescheduleContact','[rescheduleContact]\x20','unlockContact','[unlockContact]\x20','getContactDialer','temp','getContactDialerIvr','[getContactDialerIvr]\x20','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','moveContactManagedDialer','[moveContactManagedDialer]\x20','createHistory','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','emptyContact','pick','ContactId'];(function(_0x1a286f,_0x374d52){var _0x33e8b0=function(_0xc49f77){while(--_0xc49f77){_0x1a286f['push'](_0x1a286f['shift']());}};_0x33e8b0(++_0x374d52);}(_0x60d7,0x139));var _0x760d=function(_0x5d4fc1,_0x1719d9){_0x5d4fc1=_0x5d4fc1-0x0;var _0x1b0f65=_0x60d7[_0x5d4fc1];return _0x1b0f65;};'use strict';var util=require(_0x760d('0x0'));var _=require(_0x760d('0x1'));var BPromise=require('bluebird');var uuid=require(_0x760d('0x2'));var moment=require('moment');var rr=require('rr');var md5=require(_0x760d('0x3'));var Redis=require('ioredis');var ut=require(_0x760d('0x4'));var config=require(_0x760d('0x5'));var logger=require(_0x760d('0x6'))(_0x760d('0x7'));var loggerBooked=require('../../../config/logger')(_0x760d('0x8'));var loggerPredictive=require(_0x760d('0x6'))(_0x760d('0x9'));var loggerPredictiveCalls=require(_0x760d('0x6'))(_0x760d('0xa'));var loggerSyncQueueSummary=require('../../../config/logger')(_0x760d('0xb'));var ami=require(_0x760d('0xc'));config[_0x760d('0xd')]=_['defaults'](config[_0x760d('0xd')],{'host':_0x760d('0xe'),'port':0x18eb});var io=require(_0x760d('0xf'))(new Redis(config['redis']));var cmHopper=require(_0x760d('0x10'));var cmHopperHistory=require(_0x760d('0x11'));var cmHopperBlack=require('../rpc/cmHopperBlack');var voiceQueueRt=require(_0x760d('0x12'));var Action=require(_0x760d('0x13'));var History=require(_0x760d('0x14'));var Final=require(_0x760d('0x15'));var AgentComplete=require(_0x760d('0x16'));var QueueCallerAbandon=require(_0x760d('0x17'));var Hangup=require(_0x760d('0x18'));var ipAgi=process[_0x760d('0x19')][_0x760d('0x1a')]||_0x760d('0x1b');var strategy={'rrmemory':_0x760d('0x1c'),'roundrobin':'roundrobin'};var Sequence=function(){};Sequence[_0x760d('0x1d')]['enqueue']=function(_0x305db8){this[_0x760d('0x1e')]=this[_0x760d('0x1e')]?this[_0x760d('0x1e')]['finally'](_0x305db8):_0x305db8();};function Dialer(_0x5190e5,_0xb8b0aa){this[_0x760d('0x1f')]=new Sequence();this[_0x760d('0x20')]=_0xb8b0aa;this[_0x760d('0x21')]=_0x5190e5[_0x760d('0x21')];this[_0x760d('0x22')]=_0x5190e5['campaigns'];this['agents']=_0x5190e5[_0x760d('0x23')];this[_0x760d('0x24')]=_0x5190e5[_0x760d('0x24')];this[_0x760d('0x25')]=config[_0x760d('0x25')]||0x2;this[_0x760d('0x26')]={};this[_0x760d('0x27')]={};this[_0x760d('0x28')]={};this[_0x760d('0x29')]={};this[_0x760d('0x2a')]={};this['startPredictive']={};this[_0x760d('0x2b')]={};this[_0x760d('0x2c')]={};this[_0x760d('0x2d')]={};this[_0x760d('0x2e')]={};ami['on'](_0x760d('0x2f'),this['syncAgentConnect'][_0x760d('0x30')](this));ami['on'](_0x760d('0x31'),this[_0x760d('0x32')]['bind'](this));ami['on']('originateresponse',this[_0x760d('0x33')][_0x760d('0x30')](this));ami['on'](_0x760d('0x34'),this[_0x760d('0x35')][_0x760d('0x30')](this));ami['on'](_0x760d('0x36'),this[_0x760d('0xb')][_0x760d('0x30')](this));ami['on']('hangup',this[_0x760d('0x37')][_0x760d('0x30')](this));ami['on'](_0x760d('0x38'),this[_0x760d('0x39')]['bind'](this));ami['on'](_0x760d('0x3a'),this['syncVarSet']['bind'](this));ami['on'](_0x760d('0x3b'),this[_0x760d('0x3c')][_0x760d('0x30')](this));ami['on'](_0x760d('0x3d'),this[_0x760d('0x3e')][_0x760d('0x30')](this));this[_0x760d('0x3f')]();this[_0x760d('0x40')]();}function isNotNull(_0x5c20be){return _0x5c20be!==null&&!_[_0x760d('0x41')](_0x5c20be);}function checkIsLoggedIn(_0xc4fec8,_0x27cb58){return function(){if(_0x27cb58<=0x0){_0xc4fec8[_0x760d('0x42')]='AGENTS_NOT_LOGGED';throw _0xc4fec8['name']+_0x760d('0x43');}};}function isActive(_0x3fab11){return _0x3fab11;}function checkIsActive(_0x2fb82d,_0x1b0bd9){return function(){if(!isActive(_0x1b0bd9)){_0x2fb82d[_0x760d('0x42')]=_0x760d('0x44');throw _0x2fb82d[_0x760d('0x45')]+_0x760d('0x46');}};}function checkInterval(_0x2a3046){return function(){if(!isNotNull(_0x2a3046[_0x760d('0x47')])){_0x2a3046[_0x760d('0x42')]=_0x760d('0x48');throw _0x2a3046[_0x760d('0x45')]+'\x20INTERVAL_IS_NULL';}if(!isNotNull(_0x2a3046[_0x760d('0x47')][_0x760d('0x49')])){_0x2a3046['message']='INTERVAL_IS_NULL';throw _0x2a3046[_0x760d('0x45')]+_0x760d('0x4a');}if(!isNotNull(_['isEmpty'](_0x2a3046[_0x760d('0x47')]['Intervals']))){_0x2a3046['message']=_0x760d('0x48');throw _0x2a3046[_0x760d('0x45')]+_0x760d('0x4a');}};}function msgResponse(_0x374359,_0x2cce22,_0x56487e){return{'action':_0x374359,'response':_0x2cce22,'message':_0x56487e,'stack':_0x56487e};}function myreject(_0x5b56e7){return function(_0x4aecf9){return _0x5b56e7(msgResponse('[ifTime][Action]',_0x760d('0x4b'),JSON[_0x760d('0x4c')](_0x4aecf9)));};}function getSeconds(_0x1a2f61,_0x9e357d){var _0x3b5796=moment(_0x1a2f61)[_0x760d('0x4d')](0x0);var _0x5dac5c=moment(_0x9e357d)[_0x760d('0x4d')](0x0);return _0x3b5796[_0x760d('0x4e')](_0x5dac5c,_0x760d('0x4f'));}function emit(_0x17eaed,_0x2c59d5,_0x397952){io['to'](_0x17eaed)[_0x760d('0x50')](_0x2c59d5,_0x397952);}function emitVoiceQueueSummary(_0x97a491){if(_0x97a491['type']===_0x760d('0x51')){var _0x534396={'id':_0x97a491['id'],'name':_0x97a491[_0x760d('0x45')],'strategy':_0x97a491[_0x760d('0x52')],'answered':_0x97a491['answered'],'available':_0x97a491[_0x760d('0x53')],'loggedIn':_0x97a491['loggedIn'],'pTalking':_0x97a491['pTalking'],'sumBillable':_0x97a491[_0x760d('0x54')],'sumDuration':_0x97a491['sumDuration'],'sumHoldTime':_0x97a491['sumHoldTime']||0x0,'talking':_0x97a491[_0x760d('0x55')],'total':_0x97a491[_0x760d('0x56')],'type':_0x97a491[_0x760d('0x57')],'unmanaged':_0x97a491['unmanaged'],'abandoned':_0x97a491['abandoned'],'waiting':_0x97a491['waiting'],'loggedInDb':_0x97a491[_0x760d('0x58')],'dialActive':_0x97a491[_0x760d('0x59')],'dialMethod':_0x97a491[_0x760d('0x5a')],'dialOriginateCallerIdName':_0x97a491[_0x760d('0x5b')],'dialOriginateCallerIdNumber':_0x97a491[_0x760d('0x5c')],'dialOriginateTimeout':_0x97a491[_0x760d('0x5d')],'dialPrefix':_0x97a491[_0x760d('0x5e')],'outboundAnswerAgiCallsDay':_0x97a491[_0x760d('0x5f')],'outboundAnswerCallsDay':_0x97a491[_0x760d('0x60')],'outboundBlacklistCallsDay':_0x97a491['outboundBlacklistCallsDay'],'outboundBusyCallsDay':_0x97a491['outboundBusyCallsDay'],'outboundCongestionCallsDay':_0x97a491[_0x760d('0x61')],'outboundDropCallsDayACS':_0x97a491['outboundDropCallsDayACS'],'outboundDropCallsDayCallersExit':_0x97a491[_0x760d('0x62')],'outboundDropCallsDayTimeout':_0x97a491[_0x760d('0x63')],'outboundNoAnswerCallsDay':_0x97a491[_0x760d('0x64')],'outboundNoSuchCallsDay':_0x97a491[_0x760d('0x65')],'outboundOriginateFailureCallsDay':_0x97a491[_0x760d('0x66')],'outboundReCallsDay':_0x97a491[_0x760d('0x67')],'outboundRejectCallsDay':_0x97a491[_0x760d('0x68')],'outboundUnknownCallsDay':_0x97a491[_0x760d('0x69')],'predictiveIntervalAnsweredCalls':_0x97a491[_0x760d('0x6a')],'predictiveIntervalAvgHoldtime':_0x97a491[_0x760d('0x6b')],'predictiveIntervalAvgTalktime':_0x97a491[_0x760d('0x6c')],'predictiveIntervalDroppedCallsCallersExit':_0x97a491[_0x760d('0x6d')],'predictiveIntervalDroppedCallsTimeout':_0x97a491[_0x760d('0x6e')],'predictiveIntervalErlangCalls':_0x97a491[_0x760d('0x6f')],'predictiveIntervalErlangCallsDroppedCalls':_0x97a491[_0x760d('0x70')],'predictiveIntervalHitRate':_0x97a491[_0x760d('0x71')],'predictiveIntervalMultiplicativeFactor':_0x97a491[_0x760d('0x72')],'predictiveIntervalPauses':_0x97a491['predictiveIntervalPauses'],'predictiveIntervalAvailable':_0x97a491['predictiveIntervalAvailable'],'predictiveIntervalTotalCalls':_0x97a491['predictiveIntervalTotalCalls'],'message':_0x97a491['message'],'originated':_0x97a491[_0x760d('0x73')],'erlangCalls':_0x97a491[_0x760d('0x74')],'erlangCallToSecond':_0x97a491[_0x760d('0x75')],'erlangAbandonmentRate':_0x97a491['erlangAbandonmentRate'],'erlangBusyFactor':_0x97a491[_0x760d('0x76')],'startPredictive':_0x97a491[_0x760d('0x77')],'startProgressive':_0x97a491[_0x760d('0x2b')]};if(_0x97a491[_0x760d('0x78')]){_0x534396[_0x760d('0x78')]={'id':_0x97a491[_0x760d('0x78')]['id'],'name':_0x97a491['Trunk'][_0x760d('0x45')],'active':_0x97a491[_0x760d('0x78')][_0x760d('0x79')],'callerid':_0x97a491[_0x760d('0x78')][_0x760d('0x7a')]};}if(_0x97a491[_0x760d('0x47')]){_0x534396[_0x760d('0x47')]={'id':_0x97a491[_0x760d('0x47')]['id'],'name':_0x97a491[_0x760d('0x47')][_0x760d('0x45')]};}var _0x5b7555=md5(JSON['stringify'](_0x534396));if(_0x97a491[_0x760d('0x3')]!==_0x5b7555){_0x97a491[_0x760d('0x3')]=_0x5b7555;emit(util['format'](_0x760d('0x7b'),_0x534396['name']),_0x760d('0x7c'),_0x534396);}}}function emitCampaignSummary(_0x47fa82){if(_0x47fa82['type']===_0x760d('0x7d')){emit(util[_0x760d('0x7e')](_0x760d('0x7f'),_0x47fa82[_0x760d('0x45')]),'campaign:save',_0x47fa82);}}function checkGetDataPredictive(_0x35f764){if(isNotNull(_0x35f764)&&!_[_0x760d('0x80')](_0x35f764)){loggerPredictive['info'](_0x760d('0x81'));loggerPredictive['info'](_0x760d('0x82'),_0x35f764[_0x760d('0x83')]);loggerPredictive[_0x760d('0x84')]('Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x35f764[_0x760d('0x6a')]);loggerPredictive[_0x760d('0x84')](_0x760d('0x85'),_0x35f764[_0x760d('0x6e')]);loggerPredictive[_0x760d('0x84')](_0x760d('0x86'),_0x35f764[_0x760d('0x6d')]);loggerPredictive['info'](_0x760d('0x87'),_0x35f764[_0x760d('0x6b')]);loggerPredictive[_0x760d('0x84')](_0x760d('0x88'),_0x35f764[_0x760d('0x6c')]);loggerPredictive[_0x760d('0x84')]('---------------------------');if(_0x35f764['predictiveIntervalTotalCalls']>0x0){if(!_[_0x760d('0x41')](_0x35f764[_0x760d('0x6c')])&&_0x35f764['predictiveIntervalAvgTalktime']>0x0){return!![];}loggerPredictive[_0x760d('0x84')](_0x760d('0x89'));if(!_['isUndefined'](_0x35f764[_0x760d('0x6b')])&&_0x35f764['predictiveIntervalAvgHoldtime']>0x0){return!![];}loggerPredictive[_0x760d('0x84')](_0x760d('0x8a'));}else{loggerPredictive[_0x760d('0x84')](_0x760d('0x8b'));}}else{loggerPredictive[_0x760d('0x84')]('History\x20information\x20are\x20empty');}return![];}function mergeDataErlangB(_0x428e25){return function(_0x35461e){loggerPredictive[_0x760d('0x84')](_0x760d('0x8c'));loggerPredictive[_0x760d('0x84')](_0x760d('0x8d'),_0x35461e[_0x760d('0x74')]);loggerPredictive[_0x760d('0x84')](_0x760d('0x8e'),_0x35461e[_0x760d('0x75')]);loggerPredictive[_0x760d('0x84')](_0x760d('0x8f'),_0x35461e['erlangAbandonmentRate']);loggerPredictive['info'](_0x760d('0x90'),_0x35461e[_0x760d('0x76')]);loggerPredictive[_0x760d('0x84')](_0x760d('0x8f'),_0x35461e[_0x760d('0x91')]);loggerPredictive[_0x760d('0x84')](_0x760d('0x92'));_[_0x760d('0x93')](_0x428e25,_0x35461e);};}function getDiff(_0x24d545){var _0x2b50d8=moment()[_0x760d('0x4d')](0x0);var _0x4524af=moment(_0x24d545)[_0x760d('0x4d')](0x0);return _0x2b50d8[_0x760d('0x4e')](_0x4524af,_0x760d('0x4f'));}function ifInterval(_0x385054,_0x531e52){if(_[_0x760d('0x41')](_0x531e52)){return![];}return getDiff(_0x531e52)<_0x385054*0x3c;}function freeVariablesPredictive(_0x2a8196){if(isNotNull(_0x2a8196)){if(!_[_0x760d('0x41')](_0x2a8196[_0x760d('0x2b')])){_0x2a8196[_0x760d('0x2b')]=undefined;loggerPredictive['info'](_0x2a8196[_0x760d('0x45')],'clearing\x20variable\x20start\x20progressive');}if(!_[_0x760d('0x41')](_0x2a8196[_0x760d('0x77')])){_0x2a8196[_0x760d('0x77')]=undefined;loggerPredictive[_0x760d('0x84')](_0x2a8196['name'],_0x760d('0x94'));}if(!_[_0x760d('0x41')](_0x2a8196['handlePredictive'])){clearInterval(_0x2a8196[_0x760d('0x95')]);_0x2a8196[_0x760d('0x95')]=undefined;loggerPredictive[_0x760d('0x84')](_0x2a8196[_0x760d('0x45')],_0x760d('0x96'));}}}function erlangb(_0x1f1ea6,_0x162f79){if(_0x162f79===0x0){return 0x0;}var _0x4b4f0c=0x1;for(var _0x169e34=0x1;_0x169e34<=_0x162f79;_0x169e34+=0x1){_0x4b4f0c=0x1+_0x4b4f0c*_0x169e34/_0x1f1ea6;}return 0x1/_0x4b4f0c;}function isVoiceQueueOutbound(_0x509100){return _0x509100===_0x760d('0x51');}function isNotPreview(_0x1da97f){return _0x1da97f!==_0x760d('0x20');}function isCampaignIvr(_0x5db011){return _0x5db011===_0x760d('0x7d');}function getCallerId(_0x5e9569,_0x8265ea,_0x39f652){if(!_[_0x760d('0x41')](_0x39f652)&&typeof _0x39f652===_0x760d('0x97')&&!_[_0x760d('0x80')](_0x39f652)){if(!_['isUndefined'](_0x8265ea)&&typeof _0x8265ea===_0x760d('0x97')&&!_[_0x760d('0x80')](_0x8265ea)){return util[_0x760d('0x7e')]('\x22%s\x22\x20<%s>',_0x8265ea,_0x39f652);}return util[_0x760d('0x7e')](_0x760d('0x98'),_0x39f652,_0x39f652);}if(!_[_0x760d('0x41')](_0x5e9569)&&typeof _0x5e9569==='string'&&!_['isEmpty'](_0x5e9569)){return _0x5e9569;}return'\x22\x22\x20<>';}function loggerCatchQueueSummary(_0x292b0f,_0x356959){return function(_0x56b2c2){freeVariablesPredictive(_0x356959);emitVoiceQueueSummary(_0x356959);emitCampaignSummary(_0x356959);loggerSyncQueueSummary['error'](_0x292b0f,util[_0x760d('0x99')](_0x56b2c2,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0x3008b0,_0x2e541b){return function(_0xe86d77){loggerPredictive[_0x760d('0x9a')](_0x2e541b[_0x760d('0x45')],_0x3008b0);loggerPredictive[_0x760d('0x9a')](_0xe86d77[_0x760d('0x9b')]);freeVariablesPredictive(_0x2e541b);};}function loggerCatch(_0x39c5c2){return function(_0xe4eeba){logger['error'](_0x39c5c2,util[_0x760d('0x99')](_0xe4eeba,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0x2b2779){return _0x2b2779&&!_['isUndefined'](_0x2b2779)&&_0x2b2779['length']>0x0;}function decremetOriginate(_0x3f42be){if(!_[_0x760d('0x41')](_0x3f42be)&&_0x3f42be!==null){if(typeof _0x3f42be['originated']!==_0x760d('0x9c')){if(_0x3f42be[_0x760d('0x73')]>0x0){_0x3f42be['originated']-=0x1;}else{logger[_0x760d('0x9a')]('[decremetOriginate]\x20object\x20originated\x20is\x20negative');}}}else{logger[_0x760d('0x9a')]('[decremetOriginate]\x20is\x20null\x20or\x20undefined');}}function checkContactLowerLimitOriginate(_0x2722c3,_0x2e4fcd,_0x50aa77){if(_0x2e4fcd>_0x50aa77){for(var _0x536f5d=0x0;_0x536f5d<_0x2e4fcd-_0x50aa77;_0x536f5d+=0x1){decremetOriginate(_0x2722c3);}}}function loggerGetContactDialer(_0x36ffb8,_0x25c605,_0x3f94b9){return function(_0x4f1638){checkContactLowerLimitOriginate(_0x25c605,_0x3f94b9,0x0);logger[_0x760d('0x9a')](_0x36ffb8,util['inspect'](_0x4f1638,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x4bbf02){return function(_0xe088ed){if(isNotNull(_0xe088ed)&&isNotNull(_0xe088ed[0x0])){if(_0xe088ed[0x0][_0x760d('0x9d')]>0x0){_0x4bbf02[_0x760d('0x42')]='RESCHEDULED_CONTACTS';logger['info'](_0x760d('0x9e')+_0x4bbf02[_0x760d('0x45')],_0xe088ed[0x0][_0x760d('0x9d')],_0x760d('0x9f'));}else{_0x4bbf02[_0x760d('0x42')]=_0x760d('0xa0');logger['info'](_0x760d('0xa1')+_0x4bbf02[_0x760d('0x45')]);}}};}function notSendMessagesQueue(_0x1e0113){if(_0x1e0113[_0x760d('0xa2')]){freeVariablesPredictive(_0x1e0113);if(_0x1e0113['originated']===0x0&&_0x1e0113[_0x760d('0x55')]===0x0&&_0x1e0113[_0x760d('0xa3')]===0x0&&(_0x1e0113['pTalking']||0x0)===0x0){_0x1e0113[_0x760d('0xa2')]=![];_0x1e0113['available']=0x0;_0x1e0113[_0x760d('0x42')]=_0x760d('0x44');loggerSyncQueueSummary[_0x760d('0x9a')](_0x760d('0xa4'),_0x1e0113[_0x760d('0x45')],'is\x20not\x20active');}else{_0x1e0113['message']=_0x760d('0xa5');loggerSyncQueueSummary[_0x760d('0x9a')]('[syncQueueSummary]\x20Campaign\x20Queue:\x20',_0x1e0113[_0x760d('0x45')],_0x760d('0xa6'));}emitVoiceQueueSummary(_0x1e0113);}}function notSendMessagesCampaign(_0x4c2e12){if(_0x4c2e12[_0x760d('0xa2')]){if(_0x4c2e12[_0x760d('0x73')]===0x0){_0x4c2e12['sendMessageOneNotActive']=![];_0x4c2e12['message']=_0x760d('0x44');loggerSyncQueueSummary[_0x760d('0x9a')]('[syncQueueSummary]\x20Campaign\x20Ivr:\x20',_0x4c2e12[_0x760d('0x45')],_0x760d('0xa7'));}else{_0x4c2e12['message']=_0x760d('0xa5');loggerSyncQueueSummary['error'](_0x760d('0xa8'),_0x4c2e12[_0x760d('0x45')],'is\x20disactive');}emitCampaignSummary(_0x4c2e12);}}function createObjHistory(_0x429579,_0x4d8c3f,_0x4ce1c3,_0x4244f5,_0x4ef947){_0x429579['message']=_0x4ce1c3;var _0x5d7a8e=new Action(_0x429579,_0x4d8c3f);var _0x5bf96e=new History(_0x5d7a8e);_0x5bf96e[_0x760d('0xa9')]=_0x4244f5;_0x5bf96e[_0x760d('0xaa')]=_0x4ef947;_0x5bf96e[_0x760d('0xab')]=_0x5d7a8e[_0x760d('0xac')];return _0x5bf96e;}Dialer[_0x760d('0x1d')][_0x760d('0x40')]=function(){var _0x5a4c4c=this;setInterval(function(){_0x5a4c4c['clearZombieChannels'](_0x5a4c4c[_0x760d('0x29')],'[uniqueid]');_0x5a4c4c[_0x760d('0xad')](_0x5a4c4c[_0x760d('0x27')],_0x760d('0xae'));},0x32c8);};Dialer['prototype'][_0x760d('0xad')]=function(_0x32f3ea,_0x1ed3a4){var _0x183240=this;for(var _0x135566 in _0x32f3ea){if(typeof _0x32f3ea[_0x135566]!==_0x760d('0x9c')){this[_0x760d('0x1f')][_0x760d('0xaf')](function(){if(!_[_0x760d('0xb0')](_0x32f3ea[_0x135566])){return ami[_0x760d('0xb1')]({'action':_0x760d('0xb2'),'channel':_0x32f3ea[_0x135566][_0x760d('0xb3')]})[_0x760d('0xb4')](function(_0xdb49f4){if(_0xdb49f4[_0x760d('0x42')]===_0x760d('0xb5')){setTimeout(function(){if(_0x32f3ea[_0x135566]&&_0x32f3ea[_0x135566]['type']!=='ivr'){_0x183240[_0x760d('0xb6')](_0x183240[_0x760d('0x21')][_0x32f3ea[_0x135566][_0x760d('0xb7')]]);logger[_0x760d('0x9a')]('[Dialer][checkChannel]',_0x1ed3a4,_0x135566,_0x32f3ea[_0x135566][_0x760d('0xb7')]);delete _0x32f3ea[_0x135566];}if(_0x32f3ea[_0x135566]&&_0x32f3ea[_0x135566]['type']==='ivr'){_0x183240[_0x760d('0xb6')](_0x183240[_0x760d('0x22')][_0x32f3ea[_0x135566][_0x760d('0xb7')]]);logger['error'](_0x760d('0xb8'),_0x1ed3a4,_0x135566,_0x32f3ea[_0x135566][_0x760d('0xb7')]);delete _0x32f3ea[_0x135566];}},0x2328);}});}});}}};Dialer[_0x760d('0x1d')][_0x760d('0xb9')]=function(_0x3dc417){return BPromise[_0x760d('0xba')]()[_0x760d('0xbb')](cmHopper[_0x760d('0xb9')](_0x3dc417))[_0x760d('0xb4')](loggerCatch('[countReScheduled]\x20'));};Dialer[_0x760d('0x1d')][_0x760d('0xbc')]=function(_0x542e1c){return BPromise[_0x760d('0xba')]()[_0x760d('0xbb')](cmHopperBlack[_0x760d('0xbc')](_0x542e1c))[_0x760d('0xb4')](loggerCatch('[checkIsBlackList]\x20'));};Dialer[_0x760d('0x1d')][_0x760d('0xbd')]=function(_0x58f5be){return BPromise['resolve']()[_0x760d('0xbb')](cmHopperBlack[_0x760d('0xbd')](_0x58f5be))[_0x760d('0xb4')](loggerCatch(_0x760d('0xbe')));};Dialer['prototype'][_0x760d('0xbf')]=function(_0x2d0a46){return BPromise[_0x760d('0xba')]()[_0x760d('0xbb')](cmHopperHistory['avgHandleTime'](_0x2d0a46))['catch'](loggerCatch(_0x760d('0xc0')));};Dialer[_0x760d('0x1d')][_0x760d('0xc1')]=function(_0x27cea1){return BPromise[_0x760d('0xba')]()[_0x760d('0xbb')](cmHopper[_0x760d('0xc1')](_0x27cea1))[_0x760d('0xb4')](loggerCatch(_0x760d('0xc2')));};Dialer['prototype']['unlockContact']=function(_0x2deea5,_0x36b7fa,_0x10dddf){return BPromise[_0x760d('0xba')]()[_0x760d('0xbb')](cmHopper[_0x760d('0xc3')](_0x2deea5,_0x36b7fa,_0x10dddf))[_0x760d('0xb4')](loggerCatch(_0x760d('0xc4')));};Dialer[_0x760d('0x1d')][_0x760d('0xc5')]=function(_0x1d13ea,_0x8a230,_0xa36b46,_0x543b4a,_0x4b0d27){return BPromise[_0x760d('0xba')]()[_0x760d('0xbb')](cmHopper['getContactDialer'](_0x1d13ea,_0x8a230,_0xa36b46,_0x543b4a))['catch'](function(_0x16c3ae){_0x4b0d27[_0x760d('0xc6')]-=_0xa36b46;_0x4b0d27[_0x760d('0xc6')]=_0x4b0d27[_0x760d('0xc6')]>0x0?_0x4b0d27['temp']:0x0;loggerCatch('[getContactDialer]\x20')(_0x16c3ae);});};Dialer[_0x760d('0x1d')][_0x760d('0xc7')]=function(_0x23466f,_0x4172c3,_0x59d436,_0x2b5614){return BPromise[_0x760d('0xba')]()[_0x760d('0xbb')](cmHopper[_0x760d('0xc7')](_0x23466f,_0x4172c3,_0x59d436))[_0x760d('0xb4')](function(_0x511ba4){_0x2b5614[_0x760d('0xc6')]-=_0x4172c3;_0x2b5614[_0x760d('0xc6')]=_0x2b5614['temp']>0x0?_0x2b5614[_0x760d('0xc6')]:0x0;loggerCatch(_0x760d('0xc8'))(_0x511ba4);});};Dialer[_0x760d('0x1d')][_0x760d('0xc9')]=function(_0x37ea9c){return BPromise['resolve']()[_0x760d('0xbb')](voiceQueueRt[_0x760d('0xc9')](_0x37ea9c))[_0x760d('0xb4')](loggerCatch(_0x760d('0xca')));};Dialer[_0x760d('0x1d')][_0x760d('0xcb')]=function(_0x39d159){return BPromise[_0x760d('0xba')]()['then'](cmHopper[_0x760d('0xcb')](_0x39d159))[_0x760d('0xb4')](loggerCatch(_0x760d('0xcc')));};Dialer['prototype'][_0x760d('0xcd')]=function(_0x292b80){return BPromise[_0x760d('0xba')]()['then'](cmHopperHistory[_0x760d('0xcd')](_0x292b80))[_0x760d('0xb4')](loggerCatch('[createHistory]\x20'));};Dialer[_0x760d('0x1d')][_0x760d('0xb6')]=function(_0x317ffe){if(!_['isUndefined'](_0x317ffe)&&_0x317ffe!==null){if(typeof _0x317ffe[_0x760d('0x73')]!==_0x760d('0x9c')){if(_0x317ffe[_0x760d('0x73')]>0x0){_0x317ffe[_0x760d('0x73')]-=0x1;}else{logger['error'](_0x760d('0xce'));}}}else{logger[_0x760d('0x9a')](_0x760d('0xcf'));}};Dialer['prototype']['loggerHandler']=function(_0x1b38c5,_0x2e8c58){var _0x5d81be=this;return function(_0x364036){_0x5d81be[_0x760d('0xb6')](_0x2e8c58);logger['error'](_0x1b38c5,util[_0x760d('0x99')](_0x364036,{'showHidden':![],'depth':null}));};};Dialer[_0x760d('0x1d')][_0x760d('0xd0')]=function(_0x48deca,_0x2eebb5,_0x21a717){var _0x39a26b={'state':0x19,'statedesc':'notFound'};this[_0x760d('0xb6')](_0x2eebb5);this['saveInDb'](_[_0x760d('0x93')](_0x39a26b,_[_0x760d('0xd1')](_0x21a717,[_0x760d('0xd2'),_0x760d('0xd3'),_0x760d('0xd4'),_0x760d('0xd5'),_0x760d('0xd6')])),'[emptyContact][createHistory]',_0x760d('0xd7'));logger[_0x760d('0x9a')](_0x48deca);};Dialer[_0x760d('0x1d')]['isSuccess']=function(_0x276bbd){return _0x276bbd===_0x760d('0xd8');};Dialer[_0x760d('0x1d')][_0x760d('0xd9')]=function(_0x44746e){return!_[_0x760d('0x41')](_0x44746e)&&_0x44746e&&!_['isUndefined'](_0x44746e[_0x760d('0x45')])&&!_['isUndefined'](_0x44746e[_0x760d('0x79')])&&_0x44746e[_0x760d('0x79')]&&(this['trunks'][util['format'](_0x760d('0xda'),_0x44746e[_0x760d('0x45')])][_0x760d('0xb2')]===_0x760d('0xdb')||this['trunks'][util['format']('SIP/%s',_0x44746e[_0x760d('0x45')])][_0x760d('0xb2')]===_0x760d('0xdc'));};Dialer['prototype'][_0x760d('0xdd')]=function(_0xdf0e06,_0x355374,_0x5e13e5){this[_0x760d('0xcd')](_0xdf0e06)[_0x760d('0xb4')](loggerCatch(_0x355374));this['moveContactManagedDialer'](_0xdf0e06)['catch'](loggerCatch(_0x5e13e5));};Dialer['prototype'][_0x760d('0xde')]=function(_0x27a48d){var _0xf08ddf=this[_0x760d('0x29')][_0x27a48d['uniqueid']];var _0x477a90;if(!_[_0x760d('0xb0')](_0x27a48d)&&!_[_0x760d('0xb0')](_0x27a48d['variable'])&&!_[_0x760d('0xb0')](_0x27a48d[_0x760d('0xdf')][_0x760d('0xe0')])&&_0x27a48d[_0x760d('0xe1')]===_0x760d('0xe2')&&_0xf08ddf){if(_0xf08ddf['type']!==_0x760d('0x7d')&&this[_0x760d('0x21')][_0xf08ddf[_0x760d('0xb7')]]['dialAMDActive']&&_0x27a48d['value']===_0x760d('0xe3')){delete this[_0x760d('0x29')][_0x27a48d[_0x760d('0xe4')]];this[_0x760d('0xb6')](this[_0x760d('0x21')][_0xf08ddf[_0x760d('0xb7')]]);this[_0x760d('0x21')][_0xf08ddf['queue']][_0x760d('0x60')]+=0x1;this[_0x760d('0x21')][_0xf08ddf[_0x760d('0xb7')]][_0x760d('0x5f')]+=0x1;_0x477a90=new Hangup(_0xf08ddf,_0x27a48d);_0x477a90['state']=0x12;_0x477a90[_0x760d('0xaa')]='HangupInAMD';_0x477a90[_0x760d('0xe5')]=_0x760d('0xe6');ami[_0x760d('0x50')](_0x760d('0xe7'),ut[_0x760d('0xe8')](_0x477a90,_0x760d('0xe9')));this[_0x760d('0xdd')](_0x477a90,_0x760d('0xea'),'[syncHangupInAMD]');}if(_0xf08ddf[_0x760d('0x57')]!==_0x760d('0x7d')&&this[_0x760d('0x21')][_0xf08ddf[_0x760d('0xb7')]][_0x760d('0xeb')]&&_0x27a48d[_0x760d('0xec')]===_0x760d('0xed')){var _0x255c9b=this;return new BPromise(function(_0x1c0d81,_0x5cc7c7){delete _0x255c9b[_0x760d('0x29')][_0x27a48d[_0x760d('0xe4')]];_0x255c9b[_0x760d('0xb6')](_0x255c9b[_0x760d('0x21')][_0xf08ddf[_0x760d('0xb7')]]);_0x255c9b['voiceQueues'][_0xf08ddf[_0x760d('0xb7')]]['outboundAnswerCallsDay']+=0x1;_0x255c9b['voiceQueues'][_0xf08ddf[_0x760d('0xb7')]][_0x760d('0x5f')]+=0x1;var _0x2c8df=_0x255c9b[_0x760d('0x21')][_0xf08ddf['queue']];var _0x463d20=new Hangup(_0xf08ddf,_0x27a48d);_0x463d20['state']=0x13;_0x463d20[_0x760d('0xaa')]='Machine';_0x463d20[_0x760d('0xe5')]=_0x760d('0xe6');_0x463d20[_0x760d('0xee')]+=0x1;_0x463d20[_0x760d('0xef')]+=0x1;_0x463d20['amd']=!![];ami['emit'](_0x760d('0xe7'),ut[_0x760d('0xe8')](_0x463d20,_0x760d('0xe9')));_0x255c9b[_0x760d('0xcd')](_0x463d20)[_0x760d('0xb4')](loggerCatch(_0x760d('0xf0')));if(_0x463d20['countbusyretry']+_0x463d20['countcongestionretry']+_0x463d20[_0x760d('0xf1')]+_0x463d20[_0x760d('0xf2')]+_0x463d20['countdropretry']+_0x463d20['countabandonedretry']+_0x463d20[_0x760d('0xee')]+_0x463d20[_0x760d('0xf3')]>=_0x2c8df[_0x760d('0xf4')]){_0x255c9b[_0x760d('0xf5')](_0x463d20,_0x1c0d81,_0x5cc7c7,_0x760d('0xf6'));}else{if(_0x463d20[_0x760d('0xee')]>=_0x2c8df['dialMachineMaxRetry']){_0x255c9b[_0x760d('0xf7')](_0x463d20,_0x1c0d81,_0x5cc7c7,_0x760d('0xf8'));}else{_0x255c9b[_0x760d('0xc1')]({'active':![],'countmachineretry':_0x463d20[_0x760d('0xee')],'scheduledat':moment()[_0x760d('0xf9')](_0x2c8df[_0x760d('0xfa')],_0x760d('0xfb'))[_0x760d('0x7e')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x463d20['ContactId'],'ListId':_0x463d20[_0x760d('0xd3')],'VoiceQueueId':_0x463d20[_0x760d('0xd5')]||undefined,'CampaignId':_0x463d20['CampaignId']||undefined})['catch'](loggerCatch(_0x760d('0xfc')));_0x1c0d81({'reschedule':0x1});}}});}if(_0xf08ddf['type']===_0x760d('0x7d')&&this[_0x760d('0x22')][_0xf08ddf['queue']][_0x760d('0xeb')]&&_0x27a48d[_0x760d('0xec')]===_0x760d('0xe3')){delete this['uniqueId'][_0x27a48d[_0x760d('0xe4')]];this['updateOriginated'](this['campaigns'][_0xf08ddf[_0x760d('0xb7')]]);_0x477a90=new Hangup(_0xf08ddf,_0x27a48d);_0x477a90[_0x760d('0xa9')]=0x12;_0x477a90[_0x760d('0xaa')]=_0x760d('0xfd');_0x477a90[_0x760d('0xe5')]=_0x760d('0xe6');ami[_0x760d('0x50')](_0x760d('0xe7'),ut[_0x760d('0xe8')](_0x477a90,_0x760d('0xe9')));this[_0x760d('0xdd')](_0x477a90,_0x760d('0xfe'),'[syncHangupInAMDIvr]');}if(_0xf08ddf['type']===_0x760d('0x7d')&&this[_0x760d('0x22')][_0xf08ddf[_0x760d('0xb7')]][_0x760d('0xeb')]&&_0x27a48d[_0x760d('0xec')]==='MACHINE'){var _0x255c9b=this;return new BPromise(function(_0x717e1d,_0x1427cf){delete _0x255c9b['uniqueId'][_0x27a48d[_0x760d('0xe4')]];_0x255c9b[_0x760d('0xb6')](_0x255c9b[_0x760d('0x22')][_0xf08ddf['queue']]);_0x255c9b[_0x760d('0x22')][_0xf08ddf[_0x760d('0xb7')]]['outboundAnswerCallsDay']+=0x1;_0x255c9b['campaigns'][_0xf08ddf[_0x760d('0xb7')]]['outboundAnswerAgiCallsDay']+=0x1;var _0x346ba4=_0x255c9b['campaigns'][_0xf08ddf[_0x760d('0xb7')]];var _0x681e=new Hangup(_0xf08ddf,_0x27a48d);_0x681e[_0x760d('0xa9')]=0x13;_0x681e['statedesc']='Machine';_0x681e[_0x760d('0xe5')]='AMD';_0x681e[_0x760d('0xee')]+=0x1;_0x681e[_0x760d('0xef')]+=0x1;_0x681e[_0x760d('0xe9')]=!![];ami[_0x760d('0x50')](_0x760d('0xe7'),ut[_0x760d('0xe8')](_0x681e,_0x760d('0xe9')));_0x255c9b[_0x760d('0xcd')](_0x681e)[_0x760d('0xb4')](loggerCatch(_0x760d('0xf0')));if(_0x681e[_0x760d('0xff')]+_0x681e[_0x760d('0x100')]+_0x681e[_0x760d('0xf1')]+_0x681e[_0x760d('0xf2')]+_0x681e['countdropretry']+_0x681e['countabandonedretry']+_0x681e[_0x760d('0xee')]+_0x681e[_0x760d('0xf3')]>=_0x346ba4[_0x760d('0xf4')]){_0x255c9b[_0x760d('0xf5')](_0x681e,_0x717e1d,_0x1427cf,'reason19\x20machine....');}else{if(_0x681e[_0x760d('0xee')]>=_0x346ba4[_0x760d('0x101')]){_0x255c9b['createStateFinal'](_0x681e,_0x717e1d,_0x1427cf,_0x760d('0xf8'));}else{_0x255c9b['rescheduleContact']({'active':![],'countmachineretry':_0x681e[_0x760d('0xee')],'scheduledat':moment()[_0x760d('0xf9')](_0x346ba4[_0x760d('0xfa')],_0x760d('0xfb'))['format'](_0x760d('0x102')),'ContactId':_0x681e[_0x760d('0xd2')],'ListId':_0x681e['ListId'],'VoiceQueueId':_0x681e[_0x760d('0xd5')]||undefined,'CampaignId':_0x681e[_0x760d('0xd6')]||undefined})[_0x760d('0xb4')](loggerCatch(_0x760d('0xfc')));_0x717e1d({'reschedule':0x1});}}});}}};Dialer[_0x760d('0x1d')][_0x760d('0x37')]=function(_0x538e36){var _0x451c06=this[_0x760d('0x29')][_0x538e36[_0x760d('0xe4')]];var _0x59e4ab=this;var _0x4ec207;if(_0x451c06&&_0x451c06[_0x760d('0x57')]===_0x760d('0x7d')){delete this['uniqueId'][_0x538e36[_0x760d('0xe4')]];this['updateOriginated'](this[_0x760d('0x22')][_0x451c06[_0x760d('0xb7')]]);this[_0x760d('0x22')][_0x451c06[_0x760d('0xb7')]][_0x760d('0x103')]+=0x1;_0x4ec207=new Hangup(_0x451c06,_0x538e36);this[_0x760d('0xcd')](_0x4ec207)['catch'](loggerCatch(_0x760d('0x104')));this[_0x760d('0xcb')](_0x4ec207)[_0x760d('0xb4')](loggerCatch('[syncHangupIvr]'));}if(_0x451c06&&_0x451c06['type']!==_0x760d('0x7d')&&isNotNull(this[_0x760d('0x21')][_0x451c06['queue']]['dialQueueProject'])){delete this['uniqueId'][_0x538e36[_0x760d('0xe4')]];this[_0x760d('0xb6')](this[_0x760d('0x21')][_0x451c06['queue']]);this['voiceQueues'][_0x451c06[_0x760d('0xb7')]][_0x760d('0x60')]+=0x1;this[_0x760d('0x21')][_0x451c06[_0x760d('0xb7')]][_0x760d('0x5f')]+=0x1;_0x4ec207=new Hangup(_0x451c06,_0x538e36);_0x4ec207[_0x760d('0xa9')]=0x10;_0x4ec207[_0x760d('0xaa')]=_0x760d('0x105');_0x4ec207['membername']='AGI';this[_0x760d('0xcd')](_0x4ec207)[_0x760d('0xb4')](loggerCatch('[syncHangupIvr][createHistory]'));this[_0x760d('0xcb')](_0x4ec207)['catch'](loggerCatch(_0x760d('0x106')));}if(_0x451c06&&_0x451c06[_0x760d('0x57')]!=='ivr'&&!isNotNull(this[_0x760d('0x21')][_0x451c06[_0x760d('0xb7')]][_0x760d('0x107')])){delete this['uniqueId'][_0x538e36['uniqueid']];this[_0x760d('0xb6')](this[_0x760d('0x21')][_0x451c06['queue']]);this[_0x760d('0x21')][_0x451c06[_0x760d('0xb7')]][_0x760d('0x69')]+=0x1;_0x4ec207=new Hangup(_0x451c06,_0x538e36);_0x4ec207[_0x760d('0xa9')]=0xc;_0x4ec207[_0x760d('0xaa')]=_0x538e36[_0x760d('0x108')];_0x4ec207[_0x760d('0xe5')]=_0x760d('0x109');this['createHistory'](_0x4ec207)[_0x760d('0xb4')](loggerCatch(_0x760d('0x104')));this[_0x760d('0xcb')](_0x4ec207)[_0x760d('0xb4')](loggerCatch(_0x760d('0x106')));}};Dialer['prototype'][_0x760d('0x35')]=function(_0x59d854){var _0x457f3e=this[_0x760d('0x29')][_0x59d854[_0x760d('0xe4')]];var _0x5c647a=this;if(this[_0x760d('0x21')][_0x59d854['queue']]){if(_0x457f3e&&_0x457f3e[_0x760d('0x57')]!==_0x760d('0x7d')){delete this[_0x760d('0x29')][_0x59d854['uniqueid']];this[_0x760d('0x21')][_0x59d854[_0x760d('0xb7')]][_0x760d('0x60')]+=0x1;var _0x4dd583=new AgentComplete(_0x457f3e,_0x59d854);if(_0x59d854['reason']==='agent'){_0x4dd583[_0x760d('0x10a')]=this[_0x760d('0x21')][_0x59d854['queue']]['dialQueueProject2']&&this[_0x760d('0x21')][_0x59d854['queue']]['dialAgiAfterHangupAgent']?moment()[_0x760d('0x7e')]('YYYY-MM-DD\x20HH:mm:ss'):undefined;}this[_0x760d('0xcd')](_0x4dd583)['catch'](loggerCatch(_0x760d('0x10b')));this[_0x760d('0xcb')](_0x4dd583)[_0x760d('0xb4')](loggerCatch(_0x760d('0x10c')));}}};Dialer['prototype'][_0x760d('0x10d')]=function(_0x29cf9d){if(this['voiceQueues'][_0x29cf9d[_0x760d('0xb7')]]){if(this['uniqueId'][_0x29cf9d[_0x760d('0xe4')]]&&this[_0x760d('0x29')][_0x29cf9d[_0x760d('0xe4')]][_0x760d('0x57')]!==_0x760d('0x7d')){this[_0x760d('0xb6')](this[_0x760d('0x21')][_0x29cf9d['queue']]);this[_0x760d('0x29')][_0x29cf9d['uniqueid']][_0x760d('0x10e')]=moment()[_0x760d('0x7e')](_0x760d('0x102'));}}};Dialer[_0x760d('0x1d')]['queueCallerAbandonCreateState']=function(_0x2fb08e){this[_0x760d('0xcd')](_0x2fb08e)[_0x760d('0xb4')](loggerCatch(_0x760d('0x10b')));this[_0x760d('0xcb')](_0x2fb08e)[_0x760d('0xb4')](loggerCatch(_0x760d('0x10f')));};Dialer[_0x760d('0x1d')][_0x760d('0x32')]=function(_0x22c601){var _0x1c6756=this[_0x760d('0x29')][_0x22c601[_0x760d('0xe4')]];var _0x14a90c=this;if(this['voiceQueues'][_0x22c601[_0x760d('0xb7')]]){if(_0x1c6756&&_0x1c6756[_0x760d('0x57')]!=='ivr'){delete this[_0x760d('0x29')][_0x22c601[_0x760d('0xe4')]];this['updateOriginated'](this[_0x760d('0x21')][_0x22c601['queue']]);_0x1c6756[_0x760d('0x110')]=moment()[_0x760d('0x7e')]('YYYY-MM-DD\x20HH:mm:ss');var _0xb769c=new QueueCallerAbandon(_0x1c6756,_0x22c601);if(getSeconds(_0x1c6756['droptime'],_0x1c6756[_0x760d('0x111')])>=_0x1c6756['dialQueueTimeout']){this[_0x760d('0x21')][_0x22c601['queue']]['predictiveIntervalDroppedCallsTimeout']+=0x1;this['voiceQueues'][_0x22c601[_0x760d('0xb7')]][_0x760d('0x63')]+=0x1;this['voiceQueues'][_0x22c601['queue']][_0x760d('0x70')]+=0x1;_0xb769c[_0x760d('0xa9')]=0xa;_0xb769c[_0x760d('0xaa')]='Drop';_0xb769c['dropreason']='TIMEOUT';_0xb769c[_0x760d('0x10a')]=this[_0x760d('0x21')][_0x22c601[_0x760d('0xb7')]][_0x760d('0x112')]?moment()[_0x760d('0x7e')]('YYYY-MM-DD\x20HH:mm:ss'):undefined;_0xb769c['countdropretry']+=0x1;_0xb769c['countglobal']+=0x1;if(_0xb769c['countdropretry']>=this[_0x760d('0x21')][_0x22c601[_0x760d('0xb7')]]['dialDropMaxRetry']){this[_0x760d('0x113')](_0xb769c);}else{this[_0x760d('0xc1')]({'active':![],'countdropretry':_0xb769c[_0x760d('0x114')],'scheduledat':moment()['add'](this[_0x760d('0x21')][_0x22c601[_0x760d('0xb7')]]['dialDropRetryFrequency'],_0x760d('0xfb'))[_0x760d('0x7e')](_0x760d('0x102')),'ContactId':_0x1c6756['ContactId'],'ListId':_0x1c6756[_0x760d('0xd3')],'VoiceQueueId':_0x1c6756[_0x760d('0xd5')]||undefined,'CampaignId':_0x1c6756['CampaignId']||undefined})[_0x760d('0xb4')](loggerCatch(_0x760d('0x115')));var _0x5aa429=new History(_0xb769c);_0x5aa429[_0x760d('0xa9')]=0xa;_0x5aa429[_0x760d('0xaa')]=_0x760d('0x116');_0x5aa429['starttime']=moment()[_0x760d('0x7e')](_0x760d('0x102'));_0x5aa429[_0x760d('0xab')]=_0x5aa429[_0x760d('0xac')];_0x5aa429[_0x760d('0x117')]=_0xb769c[_0x760d('0x117')];_0x5aa429[_0x760d('0x118')]=_0xb769c['calleridnum'];this[_0x760d('0xcd')](_0x5aa429)[_0x760d('0xb4')](loggerCatch(_0x760d('0x119')));}}else{this[_0x760d('0x21')][_0x22c601[_0x760d('0xb7')]][_0x760d('0x6d')]+=0x1;this['voiceQueues'][_0x22c601[_0x760d('0xb7')]]['outboundDropCallsDayCallersExit']+=0x1;_0xb769c['state']=0xb;_0xb769c[_0x760d('0xaa')]=_0x760d('0x11a');_0xb769c[_0x760d('0x11b')]='CALLEREXIT';_0xb769c['countabandonedretry']+=0x1;_0xb769c[_0x760d('0xef')]+=0x1;if(_0xb769c[_0x760d('0x11c')]>=this[_0x760d('0x21')][_0x22c601[_0x760d('0xb7')]][_0x760d('0x11d')]){this[_0x760d('0x113')](_0xb769c);}else{this['rescheduleContact']({'active':![],'countabandonedretry':_0xb769c[_0x760d('0x11c')],'scheduledat':moment()[_0x760d('0xf9')](this[_0x760d('0x21')][_0x22c601[_0x760d('0xb7')]][_0x760d('0x11e')],_0x760d('0xfb'))['format'](_0x760d('0x102')),'ContactId':_0x1c6756[_0x760d('0xd2')],'ListId':_0x1c6756[_0x760d('0xd3')],'VoiceQueueId':_0x1c6756['VoiceQueueId']||undefined,'CampaignId':_0x1c6756[_0x760d('0xd6')]||undefined})[_0x760d('0xb4')](loggerCatch('[rescheduleContact][Abandoned]'));var _0x5aa429=new History(_0xb769c);_0x5aa429[_0x760d('0xa9')]=0xb;_0x5aa429['statedesc']='Abandoned';_0x5aa429['starttime']=moment()[_0x760d('0x7e')](_0x760d('0x102'));_0x5aa429[_0x760d('0xab')]=_0x5aa429[_0x760d('0xac')];_0x5aa429[_0x760d('0x117')]=_0xb769c['calleridname'];_0x5aa429[_0x760d('0x118')]=_0xb769c[_0x760d('0x118')];this[_0x760d('0xcd')](_0x5aa429)[_0x760d('0xb4')](loggerCatch(_0x760d('0x11f')));}}}}};Dialer['prototype'][_0x760d('0x39')]=function(_0x5ee28f){if(this[_0x760d('0x27')][_0x5ee28f[_0x760d('0xe4')]]){this[_0x760d('0x27')][_0x5ee28f[_0x760d('0xe4')]][_0x760d('0xb3')]=_0x5ee28f[_0x760d('0xb3')];}if(this[_0x760d('0x29')][_0x5ee28f[_0x760d('0xe4')]]){this['uniqueId'][_0x5ee28f[_0x760d('0xe4')]][_0x760d('0xb3')]=_0x5ee28f[_0x760d('0xb3')];}};Dialer['prototype'][_0x760d('0x3c')]=function(_0x5b383f){if(strategy[this['voiceQueues'][this[_0x760d('0x27')][_0x5b383f['actionid']]['queue']][_0x760d('0x52')]]===_0x760d('0x120')){if(this[_0x760d('0x27')][_0x5b383f[_0x760d('0x121')]]&&_['isNil'](this[_0x760d('0x27')][_0x5b383f[_0x760d('0x121')]]['locked'])&&_0x5b383f[_0x760d('0xb2')]==='1'&&_0x5b383f[_0x760d('0x122')]==='0'){if(this[_0x760d('0x23')][_0x5b383f[_0x760d('0x123')]]){if(!this[_0x760d('0x23')][_0x5b383f[_0x760d('0x123')]][_0x760d('0x124')]){this[_0x760d('0x23')][_0x5b383f['stateinterface']][_0x760d('0x124')]=!![];this[_0x760d('0x27')][_0x5b383f[_0x760d('0x121')]]['locked']=!![];this[_0x760d('0x27')][_0x5b383f[_0x760d('0x121')]][_0x760d('0x123')]=_0x5b383f[_0x760d('0x123')];}}}}else if((strategy[this['voiceQueues'][this[_0x760d('0x27')][_0x5b383f[_0x760d('0x121')]][_0x760d('0xb7')]]['strategy']]||_0x760d('0x1c'))===_0x760d('0x1c')){if(this[_0x760d('0x27')][_0x5b383f[_0x760d('0x121')]]){if(this[_0x760d('0x23')][_0x5b383f[_0x760d('0x123')]]){this[_0x760d('0x27')][_0x5b383f[_0x760d('0x121')]]['stateinterface']=_0x5b383f[_0x760d('0x123')];if(_[_0x760d('0xb0')](this[_0x760d('0x2d')][this[_0x760d('0x27')][_0x5b383f['actionid']][_0x760d('0xb7')]])){this[_0x760d('0x2d')][this[_0x760d('0x27')][_0x5b383f[_0x760d('0x121')]]['queue']]=[];}this[_0x760d('0x2d')][this[_0x760d('0x27')][_0x5b383f['actionid']]['queue']]['push'](_[_0x760d('0x93')](_[_0x760d('0xd1')](this[_0x760d('0x27')][_0x5b383f[_0x760d('0x121')]],['idHopper',_0x760d('0x123')]),{'status':_0x5b383f['status'],'paused':_0x5b383f['paused']}));}}}};function unlockQueueStatus(_0x23a089,_0x43ceb0){setTimeout(function(){if(_[_0x760d('0x41')](_0x23a089[_0x760d('0x125')])){loggerBooked[_0x760d('0x9a')](_0x760d('0x126'),_0x43ceb0);}_0x23a089['queueStatusComplete']=!![];loggerBooked[_0x760d('0x84')](_0x760d('0x127'),_0x43ceb0,JSON[_0x760d('0x4c')](_[_0x760d('0xd1')](_0x23a089,[_0x760d('0x45'),'queueStatusComplete'])));},0x1f3);}Dialer[_0x760d('0x1d')]['syncQueueStatusComplete']=function(_0x5d7c1a){var _0x514df7=this;var _0x3dc796=_0x514df7[_0x760d('0x21')][_0x514df7[_0x760d('0x27')][_0x5d7c1a[_0x760d('0x121')]][_0x760d('0xb7')]];if(strategy[this[_0x760d('0x21')][this[_0x760d('0x27')][_0x5d7c1a[_0x760d('0x121')]][_0x760d('0xb7')]][_0x760d('0x52')]]===_0x760d('0x120')){if(this[_0x760d('0x27')][_0x5d7c1a[_0x760d('0x121')]]&&this['actions'][_0x5d7c1a['actionid']][_0x760d('0x123')]){this[_0x760d('0x20')]['run'](this[_0x760d('0x27')][_0x5d7c1a[_0x760d('0x121')]]['idHopper'],this['actions'][_0x5d7c1a[_0x760d('0x121')]]['stateinterface'])['catch'](function(_0x16ee0c){logger[_0x760d('0x9a')]('[Catch][Preview][syncQueueStatusComplete]',util[_0x760d('0x99')](_0x16ee0c,{'showHidden':![],'depth':null}));})[_0x760d('0x128')](function(){_0x514df7[_0x760d('0xb6')](_0x514df7['voiceQueues'][_0x514df7['actions'][_0x5d7c1a[_0x760d('0x121')]][_0x760d('0xb7')]]);_0x514df7[_0x760d('0x23')][_0x514df7[_0x760d('0x27')][_0x5d7c1a[_0x760d('0x121')]][_0x760d('0x123')]][_0x760d('0x124')]=![];delete _0x514df7[_0x760d('0x27')][_0x5d7c1a[_0x760d('0x121')]];unlockQueueStatus(_0x3dc796);});}else{this['updateOriginated'](this[_0x760d('0x21')][this['actions'][_0x5d7c1a[_0x760d('0x121')]][_0x760d('0xb7')]]);this[_0x760d('0xc1')]({'active':![],'ContactId':this[_0x760d('0x27')][_0x5d7c1a[_0x760d('0x121')]]['ContactId'],'ListId':this[_0x760d('0x27')][_0x5d7c1a[_0x760d('0x121')]][_0x760d('0xd3')],'VoiceQueueId':this['actions'][_0x5d7c1a[_0x760d('0x121')]][_0x760d('0xd5')]||undefined,'CampaignId':this[_0x760d('0x27')][_0x5d7c1a[_0x760d('0x121')]][_0x760d('0xd6')]||undefined})[_0x760d('0xb4')](loggerCatch('[unlock][syncQueueStatusComplete]'));delete this[_0x760d('0x27')][_0x5d7c1a[_0x760d('0x121')]];unlockQueueStatus(_0x3dc796);}}else if((strategy[this[_0x760d('0x21')][this[_0x760d('0x27')][_0x5d7c1a[_0x760d('0x121')]][_0x760d('0xb7')]][_0x760d('0x52')]]||_0x760d('0x1c'))===_0x760d('0x1c')){var _0x226244;if(this[_0x760d('0x27')][_0x5d7c1a['actionid']]&&!_['isEmpty'](this[_0x760d('0x2d')][this[_0x760d('0x27')][_0x5d7c1a[_0x760d('0x121')]][_0x760d('0xb7')]])){if(this['queueBookedRR'][_0x514df7[_0x760d('0x27')][_0x5d7c1a['actionid']][_0x760d('0xb7')]]){this[_0x760d('0x2e')][_0x514df7[_0x760d('0x27')][_0x5d7c1a[_0x760d('0x121')]][_0x760d('0xb7')]]=this[_0x760d('0x2e')][this['actions'][_0x5d7c1a[_0x760d('0x121')]][_0x760d('0xb7')]]?this[_0x760d('0x2e')][this[_0x760d('0x27')][_0x5d7c1a[_0x760d('0x121')]][_0x760d('0xb7')]]:this['queueBooked'][this['actions'][_0x5d7c1a[_0x760d('0x121')]][_0x760d('0xb7')]]?this[_0x760d('0x2d')][this[_0x760d('0x27')][_0x5d7c1a[_0x760d('0x121')]]['queue']][_0x760d('0x129')]||0x0:0x0;}this[_0x760d('0x2d')][this[_0x760d('0x27')][_0x5d7c1a[_0x760d('0x121')]][_0x760d('0xb7')]][_0x760d('0x129')]=this[_0x760d('0x2e')][this[_0x760d('0x27')][_0x5d7c1a[_0x760d('0x121')]][_0x760d('0xb7')]];for(var _0xfd69df=0x0;_0xfd69df=0x0;})[_0x760d('0xb4')](myreject(_0x5699c9)));}}else{_0x2f0bdd['push'](ami[_0x760d('0xb1')]({'action':_0x760d('0x147'),'command':util[_0x760d('0x7e')](_0x760d('0x148'),_0x2e8d0a,!_[_0x760d('0x41')](config['timezones'][_0x318d5f])?_0x318d5f:'')})[_0x760d('0xbb')](function(_0x49a899){return _0x49a899['content']['indexOf'](_0x760d('0x149'))>=0x0;})[_0x760d('0xb4')](myreject(_0x5699c9)));}BPromise[_0x760d('0x14a')](_0x2f0bdd)['then'](function(_0x3e5079){var _0x93532f=_['some'](_0x3e5079);if(_0x93532f){return _0x22c12c(_0x93532f);}else{_0x2ee64c[_0x760d('0x42')]=_0xc6fc4b?_0x760d('0x14b'):'INTERVAL_IS_OVERTIME';return _0x5699c9(msgResponse(_0x760d('0x14c'),_0x760d('0x13d'),'Global:\x20'+_0xc6fc4b+'\x20'+_0x5a0eb1+'\x20Interval\x20is\x20overtime:\x20'+util[_0x760d('0x99')](_0x2e8d0a,{'showHidden':![],'depth':null})+_0x760d('0x14d')+_0x318d5f));}})[_0x760d('0xb4')](function(_0x420a7d){return _0x5699c9(msgResponse(_0x760d('0x13b'),_0x760d('0x13d'),JSON[_0x760d('0x4c')](_0x420a7d)));});});};Dialer[_0x760d('0x1d')][_0x760d('0x14e')]=function(_0x2eee57){var _0x3c6f79=this;return function(){switch(_0x2eee57[_0x760d('0x5a')]){case _0x760d('0x14f'):freeVariablesPredictive(_0x2eee57);_0x3c6f79[_0x760d('0x150')](_0x2eee57,0x1);break;case _0x760d('0x151'):freeVariablesPredictive(_0x2eee57);_0x3c6f79[_0x760d('0x150')](_0x2eee57,_0x2eee57['dialPowerLevel']);break;case _0x760d('0x9'):_0x3c6f79[_0x760d('0x9')](_0x2eee57);break;case'booked':freeVariablesPredictive(_0x2eee57);_0x3c6f79[_0x760d('0x150')](_0x2eee57,0x1);break;default:freeVariablesPredictive(_0x2eee57);logger[_0x760d('0x9a')](_0x760d('0x152'),_0x2eee57[_0x760d('0x45')],_0x760d('0x153'));}};};Dialer[_0x760d('0x1d')]['launchHandleIvr']=function(_0x4ad1b4){var _0x493187=this;return function(){_0x493187[_0x760d('0x154')](_0x4ad1b4);};};Dialer[_0x760d('0x1d')][_0x760d('0xb')]=function(_0x33804b){var _0x4e61a7=this;if(isNotPreview(_0x33804b[_0x760d('0x5a')])){if(isVoiceQueueOutbound(_0x33804b[_0x760d('0x57')])&&isActive(_0x33804b[_0x760d('0x59')])){_0x33804b[_0x760d('0xa2')]=!![];BPromise[_0x760d('0xba')]()[_0x760d('0xbb')](checkIsLoggedIn(_0x33804b,_0x33804b[_0x760d('0x155')]))[_0x760d('0xbb')](checkIsActive(_0x33804b,_0x33804b['dialActive']))[_0x760d('0xbb')](checkInterval(_0x33804b))[_0x760d('0xbb')](_0x4e61a7[_0x760d('0x138')](_0x33804b))['then'](_0x4e61a7['checkIfTime'](_0x33804b['dialGlobalInterval'],_0x33804b[_0x760d('0x156')],_0x33804b['name'],_0x33804b))[_0x760d('0xbb')](_0x4e61a7[_0x760d('0x13c')](_0x33804b[_0x760d('0x47')],_0x33804b['dialTimezone'],_0x33804b['name'],_0x33804b))['then'](_0x4e61a7[_0x760d('0x14e')](_0x33804b))['catch'](loggerCatchQueueSummary(_0x760d('0x157'),_0x33804b));}else{notSendMessagesQueue(_0x33804b);}}else{freeVariablesPredictive(_0x33804b);}};Dialer[_0x760d('0x1d')][_0x760d('0x137')]=function(){var _0x51c442=this;var _0x561ea7;for(var _0x490df0 in this['campaigns']){if(typeof this[_0x760d('0x22')][_0x490df0]!=='undefined'){_0x561ea7=this[_0x760d('0x22')][_0x490df0];if(isCampaignIvr(_0x561ea7[_0x760d('0x57')])&&isActive(_0x561ea7['active'])){_0x561ea7['sendMessageOneNotActive']=!![];BPromise['resolve']()['then'](checkIsActive(_0x561ea7,_0x561ea7['active']))['then'](checkInterval(_0x561ea7))['then'](_0x51c442[_0x760d('0x138')](_0x561ea7))[_0x760d('0xbb')](_0x51c442['checkIfTime'](_0x561ea7[_0x760d('0x158')],_0x561ea7[_0x760d('0x156')],_0x561ea7[_0x760d('0x45')],_0x561ea7))[_0x760d('0xbb')](_0x51c442[_0x760d('0x13c')](_0x561ea7[_0x760d('0x47')],_0x561ea7[_0x760d('0x156')],_0x561ea7[_0x760d('0x45')],_0x561ea7))[_0x760d('0xbb')](_0x51c442[_0x760d('0x159')](_0x561ea7))[_0x760d('0xb4')](loggerCatchQueueSummary('[syncCampaigns]',_0x561ea7));}else{notSendMessagesCampaign(_0x561ea7);}}}};function getCallerIdRandom(_0x348ad9,_0x4b92f0){var _0x3bbbbe;var _0x536477;var _0x2239ad;if(_0x4b92f0<=0x0){_0x4b92f0=0x1;}_0x3bbbbe=new RegExp('\x5cw{0,'+_0x4b92f0+'}$');_0x536477=Math[_0x760d('0x15a')](0xa,_0x4b92f0-0x1);_0x2239ad=Math[_0x760d('0x15a')](0xa,_0x4b92f0)-0x1;return util['format']('%s',_[_0x760d('0x15b')](_0x348ad9,_0x3bbbbe,_[_0x760d('0x15c')](_0x536477,_0x2239ad)));}function extractCalleridName(_0x2a804b){var _0x47f31e=_0x2a804b[_0x760d('0x15d')](/"(.*?)"/);return _0x47f31e?_0x47f31e[0x1]:_0x2a804b;}function extractCalleridNumber(_0xad423f){var _0x599376=_0xad423f[_0x760d('0x15d')](/<(.*?)>/);return _0x599376?_0x599376[0x1]:_0xad423f;}Dialer[_0x760d('0x1d')][_0x760d('0x15e')]=function(_0x1c7525,_0x1109e1){var _0x5736e6=this;var _0x3147a0=uuid['v4']();this[_0x760d('0x27')][_0x3147a0]=new Action(_0x1c7525,_0x1109e1,_0x3147a0);return new BPromise(function(_0x48da6c,_0x549df7){if(_[_0x760d('0x41')](_0x1c7525)&&typeof _0x1c7525!=='object'){return _0x549df7(msgResponse(_0x760d('0x15f'),'Failure',_0x760d('0x160')));}if(_[_0x760d('0x41')](_0x1109e1[_0x760d('0x161')][_0x760d('0x162')])||_0x1109e1[_0x760d('0x161')][_0x760d('0x162')]===null){return _0x549df7(msgResponse(_0x760d('0x15f'),_0x760d('0x13d'),_0x760d('0x163')));}var _0x5e6cb5={'XMD-CALLERID':_0x5736e6[_0x760d('0x27')][_0x3147a0][_0x760d('0x164')](),'XMD-AGI':_0x1c7525[_0x760d('0x107')]?util[_0x760d('0x7e')]('\x22agi://%s/square,%s\x22',ipAgi,_0x1c7525[_0x760d('0x107')]):'NONE','XMD-AGIAFTER':_0x1c7525[_0x760d('0x112')]?util[_0x760d('0x7e')](_0x760d('0x165'),ipAgi,_0x1c7525['dialQueueProject2']):_0x760d('0x166'),'XMD-QUEUE':_0x1c7525['type']==='outbound'?util[_0x760d('0x7e')]('\x22%s,%s%s,,,%s\x22',_0x1c7525[_0x760d('0x45')],_0x1c7525[_0x760d('0x167')]||'',_0x1c7525[_0x760d('0x168')]?'c':'',_0x1c7525[_0x760d('0x169')]||0x3):_0x760d('0x166'),'XMD-CONTACTID':_0x1109e1['ContactId'],'XMD-CDRTYPE':'dialer','CALLERID(all)':_0x5736e6[_0x760d('0x27')][_0x3147a0][_0x760d('0x164')](),'XMD-AMD':_0x1c7525[_0x760d('0xeb')]?'ACTIVE':_0x760d('0x166'),'XMD-DESTINATION':_0x760d('0xe2')};if(_0x1c7525[_0x760d('0xeb')]){_0x5e6cb5[_0x760d('0x16a')]=_0x1c7525[_0x760d('0x16b')]||0x9c4;_0x5e6cb5[_0x760d('0x16c')]=_0x1c7525[_0x760d('0x16d')]||0x5dc;_0x5e6cb5[_0x760d('0x16e')]=_0x1c7525[_0x760d('0x16f')]||0x320;_0x5e6cb5['XMD-AMDTOTALANALYSISTIME']=_0x1c7525[_0x760d('0x170')]||0x1388;_0x5e6cb5['XMD-AMDMINWORDLENGTH']=_0x1c7525[_0x760d('0x171')]||0x64;_0x5e6cb5[_0x760d('0x172')]=_0x1c7525['dialAMDBetweenWordsSilence']||0x32;_0x5e6cb5[_0x760d('0x173')]=_0x1c7525[_0x760d('0x174')]||0x3;_0x5e6cb5[_0x760d('0x175')]=_0x1c7525[_0x760d('0x176')]||0x100;_0x5e6cb5[_0x760d('0x177')]=_0x1c7525[_0x760d('0x178')]||0x1388;}if(_0x1c7525['type']===_0x760d('0x51')){_0x5e6cb5['XMD-VOICEQUEUEID']=_0x1109e1[_0x760d('0xd5')];}else{_0x5e6cb5[_0x760d('0x179')]=_0x1109e1['CampaignId'];}for(var _0x4bf5c5 in _0x1109e1[_0x760d('0x161')]){if(typeof _0x1109e1[_0x760d('0x161')][_0x4bf5c5]!==_0x760d('0x9c')){if(isNotNull(_0x1109e1['Contact'][_0x4bf5c5])&&_0x4bf5c5!=='id'&&_0x4bf5c5!==_0x760d('0x17a')&&_0x4bf5c5!==_0x760d('0x17b')&&_0x4bf5c5!==_0x760d('0x17c')){_0x5e6cb5[util[_0x760d('0x7e')]('%s%s',_0x760d('0x17d'),_[_0x760d('0x17e')](_0x4bf5c5))]=_0x1109e1[_0x760d('0x161')][_0x4bf5c5];}}}var _0x578597=_0x5736e6[_0x760d('0xd9')](_0x1c7525[_0x760d('0x78')])?getCallerId(_0x1c7525[_0x760d('0x78')]['callerid'],_0x1c7525[_0x760d('0x5b')],_0x1c7525[_0x760d('0x17f')]>0x0?getCallerIdRandom(_0x1c7525[_0x760d('0x5c')],_0x1c7525[_0x760d('0x17f')]):_0x1c7525[_0x760d('0x5c')]):getCallerId(_['isNil'](_0x1c7525['TrunkBackup'])?_0x1c7525['Trunk']['callerid']:_0x1c7525[_0x760d('0x139')][_0x760d('0x7a')],_0x1c7525[_0x760d('0x5b')],_0x1c7525['dialRandomLastDigitCallerIdNumber']>0x0?getCallerIdRandom(_0x1c7525[_0x760d('0x5c')],_0x1c7525[_0x760d('0x17f')]):_0x1c7525[_0x760d('0x5c')]);if(_0x578597){_0x5e6cb5[_0x760d('0x180')]=_0x5736e6[_0x760d('0x27')][_0x3147a0][_0x760d('0x181')]=extractCalleridName(_0x578597);_0x5e6cb5['XMD-ORIGINATECALLERIDNUM']=_0x5736e6[_0x760d('0x27')][_0x3147a0]['originatecalleridnum']=extractCalleridNumber(_0x578597);}return ami[_0x760d('0xb1')]({'actionid':_0x3147a0,'action':_0x760d('0x15f'),'channel':_0x5736e6[_0x760d('0xd9')](_0x1c7525[_0x760d('0x78')])?util[_0x760d('0x7e')](_0x760d('0x182'),_0x1c7525[_0x760d('0x78')][_0x760d('0x45')],isNotNull(_0x1c7525[_0x760d('0x5e')])?_0x1c7525[_0x760d('0x5e')][_0x760d('0x183')]()||'':'',_0x1c7525[_0x760d('0x184')]>0x0?_0x1109e1[_0x760d('0x161')][_0x760d('0x162')]['substring'](_0x1c7525['dialCutDigit']):_0x1109e1['Contact'][_0x760d('0x162')]):util[_0x760d('0x7e')](_0x760d('0x182'),_[_0x760d('0xb0')](_0x1c7525[_0x760d('0x139')])?_0x1c7525[_0x760d('0x78')][_0x760d('0x45')]:_0x1c7525[_0x760d('0x139')][_0x760d('0x45')],isNotNull(_0x1c7525['dialPrefix'])?_0x1c7525['dialPrefix']['trim']()||'':'',_0x1c7525[_0x760d('0x184')]>0x0?_0x1109e1[_0x760d('0x161')][_0x760d('0x162')]['substring'](_0x1c7525[_0x760d('0x184')]):_0x1109e1['Contact'][_0x760d('0x162')]),'callerid':_0x578597,'Exten':_0x760d('0xe2'),'Context':'from-sip','Priority':'1','variable':_0x5e6cb5,'timeout':(_0x1c7525[_0x760d('0x5d')]||0x1e)*0x3e8,'async':!![],'channelid':_0x3147a0})[_0x760d('0xbb')](function(_0xaa591b){return _0x48da6c(_0xaa591b);})[_0x760d('0xb4')](function(_0x33626e){_0x1c7525[_0x760d('0x66')]+=0x1;var _0x12b576=new History(_0x5736e6[_0x760d('0x27')][_0x3147a0]);logger[_0x760d('0x9a')](util[_0x760d('0x7e')]('[originateError]:\x20%s',JSON['stringify'](_0x33626e)));_0x12b576[_0x760d('0xa9')]=0xe;_0x12b576[_0x760d('0xaa')]=_0x760d('0x185');_0x12b576[_0x760d('0xac')]=moment()[_0x760d('0x7e')](_0x760d('0x102'));_0x12b576['endtime']=_0x12b576[_0x760d('0xac')];_0x5736e6[_0x760d('0xcd')](_0x12b576)[_0x760d('0xb4')](loggerCatch(_0x760d('0x186')));_0x5736e6['moveContactManagedDialer'](_0x12b576)[_0x760d('0xb4')](loggerCatch(_0x760d('0x186')))[_0x760d('0x128')](function(){delete _0x5736e6['actions'][_0x3147a0];return _0x549df7(msgResponse(_0x760d('0x15f'),_0x760d('0x4b'),_0x760d('0x187')));});});});};Dialer[_0x760d('0x1d')][_0x760d('0x33')]=function(_0x283172){var _0x4082bb=this[_0x760d('0x27')][_0x283172[_0x760d('0x121')]];if(_0x4082bb){delete this[_0x760d('0x27')][_0x283172[_0x760d('0x121')]];_0x4082bb[_0x760d('0x111')]=moment()[_0x760d('0x7e')](_0x760d('0x102'));var _0x4c4ab5=_0x4082bb[_0x760d('0x57')]===_0x760d('0x7d')?this[_0x760d('0x22')][_0x4082bb[_0x760d('0xb7')]]:this[_0x760d('0x21')][_0x4082bb['getQueue']()];if(!this[_0x760d('0x188')](_0x283172[_0x760d('0x189')])){this[_0x760d('0xb6')](_0x4c4ab5);return this[_0x760d('0x18a')](_0x4082bb,_0x4c4ab5,_0x283172)[_0x760d('0xb4')](loggerCatch('[callProgressDetecting]\x20'));}this[_0x760d('0x29')][_0x283172[_0x760d('0xe4')]]=_0x4082bb;}};Dialer['prototype']['checkRetriveMax']=function(_0x38512b,_0x3e4aff,_0x6c194f){var _0x36e4d2=new History(_0x3e4aff);if(_0x36e4d2['countbusyretry']+_0x36e4d2[_0x760d('0x100')]+_0x36e4d2['countnoanswerretry']+_0x36e4d2['countnosuchnumberretry']+_0x36e4d2[_0x760d('0x114')]+_0x36e4d2[_0x760d('0x11c')]+_0x36e4d2[_0x760d('0xee')]+_0x36e4d2[_0x760d('0xf3')]>=_0x6c194f['dialGlobalMaxRetry']-0x1){return!![];}switch(_0x38512b){case 0x3:if(_0x36e4d2[_0x760d('0xf1')]>=_0x6c194f[_0x760d('0x18b')]-0x1){return!![];}this['rescheduleContact']({'active':![],'countnoanswerretry':_0x36e4d2[_0x760d('0xf1')]+=0x1,'scheduledat':moment()[_0x760d('0xf9')](_0x6c194f[_0x760d('0x18c')],_0x760d('0xfb'))['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x36e4d2[_0x760d('0xd2')],'ListId':_0x36e4d2[_0x760d('0xd3')],'VoiceQueueId':_0x36e4d2[_0x760d('0xd5')]||undefined,'CampaignId':_0x36e4d2[_0x760d('0xd6')]||undefined})['catch'](loggerCatch(_0x760d('0x18d')));break;case 0x5:if(_0x36e4d2['countbusyretry']>=_0x6c194f[_0x760d('0x18e')]-0x1){return!![];}this[_0x760d('0xc1')]({'active':![],'countbusyretry':_0x36e4d2[_0x760d('0xff')]+=0x1,'scheduledat':moment()[_0x760d('0xf9')](_0x6c194f['dialBusyRetryFrequency'],'minutes')['format'](_0x760d('0x102')),'ContactId':_0x36e4d2['ContactId'],'ListId':_0x36e4d2[_0x760d('0xd3')],'VoiceQueueId':_0x36e4d2['VoiceQueueId']||undefined,'CampaignId':_0x36e4d2[_0x760d('0xd6')]||undefined})[_0x760d('0xb4')](loggerCatch(_0x760d('0x18f')));break;case 0x8:if(_0x36e4d2['countcongestionretry']>=_0x6c194f[_0x760d('0x190')]-0x1){return!![];}this[_0x760d('0xc1')]({'active':![],'countcongestionretry':_0x36e4d2['countcongestionretry']+=0x1,'scheduledat':moment()[_0x760d('0xf9')](_0x6c194f[_0x760d('0x191')],'minutes')[_0x760d('0x7e')](_0x760d('0x102')),'ContactId':_0x36e4d2[_0x760d('0xd2')],'ListId':_0x36e4d2[_0x760d('0xd3')],'VoiceQueueId':_0x36e4d2[_0x760d('0xd5')]||undefined,'CampaignId':_0x36e4d2[_0x760d('0xd6')]||undefined})['catch'](loggerCatch(_0x760d('0x192')));break;case 0x0:if(_0x36e4d2[_0x760d('0xf2')]>=_0x6c194f['dialNoSuchNumberMaxRetry']-0x1){return!![];}else{this['rescheduleContact']({'active':![],'countnosuchnumberretry':_0x36e4d2[_0x760d('0xf2')]+=0x1,'scheduledat':moment()[_0x760d('0xf9')](_0x6c194f[_0x760d('0x193')],_0x760d('0xfb'))[_0x760d('0x7e')](_0x760d('0x102')),'ContactId':_0x36e4d2[_0x760d('0xd2')],'ListId':_0x36e4d2['ListId'],'VoiceQueueId':_0x36e4d2[_0x760d('0xd5')]||undefined,'CampaignId':_0x36e4d2['CampaignId']||undefined})[_0x760d('0xb4')](loggerCatch('[rescheduleContact][NoSuchNumber]'));}break;case 0xa:if(_0x36e4d2[_0x760d('0x114')]>=_0x6c194f[_0x760d('0x194')]-0x1){return!![];}this[_0x760d('0xc1')]({'active':![],'countdropretry':_0x36e4d2[_0x760d('0x114')]+=0x1,'scheduledat':moment()[_0x760d('0xf9')](_0x6c194f['dialDropRetryFrequency'],'minutes')[_0x760d('0x7e')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x36e4d2[_0x760d('0xd2')],'ListId':_0x36e4d2[_0x760d('0xd3')],'VoiceQueueId':_0x36e4d2['VoiceQueueId']||undefined,'CampaignId':_0x36e4d2[_0x760d('0xd6')]||undefined})[_0x760d('0xb4')](loggerCatch('[rescheduleContact][Drop]'));break;case 0xb:if(_0x36e4d2[_0x760d('0x11c')]>=_0x6c194f[_0x760d('0x11d')]-0x1){return!![];}this[_0x760d('0xc1')]({'active':![],'countabandonedretry':_0x36e4d2[_0x760d('0x11c')]+=0x1,'scheduledat':moment()[_0x760d('0xf9')](_0x6c194f[_0x760d('0x11e')],_0x760d('0xfb'))[_0x760d('0x7e')](_0x760d('0x102')),'ContactId':_0x36e4d2['ContactId'],'ListId':_0x36e4d2[_0x760d('0xd3')],'VoiceQueueId':_0x36e4d2[_0x760d('0xd5')]||undefined,'CampaignId':_0x36e4d2[_0x760d('0xd6')]||undefined})[_0x760d('0xb4')](loggerCatch(_0x760d('0x195')));break;case 0x13:if(_0x36e4d2['countmachineretry']>=_0x6c194f[_0x760d('0x101')]-0x1){return!![];}this['rescheduleContact']({'active':![],'countmachineretry':_0x36e4d2[_0x760d('0xee')]+=0x1,'scheduledat':moment()[_0x760d('0xf9')](_0x6c194f[_0x760d('0xfa')],'minutes')[_0x760d('0x7e')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x36e4d2[_0x760d('0xd2')],'ListId':_0x36e4d2[_0x760d('0xd3')],'VoiceQueueId':_0x36e4d2['VoiceQueueId']||undefined,'CampaignId':_0x36e4d2[_0x760d('0xd6')]||undefined})[_0x760d('0xb4')](loggerCatch(_0x760d('0xfc')));break;case 0x14:if(_0x36e4d2[_0x760d('0xf3')]>=_0x6c194f[_0x760d('0x196')]-0x1){return!![];}this[_0x760d('0xc1')]({'active':![],'countagentrejectretry':_0x36e4d2['countagentrejectretry']+=0x1,'scheduledat':moment()[_0x760d('0xf9')](_0x6c194f[_0x760d('0x197')],'minutes')[_0x760d('0x7e')](_0x760d('0x102')),'ContactId':_0x36e4d2['ContactId'],'ListId':_0x36e4d2[_0x760d('0xd3')],'VoiceQueueId':_0x36e4d2['VoiceQueueId']||undefined,'CampaignId':_0x36e4d2[_0x760d('0xd6')]||undefined})['catch'](loggerCatch(_0x760d('0x198')));break;default:return!![];}};Dialer[_0x760d('0x1d')][_0x760d('0x18a')]=function(_0x20a980,_0x5efb40,_0xfab40b){var _0x4fbb0f=this;var _0x4c7a9e=new History(_0x20a980);return new BPromise(function(_0x567ae6,_0x365680){if(_[_0x760d('0x41')](_0x5efb40)&&typeof _0x5efb40!==_0x760d('0x199')){return _0x365680(msgResponse(_0x760d('0x19a'),_0x760d('0x13d'),'entity\x20is\x20undefine'));}if(_[_0x760d('0x41')](_0xfab40b)&&typeof _0xfab40b!=='object'){return _0x365680(msgResponse(_0x760d('0x19a'),_0x760d('0x13d'),'evt\x20is\x20undefine'));}switch(_0xfab40b[_0x760d('0x19b')]){case'0':_0x5efb40[_0x760d('0x65')]+=0x1;_0x4c7a9e[_0x760d('0xa9')]=0x0;_0x4c7a9e[_0x760d('0xaa')]=_0x760d('0x19c');_0x4c7a9e[_0x760d('0xf2')]+=0x1;_0x4c7a9e[_0x760d('0xef')]+=0x1;ami[_0x760d('0x50')](_0x760d('0x19d'),ut[_0x760d('0xe8')](_0x20a980,'nosuchnumber'));_0x4fbb0f[_0x760d('0xcd')](_0x4c7a9e)['catch'](loggerCatch(_0x760d('0xf0')));if(_0x4fbb0f[_0x760d('0x19e')](0x0,_0x20a980,_0x5efb40)){if(_0x4c7a9e['countnosuchnumberretry']>=_0x5efb40['dialNoSuchNumberMaxRetry']){_0x4fbb0f[_0x760d('0xf7')](_0x4c7a9e,_0x567ae6,_0x365680,_0x760d('0x19f'));}else{_0x4fbb0f[_0x760d('0xf5')](_0x4c7a9e,_0x567ae6,_0x365680,_0x760d('0x19f'));}}break;case'3':_0x5efb40[_0x760d('0x64')]+=0x1;_0x4c7a9e[_0x760d('0xa9')]=0x3;_0x4c7a9e[_0x760d('0xaa')]=_0x760d('0x1a0');_0x4c7a9e[_0x760d('0xf1')]+=0x1;_0x4c7a9e[_0x760d('0xef')]+=0x1;ami[_0x760d('0x50')](_0x760d('0x1a1'),ut[_0x760d('0xe8')](_0x20a980,_0x760d('0x1a2')));_0x4fbb0f[_0x760d('0xcd')](_0x4c7a9e)[_0x760d('0xb4')](loggerCatch('[syncAgentComplete][createHistory][3]'));if(_0x4fbb0f['checkRetriveMax'](0x3,_0x20a980,_0x5efb40)){if(_0x4c7a9e[_0x760d('0xf1')]>=_0x5efb40['dialNoAnswerMaxRetry']){_0x4fbb0f[_0x760d('0xf7')](_0x4c7a9e,_0x567ae6,_0x365680,_0x760d('0x1a3'));}else{_0x4fbb0f[_0x760d('0xf5')](_0x4c7a9e,_0x567ae6,_0x365680,_0x760d('0x1a3'));}}break;case'5':_0x5efb40['outboundBusyCallsDay']+=0x1;_0x4c7a9e[_0x760d('0xa9')]=0x5;_0x4c7a9e[_0x760d('0xaa')]='Busy';_0x4c7a9e[_0x760d('0xff')]+=0x1;_0x4c7a9e['countglobal']+=0x1;ami['emit'](_0x760d('0x1a4'),ut[_0x760d('0xe8')](_0x20a980,_0x760d('0x1a5')));_0x4fbb0f[_0x760d('0xcd')](_0x4c7a9e)[_0x760d('0xb4')](loggerCatch('[syncAgentComplete][createHistory][5]'));if(_0x4fbb0f['checkRetriveMax'](0x5,_0x20a980,_0x5efb40)){if(_0x4c7a9e[_0x760d('0xff')]>=_0x5efb40[_0x760d('0x18e')]){_0x4fbb0f[_0x760d('0xf7')](_0x4c7a9e,_0x567ae6,_0x365680,_0x760d('0x1a6'));}else{_0x4fbb0f['stateGlobal'](_0x4c7a9e,_0x567ae6,_0x365680,_0x760d('0x1a6'));}}break;case'8':_0x5efb40[_0x760d('0x61')]+=0x1;_0x4c7a9e[_0x760d('0xa9')]=0x8;_0x4c7a9e['statedesc']=_0x760d('0x1a7');_0x4c7a9e[_0x760d('0x100')]+=0x1;_0x4c7a9e[_0x760d('0xef')]+=0x1;ami[_0x760d('0x50')](_0x760d('0x1a8'),ut[_0x760d('0xe8')](_0x20a980,_0x760d('0x1a9')));_0x4fbb0f[_0x760d('0xcd')](_0x4c7a9e)[_0x760d('0xb4')](loggerCatch(_0x760d('0x1aa')));if(_0x4fbb0f[_0x760d('0x19e')](0x8,_0x20a980,_0x5efb40)){if(_0x4c7a9e[_0x760d('0x100')]>=_0x5efb40[_0x760d('0x190')]){_0x4fbb0f[_0x760d('0xf7')](_0x4c7a9e,_0x567ae6,_0x365680,'reason\x208\x20congestion');}else{_0x4fbb0f['stateGlobal'](_0x4c7a9e,_0x567ae6,_0x365680,'reason\x208\x20congestion');}}break;case'11':_0x5efb40['outboundAbandonedCallsDay']+=0x1;_0x4c7a9e[_0x760d('0xa9')]=0xb;_0x4c7a9e[_0x760d('0xaa')]=_0x760d('0x11a');_0x4c7a9e[_0x760d('0x11c')]+=0x1;_0x4c7a9e[_0x760d('0xef')]+=0x1;_0x4fbb0f[_0x760d('0xcd')](_0x4c7a9e)[_0x760d('0xb4')](loggerCatch('[syncAgentComplete][createHistory][11]'));if(_0x4fbb0f['checkRetriveMax'](0xb,_0x20a980,_0x5efb40)){if(_0x4c7a9e[_0x760d('0x11c')]>=_0x5efb40[_0x760d('0x11d')]){_0x4fbb0f[_0x760d('0xf7')](_0x4c7a9e,_0x567ae6,_0x365680,_0x760d('0x1ab'));}else{_0x4fbb0f[_0x760d('0xf5')](_0x4c7a9e,_0x567ae6,_0x365680,_0x760d('0x1ab'));}}break;case'20':_0x5efb40[_0x760d('0x68')]+=0x1;_0x4c7a9e['state']=0x14;_0x4c7a9e[_0x760d('0xaa')]=_0x760d('0x1ac');_0x4c7a9e[_0x760d('0xf3')]+=0x1;_0x4c7a9e['countglobal']+=0x1;ami[_0x760d('0x50')]('custom:agentreject',ut[_0x760d('0xe8')](_0x20a980,'agentreject'));_0x4fbb0f['createHistory'](_0x4c7a9e)[_0x760d('0xb4')](loggerCatch(_0x760d('0x1ad')));if(_0x4fbb0f[_0x760d('0x19e')](0x14,_0x20a980,_0x5efb40)){if(_0x4c7a9e[_0x760d('0xf3')]>=_0x5efb40[_0x760d('0x196')]){_0x4fbb0f[_0x760d('0xf7')](_0x4c7a9e,_0x567ae6,_0x365680,_0x760d('0x1ae'));}else{_0x4fbb0f[_0x760d('0xf5')](_0x4c7a9e,_0x567ae6,_0x365680,_0x760d('0x1ae'));}}break;default:_0x5efb40[_0x760d('0x69')]+=0x1;_0x4c7a9e['state']=0xc;_0x4c7a9e[_0x760d('0xaa')]=_0xfab40b[_0x760d('0x19b')];_0x4fbb0f['createHistory'](_0x4c7a9e)[_0x760d('0xb4')](loggerCatch(_0x760d('0x1af')));if(_0x4fbb0f['checkRetriveMax'](_0xfab40b[_0x760d('0x19b')],_0x20a980,_0x5efb40)){if(_0x4c7a9e[_0x760d('0xff')]+_0x4c7a9e[_0x760d('0x100')]+_0x4c7a9e['countnoanswerretry']+_0x4c7a9e[_0x760d('0xf2')]+_0x4c7a9e[_0x760d('0x114')]+_0x4c7a9e[_0x760d('0x11c')]+_0x4c7a9e[_0x760d('0xee')]+_0x4c7a9e['countagentrejectretry']>=_0x5efb40['dialGlobalMaxRetry']){_0x4fbb0f[_0x760d('0xf5')](_0x4c7a9e,_0x567ae6,_0x365680,_0xfab40b['reason']);}else{_0x4fbb0f[_0x760d('0xf7')](_0x4c7a9e,_0x567ae6,_0x365680,_0xfab40b[_0x760d('0x19b')]);}}}});};Dialer[_0x760d('0x1d')][_0x760d('0xf5')]=function(_0x1514c4,_0x2ba668,_0x20f3ca,_0x24f329){var _0x2b2659=new Final(_0x1514c4);_0x2b2659[_0x760d('0xa9')]=0xf;_0x2b2659[_0x760d('0xaa')]=_0x760d('0x1b0');this[_0x760d('0xf7')](_0x2b2659,_0x2ba668,_0x20f3ca,_0x24f329);};Dialer[_0x760d('0x1d')][_0x760d('0xf7')]=function(_0x2ef610,_0x2592b8,_0x30a2ba,_0x484924){this['moveContactManagedDialer'](_0x2ef610)[_0x760d('0xbb')](function(){return _0x2592b8(msgResponse('[callProgressDetecting]',_0x760d('0xd8'),_0x484924));})[_0x760d('0xb4')](function(){return _0x30a2ba(msgResponse(_0x760d('0x1b1'),_0x760d('0x13d'),'contact\x20not\x20moved'));});};Dialer[_0x760d('0x1d')][_0x760d('0x9')]=function(_0x40ddd4){var _0x21c7ea=_0x40ddd4[_0x760d('0x1b2')]/0x64;var _0x4fe0e1=_0x40ddd4[_0x760d('0x63')]/(_0x40ddd4[_0x760d('0x63')]+_0x40ddd4['outboundAnswerCallsDay']);var _0x29cff4=Math[_0x760d('0x1b3')](_0x40ddd4['predictiveIntervalAvailable']*(_0x40ddd4[_0x760d('0x1b4')]/0x64));var _0x4d1278=Math['round'](_0x40ddd4[_0x760d('0x1b5')]*(_0x40ddd4[_0x760d('0x1b6')]/0x64));var _0x30f5b8=_0x40ddd4[_0x760d('0x53')]+_0x40ddd4[_0x760d('0x55')];var _0x351014=Math['floor'](_0x40ddd4[_0x760d('0x74')]*_0x40ddd4[_0x760d('0x91')]*_0x40ddd4[_0x760d('0x71')]*_0x40ddd4['predictiveIntervalMultiplicativeFactor']);if(_[_0x760d('0x41')](_0x40ddd4[_0x760d('0x2b')])){if(!_[_0x760d('0x41')](_0x40ddd4['startPredictive'])){_0x40ddd4[_0x760d('0x77')]=undefined;loggerPredictive[_0x760d('0x9a')]('[startMethodPredictive][StartProgressive]',_0x760d('0x1b7'));}if(!_[_0x760d('0x41')](_0x40ddd4[_0x760d('0x95')])){loggerPredictive[_0x760d('0x9a')]('[startMethodPredictive][StartProgressive]',_0x760d('0x1b8'));clearInterval(_0x40ddd4[_0x760d('0x95')]);_0x40ddd4[_0x760d('0x95')]=undefined;}_0x40ddd4[_0x760d('0x2b')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive[_0x760d('0x84')](_0x40ddd4['name'],_0x760d('0x1b9'),_0x40ddd4['startProgressive']);this['handlePower'](_0x40ddd4,0x1);}else if(ifInterval(_0x40ddd4[_0x760d('0x1ba')],_0x40ddd4[_0x760d('0x2b')])){this[_0x760d('0x150')](_0x40ddd4,0x1);loggerPredictiveCalls[_0x760d('0x84')]('[startMethodPredictive][StartProgressive][Loop]',_0x40ddd4[_0x760d('0x2b')],_0x40ddd4[_0x760d('0x45')]);_0x40ddd4[_0x760d('0x74')]=0x0;_0x40ddd4[_0x760d('0x70')]=0x0;}else if(_0x21c7ea<_0x4fe0e1&&_0x40ddd4['dialPredictiveOptimization']===_0x760d('0x1bb')){freeVariablesPredictive(_0x40ddd4);loggerPredictive['info'](_0x760d('0x1bc'),_0x760d('0x1bd'),_0x4fe0e1,_0x760d('0x2b'),_0x40ddd4['name']);}else if(_0x351014<_0x40ddd4[_0x760d('0x70')]&&_0x40ddd4[_0x760d('0x1be')]===_0x760d('0x1bb')){freeVariablesPredictive(_0x40ddd4);loggerPredictive[_0x760d('0x84')](_0x760d('0x1bf'),_0x760d('0x1c0'),_0x351014,'Drop\x20in\x20this\x20interval',_0x40ddd4[_0x760d('0x70')],_0x760d('0x2b'),_0x40ddd4['name']);}else if(!ifInterval(_0x40ddd4[_0x760d('0x1ba')],_0x40ddd4['startProgressive'])&&_[_0x760d('0x41')](_0x40ddd4['startPredictive'])&&!_[_0x760d('0x41')](_0x40ddd4[_0x760d('0x2b')])){_0x40ddd4[_0x760d('0x77')]=moment()[_0x760d('0x7e')](_0x760d('0x102'));loggerPredictive['info'](_0x40ddd4[_0x760d('0x45')],_0x760d('0x1c1'),_0x40ddd4[_0x760d('0x77')]);this[_0x760d('0xbf')](_0x40ddd4[_0x760d('0x1ba')])[_0x760d('0xbb')](this['getDataPredictive'](_0x40ddd4))[_0x760d('0xbb')](mergeDataErlangB(_0x40ddd4))['then'](this[_0x760d('0x1c2')](_0x40ddd4))[_0x760d('0xb4')](loggerCatchPredictive(_0x760d('0x1c3'),_0x40ddd4));}else if(!ifInterval(_0x40ddd4[_0x760d('0x1ba')],_0x40ddd4[_0x760d('0x77')])){_0x40ddd4[_0x760d('0x70')]=0x0;_0x40ddd4['startPredictive']=moment()[_0x760d('0x7e')](_0x760d('0x102'));loggerPredictive['info'](_0x40ddd4[_0x760d('0x45')],_0x760d('0x1c4'),_0x40ddd4[_0x760d('0x77')]);clearInterval(_0x40ddd4[_0x760d('0x95')]);_0x40ddd4[_0x760d('0x95')]=undefined;this[_0x760d('0xbf')](_0x40ddd4[_0x760d('0x1ba')])[_0x760d('0xbb')](this[_0x760d('0x1c5')](_0x40ddd4))[_0x760d('0xbb')](mergeDataErlangB(_0x40ddd4))[_0x760d('0xbb')](this[_0x760d('0x1c2')](_0x40ddd4))[_0x760d('0xb4')](loggerCatchPredictive('Predictive\x20for\x20every\x20interval',_0x40ddd4));}else if(_0x40ddd4[_0x760d('0x1b5')]&&_0x30f5b8<_0x40ddd4[_0x760d('0x1b5')]-_0x4d1278){freeVariablesPredictive(_0x40ddd4);loggerPredictive[_0x760d('0x84')](_0x40ddd4[_0x760d('0x45')],_0x760d('0x1c6'),_0x30f5b8,_0x760d('0x1c7'),_0x40ddd4[_0x760d('0x1b5')],'-',_0x4d1278,'=',_0x40ddd4['predictiveIntervalAvailable']-_0x4d1278,')');}else if(_0x40ddd4[_0x760d('0x1b5')]&&_0x30f5b8>_0x40ddd4['predictiveIntervalAvailable']+_0x29cff4){freeVariablesPredictive(_0x40ddd4);loggerPredictive['info'](_0x40ddd4[_0x760d('0x45')],_0x760d('0x1c6'),_0x30f5b8,_0x760d('0x1c8'),_0x40ddd4[_0x760d('0x1b5')],'+',_0x29cff4,'=',_0x40ddd4[_0x760d('0x1b5')]+_0x29cff4,')');}};Dialer[_0x760d('0x1d')][_0x760d('0x1c5')]=function(_0x5054a){var _0x2da45c=this;return function(_0x9af7db){return new BPromise(function(_0x1e63d6,_0x291841){_[_0x760d('0x93')](_0x5054a,_0x9af7db[0x0]);if(checkGetDataPredictive(_0x9af7db[0x0])){var _0x3b39db=_0x5054a[_0x760d('0x1b5')]=_0x5054a[_0x760d('0x55')]+_0x5054a[_0x760d('0x53')];var _0x1e8975=_0x5054a[_0x760d('0x1ba')]*0x3c;var _0xf5ad44=_0x9af7db[0x0][_0x760d('0x6c')]+_0x9af7db[0x0]['predictiveIntervalAvgHoldtime'];var _0x3b4bb9=(_0x9af7db[0x0][_0x760d('0x6a')]+_0x9af7db[0x0][_0x760d('0x6e')]+_0x9af7db[0x0][_0x760d('0x6d')])/_0x9af7db[0x0]['predictiveIntervalTotalCalls'];_0x5054a[_0x760d('0x71')]=_0x3b4bb9>0x0?_0x3b4bb9:0x1;switch(_0x5054a[_0x760d('0x1be')]){case _0x760d('0x1bb'):var _0x13eea8=_0x5054a[_0x760d('0x1b2')]/0x64;return _0x2da45c[_0x760d('0x1c9')](_0x3b39db,_0x1e8975,_0xf5ad44,_0x3b4bb9,_0x13eea8)[_0x760d('0xbb')](function(_0x1eef82){return _0x1e63d6(_0x1eef82);});case _0x760d('0x1ca'):var _0xe1a85e=_0x5054a[_0x760d('0x1b2')]/0x64;return _0x2da45c[_0x760d('0x1cb')](_0x3b39db,_0x1e8975,_0xf5ad44,_0x3b4bb9,_0xe1a85e)['then'](function(_0x2f6cc8){return _0x1e63d6(_0x2f6cc8);});default:return _0x291841(msgResponse(_0x760d('0x1cc'),_0x760d('0x13d'),_0x760d('0x1cd')));}}else{return _0x291841(msgResponse(_0x760d('0x1cc'),_0x760d('0x13d'),_0x760d('0x1ce')));}});};};Dialer[_0x760d('0x1d')][_0x760d('0x1cf')]=function(_0xdabdb9){var _0x10a3bc=this;return function(_0x5c6405){return new BPromise(function(_0x51b6e7,_0x19a9db){_['merge'](_0xdabdb9,_0x5c6405[0x0]);if(checkGetDataPredictive(_0x5c6405[0x0])){loggerPredictive[_0x760d('0x84')](JSON[_0x760d('0x4c')](_0x5c6405[0x0]));if(_0xdabdb9['dialPredictiveOptimization']===_0x760d('0x1bb')){return _0x10a3bc['getVoiceQueueRtPauses'](_0xdabdb9['id'])[_0x760d('0xbb')](function(_0x2aa34b){var _0x238735=_0xdabdb9[_0x760d('0x155')]-_0x2aa34b[0x0]['outboundQueuePauses'];var _0x4396c3=_0xdabdb9['dialPredictiveInterval']*0x3c;var _0x4ad8f9=_0x5c6405[0x0][_0x760d('0x6c')]+_0x5c6405[0x0][_0x760d('0x6b')];var _0x163e45=(_0x5c6405[0x0][_0x760d('0x6a')]+_0x5c6405[0x0][_0x760d('0x6e')]+_0x5c6405[0x0][_0x760d('0x6d')])/_0x5c6405[0x0][_0x760d('0x83')];var _0x1e591e=_0xdabdb9['dialPredictiveOptimizationPercentage']/0x64;_0xdabdb9[_0x760d('0x1d0')]=_0x2aa34b[0x0][_0x760d('0x1d1')]||0x0;_0xdabdb9['predictiveIntervalHitRate']=_0x163e45>0x0?_0x163e45:0x1;return _0x10a3bc[_0x760d('0x1c9')](_0x238735,_0x4396c3,_0x4ad8f9,_0x163e45,_0x1e591e);})['then'](function(_0x3a5250){return _0x51b6e7(_0x3a5250);})[_0x760d('0xb4')](function(_0xf3b580){return _0x19a9db(msgResponse(_0x760d('0x1d2'),_0x760d('0x13d'),JSON[_0x760d('0x4c')](_0xf3b580)));});}if(_0xdabdb9['dialPredictiveOptimization']==='agentBusyFactor'){return _0x10a3bc['getVoiceQueueRtPauses'](_0xdabdb9['id'])['then'](function(_0x623d4d){var _0x2fa3cb=_0xdabdb9[_0x760d('0x155')]-_0x623d4d[0x0][_0x760d('0x1d1')];var _0x2f54e5=_0xdabdb9[_0x760d('0x1ba')]*0x3c;var _0x362380=_0x5c6405[0x0][_0x760d('0x6c')]+_0x5c6405[0x0][_0x760d('0x6b')];var _0x3ed0db=(_0x5c6405[0x0][_0x760d('0x6a')]+_0x5c6405[0x0][_0x760d('0x6e')]+_0x5c6405[0x0][_0x760d('0x6d')])/_0x5c6405[0x0][_0x760d('0x83')];var _0x40ea51=_0xdabdb9[_0x760d('0x1b2')]/0x64;_0xdabdb9[_0x760d('0x1d0')]=_0x623d4d[0x0]['outboundQueuePauses']||0x0;_0xdabdb9[_0x760d('0x71')]=_0x3ed0db>0x0?_0x3ed0db:0x1;return _0x10a3bc[_0x760d('0x1cb')](_0x2fa3cb,_0x2f54e5,_0x362380,_0x3ed0db,_0x40ea51);})[_0x760d('0xbb')](function(_0x52ccb3){return _0x51b6e7(_0x52ccb3);})[_0x760d('0xb4')](function(_0x493613){return _0x19a9db(msgResponse(_0x760d('0x1d2'),'Failure',JSON[_0x760d('0x4c')](_0x493613)));});}}else{return _0x19a9db(msgResponse('[getDataPredictive]',_0x760d('0x13d'),_0x760d('0x1ce')));}});};};Dialer[_0x760d('0x1d')][_0x760d('0x1c2')]=function(_0x32c6c5){var _0x4ab443=this;return function(){var _0x3fc9fd=0x0;var _0x5a71b0=Math[_0x760d('0x1d3')](_0x32c6c5[_0x760d('0x75')]*0x3e8);if(_0x5a71b0>0x0){_0x5a71b0=_0x5a71b0<0x64?0x64:_0x5a71b0;loggerPredictive['info'](_0x32c6c5[_0x760d('0x45')],'one\x20call\x20every:',_0x5a71b0,_0x760d('0x4d'));_0x32c6c5[_0x760d('0x95')]=setInterval(function(){_0x4ab443[_0x760d('0x95')](_0x32c6c5);loggerPredictiveCalls[_0x760d('0x84')](_0x760d('0x1d4'),_0x3fc9fd+=0x1);},_0x5a71b0);}else{loggerPredictive['info'](_0x32c6c5[_0x760d('0x45')],'fail\x20to\x20scheduled\x20calls');}};};Dialer[_0x760d('0x1d')][_0x760d('0x1d5')]=function(_0x2bf290,_0x1d7473){var _0x5bbeb9=this;return function(_0x107aa1){if(_[_0x760d('0x80')](_0x107aa1)){if(_[_0x760d('0xb0')](_0x1d7473[_0x760d('0xd4')])||!_0x1d7473[_0x760d('0x1d6')]){if(_0x2bf290[_0x760d('0x5a')]===_0x760d('0x8')){_0x2bf290[_0x760d('0x125')]=_[_0x760d('0x41')](_0x2bf290['queueStatusComplete'])?!![]:_0x2bf290['queueStatusComplete'];var _0x3ca50d=uuid['v4']();_0x5bbeb9[_0x760d('0x27')][_0x3ca50d]=new Action(_0x2bf290,_0x1d7473,_0x3ca50d);loggerBooked['info'](_0x760d('0x1d7'),_0x3ca50d,_0x760d('0x1d8'),JSON[_0x760d('0x4c')](_0x2bf290[_0x760d('0x125')]),_0x760d('0x1d9'),_0x2bf290[_0x760d('0x45')]);if(_0x2bf290[_0x760d('0x125')]){_0x2bf290[_0x760d('0x125')]=![];_0x5bbeb9['queueBooked'][_0x5bbeb9[_0x760d('0x27')][_0x3ca50d]['queue']]=[];ami[_0x760d('0xb1')]({'actionid':_0x3ca50d,'action':_0x760d('0x1da'),'queue':_0x2bf290['name']})[_0x760d('0xb4')](function(){_0x5bbeb9[_0x760d('0xb6')](_0x2bf290);_0x5bbeb9[_0x760d('0xc1')]({'active':![],'ContactId':_0x5bbeb9[_0x760d('0x27')][_0x3ca50d][_0x760d('0xd2')],'ListId':_0x5bbeb9['actions'][_0x3ca50d][_0x760d('0xd3')],'VoiceQueueId':_0x5bbeb9[_0x760d('0x27')][_0x3ca50d][_0x760d('0xd5')]||undefined,'CampaignId':_0x5bbeb9[_0x760d('0x27')][_0x3ca50d][_0x760d('0xd6')]||undefined})[_0x760d('0xb4')](loggerCatch(_0x760d('0x1db')));delete _0x5bbeb9[_0x760d('0x27')][_0x3ca50d];});}else{loggerBooked[_0x760d('0x84')](_0x760d('0x1dc'),JSON[_0x760d('0x4c')](_0x2bf290[_0x760d('0x125')]),_0x760d('0x1d9'),_0x2bf290['name']);_0x5bbeb9['updateOriginated'](_0x2bf290);_0x5bbeb9[_0x760d('0xc1')]({'active':![],'ContactId':_0x5bbeb9['actions'][_0x3ca50d][_0x760d('0xd2')],'ListId':_0x5bbeb9[_0x760d('0x27')][_0x3ca50d][_0x760d('0xd3')],'VoiceQueueId':_0x5bbeb9[_0x760d('0x27')][_0x3ca50d][_0x760d('0xd5')]||undefined,'CampaignId':_0x5bbeb9[_0x760d('0x27')][_0x3ca50d][_0x760d('0xd6')]||undefined})[_0x760d('0xb4')](loggerCatch(_0x760d('0x1db')));delete _0x5bbeb9[_0x760d('0x27')][_0x3ca50d];}}else{return _0x5bbeb9[_0x760d('0x15e')](_0x2bf290,_0x1d7473);}}else{if(getDiff(_0x1d7473[_0x760d('0x1dd')])<_0x2bf290['dialRecallMeTimeout']*0x3c){if(_0x1d7473[_0x760d('0x1de')]&&!_0x1d7473[_0x760d('0x1de')][_0x760d('0x1df')]){_0x5bbeb9['preview'][_0x760d('0x130')](_0x1d7473['id'])[_0x760d('0x128')](function(){_0x5bbeb9[_0x760d('0xb6')](_0x2bf290);});}else{_0x5bbeb9['unlockContact']({'active':![]},_0x1d7473['id'],0x1)[_0x760d('0x128')](function(){_0x5bbeb9[_0x760d('0xb6')](_0x2bf290);});}}else{_0x2bf290['outboundReCallsDay']+=0x1;_0x5bbeb9[_0x760d('0xb6')](_0x2bf290);if(_0x2bf290[_0x760d('0x1e0')]){_0x5bbeb9[_0x760d('0xc1')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0x1d7473[_0x760d('0xd2')],'ListId':_0x1d7473['ListId'],'VoiceQueueId':_0x1d7473[_0x760d('0xd5')]||undefined,'CampaignId':_0x1d7473['CampaignId']||undefined})[_0x760d('0xb4')](loggerCatch('[rescheduleContact][dialRecallInQueue]'));_0x5bbeb9['createHistory'](createObjHistory(_0x2bf290,_0x1d7473,_0x760d('0x1e1'),0x17,_0x760d('0x1e2')))['catch'](loggerCatch(_0x760d('0x1e3')));}else{_0x5bbeb9[_0x760d('0xdd')](createObjHistory(_0x2bf290,_0x1d7473,_0x760d('0x1e4'),0x16,_0x760d('0x1e5')),_0x760d('0x1e6'),_0x760d('0x1e7'));}}}}else{_0x2bf290[_0x760d('0x1e8')]+=0x1;_0x5bbeb9[_0x760d('0xdd')](createObjHistory(_0x2bf290,_0x1d7473,_0x760d('0x1e9'),0xd,'Blacklist'),_0x760d('0x1ea'),_0x760d('0x1eb'));throw'inBlackList';}};};Dialer['prototype'][_0x760d('0x154')]=function(_0x35c54e){var _0x446263=this;var _0x1da894=_0x35c54e[_0x760d('0x1ec')]-_0x35c54e[_0x760d('0x73')]-_0x35c54e['temp'];emitCampaignSummary(_0x35c54e);if(_0x1da894>0x0){if(_0x1da894>this['maxNumberOriginate']){_0x1da894=this[_0x760d('0x25')];}_0x35c54e[_0x760d('0xc6')]+=_0x1da894;this[_0x760d('0xc7')](_0x35c54e['id'],_0x1da894,_0x35c54e[_0x760d('0x1ed')],_0x35c54e)[_0x760d('0xbb')](function(_0x1cef42){_0x35c54e['temp']-=_0x1da894;_0x35c54e['temp']=_0x35c54e[_0x760d('0xc6')]>0x0?_0x35c54e[_0x760d('0xc6')]:0x0;if(!checkContactEmpty(_0x1cef42)){_0x35c54e[_0x760d('0x42')]=_0x760d('0xa0');logger[_0x760d('0x84')](_0x760d('0x1ee')+_0x35c54e[_0x760d('0x45')]);}else{_0x35c54e[_0x760d('0x73')]+=_0x1cef42[_0x760d('0x12a')];_0x35c54e['message']='RUNNING';for(var _0x2f89cc=0x0;_0x2f89cc<_0x1cef42[_0x760d('0x12a')];_0x2f89cc+=0x1){_0x35c54e[_0x760d('0x1ef')]+=0x1;if(_[_0x760d('0xb0')](_0x1cef42[_0x2f89cc])||_[_0x760d('0xb0')](_0x1cef42[_0x2f89cc][_0x760d('0x161')])||_[_0x760d('0xb0')](_0x1cef42[_0x2f89cc][_0x760d('0x161')][_0x760d('0x162')])){_0x446263['emptyContact'](_0x760d('0x1f0'),_0x35c54e,_0x1cef42[_0x2f89cc]);}else{_0x446263[_0x760d('0xbd')](_[_0x760d('0xd1')](_0x1cef42[_0x2f89cc],[_0x760d('0xd6'),'Contact.phone']))[_0x760d('0xbb')](_0x446263['checkContactBlack'](_0x35c54e,_0x1cef42[_0x2f89cc]))['catch'](_0x446263[_0x760d('0x1f1')](_0x760d('0x1f2'),_0x35c54e));}}}})[_0x760d('0xb4')](loggerGetContactDialer(_0x760d('0x1f3'),_0x35c54e,_0x1da894));}};Dialer[_0x760d('0x1d')]['handlePower']=function(_0x3204b8,_0x38aad2){var _0x2e35dd=this;var _0x147127=[];var _0x4fa839=_0x38aad2>=0x1?_0x38aad2:0x1;if(_0x3204b8[_0x760d('0x5a')]==='booked'){_0x4fa839=0x1;}var _0x1116df=Math[_0x760d('0x1d3')](_0x3204b8[_0x760d('0x53')]*_0x4fa839)-_0x3204b8[_0x760d('0x73')]-_0x3204b8['temp'];emitVoiceQueueSummary(_0x3204b8);if(_0x3204b8['dialLimitQueue']>0x0){var _0x414aa6=_0x3204b8[_0x760d('0x1f4')]-_0x3204b8[_0x760d('0x73')]-_0x3204b8[_0x760d('0x55')]-_0x3204b8[_0x760d('0xc6')]-_0x3204b8[_0x760d('0x1f5')];if(_0x1116df>_0x414aa6){_0x1116df=_0x414aa6;}}if(_0x1116df>0x0){if(_0x3204b8[_0x760d('0x5a')]===_0x760d('0x8')){_0x1116df=0x1;}if(_0x1116df>this['maxNumberOriginate']){_0x1116df=this[_0x760d('0x25')];}_0x3204b8['temp']+=_0x1116df;for(var _0x47a129 in this['agents']){if(typeof this['agents'][_0x47a129]!==_0x760d('0x9c')){if(this[_0x760d('0x23')][_0x47a129][_0x760d('0xa9')]===_0x760d('0x1f6')&&this[_0x760d('0x23')][_0x47a129]['status']===_0x760d('0xdb')){_0x147127[_0x760d('0x143')](this[_0x760d('0x23')][_0x47a129]['id']);}}}this[_0x760d('0xc5')](_0x3204b8['id'],_0x147127,_0x1116df,_0x3204b8['dialOrderByScheduledAt'],_0x3204b8)[_0x760d('0xbb')](function(_0x390cd7){_0x3204b8[_0x760d('0xc6')]-=_0x1116df;_0x3204b8[_0x760d('0xc6')]=_0x3204b8['temp']>0x0?_0x3204b8[_0x760d('0xc6')]:0x0;if(!checkContactEmpty(_0x390cd7)){_0x2e35dd[_0x760d('0xb9')](_0x3204b8)[_0x760d('0xbb')](sendMessageReschedule(_0x3204b8))[_0x760d('0xb4')](loggerCatch(_0x760d('0x1f7')));}else{_0x3204b8['originated']+=_0x390cd7[_0x760d('0x12a')];_0x3204b8[_0x760d('0x42')]=_0x3204b8[_0x760d('0x5a')]===_0x760d('0x8')?'ACTIVE':_0x760d('0x1f8');for(var _0x1f4314=0x0;_0x1f4314<_0x390cd7[_0x760d('0x12a')];_0x1f4314+=0x1){if(_[_0x760d('0xb0')](_0x390cd7[_0x1f4314])||_['isNil'](_0x390cd7[_0x1f4314][_0x760d('0x161')])||_[_0x760d('0xb0')](_0x390cd7[_0x1f4314][_0x760d('0x161')]['phone'])){_0x2e35dd['emptyContact'](_0x760d('0x1f0'),_0x3204b8,_0x390cd7[_0x1f4314]);}else{_0x2e35dd['checkIsBlackList'](_[_0x760d('0xd1')](_0x390cd7[_0x1f4314],[_0x760d('0xd5'),_0x760d('0x1f9')]))[_0x760d('0xbb')](_0x2e35dd['checkContactBlack'](_0x3204b8,_0x390cd7[_0x1f4314]))['catch'](_0x2e35dd[_0x760d('0x1f1')](_0x760d('0x1f0'),_0x3204b8));}}}})[_0x760d('0xb4')](loggerGetContactDialer(_0x760d('0x1fa'),_0x3204b8,_0x1116df));}};Dialer['prototype'][_0x760d('0x95')]=function(_0x3db002){if(_0x3db002[_0x760d('0x1f4')]>0x0){var _0x4adf14=_0x3db002[_0x760d('0x1f4')]-_0x3db002[_0x760d('0x73')]-_0x3db002['talking'];if(_0x4adf14>0x0){this[_0x760d('0x1fb')](_0x3db002);}else{loggerPredictiveCalls[_0x760d('0x84')](_0x760d('0x1fc'));}}else{this[_0x760d('0x1fb')](_0x3db002);}};Dialer[_0x760d('0x1d')][_0x760d('0x1fb')]=function(_0x473584){var _0x43128a=this;var _0xbca584=[];_0x473584[_0x760d('0x73')]+=0x1;for(var _0x4efcda in this['agents']){if(typeof this[_0x760d('0x23')][_0x4efcda]!=='undefined'){if(this[_0x760d('0x23')][_0x4efcda]['state']===_0x760d('0x1f6')&&this[_0x760d('0x23')][_0x4efcda][_0x760d('0xb2')]===_0x760d('0xdb')){_0xbca584[_0x760d('0x143')](this['agents'][_0x4efcda]['id']);}}}this[_0x760d('0xc5')](_0x473584['id'],_0xbca584,0x1,_0x473584[_0x760d('0x1ed')],_0x473584)[_0x760d('0xbb')](function(_0x5678cc){if(!checkContactEmpty(_0x5678cc)){checkContactLowerLimitOriginate(_0x473584,0x1,0x0);_0x43128a[_0x760d('0xb9')](_0x473584)[_0x760d('0xbb')](sendMessageReschedule(_0x473584))['catch'](loggerCatch('[countReScheduled]\x20'));}else{_0x473584[_0x760d('0x42')]=_0x760d('0x1f8');if(_[_0x760d('0xb0')](_0x5678cc[0x0])||_[_0x760d('0xb0')](_0x5678cc[0x0][_0x760d('0x161')])||_['isNil'](_0x5678cc[0x0][_0x760d('0x161')]['phone'])){_0x43128a[_0x760d('0xd0')]('[actionOriginate]\x20',_0x473584,_0x5678cc[0x0]);}else{_0x43128a['checkIsBlackList'](_[_0x760d('0xd1')](_0x5678cc[0x0],[_0x760d('0xd5'),_0x760d('0x1f9')]))[_0x760d('0xbb')](_0x43128a[_0x760d('0x1d5')](_0x473584,_0x5678cc[0x0]))[_0x760d('0xb4')](_0x43128a[_0x760d('0x1f1')]('[actionOriginatePredictive]\x20',_0x473584));}}})[_0x760d('0xb4')](loggerGetContactDialer('[getContactDialerPredictive]',_0x473584,0x1));emitVoiceQueueSummary(_0x473584);};Dialer[_0x760d('0x1d')]['abandonmentRate']=function(_0x55628c,_0x647317,_0x298daa,_0xa51179,_0x55976f,_0x10db04){loggerPredictive[_0x760d('0x84')]('--------\x20Drop\x20Rate\x20--------');loggerPredictive[_0x760d('0x84')]('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',_0x55628c);loggerPredictive[_0x760d('0x84')](_0x760d('0x1fd'),_0x647317);loggerPredictive[_0x760d('0x84')]('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',_0x298daa);loggerPredictive[_0x760d('0x84')](_0x760d('0x1fe'),_0xa51179);loggerPredictive[_0x760d('0x84')](_0x760d('0x1ff'),_0x55976f);loggerPredictive[_0x760d('0x84')](_0x760d('0x92'));return new BPromise(function(_0x2910c7,_0x1b1695){if(_0x55628c<=0x0||isNaN(_0x55628c)){return _0x1b1695(msgResponse(_0x760d('0x200'),_0x760d('0x4b'),'m\x20=\x20'+_0x55628c));}if(_0x298daa<=0x0||isNaN(_0x298daa)){return _0x1b1695(msgResponse('[abandonmentRate]','Error',_0x760d('0x201')+_0x298daa));}if(_0xa51179<=0x0||isNaN(_0xa51179)){return _0x1b1695(msgResponse(_0x760d('0x200'),_0x760d('0x4b'),_0x760d('0x202')+_0xa51179));}if(_0x647317<=0x0||isNaN(_0x647317)){return _0x1b1695(msgResponse(_0x760d('0x200'),_0x760d('0x4b'),_0x760d('0x203')+_0x647317));}if(_0x55976f<=0x0||isNaN(_0x55976f)){return _0x1b1695(msgResponse('[abandonmentRate]',_0x760d('0x4b'),_0x760d('0x204')+_0x55976f));}_0x10db04=_0x10db04||0x0;var _0x443358=0x1/_0x298daa;var _0x471807=0x0;var _0x72225d=0x0;var _0xf1f3f5=0x0;var _0x332c40=0x0;for(var _0x4d9703=0x0;_0xf1f3f5<_0x55976f;_0x4d9703+=0x1){_0x72225d=_0x4d9703/_0x647317;_0x471807=(_0xa51179*_0x72225d+_0x10db04)/_0x443358;_0xf1f3f5=erlangb(_0x471807,_0x55628c);_0x332c40=_0x471807/_0x55628c*(0x1-erlangb(_0x471807,_0x55628c));}return _0x2910c7({'erlangCalls':_0x4d9703,'erlangCallToSecond':_0x647317/_0x4d9703,'erlangAbandonmentRate':_0xf1f3f5,'erlangBusyFactor':_0x332c40});});};Dialer[_0x760d('0x1d')][_0x760d('0x1cb')]=function(_0xb4343a,_0x3f7e84,_0x488129,_0xac29ee,_0x2e0cb5,_0xc45137){loggerPredictive[_0x760d('0x84')]('----\x20Agent\x20Busy\x20Factor\x20----');loggerPredictive[_0x760d('0x84')](_0x760d('0x205'),_0xb4343a);loggerPredictive[_0x760d('0x84')](_0x760d('0x1fd'),_0x3f7e84);loggerPredictive[_0x760d('0x84')](_0x760d('0x206'),_0x488129);loggerPredictive['info'](_0x760d('0x1fe'),_0xac29ee);loggerPredictive[_0x760d('0x84')](_0x760d('0x207'),_0x2e0cb5);loggerPredictive['info']('---------------------------');return new BPromise(function(_0x214dc0,_0x4dc2bd){if(_0xb4343a<=0x0||isNaN(_0xb4343a)){return _0x4dc2bd(msgResponse(_0x760d('0x208'),_0x760d('0x4b'),_0x760d('0x209')+_0xb4343a));}if(_0x488129<=0x0||isNaN(_0x488129)){return _0x4dc2bd(msgResponse(_0x760d('0x208'),_0x760d('0x4b'),_0x760d('0x201')+_0x488129));}if(_0xac29ee<=0x0||isNaN(_0xac29ee)){return _0x4dc2bd(msgResponse(_0x760d('0x208'),_0x760d('0x4b'),_0x760d('0x202')+_0xac29ee));}if(_0x3f7e84<=0x0||isNaN(_0x3f7e84)){return _0x4dc2bd(msgResponse(_0x760d('0x208'),'Error','interval\x20=\x20'+_0x3f7e84));}if(_0x2e0cb5<=0x0||isNaN(_0x2e0cb5)){return _0x4dc2bd(msgResponse('[busyFactor]',_0x760d('0x4b'),_0x760d('0x20a')+_0x2e0cb5));}_0xc45137=_0xc45137||0x0;var _0x298e5c=0x1/_0x488129;var _0x279d22=0x0;var _0x602be3=0x0;var _0x16b952=0x0;var _0x129bd3=0x0;for(var _0x57d813=0x0;_0x129bd3<_0x2e0cb5;_0x57d813+=0x1){_0x602be3=_0x57d813/_0x3f7e84;_0x279d22=(_0xac29ee*_0x602be3+_0xc45137)/_0x298e5c;_0x16b952=erlangb(_0x279d22,_0xb4343a);_0x129bd3=_0x279d22/_0xb4343a*(0x1-erlangb(_0x279d22,_0xb4343a));}return _0x214dc0({'erlangCalls':_0x57d813,'erlangCallToSecond':_0x3f7e84/_0x57d813,'erlangAbandonmentRate':_0x16b952,'erlangBusyFactor':_0x129bd3});});};module[_0x760d('0x20b')]=Dialer; \ No newline at end of file +var _0xb49a=['predictiveIntervalErlangCallsDroppedCalls','Drop','TIMEOUT','queueCallerAbandonCreateState','dialDropRetryFrequency','[rescheduleContact][Drop]','starttime','calleridname','calleridnum','Abandoned','CALLEREXIT','dialAbandonedMaxRetry','[rescheduleContact][Abandoned]','actionid','paused','stateinterface','locked','queueBooked','push','queueStatusComplete','[booked][unlockQueueStatus]','run','[unlock][syncQueueStatusComplete]','queueBookedRR','_rr','unlockRR','Agent:\x20','contactAgent-idHopper:\x20','idHopper','[Catch][Preview][syncQueueStatusComplete]','[booked][RR][finaly]','[booked][unlock]','[booked][unlock2]','[unlock2][syncQueueStatusComplete]','[unlock3][syncQueueStatusComplete]','syncCampaigns','checkIsTrunkReachable','TrunkBackup','TRUNK_IS_NOT_REACHABLE','\x20trunk\x20is\x20not\x20reachable','checkIfTime','ifTime','Failure','INTERVAL_IS_EMPTY','\x20Intervals\x20is\x20empty\x20','timezones','TIMEZONE_UNKNOW','\x20Timezone\x20unknow\x20','isArray','command','iftime\x20%s,%s','interval','content','true','indexOf','all','GLOBAL_INTERVAL_IS_OVERTIME','Global:\x20','\x20Interval\x20is\x20overtime:\x20','Timezone:\x20','dialMethod','progressive','handlePower','dialPowerLevel','Queue','launchHandleIvr','handleIvr','dialActive','dialGlobalInterval','dialTimezone','checkDialMethod','[syncQueueSummary]','checkIfTimeIntervals','[syncCampaigns]','pow','replace','random','match','actionOriginate','originate','voiceQueue\x20is\x20undefine','Contact','phone','contact\x20is\x20undefine','getCaller','NONE','\x22agi://%s/square,%s\x22','\x22%s,%s%s,,,%s\x22','dialQueueOptions','ACTIVE','XMD-AMDINITIALSILENCE','dialAMDGreeting','XMD-AMDAFTERGREETINGSILENCE','dialAMDAfterGreetingSilence','XMD-AMDTOTALANALYSISTIME','dialAMDTotalAnalysisTime','XMD-AMDMINWORDLENGTH','XMD-AMDBETWEENWORDSSILENCE','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','XMD-AMDSILENCETHRESHOLD','dialAMDSilenceThreshold','XMD-AMDMAXIMUMWORDLENGTH','XMD-VOICEQUEUEID','XMD-CAMPAIGNID','createdAt','updatedAt','%s%s','toUpper','dialOriginateCallerIdName','dialRandomLastDigitCallerIdNumber','dialOriginateCallerIdNumber','XMD-ORIGINATECALLERIDNAME','SIP/%s/%s%s','trim','dialCutDigit','substring','from-sip','[originateError]:\x20%s','[originate][error]','originate\x20action\x20Error','response','callProgressDetecting','dialNoAnswerRetryFrequency','[rescheduleContact][NoAnswer]','dialBusyMaxRetry','[rescheduleContact]\x20[Busy]','dialCongestionMaxRetry','dialCongestionRetryFrequency','[rescheduleContact]\x20[Congestion]','dialNoSuchNumberRetryFrequency','[rescheduleContact][NoSuchNumber]','dialDropMaxRetry','dialAbandonedRetryFrequency','dialAgentRejectMaxRetry','[rescheduleContact][AgentReject]','object','[callProgressDetecting]','entity\x20is\x20undefine','NoSuchNumber','nosuchnumber','checkRetriveMax','reason\x200\x20no\x20such\x20number....','outboundNoAnswerCallsDay','NoAnswer','[syncAgentComplete][createHistory][3]','dialNoAnswerMaxRetry','reason\x203\x20ringing\x20no\x20answer','Busy','[syncAgentComplete][createHistory][5]','reason\x205\x20busy','custom:agentcongestion','congestion','reason\x208\x20congestion','outboundAbandonedCallsDay','[syncAgentComplete][createHistory][11]','reason\x2011\x20abandoned','AgentReject','custom:agentreject','[syncAgentComplete][createHistory][20]','reason\x2020\x20agentreject','[syncAgentComplete][createHistory][?]','Global','[moveContactManagedDialer][0]','contact\x20not\x20moved','dialPredictiveOptimizationPercentage','round','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','floor','[startMethodPredictive][StartProgressive]','check\x20handlePredictive\x20is\x20not\x20undefine','collection\x20data\x20in\x20progressive\x20at','[startMethodPredictive][StartProgressive][Loop]','dialPredictiveOptimization','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','Dropped\x20calls\x20day','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Max\x20Drop\x20','Drop\x20in\x20this\x20interval','dialPredictiveInterval','started\x20in\x20predictive\x20at','getDataPredictive','startMethodPredictive','recalculate\x20predictive\x20at','Predictive\x20for\x20every\x20interval','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20less\x20than\x20threshold\x20(',')\x20are\x20more\x20than\x20threshold\x20(','abandonmentRate','agentBusyFactor','busyFactor','[getDataPredictive]','Unknown\x20Predictive','check\x20failure','getDataPredictiveOld','outboundQueuePauses','[CatchErlangB]','one\x20call\x20every:','[handlePredictive]','fail\x20to\x20scheduled\x20calls','checkContactBlack','recallme','[booked][checkContactBlack]','queueStatusComplete:\x20','queuestatus','[unlockOriginate][syncQueueStatusComplete]','scheduledat','Agent','outboundReCallsDay','dialRecallInQueue','[rescheduleContact][dialRecallInQueue]','RecallInQueue','[Originate][HistoryDialRecallInQueue][historyCatch]','RECALLFAILEDTIMEOUT','RecallFailedTimeout','[Originate][HistoryRecallClose][historyCatch]','[Originate][HistoryRecallClose]','Blacklist','[Originate][MoveBlacklist]','inBlackList','dialOrderByScheduledAt','[getContactCampaign2][Empty]','RUNNING','ivrTotalCallsDays','[actionOriginate]\x20','Contact.phone','[actionOriginateIvr]\x20','dialLimitQueue','not_inuse','[getContactDialer2]','tryOriginatePredictive','[handlePredictive][limitChannel]','[actionOriginatePredictive]\x20','[getContactDialerPredictive]','--------\x20Drop\x20Rate\x20--------','M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','P:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[abandonmentRate]','m\x20=\x20','Ts\x20=\x20','p\x20=\x20','interval\x20=\x20','Amax\x20=\x20','----\x20Agent\x20Busy\x20Factor\x20----','Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[busyFactor]','exports','util','lodash','bluebird','uuid','moment','ioredis','../preview/util/util','dialer','../../../config/logger','booked','predictive','predictiveCalls','syncQueueSummary','../ami','redis','defaults','../rpc/cmHopper','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/voiceQueueRt','./history','./final','./agentComplete','./queueCallerAbandon','./hangup','env','XCALLY_IP_AGI','127.0.0.1','rrmemory','roundrobin','prototype','tail','finally','sequence','preview','voiceQueues','campaigns','agents','maxNumberOriginate','actions','contactsId','optionPredictive','startProgressive','ivrOriginated','agentconnect','bind','syncQueueCallerAbandon','originateresponse','syncAgentComplete','newexten','syncNewExten','varset','syncVarSet','queuemember','syncQueueMember','syncQueueStatusComplete','loopCampaigns','message','AGENTS_NOT_LOGGED','\x20AGENTS\x20NOT\x20LOGGED','name','\x20INTERVAL_IS_NULL','Interval','INTERVAL_IS_NULL','isEmpty','Intervals','[ifTime][Action]','Error','stringify','milliseconds','diff','seconds','emit','outbound','strategy','answered','loggedIn','pTalking','sumBillable','sumDuration','sumHoldTime','type','unmanaged','abandoned','loggedInDb','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','startPredictive','Trunk','active','callerid','md5','format','voice:queue:%s','voice_queue:save','ivr','campaign:ivr:%s','campaign:save','info','Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','---------------------------','isUndefined','Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive','History\x20information\x20are\x20empty','Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangBusyFactor','merge','clearing\x20variable\x20start\x20progressive','clearing\x20variable\x20start\x20predictive','handlePredictive','clearing\x20variable\x20handle\x20predictive','string','\x22%s\x22\x20<%s>','\x22\x22\x20<>','error','inspect','stack','length','undefined','[decremetOriginate]\x20object\x20originated\x20is\x20negative','[decremetOriginate]\x20is\x20null\x20or\x20undefined','contactsRescheduled','[getContactDialer2][ReScheduled]','contacts','AVAILABLE_CONTACTS_FINISHED','sendMessageOneNotActive','talking','waiting','available','NOT_ACTIVE','[syncQueueSummary]\x20Campaign\x20Queue:\x20','is\x20not\x20active','IS_DISACTIVED','is\x20disactive','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','state','statedesc','endtime','loopClearZombieChannels','clearZombieChannels','uniqueId','[uniqueid]','[actions]','enqueue','isNil','Action','status','channel','catch','No\x20such\x20channel','updateOriginated','queue','[Dialer][checkChannel]','[Dialer][checkChannel][ivr]','countReScheduled','[countReScheduled]\x20','checkIsBlackList','resolve','then','[checkIsBlackList]\x20','checkIsBlackListIvr','[checkIsBlackListIvr]\x20','averageHandleTime','avgHandleTime','rescheduleContact','unlockContact','[unlockContact]\x20','getContactDialer','temp','[getContactDialer]\x20','getContactDialerIvr','[getContactDialerIvr]\x20','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','moveContactManagedDialer','[moveContactManagedDialer]\x20','createHistory','[createHistory]\x20','[updateOriginated]\x20object\x20originated\x20is\x20negative','loggerHandler','emptyContact','notFound','pick','ContactId','ListId','UserId','VoiceQueueId','[emptyContact][createHistory]','[emptyContact]','isSuccess','Success','isTrunkReachable','trunks','SIP/%s','reachable','unmonitored','variable','amdstatus','exten','xcally-motion-dialer','dialAMDActive','value','uniqueid','HangupInAMD','membername','AMD','custom:amd','buildObj','amd','saveInDb','[syncHangupInAMD][createHistory]','[syncHangupInAMD]','MACHINE','countmachineretry','countglobal','[syncAgentComplete][createHistory][0]','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countagentrejectretry','dialGlobalMaxRetry','stateGlobal','reason19\x20machine....','dialMachineMaxRetry','createStateFinal','YYYY-MM-DD\x20HH:mm:ss','CampaignId','[rescheduleContact][Machine]','HANGUP','[syncHangupInAMDIvr][createHistory]','Machine','add','dialMachineRetryFrequency','minutes','syncHangup','ivrAnswerCallsDay','[syncHangupIvr]','dialQueueProject','AnswerAGI','cause-txt','Unknow','[syncHangupIvr][createHistory]','reason','agent','agiafterat','dialQueueProject2','dialAgiAfterHangupAgent','[syncAgentComplete][createHistory]','[syncAgentComplete]','syncAgentConnect','answertime','droptime','responsetime','dialQueueTimeout'];(function(_0x56ce7d,_0x57d050){var _0x72a880=function(_0x3179a2){while(--_0x3179a2){_0x56ce7d['push'](_0x56ce7d['shift']());}};_0x72a880(++_0x57d050);}(_0xb49a,0xfb));var _0xab49=function(_0x392dbc,_0x4d31cf){_0x392dbc=_0x392dbc-0x0;var _0x119302=_0xb49a[_0x392dbc];return _0x119302;};'use strict';var util=require(_0xab49('0x0'));var _=require(_0xab49('0x1'));var BPromise=require(_0xab49('0x2'));var uuid=require(_0xab49('0x3'));var moment=require(_0xab49('0x4'));var rr=require('rr');var md5=require('md5');var Redis=require(_0xab49('0x5'));var ut=require(_0xab49('0x6'));var config=require('../../../config/environment/');var logger=require('../../../config/logger')(_0xab49('0x7'));var loggerBooked=require(_0xab49('0x8'))(_0xab49('0x9'));var loggerPredictive=require(_0xab49('0x8'))(_0xab49('0xa'));var loggerPredictiveCalls=require(_0xab49('0x8'))(_0xab49('0xb'));var loggerSyncQueueSummary=require('../../../config/logger')(_0xab49('0xc'));var ami=require(_0xab49('0xd'));config[_0xab49('0xe')]=_[_0xab49('0xf')](config[_0xab49('0xe')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xab49('0xe')]));var cmHopper=require(_0xab49('0x10'));var cmHopperHistory=require(_0xab49('0x11'));var cmHopperBlack=require(_0xab49('0x12'));var voiceQueueRt=require(_0xab49('0x13'));var Action=require('./action');var History=require(_0xab49('0x14'));var Final=require(_0xab49('0x15'));var AgentComplete=require(_0xab49('0x16'));var QueueCallerAbandon=require(_0xab49('0x17'));var Hangup=require(_0xab49('0x18'));var ipAgi=process[_0xab49('0x19')][_0xab49('0x1a')]||_0xab49('0x1b');var strategy={'rrmemory':_0xab49('0x1c'),'roundrobin':_0xab49('0x1d')};var Sequence=function(){};Sequence[_0xab49('0x1e')]['enqueue']=function(_0xcd137f){this[_0xab49('0x1f')]=this[_0xab49('0x1f')]?this[_0xab49('0x1f')][_0xab49('0x20')](_0xcd137f):_0xcd137f();};function Dialer(_0x589dc4,_0x44a3a9){this[_0xab49('0x21')]=new Sequence();this[_0xab49('0x22')]=_0x44a3a9;this[_0xab49('0x23')]=_0x589dc4[_0xab49('0x23')];this['campaigns']=_0x589dc4[_0xab49('0x24')];this[_0xab49('0x25')]=_0x589dc4[_0xab49('0x25')];this['trunks']=_0x589dc4['trunks'];this[_0xab49('0x26')]=config[_0xab49('0x26')]||0x2;this['channels']={};this[_0xab49('0x27')]={};this[_0xab49('0x28')]={};this['uniqueId']={};this[_0xab49('0x29')]={};this['startPredictive']={};this[_0xab49('0x2a')]={};this[_0xab49('0x2b')]={};this['queueBooked']={};this['queueBookedRR']={};ami['on'](_0xab49('0x2c'),this['syncAgentConnect'][_0xab49('0x2d')](this));ami['on']('queuecallerabandon',this[_0xab49('0x2e')][_0xab49('0x2d')](this));ami['on'](_0xab49('0x2f'),this['syncOriginateResponse'][_0xab49('0x2d')](this));ami['on']('agentcomplete',this[_0xab49('0x30')][_0xab49('0x2d')](this));ami['on']('custom:queuesummary',this[_0xab49('0xc')][_0xab49('0x2d')](this));ami['on']('hangup',this['syncHangup'][_0xab49('0x2d')](this));ami['on'](_0xab49('0x31'),this[_0xab49('0x32')]['bind'](this));ami['on'](_0xab49('0x33'),this[_0xab49('0x34')]['bind'](this));ami['on'](_0xab49('0x35'),this[_0xab49('0x36')][_0xab49('0x2d')](this));ami['on']('queuestatuscomplete',this[_0xab49('0x37')]['bind'](this));this[_0xab49('0x38')]();this['loopClearZombieChannels']();}function isNotNull(_0x19f094){return _0x19f094!==null&&!_['isUndefined'](_0x19f094);}function checkIsLoggedIn(_0x134a03,_0x24bd0f){return function(){if(_0x24bd0f<=0x0){_0x134a03[_0xab49('0x39')]=_0xab49('0x3a');throw _0x134a03['name']+_0xab49('0x3b');}};}function isActive(_0x1ea20e){return _0x1ea20e;}function checkIsActive(_0x7bf67f,_0x4a62e8){return function(){if(!isActive(_0x4a62e8)){_0x7bf67f[_0xab49('0x39')]='NOT_ACTIVE';throw _0x7bf67f[_0xab49('0x3c')]+'\x20NOT\x20Active';}};}function checkInterval(_0x4dcb39){return function(){if(!isNotNull(_0x4dcb39['Interval'])){_0x4dcb39[_0xab49('0x39')]='INTERVAL_IS_NULL';throw _0x4dcb39[_0xab49('0x3c')]+_0xab49('0x3d');}if(!isNotNull(_0x4dcb39[_0xab49('0x3e')]['Intervals'])){_0x4dcb39[_0xab49('0x39')]=_0xab49('0x3f');throw _0x4dcb39[_0xab49('0x3c')]+_0xab49('0x3d');}if(!isNotNull(_[_0xab49('0x40')](_0x4dcb39['Interval'][_0xab49('0x41')]))){_0x4dcb39[_0xab49('0x39')]='INTERVAL_IS_NULL';throw _0x4dcb39['name']+_0xab49('0x3d');}};}function msgResponse(_0x29c6cf,_0x30ee5e,_0x224b7f){return{'action':_0x29c6cf,'response':_0x30ee5e,'message':_0x224b7f,'stack':_0x224b7f};}function myreject(_0x325ad9){return function(_0x26daf3){return _0x325ad9(msgResponse(_0xab49('0x42'),_0xab49('0x43'),JSON[_0xab49('0x44')](_0x26daf3)));};}function getSeconds(_0x43027f,_0x2b3ea5){var _0x3769ce=moment(_0x43027f)[_0xab49('0x45')](0x0);var _0x4a9f39=moment(_0x2b3ea5)[_0xab49('0x45')](0x0);return _0x3769ce[_0xab49('0x46')](_0x4a9f39,_0xab49('0x47'));}function emit(_0x46e359,_0x3c8155,_0x57c068){io['to'](_0x46e359)[_0xab49('0x48')](_0x3c8155,_0x57c068);}function emitVoiceQueueSummary(_0x500f32){if(_0x500f32['type']===_0xab49('0x49')){var _0x254806={'id':_0x500f32['id'],'name':_0x500f32[_0xab49('0x3c')],'strategy':_0x500f32[_0xab49('0x4a')],'answered':_0x500f32[_0xab49('0x4b')],'available':_0x500f32['available'],'loggedIn':_0x500f32[_0xab49('0x4c')],'pTalking':_0x500f32[_0xab49('0x4d')],'sumBillable':_0x500f32[_0xab49('0x4e')],'sumDuration':_0x500f32[_0xab49('0x4f')],'sumHoldTime':_0x500f32[_0xab49('0x50')]||0x0,'talking':_0x500f32['talking'],'total':_0x500f32['total'],'type':_0x500f32[_0xab49('0x51')],'unmanaged':_0x500f32[_0xab49('0x52')],'abandoned':_0x500f32[_0xab49('0x53')],'waiting':_0x500f32['waiting'],'loggedInDb':_0x500f32[_0xab49('0x54')],'dialActive':_0x500f32['dialActive'],'dialMethod':_0x500f32['dialMethod'],'dialOriginateCallerIdName':_0x500f32['dialOriginateCallerIdName'],'dialOriginateCallerIdNumber':_0x500f32['dialOriginateCallerIdNumber'],'dialOriginateTimeout':_0x500f32[_0xab49('0x55')],'dialPrefix':_0x500f32[_0xab49('0x56')],'outboundAnswerAgiCallsDay':_0x500f32[_0xab49('0x57')],'outboundAnswerCallsDay':_0x500f32[_0xab49('0x58')],'outboundBlacklistCallsDay':_0x500f32[_0xab49('0x59')],'outboundBusyCallsDay':_0x500f32[_0xab49('0x5a')],'outboundCongestionCallsDay':_0x500f32[_0xab49('0x5b')],'outboundDropCallsDayACS':_0x500f32[_0xab49('0x5c')],'outboundDropCallsDayCallersExit':_0x500f32[_0xab49('0x5d')],'outboundDropCallsDayTimeout':_0x500f32[_0xab49('0x5e')],'outboundNoAnswerCallsDay':_0x500f32['outboundNoAnswerCallsDay'],'outboundNoSuchCallsDay':_0x500f32[_0xab49('0x5f')],'outboundOriginateFailureCallsDay':_0x500f32[_0xab49('0x60')],'outboundReCallsDay':_0x500f32['outboundReCallsDay'],'outboundRejectCallsDay':_0x500f32[_0xab49('0x61')],'outboundUnknownCallsDay':_0x500f32[_0xab49('0x62')],'predictiveIntervalAnsweredCalls':_0x500f32[_0xab49('0x63')],'predictiveIntervalAvgHoldtime':_0x500f32[_0xab49('0x64')],'predictiveIntervalAvgTalktime':_0x500f32[_0xab49('0x65')],'predictiveIntervalDroppedCallsCallersExit':_0x500f32[_0xab49('0x66')],'predictiveIntervalDroppedCallsTimeout':_0x500f32[_0xab49('0x67')],'predictiveIntervalErlangCalls':_0x500f32[_0xab49('0x68')],'predictiveIntervalErlangCallsDroppedCalls':_0x500f32['predictiveIntervalErlangCallsDroppedCalls'],'predictiveIntervalHitRate':_0x500f32[_0xab49('0x69')],'predictiveIntervalMultiplicativeFactor':_0x500f32[_0xab49('0x6a')],'predictiveIntervalPauses':_0x500f32[_0xab49('0x6b')],'predictiveIntervalAvailable':_0x500f32['predictiveIntervalAvailable'],'predictiveIntervalTotalCalls':_0x500f32[_0xab49('0x6c')],'message':_0x500f32[_0xab49('0x39')],'originated':_0x500f32[_0xab49('0x6d')],'erlangCalls':_0x500f32[_0xab49('0x6e')],'erlangCallToSecond':_0x500f32[_0xab49('0x6f')],'erlangAbandonmentRate':_0x500f32[_0xab49('0x70')],'erlangBusyFactor':_0x500f32['erlangBusyFactor'],'startPredictive':_0x500f32[_0xab49('0x71')],'startProgressive':_0x500f32[_0xab49('0x2a')]};if(_0x500f32[_0xab49('0x72')]){_0x254806[_0xab49('0x72')]={'id':_0x500f32[_0xab49('0x72')]['id'],'name':_0x500f32[_0xab49('0x72')]['name'],'active':_0x500f32[_0xab49('0x72')][_0xab49('0x73')],'callerid':_0x500f32[_0xab49('0x72')][_0xab49('0x74')]};}if(_0x500f32[_0xab49('0x3e')]){_0x254806[_0xab49('0x3e')]={'id':_0x500f32[_0xab49('0x3e')]['id'],'name':_0x500f32[_0xab49('0x3e')][_0xab49('0x3c')]};}var _0xfb7d69=md5(JSON[_0xab49('0x44')](_0x254806));if(_0x500f32[_0xab49('0x75')]!==_0xfb7d69){_0x500f32['md5']=_0xfb7d69;emit(util[_0xab49('0x76')](_0xab49('0x77'),_0x254806[_0xab49('0x3c')]),_0xab49('0x78'),_0x254806);}}}function emitCampaignSummary(_0x1212f5){if(_0x1212f5[_0xab49('0x51')]===_0xab49('0x79')){emit(util['format'](_0xab49('0x7a'),_0x1212f5['name']),_0xab49('0x7b'),_0x1212f5);}}function checkGetDataPredictive(_0x49c9ad){if(isNotNull(_0x49c9ad)&&!_[_0xab49('0x40')](_0x49c9ad)){loggerPredictive[_0xab49('0x7c')]('-----\x20Stats\x20Predictive\x20---');loggerPredictive[_0xab49('0x7c')](_0xab49('0x7d'),_0x49c9ad[_0xab49('0x6c')]);loggerPredictive[_0xab49('0x7c')](_0xab49('0x7e'),_0x49c9ad[_0xab49('0x63')]);loggerPredictive[_0xab49('0x7c')](_0xab49('0x7f'),_0x49c9ad[_0xab49('0x67')]);loggerPredictive[_0xab49('0x7c')](_0xab49('0x80'),_0x49c9ad[_0xab49('0x66')]);loggerPredictive[_0xab49('0x7c')](_0xab49('0x81'),_0x49c9ad[_0xab49('0x64')]);loggerPredictive[_0xab49('0x7c')](_0xab49('0x82'),_0x49c9ad['predictiveIntervalAvgTalktime']);loggerPredictive[_0xab49('0x7c')](_0xab49('0x83'));if(_0x49c9ad[_0xab49('0x6c')]>0x0){if(!_[_0xab49('0x84')](_0x49c9ad[_0xab49('0x65')])&&_0x49c9ad['predictiveIntervalAvgTalktime']>0x0){return!![];}loggerPredictive[_0xab49('0x7c')](_0xab49('0x85'));if(!_[_0xab49('0x84')](_0x49c9ad[_0xab49('0x64')])&&_0x49c9ad[_0xab49('0x64')]>0x0){return!![];}loggerPredictive[_0xab49('0x7c')]('Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive');}else{loggerPredictive[_0xab49('0x7c')](_0xab49('0x86'));}}else{loggerPredictive[_0xab49('0x7c')](_0xab49('0x87'));}return![];}function mergeDataErlangB(_0x58dd44){return function(_0x5d287f){loggerPredictive[_0xab49('0x7c')]('---------\x20ErlangB\x20---------');loggerPredictive[_0xab49('0x7c')](_0xab49('0x88'),_0x5d287f[_0xab49('0x6e')]);loggerPredictive[_0xab49('0x7c')](_0xab49('0x89'),_0x5d287f[_0xab49('0x6f')]);loggerPredictive[_0xab49('0x7c')](_0xab49('0x8a'),_0x5d287f['erlangAbandonmentRate']);loggerPredictive[_0xab49('0x7c')](_0xab49('0x8b'),_0x5d287f[_0xab49('0x8c')]);loggerPredictive[_0xab49('0x7c')](_0xab49('0x8a'),_0x5d287f['erlangAbandonmentRate']);loggerPredictive[_0xab49('0x7c')](_0xab49('0x83'));_[_0xab49('0x8d')](_0x58dd44,_0x5d287f);};}function getDiff(_0x4464bd){var _0x32cdf2=moment()[_0xab49('0x45')](0x0);var _0x2ff48d=moment(_0x4464bd)[_0xab49('0x45')](0x0);return _0x32cdf2[_0xab49('0x46')](_0x2ff48d,_0xab49('0x47'));}function ifInterval(_0xeccf30,_0x2029d1){if(_[_0xab49('0x84')](_0x2029d1)){return![];}return getDiff(_0x2029d1)<_0xeccf30*0x3c;}function freeVariablesPredictive(_0x5914cd){if(isNotNull(_0x5914cd)){if(!_[_0xab49('0x84')](_0x5914cd[_0xab49('0x2a')])){_0x5914cd[_0xab49('0x2a')]=undefined;loggerPredictive[_0xab49('0x7c')](_0x5914cd[_0xab49('0x3c')],_0xab49('0x8e'));}if(!_[_0xab49('0x84')](_0x5914cd[_0xab49('0x71')])){_0x5914cd[_0xab49('0x71')]=undefined;loggerPredictive[_0xab49('0x7c')](_0x5914cd['name'],_0xab49('0x8f'));}if(!_[_0xab49('0x84')](_0x5914cd['handlePredictive'])){clearInterval(_0x5914cd[_0xab49('0x90')]);_0x5914cd[_0xab49('0x90')]=undefined;loggerPredictive[_0xab49('0x7c')](_0x5914cd['name'],_0xab49('0x91'));}}}function erlangb(_0x47509b,_0x51386a){if(_0x51386a===0x0){return 0x0;}var _0x47b7f4=0x1;for(var _0x425d2e=0x1;_0x425d2e<=_0x51386a;_0x425d2e+=0x1){_0x47b7f4=0x1+_0x47b7f4*_0x425d2e/_0x47509b;}return 0x1/_0x47b7f4;}function isVoiceQueueOutbound(_0x376163){return _0x376163===_0xab49('0x49');}function isNotPreview(_0x48fb06){return _0x48fb06!=='preview';}function isCampaignIvr(_0x148ff0){return _0x148ff0===_0xab49('0x79');}function getCallerId(_0x370987,_0x10e23c,_0x1195e4){if(!_[_0xab49('0x84')](_0x1195e4)&&typeof _0x1195e4===_0xab49('0x92')&&!_[_0xab49('0x40')](_0x1195e4)){if(!_['isUndefined'](_0x10e23c)&&typeof _0x10e23c==='string'&&!_[_0xab49('0x40')](_0x10e23c)){return util[_0xab49('0x76')](_0xab49('0x93'),_0x10e23c,_0x1195e4);}return util[_0xab49('0x76')](_0xab49('0x93'),_0x1195e4,_0x1195e4);}if(!_[_0xab49('0x84')](_0x370987)&&typeof _0x370987===_0xab49('0x92')&&!_[_0xab49('0x40')](_0x370987)){return _0x370987;}return _0xab49('0x94');}function loggerCatchQueueSummary(_0x4371ae,_0x47d36d){return function(_0x146c78){freeVariablesPredictive(_0x47d36d);emitVoiceQueueSummary(_0x47d36d);emitCampaignSummary(_0x47d36d);loggerSyncQueueSummary[_0xab49('0x95')](_0x4371ae,util[_0xab49('0x96')](_0x146c78,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0x685962,_0xc80b1e){return function(_0x219a2f){loggerPredictive[_0xab49('0x95')](_0xc80b1e[_0xab49('0x3c')],_0x685962);loggerPredictive['error'](_0x219a2f[_0xab49('0x97')]);freeVariablesPredictive(_0xc80b1e);};}function loggerCatch(_0x4934fa){return function(_0x21665f){logger[_0xab49('0x95')](_0x4934fa,util[_0xab49('0x96')](_0x21665f,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0x5433d8){return _0x5433d8&&!_[_0xab49('0x84')](_0x5433d8)&&_0x5433d8[_0xab49('0x98')]>0x0;}function decremetOriginate(_0x553fc5){if(!_[_0xab49('0x84')](_0x553fc5)&&_0x553fc5!==null){if(typeof _0x553fc5[_0xab49('0x6d')]!==_0xab49('0x99')){if(_0x553fc5[_0xab49('0x6d')]>0x0){_0x553fc5[_0xab49('0x6d')]-=0x1;}else{logger[_0xab49('0x95')](_0xab49('0x9a'));}}}else{logger[_0xab49('0x95')](_0xab49('0x9b'));}}function checkContactLowerLimitOriginate(_0x46bdda,_0x366a3c,_0x26e8c5){if(_0x366a3c>_0x26e8c5){for(var _0x34906b=0x0;_0x34906b<_0x366a3c-_0x26e8c5;_0x34906b+=0x1){decremetOriginate(_0x46bdda);}}}function loggerGetContactDialer(_0x5dfb3c,_0x396686,_0x8b3050){return function(_0x1bd470){checkContactLowerLimitOriginate(_0x396686,_0x8b3050,0x0);logger['error'](_0x5dfb3c,util[_0xab49('0x96')](_0x1bd470,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x31c823){return function(_0x56892f){if(isNotNull(_0x56892f)&&isNotNull(_0x56892f[0x0])){if(_0x56892f[0x0][_0xab49('0x9c')]>0x0){_0x31c823[_0xab49('0x39')]='RESCHEDULED_CONTACTS';logger[_0xab49('0x7c')](_0xab49('0x9d')+_0x31c823[_0xab49('0x3c')],_0x56892f[0x0][_0xab49('0x9c')],_0xab49('0x9e'));}else{_0x31c823[_0xab49('0x39')]=_0xab49('0x9f');logger[_0xab49('0x7c')]('[getContactDialer2][Empty]'+_0x31c823['name']);}}};}function notSendMessagesQueue(_0x45597b){if(_0x45597b[_0xab49('0xa0')]){freeVariablesPredictive(_0x45597b);if(_0x45597b[_0xab49('0x6d')]===0x0&&_0x45597b[_0xab49('0xa1')]===0x0&&_0x45597b[_0xab49('0xa2')]===0x0&&(_0x45597b[_0xab49('0x4d')]||0x0)===0x0){_0x45597b[_0xab49('0xa0')]=![];_0x45597b[_0xab49('0xa3')]=0x0;_0x45597b['message']=_0xab49('0xa4');loggerSyncQueueSummary['error'](_0xab49('0xa5'),_0x45597b[_0xab49('0x3c')],_0xab49('0xa6'));}else{_0x45597b[_0xab49('0x39')]=_0xab49('0xa7');loggerSyncQueueSummary[_0xab49('0x95')](_0xab49('0xa5'),_0x45597b[_0xab49('0x3c')],_0xab49('0xa8'));}emitVoiceQueueSummary(_0x45597b);}}function notSendMessagesCampaign(_0x40e622){if(_0x40e622[_0xab49('0xa0')]){if(_0x40e622[_0xab49('0x6d')]===0x0){_0x40e622[_0xab49('0xa0')]=![];_0x40e622[_0xab49('0x39')]=_0xab49('0xa4');loggerSyncQueueSummary[_0xab49('0x95')]('[syncQueueSummary]\x20Campaign\x20Ivr:\x20',_0x40e622['name'],_0xab49('0xa6'));}else{_0x40e622[_0xab49('0x39')]=_0xab49('0xa7');loggerSyncQueueSummary[_0xab49('0x95')](_0xab49('0xa9'),_0x40e622[_0xab49('0x3c')],'is\x20disactive');}emitCampaignSummary(_0x40e622);}}function createObjHistory(_0x2d9a10,_0x59f66b,_0x4fff45,_0x131acd,_0x4cc02b){_0x2d9a10[_0xab49('0x39')]=_0x4fff45;var _0x1bb224=new Action(_0x2d9a10,_0x59f66b);var _0x59d910=new History(_0x1bb224);_0x59d910[_0xab49('0xaa')]=_0x131acd;_0x59d910[_0xab49('0xab')]=_0x4cc02b;_0x59d910[_0xab49('0xac')]=_0x1bb224['starttime'];return _0x59d910;}Dialer['prototype'][_0xab49('0xad')]=function(){var _0x9e2718=this;setInterval(function(){_0x9e2718[_0xab49('0xae')](_0x9e2718[_0xab49('0xaf')],_0xab49('0xb0'));_0x9e2718[_0xab49('0xae')](_0x9e2718['actions'],_0xab49('0xb1'));},0x32c8);};Dialer['prototype'][_0xab49('0xae')]=function(_0x58c7ab,_0xf69bf9){var _0x1d3bb1=this;for(var _0x520fa1 in _0x58c7ab){if(typeof _0x58c7ab[_0x520fa1]!=='undefined'){this[_0xab49('0x21')][_0xab49('0xb2')](function(){if(!_[_0xab49('0xb3')](_0x58c7ab[_0x520fa1])){return ami[_0xab49('0xb4')]({'action':_0xab49('0xb5'),'channel':_0x58c7ab[_0x520fa1][_0xab49('0xb6')]})[_0xab49('0xb7')](function(_0x5dce5d){if(_0x5dce5d['message']===_0xab49('0xb8')){setTimeout(function(){if(_0x58c7ab[_0x520fa1]&&_0x58c7ab[_0x520fa1]['type']!=='ivr'){_0x1d3bb1[_0xab49('0xb9')](_0x1d3bb1[_0xab49('0x23')][_0x58c7ab[_0x520fa1][_0xab49('0xba')]]);logger[_0xab49('0x95')](_0xab49('0xbb'),_0xf69bf9,_0x520fa1,_0x58c7ab[_0x520fa1]['queue']);delete _0x58c7ab[_0x520fa1];}if(_0x58c7ab[_0x520fa1]&&_0x58c7ab[_0x520fa1][_0xab49('0x51')]===_0xab49('0x79')){_0x1d3bb1[_0xab49('0xb9')](_0x1d3bb1[_0xab49('0x24')][_0x58c7ab[_0x520fa1][_0xab49('0xba')]]);logger[_0xab49('0x95')](_0xab49('0xbc'),_0xf69bf9,_0x520fa1,_0x58c7ab[_0x520fa1][_0xab49('0xba')]);delete _0x58c7ab[_0x520fa1];}},0x2328);}});}});}}};Dialer['prototype'][_0xab49('0xbd')]=function(_0x43ae09){return BPromise['resolve']()['then'](cmHopper['countReScheduled'](_0x43ae09))[_0xab49('0xb7')](loggerCatch(_0xab49('0xbe')));};Dialer[_0xab49('0x1e')][_0xab49('0xbf')]=function(_0x2d93cd){return BPromise[_0xab49('0xc0')]()[_0xab49('0xc1')](cmHopperBlack['checkIsBlackList'](_0x2d93cd))[_0xab49('0xb7')](loggerCatch(_0xab49('0xc2')));};Dialer[_0xab49('0x1e')][_0xab49('0xc3')]=function(_0x32c3e0){return BPromise['resolve']()[_0xab49('0xc1')](cmHopperBlack[_0xab49('0xc3')](_0x32c3e0))[_0xab49('0xb7')](loggerCatch(_0xab49('0xc4')));};Dialer['prototype'][_0xab49('0xc5')]=function(_0x4e7d9b){return BPromise['resolve']()[_0xab49('0xc1')](cmHopperHistory[_0xab49('0xc6')](_0x4e7d9b))[_0xab49('0xb7')](loggerCatch('[averageHandleTime]\x20'));};Dialer[_0xab49('0x1e')][_0xab49('0xc7')]=function(_0x1ff13f){return BPromise['resolve']()['then'](cmHopper[_0xab49('0xc7')](_0x1ff13f))[_0xab49('0xb7')](loggerCatch('[rescheduleContact]\x20'));};Dialer[_0xab49('0x1e')][_0xab49('0xc8')]=function(_0x49d6b1,_0x3c92f9,_0x5ac69e){return BPromise['resolve']()[_0xab49('0xc1')](cmHopper[_0xab49('0xc8')](_0x49d6b1,_0x3c92f9,_0x5ac69e))['catch'](loggerCatch(_0xab49('0xc9')));};Dialer[_0xab49('0x1e')][_0xab49('0xca')]=function(_0x9054fa,_0x20410f,_0x4200b6,_0x45632a,_0x14ba43){return BPromise[_0xab49('0xc0')]()[_0xab49('0xc1')](cmHopper['getContactDialer'](_0x9054fa,_0x20410f,_0x4200b6,_0x45632a))[_0xab49('0xb7')](function(_0x32e066){_0x14ba43[_0xab49('0xcb')]-=_0x4200b6;_0x14ba43['temp']=_0x14ba43[_0xab49('0xcb')]>0x0?_0x14ba43[_0xab49('0xcb')]:0x0;loggerCatch(_0xab49('0xcc'))(_0x32e066);});};Dialer['prototype'][_0xab49('0xcd')]=function(_0x5d6529,_0x4dfc20,_0x139e28,_0x5cdd4c){return BPromise[_0xab49('0xc0')]()[_0xab49('0xc1')](cmHopper[_0xab49('0xcd')](_0x5d6529,_0x4dfc20,_0x139e28))['catch'](function(_0x1c52ca){_0x5cdd4c[_0xab49('0xcb')]-=_0x4dfc20;_0x5cdd4c[_0xab49('0xcb')]=_0x5cdd4c[_0xab49('0xcb')]>0x0?_0x5cdd4c[_0xab49('0xcb')]:0x0;loggerCatch(_0xab49('0xce'))(_0x1c52ca);});};Dialer[_0xab49('0x1e')][_0xab49('0xcf')]=function(_0x1935e6){return BPromise[_0xab49('0xc0')]()[_0xab49('0xc1')](voiceQueueRt[_0xab49('0xcf')](_0x1935e6))['catch'](loggerCatch(_0xab49('0xd0')));};Dialer[_0xab49('0x1e')]['moveContactManagedDialer']=function(_0x557a7d){return BPromise[_0xab49('0xc0')]()[_0xab49('0xc1')](cmHopper[_0xab49('0xd1')](_0x557a7d))[_0xab49('0xb7')](loggerCatch(_0xab49('0xd2')));};Dialer['prototype'][_0xab49('0xd3')]=function(_0x5942d8){return BPromise['resolve']()[_0xab49('0xc1')](cmHopperHistory[_0xab49('0xd3')](_0x5942d8))[_0xab49('0xb7')](loggerCatch(_0xab49('0xd4')));};Dialer[_0xab49('0x1e')][_0xab49('0xb9')]=function(_0x2ef292){if(!_[_0xab49('0x84')](_0x2ef292)&&_0x2ef292!==null){if(typeof _0x2ef292[_0xab49('0x6d')]!==_0xab49('0x99')){if(_0x2ef292['originated']>0x0){_0x2ef292['originated']-=0x1;}else{logger[_0xab49('0x95')](_0xab49('0xd5'));}}}else{logger[_0xab49('0x95')]('[updateOriginated]\x20is\x20null\x20or\x20undefined');}};Dialer[_0xab49('0x1e')][_0xab49('0xd6')]=function(_0x391136,_0x2cc47f){var _0x3588cf=this;return function(_0x16bb4b){_0x3588cf[_0xab49('0xb9')](_0x2cc47f);logger[_0xab49('0x95')](_0x391136,util['inspect'](_0x16bb4b,{'showHidden':![],'depth':null}));};};Dialer['prototype'][_0xab49('0xd7')]=function(_0x498e29,_0x571f9a,_0x589d46){var _0x37436b={'state':0x19,'statedesc':_0xab49('0xd8')};this[_0xab49('0xb9')](_0x571f9a);this['saveInDb'](_['merge'](_0x37436b,_[_0xab49('0xd9')](_0x589d46,[_0xab49('0xda'),_0xab49('0xdb'),_0xab49('0xdc'),_0xab49('0xdd'),'CampaignId'])),_0xab49('0xde'),_0xab49('0xdf'));logger[_0xab49('0x95')](_0x498e29);};Dialer[_0xab49('0x1e')][_0xab49('0xe0')]=function(_0x4944c4){return _0x4944c4===_0xab49('0xe1');};Dialer[_0xab49('0x1e')][_0xab49('0xe2')]=function(_0x33300b){return!_[_0xab49('0x84')](_0x33300b)&&_0x33300b&&!_[_0xab49('0x84')](_0x33300b[_0xab49('0x3c')])&&!_[_0xab49('0x84')](_0x33300b[_0xab49('0x73')])&&_0x33300b[_0xab49('0x73')]&&(this[_0xab49('0xe3')][util[_0xab49('0x76')](_0xab49('0xe4'),_0x33300b[_0xab49('0x3c')])][_0xab49('0xb5')]===_0xab49('0xe5')||this[_0xab49('0xe3')][util['format'](_0xab49('0xe4'),_0x33300b['name'])]['status']===_0xab49('0xe6'));};Dialer[_0xab49('0x1e')]['saveInDb']=function(_0x2edd1e,_0x57225a,_0x760c38){this[_0xab49('0xd3')](_0x2edd1e)[_0xab49('0xb7')](loggerCatch(_0x57225a));this[_0xab49('0xd1')](_0x2edd1e)['catch'](loggerCatch(_0x760c38));};Dialer[_0xab49('0x1e')][_0xab49('0x34')]=function(_0x38781a){var _0x471964=this[_0xab49('0xaf')][_0x38781a['uniqueid']];var _0x50529b;if(!_[_0xab49('0xb3')](_0x38781a)&&!_[_0xab49('0xb3')](_0x38781a[_0xab49('0xe7')])&&!_[_0xab49('0xb3')](_0x38781a[_0xab49('0xe7')][_0xab49('0xe8')])&&_0x38781a[_0xab49('0xe9')]===_0xab49('0xea')&&_0x471964){if(_0x471964[_0xab49('0x51')]!=='ivr'&&this[_0xab49('0x23')][_0x471964[_0xab49('0xba')]][_0xab49('0xeb')]&&_0x38781a[_0xab49('0xec')]==='HANGUP'){delete this[_0xab49('0xaf')][_0x38781a[_0xab49('0xed')]];this[_0xab49('0xb9')](this[_0xab49('0x23')][_0x471964[_0xab49('0xba')]]);this[_0xab49('0x23')][_0x471964['queue']][_0xab49('0x58')]+=0x1;this[_0xab49('0x23')][_0x471964[_0xab49('0xba')]][_0xab49('0x57')]+=0x1;_0x50529b=new Hangup(_0x471964,_0x38781a);_0x50529b[_0xab49('0xaa')]=0x12;_0x50529b[_0xab49('0xab')]=_0xab49('0xee');_0x50529b[_0xab49('0xef')]=_0xab49('0xf0');ami[_0xab49('0x48')](_0xab49('0xf1'),ut[_0xab49('0xf2')](_0x50529b,_0xab49('0xf3')));this[_0xab49('0xf4')](_0x50529b,_0xab49('0xf5'),_0xab49('0xf6'));}if(_0x471964[_0xab49('0x51')]!==_0xab49('0x79')&&this['voiceQueues'][_0x471964[_0xab49('0xba')]]['dialAMDActive']&&_0x38781a[_0xab49('0xec')]===_0xab49('0xf7')){var _0x37c9fa=this;return new BPromise(function(_0x542c33,_0x31eed0){delete _0x37c9fa[_0xab49('0xaf')][_0x38781a[_0xab49('0xed')]];_0x37c9fa[_0xab49('0xb9')](_0x37c9fa['voiceQueues'][_0x471964['queue']]);_0x37c9fa[_0xab49('0x23')][_0x471964[_0xab49('0xba')]][_0xab49('0x58')]+=0x1;_0x37c9fa[_0xab49('0x23')][_0x471964['queue']][_0xab49('0x57')]+=0x1;var _0x1c97a1=_0x37c9fa[_0xab49('0x23')][_0x471964[_0xab49('0xba')]];var _0xbc8830=new Hangup(_0x471964,_0x38781a);_0xbc8830[_0xab49('0xaa')]=0x13;_0xbc8830[_0xab49('0xab')]='Machine';_0xbc8830[_0xab49('0xef')]=_0xab49('0xf0');_0xbc8830[_0xab49('0xf8')]+=0x1;_0xbc8830[_0xab49('0xf9')]+=0x1;_0xbc8830[_0xab49('0xf3')]=!![];ami[_0xab49('0x48')](_0xab49('0xf1'),ut[_0xab49('0xf2')](_0xbc8830,_0xab49('0xf3')));_0x37c9fa[_0xab49('0xd3')](_0xbc8830)[_0xab49('0xb7')](loggerCatch(_0xab49('0xfa')));if(_0xbc8830[_0xab49('0xfb')]+_0xbc8830[_0xab49('0xfc')]+_0xbc8830[_0xab49('0xfd')]+_0xbc8830[_0xab49('0xfe')]+_0xbc8830[_0xab49('0xff')]+_0xbc8830[_0xab49('0x100')]+_0xbc8830[_0xab49('0xf8')]+_0xbc8830[_0xab49('0x101')]>=_0x1c97a1[_0xab49('0x102')]){_0x37c9fa[_0xab49('0x103')](_0xbc8830,_0x542c33,_0x31eed0,_0xab49('0x104'));}else{if(_0xbc8830[_0xab49('0xf8')]>=_0x1c97a1[_0xab49('0x105')]){_0x37c9fa[_0xab49('0x106')](_0xbc8830,_0x542c33,_0x31eed0,'reason\x2019\x20machine....');}else{_0x37c9fa[_0xab49('0xc7')]({'active':![],'countmachineretry':_0xbc8830[_0xab49('0xf8')],'scheduledat':moment()['add'](_0x1c97a1['dialMachineRetryFrequency'],'minutes')[_0xab49('0x76')](_0xab49('0x107')),'ContactId':_0xbc8830[_0xab49('0xda')],'ListId':_0xbc8830['ListId'],'VoiceQueueId':_0xbc8830[_0xab49('0xdd')]||undefined,'CampaignId':_0xbc8830[_0xab49('0x108')]||undefined})[_0xab49('0xb7')](loggerCatch(_0xab49('0x109')));_0x542c33({'reschedule':0x1});}}});}if(_0x471964[_0xab49('0x51')]===_0xab49('0x79')&&this[_0xab49('0x24')][_0x471964[_0xab49('0xba')]]['dialAMDActive']&&_0x38781a[_0xab49('0xec')]===_0xab49('0x10a')){delete this[_0xab49('0xaf')][_0x38781a[_0xab49('0xed')]];this[_0xab49('0xb9')](this['campaigns'][_0x471964[_0xab49('0xba')]]);_0x50529b=new Hangup(_0x471964,_0x38781a);_0x50529b[_0xab49('0xaa')]=0x12;_0x50529b['statedesc']=_0xab49('0xee');_0x50529b[_0xab49('0xef')]=_0xab49('0xf0');ami['emit'](_0xab49('0xf1'),ut[_0xab49('0xf2')](_0x50529b,_0xab49('0xf3')));this[_0xab49('0xf4')](_0x50529b,_0xab49('0x10b'),'[syncHangupInAMDIvr]');}if(_0x471964[_0xab49('0x51')]==='ivr'&&this[_0xab49('0x24')][_0x471964[_0xab49('0xba')]][_0xab49('0xeb')]&&_0x38781a['value']===_0xab49('0xf7')){var _0x37c9fa=this;return new BPromise(function(_0x2300a4,_0x2b3724){delete _0x37c9fa[_0xab49('0xaf')][_0x38781a['uniqueid']];_0x37c9fa[_0xab49('0xb9')](_0x37c9fa['campaigns'][_0x471964['queue']]);_0x37c9fa['campaigns'][_0x471964[_0xab49('0xba')]]['outboundAnswerCallsDay']+=0x1;_0x37c9fa['campaigns'][_0x471964['queue']][_0xab49('0x57')]+=0x1;var _0x4ae0f3=_0x37c9fa['campaigns'][_0x471964['queue']];var _0x5d28c9=new Hangup(_0x471964,_0x38781a);_0x5d28c9[_0xab49('0xaa')]=0x13;_0x5d28c9['statedesc']=_0xab49('0x10c');_0x5d28c9['membername']=_0xab49('0xf0');_0x5d28c9['countmachineretry']+=0x1;_0x5d28c9[_0xab49('0xf9')]+=0x1;_0x5d28c9[_0xab49('0xf3')]=!![];ami['emit'](_0xab49('0xf1'),ut[_0xab49('0xf2')](_0x5d28c9,_0xab49('0xf3')));_0x37c9fa[_0xab49('0xd3')](_0x5d28c9)[_0xab49('0xb7')](loggerCatch(_0xab49('0xfa')));if(_0x5d28c9[_0xab49('0xfb')]+_0x5d28c9[_0xab49('0xfc')]+_0x5d28c9[_0xab49('0xfd')]+_0x5d28c9[_0xab49('0xfe')]+_0x5d28c9[_0xab49('0xff')]+_0x5d28c9[_0xab49('0x100')]+_0x5d28c9[_0xab49('0xf8')]+_0x5d28c9[_0xab49('0x101')]>=_0x4ae0f3[_0xab49('0x102')]){_0x37c9fa[_0xab49('0x103')](_0x5d28c9,_0x2300a4,_0x2b3724,_0xab49('0x104'));}else{if(_0x5d28c9['countmachineretry']>=_0x4ae0f3['dialMachineMaxRetry']){_0x37c9fa[_0xab49('0x106')](_0x5d28c9,_0x2300a4,_0x2b3724,'reason\x2019\x20machine....');}else{_0x37c9fa['rescheduleContact']({'active':![],'countmachineretry':_0x5d28c9[_0xab49('0xf8')],'scheduledat':moment()[_0xab49('0x10d')](_0x4ae0f3[_0xab49('0x10e')],_0xab49('0x10f'))[_0xab49('0x76')](_0xab49('0x107')),'ContactId':_0x5d28c9[_0xab49('0xda')],'ListId':_0x5d28c9['ListId'],'VoiceQueueId':_0x5d28c9['VoiceQueueId']||undefined,'CampaignId':_0x5d28c9['CampaignId']||undefined})[_0xab49('0xb7')](loggerCatch(_0xab49('0x109')));_0x2300a4({'reschedule':0x1});}}});}}};Dialer[_0xab49('0x1e')][_0xab49('0x110')]=function(_0x3304df){var _0x5f4733=this[_0xab49('0xaf')][_0x3304df['uniqueid']];var _0x41b21f=this;var _0x28bc40;if(_0x5f4733&&_0x5f4733[_0xab49('0x51')]===_0xab49('0x79')){delete this[_0xab49('0xaf')][_0x3304df[_0xab49('0xed')]];this['updateOriginated'](this[_0xab49('0x24')][_0x5f4733[_0xab49('0xba')]]);this[_0xab49('0x24')][_0x5f4733[_0xab49('0xba')]][_0xab49('0x111')]+=0x1;_0x28bc40=new Hangup(_0x5f4733,_0x3304df);this[_0xab49('0xd3')](_0x28bc40)['catch'](loggerCatch('[syncHangupIvr][createHistory]'));this[_0xab49('0xd1')](_0x28bc40)[_0xab49('0xb7')](loggerCatch(_0xab49('0x112')));}if(_0x5f4733&&_0x5f4733['type']!==_0xab49('0x79')&&isNotNull(this[_0xab49('0x23')][_0x5f4733['queue']][_0xab49('0x113')])){delete this['uniqueId'][_0x3304df[_0xab49('0xed')]];this[_0xab49('0xb9')](this[_0xab49('0x23')][_0x5f4733[_0xab49('0xba')]]);this[_0xab49('0x23')][_0x5f4733[_0xab49('0xba')]][_0xab49('0x58')]+=0x1;this['voiceQueues'][_0x5f4733[_0xab49('0xba')]]['outboundAnswerAgiCallsDay']+=0x1;_0x28bc40=new Hangup(_0x5f4733,_0x3304df);_0x28bc40[_0xab49('0xaa')]=0x10;_0x28bc40[_0xab49('0xab')]=_0xab49('0x114');_0x28bc40[_0xab49('0xef')]='AGI';this['createHistory'](_0x28bc40)[_0xab49('0xb7')](loggerCatch('[syncHangupIvr][createHistory]'));this[_0xab49('0xd1')](_0x28bc40)[_0xab49('0xb7')](loggerCatch('[syncHangupIvr]'));}if(_0x5f4733&&_0x5f4733[_0xab49('0x51')]!=='ivr'&&!isNotNull(this[_0xab49('0x23')][_0x5f4733[_0xab49('0xba')]][_0xab49('0x113')])){delete this['uniqueId'][_0x3304df['uniqueid']];this['updateOriginated'](this[_0xab49('0x23')][_0x5f4733[_0xab49('0xba')]]);this[_0xab49('0x23')][_0x5f4733[_0xab49('0xba')]][_0xab49('0x62')]+=0x1;_0x28bc40=new Hangup(_0x5f4733,_0x3304df);_0x28bc40[_0xab49('0xaa')]=0xc;_0x28bc40[_0xab49('0xab')]=_0x3304df[_0xab49('0x115')];_0x28bc40['membername']=_0xab49('0x116');this[_0xab49('0xd3')](_0x28bc40)[_0xab49('0xb7')](loggerCatch(_0xab49('0x117')));this[_0xab49('0xd1')](_0x28bc40)[_0xab49('0xb7')](loggerCatch(_0xab49('0x112')));}};Dialer[_0xab49('0x1e')][_0xab49('0x30')]=function(_0x1024bf){var _0x316a45=this[_0xab49('0xaf')][_0x1024bf[_0xab49('0xed')]];var _0x28d661=this;if(this['voiceQueues'][_0x1024bf[_0xab49('0xba')]]){if(_0x316a45&&_0x316a45[_0xab49('0x51')]!==_0xab49('0x79')){delete this[_0xab49('0xaf')][_0x1024bf[_0xab49('0xed')]];this[_0xab49('0x23')][_0x1024bf[_0xab49('0xba')]]['outboundAnswerCallsDay']+=0x1;var _0x5892fb=new AgentComplete(_0x316a45,_0x1024bf);if(_0x1024bf[_0xab49('0x118')]===_0xab49('0x119')){_0x5892fb[_0xab49('0x11a')]=this[_0xab49('0x23')][_0x1024bf['queue']][_0xab49('0x11b')]&&this['voiceQueues'][_0x1024bf['queue']][_0xab49('0x11c')]?moment()[_0xab49('0x76')]('YYYY-MM-DD\x20HH:mm:ss'):undefined;}this[_0xab49('0xd3')](_0x5892fb)[_0xab49('0xb7')](loggerCatch(_0xab49('0x11d')));this[_0xab49('0xd1')](_0x5892fb)[_0xab49('0xb7')](loggerCatch(_0xab49('0x11e')));}}};Dialer[_0xab49('0x1e')][_0xab49('0x11f')]=function(_0xda819b){if(this['voiceQueues'][_0xda819b[_0xab49('0xba')]]){if(this[_0xab49('0xaf')][_0xda819b[_0xab49('0xed')]]&&this[_0xab49('0xaf')][_0xda819b['uniqueid']][_0xab49('0x51')]!==_0xab49('0x79')){this[_0xab49('0xb9')](this[_0xab49('0x23')][_0xda819b['queue']]);this['uniqueId'][_0xda819b[_0xab49('0xed')]][_0xab49('0x120')]=moment()[_0xab49('0x76')](_0xab49('0x107'));}}};Dialer[_0xab49('0x1e')]['queueCallerAbandonCreateState']=function(_0x4fd718){this['createHistory'](_0x4fd718)[_0xab49('0xb7')](loggerCatch(_0xab49('0x11d')));this[_0xab49('0xd1')](_0x4fd718)[_0xab49('0xb7')](loggerCatch('[syncQueueCallerAbandon]\x20[Drop]'));};Dialer[_0xab49('0x1e')][_0xab49('0x2e')]=function(_0x3a0a23){var _0x2e23a9=this[_0xab49('0xaf')][_0x3a0a23['uniqueid']];var _0xe5786e=this;if(this[_0xab49('0x23')][_0x3a0a23['queue']]){if(_0x2e23a9&&_0x2e23a9[_0xab49('0x51')]!=='ivr'){delete this[_0xab49('0xaf')][_0x3a0a23[_0xab49('0xed')]];this[_0xab49('0xb9')](this['voiceQueues'][_0x3a0a23['queue']]);_0x2e23a9[_0xab49('0x121')]=moment()[_0xab49('0x76')](_0xab49('0x107'));var _0x3c0957=new QueueCallerAbandon(_0x2e23a9,_0x3a0a23);if(getSeconds(_0x2e23a9[_0xab49('0x121')],_0x2e23a9[_0xab49('0x122')])>=_0x2e23a9[_0xab49('0x123')]){this[_0xab49('0x23')][_0x3a0a23[_0xab49('0xba')]][_0xab49('0x67')]+=0x1;this[_0xab49('0x23')][_0x3a0a23[_0xab49('0xba')]]['outboundDropCallsDayTimeout']+=0x1;this[_0xab49('0x23')][_0x3a0a23[_0xab49('0xba')]][_0xab49('0x124')]+=0x1;_0x3c0957[_0xab49('0xaa')]=0xa;_0x3c0957[_0xab49('0xab')]=_0xab49('0x125');_0x3c0957['dropreason']=_0xab49('0x126');_0x3c0957[_0xab49('0x11a')]=this['voiceQueues'][_0x3a0a23[_0xab49('0xba')]]['dialQueueProject2']?moment()[_0xab49('0x76')](_0xab49('0x107')):undefined;_0x3c0957['countdropretry']+=0x1;_0x3c0957[_0xab49('0xf9')]+=0x1;if(_0x3c0957[_0xab49('0xff')]>=this[_0xab49('0x23')][_0x3a0a23[_0xab49('0xba')]]['dialDropMaxRetry']){this[_0xab49('0x127')](_0x3c0957);}else{this['rescheduleContact']({'active':![],'countdropretry':_0x3c0957[_0xab49('0xff')],'scheduledat':moment()['add'](this[_0xab49('0x23')][_0x3a0a23[_0xab49('0xba')]][_0xab49('0x128')],'minutes')['format'](_0xab49('0x107')),'ContactId':_0x2e23a9[_0xab49('0xda')],'ListId':_0x2e23a9[_0xab49('0xdb')],'VoiceQueueId':_0x2e23a9[_0xab49('0xdd')]||undefined,'CampaignId':_0x2e23a9['CampaignId']||undefined})['catch'](loggerCatch(_0xab49('0x129')));var _0x53ecac=new History(_0x3c0957);_0x53ecac['state']=0xa;_0x53ecac[_0xab49('0xab')]=_0xab49('0x125');_0x53ecac[_0xab49('0x12a')]=moment()[_0xab49('0x76')]('YYYY-MM-DD\x20HH:mm:ss');_0x53ecac['endtime']=_0x53ecac['starttime'];_0x53ecac[_0xab49('0x12b')]=_0x3c0957[_0xab49('0x12b')];_0x53ecac[_0xab49('0x12c')]=_0x3c0957[_0xab49('0x12c')];this['createHistory'](_0x53ecac)['catch'](loggerCatch('[syncAgentComplete][createHistory][10]'));}}else{this[_0xab49('0x23')][_0x3a0a23['queue']]['predictiveIntervalDroppedCallsCallersExit']+=0x1;this[_0xab49('0x23')][_0x3a0a23[_0xab49('0xba')]]['outboundDropCallsDayCallersExit']+=0x1;_0x3c0957[_0xab49('0xaa')]=0xb;_0x3c0957[_0xab49('0xab')]=_0xab49('0x12d');_0x3c0957['dropreason']=_0xab49('0x12e');_0x3c0957[_0xab49('0x100')]+=0x1;_0x3c0957[_0xab49('0xf9')]+=0x1;if(_0x3c0957['countabandonedretry']>=this[_0xab49('0x23')][_0x3a0a23[_0xab49('0xba')]][_0xab49('0x12f')]){this['queueCallerAbandonCreateState'](_0x3c0957);}else{this[_0xab49('0xc7')]({'active':![],'countabandonedretry':_0x3c0957['countabandonedretry'],'scheduledat':moment()['add'](this['voiceQueues'][_0x3a0a23[_0xab49('0xba')]]['dialAbandonedRetryFrequency'],_0xab49('0x10f'))[_0xab49('0x76')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x2e23a9[_0xab49('0xda')],'ListId':_0x2e23a9[_0xab49('0xdb')],'VoiceQueueId':_0x2e23a9[_0xab49('0xdd')]||undefined,'CampaignId':_0x2e23a9[_0xab49('0x108')]||undefined})[_0xab49('0xb7')](loggerCatch(_0xab49('0x130')));var _0x53ecac=new History(_0x3c0957);_0x53ecac['state']=0xb;_0x53ecac['statedesc']=_0xab49('0x12d');_0x53ecac[_0xab49('0x12a')]=moment()[_0xab49('0x76')](_0xab49('0x107'));_0x53ecac[_0xab49('0xac')]=_0x53ecac[_0xab49('0x12a')];_0x53ecac[_0xab49('0x12b')]=_0x3c0957[_0xab49('0x12b')];_0x53ecac[_0xab49('0x12c')]=_0x3c0957['calleridnum'];this[_0xab49('0xd3')](_0x53ecac)[_0xab49('0xb7')](loggerCatch('[syncAgentComplete][createHistory][11]'));}}}}};Dialer['prototype'][_0xab49('0x32')]=function(_0x2d7f93){if(this[_0xab49('0x27')][_0x2d7f93[_0xab49('0xed')]]){this[_0xab49('0x27')][_0x2d7f93[_0xab49('0xed')]][_0xab49('0xb6')]=_0x2d7f93['channel'];}if(this[_0xab49('0xaf')][_0x2d7f93[_0xab49('0xed')]]){this['uniqueId'][_0x2d7f93[_0xab49('0xed')]][_0xab49('0xb6')]=_0x2d7f93[_0xab49('0xb6')];}};Dialer[_0xab49('0x1e')][_0xab49('0x36')]=function(_0x1e46e9){if(strategy[this['voiceQueues'][this[_0xab49('0x27')][_0x1e46e9[_0xab49('0x131')]][_0xab49('0xba')]][_0xab49('0x4a')]]==='roundrobin'){if(this[_0xab49('0x27')][_0x1e46e9[_0xab49('0x131')]]&&_[_0xab49('0xb3')](this['actions'][_0x1e46e9[_0xab49('0x131')]]['locked'])&&_0x1e46e9[_0xab49('0xb5')]==='1'&&_0x1e46e9[_0xab49('0x132')]==='0'){if(this[_0xab49('0x25')][_0x1e46e9[_0xab49('0x133')]]){if(!this[_0xab49('0x25')][_0x1e46e9['stateinterface']][_0xab49('0x134')]){this[_0xab49('0x25')][_0x1e46e9[_0xab49('0x133')]][_0xab49('0x134')]=!![];this['actions'][_0x1e46e9['actionid']][_0xab49('0x134')]=!![];this[_0xab49('0x27')][_0x1e46e9[_0xab49('0x131')]][_0xab49('0x133')]=_0x1e46e9['stateinterface'];}}}}else if((strategy[this[_0xab49('0x23')][this[_0xab49('0x27')][_0x1e46e9['actionid']][_0xab49('0xba')]][_0xab49('0x4a')]]||'rrmemory')===_0xab49('0x1c')){if(this[_0xab49('0x27')][_0x1e46e9[_0xab49('0x131')]]){if(this[_0xab49('0x25')][_0x1e46e9['stateinterface']]){this[_0xab49('0x27')][_0x1e46e9[_0xab49('0x131')]][_0xab49('0x133')]=_0x1e46e9[_0xab49('0x133')];if(_[_0xab49('0xb3')](this[_0xab49('0x135')][this[_0xab49('0x27')][_0x1e46e9[_0xab49('0x131')]][_0xab49('0xba')]])){this[_0xab49('0x135')][this[_0xab49('0x27')][_0x1e46e9[_0xab49('0x131')]][_0xab49('0xba')]]=[];}this[_0xab49('0x135')][this[_0xab49('0x27')][_0x1e46e9[_0xab49('0x131')]][_0xab49('0xba')]][_0xab49('0x136')](_['merge'](_[_0xab49('0xd9')](this[_0xab49('0x27')][_0x1e46e9[_0xab49('0x131')]],['idHopper',_0xab49('0x133')]),{'status':_0x1e46e9[_0xab49('0xb5')],'paused':_0x1e46e9[_0xab49('0x132')]}));}}}};function unlockQueueStatus(_0x3cd158,_0x5e1ce4){setTimeout(function(){if(_['isUndefined'](_0x3cd158[_0xab49('0x137')])){loggerBooked[_0xab49('0x95')]('[unlockQueueStatus][undefined]',_0x5e1ce4);}_0x3cd158[_0xab49('0x137')]=!![];loggerBooked[_0xab49('0x7c')](_0xab49('0x138'),_0x5e1ce4,JSON[_0xab49('0x44')](_[_0xab49('0xd9')](_0x3cd158,[_0xab49('0x3c'),'queueStatusComplete'])));},0x1f3);}Dialer[_0xab49('0x1e')][_0xab49('0x37')]=function(_0x13c28e){var _0x1209d1=this;var _0x2c62b1=_0x1209d1['voiceQueues'][_0x1209d1['actions'][_0x13c28e[_0xab49('0x131')]]['queue']];if(strategy[this['voiceQueues'][this[_0xab49('0x27')][_0x13c28e[_0xab49('0x131')]]['queue']][_0xab49('0x4a')]]===_0xab49('0x1d')){if(this['actions'][_0x13c28e[_0xab49('0x131')]]&&this[_0xab49('0x27')][_0x13c28e['actionid']][_0xab49('0x133')]){this[_0xab49('0x22')][_0xab49('0x139')](this[_0xab49('0x27')][_0x13c28e['actionid']]['idHopper'],this[_0xab49('0x27')][_0x13c28e[_0xab49('0x131')]][_0xab49('0x133')])[_0xab49('0xb7')](function(_0x1dcb60){logger[_0xab49('0x95')]('[Catch][Preview][syncQueueStatusComplete]',util[_0xab49('0x96')](_0x1dcb60,{'showHidden':![],'depth':null}));})[_0xab49('0x20')](function(){_0x1209d1['updateOriginated'](_0x1209d1[_0xab49('0x23')][_0x1209d1[_0xab49('0x27')][_0x13c28e[_0xab49('0x131')]][_0xab49('0xba')]]);_0x1209d1['agents'][_0x1209d1[_0xab49('0x27')][_0x13c28e['actionid']][_0xab49('0x133')]][_0xab49('0x134')]=![];delete _0x1209d1[_0xab49('0x27')][_0x13c28e[_0xab49('0x131')]];unlockQueueStatus(_0x2c62b1);});}else{this['updateOriginated'](this[_0xab49('0x23')][this[_0xab49('0x27')][_0x13c28e[_0xab49('0x131')]][_0xab49('0xba')]]);this[_0xab49('0xc7')]({'active':![],'ContactId':this[_0xab49('0x27')][_0x13c28e[_0xab49('0x131')]][_0xab49('0xda')],'ListId':this[_0xab49('0x27')][_0x13c28e[_0xab49('0x131')]][_0xab49('0xdb')],'VoiceQueueId':this[_0xab49('0x27')][_0x13c28e[_0xab49('0x131')]][_0xab49('0xdd')]||undefined,'CampaignId':this[_0xab49('0x27')][_0x13c28e['actionid']][_0xab49('0x108')]||undefined})[_0xab49('0xb7')](loggerCatch(_0xab49('0x13a')));delete this['actions'][_0x13c28e[_0xab49('0x131')]];unlockQueueStatus(_0x2c62b1);}}else if((strategy[this[_0xab49('0x23')][this[_0xab49('0x27')][_0x13c28e[_0xab49('0x131')]]['queue']][_0xab49('0x4a')]]||_0xab49('0x1c'))==='rrmemory'){var _0x4e148c;if(this['actions'][_0x13c28e[_0xab49('0x131')]]&&!_[_0xab49('0x40')](this['queueBooked'][this[_0xab49('0x27')][_0x13c28e[_0xab49('0x131')]][_0xab49('0xba')]])){if(this['queueBookedRR'][_0x1209d1['actions'][_0x13c28e[_0xab49('0x131')]][_0xab49('0xba')]]){this['queueBookedRR'][_0x1209d1['actions'][_0x13c28e[_0xab49('0x131')]][_0xab49('0xba')]]=this['queueBookedRR'][this['actions'][_0x13c28e[_0xab49('0x131')]][_0xab49('0xba')]]?this[_0xab49('0x13b')][this[_0xab49('0x27')][_0x13c28e[_0xab49('0x131')]]['queue']]:this['queueBooked'][this[_0xab49('0x27')][_0x13c28e['actionid']][_0xab49('0xba')]]?this[_0xab49('0x135')][this[_0xab49('0x27')][_0x13c28e[_0xab49('0x131')]][_0xab49('0xba')]][_0xab49('0x13c')]||0x0:0x0;}this[_0xab49('0x135')][this[_0xab49('0x27')][_0x13c28e['actionid']][_0xab49('0xba')]][_0xab49('0x13c')]=this['queueBookedRR'][this['actions'][_0x13c28e[_0xab49('0x131')]][_0xab49('0xba')]];for(var _0x1d9a6f=0x0;_0x1d9a6f=0x0;})[_0xab49('0xb7')](myreject(_0x3343a3)));}}else{_0x337af4[_0xab49('0x136')](ami[_0xab49('0xb4')]({'action':'command','command':util[_0xab49('0x76')](_0xab49('0x156'),_0x4795bb,!_['isUndefined'](config['timezones'][_0x46228f])?_0x46228f:'')})[_0xab49('0xc1')](function(_0x54d413){return _0x54d413[_0xab49('0x158')][_0xab49('0x15a')](_0xab49('0x159'))>=0x0;})[_0xab49('0xb7')](myreject(_0x3343a3)));}BPromise[_0xab49('0x15b')](_0x337af4)[_0xab49('0xc1')](function(_0x463d94){var _0x3abc34=_['some'](_0x463d94);if(_0x3abc34){return _0x332207(_0x3abc34);}else{_0x312b6a[_0xab49('0x39')]=_0x43c9ea?_0xab49('0x15c'):'INTERVAL_IS_OVERTIME';return _0x3343a3(msgResponse('[ifTime][promiseAll]',_0xab49('0x14e'),_0xab49('0x15d')+_0x43c9ea+'\x20'+_0x72dd3e+_0xab49('0x15e')+util[_0xab49('0x96')](_0x4795bb,{'showHidden':![],'depth':null})+_0xab49('0x15f')+_0x46228f));}})[_0xab49('0xb7')](function(_0x566cbd){return _0x3343a3(msgResponse(_0xab49('0x14d'),_0xab49('0x14e'),JSON['stringify'](_0x566cbd)));});});};Dialer[_0xab49('0x1e')]['checkDialMethod']=function(_0x141a5c){var _0x2faa60=this;return function(){switch(_0x141a5c[_0xab49('0x160')]){case _0xab49('0x161'):freeVariablesPredictive(_0x141a5c);_0x2faa60[_0xab49('0x162')](_0x141a5c,0x1);break;case'power':freeVariablesPredictive(_0x141a5c);_0x2faa60[_0xab49('0x162')](_0x141a5c,_0x141a5c[_0xab49('0x163')]);break;case _0xab49('0xa'):_0x2faa60[_0xab49('0xa')](_0x141a5c);break;case'booked':freeVariablesPredictive(_0x141a5c);_0x2faa60[_0xab49('0x162')](_0x141a5c,0x1);break;default:freeVariablesPredictive(_0x141a5c);logger[_0xab49('0x95')](_0xab49('0x164'),_0x141a5c['name'],'method\x20not\x20recognized');}};};Dialer['prototype'][_0xab49('0x165')]=function(_0x2d9b15){var _0x34a986=this;return function(){_0x34a986[_0xab49('0x166')](_0x2d9b15);};};Dialer['prototype'][_0xab49('0xc')]=function(_0x1f2a18){var _0x45ab87=this;if(isNotPreview(_0x1f2a18['dialMethod'])){if(isVoiceQueueOutbound(_0x1f2a18[_0xab49('0x51')])&&isActive(_0x1f2a18[_0xab49('0x167')])){_0x1f2a18[_0xab49('0xa0')]=!![];BPromise[_0xab49('0xc0')]()[_0xab49('0xc1')](checkIsLoggedIn(_0x1f2a18,_0x1f2a18[_0xab49('0x4c')]))[_0xab49('0xc1')](checkIsActive(_0x1f2a18,_0x1f2a18[_0xab49('0x167')]))[_0xab49('0xc1')](checkInterval(_0x1f2a18))[_0xab49('0xc1')](_0x45ab87['checkIsTrunkReachable'](_0x1f2a18))[_0xab49('0xc1')](_0x45ab87[_0xab49('0x14c')](_0x1f2a18[_0xab49('0x168')],_0x1f2a18[_0xab49('0x169')],_0x1f2a18[_0xab49('0x3c')],_0x1f2a18))['then'](_0x45ab87['checkIfTimeIntervals'](_0x1f2a18[_0xab49('0x3e')],_0x1f2a18[_0xab49('0x169')],_0x1f2a18[_0xab49('0x3c')],_0x1f2a18))['then'](_0x45ab87[_0xab49('0x16a')](_0x1f2a18))[_0xab49('0xb7')](loggerCatchQueueSummary(_0xab49('0x16b'),_0x1f2a18));}else{notSendMessagesQueue(_0x1f2a18);}}else{freeVariablesPredictive(_0x1f2a18);}};Dialer['prototype'][_0xab49('0x147')]=function(){var _0xf98a56=this;var _0x12ed45;for(var _0x4728d2 in this[_0xab49('0x24')]){if(typeof this[_0xab49('0x24')][_0x4728d2]!=='undefined'){_0x12ed45=this[_0xab49('0x24')][_0x4728d2];if(isCampaignIvr(_0x12ed45['type'])&&isActive(_0x12ed45[_0xab49('0x73')])){_0x12ed45[_0xab49('0xa0')]=!![];BPromise[_0xab49('0xc0')]()[_0xab49('0xc1')](checkIsActive(_0x12ed45,_0x12ed45[_0xab49('0x73')]))['then'](checkInterval(_0x12ed45))['then'](_0xf98a56[_0xab49('0x148')](_0x12ed45))[_0xab49('0xc1')](_0xf98a56['checkIfTime'](_0x12ed45[_0xab49('0x168')],_0x12ed45['dialTimezone'],_0x12ed45['name'],_0x12ed45))[_0xab49('0xc1')](_0xf98a56[_0xab49('0x16c')](_0x12ed45['Interval'],_0x12ed45[_0xab49('0x169')],_0x12ed45[_0xab49('0x3c')],_0x12ed45))[_0xab49('0xc1')](_0xf98a56[_0xab49('0x165')](_0x12ed45))[_0xab49('0xb7')](loggerCatchQueueSummary(_0xab49('0x16d'),_0x12ed45));}else{notSendMessagesCampaign(_0x12ed45);}}}};function getCallerIdRandom(_0xa56cdb,_0x4c6502){var _0x46828b;var _0x35064c;var _0x5925b2;if(_0x4c6502<=0x0){_0x4c6502=0x1;}_0x46828b=new RegExp('\x5cw{0,'+_0x4c6502+'}$');_0x35064c=Math[_0xab49('0x16e')](0xa,_0x4c6502-0x1);_0x5925b2=Math['pow'](0xa,_0x4c6502)-0x1;return util[_0xab49('0x76')]('%s',_[_0xab49('0x16f')](_0xa56cdb,_0x46828b,_[_0xab49('0x170')](_0x35064c,_0x5925b2)));}function extractCalleridName(_0x10f0f){var _0x4dad76=_0x10f0f[_0xab49('0x171')](/"(.*?)"/);return _0x4dad76?_0x4dad76[0x1]:_0x10f0f;}function extractCalleridNumber(_0x1932ee){var _0x5ac2c8=_0x1932ee[_0xab49('0x171')](/<(.*?)>/);return _0x5ac2c8?_0x5ac2c8[0x1]:_0x1932ee;}Dialer[_0xab49('0x1e')][_0xab49('0x172')]=function(_0x2e3b33,_0x6819d){var _0x14fc7e=this;var _0x5b4182=uuid['v4']();this[_0xab49('0x27')][_0x5b4182]=new Action(_0x2e3b33,_0x6819d,_0x5b4182);return new BPromise(function(_0x5ad1ae,_0x181c0d){if(_['isUndefined'](_0x2e3b33)&&typeof _0x2e3b33!=='object'){return _0x181c0d(msgResponse(_0xab49('0x173'),_0xab49('0x14e'),_0xab49('0x174')));}if(_[_0xab49('0x84')](_0x6819d[_0xab49('0x175')][_0xab49('0x176')])||_0x6819d[_0xab49('0x175')][_0xab49('0x176')]===null){return _0x181c0d(msgResponse('originate',_0xab49('0x14e'),_0xab49('0x177')));}var _0x538d1d={'XMD-CALLERID':_0x14fc7e[_0xab49('0x27')][_0x5b4182][_0xab49('0x178')](),'XMD-AGI':_0x2e3b33[_0xab49('0x113')]?util[_0xab49('0x76')]('\x22agi://%s/square,%s\x22',ipAgi,_0x2e3b33['dialQueueProject']):_0xab49('0x179'),'XMD-AGIAFTER':_0x2e3b33[_0xab49('0x11b')]?util['format'](_0xab49('0x17a'),ipAgi,_0x2e3b33[_0xab49('0x11b')]):_0xab49('0x179'),'XMD-QUEUE':_0x2e3b33[_0xab49('0x51')]===_0xab49('0x49')?util['format'](_0xab49('0x17b'),_0x2e3b33[_0xab49('0x3c')],_0x2e3b33[_0xab49('0x17c')]||'',_0x2e3b33['dialAgiAfterHangupAgent']?'c':'',_0x2e3b33['dialQueueTimeout']||0x3):'NONE','XMD-CONTACTID':_0x6819d[_0xab49('0xda')],'XMD-CDRTYPE':_0xab49('0x7'),'CALLERID(all)':_0x14fc7e['actions'][_0x5b4182][_0xab49('0x178')](),'XMD-AMD':_0x2e3b33[_0xab49('0xeb')]?_0xab49('0x17d'):_0xab49('0x179'),'XMD-DESTINATION':_0xab49('0xea')};if(_0x2e3b33['dialAMDActive']){_0x538d1d[_0xab49('0x17e')]=_0x2e3b33['dialAMDInitialSilence']||0x9c4;_0x538d1d['XMD-AMDGREETING']=_0x2e3b33[_0xab49('0x17f')]||0x5dc;_0x538d1d[_0xab49('0x180')]=_0x2e3b33[_0xab49('0x181')]||0x320;_0x538d1d[_0xab49('0x182')]=_0x2e3b33[_0xab49('0x183')]||0x1388;_0x538d1d[_0xab49('0x184')]=_0x2e3b33['dialAMDMinWordLength']||0x64;_0x538d1d[_0xab49('0x185')]=_0x2e3b33[_0xab49('0x186')]||0x32;_0x538d1d['XMD-AMDMAXIMUMNUMBEROFWORDS']=_0x2e3b33[_0xab49('0x187')]||0x3;_0x538d1d[_0xab49('0x188')]=_0x2e3b33[_0xab49('0x189')]||0x100;_0x538d1d[_0xab49('0x18a')]=_0x2e3b33['dialAMDMaximumWordLength']||0x1388;}if(_0x2e3b33[_0xab49('0x51')]===_0xab49('0x49')){_0x538d1d[_0xab49('0x18b')]=_0x6819d[_0xab49('0xdd')];}else{_0x538d1d[_0xab49('0x18c')]=_0x6819d[_0xab49('0x108')];}for(var _0x59a93c in _0x6819d['Contact']){if(typeof _0x6819d[_0xab49('0x175')][_0x59a93c]!=='undefined'){if(isNotNull(_0x6819d[_0xab49('0x175')][_0x59a93c])&&_0x59a93c!=='id'&&_0x59a93c!=='tags'&&_0x59a93c!==_0xab49('0x18d')&&_0x59a93c!==_0xab49('0x18e')){_0x538d1d[util[_0xab49('0x76')](_0xab49('0x18f'),'XMD-',_[_0xab49('0x190')](_0x59a93c))]=_0x6819d[_0xab49('0x175')][_0x59a93c];}}}var _0x2f2a11=_0x14fc7e[_0xab49('0xe2')](_0x2e3b33[_0xab49('0x72')])?getCallerId(_0x2e3b33[_0xab49('0x72')][_0xab49('0x74')],_0x2e3b33[_0xab49('0x191')],_0x2e3b33[_0xab49('0x192')]>0x0?getCallerIdRandom(_0x2e3b33[_0xab49('0x193')],_0x2e3b33[_0xab49('0x192')]):_0x2e3b33[_0xab49('0x193')]):getCallerId(_[_0xab49('0xb3')](_0x2e3b33[_0xab49('0x149')])?_0x2e3b33[_0xab49('0x72')][_0xab49('0x74')]:_0x2e3b33['TrunkBackup'][_0xab49('0x74')],_0x2e3b33['dialOriginateCallerIdName'],_0x2e3b33['dialRandomLastDigitCallerIdNumber']>0x0?getCallerIdRandom(_0x2e3b33[_0xab49('0x193')],_0x2e3b33[_0xab49('0x192')]):_0x2e3b33['dialOriginateCallerIdNumber']);if(_0x2f2a11){_0x538d1d[_0xab49('0x194')]=_0x14fc7e[_0xab49('0x27')][_0x5b4182]['originatecalleridname']=extractCalleridName(_0x2f2a11);_0x538d1d['XMD-ORIGINATECALLERIDNUM']=_0x14fc7e[_0xab49('0x27')][_0x5b4182]['originatecalleridnum']=extractCalleridNumber(_0x2f2a11);}return ami[_0xab49('0xb4')]({'actionid':_0x5b4182,'action':'originate','channel':_0x14fc7e[_0xab49('0xe2')](_0x2e3b33['Trunk'])?util[_0xab49('0x76')](_0xab49('0x195'),_0x2e3b33[_0xab49('0x72')][_0xab49('0x3c')],isNotNull(_0x2e3b33['dialPrefix'])?_0x2e3b33['dialPrefix'][_0xab49('0x196')]()||'':'',_0x2e3b33[_0xab49('0x197')]>0x0?_0x6819d['Contact'][_0xab49('0x176')][_0xab49('0x198')](_0x2e3b33[_0xab49('0x197')]):_0x6819d['Contact'][_0xab49('0x176')]):util[_0xab49('0x76')](_0xab49('0x195'),_[_0xab49('0xb3')](_0x2e3b33[_0xab49('0x149')])?_0x2e3b33[_0xab49('0x72')][_0xab49('0x3c')]:_0x2e3b33['TrunkBackup'][_0xab49('0x3c')],isNotNull(_0x2e3b33[_0xab49('0x56')])?_0x2e3b33[_0xab49('0x56')]['trim']()||'':'',_0x2e3b33[_0xab49('0x197')]>0x0?_0x6819d[_0xab49('0x175')][_0xab49('0x176')][_0xab49('0x198')](_0x2e3b33[_0xab49('0x197')]):_0x6819d[_0xab49('0x175')][_0xab49('0x176')]),'callerid':_0x2f2a11,'Exten':'xcally-motion-dialer','Context':_0xab49('0x199'),'Priority':'1','variable':_0x538d1d,'timeout':(_0x2e3b33[_0xab49('0x55')]||0x1e)*0x3e8,'async':!![],'channelid':_0x5b4182})[_0xab49('0xc1')](function(_0x8c537b){return _0x5ad1ae(_0x8c537b);})[_0xab49('0xb7')](function(_0x2aa38c){_0x2e3b33[_0xab49('0x60')]+=0x1;var _0x44a597=new History(_0x14fc7e[_0xab49('0x27')][_0x5b4182]);logger[_0xab49('0x95')](util[_0xab49('0x76')](_0xab49('0x19a'),JSON[_0xab49('0x44')](_0x2aa38c)));_0x44a597[_0xab49('0xaa')]=0xe;_0x44a597[_0xab49('0xab')]='OriginateError';_0x44a597['starttime']=moment()['format'](_0xab49('0x107'));_0x44a597[_0xab49('0xac')]=_0x44a597[_0xab49('0x12a')];_0x14fc7e[_0xab49('0xd3')](_0x44a597)[_0xab49('0xb7')](loggerCatch(_0xab49('0x19b')));_0x14fc7e['moveContactManagedDialer'](_0x44a597)[_0xab49('0xb7')](loggerCatch('[originate][error]'))['finally'](function(){delete _0x14fc7e[_0xab49('0x27')][_0x5b4182];return _0x181c0d(msgResponse(_0xab49('0x173'),_0xab49('0x43'),_0xab49('0x19c')));});});});};Dialer[_0xab49('0x1e')]['syncOriginateResponse']=function(_0x654cc){var _0x20b278=this[_0xab49('0x27')][_0x654cc[_0xab49('0x131')]];if(_0x20b278){delete this[_0xab49('0x27')][_0x654cc[_0xab49('0x131')]];_0x20b278[_0xab49('0x122')]=moment()[_0xab49('0x76')](_0xab49('0x107'));var _0x29d32e=_0x20b278[_0xab49('0x51')]===_0xab49('0x79')?this[_0xab49('0x24')][_0x20b278[_0xab49('0xba')]]:this[_0xab49('0x23')][_0x20b278['getQueue']()];if(!this[_0xab49('0xe0')](_0x654cc[_0xab49('0x19d')])){this[_0xab49('0xb9')](_0x29d32e);return this[_0xab49('0x19e')](_0x20b278,_0x29d32e,_0x654cc)['catch'](loggerCatch('[callProgressDetecting]\x20'));}this['uniqueId'][_0x654cc[_0xab49('0xed')]]=_0x20b278;}};Dialer[_0xab49('0x1e')]['checkRetriveMax']=function(_0x45c7e2,_0x3127e7,_0x2bd981){var _0x2bbb00=new History(_0x3127e7);if(_0x2bbb00[_0xab49('0xfb')]+_0x2bbb00[_0xab49('0xfc')]+_0x2bbb00['countnoanswerretry']+_0x2bbb00[_0xab49('0xfe')]+_0x2bbb00['countdropretry']+_0x2bbb00[_0xab49('0x100')]+_0x2bbb00['countmachineretry']+_0x2bbb00[_0xab49('0x101')]>=_0x2bd981[_0xab49('0x102')]-0x1){return!![];}switch(_0x45c7e2){case 0x3:if(_0x2bbb00[_0xab49('0xfd')]>=_0x2bd981['dialNoAnswerMaxRetry']-0x1){return!![];}this['rescheduleContact']({'active':![],'countnoanswerretry':_0x2bbb00[_0xab49('0xfd')]+=0x1,'scheduledat':moment()[_0xab49('0x10d')](_0x2bd981[_0xab49('0x19f')],_0xab49('0x10f'))[_0xab49('0x76')](_0xab49('0x107')),'ContactId':_0x2bbb00[_0xab49('0xda')],'ListId':_0x2bbb00[_0xab49('0xdb')],'VoiceQueueId':_0x2bbb00['VoiceQueueId']||undefined,'CampaignId':_0x2bbb00['CampaignId']||undefined})['catch'](loggerCatch(_0xab49('0x1a0')));break;case 0x5:if(_0x2bbb00[_0xab49('0xfb')]>=_0x2bd981[_0xab49('0x1a1')]-0x1){return!![];}this[_0xab49('0xc7')]({'active':![],'countbusyretry':_0x2bbb00[_0xab49('0xfb')]+=0x1,'scheduledat':moment()[_0xab49('0x10d')](_0x2bd981['dialBusyRetryFrequency'],_0xab49('0x10f'))[_0xab49('0x76')](_0xab49('0x107')),'ContactId':_0x2bbb00[_0xab49('0xda')],'ListId':_0x2bbb00[_0xab49('0xdb')],'VoiceQueueId':_0x2bbb00[_0xab49('0xdd')]||undefined,'CampaignId':_0x2bbb00['CampaignId']||undefined})[_0xab49('0xb7')](loggerCatch(_0xab49('0x1a2')));break;case 0x8:if(_0x2bbb00[_0xab49('0xfc')]>=_0x2bd981[_0xab49('0x1a3')]-0x1){return!![];}this[_0xab49('0xc7')]({'active':![],'countcongestionretry':_0x2bbb00[_0xab49('0xfc')]+=0x1,'scheduledat':moment()['add'](_0x2bd981[_0xab49('0x1a4')],_0xab49('0x10f'))[_0xab49('0x76')](_0xab49('0x107')),'ContactId':_0x2bbb00[_0xab49('0xda')],'ListId':_0x2bbb00['ListId'],'VoiceQueueId':_0x2bbb00[_0xab49('0xdd')]||undefined,'CampaignId':_0x2bbb00[_0xab49('0x108')]||undefined})[_0xab49('0xb7')](loggerCatch(_0xab49('0x1a5')));break;case 0x0:if(_0x2bbb00['countnosuchnumberretry']>=_0x2bd981['dialNoSuchNumberMaxRetry']-0x1){return!![];}else{this[_0xab49('0xc7')]({'active':![],'countnosuchnumberretry':_0x2bbb00['countnosuchnumberretry']+=0x1,'scheduledat':moment()[_0xab49('0x10d')](_0x2bd981[_0xab49('0x1a6')],_0xab49('0x10f'))[_0xab49('0x76')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x2bbb00[_0xab49('0xda')],'ListId':_0x2bbb00['ListId'],'VoiceQueueId':_0x2bbb00[_0xab49('0xdd')]||undefined,'CampaignId':_0x2bbb00[_0xab49('0x108')]||undefined})[_0xab49('0xb7')](loggerCatch(_0xab49('0x1a7')));}break;case 0xa:if(_0x2bbb00[_0xab49('0xff')]>=_0x2bd981[_0xab49('0x1a8')]-0x1){return!![];}this[_0xab49('0xc7')]({'active':![],'countdropretry':_0x2bbb00[_0xab49('0xff')]+=0x1,'scheduledat':moment()[_0xab49('0x10d')](_0x2bd981[_0xab49('0x128')],_0xab49('0x10f'))[_0xab49('0x76')](_0xab49('0x107')),'ContactId':_0x2bbb00['ContactId'],'ListId':_0x2bbb00[_0xab49('0xdb')],'VoiceQueueId':_0x2bbb00[_0xab49('0xdd')]||undefined,'CampaignId':_0x2bbb00[_0xab49('0x108')]||undefined})['catch'](loggerCatch(_0xab49('0x129')));break;case 0xb:if(_0x2bbb00[_0xab49('0x100')]>=_0x2bd981[_0xab49('0x12f')]-0x1){return!![];}this[_0xab49('0xc7')]({'active':![],'countabandonedretry':_0x2bbb00[_0xab49('0x100')]+=0x1,'scheduledat':moment()['add'](_0x2bd981[_0xab49('0x1a9')],_0xab49('0x10f'))['format'](_0xab49('0x107')),'ContactId':_0x2bbb00[_0xab49('0xda')],'ListId':_0x2bbb00[_0xab49('0xdb')],'VoiceQueueId':_0x2bbb00['VoiceQueueId']||undefined,'CampaignId':_0x2bbb00[_0xab49('0x108')]||undefined})[_0xab49('0xb7')](loggerCatch('[rescheduleContact][Abandoned]'));break;case 0x13:if(_0x2bbb00[_0xab49('0xf8')]>=_0x2bd981[_0xab49('0x105')]-0x1){return!![];}this[_0xab49('0xc7')]({'active':![],'countmachineretry':_0x2bbb00['countmachineretry']+=0x1,'scheduledat':moment()['add'](_0x2bd981[_0xab49('0x10e')],_0xab49('0x10f'))[_0xab49('0x76')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x2bbb00['ContactId'],'ListId':_0x2bbb00['ListId'],'VoiceQueueId':_0x2bbb00[_0xab49('0xdd')]||undefined,'CampaignId':_0x2bbb00[_0xab49('0x108')]||undefined})[_0xab49('0xb7')](loggerCatch(_0xab49('0x109')));break;case 0x14:if(_0x2bbb00['countagentrejectretry']>=_0x2bd981[_0xab49('0x1aa')]-0x1){return!![];}this['rescheduleContact']({'active':![],'countagentrejectretry':_0x2bbb00[_0xab49('0x101')]+=0x1,'scheduledat':moment()['add'](_0x2bd981['dialAgentRejectRetryFrequency'],_0xab49('0x10f'))[_0xab49('0x76')](_0xab49('0x107')),'ContactId':_0x2bbb00['ContactId'],'ListId':_0x2bbb00['ListId'],'VoiceQueueId':_0x2bbb00[_0xab49('0xdd')]||undefined,'CampaignId':_0x2bbb00[_0xab49('0x108')]||undefined})[_0xab49('0xb7')](loggerCatch(_0xab49('0x1ab')));break;default:return!![];}};Dialer[_0xab49('0x1e')][_0xab49('0x19e')]=function(_0xb9faec,_0x2457a7,_0x5beafa){var _0x17b920=this;var _0x3f91c3=new History(_0xb9faec);return new BPromise(function(_0x226ada,_0x21a1a0){if(_[_0xab49('0x84')](_0x2457a7)&&typeof _0x2457a7!==_0xab49('0x1ac')){return _0x21a1a0(msgResponse(_0xab49('0x1ad'),_0xab49('0x14e'),_0xab49('0x1ae')));}if(_[_0xab49('0x84')](_0x5beafa)&&typeof _0x5beafa!=='object'){return _0x21a1a0(msgResponse('[callProgressDetecting]','Failure','evt\x20is\x20undefine'));}switch(_0x5beafa[_0xab49('0x118')]){case'0':_0x2457a7[_0xab49('0x5f')]+=0x1;_0x3f91c3[_0xab49('0xaa')]=0x0;_0x3f91c3[_0xab49('0xab')]=_0xab49('0x1af');_0x3f91c3[_0xab49('0xfe')]+=0x1;_0x3f91c3[_0xab49('0xf9')]+=0x1;ami[_0xab49('0x48')]('custom:agentnosuchnumber',ut[_0xab49('0xf2')](_0xb9faec,_0xab49('0x1b0')));_0x17b920[_0xab49('0xd3')](_0x3f91c3)[_0xab49('0xb7')](loggerCatch(_0xab49('0xfa')));if(_0x17b920[_0xab49('0x1b1')](0x0,_0xb9faec,_0x2457a7)){if(_0x3f91c3[_0xab49('0xfe')]>=_0x2457a7['dialNoSuchNumberMaxRetry']){_0x17b920[_0xab49('0x106')](_0x3f91c3,_0x226ada,_0x21a1a0,_0xab49('0x1b2'));}else{_0x17b920[_0xab49('0x103')](_0x3f91c3,_0x226ada,_0x21a1a0,_0xab49('0x1b2'));}}break;case'3':_0x2457a7[_0xab49('0x1b3')]+=0x1;_0x3f91c3[_0xab49('0xaa')]=0x3;_0x3f91c3[_0xab49('0xab')]=_0xab49('0x1b4');_0x3f91c3[_0xab49('0xfd')]+=0x1;_0x3f91c3[_0xab49('0xf9')]+=0x1;ami[_0xab49('0x48')]('custom:agentnoanswer',ut['buildObj'](_0xb9faec,'noanswer'));_0x17b920[_0xab49('0xd3')](_0x3f91c3)[_0xab49('0xb7')](loggerCatch(_0xab49('0x1b5')));if(_0x17b920['checkRetriveMax'](0x3,_0xb9faec,_0x2457a7)){if(_0x3f91c3[_0xab49('0xfd')]>=_0x2457a7[_0xab49('0x1b6')]){_0x17b920[_0xab49('0x106')](_0x3f91c3,_0x226ada,_0x21a1a0,'reason\x203\x20ringing\x20no\x20answer');}else{_0x17b920['stateGlobal'](_0x3f91c3,_0x226ada,_0x21a1a0,_0xab49('0x1b7'));}}break;case'5':_0x2457a7[_0xab49('0x5a')]+=0x1;_0x3f91c3[_0xab49('0xaa')]=0x5;_0x3f91c3[_0xab49('0xab')]=_0xab49('0x1b8');_0x3f91c3[_0xab49('0xfb')]+=0x1;_0x3f91c3['countglobal']+=0x1;ami['emit']('custom:agentbusy',ut[_0xab49('0xf2')](_0xb9faec,'busy'));_0x17b920[_0xab49('0xd3')](_0x3f91c3)[_0xab49('0xb7')](loggerCatch(_0xab49('0x1b9')));if(_0x17b920[_0xab49('0x1b1')](0x5,_0xb9faec,_0x2457a7)){if(_0x3f91c3['countbusyretry']>=_0x2457a7['dialBusyMaxRetry']){_0x17b920['createStateFinal'](_0x3f91c3,_0x226ada,_0x21a1a0,'reason\x205\x20busy');}else{_0x17b920[_0xab49('0x103')](_0x3f91c3,_0x226ada,_0x21a1a0,_0xab49('0x1ba'));}}break;case'8':_0x2457a7[_0xab49('0x5b')]+=0x1;_0x3f91c3[_0xab49('0xaa')]=0x8;_0x3f91c3[_0xab49('0xab')]='Congestion';_0x3f91c3[_0xab49('0xfc')]+=0x1;_0x3f91c3[_0xab49('0xf9')]+=0x1;ami[_0xab49('0x48')](_0xab49('0x1bb'),ut['buildObj'](_0xb9faec,_0xab49('0x1bc')));_0x17b920[_0xab49('0xd3')](_0x3f91c3)['catch'](loggerCatch('[syncAgentComplete][createHistory][8]'));if(_0x17b920['checkRetriveMax'](0x8,_0xb9faec,_0x2457a7)){if(_0x3f91c3[_0xab49('0xfc')]>=_0x2457a7[_0xab49('0x1a3')]){_0x17b920[_0xab49('0x106')](_0x3f91c3,_0x226ada,_0x21a1a0,_0xab49('0x1bd'));}else{_0x17b920['stateGlobal'](_0x3f91c3,_0x226ada,_0x21a1a0,'reason\x208\x20congestion');}}break;case'11':_0x2457a7[_0xab49('0x1be')]+=0x1;_0x3f91c3['state']=0xb;_0x3f91c3['statedesc']='Abandoned';_0x3f91c3[_0xab49('0x100')]+=0x1;_0x3f91c3[_0xab49('0xf9')]+=0x1;_0x17b920['createHistory'](_0x3f91c3)[_0xab49('0xb7')](loggerCatch(_0xab49('0x1bf')));if(_0x17b920[_0xab49('0x1b1')](0xb,_0xb9faec,_0x2457a7)){if(_0x3f91c3[_0xab49('0x100')]>=_0x2457a7['dialAbandonedMaxRetry']){_0x17b920[_0xab49('0x106')](_0x3f91c3,_0x226ada,_0x21a1a0,_0xab49('0x1c0'));}else{_0x17b920[_0xab49('0x103')](_0x3f91c3,_0x226ada,_0x21a1a0,_0xab49('0x1c0'));}}break;case'20':_0x2457a7[_0xab49('0x61')]+=0x1;_0x3f91c3[_0xab49('0xaa')]=0x14;_0x3f91c3['statedesc']=_0xab49('0x1c1');_0x3f91c3[_0xab49('0x101')]+=0x1;_0x3f91c3[_0xab49('0xf9')]+=0x1;ami[_0xab49('0x48')](_0xab49('0x1c2'),ut[_0xab49('0xf2')](_0xb9faec,'agentreject'));_0x17b920['createHistory'](_0x3f91c3)['catch'](loggerCatch(_0xab49('0x1c3')));if(_0x17b920[_0xab49('0x1b1')](0x14,_0xb9faec,_0x2457a7)){if(_0x3f91c3['countagentrejectretry']>=_0x2457a7[_0xab49('0x1aa')]){_0x17b920['createStateFinal'](_0x3f91c3,_0x226ada,_0x21a1a0,_0xab49('0x1c4'));}else{_0x17b920[_0xab49('0x103')](_0x3f91c3,_0x226ada,_0x21a1a0,_0xab49('0x1c4'));}}break;default:_0x2457a7[_0xab49('0x62')]+=0x1;_0x3f91c3[_0xab49('0xaa')]=0xc;_0x3f91c3[_0xab49('0xab')]=_0x5beafa['reason'];_0x17b920[_0xab49('0xd3')](_0x3f91c3)[_0xab49('0xb7')](loggerCatch(_0xab49('0x1c5')));if(_0x17b920[_0xab49('0x1b1')](_0x5beafa[_0xab49('0x118')],_0xb9faec,_0x2457a7)){if(_0x3f91c3['countbusyretry']+_0x3f91c3['countcongestionretry']+_0x3f91c3[_0xab49('0xfd')]+_0x3f91c3[_0xab49('0xfe')]+_0x3f91c3[_0xab49('0xff')]+_0x3f91c3[_0xab49('0x100')]+_0x3f91c3[_0xab49('0xf8')]+_0x3f91c3['countagentrejectretry']>=_0x2457a7[_0xab49('0x102')]){_0x17b920[_0xab49('0x103')](_0x3f91c3,_0x226ada,_0x21a1a0,_0x5beafa[_0xab49('0x118')]);}else{_0x17b920['createStateFinal'](_0x3f91c3,_0x226ada,_0x21a1a0,_0x5beafa[_0xab49('0x118')]);}}}});};Dialer[_0xab49('0x1e')][_0xab49('0x103')]=function(_0x14c568,_0x33712e,_0x217916,_0x373c51){var _0x3b0fc9=new Final(_0x14c568);_0x3b0fc9[_0xab49('0xaa')]=0xf;_0x3b0fc9[_0xab49('0xab')]=_0xab49('0x1c6');this[_0xab49('0x106')](_0x3b0fc9,_0x33712e,_0x217916,_0x373c51);};Dialer['prototype'][_0xab49('0x106')]=function(_0x44ea50,_0x12d090,_0x16f9b1,_0x1ea0c8){this[_0xab49('0xd1')](_0x44ea50)['then'](function(){return _0x12d090(msgResponse('[callProgressDetecting]',_0xab49('0xe1'),_0x1ea0c8));})['catch'](function(){return _0x16f9b1(msgResponse(_0xab49('0x1c7'),_0xab49('0x14e'),_0xab49('0x1c8')));});};Dialer[_0xab49('0x1e')]['predictive']=function(_0xb37439){var _0x14cf92=_0xb37439[_0xab49('0x1c9')]/0x64;var _0x2ac97c=_0xb37439[_0xab49('0x5e')]/(_0xb37439[_0xab49('0x5e')]+_0xb37439['outboundAnswerCallsDay']);var _0x5d0dc8=Math[_0xab49('0x1ca')](_0xb37439[_0xab49('0x1cb')]*(_0xb37439[_0xab49('0x1cc')]/0x64));var _0x4187cd=Math[_0xab49('0x1ca')](_0xb37439[_0xab49('0x1cb')]*(_0xb37439['predictiveIntervalMinThreshold']/0x64));var _0x18c6da=_0xb37439[_0xab49('0xa3')]+_0xb37439[_0xab49('0xa1')];var _0x433105=Math[_0xab49('0x1cd')](_0xb37439[_0xab49('0x6e')]*_0xb37439['erlangAbandonmentRate']*_0xb37439[_0xab49('0x69')]*_0xb37439[_0xab49('0x6a')]);if(_['isUndefined'](_0xb37439[_0xab49('0x2a')])){if(!_[_0xab49('0x84')](_0xb37439[_0xab49('0x71')])){_0xb37439[_0xab49('0x71')]=undefined;loggerPredictive['error'](_0xab49('0x1ce'),'check\x20predictive\x20is\x20not\x20undefine');}if(!_[_0xab49('0x84')](_0xb37439['handlePredictive'])){loggerPredictive[_0xab49('0x95')]('[startMethodPredictive][StartProgressive]',_0xab49('0x1cf'));clearInterval(_0xb37439[_0xab49('0x90')]);_0xb37439[_0xab49('0x90')]=undefined;}_0xb37439['startProgressive']=moment()[_0xab49('0x76')]('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive['info'](_0xb37439[_0xab49('0x3c')],_0xab49('0x1d0'),_0xb37439[_0xab49('0x2a')]);this[_0xab49('0x162')](_0xb37439,0x1);}else if(ifInterval(_0xb37439['dialPredictiveInterval'],_0xb37439['startProgressive'])){this[_0xab49('0x162')](_0xb37439,0x1);loggerPredictiveCalls[_0xab49('0x7c')](_0xab49('0x1d1'),_0xb37439[_0xab49('0x2a')],_0xb37439[_0xab49('0x3c')]);_0xb37439[_0xab49('0x6e')]=0x0;_0xb37439[_0xab49('0x124')]=0x0;}else if(_0x14cf92<_0x2ac97c&&_0xb37439[_0xab49('0x1d2')]===_0xab49('0x1d3')){freeVariablesPredictive(_0xb37439);loggerPredictive[_0xab49('0x7c')](_0xab49('0x1d4'),_0xab49('0x1d5'),_0x2ac97c,_0xab49('0x2a'),_0xb37439[_0xab49('0x3c')]);}else if(_0x433105<_0xb37439[_0xab49('0x124')]&&_0xb37439['dialPredictiveOptimization']==='dropRate'){freeVariablesPredictive(_0xb37439);loggerPredictive[_0xab49('0x7c')](_0xab49('0x1d6'),_0xab49('0x1d7'),_0x433105,_0xab49('0x1d8'),_0xb37439[_0xab49('0x124')],_0xab49('0x2a'),_0xb37439['name']);}else if(!ifInterval(_0xb37439[_0xab49('0x1d9')],_0xb37439[_0xab49('0x2a')])&&_['isUndefined'](_0xb37439[_0xab49('0x71')])&&!_[_0xab49('0x84')](_0xb37439[_0xab49('0x2a')])){_0xb37439[_0xab49('0x71')]=moment()[_0xab49('0x76')](_0xab49('0x107'));loggerPredictive[_0xab49('0x7c')](_0xb37439[_0xab49('0x3c')],_0xab49('0x1da'),_0xb37439[_0xab49('0x71')]);this[_0xab49('0xc5')](_0xb37439[_0xab49('0x1d9')])[_0xab49('0xc1')](this[_0xab49('0x1db')](_0xb37439))[_0xab49('0xc1')](mergeDataErlangB(_0xb37439))['then'](this[_0xab49('0x1dc')](_0xb37439))[_0xab49('0xb7')](loggerCatchPredictive('Predictive\x20after\x20first\x20interval',_0xb37439));}else if(!ifInterval(_0xb37439['dialPredictiveInterval'],_0xb37439[_0xab49('0x71')])){_0xb37439['predictiveIntervalErlangCallsDroppedCalls']=0x0;_0xb37439['startPredictive']=moment()['format'](_0xab49('0x107'));loggerPredictive[_0xab49('0x7c')](_0xb37439['name'],_0xab49('0x1dd'),_0xb37439['startPredictive']);clearInterval(_0xb37439[_0xab49('0x90')]);_0xb37439[_0xab49('0x90')]=undefined;this[_0xab49('0xc5')](_0xb37439[_0xab49('0x1d9')])[_0xab49('0xc1')](this[_0xab49('0x1db')](_0xb37439))['then'](mergeDataErlangB(_0xb37439))[_0xab49('0xc1')](this[_0xab49('0x1dc')](_0xb37439))[_0xab49('0xb7')](loggerCatchPredictive(_0xab49('0x1de'),_0xb37439));}else if(_0xb37439[_0xab49('0x1cb')]&&_0x18c6da<_0xb37439[_0xab49('0x1cb')]-_0x4187cd){freeVariablesPredictive(_0xb37439);loggerPredictive[_0xab49('0x7c')](_0xb37439['name'],_0xab49('0x1df'),_0x18c6da,_0xab49('0x1e0'),_0xb37439[_0xab49('0x1cb')],'-',_0x4187cd,'=',_0xb37439[_0xab49('0x1cb')]-_0x4187cd,')');}else if(_0xb37439[_0xab49('0x1cb')]&&_0x18c6da>_0xb37439[_0xab49('0x1cb')]+_0x5d0dc8){freeVariablesPredictive(_0xb37439);loggerPredictive[_0xab49('0x7c')](_0xb37439['name'],_0xab49('0x1df'),_0x18c6da,_0xab49('0x1e1'),_0xb37439[_0xab49('0x1cb')],'+',_0x5d0dc8,'=',_0xb37439['predictiveIntervalAvailable']+_0x5d0dc8,')');}};Dialer[_0xab49('0x1e')][_0xab49('0x1db')]=function(_0x2dcae4){var _0x10ef4e=this;return function(_0x4d259a){return new BPromise(function(_0x4f3b90,_0x56a09d){_[_0xab49('0x8d')](_0x2dcae4,_0x4d259a[0x0]);if(checkGetDataPredictive(_0x4d259a[0x0])){var _0x2558a4=_0x2dcae4['predictiveIntervalAvailable']=_0x2dcae4[_0xab49('0xa1')]+_0x2dcae4[_0xab49('0xa3')];var _0x433bba=_0x2dcae4[_0xab49('0x1d9')]*0x3c;var _0x81e2df=_0x4d259a[0x0][_0xab49('0x65')]+_0x4d259a[0x0]['predictiveIntervalAvgHoldtime'];var _0x47c3d8=(_0x4d259a[0x0][_0xab49('0x63')]+_0x4d259a[0x0][_0xab49('0x67')]+_0x4d259a[0x0][_0xab49('0x66')])/_0x4d259a[0x0][_0xab49('0x6c')];_0x2dcae4[_0xab49('0x69')]=_0x47c3d8>0x0?_0x47c3d8:0x1;switch(_0x2dcae4[_0xab49('0x1d2')]){case _0xab49('0x1d3'):var _0x424d6b=_0x2dcae4[_0xab49('0x1c9')]/0x64;return _0x10ef4e[_0xab49('0x1e2')](_0x2558a4,_0x433bba,_0x81e2df,_0x47c3d8,_0x424d6b)[_0xab49('0xc1')](function(_0x37b983){return _0x4f3b90(_0x37b983);});case _0xab49('0x1e3'):var _0x851d3=_0x2dcae4[_0xab49('0x1c9')]/0x64;return _0x10ef4e[_0xab49('0x1e4')](_0x2558a4,_0x433bba,_0x81e2df,_0x47c3d8,_0x851d3)[_0xab49('0xc1')](function(_0x40fb6d){return _0x4f3b90(_0x40fb6d);});default:return _0x56a09d(msgResponse(_0xab49('0x1e5'),_0xab49('0x14e'),_0xab49('0x1e6')));}}else{return _0x56a09d(msgResponse('[getDataPredictive]','Failure',_0xab49('0x1e7')));}});};};Dialer[_0xab49('0x1e')][_0xab49('0x1e8')]=function(_0x90d6da){var _0x29e3ae=this;return function(_0x26e975){return new BPromise(function(_0x25a503,_0x3d34de){_[_0xab49('0x8d')](_0x90d6da,_0x26e975[0x0]);if(checkGetDataPredictive(_0x26e975[0x0])){loggerPredictive['info'](JSON[_0xab49('0x44')](_0x26e975[0x0]));if(_0x90d6da['dialPredictiveOptimization']===_0xab49('0x1d3')){return _0x29e3ae[_0xab49('0xcf')](_0x90d6da['id'])[_0xab49('0xc1')](function(_0x5c0979){var _0x58ba82=_0x90d6da['loggedIn']-_0x5c0979[0x0]['outboundQueuePauses'];var _0x116bd6=_0x90d6da[_0xab49('0x1d9')]*0x3c;var _0x5c0c3f=_0x26e975[0x0][_0xab49('0x65')]+_0x26e975[0x0][_0xab49('0x64')];var _0x2fa528=(_0x26e975[0x0][_0xab49('0x63')]+_0x26e975[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x26e975[0x0][_0xab49('0x66')])/_0x26e975[0x0][_0xab49('0x6c')];var _0x334a0a=_0x90d6da[_0xab49('0x1c9')]/0x64;_0x90d6da['predictiveIntervalPauses']=_0x5c0979[0x0][_0xab49('0x1e9')]||0x0;_0x90d6da[_0xab49('0x69')]=_0x2fa528>0x0?_0x2fa528:0x1;return _0x29e3ae[_0xab49('0x1e2')](_0x58ba82,_0x116bd6,_0x5c0c3f,_0x2fa528,_0x334a0a);})[_0xab49('0xc1')](function(_0x23b1d8){return _0x25a503(_0x23b1d8);})['catch'](function(_0x24a58b){return _0x3d34de(msgResponse(_0xab49('0x1ea'),_0xab49('0x14e'),JSON[_0xab49('0x44')](_0x24a58b)));});}if(_0x90d6da[_0xab49('0x1d2')]==='agentBusyFactor'){return _0x29e3ae[_0xab49('0xcf')](_0x90d6da['id'])[_0xab49('0xc1')](function(_0x315781){var _0x55fbf3=_0x90d6da[_0xab49('0x4c')]-_0x315781[0x0][_0xab49('0x1e9')];var _0x376df1=_0x90d6da[_0xab49('0x1d9')]*0x3c;var _0x45337c=_0x26e975[0x0][_0xab49('0x65')]+_0x26e975[0x0][_0xab49('0x64')];var _0x508038=(_0x26e975[0x0][_0xab49('0x63')]+_0x26e975[0x0][_0xab49('0x67')]+_0x26e975[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x26e975[0x0]['predictiveIntervalTotalCalls'];var _0x403ca8=_0x90d6da[_0xab49('0x1c9')]/0x64;_0x90d6da[_0xab49('0x6b')]=_0x315781[0x0][_0xab49('0x1e9')]||0x0;_0x90d6da[_0xab49('0x69')]=_0x508038>0x0?_0x508038:0x1;return _0x29e3ae[_0xab49('0x1e4')](_0x55fbf3,_0x376df1,_0x45337c,_0x508038,_0x403ca8);})[_0xab49('0xc1')](function(_0x256d9d){return _0x25a503(_0x256d9d);})[_0xab49('0xb7')](function(_0x6826be){return _0x3d34de(msgResponse('[CatchErlangB]',_0xab49('0x14e'),JSON[_0xab49('0x44')](_0x6826be)));});}}else{return _0x3d34de(msgResponse(_0xab49('0x1e5'),_0xab49('0x14e'),_0xab49('0x1e7')));}});};};Dialer['prototype'][_0xab49('0x1dc')]=function(_0x5cd049){var _0x4bdde3=this;return function(){var _0x3d4a01=0x0;var _0x4034af=Math[_0xab49('0x1cd')](_0x5cd049['erlangCallToSecond']*0x3e8);if(_0x4034af>0x0){_0x4034af=_0x4034af<0x64?0x64:_0x4034af;loggerPredictive['info'](_0x5cd049[_0xab49('0x3c')],_0xab49('0x1eb'),_0x4034af,_0xab49('0x45'));_0x5cd049['handlePredictive']=setInterval(function(){_0x4bdde3[_0xab49('0x90')](_0x5cd049);loggerPredictiveCalls[_0xab49('0x7c')](_0xab49('0x1ec'),_0x3d4a01+=0x1);},_0x4034af);}else{loggerPredictive[_0xab49('0x7c')](_0x5cd049[_0xab49('0x3c')],_0xab49('0x1ed'));}};};Dialer[_0xab49('0x1e')][_0xab49('0x1ee')]=function(_0x112f3d,_0xa8ba01){var _0xd48d85=this;return function(_0x59e7a8){if(_[_0xab49('0x40')](_0x59e7a8)){if(_['isNil'](_0xa8ba01[_0xab49('0xdc')])||!_0xa8ba01[_0xab49('0x1ef')]){if(_0x112f3d[_0xab49('0x160')]===_0xab49('0x9')){_0x112f3d[_0xab49('0x137')]=_[_0xab49('0x84')](_0x112f3d['queueStatusComplete'])?!![]:_0x112f3d[_0xab49('0x137')];var _0x1eb9ac=uuid['v4']();_0xd48d85['actions'][_0x1eb9ac]=new Action(_0x112f3d,_0xa8ba01,_0x1eb9ac);loggerBooked['info'](_0xab49('0x1f0'),_0x1eb9ac,_0xab49('0x1f1'),JSON[_0xab49('0x44')](_0x112f3d['queueStatusComplete']),'Queue:\x20',_0x112f3d[_0xab49('0x3c')]);if(_0x112f3d[_0xab49('0x137')]){_0x112f3d[_0xab49('0x137')]=![];_0xd48d85[_0xab49('0x135')][_0xd48d85[_0xab49('0x27')][_0x1eb9ac][_0xab49('0xba')]]=[];ami[_0xab49('0xb4')]({'actionid':_0x1eb9ac,'action':_0xab49('0x1f2'),'queue':_0x112f3d[_0xab49('0x3c')]})['catch'](function(){_0xd48d85[_0xab49('0xb9')](_0x112f3d);_0xd48d85[_0xab49('0xc7')]({'active':![],'ContactId':_0xd48d85['actions'][_0x1eb9ac][_0xab49('0xda')],'ListId':_0xd48d85[_0xab49('0x27')][_0x1eb9ac][_0xab49('0xdb')],'VoiceQueueId':_0xd48d85[_0xab49('0x27')][_0x1eb9ac][_0xab49('0xdd')]||undefined,'CampaignId':_0xd48d85[_0xab49('0x27')][_0x1eb9ac][_0xab49('0x108')]||undefined})[_0xab49('0xb7')](loggerCatch(_0xab49('0x1f3')));delete _0xd48d85['actions'][_0x1eb9ac];});}else{loggerBooked[_0xab49('0x7c')]('[booked][checkContactBlack][else]',JSON['stringify'](_0x112f3d['queueStatusComplete']),'Queue:\x20',_0x112f3d[_0xab49('0x3c')]);_0xd48d85[_0xab49('0xb9')](_0x112f3d);_0xd48d85[_0xab49('0xc7')]({'active':![],'ContactId':_0xd48d85[_0xab49('0x27')][_0x1eb9ac][_0xab49('0xda')],'ListId':_0xd48d85[_0xab49('0x27')][_0x1eb9ac][_0xab49('0xdb')],'VoiceQueueId':_0xd48d85[_0xab49('0x27')][_0x1eb9ac][_0xab49('0xdd')]||undefined,'CampaignId':_0xd48d85['actions'][_0x1eb9ac][_0xab49('0x108')]||undefined})[_0xab49('0xb7')](loggerCatch(_0xab49('0x1f3')));delete _0xd48d85[_0xab49('0x27')][_0x1eb9ac];}}else{return _0xd48d85['actionOriginate'](_0x112f3d,_0xa8ba01);}}else{if(getDiff(_0xa8ba01[_0xab49('0x1f4')])<_0x112f3d['dialRecallMeTimeout']*0x3c){if(_0xa8ba01[_0xab49('0x1f5')]&&!_0xa8ba01[_0xab49('0x1f5')]['voicePause']){_0xd48d85[_0xab49('0x22')][_0xab49('0x139')](_0xa8ba01['id'])['finally'](function(){_0xd48d85[_0xab49('0xb9')](_0x112f3d);});}else{_0xd48d85[_0xab49('0xc8')]({'active':![]},_0xa8ba01['id'],0x1)[_0xab49('0x20')](function(){_0xd48d85[_0xab49('0xb9')](_0x112f3d);});}}else{_0x112f3d[_0xab49('0x1f6')]+=0x1;_0xd48d85[_0xab49('0xb9')](_0x112f3d);if(_0x112f3d[_0xab49('0x1f7')]){_0xd48d85['rescheduleContact']({'active':![],'recallme':![],'UserId':null,'ContactId':_0xa8ba01[_0xab49('0xda')],'ListId':_0xa8ba01['ListId'],'VoiceQueueId':_0xa8ba01['VoiceQueueId']||undefined,'CampaignId':_0xa8ba01[_0xab49('0x108')]||undefined})[_0xab49('0xb7')](loggerCatch(_0xab49('0x1f8')));_0xd48d85['createHistory'](createObjHistory(_0x112f3d,_0xa8ba01,'RECALLINQUEUE',0x17,_0xab49('0x1f9')))[_0xab49('0xb7')](loggerCatch(_0xab49('0x1fa')));}else{_0xd48d85['saveInDb'](createObjHistory(_0x112f3d,_0xa8ba01,_0xab49('0x1fb'),0x16,_0xab49('0x1fc')),_0xab49('0x1fd'),_0xab49('0x1fe'));}}}}else{_0x112f3d[_0xab49('0x59')]+=0x1;_0xd48d85['saveInDb'](createObjHistory(_0x112f3d,_0xa8ba01,'BLACKLIST',0xd,_0xab49('0x1ff')),'[Originate][historyBlacklist]',_0xab49('0x200'));throw _0xab49('0x201');}};};Dialer[_0xab49('0x1e')]['handleIvr']=function(_0xc1f326){var _0x6bd3d6=this;var _0x188f20=_0xc1f326['limitCalls']-_0xc1f326[_0xab49('0x6d')]-_0xc1f326[_0xab49('0xcb')];emitCampaignSummary(_0xc1f326);if(_0x188f20>0x0){if(_0x188f20>this[_0xab49('0x26')]){_0x188f20=this[_0xab49('0x26')];}_0xc1f326['temp']+=_0x188f20;this['getContactDialerIvr'](_0xc1f326['id'],_0x188f20,_0xc1f326[_0xab49('0x202')],_0xc1f326)['then'](function(_0x5bf324){_0xc1f326[_0xab49('0xcb')]-=_0x188f20;_0xc1f326[_0xab49('0xcb')]=_0xc1f326[_0xab49('0xcb')]>0x0?_0xc1f326[_0xab49('0xcb')]:0x0;if(!checkContactEmpty(_0x5bf324)){_0xc1f326[_0xab49('0x39')]=_0xab49('0x9f');logger[_0xab49('0x7c')](_0xab49('0x203')+_0xc1f326[_0xab49('0x3c')]);}else{_0xc1f326[_0xab49('0x6d')]+=_0x5bf324[_0xab49('0x98')];_0xc1f326[_0xab49('0x39')]=_0xab49('0x204');for(var _0x143cd2=0x0;_0x143cd2<_0x5bf324[_0xab49('0x98')];_0x143cd2+=0x1){_0xc1f326[_0xab49('0x205')]+=0x1;if(_[_0xab49('0xb3')](_0x5bf324[_0x143cd2])||_['isNil'](_0x5bf324[_0x143cd2]['Contact'])||_[_0xab49('0xb3')](_0x5bf324[_0x143cd2]['Contact'][_0xab49('0x176')])){_0x6bd3d6[_0xab49('0xd7')](_0xab49('0x206'),_0xc1f326,_0x5bf324[_0x143cd2]);}else{_0x6bd3d6[_0xab49('0xc3')](_[_0xab49('0xd9')](_0x5bf324[_0x143cd2],[_0xab49('0x108'),_0xab49('0x207')]))[_0xab49('0xc1')](_0x6bd3d6['checkContactBlack'](_0xc1f326,_0x5bf324[_0x143cd2]))['catch'](_0x6bd3d6[_0xab49('0xd6')](_0xab49('0x208'),_0xc1f326));}}}})[_0xab49('0xb7')](loggerGetContactDialer('[getContactCampaign2]',_0xc1f326,_0x188f20));}};Dialer[_0xab49('0x1e')][_0xab49('0x162')]=function(_0x3fdc37,_0x36117b){var _0x931257=this;var _0x2239ce=[];var _0x4c5128=_0x36117b>=0x1?_0x36117b:0x1;if(_0x3fdc37['dialMethod']===_0xab49('0x9')){_0x4c5128=0x1;}var _0x2e5634=Math[_0xab49('0x1cd')](_0x3fdc37[_0xab49('0xa3')]*_0x4c5128)-_0x3fdc37[_0xab49('0x6d')]-_0x3fdc37[_0xab49('0xcb')];emitVoiceQueueSummary(_0x3fdc37);if(_0x3fdc37[_0xab49('0x209')]>0x0){var _0x1f1e2b=_0x3fdc37[_0xab49('0x209')]-_0x3fdc37['originated']-_0x3fdc37['talking']-_0x3fdc37[_0xab49('0xcb')]-_0x3fdc37['pTalking'];if(_0x2e5634>_0x1f1e2b){_0x2e5634=_0x1f1e2b;}}if(_0x2e5634>0x0){if(_0x3fdc37[_0xab49('0x160')]==='booked'){_0x2e5634=0x1;}if(_0x2e5634>this[_0xab49('0x26')]){_0x2e5634=this[_0xab49('0x26')];}_0x3fdc37[_0xab49('0xcb')]+=_0x2e5634;for(var _0x562883 in this[_0xab49('0x25')]){if(typeof this[_0xab49('0x25')][_0x562883]!==_0xab49('0x99')){if(this[_0xab49('0x25')][_0x562883][_0xab49('0xaa')]===_0xab49('0x20a')&&this['agents'][_0x562883][_0xab49('0xb5')]===_0xab49('0xe5')){_0x2239ce['push'](this[_0xab49('0x25')][_0x562883]['id']);}}}this[_0xab49('0xca')](_0x3fdc37['id'],_0x2239ce,_0x2e5634,_0x3fdc37[_0xab49('0x202')],_0x3fdc37)['then'](function(_0x3b1b90){_0x3fdc37[_0xab49('0xcb')]-=_0x2e5634;_0x3fdc37[_0xab49('0xcb')]=_0x3fdc37[_0xab49('0xcb')]>0x0?_0x3fdc37[_0xab49('0xcb')]:0x0;if(!checkContactEmpty(_0x3b1b90)){_0x931257['countReScheduled'](_0x3fdc37)[_0xab49('0xc1')](sendMessageReschedule(_0x3fdc37))[_0xab49('0xb7')](loggerCatch(_0xab49('0xbe')));}else{_0x3fdc37['originated']+=_0x3b1b90[_0xab49('0x98')];_0x3fdc37[_0xab49('0x39')]=_0x3fdc37[_0xab49('0x160')]===_0xab49('0x9')?_0xab49('0x17d'):_0xab49('0x204');for(var _0x2ffc50=0x0;_0x2ffc50<_0x3b1b90[_0xab49('0x98')];_0x2ffc50+=0x1){if(_['isNil'](_0x3b1b90[_0x2ffc50])||_[_0xab49('0xb3')](_0x3b1b90[_0x2ffc50][_0xab49('0x175')])||_['isNil'](_0x3b1b90[_0x2ffc50][_0xab49('0x175')][_0xab49('0x176')])){_0x931257['emptyContact'](_0xab49('0x206'),_0x3fdc37,_0x3b1b90[_0x2ffc50]);}else{_0x931257[_0xab49('0xbf')](_['pick'](_0x3b1b90[_0x2ffc50],[_0xab49('0xdd'),_0xab49('0x207')]))['then'](_0x931257[_0xab49('0x1ee')](_0x3fdc37,_0x3b1b90[_0x2ffc50]))[_0xab49('0xb7')](_0x931257[_0xab49('0xd6')](_0xab49('0x206'),_0x3fdc37));}}}})[_0xab49('0xb7')](loggerGetContactDialer(_0xab49('0x20b'),_0x3fdc37,_0x2e5634));}};Dialer[_0xab49('0x1e')][_0xab49('0x90')]=function(_0x1a5f6f){if(_0x1a5f6f[_0xab49('0x209')]>0x0){var _0x237dc5=_0x1a5f6f[_0xab49('0x209')]-_0x1a5f6f['originated']-_0x1a5f6f[_0xab49('0xa1')];if(_0x237dc5>0x0){this[_0xab49('0x20c')](_0x1a5f6f);}else{loggerPredictiveCalls[_0xab49('0x7c')](_0xab49('0x20d'));}}else{this[_0xab49('0x20c')](_0x1a5f6f);}};Dialer[_0xab49('0x1e')][_0xab49('0x20c')]=function(_0x357384){var _0x358126=this;var _0x50e373=[];_0x357384['originated']+=0x1;for(var _0x5ccf9e in this['agents']){if(typeof this[_0xab49('0x25')][_0x5ccf9e]!==_0xab49('0x99')){if(this[_0xab49('0x25')][_0x5ccf9e][_0xab49('0xaa')]===_0xab49('0x20a')&&this[_0xab49('0x25')][_0x5ccf9e][_0xab49('0xb5')]===_0xab49('0xe5')){_0x50e373['push'](this['agents'][_0x5ccf9e]['id']);}}}this[_0xab49('0xca')](_0x357384['id'],_0x50e373,0x1,_0x357384[_0xab49('0x202')],_0x357384)['then'](function(_0x40508a){if(!checkContactEmpty(_0x40508a)){checkContactLowerLimitOriginate(_0x357384,0x1,0x0);_0x358126['countReScheduled'](_0x357384)['then'](sendMessageReschedule(_0x357384))[_0xab49('0xb7')](loggerCatch(_0xab49('0xbe')));}else{_0x357384[_0xab49('0x39')]=_0xab49('0x204');if(_[_0xab49('0xb3')](_0x40508a[0x0])||_[_0xab49('0xb3')](_0x40508a[0x0][_0xab49('0x175')])||_['isNil'](_0x40508a[0x0][_0xab49('0x175')][_0xab49('0x176')])){_0x358126[_0xab49('0xd7')](_0xab49('0x206'),_0x357384,_0x40508a[0x0]);}else{_0x358126[_0xab49('0xbf')](_[_0xab49('0xd9')](_0x40508a[0x0],[_0xab49('0xdd'),_0xab49('0x207')]))[_0xab49('0xc1')](_0x358126[_0xab49('0x1ee')](_0x357384,_0x40508a[0x0]))[_0xab49('0xb7')](_0x358126[_0xab49('0xd6')](_0xab49('0x20e'),_0x357384));}}})[_0xab49('0xb7')](loggerGetContactDialer(_0xab49('0x20f'),_0x357384,0x1));emitVoiceQueueSummary(_0x357384);};Dialer[_0xab49('0x1e')][_0xab49('0x1e2')]=function(_0x4c14e6,_0x5eb68c,_0x3b1ae,_0x30fd38,_0x4aab81,_0x1301b5){loggerPredictive['info'](_0xab49('0x210'));loggerPredictive[_0xab49('0x7c')](_0xab49('0x211'),_0x4c14e6);loggerPredictive[_0xab49('0x7c')](_0xab49('0x212'),_0x5eb68c);loggerPredictive[_0xab49('0x7c')](_0xab49('0x213'),_0x3b1ae);loggerPredictive[_0xab49('0x7c')](_0xab49('0x214'),_0x30fd38);loggerPredictive['info']('Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x4aab81);loggerPredictive[_0xab49('0x7c')](_0xab49('0x83'));return new BPromise(function(_0x5a0925,_0x563d3c){if(_0x4c14e6<=0x0||isNaN(_0x4c14e6)){return _0x563d3c(msgResponse(_0xab49('0x215'),_0xab49('0x43'),_0xab49('0x216')+_0x4c14e6));}if(_0x3b1ae<=0x0||isNaN(_0x3b1ae)){return _0x563d3c(msgResponse(_0xab49('0x215'),'Error',_0xab49('0x217')+_0x3b1ae));}if(_0x30fd38<=0x0||isNaN(_0x30fd38)){return _0x563d3c(msgResponse(_0xab49('0x215'),_0xab49('0x43'),_0xab49('0x218')+_0x30fd38));}if(_0x5eb68c<=0x0||isNaN(_0x5eb68c)){return _0x563d3c(msgResponse('[abandonmentRate]','Error',_0xab49('0x219')+_0x5eb68c));}if(_0x4aab81<=0x0||isNaN(_0x4aab81)){return _0x563d3c(msgResponse(_0xab49('0x215'),'Error',_0xab49('0x21a')+_0x4aab81));}_0x1301b5=_0x1301b5||0x0;var _0xdc8c43=0x1/_0x3b1ae;var _0x6eca7=0x0;var _0x27d918=0x0;var _0x383643=0x0;var _0x2789f1=0x0;for(var _0x5c1a0d=0x0;_0x383643<_0x4aab81;_0x5c1a0d+=0x1){_0x27d918=_0x5c1a0d/_0x5eb68c;_0x6eca7=(_0x30fd38*_0x27d918+_0x1301b5)/_0xdc8c43;_0x383643=erlangb(_0x6eca7,_0x4c14e6);_0x2789f1=_0x6eca7/_0x4c14e6*(0x1-erlangb(_0x6eca7,_0x4c14e6));}return _0x5a0925({'erlangCalls':_0x5c1a0d,'erlangCallToSecond':_0x5eb68c/_0x5c1a0d,'erlangAbandonmentRate':_0x383643,'erlangBusyFactor':_0x2789f1});});};Dialer[_0xab49('0x1e')]['busyFactor']=function(_0x2db238,_0x27eb6e,_0x1a1b39,_0x5ee79c,_0x2a07e1,_0x28bd1f){loggerPredictive['info'](_0xab49('0x21b'));loggerPredictive[_0xab49('0x7c')]('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',_0x2db238);loggerPredictive[_0xab49('0x7c')](_0xab49('0x212'),_0x27eb6e);loggerPredictive[_0xab49('0x7c')]('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',_0x1a1b39);loggerPredictive['info'](_0xab49('0x214'),_0x5ee79c);loggerPredictive['info'](_0xab49('0x21c'),_0x2a07e1);loggerPredictive[_0xab49('0x7c')](_0xab49('0x83'));return new BPromise(function(_0x553ed3,_0x1e9d15){if(_0x2db238<=0x0||isNaN(_0x2db238)){return _0x1e9d15(msgResponse(_0xab49('0x21d'),'Error',_0xab49('0x216')+_0x2db238));}if(_0x1a1b39<=0x0||isNaN(_0x1a1b39)){return _0x1e9d15(msgResponse(_0xab49('0x21d'),_0xab49('0x43'),_0xab49('0x217')+_0x1a1b39));}if(_0x5ee79c<=0x0||isNaN(_0x5ee79c)){return _0x1e9d15(msgResponse(_0xab49('0x21d'),_0xab49('0x43'),'p\x20=\x20'+_0x5ee79c));}if(_0x27eb6e<=0x0||isNaN(_0x27eb6e)){return _0x1e9d15(msgResponse(_0xab49('0x21d'),'Error',_0xab49('0x219')+_0x27eb6e));}if(_0x2a07e1<=0x0||isNaN(_0x2a07e1)){return _0x1e9d15(msgResponse(_0xab49('0x21d'),'Error','Umin\x20=\x20'+_0x2a07e1));}_0x28bd1f=_0x28bd1f||0x0;var _0x1c7627=0x1/_0x1a1b39;var _0x167f52=0x0;var _0x3d0f23=0x0;var _0x5c28c6=0x0;var _0x19dedc=0x0;for(var _0x183862=0x0;_0x19dedc<_0x2a07e1;_0x183862+=0x1){_0x3d0f23=_0x183862/_0x27eb6e;_0x167f52=(_0x5ee79c*_0x3d0f23+_0x28bd1f)/_0x1c7627;_0x5c28c6=erlangb(_0x167f52,_0x2db238);_0x19dedc=_0x167f52/_0x2db238*(0x1-erlangb(_0x167f52,_0x2db238));}return _0x553ed3({'erlangCalls':_0x183862,'erlangCallToSecond':_0x27eb6e/_0x183862,'erlangAbandonmentRate':_0x5c28c6,'erlangBusyFactor':_0x19dedc});});};module[_0xab49('0x21e')]=Dialer; \ No newline at end of file diff --git a/server/services/ami/dialer/queueCallerAbandon.js b/server/services/ami/dialer/queueCallerAbandon.js index 4a0a78c..8c7b814 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 _0xd4eb=['ringtime','holdtime','talktime','membername','connectedlinename','reason','callback','callbackuniqueid','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridname','exports','util','lodash','moment','milliseconds','diff','seconds','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countabandonedretry','countmachineretry','countagentrejectretry','countdropretry','uniqueid','calleridname','name','number','starttime','responsetime','droptime','endtime'];(function(_0x151935,_0x58df29){var _0x3c8f56=function(_0x31e2f6){while(--_0x31e2f6){_0x151935['push'](_0x151935['shift']());}};_0x3c8f56(++_0x58df29);}(_0xd4eb,0x68));var _0xbd4e=function(_0x7a856b,_0x484fc6){_0x7a856b=_0x7a856b-0x0;var _0x3ccc3c=_0xd4eb[_0x7a856b];return _0x3ccc3c;};'use strict';var util=require(_0xbd4e('0x0'));var _=require(_0xbd4e('0x1'));var moment=require(_0xbd4e('0x2'));function getSeconds(_0x49b476,_0x383f79){var _0x131e70=moment(_0x49b476)[_0xbd4e('0x3')](0x0);var _0xde2bc=moment(_0x383f79)[_0xbd4e('0x3')](0x0);return _0x131e70[_0xbd4e('0x4')](_0xde2bc,_0xbd4e('0x5'));}function QueueCallerAbandon(_0xe6531,_0x23c6f2){this['scheduledat']=_0xe6531[_0xbd4e('0x6')];this[_0xbd4e('0x7')]=_0xe6531[_0xbd4e('0x7')];this[_0xbd4e('0x8')]=_0xe6531[_0xbd4e('0x7')]===_0xbd4e('0x9')?_0xbd4e('0xa'):_0xe6531[_0xbd4e('0x7')];this[_0xbd4e('0xb')]=_0xe6531['countbusyretry'];this[_0xbd4e('0xc')]=_0xe6531[_0xbd4e('0xc')];this[_0xbd4e('0xd')]=_0xe6531['countnoanswerretry'];this[_0xbd4e('0xe')]=_0xe6531['countbusyretry']+_0xe6531[_0xbd4e('0xc')]+_0xe6531[_0xbd4e('0xd')]+_0xe6531[_0xbd4e('0xf')]+_0xe6531['countdropretry']+_0xe6531[_0xbd4e('0x10')]+_0xe6531[_0xbd4e('0x11')]+_0xe6531[_0xbd4e('0x12')];this['countnosuchnumberretry']=_0xe6531[_0xbd4e('0xf')];this[_0xbd4e('0x13')]=_0xe6531[_0xbd4e('0x13')];this[_0xbd4e('0x10')]=_0xe6531['countabandonedretry'];this['countmachineretry']=_0xe6531[_0xbd4e('0x11')];this[_0xbd4e('0x12')]=_0xe6531[_0xbd4e('0x12')];this['uniqueid']=_0x23c6f2[_0xbd4e('0x14')];this[_0xbd4e('0x15')]=_0xe6531[_0xbd4e('0x16')];this['calleridnum']=_0xe6531[_0xbd4e('0x17')];this[_0xbd4e('0x18')]=_0xe6531['starttime'];this[_0xbd4e('0x19')]=_0xe6531[_0xbd4e('0x19')];this[_0xbd4e('0x1a')]=_0xe6531['droptime'];this[_0xbd4e('0x1b')]=this[_0xbd4e('0x1a')];this[_0xbd4e('0x1c')]=getSeconds(_0xe6531[_0xbd4e('0x19')],_0xe6531[_0xbd4e('0x18')]);this[_0xbd4e('0x1d')]=getSeconds(this['droptime'],_0xe6531[_0xbd4e('0x19')]);this[_0xbd4e('0x1e')]=0x0;this[_0xbd4e('0xa')]=_0x23c6f2[_0xbd4e('0xa')];this[_0xbd4e('0x1f')]=_0x23c6f2[_0xbd4e('0x20')];this[_0xbd4e('0x21')]=_0x23c6f2[_0xbd4e('0x21')];this[_0xbd4e('0x22')]=_0xe6531[_0xbd4e('0x22')];this[_0xbd4e('0x23')]=_0xe6531['callbackuniqueid'];this['callbackat']=_0xe6531['callbackat'];this[_0xbd4e('0x24')]=_0xe6531[_0xbd4e('0x24')];this[_0xbd4e('0x25')]=_0xe6531[_0xbd4e('0x25')];this[_0xbd4e('0x26')]=_0xe6531[_0xbd4e('0x26')];this['UserId']=_0xe6531[_0xbd4e('0x27')];this[_0xbd4e('0x28')]=_0xe6531[_0xbd4e('0x28')];this[_0xbd4e('0x29')]=_0xe6531[_0xbd4e('0x29')];this['originatecalleridnum']=_0xe6531['originatecalleridnum']||'';this[_0xbd4e('0x2a')]=_0xe6531[_0xbd4e('0x2a')]||'';}module[_0xbd4e('0x2b')]=QueueCallerAbandon; \ No newline at end of file +var _0xb12a=['moment','milliseconds','seconds','scheduledat','type','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countabandonedretry','countmachineretry','countdropretry','uniqueid','calleridname','name','number','starttime','responsetime','droptime','ringtime','holdtime','membername','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','lodash'];(function(_0x1ab0e6,_0x17ba8d){var _0x248815=function(_0x5d2b40){while(--_0x5d2b40){_0x1ab0e6['push'](_0x1ab0e6['shift']());}};_0x248815(++_0x17ba8d);}(_0xb12a,0xbd));var _0xab12=function(_0x4f5401,_0xd817c1){_0x4f5401=_0x4f5401-0x0;var _0x5205c3=_0xb12a[_0x4f5401];return _0x5205c3;};'use strict';var util=require('util');var _=require(_0xab12('0x0'));var moment=require(_0xab12('0x1'));function getSeconds(_0x2e73f5,_0x2063fa){var _0x353502=moment(_0x2e73f5)[_0xab12('0x2')](0x0);var _0x5ec622=moment(_0x2063fa)[_0xab12('0x2')](0x0);return _0x353502['diff'](_0x5ec622,_0xab12('0x3'));}function QueueCallerAbandon(_0x10a45b,_0x217ddf){this[_0xab12('0x4')]=_0x10a45b['scheduledat'];this[_0xab12('0x5')]=_0x10a45b['type'];this['campaigntype']=_0x10a45b[_0xab12('0x5')]===_0xab12('0x6')?_0xab12('0x7'):_0x10a45b['type'];this['countbusyretry']=_0x10a45b[_0xab12('0x8')];this[_0xab12('0x9')]=_0x10a45b[_0xab12('0x9')];this[_0xab12('0xa')]=_0x10a45b[_0xab12('0xa')];this[_0xab12('0xb')]=_0x10a45b['countbusyretry']+_0x10a45b['countcongestionretry']+_0x10a45b['countnoanswerretry']+_0x10a45b[_0xab12('0xc')]+_0x10a45b['countdropretry']+_0x10a45b[_0xab12('0xd')]+_0x10a45b[_0xab12('0xe')]+_0x10a45b['countagentrejectretry'];this[_0xab12('0xc')]=_0x10a45b['countnosuchnumberretry'];this[_0xab12('0xf')]=_0x10a45b[_0xab12('0xf')];this[_0xab12('0xd')]=_0x10a45b[_0xab12('0xd')];this[_0xab12('0xe')]=_0x10a45b[_0xab12('0xe')];this['countagentrejectretry']=_0x10a45b['countagentrejectretry'];this[_0xab12('0x10')]=_0x217ddf[_0xab12('0x10')];this[_0xab12('0x11')]=_0x10a45b[_0xab12('0x12')];this['calleridnum']=_0x10a45b[_0xab12('0x13')];this[_0xab12('0x14')]=_0x10a45b[_0xab12('0x14')];this[_0xab12('0x15')]=_0x10a45b[_0xab12('0x15')];this['droptime']=_0x10a45b[_0xab12('0x16')];this['endtime']=this[_0xab12('0x16')];this[_0xab12('0x17')]=getSeconds(_0x10a45b[_0xab12('0x15')],_0x10a45b['starttime']);this[_0xab12('0x18')]=getSeconds(this['droptime'],_0x10a45b[_0xab12('0x15')]);this['talktime']=0x0;this['queue']=_0x217ddf['queue'];this[_0xab12('0x19')]=_0x217ddf['connectedlinename'];this[_0xab12('0x1a')]=_0x217ddf[_0xab12('0x1a')];this[_0xab12('0x1b')]=_0x10a45b[_0xab12('0x1b')];this[_0xab12('0x1c')]=_0x10a45b[_0xab12('0x1c')];this[_0xab12('0x1d')]=_0x10a45b[_0xab12('0x1d')];this[_0xab12('0x1e')]=_0x10a45b['recallme'];this['ContactId']=_0x10a45b[_0xab12('0x1f')];this['ListId']=_0x10a45b[_0xab12('0x20')];this['UserId']=_0x10a45b[_0xab12('0x21')];this[_0xab12('0x22')]=_0x10a45b[_0xab12('0x22')];this[_0xab12('0x23')]=_0x10a45b[_0xab12('0x23')];this[_0xab12('0x24')]=_0x10a45b['originatecalleridnum']||'';this[_0xab12('0x25')]=_0x10a45b[_0xab12('0x25')]||'';}module['exports']=QueueCallerAbandon; \ No newline at end of file diff --git a/server/services/ami/fax/action.js b/server/services/ami/fax/action.js index 51e9d40..6e11be3 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(_0x2b5f9f,_0x58f8f9){var _0x92665c=function(_0x416a95){while(--_0x416a95){_0x2b5f9f['push'](_0x2b5f9f['shift']());}};_0x92665c(++_0x58f8f9);}(_0xa9e0,0x123));var _0x0a9e=function(_0x484e36,_0x4482d8){_0x484e36=_0x484e36-0x0;var _0xafc85d=_0xa9e0[_0x484e36];return _0xafc85d;};'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(_0x4b9a5d,_0x229852){var _0x338cd9=function(_0x2414a7){while(--_0x2414a7){_0x4b9a5d['push'](_0x4b9a5d['shift']());}};_0x338cd9(++_0x229852);}(_0xa9e0,0x123));var _0x0a9e=function(_0x31e29a,_0x349c9b){_0x31e29a=_0x31e29a-0x0;var _0x32d892=_0xa9e0[_0x31e29a];return _0x32d892;};'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 707ec8a..14488ee 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 _0xafc1=['lodash','bluebird','uuid','path','tiff2pdf','./util/gs','../../../config/logger','../ami','./rpcDb','./channel','./util/util','./action','channels','faxAccounts','trunks','actions','newchannel','bind','varset','syncVarSet','syncNewState','newexten','syncNewExten','faxstatus','syncFaxStatus','syncReceiveFax','hangup','originateresponse','syncOriginateResponse','prototype','hasOwnProperty','localstationid','uniqueid','channel','name','\x20syncNewchannel\x20','variable','value','channelstate','channelstatedesc','operation','status','filename','info','\x20syncFaxStatus\x20','remotestationid','pagestransferred','resolution','transferrate','calleridnum','\x20result\x20conversion\x20file\x20','message','create','application/pdf','then','fax','parse','.pdf','catch','\x20notify\x20','stringify','\x20receiveFax\x20','merge','pick','reason','update','AttachmentId','SENDING\x20FAILED\x20','[Fax][Message][Error][Updated]','logger','[Fax][Message][Error][NoUpdate1]','[Fax][Message][Error][NoUpdate2]','[Fax][Message][Updated]','[Fax][Message][NoUpdate1]','finally','syncHangup','\x20hangup\x20sendFile\x20','\x20hangup\x20faxRiceive\x20','faxpages','updateStatus','faxstatusstring','SENDING\x20FAILED:\x20','SENDING\x20FAILED','execOriginate','[Fax][execOriginate][failure]','Fax\x20failed','checkAfterSend','checkTrunk','FaxAccountId','Trunk','Trunk\x20Reachable','format','%s/%s.tif','dir','XMF-PATH','Convert\x20pdf\x20to\x20tif','variablesAction','Action','addVariables','ext','isNil','active','SIP/%s','reachable','unmonitored','isTrunkReachable','[Fax][checkTrunk][Trunk\x20not\x20work]','\x20Trunk\x20is\x20not\x20active','Trunk\x20not\x20working','[Fax][checkTrunk][Empty\x20Fax]','Empty\x20Fax','[Fax][checkTrunk][Empty\x20path]','Empty\x20path','Is\x20Valid','exports'];(function(_0x383b8a,_0x32e3af){var _0x5e00f7=function(_0x11cd27){while(--_0x11cd27){_0x383b8a['push'](_0x383b8a['shift']());}};_0x5e00f7(++_0x32e3af);}(_0xafc1,0x73));var _0x1afc=function(_0x2c9722,_0x33bea2){_0x2c9722=_0x2c9722-0x0;var _0xfaf613=_0xafc1[_0x2c9722];return _0xfaf613;};'use strict';var util=require('util');var _=require(_0x1afc('0x0'));var BPromise=require(_0x1afc('0x1'));var uuid=require(_0x1afc('0x2'));var moment=require('moment');var path=require(_0x1afc('0x3'));var tiff2pdf=require(_0x1afc('0x4'));var gs=require(_0x1afc('0x5'));var logger=require(_0x1afc('0x6'))('fax');var ami=require(_0x1afc('0x7'));var rpcDb=require(_0x1afc('0x8'));var Channel=require(_0x1afc('0x9'));var ut=require(_0x1afc('0xa'));var Action=require(_0x1afc('0xb'));var faxAccount=require('../rpc/faxAccount');var attachment=require('../rpc/attachment');var faxMessage=require('../rpc/faxMessage');function Fax(_0x5dad46){this[_0x1afc('0xc')]={};this[_0x1afc('0xd')]=_0x5dad46[_0x1afc('0xd')];this[_0x1afc('0xe')]=_0x5dad46['trunks'];this[_0x1afc('0xf')]={};ami['on'](_0x1afc('0x10'),this['syncNewchannel'][_0x1afc('0x11')](this));ami['on'](_0x1afc('0x12'),this[_0x1afc('0x13')][_0x1afc('0x11')](this));ami['on']('newstate',this[_0x1afc('0x14')]['bind'](this));ami['on'](_0x1afc('0x15'),this[_0x1afc('0x16')]['bind'](this));ami['on'](_0x1afc('0x17'),this[_0x1afc('0x18')][_0x1afc('0x11')](this));ami['on']('receivefax',this[_0x1afc('0x19')][_0x1afc('0x11')](this));ami['on'](_0x1afc('0x1a'),this['syncHangup'][_0x1afc('0x11')](this));ami['on'](_0x1afc('0x1b'),this[_0x1afc('0x1c')][_0x1afc('0x11')](this));}Fax[_0x1afc('0x1d')]['syncNewchannel']=function(_0x45bfcd){if(_0x45bfcd['context']==='from-voip-provider'){for(var _0x317b0f in this['faxAccounts']){if(this[_0x1afc('0xd')][_0x1afc('0x1e')](_0x317b0f)){if(_0x45bfcd['exten']===this[_0x1afc('0xd')][_0x317b0f][_0x1afc('0x1f')]){this['channels'][_0x45bfcd[_0x1afc('0x20')]]={};this[_0x1afc('0xc')][_0x45bfcd[_0x1afc('0x20')]][_0x1afc('0x21')]=_0x45bfcd[_0x1afc('0x21')];this['channels'][_0x45bfcd[_0x1afc('0x20')]]['id']=this['faxAccounts'][_0x317b0f]['id'];this['channels'][_0x45bfcd['uniqueid']]['name']=this['faxAccounts'][_0x317b0f][_0x1afc('0x22')];logger['info'](_0x45bfcd[_0x1afc('0x20')],'\x20syncNewchannel\x20');}}}}if(this[_0x1afc('0xf')][_0x45bfcd[_0x1afc('0x20')]]){this['channels'][_0x45bfcd[_0x1afc('0x20')]]={};this[_0x1afc('0xc')][_0x45bfcd[_0x1afc('0x20')]][_0x1afc('0x21')]=_0x45bfcd[_0x1afc('0x21')];logger['info'](_0x45bfcd[_0x1afc('0x20')],_0x1afc('0x23'));}};Fax[_0x1afc('0x1d')][_0x1afc('0x13')]=function(_0x4f5f09){if(this[_0x1afc('0xc')][_0x4f5f09[_0x1afc('0x20')]]){for(var _0x594445 in _0x4f5f09[_0x1afc('0x24')]){if(_0x4f5f09[_0x1afc('0x24')][_0x1afc('0x1e')](_0x594445)){this['channels'][_0x4f5f09[_0x1afc('0x20')]][_0x594445]=_0x4f5f09[_0x1afc('0x25')];}}}};Fax[_0x1afc('0x1d')][_0x1afc('0x14')]=function(_0x1cfb71){if(this[_0x1afc('0xc')][_0x1cfb71[_0x1afc('0x20')]]){this[_0x1afc('0xc')][_0x1cfb71[_0x1afc('0x20')]][_0x1afc('0x26')]=_0x1cfb71[_0x1afc('0x26')];this['channels'][_0x1cfb71[_0x1afc('0x20')]]['channelstatedesc']=_0x1cfb71[_0x1afc('0x27')];}};Fax[_0x1afc('0x1d')]['syncNewExten']=function(_0x5c4e3b){if(this[_0x1afc('0xc')][_0x5c4e3b['uniqueid']]){for(var _0x22825f in _0x5c4e3b[_0x1afc('0x24')]){if(_0x5c4e3b[_0x1afc('0x24')][_0x1afc('0x1e')](_0x22825f)){this['channels'][_0x5c4e3b[_0x1afc('0x20')]][_0x22825f]=_0x5c4e3b[_0x1afc('0x25')];}}}};Fax[_0x1afc('0x1d')][_0x1afc('0x18')]=function(_0x4d26c2){if(this[_0x1afc('0xc')][_0x4d26c2[_0x1afc('0x20')]]){this[_0x1afc('0xc')][_0x4d26c2[_0x1afc('0x20')]][_0x1afc('0x28')]=_0x4d26c2[_0x1afc('0x28')];this[_0x1afc('0xc')][_0x4d26c2[_0x1afc('0x20')]][_0x1afc('0x29')]=_0x4d26c2[_0x1afc('0x29')];this['channels'][_0x4d26c2['uniqueid']]['localstationid']=_0x4d26c2[_0x1afc('0x1f')];this[_0x1afc('0xc')][_0x4d26c2['uniqueid']][_0x1afc('0x2a')]=_0x4d26c2['filename'];logger[_0x1afc('0x2b')](_0x4d26c2['uniqueid'],_0x1afc('0x2c'));}};Fax[_0x1afc('0x1d')][_0x1afc('0x19')]=function(_0x2b34a5){var _0x38ff84=this;if(this['channels'][_0x2b34a5['uniqueid']]){var _0x4d47fe=this[_0x1afc('0xc')][_0x2b34a5[_0x1afc('0x20')]]['id'];this[_0x1afc('0xc')][_0x2b34a5['uniqueid']][_0x1afc('0x2d')]=_0x2b34a5[_0x1afc('0x2d')];this[_0x1afc('0xc')][_0x2b34a5[_0x1afc('0x20')]][_0x1afc('0x2e')]=_0x2b34a5[_0x1afc('0x2e')];this[_0x1afc('0xc')][_0x2b34a5['uniqueid']][_0x1afc('0x1f')]=_0x2b34a5['localstationid'];this['channels'][_0x2b34a5['uniqueid']][_0x1afc('0x2f')]=_0x2b34a5[_0x1afc('0x2f')];this[_0x1afc('0xc')][_0x2b34a5['uniqueid']]['transferrate']=_0x2b34a5[_0x1afc('0x30')];this[_0x1afc('0xc')][_0x2b34a5[_0x1afc('0x20')]]['filename']=_0x2b34a5[_0x1afc('0x2a')];this['channels'][_0x2b34a5[_0x1afc('0x20')]]['calleridnum']=_0x2b34a5[_0x1afc('0x31')];if(this[_0x1afc('0xc')][_0x2b34a5[_0x1afc('0x20')]][_0x1afc('0x2e')]>0x0){tiff2pdf(_0x2b34a5['filename'],'/var/opt/motion2/server/files/attachments/',function(_0x1b676d){logger[_0x1afc('0x2b')](_0x2b34a5['uniqueid'],_0x1afc('0x32'),_0x1b676d[_0x1afc('0x33')]);attachment[_0x1afc('0x34')]({'name':path['parse'](_0x2b34a5[_0x1afc('0x2a')])[_0x1afc('0x22')],'basename':path['parse'](_0x2b34a5[_0x1afc('0x2a')])[_0x1afc('0x22')]+'.pdf','type':_0x1afc('0x35')})[_0x1afc('0x36')](function(_0x4686b3){faxAccount['notify'](_0x4d47fe,{'from':_0x2b34a5['calleridnum'],'mapKey':_0x1afc('0x37'),'body':path[_0x1afc('0x38')](_0x2b34a5[_0x1afc('0x2a')])['name']+_0x1afc('0x39'),'AttachmentId':_0x4686b3['id']})[_0x1afc('0x3a')](function(_0x47447b){logger['error'](_0x2b34a5[_0x1afc('0x20')],_0x1afc('0x3b'),JSON[_0x1afc('0x3c')](_0x47447b));});})[_0x1afc('0x3a')](function(_0x2f3bde){logger['error'](_0x2b34a5[_0x1afc('0x20')],_0x1afc('0x3d'),JSON[_0x1afc('0x3c')](_0x2f3bde));});});}logger[_0x1afc('0x2b')](_0x2b34a5[_0x1afc('0x20')],_0x1afc('0x3d'));}};Fax[_0x1afc('0x1d')][_0x1afc('0x1c')]=function(_0x4717c9){if(this[_0x1afc('0xf')][_0x4717c9[_0x1afc('0x20')]]){_[_0x1afc('0x3e')](this[_0x1afc('0xc')][_0x4717c9['uniqueid']],_[_0x1afc('0x3f')](_0x4717c9,['response',_0x1afc('0x40')]));}};function updateStatus(_0x143d09){if(_0x143d09['AttachmentId']){faxMessage[_0x1afc('0x41')](_0x143d09[_0x1afc('0x42')],{'failMessage':_0x1afc('0x43')})[_0x1afc('0x36')](function(_0x269231){ut['logger'](_0x1afc('0x44'),_0x269231);})[_0x1afc('0x3a')](function(_0x338187){ut[_0x1afc('0x45')](_0x1afc('0x46'),_0x338187);});}else{ut[_0x1afc('0x45')](_0x1afc('0x47'));}}Fax[_0x1afc('0x1d')]['updateStatus']=function(_0x47adf5,_0x1e8669,_0x21d5d2){var _0x19f484=this;var _0x31b590={};if(_0x1e8669){_0x31b590={'read':_0x1e8669};}else{_0x31b590={'failMessage':_0x21d5d2};}if(this[_0x1afc('0xf')][_0x47adf5]['AttachmentId']){faxMessage[_0x1afc('0x41')](this[_0x1afc('0xf')][_0x47adf5]['AttachmentId'],_0x31b590)['then'](function(_0x59241a){ut['logger'](_0x1afc('0x48'),_0x59241a);})['catch'](function(_0x328f11){ut['logger'](_0x1afc('0x49'),_0x328f11);})[_0x1afc('0x4a')](function(){delete _0x19f484[_0x1afc('0xc')][_0x47adf5];delete _0x19f484[_0x1afc('0xf')][_0x47adf5];});}else{ut[_0x1afc('0x45')]('[Fax][Message][NoUpdate2]');delete this[_0x1afc('0xc')][_0x47adf5];delete this[_0x1afc('0xf')][_0x47adf5];}};Fax[_0x1afc('0x1d')][_0x1afc('0x4b')]=function(_0x31e597){var _0x2e55bc=this;if(this[_0x1afc('0xc')][_0x31e597[_0x1afc('0x20')]]){if(this['actions'][_0x31e597[_0x1afc('0x20')]]){this[_0x1afc('0xc')][_0x31e597[_0x1afc('0x20')]]['id']=this[_0x1afc('0xf')][_0x31e597[_0x1afc('0x20')]]['id'];this[_0x1afc('0xc')][_0x31e597['uniqueid']][_0x1afc('0x22')]=this[_0x1afc('0xf')][_0x31e597[_0x1afc('0x20')]]['name'];}logger[_0x1afc('0x2b')](_0x31e597[_0x1afc('0x20')],this[_0x1afc('0xf')][_0x31e597['uniqueid']]?_0x1afc('0x4c'):_0x1afc('0x4d'),JSON[_0x1afc('0x3c')](this[_0x1afc('0xc')][_0x31e597['uniqueid']]));if(this['actions'][_0x31e597['uniqueid']]){if(this['channels'][_0x31e597[_0x1afc('0x20')]][_0x1afc('0x4e')]>0x0&&this[_0x1afc('0xc')][_0x31e597[_0x1afc('0x20')]]['faxstatus']==='SUCCESS'){this[_0x1afc('0x4f')](_0x31e597['uniqueid'],!![]);}else{this[_0x1afc('0x4f')](_0x31e597['uniqueid'],![],this[_0x1afc('0xc')][_0x31e597[_0x1afc('0x20')]][_0x1afc('0x50')]?_0x1afc('0x51')+this[_0x1afc('0xc')][_0x31e597[_0x1afc('0x20')]][_0x1afc('0x50')]:_0x1afc('0x52'));}}}};Fax[_0x1afc('0x1d')]['send']=function(_0x35aaea){var _0x29ecdc=this;return new BPromise(function(_0x2c14ac,_0x553338){_0x29ecdc[_0x1afc('0x53')](_0x35aaea,_0x29ecdc['faxAccounts'][_0x35aaea['FaxAccountId']])[_0x1afc('0x36')](function(_0x1bf40c){ut[_0x1afc('0x45')]('[Fax][execOriginate][success]',_0x1bf40c);_0x2c14ac(ut['message']('Fax\x20received'));})[_0x1afc('0x3a')](function(_0x36cf82){ut[_0x1afc('0x45')](_0x1afc('0x54'),_0x36cf82);updateStatus(_0x35aaea);_0x553338(ut[_0x1afc('0x33')](_0x1afc('0x55')));});});};Fax[_0x1afc('0x1d')][_0x1afc('0x56')]=function(_0x4dc7ce){var _0x512533=this;return new BPromise(function(_0x1ea9e7,_0xbfb32){var _0x78173c=_0x512533[_0x1afc('0x57')](_0x512533[_0x1afc('0xd')][_0x4dc7ce[_0x1afc('0x58')]][_0x1afc('0x59')],_0x4dc7ce);if(_0x78173c['isValid']){_0x1ea9e7(ut[_0x1afc('0x33')](_0x1afc('0x5a')));}else{_0xbfb32(ut[_0x1afc('0x33')](_0x78173c['message']));}});};function originate(_0x46d14b,_0x1e57cb,_0xdc5c24){return new BPromise(function(_0x4047b5,_0x59e5d2){if(_0xdc5c24){var _0x404f72=util[_0x1afc('0x5b')]('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['parse'](_0x46d14b[_0x1afc('0x3')])[_0x1afc('0x22')],_0x46d14b[_0x1afc('0x3')]);gs['execute'](_0x404f72)[_0x1afc('0x36')](function(){_0x46d14b['path']=util[_0x1afc('0x5b')](_0x1afc('0x5c'),path[_0x1afc('0x38')](_0x46d14b['path'])[_0x1afc('0x5d')],path[_0x1afc('0x38')](_0x46d14b[_0x1afc('0x3')])[_0x1afc('0x22')]);_0x1e57cb[_0x1afc('0x5e')]=_0x46d14b[_0x1afc('0x3')];ut[_0x1afc('0x45')](_0x1afc('0x5f'),'');ami['Action'](ut[_0x1afc('0x60')](_0x46d14b,_0x1e57cb))[_0x1afc('0x36')](function(_0x6ec45d){_0x4047b5(_0x6ec45d);})['catch'](function(_0x5adc82){_0x59e5d2(_0x5adc82);});})[_0x1afc('0x3a')](function(_0x2ed0d3){_0x59e5d2(_0x2ed0d3);});}else{ami[_0x1afc('0x61')](ut['variablesAction'](_0x46d14b,_0x1e57cb))[_0x1afc('0x36')](function(_0x357c67){_0x4047b5(_0x357c67);})[_0x1afc('0x3a')](function(_0x567bf5){_0x59e5d2(_0x567bf5);});}});}Fax['prototype']['execOriginate']=function(_0x56f25c,_0x364ad3){var _0x3f74e3=this;return new BPromise(function(_0x20624e,_0x46d3f1){var _0x5e07c4=uuid['v4']();var _0x5833dd=ut[_0x1afc('0x62')](_0x56f25c,_0x364ad3);_0x3f74e3['actions'][_0x5e07c4]=new Action(_0x5e07c4,_0x364ad3,_0x56f25c);var _0x11ee0b=_0x3f74e3[_0x1afc('0xf')][_0x5e07c4];if(path[_0x1afc('0x38')](_0x56f25c['path'])[_0x1afc('0x63')]===_0x1afc('0x39')){originate(_0x11ee0b,_0x5833dd,!![])[_0x1afc('0x36')](function(_0x4a454a){_0x20624e(_0x4a454a);})[_0x1afc('0x3a')](function(_0x3ea621){_0x46d3f1(_0x3ea621);});}else{originate(_0x11ee0b,_0x5833dd,![])[_0x1afc('0x36')](function(_0x1d828d){_0x20624e(_0x1d828d);})[_0x1afc('0x3a')](function(_0x4f44d3){_0x46d3f1(_0x4f44d3);});}});};Fax['prototype']['isTrunkReachable']=function(_0xa4b71b){return!_[_0x1afc('0x64')](_0xa4b71b)&&!_['isNil'](_0xa4b71b[_0x1afc('0x22')])&&!_[_0x1afc('0x64')](_0xa4b71b['active'])&&_0xa4b71b[_0x1afc('0x65')]&&!_[_0x1afc('0x64')](this[_0x1afc('0xe')][util[_0x1afc('0x5b')]('SIP/%s',_0xa4b71b[_0x1afc('0x22')])])&&!_[_0x1afc('0x64')](this[_0x1afc('0xe')][util[_0x1afc('0x5b')](_0x1afc('0x66'),_0xa4b71b[_0x1afc('0x22')])][_0x1afc('0x29')])&&(this[_0x1afc('0xe')][util[_0x1afc('0x5b')](_0x1afc('0x66'),_0xa4b71b['name'])][_0x1afc('0x29')]===_0x1afc('0x67')||this[_0x1afc('0xe')][util[_0x1afc('0x5b')](_0x1afc('0x66'),_0xa4b71b[_0x1afc('0x22')])][_0x1afc('0x29')]===_0x1afc('0x68'));};Fax[_0x1afc('0x1d')]['checkTrunk']=function(_0x1e636e,_0x58e198){if(!this[_0x1afc('0x69')](_0x1e636e)){ut[_0x1afc('0x45')](_0x1afc('0x6a'),_['isNil'](_0x1e636e)?'':_0x1e636e[_0x1afc('0x22')]+_0x1afc('0x6b'));return{'isValid':![],'message':_0x1afc('0x6c')};}if(_[_0x1afc('0x64')](_0x58e198[_0x1afc('0x37')])){ut[_0x1afc('0x45')](_0x1afc('0x6d'),JSON[_0x1afc('0x3c')](_0x58e198));return{'isValid':![],'message':_0x1afc('0x6e')};}if(_[_0x1afc('0x64')](_0x58e198[_0x1afc('0x3')])){ut[_0x1afc('0x45')](_0x1afc('0x6f'),JSON['stringify'](_0x58e198));return{'isValid':![],'message':_0x1afc('0x70')};}return{'isValid':!![],'message':_0x1afc('0x71')};};module[_0x1afc('0x72')]=Fax; \ No newline at end of file +var _0x6d9f=['[Fax][Message][Updated]','[Fax][Message][NoUpdate1]','[Fax][Message][NoUpdate2]','\x20hangup\x20faxRiceive\x20','faxpages','faxstatus','updateStatus','faxstatusstring','SENDING\x20FAILED:\x20','SENDING\x20FAILED','send','execOriginate','[Fax][execOriginate][success]','Fax\x20received','[Fax][execOriginate][failure]','message','Fax\x20failed','checkAfterSend','checkTrunk','Trunk','isValid','Trunk\x20Reachable','execute','format','%s/%s.tif','XMF-PATH','Action','variablesAction','isTrunkReachable','isNil','SIP/%s','reachable','unmonitored','[Fax][checkTrunk][Trunk\x20not\x20work]','\x20Trunk\x20is\x20not\x20active','Trunk\x20not\x20working','[Fax][checkTrunk][Empty\x20Fax]','Empty\x20Fax','Empty\x20path','Is\x20Valid','exports','util','lodash','uuid','moment','path','tiff2pdf','./util/gs','../ami','./rpcDb','./channel','./util/util','../rpc/faxAccount','../rpc/faxMessage','faxAccounts','trunks','actions','newchannel','varset','syncVarSet','bind','syncNewState','newexten','syncNewExten','syncFaxStatus','receivefax','syncReceiveFax','syncHangup','originateresponse','syncOriginateResponse','prototype','syncNewchannel','context','from-voip-provider','exten','channels','uniqueid','channel','name','info','\x20syncNewchannel\x20','variable','hasOwnProperty','channelstate','channelstatedesc','value','operation','status','localstationid','filename','\x20syncFaxStatus\x20','remotestationid','pagestransferred','resolution','transferrate','calleridnum','\x20result\x20conversion\x20file\x20','create','parse','.pdf','application/pdf','then','error','stringify','catch','\x20receiveFax\x20','response','reason','AttachmentId','update','SENDING\x20FAILED\x20','logger','[Fax][Message][Error][Updated]','[Fax][Message][Error][NoUpdate1]'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x6d9f,0x17f));var _0xf6d9=function(_0x38e66e,_0x9b22cc){_0x38e66e=_0x38e66e-0x0;var _0x400952=_0x6d9f[_0x38e66e];return _0x400952;};'use strict';var util=require(_0xf6d9('0x0'));var _=require(_0xf6d9('0x1'));var BPromise=require('bluebird');var uuid=require(_0xf6d9('0x2'));var moment=require(_0xf6d9('0x3'));var path=require(_0xf6d9('0x4'));var tiff2pdf=require(_0xf6d9('0x5'));var gs=require(_0xf6d9('0x6'));var logger=require('../../../config/logger')('fax');var ami=require(_0xf6d9('0x7'));var rpcDb=require(_0xf6d9('0x8'));var Channel=require(_0xf6d9('0x9'));var ut=require(_0xf6d9('0xa'));var Action=require('./action');var faxAccount=require(_0xf6d9('0xb'));var attachment=require('../rpc/attachment');var faxMessage=require(_0xf6d9('0xc'));function Fax(_0x573f4c){this['channels']={};this['faxAccounts']=_0x573f4c[_0xf6d9('0xd')];this['trunks']=_0x573f4c[_0xf6d9('0xe')];this[_0xf6d9('0xf')]={};ami['on'](_0xf6d9('0x10'),this['syncNewchannel']['bind'](this));ami['on'](_0xf6d9('0x11'),this[_0xf6d9('0x12')][_0xf6d9('0x13')](this));ami['on']('newstate',this[_0xf6d9('0x14')][_0xf6d9('0x13')](this));ami['on'](_0xf6d9('0x15'),this[_0xf6d9('0x16')][_0xf6d9('0x13')](this));ami['on']('faxstatus',this[_0xf6d9('0x17')][_0xf6d9('0x13')](this));ami['on'](_0xf6d9('0x18'),this[_0xf6d9('0x19')]['bind'](this));ami['on']('hangup',this[_0xf6d9('0x1a')][_0xf6d9('0x13')](this));ami['on'](_0xf6d9('0x1b'),this[_0xf6d9('0x1c')][_0xf6d9('0x13')](this));}Fax[_0xf6d9('0x1d')][_0xf6d9('0x1e')]=function(_0x4e28ce){if(_0x4e28ce[_0xf6d9('0x1f')]===_0xf6d9('0x20')){for(var _0x2b3285 in this[_0xf6d9('0xd')]){if(this[_0xf6d9('0xd')]['hasOwnProperty'](_0x2b3285)){if(_0x4e28ce[_0xf6d9('0x21')]===this[_0xf6d9('0xd')][_0x2b3285]['localstationid']){this[_0xf6d9('0x22')][_0x4e28ce[_0xf6d9('0x23')]]={};this[_0xf6d9('0x22')][_0x4e28ce[_0xf6d9('0x23')]][_0xf6d9('0x24')]=_0x4e28ce[_0xf6d9('0x24')];this[_0xf6d9('0x22')][_0x4e28ce[_0xf6d9('0x23')]]['id']=this['faxAccounts'][_0x2b3285]['id'];this[_0xf6d9('0x22')][_0x4e28ce['uniqueid']]['name']=this[_0xf6d9('0xd')][_0x2b3285][_0xf6d9('0x25')];logger[_0xf6d9('0x26')](_0x4e28ce[_0xf6d9('0x23')],_0xf6d9('0x27'));}}}}if(this[_0xf6d9('0xf')][_0x4e28ce['uniqueid']]){this[_0xf6d9('0x22')][_0x4e28ce[_0xf6d9('0x23')]]={};this[_0xf6d9('0x22')][_0x4e28ce[_0xf6d9('0x23')]][_0xf6d9('0x24')]=_0x4e28ce['channel'];logger[_0xf6d9('0x26')](_0x4e28ce[_0xf6d9('0x23')],_0xf6d9('0x27'));}};Fax[_0xf6d9('0x1d')][_0xf6d9('0x12')]=function(_0x4fee25){if(this[_0xf6d9('0x22')][_0x4fee25[_0xf6d9('0x23')]]){for(var _0x69d5d in _0x4fee25[_0xf6d9('0x28')]){if(_0x4fee25[_0xf6d9('0x28')][_0xf6d9('0x29')](_0x69d5d)){this[_0xf6d9('0x22')][_0x4fee25[_0xf6d9('0x23')]][_0x69d5d]=_0x4fee25['value'];}}}};Fax['prototype']['syncNewState']=function(_0x5b7833){if(this['channels'][_0x5b7833[_0xf6d9('0x23')]]){this[_0xf6d9('0x22')][_0x5b7833['uniqueid']]['channelstate']=_0x5b7833[_0xf6d9('0x2a')];this[_0xf6d9('0x22')][_0x5b7833['uniqueid']][_0xf6d9('0x2b')]=_0x5b7833[_0xf6d9('0x2b')];}};Fax['prototype']['syncNewExten']=function(_0x4d9ecb){if(this[_0xf6d9('0x22')][_0x4d9ecb[_0xf6d9('0x23')]]){for(var _0x1ff8d1 in _0x4d9ecb[_0xf6d9('0x28')]){if(_0x4d9ecb[_0xf6d9('0x28')]['hasOwnProperty'](_0x1ff8d1)){this[_0xf6d9('0x22')][_0x4d9ecb[_0xf6d9('0x23')]][_0x1ff8d1]=_0x4d9ecb[_0xf6d9('0x2c')];}}}};Fax[_0xf6d9('0x1d')][_0xf6d9('0x17')]=function(_0x6e4ad3){if(this[_0xf6d9('0x22')][_0x6e4ad3['uniqueid']]){this[_0xf6d9('0x22')][_0x6e4ad3[_0xf6d9('0x23')]]['operation']=_0x6e4ad3[_0xf6d9('0x2d')];this[_0xf6d9('0x22')][_0x6e4ad3['uniqueid']][_0xf6d9('0x2e')]=_0x6e4ad3['status'];this[_0xf6d9('0x22')][_0x6e4ad3[_0xf6d9('0x23')]][_0xf6d9('0x2f')]=_0x6e4ad3[_0xf6d9('0x2f')];this[_0xf6d9('0x22')][_0x6e4ad3[_0xf6d9('0x23')]][_0xf6d9('0x30')]=_0x6e4ad3['filename'];logger[_0xf6d9('0x26')](_0x6e4ad3[_0xf6d9('0x23')],_0xf6d9('0x31'));}};Fax['prototype']['syncReceiveFax']=function(_0x1dafa5){var _0x45a9a4=this;if(this[_0xf6d9('0x22')][_0x1dafa5[_0xf6d9('0x23')]]){var _0x98d4cd=this['channels'][_0x1dafa5[_0xf6d9('0x23')]]['id'];this[_0xf6d9('0x22')][_0x1dafa5[_0xf6d9('0x23')]][_0xf6d9('0x32')]=_0x1dafa5[_0xf6d9('0x32')];this[_0xf6d9('0x22')][_0x1dafa5[_0xf6d9('0x23')]][_0xf6d9('0x33')]=_0x1dafa5[_0xf6d9('0x33')];this['channels'][_0x1dafa5[_0xf6d9('0x23')]][_0xf6d9('0x2f')]=_0x1dafa5[_0xf6d9('0x2f')];this['channels'][_0x1dafa5[_0xf6d9('0x23')]][_0xf6d9('0x34')]=_0x1dafa5[_0xf6d9('0x34')];this[_0xf6d9('0x22')][_0x1dafa5[_0xf6d9('0x23')]][_0xf6d9('0x35')]=_0x1dafa5[_0xf6d9('0x35')];this['channels'][_0x1dafa5[_0xf6d9('0x23')]]['filename']=_0x1dafa5[_0xf6d9('0x30')];this[_0xf6d9('0x22')][_0x1dafa5[_0xf6d9('0x23')]][_0xf6d9('0x36')]=_0x1dafa5[_0xf6d9('0x36')];if(this['channels'][_0x1dafa5[_0xf6d9('0x23')]][_0xf6d9('0x33')]>0x0){tiff2pdf(_0x1dafa5[_0xf6d9('0x30')],'/var/opt/motion2/server/files/attachments/',function(_0x3e1b89){logger[_0xf6d9('0x26')](_0x1dafa5['uniqueid'],_0xf6d9('0x37'),_0x3e1b89['message']);attachment[_0xf6d9('0x38')]({'name':path[_0xf6d9('0x39')](_0x1dafa5[_0xf6d9('0x30')])[_0xf6d9('0x25')],'basename':path[_0xf6d9('0x39')](_0x1dafa5[_0xf6d9('0x30')])[_0xf6d9('0x25')]+_0xf6d9('0x3a'),'type':_0xf6d9('0x3b')})[_0xf6d9('0x3c')](function(_0x448d66){faxAccount['notify'](_0x98d4cd,{'from':_0x1dafa5[_0xf6d9('0x36')],'mapKey':'fax','body':path[_0xf6d9('0x39')](_0x1dafa5[_0xf6d9('0x30')])[_0xf6d9('0x25')]+_0xf6d9('0x3a'),'AttachmentId':_0x448d66['id']})['catch'](function(_0x579d44){logger[_0xf6d9('0x3d')](_0x1dafa5[_0xf6d9('0x23')],'\x20notify\x20',JSON[_0xf6d9('0x3e')](_0x579d44));});})[_0xf6d9('0x3f')](function(_0x995be1){logger[_0xf6d9('0x3d')](_0x1dafa5['uniqueid'],_0xf6d9('0x40'),JSON[_0xf6d9('0x3e')](_0x995be1));});});}logger[_0xf6d9('0x26')](_0x1dafa5[_0xf6d9('0x23')],_0xf6d9('0x40'));}};Fax[_0xf6d9('0x1d')][_0xf6d9('0x1c')]=function(_0x17d52e){if(this[_0xf6d9('0xf')][_0x17d52e[_0xf6d9('0x23')]]){_['merge'](this[_0xf6d9('0x22')][_0x17d52e['uniqueid']],_['pick'](_0x17d52e,[_0xf6d9('0x41'),_0xf6d9('0x42')]));}};function updateStatus(_0x4945e6){if(_0x4945e6[_0xf6d9('0x43')]){faxMessage[_0xf6d9('0x44')](_0x4945e6['AttachmentId'],{'failMessage':_0xf6d9('0x45')})[_0xf6d9('0x3c')](function(_0x15bfbe){ut[_0xf6d9('0x46')](_0xf6d9('0x47'),_0x15bfbe);})['catch'](function(_0x8b2def){ut[_0xf6d9('0x46')](_0xf6d9('0x48'),_0x8b2def);});}else{ut[_0xf6d9('0x46')]('[Fax][Message][Error][NoUpdate2]');}}Fax[_0xf6d9('0x1d')]['updateStatus']=function(_0x583f0d,_0x5af0aa,_0x314e53){var _0x30aea0=this;var _0x7ddcb5={};if(_0x5af0aa){_0x7ddcb5={'read':_0x5af0aa};}else{_0x7ddcb5={'failMessage':_0x314e53};}if(this['actions'][_0x583f0d][_0xf6d9('0x43')]){faxMessage['update'](this[_0xf6d9('0xf')][_0x583f0d][_0xf6d9('0x43')],_0x7ddcb5)[_0xf6d9('0x3c')](function(_0xf3489f){ut[_0xf6d9('0x46')](_0xf6d9('0x49'),_0xf3489f);})[_0xf6d9('0x3f')](function(_0x4ac5b7){ut['logger'](_0xf6d9('0x4a'),_0x4ac5b7);})['finally'](function(){delete _0x30aea0[_0xf6d9('0x22')][_0x583f0d];delete _0x30aea0[_0xf6d9('0xf')][_0x583f0d];});}else{ut[_0xf6d9('0x46')](_0xf6d9('0x4b'));delete this['channels'][_0x583f0d];delete this[_0xf6d9('0xf')][_0x583f0d];}};Fax[_0xf6d9('0x1d')][_0xf6d9('0x1a')]=function(_0x40e49e){var _0x14c547=this;if(this[_0xf6d9('0x22')][_0x40e49e['uniqueid']]){if(this['actions'][_0x40e49e[_0xf6d9('0x23')]]){this[_0xf6d9('0x22')][_0x40e49e['uniqueid']]['id']=this[_0xf6d9('0xf')][_0x40e49e[_0xf6d9('0x23')]]['id'];this[_0xf6d9('0x22')][_0x40e49e[_0xf6d9('0x23')]]['name']=this[_0xf6d9('0xf')][_0x40e49e[_0xf6d9('0x23')]][_0xf6d9('0x25')];}logger[_0xf6d9('0x26')](_0x40e49e[_0xf6d9('0x23')],this[_0xf6d9('0xf')][_0x40e49e['uniqueid']]?'\x20hangup\x20sendFile\x20':_0xf6d9('0x4c'),JSON[_0xf6d9('0x3e')](this[_0xf6d9('0x22')][_0x40e49e[_0xf6d9('0x23')]]));if(this[_0xf6d9('0xf')][_0x40e49e[_0xf6d9('0x23')]]){if(this[_0xf6d9('0x22')][_0x40e49e[_0xf6d9('0x23')]][_0xf6d9('0x4d')]>0x0&&this['channels'][_0x40e49e[_0xf6d9('0x23')]][_0xf6d9('0x4e')]==='SUCCESS'){this[_0xf6d9('0x4f')](_0x40e49e['uniqueid'],!![]);}else{this[_0xf6d9('0x4f')](_0x40e49e[_0xf6d9('0x23')],![],this[_0xf6d9('0x22')][_0x40e49e[_0xf6d9('0x23')]][_0xf6d9('0x50')]?_0xf6d9('0x51')+this[_0xf6d9('0x22')][_0x40e49e[_0xf6d9('0x23')]][_0xf6d9('0x50')]:_0xf6d9('0x52'));}}}};Fax[_0xf6d9('0x1d')][_0xf6d9('0x53')]=function(_0x10f80b){var _0x77ba88=this;return new BPromise(function(_0x1c0011,_0x2d9c17){_0x77ba88[_0xf6d9('0x54')](_0x10f80b,_0x77ba88[_0xf6d9('0xd')][_0x10f80b['FaxAccountId']])[_0xf6d9('0x3c')](function(_0x53292c){ut[_0xf6d9('0x46')](_0xf6d9('0x55'),_0x53292c);_0x1c0011(ut['message'](_0xf6d9('0x56')));})[_0xf6d9('0x3f')](function(_0x225d14){ut[_0xf6d9('0x46')](_0xf6d9('0x57'),_0x225d14);updateStatus(_0x10f80b);_0x2d9c17(ut[_0xf6d9('0x58')](_0xf6d9('0x59')));});});};Fax[_0xf6d9('0x1d')][_0xf6d9('0x5a')]=function(_0x25b22d){var _0x23fbb0=this;return new BPromise(function(_0x5c5764,_0x3f0b23){var _0x1e61cf=_0x23fbb0[_0xf6d9('0x5b')](_0x23fbb0[_0xf6d9('0xd')][_0x25b22d['FaxAccountId']][_0xf6d9('0x5c')],_0x25b22d);if(_0x1e61cf[_0xf6d9('0x5d')]){_0x5c5764(ut['message'](_0xf6d9('0x5e')));}else{_0x3f0b23(ut[_0xf6d9('0x58')](_0x1e61cf[_0xf6d9('0x58')]));}});};function originate(_0x56a192,_0x3a62ff,_0x27f865){return new BPromise(function(_0x519a95,_0x45212e){if(_0x27f865){var _0x161474=util['format']('gs\x20-q\x20-dNOPAUSE\x20-dBATCH\x20-sDEVICE=tiffg4\x20-sPAPERSIZE=letter\x20-sOutputFile=/var/opt/motion2/server/files/attachments/%s.tif\x20\x20%s\x20-c\x20quit',path[_0xf6d9('0x39')](_0x56a192['path'])[_0xf6d9('0x25')],_0x56a192[_0xf6d9('0x4')]);gs[_0xf6d9('0x5f')](_0x161474)[_0xf6d9('0x3c')](function(){_0x56a192[_0xf6d9('0x4')]=util[_0xf6d9('0x60')](_0xf6d9('0x61'),path[_0xf6d9('0x39')](_0x56a192['path'])['dir'],path['parse'](_0x56a192[_0xf6d9('0x4')])[_0xf6d9('0x25')]);_0x3a62ff[_0xf6d9('0x62')]=_0x56a192[_0xf6d9('0x4')];ut['logger']('Convert\x20pdf\x20to\x20tif','');ami[_0xf6d9('0x63')](ut['variablesAction'](_0x56a192,_0x3a62ff))[_0xf6d9('0x3c')](function(_0x20ad10){_0x519a95(_0x20ad10);})[_0xf6d9('0x3f')](function(_0x5a7cb8){_0x45212e(_0x5a7cb8);});})[_0xf6d9('0x3f')](function(_0x3a0173){_0x45212e(_0x3a0173);});}else{ami['Action'](ut[_0xf6d9('0x64')](_0x56a192,_0x3a62ff))[_0xf6d9('0x3c')](function(_0x1ccc6e){_0x519a95(_0x1ccc6e);})[_0xf6d9('0x3f')](function(_0x29ef98){_0x45212e(_0x29ef98);});}});}Fax[_0xf6d9('0x1d')][_0xf6d9('0x54')]=function(_0x4a6b96,_0x111e24){var _0x2ba41e=this;return new BPromise(function(_0x4bf0a4,_0x5c1096){var _0x2583fa=uuid['v4']();var _0x5042b6=ut['addVariables'](_0x4a6b96,_0x111e24);_0x2ba41e[_0xf6d9('0xf')][_0x2583fa]=new Action(_0x2583fa,_0x111e24,_0x4a6b96);var _0x332c9b=_0x2ba41e['actions'][_0x2583fa];if(path[_0xf6d9('0x39')](_0x4a6b96[_0xf6d9('0x4')])['ext']===_0xf6d9('0x3a')){originate(_0x332c9b,_0x5042b6,!![])['then'](function(_0x2cb5f5){_0x4bf0a4(_0x2cb5f5);})['catch'](function(_0x47e646){_0x5c1096(_0x47e646);});}else{originate(_0x332c9b,_0x5042b6,![])[_0xf6d9('0x3c')](function(_0xa6402e){_0x4bf0a4(_0xa6402e);})[_0xf6d9('0x3f')](function(_0x49b65b){_0x5c1096(_0x49b65b);});}});};Fax[_0xf6d9('0x1d')][_0xf6d9('0x65')]=function(_0x161b70){return!_[_0xf6d9('0x66')](_0x161b70)&&!_[_0xf6d9('0x66')](_0x161b70['name'])&&!_['isNil'](_0x161b70['active'])&&_0x161b70['active']&&!_[_0xf6d9('0x66')](this[_0xf6d9('0xe')][util[_0xf6d9('0x60')](_0xf6d9('0x67'),_0x161b70[_0xf6d9('0x25')])])&&!_['isNil'](this[_0xf6d9('0xe')][util[_0xf6d9('0x60')](_0xf6d9('0x67'),_0x161b70[_0xf6d9('0x25')])][_0xf6d9('0x2e')])&&(this[_0xf6d9('0xe')][util['format'](_0xf6d9('0x67'),_0x161b70['name'])][_0xf6d9('0x2e')]===_0xf6d9('0x68')||this[_0xf6d9('0xe')][util[_0xf6d9('0x60')]('SIP/%s',_0x161b70[_0xf6d9('0x25')])]['status']===_0xf6d9('0x69'));};Fax[_0xf6d9('0x1d')][_0xf6d9('0x5b')]=function(_0x5925ff,_0x3cf807){if(!this[_0xf6d9('0x65')](_0x5925ff)){ut['logger'](_0xf6d9('0x6a'),_[_0xf6d9('0x66')](_0x5925ff)?'':_0x5925ff['name']+_0xf6d9('0x6b'));return{'isValid':![],'message':_0xf6d9('0x6c')};}if(_['isNil'](_0x3cf807['fax'])){ut[_0xf6d9('0x46')](_0xf6d9('0x6d'),JSON[_0xf6d9('0x3e')](_0x3cf807));return{'isValid':![],'message':_0xf6d9('0x6e')};}if(_['isNil'](_0x3cf807['path'])){ut['logger']('[Fax][checkTrunk][Empty\x20path]',JSON[_0xf6d9('0x3e')](_0x3cf807));return{'isValid':![],'message':_0xf6d9('0x6f')};}return{'isValid':!![],'message':_0xf6d9('0x70')};};module[_0xf6d9('0x71')]=Fax; \ No newline at end of file diff --git a/server/services/ami/fax/rpcDb.js b/server/services/ami/fax/rpcDb.js index 6593e8f..0b6e2fb 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 _0xea80=['util','bluebird','../../../config/logger','lodash','../rpc/faxAccount','inspect','resolve','then','notify','catch','[Notify]\x20'];(function(_0x4ebddb,_0x5cd1d4){var _0xbd90d5=function(_0x6eea9b){while(--_0x6eea9b){_0x4ebddb['push'](_0x4ebddb['shift']());}};_0xbd90d5(++_0x5cd1d4);}(_0xea80,0x8f));var _0x0ea8=function(_0x210f4c,_0x305f73){_0x210f4c=_0x210f4c-0x0;var _0x5c6c9c=_0xea80[_0x210f4c];return _0x5c6c9c;};'use strict';var util=require(_0x0ea8('0x0'));var BPromise=require(_0x0ea8('0x1'));var logger=require(_0x0ea8('0x2'))('preview');var _=require(_0x0ea8('0x3'));var faxAccount=require(_0x0ea8('0x4'));function loggerCatch(_0x45625){return function(_0x1607ed){logger['error'](_0x45625,util[_0x0ea8('0x5')](_0x1607ed,{'showHidden':![],'depth':null}));};}exports['notify']=function(_0xdaa322,_0x515d56){return BPromise[_0x0ea8('0x6')]()[_0x0ea8('0x7')](faxAccount[_0x0ea8('0x8')](_0xdaa322,_0x515d56))[_0x0ea8('0x9')](loggerCatch(_0x0ea8('0xa')));}; \ No newline at end of file +var _0xc35c=['error','notify','resolve','then','[Notify]\x20','util','bluebird','../../../config/logger','preview','lodash'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0xc35c,0x1e5));var _0xcc35=function(_0x26554b,_0x5ee51d){_0x26554b=_0x26554b-0x0;var _0x17d280=_0xc35c[_0x26554b];return _0x17d280;};'use strict';var util=require(_0xcc35('0x0'));var BPromise=require(_0xcc35('0x1'));var logger=require(_0xcc35('0x2'))(_0xcc35('0x3'));var _=require(_0xcc35('0x4'));var faxAccount=require('../rpc/faxAccount');function loggerCatch(_0x32da29){return function(_0x14eafc){logger[_0xcc35('0x5')](_0x32da29,util['inspect'](_0x14eafc,{'showHidden':![],'depth':null}));};}exports[_0xcc35('0x6')]=function(_0x3fc4ed,_0x14c8f9){return BPromise[_0xcc35('0x7')]()[_0xcc35('0x8')](faxAccount['notify'](_0x3fc4ed,_0x14c8f9))['catch'](loggerCatch(_0xcc35('0x9')));}; \ No newline at end of file diff --git a/server/services/ami/fax/util/gs.js b/server/services/ami/fax/util/gs.js index f2e7fe0..e606afc 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 _0x1cd1=['child_process','exec','execute','Exec\x20gs','info','inspect','util','../../../../config/logger','fax','bluebird'];(function(_0x25e00c,_0x457c43){var _0xed6d40=function(_0x31deec){while(--_0x31deec){_0x25e00c['push'](_0x25e00c['shift']());}};_0xed6d40(++_0x457c43);}(_0x1cd1,0x1f0));var _0x11cd=function(_0x330f7c,_0x4e42ad){_0x330f7c=_0x330f7c-0x0;var _0x1a1b3c=_0x1cd1[_0x330f7c];return _0x1a1b3c;};'use strict';var util=require(_0x11cd('0x0'));var logger=require(_0x11cd('0x1'))(_0x11cd('0x2'));var BPromise=require(_0x11cd('0x3'));var exec=require(_0x11cd('0x4'))[_0x11cd('0x5')];exports[_0x11cd('0x6')]=function(_0xfe704f){return new BPromise(function(_0x3a18a9,_0x46997e){exec(_0xfe704f,function(_0xf91ae5,_0x48a30a,_0x5d338f){logger['info'](_0x11cd('0x7'),_0x48a30a);if(_0xf91ae5){logger[_0x11cd('0x8')](_0x11cd('0x7'),'\x20Error\x20:',util[_0x11cd('0x9')](_0xf91ae5,{'showHidden':![],'depth':null}),_0x48a30a,_0x5d338f);_0x46997e(_0xf91ae5);}_0x3a18a9(_0x48a30a);});});}; \ No newline at end of file +var _0xda67=['fax','bluebird','child_process','execute','info','Exec\x20gs','\x20Error\x20:'];(function(_0x568e40,_0x3bf4f8){var _0x7d0798=function(_0x1efb7f){while(--_0x1efb7f){_0x568e40['push'](_0x568e40['shift']());}};_0x7d0798(++_0x3bf4f8);}(_0xda67,0x1ce));var _0x7da6=function(_0x1cbac4,_0x28eecb){_0x1cbac4=_0x1cbac4-0x0;var _0x4f14d1=_0xda67[_0x1cbac4];return _0x4f14d1;};'use strict';var util=require('util');var logger=require('../../../../config/logger')(_0x7da6('0x0'));var BPromise=require(_0x7da6('0x1'));var exec=require(_0x7da6('0x2'))['exec'];exports[_0x7da6('0x3')]=function(_0x27cc2a){return new BPromise(function(_0x36d7fb,_0x54a0a9){exec(_0x27cc2a,function(_0x4c6e39,_0x44fec3,_0x1f4037){logger[_0x7da6('0x4')](_0x7da6('0x5'),_0x44fec3);if(_0x4c6e39){logger['info'](_0x7da6('0x5'),_0x7da6('0x6'),util['inspect'](_0x4c6e39,{'showHidden':![],'depth':null}),_0x44fec3,_0x1f4037);_0x54a0a9(_0x4c6e39);}_0x36d7fb(_0x44fec3);});});}; \ 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 c4a9177..804346a 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 _0xc36d=['message','logger','info','inspect','addVariables','ecm','headerinfo','minrate','maxrate','\x22%s\x22','modem','faxdetect','t38timeout','localstationid','variablesAction','originate','channel','xcally-motion-fax','from-sip','\x22%s\x22\x20<%s>','uniqueid','util','lodash','moment','../../../../config/logger','fax'];(function(_0x226d65,_0x1e3a8e){var _0x4d2eb3=function(_0x592bfd){while(--_0x592bfd){_0x226d65['push'](_0x226d65['shift']());}};_0x4d2eb3(++_0x1e3a8e);}(_0xc36d,0x7d));var _0xdc36=function(_0x4e90e3,_0x570a1d){_0x4e90e3=_0x4e90e3-0x0;var _0x295e5b=_0xc36d[_0x4e90e3];return _0x295e5b;};'use strict';var util=require(_0xdc36('0x0'));var _=require(_0xdc36('0x1'));var moment=require(_0xdc36('0x2'));var logger=require(_0xdc36('0x3'))(_0xdc36('0x4'));exports[_0xdc36('0x5')]=function(_0x4c42dd){return{'message':_0x4c42dd};};exports[_0xdc36('0x6')]=function(_0x3431f9,_0x53ac17){logger[_0xdc36('0x7')](_0x3431f9,util[_0xdc36('0x8')](_0x53ac17,{'showHidden':![],'depth':null}));};exports[_0xdc36('0x9')]=function(_0x11ad3b,_0x6e4753){var _0x571311={'XMF-ECM':_0x6e4753[_0xdc36('0xa')],'XMF-HEADERINFO':_0x6e4753[_0xdc36('0xb')],'XMF-MINRATE':_0x6e4753[_0xdc36('0xc')],'XMF-MAXRATE':_0x6e4753[_0xdc36('0xd')],'XMF-MODEM':util['format'](_0xdc36('0xe'),_0x6e4753[_0xdc36('0xf')]),'XMF-GATEWAY':_0x6e4753['gateway'],'XMF-FAXDETECT':_0x6e4753[_0xdc36('0x10')],'XMF-T38TIMEOUT':_0x6e4753[_0xdc36('0x11')],'XMF-LOCALSTATIONID':_0x6e4753[_0xdc36('0x12')],'XMF-PATH':_0x11ad3b['path']};return _0x571311;};exports[_0xdc36('0x13')]=function(_0x18707d,_0x4fda43){return{'actionid':_0x18707d['uniqueid'],'action':_0xdc36('0x14'),'channel':_0x18707d[_0xdc36('0x15')],'Exten':_0xdc36('0x16'),'Context':_0xdc36('0x17'),'Priority':'1','callerid':util['format'](_0xdc36('0x18'),_0x18707d[_0xdc36('0xb')]?_0x18707d[_0xdc36('0xb')]:'',_0x18707d[_0xdc36('0x12')]),'variable':_0x4fda43,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x18707d[_0xdc36('0x19')]};}; \ No newline at end of file +var _0xc793=['\x22%s\x22','modem','gateway','faxdetect','t38timeout','localstationid','variablesAction','uniqueid','originate','channel','xcally-motion-fax','from-sip','util','lodash','moment','../../../../config/logger','fax','message','logger','info','inspect','addVariables','ecm','headerinfo','minrate','maxrate','format'];(function(_0x133fe4,_0x1f473b){var _0x4c4017=function(_0x3c1fb1){while(--_0x3c1fb1){_0x133fe4['push'](_0x133fe4['shift']());}};_0x4c4017(++_0x1f473b);}(_0xc793,0x16b));var _0x3c79=function(_0x58410c,_0x43b817){_0x58410c=_0x58410c-0x0;var _0x5d8306=_0xc793[_0x58410c];return _0x5d8306;};'use strict';var util=require(_0x3c79('0x0'));var _=require(_0x3c79('0x1'));var moment=require(_0x3c79('0x2'));var logger=require(_0x3c79('0x3'))(_0x3c79('0x4'));exports[_0x3c79('0x5')]=function(_0x10d309){return{'message':_0x10d309};};exports[_0x3c79('0x6')]=function(_0x3d7a13,_0x1bfa4d){logger[_0x3c79('0x7')](_0x3d7a13,util[_0x3c79('0x8')](_0x1bfa4d,{'showHidden':![],'depth':null}));};exports[_0x3c79('0x9')]=function(_0x4a370a,_0x5dd1a2){var _0x12ef36={'XMF-ECM':_0x5dd1a2[_0x3c79('0xa')],'XMF-HEADERINFO':_0x5dd1a2[_0x3c79('0xb')],'XMF-MINRATE':_0x5dd1a2[_0x3c79('0xc')],'XMF-MAXRATE':_0x5dd1a2[_0x3c79('0xd')],'XMF-MODEM':util[_0x3c79('0xe')](_0x3c79('0xf'),_0x5dd1a2[_0x3c79('0x10')]),'XMF-GATEWAY':_0x5dd1a2[_0x3c79('0x11')],'XMF-FAXDETECT':_0x5dd1a2[_0x3c79('0x12')],'XMF-T38TIMEOUT':_0x5dd1a2[_0x3c79('0x13')],'XMF-LOCALSTATIONID':_0x5dd1a2[_0x3c79('0x14')],'XMF-PATH':_0x4a370a['path']};return _0x12ef36;};exports[_0x3c79('0x15')]=function(_0x17e177,_0x163b04){return{'actionid':_0x17e177[_0x3c79('0x16')],'action':_0x3c79('0x17'),'channel':_0x17e177[_0x3c79('0x18')],'Exten':_0x3c79('0x19'),'Context':_0x3c79('0x1a'),'Priority':'1','callerid':util[_0x3c79('0xe')]('\x22%s\x22\x20<%s>',_0x17e177[_0x3c79('0xb')]?_0x17e177[_0x3c79('0xb')]:'',_0x17e177[_0x3c79('0x14')]),'variable':_0x163b04,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x17e177[_0x3c79('0x16')]};}; \ No newline at end of file diff --git a/server/services/ami/index.js b/server/services/ami/index.js index e0f61ab..d18bd70 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 _0xacaa=['./rpc/voiceCallReport','./rpc/trunk','./rpc/trigger','./rpc/template','./rpc/cmHopperHistory','./rpc/campaign','./rpc/voiceExtension','./rpc/faxAccount','./rpc/integrations/zendesk','./rpc/integrations/sugarcrm','./rpc/integrations/desk','./rpc/integrations/zoho','./rpc/integrations/servicenow','get','hour','then','getAgents','initAgents','initTelephones','getTrunks','initTrunks','getVoiceQueues','initVoiceQueues','getTriggers','getTemplates','initTemplates','getZendeskAccounts','initZendeskAccounts','initSalesforceAccounts','getSugarcrmAccounts','initSugarcrmAccounts','getFreshdeskAccounts','initFreshdeskAccounts','initDeskAccounts','initZohoAccounts','getVtigerAccounts','initVtigerAccounts','initServicenowAccounts','getDynamics365Accounts','initDynamics365Accounts','getCampaigns','initCampaigns','getVoiceExtensions','initVoiceExtensions','getFaxAccounts','initFaxAccounts','initVoiceQueueReports','initVoiceQueueHopperHistory','getCampaignHopperHistory','getVoiceCallReports','initVoiceCallReports','catch','log','listen','sync','bluebird','util','moment','./server','./realtime','./acw','./trigger','./dialer','./preview','./fax','./rpc/user','./rpc/voiceQueue','./rpc/voiceQueueReport'];(function(_0x32e109,_0x48938e){var _0x58bbc5=function(_0x421ff7){while(--_0x421ff7){_0x32e109['push'](_0x32e109['shift']());}};_0x58bbc5(++_0x48938e);}(_0xacaa,0x1cf));var _0xaaca=function(_0x383a55,_0x258e02){_0x383a55=_0x383a55-0x0;var _0x525c55=_0xacaa[_0x383a55];return _0x525c55;};'use strict';var BPromise=require(_0xaaca('0x0'));var util=require(_0xaaca('0x1'));var moment=require(_0xaaca('0x2'));var server=require(_0xaaca('0x3'));var Realtime=require(_0xaaca('0x4'));var Report=require('./report');var Acw=require(_0xaaca('0x5'));var Trigger=require(_0xaaca('0x6'));var Dialer=require(_0xaaca('0x7'));var Preview=require(_0xaaca('0x8'));var Fax=require(_0xaaca('0x9'));var user=require(_0xaaca('0xa'));var voiceQueue=require(_0xaaca('0xb'));var voiceQueueReport=require(_0xaaca('0xc'));var voiceCallReport=require(_0xaaca('0xd'));var trunk=require(_0xaaca('0xe'));var trigger=require(_0xaaca('0xf'));var template=require(_0xaaca('0x10'));var cmHopperHistory=require(_0xaaca('0x11'));var campaign=require(_0xaaca('0x12'));var voiceExtension=require(_0xaaca('0x13'));var faxAccount=require(_0xaaca('0x14'));var zendesk=require(_0xaaca('0x15'));var salesforce=require('./rpc/integrations/salesforce');var sugarcrm=require(_0xaaca('0x16'));var freshdesk=require('./rpc/integrations/freshdesk');var desk=require(_0xaaca('0x17'));var zoho=require(_0xaaca('0x18'));var vtiger=require('./rpc/integrations/vtiger');var freshsales=require('./rpc/integrations/freshsales');var servicenow=require(_0xaaca('0x19'));var dynamics365=require('./rpc/integrations/dynamics365');var realtime=new Realtime();var report=new Report(realtime);var acw=new Acw(realtime);var channelTrigger=new Trigger(realtime);var preview=new Preview(realtime);var dialer=new Dialer(realtime,preview);var fax=new Fax(realtime);var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()[_0xaaca('0x1a')](_0xaaca('0x1b'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()['get'](_0xaaca('0x1b'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return BPromise['resolve']()[_0xaaca('0x1c')](user[_0xaaca('0x1d')]())['then'](realtime[_0xaaca('0x1e')]())[_0xaaca('0x1c')](user['getTelephones']())[_0xaaca('0x1c')](realtime[_0xaaca('0x1f')]())[_0xaaca('0x1c')](trunk[_0xaaca('0x20')]())[_0xaaca('0x1c')](realtime[_0xaaca('0x21')]())[_0xaaca('0x1c')](voiceQueue[_0xaaca('0x22')]())[_0xaaca('0x1c')](realtime[_0xaaca('0x23')]())[_0xaaca('0x1c')](trigger[_0xaaca('0x24')]())[_0xaaca('0x1c')](realtime['initTriggers']())['then'](template[_0xaaca('0x25')]())['then'](realtime[_0xaaca('0x26')]())[_0xaaca('0x1c')](zendesk[_0xaaca('0x27')]())[_0xaaca('0x1c')](realtime[_0xaaca('0x28')]())[_0xaaca('0x1c')](salesforce['getSalesforceAccounts']())[_0xaaca('0x1c')](realtime[_0xaaca('0x29')]())[_0xaaca('0x1c')](sugarcrm[_0xaaca('0x2a')]())[_0xaaca('0x1c')](realtime[_0xaaca('0x2b')]())[_0xaaca('0x1c')](freshdesk[_0xaaca('0x2c')]())[_0xaaca('0x1c')](realtime[_0xaaca('0x2d')]())[_0xaaca('0x1c')](desk['getDeskAccounts']())[_0xaaca('0x1c')](realtime[_0xaaca('0x2e')]())[_0xaaca('0x1c')](zoho['getZohoAccounts']())[_0xaaca('0x1c')](realtime[_0xaaca('0x2f')]())[_0xaaca('0x1c')](vtiger[_0xaaca('0x30')]())[_0xaaca('0x1c')](realtime[_0xaaca('0x31')]())['then'](freshsales['getFreshsalesAccounts']())[_0xaaca('0x1c')](realtime['initFreshsalesAccounts']())[_0xaaca('0x1c')](servicenow['getServicenowAccounts']())['then'](realtime[_0xaaca('0x32')]())[_0xaaca('0x1c')](dynamics365[_0xaaca('0x33')]())['then'](realtime[_0xaaca('0x34')]())['then'](campaign[_0xaaca('0x35')]())['then'](realtime[_0xaaca('0x36')]())[_0xaaca('0x1c')](voiceExtension[_0xaaca('0x37')]())[_0xaaca('0x1c')](realtime[_0xaaca('0x38')]())[_0xaaca('0x1c')](faxAccount[_0xaaca('0x39')]())[_0xaaca('0x1c')](realtime[_0xaaca('0x3a')]())[_0xaaca('0x1c')](function(){return realtime;});}function initParams(){return BPromise['resolve']()[_0xaaca('0x1c')](voiceQueueReport['getVoiceQueueReports']())[_0xaaca('0x1c')](realtime[_0xaaca('0x3b')]())[_0xaaca('0x1c')](cmHopperHistory['getVoiceQueueHopperHistory']())[_0xaaca('0x1c')](realtime[_0xaaca('0x3c')]())[_0xaaca('0x1c')](cmHopperHistory[_0xaaca('0x3d')]())[_0xaaca('0x1c')](realtime['initCampaignHopperHistory']())[_0xaaca('0x1c')](voiceCallReport[_0xaaca('0x3e')]())[_0xaaca('0x1c')](realtime[_0xaaca('0x3f')]())[_0xaaca('0x1c')](function(_0x85d76e){})[_0xaaca('0x40')](function(_0x11d3b2){console[_0xaaca('0x41')](_0x11d3b2);});}function main(){return server[_0xaaca('0x42')](realtime,preview,fax)[_0xaaca('0x1c')](function(_0x2bd6e5){return initRealtime();})[_0xaaca('0x1c')](function(){return initParams();})[_0xaaca('0x1c')](function(){report[_0xaaca('0x43')]();setInterval(initRealtime,0x1388);})[_0xaaca('0x40')](function(_0x3e6ad4){console[_0xaaca('0x41')](_0x3e6ad4);});}main(); \ No newline at end of file +var _0xe6a0=['getVoiceCallReports','initVoiceCallReports','catch','log','listen','sync','bluebird','util','moment','./realtime','./report','./trigger','./preview','./rpc/user','./rpc/voiceCallReport','./rpc/trigger','./rpc/template','./rpc/cmHopperHistory','./rpc/campaign','./rpc/voiceExtension','./rpc/faxAccount','./rpc/integrations/zendesk','./rpc/integrations/salesforce','./rpc/integrations/desk','./rpc/integrations/zoho','./rpc/integrations/vtiger','./rpc/integrations/freshsales','get','hour','then','getTelephones','initTelephones','getTrunks','initVoiceQueues','getTriggers','initTriggers','getTemplates','initTemplates','getZendeskAccounts','initZendeskAccounts','getSalesforceAccounts','initSalesforceAccounts','initSugarcrmAccounts','getFreshdeskAccounts','initFreshdeskAccounts','getDeskAccounts','initDeskAccounts','getZohoAccounts','initZohoAccounts','getVtigerAccounts','initVtigerAccounts','initFreshsalesAccounts','initServicenowAccounts','getDynamics365Accounts','getCampaigns','initCampaigns','getVoiceExtensions','getFaxAccounts','initFaxAccounts','resolve','getVoiceQueueReports','initVoiceQueueReports','initVoiceQueueHopperHistory','getCampaignHopperHistory'];(function(_0x5bb89c,_0x1904df){var _0x428333=function(_0x48aa07){while(--_0x48aa07){_0x5bb89c['push'](_0x5bb89c['shift']());}};_0x428333(++_0x1904df);}(_0xe6a0,0x106));var _0x0e6a=function(_0x3ac3cb,_0x268afb){_0x3ac3cb=_0x3ac3cb-0x0;var _0x19d365=_0xe6a0[_0x3ac3cb];return _0x19d365;};'use strict';var BPromise=require(_0x0e6a('0x0'));var util=require(_0x0e6a('0x1'));var moment=require(_0x0e6a('0x2'));var server=require('./server');var Realtime=require(_0x0e6a('0x3'));var Report=require(_0x0e6a('0x4'));var Acw=require('./acw');var Trigger=require(_0x0e6a('0x5'));var Dialer=require('./dialer');var Preview=require(_0x0e6a('0x6'));var Fax=require('./fax');var user=require(_0x0e6a('0x7'));var voiceQueue=require('./rpc/voiceQueue');var voiceQueueReport=require('./rpc/voiceQueueReport');var voiceCallReport=require(_0x0e6a('0x8'));var trunk=require('./rpc/trunk');var trigger=require(_0x0e6a('0x9'));var template=require(_0x0e6a('0xa'));var cmHopperHistory=require(_0x0e6a('0xb'));var campaign=require(_0x0e6a('0xc'));var voiceExtension=require(_0x0e6a('0xd'));var faxAccount=require(_0x0e6a('0xe'));var zendesk=require(_0x0e6a('0xf'));var salesforce=require(_0x0e6a('0x10'));var sugarcrm=require('./rpc/integrations/sugarcrm');var freshdesk=require('./rpc/integrations/freshdesk');var desk=require(_0x0e6a('0x11'));var zoho=require(_0x0e6a('0x12'));var vtiger=require(_0x0e6a('0x13'));var freshsales=require(_0x0e6a('0x14'));var servicenow=require('./rpc/integrations/servicenow');var dynamics365=require('./rpc/integrations/dynamics365');var realtime=new Realtime();var report=new Report(realtime);var acw=new Acw(realtime);var channelTrigger=new Trigger(realtime);var preview=new Preview(realtime);var dialer=new Dialer(realtime,preview);var fax=new Fax(realtime);var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()[_0x0e6a('0x15')](_0x0e6a('0x16'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0x0e6a('0x15')]('hour')===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return BPromise['resolve']()[_0x0e6a('0x17')](user['getAgents']())['then'](realtime['initAgents']())[_0x0e6a('0x17')](user[_0x0e6a('0x18')]())[_0x0e6a('0x17')](realtime[_0x0e6a('0x19')]())[_0x0e6a('0x17')](trunk[_0x0e6a('0x1a')]())[_0x0e6a('0x17')](realtime['initTrunks']())[_0x0e6a('0x17')](voiceQueue['getVoiceQueues']())[_0x0e6a('0x17')](realtime[_0x0e6a('0x1b')]())['then'](trigger[_0x0e6a('0x1c')]())[_0x0e6a('0x17')](realtime[_0x0e6a('0x1d')]())[_0x0e6a('0x17')](template[_0x0e6a('0x1e')]())['then'](realtime[_0x0e6a('0x1f')]())['then'](zendesk[_0x0e6a('0x20')]())[_0x0e6a('0x17')](realtime[_0x0e6a('0x21')]())[_0x0e6a('0x17')](salesforce[_0x0e6a('0x22')]())['then'](realtime[_0x0e6a('0x23')]())['then'](sugarcrm['getSugarcrmAccounts']())[_0x0e6a('0x17')](realtime[_0x0e6a('0x24')]())[_0x0e6a('0x17')](freshdesk[_0x0e6a('0x25')]())[_0x0e6a('0x17')](realtime[_0x0e6a('0x26')]())[_0x0e6a('0x17')](desk[_0x0e6a('0x27')]())[_0x0e6a('0x17')](realtime[_0x0e6a('0x28')]())[_0x0e6a('0x17')](zoho[_0x0e6a('0x29')]())[_0x0e6a('0x17')](realtime[_0x0e6a('0x2a')]())[_0x0e6a('0x17')](vtiger[_0x0e6a('0x2b')]())[_0x0e6a('0x17')](realtime[_0x0e6a('0x2c')]())[_0x0e6a('0x17')](freshsales['getFreshsalesAccounts']())[_0x0e6a('0x17')](realtime[_0x0e6a('0x2d')]())[_0x0e6a('0x17')](servicenow['getServicenowAccounts']())[_0x0e6a('0x17')](realtime[_0x0e6a('0x2e')]())[_0x0e6a('0x17')](dynamics365[_0x0e6a('0x2f')]())[_0x0e6a('0x17')](realtime['initDynamics365Accounts']())[_0x0e6a('0x17')](campaign[_0x0e6a('0x30')]())['then'](realtime[_0x0e6a('0x31')]())['then'](voiceExtension[_0x0e6a('0x32')]())[_0x0e6a('0x17')](realtime['initVoiceExtensions']())['then'](faxAccount[_0x0e6a('0x33')]())[_0x0e6a('0x17')](realtime[_0x0e6a('0x34')]())[_0x0e6a('0x17')](function(){return realtime;});}function initParams(){return BPromise[_0x0e6a('0x35')]()['then'](voiceQueueReport[_0x0e6a('0x36')]())['then'](realtime[_0x0e6a('0x37')]())[_0x0e6a('0x17')](cmHopperHistory['getVoiceQueueHopperHistory']())['then'](realtime[_0x0e6a('0x38')]())[_0x0e6a('0x17')](cmHopperHistory[_0x0e6a('0x39')]())[_0x0e6a('0x17')](realtime['initCampaignHopperHistory']())[_0x0e6a('0x17')](voiceCallReport[_0x0e6a('0x3a')]())[_0x0e6a('0x17')](realtime[_0x0e6a('0x3b')]())['then'](function(_0x35b3b3){})[_0x0e6a('0x3c')](function(_0x545132){console[_0x0e6a('0x3d')](_0x545132);});}function main(){return server[_0x0e6a('0x3e')](realtime,preview,fax)[_0x0e6a('0x17')](function(_0x3de758){return initRealtime();})['then'](function(){return initParams();})[_0x0e6a('0x17')](function(){report[_0x0e6a('0x3f')]();setInterval(initRealtime,0x1388);})[_0x0e6a('0x3c')](function(_0x134fab){console['log'](_0x134fab);});}main(); \ No newline at end of file diff --git a/server/services/ami/model/agent.js b/server/services/ami/model/agent.js index 957226b..933e496 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(_0x798a46,_0x2de427){var _0x2ceada=function(_0x17b86b){while(--_0x17b86b){_0x798a46['push'](_0x798a46['shift']());}};_0x2ceada(++_0x2de427);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x3fe042,_0x1106f7){_0x3fe042=_0x3fe042-0x0;var _0x7d4a1f=_0xcb91[_0x3fe042];return _0x7d4a1f;};'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 _0x9c44=['phone','mobile','online','voiceStatus','voiceStatusTime','voiceStatusCallerIdNumber','onhold','local','prototype','updateStatusRealtime','toLowerCase','not_inuse','idle','inuse','talking','statePause','stateTime','address','voiceStatusQueue','stringify','format','user:%s','emit','user:presence','exports','moment','md5','ioredis','../../../config/environment','redis','defaults','socket.io-emitter','name','email','accountcode','fullname','state','status','unknown'];(function(_0x3873ab,_0x152776){var _0x42f6ed=function(_0x189425){while(--_0x189425){_0x3873ab['push'](_0x3873ab['shift']());}};_0x42f6ed(++_0x152776);}(_0x9c44,0x178));var _0x49c4=function(_0x16b9ed,_0x56517a){_0x16b9ed=_0x16b9ed-0x0;var _0x66b1f8=_0x9c44[_0x16b9ed];return _0x66b1f8;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x49c4('0x0'));var md5=require(_0x49c4('0x1'));var Redis=require(_0x49c4('0x2'));var config=require(_0x49c4('0x3'));config[_0x49c4('0x4')]=_[_0x49c4('0x5')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x49c4('0x6'))(new Redis(config['redis']));function Agent(_0xc1278f){this['id']=_0xc1278f['id']||0x0;this[_0x49c4('0x7')]=_0xc1278f[_0x49c4('0x7')]||'';this[_0x49c4('0x8')]=_0xc1278f[_0x49c4('0x8')]||'';this['accountcode']=_0xc1278f[_0x49c4('0x9')]||'';this[_0x49c4('0xa')]=_0xc1278f[_0x49c4('0xa')]||'';this[_0x49c4('0xb')]='unknown';this['stateTime']=0x0;this[_0x49c4('0xc')]=_0x49c4('0xd');this['address']='';this[_0x49c4('0xe')]='';this[_0x49c4('0xf')]='';this['interface']='';this['online']=_0xc1278f[_0x49c4('0x10')]||![];this[_0x49c4('0x11')]='unknown';this[_0x49c4('0x12')]=0x0;this[_0x49c4('0x13')]='';this['voiceStatusQueue']='';this[_0x49c4('0x14')]=![];this[_0x49c4('0x15')]=![];this[_0x49c4('0x1')]='';}Agent[_0x49c4('0x16')][_0x49c4('0x17')]=function(_0x18211c){var _0x75ea8;if(_0x18211c&&_0x18211c[_0x49c4('0xb')]){_0x75ea8=_0x18211c['state'][_0x49c4('0x18')]();switch(_0x75ea8){case _0x49c4('0x19'):_0x75ea8=_0x49c4('0x1a');break;case _0x49c4('0x1b'):_0x75ea8=_0x49c4('0x1c');break;}}if(_0x75ea8&&this['voiceStatus']!==_0x75ea8||_0x18211c[_0x49c4('0x1d')]){this[_0x49c4('0x12')]=_['toNumber'](moment()['format']('x'));}if(_0x75ea8){this[_0x49c4('0x11')]=_0x75ea8;}var _0x2f82d5={'id':this['id'],'name':this[_0x49c4('0x7')],'email':this['email'],'accountcode':this[_0x49c4('0x9')],'fullname':this['fullname'],'state':this[_0x49c4('0xb')],'stateTime':this[_0x49c4('0x1e')],'status':this[_0x49c4('0xc')],'address':this[_0x49c4('0x1f')],'online':this[_0x49c4('0x10')],'voiceStatus':this[_0x49c4('0x11')],'voiceStatusTime':this[_0x49c4('0x12')],'voiceStatusCallerIdNumber':this[_0x49c4('0x13')],'voiceStatusQueue':this[_0x49c4('0x20')],'interface':this['interface'],'onhold':this['onhold']};var _0x57f502=md5(JSON[_0x49c4('0x21')](_0x2f82d5));if(this['md5']!==_0x57f502){this['md5']=_0x57f502;io['to'](util[_0x49c4('0x22')](_0x49c4('0x23'),_0x2f82d5[_0x49c4('0x7')]))[_0x49c4('0x24')]('user:save',_0x2f82d5);io['emit'](_0x49c4('0x25'),_0x2f82d5);}};module[_0x49c4('0x26')]=Agent; \ No newline at end of file diff --git a/server/services/ami/model/campaign.js b/server/services/ami/model/campaign.js index d6511bb..0f5b51d 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 _0x4853=['dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialOrderByScheduledAt','DESC','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','dialQueueProject','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','exports','name','type','originated','temp','ivrAnswerCallsDay','ivrTotalCallsDays','active','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry'];(function(_0x5d1718,_0x3c0926){var _0x1cd8ff=function(_0xd52d24){while(--_0xd52d24){_0x5d1718['push'](_0x5d1718['shift']());}};_0x1cd8ff(++_0x3c0926);}(_0x4853,0x1de));var _0x3485=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x4853[_0xa464c9];return _0x3d73c4;};'use strict';function Campaign(_0x54da87){this['id']=_0x54da87['id']||0x0;this['name']=_0x54da87[_0x3485('0x0')]||'';this[_0x3485('0x1')]=_0x54da87['type']||'campaign';this[_0x3485('0x2')]=0x0;this[_0x3485('0x3')]=0x0;this[_0x3485('0x4')]=0x0;this[_0x3485('0x5')]=0x0;this['message']='';this['sendMessageOneNotActive']=!![];this[_0x3485('0x6')]=_0x54da87[_0x3485('0x6')];this[_0x3485('0x7')]=_0x54da87[_0x3485('0x7')];this[_0x3485('0x8')]=_0x54da87['dialTimezone']||null;this['dialGlobalInterval']=_0x54da87['dialGlobalInterval']?_0x54da87[_0x3485('0x9')]:null;this[_0x3485('0xa')]=_0x54da87[_0x3485('0xa')];this[_0x3485('0xb')]=_0x54da87[_0x3485('0xb')];this[_0x3485('0xc')]=_0x54da87[_0x3485('0xc')]||0x1e;this[_0x3485('0xd')]=_0x54da87['dialCongestionMaxRetry'];this['dialCongestionRetryFrequency']=_0x54da87[_0x3485('0xe')];this[_0x3485('0xf')]=_0x54da87[_0x3485('0xf')];this[_0x3485('0x10')]=_0x54da87[_0x3485('0x10')];this[_0x3485('0x11')]=_0x54da87['dialNoAnswerMaxRetry'];this[_0x3485('0x12')]=_0x54da87[_0x3485('0x12')];this['dialGlobalMaxRetry']=_0x54da87['dialGlobalMaxRetry'];this[_0x3485('0x13')]=_0x54da87[_0x3485('0x13')]||0x3;this[_0x3485('0x14')]=_0x54da87['dialNoSuchNumberRetryFrequency']||0x96;this[_0x3485('0x15')]=_0x54da87[_0x3485('0x15')]||0x3;this[_0x3485('0x16')]=_0x54da87[_0x3485('0x16')]||0x96;this[_0x3485('0x17')]=_0x54da87[_0x3485('0x17')]||0x3;this[_0x3485('0x18')]=_0x54da87[_0x3485('0x18')]||0x96;this[_0x3485('0x19')]=_0x54da87['dialMachineMaxRetry']||0x3;this[_0x3485('0x1a')]=_0x54da87[_0x3485('0x1a')]||0x96;this[_0x3485('0x1b')]=_0x54da87[_0x3485('0x1b')]||0x3;this[_0x3485('0x1c')]=_0x54da87[_0x3485('0x1c')]||0x96;this[_0x3485('0x1d')]=_0x54da87['dialOrderByScheduledAt']||_0x3485('0x1e');this[_0x3485('0x1f')]=_0x54da87[_0x3485('0x1f')]||undefined;this['dialRandomLastDigitCallerIdNumber']=_0x54da87[_0x3485('0x20')]||undefined;this['dialCutDigit']=_0x54da87[_0x3485('0x21')]||undefined;this[_0x3485('0x22')]=_0x54da87[_0x3485('0x22')]?_0x54da87[_0x3485('0x22')]:undefined;this['Trunk']=_0x54da87['Trunk']?_0x54da87[_0x3485('0x23')]:undefined;this[_0x3485('0x24')]=_0x54da87[_0x3485('0x24')]?_0x54da87[_0x3485('0x24')]:undefined;this[_0x3485('0x25')]=_0x54da87[_0x3485('0x25')]?_0x54da87[_0x3485('0x25')]:undefined;this[_0x3485('0x26')]=_0x54da87[_0x3485('0x25')]?_0x54da87[_0x3485('0x25')]['name']:undefined;this[_0x3485('0x27')]=_0x54da87[_0x3485('0x27')]||![];this[_0x3485('0x28')]=_0x54da87[_0x3485('0x28')];this[_0x3485('0x29')]=_0x54da87['dialAMDGreeting'];this[_0x3485('0x2a')]=_0x54da87[_0x3485('0x2a')];this['dialAMDTotalAnalysisTime']=_0x54da87[_0x3485('0x2b')];this[_0x3485('0x2c')]=_0x54da87[_0x3485('0x2c')];this['dialAMDBetweenWordsSilence']=_0x54da87[_0x3485('0x2d')];this[_0x3485('0x2e')]=_0x54da87['dialAMDMaximumNumberOfWords'];this[_0x3485('0x2f')]=_0x54da87[_0x3485('0x2f')];this[_0x3485('0x30')]=_0x54da87['dialAMDMaximumWordLength'];}module[_0x3485('0x31')]=Campaign; \ No newline at end of file +var _0x552c=['dialNoAnswerMaxRetry','dialGlobalMaxRetry','dialNoSuchNumberMaxRetry','dialDropMaxRetry','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialOrderByScheduledAt','DESC','dialPrefix','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','dialQueueProject','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','exports','name','type','campaign','temp','ivrAnswerCallsDay','ivrTotalCallsDays','message','active','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency'];(function(_0x4caf0d,_0x580ea2){var _0x473297=function(_0xf159ac){while(--_0xf159ac){_0x4caf0d['push'](_0x4caf0d['shift']());}};_0x473297(++_0x580ea2);}(_0x552c,0xaa));var _0xc552=function(_0x37cf36,_0x124489){_0x37cf36=_0x37cf36-0x0;var _0x4678d5=_0x552c[_0x37cf36];return _0x4678d5;};'use strict';function Campaign(_0x96b597){this['id']=_0x96b597['id']||0x0;this['name']=_0x96b597[_0xc552('0x0')]||'';this[_0xc552('0x1')]=_0x96b597[_0xc552('0x1')]||_0xc552('0x2');this['originated']=0x0;this[_0xc552('0x3')]=0x0;this[_0xc552('0x4')]=0x0;this[_0xc552('0x5')]=0x0;this[_0xc552('0x6')]='';this['sendMessageOneNotActive']=!![];this[_0xc552('0x7')]=_0x96b597[_0xc552('0x7')];this[_0xc552('0x8')]=_0x96b597[_0xc552('0x8')];this[_0xc552('0x9')]=_0x96b597[_0xc552('0x9')]||null;this['dialGlobalInterval']=_0x96b597[_0xc552('0xa')]?_0x96b597[_0xc552('0xa')]:null;this[_0xc552('0xb')]=_0x96b597[_0xc552('0xb')];this[_0xc552('0xc')]=_0x96b597['dialOriginateCallerIdNumber'];this[_0xc552('0xd')]=_0x96b597[_0xc552('0xd')]||0x1e;this[_0xc552('0xe')]=_0x96b597[_0xc552('0xe')];this[_0xc552('0xf')]=_0x96b597['dialCongestionRetryFrequency'];this[_0xc552('0x10')]=_0x96b597[_0xc552('0x10')];this[_0xc552('0x11')]=_0x96b597[_0xc552('0x11')];this['dialNoAnswerMaxRetry']=_0x96b597[_0xc552('0x12')];this['dialNoAnswerRetryFrequency']=_0x96b597['dialNoAnswerRetryFrequency'];this[_0xc552('0x13')]=_0x96b597[_0xc552('0x13')];this[_0xc552('0x14')]=_0x96b597[_0xc552('0x14')]||0x3;this['dialNoSuchNumberRetryFrequency']=_0x96b597['dialNoSuchNumberRetryFrequency']||0x96;this[_0xc552('0x15')]=_0x96b597[_0xc552('0x15')]||0x3;this['dialDropRetryFrequency']=_0x96b597['dialDropRetryFrequency']||0x96;this[_0xc552('0x16')]=_0x96b597['dialAbandonedMaxRetry']||0x3;this[_0xc552('0x17')]=_0x96b597['dialAbandonedRetryFrequency']||0x96;this['dialMachineMaxRetry']=_0x96b597[_0xc552('0x18')]||0x3;this[_0xc552('0x19')]=_0x96b597[_0xc552('0x19')]||0x96;this[_0xc552('0x1a')]=_0x96b597['dialAgentRejectMaxRetry']||0x3;this[_0xc552('0x1b')]=_0x96b597['dialAgentRejectRetryFrequency']||0x96;this[_0xc552('0x1c')]=_0x96b597[_0xc552('0x1c')]||_0xc552('0x1d');this[_0xc552('0x1e')]=_0x96b597[_0xc552('0x1e')]||undefined;this['dialRandomLastDigitCallerIdNumber']=_0x96b597['dialRandomLastDigitCallerIdNumber']||undefined;this['dialCutDigit']=_0x96b597[_0xc552('0x1f')]||undefined;this[_0xc552('0x20')]=_0x96b597[_0xc552('0x20')]?_0x96b597[_0xc552('0x20')]:undefined;this[_0xc552('0x21')]=_0x96b597[_0xc552('0x21')]?_0x96b597[_0xc552('0x21')]:undefined;this[_0xc552('0x22')]=_0x96b597[_0xc552('0x22')]?_0x96b597[_0xc552('0x22')]:undefined;this['SquareProject']=_0x96b597[_0xc552('0x23')]?_0x96b597[_0xc552('0x23')]:undefined;this[_0xc552('0x24')]=_0x96b597[_0xc552('0x23')]?_0x96b597[_0xc552('0x23')][_0xc552('0x0')]:undefined;this[_0xc552('0x25')]=_0x96b597[_0xc552('0x25')]||![];this[_0xc552('0x26')]=_0x96b597['dialAMDInitialSilence'];this[_0xc552('0x27')]=_0x96b597[_0xc552('0x27')];this['dialAMDAfterGreetingSilence']=_0x96b597['dialAMDAfterGreetingSilence'];this[_0xc552('0x28')]=_0x96b597['dialAMDTotalAnalysisTime'];this['dialAMDMinWordLength']=_0x96b597[_0xc552('0x29')];this['dialAMDBetweenWordsSilence']=_0x96b597[_0xc552('0x2a')];this['dialAMDMaximumNumberOfWords']=_0x96b597[_0xc552('0x2b')];this[_0xc552('0x2c')]=_0x96b597['dialAMDSilenceThreshold'];this['dialAMDMaximumWordLength']=_0x96b597[_0xc552('0x2d')];}module[_0xc552('0x2e')]=Campaign; \ No newline at end of file diff --git a/server/services/ami/model/channel.js b/server/services/ami/model/channel.js index 45fc1f2..2a14ed0 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 _0x1458=['queue','transfercalleridnum','transferconnectedlinenum','transferType','starttime','channel','destinationchannel','calleridnum','calleridname','connectedlinenum','connectedlinename','context','uniqueid','linkedid','exten','answered','endtime','lastdata','billableseconds','holdtime','tag','disposition','monitor','monitorFilename'];(function(_0x3e0191,_0x1d4b20){var _0xf2ae83=function(_0x277210){while(--_0x277210){_0x3e0191['push'](_0x3e0191['shift']());}};_0xf2ae83(++_0x1d4b20);}(_0x1458,0x16c));var _0x8145=function(_0x39fe3d,_0x33e35d){_0x39fe3d=_0x39fe3d-0x0;var _0x496e73=_0x1458[_0x39fe3d];return _0x496e73;};'use strict';function Channel(){this[_0x8145('0x0')]=null;this[_0x8145('0x1')]='';this[_0x8145('0x2')]='';this[_0x8145('0x3')]=0x0;this[_0x8145('0x4')]='';this[_0x8145('0x5')]=undefined;this[_0x8145('0x6')]=undefined;this['accountcode']=0x0;this[_0x8145('0x7')]='';this[_0x8145('0x8')]=0x0;this[_0x8145('0x9')]=0x0;this[_0x8145('0xa')]=0x0;this[_0x8145('0xb')]=![];this['answertime']=null;this[_0x8145('0xc')]=null;this['unmanaged']=![];this['abandoned']=![];this['lastapplication']='';this[_0x8145('0xd')]='';this['duration']=0x0;this[_0x8145('0xe')]=0x0;this[_0x8145('0xf')]=0x0;this['type']=null;this[_0x8145('0x10')]=null;this[_0x8145('0x11')]=null;this[_0x8145('0x12')]=![];this[_0x8145('0x13')]=null;this[_0x8145('0x14')]=null;this['monitors']=[];this[_0x8145('0x15')]=undefined;this[_0x8145('0x16')]=undefined;this[_0x8145('0x17')]=undefined;this['mohtime']=0x0;}module['exports']=Channel; \ No newline at end of file +var _0x2581=['destinationchannel','calleridnum','calleridname','connectedlinenum','connectedlinename','accountcode','context','uniqueid','exten','answered','answertime','endtime','unmanaged','abandoned','lastapplication','lastdata','duration','billableseconds','type','tag','disposition','monitor','monitorFilename','transferconnectedlinenum','transferType','mohtime','exports','starttime','channel'];(function(_0x205e7a,_0x51723a){var _0x1a52bf=function(_0x151651){while(--_0x151651){_0x205e7a['push'](_0x205e7a['shift']());}};_0x1a52bf(++_0x51723a);}(_0x2581,0x72));var _0x1258=function(_0x384f30,_0x547c8b){_0x384f30=_0x384f30-0x0;var _0x34e315=_0x2581[_0x384f30];return _0x34e315;};'use strict';function Channel(){this[_0x1258('0x0')]=null;this[_0x1258('0x1')]='';this[_0x1258('0x2')]='';this[_0x1258('0x3')]=0x0;this[_0x1258('0x4')]='';this[_0x1258('0x5')]=undefined;this[_0x1258('0x6')]=undefined;this[_0x1258('0x7')]=0x0;this[_0x1258('0x8')]='';this[_0x1258('0x9')]=0x0;this['linkedid']=0x0;this[_0x1258('0xa')]=0x0;this[_0x1258('0xb')]=![];this[_0x1258('0xc')]=null;this[_0x1258('0xd')]=null;this[_0x1258('0xe')]=![];this[_0x1258('0xf')]=![];this[_0x1258('0x10')]='';this[_0x1258('0x11')]='';this[_0x1258('0x12')]=0x0;this[_0x1258('0x13')]=0x0;this['holdtime']=0x0;this[_0x1258('0x14')]=null;this[_0x1258('0x15')]=null;this[_0x1258('0x16')]=null;this[_0x1258('0x17')]=![];this[_0x1258('0x18')]=null;this['queue']=null;this['monitors']=[];this['transfercalleridnum']=undefined;this[_0x1258('0x19')]=undefined;this[_0x1258('0x1a')]=undefined;this[_0x1258('0x1b')]=0x0;}module[_0x1258('0x1c')]=Channel; \ No newline at end of file diff --git a/server/services/ami/model/deskAccount.js b/server/services/ami/model/deskAccount.js index e7aef5e..059c619 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 _0xc035=['authType','password','consumerKey','consumerSecret','token','tokenSecret','type','serverUrl','Configurations','name','username','remoteUri'];(function(_0x4a1835,_0xe4a237){var _0x203f1b=function(_0x52886e){while(--_0x52886e){_0x4a1835['push'](_0x4a1835['shift']());}};_0x203f1b(++_0xe4a237);}(_0xc035,0x14d));var _0x5c03=function(_0x19e972,_0x124083){_0x19e972=_0x19e972-0x0;var _0x256772=_0xc035[_0x19e972];return _0x256772;};'use strict';function DeskAccount(_0x3fa626){this['id']=_0x3fa626['id']||0x0;this[_0x5c03('0x0')]=_0x3fa626[_0x5c03('0x0')]||'';this[_0x5c03('0x1')]=_0x3fa626[_0x5c03('0x1')]||'';this['remoteUri']=_0x3fa626[_0x5c03('0x2')]||'';this[_0x5c03('0x3')]=_0x3fa626[_0x5c03('0x3')]||'';this[_0x5c03('0x4')]=_0x3fa626['password']||'';this[_0x5c03('0x5')]=_0x3fa626[_0x5c03('0x5')]||'';this[_0x5c03('0x6')]=_0x3fa626[_0x5c03('0x6')]||'';this[_0x5c03('0x7')]=_0x3fa626[_0x5c03('0x7')]||'';this['tokenSecret']=_0x3fa626[_0x5c03('0x8')]||'';this[_0x5c03('0x9')]=_0x3fa626[_0x5c03('0x9')]||'';this[_0x5c03('0xa')]=_0x3fa626[_0x5c03('0xa')]||'';this['Configurations']=_0x3fa626[_0x5c03('0xb')]||{};}module['exports']=DeskAccount; \ No newline at end of file +var _0xd669=['authType','password','consumerKey','consumerSecret','token','tokenSecret','type','serverUrl','Configurations','name','username','remoteUri'];(function(_0x3bc9b2,_0x3a4619){var _0x41e863=function(_0x25e9f4){while(--_0x25e9f4){_0x3bc9b2['push'](_0x3bc9b2['shift']());}};_0x41e863(++_0x3a4619);}(_0xd669,0x11d));var _0x9d66=function(_0x2c1144,_0x5264a8){_0x2c1144=_0x2c1144-0x0;var _0x147bd2=_0xd669[_0x2c1144];return _0x147bd2;};'use strict';function DeskAccount(_0x14af13){this['id']=_0x14af13['id']||0x0;this['name']=_0x14af13[_0x9d66('0x0')]||'';this['username']=_0x14af13[_0x9d66('0x1')]||'';this[_0x9d66('0x2')]=_0x14af13[_0x9d66('0x2')]||'';this[_0x9d66('0x3')]=_0x14af13[_0x9d66('0x3')]||'';this['password']=_0x14af13[_0x9d66('0x4')]||'';this['consumerKey']=_0x14af13[_0x9d66('0x5')]||'';this[_0x9d66('0x6')]=_0x14af13[_0x9d66('0x6')]||'';this[_0x9d66('0x7')]=_0x14af13['token']||'';this[_0x9d66('0x8')]=_0x14af13[_0x9d66('0x8')]||'';this[_0x9d66('0x9')]=_0x14af13['type']||'';this[_0x9d66('0xa')]=_0x14af13[_0x9d66('0xa')]||'';this[_0x9d66('0xb')]=_0x14af13[_0x9d66('0xb')]||{};}module['exports']=DeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/dynamics365Account.js b/server/services/ami/model/dynamics365Account.js index 612fe8d..c58d6ca 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 _0x4522=['tenantId','clientId','clientSecret','serverUrl','Configurations','exports','name','username','password','remoteUri'];(function(_0x11005e,_0x20c3d2){var _0x29338f=function(_0x3384e9){while(--_0x3384e9){_0x11005e['push'](_0x11005e['shift']());}};_0x29338f(++_0x20c3d2);}(_0x4522,0x1a0));var _0x2452=function(_0x4dfef9,_0x28d975){_0x4dfef9=_0x4dfef9-0x0;var _0x217a26=_0x4522[_0x4dfef9];return _0x217a26;};'use strict';function Dynamics365Account(_0x2606f1){this['id']=_0x2606f1['id']||0x0;this['name']=_0x2606f1[_0x2452('0x0')]||'';this[_0x2452('0x1')]=_0x2606f1[_0x2452('0x1')]||'';this['password']=_0x2606f1[_0x2452('0x2')]||'';this[_0x2452('0x3')]=_0x2606f1[_0x2452('0x3')]||'';this[_0x2452('0x4')]=_0x2606f1[_0x2452('0x4')]||'';this[_0x2452('0x5')]=_0x2606f1[_0x2452('0x5')]||'';this[_0x2452('0x6')]=_0x2606f1[_0x2452('0x6')]||{};this[_0x2452('0x7')]=_0x2606f1[_0x2452('0x7')]||'';this[_0x2452('0x8')]=_0x2606f1[_0x2452('0x8')]||{};}module[_0x2452('0x9')]=Dynamics365Account; \ No newline at end of file +var _0xa75b=['username','password','remoteUri','tenantId','clientId','clientSecret','serverUrl','Configurations'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa75b,0x170));var _0xba75=function(_0x5afafc,_0x3eb773){_0x5afafc=_0x5afafc-0x0;var _0x238269=_0xa75b[_0x5afafc];return _0x238269;};'use strict';function Dynamics365Account(_0x5b33c5){this['id']=_0x5b33c5['id']||0x0;this['name']=_0x5b33c5['name']||'';this[_0xba75('0x0')]=_0x5b33c5[_0xba75('0x0')]||'';this[_0xba75('0x1')]=_0x5b33c5[_0xba75('0x1')]||'';this[_0xba75('0x2')]=_0x5b33c5[_0xba75('0x2')]||'';this[_0xba75('0x3')]=_0x5b33c5[_0xba75('0x3')]||'';this[_0xba75('0x4')]=_0x5b33c5[_0xba75('0x4')]||'';this[_0xba75('0x5')]=_0x5b33c5[_0xba75('0x5')]||{};this[_0xba75('0x6')]=_0x5b33c5['serverUrl']||'';this['Configurations']=_0x5b33c5[_0xba75('0x7')]||{};}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 924100e..12e79b8 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 _0x5f27=['gateway','faxdetect','tech','SIP','Trunk','ListId','key','exports','description','ecm','headerinfo','localstationid','minrate','maxrate','modem','v17,v27,v29'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x5f27,0xd8));var _0x75f2=function(_0xc4c6fd,_0x809d71){_0xc4c6fd=_0xc4c6fd-0x0;var _0x27b296=_0x5f27[_0xc4c6fd];return _0x27b296;};'use strict';function FaxAccount(_0x9faad5){this['id']=_0x9faad5['id']||0x0;this['name']=_0x9faad5['name']||'';this['description']=_0x9faad5[_0x75f2('0x0')];this[_0x75f2('0x1')]=_0x9faad5['ecm'];this[_0x75f2('0x2')]=_0x9faad5[_0x75f2('0x2')];this[_0x75f2('0x3')]=_0x9faad5[_0x75f2('0x3')];this[_0x75f2('0x4')]=_0x9faad5[_0x75f2('0x4')]||0x960;this[_0x75f2('0x5')]=_0x9faad5[_0x75f2('0x5')]||0x3840;this[_0x75f2('0x6')]=_0x9faad5[_0x75f2('0x6')]||_0x75f2('0x7');this['gateway']=_0x9faad5[_0x75f2('0x8')]||'no';this['faxdetect']=_0x9faad5[_0x75f2('0x9')]||'no';this['t38timeout']=_0x9faad5['t38timeout']||0x1388;this[_0x75f2('0xa')]=_0x9faad5['tech']||_0x75f2('0xb');this[_0x75f2('0xc')]=_0x9faad5[_0x75f2('0xc')]?_0x9faad5[_0x75f2('0xc')]:undefined;this['ListId']=_0x9faad5[_0x75f2('0xd')];this[_0x75f2('0xe')]=_0x9faad5[_0x75f2('0xe')];}module[_0x75f2('0xf')]=FaxAccount; \ No newline at end of file +var _0x5ba5=['SIP','Trunk','ListId','key','name','description','headerinfo','localstationid','minrate','maxrate','modem','v17,v27,v29','gateway','faxdetect','t38timeout','tech'];(function(_0x41997b,_0x4ccc82){var _0x57d0bf=function(_0x3b1a0e){while(--_0x3b1a0e){_0x41997b['push'](_0x41997b['shift']());}};_0x57d0bf(++_0x4ccc82);}(_0x5ba5,0x174));var _0x55ba=function(_0x245690,_0x3bf938){_0x245690=_0x245690-0x0;var _0x3fb9a4=_0x5ba5[_0x245690];return _0x3fb9a4;};'use strict';function FaxAccount(_0x5b9404){this['id']=_0x5b9404['id']||0x0;this[_0x55ba('0x0')]=_0x5b9404[_0x55ba('0x0')]||'';this[_0x55ba('0x1')]=_0x5b9404[_0x55ba('0x1')];this['ecm']=_0x5b9404['ecm'];this[_0x55ba('0x2')]=_0x5b9404[_0x55ba('0x2')];this[_0x55ba('0x3')]=_0x5b9404[_0x55ba('0x3')];this[_0x55ba('0x4')]=_0x5b9404[_0x55ba('0x4')]||0x960;this[_0x55ba('0x5')]=_0x5b9404[_0x55ba('0x5')]||0x3840;this[_0x55ba('0x6')]=_0x5b9404[_0x55ba('0x6')]||_0x55ba('0x7');this['gateway']=_0x5b9404[_0x55ba('0x8')]||'no';this[_0x55ba('0x9')]=_0x5b9404[_0x55ba('0x9')]||'no';this['t38timeout']=_0x5b9404[_0x55ba('0xa')]||0x1388;this['tech']=_0x5b9404[_0x55ba('0xb')]||_0x55ba('0xc');this['Trunk']=_0x5b9404[_0x55ba('0xd')]?_0x5b9404[_0x55ba('0xd')]:undefined;this[_0x55ba('0xe')]=_0x5b9404['ListId'];this[_0x55ba('0xf')]=_0x5b9404[_0x55ba('0xf')];}module['exports']=FaxAccount; \ No newline at end of file diff --git a/server/services/ami/model/freshdeskAccount.js b/server/services/ami/model/freshdeskAccount.js index f9b4723..b911fec 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 _0x9061=['Configurations','name','username','token','remoteUri','serverUrl'];(function(_0x4ff09b,_0x53f67d){var _0x3f5c2e=function(_0x124592){while(--_0x124592){_0x4ff09b['push'](_0x4ff09b['shift']());}};_0x3f5c2e(++_0x53f67d);}(_0x9061,0x1ed));var _0x1906=function(_0x4a5e76,_0xe72439){_0x4a5e76=_0x4a5e76-0x0;var _0x6c1ff8=_0x9061[_0x4a5e76];return _0x6c1ff8;};'use strict';function FreshdeskAccount(_0x241db8){this['id']=_0x241db8['id']||0x0;this[_0x1906('0x0')]=_0x241db8[_0x1906('0x0')]||'';this['username']=_0x241db8[_0x1906('0x1')]||'';this['apiKey']=_0x241db8[_0x1906('0x2')]||'';this['remoteUri']=_0x241db8[_0x1906('0x3')]||'';this[_0x1906('0x4')]=_0x241db8[_0x1906('0x4')]||'';this[_0x1906('0x5')]=_0x241db8[_0x1906('0x5')]||{};}module['exports']=FreshdeskAccount; \ No newline at end of file +var _0xda81=['token','remoteUri','Configurations','name'];(function(_0x24087b,_0x10c09a){var _0x1ba8e4=function(_0x519f32){while(--_0x519f32){_0x24087b['push'](_0x24087b['shift']());}};_0x1ba8e4(++_0x10c09a);}(_0xda81,0xd7));var _0x1da8=function(_0x12700d,_0x35a546){_0x12700d=_0x12700d-0x0;var _0x2a15ab=_0xda81[_0x12700d];return _0x2a15ab;};'use strict';function FreshdeskAccount(_0x6cc3f6){this['id']=_0x6cc3f6['id']||0x0;this[_0x1da8('0x0')]=_0x6cc3f6['name']||'';this['username']=_0x6cc3f6['username']||'';this['apiKey']=_0x6cc3f6[_0x1da8('0x1')]||'';this[_0x1da8('0x2')]=_0x6cc3f6[_0x1da8('0x2')]||'';this['serverUrl']=_0x6cc3f6['serverUrl']||'';this[_0x1da8('0x3')]=_0x6cc3f6['Configurations']||{};}module['exports']=FreshdeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/freshsalesAccount.js b/server/services/ami/model/freshsalesAccount.js index 9b5ca5e..6d22526 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 _0x07d7=['token','remoteUri','serverUrl','Configurations','exports','name','username','apiKey'];(function(_0x3da832,_0x2133f1){var _0xe602f2=function(_0xb7b2f){while(--_0xb7b2f){_0x3da832['push'](_0x3da832['shift']());}};_0xe602f2(++_0x2133f1);}(_0x07d7,0x85));var _0x707d=function(_0x5d1044,_0x18f656){_0x5d1044=_0x5d1044-0x0;var _0x3cd90e=_0x07d7[_0x5d1044];return _0x3cd90e;};'use strict';function FreshsalesAccount(_0x3cc60f){this['id']=_0x3cc60f['id']||0x0;this[_0x707d('0x0')]=_0x3cc60f[_0x707d('0x0')]||'';this[_0x707d('0x1')]=_0x3cc60f[_0x707d('0x1')]||'';this[_0x707d('0x2')]=_0x3cc60f[_0x707d('0x3')]||'';this[_0x707d('0x4')]=_0x3cc60f[_0x707d('0x4')]||'';this[_0x707d('0x5')]=_0x3cc60f[_0x707d('0x5')]||'';this[_0x707d('0x6')]=_0x3cc60f[_0x707d('0x6')]||{};}module[_0x707d('0x7')]=FreshsalesAccount; \ No newline at end of file +var _0x88d5=['username','token','remoteUri','serverUrl','Configurations','exports','name'];(function(_0xe35164,_0x5a493d){var _0x11c9fb=function(_0x8673f0){while(--_0x8673f0){_0xe35164['push'](_0xe35164['shift']());}};_0x11c9fb(++_0x5a493d);}(_0x88d5,0x76));var _0x588d=function(_0x538464,_0x1810ad){_0x538464=_0x538464-0x0;var _0x2cf7de=_0x88d5[_0x538464];return _0x2cf7de;};'use strict';function FreshsalesAccount(_0xadcb1a){this['id']=_0xadcb1a['id']||0x0;this[_0x588d('0x0')]=_0xadcb1a[_0x588d('0x0')]||'';this[_0x588d('0x1')]=_0xadcb1a[_0x588d('0x1')]||'';this['apiKey']=_0xadcb1a[_0x588d('0x2')]||'';this[_0x588d('0x3')]=_0xadcb1a['remoteUri']||'';this[_0x588d('0x4')]=_0xadcb1a[_0x588d('0x4')]||'';this[_0x588d('0x5')]=_0xadcb1a[_0x588d('0x5')]||{};}module[_0x588d('0x6')]=FreshsalesAccount; \ No newline at end of file diff --git a/server/services/ami/model/queueReport.js b/server/services/ami/model/queueReport.js index 3c92ec9..7e6e4c3 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 _0xb550=['accountcode','context','priority','holdtime','assigned','motionChannel','voice','mohtime','variables','exports','type','inbound','calleridnum','calleridname','queue','queuecallerjoinAt','queuecallerleaveAt','position','count','queuecallerabandonAt','queuecallerexit','queuecallerexitAt','originalposition','connectedlinenum','connectedlinename'];(function(_0x871557,_0x21ae05){var _0x24345c=function(_0x364d8f){while(--_0x364d8f){_0x871557['push'](_0x871557['shift']());}};_0x24345c(++_0x21ae05);}(_0xb550,0x1b3));var _0x0b55=function(_0x142d34,_0x1f4d91){_0x142d34=_0x142d34-0x0;var _0x330b5b=_0xb550[_0x142d34];return _0x330b5b;};'use strict';function QueueReport(){this[_0x0b55('0x0')]=_0x0b55('0x1');this['uniqueid']='';this[_0x0b55('0x2')]='';this[_0x0b55('0x3')]='';this[_0x0b55('0x4')]='';this[_0x0b55('0x5')]=null;this[_0x0b55('0x6')]=null;this[_0x0b55('0x7')]=0x1;this[_0x0b55('0x8')]=0x1;this['queuecallerabandon']=![];this[_0x0b55('0x9')]=null;this['queuecallercomplete']=![];this['queuecallercompleteAt']=null;this[_0x0b55('0xa')]=![];this[_0x0b55('0xb')]=null;this[_0x0b55('0xc')]=0x1;this['channel']='';this[_0x0b55('0xd')]='';this[_0x0b55('0xe')]='';this[_0x0b55('0xf')]='';this[_0x0b55('0x10')]='';this['exten']='';this[_0x0b55('0x11')]='';this[_0x0b55('0x12')]=0x0;this[_0x0b55('0x13')]=![];this['lastAssignedTo']='';this[_0x0b55('0x14')]=_0x0b55('0x15');this[_0x0b55('0x16')]=0x0;this[_0x0b55('0x17')]={};}module[_0x0b55('0x18')]=QueueReport; \ No newline at end of file +var _0x3ddf=['motionChannel','exports','type','inbound','calleridnum','queue','queuecallerleaveAt','count','queuecallerabandon','queuecallercomplete','queuecallerexit','queuecallerexitAt','channel','connectedlinenum','accountcode','exten','priority','holdtime','assigned','lastAssignedTo'];(function(_0x422410,_0x97e958){var _0x3dd4e5=function(_0x33d8f8){while(--_0x33d8f8){_0x422410['push'](_0x422410['shift']());}};_0x3dd4e5(++_0x97e958);}(_0x3ddf,0x1a6));var _0xf3dd=function(_0x18f7d9,_0x10d0f6){_0x18f7d9=_0x18f7d9-0x0;var _0x173496=_0x3ddf[_0x18f7d9];return _0x173496;};'use strict';function QueueReport(){this[_0xf3dd('0x0')]=_0xf3dd('0x1');this['uniqueid']='';this[_0xf3dd('0x2')]='';this['calleridname']='';this[_0xf3dd('0x3')]='';this['queuecallerjoinAt']=null;this[_0xf3dd('0x4')]=null;this['position']=0x1;this[_0xf3dd('0x5')]=0x1;this[_0xf3dd('0x6')]=![];this['queuecallerabandonAt']=null;this[_0xf3dd('0x7')]=![];this['queuecallercompleteAt']=null;this[_0xf3dd('0x8')]=![];this[_0xf3dd('0x9')]=null;this['originalposition']=0x1;this[_0xf3dd('0xa')]='';this[_0xf3dd('0xb')]='';this['connectedlinename']='';this[_0xf3dd('0xc')]='';this['context']='';this[_0xf3dd('0xd')]='';this[_0xf3dd('0xe')]='';this[_0xf3dd('0xf')]=0x0;this[_0xf3dd('0x10')]=![];this[_0xf3dd('0x11')]='';this[_0xf3dd('0x12')]='voice';this['mohtime']=0x0;this['variables']={};}module[_0xf3dd('0x13')]=QueueReport; \ No newline at end of file diff --git a/server/services/ami/model/salesforceAccount.js b/server/services/ami/model/salesforceAccount.js index 73bf2fa..a5d49b4 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 _0x176a=['securityToken','type','integrationTab','serverUrl','Configurations','exports','username','remoteUri','password','clientId','clientSecret'];(function(_0x4539c2,_0x13ee1d){var _0xb1c569=function(_0x2f047a){while(--_0x2f047a){_0x4539c2['push'](_0x4539c2['shift']());}};_0xb1c569(++_0x13ee1d);}(_0x176a,0x8a));var _0xa176=function(_0x125c3a,_0x2d86ca){_0x125c3a=_0x125c3a-0x0;var _0x5dec85=_0x176a[_0x125c3a];return _0x5dec85;};'use strict';function SalesforceAccount(_0x491f68){this['id']=_0x491f68['id']||0x0;this['name']=_0x491f68['name']||'';this['username']=_0x491f68[_0xa176('0x0')]||'';this[_0xa176('0x1')]=_0x491f68['remoteUri']||'';this[_0xa176('0x2')]=_0x491f68[_0xa176('0x2')]||'';this[_0xa176('0x3')]=_0x491f68[_0xa176('0x3')]||'';this[_0xa176('0x4')]=_0x491f68[_0xa176('0x4')]||'';this[_0xa176('0x5')]=_0x491f68[_0xa176('0x5')]||'';this[_0xa176('0x6')]=_0x491f68[_0xa176('0x6')]||_0xa176('0x7');this[_0xa176('0x8')]=_0x491f68[_0xa176('0x8')]||'';this[_0xa176('0x9')]=_0x491f68['Configurations']||{};}module[_0xa176('0xa')]=SalesforceAccount; \ No newline at end of file +var _0x874d=['clientId','clientSecret','securityToken','type','integrationTab','serverUrl','Configurations','exports','name','username','remoteUri','password'];(function(_0x2d3c77,_0x5e0c94){var _0x26e213=function(_0x38a321){while(--_0x38a321){_0x2d3c77['push'](_0x2d3c77['shift']());}};_0x26e213(++_0x5e0c94);}(_0x874d,0x1e8));var _0xd874=function(_0x468a77,_0x1382be){_0x468a77=_0x468a77-0x0;var _0x2d1c33=_0x874d[_0x468a77];return _0x2d1c33;};'use strict';function SalesforceAccount(_0x3843a5){this['id']=_0x3843a5['id']||0x0;this[_0xd874('0x0')]=_0x3843a5[_0xd874('0x0')]||'';this[_0xd874('0x1')]=_0x3843a5['username']||'';this[_0xd874('0x2')]=_0x3843a5[_0xd874('0x2')]||'';this[_0xd874('0x3')]=_0x3843a5[_0xd874('0x3')]||'';this['clientId']=_0x3843a5[_0xd874('0x4')]||'';this[_0xd874('0x5')]=_0x3843a5[_0xd874('0x5')]||'';this[_0xd874('0x6')]=_0x3843a5[_0xd874('0x6')]||'';this['type']=_0x3843a5[_0xd874('0x7')]||_0xd874('0x8');this[_0xd874('0x9')]=_0x3843a5['serverUrl']||'';this['Configurations']=_0x3843a5[_0xd874('0xa')]||{};}module[_0xd874('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 2149b42..42506fe 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 _0xb46e=['remoteUri','serverUrl','Configurations','exports','name','username','password'];(function(_0xf9a6cf,_0x11870e){var _0x59e2bc=function(_0x1cd606){while(--_0x1cd606){_0xf9a6cf['push'](_0xf9a6cf['shift']());}};_0x59e2bc(++_0x11870e);}(_0xb46e,0xcf));var _0xeb46=function(_0x46aaaa,_0x3af897){_0x46aaaa=_0x46aaaa-0x0;var _0x26d04e=_0xb46e[_0x46aaaa];return _0x26d04e;};'use strict';function ServicenowAccount(_0x320b9c){this['id']=_0x320b9c['id']||0x0;this['name']=_0x320b9c[_0xeb46('0x0')]||'';this[_0xeb46('0x1')]=_0x320b9c[_0xeb46('0x1')]||'';this[_0xeb46('0x2')]=_0x320b9c[_0xeb46('0x2')]||'';this[_0xeb46('0x3')]=_0x320b9c[_0xeb46('0x3')]||'';this[_0xeb46('0x4')]=_0x320b9c['serverUrl']||'';this[_0xeb46('0x5')]=_0x320b9c['Configurations']||{};}module[_0xeb46('0x6')]=ServicenowAccount; \ No newline at end of file +var _0x7339=['name','username','password','remoteUri','serverUrl','Configurations'];(function(_0x32792d,_0x2f0aae){var _0x4e09aa=function(_0x133f75){while(--_0x133f75){_0x32792d['push'](_0x32792d['shift']());}};_0x4e09aa(++_0x2f0aae);}(_0x7339,0x132));var _0x9733=function(_0x3e7980,_0x59e038){_0x3e7980=_0x3e7980-0x0;var _0x4fc36a=_0x7339[_0x3e7980];return _0x4fc36a;};'use strict';function ServicenowAccount(_0x4e8617){this['id']=_0x4e8617['id']||0x0;this['name']=_0x4e8617[_0x9733('0x0')]||'';this[_0x9733('0x1')]=_0x4e8617[_0x9733('0x1')]||'';this[_0x9733('0x2')]=_0x4e8617[_0x9733('0x2')]||'';this[_0x9733('0x3')]=_0x4e8617[_0x9733('0x3')]||'';this[_0x9733('0x4')]=_0x4e8617[_0x9733('0x4')]||'';this[_0x9733('0x5')]=_0x4e8617[_0x9733('0x5')]||{};}module['exports']=ServicenowAccount; \ No newline at end of file diff --git a/server/services/ami/model/sugarcrmAccount.js b/server/services/ami/model/sugarcrmAccount.js index 4a01377..cd06af3 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 _0x4737=['remoteUri','serverUrl','Configurations','name','username','password'];(function(_0xf6c595,_0x11300f){var _0x2d0508=function(_0x5bae23){while(--_0x5bae23){_0xf6c595['push'](_0xf6c595['shift']());}};_0x2d0508(++_0x11300f);}(_0x4737,0x141));var _0x7473=function(_0x2c36f8,_0x19e16b){_0x2c36f8=_0x2c36f8-0x0;var _0x5151e8=_0x4737[_0x2c36f8];return _0x5151e8;};'use strict';function SugarcrmAccount(_0x90202d){this['id']=_0x90202d['id']||0x0;this[_0x7473('0x0')]=_0x90202d[_0x7473('0x0')]||'';this[_0x7473('0x1')]=_0x90202d[_0x7473('0x1')]||'';this[_0x7473('0x2')]=_0x90202d['password']||'';this['remoteUri']=_0x90202d[_0x7473('0x3')]||'';this['serverUrl']=_0x90202d[_0x7473('0x4')]||'';this[_0x7473('0x5')]=_0x90202d[_0x7473('0x5')]||{};}module['exports']=SugarcrmAccount; \ No newline at end of file +var _0x80c2=['exports','username','password','remoteUri','serverUrl','Configurations'];(function(_0x3ac4e7,_0x9f6f40){var _0x2f044c=function(_0x4e6039){while(--_0x4e6039){_0x3ac4e7['push'](_0x3ac4e7['shift']());}};_0x2f044c(++_0x9f6f40);}(_0x80c2,0xf1));var _0x280c=function(_0x7a18e6,_0x3eeb25){_0x7a18e6=_0x7a18e6-0x0;var _0x558e18=_0x80c2[_0x7a18e6];return _0x558e18;};'use strict';function SugarcrmAccount(_0x44fc6b){this['id']=_0x44fc6b['id']||0x0;this['name']=_0x44fc6b['name']||'';this[_0x280c('0x0')]=_0x44fc6b['username']||'';this[_0x280c('0x1')]=_0x44fc6b[_0x280c('0x1')]||'';this['remoteUri']=_0x44fc6b[_0x280c('0x2')]||'';this[_0x280c('0x3')]=_0x44fc6b[_0x280c('0x3')]||'';this['Configurations']=_0x44fc6b[_0x280c('0x4')]||{};}module[_0x280c('0x5')]=SugarcrmAccount; \ No newline at end of file diff --git a/server/services/ami/model/telephone.js b/server/services/ami/model/telephone.js index b8548e3..e9988eb 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 _0x3a6d=['name','accountcode','unknown','stateTime','status','address','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3a6d,0x196));var _0xd3a6=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x3a6d[_0x42cae2];return _0x5f256f;};'use strict';function Telephone(_0x241bd1){this['id']=_0x241bd1['id']||0x0;this[_0xd3a6('0x0')]=_0x241bd1[_0xd3a6('0x0')]||'';this[_0xd3a6('0x1')]=_0x241bd1[_0xd3a6('0x1')]||'';this['state']=_0xd3a6('0x2');this[_0xd3a6('0x3')]=0x0;this[_0xd3a6('0x4')]=_0xd3a6('0x2');this[_0xd3a6('0x5')]='';}module[_0xd3a6('0x6')]=Telephone; \ No newline at end of file +var _0x6f3e=['unknown','status','exports','name','accountcode','state'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x6f3e,0x9f));var _0xe6f3=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x6f3e[_0x14add3];return _0x4a174f;};'use strict';function Telephone(_0x5b4094){this['id']=_0x5b4094['id']||0x0;this[_0xe6f3('0x0')]=_0x5b4094[_0xe6f3('0x0')]||'';this[_0xe6f3('0x1')]=_0x5b4094[_0xe6f3('0x1')]||'';this[_0xe6f3('0x2')]=_0xe6f3('0x3');this['stateTime']=0x0;this[_0xe6f3('0x4')]=_0xe6f3('0x3');this['address']='';}module[_0xe6f3('0x5')]=Telephone; \ No newline at end of file diff --git a/server/services/ami/model/template.js b/server/services/ami/model/template.js index 94ad017..e94c911 100644 --- a/server/services/ami/model/template.js +++ b/server/services/ami/model/template.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb10b=['name','html'];(function(_0x2a1b4b,_0x57e7c7){var _0x4b714d=function(_0x7cac5b){while(--_0x7cac5b){_0x2a1b4b['push'](_0x2a1b4b['shift']());}};_0x4b714d(++_0x57e7c7);}(_0xb10b,0x12a));var _0xbb10=function(_0x1fd7c0,_0x1d3c01){_0x1fd7c0=_0x1fd7c0-0x0;var _0x1f27d5=_0xb10b[_0x1fd7c0];return _0x1f27d5;};'use strict';function template(_0x13ce8d){this['id']=_0x13ce8d['id']||0x0;this['name']=_0x13ce8d[_0xbb10('0x0')]||'';this[_0xbb10('0x1')]=_0x13ce8d[_0xbb10('0x1')]||'';}module['exports']=template; \ No newline at end of file +var _0xa9e0=['exports','name'];(function(_0x2c1c13,_0x263ada){var _0x2b461c=function(_0x563c5b){while(--_0x563c5b){_0x2c1c13['push'](_0x2c1c13['shift']());}};_0x2b461c(++_0x263ada);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xa9e0[_0x1facfa];return _0x9ec701;};'use strict';function template(_0x1f0015){this['id']=_0x1f0015['id']||0x0;this[_0x0a9e('0x0')]=_0x1f0015[_0x0a9e('0x0')]||'';this['html']=_0x1f0015['html']||'';}module[_0x0a9e('0x1')]=template; \ No newline at end of file diff --git a/server/services/ami/model/trigger.js b/server/services/ami/model/trigger.js index a25055b..1eca48d 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 _0x757a=['name','status','AllConditions','AnyConditions','Actions','exports'];(function(_0xc7aab0,_0x40e956){var _0x32bbdf=function(_0x20b275){while(--_0x20b275){_0xc7aab0['push'](_0xc7aab0['shift']());}};_0x32bbdf(++_0x40e956);}(_0x757a,0xde));var _0xa757=function(_0x8cbead,_0x499893){_0x8cbead=_0x8cbead-0x0;var _0x5677e=_0x757a[_0x8cbead];return _0x5677e;};'use strict';function Trigger(_0x1acf7d){this['id']=_0x1acf7d['id']||0x0;this[_0xa757('0x0')]=_0x1acf7d[_0xa757('0x0')]||'';this['channel']=_0x1acf7d['channel']||'voice';this[_0xa757('0x1')]=_0x1acf7d[_0xa757('0x1')]||![];this[_0xa757('0x2')]=_0x1acf7d[_0xa757('0x2')]||[];this[_0xa757('0x3')]=_0x1acf7d[_0xa757('0x3')]||[];this['Actions']=_0x1acf7d[_0xa757('0x4')]||[];}module[_0xa757('0x5')]=Trigger; \ No newline at end of file +var _0x1a85=['status','AllConditions','AnyConditions','Actions','name','channel'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x1a85,0x178));var _0x51a8=function(_0x2b1c74,_0x4d14e8){_0x2b1c74=_0x2b1c74-0x0;var _0x575295=_0x1a85[_0x2b1c74];return _0x575295;};'use strict';function Trigger(_0x4570ac){this['id']=_0x4570ac['id']||0x0;this['name']=_0x4570ac[_0x51a8('0x0')]||'';this[_0x51a8('0x1')]=_0x4570ac[_0x51a8('0x1')]||'voice';this['status']=_0x4570ac[_0x51a8('0x2')]||![];this[_0x51a8('0x3')]=_0x4570ac[_0x51a8('0x3')]||[];this['AnyConditions']=_0x4570ac[_0x51a8('0x4')]||[];this['Actions']=_0x4570ac[_0x51a8('0x5')]||[];}module['exports']=Trigger; \ No newline at end of file diff --git a/server/services/ami/model/trunk.js b/server/services/ami/model/trunk.js index 7760fe6..f013561 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 _0xbc34=['status','registry','split','port','registrationtime','defaultuser','exports','active','name','state','unknown','stateTime'];(function(_0x373dee,_0x1a8c45){var _0x46798f=function(_0xc389f0){while(--_0xc389f0){_0x373dee['push'](_0x373dee['shift']());}};_0x46798f(++_0x1a8c45);}(_0xbc34,0x73));var _0x4bc3=function(_0x4aec2b,_0x5a5bd4){_0x4aec2b=_0x4aec2b-0x0;var _0x21caa4=_0xbc34[_0x4aec2b];return _0x21caa4;};'use strict';function Trunk(_0x4079d9){this['id']=_0x4079d9['id']||0x0;this[_0x4bc3('0x0')]=_0x4079d9['active']||![];this[_0x4bc3('0x1')]=_0x4079d9[_0x4bc3('0x1')]||'';this[_0x4bc3('0x2')]=_0x4bc3('0x3');this[_0x4bc3('0x4')]=0x0;this[_0x4bc3('0x5')]=_0x4bc3('0x3');this[_0x4bc3('0x6')]=_0x4079d9[_0x4bc3('0x6')]&&_0x4079d9[_0x4bc3('0x6')]['indexOf'](':')?_0x4079d9[_0x4bc3('0x6')][_0x4bc3('0x7')](':')[0x0]:'';this['host']='';this[_0x4bc3('0x8')]='';this['domain']='';this['domainport']='';this['refresh']='';this['stateRegistry']='unknown';this[_0x4bc3('0x9')]='';this['address']='';this[_0x4bc3('0xa')]=_0x4079d9[_0x4bc3('0xa')]||'';}module[_0x4bc3('0xb')]=Trunk; \ No newline at end of file +var _0x9dba=['active','name','state','unknown','status','registry','indexOf','split','host','port','domain','domainport','registrationtime','defaultuser'];(function(_0x1c0836,_0x3a272a){var _0x8feb0b=function(_0x2e3427){while(--_0x2e3427){_0x1c0836['push'](_0x1c0836['shift']());}};_0x8feb0b(++_0x3a272a);}(_0x9dba,0xa8));var _0xa9db=function(_0x14ca31,_0x120bf2){_0x14ca31=_0x14ca31-0x0;var _0x3f09c2=_0x9dba[_0x14ca31];return _0x3f09c2;};'use strict';function Trunk(_0x140c6e){this['id']=_0x140c6e['id']||0x0;this[_0xa9db('0x0')]=_0x140c6e[_0xa9db('0x0')]||![];this[_0xa9db('0x1')]=_0x140c6e[_0xa9db('0x1')]||'';this[_0xa9db('0x2')]=_0xa9db('0x3');this['stateTime']=0x0;this[_0xa9db('0x4')]=_0xa9db('0x3');this[_0xa9db('0x5')]=_0x140c6e[_0xa9db('0x5')]&&_0x140c6e[_0xa9db('0x5')][_0xa9db('0x6')](':')?_0x140c6e[_0xa9db('0x5')][_0xa9db('0x7')](':')[0x0]:'';this[_0xa9db('0x8')]='';this[_0xa9db('0x9')]='';this[_0xa9db('0xa')]='';this[_0xa9db('0xb')]='';this['refresh']='';this['stateRegistry']=_0xa9db('0x3');this[_0xa9db('0xc')]='';this['address']='';this[_0xa9db('0xd')]=_0x140c6e['defaultuser']||'';}module['exports']=Trunk; \ No newline at end of file diff --git a/server/services/ami/model/voiceExtension.js b/server/services/ami/model/voiceExtension.js index bab8c7b..cffe682 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 _0x745a=['recordingFormat','mandatoryDisposition','exports','exten'];(function(_0x417417,_0x518d03){var _0x46ded9=function(_0x19ed3e){while(--_0x19ed3e){_0x417417['push'](_0x417417['shift']());}};_0x46ded9(++_0x518d03);}(_0x745a,0x6f));var _0xa745=function(_0x46698a,_0x8de1e4){_0x46698a=_0x46698a-0x0;var _0x356db0=_0x745a[_0x46698a];return _0x356db0;};'use strict';function voiceExtension(_0x4af277){this['id']=_0x4af277['id']||0x0;this['exten']=_0x4af277[_0xa745('0x0')]||'';this[_0xa745('0x1')]=_0x4af277[_0xa745('0x1')]||'none';this[_0xa745('0x2')]=_0x4af277[_0xa745('0x2')]||![];}module[_0xa745('0x3')]=voiceExtension; \ No newline at end of file +var _0x0b1c=['mandatoryDisposition','exten','recordingFormat','none'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0b1c,0x1d9));var _0xc0b1=function(_0x42bc91,_0x41f40a){_0x42bc91=_0x42bc91-0x0;var _0x3f5507=_0x0b1c[_0x42bc91];return _0x3f5507;};'use strict';function voiceExtension(_0x1498dc){this['id']=_0x1498dc['id']||0x0;this[_0xc0b1('0x0')]=_0x1498dc[_0xc0b1('0x0')]||'';this[_0xc0b1('0x1')]=_0x1498dc[_0xc0b1('0x1')]||_0xc0b1('0x2');this['mandatoryDisposition']=_0x1498dc[_0xc0b1('0x3')]||![];}module['exports']=voiceExtension; \ No newline at end of file diff --git a/server/services/ami/model/voiceQueue.js b/server/services/ami/model/voiceQueue.js index f087950..2071afc 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 _0x07ef=['ringinuse','onhold','wav','wav49','gsm','rrmemory','roundrobin','name','monitor_format','type','inbound','waiting','total','answered','sumBillable','unmanaged','loggedIn','available','acw','acwTimeout','autopause','sendMessageOneNotActive','message','originated','temp','dialTimezone','dialGlobalInterval','dialActive','dialMethod','progressive','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dropRate','dialPredictiveOptimizationPercentage','dialPredictiveInterval','anonymous','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','DESC','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','queueStatusComplete','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','outboundRejectCallsDay','pTalking','timeout','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundBlacklistCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayACS','outboundAbandonedDay','startPredictive','handlePredictive','predictiveIntervalTotalCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','dialPredictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','dialRecallMeTimeout','dialQueueProject2','dialAgiAfterHangupClient','mandatoryDispositionPause','exports','unknown','not_inuse','inuse','busy','unavailable','ringing'];(function(_0x4a240a,_0x368a06){var _0xe636c1=function(_0x281d12){while(--_0x281d12){_0x4a240a['push'](_0x4a240a['shift']());}};_0xe636c1(++_0x368a06);}(_0x07ef,0x70));var _0xf07e=function(_0x4fc435,_0x45eddf){_0x4fc435=_0x4fc435-0x0;var _0x3c5db1=_0x07ef[_0x4fc435];return _0x3c5db1;};'use strict';var statusDesc=[_0xf07e('0x0'),_0xf07e('0x1'),_0xf07e('0x2'),_0xf07e('0x3'),'invalid',_0xf07e('0x4'),_0xf07e('0x5'),_0xf07e('0x6'),_0xf07e('0x7')];var monitorFormat={'wav':_0xf07e('0x8'),'wav49':_0xf07e('0x9'),'gsm':_0xf07e('0xa')};var strategy={'rrmemory':_0xf07e('0xb'),'roundrobin':_0xf07e('0xc')};function VoiceQueue(_0x16a417){this['id']=_0x16a417['id']||0x0;this[_0xf07e('0xd')]=_0x16a417[_0xf07e('0xd')]||'';this[_0xf07e('0xe')]=_0x16a417[_0xf07e('0xe')]||'';this[_0xf07e('0xf')]=_0x16a417[_0xf07e('0xf')]||_0xf07e('0x10');this[_0xf07e('0x11')]=0x0;this['talking']=0x0;this[_0xf07e('0x12')]=0x0;this[_0xf07e('0x13')]=0x0;this['sumDuration']=0x0;this['sumHoldTime']=0x0;this[_0xf07e('0x14')]=0x0;this[_0xf07e('0x15')]=0x0;this['abandoned']=0x0;this[_0xf07e('0x16')]=0x0;this[_0xf07e('0x17')]=0x0;this[_0xf07e('0x18')]=_0x16a417[_0xf07e('0x18')]||![];this['acwTimeout']=_0x16a417[_0xf07e('0x19')]||0xa;this[_0xf07e('0x1a')]=_0x16a417[_0xf07e('0x1a')]||'no';this[_0xf07e('0x1b')]=!![];this[_0xf07e('0x1c')]='';this[_0xf07e('0x1d')]=0x0;this[_0xf07e('0x1e')]=0x0;this['dialTimezone']=_0x16a417[_0xf07e('0x1f')]||null;this[_0xf07e('0x20')]=_0x16a417['dialGlobalInterval']?_0x16a417[_0xf07e('0x20')]:null;this[_0xf07e('0x21')]=_0x16a417[_0xf07e('0x21')];this[_0xf07e('0x22')]=_0x16a417[_0xf07e('0x22')]||_0xf07e('0x23');this[_0xf07e('0x24')]=_0x16a417[_0xf07e('0x24')]||0x0;this[_0xf07e('0x25')]=_0x16a417['dialLimitQueue']||0x0;this['dialPowerLevel']=_0x16a417[_0xf07e('0x26')]||0x1;this[_0xf07e('0x27')]=_0x16a417[_0xf07e('0x27')]||_0xf07e('0x28');this[_0xf07e('0x29')]=_0x16a417[_0xf07e('0x29')]||0.03;this[_0xf07e('0x2a')]=_0x16a417[_0xf07e('0x2a')]||0x258;this['dialOriginateCallerIdName']=_0x16a417['dialOriginateCallerIdName']||_0xf07e('0x2b');this[_0xf07e('0x2c')]=_0x16a417[_0xf07e('0x2c')]||_0xf07e('0x2b');this[_0xf07e('0x2d')]=_0x16a417[_0xf07e('0x2d')]||0x1e;this[_0xf07e('0x2e')]=_0x16a417['dialQueueOptions']||'tTxX';this[_0xf07e('0x2f')]=_0x16a417[_0xf07e('0x2f')]||0x3;this[_0xf07e('0x30')]=_0x16a417[_0xf07e('0x30')]||undefined;this[_0xf07e('0x31')]=_0x16a417[_0xf07e('0x31')]||0x3;this[_0xf07e('0x32')]=_0x16a417[_0xf07e('0x32')]||0x96;this[_0xf07e('0x33')]=_0x16a417[_0xf07e('0x33')]||0x3;this['dialBusyRetryFrequency']=_0x16a417[_0xf07e('0x34')]||0x96;this[_0xf07e('0x35')]=_0x16a417[_0xf07e('0x35')]||0x3;this[_0xf07e('0x36')]=_0x16a417['dialNoAnswerRetryFrequency']||0x96;this[_0xf07e('0x37')]=_0x16a417[_0xf07e('0x37')]||0x3;this[_0xf07e('0x38')]=_0x16a417['dialNoSuchNumberRetryFrequency']||0x96;this[_0xf07e('0x39')]=_0x16a417['dialDropMaxRetry']||0x3;this[_0xf07e('0x3a')]=_0x16a417[_0xf07e('0x3a')]||0x96;this['dialAbandonedMaxRetry']=_0x16a417[_0xf07e('0x3b')]||0x3;this[_0xf07e('0x3c')]=_0x16a417['dialAbandonedRetryFrequency']||0x96;this[_0xf07e('0x3d')]=_0x16a417[_0xf07e('0x3d')]||0x3;this[_0xf07e('0x3e')]=_0x16a417['dialMachineRetryFrequency']||0x96;this['dialAgentRejectMaxRetry']=_0x16a417[_0xf07e('0x3f')]||0x3;this[_0xf07e('0x40')]=_0x16a417[_0xf07e('0x40')]||0x96;this[_0xf07e('0x41')]=_0x16a417[_0xf07e('0x41')]||0x4;this[_0xf07e('0x42')]=_0x16a417['Trunk']?_0x16a417[_0xf07e('0x42')]:undefined;this[_0xf07e('0x43')]=_0x16a417[_0xf07e('0x43')]?_0x16a417[_0xf07e('0x43')]:undefined;this[_0xf07e('0x44')]=_0x16a417[_0xf07e('0x44')]||undefined;this[_0xf07e('0x45')]=_0x16a417[_0xf07e('0x45')]?_0x16a417[_0xf07e('0x45')]:undefined;this[_0xf07e('0x46')]=_0x16a417['dialOrderByScheduledAt']||_0xf07e('0x47');this['dialRandomLastDigitCallerIdNumber']=_0x16a417[_0xf07e('0x48')]||undefined;this['dialCutDigit']=_0x16a417[_0xf07e('0x49')]||undefined;this[_0xf07e('0x4a')]=strategy[_0x16a417[_0xf07e('0x4a')]]||_0xf07e('0xb');this[_0xf07e('0x4b')]=!![];this['dialAMDActive']=_0x16a417[_0xf07e('0x4c')]||![];this[_0xf07e('0x4d')]=_0x16a417[_0xf07e('0x4d')];this[_0xf07e('0x4e')]=_0x16a417[_0xf07e('0x4e')];this[_0xf07e('0x4f')]=_0x16a417['dialAMDAfterGreetingSilence'];this[_0xf07e('0x50')]=_0x16a417[_0xf07e('0x50')];this['dialAMDMinWordLength']=_0x16a417['dialAMDMinWordLength'];this['dialAMDBetweenWordsSilence']=_0x16a417[_0xf07e('0x51')];this[_0xf07e('0x52')]=_0x16a417[_0xf07e('0x52')];this['dialAMDSilenceThreshold']=_0x16a417[_0xf07e('0x53')];this['dialAMDMaximumWordLength']=_0x16a417[_0xf07e('0x54')];this[_0xf07e('0x55')]=0x0;this[_0xf07e('0x56')]=0x0;this['timeout']=_0x16a417[_0xf07e('0x57')];this['outboundAnswerCallsDay']=0x0;this['outboundAnswerAgiCallsDay']=0x0;this[_0xf07e('0x58')]=0x0;this[_0xf07e('0x59')]=0x0;this[_0xf07e('0x5a')]=0x0;this[_0xf07e('0x5b')]=0x0;this[_0xf07e('0x5c')]=0x0;this[_0xf07e('0x5d')]=0x0;this['outboundOriginateFailureCallsDay']=0x0;this['outboundDropCallsDayCallersExit']=0x0;this[_0xf07e('0x5e')]=0x0;this[_0xf07e('0x5f')]=0x0;this['outboundReCallsDay']=0x0;this[_0xf07e('0x60')]=0x0;this['startProgressive']=undefined;this[_0xf07e('0x61')]=undefined;this[_0xf07e('0x62')]=undefined;this['predictiveIntervalMultiplicativeFactor']=1.05;this[_0xf07e('0x63')]=0x0;this['predictiveIntervalAnsweredCalls']=0x0;this['predictiveIntervalDroppedCallsCallersExit']=0x0;this[_0xf07e('0x64')]=0x0;this[_0xf07e('0x65')]=0x0;this[_0xf07e('0x66')]=0x0;this['predictiveIntervalPauses']=0x0;this[_0xf07e('0x67')]=0x0;this[_0xf07e('0x68')]=_0x16a417[_0xf07e('0x69')]||0x14;this[_0xf07e('0x6a')]=_0x16a417[_0xf07e('0x69')]||0xa;this[_0xf07e('0x6b')]=0x0;this[_0xf07e('0x6c')]=0x0;this[_0xf07e('0x6d')]=0x1;this['erlangCalls']=0x0;this[_0xf07e('0x6e')]=0x0;this[_0xf07e('0x6f')]=0x0;this[_0xf07e('0x70')]=0x0;this[_0xf07e('0x71')]=_0x16a417[_0xf07e('0x71')]||0x1e;this['dialRecallInQueue']=_0x16a417['dialRecallInQueue']||![];this['dialQueueProject2']=_0x16a417[_0xf07e('0x72')]||undefined;this[_0xf07e('0x73')]=_0x16a417[_0xf07e('0x73')]||![];this['dialAgiAfterHangupAgent']=_0x16a417['dialAgiAfterHangupAgent']||![];this[_0xf07e('0xe')]=monitorFormat[_0x16a417[_0xf07e('0xe')]]?monitorFormat[_0x16a417[_0xf07e('0xe')]]:undefined;this['mandatoryDisposition']=_0x16a417['mandatoryDisposition']||![];this[_0xf07e('0x74')]=_0x16a417[_0xf07e('0x74')]?_0x16a417[_0xf07e('0x74')]:undefined;}module[_0xf07e('0x75')]=VoiceQueue; \ No newline at end of file +var _0x834c=['mandatoryDisposition','mandatoryDispositionPause','exports','unknown','not_inuse','busy','invalid','unavailable','ringing','onhold','wav','wav49','gsm','roundrobin','name','monitor_format','type','inbound','talking','sumDuration','abandoned','loggedIn','acw','acwTimeout','sendMessageOneNotActive','message','originated','temp','dialTimezone','dialGlobalInterval','dialActive','dialMethod','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dropRate','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','anonymous','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','tTxX','dialQueueProject','dialCongestionMaxRetry','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','DESC','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','dialAMDActive','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','pTalking','timeout','outboundAnswerCallsDay','outboundAnswerAgiCallsDay','outboundCongestionCallsDay','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayACS','outboundReCallsDay','startProgressive','startPredictive','handlePredictive','predictiveIntervalMultiplicativeFactor','predictiveIntervalTotalCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalPauses','predictiveIntervalMaxThreshold','dialPredictiveIntervalMaxThreshold','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','dialRecallMeTimeout','dialRecallInQueue','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent'];(function(_0x19f8a3,_0x34ba71){var _0x1b6ee8=function(_0x581b4f){while(--_0x581b4f){_0x19f8a3['push'](_0x19f8a3['shift']());}};_0x1b6ee8(++_0x34ba71);}(_0x834c,0x73));var _0xc834=function(_0x5bfa44,_0x76dacc){_0x5bfa44=_0x5bfa44-0x0;var _0x43815f=_0x834c[_0x5bfa44];return _0x43815f;};'use strict';var statusDesc=[_0xc834('0x0'),_0xc834('0x1'),'inuse',_0xc834('0x2'),_0xc834('0x3'),_0xc834('0x4'),_0xc834('0x5'),'ringinuse',_0xc834('0x6')];var monitorFormat={'wav':_0xc834('0x7'),'wav49':_0xc834('0x8'),'gsm':_0xc834('0x9')};var strategy={'rrmemory':'rrmemory','roundrobin':_0xc834('0xa')};function VoiceQueue(_0x1484b9){this['id']=_0x1484b9['id']||0x0;this[_0xc834('0xb')]=_0x1484b9[_0xc834('0xb')]||'';this[_0xc834('0xc')]=_0x1484b9['monitor_format']||'';this[_0xc834('0xd')]=_0x1484b9[_0xc834('0xd')]||_0xc834('0xe');this['waiting']=0x0;this[_0xc834('0xf')]=0x0;this['total']=0x0;this['answered']=0x0;this[_0xc834('0x10')]=0x0;this['sumHoldTime']=0x0;this['sumBillable']=0x0;this['unmanaged']=0x0;this[_0xc834('0x11')]=0x0;this[_0xc834('0x12')]=0x0;this['available']=0x0;this[_0xc834('0x13')]=_0x1484b9['acw']||![];this[_0xc834('0x14')]=_0x1484b9[_0xc834('0x14')]||0xa;this['autopause']=_0x1484b9['autopause']||'no';this[_0xc834('0x15')]=!![];this[_0xc834('0x16')]='';this[_0xc834('0x17')]=0x0;this[_0xc834('0x18')]=0x0;this[_0xc834('0x19')]=_0x1484b9[_0xc834('0x19')]||null;this['dialGlobalInterval']=_0x1484b9[_0xc834('0x1a')]?_0x1484b9[_0xc834('0x1a')]:null;this[_0xc834('0x1b')]=_0x1484b9[_0xc834('0x1b')];this[_0xc834('0x1c')]=_0x1484b9[_0xc834('0x1c')]||'progressive';this[_0xc834('0x1d')]=_0x1484b9[_0xc834('0x1d')]||0x0;this[_0xc834('0x1e')]=_0x1484b9[_0xc834('0x1e')]||0x0;this[_0xc834('0x1f')]=_0x1484b9['dialPowerLevel']||0x1;this[_0xc834('0x20')]=_0x1484b9[_0xc834('0x20')]||_0xc834('0x21');this[_0xc834('0x22')]=_0x1484b9[_0xc834('0x22')]||0.03;this[_0xc834('0x23')]=_0x1484b9[_0xc834('0x23')]||0x258;this[_0xc834('0x24')]=_0x1484b9[_0xc834('0x24')]||_0xc834('0x25');this['dialOriginateCallerIdNumber']=_0x1484b9[_0xc834('0x26')]||_0xc834('0x25');this[_0xc834('0x27')]=_0x1484b9['dialOriginateTimeout']||0x1e;this[_0xc834('0x28')]=_0x1484b9['dialQueueOptions']||_0xc834('0x29');this['dialQueueTimeout']=_0x1484b9['dialQueueTimeout']||0x3;this['dialQueueProject']=_0x1484b9[_0xc834('0x2a')]||undefined;this['dialCongestionMaxRetry']=_0x1484b9[_0xc834('0x2b')]||0x3;this['dialCongestionRetryFrequency']=_0x1484b9['dialCongestionRetryFrequency']||0x96;this[_0xc834('0x2c')]=_0x1484b9[_0xc834('0x2c')]||0x3;this[_0xc834('0x2d')]=_0x1484b9[_0xc834('0x2d')]||0x96;this['dialNoAnswerMaxRetry']=_0x1484b9[_0xc834('0x2e')]||0x3;this[_0xc834('0x2f')]=_0x1484b9[_0xc834('0x2f')]||0x96;this[_0xc834('0x30')]=_0x1484b9[_0xc834('0x30')]||0x3;this[_0xc834('0x31')]=_0x1484b9['dialNoSuchNumberRetryFrequency']||0x96;this[_0xc834('0x32')]=_0x1484b9[_0xc834('0x32')]||0x3;this[_0xc834('0x33')]=_0x1484b9[_0xc834('0x33')]||0x96;this[_0xc834('0x34')]=_0x1484b9['dialAbandonedMaxRetry']||0x3;this[_0xc834('0x35')]=_0x1484b9[_0xc834('0x35')]||0x96;this['dialMachineMaxRetry']=_0x1484b9['dialMachineMaxRetry']||0x3;this['dialMachineRetryFrequency']=_0x1484b9[_0xc834('0x36')]||0x96;this[_0xc834('0x37')]=_0x1484b9[_0xc834('0x37')]||0x3;this[_0xc834('0x38')]=_0x1484b9[_0xc834('0x38')]||0x96;this[_0xc834('0x39')]=_0x1484b9[_0xc834('0x39')]||0x4;this[_0xc834('0x3a')]=_0x1484b9['Trunk']?_0x1484b9[_0xc834('0x3a')]:undefined;this[_0xc834('0x3b')]=_0x1484b9[_0xc834('0x3b')]?_0x1484b9[_0xc834('0x3b')]:undefined;this[_0xc834('0x3c')]=_0x1484b9[_0xc834('0x3c')]||undefined;this[_0xc834('0x3d')]=_0x1484b9[_0xc834('0x3d')]?_0x1484b9['Interval']:undefined;this[_0xc834('0x3e')]=_0x1484b9[_0xc834('0x3e')]||_0xc834('0x3f');this[_0xc834('0x40')]=_0x1484b9[_0xc834('0x40')]||undefined;this[_0xc834('0x41')]=_0x1484b9[_0xc834('0x41')]||undefined;this[_0xc834('0x42')]=strategy[_0x1484b9[_0xc834('0x42')]]||'rrmemory';this['queueStatusComplete']=!![];this['dialAMDActive']=_0x1484b9[_0xc834('0x43')]||![];this['dialAMDInitialSilence']=_0x1484b9['dialAMDInitialSilence'];this['dialAMDGreeting']=_0x1484b9[_0xc834('0x44')];this[_0xc834('0x45')]=_0x1484b9[_0xc834('0x45')];this[_0xc834('0x46')]=_0x1484b9['dialAMDTotalAnalysisTime'];this['dialAMDMinWordLength']=_0x1484b9[_0xc834('0x47')];this['dialAMDBetweenWordsSilence']=_0x1484b9[_0xc834('0x48')];this[_0xc834('0x49')]=_0x1484b9['dialAMDMaximumNumberOfWords'];this[_0xc834('0x4a')]=_0x1484b9[_0xc834('0x4a')];this[_0xc834('0x4b')]=_0x1484b9['dialAMDMaximumWordLength'];this['outboundRejectCallsDay']=0x0;this[_0xc834('0x4c')]=0x0;this[_0xc834('0x4d')]=_0x1484b9[_0xc834('0x4d')];this[_0xc834('0x4e')]=0x0;this[_0xc834('0x4f')]=0x0;this['outboundNoAnswerCallsDay']=0x0;this['outboundBusyCallsDay']=0x0;this[_0xc834('0x50')]=0x0;this['outboundNoSuchCallsDay']=0x0;this['outboundUnknownCallsDay']=0x0;this[_0xc834('0x51')]=0x0;this[_0xc834('0x52')]=0x0;this[_0xc834('0x53')]=0x0;this['outboundDropCallsDayTimeout']=0x0;this[_0xc834('0x54')]=0x0;this[_0xc834('0x55')]=0x0;this['outboundAbandonedDay']=0x0;this[_0xc834('0x56')]=undefined;this[_0xc834('0x57')]=undefined;this[_0xc834('0x58')]=undefined;this[_0xc834('0x59')]=1.05;this[_0xc834('0x5a')]=0x0;this['predictiveIntervalAnsweredCalls']=0x0;this[_0xc834('0x5b')]=0x0;this[_0xc834('0x5c')]=0x0;this[_0xc834('0x5d')]=0x0;this[_0xc834('0x5e')]=0x0;this[_0xc834('0x5f')]=0x0;this['predictiveIntervalAvailable']=0x0;this[_0xc834('0x60')]=_0x1484b9['dialPredictiveIntervalMaxThreshold']||0x14;this['predictiveIntervalMinThreshold']=_0x1484b9[_0xc834('0x61')]||0xa;this[_0xc834('0x62')]=0x0;this[_0xc834('0x63')]=0x0;this[_0xc834('0x64')]=0x1;this[_0xc834('0x65')]=0x0;this[_0xc834('0x66')]=0x0;this[_0xc834('0x67')]=0x0;this['erlangBusyFactor']=0x0;this[_0xc834('0x68')]=_0x1484b9[_0xc834('0x68')]||0x1e;this['dialRecallInQueue']=_0x1484b9[_0xc834('0x69')]||![];this[_0xc834('0x6a')]=_0x1484b9[_0xc834('0x6a')]||undefined;this[_0xc834('0x6b')]=_0x1484b9[_0xc834('0x6b')]||![];this[_0xc834('0x6c')]=_0x1484b9[_0xc834('0x6c')]||![];this[_0xc834('0xc')]=monitorFormat[_0x1484b9['monitor_format']]?monitorFormat[_0x1484b9['monitor_format']]:undefined;this[_0xc834('0x6d')]=_0x1484b9[_0xc834('0x6d')]||![];this[_0xc834('0x6e')]=_0x1484b9[_0xc834('0x6e')]?_0x1484b9['mandatoryDispositionPause']:undefined;}module[_0xc834('0x6f')]=VoiceQueue; \ No newline at end of file diff --git a/server/services/ami/model/vtigerAccount.js b/server/services/ami/model/vtigerAccount.js index cb006d7..9993648 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 _0xded6=['username','accessKey','remoteUri','serverUrl','Configurations','exports','name'];(function(_0x9c2427,_0x17c865){var _0x51984f=function(_0x177af6){while(--_0x177af6){_0x9c2427['push'](_0x9c2427['shift']());}};_0x51984f(++_0x17c865);}(_0xded6,0x1aa));var _0x6ded=function(_0x16166f,_0x5aa463){_0x16166f=_0x16166f-0x0;var _0xaf29af=_0xded6[_0x16166f];return _0xaf29af;};'use strict';function VtigerAccount(_0x590443){this['id']=_0x590443['id']||0x0;this[_0x6ded('0x0')]=_0x590443[_0x6ded('0x0')]||'';this[_0x6ded('0x1')]=_0x590443['username']||'';this[_0x6ded('0x2')]=_0x590443[_0x6ded('0x2')]||'';this['remoteUri']=_0x590443[_0x6ded('0x3')]||'';this[_0x6ded('0x4')]=_0x590443[_0x6ded('0x4')]||'';this['Configurations']=_0x590443[_0x6ded('0x5')]||{};}module[_0x6ded('0x6')]=VtigerAccount; \ No newline at end of file +var _0xc40e=['name','username','serverUrl','Configurations','exports'];(function(_0x59a66b,_0x354262){var _0x2dd3c9=function(_0x26b419){while(--_0x26b419){_0x59a66b['push'](_0x59a66b['shift']());}};_0x2dd3c9(++_0x354262);}(_0xc40e,0x1db));var _0xec40=function(_0x1d3694,_0x35a643){_0x1d3694=_0x1d3694-0x0;var _0x3acd26=_0xc40e[_0x1d3694];return _0x3acd26;};'use strict';function VtigerAccount(_0x16f3c0){this['id']=_0x16f3c0['id']||0x0;this[_0xec40('0x0')]=_0x16f3c0['name']||'';this[_0xec40('0x1')]=_0x16f3c0[_0xec40('0x1')]||'';this['accessKey']=_0x16f3c0['accessKey']||'';this['remoteUri']=_0x16f3c0['remoteUri']||'';this[_0xec40('0x2')]=_0x16f3c0[_0xec40('0x2')]||'';this[_0xec40('0x3')]=_0x16f3c0[_0xec40('0x3')]||{};}module[_0xec40('0x4')]=VtigerAccount; \ No newline at end of file diff --git a/server/services/ami/model/zendeskAccount.js b/server/services/ami/model/zendeskAccount.js index b5d2580..bc870ec 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 _0x141c=['exports','username','password','token','remoteUri','authType','type','integrationTab','serverUrl','Configurations'];(function(_0x112d64,_0x39fdd5){var _0x352f35=function(_0x5ad32f){while(--_0x5ad32f){_0x112d64['push'](_0x112d64['shift']());}};_0x352f35(++_0x39fdd5);}(_0x141c,0x65));var _0xc141=function(_0x2f47e2,_0x2131dc){_0x2f47e2=_0x2f47e2-0x0;var _0x2a7298=_0x141c[_0x2f47e2];return _0x2a7298;};'use strict';function ZendeskAccount(_0x331494){this['id']=_0x331494['id']||0x0;this['name']=_0x331494['name']||'';this[_0xc141('0x0')]=_0x331494[_0xc141('0x0')]||'';this['password']=_0x331494[_0xc141('0x1')]||'';this[_0xc141('0x2')]=_0x331494[_0xc141('0x2')]||'';this[_0xc141('0x3')]=_0x331494[_0xc141('0x3')]||'';this[_0xc141('0x4')]=_0x331494[_0xc141('0x4')]||'';this['type']=_0x331494[_0xc141('0x5')]||_0xc141('0x6');this[_0xc141('0x7')]=_0x331494[_0xc141('0x7')]||'';this[_0xc141('0x8')]=_0x331494[_0xc141('0x8')]||{};}module[_0xc141('0x9')]=ZendeskAccount; \ No newline at end of file +var _0x0b0f=['token','authType','type','integrationTab','serverUrl','Configurations','name','username','password'];(function(_0x2aae2d,_0x257260){var _0x420302=function(_0x4715b0){while(--_0x4715b0){_0x2aae2d['push'](_0x2aae2d['shift']());}};_0x420302(++_0x257260);}(_0x0b0f,0xc3));var _0xf0b0=function(_0x136ce3,_0x15af7b){_0x136ce3=_0x136ce3-0x0;var _0x272616=_0x0b0f[_0x136ce3];return _0x272616;};'use strict';function ZendeskAccount(_0x49bb02){this['id']=_0x49bb02['id']||0x0;this[_0xf0b0('0x0')]=_0x49bb02[_0xf0b0('0x0')]||'';this[_0xf0b0('0x1')]=_0x49bb02['username']||'';this[_0xf0b0('0x2')]=_0x49bb02[_0xf0b0('0x2')]||'';this[_0xf0b0('0x3')]=_0x49bb02['token']||'';this['remoteUri']=_0x49bb02['remoteUri']||'';this[_0xf0b0('0x4')]=_0x49bb02['authType']||'';this[_0xf0b0('0x5')]=_0x49bb02[_0xf0b0('0x5')]||_0xf0b0('0x6');this[_0xf0b0('0x7')]=_0x49bb02['serverUrl']||'';this[_0xf0b0('0x8')]=_0x49bb02['Configurations']||{};}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 7ba83c2..e9d617d 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 _0x1734=['refreshToken','Configurations','name','description','host','clientId','clientSecret','serverUrl','code'];(function(_0x5380cb,_0x2cd83e){var _0x27afb2=function(_0x5ad1ba){while(--_0x5ad1ba){_0x5380cb['push'](_0x5380cb['shift']());}};_0x27afb2(++_0x2cd83e);}(_0x1734,0x161));var _0x4173=function(_0xdcc260,_0x3a943a){_0xdcc260=_0xdcc260-0x0;var _0x2c9dc4=_0x1734[_0xdcc260];return _0x2c9dc4;};'use strict';function ZohoAccount(_0x5f4c9c){this['id']=_0x5f4c9c['id']||0x0;this[_0x4173('0x0')]=_0x5f4c9c[_0x4173('0x0')]||'';this[_0x4173('0x1')]=_0x5f4c9c[_0x4173('0x1')]||'';this[_0x4173('0x2')]=_0x5f4c9c[_0x4173('0x2')]||'';this['zone']=_0x5f4c9c['zone']||'';this[_0x4173('0x3')]=_0x5f4c9c['clientId']||'';this[_0x4173('0x4')]=_0x5f4c9c[_0x4173('0x4')]||'';this[_0x4173('0x5')]=_0x5f4c9c[_0x4173('0x5')]||'';this['code']=_0x5f4c9c[_0x4173('0x6')]||'';this[_0x4173('0x7')]=_0x5f4c9c[_0x4173('0x7')]||'';this['Configurations']=_0x5f4c9c[_0x4173('0x8')]||{};}module['exports']=ZohoAccount; \ No newline at end of file +var _0xdb9b=['refreshToken','Configurations','name','description','host','zone','clientId','clientSecret','serverUrl','code'];(function(_0x197df3,_0x57d366){var _0xafdaf7=function(_0x5489b5){while(--_0x5489b5){_0x197df3['push'](_0x197df3['shift']());}};_0xafdaf7(++_0x57d366);}(_0xdb9b,0x98));var _0xbdb9=function(_0x5608a3,_0x5b33c5){_0x5608a3=_0x5608a3-0x0;var _0x1ed50a=_0xdb9b[_0x5608a3];return _0x1ed50a;};'use strict';function ZohoAccount(_0x5851bb){this['id']=_0x5851bb['id']||0x0;this['name']=_0x5851bb[_0xbdb9('0x0')]||'';this[_0xbdb9('0x1')]=_0x5851bb[_0xbdb9('0x1')]||'';this[_0xbdb9('0x2')]=_0x5851bb[_0xbdb9('0x2')]||'';this[_0xbdb9('0x3')]=_0x5851bb[_0xbdb9('0x3')]||'';this[_0xbdb9('0x4')]=_0x5851bb['clientId']||'';this['clientSecret']=_0x5851bb[_0xbdb9('0x5')]||'';this[_0xbdb9('0x6')]=_0x5851bb['serverUrl']||'';this[_0xbdb9('0x7')]=_0x5851bb[_0xbdb9('0x7')]||'';this['refreshToken']=_0x5851bb[_0xbdb9('0x8')]||'';this[_0xbdb9('0x9')]=_0x5851bb[_0xbdb9('0x9')]||{};}module['exports']=ZohoAccount; \ No newline at end of file diff --git a/server/services/ami/preview/action.js b/server/services/ami/preview/action.js index 1c985ef..cdc7930 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 _0xcbdf=['callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridnum','originatecalleridname','getCaller','util','lodash','moment','isNil','string','uniqueid','idContact','name','type','campaigntype','queue','dialAnswer','Agent','channelAgent','membername','format','SIP/%s','Contact','firstName','lastName','active','calleridnum','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countmachineretry','countagentrejectretry','countabandonedretry'];(function(_0x18bfdb,_0x241d43){var _0x44334c=function(_0x55e999){while(--_0x55e999){_0x18bfdb['push'](_0x18bfdb['shift']());}};_0x44334c(++_0x241d43);}(_0xcbdf,0x107));var _0xfcbd=function(_0x2efd2d,_0x580dbc){_0x2efd2d=_0x2efd2d-0x0;var _0x36dafa=_0xcbdf[_0x2efd2d];return _0x36dafa;};'use strict';var util=require(_0xfcbd('0x0'));var _=require(_0xfcbd('0x1'));var moment=require(_0xfcbd('0x2'));function checkNameSurname(_0x441d9a,_0x231404,_0x4faf6f){var _0x5537d4='';if(!_[_0xfcbd('0x3')](_0x231404)&&_0xfcbd('0x4')===typeof _0x231404){_0x5537d4+=_0x231404;}if(!_[_0xfcbd('0x3')](_0x4faf6f)&&_0xfcbd('0x4')===typeof _0x4faf6f){_0x5537d4+='\x20'+_0x4faf6f;}if(_0x5537d4!==''){return _0x5537d4;}return _0x441d9a;}function Action(_0x45b1b8,_0x9d9a4f,_0x43173b,_0x46acf2,_0x533169){this[_0xfcbd('0x5')]=_0x43173b||undefined;this[_0xfcbd('0x6')]=_0x45b1b8['id'];this['queue']=_0x9d9a4f[_0xfcbd('0x7')];this[_0xfcbd('0x8')]=_0x9d9a4f[_0xfcbd('0x8')];this[_0xfcbd('0x9')]=_0xfcbd('0xa');this[_0xfcbd('0xb')]=![];this['membername']=_[_0xfcbd('0x3')](_0x45b1b8['Agent'])?undefined:_0x45b1b8[_0xfcbd('0xc')][_0xfcbd('0x7')];this[_0xfcbd('0xd')]=this[_0xfcbd('0xe')]?util[_0xfcbd('0xf')](_0xfcbd('0x10'),this['membername']):_0x46acf2||undefined;this['calleridname']=checkNameSurname(_0x45b1b8[_0xfcbd('0x11')]['phone'],_0x45b1b8[_0xfcbd('0x11')][_0xfcbd('0x12')],_0x45b1b8[_0xfcbd('0x11')][_0xfcbd('0x13')]);this[_0xfcbd('0x14')]=_0x45b1b8['active']||![];this[_0xfcbd('0x15')]=_0x45b1b8[_0xfcbd('0x11')]['phone'];this['scheduledat']=_0x45b1b8[_0xfcbd('0x16')];this[_0xfcbd('0x17')]=_0x45b1b8[_0xfcbd('0x17')]||0x0;this[_0xfcbd('0x18')]=_0x45b1b8[_0xfcbd('0x18')]||0x0;this[_0xfcbd('0x19')]=_0x45b1b8['countnoanswerretry']||0x0;this['countglobal']=(_0x45b1b8[_0xfcbd('0x17')]||0x0)+(_0x45b1b8['countcongestionretry']||0x0)+(_0x45b1b8[_0xfcbd('0x19')]||0x0)+(_0x45b1b8[_0xfcbd('0x1a')]||0x0)+(_0x45b1b8[_0xfcbd('0x1b')]||0x0)+(_0x45b1b8['countabandonedretry']||0x0)+(_0x45b1b8[_0xfcbd('0x1c')]||0x0)+(_0x45b1b8[_0xfcbd('0x1d')]||0x0);this[_0xfcbd('0x1a')]=_0x45b1b8[_0xfcbd('0x1a')]||0x0;this[_0xfcbd('0x1b')]=_0x45b1b8[_0xfcbd('0x1b')]||0x0;this[_0xfcbd('0x1e')]=_0x45b1b8[_0xfcbd('0x1e')]||0x0;this[_0xfcbd('0x1c')]=_0x45b1b8['countmachineretry']||0x0;this[_0xfcbd('0x1d')]=_0x45b1b8[_0xfcbd('0x1d')]||0x0;this[_0xfcbd('0x1f')]=_0x45b1b8['callback'];this[_0xfcbd('0x20')]=_0x45b1b8[_0xfcbd('0x20')];this[_0xfcbd('0x21')]=_0x45b1b8[_0xfcbd('0x21')];this[_0xfcbd('0x22')]=_0x45b1b8[_0xfcbd('0x22')];this[_0xfcbd('0x23')]=_0x45b1b8[_0xfcbd('0x23')];this[_0xfcbd('0x24')]=_0x45b1b8[_0xfcbd('0x24')];this[_0xfcbd('0x25')]=_[_0xfcbd('0x3')](_0x45b1b8[_0xfcbd('0xc')])?_0x45b1b8[_0xfcbd('0x25')]:_0x45b1b8[_0xfcbd('0xc')]['id'];this[_0xfcbd('0x26')]=_0x45b1b8[_0xfcbd('0x26')];this[_0xfcbd('0x27')]='';this[_0xfcbd('0x28')]='';}Action['prototype'][_0xfcbd('0x29')]=function(){return util['format']('\x22%s\x22\x20<%s>',this['calleridname'],this['number']);};module['exports']=Action; \ No newline at end of file +var _0x03b8=['idContact','queue','name','type','dialAnswer','membername','channelAgent','SIP/%s','calleridname','Contact','phone','firstName','active','calleridnum','scheduledat','countcongestionretry','countnoanswerretry','countbusyretry','countmachineretry','countagentrejectretry','countnosuchnumberretry','countdropretry','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','Agent','VoiceQueueId','originatecalleridnum','originatecalleridname','prototype','format','number','exports','util','lodash','moment','isNil','string','uniqueid'];(function(_0x37e1a0,_0x33c213){var _0x55444c=function(_0x5af6df){while(--_0x5af6df){_0x37e1a0['push'](_0x37e1a0['shift']());}};_0x55444c(++_0x33c213);}(_0x03b8,0x17d));var _0x803b=function(_0xfb0ec4,_0x33037d){_0xfb0ec4=_0xfb0ec4-0x0;var _0x1a2829=_0x03b8[_0xfb0ec4];return _0x1a2829;};'use strict';var util=require(_0x803b('0x0'));var _=require(_0x803b('0x1'));var moment=require(_0x803b('0x2'));function checkNameSurname(_0x4e6884,_0x2d5be6,_0x4cc452){var _0x381800='';if(!_[_0x803b('0x3')](_0x2d5be6)&&_0x803b('0x4')===typeof _0x2d5be6){_0x381800+=_0x2d5be6;}if(!_[_0x803b('0x3')](_0x4cc452)&&_0x803b('0x4')===typeof _0x4cc452){_0x381800+='\x20'+_0x4cc452;}if(_0x381800!==''){return _0x381800;}return _0x4e6884;}function Action(_0xcc67b0,_0x46bc60,_0x593f58,_0x19e1f9,_0x1d56b5){this[_0x803b('0x5')]=_0x593f58||undefined;this[_0x803b('0x6')]=_0xcc67b0['id'];this[_0x803b('0x7')]=_0x46bc60[_0x803b('0x8')];this[_0x803b('0x9')]=_0x46bc60['type'];this['campaigntype']=_0x803b('0x7');this[_0x803b('0xa')]=![];this[_0x803b('0xb')]=_['isNil'](_0xcc67b0['Agent'])?undefined:_0xcc67b0['Agent']['name'];this[_0x803b('0xc')]=this[_0x803b('0xb')]?util['format'](_0x803b('0xd'),this['membername']):_0x19e1f9||undefined;this[_0x803b('0xe')]=checkNameSurname(_0xcc67b0[_0x803b('0xf')][_0x803b('0x10')],_0xcc67b0['Contact'][_0x803b('0x11')],_0xcc67b0[_0x803b('0xf')]['lastName']);this[_0x803b('0x12')]=_0xcc67b0[_0x803b('0x12')]||![];this[_0x803b('0x13')]=_0xcc67b0[_0x803b('0xf')][_0x803b('0x10')];this[_0x803b('0x14')]=_0xcc67b0[_0x803b('0x14')];this['countbusyretry']=_0xcc67b0['countbusyretry']||0x0;this['countcongestionretry']=_0xcc67b0[_0x803b('0x15')]||0x0;this[_0x803b('0x16')]=_0xcc67b0[_0x803b('0x16')]||0x0;this['countglobal']=(_0xcc67b0[_0x803b('0x17')]||0x0)+(_0xcc67b0[_0x803b('0x15')]||0x0)+(_0xcc67b0['countnoanswerretry']||0x0)+(_0xcc67b0['countnosuchnumberretry']||0x0)+(_0xcc67b0['countdropretry']||0x0)+(_0xcc67b0['countabandonedretry']||0x0)+(_0xcc67b0[_0x803b('0x18')]||0x0)+(_0xcc67b0[_0x803b('0x19')]||0x0);this[_0x803b('0x1a')]=_0xcc67b0['countnosuchnumberretry']||0x0;this['countdropretry']=_0xcc67b0[_0x803b('0x1b')]||0x0;this['countabandonedretry']=_0xcc67b0['countabandonedretry']||0x0;this[_0x803b('0x18')]=_0xcc67b0[_0x803b('0x18')]||0x0;this[_0x803b('0x19')]=_0xcc67b0[_0x803b('0x19')]||0x0;this[_0x803b('0x1c')]=_0xcc67b0[_0x803b('0x1c')];this[_0x803b('0x1d')]=_0xcc67b0[_0x803b('0x1d')];this[_0x803b('0x1e')]=_0xcc67b0[_0x803b('0x1e')];this['recallme']=_0xcc67b0[_0x803b('0x1f')];this[_0x803b('0x20')]=_0xcc67b0[_0x803b('0x20')];this[_0x803b('0x21')]=_0xcc67b0[_0x803b('0x21')];this[_0x803b('0x22')]=_[_0x803b('0x3')](_0xcc67b0[_0x803b('0x23')])?_0xcc67b0[_0x803b('0x22')]:_0xcc67b0['Agent']['id'];this[_0x803b('0x24')]=_0xcc67b0[_0x803b('0x24')];this[_0x803b('0x25')]='';this[_0x803b('0x26')]='';}Action[_0x803b('0x27')]['getCaller']=function(){return util[_0x803b('0x28')]('\x22%s\x22\x20<%s>',this[_0x803b('0xe')],this[_0x803b('0x29')]);};module[_0x803b('0x2a')]=Action; \ No newline at end of file diff --git a/server/services/ami/preview/index.js b/server/services/ami/preview/index.js index 89863c6..7dd2c4b 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 _0x81e8=['[Preview][execCall][failure]','Call\x20failed','logBlacklist','createHistory','[Blacklist][error]','SIP/%s','unmonitored','pick','unlock','disableContact','execRun','recallme','validateContact','isValid','checkIsBlackList','[Preview][checkIsBlackList]','Call\x20unsuccessful','ACTIVE','[Preview][validateContact][Empty\x20Campaign]','Empty\x20Campaign','[Preview][validateContact][Trunk\x20not\x20work]','campaign\x20Name:\x20','\x20Trunk\x20is\x20not\x20active','\x20Trunk\x20Backup\x20is\x20not\x20active','Trunk\x20not\x20work','[Preview][validateContact][Campaign\x20Active]','\x20Not\x20Active','Is\x20Valid','SIP/%s/%s%s','trim','substring','dialCutDigit','getCallerId','dialOriginateCallerIdName','getCallerIdRandom','originatecalleridname','originatecalleridnum','extractCalleridNumber','addVariables','toLowerVariables','variablesAction','destconnectedlinenum','calleridnum','user:%s','user:agentconnect','OriginateError','[originateFailure][logOriginateFailure]','actionid','logLookAgent','clone','responsetime','isFailure','response','unlockContact','custom:agentringnoanswer','rejected','[syncHangup][talking]','cause','channelstate','transfer','idContact','[syncHangup][talking][transfer]','[syncHangup][talking][cause]','destuniqueid','addVariable','variables','filterKey','keys','variable','value','error','inspect','transfertargetlinkedid','transfererlinkedid','exports','util','lodash','uuid','md5','ioredis','../../../config/logger','preview','actionPreview','../ami','./action','./util/util','redis','prototype','enqueue','tail','finally','sequence','campaignsPreview','voiceQueues','trunks','actions','agents','clockClearZombieChannels','originateresponse','syncOriginateResponse','bind','syncHangup','syncHangupRequest','syncDialEnd','newexten','syncNewExten','varset','syncVarSet','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','loopCampaigns','emit','type','outbound','name','strategy','available','loggedIn','pTalking','sumBillable','sumDuration','sumHoldTime','talking','total','abandoned','waiting','loggedInDb','dialActive','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','outboundAbandonedCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','message','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','Trunk','active','callerid','Interval','stringify','voice_queue:save','info','[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event','voice:queue:%s','voice_queue_channel:remove','voice_queue_presence:remove','sendMessageOneNotActive','paused','NOT_ACTIVE','logger','\x20is\x20not\x20active','IS_DISACTIVED','[CampaignPreview]\x20Campaign\x20Queue:\x20','syncCampaigns','hasOwnProperty','dialMethod','clearZombieChannels','recallMe','isNil','[clearZombieChannels][talking]','Queue','queue','originated:\x20','pTalking:\x20','contactId','ListId','Action','status','channel','catch','No\x20such\x20channel','updateOriginated','dialAnswer','decrementTalkink','[clearZombieChannel]','loggerError','[Dialer][checkChannel][pTalking][Preview]','[Dialer][checkChannel][Preview]','[action]','clearZombieChannel','getContactRecallMe','agentReadyId','then','length','getDiff','scheduledat','dialRecallMeTimeout','Agent','run','logger2','starttime','format','logCustomer','RecallInQueue','createCustomerHistory','[HistoryDialRecallInQueue][historyCatch]','RecallFailedTimeout','createCustomerFinal','[HistoryRecallClose]','[getContactRecallMe]','IsNotLoggedIn','isActive','isTrunkReachable','TrunkBackup','callProgressDetectingCustomer','countnosuchnumberretry','countglobal','totalGlobal','NoSuchNumber','buildObj','nosuchnumber','cloneAction','Global','[callProgressDetectingCustomer][logNoSuchGlobal]','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','activeContact','YYYY-MM-DD\x20HH:mm:ss','answertime','[syncHangup][talking][increment]','\x20Queue','connect','custom:agentConnectPreview','buildAcw','complete','answered','[16]','Answer','[callProgressDetectingCustomer][logAnswer]','crateCustomerReportQueue','talktime','[syncHangup][talking][decrement]','uniqueid','linkedid','BUSY','Busy','custom:agentbusy','[callProgressDetectingCustomer][logBusy]','dialGlobalMaxRetry','dialBusyMaxRetry','rescheduleContact','scheduledAt','dialBusyRetryFrequency','unlockAgent','NOANSWER','countnoanswerretry','NoAnswer','custom:agentnoanswer','noanswer','[callProgressDetectingCustomer][logNoAnswer]','[callProgressDetectingCustomer][logNoAnswerGlobal]','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','CONGESTION','outboundCongestionCallsDay','countcongestionretry','Congestion','custom:agentcongestion','congestion','[callProgressDetectingCustomer][logCongestion]','[callProgressDetectingCustomer][logCongestionGlobal]','dialCongestionMaxRetry','CANCEL','countagentrejectretry','AgentReject','agentreject','[callProgressDetectingCustomer][logAgentReject]','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','ABANDONED','countabandonedretry','Abandoned','[callProgressDetectingCustomer][logAbandoned]','countabandonedetry','dialAbandonedMaxRety','dialAbandonedRetryFrequency','cause-txt','dialstatus','custom:amd','[callProgressDetectingCustomer][hangupInAMD]','[callProgressDetectingCustomer][machine]','[default]','[Dialer][decrementTalkink][no\x20Hangup][Preview]','[callProgressDetectingCustomer][logUnknown]','[callProgressDetectingCustomer][logUnknownGlobal]','[callProgressDetectingCustomer]','[originated][decrement][callProgressDetectingCustomer]','destlinkedid','callProgressDetectingAgent','isUndefined','object','reason','logAgent','createAgentHistory','[callProgressDetectingAgent][logNoAnswer]','[callProgressDetectingAgent][logBusy]','AnswerAGI','[callProgressDetectingAgent][logAnswerAGI]','[callProgressDetectingAgent][logCongestion]','[callProgressDetectingAgent]','[originated][decrement][callProgressDetectingAgent]','checkInBlack','Contact','phone','VoiceQueueId','lookAgent','isEmpty','execCall','[Preview][execCall][success]','Queue:\x20','\x20IdHopper:\x20','custom:agentcalled','Calling'];(function(_0x2db7ce,_0x1a669e){var _0x460cc3=function(_0x33da63){while(--_0x33da63){_0x2db7ce['push'](_0x2db7ce['shift']());}};_0x460cc3(++_0x1a669e);}(_0x81e8,0x19f));var _0x881e=function(_0x391892,_0x1ee78e){_0x391892=_0x391892-0x0;var _0x5e18ac=_0x81e8[_0x391892];return _0x5e18ac;};'use strict';var util=require(_0x881e('0x0'));var _=require(_0x881e('0x1'));var BPromise=require('bluebird');var uuid=require(_0x881e('0x2'));var moment=require('moment');var md5=require(_0x881e('0x3'));var Redis=require(_0x881e('0x4'));var config=require('../../../config/environment');var logger=require(_0x881e('0x5'))(_0x881e('0x6'));var loggerAction=require(_0x881e('0x5'))(_0x881e('0x7'));var ami=require(_0x881e('0x8'));var rpcDb=require('./rpcDb');var Action=require(_0x881e('0x9'));var ut=require(_0x881e('0xa'));config[_0x881e('0xb')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x881e('0xb')]));var Sequence=function(){};Sequence[_0x881e('0xc')][_0x881e('0xd')]=function(_0x4ed82a){this['tail']=this[_0x881e('0xe')]?this[_0x881e('0xe')][_0x881e('0xf')](_0x4ed82a):_0x4ed82a();};function Preview(_0x5246d4){this[_0x881e('0x10')]=new Sequence();this[_0x881e('0x11')]=_0x5246d4[_0x881e('0x12')];this[_0x881e('0x13')]=_0x5246d4[_0x881e('0x13')];this[_0x881e('0x14')]={};this[_0x881e('0x15')]=_0x5246d4[_0x881e('0x15')];this[_0x881e('0x16')]=0x0;ami['on'](_0x881e('0x17'),this[_0x881e('0x18')][_0x881e('0x19')](this));ami['on']('hangup',this[_0x881e('0x1a')]['bind'](this));ami['on']('hanguprequest',this[_0x881e('0x1b')][_0x881e('0x19')](this));ami['on']('dialend',this[_0x881e('0x1c')]['bind'](this));ami['on'](_0x881e('0x1d'),this[_0x881e('0x1e')]['bind'](this));ami['on'](_0x881e('0x1f'),this[_0x881e('0x20')][_0x881e('0x19')](this));ami['on'](_0x881e('0x21'),this[_0x881e('0x22')][_0x881e('0x19')](this));ami['on'](_0x881e('0x23'),this[_0x881e('0x24')][_0x881e('0x19')](this));this[_0x881e('0x25')](this[_0x881e('0x11')]);}function emit(_0x1a9bb0,_0x1369ae,_0x3a344a){io['to'](_0x1a9bb0)[_0x881e('0x26')](_0x1369ae,_0x3a344a);}function emitCampaignPreview(_0x1a1e9a){if(_0x1a1e9a[_0x881e('0x27')]===_0x881e('0x28')){var _0x58f4ff={'id':_0x1a1e9a['id'],'name':_0x1a1e9a[_0x881e('0x29')],'strategy':_0x1a1e9a[_0x881e('0x2a')],'answered':_0x1a1e9a['answered'],'available':_0x1a1e9a[_0x881e('0x2b')],'loggedIn':_0x1a1e9a[_0x881e('0x2c')],'pTalking':_0x1a1e9a[_0x881e('0x2d')],'sumBillable':_0x1a1e9a[_0x881e('0x2e')],'sumDuration':_0x1a1e9a[_0x881e('0x2f')],'sumHoldTime':_0x1a1e9a[_0x881e('0x30')]||0x0,'talking':_0x1a1e9a[_0x881e('0x31')],'total':_0x1a1e9a[_0x881e('0x32')],'type':_0x1a1e9a['type'],'unmanaged':_0x1a1e9a['unmanaged'],'abandoned':_0x1a1e9a[_0x881e('0x33')],'waiting':_0x1a1e9a[_0x881e('0x34')],'loggedInDb':_0x1a1e9a[_0x881e('0x35')],'dialActive':_0x1a1e9a[_0x881e('0x36')],'dialMethod':_0x1a1e9a['dialMethod'],'dialOriginateCallerIdName':_0x1a1e9a['dialOriginateCallerIdName'],'dialOriginateCallerIdNumber':_0x1a1e9a[_0x881e('0x37')],'dialOriginateTimeout':_0x1a1e9a[_0x881e('0x38')],'dialPrefix':_0x1a1e9a[_0x881e('0x39')],'outboundAnswerAgiCallsDay':_0x1a1e9a[_0x881e('0x3a')],'outboundAnswerCallsDay':_0x1a1e9a[_0x881e('0x3b')],'outboundBlacklistCallsDay':_0x1a1e9a[_0x881e('0x3c')],'outboundBusyCallsDay':_0x1a1e9a[_0x881e('0x3d')],'outboundCongestionCallsDay':_0x1a1e9a['outboundCongestionCallsDay'],'outboundDropCallsDayACS':_0x1a1e9a[_0x881e('0x3e')],'outboundDropCallsDayCallersExit':_0x1a1e9a[_0x881e('0x3f')],'outboundDropCallsDayTimeout':_0x1a1e9a['outboundDropCallsDayTimeout'],'outboundNoAnswerCallsDay':_0x1a1e9a[_0x881e('0x40')],'outboundNoSuchCallsDay':_0x1a1e9a[_0x881e('0x41')],'outboundOriginateFailureCallsDay':_0x1a1e9a[_0x881e('0x42')],'outboundReCallsDay':_0x1a1e9a[_0x881e('0x43')],'outboundRejectCallsDay':_0x1a1e9a[_0x881e('0x44')],'outboundUnknownCallsDay':_0x1a1e9a[_0x881e('0x45')],'outboundAbandonedCallsDay':_0x1a1e9a[_0x881e('0x46')],'predictiveIntervalAnsweredCalls':_0x1a1e9a[_0x881e('0x47')],'predictiveIntervalAvgHoldtime':_0x1a1e9a[_0x881e('0x48')],'predictiveIntervalAvgTalktime':_0x1a1e9a['predictiveIntervalAvgTalktime'],'predictiveIntervalDroppedCallsCallersExit':_0x1a1e9a[_0x881e('0x49')],'predictiveIntervalDroppedCallsTimeout':_0x1a1e9a[_0x881e('0x4a')],'predictiveIntervalErlangCalls':_0x1a1e9a[_0x881e('0x4b')],'predictiveIntervalErlangCallsDroppedCalls':_0x1a1e9a['predictiveIntervalErlangCallsDroppedCalls'],'predictiveIntervalHitRate':_0x1a1e9a[_0x881e('0x4c')],'predictiveIntervalMultiplicativeFactor':_0x1a1e9a[_0x881e('0x4d')],'predictiveIntervalPauses':_0x1a1e9a[_0x881e('0x4e')],'predictiveIntervalAvailable':_0x1a1e9a[_0x881e('0x4f')],'predictiveIntervalTotalCalls':_0x1a1e9a['predictiveIntervalTotalCalls'],'message':_0x1a1e9a[_0x881e('0x50')],'originated':_0x1a1e9a[_0x881e('0x51')],'erlangCalls':_0x1a1e9a[_0x881e('0x52')],'erlangCallToSecond':_0x1a1e9a[_0x881e('0x53')],'erlangAbandonmentRate':_0x1a1e9a[_0x881e('0x54')],'erlangBusyFactor':_0x1a1e9a[_0x881e('0x55')],'startPredictive':_0x1a1e9a[_0x881e('0x56')],'startProgressive':_0x1a1e9a['startProgressive']};if(_0x1a1e9a[_0x881e('0x57')]){_0x58f4ff['Trunk']={'id':_0x1a1e9a[_0x881e('0x57')]['id'],'name':_0x1a1e9a[_0x881e('0x57')][_0x881e('0x29')],'active':_0x1a1e9a[_0x881e('0x57')][_0x881e('0x58')],'callerid':_0x1a1e9a['Trunk'][_0x881e('0x59')]};}if(_0x1a1e9a['Interval']){_0x58f4ff[_0x881e('0x5a')]={'id':_0x1a1e9a[_0x881e('0x5a')]['id'],'name':_0x1a1e9a[_0x881e('0x5a')][_0x881e('0x29')]};}var _0x116cba=md5(JSON[_0x881e('0x5b')](_0x58f4ff));if(_0x1a1e9a[_0x881e('0x3')]!==_0x116cba){_0x1a1e9a[_0x881e('0x3')]=_0x116cba;emit(util['format']('voice:queue:%s',_0x58f4ff['name']),_0x881e('0x5c'),_0x58f4ff);}}}function emitVoiceQueueChannelRemove(_0x189ff7){logger[_0x881e('0x5d')](_0x881e('0x5e'),JSON[_0x881e('0x5b')](_0x189ff7));emit(util['format'](_0x881e('0x5f'),_0x189ff7['name']),_0x881e('0x60'),_0x189ff7);io[_0x881e('0x26')](_0x881e('0x61'),_0x189ff7);}function notSendMessagesQueue(_0x2dc3f9){if(_0x2dc3f9[_0x881e('0x62')]){if(_0x2dc3f9[_0x881e('0x51')]===0x0&&_0x2dc3f9[_0x881e('0x2d')]===0x0){_0x2dc3f9['sendMessageOneNotActive']=![];_0x2dc3f9['available']=0x0;_0x2dc3f9[_0x881e('0x63')]=0x0;_0x2dc3f9['message']=_0x881e('0x64');ut[_0x881e('0x65')]('[CampaignPreview]\x20Campaign\x20Queue:\x20',_0x2dc3f9[_0x881e('0x29')]+_0x881e('0x66'));}else{_0x2dc3f9[_0x881e('0x50')]=_0x881e('0x67');ut[_0x881e('0x65')](_0x881e('0x68'),_0x2dc3f9['name']+'\x20is\x20disactive');}emitCampaignPreview(_0x2dc3f9);}}Preview[_0x881e('0xc')][_0x881e('0x25')]=function(){var _0x19077c=this;setInterval(function(){_0x19077c[_0x881e('0x69')]();},0x7cf);};Preview[_0x881e('0xc')][_0x881e('0x69')]=function(){var _0x355e6d=this[_0x881e('0x11')];this[_0x881e('0x16')]+=0x1;for(var _0x1fc87d in _0x355e6d){if(_0x355e6d[_0x881e('0x6a')](_0x1fc87d)&&(_0x355e6d[_0x1fc87d][_0x881e('0x6b')]===_0x881e('0x6')||_0x355e6d[_0x1fc87d][_0x881e('0x6b')]==='booked')&&_0x355e6d[_0x1fc87d][_0x881e('0x27')]===_0x881e('0x28')){if(this[_0x881e('0x16')]>0x7){this['clockClearZombieChannels']=0x0;this[_0x881e('0x6c')]();}}if(_0x355e6d[_0x881e('0x6a')](_0x1fc87d)&&_0x355e6d[_0x1fc87d][_0x881e('0x6b')]===_0x881e('0x6')&&_0x355e6d[_0x1fc87d][_0x881e('0x27')]===_0x881e('0x28')){if(_0x355e6d[_0x1fc87d][_0x881e('0x36')]){this['setMessage'](_0x355e6d[_0x1fc87d]);this[_0x881e('0x6d')](_0x355e6d[_0x1fc87d]);}else{notSendMessagesQueue(_0x355e6d[_0x1fc87d]);}}}};Preview[_0x881e('0xc')]['clearZombieChannel']=function(_0x3cd715){var _0xe032e1=this;this['sequence'][_0x881e('0xd')](function(){if(!_[_0x881e('0x6e')](_0xe032e1[_0x881e('0x14')][_0x3cd715])){loggerAction[_0x881e('0x5d')](_0x881e('0x6f'),_0x3cd715,_0x881e('0x70'),_0xe032e1['actions'][_0x3cd715][_0x881e('0x71')],_0x881e('0x72'),JSON['stringify'](_0xe032e1[_0x881e('0x11')][_0xe032e1[_0x881e('0x14')][_0x3cd715][_0x881e('0x71')]][_0x881e('0x51')]),_0x881e('0x73'),JSON[_0x881e('0x5b')](_0xe032e1[_0x881e('0x11')][_0xe032e1[_0x881e('0x14')][_0x3cd715][_0x881e('0x71')]]['pTalking']),JSON['stringify'](_0xe032e1[_0x881e('0x14')][_0x3cd715]['dialAnswer']),JSON[_0x881e('0x5b')](_['pick'](_0xe032e1[_0x881e('0x14')][_0x3cd715],[_0x881e('0x74'),'UserId','VoiceQueueId',_0x881e('0x75')])));return ami[_0x881e('0x76')]({'action':_0x881e('0x77'),'channel':_0xe032e1[_0x881e('0x14')][_0x3cd715][_0x881e('0x78')]})[_0x881e('0x79')](function(_0x2c3558){if(_0x2c3558[_0x881e('0x50')]===_0x881e('0x7a')){setTimeout(function(){if(_0xe032e1[_0x881e('0x14')][_0x3cd715]){ut[_0x881e('0x7b')](_0xe032e1[_0x881e('0x11')][_0xe032e1[_0x881e('0x14')][_0x3cd715]['queue']],'[clearZombieChannel]');if(_0xe032e1[_0x881e('0x14')][_0x3cd715][_0x881e('0x7c')]===!![]){ut[_0x881e('0x7d')](_0xe032e1[_0x881e('0x11')][_0xe032e1[_0x881e('0x14')][_0x3cd715][_0x881e('0x71')]],_0x881e('0x7e'));ut[_0x881e('0x7f')](_0x881e('0x80')+_0x3cd715,_0xe032e1['actions'][_0x3cd715][_0x881e('0x71')]);}ut[_0x881e('0x7f')](_0x881e('0x81')+_0x3cd715,_0xe032e1[_0x881e('0x14')][_0x3cd715][_0x881e('0x71')]);delete _0xe032e1['actions'][_0x3cd715];}},0x2328);}});}});};Preview[_0x881e('0xc')]['clearZombieChannels']=function(){var _0x5d4bb4=this;loggerAction[_0x881e('0x5d')](_0x881e('0x82'),_['size'](this[_0x881e('0x14')]));for(var _0x142ef8 in this[_0x881e('0x14')]){if(_0x5d4bb4[_0x881e('0x14')][_0x881e('0x6a')](_0x142ef8)){_0x5d4bb4[_0x881e('0x83')](_0x142ef8);}}};Preview[_0x881e('0xc')][_0x881e('0x6d')]=function(_0x4813bd){var _0x409a21=this;rpcDb[_0x881e('0x84')](_0x4813bd['id'],ut[_0x881e('0x85')](this[_0x881e('0x15')]))[_0x881e('0x86')](function(_0x14b712){if(!_[_0x881e('0x6e')](_0x14b712)){for(var _0x2f23d4=0x0;_0x2f23d4<_0x14b712[_0x881e('0x87')];_0x2f23d4+=0x1){if(ut[_0x881e('0x88')](_0x14b712[_0x2f23d4][_0x881e('0x89')])<_0x4813bd[_0x881e('0x8a')]*0x3c){if(_0x14b712[_0x2f23d4][_0x881e('0x8b')]&&!_0x14b712[_0x2f23d4][_0x881e('0x8b')]['voicePause']){_0x409a21[_0x881e('0x8c')](_0x14b712[_0x2f23d4]['id'])[_0x881e('0x86')](ut[_0x881e('0x8d')]('[RecallMe]'))['catch'](ut[_0x881e('0x8d')]('[RecallMe]'));}else{rpcDb['disableContact'](_0x14b712[_0x2f23d4]['id']);}}else{var _0xcea3b=new Action(_0x14b712[_0x2f23d4],_0x4813bd);_0xcea3b[_0x881e('0x8e')]=moment()[_0x881e('0x8f')]('YYYY-MM-DD\x20HH:mm:ss');_0x4813bd[_0x881e('0x43')]+=0x1;ut[_0x881e('0x90')](_0xcea3b,0x17,_0x881e('0x91'));if(_0x4813bd['dialRecallInQueue']){rpcDb['rescheduleContactInQueue'](ut['createBody'](_0x14b712[_0x2f23d4]));rpcDb[_0x881e('0x92')](_0xcea3b,_0x881e('0x93'));}else{ut[_0x881e('0x90')](_0xcea3b,0x16,_0x881e('0x94'));rpcDb[_0x881e('0x92')](_0xcea3b,'[HistoryRecallClose]');rpcDb[_0x881e('0x95')](_0xcea3b,_0x881e('0x96'));}}}}})['catch'](ut[_0x881e('0x8d')](_0x881e('0x97')));};Preview[_0x881e('0xc')]['setMessage']=function(_0x5015fe){_0x5015fe[_0x881e('0x62')]=!![];if(ut[_0x881e('0x98')](_0x5015fe[_0x881e('0x2c')])){_0x5015fe['message']='AGENTS_NOT_LOGGED';}else if(!ut[_0x881e('0x99')](_0x5015fe[_0x881e('0x36')])){_0x5015fe[_0x881e('0x50')]='NOT_ACTIVE';}else if(!this[_0x881e('0x9a')](_0x5015fe['Trunk'])){if(!this['isTrunkReachable'](_0x5015fe[_0x881e('0x9b')])){_0x5015fe[_0x881e('0x50')]='TRUNK_IS_NOT_REACHABLE';}else{_0x5015fe[_0x881e('0x50')]='ACTIVE';}}else{_0x5015fe[_0x881e('0x50')]='ACTIVE';}emitCampaignPreview(_0x5015fe);};Preview[_0x881e('0xc')][_0x881e('0x9c')]=function(_0x264308,_0xb04a60,_0xa8a264){var _0x1f065f=this;var _0xd06108=this[_0x881e('0x14')][_0xb04a60];var _0x595dac=this[_0x881e('0x11')][_0xd06108[_0x881e('0x71')]];var _0x1bbce9;if(_0x595dac){switch(_0xa8a264){case'1':_0x595dac[_0x881e('0x41')]+=0x1;_0xd06108[_0x881e('0x9d')]+=0x1;_0xd06108[_0x881e('0x9e')]=ut[_0x881e('0x9f')](_0xd06108);ut[_0x881e('0x90')](_0xd06108,0x0,_0x881e('0xa0'));ami[_0x881e('0x26')]('custom:agentnosuchnumber',ut[_0x881e('0xa1')](_0xd06108,_0x881e('0xa2')));rpcDb[_0x881e('0x92')](_0xd06108,'[callProgressDetectingCustomer][logNoSuch]');if(ut[_0x881e('0x9f')](_0xd06108)>=_0x595dac['dialGlobalMaxRetry']){_0x1bbce9=ut[_0x881e('0xa3')](_0xd06108,0xf,_0x881e('0xa4'));rpcDb[_0x881e('0x95')](_0x1bbce9,_0x881e('0xa5'));}else{if(_0xd06108[_0x881e('0x9d')]>=_0x595dac[_0x881e('0xa6')]){rpcDb[_0x881e('0x95')](_0xd06108,_0x881e('0xa5'));}else{rpcDb['rescheduleContact'](ut['scheduledAt'](_0xd06108,_0x881e('0x9d'),_0x595dac[_0x881e('0xa7')]),_0xd06108['unlockAgent'],_0xd06108[_0x881e('0xa8')]);}}delete this['actions'][_0x264308['linkedid']];break;case'ANSWER':var _0x2b229c=moment()['format'](_0x881e('0xa9'));_0xd06108['responsetime']=_0x2b229c;_0xd06108[_0x881e('0xaa')]=_0x2b229c;_0xd06108['dialAnswer']=!![];_0x595dac[_0x881e('0x2d')]+=0x1;logger[_0x881e('0x5d')](_0x881e('0xab'),_0xd06108['uniqueid'],_0x881e('0xac'),_0x595dac[_0x881e('0x29')],_0x881e('0x73'),_0x595dac[_0x881e('0x2d')]);ami[_0x881e('0x26')]('custom:agentconnect',ut['buildObj'](_0xd06108,_0x881e('0xad'),this['campaignsPreview'][_0xd06108[_0x881e('0x71')]]));if(_0x595dac['acw']){ami[_0x881e('0x26')](_0x881e('0xae'),ut[_0x881e('0xaf')](_0xd06108));}break;case'16':ami[_0x881e('0x26')]('custom:agentcomplete',ut[_0x881e('0xa1')](_0xd06108,'complete',this['campaignsPreview'][_0xd06108[_0x881e('0x71')]]));emitVoiceQueueChannelRemove(ut[_0x881e('0xa1')](_0xd06108,_0x881e('0xb0')));_0x595dac['outboundAnswerCallsDay']+=0x1;_0x595dac['total']+=0x1;_0x595dac[_0x881e('0xb1')]+=0x1;ut[_0x881e('0x7d')](_0x595dac,_0x881e('0xb2'));_0xd06108[_0x881e('0x9e')]=ut['totalGlobal'](_0xd06108);ut[_0x881e('0x90')](_0xd06108,0x4,_0x881e('0xb3'));rpcDb['createCustomerHistory'](_0xd06108,_0x881e('0xb4'));rpcDb[_0x881e('0x95')](_0xd06108,'[callProgressDetectingCustomer][logAnswerGlobal]');rpcDb[_0x881e('0xb5')](_0xd06108);_0x595dac[_0x881e('0x2f')]+=_0xd06108[_0x881e('0xb6')];_0x595dac[_0x881e('0x2e')]+=_0xd06108[_0x881e('0xb6')];logger[_0x881e('0x5d')](_0x881e('0xb7'),_0xd06108[_0x881e('0xb8')],_0x881e('0xac'),_0x595dac[_0x881e('0x29')],_0x881e('0x73'),_0x595dac[_0x881e('0x2d')]);delete this[_0x881e('0x14')][_0x264308[_0x881e('0xb9')]];break;case _0x881e('0xba'):_0x595dac[_0x881e('0x3d')]+=0x1;_0xd06108['countbusyretry']+=0x1;_0xd06108['countglobal']=ut[_0x881e('0x9f')](_0xd06108);ut['logCustomer'](_0xd06108,0x5,_0x881e('0xbb'));ami[_0x881e('0x26')](_0x881e('0xbc'),ut[_0x881e('0xa1')](_0xd06108,'busy'));rpcDb[_0x881e('0x92')](_0xd06108,_0x881e('0xbd'));if(ut[_0x881e('0x9f')](_0xd06108)>=_0x595dac[_0x881e('0xbe')]){_0x1bbce9=ut[_0x881e('0xa3')](_0xd06108,0xf,_0x881e('0xa4'));rpcDb[_0x881e('0x95')](_0x1bbce9,'[callProgressDetectingCustomer][logBusyGlobal]');}else{if(_0xd06108['countbusyretry']>=_0x595dac[_0x881e('0xbf')]){rpcDb[_0x881e('0x95')](_0xd06108,_0x881e('0xbd'));}else{rpcDb[_0x881e('0xc0')](ut[_0x881e('0xc1')](_0xd06108,'countbusyretry',_0x595dac[_0x881e('0xc2')]),_0xd06108[_0x881e('0xc3')],_0xd06108[_0x881e('0xa8')]);}}break;case _0x881e('0xc4'):_0x595dac[_0x881e('0x40')]+=0x1;_0xd06108[_0x881e('0xc5')]+=0x1;_0xd06108['countglobal']=ut['totalGlobal'](_0xd06108);ut['logCustomer'](_0xd06108,0x3,_0x881e('0xc6'));ami[_0x881e('0x26')](_0x881e('0xc7'),ut[_0x881e('0xa1')](_0xd06108,_0x881e('0xc8')));rpcDb['createCustomerHistory'](_0xd06108,_0x881e('0xc9'));if(ut[_0x881e('0x9f')](_0xd06108)>=_0x595dac[_0x881e('0xbe')]){_0x1bbce9=ut[_0x881e('0xa3')](_0xd06108,0xf,_0x881e('0xa4'));rpcDb[_0x881e('0x95')](_0x1bbce9,_0x881e('0xca'));}else{if(_0xd06108[_0x881e('0xc5')]>=_0x595dac[_0x881e('0xcb')]){rpcDb['createCustomerFinal'](_0xd06108,_0x881e('0xc9'));}else{rpcDb[_0x881e('0xc0')](ut[_0x881e('0xc1')](_0xd06108,_0x881e('0xc5'),_0x595dac[_0x881e('0xcc')]),_0xd06108[_0x881e('0xc3')],_0xd06108['activeContact']);}}break;case _0x881e('0xcd'):_0x595dac[_0x881e('0xce')]+=0x1;_0xd06108[_0x881e('0xcf')]+=0x1;_0xd06108[_0x881e('0x9e')]=ut['totalGlobal'](_0xd06108);ut[_0x881e('0x90')](_0xd06108,0x8,_0x881e('0xd0'));ami[_0x881e('0x26')](_0x881e('0xd1'),ut['buildObj'](_0xd06108,_0x881e('0xd2')));rpcDb[_0x881e('0x92')](_0xd06108,_0x881e('0xd3'));if(ut[_0x881e('0x9f')](_0xd06108)>=_0x595dac[_0x881e('0xbe')]){_0x1bbce9=ut['cloneAction'](_0xd06108,0xf,_0x881e('0xa4'));rpcDb[_0x881e('0x95')](_0x1bbce9,_0x881e('0xd4'));}else{if(_0xd06108[_0x881e('0xcf')]>=_0x595dac[_0x881e('0xd5')]){rpcDb[_0x881e('0x95')](_0xd06108,_0x881e('0xd3'));}else{rpcDb['rescheduleContact'](ut[_0x881e('0xc1')](_0xd06108,_0x881e('0xcf'),_0x595dac['dialBusyRetryFrequency']),_0xd06108[_0x881e('0xc3')],_0xd06108[_0x881e('0xa8')]);}}break;case _0x881e('0xd6'):_0x595dac['outboundRejectCallsDay']+=0x1;_0xd06108[_0x881e('0xd7')]+=0x1;_0xd06108['countglobal']=ut['totalGlobal'](_0xd06108);ut[_0x881e('0x90')](_0xd06108,0x14,_0x881e('0xd8'));ami[_0x881e('0x26')]('custom:agentreject',ut[_0x881e('0xa1')](_0xd06108,_0x881e('0xd9')));rpcDb[_0x881e('0x92')](_0xd06108,'[syncHangupRequest][logAgentReject]');if(ut['totalGlobal'](_0xd06108)>=_0x595dac[_0x881e('0xbe')]){_0x1bbce9=ut[_0x881e('0xa3')](_0xd06108,0x14,'AgentReject');rpcDb[_0x881e('0x95')](_0x1bbce9,_0x881e('0xda'));}else{if(_0xd06108['countagentrejectretry']>=_0x595dac[_0x881e('0xdb')]){rpcDb[_0x881e('0x95')](_0xd06108,_0x881e('0xda'));}else{rpcDb[_0x881e('0xc0')](ut[_0x881e('0xc1')](_0xd06108,'countagentrejectretry',_0x595dac[_0x881e('0xdc')]),_0xd06108[_0x881e('0xc3')],_0xd06108[_0x881e('0xa8')]);}}break;case _0x881e('0xdd'):_0x595dac[_0x881e('0x46')]+=0x1;_0xd06108[_0x881e('0xde')]+=0x1;_0xd06108[_0x881e('0x9e')]=ut[_0x881e('0x9f')](_0xd06108);ut[_0x881e('0x90')](_0xd06108,0xb,_0x881e('0xdf'));rpcDb['createCustomerHistory'](_0xd06108,'[callProgressDetectingCustomer][logAbandoned]');if(ut[_0x881e('0x9f')](_0xd06108)>=_0x595dac['dialGlobalMaxRetry']){_0x1bbce9=ut['cloneAction'](_0xd06108,0xf,_0x881e('0xa4'));rpcDb[_0x881e('0x95')](_0x1bbce9,_0x881e('0xe0'));}else{if(_0xd06108[_0x881e('0xe1')]>=_0x595dac[_0x881e('0xe2')]){rpcDb['createCustomerFinal'](_0xd06108,_0x881e('0xe0'));}else{rpcDb[_0x881e('0xc0')](ut[_0x881e('0xc1')](_0xd06108,_0x881e('0xde'),_0x595dac[_0x881e('0xe3')]),_0xd06108[_0x881e('0xc3')],_0xd06108[_0x881e('0xa8')]);}}break;case'18':_0x595dac[_0x881e('0x45')]+=0x1;_0xd06108['countmachineretry']+=0x1;_0xd06108[_0x881e('0x9e')]=ut[_0x881e('0x9f')](_0xd06108);ut[_0x881e('0x90')](_0xd06108,0x12,_0x264308[_0x881e('0xe4')]||_0x264308[_0x881e('0xe5')]);ami[_0x881e('0x26')](_0x881e('0xe6'),ut[_0x881e('0xa1')](_0xd06108,'amd'));rpcDb[_0x881e('0x92')](_0xd06108,_0x881e('0xe7'));if(ut[_0x881e('0x9f')](_0xd06108)>=_0x595dac[_0x881e('0xbe')]){_0x1bbce9=ut[_0x881e('0xa3')](_0xd06108,0xf,_0x881e('0xa4'));rpcDb[_0x881e('0x95')](_0x1bbce9,_0x881e('0xe7'));}else{rpcDb['createCustomerFinal'](_0xd06108,_0x881e('0xe7'));}delete this[_0x881e('0x14')][_0x264308[_0x881e('0xb9')]];break;case'19':_0x595dac['outboundUnknownCallsDay']+=0x1;_0xd06108['countglobal']=ut[_0x881e('0x9f')](_0xd06108);ut['logCustomer'](_0xd06108,0x13,_0x264308[_0x881e('0xe4')]||_0x264308[_0x881e('0xe5')]);ami['emit'](_0x881e('0xe6'),ut[_0x881e('0xa1')](_0xd06108,'amd'));rpcDb[_0x881e('0x92')](_0xd06108,_0x881e('0xe8'));if(ut[_0x881e('0x9f')](_0xd06108)>=_0x595dac[_0x881e('0xbe')]){_0x1bbce9=ut[_0x881e('0xa3')](_0xd06108,0xf,'Global');rpcDb[_0x881e('0x95')](_0x1bbce9,_0x881e('0xe8'));}else{rpcDb[_0x881e('0x95')](_0xd06108,_0x881e('0xe8'));}delete this[_0x881e('0x14')][_0x264308[_0x881e('0xb9')]];break;default:if(_0xd06108[_0x881e('0x7c')]){ut[_0x881e('0x7d')](_0x595dac,_0x881e('0xe9'));ut[_0x881e('0x7f')](_0x881e('0xea')+_0x595dac[_0x881e('0x29')],_0x264308);}_0x595dac[_0x881e('0x45')]+=0x1;_0xd06108[_0x881e('0x9e')]=ut['totalGlobal'](_0xd06108);ut[_0x881e('0x90')](_0xd06108,0xc,_0x264308[_0x881e('0xe4')]||_0x264308[_0x881e('0xe5')]);rpcDb['createCustomerHistory'](_0xd06108,_0x881e('0xeb'));if(ut['totalGlobal'](_0xd06108)>=_0x595dac[_0x881e('0xbe')]){_0x1bbce9=ut[_0x881e('0xa3')](_0xd06108,0xf,_0x881e('0xa4'));rpcDb[_0x881e('0x95')](_0x1bbce9,'[callProgressDetectingCustomer][logUnknownGlobal]');}else{rpcDb['createCustomerFinal'](_0xd06108,_0x881e('0xec'));}delete this[_0x881e('0x14')][_0x264308[_0x881e('0xb9')]];}if(!(_0xd06108['dialAnswer']&&_0xa8a264==='16')){ut[_0x881e('0x7b')](_0x595dac,_0x881e('0xed'));logger[_0x881e('0x5d')](_0x881e('0xee'),_0xd06108[_0x881e('0xb8')],_0x881e('0xac'),_0x595dac['name'],_0x881e('0x72'),_0x595dac['originated']);}if(_0xa8a264!=='ANSWER'){delete this['actions'][_0x264308[_0x881e('0xb9')]];delete this[_0x881e('0x14')][_0x264308[_0x881e('0xef')]];}}};Preview['prototype'][_0x881e('0xf0')]=function(_0x1ff1d0,_0x36cd86,_0x12ae18){if(_[_0x881e('0xf1')](_0x36cd86)&&_0x881e('0xf2')!==typeof _0x36cd86){return;}if(_[_0x881e('0xf1')](_0x12ae18)&&'object'!==typeof _0x12ae18){return;}switch(_0x12ae18[_0x881e('0xf3')]){case'0':ut[_0x881e('0xf4')](_0x1ff1d0,0x0,_0x881e('0xa0'));rpcDb[_0x881e('0xf5')](_0x1ff1d0,'[callProgressDetectingAgent][logNoSuch]');break;case'3':ut['logAgent'](_0x1ff1d0,0x3,_0x881e('0xc6'));rpcDb[_0x881e('0xf5')](_0x1ff1d0,_0x881e('0xf6'));break;case'5':ut['logAgent'](_0x1ff1d0,0x5,'Busy');rpcDb['createAgentHistory'](_0x1ff1d0,_0x881e('0xf7'));break;case'8':ut[_0x881e('0xf4')](_0x1ff1d0,0x8,'Congestion');rpcDb[_0x881e('0xf5')](_0x1ff1d0,'[callProgressDetectingAgent][logCongestion]');break;case'22':ut[_0x881e('0xf4')](_0x1ff1d0,0x16,_0x881e('0xf8'));rpcDb['createAgentHistory'](_0x1ff1d0,_0x881e('0xf9'));break;default:ut[_0x881e('0xf4')](_0x1ff1d0,0xc,_0x12ae18[_0x881e('0xf3')]);rpcDb['createAgentHistory'](_0x1ff1d0,_0x881e('0xfa'));}ut[_0x881e('0x7b')](_0x36cd86,_0x881e('0xfb'));logger['info'](_0x881e('0xfc'),_0x1ff1d0[_0x881e('0xb8')],'\x20Queue',_0x36cd86[_0x881e('0x29')],_0x881e('0x72'),_0x36cd86['originated']);delete this[_0x881e('0x14')][_0x1ff1d0[_0x881e('0xb8')]];};Preview['prototype'][_0x881e('0xfd')]=function(_0x57e528,_0x1601c1,_0x21d3f9,_0x3a1a32,_0x378b34){var _0x3d56e9=this;return new BPromise(function(_0x592d3b,_0x44220e){if(_[_0x881e('0x6e')](_0x1601c1)||_[_0x881e('0x6e')](_0x1601c1[_0x881e('0xfe')])||_[_0x881e('0x6e')](_0x1601c1[_0x881e('0xfe')][_0x881e('0xff')])||_[_0x881e('0x6e')](_0x1601c1[_0x881e('0x100')])){_0x44220e(ut[_0x881e('0x50')]('Contact\x20is\x20undefined',_0x3a1a32,_0x378b34));return;}var _0x502740=uuid['v4']();var _0x28dbe6=_0x3d56e9[_0x881e('0x11')][_0x1601c1[_0x881e('0x70')][_0x881e('0x29')]];var _0x1fc9a5=_0x21d3f9?_0x3d56e9[_0x881e('0x15')][_0x21d3f9]['id']:undefined;_0x3d56e9['actions'][_0x502740]=new Action(_0x1601c1,_0x28dbe6,_0x502740,_0x21d3f9,_0x1fc9a5);var _0x444099=_0x3d56e9['actions'][_0x502740];_0x444099[_0x881e('0xc3')]=_0x3a1a32;_0x444099[_0x881e('0xa8')]=_0x378b34;_0x444099[_0x881e('0x101')]=_0x21d3f9;if(_[_0x881e('0x102')](_0x57e528)){_0x3d56e9[_0x881e('0x103')](_0x444099,_0x28dbe6,_0x1601c1,_0x21d3f9)[_0x881e('0x86')](function(_0x4fec83){logger[_0x881e('0x5d')](_0x881e('0x104'),_0x881e('0x105')+_0x444099[_0x881e('0x71')]+_0x881e('0x106')+_0x444099['idContact'],JSON[_0x881e('0x5b')](_0x4fec83));ami['emit'](_0x881e('0x107'),ut[_0x881e('0xa1')](_0x444099,'called',_0x3d56e9[_0x881e('0x11')][_0x444099[_0x881e('0x71')]]));_0x592d3b(ut[_0x881e('0x50')](_0x881e('0x108')));})[_0x881e('0x79')](function(_0x36666f){ut['logger'](_0x881e('0x109'),_0x36666f);_0x44220e(ut['message'](_0x881e('0x10a'),_0x3a1a32,_0x378b34));});}else{_0x28dbe6['outboundBlacklistCallsDay']+=0x1;ut[_0x881e('0x10b')](_0x444099);rpcDb[_0x881e('0x10c')](_0x444099,_0x881e('0x10d'));delete _0x3d56e9[_0x881e('0x14')][_0x502740];_0x44220e(ut['message']('Contact\x20in\x20black\x20List',_0x3a1a32,_0x378b34));}});};Preview[_0x881e('0xc')][_0x881e('0x9a')]=function(_0x36f601){return!_[_0x881e('0x6e')](_0x36f601)&&!_['isNil'](_0x36f601[_0x881e('0x29')])&&!_[_0x881e('0x6e')](_0x36f601[_0x881e('0x58')])&&_0x36f601[_0x881e('0x58')]&&!_[_0x881e('0x6e')](this[_0x881e('0x13')][util['format'](_0x881e('0x10e'),_0x36f601['name'])])&&!_[_0x881e('0x6e')](this[_0x881e('0x13')][util[_0x881e('0x8f')](_0x881e('0x10e'),_0x36f601['name'])][_0x881e('0x77')])&&(this[_0x881e('0x13')][util[_0x881e('0x8f')](_0x881e('0x10e'),_0x36f601[_0x881e('0x29')])][_0x881e('0x77')]==='reachable'||this[_0x881e('0x13')][util[_0x881e('0x8f')](_0x881e('0x10e'),_0x36f601['name'])]['status']===_0x881e('0x10f'));};Preview[_0x881e('0xc')]['run']=function(_0x4bc6d3,_0x894cc0){var _0x1f9ada=this;return new BPromise(function(_0x47f82a,_0x1a88ab){_0x1f9ada['execRun'](_0x4bc6d3,_0x894cc0)[_0x881e('0x86')](function(_0x3cf1c6){_0x47f82a(_[_0x881e('0x110')](_0x3cf1c6,[_0x881e('0x50')]));})[_0x881e('0x79')](function(_0x1199e6){if(_0x1199e6[_0x881e('0x111')]){rpcDb['unlockContact'](_0x4bc6d3);}if(_0x1199e6[_0x881e('0x58')]){rpcDb[_0x881e('0x112')](_0x4bc6d3);}_0x1a88ab(_['pick'](_0x1199e6,['message']));});});};Preview[_0x881e('0xc')][_0x881e('0x113')]=function(_0x371a14,_0x3cf3a4){var _0x1881e2=this;return new BPromise(function(_0xf151db,_0x4aa1b2){var _0x1c1531,_0x5a2968;rpcDb['getContactPreview'](_0x371a14)[_0x881e('0x86')](function(_0x2711e8){if(!_[_0x881e('0x6e')](_0x2711e8[0x0])){_0x5a2968=_0x2711e8[0x0][_0x881e('0x114')]?![]:!![];_0x1c1531=_0x2711e8[0x0][_0x881e('0x114')]?!![]:![];_0x1c1531=_0x3cf3a4?!![]:_0x1c1531;}var _0x35d27c=_0x1881e2[_0x881e('0x115')](_0x2711e8);if(_0x35d27c[_0x881e('0x116')]){rpcDb[_0x881e('0x117')](_[_0x881e('0x110')](_0x2711e8[0x0],[_0x881e('0x100'),'Contact.phone']))[_0x881e('0x86')](function(_0xf8a898){_0x1881e2[_0x881e('0xfd')](_0xf8a898,_0x2711e8[0x0],_0x3cf3a4,_0x5a2968,_0x1c1531)['then'](function(_0x1f58f5){_0xf151db(_0x1f58f5);})[_0x881e('0x79')](function(_0x13ecd9){_0x4aa1b2(_0x13ecd9);});})[_0x881e('0x79')](function(_0x1fc0f4){ut[_0x881e('0x65')](_0x881e('0x118'),_0x1fc0f4);_0x4aa1b2(ut[_0x881e('0x50')](_0x881e('0x119'),_0x5a2968,_0x1c1531));});}else{_0x4aa1b2(ut[_0x881e('0x50')](_0x35d27c[_0x881e('0x50')],_0x5a2968,_0x1c1531));}})[_0x881e('0x79')](function(_0x3ee1ad){ut[_0x881e('0x65')]('[Preview][getContactPreview]',_0x3ee1ad);_0x4aa1b2(ut[_0x881e('0x50')]('Call\x20unsuccessful',![],!![]));});});};Preview[_0x881e('0xc')][_0x881e('0x115')]=function(_0x535869){if(_[_0x881e('0x6e')](_0x535869)||_[_0x881e('0x102')](_0x535869)||!_['isNil'](_0x535869[0x0][_0x881e('0x8b')])&&_[_0x881e('0x6e')](_0x535869[0x0][_0x881e('0x8b')][_0x881e('0x29')])){ut[_0x881e('0x65')]('[Preview][validateContact][Empty\x20Contact]',_0x535869);return{'isValid':![],'message':'Empty\x20Contact'};}var _0xdfd96a=this[_0x881e('0x11')][_0x535869[0x0][_0x881e('0x70')][_0x881e('0x29')]];_0xdfd96a[_0x881e('0x50')]=_0x881e('0x11a');if(_[_0x881e('0x6e')](_0xdfd96a)){ut[_0x881e('0x65')](_0x881e('0x11b'),_0xdfd96a);return{'isValid':![],'message':_0x881e('0x11c')};}if(!this['isTrunkReachable'](_0xdfd96a[_0x881e('0x57')])){ut[_0x881e('0x65')](_0x881e('0x11d'),_0x881e('0x11e')+_0xdfd96a[_0x881e('0x29')]+_0x881e('0x11f'));if(!this[_0x881e('0x9a')](_0xdfd96a[_0x881e('0x9b')])){ut[_0x881e('0x65')](_0x881e('0x11d'),_0xdfd96a[_0x881e('0x29')]+_0x881e('0x120'));return{'isValid':![],'message':_0x881e('0x121')};}}if(!ut[_0x881e('0x99')](_0xdfd96a[_0x881e('0x36')])){ut[_0x881e('0x65')](_0x881e('0x122'),_0xdfd96a[_0x881e('0x29')]+_0x881e('0x123'));return{'isValid':![],'message':'campaign\x20Name:\x20'+_0xdfd96a[_0x881e('0x29')]+_0x881e('0x123')};}return{'isValid':!![],'message':_0x881e('0x124')};};Preview[_0x881e('0xc')]['execCall']=function(_0x224a8e,_0x56ffae,_0x485bc,_0x2cf3d6){var _0x252d69=this;return new BPromise(function(_0x56465e,_0x1bc20f){var _0x2e9eed=_0x224a8e[_0x881e('0xb8')];var _0x41f7c3=_0x252d69['isTrunkReachable'](_0x56ffae[_0x881e('0x57')])?util['format'](_0x881e('0x125'),_0x56ffae['Trunk'][_0x881e('0x29')],_[_0x881e('0x6e')](_0x56ffae[_0x881e('0x39')])?'':_0x56ffae[_0x881e('0x39')][_0x881e('0x126')]()||'',_0x56ffae['dialCutDigit']>0x0?_0x485bc[_0x881e('0xfe')][_0x881e('0xff')][_0x881e('0x127')](_0x56ffae['dialCutDigit']):_0x485bc[_0x881e('0xfe')][_0x881e('0xff')]):util['format'](_0x881e('0x125'),_['isNil'](_0x56ffae[_0x881e('0x9b')])?_0x56ffae[_0x881e('0x57')]['name']:_0x56ffae[_0x881e('0x9b')][_0x881e('0x29')],_[_0x881e('0x6e')](_0x56ffae[_0x881e('0x39')])?'':_0x56ffae[_0x881e('0x39')][_0x881e('0x126')]()||'',_0x56ffae[_0x881e('0x128')]>0x0?_0x485bc[_0x881e('0xfe')]['phone'][_0x881e('0x127')](_0x56ffae[_0x881e('0x128')]):_0x485bc[_0x881e('0xfe')]['phone']);var _0x4faa4a=_0x252d69[_0x881e('0x9a')](_0x56ffae['Trunk'])?ut[_0x881e('0x129')](_0x56ffae[_0x881e('0x57')][_0x881e('0x59')],_0x56ffae[_0x881e('0x12a')],_0x56ffae['dialRandomLastDigitCallerIdNumber']>0x0?ut['getCallerIdRandom'](_0x56ffae[_0x881e('0x37')],_0x56ffae['dialRandomLastDigitCallerIdNumber']):_0x56ffae[_0x881e('0x37')]):ut[_0x881e('0x129')](_[_0x881e('0x6e')](_0x56ffae['TrunkBackup'])?_0x56ffae['Trunk'][_0x881e('0x59')]:_0x56ffae['TrunkBackup'][_0x881e('0x59')],_0x56ffae[_0x881e('0x12a')],_0x56ffae['dialRandomLastDigitCallerIdNumber']>0x0?ut[_0x881e('0x12b')](_0x56ffae['dialOriginateCallerIdNumber'],_0x56ffae['dialRandomLastDigitCallerIdNumber']):_0x56ffae['dialOriginateCallerIdNumber']);if(_0x4faa4a){_0x224a8e[_0x881e('0x12c')]=ut['extractCalleridName'](_0x4faa4a);_0x224a8e[_0x881e('0x12d')]=ut[_0x881e('0x12e')](_0x4faa4a);}var _0x6978a3=ut[_0x881e('0x12f')](_0x56ffae,_0x485bc,_0x41f7c3,_0x4faa4a,_0x2e9eed,_0x224a8e);_['merge'](_0x224a8e,ut[_0x881e('0x130')](_0x6978a3));_0x224a8e[_0x881e('0x8e')]=moment()['format'](_0x881e('0xa9'));ami[_0x881e('0x76')](ut[_0x881e('0x131')](_0x224a8e,_0x56ffae,_0x6978a3,_0x224a8e[_0x881e('0xa8')],_0x2cf3d6))['then'](function(_0x5b1a8f){var _0x3dab4a=_0x224a8e['channelAgent'];if(!_['isNil'](_0x3dab4a)){if(!_['isNil'](_0x252d69[_0x881e('0x15')][_0x3dab4a])){_0x252d69['agents'][_0x3dab4a][_0x881e('0x132')]=_0x224a8e[_0x881e('0x133')];emit(util[_0x881e('0x8f')](_0x881e('0x134'),_0x252d69[_0x881e('0x15')][_0x3dab4a][_0x881e('0x29')]),_0x881e('0x135'),{'destaccountcode':_0x252d69['agents'][_0x3dab4a]['accountcode'],'destconnectedlinenum':_0x224a8e[_0x881e('0x133')]});}}_0x56ffae[_0x881e('0x51')]+=0x1;logger[_0x881e('0x5d')]('[originated][increment]',_0x2e9eed,'\x20Queue',_0x56ffae['name'],_0x881e('0x72'),_0x56ffae[_0x881e('0x51')]);_0x56465e(_0x5b1a8f);})['catch'](function(_0x9057e7){ut[_0x881e('0xf4')](_0x224a8e,0xe,_0x881e('0x136'));rpcDb[_0x881e('0xf5')](_0x224a8e,_0x881e('0x137'));_0x1bc20f(_0x9057e7);});});};Preview[_0x881e('0xc')]['syncNewExten']=function(_0x263e20){if(this[_0x881e('0x14')][_0x263e20[_0x881e('0xb9')]]){this[_0x881e('0x14')][_0x263e20['linkedid']][_0x881e('0x78')]=_0x263e20[_0x881e('0x78')];}};Preview[_0x881e('0xc')][_0x881e('0x18')]=function(_0x23e484){var _0x342a8a=this;var _0x555120=this['actions'][_0x23e484[_0x881e('0x138')]];if(_0x555120){if(_0x555120[_0x881e('0x101')]&&this[_0x881e('0x15')][_0x555120['lookAgent']]){ut[_0x881e('0x139')](_0x555120,this[_0x881e('0x15')][_0x555120[_0x881e('0x101')]][_0x881e('0x29')],this[_0x881e('0x15')][_0x555120[_0x881e('0x101')]]['id']);}var _0x508e6c=_[_0x881e('0x13a')](_0x555120);_0x508e6c[_0x881e('0x13b')]=moment()['format'](_0x881e('0xa9'));var _0x4eeeb0=_0x342a8a[_0x881e('0x11')][_0x555120[_0x881e('0x71')]];if(ut[_0x881e('0x13c')](_0x23e484[_0x881e('0x13d')])){if(_0x555120[_0x881e('0xc3')]){rpcDb[_0x881e('0x13e')](_0x555120['idContact']);}if(_0x555120[_0x881e('0xa8')]){rpcDb['disableContact'](_0x555120['idContact']);}ami[_0x881e('0x26')](_0x881e('0x13f'),ut[_0x881e('0xa1')](_0x555120,_0x881e('0x140'),this[_0x881e('0x11')][_0x555120[_0x881e('0x71')]]));this[_0x881e('0xf0')](_0x508e6c,_0x4eeeb0,_0x23e484);}else{_0x555120[_0x881e('0x8e')]=moment()[_0x881e('0x8f')]('YYYY-MM-DD\x20HH:mm:ss');ut[_0x881e('0xf4')](_0x508e6c,0x4,_0x881e('0xb3'));rpcDb[_0x881e('0xf5')](_0x508e6c,'[callProgressDetectingAgent][logAnswer]');}}};Preview[_0x881e('0xc')]['syncHangup']=function(_0x556b42){var _0x224ab9=this;var _0x5b52cc=this[_0x881e('0x14')][_0x556b42[_0x881e('0xb9')]];var _0xfffddf;if(_0x5b52cc){_0xfffddf=this[_0x881e('0x11')][_0x5b52cc[_0x881e('0x71')]];logger[_0x881e('0x5d')](_0x881e('0x141'),_0x556b42[_0x881e('0xb9')],_0x881e('0xac'),_0xfffddf[_0x881e('0x29')],_0x881e('0x73'),_0xfffddf[_0x881e('0x2d')]);}if(this['actions'][_0x556b42[_0x881e('0xb9')]]&&_0x556b42[_0x881e('0xb9')]!==_0x556b42['uniqueid']){if(_0x556b42[_0x881e('0x142')]==='16'&&this[_0x881e('0x14')][_0x556b42[_0x881e('0xb9')]][_0x881e('0x7c')]){this[_0x881e('0x9c')](_0x556b42,_0x556b42['linkedid'],_0x556b42[_0x881e('0x142')]);}else if(this[_0x881e('0x14')][_0x556b42[_0x881e('0xb9')]][_0x881e('0x7c')]){logger[_0x881e('0x5d')]('[syncHangup][talking][cause]',_0x556b42['linkedid'],_0x556b42['cause'],_0x881e('0xac'),_0xfffddf[_0x881e('0x29')],_0x881e('0x73'),_0xfffddf['pTalking']);this[_0x881e('0x9c')](_0x556b42,_0x556b42[_0x881e('0xb9')],_0x556b42[_0x881e('0x142')]);}}else if(_0x5b52cc&&_[_0x881e('0x6e')](_0x5b52cc['statedesc'])&&_0xfffddf['dialQueueProject']&&_0x556b42[_0x881e('0xb9')]===_0x556b42[_0x881e('0xb8')]&&_['isNil'](_0x556b42[_0x881e('0xf3')])&&_0x556b42[_0x881e('0x142')]==='16'&&_0x556b42[_0x881e('0x143')]==='6'&&_[_0x881e('0xf1')](_0x5b52cc[_0x881e('0x144')])){if(_0x5b52cc['unlockAgent']){rpcDb[_0x881e('0x13e')](_0x5b52cc[_0x881e('0x145')]);}if(_0x5b52cc[_0x881e('0xa8')]){rpcDb[_0x881e('0x112')](_0x5b52cc['idContact']);}_0x556b42[_0x881e('0xf3')]='22';this[_0x881e('0xf0')](_0x5b52cc,_0xfffddf,_0x556b42);}else if(_0x5b52cc&&_0x5b52cc[_0x881e('0x144')]){if(_0x556b42[_0x881e('0x142')]==='16'&&this[_0x881e('0x14')][_0x556b42['linkedid']][_0x881e('0x7c')]){logger['info'](_0x881e('0x146'),_0x556b42[_0x881e('0xb9')],_0x556b42['cause'],_0x881e('0xac'),_0xfffddf[_0x881e('0x29')],_0x881e('0x73'),_0xfffddf[_0x881e('0x2d')]);this[_0x881e('0x9c')](_0x556b42,_0x556b42[_0x881e('0xb9')],_0x556b42[_0x881e('0x142')]);}else if(this['actions'][_0x556b42[_0x881e('0xb9')]]['dialAnswer']){logger[_0x881e('0x5d')](_0x881e('0x147'),_0x556b42[_0x881e('0xb9')],_0x556b42[_0x881e('0x142')],_0x881e('0xac'),_0xfffddf[_0x881e('0x29')],_0x881e('0x73'),_0xfffddf[_0x881e('0x2d')]);this[_0x881e('0x9c')](_0x556b42,_0x556b42[_0x881e('0xb9')],_0x556b42['cause']);}}};Preview[_0x881e('0xc')]['syncDialEnd']=function(_0x106bd1){if(this[_0x881e('0x14')][_0x106bd1['destlinkedid']]&&_0x106bd1[_0x881e('0xef')]!==_0x106bd1[_0x881e('0x148')]){this[_0x881e('0x9c')](_0x106bd1,_0x106bd1['destlinkedid'],_0x106bd1[_0x881e('0xe5')]);}};Preview[_0x881e('0xc')][_0x881e('0x1b')]=function(_0x10bb75){if(this[_0x881e('0x14')][_0x10bb75[_0x881e('0xb9')]]&&_0x10bb75[_0x881e('0xb9')]!==_0x10bb75[_0x881e('0xb8')]&&!this[_0x881e('0x14')][_0x10bb75[_0x881e('0xb9')]][_0x881e('0x7c')]){if(_0x10bb75[_0x881e('0x142')]==='1'){this[_0x881e('0x9c')](_0x10bb75,_0x10bb75[_0x881e('0xb9')],_0x10bb75[_0x881e('0x142')]);}}};Preview[_0x881e('0xc')][_0x881e('0x149')]=function(_0x425e8b,_0x22113e,_0x3da6b0){if(this[_0x881e('0x14')][_0x425e8b]){if(_['isNil'](this[_0x881e('0x14')][_0x425e8b][_0x881e('0x14a')])){this[_0x881e('0x14')][_0x425e8b][_0x881e('0x14a')]={};}this[_0x881e('0x14')][_0x425e8b][_0x881e('0x14a')][_0x22113e]=_0x3da6b0;}};Preview[_0x881e('0xc')][_0x881e('0x20')]=function(_0x436605){try{if(!_[_0x881e('0x6e')](_0x436605)){if(ut[_0x881e('0x14b')](_[_0x881e('0x14c')](_0x436605[_0x881e('0x14d')])[0x0])){this[_0x881e('0x149')](_0x436605[_0x881e('0xb8')],_[_0x881e('0x14c')](_0x436605['variable'])[0x0],_0x436605[_0x881e('0x14e')]);}}}catch(_0x4d4a26){logger[_0x881e('0x14f')]('[syncVarSet][Preview]',util[_0x881e('0x150')](_0x4d4a26,{'showHidden':![],'depth':null}));}};Preview[_0x881e('0xc')][_0x881e('0x22')]=function(_0x4fcaf3){if(_0x4fcaf3){if(this['actions'][_0x4fcaf3[_0x881e('0x151')]]){this['actions'][_0x4fcaf3[_0x881e('0x151')]][_0x881e('0x144')]=!![];}}};Preview[_0x881e('0xc')][_0x881e('0x24')]=function(_0x4113f6){if(_0x4113f6){if(this[_0x881e('0x14')][_0x4113f6[_0x881e('0x152')]]){this[_0x881e('0x14')][_0x4113f6[_0x881e('0x152')]]['transfer']=!![];}}};module[_0x881e('0x153')]=Preview; \ No newline at end of file +var _0x3041=['[clearZombieChannels][talking]','Queue','queue','dialAnswer','pick','contactId','UserId','VoiceQueueId','ListId','Action','channel','catch','[clearZombieChannel]','loggerError','[Dialer][checkChannel][pTalking][Preview]','[Dialer][checkChannel][Preview]','clearZombieChannel','agentReadyId','then','length','getDiff','scheduledat','dialRecallMeTimeout','Agent','logger2','[RecallMe]','disableContact','starttime','YYYY-MM-DD\x20HH:mm:ss','dialRecallInQueue','rescheduleContactInQueue','createBody','[HistoryDialRecallInQueue][historyCatch]','RecallFailedTimeout','createCustomerHistory','[HistoryRecallClose]','createCustomerFinal','[getContactRecallMe]','setMessage','IsNotLoggedIn','AGENTS_NOT_LOGGED','isActive','isTrunkReachable','TrunkBackup','TRUNK_IS_NOT_REACHABLE','ACTIVE','callProgressDetectingCustomer','countnosuchnumberretry','countglobal','logCustomer','NoSuchNumber','custom:agentnosuchnumber','buildObj','nosuchnumber','[callProgressDetectingCustomer][logNoSuch]','dialGlobalMaxRetry','cloneAction','Global','dialNoSuchNumberMaxRetry','[callProgressDetectingCustomer][logNoSuchGlobal]','rescheduleContact','dialNoSuchNumberRetryFrequency','activeContact','linkedid','ANSWER','responsetime','answertime','[syncHangup][talking][increment]','uniqueid','\x20Queue','pTalking:\x20','acw','buildAcw','custom:agentcomplete','complete','decrementTalkink','Answer','[callProgressDetectingCustomer][logAnswer]','[callProgressDetectingCustomer][logAnswerGlobal]','talktime','BUSY','countbusyretry','totalGlobal','Busy','custom:agentbusy','[callProgressDetectingCustomer][logBusy]','[callProgressDetectingCustomer][logBusyGlobal]','dialBusyRetryFrequency','unlockAgent','NOANSWER','countnoanswerretry','NoAnswer','custom:agentnoanswer','noanswer','[callProgressDetectingCustomer][logNoAnswer]','[callProgressDetectingCustomer][logNoAnswerGlobal]','dialNoAnswerMaxRetry','scheduledAt','dialNoAnswerRetryFrequency','CONGESTION','countcongestionretry','Congestion','congestion','[callProgressDetectingCustomer][logCongestion]','[callProgressDetectingCustomer][logCongestionGlobal]','countagentrejectretry','AgentReject','custom:agentreject','agentreject','[syncHangupRequest][logAgentReject]','[callProgressDetectingCustomer][logAgentReject]','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','ABANDONED','outboundAbandonedCallsDay','[callProgressDetectingCustomer][logAbandoned]','countabandonedetry','dialAbandonedMaxRety','countabandonedretry','dialAbandonedRetryFrequency','countmachineretry','cause-txt','dialstatus','custom:amd','amd','[callProgressDetectingCustomer][hangupInAMD]','[callProgressDetectingCustomer][machine]','[default]','[Dialer][decrementTalkink][no\x20Hangup][Preview]','[callProgressDetectingCustomer][logUnknown]','updateOriginated','[callProgressDetectingCustomer]','[originated][decrement][callProgressDetectingCustomer]','callProgressDetectingAgent','object','isUndefined','createAgentHistory','[callProgressDetectingAgent][logNoSuch]','[callProgressDetectingAgent][logBusy]','logAgent','[callProgressDetectingAgent][logCongestion]','reason','[callProgressDetectingAgent]','originated:\x20','checkInBlack','Contact','phone','Contact\x20is\x20undefined','lookAgent','isEmpty','execCall','[Preview][execCall][success]','Queue:\x20','\x20IdHopper:\x20','idContact','called','Calling','[Preview][execCall][failure]','logBlacklist','createHistory','[Blacklist][error]','Contact\x20in\x20black\x20List','SIP/%s','status','unmonitored','run','unlockContact','execRun','getContactPreview','recallme','validateContact','checkIsBlackList','Contact.phone','[Preview][checkIsBlackList]','Call\x20unsuccessful','[Preview][validateContact][Empty\x20Contact]','Empty\x20Contact','[Preview][validateContact][Empty\x20Campaign]','Empty\x20Campaign','[Preview][validateContact][Trunk\x20not\x20work]','campaign\x20Name:\x20','\x20Trunk\x20is\x20not\x20active','Trunk\x20not\x20work','[Preview][validateContact][Campaign\x20Active]','\x20Not\x20Active','Is\x20Valid','dialPrefix','trim','dialCutDigit','substring','SIP/%s/%s%s','getCallerId','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','originatecalleridname','extractCalleridName','originatecalleridnum','extractCalleridNumber','addVariables','merge','toLowerVariables','variablesAction','channelAgent','destconnectedlinenum','user:%s','accountcode','calleridnum','[originated][increment]','[originateFailure][logOriginateFailure]','syncOriginateResponse','isFailure','rejected','[syncHangup][talking]','cause','channelstate','[syncHangup][talking][transfer]','[syncHangup][talking][cause]','syncDialEnd','destlinkedid','addVariable','variables','filterKey','keys','variable','value','error','[syncVarSet][Preview]','inspect','transfertargetlinkedid','transfererlinkedid','transfer','exports','util','lodash','bluebird','uuid','moment','md5','ioredis','actionPreview','../ami','./rpcDb','./util/util','redis','localhost','socket.io-emitter','prototype','tail','finally','sequence','campaignsPreview','voiceQueues','trunks','actions','agents','clockClearZombieChannels','originateresponse','bind','hangup','syncHangup','syncHangupRequest','dialend','newexten','syncNewExten','varset','syncVarSet','attendedtransfer','syncAttendedTransfer','blindtransfer','emit','type','outbound','name','strategy','answered','available','loggedIn','sumBillable','sumDuration','sumHoldTime','talking','total','unmanaged','abandoned','waiting','loggedInDb','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalAvailable','predictiveIntervalTotalCalls','message','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','Trunk','active','callerid','Interval','stringify','voice:queue:%s','voice_queue:save','info','format','voice_queue_channel:remove','voice_queue_presence:remove','sendMessageOneNotActive','pTalking','paused','NOT_ACTIVE','[CampaignPreview]\x20Campaign\x20Queue:\x20','IS_DISACTIVED','logger','\x20is\x20disactive','loopCampaigns','syncCampaigns','hasOwnProperty','booked','clearZombieChannels','preview','recallMe','isNil'];(function(_0x5825b2,_0x45b904){var _0x2030e3=function(_0x39772d){while(--_0x39772d){_0x5825b2['push'](_0x5825b2['shift']());}};_0x2030e3(++_0x45b904);}(_0x3041,0xe8));var _0x1304=function(_0x71b765,_0x3053f8){_0x71b765=_0x71b765-0x0;var _0x34cb24=_0x3041[_0x71b765];return _0x34cb24;};'use strict';var util=require(_0x1304('0x0'));var _=require(_0x1304('0x1'));var BPromise=require(_0x1304('0x2'));var uuid=require(_0x1304('0x3'));var moment=require(_0x1304('0x4'));var md5=require(_0x1304('0x5'));var Redis=require(_0x1304('0x6'));var config=require('../../../config/environment');var logger=require('../../../config/logger')('preview');var loggerAction=require('../../../config/logger')(_0x1304('0x7'));var ami=require(_0x1304('0x8'));var rpcDb=require(_0x1304('0x9'));var Action=require('./action');var ut=require(_0x1304('0xa'));config['redis']=_['defaults'](config[_0x1304('0xb')],{'host':_0x1304('0xc'),'port':0x18eb});var io=require(_0x1304('0xd'))(new Redis(config[_0x1304('0xb')]));var Sequence=function(){};Sequence[_0x1304('0xe')]['enqueue']=function(_0xe2fcb2){this[_0x1304('0xf')]=this[_0x1304('0xf')]?this[_0x1304('0xf')][_0x1304('0x10')](_0xe2fcb2):_0xe2fcb2();};function Preview(_0x321a3e){this[_0x1304('0x11')]=new Sequence();this[_0x1304('0x12')]=_0x321a3e[_0x1304('0x13')];this['trunks']=_0x321a3e[_0x1304('0x14')];this[_0x1304('0x15')]={};this['agents']=_0x321a3e[_0x1304('0x16')];this[_0x1304('0x17')]=0x0;ami['on'](_0x1304('0x18'),this['syncOriginateResponse'][_0x1304('0x19')](this));ami['on'](_0x1304('0x1a'),this[_0x1304('0x1b')][_0x1304('0x19')](this));ami['on']('hanguprequest',this[_0x1304('0x1c')]['bind'](this));ami['on'](_0x1304('0x1d'),this['syncDialEnd']['bind'](this));ami['on'](_0x1304('0x1e'),this[_0x1304('0x1f')][_0x1304('0x19')](this));ami['on'](_0x1304('0x20'),this[_0x1304('0x21')][_0x1304('0x19')](this));ami['on'](_0x1304('0x22'),this[_0x1304('0x23')][_0x1304('0x19')](this));ami['on'](_0x1304('0x24'),this['syncBlindTransfer']['bind'](this));this['loopCampaigns'](this[_0x1304('0x12')]);}function emit(_0x5d24ab,_0x2e0bf5,_0x139aea){io['to'](_0x5d24ab)[_0x1304('0x25')](_0x2e0bf5,_0x139aea);}function emitCampaignPreview(_0x4a5348){if(_0x4a5348[_0x1304('0x26')]===_0x1304('0x27')){var _0x3f0b82={'id':_0x4a5348['id'],'name':_0x4a5348[_0x1304('0x28')],'strategy':_0x4a5348[_0x1304('0x29')],'answered':_0x4a5348[_0x1304('0x2a')],'available':_0x4a5348[_0x1304('0x2b')],'loggedIn':_0x4a5348[_0x1304('0x2c')],'pTalking':_0x4a5348['pTalking'],'sumBillable':_0x4a5348[_0x1304('0x2d')],'sumDuration':_0x4a5348[_0x1304('0x2e')],'sumHoldTime':_0x4a5348[_0x1304('0x2f')]||0x0,'talking':_0x4a5348[_0x1304('0x30')],'total':_0x4a5348[_0x1304('0x31')],'type':_0x4a5348[_0x1304('0x26')],'unmanaged':_0x4a5348[_0x1304('0x32')],'abandoned':_0x4a5348[_0x1304('0x33')],'waiting':_0x4a5348[_0x1304('0x34')],'loggedInDb':_0x4a5348[_0x1304('0x35')],'dialActive':_0x4a5348[_0x1304('0x36')],'dialMethod':_0x4a5348[_0x1304('0x37')],'dialOriginateCallerIdName':_0x4a5348[_0x1304('0x38')],'dialOriginateCallerIdNumber':_0x4a5348[_0x1304('0x39')],'dialOriginateTimeout':_0x4a5348[_0x1304('0x3a')],'dialPrefix':_0x4a5348['dialPrefix'],'outboundAnswerAgiCallsDay':_0x4a5348['outboundAnswerAgiCallsDay'],'outboundAnswerCallsDay':_0x4a5348[_0x1304('0x3b')],'outboundBlacklistCallsDay':_0x4a5348[_0x1304('0x3c')],'outboundBusyCallsDay':_0x4a5348[_0x1304('0x3d')],'outboundCongestionCallsDay':_0x4a5348[_0x1304('0x3e')],'outboundDropCallsDayACS':_0x4a5348[_0x1304('0x3f')],'outboundDropCallsDayCallersExit':_0x4a5348['outboundDropCallsDayCallersExit'],'outboundDropCallsDayTimeout':_0x4a5348['outboundDropCallsDayTimeout'],'outboundNoAnswerCallsDay':_0x4a5348[_0x1304('0x40')],'outboundNoSuchCallsDay':_0x4a5348[_0x1304('0x41')],'outboundOriginateFailureCallsDay':_0x4a5348['outboundOriginateFailureCallsDay'],'outboundReCallsDay':_0x4a5348[_0x1304('0x42')],'outboundRejectCallsDay':_0x4a5348[_0x1304('0x43')],'outboundUnknownCallsDay':_0x4a5348[_0x1304('0x44')],'outboundAbandonedCallsDay':_0x4a5348['outboundAbandonedCallsDay'],'predictiveIntervalAnsweredCalls':_0x4a5348[_0x1304('0x45')],'predictiveIntervalAvgHoldtime':_0x4a5348['predictiveIntervalAvgHoldtime'],'predictiveIntervalAvgTalktime':_0x4a5348[_0x1304('0x46')],'predictiveIntervalDroppedCallsCallersExit':_0x4a5348[_0x1304('0x47')],'predictiveIntervalDroppedCallsTimeout':_0x4a5348[_0x1304('0x48')],'predictiveIntervalErlangCalls':_0x4a5348[_0x1304('0x49')],'predictiveIntervalErlangCallsDroppedCalls':_0x4a5348['predictiveIntervalErlangCallsDroppedCalls'],'predictiveIntervalHitRate':_0x4a5348[_0x1304('0x4a')],'predictiveIntervalMultiplicativeFactor':_0x4a5348[_0x1304('0x4b')],'predictiveIntervalPauses':_0x4a5348['predictiveIntervalPauses'],'predictiveIntervalAvailable':_0x4a5348[_0x1304('0x4c')],'predictiveIntervalTotalCalls':_0x4a5348[_0x1304('0x4d')],'message':_0x4a5348[_0x1304('0x4e')],'originated':_0x4a5348[_0x1304('0x4f')],'erlangCalls':_0x4a5348[_0x1304('0x50')],'erlangCallToSecond':_0x4a5348[_0x1304('0x51')],'erlangAbandonmentRate':_0x4a5348[_0x1304('0x52')],'erlangBusyFactor':_0x4a5348[_0x1304('0x53')],'startPredictive':_0x4a5348[_0x1304('0x54')],'startProgressive':_0x4a5348['startProgressive']};if(_0x4a5348[_0x1304('0x55')]){_0x3f0b82[_0x1304('0x55')]={'id':_0x4a5348[_0x1304('0x55')]['id'],'name':_0x4a5348[_0x1304('0x55')][_0x1304('0x28')],'active':_0x4a5348[_0x1304('0x55')][_0x1304('0x56')],'callerid':_0x4a5348[_0x1304('0x55')][_0x1304('0x57')]};}if(_0x4a5348[_0x1304('0x58')]){_0x3f0b82[_0x1304('0x58')]={'id':_0x4a5348[_0x1304('0x58')]['id'],'name':_0x4a5348[_0x1304('0x58')][_0x1304('0x28')]};}var _0x157d85=md5(JSON[_0x1304('0x59')](_0x3f0b82));if(_0x4a5348['md5']!==_0x157d85){_0x4a5348[_0x1304('0x5')]=_0x157d85;emit(util['format'](_0x1304('0x5a'),_0x3f0b82['name']),_0x1304('0x5b'),_0x3f0b82);}}}function emitVoiceQueueChannelRemove(_0x121c05){logger[_0x1304('0x5c')]('[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event',JSON[_0x1304('0x59')](_0x121c05));emit(util[_0x1304('0x5d')](_0x1304('0x5a'),_0x121c05[_0x1304('0x28')]),_0x1304('0x5e'),_0x121c05);io[_0x1304('0x25')](_0x1304('0x5f'),_0x121c05);}function notSendMessagesQueue(_0x4ae05d){if(_0x4ae05d[_0x1304('0x60')]){if(_0x4ae05d['originated']===0x0&&_0x4ae05d[_0x1304('0x61')]===0x0){_0x4ae05d[_0x1304('0x60')]=![];_0x4ae05d[_0x1304('0x2b')]=0x0;_0x4ae05d[_0x1304('0x62')]=0x0;_0x4ae05d[_0x1304('0x4e')]=_0x1304('0x63');ut['logger'](_0x1304('0x64'),_0x4ae05d[_0x1304('0x28')]+'\x20is\x20not\x20active');}else{_0x4ae05d[_0x1304('0x4e')]=_0x1304('0x65');ut[_0x1304('0x66')](_0x1304('0x64'),_0x4ae05d[_0x1304('0x28')]+_0x1304('0x67'));}emitCampaignPreview(_0x4ae05d);}}Preview[_0x1304('0xe')][_0x1304('0x68')]=function(){var _0x5d6b73=this;setInterval(function(){_0x5d6b73['syncCampaigns']();},0x7cf);};Preview[_0x1304('0xe')][_0x1304('0x69')]=function(){var _0x11b97b=this[_0x1304('0x12')];this[_0x1304('0x17')]+=0x1;for(var _0x2234f2 in _0x11b97b){if(_0x11b97b[_0x1304('0x6a')](_0x2234f2)&&(_0x11b97b[_0x2234f2][_0x1304('0x37')]==='preview'||_0x11b97b[_0x2234f2][_0x1304('0x37')]===_0x1304('0x6b'))&&_0x11b97b[_0x2234f2][_0x1304('0x26')]===_0x1304('0x27')){if(this[_0x1304('0x17')]>0x7){this['clockClearZombieChannels']=0x0;this[_0x1304('0x6c')]();}}if(_0x11b97b[_0x1304('0x6a')](_0x2234f2)&&_0x11b97b[_0x2234f2]['dialMethod']===_0x1304('0x6d')&&_0x11b97b[_0x2234f2]['type']==='outbound'){if(_0x11b97b[_0x2234f2]['dialActive']){this['setMessage'](_0x11b97b[_0x2234f2]);this[_0x1304('0x6e')](_0x11b97b[_0x2234f2]);}else{notSendMessagesQueue(_0x11b97b[_0x2234f2]);}}}};Preview['prototype']['clearZombieChannel']=function(_0x41dc6b){var _0x182115=this;this[_0x1304('0x11')]['enqueue'](function(){if(!_[_0x1304('0x6f')](_0x182115['actions'][_0x41dc6b])){loggerAction[_0x1304('0x5c')](_0x1304('0x70'),_0x41dc6b,_0x1304('0x71'),_0x182115['actions'][_0x41dc6b][_0x1304('0x72')],'originated:\x20',JSON[_0x1304('0x59')](_0x182115[_0x1304('0x12')][_0x182115['actions'][_0x41dc6b]['queue']][_0x1304('0x4f')]),'pTalking:\x20',JSON['stringify'](_0x182115[_0x1304('0x12')][_0x182115[_0x1304('0x15')][_0x41dc6b][_0x1304('0x72')]]['pTalking']),JSON[_0x1304('0x59')](_0x182115[_0x1304('0x15')][_0x41dc6b][_0x1304('0x73')]),JSON[_0x1304('0x59')](_[_0x1304('0x74')](_0x182115['actions'][_0x41dc6b],[_0x1304('0x75'),_0x1304('0x76'),_0x1304('0x77'),_0x1304('0x78')])));return ami[_0x1304('0x79')]({'action':'status','channel':_0x182115[_0x1304('0x15')][_0x41dc6b][_0x1304('0x7a')]})[_0x1304('0x7b')](function(_0x1d235c){if(_0x1d235c['message']==='No\x20such\x20channel'){setTimeout(function(){if(_0x182115[_0x1304('0x15')][_0x41dc6b]){ut['updateOriginated'](_0x182115[_0x1304('0x12')][_0x182115['actions'][_0x41dc6b][_0x1304('0x72')]],_0x1304('0x7c'));if(_0x182115['actions'][_0x41dc6b][_0x1304('0x73')]===!![]){ut['decrementTalkink'](_0x182115[_0x1304('0x12')][_0x182115[_0x1304('0x15')][_0x41dc6b][_0x1304('0x72')]],_0x1304('0x7c'));ut[_0x1304('0x7d')](_0x1304('0x7e')+_0x41dc6b,_0x182115[_0x1304('0x15')][_0x41dc6b][_0x1304('0x72')]);}ut['loggerError'](_0x1304('0x7f')+_0x41dc6b,_0x182115['actions'][_0x41dc6b]['queue']);delete _0x182115['actions'][_0x41dc6b];}},0x2328);}});}});};Preview[_0x1304('0xe')]['clearZombieChannels']=function(){var _0x13beb4=this;loggerAction['info']('[action]',_['size'](this[_0x1304('0x15')]));for(var _0xb0603a in this[_0x1304('0x15')]){if(_0x13beb4[_0x1304('0x15')][_0x1304('0x6a')](_0xb0603a)){_0x13beb4[_0x1304('0x80')](_0xb0603a);}}};Preview[_0x1304('0xe')][_0x1304('0x6e')]=function(_0x49719f){var _0x2f60fb=this;rpcDb['getContactRecallMe'](_0x49719f['id'],ut[_0x1304('0x81')](this['agents']))[_0x1304('0x82')](function(_0x28962c){if(!_[_0x1304('0x6f')](_0x28962c)){for(var _0x3971bb=0x0;_0x3971bb<_0x28962c[_0x1304('0x83')];_0x3971bb+=0x1){if(ut[_0x1304('0x84')](_0x28962c[_0x3971bb][_0x1304('0x85')])<_0x49719f[_0x1304('0x86')]*0x3c){if(_0x28962c[_0x3971bb][_0x1304('0x87')]&&!_0x28962c[_0x3971bb][_0x1304('0x87')]['voicePause']){_0x2f60fb['run'](_0x28962c[_0x3971bb]['id'])[_0x1304('0x82')](ut[_0x1304('0x88')](_0x1304('0x89')))[_0x1304('0x7b')](ut[_0x1304('0x88')](_0x1304('0x89')));}else{rpcDb[_0x1304('0x8a')](_0x28962c[_0x3971bb]['id']);}}else{var _0x25f22f=new Action(_0x28962c[_0x3971bb],_0x49719f);_0x25f22f[_0x1304('0x8b')]=moment()[_0x1304('0x5d')](_0x1304('0x8c'));_0x49719f[_0x1304('0x42')]+=0x1;ut['logCustomer'](_0x25f22f,0x17,'RecallInQueue');if(_0x49719f[_0x1304('0x8d')]){rpcDb[_0x1304('0x8e')](ut[_0x1304('0x8f')](_0x28962c[_0x3971bb]));rpcDb['createCustomerHistory'](_0x25f22f,_0x1304('0x90'));}else{ut['logCustomer'](_0x25f22f,0x16,_0x1304('0x91'));rpcDb[_0x1304('0x92')](_0x25f22f,_0x1304('0x93'));rpcDb[_0x1304('0x94')](_0x25f22f,_0x1304('0x93'));}}}}})[_0x1304('0x7b')](ut['logger2'](_0x1304('0x95')));};Preview[_0x1304('0xe')][_0x1304('0x96')]=function(_0x3bf616){_0x3bf616[_0x1304('0x60')]=!![];if(ut[_0x1304('0x97')](_0x3bf616[_0x1304('0x2c')])){_0x3bf616[_0x1304('0x4e')]=_0x1304('0x98');}else if(!ut[_0x1304('0x99')](_0x3bf616[_0x1304('0x36')])){_0x3bf616[_0x1304('0x4e')]='NOT_ACTIVE';}else if(!this[_0x1304('0x9a')](_0x3bf616[_0x1304('0x55')])){if(!this[_0x1304('0x9a')](_0x3bf616[_0x1304('0x9b')])){_0x3bf616[_0x1304('0x4e')]=_0x1304('0x9c');}else{_0x3bf616['message']=_0x1304('0x9d');}}else{_0x3bf616[_0x1304('0x4e')]=_0x1304('0x9d');}emitCampaignPreview(_0x3bf616);};Preview['prototype'][_0x1304('0x9e')]=function(_0x54a76d,_0x6872df,_0x3f4a76){var _0x493055=this;var _0xf9cdce=this[_0x1304('0x15')][_0x6872df];var _0x554046=this['campaignsPreview'][_0xf9cdce[_0x1304('0x72')]];var _0x2481e8;if(_0x554046){switch(_0x3f4a76){case'1':_0x554046[_0x1304('0x41')]+=0x1;_0xf9cdce[_0x1304('0x9f')]+=0x1;_0xf9cdce[_0x1304('0xa0')]=ut['totalGlobal'](_0xf9cdce);ut[_0x1304('0xa1')](_0xf9cdce,0x0,_0x1304('0xa2'));ami[_0x1304('0x25')](_0x1304('0xa3'),ut[_0x1304('0xa4')](_0xf9cdce,_0x1304('0xa5')));rpcDb[_0x1304('0x92')](_0xf9cdce,_0x1304('0xa6'));if(ut['totalGlobal'](_0xf9cdce)>=_0x554046[_0x1304('0xa7')]){_0x2481e8=ut[_0x1304('0xa8')](_0xf9cdce,0xf,_0x1304('0xa9'));rpcDb['createCustomerFinal'](_0x2481e8,'[callProgressDetectingCustomer][logNoSuchGlobal]');}else{if(_0xf9cdce[_0x1304('0x9f')]>=_0x554046[_0x1304('0xaa')]){rpcDb['createCustomerFinal'](_0xf9cdce,_0x1304('0xab'));}else{rpcDb[_0x1304('0xac')](ut['scheduledAt'](_0xf9cdce,'countnosuchnumberretry',_0x554046[_0x1304('0xad')]),_0xf9cdce['unlockAgent'],_0xf9cdce[_0x1304('0xae')]);}}delete this[_0x1304('0x15')][_0x54a76d[_0x1304('0xaf')]];break;case _0x1304('0xb0'):var _0x2ecd0b=moment()[_0x1304('0x5d')](_0x1304('0x8c'));_0xf9cdce[_0x1304('0xb1')]=_0x2ecd0b;_0xf9cdce[_0x1304('0xb2')]=_0x2ecd0b;_0xf9cdce[_0x1304('0x73')]=!![];_0x554046[_0x1304('0x61')]+=0x1;logger[_0x1304('0x5c')](_0x1304('0xb3'),_0xf9cdce[_0x1304('0xb4')],_0x1304('0xb5'),_0x554046[_0x1304('0x28')],_0x1304('0xb6'),_0x554046[_0x1304('0x61')]);ami[_0x1304('0x25')]('custom:agentconnect',ut[_0x1304('0xa4')](_0xf9cdce,'connect',this['campaignsPreview'][_0xf9cdce[_0x1304('0x72')]]));if(_0x554046[_0x1304('0xb7')]){ami[_0x1304('0x25')]('custom:agentConnectPreview',ut[_0x1304('0xb8')](_0xf9cdce));}break;case'16':ami[_0x1304('0x25')](_0x1304('0xb9'),ut[_0x1304('0xa4')](_0xf9cdce,_0x1304('0xba'),this[_0x1304('0x12')][_0xf9cdce[_0x1304('0x72')]]));emitVoiceQueueChannelRemove(ut[_0x1304('0xa4')](_0xf9cdce,_0x1304('0xba')));_0x554046['outboundAnswerCallsDay']+=0x1;_0x554046[_0x1304('0x31')]+=0x1;_0x554046[_0x1304('0x2a')]+=0x1;ut[_0x1304('0xbb')](_0x554046,'[16]');_0xf9cdce[_0x1304('0xa0')]=ut['totalGlobal'](_0xf9cdce);ut[_0x1304('0xa1')](_0xf9cdce,0x4,_0x1304('0xbc'));rpcDb[_0x1304('0x92')](_0xf9cdce,_0x1304('0xbd'));rpcDb[_0x1304('0x94')](_0xf9cdce,_0x1304('0xbe'));rpcDb['crateCustomerReportQueue'](_0xf9cdce);_0x554046[_0x1304('0x2e')]+=_0xf9cdce[_0x1304('0xbf')];_0x554046[_0x1304('0x2d')]+=_0xf9cdce['talktime'];logger[_0x1304('0x5c')]('[syncHangup][talking][decrement]',_0xf9cdce[_0x1304('0xb4')],'\x20Queue',_0x554046[_0x1304('0x28')],'pTalking:\x20',_0x554046[_0x1304('0x61')]);delete this['actions'][_0x54a76d[_0x1304('0xaf')]];break;case _0x1304('0xc0'):_0x554046[_0x1304('0x3d')]+=0x1;_0xf9cdce[_0x1304('0xc1')]+=0x1;_0xf9cdce[_0x1304('0xa0')]=ut[_0x1304('0xc2')](_0xf9cdce);ut[_0x1304('0xa1')](_0xf9cdce,0x5,_0x1304('0xc3'));ami['emit'](_0x1304('0xc4'),ut[_0x1304('0xa4')](_0xf9cdce,'busy'));rpcDb[_0x1304('0x92')](_0xf9cdce,_0x1304('0xc5'));if(ut[_0x1304('0xc2')](_0xf9cdce)>=_0x554046[_0x1304('0xa7')]){_0x2481e8=ut[_0x1304('0xa8')](_0xf9cdce,0xf,_0x1304('0xa9'));rpcDb[_0x1304('0x94')](_0x2481e8,_0x1304('0xc6'));}else{if(_0xf9cdce[_0x1304('0xc1')]>=_0x554046['dialBusyMaxRetry']){rpcDb[_0x1304('0x94')](_0xf9cdce,_0x1304('0xc5'));}else{rpcDb['rescheduleContact'](ut['scheduledAt'](_0xf9cdce,_0x1304('0xc1'),_0x554046[_0x1304('0xc7')]),_0xf9cdce[_0x1304('0xc8')],_0xf9cdce['activeContact']);}}break;case _0x1304('0xc9'):_0x554046[_0x1304('0x40')]+=0x1;_0xf9cdce[_0x1304('0xca')]+=0x1;_0xf9cdce[_0x1304('0xa0')]=ut[_0x1304('0xc2')](_0xf9cdce);ut[_0x1304('0xa1')](_0xf9cdce,0x3,_0x1304('0xcb'));ami['emit'](_0x1304('0xcc'),ut['buildObj'](_0xf9cdce,_0x1304('0xcd')));rpcDb[_0x1304('0x92')](_0xf9cdce,_0x1304('0xce'));if(ut[_0x1304('0xc2')](_0xf9cdce)>=_0x554046['dialGlobalMaxRetry']){_0x2481e8=ut[_0x1304('0xa8')](_0xf9cdce,0xf,_0x1304('0xa9'));rpcDb[_0x1304('0x94')](_0x2481e8,_0x1304('0xcf'));}else{if(_0xf9cdce[_0x1304('0xca')]>=_0x554046[_0x1304('0xd0')]){rpcDb[_0x1304('0x94')](_0xf9cdce,_0x1304('0xce'));}else{rpcDb[_0x1304('0xac')](ut[_0x1304('0xd1')](_0xf9cdce,_0x1304('0xca'),_0x554046[_0x1304('0xd2')]),_0xf9cdce['unlockAgent'],_0xf9cdce[_0x1304('0xae')]);}}break;case _0x1304('0xd3'):_0x554046[_0x1304('0x3e')]+=0x1;_0xf9cdce[_0x1304('0xd4')]+=0x1;_0xf9cdce[_0x1304('0xa0')]=ut[_0x1304('0xc2')](_0xf9cdce);ut['logCustomer'](_0xf9cdce,0x8,_0x1304('0xd5'));ami[_0x1304('0x25')]('custom:agentcongestion',ut[_0x1304('0xa4')](_0xf9cdce,_0x1304('0xd6')));rpcDb[_0x1304('0x92')](_0xf9cdce,_0x1304('0xd7'));if(ut[_0x1304('0xc2')](_0xf9cdce)>=_0x554046[_0x1304('0xa7')]){_0x2481e8=ut['cloneAction'](_0xf9cdce,0xf,_0x1304('0xa9'));rpcDb[_0x1304('0x94')](_0x2481e8,_0x1304('0xd8'));}else{if(_0xf9cdce['countcongestionretry']>=_0x554046['dialCongestionMaxRetry']){rpcDb['createCustomerFinal'](_0xf9cdce,_0x1304('0xd7'));}else{rpcDb[_0x1304('0xac')](ut[_0x1304('0xd1')](_0xf9cdce,_0x1304('0xd4'),_0x554046[_0x1304('0xc7')]),_0xf9cdce[_0x1304('0xc8')],_0xf9cdce[_0x1304('0xae')]);}}break;case'CANCEL':_0x554046['outboundRejectCallsDay']+=0x1;_0xf9cdce[_0x1304('0xd9')]+=0x1;_0xf9cdce[_0x1304('0xa0')]=ut[_0x1304('0xc2')](_0xf9cdce);ut[_0x1304('0xa1')](_0xf9cdce,0x14,_0x1304('0xda'));ami[_0x1304('0x25')](_0x1304('0xdb'),ut[_0x1304('0xa4')](_0xf9cdce,_0x1304('0xdc')));rpcDb[_0x1304('0x92')](_0xf9cdce,_0x1304('0xdd'));if(ut[_0x1304('0xc2')](_0xf9cdce)>=_0x554046[_0x1304('0xa7')]){_0x2481e8=ut['cloneAction'](_0xf9cdce,0x14,_0x1304('0xda'));rpcDb[_0x1304('0x94')](_0x2481e8,_0x1304('0xde'));}else{if(_0xf9cdce[_0x1304('0xd9')]>=_0x554046[_0x1304('0xdf')]){rpcDb[_0x1304('0x94')](_0xf9cdce,_0x1304('0xde'));}else{rpcDb[_0x1304('0xac')](ut[_0x1304('0xd1')](_0xf9cdce,_0x1304('0xd9'),_0x554046[_0x1304('0xe0')]),_0xf9cdce[_0x1304('0xc8')],_0xf9cdce[_0x1304('0xae')]);}}break;case _0x1304('0xe1'):_0x554046[_0x1304('0xe2')]+=0x1;_0xf9cdce['countabandonedretry']+=0x1;_0xf9cdce[_0x1304('0xa0')]=ut[_0x1304('0xc2')](_0xf9cdce);ut['logCustomer'](_0xf9cdce,0xb,'Abandoned');rpcDb[_0x1304('0x92')](_0xf9cdce,'[callProgressDetectingCustomer][logAbandoned]');if(ut[_0x1304('0xc2')](_0xf9cdce)>=_0x554046[_0x1304('0xa7')]){_0x2481e8=ut[_0x1304('0xa8')](_0xf9cdce,0xf,_0x1304('0xa9'));rpcDb[_0x1304('0x94')](_0x2481e8,_0x1304('0xe3'));}else{if(_0xf9cdce[_0x1304('0xe4')]>=_0x554046[_0x1304('0xe5')]){rpcDb[_0x1304('0x94')](_0xf9cdce,_0x1304('0xe3'));}else{rpcDb[_0x1304('0xac')](ut[_0x1304('0xd1')](_0xf9cdce,_0x1304('0xe6'),_0x554046[_0x1304('0xe7')]),_0xf9cdce[_0x1304('0xc8')],_0xf9cdce[_0x1304('0xae')]);}}break;case'18':_0x554046[_0x1304('0x44')]+=0x1;_0xf9cdce[_0x1304('0xe8')]+=0x1;_0xf9cdce[_0x1304('0xa0')]=ut['totalGlobal'](_0xf9cdce);ut['logCustomer'](_0xf9cdce,0x12,_0x54a76d[_0x1304('0xe9')]||_0x54a76d[_0x1304('0xea')]);ami[_0x1304('0x25')](_0x1304('0xeb'),ut[_0x1304('0xa4')](_0xf9cdce,_0x1304('0xec')));rpcDb[_0x1304('0x92')](_0xf9cdce,_0x1304('0xed'));if(ut[_0x1304('0xc2')](_0xf9cdce)>=_0x554046['dialGlobalMaxRetry']){_0x2481e8=ut[_0x1304('0xa8')](_0xf9cdce,0xf,_0x1304('0xa9'));rpcDb['createCustomerFinal'](_0x2481e8,_0x1304('0xed'));}else{rpcDb['createCustomerFinal'](_0xf9cdce,_0x1304('0xed'));}delete this[_0x1304('0x15')][_0x54a76d[_0x1304('0xaf')]];break;case'19':_0x554046[_0x1304('0x44')]+=0x1;_0xf9cdce['countglobal']=ut[_0x1304('0xc2')](_0xf9cdce);ut[_0x1304('0xa1')](_0xf9cdce,0x13,_0x54a76d[_0x1304('0xe9')]||_0x54a76d[_0x1304('0xea')]);ami[_0x1304('0x25')](_0x1304('0xeb'),ut['buildObj'](_0xf9cdce,'amd'));rpcDb['createCustomerHistory'](_0xf9cdce,_0x1304('0xee'));if(ut[_0x1304('0xc2')](_0xf9cdce)>=_0x554046['dialGlobalMaxRetry']){_0x2481e8=ut[_0x1304('0xa8')](_0xf9cdce,0xf,'Global');rpcDb[_0x1304('0x94')](_0x2481e8,_0x1304('0xee'));}else{rpcDb[_0x1304('0x94')](_0xf9cdce,_0x1304('0xee'));}delete this[_0x1304('0x15')][_0x54a76d['linkedid']];break;default:if(_0xf9cdce[_0x1304('0x73')]){ut[_0x1304('0xbb')](_0x554046,_0x1304('0xef'));ut[_0x1304('0x7d')](_0x1304('0xf0')+_0x554046[_0x1304('0x28')],_0x54a76d);}_0x554046['outboundUnknownCallsDay']+=0x1;_0xf9cdce[_0x1304('0xa0')]=ut[_0x1304('0xc2')](_0xf9cdce);ut[_0x1304('0xa1')](_0xf9cdce,0xc,_0x54a76d[_0x1304('0xe9')]||_0x54a76d[_0x1304('0xea')]);rpcDb[_0x1304('0x92')](_0xf9cdce,_0x1304('0xf1'));if(ut[_0x1304('0xc2')](_0xf9cdce)>=_0x554046['dialGlobalMaxRetry']){_0x2481e8=ut[_0x1304('0xa8')](_0xf9cdce,0xf,_0x1304('0xa9'));rpcDb[_0x1304('0x94')](_0x2481e8,'[callProgressDetectingCustomer][logUnknownGlobal]');}else{rpcDb[_0x1304('0x94')](_0xf9cdce,'[callProgressDetectingCustomer][logUnknownGlobal]');}delete this[_0x1304('0x15')][_0x54a76d[_0x1304('0xaf')]];}if(!(_0xf9cdce[_0x1304('0x73')]&&_0x3f4a76==='16')){ut[_0x1304('0xf2')](_0x554046,_0x1304('0xf3'));logger[_0x1304('0x5c')](_0x1304('0xf4'),_0xf9cdce['uniqueid'],'\x20Queue',_0x554046['name'],'originated:\x20',_0x554046[_0x1304('0x4f')]);}if(_0x3f4a76!==_0x1304('0xb0')){delete this['actions'][_0x54a76d[_0x1304('0xaf')]];delete this[_0x1304('0x15')][_0x54a76d['destlinkedid']];}}};Preview[_0x1304('0xe')][_0x1304('0xf5')]=function(_0x18710d,_0xb0eaca,_0x210b13){if(_['isUndefined'](_0xb0eaca)&&_0x1304('0xf6')!==typeof _0xb0eaca){return;}if(_[_0x1304('0xf7')](_0x210b13)&&_0x1304('0xf6')!==typeof _0x210b13){return;}switch(_0x210b13['reason']){case'0':ut['logAgent'](_0x18710d,0x0,'NoSuchNumber');rpcDb[_0x1304('0xf8')](_0x18710d,_0x1304('0xf9'));break;case'3':ut['logAgent'](_0x18710d,0x3,'NoAnswer');rpcDb[_0x1304('0xf8')](_0x18710d,'[callProgressDetectingAgent][logNoAnswer]');break;case'5':ut['logAgent'](_0x18710d,0x5,_0x1304('0xc3'));rpcDb['createAgentHistory'](_0x18710d,_0x1304('0xfa'));break;case'8':ut[_0x1304('0xfb')](_0x18710d,0x8,_0x1304('0xd5'));rpcDb[_0x1304('0xf8')](_0x18710d,_0x1304('0xfc'));break;case'22':ut[_0x1304('0xfb')](_0x18710d,0x16,'AnswerAGI');rpcDb[_0x1304('0xf8')](_0x18710d,'[callProgressDetectingAgent][logAnswerAGI]');break;default:ut['logAgent'](_0x18710d,0xc,_0x210b13[_0x1304('0xfd')]);rpcDb[_0x1304('0xf8')](_0x18710d,_0x1304('0xfc'));}ut[_0x1304('0xf2')](_0xb0eaca,_0x1304('0xfe'));logger[_0x1304('0x5c')]('[originated][decrement][callProgressDetectingAgent]',_0x18710d['uniqueid'],'\x20Queue',_0xb0eaca['name'],_0x1304('0xff'),_0xb0eaca['originated']);delete this['actions'][_0x18710d[_0x1304('0xb4')]];};Preview[_0x1304('0xe')][_0x1304('0x100')]=function(_0x464c40,_0x31380a,_0x1b1a22,_0x9722cc,_0x46dd6f){var _0xe97d80=this;return new BPromise(function(_0x46c94d,_0x2b337a){if(_[_0x1304('0x6f')](_0x31380a)||_['isNil'](_0x31380a[_0x1304('0x101')])||_[_0x1304('0x6f')](_0x31380a[_0x1304('0x101')][_0x1304('0x102')])||_[_0x1304('0x6f')](_0x31380a['VoiceQueueId'])){_0x2b337a(ut[_0x1304('0x4e')](_0x1304('0x103'),_0x9722cc,_0x46dd6f));return;}var _0x20cd48=uuid['v4']();var _0xf46f6a=_0xe97d80['campaignsPreview'][_0x31380a[_0x1304('0x71')][_0x1304('0x28')]];var _0x546281=_0x1b1a22?_0xe97d80[_0x1304('0x16')][_0x1b1a22]['id']:undefined;_0xe97d80[_0x1304('0x15')][_0x20cd48]=new Action(_0x31380a,_0xf46f6a,_0x20cd48,_0x1b1a22,_0x546281);var _0x1a8553=_0xe97d80[_0x1304('0x15')][_0x20cd48];_0x1a8553['unlockAgent']=_0x9722cc;_0x1a8553[_0x1304('0xae')]=_0x46dd6f;_0x1a8553[_0x1304('0x104')]=_0x1b1a22;if(_[_0x1304('0x105')](_0x464c40)){_0xe97d80[_0x1304('0x106')](_0x1a8553,_0xf46f6a,_0x31380a,_0x1b1a22)[_0x1304('0x82')](function(_0x5cdc19){logger[_0x1304('0x5c')](_0x1304('0x107'),_0x1304('0x108')+_0x1a8553[_0x1304('0x72')]+_0x1304('0x109')+_0x1a8553[_0x1304('0x10a')],JSON[_0x1304('0x59')](_0x5cdc19));ami[_0x1304('0x25')]('custom:agentcalled',ut[_0x1304('0xa4')](_0x1a8553,_0x1304('0x10b'),_0xe97d80[_0x1304('0x12')][_0x1a8553['queue']]));_0x46c94d(ut['message'](_0x1304('0x10c')));})['catch'](function(_0x23bb85){ut[_0x1304('0x66')](_0x1304('0x10d'),_0x23bb85);_0x2b337a(ut[_0x1304('0x4e')]('Call\x20failed',_0x9722cc,_0x46dd6f));});}else{_0xf46f6a[_0x1304('0x3c')]+=0x1;ut[_0x1304('0x10e')](_0x1a8553);rpcDb[_0x1304('0x10f')](_0x1a8553,_0x1304('0x110'));delete _0xe97d80[_0x1304('0x15')][_0x20cd48];_0x2b337a(ut['message'](_0x1304('0x111'),_0x9722cc,_0x46dd6f));}});};Preview[_0x1304('0xe')]['isTrunkReachable']=function(_0x1aded8){return!_[_0x1304('0x6f')](_0x1aded8)&&!_[_0x1304('0x6f')](_0x1aded8['name'])&&!_[_0x1304('0x6f')](_0x1aded8[_0x1304('0x56')])&&_0x1aded8['active']&&!_['isNil'](this[_0x1304('0x14')][util['format'](_0x1304('0x112'),_0x1aded8['name'])])&&!_['isNil'](this['trunks'][util[_0x1304('0x5d')](_0x1304('0x112'),_0x1aded8[_0x1304('0x28')])][_0x1304('0x113')])&&(this[_0x1304('0x14')][util[_0x1304('0x5d')]('SIP/%s',_0x1aded8[_0x1304('0x28')])][_0x1304('0x113')]==='reachable'||this[_0x1304('0x14')][util[_0x1304('0x5d')](_0x1304('0x112'),_0x1aded8[_0x1304('0x28')])][_0x1304('0x113')]===_0x1304('0x114'));};Preview[_0x1304('0xe')][_0x1304('0x115')]=function(_0x28a409,_0x38ce93){var _0x193eac=this;return new BPromise(function(_0x4a88a8,_0x321bb7){_0x193eac['execRun'](_0x28a409,_0x38ce93)[_0x1304('0x82')](function(_0x4824bf){_0x4a88a8(_['pick'](_0x4824bf,[_0x1304('0x4e')]));})[_0x1304('0x7b')](function(_0x3ce297){if(_0x3ce297['unlock']){rpcDb[_0x1304('0x116')](_0x28a409);}if(_0x3ce297[_0x1304('0x56')]){rpcDb['disableContact'](_0x28a409);}_0x321bb7(_['pick'](_0x3ce297,[_0x1304('0x4e')]));});});};Preview[_0x1304('0xe')][_0x1304('0x117')]=function(_0x5e8cc1,_0x46f24d){var _0x20f3f9=this;return new BPromise(function(_0x5d230b,_0x3b7420){var _0x5d9800,_0x21d3c8;rpcDb[_0x1304('0x118')](_0x5e8cc1)[_0x1304('0x82')](function(_0x360b21){if(!_[_0x1304('0x6f')](_0x360b21[0x0])){_0x21d3c8=_0x360b21[0x0][_0x1304('0x119')]?![]:!![];_0x5d9800=_0x360b21[0x0][_0x1304('0x119')]?!![]:![];_0x5d9800=_0x46f24d?!![]:_0x5d9800;}var _0x4b831b=_0x20f3f9[_0x1304('0x11a')](_0x360b21);if(_0x4b831b['isValid']){rpcDb[_0x1304('0x11b')](_['pick'](_0x360b21[0x0],['VoiceQueueId',_0x1304('0x11c')]))['then'](function(_0x484a16){_0x20f3f9[_0x1304('0x100')](_0x484a16,_0x360b21[0x0],_0x46f24d,_0x21d3c8,_0x5d9800)['then'](function(_0x3fbb75){_0x5d230b(_0x3fbb75);})[_0x1304('0x7b')](function(_0x3a6e66){_0x3b7420(_0x3a6e66);});})[_0x1304('0x7b')](function(_0x39ff8a){ut[_0x1304('0x66')](_0x1304('0x11d'),_0x39ff8a);_0x3b7420(ut[_0x1304('0x4e')](_0x1304('0x11e'),_0x21d3c8,_0x5d9800));});}else{_0x3b7420(ut[_0x1304('0x4e')](_0x4b831b[_0x1304('0x4e')],_0x21d3c8,_0x5d9800));}})[_0x1304('0x7b')](function(_0x266aa1){ut[_0x1304('0x66')]('[Preview][getContactPreview]',_0x266aa1);_0x3b7420(ut[_0x1304('0x4e')]('Call\x20unsuccessful',![],!![]));});});};Preview[_0x1304('0xe')][_0x1304('0x11a')]=function(_0x44ca9d){if(_['isNil'](_0x44ca9d)||_[_0x1304('0x105')](_0x44ca9d)||!_[_0x1304('0x6f')](_0x44ca9d[0x0][_0x1304('0x87')])&&_[_0x1304('0x6f')](_0x44ca9d[0x0][_0x1304('0x87')][_0x1304('0x28')])){ut[_0x1304('0x66')](_0x1304('0x11f'),_0x44ca9d);return{'isValid':![],'message':_0x1304('0x120')};}var _0x3ff55a=this[_0x1304('0x12')][_0x44ca9d[0x0]['Queue'][_0x1304('0x28')]];_0x3ff55a[_0x1304('0x4e')]=_0x1304('0x9d');if(_[_0x1304('0x6f')](_0x3ff55a)){ut[_0x1304('0x66')](_0x1304('0x121'),_0x3ff55a);return{'isValid':![],'message':_0x1304('0x122')};}if(!this['isTrunkReachable'](_0x3ff55a[_0x1304('0x55')])){ut[_0x1304('0x66')](_0x1304('0x123'),_0x1304('0x124')+_0x3ff55a[_0x1304('0x28')]+_0x1304('0x125'));if(!this['isTrunkReachable'](_0x3ff55a['TrunkBackup'])){ut[_0x1304('0x66')](_0x1304('0x123'),_0x3ff55a[_0x1304('0x28')]+'\x20Trunk\x20Backup\x20is\x20not\x20active');return{'isValid':![],'message':_0x1304('0x126')};}}if(!ut['isActive'](_0x3ff55a[_0x1304('0x36')])){ut[_0x1304('0x66')](_0x1304('0x127'),_0x3ff55a[_0x1304('0x28')]+_0x1304('0x128'));return{'isValid':![],'message':'campaign\x20Name:\x20'+_0x3ff55a[_0x1304('0x28')]+_0x1304('0x128')};}return{'isValid':!![],'message':_0x1304('0x129')};};Preview[_0x1304('0xe')][_0x1304('0x106')]=function(_0x4f2c24,_0x1323f2,_0x4853f2,_0x40817c){var _0x98f6f7=this;return new BPromise(function(_0xb83963,_0xd8f260){var _0x16ce65=_0x4f2c24[_0x1304('0xb4')];var _0x16f624=_0x98f6f7[_0x1304('0x9a')](_0x1323f2[_0x1304('0x55')])?util[_0x1304('0x5d')]('SIP/%s/%s%s',_0x1323f2[_0x1304('0x55')][_0x1304('0x28')],_[_0x1304('0x6f')](_0x1323f2['dialPrefix'])?'':_0x1323f2[_0x1304('0x12a')][_0x1304('0x12b')]()||'',_0x1323f2[_0x1304('0x12c')]>0x0?_0x4853f2[_0x1304('0x101')][_0x1304('0x102')][_0x1304('0x12d')](_0x1323f2[_0x1304('0x12c')]):_0x4853f2[_0x1304('0x101')][_0x1304('0x102')]):util['format'](_0x1304('0x12e'),_[_0x1304('0x6f')](_0x1323f2[_0x1304('0x9b')])?_0x1323f2[_0x1304('0x55')][_0x1304('0x28')]:_0x1323f2[_0x1304('0x9b')][_0x1304('0x28')],_[_0x1304('0x6f')](_0x1323f2[_0x1304('0x12a')])?'':_0x1323f2[_0x1304('0x12a')][_0x1304('0x12b')]()||'',_0x1323f2[_0x1304('0x12c')]>0x0?_0x4853f2[_0x1304('0x101')][_0x1304('0x102')][_0x1304('0x12d')](_0x1323f2[_0x1304('0x12c')]):_0x4853f2[_0x1304('0x101')][_0x1304('0x102')]);var _0x4e25ee=_0x98f6f7['isTrunkReachable'](_0x1323f2['Trunk'])?ut[_0x1304('0x12f')](_0x1323f2[_0x1304('0x55')]['callerid'],_0x1323f2[_0x1304('0x38')],_0x1323f2[_0x1304('0x130')]>0x0?ut[_0x1304('0x131')](_0x1323f2[_0x1304('0x39')],_0x1323f2['dialRandomLastDigitCallerIdNumber']):_0x1323f2['dialOriginateCallerIdNumber']):ut['getCallerId'](_[_0x1304('0x6f')](_0x1323f2['TrunkBackup'])?_0x1323f2[_0x1304('0x55')][_0x1304('0x57')]:_0x1323f2[_0x1304('0x9b')][_0x1304('0x57')],_0x1323f2['dialOriginateCallerIdName'],_0x1323f2[_0x1304('0x130')]>0x0?ut['getCallerIdRandom'](_0x1323f2[_0x1304('0x39')],_0x1323f2[_0x1304('0x130')]):_0x1323f2[_0x1304('0x39')]);if(_0x4e25ee){_0x4f2c24[_0x1304('0x132')]=ut[_0x1304('0x133')](_0x4e25ee);_0x4f2c24[_0x1304('0x134')]=ut[_0x1304('0x135')](_0x4e25ee);}var _0x16a37c=ut[_0x1304('0x136')](_0x1323f2,_0x4853f2,_0x16f624,_0x4e25ee,_0x16ce65,_0x4f2c24);_[_0x1304('0x137')](_0x4f2c24,ut[_0x1304('0x138')](_0x16a37c));_0x4f2c24[_0x1304('0x8b')]=moment()[_0x1304('0x5d')]('YYYY-MM-DD\x20HH:mm:ss');ami[_0x1304('0x79')](ut[_0x1304('0x139')](_0x4f2c24,_0x1323f2,_0x16a37c,_0x4f2c24[_0x1304('0xae')],_0x40817c))[_0x1304('0x82')](function(_0xd4faf6){var _0xf46c2a=_0x4f2c24[_0x1304('0x13a')];if(!_[_0x1304('0x6f')](_0xf46c2a)){if(!_[_0x1304('0x6f')](_0x98f6f7[_0x1304('0x16')][_0xf46c2a])){_0x98f6f7[_0x1304('0x16')][_0xf46c2a][_0x1304('0x13b')]=_0x4f2c24['calleridnum'];emit(util[_0x1304('0x5d')](_0x1304('0x13c'),_0x98f6f7[_0x1304('0x16')][_0xf46c2a]['name']),'user:agentconnect',{'destaccountcode':_0x98f6f7[_0x1304('0x16')][_0xf46c2a][_0x1304('0x13d')],'destconnectedlinenum':_0x4f2c24[_0x1304('0x13e')]});}}_0x1323f2['originated']+=0x1;logger['info'](_0x1304('0x13f'),_0x16ce65,_0x1304('0xb5'),_0x1323f2[_0x1304('0x28')],_0x1304('0xff'),_0x1323f2['originated']);_0xb83963(_0xd4faf6);})[_0x1304('0x7b')](function(_0x264120){ut['logAgent'](_0x4f2c24,0xe,'OriginateError');rpcDb[_0x1304('0xf8')](_0x4f2c24,_0x1304('0x140'));_0xd8f260(_0x264120);});});};Preview[_0x1304('0xe')][_0x1304('0x1f')]=function(_0x54fd35){if(this['actions'][_0x54fd35['linkedid']]){this['actions'][_0x54fd35[_0x1304('0xaf')]][_0x1304('0x7a')]=_0x54fd35[_0x1304('0x7a')];}};Preview['prototype'][_0x1304('0x141')]=function(_0x211c57){var _0xc14119=this;var _0x376532=this[_0x1304('0x15')][_0x211c57['actionid']];if(_0x376532){if(_0x376532['lookAgent']&&this['agents'][_0x376532['lookAgent']]){ut['logLookAgent'](_0x376532,this[_0x1304('0x16')][_0x376532[_0x1304('0x104')]][_0x1304('0x28')],this[_0x1304('0x16')][_0x376532[_0x1304('0x104')]]['id']);}var _0x4c8e49=_['clone'](_0x376532);_0x4c8e49[_0x1304('0xb1')]=moment()[_0x1304('0x5d')](_0x1304('0x8c'));var _0x11648d=_0xc14119[_0x1304('0x12')][_0x376532[_0x1304('0x72')]];if(ut[_0x1304('0x142')](_0x211c57['response'])){if(_0x376532[_0x1304('0xc8')]){rpcDb[_0x1304('0x116')](_0x376532[_0x1304('0x10a')]);}if(_0x376532[_0x1304('0xae')]){rpcDb[_0x1304('0x8a')](_0x376532[_0x1304('0x10a')]);}ami[_0x1304('0x25')]('custom:agentringnoanswer',ut['buildObj'](_0x376532,_0x1304('0x143'),this['campaignsPreview'][_0x376532[_0x1304('0x72')]]));this[_0x1304('0xf5')](_0x4c8e49,_0x11648d,_0x211c57);}else{_0x376532[_0x1304('0x8b')]=moment()[_0x1304('0x5d')](_0x1304('0x8c'));ut['logAgent'](_0x4c8e49,0x4,'Answer');rpcDb[_0x1304('0xf8')](_0x4c8e49,'[callProgressDetectingAgent][logAnswer]');}}};Preview[_0x1304('0xe')][_0x1304('0x1b')]=function(_0x366578){var _0x1d7aff=this;var _0x9f5ba1=this[_0x1304('0x15')][_0x366578[_0x1304('0xaf')]];var _0x4fe66a;if(_0x9f5ba1){_0x4fe66a=this[_0x1304('0x12')][_0x9f5ba1[_0x1304('0x72')]];logger[_0x1304('0x5c')](_0x1304('0x144'),_0x366578[_0x1304('0xaf')],'\x20Queue',_0x4fe66a[_0x1304('0x28')],_0x1304('0xb6'),_0x4fe66a[_0x1304('0x61')]);}if(this[_0x1304('0x15')][_0x366578[_0x1304('0xaf')]]&&_0x366578[_0x1304('0xaf')]!==_0x366578[_0x1304('0xb4')]){if(_0x366578[_0x1304('0x145')]==='16'&&this[_0x1304('0x15')][_0x366578['linkedid']][_0x1304('0x73')]){this[_0x1304('0x9e')](_0x366578,_0x366578['linkedid'],_0x366578[_0x1304('0x145')]);}else if(this[_0x1304('0x15')][_0x366578[_0x1304('0xaf')]][_0x1304('0x73')]){logger[_0x1304('0x5c')]('[syncHangup][talking][cause]',_0x366578['linkedid'],_0x366578[_0x1304('0x145')],_0x1304('0xb5'),_0x4fe66a[_0x1304('0x28')],_0x1304('0xb6'),_0x4fe66a['pTalking']);this[_0x1304('0x9e')](_0x366578,_0x366578['linkedid'],_0x366578[_0x1304('0x145')]);}}else if(_0x9f5ba1&&_[_0x1304('0x6f')](_0x9f5ba1['statedesc'])&&_0x4fe66a['dialQueueProject']&&_0x366578[_0x1304('0xaf')]===_0x366578[_0x1304('0xb4')]&&_[_0x1304('0x6f')](_0x366578[_0x1304('0xfd')])&&_0x366578[_0x1304('0x145')]==='16'&&_0x366578[_0x1304('0x146')]==='6'&&_[_0x1304('0xf7')](_0x9f5ba1['transfer'])){if(_0x9f5ba1[_0x1304('0xc8')]){rpcDb[_0x1304('0x116')](_0x9f5ba1[_0x1304('0x10a')]);}if(_0x9f5ba1[_0x1304('0xae')]){rpcDb['disableContact'](_0x9f5ba1['idContact']);}_0x366578[_0x1304('0xfd')]='22';this[_0x1304('0xf5')](_0x9f5ba1,_0x4fe66a,_0x366578);}else if(_0x9f5ba1&&_0x9f5ba1['transfer']){if(_0x366578['cause']==='16'&&this[_0x1304('0x15')][_0x366578['linkedid']][_0x1304('0x73')]){logger[_0x1304('0x5c')](_0x1304('0x147'),_0x366578[_0x1304('0xaf')],_0x366578[_0x1304('0x145')],_0x1304('0xb5'),_0x4fe66a[_0x1304('0x28')],'pTalking:\x20',_0x4fe66a['pTalking']);this['callProgressDetectingCustomer'](_0x366578,_0x366578[_0x1304('0xaf')],_0x366578['cause']);}else if(this[_0x1304('0x15')][_0x366578['linkedid']]['dialAnswer']){logger[_0x1304('0x5c')](_0x1304('0x148'),_0x366578['linkedid'],_0x366578['cause'],_0x1304('0xb5'),_0x4fe66a[_0x1304('0x28')],_0x1304('0xb6'),_0x4fe66a[_0x1304('0x61')]);this[_0x1304('0x9e')](_0x366578,_0x366578[_0x1304('0xaf')],_0x366578[_0x1304('0x145')]);}}};Preview[_0x1304('0xe')][_0x1304('0x149')]=function(_0x50cec8){if(this['actions'][_0x50cec8[_0x1304('0x14a')]]&&_0x50cec8[_0x1304('0x14a')]!==_0x50cec8['destuniqueid']){this[_0x1304('0x9e')](_0x50cec8,_0x50cec8[_0x1304('0x14a')],_0x50cec8[_0x1304('0xea')]);}};Preview['prototype'][_0x1304('0x1c')]=function(_0x2fcab6){if(this[_0x1304('0x15')][_0x2fcab6[_0x1304('0xaf')]]&&_0x2fcab6['linkedid']!==_0x2fcab6[_0x1304('0xb4')]&&!this[_0x1304('0x15')][_0x2fcab6[_0x1304('0xaf')]][_0x1304('0x73')]){if(_0x2fcab6['cause']==='1'){this[_0x1304('0x9e')](_0x2fcab6,_0x2fcab6[_0x1304('0xaf')],_0x2fcab6['cause']);}}};Preview['prototype'][_0x1304('0x14b')]=function(_0x3d9134,_0x510cd3,_0x3166bd){if(this['actions'][_0x3d9134]){if(_['isNil'](this[_0x1304('0x15')][_0x3d9134][_0x1304('0x14c')])){this[_0x1304('0x15')][_0x3d9134][_0x1304('0x14c')]={};}this['actions'][_0x3d9134][_0x1304('0x14c')][_0x510cd3]=_0x3166bd;}};Preview[_0x1304('0xe')][_0x1304('0x21')]=function(_0xde4345){try{if(!_[_0x1304('0x6f')](_0xde4345)){if(ut[_0x1304('0x14d')](_[_0x1304('0x14e')](_0xde4345[_0x1304('0x14f')])[0x0])){this['addVariable'](_0xde4345['uniqueid'],_[_0x1304('0x14e')](_0xde4345[_0x1304('0x14f')])[0x0],_0xde4345[_0x1304('0x150')]);}}}catch(_0x37f37b){logger[_0x1304('0x151')](_0x1304('0x152'),util[_0x1304('0x153')](_0x37f37b,{'showHidden':![],'depth':null}));}};Preview[_0x1304('0xe')][_0x1304('0x23')]=function(_0x1d310f){if(_0x1d310f){if(this['actions'][_0x1d310f['transfertargetlinkedid']]){this[_0x1304('0x15')][_0x1d310f[_0x1304('0x154')]]['transfer']=!![];}}};Preview[_0x1304('0xe')]['syncBlindTransfer']=function(_0x1aae6a){if(_0x1aae6a){if(this[_0x1304('0x15')][_0x1aae6a['transfererlinkedid']]){this[_0x1304('0x15')][_0x1aae6a[_0x1304('0x155')]][_0x1304('0x156')]=!![];}}};module[_0x1304('0x157')]=Preview; \ No newline at end of file diff --git a/server/services/ami/preview/rpcDb.js b/server/services/ami/preview/rpcDb.js index 5067fc0..3836aba 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 _0x1995=['catch','[createHistory]\x20','moveContactManagedDialer','[moveContactManagedDialer]\x20','checkIsBlackList','[checkIsBlackList]\x20','getContactPreview','createAgentHistory','createCustomerHistory','createCustomerFinal','rescheduleContact','[rescheduleContact]\x20','countReScheduled','unlockContact','[unlockContact]\x20','disableContact','crateCustomerReportQueue','type','uniqueid','calleridnum','calleridname','queuecallerjoinAt','answertime','queuecallercomplete','queuecallercompleteAt','endtime','connectedlinename','from-sip','xcally-motion-preview','holdtime','assigned','lastAssignedTo','membername','queuecallerexitreason','COMPLETED','[voiceQueueReport]\x20','getContactRecallMe','rescheduleContactInQueue','../../../config/logger','preview','../rpc/cmHopper','../rpc/cmHopperFinal','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/voiceQueueRt','../rpc/agentReportPreview','../rpc/voiceQueueReport','error','resolve','then','createHistory'];(function(_0x460429,_0x4040e0){var _0x5e9d55=function(_0x502c79){while(--_0x502c79){_0x460429['push'](_0x460429['shift']());}};_0x5e9d55(++_0x4040e0);}(_0x1995,0x125));var _0x5199=function(_0x8fa4c7,_0x771d38){_0x8fa4c7=_0x8fa4c7-0x0;var _0x1c712b=_0x1995[_0x8fa4c7];return _0x1c712b;};'use strict';var util=require('util');var BPromise=require('bluebird');var logger=require(_0x5199('0x0'))(_0x5199('0x1'));var _=require('lodash');var cmHopper=require(_0x5199('0x2'));var cmHopperFinal=require(_0x5199('0x3'));var cmHopperHistory=require(_0x5199('0x4'));var cmHopperBlack=require(_0x5199('0x5'));var voiceQueueRt=require(_0x5199('0x6'));var agentReportPreview=require(_0x5199('0x7'));var voiceQueueReport=require(_0x5199('0x8'));function loggerCatch(_0xe7572d){return function(_0x5778ec){logger[_0x5199('0x9')](_0xe7572d,util['inspect'](_0x5778ec,{'showHidden':![],'depth':null}));};}function create(_0x1fa329){return BPromise[_0x5199('0xa')]()[_0x5199('0xb')](cmHopperHistory[_0x5199('0xc')](_0x1fa329))[_0x5199('0xd')](loggerCatch(_0x5199('0xe')));}function createAgent(_0x29010c){return BPromise[_0x5199('0xa')]()[_0x5199('0xb')](agentReportPreview[_0x5199('0xc')](_0x29010c))[_0x5199('0xd')](loggerCatch(_0x5199('0xe')));}function moveContact(_0x82d71e){return BPromise[_0x5199('0xa')]()[_0x5199('0xb')](cmHopper[_0x5199('0xf')](_0x82d71e,!![]))[_0x5199('0xd')](loggerCatch(_0x5199('0x10')));}exports[_0x5199('0x11')]=function(_0x38008c){return BPromise[_0x5199('0xa')]()[_0x5199('0xb')](cmHopperBlack['checkIsBlackList'](_0x38008c))[_0x5199('0xd')](loggerCatch(_0x5199('0x12')));};exports['getContactPreview']=function(_0x67701f){return BPromise[_0x5199('0xa')]()[_0x5199('0xb')](cmHopper[_0x5199('0x13')](_0x67701f))[_0x5199('0xd')](loggerCatch('[getContactPreview]\x20'));};exports[_0x5199('0xc')]=function(_0xf42849,_0x7bea21){create(_0xf42849)[_0x5199('0xd')](loggerCatch(_0x7bea21));moveContact(_0xf42849)[_0x5199('0xd')](loggerCatch(_0x7bea21));};exports[_0x5199('0x14')]=function(_0x2c6428,_0x5bd014){createAgent(_0x2c6428)[_0x5199('0xd')](loggerCatch(_0x5bd014));};exports[_0x5199('0x15')]=function(_0x4c1816,_0x30d405){create(_0x4c1816)[_0x5199('0xd')](loggerCatch(_0x30d405));};exports[_0x5199('0x16')]=function(_0x54ed3f,_0x1d780f){moveContact(_0x54ed3f)[_0x5199('0xd')](loggerCatch(_0x1d780f));};exports[_0x5199('0x17')]=function(_0x15f0f7,_0x21f3e5,_0x3bba7e){if(_0x21f3e5){_0x15f0f7['UserId']=null;}if(_0x3bba7e){_0x15f0f7['active']=![];}return BPromise[_0x5199('0xa')]()[_0x5199('0xb')](cmHopper[_0x5199('0x17')](_0x15f0f7))[_0x5199('0xd')](loggerCatch(_0x5199('0x18')));};exports['countReScheduled']=function(_0x44802e){return BPromise[_0x5199('0xa')]()[_0x5199('0xb')](cmHopper[_0x5199('0x19')](_0x44802e))[_0x5199('0xd')](loggerCatch('[countReScheduled]\x20'));};exports[_0x5199('0x1a')]=function(_0xe398a4){return BPromise[_0x5199('0xa')]()[_0x5199('0xb')](cmHopper[_0x5199('0x1a')]({'UserId':null},_0xe398a4,0x1))[_0x5199('0xd')](loggerCatch(_0x5199('0x1b')));};exports[_0x5199('0x1c')]=function(_0x54cae0){return BPromise[_0x5199('0xa')]()['then'](cmHopper[_0x5199('0x1a')]({'active':![]},_0x54cae0,0x1))['catch'](loggerCatch('[activeContact]\x20'));};exports[_0x5199('0x1d')]=function(_0x559728){var _0x5b1f37={};_0x5b1f37[_0x5199('0x1e')]=_0x559728[_0x5199('0x1e')];_0x5b1f37['uniqueid']=_0x559728[_0x5199('0x1f')];_0x5b1f37[_0x5199('0x20')]=_0x559728[_0x5199('0x20')];_0x5b1f37[_0x5199('0x21')]=_0x559728[_0x5199('0x21')];_0x5b1f37['queue']=_0x559728['queue'];_0x5b1f37[_0x5199('0x22')]=_0x559728[_0x5199('0x23')];_0x5b1f37['queuecallerleaveAt']=_0x559728[_0x5199('0x23')];_0x5b1f37[_0x5199('0x24')]=0x1;_0x5b1f37[_0x5199('0x25')]=_0x559728[_0x5199('0x26')];_0x5b1f37[_0x5199('0x27')]=_0x559728['membername'];_0x5b1f37['context']=_0x5199('0x28');_0x5b1f37['exten']=_0x5199('0x29');_0x5b1f37[_0x5199('0x2a')]=0x0;_0x5b1f37[_0x5199('0x2b')]=0x1;_0x5b1f37[_0x5199('0x2c')]=_0x559728[_0x5199('0x2d')];_0x5b1f37[_0x5199('0x2e')]=_0x5199('0x2f');return BPromise[_0x5199('0xa')]()[_0x5199('0xb')](voiceQueueReport['create'](_0x5b1f37))[_0x5199('0xd')](loggerCatch(_0x5199('0x30')));};exports[_0x5199('0x31')]=function(_0x40bba5,_0x1c894e){return BPromise[_0x5199('0xa')]()['then'](cmHopper[_0x5199('0x31')](_0x40bba5,_0x1c894e))['catch'](loggerCatch('[GetContactRecallMe]\x20'));};exports[_0x5199('0x32')]=function(_0x40613e){return BPromise['resolve']()[_0x5199('0xb')](cmHopper[_0x5199('0x17')](_0x40613e,!![],!![]))[_0x5199('0xd')](loggerCatch('[rescheduleContactInQueue]\x20'));}; \ No newline at end of file +var _0xd395=['uniqueid','calleridname','queue','queuecallerjoinAt','answertime','queuecallercomplete','queuecallercompleteAt','membername','context','from-sip','exten','xcally-motion-preview','lastAssignedTo','queuecallerexitreason','[voiceQueueReport]\x20','getContactRecallMe','[GetContactRecallMe]\x20','rescheduleContactInQueue','[rescheduleContactInQueue]\x20','util','bluebird','../../../config/logger','preview','lodash','../rpc/cmHopper','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/voiceQueueRt','../rpc/agentReportPreview','../rpc/voiceQueueReport','error','resolve','then','createHistory','catch','[createHistory]\x20','moveContactManagedDialer','[moveContactManagedDialer]\x20','checkIsBlackList','getContactPreview','[getContactPreview]\x20','createAgentHistory','createCustomerFinal','UserId','active','rescheduleContact','[rescheduleContact]\x20','countReScheduled','[countReScheduled]\x20','unlockContact','[unlockContact]\x20','disableContact','[activeContact]\x20','crateCustomerReportQueue','type'];(function(_0x5400a1,_0x2275aa){var _0x4006c7=function(_0x5002dc){while(--_0x5002dc){_0x5400a1['push'](_0x5400a1['shift']());}};_0x4006c7(++_0x2275aa);}(_0xd395,0x15d));var _0x5d39=function(_0x467657,_0x10c346){_0x467657=_0x467657-0x0;var _0x2f8acd=_0xd395[_0x467657];return _0x2f8acd;};'use strict';var util=require(_0x5d39('0x0'));var BPromise=require(_0x5d39('0x1'));var logger=require(_0x5d39('0x2'))(_0x5d39('0x3'));var _=require(_0x5d39('0x4'));var cmHopper=require(_0x5d39('0x5'));var cmHopperFinal=require('../rpc/cmHopperFinal');var cmHopperHistory=require(_0x5d39('0x6'));var cmHopperBlack=require(_0x5d39('0x7'));var voiceQueueRt=require(_0x5d39('0x8'));var agentReportPreview=require(_0x5d39('0x9'));var voiceQueueReport=require(_0x5d39('0xa'));function loggerCatch(_0x16fa49){return function(_0x113375){logger[_0x5d39('0xb')](_0x16fa49,util['inspect'](_0x113375,{'showHidden':![],'depth':null}));};}function create(_0x3ea6ea){return BPromise[_0x5d39('0xc')]()[_0x5d39('0xd')](cmHopperHistory[_0x5d39('0xe')](_0x3ea6ea))[_0x5d39('0xf')](loggerCatch(_0x5d39('0x10')));}function createAgent(_0x2dc2ba){return BPromise['resolve']()[_0x5d39('0xd')](agentReportPreview[_0x5d39('0xe')](_0x2dc2ba))[_0x5d39('0xf')](loggerCatch(_0x5d39('0x10')));}function moveContact(_0x1c3581){return BPromise[_0x5d39('0xc')]()[_0x5d39('0xd')](cmHopper[_0x5d39('0x11')](_0x1c3581,!![]))[_0x5d39('0xf')](loggerCatch(_0x5d39('0x12')));}exports[_0x5d39('0x13')]=function(_0x7e0c20){return BPromise['resolve']()['then'](cmHopperBlack[_0x5d39('0x13')](_0x7e0c20))[_0x5d39('0xf')](loggerCatch('[checkIsBlackList]\x20'));};exports[_0x5d39('0x14')]=function(_0x2bb161){return BPromise['resolve']()[_0x5d39('0xd')](cmHopper['getContactPreview'](_0x2bb161))[_0x5d39('0xf')](loggerCatch(_0x5d39('0x15')));};exports[_0x5d39('0xe')]=function(_0x5c82c3,_0x4ab667){create(_0x5c82c3)['catch'](loggerCatch(_0x4ab667));moveContact(_0x5c82c3)['catch'](loggerCatch(_0x4ab667));};exports[_0x5d39('0x16')]=function(_0x2a3a01,_0x57b05a){createAgent(_0x2a3a01)[_0x5d39('0xf')](loggerCatch(_0x57b05a));};exports['createCustomerHistory']=function(_0x1a18ed,_0x5780f2){create(_0x1a18ed)['catch'](loggerCatch(_0x5780f2));};exports[_0x5d39('0x17')]=function(_0x394e81,_0x149a76){moveContact(_0x394e81)['catch'](loggerCatch(_0x149a76));};exports['rescheduleContact']=function(_0x46ced5,_0x3a0c,_0x5888b4){if(_0x3a0c){_0x46ced5[_0x5d39('0x18')]=null;}if(_0x5888b4){_0x46ced5[_0x5d39('0x19')]=![];}return BPromise['resolve']()[_0x5d39('0xd')](cmHopper[_0x5d39('0x1a')](_0x46ced5))[_0x5d39('0xf')](loggerCatch(_0x5d39('0x1b')));};exports[_0x5d39('0x1c')]=function(_0x1d71cb){return BPromise[_0x5d39('0xc')]()[_0x5d39('0xd')](cmHopper[_0x5d39('0x1c')](_0x1d71cb))[_0x5d39('0xf')](loggerCatch(_0x5d39('0x1d')));};exports[_0x5d39('0x1e')]=function(_0x31075d){return BPromise[_0x5d39('0xc')]()[_0x5d39('0xd')](cmHopper['unlockContact']({'UserId':null},_0x31075d,0x1))[_0x5d39('0xf')](loggerCatch(_0x5d39('0x1f')));};exports[_0x5d39('0x20')]=function(_0x13bf04){return BPromise[_0x5d39('0xc')]()['then'](cmHopper[_0x5d39('0x1e')]({'active':![]},_0x13bf04,0x1))['catch'](loggerCatch(_0x5d39('0x21')));};exports[_0x5d39('0x22')]=function(_0x3d640a){var _0xda692b={};_0xda692b['type']=_0x3d640a[_0x5d39('0x23')];_0xda692b[_0x5d39('0x24')]=_0x3d640a[_0x5d39('0x24')];_0xda692b['calleridnum']=_0x3d640a['calleridnum'];_0xda692b[_0x5d39('0x25')]=_0x3d640a[_0x5d39('0x25')];_0xda692b[_0x5d39('0x26')]=_0x3d640a[_0x5d39('0x26')];_0xda692b[_0x5d39('0x27')]=_0x3d640a[_0x5d39('0x28')];_0xda692b['queuecallerleaveAt']=_0x3d640a[_0x5d39('0x28')];_0xda692b[_0x5d39('0x29')]=0x1;_0xda692b[_0x5d39('0x2a')]=_0x3d640a['endtime'];_0xda692b['connectedlinename']=_0x3d640a[_0x5d39('0x2b')];_0xda692b[_0x5d39('0x2c')]=_0x5d39('0x2d');_0xda692b[_0x5d39('0x2e')]=_0x5d39('0x2f');_0xda692b['holdtime']=0x0;_0xda692b['assigned']=0x1;_0xda692b[_0x5d39('0x30')]=_0x3d640a['membername'];_0xda692b[_0x5d39('0x31')]='COMPLETED';return BPromise['resolve']()[_0x5d39('0xd')](voiceQueueReport['create'](_0xda692b))[_0x5d39('0xf')](loggerCatch(_0x5d39('0x32')));};exports[_0x5d39('0x33')]=function(_0xbc97e5,_0xc18f47){return BPromise[_0x5d39('0xc')]()[_0x5d39('0xd')](cmHopper['getContactRecallMe'](_0xbc97e5,_0xc18f47))[_0x5d39('0xf')](loggerCatch(_0x5d39('0x34')));};exports[_0x5d39('0x35')]=function(_0x54bf06){return BPromise[_0x5d39('0xc')]()[_0x5d39('0xd')](cmHopper[_0x5d39('0x1a')](_0x54bf06,!![],!![]))[_0x5d39('0xf')](loggerCatch(_0x5d39('0x36')));}; \ 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 fc4f7c5..80bb951 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 _0xa3ab=['name','calleridname','ContactId','dialer','dialOriginateTimeout','\x22rtTxX%s%s\x22','dialQueueProject2','monitor_format','dialPreviewUrl','dialQueueProject','\x22agi://%s/square,%s\x22','NONE','originatecalleridnum','originatecalleridname','xcally-motion-preview','_XCALLY_MIXMONITOR_FORMAT','Contact','hasOwnProperty','tags','createdAt','updatedAt','%s%s','XMD-','toUpper','toLowerVariables','toLower','updateOriginated','originated','error','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','logBlacklist','YYYY-MM-DD\x20HH:mm:ss','state','starttime','responsetime','endtime','logAgent','statedesc','ringtime','logLookAgent','UserId','logCustomer','talktime','answertime','variablesAction','RECALL','uniqueid','originate','channelAgent','calleridnum','timeout','totalGlobal','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','cloneAction','clone','Global','scheduledAt','active','scheduledat','add','ListId','decrementTalkink','pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','IsNotLoggedIn','buildObj','interface','motionChannel','voice','mandatoryDisposition','buildAcw','queue','not_inuse','reachable','push','getDiff','milliseconds','createBody','VoiceQueueId','filterKey','type','campaigntype','membername','countglobal','callback','callbackuniqueid','callbackat','xmd-voicequeueid','xmd-queue','xmd-phone','xmd-listid','xmd-dialurl','xmd-dialtimeout','xmd-dialid','xmd-cdrtype','xmd-callerid','xmd-agiafter','rtpaudioqos','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosbridged','bridgepeer','bridgepvtcallid','getCallerIdRandom','random','extractCalleridName','match','extractCalleridNumber','util','lodash','moment','../../../../config/logger','preview','XCALLY_IP_AGI','diff','loggerCatch','inspect','logger','info','loggerError','logger2','message','getCallerId','isUndefined','string','isEmpty','format','\x22%s\x22\x20<%s>','\x22\x22\x20<>','isActive','isNil','addVariables','Queue'];(function(_0x2c5594,_0x3c6a36){var _0x1825fb=function(_0x3850fe){while(--_0x3850fe){_0x2c5594['push'](_0x2c5594['shift']());}};_0x1825fb(++_0x3c6a36);}(_0xa3ab,0x18b));var _0xba3a=function(_0x3cc387,_0x3197a6){_0x3cc387=_0x3cc387-0x0;var _0x59cf35=_0xa3ab[_0x3cc387];return _0x59cf35;};'use strict';var util=require(_0xba3a('0x0'));var _=require(_0xba3a('0x1'));var moment=require(_0xba3a('0x2'));var logger=require(_0xba3a('0x3'))(_0xba3a('0x4'));var ipAgi=process['env'][_0xba3a('0x5')]||'127.0.0.1';function getSeconds(_0x24b0b5,_0x457909){var _0x21906d=moment(_0x24b0b5)['milliseconds'](0x0);var _0x3cec45=moment(_0x457909)['milliseconds'](0x0);return _0x21906d[_0xba3a('0x6')](_0x3cec45,'seconds');}exports[_0xba3a('0x7')]=function(_0x2e6b0d){return function(_0x62cd95){logger['error'](_0x2e6b0d,util[_0xba3a('0x8')](_0x62cd95,{'showHidden':![],'depth':null}));};};exports[_0xba3a('0x9')]=function(_0x5146e2,_0x32c4ee){logger[_0xba3a('0xa')](_0x5146e2,util[_0xba3a('0x8')](_0x32c4ee,{'showHidden':![],'depth':null}));};exports[_0xba3a('0xb')]=function(_0x24e608,_0x58c077){logger['error'](_0x24e608,util[_0xba3a('0x8')](_0x58c077,{'showHidden':![],'depth':null}));};exports[_0xba3a('0xc')]=function(_0x16a55d){return function(_0x4d5a48){logger['info'](_0x16a55d,util[_0xba3a('0x8')](_0x4d5a48,{'showHidden':![],'depth':null}));};};exports[_0xba3a('0xd')]=function(_0x542c8a,_0x319d47,_0x50cf34){return{'message':_0x542c8a,'unlock':_0x319d47,'active':_0x50cf34};};exports[_0xba3a('0xe')]=function(_0xd9cae,_0x258ae4,_0x862989){if(!_[_0xba3a('0xf')](_0x862989)&&_0xba3a('0x10')===typeof _0x862989&&!_[_0xba3a('0x11')](_0x862989)){if(!_[_0xba3a('0xf')](_0x258ae4)&&_0xba3a('0x10')===typeof _0x258ae4&&!_[_0xba3a('0x11')](_0x258ae4)){return util[_0xba3a('0x12')](_0xba3a('0x13'),_0x258ae4,_0x862989);}return util[_0xba3a('0x12')]('\x22%s\x22\x20<%s>',_0x862989,_0x862989);}if(!_['isUndefined'](_0xd9cae)&&'string'===typeof _0xd9cae&&!_[_0xba3a('0x11')](_0xd9cae)){return _0xd9cae;}return _0xba3a('0x14');};exports[_0xba3a('0x15')]=function(_0x3cf964){if(_[_0xba3a('0x16')](_0x3cf964)){return![];}return _0x3cf964;};exports[_0xba3a('0x17')]=function(_0x125765,_0x4e1a2b,_0x23b6f3,_0x521460,_0x45357b,_0x549948){var _0x594c71={'XMD-QUEUE':_0x4e1a2b[_0xba3a('0x18')]?_0x4e1a2b['Queue'][_0xba3a('0x19')]:'','XMD-CALLERID':_0x521460,'XMD-CALLERID-PREVIEW':_0x549948?util[_0xba3a('0x12')](_0xba3a('0x13'),_0x549948[_0xba3a('0x1a')],_0x549948['calleridnum']):_0x521460,'XMD-DIALID':_0x45357b,'XMD-CONTACTID':_0x4e1a2b[_0xba3a('0x1b')],'XMD-CDRTYPE':_0xba3a('0x1c'),'CALLERID(all)':_0x521460,'XMD-VOICEQUEUEID':_0x4e1a2b['VoiceQueueId'],'XMD-DIALCHANNEL':_0x23b6f3,'XMD-DIALTIMEOUT':_0x125765[_0xba3a('0x1d')]||0x1e,'XMD-DIALOPTIONS':util[_0xba3a('0x12')](_0xba3a('0x1e'),_0x125765[_0xba3a('0x1f')]?'g':'',_['isEmpty'](_0x125765[_0xba3a('0x20')])?'':'U(xcally-mixmonitor-context)'),'XMD-DIALURL':_0x125765[_0xba3a('0x21')]||'','XMD-AGI':_0x125765[_0xba3a('0x22')]?util['format'](_0xba3a('0x23'),ipAgi,_0x125765[_0xba3a('0x22')]):_0xba3a('0x24'),'XMD-AGIAFTER':_0x125765[_0xba3a('0x1f')]?util[_0xba3a('0x12')](_0xba3a('0x23'),ipAgi,_0x125765[_0xba3a('0x1f')]):_0xba3a('0x24'),'XMD-ORIGINATECALLERIDNUM':_0x549948?_0x549948[_0xba3a('0x25')]:'','XMD-ORIGINATECALLERIDNAME':_0x549948?_0x549948[_0xba3a('0x26')]:'','XMD-DESTINATION':_0xba3a('0x27')};if(!_['isEmpty'](_0x125765[_0xba3a('0x20')])){_0x594c71[util[_0xba3a('0x12')]('%s',_0xba3a('0x28'))]=_0x125765['monitor_format'];_0x594c71[util['format']('%s','_XCALLY_MIXMONITOR_UNIQUEID')]=_0x45357b;}if(_0x4e1a2b&&_0x4e1a2b['Contact']){for(var _0x4f4865 in _0x4e1a2b[_0xba3a('0x29')]){if(_0x4e1a2b[_0xba3a('0x29')][_0xba3a('0x2a')](_0x4f4865)){if(!_['isNil'](_0x4e1a2b[_0xba3a('0x29')][_0x4f4865])&&_0x4f4865!=='id'&&_0x4f4865!==_0xba3a('0x2b')&&_0x4f4865!==_0xba3a('0x2c')&&_0x4f4865!==_0xba3a('0x2d')){_0x594c71[util[_0xba3a('0x12')](_0xba3a('0x2e'),_0xba3a('0x2f'),_[_0xba3a('0x30')](_0x4f4865))]=_0x4e1a2b[_0xba3a('0x29')][_0x4f4865];}}}}return _0x594c71;};exports[_0xba3a('0x31')]=function(_0x24e8c3){var _0xf0216d={};for(var _0x51bb91 in _0x24e8c3){if(_0x24e8c3['hasOwnProperty'](_0x51bb91)){_0xf0216d[util[_0xba3a('0x12')]('%s',_[_0xba3a('0x32')](_0x51bb91))]=_0x24e8c3[_0x51bb91];}}return{'variables':_0xf0216d};};exports[_0xba3a('0x33')]=function(_0x4d7241,_0x4e084c){if(!_[_0xba3a('0x16')](_0x4d7241)){if(_0x4d7241[_0xba3a('0x2a')]('originated')){if(_0x4d7241['originated']>0x0){_0x4d7241[_0xba3a('0x34')]-=0x1;}else{logger[_0xba3a('0x35')](_0xba3a('0x36'),_0x4e084c);}}}else{logger['error'](_0xba3a('0x37'),_0x4e084c);}};exports[_0xba3a('0x38')]=function(_0x5254f6){var _0x833a97=moment()['format'](_0xba3a('0x39'));_0x5254f6[_0xba3a('0x3a')]=0xd;_0x5254f6['statedesc']='Blacklist';_0x5254f6[_0xba3a('0x3b')]=_0x833a97;_0x5254f6[_0xba3a('0x3c')]=_0x833a97;_0x5254f6[_0xba3a('0x3d')]=_0x833a97;};exports[_0xba3a('0x3e')]=function(_0x72494e,_0xb71891,_0x32ace3){var _0x2ebbdb=moment()['format'](_0xba3a('0x39'));_0x72494e[_0xba3a('0x3a')]=_0xb71891;_0x72494e[_0xba3a('0x3f')]=_0x32ace3;_0x72494e[_0xba3a('0x3c')]=_0x2ebbdb;_0x72494e[_0xba3a('0x40')]=getSeconds(_0x72494e[_0xba3a('0x3c')],_0x72494e['starttime']);};exports[_0xba3a('0x41')]=function(_0x52535e,_0x583ae9,_0x4fd94c){_0x52535e['membername']=_0x583ae9;_0x52535e[_0xba3a('0x42')]=_0x4fd94c;};exports[_0xba3a('0x43')]=function(_0xb2e9df,_0x8e68f0,_0x22dd31){var _0x32347b=moment()['format'](_0xba3a('0x39'));_0xb2e9df[_0xba3a('0x3a')]=_0x8e68f0;_0xb2e9df[_0xba3a('0x3f')]=_0x22dd31;_0xb2e9df[_0xba3a('0x3c')]=_0xb2e9df['responsetime']?_0xb2e9df['responsetime']:_0x32347b;_0xb2e9df[_0xba3a('0x3d')]=_0xb2e9df[_0xba3a('0x3d')]?_0xb2e9df[_0xba3a('0x3d')]:_0x32347b;_0xb2e9df[_0xba3a('0x40')]=getSeconds(_0xb2e9df[_0xba3a('0x3c')]||0x0,_0xb2e9df[_0xba3a('0x3b')]||0x0);_0xb2e9df[_0xba3a('0x44')]=_0xb2e9df['answertime']?getSeconds(_0xb2e9df[_0xba3a('0x3d')],_0xb2e9df[_0xba3a('0x45')]):0x0;};exports['isFailure']=function(_0x201b9b){return _0x201b9b==='Failure';};exports[_0xba3a('0x46')]=function(_0x35108a,_0x5963a0,_0x2941b8,_0x57bc6d,_0x49ff10){var _0xed8474=_0x57bc6d?_0xba3a('0x47'):_0x35108a[_0xba3a('0x1a')];_0xed8474=_0x49ff10?'BOOKED':_0xed8474;return{'actionid':_0x35108a[_0xba3a('0x48')],'action':_0xba3a('0x49'),'channel':_0x35108a[_0xba3a('0x4a')],'callerid':util[_0xba3a('0x12')]('\x22%s\x22\x20<%s>',_0xed8474,_0x35108a[_0xba3a('0x4b')]),'Exten':_0xba3a('0x27'),'Context':'from-sip','Priority':'1','variable':_0x2941b8,'timeout':(_0x5963a0[_0xba3a('0x4c')]||0x1e)*0x3e8,'async':!![],'channelid':_0x35108a[_0xba3a('0x48')]};};exports[_0xba3a('0x4d')]=function(_0x21aaaf){return _0x21aaaf[_0xba3a('0x4e')]+_0x21aaaf[_0xba3a('0x4f')]+_0x21aaaf[_0xba3a('0x50')]+_0x21aaaf['countagentrejectretry']+_0x21aaaf[_0xba3a('0x51')];};exports[_0xba3a('0x52')]=function(_0x104b4f){var _0x33d2a1=_[_0xba3a('0x53')](_0x104b4f);_0x33d2a1[_0xba3a('0x3a')]=0xf;_0x33d2a1[_0xba3a('0x3f')]=_0xba3a('0x54');return _0x33d2a1;};exports[_0xba3a('0x55')]=function(_0x25d119,_0x13f941,_0x5a132c){var _0x305a2f={};_0x305a2f[_0x13f941]=_0x25d119[_0x13f941];_0x305a2f[_0xba3a('0x56')]=![];_0x305a2f[_0xba3a('0x57')]=moment()[_0xba3a('0x58')](_0x5a132c,'minutes')[_0xba3a('0x12')](_0xba3a('0x39'));_0x305a2f[_0xba3a('0x1b')]=_0x25d119[_0xba3a('0x1b')];_0x305a2f[_0xba3a('0x59')]=_0x25d119['ListId'];_0x305a2f['VoiceQueueId']=_0x25d119['VoiceQueueId']||undefined;return _0x305a2f;};exports[_0xba3a('0x5a')]=function(_0x54e9a3,_0x3aeaf6){if(!_[_0xba3a('0x16')](_0x54e9a3)){if(_0x54e9a3['pTalking']>0x0){_0x54e9a3[_0xba3a('0x5b')]-=0x1;}else{logger[_0xba3a('0x35')](_0x3aeaf6,_0xba3a('0x5c'));}}else{logger[_0xba3a('0x35')](_0x3aeaf6,'[decrementTalkink]\x20is\x20null\x20or\x20undefined');}};exports[_0xba3a('0x5d')]=function(_0x3f0ae1){if(_0x3f0ae1<=0x0){return!![];}return![];};exports[_0xba3a('0x5e')]=function(_0x54ffae,_0x5494e7,_0x4f16ff){_0x54ffae['lastevent']=_0x5494e7;_0x54ffae[_0xba3a('0x19')]=_0x54ffae['queue'];_0x54ffae[_0xba3a('0x5f')]=_0x54ffae[_0xba3a('0x4a')];_0x54ffae[_0xba3a('0x60')]=_0xba3a('0x61');if(_0x4f16ff){_0x54ffae[_0xba3a('0x62')]=_0x4f16ff[_0xba3a('0x62')];}return _0x54ffae;};exports[_0xba3a('0x63')]=function(_0x21cefc){var _0x8ab76={};_0x8ab76[_0xba3a('0x64')]=_0x21cefc['queue'];_0x8ab76[_0xba3a('0x5f')]=_0x21cefc[_0xba3a('0x4a')];_0x8ab76['uniqueid']=_0x21cefc['uniqueid'];return _0x8ab76;};exports['agentReadyId']=function(_0x1f2efb){var _0x11aebf=[];for(var _0x28e7c1 in _0x1f2efb){if(_0x1f2efb[_0xba3a('0x2a')](_0x28e7c1)){if(!_[_0xba3a('0x16')](_0x1f2efb[_0x28e7c1])&&_0x1f2efb[_0x28e7c1][_0xba3a('0x3a')]===_0xba3a('0x65')&&_0x1f2efb[_0x28e7c1]['status']===_0xba3a('0x66')){_0x11aebf[_0xba3a('0x67')](_0x1f2efb[_0x28e7c1]['id']);}}}return _0x11aebf;};exports[_0xba3a('0x68')]=function(_0x4294a7){var _0x4269af=moment()['milliseconds'](0x0);var _0x53acf9=moment(_0x4294a7)[_0xba3a('0x69')](0x0);return _0x4269af[_0xba3a('0x6')](_0x53acf9,'seconds');};exports[_0xba3a('0x6a')]=function(_0x5bda30){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x5bda30[_0xba3a('0x1b')],'ListId':_0x5bda30[_0xba3a('0x59')],'VoiceQueueId':_0x5bda30[_0xba3a('0x6b')]||undefined,'CampaignId':_0x5bda30['CampaignId']||undefined};};exports[_0xba3a('0x6c')]=function(_0x3030e1){if(_0x3030e1===_0xba3a('0x48')||_0x3030e1==='idContact'||_0x3030e1===_0xba3a('0x64')||_0x3030e1===_0xba3a('0x6d')||_0x3030e1===_0xba3a('0x6e')||_0x3030e1==='dialAnswer'||_0x3030e1===_0xba3a('0x6f')||_0x3030e1===_0xba3a('0x4a')||_0x3030e1===_0xba3a('0x1a')||_0x3030e1===_0xba3a('0x56')||_0x3030e1===_0xba3a('0x4b')||_0x3030e1===_0xba3a('0x57')||_0x3030e1===_0xba3a('0x4e')||_0x3030e1===_0xba3a('0x4f')||_0x3030e1===_0xba3a('0x50')||_0x3030e1===_0xba3a('0x70')||_0x3030e1===_0xba3a('0x71')||_0x3030e1===_0xba3a('0x72')||_0x3030e1===_0xba3a('0x73')||_0x3030e1==='recallme'||_0x3030e1===_0xba3a('0x1b')||_0x3030e1===_0xba3a('0x59')||_0x3030e1===_0xba3a('0x42')||_0x3030e1==='VoiceQueueId'||_0x3030e1==='sipcallid'||_0x3030e1===_0xba3a('0x74')||_0x3030e1===_0xba3a('0x75')||_0x3030e1===_0xba3a('0x76')||_0x3030e1===_0xba3a('0x77')||_0x3030e1===_0xba3a('0x78')||_0x3030e1===_0xba3a('0x79')||_0x3030e1==='xmd-dialoptions'||_0x3030e1===_0xba3a('0x7a')||_0x3030e1==='xmd-dialchannel'||_0x3030e1==='xmd-contactid'||_0x3030e1===_0xba3a('0x7b')||_0x3030e1===_0xba3a('0x7c')||_0x3030e1===_0xba3a('0x7d')||_0x3030e1==='xmd-agi'||_0x3030e1===_0xba3a('0x7e')||_0x3030e1==='rtpaudioqosbridged'||_0x3030e1===_0xba3a('0x7f')||_0x3030e1===_0xba3a('0x80')||_0x3030e1===_0xba3a('0x81')||_0x3030e1===_0xba3a('0x82')||_0x3030e1===_0xba3a('0x83')||_0x3030e1==='rtpaudioqosrttbridged'||_0x3030e1===_0xba3a('0x7e')||_0x3030e1===_0xba3a('0x84')||_0x3030e1===_0xba3a('0x7f')||_0x3030e1===_0xba3a('0x80')||_0x3030e1===_0xba3a('0x81')||_0x3030e1===_0xba3a('0x82')||_0x3030e1===_0xba3a('0x83')||_0x3030e1==='rtpaudioqosrttbridged'||_0x3030e1===_0xba3a('0x85')||_0x3030e1===_0xba3a('0x86')||_0x3030e1===_0xba3a('0x3a')||_0x3030e1==='statedesc'){return![];}return!![];};exports[_0xba3a('0x87')]=function(_0x488327,_0x178892){var _0x3bc882,_0x5a94a8,_0x4991c3;if(_0x178892<=0x0){_0x178892=0x1;}_0x3bc882=new RegExp('\x5cw{0,'+_0x178892+'}$');_0x5a94a8=Math['pow'](0xa,_0x178892-0x1);_0x4991c3=Math['pow'](0xa,_0x178892)-0x1;return util[_0xba3a('0x12')]('%s',_['replace'](_0x488327,_0x3bc882,_[_0xba3a('0x88')](_0x5a94a8,_0x4991c3)));};exports[_0xba3a('0x89')]=function(_0x5ddfd8){var _0x1c8001=_0x5ddfd8[_0xba3a('0x8a')](/"(.*?)"/);return _0x1c8001?_0x1c8001[0x1]:_0x5ddfd8;};exports[_0xba3a('0x8b')]=function(_0x4899d1){var _0x48df52=_0x4899d1[_0xba3a('0x8a')](/<(.*?)>/);return _0x48df52?_0x48df52[0x1]:_0x4899d1;}; \ No newline at end of file +var _0x6529=['loggerError','error','logger2','message','getCallerId','isUndefined','string','isEmpty','format','\x22%s\x22\x20<%s>','isActive','isNil','addVariables','Queue','calleridnum','ContactId','dialer','dialOriginateTimeout','\x22rtTxX%s%s\x22','dialQueueProject2','monitor_format','U(xcally-mixmonitor-context)','\x22agi://%s/square,%s\x22','NONE','originatecalleridnum','originatecalleridname','xcally-motion-preview','_XCALLY_MIXMONITOR_FORMAT','_XCALLY_MIXMONITOR_UNIQUEID','Contact','hasOwnProperty','tags','updatedAt','%s%s','toLowerVariables','toLower','updateOriginated','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','logBlacklist','YYYY-MM-DD\x20HH:mm:ss','state','statedesc','Blacklist','starttime','responsetime','logAgent','ringtime','logLookAgent','membername','UserId','endtime','answertime','Failure','variablesAction','RECALL','calleridname','BOOKED','uniqueid','originate','channelAgent','from-sip','timeout','totalGlobal','countcongestionretry','countagentrejectretry','countnosuchnumberretry','clone','Global','scheduledAt','active','add','minutes','ListId','VoiceQueueId','decrementTalkink','pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','IsNotLoggedIn','buildObj','lastevent','name','queue','motionChannel','voice','mandatoryDisposition','buildAcw','agentReadyId','not_inuse','status','reachable','push','diff','seconds','CampaignId','filterKey','type','campaigntype','scheduledat','countbusyretry','countnoanswerretry','callback','recallme','sipcallid','xmd-voicequeueid','xmd-queue','xmd-phone','xmd-listid','xmd-dialurl','xmd-dialtimeout','xmd-dialoptions','xmd-dialid','xmd-dialchannel','xmd-cdrtype','xmd-callerid','xmd-agiafter','xmd-agi','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqosrttbridged','rtpaudioqosjitter','rtpaudioqoslossbridged','getCallerIdRandom','pow','replace','random','extractCalleridName','match','extractCalleridNumber','util','lodash','moment','../../../../config/logger','preview','milliseconds','loggerCatch','info','inspect'];(function(_0x5d61b4,_0x4f7b91){var _0x183fc5=function(_0x5ecf92){while(--_0x5ecf92){_0x5d61b4['push'](_0x5d61b4['shift']());}};_0x183fc5(++_0x4f7b91);}(_0x6529,0x111));var _0x9652=function(_0x53c076,_0x17ca1d){_0x53c076=_0x53c076-0x0;var _0x36bd60=_0x6529[_0x53c076];return _0x36bd60;};'use strict';var util=require(_0x9652('0x0'));var _=require(_0x9652('0x1'));var moment=require(_0x9652('0x2'));var logger=require(_0x9652('0x3'))(_0x9652('0x4'));var ipAgi=process['env']['XCALLY_IP_AGI']||'127.0.0.1';function getSeconds(_0x5c8fd8,_0x18f069){var _0x1a6303=moment(_0x5c8fd8)[_0x9652('0x5')](0x0);var _0x5354c0=moment(_0x18f069)[_0x9652('0x5')](0x0);return _0x1a6303['diff'](_0x5354c0,'seconds');}exports[_0x9652('0x6')]=function(_0x2b9863){return function(_0x22f047){logger['error'](_0x2b9863,util['inspect'](_0x22f047,{'showHidden':![],'depth':null}));};};exports['logger']=function(_0x29f069,_0x1217b3){logger[_0x9652('0x7')](_0x29f069,util[_0x9652('0x8')](_0x1217b3,{'showHidden':![],'depth':null}));};exports[_0x9652('0x9')]=function(_0x121f15,_0x3dfba2){logger[_0x9652('0xa')](_0x121f15,util[_0x9652('0x8')](_0x3dfba2,{'showHidden':![],'depth':null}));};exports[_0x9652('0xb')]=function(_0xa6ae1a){return function(_0x88ca18){logger['info'](_0xa6ae1a,util[_0x9652('0x8')](_0x88ca18,{'showHidden':![],'depth':null}));};};exports[_0x9652('0xc')]=function(_0x108ff8,_0x746ea1,_0xfd9805){return{'message':_0x108ff8,'unlock':_0x746ea1,'active':_0xfd9805};};exports[_0x9652('0xd')]=function(_0xa742cd,_0x2a8ae0,_0x292226){if(!_[_0x9652('0xe')](_0x292226)&&_0x9652('0xf')===typeof _0x292226&&!_[_0x9652('0x10')](_0x292226)){if(!_[_0x9652('0xe')](_0x2a8ae0)&&_0x9652('0xf')===typeof _0x2a8ae0&&!_[_0x9652('0x10')](_0x2a8ae0)){return util[_0x9652('0x11')](_0x9652('0x12'),_0x2a8ae0,_0x292226);}return util[_0x9652('0x11')]('\x22%s\x22\x20<%s>',_0x292226,_0x292226);}if(!_['isUndefined'](_0xa742cd)&&_0x9652('0xf')===typeof _0xa742cd&&!_[_0x9652('0x10')](_0xa742cd)){return _0xa742cd;}return'\x22\x22\x20<>';};exports[_0x9652('0x13')]=function(_0x27dc8f){if(_[_0x9652('0x14')](_0x27dc8f)){return![];}return _0x27dc8f;};exports[_0x9652('0x15')]=function(_0x119539,_0x416599,_0xde0c49,_0x565c96,_0x575ef2,_0x419466){var _0x1aacc8={'XMD-QUEUE':_0x416599[_0x9652('0x16')]?_0x416599[_0x9652('0x16')]['name']:'','XMD-CALLERID':_0x565c96,'XMD-CALLERID-PREVIEW':_0x419466?util[_0x9652('0x11')](_0x9652('0x12'),_0x419466['calleridname'],_0x419466[_0x9652('0x17')]):_0x565c96,'XMD-DIALID':_0x575ef2,'XMD-CONTACTID':_0x416599[_0x9652('0x18')],'XMD-CDRTYPE':_0x9652('0x19'),'CALLERID(all)':_0x565c96,'XMD-VOICEQUEUEID':_0x416599['VoiceQueueId'],'XMD-DIALCHANNEL':_0xde0c49,'XMD-DIALTIMEOUT':_0x119539[_0x9652('0x1a')]||0x1e,'XMD-DIALOPTIONS':util['format'](_0x9652('0x1b'),_0x119539[_0x9652('0x1c')]?'g':'',_[_0x9652('0x10')](_0x119539[_0x9652('0x1d')])?'':_0x9652('0x1e')),'XMD-DIALURL':_0x119539['dialPreviewUrl']||'','XMD-AGI':_0x119539['dialQueueProject']?util[_0x9652('0x11')](_0x9652('0x1f'),ipAgi,_0x119539['dialQueueProject']):'NONE','XMD-AGIAFTER':_0x119539[_0x9652('0x1c')]?util[_0x9652('0x11')](_0x9652('0x1f'),ipAgi,_0x119539[_0x9652('0x1c')]):_0x9652('0x20'),'XMD-ORIGINATECALLERIDNUM':_0x419466?_0x419466[_0x9652('0x21')]:'','XMD-ORIGINATECALLERIDNAME':_0x419466?_0x419466[_0x9652('0x22')]:'','XMD-DESTINATION':_0x9652('0x23')};if(!_['isEmpty'](_0x119539[_0x9652('0x1d')])){_0x1aacc8[util[_0x9652('0x11')]('%s',_0x9652('0x24'))]=_0x119539['monitor_format'];_0x1aacc8[util[_0x9652('0x11')]('%s',_0x9652('0x25'))]=_0x575ef2;}if(_0x416599&&_0x416599[_0x9652('0x26')]){for(var _0x24fc3e in _0x416599[_0x9652('0x26')]){if(_0x416599[_0x9652('0x26')][_0x9652('0x27')](_0x24fc3e)){if(!_[_0x9652('0x14')](_0x416599[_0x9652('0x26')][_0x24fc3e])&&_0x24fc3e!=='id'&&_0x24fc3e!==_0x9652('0x28')&&_0x24fc3e!=='createdAt'&&_0x24fc3e!==_0x9652('0x29')){_0x1aacc8[util[_0x9652('0x11')](_0x9652('0x2a'),'XMD-',_['toUpper'](_0x24fc3e))]=_0x416599['Contact'][_0x24fc3e];}}}}return _0x1aacc8;};exports[_0x9652('0x2b')]=function(_0x3043b0){var _0x32ac6a={};for(var _0x103337 in _0x3043b0){if(_0x3043b0['hasOwnProperty'](_0x103337)){_0x32ac6a[util[_0x9652('0x11')]('%s',_[_0x9652('0x2c')](_0x103337))]=_0x3043b0[_0x103337];}}return{'variables':_0x32ac6a};};exports[_0x9652('0x2d')]=function(_0x4f6ace,_0x48fc6d){if(!_[_0x9652('0x14')](_0x4f6ace)){if(_0x4f6ace[_0x9652('0x27')](_0x9652('0x2e'))){if(_0x4f6ace[_0x9652('0x2e')]>0x0){_0x4f6ace[_0x9652('0x2e')]-=0x1;}else{logger['error'](_0x9652('0x2f'),_0x48fc6d);}}}else{logger[_0x9652('0xa')](_0x9652('0x30'),_0x48fc6d);}};exports[_0x9652('0x31')]=function(_0x10f47d){var _0x251191=moment()['format'](_0x9652('0x32'));_0x10f47d[_0x9652('0x33')]=0xd;_0x10f47d[_0x9652('0x34')]=_0x9652('0x35');_0x10f47d[_0x9652('0x36')]=_0x251191;_0x10f47d[_0x9652('0x37')]=_0x251191;_0x10f47d['endtime']=_0x251191;};exports[_0x9652('0x38')]=function(_0x1cc715,_0x2e46b7,_0x228093){var _0xab7681=moment()[_0x9652('0x11')](_0x9652('0x32'));_0x1cc715[_0x9652('0x33')]=_0x2e46b7;_0x1cc715[_0x9652('0x34')]=_0x228093;_0x1cc715['responsetime']=_0xab7681;_0x1cc715[_0x9652('0x39')]=getSeconds(_0x1cc715['responsetime'],_0x1cc715[_0x9652('0x36')]);};exports[_0x9652('0x3a')]=function(_0x1d2189,_0x1a8eab,_0xd4f078){_0x1d2189[_0x9652('0x3b')]=_0x1a8eab;_0x1d2189[_0x9652('0x3c')]=_0xd4f078;};exports['logCustomer']=function(_0x132bb5,_0x472315,_0x15dae0){var _0x25a86c=moment()[_0x9652('0x11')](_0x9652('0x32'));_0x132bb5[_0x9652('0x33')]=_0x472315;_0x132bb5['statedesc']=_0x15dae0;_0x132bb5[_0x9652('0x37')]=_0x132bb5[_0x9652('0x37')]?_0x132bb5[_0x9652('0x37')]:_0x25a86c;_0x132bb5['endtime']=_0x132bb5[_0x9652('0x3d')]?_0x132bb5[_0x9652('0x3d')]:_0x25a86c;_0x132bb5['ringtime']=getSeconds(_0x132bb5[_0x9652('0x37')]||0x0,_0x132bb5['starttime']||0x0);_0x132bb5['talktime']=_0x132bb5['answertime']?getSeconds(_0x132bb5['endtime'],_0x132bb5[_0x9652('0x3e')]):0x0;};exports['isFailure']=function(_0x5bd41d){return _0x5bd41d===_0x9652('0x3f');};exports[_0x9652('0x40')]=function(_0x4498a9,_0x1b7ab8,_0x5c404a,_0x3d6d03,_0x2dfff9){var _0x1a9810=_0x3d6d03?_0x9652('0x41'):_0x4498a9[_0x9652('0x42')];_0x1a9810=_0x2dfff9?_0x9652('0x43'):_0x1a9810;return{'actionid':_0x4498a9[_0x9652('0x44')],'action':_0x9652('0x45'),'channel':_0x4498a9[_0x9652('0x46')],'callerid':util[_0x9652('0x11')](_0x9652('0x12'),_0x1a9810,_0x4498a9[_0x9652('0x17')]),'Exten':_0x9652('0x23'),'Context':_0x9652('0x47'),'Priority':'1','variable':_0x5c404a,'timeout':(_0x1b7ab8[_0x9652('0x48')]||0x1e)*0x3e8,'async':!![],'channelid':_0x4498a9[_0x9652('0x44')]};};exports[_0x9652('0x49')]=function(_0x45fa58){return _0x45fa58['countbusyretry']+_0x45fa58[_0x9652('0x4a')]+_0x45fa58['countnoanswerretry']+_0x45fa58[_0x9652('0x4b')]+_0x45fa58[_0x9652('0x4c')];};exports['cloneAction']=function(_0x4e82f4){var _0x178ce0=_[_0x9652('0x4d')](_0x4e82f4);_0x178ce0['state']=0xf;_0x178ce0['statedesc']=_0x9652('0x4e');return _0x178ce0;};exports[_0x9652('0x4f')]=function(_0x365ea5,_0x3e4f4e,_0x3c2e4e){var _0xce59e0={};_0xce59e0[_0x3e4f4e]=_0x365ea5[_0x3e4f4e];_0xce59e0[_0x9652('0x50')]=![];_0xce59e0['scheduledat']=moment()[_0x9652('0x51')](_0x3c2e4e,_0x9652('0x52'))[_0x9652('0x11')](_0x9652('0x32'));_0xce59e0['ContactId']=_0x365ea5[_0x9652('0x18')];_0xce59e0['ListId']=_0x365ea5[_0x9652('0x53')];_0xce59e0[_0x9652('0x54')]=_0x365ea5[_0x9652('0x54')]||undefined;return _0xce59e0;};exports[_0x9652('0x55')]=function(_0x49f618,_0x265506){if(!_[_0x9652('0x14')](_0x49f618)){if(_0x49f618[_0x9652('0x56')]>0x0){_0x49f618[_0x9652('0x56')]-=0x1;}else{logger[_0x9652('0xa')](_0x265506,_0x9652('0x57'));}}else{logger[_0x9652('0xa')](_0x265506,'[decrementTalkink]\x20is\x20null\x20or\x20undefined');}};exports[_0x9652('0x58')]=function(_0x56a72c){if(_0x56a72c<=0x0){return!![];}return![];};exports[_0x9652('0x59')]=function(_0x804c56,_0xaf173b,_0x5e9510){_0x804c56[_0x9652('0x5a')]=_0xaf173b;_0x804c56[_0x9652('0x5b')]=_0x804c56[_0x9652('0x5c')];_0x804c56['interface']=_0x804c56[_0x9652('0x46')];_0x804c56[_0x9652('0x5d')]=_0x9652('0x5e');if(_0x5e9510){_0x804c56[_0x9652('0x5f')]=_0x5e9510[_0x9652('0x5f')];}return _0x804c56;};exports[_0x9652('0x60')]=function(_0x3be88c){var _0x5ab6a2={};_0x5ab6a2[_0x9652('0x5c')]=_0x3be88c[_0x9652('0x5c')];_0x5ab6a2['interface']=_0x3be88c[_0x9652('0x46')];_0x5ab6a2['uniqueid']=_0x3be88c[_0x9652('0x44')];return _0x5ab6a2;};exports[_0x9652('0x61')]=function(_0xd54d5b){var _0x13e5b5=[];for(var _0x43693a in _0xd54d5b){if(_0xd54d5b['hasOwnProperty'](_0x43693a)){if(!_[_0x9652('0x14')](_0xd54d5b[_0x43693a])&&_0xd54d5b[_0x43693a][_0x9652('0x33')]===_0x9652('0x62')&&_0xd54d5b[_0x43693a][_0x9652('0x63')]===_0x9652('0x64')){_0x13e5b5[_0x9652('0x65')](_0xd54d5b[_0x43693a]['id']);}}}return _0x13e5b5;};exports['getDiff']=function(_0x4cef9e){var _0x1d0247=moment()[_0x9652('0x5')](0x0);var _0x1eb3ee=moment(_0x4cef9e)[_0x9652('0x5')](0x0);return _0x1d0247[_0x9652('0x66')](_0x1eb3ee,_0x9652('0x67'));};exports['createBody']=function(_0xe68597){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0xe68597[_0x9652('0x18')],'ListId':_0xe68597[_0x9652('0x53')],'VoiceQueueId':_0xe68597[_0x9652('0x54')]||undefined,'CampaignId':_0xe68597[_0x9652('0x68')]||undefined};};exports[_0x9652('0x69')]=function(_0x3cbb21){if(_0x3cbb21===_0x9652('0x44')||_0x3cbb21==='idContact'||_0x3cbb21===_0x9652('0x5c')||_0x3cbb21===_0x9652('0x6a')||_0x3cbb21===_0x9652('0x6b')||_0x3cbb21==='dialAnswer'||_0x3cbb21===_0x9652('0x3b')||_0x3cbb21===_0x9652('0x46')||_0x3cbb21===_0x9652('0x42')||_0x3cbb21===_0x9652('0x50')||_0x3cbb21==='calleridnum'||_0x3cbb21===_0x9652('0x6c')||_0x3cbb21===_0x9652('0x6d')||_0x3cbb21==='countcongestionretry'||_0x3cbb21===_0x9652('0x6e')||_0x3cbb21==='countglobal'||_0x3cbb21===_0x9652('0x6f')||_0x3cbb21==='callbackuniqueid'||_0x3cbb21==='callbackat'||_0x3cbb21===_0x9652('0x70')||_0x3cbb21==='ContactId'||_0x3cbb21===_0x9652('0x53')||_0x3cbb21===_0x9652('0x3c')||_0x3cbb21===_0x9652('0x54')||_0x3cbb21===_0x9652('0x71')||_0x3cbb21===_0x9652('0x72')||_0x3cbb21===_0x9652('0x73')||_0x3cbb21===_0x9652('0x74')||_0x3cbb21===_0x9652('0x75')||_0x3cbb21===_0x9652('0x76')||_0x3cbb21===_0x9652('0x77')||_0x3cbb21===_0x9652('0x78')||_0x3cbb21===_0x9652('0x79')||_0x3cbb21===_0x9652('0x7a')||_0x3cbb21==='xmd-contactid'||_0x3cbb21===_0x9652('0x7b')||_0x3cbb21===_0x9652('0x7c')||_0x3cbb21===_0x9652('0x7d')||_0x3cbb21===_0x9652('0x7e')||_0x3cbb21===_0x9652('0x7f')||_0x3cbb21===_0x9652('0x80')||_0x3cbb21==='rtpaudioqosjitter'||_0x3cbb21===_0x9652('0x81')||_0x3cbb21===_0x9652('0x82')||_0x3cbb21==='rtpaudioqoslossbridged'||_0x3cbb21==='rtpaudioqosrtt'||_0x3cbb21===_0x9652('0x83')||_0x3cbb21===_0x9652('0x7f')||_0x3cbb21===_0x9652('0x80')||_0x3cbb21===_0x9652('0x84')||_0x3cbb21==='rtpaudioqosjitterbridged'||_0x3cbb21===_0x9652('0x82')||_0x3cbb21===_0x9652('0x85')||_0x3cbb21==='rtpaudioqosrtt'||_0x3cbb21===_0x9652('0x83')||_0x3cbb21==='bridgepeer'||_0x3cbb21==='bridgepvtcallid'||_0x3cbb21===_0x9652('0x33')||_0x3cbb21===_0x9652('0x34')){return![];}return!![];};exports[_0x9652('0x86')]=function(_0x4468eb,_0x1e5be7){var _0x2e7b67,_0x27fda6,_0x30ffc7;if(_0x1e5be7<=0x0){_0x1e5be7=0x1;}_0x2e7b67=new RegExp('\x5cw{0,'+_0x1e5be7+'}$');_0x27fda6=Math[_0x9652('0x87')](0xa,_0x1e5be7-0x1);_0x30ffc7=Math['pow'](0xa,_0x1e5be7)-0x1;return util[_0x9652('0x11')]('%s',_[_0x9652('0x88')](_0x4468eb,_0x2e7b67,_[_0x9652('0x89')](_0x27fda6,_0x30ffc7)));};exports[_0x9652('0x8a')]=function(_0x17e460){var _0x45af96=_0x17e460[_0x9652('0x8b')](/"(.*?)"/);return _0x45af96?_0x45af96[0x1]:_0x17e460;};exports[_0x9652('0x8c')]=function(_0x5a8d67){var _0x304cda=_0x5a8d67[_0x9652('0x8b')](/<(.*?)>/);return _0x304cda?_0x304cda[0x1]:_0x5a8d67;}; \ No newline at end of file diff --git a/server/services/ami/properties.js b/server/services/ami/properties.js index ae0dd8e..aa00d5c 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 _0xb92a=['voicechannel','voicequeuechannelredirect','queueadd','string','number','boolean','queueremove','reload','voicequeuechannel'];(function(_0x1d75f0,_0x58fd25){var _0x572f05=function(_0x562a4e){while(--_0x562a4e){_0x1d75f0['push'](_0x1d75f0['shift']());}};_0x572f05(++_0x58fd25);}(_0xb92a,0x119));var _0xab92=function(_0x1aec25,_0x5d44dd){_0x1aec25=_0x1aec25-0x0;var _0x5e4e8c=_0xb92a[_0x1aec25];return _0x5e4e8c;};'use strict';exports[_0xab92('0x0')]={'queue':{'type':'string','required':!![]},'interface':{'type':_0xab92('0x1'),'required':!![]},'membername':{'type':'string','required':!![]},'penalty':{'type':_0xab92('0x2'),'required':![]},'paused':{'type':_0xab92('0x3'),'required':![]}};exports[_0xab92('0x4')]={'queue':{'type':_0xab92('0x1'),'required':!![]},'interface':{'type':'string','required':!![]}};exports['queuepause']={'interface':{'type':_0xab92('0x1'),'required':!![]},'paused':{'type':_0xab92('0x3')},'reason':{'type':'string','required':![]}};exports[_0xab92('0x5')]={'module':{'type':_0xab92('0x1'),'required':![]}};exports[_0xab92('0x6')]={'uniqueid':{'type':_0xab92('0x1'),'required':!![]}};exports[_0xab92('0x7')]={'uniqueid':{'type':_0xab92('0x1'),'required':!![]},'filename':{'type':'string'},'format':{'type':_0xab92('0x1')},'mixmonitorid':{'type':_0xab92('0x1')}};exports['voicequeuechannelhangup']={'uniqueid':{'type':_0xab92('0x1'),'required':!![]}};exports[_0xab92('0x8')]={'uniqueid':{'type':_0xab92('0x1'),'required':!![]},'exten':{'type':_0xab92('0x1'),'required':!![]},'context':{'type':'string'}}; \ No newline at end of file +var _0x313c=['voicequeuechannelhangup','string','boolean','queueremove','queuepause','reload'];(function(_0x5208df,_0x2e3e19){var _0x1e0ee7=function(_0x3ae901){while(--_0x3ae901){_0x5208df['push'](_0x5208df['shift']());}};_0x1e0ee7(++_0x2e3e19);}(_0x313c,0x19f));var _0xc313=function(_0x47b810,_0xe008a9){_0x47b810=_0x47b810-0x0;var _0x2ef31e=_0x313c[_0x47b810];return _0x2ef31e;};'use strict';exports['queueadd']={'queue':{'type':_0xc313('0x0'),'required':!![]},'interface':{'type':_0xc313('0x0'),'required':!![]},'membername':{'type':_0xc313('0x0'),'required':!![]},'penalty':{'type':'number','required':![]},'paused':{'type':_0xc313('0x1'),'required':![]}};exports[_0xc313('0x2')]={'queue':{'type':_0xc313('0x0'),'required':!![]},'interface':{'type':_0xc313('0x0'),'required':!![]}};exports[_0xc313('0x3')]={'interface':{'type':_0xc313('0x0'),'required':!![]},'paused':{'type':'boolean'},'reason':{'type':'string','required':![]}};exports[_0xc313('0x4')]={'module':{'type':'string','required':![]}};exports['voicequeuechannel']={'uniqueid':{'type':_0xc313('0x0'),'required':!![]}};exports['voicechannel']={'uniqueid':{'type':_0xc313('0x0'),'required':!![]},'filename':{'type':'string'},'format':{'type':_0xc313('0x0')},'mixmonitorid':{'type':_0xc313('0x0')}};exports[_0xc313('0x5')]={'uniqueid':{'type':_0xc313('0x0'),'required':!![]}};exports['voicequeuechannelredirect']={'uniqueid':{'type':_0xc313('0x0'),'required':!![]},'exten':{'type':_0xc313('0x0'),'required':!![]},'context':{'type':_0xc313('0x0')}}; \ No newline at end of file diff --git a/server/services/ami/realtime/index.js b/server/services/ami/realtime/index.js index 241d307..c20a917 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 _0x7f6c=['outboundAnswerCallsDay','prototype','mergeFromDatabase','agents','length','isNil','isUndefined','initTelephones','initTrunks','initVoiceQueues','initTriggers','triggers','salesforceAccounts','initFreshdeskAccounts','initZohoAccounts','initDeskAccounts','initSugarcrmAccounts','initVtigerAccounts','initServicenowAccounts','servicenowAccounts','initFreshsalesAccounts','initVoiceQueueHopperHistory','initVoiceQueueReports','groupBy','uniqueid','queue','queuecallerexit','queuecallerabandon','abandoned','queuecallerleaveAt','diff','queuecallerjoinAt','seconds','queuecallercompleteAt','queuecallerabandonAt','queuecallerexitAt','outbound','ANSWERED','duration','billableseconds','dialQueueProject','SquareProject','initVoiceExtensions','voiceExtensions','merge','initFaxAccounts','faxAccounts','exports','bluebird','util','lodash','../model/telephone','../model/trunk','../model/voiceQueue','../model/trigger','../model/template','../model/campaign','../model/voiceExtension','../model/zendeskAccount','../model/salesforceAccount','../model/freshdeskAccount','../model/sugarcrmAccount','../model/zohoAccount','../model/deskAccount','../model/vtigerAccount','../model/servicenowAccount','../model/dynamics365Account','../model/freshsalesAccount','../model/faxAccount','telephones','trunks','voiceQueues','campaigns','templates','channels','queueChannels','outboundChannels','settings','zendeskAccounts','sugarcrmAccounts','freshdeskAccounts','zohoAccounts','deskAccounts','vtigerAccounts','dynamics365Accounts','freshsalesAccounts','mapKeys','hasOwnProperty','format','SIP/%s','name','interface','total','answered','sumHoldTime','sumDuration','sumBillable','isEmpty','ivrAnswerCallsDay','unmanaged','outboundAnswerAgiCallsDay','outboundCongestionCallsDay','outboundUnknownCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayCallersExit','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundRejectCallsDay','outboundReCallsDay'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7f6c,0x9d));var _0xc7f6=function(_0x4b6d6e,_0x420ed8){_0x4b6d6e=_0x4b6d6e-0x0;var _0x42e915=_0x7f6c[_0x4b6d6e];return _0x42e915;};'use strict';var BPromise=require(_0xc7f6('0x0'));var util=require(_0xc7f6('0x1'));var _=require(_0xc7f6('0x2'));var moment=require('moment');var Agent=require('../model/agent');var Telephone=require(_0xc7f6('0x3'));var Trunk=require(_0xc7f6('0x4'));var VoiceQueue=require(_0xc7f6('0x5'));var Trigger=require(_0xc7f6('0x6'));var Template=require(_0xc7f6('0x7'));var Campaign=require(_0xc7f6('0x8'));var VoiceExtension=require(_0xc7f6('0x9'));var ZendeskAccount=require(_0xc7f6('0xa'));var SalesforceAccount=require(_0xc7f6('0xb'));var FreshdeskAccount=require(_0xc7f6('0xc'));var SugarcrmAccount=require(_0xc7f6('0xd'));var ZohoAccount=require(_0xc7f6('0xe'));var DeskAccount=require(_0xc7f6('0xf'));var VtigerAccount=require(_0xc7f6('0x10'));var ServicenowAccount=require(_0xc7f6('0x11'));var Dynamics365Account=require(_0xc7f6('0x12'));var FreshsalesAccount=require(_0xc7f6('0x13'));var FaxAccount=require(_0xc7f6('0x14'));var Realtime=function(){this['agents']={};this[_0xc7f6('0x15')]={};this[_0xc7f6('0x16')]={};this[_0xc7f6('0x17')]={};this['triggers']={};this[_0xc7f6('0x18')]={};this[_0xc7f6('0x19')]={};this['outbound']={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this['voiceExtensions']={};this[_0xc7f6('0x1a')]={};this[_0xc7f6('0x1b')]={};this[_0xc7f6('0x1c')]={};this['timers']={};this[_0xc7f6('0x1d')]={};this[_0xc7f6('0x1e')]={};this['salesforceAccounts']={};this[_0xc7f6('0x1f')]={};this[_0xc7f6('0x20')]={};this[_0xc7f6('0x21')]={};this[_0xc7f6('0x22')]={};this[_0xc7f6('0x23')]={};this['servicenowAccounts']={};this[_0xc7f6('0x24')]={};this[_0xc7f6('0x25')]={};this['faxAccounts']={};};function freeIsNotKey(_0x675b3b,_0x38a77f,_0x395897){var _0x45b1ad=_[_0xc7f6('0x26')](_0x675b3b,function(_0x30000c,_0x1d6bc7){return _0x30000c[_0x395897];});for(var _0x25cb63 in _0x38a77f){if(_0x38a77f[_0xc7f6('0x27')](_0x25cb63)){if(!_0x45b1ad[_0x25cb63]){delete _0x38a77f[_0x25cb63];}}}}function freeIsNotKeySip(_0x54b4ec,_0x508c21){var _0x3ed05f=_[_0xc7f6('0x26')](_0x54b4ec,function(_0x5c30ff,_0x3f1aa5){return util[_0xc7f6('0x28')](_0xc7f6('0x29'),_0x5c30ff[_0xc7f6('0x2a')]);});for(var _0x160559 in _0x508c21){if(_0x508c21['hasOwnProperty'](_0x160559)){if(!_0x3ed05f[_0x160559]){delete _0x508c21[_0x160559];}}}}function freeIsNotKeyAgent(_0x131585,_0x31b35a){var _0xe0b35c=_[_0xc7f6('0x26')](_0x131585,function(_0xa8b5e5,_0x25bbe2){var _0x5eb498=_['isNil'](_0xa8b5e5[_0xc7f6('0x2b')])?util['format']('SIP/%s',_0xa8b5e5[_0xc7f6('0x2a')]):_0xa8b5e5[_0xc7f6('0x2b')];return _0x5eb498;});for(var _0x351f54 in _0x31b35a){if(_0x31b35a[_0xc7f6('0x27')](_0x351f54)){if(!_0xe0b35c[_0x351f54]){delete _0x31b35a[_0x351f54];}}}}function clearVoiceCallReports(_0x316411){_0x316411[_0xc7f6('0x2c')]=0x0;_0x316411[_0xc7f6('0x2d')]=0x0;_0x316411[_0xc7f6('0x2e')]=0x0;_0x316411[_0xc7f6('0x2f')]=0x0;_0x316411[_0xc7f6('0x30')]=0x0;}function clearCampaigns(_0x4987cb){if(!_[_0xc7f6('0x31')](_0x4987cb)){for(var _0x3f7a06 in _0x4987cb){if(_0x4987cb[_0xc7f6('0x27')](_0x3f7a06)){_0x4987cb[_0x3f7a06]['ivrTotalCallsDays']=0x0;_0x4987cb[_0x3f7a06][_0xc7f6('0x32')]=0x0;}}}}function clearVoiceQueues(_0x209b1e){if(!_[_0xc7f6('0x31')](_0x209b1e)){for(var _0x4b6a0f in _0x209b1e){if(_0x209b1e['hasOwnProperty'](_0x4b6a0f)){_0x209b1e[_0x4b6a0f][_0xc7f6('0x2c')]=0x0;_0x209b1e[_0x4b6a0f][_0xc7f6('0x2d')]=0x0;_0x209b1e[_0x4b6a0f][_0xc7f6('0x33')]=0x0;_0x209b1e[_0x4b6a0f]['abandoned']=0x0;_0x209b1e[_0x4b6a0f][_0xc7f6('0x2e')]=0x0;_0x209b1e[_0x4b6a0f][_0xc7f6('0x2f')]=0x0;_0x209b1e[_0x4b6a0f]['sumBillable']=0x0;_0x209b1e[_0x4b6a0f][_0xc7f6('0x34')]=0x0;_0x209b1e[_0x4b6a0f]['outboundNoAnswerCallsDay']=0x0;_0x209b1e[_0x4b6a0f]['outboundBusyCallsDay']=0x0;_0x209b1e[_0x4b6a0f][_0xc7f6('0x35')]=0x0;_0x209b1e[_0x4b6a0f]['outboundNoSuchCallsDay']=0x0;_0x209b1e[_0x4b6a0f][_0xc7f6('0x36')]=0x0;_0x209b1e[_0x4b6a0f][_0xc7f6('0x37')]=0x0;_0x209b1e[_0x4b6a0f][_0xc7f6('0x38')]=0x0;_0x209b1e[_0x4b6a0f][_0xc7f6('0x39')]=0x0;_0x209b1e[_0x4b6a0f][_0xc7f6('0x3a')]=0x0;_0x209b1e[_0x4b6a0f][_0xc7f6('0x3b')]=0x0;_0x209b1e[_0x4b6a0f][_0xc7f6('0x3c')]=0x0;_0x209b1e[_0x4b6a0f][_0xc7f6('0x34')]=0x0;_0x209b1e[_0x4b6a0f][_0xc7f6('0x3d')]=0x0;_0x209b1e[_0x4b6a0f]['queueStatusComplete']=!![];}}}}Realtime[_0xc7f6('0x3e')][_0xc7f6('0x3f')]=function(_0xf8cdcf,_0x4eb417){for(var _0x358084 in _0x4eb417){if(_0xf8cdcf['hasOwnProperty'](_0x358084)){_0xf8cdcf[_0x358084]=_0x4eb417[_0x358084];}}};Realtime[_0xc7f6('0x3e')]['initAgents']=function(){var _0x35c9bc=this;return function(_0x616c32){if(_0x616c32){freeIsNotKeyAgent(_0x616c32,_0x35c9bc[_0xc7f6('0x40')]);for(var _0xdede22=0x0,_0x3c6efd={},_0xa3622={};_0xdede22<_0x616c32[_0xc7f6('0x41')];_0xdede22+=0x1){_0x3c6efd=_0x616c32[_0xdede22];var _0x86cd3c=_[_0xc7f6('0x42')](_0x3c6efd[_0xc7f6('0x2b')])?util[_0xc7f6('0x28')](_0xc7f6('0x29'),_0x3c6efd[_0xc7f6('0x2a')]):_0x3c6efd[_0xc7f6('0x2b')];if(_[_0xc7f6('0x43')](_0x35c9bc[_0xc7f6('0x40')][_0x86cd3c])){_0x35c9bc[_0xc7f6('0x40')][_0x86cd3c]=new Agent(_0x3c6efd);}else{_0x35c9bc[_0xc7f6('0x3f')](_0x35c9bc[_0xc7f6('0x40')][_0x86cd3c],_0x3c6efd);}}}return _0x35c9bc[_0xc7f6('0x40')];};};Realtime[_0xc7f6('0x3e')][_0xc7f6('0x44')]=function(){var _0x384474=this;return function(_0x28b229){if(_0x28b229){freeIsNotKeySip(_0x28b229,_0x384474[_0xc7f6('0x15')]);for(var _0x24a4f1=0x0,_0x12fcce={},_0x54bb51={};_0x24a4f1<_0x28b229[_0xc7f6('0x41')];_0x24a4f1+=0x1){_0x12fcce=_0x28b229[_0x24a4f1];if(_[_0xc7f6('0x43')](_0x384474[_0xc7f6('0x15')][util[_0xc7f6('0x28')](_0xc7f6('0x29'),_0x12fcce[_0xc7f6('0x2a')])])){_0x384474[_0xc7f6('0x15')][util[_0xc7f6('0x28')](_0xc7f6('0x29'),_0x12fcce[_0xc7f6('0x2a')])]=new Telephone(_0x12fcce);}else{_0x384474[_0xc7f6('0x3f')](_0x384474['telephones'][util[_0xc7f6('0x28')](_0xc7f6('0x29'),_0x12fcce[_0xc7f6('0x2a')])],_0x12fcce);}}}return _0x384474['telephones'];};};Realtime[_0xc7f6('0x3e')][_0xc7f6('0x45')]=function(){var _0x12ce7f=this;return function(_0x5aa954){if(_0x5aa954){freeIsNotKeySip(_0x5aa954,_0x12ce7f[_0xc7f6('0x16')]);for(var _0x37149c=0x0,_0x1360b8={},_0x213532={};_0x37149c<_0x5aa954[_0xc7f6('0x41')];_0x37149c+=0x1){_0x1360b8=_0x5aa954[_0x37149c];if(_['isUndefined'](_0x12ce7f[_0xc7f6('0x16')][util[_0xc7f6('0x28')](_0xc7f6('0x29'),_0x1360b8['name'])])){_0x12ce7f[_0xc7f6('0x16')][util[_0xc7f6('0x28')](_0xc7f6('0x29'),_0x1360b8[_0xc7f6('0x2a')])]=new Trunk(_0x1360b8);}else{_0x12ce7f[_0xc7f6('0x3f')](_0x12ce7f[_0xc7f6('0x16')][util[_0xc7f6('0x28')](_0xc7f6('0x29'),_0x1360b8[_0xc7f6('0x2a')])],_0x1360b8);}}}return _0x12ce7f[_0xc7f6('0x16')];};};Realtime['prototype'][_0xc7f6('0x46')]=function(){var _0x388464=this;return function(_0x220709){if(_0x220709){freeIsNotKey(_0x220709,_0x388464[_0xc7f6('0x17')],_0xc7f6('0x2a'));for(var _0x3ebf6c=0x0,_0x5d3a39={},_0x1b0896={};_0x3ebf6c<_0x220709[_0xc7f6('0x41')];_0x3ebf6c+=0x1){_0x5d3a39=_0x220709[_0x3ebf6c];if(_[_0xc7f6('0x43')](_0x388464['voiceQueues'][_0x5d3a39[_0xc7f6('0x2a')]])){_0x388464[_0xc7f6('0x17')][_0x5d3a39['name']]=new VoiceQueue(_0x5d3a39);}else{_0x388464[_0xc7f6('0x3f')](_0x388464[_0xc7f6('0x17')][_0x5d3a39['name']],_0x5d3a39);}}}return _0x388464[_0xc7f6('0x17')];};};Realtime[_0xc7f6('0x3e')][_0xc7f6('0x47')]=function(){var _0x378e1d=this;return function(_0x59c033){if(_0x59c033){freeIsNotKey(_0x59c033,_0x378e1d[_0xc7f6('0x48')],'id');for(var _0x529bae=0x0,_0xbde80a={},_0x24056d={};_0x529bae<_0x59c033[_0xc7f6('0x41')];_0x529bae+=0x1){_0xbde80a=_0x59c033[_0x529bae];if(_['isUndefined'](_0x378e1d[_0xc7f6('0x48')][_0xbde80a['id']])){_0x378e1d[_0xc7f6('0x48')][_0xbde80a['id']]=new Trigger(_0xbde80a);}else{_0x378e1d['mergeFromDatabase'](_0x378e1d[_0xc7f6('0x48')][_0xbde80a['id']],_0xbde80a);}}}return _0x378e1d[_0xc7f6('0x48')];};};Realtime[_0xc7f6('0x3e')]['initTemplates']=function(){var _0x82a442=this;return function(_0x12362f){if(_0x12362f){freeIsNotKey(_0x12362f,_0x82a442[_0xc7f6('0x19')],'id');for(var _0x5eb461=0x0,_0x3aa05c={},_0x4d27d9={};_0x5eb461<_0x12362f[_0xc7f6('0x41')];_0x5eb461+=0x1){_0x3aa05c=_0x12362f[_0x5eb461];if(_['isUndefined'](_0x82a442[_0xc7f6('0x19')][_0x3aa05c['id']])){_0x82a442[_0xc7f6('0x19')][_0x3aa05c['id']]=new Template(_0x3aa05c);}else{_0x82a442[_0xc7f6('0x3f')](_0x82a442[_0xc7f6('0x19')][_0x3aa05c['id']],_0x3aa05c);}}}return _0x82a442[_0xc7f6('0x19')];};};Realtime[_0xc7f6('0x3e')]['initZendeskAccounts']=function(){var _0x482b5d=this;return function(_0x2bbf8c){if(_0x2bbf8c){freeIsNotKey(_0x2bbf8c,_0x482b5d[_0xc7f6('0x1e')],'id');for(var _0x174472=0x0,_0x27d1ff={},_0x381fad={};_0x174472<_0x2bbf8c[_0xc7f6('0x41')];_0x174472+=0x1){_0x27d1ff=_0x2bbf8c[_0x174472];if(_[_0xc7f6('0x43')](_0x482b5d[_0xc7f6('0x1e')][_0x27d1ff['id']])){_0x482b5d[_0xc7f6('0x1e')][_0x27d1ff['id']]=new ZendeskAccount(_0x27d1ff);}else{_0x482b5d[_0xc7f6('0x3f')](_0x482b5d[_0xc7f6('0x1e')][_0x27d1ff['id']],_0x27d1ff);}}}return _0x482b5d[_0xc7f6('0x1e')];};};Realtime[_0xc7f6('0x3e')]['initSalesforceAccounts']=function(){var _0x5cf6b5=this;return function(_0x33a608){if(_0x33a608){freeIsNotKey(_0x33a608,_0x5cf6b5['salesforceAccounts'],'id');for(var _0x1fdd3b=0x0,_0x311c99={},_0x4b068a={};_0x1fdd3b<_0x33a608[_0xc7f6('0x41')];_0x1fdd3b+=0x1){_0x311c99=_0x33a608[_0x1fdd3b];if(_['isUndefined'](_0x5cf6b5[_0xc7f6('0x49')][_0x311c99['id']])){_0x5cf6b5[_0xc7f6('0x49')][_0x311c99['id']]=new SalesforceAccount(_0x311c99);}else{_0x5cf6b5[_0xc7f6('0x3f')](_0x5cf6b5[_0xc7f6('0x49')][_0x311c99['id']],_0x311c99);}}}return _0x5cf6b5[_0xc7f6('0x49')];};};Realtime[_0xc7f6('0x3e')][_0xc7f6('0x4a')]=function(){var _0x445f26=this;return function(_0x246cd9){if(_0x246cd9){freeIsNotKey(_0x246cd9,_0x445f26[_0xc7f6('0x20')],'id');for(var _0x50027a=0x0,_0xc9afc={},_0x4c288f={};_0x50027a<_0x246cd9['length'];_0x50027a+=0x1){_0xc9afc=_0x246cd9[_0x50027a];if(_[_0xc7f6('0x43')](_0x445f26['freshdeskAccounts'][_0xc9afc['id']])){_0x445f26[_0xc7f6('0x20')][_0xc9afc['id']]=new FreshdeskAccount(_0xc9afc);}else{_0x445f26[_0xc7f6('0x3f')](_0x445f26[_0xc7f6('0x20')][_0xc9afc['id']],_0xc9afc);}}}return _0x445f26['freshdeskAccounts'];};};Realtime[_0xc7f6('0x3e')][_0xc7f6('0x4b')]=function(){var _0x57317d=this;return function(_0x31316f){if(_0x31316f){freeIsNotKey(_0x31316f,_0x57317d['zohoAccounts'],'id');for(var _0xb9cd69=0x0,_0x533812={},_0x21d2ab={};_0xb9cd69<_0x31316f[_0xc7f6('0x41')];_0xb9cd69+=0x1){_0x533812=_0x31316f[_0xb9cd69];if(_[_0xc7f6('0x43')](_0x57317d[_0xc7f6('0x21')][_0x533812['id']])){_0x57317d['zohoAccounts'][_0x533812['id']]=new ZohoAccount(_0x533812);}else{_0x57317d[_0xc7f6('0x3f')](_0x57317d[_0xc7f6('0x21')][_0x533812['id']],_0x533812);}}}return _0x57317d[_0xc7f6('0x21')];};};Realtime[_0xc7f6('0x3e')][_0xc7f6('0x4c')]=function(){var _0x4777fc=this;return function(_0x463e63){if(_0x463e63){freeIsNotKey(_0x463e63,_0x4777fc[_0xc7f6('0x22')],'id');for(var _0x5160ff=0x0,_0x296147={},_0xa268ed={};_0x5160ff<_0x463e63[_0xc7f6('0x41')];_0x5160ff+=0x1){_0x296147=_0x463e63[_0x5160ff];if(_[_0xc7f6('0x43')](_0x4777fc['deskAccounts'][_0x296147['id']])){_0x4777fc[_0xc7f6('0x22')][_0x296147['id']]=new DeskAccount(_0x296147);}else{_0x4777fc[_0xc7f6('0x3f')](_0x4777fc[_0xc7f6('0x22')][_0x296147['id']],_0x296147);}}}return _0x4777fc[_0xc7f6('0x22')];};};Realtime[_0xc7f6('0x3e')][_0xc7f6('0x4d')]=function(){var _0x4bd773=this;return function(_0x55e335){if(_0x55e335){freeIsNotKey(_0x55e335,_0x4bd773[_0xc7f6('0x1f')],'id');for(var _0x263bf5=0x0,_0x13d7b2={},_0x2a55b8={};_0x263bf5<_0x55e335[_0xc7f6('0x41')];_0x263bf5+=0x1){_0x13d7b2=_0x55e335[_0x263bf5];if(_['isUndefined'](_0x4bd773[_0xc7f6('0x1f')][_0x13d7b2['id']])){_0x4bd773[_0xc7f6('0x1f')][_0x13d7b2['id']]=new SugarcrmAccount(_0x13d7b2);}else{_0x4bd773[_0xc7f6('0x3f')](_0x4bd773['sugarcrmAccounts'][_0x13d7b2['id']],_0x13d7b2);}}}return _0x4bd773[_0xc7f6('0x1f')];};};Realtime[_0xc7f6('0x3e')][_0xc7f6('0x4e')]=function(){var _0x182f04=this;return function(_0x24aaeb){if(_0x24aaeb){freeIsNotKey(_0x24aaeb,_0x182f04[_0xc7f6('0x23')],'id');for(var _0x359ba4=0x0,_0x42a342={},_0x85b984={};_0x359ba4<_0x24aaeb[_0xc7f6('0x41')];_0x359ba4+=0x1){_0x42a342=_0x24aaeb[_0x359ba4];if(_[_0xc7f6('0x43')](_0x182f04[_0xc7f6('0x23')][_0x42a342['id']])){_0x182f04[_0xc7f6('0x23')][_0x42a342['id']]=new VtigerAccount(_0x42a342);}else{_0x182f04[_0xc7f6('0x3f')](_0x182f04['vtigerAccounts'][_0x42a342['id']],_0x42a342);}}}return _0x182f04[_0xc7f6('0x23')];};};Realtime[_0xc7f6('0x3e')][_0xc7f6('0x4f')]=function(){var _0x5b7542=this;return function(_0x38ddd5){if(_0x38ddd5){freeIsNotKey(_0x38ddd5,_0x5b7542[_0xc7f6('0x50')],'id');for(var _0x5bfacc=0x0,_0x270225={},_0x51f575={};_0x5bfacc<_0x38ddd5[_0xc7f6('0x41')];_0x5bfacc+=0x1){_0x270225=_0x38ddd5[_0x5bfacc];if(_['isUndefined'](_0x5b7542[_0xc7f6('0x50')][_0x270225['id']])){_0x5b7542[_0xc7f6('0x50')][_0x270225['id']]=new ServicenowAccount(_0x270225);}else{_0x5b7542[_0xc7f6('0x3f')](_0x5b7542[_0xc7f6('0x50')][_0x270225['id']],_0x270225);}}}return _0x5b7542[_0xc7f6('0x50')];};};Realtime[_0xc7f6('0x3e')]['initDynamics365Accounts']=function(){var _0x2a389a=this;return function(_0x118479){if(_0x118479){freeIsNotKey(_0x118479,_0x2a389a[_0xc7f6('0x24')],'id');for(var _0x544402=0x0,_0x24fbfd={},_0x4fe9c8={};_0x544402<_0x118479[_0xc7f6('0x41')];_0x544402+=0x1){_0x24fbfd=_0x118479[_0x544402];if(_[_0xc7f6('0x43')](_0x2a389a[_0xc7f6('0x24')][_0x24fbfd['id']])){_0x2a389a[_0xc7f6('0x24')][_0x24fbfd['id']]=new Dynamics365Account(_0x24fbfd);}else{_0x2a389a[_0xc7f6('0x3f')](_0x2a389a['dynamics365Accounts'][_0x24fbfd['id']],_0x24fbfd);}}}return _0x2a389a[_0xc7f6('0x24')];};};Realtime[_0xc7f6('0x3e')][_0xc7f6('0x51')]=function(){var _0x2c0c5e=this;return function(_0x17cec5){if(_0x17cec5){freeIsNotKey(_0x17cec5,_0x2c0c5e[_0xc7f6('0x25')],'id');for(var _0x526a35=0x0,_0x3f1e0e={},_0x4b6986={};_0x526a35<_0x17cec5[_0xc7f6('0x41')];_0x526a35+=0x1){_0x3f1e0e=_0x17cec5[_0x526a35];if(_[_0xc7f6('0x43')](_0x2c0c5e[_0xc7f6('0x25')][_0x3f1e0e['id']])){_0x2c0c5e[_0xc7f6('0x25')][_0x3f1e0e['id']]=new FreshsalesAccount(_0x3f1e0e);}else{_0x2c0c5e[_0xc7f6('0x3f')](_0x2c0c5e['freshsalesAccounts'][_0x3f1e0e['id']],_0x3f1e0e);}}}return _0x2c0c5e['freshsalesAccounts'];};};Realtime[_0xc7f6('0x3e')][_0xc7f6('0x52')]=function(){var _0x283113=this;return function(_0xc38fd){for(var _0x211db0=0x0;_0x211db0<_0xc38fd['length'];_0x211db0+=0x1){_['merge'](_0x283113[_0xc7f6('0x17')][_0xc38fd[_0x211db0][_0xc7f6('0x2a')]],_0xc38fd[_0x211db0]);}return _0x283113[_0xc7f6('0x17')];};};Realtime['prototype'][_0xc7f6('0x53')]=function(){var _0x252514=this;return function(_0x2e8f8b){clearVoiceQueues(_0x252514[_0xc7f6('0x17')]);if(_0x2e8f8b){_0x2e8f8b=_[_0xc7f6('0x54')](_0x2e8f8b,_0xc7f6('0x55'));for(var _0x4a15e9 in _0x2e8f8b){if(_0x2e8f8b[_0xc7f6('0x27')](_0x4a15e9)){var _0xb84cc1={};for(var _0x316131=0x0;_0x316131<_0x2e8f8b[_0x4a15e9][_0xc7f6('0x41')];_0x316131+=0x1){var _0x5a43c3=_0x2e8f8b[_0x4a15e9][_0x316131][_0xc7f6('0x56')];if(_0x252514['voiceQueues'][_0x5a43c3]){if(_0x2e8f8b[_0x4a15e9][_0x316131][_0xc7f6('0x57')]){_0x252514[_0xc7f6('0x17')][_0x5a43c3][_0xc7f6('0x33')]+=0x1;}if(_0x2e8f8b[_0x4a15e9][_0x316131][_0xc7f6('0x58')]){_0x252514[_0xc7f6('0x17')][_0x5a43c3][_0xc7f6('0x59')]+=0x1;}_0x252514['voiceQueues'][_0x5a43c3][_0xc7f6('0x2e')]+=moment(_0x2e8f8b[_0x4a15e9][_0x316131][_0xc7f6('0x5a')])[_0xc7f6('0x5b')](moment(_0x2e8f8b[_0x4a15e9][_0x316131][_0xc7f6('0x5c')]),_0xc7f6('0x5d'))||0x0;if(_0x316131===_0x2e8f8b[_0x4a15e9]['length']-0x1){_0x252514[_0xc7f6('0x17')][_0x5a43c3]['sumDuration']+=moment(_0x2e8f8b[_0x4a15e9][_0x316131][_0xc7f6('0x5e')]||_0x2e8f8b[_0x4a15e9][_0x316131][_0xc7f6('0x5f')]||_0x2e8f8b[_0x4a15e9][_0x316131][_0xc7f6('0x60')])[_0xc7f6('0x5b')](moment(_0x2e8f8b[_0x4a15e9][_0x316131][_0xc7f6('0x5c')]),_0xc7f6('0x5d'))||0x0;_0x252514[_0xc7f6('0x17')][_0x5a43c3]['total']+=0x1;if(_0x2e8f8b[_0x4a15e9][_0x316131]['queuecallercomplete']){_0x252514[_0xc7f6('0x17')][_0x5a43c3][_0xc7f6('0x2d')]+=0x1;_0x252514[_0xc7f6('0x17')][_0x5a43c3][_0xc7f6('0x30')]+=moment(_0x2e8f8b[_0x4a15e9][_0x316131][_0xc7f6('0x5e')])['diff'](moment(_0x2e8f8b[_0x4a15e9][_0x316131][_0xc7f6('0x5a')]),_0xc7f6('0x5d'))||0x0;}}else{_0x252514[_0xc7f6('0x17')][_0x5a43c3][_0xc7f6('0x2f')]+=_0x252514[_0xc7f6('0x17')][_0x5a43c3]['sumHoldTime']||0x0;}}}}}}return _0x252514[_0xc7f6('0x17')];};};Realtime[_0xc7f6('0x3e')]['initVoiceCallReports']=function(){var _0x2e02d2=this;return function(_0x2dd043){clearVoiceCallReports(_0x2e02d2[_0xc7f6('0x61')]);if(_0x2dd043){for(var _0x131397=0x0;_0x131397<_0x2dd043[_0xc7f6('0x41')];_0x131397+=0x1){_0x2e02d2['outbound'][_0xc7f6('0x2c')]+=0x1;_0x2e02d2[_0xc7f6('0x61')]['sumDuration']+=_0x2dd043[_0x131397]['duration'];if(_0x2dd043[_0x131397]['disposition']===_0xc7f6('0x62')){_0x2e02d2[_0xc7f6('0x61')][_0xc7f6('0x2d')]+=0x1;_0x2e02d2[_0xc7f6('0x61')][_0xc7f6('0x2e')]+=_0x2dd043[_0x131397][_0xc7f6('0x63')]-_0x2dd043[_0x131397][_0xc7f6('0x64')]||0x0;_0x2e02d2[_0xc7f6('0x61')][_0xc7f6('0x30')]+=_0x2dd043[_0x131397][_0xc7f6('0x64')];}}}return _0x2e02d2[_0xc7f6('0x61')];};};Realtime['prototype']['initCampaigns']=function(){var _0x133e7a=this;return function(_0x465f11){if(_0x465f11){freeIsNotKey(_0x465f11,_0x133e7a[_0xc7f6('0x18')],_0xc7f6('0x2a'));for(var _0x23f8a7=0x0,_0x3ce17f={};_0x23f8a7<_0x465f11[_0xc7f6('0x41')];_0x23f8a7+=0x1){_0x3ce17f=_0x465f11[_0x23f8a7];if(_[_0xc7f6('0x43')](_0x133e7a['campaigns'][_0x3ce17f[_0xc7f6('0x2a')]])){_0x133e7a[_0xc7f6('0x18')][_0x3ce17f[_0xc7f6('0x2a')]]=new Campaign(_0x3ce17f);}else{_0x133e7a['mergeFromDatabase'](_0x133e7a['campaigns'][_0x3ce17f['name']],_0x3ce17f);_0x133e7a[_0xc7f6('0x18')][_0x3ce17f[_0xc7f6('0x2a')]][_0xc7f6('0x65')]=_0x3ce17f[_0xc7f6('0x66')]?_0x3ce17f[_0xc7f6('0x66')][_0xc7f6('0x2a')]:undefined;}}}return _0x133e7a['campaigns'];};};Realtime[_0xc7f6('0x3e')][_0xc7f6('0x67')]=function(){var _0x502022=this;return function(_0x1cf051){if(_0x1cf051){freeIsNotKey(_0x1cf051,_0x502022['voiceExtensions'],'id');for(var _0x1cf4f0=0x0,_0x129cc0={};_0x1cf4f0<_0x1cf051[_0xc7f6('0x41')];_0x1cf4f0+=0x1){_0x129cc0=_0x1cf051[_0x1cf4f0];if(_[_0xc7f6('0x43')](_0x502022['voiceExtensions'][_0x129cc0['id']])){_0x502022[_0xc7f6('0x68')][_0x129cc0['id']]=new VoiceExtension(_0x129cc0);}else{_0x502022[_0xc7f6('0x3f')](_0x502022[_0xc7f6('0x68')][_0x129cc0['id']],_0x129cc0);}}}return _0x502022[_0xc7f6('0x68')];};};Realtime['prototype']['initCampaignHopperHistory']=function(){var _0x2285b0=this;return function(_0x134efe){clearCampaigns(_0x2285b0[_0xc7f6('0x18')]);for(var _0x412c2d=0x0;_0x412c2d<_0x134efe[_0xc7f6('0x41')];_0x412c2d+=0x1){_[_0xc7f6('0x69')](_0x2285b0[_0xc7f6('0x18')][_0x134efe[_0x412c2d]['name']],_0x134efe[_0x412c2d]);}return _0x2285b0[_0xc7f6('0x18')];};};Realtime[_0xc7f6('0x3e')][_0xc7f6('0x6a')]=function(){var _0x48b581=this;return function(_0x312d8a){if(_0x312d8a){freeIsNotKey(_0x312d8a,_0x48b581[_0xc7f6('0x6b')],'id');for(var _0x15a747=0x0,_0x5c28cf={},_0x16652b={};_0x15a747<_0x312d8a[_0xc7f6('0x41')];_0x15a747+=0x1){_0x5c28cf=_0x312d8a[_0x15a747];if(_[_0xc7f6('0x43')](_0x48b581[_0xc7f6('0x6b')][_0x5c28cf['id']])){_0x48b581[_0xc7f6('0x6b')][_0x5c28cf['id']]=new FaxAccount(_0x5c28cf);}else{_0x48b581['mergeFromDatabase'](_0x48b581['faxAccounts'][_0x5c28cf['id']],_0x5c28cf);}}}return _0x48b581['faxAccounts'];};};module[_0xc7f6('0x6c')]=Realtime; \ No newline at end of file +var _0x664d=['../model/vtigerAccount','../model/dynamics365Account','../model/freshsalesAccount','../model/faxAccount','agents','telephones','trunks','voiceQueues','triggers','campaigns','templates','outbound','voiceExtensions','channels','queueChannels','outboundChannels','settings','zendeskAccounts','salesforceAccounts','freshdeskAccounts','vtigerAccounts','servicenowAccounts','freshsalesAccounts','faxAccounts','hasOwnProperty','format','SIP/%s','isNil','interface','total','answered','sumBillable','isEmpty','ivrTotalCallsDays','unmanaged','abandoned','sumHoldTime','sumDuration','outboundAnswerAgiCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundBlacklistCallsDay','outboundRejectCallsDay','outboundReCallsDay','outboundAnswerCallsDay','queueStatusComplete','prototype','mergeFromDatabase','initAgents','name','isUndefined','length','initTrunks','initTriggers','initZendeskAccounts','initSalesforceAccounts','zohoAccounts','initDeskAccounts','deskAccounts','initSugarcrmAccounts','sugarcrmAccounts','initDynamics365Accounts','dynamics365Accounts','initVoiceQueueHopperHistory','initVoiceQueueReports','groupBy','uniqueid','queuecallerexit','queuecallerleaveAt','diff','queuecallerjoinAt','seconds','queuecallercompleteAt','queuecallercomplete','initVoiceCallReports','duration','disposition','billableseconds','initCampaigns','SquareProject','initVoiceExtensions','initFaxAccounts','bluebird','util','lodash','moment','../model/agent','../model/telephone','../model/trunk','../model/voiceQueue','../model/trigger','../model/template','../model/campaign','../model/voiceExtension','../model/zendeskAccount','../model/freshdeskAccount','../model/sugarcrmAccount','../model/zohoAccount','../model/deskAccount'];(function(_0x4e04a8,_0x2f2d6a){var _0x6c3e6f=function(_0x806cf7){while(--_0x806cf7){_0x4e04a8['push'](_0x4e04a8['shift']());}};_0x6c3e6f(++_0x2f2d6a);}(_0x664d,0x1e8));var _0xd664=function(_0xf7c208,_0x5cbc84){_0xf7c208=_0xf7c208-0x0;var _0x16992d=_0x664d[_0xf7c208];return _0x16992d;};'use strict';var BPromise=require(_0xd664('0x0'));var util=require(_0xd664('0x1'));var _=require(_0xd664('0x2'));var moment=require(_0xd664('0x3'));var Agent=require(_0xd664('0x4'));var Telephone=require(_0xd664('0x5'));var Trunk=require(_0xd664('0x6'));var VoiceQueue=require(_0xd664('0x7'));var Trigger=require(_0xd664('0x8'));var Template=require(_0xd664('0x9'));var Campaign=require(_0xd664('0xa'));var VoiceExtension=require(_0xd664('0xb'));var ZendeskAccount=require(_0xd664('0xc'));var SalesforceAccount=require('../model/salesforceAccount');var FreshdeskAccount=require(_0xd664('0xd'));var SugarcrmAccount=require(_0xd664('0xe'));var ZohoAccount=require(_0xd664('0xf'));var DeskAccount=require(_0xd664('0x10'));var VtigerAccount=require(_0xd664('0x11'));var ServicenowAccount=require('../model/servicenowAccount');var Dynamics365Account=require(_0xd664('0x12'));var FreshsalesAccount=require(_0xd664('0x13'));var FaxAccount=require(_0xd664('0x14'));var Realtime=function(){this[_0xd664('0x15')]={};this[_0xd664('0x16')]={};this[_0xd664('0x17')]={};this[_0xd664('0x18')]={};this[_0xd664('0x19')]={};this[_0xd664('0x1a')]={};this[_0xd664('0x1b')]={};this[_0xd664('0x1c')]={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this[_0xd664('0x1d')]={};this[_0xd664('0x1e')]={};this[_0xd664('0x1f')]={};this[_0xd664('0x20')]={};this['timers']={};this[_0xd664('0x21')]={};this[_0xd664('0x22')]={};this[_0xd664('0x23')]={};this['sugarcrmAccounts']={};this[_0xd664('0x24')]={};this['zohoAccounts']={};this['deskAccounts']={};this[_0xd664('0x25')]={};this[_0xd664('0x26')]={};this['dynamics365Accounts']={};this[_0xd664('0x27')]={};this[_0xd664('0x28')]={};};function freeIsNotKey(_0x5de05b,_0x197e85,_0x557b66){var _0x58846c=_['mapKeys'](_0x5de05b,function(_0x2a9f83,_0x532abf){return _0x2a9f83[_0x557b66];});for(var _0x287ab8 in _0x197e85){if(_0x197e85[_0xd664('0x29')](_0x287ab8)){if(!_0x58846c[_0x287ab8]){delete _0x197e85[_0x287ab8];}}}}function freeIsNotKeySip(_0x1ccc4c,_0x475788){var _0x7fea3b=_['mapKeys'](_0x1ccc4c,function(_0x3fe90f,_0x24b09f){return util[_0xd664('0x2a')](_0xd664('0x2b'),_0x3fe90f['name']);});for(var _0x294006 in _0x475788){if(_0x475788[_0xd664('0x29')](_0x294006)){if(!_0x7fea3b[_0x294006]){delete _0x475788[_0x294006];}}}}function freeIsNotKeyAgent(_0x331598,_0x248f85){var _0x415338=_['mapKeys'](_0x331598,function(_0x83d335,_0x319dee){var _0x133009=_[_0xd664('0x2c')](_0x83d335[_0xd664('0x2d')])?util['format'](_0xd664('0x2b'),_0x83d335['name']):_0x83d335[_0xd664('0x2d')];return _0x133009;});for(var _0x58ad67 in _0x248f85){if(_0x248f85[_0xd664('0x29')](_0x58ad67)){if(!_0x415338[_0x58ad67]){delete _0x248f85[_0x58ad67];}}}}function clearVoiceCallReports(_0x137bb0){_0x137bb0[_0xd664('0x2e')]=0x0;_0x137bb0[_0xd664('0x2f')]=0x0;_0x137bb0['sumHoldTime']=0x0;_0x137bb0['sumDuration']=0x0;_0x137bb0[_0xd664('0x30')]=0x0;}function clearCampaigns(_0x12474e){if(!_[_0xd664('0x31')](_0x12474e)){for(var _0x46c97f in _0x12474e){if(_0x12474e['hasOwnProperty'](_0x46c97f)){_0x12474e[_0x46c97f][_0xd664('0x32')]=0x0;_0x12474e[_0x46c97f]['ivrAnswerCallsDay']=0x0;}}}}function clearVoiceQueues(_0x361fbb){if(!_[_0xd664('0x31')](_0x361fbb)){for(var _0x2e23f8 in _0x361fbb){if(_0x361fbb[_0xd664('0x29')](_0x2e23f8)){_0x361fbb[_0x2e23f8]['total']=0x0;_0x361fbb[_0x2e23f8][_0xd664('0x2f')]=0x0;_0x361fbb[_0x2e23f8][_0xd664('0x33')]=0x0;_0x361fbb[_0x2e23f8][_0xd664('0x34')]=0x0;_0x361fbb[_0x2e23f8][_0xd664('0x35')]=0x0;_0x361fbb[_0x2e23f8][_0xd664('0x36')]=0x0;_0x361fbb[_0x2e23f8][_0xd664('0x30')]=0x0;_0x361fbb[_0x2e23f8][_0xd664('0x37')]=0x0;_0x361fbb[_0x2e23f8]['outboundNoAnswerCallsDay']=0x0;_0x361fbb[_0x2e23f8][_0xd664('0x38')]=0x0;_0x361fbb[_0x2e23f8][_0xd664('0x39')]=0x0;_0x361fbb[_0x2e23f8][_0xd664('0x3a')]=0x0;_0x361fbb[_0x2e23f8][_0xd664('0x3b')]=0x0;_0x361fbb[_0x2e23f8]['outboundDropCallsDayTimeout']=0x0;_0x361fbb[_0x2e23f8]['outboundDropCallsDayCallersExit']=0x0;_0x361fbb[_0x2e23f8][_0xd664('0x3c')]=0x0;_0x361fbb[_0x2e23f8]['outboundOriginateFailureCallsDay']=0x0;_0x361fbb[_0x2e23f8][_0xd664('0x3d')]=0x0;_0x361fbb[_0x2e23f8][_0xd664('0x3e')]=0x0;_0x361fbb[_0x2e23f8][_0xd664('0x37')]=0x0;_0x361fbb[_0x2e23f8][_0xd664('0x3f')]=0x0;_0x361fbb[_0x2e23f8][_0xd664('0x40')]=!![];}}}}Realtime[_0xd664('0x41')][_0xd664('0x42')]=function(_0x586985,_0x5e2229){for(var _0x4cc155 in _0x5e2229){if(_0x586985[_0xd664('0x29')](_0x4cc155)){_0x586985[_0x4cc155]=_0x5e2229[_0x4cc155];}}};Realtime[_0xd664('0x41')][_0xd664('0x43')]=function(){var _0x876892=this;return function(_0x699ce8){if(_0x699ce8){freeIsNotKeyAgent(_0x699ce8,_0x876892['agents']);for(var _0xf9b6fd=0x0,_0x58929c={},_0x100f90={};_0xf9b6fd<_0x699ce8['length'];_0xf9b6fd+=0x1){_0x58929c=_0x699ce8[_0xf9b6fd];var _0x4579dc=_[_0xd664('0x2c')](_0x58929c[_0xd664('0x2d')])?util[_0xd664('0x2a')](_0xd664('0x2b'),_0x58929c[_0xd664('0x44')]):_0x58929c[_0xd664('0x2d')];if(_[_0xd664('0x45')](_0x876892[_0xd664('0x15')][_0x4579dc])){_0x876892[_0xd664('0x15')][_0x4579dc]=new Agent(_0x58929c);}else{_0x876892['mergeFromDatabase'](_0x876892[_0xd664('0x15')][_0x4579dc],_0x58929c);}}}return _0x876892['agents'];};};Realtime[_0xd664('0x41')]['initTelephones']=function(){var _0x529ed8=this;return function(_0x3732ef){if(_0x3732ef){freeIsNotKeySip(_0x3732ef,_0x529ed8[_0xd664('0x16')]);for(var _0x59f893=0x0,_0x4c8e48={},_0xe69e0e={};_0x59f893<_0x3732ef[_0xd664('0x46')];_0x59f893+=0x1){_0x4c8e48=_0x3732ef[_0x59f893];if(_[_0xd664('0x45')](_0x529ed8[_0xd664('0x16')][util[_0xd664('0x2a')](_0xd664('0x2b'),_0x4c8e48['name'])])){_0x529ed8[_0xd664('0x16')][util[_0xd664('0x2a')](_0xd664('0x2b'),_0x4c8e48['name'])]=new Telephone(_0x4c8e48);}else{_0x529ed8['mergeFromDatabase'](_0x529ed8[_0xd664('0x16')][util[_0xd664('0x2a')](_0xd664('0x2b'),_0x4c8e48['name'])],_0x4c8e48);}}}return _0x529ed8[_0xd664('0x16')];};};Realtime[_0xd664('0x41')][_0xd664('0x47')]=function(){var _0xff4ddc=this;return function(_0xdf818c){if(_0xdf818c){freeIsNotKeySip(_0xdf818c,_0xff4ddc[_0xd664('0x17')]);for(var _0xe9cb2=0x0,_0x25cf45={},_0xa691ea={};_0xe9cb2<_0xdf818c[_0xd664('0x46')];_0xe9cb2+=0x1){_0x25cf45=_0xdf818c[_0xe9cb2];if(_[_0xd664('0x45')](_0xff4ddc[_0xd664('0x17')][util[_0xd664('0x2a')](_0xd664('0x2b'),_0x25cf45['name'])])){_0xff4ddc[_0xd664('0x17')][util[_0xd664('0x2a')](_0xd664('0x2b'),_0x25cf45[_0xd664('0x44')])]=new Trunk(_0x25cf45);}else{_0xff4ddc[_0xd664('0x42')](_0xff4ddc[_0xd664('0x17')][util[_0xd664('0x2a')](_0xd664('0x2b'),_0x25cf45[_0xd664('0x44')])],_0x25cf45);}}}return _0xff4ddc[_0xd664('0x17')];};};Realtime[_0xd664('0x41')]['initVoiceQueues']=function(){var _0x674a37=this;return function(_0x34da14){if(_0x34da14){freeIsNotKey(_0x34da14,_0x674a37['voiceQueues'],_0xd664('0x44'));for(var _0x119a37=0x0,_0x352610={},_0x507510={};_0x119a37<_0x34da14[_0xd664('0x46')];_0x119a37+=0x1){_0x352610=_0x34da14[_0x119a37];if(_[_0xd664('0x45')](_0x674a37[_0xd664('0x18')][_0x352610['name']])){_0x674a37['voiceQueues'][_0x352610[_0xd664('0x44')]]=new VoiceQueue(_0x352610);}else{_0x674a37[_0xd664('0x42')](_0x674a37[_0xd664('0x18')][_0x352610[_0xd664('0x44')]],_0x352610);}}}return _0x674a37[_0xd664('0x18')];};};Realtime['prototype'][_0xd664('0x48')]=function(){var _0x534aa7=this;return function(_0x3bd4ec){if(_0x3bd4ec){freeIsNotKey(_0x3bd4ec,_0x534aa7[_0xd664('0x19')],'id');for(var _0x2b8fee=0x0,_0x2c356b={},_0x570b73={};_0x2b8fee<_0x3bd4ec[_0xd664('0x46')];_0x2b8fee+=0x1){_0x2c356b=_0x3bd4ec[_0x2b8fee];if(_['isUndefined'](_0x534aa7[_0xd664('0x19')][_0x2c356b['id']])){_0x534aa7[_0xd664('0x19')][_0x2c356b['id']]=new Trigger(_0x2c356b);}else{_0x534aa7[_0xd664('0x42')](_0x534aa7[_0xd664('0x19')][_0x2c356b['id']],_0x2c356b);}}}return _0x534aa7[_0xd664('0x19')];};};Realtime[_0xd664('0x41')]['initTemplates']=function(){var _0x261140=this;return function(_0x2ef429){if(_0x2ef429){freeIsNotKey(_0x2ef429,_0x261140['templates'],'id');for(var _0x23019f=0x0,_0xfac154={},_0x4b42c6={};_0x23019f<_0x2ef429[_0xd664('0x46')];_0x23019f+=0x1){_0xfac154=_0x2ef429[_0x23019f];if(_[_0xd664('0x45')](_0x261140[_0xd664('0x1b')][_0xfac154['id']])){_0x261140['templates'][_0xfac154['id']]=new Template(_0xfac154);}else{_0x261140['mergeFromDatabase'](_0x261140[_0xd664('0x1b')][_0xfac154['id']],_0xfac154);}}}return _0x261140['templates'];};};Realtime[_0xd664('0x41')][_0xd664('0x49')]=function(){var _0x1a99e1=this;return function(_0x3f41e0){if(_0x3f41e0){freeIsNotKey(_0x3f41e0,_0x1a99e1['zendeskAccounts'],'id');for(var _0x52263e=0x0,_0x2a2a81={},_0x57a584={};_0x52263e<_0x3f41e0[_0xd664('0x46')];_0x52263e+=0x1){_0x2a2a81=_0x3f41e0[_0x52263e];if(_[_0xd664('0x45')](_0x1a99e1[_0xd664('0x22')][_0x2a2a81['id']])){_0x1a99e1[_0xd664('0x22')][_0x2a2a81['id']]=new ZendeskAccount(_0x2a2a81);}else{_0x1a99e1[_0xd664('0x42')](_0x1a99e1[_0xd664('0x22')][_0x2a2a81['id']],_0x2a2a81);}}}return _0x1a99e1[_0xd664('0x22')];};};Realtime['prototype'][_0xd664('0x4a')]=function(){var _0x16efb9=this;return function(_0x561fde){if(_0x561fde){freeIsNotKey(_0x561fde,_0x16efb9['salesforceAccounts'],'id');for(var _0x4f1ecc=0x0,_0x56f986={},_0x2235ec={};_0x4f1ecc<_0x561fde['length'];_0x4f1ecc+=0x1){_0x56f986=_0x561fde[_0x4f1ecc];if(_[_0xd664('0x45')](_0x16efb9[_0xd664('0x23')][_0x56f986['id']])){_0x16efb9['salesforceAccounts'][_0x56f986['id']]=new SalesforceAccount(_0x56f986);}else{_0x16efb9[_0xd664('0x42')](_0x16efb9[_0xd664('0x23')][_0x56f986['id']],_0x56f986);}}}return _0x16efb9['salesforceAccounts'];};};Realtime[_0xd664('0x41')]['initFreshdeskAccounts']=function(){var _0x9d806c=this;return function(_0x4dda04){if(_0x4dda04){freeIsNotKey(_0x4dda04,_0x9d806c[_0xd664('0x24')],'id');for(var _0x2bc0e4=0x0,_0x8e83b1={},_0x260d84={};_0x2bc0e4<_0x4dda04[_0xd664('0x46')];_0x2bc0e4+=0x1){_0x8e83b1=_0x4dda04[_0x2bc0e4];if(_[_0xd664('0x45')](_0x9d806c['freshdeskAccounts'][_0x8e83b1['id']])){_0x9d806c[_0xd664('0x24')][_0x8e83b1['id']]=new FreshdeskAccount(_0x8e83b1);}else{_0x9d806c['mergeFromDatabase'](_0x9d806c[_0xd664('0x24')][_0x8e83b1['id']],_0x8e83b1);}}}return _0x9d806c['freshdeskAccounts'];};};Realtime[_0xd664('0x41')]['initZohoAccounts']=function(){var _0x400814=this;return function(_0x55e4e3){if(_0x55e4e3){freeIsNotKey(_0x55e4e3,_0x400814['zohoAccounts'],'id');for(var _0x334ee0=0x0,_0x307f4e={},_0x602cb0={};_0x334ee0<_0x55e4e3[_0xd664('0x46')];_0x334ee0+=0x1){_0x307f4e=_0x55e4e3[_0x334ee0];if(_[_0xd664('0x45')](_0x400814[_0xd664('0x4b')][_0x307f4e['id']])){_0x400814[_0xd664('0x4b')][_0x307f4e['id']]=new ZohoAccount(_0x307f4e);}else{_0x400814[_0xd664('0x42')](_0x400814['zohoAccounts'][_0x307f4e['id']],_0x307f4e);}}}return _0x400814[_0xd664('0x4b')];};};Realtime[_0xd664('0x41')][_0xd664('0x4c')]=function(){var _0x56df47=this;return function(_0xbd1c30){if(_0xbd1c30){freeIsNotKey(_0xbd1c30,_0x56df47[_0xd664('0x4d')],'id');for(var _0x1180f7=0x0,_0x56d7ff={},_0x423bb2={};_0x1180f7<_0xbd1c30[_0xd664('0x46')];_0x1180f7+=0x1){_0x56d7ff=_0xbd1c30[_0x1180f7];if(_[_0xd664('0x45')](_0x56df47['deskAccounts'][_0x56d7ff['id']])){_0x56df47['deskAccounts'][_0x56d7ff['id']]=new DeskAccount(_0x56d7ff);}else{_0x56df47[_0xd664('0x42')](_0x56df47['deskAccounts'][_0x56d7ff['id']],_0x56d7ff);}}}return _0x56df47[_0xd664('0x4d')];};};Realtime['prototype'][_0xd664('0x4e')]=function(){var _0x589742=this;return function(_0x4a8e48){if(_0x4a8e48){freeIsNotKey(_0x4a8e48,_0x589742[_0xd664('0x4f')],'id');for(var _0x1745b2=0x0,_0x1a1951={},_0x1c5564={};_0x1745b2<_0x4a8e48[_0xd664('0x46')];_0x1745b2+=0x1){_0x1a1951=_0x4a8e48[_0x1745b2];if(_['isUndefined'](_0x589742[_0xd664('0x4f')][_0x1a1951['id']])){_0x589742[_0xd664('0x4f')][_0x1a1951['id']]=new SugarcrmAccount(_0x1a1951);}else{_0x589742[_0xd664('0x42')](_0x589742[_0xd664('0x4f')][_0x1a1951['id']],_0x1a1951);}}}return _0x589742[_0xd664('0x4f')];};};Realtime[_0xd664('0x41')]['initVtigerAccounts']=function(){var _0x5c443f=this;return function(_0x4d1710){if(_0x4d1710){freeIsNotKey(_0x4d1710,_0x5c443f[_0xd664('0x25')],'id');for(var _0x2435f0=0x0,_0xf53232={},_0x507c0a={};_0x2435f0<_0x4d1710[_0xd664('0x46')];_0x2435f0+=0x1){_0xf53232=_0x4d1710[_0x2435f0];if(_['isUndefined'](_0x5c443f[_0xd664('0x25')][_0xf53232['id']])){_0x5c443f[_0xd664('0x25')][_0xf53232['id']]=new VtigerAccount(_0xf53232);}else{_0x5c443f[_0xd664('0x42')](_0x5c443f[_0xd664('0x25')][_0xf53232['id']],_0xf53232);}}}return _0x5c443f[_0xd664('0x25')];};};Realtime['prototype']['initServicenowAccounts']=function(){var _0x57ed20=this;return function(_0x104c92){if(_0x104c92){freeIsNotKey(_0x104c92,_0x57ed20[_0xd664('0x26')],'id');for(var _0x3bcae1=0x0,_0x30ccc7={},_0x58c94f={};_0x3bcae1<_0x104c92[_0xd664('0x46')];_0x3bcae1+=0x1){_0x30ccc7=_0x104c92[_0x3bcae1];if(_['isUndefined'](_0x57ed20[_0xd664('0x26')][_0x30ccc7['id']])){_0x57ed20[_0xd664('0x26')][_0x30ccc7['id']]=new ServicenowAccount(_0x30ccc7);}else{_0x57ed20[_0xd664('0x42')](_0x57ed20[_0xd664('0x26')][_0x30ccc7['id']],_0x30ccc7);}}}return _0x57ed20[_0xd664('0x26')];};};Realtime[_0xd664('0x41')][_0xd664('0x50')]=function(){var _0x2d617d=this;return function(_0x23c795){if(_0x23c795){freeIsNotKey(_0x23c795,_0x2d617d['dynamics365Accounts'],'id');for(var _0x3e6f30=0x0,_0xcf3a91={},_0x54b873={};_0x3e6f30<_0x23c795[_0xd664('0x46')];_0x3e6f30+=0x1){_0xcf3a91=_0x23c795[_0x3e6f30];if(_[_0xd664('0x45')](_0x2d617d[_0xd664('0x51')][_0xcf3a91['id']])){_0x2d617d[_0xd664('0x51')][_0xcf3a91['id']]=new Dynamics365Account(_0xcf3a91);}else{_0x2d617d[_0xd664('0x42')](_0x2d617d[_0xd664('0x51')][_0xcf3a91['id']],_0xcf3a91);}}}return _0x2d617d[_0xd664('0x51')];};};Realtime['prototype']['initFreshsalesAccounts']=function(){var _0x32dc28=this;return function(_0x4daa5a){if(_0x4daa5a){freeIsNotKey(_0x4daa5a,_0x32dc28[_0xd664('0x27')],'id');for(var _0x163c95=0x0,_0x24d388={},_0x3a91dd={};_0x163c95<_0x4daa5a['length'];_0x163c95+=0x1){_0x24d388=_0x4daa5a[_0x163c95];if(_['isUndefined'](_0x32dc28[_0xd664('0x27')][_0x24d388['id']])){_0x32dc28[_0xd664('0x27')][_0x24d388['id']]=new FreshsalesAccount(_0x24d388);}else{_0x32dc28[_0xd664('0x42')](_0x32dc28[_0xd664('0x27')][_0x24d388['id']],_0x24d388);}}}return _0x32dc28['freshsalesAccounts'];};};Realtime[_0xd664('0x41')][_0xd664('0x52')]=function(){var _0x47d9ed=this;return function(_0x27b1c9){for(var _0x2413d3=0x0;_0x2413d3<_0x27b1c9[_0xd664('0x46')];_0x2413d3+=0x1){_['merge'](_0x47d9ed[_0xd664('0x18')][_0x27b1c9[_0x2413d3][_0xd664('0x44')]],_0x27b1c9[_0x2413d3]);}return _0x47d9ed[_0xd664('0x18')];};};Realtime[_0xd664('0x41')][_0xd664('0x53')]=function(){var _0x534ebd=this;return function(_0xb93c1b){clearVoiceQueues(_0x534ebd[_0xd664('0x18')]);if(_0xb93c1b){_0xb93c1b=_[_0xd664('0x54')](_0xb93c1b,_0xd664('0x55'));for(var _0x194051 in _0xb93c1b){if(_0xb93c1b[_0xd664('0x29')](_0x194051)){var _0x33fc37={};for(var _0x4b5792=0x0;_0x4b5792<_0xb93c1b[_0x194051][_0xd664('0x46')];_0x4b5792+=0x1){var _0x54986e=_0xb93c1b[_0x194051][_0x4b5792]['queue'];if(_0x534ebd[_0xd664('0x18')][_0x54986e]){if(_0xb93c1b[_0x194051][_0x4b5792][_0xd664('0x56')]){_0x534ebd['voiceQueues'][_0x54986e][_0xd664('0x33')]+=0x1;}if(_0xb93c1b[_0x194051][_0x4b5792]['queuecallerabandon']){_0x534ebd[_0xd664('0x18')][_0x54986e][_0xd664('0x34')]+=0x1;}_0x534ebd[_0xd664('0x18')][_0x54986e][_0xd664('0x35')]+=moment(_0xb93c1b[_0x194051][_0x4b5792][_0xd664('0x57')])[_0xd664('0x58')](moment(_0xb93c1b[_0x194051][_0x4b5792][_0xd664('0x59')]),_0xd664('0x5a'))||0x0;if(_0x4b5792===_0xb93c1b[_0x194051][_0xd664('0x46')]-0x1){_0x534ebd[_0xd664('0x18')][_0x54986e][_0xd664('0x36')]+=moment(_0xb93c1b[_0x194051][_0x4b5792][_0xd664('0x5b')]||_0xb93c1b[_0x194051][_0x4b5792]['queuecallerabandonAt']||_0xb93c1b[_0x194051][_0x4b5792]['queuecallerexitAt'])[_0xd664('0x58')](moment(_0xb93c1b[_0x194051][_0x4b5792][_0xd664('0x59')]),_0xd664('0x5a'))||0x0;_0x534ebd[_0xd664('0x18')][_0x54986e][_0xd664('0x2e')]+=0x1;if(_0xb93c1b[_0x194051][_0x4b5792][_0xd664('0x5c')]){_0x534ebd[_0xd664('0x18')][_0x54986e][_0xd664('0x2f')]+=0x1;_0x534ebd['voiceQueues'][_0x54986e]['sumBillable']+=moment(_0xb93c1b[_0x194051][_0x4b5792]['queuecallercompleteAt'])['diff'](moment(_0xb93c1b[_0x194051][_0x4b5792][_0xd664('0x57')]),_0xd664('0x5a'))||0x0;}}else{_0x534ebd[_0xd664('0x18')][_0x54986e][_0xd664('0x36')]+=_0x534ebd['voiceQueues'][_0x54986e]['sumHoldTime']||0x0;}}}}}}return _0x534ebd[_0xd664('0x18')];};};Realtime['prototype'][_0xd664('0x5d')]=function(){var _0x22eb6a=this;return function(_0x3e608d){clearVoiceCallReports(_0x22eb6a[_0xd664('0x1c')]);if(_0x3e608d){for(var _0x7d0ccb=0x0;_0x7d0ccb<_0x3e608d[_0xd664('0x46')];_0x7d0ccb+=0x1){_0x22eb6a[_0xd664('0x1c')][_0xd664('0x2e')]+=0x1;_0x22eb6a[_0xd664('0x1c')]['sumDuration']+=_0x3e608d[_0x7d0ccb][_0xd664('0x5e')];if(_0x3e608d[_0x7d0ccb][_0xd664('0x5f')]==='ANSWERED'){_0x22eb6a[_0xd664('0x1c')][_0xd664('0x2f')]+=0x1;_0x22eb6a[_0xd664('0x1c')][_0xd664('0x35')]+=_0x3e608d[_0x7d0ccb][_0xd664('0x5e')]-_0x3e608d[_0x7d0ccb][_0xd664('0x60')]||0x0;_0x22eb6a[_0xd664('0x1c')][_0xd664('0x30')]+=_0x3e608d[_0x7d0ccb][_0xd664('0x60')];}}}return _0x22eb6a[_0xd664('0x1c')];};};Realtime[_0xd664('0x41')][_0xd664('0x61')]=function(){var _0x426d42=this;return function(_0x1caf4c){if(_0x1caf4c){freeIsNotKey(_0x1caf4c,_0x426d42[_0xd664('0x1a')],_0xd664('0x44'));for(var _0x6a17ac=0x0,_0x7b8e4f={};_0x6a17ac<_0x1caf4c[_0xd664('0x46')];_0x6a17ac+=0x1){_0x7b8e4f=_0x1caf4c[_0x6a17ac];if(_[_0xd664('0x45')](_0x426d42[_0xd664('0x1a')][_0x7b8e4f[_0xd664('0x44')]])){_0x426d42[_0xd664('0x1a')][_0x7b8e4f['name']]=new Campaign(_0x7b8e4f);}else{_0x426d42[_0xd664('0x42')](_0x426d42[_0xd664('0x1a')][_0x7b8e4f[_0xd664('0x44')]],_0x7b8e4f);_0x426d42[_0xd664('0x1a')][_0x7b8e4f['name']]['dialQueueProject']=_0x7b8e4f[_0xd664('0x62')]?_0x7b8e4f[_0xd664('0x62')][_0xd664('0x44')]:undefined;}}}return _0x426d42[_0xd664('0x1a')];};};Realtime[_0xd664('0x41')][_0xd664('0x63')]=function(){var _0x14b9ec=this;return function(_0x2fc459){if(_0x2fc459){freeIsNotKey(_0x2fc459,_0x14b9ec[_0xd664('0x1d')],'id');for(var _0x55e09f=0x0,_0x369de6={};_0x55e09f<_0x2fc459[_0xd664('0x46')];_0x55e09f+=0x1){_0x369de6=_0x2fc459[_0x55e09f];if(_[_0xd664('0x45')](_0x14b9ec[_0xd664('0x1d')][_0x369de6['id']])){_0x14b9ec[_0xd664('0x1d')][_0x369de6['id']]=new VoiceExtension(_0x369de6);}else{_0x14b9ec[_0xd664('0x42')](_0x14b9ec['voiceExtensions'][_0x369de6['id']],_0x369de6);}}}return _0x14b9ec[_0xd664('0x1d')];};};Realtime[_0xd664('0x41')]['initCampaignHopperHistory']=function(){var _0x5d2aae=this;return function(_0x55af83){clearCampaigns(_0x5d2aae[_0xd664('0x1a')]);for(var _0x38d4cc=0x0;_0x38d4cc<_0x55af83['length'];_0x38d4cc+=0x1){_['merge'](_0x5d2aae[_0xd664('0x1a')][_0x55af83[_0x38d4cc][_0xd664('0x44')]],_0x55af83[_0x38d4cc]);}return _0x5d2aae[_0xd664('0x1a')];};};Realtime[_0xd664('0x41')][_0xd664('0x64')]=function(){var _0x26ca34=this;return function(_0x566fb0){if(_0x566fb0){freeIsNotKey(_0x566fb0,_0x26ca34['faxAccounts'],'id');for(var _0x330251=0x0,_0x34b796={},_0x5152ff={};_0x330251<_0x566fb0['length'];_0x330251+=0x1){_0x34b796=_0x566fb0[_0x330251];if(_[_0xd664('0x45')](_0x26ca34['faxAccounts'][_0x34b796['id']])){_0x26ca34[_0xd664('0x28')][_0x34b796['id']]=new FaxAccount(_0x34b796);}else{_0x26ca34['mergeFromDatabase'](_0x26ca34[_0xd664('0x28')][_0x34b796['id']],_0x34b796);}}}return _0x26ca34[_0xd664('0x28')];};};module['exports']=Realtime; \ No newline at end of file diff --git a/server/services/ami/report/index.js b/server/services/ami/report/index.js index 529fe78..04bc12d 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 _0xe8c7=['channel','disposition','ANSWERED','connectedlinenum','\x22%s\x22\x20<%s>','transfers','linkedid','transfereelinkedid','create','monitor','monitorFilename','monitors','filename','createdAt','calleridname','membername','xcally-motion-dialer','isArray','startsWith','substring','indexOf','mobile','lastIndexOf','transfererlinkedid','attendedTransfer','exports','lodash','moment','util','../../../config/environment','../ami','../rpc/voiceAgentReport','../rpc/voiceDialReport','../rpc/voiceQueueReport','../rpc/voiceRecording','../rpc/voiceTransferReport','./voiceQueueReport','./voiceCallReport','./voiceAgentReport','./voiceDialReport','realtime','agents','telephones','prototype','sync','disabled','custom:voiceQueueReport','voiceQueueReport','bind','voiceCallReport','custom:voiceAgentReport','voiceAgentReport','custom:voiceDialReport','voiceDialReport','blindTransfer','attendedtransfer','findAgent','find','accountcode','name','isNil','interface','length','assigned','lastAssignedTo','format','SIP/%s','queuecallercomplete','queuecallercompleteAt','YYYY-MM-DD\x20HH:mm:ss','queuecallerexitAt','match','destination','exten','type','dialer','lastapplication','lastdata','context','from-voip-provider','callerid','from-sip','xcally-motion-preview','calleridpreview','calleridnum','originatecalleridnum','destinationchannel'];(function(_0x5c9e54,_0x4b572b){var _0x4ad0e0=function(_0x5076bd){while(--_0x5076bd){_0x5c9e54['push'](_0x5c9e54['shift']());}};_0x4ad0e0(++_0x4b572b);}(_0xe8c7,0x1cd));var _0x7e8c=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0xe8c7[_0x5ddb1c];return _0x354adc;};'use strict';var _=require(_0x7e8c('0x0'));var moment=require(_0x7e8c('0x1'));var util=require(_0x7e8c('0x2'));var config=require(_0x7e8c('0x3'));var ami=require(_0x7e8c('0x4'));var RpcVoiceAgentReport=require(_0x7e8c('0x5'));var RpcVoiceCallReport=require('../rpc/voiceCallReport');var RpcVoiceDialReport=require(_0x7e8c('0x6'));var RpcMemberReport=require('../rpc/memberReport');var RpcVoiceQueueReport=require(_0x7e8c('0x7'));var RpcVoiceRecording=require(_0x7e8c('0x8'));var RpcVoiceTransferReport=require(_0x7e8c('0x9'));var VoiceQueueReport=require(_0x7e8c('0xa'));var VoiceCallReport=require(_0x7e8c('0xb'));var VoiceAgentReport=require(_0x7e8c('0xc'));var VoiceDialReport=require(_0x7e8c('0xd'));var UserReport=require('./userReport');function Report(_0x1ba34f){this[_0x7e8c('0xe')]=_0x1ba34f;this[_0x7e8c('0xf')]=_0x1ba34f['agents'];this[_0x7e8c('0x10')]=_0x1ba34f[_0x7e8c('0x10')];}Report[_0x7e8c('0x11')][_0x7e8c('0x12')]=function(_0x139d87){var _0x2544bf=new VoiceQueueReport(this[_0x7e8c('0xe')]);var _0x241785=new VoiceAgentReport(this['realtime']);var _0x2031b7=new VoiceDialReport(this[_0x7e8c('0xe')]);var _0x467195=new VoiceCallReport(this[_0x7e8c('0xe')]);var _0x59748d=new UserReport(this[_0x7e8c('0xe')]);if(config['xdr']&&config['xdr'][_0x7e8c('0x13')]){ami['on'](_0x7e8c('0x14'),this[_0x7e8c('0x15')][_0x7e8c('0x16')](this));ami['on']('custom:voiceCallReport',this[_0x7e8c('0x17')]['bind'](this));ami['on'](_0x7e8c('0x18'),this[_0x7e8c('0x19')]['bind'](this));ami['on'](_0x7e8c('0x1a'),this[_0x7e8c('0x1b')][_0x7e8c('0x16')](this));ami['on']('blindtransfer',this[_0x7e8c('0x1c')][_0x7e8c('0x16')](this));ami['on'](_0x7e8c('0x1d'),this['attendedTransfer']['bind'](this));}};Report[_0x7e8c('0x11')][_0x7e8c('0x1e')]=function(_0x1d38b9){var _0x2f3483;_0x2f3483=_[_0x7e8c('0x1f')](this[_0x7e8c('0xf')],function(_0x29fb4a){return _0x29fb4a[_0x7e8c('0x20')]==_0x1d38b9||_0x29fb4a[_0x7e8c('0x21')]==_0x1d38b9;});if(_[_0x7e8c('0x22')](_0x2f3483)){var _0x5aa0b9=_['find'](this[_0x7e8c('0x10')],function(_0x10f806){return _0x10f806[_0x7e8c('0x20')]==_0x1d38b9||_0x10f806[_0x7e8c('0x21')]==_0x1d38b9;});if(_0x5aa0b9){_0x2f3483=_['find'](this['agents'],function(_0x1f8155){return _0x1f8155[_0x7e8c('0x23')]==util['format']('SIP/%s',_0x5aa0b9[_0x7e8c('0x21')]);});}}return _0x2f3483;};Report[_0x7e8c('0x11')]['voiceQueueReport']=function(_0x353589){for(var _0x3281bd=0x0;_0x3281bd<_0x353589[_0x7e8c('0x24')];_0x3281bd+=0x1){var _0x21d064=this[_0x7e8c('0x1e')](_0x353589[_0x3281bd]['connectedlinenum']);if(_0x21d064){_0x353589[_0x3281bd]['accountcode']=_0x21d064[_0x7e8c('0x20')];_0x353589[_0x3281bd][_0x7e8c('0x25')]=!![];_0x353589[_0x3281bd][_0x7e8c('0x26')]=_0x21d064[_0x7e8c('0x21')];_0x353589[_0x3281bd][_0x7e8c('0x23')]=_['isNil'](_0x21d064[_0x7e8c('0x23')])?util[_0x7e8c('0x27')](_0x7e8c('0x28'),_0x21d064['name']):_0x21d064[_0x7e8c('0x23')];if(_0x353589[_0x3281bd][_0x7e8c('0x29')]){_0x353589[_0x3281bd][_0x7e8c('0x2a')]=moment()[_0x7e8c('0x27')](_0x7e8c('0x2b'));}if(_0x353589[_0x3281bd]['queuecallerexit']){_0x353589[_0x3281bd][_0x7e8c('0x2c')]=moment()[_0x7e8c('0x27')](_0x7e8c('0x2b'));}RpcMemberReport['voiceQueueReport'](_0x353589[_0x3281bd]);}RpcVoiceQueueReport['create'](_0x353589[_0x3281bd]);}};function extractCalleridNumber(_0x5d9a25){var _0x255d26=_0x5d9a25[_0x7e8c('0x2d')](/<(.*?)>/);return _0x255d26?_0x255d26[0x1]:_0x5d9a25;}Report[_0x7e8c('0x11')][_0x7e8c('0x17')]=function(_0x21298e){_0x21298e['destination']=_0x21298e[_0x7e8c('0x2e')]||_0x21298e[_0x7e8c('0x2f')];if(_0x21298e[_0x7e8c('0x30')]==_0x7e8c('0x31')){_0x21298e[_0x7e8c('0x32')]='queue';_0x21298e[_0x7e8c('0x33')]=_0x21298e['queue'];if(_0x21298e[_0x7e8c('0x34')]==_0x7e8c('0x35')){_0x21298e[_0x7e8c('0x20')]='';_0x21298e[_0x7e8c('0x2e')]=extractCalleridNumber(_0x21298e[_0x7e8c('0x36')]);}else if(_0x21298e['context']==_0x7e8c('0x37')){if(_0x21298e[_0x7e8c('0x2e')]==_0x7e8c('0x38')){_0x21298e[_0x7e8c('0x2e')]=extractCalleridNumber(_0x21298e[_0x7e8c('0x39')]);_0x21298e[_0x7e8c('0x3a')]=_0x21298e[_0x7e8c('0x3b')];_0x21298e[_0x7e8c('0x3c')]=[_0x21298e[_0x7e8c('0x3d')],_0x21298e[_0x7e8c('0x3d')]=_0x21298e[_0x7e8c('0x3c')]][0x0];_0x21298e['callerid']=_0x21298e[_0x7e8c('0x39')];}else{_0x21298e[_0x7e8c('0x2e')]=_0x21298e['calleridnum'];_0x21298e[_0x7e8c('0x3a')]=_0x21298e['originatecalleridnum'];if(_0x21298e[_0x7e8c('0x3e')]==_0x7e8c('0x3f')){_0x21298e[_0x7e8c('0x20')]=_0x21298e[_0x7e8c('0x40')];}else{_0x21298e[_0x7e8c('0x20')]='';}}}}else{_0x21298e[_0x7e8c('0x36')]=util[_0x7e8c('0x27')](_0x7e8c('0x41'),_0x21298e['calleridname'],_0x21298e[_0x7e8c('0x3a')]);}if(RpcVoiceTransferReport[_0x7e8c('0x42')][_0x21298e[_0x7e8c('0x43')]]){var _0x5896a3=RpcVoiceTransferReport[_0x7e8c('0x42')][_0x21298e[_0x7e8c('0x43')]];_0x5896a3[_0x7e8c('0x44')]=_0x21298e['uniqueid'];RpcVoiceTransferReport[_0x7e8c('0x1c')](_0x5896a3);delete RpcVoiceTransferReport['transfers'][_0x21298e[_0x7e8c('0x43')]];}RpcVoiceCallReport[_0x7e8c('0x45')](_0x21298e);if(_0x21298e[_0x7e8c('0x46')]){for(var _0x2685ec=0x0;_0x2685ec<_0x21298e['monitors'][_0x7e8c('0x24')];_0x2685ec+=0x1){_0x21298e[_0x7e8c('0x47')]=_0x21298e[_0x7e8c('0x48')][_0x2685ec][_0x7e8c('0x49')];_0x21298e[_0x7e8c('0x4a')]=_0x21298e['monitors'][_0x2685ec][_0x7e8c('0x4a')];if(_0x21298e[_0x7e8c('0x2f')]==_0x7e8c('0x38')){_0x21298e['calleridnum']=_0x21298e[_0x7e8c('0x40')];_0x21298e[_0x7e8c('0x4b')]=_0x21298e['connectedlinename'];_0x21298e[_0x7e8c('0x40')]=_0x21298e[_0x7e8c('0x20')];_0x21298e['connectedlinename']=_0x21298e[_0x7e8c('0x4c')];_0x21298e['exten']=_0x21298e['originatecalleridnum'];}else if(_0x21298e[_0x7e8c('0x2f')]==_0x7e8c('0x4d')){_0x21298e[_0x7e8c('0x3a')]=_0x21298e[_0x7e8c('0x2e')];_0x21298e['exten']=_0x21298e[_0x7e8c('0x3b')];}RpcVoiceRecording[_0x7e8c('0x45')](_0x21298e);}}};Report[_0x7e8c('0x11')][_0x7e8c('0x19')]=function(_0x3f5f77){if(_[_0x7e8c('0x4e')](_0x3f5f77)){_0x3f5f77['forEach'](function(_0x69b008){RpcVoiceAgentReport[_0x7e8c('0x45')](_0x69b008);});}else{RpcVoiceAgentReport[_0x7e8c('0x45')](_0x3f5f77);}};Report[_0x7e8c('0x11')][_0x7e8c('0x1b')]=function(_0x73d928){RpcVoiceDialReport[_0x7e8c('0x45')](_0x73d928);var _0x1d12a9;var _0x1f1b27;var _0x4e157b=_0x73d928[_0x7e8c('0x3d')];if(_[_0x7e8c('0x4f')](_0x4e157b,'Local')){_0x1f1b27=_0x4e157b[_0x7e8c('0x50')](_0x4e157b[_0x7e8c('0x51')]('/')+0x1,_0x4e157b[_0x7e8c('0x51')]('@'));_0x1d12a9=_[_0x7e8c('0x1f')](this[_0x7e8c('0xf')],function(_0x5da0cd){return _0x5da0cd[_0x7e8c('0x52')]==_0x1f1b27||_0x5da0cd['phone']==_0x1f1b27||_0x5da0cd[_0x7e8c('0x20')]==_0x1f1b27;});}else{_0x1f1b27=_0x4e157b[_0x7e8c('0x50')](_0x4e157b[_0x7e8c('0x51')]('/')+0x1,_0x4e157b[_0x7e8c('0x53')]('-'));_0x1d12a9=this[_0x7e8c('0x1e')](_0x1f1b27);}if(_0x1d12a9){_0x73d928['interface']=_['isNil'](_0x1d12a9['interface'])?util['format']('SIP/%s',_0x1d12a9[_0x7e8c('0x21')]):_0x1d12a9['interface'];_0x73d928[_0x7e8c('0x4c')]=_0x1d12a9[_0x7e8c('0x21')];_0x73d928['accountcode']=_0x1d12a9['accountcode'];RpcMemberReport[_0x7e8c('0x1b')](_0x73d928);}};Report[_0x7e8c('0x11')][_0x7e8c('0x1c')]=function(_0x513b5a){RpcVoiceTransferReport[_0x7e8c('0x42')][_0x513b5a[_0x7e8c('0x54')]]=_0x513b5a;};Report['prototype'][_0x7e8c('0x55')]=function(_0x54da4d){RpcVoiceTransferReport[_0x7e8c('0x55')](_0x54da4d);};module[_0x7e8c('0x56')]=Report; \ No newline at end of file +var _0xb8a3=['queue','from-voip-provider','callerid','context','xcally-motion-preview','calleridpreview','calleridnum','originatecalleridnum','destinationchannel','channel','ANSWERED','\x22%s\x22\x20<%s>','calleridname','linkedid','transfers','transfereelinkedid','uniqueid','blindTransfer','monitor','monitors','createdAt','connectedlinename','membername','xcally-motion-dialer','isArray','forEach','voiceDialReport','startsWith','Local','substring','indexOf','mobile','phone','lastIndexOf','transfererlinkedid','attendedTransfer','lodash','util','../../../config/environment','../ami','../rpc/voiceAgentReport','../rpc/voiceCallReport','../rpc/voiceDialReport','../rpc/memberReport','../rpc/voiceQueueReport','../rpc/voiceRecording','./voiceCallReport','./voiceAgentReport','./voiceDialReport','./userReport','agents','telephones','sync','realtime','xdr','disabled','custom:voiceQueueReport','bind','custom:voiceCallReport','custom:voiceAgentReport','voiceAgentReport','custom:voiceDialReport','blindtransfer','attendedtransfer','prototype','findAgent','find','accountcode','name','isNil','interface','SIP/%s','length','connectedlinenum','assigned','format','queuecallercomplete','queuecallercompleteAt','YYYY-MM-DD\x20HH:mm:ss','queuecallerexitAt','voiceQueueReport','create','match','voiceCallReport','destination','exten','dialer','lastapplication'];(function(_0x10e9a8,_0x430f51){var _0x1fcb44=function(_0x41b04a){while(--_0x41b04a){_0x10e9a8['push'](_0x10e9a8['shift']());}};_0x1fcb44(++_0x430f51);}(_0xb8a3,0x7c));var _0x3b8a=function(_0x3d92a6,_0x44e5cd){_0x3d92a6=_0x3d92a6-0x0;var _0xa28091=_0xb8a3[_0x3d92a6];return _0xa28091;};'use strict';var _=require(_0x3b8a('0x0'));var moment=require('moment');var util=require(_0x3b8a('0x1'));var config=require(_0x3b8a('0x2'));var ami=require(_0x3b8a('0x3'));var RpcVoiceAgentReport=require(_0x3b8a('0x4'));var RpcVoiceCallReport=require(_0x3b8a('0x5'));var RpcVoiceDialReport=require(_0x3b8a('0x6'));var RpcMemberReport=require(_0x3b8a('0x7'));var RpcVoiceQueueReport=require(_0x3b8a('0x8'));var RpcVoiceRecording=require(_0x3b8a('0x9'));var RpcVoiceTransferReport=require('../rpc/voiceTransferReport');var VoiceQueueReport=require('./voiceQueueReport');var VoiceCallReport=require(_0x3b8a('0xa'));var VoiceAgentReport=require(_0x3b8a('0xb'));var VoiceDialReport=require(_0x3b8a('0xc'));var UserReport=require(_0x3b8a('0xd'));function Report(_0x421ecf){this['realtime']=_0x421ecf;this['agents']=_0x421ecf[_0x3b8a('0xe')];this[_0x3b8a('0xf')]=_0x421ecf[_0x3b8a('0xf')];}Report['prototype'][_0x3b8a('0x10')]=function(_0x25ed13){var _0x325cd0=new VoiceQueueReport(this[_0x3b8a('0x11')]);var _0x42331e=new VoiceAgentReport(this[_0x3b8a('0x11')]);var _0x74b361=new VoiceDialReport(this[_0x3b8a('0x11')]);var _0x344fc1=new VoiceCallReport(this[_0x3b8a('0x11')]);var _0x33dc78=new UserReport(this[_0x3b8a('0x11')]);if(config['xdr']&&config[_0x3b8a('0x12')][_0x3b8a('0x13')]){ami['on'](_0x3b8a('0x14'),this['voiceQueueReport'][_0x3b8a('0x15')](this));ami['on'](_0x3b8a('0x16'),this['voiceCallReport'][_0x3b8a('0x15')](this));ami['on'](_0x3b8a('0x17'),this[_0x3b8a('0x18')][_0x3b8a('0x15')](this));ami['on'](_0x3b8a('0x19'),this['voiceDialReport']['bind'](this));ami['on'](_0x3b8a('0x1a'),this['blindTransfer'][_0x3b8a('0x15')](this));ami['on'](_0x3b8a('0x1b'),this['attendedTransfer'][_0x3b8a('0x15')](this));}};Report[_0x3b8a('0x1c')][_0x3b8a('0x1d')]=function(_0x4b12ab){var _0x15667e;_0x15667e=_[_0x3b8a('0x1e')](this[_0x3b8a('0xe')],function(_0x4d8bfa){return _0x4d8bfa[_0x3b8a('0x1f')]==_0x4b12ab||_0x4d8bfa[_0x3b8a('0x20')]==_0x4b12ab;});if(_[_0x3b8a('0x21')](_0x15667e)){var _0x2db2c2=_[_0x3b8a('0x1e')](this[_0x3b8a('0xf')],function(_0x17b559){return _0x17b559[_0x3b8a('0x1f')]==_0x4b12ab||_0x17b559[_0x3b8a('0x20')]==_0x4b12ab;});if(_0x2db2c2){_0x15667e=_['find'](this[_0x3b8a('0xe')],function(_0x142abd){return _0x142abd[_0x3b8a('0x22')]==util['format'](_0x3b8a('0x23'),_0x2db2c2[_0x3b8a('0x20')]);});}}return _0x15667e;};Report[_0x3b8a('0x1c')]['voiceQueueReport']=function(_0x1f458d){for(var _0x532b5f=0x0;_0x532b5f<_0x1f458d[_0x3b8a('0x24')];_0x532b5f+=0x1){var _0x19841f=this[_0x3b8a('0x1d')](_0x1f458d[_0x532b5f][_0x3b8a('0x25')]);if(_0x19841f){_0x1f458d[_0x532b5f][_0x3b8a('0x1f')]=_0x19841f[_0x3b8a('0x1f')];_0x1f458d[_0x532b5f][_0x3b8a('0x26')]=!![];_0x1f458d[_0x532b5f]['lastAssignedTo']=_0x19841f['name'];_0x1f458d[_0x532b5f]['interface']=_['isNil'](_0x19841f[_0x3b8a('0x22')])?util[_0x3b8a('0x27')](_0x3b8a('0x23'),_0x19841f[_0x3b8a('0x20')]):_0x19841f['interface'];if(_0x1f458d[_0x532b5f][_0x3b8a('0x28')]){_0x1f458d[_0x532b5f][_0x3b8a('0x29')]=moment()[_0x3b8a('0x27')](_0x3b8a('0x2a'));}if(_0x1f458d[_0x532b5f]['queuecallerexit']){_0x1f458d[_0x532b5f][_0x3b8a('0x2b')]=moment()[_0x3b8a('0x27')]('YYYY-MM-DD\x20HH:mm:ss');}RpcMemberReport[_0x3b8a('0x2c')](_0x1f458d[_0x532b5f]);}RpcVoiceQueueReport[_0x3b8a('0x2d')](_0x1f458d[_0x532b5f]);}};function extractCalleridNumber(_0x40691a){var _0x4c1c53=_0x40691a[_0x3b8a('0x2e')](/<(.*?)>/);return _0x4c1c53?_0x4c1c53[0x1]:_0x40691a;}Report[_0x3b8a('0x1c')][_0x3b8a('0x2f')]=function(_0x5a473a){_0x5a473a[_0x3b8a('0x30')]=_0x5a473a[_0x3b8a('0x30')]||_0x5a473a[_0x3b8a('0x31')];if(_0x5a473a['type']==_0x3b8a('0x32')){_0x5a473a[_0x3b8a('0x33')]=_0x3b8a('0x34');_0x5a473a['lastdata']=_0x5a473a[_0x3b8a('0x34')];if(_0x5a473a['context']==_0x3b8a('0x35')){_0x5a473a[_0x3b8a('0x1f')]='';_0x5a473a[_0x3b8a('0x30')]=extractCalleridNumber(_0x5a473a[_0x3b8a('0x36')]);}else if(_0x5a473a[_0x3b8a('0x37')]=='from-sip'){if(_0x5a473a[_0x3b8a('0x30')]==_0x3b8a('0x38')){_0x5a473a['destination']=extractCalleridNumber(_0x5a473a[_0x3b8a('0x39')]);_0x5a473a[_0x3b8a('0x3a')]=_0x5a473a[_0x3b8a('0x3b')];_0x5a473a[_0x3b8a('0x3c')]=[_0x5a473a[_0x3b8a('0x3d')],_0x5a473a['channel']=_0x5a473a[_0x3b8a('0x3c')]][0x0];_0x5a473a[_0x3b8a('0x36')]=_0x5a473a[_0x3b8a('0x39')];}else{_0x5a473a[_0x3b8a('0x30')]=_0x5a473a['calleridnum'];_0x5a473a[_0x3b8a('0x3a')]=_0x5a473a['originatecalleridnum'];if(_0x5a473a['disposition']==_0x3b8a('0x3e')){_0x5a473a['accountcode']=_0x5a473a[_0x3b8a('0x25')];}else{_0x5a473a[_0x3b8a('0x1f')]='';}}}}else{_0x5a473a[_0x3b8a('0x36')]=util[_0x3b8a('0x27')](_0x3b8a('0x3f'),_0x5a473a[_0x3b8a('0x40')],_0x5a473a[_0x3b8a('0x3a')]);}if(RpcVoiceTransferReport['transfers'][_0x5a473a[_0x3b8a('0x41')]]){var _0x5f4337=RpcVoiceTransferReport[_0x3b8a('0x42')][_0x5a473a['linkedid']];_0x5f4337[_0x3b8a('0x43')]=_0x5a473a[_0x3b8a('0x44')];RpcVoiceTransferReport[_0x3b8a('0x45')](_0x5f4337);delete RpcVoiceTransferReport[_0x3b8a('0x42')][_0x5a473a[_0x3b8a('0x41')]];}RpcVoiceCallReport['create'](_0x5a473a);if(_0x5a473a[_0x3b8a('0x46')]){for(var _0x514ab8=0x0;_0x514ab8<_0x5a473a[_0x3b8a('0x47')][_0x3b8a('0x24')];_0x514ab8+=0x1){_0x5a473a['monitorFilename']=_0x5a473a[_0x3b8a('0x47')][_0x514ab8]['filename'];_0x5a473a[_0x3b8a('0x48')]=_0x5a473a[_0x3b8a('0x47')][_0x514ab8]['createdAt'];if(_0x5a473a['exten']==_0x3b8a('0x38')){_0x5a473a[_0x3b8a('0x3a')]=_0x5a473a['connectedlinenum'];_0x5a473a[_0x3b8a('0x40')]=_0x5a473a[_0x3b8a('0x49')];_0x5a473a[_0x3b8a('0x25')]=_0x5a473a[_0x3b8a('0x1f')];_0x5a473a[_0x3b8a('0x49')]=_0x5a473a[_0x3b8a('0x4a')];_0x5a473a[_0x3b8a('0x31')]=_0x5a473a[_0x3b8a('0x3b')];}else if(_0x5a473a[_0x3b8a('0x31')]==_0x3b8a('0x4b')){_0x5a473a['calleridnum']=_0x5a473a[_0x3b8a('0x30')];_0x5a473a[_0x3b8a('0x31')]=_0x5a473a['originatecalleridnum'];}RpcVoiceRecording[_0x3b8a('0x2d')](_0x5a473a);}}};Report[_0x3b8a('0x1c')][_0x3b8a('0x18')]=function(_0x4f7bd2){if(_[_0x3b8a('0x4c')](_0x4f7bd2)){_0x4f7bd2[_0x3b8a('0x4d')](function(_0x377a9e){RpcVoiceAgentReport[_0x3b8a('0x2d')](_0x377a9e);});}else{RpcVoiceAgentReport[_0x3b8a('0x2d')](_0x4f7bd2);}};Report[_0x3b8a('0x1c')][_0x3b8a('0x4e')]=function(_0x35d379){RpcVoiceDialReport['create'](_0x35d379);var _0x2c5249;var _0x4c4dff;var _0x11341b=_0x35d379[_0x3b8a('0x3d')];if(_[_0x3b8a('0x4f')](_0x11341b,_0x3b8a('0x50'))){_0x4c4dff=_0x11341b[_0x3b8a('0x51')](_0x11341b[_0x3b8a('0x52')]('/')+0x1,_0x11341b[_0x3b8a('0x52')]('@'));_0x2c5249=_['find'](this['agents'],function(_0x68286e){return _0x68286e[_0x3b8a('0x53')]==_0x4c4dff||_0x68286e[_0x3b8a('0x54')]==_0x4c4dff||_0x68286e[_0x3b8a('0x1f')]==_0x4c4dff;});}else{_0x4c4dff=_0x11341b[_0x3b8a('0x51')](_0x11341b['indexOf']('/')+0x1,_0x11341b[_0x3b8a('0x55')]('-'));_0x2c5249=this[_0x3b8a('0x1d')](_0x4c4dff);}if(_0x2c5249){_0x35d379[_0x3b8a('0x22')]=_[_0x3b8a('0x21')](_0x2c5249[_0x3b8a('0x22')])?util['format'](_0x3b8a('0x23'),_0x2c5249[_0x3b8a('0x20')]):_0x2c5249[_0x3b8a('0x22')];_0x35d379[_0x3b8a('0x4a')]=_0x2c5249[_0x3b8a('0x20')];_0x35d379['accountcode']=_0x2c5249[_0x3b8a('0x1f')];RpcMemberReport[_0x3b8a('0x4e')](_0x35d379);}};Report[_0x3b8a('0x1c')][_0x3b8a('0x45')]=function(_0x5c49e6){RpcVoiceTransferReport[_0x3b8a('0x42')][_0x5c49e6[_0x3b8a('0x56')]]=_0x5c49e6;};Report[_0x3b8a('0x1c')][_0x3b8a('0x57')]=function(_0x486e33){RpcVoiceTransferReport[_0x3b8a('0x57')](_0x486e33);};module['exports']=Report; \ No newline at end of file diff --git a/server/services/ami/report/userReport.js b/server/services/ami/report/userReport.js index c4835e3..36b6c68 100644 --- a/server/services/ami/report/userReport.js +++ b/server/services/ami/report/userReport.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x00fd=['stateRegistry','merge','omit','event','actionid','state','format','name','trunk:save','device','[userReport][devicestatechange]','local','toLowerCase','updateStatusRealtime','stateTime','toNumber','[userReport][devicestatechange]\x20sending\x20telephone:save\x20event:','telephone:%s','telephone:save','[userReport][devicestatechange]\x20sending\x20trunk:save\x20event:','trunk:%s','startsWith','substring','indexOf','find','mobile','phone','accountcode','[userReport][peerstatus]\x20peer:%s\x20address:%s\x20status:%s','peer','address','[userReport][peerstatus]','status','[userReport][peerstatus]\x20sending\x20telephone:save\x20event:','[userReport][peerstatus]\x20sending\x20trunk:save\x20event:','lodash','moment','util','ioredis','bluebird','../../../config/environment','ami','../ami','redis','localhost','trunks','agents','telephones','syncRegistry','bind','devicestatechange','peerstatus','syncPeerStatus','syncRealtimeShow','then','actionSipShowRegistry','error','inspect','resolve','actionDeviceStateList','[userReport][devicestatelist]','actionSipPeerStatus','catch','[userReport][sippeerstatus]','prototype','isNotNull','isUndefined','emit','info','username','debug','[userReport][registry]'];(function(_0x319cb9,_0x4b8d35){var _0x1735fc=function(_0x43b061){while(--_0x43b061){_0x319cb9['push'](_0x319cb9['shift']());}};_0x1735fc(++_0x4b8d35);}(_0x00fd,0x1d3));var _0xd00f=function(_0x4c9c53,_0x8973a0){_0x4c9c53=_0x4c9c53-0x0;var _0x45aa6a=_0x00fd[_0x4c9c53];return _0x45aa6a;};'use strict';var _=require(_0xd00f('0x0'));var moment=require(_0xd00f('0x1'));var util=require(_0xd00f('0x2'));var Redis=require(_0xd00f('0x3'));var BPromise=require(_0xd00f('0x4'));var config=require(_0xd00f('0x5'));var logger=require('../../../config/logger')(_0xd00f('0x6'));var ami=require(_0xd00f('0x7'));config[_0xd00f('0x8')]=_['defaults'](config[_0xd00f('0x8')],{'host':_0xd00f('0x9'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xd00f('0x8')]));function UserReport(_0x181699){this['trunks']=_0x181699[_0xd00f('0xa')];this[_0xd00f('0xb')]=_0x181699[_0xd00f('0xb')];this['telephones']=_0x181699[_0xd00f('0xc')];ami['on']('registryentry',this[_0xd00f('0xd')][_0xd00f('0xe')](this));ami['on']('registry',this[_0xd00f('0xd')][_0xd00f('0xe')](this));ami['on'](_0xd00f('0xf'),this['syncDeviceState']['bind'](this));ami['on'](_0xd00f('0x10'),this[_0xd00f('0x11')][_0xd00f('0xe')](this));return this[_0xd00f('0x12')]();}function showSipRegistrations(){Promise['resolve']()[_0xd00f('0x13')](ami[_0xd00f('0x14')]())['catch'](function(_0x2cf849){logger[_0xd00f('0x15')]('[userReport][sipshowregistry]',util[_0xd00f('0x16')](_0x2cf849,{'showHidden':![],'depth':null}));});}function listDeviceStates(){Promise[_0xd00f('0x17')]()[_0xd00f('0x13')](ami[_0xd00f('0x18')]())['catch'](function(_0xf5e28c){logger['error'](_0xd00f('0x19'),util[_0xd00f('0x16')](_0xf5e28c,{'showHidden':![],'depth':null}));});}function showPeersStatus(){Promise[_0xd00f('0x17')]()[_0xd00f('0x13')](ami[_0xd00f('0x1a')]())[_0xd00f('0x1b')](function(_0x52eb5c){logger[_0xd00f('0x15')](_0xd00f('0x1c'),util[_0xd00f('0x16')](_0x52eb5c,{'showHidden':![],'depth':null}));});}UserReport[_0xd00f('0x1d')]['syncRealtimeShow']=function(){setInterval(function(){BPromise['resolve']()[_0xd00f('0x13')](showSipRegistrations())[_0xd00f('0x13')](listDeviceStates())[_0xd00f('0x13')](showPeersStatus());},0x32c8);};UserReport[_0xd00f('0x1d')][_0xd00f('0x1e')]=function(_0x2d5a0f){return _0x2d5a0f!==null&&!_[_0xd00f('0x1f')](_0x2d5a0f);};UserReport[_0xd00f('0x1d')][_0xd00f('0x20')]=function(_0x4db831,_0x1d9473,_0x43cd4a){io['to'](_0x4db831)[_0xd00f('0x20')](_0x1d9473,_0x43cd4a);};UserReport[_0xd00f('0x1d')][_0xd00f('0xd')]=function(_0x1a2c83){try{if(this[_0xd00f('0x1e')](_0x1a2c83)){logger[_0xd00f('0x21')]('[userReport][registry]\x20registry:%s\x20state:%s',_0x1a2c83[_0xd00f('0x22')],_0x1a2c83['state']);logger[_0xd00f('0x23')](_0xd00f('0x24'),util[_0xd00f('0x16')](_0x1a2c83,{'showHidden':![],'depth':null}));var _0x311661=_['find'](this['trunks'],{'defaultuser':_0x1a2c83['username']});if(_0x311661){_0x1a2c83[_0xd00f('0x25')]=_0x1a2c83['state'];_[_0xd00f('0x26')](_0x311661,_[_0xd00f('0x27')](_0x1a2c83,[_0xd00f('0x28'),_0xd00f('0x29'),'username',_0xd00f('0x2a')]));logger[_0xd00f('0x23')]('[userReport][registry]\x20sending\x20trunk:save\x20event:',util[_0xd00f('0x16')](_0x311661,{'showHidden':![],'depth':null}));this[_0xd00f('0x20')](util[_0xd00f('0x2b')]('trunk:%s',_0x311661[_0xd00f('0x2c')]),_0xd00f('0x2d'),_0x311661);}}}catch(_0x2d69d8){logger[_0xd00f('0x15')]('[userReport][registry]',util[_0xd00f('0x16')](_0x2d69d8,{'showHidden':![],'depth':null}));}};UserReport[_0xd00f('0x1d')]['syncDeviceState']=function(_0x306ba6){try{if(this['isNotNull'](_0x306ba6)){logger[_0xd00f('0x21')]('[userReport][devicestatechange]\x20device:%s\x20state:%s',_0x306ba6[_0xd00f('0x2e')],_0x306ba6[_0xd00f('0x2a')]);logger['debug'](_0xd00f('0x2f'),util['inspect'](_0x306ba6,{'showHidden':![],'depth':null}));if(this[_0xd00f('0xb')][_0x306ba6[_0xd00f('0x2e')]]){if(!this[_0xd00f('0xb')][_0x306ba6[_0xd00f('0x2e')]][_0xd00f('0x30')]||_0x306ba6[_0xd00f('0x2a')][_0xd00f('0x31')]()=='inuse'){this[_0xd00f('0xb')][_0x306ba6[_0xd00f('0x2e')]]['local']=![];if(this[_0xd00f('0xb')][_0x306ba6[_0xd00f('0x2e')]][_0xd00f('0x2a')]!==_0x306ba6['state']['toLowerCase']()){this['agents'][_0x306ba6[_0xd00f('0x2e')]]['stateTime']=_['toNumber'](moment()['format']('x'));}this['agents'][_0x306ba6[_0xd00f('0x2e')]]['state']=_0x306ba6['state'][_0xd00f('0x31')]();this['agents'][_0x306ba6[_0xd00f('0x2e')]][_0xd00f('0x32')](_0x306ba6);}}else if(this['telephones'][_0x306ba6[_0xd00f('0x2e')]]){if(this[_0xd00f('0xc')][_0x306ba6[_0xd00f('0x2e')]]['state']!==_0x306ba6[_0xd00f('0x2a')][_0xd00f('0x31')]()){this[_0xd00f('0xc')][_0x306ba6[_0xd00f('0x2e')]][_0xd00f('0x33')]=_[_0xd00f('0x34')](moment()['format']('x'));}this[_0xd00f('0xc')][_0x306ba6[_0xd00f('0x2e')]][_0xd00f('0x2a')]=_0x306ba6[_0xd00f('0x2a')][_0xd00f('0x31')]();logger[_0xd00f('0x23')](_0xd00f('0x35'),util[_0xd00f('0x16')](this['telephones'][_0x306ba6[_0xd00f('0x2e')]],{'showHidden':![],'depth':null}));this['emit'](util[_0xd00f('0x2b')](_0xd00f('0x36'),this[_0xd00f('0xc')][_0x306ba6[_0xd00f('0x2e')]]['name']),_0xd00f('0x37'),this['telephones'][_0x306ba6[_0xd00f('0x2e')]]);}else if(this[_0xd00f('0xa')][_0x306ba6['device']]){if(this[_0xd00f('0xa')][_0x306ba6[_0xd00f('0x2e')]]['state']!==_0x306ba6[_0xd00f('0x2a')][_0xd00f('0x31')]()){this[_0xd00f('0xa')][_0x306ba6[_0xd00f('0x2e')]][_0xd00f('0x33')]=_[_0xd00f('0x34')](moment()[_0xd00f('0x2b')]('x'));}this['trunks'][_0x306ba6[_0xd00f('0x2e')]]['state']=_0x306ba6[_0xd00f('0x2a')]['toLowerCase']();logger[_0xd00f('0x23')](_0xd00f('0x38'),util['inspect'](this[_0xd00f('0xa')][_0x306ba6['device']],{'showHidden':![],'depth':null}));this[_0xd00f('0x20')](util['format'](_0xd00f('0x39'),this[_0xd00f('0xa')][_0x306ba6[_0xd00f('0x2e')]][_0xd00f('0x2c')]),_0xd00f('0x2d'),this[_0xd00f('0xa')][_0x306ba6[_0xd00f('0x2e')]]);}else if(_[_0xd00f('0x3a')](_0x306ba6[_0xd00f('0x2e')],'Local')){var _0x592dd8=_0x306ba6[_0xd00f('0x2e')];var _0x136923=_0x592dd8[_0xd00f('0x3b')](_0x592dd8[_0xd00f('0x3c')]('/')+0x1,_0x592dd8['indexOf']('@'));var _0x2bb19f=_[_0xd00f('0x3d')](this[_0xd00f('0xb')],function(_0x5c1cb5){return _0x5c1cb5[_0xd00f('0x3e')]==_0x136923||_0x5c1cb5[_0xd00f('0x3f')]==_0x136923||_0x5c1cb5[_0xd00f('0x40')]==_0x136923;});if(_0x2bb19f){if(_0x2bb19f[_0xd00f('0x2a')]!==_0x306ba6[_0xd00f('0x2a')][_0xd00f('0x31')]()){_0x2bb19f[_0xd00f('0x33')]=_[_0xd00f('0x34')](moment()[_0xd00f('0x2b')]('x'));}_0x2bb19f['state']=_0x306ba6[_0xd00f('0x2a')]['toLowerCase']();_0x2bb19f['local']=!![];_0x2bb19f[_0xd00f('0x32')](_0x306ba6);}}}}catch(_0x4c10ce){logger[_0xd00f('0x15')]('[userReport][devicestatechange]',util['inspect'](_0x4c10ce,{'showHidden':![],'depth':null}));}};UserReport[_0xd00f('0x1d')]['syncPeerStatus']=function(_0x2f9320){try{if(this['isNotNull'](_0x2f9320)&&this[_0xd00f('0x1e')](_0x2f9320[_0xd00f('0x10')])){logger[_0xd00f('0x21')](_0xd00f('0x41'),_0x2f9320[_0xd00f('0x42')],_0x2f9320[_0xd00f('0x43')],_0x2f9320[_0xd00f('0x10')]);logger[_0xd00f('0x23')](_0xd00f('0x44'),util['inspect'](_0x2f9320,{'showHidden':![],'depth':null}));if(this[_0xd00f('0xb')][_0x2f9320['peer']]){if(!this[_0xd00f('0xb')][_0x2f9320['peer']][_0xd00f('0x30')]||_0x2f9320[_0xd00f('0x10')][_0xd00f('0x31')]()=='registered'){this[_0xd00f('0xb')][_0x2f9320[_0xd00f('0x42')]]['local']=![];this[_0xd00f('0xb')][_0x2f9320[_0xd00f('0x42')]][_0xd00f('0x45')]=_0x2f9320['peerstatus']['toLowerCase']();this[_0xd00f('0xb')][_0x2f9320[_0xd00f('0x42')]][_0xd00f('0x43')]=_0x2f9320[_0xd00f('0x43')];this['agents'][_0x2f9320[_0xd00f('0x42')]][_0xd00f('0x32')](_0x2f9320);}}else if(this['telephones'][_0x2f9320['peer']]){this['telephones'][_0x2f9320[_0xd00f('0x42')]]['status']=_0x2f9320[_0xd00f('0x10')][_0xd00f('0x31')]();this[_0xd00f('0xc')][_0x2f9320[_0xd00f('0x42')]]['address']=_0x2f9320['address'];logger[_0xd00f('0x23')](_0xd00f('0x46'),util[_0xd00f('0x16')](this['telephones'][_0x2f9320['peer']],{'showHidden':![],'depth':null}));this[_0xd00f('0x20')](util[_0xd00f('0x2b')]('telephone:%s',this[_0xd00f('0xc')][_0x2f9320[_0xd00f('0x42')]][_0xd00f('0x2c')]),'telephone:save',this[_0xd00f('0xc')][_0x2f9320['peer']]);}else if(this[_0xd00f('0xa')][_0x2f9320['peer']]){this[_0xd00f('0xa')][_0x2f9320[_0xd00f('0x42')]][_0xd00f('0x45')]=_0x2f9320[_0xd00f('0x10')][_0xd00f('0x31')]();this['trunks'][_0x2f9320[_0xd00f('0x42')]][_0xd00f('0x43')]=_0x2f9320[_0xd00f('0x43')];logger[_0xd00f('0x23')](_0xd00f('0x47'),util[_0xd00f('0x16')](this[_0xd00f('0xa')][_0x2f9320[_0xd00f('0x42')]],{'showHidden':![],'depth':null}));this[_0xd00f('0x20')](util[_0xd00f('0x2b')](_0xd00f('0x39'),this[_0xd00f('0xa')][_0x2f9320['peer']][_0xd00f('0x2c')]),_0xd00f('0x2d'),this[_0xd00f('0xa')][_0x2f9320[_0xd00f('0x42')]]);}}}catch(_0x5b9d5c){logger[_0xd00f('0x15')]('[userReport][peerstatus]',util[_0xd00f('0x16')](_0x5b9d5c,{'showHidden':![],'depth':null}));}};module['exports']=UserReport; \ No newline at end of file +var _0xccb3=['telephones','registryentry','syncRegistry','registry','bind','devicestatechange','syncDeviceState','peerstatus','syncPeerStatus','syncRealtimeShow','resolve','actionSipShowRegistry','catch','[userReport][sipshowregistry]','inspect','actionDeviceStateList','error','[userReport][devicestatelist]','then','actionSipPeerStatus','[userReport][sippeerstatus]','prototype','isNotNull','isUndefined','emit','info','[userReport][registry]\x20registry:%s\x20state:%s','state','debug','[userReport][registry]','username','event','actionid','format','name','trunk:save','[userReport][devicestatechange]\x20device:%s\x20state:%s','[userReport][devicestatechange]','device','toLowerCase','inuse','local','updateStatusRealtime','toNumber','telephone:%s','stateTime','[userReport][devicestatechange]\x20sending\x20trunk:save\x20event:','Local','substring','mobile','phone','accountcode','peer','address','[userReport][peerstatus]','registered','status','[userReport][peerstatus]\x20sending\x20telephone:save\x20event:','telephone:save','[userReport][peerstatus]\x20sending\x20trunk:save\x20event:','lodash','util','ioredis','../../../config/logger','ami','redis','defaults','localhost','socket.io-emitter','trunks','agents'];(function(_0x114b16,_0x5df981){var _0x53b851=function(_0x28acd8){while(--_0x28acd8){_0x114b16['push'](_0x114b16['shift']());}};_0x53b851(++_0x5df981);}(_0xccb3,0xca));var _0x3ccb=function(_0x552fce,_0x3f24bc){_0x552fce=_0x552fce-0x0;var _0x3e27a2=_0xccb3[_0x552fce];return _0x3e27a2;};'use strict';var _=require(_0x3ccb('0x0'));var moment=require('moment');var util=require(_0x3ccb('0x1'));var Redis=require(_0x3ccb('0x2'));var BPromise=require('bluebird');var config=require('../../../config/environment');var logger=require(_0x3ccb('0x3'))(_0x3ccb('0x4'));var ami=require('../ami');config[_0x3ccb('0x5')]=_[_0x3ccb('0x6')](config[_0x3ccb('0x5')],{'host':_0x3ccb('0x7'),'port':0x18eb});var io=require(_0x3ccb('0x8'))(new Redis(config[_0x3ccb('0x5')]));function UserReport(_0x25fbf5){this[_0x3ccb('0x9')]=_0x25fbf5['trunks'];this[_0x3ccb('0xa')]=_0x25fbf5[_0x3ccb('0xa')];this[_0x3ccb('0xb')]=_0x25fbf5[_0x3ccb('0xb')];ami['on'](_0x3ccb('0xc'),this[_0x3ccb('0xd')]['bind'](this));ami['on'](_0x3ccb('0xe'),this['syncRegistry'][_0x3ccb('0xf')](this));ami['on'](_0x3ccb('0x10'),this[_0x3ccb('0x11')]['bind'](this));ami['on'](_0x3ccb('0x12'),this[_0x3ccb('0x13')][_0x3ccb('0xf')](this));return this[_0x3ccb('0x14')]();}function showSipRegistrations(){Promise[_0x3ccb('0x15')]()['then'](ami[_0x3ccb('0x16')]())[_0x3ccb('0x17')](function(_0x2f430a){logger['error'](_0x3ccb('0x18'),util[_0x3ccb('0x19')](_0x2f430a,{'showHidden':![],'depth':null}));});}function listDeviceStates(){Promise[_0x3ccb('0x15')]()['then'](ami[_0x3ccb('0x1a')]())['catch'](function(_0x3d4a24){logger[_0x3ccb('0x1b')](_0x3ccb('0x1c'),util[_0x3ccb('0x19')](_0x3d4a24,{'showHidden':![],'depth':null}));});}function showPeersStatus(){Promise[_0x3ccb('0x15')]()[_0x3ccb('0x1d')](ami[_0x3ccb('0x1e')]())['catch'](function(_0x2a22b5){logger[_0x3ccb('0x1b')](_0x3ccb('0x1f'),util[_0x3ccb('0x19')](_0x2a22b5,{'showHidden':![],'depth':null}));});}UserReport[_0x3ccb('0x20')][_0x3ccb('0x14')]=function(){setInterval(function(){BPromise[_0x3ccb('0x15')]()[_0x3ccb('0x1d')](showSipRegistrations())[_0x3ccb('0x1d')](listDeviceStates())[_0x3ccb('0x1d')](showPeersStatus());},0x32c8);};UserReport[_0x3ccb('0x20')][_0x3ccb('0x21')]=function(_0x3fd100){return _0x3fd100!==null&&!_[_0x3ccb('0x22')](_0x3fd100);};UserReport[_0x3ccb('0x20')][_0x3ccb('0x23')]=function(_0x48daa9,_0x5cd90b,_0x52ca22){io['to'](_0x48daa9)[_0x3ccb('0x23')](_0x5cd90b,_0x52ca22);};UserReport[_0x3ccb('0x20')][_0x3ccb('0xd')]=function(_0x2b34ce){try{if(this[_0x3ccb('0x21')](_0x2b34ce)){logger[_0x3ccb('0x24')](_0x3ccb('0x25'),_0x2b34ce['username'],_0x2b34ce[_0x3ccb('0x26')]);logger[_0x3ccb('0x27')](_0x3ccb('0x28'),util[_0x3ccb('0x19')](_0x2b34ce,{'showHidden':![],'depth':null}));var _0x25987c=_['find'](this['trunks'],{'defaultuser':_0x2b34ce[_0x3ccb('0x29')]});if(_0x25987c){_0x2b34ce['stateRegistry']=_0x2b34ce[_0x3ccb('0x26')];_['merge'](_0x25987c,_['omit'](_0x2b34ce,[_0x3ccb('0x2a'),_0x3ccb('0x2b'),_0x3ccb('0x29'),_0x3ccb('0x26')]));logger[_0x3ccb('0x27')]('[userReport][registry]\x20sending\x20trunk:save\x20event:',util[_0x3ccb('0x19')](_0x25987c,{'showHidden':![],'depth':null}));this[_0x3ccb('0x23')](util[_0x3ccb('0x2c')]('trunk:%s',_0x25987c[_0x3ccb('0x2d')]),_0x3ccb('0x2e'),_0x25987c);}}}catch(_0x4ac43d){logger[_0x3ccb('0x1b')](_0x3ccb('0x28'),util[_0x3ccb('0x19')](_0x4ac43d,{'showHidden':![],'depth':null}));}};UserReport['prototype']['syncDeviceState']=function(_0x83efc3){try{if(this['isNotNull'](_0x83efc3)){logger[_0x3ccb('0x24')](_0x3ccb('0x2f'),_0x83efc3['device'],_0x83efc3['state']);logger['debug'](_0x3ccb('0x30'),util[_0x3ccb('0x19')](_0x83efc3,{'showHidden':![],'depth':null}));if(this['agents'][_0x83efc3[_0x3ccb('0x31')]]){if(!this[_0x3ccb('0xa')][_0x83efc3[_0x3ccb('0x31')]]['local']||_0x83efc3[_0x3ccb('0x26')][_0x3ccb('0x32')]()==_0x3ccb('0x33')){this[_0x3ccb('0xa')][_0x83efc3[_0x3ccb('0x31')]][_0x3ccb('0x34')]=![];if(this[_0x3ccb('0xa')][_0x83efc3['device']][_0x3ccb('0x26')]!==_0x83efc3[_0x3ccb('0x26')][_0x3ccb('0x32')]()){this[_0x3ccb('0xa')][_0x83efc3[_0x3ccb('0x31')]]['stateTime']=_['toNumber'](moment()[_0x3ccb('0x2c')]('x'));}this['agents'][_0x83efc3[_0x3ccb('0x31')]][_0x3ccb('0x26')]=_0x83efc3['state'][_0x3ccb('0x32')]();this[_0x3ccb('0xa')][_0x83efc3[_0x3ccb('0x31')]][_0x3ccb('0x35')](_0x83efc3);}}else if(this[_0x3ccb('0xb')][_0x83efc3[_0x3ccb('0x31')]]){if(this[_0x3ccb('0xb')][_0x83efc3[_0x3ccb('0x31')]][_0x3ccb('0x26')]!==_0x83efc3[_0x3ccb('0x26')][_0x3ccb('0x32')]()){this['telephones'][_0x83efc3[_0x3ccb('0x31')]]['stateTime']=_[_0x3ccb('0x36')](moment()[_0x3ccb('0x2c')]('x'));}this[_0x3ccb('0xb')][_0x83efc3[_0x3ccb('0x31')]][_0x3ccb('0x26')]=_0x83efc3['state']['toLowerCase']();logger[_0x3ccb('0x27')]('[userReport][devicestatechange]\x20sending\x20telephone:save\x20event:',util[_0x3ccb('0x19')](this[_0x3ccb('0xb')][_0x83efc3[_0x3ccb('0x31')]],{'showHidden':![],'depth':null}));this['emit'](util['format'](_0x3ccb('0x37'),this[_0x3ccb('0xb')][_0x83efc3['device']]['name']),'telephone:save',this[_0x3ccb('0xb')][_0x83efc3[_0x3ccb('0x31')]]);}else if(this['trunks'][_0x83efc3[_0x3ccb('0x31')]]){if(this[_0x3ccb('0x9')][_0x83efc3[_0x3ccb('0x31')]][_0x3ccb('0x26')]!==_0x83efc3[_0x3ccb('0x26')]['toLowerCase']()){this[_0x3ccb('0x9')][_0x83efc3[_0x3ccb('0x31')]][_0x3ccb('0x38')]=_[_0x3ccb('0x36')](moment()[_0x3ccb('0x2c')]('x'));}this['trunks'][_0x83efc3[_0x3ccb('0x31')]][_0x3ccb('0x26')]=_0x83efc3[_0x3ccb('0x26')]['toLowerCase']();logger[_0x3ccb('0x27')](_0x3ccb('0x39'),util[_0x3ccb('0x19')](this[_0x3ccb('0x9')][_0x83efc3[_0x3ccb('0x31')]],{'showHidden':![],'depth':null}));this[_0x3ccb('0x23')](util['format']('trunk:%s',this[_0x3ccb('0x9')][_0x83efc3[_0x3ccb('0x31')]][_0x3ccb('0x2d')]),_0x3ccb('0x2e'),this[_0x3ccb('0x9')][_0x83efc3['device']]);}else if(_['startsWith'](_0x83efc3['device'],_0x3ccb('0x3a'))){var _0x816e96=_0x83efc3[_0x3ccb('0x31')];var _0x3fab64=_0x816e96[_0x3ccb('0x3b')](_0x816e96['indexOf']('/')+0x1,_0x816e96['indexOf']('@'));var _0x5c3762=_['find'](this[_0x3ccb('0xa')],function(_0x5c92b1){return _0x5c92b1[_0x3ccb('0x3c')]==_0x3fab64||_0x5c92b1[_0x3ccb('0x3d')]==_0x3fab64||_0x5c92b1[_0x3ccb('0x3e')]==_0x3fab64;});if(_0x5c3762){if(_0x5c3762[_0x3ccb('0x26')]!==_0x83efc3[_0x3ccb('0x26')]['toLowerCase']()){_0x5c3762[_0x3ccb('0x38')]=_['toNumber'](moment()[_0x3ccb('0x2c')]('x'));}_0x5c3762[_0x3ccb('0x26')]=_0x83efc3[_0x3ccb('0x26')][_0x3ccb('0x32')]();_0x5c3762[_0x3ccb('0x34')]=!![];_0x5c3762[_0x3ccb('0x35')](_0x83efc3);}}}}catch(_0x4d2361){logger['error'](_0x3ccb('0x30'),util[_0x3ccb('0x19')](_0x4d2361,{'showHidden':![],'depth':null}));}};UserReport[_0x3ccb('0x20')][_0x3ccb('0x13')]=function(_0x52d684){try{if(this[_0x3ccb('0x21')](_0x52d684)&&this[_0x3ccb('0x21')](_0x52d684['peerstatus'])){logger[_0x3ccb('0x24')]('[userReport][peerstatus]\x20peer:%s\x20address:%s\x20status:%s',_0x52d684[_0x3ccb('0x3f')],_0x52d684[_0x3ccb('0x40')],_0x52d684[_0x3ccb('0x12')]);logger[_0x3ccb('0x27')](_0x3ccb('0x41'),util[_0x3ccb('0x19')](_0x52d684,{'showHidden':![],'depth':null}));if(this[_0x3ccb('0xa')][_0x52d684[_0x3ccb('0x3f')]]){if(!this[_0x3ccb('0xa')][_0x52d684['peer']]['local']||_0x52d684['peerstatus'][_0x3ccb('0x32')]()==_0x3ccb('0x42')){this[_0x3ccb('0xa')][_0x52d684[_0x3ccb('0x3f')]][_0x3ccb('0x34')]=![];this[_0x3ccb('0xa')][_0x52d684[_0x3ccb('0x3f')]][_0x3ccb('0x43')]=_0x52d684['peerstatus'][_0x3ccb('0x32')]();this[_0x3ccb('0xa')][_0x52d684[_0x3ccb('0x3f')]]['address']=_0x52d684[_0x3ccb('0x40')];this[_0x3ccb('0xa')][_0x52d684[_0x3ccb('0x3f')]][_0x3ccb('0x35')](_0x52d684);}}else if(this['telephones'][_0x52d684['peer']]){this[_0x3ccb('0xb')][_0x52d684[_0x3ccb('0x3f')]][_0x3ccb('0x43')]=_0x52d684[_0x3ccb('0x12')][_0x3ccb('0x32')]();this[_0x3ccb('0xb')][_0x52d684[_0x3ccb('0x3f')]][_0x3ccb('0x40')]=_0x52d684[_0x3ccb('0x40')];logger['debug'](_0x3ccb('0x44'),util[_0x3ccb('0x19')](this[_0x3ccb('0xb')][_0x52d684[_0x3ccb('0x3f')]],{'showHidden':![],'depth':null}));this['emit'](util['format'](_0x3ccb('0x37'),this[_0x3ccb('0xb')][_0x52d684['peer']][_0x3ccb('0x2d')]),_0x3ccb('0x45'),this[_0x3ccb('0xb')][_0x52d684[_0x3ccb('0x3f')]]);}else if(this[_0x3ccb('0x9')][_0x52d684[_0x3ccb('0x3f')]]){this[_0x3ccb('0x9')][_0x52d684[_0x3ccb('0x3f')]][_0x3ccb('0x43')]=_0x52d684[_0x3ccb('0x12')][_0x3ccb('0x32')]();this[_0x3ccb('0x9')][_0x52d684[_0x3ccb('0x3f')]][_0x3ccb('0x40')]=_0x52d684[_0x3ccb('0x40')];logger[_0x3ccb('0x27')](_0x3ccb('0x46'),util[_0x3ccb('0x19')](this['trunks'][_0x52d684[_0x3ccb('0x3f')]],{'showHidden':![],'depth':null}));this['emit'](util[_0x3ccb('0x2c')]('trunk:%s',this[_0x3ccb('0x9')][_0x52d684['peer']]['name']),_0x3ccb('0x2e'),this[_0x3ccb('0x9')][_0x52d684[_0x3ccb('0x3f')]]);}}}catch(_0x4194d0){logger[_0x3ccb('0x1b')](_0x3ccb('0x41'),util['inspect'](_0x4194d0,{'showHidden':![],'depth':null}));}};module['exports']=UserReport; \ No newline at end of file diff --git a/server/services/ami/report/voiceAgentReport.js b/server/services/ami/report/voiceAgentReport.js index 4ad70f5..ff5e212 100644 --- a/server/services/ami/report/voiceAgentReport.js +++ b/server/services/ami/report/voiceAgentReport.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x05f1=['[%s][voiceAgentReport][agentcalled]\x20sending\x20agentcalled\x20event:','[%s][voiceAgentReport][agentcalled]\x20sending\x20user:called\x20event:','[%s][voiceAgentReport][agentcalled]','[%s][voiceAgentReport][agentconnect]\x20event:','hasOwnProperty','[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','agentconnectAt','connectedlinename','connectedlinenum','destchannelstate','destchannelstatedesc','holdtime','connect','routealias','interface','destconnectedlinenum','[%s][voiceAgentReport][agentconnect]\x20sending\x20agentconnect\x20event:','custom:agentconnect','[%s][voiceAgentReport][agentcalled]\x20sending\x20user:agentconnect\x20event:','user:%s','user:agentconnect','agentringnoanswerAt','answeredelsewheredestinationuniqueid','answeredelsewheremembername','lastevent','answered_elsewhere','reason','custom:agentansweredelsewhere','error','[%s][voiceAgentReport][agentringnoanswer]\x20event:','[%s][voiceAgentReport][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:rejected','rejected','[%s][voiceAgentReport][agentringnoanswer]\x20sending\x20agentringnoanswer\x20event:','custom:agentringnoanswer','[%s][voiceAgentReport][agentringnoanswer]','syncQueueCallerAbandon','[%s][voiceAgentReport][queuecallerabandon]\x20event:','abandoned','[%s][voiceAgentReport][queuecallerabandon]\x20sending\x20agentqueuecallerabandon\x20event:','custom:agentqueuecallerabandon','[%s][voiceAgentReport][queuecallerabandon]','syncAgentComplete','[%s][voiceAgentReport][agentcomplete]\x20event:','[%s][voiceAgentReport][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','agentcompleteAt','complete','agent','talktime','acw','acwTimeout','agentacw','[%s][voiceAgentReport][agentcomplete]\x20sending\x20agentcomplete\x20event:','custom:agentcomplete','user:agentcomplete','[%s][voiceAgentReport][varset]\x20event:','addVariable','keys','variable','value','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqosrtt','rtpaudioqosrttbridged','sipcallid','sipuri','bridgepeer','bridgepvtcallid','membercalls','memberdynamic','memberinterface','memberlastcall','memberpenalty','isNil','[%s][voiceAgentReport][hangup]\x20event:','transfer','[%s][voiceAgentReport][hangup]\x20destuniqueid:%s','[%s][voiceAgentReport][hangup]\x20sending\x20voiceAgentReport\x20event:','custom:voiceAgentReport','values','[%s][voiceAgentReport][hangup]','[%s][voiceAgentReport][attendedtransfer]\x20event:','transfereeuniqueid','origtransfereruniqueid','diff','seconds','secondtransfereruniqueid','[%s][voiceAgentReport][blindtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','channel','substring','lastIndexOf','[%s][voiceAgentReport][musiconholdstart]\x20interface:%s','onhold','[%s][voiceAgentReport][musiconholdstop]\x20event:','[%s][voiceAgentReport][musiconholdstop]\x20interface:%s','[%s][voiceAgentReport][musiconholdstop]','exports','lodash','moment','util','ioredis','../../../config/environment','../../../config/logger','../ami','redis','defaults','voiceChannels','channels','voiceQueues','agents','variables','agentcalled','syncAgentCalled','bind','agentconnect','syncAgentConnect','agentringnoanswer','syncAgentRingNoAnswer','queuecallerabandon','agentcomplete','varset','hangup','syncHangup','syncMusicOnHoldStart','musiconholdstop','syncMusicOnHoldStop','attendedtransfer','syncAttendedTransfer','syncBlindTransfer','prototype','emit','isNotNull','isUndefined','info','[%s][voiceAgentReport][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','membername','destuniqueid','debug','[%s][voiceAgentReport][agentcalled]\x20event:','uniqueid','inspect','format','YYYY-MM-DD\x20HH:mm:ss','queue','mandatoryDisposition','type','inbound','voice','merge','omit','event'];(function(_0x59bd64,_0x237f2b){var _0x378c0e=function(_0x24e2be){while(--_0x24e2be){_0x59bd64['push'](_0x59bd64['shift']());}};_0x378c0e(++_0x237f2b);}(_0x05f1,0xfa));var _0x105f=function(_0x413feb,_0x10477f){_0x413feb=_0x413feb-0x0;var _0x40ee88=_0x05f1[_0x413feb];return _0x40ee88;};'use strict';var _=require(_0x105f('0x0'));var moment=require(_0x105f('0x1'));var util=require(_0x105f('0x2'));var Redis=require(_0x105f('0x3'));var config=require(_0x105f('0x4'));var logger=require(_0x105f('0x5'))('ami');var ami=require(_0x105f('0x6'));config[_0x105f('0x7')]=_[_0x105f('0x8')](config[_0x105f('0x7')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x105f('0x7')]));function VoiceAgentReport(_0x228294){this['channels']={};this[_0x105f('0x9')]=_0x228294[_0x105f('0xa')];this[_0x105f('0xb')]=_0x228294['voiceQueues'];this[_0x105f('0xc')]=_0x228294['agents'];this[_0x105f('0xd')]={};ami['on'](_0x105f('0xe'),this[_0x105f('0xf')][_0x105f('0x10')](this));ami['on'](_0x105f('0x11'),this[_0x105f('0x12')][_0x105f('0x10')](this));ami['on'](_0x105f('0x13'),this[_0x105f('0x14')][_0x105f('0x10')](this));ami['on'](_0x105f('0x15'),this['syncQueueCallerAbandon'][_0x105f('0x10')](this));ami['on'](_0x105f('0x16'),this['syncAgentComplete'][_0x105f('0x10')](this));ami['on'](_0x105f('0x17'),this['syncVarSet']['bind'](this));ami['on'](_0x105f('0x18'),this[_0x105f('0x19')][_0x105f('0x10')](this));ami['on']('musiconholdstart',this[_0x105f('0x1a')][_0x105f('0x10')](this));ami['on'](_0x105f('0x1b'),this[_0x105f('0x1c')][_0x105f('0x10')](this));ami['on'](_0x105f('0x1d'),this[_0x105f('0x1e')][_0x105f('0x10')](this));ami['on']('blindtransfer',this[_0x105f('0x1f')][_0x105f('0x10')](this));}VoiceAgentReport[_0x105f('0x20')][_0x105f('0x21')]=function(_0x4044cd,_0x186cc6,_0x1b7e67){io['to'](_0x4044cd)[_0x105f('0x21')](_0x186cc6,_0x1b7e67);};VoiceAgentReport['prototype'][_0x105f('0x22')]=function(_0xe654c2){return _0xe654c2!==null&&!_[_0x105f('0x23')](_0xe654c2);};VoiceAgentReport[_0x105f('0x20')]['syncAgentCalled']=function(_0x1f0f40){try{if(this[_0x105f('0x22')](_0x1f0f40)){logger[_0x105f('0x24')](_0x105f('0x25'),_0x1f0f40['uniqueid'],_0x1f0f40[_0x105f('0x26')],_0x1f0f40[_0x105f('0x27')]);logger[_0x105f('0x28')](_0x105f('0x29'),_0x1f0f40[_0x105f('0x2a')],util[_0x105f('0x2b')](_0x1f0f40,{'showHidden':![],'depth':null}));if(_[_0x105f('0x23')](this['channels'][_0x1f0f40[_0x105f('0x2a')]])){this[_0x105f('0xa')][_0x1f0f40[_0x105f('0x2a')]]={};}if(_[_0x105f('0x23')](this[_0x105f('0xa')][_0x1f0f40['uniqueid']][_0x1f0f40[_0x105f('0x27')]])){this[_0x105f('0xa')][_0x1f0f40[_0x105f('0x2a')]][_0x1f0f40['destuniqueid']]={'agentcalledAt':moment()[_0x105f('0x2c')](_0x105f('0x2d')),'lastevent':'called','mandatoryDisposition':this['voiceQueues'][_0x1f0f40[_0x105f('0x2e')]]?this[_0x105f('0xb')][_0x1f0f40['queue']][_0x105f('0x2f')]||![]:![],'type':this[_0x105f('0xb')][_0x1f0f40['queue']]?this[_0x105f('0xb')][_0x1f0f40[_0x105f('0x2e')]][_0x105f('0x30')]||_0x105f('0x31'):'inbound','variables':this['variables'][_0x1f0f40[_0x105f('0x2a')]],'motionChannel':_0x105f('0x32')};}_[_0x105f('0x33')](this[_0x105f('0xa')][_0x1f0f40[_0x105f('0x2a')]][_0x1f0f40[_0x105f('0x27')]],_[_0x105f('0x34')](_0x1f0f40,[_0x105f('0x35'),'privilege']));logger['debug'](_0x105f('0x36'),_0x1f0f40[_0x105f('0x2a')],util[_0x105f('0x2b')](this[_0x105f('0xa')][_0x1f0f40[_0x105f('0x2a')]][_0x1f0f40[_0x105f('0x27')]],{'showHidden':![],'depth':null}));ami[_0x105f('0x21')]('custom:agentcalled',this[_0x105f('0xa')][_0x1f0f40[_0x105f('0x2a')]][_0x1f0f40[_0x105f('0x27')]]);logger[_0x105f('0x28')](_0x105f('0x37'),_0x1f0f40[_0x105f('0x2a')],util[_0x105f('0x2b')](this['channels'][_0x1f0f40[_0x105f('0x2a')]][_0x1f0f40[_0x105f('0x27')]],{'showHidden':![],'depth':null}));this[_0x105f('0x21')](util[_0x105f('0x2c')]('user:%s',_0x1f0f40['membername']),'user:called',this[_0x105f('0xa')][_0x1f0f40[_0x105f('0x2a')]][_0x1f0f40['destuniqueid']]);}}catch(_0x2133b9){logger['error'](_0x105f('0x38'),_0x1f0f40[_0x105f('0x2a')],util[_0x105f('0x2b')](_0x2133b9,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x105f('0x12')]=function(_0x1d9cd9){try{if(this['isNotNull'](_0x1d9cd9)){if(this[_0x105f('0xa')][_0x1d9cd9[_0x105f('0x2a')]]){logger[_0x105f('0x28')](_0x105f('0x39'),_0x1d9cd9[_0x105f('0x2a')],util[_0x105f('0x2b')](_0x1d9cd9,{'showHidden':![],'depth':null}));for(var _0xc22303 in this[_0x105f('0xa')][_0x1d9cd9[_0x105f('0x2a')]]){if(this[_0x105f('0xa')][_0x1d9cd9[_0x105f('0x2a')]][_0x105f('0x3a')](_0xc22303)){if(_0x1d9cd9[_0x105f('0x27')]===_0xc22303){logger[_0x105f('0x24')](_0x105f('0x3b'),_0x1d9cd9[_0x105f('0x2a')],_0x1d9cd9[_0x105f('0x26')],_0x1d9cd9[_0x105f('0x27')]);this[_0x105f('0xa')][_0x1d9cd9[_0x105f('0x2a')]][_0xc22303][_0x105f('0x3c')]=moment()[_0x105f('0x2c')](_0x105f('0x2d'));this[_0x105f('0xa')][_0x1d9cd9['uniqueid']][_0xc22303][_0x105f('0x3d')]=_0x1d9cd9['connectedlinename'];this['channels'][_0x1d9cd9[_0x105f('0x2a')]][_0xc22303][_0x105f('0x3e')]=_0x1d9cd9['connectedlinenum'];this[_0x105f('0xa')][_0x1d9cd9['uniqueid']][_0xc22303][_0x105f('0x3f')]=_0x1d9cd9[_0x105f('0x3f')];this['channels'][_0x1d9cd9[_0x105f('0x2a')]][_0xc22303][_0x105f('0x40')]=_0x1d9cd9[_0x105f('0x40')];this['channels'][_0x1d9cd9[_0x105f('0x2a')]][_0xc22303][_0x105f('0x41')]=_0x1d9cd9[_0x105f('0x41')];this[_0x105f('0xa')][_0x1d9cd9[_0x105f('0x2a')]][_0xc22303]['lastevent']=_0x105f('0x42');if(this[_0x105f('0x9')][this['channels'][_0x1d9cd9['uniqueid']][_0xc22303][_0x105f('0x2a')]]){var _0x5890c6=this[_0x105f('0x9')][this[_0x105f('0xa')][_0x1d9cd9[_0x105f('0x2a')]][_0xc22303][_0x105f('0x2a')]][_0x105f('0x43')];this[_0x105f('0xa')][_0x1d9cd9[_0x105f('0x2a')]][_0xc22303][_0x105f('0x43')]=_0x5890c6;_0x1d9cd9[_0x105f('0x43')]=_0x5890c6;}_[_0x105f('0x33')](this['agents'][_0x1d9cd9[_0x105f('0x44')]],_['pick'](_0x1d9cd9,['queue',_0x105f('0x45'),_0x105f('0x43')]));logger[_0x105f('0x28')](_0x105f('0x46'),_0x1d9cd9[_0x105f('0x2a')],util[_0x105f('0x2b')](this[_0x105f('0xa')][_0x1d9cd9[_0x105f('0x2a')]][_0x1d9cd9[_0x105f('0x27')]],{'showHidden':![],'depth':null}));ami[_0x105f('0x21')](_0x105f('0x47'),this[_0x105f('0xa')][_0x1d9cd9[_0x105f('0x2a')]][_0x1d9cd9[_0x105f('0x27')]]);logger['debug'](_0x105f('0x48'),_0x1d9cd9[_0x105f('0x2a')],util[_0x105f('0x2b')](this['channels'][_0x1d9cd9[_0x105f('0x2a')]][_0x1d9cd9[_0x105f('0x27')]],{'showHidden':![],'depth':null}));this[_0x105f('0x21')](util['format'](_0x105f('0x49'),_0x1d9cd9['membername']),_0x105f('0x4a'),this['channels'][_0x1d9cd9['uniqueid']][_0x1d9cd9['destuniqueid']]);}else if(!this['channels'][_0x1d9cd9[_0x105f('0x2a')]][_0xc22303][_0x105f('0x13')]&&!this['channels'][_0x1d9cd9[_0x105f('0x2a')]][_0xc22303][_0x105f('0x16')]){logger[_0x105f('0x24')]('[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:answered_elsewhere',_0x1d9cd9['uniqueid'],this[_0x105f('0xa')][_0x1d9cd9['uniqueid']][_0xc22303][_0x105f('0x26')],_0xc22303);this['channels'][_0x1d9cd9[_0x105f('0x2a')]][_0xc22303][_0x105f('0x13')]=!![];this[_0x105f('0xa')][_0x1d9cd9[_0x105f('0x2a')]][_0xc22303][_0x105f('0x4b')]=moment()[_0x105f('0x2c')](_0x105f('0x2d'));this[_0x105f('0xa')][_0x1d9cd9[_0x105f('0x2a')]][_0xc22303][_0x105f('0x4c')]=_0x1d9cd9[_0x105f('0x27')];this[_0x105f('0xa')][_0x1d9cd9[_0x105f('0x2a')]][_0xc22303][_0x105f('0x4d')]=_0x1d9cd9[_0x105f('0x26')];this[_0x105f('0xa')][_0x1d9cd9[_0x105f('0x2a')]][_0xc22303][_0x105f('0x4e')]=_0x105f('0x4f');this[_0x105f('0xa')][_0x1d9cd9[_0x105f('0x2a')]][_0xc22303][_0x105f('0x50')]=_0x105f('0x4f');logger[_0x105f('0x28')]('[%s][voiceAgentReport][agentconnect]\x20sending\x20agentansweredelsewhere\x20event:',_0x1d9cd9[_0x105f('0x2a')],util[_0x105f('0x2b')](this[_0x105f('0xa')][_0x1d9cd9[_0x105f('0x2a')]][_0xc22303],{'showHidden':![],'depth':null}));ami[_0x105f('0x21')](_0x105f('0x51'),this[_0x105f('0xa')][_0x1d9cd9[_0x105f('0x2a')]][_0xc22303]);}}}}}}catch(_0x2b0eae){logger[_0x105f('0x52')]('[%s][voiceAgentReport][agentconnect]',_0x1d9cd9[_0x105f('0x2a')],util['inspect'](_0x2b0eae,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x105f('0x20')][_0x105f('0x14')]=function(_0x48afd3){try{if(this[_0x105f('0x22')](_0x48afd3)){logger[_0x105f('0x28')](_0x105f('0x53'),_0x48afd3[_0x105f('0x2a')],util[_0x105f('0x2b')](_0x48afd3,{'showHidden':![],'depth':null}));if(this[_0x105f('0xa')][_0x48afd3[_0x105f('0x2a')]]&&this[_0x105f('0xa')][_0x48afd3[_0x105f('0x2a')]][_0x48afd3[_0x105f('0x27')]]){logger[_0x105f('0x24')](_0x105f('0x54'),_0x48afd3['uniqueid'],_0x48afd3[_0x105f('0x26')],_0x48afd3[_0x105f('0x27')]);this[_0x105f('0xa')][_0x48afd3[_0x105f('0x2a')]][_0x48afd3[_0x105f('0x27')]][_0x105f('0x13')]=!![];this[_0x105f('0xa')][_0x48afd3[_0x105f('0x2a')]][_0x48afd3['destuniqueid']][_0x105f('0x4b')]=moment()[_0x105f('0x2c')](_0x105f('0x2d'));this['channels'][_0x48afd3['uniqueid']][_0x48afd3[_0x105f('0x27')]][_0x105f('0x4e')]=_0x105f('0x55');this[_0x105f('0xa')][_0x48afd3[_0x105f('0x2a')]][_0x48afd3[_0x105f('0x27')]]['reason']=_0x105f('0x55');logger[_0x105f('0x28')](_0x105f('0x56'),_0x48afd3[_0x105f('0x2a')],util[_0x105f('0x2b')](this[_0x105f('0xa')][_0x48afd3[_0x105f('0x2a')]][_0x48afd3[_0x105f('0x27')]],{'showHidden':![],'depth':null}));ami[_0x105f('0x21')](_0x105f('0x57'),this[_0x105f('0xa')][_0x48afd3[_0x105f('0x2a')]][_0x48afd3[_0x105f('0x27')]]);}}}catch(_0x35e6d3){logger[_0x105f('0x52')](_0x105f('0x58'),_0x48afd3[_0x105f('0x2a')],util[_0x105f('0x2b')](_0x35e6d3,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x105f('0x59')]=function(_0x334421){try{if(this[_0x105f('0x22')](_0x334421)){logger[_0x105f('0x28')](_0x105f('0x5a'),_0x334421[_0x105f('0x2a')],util[_0x105f('0x2b')](_0x334421,{'showHidden':![],'depth':null}));if(this[_0x105f('0xa')][_0x334421[_0x105f('0x2a')]]){for(var _0x14dac8 in this['channels'][_0x334421['uniqueid']]){if(this['channels'][_0x334421[_0x105f('0x2a')]][_0x105f('0x3a')](_0x14dac8)&&!this['channels'][_0x334421['uniqueid']][_0x14dac8][_0x105f('0x13')]&&!this[_0x105f('0xa')][_0x334421[_0x105f('0x2a')]][_0x14dac8][_0x105f('0x16')]){logger['info']('[%s][voiceAgentReport][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned',_0x334421[_0x105f('0x2a')],this[_0x105f('0xa')][_0x334421[_0x105f('0x2a')]][_0x14dac8][_0x105f('0x26')],_0x14dac8);this[_0x105f('0xa')][_0x334421[_0x105f('0x2a')]][_0x14dac8][_0x105f('0x13')]=!![];this[_0x105f('0xa')][_0x334421['uniqueid']][_0x14dac8][_0x105f('0x4b')]=moment()[_0x105f('0x2c')](_0x105f('0x2d'));this[_0x105f('0xa')][_0x334421[_0x105f('0x2a')]][_0x14dac8][_0x105f('0x4e')]=_0x105f('0x5b');this['channels'][_0x334421[_0x105f('0x2a')]][_0x14dac8]['reason']=_0x105f('0x5b');logger[_0x105f('0x28')](_0x105f('0x5c'),_0x334421[_0x105f('0x2a')],util[_0x105f('0x2b')](this['channels'][_0x334421[_0x105f('0x2a')]][_0x14dac8],{'showHidden':![],'depth':null}));ami[_0x105f('0x21')](_0x105f('0x5d'),this['channels'][_0x334421['uniqueid']][_0x14dac8]);}}}}}catch(_0x4accab){logger[_0x105f('0x52')](_0x105f('0x5e'),_0x334421['uniqueid'],util[_0x105f('0x2b')](_0x4accab,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x105f('0x20')][_0x105f('0x5f')]=function(_0x26e70c){try{if(this[_0x105f('0x22')](_0x26e70c)){logger[_0x105f('0x28')](_0x105f('0x60'),_0x26e70c[_0x105f('0x2a')],util[_0x105f('0x2b')](_0x26e70c,{'showHidden':![],'depth':null}));if(this[_0x105f('0xa')][_0x26e70c['uniqueid']]){for(var _0x4df91b in this['channels'][_0x26e70c[_0x105f('0x2a')]]){if(this[_0x105f('0xa')][_0x26e70c[_0x105f('0x2a')]]['hasOwnProperty'](_0x4df91b)){if(this[_0x105f('0xa')][_0x26e70c[_0x105f('0x2a')]][_0x4df91b][_0x105f('0x3c')]&&!this[_0x105f('0xa')][_0x26e70c[_0x105f('0x2a')]][_0x4df91b][_0x105f('0x16')]){logger[_0x105f('0x24')](_0x105f('0x61'),_0x26e70c[_0x105f('0x2a')],this[_0x105f('0xa')][_0x26e70c[_0x105f('0x2a')]][_0x4df91b][_0x105f('0x26')],_0x4df91b);this[_0x105f('0xa')][_0x26e70c[_0x105f('0x2a')]][_0x4df91b]['agentcomplete']=!![];this[_0x105f('0xa')][_0x26e70c[_0x105f('0x2a')]][_0x4df91b][_0x105f('0x62')]=moment()[_0x105f('0x2c')](_0x105f('0x2d'));this[_0x105f('0xa')][_0x26e70c['uniqueid']][_0x4df91b][_0x105f('0x4e')]=_0x105f('0x63');this[_0x105f('0xa')][_0x26e70c[_0x105f('0x2a')]][_0x4df91b][_0x105f('0x50')]=_0x26e70c['reason']=='transfer'?_0x105f('0x64'):_0x26e70c[_0x105f('0x50')];this['channels'][_0x26e70c[_0x105f('0x2a')]][_0x4df91b][_0x105f('0x65')]=_0x26e70c['talktime'];if(this[_0x105f('0xb')][_0x26e70c['queue']]&&this[_0x105f('0xb')][_0x26e70c[_0x105f('0x2e')]][_0x105f('0x66')]){this[_0x105f('0xa')][_0x26e70c[_0x105f('0x2a')]][_0x4df91b]['acwtime']=this['voiceQueues'][_0x26e70c[_0x105f('0x2e')]][_0x105f('0x67')];this[_0x105f('0xa')][_0x26e70c[_0x105f('0x2a')]][_0x4df91b][_0x105f('0x68')]=!![];}this[_0x105f('0xc')][_0x26e70c['interface']]=_[_0x105f('0x34')](this[_0x105f('0xc')][_0x26e70c[_0x105f('0x44')]],[_0x105f('0x2e'),_0x105f('0x45')]);logger['debug'](_0x105f('0x69'),_0x26e70c[_0x105f('0x2a')],util[_0x105f('0x2b')](this['channels'][_0x26e70c[_0x105f('0x2a')]][_0x4df91b],{'showHidden':![],'depth':null}));ami[_0x105f('0x21')](_0x105f('0x6a'),this[_0x105f('0xa')][_0x26e70c[_0x105f('0x2a')]][_0x4df91b]);logger[_0x105f('0x28')]('[%s][voiceAgentReport][agentcomplete]\x20sending\x20user:agentcomplete\x20event:',_0x26e70c[_0x105f('0x2a')],util['inspect'](this[_0x105f('0xa')][_0x26e70c['uniqueid']][_0x4df91b],{'showHidden':![],'depth':null}));this[_0x105f('0x21')](util['format'](_0x105f('0x49'),_0x26e70c[_0x105f('0x26')]),_0x105f('0x6b'),this['channels'][_0x26e70c['uniqueid']][_0x4df91b]);}}}}}}catch(_0x106bd4){logger[_0x105f('0x52')]('[%s][voiceAgentReport][agentcomplete]',_0x26e70c[_0x105f('0x2a')],util[_0x105f('0x2b')](_0x106bd4,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x105f('0x20')]['syncVarSet']=function(_0x479b14){try{if(this['isNotNull'](_0x479b14)){logger[_0x105f('0x28')](_0x105f('0x6c'),_0x479b14[_0x105f('0x2a')],util[_0x105f('0x2b')](_0x479b14,{'showHidden':![],'depth':null}));this[_0x105f('0x6d')](_0x479b14[_0x105f('0x2a')],_[_0x105f('0x6e')](_0x479b14[_0x105f('0x6f')])[0x0],_0x479b14[_0x105f('0x70')]);if(this[_0x105f('0xa')][_0x479b14[_0x105f('0x2a')]]){for(var _0x14e917 in this['channels'][_0x479b14['uniqueid']]){if(this['channels'][_0x479b14[_0x105f('0x2a')]][_0x105f('0x3a')](_0x14e917)){logger[_0x105f('0x24')]('[%s][voiceAgentReport][varset]\x20destuniqueid:%s\x20variable:%s\x20value:%s',_0x479b14[_0x105f('0x2a')],_0x14e917,_[_0x105f('0x6e')](_0x479b14[_0x105f('0x6f')])[0x0],_0x479b14[_0x105f('0x70')]);if(_[_0x105f('0x23')](this[_0x105f('0xa')][_0x479b14[_0x105f('0x2a')]][_0x14e917][_0x105f('0xd')])){this[_0x105f('0xa')][_0x479b14[_0x105f('0x2a')]][_0x14e917][_0x105f('0xd')]={};}this[_0x105f('0xa')][_0x479b14[_0x105f('0x2a')]][_0x14e917][_0x105f('0xd')]=this[_0x105f('0xd')][_0x479b14['uniqueid']];}}}}}catch(_0x3b8571){logger[_0x105f('0x52')]('[%s][voiceAgentReport][varset]',_0x479b14[_0x105f('0x2a')],util['inspect'](_0x3b8571,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x105f('0x20')][_0x105f('0x6d')]=function(_0x2a182e,_0x2a1f69,_0xd330ea){var _0x3c6b78=[_0x105f('0x71'),_0x105f('0x72'),'rtpaudioqosjitter',_0x105f('0x73'),_0x105f('0x74'),'rtpaudioqoslossbridged',_0x105f('0x75'),_0x105f('0x76'),_0x105f('0x77'),_0x105f('0x78'),_0x105f('0x79'),_0x105f('0x7a'),_0x105f('0x7b'),_0x105f('0x7c'),_0x105f('0x7d'),_0x105f('0x7e'),_0x105f('0x26'),_0x105f('0x7f'),'memberrealtime'];if(!_[_0x105f('0x80')](_0x2a1f69)&&!_['includes'](_0x3c6b78,_0x2a1f69)){if(_['isUndefined'](this[_0x105f('0xd')][_0x2a182e])){this[_0x105f('0xd')][_0x2a182e]={};}this[_0x105f('0xd')][_0x2a182e][_0x2a1f69]=_0xd330ea;}};VoiceAgentReport[_0x105f('0x20')]['syncHangup']=function(_0x1c79c8){try{if(this[_0x105f('0x22')](_0x1c79c8)){logger[_0x105f('0x28')](_0x105f('0x81'),_0x1c79c8[_0x105f('0x2a')],util['inspect'](_0x1c79c8,{'showHidden':![],'depth':null}));if(this['channels'][_0x1c79c8[_0x105f('0x2a')]]){for(var _0x4fda6b in this['channels'][_0x1c79c8[_0x105f('0x2a')]]){if(this['channels'][_0x1c79c8[_0x105f('0x2a')]][_0x105f('0x3a')](_0x4fda6b)){if(this[_0x105f('0xa')][_0x1c79c8['uniqueid']][_0x4fda6b]['reason']==_0x105f('0x82')&&this['channels'][_0x1c79c8[_0x105f('0x2a')]][_0x4fda6b][_0x105f('0x16')]){logger[_0x105f('0x24')](_0x105f('0x83'),_0x1c79c8[_0x105f('0x2a')],_0x4fda6b);this[_0x105f('0xa')][_0x1c79c8['uniqueid']][_0x4fda6b][_0x105f('0x62')]=moment()[_0x105f('0x2c')](_0x105f('0x2d'));}}}logger[_0x105f('0x28')](_0x105f('0x84'),_0x1c79c8[_0x105f('0x2a')],util[_0x105f('0x2b')](_['values'](this['channels'][_0x1c79c8['uniqueid']]),{'showHidden':![],'depth':null}));ami[_0x105f('0x21')](_0x105f('0x85'),_[_0x105f('0x86')](this['channels'][_0x1c79c8['uniqueid']]));delete this[_0x105f('0xa')][_0x1c79c8[_0x105f('0x2a')]];}if(this[_0x105f('0xd')][_0x1c79c8[_0x105f('0x2a')]]){delete this[_0x105f('0xd')][_0x1c79c8[_0x105f('0x2a')]];}}}catch(_0x1ddf47){logger['error'](_0x105f('0x87'),_0x1c79c8[_0x105f('0x2a')],util['inspect'](_0x1ddf47,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x105f('0x20')][_0x105f('0x1e')]=function(_0x390c0a){try{if(this[_0x105f('0x22')](_0x390c0a)){logger['debug'](_0x105f('0x88'),_0x390c0a[_0x105f('0x2a')],util['inspect'](_0x390c0a,{'showHidden':![],'depth':null}));if(this[_0x105f('0xa')][_0x390c0a[_0x105f('0x89')]]){for(var _0x4021c0 in this[_0x105f('0xa')][_0x390c0a[_0x105f('0x89')]]){if(this[_0x105f('0xa')][_0x390c0a[_0x105f('0x89')]][_0x105f('0x3a')](_0x4021c0)){if(_0x390c0a[_0x105f('0x8a')]===_0x4021c0){logger[_0x105f('0x24')]('[%s][voiceAgentReport][attendedtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete',_0x390c0a[_0x105f('0x2a')],this[_0x105f('0xa')][_0x390c0a[_0x105f('0x89')]][_0x4021c0][_0x105f('0x26')],_0x4021c0);var _0x4ecde7=moment();this['channels'][_0x390c0a[_0x105f('0x89')]][_0x4021c0][_0x105f('0x16')]=!![];this[_0x105f('0xa')][_0x390c0a['transfereeuniqueid']][_0x4021c0][_0x105f('0x62')]=moment()[_0x105f('0x2c')]('YYYY-MM-DD\x20HH:mm:ss');this['channels'][_0x390c0a['transfereeuniqueid']][_0x4021c0][_0x105f('0x4e')]=_0x105f('0x63');this['channels'][_0x390c0a['transfereeuniqueid']][_0x4021c0][_0x105f('0x50')]='transfer';this[_0x105f('0xa')][_0x390c0a['transfereeuniqueid']][_0x4021c0][_0x105f('0x65')]=_0x4ecde7[_0x105f('0x8b')](this[_0x105f('0xa')][_0x390c0a[_0x105f('0x89')]][_0x4021c0][_0x105f('0x3c')],_0x105f('0x8c'));}}}}if(this[_0x105f('0xa')][_0x390c0a[_0x105f('0x8d')]]){var _0x454739=this['channels'][_0x390c0a[_0x105f('0x8d')]];this[_0x105f('0xa')][_0x390c0a['secondtransfereruniqueid']]=this[_0x105f('0xa')][_0x390c0a[_0x105f('0x89')]];this[_0x105f('0xa')][_0x390c0a['transfereeuniqueid']]=_0x454739;}}}catch(_0x335611){logger[_0x105f('0x52')]('[%s][voiceAgentReport][attendedtransfer]',_0x390c0a[_0x105f('0x2a')],util[_0x105f('0x2b')](_0x335611,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x105f('0x20')][_0x105f('0x1f')]=function(_0x1e63d8){try{if(this['isNotNull'](_0x1e63d8)){logger['debug']('[%s][voiceAgentReport][blindtransfer]\x20event:',_0x1e63d8[_0x105f('0x2a')],util[_0x105f('0x2b')](_0x1e63d8,{'showHidden':![],'depth':null}));if(this[_0x105f('0xa')][_0x1e63d8[_0x105f('0x89')]]){for(var _0x39014d in this['channels'][_0x1e63d8[_0x105f('0x89')]]){if(this[_0x105f('0xa')][_0x1e63d8[_0x105f('0x89')]][_0x105f('0x3a')](_0x39014d)){if(_0x1e63d8['transfereruniqueid']===_0x39014d){logger[_0x105f('0x24')](_0x105f('0x8e'),_0x1e63d8[_0x105f('0x2a')],this[_0x105f('0xa')][_0x1e63d8[_0x105f('0x89')]][_0x39014d]['membername'],_0x39014d);var _0x3d28dd=moment();this[_0x105f('0xa')][_0x1e63d8[_0x105f('0x89')]][_0x39014d]['agentcomplete']=!![];this[_0x105f('0xa')][_0x1e63d8[_0x105f('0x89')]][_0x39014d]['agentcompleteAt']=_0x3d28dd;this[_0x105f('0xa')][_0x1e63d8[_0x105f('0x89')]][_0x39014d][_0x105f('0x4e')]=_0x105f('0x63');this[_0x105f('0xa')][_0x1e63d8[_0x105f('0x89')]][_0x39014d][_0x105f('0x50')]=_0x105f('0x82');this[_0x105f('0xa')][_0x1e63d8[_0x105f('0x89')]][_0x39014d][_0x105f('0x65')]=_0x3d28dd[_0x105f('0x8b')](this['channels'][_0x1e63d8[_0x105f('0x89')]][_0x39014d][_0x105f('0x3c')],'seconds');}}}}}}catch(_0x2515bd){logger['error']('[%s][voiceAgentReport][blindtransfer]',_0x1e63d8['uniqueid'],util[_0x105f('0x2b')](_0x2515bd,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x105f('0x1a')]=function(_0x303930){var _0x83d415='';try{if(this[_0x105f('0x22')](_0x303930)){logger[_0x105f('0x28')]('[%s][voiceAgentReport][musiconholdstart]\x20event:',_0x303930[_0x105f('0x2a')],util[_0x105f('0x2b')](_0x303930,{'showHidden':![],'depth':null}));if(_0x303930['channel']){_0x83d415=_0x303930[_0x105f('0x8f')][_0x105f('0x90')](0x0,_0x303930['channel'][_0x105f('0x91')]('-'));if(this[_0x105f('0xc')][_0x83d415]){logger[_0x105f('0x24')](_0x105f('0x92'),_0x303930[_0x105f('0x2a')],_0x83d415);this[_0x105f('0xc')][_0x83d415][_0x105f('0x93')]=!![];}}}}catch(_0xa6b06a){logger[_0x105f('0x52')]('[%s][voiceAgentReport][musiconholdstart]',_0x303930[_0x105f('0x2a')],util['inspect'](_0xa6b06a,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype']['syncMusicOnHoldStop']=function(_0x1d4e4a){var _0x3954cb='';try{if(this[_0x105f('0x22')](_0x1d4e4a)){logger[_0x105f('0x28')](_0x105f('0x94'),_0x1d4e4a['uniqueid'],util['inspect'](_0x1d4e4a,{'showHidden':![],'depth':null}));if(_0x1d4e4a['channel']){_0x3954cb=_0x1d4e4a[_0x105f('0x8f')]['substring'](0x0,_0x1d4e4a[_0x105f('0x8f')][_0x105f('0x91')]('-'));if(this[_0x105f('0xc')][_0x3954cb]){logger[_0x105f('0x24')](_0x105f('0x95'),_0x1d4e4a[_0x105f('0x2a')],_0x3954cb);this[_0x105f('0xc')][_0x3954cb]['onhold']=![];}}}}catch(_0x4a2249){logger[_0x105f('0x52')](_0x105f('0x96'),_0x1d4e4a[_0x105f('0x2a')],util['inspect'](_0x4a2249,{'showHidden':![],'depth':null}));}};module[_0x105f('0x97')]=VoiceAgentReport; \ No newline at end of file +var _0x912e=['custom:agentansweredelsewhere','[%s][voiceAgentReport][agentconnect]','syncAgentRingNoAnswer','[%s][voiceAgentReport][agentringnoanswer]\x20event:','info','agentringnoanswerAt','rejected','[%s][voiceAgentReport][agentringnoanswer]\x20sending\x20agentringnoanswer\x20event:','custom:agentringnoanswer','[%s][voiceAgentReport][agentringnoanswer]','syncQueueCallerAbandon','[%s][voiceAgentReport][queuecallerabandon]\x20event:','[%s][voiceAgentReport][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','[%s][voiceAgentReport][queuecallerabandon]\x20sending\x20agentqueuecallerabandon\x20event:','custom:agentqueuecallerabandon','[%s][voiceAgentReport][agentcomplete]\x20event:','hasOwnProperty','[%s][voiceAgentReport][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','agentcompleteAt','complete','transfer','agent','talktime','[%s][voiceAgentReport][agentcomplete]\x20sending\x20user:agentcomplete\x20event:','user:agentcomplete','[%s][voiceAgentReport][agentcomplete]','addVariable','keys','value','[%s][voiceAgentReport][varset]\x20destuniqueid:%s\x20variable:%s\x20value:%s','variable','variables','[%s][voiceAgentReport][varset]','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','sipcallid','sipuri','bridgepvtcallid','membercalls','memberdynamic','memberinterface','memberpenalty','isNil','includes','[%s][voiceAgentReport][hangup]\x20event:','[%s][voiceAgentReport][hangup]\x20destuniqueid:%s','[%s][voiceAgentReport][hangup]\x20sending\x20voiceAgentReport\x20event:','values','custom:voiceAgentReport','[%s][voiceAgentReport][hangup]','[%s][voiceAgentReport][attendedtransfer]\x20event:','transfereeuniqueid','origtransfereruniqueid','[%s][voiceAgentReport][attendedtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','seconds','secondtransfereruniqueid','[%s][voiceAgentReport][attendedtransfer]','transfereruniqueid','diff','[%s][voiceAgentReport][blindtransfer]','channel','substring','[%s][voiceAgentReport][musiconholdstart]\x20interface:%s','onhold','[%s][voiceAgentReport][musiconholdstart]','[%s][voiceAgentReport][musiconholdstop]\x20event:','lastIndexOf','[%s][voiceAgentReport][musiconholdstop]\x20interface:%s','[%s][voiceAgentReport][musiconholdstop]','exports','util','ioredis','../../../config/environment','../../../config/logger','ami','../ami','redis','defaults','localhost','socket.io-emitter','channels','voiceChannels','voiceQueues','agents','agentcalled','syncAgentCalled','bind','agentconnect','syncAgentConnect','agentringnoanswer','agentcomplete','syncAgentComplete','varset','syncVarSet','hangup','syncHangup','musiconholdstart','syncMusicOnHoldStart','syncMusicOnHoldStop','attendedtransfer','syncAttendedTransfer','syncBlindTransfer','prototype','isNotNull','isUndefined','[%s][voiceAgentReport][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','destuniqueid','debug','[%s][voiceAgentReport][agentcalled]\x20event:','uniqueid','inspect','format','YYYY-MM-DD\x20HH:mm:ss','called','queue','mandatoryDisposition','inbound','voice','merge','omit','event','privilege','[%s][voiceAgentReport][agentcalled]\x20sending\x20agentcalled\x20event:','emit','custom:agentcalled','user:%s','membername','user:called','error','[%s][voiceAgentReport][agentcalled]','[%s][voiceAgentReport][agentconnect]\x20event:','[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','agentconnectAt','connectedlinename','connectedlinenum','destchannelstate','destchannelstatedesc','holdtime','lastevent','connect','routealias','interface','pick','destconnectedlinenum','[%s][voiceAgentReport][agentconnect]\x20sending\x20agentconnect\x20event:','custom:agentconnect','[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:answered_elsewhere','answeredelsewheredestinationuniqueid','answered_elsewhere','reason','[%s][voiceAgentReport][agentconnect]\x20sending\x20agentansweredelsewhere\x20event:'];(function(_0x57c461,_0x340753){var _0x406034=function(_0x175832){while(--_0x175832){_0x57c461['push'](_0x57c461['shift']());}};_0x406034(++_0x340753);}(_0x912e,0xe5));var _0xe912=function(_0x487718,_0x5c3d90){_0x487718=_0x487718-0x0;var _0x860581=_0x912e[_0x487718];return _0x860581;};'use strict';var _=require('lodash');var moment=require('moment');var util=require(_0xe912('0x0'));var Redis=require(_0xe912('0x1'));var config=require(_0xe912('0x2'));var logger=require(_0xe912('0x3'))(_0xe912('0x4'));var ami=require(_0xe912('0x5'));config[_0xe912('0x6')]=_[_0xe912('0x7')](config['redis'],{'host':_0xe912('0x8'),'port':0x18eb});var io=require(_0xe912('0x9'))(new Redis(config[_0xe912('0x6')]));function VoiceAgentReport(_0x1c5ba3){this[_0xe912('0xa')]={};this[_0xe912('0xb')]=_0x1c5ba3['channels'];this[_0xe912('0xc')]=_0x1c5ba3[_0xe912('0xc')];this[_0xe912('0xd')]=_0x1c5ba3[_0xe912('0xd')];this['variables']={};ami['on'](_0xe912('0xe'),this[_0xe912('0xf')][_0xe912('0x10')](this));ami['on'](_0xe912('0x11'),this[_0xe912('0x12')][_0xe912('0x10')](this));ami['on'](_0xe912('0x13'),this['syncAgentRingNoAnswer'][_0xe912('0x10')](this));ami['on']('queuecallerabandon',this['syncQueueCallerAbandon']['bind'](this));ami['on'](_0xe912('0x14'),this[_0xe912('0x15')][_0xe912('0x10')](this));ami['on'](_0xe912('0x16'),this[_0xe912('0x17')]['bind'](this));ami['on'](_0xe912('0x18'),this[_0xe912('0x19')]['bind'](this));ami['on'](_0xe912('0x1a'),this[_0xe912('0x1b')][_0xe912('0x10')](this));ami['on']('musiconholdstop',this[_0xe912('0x1c')][_0xe912('0x10')](this));ami['on'](_0xe912('0x1d'),this[_0xe912('0x1e')][_0xe912('0x10')](this));ami['on']('blindtransfer',this[_0xe912('0x1f')]['bind'](this));}VoiceAgentReport['prototype']['emit']=function(_0x386173,_0x10f9b3,_0x51b8d7){io['to'](_0x386173)['emit'](_0x10f9b3,_0x51b8d7);};VoiceAgentReport[_0xe912('0x20')][_0xe912('0x21')]=function(_0xe2b5f3){return _0xe2b5f3!==null&&!_[_0xe912('0x22')](_0xe2b5f3);};VoiceAgentReport[_0xe912('0x20')][_0xe912('0xf')]=function(_0x3805f0){try{if(this[_0xe912('0x21')](_0x3805f0)){logger['info'](_0xe912('0x23'),_0x3805f0['uniqueid'],_0x3805f0['membername'],_0x3805f0[_0xe912('0x24')]);logger[_0xe912('0x25')](_0xe912('0x26'),_0x3805f0[_0xe912('0x27')],util[_0xe912('0x28')](_0x3805f0,{'showHidden':![],'depth':null}));if(_[_0xe912('0x22')](this[_0xe912('0xa')][_0x3805f0['uniqueid']])){this[_0xe912('0xa')][_0x3805f0['uniqueid']]={};}if(_[_0xe912('0x22')](this[_0xe912('0xa')][_0x3805f0[_0xe912('0x27')]][_0x3805f0[_0xe912('0x24')]])){this[_0xe912('0xa')][_0x3805f0[_0xe912('0x27')]][_0x3805f0['destuniqueid']]={'agentcalledAt':moment()[_0xe912('0x29')](_0xe912('0x2a')),'lastevent':_0xe912('0x2b'),'mandatoryDisposition':this[_0xe912('0xc')][_0x3805f0['queue']]?this[_0xe912('0xc')][_0x3805f0[_0xe912('0x2c')]][_0xe912('0x2d')]||![]:![],'type':this[_0xe912('0xc')][_0x3805f0['queue']]?this[_0xe912('0xc')][_0x3805f0[_0xe912('0x2c')]]['type']||'inbound':_0xe912('0x2e'),'variables':this['variables'][_0x3805f0[_0xe912('0x27')]],'motionChannel':_0xe912('0x2f')};}_[_0xe912('0x30')](this[_0xe912('0xa')][_0x3805f0['uniqueid']][_0x3805f0['destuniqueid']],_[_0xe912('0x31')](_0x3805f0,[_0xe912('0x32'),_0xe912('0x33')]));logger['debug'](_0xe912('0x34'),_0x3805f0[_0xe912('0x27')],util[_0xe912('0x28')](this[_0xe912('0xa')][_0x3805f0[_0xe912('0x27')]][_0x3805f0['destuniqueid']],{'showHidden':![],'depth':null}));ami[_0xe912('0x35')](_0xe912('0x36'),this['channels'][_0x3805f0[_0xe912('0x27')]][_0x3805f0[_0xe912('0x24')]]);logger[_0xe912('0x25')]('[%s][voiceAgentReport][agentcalled]\x20sending\x20user:called\x20event:',_0x3805f0['uniqueid'],util[_0xe912('0x28')](this['channels'][_0x3805f0[_0xe912('0x27')]][_0x3805f0[_0xe912('0x24')]],{'showHidden':![],'depth':null}));this[_0xe912('0x35')](util[_0xe912('0x29')](_0xe912('0x37'),_0x3805f0[_0xe912('0x38')]),_0xe912('0x39'),this[_0xe912('0xa')][_0x3805f0[_0xe912('0x27')]][_0x3805f0['destuniqueid']]);}}catch(_0x2d602c){logger[_0xe912('0x3a')](_0xe912('0x3b'),_0x3805f0[_0xe912('0x27')],util['inspect'](_0x2d602c,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xe912('0x20')][_0xe912('0x12')]=function(_0xb262ff){try{if(this[_0xe912('0x21')](_0xb262ff)){if(this['channels'][_0xb262ff[_0xe912('0x27')]]){logger[_0xe912('0x25')](_0xe912('0x3c'),_0xb262ff['uniqueid'],util['inspect'](_0xb262ff,{'showHidden':![],'depth':null}));for(var _0xf81a31 in this[_0xe912('0xa')][_0xb262ff[_0xe912('0x27')]]){if(this[_0xe912('0xa')][_0xb262ff['uniqueid']]['hasOwnProperty'](_0xf81a31)){if(_0xb262ff[_0xe912('0x24')]===_0xf81a31){logger['info'](_0xe912('0x3d'),_0xb262ff['uniqueid'],_0xb262ff[_0xe912('0x38')],_0xb262ff[_0xe912('0x24')]);this['channels'][_0xb262ff['uniqueid']][_0xf81a31][_0xe912('0x3e')]=moment()['format'](_0xe912('0x2a'));this[_0xe912('0xa')][_0xb262ff['uniqueid']][_0xf81a31][_0xe912('0x3f')]=_0xb262ff['connectedlinename'];this[_0xe912('0xa')][_0xb262ff[_0xe912('0x27')]][_0xf81a31][_0xe912('0x40')]=_0xb262ff['connectedlinenum'];this[_0xe912('0xa')][_0xb262ff['uniqueid']][_0xf81a31]['destchannelstate']=_0xb262ff[_0xe912('0x41')];this[_0xe912('0xa')][_0xb262ff[_0xe912('0x27')]][_0xf81a31]['destchannelstatedesc']=_0xb262ff[_0xe912('0x42')];this[_0xe912('0xa')][_0xb262ff[_0xe912('0x27')]][_0xf81a31]['holdtime']=_0xb262ff[_0xe912('0x43')];this[_0xe912('0xa')][_0xb262ff[_0xe912('0x27')]][_0xf81a31][_0xe912('0x44')]=_0xe912('0x45');if(this[_0xe912('0xb')][this[_0xe912('0xa')][_0xb262ff[_0xe912('0x27')]][_0xf81a31][_0xe912('0x27')]]){var _0x206727=this[_0xe912('0xb')][this[_0xe912('0xa')][_0xb262ff[_0xe912('0x27')]][_0xf81a31][_0xe912('0x27')]][_0xe912('0x46')];this[_0xe912('0xa')][_0xb262ff[_0xe912('0x27')]][_0xf81a31][_0xe912('0x46')]=_0x206727;_0xb262ff[_0xe912('0x46')]=_0x206727;}_[_0xe912('0x30')](this['agents'][_0xb262ff[_0xe912('0x47')]],_[_0xe912('0x48')](_0xb262ff,['queue',_0xe912('0x49'),_0xe912('0x46')]));logger[_0xe912('0x25')](_0xe912('0x4a'),_0xb262ff['uniqueid'],util[_0xe912('0x28')](this['channels'][_0xb262ff[_0xe912('0x27')]][_0xb262ff['destuniqueid']],{'showHidden':![],'depth':null}));ami[_0xe912('0x35')](_0xe912('0x4b'),this[_0xe912('0xa')][_0xb262ff[_0xe912('0x27')]][_0xb262ff[_0xe912('0x24')]]);logger[_0xe912('0x25')]('[%s][voiceAgentReport][agentcalled]\x20sending\x20user:agentconnect\x20event:',_0xb262ff[_0xe912('0x27')],util[_0xe912('0x28')](this[_0xe912('0xa')][_0xb262ff[_0xe912('0x27')]][_0xb262ff[_0xe912('0x24')]],{'showHidden':![],'depth':null}));this[_0xe912('0x35')](util['format'](_0xe912('0x37'),_0xb262ff[_0xe912('0x38')]),'user:agentconnect',this[_0xe912('0xa')][_0xb262ff[_0xe912('0x27')]][_0xb262ff[_0xe912('0x24')]]);}else if(!this[_0xe912('0xa')][_0xb262ff['uniqueid']][_0xf81a31][_0xe912('0x13')]&&!this[_0xe912('0xa')][_0xb262ff[_0xe912('0x27')]][_0xf81a31][_0xe912('0x14')]){logger['info'](_0xe912('0x4c'),_0xb262ff[_0xe912('0x27')],this['channels'][_0xb262ff['uniqueid']][_0xf81a31][_0xe912('0x38')],_0xf81a31);this['channels'][_0xb262ff[_0xe912('0x27')]][_0xf81a31]['agentringnoanswer']=!![];this[_0xe912('0xa')][_0xb262ff[_0xe912('0x27')]][_0xf81a31]['agentringnoanswerAt']=moment()[_0xe912('0x29')](_0xe912('0x2a'));this['channels'][_0xb262ff['uniqueid']][_0xf81a31][_0xe912('0x4d')]=_0xb262ff[_0xe912('0x24')];this[_0xe912('0xa')][_0xb262ff[_0xe912('0x27')]][_0xf81a31]['answeredelsewheremembername']=_0xb262ff[_0xe912('0x38')];this[_0xe912('0xa')][_0xb262ff[_0xe912('0x27')]][_0xf81a31][_0xe912('0x44')]=_0xe912('0x4e');this['channels'][_0xb262ff['uniqueid']][_0xf81a31][_0xe912('0x4f')]=_0xe912('0x4e');logger[_0xe912('0x25')](_0xe912('0x50'),_0xb262ff[_0xe912('0x27')],util[_0xe912('0x28')](this['channels'][_0xb262ff[_0xe912('0x27')]][_0xf81a31],{'showHidden':![],'depth':null}));ami[_0xe912('0x35')](_0xe912('0x51'),this[_0xe912('0xa')][_0xb262ff[_0xe912('0x27')]][_0xf81a31]);}}}}}}catch(_0x3e52de){logger['error'](_0xe912('0x52'),_0xb262ff['uniqueid'],util[_0xe912('0x28')](_0x3e52de,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xe912('0x20')][_0xe912('0x53')]=function(_0x4a878f){try{if(this[_0xe912('0x21')](_0x4a878f)){logger[_0xe912('0x25')](_0xe912('0x54'),_0x4a878f[_0xe912('0x27')],util[_0xe912('0x28')](_0x4a878f,{'showHidden':![],'depth':null}));if(this['channels'][_0x4a878f['uniqueid']]&&this[_0xe912('0xa')][_0x4a878f['uniqueid']][_0x4a878f['destuniqueid']]){logger[_0xe912('0x55')]('[%s][voiceAgentReport][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:rejected',_0x4a878f[_0xe912('0x27')],_0x4a878f[_0xe912('0x38')],_0x4a878f[_0xe912('0x24')]);this[_0xe912('0xa')][_0x4a878f[_0xe912('0x27')]][_0x4a878f['destuniqueid']][_0xe912('0x13')]=!![];this[_0xe912('0xa')][_0x4a878f[_0xe912('0x27')]][_0x4a878f[_0xe912('0x24')]][_0xe912('0x56')]=moment()[_0xe912('0x29')]('YYYY-MM-DD\x20HH:mm:ss');this['channels'][_0x4a878f['uniqueid']][_0x4a878f[_0xe912('0x24')]]['lastevent']=_0xe912('0x57');this[_0xe912('0xa')][_0x4a878f['uniqueid']][_0x4a878f[_0xe912('0x24')]][_0xe912('0x4f')]='rejected';logger[_0xe912('0x25')](_0xe912('0x58'),_0x4a878f['uniqueid'],util['inspect'](this[_0xe912('0xa')][_0x4a878f[_0xe912('0x27')]][_0x4a878f[_0xe912('0x24')]],{'showHidden':![],'depth':null}));ami[_0xe912('0x35')](_0xe912('0x59'),this['channels'][_0x4a878f['uniqueid']][_0x4a878f[_0xe912('0x24')]]);}}}catch(_0x27994e){logger['error'](_0xe912('0x5a'),_0x4a878f[_0xe912('0x27')],util[_0xe912('0x28')](_0x27994e,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0xe912('0x5b')]=function(_0x56ea4e){try{if(this[_0xe912('0x21')](_0x56ea4e)){logger[_0xe912('0x25')](_0xe912('0x5c'),_0x56ea4e['uniqueid'],util[_0xe912('0x28')](_0x56ea4e,{'showHidden':![],'depth':null}));if(this[_0xe912('0xa')][_0x56ea4e[_0xe912('0x27')]]){for(var _0x5bcd69 in this['channels'][_0x56ea4e[_0xe912('0x27')]]){if(this[_0xe912('0xa')][_0x56ea4e[_0xe912('0x27')]]['hasOwnProperty'](_0x5bcd69)&&!this[_0xe912('0xa')][_0x56ea4e['uniqueid']][_0x5bcd69][_0xe912('0x13')]&&!this[_0xe912('0xa')][_0x56ea4e[_0xe912('0x27')]][_0x5bcd69][_0xe912('0x14')]){logger[_0xe912('0x55')](_0xe912('0x5d'),_0x56ea4e[_0xe912('0x27')],this[_0xe912('0xa')][_0x56ea4e[_0xe912('0x27')]][_0x5bcd69][_0xe912('0x38')],_0x5bcd69);this[_0xe912('0xa')][_0x56ea4e[_0xe912('0x27')]][_0x5bcd69][_0xe912('0x13')]=!![];this[_0xe912('0xa')][_0x56ea4e[_0xe912('0x27')]][_0x5bcd69][_0xe912('0x56')]=moment()[_0xe912('0x29')](_0xe912('0x2a'));this[_0xe912('0xa')][_0x56ea4e[_0xe912('0x27')]][_0x5bcd69][_0xe912('0x44')]='abandoned';this[_0xe912('0xa')][_0x56ea4e[_0xe912('0x27')]][_0x5bcd69][_0xe912('0x4f')]='abandoned';logger[_0xe912('0x25')](_0xe912('0x5e'),_0x56ea4e[_0xe912('0x27')],util[_0xe912('0x28')](this[_0xe912('0xa')][_0x56ea4e['uniqueid']][_0x5bcd69],{'showHidden':![],'depth':null}));ami[_0xe912('0x35')](_0xe912('0x5f'),this[_0xe912('0xa')][_0x56ea4e[_0xe912('0x27')]][_0x5bcd69]);}}}}}catch(_0x8e07e6){logger[_0xe912('0x3a')]('[%s][voiceAgentReport][queuecallerabandon]',_0x56ea4e[_0xe912('0x27')],util[_0xe912('0x28')](_0x8e07e6,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0xe912('0x15')]=function(_0x2190aa){try{if(this[_0xe912('0x21')](_0x2190aa)){logger[_0xe912('0x25')](_0xe912('0x60'),_0x2190aa[_0xe912('0x27')],util['inspect'](_0x2190aa,{'showHidden':![],'depth':null}));if(this[_0xe912('0xa')][_0x2190aa[_0xe912('0x27')]]){for(var _0x4e67cd in this[_0xe912('0xa')][_0x2190aa[_0xe912('0x27')]]){if(this[_0xe912('0xa')][_0x2190aa[_0xe912('0x27')]][_0xe912('0x61')](_0x4e67cd)){if(this['channels'][_0x2190aa[_0xe912('0x27')]][_0x4e67cd][_0xe912('0x3e')]&&!this[_0xe912('0xa')][_0x2190aa['uniqueid']][_0x4e67cd][_0xe912('0x14')]){logger[_0xe912('0x55')](_0xe912('0x62'),_0x2190aa[_0xe912('0x27')],this[_0xe912('0xa')][_0x2190aa[_0xe912('0x27')]][_0x4e67cd]['membername'],_0x4e67cd);this['channels'][_0x2190aa[_0xe912('0x27')]][_0x4e67cd][_0xe912('0x14')]=!![];this[_0xe912('0xa')][_0x2190aa['uniqueid']][_0x4e67cd][_0xe912('0x63')]=moment()['format'](_0xe912('0x2a'));this[_0xe912('0xa')][_0x2190aa['uniqueid']][_0x4e67cd][_0xe912('0x44')]=_0xe912('0x64');this['channels'][_0x2190aa[_0xe912('0x27')]][_0x4e67cd][_0xe912('0x4f')]=_0x2190aa[_0xe912('0x4f')]==_0xe912('0x65')?_0xe912('0x66'):_0x2190aa['reason'];this['channels'][_0x2190aa[_0xe912('0x27')]][_0x4e67cd][_0xe912('0x67')]=_0x2190aa[_0xe912('0x67')];if(this['voiceQueues'][_0x2190aa[_0xe912('0x2c')]]&&this[_0xe912('0xc')][_0x2190aa['queue']]['acw']){this['channels'][_0x2190aa[_0xe912('0x27')]][_0x4e67cd]['acwtime']=this[_0xe912('0xc')][_0x2190aa[_0xe912('0x2c')]]['acwTimeout'];this['channels'][_0x2190aa[_0xe912('0x27')]][_0x4e67cd]['agentacw']=!![];}this['agents'][_0x2190aa[_0xe912('0x47')]]=_[_0xe912('0x31')](this['agents'][_0x2190aa['interface']],[_0xe912('0x2c'),_0xe912('0x49')]);logger['debug']('[%s][voiceAgentReport][agentcomplete]\x20sending\x20agentcomplete\x20event:',_0x2190aa['uniqueid'],util[_0xe912('0x28')](this[_0xe912('0xa')][_0x2190aa['uniqueid']][_0x4e67cd],{'showHidden':![],'depth':null}));ami[_0xe912('0x35')]('custom:agentcomplete',this['channels'][_0x2190aa['uniqueid']][_0x4e67cd]);logger[_0xe912('0x25')](_0xe912('0x68'),_0x2190aa['uniqueid'],util[_0xe912('0x28')](this[_0xe912('0xa')][_0x2190aa['uniqueid']][_0x4e67cd],{'showHidden':![],'depth':null}));this[_0xe912('0x35')](util[_0xe912('0x29')]('user:%s',_0x2190aa[_0xe912('0x38')]),_0xe912('0x69'),this[_0xe912('0xa')][_0x2190aa[_0xe912('0x27')]][_0x4e67cd]);}}}}}}catch(_0x3396c6){logger[_0xe912('0x3a')](_0xe912('0x6a'),_0x2190aa[_0xe912('0x27')],util[_0xe912('0x28')](_0x3396c6,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0xe912('0x17')]=function(_0x523494){try{if(this['isNotNull'](_0x523494)){logger[_0xe912('0x25')]('[%s][voiceAgentReport][varset]\x20event:',_0x523494[_0xe912('0x27')],util[_0xe912('0x28')](_0x523494,{'showHidden':![],'depth':null}));this[_0xe912('0x6b')](_0x523494[_0xe912('0x27')],_[_0xe912('0x6c')](_0x523494['variable'])[0x0],_0x523494[_0xe912('0x6d')]);if(this['channels'][_0x523494[_0xe912('0x27')]]){for(var _0x1e0c44 in this[_0xe912('0xa')][_0x523494[_0xe912('0x27')]]){if(this[_0xe912('0xa')][_0x523494[_0xe912('0x27')]][_0xe912('0x61')](_0x1e0c44)){logger[_0xe912('0x55')](_0xe912('0x6e'),_0x523494[_0xe912('0x27')],_0x1e0c44,_[_0xe912('0x6c')](_0x523494[_0xe912('0x6f')])[0x0],_0x523494[_0xe912('0x6d')]);if(_[_0xe912('0x22')](this[_0xe912('0xa')][_0x523494[_0xe912('0x27')]][_0x1e0c44][_0xe912('0x70')])){this[_0xe912('0xa')][_0x523494[_0xe912('0x27')]][_0x1e0c44][_0xe912('0x70')]={};}this[_0xe912('0xa')][_0x523494[_0xe912('0x27')]][_0x1e0c44][_0xe912('0x70')]=this[_0xe912('0x70')][_0x523494[_0xe912('0x27')]];}}}}}catch(_0x22b734){logger[_0xe912('0x3a')](_0xe912('0x71'),_0x523494['uniqueid'],util[_0xe912('0x28')](_0x22b734,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xe912('0x20')]['addVariable']=function(_0x4a5e84,_0x433759,_0x59648f){var _0x25d9b5=[_0xe912('0x72'),_0xe912('0x73'),_0xe912('0x74'),'rtpaudioqosjitterbridged','rtpaudioqosloss',_0xe912('0x75'),_0xe912('0x76'),_0xe912('0x77'),_0xe912('0x78'),_0xe912('0x79'),'bridgepeer',_0xe912('0x7a'),_0xe912('0x7b'),_0xe912('0x7c'),_0xe912('0x7d'),'memberlastcall','membername',_0xe912('0x7e'),'memberrealtime'];if(!_[_0xe912('0x7f')](_0x433759)&&!_[_0xe912('0x80')](_0x25d9b5,_0x433759)){if(_['isUndefined'](this[_0xe912('0x70')][_0x4a5e84])){this['variables'][_0x4a5e84]={};}this[_0xe912('0x70')][_0x4a5e84][_0x433759]=_0x59648f;}};VoiceAgentReport['prototype']['syncHangup']=function(_0xb0669b){try{if(this[_0xe912('0x21')](_0xb0669b)){logger['debug'](_0xe912('0x81'),_0xb0669b[_0xe912('0x27')],util['inspect'](_0xb0669b,{'showHidden':![],'depth':null}));if(this[_0xe912('0xa')][_0xb0669b[_0xe912('0x27')]]){for(var _0x49d890 in this[_0xe912('0xa')][_0xb0669b[_0xe912('0x27')]]){if(this[_0xe912('0xa')][_0xb0669b[_0xe912('0x27')]]['hasOwnProperty'](_0x49d890)){if(this['channels'][_0xb0669b[_0xe912('0x27')]][_0x49d890][_0xe912('0x4f')]==_0xe912('0x65')&&this[_0xe912('0xa')][_0xb0669b['uniqueid']][_0x49d890][_0xe912('0x14')]){logger[_0xe912('0x55')](_0xe912('0x82'),_0xb0669b[_0xe912('0x27')],_0x49d890);this[_0xe912('0xa')][_0xb0669b[_0xe912('0x27')]][_0x49d890]['agentcompleteAt']=moment()[_0xe912('0x29')]('YYYY-MM-DD\x20HH:mm:ss');}}}logger[_0xe912('0x25')](_0xe912('0x83'),_0xb0669b[_0xe912('0x27')],util[_0xe912('0x28')](_[_0xe912('0x84')](this[_0xe912('0xa')][_0xb0669b[_0xe912('0x27')]]),{'showHidden':![],'depth':null}));ami[_0xe912('0x35')](_0xe912('0x85'),_[_0xe912('0x84')](this[_0xe912('0xa')][_0xb0669b[_0xe912('0x27')]]));delete this['channels'][_0xb0669b['uniqueid']];}if(this[_0xe912('0x70')][_0xb0669b[_0xe912('0x27')]]){delete this[_0xe912('0x70')][_0xb0669b[_0xe912('0x27')]];}}}catch(_0x483144){logger[_0xe912('0x3a')](_0xe912('0x86'),_0xb0669b[_0xe912('0x27')],util[_0xe912('0x28')](_0x483144,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xe912('0x20')]['syncAttendedTransfer']=function(_0x1d677e){try{if(this[_0xe912('0x21')](_0x1d677e)){logger['debug'](_0xe912('0x87'),_0x1d677e[_0xe912('0x27')],util[_0xe912('0x28')](_0x1d677e,{'showHidden':![],'depth':null}));if(this[_0xe912('0xa')][_0x1d677e['transfereeuniqueid']]){for(var _0x5604c6 in this[_0xe912('0xa')][_0x1d677e[_0xe912('0x88')]]){if(this[_0xe912('0xa')][_0x1d677e['transfereeuniqueid']]['hasOwnProperty'](_0x5604c6)){if(_0x1d677e[_0xe912('0x89')]===_0x5604c6){logger['info'](_0xe912('0x8a'),_0x1d677e[_0xe912('0x27')],this[_0xe912('0xa')][_0x1d677e[_0xe912('0x88')]][_0x5604c6]['membername'],_0x5604c6);var _0x588d77=moment();this['channels'][_0x1d677e['transfereeuniqueid']][_0x5604c6][_0xe912('0x14')]=!![];this[_0xe912('0xa')][_0x1d677e[_0xe912('0x88')]][_0x5604c6]['agentcompleteAt']=moment()[_0xe912('0x29')]('YYYY-MM-DD\x20HH:mm:ss');this['channels'][_0x1d677e[_0xe912('0x88')]][_0x5604c6][_0xe912('0x44')]='complete';this[_0xe912('0xa')][_0x1d677e[_0xe912('0x88')]][_0x5604c6][_0xe912('0x4f')]=_0xe912('0x65');this[_0xe912('0xa')][_0x1d677e[_0xe912('0x88')]][_0x5604c6][_0xe912('0x67')]=_0x588d77['diff'](this[_0xe912('0xa')][_0x1d677e['transfereeuniqueid']][_0x5604c6][_0xe912('0x3e')],_0xe912('0x8b'));}}}}if(this[_0xe912('0xa')][_0x1d677e['secondtransfereruniqueid']]){var _0x5ee23e=this['channels'][_0x1d677e['secondtransfereruniqueid']];this[_0xe912('0xa')][_0x1d677e[_0xe912('0x8c')]]=this['channels'][_0x1d677e[_0xe912('0x88')]];this['channels'][_0x1d677e['transfereeuniqueid']]=_0x5ee23e;}}}catch(_0x46f136){logger['error'](_0xe912('0x8d'),_0x1d677e[_0xe912('0x27')],util[_0xe912('0x28')](_0x46f136,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xe912('0x20')][_0xe912('0x1f')]=function(_0x1b9c73){try{if(this[_0xe912('0x21')](_0x1b9c73)){logger[_0xe912('0x25')]('[%s][voiceAgentReport][blindtransfer]\x20event:',_0x1b9c73[_0xe912('0x27')],util[_0xe912('0x28')](_0x1b9c73,{'showHidden':![],'depth':null}));if(this[_0xe912('0xa')][_0x1b9c73['transfereeuniqueid']]){for(var _0x4f9b6a in this['channels'][_0x1b9c73['transfereeuniqueid']]){if(this[_0xe912('0xa')][_0x1b9c73[_0xe912('0x88')]][_0xe912('0x61')](_0x4f9b6a)){if(_0x1b9c73[_0xe912('0x8e')]===_0x4f9b6a){logger[_0xe912('0x55')]('[%s][voiceAgentReport][blindtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete',_0x1b9c73[_0xe912('0x27')],this['channels'][_0x1b9c73['transfereeuniqueid']][_0x4f9b6a][_0xe912('0x38')],_0x4f9b6a);var _0xb85f7c=moment();this[_0xe912('0xa')][_0x1b9c73[_0xe912('0x88')]][_0x4f9b6a][_0xe912('0x14')]=!![];this[_0xe912('0xa')][_0x1b9c73[_0xe912('0x88')]][_0x4f9b6a][_0xe912('0x63')]=_0xb85f7c;this[_0xe912('0xa')][_0x1b9c73['transfereeuniqueid']][_0x4f9b6a][_0xe912('0x44')]=_0xe912('0x64');this['channels'][_0x1b9c73[_0xe912('0x88')]][_0x4f9b6a][_0xe912('0x4f')]='transfer';this[_0xe912('0xa')][_0x1b9c73[_0xe912('0x88')]][_0x4f9b6a][_0xe912('0x67')]=_0xb85f7c[_0xe912('0x8f')](this[_0xe912('0xa')][_0x1b9c73['transfereeuniqueid']][_0x4f9b6a]['agentconnectAt'],_0xe912('0x8b'));}}}}}}catch(_0x51b68f){logger[_0xe912('0x3a')](_0xe912('0x90'),_0x1b9c73[_0xe912('0x27')],util[_0xe912('0x28')](_0x51b68f,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xe912('0x20')]['syncMusicOnHoldStart']=function(_0x3af836){var _0x4d272f='';try{if(this[_0xe912('0x21')](_0x3af836)){logger[_0xe912('0x25')]('[%s][voiceAgentReport][musiconholdstart]\x20event:',_0x3af836[_0xe912('0x27')],util[_0xe912('0x28')](_0x3af836,{'showHidden':![],'depth':null}));if(_0x3af836[_0xe912('0x91')]){_0x4d272f=_0x3af836['channel'][_0xe912('0x92')](0x0,_0x3af836[_0xe912('0x91')]['lastIndexOf']('-'));if(this[_0xe912('0xd')][_0x4d272f]){logger[_0xe912('0x55')](_0xe912('0x93'),_0x3af836[_0xe912('0x27')],_0x4d272f);this[_0xe912('0xd')][_0x4d272f][_0xe912('0x94')]=!![];}}}}catch(_0x416657){logger[_0xe912('0x3a')](_0xe912('0x95'),_0x3af836[_0xe912('0x27')],util['inspect'](_0x416657,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0xe912('0x1c')]=function(_0x22c638){var _0x1fbecb='';try{if(this['isNotNull'](_0x22c638)){logger[_0xe912('0x25')](_0xe912('0x96'),_0x22c638['uniqueid'],util[_0xe912('0x28')](_0x22c638,{'showHidden':![],'depth':null}));if(_0x22c638[_0xe912('0x91')]){_0x1fbecb=_0x22c638['channel']['substring'](0x0,_0x22c638[_0xe912('0x91')][_0xe912('0x97')]('-'));if(this[_0xe912('0xd')][_0x1fbecb]){logger[_0xe912('0x55')](_0xe912('0x98'),_0x22c638['uniqueid'],_0x1fbecb);this[_0xe912('0xd')][_0x1fbecb][_0xe912('0x94')]=![];}}}}catch(_0x41c12){logger[_0xe912('0x3a')](_0xe912('0x99'),_0x22c638[_0xe912('0x27')],util[_0xe912('0x28')](_0x41c12,{'showHidden':![],'depth':null}));}};module[_0xe912('0x9a')]=VoiceAgentReport; \ No newline at end of file diff --git a/server/services/ami/report/voiceCallReport.js b/server/services/ami/report/voiceCallReport.js index c62b3fa..7369d3b 100644 --- a/server/services/ami/report/voiceCallReport.js +++ b/server/services/ami/report/voiceCallReport.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0a17=['disposition','toNumber','channelstate','merge','pick','keys','accountcode','[%s][voiceCallReport][newchannel]','application','toLowerCase','applicationdata','appdata','CDR(routeAlias)','[%s][voiceCallReport][newexten]\x20application:%s\x20appdata:%s','duration','subtract','seconds','includes','lastdata','startsWith','cdr(','match','queue','[%s][voiceCallReport][newexten]','syncNewState','[%s][voiceCallReport][newstate]\x20linkedid:%s\x20calleridname:%s\x20calleridnum:%s','[%s][voiceCallReport][newstate]\x20event:','answered','answertime','diff','connectedlinename','membername','name','UserId','routealias','[%s][voiceCallReport][newstate]\x20sending\x20user:agentconnect\x20event:','syncMixMonitorFilename','[%s][voiceCallReport][mixMonitorFilename]\x20monitorFilename:%s','monitor','endsWith','.wav49','.WAV','find','monitors','isNil','push','rec','[%s][voiceCallReport][varset]\x20event:','variable','mixmonitor_filename','[%s][voiceCallReport][varset]\x20variable:mixmonitor_filename\x20value:%s','value','[%s][voiceCallReport][varset]\x20variable:xmd-phone\x20value:%s','xmd-callerid','[%s][voiceCallReport][varset]\x20variable:xmd-callerid\x20value:%s','xmd-cdrtype','[%s][voiceCallReport][varset]\x20variable:xmd-cdrtype\x20value:%s','type','xmd-originatecalleridnum','[%s][voiceCallReport][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','xmd-destination','[%s][voiceCallReport][varset]\x20variable:xmd-destination\x20value:%s','destination','xmd-callerid-preview','[%s][voiceCallReport][varset]\x20variable:xmd-callerid-preview\x20value:%s','calleridpreview','xmcs-queue','[%s][voiceCallReport][varset]\x20variable:xmcs-queue\x20value:%s','sipcallid','[%s][voiceCallReport][varset]\x20variable:sipcallid\x20value:%s','parse','sipcalllinkedid','[%s][voiceCallReport][varset]','[%s][voiceCallReport][hangup]\x20event:','cause-txt','endtime','billableseconds','holdtime','omit','transferType','isEmpty','then','resolve','StopMixMonitor','catch','Action','destinationchannel','finally','webbar:stopmonitors','event','outbound','[%s][voiceCallReport][hangup]\x20sending\x20hangup\x20event:','custom:voiceCallReport','[%s][voiceCallReport][hangup]','origtransferercalleridnum','transfertargetcalleridnum','[%s][voiceCallReport][attendedtransfer]\x20event:','transfereeuniqueid','transfercalleridnum','secondtransfereruniqueid','transfertargetuniqueid','transferconnectedlinenum','origtransfereruniqueid','origtransfererlinkedid','ATTENDED','[%s][voiceCallReport][attendedtransfer]','[%s][voiceCallReport][blindtransfer]\x20transfercalleridnum:%s\x20transferconnectedlinenum:%s','extension','transfereecalleridnum','BlindTransfer','transfererchannel','transfereruniqueid','BLIND','mohstarttime','[%s][voiceCallReport][musiconholdstart]\x20mohstarttime:%s','[%s][voiceCallReport][musiconholdstart]','[%s][voiceCallReport][musiconholdstop]\x20event:','mohtime','milliseconds','[%s][voiceCallReport][musiconholdstop]\x20mohtime:%s','[%s][voiceCallReport][musiconholdstop]','exports','bluebird','lodash','moment','util','path','ioredis','../../../config/environment','../../../config/logger','ami','../ami','../model/channel','../rpc/setting','unknown','not_inuse','inuse','invalid','unavailable','ringing','ringinuse','onhold','set','agi','dial','playback','voicemail','FAILED','NO\x20ANSWER','BUSY','redis','agents','blindTransfers','coreshowchannel','syncNewExten','bind','newexten','syncNewChannel','newstate','varset','hangup','syncHangup','newcallerid','syncNewCallerId','attendedtransfer','syncAttendedTransfer','syncBlindTransfer','musiconholdstart','syncMusicOnHoldStart','musiconholdstop','syncMusicOnHoldStop','[voiceCallReport][coreshowchannels]\x20started','actionCoreShowChannels','error','inspect','prototype','isNotNull','emit','uniqueid','calleridname','calleridnum','debug','linkedid','channels','context','from-sip','split','exten','xcally-motion-preview','destconnectedlinenum','connectedlinenum','format','user:%s','channel','user:agentconnect','[%s][voiceCallReport][newchannel]\x20event:','OutgoingSpoolFailed','isUndefined','info','[%s][voiceCallReport][newchannel]\x20context:%s\x20exten:%s','starttime','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x4d0662,_0x145963){var _0x6eea6d=function(_0x2def06){while(--_0x2def06){_0x4d0662['push'](_0x4d0662['shift']());}};_0x6eea6d(++_0x145963);}(_0x0a17,0x7a));var _0x70a1=function(_0x427512,_0x57c0fd){_0x427512=_0x427512-0x0;var _0x3ab8d5=_0x0a17[_0x427512];return _0x3ab8d5;};'use strict';var BPromise=require(_0x70a1('0x0'));var _=require(_0x70a1('0x1'));var moment=require(_0x70a1('0x2'));var util=require(_0x70a1('0x3'));var path=require(_0x70a1('0x4'));var Redis=require(_0x70a1('0x5'));var config=require(_0x70a1('0x6'));var logger=require(_0x70a1('0x7'))(_0x70a1('0x8'));var ami=require(_0x70a1('0x9'));var Channel=require(_0x70a1('0xa'));var RpcSetting=require(_0x70a1('0xb'));var statusDesc=[_0x70a1('0xc'),_0x70a1('0xd'),_0x70a1('0xe'),'busy',_0x70a1('0xf'),_0x70a1('0x10'),_0x70a1('0x11'),_0x70a1('0x12'),_0x70a1('0x13')];var applications=[_0x70a1('0x14'),'queue',_0x70a1('0x15'),_0x70a1('0x16'),_0x70a1('0x17'),_0x70a1('0x18')];var dispositions=['NO\x20ANSWER',_0x70a1('0x19'),_0x70a1('0x19'),_0x70a1('0x1a'),'NO\x20ANSWER',_0x70a1('0x1a'),'ANSWERED',_0x70a1('0x1b'),'FAILED',_0x70a1('0x19'),_0x70a1('0x19')];var actions={};config[_0x70a1('0x1c')]=_['defaults'](config[_0x70a1('0x1c')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function VoiceCallReport(_0x3b1565){this['channels']=_0x3b1565['channels'];this[_0x70a1('0x1d')]=_0x3b1565[_0x70a1('0x1d')];this[_0x70a1('0x1e')]={};ami['on'](_0x70a1('0x1f'),this[_0x70a1('0x20')][_0x70a1('0x21')](this));ami['on'](_0x70a1('0x22'),this['syncNewExten'][_0x70a1('0x21')](this));ami['on']('newchannel',this[_0x70a1('0x23')][_0x70a1('0x21')](this));ami['on'](_0x70a1('0x24'),this['syncNewState'][_0x70a1('0x21')](this));ami['on'](_0x70a1('0x25'),this['syncVarSet'][_0x70a1('0x21')](this));ami['on'](_0x70a1('0x26'),this[_0x70a1('0x27')][_0x70a1('0x21')](this));ami['on'](_0x70a1('0x28'),this[_0x70a1('0x29')][_0x70a1('0x21')](this));ami['on'](_0x70a1('0x2a'),this[_0x70a1('0x2b')][_0x70a1('0x21')](this));ami['on']('blindtransfer',this[_0x70a1('0x2c')][_0x70a1('0x21')](this));ami['on'](_0x70a1('0x2d'),this[_0x70a1('0x2e')][_0x70a1('0x21')](this));ami['on'](_0x70a1('0x2f'),this[_0x70a1('0x30')]['bind'](this));try{logger['info'](_0x70a1('0x31'));ami[_0x70a1('0x32')]();}catch(_0x2d425c){logger[_0x70a1('0x33')]('[voiceCallReport][coreshowchannels]',util[_0x70a1('0x34')](_0x2d425c,{'showHidden':![],'depth':null}));}}VoiceCallReport[_0x70a1('0x35')][_0x70a1('0x36')]=function(_0x2793d7){return _0x2793d7!==null&&!_['isUndefined'](_0x2793d7);};VoiceCallReport[_0x70a1('0x35')][_0x70a1('0x37')]=function(_0x565b36,_0x1fc8b9,_0x5af16c){io['to'](_0x565b36)[_0x70a1('0x37')](_0x1fc8b9,_0x5af16c);};VoiceCallReport['prototype']['syncNewCallerId']=function(_0x216b34){try{if(this['isNotNull'](_0x216b34)){logger['info']('[%s][voiceCallReport][newcallerid]\x20calleridname:%s\x20calleridnum:%s',_0x216b34[_0x70a1('0x38')],_0x216b34[_0x70a1('0x39')],_0x216b34[_0x70a1('0x3a')]);logger[_0x70a1('0x3b')]('[%s][voiceCallReport][newcallerid]\x20event:',_0x216b34[_0x70a1('0x38')],util[_0x70a1('0x34')](_0x216b34,{'showHidden':![],'depth':null}));if(_0x216b34[_0x70a1('0x38')]===_0x216b34[_0x70a1('0x3c')]){if(!_['isUndefined'](this[_0x70a1('0x3d')][_0x216b34[_0x70a1('0x38')]])){_['merge'](this[_0x70a1('0x3d')][_0x216b34['uniqueid']],_['pick'](_0x216b34,_['keys'](this['channels'][_0x216b34[_0x70a1('0x38')]])));}}if(_0x216b34[_0x70a1('0x3e')]===_0x70a1('0x3f')){if(this['agents'][_0x216b34['channel'][_0x70a1('0x40')]('-')[0x0]]){if(_0x216b34[_0x70a1('0x41')]==_0x70a1('0x42')){this[_0x70a1('0x1d')][_0x216b34['channel']['split']('-')[0x0]][_0x70a1('0x43')]=_0x216b34[_0x70a1('0x44')];this[_0x70a1('0x37')](util[_0x70a1('0x45')](_0x70a1('0x46'),this[_0x70a1('0x1d')][_0x216b34[_0x70a1('0x47')][_0x70a1('0x40')]('-')[0x0]]['name']),_0x70a1('0x48'),{'destaccountcode':this[_0x70a1('0x1d')][_0x216b34['channel']['split']('-')[0x0]]['accountcode'],'destconnectedlinenum':_0x216b34[_0x70a1('0x44')]});}}}}}catch(_0x470c2d){logger[_0x70a1('0x33')]('[%s][voiceCallReport][newcallerid]',_0x216b34['uniqueid'],util[_0x70a1('0x34')](_0x470c2d,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x70a1('0x35')][_0x70a1('0x23')]=function(_0x275c0c){try{if(this[_0x70a1('0x36')](_0x275c0c)){logger[_0x70a1('0x3b')](_0x70a1('0x49'),_0x275c0c[_0x70a1('0x38')],util[_0x70a1('0x34')](_0x275c0c,{'showHidden':![],'depth':null}));if(_0x275c0c['uniqueid']===_0x275c0c['linkedid']&&_0x275c0c['channel']!=_0x70a1('0x4a')){if(_[_0x70a1('0x4b')](this['channels'][_0x275c0c[_0x70a1('0x38')]])){logger[_0x70a1('0x4c')](_0x70a1('0x4d'),_0x275c0c['uniqueid'],_0x275c0c['context'],_0x275c0c[_0x70a1('0x41')]);this['channels'][_0x275c0c[_0x70a1('0x38')]]=new Channel();this[_0x70a1('0x3d')][_0x275c0c[_0x70a1('0x38')]][_0x70a1('0x4e')]=moment()['format'](_0x70a1('0x4f'));this[_0x70a1('0x3d')][_0x275c0c[_0x70a1('0x38')]][_0x70a1('0x50')]=dispositions[_[_0x70a1('0x51')](_0x275c0c[_0x70a1('0x52')])];_[_0x70a1('0x53')](this[_0x70a1('0x3d')][_0x275c0c[_0x70a1('0x38')]],_[_0x70a1('0x54')](_0x275c0c,_[_0x70a1('0x55')](this['channels'][_0x275c0c[_0x70a1('0x38')]])));if(_0x275c0c['context']==='from-sip'){if(this['agents'][_0x275c0c[_0x70a1('0x47')]['split']('-')[0x0]]){if(_[_0x70a1('0x4b')](this[_0x70a1('0x1d')][_0x275c0c[_0x70a1('0x47')][_0x70a1('0x40')]('-')[0x0]][_0x70a1('0x43')])){this[_0x70a1('0x1d')][_0x275c0c[_0x70a1('0x47')]['split']('-')[0x0]][_0x70a1('0x43')]=_0x275c0c['exten'];logger[_0x70a1('0x3b')]('[%s][voiceCallReport][newchannel]\x20sending\x20user:agentconnect\x20event:',_0x275c0c[_0x70a1('0x38')],util['inspect']({'destaccountcode':this[_0x70a1('0x1d')][_0x275c0c[_0x70a1('0x47')][_0x70a1('0x40')]('-')[0x0]][_0x70a1('0x56')],'destconnectedlinenum':_0x275c0c[_0x70a1('0x41')]},{'showHidden':![],'depth':null}));this['emit'](util[_0x70a1('0x45')](_0x70a1('0x46'),this['agents'][_0x275c0c[_0x70a1('0x47')][_0x70a1('0x40')]('-')[0x0]]['name']),_0x70a1('0x48'),{'destaccountcode':this['agents'][_0x275c0c[_0x70a1('0x47')]['split']('-')[0x0]]['accountcode'],'destconnectedlinenum':_0x275c0c[_0x70a1('0x41')]});}}}}}}}catch(_0x365440){logger[_0x70a1('0x33')](_0x70a1('0x57'),_0x275c0c[_0x70a1('0x38')],util['inspect'](_0x365440,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0x70a1('0x20')]=function(_0x3ff57e){try{if(this[_0x70a1('0x36')](_0x3ff57e)){logger['debug']('[%s][voiceCallReport][newexten]\x20event:',_0x3ff57e[_0x70a1('0x38')],util['inspect'](_0x3ff57e,{'showHidden':![],'depth':null}));if(_0x3ff57e[_0x70a1('0x38')]===_0x3ff57e['linkedid']&&_0x3ff57e[_0x70a1('0x41')]!='h'&&_0x3ff57e[_0x70a1('0x47')]!=_0x70a1('0x4a')){_0x3ff57e[_0x70a1('0x58')]=_0x3ff57e['application'][_0x70a1('0x59')]();_0x3ff57e[_0x70a1('0x5a')]=_0x3ff57e[_0x70a1('0x5b')]&&_0x3ff57e[_0x70a1('0x5b')]['startsWith'](_0x70a1('0x5c'))?_0x3ff57e['appdata']:(_0x3ff57e[_0x70a1('0x5b')]||_0x3ff57e[_0x70a1('0x5a')])[_0x70a1('0x59')]();logger['info'](_0x70a1('0x5d'),_0x3ff57e[_0x70a1('0x38')],_0x3ff57e['application'],_0x3ff57e[_0x70a1('0x5a')]);if(_['isUndefined'](this[_0x70a1('0x3d')][_0x3ff57e[_0x70a1('0x38')]])){this[_0x70a1('0x3d')][_0x3ff57e['uniqueid']]=new Channel();this[_0x70a1('0x3d')][_0x3ff57e['uniqueid']][_0x70a1('0x4e')]=_0x3ff57e[_0x70a1('0x5e')]?moment()[_0x70a1('0x5f')](moment['duration'](_0x3ff57e[_0x70a1('0x5e')])['seconds'](),_0x70a1('0x60'))[_0x70a1('0x45')]('YYYY-MM-DD\x20HH:mm:ss'):moment()[_0x70a1('0x45')](_0x70a1('0x4f'));this[_0x70a1('0x3d')][_0x3ff57e['uniqueid']][_0x70a1('0x50')]=_0x70a1('0x1a');}_[_0x70a1('0x53')](this[_0x70a1('0x3d')][_0x3ff57e[_0x70a1('0x38')]],_[_0x70a1('0x54')](_0x3ff57e,_['keys'](this['channels'][_0x3ff57e[_0x70a1('0x38')]])));if(_[_0x70a1('0x61')](applications,_0x3ff57e['application'])){this['channels'][_0x3ff57e[_0x70a1('0x38')]]['lastapplication']=_0x3ff57e['application'];this['channels'][_0x3ff57e['uniqueid']][_0x70a1('0x62')]=_0x3ff57e[_0x70a1('0x5a')];if(_0x3ff57e[_0x70a1('0x58')]===_0x70a1('0x14')&&_[_0x70a1('0x63')](_0x3ff57e[_0x70a1('0x5a')]['toLowerCase'](),_0x70a1('0x64'))){var _0x18500e=_0x3ff57e[_0x70a1('0x5a')]['split']('=');var _0x538d4d=_0x18500e[0x0][_0x70a1('0x59')]()[_0x70a1('0x65')](/cdr\((.*)\)/);if(_0x538d4d){this[_0x70a1('0x3d')][_0x3ff57e['uniqueid']][_0x538d4d[0x1]]=_0x18500e[0x1];}}else if(_0x3ff57e[_0x70a1('0x58')]===_0x70a1('0x66')){this[_0x70a1('0x3d')][_0x3ff57e[_0x70a1('0x38')]][_0x70a1('0x66')]=_0x3ff57e[_0x70a1('0x5a')][_0x70a1('0x40')](',')[0x0];}}}}}catch(_0x1d5ee3){logger[_0x70a1('0x33')](_0x70a1('0x67'),_0x3ff57e['uniqueid'],util[_0x70a1('0x34')](_0x1d5ee3,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x70a1('0x35')][_0x70a1('0x68')]=function(_0x56805b){try{if(this[_0x70a1('0x36')](_0x56805b)){logger[_0x70a1('0x4c')](_0x70a1('0x69'),_0x56805b[_0x70a1('0x38')],_0x56805b['linkedid'],_0x56805b[_0x70a1('0x39')],_0x56805b[_0x70a1('0x3a')]);logger[_0x70a1('0x3b')](_0x70a1('0x6a'),_0x56805b[_0x70a1('0x38')],util['inspect'](_0x56805b,{'showHidden':![],'depth':null}));if(_0x56805b['uniqueid']!==_0x56805b['linkedid']){if(this[_0x70a1('0x3d')][_0x56805b['linkedid']]){if(_0x56805b[_0x70a1('0x52')]==='6'){if(!this[_0x70a1('0x3d')][_0x56805b[_0x70a1('0x3c')]][_0x70a1('0x6b')]){var _0x237c86=moment();this[_0x70a1('0x3d')][_0x56805b[_0x70a1('0x3c')]][_0x70a1('0x6b')]=!![];this['channels'][_0x56805b[_0x70a1('0x3c')]][_0x70a1('0x6c')]=_0x237c86[_0x70a1('0x45')](_0x70a1('0x4f'));if(this[_0x70a1('0x3d')][_0x56805b['linkedid']][_0x70a1('0x4e')]){this[_0x70a1('0x3d')][_0x56805b['linkedid']]['holdtime']=_0x237c86[_0x70a1('0x6d')](this[_0x70a1('0x3d')][_0x56805b[_0x70a1('0x3c')]][_0x70a1('0x4e')],_0x70a1('0x60'));}}this[_0x70a1('0x3d')][_0x56805b[_0x70a1('0x3c')]][_0x70a1('0x3c')]=_0x56805b[_0x70a1('0x38')];if(_0x56805b[_0x70a1('0x3a')]!==_0x70a1('0x42')){this[_0x70a1('0x3d')][_0x56805b[_0x70a1('0x3c')]][_0x70a1('0x44')]=_0x56805b[_0x70a1('0x3a')];}this[_0x70a1('0x3d')][_0x56805b[_0x70a1('0x3c')]][_0x70a1('0x6e')]=_0x56805b[_0x70a1('0x39')];this['channels'][_0x56805b[_0x70a1('0x3c')]]['destinationchannel']=_0x56805b[_0x70a1('0x47')];this[_0x70a1('0x3d')][_0x56805b['linkedid']][_0x70a1('0x50')]=dispositions[_['toNumber'](_0x56805b['channelstate'])];if(this[_0x70a1('0x1d')][_0x56805b[_0x70a1('0x47')][_0x70a1('0x40')]('-')[0x0]]){this['channels'][_0x56805b[_0x70a1('0x3c')]]['UserId']=this[_0x70a1('0x1d')][_0x56805b['channel'][_0x70a1('0x40')]('-')[0x0]]['id'];this[_0x70a1('0x3d')][_0x56805b[_0x70a1('0x3c')]][_0x70a1('0x6f')]=this['agents'][_0x56805b[_0x70a1('0x47')][_0x70a1('0x40')]('-')[0x0]][_0x70a1('0x70')];}}}}else{if(this[_0x70a1('0x3d')][_0x56805b['uniqueid']]){if(_0x56805b['channelstate']==='6'){if(this['agents'][_0x56805b[_0x70a1('0x47')]['split']('-')[0x0]]){this['channels'][_0x56805b[_0x70a1('0x38')]][_0x70a1('0x71')]=this[_0x70a1('0x1d')][_0x56805b[_0x70a1('0x47')][_0x70a1('0x40')]('-')[0x0]]['id'];this[_0x70a1('0x3d')][_0x56805b[_0x70a1('0x38')]][_0x70a1('0x6f')]=this['agents'][_0x56805b[_0x70a1('0x47')][_0x70a1('0x40')]('-')[0x0]][_0x70a1('0x70')];}}}}if(_0x56805b[_0x70a1('0x52')]==='6'&&_0x56805b[_0x70a1('0x3e')]===_0x70a1('0x3f')){if(this[_0x70a1('0x1d')][_0x56805b[_0x70a1('0x47')][_0x70a1('0x40')]('-')[0x0]]){this['agents'][_0x56805b[_0x70a1('0x47')][_0x70a1('0x40')]('-')[0x0]][_0x70a1('0x43')]=_0x56805b[_0x70a1('0x41')];var _0x170f0e;if(this[_0x70a1('0x3d')][_0x56805b[_0x70a1('0x38')]])_0x170f0e=this['channels'][_0x56805b[_0x70a1('0x38')]]['routealias'];else if(this[_0x70a1('0x3d')][_0x56805b[_0x70a1('0x3c')]])_0x170f0e=this['channels'][_0x56805b[_0x70a1('0x3c')]][_0x70a1('0x72')];logger[_0x70a1('0x3b')](_0x70a1('0x73'),_0x56805b[_0x70a1('0x38')],util[_0x70a1('0x34')]({'destaccountcode':this[_0x70a1('0x1d')][_0x56805b[_0x70a1('0x47')]['split']('-')[0x0]][_0x70a1('0x56')],'destconnectedlinenum':_0x56805b['exten'],'routealias':_0x170f0e},{'showHidden':![],'depth':null}));this[_0x70a1('0x37')](util[_0x70a1('0x45')](_0x70a1('0x46'),this[_0x70a1('0x1d')][_0x56805b[_0x70a1('0x47')][_0x70a1('0x40')]('-')[0x0]][_0x70a1('0x70')]),_0x70a1('0x48'),{'destaccountcode':this[_0x70a1('0x1d')][_0x56805b[_0x70a1('0x47')][_0x70a1('0x40')]('-')[0x0]][_0x70a1('0x56')],'destconnectedlinenum':_0x56805b[_0x70a1('0x41')],'routealias':_0x170f0e});}}}}catch(_0x5c39bb){logger['error']('[%s][voiceCallReport][newstate]',_0x56805b[_0x70a1('0x38')],util[_0x70a1('0x34')](_0x5c39bb,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x70a1('0x35')][_0x70a1('0x74')]=function(_0x367685,_0x352622){try{if(this[_0x70a1('0x3d')][_0x367685]){logger[_0x70a1('0x4c')](_0x70a1('0x75'),_0x367685,_0x352622);this['channels'][_0x367685][_0x70a1('0x76')]=!![];if(_[_0x70a1('0x77')](_0x352622,'.wav49')){_0x352622=_0x352622['replace'](_0x70a1('0x78'),_0x70a1('0x79'));}this['channels'][_0x367685]['monitorFilename']=_0x352622;var _0x288e33=_[_0x70a1('0x7a')](this[_0x70a1('0x3d')][_0x367685][_0x70a1('0x7b')],{'filename':_0x352622});if(_[_0x70a1('0x7c')](_0x288e33)){this[_0x70a1('0x3d')][_0x367685][_0x70a1('0x7b')][_0x70a1('0x7d')]({'filename':_0x352622,'createdAt':moment()['format'](_0x70a1('0x4f')),'mixmonitorid':'','status':_0x70a1('0x7e')});}}}catch(_0x225853){logger[_0x70a1('0x33')]('[%s][voiceCallReport][mixMonitorFilename]',_0x367685,util['inspect'](_0x225853,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x70a1('0x35')]['syncVarSet']=function(_0x4e4ba5){try{if(this[_0x70a1('0x36')](_0x4e4ba5)){logger[_0x70a1('0x3b')](_0x70a1('0x7f'),_0x4e4ba5[_0x70a1('0x38')],util['inspect'](_0x4e4ba5,{'showHidden':![],'depth':null}));if(this[_0x70a1('0x3d')][_0x4e4ba5[_0x70a1('0x38')]]&&_0x4e4ba5[_0x70a1('0x47')]!=_0x70a1('0x4a')){if(this['isNotNull'](_0x4e4ba5[_0x70a1('0x80')])){if(this[_0x70a1('0x36')](_0x4e4ba5[_0x70a1('0x80')][_0x70a1('0x81')])){logger['info'](_0x70a1('0x82'),_0x4e4ba5[_0x70a1('0x38')],_0x4e4ba5['value']);this[_0x70a1('0x74')](_0x4e4ba5['uniqueid'],_0x4e4ba5[_0x70a1('0x83')]);}else if(this[_0x70a1('0x36')](_0x4e4ba5[_0x70a1('0x80')]['xmd-phone'])){logger['info'](_0x70a1('0x84'),_0x4e4ba5[_0x70a1('0x38')],_0x4e4ba5[_0x70a1('0x83')]);this[_0x70a1('0x3d')][_0x4e4ba5[_0x70a1('0x38')]]['calleridnum']=_0x4e4ba5[_0x70a1('0x83')];}else if(this['isNotNull'](_0x4e4ba5['variable'][_0x70a1('0x85')])){logger[_0x70a1('0x4c')](_0x70a1('0x86'),_0x4e4ba5[_0x70a1('0x38')],_0x4e4ba5['value']);this[_0x70a1('0x3d')][_0x4e4ba5['uniqueid']]['callerid']=_0x4e4ba5[_0x70a1('0x83')];}else if(this[_0x70a1('0x36')](_0x4e4ba5[_0x70a1('0x80')][_0x70a1('0x87')])){logger['info'](_0x70a1('0x88'),_0x4e4ba5[_0x70a1('0x38')],_0x4e4ba5[_0x70a1('0x83')]);this[_0x70a1('0x3d')][_0x4e4ba5[_0x70a1('0x38')]][_0x70a1('0x89')]=_0x4e4ba5[_0x70a1('0x83')];}else if(this[_0x70a1('0x36')](_0x4e4ba5[_0x70a1('0x80')]['xmd-queue'])){logger[_0x70a1('0x4c')]('[%s][voiceCallReport][varset]\x20variable:xmd-queue\x20value:%s',_0x4e4ba5[_0x70a1('0x38')],_0x4e4ba5['value']['split'](',')[0x0]);this[_0x70a1('0x3d')][_0x4e4ba5[_0x70a1('0x38')]][_0x70a1('0x66')]=_0x4e4ba5[_0x70a1('0x83')]['split'](',')[0x0];}else if(this[_0x70a1('0x36')](_0x4e4ba5[_0x70a1('0x80')][_0x70a1('0x8a')])){logger[_0x70a1('0x4c')](_0x70a1('0x8b'),_0x4e4ba5['uniqueid'],_0x4e4ba5['value']);this[_0x70a1('0x3d')][_0x4e4ba5[_0x70a1('0x38')]]['originatecalleridnum']=_0x4e4ba5[_0x70a1('0x83')];}else if(this['isNotNull'](_0x4e4ba5[_0x70a1('0x80')][_0x70a1('0x8c')])){logger['info'](_0x70a1('0x8d'),_0x4e4ba5[_0x70a1('0x38')],_0x4e4ba5[_0x70a1('0x83')]);this[_0x70a1('0x3d')][_0x4e4ba5['uniqueid']][_0x70a1('0x8e')]=_0x4e4ba5[_0x70a1('0x83')];}else if(this[_0x70a1('0x36')](_0x4e4ba5[_0x70a1('0x80')][_0x70a1('0x8f')])){logger[_0x70a1('0x4c')](_0x70a1('0x90'),_0x4e4ba5[_0x70a1('0x38')],_0x4e4ba5[_0x70a1('0x83')]);this[_0x70a1('0x3d')][_0x4e4ba5[_0x70a1('0x38')]][_0x70a1('0x91')]=_0x4e4ba5['value'];}else if(this[_0x70a1('0x36')](_0x4e4ba5[_0x70a1('0x80')][_0x70a1('0x92')])){logger[_0x70a1('0x4c')](_0x70a1('0x93'),_0x4e4ba5['uniqueid'],_0x4e4ba5[_0x70a1('0x83')]);this[_0x70a1('0x3d')][_0x4e4ba5[_0x70a1('0x38')]][_0x70a1('0x66')]=_0x4e4ba5[_0x70a1('0x83')];}else if(this[_0x70a1('0x36')](_0x4e4ba5[_0x70a1('0x80')][_0x70a1('0x94')])){logger[_0x70a1('0x4c')](_0x70a1('0x95'),_0x4e4ba5[_0x70a1('0x38')],_0x4e4ba5[_0x70a1('0x83')]);this[_0x70a1('0x3d')][_0x4e4ba5[_0x70a1('0x38')]]['sipcalluniqueid']=_0x4e4ba5[_0x70a1('0x83')];}}}else if(this[_0x70a1('0x36')](_0x4e4ba5[_0x70a1('0x80')][_0x70a1('0x81')])){if(_0x4e4ba5[_0x70a1('0x83')]){var _0x510197=path[_0x70a1('0x96')](_0x4e4ba5[_0x70a1('0x83')])[_0x70a1('0x70')];logger['info'](_0x70a1('0x82'),_0x510197,_0x4e4ba5[_0x70a1('0x83')]);this[_0x70a1('0x74')](_0x510197,_0x4e4ba5['value']);}}else if(this[_0x70a1('0x3d')][_0x4e4ba5['linkedid']]){if(this['isNotNull'](_0x4e4ba5['variable'])){if(this[_0x70a1('0x36')](_0x4e4ba5[_0x70a1('0x80')]['sipcallid'])){logger[_0x70a1('0x4c')]('[%s][voiceCallReport][varset]\x20variable:sipcallid\x20value:%s',_0x4e4ba5[_0x70a1('0x3c')],_0x4e4ba5['value']);this['channels'][_0x4e4ba5[_0x70a1('0x3c')]][_0x70a1('0x97')]=_0x4e4ba5[_0x70a1('0x83')];}}}}}catch(_0x5b26fb){logger['error'](_0x70a1('0x98'),_0x4e4ba5[_0x70a1('0x38')],util['inspect'](_0x5b26fb,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x70a1('0x35')][_0x70a1('0x27')]=function(_0x417b7c){try{if(this[_0x70a1('0x36')](_0x417b7c)){logger['debug'](_0x70a1('0x99'),_0x417b7c[_0x70a1('0x38')],util[_0x70a1('0x34')](_0x417b7c,{'showHidden':![],'depth':null}));if(this[_0x70a1('0x3d')][_0x417b7c[_0x70a1('0x38')]]){logger['info']('[%s][voiceCallReport][hangup]\x20reason:%s',_0x417b7c[_0x70a1('0x38')],_0x417b7c[_0x70a1('0x9a')]);var _0x3b6c1d=moment();this[_0x70a1('0x3d')][_0x417b7c[_0x70a1('0x38')]][_0x70a1('0x9b')]=_0x3b6c1d[_0x70a1('0x45')](_0x70a1('0x4f'));this[_0x70a1('0x3d')][_0x417b7c['uniqueid']][_0x70a1('0x5e')]=_0x3b6c1d[_0x70a1('0x6d')](this[_0x70a1('0x3d')][_0x417b7c['uniqueid']][_0x70a1('0x4e')],_0x70a1('0x60'));if(this[_0x70a1('0x3d')][_0x417b7c[_0x70a1('0x38')]][_0x70a1('0x6b')]){this[_0x70a1('0x3d')][_0x417b7c[_0x70a1('0x38')]][_0x70a1('0x9c')]=_0x3b6c1d[_0x70a1('0x6d')](this['channels'][_0x417b7c[_0x70a1('0x38')]]['answertime'],_0x70a1('0x60'));this[_0x70a1('0x3d')][_0x417b7c['uniqueid']][_0x70a1('0x9d')]=this[_0x70a1('0x3d')][_0x417b7c[_0x70a1('0x38')]][_0x70a1('0x5e')]-this[_0x70a1('0x3d')][_0x417b7c[_0x70a1('0x38')]][_0x70a1('0x9c')];}if(_0x417b7c[_0x70a1('0x3e')]===_0x70a1('0x3f')){if(this[_0x70a1('0x1d')][_0x417b7c['channel'][_0x70a1('0x40')]('-')[0x0]]){this[_0x70a1('0x1d')][_0x417b7c[_0x70a1('0x47')]['split']('-')[0x0]]=_[_0x70a1('0x9e')](this[_0x70a1('0x1d')][_0x417b7c['channel']['split']('-')[0x0]],['destconnectedlinenum']);logger[_0x70a1('0x3b')]('[%s][voiceCallReport][hangup]\x20sending\x20user:agentcomplete\x20event:',_0x417b7c[_0x70a1('0x38')],util['inspect']({'id':this['agents'][_0x417b7c['channel']['split']('-')[0x0]]['id'],'destaccountcode':this[_0x70a1('0x1d')][_0x417b7c[_0x70a1('0x47')][_0x70a1('0x40')]('-')[0x0]][_0x70a1('0x56')]},{'showHidden':![],'depth':null}));this[_0x70a1('0x37')](util[_0x70a1('0x45')](_0x70a1('0x46'),this['agents'][_0x417b7c['channel'][_0x70a1('0x40')]('-')[0x0]][_0x70a1('0x70')]),'user:agentcomplete',{'id':this['agents'][_0x417b7c[_0x70a1('0x47')][_0x70a1('0x40')]('-')[0x0]]['id'],'destaccountcode':this[_0x70a1('0x1d')][_0x417b7c[_0x70a1('0x47')][_0x70a1('0x40')]('-')[0x0]][_0x70a1('0x56')]});}}var _0x28ee19=this;Promise['resolve']()['then'](function(){var _0x55755e=_0x28ee19[_0x70a1('0x3d')][_0x417b7c[_0x70a1('0x38')]];if(typeof _0x55755e[_0x70a1('0x9f')]==='undefined')return;if(_[_0x70a1('0xa0')](_0x55755e['monitors']))return;return RpcSetting['getSettings']()[_0x70a1('0xa1')](function(_0x269b96){if(!_0x269b96['stopRecordingOnTransfer'])return;return Promise[_0x70a1('0xa2')]()[_0x70a1('0xa1')](function(){return ami['Action']({'action':_0x70a1('0xa3'),'channel':_0x55755e[_0x70a1('0x47')]})[_0x70a1('0xa4')](function(){});})['then'](function(){return ami[_0x70a1('0xa5')]({'action':_0x70a1('0xa3'),'channel':_0x55755e[_0x70a1('0xa6')]})['catch'](function(){})[_0x70a1('0xa7')](function(){var _0x23a7a2=_0x28ee19[_0x70a1('0x1d')][_0x55755e[_0x70a1('0xa6')][_0x70a1('0x40')]('-')[0x0]];if(!_0x23a7a2)return;io[_0x70a1('0x37')](_0x70a1('0xa8'),{'agentId':_0x23a7a2['id'],'uniqueid':_0x55755e[_0x70a1('0x38')]});});});});})['then'](function(){if(_0x417b7c[_0x70a1('0xa9')]==='BlindTransfer'){_0x28ee19[_0x70a1('0x1e')][_0x417b7c[_0x70a1('0x38')]]=_0x28ee19[_0x70a1('0x3d')][_0x417b7c[_0x70a1('0x38')]];}else{if(_0x28ee19['channels'][_0x417b7c[_0x70a1('0x38')]][_0x70a1('0x89')]===_0x70a1('0xaa')&&_0x28ee19[_0x70a1('0x1e')][_0x417b7c[_0x70a1('0x38')]]){_0x28ee19['channels'][_0x417b7c[_0x70a1('0x38')]][_0x70a1('0x38')]=[_0x28ee19[_0x70a1('0x3d')][_0x417b7c['uniqueid']][_0x70a1('0x3c')],_0x28ee19[_0x70a1('0x3d')][_0x417b7c[_0x70a1('0x38')]][_0x70a1('0x3c')]=_0x28ee19[_0x70a1('0x3d')][_0x417b7c[_0x70a1('0x38')]][_0x70a1('0x38')]][0x0];delete _0x28ee19['blindTransfers'][_0x417b7c['uniqueid']];}}logger[_0x70a1('0x3b')](_0x70a1('0xab'),_0x417b7c[_0x70a1('0x38')],util[_0x70a1('0x34')](_0x28ee19[_0x70a1('0x3d')][_0x417b7c[_0x70a1('0x38')]],{'showHidden':![],'depth':null}));ami[_0x70a1('0x37')](_0x70a1('0xac'),_0x28ee19[_0x70a1('0x3d')][_0x417b7c[_0x70a1('0x38')]]);delete _0x28ee19[_0x70a1('0x3d')][_0x417b7c[_0x70a1('0x38')]];});}}}catch(_0x2bdf73){logger[_0x70a1('0x33')](_0x70a1('0xad'),_0x417b7c[_0x70a1('0x38')],util[_0x70a1('0x34')](_0x2bdf73,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x70a1('0x35')][_0x70a1('0x2b')]=function(_0x4b476f){try{if(this[_0x70a1('0x36')](_0x4b476f)){logger[_0x70a1('0x4c')]('[%s][voiceCallReport][attendedtransfer]\x20transfercalleridnum:%s\x20transferconnectedlinenum:%s',_0x4b476f[_0x70a1('0x38')],_0x4b476f[_0x70a1('0xae')],_0x4b476f[_0x70a1('0xaf')]);logger[_0x70a1('0x3b')](_0x70a1('0xb0'),_0x4b476f[_0x70a1('0x38')],util[_0x70a1('0x34')](_0x4b476f,{'showHidden':![],'depth':null}));if(this[_0x70a1('0x3d')][_0x4b476f['transfereeuniqueid']]){this[_0x70a1('0x3d')][_0x4b476f[_0x70a1('0xb1')]][_0x70a1('0xb2')]=_0x4b476f[_0x70a1('0xae')];this['channels'][_0x4b476f['transfereeuniqueid']]['transferconnectedlinenum']=_0x4b476f[_0x70a1('0xaf')];if(this[_0x70a1('0x3d')][_0x4b476f[_0x70a1('0xb3')]]){var _0x3d5744=this[_0x70a1('0x3d')][_0x4b476f[_0x70a1('0xb3')]];this[_0x70a1('0x3d')][_0x4b476f[_0x70a1('0xb3')]]=this[_0x70a1('0x3d')][_0x4b476f[_0x70a1('0xb1')]];this[_0x70a1('0x3d')][_0x4b476f['transfereeuniqueid']]=_0x3d5744;}}else if(this[_0x70a1('0x3d')][_0x4b476f['transfertargetuniqueid']]){this[_0x70a1('0x3d')][_0x4b476f[_0x70a1('0xb4')]][_0x70a1('0xb2')]=_0x4b476f[_0x70a1('0xae')];this[_0x70a1('0x3d')][_0x4b476f['transfertargetuniqueid']][_0x70a1('0xb5')]=_0x4b476f['transfertargetcalleridnum'];if(this['channels'][_0x4b476f[_0x70a1('0xb6')]]){var _0x3d5744=this[_0x70a1('0x3d')][_0x4b476f[_0x70a1('0xb6')]];this[_0x70a1('0x3d')][_0x4b476f[_0x70a1('0xb6')]]=this['channels'][_0x4b476f[_0x70a1('0xb4')]];this[_0x70a1('0x3d')][_0x4b476f['transfertargetuniqueid']]=_0x3d5744;}}if((this[_0x70a1('0x3d')][_0x4b476f['origtransfereruniqueid']]||this[_0x70a1('0x3d')][_0x4b476f[_0x70a1('0xb7')]])&&this[_0x70a1('0x3d')][_0x4b476f[_0x70a1('0xb3')]]){var _0x467291=_['some']([this[_0x70a1('0x3d')][_0x4b476f[_0x70a1('0xb6')]],this[_0x70a1('0x3d')][_0x4b476f['origtransfererlinkedid']],this[_0x70a1('0x3d')][_0x4b476f[_0x70a1('0xb3')]]],function(_0x367cf6){return _0x367cf6&&_0x367cf6[_0x70a1('0x89')]===_0x70a1('0xaa')&&_0x367cf6['routeid'];});if(_0x467291){if(this[_0x70a1('0x3d')][_0x4b476f['origtransfereruniqueid']])this[_0x70a1('0x3d')][_0x4b476f[_0x70a1('0xb6')]]['transferType']=_0x70a1('0xb8');if(this[_0x70a1('0x3d')][_0x4b476f[_0x70a1('0xb7')]])this[_0x70a1('0x3d')][_0x4b476f[_0x70a1('0xb7')]][_0x70a1('0x9f')]=_0x70a1('0xb8');this[_0x70a1('0x3d')][_0x4b476f[_0x70a1('0xb3')]][_0x70a1('0x9f')]='ATTENDED';}}}}catch(_0x13e65c){logger[_0x70a1('0x33')](_0x70a1('0xb9'),_0x4b476f['uniqueid'],util[_0x70a1('0x34')](_0x13e65c,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x70a1('0x35')][_0x70a1('0x2c')]=function(_0x22ccae){try{if(this[_0x70a1('0x36')](_0x22ccae)){logger[_0x70a1('0x4c')](_0x70a1('0xba'),_0x22ccae[_0x70a1('0x38')],_0x22ccae['transfereecalleridnum'],_0x22ccae[_0x70a1('0xbb')]);logger[_0x70a1('0x3b')]('[%s][voiceCallReport][blindtransfer]\x20event:',_0x22ccae['uniqueid'],util[_0x70a1('0x34')](_0x22ccae,{'showHidden':![],'depth':null}));if(this[_0x70a1('0x3d')][_0x22ccae['transfereeuniqueid']]){this[_0x70a1('0x3d')][_0x22ccae[_0x70a1('0xb1')]][_0x70a1('0xb2')]=_0x22ccae[_0x70a1('0xbc')];this[_0x70a1('0x3d')][_0x22ccae[_0x70a1('0xb1')]]['transferconnectedlinenum']=_0x22ccae['extension'];this[_0x70a1('0x3d')][_0x22ccae[_0x70a1('0xb1')]][_0x70a1('0x9f')]='BLIND';this[_0x70a1('0x27')]({'event':_0x70a1('0xbd'),'uniqueid':_0x22ccae[_0x70a1('0xb1')],'context':_0x22ccae['context'],'channel':_0x22ccae[_0x70a1('0xbe')]});}else{this[_0x70a1('0x3d')][_0x22ccae[_0x70a1('0xbf')]][_0x70a1('0x9f')]=_0x70a1('0xc0');}}}catch(_0x49dcfb){logger['error']('[%s][voiceCallReport][blindtransfer]',_0x22ccae[_0x70a1('0x38')],util[_0x70a1('0x34')](_0x49dcfb,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x70a1('0x35')][_0x70a1('0x2e')]=function(_0x81c3c6){try{if(this[_0x70a1('0x36')](_0x81c3c6)){logger[_0x70a1('0x3b')]('[%s][voiceCallReport][musiconholdstart]\x20event:',_0x81c3c6['uniqueid'],util['inspect'](_0x81c3c6,{'showHidden':![],'depth':null}));if(this[_0x70a1('0x3d')][_0x81c3c6[_0x70a1('0x38')]]){if(!_[_0x70a1('0x7c')](this[_0x70a1('0x3d')][_0x81c3c6[_0x70a1('0x38')]][_0x70a1('0x6c')])){this[_0x70a1('0x3d')][_0x81c3c6[_0x70a1('0x38')]][_0x70a1('0xc1')]=moment()[_0x70a1('0x45')](_0x70a1('0x4f'));logger[_0x70a1('0x4c')](_0x70a1('0xc2'),_0x81c3c6[_0x70a1('0x38')],this[_0x70a1('0x3d')][_0x81c3c6[_0x70a1('0x38')]][_0x70a1('0xc1')]);}}}}catch(_0x5ddbc8){logger[_0x70a1('0x33')](_0x70a1('0xc3'),_0x81c3c6[_0x70a1('0x38')],util[_0x70a1('0x34')](_0x5ddbc8,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x70a1('0x35')][_0x70a1('0x30')]=function(_0x46668d){try{if(this[_0x70a1('0x36')](_0x46668d)){logger[_0x70a1('0x3b')](_0x70a1('0xc4'),_0x46668d[_0x70a1('0x38')],util[_0x70a1('0x34')](_0x46668d,{'showHidden':![],'depth':null}));if(this[_0x70a1('0x3d')][_0x46668d[_0x70a1('0x38')]]){if(!_['isNil'](this['channels'][_0x46668d[_0x70a1('0x38')]][_0x70a1('0xc1')])){this['channels'][_0x46668d[_0x70a1('0x38')]][_0x70a1('0xc5')]+=moment()[_0x70a1('0xc6')](0x0)['diff'](this['channels'][_0x46668d[_0x70a1('0x38')]][_0x70a1('0xc1')],_0x70a1('0x60'));logger[_0x70a1('0x4c')](_0x70a1('0xc7'),_0x46668d[_0x70a1('0x38')],this[_0x70a1('0x3d')][_0x46668d[_0x70a1('0x38')]][_0x70a1('0xc5')]);delete this[_0x70a1('0x3d')][_0x46668d[_0x70a1('0x38')]][_0x70a1('0xc1')];}}}}catch(_0x4461be){logger[_0x70a1('0x33')](_0x70a1('0xc8'),_0x46668d[_0x70a1('0x38')],util['inspect'](_0x4461be,{'showHidden':![],'depth':null}));}};module[_0x70a1('0xc9')]=VoiceCallReport; \ No newline at end of file +var _0x90ff=['debug','[%s][voiceCallReport][newcallerid]\x20event:','merge','pick','from-sip','channel','split','exten','xcally-motion-preview','destconnectedlinenum','connectedlinenum','emit','format','user:%s','name','accountcode','[%s][voiceCallReport][newchannel]\x20event:','linkedid','OutgoingSpoolFailed','[%s][voiceCallReport][newchannel]\x20context:%s\x20exten:%s','context','YYYY-MM-DD\x20HH:mm:ss','disposition','toNumber','channelstate','[%s][voiceCallReport][newchannel]\x20sending\x20user:agentconnect\x20event:','[%s][voiceCallReport][newchannel]','application','toLowerCase','applicationdata','appdata','startsWith','CDR(routeAlias)','[%s][voiceCallReport][newexten]\x20application:%s\x20appdata:%s','starttime','duration','seconds','keys','includes','lastapplication','lastdata','cdr(','[%s][voiceCallReport][newstate]\x20linkedid:%s\x20calleridname:%s\x20calleridnum:%s','[%s][voiceCallReport][newstate]\x20event:','answertime','holdtime','destinationchannel','UserId','membername','routealias','user:agentconnect','[%s][voiceCallReport][newstate]','monitor','endsWith','.wav49','replace','monitorFilename','find','monitors','isNil','push','[%s][voiceCallReport][mixMonitorFilename]','[%s][voiceCallReport][varset]\x20event:','variable','value','xmd-phone','[%s][voiceCallReport][varset]\x20variable:xmd-phone\x20value:%s','xmd-callerid','[%s][voiceCallReport][varset]\x20variable:xmd-callerid\x20value:%s','callerid','xmd-cdrtype','[%s][voiceCallReport][varset]\x20variable:xmd-cdrtype\x20value:%s','xmd-queue','[%s][voiceCallReport][varset]\x20variable:xmd-queue\x20value:%s','[%s][voiceCallReport][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','xmd-destination','[%s][voiceCallReport][varset]\x20variable:xmd-destination\x20value:%s','destination','[%s][voiceCallReport][varset]\x20variable:xmd-callerid-preview\x20value:%s','calleridpreview','xmcs-queue','[%s][voiceCallReport][varset]\x20variable:xmcs-queue\x20value:%s','sipcallid','[%s][voiceCallReport][varset]\x20variable:sipcallid\x20value:%s','sipcalluniqueid','mixmonitor_filename','parse','syncMixMonitorFilename','sipcalllinkedid','[%s][voiceCallReport][varset]','endtime','diff','answered','omit','[%s][voiceCallReport][hangup]\x20sending\x20user:agentcomplete\x20event:','user:agentcomplete','undefined','isEmpty','getSettings','then','stopRecordingOnTransfer','Action','StopMixMonitor','catch','finally','webbar:stopmonitors','BlindTransfer','type','outbound','custom:voiceCallReport','[%s][voiceCallReport][hangup]','[%s][voiceCallReport][attendedtransfer]\x20transfercalleridnum:%s\x20transferconnectedlinenum:%s','origtransferercalleridnum','transfertargetcalleridnum','[%s][voiceCallReport][attendedtransfer]\x20event:','transfereeuniqueid','transfercalleridnum','transferconnectedlinenum','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','origtransfererlinkedid','some','routeid','transferType','ATTENDED','[%s][voiceCallReport][attendedtransfer]','transfereecalleridnum','[%s][voiceCallReport][blindtransfer]\x20event:','extension','transfererchannel','transfereruniqueid','mohstarttime','[%s][voiceCallReport][musiconholdstart]\x20mohstarttime:%s','[%s][voiceCallReport][musiconholdstart]','[%s][voiceCallReport][musiconholdstop]\x20event:','mohtime','milliseconds','[%s][voiceCallReport][musiconholdstop]','bluebird','lodash','moment','util','path','ioredis','../../../config/environment','../../../config/logger','ami','../model/channel','../rpc/setting','unknown','not_inuse','busy','unavailable','ringing','ringinuse','onhold','set','queue','agi','dial','playback','voicemail','NO\x20ANSWER','FAILED','ANSWERED','BUSY','redis','defaults','socket.io-emitter','channels','agents','blindTransfers','coreshowchannel','bind','newexten','syncNewExten','newchannel','syncNewChannel','newstate','syncNewState','varset','syncVarSet','hangup','syncHangup','newcallerid','attendedtransfer','syncAttendedTransfer','blindtransfer','musiconholdstop','syncMusicOnHoldStop','info','actionCoreShowChannels','error','[voiceCallReport][coreshowchannels]','inspect','prototype','isNotNull','isUndefined','syncNewCallerId','[%s][voiceCallReport][newcallerid]\x20calleridname:%s\x20calleridnum:%s','uniqueid','calleridname','calleridnum'];(function(_0x1036ba,_0x651ed2){var _0x476d80=function(_0x25ff35){while(--_0x25ff35){_0x1036ba['push'](_0x1036ba['shift']());}};_0x476d80(++_0x651ed2);}(_0x90ff,0x157));var _0xf90f=function(_0x13d818,_0x23e6e5){_0x13d818=_0x13d818-0x0;var _0x40dfc0=_0x90ff[_0x13d818];return _0x40dfc0;};'use strict';var BPromise=require(_0xf90f('0x0'));var _=require(_0xf90f('0x1'));var moment=require(_0xf90f('0x2'));var util=require(_0xf90f('0x3'));var path=require(_0xf90f('0x4'));var Redis=require(_0xf90f('0x5'));var config=require(_0xf90f('0x6'));var logger=require(_0xf90f('0x7'))(_0xf90f('0x8'));var ami=require('../ami');var Channel=require(_0xf90f('0x9'));var RpcSetting=require(_0xf90f('0xa'));var statusDesc=[_0xf90f('0xb'),_0xf90f('0xc'),'inuse',_0xf90f('0xd'),'invalid',_0xf90f('0xe'),_0xf90f('0xf'),_0xf90f('0x10'),_0xf90f('0x11')];var applications=[_0xf90f('0x12'),_0xf90f('0x13'),_0xf90f('0x14'),_0xf90f('0x15'),_0xf90f('0x16'),_0xf90f('0x17')];var dispositions=[_0xf90f('0x18'),_0xf90f('0x19'),_0xf90f('0x19'),_0xf90f('0x18'),'NO\x20ANSWER','NO\x20ANSWER',_0xf90f('0x1a'),_0xf90f('0x1b'),_0xf90f('0x19'),'FAILED',_0xf90f('0x19')];var actions={};config[_0xf90f('0x1c')]=_[_0xf90f('0x1d')](config[_0xf90f('0x1c')],{'host':'localhost','port':0x18eb});var io=require(_0xf90f('0x1e'))(new Redis(config[_0xf90f('0x1c')]));function VoiceCallReport(_0x53723c){this['channels']=_0x53723c[_0xf90f('0x1f')];this['agents']=_0x53723c[_0xf90f('0x20')];this[_0xf90f('0x21')]={};ami['on'](_0xf90f('0x22'),this['syncNewExten'][_0xf90f('0x23')](this));ami['on'](_0xf90f('0x24'),this[_0xf90f('0x25')]['bind'](this));ami['on'](_0xf90f('0x26'),this[_0xf90f('0x27')]['bind'](this));ami['on'](_0xf90f('0x28'),this[_0xf90f('0x29')][_0xf90f('0x23')](this));ami['on'](_0xf90f('0x2a'),this[_0xf90f('0x2b')][_0xf90f('0x23')](this));ami['on'](_0xf90f('0x2c'),this[_0xf90f('0x2d')]['bind'](this));ami['on'](_0xf90f('0x2e'),this['syncNewCallerId'][_0xf90f('0x23')](this));ami['on'](_0xf90f('0x2f'),this[_0xf90f('0x30')][_0xf90f('0x23')](this));ami['on'](_0xf90f('0x31'),this['syncBlindTransfer'][_0xf90f('0x23')](this));ami['on']('musiconholdstart',this['syncMusicOnHoldStart']['bind'](this));ami['on'](_0xf90f('0x32'),this[_0xf90f('0x33')][_0xf90f('0x23')](this));try{logger[_0xf90f('0x34')]('[voiceCallReport][coreshowchannels]\x20started');ami[_0xf90f('0x35')]();}catch(_0x44bec0){logger[_0xf90f('0x36')](_0xf90f('0x37'),util[_0xf90f('0x38')](_0x44bec0,{'showHidden':![],'depth':null}));}}VoiceCallReport[_0xf90f('0x39')][_0xf90f('0x3a')]=function(_0xc6d0ae){return _0xc6d0ae!==null&&!_[_0xf90f('0x3b')](_0xc6d0ae);};VoiceCallReport[_0xf90f('0x39')]['emit']=function(_0xf49dbc,_0x2c84c5,_0x565b05){io['to'](_0xf49dbc)['emit'](_0x2c84c5,_0x565b05);};VoiceCallReport['prototype'][_0xf90f('0x3c')]=function(_0x93c30d){try{if(this[_0xf90f('0x3a')](_0x93c30d)){logger['info'](_0xf90f('0x3d'),_0x93c30d[_0xf90f('0x3e')],_0x93c30d[_0xf90f('0x3f')],_0x93c30d[_0xf90f('0x40')]);logger[_0xf90f('0x41')](_0xf90f('0x42'),_0x93c30d['uniqueid'],util[_0xf90f('0x38')](_0x93c30d,{'showHidden':![],'depth':null}));if(_0x93c30d[_0xf90f('0x3e')]===_0x93c30d['linkedid']){if(!_[_0xf90f('0x3b')](this[_0xf90f('0x1f')][_0x93c30d[_0xf90f('0x3e')]])){_[_0xf90f('0x43')](this[_0xf90f('0x1f')][_0x93c30d[_0xf90f('0x3e')]],_[_0xf90f('0x44')](_0x93c30d,_['keys'](this[_0xf90f('0x1f')][_0x93c30d[_0xf90f('0x3e')]])));}}if(_0x93c30d['context']===_0xf90f('0x45')){if(this['agents'][_0x93c30d[_0xf90f('0x46')][_0xf90f('0x47')]('-')[0x0]]){if(_0x93c30d[_0xf90f('0x48')]==_0xf90f('0x49')){this['agents'][_0x93c30d[_0xf90f('0x46')][_0xf90f('0x47')]('-')[0x0]][_0xf90f('0x4a')]=_0x93c30d[_0xf90f('0x4b')];this[_0xf90f('0x4c')](util[_0xf90f('0x4d')](_0xf90f('0x4e'),this[_0xf90f('0x20')][_0x93c30d['channel']['split']('-')[0x0]][_0xf90f('0x4f')]),'user:agentconnect',{'destaccountcode':this[_0xf90f('0x20')][_0x93c30d[_0xf90f('0x46')][_0xf90f('0x47')]('-')[0x0]][_0xf90f('0x50')],'destconnectedlinenum':_0x93c30d[_0xf90f('0x4b')]});}}}}}catch(_0x2d1639){logger['error']('[%s][voiceCallReport][newcallerid]',_0x93c30d[_0xf90f('0x3e')],util[_0xf90f('0x38')](_0x2d1639,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xf90f('0x39')][_0xf90f('0x27')]=function(_0x5c43ad){try{if(this['isNotNull'](_0x5c43ad)){logger[_0xf90f('0x41')](_0xf90f('0x51'),_0x5c43ad[_0xf90f('0x3e')],util[_0xf90f('0x38')](_0x5c43ad,{'showHidden':![],'depth':null}));if(_0x5c43ad['uniqueid']===_0x5c43ad[_0xf90f('0x52')]&&_0x5c43ad[_0xf90f('0x46')]!=_0xf90f('0x53')){if(_[_0xf90f('0x3b')](this[_0xf90f('0x1f')][_0x5c43ad['uniqueid']])){logger['info'](_0xf90f('0x54'),_0x5c43ad[_0xf90f('0x3e')],_0x5c43ad[_0xf90f('0x55')],_0x5c43ad['exten']);this[_0xf90f('0x1f')][_0x5c43ad[_0xf90f('0x3e')]]=new Channel();this[_0xf90f('0x1f')][_0x5c43ad['uniqueid']]['starttime']=moment()['format'](_0xf90f('0x56'));this[_0xf90f('0x1f')][_0x5c43ad[_0xf90f('0x3e')]][_0xf90f('0x57')]=dispositions[_[_0xf90f('0x58')](_0x5c43ad[_0xf90f('0x59')])];_[_0xf90f('0x43')](this['channels'][_0x5c43ad[_0xf90f('0x3e')]],_[_0xf90f('0x44')](_0x5c43ad,_['keys'](this[_0xf90f('0x1f')][_0x5c43ad[_0xf90f('0x3e')]])));if(_0x5c43ad[_0xf90f('0x55')]==='from-sip'){if(this[_0xf90f('0x20')][_0x5c43ad[_0xf90f('0x46')][_0xf90f('0x47')]('-')[0x0]]){if(_[_0xf90f('0x3b')](this[_0xf90f('0x20')][_0x5c43ad[_0xf90f('0x46')][_0xf90f('0x47')]('-')[0x0]][_0xf90f('0x4a')])){this[_0xf90f('0x20')][_0x5c43ad[_0xf90f('0x46')]['split']('-')[0x0]][_0xf90f('0x4a')]=_0x5c43ad[_0xf90f('0x48')];logger[_0xf90f('0x41')](_0xf90f('0x5a'),_0x5c43ad[_0xf90f('0x3e')],util[_0xf90f('0x38')]({'destaccountcode':this[_0xf90f('0x20')][_0x5c43ad[_0xf90f('0x46')][_0xf90f('0x47')]('-')[0x0]]['accountcode'],'destconnectedlinenum':_0x5c43ad[_0xf90f('0x48')]},{'showHidden':![],'depth':null}));this[_0xf90f('0x4c')](util[_0xf90f('0x4d')](_0xf90f('0x4e'),this[_0xf90f('0x20')][_0x5c43ad[_0xf90f('0x46')][_0xf90f('0x47')]('-')[0x0]]['name']),'user:agentconnect',{'destaccountcode':this[_0xf90f('0x20')][_0x5c43ad[_0xf90f('0x46')][_0xf90f('0x47')]('-')[0x0]][_0xf90f('0x50')],'destconnectedlinenum':_0x5c43ad['exten']});}}}}}}}catch(_0x4928c5){logger[_0xf90f('0x36')](_0xf90f('0x5b'),_0x5c43ad[_0xf90f('0x3e')],util[_0xf90f('0x38')](_0x4928c5,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype']['syncNewExten']=function(_0x42f514){try{if(this['isNotNull'](_0x42f514)){logger['debug']('[%s][voiceCallReport][newexten]\x20event:',_0x42f514[_0xf90f('0x3e')],util[_0xf90f('0x38')](_0x42f514,{'showHidden':![],'depth':null}));if(_0x42f514[_0xf90f('0x3e')]===_0x42f514['linkedid']&&_0x42f514[_0xf90f('0x48')]!='h'&&_0x42f514['channel']!='OutgoingSpoolFailed'){_0x42f514['application']=_0x42f514[_0xf90f('0x5c')][_0xf90f('0x5d')]();_0x42f514[_0xf90f('0x5e')]=_0x42f514['appdata']&&_0x42f514[_0xf90f('0x5f')][_0xf90f('0x60')](_0xf90f('0x61'))?_0x42f514['appdata']:(_0x42f514['appdata']||_0x42f514[_0xf90f('0x5e')])[_0xf90f('0x5d')]();logger[_0xf90f('0x34')](_0xf90f('0x62'),_0x42f514[_0xf90f('0x3e')],_0x42f514[_0xf90f('0x5c')],_0x42f514[_0xf90f('0x5e')]);if(_[_0xf90f('0x3b')](this[_0xf90f('0x1f')][_0x42f514['uniqueid']])){this[_0xf90f('0x1f')][_0x42f514[_0xf90f('0x3e')]]=new Channel();this[_0xf90f('0x1f')][_0x42f514[_0xf90f('0x3e')]][_0xf90f('0x63')]=_0x42f514[_0xf90f('0x64')]?moment()['subtract'](moment[_0xf90f('0x64')](_0x42f514[_0xf90f('0x64')])[_0xf90f('0x65')](),_0xf90f('0x65'))[_0xf90f('0x4d')](_0xf90f('0x56')):moment()[_0xf90f('0x4d')](_0xf90f('0x56'));this[_0xf90f('0x1f')][_0x42f514[_0xf90f('0x3e')]][_0xf90f('0x57')]=_0xf90f('0x18');}_[_0xf90f('0x43')](this[_0xf90f('0x1f')][_0x42f514[_0xf90f('0x3e')]],_[_0xf90f('0x44')](_0x42f514,_[_0xf90f('0x66')](this['channels'][_0x42f514[_0xf90f('0x3e')]])));if(_[_0xf90f('0x67')](applications,_0x42f514[_0xf90f('0x5c')])){this['channels'][_0x42f514['uniqueid']][_0xf90f('0x68')]=_0x42f514['application'];this[_0xf90f('0x1f')][_0x42f514[_0xf90f('0x3e')]][_0xf90f('0x69')]=_0x42f514[_0xf90f('0x5e')];if(_0x42f514[_0xf90f('0x5c')]===_0xf90f('0x12')&&_[_0xf90f('0x60')](_0x42f514[_0xf90f('0x5e')]['toLowerCase'](),_0xf90f('0x6a'))){var _0x2f3135=_0x42f514[_0xf90f('0x5e')]['split']('=');var _0xd23782=_0x2f3135[0x0][_0xf90f('0x5d')]()['match'](/cdr\((.*)\)/);if(_0xd23782){this[_0xf90f('0x1f')][_0x42f514[_0xf90f('0x3e')]][_0xd23782[0x1]]=_0x2f3135[0x1];}}else if(_0x42f514[_0xf90f('0x5c')]==='queue'){this['channels'][_0x42f514[_0xf90f('0x3e')]]['queue']=_0x42f514['applicationdata'][_0xf90f('0x47')](',')[0x0];}}}}}catch(_0x1e9e8b){logger[_0xf90f('0x36')]('[%s][voiceCallReport][newexten]',_0x42f514[_0xf90f('0x3e')],util[_0xf90f('0x38')](_0x1e9e8b,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0xf90f('0x29')]=function(_0x574bce){try{if(this[_0xf90f('0x3a')](_0x574bce)){logger[_0xf90f('0x34')](_0xf90f('0x6b'),_0x574bce[_0xf90f('0x3e')],_0x574bce[_0xf90f('0x52')],_0x574bce['calleridname'],_0x574bce[_0xf90f('0x40')]);logger[_0xf90f('0x41')](_0xf90f('0x6c'),_0x574bce[_0xf90f('0x3e')],util[_0xf90f('0x38')](_0x574bce,{'showHidden':![],'depth':null}));if(_0x574bce['uniqueid']!==_0x574bce[_0xf90f('0x52')]){if(this[_0xf90f('0x1f')][_0x574bce[_0xf90f('0x52')]]){if(_0x574bce[_0xf90f('0x59')]==='6'){if(!this[_0xf90f('0x1f')][_0x574bce[_0xf90f('0x52')]]['answered']){var _0x391954=moment();this[_0xf90f('0x1f')][_0x574bce[_0xf90f('0x52')]]['answered']=!![];this[_0xf90f('0x1f')][_0x574bce[_0xf90f('0x52')]][_0xf90f('0x6d')]=_0x391954['format'](_0xf90f('0x56'));if(this[_0xf90f('0x1f')][_0x574bce[_0xf90f('0x52')]][_0xf90f('0x63')]){this['channels'][_0x574bce[_0xf90f('0x52')]][_0xf90f('0x6e')]=_0x391954['diff'](this['channels'][_0x574bce[_0xf90f('0x52')]][_0xf90f('0x63')],_0xf90f('0x65'));}}this[_0xf90f('0x1f')][_0x574bce[_0xf90f('0x52')]][_0xf90f('0x52')]=_0x574bce[_0xf90f('0x3e')];if(_0x574bce[_0xf90f('0x40')]!==_0xf90f('0x49')){this[_0xf90f('0x1f')][_0x574bce[_0xf90f('0x52')]]['connectedlinenum']=_0x574bce['calleridnum'];}this['channels'][_0x574bce[_0xf90f('0x52')]]['connectedlinename']=_0x574bce['calleridname'];this[_0xf90f('0x1f')][_0x574bce['linkedid']][_0xf90f('0x6f')]=_0x574bce[_0xf90f('0x46')];this[_0xf90f('0x1f')][_0x574bce[_0xf90f('0x52')]][_0xf90f('0x57')]=dispositions[_[_0xf90f('0x58')](_0x574bce[_0xf90f('0x59')])];if(this[_0xf90f('0x20')][_0x574bce[_0xf90f('0x46')][_0xf90f('0x47')]('-')[0x0]]){this[_0xf90f('0x1f')][_0x574bce[_0xf90f('0x52')]][_0xf90f('0x70')]=this[_0xf90f('0x20')][_0x574bce['channel'][_0xf90f('0x47')]('-')[0x0]]['id'];this['channels'][_0x574bce['linkedid']]['membername']=this[_0xf90f('0x20')][_0x574bce['channel'][_0xf90f('0x47')]('-')[0x0]][_0xf90f('0x4f')];}}}}else{if(this[_0xf90f('0x1f')][_0x574bce[_0xf90f('0x3e')]]){if(_0x574bce[_0xf90f('0x59')]==='6'){if(this[_0xf90f('0x20')][_0x574bce[_0xf90f('0x46')][_0xf90f('0x47')]('-')[0x0]]){this[_0xf90f('0x1f')][_0x574bce[_0xf90f('0x3e')]][_0xf90f('0x70')]=this[_0xf90f('0x20')][_0x574bce[_0xf90f('0x46')][_0xf90f('0x47')]('-')[0x0]]['id'];this[_0xf90f('0x1f')][_0x574bce[_0xf90f('0x3e')]][_0xf90f('0x71')]=this['agents'][_0x574bce[_0xf90f('0x46')][_0xf90f('0x47')]('-')[0x0]][_0xf90f('0x4f')];}}}}if(_0x574bce[_0xf90f('0x59')]==='6'&&_0x574bce['context']===_0xf90f('0x45')){if(this['agents'][_0x574bce[_0xf90f('0x46')][_0xf90f('0x47')]('-')[0x0]]){this[_0xf90f('0x20')][_0x574bce[_0xf90f('0x46')][_0xf90f('0x47')]('-')[0x0]][_0xf90f('0x4a')]=_0x574bce[_0xf90f('0x48')];var _0x291803;if(this[_0xf90f('0x1f')][_0x574bce[_0xf90f('0x3e')]])_0x291803=this[_0xf90f('0x1f')][_0x574bce[_0xf90f('0x3e')]][_0xf90f('0x72')];else if(this[_0xf90f('0x1f')][_0x574bce['linkedid']])_0x291803=this[_0xf90f('0x1f')][_0x574bce[_0xf90f('0x52')]][_0xf90f('0x72')];logger[_0xf90f('0x41')]('[%s][voiceCallReport][newstate]\x20sending\x20user:agentconnect\x20event:',_0x574bce['uniqueid'],util[_0xf90f('0x38')]({'destaccountcode':this[_0xf90f('0x20')][_0x574bce[_0xf90f('0x46')][_0xf90f('0x47')]('-')[0x0]][_0xf90f('0x50')],'destconnectedlinenum':_0x574bce['exten'],'routealias':_0x291803},{'showHidden':![],'depth':null}));this[_0xf90f('0x4c')](util[_0xf90f('0x4d')](_0xf90f('0x4e'),this[_0xf90f('0x20')][_0x574bce['channel'][_0xf90f('0x47')]('-')[0x0]]['name']),_0xf90f('0x73'),{'destaccountcode':this[_0xf90f('0x20')][_0x574bce['channel'][_0xf90f('0x47')]('-')[0x0]]['accountcode'],'destconnectedlinenum':_0x574bce[_0xf90f('0x48')],'routealias':_0x291803});}}}}catch(_0x3e6160){logger[_0xf90f('0x36')](_0xf90f('0x74'),_0x574bce['uniqueid'],util[_0xf90f('0x38')](_0x3e6160,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype']['syncMixMonitorFilename']=function(_0x5c56cf,_0x3ec722){try{if(this[_0xf90f('0x1f')][_0x5c56cf]){logger[_0xf90f('0x34')]('[%s][voiceCallReport][mixMonitorFilename]\x20monitorFilename:%s',_0x5c56cf,_0x3ec722);this[_0xf90f('0x1f')][_0x5c56cf][_0xf90f('0x75')]=!![];if(_[_0xf90f('0x76')](_0x3ec722,_0xf90f('0x77'))){_0x3ec722=_0x3ec722[_0xf90f('0x78')](_0xf90f('0x77'),'.WAV');}this[_0xf90f('0x1f')][_0x5c56cf][_0xf90f('0x79')]=_0x3ec722;var _0xabcde4=_[_0xf90f('0x7a')](this['channels'][_0x5c56cf][_0xf90f('0x7b')],{'filename':_0x3ec722});if(_[_0xf90f('0x7c')](_0xabcde4)){this[_0xf90f('0x1f')][_0x5c56cf][_0xf90f('0x7b')][_0xf90f('0x7d')]({'filename':_0x3ec722,'createdAt':moment()['format'](_0xf90f('0x56')),'mixmonitorid':'','status':'rec'});}}}catch(_0x64d124){logger['error'](_0xf90f('0x7e'),_0x5c56cf,util[_0xf90f('0x38')](_0x64d124,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xf90f('0x39')][_0xf90f('0x2b')]=function(_0x152fcc){try{if(this[_0xf90f('0x3a')](_0x152fcc)){logger[_0xf90f('0x41')](_0xf90f('0x7f'),_0x152fcc[_0xf90f('0x3e')],util[_0xf90f('0x38')](_0x152fcc,{'showHidden':![],'depth':null}));if(this[_0xf90f('0x1f')][_0x152fcc[_0xf90f('0x3e')]]&&_0x152fcc[_0xf90f('0x46')]!='OutgoingSpoolFailed'){if(this[_0xf90f('0x3a')](_0x152fcc['variable'])){if(this[_0xf90f('0x3a')](_0x152fcc[_0xf90f('0x80')]['mixmonitor_filename'])){logger[_0xf90f('0x34')]('[%s][voiceCallReport][varset]\x20variable:mixmonitor_filename\x20value:%s',_0x152fcc[_0xf90f('0x3e')],_0x152fcc[_0xf90f('0x81')]);this['syncMixMonitorFilename'](_0x152fcc[_0xf90f('0x3e')],_0x152fcc[_0xf90f('0x81')]);}else if(this[_0xf90f('0x3a')](_0x152fcc[_0xf90f('0x80')][_0xf90f('0x82')])){logger['info'](_0xf90f('0x83'),_0x152fcc[_0xf90f('0x3e')],_0x152fcc[_0xf90f('0x81')]);this['channels'][_0x152fcc[_0xf90f('0x3e')]][_0xf90f('0x40')]=_0x152fcc[_0xf90f('0x81')];}else if(this[_0xf90f('0x3a')](_0x152fcc[_0xf90f('0x80')][_0xf90f('0x84')])){logger['info'](_0xf90f('0x85'),_0x152fcc[_0xf90f('0x3e')],_0x152fcc[_0xf90f('0x81')]);this[_0xf90f('0x1f')][_0x152fcc[_0xf90f('0x3e')]][_0xf90f('0x86')]=_0x152fcc[_0xf90f('0x81')];}else if(this[_0xf90f('0x3a')](_0x152fcc[_0xf90f('0x80')][_0xf90f('0x87')])){logger[_0xf90f('0x34')](_0xf90f('0x88'),_0x152fcc[_0xf90f('0x3e')],_0x152fcc[_0xf90f('0x81')]);this[_0xf90f('0x1f')][_0x152fcc[_0xf90f('0x3e')]]['type']=_0x152fcc[_0xf90f('0x81')];}else if(this[_0xf90f('0x3a')](_0x152fcc[_0xf90f('0x80')][_0xf90f('0x89')])){logger[_0xf90f('0x34')](_0xf90f('0x8a'),_0x152fcc[_0xf90f('0x3e')],_0x152fcc[_0xf90f('0x81')]['split'](',')[0x0]);this[_0xf90f('0x1f')][_0x152fcc['uniqueid']]['queue']=_0x152fcc[_0xf90f('0x81')][_0xf90f('0x47')](',')[0x0];}else if(this[_0xf90f('0x3a')](_0x152fcc[_0xf90f('0x80')]['xmd-originatecalleridnum'])){logger[_0xf90f('0x34')](_0xf90f('0x8b'),_0x152fcc[_0xf90f('0x3e')],_0x152fcc[_0xf90f('0x81')]);this[_0xf90f('0x1f')][_0x152fcc[_0xf90f('0x3e')]]['originatecalleridnum']=_0x152fcc[_0xf90f('0x81')];}else if(this['isNotNull'](_0x152fcc[_0xf90f('0x80')][_0xf90f('0x8c')])){logger[_0xf90f('0x34')](_0xf90f('0x8d'),_0x152fcc[_0xf90f('0x3e')],_0x152fcc[_0xf90f('0x81')]);this[_0xf90f('0x1f')][_0x152fcc[_0xf90f('0x3e')]][_0xf90f('0x8e')]=_0x152fcc[_0xf90f('0x81')];}else if(this[_0xf90f('0x3a')](_0x152fcc[_0xf90f('0x80')]['xmd-callerid-preview'])){logger[_0xf90f('0x34')](_0xf90f('0x8f'),_0x152fcc[_0xf90f('0x3e')],_0x152fcc[_0xf90f('0x81')]);this[_0xf90f('0x1f')][_0x152fcc['uniqueid']][_0xf90f('0x90')]=_0x152fcc[_0xf90f('0x81')];}else if(this['isNotNull'](_0x152fcc['variable'][_0xf90f('0x91')])){logger['info'](_0xf90f('0x92'),_0x152fcc[_0xf90f('0x3e')],_0x152fcc[_0xf90f('0x81')]);this[_0xf90f('0x1f')][_0x152fcc[_0xf90f('0x3e')]][_0xf90f('0x13')]=_0x152fcc[_0xf90f('0x81')];}else if(this[_0xf90f('0x3a')](_0x152fcc['variable'][_0xf90f('0x93')])){logger[_0xf90f('0x34')](_0xf90f('0x94'),_0x152fcc[_0xf90f('0x3e')],_0x152fcc['value']);this[_0xf90f('0x1f')][_0x152fcc[_0xf90f('0x3e')]][_0xf90f('0x95')]=_0x152fcc[_0xf90f('0x81')];}}}else if(this['isNotNull'](_0x152fcc[_0xf90f('0x80')][_0xf90f('0x96')])){if(_0x152fcc[_0xf90f('0x81')]){var _0x92d642=path[_0xf90f('0x97')](_0x152fcc[_0xf90f('0x81')])[_0xf90f('0x4f')];logger[_0xf90f('0x34')]('[%s][voiceCallReport][varset]\x20variable:mixmonitor_filename\x20value:%s',_0x92d642,_0x152fcc[_0xf90f('0x81')]);this[_0xf90f('0x98')](_0x92d642,_0x152fcc[_0xf90f('0x81')]);}}else if(this[_0xf90f('0x1f')][_0x152fcc[_0xf90f('0x52')]]){if(this[_0xf90f('0x3a')](_0x152fcc['variable'])){if(this[_0xf90f('0x3a')](_0x152fcc[_0xf90f('0x80')]['sipcallid'])){logger[_0xf90f('0x34')]('[%s][voiceCallReport][varset]\x20variable:sipcallid\x20value:%s',_0x152fcc[_0xf90f('0x52')],_0x152fcc['value']);this[_0xf90f('0x1f')][_0x152fcc[_0xf90f('0x52')]][_0xf90f('0x99')]=_0x152fcc[_0xf90f('0x81')];}}}}}catch(_0x4f7407){logger[_0xf90f('0x36')](_0xf90f('0x9a'),_0x152fcc[_0xf90f('0x3e')],util[_0xf90f('0x38')](_0x4f7407,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0xf90f('0x2d')]=function(_0x44e134){try{if(this['isNotNull'](_0x44e134)){logger[_0xf90f('0x41')]('[%s][voiceCallReport][hangup]\x20event:',_0x44e134[_0xf90f('0x3e')],util[_0xf90f('0x38')](_0x44e134,{'showHidden':![],'depth':null}));if(this['channels'][_0x44e134[_0xf90f('0x3e')]]){logger['info']('[%s][voiceCallReport][hangup]\x20reason:%s',_0x44e134[_0xf90f('0x3e')],_0x44e134['cause-txt']);var _0x493e89=moment();this[_0xf90f('0x1f')][_0x44e134[_0xf90f('0x3e')]][_0xf90f('0x9b')]=_0x493e89[_0xf90f('0x4d')]('YYYY-MM-DD\x20HH:mm:ss');this[_0xf90f('0x1f')][_0x44e134[_0xf90f('0x3e')]][_0xf90f('0x64')]=_0x493e89[_0xf90f('0x9c')](this[_0xf90f('0x1f')][_0x44e134[_0xf90f('0x3e')]][_0xf90f('0x63')],_0xf90f('0x65'));if(this[_0xf90f('0x1f')][_0x44e134[_0xf90f('0x3e')]][_0xf90f('0x9d')]){this['channels'][_0x44e134['uniqueid']]['billableseconds']=_0x493e89[_0xf90f('0x9c')](this[_0xf90f('0x1f')][_0x44e134[_0xf90f('0x3e')]]['answertime'],'seconds');this[_0xf90f('0x1f')][_0x44e134[_0xf90f('0x3e')]]['holdtime']=this[_0xf90f('0x1f')][_0x44e134[_0xf90f('0x3e')]][_0xf90f('0x64')]-this['channels'][_0x44e134['uniqueid']]['billableseconds'];}if(_0x44e134[_0xf90f('0x55')]===_0xf90f('0x45')){if(this[_0xf90f('0x20')][_0x44e134[_0xf90f('0x46')][_0xf90f('0x47')]('-')[0x0]]){this[_0xf90f('0x20')][_0x44e134[_0xf90f('0x46')][_0xf90f('0x47')]('-')[0x0]]=_[_0xf90f('0x9e')](this[_0xf90f('0x20')][_0x44e134[_0xf90f('0x46')][_0xf90f('0x47')]('-')[0x0]],[_0xf90f('0x4a')]);logger[_0xf90f('0x41')](_0xf90f('0x9f'),_0x44e134[_0xf90f('0x3e')],util[_0xf90f('0x38')]({'id':this['agents'][_0x44e134[_0xf90f('0x46')][_0xf90f('0x47')]('-')[0x0]]['id'],'destaccountcode':this[_0xf90f('0x20')][_0x44e134[_0xf90f('0x46')][_0xf90f('0x47')]('-')[0x0]][_0xf90f('0x50')]},{'showHidden':![],'depth':null}));this[_0xf90f('0x4c')](util[_0xf90f('0x4d')](_0xf90f('0x4e'),this[_0xf90f('0x20')][_0x44e134[_0xf90f('0x46')][_0xf90f('0x47')]('-')[0x0]][_0xf90f('0x4f')]),_0xf90f('0xa0'),{'id':this[_0xf90f('0x20')][_0x44e134[_0xf90f('0x46')][_0xf90f('0x47')]('-')[0x0]]['id'],'destaccountcode':this['agents'][_0x44e134[_0xf90f('0x46')][_0xf90f('0x47')]('-')[0x0]][_0xf90f('0x50')]});}}var _0xd80506=this;Promise['resolve']()['then'](function(){var _0x3f50ee=_0xd80506['channels'][_0x44e134[_0xf90f('0x3e')]];if(typeof _0x3f50ee['transferType']===_0xf90f('0xa1'))return;if(_[_0xf90f('0xa2')](_0x3f50ee[_0xf90f('0x7b')]))return;return RpcSetting[_0xf90f('0xa3')]()[_0xf90f('0xa4')](function(_0x58dfa8){if(!_0x58dfa8[_0xf90f('0xa5')])return;return Promise['resolve']()['then'](function(){return ami[_0xf90f('0xa6')]({'action':_0xf90f('0xa7'),'channel':_0x3f50ee[_0xf90f('0x46')]})[_0xf90f('0xa8')](function(){});})[_0xf90f('0xa4')](function(){return ami[_0xf90f('0xa6')]({'action':_0xf90f('0xa7'),'channel':_0x3f50ee[_0xf90f('0x6f')]})[_0xf90f('0xa8')](function(){})[_0xf90f('0xa9')](function(){var _0x2b759f=_0xd80506[_0xf90f('0x20')][_0x3f50ee[_0xf90f('0x6f')]['split']('-')[0x0]];if(!_0x2b759f)return;io[_0xf90f('0x4c')](_0xf90f('0xaa'),{'agentId':_0x2b759f['id'],'uniqueid':_0x3f50ee[_0xf90f('0x3e')]});});});});})[_0xf90f('0xa4')](function(){if(_0x44e134['event']===_0xf90f('0xab')){_0xd80506[_0xf90f('0x21')][_0x44e134['uniqueid']]=_0xd80506[_0xf90f('0x1f')][_0x44e134['uniqueid']];}else{if(_0xd80506[_0xf90f('0x1f')][_0x44e134[_0xf90f('0x3e')]][_0xf90f('0xac')]===_0xf90f('0xad')&&_0xd80506[_0xf90f('0x21')][_0x44e134['uniqueid']]){_0xd80506[_0xf90f('0x1f')][_0x44e134[_0xf90f('0x3e')]][_0xf90f('0x3e')]=[_0xd80506['channels'][_0x44e134['uniqueid']][_0xf90f('0x52')],_0xd80506['channels'][_0x44e134[_0xf90f('0x3e')]][_0xf90f('0x52')]=_0xd80506['channels'][_0x44e134[_0xf90f('0x3e')]]['uniqueid']][0x0];delete _0xd80506[_0xf90f('0x21')][_0x44e134['uniqueid']];}}logger[_0xf90f('0x41')]('[%s][voiceCallReport][hangup]\x20sending\x20hangup\x20event:',_0x44e134[_0xf90f('0x3e')],util[_0xf90f('0x38')](_0xd80506[_0xf90f('0x1f')][_0x44e134[_0xf90f('0x3e')]],{'showHidden':![],'depth':null}));ami['emit'](_0xf90f('0xae'),_0xd80506[_0xf90f('0x1f')][_0x44e134[_0xf90f('0x3e')]]);delete _0xd80506['channels'][_0x44e134[_0xf90f('0x3e')]];});}}}catch(_0x42ab6a){logger[_0xf90f('0x36')](_0xf90f('0xaf'),_0x44e134[_0xf90f('0x3e')],util[_0xf90f('0x38')](_0x42ab6a,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xf90f('0x39')][_0xf90f('0x30')]=function(_0x51cd54){try{if(this[_0xf90f('0x3a')](_0x51cd54)){logger['info'](_0xf90f('0xb0'),_0x51cd54['uniqueid'],_0x51cd54[_0xf90f('0xb1')],_0x51cd54[_0xf90f('0xb2')]);logger[_0xf90f('0x41')](_0xf90f('0xb3'),_0x51cd54[_0xf90f('0x3e')],util[_0xf90f('0x38')](_0x51cd54,{'showHidden':![],'depth':null}));if(this[_0xf90f('0x1f')][_0x51cd54[_0xf90f('0xb4')]]){this[_0xf90f('0x1f')][_0x51cd54['transfereeuniqueid']][_0xf90f('0xb5')]=_0x51cd54['origtransferercalleridnum'];this[_0xf90f('0x1f')][_0x51cd54[_0xf90f('0xb4')]][_0xf90f('0xb6')]=_0x51cd54[_0xf90f('0xb2')];if(this[_0xf90f('0x1f')][_0x51cd54[_0xf90f('0xb7')]]){var _0x23a071=this[_0xf90f('0x1f')][_0x51cd54['secondtransfereruniqueid']];this[_0xf90f('0x1f')][_0x51cd54[_0xf90f('0xb7')]]=this[_0xf90f('0x1f')][_0x51cd54[_0xf90f('0xb4')]];this[_0xf90f('0x1f')][_0x51cd54[_0xf90f('0xb4')]]=_0x23a071;}}else if(this[_0xf90f('0x1f')][_0x51cd54[_0xf90f('0xb8')]]){this[_0xf90f('0x1f')][_0x51cd54['transfertargetuniqueid']][_0xf90f('0xb5')]=_0x51cd54[_0xf90f('0xb1')];this['channels'][_0x51cd54['transfertargetuniqueid']]['transferconnectedlinenum']=_0x51cd54['transfertargetcalleridnum'];if(this[_0xf90f('0x1f')][_0x51cd54[_0xf90f('0xb9')]]){var _0x23a071=this[_0xf90f('0x1f')][_0x51cd54[_0xf90f('0xb9')]];this[_0xf90f('0x1f')][_0x51cd54[_0xf90f('0xb9')]]=this[_0xf90f('0x1f')][_0x51cd54[_0xf90f('0xb8')]];this[_0xf90f('0x1f')][_0x51cd54[_0xf90f('0xb8')]]=_0x23a071;}}if((this[_0xf90f('0x1f')][_0x51cd54[_0xf90f('0xb9')]]||this['channels'][_0x51cd54[_0xf90f('0xba')]])&&this[_0xf90f('0x1f')][_0x51cd54['secondtransfereruniqueid']]){var _0x5e53ed=_[_0xf90f('0xbb')]([this[_0xf90f('0x1f')][_0x51cd54[_0xf90f('0xb9')]],this[_0xf90f('0x1f')][_0x51cd54[_0xf90f('0xba')]],this['channels'][_0x51cd54['secondtransfereruniqueid']]],function(_0x48eb10){return _0x48eb10&&_0x48eb10[_0xf90f('0xac')]===_0xf90f('0xad')&&_0x48eb10[_0xf90f('0xbc')];});if(_0x5e53ed){if(this[_0xf90f('0x1f')][_0x51cd54[_0xf90f('0xb9')]])this[_0xf90f('0x1f')][_0x51cd54[_0xf90f('0xb9')]][_0xf90f('0xbd')]='ATTENDED';if(this[_0xf90f('0x1f')][_0x51cd54[_0xf90f('0xba')]])this[_0xf90f('0x1f')][_0x51cd54[_0xf90f('0xba')]][_0xf90f('0xbd')]=_0xf90f('0xbe');this[_0xf90f('0x1f')][_0x51cd54['secondtransfereruniqueid']]['transferType']=_0xf90f('0xbe');}}}}catch(_0x2da9a7){logger['error'](_0xf90f('0xbf'),_0x51cd54[_0xf90f('0x3e')],util[_0xf90f('0x38')](_0x2da9a7,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype']['syncBlindTransfer']=function(_0x5bf435){try{if(this['isNotNull'](_0x5bf435)){logger['info']('[%s][voiceCallReport][blindtransfer]\x20transfercalleridnum:%s\x20transferconnectedlinenum:%s',_0x5bf435[_0xf90f('0x3e')],_0x5bf435[_0xf90f('0xc0')],_0x5bf435['extension']);logger[_0xf90f('0x41')](_0xf90f('0xc1'),_0x5bf435[_0xf90f('0x3e')],util[_0xf90f('0x38')](_0x5bf435,{'showHidden':![],'depth':null}));if(this[_0xf90f('0x1f')][_0x5bf435['transfereeuniqueid']]){this[_0xf90f('0x1f')][_0x5bf435[_0xf90f('0xb4')]][_0xf90f('0xb5')]=_0x5bf435['transfereecalleridnum'];this[_0xf90f('0x1f')][_0x5bf435[_0xf90f('0xb4')]][_0xf90f('0xb6')]=_0x5bf435[_0xf90f('0xc2')];this['channels'][_0x5bf435[_0xf90f('0xb4')]][_0xf90f('0xbd')]='BLIND';this[_0xf90f('0x2d')]({'event':_0xf90f('0xab'),'uniqueid':_0x5bf435[_0xf90f('0xb4')],'context':_0x5bf435[_0xf90f('0x55')],'channel':_0x5bf435[_0xf90f('0xc3')]});}else{this[_0xf90f('0x1f')][_0x5bf435[_0xf90f('0xc4')]]['transferType']='BLIND';}}}catch(_0x20bdd0){logger[_0xf90f('0x36')]('[%s][voiceCallReport][blindtransfer]',_0x5bf435[_0xf90f('0x3e')],util[_0xf90f('0x38')](_0x20bdd0,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xf90f('0x39')]['syncMusicOnHoldStart']=function(_0x439479){try{if(this[_0xf90f('0x3a')](_0x439479)){logger[_0xf90f('0x41')]('[%s][voiceCallReport][musiconholdstart]\x20event:',_0x439479[_0xf90f('0x3e')],util[_0xf90f('0x38')](_0x439479,{'showHidden':![],'depth':null}));if(this['channels'][_0x439479[_0xf90f('0x3e')]]){if(!_[_0xf90f('0x7c')](this['channels'][_0x439479[_0xf90f('0x3e')]][_0xf90f('0x6d')])){this[_0xf90f('0x1f')][_0x439479[_0xf90f('0x3e')]][_0xf90f('0xc5')]=moment()[_0xf90f('0x4d')](_0xf90f('0x56'));logger[_0xf90f('0x34')](_0xf90f('0xc6'),_0x439479[_0xf90f('0x3e')],this[_0xf90f('0x1f')][_0x439479[_0xf90f('0x3e')]][_0xf90f('0xc5')]);}}}}catch(_0x355d57){logger[_0xf90f('0x36')](_0xf90f('0xc7'),_0x439479[_0xf90f('0x3e')],util[_0xf90f('0x38')](_0x355d57,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0xf90f('0x33')]=function(_0x1dfda5){try{if(this['isNotNull'](_0x1dfda5)){logger[_0xf90f('0x41')](_0xf90f('0xc8'),_0x1dfda5[_0xf90f('0x3e')],util['inspect'](_0x1dfda5,{'showHidden':![],'depth':null}));if(this[_0xf90f('0x1f')][_0x1dfda5[_0xf90f('0x3e')]]){if(!_[_0xf90f('0x7c')](this[_0xf90f('0x1f')][_0x1dfda5['uniqueid']][_0xf90f('0xc5')])){this[_0xf90f('0x1f')][_0x1dfda5[_0xf90f('0x3e')]][_0xf90f('0xc9')]+=moment()[_0xf90f('0xca')](0x0)[_0xf90f('0x9c')](this[_0xf90f('0x1f')][_0x1dfda5[_0xf90f('0x3e')]]['mohstarttime'],_0xf90f('0x65'));logger[_0xf90f('0x34')]('[%s][voiceCallReport][musiconholdstop]\x20mohtime:%s',_0x1dfda5['uniqueid'],this[_0xf90f('0x1f')][_0x1dfda5[_0xf90f('0x3e')]][_0xf90f('0xc9')]);delete this['channels'][_0x1dfda5['uniqueid']][_0xf90f('0xc5')];}}}}catch(_0x4de5cb){logger[_0xf90f('0x36')](_0xf90f('0xcb'),_0x1dfda5['uniqueid'],util[_0xf90f('0x38')](_0x4de5cb,{'showHidden':![],'depth':null}));}};module['exports']=VoiceCallReport; \ No newline at end of file diff --git a/server/services/ami/report/voiceDialReport.js b/server/services/ami/report/voiceDialReport.js index b6b4ba4..de05183 100644 --- a/server/services/ami/report/voiceDialReport.js +++ b/server/services/ami/report/voiceDialReport.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4781=['[%s][voiceDialReport][varset]\x20event:','addVariable','keys','variable','value','outboundrouteid','voice','[%s][voiceDialReport][varset]\x20outboundrouteid:%s\x20variable:%s\x20value:%s','[%s][voiceDialReport][varset]','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqosrtt','rtpaudioqosrttbridged','sipcallid','bridgepeer','bridgepvtcallid','membercalls','memberinterface','membername','memberpenalty','memberrealtime','isNil','includes','variables','syncHangup','[%s][voiceDialReport][hangup]\x20event:','[%s][voiceDialReport][hangup]\x20reason:%s\x20lasteevent:complete','cause-txt','endtime','duration','starttime','seconds','complete','total','answered','holdtime','billableseconds','diff','sumHoldTime','sumBillable','sumDuration','[%s][voiceDialReport][hangup]\x20sending\x20voiceDialReport\x20event:','custom:voiceDialReport','[%s][voiceDialReport][hangup]\x20sending\x20dialend\x20event:','custom:dialend','[%s][voiceDialReport][hangup]\x20sending\x20voice_outbound:save\x20event:','voice_outbound:save','[DEBUG]\x20Emit\x20voice_outbound_channel:remove\x20event','stringify','[%s][voiceDialReport][hangup]\x20sending\x20voice_outbound_channel:remove\x20event:','linkedid','destuniqueid','error','toLowerCase','set','applicationdata','startsWith','cdr(','[%s][voiceDialReport][newexten]\x20application:%s\x20appdata:%s','split','match','lodash','moment','../../../config/environment','../ami','redis','defaults','localhost','channels','outboundChannels','outbound','applications','dialbegin','syncDialBegin','bind','varset','syncVarSet','newexten','syncNewExten','hangup','isUndefined','emit','isNotNull','uniqueid','merge','format','YYYY-MM-DD\x20HH:mm:ss','called','channel','substring','lastIndexOf','event','privilege','info','[%s][voiceDialReport][dialbegin]\x20agent:%s\x20interface:%s\x20lastevent:called','debug','[%s][voiceDialReport][dialbegin]\x20sending\x20voice_outbound_channel:save\x20event:','inspect','voice:outbound','voice_outbound_channel:save','[%s][voiceDialReport][dialbegin]\x20sending\x20dialbegin\x20event:','custom:dialbegin','[%s][voiceDialReport][dialbegin]','syncDialEnd','[%s][voiceDialReport][dialend]\x20event:','dialstatus','ANSWER','connectedlinenum','connectedlinename','answertime','lastevent','connect','[%s][voiceDialReport][dialend]\x20agent:%s\x20lastevent:connect','[%s][voiceDialReport][dialend]\x20sending\x20dialconnect\x20event:','custom:dialconnect','[%s][voiceDialReport][dialend]\x20sending\x20voice_outbound_channel:save\x20event:','[%s][voiceDialReport][dialend]','prototype'];(function(_0x5d7df9,_0x59f667){var _0x1d104b=function(_0x45d0c4){while(--_0x45d0c4){_0x5d7df9['push'](_0x5d7df9['shift']());}};_0x1d104b(++_0x59f667);}(_0x4781,0x1ab));var _0x1478=function(_0x359bcf,_0x5dc445){_0x359bcf=_0x359bcf-0x0;var _0x11f32f=_0x4781[_0x359bcf];return _0x11f32f;};'use strict';var _=require(_0x1478('0x0'));var moment=require(_0x1478('0x1'));var util=require('util');var Redis=require('ioredis');var config=require(_0x1478('0x2'));var logger=require('../../../config/logger')('ami');var ami=require(_0x1478('0x3'));config[_0x1478('0x4')]=_[_0x1478('0x5')](config[_0x1478('0x4')],{'host':_0x1478('0x6'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x1478('0x4')]));function VoiceDialReport(_0x3cfcf5){this[_0x1478('0x7')]=_0x3cfcf5[_0x1478('0x8')];this[_0x1478('0x9')]=_0x3cfcf5[_0x1478('0x9')];this[_0x1478('0xa')]={};this['variables']={};ami['on'](_0x1478('0xb'),this[_0x1478('0xc')][_0x1478('0xd')](this));ami['on']('dialend',this['syncDialEnd'][_0x1478('0xd')](this));ami['on'](_0x1478('0xe'),this[_0x1478('0xf')][_0x1478('0xd')](this));ami['on'](_0x1478('0x10'),this[_0x1478('0x11')]['bind'](this));ami['on'](_0x1478('0x12'),this['syncHangup'][_0x1478('0xd')](this));}VoiceDialReport['prototype']['isNotNull']=function(_0x4603a5){return _0x4603a5!==null&&!_[_0x1478('0x13')](_0x4603a5);};VoiceDialReport['prototype']['emit']=function(_0x361a14,_0x536fce,_0x5c866e){io['to'](_0x361a14)[_0x1478('0x14')](_0x536fce,_0x5c866e);};VoiceDialReport['prototype'][_0x1478('0xc')]=function(_0x3604f8){try{if(this[_0x1478('0x15')](_0x3604f8)){logger['debug']('[%s][voiceDialReport][dialbegin]\x20event:',_0x3604f8[_0x1478('0x16')],util['inspect'](_0x3604f8,{'showHidden':![],'depth':null}));if(this[_0x1478('0x7')][_0x3604f8[_0x1478('0x16')]]){_[_0x1478('0x17')](this[_0x1478('0x7')][_0x3604f8['uniqueid']],{'starttime':moment()[_0x1478('0x18')](_0x1478('0x19')),'lastevent':_0x1478('0x1a'),'interface':_0x3604f8[_0x1478('0x1b')][_0x1478('0x1c')](0x0,_0x3604f8[_0x1478('0x1b')][_0x1478('0x1d')]('-')),'membername':_0x3604f8['channel'][_0x1478('0x1c')](_0x3604f8[_0x1478('0x1b')][_0x1478('0x1d')]('/')+0x1,_0x3604f8['channel'][_0x1478('0x1d')]('-'))},_['omit'](_0x3604f8,[_0x1478('0x1e'),_0x1478('0x1f')]));logger[_0x1478('0x20')](_0x1478('0x21'),_0x3604f8[_0x1478('0x16')],this[_0x1478('0x7')][_0x3604f8['uniqueid']]['membername'],this[_0x1478('0x7')][_0x3604f8[_0x1478('0x16')]]['interface']);logger[_0x1478('0x22')](_0x1478('0x23'),_0x3604f8['uniqueid'],util[_0x1478('0x24')](this[_0x1478('0x7')][_0x3604f8[_0x1478('0x16')]],{'showHidden':![],'depth':null}));if(this[_0x1478('0xa')][_0x3604f8[_0x1478('0x16')]])_[_0x1478('0x17')](this[_0x1478('0x7')][_0x3604f8['uniqueid']],this['applications'][_0x3604f8[_0x1478('0x16')]]);this[_0x1478('0x14')](_0x1478('0x25'),_0x1478('0x26'),this[_0x1478('0x7')][_0x3604f8[_0x1478('0x16')]]);logger[_0x1478('0x22')](_0x1478('0x27'),_0x3604f8[_0x1478('0x16')],util[_0x1478('0x24')](this['channels'][_0x3604f8[_0x1478('0x16')]],{'showHidden':![],'depth':null}));ami[_0x1478('0x14')](_0x1478('0x28'),this[_0x1478('0x7')][_0x3604f8[_0x1478('0x16')]]);}}}catch(_0x3e1cb6){logger['error'](_0x1478('0x29'),_0x3604f8[_0x1478('0x16')],util[_0x1478('0x24')](_0x3e1cb6,{'showHidden':![],'depth':null}));}};VoiceDialReport['prototype'][_0x1478('0x2a')]=function(_0x423dc2){try{if(this['isNotNull'](_0x423dc2)){logger[_0x1478('0x22')](_0x1478('0x2b'),_0x423dc2['uniqueid'],util[_0x1478('0x24')](_0x423dc2,{'showHidden':![],'depth':null}));if(this[_0x1478('0x7')][_0x423dc2[_0x1478('0x16')]]){this['channels'][_0x423dc2[_0x1478('0x16')]][_0x1478('0x2c')]=_0x423dc2[_0x1478('0x2c')];if(_0x423dc2[_0x1478('0x2c')]===_0x1478('0x2d')){this[_0x1478('0x7')][_0x423dc2[_0x1478('0x16')]][_0x1478('0x2e')]=_0x423dc2['connectedlinenum'];this[_0x1478('0x7')][_0x423dc2[_0x1478('0x16')]][_0x1478('0x2f')]=_0x423dc2[_0x1478('0x2f')];this['channels'][_0x423dc2[_0x1478('0x16')]][_0x1478('0x30')]=moment()[_0x1478('0x18')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x1478('0x7')][_0x423dc2[_0x1478('0x16')]][_0x1478('0x31')]=_0x1478('0x32');logger[_0x1478('0x20')](_0x1478('0x33'),_0x423dc2[_0x1478('0x16')],_0x423dc2[_0x1478('0x1b')][_0x1478('0x1c')](_0x423dc2['channel'][_0x1478('0x1d')]('/')+0x1,_0x423dc2[_0x1478('0x1b')][_0x1478('0x1d')]('-')));logger['debug'](_0x1478('0x34'),_0x423dc2[_0x1478('0x16')],util[_0x1478('0x24')](this['channels'][_0x423dc2[_0x1478('0x16')]],{'showHidden':![],'depth':null}));ami['emit'](_0x1478('0x35'),this[_0x1478('0x7')][_0x423dc2[_0x1478('0x16')]]);}logger[_0x1478('0x22')](_0x1478('0x36'),_0x423dc2['uniqueid'],util[_0x1478('0x24')](this[_0x1478('0x7')][_0x423dc2[_0x1478('0x16')]],{'showHidden':![],'depth':null}));this[_0x1478('0x14')](_0x1478('0x25'),_0x1478('0x26'),this[_0x1478('0x7')][_0x423dc2[_0x1478('0x16')]]);}}}catch(_0x3aa82f){logger['error'](_0x1478('0x37'),_0x423dc2[_0x1478('0x16')],util['inspect'](_0x3aa82f,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x1478('0x38')]['syncVarSet']=function(_0xa1ebb4){try{if(this[_0x1478('0x15')](_0xa1ebb4)){logger[_0x1478('0x22')](_0x1478('0x39'),_0xa1ebb4['uniqueid'],util[_0x1478('0x24')](_0xa1ebb4,{'showHidden':![],'depth':null}));this[_0x1478('0x3a')](_0xa1ebb4[_0x1478('0x16')],_[_0x1478('0x3b')](_0xa1ebb4[_0x1478('0x3c')])[0x0],_0xa1ebb4[_0x1478('0x3d')]);if(this['isNotNull'](_0xa1ebb4['variable'])&&this[_0x1478('0x15')](_0xa1ebb4[_0x1478('0x3c')][_0x1478('0x3e')])){if(_[_0x1478('0x13')](this[_0x1478('0x7')][_0xa1ebb4[_0x1478('0x16')]])){this[_0x1478('0x7')][_0xa1ebb4['uniqueid']]={'routeId':_0xa1ebb4['value'],'variables':this['variables'][_0xa1ebb4[_0x1478('0x16')]],'motionChannel':_0x1478('0x3f')};logger['info'](_0x1478('0x40'),_0xa1ebb4[_0x1478('0x16')],_0xa1ebb4[_0x1478('0x3c')][_0x1478('0x3e')],_[_0x1478('0x3b')](_0xa1ebb4['variable'])[0x0],_0xa1ebb4[_0x1478('0x3d')]);logger[_0x1478('0x22')]('[%s][voiceDialReport][varset]\x20sending\x20voice_outbound_channel:save\x20event:',_0xa1ebb4[_0x1478('0x16')],util[_0x1478('0x24')](this['channels'][_0xa1ebb4['uniqueid']],{'showHidden':![],'depth':null}));this[_0x1478('0x14')]('voice:outbound','voice_outbound_channel:save',this['channels'][_0xa1ebb4['uniqueid']]);}}}}catch(_0x1a8ed2){logger['error'](_0x1478('0x41'),_0xa1ebb4['uniqueid'],util[_0x1478('0x24')](_0x1a8ed2,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x1478('0x38')][_0x1478('0x3a')]=function(_0x523f69,_0x44d1c7,_0x25db38){var _0x4f0a6c=[_0x1478('0x42'),_0x1478('0x43'),_0x1478('0x44'),_0x1478('0x45'),_0x1478('0x46'),'rtpaudioqoslossbridged',_0x1478('0x47'),_0x1478('0x48'),_0x1478('0x49'),'sipuri',_0x1478('0x4a'),_0x1478('0x4b'),_0x1478('0x4c'),'memberdynamic',_0x1478('0x4d'),'memberlastcall',_0x1478('0x4e'),_0x1478('0x4f'),_0x1478('0x50')];if(!_[_0x1478('0x51')](_0x44d1c7)&&!_[_0x1478('0x52')](_0x4f0a6c,_0x44d1c7)){if(_[_0x1478('0x13')](this[_0x1478('0x53')][_0x523f69])){this[_0x1478('0x53')][_0x523f69]={};}this['variables'][_0x523f69][_0x44d1c7]=_0x25db38;}};VoiceDialReport[_0x1478('0x38')][_0x1478('0x54')]=function(_0x2fd3bc){try{if(this[_0x1478('0x15')](_0x2fd3bc)){logger[_0x1478('0x22')](_0x1478('0x55'),_0x2fd3bc[_0x1478('0x16')],util[_0x1478('0x24')](_0x2fd3bc,{'showHidden':![],'depth':null}));if(this[_0x1478('0x7')][_0x2fd3bc[_0x1478('0x16')]]){logger[_0x1478('0x20')](_0x1478('0x56'),_0x2fd3bc[_0x1478('0x16')],_0x2fd3bc[_0x1478('0x57')]);this[_0x1478('0x7')][_0x2fd3bc[_0x1478('0x16')]][_0x1478('0x58')]=moment()[_0x1478('0x18')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x1478('0x7')][_0x2fd3bc['uniqueid']][_0x1478('0x59')]=moment(this[_0x1478('0x7')][_0x2fd3bc[_0x1478('0x16')]][_0x1478('0x58')])['diff'](this[_0x1478('0x7')][_0x2fd3bc['uniqueid']][_0x1478('0x5a')],_0x1478('0x5b'));this[_0x1478('0x7')][_0x2fd3bc[_0x1478('0x16')]][_0x1478('0x31')]=_0x1478('0x5c');this[_0x1478('0x9')][_0x1478('0x5d')]+=0x1;if(this[_0x1478('0x7')][_0x2fd3bc[_0x1478('0x16')]][_0x1478('0x30')]){this[_0x1478('0x9')][_0x1478('0x5e')]+=0x1;this[_0x1478('0x7')][_0x2fd3bc[_0x1478('0x16')]][_0x1478('0x5f')]=moment(this[_0x1478('0x7')][_0x2fd3bc[_0x1478('0x16')]][_0x1478('0x30')])['diff'](this[_0x1478('0x7')][_0x2fd3bc[_0x1478('0x16')]]['starttime'],_0x1478('0x5b'));this[_0x1478('0x7')][_0x2fd3bc['uniqueid']][_0x1478('0x60')]=moment(this['channels'][_0x2fd3bc['uniqueid']][_0x1478('0x58')])[_0x1478('0x61')](this[_0x1478('0x7')][_0x2fd3bc[_0x1478('0x16')]][_0x1478('0x30')],_0x1478('0x5b'));this['outbound'][_0x1478('0x62')]+=this[_0x1478('0x7')][_0x2fd3bc[_0x1478('0x16')]][_0x1478('0x5f')]||0x0;this[_0x1478('0x9')][_0x1478('0x63')]+=this['channels'][_0x2fd3bc[_0x1478('0x16')]][_0x1478('0x60')];}this[_0x1478('0x9')][_0x1478('0x64')]+=this[_0x1478('0x7')][_0x2fd3bc[_0x1478('0x16')]][_0x1478('0x59')];logger[_0x1478('0x22')](_0x1478('0x65'),_0x2fd3bc[_0x1478('0x16')],util['inspect'](this[_0x1478('0x7')][_0x2fd3bc['uniqueid']],{'showHidden':![],'depth':null}));ami[_0x1478('0x14')](_0x1478('0x66'),this[_0x1478('0x7')][_0x2fd3bc[_0x1478('0x16')]]);logger[_0x1478('0x22')](_0x1478('0x67'),_0x2fd3bc['uniqueid'],util['inspect'](this[_0x1478('0x7')][_0x2fd3bc[_0x1478('0x16')]],{'showHidden':![],'depth':null}));ami[_0x1478('0x14')](_0x1478('0x68'),this[_0x1478('0x7')][_0x2fd3bc[_0x1478('0x16')]]);logger[_0x1478('0x22')](_0x1478('0x69'),_0x2fd3bc[_0x1478('0x16')],util[_0x1478('0x24')](this['channels'][_0x2fd3bc['uniqueid']],{'showHidden':![],'depth':null}));this[_0x1478('0x14')]('voice:outbound',_0x1478('0x6a'),this[_0x1478('0x9')]);logger['info'](_0x1478('0x6b'),JSON[_0x1478('0x6c')](this[_0x1478('0x7')][_0x2fd3bc['uniqueid']]));logger['debug'](_0x1478('0x6d'),_0x2fd3bc[_0x1478('0x16')],util[_0x1478('0x24')](this[_0x1478('0x7')][_0x2fd3bc[_0x1478('0x16')]],{'showHidden':![],'depth':null}));this['emit']('voice:outbound','voice_outbound_channel:remove',this[_0x1478('0x7')][_0x2fd3bc[_0x1478('0x16')]]);delete this['channels'][_0x2fd3bc[_0x1478('0x16')]];}else if(this[_0x1478('0x7')][_0x2fd3bc['linkedid']]){this[_0x1478('0x7')][_0x2fd3bc[_0x1478('0x6e')]][_0x1478('0x16')]=this[_0x1478('0x7')][_0x2fd3bc['linkedid']][_0x1478('0x6f')];}if(this[_0x1478('0x53')][_0x2fd3bc['uniqueid']]){delete this[_0x1478('0x53')][_0x2fd3bc[_0x1478('0x16')]];}}}catch(_0x5723bb){logger[_0x1478('0x70')]('[%s][voiceDialReport][hangup]',_0x2fd3bc[_0x1478('0x16')],util['inspect'](_0x5723bb,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x1478('0x38')]['syncNewExten']=function(_0x2c19ed){try{if(this[_0x1478('0x15')](_0x2c19ed)){logger[_0x1478('0x22')]('[%s][voiceDialReport][newexten]\x20event:',_0x2c19ed[_0x1478('0x16')],util[_0x1478('0x24')](_0x2c19ed,{'showHidden':![],'depth':null}));if(_0x2c19ed['application'][_0x1478('0x71')]()===_0x1478('0x72')){_0x2c19ed[_0x1478('0x73')]=(_0x2c19ed['appdata']||_0x2c19ed[_0x1478('0x73')])[_0x1478('0x71')]();if(_[_0x1478('0x74')](_0x2c19ed[_0x1478('0x73')],_0x1478('0x75'))){if(_[_0x1478('0x13')](this[_0x1478('0xa')][_0x2c19ed[_0x1478('0x16')]]))this[_0x1478('0xa')][_0x2c19ed['uniqueid']]={};logger[_0x1478('0x20')](_0x1478('0x76'),_0x2c19ed['uniqueid'],_0x2c19ed['application'],_0x2c19ed['applicationdata']);var _0x4361e3=_0x2c19ed['applicationdata'][_0x1478('0x77')]('=');var _0xc6b22e=_0x4361e3[0x0][_0x1478('0x78')](/cdr\((.*)\)/);if(_0xc6b22e)this['applications'][_0x2c19ed[_0x1478('0x16')]][_0xc6b22e[0x1]]=_0x4361e3[0x1];}}}}catch(_0x4418c3){logger[_0x1478('0x70')]('[%s][voiceDialReport][newexten]',_0x2c19ed[_0x1478('0x16')],util[_0x1478('0x24')](_0x4418c3,{'showHidden':![],'depth':null}));}};module['exports']=VoiceDialReport; \ No newline at end of file +var _0x6bfc=['varset','syncVarSet','newexten','syncNewExten','syncHangup','isNotNull','emit','prototype','debug','[%s][voiceDialReport][dialbegin]\x20event:','inspect','uniqueid','YYYY-MM-DD\x20HH:mm:ss','called','substring','channel','lastIndexOf','omit','event','info','membername','interface','[%s][voiceDialReport][dialbegin]\x20sending\x20voice_outbound_channel:save\x20event:','merge','applications','voice:outbound','[%s][voiceDialReport][dialbegin]\x20sending\x20dialbegin\x20event:','custom:dialbegin','error','[%s][voiceDialReport][dialbegin]','syncDialEnd','[%s][voiceDialReport][dialend]\x20event:','dialstatus','ANSWER','connectedlinenum','connectedlinename','answertime','format','lastevent','[%s][voiceDialReport][dialend]\x20agent:%s\x20lastevent:connect','[%s][voiceDialReport][dialend]\x20sending\x20dialconnect\x20event:','custom:dialconnect','voice_outbound_channel:save','[%s][voiceDialReport][dialend]','[%s][voiceDialReport][varset]\x20event:','addVariable','keys','value','variable','isUndefined','voice','[%s][voiceDialReport][varset]\x20outboundrouteid:%s\x20variable:%s\x20value:%s','outboundrouteid','[%s][voiceDialReport][varset]\x20sending\x20voice_outbound_channel:save\x20event:','[%s][voiceDialReport][varset]','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','sipcallid','bridgepvtcallid','memberdynamic','memberinterface','memberpenalty','memberrealtime','isNil','includes','[%s][voiceDialReport][hangup]\x20reason:%s\x20lasteevent:complete','duration','endtime','diff','complete','total','starttime','seconds','billableseconds','sumHoldTime','holdtime','sumBillable','sumDuration','[%s][voiceDialReport][hangup]\x20sending\x20dialend\x20event:','custom:dialend','voice_outbound:save','[%s][voiceDialReport][hangup]\x20sending\x20voice_outbound_channel:remove\x20event:','voice_outbound_channel:remove','linkedid','[%s][voiceDialReport][hangup]','[%s][voiceDialReport][newexten]\x20event:','application','toLowerCase','set','applicationdata','appdata','startsWith','[%s][voiceDialReport][newexten]','exports','lodash','moment','util','../../../config/environment','ami','../ami','defaults','redis','socket.io-emitter','channels','outboundChannels','outbound','variables','syncDialBegin','bind','dialend'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6bfc,0xd4));var _0xc6bf=function(_0x376005,_0x265e06){_0x376005=_0x376005-0x0;var _0x3f7ba7=_0x6bfc[_0x376005];return _0x3f7ba7;};'use strict';var _=require(_0xc6bf('0x0'));var moment=require(_0xc6bf('0x1'));var util=require(_0xc6bf('0x2'));var Redis=require('ioredis');var config=require(_0xc6bf('0x3'));var logger=require('../../../config/logger')(_0xc6bf('0x4'));var ami=require(_0xc6bf('0x5'));config['redis']=_[_0xc6bf('0x6')](config[_0xc6bf('0x7')],{'host':'localhost','port':0x18eb});var io=require(_0xc6bf('0x8'))(new Redis(config['redis']));function VoiceDialReport(_0x17d6f8){this[_0xc6bf('0x9')]=_0x17d6f8[_0xc6bf('0xa')];this[_0xc6bf('0xb')]=_0x17d6f8[_0xc6bf('0xb')];this['applications']={};this[_0xc6bf('0xc')]={};ami['on']('dialbegin',this[_0xc6bf('0xd')][_0xc6bf('0xe')](this));ami['on'](_0xc6bf('0xf'),this['syncDialEnd'][_0xc6bf('0xe')](this));ami['on'](_0xc6bf('0x10'),this[_0xc6bf('0x11')][_0xc6bf('0xe')](this));ami['on'](_0xc6bf('0x12'),this[_0xc6bf('0x13')][_0xc6bf('0xe')](this));ami['on']('hangup',this[_0xc6bf('0x14')][_0xc6bf('0xe')](this));}VoiceDialReport['prototype'][_0xc6bf('0x15')]=function(_0x3984f3){return _0x3984f3!==null&&!_['isUndefined'](_0x3984f3);};VoiceDialReport['prototype'][_0xc6bf('0x16')]=function(_0xee2c42,_0x4e3bee,_0x3d29e7){io['to'](_0xee2c42)[_0xc6bf('0x16')](_0x4e3bee,_0x3d29e7);};VoiceDialReport[_0xc6bf('0x17')]['syncDialBegin']=function(_0x104c97){try{if(this[_0xc6bf('0x15')](_0x104c97)){logger[_0xc6bf('0x18')](_0xc6bf('0x19'),_0x104c97['uniqueid'],util[_0xc6bf('0x1a')](_0x104c97,{'showHidden':![],'depth':null}));if(this['channels'][_0x104c97[_0xc6bf('0x1b')]]){_['merge'](this[_0xc6bf('0x9')][_0x104c97['uniqueid']],{'starttime':moment()['format'](_0xc6bf('0x1c')),'lastevent':_0xc6bf('0x1d'),'interface':_0x104c97['channel'][_0xc6bf('0x1e')](0x0,_0x104c97['channel']['lastIndexOf']('-')),'membername':_0x104c97[_0xc6bf('0x1f')][_0xc6bf('0x1e')](_0x104c97[_0xc6bf('0x1f')]['lastIndexOf']('/')+0x1,_0x104c97[_0xc6bf('0x1f')][_0xc6bf('0x20')]('-'))},_[_0xc6bf('0x21')](_0x104c97,[_0xc6bf('0x22'),'privilege']));logger[_0xc6bf('0x23')]('[%s][voiceDialReport][dialbegin]\x20agent:%s\x20interface:%s\x20lastevent:called',_0x104c97['uniqueid'],this[_0xc6bf('0x9')][_0x104c97[_0xc6bf('0x1b')]][_0xc6bf('0x24')],this[_0xc6bf('0x9')][_0x104c97[_0xc6bf('0x1b')]][_0xc6bf('0x25')]);logger[_0xc6bf('0x18')](_0xc6bf('0x26'),_0x104c97[_0xc6bf('0x1b')],util[_0xc6bf('0x1a')](this[_0xc6bf('0x9')][_0x104c97[_0xc6bf('0x1b')]],{'showHidden':![],'depth':null}));if(this['applications'][_0x104c97[_0xc6bf('0x1b')]])_[_0xc6bf('0x27')](this[_0xc6bf('0x9')][_0x104c97[_0xc6bf('0x1b')]],this[_0xc6bf('0x28')][_0x104c97[_0xc6bf('0x1b')]]);this[_0xc6bf('0x16')](_0xc6bf('0x29'),'voice_outbound_channel:save',this[_0xc6bf('0x9')][_0x104c97[_0xc6bf('0x1b')]]);logger[_0xc6bf('0x18')](_0xc6bf('0x2a'),_0x104c97[_0xc6bf('0x1b')],util['inspect'](this[_0xc6bf('0x9')][_0x104c97[_0xc6bf('0x1b')]],{'showHidden':![],'depth':null}));ami['emit'](_0xc6bf('0x2b'),this[_0xc6bf('0x9')][_0x104c97['uniqueid']]);}}}catch(_0x4e3211){logger[_0xc6bf('0x2c')](_0xc6bf('0x2d'),_0x104c97[_0xc6bf('0x1b')],util[_0xc6bf('0x1a')](_0x4e3211,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0xc6bf('0x17')][_0xc6bf('0x2e')]=function(_0x4705c1){try{if(this[_0xc6bf('0x15')](_0x4705c1)){logger[_0xc6bf('0x18')](_0xc6bf('0x2f'),_0x4705c1[_0xc6bf('0x1b')],util[_0xc6bf('0x1a')](_0x4705c1,{'showHidden':![],'depth':null}));if(this[_0xc6bf('0x9')][_0x4705c1[_0xc6bf('0x1b')]]){this['channels'][_0x4705c1['uniqueid']][_0xc6bf('0x30')]=_0x4705c1[_0xc6bf('0x30')];if(_0x4705c1[_0xc6bf('0x30')]===_0xc6bf('0x31')){this[_0xc6bf('0x9')][_0x4705c1[_0xc6bf('0x1b')]][_0xc6bf('0x32')]=_0x4705c1[_0xc6bf('0x32')];this['channels'][_0x4705c1['uniqueid']]['connectedlinename']=_0x4705c1[_0xc6bf('0x33')];this['channels'][_0x4705c1['uniqueid']][_0xc6bf('0x34')]=moment()[_0xc6bf('0x35')](_0xc6bf('0x1c'));this[_0xc6bf('0x9')][_0x4705c1[_0xc6bf('0x1b')]][_0xc6bf('0x36')]='connect';logger[_0xc6bf('0x23')](_0xc6bf('0x37'),_0x4705c1[_0xc6bf('0x1b')],_0x4705c1[_0xc6bf('0x1f')][_0xc6bf('0x1e')](_0x4705c1[_0xc6bf('0x1f')][_0xc6bf('0x20')]('/')+0x1,_0x4705c1[_0xc6bf('0x1f')][_0xc6bf('0x20')]('-')));logger['debug'](_0xc6bf('0x38'),_0x4705c1[_0xc6bf('0x1b')],util[_0xc6bf('0x1a')](this['channels'][_0x4705c1['uniqueid']],{'showHidden':![],'depth':null}));ami['emit'](_0xc6bf('0x39'),this[_0xc6bf('0x9')][_0x4705c1['uniqueid']]);}logger['debug']('[%s][voiceDialReport][dialend]\x20sending\x20voice_outbound_channel:save\x20event:',_0x4705c1[_0xc6bf('0x1b')],util[_0xc6bf('0x1a')](this[_0xc6bf('0x9')][_0x4705c1[_0xc6bf('0x1b')]],{'showHidden':![],'depth':null}));this[_0xc6bf('0x16')]('voice:outbound',_0xc6bf('0x3a'),this[_0xc6bf('0x9')][_0x4705c1[_0xc6bf('0x1b')]]);}}}catch(_0x24db90){logger[_0xc6bf('0x2c')](_0xc6bf('0x3b'),_0x4705c1[_0xc6bf('0x1b')],util[_0xc6bf('0x1a')](_0x24db90,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0xc6bf('0x17')][_0xc6bf('0x11')]=function(_0x457510){try{if(this[_0xc6bf('0x15')](_0x457510)){logger['debug'](_0xc6bf('0x3c'),_0x457510[_0xc6bf('0x1b')],util['inspect'](_0x457510,{'showHidden':![],'depth':null}));this[_0xc6bf('0x3d')](_0x457510[_0xc6bf('0x1b')],_[_0xc6bf('0x3e')](_0x457510['variable'])[0x0],_0x457510[_0xc6bf('0x3f')]);if(this[_0xc6bf('0x15')](_0x457510[_0xc6bf('0x40')])&&this[_0xc6bf('0x15')](_0x457510[_0xc6bf('0x40')]['outboundrouteid'])){if(_[_0xc6bf('0x41')](this[_0xc6bf('0x9')][_0x457510[_0xc6bf('0x1b')]])){this[_0xc6bf('0x9')][_0x457510[_0xc6bf('0x1b')]]={'routeId':_0x457510[_0xc6bf('0x3f')],'variables':this[_0xc6bf('0xc')][_0x457510[_0xc6bf('0x1b')]],'motionChannel':_0xc6bf('0x42')};logger['info'](_0xc6bf('0x43'),_0x457510[_0xc6bf('0x1b')],_0x457510[_0xc6bf('0x40')][_0xc6bf('0x44')],_[_0xc6bf('0x3e')](_0x457510[_0xc6bf('0x40')])[0x0],_0x457510[_0xc6bf('0x3f')]);logger['debug'](_0xc6bf('0x45'),_0x457510[_0xc6bf('0x1b')],util[_0xc6bf('0x1a')](this[_0xc6bf('0x9')][_0x457510['uniqueid']],{'showHidden':![],'depth':null}));this[_0xc6bf('0x16')](_0xc6bf('0x29'),_0xc6bf('0x3a'),this[_0xc6bf('0x9')][_0x457510[_0xc6bf('0x1b')]]);}}}}catch(_0x4e1d7e){logger[_0xc6bf('0x2c')](_0xc6bf('0x46'),_0x457510[_0xc6bf('0x1b')],util[_0xc6bf('0x1a')](_0x4e1d7e,{'showHidden':![],'depth':null}));}};VoiceDialReport['prototype'][_0xc6bf('0x3d')]=function(_0x2a77e8,_0x4cb3ca,_0x49d356){var _0x224600=[_0xc6bf('0x47'),_0xc6bf('0x48'),'rtpaudioqosjitter',_0xc6bf('0x49'),_0xc6bf('0x4a'),_0xc6bf('0x4b'),_0xc6bf('0x4c'),'rtpaudioqosrttbridged',_0xc6bf('0x4d'),'sipuri','bridgepeer',_0xc6bf('0x4e'),'membercalls',_0xc6bf('0x4f'),_0xc6bf('0x50'),'memberlastcall',_0xc6bf('0x24'),_0xc6bf('0x51'),_0xc6bf('0x52')];if(!_[_0xc6bf('0x53')](_0x4cb3ca)&&!_[_0xc6bf('0x54')](_0x224600,_0x4cb3ca)){if(_[_0xc6bf('0x41')](this[_0xc6bf('0xc')][_0x2a77e8])){this[_0xc6bf('0xc')][_0x2a77e8]={};}this['variables'][_0x2a77e8][_0x4cb3ca]=_0x49d356;}};VoiceDialReport[_0xc6bf('0x17')][_0xc6bf('0x14')]=function(_0x51d2ea){try{if(this[_0xc6bf('0x15')](_0x51d2ea)){logger[_0xc6bf('0x18')]('[%s][voiceDialReport][hangup]\x20event:',_0x51d2ea[_0xc6bf('0x1b')],util['inspect'](_0x51d2ea,{'showHidden':![],'depth':null}));if(this[_0xc6bf('0x9')][_0x51d2ea[_0xc6bf('0x1b')]]){logger[_0xc6bf('0x23')](_0xc6bf('0x55'),_0x51d2ea['uniqueid'],_0x51d2ea['cause-txt']);this[_0xc6bf('0x9')][_0x51d2ea['uniqueid']]['endtime']=moment()[_0xc6bf('0x35')](_0xc6bf('0x1c'));this[_0xc6bf('0x9')][_0x51d2ea['uniqueid']][_0xc6bf('0x56')]=moment(this[_0xc6bf('0x9')][_0x51d2ea[_0xc6bf('0x1b')]][_0xc6bf('0x57')])[_0xc6bf('0x58')](this['channels'][_0x51d2ea[_0xc6bf('0x1b')]]['starttime'],'seconds');this[_0xc6bf('0x9')][_0x51d2ea[_0xc6bf('0x1b')]]['lastevent']=_0xc6bf('0x59');this[_0xc6bf('0xb')][_0xc6bf('0x5a')]+=0x1;if(this['channels'][_0x51d2ea[_0xc6bf('0x1b')]]['answertime']){this[_0xc6bf('0xb')]['answered']+=0x1;this[_0xc6bf('0x9')][_0x51d2ea['uniqueid']]['holdtime']=moment(this['channels'][_0x51d2ea[_0xc6bf('0x1b')]]['answertime'])[_0xc6bf('0x58')](this[_0xc6bf('0x9')][_0x51d2ea[_0xc6bf('0x1b')]][_0xc6bf('0x5b')],_0xc6bf('0x5c'));this[_0xc6bf('0x9')][_0x51d2ea['uniqueid']][_0xc6bf('0x5d')]=moment(this[_0xc6bf('0x9')][_0x51d2ea['uniqueid']][_0xc6bf('0x57')])[_0xc6bf('0x58')](this['channels'][_0x51d2ea[_0xc6bf('0x1b')]][_0xc6bf('0x34')],'seconds');this['outbound'][_0xc6bf('0x5e')]+=this[_0xc6bf('0x9')][_0x51d2ea[_0xc6bf('0x1b')]][_0xc6bf('0x5f')]||0x0;this[_0xc6bf('0xb')][_0xc6bf('0x60')]+=this[_0xc6bf('0x9')][_0x51d2ea[_0xc6bf('0x1b')]][_0xc6bf('0x5d')];}this['outbound'][_0xc6bf('0x61')]+=this[_0xc6bf('0x9')][_0x51d2ea['uniqueid']][_0xc6bf('0x56')];logger[_0xc6bf('0x18')]('[%s][voiceDialReport][hangup]\x20sending\x20voiceDialReport\x20event:',_0x51d2ea['uniqueid'],util[_0xc6bf('0x1a')](this['channels'][_0x51d2ea[_0xc6bf('0x1b')]],{'showHidden':![],'depth':null}));ami['emit']('custom:voiceDialReport',this[_0xc6bf('0x9')][_0x51d2ea[_0xc6bf('0x1b')]]);logger[_0xc6bf('0x18')](_0xc6bf('0x62'),_0x51d2ea['uniqueid'],util[_0xc6bf('0x1a')](this[_0xc6bf('0x9')][_0x51d2ea[_0xc6bf('0x1b')]],{'showHidden':![],'depth':null}));ami[_0xc6bf('0x16')](_0xc6bf('0x63'),this[_0xc6bf('0x9')][_0x51d2ea[_0xc6bf('0x1b')]]);logger[_0xc6bf('0x18')]('[%s][voiceDialReport][hangup]\x20sending\x20voice_outbound:save\x20event:',_0x51d2ea[_0xc6bf('0x1b')],util[_0xc6bf('0x1a')](this['channels'][_0x51d2ea['uniqueid']],{'showHidden':![],'depth':null}));this[_0xc6bf('0x16')](_0xc6bf('0x29'),_0xc6bf('0x64'),this[_0xc6bf('0xb')]);logger[_0xc6bf('0x23')]('[DEBUG]\x20Emit\x20voice_outbound_channel:remove\x20event',JSON['stringify'](this[_0xc6bf('0x9')][_0x51d2ea['uniqueid']]));logger['debug'](_0xc6bf('0x65'),_0x51d2ea[_0xc6bf('0x1b')],util['inspect'](this['channels'][_0x51d2ea['uniqueid']],{'showHidden':![],'depth':null}));this['emit']('voice:outbound',_0xc6bf('0x66'),this[_0xc6bf('0x9')][_0x51d2ea[_0xc6bf('0x1b')]]);delete this[_0xc6bf('0x9')][_0x51d2ea[_0xc6bf('0x1b')]];}else if(this[_0xc6bf('0x9')][_0x51d2ea[_0xc6bf('0x67')]]){this[_0xc6bf('0x9')][_0x51d2ea[_0xc6bf('0x67')]][_0xc6bf('0x1b')]=this[_0xc6bf('0x9')][_0x51d2ea[_0xc6bf('0x67')]]['destuniqueid'];}if(this[_0xc6bf('0xc')][_0x51d2ea['uniqueid']]){delete this[_0xc6bf('0xc')][_0x51d2ea[_0xc6bf('0x1b')]];}}}catch(_0x5d2dc7){logger[_0xc6bf('0x2c')](_0xc6bf('0x68'),_0x51d2ea['uniqueid'],util[_0xc6bf('0x1a')](_0x5d2dc7,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0xc6bf('0x17')][_0xc6bf('0x13')]=function(_0x5ffdf3){try{if(this[_0xc6bf('0x15')](_0x5ffdf3)){logger[_0xc6bf('0x18')](_0xc6bf('0x69'),_0x5ffdf3[_0xc6bf('0x1b')],util['inspect'](_0x5ffdf3,{'showHidden':![],'depth':null}));if(_0x5ffdf3[_0xc6bf('0x6a')][_0xc6bf('0x6b')]()===_0xc6bf('0x6c')){_0x5ffdf3[_0xc6bf('0x6d')]=(_0x5ffdf3[_0xc6bf('0x6e')]||_0x5ffdf3[_0xc6bf('0x6d')])[_0xc6bf('0x6b')]();if(_[_0xc6bf('0x6f')](_0x5ffdf3['applicationdata'],'cdr(')){if(_[_0xc6bf('0x41')](this[_0xc6bf('0x28')][_0x5ffdf3[_0xc6bf('0x1b')]]))this['applications'][_0x5ffdf3[_0xc6bf('0x1b')]]={};logger['info']('[%s][voiceDialReport][newexten]\x20application:%s\x20appdata:%s',_0x5ffdf3[_0xc6bf('0x1b')],_0x5ffdf3['application'],_0x5ffdf3[_0xc6bf('0x6d')]);var _0x4cb628=_0x5ffdf3['applicationdata']['split']('=');var _0x4afefe=_0x4cb628[0x0]['match'](/cdr\((.*)\)/);if(_0x4afefe)this[_0xc6bf('0x28')][_0x5ffdf3[_0xc6bf('0x1b')]][_0x4afefe[0x1]]=_0x4cb628[0x1];}}}}catch(_0x3378e1){logger[_0xc6bf('0x2c')](_0xc6bf('0x70'),_0x5ffdf3[_0xc6bf('0x1b')],util[_0xc6bf('0x1a')](_0x3378e1,{'showHidden':![],'depth':null}));}};module[_0xc6bf('0x71')]=VoiceDialReport; \ No newline at end of file diff --git a/server/services/ami/report/voiceQueueReport.js b/server/services/ami/report/voiceQueueReport.js index 6f75881..90bdae1 100644 --- a/server/services/ami/report/voiceQueueReport.js +++ b/server/services/ami/report/voiceQueueReport.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd691=['ioredis','../../../config/environment','../../../config/logger','ami','../ami','../model/queueReport','redis','defaults','localhost','prototype','tail','sequence','queueReports','agents','voiceQueues','flagQueueSummary','campaigns','variables','queuesummary','syncQueueSummary','bind','queuesummarycomplete','syncQueueSummaryComplete','queuecallerjoin','queuecallerabandon','syncQueueCallerAbandon','queuecallerleave','syncQueueCallerLeave','syncAgentComplete','agentconnect','varset','syncVarSet','syncHangup','fullybooted','syncFullyBooted','newexten','syncNewExten','syncMusicOnHoldStart','musiconholdstop','syncMusicOnHoldStop','attendedtransfer','syncAttendedTransfer','loopQueueSummary','loopQueueShow','isEmpty','hasOwnProperty','originated','talking','pTalking','waiting','queueStatusComplete','unlockRR','channels','enqueue','Action','status','channel','catch','message','No\x20such\x20channel','error','[%s][voiceQueueReport][checkChannel]','inspect','[%s][voiceQueueReport][checkQueueReport]','[%s][voiceQueueReport][checkVariables]','[FullyBooted]\x20clear\x20realtime','clearQueueReport','emitVoiceQueueChannelRemove','clearqueuereport','emit','debug','[%s][voiceQueueReport][',']\x20sending\x20voice_queue_channel:save\x20event:','uniqueid','format','voice:queue:%s','voice_queue_channel:save','voice_queue_presence:save',']\x20sending\x20voice_queue_channel:remove\x20event:','name','emitVoiceQueueSummary','type','inbound','strategy','answered','available','loggedIn','sumBillable','sumDuration','sumHoldTime','total','unmanaged','abandoned','Trunk','Interval','md5','[voiceQueueReport][',']\x20sending\x20voice_queue:save\x20event:','voice_queue:save','isNotNull','isUndefined','queues','then','[voiceQueueReport][queuesummary]','queue','[voiceQueueReport][queuesummary]\x20event:','[voiceQueueReport][queuesummary]\x20name:%s','countBy','callers','toNumber','loggedin','[voiceQueueReport][queuesummarycomplete]\x20event:','syncQueueCallerJoin','[%s][voiceQueueReport][queuecallerjoin]','YYYY-MM-DD\x20HH:mm:ss','position','count','routealias','[voiceQueueReport][queuecallerjoin]\x20name:%s\x20type:%s','merge','keys','push','emitVoiceQueueChannelSave','last','queuecallercomplete','queuecallercompleteAt','holdtime','originalposition','queuecallerabandonAt','queuecallerexitreason','ABANDONED','lastAssignedTo','[voiceQueueReport][queuecallerabandon]\x20name:%s\x20type:%s','queuecallerleaveAt','connectedlinenum','connectedlinename','info','[%s][voiceQueueReport][queuecallerleave]','syncAgentConnect','[%s][voiceQueueReport][agentconnect]','[voiceQueueReport][agentconnect]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETEDBYAGENT','assigned','membername','queuecallerexit','queuecallerexitAt','transfer','reason','[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETED','startsWith','toLowerCase','local/','linkedid','queuecallerjoinAt','seconds','FORWARDTRANSFER','transfertype','transferexten','destexten','transferuniqueid','[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:FORWARDTRANSFER','COMPLETEDBY','toUpperCase','[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:%s','agentcomplete','[%s][voiceQueueReport][agentcomplete]','[%s][voiceQueueReport][varset]','addVariable','variable','value','queuestatus','CONTINUE','TIMEOUT','lastevent','timeout','[%s][voiceQueueReport][varset]\x20sending\x20timeout\x20event:','custom:timeout','queueposition','[%s][voiceQueueReport][varset]\x20name:%s\x20type:%s\x20variable:%s\x20value:%s','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqosrtt','sipuri','bridgepeer','bridgepvtcallid','membercalls','memberdynamic','memberinterface','memberpenalty','memberrealtime','isNil','includes','[%s][voiceQueueReport][hangup]','diff','length','milliseconds','[%s][voiceQueueReport][hangup]\x20sending\x20queuecallerunmanaged\x20event:','custom:queuecallerunmanaged','hangup','[%s][voiceQueueReport][hangup]\x20sending\x20voiceQueueReport\x20event:','[%s][voiceQueueReport][attendedtransfer]','transfereeuniqueid','secondtransfererexten','secondtransfereruniqueid','switch','transfertargetuniqueid','origtransfererexten','origtransfereruniqueid','ATTENDEDTRANSFER','ATTENDED','syncBlindTransfer','[%s][voiceQueueReport][blindtransfer]','[%s][voiceQueueReport][blindTransfer]\x20name:%s\x20type:%s\x20transferexten:%s\x20transferuniqueid:%s','BlindTransfer','transfererchannel','[%s][voiceQueueReport][musiconholdstart]','mohstarttime','[%s][voiceQueueReport][musiconholdstart]\x20mohstarttime:%s','[%s][voiceQueueReport][musiconholdstop]','mohtime','application','set','applicationdata','appdata','CDR(routeAlias)','cdr(','[%s][voiceQueueReport][newexten]\x20application:%s\x20appdata:%s','split','exports','lodash','moment','util'];(function(_0x243b59,_0x3f9495){var _0x3e1676=function(_0x354052){while(--_0x354052){_0x243b59['push'](_0x243b59['shift']());}};_0x3e1676(++_0x3f9495);}(_0xd691,0xe6));var _0x1d69=function(_0x3c4e48,_0x43a5eb){_0x3c4e48=_0x3c4e48-0x0;var _0x37fd7e=_0xd691[_0x3c4e48];return _0x37fd7e;};'use strict';var _=require(_0x1d69('0x0'));var moment=require(_0x1d69('0x1'));var util=require(_0x1d69('0x2'));var md5=require('md5');var Redis=require(_0x1d69('0x3'));var config=require(_0x1d69('0x4'));var logger=require(_0x1d69('0x5'))(_0x1d69('0x6'));var ami=require(_0x1d69('0x7'));var QueueReport=require(_0x1d69('0x8'));config[_0x1d69('0x9')]=_[_0x1d69('0xa')](config[_0x1d69('0x9')],{'host':_0x1d69('0xb'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));var Sequence=function(){};Sequence[_0x1d69('0xc')]['enqueue']=function(_0x369d44){this[_0x1d69('0xd')]=this[_0x1d69('0xd')]?this[_0x1d69('0xd')]['finally'](_0x369d44):_0x369d44();};function VoiceQueueReport(_0x298c17){this[_0x1d69('0xe')]=new Sequence();this[_0x1d69('0xf')]={};this[_0x1d69('0x10')]=_0x298c17[_0x1d69('0x10')];this['channels']=_0x298c17['queueChannels'];this[_0x1d69('0x11')]=_0x298c17[_0x1d69('0x11')];this[_0x1d69('0x12')]=!![];this[_0x1d69('0x13')]=_0x298c17[_0x1d69('0x13')];this[_0x1d69('0x14')]={};ami['on'](_0x1d69('0x15'),this[_0x1d69('0x16')][_0x1d69('0x17')](this));ami['on'](_0x1d69('0x18'),this[_0x1d69('0x19')][_0x1d69('0x17')](this));ami['on'](_0x1d69('0x1a'),this['syncQueueCallerJoin']['bind'](this));ami['on'](_0x1d69('0x1b'),this[_0x1d69('0x1c')][_0x1d69('0x17')](this));ami['on'](_0x1d69('0x1d'),this[_0x1d69('0x1e')][_0x1d69('0x17')](this));ami['on']('agentcomplete',this[_0x1d69('0x1f')][_0x1d69('0x17')](this));ami['on'](_0x1d69('0x20'),this['syncAgentConnect']['bind'](this));ami['on'](_0x1d69('0x21'),this[_0x1d69('0x22')][_0x1d69('0x17')](this));ami['on']('hangup',this[_0x1d69('0x23')][_0x1d69('0x17')](this));ami['on'](_0x1d69('0x24'),this[_0x1d69('0x25')][_0x1d69('0x17')](this));ami['on'](_0x1d69('0x26'),this[_0x1d69('0x27')][_0x1d69('0x17')](this));ami['on']('musiconholdstart',this[_0x1d69('0x28')][_0x1d69('0x17')](this));ami['on'](_0x1d69('0x29'),this[_0x1d69('0x2a')]['bind'](this));ami['on'](_0x1d69('0x2b'),this[_0x1d69('0x2c')][_0x1d69('0x17')](this));ami['on']('blindtransfer',this['syncBlindTransfer']['bind'](this));this[_0x1d69('0x2d')]();this[_0x1d69('0x2e')]();}function clearChannels(_0x1d4e16){if(!_[_0x1d69('0x2f')](_0x1d4e16)){for(var _0x4f4449 in _0x1d4e16){if(_0x1d4e16[_0x1d69('0x30')](_0x4f4449)){delete _0x1d4e16[_0x4f4449];}}}}function clearCampaigns(_0x33b5e9){if(!_['isEmpty'](_0x33b5e9)){for(var _0x377913 in _0x33b5e9){if(_0x33b5e9[_0x1d69('0x30')](_0x377913)){_0x33b5e9[_0x377913][_0x1d69('0x31')]=0x0;}}}}function clearVoiceQueues(_0x30aefe){if(!_[_0x1d69('0x2f')](_0x30aefe)){for(var _0x247130 in _0x30aefe){if(_0x30aefe['hasOwnProperty'](_0x247130)){_0x30aefe[_0x247130][_0x1d69('0x31')]=0x0;_0x30aefe[_0x247130][_0x1d69('0x32')]=0x0;_0x30aefe[_0x247130][_0x1d69('0x33')]=0x0;_0x30aefe[_0x247130][_0x1d69('0x34')]=0x0;_0x30aefe[_0x247130][_0x1d69('0x35')]=!![];}}}}function clearAgentBooked(_0x1e5818){if(!_[_0x1d69('0x2f')](_0x1e5818)){for(var _0x215052 in _0x1e5818){if(_0x1e5818[_0x1d69('0x30')](_0x215052)){_0x1e5818[_0x215052][_0x1d69('0x36')]=!![];}}}}VoiceQueueReport[_0x1d69('0xc')]['clearZombieChannels']=function(){var _0x3affc9=this;for(var _0x5bbbe3 in this[_0x1d69('0x37')]){if(this[_0x1d69('0x37')][_0x1d69('0x30')](_0x5bbbe3)&&!this[_0x1d69('0x37')][_0x5bbbe3]['switch']){this['sequence'][_0x1d69('0x38')](function(){if(!_['isNil'](_0x3affc9[_0x1d69('0x37')][_0x5bbbe3])){return ami[_0x1d69('0x39')]({'action':_0x1d69('0x3a'),'channel':_0x3affc9[_0x1d69('0x37')][_0x5bbbe3][_0x1d69('0x3b')]})[_0x1d69('0x3c')](function(_0x2567ef){if(_0x2567ef[_0x1d69('0x3d')]===_0x1d69('0x3e')){setTimeout(function(){if(_0x3affc9[_0x1d69('0x37')][_0x5bbbe3]){delete _0x3affc9[_0x1d69('0x37')][_0x5bbbe3];logger[_0x1d69('0x3f')](_0x1d69('0x40'),_0x5bbbe3,util[_0x1d69('0x41')](_0x2567ef,{'showHidden':![],'depth':null}));}if(_0x3affc9['queueReports'][_0x5bbbe3]){delete _0x3affc9[_0x1d69('0xf')][_0x5bbbe3];logger[_0x1d69('0x3f')](_0x1d69('0x42'),_0x5bbbe3,util[_0x1d69('0x41')](_0x2567ef,{'showHidden':![],'depth':null}));}if(_0x3affc9[_0x1d69('0x14')][_0x5bbbe3]){delete _0x3affc9['variables'][_0x5bbbe3];logger[_0x1d69('0x3f')](_0x1d69('0x43'),_0x5bbbe3,util[_0x1d69('0x41')](_0x2567ef,{'showHidden':![],'depth':null}));}},0x1f40);}});}});}}};VoiceQueueReport[_0x1d69('0xc')]['syncFullyBooted']=function(){logger[_0x1d69('0x3f')](_0x1d69('0x44'));clearChannels(this[_0x1d69('0x37')]);this[_0x1d69('0x45')](this[_0x1d69('0xf')]);clearAgentBooked(this['agents']);clearVoiceQueues(this['voiceQueues']);clearCampaigns(this['campaigns']);};VoiceQueueReport[_0x1d69('0xc')][_0x1d69('0x45')]=function(_0x5c8d79){var _0x2dc896=this;if(!_[_0x1d69('0x2f')](_0x5c8d79)){for(var _0x23032f in _0x5c8d79){if(_0x5c8d79['hasOwnProperty'](_0x23032f)){_0x2dc896[_0x1d69('0x46')](_0x5c8d79[_0x23032f],_0x1d69('0x47'));delete _0x5c8d79[_0x23032f];}}}};VoiceQueueReport[_0x1d69('0xc')][_0x1d69('0x48')]=function(_0x4d0224,_0x42abeb,_0x353a83){io['to'](_0x4d0224)[_0x1d69('0x48')](_0x42abeb,_0x353a83);};VoiceQueueReport[_0x1d69('0xc')]['emitVoiceQueueChannelSave']=function(_0x1a46ae,_0x22d6e4){logger[_0x1d69('0x49')](_0x1d69('0x4a')+_0x22d6e4+_0x1d69('0x4b'),_0x1a46ae[_0x1d69('0x4c')],util[_0x1d69('0x41')](_0x1a46ae,{'showHidden':![],'depth':null}));this['emit'](util[_0x1d69('0x4d')](_0x1d69('0x4e'),_0x1a46ae['name']),_0x1d69('0x4f'),_0x1a46ae);io['emit'](_0x1d69('0x50'),_0x1a46ae);};VoiceQueueReport[_0x1d69('0xc')][_0x1d69('0x46')]=function(_0xc052d6,_0x5b0a74){logger[_0x1d69('0x49')](_0x1d69('0x4a')+_0x5b0a74+_0x1d69('0x51'),_0xc052d6['uniqueid'],util[_0x1d69('0x41')](_0xc052d6,{'showHidden':![],'depth':null}));this['emit'](util['format'](_0x1d69('0x4e'),_0xc052d6[_0x1d69('0x52')]),'voice_queue_channel:remove',_0xc052d6);io[_0x1d69('0x48')]('voice_queue_presence:remove',_0xc052d6);};VoiceQueueReport[_0x1d69('0xc')][_0x1d69('0x53')]=function(_0x511f5f,_0x3c57ba){if(_0x511f5f[_0x1d69('0x54')]===_0x1d69('0x55')){var _0x555dd2={'id':_0x511f5f['id'],'name':_0x511f5f[_0x1d69('0x52')],'strategy':_0x511f5f[_0x1d69('0x56')],'answered':_0x511f5f[_0x1d69('0x57')],'available':_0x511f5f[_0x1d69('0x58')],'loggedIn':_0x511f5f[_0x1d69('0x59')],'pTalking':_0x511f5f[_0x1d69('0x33')],'sumBillable':_0x511f5f[_0x1d69('0x5a')],'sumDuration':_0x511f5f[_0x1d69('0x5b')],'sumHoldTime':_0x511f5f[_0x1d69('0x5c')]||0x0,'talking':_0x511f5f[_0x1d69('0x32')],'total':_0x511f5f[_0x1d69('0x5d')],'type':_0x511f5f[_0x1d69('0x54')],'unmanaged':_0x511f5f[_0x1d69('0x5e')],'abandoned':_0x511f5f[_0x1d69('0x5f')],'waiting':_0x511f5f[_0x1d69('0x34')]};if(_0x511f5f[_0x1d69('0x60')]){_0x555dd2['Trunk']={'id':_0x511f5f[_0x1d69('0x60')]['id'],'name':_0x511f5f[_0x1d69('0x60')][_0x1d69('0x52')],'active':_0x511f5f['Trunk']['active'],'callerid':_0x511f5f[_0x1d69('0x60')]['callerid']};}if(_0x511f5f[_0x1d69('0x61')]){_0x555dd2[_0x1d69('0x61')]={'id':_0x511f5f[_0x1d69('0x61')]['id'],'name':_0x511f5f['Interval']['name']};}var _0x3c4270=md5(JSON['stringify'](_0x555dd2));if(_0x511f5f[_0x1d69('0x62')]!==_0x3c4270){_0x511f5f['md5']=_0x3c4270;logger['debug'](_0x1d69('0x63')+_0x3c57ba+_0x1d69('0x64'),util[_0x1d69('0x41')](_0x555dd2,{'showHidden':![],'depth':null}));this[_0x1d69('0x48')](util[_0x1d69('0x4d')](_0x1d69('0x4e'),_0x555dd2[_0x1d69('0x52')]),_0x1d69('0x65'),_0x555dd2);}}};VoiceQueueReport['prototype'][_0x1d69('0x66')]=function(_0x384917){return _0x384917!==null&&!_[_0x1d69('0x67')](_0x384917);};VoiceQueueReport[_0x1d69('0xc')]['loopQueueShow']=function(){var _0x10d730=this;setInterval(function(){_0x10d730['clearZombieChannels']();ami[_0x1d69('0x39')]({'action':_0x1d69('0x68')})[_0x1d69('0x3c')](function(_0x478888){logger[_0x1d69('0x3f')]('[voiceQueueReport][queues]',util[_0x1d69('0x41')](_0x478888,{'showHidden':![],'depth':null}));});},0x2710);};VoiceQueueReport[_0x1d69('0xc')][_0x1d69('0x2d')]=function(){var _0x5e82d6=this;setInterval(function(){if(_0x5e82d6[_0x1d69('0x12')]){return ami['Action']({'action':_0x1d69('0x15')})[_0x1d69('0x69')](function(_0x187647){_0x5e82d6[_0x1d69('0x12')]=![];})[_0x1d69('0x3c')](function(_0x429060){logger[_0x1d69('0x3f')](_0x1d69('0x6a'),util[_0x1d69('0x41')](_0x429060,{'showHidden':![],'depth':null}));});}},0x3e8);};VoiceQueueReport[_0x1d69('0xc')][_0x1d69('0x16')]=function(_0xfc58ef){try{if(this[_0x1d69('0x66')](_0xfc58ef)&&this[_0x1d69('0x66')](_0xfc58ef[_0x1d69('0x6b')])){logger[_0x1d69('0x49')](_0x1d69('0x6c'),util['inspect'](_0xfc58ef,{'showHidden':![],'depth':null}));if(this[_0x1d69('0x11')][_0xfc58ef[_0x1d69('0x6b')]]){logger['info'](_0x1d69('0x6d'),_0xfc58ef['queue']);var _0x3b26c6=_[_0x1d69('0x6e')](this['channels'],'queue')[_0xfc58ef[_0x1d69('0x6b')]]||0x0;var _0x3b705d=_0x3b26c6-_0xfc58ef[_0x1d69('0x6f')];if(this[_0x1d69('0x11')][_0xfc58ef['queue']][_0x1d69('0x34')]!==_[_0x1d69('0x70')](_0xfc58ef[_0x1d69('0x6f')])||this[_0x1d69('0x11')][_0xfc58ef[_0x1d69('0x6b')]][_0x1d69('0x59')]!==_[_0x1d69('0x70')](_0xfc58ef[_0x1d69('0x71')])||this[_0x1d69('0x11')][_0xfc58ef[_0x1d69('0x6b')]][_0x1d69('0x58')]!==_[_0x1d69('0x70')](_0xfc58ef[_0x1d69('0x58')])||this['voiceQueues'][_0xfc58ef[_0x1d69('0x6b')]][_0x1d69('0x32')]!==_0x3b705d){this[_0x1d69('0x11')][_0xfc58ef['queue']][_0x1d69('0x34')]=_[_0x1d69('0x70')](_0xfc58ef[_0x1d69('0x6f')]);this[_0x1d69('0x11')][_0xfc58ef[_0x1d69('0x6b')]][_0x1d69('0x59')]=_[_0x1d69('0x70')](_0xfc58ef[_0x1d69('0x71')]);this[_0x1d69('0x11')][_0xfc58ef[_0x1d69('0x6b')]][_0x1d69('0x58')]=_[_0x1d69('0x70')](_0xfc58ef[_0x1d69('0x58')]);this[_0x1d69('0x11')][_0xfc58ef[_0x1d69('0x6b')]]['talking']=_0x3b705d>0x0?_0x3b705d:0x0;this[_0x1d69('0x11')][_0xfc58ef[_0x1d69('0x6b')]][_0x1d69('0x32')]=this[_0x1d69('0x11')][_0xfc58ef[_0x1d69('0x6b')]]['talking']>_[_0x1d69('0x70')](_0xfc58ef[_0x1d69('0x71')])?_[_0x1d69('0x70')](_0xfc58ef['loggedin']):this[_0x1d69('0x11')][_0xfc58ef[_0x1d69('0x6b')]][_0x1d69('0x32')];this['emitVoiceQueueSummary'](this[_0x1d69('0x11')][_0xfc58ef[_0x1d69('0x6b')]],'queuesummary');}logger[_0x1d69('0x49')]('[voiceQueueReport][queuesummary]\x20sending\x20queuesummary\x20event:',util['inspect'](this[_0x1d69('0x11')][_0xfc58ef['queue']],{'showHidden':![],'depth':null}));ami[_0x1d69('0x48')]('custom:queuesummary',this[_0x1d69('0x11')][_0xfc58ef[_0x1d69('0x6b')]]);}}}catch(_0x550c3d){logger[_0x1d69('0x3f')](_0x1d69('0x6a'),util[_0x1d69('0x41')](_0x550c3d,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x1d69('0x19')]=function(_0x4f2fa6){logger[_0x1d69('0x49')](_0x1d69('0x72'),util[_0x1d69('0x41')](_0x4f2fa6,{'showHidden':![],'depth':null}));this[_0x1d69('0x12')]=!![];};VoiceQueueReport[_0x1d69('0xc')][_0x1d69('0x73')]=function(_0x9c50c9){try{if(this[_0x1d69('0x66')](_0x9c50c9)){logger['debug'](_0x1d69('0x74'),_0x9c50c9[_0x1d69('0x4c')],util[_0x1d69('0x41')](_0x9c50c9,{'showHidden':![],'depth':null}));if(_[_0x1d69('0x67')](this[_0x1d69('0xf')][_0x9c50c9['uniqueid']]))this[_0x1d69('0xf')][_0x9c50c9[_0x1d69('0x4c')]]=[];if(_[_0x1d69('0x67')](this[_0x1d69('0x37')][_0x9c50c9[_0x1d69('0x4c')]]))this[_0x1d69('0x37')][_0x9c50c9[_0x1d69('0x4c')]]={};var _0x5f03f9=new QueueReport();_0x5f03f9[_0x1d69('0x52')]=_0x9c50c9[_0x1d69('0x6b')];_0x5f03f9['type']=this[_0x1d69('0x11')][_0x5f03f9[_0x1d69('0x52')]]&&this[_0x1d69('0x11')][_0x5f03f9['name']]['type']?this[_0x1d69('0x11')][_0x5f03f9['name']][_0x1d69('0x54')]||_0x1d69('0x55'):'inbound';_0x5f03f9[_0x1d69('0x6b')]=_0x9c50c9[_0x1d69('0x6b')];_0x5f03f9['queuecallerjoinAt']=moment()[_0x1d69('0x4d')](_0x1d69('0x75'));_0x5f03f9['position']=_0x9c50c9[_0x1d69('0x76')];_0x5f03f9['count']=_0x9c50c9[_0x1d69('0x77')];_0x5f03f9['uniqueid']=_0x9c50c9[_0x1d69('0x4c')];_0x5f03f9['routealias']=this['channels'][_0x9c50c9[_0x1d69('0x4c')]][_0x1d69('0x78')];logger['info'](_0x1d69('0x79'),_0x5f03f9[_0x1d69('0x52')],_0x5f03f9['type']);_[_0x1d69('0x7a')](_0x5f03f9,_['pick'](_0x9c50c9,_[_0x1d69('0x7b')](_0x5f03f9)));this[_0x1d69('0xf')][_0x9c50c9['uniqueid']][_0x1d69('0x7c')](_0x5f03f9);this[_0x1d69('0x37')][_0x9c50c9[_0x1d69('0x4c')]]=_0x5f03f9;this[_0x1d69('0x7d')](_0x5f03f9,_0x1d69('0x1a'));}}catch(_0xc38b46){logger[_0x1d69('0x3f')]('[%s][voiceQueueReport][queuecallerjoin]',_0x9c50c9[_0x1d69('0x4c')],util['inspect'](_0xc38b46,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x1d69('0xc')]['syncQueueCallerAbandon']=function(_0x473e67){try{if(this[_0x1d69('0x66')](_0x473e67)){logger[_0x1d69('0x49')]('[%s][voiceQueueReport][queuecallerabandon]',_0x473e67[_0x1d69('0x4c')],util[_0x1d69('0x41')](_0x473e67,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x473e67[_0x1d69('0x4c')]]){var _0x563481=_[_0x1d69('0x7e')](this[_0x1d69('0xf')][_0x473e67[_0x1d69('0x4c')]]);_0x563481[_0x1d69('0x7f')]=![];_0x563481[_0x1d69('0x80')]=null;_0x563481[_0x1d69('0x81')]=_0x473e67[_0x1d69('0x81')];_0x563481[_0x1d69('0x82')]=_0x473e67[_0x1d69('0x82')];_0x563481[_0x1d69('0x1b')]=!![];_0x563481[_0x1d69('0x83')]=moment()[_0x1d69('0x4d')](_0x1d69('0x75'));_0x563481[_0x1d69('0x84')]=_0x1d69('0x85');_0x563481[_0x1d69('0x86')]=null;logger['info'](_0x1d69('0x87'),_0x563481['name'],_0x563481[_0x1d69('0x54')]);this[_0x1d69('0x37')][_0x473e67[_0x1d69('0x4c')]]=_0x563481;this[_0x1d69('0x46')](_0x563481,_0x1d69('0x1b'));}}}catch(_0x25c568){logger[_0x1d69('0x3f')]('[%s][voiceQueueReport][queuecallerabandon]',_0x473e67[_0x1d69('0x4c')],util['inspect'](_0x25c568,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x1d69('0xc')][_0x1d69('0x1e')]=function(_0x1fb525){try{if(this[_0x1d69('0x66')](_0x1fb525)){logger[_0x1d69('0x49')]('[%s][voiceQueueReport][queuecallerleave]',_0x1fb525[_0x1d69('0x4c')],util[_0x1d69('0x41')](_0x1fb525,{'showHidden':![],'depth':null}));if(this[_0x1d69('0xf')][_0x1fb525['uniqueid']]){var _0x59e66d=_[_0x1d69('0x7e')](this[_0x1d69('0xf')][_0x1fb525[_0x1d69('0x4c')]]);_0x59e66d[_0x1d69('0x88')]=moment()[_0x1d69('0x4d')](_0x1d69('0x75'));_0x59e66d[_0x1d69('0x89')]=_0x1fb525[_0x1d69('0x89')];_0x59e66d[_0x1d69('0x8a')]=_0x1fb525['connectedlinename'];logger[_0x1d69('0x8b')]('[voiceQueueReport][queuecallerleave]\x20name:%s\x20type:%s\x20connectedlinenum:%s\x20connectedlinename:%s',_0x59e66d[_0x1d69('0x52')],_0x59e66d['type'],_0x1fb525[_0x1d69('0x89')],_0x1fb525[_0x1d69('0x8a')]);this[_0x1d69('0x37')][_0x1fb525[_0x1d69('0x4c')]]=_0x59e66d;this['emitVoiceQueueChannelSave'](_0x59e66d,_0x1d69('0x1d'));}}}catch(_0x3574de){logger[_0x1d69('0x3f')](_0x1d69('0x8c'),_0x1fb525[_0x1d69('0x4c')],util[_0x1d69('0x41')](_0x3574de,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x1d69('0xc')][_0x1d69('0x8d')]=function(_0x78f5ca){try{if(this[_0x1d69('0x66')](_0x78f5ca)){logger[_0x1d69('0x49')](_0x1d69('0x8e'),_0x78f5ca[_0x1d69('0x4c')],util[_0x1d69('0x41')](_0x78f5ca,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x78f5ca[_0x1d69('0x4c')]]){var _0x2ce132=_[_0x1d69('0x7e')](this[_0x1d69('0xf')][_0x78f5ca[_0x1d69('0x4c')]]);_0x2ce132[_0x1d69('0x7f')]=!![];_0x2ce132[_0x1d69('0x84')]='COMPLETEDBYAGENT';logger[_0x1d69('0x8b')](_0x1d69('0x8f'),_0x2ce132[_0x1d69('0x52')],_0x2ce132[_0x1d69('0x54')]);}}}catch(_0x29b220){logger[_0x1d69('0x3f')]('[%s][voiceQueueReport][agentconnect]',_0x78f5ca['uniqueid'],util[_0x1d69('0x41')](_0x29b220,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x1d69('0xc')][_0x1d69('0x1f')]=function(_0x1a68a1){try{if(this[_0x1d69('0x66')](_0x1a68a1)){logger[_0x1d69('0x49')]('[%s][voiceQueueReport][agentcomplete]',_0x1a68a1[_0x1d69('0x4c')],util[_0x1d69('0x41')](_0x1a68a1,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x1a68a1[_0x1d69('0x4c')]]){var _0x5b0061=_['last'](this[_0x1d69('0xf')][_0x1a68a1[_0x1d69('0x4c')]]);_0x5b0061[_0x1d69('0x1b')]=![];_0x5b0061[_0x1d69('0x83')]=null;_0x5b0061[_0x1d69('0x90')]=!![];_0x5b0061[_0x1d69('0x86')]=_0x1a68a1[_0x1d69('0x91')];_0x5b0061['holdtime']=_0x1a68a1['holdtime'];_0x5b0061[_0x1d69('0x7f')]=!![];_0x5b0061[_0x1d69('0x92')]=![];_0x5b0061[_0x1d69('0x93')]=null;if(!_0x5b0061[_0x1d69('0x94')]){if(_0x1a68a1[_0x1d69('0x95')]==_0x1d69('0x94')){_0x5b0061[_0x1d69('0x84')]='COMPLETED';logger[_0x1d69('0x8b')](_0x1d69('0x96'),_0x5b0061[_0x1d69('0x52')],_0x5b0061['type']);}else{if(_[_0x1d69('0x97')](_0x1a68a1[_0x1d69('0x3b')][_0x1d69('0x98')](),_0x1d69('0x99'))){if(this[_0x1d69('0xf')][_0x1a68a1[_0x1d69('0x9a')]]){var _0x5736e1=_[_0x1d69('0x7e')](this[_0x1d69('0xf')][_0x1a68a1[_0x1d69('0x9a')]]);_0x5736e1[_0x1d69('0x7f')]=![];_0x5736e1[_0x1d69('0x92')]=!![];_0x5736e1[_0x1d69('0x93')]=moment(_0x5b0061[_0x1d69('0x9b')])['add'](_0x1a68a1[_0x1d69('0x81')],_0x1d69('0x9c'))['format'](_0x1d69('0x75'));_0x5736e1[_0x1d69('0x84')]=_0x1d69('0x9d');_0x5736e1[_0x1d69('0x94')]=!![];_0x5736e1[_0x1d69('0x9e')]='FORWARD';_0x5736e1[_0x1d69('0x9f')]=_0x1a68a1[_0x1d69('0xa0')];_0x5736e1[_0x1d69('0xa1')]=_0x1a68a1['uniqueid'];logger[_0x1d69('0x8b')](_0x1d69('0xa2'),_0x5736e1[_0x1d69('0x52')],_0x5736e1[_0x1d69('0x54')]);var _0x12726f=this['queueReports'][_0x1a68a1[_0x1d69('0x9a')]];this[_0x1d69('0xf')][_0x1a68a1[_0x1d69('0x9a')]]=this['queueReports'][_0x1a68a1[_0x1d69('0x4c')]];this[_0x1d69('0xf')][_0x1a68a1[_0x1d69('0x4c')]]=_0x12726f;}}else{_0x5b0061[_0x1d69('0x84')]=_0x1d69('0xa3')+_0x1a68a1[_0x1d69('0x95')][_0x1d69('0xa4')]();logger['info'](_0x1d69('0xa5'),_0x5b0061[_0x1d69('0x52')],_0x5b0061[_0x1d69('0x54')],_0x5b0061[_0x1d69('0x84')]);}}}this[_0x1d69('0x37')][_0x1a68a1['uniqueid']]=_0x5b0061;this[_0x1d69('0x46')](_0x5b0061,_0x1d69('0xa6'));}}}catch(_0x54d83a){logger['error'](_0x1d69('0xa7'),_0x1a68a1['uniqueid'],util['inspect'](_0x54d83a,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x1d69('0xc')][_0x1d69('0x22')]=function(_0x25c5a5){try{if(this['isNotNull'](_0x25c5a5)){logger[_0x1d69('0x49')](_0x1d69('0xa8'),_0x25c5a5['uniqueid'],util[_0x1d69('0x41')](_0x25c5a5,{'showHidden':![],'depth':null}));this[_0x1d69('0xa9')](_0x25c5a5[_0x1d69('0x4c')],_[_0x1d69('0x7b')](_0x25c5a5[_0x1d69('0xaa')])[0x0],_0x25c5a5[_0x1d69('0xab')]);if(this[_0x1d69('0xf')][_0x25c5a5['uniqueid']]){var _0x18f002=_['last'](this[_0x1d69('0xf')][_0x25c5a5[_0x1d69('0x4c')]]);if(_0x18f002){if(this['isNotNull'](_0x25c5a5[_0x1d69('0xaa')])&&this[_0x1d69('0x66')](_0x25c5a5['variable'][_0x1d69('0xac')])){switch(_0x25c5a5[_0x1d69('0xab')]){case _0x1d69('0xad'):_0x18f002[_0x1d69('0x92')]=![];_0x18f002[_0x1d69('0x93')]=null;break;case _0x1d69('0xae'):_0x18f002[_0x1d69('0xaf')]=_0x1d69('0xb0');_0x18f002['queuecallerexit']=!![];_0x18f002[_0x1d69('0x93')]=moment()['format'](_0x1d69('0x75'));_0x18f002['queuecallerleaveAt']=moment()[_0x1d69('0x4d')]('YYYY-MM-DD\x20HH:mm:ss');logger['debug'](_0x1d69('0xb1'),_0x25c5a5[_0x1d69('0x4c')],util['inspect'](_0x18f002,{'showHidden':![],'depth':null}));ami[_0x1d69('0x48')](_0x1d69('0xb2'),_0x18f002);break;default:_0x18f002[_0x1d69('0x92')]=!![];_0x18f002['queuecallerexitAt']=moment()[_0x1d69('0x4d')]('YYYY-MM-DD\x20HH:mm:ss');_0x18f002[_0x1d69('0x88')]=moment()['format'](_0x1d69('0x75'));}_0x18f002[_0x1d69('0x1b')]=![];_0x18f002[_0x1d69('0x83')]=null;_0x18f002[_0x1d69('0x84')]=_0x25c5a5[_0x1d69('0xab')];this['channels'][_0x25c5a5[_0x1d69('0x4c')]]=_0x18f002;this[_0x1d69('0x46')](_0x18f002,_0x1d69('0x21'));}else if(this[_0x1d69('0x66')](_0x25c5a5[_0x1d69('0xaa')])&&this[_0x1d69('0x66')](_0x25c5a5[_0x1d69('0xaa')][_0x1d69('0xb3')])){if(!_0x18f002['queuecallerabandon']){_0x18f002[_0x1d69('0x92')]=!![];_0x18f002[_0x1d69('0x93')]=moment()[_0x1d69('0x4d')](_0x1d69('0x75'));_0x18f002[_0x1d69('0x84')]='EXITWITHKEY';_0x18f002[_0x1d69('0x88')]=moment()[_0x1d69('0x4d')](_0x1d69('0x75'));this[_0x1d69('0x37')][_0x25c5a5[_0x1d69('0x4c')]]=_0x18f002;}}logger[_0x1d69('0x8b')](_0x1d69('0xb4'),_0x25c5a5[_0x1d69('0x4c')],_0x18f002['name'],_0x18f002[_0x1d69('0x54')],_[_0x1d69('0x7b')](_0x25c5a5[_0x1d69('0xaa')])[0x0],_0x25c5a5[_0x1d69('0xab')]);_0x18f002[_0x1d69('0x14')]=this[_0x1d69('0x14')][_0x25c5a5['uniqueid']];}}}}catch(_0x1504cb){logger[_0x1d69('0x3f')](_0x1d69('0xa8'),_0x25c5a5['uniqueid'],util[_0x1d69('0x41')](_0x1504cb,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x1d69('0xc')][_0x1d69('0xa9')]=function(_0x4d25db,_0x4b905e,_0x1316ba){var _0x481272=[_0x1d69('0xb5'),_0x1d69('0xb6'),'rtpaudioqosjitter',_0x1d69('0xb7'),_0x1d69('0xb8'),'rtpaudioqoslossbridged',_0x1d69('0xb9'),'rtpaudioqosrttbridged','sipcallid',_0x1d69('0xba'),_0x1d69('0xbb'),_0x1d69('0xbc'),_0x1d69('0xbd'),_0x1d69('0xbe'),_0x1d69('0xbf'),'memberlastcall',_0x1d69('0x91'),_0x1d69('0xc0'),_0x1d69('0xc1')];if(!_[_0x1d69('0xc2')](_0x4b905e)&&!_[_0x1d69('0xc3')](_0x481272,_0x4b905e)){if(_['isUndefined'](this[_0x1d69('0x14')][_0x4d25db])){this[_0x1d69('0x14')][_0x4d25db]={};}this[_0x1d69('0x14')][_0x4d25db][_0x4b905e]=_0x1316ba;}};VoiceQueueReport[_0x1d69('0xc')]['syncHangup']=function(_0x488db8){try{if(this[_0x1d69('0x66')](_0x488db8)){logger[_0x1d69('0x49')](_0x1d69('0xc4'),_0x488db8['uniqueid'],util['inspect'](_0x488db8,{'showHidden':![],'depth':null}));if(this[_0x1d69('0xf')][_0x488db8[_0x1d69('0x4c')]]){for(var _0x40a740=0x0,_0x573f07={};_0x40a7400x0?_0x574260:0x0;this[_0x5ad9('0xf')][_0x5c6627[_0x5ad9('0x61')]]['talking']=this[_0x5ad9('0xf')][_0x5c6627[_0x5ad9('0x61')]]['talking']>_[_0x5ad9('0x65')](_0x5c6627[_0x5ad9('0x66')])?_['toNumber'](_0x5c6627[_0x5ad9('0x66')]):this[_0x5ad9('0xf')][_0x5c6627['queue']][_0x5ad9('0x2d')];this[_0x5ad9('0x4a')](this[_0x5ad9('0xf')][_0x5c6627['queue']],_0x5ad9('0x68'));}logger[_0x5ad9('0x40')](_0x5ad9('0x69'),util[_0x5ad9('0x37')](this[_0x5ad9('0xf')][_0x5c6627['queue']],{'showHidden':![],'depth':null}));ami['emit']('custom:queuesummary',this['voiceQueues'][_0x5c6627['queue']]);}}}catch(_0x51da3b){logger['error'](_0x5ad9('0x6a'),util[_0x5ad9('0x37')](_0x51da3b,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x5ad9('0x8')][_0x5ad9('0x14')]=function(_0x225c63){logger[_0x5ad9('0x40')](_0x5ad9('0x6b'),util[_0x5ad9('0x37')](_0x225c63,{'showHidden':![],'depth':null}));this[_0x5ad9('0x10')]=!![];};VoiceQueueReport['prototype'][_0x5ad9('0x16')]=function(_0x36454d){try{if(this['isNotNull'](_0x36454d)){logger[_0x5ad9('0x40')]('[%s][voiceQueueReport][queuecallerjoin]',_0x36454d[_0x5ad9('0x46')],util[_0x5ad9('0x37')](_0x36454d,{'showHidden':![],'depth':null}));if(_[_0x5ad9('0x5d')](this[_0x5ad9('0xc')][_0x36454d[_0x5ad9('0x46')]]))this['queueReports'][_0x36454d['uniqueid']]=[];if(_[_0x5ad9('0x5d')](this[_0x5ad9('0xe')][_0x36454d[_0x5ad9('0x46')]]))this[_0x5ad9('0xe')][_0x36454d[_0x5ad9('0x46')]]={};var _0x3320d5=new QueueReport();_0x3320d5[_0x5ad9('0x44')]=_0x36454d[_0x5ad9('0x61')];_0x3320d5[_0x5ad9('0x6c')]=this[_0x5ad9('0xf')][_0x3320d5[_0x5ad9('0x44')]]&&this[_0x5ad9('0xf')][_0x3320d5[_0x5ad9('0x44')]][_0x5ad9('0x6c')]?this[_0x5ad9('0xf')][_0x3320d5['name']][_0x5ad9('0x6c')]||_0x5ad9('0x4b'):_0x5ad9('0x4b');_0x3320d5[_0x5ad9('0x61')]=_0x36454d['queue'];_0x3320d5[_0x5ad9('0x6d')]=moment()['format'](_0x5ad9('0x6e'));_0x3320d5[_0x5ad9('0x6f')]=_0x36454d[_0x5ad9('0x6f')];_0x3320d5[_0x5ad9('0x70')]=_0x36454d[_0x5ad9('0x70')];_0x3320d5[_0x5ad9('0x46')]=_0x36454d[_0x5ad9('0x46')];_0x3320d5[_0x5ad9('0x71')]=this['channels'][_0x36454d['uniqueid']][_0x5ad9('0x71')];logger[_0x5ad9('0x63')]('[voiceQueueReport][queuecallerjoin]\x20name:%s\x20type:%s',_0x3320d5[_0x5ad9('0x44')],_0x3320d5[_0x5ad9('0x6c')]);_[_0x5ad9('0x72')](_0x3320d5,_[_0x5ad9('0x73')](_0x36454d,_[_0x5ad9('0x74')](_0x3320d5)));this[_0x5ad9('0xc')][_0x36454d[_0x5ad9('0x46')]][_0x5ad9('0x75')](_0x3320d5);this['channels'][_0x36454d['uniqueid']]=_0x3320d5;this['emitVoiceQueueChannelSave'](_0x3320d5,'queuecallerjoin');}}catch(_0x481371){logger[_0x5ad9('0x35')](_0x5ad9('0x76'),_0x36454d[_0x5ad9('0x46')],util[_0x5ad9('0x37')](_0x481371,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x5ad9('0x8')]['syncQueueCallerAbandon']=function(_0x24b146){try{if(this[_0x5ad9('0x5c')](_0x24b146)){logger[_0x5ad9('0x40')](_0x5ad9('0x77'),_0x24b146['uniqueid'],util['inspect'](_0x24b146,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x24b146[_0x5ad9('0x46')]]){var _0x4d87ed=_[_0x5ad9('0x78')](this['queueReports'][_0x24b146['uniqueid']]);_0x4d87ed[_0x5ad9('0x79')]=![];_0x4d87ed[_0x5ad9('0x7a')]=null;_0x4d87ed[_0x5ad9('0x7b')]=_0x24b146[_0x5ad9('0x7b')];_0x4d87ed[_0x5ad9('0x7c')]=_0x24b146[_0x5ad9('0x7c')];_0x4d87ed[_0x5ad9('0x18')]=!![];_0x4d87ed[_0x5ad9('0x7d')]=moment()[_0x5ad9('0x43')]('YYYY-MM-DD\x20HH:mm:ss');_0x4d87ed[_0x5ad9('0x7e')]=_0x5ad9('0x7f');_0x4d87ed[_0x5ad9('0x80')]=null;logger[_0x5ad9('0x63')](_0x5ad9('0x81'),_0x4d87ed[_0x5ad9('0x44')],_0x4d87ed['type']);this[_0x5ad9('0xe')][_0x24b146[_0x5ad9('0x46')]]=_0x4d87ed;this[_0x5ad9('0x3c')](_0x4d87ed,_0x5ad9('0x18'));}}}catch(_0x30742b){logger[_0x5ad9('0x35')](_0x5ad9('0x77'),_0x24b146[_0x5ad9('0x46')],util[_0x5ad9('0x37')](_0x30742b,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x5ad9('0x8')]['syncQueueCallerLeave']=function(_0x435b51){try{if(this[_0x5ad9('0x5c')](_0x435b51)){logger[_0x5ad9('0x40')](_0x5ad9('0x82'),_0x435b51['uniqueid'],util[_0x5ad9('0x37')](_0x435b51,{'showHidden':![],'depth':null}));if(this[_0x5ad9('0xc')][_0x435b51[_0x5ad9('0x46')]]){var _0x1be06c=_[_0x5ad9('0x78')](this[_0x5ad9('0xc')][_0x435b51[_0x5ad9('0x46')]]);_0x1be06c['queuecallerleaveAt']=moment()[_0x5ad9('0x43')](_0x5ad9('0x6e'));_0x1be06c['connectedlinenum']=_0x435b51['connectedlinenum'];_0x1be06c[_0x5ad9('0x83')]=_0x435b51[_0x5ad9('0x83')];logger[_0x5ad9('0x63')](_0x5ad9('0x84'),_0x1be06c[_0x5ad9('0x44')],_0x1be06c['type'],_0x435b51[_0x5ad9('0x85')],_0x435b51[_0x5ad9('0x83')]);this[_0x5ad9('0xe')][_0x435b51[_0x5ad9('0x46')]]=_0x1be06c;this[_0x5ad9('0x3f')](_0x1be06c,_0x5ad9('0x1a'));}}}catch(_0x3cb5b8){logger[_0x5ad9('0x35')](_0x5ad9('0x82'),_0x435b51[_0x5ad9('0x46')],util[_0x5ad9('0x37')](_0x3cb5b8,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x5ad9('0x8')][_0x5ad9('0x1d')]=function(_0xd7efb1){try{if(this[_0x5ad9('0x5c')](_0xd7efb1)){logger[_0x5ad9('0x40')](_0x5ad9('0x86'),_0xd7efb1[_0x5ad9('0x46')],util[_0x5ad9('0x37')](_0xd7efb1,{'showHidden':![],'depth':null}));if(this['queueReports'][_0xd7efb1[_0x5ad9('0x46')]]){var _0x2ee7ff=_[_0x5ad9('0x78')](this[_0x5ad9('0xc')][_0xd7efb1['uniqueid']]);_0x2ee7ff[_0x5ad9('0x79')]=!![];_0x2ee7ff[_0x5ad9('0x7e')]=_0x5ad9('0x87');logger[_0x5ad9('0x63')](_0x5ad9('0x88'),_0x2ee7ff['name'],_0x2ee7ff['type']);}}}catch(_0x4a9160){logger[_0x5ad9('0x35')](_0x5ad9('0x86'),_0xd7efb1[_0x5ad9('0x46')],util[_0x5ad9('0x37')](_0x4a9160,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x5ad9('0x8')][_0x5ad9('0x89')]=function(_0x4d8ffc){try{if(this[_0x5ad9('0x5c')](_0x4d8ffc)){logger[_0x5ad9('0x40')]('[%s][voiceQueueReport][agentcomplete]',_0x4d8ffc[_0x5ad9('0x46')],util[_0x5ad9('0x37')](_0x4d8ffc,{'showHidden':![],'depth':null}));if(this[_0x5ad9('0xc')][_0x4d8ffc[_0x5ad9('0x46')]]){var _0x16525b=_[_0x5ad9('0x78')](this['queueReports'][_0x4d8ffc['uniqueid']]);_0x16525b['queuecallerabandon']=![];_0x16525b[_0x5ad9('0x7d')]=null;_0x16525b[_0x5ad9('0x8a')]=!![];_0x16525b[_0x5ad9('0x80')]=_0x4d8ffc[_0x5ad9('0x8b')];_0x16525b['holdtime']=_0x4d8ffc['holdtime'];_0x16525b[_0x5ad9('0x79')]=!![];_0x16525b[_0x5ad9('0x8c')]=![];_0x16525b[_0x5ad9('0x8d')]=null;if(!_0x16525b[_0x5ad9('0x8e')]){if(_0x4d8ffc[_0x5ad9('0x8f')]=='transfer'){_0x16525b[_0x5ad9('0x7e')]='COMPLETED';logger[_0x5ad9('0x63')](_0x5ad9('0x90'),_0x16525b['name'],_0x16525b['type']);}else{if(_[_0x5ad9('0x91')](_0x4d8ffc['channel'][_0x5ad9('0x92')](),_0x5ad9('0x93'))){if(this[_0x5ad9('0xc')][_0x4d8ffc[_0x5ad9('0x94')]]){var _0x5a1bd9=_[_0x5ad9('0x78')](this[_0x5ad9('0xc')][_0x4d8ffc[_0x5ad9('0x94')]]);_0x5a1bd9[_0x5ad9('0x79')]=![];_0x5a1bd9[_0x5ad9('0x8c')]=!![];_0x5a1bd9[_0x5ad9('0x8d')]=moment(_0x16525b[_0x5ad9('0x6d')])[_0x5ad9('0x95')](_0x4d8ffc[_0x5ad9('0x7b')],_0x5ad9('0x96'))[_0x5ad9('0x43')](_0x5ad9('0x6e'));_0x5a1bd9[_0x5ad9('0x7e')]=_0x5ad9('0x97');_0x5a1bd9[_0x5ad9('0x8e')]=!![];_0x5a1bd9[_0x5ad9('0x98')]='FORWARD';_0x5a1bd9[_0x5ad9('0x99')]=_0x4d8ffc[_0x5ad9('0x9a')];_0x5a1bd9[_0x5ad9('0x9b')]=_0x4d8ffc[_0x5ad9('0x46')];logger[_0x5ad9('0x63')]('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:FORWARDTRANSFER',_0x5a1bd9['name'],_0x5a1bd9['type']);var _0x1099f3=this[_0x5ad9('0xc')][_0x4d8ffc[_0x5ad9('0x94')]];this[_0x5ad9('0xc')][_0x4d8ffc['linkedid']]=this['queueReports'][_0x4d8ffc['uniqueid']];this[_0x5ad9('0xc')][_0x4d8ffc[_0x5ad9('0x46')]]=_0x1099f3;}}else{_0x16525b[_0x5ad9('0x7e')]='COMPLETEDBY'+_0x4d8ffc[_0x5ad9('0x8f')][_0x5ad9('0x9c')]();logger['info'](_0x5ad9('0x9d'),_0x16525b[_0x5ad9('0x44')],_0x16525b[_0x5ad9('0x6c')],_0x16525b[_0x5ad9('0x7e')]);}}}this[_0x5ad9('0xe')][_0x4d8ffc[_0x5ad9('0x46')]]=_0x16525b;this['emitVoiceQueueChannelRemove'](_0x16525b,_0x5ad9('0x1c'));}}}catch(_0x28fdca){logger[_0x5ad9('0x35')](_0x5ad9('0x9e'),_0x4d8ffc['uniqueid'],util[_0x5ad9('0x37')](_0x28fdca,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x5ad9('0x8')]['syncVarSet']=function(_0xfd849b){try{if(this['isNotNull'](_0xfd849b)){logger['debug'](_0x5ad9('0x9f'),_0xfd849b[_0x5ad9('0x46')],util['inspect'](_0xfd849b,{'showHidden':![],'depth':null}));this[_0x5ad9('0xa0')](_0xfd849b['uniqueid'],_['keys'](_0xfd849b[_0x5ad9('0xa1')])[0x0],_0xfd849b[_0x5ad9('0xa2')]);if(this[_0x5ad9('0xc')][_0xfd849b[_0x5ad9('0x46')]]){var _0x5d1bda=_[_0x5ad9('0x78')](this[_0x5ad9('0xc')][_0xfd849b['uniqueid']]);if(_0x5d1bda){if(this[_0x5ad9('0x5c')](_0xfd849b[_0x5ad9('0xa1')])&&this[_0x5ad9('0x5c')](_0xfd849b[_0x5ad9('0xa1')][_0x5ad9('0xa3')])){switch(_0xfd849b['value']){case _0x5ad9('0xa4'):_0x5d1bda['queuecallerexit']=![];_0x5d1bda['queuecallerexitAt']=null;break;case _0x5ad9('0xa5'):_0x5d1bda[_0x5ad9('0xa6')]=_0x5ad9('0xa7');_0x5d1bda[_0x5ad9('0x8c')]=!![];_0x5d1bda[_0x5ad9('0x8d')]=moment()[_0x5ad9('0x43')](_0x5ad9('0x6e'));_0x5d1bda[_0x5ad9('0xa8')]=moment()[_0x5ad9('0x43')](_0x5ad9('0x6e'));logger[_0x5ad9('0x40')]('[%s][voiceQueueReport][varset]\x20sending\x20timeout\x20event:',_0xfd849b[_0x5ad9('0x46')],util[_0x5ad9('0x37')](_0x5d1bda,{'showHidden':![],'depth':null}));ami[_0x5ad9('0x3e')]('custom:timeout',_0x5d1bda);break;default:_0x5d1bda['queuecallerexit']=!![];_0x5d1bda[_0x5ad9('0x8d')]=moment()[_0x5ad9('0x43')](_0x5ad9('0x6e'));_0x5d1bda['queuecallerleaveAt']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}_0x5d1bda['queuecallerabandon']=![];_0x5d1bda[_0x5ad9('0x7d')]=null;_0x5d1bda[_0x5ad9('0x7e')]=_0xfd849b['value'];this[_0x5ad9('0xe')][_0xfd849b[_0x5ad9('0x46')]]=_0x5d1bda;this[_0x5ad9('0x3c')](_0x5d1bda,'varset');}else if(this[_0x5ad9('0x5c')](_0xfd849b['variable'])&&this[_0x5ad9('0x5c')](_0xfd849b[_0x5ad9('0xa1')]['queueposition'])){if(!_0x5d1bda[_0x5ad9('0x18')]){_0x5d1bda[_0x5ad9('0x8c')]=!![];_0x5d1bda['queuecallerexitAt']=moment()[_0x5ad9('0x43')](_0x5ad9('0x6e'));_0x5d1bda['queuecallerexitreason']=_0x5ad9('0xa9');_0x5d1bda[_0x5ad9('0xa8')]=moment()['format'](_0x5ad9('0x6e'));this['channels'][_0xfd849b[_0x5ad9('0x46')]]=_0x5d1bda;}}logger[_0x5ad9('0x63')](_0x5ad9('0xaa'),_0xfd849b[_0x5ad9('0x46')],_0x5d1bda[_0x5ad9('0x44')],_0x5d1bda[_0x5ad9('0x6c')],_['keys'](_0xfd849b['variable'])[0x0],_0xfd849b['value']);_0x5d1bda[_0x5ad9('0x12')]=this[_0x5ad9('0x12')][_0xfd849b[_0x5ad9('0x46')]];}}}}catch(_0x1e3510){logger['error'](_0x5ad9('0x9f'),_0xfd849b[_0x5ad9('0x46')],util[_0x5ad9('0x37')](_0x1e3510,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x5ad9('0x8')][_0x5ad9('0xa0')]=function(_0x8856a,_0x29828d,_0x4fcb4f){var _0x1a432d=['rtpaudioqos','rtpaudioqosbridged',_0x5ad9('0xab'),'rtpaudioqosjitterbridged',_0x5ad9('0xac'),_0x5ad9('0xad'),_0x5ad9('0xae'),_0x5ad9('0xaf'),_0x5ad9('0xb0'),'sipuri',_0x5ad9('0xb1'),_0x5ad9('0xb2'),'membercalls',_0x5ad9('0xb3'),'memberinterface',_0x5ad9('0xb4'),_0x5ad9('0x8b'),_0x5ad9('0xb5'),_0x5ad9('0xb6')];if(!_['isNil'](_0x29828d)&&!_[_0x5ad9('0xb7')](_0x1a432d,_0x29828d)){if(_['isUndefined'](this[_0x5ad9('0x12')][_0x8856a])){this[_0x5ad9('0x12')][_0x8856a]={};}this[_0x5ad9('0x12')][_0x8856a][_0x29828d]=_0x4fcb4f;}};VoiceQueueReport[_0x5ad9('0x8')][_0x5ad9('0x21')]=function(_0x4603c6){try{if(this[_0x5ad9('0x5c')](_0x4603c6)){logger[_0x5ad9('0x40')]('[%s][voiceQueueReport][hangup]',_0x4603c6[_0x5ad9('0x46')],util[_0x5ad9('0x37')](_0x4603c6,{'showHidden':![],'depth':null}));if(this[_0x5ad9('0xc')][_0x4603c6[_0x5ad9('0x46')]]){for(var _0x2386f8=0x0,_0x32814e={};_0x2386f8=0x0?moment(_0xfcc196[_0xa5fb('0x1a')])[_0xa5fb('0xe')](_0xfcc196['starttime'],_0xa5fb('0xf')):null,'data1':'outbound','data2':_0xfcc196['accountcode'],'data3':_0xfcc196['exten'],'data4':_0xfcc196[_0xa5fb('0x1b')]||null,'role':_0xa5fb('0x14'),'internal':_0xfcc196[_0xa5fb('0x15')]?_[_0xa5fb('0x16')](_0xfcc196['accountcode']):undefined,'uniqueid':_0xfcc196['uniqueid']},'log':_0xa5fb('0x5')});}; \ No newline at end of file +var _0x202b=['queuecallercompleteAt','lastAssignedTo','isNil','interface','format','SIP/%s','TALKING','queuecallerleaveAt','diff','seconds','inbound','exten','queue','agent','accountcode','toNumber','uniqueid','CreateMemberReport','voiceDialReport','Request','endtime','starttime','outbound','dialstring','moment','../client','voiceQueueReport'];(function(_0x13b02f,_0x462a53){var _0x12e9a6=function(_0x187d57){while(--_0x187d57){_0x13b02f['push'](_0x13b02f['shift']());}};_0x12e9a6(++_0x462a53);}(_0x202b,0x192));var _0xb202=function(_0x4ba54b,_0x46f4de){_0x4ba54b=_0x4ba54b-0x0;var _0x364bfe=_0x202b[_0x4ba54b];return _0x364bfe;};'use strict';var moment=require(_0xb202('0x0'));var _=require('lodash');var util=require('util');var client=require(_0xb202('0x1'));exports[_0xb202('0x2')]=function(_0x58c7a2){var _0x22863c=_0x58c7a2[_0xb202('0x3')]||_0x58c7a2['queuecallerexitAt'];return client['Request']('CreateMemberReport',{'body':{'channel':'voice','membername':_0x58c7a2[_0xb202('0x4')],'interface':_[_0xb202('0x5')](_0x58c7a2[_0xb202('0x6')])?util[_0xb202('0x7')](_0xb202('0x8'),_0x58c7a2[_0xb202('0x4')]):_0x58c7a2[_0xb202('0x6')],'type':_0xb202('0x9'),'enterAt':_0x58c7a2[_0xb202('0xa')],'exitAt':_0x22863c,'duration':moment(_0x22863c)[_0xb202('0xb')](_0x58c7a2['queuecallerleaveAt'],_0xb202('0xc')),'data1':_0xb202('0xd'),'data2':_0x58c7a2['calleridnum'],'data3':_0x58c7a2[_0xb202('0xe')],'data4':null,'data5':_0x58c7a2[_0xb202('0xf')],'role':_0xb202('0x10'),'internal':_0x58c7a2[_0xb202('0x11')]?_[_0xb202('0x12')](_0x58c7a2[_0xb202('0x11')]):undefined,'uniqueid':_0x58c7a2[_0xb202('0x13')]},'log':_0xb202('0x14')});};exports[_0xb202('0x15')]=function(_0x33c3c1){return client[_0xb202('0x16')](_0xb202('0x14'),{'body':{'channel':'voice','membername':_0x33c3c1['membername'],'interface':_0x33c3c1[_0xb202('0x6')],'type':_0xb202('0x9'),'enterAt':_0x33c3c1['starttime'],'exitAt':_0x33c3c1[_0xb202('0x17')],'duration':moment(_0x33c3c1[_0xb202('0x17')])[_0xb202('0xb')](_0x33c3c1[_0xb202('0x18')],_0xb202('0xc'))>=0x0?moment(_0x33c3c1['endtime'])[_0xb202('0xb')](_0x33c3c1[_0xb202('0x18')],_0xb202('0xc')):null,'data1':_0xb202('0x19'),'data2':_0x33c3c1[_0xb202('0x11')],'data3':_0x33c3c1[_0xb202('0xe')],'data4':_0x33c3c1[_0xb202('0x1a')]||null,'role':_0xb202('0x10'),'internal':_0x33c3c1[_0xb202('0x11')]?_['toNumber'](_0x33c3c1[_0xb202('0x11')]):undefined,'uniqueid':_0x33c3c1['uniqueid']},'log':_0xb202('0x14')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/setting.js b/server/services/ami/rpc/setting.js index 66cfd1e..d435cb6 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 _0x5881=['ShowSetting','stopRecordingOnTransfer','GetSettings','getSettings','Request'];(function(_0x7de5bf,_0x2b67de){var _0x5a98b1=function(_0xbbd423){while(--_0xbbd423){_0x7de5bf['push'](_0x7de5bf['shift']());}};_0x5a98b1(++_0x2b67de);}(_0x5881,0x1f2));var _0x1588=function(_0x77eae,_0x17b823){_0x77eae=_0x77eae-0x0;var _0x5aa11f=_0x5881[_0x77eae];return _0x5aa11f;};'use strict';var client=require('../client');exports[_0x1588('0x0')]=function(){return client[_0x1588('0x1')](_0x1588('0x2'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x1588('0x3')]},'log':_0x1588('0x4')});}; \ No newline at end of file +var _0x8130=['GetSettings','../client','getSettings','ShowSetting','stopRecordingOnTransfer'];(function(_0x20b5f5,_0x8eb71f){var _0x38cb49=function(_0x1885e0){while(--_0x1885e0){_0x20b5f5['push'](_0x20b5f5['shift']());}};_0x38cb49(++_0x8eb71f);}(_0x8130,0x146));var _0x0813=function(_0x4a8c52,_0x13c4bc){_0x4a8c52=_0x4a8c52-0x0;var _0x2261e4=_0x8130[_0x4a8c52];return _0x2261e4;};'use strict';var client=require(_0x0813('0x0'));exports[_0x0813('0x1')]=function(){return client['Request'](_0x0813('0x2'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x0813('0x3')]},'log':_0x0813('0x4')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/template.js b/server/services/ami/rpc/template.js index 738b4c3..f84e645 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 _0x8eba=['../client','getTemplates','GetTemplate','name','html'];(function(_0x51e776,_0xf08725){var _0x3ff2e8=function(_0x11a1de){while(--_0x11a1de){_0x51e776['push'](_0x51e776['shift']());}};_0x3ff2e8(++_0xf08725);}(_0x8eba,0xc3));var _0xa8eb=function(_0xaf025d,_0x586d7a){_0xaf025d=_0xaf025d-0x0;var _0x1c77cb=_0x8eba[_0xaf025d];return _0x1c77cb;};'use strict';var client=require(_0xa8eb('0x0'));exports[_0xa8eb('0x1')]=function(_0x54c190){return function(_0x4bac28){return client['Request'](_0xa8eb('0x2'),{'options':{'raw':!![],'attributes':['id',_0xa8eb('0x3'),_0xa8eb('0x4')]},'log':_0xa8eb('0x2')});};}; \ No newline at end of file +var _0xf117=['html','GetTemplate','getTemplates','name'];(function(_0x56ff01,_0x4766ed){var _0x188edd=function(_0x239e51){while(--_0x239e51){_0x56ff01['push'](_0x56ff01['shift']());}};_0x188edd(++_0x4766ed);}(_0xf117,0x122));var _0x7f11=function(_0x35885a,_0x42fed7){_0x35885a=_0x35885a-0x0;var _0xe86249=_0xf117[_0x35885a];return _0xe86249;};'use strict';var client=require('../client');exports[_0x7f11('0x0')]=function(_0x22a728){return function(_0x2940df){return client['Request']('GetTemplate',{'options':{'raw':!![],'attributes':['id',_0x7f11('0x1'),_0x7f11('0x2')]},'log':_0x7f11('0x3')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trigger.js b/server/services/ami/rpc/trigger.js index 0d1b4fa..e21933f 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 _0x4059=['field','operator','value','AnyConditions','Action','Actions','data2','data3','data4','data5','data6','GetTrigger','../client','getTriggers','Request','channel','status','Condition','AllConditions'];(function(_0x448bab,_0x25517b){var _0x5dc534=function(_0x2196ba){while(--_0x2196ba){_0x448bab['push'](_0x448bab['shift']());}};_0x5dc534(++_0x25517b);}(_0x4059,0x13c));var _0x9405=function(_0x58cf0a,_0x2da36e){_0x58cf0a=_0x58cf0a-0x0;var _0x4ca00b=_0x4059[_0x58cf0a];return _0x4ca00b;};'use strict';var client=require(_0x9405('0x0'));exports[_0x9405('0x1')]=function(_0x3963ed){return function(_0x13b22e){return client[_0x9405('0x2')]('GetTrigger',{'options':{'raw':![],'attributes':['id','name',_0x9405('0x3'),_0x9405('0x4')],'include':[{'model':_0x9405('0x5'),'as':_0x9405('0x6'),'attributes':['id',_0x9405('0x7'),_0x9405('0x8'),_0x9405('0x9')]},{'model':_0x9405('0x5'),'as':_0x9405('0xa'),'attributes':['id',_0x9405('0x7'),_0x9405('0x8'),'value']},{'model':_0x9405('0xb'),'as':_0x9405('0xc'),'attributes':['id','action','data1',_0x9405('0xd'),_0x9405('0xe'),_0x9405('0xf'),_0x9405('0x10'),_0x9405('0x11'),'data7']}]},'log':_0x9405('0x12')});};}; \ No newline at end of file +var _0x6059=['status','Condition','AllConditions','field','operator','value','AnyConditions','Action','Actions','data2','data3','data4','data6','data7','../client','getTriggers','GetTrigger','name','channel'];(function(_0x9be28f,_0x231334){var _0xa9f52d=function(_0x239dad){while(--_0x239dad){_0x9be28f['push'](_0x9be28f['shift']());}};_0xa9f52d(++_0x231334);}(_0x6059,0x118));var _0x9605=function(_0x11bc40,_0x537bbc){_0x11bc40=_0x11bc40-0x0;var _0x2b7a99=_0x6059[_0x11bc40];return _0x2b7a99;};'use strict';var client=require(_0x9605('0x0'));exports[_0x9605('0x1')]=function(_0x1a583b){return function(_0x413bc2){return client['Request'](_0x9605('0x2'),{'options':{'raw':![],'attributes':['id',_0x9605('0x3'),_0x9605('0x4'),_0x9605('0x5')],'include':[{'model':_0x9605('0x6'),'as':_0x9605('0x7'),'attributes':['id',_0x9605('0x8'),_0x9605('0x9'),_0x9605('0xa')]},{'model':_0x9605('0x6'),'as':_0x9605('0xb'),'attributes':['id',_0x9605('0x8'),_0x9605('0x9'),_0x9605('0xa')]},{'model':_0x9605('0xc'),'as':_0x9605('0xd'),'attributes':['id','action','data1',_0x9605('0xe'),_0x9605('0xf'),_0x9605('0x10'),'data5',_0x9605('0x11'),_0x9605('0x12')]}]},'log':_0x9605('0x2')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trunk.js b/server/services/ami/rpc/trunk.js index 23e7a2d..ecb5e8f 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 _0x47e6=['Request','registry','defaultuser','GetTrunk','getTrunks'];(function(_0x29a0a3,_0x5e558e){var _0x29e6b0=function(_0x9b4ddf){while(--_0x9b4ddf){_0x29a0a3['push'](_0x29a0a3['shift']());}};_0x29e6b0(++_0x5e558e);}(_0x47e6,0xe5));var _0x647e=function(_0x165787,_0xe4c5ec){_0x165787=_0x165787-0x0;var _0x4e6f5a=_0x47e6[_0x165787];return _0x4e6f5a;};'use strict';var client=require('../client');exports[_0x647e('0x0')]=function(_0x513333){return function(_0x587c3c){return client[_0x647e('0x1')]('GetTrunk',{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id','name',_0x647e('0x2'),_0x647e('0x3')]},'log':_0x647e('0x4')});};}; \ No newline at end of file +var _0x3770=['GetTrunk','name','registry','defaultuser','../client','getTrunks'];(function(_0x1e94e7,_0x52b3ed){var _0x33e6e5=function(_0x340ea1){while(--_0x340ea1){_0x1e94e7['push'](_0x1e94e7['shift']());}};_0x33e6e5(++_0x52b3ed);}(_0x3770,0x13c));var _0x0377=function(_0x27d589,_0x2b55c5){_0x27d589=_0x27d589-0x0;var _0x18825b=_0x3770[_0x27d589];return _0x18825b;};'use strict';var client=require(_0x0377('0x0'));exports[_0x0377('0x1')]=function(_0x1df51b){return function(_0x54679e){return client['Request'](_0x0377('0x2'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id',_0x0377('0x3'),_0x0377('0x4'),_0x0377('0x5')]},'log':'GetTrunk'});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/user.js b/server/services/ami/rpc/user.js index fce8f70..81882c2 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 _0x34e8=['../client','getAgents','Request','GetUser','name','email','accountcode','fullname','online','lastLoginAt','pauseType','voicePause','mobile','interface','getTelephones','telephone','internal','savePause','PauseUser','saveUnpause','UnpauseUser','getAgent','ShowUser','agent','lastPauseAt'];(function(_0x1f460e,_0x486fbd){var _0x12d6cc=function(_0x5b5114){while(--_0x5b5114){_0x1f460e['push'](_0x1f460e['shift']());}};_0x12d6cc(++_0x486fbd);}(_0x34e8,0x12c));var _0x834e=function(_0x25c566,_0x3f00d1){_0x25c566=_0x25c566-0x0;var _0x3baaa1=_0x34e8[_0x25c566];return _0x3baaa1;};'use strict';var client=require(_0x834e('0x0'));exports[_0x834e('0x1')]=function(){return function(){return client[_0x834e('0x2')](_0x834e('0x3'),{'options':{'raw':![],'where':{'role':'agent'},'attributes':['id',_0x834e('0x4'),_0x834e('0x5'),_0x834e('0x6'),_0x834e('0x7'),_0x834e('0x8'),_0x834e('0x9'),_0x834e('0xa'),'lastPauseAt',_0x834e('0xb'),'phone',_0x834e('0xc'),_0x834e('0xd')]},'log':_0x834e('0x1')});};};exports[_0x834e('0xe')]=function(){return function(){return client[_0x834e('0x2')](_0x834e('0x3'),{'options':{'raw':!![],'where':{'role':_0x834e('0xf')},'attributes':['id',_0x834e('0x4'),_0x834e('0x6'),_0x834e('0x10')]},'log':_0x834e('0xe')});};};exports[_0x834e('0x11')]=function(_0x14038b,_0x2e1a37,_0x293514){return client[_0x834e('0x2')](_0x834e('0x12'),{'body':{'type':_0x2e1a37,'uniqueid':_0x293514},'options':{'where':{'id':_0x14038b['id']}},'log':'savePause'});};exports[_0x834e('0x13')]=function(_0x6cd9b9){return client['Request'](_0x834e('0x14'),{'body':{},'options':{'where':{'id':_0x6cd9b9['id']}},'log':_0x834e('0x11')});};exports[_0x834e('0x15')]=function(_0x21cc0a){return client['Request'](_0x834e('0x16'),{'options':{'raw':![],'where':{'role':_0x834e('0x17'),'id':_0x21cc0a},'attributes':['id','name',_0x834e('0x5'),'accountcode',_0x834e('0x7'),_0x834e('0x8'),'lastLoginAt',_0x834e('0xa'),_0x834e('0x18'),_0x834e('0xb'),'interface']},'log':_0x834e('0x15')});}; \ No newline at end of file +var _0xa9e0=['agent','lastPauseAt','interface','../client','getAgents','Request','name','accountcode','fullname','online','lastLoginAt','pauseType','voicePause','phone','mobile','getTelephones','telephone','internal','savePause','PauseUser','saveUnpause','UnpauseUser','getAgent','ShowUser'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x92c450,_0x41f1e3){_0x92c450=_0x92c450-0x0;var _0x2a9599=_0xa9e0[_0x92c450];return _0x2a9599;};'use strict';var client=require(_0x0a9e('0x0'));exports[_0x0a9e('0x1')]=function(){return function(){return client[_0x0a9e('0x2')]('GetUser',{'options':{'raw':![],'where':{'role':'agent'},'attributes':['id',_0x0a9e('0x3'),'email',_0x0a9e('0x4'),_0x0a9e('0x5'),_0x0a9e('0x6'),_0x0a9e('0x7'),_0x0a9e('0x8'),'lastPauseAt',_0x0a9e('0x9'),_0x0a9e('0xa'),_0x0a9e('0xb'),'interface']},'log':'getAgents'});};};exports[_0x0a9e('0xc')]=function(){return function(){return client['Request']('GetUser',{'options':{'raw':!![],'where':{'role':_0x0a9e('0xd')},'attributes':['id',_0x0a9e('0x3'),_0x0a9e('0x4'),_0x0a9e('0xe')]},'log':_0x0a9e('0xc')});};};exports[_0x0a9e('0xf')]=function(_0x4a4c56,_0x50dfb2,_0x527cdd){return client['Request'](_0x0a9e('0x10'),{'body':{'type':_0x50dfb2,'uniqueid':_0x527cdd},'options':{'where':{'id':_0x4a4c56['id']}},'log':_0x0a9e('0xf')});};exports[_0x0a9e('0x11')]=function(_0x26d672){return client[_0x0a9e('0x2')](_0x0a9e('0x12'),{'body':{},'options':{'where':{'id':_0x26d672['id']}},'log':'savePause'});};exports[_0x0a9e('0x13')]=function(_0x239b12){return client[_0x0a9e('0x2')](_0x0a9e('0x14'),{'options':{'raw':![],'where':{'role':_0x0a9e('0x15'),'id':_0x239b12},'attributes':['id',_0x0a9e('0x3'),'email',_0x0a9e('0x4'),'fullname',_0x0a9e('0x6'),'lastLoginAt',_0x0a9e('0x8'),_0x0a9e('0x16'),'voicePause',_0x0a9e('0x17')]},'log':'getAgent'});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceAgentReport.js b/server/services/ami/rpc/voiceAgentReport.js index 0fcfafb..fd2cbb5 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 _0x3c23=['CreateVoiceAgentReport','UpdateVoiceAgentReport','Request'];(function(_0x37b351,_0x3275cc){var _0xccc179=function(_0x577c4f){while(--_0x577c4f){_0x37b351['push'](_0x37b351['shift']());}};_0xccc179(++_0x3275cc);}(_0x3c23,0x80));var _0x33c2=function(_0x198cb2,_0x26f098){_0x198cb2=_0x198cb2-0x0;var _0x216c99=_0x3c23[_0x198cb2];return _0x216c99;};'use strict';var client=require('../client');exports['create']=function(_0x15a1e6){return client[_0x33c2('0x0')](_0x33c2('0x1'),{'body':_0x15a1e6,'log':_0x33c2('0x1')});};exports['update']=function(_0x4dafd4,_0x3c7c1f,_0x421887){return client['Request'](_0x33c2('0x2'),{'body':_0x4dafd4,'options':{'where':{'uniqueid':_0x3c7c1f,'interface':_0x421887,'agentcomplete':!![]}},'log':_0x33c2('0x2')});}; \ No newline at end of file +var _0xbdda=['CreateVoiceAgentReport','UpdateVoiceAgentReport','../client','create','Request'];(function(_0x2e9b66,_0xc92c1f){var _0x17438f=function(_0x37326c){while(--_0x37326c){_0x2e9b66['push'](_0x2e9b66['shift']());}};_0x17438f(++_0xc92c1f);}(_0xbdda,0x1bf));var _0xabdd=function(_0x21a7cf,_0x5ea0b5){_0x21a7cf=_0x21a7cf-0x0;var _0x202534=_0xbdda[_0x21a7cf];return _0x202534;};'use strict';var client=require(_0xabdd('0x0'));exports[_0xabdd('0x1')]=function(_0x4e1d1c){return client[_0xabdd('0x2')](_0xabdd('0x3'),{'body':_0x4e1d1c,'log':_0xabdd('0x3')});};exports['update']=function(_0x70997e,_0x3a9361,_0x1c264e){return client[_0xabdd('0x2')]('UpdateVoiceAgentReport',{'body':_0x70997e,'options':{'where':{'uniqueid':_0x3a9361,'interface':_0x1c264e,'agentcomplete':!![]}},'log':_0xabdd('0x4')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceCallReport.js b/server/services/ami/rpc/voiceCallReport.js index 2baaf3c..67a30b9 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 _0xf925=['endOf','day','type','duration','billableseconds','GetVoiceCallReports','moment','util','lodash','../client','create','Request','CreateVoiceCallReport','merge','calleridnum','context','DOCUMENTATION','getVoiceCallReports','GetVoiceCallReport','startOf','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x5e2152,_0x172f3d){var _0x5ddcf6=function(_0x30a5cc){while(--_0x30a5cc){_0x5e2152['push'](_0x5e2152['shift']());}};_0x5ddcf6(++_0x172f3d);}(_0xf925,0x99));var _0x5f92=function(_0x16d411,_0x5e0970){_0x16d411=_0x16d411-0x0;var _0x20336d=_0xf925[_0x16d411];return _0x20336d;};'use strict';var moment=require(_0x5f92('0x0'));var util=require(_0x5f92('0x1'));var _=require(_0x5f92('0x2'));var client=require(_0x5f92('0x3'));exports[_0x5f92('0x4')]=function(_0x5e5410){return client[_0x5f92('0x5')](_0x5f92('0x6'),{'body':_[_0x5f92('0x7')](_0x5e5410,{'source':_0x5e5410[_0x5f92('0x8')],'destinationcontext':_0x5e5410[_0x5f92('0x9')],'callerid':_0x5e5410['callerid'],'amaflags':_0x5f92('0xa')}),'log':'CreateVoiceCallReport'});};exports[_0x5f92('0xb')]=function(){return function(){return client[_0x5f92('0x5')](_0x5f92('0xc'),{'options':{'where':{'type':['outbound'],'createdAt':{'$between':[moment()[_0x5f92('0xd')]('day')['format'](_0x5f92('0xe')),moment()[_0x5f92('0xf')](_0x5f92('0x10'))['format']('YYYY-MM-DD\x20HH:mm:ss')]}},'attributes':[_0x5f92('0x11'),'disposition',_0x5f92('0x12'),_0x5f92('0x13')]},'log':_0x5f92('0x14')});};}; \ No newline at end of file +var _0xb97f=['moment','util','lodash','create','CreateVoiceCallReport','context','DOCUMENTATION','getVoiceCallReports','Request','outbound','startOf','day','endOf','YYYY-MM-DD\x20HH:mm:ss','type','disposition','duration','billableseconds','GetVoiceCallReports'];(function(_0x4154a6,_0x2c0b8e){var _0x3b2786=function(_0x2f5936){while(--_0x2f5936){_0x4154a6['push'](_0x4154a6['shift']());}};_0x3b2786(++_0x2c0b8e);}(_0xb97f,0x11d));var _0xfb97=function(_0x1b1d3b,_0x5ead4c){_0x1b1d3b=_0x1b1d3b-0x0;var _0x1535bc=_0xb97f[_0x1b1d3b];return _0x1535bc;};'use strict';var moment=require(_0xfb97('0x0'));var util=require(_0xfb97('0x1'));var _=require(_0xfb97('0x2'));var client=require('../client');exports[_0xfb97('0x3')]=function(_0x34e1a5){return client['Request'](_0xfb97('0x4'),{'body':_['merge'](_0x34e1a5,{'source':_0x34e1a5['calleridnum'],'destinationcontext':_0x34e1a5[_0xfb97('0x5')],'callerid':_0x34e1a5['callerid'],'amaflags':_0xfb97('0x6')}),'log':'CreateVoiceCallReport'});};exports[_0xfb97('0x7')]=function(){return function(){return client[_0xfb97('0x8')]('GetVoiceCallReport',{'options':{'where':{'type':[_0xfb97('0x9')],'createdAt':{'$between':[moment()[_0xfb97('0xa')](_0xfb97('0xb'))['format']('YYYY-MM-DD\x20HH:mm:ss'),moment()[_0xfb97('0xc')](_0xfb97('0xb'))['format'](_0xfb97('0xd'))]}},'attributes':[_0xfb97('0xe'),_0xfb97('0xf'),_0xfb97('0x10'),_0xfb97('0x11')]},'log':_0xfb97('0x12')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceDialReport.js b/server/services/ami/rpc/voiceDialReport.js index 756eba0..fdec890 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 _0x346c=['create','Request','../client'];(function(_0x4475f6,_0x125c36){var _0xa192a0=function(_0x56187b){while(--_0x56187b){_0x4475f6['push'](_0x4475f6['shift']());}};_0xa192a0(++_0x125c36);}(_0x346c,0x1d9));var _0xc346=function(_0x4fc185,_0x329dd7){_0x4fc185=_0x4fc185-0x0;var _0xaf1199=_0x346c[_0x4fc185];return _0xaf1199;};'use strict';var client=require(_0xc346('0x0'));exports[_0xc346('0x1')]=function(_0x1e9c97){return client[_0xc346('0x2')]('CreateVoiceDialReport',{'body':_0x1e9c97,'log':'CreateVoiceDialReport'});}; \ No newline at end of file +var _0xa23e=['CreateVoiceDialReport','create','Request'];(function(_0x54e48b,_0x313c10){var _0x22be93=function(_0x17a9eb){while(--_0x17a9eb){_0x54e48b['push'](_0x54e48b['shift']());}};_0x22be93(++_0x313c10);}(_0xa23e,0x1c0));var _0xea23=function(_0x1d73d2,_0x293d4f){_0x1d73d2=_0x1d73d2-0x0;var _0x4986ff=_0xa23e[_0x1d73d2];return _0x4986ff;};'use strict';var client=require('../client');exports[_0xea23('0x0')]=function(_0x123b62){return client[_0xea23('0x1')](_0xea23('0x2'),{'body':_0x123b62,'log':_0xea23('0x2')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceExtension.js b/server/services/ami/rpc/voiceExtension.js index 155f63e..282a858 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 _0xa1b9=['Request','GetVoiceExtension','exten','recordingFormat','getVoiceExtensions','../client'];(function(_0x40dd47,_0x28e64f){var _0x4bc92b=function(_0x5c3ff0){while(--_0x5c3ff0){_0x40dd47['push'](_0x40dd47['shift']());}};_0x4bc92b(++_0x28e64f);}(_0xa1b9,0x71));var _0x9a1b=function(_0x411add,_0x1aed38){_0x411add=_0x411add-0x0;var _0x238242=_0xa1b9[_0x411add];return _0x238242;};'use strict';var client=require(_0x9a1b('0x0'));exports['getVoiceExtensions']=function(){return function(){return client[_0x9a1b('0x1')](_0x9a1b('0x2'),{'options':{'raw':!![],'attributes':['id',_0x9a1b('0x3'),_0x9a1b('0x4')],'where':{'VoiceExtensionId':null}},'log':_0x9a1b('0x5')});};}; \ No newline at end of file +var _0x70e0=['getVoiceExtensions','Request','recordingFormat','../client'];(function(_0x51dcc5,_0x47411e){var _0x3e7cad=function(_0x1686b5){while(--_0x1686b5){_0x51dcc5['push'](_0x51dcc5['shift']());}};_0x3e7cad(++_0x47411e);}(_0x70e0,0x17b));var _0x070e=function(_0x34b144,_0x8cc3de){_0x34b144=_0x34b144-0x0;var _0x33edb7=_0x70e0[_0x34b144];return _0x33edb7;};'use strict';var client=require(_0x070e('0x0'));exports[_0x070e('0x1')]=function(){return function(){return client[_0x070e('0x2')]('GetVoiceExtension',{'options':{'raw':!![],'attributes':['id','exten',_0x070e('0x3')],'where':{'VoiceExtensionId':null}},'log':_0x070e('0x1')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueue.js b/server/services/ami/rpc/voiceQueue.js index 4f6a06d..d74a288 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 _0xf698=['dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialQueueOptions','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialPrefix','dialCheckDuplicateType','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDSilenceThreshold','dialAMDMaximumWordLength','timeout','dialRecallMeTimeout','dialOrderByScheduledAt','dialAgiAfterHangupAgent','dialQueueProject2','monitor_format','dialRandomLastDigitCallerIdNumber','dialCutDigit','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineRetryFrequency','dialAgentRejectRetryFrequency','mandatoryDisposition','dialPredictiveIntervalMaxThreshold','Trunk','name','callerid','active','Pause','TrunkBackup','Interval','Intervals','getVoiceQueues','Request','GetVoiceQueue','acw','autopause','type','dialActive','dialMethod','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dialPredictiveOptimizationPercentage'];(function(_0x36a226,_0x434552){var _0x4482a0=function(_0x3c365c){while(--_0x3c365c){_0x36a226['push'](_0x36a226['shift']());}};_0x4482a0(++_0x434552);}(_0xf698,0x129));var _0x8f69=function(_0x11e30d,_0x5584aa){_0x11e30d=_0x11e30d-0x0;var _0x2d4e29=_0xf698[_0x11e30d];return _0x2d4e29;};'use strict';var client=require('../client');exports[_0x8f69('0x0')]=function(){return function(){return client[_0x8f69('0x1')](_0x8f69('0x2'),{'options':{'raw':![],'attributes':['id','name',_0x8f69('0x3'),'acwTimeout',_0x8f69('0x4'),'monitor_format',_0x8f69('0x5'),_0x8f69('0x6'),_0x8f69('0x7'),_0x8f69('0x8'),_0x8f69('0x9'),_0x8f69('0xa'),_0x8f69('0xb'),_0x8f69('0xc'),_0x8f69('0xd'),_0x8f69('0xe'),_0x8f69('0xf'),'dialOriginateTimeout',_0x8f69('0x10'),_0x8f69('0x11'),_0x8f69('0x12'),_0x8f69('0x13'),'dialCongestionRetryFrequency',_0x8f69('0x14'),_0x8f69('0x15'),_0x8f69('0x16'),_0x8f69('0x17'),_0x8f69('0x18'),'dialTimezone','dialGlobalInterval',_0x8f69('0x19'),_0x8f69('0x1a'),_0x8f69('0x1b'),_0x8f69('0x1c'),_0x8f69('0x1d'),_0x8f69('0x1e'),_0x8f69('0x1f'),_0x8f69('0x20'),_0x8f69('0x21'),'dialAMDMaximumNumberOfWords',_0x8f69('0x22'),_0x8f69('0x23'),_0x8f69('0x24'),_0x8f69('0x25'),'dialRecallInQueue',_0x8f69('0x26'),_0x8f69('0x27'),'dialAgiAfterHangupClient',_0x8f69('0x28'),_0x8f69('0x29'),'strategy',_0x8f69('0x2a'),_0x8f69('0x2b'),_0x8f69('0x2c'),_0x8f69('0x2d'),_0x8f69('0x2e'),_0x8f69('0x2f'),_0x8f69('0x30'),_0x8f69('0x31'),'dialMachineMaxRetry',_0x8f69('0x32'),'dialAgentRejectMaxRetry',_0x8f69('0x33'),_0x8f69('0x34'),_0x8f69('0x35'),'dialPredictiveIntervalMinThreshold'],'include':[{'model':'Trunk','as':_0x8f69('0x36'),'attributes':['id',_0x8f69('0x37'),_0x8f69('0x38'),_0x8f69('0x39')]},{'model':_0x8f69('0x3a'),'as':'mandatoryDispositionPause','attributes':['id',_0x8f69('0x37')]},{'model':_0x8f69('0x36'),'as':_0x8f69('0x3b'),'attributes':['id',_0x8f69('0x37'),'callerid',_0x8f69('0x39')]},{'model':'Interval','as':_0x8f69('0x3c'),'attributes':['id','name'],'include':[{'model':_0x8f69('0x3c'),'as':_0x8f69('0x3d'),'attributes':['id','name','interval']}]}]},'log':_0x8f69('0x0')});};}; \ No newline at end of file +var _0x58f5=['Request','name','acw','acwTimeout','autopause','type','dialActive','dialLimitChannel','dialPowerLevel','dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','dialQueueTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialTimezone','dialCheckDuplicateType','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDSilenceThreshold','dialAMDMaximumWordLength','timeout','dialRecallMeTimeout','dialRecallInQueue','dialAgiAfterHangupClient','dialQueueProject2','monitor_format','dialRandomLastDigitCallerIdNumber','dialCutDigit','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectRetryFrequency','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','Trunk','callerid','active','Pause','mandatoryDispositionPause','TrunkBackup','Interval','interval','../client'];(function(_0x22135d,_0x149f4e){var _0x22adbd=function(_0x1d9793){while(--_0x1d9793){_0x22135d['push'](_0x22135d['shift']());}};_0x22adbd(++_0x149f4e);}(_0x58f5,0x126));var _0x558f=function(_0x3644aa,_0x5a8cd9){_0x3644aa=_0x3644aa-0x0;var _0x4f57c3=_0x58f5[_0x3644aa];return _0x4f57c3;};'use strict';var client=require(_0x558f('0x0'));exports['getVoiceQueues']=function(){return function(){return client[_0x558f('0x1')]('GetVoiceQueue',{'options':{'raw':![],'attributes':['id',_0x558f('0x2'),_0x558f('0x3'),_0x558f('0x4'),_0x558f('0x5'),'monitor_format',_0x558f('0x6'),_0x558f('0x7'),'dialMethod',_0x558f('0x8'),'dialLimitQueue',_0x558f('0x9'),_0x558f('0xa'),_0x558f('0xb'),_0x558f('0xc'),_0x558f('0xd'),_0x558f('0xe'),_0x558f('0xf'),_0x558f('0x10'),_0x558f('0x11'),'dialQueueProject',_0x558f('0x12'),_0x558f('0x13'),_0x558f('0x14'),'dialBusyRetryFrequency',_0x558f('0x15'),_0x558f('0x16'),'dialGlobalMaxRetry',_0x558f('0x17'),'dialGlobalInterval','dialPrefix',_0x558f('0x18'),_0x558f('0x19'),_0x558f('0x1a'),_0x558f('0x1b'),_0x558f('0x1c'),_0x558f('0x1d'),_0x558f('0x1e'),'dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords',_0x558f('0x1f'),_0x558f('0x20'),_0x558f('0x21'),_0x558f('0x22'),_0x558f('0x23'),'dialOrderByScheduledAt','dialAgiAfterHangupAgent',_0x558f('0x24'),_0x558f('0x25'),_0x558f('0x26'),'strategy',_0x558f('0x27'),_0x558f('0x28'),_0x558f('0x29'),_0x558f('0x2a'),_0x558f('0x2b'),_0x558f('0x2c'),_0x558f('0x2d'),'dialAbandonedRetryFrequency',_0x558f('0x2e'),_0x558f('0x2f'),'dialAgentRejectMaxRetry',_0x558f('0x30'),'mandatoryDisposition',_0x558f('0x31'),_0x558f('0x32')],'include':[{'model':_0x558f('0x33'),'as':_0x558f('0x33'),'attributes':['id',_0x558f('0x2'),_0x558f('0x34'),_0x558f('0x35')]},{'model':_0x558f('0x36'),'as':_0x558f('0x37'),'attributes':['id',_0x558f('0x2')]},{'model':'Trunk','as':_0x558f('0x38'),'attributes':['id','name',_0x558f('0x34'),_0x558f('0x35')]},{'model':_0x558f('0x39'),'as':_0x558f('0x39'),'attributes':['id',_0x558f('0x2')],'include':[{'model':'Interval','as':'Intervals','attributes':['id',_0x558f('0x2'),_0x558f('0x3a')]}]}]},'log':'getVoiceQueues'});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueueReport.js b/server/services/ami/rpc/voiceQueueReport.js index 8bd0a0d..9d18e87 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(_0x48159e,_0x4a6019){var _0x152fb2=function(_0x252b99){while(--_0x252b99){_0x48159e['push'](_0x48159e['shift']());}};_0x152fb2(++_0x4a6019);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1c546c,_0x5c57cb){_0x1c546c=_0x1c546c-0x0;var _0x2cc384=_0xa9e0[_0x1c546c];return _0x2cc384;};'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(_0x43f12a,_0x3b37bf){var _0x570d86=function(_0x193f9b){while(--_0x193f9b){_0x43f12a['push'](_0x43f12a['shift']());}};_0x570d86(++_0x3b37bf);}(_0xa9e0,0x123));var _0x0a9e=function(_0x139a3c,_0x4fc883){_0x139a3c=_0x139a3c-0x0;var _0x2b375b=_0xa9e0[_0x139a3c];return _0x2b375b;};'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 397f4a7..e795659 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 _0x2768=['Request','GetVoiceQueueRtPauses','../client'];(function(_0x504582,_0x5b3965){var _0x43c6ce=function(_0x1199a4){while(--_0x1199a4){_0x504582['push'](_0x504582['shift']());}};_0x43c6ce(++_0x5b3965);}(_0x2768,0x119));var _0x8276=function(_0x233f03,_0x34f5fd){_0x233f03=_0x233f03-0x0;var _0x41acb0=_0x2768[_0x233f03];return _0x41acb0;};'use strict';var client=require(_0x8276('0x0'));exports['getVoiceQueueRtPauses']=function(_0x143bfb){return function(){return client[_0x8276('0x1')](_0x8276('0x2'),{'options':{'where':{'VoiceQueueId':_0x143bfb,'paused':!![]},'raw':!![]},'log':'getVoiceQueueRtPauses'});};}; \ No newline at end of file +var _0xb210=['../client','getVoiceQueueRtPauses','Request','GetVoiceQueueRtPauses'];(function(_0x543996,_0x6c8bdc){var _0xc0a5e2=function(_0x3a9db7){while(--_0x3a9db7){_0x543996['push'](_0x543996['shift']());}};_0xc0a5e2(++_0x6c8bdc);}(_0xb210,0xdc));var _0x0b21=function(_0x20f631,_0x138a18){_0x20f631=_0x20f631-0x0;var _0xdb0683=_0xb210[_0x20f631];return _0xdb0683;};'use strict';var client=require(_0x0b21('0x0'));exports[_0x0b21('0x1')]=function(_0x476ad8){return function(){return client[_0x0b21('0x2')](_0x0b21('0x3'),{'options':{'where':{'VoiceQueueId':_0x476ad8,'paused':!![]},'raw':!![]},'log':'getVoiceQueueRtPauses'});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceRecording.js b/server/services/ami/rpc/voiceRecording.js index 7b7732c..85a0119 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(_0x5d6fb9,_0x20f87f){var _0x3afa96=function(_0xee948){while(--_0xee948){_0x5d6fb9['push'](_0x5d6fb9['shift']());}};_0x3afa96(++_0x20f87f);}(_0x9957,0x93));var _0x7995=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x9957[_0x2dafbe];return _0x58a45a;};'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 _0x7a54=['create','Request','CreateVoiceRecording','monitorFilename','lodash','../client'];(function(_0x3c8a28,_0x87616f){var _0x4545fe=function(_0xd830af){while(--_0xd830af){_0x3c8a28['push'](_0x3c8a28['shift']());}};_0x4545fe(++_0x87616f);}(_0x7a54,0x106));var _0x47a5=function(_0x54d501,_0x15bb43){_0x54d501=_0x54d501-0x0;var _0x22004b=_0x7a54[_0x54d501];return _0x22004b;};'use strict';var _=require(_0x47a5('0x0'));var client=require(_0x47a5('0x1'));exports[_0x47a5('0x2')]=function(_0x58157c){return client[_0x47a5('0x3')](_0x47a5('0x4'),{'body':_['merge'](_0x58157c,{'value':_0x58157c[_0x47a5('0x5')]}),'log':_0x47a5('0x4')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceTransferReport.js b/server/services/ami/rpc/voiceTransferReport.js index 2bf0e1f..e1d096f 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 _0x1058=['transfertargetcalleridnum','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','transfertargetexten','transfertargetlinkedid','origtransfererexten','attended','../client','transfers','Request','CreateVoiceTransferReport','result','transfererchannel','transferercalleridnum','transferercalleridname','transfereraccountcode','transferercontext','transfererexten','transfereechannel','transfereecalleridnum','transfereeconnectedlinename','transfereeaccountcode','transfereecontext','transfereeexten','transfereelinkedid','isexternal','context','extension','attendedTransfer','origtransfererchannel','origtransferercalleridname','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','secondtransferercontext','secondtransfererexten','transfertargetchannel'];(function(_0x528575,_0x2e067d){var _0x3063b7=function(_0x1ee183){while(--_0x1ee183){_0x528575['push'](_0x528575['shift']());}};_0x3063b7(++_0x2e067d);}(_0x1058,0x139));var _0x8105=function(_0x154183,_0x4bd861){_0x154183=_0x154183-0x0;var _0x58c318=_0x1058[_0x154183];return _0x58c318;};'use strict';var client=require(_0x8105('0x0'));exports[_0x8105('0x1')]={};exports['blindTransfer']=function(_0x49cf59){return client[_0x8105('0x2')](_0x8105('0x3'),{'body':{'result':_0x49cf59[_0x8105('0x4')],'transfererchannel':_0x49cf59[_0x8105('0x5')],'transferercalleridnum':_0x49cf59[_0x8105('0x6')],'transferercalleridname':_0x49cf59[_0x8105('0x7')],'transfererconnectedlinenum':_0x49cf59['transfererconnectedlinenum'],'transfererconnectedlinename':_0x49cf59['transfererconnectedlinename'],'transfereraccountcode':_0x49cf59[_0x8105('0x8')],'transferercontext':_0x49cf59[_0x8105('0x9')],'transfererexten':_0x49cf59[_0x8105('0xa')],'transfererlinkedid':_0x49cf59['transfererlinkedid'],'transfereechannel':_0x49cf59[_0x8105('0xb')],'transfereecalleridnum':_0x49cf59[_0x8105('0xc')],'transfereecalleridname':_0x49cf59['transfereecalleridname'],'transfereeconnectedlinenum':_0x49cf59['transfereeconnectedlinenum'],'transfereeconnectedlinename':_0x49cf59[_0x8105('0xd')],'transfereeaccountcode':_0x49cf59[_0x8105('0xe')],'transfereecontext':_0x49cf59[_0x8105('0xf')],'transfereeexten':_0x49cf59[_0x8105('0x10')],'transfereelinkedid':_0x49cf59[_0x8105('0x11')],'isexternal':_0x49cf59[_0x8105('0x12')],'context':_0x49cf59[_0x8105('0x13')],'extension':_0x49cf59[_0x8105('0x14')],'type':'blind'},'log':_0x8105('0x3')});};exports[_0x8105('0x15')]=function(_0x47b018){return client[_0x8105('0x2')]('CreateVoiceTransferReport',{'body':{'result':_0x47b018[_0x8105('0x4')],'transfererchannel':_0x47b018[_0x8105('0x16')],'transferercalleridnum':_0x47b018['origtransferercalleridnum'],'transferercalleridname':_0x47b018[_0x8105('0x17')],'transfererconnectedlinenum':_0x47b018[_0x8105('0x18')],'transfererconnectedlinename':_0x47b018[_0x8105('0x19')],'transfereraccountcode':_0x47b018['origtransfereraccountcode'],'transferercontext':_0x47b018[_0x8105('0x1a')],'transfererexten':_0x47b018[_0x8105('0x1b')],'transfererlinkedid':_0x47b018['origtransfererlinkedid'],'transfereechannel':_0x47b018[_0x8105('0x1c')],'transfereecalleridnum':_0x47b018[_0x8105('0x1d')],'transfereecalleridname':_0x47b018['transfertargetcalleridname'],'transfereeconnectedlinenum':_0x47b018[_0x8105('0x1e')],'transfereeconnectedlinename':_0x47b018[_0x8105('0x1f')],'transfereeaccountcode':_0x47b018[_0x8105('0x20')],'transfereecontext':_0x47b018[_0x8105('0x21')],'transfereeexten':_0x47b018[_0x8105('0x22')],'transfereelinkedid':_0x47b018[_0x8105('0x23')],'isexternal':_0x47b018['isexternal'],'context':_0x47b018['origtransferercontext'],'extension':_0x47b018[_0x8105('0x24')],'type':_0x8105('0x25')},'log':'CreateVoiceTransferReport'});}; \ No newline at end of file +var _0xafe6=['secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','origtransfererlinkedid','transfertargetcalleridnum','transfertargetcalleridname','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','transfertargetexten','origtransfererexten','attended','../client','transfers','blindTransfer','Request','CreateVoiceTransferReport','result','transfererchannel','transferercalleridnum','transferercalleridname','transfererconnectedlinename','transferercontext','transfererexten','transfererlinkedid','transfereechannel','transfereecalleridnum','transfereecalleridname','transfereeconnectedlinename','transfereeaccountcode','transfereecontext','transfereelinkedid','isexternal','context','extension','blind','attendedTransfer','origtransferercalleridnum','origtransferercalleridname'];(function(_0x158f01,_0x12af3e){var _0x5ef74e=function(_0x5e7adc){while(--_0x5e7adc){_0x158f01['push'](_0x158f01['shift']());}};_0x5ef74e(++_0x12af3e);}(_0xafe6,0xad));var _0x6afe=function(_0x29cd9f,_0x3006d3){_0x29cd9f=_0x29cd9f-0x0;var _0x277c54=_0xafe6[_0x29cd9f];return _0x277c54;};'use strict';var client=require(_0x6afe('0x0'));exports[_0x6afe('0x1')]={};exports[_0x6afe('0x2')]=function(_0x43d674){return client[_0x6afe('0x3')](_0x6afe('0x4'),{'body':{'result':_0x43d674[_0x6afe('0x5')],'transfererchannel':_0x43d674[_0x6afe('0x6')],'transferercalleridnum':_0x43d674[_0x6afe('0x7')],'transferercalleridname':_0x43d674[_0x6afe('0x8')],'transfererconnectedlinenum':_0x43d674['transfererconnectedlinenum'],'transfererconnectedlinename':_0x43d674[_0x6afe('0x9')],'transfereraccountcode':_0x43d674['transfereraccountcode'],'transferercontext':_0x43d674[_0x6afe('0xa')],'transfererexten':_0x43d674[_0x6afe('0xb')],'transfererlinkedid':_0x43d674[_0x6afe('0xc')],'transfereechannel':_0x43d674[_0x6afe('0xd')],'transfereecalleridnum':_0x43d674[_0x6afe('0xe')],'transfereecalleridname':_0x43d674[_0x6afe('0xf')],'transfereeconnectedlinenum':_0x43d674['transfereeconnectedlinenum'],'transfereeconnectedlinename':_0x43d674[_0x6afe('0x10')],'transfereeaccountcode':_0x43d674[_0x6afe('0x11')],'transfereecontext':_0x43d674[_0x6afe('0x12')],'transfereeexten':_0x43d674['transfereeexten'],'transfereelinkedid':_0x43d674[_0x6afe('0x13')],'isexternal':_0x43d674[_0x6afe('0x14')],'context':_0x43d674[_0x6afe('0x15')],'extension':_0x43d674[_0x6afe('0x16')],'type':_0x6afe('0x17')},'log':_0x6afe('0x4')});};exports[_0x6afe('0x18')]=function(_0x3cdab0){return client[_0x6afe('0x3')](_0x6afe('0x4'),{'body':{'result':_0x3cdab0[_0x6afe('0x5')],'transfererchannel':_0x3cdab0['origtransfererchannel'],'transferercalleridnum':_0x3cdab0[_0x6afe('0x19')],'transferercalleridname':_0x3cdab0[_0x6afe('0x1a')],'transfererconnectedlinenum':_0x3cdab0[_0x6afe('0x1b')],'transfererconnectedlinename':_0x3cdab0[_0x6afe('0x1c')],'transfereraccountcode':_0x3cdab0[_0x6afe('0x1d')],'transferercontext':_0x3cdab0['secondtransferercontext'],'transfererexten':_0x3cdab0['secondtransfererexten'],'transfererlinkedid':_0x3cdab0[_0x6afe('0x1e')],'transfereechannel':_0x3cdab0['transfertargetchannel'],'transfereecalleridnum':_0x3cdab0[_0x6afe('0x1f')],'transfereecalleridname':_0x3cdab0[_0x6afe('0x20')],'transfereeconnectedlinenum':_0x3cdab0[_0x6afe('0x21')],'transfereeconnectedlinename':_0x3cdab0[_0x6afe('0x22')],'transfereeaccountcode':_0x3cdab0[_0x6afe('0x23')],'transfereecontext':_0x3cdab0[_0x6afe('0x24')],'transfereeexten':_0x3cdab0[_0x6afe('0x25')],'transfereelinkedid':_0x3cdab0['transfertargetlinkedid'],'isexternal':_0x3cdab0[_0x6afe('0x14')],'context':_0x3cdab0['origtransferercontext'],'extension':_0x3cdab0[_0x6afe('0x26')],'type':_0x6afe('0x27')},'log':_0x6afe('0x4')});}; \ No newline at end of file diff --git a/server/services/ami/server/index.js b/server/services/ami/server/index.js index 0f9d2d7..e637bec 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 _0x126e=['validate','bluebird','moment','../../../config/environment','../ami','listen','format','SIP','name','timers','agents','updateStatusRealtime','pause','QueuePause','error','asterisk','username','ami\x20disconnected','join','pick','module','action','Reload','then','message','catch','isConnected','Command','Action','voiceQueues','strategy','answered','loggedIn','pTalking','sumDuration','sumHoldTime','talking','total','unmanaged','abandoned','type','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','temp','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','active','callerid','Interval','push','omit','undefined','values','channels','length','map','find','channel','filename','wav','MixMonitor','monitors','/var/spool/asterisk/monitor/','isNil','toLowerCase','YYYY-MM-DD\x20HH:mm:ss','mixmonitorid','rec','status','uniqueid','MixMonitor\x20Success','Channel\x20doesn\x27t\x20exist','destinationchannel','StopMixMonitor','stop','%s.%s','StopMixMonitor\x20Success','queueChannels','voicequeuechannelhangup','Hangup','exten','context','trunks','outbound','campaigns','run','emit','event','faxAccounts','send','server','http','127.0.0.1','log','AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','util','jayson/promise'];(function(_0x193aaa,_0x1ec51f){var _0x3ae1ac=function(_0x1ff132){while(--_0x1ff132){_0x193aaa['push'](_0x193aaa['shift']());}};_0x3ae1ac(++_0x1ec51f);}(_0x126e,0x108));var _0xe126=function(_0x334841,_0x2bbc4c){_0x334841=_0x334841-0x0;var _0x5beb4b=_0x126e[_0x334841];return _0x5beb4b;};'use strict';var _=require('lodash');var util=require(_0xe126('0x0'));var jayson=require(_0xe126('0x1'));var schema=require(_0xe126('0x2'));var BPromise=require(_0xe126('0x3'));var moment=require(_0xe126('0x4'));var config=require(_0xe126('0x5'));var properties=require('../properties');var ami=require(_0xe126('0x6'));exports[_0xe126('0x7')]=function(_0x8cb81d,_0x34d705,_0x2f75a4){return new BPromise(function(_0x2162bd,_0x10210f){var _0x47ae76={'QueuePause':function(_0x316be0){return new Promise(function(_0x19f94e,_0x437fd0){var _0x308b01=util[_0xe126('0x8')]('%s/%s',_0xe126('0x9'),_0x316be0[_0xe126('0xa')]);if(_0x8cb81d['timers']&&_0x8cb81d[_0xe126('0xb')][_0x308b01]&&_0x8cb81d[_0xe126('0xb')][_0x308b01]['timer']){_0x8cb81d[_0xe126('0xb')][_0x308b01]['updateAcw']();}if(_0x8cb81d[_0xe126('0xc')][_0x308b01]){_0x8cb81d['agents'][_0x308b01][_0xe126('0xd')]({'statePause':_0x316be0[_0xe126('0xe')]?!![]:![]});}_0x19f94e({'code':0xc8,'message':_0xe126('0xf')});});},'Reload':function(_0x38b8c3){var _0x197c91=this;return new Promise(function(_0x1a57c4,_0x25f232){if(ami['isConnected']()==![]){return _0x25f232(_0x197c91[_0xe126('0x10')](0x1f4,[config[_0xe126('0x11')]['ip'],config['asterisk'][_0xe126('0x12')],_0xe126('0x13')][_0xe126('0x14')]('\x20')));}_0x38b8c3=_[_0xe126('0x15')](_0x38b8c3,_['keys'](properties[_0xe126('0x16')]));_0x38b8c3[_0xe126('0x17')]=_0xe126('0x18');return ami['Action'](_0x38b8c3)[_0xe126('0x19')](function(_0x553e29){_0x1a57c4({'code':0xc8,'message':_0x553e29[_0xe126('0x1a')]});})[_0xe126('0x1b')](function(_0x19b0a3){_0x25f232(_0x197c91[_0xe126('0x10')](0x1f5,_0x19b0a3[_0xe126('0x1a')]));});});},'Command':function(_0x2efb73){var _0x20874b=this;return new Promise(function(_0x397d26,_0x5cc73b){if(ami[_0xe126('0x1c')]()==![]){return _0x5cc73b(_0x20874b[_0xe126('0x10')](0x1f4,[config[_0xe126('0x11')]['ip'],config[_0xe126('0x11')][_0xe126('0x12')],_0xe126('0x13')][_0xe126('0x14')]('\x20')));}_0x2efb73=_[_0xe126('0x15')](_0x2efb73,'command');_0x2efb73['action']=_0xe126('0x1d');return ami[_0xe126('0x1e')](_0x2efb73)[_0xe126('0x19')](function(_0x5f1ce1){_0x397d26({'code':0xc8,'message':_0x5f1ce1['content']});})['catch'](function(_0x4807d3){_0x5cc73b(_0x20874b[_0xe126('0x10')](0x1f5,_0x4807d3['message']));});});},'VoiceQueues':function(_0x264082){return new Promise(function(_0x2f05ec,_0x4157ed){var _0x1674c9=[];for(var _0x532409 in _0x8cb81d['voiceQueues']){if(_0x8cb81d[_0xe126('0x1f')]['hasOwnProperty'](_0x532409)){var _0x3f5de5=_0x8cb81d[_0xe126('0x1f')][_0x532409];var _0x630bcc={'id':_0x3f5de5['id'],'name':_0x3f5de5['name'],'strategy':_0x3f5de5[_0xe126('0x20')],'answered':_0x3f5de5[_0xe126('0x21')],'available':_0x3f5de5['available'],'loggedIn':_0x3f5de5[_0xe126('0x22')],'pTalking':_0x3f5de5[_0xe126('0x23')],'sumBillable':_0x3f5de5['sumBillable'],'sumDuration':_0x3f5de5[_0xe126('0x24')],'sumHoldTime':_0x3f5de5[_0xe126('0x25')]||0x0,'talking':_0x3f5de5[_0xe126('0x26')],'total':_0x3f5de5[_0xe126('0x27')],'type':_0x3f5de5['type'],'unmanaged':_0x3f5de5[_0xe126('0x28')],'abandoned':_0x3f5de5[_0xe126('0x29')],'waiting':_0x3f5de5['waiting'],'loggedInDb':_0x3f5de5['loggedInDb']};if(_0x3f5de5[_0xe126('0x2a')]==='outbound'){_0x630bcc[_0xe126('0x2b')]=_0x3f5de5[_0xe126('0x2b')];_0x630bcc[_0xe126('0x2c')]=_0x3f5de5['dialMethod'];_0x630bcc[_0xe126('0x2d')]=_0x3f5de5[_0xe126('0x2d')];_0x630bcc[_0xe126('0x2e')]=_0x3f5de5['dialOriginateCallerIdNumber'];_0x630bcc[_0xe126('0x2f')]=_0x3f5de5[_0xe126('0x2f')];_0x630bcc['dialPrefix']=_0x3f5de5['dialPrefix'];_0x630bcc[_0xe126('0x30')]=_0x3f5de5[_0xe126('0x30')];_0x630bcc[_0xe126('0x31')]=_0x3f5de5[_0xe126('0x31')];_0x630bcc[_0xe126('0x32')]=_0x3f5de5[_0xe126('0x32')];_0x630bcc[_0xe126('0x33')]=_0x3f5de5[_0xe126('0x33')];_0x630bcc['outboundBusyCallsDay']=_0x3f5de5[_0xe126('0x34')];_0x630bcc[_0xe126('0x35')]=_0x3f5de5[_0xe126('0x35')];_0x630bcc[_0xe126('0x36')]=_0x3f5de5[_0xe126('0x36')];_0x630bcc[_0xe126('0x37')]=_0x3f5de5['outboundDropCallsDayCallersExit'];_0x630bcc[_0xe126('0x38')]=_0x3f5de5[_0xe126('0x38')];_0x630bcc[_0xe126('0x39')]=_0x3f5de5[_0xe126('0x39')];_0x630bcc[_0xe126('0x3a')]=_0x3f5de5['outboundNoSuchCallsDay'];_0x630bcc[_0xe126('0x3b')]=_0x3f5de5[_0xe126('0x3b')];_0x630bcc[_0xe126('0x3c')]=_0x3f5de5[_0xe126('0x3c')];_0x630bcc['outboundRejectCallsDay']=_0x3f5de5[_0xe126('0x3d')];_0x630bcc[_0xe126('0x3e')]=_0x3f5de5[_0xe126('0x3e')];_0x630bcc[_0xe126('0x3f')]=_0x3f5de5[_0xe126('0x3f')];_0x630bcc[_0xe126('0x40')]=_0x3f5de5['predictiveIntervalAvgHoldtime'];_0x630bcc[_0xe126('0x41')]=_0x3f5de5[_0xe126('0x41')];_0x630bcc[_0xe126('0x42')]=_0x3f5de5['predictiveIntervalDroppedCallsCallersExit'];_0x630bcc['predictiveIntervalDroppedCallsTimeout']=_0x3f5de5[_0xe126('0x43')];_0x630bcc[_0xe126('0x44')]=_0x3f5de5[_0xe126('0x44')];_0x630bcc[_0xe126('0x45')]=_0x3f5de5[_0xe126('0x45')];_0x630bcc[_0xe126('0x46')]=_0x3f5de5['predictiveIntervalHitRate'];_0x630bcc[_0xe126('0x47')]=_0x3f5de5[_0xe126('0x47')];_0x630bcc['predictiveIntervalPauses']=_0x3f5de5[_0xe126('0x48')];_0x630bcc[_0xe126('0x49')]=_0x3f5de5[_0xe126('0x49')];_0x630bcc['predictiveIntervalTotalCalls']=_0x3f5de5[_0xe126('0x4a')];_0x630bcc[_0xe126('0x1a')]=_0x3f5de5['message'];_0x630bcc[_0xe126('0x4b')]=_0x3f5de5[_0xe126('0x4b')];_0x630bcc['erlangCalls']=_0x3f5de5[_0xe126('0x4c')];_0x630bcc['erlangCallToSecond']=_0x3f5de5[_0xe126('0x4d')];_0x630bcc[_0xe126('0x4e')]=_0x3f5de5['erlangAbandonmentRate'];_0x630bcc[_0xe126('0x4f')]=_0x3f5de5[_0xe126('0x4f')];_0x630bcc[_0xe126('0x50')]=_0x3f5de5['startPredictive'];_0x630bcc[_0xe126('0x51')]=_0x3f5de5['startProgressive'];}if(_0x3f5de5[_0xe126('0x52')]){_0x630bcc[_0xe126('0x52')]={'id':_0x3f5de5[_0xe126('0x52')]['id'],'name':_0x3f5de5[_0xe126('0x52')][_0xe126('0xa')],'active':_0x3f5de5[_0xe126('0x52')][_0xe126('0x53')],'callerid':_0x3f5de5[_0xe126('0x52')][_0xe126('0x54')]};}if(_0x3f5de5[_0xe126('0x55')]){_0x630bcc[_0xe126('0x55')]={'id':_0x3f5de5['Interval']['id'],'name':_0x3f5de5['Interval'][_0xe126('0xa')]};}_0x1674c9[_0xe126('0x56')](_0x630bcc);}}_0x2f05ec({'count':_0x1674c9['length'],'rows':_0x1674c9});});},'UpdateVoiceQueue':function(_0x47217b){return new Promise(function(_0x1d5fcc,_0x1cae28){var _0x3d318a=_['find'](_0x8cb81d[_0xe126('0x1f')],{'id':parseInt(_0x47217b['id'])});var _0x132ef9=_[_0xe126('0x57')](_0x47217b,['id']);if(_0x3d318a){for(var _0x45ac4a in _0x132ef9){if(typeof _0x132ef9[_0x45ac4a]!==_0xe126('0x58')&&typeof _0x3d318a[_0x45ac4a]!==_0xe126('0x58')){_0x3d318a[_0x45ac4a]=_0x132ef9[_0x45ac4a];}}_0x1d5fcc(_0x3d318a);}else{_0x1cae28();}});},'VoiceChannels':function(_0x23fca2){return new Promise(function(_0xa8eae6,_0x23179a){var _0xccc25d=_[_0xe126('0x59')](_0x8cb81d[_0xe126('0x5a')]);_0xa8eae6({'count':_0xccc25d[_0xe126('0x5b')],'rows':_0xccc25d});});},'VoiceChannelMixMonitor':function(_0x4d30f6){var _0x581b4a=this;return new Promise(function(_0x589321,_0x4e34fc){if(ami[_0xe126('0x1c')]()==![]){return _0x4e34fc(_0x581b4a[_0xe126('0x10')](0x1f4,[config[_0xe126('0x11')]['ip'],config[_0xe126('0x11')][_0xe126('0x12')],_0xe126('0x13')][_0xe126('0x14')]('\x20')));}var _0x5ece85=schema(properties['voicechannel'])[_0xe126('0x2')](_0x4d30f6);if(_0x5ece85[_0xe126('0x5b')]>0x0){return _0x4e34fc(_0x581b4a['error'](0x1f4,_[_0xe126('0x5c')](_0x5ece85,_0xe126('0x1a'))['join'](',\x20')));}var _0x20d263=_[_0xe126('0x5d')](_0x8cb81d['channels'],{'uniqueid':_0x4d30f6['uniqueid']});if(_0x20d263&&_0x20d263[_0xe126('0x5e')]){var _0x1a9e13=util[_0xe126('0x8')]('%s.%s',_0x4d30f6[_0xe126('0x5f')]||_0x4d30f6['uniqueid'],_0x4d30f6[_0xe126('0x8')]||_0xe126('0x60'));return ami['Action']({'action':_0xe126('0x61'),'channel':_0x20d263[_0xe126('0x5e')],'file':_0x1a9e13,'options':'ai(mixmonitorid)'})['then'](function(_0x59c977){var _0x325a24=_[_0xe126('0x5d')](_0x20d263[_0xe126('0x62')],{'filename':_0xe126('0x63')+_0x1a9e13['toLowerCase']()});if(_[_0xe126('0x64')](_0x325a24)){_0x20d263[_0xe126('0x62')][_0xe126('0x56')]({'filename':_0xe126('0x63')+_0x1a9e13[_0xe126('0x65')](),'createdAt':moment()[_0xe126('0x8')](_0xe126('0x66')),'mixmonitorid':_0x59c977[_0xe126('0x67')],'status':_0xe126('0x68')});}else{_0x325a24[_0xe126('0x67')]=_0x59c977[_0xe126('0x67')];_0x325a24[_0xe126('0x69')]=_0xe126('0x68');}_0x589321({'code':0xc8,'message':[_0x4d30f6[_0xe126('0x6a')],_0xe126('0x6b'),_0x59c977[_0xe126('0x67')]][_0xe126('0x14')]('\x20'),'mixmonitorid':_0x59c977[_0xe126('0x67')]});})[_0xe126('0x1b')](function(_0xc7618f){_0x4e34fc(_0x581b4a[_0xe126('0x10')](0x1f5,[_0x4d30f6[_0xe126('0x6a')],_0xc7618f[_0xe126('0x1a')][_0xe126('0x65')]()][_0xe126('0x14')]('\x20')));});}else{return _0x4e34fc(_0x581b4a[_0xe126('0x10')](0x1f5,_0xe126('0x6c')));}});},'VoiceChannelStopMixMonitor':function(_0x4f9db8){var _0x222443=this;return new Promise(function(_0x20e5ba,_0xa4f1e5){if(ami[_0xe126('0x1c')]()==![]){return _0xa4f1e5(_0x222443[_0xe126('0x10')](0x1f4,[config['asterisk']['ip'],config[_0xe126('0x11')][_0xe126('0x12')],'ami\x20disconnected'][_0xe126('0x14')]('\x20')));}var _0x3ed82a=schema(properties['voicechannel'])[_0xe126('0x2')](_0x4f9db8);if(_0x3ed82a[_0xe126('0x5b')]>0x0){return _0xa4f1e5(_0x222443[_0xe126('0x10')](0x1f4,_[_0xe126('0x5c')](_0x3ed82a,_0xe126('0x1a'))[_0xe126('0x14')](',\x20')));}var _0x32d937=_['find'](_0x8cb81d[_0xe126('0x5a')],{'uniqueid':_0x4f9db8[_0xe126('0x6a')]});if(_0x32d937){return BPromise['resolve']()[_0xe126('0x19')](function(){if(_0x32d937[_0xe126('0x5e')]){return ami[_0xe126('0x1e')]({'action':'StopMixMonitor','channel':_0x32d937[_0xe126('0x5e')],'mixmonitorid':_0x4f9db8[_0xe126('0x67')]})[_0xe126('0x1b')](function(_0x349380){});}})[_0xe126('0x19')](function(){if(_0x32d937[_0xe126('0x6d')]){return ami[_0xe126('0x1e')]({'action':_0xe126('0x6e'),'channel':_0x32d937[_0xe126('0x6d')],'mixmonitorid':_0x4f9db8[_0xe126('0x67')]})[_0xe126('0x1b')](function(_0x2694cd){});}})[_0xe126('0x19')](function(_0x773bed){var _0x17be73=_[_0xe126('0x5d')](_0x32d937[_0xe126('0x62')],{'mixmonitorid':_0x4f9db8[_0xe126('0x67')]});if(_0x17be73){_0x17be73[_0xe126('0x69')]=_0xe126('0x6f');}})[_0xe126('0x19')](function(){var _0x2abfa0=util['format'](_0xe126('0x70'),_0x4f9db8[_0xe126('0x5f')]||_0x4f9db8[_0xe126('0x6a')],_0x4f9db8[_0xe126('0x8')]||_0xe126('0x60'));var _0x1f8891=_[_0xe126('0x5d')](_0x32d937[_0xe126('0x62')],{'filename':_0xe126('0x63')+_0x2abfa0[_0xe126('0x65')]()});if(_0x1f8891){_0x1f8891['status']=_0xe126('0x6f');}})[_0xe126('0x19')](function(){_0x20e5ba({'code':0xc8,'message':[_0x4f9db8[_0xe126('0x6a')],_0xe126('0x71')][_0xe126('0x14')]('\x20')});})[_0xe126('0x1b')](function(_0x13e742){_0xa4f1e5(_0x222443[_0xe126('0x10')](0x1f5,[_0x4f9db8[_0xe126('0x6a')],_0x13e742[_0xe126('0x1a')][_0xe126('0x65')]()][_0xe126('0x14')]('\x20')));});}else{return _0xa4f1e5(_0x222443[_0xe126('0x10')](0x1f5,_0xe126('0x6c')));}});},'VoiceQueuesChannels':function(_0x354da2){return new Promise(function(_0x250502,_0x900d93){var _0xe6ad99=_[_0xe126('0x59')](_0x8cb81d[_0xe126('0x72')]);_0x250502({'count':_0xe6ad99[_0xe126('0x5b')],'rows':_0xe6ad99});});},'VoiceQueuesChannel':function(_0x1ff7e8){var _0x3369c1=this;return new Promise(function(_0x284f1e,_0x540bc3){var _0x23b814=schema(properties['voicequeuechannel'])[_0xe126('0x2')](_0x1ff7e8);if(_0x23b814[_0xe126('0x5b')]>0x0){return _0x540bc3(_0x3369c1[_0xe126('0x10')](0x1f4,_[_0xe126('0x5c')](_0x23b814,_0xe126('0x1a'))[_0xe126('0x14')](',\x20')));}var _0x57a2d0=_[_0xe126('0x5d')](_0x8cb81d['queueChannels'],{'uniqueid':_0x1ff7e8[_0xe126('0x6a')]});if(_0x57a2d0){_0x284f1e(_0x57a2d0);}else{return _0x540bc3(_0x3369c1[_0xe126('0x10')](0x1f5,_0xe126('0x6c')));}});},'VoiceQueuesChannelHangup':function(_0x4d8504){var _0x107cb1=this;return new Promise(function(_0x33bc47,_0x3a4b05){if(ami[_0xe126('0x1c')]()==![]){return _0x3a4b05(_0x107cb1[_0xe126('0x10')](0x1f4,[config[_0xe126('0x11')]['ip'],config['asterisk'][_0xe126('0x12')],'ami\x20disconnected']['join']('\x20')));}var _0x4f072a=schema(properties[_0xe126('0x73')])[_0xe126('0x2')](_0x4d8504);if(_0x4f072a['length']>0x0){return _0x3a4b05(_0x107cb1[_0xe126('0x10')](0x1f4,_[_0xe126('0x5c')](_0x4f072a,_0xe126('0x1a'))[_0xe126('0x14')](',\x20')));}var _0x5aaa27=_[_0xe126('0x5d')](_0x8cb81d[_0xe126('0x72')],{'uniqueid':_0x4d8504[_0xe126('0x6a')]});if(_0x5aaa27&&_0x5aaa27[_0xe126('0x5e')]){return ami[_0xe126('0x1e')]({'action':_0xe126('0x74'),'channel':_0x5aaa27[_0xe126('0x5e')]})[_0xe126('0x19')](function(_0x29b60d){_0x33bc47({'code':0xc8,'message':[_0x4d8504['uniqueid'],_0x29b60d[_0xe126('0x1a')][_0xe126('0x65')]()]['join']('\x20')});})[_0xe126('0x1b')](function(_0x60a009){_0x3a4b05(_0x107cb1[_0xe126('0x10')](0x1f5,[_0x4d8504[_0xe126('0x6a')],_0x60a009[_0xe126('0x1a')][_0xe126('0x65')]()][_0xe126('0x14')]('\x20')));});}else{return _0x3a4b05(_0x107cb1[_0xe126('0x10')](0x1f5,_0xe126('0x6c')));}});},'VoiceQueuesChannelRedirect':function(_0x208ba2){var _0x1c473a=this;return new Promise(function(_0x4cf2d9,_0x1fde6a){if(ami[_0xe126('0x1c')]()==![]){return _0x1fde6a(_0x1c473a['error'](0x1f4,[config[_0xe126('0x11')]['ip'],config[_0xe126('0x11')][_0xe126('0x12')],'ami\x20disconnected'][_0xe126('0x14')]('\x20')));}var _0x53316f=schema(properties['voicequeuechannelredirect'])[_0xe126('0x2')](_0x208ba2);if(_0x53316f[_0xe126('0x5b')]>0x0){return _0x1fde6a(_0x1c473a['error'](0x1f4,_[_0xe126('0x5c')](_0x53316f,_0xe126('0x1a'))['join'](',\x20')));}var _0x3b6081=_[_0xe126('0x5d')](_0x8cb81d[_0xe126('0x72')],{'uniqueid':_0x208ba2['uniqueid']});if(_0x3b6081&&_0x3b6081[_0xe126('0x5e')]){return ami[_0xe126('0x1e')]({'action':'Redirect','channel':_0x3b6081[_0xe126('0x5e')],'exten':_0x208ba2[_0xe126('0x75')],'context':_0x208ba2['context']||_0x3b6081[_0xe126('0x76')],'priority':0x1})[_0xe126('0x19')](function(_0x1cb650){_0x4cf2d9({'code':0xc8,'message':[_0x208ba2['uniqueid'],_0x1cb650['message'][_0xe126('0x65')]()][_0xe126('0x14')]('\x20')});})['catch'](function(_0x818507){_0x1fde6a(_0x1c473a[_0xe126('0x10')](0x1f5,[_0x208ba2[_0xe126('0x6a')],_0x818507[_0xe126('0x1a')]['toLowerCase']()][_0xe126('0x14')]('\x20')));});}else{return _0x1fde6a(_0x1c473a[_0xe126('0x10')](0x1f5,_0xe126('0x6c')));}});},'Agents':function(_0x2afd51){return new Promise(function(_0x48df24,_0x15da1b){var _0x459ad2=_[_0xe126('0x59')](_0x8cb81d[_0xe126('0xc')]);_0x48df24({'count':_0x459ad2[_0xe126('0x5b')],'rows':_0x459ad2});});},'Telephones':function(_0x3eb441){return new Promise(function(_0xf3bc99,_0x17c4e1){var _0x39cd21=_['values'](_0x8cb81d['telephones']);_0xf3bc99({'count':_0x39cd21[_0xe126('0x5b')],'rows':_0x39cd21});});},'Trunks':function(_0x1baa43){return new Promise(function(_0x1c760c,_0x5878d1){var _0x58d681=_['values'](_0x8cb81d[_0xe126('0x77')]);_0x1c760c({'count':_0x58d681[_0xe126('0x5b')],'rows':_0x58d681});});},'OutboundChannels':function(_0x3cbd56){return new Promise(function(_0x1f52b0,_0x84d769){var _0x3b8ccb=_[_0xe126('0x59')](_0x8cb81d['outboundChannels']);_0x1f52b0({'count':_0x3b8ccb[_0xe126('0x5b')],'rows':_0x3b8ccb});});},'Outbound':function(_0x3d10fd){return new Promise(function(_0x5a2fb4,_0x306765){_0x5a2fb4(_0x8cb81d[_0xe126('0x78')]);});},'Campaigns':function(_0x1cb1a4){return new Promise(function(_0x498b43,_0x55b77b){var _0x3c691b=_[_0xe126('0x59')](_0x8cb81d[_0xe126('0x79')]);_0x498b43({'count':_0x3c691b[_0xe126('0x5b')],'rows':_0x3c691b});});},'VoiceQueuesPreview':function(_0x497667){var _0x55b686=this;return new Promise(function(_0x572e20,_0x253d2a){_0x34d705[_0xe126('0x7a')](_0x497667['id'])['then'](function(_0x481994){_0x572e20({'code':0xc8,'message':_0x481994[_0xe126('0x1a')]});})[_0xe126('0x1b')](function(_0x2dace4){_0x253d2a(_0x55b686['error'](0x1f4,_0x2dace4[_0xe126('0x1a')]));});});},'EventManager':function(_0x39a9fe){var _0x219a6d=this;return new Promise(function(_0x5e3493,_0x4917c0){if(!_0x39a9fe['event']){return _0x4917c0(_0x219a6d['error'](0x1f4,'Event\x20name\x20mandatory'));}ami[_0xe126('0x7b')]('custom:'+_0x39a9fe[_0xe126('0x7c')],_0x39a9fe[_0xe126('0x1a')]);_0x5e3493({'code':0xc8,'message':_0x39a9fe});});},'FaxAccounts':function(_0x163cbc){return new Promise(function(_0x5ddfa2,_0x34c87d){var _0x42b0b5=_[_0xe126('0x59')](_0x8cb81d[_0xe126('0x7d')]);_0x5ddfa2({'count':_0x42b0b5[_0xe126('0x5b')],'rows':_0x42b0b5});});},'SendFax':function(_0x431ce6){var _0x11d287=this;return new Promise(function(_0x3588f2,_0x581003){_0x2f75a4[_0xe126('0x7e')](_0x431ce6)['then'](function(_0x2c28b2){_0x3588f2({'code':0xc8,'message':_0x2c28b2[_0xe126('0x1a')]});})['catch'](function(_0x2ff5e8){_0x581003(_0x11d287[_0xe126('0x10')](0x1f4,_0x2ff5e8[_0xe126('0x1a')]));});});},'CheckAfterSend':function(_0x4e5c0f){var _0x5ad1dd=this;return new Promise(function(_0x2c1115,_0x236dcc){_0x2f75a4['checkAfterSend'](_0x4e5c0f)[_0xe126('0x19')](function(_0x2bfffe){_0x2c1115({'code':0xc8,'message':_0x2bfffe[_0xe126('0x1a')]});})['catch'](function(_0x2877e4){_0x236dcc(_0x5ad1dd['error'](0x1f4,_0x2877e4[_0xe126('0x1a')]));});});}};var _0x1fe77c=jayson[_0xe126('0x7f')](_0x47ae76)[_0xe126('0x80')]();_0x1fe77c['on']('error',function(_0x380606){return _0x10210f(_0x380606);});_0x1fe77c['listen'](0x232a,_0xe126('0x81'),function(){console[_0xe126('0x82')](_0xe126('0x83'),0x232a);return _0x2162bd(_0xe126('0x84')+0x232a);});});}; \ No newline at end of file +var _0x3f8a=['channels','uniqueid','%s.%s','filename','wav','MixMonitor','channel','ai(mixmonitorid)','monitors','isNil','push','/var/spool/asterisk/monitor/','toLowerCase','YYYY-MM-DD\x20HH:mm:ss','mixmonitorid','rec','status','MixMonitor\x20Success','Channel\x20doesn\x27t\x20exist','resolve','StopMixMonitor','destinationchannel','stop','StopMixMonitor\x20Success','queueChannels','voicequeuechannel','voicequeuechannelhangup','voicequeuechannelredirect','exten','context','values','telephones','campaigns','run','event','emit','custom:','faxAccounts','server','http','log','AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','lodash','util','jayson/promise','validate','moment','../../../config/environment','../properties','../ami','listen','format','%s/%s','name','timers','updateAcw','agents','updateStatusRealtime','pause','QueuePause','isConnected','asterisk','username','ami\x20disconnected','pick','keys','module','action','Reload','Action','then','message','catch','error','join','command','Command','voiceQueues','hasOwnProperty','answered','available','loggedIn','sumBillable','sumHoldTime','talking','total','type','unmanaged','abandoned','waiting','loggedInDb','outbound','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','temp','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','active','callerid','Interval','length','find','omit','undefined','voicechannel','map'];(function(_0x42bdad,_0x12836c){var _0x122626=function(_0x2eb29c){while(--_0x2eb29c){_0x42bdad['push'](_0x42bdad['shift']());}};_0x122626(++_0x12836c);}(_0x3f8a,0x1d5));var _0xa3f8=function(_0x29e030,_0x1c60cd){_0x29e030=_0x29e030-0x0;var _0x375763=_0x3f8a[_0x29e030];return _0x375763;};'use strict';var _=require(_0xa3f8('0x0'));var util=require(_0xa3f8('0x1'));var jayson=require(_0xa3f8('0x2'));var schema=require(_0xa3f8('0x3'));var BPromise=require('bluebird');var moment=require(_0xa3f8('0x4'));var config=require(_0xa3f8('0x5'));var properties=require(_0xa3f8('0x6'));var ami=require(_0xa3f8('0x7'));exports[_0xa3f8('0x8')]=function(_0x2847b4,_0x39d2e4,_0x471464){return new BPromise(function(_0x1f160a,_0xf895d9){var _0xcfea5={'QueuePause':function(_0x268332){return new Promise(function(_0x2faf2e,_0x2448de){var _0x2c89bb=util[_0xa3f8('0x9')](_0xa3f8('0xa'),'SIP',_0x268332[_0xa3f8('0xb')]);if(_0x2847b4[_0xa3f8('0xc')]&&_0x2847b4[_0xa3f8('0xc')][_0x2c89bb]&&_0x2847b4[_0xa3f8('0xc')][_0x2c89bb]['timer']){_0x2847b4[_0xa3f8('0xc')][_0x2c89bb][_0xa3f8('0xd')]();}if(_0x2847b4[_0xa3f8('0xe')][_0x2c89bb]){_0x2847b4[_0xa3f8('0xe')][_0x2c89bb][_0xa3f8('0xf')]({'statePause':_0x268332[_0xa3f8('0x10')]?!![]:![]});}_0x2faf2e({'code':0xc8,'message':_0xa3f8('0x11')});});},'Reload':function(_0x63de8b){var _0x324aa8=this;return new Promise(function(_0x36b1b8,_0x21b88f){if(ami[_0xa3f8('0x12')]()==![]){return _0x21b88f(_0x324aa8['error'](0x1f4,[config[_0xa3f8('0x13')]['ip'],config[_0xa3f8('0x13')][_0xa3f8('0x14')],_0xa3f8('0x15')]['join']('\x20')));}_0x63de8b=_[_0xa3f8('0x16')](_0x63de8b,_[_0xa3f8('0x17')](properties[_0xa3f8('0x18')]));_0x63de8b[_0xa3f8('0x19')]=_0xa3f8('0x1a');return ami[_0xa3f8('0x1b')](_0x63de8b)[_0xa3f8('0x1c')](function(_0x3e2e1c){_0x36b1b8({'code':0xc8,'message':_0x3e2e1c[_0xa3f8('0x1d')]});})[_0xa3f8('0x1e')](function(_0x54b870){_0x21b88f(_0x324aa8[_0xa3f8('0x1f')](0x1f5,_0x54b870['message']));});});},'Command':function(_0x9bb9db){var _0x3dc3e5=this;return new Promise(function(_0x191f99,_0x46042d){if(ami['isConnected']()==![]){return _0x46042d(_0x3dc3e5[_0xa3f8('0x1f')](0x1f4,[config['asterisk']['ip'],config[_0xa3f8('0x13')]['username'],_0xa3f8('0x15')][_0xa3f8('0x20')]('\x20')));}_0x9bb9db=_[_0xa3f8('0x16')](_0x9bb9db,_0xa3f8('0x21'));_0x9bb9db[_0xa3f8('0x19')]=_0xa3f8('0x22');return ami[_0xa3f8('0x1b')](_0x9bb9db)['then'](function(_0xae76ec){_0x191f99({'code':0xc8,'message':_0xae76ec['content']});})[_0xa3f8('0x1e')](function(_0xa5a697){_0x46042d(_0x3dc3e5[_0xa3f8('0x1f')](0x1f5,_0xa5a697[_0xa3f8('0x1d')]));});});},'VoiceQueues':function(_0x24ead6){return new Promise(function(_0x2c5d10,_0x6e3cb4){var _0x34884d=[];for(var _0x1e22b8 in _0x2847b4[_0xa3f8('0x23')]){if(_0x2847b4['voiceQueues'][_0xa3f8('0x24')](_0x1e22b8)){var _0x2d29c1=_0x2847b4[_0xa3f8('0x23')][_0x1e22b8];var _0x5a8fcf={'id':_0x2d29c1['id'],'name':_0x2d29c1[_0xa3f8('0xb')],'strategy':_0x2d29c1['strategy'],'answered':_0x2d29c1[_0xa3f8('0x25')],'available':_0x2d29c1[_0xa3f8('0x26')],'loggedIn':_0x2d29c1[_0xa3f8('0x27')],'pTalking':_0x2d29c1['pTalking'],'sumBillable':_0x2d29c1[_0xa3f8('0x28')],'sumDuration':_0x2d29c1['sumDuration'],'sumHoldTime':_0x2d29c1[_0xa3f8('0x29')]||0x0,'talking':_0x2d29c1[_0xa3f8('0x2a')],'total':_0x2d29c1[_0xa3f8('0x2b')],'type':_0x2d29c1[_0xa3f8('0x2c')],'unmanaged':_0x2d29c1[_0xa3f8('0x2d')],'abandoned':_0x2d29c1[_0xa3f8('0x2e')],'waiting':_0x2d29c1[_0xa3f8('0x2f')],'loggedInDb':_0x2d29c1[_0xa3f8('0x30')]};if(_0x2d29c1[_0xa3f8('0x2c')]===_0xa3f8('0x31')){_0x5a8fcf[_0xa3f8('0x32')]=_0x2d29c1['dialActive'];_0x5a8fcf[_0xa3f8('0x33')]=_0x2d29c1[_0xa3f8('0x33')];_0x5a8fcf[_0xa3f8('0x34')]=_0x2d29c1[_0xa3f8('0x34')];_0x5a8fcf[_0xa3f8('0x35')]=_0x2d29c1['dialOriginateCallerIdNumber'];_0x5a8fcf[_0xa3f8('0x36')]=_0x2d29c1[_0xa3f8('0x36')];_0x5a8fcf['dialPrefix']=_0x2d29c1[_0xa3f8('0x37')];_0x5a8fcf[_0xa3f8('0x38')]=_0x2d29c1['temp'];_0x5a8fcf[_0xa3f8('0x39')]=_0x2d29c1['outboundAnswerAgiCallsDay'];_0x5a8fcf['outboundAnswerCallsDay']=_0x2d29c1[_0xa3f8('0x3a')];_0x5a8fcf[_0xa3f8('0x3b')]=_0x2d29c1['outboundBlacklistCallsDay'];_0x5a8fcf[_0xa3f8('0x3c')]=_0x2d29c1['outboundBusyCallsDay'];_0x5a8fcf[_0xa3f8('0x3d')]=_0x2d29c1[_0xa3f8('0x3d')];_0x5a8fcf[_0xa3f8('0x3e')]=_0x2d29c1[_0xa3f8('0x3e')];_0x5a8fcf['outboundDropCallsDayCallersExit']=_0x2d29c1[_0xa3f8('0x3f')];_0x5a8fcf['outboundDropCallsDayTimeout']=_0x2d29c1[_0xa3f8('0x40')];_0x5a8fcf['outboundNoAnswerCallsDay']=_0x2d29c1[_0xa3f8('0x41')];_0x5a8fcf['outboundNoSuchCallsDay']=_0x2d29c1['outboundNoSuchCallsDay'];_0x5a8fcf['outboundOriginateFailureCallsDay']=_0x2d29c1[_0xa3f8('0x42')];_0x5a8fcf[_0xa3f8('0x43')]=_0x2d29c1[_0xa3f8('0x43')];_0x5a8fcf[_0xa3f8('0x44')]=_0x2d29c1['outboundRejectCallsDay'];_0x5a8fcf[_0xa3f8('0x45')]=_0x2d29c1[_0xa3f8('0x45')];_0x5a8fcf[_0xa3f8('0x46')]=_0x2d29c1[_0xa3f8('0x46')];_0x5a8fcf[_0xa3f8('0x47')]=_0x2d29c1[_0xa3f8('0x47')];_0x5a8fcf['predictiveIntervalAvgTalktime']=_0x2d29c1[_0xa3f8('0x48')];_0x5a8fcf[_0xa3f8('0x49')]=_0x2d29c1[_0xa3f8('0x49')];_0x5a8fcf['predictiveIntervalDroppedCallsTimeout']=_0x2d29c1[_0xa3f8('0x4a')];_0x5a8fcf[_0xa3f8('0x4b')]=_0x2d29c1['predictiveIntervalErlangCalls'];_0x5a8fcf[_0xa3f8('0x4c')]=_0x2d29c1['predictiveIntervalErlangCallsDroppedCalls'];_0x5a8fcf[_0xa3f8('0x4d')]=_0x2d29c1['predictiveIntervalHitRate'];_0x5a8fcf[_0xa3f8('0x4e')]=_0x2d29c1[_0xa3f8('0x4e')];_0x5a8fcf[_0xa3f8('0x4f')]=_0x2d29c1[_0xa3f8('0x4f')];_0x5a8fcf[_0xa3f8('0x50')]=_0x2d29c1['predictiveIntervalAvailable'];_0x5a8fcf[_0xa3f8('0x51')]=_0x2d29c1[_0xa3f8('0x51')];_0x5a8fcf['message']=_0x2d29c1[_0xa3f8('0x1d')];_0x5a8fcf['originated']=_0x2d29c1[_0xa3f8('0x52')];_0x5a8fcf[_0xa3f8('0x53')]=_0x2d29c1[_0xa3f8('0x53')];_0x5a8fcf[_0xa3f8('0x54')]=_0x2d29c1[_0xa3f8('0x54')];_0x5a8fcf['erlangAbandonmentRate']=_0x2d29c1[_0xa3f8('0x55')];_0x5a8fcf[_0xa3f8('0x56')]=_0x2d29c1[_0xa3f8('0x56')];_0x5a8fcf[_0xa3f8('0x57')]=_0x2d29c1[_0xa3f8('0x57')];_0x5a8fcf['startProgressive']=_0x2d29c1[_0xa3f8('0x58')];}if(_0x2d29c1[_0xa3f8('0x59')]){_0x5a8fcf[_0xa3f8('0x59')]={'id':_0x2d29c1[_0xa3f8('0x59')]['id'],'name':_0x2d29c1[_0xa3f8('0x59')][_0xa3f8('0xb')],'active':_0x2d29c1[_0xa3f8('0x59')][_0xa3f8('0x5a')],'callerid':_0x2d29c1[_0xa3f8('0x59')][_0xa3f8('0x5b')]};}if(_0x2d29c1[_0xa3f8('0x5c')]){_0x5a8fcf[_0xa3f8('0x5c')]={'id':_0x2d29c1[_0xa3f8('0x5c')]['id'],'name':_0x2d29c1['Interval']['name']};}_0x34884d['push'](_0x5a8fcf);}}_0x2c5d10({'count':_0x34884d[_0xa3f8('0x5d')],'rows':_0x34884d});});},'UpdateVoiceQueue':function(_0xd8587d){return new Promise(function(_0x1dfea0,_0x11c912){var _0x1d6b1a=_[_0xa3f8('0x5e')](_0x2847b4['voiceQueues'],{'id':parseInt(_0xd8587d['id'])});var _0x3c872f=_[_0xa3f8('0x5f')](_0xd8587d,['id']);if(_0x1d6b1a){for(var _0x14f8e0 in _0x3c872f){if(typeof _0x3c872f[_0x14f8e0]!==_0xa3f8('0x60')&&typeof _0x1d6b1a[_0x14f8e0]!=='undefined'){_0x1d6b1a[_0x14f8e0]=_0x3c872f[_0x14f8e0];}}_0x1dfea0(_0x1d6b1a);}else{_0x11c912();}});},'VoiceChannels':function(_0x286e2a){return new Promise(function(_0x49f583,_0x3e1286){var _0x523b46=_['values'](_0x2847b4['channels']);_0x49f583({'count':_0x523b46[_0xa3f8('0x5d')],'rows':_0x523b46});});},'VoiceChannelMixMonitor':function(_0xd3bbc8){var _0x5a2a7c=this;return new Promise(function(_0x2df379,_0x1f7af7){if(ami[_0xa3f8('0x12')]()==![]){return _0x1f7af7(_0x5a2a7c[_0xa3f8('0x1f')](0x1f4,[config[_0xa3f8('0x13')]['ip'],config[_0xa3f8('0x13')][_0xa3f8('0x14')],_0xa3f8('0x15')][_0xa3f8('0x20')]('\x20')));}var _0xe1f66d=schema(properties[_0xa3f8('0x61')])[_0xa3f8('0x3')](_0xd3bbc8);if(_0xe1f66d[_0xa3f8('0x5d')]>0x0){return _0x1f7af7(_0x5a2a7c[_0xa3f8('0x1f')](0x1f4,_[_0xa3f8('0x62')](_0xe1f66d,_0xa3f8('0x1d'))[_0xa3f8('0x20')](',\x20')));}var _0x559ae7=_['find'](_0x2847b4[_0xa3f8('0x63')],{'uniqueid':_0xd3bbc8[_0xa3f8('0x64')]});if(_0x559ae7&&_0x559ae7['channel']){var _0x291a65=util[_0xa3f8('0x9')](_0xa3f8('0x65'),_0xd3bbc8[_0xa3f8('0x66')]||_0xd3bbc8[_0xa3f8('0x64')],_0xd3bbc8[_0xa3f8('0x9')]||_0xa3f8('0x67'));return ami[_0xa3f8('0x1b')]({'action':_0xa3f8('0x68'),'channel':_0x559ae7[_0xa3f8('0x69')],'file':_0x291a65,'options':_0xa3f8('0x6a')})[_0xa3f8('0x1c')](function(_0x26df9d){var _0x39faad=_[_0xa3f8('0x5e')](_0x559ae7[_0xa3f8('0x6b')],{'filename':'/var/spool/asterisk/monitor/'+_0x291a65['toLowerCase']()});if(_[_0xa3f8('0x6c')](_0x39faad)){_0x559ae7['monitors'][_0xa3f8('0x6d')]({'filename':_0xa3f8('0x6e')+_0x291a65[_0xa3f8('0x6f')](),'createdAt':moment()['format'](_0xa3f8('0x70')),'mixmonitorid':_0x26df9d[_0xa3f8('0x71')],'status':_0xa3f8('0x72')});}else{_0x39faad[_0xa3f8('0x71')]=_0x26df9d['mixmonitorid'];_0x39faad[_0xa3f8('0x73')]='rec';}_0x2df379({'code':0xc8,'message':[_0xd3bbc8[_0xa3f8('0x64')],_0xa3f8('0x74'),_0x26df9d[_0xa3f8('0x71')]]['join']('\x20'),'mixmonitorid':_0x26df9d['mixmonitorid']});})[_0xa3f8('0x1e')](function(_0x1ef464){_0x1f7af7(_0x5a2a7c[_0xa3f8('0x1f')](0x1f5,[_0xd3bbc8[_0xa3f8('0x64')],_0x1ef464['message'][_0xa3f8('0x6f')]()][_0xa3f8('0x20')]('\x20')));});}else{return _0x1f7af7(_0x5a2a7c[_0xa3f8('0x1f')](0x1f5,_0xa3f8('0x75')));}});},'VoiceChannelStopMixMonitor':function(_0xc60091){var _0x4cb66c=this;return new Promise(function(_0x5d7877,_0x9833a){if(ami[_0xa3f8('0x12')]()==![]){return _0x9833a(_0x4cb66c[_0xa3f8('0x1f')](0x1f4,[config[_0xa3f8('0x13')]['ip'],config[_0xa3f8('0x13')][_0xa3f8('0x14')],_0xa3f8('0x15')]['join']('\x20')));}var _0x50f987=schema(properties['voicechannel'])[_0xa3f8('0x3')](_0xc60091);if(_0x50f987[_0xa3f8('0x5d')]>0x0){return _0x9833a(_0x4cb66c[_0xa3f8('0x1f')](0x1f4,_[_0xa3f8('0x62')](_0x50f987,_0xa3f8('0x1d'))[_0xa3f8('0x20')](',\x20')));}var _0x356643=_[_0xa3f8('0x5e')](_0x2847b4['channels'],{'uniqueid':_0xc60091[_0xa3f8('0x64')]});if(_0x356643){return BPromise[_0xa3f8('0x76')]()[_0xa3f8('0x1c')](function(){if(_0x356643[_0xa3f8('0x69')]){return ami[_0xa3f8('0x1b')]({'action':_0xa3f8('0x77'),'channel':_0x356643[_0xa3f8('0x69')],'mixmonitorid':_0xc60091['mixmonitorid']})[_0xa3f8('0x1e')](function(_0x2f7ca1){});}})['then'](function(){if(_0x356643[_0xa3f8('0x78')]){return ami[_0xa3f8('0x1b')]({'action':_0xa3f8('0x77'),'channel':_0x356643[_0xa3f8('0x78')],'mixmonitorid':_0xc60091[_0xa3f8('0x71')]})[_0xa3f8('0x1e')](function(_0x2ebfaf){});}})['then'](function(_0x4c779b){var _0x896e29=_['find'](_0x356643[_0xa3f8('0x6b')],{'mixmonitorid':_0xc60091[_0xa3f8('0x71')]});if(_0x896e29){_0x896e29[_0xa3f8('0x73')]=_0xa3f8('0x79');}})[_0xa3f8('0x1c')](function(){var _0x35d4d6=util[_0xa3f8('0x9')](_0xa3f8('0x65'),_0xc60091[_0xa3f8('0x66')]||_0xc60091[_0xa3f8('0x64')],_0xc60091[_0xa3f8('0x9')]||_0xa3f8('0x67'));var _0x2edffa=_['find'](_0x356643[_0xa3f8('0x6b')],{'filename':_0xa3f8('0x6e')+_0x35d4d6[_0xa3f8('0x6f')]()});if(_0x2edffa){_0x2edffa[_0xa3f8('0x73')]=_0xa3f8('0x79');}})[_0xa3f8('0x1c')](function(){_0x5d7877({'code':0xc8,'message':[_0xc60091['uniqueid'],_0xa3f8('0x7a')][_0xa3f8('0x20')]('\x20')});})[_0xa3f8('0x1e')](function(_0x28535b){_0x9833a(_0x4cb66c[_0xa3f8('0x1f')](0x1f5,[_0xc60091[_0xa3f8('0x64')],_0x28535b[_0xa3f8('0x1d')][_0xa3f8('0x6f')]()][_0xa3f8('0x20')]('\x20')));});}else{return _0x9833a(_0x4cb66c[_0xa3f8('0x1f')](0x1f5,_0xa3f8('0x75')));}});},'VoiceQueuesChannels':function(_0x5d4fe5){return new Promise(function(_0x14de37,_0x1b6343){var _0x47af5b=_['values'](_0x2847b4[_0xa3f8('0x7b')]);_0x14de37({'count':_0x47af5b[_0xa3f8('0x5d')],'rows':_0x47af5b});});},'VoiceQueuesChannel':function(_0x2c0f71){var _0x1b3cd9=this;return new Promise(function(_0x1563a4,_0x219d84){var _0xe06bc2=schema(properties[_0xa3f8('0x7c')])['validate'](_0x2c0f71);if(_0xe06bc2[_0xa3f8('0x5d')]>0x0){return _0x219d84(_0x1b3cd9[_0xa3f8('0x1f')](0x1f4,_[_0xa3f8('0x62')](_0xe06bc2,'message')[_0xa3f8('0x20')](',\x20')));}var _0x150446=_['find'](_0x2847b4[_0xa3f8('0x7b')],{'uniqueid':_0x2c0f71[_0xa3f8('0x64')]});if(_0x150446){_0x1563a4(_0x150446);}else{return _0x219d84(_0x1b3cd9[_0xa3f8('0x1f')](0x1f5,_0xa3f8('0x75')));}});},'VoiceQueuesChannelHangup':function(_0x162436){var _0x1c17b9=this;return new Promise(function(_0x451278,_0x1de9f3){if(ami[_0xa3f8('0x12')]()==![]){return _0x1de9f3(_0x1c17b9['error'](0x1f4,[config[_0xa3f8('0x13')]['ip'],config['asterisk'][_0xa3f8('0x14')],'ami\x20disconnected'][_0xa3f8('0x20')]('\x20')));}var _0xe52095=schema(properties[_0xa3f8('0x7d')])[_0xa3f8('0x3')](_0x162436);if(_0xe52095[_0xa3f8('0x5d')]>0x0){return _0x1de9f3(_0x1c17b9['error'](0x1f4,_[_0xa3f8('0x62')](_0xe52095,_0xa3f8('0x1d'))['join'](',\x20')));}var _0x1219a5=_[_0xa3f8('0x5e')](_0x2847b4[_0xa3f8('0x7b')],{'uniqueid':_0x162436[_0xa3f8('0x64')]});if(_0x1219a5&&_0x1219a5[_0xa3f8('0x69')]){return ami[_0xa3f8('0x1b')]({'action':'Hangup','channel':_0x1219a5[_0xa3f8('0x69')]})[_0xa3f8('0x1c')](function(_0x42534e){_0x451278({'code':0xc8,'message':[_0x162436['uniqueid'],_0x42534e[_0xa3f8('0x1d')]['toLowerCase']()][_0xa3f8('0x20')]('\x20')});})['catch'](function(_0x5a9590){_0x1de9f3(_0x1c17b9[_0xa3f8('0x1f')](0x1f5,[_0x162436['uniqueid'],_0x5a9590[_0xa3f8('0x1d')]['toLowerCase']()][_0xa3f8('0x20')]('\x20')));});}else{return _0x1de9f3(_0x1c17b9[_0xa3f8('0x1f')](0x1f5,_0xa3f8('0x75')));}});},'VoiceQueuesChannelRedirect':function(_0x3c2af6){var _0x55bb2c=this;return new Promise(function(_0xb9a8c,_0x35db48){if(ami['isConnected']()==![]){return _0x35db48(_0x55bb2c[_0xa3f8('0x1f')](0x1f4,[config[_0xa3f8('0x13')]['ip'],config[_0xa3f8('0x13')][_0xa3f8('0x14')],_0xa3f8('0x15')][_0xa3f8('0x20')]('\x20')));}var _0x190ce8=schema(properties[_0xa3f8('0x7e')])[_0xa3f8('0x3')](_0x3c2af6);if(_0x190ce8[_0xa3f8('0x5d')]>0x0){return _0x35db48(_0x55bb2c['error'](0x1f4,_[_0xa3f8('0x62')](_0x190ce8,_0xa3f8('0x1d'))[_0xa3f8('0x20')](',\x20')));}var _0x5908f3=_[_0xa3f8('0x5e')](_0x2847b4[_0xa3f8('0x7b')],{'uniqueid':_0x3c2af6[_0xa3f8('0x64')]});if(_0x5908f3&&_0x5908f3[_0xa3f8('0x69')]){return ami[_0xa3f8('0x1b')]({'action':'Redirect','channel':_0x5908f3[_0xa3f8('0x69')],'exten':_0x3c2af6[_0xa3f8('0x7f')],'context':_0x3c2af6[_0xa3f8('0x80')]||_0x5908f3[_0xa3f8('0x80')],'priority':0x1})[_0xa3f8('0x1c')](function(_0x319801){_0xb9a8c({'code':0xc8,'message':[_0x3c2af6['uniqueid'],_0x319801[_0xa3f8('0x1d')][_0xa3f8('0x6f')]()][_0xa3f8('0x20')]('\x20')});})[_0xa3f8('0x1e')](function(_0x4c47e6){_0x35db48(_0x55bb2c[_0xa3f8('0x1f')](0x1f5,[_0x3c2af6[_0xa3f8('0x64')],_0x4c47e6[_0xa3f8('0x1d')][_0xa3f8('0x6f')]()][_0xa3f8('0x20')]('\x20')));});}else{return _0x35db48(_0x55bb2c[_0xa3f8('0x1f')](0x1f5,_0xa3f8('0x75')));}});},'Agents':function(_0x21a676){return new Promise(function(_0x23cd5e,_0x1a2b96){var _0x36fc17=_['values'](_0x2847b4[_0xa3f8('0xe')]);_0x23cd5e({'count':_0x36fc17['length'],'rows':_0x36fc17});});},'Telephones':function(_0x125bfb){return new Promise(function(_0x355922,_0x278436){var _0x6a1e95=_[_0xa3f8('0x81')](_0x2847b4[_0xa3f8('0x82')]);_0x355922({'count':_0x6a1e95[_0xa3f8('0x5d')],'rows':_0x6a1e95});});},'Trunks':function(_0x365688){return new Promise(function(_0x4bb7dd,_0x2c6efe){var _0x4f9513=_[_0xa3f8('0x81')](_0x2847b4['trunks']);_0x4bb7dd({'count':_0x4f9513[_0xa3f8('0x5d')],'rows':_0x4f9513});});},'OutboundChannels':function(_0x5bce46){return new Promise(function(_0x2e0221,_0x29947a){var _0x3bb8f8=_[_0xa3f8('0x81')](_0x2847b4['outboundChannels']);_0x2e0221({'count':_0x3bb8f8[_0xa3f8('0x5d')],'rows':_0x3bb8f8});});},'Outbound':function(_0x3d343f){return new Promise(function(_0x456e21,_0x2710bd){_0x456e21(_0x2847b4[_0xa3f8('0x31')]);});},'Campaigns':function(_0x428229){return new Promise(function(_0x54f215,_0x22d4a8){var _0x355d28=_[_0xa3f8('0x81')](_0x2847b4[_0xa3f8('0x83')]);_0x54f215({'count':_0x355d28[_0xa3f8('0x5d')],'rows':_0x355d28});});},'VoiceQueuesPreview':function(_0x565a10){var _0x20309d=this;return new Promise(function(_0x2908aa,_0x59ddc4){_0x39d2e4[_0xa3f8('0x84')](_0x565a10['id'])[_0xa3f8('0x1c')](function(_0x169fa0){_0x2908aa({'code':0xc8,'message':_0x169fa0['message']});})[_0xa3f8('0x1e')](function(_0x28c648){_0x59ddc4(_0x20309d[_0xa3f8('0x1f')](0x1f4,_0x28c648[_0xa3f8('0x1d')]));});});},'EventManager':function(_0x137c29){var _0x294272=this;return new Promise(function(_0x3b30b2,_0x4e4386){if(!_0x137c29[_0xa3f8('0x85')]){return _0x4e4386(_0x294272[_0xa3f8('0x1f')](0x1f4,'Event\x20name\x20mandatory'));}ami[_0xa3f8('0x86')](_0xa3f8('0x87')+_0x137c29[_0xa3f8('0x85')],_0x137c29[_0xa3f8('0x1d')]);_0x3b30b2({'code':0xc8,'message':_0x137c29});});},'FaxAccounts':function(_0x2d59c4){return new Promise(function(_0x2a5d75,_0x19a8c1){var _0x525a21=_[_0xa3f8('0x81')](_0x2847b4[_0xa3f8('0x88')]);_0x2a5d75({'count':_0x525a21[_0xa3f8('0x5d')],'rows':_0x525a21});});},'SendFax':function(_0x2eaf1e){var _0x39494d=this;return new Promise(function(_0x1673ac,_0xb1dca4){_0x471464['send'](_0x2eaf1e)[_0xa3f8('0x1c')](function(_0x1c0002){_0x1673ac({'code':0xc8,'message':_0x1c0002[_0xa3f8('0x1d')]});})[_0xa3f8('0x1e')](function(_0x53fb90){_0xb1dca4(_0x39494d['error'](0x1f4,_0x53fb90[_0xa3f8('0x1d')]));});});},'CheckAfterSend':function(_0x5152a1){var _0x36f6c4=this;return new Promise(function(_0xff412a,_0x323d48){_0x471464['checkAfterSend'](_0x5152a1)['then'](function(_0xf69e0c){_0xff412a({'code':0xc8,'message':_0xf69e0c[_0xa3f8('0x1d')]});})[_0xa3f8('0x1e')](function(_0x2edbad){_0x323d48(_0x36f6c4['error'](0x1f4,_0x2edbad[_0xa3f8('0x1d')]));});});}};var _0x5379e0=jayson[_0xa3f8('0x89')](_0xcfea5)[_0xa3f8('0x8a')]();_0x5379e0['on'](_0xa3f8('0x1f'),function(_0x4abe82){return _0xf895d9(_0x4abe82);});_0x5379e0['listen'](0x232a,'127.0.0.1',function(){console[_0xa3f8('0x8b')](_0xa3f8('0x8c'),0x232a);return _0x1f160a(_0xa3f8('0x8d')+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 6edfad8..38acd97 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 _0xd0bb=['format','user:%s','name','trigger:%s','merge','lodash','bluebird','ioredis','../../../../config/environment','trigger','../../rpc/cmContact','defaults','localhost','socket.io-emitter','redis','info','[CM][%s][%s]','stringify','data1','data2','isNil','data5','xmd-contactid','data3','split','phone','$or','routeId','destcalleridnum','calleridnum','firstName','fax','ListId','createdAt','scheduledAt','union','resolve','getContacts','isEmpty','length','[CM][%s][%s]\x20Contact\x20found:%s','uniqueid','map','join','[CM][%s][%s]\x20Contact\x20not\x20found','data4','calleridname','','destcalleridname','Unknown','then','createContact','push','[CM][%s][%s]\x20Autocreate\x20disabled'];(function(_0x33593e,_0x22ddd3){var _0x53db1a=function(_0x499ee5){while(--_0x499ee5){_0x33593e['push'](_0x33593e['shift']());}};_0x53db1a(++_0x22ddd3);}(_0xd0bb,0x1eb));var _0xbd0b=function(_0x3aeb9b,_0x3f3ff2){_0x3aeb9b=_0x3aeb9b-0x0;var _0x5e318f=_0xd0bb[_0x3aeb9b];return _0x5e318f;};'use strict';var _=require(_0xbd0b('0x0'));var BPromise=require(_0xbd0b('0x1'));var Redis=require(_0xbd0b('0x2'));var util=require('util');var config=require(_0xbd0b('0x3'));var logger=require('../../../../config/logger')(_0xbd0b('0x4'));var cmContactRpc=require(_0xbd0b('0x5'));config['redis']=_[_0xbd0b('0x6')](config['redis'],{'host':_0xbd0b('0x7'),'port':0x18eb});var io=require(_0xbd0b('0x8'))(new Redis(config[_0xbd0b('0x9')]));function emit(_0x37c205,_0x809599,_0x5eb975,_0x2a4075,_0x4533ff){logger[_0xbd0b('0xa')](_0xbd0b('0xb'),_0x37c205,_0x809599['id'],_0x5eb975,_0x2a4075,JSON[_0xbd0b('0xc')](_0x4533ff));io['to'](_0x5eb975)['emit'](_0x2a4075,_0x4533ff);}exports['exec']=function(_0x14bc5b,_0x110cf1,_0x4a69ff,_0x26b834){var _0x196beb,_0x526258;var _0x1e3173={};var _0x15919b=Number(_0x4a69ff[_0xbd0b('0xd')]);var _0x315ed9=_0x4a69ff[_0xbd0b('0xe')]?Boolean(Number(_0x4a69ff[_0xbd0b('0xe')])):![];var _0x420f96;var _0x1f25b6=![];if(!_[_0xbd0b('0xf')](_0x4a69ff[_0xbd0b('0x10')])){if(_0x4a69ff[_0xbd0b('0x10')]=='1')_0x1f25b6=!![];}if(!_0x1f25b6){if(_0x26b834['xmd-contactid']){_0x1e3173['id']=_0x26b834[_0xbd0b('0x11')];}}if(!_0x1e3173['id']){_0x1e3173['ListId']=_0x15919b;_0x420f96=_0x4a69ff['data3']&&_0x4a69ff[_0xbd0b('0x12')]!=='0'?_0x4a69ff[_0xbd0b('0x12')][_0xbd0b('0x13')](','):[_0xbd0b('0x14')];_0x1e3173[_0xbd0b('0x15')]=_['map'](_0x420f96,function(_0x55e0a1){var _0x2136ef={};_0x2136ef[_0x55e0a1]=_0x26b834[_0xbd0b('0x16')]?_0x26b834[_0xbd0b('0x17')]:_0x26b834[_0xbd0b('0x18')];return _0x2136ef;});}var _0x1c0a7c=['id',_0xbd0b('0x19'),'lastName',_0xbd0b('0x14'),'mobile',_0xbd0b('0x1a'),_0xbd0b('0x1b'),_0xbd0b('0x1c'),_0xbd0b('0x1d'),'updatedAt'];var _0x403c91=_[_0xbd0b('0x1e')](_0x1c0a7c,_0x420f96);BPromise[_0xbd0b('0x1f')]()['then'](cmContactRpc[_0xbd0b('0x20')]({'attributes':_0x403c91,'where':_0x1e3173}))['then'](function(_0xc66b8){_0x526258=_0xc66b8;if(!_[_0xbd0b('0x21')](_0x526258)){if(_0x526258[_0xbd0b('0x22')]===0x1){_0x196beb=_0x526258[0x0];logger[_0xbd0b('0xa')](_0xbd0b('0x23'),_0x26b834['uniqueid'],_0x110cf1['id'],_0x196beb['id']);}else{logger[_0xbd0b('0xa')]('[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]',_0x26b834[_0xbd0b('0x24')],_0x110cf1['id'],_[_0xbd0b('0x25')](_0x526258,'id')[_0xbd0b('0x26')](','));}return;}else{logger[_0xbd0b('0xa')](_0xbd0b('0x27'),_0x26b834[_0xbd0b('0x24')],_0x110cf1['id']);var _0x4fe9ed={'ListId':_0x15919b};var _0x382f76=_0x4a69ff[_0xbd0b('0x28')]&&_0x4a69ff[_0xbd0b('0x28')]!=='0'?_0x4a69ff[_0xbd0b('0x28')]:_0xbd0b('0x14');if(_0x315ed9){logger[_0xbd0b('0xa')]('[CM][%s][%s]\x20Autocreate\x20enabled',_0x26b834[_0xbd0b('0x24')],_0x110cf1['id']);_0x4fe9ed[_0x382f76]=_[_0xbd0b('0xf')](_0x26b834[_0xbd0b('0x16')])?_0x26b834['calleridnum']:_0x26b834['destcalleridnum'];if(_[_0xbd0b('0xf')](_0x26b834[_0xbd0b('0x16')])){_0x4fe9ed[_0xbd0b('0x19')]=_0x26b834[_0xbd0b('0x29')]&&_0x26b834[_0xbd0b('0x29')]!==_0xbd0b('0x2a')?_0x26b834[_0xbd0b('0x29')]:'Unknown';}else{_0x4fe9ed[_0xbd0b('0x19')]=_0x26b834[_0xbd0b('0x2b')]&&_0x26b834['destcalleridname']!==''?_0x26b834[_0xbd0b('0x2b')]:_0xbd0b('0x2c');}return BPromise['resolve']()[_0xbd0b('0x2d')](cmContactRpc[_0xbd0b('0x2e')](_0x4fe9ed))[_0xbd0b('0x2d')](function(_0x417e25){_0x196beb=_0x417e25;_0x526258[_0xbd0b('0x2f')](_0x417e25);if(_0x196beb){logger[_0xbd0b('0xa')]('[CM][%s][%s]\x20Contact\x20created:%s',_0x26b834[_0xbd0b('0x24')],_0x110cf1['id'],_0x196beb['id']);}return;});}else{logger[_0xbd0b('0xa')](_0xbd0b('0x30'),_0x26b834[_0xbd0b('0x24')],_0x110cf1['id']);_0x4fe9ed[_0x382f76]=_[_0xbd0b('0xf')](_0x26b834[_0xbd0b('0x16')])?_0x26b834[_0xbd0b('0x18')]:_0x26b834[_0xbd0b('0x17')];if(_[_0xbd0b('0xf')](_0x26b834[_0xbd0b('0x16')])){_0x4fe9ed[_0xbd0b('0x19')]=_0x26b834[_0xbd0b('0x29')]&&_0x26b834[_0xbd0b('0x29')]!==_0xbd0b('0x2a')?_0x26b834['calleridname']:_0xbd0b('0x2c');}else{_0x4fe9ed[_0xbd0b('0x19')]=_0x26b834['destcalleridname']&&_0x26b834[_0xbd0b('0x2b')]!==_0xbd0b('0x2a')?_0x26b834[_0xbd0b('0x2b')]:_0xbd0b('0x2c');}_0x196beb=_0x4fe9ed;_0x526258[_0xbd0b('0x2f')](_0x4fe9ed);return;}}})[_0xbd0b('0x2d')](function(){if(_0x14bc5b){emit(_0x26b834['uniqueid'],_0x110cf1,util[_0xbd0b('0x31')](_0xbd0b('0x32'),_0x14bc5b[_0xbd0b('0x33')]),util[_0xbd0b('0x31')](_0xbd0b('0x34'),_0x4a69ff['action']['toLowerCase']()),{'evt':_[_0xbd0b('0x35')](_0x26b834,{'autoCreate':_0x315ed9}),'contact':_0x196beb===undefined?{}:_0x196beb,'contacts':_0x526258[_0xbd0b('0x22')]===0x0?undefined:_0x526258});}});}; \ No newline at end of file +var _0x54ef=['../../rpc/cmContact','redis','defaults','info','[CM][%s][%s]','emit','exec','data1','data2','isNil','data5','xmd-contactid','ListId','data3','split','map','routeId','destcalleridnum','calleridnum','firstName','lastName','phone','mobile','createdAt','updatedAt','union','resolve','then','getContacts','isEmpty','length','uniqueid','[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]','join','[CM][%s][%s]\x20Contact\x20not\x20found','data4','[CM][%s][%s]\x20Autocreate\x20enabled','calleridname','Unknown','destcalleridname','','createContact','push','[CM][%s][%s]\x20Autocreate\x20disabled','format','name','trigger:%s','action','toLowerCase','merge','lodash','bluebird','ioredis','../../../../config/environment','../../../../config/logger','trigger'];(function(_0x5300b6,_0x4a5846){var _0x58980e=function(_0x1bdee5){while(--_0x1bdee5){_0x5300b6['push'](_0x5300b6['shift']());}};_0x58980e(++_0x4a5846);}(_0x54ef,0x112));var _0xf54e=function(_0x34c5a5,_0x517c05){_0x34c5a5=_0x34c5a5-0x0;var _0x44f660=_0x54ef[_0x34c5a5];return _0x44f660;};'use strict';var _=require(_0xf54e('0x0'));var BPromise=require(_0xf54e('0x1'));var Redis=require(_0xf54e('0x2'));var util=require('util');var config=require(_0xf54e('0x3'));var logger=require(_0xf54e('0x4'))(_0xf54e('0x5'));var cmContactRpc=require(_0xf54e('0x6'));config[_0xf54e('0x7')]=_[_0xf54e('0x8')](config[_0xf54e('0x7')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xf54e('0x7')]));function emit(_0x99cf9,_0x2464ae,_0x561870,_0x27e69b,_0x57a1ce){logger[_0xf54e('0x9')](_0xf54e('0xa'),_0x99cf9,_0x2464ae['id'],_0x561870,_0x27e69b,JSON['stringify'](_0x57a1ce));io['to'](_0x561870)[_0xf54e('0xb')](_0x27e69b,_0x57a1ce);}exports[_0xf54e('0xc')]=function(_0x6b9e61,_0x3ecfb3,_0x5f232a,_0x558502){var _0xc939ab,_0x143d66;var _0x326eef={};var _0x553759=Number(_0x5f232a[_0xf54e('0xd')]);var _0x4b0ee1=_0x5f232a['data2']?Boolean(Number(_0x5f232a[_0xf54e('0xe')])):![];var _0x2033e9;var _0x28f776=![];if(!_[_0xf54e('0xf')](_0x5f232a['data5'])){if(_0x5f232a[_0xf54e('0x10')]=='1')_0x28f776=!![];}if(!_0x28f776){if(_0x558502[_0xf54e('0x11')]){_0x326eef['id']=_0x558502[_0xf54e('0x11')];}}if(!_0x326eef['id']){_0x326eef[_0xf54e('0x12')]=_0x553759;_0x2033e9=_0x5f232a['data3']&&_0x5f232a[_0xf54e('0x13')]!=='0'?_0x5f232a[_0xf54e('0x13')][_0xf54e('0x14')](','):['phone'];_0x326eef['$or']=_[_0xf54e('0x15')](_0x2033e9,function(_0x41fb35){var _0x1c02e7={};_0x1c02e7[_0x41fb35]=_0x558502[_0xf54e('0x16')]?_0x558502[_0xf54e('0x17')]:_0x558502[_0xf54e('0x18')];return _0x1c02e7;});}var _0x2e27b6=['id',_0xf54e('0x19'),_0xf54e('0x1a'),_0xf54e('0x1b'),_0xf54e('0x1c'),'fax','ListId',_0xf54e('0x1d'),'scheduledAt',_0xf54e('0x1e')];var _0x1bfe99=_[_0xf54e('0x1f')](_0x2e27b6,_0x2033e9);BPromise[_0xf54e('0x20')]()[_0xf54e('0x21')](cmContactRpc[_0xf54e('0x22')]({'attributes':_0x1bfe99,'where':_0x326eef}))[_0xf54e('0x21')](function(_0x11985e){_0x143d66=_0x11985e;if(!_[_0xf54e('0x23')](_0x143d66)){if(_0x143d66[_0xf54e('0x24')]===0x1){_0xc939ab=_0x143d66[0x0];logger[_0xf54e('0x9')]('[CM][%s][%s]\x20Contact\x20found:%s',_0x558502[_0xf54e('0x25')],_0x3ecfb3['id'],_0xc939ab['id']);}else{logger['info'](_0xf54e('0x26'),_0x558502[_0xf54e('0x25')],_0x3ecfb3['id'],_[_0xf54e('0x15')](_0x143d66,'id')[_0xf54e('0x27')](','));}return;}else{logger[_0xf54e('0x9')](_0xf54e('0x28'),_0x558502[_0xf54e('0x25')],_0x3ecfb3['id']);var _0x43488d={'ListId':_0x553759};var _0x2342a9=_0x5f232a[_0xf54e('0x29')]&&_0x5f232a[_0xf54e('0x29')]!=='0'?_0x5f232a[_0xf54e('0x29')]:_0xf54e('0x1b');if(_0x4b0ee1){logger['info'](_0xf54e('0x2a'),_0x558502['uniqueid'],_0x3ecfb3['id']);_0x43488d[_0x2342a9]=_[_0xf54e('0xf')](_0x558502['routeId'])?_0x558502[_0xf54e('0x18')]:_0x558502[_0xf54e('0x17')];if(_[_0xf54e('0xf')](_0x558502[_0xf54e('0x16')])){_0x43488d[_0xf54e('0x19')]=_0x558502[_0xf54e('0x2b')]&&_0x558502[_0xf54e('0x2b')]!==''?_0x558502['calleridname']:_0xf54e('0x2c');}else{_0x43488d[_0xf54e('0x19')]=_0x558502[_0xf54e('0x2d')]&&_0x558502[_0xf54e('0x2d')]!==_0xf54e('0x2e')?_0x558502[_0xf54e('0x2d')]:_0xf54e('0x2c');}return BPromise[_0xf54e('0x20')]()[_0xf54e('0x21')](cmContactRpc[_0xf54e('0x2f')](_0x43488d))['then'](function(_0x5f29d3){_0xc939ab=_0x5f29d3;_0x143d66[_0xf54e('0x30')](_0x5f29d3);if(_0xc939ab){logger[_0xf54e('0x9')]('[CM][%s][%s]\x20Contact\x20created:%s',_0x558502[_0xf54e('0x25')],_0x3ecfb3['id'],_0xc939ab['id']);}return;});}else{logger[_0xf54e('0x9')](_0xf54e('0x31'),_0x558502[_0xf54e('0x25')],_0x3ecfb3['id']);_0x43488d[_0x2342a9]=_['isNil'](_0x558502['routeId'])?_0x558502['calleridnum']:_0x558502[_0xf54e('0x17')];if(_[_0xf54e('0xf')](_0x558502[_0xf54e('0x16')])){_0x43488d[_0xf54e('0x19')]=_0x558502[_0xf54e('0x2b')]&&_0x558502[_0xf54e('0x2b')]!==''?_0x558502['calleridname']:'Unknown';}else{_0x43488d[_0xf54e('0x19')]=_0x558502[_0xf54e('0x2d')]&&_0x558502['destcalleridname']!==''?_0x558502[_0xf54e('0x2d')]:_0xf54e('0x2c');}_0xc939ab=_0x43488d;_0x143d66[_0xf54e('0x30')](_0x43488d);return;}}})['then'](function(){if(_0x6b9e61){emit(_0x558502[_0xf54e('0x25')],_0x3ecfb3,util[_0xf54e('0x32')]('user:%s',_0x6b9e61[_0xf54e('0x33')]),util[_0xf54e('0x32')](_0xf54e('0x34'),_0x5f232a[_0xf54e('0x35')][_0xf54e('0x36')]()),{'evt':_[_0xf54e('0x37')](_0x558502,{'autoCreate':_0x4b0ee1}),'contact':_0xc939ab===undefined?{}:_0xc939ab,'contacts':_0x143d66['length']===0x0?undefined:_0x143d66});}});}; \ No newline at end of file diff --git a/server/services/ami/trigger/index.js b/server/services/ami/trigger/index.js index 004668c..960b335 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 _0x567e=['lodash','mustache','./urlforward','./cmContact','./script','../../../config/environment','../../../config/logger','trigger','../ami','redis','defaults','localhost','socket.io-emitter','popup','url','triggers','agents','voiceQueues','templates','voiceExtensions','zendeskAccounts','freshdeskAccounts','salesforceAccounts','sugarcrmAccounts','zohoAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','accounts','custom:agentcalled','syncCustomEvent','bind','custom:agentconnect','custom:agentringnoanswer','custom:agentcomplete','custom:agentnosuchnumber','custom:agentnoanswer','custom:agentreject','custom:amd','custom:queuecallerabandon','custom:dialbegin','syncAgentDial','custom:dialconnect','custom:dialend','custom:newinteraction','custom:closedinteraction','custom:incomingmessage','custom:outgoingmessage','custom:acceptmessage','custom:rejectmessage','prototype','info','stringify','emit','clone','motionChannel','undefined','checkTriggers','interface','hasOwnProperty','variables','Actions','action','toLowerCase','contactmanager','motionbar','data1','data2','html','uri','buildUri','data3','data4','windowWidth','isNil','800','data5','windowHeight','data6','winapp','render','winArguments','format','trigger:%s:%s','merge','user:%s','name','trigger:%s','integration','exec','queue','routeId','urlforward','script','parse','query','search','replace','channel','AllConditions','length','every','checkConditions','AnyConditions','field','chat','operator','ChatWebsiteId','upperFirst','AccountId','interaction','message','event','value','agent','membername','lastevent','exports','util'];(function(_0x55e08b,_0x421620){var _0xd1a7ff=function(_0x58c7ff){while(--_0x58c7ff){_0x55e08b['push'](_0x55e08b['shift']());}};_0xd1a7ff(++_0x421620);}(_0x567e,0x1e3));var _0xe567=function(_0x2003c4,_0x16fa63){_0x2003c4=_0x2003c4-0x0;var _0x1822ab=_0x567e[_0x2003c4];return _0x1822ab;};'use strict';var util=require(_0xe567('0x0'));var _=require(_0xe567('0x1'));var url=require('url');var Mustache=require(_0xe567('0x2'));var Redis=require('ioredis');var urlforward=require(_0xe567('0x3'));var integration=require('./integration');var cmContact=require(_0xe567('0x4'));var script=require(_0xe567('0x5'));var config=require(_0xe567('0x6'));var logger=require(_0xe567('0x7'))(_0xe567('0x8'));var ami=require(_0xe567('0x9'));config[_0xe567('0xa')]=_[_0xe567('0xb')](config['redis'],{'host':_0xe567('0xc'),'port':0x18eb});var io=require(_0xe567('0xd'))(new Redis(config[_0xe567('0xa')]));var operators={'equals':function(_0x2ae4ff,_0xe971f){return _0x2ae4ff==_0xe971f;},'not_equals':function(_0x41de8b,_0x3702fa){return _0x41de8b!=_0x3702fa;}};var barAndWebActions=[_0xe567('0xe'),_0xe567('0xf'),'winapp'];function Trigger(_0x19a497){this[_0xe567('0x10')]=_0x19a497[_0xe567('0x10')];this['agents']=_0x19a497[_0xe567('0x11')];this['voiceQueues']=_0x19a497[_0xe567('0x12')];this[_0xe567('0x13')]=_0x19a497[_0xe567('0x13')];this[_0xe567('0x14')]=_0x19a497[_0xe567('0x14')];this['zendeskAccounts']=_0x19a497[_0xe567('0x15')];this[_0xe567('0x16')]=_0x19a497[_0xe567('0x16')];this[_0xe567('0x17')]=_0x19a497[_0xe567('0x17')];this['sugarcrmAccounts']=_0x19a497[_0xe567('0x18')];this['zohoAccounts']=_0x19a497[_0xe567('0x19')];this['deskAccounts']=_0x19a497[_0xe567('0x1a')];this[_0xe567('0x1b')]=_0x19a497['vtigerAccounts'];this[_0xe567('0x1c')]=_0x19a497[_0xe567('0x1c')];this[_0xe567('0x1d')]=_0x19a497[_0xe567('0x1d')];this['freshsalesAccounts']=_0x19a497[_0xe567('0x1e')];this[_0xe567('0x1f')]={'zendesk':this[_0xe567('0x15')],'salesforce':this[_0xe567('0x17')],'freshdesk':this['freshdeskAccounts'],'sugarcrm':this[_0xe567('0x18')],'zoho':this[_0xe567('0x19')],'desk':this['deskAccounts'],'vtiger':this[_0xe567('0x1b')],'dynamics365':this[_0xe567('0x1d')],'freshsales':this[_0xe567('0x1e')],'servicenow':this[_0xe567('0x1c')]};ami['on'](_0xe567('0x20'),this[_0xe567('0x21')][_0xe567('0x22')](this));ami['on'](_0xe567('0x23'),this[_0xe567('0x21')][_0xe567('0x22')](this));ami['on'](_0xe567('0x24'),this[_0xe567('0x21')][_0xe567('0x22')](this));ami['on'](_0xe567('0x25'),this[_0xe567('0x21')][_0xe567('0x22')](this));ami['on'](_0xe567('0x26'),this[_0xe567('0x21')][_0xe567('0x22')](this));ami['on'](_0xe567('0x27'),this['syncCustomEvent']['bind'](this));ami['on']('custom:agentbusy',this['syncCustomEvent'][_0xe567('0x22')](this));ami['on']('custom:agentcongestion',this[_0xe567('0x21')]['bind'](this));ami['on'](_0xe567('0x28'),this[_0xe567('0x21')][_0xe567('0x22')](this));ami['on'](_0xe567('0x29'),this[_0xe567('0x21')][_0xe567('0x22')](this));ami['on'](_0xe567('0x2a'),this['syncCustomEvent']['bind'](this));ami['on']('custom:timeout',this[_0xe567('0x21')][_0xe567('0x22')](this));ami['on'](_0xe567('0x2b'),this[_0xe567('0x2c')][_0xe567('0x22')](this));ami['on'](_0xe567('0x2d'),this[_0xe567('0x2c')][_0xe567('0x22')](this));ami['on'](_0xe567('0x2e'),this[_0xe567('0x2c')]['bind'](this));ami['on'](_0xe567('0x2f'),this[_0xe567('0x21')][_0xe567('0x22')](this));ami['on'](_0xe567('0x30'),this['syncCustomEvent']['bind'](this));ami['on'](_0xe567('0x31'),this[_0xe567('0x21')][_0xe567('0x22')](this));ami['on'](_0xe567('0x32'),this['syncCustomEvent'][_0xe567('0x22')](this));ami['on'](_0xe567('0x33'),this['syncCustomEvent'][_0xe567('0x22')](this));ami['on'](_0xe567('0x34'),this[_0xe567('0x21')][_0xe567('0x22')](this));}Trigger[_0xe567('0x35')]['emit']=function(_0x324816,_0x1d8232,_0x4c756f){logger[_0xe567('0x36')](_0x324816,_0x1d8232,JSON[_0xe567('0x37')](_0x4c756f));io['to'](_0x324816)[_0xe567('0x38')](_0x1d8232,_0x4c756f);};Trigger['prototype'][_0xe567('0x21')]=function(_0x3f463e){var _0x484f55=_[_0xe567('0x39')](_0x3f463e);if(typeof _0x484f55[_0xe567('0x3a')]===_0xe567('0x3b')){_0x484f55[_0xe567('0x3a')]='voice';}this[_0xe567('0x3c')](_0x484f55);};Trigger[_0xe567('0x35')][_0xe567('0x2c')]=function(_0x43ddc8){if(this[_0xe567('0x11')][_0x43ddc8[_0xe567('0x3d')]]){this[_0xe567('0x21')](_0x43ddc8);}};Trigger['prototype'][_0xe567('0x3c')]=function(_0x554d12){var _0x1294ad;for(var _0xe5262a in this['triggers']){if(this[_0xe567('0x10')][_0xe567('0x3e')](_0xe5262a)){if(this['triggers'][_0xe5262a]['status']){_0x1294ad=this['checkTrigger'](this[_0xe567('0x10')][_0xe5262a],_0x554d12);if(_0x1294ad){_['merge'](_0x554d12,_0x554d12[_0xe567('0x3f')]);for(var _0x339560=0x0,_0x318880,_0x3e876e,_0x4b6472;_0x3395600x0){_0x11c1eb=_[_0x7995('0x2b')](_0xf16cc2,_0x132a42);}return _0x11c1eb;}function getCustomFields(_0x514445,_0x456a28){var _0x3250e0=[];var _0x4253e5={'custom_fields':{}};if(_0x514445['length']>0x0){_['forEach'](_0x514445,function(_0x48e573){if(_[_0x7995('0x2c')]([_0x7995('0x2d'),_0x7995('0x2e')],_0x48e573[_0x7995('0x2f')])&&_0x48e573[_0x7995('0x30')]&&!_0x48e573[_0x7995('0x31')]){_0x4253e5[_0x48e573['nameField']['toLowerCase']()]=_0x48e573[_0x7995('0x32')]['toString']();}else if(_[_0x7995('0x2c')]([_0x7995('0x2d'),_0x7995('0x2e')],_0x48e573[_0x7995('0x2f')])&&_0x48e573[_0x7995('0x33')]&&_0x48e573['customField']){_0x4253e5[_0x7995('0x34')][_0x48e573[_0x7995('0x33')]]=_0x48e573['content']['toString']();}else if(_0x48e573['type']===_0x7995('0x35')&&_0x48e573[_0x7995('0x36')]&&_0x48e573['idField']&&_0x48e573[_0x7995('0x31')]){_0x456a28[_0x48e573['variableName']]&&(_0x4253e5[_0x7995('0x34')][_0x48e573[_0x7995('0x33')]]=_0x456a28[_0x48e573[_0x7995('0x36')]]['toString']());}else if(_0x48e573['type']===_0x7995('0x37')&&_0x48e573['Variable']&&_0x48e573['Variable'][_0x7995('0x38')]&&_0x48e573[_0x7995('0x33')]&&_0x48e573['customField']){_0x456a28[_0x48e573[_0x7995('0x39')][_0x7995('0x38')][_0x7995('0x3a')]()]&&(_0x4253e5[_0x7995('0x34')][_0x48e573[_0x7995('0x33')]]=_0x456a28[_0x48e573['Variable'][_0x7995('0x38')][_0x7995('0x3a')]()][_0x7995('0x22')]());}});}if(_0x4253e5[_0x7995('0x3b')]){_0x4253e5['priority']=Number(_0x4253e5[_0x7995('0x3b')]);}return _0x4253e5;}function getTicket(_0x235df7,_0x3eb04f,_0xe5ea43,_0x1f5bee,_0x1035dc){logger['info'](_0x7995('0x3c'));var _0x3be298=_[_0x7995('0x3d')]({'subject':intUtil[_0x7995('0x3e')](_0x1f5bee[_0x7995('0x3f')],_0x1035dc,'\x20'),'type':_0x7995('0x40'),'status':_0x7995('0x41'),'labels':[_0x7995('0x42'),_0x7995('0x43'),_0x7995('0x44')][_0x7995('0x45')](getTags(_0x1f5bee[_0x7995('0x46')],_0x7995('0x38'))),'description':intUtil['getString'](_0x1f5bee['Descriptions'],_0x1035dc,'\x0a'),'_links':{'assigned_user':{'href':util[_0x7995('0x11')](_0x7995('0x47'),_0x3eb04f['id']),'class':'user'}},'message':{'direction':'in','body':intUtil['getString'](_0x1f5bee[_0x7995('0x48')],_0x1035dc,'\x0a')}},getCustomFields(_0x1f5bee['Fields'],_0x1035dc));return request({'uri':util['format'](_0x7995('0x49'),_0x235df7[_0x7995('0x12')],_0xe5ea43['id']),'method':_0x7995('0x29'),'body':_0x3be298});}exports['queue']=function(_0x46ac4f,_0x5e85b9,_0x3993b5,_0x5a8881,_0x493066,_0x39c5b8){var _0x403f54,_0xc04e5;_0x39c5b8[_0x7995('0x12')]=intUtil['stripTrailingSlash'](_0x39c5b8[_0x7995('0x12')]);_0x39c5b8[_0x7995('0x4a')]=intUtil[_0x7995('0x4b')](_0x39c5b8[_0x7995('0x4a')]);if(_0x493066&&_0x493066['monitor_format']){logger['info'](_0x7995('0x4c'),'Recording\x20is\x20enabled!');_0x5e85b9[_0x7995('0x4d')]=util['format'](_0x7995('0x4e'),_0x39c5b8['serverUrl'],_0x5e85b9[_0x7995('0x4f')],md5(_0x5e85b9[_0x7995('0x4f')]));}else{_0x5e85b9['recordingURL']='';}headers[_0x7995('0x50')]=getAuth(_0x39c5b8);return getUser(_0x39c5b8,_0x5a8881[_0x7995('0x51')])[_0x7995('0x13')](function(_0xb70a51){_0x403f54=_0xb70a51;logger['info'](_0x7995('0x52'),_0x403f54['id']);return getEndUser(_0x39c5b8,_0x5e85b9[_0x7995('0x53')],_0x5e85b9[_0x7995('0x54')]);})['then'](function(_0xe228a5){_0xc04e5=_0xe228a5;logger[_0x7995('0xf')](_0x7995('0x55'),_0xc04e5['id']);return getTicket(_0x39c5b8,_0x403f54,_0xc04e5,_0x3993b5,_0x5e85b9);})[_0x7995('0x13')](function(_0x255313){if(_0x255313){logger['info'](_0x7995('0x56'));logger[_0x7995('0xf')]('The\x20Ticket\x20ID\x20is:',_0x255313['id']);switch(_0x39c5b8[_0x7995('0x2f')]){case'integrationTab':logger[_0x7995('0xf')](_0x7995('0x4c'),_0x7995('0x57'));emit(util[_0x7995('0x11')](_0x7995('0x58'),_0x5a8881[_0x7995('0x38')]),_0x7995('0x59'),{'recordId':_0x255313['id']});break;case'newTab':logger[_0x7995('0xf')](_0x7995('0x4c'),_0x7995('0x5a'));emit(util['format'](_0x7995('0x58'),_0x5a8881[_0x7995('0x38')]),_0x7995('0x5b'),{'uri':util['format']('https://xcally.desk.com/web/agent/case/%d',_0x255313['id'])});break;default:logger['error'](_0x7995('0x4c'),_0x7995('0x5c'));}}})['catch'](function(_0x1cd85){console[_0x7995('0x5d')](_0x1cd85);logger[_0x7995('0x5d')](_0x7995('0x4c'),JSON[_0x7995('0x1c')](_0x1cd85));});};exports['outbound']=function(_0x29ee32,_0x4ab09f,_0x14fe7f,_0x33c801,_0x206d2a,_0x50c7b5,_0x5e1f34){var _0x54e2b1,_0x563f8e;_0x50c7b5[_0x7995('0x12')]=intUtil[_0x7995('0x4b')](_0x50c7b5[_0x7995('0x12')]);_0x50c7b5[_0x7995('0x4a')]=intUtil[_0x7995('0x4b')](_0x50c7b5[_0x7995('0x4a')]);if(_0x5e1f34&&_0x5e1f34[_0x7995('0x5e')]&&_0x5e1f34[_0x7995('0x5e')]!==_0x7995('0x5f')){logger[_0x7995('0xf')](_0x7995('0x60'),_0x7995('0x61'));_0x4ab09f[_0x7995('0x4d')]=util[_0x7995('0x11')](_0x7995('0x4e'),_0x50c7b5[_0x7995('0x4a')],_0x4ab09f[_0x7995('0x4f')],md5(_0x4ab09f[_0x7995('0x4f')]));}headers[_0x7995('0x50')]=getAuth(_0x50c7b5);return getUser(_0x50c7b5,_0x33c801['email'])[_0x7995('0x13')](function(_0x630737){_0x54e2b1=_0x630737;logger[_0x7995('0xf')](_0x7995('0x52'),_0x54e2b1['id']);return getEndUser(_0x50c7b5,_0x4ab09f['destcalleridname'],_0x4ab09f['destcalleridnum']);})[_0x7995('0x13')](function(_0x197b52){_0x563f8e=_0x197b52;logger[_0x7995('0xf')](_0x7995('0x55'),_0x563f8e['id']);return getTicket(_0x50c7b5,_0x54e2b1,_0x563f8e,_0x14fe7f,_0x4ab09f);})['then'](function(_0x13cd7b){if(_0x13cd7b){logger[_0x7995('0xf')](_0x7995('0x56'));logger[_0x7995('0xf')]('The\x20Ticket\x20ID\x20is:',_0x13cd7b['id']);switch(_0x50c7b5['type']){case _0x7995('0x62'):logger[_0x7995('0xf')](_0x7995('0x4c'),_0x7995('0x57'));emit(util[_0x7995('0x11')](_0x7995('0x58'),_0x33c801[_0x7995('0x38')]),_0x7995('0x59'),{'recordId':_0x13cd7b['id']});break;case _0x7995('0x63'):logger['info'](_0x7995('0x4c'),_0x7995('0x5a'));emit(util[_0x7995('0x11')](_0x7995('0x58'),_0x33c801['name']),'trigger:browser:url',{'uri':util[_0x7995('0x11')](_0x7995('0x64'),_0x50c7b5['remoteUri'],_0x13cd7b['id'])});break;default:logger[_0x7995('0x5d')](_0x7995('0x60'),_0x7995('0x5c'));}}})[_0x7995('0x65')](function(_0x32cb04){logger['error'](_0x7995('0x60'),JSON['stringify'](_0x32cb04));});};exports[_0x7995('0x66')]=function(_0xe31dcb,_0x1722e2,_0x25b534,_0x4388c1,_0xeb8920,_0x2b3c1d){var _0x44372a,_0x10f012;_0x2b3c1d[_0x7995('0x12')]=intUtil[_0x7995('0x4b')](_0x2b3c1d[_0x7995('0x12')]);_0x2b3c1d['serverUrl']=intUtil[_0x7995('0x4b')](_0x2b3c1d[_0x7995('0x4a')]);if(_0xeb8920&&_0xeb8920[_0x7995('0x67')]){logger[_0x7995('0xf')]('['+_0x1722e2[_0x7995('0x68')]['toUpperCase']()+']','Recording\x20is\x20enabled!');_0x1722e2[_0x7995('0x4d')]=util[_0x7995('0x11')](_0x7995('0x4e'),_0x2b3c1d[_0x7995('0x4a')],_0x1722e2['uniqueid'],md5(_0x1722e2[_0x7995('0x4f')]));}else{_0x1722e2['recordingURL']='';}headers['Authorization']=getAuth(_0x2b3c1d);return getUser(_0x2b3c1d)[_0x7995('0x13')](function(_0x36d27d){_0x44372a=_0x36d27d;logger[_0x7995('0xf')](_0x7995('0x52'),_0x44372a['id']);return getEndUser(_0x2b3c1d,_0x1722e2[_0x7995('0x53')],_0x1722e2[_0x7995('0x54')]);})[_0x7995('0x13')](function(_0x13dc73){_0x10f012=_0x13dc73;logger[_0x7995('0xf')](_0x7995('0x55'),_0x10f012['id']);return getTicket(_0x2b3c1d,_0x44372a,_0x10f012,_0x25b534,_0x1722e2);})['then'](function(_0x2dc1f7){if(_0x2dc1f7){logger[_0x7995('0xf')](_0x7995('0x56'));logger['info'](_0x7995('0x69'),_0x2dc1f7['id']);}})[_0x7995('0x65')](function(_0x705f0){logger[_0x7995('0x5d')]('['+_0x1722e2[_0x7995('0x68')][_0x7995('0x6a')]()+']',JSON[_0x7995('0x1c')](_0x705f0));});}; \ No newline at end of file +var _0x9957=['Motion','CTI','concat','Tags','/api/v2/users/%d','Descriptions','%s/customers/%d/cases','serverUrl','stripTrailingSlash','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','email','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Ticket\x20created!','Displaying\x20ticket\x20to\x20agent...','user:%s','trigger:desk:display','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','Desk\x20account\x20type\x20not\x20recognized','error','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','integrationTab','newTab','%s/agent/tickets/%s','catch','unmanaged','monitor_format','lastevent','The\x20Ticket\x20ID\x20is:','toUpperCase','lodash','request-promise','md5','util','./util','../../../../config/environment','../../../../config/logger','desk','defaults','redis','localhost','socket.io-emitter','emit','application/json','validateEmail','info','Getting\x20agent\x20with\x20email','format','remoteUri','then','total_entries','find','_embedded','entries','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','[HTTP]','stringify','GET','password','authType','token','Basic\x20%s','toString','base64','Searching\x20enduser\x20with\x20phone','%s/customers/search','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/customers','POST','work','map','includes','string','picklist','type','nameField','customField','content','idField','custom_fields','variable','variableName','customVariable','name','Variable','toLowerCase','priority','Creating\x20new\x20ticket...','merge','getString','Subjects','phone','new','xCALLY'];(function(_0x52848c,_0x171e55){var _0x5be36f=function(_0x3dd10b){while(--_0x3dd10b){_0x52848c['push'](_0x52848c['shift']());}};_0x5be36f(++_0x171e55);}(_0x9957,0x93));var _0x7995=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x9957[_0x5ddb1c];return _0x354adc;};'use strict';var _=require(_0x7995('0x0'));var rp=require(_0x7995('0x1'));var md5=require(_0x7995('0x2'));var util=require(_0x7995('0x3'));var Redis=require('ioredis');var intUtil=require(_0x7995('0x4'));var config=require(_0x7995('0x5'));var logger=require(_0x7995('0x6'))(_0x7995('0x7'));config['redis']=_[_0x7995('0x8')](config[_0x7995('0x9')],{'host':_0x7995('0xa'),'port':0x18eb});var io=require(_0x7995('0xb'))(new Redis(config[_0x7995('0x9')]));function emit(_0x326741,_0x4996ca,_0x465276){io['to'](_0x326741)[_0x7995('0xc')](_0x4996ca,_0x465276);}var headers={'Content-Type':'application/json','Accept':_0x7995('0xd')};function getUser(_0x3116fb,_0x18c8a3){if(intUtil[_0x7995('0xe')](_0x18c8a3)===!![]){logger[_0x7995('0xf')](_0x7995('0x10'),_0x18c8a3);return request({'uri':util[_0x7995('0x11')]('%s/users',_0x3116fb[_0x7995('0x12')])})[_0x7995('0x13')](function(_0x581f22){if(_0x581f22[_0x7995('0x14')]){return _[_0x7995('0x15')](_0x581f22[_0x7995('0x16')][_0x7995('0x17')],{'email':_0x18c8a3});}})[_0x7995('0x13')](function(_0x23999f){if(_0x23999f){logger[_0x7995('0xf')]('Agent\x20found!');return _0x23999f;}else{logger['info'](_0x7995('0x18'));return request({'uri':util[_0x7995('0x11')](_0x7995('0x19'),_0x3116fb[_0x7995('0x12')])});}});}else{logger[_0x7995('0xf')](_0x7995('0x1a'));return request({'uri':util[_0x7995('0x11')](_0x7995('0x19'),_0x3116fb['remoteUri'])});}}function request(_0x2eeacc){logger['debug'](_0x7995('0x1b'),JSON[_0x7995('0x1c')](_0x2eeacc));return rp(_[_0x7995('0x8')](_0x2eeacc,{'method':_0x7995('0x1d'),'headers':headers,'json':!![]}));}function getAuth(_0x1e1415){var _0x37a7d4;if(_0x1e1415['authType']==='basic'){_0x37a7d4=util[_0x7995('0x11')]('%s:%s',_0x1e1415['username'],_0x1e1415[_0x7995('0x1e')]);}else if(_0x1e1415[_0x7995('0x1f')]==='token'){_0x37a7d4=util[_0x7995('0x11')]('%s/token:%s',_0x1e1415['username'],_0x1e1415[_0x7995('0x20')]);}return util[_0x7995('0x11')](_0x7995('0x21'),new Buffer(_0x37a7d4)[_0x7995('0x22')](_0x7995('0x23')));}function getEndUser(_0x1c278a,_0x5d40ae,_0x32a09a){logger[_0x7995('0xf')](_0x7995('0x24'),_0x32a09a);return request({'uri':util[_0x7995('0x11')](_0x7995('0x25'),_0x1c278a[_0x7995('0x12')]),'qs':{'phone':_0x32a09a}})[_0x7995('0x13')](function(_0x472195){if(_0x472195['total_entries']){logger[_0x7995('0xf')](_0x7995('0x26'));return _0x472195[_0x7995('0x16')][_0x7995('0x17')][0x0];}else{logger[_0x7995('0xf')](_0x7995('0x27'));return request({'uri':util['format'](_0x7995('0x28'),_0x1c278a['remoteUri']),'method':_0x7995('0x29'),'body':{'first_name':_0x5d40ae,'title':_0x5d40ae,'phone_numbers':[{'type':_0x7995('0x2a'),'value':_0x32a09a}]}});}});}function getTags(_0xf16cc2,_0x132a42){var _0x11c1eb=[];if(_0xf16cc2&&_0xf16cc2['length']>0x0){_0x11c1eb=_[_0x7995('0x2b')](_0xf16cc2,_0x132a42);}return _0x11c1eb;}function getCustomFields(_0x514445,_0x456a28){var _0x3250e0=[];var _0x4253e5={'custom_fields':{}};if(_0x514445['length']>0x0){_['forEach'](_0x514445,function(_0x48e573){if(_[_0x7995('0x2c')]([_0x7995('0x2d'),_0x7995('0x2e')],_0x48e573[_0x7995('0x2f')])&&_0x48e573[_0x7995('0x30')]&&!_0x48e573[_0x7995('0x31')]){_0x4253e5[_0x48e573['nameField']['toLowerCase']()]=_0x48e573[_0x7995('0x32')]['toString']();}else if(_[_0x7995('0x2c')]([_0x7995('0x2d'),_0x7995('0x2e')],_0x48e573[_0x7995('0x2f')])&&_0x48e573[_0x7995('0x33')]&&_0x48e573['customField']){_0x4253e5[_0x7995('0x34')][_0x48e573[_0x7995('0x33')]]=_0x48e573['content']['toString']();}else if(_0x48e573['type']===_0x7995('0x35')&&_0x48e573[_0x7995('0x36')]&&_0x48e573['idField']&&_0x48e573[_0x7995('0x31')]){_0x456a28[_0x48e573['variableName']]&&(_0x4253e5[_0x7995('0x34')][_0x48e573[_0x7995('0x33')]]=_0x456a28[_0x48e573[_0x7995('0x36')]]['toString']());}else if(_0x48e573['type']===_0x7995('0x37')&&_0x48e573['Variable']&&_0x48e573['Variable'][_0x7995('0x38')]&&_0x48e573[_0x7995('0x33')]&&_0x48e573['customField']){_0x456a28[_0x48e573[_0x7995('0x39')][_0x7995('0x38')][_0x7995('0x3a')]()]&&(_0x4253e5[_0x7995('0x34')][_0x48e573[_0x7995('0x33')]]=_0x456a28[_0x48e573['Variable'][_0x7995('0x38')][_0x7995('0x3a')]()][_0x7995('0x22')]());}});}if(_0x4253e5[_0x7995('0x3b')]){_0x4253e5['priority']=Number(_0x4253e5[_0x7995('0x3b')]);}return _0x4253e5;}function getTicket(_0x235df7,_0x3eb04f,_0xe5ea43,_0x1f5bee,_0x1035dc){logger['info'](_0x7995('0x3c'));var _0x3be298=_[_0x7995('0x3d')]({'subject':intUtil[_0x7995('0x3e')](_0x1f5bee[_0x7995('0x3f')],_0x1035dc,'\x20'),'type':_0x7995('0x40'),'status':_0x7995('0x41'),'labels':[_0x7995('0x42'),_0x7995('0x43'),_0x7995('0x44')][_0x7995('0x45')](getTags(_0x1f5bee[_0x7995('0x46')],_0x7995('0x38'))),'description':intUtil['getString'](_0x1f5bee['Descriptions'],_0x1035dc,'\x0a'),'_links':{'assigned_user':{'href':util[_0x7995('0x11')](_0x7995('0x47'),_0x3eb04f['id']),'class':'user'}},'message':{'direction':'in','body':intUtil['getString'](_0x1f5bee[_0x7995('0x48')],_0x1035dc,'\x0a')}},getCustomFields(_0x1f5bee['Fields'],_0x1035dc));return request({'uri':util['format'](_0x7995('0x49'),_0x235df7[_0x7995('0x12')],_0xe5ea43['id']),'method':_0x7995('0x29'),'body':_0x3be298});}exports['queue']=function(_0x46ac4f,_0x5e85b9,_0x3993b5,_0x5a8881,_0x493066,_0x39c5b8){var _0x403f54,_0xc04e5;_0x39c5b8[_0x7995('0x12')]=intUtil['stripTrailingSlash'](_0x39c5b8[_0x7995('0x12')]);_0x39c5b8[_0x7995('0x4a')]=intUtil[_0x7995('0x4b')](_0x39c5b8[_0x7995('0x4a')]);if(_0x493066&&_0x493066['monitor_format']){logger['info'](_0x7995('0x4c'),'Recording\x20is\x20enabled!');_0x5e85b9[_0x7995('0x4d')]=util['format'](_0x7995('0x4e'),_0x39c5b8['serverUrl'],_0x5e85b9[_0x7995('0x4f')],md5(_0x5e85b9[_0x7995('0x4f')]));}else{_0x5e85b9['recordingURL']='';}headers[_0x7995('0x50')]=getAuth(_0x39c5b8);return getUser(_0x39c5b8,_0x5a8881[_0x7995('0x51')])[_0x7995('0x13')](function(_0xb70a51){_0x403f54=_0xb70a51;logger['info'](_0x7995('0x52'),_0x403f54['id']);return getEndUser(_0x39c5b8,_0x5e85b9[_0x7995('0x53')],_0x5e85b9[_0x7995('0x54')]);})['then'](function(_0xe228a5){_0xc04e5=_0xe228a5;logger[_0x7995('0xf')](_0x7995('0x55'),_0xc04e5['id']);return getTicket(_0x39c5b8,_0x403f54,_0xc04e5,_0x3993b5,_0x5e85b9);})[_0x7995('0x13')](function(_0x255313){if(_0x255313){logger['info'](_0x7995('0x56'));logger[_0x7995('0xf')]('The\x20Ticket\x20ID\x20is:',_0x255313['id']);switch(_0x39c5b8[_0x7995('0x2f')]){case'integrationTab':logger[_0x7995('0xf')](_0x7995('0x4c'),_0x7995('0x57'));emit(util[_0x7995('0x11')](_0x7995('0x58'),_0x5a8881[_0x7995('0x38')]),_0x7995('0x59'),{'recordId':_0x255313['id']});break;case'newTab':logger[_0x7995('0xf')](_0x7995('0x4c'),_0x7995('0x5a'));emit(util['format'](_0x7995('0x58'),_0x5a8881[_0x7995('0x38')]),_0x7995('0x5b'),{'uri':util['format']('https://xcally.desk.com/web/agent/case/%d',_0x255313['id'])});break;default:logger['error'](_0x7995('0x4c'),_0x7995('0x5c'));}}})['catch'](function(_0x1cd85){console[_0x7995('0x5d')](_0x1cd85);logger[_0x7995('0x5d')](_0x7995('0x4c'),JSON[_0x7995('0x1c')](_0x1cd85));});};exports['outbound']=function(_0x29ee32,_0x4ab09f,_0x14fe7f,_0x33c801,_0x206d2a,_0x50c7b5,_0x5e1f34){var _0x54e2b1,_0x563f8e;_0x50c7b5[_0x7995('0x12')]=intUtil[_0x7995('0x4b')](_0x50c7b5[_0x7995('0x12')]);_0x50c7b5[_0x7995('0x4a')]=intUtil[_0x7995('0x4b')](_0x50c7b5[_0x7995('0x4a')]);if(_0x5e1f34&&_0x5e1f34[_0x7995('0x5e')]&&_0x5e1f34[_0x7995('0x5e')]!==_0x7995('0x5f')){logger[_0x7995('0xf')](_0x7995('0x60'),_0x7995('0x61'));_0x4ab09f[_0x7995('0x4d')]=util[_0x7995('0x11')](_0x7995('0x4e'),_0x50c7b5[_0x7995('0x4a')],_0x4ab09f[_0x7995('0x4f')],md5(_0x4ab09f[_0x7995('0x4f')]));}headers[_0x7995('0x50')]=getAuth(_0x50c7b5);return getUser(_0x50c7b5,_0x33c801['email'])[_0x7995('0x13')](function(_0x630737){_0x54e2b1=_0x630737;logger[_0x7995('0xf')](_0x7995('0x52'),_0x54e2b1['id']);return getEndUser(_0x50c7b5,_0x4ab09f['destcalleridname'],_0x4ab09f['destcalleridnum']);})[_0x7995('0x13')](function(_0x197b52){_0x563f8e=_0x197b52;logger[_0x7995('0xf')](_0x7995('0x55'),_0x563f8e['id']);return getTicket(_0x50c7b5,_0x54e2b1,_0x563f8e,_0x14fe7f,_0x4ab09f);})['then'](function(_0x13cd7b){if(_0x13cd7b){logger[_0x7995('0xf')](_0x7995('0x56'));logger[_0x7995('0xf')]('The\x20Ticket\x20ID\x20is:',_0x13cd7b['id']);switch(_0x50c7b5['type']){case _0x7995('0x62'):logger[_0x7995('0xf')](_0x7995('0x4c'),_0x7995('0x57'));emit(util[_0x7995('0x11')](_0x7995('0x58'),_0x33c801[_0x7995('0x38')]),_0x7995('0x59'),{'recordId':_0x13cd7b['id']});break;case _0x7995('0x63'):logger['info'](_0x7995('0x4c'),_0x7995('0x5a'));emit(util[_0x7995('0x11')](_0x7995('0x58'),_0x33c801['name']),'trigger:browser:url',{'uri':util[_0x7995('0x11')](_0x7995('0x64'),_0x50c7b5['remoteUri'],_0x13cd7b['id'])});break;default:logger[_0x7995('0x5d')](_0x7995('0x60'),_0x7995('0x5c'));}}})[_0x7995('0x65')](function(_0x32cb04){logger['error'](_0x7995('0x60'),JSON['stringify'](_0x32cb04));});};exports[_0x7995('0x66')]=function(_0xe31dcb,_0x1722e2,_0x25b534,_0x4388c1,_0xeb8920,_0x2b3c1d){var _0x44372a,_0x10f012;_0x2b3c1d[_0x7995('0x12')]=intUtil[_0x7995('0x4b')](_0x2b3c1d[_0x7995('0x12')]);_0x2b3c1d['serverUrl']=intUtil[_0x7995('0x4b')](_0x2b3c1d[_0x7995('0x4a')]);if(_0xeb8920&&_0xeb8920[_0x7995('0x67')]){logger[_0x7995('0xf')]('['+_0x1722e2[_0x7995('0x68')]['toUpperCase']()+']','Recording\x20is\x20enabled!');_0x1722e2[_0x7995('0x4d')]=util[_0x7995('0x11')](_0x7995('0x4e'),_0x2b3c1d[_0x7995('0x4a')],_0x1722e2['uniqueid'],md5(_0x1722e2[_0x7995('0x4f')]));}else{_0x1722e2['recordingURL']='';}headers['Authorization']=getAuth(_0x2b3c1d);return getUser(_0x2b3c1d)[_0x7995('0x13')](function(_0x36d27d){_0x44372a=_0x36d27d;logger[_0x7995('0xf')](_0x7995('0x52'),_0x44372a['id']);return getEndUser(_0x2b3c1d,_0x1722e2[_0x7995('0x53')],_0x1722e2[_0x7995('0x54')]);})[_0x7995('0x13')](function(_0x13dc73){_0x10f012=_0x13dc73;logger[_0x7995('0xf')](_0x7995('0x55'),_0x10f012['id']);return getTicket(_0x2b3c1d,_0x44372a,_0x10f012,_0x25b534,_0x1722e2);})['then'](function(_0x2dc1f7){if(_0x2dc1f7){logger[_0x7995('0xf')](_0x7995('0x56'));logger['info'](_0x7995('0x69'),_0x2dc1f7['id']);}})[_0x7995('0x65')](function(_0x705f0){logger[_0x7995('0x5d')]('['+_0x1722e2[_0x7995('0x68')][_0x7995('0x6a')]()+']',JSON[_0x7995('0x1c')](_0x705f0));});}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/dynamics365.js b/server/services/ami/trigger/integration/dynamics365.js index ec2cd05..3d603de 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 _0x7b7c=[']\x20The\x20Enduser\x20ID\x20is:',']\x20The\x20Enduser\x20phone\x20is:','ticketId',']\x20Call\x20direction:\x20%s','unmanaged','Displaying\x20call\x20in\x20a\x20new\x20tab...','name','inspect','bluebird','request-promise','util','./util','md5','../../../../config/logger','redis','localhost','POST','clientId','remoteUri','password','clientSecret','then','access_token','toUpperCase','message','GET','Bearer\x20','4.0','isNil','validateEmail','email','internalemailaddress','isdisabled','info',']\x20Agent\x20found\x20','systemuserid','userId','username','length','catch','toLowerCase','outbound','destcalleridnum','calleridnum','/systemusers(','headers','substring','lastIndexOf','contacts?$select=telephone1&$filter=telephone1\x20eq\x20\x27','replace','value','telephone1','enduserId','contactid',']\x20Enduser\x20Created!','includes','string','nameField','idField','indexOf','content','ticketType','incident','incidents','assign','getString','Subjects','Descriptions','Fields','phonecall','phonecalls','/contacts(','callDirection','queue','odata-entityid','format','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','user:%s','emit','trigger:browser:url','stripTrailingSlash','serverUrl','%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','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','[OUTBOUND]',']\x20The\x20User\x20email\x20is:','userEmail'];(function(_0x45aa6c,_0x423458){var _0x20f150=function(_0x307d39){while(--_0x307d39){_0x45aa6c['push'](_0x45aa6c['shift']());}};_0x20f150(++_0x423458);}(_0x7b7c,0x67));var _0xc7b7=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x7b7c[_0x4cf98e];return _0x1623ac;};'use strict';var _=require('lodash');var BPromise=require(_0xc7b7('0x0'));var rp=require(_0xc7b7('0x1'));var util=require(_0xc7b7('0x2'));var intUtil=require(_0xc7b7('0x3'));var md5=require(_0xc7b7('0x4'));var Redis=require('ioredis');var logger=require(_0xc7b7('0x5'))('dynamics365');var config=require('../../../../config/environment');config['redis']=_['defaults'](config[_0xc7b7('0x6')],{'host':_0xc7b7('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function getAuthToken(_0x4c7e9b,_0x536988,_0x4bec9d){var _0x1be200={'method':_0xc7b7('0x8'),'uri':_0x536988,'form':{'client_id':_0x4c7e9b[_0xc7b7('0x9')],'resource':_0x4c7e9b[_0xc7b7('0xa')],'username':_0x4c7e9b['username'],'password':_0x4c7e9b[_0xc7b7('0xb')],'grant_type':_0xc7b7('0xb'),'client_secret':_0x4c7e9b[_0xc7b7('0xc')]},'json':!![]};return rp(_0x1be200)[_0xc7b7('0xd')](function(_0x3304ee){return _0x3304ee[_0xc7b7('0xe')];})['catch'](function(_0x4e5af6){logger['error']('['+[_0x4bec9d[_0xc7b7('0xf')]()]+']\x20Wrong\x20credentials!');return _0x4e5af6[_0xc7b7('0x10')];});}function getUser(_0x8184fa,_0x1ca555,_0x34657b,_0x4edcf8,_0x5b5ee6,_0x193547){return new BPromise(function(_0x577418,_0x9882e){return getAuthToken(_0x1ca555,_0x4edcf8,_0x193547)[_0xc7b7('0xd')](function(_0x33a661){var _0x3ef4cd={'method':_0xc7b7('0x11'),'uri':_0x5b5ee6+'systemusers?$select=internalemailaddress,isdisabled,systemuserid','headers':{'Authorization':_0xc7b7('0x12')+_0x33a661,'OData-Version':_0xc7b7('0x13')},'json':!![]};return rp(_0x3ef4cd);})['then'](function(_0x3e3856){var _0x15f242=_0x3e3856['value'];var _0x982f01=![];var _0x54708b=null;if(!_[_0xc7b7('0x14')](_0x34657b)){if(intUtil[_0xc7b7('0x15')](_0x34657b[_0xc7b7('0x16')])){_0x8184fa['userEmail']=_0x34657b[_0xc7b7('0x16')];for(_0x54708b=0x0;_0x54708b<_0x15f242['length'];_0x54708b++){if(_0x15f242[_0x54708b][_0xc7b7('0x17')]===_0x34657b[_0xc7b7('0x16')]&&!_0x15f242[_0x54708b][_0xc7b7('0x18')]){_0x982f01=!![];logger[_0xc7b7('0x19')]('['+[_0x193547['toUpperCase']()]+_0xc7b7('0x1a')+_0x15f242[_0x54708b][_0xc7b7('0x1b')]+'!');_0x8184fa[_0xc7b7('0x1c')]=_0x15f242[_0x54708b]['systemuserid'];}}}}if(!_0x982f01){logger[_0xc7b7('0x19')]('['+[_0x193547[_0xc7b7('0xf')]()]+']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');_0x8184fa['userEmail']=_0x1ca555[_0xc7b7('0x1d')];for(_0x54708b=0x0;_0x54708b<_0x15f242[_0xc7b7('0x1e')];_0x54708b++){if(_0x15f242[_0x54708b][_0xc7b7('0x17')]===_0x1ca555[_0xc7b7('0x1d')]){_0x8184fa[_0xc7b7('0x1c')]=_0x15f242[_0x54708b][_0xc7b7('0x1b')];}}}_0x577418(_0x8184fa);})[_0xc7b7('0x1f')](function(_0x1f8744){_0x9882e(_0x1f8744[_0xc7b7('0x10')]);});});}function createEndUser(_0x16a6c5,_0x3b2d7a,_0x23e57f,_0x3b9113,_0x507fd0,_0x85e0e8){return new BPromise(function(_0xf3ec34,_0x1e5721){return getAuthToken(_0x3b2d7a,_0x23e57f,_0x85e0e8)[_0xc7b7('0xd')](function(_0x2deca4){var _0x2b3e99=_0x85e0e8[_0xc7b7('0x20')]()===_0xc7b7('0x21')?_0x507fd0[_0xc7b7('0x22')]:_0x507fd0[_0xc7b7('0x23')];var _0xa95a85={'method':_0xc7b7('0x8'),'uri':_0x3b9113+'contacts','body':{'telephone1':_0x2b3e99,'fullname':_0x2b3e99,'firstname':_0x2b3e99,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0xc7b7('0x24')+_0x16a6c5[_0xc7b7('0x1c')]+')'},'headers':{'Authorization':_0xc7b7('0x12')+_0x2deca4,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};return rp(_0xa95a85);})['then'](function(_0x473268){var _0x1372bf=_0x473268[_0xc7b7('0x25')]['odata-entityid'];var _0x206ff1=_0x1372bf[_0xc7b7('0x26')](_0x1372bf['lastIndexOf']('(')+0x1,_0x1372bf[_0xc7b7('0x27')](')'));_0x16a6c5['enduserId']=_0x206ff1;_0xf3ec34(_0x16a6c5);})['catch'](function(_0x3b6e87){_0x1e5721(_0x3b6e87[_0xc7b7('0x10')]);});});}function getEndUser(_0xd91615,_0x41cdcf,_0x124ea6,_0x2e462f,_0x46ece7,_0x2eb941){return new BPromise(function(_0x4209c2,_0x1a57bc){var _0x5e290e=_0x2eb941[_0xc7b7('0x20')]()==='outbound'?_0x46ece7['destcalleridnum']:_0x46ece7[_0xc7b7('0x23')];return getAuthToken(_0x41cdcf,_0x124ea6,_0x2eb941)['then'](function(_0x1f7983){var _0x4f4727={'method':'GET','uri':_0x2e462f+_0xc7b7('0x28')+_0x5e290e[_0xc7b7('0x29')]('+','%2b')+'\x27','headers':{'Authorization':'Bearer\x20'+_0x1f7983,'If-None-Match':null,'OData-Version':_0xc7b7('0x13')},'json':!![]};return rp(_0x4f4727);})[_0xc7b7('0xd')](function(_0x166bd5){var _0x331567=null;if(_0x166bd5){var _0x19240c=_0x166bd5[_0xc7b7('0x2a')];var _0x4229bf=![];for(_0x331567=0x0;_0x331567<_0x19240c[_0xc7b7('0x1e')];_0x331567++){if(_0x19240c[_0x331567][_0xc7b7('0x2b')]===_0x5e290e){_0x4229bf=!![];_0xd91615[_0xc7b7('0x2c')]=_0x19240c[_0x331567][_0xc7b7('0x2d')];}}if(_0x4229bf){_0x4209c2(_0xd91615);}else{return createEndUser(_0xd91615,_0x41cdcf,_0x124ea6,_0x2e462f,_0x46ece7,_0x2eb941)[_0xc7b7('0xd')](function(_0xc68109){logger[_0xc7b7('0x19')]('['+[_0x2eb941[_0xc7b7('0xf')]()]+']\x20Enduser\x20created!',_0xc68109[_0xc7b7('0x2c')]);_0x4209c2(_0xc68109);});}}else{return createEndUser(_0xd91615,_0x41cdcf,_0x124ea6,_0x2e462f,_0x46ece7,_0x2eb941)[_0xc7b7('0xd')](function(_0x3204b8){logger['info']('['+[_0x2eb941[_0xc7b7('0xf')]()]+_0xc7b7('0x2e'),_0x3204b8[_0xc7b7('0x2c')]);_0x4209c2(_0x3204b8);});}});});}function getCustomFields(_0x418dd3,_0x3ef089,_0x4ede61){var _0x377f7a={};if(_0x418dd3[_0xc7b7('0x1e')]>0x0){_['forEach'](_0x418dd3,function(_0x137eab){if(_[_0xc7b7('0x2f')]([_0xc7b7('0x30'),'picklist'],_0x137eab['type'])&&_0x137eab[_0xc7b7('0x31')]&&!_0x137eab['customField']){var _0x1a70e8=_0x137eab[_0xc7b7('0x32')][_0xc7b7('0x20')]();var _0x57225a=_0x1a70e8['substring'](0x0,_0x1a70e8['indexOf']('_'));var _0x3dfdcb=_0x1a70e8[_0xc7b7('0x26')](_0x1a70e8[_0xc7b7('0x33')]('_')+0x1);if(_0x57225a===_0x4ede61){_0x377f7a[_0x3dfdcb]=_0x137eab[_0xc7b7('0x34')];}}});}return _0x377f7a;}function getTicket(_0x304b99,_0x26584d,_0x4f15eb,_0x5d8ca4,_0x1c5e6a,_0x4a4606,_0x1eee0c){return new BPromise(function(_0x35ea73,_0x501495){var _0x58883f;return getAuthToken(_0x26584d,_0x4f15eb,_0x1eee0c)[_0xc7b7('0xd')](function(_0x5f48d8){if(_0x4a4606[_0xc7b7('0x35')]===_0xc7b7('0x36')){_0x58883f={'method':_0xc7b7('0x8'),'uri':_0x5d8ca4+_0xc7b7('0x37'),'body':Object[_0xc7b7('0x38')]({},{'title':intUtil[_0xc7b7('0x39')](_0x4a4606[_0xc7b7('0x3a')],_0x1c5e6a,'\x20'),'description':intUtil[_0xc7b7('0x39')](_0x4a4606[_0xc7b7('0x3b')],_0x1c5e6a,'\x0a'),'customerid_contact@odata.bind':'/contacts('+_0x304b99[_0xc7b7('0x2c')]+')','ownerid@odata.bind':'/systemusers('+_0x304b99['userId']+')','caseorigincode':'1'},getCustomFields(_0x4a4606[_0xc7b7('0x3c')],_0x1c5e6a,_0x4a4606[_0xc7b7('0x35')])),'headers':{'Authorization':_0xc7b7('0x12')+_0x5f48d8,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};}if(_0x4a4606[_0xc7b7('0x35')]===_0xc7b7('0x3d')){_0x58883f={'method':_0xc7b7('0x8'),'uri':_0x5d8ca4+_0xc7b7('0x3e'),'body':Object[_0xc7b7('0x38')]({},{'subject':intUtil[_0xc7b7('0x39')](_0x4a4606['Subjects'],_0x1c5e6a,'\x20'),'phonenumber':String(_0x1c5e6a[_0xc7b7('0x23')]),'description':intUtil[_0xc7b7('0x39')](_0x4a4606[_0xc7b7('0x3b')],_0x1c5e6a,'\x0a'),'regardingobjectid_contact@odata.bind':_0xc7b7('0x3f')+_0x304b99[_0xc7b7('0x2c')]+')','ownerid@odata.bind':_0xc7b7('0x24')+_0x304b99[_0xc7b7('0x1c')]+')','directioncode':_0x304b99[_0xc7b7('0x40')]===_0xc7b7('0x41')?![]:!![],'phonecall_activity_parties':[{'partyid_systemuser@odata.bind':_0xc7b7('0x24')+_0x304b99[_0xc7b7('0x1c')]+')','participationtypemask':_0x304b99[_0xc7b7('0x40')]===_0xc7b7('0x41')?0x2:0x1},{'partyid_contact@odata.bind':_0xc7b7('0x3f')+_0x304b99[_0xc7b7('0x2c')]+')','participationtypemask':_0x304b99['callDirection']===_0xc7b7('0x41')?0x1:0x2}]},getCustomFields(_0x4a4606[_0xc7b7('0x3c')],_0x1c5e6a,_0x4a4606[_0xc7b7('0x35')])),'headers':{'Authorization':'Bearer\x20'+_0x5f48d8,'OData-Version':_0xc7b7('0x13')},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x58883f);})[_0xc7b7('0xd')](function(_0x212662){var _0x2d6470=_0x212662['headers'][_0xc7b7('0x42')];var _0x3a0f23=_0x2d6470['substring'](_0x2d6470[_0xc7b7('0x27')]('(')+0x1,_0x2d6470['lastIndexOf'](')'));_0x304b99['ticketId']=_0x3a0f23;_0x35ea73(_0x304b99);})['catch'](function(_0x38a944){_0x501495(_0x38a944[_0xc7b7('0x10')]);});});}function emit(_0x2916f0,_0x441b82,_0x557869,_0x546331){var _0xf63c83={'uri':util[_0xc7b7('0x43')](_0xc7b7('0x44'),_0x2916f0,_0x557869,_0x546331)};io['to'](util[_0xc7b7('0x43')](_0xc7b7('0x45'),_0x441b82))[_0xc7b7('0x46')](_0xc7b7('0x47'),_0xf63c83);}exports['cs']=function(_0x578f95,_0x334fd4,_0x38947a,_0x2682f4,_0x500ca3,_0x3c8992,_0x56e09a,_0x414847){var _0x23f9f5={};_0x3c8992[_0xc7b7('0xa')]=intUtil[_0xc7b7('0x48')](_0x3c8992['remoteUri']);_0x3c8992['serverUrl']=intUtil[_0xc7b7('0x48')](_0x3c8992[_0xc7b7('0x49')]);_0x23f9f5[_0xc7b7('0x40')]=_0x414847===_0xc7b7('0x41')||_0x414847==='unmanaged'?_0xc7b7('0x41'):_0xc7b7('0x21');var _0x3896dc=util[_0xc7b7('0x43')](_0xc7b7('0x4a'),_0x3c8992[_0xc7b7('0xa')]);var _0x53d151=util['format'](_0xc7b7('0x4b'),_0x3c8992['tenantId']);var _0x301ca7=util[_0xc7b7('0x43')](_0xc7b7('0x4c'),_0x3c8992[_0xc7b7('0x49')],_0x334fd4[_0xc7b7('0x4d')],md5(_0x334fd4[_0xc7b7('0x4d')]));if(_0x500ca3&&_0x500ca3[_0xc7b7('0x4e')]){logger[_0xc7b7('0x19')](_0xc7b7('0x4f'),_0xc7b7('0x50'));_0x334fd4[_0xc7b7('0x51')]=_0x301ca7;}else if(_0x56e09a&&_0x56e09a[_0xc7b7('0x52')]&&_0x56e09a[_0xc7b7('0x52')]!==_0xc7b7('0x53')){logger[_0xc7b7('0x19')](_0xc7b7('0x54'),_0xc7b7('0x50'));_0x334fd4['recordingURL']=_0x301ca7;}else{_0x334fd4[_0xc7b7('0x51')]='';}return getUser(_0x23f9f5,_0x3c8992,_0x2682f4,_0x53d151,_0x3896dc,_0x414847)['then'](function(_0x356a0c){logger[_0xc7b7('0x19')]('['+_0x414847[_0xc7b7('0xf')]()+']\x20The\x20User\x20ID\x20is:',_0x356a0c['userId']);logger[_0xc7b7('0x19')]('['+_0x414847[_0xc7b7('0xf')]()+_0xc7b7('0x55'),_0x356a0c[_0xc7b7('0x56')]);return getEndUser(_0x356a0c,_0x3c8992,_0x53d151,_0x3896dc,_0x334fd4,_0x414847);})['then'](function(_0x4f950c){logger[_0xc7b7('0x19')]('['+_0x414847[_0xc7b7('0xf')]()+_0xc7b7('0x57'),_0x4f950c[_0xc7b7('0x2c')]);logger['info']('['+_0x414847['toUpperCase']()+_0xc7b7('0x58'),_0x334fd4[_0xc7b7('0x23')]);return getTicket(_0x4f950c,_0x3c8992,_0x53d151,_0x3896dc,_0x334fd4,_0x38947a,_0x414847);})['then'](function(_0x28dc3d){logger[_0xc7b7('0x19')](util[_0xc7b7('0x43')]('['+_0x414847[_0xc7b7('0xf')]()+']\x20The\x20%s\x20ID\x20is:\x20%s',_0x38947a['ticketType'],_0x28dc3d[_0xc7b7('0x59')]));logger[_0xc7b7('0x19')](util[_0xc7b7('0x43')]('['+_0x414847[_0xc7b7('0xf')]()+_0xc7b7('0x5a'),_0x414847));if(_0x414847!==_0xc7b7('0x5b')){logger[_0xc7b7('0x19')]('['+_0x414847[_0xc7b7('0xf')]()+']',_0xc7b7('0x5c'));emit(_0x3c8992[_0xc7b7('0xa')],_0x2682f4[_0xc7b7('0x5d')],_0x38947a[_0xc7b7('0x35')],_0x28dc3d[_0xc7b7('0x59')]);}})['catch'](function(_0x133bd1){logger['error']('['+_0x414847[_0xc7b7('0xf')]()+']\x20Error\x20running\x20Dynamics365\x20integration',util[_0xc7b7('0x5e')](_0x133bd1,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x54c0=['queue','odata-entityid','lastIndexOf','ticketId','format','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','user:%s','emit','trigger:browser:url','stripTrailingSlash','serverUrl','%s/api/data/v9.0/','https://login.microsoftonline.com/%s/oauth2/token','tenantId','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none',']\x20The\x20User\x20ID\x20is:',']\x20The\x20Enduser\x20ID\x20is:',']\x20The\x20Enduser\x20phone\x20is:',']\x20The\x20%s\x20ID\x20is:\x20%s',']\x20Call\x20direction:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...','name',']\x20Error\x20running\x20Dynamics365\x20integration','inspect','lodash','request-promise','./util','md5','../../../../config/logger','dynamics365','../../../../config/environment','redis','defaults','localhost','POST','clientId','remoteUri','username','password','clientSecret','then','access_token','error','toUpperCase','message','GET','systemusers?$select=internalemailaddress,isdisabled,systemuserid','Bearer\x20','4.0','isNil','validateEmail','email','internalemailaddress','isdisabled','info',']\x20Agent\x20found\x20','userId','systemuserid',']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','userEmail','length','toLowerCase','outbound','destcalleridnum','calleridnum','contacts','/systemusers(','headers','substring','enduserId','catch','contacts?$select=telephone1&$filter=telephone1\x20eq\x20\x27','value','telephone1','contactid','forEach','includes','string','picklist','type','nameField','customField','indexOf','content','ticketType','incident','incidents','getString','Subjects','Descriptions','/contacts(','Fields','phonecalls','assign','callDirection'];(function(_0x5977ef,_0x4a0621){var _0x52976c=function(_0x5e2e99){while(--_0x5e2e99){_0x5977ef['push'](_0x5977ef['shift']());}};_0x52976c(++_0x4a0621);}(_0x54c0,0x1b7));var _0x054c=function(_0x4da58a,_0x5ea5f8){_0x4da58a=_0x4da58a-0x0;var _0x3e5edc=_0x54c0[_0x4da58a];return _0x3e5edc;};'use strict';var _=require(_0x054c('0x0'));var BPromise=require('bluebird');var rp=require(_0x054c('0x1'));var util=require('util');var intUtil=require(_0x054c('0x2'));var md5=require(_0x054c('0x3'));var Redis=require('ioredis');var logger=require(_0x054c('0x4'))(_0x054c('0x5'));var config=require(_0x054c('0x6'));config[_0x054c('0x7')]=_[_0x054c('0x8')](config['redis'],{'host':_0x054c('0x9'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x054c('0x7')]));function getAuthToken(_0x38f5e4,_0x4311f0,_0x515e99){var _0x502f89={'method':_0x054c('0xa'),'uri':_0x4311f0,'form':{'client_id':_0x38f5e4[_0x054c('0xb')],'resource':_0x38f5e4[_0x054c('0xc')],'username':_0x38f5e4[_0x054c('0xd')],'password':_0x38f5e4['password'],'grant_type':_0x054c('0xe'),'client_secret':_0x38f5e4[_0x054c('0xf')]},'json':!![]};return rp(_0x502f89)[_0x054c('0x10')](function(_0x3fd514){return _0x3fd514[_0x054c('0x11')];})['catch'](function(_0x31f0b8){logger[_0x054c('0x12')]('['+[_0x515e99[_0x054c('0x13')]()]+']\x20Wrong\x20credentials!');return _0x31f0b8[_0x054c('0x14')];});}function getUser(_0x59d9eb,_0x12010f,_0x2f1f28,_0x233256,_0x42b09e,_0x14c9f6){return new BPromise(function(_0x35a1d8,_0x384925){return getAuthToken(_0x12010f,_0x233256,_0x14c9f6)[_0x054c('0x10')](function(_0x39c82f){var _0x1cc48b={'method':_0x054c('0x15'),'uri':_0x42b09e+_0x054c('0x16'),'headers':{'Authorization':_0x054c('0x17')+_0x39c82f,'OData-Version':_0x054c('0x18')},'json':!![]};return rp(_0x1cc48b);})[_0x054c('0x10')](function(_0x1e10a2){var _0x6095e4=_0x1e10a2['value'];var _0x5d3d40=![];var _0xddbc1e=null;if(!_[_0x054c('0x19')](_0x2f1f28)){if(intUtil[_0x054c('0x1a')](_0x2f1f28[_0x054c('0x1b')])){_0x59d9eb['userEmail']=_0x2f1f28[_0x054c('0x1b')];for(_0xddbc1e=0x0;_0xddbc1e<_0x6095e4['length'];_0xddbc1e++){if(_0x6095e4[_0xddbc1e][_0x054c('0x1c')]===_0x2f1f28[_0x054c('0x1b')]&&!_0x6095e4[_0xddbc1e][_0x054c('0x1d')]){_0x5d3d40=!![];logger[_0x054c('0x1e')]('['+[_0x14c9f6['toUpperCase']()]+_0x054c('0x1f')+_0x6095e4[_0xddbc1e]['systemuserid']+'!');_0x59d9eb[_0x054c('0x20')]=_0x6095e4[_0xddbc1e][_0x054c('0x21')];}}}}if(!_0x5d3d40){logger['info']('['+[_0x14c9f6['toUpperCase']()]+_0x054c('0x22'));_0x59d9eb[_0x054c('0x23')]=_0x12010f[_0x054c('0xd')];for(_0xddbc1e=0x0;_0xddbc1e<_0x6095e4[_0x054c('0x24')];_0xddbc1e++){if(_0x6095e4[_0xddbc1e]['internalemailaddress']===_0x12010f[_0x054c('0xd')]){_0x59d9eb[_0x054c('0x20')]=_0x6095e4[_0xddbc1e][_0x054c('0x21')];}}}_0x35a1d8(_0x59d9eb);})['catch'](function(_0x43abcf){_0x384925(_0x43abcf[_0x054c('0x14')]);});});}function createEndUser(_0x3dedae,_0x37b9ba,_0x1f39ca,_0x2b0085,_0x340fdf,_0x40565d){return new BPromise(function(_0x3e1440,_0x263ead){return getAuthToken(_0x37b9ba,_0x1f39ca,_0x40565d)['then'](function(_0x40e37b){var _0x5f3bb=_0x40565d[_0x054c('0x25')]()===_0x054c('0x26')?_0x340fdf[_0x054c('0x27')]:_0x340fdf[_0x054c('0x28')];var _0x54e657={'method':'POST','uri':_0x2b0085+_0x054c('0x29'),'body':{'telephone1':_0x5f3bb,'fullname':_0x5f3bb,'firstname':_0x5f3bb,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0x054c('0x2a')+_0x3dedae['userId']+')'},'headers':{'Authorization':_0x054c('0x17')+_0x40e37b,'OData-Version':_0x054c('0x18')},'json':!![],'resolveWithFullResponse':!![]};return rp(_0x54e657);})[_0x054c('0x10')](function(_0x96654f){var _0x5b3748=_0x96654f[_0x054c('0x2b')]['odata-entityid'];var _0x597cad=_0x5b3748[_0x054c('0x2c')](_0x5b3748['lastIndexOf']('(')+0x1,_0x5b3748['lastIndexOf'](')'));_0x3dedae[_0x054c('0x2d')]=_0x597cad;_0x3e1440(_0x3dedae);})[_0x054c('0x2e')](function(_0x1ad1b7){_0x263ead(_0x1ad1b7[_0x054c('0x14')]);});});}function getEndUser(_0x2342de,_0x3039e8,_0x1bce23,_0x14da64,_0x2d777e,_0x4c64ed){return new BPromise(function(_0x2747cf,_0x8f3782){var _0x4f8301=_0x4c64ed[_0x054c('0x25')]()===_0x054c('0x26')?_0x2d777e[_0x054c('0x27')]:_0x2d777e['calleridnum'];return getAuthToken(_0x3039e8,_0x1bce23,_0x4c64ed)[_0x054c('0x10')](function(_0xbef37c){var _0x498f4e={'method':_0x054c('0x15'),'uri':_0x14da64+_0x054c('0x2f')+_0x4f8301['replace']('+','%2b')+'\x27','headers':{'Authorization':_0x054c('0x17')+_0xbef37c,'If-None-Match':null,'OData-Version':_0x054c('0x18')},'json':!![]};return rp(_0x498f4e);})['then'](function(_0x1af88e){var _0x409738=null;if(_0x1af88e){var _0x4052da=_0x1af88e[_0x054c('0x30')];var _0x30d5b3=![];for(_0x409738=0x0;_0x409738<_0x4052da[_0x054c('0x24')];_0x409738++){if(_0x4052da[_0x409738][_0x054c('0x31')]===_0x4f8301){_0x30d5b3=!![];_0x2342de['enduserId']=_0x4052da[_0x409738][_0x054c('0x32')];}}if(_0x30d5b3){_0x2747cf(_0x2342de);}else{return createEndUser(_0x2342de,_0x3039e8,_0x1bce23,_0x14da64,_0x2d777e,_0x4c64ed)[_0x054c('0x10')](function(_0x1db479){logger[_0x054c('0x1e')]('['+[_0x4c64ed[_0x054c('0x13')]()]+']\x20Enduser\x20created!',_0x1db479[_0x054c('0x2d')]);_0x2747cf(_0x1db479);});}}else{return createEndUser(_0x2342de,_0x3039e8,_0x1bce23,_0x14da64,_0x2d777e,_0x4c64ed)[_0x054c('0x10')](function(_0x5eca9d){logger[_0x054c('0x1e')]('['+[_0x4c64ed['toUpperCase']()]+']\x20Enduser\x20Created!',_0x5eca9d[_0x054c('0x2d')]);_0x2747cf(_0x5eca9d);});}});});}function getCustomFields(_0x5aeb4a,_0x1a701c,_0xe6bcd7){var _0x24e93f={};if(_0x5aeb4a[_0x054c('0x24')]>0x0){_[_0x054c('0x33')](_0x5aeb4a,function(_0x46eeca){if(_[_0x054c('0x34')]([_0x054c('0x35'),_0x054c('0x36')],_0x46eeca[_0x054c('0x37')])&&_0x46eeca[_0x054c('0x38')]&&!_0x46eeca[_0x054c('0x39')]){var _0x5d38a1=_0x46eeca['idField']['toLowerCase']();var _0x2eb1c6=_0x5d38a1[_0x054c('0x2c')](0x0,_0x5d38a1[_0x054c('0x3a')]('_'));var _0x1b459d=_0x5d38a1[_0x054c('0x2c')](_0x5d38a1[_0x054c('0x3a')]('_')+0x1);if(_0x2eb1c6===_0xe6bcd7){_0x24e93f[_0x1b459d]=_0x46eeca[_0x054c('0x3b')];}}});}return _0x24e93f;}function getTicket(_0x328de5,_0x16bcb2,_0x430766,_0x23c06a,_0x32a96b,_0x39b428,_0x2ef118){return new BPromise(function(_0x18d275,_0x266d87){var _0x3c0466;return getAuthToken(_0x16bcb2,_0x430766,_0x2ef118)['then'](function(_0x127c02){if(_0x39b428[_0x054c('0x3c')]===_0x054c('0x3d')){_0x3c0466={'method':'POST','uri':_0x23c06a+_0x054c('0x3e'),'body':Object['assign']({},{'title':intUtil[_0x054c('0x3f')](_0x39b428[_0x054c('0x40')],_0x32a96b,'\x20'),'description':intUtil['getString'](_0x39b428[_0x054c('0x41')],_0x32a96b,'\x0a'),'customerid_contact@odata.bind':_0x054c('0x42')+_0x328de5[_0x054c('0x2d')]+')','ownerid@odata.bind':_0x054c('0x2a')+_0x328de5[_0x054c('0x20')]+')','caseorigincode':'1'},getCustomFields(_0x39b428[_0x054c('0x43')],_0x32a96b,_0x39b428['ticketType'])),'headers':{'Authorization':_0x054c('0x17')+_0x127c02,'OData-Version':_0x054c('0x18')},'json':!![],'resolveWithFullResponse':!![]};}if(_0x39b428[_0x054c('0x3c')]==='phonecall'){_0x3c0466={'method':_0x054c('0xa'),'uri':_0x23c06a+_0x054c('0x44'),'body':Object[_0x054c('0x45')]({},{'subject':intUtil[_0x054c('0x3f')](_0x39b428[_0x054c('0x40')],_0x32a96b,'\x20'),'phonenumber':String(_0x32a96b[_0x054c('0x28')]),'description':intUtil[_0x054c('0x3f')](_0x39b428[_0x054c('0x41')],_0x32a96b,'\x0a'),'regardingobjectid_contact@odata.bind':_0x054c('0x42')+_0x328de5[_0x054c('0x2d')]+')','ownerid@odata.bind':_0x054c('0x2a')+_0x328de5[_0x054c('0x20')]+')','directioncode':_0x328de5['callDirection']==='queue'?![]:!![],'phonecall_activity_parties':[{'partyid_systemuser@odata.bind':_0x054c('0x2a')+_0x328de5[_0x054c('0x20')]+')','participationtypemask':_0x328de5['callDirection']==='queue'?0x2:0x1},{'partyid_contact@odata.bind':_0x054c('0x42')+_0x328de5[_0x054c('0x2d')]+')','participationtypemask':_0x328de5[_0x054c('0x46')]===_0x054c('0x47')?0x1:0x2}]},getCustomFields(_0x39b428[_0x054c('0x43')],_0x32a96b,_0x39b428[_0x054c('0x3c')])),'headers':{'Authorization':_0x054c('0x17')+_0x127c02,'OData-Version':_0x054c('0x18')},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x3c0466);})[_0x054c('0x10')](function(_0x43c7ee){var _0x2d5044=_0x43c7ee[_0x054c('0x2b')][_0x054c('0x48')];var _0x428ab3=_0x2d5044[_0x054c('0x2c')](_0x2d5044[_0x054c('0x49')]('(')+0x1,_0x2d5044[_0x054c('0x49')](')'));_0x328de5[_0x054c('0x4a')]=_0x428ab3;_0x18d275(_0x328de5);})[_0x054c('0x2e')](function(_0x5bda77){_0x266d87(_0x5bda77[_0x054c('0x14')]);});});}function emit(_0x501837,_0x2a4548,_0x4db1ac,_0x7cc2a1){var _0x1b1a13={'uri':util[_0x054c('0x4b')](_0x054c('0x4c'),_0x501837,_0x4db1ac,_0x7cc2a1)};io['to'](util[_0x054c('0x4b')](_0x054c('0x4d'),_0x2a4548))[_0x054c('0x4e')](_0x054c('0x4f'),_0x1b1a13);}exports['cs']=function(_0x3a07ab,_0x5a3528,_0x186223,_0x4ef8d2,_0x1567e4,_0x127a49,_0x292a7b,_0x593f98){var _0x36e9e5={};_0x127a49[_0x054c('0xc')]=intUtil[_0x054c('0x50')](_0x127a49[_0x054c('0xc')]);_0x127a49[_0x054c('0x51')]=intUtil[_0x054c('0x50')](_0x127a49[_0x054c('0x51')]);_0x36e9e5[_0x054c('0x46')]=_0x593f98===_0x054c('0x47')||_0x593f98==='unmanaged'?_0x054c('0x47'):_0x054c('0x26');var _0x4ffea1=util[_0x054c('0x4b')](_0x054c('0x52'),_0x127a49[_0x054c('0xc')]);var _0x3cdf34=util[_0x054c('0x4b')](_0x054c('0x53'),_0x127a49[_0x054c('0x54')]);var _0x3583dd=util[_0x054c('0x4b')](_0x054c('0x55'),_0x127a49['serverUrl'],_0x5a3528[_0x054c('0x56')],md5(_0x5a3528[_0x054c('0x56')]));if(_0x1567e4&&_0x1567e4[_0x054c('0x57')]){logger[_0x054c('0x1e')](_0x054c('0x58'),_0x054c('0x59'));_0x5a3528[_0x054c('0x5a')]=_0x3583dd;}else if(_0x292a7b&&_0x292a7b[_0x054c('0x5b')]&&_0x292a7b[_0x054c('0x5b')]!==_0x054c('0x5c')){logger['info']('[OUTBOUND]','Recording\x20is\x20enabled!');_0x5a3528[_0x054c('0x5a')]=_0x3583dd;}else{_0x5a3528[_0x054c('0x5a')]='';}return getUser(_0x36e9e5,_0x127a49,_0x4ef8d2,_0x3cdf34,_0x4ffea1,_0x593f98)[_0x054c('0x10')](function(_0x4b2ada){logger['info']('['+_0x593f98['toUpperCase']()+_0x054c('0x5d'),_0x4b2ada['userId']);logger[_0x054c('0x1e')]('['+_0x593f98['toUpperCase']()+']\x20The\x20User\x20email\x20is:',_0x4b2ada[_0x054c('0x23')]);return getEndUser(_0x4b2ada,_0x127a49,_0x3cdf34,_0x4ffea1,_0x5a3528,_0x593f98);})['then'](function(_0x4d6428){logger[_0x054c('0x1e')]('['+_0x593f98[_0x054c('0x13')]()+_0x054c('0x5e'),_0x4d6428[_0x054c('0x2d')]);logger[_0x054c('0x1e')]('['+_0x593f98[_0x054c('0x13')]()+_0x054c('0x5f'),_0x5a3528[_0x054c('0x28')]);return getTicket(_0x4d6428,_0x127a49,_0x3cdf34,_0x4ffea1,_0x5a3528,_0x186223,_0x593f98);})[_0x054c('0x10')](function(_0x26be7d){logger[_0x054c('0x1e')](util[_0x054c('0x4b')]('['+_0x593f98[_0x054c('0x13')]()+_0x054c('0x60'),_0x186223['ticketType'],_0x26be7d[_0x054c('0x4a')]));logger['info'](util['format']('['+_0x593f98[_0x054c('0x13')]()+_0x054c('0x61'),_0x593f98));if(_0x593f98!=='unmanaged'){logger[_0x054c('0x1e')]('['+_0x593f98[_0x054c('0x13')]()+']',_0x054c('0x62'));emit(_0x127a49['remoteUri'],_0x4ef8d2[_0x054c('0x63')],_0x186223[_0x054c('0x3c')],_0x26be7d[_0x054c('0x4a')]);}})[_0x054c('0x2e')](function(_0x48bd32){logger[_0x054c('0x12')]('['+_0x593f98[_0x054c('0x13')]()+_0x054c('0x64'),util[_0x054c('0x65')](_0x48bd32,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/freshdesk.js b/server/services/ami/trigger/integration/freshdesk.js index 42979f1..d86d20d 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 _0x88f5=['Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','%s/helpdesk/tickets/%d','catch','toUpperCase','md5','util','../../../../config/environment','freshdesk','redis','defaults','localhost','application/json','emit','info','Creating\x20new\x20ticket...','merge','Caller\x20-\x20%s','calleridnum','getString','Descriptions','Tags','name','Fields','custom_fields','mapValues','value','format','%s/api/v2/tickets','remoteUri','POST','then','Ticket\x20created!','validateEmail','%s/api/v2/agents','length','Agent\x20found!','find','contact','email','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/api/v2/agents/me','Admin\x20account\x20selected.','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','stringify','GET','map','forEach','includes','string','nameField','customField','toLowerCase','content','picklist','type','idField','push','variable','variableName','Variable','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','The\x20User\x20ID\x20is:','calleridname','The\x20Enduser\x20ID\x20is:','error','outbound','recordingFormat','none','Recording\x20is\x20enabled!','The\x20Ticket\x20ID\x20is:','[OUTBOUND]'];(function(_0x40f0ee,_0x516a88){var _0x1cc6b4=function(_0x4548b4){while(--_0x4548b4){_0x40f0ee['push'](_0x40f0ee['shift']());}};_0x1cc6b4(++_0x516a88);}(_0x88f5,0x110));var _0x588f=function(_0x3847a1,_0x17934e){_0x3847a1=_0x3847a1-0x0;var _0x4d50d1=_0x88f5[_0x3847a1];return _0x4d50d1;};'use strict';var _=require('lodash');var rp=require('request-promise');var md5=require(_0x588f('0x0'));var util=require(_0x588f('0x1'));var Redis=require('ioredis');var intUtil=require('./util');var config=require(_0x588f('0x2'));var logger=require('../../../../config/logger')(_0x588f('0x3'));config[_0x588f('0x4')]=_[_0x588f('0x5')](config[_0x588f('0x4')],{'host':_0x588f('0x6'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));var headers={'Content-Type':_0x588f('0x7'),'Accept':'application/json'};function emit(_0x24109c,_0x30d0b8,_0x242e50){io['to'](_0x24109c)[_0x588f('0x8')](_0x30d0b8,_0x242e50);}function getTicket(_0x8110db,_0x395c8b,_0x14d061,_0x12cd75,_0x985536){logger[_0x588f('0x9')](_0x588f('0xa'));var _0x296a4e=_[_0x588f('0xb')]({'responder_id':_0x395c8b['id'],'requester_id':_0x14d061['id'],'name':util['format'](_0x588f('0xc'),_0x985536['calleridname']),'phone':_0x985536[_0x588f('0xd')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil[_0x588f('0xe')](_0x12cd75['Subjects'],_0x985536,'\x20'),'description':intUtil[_0x588f('0xe')](_0x12cd75[_0x588f('0xf')],_0x985536,'
'),'tags':getTags(_0x12cd75[_0x588f('0x10')],_0x588f('0x11'))},getCustomFields(_0x12cd75[_0x588f('0x12')],_0x985536));_0x296a4e[_0x588f('0x13')]=_[_0x588f('0x14')](_['keyBy'](_0x296a4e[_0x588f('0x13')],'id'),_0x588f('0x15'));return request({'uri':util[_0x588f('0x16')](_0x588f('0x17'),_0x8110db[_0x588f('0x18')]),'method':_0x588f('0x19'),'body':_0x296a4e})[_0x588f('0x1a')](function(_0x1fd1d8){logger[_0x588f('0x9')](_0x588f('0x1b'));return _0x1fd1d8;});}function getUser(_0xfda4f9,_0x4a2934){if(intUtil[_0x588f('0x1c')](_0x4a2934)){return request({'uri':util[_0x588f('0x16')](_0x588f('0x1d'),_0xfda4f9[_0x588f('0x18')]),'qs':{'email':_0x4a2934}})[_0x588f('0x1a')](function(_0x191774){if(_0x191774[_0x588f('0x1e')]){logger[_0x588f('0x9')](_0x588f('0x1f'));return _[_0x588f('0x20')](_0x191774,function(_0x62ad8d){return _0x62ad8d[_0x588f('0x21')][_0x588f('0x22')]===_0x4a2934;});}else{logger['info'](_0x588f('0x23'));return request({'uri':util[_0x588f('0x16')](_0x588f('0x24'),_0xfda4f9[_0x588f('0x18')])})[_0x588f('0x1a')](function(_0x427e28){logger['info'](_0x588f('0x25'));return _0x427e28;});}});}else{logger['info'](_0x588f('0x26'));return request({'uri':util['format']('%s/api/v2/agents/me',_0xfda4f9['remoteUri'])})[_0x588f('0x1a')](function(_0x36aec5){logger[_0x588f('0x9')]('Admin\x20account\x20selected.');return _0x36aec5;});}}function getEndUser(_0x814942,_0x21132c,_0x3a1545){logger[_0x588f('0x9')](_0x588f('0x27'),_0x3a1545);return request({'uri':util[_0x588f('0x16')](_0x588f('0x28'),_0x814942[_0x588f('0x18')]),'qs':{'phone':_0x3a1545}})[_0x588f('0x1a')](function(_0x211108){if(_0x211108[_0x588f('0x1e')]){logger[_0x588f('0x9')](_0x588f('0x29'));return _['find'](_0x211108,{'phone':_0x3a1545});}else{logger[_0x588f('0x9')](_0x588f('0x2a'));return request({'uri':util[_0x588f('0x16')](_0x588f('0x28'),_0x814942[_0x588f('0x18')]),'method':_0x588f('0x19'),'body':{'name':_0x21132c,'phone':_0x3a1545}})[_0x588f('0x1a')](function(_0x51fdeb){logger[_0x588f('0x9')](_0x588f('0x2b'));return _0x51fdeb;});}});}function getAuth(_0x41dabe){return util['format']('Basic\x20%s',new Buffer(_0x41dabe[_0x588f('0x2c')]+':X')[_0x588f('0x2d')](_0x588f('0x2e')));}function request(_0x3e85c7){logger[_0x588f('0x2f')]('[HTTP]',JSON[_0x588f('0x30')](_0x3e85c7));return rp(_[_0x588f('0x5')](_0x3e85c7,{'method':_0x588f('0x31'),'headers':headers,'json':!![]}));}function getTags(_0x390f05,_0x1a9dcd){var _0x3d3fc6=[];if(_0x390f05&&_0x390f05[_0x588f('0x1e')]>0x0){_0x3d3fc6=_[_0x588f('0x32')](_0x390f05,_0x1a9dcd);}return _0x3d3fc6;}function getCustomFields(_0x327f23,_0x35168f){var _0xec8089=[];var _0x420d8a={'custom_fields':[]};if(_0x327f23['length']>0x0){_[_0x588f('0x33')](_0x327f23,function(_0x751c95){if(_[_0x588f('0x34')]([_0x588f('0x35'),'picklist'],_0x751c95['type'])&&_0x751c95[_0x588f('0x36')]&&!_0x751c95[_0x588f('0x37')]){_0x420d8a[_0x751c95[_0x588f('0x36')][_0x588f('0x38')]()]=_0x751c95[_0x588f('0x39')][_0x588f('0x2d')]();}else if(_['includes']([_0x588f('0x35'),_0x588f('0x3a')],_0x751c95[_0x588f('0x3b')])&&_0x751c95[_0x588f('0x3c')]&&_0x751c95[_0x588f('0x37')]){_0x420d8a['custom_fields'][_0x588f('0x3d')]({'id':_0x751c95[_0x588f('0x3c')],'value':_0x751c95['content'][_0x588f('0x2d')]()});}else if(_0x751c95[_0x588f('0x3b')]===_0x588f('0x3e')&&_0x751c95[_0x588f('0x3f')]&&_0x751c95[_0x588f('0x3c')]&&_0x751c95[_0x588f('0x37')]){_0x35168f[_0x751c95['variableName']]&&_0x420d8a['custom_fields']['push']({'id':_0x751c95[_0x588f('0x3c')],'value':_0x35168f[_0x751c95[_0x588f('0x3f')]][_0x588f('0x2d')]()});}else if(_0x751c95[_0x588f('0x3b')]==='customVariable'&&_0x751c95['Variable']&&_0x751c95[_0x588f('0x40')][_0x588f('0x11')]&&_0x751c95[_0x588f('0x3c')]&&_0x751c95[_0x588f('0x37')]){_0x35168f[_0x751c95[_0x588f('0x40')]['name'][_0x588f('0x38')]()]&&_0x420d8a[_0x588f('0x13')][_0x588f('0x3d')]({'id':_0x751c95[_0x588f('0x3c')],'value':_0x35168f[_0x751c95[_0x588f('0x40')][_0x588f('0x11')][_0x588f('0x38')]()][_0x588f('0x2d')]()});}});}return _0x420d8a;}exports[_0x588f('0x41')]=function(_0x42a1c2,_0x19a8cd,_0x165f3f,_0x2dcb66,_0x521e07,_0x5875e6){var _0x1e3841,_0x2abf7e;_0x5875e6[_0x588f('0x18')]=intUtil[_0x588f('0x42')](_0x5875e6[_0x588f('0x18')]);_0x5875e6[_0x588f('0x43')]=intUtil['stripTrailingSlash'](_0x5875e6[_0x588f('0x43')]);if(_0x521e07&&_0x521e07[_0x588f('0x44')]){logger['info'](_0x588f('0x45'),'Recording\x20is\x20enabled!');_0x19a8cd[_0x588f('0x46')]=util[_0x588f('0x16')](_0x588f('0x47'),_0x5875e6[_0x588f('0x43')],_0x19a8cd[_0x588f('0x48')],md5(_0x19a8cd[_0x588f('0x48')]));}else{_0x19a8cd[_0x588f('0x46')]='';}headers[_0x588f('0x49')]=getAuth(_0x5875e6);return getUser(_0x5875e6,_0x2dcb66[_0x588f('0x22')])[_0x588f('0x1a')](function(_0x41085d){_0x1e3841=_0x41085d;logger[_0x588f('0x9')](_0x588f('0x4a'),_0x1e3841['id']);return getEndUser(_0x5875e6,_0x19a8cd[_0x588f('0x4b')],_0x19a8cd['calleridnum']);})[_0x588f('0x1a')](function(_0x2b17fb){_0x2abf7e=_0x2b17fb;logger[_0x588f('0x9')](_0x588f('0x4c'),_0x2abf7e['id']);return getTicket(_0x5875e6,_0x1e3841,_0x2abf7e,_0x165f3f,_0x19a8cd);})[_0x588f('0x1a')](function(_0x2d3583){if(_0x2d3583&&_0x2d3583['id']){logger['info']('Ticket\x20created!');logger['info']('The\x20Ticket\x20ID\x20is:',_0x2d3583['id']);logger[_0x588f('0x9')](_0x588f('0x45'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x588f('0x16')]('user:%s',_0x2dcb66['name']),'trigger:browser:url',{'uri':util[_0x588f('0x16')]('%s/helpdesk/tickets/%d',_0x5875e6[_0x588f('0x18')],_0x2d3583['id'])});}})['catch'](function(_0x42f83a){logger[_0x588f('0x4d')](_0x588f('0x45'),JSON[_0x588f('0x30')](_0x42f83a));});};exports[_0x588f('0x4e')]=function(_0x3ab146,_0x293299,_0x57d709,_0x2a2af8,_0x248f63,_0x1390b2,_0x45729e){var _0x114c1a,_0x59ae9a;_0x1390b2[_0x588f('0x18')]=intUtil[_0x588f('0x42')](_0x1390b2[_0x588f('0x18')]);_0x1390b2[_0x588f('0x43')]=intUtil[_0x588f('0x42')](_0x1390b2[_0x588f('0x43')]);if(_0x45729e&&_0x45729e[_0x588f('0x4f')]&&_0x45729e[_0x588f('0x4f')]!==_0x588f('0x50')){logger[_0x588f('0x9')]('[OUTBOUND]',_0x588f('0x51'));_0x293299[_0x588f('0x46')]=util[_0x588f('0x16')](_0x588f('0x47'),_0x1390b2[_0x588f('0x43')],_0x293299[_0x588f('0x48')],md5(_0x293299['uniqueid']));}headers[_0x588f('0x49')]=getAuth(_0x1390b2);return getUser(_0x1390b2,_0x2a2af8[_0x588f('0x22')])[_0x588f('0x1a')](function(_0xb83473){_0x114c1a=_0xb83473;logger[_0x588f('0x9')](_0x588f('0x4a'),_0x114c1a['id']);return getEndUser(_0x1390b2,_0x293299['destcalleridname'],_0x293299['destcalleridnum']);})[_0x588f('0x1a')](function(_0x497242){_0x59ae9a=_0x497242;logger['info'](_0x588f('0x4c'),_0x59ae9a['id']);return getTicket(_0x1390b2,_0x114c1a,_0x59ae9a,_0x57d709,_0x293299);})[_0x588f('0x1a')](function(_0x195503){if(_0x195503&&_0x195503['id']){logger[_0x588f('0x9')](_0x588f('0x1b'));logger[_0x588f('0x9')](_0x588f('0x52'),_0x195503['id']);logger[_0x588f('0x9')](_0x588f('0x53'),_0x588f('0x54'));emit(util[_0x588f('0x16')]('user:%s',_0x2a2af8['name']),_0x588f('0x55'),{'uri':util[_0x588f('0x16')](_0x588f('0x56'),_0x1390b2[_0x588f('0x18')],_0x195503['id'])});}})[_0x588f('0x57')](function(_0x4dd6b4){logger[_0x588f('0x4d')]('[OUTBOUND]',JSON[_0x588f('0x30')](_0x4dd6b4));});};exports['unmanaged']=function(_0x42fbb2,_0x5d5aec,_0x2a7b91,_0x5163bc,_0x3f41bb,_0x325463){var _0x57ac34,_0x38d2e7;_0x325463[_0x588f('0x18')]=intUtil['stripTrailingSlash'](_0x325463[_0x588f('0x18')]);_0x325463[_0x588f('0x43')]=intUtil['stripTrailingSlash'](_0x325463[_0x588f('0x43')]);if(_0x3f41bb&&_0x3f41bb['monitor_format']){logger[_0x588f('0x9')]('['+_0x5d5aec['lastevent'][_0x588f('0x58')]()+']','Recording\x20is\x20enabled!');_0x5d5aec[_0x588f('0x46')]=util[_0x588f('0x16')](_0x588f('0x47'),_0x325463[_0x588f('0x43')],_0x5d5aec['uniqueid'],md5(_0x5d5aec[_0x588f('0x48')]));}else{_0x5d5aec[_0x588f('0x46')]='';}headers[_0x588f('0x49')]=getAuth(_0x325463);return getUser(_0x325463,'')[_0x588f('0x1a')](function(_0x4e92a7){_0x57ac34=_0x4e92a7;logger[_0x588f('0x9')](_0x588f('0x4a'),_0x57ac34['id']);return getEndUser(_0x325463,_0x5d5aec[_0x588f('0x4b')],_0x5d5aec[_0x588f('0xd')]);})[_0x588f('0x1a')](function(_0x7a9b97){_0x38d2e7=_0x7a9b97;logger[_0x588f('0x9')](_0x588f('0x4c'),_0x38d2e7['id']);return getTicket(_0x325463,_0x57ac34,_0x38d2e7,_0x2a7b91,_0x5d5aec);})['then'](function(_0x1fb9b9){if(_0x1fb9b9){logger[_0x588f('0x9')](_0x588f('0x1b'));logger[_0x588f('0x9')](_0x588f('0x52'),_0x1fb9b9['id']);}})['catch'](function(_0x1e008b){logger[_0x588f('0x4d')]('['+_0x5d5aec['lastevent'][_0x588f('0x58')]()+']',JSON[_0x588f('0x30')](_0x1e008b));});}; \ No newline at end of file +var _0xba48=['GET','forEach','string','picklist','nameField','toLowerCase','content','includes','type','idField','variableName','push','Variable','customField','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','The\x20User\x20ID\x20is:','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','%s/helpdesk/tickets/%d','catch','error','outbound','recordingFormat','none','[OUTBOUND]','destcalleridname','Ticket\x20created!','unmanaged','toUpperCase','Authorization','lastevent','request-promise','md5','ioredis','./util','../../../../config/environment','freshdesk','redis','defaults','localhost','application/json','merge','format','Caller\x20-\x20%s','calleridname','calleridnum','getString','Descriptions','
','Tags','name','Fields','mapValues','custom_fields','value','%s/api/v2/tickets','POST','then','info','validateEmail','remoteUri','length','Agent\x20found!','find','contact','email','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','Admin\x20account\x20selected.','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','%s/api/v2/agents/me','Searching\x20enduser\x20with\x20phone','Enduser\x20found!','Enduser\x20created.','Basic\x20%s','toString','base64','[HTTP]','stringify'];(function(_0x397c0d,_0x4a5458){var _0x4e2704=function(_0x479c98){while(--_0x479c98){_0x397c0d['push'](_0x397c0d['shift']());}};_0x4e2704(++_0x4a5458);}(_0xba48,0x18e));var _0x8ba4=function(_0x13ea00,_0x12f610){_0x13ea00=_0x13ea00-0x0;var _0x1f7347=_0xba48[_0x13ea00];return _0x1f7347;};'use strict';var _=require('lodash');var rp=require(_0x8ba4('0x0'));var md5=require(_0x8ba4('0x1'));var util=require('util');var Redis=require(_0x8ba4('0x2'));var intUtil=require(_0x8ba4('0x3'));var config=require(_0x8ba4('0x4'));var logger=require('../../../../config/logger')(_0x8ba4('0x5'));config[_0x8ba4('0x6')]=_[_0x8ba4('0x7')](config[_0x8ba4('0x6')],{'host':_0x8ba4('0x8'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x8ba4('0x6')]));var headers={'Content-Type':_0x8ba4('0x9'),'Accept':'application/json'};function emit(_0x2d93ce,_0x426b63,_0x558fb8){io['to'](_0x2d93ce)['emit'](_0x426b63,_0x558fb8);}function getTicket(_0x964bb7,_0x37ed73,_0x58e293,_0x1d039b,_0x381ca0){logger['info']('Creating\x20new\x20ticket...');var _0x1f06b0=_[_0x8ba4('0xa')]({'responder_id':_0x37ed73['id'],'requester_id':_0x58e293['id'],'name':util[_0x8ba4('0xb')](_0x8ba4('0xc'),_0x381ca0[_0x8ba4('0xd')]),'phone':_0x381ca0[_0x8ba4('0xe')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil[_0x8ba4('0xf')](_0x1d039b['Subjects'],_0x381ca0,'\x20'),'description':intUtil[_0x8ba4('0xf')](_0x1d039b[_0x8ba4('0x10')],_0x381ca0,_0x8ba4('0x11')),'tags':getTags(_0x1d039b[_0x8ba4('0x12')],_0x8ba4('0x13'))},getCustomFields(_0x1d039b[_0x8ba4('0x14')],_0x381ca0));_0x1f06b0['custom_fields']=_[_0x8ba4('0x15')](_['keyBy'](_0x1f06b0[_0x8ba4('0x16')],'id'),_0x8ba4('0x17'));return request({'uri':util[_0x8ba4('0xb')](_0x8ba4('0x18'),_0x964bb7['remoteUri']),'method':_0x8ba4('0x19'),'body':_0x1f06b0})[_0x8ba4('0x1a')](function(_0x116656){logger[_0x8ba4('0x1b')]('Ticket\x20created!');return _0x116656;});}function getUser(_0x17b089,_0x28a464){if(intUtil[_0x8ba4('0x1c')](_0x28a464)){return request({'uri':util[_0x8ba4('0xb')]('%s/api/v2/agents',_0x17b089[_0x8ba4('0x1d')]),'qs':{'email':_0x28a464}})[_0x8ba4('0x1a')](function(_0x47938b){if(_0x47938b[_0x8ba4('0x1e')]){logger[_0x8ba4('0x1b')](_0x8ba4('0x1f'));return _[_0x8ba4('0x20')](_0x47938b,function(_0x4629ec){return _0x4629ec[_0x8ba4('0x21')][_0x8ba4('0x22')]===_0x28a464;});}else{logger[_0x8ba4('0x1b')](_0x8ba4('0x23'));return request({'uri':util[_0x8ba4('0xb')]('%s/api/v2/agents/me',_0x17b089[_0x8ba4('0x1d')])})['then'](function(_0x597a8b){logger[_0x8ba4('0x1b')](_0x8ba4('0x24'));return _0x597a8b;});}});}else{logger[_0x8ba4('0x1b')](_0x8ba4('0x25'));return request({'uri':util[_0x8ba4('0xb')](_0x8ba4('0x26'),_0x17b089[_0x8ba4('0x1d')])})[_0x8ba4('0x1a')](function(_0x2f2b55){logger[_0x8ba4('0x1b')]('Admin\x20account\x20selected.');return _0x2f2b55;});}}function getEndUser(_0x102b54,_0x19048d,_0x3bf759){logger[_0x8ba4('0x1b')](_0x8ba4('0x27'),_0x3bf759);return request({'uri':util[_0x8ba4('0xb')]('%s/api/v2/contacts',_0x102b54['remoteUri']),'qs':{'phone':_0x3bf759}})[_0x8ba4('0x1a')](function(_0x40da54){if(_0x40da54[_0x8ba4('0x1e')]){logger[_0x8ba4('0x1b')](_0x8ba4('0x28'));return _['find'](_0x40da54,{'phone':_0x3bf759});}else{logger[_0x8ba4('0x1b')]('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'uri':util[_0x8ba4('0xb')]('%s/api/v2/contacts',_0x102b54['remoteUri']),'method':_0x8ba4('0x19'),'body':{'name':_0x19048d,'phone':_0x3bf759}})[_0x8ba4('0x1a')](function(_0x25b5c3){logger['info'](_0x8ba4('0x29'));return _0x25b5c3;});}});}function getAuth(_0x5220a0){return util[_0x8ba4('0xb')](_0x8ba4('0x2a'),new Buffer(_0x5220a0['apiKey']+':X')[_0x8ba4('0x2b')](_0x8ba4('0x2c')));}function request(_0x34d78a){logger['debug'](_0x8ba4('0x2d'),JSON[_0x8ba4('0x2e')](_0x34d78a));return rp(_[_0x8ba4('0x7')](_0x34d78a,{'method':_0x8ba4('0x2f'),'headers':headers,'json':!![]}));}function getTags(_0x330651,_0xc156cc){var _0x3c193f=[];if(_0x330651&&_0x330651['length']>0x0){_0x3c193f=_['map'](_0x330651,_0xc156cc);}return _0x3c193f;}function getCustomFields(_0x4afde1,_0x289e96){var _0x3c3275=[];var _0x188847={'custom_fields':[]};if(_0x4afde1['length']>0x0){_[_0x8ba4('0x30')](_0x4afde1,function(_0x39717f){if(_['includes']([_0x8ba4('0x31'),_0x8ba4('0x32')],_0x39717f['type'])&&_0x39717f[_0x8ba4('0x33')]&&!_0x39717f['customField']){_0x188847[_0x39717f[_0x8ba4('0x33')][_0x8ba4('0x34')]()]=_0x39717f[_0x8ba4('0x35')][_0x8ba4('0x2b')]();}else if(_[_0x8ba4('0x36')](['string',_0x8ba4('0x32')],_0x39717f[_0x8ba4('0x37')])&&_0x39717f['idField']&&_0x39717f['customField']){_0x188847[_0x8ba4('0x16')]['push']({'id':_0x39717f[_0x8ba4('0x38')],'value':_0x39717f[_0x8ba4('0x35')][_0x8ba4('0x2b')]()});}else if(_0x39717f[_0x8ba4('0x37')]==='variable'&&_0x39717f[_0x8ba4('0x39')]&&_0x39717f[_0x8ba4('0x38')]&&_0x39717f['customField']){_0x289e96[_0x39717f[_0x8ba4('0x39')]]&&_0x188847[_0x8ba4('0x16')][_0x8ba4('0x3a')]({'id':_0x39717f[_0x8ba4('0x38')],'value':_0x289e96[_0x39717f[_0x8ba4('0x39')]][_0x8ba4('0x2b')]()});}else if(_0x39717f['type']==='customVariable'&&_0x39717f[_0x8ba4('0x3b')]&&_0x39717f['Variable'][_0x8ba4('0x13')]&&_0x39717f[_0x8ba4('0x38')]&&_0x39717f[_0x8ba4('0x3c')]){_0x289e96[_0x39717f['Variable']['name']['toLowerCase']()]&&_0x188847[_0x8ba4('0x16')]['push']({'id':_0x39717f[_0x8ba4('0x38')],'value':_0x289e96[_0x39717f[_0x8ba4('0x3b')][_0x8ba4('0x13')][_0x8ba4('0x34')]()][_0x8ba4('0x2b')]()});}});}return _0x188847;}exports[_0x8ba4('0x3d')]=function(_0xe16555,_0x41ccf9,_0x5a75ed,_0xf3000b,_0x4f5aba,_0xe31bd2){var _0x5995e2,_0x4d42ad;_0xe31bd2[_0x8ba4('0x1d')]=intUtil[_0x8ba4('0x3e')](_0xe31bd2[_0x8ba4('0x1d')]);_0xe31bd2[_0x8ba4('0x3f')]=intUtil[_0x8ba4('0x3e')](_0xe31bd2['serverUrl']);if(_0x4f5aba&&_0x4f5aba[_0x8ba4('0x40')]){logger[_0x8ba4('0x1b')](_0x8ba4('0x41'),_0x8ba4('0x42'));_0x41ccf9[_0x8ba4('0x43')]=util[_0x8ba4('0xb')](_0x8ba4('0x44'),_0xe31bd2[_0x8ba4('0x3f')],_0x41ccf9[_0x8ba4('0x45')],md5(_0x41ccf9[_0x8ba4('0x45')]));}else{_0x41ccf9[_0x8ba4('0x43')]='';}headers['Authorization']=getAuth(_0xe31bd2);return getUser(_0xe31bd2,_0xf3000b[_0x8ba4('0x22')])[_0x8ba4('0x1a')](function(_0x31c1ab){_0x5995e2=_0x31c1ab;logger['info'](_0x8ba4('0x46'),_0x5995e2['id']);return getEndUser(_0xe31bd2,_0x41ccf9['calleridname'],_0x41ccf9[_0x8ba4('0xe')]);})['then'](function(_0x245ed7){_0x4d42ad=_0x245ed7;logger['info'](_0x8ba4('0x47'),_0x4d42ad['id']);return getTicket(_0xe31bd2,_0x5995e2,_0x4d42ad,_0x5a75ed,_0x41ccf9);})[_0x8ba4('0x1a')](function(_0x44744d){if(_0x44744d&&_0x44744d['id']){logger[_0x8ba4('0x1b')]('Ticket\x20created!');logger[_0x8ba4('0x1b')](_0x8ba4('0x48'),_0x44744d['id']);logger['info'](_0x8ba4('0x41'),_0x8ba4('0x49'));emit(util[_0x8ba4('0xb')](_0x8ba4('0x4a'),_0xf3000b['name']),_0x8ba4('0x4b'),{'uri':util[_0x8ba4('0xb')](_0x8ba4('0x4c'),_0xe31bd2[_0x8ba4('0x1d')],_0x44744d['id'])});}})[_0x8ba4('0x4d')](function(_0x3c9c1a){logger[_0x8ba4('0x4e')](_0x8ba4('0x41'),JSON['stringify'](_0x3c9c1a));});};exports[_0x8ba4('0x4f')]=function(_0x64009b,_0x389bca,_0xc5a6b0,_0xa52826,_0x58aafb,_0x58daab,_0x33995f){var _0x1f80e6,_0x3f1d4d;_0x58daab[_0x8ba4('0x1d')]=intUtil[_0x8ba4('0x3e')](_0x58daab[_0x8ba4('0x1d')]);_0x58daab['serverUrl']=intUtil[_0x8ba4('0x3e')](_0x58daab[_0x8ba4('0x3f')]);if(_0x33995f&&_0x33995f[_0x8ba4('0x50')]&&_0x33995f['recordingFormat']!==_0x8ba4('0x51')){logger[_0x8ba4('0x1b')](_0x8ba4('0x52'),'Recording\x20is\x20enabled!');_0x389bca[_0x8ba4('0x43')]=util[_0x8ba4('0xb')](_0x8ba4('0x44'),_0x58daab[_0x8ba4('0x3f')],_0x389bca[_0x8ba4('0x45')],md5(_0x389bca[_0x8ba4('0x45')]));}headers['Authorization']=getAuth(_0x58daab);return getUser(_0x58daab,_0xa52826[_0x8ba4('0x22')])[_0x8ba4('0x1a')](function(_0x102fa4){_0x1f80e6=_0x102fa4;logger[_0x8ba4('0x1b')](_0x8ba4('0x46'),_0x1f80e6['id']);return getEndUser(_0x58daab,_0x389bca[_0x8ba4('0x53')],_0x389bca['destcalleridnum']);})[_0x8ba4('0x1a')](function(_0x28fd4d){_0x3f1d4d=_0x28fd4d;logger[_0x8ba4('0x1b')](_0x8ba4('0x47'),_0x3f1d4d['id']);return getTicket(_0x58daab,_0x1f80e6,_0x3f1d4d,_0xc5a6b0,_0x389bca);})[_0x8ba4('0x1a')](function(_0x2e50a2){if(_0x2e50a2&&_0x2e50a2['id']){logger['info'](_0x8ba4('0x54'));logger[_0x8ba4('0x1b')](_0x8ba4('0x48'),_0x2e50a2['id']);logger[_0x8ba4('0x1b')]('[OUTBOUND]',_0x8ba4('0x49'));emit(util[_0x8ba4('0xb')](_0x8ba4('0x4a'),_0xa52826['name']),_0x8ba4('0x4b'),{'uri':util['format'](_0x8ba4('0x4c'),_0x58daab['remoteUri'],_0x2e50a2['id'])});}})[_0x8ba4('0x4d')](function(_0x49dca9){logger[_0x8ba4('0x4e')](_0x8ba4('0x52'),JSON[_0x8ba4('0x2e')](_0x49dca9));});};exports[_0x8ba4('0x55')]=function(_0x1b7201,_0x1179cd,_0x59d1c9,_0x4156df,_0xfb0a00,_0x43684c){var _0x3ac972,_0x3b812e;_0x43684c[_0x8ba4('0x1d')]=intUtil['stripTrailingSlash'](_0x43684c[_0x8ba4('0x1d')]);_0x43684c['serverUrl']=intUtil[_0x8ba4('0x3e')](_0x43684c['serverUrl']);if(_0xfb0a00&&_0xfb0a00[_0x8ba4('0x40')]){logger[_0x8ba4('0x1b')]('['+_0x1179cd['lastevent'][_0x8ba4('0x56')]()+']',_0x8ba4('0x42'));_0x1179cd[_0x8ba4('0x43')]=util[_0x8ba4('0xb')](_0x8ba4('0x44'),_0x43684c['serverUrl'],_0x1179cd[_0x8ba4('0x45')],md5(_0x1179cd[_0x8ba4('0x45')]));}else{_0x1179cd[_0x8ba4('0x43')]='';}headers[_0x8ba4('0x57')]=getAuth(_0x43684c);return getUser(_0x43684c,'')['then'](function(_0x3923d4){_0x3ac972=_0x3923d4;logger[_0x8ba4('0x1b')](_0x8ba4('0x46'),_0x3ac972['id']);return getEndUser(_0x43684c,_0x1179cd[_0x8ba4('0xd')],_0x1179cd[_0x8ba4('0xe')]);})[_0x8ba4('0x1a')](function(_0x33d04f){_0x3b812e=_0x33d04f;logger[_0x8ba4('0x1b')](_0x8ba4('0x47'),_0x3b812e['id']);return getTicket(_0x43684c,_0x3ac972,_0x3b812e,_0x59d1c9,_0x1179cd);})['then'](function(_0x14e779){if(_0x14e779){logger[_0x8ba4('0x1b')]('Ticket\x20created!');logger[_0x8ba4('0x1b')](_0x8ba4('0x48'),_0x14e779['id']);}})[_0x8ba4('0x4d')](function(_0x225439){logger['error']('['+_0x1179cd[_0x8ba4('0x58')]['toUpperCase']()+']',JSON['stringify'](_0x225439));});}; \ 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 3b58421..f9f55cd 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 _0x9149=['error','message','/api/lookup?q=','&f=','&entities=contact','find','contacts','format','contactNumber','mobile_number','endUserId','Contact\x20found\x20mobile_number:','work_number','POST','/api/contacts','contact','/api/tasks','getString','Contact','YYYY-MM-DDTHH:mm:ss','add','ticketId','task','Task\x20created:','/contacts/','emit','Token\x20token=','apiKey','remoteUri','stripTrailingSlash','serverUrl','username','toLowerCase','outbound','destcalleridnum','calleridnum','queue','unmanaged','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','The\x20ticket\x20ID\x20is:\x20%s','name',']\x20Error\x20running\x20Freshsales\x20integration','inspect','lodash','md5','util','moment','bluebird','ioredis','./util','../../../../config/environment','../../../../config/logger','redis','defaults','socket.io-emitter','GET','info','Getting\x20admin\x20information','then','length','email','adminId','Admin\x20found:','Requested\x20Resource\x20not\x20Found','catch','toUpperCase','/api/selector/owners','headers','Getting\x20user\x20list','Getting\x20user\x20with\x20email','agentEmail','userEmail','userId','User\x20found:','Admin\x20selected','adminEmail'];(function(_0x4f1c83,_0x1cd82e){var _0x584a95=function(_0x248928){while(--_0x248928){_0x4f1c83['push'](_0x4f1c83['shift']());}};_0x584a95(++_0x1cd82e);}(_0x9149,0x17e));var _0x9914=function(_0x73cac8,_0x4f9981){_0x73cac8=_0x73cac8-0x0;var _0x31ce30=_0x9149[_0x73cac8];return _0x31ce30;};'use strict';var _=require(_0x9914('0x0'));var rp=require('request-promise');var md5=require(_0x9914('0x1'));var util=require(_0x9914('0x2'));var moment=require(_0x9914('0x3'));var Promise=require(_0x9914('0x4'));var Redis=require(_0x9914('0x5'));var intUtil=require(_0x9914('0x6'));var config=require(_0x9914('0x7'));var logger=require(_0x9914('0x8'))('freshsales');config[_0x9914('0x9')]=_[_0x9914('0xa')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x9914('0xb'))(new Redis(config['redis']));function getAdminId(_0x4ccf9e,_0x149217,_0x26bed4,_0x411ece){return new Promise(function(_0x3dfcb0,_0x4ac2dc){var _0x50f0ef=![];var _0x35e462={'method':_0x9914('0xc'),'uri':_0x411ece+'/api/selector/owners','json':!![]};_0x35e462['headers']=_0x26bed4;logger[_0x9914('0xd')](_0x9914('0xe'));return rp(_0x35e462)[_0x9914('0xf')](function(_0x21653a){if(_0x21653a){var _0x146b12=_0x21653a['users'];var _0x52e19f=null;for(_0x52e19f=0x0;_0x52e19f<_0x146b12[_0x9914('0x10')];_0x52e19f++){if(_0x146b12[_0x52e19f][_0x9914('0x11')]===_0x4ccf9e['adminEmail']){_0x4ccf9e[_0x9914('0x12')]=_0x146b12[_0x52e19f]['id'];_0x50f0ef=!![];}}if(_0x50f0ef){logger[_0x9914('0xd')](_0x9914('0x13'),_0x4ccf9e[_0x9914('0x12')]);_0x3dfcb0(_0x4ccf9e);}else{_0x4ac2dc({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}}else{_0x4ac2dc({'statusCode':0x194,'message':_0x9914('0x14')});}})[_0x9914('0x15')](function(_0x12d39c){logger['error']('['+[_0x149217[_0x9914('0x16')]()]+']',_0x12d39c['message']);_0x4ac2dc(_0x12d39c);});});}function getUser(_0x51838f,_0x1d753e,_0x2d17b1){return function(_0x200e76){return new Promise(function(_0x4b42df,_0x133f36){var _0x3edde1={'method':_0x9914('0xc'),'uri':_0x2d17b1+_0x9914('0x17'),'json':!![]};_0x3edde1[_0x9914('0x18')]=_0x1d753e;logger[_0x9914('0xd')](_0x9914('0x19'));return rp(_0x3edde1)[_0x9914('0xf')](function(_0x434b66){if(_0x434b66){var _0x486cf2=_0x434b66['users'];var _0x337796=![];var _0x1b3783=null;if(_0x200e76['agentEmail']!==null){logger[_0x9914('0xd')](_0x9914('0x1a'),_0x200e76[_0x9914('0x1b')]);_0x200e76[_0x9914('0x1c')]=_0x200e76[_0x9914('0x1b')];for(_0x1b3783=0x0;_0x1b3783<_0x486cf2['length'];_0x1b3783++){if(_0x486cf2[_0x1b3783]['email']===_0x200e76['agentEmail']){_0x337796=!![];_0x200e76[_0x9914('0x1d')]=_0x486cf2[_0x1b3783]['id'];logger['info'](_0x9914('0x1e'),_0x200e76[_0x9914('0x1d')]);}}}if(!_0x337796){logger[_0x9914('0xd')](_0x9914('0x1f'));_0x200e76['userEmail']=_0x200e76[_0x9914('0x20')];_0x200e76[_0x9914('0x1d')]=_0x200e76[_0x9914('0x12')];_0x337796=!![];}if(_0x337796){_0x4b42df(_0x200e76);}else{_0x133f36({'statusCode':0x194,'message':_0x9914('0x14')});}}else{_0x133f36({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}})[_0x9914('0x15')](function(_0x35f78d){logger[_0x9914('0x21')]('['+[_0x51838f[_0x9914('0x16')]()]+']',_0x35f78d[_0x9914('0x22')]);_0x133f36(_0x35f78d);});});};}function searchContact(_0xbbd6ab,_0x191173,_0x6f2890,_0x256f41){return new Promise(function(_0x1b86f6,_0x409087){var _0x40d117={'method':_0x9914('0xc'),'headers':_0x191173,'uri':_0xbbd6ab+_0x9914('0x23')+_0x256f41+_0x9914('0x24')+_0x6f2890+_0x9914('0x25'),'json':!![]};rp(_0x40d117)['then'](function(_0x4fb2b0){var _0x44ab87=_[_0x9914('0x26')](_0x4fb2b0[_0x9914('0x27')][_0x9914('0x27')],[_0x6f2890,_0x256f41]);_0x1b86f6(_0x44ab87);})[_0x9914('0x15')](function(_0x7ab25){_0x409087(_0x7ab25);});});}function getEndUser(_0x2f4453,_0x46d933,_0x405830){return function(_0x44d05e){return new Promise(function(_0x5e07fc,_0x2f2c31){logger[_0x9914('0xd')](util[_0x9914('0x28')]('Searching\x20contact\x20with\x20phone\x20%s',_0x44d05e[_0x9914('0x29')]));searchContact(_0x405830,_0x46d933,_0x9914('0x2a'),_0x44d05e[_0x9914('0x29')])[_0x9914('0xf')](function(_0x295f22){if(_0x295f22){_0x44d05e[_0x9914('0x2b')]=_0x295f22['id'];logger[_0x9914('0xd')](_0x9914('0x2c'),_0x44d05e[_0x9914('0x2b')]);return _0x5e07fc(_0x44d05e);}searchContact(_0x405830,_0x46d933,_0x9914('0x2d'),_0x44d05e[_0x9914('0x29')])[_0x9914('0xf')](function(_0x50f1f9){if(_0x50f1f9){_0x44d05e[_0x9914('0x2b')]=_0x50f1f9['id'];logger[_0x9914('0xd')]('Contact\x20found\x20work_number:',_0x44d05e[_0x9914('0x2b')]);return _0x5e07fc(_0x44d05e);}createEndUser(_0x44d05e,_0x2f4453,_0x46d933,_0x405830)['then'](function(_0x240f3c){logger[_0x9914('0xd')]('Contact\x20created:',_0x240f3c[_0x9914('0x2b')]);return _0x5e07fc(_0x240f3c);});});})[_0x9914('0x15')](function(_0x36ffdb){_0x2f2c31(_0x36ffdb);});});};}function createEndUser(_0x28e164,_0x417d07,_0x4907db,_0x2ada4f){return new Promise(function(_0x2ed1ad,_0x5d1a8a){var _0x59356a=moment();var _0x567105={'method':_0x9914('0x2e'),'uri':_0x2ada4f+_0x9914('0x2f'),'body':{'contact':{'last_name':_0x28e164[_0x9914('0x29')],'work_number':_0x28e164[_0x9914('0x29')],'mobile_number':_0x28e164[_0x9914('0x29')],'owner_id':_0x28e164[_0x9914('0x1d')],'created_at':_0x59356a[_0x9914('0x28')]('YYYY-MM-DDTHH:mm:ss')}},'json':!![]};_0x567105[_0x9914('0x18')]=_0x4907db;logger[_0x9914('0xd')]('Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact');return rp(_0x567105)[_0x9914('0xf')](function(_0x3943ef){_0x28e164['endUserId']=_0x3943ef[_0x9914('0x30')]['id'];_0x2ed1ad(_0x28e164);})[_0x9914('0x15')](function(_0x54a33a){logger[_0x9914('0x21')]('['+[_0x417d07['toUpperCase']()]+']',_0x54a33a['message']);_0x5d1a8a(_0x54a33a[_0x9914('0x22')]);});});}function getTicket(_0x5a8a1b,_0x2594dd,_0x247263,_0x251c31,_0xb99775){return function(_0x546cb8){logger['info']('Creating\x20new\x20task');return new Promise(function(_0x105ff3,_0x976fde){var _0x26fca9=moment();var _0x599c35={'method':'POST','uri':_0x247263+_0x9914('0x31'),'body':{'title':intUtil[_0x9914('0x32')](_0x251c31['Subjects'],_0xb99775,'\x20'),'description':intUtil['getString'](_0x251c31['Descriptions'],_0xb99775,'\x0a'),'owner_id':_0x546cb8[_0x9914('0x1d')],'creater_id':_0x546cb8[_0x9914('0x12')],'targetable_id':_0x546cb8[_0x9914('0x2b')],'targetable_type':_0x9914('0x33'),'created_at':_0x26fca9[_0x9914('0x28')](_0x9914('0x34')),'due_date':_0x26fca9[_0x9914('0x35')](0x1e,'m')[_0x9914('0x28')]('YYYY-MM-DDTHH:mm:ss')},'json':!![]};_0x599c35[_0x9914('0x18')]=_0x2594dd;return rp(_0x599c35)[_0x9914('0xf')](function(_0x14be7b){_0x546cb8[_0x9914('0x36')]=_0x14be7b[_0x9914('0x37')]['id'];logger[_0x9914('0xd')](_0x9914('0x38'),_0x546cb8[_0x9914('0x36')]);_0x105ff3(_0x546cb8);})[_0x9914('0x15')](function(_0x4fdfc7){logger[_0x9914('0x21')]('['+[_0x5a8a1b['toUpperCase']()]+']',_0x4fdfc7[_0x9914('0x22')]);_0x976fde(_0x4fdfc7[_0x9914('0x22')]);});});};}function emit(_0x49db67,_0x31f692,_0x5c0e12){var _0x1b29c5={'uri':_0x49db67+_0x9914('0x39')+_0x5c0e12};io['to'](util[_0x9914('0x28')]('user:%s',_0x31f692))[_0x9914('0x3a')]('trigger:browser:url',_0x1b29c5);}exports['cs']=function(_0x560252,_0x262161,_0x5e6bdc,_0x458461,_0x4b9f4e,_0x55db9f,_0x4c42f3,_0x39ebc6){var _0x301995={};var _0x14a85c={'Authorization':_0x9914('0x3b')+_0x55db9f[_0x9914('0x3c')]};_0x55db9f[_0x9914('0x3d')]=intUtil[_0x9914('0x3e')](_0x55db9f['remoteUri']);_0x55db9f['serverUrl']=intUtil[_0x9914('0x3e')](_0x55db9f[_0x9914('0x3f')]);var _0x27523d=_0x55db9f[_0x9914('0x3d')];_0x301995[_0x9914('0x20')]=_0x55db9f[_0x9914('0x40')];_0x301995[_0x9914('0x29')]=_0x39ebc6[_0x9914('0x41')]()===_0x9914('0x42')?_0x262161[_0x9914('0x43')]:_0x262161[_0x9914('0x44')];_0x301995['callDirection']=_0x39ebc6===_0x9914('0x45')||_0x39ebc6===_0x9914('0x46')?'queue':_0x9914('0x42');if(_0x458461){_0x301995[_0x9914('0x1b')]=_0x458461[_0x9914('0x11')];}var _0x3bfacd=util[_0x9914('0x28')](_0x9914('0x47'),_0x55db9f[_0x9914('0x3f')],_0x262161[_0x9914('0x48')],md5(_0x262161[_0x9914('0x48')]));if(_0x4b9f4e&&_0x4b9f4e[_0x9914('0x49')]){logger['info'](_0x9914('0x4a'),_0x9914('0x4b'));_0x262161[_0x9914('0x4c')]=_0x3bfacd;}else if(_0x4c42f3&&_0x4c42f3[_0x9914('0x4d')]&&_0x4c42f3['recordingFormat']!==_0x9914('0x4e')){logger[_0x9914('0xd')]('[OUTBOUND]',_0x9914('0x4b'));_0x262161['recordingURL']=_0x3bfacd;}else{_0x262161[_0x9914('0x4c')]='';}return getAdminId(_0x301995,_0x39ebc6,_0x14a85c,_0x27523d)[_0x9914('0xf')](getUser(_0x39ebc6,_0x14a85c,_0x27523d))[_0x9914('0xf')](getEndUser(_0x39ebc6,_0x14a85c,_0x27523d))[_0x9914('0xf')](getTicket(_0x39ebc6,_0x14a85c,_0x27523d,_0x5e6bdc,_0x262161))[_0x9914('0xf')](function(_0x531f21){logger[_0x9914('0xd')](util[_0x9914('0x28')](_0x9914('0x4f'),_0x531f21[_0x9914('0x36')]));if(_0x39ebc6!==_0x9914('0x46')){logger[_0x9914('0xd')]('['+[_0x39ebc6[_0x9914('0x16')]()]+']','Displaying\x20task\x20in\x20a\x20new\x20tab...');emit(_0x27523d,_0x458461[_0x9914('0x50')],_0x531f21[_0x9914('0x2b')]);}})[_0x9914('0x15')](function(_0x5ee9ea){logger['error']('['+[_0x39ebc6[_0x9914('0x16')]()]+_0x9914('0x51'),util[_0x9914('0x52')](_0x5ee9ea,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x8d2c=['request-promise','md5','moment','bluebird','ioredis','../../../../config/environment','../../../../config/logger','freshsales','redis','defaults','socket.io-emitter','GET','/api/selector/owners','headers','Getting\x20admin\x20information','then','users','email','adminEmail','info','adminId','catch','error','toUpperCase','Getting\x20user\x20list','agentEmail','userEmail','length','userId','User\x20found:','Admin\x20selected','Requested\x20Resource\x20not\x20Found','&f=','&entities=contact','contacts','format','Searching\x20contact\x20with\x20phone\x20%s','contactNumber','mobile_number','endUserId','Contact\x20found\x20mobile_number:','work_number','Contact\x20found\x20work_number:','Contact\x20created:','POST','YYYY-MM-DDTHH:mm:ss','Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact','contact','message','Creating\x20new\x20task','/api/tasks','Subjects','Descriptions','Contact','ticketId','task','Token\x20token=','apiKey','stripTrailingSlash','remoteUri','serverUrl','username','toLowerCase','calleridnum','callDirection','outbound','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','recordingURL','The\x20ticket\x20ID\x20is:\x20%s','unmanaged','Displaying\x20task\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20Freshsales\x20integration','inspect','lodash'];(function(_0x111b26,_0xf76620){var _0x3a0a1e=function(_0x2829cc){while(--_0x2829cc){_0x111b26['push'](_0x111b26['shift']());}};_0x3a0a1e(++_0xf76620);}(_0x8d2c,0x18f));var _0xc8d2=function(_0x316d6a,_0x3dcdcc){_0x316d6a=_0x316d6a-0x0;var _0x48933a=_0x8d2c[_0x316d6a];return _0x48933a;};'use strict';var _=require(_0xc8d2('0x0'));var rp=require(_0xc8d2('0x1'));var md5=require(_0xc8d2('0x2'));var util=require('util');var moment=require(_0xc8d2('0x3'));var Promise=require(_0xc8d2('0x4'));var Redis=require(_0xc8d2('0x5'));var intUtil=require('./util');var config=require(_0xc8d2('0x6'));var logger=require(_0xc8d2('0x7'))(_0xc8d2('0x8'));config[_0xc8d2('0x9')]=_[_0xc8d2('0xa')](config[_0xc8d2('0x9')],{'host':'localhost','port':0x18eb});var io=require(_0xc8d2('0xb'))(new Redis(config[_0xc8d2('0x9')]));function getAdminId(_0x2ae46d,_0x17c511,_0x4b3b2c,_0x49f6d3){return new Promise(function(_0x358739,_0x30107a){var _0x27b782=![];var _0x15e0f9={'method':_0xc8d2('0xc'),'uri':_0x49f6d3+_0xc8d2('0xd'),'json':!![]};_0x15e0f9[_0xc8d2('0xe')]=_0x4b3b2c;logger['info'](_0xc8d2('0xf'));return rp(_0x15e0f9)[_0xc8d2('0x10')](function(_0x113300){if(_0x113300){var _0x1e1a15=_0x113300[_0xc8d2('0x11')];var _0x53501f=null;for(_0x53501f=0x0;_0x53501f<_0x1e1a15['length'];_0x53501f++){if(_0x1e1a15[_0x53501f][_0xc8d2('0x12')]===_0x2ae46d[_0xc8d2('0x13')]){_0x2ae46d['adminId']=_0x1e1a15[_0x53501f]['id'];_0x27b782=!![];}}if(_0x27b782){logger[_0xc8d2('0x14')]('Admin\x20found:',_0x2ae46d[_0xc8d2('0x15')]);_0x358739(_0x2ae46d);}else{_0x30107a({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}}else{_0x30107a({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}})[_0xc8d2('0x16')](function(_0x2351be){logger[_0xc8d2('0x17')]('['+[_0x17c511[_0xc8d2('0x18')]()]+']',_0x2351be['message']);_0x30107a(_0x2351be);});});}function getUser(_0x25db6b,_0x590cb6,_0x1f8cf8){return function(_0x3cb5c6){return new Promise(function(_0x2c46ec,_0x15a815){var _0x542f0f={'method':_0xc8d2('0xc'),'uri':_0x1f8cf8+_0xc8d2('0xd'),'json':!![]};_0x542f0f['headers']=_0x590cb6;logger[_0xc8d2('0x14')](_0xc8d2('0x19'));return rp(_0x542f0f)[_0xc8d2('0x10')](function(_0x36288f){if(_0x36288f){var _0x2c11ff=_0x36288f[_0xc8d2('0x11')];var _0x2b75a0=![];var _0x2ca0ea=null;if(_0x3cb5c6[_0xc8d2('0x1a')]!==null){logger[_0xc8d2('0x14')]('Getting\x20user\x20with\x20email',_0x3cb5c6[_0xc8d2('0x1a')]);_0x3cb5c6[_0xc8d2('0x1b')]=_0x3cb5c6[_0xc8d2('0x1a')];for(_0x2ca0ea=0x0;_0x2ca0ea<_0x2c11ff[_0xc8d2('0x1c')];_0x2ca0ea++){if(_0x2c11ff[_0x2ca0ea][_0xc8d2('0x12')]===_0x3cb5c6['agentEmail']){_0x2b75a0=!![];_0x3cb5c6[_0xc8d2('0x1d')]=_0x2c11ff[_0x2ca0ea]['id'];logger['info'](_0xc8d2('0x1e'),_0x3cb5c6[_0xc8d2('0x1d')]);}}}if(!_0x2b75a0){logger[_0xc8d2('0x14')](_0xc8d2('0x1f'));_0x3cb5c6[_0xc8d2('0x1b')]=_0x3cb5c6[_0xc8d2('0x13')];_0x3cb5c6[_0xc8d2('0x1d')]=_0x3cb5c6[_0xc8d2('0x15')];_0x2b75a0=!![];}if(_0x2b75a0){_0x2c46ec(_0x3cb5c6);}else{_0x15a815({'statusCode':0x194,'message':_0xc8d2('0x20')});}}else{_0x15a815({'statusCode':0x194,'message':_0xc8d2('0x20')});}})[_0xc8d2('0x16')](function(_0x508fa8){logger[_0xc8d2('0x17')]('['+[_0x25db6b['toUpperCase']()]+']',_0x508fa8['message']);_0x15a815(_0x508fa8);});});};}function searchContact(_0xd4dc2,_0x392a18,_0x44b2bb,_0xf4eeb0){return new Promise(function(_0x39b910,_0x3a11d0){var _0x2b31d6={'method':_0xc8d2('0xc'),'headers':_0x392a18,'uri':_0xd4dc2+'/api/lookup?q='+_0xf4eeb0+_0xc8d2('0x21')+_0x44b2bb+_0xc8d2('0x22'),'json':!![]};rp(_0x2b31d6)[_0xc8d2('0x10')](function(_0x48c267){var _0x521537=_['find'](_0x48c267[_0xc8d2('0x23')][_0xc8d2('0x23')],[_0x44b2bb,_0xf4eeb0]);_0x39b910(_0x521537);})['catch'](function(_0x4192a7){_0x3a11d0(_0x4192a7);});});}function getEndUser(_0x41adbb,_0x2ab5c1,_0x3e7aaf){return function(_0x57c2d2){return new Promise(function(_0x43b9c3,_0x1563df){logger['info'](util[_0xc8d2('0x24')](_0xc8d2('0x25'),_0x57c2d2[_0xc8d2('0x26')]));searchContact(_0x3e7aaf,_0x2ab5c1,_0xc8d2('0x27'),_0x57c2d2[_0xc8d2('0x26')])[_0xc8d2('0x10')](function(_0x37bf4d){if(_0x37bf4d){_0x57c2d2[_0xc8d2('0x28')]=_0x37bf4d['id'];logger[_0xc8d2('0x14')](_0xc8d2('0x29'),_0x57c2d2['endUserId']);return _0x43b9c3(_0x57c2d2);}searchContact(_0x3e7aaf,_0x2ab5c1,_0xc8d2('0x2a'),_0x57c2d2['contactNumber'])[_0xc8d2('0x10')](function(_0x47d3b9){if(_0x47d3b9){_0x57c2d2[_0xc8d2('0x28')]=_0x47d3b9['id'];logger['info'](_0xc8d2('0x2b'),_0x57c2d2[_0xc8d2('0x28')]);return _0x43b9c3(_0x57c2d2);}createEndUser(_0x57c2d2,_0x41adbb,_0x2ab5c1,_0x3e7aaf)[_0xc8d2('0x10')](function(_0x25833c){logger[_0xc8d2('0x14')](_0xc8d2('0x2c'),_0x25833c[_0xc8d2('0x28')]);return _0x43b9c3(_0x25833c);});});})['catch'](function(_0x5e19c5){_0x1563df(_0x5e19c5);});});};}function createEndUser(_0x512a4a,_0x2d32f2,_0x54f2f7,_0x204bab){return new Promise(function(_0x407e19,_0x1082e7){var _0x53711f=moment();var _0x4cdcbd={'method':_0xc8d2('0x2d'),'uri':_0x204bab+'/api/contacts','body':{'contact':{'last_name':_0x512a4a['contactNumber'],'work_number':_0x512a4a[_0xc8d2('0x26')],'mobile_number':_0x512a4a[_0xc8d2('0x26')],'owner_id':_0x512a4a[_0xc8d2('0x1d')],'created_at':_0x53711f[_0xc8d2('0x24')](_0xc8d2('0x2e'))}},'json':!![]};_0x4cdcbd[_0xc8d2('0xe')]=_0x54f2f7;logger['info'](_0xc8d2('0x2f'));return rp(_0x4cdcbd)['then'](function(_0x1e601d){_0x512a4a[_0xc8d2('0x28')]=_0x1e601d[_0xc8d2('0x30')]['id'];_0x407e19(_0x512a4a);})[_0xc8d2('0x16')](function(_0x2fc086){logger[_0xc8d2('0x17')]('['+[_0x2d32f2['toUpperCase']()]+']',_0x2fc086['message']);_0x1082e7(_0x2fc086[_0xc8d2('0x31')]);});});}function getTicket(_0x1112b5,_0x507eb8,_0x2f8c40,_0x4b904e,_0x5f3eb3){return function(_0x363602){logger[_0xc8d2('0x14')](_0xc8d2('0x32'));return new Promise(function(_0x50055f,_0x2c73db){var _0x4bb0e5=moment();var _0x3cdf51={'method':_0xc8d2('0x2d'),'uri':_0x2f8c40+_0xc8d2('0x33'),'body':{'title':intUtil['getString'](_0x4b904e[_0xc8d2('0x34')],_0x5f3eb3,'\x20'),'description':intUtil['getString'](_0x4b904e[_0xc8d2('0x35')],_0x5f3eb3,'\x0a'),'owner_id':_0x363602[_0xc8d2('0x1d')],'creater_id':_0x363602[_0xc8d2('0x15')],'targetable_id':_0x363602[_0xc8d2('0x28')],'targetable_type':_0xc8d2('0x36'),'created_at':_0x4bb0e5[_0xc8d2('0x24')]('YYYY-MM-DDTHH:mm:ss'),'due_date':_0x4bb0e5['add'](0x1e,'m')[_0xc8d2('0x24')](_0xc8d2('0x2e'))},'json':!![]};_0x3cdf51[_0xc8d2('0xe')]=_0x507eb8;return rp(_0x3cdf51)[_0xc8d2('0x10')](function(_0x506dc7){_0x363602[_0xc8d2('0x37')]=_0x506dc7[_0xc8d2('0x38')]['id'];logger['info']('Task\x20created:',_0x363602[_0xc8d2('0x37')]);_0x50055f(_0x363602);})[_0xc8d2('0x16')](function(_0x245bd3){logger[_0xc8d2('0x17')]('['+[_0x1112b5[_0xc8d2('0x18')]()]+']',_0x245bd3[_0xc8d2('0x31')]);_0x2c73db(_0x245bd3[_0xc8d2('0x31')]);});});};}function emit(_0x1e867f,_0x363c3d,_0xaca13e){var _0x176d1b={'uri':_0x1e867f+'/contacts/'+_0xaca13e};io['to'](util['format']('user:%s',_0x363c3d))['emit']('trigger:browser:url',_0x176d1b);}exports['cs']=function(_0x27ca35,_0x4e3308,_0x52f809,_0x3cb730,_0x3756cf,_0x401311,_0x4cd4d0,_0x403e1a){var _0x527bd2={};var _0xd3d7c0={'Authorization':_0xc8d2('0x39')+_0x401311[_0xc8d2('0x3a')]};_0x401311['remoteUri']=intUtil[_0xc8d2('0x3b')](_0x401311[_0xc8d2('0x3c')]);_0x401311['serverUrl']=intUtil[_0xc8d2('0x3b')](_0x401311[_0xc8d2('0x3d')]);var _0x20799b=_0x401311[_0xc8d2('0x3c')];_0x527bd2[_0xc8d2('0x13')]=_0x401311[_0xc8d2('0x3e')];_0x527bd2[_0xc8d2('0x26')]=_0x403e1a[_0xc8d2('0x3f')]()==='outbound'?_0x4e3308['destcalleridnum']:_0x4e3308[_0xc8d2('0x40')];_0x527bd2[_0xc8d2('0x41')]=_0x403e1a==='queue'||_0x403e1a==='unmanaged'?'queue':_0xc8d2('0x42');if(_0x3cb730){_0x527bd2[_0xc8d2('0x1a')]=_0x3cb730['email'];}var _0x1c0a73=util['format'](_0xc8d2('0x43'),_0x401311[_0xc8d2('0x3d')],_0x4e3308[_0xc8d2('0x44')],md5(_0x4e3308['uniqueid']));if(_0x3756cf&&_0x3756cf[_0xc8d2('0x45')]){logger['info']('[QUEUE]','Recording\x20is\x20enabled!');_0x4e3308['recordingURL']=_0x1c0a73;}else if(_0x4cd4d0&&_0x4cd4d0['recordingFormat']&&_0x4cd4d0[_0xc8d2('0x46')]!==_0xc8d2('0x47')){logger[_0xc8d2('0x14')](_0xc8d2('0x48'),_0xc8d2('0x49'));_0x4e3308[_0xc8d2('0x4a')]=_0x1c0a73;}else{_0x4e3308[_0xc8d2('0x4a')]='';}return getAdminId(_0x527bd2,_0x403e1a,_0xd3d7c0,_0x20799b)['then'](getUser(_0x403e1a,_0xd3d7c0,_0x20799b))['then'](getEndUser(_0x403e1a,_0xd3d7c0,_0x20799b))['then'](getTicket(_0x403e1a,_0xd3d7c0,_0x20799b,_0x52f809,_0x4e3308))['then'](function(_0x2a5a24){logger[_0xc8d2('0x14')](util[_0xc8d2('0x24')](_0xc8d2('0x4b'),_0x2a5a24[_0xc8d2('0x37')]));if(_0x403e1a!==_0xc8d2('0x4c')){logger['info']('['+[_0x403e1a[_0xc8d2('0x18')]()]+']',_0xc8d2('0x4d'));emit(_0x20799b,_0x3cb730['name'],_0x2a5a24[_0xc8d2('0x28')]);}})['catch'](function(_0x2f7f60){logger[_0xc8d2('0x17')]('['+[_0x403e1a[_0xc8d2('0x18')]()]+_0xc8d2('0x4e'),util[_0xc8d2('0x4f')](_0x2f7f60,{'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 48137c0..caec97f 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 _0xc571=['./sugarcrm','./desk','./vtiger','./servicenow','./dynamics365','./freshsales','zendesk','salesforce','sugarcrm','freshdesk','zoho','vtiger','dynamics365','freshsales','servicenow','exec','includes','toLowerCase','data1','data2','find','Configurations','data3','queue','outbound','log','unmanaged','unknown\x20integration','../../../../config/logger','error','[EXEC]','format','%s\x20account\x20#%s\x20not\x20found','lodash','util','./zendesk','./salesforce'];(function(_0x909fbd,_0x3968fc){var _0x2e43cb=function(_0x1b4ec4){while(--_0x1b4ec4){_0x909fbd['push'](_0x909fbd['shift']());}};_0x2e43cb(++_0x3968fc);}(_0xc571,0x149));var _0x1c57=function(_0x413727,_0x17adb1){_0x413727=_0x413727-0x0;var _0x5f46d7=_0xc571[_0x413727];return _0x5f46d7;};'use strict';var _=require(_0x1c57('0x0'));var util=require(_0x1c57('0x1'));var zendesk=require(_0x1c57('0x2'));var salesforce=require(_0x1c57('0x3'));var sugarcrm=require(_0x1c57('0x4'));var freshdesk=require('./freshdesk');var zoho=require('./zoho');var desk=require(_0x1c57('0x5'));var vtiger=require(_0x1c57('0x6'));var servicenow=require(_0x1c57('0x7'));var dynamics365=require(_0x1c57('0x8'));var freshsales=require(_0x1c57('0x9'));var integrations=[_0x1c57('0xa'),_0x1c57('0xb'),_0x1c57('0xc'),_0x1c57('0xd'),_0x1c57('0xe'),'desk',_0x1c57('0xf'),_0x1c57('0x10'),_0x1c57('0x11'),_0x1c57('0x12')];exports[_0x1c57('0x13')]=function(_0x76a9a4,_0x13d8f0,_0x7e1bc7,_0x118d78,_0x2422a7,_0x582f21){if(_0x7e1bc7){if(_[_0x1c57('0x14')](integrations,_0x76a9a4['data1'][_0x1c57('0x15')]())){try{var _0x82f1d9=null;var _0x4f8eb8='';var _0x4f771b=_0x7e1bc7[_0x76a9a4[_0x1c57('0x16')][_0x1c57('0x15')]()];if(_0x4f771b){var _0x508050=_0x4f771b[_0x76a9a4[_0x1c57('0x17')]];if(_0x508050){var _0x7b33e=_[_0x1c57('0x18')](_0x508050[_0x1c57('0x19')],{'id':parseInt(_0x76a9a4[_0x1c57('0x1a')],0xa)});if(_0x7b33e){if(_0x118d78){if(_0x2422a7&&_0x13d8f0[_0x1c57('0x1b')]){_0x4f8eb8=_0x1c57('0x1b');}else if(_0x13d8f0['routeId']){_0x4f8eb8=_0x1c57('0x1c');}else{console[_0x1c57('0x1d')]('EVENT\x20UNKNOWN',_0x13d8f0);}}else{_0x4f8eb8=_0x1c57('0x1e');}switch(_0x76a9a4[_0x1c57('0x16')][_0x1c57('0x15')]()){case _0x1c57('0xa'):zendesk[_0x4f8eb8](_0x76a9a4,_0x13d8f0,_0x7b33e,_0x118d78,_0x2422a7,_0x508050,_0x582f21);break;case'salesforce':salesforce[_0x4f8eb8](_0x76a9a4,_0x13d8f0,_0x7b33e,_0x118d78,_0x2422a7,_0x508050,_0x582f21);break;case _0x1c57('0xc'):sugarcrm[_0x4f8eb8](_0x76a9a4,_0x13d8f0,_0x7b33e,_0x118d78,_0x2422a7,_0x508050,_0x582f21);break;case _0x1c57('0xd'):freshdesk[_0x4f8eb8](_0x76a9a4,_0x13d8f0,_0x7b33e,_0x118d78,_0x2422a7,_0x508050,_0x582f21);break;case _0x1c57('0xe'):zoho[_0x4f8eb8](_0x76a9a4,_0x13d8f0,_0x7b33e,_0x118d78,_0x2422a7,_0x508050,_0x582f21);break;case'desk':desk[_0x4f8eb8](_0x76a9a4,_0x13d8f0,_0x7b33e,_0x118d78,_0x2422a7,_0x508050,_0x582f21);break;case _0x1c57('0xf'):vtiger[_0x4f8eb8](_0x76a9a4,_0x13d8f0,_0x7b33e,_0x118d78,_0x2422a7,_0x508050,_0x582f21);break;case _0x1c57('0x11'):freshsales['cs'](_0x76a9a4,_0x13d8f0,_0x7b33e,_0x118d78,_0x2422a7,_0x508050,_0x582f21,_0x4f8eb8);break;case _0x1c57('0x12'):servicenow['cs'](_0x76a9a4,_0x13d8f0,_0x7b33e,_0x118d78,_0x2422a7,_0x508050,_0x582f21,_0x4f8eb8);break;case _0x1c57('0x10'):dynamics365['cs'](_0x76a9a4,_0x13d8f0,_0x7b33e,_0x118d78,_0x2422a7,_0x508050,_0x582f21,_0x4f8eb8);break;default:console[_0x1c57('0x1d')](_0x1c57('0x1f'));}}else{_0x82f1d9=require(_0x1c57('0x20'))(_0x76a9a4[_0x1c57('0x16')]['toLowerCase']());_0x82f1d9[_0x1c57('0x21')](_0x1c57('0x22'),util[_0x1c57('0x23')]('%s\x20configuration\x20#%s\x20not\x20found',_0x76a9a4[_0x1c57('0x16')][_0x1c57('0x15')](),_0x76a9a4[_0x1c57('0x1a')]));}}else{_0x82f1d9=require(_0x1c57('0x20'))(_0x76a9a4[_0x1c57('0x16')]['toLowerCase']());_0x82f1d9[_0x1c57('0x21')](_0x1c57('0x22'),util[_0x1c57('0x23')](_0x1c57('0x24'),_0x76a9a4[_0x1c57('0x16')][_0x1c57('0x15')](),_0x76a9a4[_0x1c57('0x17')]));}}else{}}catch(_0x3d03e5){console[_0x1c57('0x21')](_0x3d03e5);}}}}; \ No newline at end of file +var _0x6a5c=['find','Configurations','data3','queue','routeId','outbound','log','unmanaged','salesforce','dynamics365','../../../../config/logger','error','format','%s\x20configuration\x20#%s\x20not\x20found','[EXEC]','util','./zendesk','./salesforce','./sugarcrm','./zoho','./desk','./dynamics365','zendesk','sugarcrm','freshdesk','zoho','desk','vtiger','freshsales','servicenow','exec','data1','toLowerCase','data2'];(function(_0x2cfc10,_0x401877){var _0x2cf73d=function(_0x50a0b0){while(--_0x50a0b0){_0x2cfc10['push'](_0x2cfc10['shift']());}};_0x2cf73d(++_0x401877);}(_0x6a5c,0x1c9));var _0xc6a5=function(_0x3bb21a,_0x353b56){_0x3bb21a=_0x3bb21a-0x0;var _0x5f3983=_0x6a5c[_0x3bb21a];return _0x5f3983;};'use strict';var _=require('lodash');var util=require(_0xc6a5('0x0'));var zendesk=require(_0xc6a5('0x1'));var salesforce=require(_0xc6a5('0x2'));var sugarcrm=require(_0xc6a5('0x3'));var freshdesk=require('./freshdesk');var zoho=require(_0xc6a5('0x4'));var desk=require(_0xc6a5('0x5'));var vtiger=require('./vtiger');var servicenow=require('./servicenow');var dynamics365=require(_0xc6a5('0x6'));var freshsales=require('./freshsales');var integrations=[_0xc6a5('0x7'),'salesforce',_0xc6a5('0x8'),_0xc6a5('0x9'),_0xc6a5('0xa'),_0xc6a5('0xb'),_0xc6a5('0xc'),'dynamics365',_0xc6a5('0xd'),_0xc6a5('0xe')];exports[_0xc6a5('0xf')]=function(_0x224eb7,_0x44e459,_0x4f9c26,_0x4510e7,_0x436a09,_0x1c4550){if(_0x4f9c26){if(_['includes'](integrations,_0x224eb7[_0xc6a5('0x10')][_0xc6a5('0x11')]())){try{var _0x447fab=null;var _0x3982d1='';var _0x27b833=_0x4f9c26[_0x224eb7[_0xc6a5('0x10')][_0xc6a5('0x11')]()];if(_0x27b833){var _0x1c6da2=_0x27b833[_0x224eb7[_0xc6a5('0x12')]];if(_0x1c6da2){var _0x2da266=_[_0xc6a5('0x13')](_0x1c6da2[_0xc6a5('0x14')],{'id':parseInt(_0x224eb7[_0xc6a5('0x15')],0xa)});if(_0x2da266){if(_0x4510e7){if(_0x436a09&&_0x44e459[_0xc6a5('0x16')]){_0x3982d1='queue';}else if(_0x44e459[_0xc6a5('0x17')]){_0x3982d1=_0xc6a5('0x18');}else{console[_0xc6a5('0x19')]('EVENT\x20UNKNOWN',_0x44e459);}}else{_0x3982d1=_0xc6a5('0x1a');}switch(_0x224eb7[_0xc6a5('0x10')][_0xc6a5('0x11')]()){case _0xc6a5('0x7'):zendesk[_0x3982d1](_0x224eb7,_0x44e459,_0x2da266,_0x4510e7,_0x436a09,_0x1c6da2,_0x1c4550);break;case _0xc6a5('0x1b'):salesforce[_0x3982d1](_0x224eb7,_0x44e459,_0x2da266,_0x4510e7,_0x436a09,_0x1c6da2,_0x1c4550);break;case _0xc6a5('0x8'):sugarcrm[_0x3982d1](_0x224eb7,_0x44e459,_0x2da266,_0x4510e7,_0x436a09,_0x1c6da2,_0x1c4550);break;case'freshdesk':freshdesk[_0x3982d1](_0x224eb7,_0x44e459,_0x2da266,_0x4510e7,_0x436a09,_0x1c6da2,_0x1c4550);break;case _0xc6a5('0xa'):zoho[_0x3982d1](_0x224eb7,_0x44e459,_0x2da266,_0x4510e7,_0x436a09,_0x1c6da2,_0x1c4550);break;case _0xc6a5('0xb'):desk[_0x3982d1](_0x224eb7,_0x44e459,_0x2da266,_0x4510e7,_0x436a09,_0x1c6da2,_0x1c4550);break;case _0xc6a5('0xc'):vtiger[_0x3982d1](_0x224eb7,_0x44e459,_0x2da266,_0x4510e7,_0x436a09,_0x1c6da2,_0x1c4550);break;case _0xc6a5('0xd'):freshsales['cs'](_0x224eb7,_0x44e459,_0x2da266,_0x4510e7,_0x436a09,_0x1c6da2,_0x1c4550,_0x3982d1);break;case'servicenow':servicenow['cs'](_0x224eb7,_0x44e459,_0x2da266,_0x4510e7,_0x436a09,_0x1c6da2,_0x1c4550,_0x3982d1);break;case _0xc6a5('0x1c'):dynamics365['cs'](_0x224eb7,_0x44e459,_0x2da266,_0x4510e7,_0x436a09,_0x1c6da2,_0x1c4550,_0x3982d1);break;default:console[_0xc6a5('0x19')]('unknown\x20integration');}}else{_0x447fab=require(_0xc6a5('0x1d'))(_0x224eb7[_0xc6a5('0x10')][_0xc6a5('0x11')]());_0x447fab[_0xc6a5('0x1e')]('[EXEC]',util[_0xc6a5('0x1f')](_0xc6a5('0x20'),_0x224eb7[_0xc6a5('0x10')][_0xc6a5('0x11')](),_0x224eb7[_0xc6a5('0x15')]));}}else{_0x447fab=require('../../../../config/logger')(_0x224eb7['data1'][_0xc6a5('0x11')]());_0x447fab[_0xc6a5('0x1e')](_0xc6a5('0x21'),util[_0xc6a5('0x1f')]('%s\x20account\x20#%s\x20not\x20found',_0x224eb7['data1'][_0xc6a5('0x11')](),_0x224eb7[_0xc6a5('0x12')]));}}else{}}catch(_0x365cf4){console[_0xc6a5('0x1e')](_0x365cf4);}}}}; \ 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 6373f34..2141490 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 _0xa320=['defaults','socket.io-emitter','emit','getString','Subjects','ticketType','Task','ActivityDate','utc','contact','endUserType','lead','account','WhatId','AccountId','leadId','info','Association\x20between\x20Case\x20and\x20Lead\x20skipped','sobject','isNil','validateEmail','User','length','find','Email','Agent\x20%s\x20found.','resolve','Name','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','identity','then','user_id','display_name','moduleSearch','cloneDeep','additionalSearchContact','merge','$or','execute','additionalSearchLead','Lead','additionalSearchAccount','Account','Contact','first','Phone','type','Enduser\x20(%s)\x20with\x20phone\x20%s\x20found','Enduser\x20with\x20phone\x20%s\x20not\x20found','moduleCreate','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','','Caller\x20-\x20%s','LastName','format','Company','No\x20Company','upperFirst','create','forEach','includes','picklist','idField','content','toString','variable','variableName','Variable','name','toLowerCase','password','concat','securityToken','Connection','https://login.salesforce.com','clientSecret','login','username','Connection\x20established.','queue','serverUrl','stripTrailingSlash','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','recordingURL','email','calleridnum','Fields','[QUEUE]\x20Ticket\x20%s\x20created','user:%s','newTab','trigger:browser:url','%s/%s/e','instanceUrl','error','[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.','outbound','remoteUri','recordingFormat','[OUTBOUND]','destcalleridname','[OUTBOUND]\x20Ticket\x20%s\x20created.','[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','integrationTab','Salesforce\x20account\x20type\x20not\x20recognized','lastevent','toUpperCase','calleridname',']\x20Ticket\x20%s\x20created.','catch','lodash','request-promise','bluebird','md5','jsforce','util','ioredis','./util','../../../../config/environment','redis'];(function(_0x187ad3,_0x5f5ce6){var _0x50e4b9=function(_0xc43aae){while(--_0xc43aae){_0x187ad3['push'](_0x187ad3['shift']());}};_0x50e4b9(++_0x5f5ce6);}(_0xa320,0xec));var _0x0a32=function(_0x1928c9,_0x13a6d1){_0x1928c9=_0x1928c9-0x0;var _0x51b5fb=_0xa320[_0x1928c9];return _0x51b5fb;};'use strict';var _=require(_0x0a32('0x0'));var rp=require(_0x0a32('0x1'));var moment=require('moment');var BPromise=require(_0x0a32('0x2'));var md5=require(_0x0a32('0x3'));var jsforce=require(_0x0a32('0x4'));var util=require(_0x0a32('0x5'));var Redis=require(_0x0a32('0x6'));var intUtil=require(_0x0a32('0x7'));var config=require(_0x0a32('0x8'));var logger=require('../../../../config/logger')('salesforce');config[_0x0a32('0x9')]=_[_0x0a32('0xa')](config[_0x0a32('0x9')],{'host':'localhost','port':0x18eb});var io=require(_0x0a32('0xb'))(new Redis(config['redis']));function emit(_0x54515b,_0x392bad,_0x57a02e){io['to'](_0x54515b)[_0x0a32('0xc')](_0x392bad,_0x57a02e);}function getTicket(_0x368bb6,_0x4000ab,_0x1241f3,_0x51c86a,_0x5f31b1,_0x29fb7e,_0x1b4e92,_0x436432){var _0x319cd7=Object['assign']({},{'OwnerId':_0x4000ab['id'],'Subject':intUtil[_0x0a32('0xd')](_0x51c86a[_0x0a32('0xe')],_0x5f31b1,'\x20'),'Description':intUtil['getString'](_0x51c86a['Descriptions'],_0x5f31b1,'\x0a')},getCustomFields(_0x29fb7e,_0x5f31b1));if(_0x1241f3){if(_0x51c86a[_0x0a32('0xf')]===_0x0a32('0x10')){_0x319cd7[_0x0a32('0x11')]=moment[_0x0a32('0x12')]();_0x319cd7['IsReminderSet']=![];_0x319cd7['IsRecurrence']=![];if(_0x1241f3['endUserType']===_0x0a32('0x13')||_0x1241f3[_0x0a32('0x14')]===_0x0a32('0x15')){_0x319cd7['WhoId']=_0x1241f3['id'];}else if(_0x1241f3[_0x0a32('0x14')]===_0x0a32('0x16')){_0x319cd7[_0x0a32('0x17')]=_0x1241f3['id'];}}else if(_0x51c86a[_0x0a32('0xf')]==='Case'){if(_0x1241f3[_0x0a32('0x14')]===_0x0a32('0x13')){_0x319cd7['ContactId']=_0x1241f3['id'];}else if(_0x1241f3[_0x0a32('0x14')]==='account'){_0x319cd7[_0x0a32('0x18')]=_0x1241f3['id'];}else if(_0x1241f3[_0x0a32('0x14')]===_0x0a32('0x15')&&_0x51c86a[_0x0a32('0x19')]){_0x319cd7[_0x51c86a['leadId']]=_0x1241f3['id'];}else{logger[_0x0a32('0x1a')](_0x0a32('0x1b'));}}}return _0x1b4e92[_0x0a32('0x1c')](_0x51c86a[_0x0a32('0xf')])['create'](_0x319cd7);}function getUser(_0x25ad75,_0x2e6d42,_0x1ea396){if(!_[_0x0a32('0x1d')](_0x2e6d42)&&intUtil[_0x0a32('0x1e')](_0x2e6d42)){var _0x1d626f={'Email':_0x2e6d42};var _0x5ab2d4={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x1ea396[_0x0a32('0x1c')](_0x0a32('0x1f'))['find'](_0x1d626f,_0x5ab2d4)['execute']()['then'](function(_0x257a68){if(_0x257a68[_0x0a32('0x20')]){var _0xce78f9=_[_0x0a32('0x21')](_0x257a68,function(_0x1d67b4){return _0x1d67b4[_0x0a32('0x22')]===_0x2e6d42;});if(_0xce78f9){logger[_0x0a32('0x1a')](_0x0a32('0x23'),_0x2e6d42);return BPromise[_0x0a32('0x24')]({'id':_0xce78f9['Id'],'name':_0xce78f9[_0x0a32('0x25')]});}}else{logger[_0x0a32('0x1a')](_0x0a32('0x26'),_0x2e6d42);return _0x1ea396[_0x0a32('0x27')]()[_0x0a32('0x28')](function(_0x4dab78){return BPromise[_0x0a32('0x24')]({'id':_0x4dab78[_0x0a32('0x29')],'name':_0x4dab78['display_name']});});}});}else{logger[_0x0a32('0x1a')](_0x0a32('0x26'),_0x2e6d42);return _0x1ea396[_0x0a32('0x27')]()[_0x0a32('0x28')](function(_0x59ebc1){return BPromise['resolve']({'id':_0x59ebc1['user_id'],'name':_0x59ebc1[_0x0a32('0x2a')]});});}}function getEndUser(_0x1d814e,_0x50a8c4,_0x10a795,_0xf92930,_0x661390){var _0x516e42={'$or':{'Phone':_0xf92930}};var _0x3e3e0e={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0x0a32('0x24')]()[_0x0a32('0x28')](function(){logger['info']('Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.',_0xf92930,_0x50a8c4['moduleSearch']);switch(_0x50a8c4[_0x0a32('0x2b')]){case'contact_lead':var _0x2f0a73=_[_0x0a32('0x2c')](_0x516e42);if(_0x50a8c4[_0x0a32('0x2d')]){var _0x13dc6b={};_0x13dc6b[_0x50a8c4[_0x0a32('0x2d')]]=_0xf92930;_[_0x0a32('0x2e')](_0x2f0a73[_0x0a32('0x2f')],_0x13dc6b);}return _0x661390[_0x0a32('0x1c')]('Contact')['find'](_0x2f0a73,_0x3e3e0e)[_0x0a32('0x30')]()['then'](function(_0x5a5e69){if(_0x5a5e69&&_0x5a5e69[_0x0a32('0x20')]){return _0x5a5e69;}else{var _0x150c5c=_[_0x0a32('0x2c')](_0x516e42);if(_0x50a8c4[_0x0a32('0x31')]){var _0x40160f={};_0x40160f[_0x50a8c4[_0x0a32('0x31')]]=_0xf92930;_[_0x0a32('0x2e')](_0x150c5c['$or'],_0x40160f);}return _0x661390[_0x0a32('0x1c')](_0x0a32('0x32'))[_0x0a32('0x21')](_0x150c5c,_0x3e3e0e);}});case'account_contact_lead':var _0x1c3e3c=_[_0x0a32('0x2c')](_0x516e42);if(_0x50a8c4[_0x0a32('0x33')]){var _0x13dc6b={};_0x13dc6b[_0x50a8c4[_0x0a32('0x33')]]=_0xf92930;_[_0x0a32('0x2e')](_0x1c3e3c[_0x0a32('0x2f')],_0x13dc6b);}return _0x661390[_0x0a32('0x1c')](_0x0a32('0x34'))[_0x0a32('0x21')](_0x1c3e3c,_0x3e3e0e)[_0x0a32('0x30')]()[_0x0a32('0x28')](function(_0x23dfa0){if(_0x23dfa0&&_0x23dfa0['length']){return _0x23dfa0;}else{var _0x1d5913=_[_0x0a32('0x2c')](_0x516e42);if(_0x50a8c4[_0x0a32('0x2d')]){var _0x44d0b9={};_0x44d0b9[_0x50a8c4[_0x0a32('0x2d')]]=_0xf92930;_[_0x0a32('0x2e')](_0x1d5913[_0x0a32('0x2f')],_0x44d0b9);}return _0x661390[_0x0a32('0x1c')](_0x0a32('0x35'))[_0x0a32('0x21')](_0x1d5913,_0x3e3e0e)[_0x0a32('0x28')](function(_0x100580){if(_0x100580&&_0x100580[_0x0a32('0x20')]){return _0x100580;}else{var _0x5e4af6=_[_0x0a32('0x2c')](_0x516e42);if(_0x50a8c4[_0x0a32('0x31')]){var _0x19e435={};_0x19e435[_0x50a8c4['additionalSearchLead']]=_0xf92930;_[_0x0a32('0x2e')](_0x5e4af6['$or'],_0x19e435);}return _0x661390[_0x0a32('0x1c')](_0x0a32('0x32'))[_0x0a32('0x21')](_0x5e4af6,_0x3e3e0e);}});}});case _0x0a32('0x13'):var _0x2f0a73=_[_0x0a32('0x2c')](_0x516e42);if(_0x50a8c4['additionalSearchContact']){var _0x13dc6b={};_0x13dc6b[_0x50a8c4[_0x0a32('0x2d')]]=_0xf92930;_[_0x0a32('0x2e')](_0x2f0a73[_0x0a32('0x2f')],_0x13dc6b);}return _0x661390['sobject'](_0x0a32('0x35'))[_0x0a32('0x21')](_0x2f0a73,_0x3e3e0e)[_0x0a32('0x30')]();case'lead':var _0x285fc6=_['cloneDeep'](_0x516e42);if(_0x50a8c4['additionalSearchLead']){var _0x13dc6b={};_0x13dc6b[_0x50a8c4[_0x0a32('0x31')]]=_0xf92930;_[_0x0a32('0x2e')](_0x285fc6[_0x0a32('0x2f')],_0x13dc6b);}return _0x661390[_0x0a32('0x1c')](_0x0a32('0x32'))[_0x0a32('0x21')](_0x285fc6,_0x3e3e0e);case _0x0a32('0x16'):var _0x1c3e3c=_[_0x0a32('0x2c')](_0x516e42);if(_0x50a8c4[_0x0a32('0x33')]){var _0x13dc6b={};_0x13dc6b[_0x50a8c4[_0x0a32('0x33')]]=_0xf92930;_[_0x0a32('0x2e')](_0x1c3e3c['$or'],_0x13dc6b);}return _0x661390[_0x0a32('0x1c')]('Account')['find'](_0x1c3e3c,_0x3e3e0e);default:return null;}})[_0x0a32('0x28')](function(_0x531e43){if(_0x531e43&&_0x531e43[_0x0a32('0x20')]){var _0x315780=_[_0x0a32('0x36')](_0x531e43);if(_0x315780){return BPromise['resolve']({'id':_0x315780['Id'],'name':_0x315780['Name'],'phone':_0x315780[_0x0a32('0x37')],'endUserType':_0x315780['attributes'][_0x0a32('0x38')]['toLowerCase']()});}}})[_0x0a32('0x28')](function(_0x4f68e9){if(_0x4f68e9){logger[_0x0a32('0x1a')](_0x0a32('0x39'),_0x4f68e9[_0x0a32('0x14')],_0xf92930);return BPromise[_0x0a32('0x24')](_0x4f68e9);}else{logger[_0x0a32('0x1a')](_0x0a32('0x3a'),_0xf92930);var _0x7884b3={'Phone':_0xf92930};if(_0x50a8c4[_0x0a32('0x3b')]){if(_0x50a8c4[_0x0a32('0x3b')]===_0x0a32('0x13')){logger['info'](_0x0a32('0x3c'),_0xf92930,_0x50a8c4['moduleCreate']);_0x7884b3['LastName']=_0x10a795!==_0x0a32('0x3d')?_0x10a795:util['format'](_0x0a32('0x3e'),_0xf92930);}else if(_0x50a8c4['moduleCreate']===_0x0a32('0x15')){logger[_0x0a32('0x1a')]('Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.',_0xf92930,_0x50a8c4[_0x0a32('0x3b')]);_0x7884b3[_0x0a32('0x3f')]=_0x10a795!==_0x0a32('0x3d')?_0x10a795:util[_0x0a32('0x40')](_0x0a32('0x3e'),_0xf92930);_0x7884b3[_0x0a32('0x41')]=_0x0a32('0x42');}else if(_0x50a8c4[_0x0a32('0x3b')]===_0x0a32('0x16')){logger[_0x0a32('0x1a')]('Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.',_0xf92930,_0x50a8c4[_0x0a32('0x3b')]);_0x7884b3[_0x0a32('0x25')]=_0x10a795!==''?_0x10a795:util[_0x0a32('0x40')](_0x0a32('0x3e'),_0xf92930);}else{return null;}}return _0x661390[_0x0a32('0x1c')](_[_0x0a32('0x43')](_0x50a8c4[_0x0a32('0x3b')]))[_0x0a32('0x44')](_0x7884b3)[_0x0a32('0x28')](function(_0x13963a){return BPromise['resolve']({'id':_0x13963a['id'],'endUserType':_0x50a8c4[_0x0a32('0x3b')]});});}});}function getCustomFields(_0x4957d5,_0x1d3925){var _0xb5ec64={};if(_0x4957d5[_0x0a32('0x20')]>0x0){_[_0x0a32('0x45')](_0x4957d5,function(_0x3b804c){if(_[_0x0a32('0x46')](['string',_0x0a32('0x47')],_0x3b804c[_0x0a32('0x38')])&&_0x3b804c[_0x0a32('0x48')]){_0xb5ec64[_0x3b804c[_0x0a32('0x48')]]=_0x3b804c[_0x0a32('0x49')][_0x0a32('0x4a')]();}else if(_0x3b804c[_0x0a32('0x38')]===_0x0a32('0x4b')&&_0x3b804c[_0x0a32('0x4c')]&&_0x3b804c[_0x0a32('0x48')]){_0x1d3925[_0x3b804c[_0x0a32('0x4c')]]&&(_0xb5ec64[_0x3b804c[_0x0a32('0x48')]]=_0x1d3925[_0x3b804c[_0x0a32('0x4c')]][_0x0a32('0x4a')]());}else if(_0x3b804c[_0x0a32('0x38')]==='customVariable'&&_0x3b804c[_0x0a32('0x4d')]&&_0x3b804c['Variable'][_0x0a32('0x4e')]&&_0x3b804c[_0x0a32('0x48')]){_0x1d3925[_0x3b804c[_0x0a32('0x4d')][_0x0a32('0x4e')][_0x0a32('0x4f')]()]&&(_0xb5ec64[_0x3b804c['idField']]=_0x1d3925[_0x3b804c[_0x0a32('0x4d')][_0x0a32('0x4e')]['toLowerCase']()][_0x0a32('0x4a')]());}});}return _0xb5ec64;}function getConnection(_0x238b08){var _0x4c1761=_0x238b08[_0x0a32('0x50')][_0x0a32('0x51')](_0x238b08[_0x0a32('0x52')]);var _0x19a48c=new jsforce[(_0x0a32('0x53'))]({'oauth2':{'loginUrl':_0x238b08['remoteUri']||_0x0a32('0x54'),'clientId':_0x238b08['clientId'],'clientSecret':_0x238b08[_0x0a32('0x55')]}});return _0x19a48c[_0x0a32('0x56')](_0x238b08[_0x0a32('0x57')],_0x4c1761)[_0x0a32('0x28')](function(){logger[_0x0a32('0x1a')](_0x0a32('0x58'));return _0x19a48c;});}exports[_0x0a32('0x59')]=function(_0x20d4a6,_0x50de29,_0x5f5df9,_0x22824b,_0x3f7a9e,_0x5d8ae9){var _0x1fe3a1,_0x54cb81,_0x1cbcbc,_0x51342c;_0x5d8ae9[_0x0a32('0x5a')]=intUtil['stripTrailingSlash'](_0x5d8ae9[_0x0a32('0x5a')]);_0x5d8ae9['remoteUri']=intUtil[_0x0a32('0x5b')](_0x5d8ae9['remoteUri']);if(_0x3f7a9e&&_0x3f7a9e[_0x0a32('0x5c')]){logger[_0x0a32('0x1a')](_0x0a32('0x5d'),_0x0a32('0x5e'));_0x50de29['recordingURL']=util[_0x0a32('0x40')](_0x0a32('0x5f'),_0x5d8ae9[_0x0a32('0x5a')],_0x50de29[_0x0a32('0x60')],md5(_0x50de29['uniqueid']));}else{_0x50de29[_0x0a32('0x61')]='';}return getConnection(_0x5d8ae9)[_0x0a32('0x28')](function(_0x3bd3c3){_0x51342c=_0x3bd3c3;return getUser(_0x5d8ae9,_0x22824b[_0x0a32('0x62')],_0x51342c);})[_0x0a32('0x28')](function(_0x1d1ab0){_0x1fe3a1=_0x1d1ab0;return getEndUser(_0x5d8ae9,_0x5f5df9,_0x50de29['calleridname'],_0x50de29[_0x0a32('0x63')],_0x51342c);})['then'](function(_0x3e9d1c){_0x54cb81=_0x3e9d1c;return getTicket(_0x5d8ae9,_0x1fe3a1,_0x54cb81,_0x5f5df9,_0x50de29,_0x5f5df9[_0x0a32('0x64')],_0x51342c,_0x0a32('0x59'));})[_0x0a32('0x28')](function(_0x584bfc){_0x1cbcbc=_0x584bfc;logger[_0x0a32('0x1a')](_0x0a32('0x65'),_0x1cbcbc['id']);logger[_0x0a32('0x1a')]('[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.',_0x1cbcbc['id'],_0x22824b[_0x0a32('0x4e')],_0x5d8ae9[_0x0a32('0x38')]);switch(_0x5d8ae9[_0x0a32('0x38')]){case'integrationTab':emit(util[_0x0a32('0x40')](_0x0a32('0x66'),_0x22824b['name']),'trigger:salesforce:display',{'recordId':_0x1cbcbc['id']});break;case _0x0a32('0x67'):emit(util[_0x0a32('0x40')]('user:%s',_0x22824b[_0x0a32('0x4e')]),_0x0a32('0x68'),{'uri':util['format'](_0x0a32('0x69'),_0x51342c[_0x0a32('0x6a')],_0x1cbcbc['id'])});break;default:logger[_0x0a32('0x6b')](_0x0a32('0x6c'));}})['catch'](function(_0x3d9696){logger[_0x0a32('0x6b')](_0x0a32('0x5d'),_0x3d9696);});};exports[_0x0a32('0x6d')]=function(_0x1deab3,_0x384cf0,_0x21b324,_0x1b8e2f,_0x5c56a0,_0x24c8b8,_0x371740){var _0x6b805c,_0x3ae23f,_0x56392a,_0x25c15c;_0x24c8b8[_0x0a32('0x5a')]=intUtil[_0x0a32('0x5b')](_0x24c8b8[_0x0a32('0x5a')]);_0x24c8b8[_0x0a32('0x6e')]=intUtil[_0x0a32('0x5b')](_0x24c8b8['remoteUri']);if(_0x371740&&_0x371740[_0x0a32('0x6f')]&&_0x371740[_0x0a32('0x6f')]!=='none'){logger[_0x0a32('0x1a')](_0x0a32('0x70'),'Recording\x20is\x20enabled!');_0x384cf0[_0x0a32('0x61')]=util[_0x0a32('0x40')](_0x0a32('0x5f'),_0x24c8b8[_0x0a32('0x5a')],_0x384cf0[_0x0a32('0x60')],md5(_0x384cf0[_0x0a32('0x60')]));}return getConnection(_0x24c8b8)[_0x0a32('0x28')](function(_0x38d9b2){_0x25c15c=_0x38d9b2;return getUser(_0x24c8b8,_0x1b8e2f[_0x0a32('0x62')],_0x25c15c);})[_0x0a32('0x28')](function(_0x229d5b){_0x6b805c=_0x229d5b;return getEndUser(_0x24c8b8,_0x21b324,_0x384cf0[_0x0a32('0x71')],_0x384cf0['destcalleridnum'],_0x25c15c);})['then'](function(_0x37398d){_0x3ae23f=_0x37398d;return getTicket(_0x24c8b8,_0x6b805c,_0x3ae23f,_0x21b324,_0x384cf0,_0x21b324[_0x0a32('0x64')],_0x25c15c,_0x0a32('0x6d'));})[_0x0a32('0x28')](function(_0x1b035c){_0x56392a=_0x1b035c;logger['info'](_0x0a32('0x72'),_0x56392a['id']);logger[_0x0a32('0x1a')](_0x0a32('0x73'),_0x56392a['id'],_0x1b8e2f['name'],_0x24c8b8[_0x0a32('0x38')]);switch(_0x24c8b8[_0x0a32('0x38')]){case _0x0a32('0x74'):emit(util[_0x0a32('0x40')](_0x0a32('0x66'),_0x1b8e2f[_0x0a32('0x4e')]),'trigger:salesforce:display',{'recordId':_0x56392a['id']});break;case _0x0a32('0x67'):emit(util['format'](_0x0a32('0x66'),_0x1b8e2f[_0x0a32('0x4e')]),_0x0a32('0x68'),{'uri':util[_0x0a32('0x40')](_0x0a32('0x69'),_0x25c15c['instanceUrl'],_0x56392a['id'])});break;default:logger[_0x0a32('0x6b')](_0x0a32('0x70'),_0x0a32('0x75'));}})['catch'](function(_0x104326){logger[_0x0a32('0x6b')](_0x0a32('0x70'),_0x104326);});};exports['unmanaged']=function(_0x3ca48,_0x4f81f0,_0x5a70fc,_0x5bddbc,_0x8b5387,_0x180b8f){var _0x2b7b70,_0x539da9,_0xe75422,_0x5429ec;_0x180b8f[_0x0a32('0x5a')]=intUtil['stripTrailingSlash'](_0x180b8f['serverUrl']);_0x180b8f[_0x0a32('0x6e')]=intUtil[_0x0a32('0x5b')](_0x180b8f[_0x0a32('0x6e')]);if(_0x8b5387&&_0x8b5387[_0x0a32('0x5c')]){logger[_0x0a32('0x1a')]('['+_0x4f81f0[_0x0a32('0x76')][_0x0a32('0x77')]()+']',_0x0a32('0x5e'));_0x4f81f0[_0x0a32('0x61')]=util[_0x0a32('0x40')](_0x0a32('0x5f'),_0x180b8f[_0x0a32('0x5a')],_0x4f81f0[_0x0a32('0x60')],md5(_0x4f81f0['uniqueid']));}else{_0x4f81f0['recordingURL']='';}return getConnection(_0x180b8f)[_0x0a32('0x28')](function(_0xf64717){_0x5429ec=_0xf64717;if(!_[_0x0a32('0x1d')](_0x5bddbc)){return getUser(_0x180b8f,_0x5bddbc[_0x0a32('0x4e')],_0x5429ec);}else{return getUser(_0x180b8f,null,_0x5429ec);}})[_0x0a32('0x28')](function(_0x2b2e86){_0x2b7b70=_0x2b2e86;return getEndUser(_0x180b8f,_0x5a70fc,_0x4f81f0[_0x0a32('0x78')],_0x4f81f0['calleridnum'],_0x5429ec);})[_0x0a32('0x28')](function(_0x4cdcf7){_0x539da9=_0x4cdcf7;return getTicket(_0x180b8f,_0x2b7b70,_0x539da9,_0x5a70fc,_0x4f81f0,_0x5a70fc['Fields'],_0x5429ec);})[_0x0a32('0x28')](function(_0x507da7){_0xe75422=_0x507da7;logger[_0x0a32('0x1a')]('['+_0x4f81f0[_0x0a32('0x76')]['toUpperCase']()+_0x0a32('0x79'),_0xe75422['id']);logger['info']('['+_0x4f81f0[_0x0a32('0x76')][_0x0a32('0x77')]()+']\x20Integration\x20account\x20type\x20%s.',_0x180b8f[_0x0a32('0x38')]);})[_0x0a32('0x7a')](function(_0x5d5ef0){logger[_0x0a32('0x6b')]('['+_0x4f81f0[_0x0a32('0x76')]['toUpperCase']()+']',_0x5d5ef0);});}; \ No newline at end of file +var _0xd9f1=['additionalSearchContact','$or','Contact','additionalSearchLead','merge','account_contact_lead','additionalSearchAccount','Account','Lead','first','Phone','attributes','toLowerCase','Enduser\x20(%s)\x20with\x20phone\x20%s\x20found','Enduser\x20with\x20phone\x20%s\x20not\x20found','moduleCreate','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','LastName','','format','Caller\x20-\x20%s','No\x20Company','forEach','string','picklist','type','idField','content','toString','variable','variableName','customVariable','Variable','name','password','concat','securityToken','Connection','remoteUri','https://login.salesforce.com','clientId','Connection\x20established.','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','email','calleridname','calleridnum','Fields','[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','integrationTab','trigger:salesforce:display','newTab','trigger:browser:url','instanceUrl','error','[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.','catch','outbound','recordingFormat','[OUTBOUND]','destcalleridname','destcalleridnum','[OUTBOUND]\x20Ticket\x20%s\x20created.','[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','user:%s','Salesforce\x20account\x20type\x20not\x20recognized','unmanaged','lastevent','toUpperCase',']\x20Integration\x20account\x20type\x20%s.','request-promise','moment','bluebird','jsforce','util','./util','../../../../config/environment','../../../../config/logger','redis','defaults','localhost','getString','ticketType','Task','ActivityDate','utc','endUserType','contact','lead','WhoId','account','WhatId','ContactId','AccountId','leadId','info','Association\x20between\x20Case\x20and\x20Lead\x20skipped','sobject','create','isNil','validateEmail','User','find','execute','then','length','Email','Agent\x20%s\x20found.','resolve','Name','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','user_id','display_name','identity','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','moduleSearch','cloneDeep'];(function(_0x565c49,_0x54acd0){var _0x20ca34=function(_0x42f7e1){while(--_0x42f7e1){_0x565c49['push'](_0x565c49['shift']());}};_0x20ca34(++_0x54acd0);}(_0xd9f1,0x145));var _0x1d9f=function(_0x205e7b,_0x30d30d){_0x205e7b=_0x205e7b-0x0;var _0x16e2f5=_0xd9f1[_0x205e7b];return _0x16e2f5;};'use strict';var _=require('lodash');var rp=require(_0x1d9f('0x0'));var moment=require(_0x1d9f('0x1'));var BPromise=require(_0x1d9f('0x2'));var md5=require('md5');var jsforce=require(_0x1d9f('0x3'));var util=require(_0x1d9f('0x4'));var Redis=require('ioredis');var intUtil=require(_0x1d9f('0x5'));var config=require(_0x1d9f('0x6'));var logger=require(_0x1d9f('0x7'))('salesforce');config[_0x1d9f('0x8')]=_[_0x1d9f('0x9')](config[_0x1d9f('0x8')],{'host':_0x1d9f('0xa'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x1d9f('0x8')]));function emit(_0x14f432,_0x21eb82,_0x13d648){io['to'](_0x14f432)['emit'](_0x21eb82,_0x13d648);}function getTicket(_0x44adea,_0x312423,_0x1d1e3b,_0x22b792,_0xc63d15,_0x1e8e68,_0x23b7da,_0xdb23e8){var _0x48b3d5=Object['assign']({},{'OwnerId':_0x312423['id'],'Subject':intUtil[_0x1d9f('0xb')](_0x22b792['Subjects'],_0xc63d15,'\x20'),'Description':intUtil[_0x1d9f('0xb')](_0x22b792['Descriptions'],_0xc63d15,'\x0a')},getCustomFields(_0x1e8e68,_0xc63d15));if(_0x1d1e3b){if(_0x22b792[_0x1d9f('0xc')]===_0x1d9f('0xd')){_0x48b3d5[_0x1d9f('0xe')]=moment[_0x1d9f('0xf')]();_0x48b3d5['IsReminderSet']=![];_0x48b3d5['IsRecurrence']=![];if(_0x1d1e3b[_0x1d9f('0x10')]===_0x1d9f('0x11')||_0x1d1e3b['endUserType']===_0x1d9f('0x12')){_0x48b3d5[_0x1d9f('0x13')]=_0x1d1e3b['id'];}else if(_0x1d1e3b[_0x1d9f('0x10')]===_0x1d9f('0x14')){_0x48b3d5[_0x1d9f('0x15')]=_0x1d1e3b['id'];}}else if(_0x22b792['ticketType']==='Case'){if(_0x1d1e3b['endUserType']===_0x1d9f('0x11')){_0x48b3d5[_0x1d9f('0x16')]=_0x1d1e3b['id'];}else if(_0x1d1e3b[_0x1d9f('0x10')]===_0x1d9f('0x14')){_0x48b3d5[_0x1d9f('0x17')]=_0x1d1e3b['id'];}else if(_0x1d1e3b[_0x1d9f('0x10')]===_0x1d9f('0x12')&&_0x22b792['leadId']){_0x48b3d5[_0x22b792[_0x1d9f('0x18')]]=_0x1d1e3b['id'];}else{logger[_0x1d9f('0x19')](_0x1d9f('0x1a'));}}}return _0x23b7da[_0x1d9f('0x1b')](_0x22b792[_0x1d9f('0xc')])[_0x1d9f('0x1c')](_0x48b3d5);}function getUser(_0x46dede,_0x451ebc,_0x8b6a48){if(!_[_0x1d9f('0x1d')](_0x451ebc)&&intUtil[_0x1d9f('0x1e')](_0x451ebc)){var _0x29b923={'Email':_0x451ebc};var _0x815b90={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x8b6a48[_0x1d9f('0x1b')](_0x1d9f('0x1f'))[_0x1d9f('0x20')](_0x29b923,_0x815b90)[_0x1d9f('0x21')]()[_0x1d9f('0x22')](function(_0x516cd2){if(_0x516cd2[_0x1d9f('0x23')]){var _0x990aa1=_[_0x1d9f('0x20')](_0x516cd2,function(_0x421643){return _0x421643[_0x1d9f('0x24')]===_0x451ebc;});if(_0x990aa1){logger['info'](_0x1d9f('0x25'),_0x451ebc);return BPromise[_0x1d9f('0x26')]({'id':_0x990aa1['Id'],'name':_0x990aa1[_0x1d9f('0x27')]});}}else{logger[_0x1d9f('0x19')](_0x1d9f('0x28'),_0x451ebc);return _0x8b6a48['identity']()[_0x1d9f('0x22')](function(_0x30a5ac){return BPromise[_0x1d9f('0x26')]({'id':_0x30a5ac[_0x1d9f('0x29')],'name':_0x30a5ac[_0x1d9f('0x2a')]});});}});}else{logger[_0x1d9f('0x19')](_0x1d9f('0x28'),_0x451ebc);return _0x8b6a48[_0x1d9f('0x2b')]()[_0x1d9f('0x22')](function(_0x4b9433){return BPromise[_0x1d9f('0x26')]({'id':_0x4b9433[_0x1d9f('0x29')],'name':_0x4b9433['display_name']});});}}function getEndUser(_0x2a70f9,_0x2e36b3,_0x1db2d6,_0x12127b,_0x9e5e89){var _0x2980a7={'$or':{'Phone':_0x12127b}};var _0x300d17={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0x1d9f('0x26')]()[_0x1d9f('0x22')](function(){logger[_0x1d9f('0x19')](_0x1d9f('0x2c'),_0x12127b,_0x2e36b3[_0x1d9f('0x2d')]);switch(_0x2e36b3[_0x1d9f('0x2d')]){case'contact_lead':var _0x253785=_[_0x1d9f('0x2e')](_0x2980a7);if(_0x2e36b3[_0x1d9f('0x2f')]){var _0x548c58={};_0x548c58[_0x2e36b3[_0x1d9f('0x2f')]]=_0x12127b;_['merge'](_0x253785[_0x1d9f('0x30')],_0x548c58);}return _0x9e5e89[_0x1d9f('0x1b')](_0x1d9f('0x31'))[_0x1d9f('0x20')](_0x253785,_0x300d17)[_0x1d9f('0x21')]()['then'](function(_0x5576bb){if(_0x5576bb&&_0x5576bb[_0x1d9f('0x23')]){return _0x5576bb;}else{var _0x853f64=_[_0x1d9f('0x2e')](_0x2980a7);if(_0x2e36b3[_0x1d9f('0x32')]){var _0x42b082={};_0x42b082[_0x2e36b3[_0x1d9f('0x32')]]=_0x12127b;_[_0x1d9f('0x33')](_0x853f64['$or'],_0x42b082);}return _0x9e5e89[_0x1d9f('0x1b')]('Lead')[_0x1d9f('0x20')](_0x853f64,_0x300d17);}});case _0x1d9f('0x34'):var _0x217c6a=_[_0x1d9f('0x2e')](_0x2980a7);if(_0x2e36b3[_0x1d9f('0x35')]){var _0x548c58={};_0x548c58[_0x2e36b3[_0x1d9f('0x35')]]=_0x12127b;_['merge'](_0x217c6a[_0x1d9f('0x30')],_0x548c58);}return _0x9e5e89[_0x1d9f('0x1b')](_0x1d9f('0x36'))['find'](_0x217c6a,_0x300d17)[_0x1d9f('0x21')]()['then'](function(_0x51d42a){if(_0x51d42a&&_0x51d42a[_0x1d9f('0x23')]){return _0x51d42a;}else{var _0x5cc7e0=_[_0x1d9f('0x2e')](_0x2980a7);if(_0x2e36b3[_0x1d9f('0x2f')]){var _0x2d09cf={};_0x2d09cf[_0x2e36b3['additionalSearchContact']]=_0x12127b;_[_0x1d9f('0x33')](_0x5cc7e0['$or'],_0x2d09cf);}return _0x9e5e89[_0x1d9f('0x1b')](_0x1d9f('0x31'))['find'](_0x5cc7e0,_0x300d17)[_0x1d9f('0x22')](function(_0x9092b5){if(_0x9092b5&&_0x9092b5[_0x1d9f('0x23')]){return _0x9092b5;}else{var _0x28a8b1=_[_0x1d9f('0x2e')](_0x2980a7);if(_0x2e36b3[_0x1d9f('0x32')]){var _0x45f642={};_0x45f642[_0x2e36b3[_0x1d9f('0x32')]]=_0x12127b;_[_0x1d9f('0x33')](_0x28a8b1[_0x1d9f('0x30')],_0x45f642);}return _0x9e5e89['sobject'](_0x1d9f('0x37'))[_0x1d9f('0x20')](_0x28a8b1,_0x300d17);}});}});case _0x1d9f('0x11'):var _0x253785=_['cloneDeep'](_0x2980a7);if(_0x2e36b3[_0x1d9f('0x2f')]){var _0x548c58={};_0x548c58[_0x2e36b3[_0x1d9f('0x2f')]]=_0x12127b;_[_0x1d9f('0x33')](_0x253785['$or'],_0x548c58);}return _0x9e5e89['sobject'](_0x1d9f('0x31'))[_0x1d9f('0x20')](_0x253785,_0x300d17)[_0x1d9f('0x21')]();case _0x1d9f('0x12'):var _0x49844d=_[_0x1d9f('0x2e')](_0x2980a7);if(_0x2e36b3[_0x1d9f('0x32')]){var _0x548c58={};_0x548c58[_0x2e36b3[_0x1d9f('0x32')]]=_0x12127b;_[_0x1d9f('0x33')](_0x49844d[_0x1d9f('0x30')],_0x548c58);}return _0x9e5e89[_0x1d9f('0x1b')](_0x1d9f('0x37'))[_0x1d9f('0x20')](_0x49844d,_0x300d17);case _0x1d9f('0x14'):var _0x217c6a=_[_0x1d9f('0x2e')](_0x2980a7);if(_0x2e36b3['additionalSearchAccount']){var _0x548c58={};_0x548c58[_0x2e36b3['additionalSearchAccount']]=_0x12127b;_[_0x1d9f('0x33')](_0x217c6a[_0x1d9f('0x30')],_0x548c58);}return _0x9e5e89[_0x1d9f('0x1b')](_0x1d9f('0x36'))[_0x1d9f('0x20')](_0x217c6a,_0x300d17);default:return null;}})[_0x1d9f('0x22')](function(_0x4d6d14){if(_0x4d6d14&&_0x4d6d14[_0x1d9f('0x23')]){var _0x2f3925=_[_0x1d9f('0x38')](_0x4d6d14);if(_0x2f3925){return BPromise[_0x1d9f('0x26')]({'id':_0x2f3925['Id'],'name':_0x2f3925[_0x1d9f('0x27')],'phone':_0x2f3925[_0x1d9f('0x39')],'endUserType':_0x2f3925[_0x1d9f('0x3a')]['type'][_0x1d9f('0x3b')]()});}}})[_0x1d9f('0x22')](function(_0x2ef69f){if(_0x2ef69f){logger['info'](_0x1d9f('0x3c'),_0x2ef69f[_0x1d9f('0x10')],_0x12127b);return BPromise['resolve'](_0x2ef69f);}else{logger['info'](_0x1d9f('0x3d'),_0x12127b);var _0x5a1393={'Phone':_0x12127b};if(_0x2e36b3[_0x1d9f('0x3e')]){if(_0x2e36b3[_0x1d9f('0x3e')]===_0x1d9f('0x11')){logger[_0x1d9f('0x19')](_0x1d9f('0x3f'),_0x12127b,_0x2e36b3[_0x1d9f('0x3e')]);_0x5a1393[_0x1d9f('0x40')]=_0x1db2d6!==_0x1d9f('0x41')?_0x1db2d6:util[_0x1d9f('0x42')](_0x1d9f('0x43'),_0x12127b);}else if(_0x2e36b3[_0x1d9f('0x3e')]===_0x1d9f('0x12')){logger[_0x1d9f('0x19')](_0x1d9f('0x3f'),_0x12127b,_0x2e36b3[_0x1d9f('0x3e')]);_0x5a1393[_0x1d9f('0x40')]=_0x1db2d6!==''?_0x1db2d6:util['format'](_0x1d9f('0x43'),_0x12127b);_0x5a1393['Company']=_0x1d9f('0x44');}else if(_0x2e36b3[_0x1d9f('0x3e')]===_0x1d9f('0x14')){logger[_0x1d9f('0x19')]('Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.',_0x12127b,_0x2e36b3['moduleCreate']);_0x5a1393[_0x1d9f('0x27')]=_0x1db2d6!==''?_0x1db2d6:util[_0x1d9f('0x42')](_0x1d9f('0x43'),_0x12127b);}else{return null;}}return _0x9e5e89['sobject'](_['upperFirst'](_0x2e36b3[_0x1d9f('0x3e')]))[_0x1d9f('0x1c')](_0x5a1393)['then'](function(_0x562d5d){return BPromise['resolve']({'id':_0x562d5d['id'],'endUserType':_0x2e36b3[_0x1d9f('0x3e')]});});}});}function getCustomFields(_0x5d147d,_0x333c89){var _0x2231d9={};if(_0x5d147d[_0x1d9f('0x23')]>0x0){_[_0x1d9f('0x45')](_0x5d147d,function(_0x2d5f32){if(_['includes']([_0x1d9f('0x46'),_0x1d9f('0x47')],_0x2d5f32[_0x1d9f('0x48')])&&_0x2d5f32[_0x1d9f('0x49')]){_0x2231d9[_0x2d5f32[_0x1d9f('0x49')]]=_0x2d5f32[_0x1d9f('0x4a')][_0x1d9f('0x4b')]();}else if(_0x2d5f32[_0x1d9f('0x48')]===_0x1d9f('0x4c')&&_0x2d5f32[_0x1d9f('0x4d')]&&_0x2d5f32[_0x1d9f('0x49')]){_0x333c89[_0x2d5f32['variableName']]&&(_0x2231d9[_0x2d5f32[_0x1d9f('0x49')]]=_0x333c89[_0x2d5f32[_0x1d9f('0x4d')]][_0x1d9f('0x4b')]());}else if(_0x2d5f32[_0x1d9f('0x48')]===_0x1d9f('0x4e')&&_0x2d5f32[_0x1d9f('0x4f')]&&_0x2d5f32[_0x1d9f('0x4f')][_0x1d9f('0x50')]&&_0x2d5f32[_0x1d9f('0x49')]){_0x333c89[_0x2d5f32['Variable'][_0x1d9f('0x50')][_0x1d9f('0x3b')]()]&&(_0x2231d9[_0x2d5f32['idField']]=_0x333c89[_0x2d5f32['Variable'][_0x1d9f('0x50')][_0x1d9f('0x3b')]()][_0x1d9f('0x4b')]());}});}return _0x2231d9;}function getConnection(_0x104209){var _0x34aa21=_0x104209[_0x1d9f('0x51')][_0x1d9f('0x52')](_0x104209[_0x1d9f('0x53')]);var _0x5e0925=new jsforce[(_0x1d9f('0x54'))]({'oauth2':{'loginUrl':_0x104209[_0x1d9f('0x55')]||_0x1d9f('0x56'),'clientId':_0x104209[_0x1d9f('0x57')],'clientSecret':_0x104209['clientSecret']}});return _0x5e0925['login'](_0x104209['username'],_0x34aa21)['then'](function(){logger['info'](_0x1d9f('0x58'));return _0x5e0925;});}exports[_0x1d9f('0x59')]=function(_0x3d0e5b,_0x1f0fee,_0x5dd35a,_0x393ee4,_0x56dcd9,_0x148f04){var _0x1f9721,_0x2b3028,_0x22e286,_0x46407d;_0x148f04['serverUrl']=intUtil[_0x1d9f('0x5a')](_0x148f04[_0x1d9f('0x5b')]);_0x148f04['remoteUri']=intUtil[_0x1d9f('0x5a')](_0x148f04[_0x1d9f('0x55')]);if(_0x56dcd9&&_0x56dcd9[_0x1d9f('0x5c')]){logger[_0x1d9f('0x19')](_0x1d9f('0x5d'),_0x1d9f('0x5e'));_0x1f0fee[_0x1d9f('0x5f')]=util['format'](_0x1d9f('0x60'),_0x148f04[_0x1d9f('0x5b')],_0x1f0fee[_0x1d9f('0x61')],md5(_0x1f0fee[_0x1d9f('0x61')]));}else{_0x1f0fee[_0x1d9f('0x5f')]='';}return getConnection(_0x148f04)[_0x1d9f('0x22')](function(_0x2dc9e6){_0x46407d=_0x2dc9e6;return getUser(_0x148f04,_0x393ee4[_0x1d9f('0x62')],_0x46407d);})[_0x1d9f('0x22')](function(_0x8f44f7){_0x1f9721=_0x8f44f7;return getEndUser(_0x148f04,_0x5dd35a,_0x1f0fee[_0x1d9f('0x63')],_0x1f0fee[_0x1d9f('0x64')],_0x46407d);})['then'](function(_0x409985){_0x2b3028=_0x409985;return getTicket(_0x148f04,_0x1f9721,_0x2b3028,_0x5dd35a,_0x1f0fee,_0x5dd35a[_0x1d9f('0x65')],_0x46407d,_0x1d9f('0x59'));})[_0x1d9f('0x22')](function(_0x3253d2){_0x22e286=_0x3253d2;logger[_0x1d9f('0x19')]('[QUEUE]\x20Ticket\x20%s\x20created',_0x22e286['id']);logger[_0x1d9f('0x19')](_0x1d9f('0x66'),_0x22e286['id'],_0x393ee4[_0x1d9f('0x50')],_0x148f04[_0x1d9f('0x48')]);switch(_0x148f04[_0x1d9f('0x48')]){case _0x1d9f('0x67'):emit(util[_0x1d9f('0x42')]('user:%s',_0x393ee4[_0x1d9f('0x50')]),_0x1d9f('0x68'),{'recordId':_0x22e286['id']});break;case _0x1d9f('0x69'):emit(util[_0x1d9f('0x42')]('user:%s',_0x393ee4['name']),_0x1d9f('0x6a'),{'uri':util['format']('%s/%s/e',_0x46407d[_0x1d9f('0x6b')],_0x22e286['id'])});break;default:logger[_0x1d9f('0x6c')](_0x1d9f('0x6d'));}})[_0x1d9f('0x6e')](function(_0x319bb2){logger[_0x1d9f('0x6c')]('[QUEUE]',_0x319bb2);});};exports[_0x1d9f('0x6f')]=function(_0x258575,_0x24ec76,_0x4f8e56,_0x5ab7f6,_0x436aa4,_0x3a17c5,_0x37a351){var _0x1583e6,_0xa6c054,_0x17d662,_0x1fedc5;_0x3a17c5['serverUrl']=intUtil[_0x1d9f('0x5a')](_0x3a17c5[_0x1d9f('0x5b')]);_0x3a17c5['remoteUri']=intUtil[_0x1d9f('0x5a')](_0x3a17c5['remoteUri']);if(_0x37a351&&_0x37a351[_0x1d9f('0x70')]&&_0x37a351[_0x1d9f('0x70')]!=='none'){logger[_0x1d9f('0x19')](_0x1d9f('0x71'),_0x1d9f('0x5e'));_0x24ec76['recordingURL']=util['format'](_0x1d9f('0x60'),_0x3a17c5[_0x1d9f('0x5b')],_0x24ec76[_0x1d9f('0x61')],md5(_0x24ec76['uniqueid']));}return getConnection(_0x3a17c5)[_0x1d9f('0x22')](function(_0x5bd881){_0x1fedc5=_0x5bd881;return getUser(_0x3a17c5,_0x5ab7f6[_0x1d9f('0x62')],_0x1fedc5);})[_0x1d9f('0x22')](function(_0x21c3ed){_0x1583e6=_0x21c3ed;return getEndUser(_0x3a17c5,_0x4f8e56,_0x24ec76[_0x1d9f('0x72')],_0x24ec76[_0x1d9f('0x73')],_0x1fedc5);})[_0x1d9f('0x22')](function(_0x259dc5){_0xa6c054=_0x259dc5;return getTicket(_0x3a17c5,_0x1583e6,_0xa6c054,_0x4f8e56,_0x24ec76,_0x4f8e56[_0x1d9f('0x65')],_0x1fedc5,_0x1d9f('0x6f'));})[_0x1d9f('0x22')](function(_0x19b65a){_0x17d662=_0x19b65a;logger[_0x1d9f('0x19')](_0x1d9f('0x74'),_0x17d662['id']);logger['info'](_0x1d9f('0x75'),_0x17d662['id'],_0x5ab7f6[_0x1d9f('0x50')],_0x3a17c5[_0x1d9f('0x48')]);switch(_0x3a17c5[_0x1d9f('0x48')]){case'integrationTab':emit(util[_0x1d9f('0x42')]('user:%s',_0x5ab7f6['name']),_0x1d9f('0x68'),{'recordId':_0x17d662['id']});break;case _0x1d9f('0x69'):emit(util[_0x1d9f('0x42')](_0x1d9f('0x76'),_0x5ab7f6[_0x1d9f('0x50')]),_0x1d9f('0x6a'),{'uri':util[_0x1d9f('0x42')]('%s/%s/e',_0x1fedc5[_0x1d9f('0x6b')],_0x17d662['id'])});break;default:logger[_0x1d9f('0x6c')]('[OUTBOUND]',_0x1d9f('0x77'));}})['catch'](function(_0x30e397){logger[_0x1d9f('0x6c')]('[OUTBOUND]',_0x30e397);});};exports[_0x1d9f('0x78')]=function(_0x1931c4,_0x434f46,_0x1d4961,_0x531359,_0x3f6259,_0x16ad2e){var _0x5a2069,_0x13be77,_0x37fd8d,_0xb54ae0;_0x16ad2e[_0x1d9f('0x5b')]=intUtil['stripTrailingSlash'](_0x16ad2e[_0x1d9f('0x5b')]);_0x16ad2e[_0x1d9f('0x55')]=intUtil[_0x1d9f('0x5a')](_0x16ad2e['remoteUri']);if(_0x3f6259&&_0x3f6259['monitor_format']){logger['info']('['+_0x434f46[_0x1d9f('0x79')][_0x1d9f('0x7a')]()+']','Recording\x20is\x20enabled!');_0x434f46[_0x1d9f('0x5f')]=util[_0x1d9f('0x42')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x16ad2e['serverUrl'],_0x434f46[_0x1d9f('0x61')],md5(_0x434f46['uniqueid']));}else{_0x434f46[_0x1d9f('0x5f')]='';}return getConnection(_0x16ad2e)[_0x1d9f('0x22')](function(_0x5c7815){_0xb54ae0=_0x5c7815;if(!_[_0x1d9f('0x1d')](_0x531359)){return getUser(_0x16ad2e,_0x531359[_0x1d9f('0x50')],_0xb54ae0);}else{return getUser(_0x16ad2e,null,_0xb54ae0);}})['then'](function(_0x1328bb){_0x5a2069=_0x1328bb;return getEndUser(_0x16ad2e,_0x1d4961,_0x434f46[_0x1d9f('0x63')],_0x434f46[_0x1d9f('0x64')],_0xb54ae0);})[_0x1d9f('0x22')](function(_0x22e2a2){_0x13be77=_0x22e2a2;return getTicket(_0x16ad2e,_0x5a2069,_0x13be77,_0x1d4961,_0x434f46,_0x1d4961[_0x1d9f('0x65')],_0xb54ae0);})[_0x1d9f('0x22')](function(_0x52d2ca){_0x37fd8d=_0x52d2ca;logger[_0x1d9f('0x19')]('['+_0x434f46[_0x1d9f('0x79')][_0x1d9f('0x7a')]()+']\x20Ticket\x20%s\x20created.',_0x37fd8d['id']);logger[_0x1d9f('0x19')]('['+_0x434f46[_0x1d9f('0x79')]['toUpperCase']()+_0x1d9f('0x7b'),_0x16ad2e[_0x1d9f('0x48')]);})[_0x1d9f('0x6e')](function(_0x45ea7e){logger[_0x1d9f('0x6c')]('['+_0x434f46[_0x1d9f('0x79')][_0x1d9f('0x7a')]()+']',_0x45ea7e);});}; \ 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 990a740..3085c29 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 _0x277d=['Displaying\x20call\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20ServiceNow\x20integration','inspect','lodash','bluebird','util','./util','../../../../config/environment','../../../../config/logger','redis','defaults','localhost','socket.io-emitter','GET','sys_user?sysparm_query=user_name%3Dadmin','then','result','length','adminId','sys_id','info','toUpperCase','],\x20getAdminUser\x20crm','catch','error','message','userEmail','sys_user?sysparm_query=email%3D','],\x20getUser\x20rp\x20obj','],\x20getUser\x20entity','active','true','userId','adminEmail','],\x20createEndUser\x20input\x20crm','POST','sys_user?','endUserNumber','System','],\x20EndUser\x20schema','endUserId','],\x20getEndUser\x20input\x20crm','sys_user?sysparm_query=phone%3D','],\x20getEndUser\x20crm','],\x20createEndUser\x20crm','forEach','includes','picklist','type','nameField','customField','toLowerCase','content','toString','string','idField','variable','variableName','customVariable','Variable','name',']\x20getTicket\x20input\x20crm','outbound','incident','assign','getString','Subjects','Descriptions','Fields',']\x20POST\x20incident\x20entity\x20schema','number',']\x20getTicket\x20crm','label','?sysparm_query=name%3D','label_entry','Incident','ticketId','Incident\x20-\x20','ticketNumber','push','all',']\x20arrayPromises:\x20IDs\x20in\x20table\x20label','Tags','%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','user:%s','emit','trigger:browser:url','username','password','sysparm_limit=1','remoteUri','stripTrailingSlash','serverUrl','%s/api/now/table/','isNil','email','calleridnum','callDirection','queue','unmanaged','format','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','recordingURL','recordingFormat','none','[OUTBOUND]','The\x20ticket\x20ID\x20is:\x20%s','call\x20direction:\x20%s'];(function(_0x1c11ba,_0x175cd3){var _0x3f9db6=function(_0x150eac){while(--_0x150eac){_0x1c11ba['push'](_0x1c11ba['shift']());}};_0x3f9db6(++_0x175cd3);}(_0x277d,0x1cf));var _0xd277=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x277d[_0x2c91e9];return _0x13f0ff;};'use strict';var _=require(_0xd277('0x0'));var Promise=require(_0xd277('0x1'));var rp=require('request-promise');var util=require(_0xd277('0x2'));var md5=require('md5');var Redis=require('ioredis');var intUtil=require(_0xd277('0x3'));var config=require(_0xd277('0x4'));var logger=require(_0xd277('0x5'))('servicenow');config[_0xd277('0x6')]=_[_0xd277('0x7')](config[_0xd277('0x6')],{'host':_0xd277('0x8'),'port':0x18eb});var io=require(_0xd277('0x9'))(new Redis(config[_0xd277('0x6')]));function getAdminUser(_0x3ec5b1,_0xe93a16,_0x4562ac,_0x155b9a,_0x239188,_0x29bb8a){return new Promise(function(_0x20a0d4,_0x55c106){var _0x3fcb1={'method':_0xd277('0xa'),'uri':_0x155b9a+_0xd277('0xb')+'&'+_0x239188+'&'+_0x29bb8a,'auth':_0xe93a16,'json':!![]};return rp(_0x3fcb1)[_0xd277('0xc')](function(_0x5ccfe0){if(_0x5ccfe0[_0xd277('0xd')][_0xd277('0xe')]>0x0){_0x4562ac[_0xd277('0xf')]=_0x5ccfe0[_0xd277('0xd')][0x0][_0xd277('0x10')];}logger[_0xd277('0x11')]('['+[_0x3ec5b1[_0xd277('0x12')]()]+_0xd277('0x13'),_0x4562ac);_0x20a0d4(_0x4562ac);})[_0xd277('0x14')](function(_0x11f655){logger[_0xd277('0x15')]('['+[_0x3ec5b1[_0xd277('0x12')]()]+']',_0x11f655[_0xd277('0x16')]);_0x55c106(_0x11f655[_0xd277('0x16')]);});});}function getUser(_0x5308f8,_0x13df2b,_0x98f48f,_0x57b92e,_0x30e9e3){return function(_0x4260c6){logger[_0xd277('0x11')]('['+[_0x5308f8['toUpperCase']()]+'],\x20getUser\x20input\x20crm',_0x4260c6);return new Promise(function(_0x2ac0a4,_0x3dfdea){if(intUtil['validateEmail'](_0x4260c6[_0xd277('0x17')])){var _0x3485a6={'method':_0xd277('0xa'),'uri':_0x98f48f+_0xd277('0x18')+_0x4260c6['userEmail']+'&'+_0x57b92e+'&'+_0x30e9e3,'auth':_0x13df2b,'json':!![]};logger['info']('['+[_0x5308f8[_0xd277('0x12')]()]+_0xd277('0x19'),_0x3485a6);return rp(_0x3485a6)[_0xd277('0xc')](function(_0x16b7b6){logger[_0xd277('0x11')]('['+[_0x5308f8[_0xd277('0x12')]()]+_0xd277('0x1a'),_0x16b7b6);if(_0x16b7b6[_0xd277('0xd')]['length']>0x0&&String(_0x16b7b6[_0xd277('0xd')][0x0][_0xd277('0x1b')])===_0xd277('0x1c')){_0x4260c6[_0xd277('0x1d')]=_0x16b7b6[_0xd277('0xd')][0x0][_0xd277('0x10')];}else{_0x4260c6['userId']=_0x4260c6['adminId'];_0x4260c6[_0xd277('0x17')]=_0x4260c6[_0xd277('0x1e')];}logger[_0xd277('0x11')]('['+[_0x5308f8[_0xd277('0x12')]()]+'],\x20getUser\x20crm',_0x4260c6);_0x2ac0a4(_0x4260c6);})['catch'](function(_0x27c256){logger['error']('['+[_0x5308f8['toUpperCase']()]+']',_0x27c256['message']);_0x3dfdea(_0x27c256[_0xd277('0x16')]);});}else{logger[_0xd277('0x11')]('['+[_0x5308f8[_0xd277('0x12')]()]+']\x20using\x20admin\x20profile');_0x4260c6[_0xd277('0x1d')]=_0x4260c6[_0xd277('0xf')];_0x4260c6[_0xd277('0x17')]=_0x4260c6[_0xd277('0x1e')];_0x2ac0a4(_0x4260c6);}});};}function createEndUser(_0xed5921,_0x33dae3,_0x4d0a7a,_0xcbf816,_0x12e741){logger['info']('['+[_0xed5921[_0xd277('0x12')]()]+_0xd277('0x1f'),_0x4d0a7a);return new Promise(function(_0x16e162,_0x3ee28c){var _0x47ccdd={'method':_0xd277('0x20'),'uri':_0xcbf816+_0xd277('0x21')+_0x12e741,'body':{'user_name':_0x4d0a7a[_0xd277('0x22')],'roles':'user','first_name':_0x4d0a7a['endUserNumber'],'active':'true','date_format':_0xd277('0x23'),'phone':_0x4d0a7a[_0xd277('0x22')]},'auth':_0x33dae3,'json':!![]};return rp(_0x47ccdd)[_0xd277('0xc')](function(_0x4f2887){logger[_0xd277('0x11')]('['+[_0xed5921[_0xd277('0x12')]()]+_0xd277('0x24'),_0x4f2887['result']);_0x4d0a7a[_0xd277('0x25')]=_0x4f2887[_0xd277('0xd')][_0xd277('0x10')];_0x16e162(_0x4d0a7a);})[_0xd277('0x14')](function(_0x542f42){logger[_0xd277('0x15')]('['+[_0xed5921[_0xd277('0x12')]()]+']',_0x542f42[_0xd277('0x16')]);_0x3ee28c(_0x542f42[_0xd277('0x16')]);});});}function getEndUser(_0x55545b,_0x4d8069,_0x52d983,_0x33bd86,_0x4bb117){return function(_0x3e6b80){logger[_0xd277('0x11')]('['+[_0x55545b[_0xd277('0x12')]()]+_0xd277('0x26'),_0x3e6b80);return new Promise(function(_0x12bfb9,_0xaa1d60){var _0x2cd240={'method':_0xd277('0xa'),'uri':_0x52d983+_0xd277('0x27')+_0x3e6b80[_0xd277('0x22')]+'&'+_0x33bd86+'&'+_0x4bb117,'auth':_0x4d8069,'json':!![]};return rp(_0x2cd240)[_0xd277('0xc')](function(_0x5e2cec){if(_0x5e2cec[_0xd277('0xd')][_0xd277('0xe')]>0x0){_0x3e6b80[_0xd277('0x25')]=_0x5e2cec['result'][0x0]['sys_id'];logger[_0xd277('0x11')]('['+[_0x55545b[_0xd277('0x12')]()]+_0xd277('0x28'),_0x3e6b80);_0x12bfb9(_0x3e6b80);}else{return createEndUser(_0x55545b,_0x4d8069,_0x3e6b80,_0x52d983,_0x33bd86)['then'](function(_0x153325){logger[_0xd277('0x11')]('['+[_0x55545b['toUpperCase']()]+_0xd277('0x29'),_0x153325);_0x12bfb9(_0x153325);});}})[_0xd277('0x14')](function(_0x4fd6a1){logger[_0xd277('0x15')]('['+[_0x55545b[_0xd277('0x12')]()]+']',_0x4fd6a1[_0xd277('0x16')]);_0xaa1d60(_0x4fd6a1['message']);});});};}function getCustomFields(_0x1e3e07,_0x50eb54){var _0xad7d9a={};if(_0x1e3e07['length']>0x0){_[_0xd277('0x2a')](_0x1e3e07,function(_0x520cbc){if(_[_0xd277('0x2b')](['string',_0xd277('0x2c')],_0x520cbc[_0xd277('0x2d')])&&_0x520cbc[_0xd277('0x2e')]&&!_0x520cbc[_0xd277('0x2f')]){_0xad7d9a[_0x520cbc[_0xd277('0x2e')][_0xd277('0x30')]()]=_0x520cbc[_0xd277('0x31')][_0xd277('0x32')]();}else if(_[_0xd277('0x2b')]([_0xd277('0x33'),_0xd277('0x2c')],_0x520cbc[_0xd277('0x2d')])&&_0x520cbc[_0xd277('0x34')]&&_0x520cbc[_0xd277('0x2f')]){_0xad7d9a[_0x520cbc[_0xd277('0x34')][_0xd277('0x30')]()]=_0x520cbc[_0xd277('0x31')][_0xd277('0x32')]();}else if(_0x520cbc['type']===_0xd277('0x35')&&_0x520cbc['variableName']&&_0x520cbc[_0xd277('0x34')]&&_0x520cbc['customField']){_0xad7d9a[_0x520cbc['idField']['toLowerCase']()]=_0x50eb54[_0x520cbc[_0xd277('0x36')]][_0xd277('0x32')]();}else if(_0x520cbc[_0xd277('0x2d')]===_0xd277('0x37')&&_0x520cbc[_0xd277('0x38')]&&_0x520cbc[_0xd277('0x38')][_0xd277('0x39')]&&_0x520cbc[_0xd277('0x34')]&&_0x520cbc[_0xd277('0x2f')]){_0xad7d9a[_0x520cbc[_0xd277('0x34')][_0xd277('0x30')]()]=_0x50eb54[_0x520cbc[_0xd277('0x38')]['name'][_0xd277('0x30')]()][_0xd277('0x32')]();}});}return _0xad7d9a;}function getTicket(_0x1c81a8,_0x19f1b8,_0x10aaad,_0x2a45d9,_0x17b639,_0x9c2965){return function(_0x57958e){logger['info']('['+[_0x1c81a8[_0xd277('0x12')]()]+_0xd277('0x3a'),_0x57958e);return new Promise(function(_0x499894,_0x476fa5){var _0x2ea75e=_0x1c81a8[_0xd277('0x30')]()===_0xd277('0x3b')?_0x57958e['userId']:_0x57958e[_0xd277('0x25')];var _0x3d7ff4={'method':_0xd277('0x20'),'uri':_0x10aaad+_0xd277('0x3c')+'?'+_0x9c2965,'body':Object[_0xd277('0x3d')]({},{'active':'true','caller_id':_0x2ea75e,'assigned_to':_0x57958e[_0xd277('0x1d')],'short_description':intUtil[_0xd277('0x3e')](_0x2a45d9[_0xd277('0x3f')],_0x17b639,'\x20'),'description':intUtil[_0xd277('0x3e')](_0x2a45d9[_0xd277('0x40')],_0x17b639,'\x0a')},getCustomFields(_0x2a45d9[_0xd277('0x41')],_0x17b639)),'auth':_0x19f1b8,'json':!![]};return rp(_0x3d7ff4)['then'](function(_0x352bda){logger[_0xd277('0x11')]('['+[_0x1c81a8[_0xd277('0x12')]()]+_0xd277('0x42'),_0x352bda[_0xd277('0xd')]);_0x57958e['ticketId']=_0x352bda[_0xd277('0xd')][_0xd277('0x10')];_0x57958e['ticketNumber']=_0x352bda['result'][_0xd277('0x43')];logger[_0xd277('0x11')]('['+[_0x1c81a8['toUpperCase']()]+_0xd277('0x44'),_0x57958e);_0x499894(_0x57958e);})[_0xd277('0x14')](function(_0x26ab36){logger[_0xd277('0x15')]('['+[_0x1c81a8[_0xd277('0x12')]()]+']',_0x26ab36[_0xd277('0x16')]);_0x476fa5(_0x26ab36[_0xd277('0x16')]);});});};}function createRemoteTag(_0x4f47dd,_0x193989,_0x242aee,_0x3b417e){return new Promise(function(_0x50d997,_0x3f9143){var _0x27acad={'method':'POST','uri':_0x242aee+'label'+'?'+_0x3b417e,'body':{'short_description':_0x4f47dd,'global':!![],'active':!![],'name':_0x4f47dd},'auth':_0x193989,'json':!![]};return rp(_0x27acad)[_0xd277('0xc')](function(_0x27e14f){var _0x53d111=_0x27e14f[_0xd277('0xd')][_0xd277('0x10')];_0x50d997(_0x53d111);});});}function getRemoteTag(_0x12ccde,_0x401754,_0x34b020,_0x5c2846,_0x4e949f){return new Promise(function(_0x20d8ec,_0x4ce6a4){var _0x4ef986={'method':_0xd277('0xa'),'uri':_0x34b020+_0xd277('0x45')+_0xd277('0x46')+_0x12ccde+'&'+_0x5c2846,'auth':_0x401754,'json':!![]};return rp(_0x4ef986)[_0xd277('0xc')](function(_0x45a483){if(_0x45a483[_0xd277('0xd')][_0xd277('0xe')]>0x0){var _0x284961=_0x45a483[_0xd277('0xd')][0x0][_0xd277('0x10')];_0x20d8ec(_0x284961);}else{return createRemoteTag(_0x12ccde,_0x401754,_0x34b020,_0x5c2846)[_0xd277('0xc')](function(_0x10108d){_0x20d8ec(_0x10108d);});}});});}function assignTagToIncident(_0x38e49c,_0x21d234,_0x56f843,_0x4ffbb8,_0x18e78a){return new Promise(function(_0x347275,_0x179ea3){var _0x556064={'method':_0xd277('0x20'),'uri':_0x56f843+_0xd277('0x47')+'?'+_0x18e78a,'body':{'label':_0x38e49c,'table':'incident','id_type':_0xd277('0x48'),'table_key':_0x4ffbb8[_0xd277('0x49')],'title':_0xd277('0x4a')+_0x4ffbb8['ticketNumber'],'id_display':_0x4ffbb8[_0xd277('0x4b')]},'auth':_0x21d234,'json':!![]};return rp(_0x556064)[_0xd277('0xc')](function(_0x1d38a0){_0x347275();})['catch'](function(){_0x347275();});});}function manageTags(_0x198061,_0x3bc204,_0x2397da,_0x16a9ef,_0x2ce760,_0x458c98,_0x1a5eca){return new Promise(function(_0x434e00,_0x3ee0aa){var _0xf271a8=[];_0x3bc204[_0xd277('0x2a')](function(_0x2e33de){_0xf271a8[_0xd277('0x4c')](getRemoteTag(_0x2e33de,_0x2397da,_0x16a9ef,_0x458c98,_0x1a5eca));});return Promise[_0xd277('0x4d')](_0xf271a8)['then'](function(_0x477941){if(_0x477941[_0xd277('0xe')]){logger[_0xd277('0x11')]('['+[_0x198061['toUpperCase']()]+_0xd277('0x4e'),_0x477941);var _0x2b5e25=[];_0x477941[_0xd277('0x2a')](function(_0x6242dc){_0x2b5e25[_0xd277('0x4c')](assignTagToIncident(_0x6242dc,_0x2397da,_0x16a9ef,_0x2ce760,_0x458c98));});return Promise['all'](_0x2b5e25)[_0xd277('0xc')](function(){_0x434e00();})[_0xd277('0x14')](function(){_0x434e00();});}else{_0x434e00();}});});}function getTags(_0x4b80b7,_0x3541d1,_0x21ed33,_0x1b2351,_0x385d2e,_0x3386d8){return function(_0x2230fe){return new Promise(function(_0x475f87,_0x5abc60){var _0x512acf=[];var _0x178ac1=_0x1b2351[_0xd277('0x4f')];if(_0x178ac1&&_0x178ac1[_0xd277('0xe')]>0x0){_0x512acf=_['map'](_0x178ac1,'name');}if(_0x512acf[_0xd277('0xe')]>0x0){return manageTags(_0x4b80b7,_0x512acf,_0x3541d1,_0x21ed33,_0x2230fe,_0x385d2e,_0x3386d8)[_0xd277('0xc')](function(){_0x475f87(_0x2230fe);});}else{_0x475f87(_0x2230fe);}});};}function emit(_0x537f0f,_0xb723f2,_0x1a8dcd){var _0x25b48f=_0xd277('0x50')+_0xd277('0x51')+_0xd277('0x52')+_0xd277('0x53');var _0x1f4195={'uri':_0x537f0f+_0xd277('0x54')+_0x1a8dcd+_0x25b48f};io['to'](util['format'](_0xd277('0x55'),_0xb723f2))[_0xd277('0x56')](_0xd277('0x57'),_0x1f4195);}exports['cs']=function(_0x476cd4,_0x8625e3,_0x172b70,_0x3a051f,_0x464f07,_0x38a777,_0x334b46,_0x429185){var _0x3bf40e={};var _0x587a34={'user':_0x38a777[_0xd277('0x58')],'pass':_0x38a777[_0xd277('0x59')]};var _0x56e2b6=_0xd277('0x5a');var _0x5144ee='sysparm_display_value=true';_0x38a777[_0xd277('0x5b')]=intUtil[_0xd277('0x5c')](_0x38a777[_0xd277('0x5b')]);_0x38a777[_0xd277('0x5d')]=intUtil[_0xd277('0x5c')](_0x38a777[_0xd277('0x5d')]);var _0x327459=util['format'](_0xd277('0x5e'),_0x38a777[_0xd277('0x5b')]);_0x3bf40e[_0xd277('0x17')]=!_[_0xd277('0x5f')](_0x3a051f)?_0x3a051f[_0xd277('0x60')]:null;_0x3bf40e[_0xd277('0x1e')]=_0x38a777[_0xd277('0x60')];_0x3bf40e[_0xd277('0x22')]=_0x429185[_0xd277('0x30')]()===_0xd277('0x3b')?_0x8625e3['destcalleridnum']:_0x8625e3[_0xd277('0x61')];_0x3bf40e[_0xd277('0x62')]=_0x429185===_0xd277('0x63')||_0x429185===_0xd277('0x64')?_0xd277('0x63'):_0xd277('0x3b');var _0x1d1570=util[_0xd277('0x65')](_0xd277('0x66'),_0x38a777[_0xd277('0x5d')],_0x8625e3[_0xd277('0x67')],md5(_0x8625e3[_0xd277('0x67')]));if(_0x464f07&&_0x464f07[_0xd277('0x68')]){logger[_0xd277('0x11')](_0xd277('0x69'),'Recording\x20is\x20enabled!');_0x8625e3[_0xd277('0x6a')]=_0x1d1570;}else if(_0x334b46&&_0x334b46[_0xd277('0x6b')]&&_0x334b46[_0xd277('0x6b')]!==_0xd277('0x6c')){logger['info'](_0xd277('0x6d'),'Recording\x20is\x20enabled!');_0x8625e3[_0xd277('0x6a')]=_0x1d1570;}else{_0x8625e3[_0xd277('0x6a')]='';}return getAdminUser(_0x429185,_0x587a34,_0x3bf40e,_0x327459,_0x5144ee,_0x56e2b6)[_0xd277('0xc')](getUser(_0x429185,_0x587a34,_0x327459,_0x5144ee,_0x56e2b6))[_0xd277('0xc')](getEndUser(_0x429185,_0x587a34,_0x327459,_0x5144ee,_0x56e2b6))[_0xd277('0xc')](getTicket(_0x429185,_0x587a34,_0x327459,_0x172b70,_0x8625e3,_0x5144ee))['then'](function(_0x58a0ef){logger['info'](util[_0xd277('0x65')](_0xd277('0x6e'),_0x58a0ef['ticketId']));logger[_0xd277('0x11')](util[_0xd277('0x65')](_0xd277('0x6f'),_0x429185));if(_0x429185!=='unmanaged'){logger['info']('['+[_0x429185[_0xd277('0x12')]()]+']',_0xd277('0x70'));emit(_0x38a777[_0xd277('0x5b')],_0x3a051f[_0xd277('0x39')],_0x58a0ef[_0xd277('0x49')]);}})[_0xd277('0x14')](function(_0x458b22){logger[_0xd277('0x15')]('['+[_0x429185[_0xd277('0x12')]()]+_0xd277('0x71'),util[_0xd277('0x72')](_0x458b22,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x7689=['],\x20getUser\x20rp\x20obj','then','],\x20getUser\x20entity','result','true','userId','sys_id','adminId','catch','error','message',']\x20using\x20admin\x20profile','],\x20createEndUser\x20input\x20crm','POST','sys_user?','endUserNumber','user','System','],\x20EndUser\x20schema','endUserId','],\x20getEndUser\x20input\x20crm','],\x20getEndUser\x20crm','],\x20createEndUser\x20crm','forEach','includes','string','picklist','type','nameField','customField','toLowerCase','toString','idField','content','variable','variableName','customVariable','Variable','name',']\x20getTicket\x20input\x20crm','outbound','incident','getString','Subjects','Descriptions','number',']\x20getTicket\x20crm','label','label_entry','ticketId','Incident\x20-\x20','ticketNumber','push','all',']\x20arrayPromises:\x20IDs\x20in\x20table\x20label','Tags','map','%26sysparm_record_target%3Dincident','%26sysparm_record_row%3D1%26sysparm_record_rows%3D39','%26sysparm_record_list%3Dactive%253Dtrue','/nav_to.do?uri=incident.do?sys_id%3D','format','user:%s','username','password','sysparm_limit=1','sysparm_display_value=true','remoteUri','stripTrailingSlash','serverUrl','%s/api/now/table/','isNil','email','destcalleridnum','calleridnum','callDirection','queue','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','[OUTBOUND]','The\x20ticket\x20ID\x20is:\x20%s','unmanaged','Displaying\x20call\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20ServiceNow\x20integration','inspect','lodash','bluebird','request-promise','md5','ioredis','../../../../config/environment','../../../../config/logger','servicenow','redis','defaults','localhost','socket.io-emitter','GET','sys_user?sysparm_query=user_name%3Dadmin','length','info','toUpperCase','],\x20getAdminUser\x20crm','],\x20getUser\x20input\x20crm','validateEmail','userEmail','sys_user?sysparm_query=email%3D'];(function(_0x55f448,_0xf58185){var _0x42ed3=function(_0x4d51d3){while(--_0x4d51d3){_0x55f448['push'](_0x55f448['shift']());}};_0x42ed3(++_0xf58185);}(_0x7689,0x1aa));var _0x9768=function(_0x4b8c6d,_0x164fec){_0x4b8c6d=_0x4b8c6d-0x0;var _0x13e1d1=_0x7689[_0x4b8c6d];return _0x13e1d1;};'use strict';var _=require(_0x9768('0x0'));var Promise=require(_0x9768('0x1'));var rp=require(_0x9768('0x2'));var util=require('util');var md5=require(_0x9768('0x3'));var Redis=require(_0x9768('0x4'));var intUtil=require('./util');var config=require(_0x9768('0x5'));var logger=require(_0x9768('0x6'))(_0x9768('0x7'));config[_0x9768('0x8')]=_[_0x9768('0x9')](config[_0x9768('0x8')],{'host':_0x9768('0xa'),'port':0x18eb});var io=require(_0x9768('0xb'))(new Redis(config[_0x9768('0x8')]));function getAdminUser(_0x3d3294,_0xf78800,_0x5885f2,_0x44e669,_0xb550e8,_0x1fd5e1){return new Promise(function(_0x3c3328,_0x3a048b){var _0x17ebb3={'method':_0x9768('0xc'),'uri':_0x44e669+_0x9768('0xd')+'&'+_0xb550e8+'&'+_0x1fd5e1,'auth':_0xf78800,'json':!![]};return rp(_0x17ebb3)['then'](function(_0x22c1fd){if(_0x22c1fd['result'][_0x9768('0xe')]>0x0){_0x5885f2['adminId']=_0x22c1fd['result'][0x0]['sys_id'];}logger[_0x9768('0xf')]('['+[_0x3d3294[_0x9768('0x10')]()]+_0x9768('0x11'),_0x5885f2);_0x3c3328(_0x5885f2);})['catch'](function(_0x9b18b0){logger['error']('['+[_0x3d3294[_0x9768('0x10')]()]+']',_0x9b18b0['message']);_0x3a048b(_0x9b18b0['message']);});});}function getUser(_0x200758,_0x3ef153,_0x56c1cc,_0x4bd143,_0x538856){return function(_0x54e68e){logger[_0x9768('0xf')]('['+[_0x200758[_0x9768('0x10')]()]+_0x9768('0x12'),_0x54e68e);return new Promise(function(_0x47d655,_0x1e60ce){if(intUtil[_0x9768('0x13')](_0x54e68e[_0x9768('0x14')])){var _0x162f1e={'method':_0x9768('0xc'),'uri':_0x56c1cc+_0x9768('0x15')+_0x54e68e[_0x9768('0x14')]+'&'+_0x4bd143+'&'+_0x538856,'auth':_0x3ef153,'json':!![]};logger[_0x9768('0xf')]('['+[_0x200758[_0x9768('0x10')]()]+_0x9768('0x16'),_0x162f1e);return rp(_0x162f1e)[_0x9768('0x17')](function(_0x2e322d){logger[_0x9768('0xf')]('['+[_0x200758[_0x9768('0x10')]()]+_0x9768('0x18'),_0x2e322d);if(_0x2e322d['result'][_0x9768('0xe')]>0x0&&String(_0x2e322d[_0x9768('0x19')][0x0]['active'])===_0x9768('0x1a')){_0x54e68e[_0x9768('0x1b')]=_0x2e322d[_0x9768('0x19')][0x0][_0x9768('0x1c')];}else{_0x54e68e[_0x9768('0x1b')]=_0x54e68e[_0x9768('0x1d')];_0x54e68e[_0x9768('0x14')]=_0x54e68e['adminEmail'];}logger[_0x9768('0xf')]('['+[_0x200758[_0x9768('0x10')]()]+'],\x20getUser\x20crm',_0x54e68e);_0x47d655(_0x54e68e);})[_0x9768('0x1e')](function(_0x401b3d){logger[_0x9768('0x1f')]('['+[_0x200758[_0x9768('0x10')]()]+']',_0x401b3d[_0x9768('0x20')]);_0x1e60ce(_0x401b3d['message']);});}else{logger[_0x9768('0xf')]('['+[_0x200758[_0x9768('0x10')]()]+_0x9768('0x21'));_0x54e68e[_0x9768('0x1b')]=_0x54e68e['adminId'];_0x54e68e['userEmail']=_0x54e68e['adminEmail'];_0x47d655(_0x54e68e);}});};}function createEndUser(_0x8e053c,_0x50a6a3,_0x3d0805,_0x501c25,_0x2d3f14){logger[_0x9768('0xf')]('['+[_0x8e053c['toUpperCase']()]+_0x9768('0x22'),_0x3d0805);return new Promise(function(_0x474778,_0x5726bc){var _0x3ab547={'method':_0x9768('0x23'),'uri':_0x501c25+_0x9768('0x24')+_0x2d3f14,'body':{'user_name':_0x3d0805[_0x9768('0x25')],'roles':_0x9768('0x26'),'first_name':_0x3d0805[_0x9768('0x25')],'active':_0x9768('0x1a'),'date_format':_0x9768('0x27'),'phone':_0x3d0805[_0x9768('0x25')]},'auth':_0x50a6a3,'json':!![]};return rp(_0x3ab547)['then'](function(_0x4d2993){logger[_0x9768('0xf')]('['+[_0x8e053c['toUpperCase']()]+_0x9768('0x28'),_0x4d2993[_0x9768('0x19')]);_0x3d0805[_0x9768('0x29')]=_0x4d2993['result'][_0x9768('0x1c')];_0x474778(_0x3d0805);})['catch'](function(_0x2ffb16){logger['error']('['+[_0x8e053c[_0x9768('0x10')]()]+']',_0x2ffb16['message']);_0x5726bc(_0x2ffb16[_0x9768('0x20')]);});});}function getEndUser(_0x398570,_0x3adf6d,_0x1a5f6d,_0x3c0b92,_0x2b7322){return function(_0x9b9613){logger[_0x9768('0xf')]('['+[_0x398570['toUpperCase']()]+_0x9768('0x2a'),_0x9b9613);return new Promise(function(_0x5cd51e,_0x295106){var _0x11d3d1={'method':_0x9768('0xc'),'uri':_0x1a5f6d+'sys_user?sysparm_query=phone%3D'+_0x9b9613['endUserNumber']+'&'+_0x3c0b92+'&'+_0x2b7322,'auth':_0x3adf6d,'json':!![]};return rp(_0x11d3d1)[_0x9768('0x17')](function(_0x1708a4){if(_0x1708a4[_0x9768('0x19')][_0x9768('0xe')]>0x0){_0x9b9613[_0x9768('0x29')]=_0x1708a4[_0x9768('0x19')][0x0]['sys_id'];logger[_0x9768('0xf')]('['+[_0x398570[_0x9768('0x10')]()]+_0x9768('0x2b'),_0x9b9613);_0x5cd51e(_0x9b9613);}else{return createEndUser(_0x398570,_0x3adf6d,_0x9b9613,_0x1a5f6d,_0x3c0b92)[_0x9768('0x17')](function(_0xc27940){logger[_0x9768('0xf')]('['+[_0x398570[_0x9768('0x10')]()]+_0x9768('0x2c'),_0xc27940);_0x5cd51e(_0xc27940);});}})[_0x9768('0x1e')](function(_0x1c6567){logger['error']('['+[_0x398570['toUpperCase']()]+']',_0x1c6567[_0x9768('0x20')]);_0x295106(_0x1c6567[_0x9768('0x20')]);});});};}function getCustomFields(_0x409957,_0x5e583a){var _0x5c4b67={};if(_0x409957['length']>0x0){_[_0x9768('0x2d')](_0x409957,function(_0x4f1875){if(_[_0x9768('0x2e')]([_0x9768('0x2f'),_0x9768('0x30')],_0x4f1875[_0x9768('0x31')])&&_0x4f1875[_0x9768('0x32')]&&!_0x4f1875[_0x9768('0x33')]){_0x5c4b67[_0x4f1875[_0x9768('0x32')][_0x9768('0x34')]()]=_0x4f1875['content'][_0x9768('0x35')]();}else if(_['includes']([_0x9768('0x2f'),_0x9768('0x30')],_0x4f1875['type'])&&_0x4f1875[_0x9768('0x36')]&&_0x4f1875[_0x9768('0x33')]){_0x5c4b67[_0x4f1875[_0x9768('0x36')]['toLowerCase']()]=_0x4f1875[_0x9768('0x37')][_0x9768('0x35')]();}else if(_0x4f1875['type']===_0x9768('0x38')&&_0x4f1875[_0x9768('0x39')]&&_0x4f1875['idField']&&_0x4f1875[_0x9768('0x33')]){_0x5c4b67[_0x4f1875[_0x9768('0x36')][_0x9768('0x34')]()]=_0x5e583a[_0x4f1875['variableName']][_0x9768('0x35')]();}else if(_0x4f1875[_0x9768('0x31')]===_0x9768('0x3a')&&_0x4f1875[_0x9768('0x3b')]&&_0x4f1875[_0x9768('0x3b')]['name']&&_0x4f1875[_0x9768('0x36')]&&_0x4f1875[_0x9768('0x33')]){_0x5c4b67[_0x4f1875[_0x9768('0x36')][_0x9768('0x34')]()]=_0x5e583a[_0x4f1875['Variable'][_0x9768('0x3c')]['toLowerCase']()][_0x9768('0x35')]();}});}return _0x5c4b67;}function getTicket(_0x96138c,_0x23ec19,_0x570d89,_0x5236e8,_0x214d5d,_0x24b43c){return function(_0x383ff8){logger[_0x9768('0xf')]('['+[_0x96138c[_0x9768('0x10')]()]+_0x9768('0x3d'),_0x383ff8);return new Promise(function(_0x38e2e9,_0x8a6f4a){var _0x13c5ed=_0x96138c[_0x9768('0x34')]()===_0x9768('0x3e')?_0x383ff8['userId']:_0x383ff8[_0x9768('0x29')];var _0x1f8ce1={'method':_0x9768('0x23'),'uri':_0x570d89+_0x9768('0x3f')+'?'+_0x24b43c,'body':Object['assign']({},{'active':_0x9768('0x1a'),'caller_id':_0x13c5ed,'assigned_to':_0x383ff8[_0x9768('0x1b')],'short_description':intUtil[_0x9768('0x40')](_0x5236e8[_0x9768('0x41')],_0x214d5d,'\x20'),'description':intUtil[_0x9768('0x40')](_0x5236e8[_0x9768('0x42')],_0x214d5d,'\x0a')},getCustomFields(_0x5236e8['Fields'],_0x214d5d)),'auth':_0x23ec19,'json':!![]};return rp(_0x1f8ce1)[_0x9768('0x17')](function(_0x27e054){logger[_0x9768('0xf')]('['+[_0x96138c[_0x9768('0x10')]()]+']\x20POST\x20incident\x20entity\x20schema',_0x27e054[_0x9768('0x19')]);_0x383ff8['ticketId']=_0x27e054[_0x9768('0x19')][_0x9768('0x1c')];_0x383ff8['ticketNumber']=_0x27e054[_0x9768('0x19')][_0x9768('0x43')];logger[_0x9768('0xf')]('['+[_0x96138c['toUpperCase']()]+_0x9768('0x44'),_0x383ff8);_0x38e2e9(_0x383ff8);})['catch'](function(_0xc057bb){logger[_0x9768('0x1f')]('['+[_0x96138c[_0x9768('0x10')]()]+']',_0xc057bb[_0x9768('0x20')]);_0x8a6f4a(_0xc057bb[_0x9768('0x20')]);});});};}function createRemoteTag(_0x42f5f5,_0x283cd8,_0x596480,_0x5b5a1c){return new Promise(function(_0x52bed4,_0x1fb4ee){var _0xc94d59={'method':'POST','uri':_0x596480+_0x9768('0x45')+'?'+_0x5b5a1c,'body':{'short_description':_0x42f5f5,'global':!![],'active':!![],'name':_0x42f5f5},'auth':_0x283cd8,'json':!![]};return rp(_0xc94d59)[_0x9768('0x17')](function(_0x44ef7b){var _0x4b3ac5=_0x44ef7b['result'][_0x9768('0x1c')];_0x52bed4(_0x4b3ac5);});});}function getRemoteTag(_0x31a775,_0x366779,_0x3220a2,_0x1e0d16,_0x3084b3){return new Promise(function(_0x1d4d8d,_0x5d9203){var _0x2b86ca={'method':'GET','uri':_0x3220a2+_0x9768('0x45')+'?sysparm_query=name%3D'+_0x31a775+'&'+_0x1e0d16,'auth':_0x366779,'json':!![]};return rp(_0x2b86ca)[_0x9768('0x17')](function(_0x44d906){if(_0x44d906[_0x9768('0x19')][_0x9768('0xe')]>0x0){var _0x5d48af=_0x44d906['result'][0x0][_0x9768('0x1c')];_0x1d4d8d(_0x5d48af);}else{return createRemoteTag(_0x31a775,_0x366779,_0x3220a2,_0x1e0d16)[_0x9768('0x17')](function(_0x330956){_0x1d4d8d(_0x330956);});}});});}function assignTagToIncident(_0x50328a,_0x1b14c2,_0x2bff39,_0x2e84bb,_0x4c3c40){return new Promise(function(_0x202be9,_0x21097c){var _0x1e07c2={'method':'POST','uri':_0x2bff39+_0x9768('0x46')+'?'+_0x4c3c40,'body':{'label':_0x50328a,'table':_0x9768('0x3f'),'id_type':'Incident','table_key':_0x2e84bb[_0x9768('0x47')],'title':_0x9768('0x48')+_0x2e84bb[_0x9768('0x49')],'id_display':_0x2e84bb['ticketNumber']},'auth':_0x1b14c2,'json':!![]};return rp(_0x1e07c2)[_0x9768('0x17')](function(_0x9a5595){_0x202be9();})[_0x9768('0x1e')](function(){_0x202be9();});});}function manageTags(_0x37a690,_0x2fe1de,_0x1f2fbf,_0x588010,_0x689de6,_0x26d652,_0x25fb2b){return new Promise(function(_0xec1096,_0x83fbc4){var _0x7e28d2=[];_0x2fe1de[_0x9768('0x2d')](function(_0x33c53e){_0x7e28d2[_0x9768('0x4a')](getRemoteTag(_0x33c53e,_0x1f2fbf,_0x588010,_0x26d652,_0x25fb2b));});return Promise[_0x9768('0x4b')](_0x7e28d2)[_0x9768('0x17')](function(_0x4dca54){if(_0x4dca54[_0x9768('0xe')]){logger[_0x9768('0xf')]('['+[_0x37a690['toUpperCase']()]+_0x9768('0x4c'),_0x4dca54);var _0xd23b03=[];_0x4dca54[_0x9768('0x2d')](function(_0x481280){_0xd23b03[_0x9768('0x4a')](assignTagToIncident(_0x481280,_0x1f2fbf,_0x588010,_0x689de6,_0x26d652));});return Promise['all'](_0xd23b03)[_0x9768('0x17')](function(){_0xec1096();})['catch'](function(){_0xec1096();});}else{_0xec1096();}});});}function getTags(_0x3557d0,_0x1f86c9,_0x11565d,_0x5dc0d2,_0x285633,_0x5d3cd8){return function(_0x47934c){return new Promise(function(_0xf11ca9,_0x2f78f6){var _0xe5c3e6=[];var _0x2bccbb=_0x5dc0d2[_0x9768('0x4d')];if(_0x2bccbb&&_0x2bccbb[_0x9768('0xe')]>0x0){_0xe5c3e6=_[_0x9768('0x4e')](_0x2bccbb,_0x9768('0x3c'));}if(_0xe5c3e6[_0x9768('0xe')]>0x0){return manageTags(_0x3557d0,_0xe5c3e6,_0x1f86c9,_0x11565d,_0x47934c,_0x285633,_0x5d3cd8)[_0x9768('0x17')](function(){_0xf11ca9(_0x47934c);});}else{_0xf11ca9(_0x47934c);}});};}function emit(_0x293d1b,_0x292722,_0x177119){var _0x5288f7=_0x9768('0x4f')+_0x9768('0x50')+_0x9768('0x51')+'%255EORDERBYDESCnumber';var _0x2347bd={'uri':_0x293d1b+_0x9768('0x52')+_0x177119+_0x5288f7};io['to'](util[_0x9768('0x53')](_0x9768('0x54'),_0x292722))['emit']('trigger:browser:url',_0x2347bd);}exports['cs']=function(_0x2afc5f,_0x3534d7,_0x8bf117,_0x1d109e,_0x47151e,_0x32fafc,_0xab8635,_0x57a3a0){var _0x4ab697={};var _0x2bbbd1={'user':_0x32fafc[_0x9768('0x55')],'pass':_0x32fafc[_0x9768('0x56')]};var _0x10709e=_0x9768('0x57');var _0x130cc0=_0x9768('0x58');_0x32fafc[_0x9768('0x59')]=intUtil[_0x9768('0x5a')](_0x32fafc[_0x9768('0x59')]);_0x32fafc[_0x9768('0x5b')]=intUtil[_0x9768('0x5a')](_0x32fafc['serverUrl']);var _0x1e8002=util[_0x9768('0x53')](_0x9768('0x5c'),_0x32fafc[_0x9768('0x59')]);_0x4ab697[_0x9768('0x14')]=!_[_0x9768('0x5d')](_0x1d109e)?_0x1d109e['email']:null;_0x4ab697['adminEmail']=_0x32fafc[_0x9768('0x5e')];_0x4ab697[_0x9768('0x25')]=_0x57a3a0[_0x9768('0x34')]()==='outbound'?_0x3534d7[_0x9768('0x5f')]:_0x3534d7[_0x9768('0x60')];_0x4ab697[_0x9768('0x61')]=_0x57a3a0===_0x9768('0x62')||_0x57a3a0==='unmanaged'?_0x9768('0x62'):_0x9768('0x3e');var _0x50df4e=util[_0x9768('0x53')](_0x9768('0x63'),_0x32fafc[_0x9768('0x5b')],_0x3534d7[_0x9768('0x64')],md5(_0x3534d7[_0x9768('0x64')]));if(_0x47151e&&_0x47151e[_0x9768('0x65')]){logger[_0x9768('0xf')]('[QUEUE]',_0x9768('0x66'));_0x3534d7[_0x9768('0x67')]=_0x50df4e;}else if(_0xab8635&&_0xab8635[_0x9768('0x68')]&&_0xab8635[_0x9768('0x68')]!==_0x9768('0x69')){logger['info'](_0x9768('0x6a'),_0x9768('0x66'));_0x3534d7[_0x9768('0x67')]=_0x50df4e;}else{_0x3534d7[_0x9768('0x67')]='';}return getAdminUser(_0x57a3a0,_0x2bbbd1,_0x4ab697,_0x1e8002,_0x130cc0,_0x10709e)['then'](getUser(_0x57a3a0,_0x2bbbd1,_0x1e8002,_0x130cc0,_0x10709e))[_0x9768('0x17')](getEndUser(_0x57a3a0,_0x2bbbd1,_0x1e8002,_0x130cc0,_0x10709e))['then'](getTicket(_0x57a3a0,_0x2bbbd1,_0x1e8002,_0x8bf117,_0x3534d7,_0x130cc0))['then'](function(_0x4c1863){logger['info'](util['format'](_0x9768('0x6b'),_0x4c1863[_0x9768('0x47')]));logger[_0x9768('0xf')](util[_0x9768('0x53')]('call\x20direction:\x20%s',_0x57a3a0));if(_0x57a3a0!==_0x9768('0x6c')){logger[_0x9768('0xf')]('['+[_0x57a3a0['toUpperCase']()]+']',_0x9768('0x6d'));emit(_0x32fafc[_0x9768('0x59')],_0x1d109e[_0x9768('0x3c')],_0x4c1863[_0x9768('0x47')]);}})[_0x9768('0x1e')](function(_0x4ed0f2){logger[_0x9768('0x1f')]('['+[_0x57a3a0[_0x9768('0x10')]()]+_0x9768('0x6e'),util[_0x9768('0x6f')](_0x4ed0f2,{'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 4f2c2fa..0d4d6f1 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 _0x6cf9=['calleridnum','lodash','request-promise','bluebird','util','../../../../config/environment','sugarcrm','redis','defaults','localhost','socket.io-emitter','POST','emit','info','name','assigned_user_id','description','getString','Descriptions','date_start','toISOString','duration_hours','duration_minutes','parent_id','parent_type','Contacts','parent_name','direction','variableName','push','idField','set_entry','JSON','stringify','Calls','format','Basic\x20%s','apiKey','toString','base64','isNil','Getting\x20agent\x20with\x20name','get_entry_list','Employees','INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200','entry_list','length','find','name_value_list','user_name','value','Agent\x20found!','user_id','Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!','resolve','Searching\x20enduser\x20with\x20phone','contacts.phone_home\x20=\x20\x22%s\x22','phone_home','then','first_name','','Caller\x20-\x20%s','debug','[HTTP]','merge','type','string','customField','toLowerCase','content','custom_fields','Variable','username','PLAIN','xCALLY\x20Motion\x20integration','sessionID','Account\x20%d\x20is\x20not\x20valid','remoteUri','stripTrailingSlash','serverUrl','uri','%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','The\x20Enduser\x20ID\x20is:','Fields','Inbound','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','users','contacts','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','recordingFormat','none','destcalleridname','destcalleridnum','Outbound','version','[OUTBOUND]','unmanaged','lastevent'];(function(_0x4f3692,_0x38222a){var _0x1537fe=function(_0x34bef6){while(--_0x34bef6){_0x4f3692['push'](_0x4f3692['shift']());}};_0x1537fe(++_0x38222a);}(_0x6cf9,0xe7));var _0x96cf=function(_0x5ca52d,_0x3a4a22){_0x5ca52d=_0x5ca52d-0x0;var _0x89e54e=_0x6cf9[_0x5ca52d];return _0x89e54e;};'use strict';var _=require(_0x96cf('0x0'));var rp=require(_0x96cf('0x1'));var BPromise=require(_0x96cf('0x2'));var md5=require('md5');var util=require(_0x96cf('0x3'));var Redis=require('ioredis');var intUtil=require('./util');var config=require(_0x96cf('0x4'));var logger=require('../../../../config/logger')(_0x96cf('0x5'));config[_0x96cf('0x6')]=_[_0x96cf('0x7')](config[_0x96cf('0x6')],{'host':_0x96cf('0x8'),'port':0x18eb});var io=require(_0x96cf('0x9'))(new Redis(config['redis']));var def={'method':_0x96cf('0xa'),'json':!![]};function emit(_0x42ed8b,_0x4096d6,_0x268f6f){io['to'](_0x42ed8b)[_0x96cf('0xb')](_0x4096d6,_0x268f6f);}function getTicket(_0x2e6bc1,_0x7c304b,_0x4b6202,_0x5689b9,_0x5d580a,_0x1d5330,_0x1cb0f8,_0x49f69e){logger[_0x96cf('0xc')]('Creating\x20new\x20ticket...');var _0x21213d=new Date();var _0x561564=[{'name':_0x96cf('0xd'),'value':intUtil['getString'](_0x5689b9['Subjects'],_0x5d580a,'\x20')},{'name':_0x96cf('0xe'),'value':_0x7c304b['id']},{'name':'created_by','value':_0x7c304b['id']},{'name':_0x96cf('0xf'),'value':intUtil[_0x96cf('0x10')](_0x5689b9[_0x96cf('0x11')],_0x5d580a,'\x0a')},{'name':_0x96cf('0x12'),'value':_0x21213d[_0x96cf('0x13')]()['slice'](0x0,0x13)['replace']('T','\x20')},{'name':_0x96cf('0x14'),'value':'0'},{'name':_0x96cf('0x15'),'value':'15'},{'name':_0x96cf('0x16'),'value':_0x4b6202['id']},{'name':_0x96cf('0x17'),'value':_0x96cf('0x18')},{'name':_0x96cf('0x19'),'value':_0x4b6202[_0x96cf('0xd')]},{'name':_0x96cf('0x1a'),'value':_0x49f69e}];if(_0x1d5330['length']){_['forEach'](_0x1d5330,function(_0x4d6688){if(_0x5d580a[_0x4d6688[_0x96cf('0x1b')]]){_0x561564[_0x96cf('0x1c')]({'name':_0x4d6688[_0x96cf('0x1d')],'value':_0x5d580a[_0x4d6688[_0x96cf('0x1b')]]});}});}return request({'form':{'method':_0x96cf('0x1e'),'input_type':_0x96cf('0x1f'),'response_type':_0x96cf('0x1f'),'rest_data':JSON[_0x96cf('0x20')]({'session':_0x1cb0f8['id'],'module_name':_0x96cf('0x21'),'name_value_list':_0x561564})}});}function getAuth(_0x5544bf){return util[_0x96cf('0x22')](_0x96cf('0x23'),new Buffer(_0x5544bf[_0x96cf('0x24')]+':X')[_0x96cf('0x25')](_0x96cf('0x26')));}function getServerInfo(_0x1f06d1){return request({'form':{'method':'get_server_info','input_type':'JSON','response_type':_0x96cf('0x1f'),'rest_data':JSON[_0x96cf('0x20')]({'session':_0x1f06d1['id']})}});}function getUser(_0x52ceca,_0x424300,_0x427e2e){if(!_[_0x96cf('0x27')](_0x424300)){logger[_0x96cf('0xc')](_0x96cf('0x28'),_0x424300);return request({'form':{'method':_0x96cf('0x29'),'input_type':_0x96cf('0x1f'),'response_type':_0x96cf('0x1f'),'rest_data':JSON[_0x96cf('0x20')]({'session':_0x427e2e['id'],'module_name':_0x96cf('0x2a'),'query':util['format'](_0x96cf('0x2b'),_0x424300),'order_by':'','offset':'0','select_fields':['id',_0x96cf('0xd'),'user_name'],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})['then'](function(_0x442177){if(_0x442177[_0x96cf('0x2c')][_0x96cf('0x2d')]){var _0x4a1bfb=_[_0x96cf('0x2e')](_0x442177[_0x96cf('0x2c')],function(_0x5aa41e){return _0x5aa41e[_0x96cf('0x2f')][_0x96cf('0x30')][_0x96cf('0x31')]===_0x424300;});if(_0x4a1bfb){logger[_0x96cf('0xc')](_0x96cf('0x32'));return BPromise['resolve']({'id':_0x4a1bfb[_0x96cf('0x2f')]['id'][_0x96cf('0x31')],'name':_0x4a1bfb[_0x96cf('0x2f')]['name'][_0x96cf('0x31')]});}}logger[_0x96cf('0xc')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return BPromise['resolve']({'id':_0x427e2e[_0x96cf('0x2f')][_0x96cf('0x33')][_0x96cf('0x31')],'name':_0x427e2e[_0x96cf('0x2f')][_0x96cf('0x30')][_0x96cf('0x31')]});});}else{logger['info'](_0x96cf('0x34'));return BPromise[_0x96cf('0x35')]({'id':_0x427e2e['name_value_list'][_0x96cf('0x33')][_0x96cf('0x31')],'name':_0x427e2e[_0x96cf('0x2f')]['user_name'][_0x96cf('0x31')]});}}function getEndUser(_0x5b7200,_0x23ba6e,_0x249498,_0x71be50){logger[_0x96cf('0xc')](_0x96cf('0x36'),_0x249498);return request({'form':{'method':'get_entry_list','input_type':'JSON','response_type':_0x96cf('0x1f'),'rest_data':JSON[_0x96cf('0x20')]({'session':_0x71be50['id'],'module_name':_0x96cf('0x18'),'query':util[_0x96cf('0x22')](_0x96cf('0x37'),_0x249498),'order_by':'','offset':'0','select_fields':['id','name',_0x96cf('0x38')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x96cf('0x39')](function(_0xc0656a){if(_0xc0656a[_0x96cf('0x2c')][_0x96cf('0x2d')]){var _0x34982d=_['find'](_0xc0656a[_0x96cf('0x2c')],function(_0x219a6d){return _0x219a6d[_0x96cf('0x2f')]['phone_home']['value']===_0x249498;});if(_0x34982d){logger[_0x96cf('0xc')]('Enduser\x20found!');return BPromise[_0x96cf('0x35')]({'id':_0x34982d[_0x96cf('0x2f')]['id'][_0x96cf('0x31')],'name':_0x34982d[_0x96cf('0x2f')][_0x96cf('0xd')]['value'],'phone':_0x34982d[_0x96cf('0x2f')][_0x96cf('0x38')][_0x96cf('0x31')]});}}else{logger[_0x96cf('0xc')]('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'form':{'method':_0x96cf('0x1e'),'input_type':_0x96cf('0x1f'),'response_type':_0x96cf('0x1f'),'rest_data':JSON['stringify']({'session':_0x71be50['id'],'module_name':_0x96cf('0x18'),'name_value_list':[{'name':_0x96cf('0x3a'),'value':_0x23ba6e!==_0x96cf('0x3b')?_0x23ba6e:util[_0x96cf('0x22')](_0x96cf('0x3c'),_0x249498)},{'name':_0x96cf('0x38'),'value':_0x249498}]})}})['then'](function(_0x47c6a5){logger[_0x96cf('0xc')]('Enduser\x20created.');return BPromise[_0x96cf('0x35')]({'id':_0x47c6a5['id'],'name':_0x47c6a5[_0x96cf('0x2c')][_0x96cf('0x3a')][_0x96cf('0x31')],'phone':_0x47c6a5[_0x96cf('0x2c')][_0x96cf('0x38')]['value']});});}});}function request(_0x3b50e1){logger[_0x96cf('0x3d')](_0x96cf('0x3e'),JSON['stringify'](_0x3b50e1));return rp(_[_0x96cf('0x3f')](def,_0x3b50e1));}function getTags(_0x47ef7d,_0x11d168){var _0xcb0d7e=[];if(_0x47ef7d&&_0x47ef7d[_0x96cf('0x2d')]>0x0){_0xcb0d7e=_['map'](_0x47ef7d,_0x11d168);}return _0xcb0d7e;}function getCustomFields(_0x21192b,_0xfc79cb){var _0x3185fa=[];var _0x4e9b2b={'custom_fields':[]};if(_0x21192b[_0x96cf('0x2d')]>0x0){_['forEach'](_0x21192b,function(_0x59a27a){if(_0x59a27a[_0x96cf('0x40')]===_0x96cf('0x41')&&_0x59a27a['nameField']&&!_0x59a27a[_0x96cf('0x42')]){_0x4e9b2b[_0x59a27a['nameField'][_0x96cf('0x43')]()]=_0x59a27a[_0x96cf('0x44')]['toString']();}else if(_0x59a27a[_0x96cf('0x40')]==='string'&&_0x59a27a['idField']&&_0x59a27a[_0x96cf('0x42')]){_0x4e9b2b[_0x96cf('0x45')][_0x96cf('0x1c')]({'id':_0x59a27a[_0x96cf('0x1d')],'value':_0x59a27a[_0x96cf('0x44')][_0x96cf('0x25')]()});}else if(_0x59a27a[_0x96cf('0x40')]==='variable'&&_0x59a27a[_0x96cf('0x1b')]&&_0x59a27a[_0x96cf('0x1d')]&&_0x59a27a[_0x96cf('0x42')]){_0xfc79cb[_0x59a27a[_0x96cf('0x1b')]]&&_0x4e9b2b['custom_fields']['push']({'id':_0x59a27a['idField'],'value':_0xfc79cb[_0x59a27a[_0x96cf('0x1b')]][_0x96cf('0x25')]()});}else if(_0x59a27a[_0x96cf('0x40')]==='customVariable'&&_0x59a27a[_0x96cf('0x46')]&&_0x59a27a[_0x96cf('0x46')][_0x96cf('0xd')]&&_0x59a27a['idField']&&_0x59a27a['customField']){_0xfc79cb[_0x59a27a['Variable'][_0x96cf('0xd')][_0x96cf('0x43')]()]&&_0x4e9b2b['custom_fields']['push']({'id':_0x59a27a['idField'],'value':_0xfc79cb[_0x59a27a[_0x96cf('0x46')][_0x96cf('0xd')][_0x96cf('0x43')]()][_0x96cf('0x25')]()});}});}return _0x4e9b2b;}function getConnection(_0x86b3d2){return request({'method':_0x96cf('0xa'),'form':{'method':'login','input_type':_0x96cf('0x1f'),'response_type':_0x96cf('0x1f'),'rest_data':JSON[_0x96cf('0x20')]({'user_auth':{'user_name':_0x86b3d2[_0x96cf('0x47')],'password':_0x86b3d2['password'],'encryption':_0x96cf('0x48')},'application':_0x96cf('0x49')})}})['then'](function(_0x3c7ca1){var _0xa5b1ff=_0x3c7ca1;if(_0xa5b1ff['id']){def[_0x96cf('0x4a')]=_0xa5b1ff['id'];return BPromise[_0x96cf('0x35')](_0xa5b1ff);}else{throw new Error(util[_0x96cf('0x22')](_0x96cf('0x4b'),_0x86b3d2['id']));}});}function setRelationship(_0x5d4633,_0x1d0294,_0x3aa106,_0x201744){return request({'form':{'method':'set_relationship','input_type':_0x96cf('0x1f'),'response_type':'JSON','rest_data':JSON[_0x96cf('0x20')]({'session':_0x5d4633['id'],'module_name':_0x96cf('0x21'),'module_id':_0x3aa106['id'],'link_field_name':_0x201744,'related_ids':[_0x1d0294['id']],'name_value_list':[],'delete':0x0})}});}exports['queue']=function(_0x2c5224,_0x83510c,_0x21020c,_0x8c5f12,_0x565954,_0x2f0a67){var _0x40b4e5,_0x6babc6,_0x4d4591,_0x2bd187;_0x2f0a67[_0x96cf('0x4c')]=intUtil[_0x96cf('0x4d')](_0x2f0a67['remoteUri']);_0x2f0a67[_0x96cf('0x4e')]=intUtil['stripTrailingSlash'](_0x2f0a67[_0x96cf('0x4e')]);def[_0x96cf('0x4f')]=util[_0x96cf('0x22')](_0x96cf('0x50'),_0x2f0a67[_0x96cf('0x4c')]);if(_0x565954&&_0x565954[_0x96cf('0x51')]){logger[_0x96cf('0xc')](_0x96cf('0x52'),_0x96cf('0x53'));_0x83510c[_0x96cf('0x54')]=util[_0x96cf('0x22')](_0x96cf('0x55'),_0x2f0a67[_0x96cf('0x4e')],_0x83510c[_0x96cf('0x56')],md5(_0x83510c[_0x96cf('0x56')]));}else{_0x83510c['recordingURL']='';}return getConnection(_0x2f0a67)[_0x96cf('0x39')](function(_0x37c987){_0x2bd187=_0x37c987;return getUser(_0x2f0a67,_0x8c5f12['name'],_0x2bd187);})['then'](function(_0x487ace){_0x40b4e5=_0x487ace;logger[_0x96cf('0xc')](_0x96cf('0x57'),_0x40b4e5['id']);return getEndUser(_0x2f0a67,_0x83510c[_0x96cf('0x58')],_0x83510c['calleridnum'],_0x2bd187);})[_0x96cf('0x39')](function(_0x53881d){_0x6babc6=_0x53881d;logger['info'](_0x96cf('0x59'),_0x6babc6['id']);return getTicket(_0x2f0a67,_0x40b4e5,_0x6babc6,_0x21020c,_0x83510c,_0x21020c[_0x96cf('0x5a')],_0x2bd187,_0x96cf('0x5b'));})[_0x96cf('0x39')](function(_0x23fb1d){_0x4d4591=_0x23fb1d;logger['info'](_0x96cf('0x5c'));logger['info'](_0x96cf('0x5d'),_0x4d4591['id']);return setRelationship(_0x2bd187,_0x40b4e5,_0x4d4591,_0x96cf('0x5e'));})[_0x96cf('0x39')](function(){return setRelationship(_0x2bd187,_0x6babc6,_0x4d4591,_0x96cf('0x5f'));})[_0x96cf('0x39')](function(){return getServerInfo(_0x2bd187);})['then'](function(_0xe04010){var _0x5cb4df=parseInt(_0xe04010['version'][_0x96cf('0x60')](0x0));var _0x1071ad=util[_0x96cf('0x22')](_0x96cf('0x61'),_0x2f0a67[_0x96cf('0x4c')],_0x4d4591['id']);if(_0x5cb4df>0x6){_0x1071ad=util[_0x96cf('0x22')](_0x96cf('0x62'),_0x2f0a67['remoteUri'],_0x4d4591['id']);}logger[_0x96cf('0xc')](_0x96cf('0x52'),_0x96cf('0x63'));emit(util[_0x96cf('0x22')](_0x96cf('0x64'),_0x8c5f12['name']),_0x96cf('0x65'),{'uri':_0x1071ad});})[_0x96cf('0x66')](function(_0x5174be){logger[_0x96cf('0x67')]('[QUEUE]',JSON[_0x96cf('0x20')](_0x5174be));});};exports[_0x96cf('0x68')]=function(_0x413db8,_0x35201d,_0x5b75f6,_0x323260,_0x5beb61,_0x530830,_0x1d2984){var _0x1d2024,_0x499a3d,_0x1a68b0,_0x16dd7b;_0x530830['remoteUri']=intUtil[_0x96cf('0x4d')](_0x530830['remoteUri']);_0x530830['serverUrl']=intUtil['stripTrailingSlash'](_0x530830[_0x96cf('0x4e')]);def[_0x96cf('0x4f')]=util[_0x96cf('0x22')](_0x96cf('0x50'),_0x530830['remoteUri']);if(_0x1d2984&&_0x1d2984['recordingFormat']&&_0x1d2984[_0x96cf('0x69')]!==_0x96cf('0x6a')){logger['info']('[OUTBOUND]',_0x96cf('0x53'));_0x35201d[_0x96cf('0x54')]=util['format'](_0x96cf('0x55'),_0x530830[_0x96cf('0x4e')],_0x35201d[_0x96cf('0x56')],md5(_0x35201d[_0x96cf('0x56')]));}return getConnection(_0x530830)['then'](function(_0x172cac){_0x16dd7b=_0x172cac;return getUser(_0x530830,_0x323260[_0x96cf('0xd')],_0x16dd7b);})[_0x96cf('0x39')](function(_0xa22097){_0x1d2024=_0xa22097;logger[_0x96cf('0xc')](_0x96cf('0x57'),_0x1d2024['id']);return getEndUser(_0x530830,_0x35201d[_0x96cf('0x6b')],_0x35201d[_0x96cf('0x6c')],_0x16dd7b);})[_0x96cf('0x39')](function(_0x566713){_0x499a3d=_0x566713;logger[_0x96cf('0xc')](_0x96cf('0x59'),_0x499a3d['id']);return getTicket(_0x530830,_0x1d2024,_0x499a3d,_0x5b75f6,_0x35201d,_0x5b75f6[_0x96cf('0x5a')],_0x16dd7b,_0x96cf('0x6d'));})['then'](function(_0x100aa2){_0x1a68b0=_0x100aa2;logger[_0x96cf('0xc')](_0x96cf('0x5c'));logger[_0x96cf('0xc')](_0x96cf('0x5d'),_0x1a68b0['id']);return setRelationship(_0x16dd7b,_0x1d2024,_0x1a68b0,_0x96cf('0x5e'));})['then'](function(){return setRelationship(_0x16dd7b,_0x499a3d,_0x1a68b0,_0x96cf('0x5f'));})[_0x96cf('0x39')](function(){return getServerInfo(_0x16dd7b);})['then'](function(_0x2756f9){var _0x1f9c41=parseInt(_0x2756f9[_0x96cf('0x6e')][_0x96cf('0x60')](0x0));var _0x4403a5=util[_0x96cf('0x22')](_0x96cf('0x61'),_0x530830[_0x96cf('0x4c')],_0x1a68b0['id']);if(_0x1f9c41>0x6){_0x4403a5=util[_0x96cf('0x22')](_0x96cf('0x62'),_0x530830[_0x96cf('0x4c')],_0x1a68b0['id']);}logger[_0x96cf('0xc')](_0x96cf('0x6f'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x96cf('0x22')](_0x96cf('0x64'),_0x323260['name']),_0x96cf('0x65'),{'uri':_0x4403a5});})[_0x96cf('0x66')](function(_0x1cfa50){logger[_0x96cf('0x67')]('[OUTBOUND]',JSON[_0x96cf('0x20')](_0x1cfa50));});};exports[_0x96cf('0x70')]=function(_0x1281d2,_0x1f0704,_0x39115f,_0x1d66b1,_0x447f58,_0x1f0ff3){var _0xd8375a,_0x5bcd89,_0x56659b,_0x3ad761;_0x1f0ff3[_0x96cf('0x4c')]=intUtil[_0x96cf('0x4d')](_0x1f0ff3['remoteUri']);_0x1f0ff3[_0x96cf('0x4e')]=intUtil[_0x96cf('0x4d')](_0x1f0ff3[_0x96cf('0x4e')]);def[_0x96cf('0x4f')]=util[_0x96cf('0x22')]('%s/service/v4_1/rest.php',_0x1f0ff3[_0x96cf('0x4c')]);if(_0x447f58&&_0x447f58[_0x96cf('0x51')]){logger[_0x96cf('0xc')]('['+_0x1f0704[_0x96cf('0x71')]['toUpperCase']()+']',_0x96cf('0x53'));_0x1f0704['recordingURL']=util[_0x96cf('0x22')](_0x96cf('0x55'),_0x1f0ff3[_0x96cf('0x4e')],_0x1f0704['uniqueid'],md5(_0x1f0704['uniqueid']));}else{_0x1f0704[_0x96cf('0x54')]='';}return getConnection(_0x1f0ff3)[_0x96cf('0x39')](function(_0x3244a4){_0x3ad761=_0x3244a4;if(!_[_0x96cf('0x27')](_0x1d66b1)){return getUser(_0x1f0ff3,_0x1d66b1[_0x96cf('0xd')],_0x3ad761);}else{return getUser(_0x1f0ff3,null,_0x3ad761);}})[_0x96cf('0x39')](function(_0x5028d5){_0xd8375a=_0x5028d5;logger[_0x96cf('0xc')](_0x96cf('0x57'),_0xd8375a['id']);return getEndUser(_0x1f0ff3,_0x1f0704[_0x96cf('0x58')],_0x1f0704[_0x96cf('0x72')],_0x3ad761);})[_0x96cf('0x39')](function(_0x27618a){_0x5bcd89=_0x27618a;logger['info'](_0x96cf('0x59'),_0x5bcd89['id']);return getTicket(_0x1f0ff3,_0xd8375a,_0x5bcd89,_0x39115f,_0x1f0704,_0x39115f[_0x96cf('0x5a')],_0x3ad761,'Inbound');})[_0x96cf('0x39')](function(_0xf2f4d3){_0x56659b=_0xf2f4d3;logger[_0x96cf('0xc')](_0x96cf('0x5c'));logger[_0x96cf('0xc')]('The\x20Ticket\x20ID\x20is:',_0x56659b['id']);return setRelationship(_0x3ad761,_0xd8375a,_0x56659b,_0x96cf('0x5e'));})['then'](function(){return setRelationship(_0x3ad761,_0x5bcd89,_0x56659b,'contacts');})[_0x96cf('0x39')](function(){return getServerInfo(_0x3ad761);})['catch'](function(_0x45e4bc){logger[_0x96cf('0x67')]('['+_0x1f0704['lastevent']['toUpperCase']()+']',JSON[_0x96cf('0x20')](_0x45e4bc));});}; \ No newline at end of file +var _0x4b3f=['uniqueid','The\x20User\x20ID\x20is:','calleridnum','The\x20Enduser\x20ID\x20is:','Fields','Inbound','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','users','contacts','version','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s','%s/#bwc/index.php?module=Calls&action=EditView&record=%s','user:%s','trigger:browser:url','catch','error','outbound','uri','%s/service/v4_1/rest.php','recordingFormat','none','[OUTBOUND]','destcalleridnum','Outbound','unmanaged','lastevent','toUpperCase','calleridname','request-promise','bluebird','md5','util','ioredis','./util','../../../../config/environment','../../../../config/logger','sugarcrm','redis','defaults','socket.io-emitter','emit','info','Creating\x20new\x20ticket...','name','getString','created_by','description','toISOString','duration_hours','parent_type','Contacts','length','forEach','variableName','idField','set_entry','stringify','Calls','format','Basic\x20%s','base64','JSON','isNil','Getting\x20agent\x20with\x20name','get_entry_list','Employees','INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200','user_name','then','entry_list','find','value','Agent\x20found!','name_value_list','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','resolve','user_id','Searching\x20enduser\x20with\x20phone','contacts.phone_home\x20=\x20\x22%s\x22','Enduser\x20found!','phone_home','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','first_name','','Enduser\x20created.','debug','merge','type','string','nameField','toLowerCase','content','toString','customField','custom_fields','push','variable','customVariable','Variable','POST','username','password','PLAIN','xCALLY\x20Motion\x20integration','Account\x20%d\x20is\x20not\x20valid','set_relationship','remoteUri','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s'];(function(_0x1976f5,_0x322aee){var _0x31975e=function(_0x179b34){while(--_0x179b34){_0x1976f5['push'](_0x1976f5['shift']());}};_0x31975e(++_0x322aee);}(_0x4b3f,0x1e9));var _0xf4b3=function(_0x3060a8,_0xe80146){_0x3060a8=_0x3060a8-0x0;var _0x3481bf=_0x4b3f[_0x3060a8];return _0x3481bf;};'use strict';var _=require('lodash');var rp=require(_0xf4b3('0x0'));var BPromise=require(_0xf4b3('0x1'));var md5=require(_0xf4b3('0x2'));var util=require(_0xf4b3('0x3'));var Redis=require(_0xf4b3('0x4'));var intUtil=require(_0xf4b3('0x5'));var config=require(_0xf4b3('0x6'));var logger=require(_0xf4b3('0x7'))(_0xf4b3('0x8'));config[_0xf4b3('0x9')]=_[_0xf4b3('0xa')](config[_0xf4b3('0x9')],{'host':'localhost','port':0x18eb});var io=require(_0xf4b3('0xb'))(new Redis(config[_0xf4b3('0x9')]));var def={'method':'POST','json':!![]};function emit(_0x3dff71,_0x4de924,_0x2d3fed){io['to'](_0x3dff71)[_0xf4b3('0xc')](_0x4de924,_0x2d3fed);}function getTicket(_0x2fb84a,_0x1484ea,_0x1e76f0,_0x998e48,_0x14fcfd,_0x358606,_0x13d693,_0xd01a7b){logger[_0xf4b3('0xd')](_0xf4b3('0xe'));var _0x280e69=new Date();var _0xc677fe=[{'name':_0xf4b3('0xf'),'value':intUtil[_0xf4b3('0x10')](_0x998e48['Subjects'],_0x14fcfd,'\x20')},{'name':'assigned_user_id','value':_0x1484ea['id']},{'name':_0xf4b3('0x11'),'value':_0x1484ea['id']},{'name':_0xf4b3('0x12'),'value':intUtil[_0xf4b3('0x10')](_0x998e48['Descriptions'],_0x14fcfd,'\x0a')},{'name':'date_start','value':_0x280e69[_0xf4b3('0x13')]()['slice'](0x0,0x13)['replace']('T','\x20')},{'name':_0xf4b3('0x14'),'value':'0'},{'name':'duration_minutes','value':'15'},{'name':'parent_id','value':_0x1e76f0['id']},{'name':_0xf4b3('0x15'),'value':_0xf4b3('0x16')},{'name':'parent_name','value':_0x1e76f0['name']},{'name':'direction','value':_0xd01a7b}];if(_0x358606[_0xf4b3('0x17')]){_[_0xf4b3('0x18')](_0x358606,function(_0x5e87b0){if(_0x14fcfd[_0x5e87b0[_0xf4b3('0x19')]]){_0xc677fe['push']({'name':_0x5e87b0[_0xf4b3('0x1a')],'value':_0x14fcfd[_0x5e87b0[_0xf4b3('0x19')]]});}});}return request({'form':{'method':_0xf4b3('0x1b'),'input_type':'JSON','response_type':'JSON','rest_data':JSON[_0xf4b3('0x1c')]({'session':_0x13d693['id'],'module_name':_0xf4b3('0x1d'),'name_value_list':_0xc677fe})}});}function getAuth(_0x5a4823){return util[_0xf4b3('0x1e')](_0xf4b3('0x1f'),new Buffer(_0x5a4823['apiKey']+':X')['toString'](_0xf4b3('0x20')));}function getServerInfo(_0xda8f4c){return request({'form':{'method':'get_server_info','input_type':'JSON','response_type':_0xf4b3('0x21'),'rest_data':JSON[_0xf4b3('0x1c')]({'session':_0xda8f4c['id']})}});}function getUser(_0x457697,_0x133b26,_0x4c129b){if(!_[_0xf4b3('0x22')](_0x133b26)){logger[_0xf4b3('0xd')](_0xf4b3('0x23'),_0x133b26);return request({'form':{'method':_0xf4b3('0x24'),'input_type':_0xf4b3('0x21'),'response_type':_0xf4b3('0x21'),'rest_data':JSON[_0xf4b3('0x1c')]({'session':_0x4c129b['id'],'module_name':_0xf4b3('0x25'),'query':util[_0xf4b3('0x1e')](_0xf4b3('0x26'),_0x133b26),'order_by':'','offset':'0','select_fields':['id',_0xf4b3('0xf'),_0xf4b3('0x27')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0xf4b3('0x28')](function(_0x5b7894){if(_0x5b7894[_0xf4b3('0x29')][_0xf4b3('0x17')]){var _0x1974c7=_[_0xf4b3('0x2a')](_0x5b7894['entry_list'],function(_0x35cc75){return _0x35cc75['name_value_list']['user_name'][_0xf4b3('0x2b')]===_0x133b26;});if(_0x1974c7){logger[_0xf4b3('0xd')](_0xf4b3('0x2c'));return BPromise['resolve']({'id':_0x1974c7[_0xf4b3('0x2d')]['id'][_0xf4b3('0x2b')],'name':_0x1974c7[_0xf4b3('0x2d')][_0xf4b3('0xf')][_0xf4b3('0x2b')]});}}logger[_0xf4b3('0xd')](_0xf4b3('0x2e'));return BPromise[_0xf4b3('0x2f')]({'id':_0x4c129b['name_value_list'][_0xf4b3('0x30')][_0xf4b3('0x2b')],'name':_0x4c129b['name_value_list'][_0xf4b3('0x27')][_0xf4b3('0x2b')]});});}else{logger['info']('Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!');return BPromise[_0xf4b3('0x2f')]({'id':_0x4c129b[_0xf4b3('0x2d')][_0xf4b3('0x30')][_0xf4b3('0x2b')],'name':_0x4c129b[_0xf4b3('0x2d')][_0xf4b3('0x27')][_0xf4b3('0x2b')]});}}function getEndUser(_0x1baa1c,_0x4cf406,_0x8679c2,_0x6eeb69){logger[_0xf4b3('0xd')](_0xf4b3('0x31'),_0x8679c2);return request({'form':{'method':_0xf4b3('0x24'),'input_type':_0xf4b3('0x21'),'response_type':'JSON','rest_data':JSON[_0xf4b3('0x1c')]({'session':_0x6eeb69['id'],'module_name':_0xf4b3('0x16'),'query':util[_0xf4b3('0x1e')](_0xf4b3('0x32'),_0x8679c2),'order_by':'','offset':'0','select_fields':['id',_0xf4b3('0xf'),'phone_home'],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})['then'](function(_0x21e1e6){if(_0x21e1e6[_0xf4b3('0x29')][_0xf4b3('0x17')]){var _0x478526=_[_0xf4b3('0x2a')](_0x21e1e6['entry_list'],function(_0x3ce42c){return _0x3ce42c[_0xf4b3('0x2d')]['phone_home'][_0xf4b3('0x2b')]===_0x8679c2;});if(_0x478526){logger[_0xf4b3('0xd')](_0xf4b3('0x33'));return BPromise[_0xf4b3('0x2f')]({'id':_0x478526[_0xf4b3('0x2d')]['id']['value'],'name':_0x478526[_0xf4b3('0x2d')][_0xf4b3('0xf')][_0xf4b3('0x2b')],'phone':_0x478526[_0xf4b3('0x2d')][_0xf4b3('0x34')][_0xf4b3('0x2b')]});}}else{logger[_0xf4b3('0xd')](_0xf4b3('0x35'));return request({'form':{'method':_0xf4b3('0x1b'),'input_type':'JSON','response_type':_0xf4b3('0x21'),'rest_data':JSON[_0xf4b3('0x1c')]({'session':_0x6eeb69['id'],'module_name':'Contacts','name_value_list':[{'name':_0xf4b3('0x36'),'value':_0x4cf406!==_0xf4b3('0x37')?_0x4cf406:util[_0xf4b3('0x1e')]('Caller\x20-\x20%s',_0x8679c2)},{'name':'phone_home','value':_0x8679c2}]})}})[_0xf4b3('0x28')](function(_0x3ce8be){logger[_0xf4b3('0xd')](_0xf4b3('0x38'));return BPromise['resolve']({'id':_0x3ce8be['id'],'name':_0x3ce8be[_0xf4b3('0x29')][_0xf4b3('0x36')]['value'],'phone':_0x3ce8be['entry_list'][_0xf4b3('0x34')][_0xf4b3('0x2b')]});});}});}function request(_0x3e6607){logger[_0xf4b3('0x39')]('[HTTP]',JSON['stringify'](_0x3e6607));return rp(_[_0xf4b3('0x3a')](def,_0x3e6607));}function getTags(_0x3593d5,_0x15e3d6){var _0x14c9c0=[];if(_0x3593d5&&_0x3593d5[_0xf4b3('0x17')]>0x0){_0x14c9c0=_['map'](_0x3593d5,_0x15e3d6);}return _0x14c9c0;}function getCustomFields(_0x4ec851,_0x56c1d1){var _0x38669a=[];var _0x5d2155={'custom_fields':[]};if(_0x4ec851[_0xf4b3('0x17')]>0x0){_[_0xf4b3('0x18')](_0x4ec851,function(_0x168b02){if(_0x168b02[_0xf4b3('0x3b')]===_0xf4b3('0x3c')&&_0x168b02['nameField']&&!_0x168b02['customField']){_0x5d2155[_0x168b02[_0xf4b3('0x3d')][_0xf4b3('0x3e')]()]=_0x168b02[_0xf4b3('0x3f')][_0xf4b3('0x40')]();}else if(_0x168b02['type']==='string'&&_0x168b02[_0xf4b3('0x1a')]&&_0x168b02[_0xf4b3('0x41')]){_0x5d2155[_0xf4b3('0x42')][_0xf4b3('0x43')]({'id':_0x168b02[_0xf4b3('0x1a')],'value':_0x168b02['content'][_0xf4b3('0x40')]()});}else if(_0x168b02[_0xf4b3('0x3b')]===_0xf4b3('0x44')&&_0x168b02[_0xf4b3('0x19')]&&_0x168b02['idField']&&_0x168b02[_0xf4b3('0x41')]){_0x56c1d1[_0x168b02[_0xf4b3('0x19')]]&&_0x5d2155[_0xf4b3('0x42')][_0xf4b3('0x43')]({'id':_0x168b02[_0xf4b3('0x1a')],'value':_0x56c1d1[_0x168b02[_0xf4b3('0x19')]][_0xf4b3('0x40')]()});}else if(_0x168b02[_0xf4b3('0x3b')]===_0xf4b3('0x45')&&_0x168b02['Variable']&&_0x168b02[_0xf4b3('0x46')]['name']&&_0x168b02['idField']&&_0x168b02[_0xf4b3('0x41')]){_0x56c1d1[_0x168b02[_0xf4b3('0x46')][_0xf4b3('0xf')][_0xf4b3('0x3e')]()]&&_0x5d2155[_0xf4b3('0x42')][_0xf4b3('0x43')]({'id':_0x168b02[_0xf4b3('0x1a')],'value':_0x56c1d1[_0x168b02['Variable'][_0xf4b3('0xf')][_0xf4b3('0x3e')]()][_0xf4b3('0x40')]()});}});}return _0x5d2155;}function getConnection(_0x564f5f){return request({'method':_0xf4b3('0x47'),'form':{'method':'login','input_type':'JSON','response_type':_0xf4b3('0x21'),'rest_data':JSON[_0xf4b3('0x1c')]({'user_auth':{'user_name':_0x564f5f[_0xf4b3('0x48')],'password':_0x564f5f[_0xf4b3('0x49')],'encryption':_0xf4b3('0x4a')},'application':_0xf4b3('0x4b')})}})[_0xf4b3('0x28')](function(_0x4e62a5){var _0x11bc2a=_0x4e62a5;if(_0x11bc2a['id']){def['sessionID']=_0x11bc2a['id'];return BPromise[_0xf4b3('0x2f')](_0x11bc2a);}else{throw new Error(util[_0xf4b3('0x1e')](_0xf4b3('0x4c'),_0x564f5f['id']));}});}function setRelationship(_0x2b8a69,_0xf76e8c,_0x4811ac,_0x2fb182){return request({'form':{'method':_0xf4b3('0x4d'),'input_type':_0xf4b3('0x21'),'response_type':_0xf4b3('0x21'),'rest_data':JSON[_0xf4b3('0x1c')]({'session':_0x2b8a69['id'],'module_name':_0xf4b3('0x1d'),'module_id':_0x4811ac['id'],'link_field_name':_0x2fb182,'related_ids':[_0xf76e8c['id']],'name_value_list':[],'delete':0x0})}});}exports['queue']=function(_0x44ec5d,_0x587655,_0x46c6df,_0x2147e6,_0x3d9cf1,_0x13c476){var _0x55a656,_0xf59de5,_0x173442,_0x4730ef;_0x13c476[_0xf4b3('0x4e')]=intUtil[_0xf4b3('0x4f')](_0x13c476[_0xf4b3('0x4e')]);_0x13c476[_0xf4b3('0x50')]=intUtil['stripTrailingSlash'](_0x13c476[_0xf4b3('0x50')]);def['uri']=util[_0xf4b3('0x1e')]('%s/service/v4_1/rest.php',_0x13c476[_0xf4b3('0x4e')]);if(_0x3d9cf1&&_0x3d9cf1[_0xf4b3('0x51')]){logger[_0xf4b3('0xd')](_0xf4b3('0x52'),_0xf4b3('0x53'));_0x587655[_0xf4b3('0x54')]=util[_0xf4b3('0x1e')](_0xf4b3('0x55'),_0x13c476[_0xf4b3('0x50')],_0x587655[_0xf4b3('0x56')],md5(_0x587655['uniqueid']));}else{_0x587655['recordingURL']='';}return getConnection(_0x13c476)[_0xf4b3('0x28')](function(_0x128b67){_0x4730ef=_0x128b67;return getUser(_0x13c476,_0x2147e6['name'],_0x4730ef);})['then'](function(_0x2f789f){_0x55a656=_0x2f789f;logger[_0xf4b3('0xd')](_0xf4b3('0x57'),_0x55a656['id']);return getEndUser(_0x13c476,_0x587655['calleridname'],_0x587655[_0xf4b3('0x58')],_0x4730ef);})[_0xf4b3('0x28')](function(_0x15d572){_0xf59de5=_0x15d572;logger[_0xf4b3('0xd')](_0xf4b3('0x59'),_0xf59de5['id']);return getTicket(_0x13c476,_0x55a656,_0xf59de5,_0x46c6df,_0x587655,_0x46c6df[_0xf4b3('0x5a')],_0x4730ef,_0xf4b3('0x5b'));})[_0xf4b3('0x28')](function(_0x33569d){_0x173442=_0x33569d;logger['info'](_0xf4b3('0x5c'));logger[_0xf4b3('0xd')](_0xf4b3('0x5d'),_0x173442['id']);return setRelationship(_0x4730ef,_0x55a656,_0x173442,_0xf4b3('0x5e'));})[_0xf4b3('0x28')](function(){return setRelationship(_0x4730ef,_0xf59de5,_0x173442,_0xf4b3('0x5f'));})[_0xf4b3('0x28')](function(){return getServerInfo(_0x4730ef);})[_0xf4b3('0x28')](function(_0x4ed0eb){var _0x37ce5e=parseInt(_0x4ed0eb[_0xf4b3('0x60')]['charAt'](0x0));var _0x1a0774=util[_0xf4b3('0x1e')](_0xf4b3('0x61'),_0x13c476[_0xf4b3('0x4e')],_0x173442['id']);if(_0x37ce5e>0x6){_0x1a0774=util[_0xf4b3('0x1e')](_0xf4b3('0x62'),_0x13c476[_0xf4b3('0x4e')],_0x173442['id']);}logger[_0xf4b3('0xd')](_0xf4b3('0x52'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0xf4b3('0x1e')](_0xf4b3('0x63'),_0x2147e6[_0xf4b3('0xf')]),_0xf4b3('0x64'),{'uri':_0x1a0774});})[_0xf4b3('0x65')](function(_0x55661a){logger[_0xf4b3('0x66')](_0xf4b3('0x52'),JSON[_0xf4b3('0x1c')](_0x55661a));});};exports[_0xf4b3('0x67')]=function(_0x3659fa,_0x343c46,_0x1135ed,_0x1d75b5,_0x229c84,_0x752f4d,_0x4895bb){var _0x21ee7a,_0x3d8cbf,_0x4c9050,_0x30ae07;_0x752f4d[_0xf4b3('0x4e')]=intUtil['stripTrailingSlash'](_0x752f4d[_0xf4b3('0x4e')]);_0x752f4d[_0xf4b3('0x50')]=intUtil['stripTrailingSlash'](_0x752f4d[_0xf4b3('0x50')]);def[_0xf4b3('0x68')]=util[_0xf4b3('0x1e')](_0xf4b3('0x69'),_0x752f4d['remoteUri']);if(_0x4895bb&&_0x4895bb[_0xf4b3('0x6a')]&&_0x4895bb[_0xf4b3('0x6a')]!==_0xf4b3('0x6b')){logger[_0xf4b3('0xd')](_0xf4b3('0x6c'),_0xf4b3('0x53'));_0x343c46[_0xf4b3('0x54')]=util[_0xf4b3('0x1e')](_0xf4b3('0x55'),_0x752f4d[_0xf4b3('0x50')],_0x343c46['uniqueid'],md5(_0x343c46[_0xf4b3('0x56')]));}return getConnection(_0x752f4d)[_0xf4b3('0x28')](function(_0x2e23a1){_0x30ae07=_0x2e23a1;return getUser(_0x752f4d,_0x1d75b5[_0xf4b3('0xf')],_0x30ae07);})[_0xf4b3('0x28')](function(_0x331393){_0x21ee7a=_0x331393;logger[_0xf4b3('0xd')]('The\x20User\x20ID\x20is:',_0x21ee7a['id']);return getEndUser(_0x752f4d,_0x343c46['destcalleridname'],_0x343c46[_0xf4b3('0x6d')],_0x30ae07);})[_0xf4b3('0x28')](function(_0x134f7f){_0x3d8cbf=_0x134f7f;logger[_0xf4b3('0xd')](_0xf4b3('0x59'),_0x3d8cbf['id']);return getTicket(_0x752f4d,_0x21ee7a,_0x3d8cbf,_0x1135ed,_0x343c46,_0x1135ed[_0xf4b3('0x5a')],_0x30ae07,_0xf4b3('0x6e'));})[_0xf4b3('0x28')](function(_0x593733){_0x4c9050=_0x593733;logger['info'](_0xf4b3('0x5c'));logger['info']('The\x20Ticket\x20ID\x20is:',_0x4c9050['id']);return setRelationship(_0x30ae07,_0x21ee7a,_0x4c9050,'users');})[_0xf4b3('0x28')](function(){return setRelationship(_0x30ae07,_0x3d8cbf,_0x4c9050,_0xf4b3('0x5f'));})[_0xf4b3('0x28')](function(){return getServerInfo(_0x30ae07);})[_0xf4b3('0x28')](function(_0x5a1206){var _0x27a797=parseInt(_0x5a1206[_0xf4b3('0x60')]['charAt'](0x0));var _0x4c4168=util[_0xf4b3('0x1e')](_0xf4b3('0x61'),_0x752f4d['remoteUri'],_0x4c9050['id']);if(_0x27a797>0x6){_0x4c4168=util[_0xf4b3('0x1e')](_0xf4b3('0x62'),_0x752f4d[_0xf4b3('0x4e')],_0x4c9050['id']);}logger['info'](_0xf4b3('0x6c'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0xf4b3('0x1e')](_0xf4b3('0x63'),_0x1d75b5[_0xf4b3('0xf')]),'trigger:browser:url',{'uri':_0x4c4168});})[_0xf4b3('0x65')](function(_0x2f6118){logger['error']('[OUTBOUND]',JSON[_0xf4b3('0x1c')](_0x2f6118));});};exports[_0xf4b3('0x6f')]=function(_0x34cb56,_0x14a756,_0x242e7f,_0x17349f,_0x592150,_0x3d30c9){var _0x21354d,_0x4e718e,_0x17d069,_0x8a950c;_0x3d30c9['remoteUri']=intUtil[_0xf4b3('0x4f')](_0x3d30c9['remoteUri']);_0x3d30c9['serverUrl']=intUtil[_0xf4b3('0x4f')](_0x3d30c9[_0xf4b3('0x50')]);def[_0xf4b3('0x68')]=util[_0xf4b3('0x1e')](_0xf4b3('0x69'),_0x3d30c9[_0xf4b3('0x4e')]);if(_0x592150&&_0x592150['monitor_format']){logger[_0xf4b3('0xd')]('['+_0x14a756[_0xf4b3('0x70')][_0xf4b3('0x71')]()+']',_0xf4b3('0x53'));_0x14a756[_0xf4b3('0x54')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x3d30c9[_0xf4b3('0x50')],_0x14a756[_0xf4b3('0x56')],md5(_0x14a756[_0xf4b3('0x56')]));}else{_0x14a756[_0xf4b3('0x54')]='';}return getConnection(_0x3d30c9)[_0xf4b3('0x28')](function(_0x1acfc0){_0x8a950c=_0x1acfc0;if(!_[_0xf4b3('0x22')](_0x17349f)){return getUser(_0x3d30c9,_0x17349f[_0xf4b3('0xf')],_0x8a950c);}else{return getUser(_0x3d30c9,null,_0x8a950c);}})[_0xf4b3('0x28')](function(_0x558095){_0x21354d=_0x558095;logger['info'](_0xf4b3('0x57'),_0x21354d['id']);return getEndUser(_0x3d30c9,_0x14a756[_0xf4b3('0x72')],_0x14a756[_0xf4b3('0x58')],_0x8a950c);})[_0xf4b3('0x28')](function(_0x365fec){_0x4e718e=_0x365fec;logger['info'](_0xf4b3('0x59'),_0x4e718e['id']);return getTicket(_0x3d30c9,_0x21354d,_0x4e718e,_0x242e7f,_0x14a756,_0x242e7f[_0xf4b3('0x5a')],_0x8a950c,_0xf4b3('0x5b'));})['then'](function(_0x11c682){_0x17d069=_0x11c682;logger[_0xf4b3('0xd')](_0xf4b3('0x5c'));logger[_0xf4b3('0xd')](_0xf4b3('0x5d'),_0x17d069['id']);return setRelationship(_0x8a950c,_0x21354d,_0x17d069,_0xf4b3('0x5e'));})[_0xf4b3('0x28')](function(){return setRelationship(_0x8a950c,_0x4e718e,_0x17d069,_0xf4b3('0x5f'));})[_0xf4b3('0x28')](function(){return getServerInfo(_0x8a950c);})[_0xf4b3('0x65')](function(_0x3ff2ca){logger['error']('['+_0x14a756['lastevent']['toUpperCase']()+']',JSON[_0xf4b3('0x1c')](_0x3ff2ca));});}; \ 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 8e3b5c8..a9a7dad 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 _0xd9c9=['type','string','push','variable','variableName','customVariable','Variable','name','toLowerCase','toString','keyValue','keyType','key','format','%s:\x20%s','slice','substring','lastIndexOf','isNil','test','lodash','util','getString','length','sortBy'];(function(_0xa6df52,_0x1b8584){var _0x5edd57=function(_0x543f11){while(--_0x543f11){_0xa6df52['push'](_0xa6df52['shift']());}};_0x5edd57(++_0x1b8584);}(_0xd9c9,0x1ef));var _0x9d9c=function(_0x306106,_0x7dc50d){_0x306106=_0x306106-0x0;var _0x4d6083=_0xd9c9[_0x306106];return _0x4d6083;};'use strict';var _=require(_0x9d9c('0x0'));var util=require(_0x9d9c('0x1'));exports[_0x9d9c('0x2')]=function(_0x5caa78,_0x1bf2fc,_0x241f1e){var _0x102694=[];if(_0x5caa78[_0x9d9c('0x3')]>0x0){var _0x45fe8b=_[_0x9d9c('0x4')](_0x5caa78,['id']);for(var _0x4706cb=0x0;_0x4706cb<_0x45fe8b[_0x9d9c('0x3')];_0x4706cb++){var _0x50a5fc=_0x45fe8b[_0x4706cb];if(_0x50a5fc[_0x9d9c('0x5')]===_0x9d9c('0x6')){_0x102694[_0x9d9c('0x7')](_0x50a5fc['content']);}else if(_0x50a5fc[_0x9d9c('0x5')]===_0x9d9c('0x8')&&_0x50a5fc['variableName']){_0x1bf2fc[_0x50a5fc['variableName']]&&_0x102694[_0x9d9c('0x7')](_0x1bf2fc[_0x50a5fc[_0x9d9c('0x9')]]['toString']());}else if(_0x50a5fc['type']===_0x9d9c('0xa')&&_0x50a5fc[_0x9d9c('0xb')]&&_0x50a5fc[_0x9d9c('0xb')][_0x9d9c('0xc')]){_0x1bf2fc[_0x50a5fc['Variable'][_0x9d9c('0xc')][_0x9d9c('0xd')]()]&&_0x102694[_0x9d9c('0x7')](_0x1bf2fc[_0x50a5fc[_0x9d9c('0xb')][_0x9d9c('0xc')][_0x9d9c('0xd')]()][_0x9d9c('0xe')]());}else if(_0x50a5fc[_0x9d9c('0x5')]===_0x9d9c('0xf')){if(_0x50a5fc[_0x9d9c('0x10')]===_0x9d9c('0x6')&&_0x50a5fc[_0x9d9c('0x11')]){_0x102694[_0x9d9c('0x7')](util[_0x9d9c('0x12')]('%s:\x20%s',_0x50a5fc[_0x9d9c('0x11')],_0x50a5fc['keyContent']));}else if(_0x50a5fc[_0x9d9c('0x10')]===_0x9d9c('0x8')&&_0x50a5fc['variableName']&&_0x50a5fc[_0x9d9c('0x11')]){_0x1bf2fc[_0x50a5fc['variableName']]&&_0x102694[_0x9d9c('0x7')](util['format'](_0x9d9c('0x13'),_0x50a5fc['key'],_0x1bf2fc[_0x50a5fc[_0x9d9c('0x9')]]));}else if(_0x50a5fc[_0x9d9c('0x10')]===_0x9d9c('0xa')&&_0x50a5fc[_0x9d9c('0xb')]&&_0x50a5fc[_0x9d9c('0xb')][_0x9d9c('0xc')]&&_0x50a5fc['key']){_0x1bf2fc[_0x50a5fc[_0x9d9c('0xb')][_0x9d9c('0xc')]['toLowerCase']()]&&_0x102694[_0x9d9c('0x7')](util[_0x9d9c('0x12')]('%s:\x20%s',_0x50a5fc[_0x9d9c('0x11')],_0x1bf2fc[_0x50a5fc[_0x9d9c('0xb')][_0x9d9c('0xc')][_0x9d9c('0xd')]()]));}}}}return _0x102694['join'](_0x241f1e);};exports['stripTrailingSlash']=function(_0x54bbc1){var _0x4e23cd=_0x54bbc1[_0x9d9c('0x14')](-0x1);if(_0x4e23cd==='/'){_0x54bbc1=_0x54bbc1[_0x9d9c('0x15')](0x0,_0x54bbc1[_0x9d9c('0x16')](_0x4e23cd));}return _0x54bbc1;};exports['validateEmail']=function(_0x23cf68){if(!_[_0x9d9c('0x17')](_0x23cf68)&&_0x23cf68!==''){var _0x98e865=/^(([^<>()\[\]\\.,;:\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 _0x98e865[_0x9d9c('0x18')](String(_0x23cf68)[_0x9d9c('0xd')]());}else{return![];}}; \ No newline at end of file +var _0xbc2e=['key','keyContent','join','stripTrailingSlash','slice','substring','lastIndexOf','validateEmail','isNil','test','util','getString','sortBy','string','push','content','type','variable','variableName','customVariable','Variable','name','toLowerCase','toString','keyValue','keyType','format','%s:\x20%s'];(function(_0x384b62,_0x22466b){var _0x51fb87=function(_0x49398f){while(--_0x49398f){_0x384b62['push'](_0x384b62['shift']());}};_0x51fb87(++_0x22466b);}(_0xbc2e,0x192));var _0xebc2=function(_0x1312d7,_0xc6ded2){_0x1312d7=_0x1312d7-0x0;var _0x1c7bb3=_0xbc2e[_0x1312d7];return _0x1c7bb3;};'use strict';var _=require('lodash');var util=require(_0xebc2('0x0'));exports[_0xebc2('0x1')]=function(_0x598c38,_0x35b3b6,_0xbc8ea7){var _0x2a4863=[];if(_0x598c38['length']>0x0){var _0x197e72=_[_0xebc2('0x2')](_0x598c38,['id']);for(var _0x9b4b44=0x0;_0x9b4b44<_0x197e72['length'];_0x9b4b44++){var _0x56dc22=_0x197e72[_0x9b4b44];if(_0x56dc22['type']===_0xebc2('0x3')){_0x2a4863[_0xebc2('0x4')](_0x56dc22[_0xebc2('0x5')]);}else if(_0x56dc22[_0xebc2('0x6')]===_0xebc2('0x7')&&_0x56dc22[_0xebc2('0x8')]){_0x35b3b6[_0x56dc22[_0xebc2('0x8')]]&&_0x2a4863['push'](_0x35b3b6[_0x56dc22[_0xebc2('0x8')]]['toString']());}else if(_0x56dc22['type']===_0xebc2('0x9')&&_0x56dc22[_0xebc2('0xa')]&&_0x56dc22[_0xebc2('0xa')][_0xebc2('0xb')]){_0x35b3b6[_0x56dc22[_0xebc2('0xa')]['name'][_0xebc2('0xc')]()]&&_0x2a4863['push'](_0x35b3b6[_0x56dc22['Variable']['name'][_0xebc2('0xc')]()][_0xebc2('0xd')]());}else if(_0x56dc22[_0xebc2('0x6')]===_0xebc2('0xe')){if(_0x56dc22[_0xebc2('0xf')]===_0xebc2('0x3')&&_0x56dc22['key']){_0x2a4863[_0xebc2('0x4')](util[_0xebc2('0x10')](_0xebc2('0x11'),_0x56dc22[_0xebc2('0x12')],_0x56dc22[_0xebc2('0x13')]));}else if(_0x56dc22[_0xebc2('0xf')]===_0xebc2('0x7')&&_0x56dc22[_0xebc2('0x8')]&&_0x56dc22['key']){_0x35b3b6[_0x56dc22[_0xebc2('0x8')]]&&_0x2a4863[_0xebc2('0x4')](util[_0xebc2('0x10')](_0xebc2('0x11'),_0x56dc22[_0xebc2('0x12')],_0x35b3b6[_0x56dc22[_0xebc2('0x8')]]));}else if(_0x56dc22[_0xebc2('0xf')]===_0xebc2('0x9')&&_0x56dc22[_0xebc2('0xa')]&&_0x56dc22[_0xebc2('0xa')][_0xebc2('0xb')]&&_0x56dc22[_0xebc2('0x12')]){_0x35b3b6[_0x56dc22[_0xebc2('0xa')][_0xebc2('0xb')]['toLowerCase']()]&&_0x2a4863[_0xebc2('0x4')](util[_0xebc2('0x10')](_0xebc2('0x11'),_0x56dc22[_0xebc2('0x12')],_0x35b3b6[_0x56dc22[_0xebc2('0xa')][_0xebc2('0xb')][_0xebc2('0xc')]()]));}}}}return _0x2a4863[_0xebc2('0x14')](_0xbc8ea7);};exports[_0xebc2('0x15')]=function(_0x25a9ca){var _0x3365da=_0x25a9ca[_0xebc2('0x16')](-0x1);if(_0x3365da==='/'){_0x25a9ca=_0x25a9ca[_0xebc2('0x17')](0x0,_0x25a9ca[_0xebc2('0x18')](_0x3365da));}return _0x25a9ca;};exports[_0xebc2('0x19')]=function(_0x43213b){if(!_[_0xebc2('0x1a')](_0x43213b)&&_0x43213b!==''){var _0x57ef45=/^(([^<>()\[\]\\.,;:\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 _0x57ef45[_0xebc2('0x1b')](String(_0x43213b)[_0xebc2('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 94f74dc..a4ee552 100644 --- a/server/services/ami/trigger/integration/vtiger.js +++ b/server/services/ami/trigger/integration/vtiger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x34e8=['redis','defaults','localhost','emit','length','forEach','includes','string','picklist','type','idField','toString','variableName','Variable','name','toLowerCase','info','Creating\x20new\x20ticket...','merge','Normal','getString','Subjects','POST','format','remoteUri','create','sessionName','HelpDesk','stringify','success','error','catch','statusCode','Getting\x20agent\x20with\x20email','GET','%s/webservice.php','query','username','SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;','result','Agent\x20found!','resolve','email1','first_name','last_name','userId','[vTiger],\x20%s,\x20%s,\x20%s','getUser','admin','SELECT\x20id,\x20firstname,\x20lastname,\x20email,\x20phone,\x20mobile,\x20homephone,\x20otherphone,\x20assistantphone\x20FROM\x20Contacts\x20WHERE\x20phone\x20=\x20\x27%s\x27\x20OR\x20mobile\x20=\x27%s\x27\x20OR\x20homephone\x20=\x27%s\x27\x20OR\x20otherphone\x20=\x27%s\x27\x20OR\x20assistantphone\x20=\x27%s\x27;','Enduser\x20found!','firstname','lastname','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','phone','getEndUser','accessKey','getchallenge','then','login','token','Account\x20%d\x20is\x20not\x20valid','getConnection','[HTTP]','queue','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','recordingURL','email','The\x20User\x20ID\x20is:','calleridnum','Fields','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT','[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','outbound','stripTrailingSlash','recordingFormat','none','[OUTBOUND]','uniqueid','destcalleridname','destcalleridnum','The\x20Enduser\x20ID\x20is:','split','unmanaged','lastevent','toUpperCase','calleridname','lodash','request-promise','bluebird','md5','ioredis','./util','../../../../config/environment','../../../../config/logger','vTiger'];(function(_0x109487,_0x5b22d1){var _0x15d895=function(_0x5b7546){while(--_0x5b7546){_0x109487['push'](_0x109487['shift']());}};_0x15d895(++_0x5b22d1);}(_0x34e8,0x12c));var _0x834e=function(_0x5aef7b,_0x2341a2){_0x5aef7b=_0x5aef7b-0x0;var _0x2db013=_0x34e8[_0x5aef7b];return _0x2db013;};'use strict';var _=require(_0x834e('0x0'));var rp=require(_0x834e('0x1'));var BPromise=require(_0x834e('0x2'));var md5=require(_0x834e('0x3'));var util=require('util');var Redis=require(_0x834e('0x4'));var intUtil=require(_0x834e('0x5'));var config=require(_0x834e('0x6'));var logger=require(_0x834e('0x7'))(_0x834e('0x8'));config[_0x834e('0x9')]=_[_0x834e('0xa')](config['redis'],{'host':_0x834e('0xb'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x834e('0x9')]));function emit(_0x3cc2e3,_0x3a3ef6,_0x2e69e2){io['to'](_0x3cc2e3)[_0x834e('0xc')](_0x3a3ef6,_0x2e69e2);}function getCustomFields(_0x23501c,_0x363786){var _0x1af45a={};if(_0x23501c[_0x834e('0xd')]>0x0){_[_0x834e('0xe')](_0x23501c,function(_0x1e41fe){if(_[_0x834e('0xf')]([_0x834e('0x10'),_0x834e('0x11')],_0x1e41fe[_0x834e('0x12')])&&_0x1e41fe[_0x834e('0x13')]){_0x1af45a[_0x1e41fe[_0x834e('0x13')]]=_0x1e41fe['content'][_0x834e('0x14')]();}else if(_0x1e41fe[_0x834e('0x12')]==='variable'&&_0x1e41fe[_0x834e('0x15')]&&_0x1e41fe[_0x834e('0x13')]&&_0x363786[_0x1e41fe[_0x834e('0x15')]]){_0x1af45a[_0x1e41fe[_0x834e('0x13')]]=_0x363786[_0x1e41fe['variableName']][_0x834e('0x14')]();}else if(_0x1e41fe[_0x834e('0x12')]==='customVariable'&&_0x1e41fe[_0x834e('0x16')]&&_0x1e41fe['Variable'][_0x834e('0x17')]&&_0x1e41fe[_0x834e('0x13')]&&_0x363786[_0x1e41fe['Variable'][_0x834e('0x17')][_0x834e('0x18')]()]){_0x1af45a[_0x1e41fe[_0x834e('0x13')]]=_0x363786[_0x1e41fe['Variable'][_0x834e('0x17')][_0x834e('0x18')]()][_0x834e('0x14')]();}});}return _0x1af45a;}function createTicket(_0xb993a1,_0x237947,_0x254677,_0x1dd214,_0x595515,_0x2545b4,_0x1fd2c6){logger[_0x834e('0x19')](_0x834e('0x1a'));var _0x4ab05d=_[_0x834e('0x1b')]({'parent_id':'','assigned_user_id':_0x237947['id'],'ticketpriorities':_0x834e('0x1c'),'ticketstatus':'Open','ticket_title':intUtil[_0x834e('0x1d')](_0x1dd214[_0x834e('0x1e')],_0x595515,'\x20'),'description':intUtil[_0x834e('0x1d')](_0x1dd214['Descriptions'],_0x595515,'\x0a'),'contact_id':_0x254677['id']},getCustomFields(_0x2545b4,_0x595515));var _0x4e3f48={'method':_0x834e('0x1f'),'uri':util[_0x834e('0x20')]('%s/webservice.php',_0xb993a1[_0x834e('0x21')]),'form':{'operation':_0x834e('0x22'),'username':_0xb993a1['username'],'sessionName':_0x1fd2c6[_0x834e('0x23')],'elementType':_0x834e('0x24'),'element':JSON[_0x834e('0x25')](_0x4ab05d)},'json':!![]};return request(_0x4e3f48)['then'](function(_0x24fcf7){if(_0x24fcf7[_0x834e('0x26')]){return BPromise['resolve']({'id':_0x24fcf7['result']['id']});}else{throw new Error(util[_0x834e('0x20')]('Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s',JSON[_0x834e('0x25')](_0x24fcf7[_0x834e('0x27')])));}})[_0x834e('0x28')](function(_0x2cc2eb){var _0x3cd928=_0x2cc2eb[_0x834e('0x29')]||0x1f4;logger['error']('[vTiger],\x20%s,\x20%s,\x20%s','createTicket',_0x3cd928,JSON['stringify'](_0x2cc2eb));});}function getUser(_0x2c7a8d,_0x567cea,_0x106d6a){if(intUtil['validateEmail'](_0x567cea)){logger[_0x834e('0x19')](_0x834e('0x2a'),_0x567cea);return request({'method':_0x834e('0x2b'),'uri':util[_0x834e('0x20')](_0x834e('0x2c'),_0x2c7a8d[_0x834e('0x21')]),'qs':{'operation':_0x834e('0x2d'),'username':_0x2c7a8d[_0x834e('0x2e')],'sessionName':_0x106d6a[_0x834e('0x23')],'query':util['format'](_0x834e('0x2f'),_0x567cea)},'json':!![]})['then'](function(_0x2c75c2){if(_0x2c75c2[_0x834e('0x26')]&&_0x2c75c2[_0x834e('0x30')][_0x834e('0xd')]){logger[_0x834e('0x19')](_0x834e('0x31'));return BPromise[_0x834e('0x32')]({'id':_0x2c75c2[_0x834e('0x30')][0x0]['id'],'email':_0x2c75c2[_0x834e('0x30')][0x0][_0x834e('0x33')],'name':_0x2c75c2['result'][0x0][_0x834e('0x34')]+'\x20'+_0x2c75c2[_0x834e('0x30')][_0x834e('0x35')]});}else{logger[_0x834e('0x19')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return BPromise[_0x834e('0x32')]({'id':_0x106d6a[_0x834e('0x36')],'email':_0x2c7a8d['username'],'name':'admin'});}})['catch'](function(_0x3e58fa){var _0x41bf4d=_0x3e58fa[_0x834e('0x29')]||0x1f4;logger[_0x834e('0x27')](_0x834e('0x37'),_0x834e('0x38'),_0x41bf4d,JSON['stringify'](_0x3e58fa));});}else{logger[_0x834e('0x19')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return BPromise[_0x834e('0x32')]({'id':_0x106d6a[_0x834e('0x36')],'email':_0x2c7a8d['username'],'name':_0x834e('0x39')})[_0x834e('0x28')](function(_0x491c28){var _0x481f70=_0x491c28[_0x834e('0x29')]||0x1f4;logger[_0x834e('0x27')](_0x834e('0x37'),_0x834e('0x38'),_0x481f70,JSON[_0x834e('0x25')](_0x491c28));});}}function getEndUser(_0x4ca43c,_0x1c5ed6,_0x548d1d,_0x50c243){logger[_0x834e('0x19')]('Searching\x20end\x20user\x20with\x20phone',_0x548d1d);return request({'method':_0x834e('0x2b'),'uri':util[_0x834e('0x20')](_0x834e('0x2c'),_0x4ca43c[_0x834e('0x21')]),'qs':{'operation':_0x834e('0x2d'),'username':_0x4ca43c['username'],'sessionName':_0x50c243[_0x834e('0x23')],'query':util[_0x834e('0x20')](_0x834e('0x3a'),_0x548d1d,_0x548d1d,_0x548d1d,_0x548d1d,_0x548d1d)},'json':!![]})['then'](function(_0x35380e){if(_0x35380e[_0x834e('0x26')]&&_0x35380e['result'][_0x834e('0xd')]){logger['info'](_0x834e('0x3b'));return BPromise[_0x834e('0x32')]({'id':_0x35380e['result'][0x0]['id'],'name':_0x35380e['result'][0x0][_0x834e('0x3c')]+'\x20'+_0x35380e[_0x834e('0x30')][0x0][_0x834e('0x3d')],'phone':_0x548d1d});}else{logger[_0x834e('0x19')](_0x834e('0x3e'));return request({'method':_0x834e('0x1f'),'uri':util[_0x834e('0x20')]('%s/webservice.php',_0x4ca43c[_0x834e('0x21')]),'form':{'operation':'create','sessionName':_0x50c243[_0x834e('0x23')],'elementType':'Contacts','element':JSON[_0x834e('0x25')]({'lastname':_0x1c5ed6,'phone':_0x548d1d,'assigned_user_id':'\x20'})},'json':!![]})['then'](function(_0x361f60){logger[_0x834e('0x19')]('Enduser\x20created.');return BPromise[_0x834e('0x32')]({'id':_0x361f60[_0x834e('0x30')]['id'],'name':_0x361f60[_0x834e('0x30')][_0x834e('0x3d')],'phone':_0x361f60[_0x834e('0x30')][_0x834e('0x3f')]});})[_0x834e('0x28')](function(_0x3ccd8e){var _0x5dc63b=_0x3ccd8e[_0x834e('0x29')]||0x1f4;logger['error'](_0x834e('0x37'),_0x834e('0x40'),_0x5dc63b,JSON['stringify'](_0x3ccd8e));});}});}function getConnection(_0x112306){var _0x42fd90=_0x112306[_0x834e('0x2e')];var _0x2112d5=_0x112306[_0x834e('0x41')];return request({'method':_0x834e('0x2b'),'uri':util['format']('%s/webservice.php',_0x112306[_0x834e('0x21')]),'qs':{'operation':_0x834e('0x42'),'username':_0x42fd90},'json':!![]})[_0x834e('0x43')](function(_0x40ff5a){if(_0x40ff5a[_0x834e('0x26')]){return request({'method':_0x834e('0x1f'),'uri':util[_0x834e('0x20')](_0x834e('0x2c'),_0x112306[_0x834e('0x21')]),'form':{'operation':_0x834e('0x44'),'username':_0x42fd90,'accessKey':md5(_0x40ff5a[_0x834e('0x30')][_0x834e('0x45')]+_0x2112d5)},'json':!![]});}})[_0x834e('0x43')](function(_0x1a3237){if(_0x1a3237[_0x834e('0x26')]){return BPromise[_0x834e('0x32')](_0x1a3237[_0x834e('0x30')]);}else{throw new Error(util[_0x834e('0x20')](_0x834e('0x46'),_0x112306['id']));}})[_0x834e('0x28')](function(_0x4cfacd){var _0x1cc0b8=_0x4cfacd[_0x834e('0x29')]||0x1f4;logger['error'](_0x834e('0x37'),_0x834e('0x47'),_0x1cc0b8,JSON['stringify'](_0x4cfacd));});}function request(_0x3dcca3){logger[_0x834e('0x19')](_0x834e('0x48'),JSON[_0x834e('0x25')](_0x3dcca3));return rp(_0x3dcca3);}exports[_0x834e('0x49')]=function(_0xb77aab,_0x4549ba,_0x4a8b32,_0x1ad7fe,_0x8bc6c6,_0x3e0550){var _0x363675,_0x86ad2b,_0x396bbe,_0x344b51;_0x3e0550[_0x834e('0x21')]=intUtil['stripTrailingSlash'](_0x3e0550[_0x834e('0x21')]);if(_0x8bc6c6&&_0x8bc6c6['monitor_format']){logger[_0x834e('0x19')]('[QUEUE]',_0x834e('0x4a'));_0x4549ba['recordingURL']=util['format'](_0x834e('0x4b'),_0x3e0550[_0x834e('0x4c')],_0x4549ba['uniqueid'],md5(_0x4549ba['uniqueid']));}else{_0x4549ba[_0x834e('0x4d')]='';}return getConnection(_0x3e0550)[_0x834e('0x43')](function(_0x138ed2){_0x344b51=_0x138ed2;return getUser(_0x3e0550,_0x1ad7fe[_0x834e('0x4e')],_0x344b51);})[_0x834e('0x43')](function(_0x315858){_0x363675=_0x315858;logger[_0x834e('0x19')](_0x834e('0x4f'),_0x363675['id']);return getEndUser(_0x3e0550,_0x4549ba['calleridname'],_0x4549ba[_0x834e('0x50')],_0x344b51);})[_0x834e('0x43')](function(_0x5d5ac2){_0x86ad2b=_0x5d5ac2;logger[_0x834e('0x19')]('The\x20Enduser\x20ID\x20is:',_0x86ad2b['id']);return createTicket(_0x3e0550,_0x363675,_0x86ad2b,_0x4a8b32,_0x4549ba,_0x4a8b32[_0x834e('0x51')],_0x344b51);})[_0x834e('0x43')](function(_0x5160c4){_0x396bbe=_0x5160c4;logger[_0x834e('0x19')](_0x834e('0x52'));logger[_0x834e('0x19')](_0x834e('0x53'),_0x396bbe['id']);var _0x5a2924=util[_0x834e('0x20')](_0x834e('0x54'),_0x3e0550[_0x834e('0x21')],_['split'](_0x396bbe['id'],'x')[0x1]);logger[_0x834e('0x19')](_0x834e('0x55'),_0x834e('0x56'));emit(util[_0x834e('0x20')](_0x834e('0x57'),_0x1ad7fe[_0x834e('0x17')]),_0x834e('0x58'),{'uri':_0x5a2924});})[_0x834e('0x28')](function(_0x208c21){logger[_0x834e('0x27')](_0x834e('0x55'),JSON[_0x834e('0x25')](_0x208c21));});};exports[_0x834e('0x59')]=function(_0x1659c8,_0x460a7a,_0x17b8e3,_0x297cce,_0x14ed83,_0x193a15,_0x3e3467){var _0xed4081,_0x2cb233,_0x5c83eb,_0x2145cf;_0x193a15[_0x834e('0x21')]=intUtil[_0x834e('0x5a')](_0x193a15[_0x834e('0x21')]);_0x193a15['serverUrl']=intUtil[_0x834e('0x5a')](_0x193a15['serverUrl']);if(_0x3e3467&&_0x3e3467['recordingFormat']&&_0x3e3467[_0x834e('0x5b')]!==_0x834e('0x5c')){logger[_0x834e('0x19')](_0x834e('0x5d'),_0x834e('0x4a'));_0x460a7a[_0x834e('0x4d')]=util[_0x834e('0x20')](_0x834e('0x4b'),_0x193a15['serverUrl'],_0x460a7a[_0x834e('0x5e')],md5(_0x460a7a['uniqueid']));}return getConnection(_0x193a15)[_0x834e('0x43')](function(_0xd35dda){_0x2145cf=_0xd35dda;return getUser(_0x193a15,_0x297cce['email'],_0x2145cf);})['then'](function(_0x4a4def){_0xed4081=_0x4a4def;logger[_0x834e('0x19')](_0x834e('0x4f'),_0xed4081['id']);return getEndUser(_0x193a15,_0x460a7a[_0x834e('0x5f')],_0x460a7a[_0x834e('0x60')],_0x2145cf);})['then'](function(_0x2b0d93){_0x2cb233=_0x2b0d93;logger[_0x834e('0x19')](_0x834e('0x61'),_0x2cb233['id']);return createTicket(_0x193a15,_0xed4081,_0x2cb233,_0x17b8e3,_0x460a7a,_0x17b8e3[_0x834e('0x51')],_0x2145cf);})[_0x834e('0x43')](function(_0x28b5c9){_0x5c83eb=_0x28b5c9;logger[_0x834e('0x19')](_0x834e('0x52'));logger[_0x834e('0x19')](_0x834e('0x53'),_0x5c83eb['id']);var _0x5b2bf6=util[_0x834e('0x20')](_0x834e('0x54'),_0x193a15[_0x834e('0x21')],_[_0x834e('0x62')](_0x5c83eb['id'],'x')[0x1]);logger['info'](_0x834e('0x5d'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util['format']('user:%s',_0x297cce[_0x834e('0x17')]),_0x834e('0x58'),{'uri':_0x5b2bf6});})['catch'](function(_0x2645df){logger[_0x834e('0x27')]('[OUTBOUND]',JSON[_0x834e('0x25')](_0x2645df));});};exports[_0x834e('0x63')]=function(_0x4b88e7,_0x5df169,_0x346be5,_0x2a42a3,_0x8bc7d9,_0x44c909){var _0x1d8e7,_0x493239,_0x264a6f,_0x520367;_0x44c909[_0x834e('0x21')]=intUtil[_0x834e('0x5a')](_0x44c909[_0x834e('0x21')]);_0x44c909['serverUrl']=intUtil[_0x834e('0x5a')](_0x44c909[_0x834e('0x4c')]);if(_0x8bc7d9&&_0x8bc7d9['monitor_format']){logger[_0x834e('0x19')]('['+_0x5df169[_0x834e('0x64')][_0x834e('0x65')]()+']','Recording\x20is\x20enabled!');_0x5df169[_0x834e('0x4d')]=util[_0x834e('0x20')](_0x834e('0x4b'),_0x44c909[_0x834e('0x4c')],_0x5df169[_0x834e('0x5e')],md5(_0x5df169[_0x834e('0x5e')]));}else{_0x5df169[_0x834e('0x4d')]='';}return getConnection(_0x44c909)[_0x834e('0x43')](function(_0xd49002){_0x520367=_0xd49002;return getUser(_0x44c909,'',_0x520367);})[_0x834e('0x43')](function(_0x57d898){_0x1d8e7=_0x57d898;logger['info']('The\x20User\x20ID\x20is:',_0x1d8e7['id']);return getEndUser(_0x44c909,_0x5df169[_0x834e('0x66')],_0x5df169[_0x834e('0x50')],_0x520367);})[_0x834e('0x43')](function(_0x37fa2c){_0x493239=_0x37fa2c;logger[_0x834e('0x19')]('The\x20Enduser\x20ID\x20is:',_0x493239['id']);return createTicket(_0x44c909,_0x1d8e7,_0x493239,_0x346be5,_0x5df169,_0x346be5['Fields'],_0x520367);})[_0x834e('0x43')](function(_0x1ad428){_0x264a6f=_0x1ad428;logger[_0x834e('0x19')](_0x834e('0x52'));logger[_0x834e('0x19')]('The\x20Ticket\x20ID\x20is:',_0x264a6f['id']);})[_0x834e('0x28')](function(_0x2b162a){logger[_0x834e('0x27')]('['+_0x5df169['lastevent'][_0x834e('0x65')]()+']',JSON[_0x834e('0x25')](_0x2b162a));});}; \ No newline at end of file +var _0x9c44=['stringify','validateEmail','Getting\x20agent\x20with\x20email','GET','%s/webservice.php','SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;','success','length','Agent\x20found!','email1','first_name','last_name','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','userId','getUser','admin','Searching\x20end\x20user\x20with\x20phone','SELECT\x20id,\x20firstname,\x20lastname,\x20email,\x20phone,\x20mobile,\x20homephone,\x20otherphone,\x20assistantphone\x20FROM\x20Contacts\x20WHERE\x20phone\x20=\x20\x27%s\x27\x20OR\x20mobile\x20=\x27%s\x27\x20OR\x20homephone\x20=\x27%s\x27\x20OR\x20otherphone\x20=\x27%s\x27\x20OR\x20assistantphone\x20=\x27%s\x27;','Enduser\x20found!','firstname','lastname','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Contacts','Enduser\x20created.','phone','getEndUser','accessKey','login','Account\x20%d\x20is\x20not\x20valid','getConnection','[HTTP]','queue','stripTrailingSlash','[QUEUE]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','uniqueid','recordingURL','email','The\x20User\x20ID\x20is:','calleridname','The\x20Enduser\x20ID\x20is:','Fields','The\x20Ticket\x20ID\x20is:','split','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','destcalleridname','destcalleridnum','Ticket\x20created!','%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT','trigger:browser:url','unmanaged','monitor_format','toUpperCase','calleridnum','lastevent','bluebird','md5','util','ioredis','./util','../../../../config/environment','redis','localhost','socket.io-emitter','emit','forEach','string','picklist','idField','content','type','variable','variableName','toString','customVariable','Variable','name','toLowerCase','info','Creating\x20new\x20ticket...','merge','Normal','Open','getString','Subjects','POST','remoteUri','create','username','sessionName','then','resolve','result','format','Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s','catch','statusCode','error','[vTiger],\x20%s,\x20%s,\x20%s'];(function(_0xb0d903,_0x3585fa){var _0x2bcfbf=function(_0x5de30c){while(--_0x5de30c){_0xb0d903['push'](_0xb0d903['shift']());}};_0x2bcfbf(++_0x3585fa);}(_0x9c44,0x178));var _0x49c4=function(_0x50a0c2,_0x4befab){_0x50a0c2=_0x50a0c2-0x0;var _0x5ebadd=_0x9c44[_0x50a0c2];return _0x5ebadd;};'use strict';var _=require('lodash');var rp=require('request-promise');var BPromise=require(_0x49c4('0x0'));var md5=require(_0x49c4('0x1'));var util=require(_0x49c4('0x2'));var Redis=require(_0x49c4('0x3'));var intUtil=require(_0x49c4('0x4'));var config=require(_0x49c4('0x5'));var logger=require('../../../../config/logger')('vTiger');config[_0x49c4('0x6')]=_['defaults'](config[_0x49c4('0x6')],{'host':_0x49c4('0x7'),'port':0x18eb});var io=require(_0x49c4('0x8'))(new Redis(config[_0x49c4('0x6')]));function emit(_0x436234,_0x511d53,_0x11c586){io['to'](_0x436234)[_0x49c4('0x9')](_0x511d53,_0x11c586);}function getCustomFields(_0x1d13fb,_0x4487ca){var _0x4c7d3a={};if(_0x1d13fb['length']>0x0){_[_0x49c4('0xa')](_0x1d13fb,function(_0x313e73){if(_['includes']([_0x49c4('0xb'),_0x49c4('0xc')],_0x313e73['type'])&&_0x313e73['idField']){_0x4c7d3a[_0x313e73[_0x49c4('0xd')]]=_0x313e73[_0x49c4('0xe')]['toString']();}else if(_0x313e73[_0x49c4('0xf')]===_0x49c4('0x10')&&_0x313e73['variableName']&&_0x313e73[_0x49c4('0xd')]&&_0x4487ca[_0x313e73[_0x49c4('0x11')]]){_0x4c7d3a[_0x313e73[_0x49c4('0xd')]]=_0x4487ca[_0x313e73[_0x49c4('0x11')]][_0x49c4('0x12')]();}else if(_0x313e73[_0x49c4('0xf')]===_0x49c4('0x13')&&_0x313e73[_0x49c4('0x14')]&&_0x313e73['Variable'][_0x49c4('0x15')]&&_0x313e73[_0x49c4('0xd')]&&_0x4487ca[_0x313e73[_0x49c4('0x14')][_0x49c4('0x15')][_0x49c4('0x16')]()]){_0x4c7d3a[_0x313e73['idField']]=_0x4487ca[_0x313e73[_0x49c4('0x14')][_0x49c4('0x15')]['toLowerCase']()]['toString']();}});}return _0x4c7d3a;}function createTicket(_0x3c782d,_0x2f82d5,_0x3addb2,_0x59f29b,_0x24856d,_0x50b151,_0x2cbd50){logger[_0x49c4('0x17')](_0x49c4('0x18'));var _0x291526=_[_0x49c4('0x19')]({'parent_id':'','assigned_user_id':_0x2f82d5['id'],'ticketpriorities':_0x49c4('0x1a'),'ticketstatus':_0x49c4('0x1b'),'ticket_title':intUtil[_0x49c4('0x1c')](_0x59f29b[_0x49c4('0x1d')],_0x24856d,'\x20'),'description':intUtil['getString'](_0x59f29b['Descriptions'],_0x24856d,'\x0a'),'contact_id':_0x3addb2['id']},getCustomFields(_0x50b151,_0x24856d));var _0x57f502={'method':_0x49c4('0x1e'),'uri':util['format']('%s/webservice.php',_0x3c782d[_0x49c4('0x1f')]),'form':{'operation':_0x49c4('0x20'),'username':_0x3c782d[_0x49c4('0x21')],'sessionName':_0x2cbd50[_0x49c4('0x22')],'elementType':'HelpDesk','element':JSON['stringify'](_0x291526)},'json':!![]};return request(_0x57f502)[_0x49c4('0x23')](function(_0x9cb797){if(_0x9cb797['success']){return BPromise[_0x49c4('0x24')]({'id':_0x9cb797[_0x49c4('0x25')]['id']});}else{throw new Error(util[_0x49c4('0x26')](_0x49c4('0x27'),JSON['stringify'](_0x9cb797['error'])));}})[_0x49c4('0x28')](function(_0x53c199){var _0x3800b7=_0x53c199[_0x49c4('0x29')]||0x1f4;logger[_0x49c4('0x2a')](_0x49c4('0x2b'),'createTicket',_0x3800b7,JSON[_0x49c4('0x2c')](_0x53c199));});}function getUser(_0x2b2793,_0x46e04d,_0x4f28a2){if(intUtil[_0x49c4('0x2d')](_0x46e04d)){logger[_0x49c4('0x17')](_0x49c4('0x2e'),_0x46e04d);return request({'method':_0x49c4('0x2f'),'uri':util[_0x49c4('0x26')](_0x49c4('0x30'),_0x2b2793[_0x49c4('0x1f')]),'qs':{'operation':'query','username':_0x2b2793['username'],'sessionName':_0x4f28a2['sessionName'],'query':util[_0x49c4('0x26')](_0x49c4('0x31'),_0x46e04d)},'json':!![]})[_0x49c4('0x23')](function(_0x27e467){if(_0x27e467[_0x49c4('0x32')]&&_0x27e467['result'][_0x49c4('0x33')]){logger[_0x49c4('0x17')](_0x49c4('0x34'));return BPromise[_0x49c4('0x24')]({'id':_0x27e467['result'][0x0]['id'],'email':_0x27e467['result'][0x0][_0x49c4('0x35')],'name':_0x27e467[_0x49c4('0x25')][0x0][_0x49c4('0x36')]+'\x20'+_0x27e467[_0x49c4('0x25')][_0x49c4('0x37')]});}else{logger['info'](_0x49c4('0x38'));return BPromise[_0x49c4('0x24')]({'id':_0x4f28a2[_0x49c4('0x39')],'email':_0x2b2793['username'],'name':'admin'});}})[_0x49c4('0x28')](function(_0x1991e9){var _0x3bec0a=_0x1991e9[_0x49c4('0x29')]||0x1f4;logger[_0x49c4('0x2a')](_0x49c4('0x2b'),_0x49c4('0x3a'),_0x3bec0a,JSON[_0x49c4('0x2c')](_0x1991e9));});}else{logger[_0x49c4('0x17')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return BPromise[_0x49c4('0x24')]({'id':_0x4f28a2['userId'],'email':_0x2b2793[_0x49c4('0x21')],'name':_0x49c4('0x3b')})[_0x49c4('0x28')](function(_0x1c2830){var _0x4ed4f8=_0x1c2830[_0x49c4('0x29')]||0x1f4;logger[_0x49c4('0x2a')](_0x49c4('0x2b'),'getUser',_0x4ed4f8,JSON[_0x49c4('0x2c')](_0x1c2830));});}}function getEndUser(_0x21d8c7,_0x178987,_0x5e5366,_0x1ba7a0){logger[_0x49c4('0x17')](_0x49c4('0x3c'),_0x5e5366);return request({'method':_0x49c4('0x2f'),'uri':util[_0x49c4('0x26')](_0x49c4('0x30'),_0x21d8c7[_0x49c4('0x1f')]),'qs':{'operation':'query','username':_0x21d8c7[_0x49c4('0x21')],'sessionName':_0x1ba7a0[_0x49c4('0x22')],'query':util[_0x49c4('0x26')](_0x49c4('0x3d'),_0x5e5366,_0x5e5366,_0x5e5366,_0x5e5366,_0x5e5366)},'json':!![]})[_0x49c4('0x23')](function(_0x29dd5d){if(_0x29dd5d[_0x49c4('0x32')]&&_0x29dd5d[_0x49c4('0x25')][_0x49c4('0x33')]){logger[_0x49c4('0x17')](_0x49c4('0x3e'));return BPromise[_0x49c4('0x24')]({'id':_0x29dd5d[_0x49c4('0x25')][0x0]['id'],'name':_0x29dd5d['result'][0x0][_0x49c4('0x3f')]+'\x20'+_0x29dd5d['result'][0x0][_0x49c4('0x40')],'phone':_0x5e5366});}else{logger[_0x49c4('0x17')](_0x49c4('0x41'));return request({'method':_0x49c4('0x1e'),'uri':util[_0x49c4('0x26')](_0x49c4('0x30'),_0x21d8c7['remoteUri']),'form':{'operation':'create','sessionName':_0x1ba7a0[_0x49c4('0x22')],'elementType':_0x49c4('0x42'),'element':JSON[_0x49c4('0x2c')]({'lastname':_0x178987,'phone':_0x5e5366,'assigned_user_id':'\x20'})},'json':!![]})[_0x49c4('0x23')](function(_0x490823){logger[_0x49c4('0x17')](_0x49c4('0x43'));return BPromise[_0x49c4('0x24')]({'id':_0x490823[_0x49c4('0x25')]['id'],'name':_0x490823[_0x49c4('0x25')][_0x49c4('0x40')],'phone':_0x490823[_0x49c4('0x25')][_0x49c4('0x44')]});})[_0x49c4('0x28')](function(_0x5640d3){var _0x2ad771=_0x5640d3['statusCode']||0x1f4;logger[_0x49c4('0x2a')](_0x49c4('0x2b'),_0x49c4('0x45'),_0x2ad771,JSON[_0x49c4('0x2c')](_0x5640d3));});}});}function getConnection(_0x2d93d8){var _0x5b296d=_0x2d93d8[_0x49c4('0x21')];var _0x15b674=_0x2d93d8[_0x49c4('0x46')];return request({'method':_0x49c4('0x2f'),'uri':util[_0x49c4('0x26')](_0x49c4('0x30'),_0x2d93d8[_0x49c4('0x1f')]),'qs':{'operation':'getchallenge','username':_0x5b296d},'json':!![]})[_0x49c4('0x23')](function(_0x5cfff9){if(_0x5cfff9[_0x49c4('0x32')]){return request({'method':_0x49c4('0x1e'),'uri':util[_0x49c4('0x26')](_0x49c4('0x30'),_0x2d93d8[_0x49c4('0x1f')]),'form':{'operation':_0x49c4('0x47'),'username':_0x5b296d,'accessKey':md5(_0x5cfff9[_0x49c4('0x25')]['token']+_0x15b674)},'json':!![]});}})[_0x49c4('0x23')](function(_0x3feaf0){if(_0x3feaf0['success']){return BPromise[_0x49c4('0x24')](_0x3feaf0[_0x49c4('0x25')]);}else{throw new Error(util[_0x49c4('0x26')](_0x49c4('0x48'),_0x2d93d8['id']));}})['catch'](function(_0x5d8bf0){var _0x144fd2=_0x5d8bf0['statusCode']||0x1f4;logger[_0x49c4('0x2a')](_0x49c4('0x2b'),_0x49c4('0x49'),_0x144fd2,JSON[_0x49c4('0x2c')](_0x5d8bf0));});}function request(_0x240c20){logger[_0x49c4('0x17')](_0x49c4('0x4a'),JSON['stringify'](_0x240c20));return rp(_0x240c20);}exports[_0x49c4('0x4b')]=function(_0x1550ce,_0x3936d3,_0x3d944c,_0x17ef75,_0x2644c0,_0x156748){var _0x25d174,_0x1e0b4f,_0x1856be,_0x5b822f;_0x156748['remoteUri']=intUtil[_0x49c4('0x4c')](_0x156748[_0x49c4('0x1f')]);if(_0x2644c0&&_0x2644c0['monitor_format']){logger['info'](_0x49c4('0x4d'),'Recording\x20is\x20enabled!');_0x3936d3['recordingURL']=util[_0x49c4('0x26')](_0x49c4('0x4e'),_0x156748[_0x49c4('0x4f')],_0x3936d3[_0x49c4('0x50')],md5(_0x3936d3[_0x49c4('0x50')]));}else{_0x3936d3[_0x49c4('0x51')]='';}return getConnection(_0x156748)[_0x49c4('0x23')](function(_0x50798e){_0x5b822f=_0x50798e;return getUser(_0x156748,_0x17ef75[_0x49c4('0x52')],_0x5b822f);})[_0x49c4('0x23')](function(_0x207572){_0x25d174=_0x207572;logger[_0x49c4('0x17')](_0x49c4('0x53'),_0x25d174['id']);return getEndUser(_0x156748,_0x3936d3[_0x49c4('0x54')],_0x3936d3['calleridnum'],_0x5b822f);})['then'](function(_0x1ef0c1){_0x1e0b4f=_0x1ef0c1;logger[_0x49c4('0x17')](_0x49c4('0x55'),_0x1e0b4f['id']);return createTicket(_0x156748,_0x25d174,_0x1e0b4f,_0x3d944c,_0x3936d3,_0x3d944c[_0x49c4('0x56')],_0x5b822f);})[_0x49c4('0x23')](function(_0x6b2592){_0x1856be=_0x6b2592;logger[_0x49c4('0x17')]('Ticket\x20created!');logger[_0x49c4('0x17')](_0x49c4('0x57'),_0x1856be['id']);var _0x4ba4eb=util[_0x49c4('0x26')]('%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT',_0x156748[_0x49c4('0x1f')],_[_0x49c4('0x58')](_0x1856be['id'],'x')[0x1]);logger[_0x49c4('0x17')](_0x49c4('0x4d'),_0x49c4('0x59'));emit(util[_0x49c4('0x26')](_0x49c4('0x5a'),_0x17ef75[_0x49c4('0x15')]),'trigger:browser:url',{'uri':_0x4ba4eb});})[_0x49c4('0x28')](function(_0x27b9c2){logger['error'](_0x49c4('0x4d'),JSON[_0x49c4('0x2c')](_0x27b9c2));});};exports['outbound']=function(_0x39c455,_0x42e0e6,_0x4f50bf,_0x4dc54d,_0x589484,_0x513879,_0xc43386){var _0x54947d,_0xb20a5d,_0x32f344,_0x515240;_0x513879[_0x49c4('0x1f')]=intUtil[_0x49c4('0x4c')](_0x513879['remoteUri']);_0x513879[_0x49c4('0x4f')]=intUtil[_0x49c4('0x4c')](_0x513879[_0x49c4('0x4f')]);if(_0xc43386&&_0xc43386[_0x49c4('0x5b')]&&_0xc43386['recordingFormat']!==_0x49c4('0x5c')){logger[_0x49c4('0x17')](_0x49c4('0x5d'),_0x49c4('0x5e'));_0x42e0e6['recordingURL']=util[_0x49c4('0x26')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x513879['serverUrl'],_0x42e0e6['uniqueid'],md5(_0x42e0e6['uniqueid']));}return getConnection(_0x513879)[_0x49c4('0x23')](function(_0x32eaef){_0x515240=_0x32eaef;return getUser(_0x513879,_0x4dc54d[_0x49c4('0x52')],_0x515240);})[_0x49c4('0x23')](function(_0x5b056e){_0x54947d=_0x5b056e;logger['info'](_0x49c4('0x53'),_0x54947d['id']);return getEndUser(_0x513879,_0x42e0e6[_0x49c4('0x5f')],_0x42e0e6[_0x49c4('0x60')],_0x515240);})[_0x49c4('0x23')](function(_0x102c15){_0xb20a5d=_0x102c15;logger[_0x49c4('0x17')](_0x49c4('0x55'),_0xb20a5d['id']);return createTicket(_0x513879,_0x54947d,_0xb20a5d,_0x4f50bf,_0x42e0e6,_0x4f50bf[_0x49c4('0x56')],_0x515240);})['then'](function(_0x2276db){_0x32f344=_0x2276db;logger['info'](_0x49c4('0x61'));logger[_0x49c4('0x17')](_0x49c4('0x57'),_0x32f344['id']);var _0x1ea1b4=util[_0x49c4('0x26')](_0x49c4('0x62'),_0x513879[_0x49c4('0x1f')],_[_0x49c4('0x58')](_0x32f344['id'],'x')[0x1]);logger[_0x49c4('0x17')](_0x49c4('0x5d'),_0x49c4('0x59'));emit(util[_0x49c4('0x26')](_0x49c4('0x5a'),_0x4dc54d[_0x49c4('0x15')]),_0x49c4('0x63'),{'uri':_0x1ea1b4});})[_0x49c4('0x28')](function(_0x371e49){logger[_0x49c4('0x2a')]('[OUTBOUND]',JSON['stringify'](_0x371e49));});};exports[_0x49c4('0x64')]=function(_0x16b3e8,_0x4af680,_0x1a15f3,_0x38ad50,_0x2939fd,_0x16e7b1){var _0x4d6aaa,_0x5a14a5,_0x4a85d4,_0x2e90d8;_0x16e7b1[_0x49c4('0x1f')]=intUtil[_0x49c4('0x4c')](_0x16e7b1[_0x49c4('0x1f')]);_0x16e7b1[_0x49c4('0x4f')]=intUtil[_0x49c4('0x4c')](_0x16e7b1[_0x49c4('0x4f')]);if(_0x2939fd&&_0x2939fd[_0x49c4('0x65')]){logger[_0x49c4('0x17')]('['+_0x4af680['lastevent'][_0x49c4('0x66')]()+']',_0x49c4('0x5e'));_0x4af680[_0x49c4('0x51')]=util['format'](_0x49c4('0x4e'),_0x16e7b1[_0x49c4('0x4f')],_0x4af680[_0x49c4('0x50')],md5(_0x4af680[_0x49c4('0x50')]));}else{_0x4af680[_0x49c4('0x51')]='';}return getConnection(_0x16e7b1)[_0x49c4('0x23')](function(_0x35fa39){_0x2e90d8=_0x35fa39;return getUser(_0x16e7b1,'',_0x2e90d8);})[_0x49c4('0x23')](function(_0x4ba198){_0x4d6aaa=_0x4ba198;logger[_0x49c4('0x17')](_0x49c4('0x53'),_0x4d6aaa['id']);return getEndUser(_0x16e7b1,_0x4af680[_0x49c4('0x54')],_0x4af680[_0x49c4('0x67')],_0x2e90d8);})[_0x49c4('0x23')](function(_0x4a204d){_0x5a14a5=_0x4a204d;logger['info'](_0x49c4('0x55'),_0x5a14a5['id']);return createTicket(_0x16e7b1,_0x4d6aaa,_0x5a14a5,_0x1a15f3,_0x4af680,_0x1a15f3['Fields'],_0x2e90d8);})[_0x49c4('0x23')](function(_0x558880){_0x4a85d4=_0x558880;logger[_0x49c4('0x17')](_0x49c4('0x61'));logger[_0x49c4('0x17')](_0x49c4('0x57'),_0x4a85d4['id']);})['catch'](function(_0x123060){logger[_0x49c4('0x2a')]('['+_0x4af680[_0x49c4('0x68')][_0x49c4('0x66')]()+']',JSON[_0x49c4('0x2c')](_0x123060));});}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/zendesk.js b/server/services/ami/trigger/integration/zendesk.js index d1e9ae9..d6d4205 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 _0xf4d4=['[QUEUE]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','recordingURL','Authorization','email','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','integrationTab','newTab','user:%s','trigger:browser:url','%s/agent/tickets/%s','replace','/api/v2','error','outbound','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','The\x20User\x20ID\x20is:','destcalleridnum','Displaying\x20ticket\x20to\x20agent...','%s/channels/voice/agents/%d/tickets/%d/display.json','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','inspect','unmanaged','toUpperCase','catch','lastevent','\x20Error\x20running\x20Zendesk\x20integration','lodash','request-promise','md5','util','ioredis','./util','../../../../config/environment','zendesk','defaults','redis','localhost','socket.io-emitter','emit','application/json','format','%s/tickets.json','remoteUri','POST','merge','getString','Subjects','Descriptions','Fields','then','info','Getting\x20agent\x20with\x20email','type:user\x20role:agent\x20email:%s','find','results','agent','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me.json','user','Searching\x20enduser\x20with\x20phone','%s/search.json','type:user\x20role:end-user\x20phone:%s','length','filter','end-user','%s/users.json','Caller\x20-\x20%s','password','%s:%s','username','authType','token','%s/token:%s','Basic\x20%s','toString','base64','debug','[HTTP]','stringify','GET','map','forEach','picklist','type','nameField','customField','toLowerCase','includes','string','idField','custom_fields','push','content','variable','variableName','customVariable','Variable','name','queue','stripTrailingSlash','serverUrl','monitor_format'];(function(_0x436c46,_0x3e7a73){var _0x22409b=function(_0x17287e){while(--_0x17287e){_0x436c46['push'](_0x436c46['shift']());}};_0x22409b(++_0x3e7a73);}(_0xf4d4,0x1df));var _0x4f4d=function(_0x4021ae,_0x4d9ea4){_0x4021ae=_0x4021ae-0x0;var _0x3f6de7=_0xf4d4[_0x4021ae];return _0x3f6de7;};'use strict';var _=require(_0x4f4d('0x0'));var rp=require(_0x4f4d('0x1'));var md5=require(_0x4f4d('0x2'));var util=require(_0x4f4d('0x3'));var Redis=require(_0x4f4d('0x4'));var intUtil=require(_0x4f4d('0x5'));var config=require(_0x4f4d('0x6'));var logger=require('../../../../config/logger')(_0x4f4d('0x7'));config['redis']=_[_0x4f4d('0x8')](config[_0x4f4d('0x9')],{'host':_0x4f4d('0xa'),'port':0x18eb});var io=require(_0x4f4d('0xb'))(new Redis(config[_0x4f4d('0x9')]));function emit(_0x398a87,_0x1f5360,_0x3d37b3){io['to'](_0x398a87)[_0x4f4d('0xc')](_0x1f5360,_0x3d37b3);}var headers={'Content-Type':'application/json','Accept':_0x4f4d('0xd')};function getTicket(_0x5cc290,_0x485c5b,_0x32fd65,_0x591cce,_0x133315){logger['info']('Creating\x20new\x20ticket...');return request({'uri':util[_0x4f4d('0xe')](_0x4f4d('0xf'),_0x5cc290[_0x4f4d('0x10')]),'method':_0x4f4d('0x11'),'body':{'ticket':_[_0x4f4d('0x12')]({'requester_id':_0x32fd65['id'],'submitter_id':_0x485c5b?_0x485c5b['id']:undefined,'assignee_id':_0x485c5b?_0x485c5b['id']:undefined,'tags':getTags(_0x591cce['Tags'],'name'),'subject':intUtil[_0x4f4d('0x13')](_0x591cce[_0x4f4d('0x14')],_0x133315,'\x20'),'description':intUtil[_0x4f4d('0x13')](_0x591cce['Descriptions'],_0x133315,'\x0a'),'comment':{'public':![],'body':intUtil[_0x4f4d('0x13')](_0x591cce[_0x4f4d('0x15')],_0x133315,'\x0a')}},getCustomFields(_0x591cce[_0x4f4d('0x16')],_0x133315))}})[_0x4f4d('0x17')](function(_0x178cb0){logger[_0x4f4d('0x18')]('Ticket\x20created!');return _0x178cb0['ticket'];});}function getUser(_0x1245e3,_0x33990e){if(intUtil['validateEmail'](_0x33990e)){logger[_0x4f4d('0x18')](_0x4f4d('0x19'),_0x33990e);return request({'uri':util[_0x4f4d('0xe')]('%s/search.json',_0x1245e3[_0x4f4d('0x10')]),'qs':{'query':util[_0x4f4d('0xe')](_0x4f4d('0x1a'),_0x33990e)}})[_0x4f4d('0x17')](function(_0x204e55){if(_0x204e55['count']){logger[_0x4f4d('0x18')]('Agent\x20found!');return _[_0x4f4d('0x1b')](_0x204e55[_0x4f4d('0x1c')],{'email':_0x33990e,'role':_0x4f4d('0x1d')});}else{logger[_0x4f4d('0x18')](_0x4f4d('0x1e'));return request({'uri':util[_0x4f4d('0xe')](_0x4f4d('0x1f'),_0x1245e3[_0x4f4d('0x10')])})[_0x4f4d('0x17')](function(_0x1bc7e3){logger[_0x4f4d('0x18')]('Admin\x20account\x20selected.');return _0x1bc7e3[_0x4f4d('0x20')];});}});}else{logger['info'](_0x4f4d('0x1e'));return request({'uri':util['format'](_0x4f4d('0x1f'),_0x1245e3[_0x4f4d('0x10')])})[_0x4f4d('0x17')](function(_0x25e423){logger[_0x4f4d('0x18')]('Admin\x20account\x20selected.');return _0x25e423[_0x4f4d('0x20')];});}}function getEndUser(_0x2363ec,_0x1379c5,_0x1dc282){logger['info'](_0x4f4d('0x21'),_0x1dc282);return request({'uri':util[_0x4f4d('0xe')](_0x4f4d('0x22'),_0x2363ec['remoteUri']),'qs':{'query':util[_0x4f4d('0xe')](_0x4f4d('0x23'),_0x1dc282)}})[_0x4f4d('0x17')](function(_0x2aaf82){var _0x371a92;if(_0x2aaf82['results'][_0x4f4d('0x24')]){_0x2aaf82['results']=_[_0x4f4d('0x25')](_0x2aaf82[_0x4f4d('0x1c')],{'suspended':![],'role':_0x4f4d('0x26')});if(_0x2aaf82['results'][_0x4f4d('0x24')]){_0x371a92=_['first'](_0x2aaf82['results']);}}if(_0x371a92){logger[_0x4f4d('0x18')]('Enduser\x20found!');return _0x371a92;}else{logger[_0x4f4d('0x18')]('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'uri':util[_0x4f4d('0xe')](_0x4f4d('0x27'),_0x2363ec[_0x4f4d('0x10')]),'method':_0x4f4d('0x11'),'body':{'user':{'role':'end-user','name':util['format'](_0x4f4d('0x28'),_0x1379c5||_0x1dc282),'phone':_0x1dc282}}})[_0x4f4d('0x17')](function(_0x1ad504){logger[_0x4f4d('0x18')]('Enduser\x20created.');return _0x1ad504[_0x4f4d('0x20')];});}});}function getAuth(_0x3194db){var _0x3849cb;if(_0x3194db['authType']===_0x4f4d('0x29')){_0x3849cb=util['format'](_0x4f4d('0x2a'),_0x3194db[_0x4f4d('0x2b')],_0x3194db[_0x4f4d('0x29')]);}else if(_0x3194db[_0x4f4d('0x2c')]===_0x4f4d('0x2d')){_0x3849cb=util[_0x4f4d('0xe')](_0x4f4d('0x2e'),_0x3194db['username'],_0x3194db[_0x4f4d('0x2d')]);}return util[_0x4f4d('0xe')](_0x4f4d('0x2f'),new Buffer(_0x3849cb)[_0x4f4d('0x30')](_0x4f4d('0x31')));}function request(_0x34ab08){logger[_0x4f4d('0x32')](_0x4f4d('0x33'),JSON[_0x4f4d('0x34')](_0x34ab08));return rp(_['defaults'](_0x34ab08,{'method':_0x4f4d('0x35'),'headers':headers,'json':!![]}));}function getTags(_0x23f9fe,_0x46bf37){var _0x1eb403=[];if(_0x23f9fe&&_0x23f9fe[_0x4f4d('0x24')]>0x0){_0x1eb403=_[_0x4f4d('0x36')](_0x23f9fe,_0x46bf37);}return _0x1eb403;}function getCustomFields(_0xe58617,_0x562cc8){var _0x261433=[];var _0x2cc5cc={'custom_fields':[]};if(_0xe58617[_0x4f4d('0x24')]>0x0){_[_0x4f4d('0x37')](_0xe58617,function(_0x4ebff5){if(_['includes'](['string',_0x4f4d('0x38')],_0x4ebff5[_0x4f4d('0x39')])&&_0x4ebff5[_0x4f4d('0x3a')]&&!_0x4ebff5[_0x4f4d('0x3b')]){_0x2cc5cc[_0x4ebff5[_0x4f4d('0x3a')][_0x4f4d('0x3c')]()]=_0x4ebff5['content'][_0x4f4d('0x30')]();}else if(_[_0x4f4d('0x3d')]([_0x4f4d('0x3e'),_0x4f4d('0x38')],_0x4ebff5['type'])&&_0x4ebff5[_0x4f4d('0x3f')]&&_0x4ebff5['customField']){_0x2cc5cc[_0x4f4d('0x40')][_0x4f4d('0x41')]({'id':_0x4ebff5[_0x4f4d('0x3f')],'value':_0x4ebff5[_0x4f4d('0x42')][_0x4f4d('0x30')]()});}else if(_0x4ebff5[_0x4f4d('0x39')]===_0x4f4d('0x43')&&_0x4ebff5['variableName']&&_0x4ebff5[_0x4f4d('0x3f')]&&_0x4ebff5['customField']){_0x562cc8[_0x4ebff5[_0x4f4d('0x44')]]&&_0x2cc5cc[_0x4f4d('0x40')][_0x4f4d('0x41')]({'id':_0x4ebff5[_0x4f4d('0x3f')],'value':_0x562cc8[_0x4ebff5[_0x4f4d('0x44')]][_0x4f4d('0x30')]()});}else if(_0x4ebff5[_0x4f4d('0x39')]===_0x4f4d('0x45')&&_0x4ebff5[_0x4f4d('0x46')]&&_0x4ebff5[_0x4f4d('0x46')][_0x4f4d('0x47')]&&_0x4ebff5[_0x4f4d('0x3f')]&&_0x4ebff5[_0x4f4d('0x3b')]){_0x562cc8[_0x4ebff5['Variable'][_0x4f4d('0x47')][_0x4f4d('0x3c')]()]&&_0x2cc5cc['custom_fields'][_0x4f4d('0x41')]({'id':_0x4ebff5[_0x4f4d('0x3f')],'value':_0x562cc8[_0x4ebff5['Variable'][_0x4f4d('0x47')]['toLowerCase']()]['toString']()});}});}return _0x2cc5cc;}exports[_0x4f4d('0x48')]=function(_0x477a2a,_0x12b2a7,_0x37f963,_0xb9986,_0x443cc9,_0x2808e5){var _0x27d0d7,_0x4f04a7;_0x2808e5[_0x4f4d('0x10')]=intUtil[_0x4f4d('0x49')](_0x2808e5['remoteUri']);_0x2808e5[_0x4f4d('0x4a')]=intUtil[_0x4f4d('0x49')](_0x2808e5[_0x4f4d('0x4a')]);if(_0x443cc9&&_0x443cc9[_0x4f4d('0x4b')]){logger[_0x4f4d('0x18')](_0x4f4d('0x4c'),'Recording\x20is\x20enabled!');_0x12b2a7['recordingURL']=util[_0x4f4d('0xe')](_0x4f4d('0x4d'),_0x2808e5[_0x4f4d('0x4a')],_0x12b2a7[_0x4f4d('0x4e')],md5(_0x12b2a7[_0x4f4d('0x4e')]));}else{_0x12b2a7[_0x4f4d('0x4f')]='';}headers[_0x4f4d('0x50')]=getAuth(_0x2808e5);return getUser(_0x2808e5,_0xb9986[_0x4f4d('0x51')])[_0x4f4d('0x17')](function(_0x49c6cb){_0x27d0d7=_0x49c6cb;logger[_0x4f4d('0x18')]('The\x20User\x20ID\x20is:',_0x27d0d7['id']);return getEndUser(_0x2808e5,_0x12b2a7[_0x4f4d('0x52')],_0x12b2a7[_0x4f4d('0x53')]);})['then'](function(_0x51b1a6){_0x4f04a7=_0x51b1a6;logger[_0x4f4d('0x18')](_0x4f4d('0x54'),_0x4f04a7['id']);return getTicket(_0x2808e5,_0x27d0d7,_0x4f04a7,_0x37f963,_0x12b2a7);})[_0x4f4d('0x17')](function(_0x1aea02){if(_0x1aea02){logger[_0x4f4d('0x18')](_0x4f4d('0x55'),_0x1aea02['id']);switch(_0x2808e5[_0x4f4d('0x39')]){case _0x4f4d('0x56'):logger[_0x4f4d('0x18')](_0x4f4d('0x4c'),'Displaying\x20ticket\x20to\x20agent...');return request({'uri':util[_0x4f4d('0xe')]('%s/channels/voice/agents/%d/tickets/%d/display.json',_0x2808e5[_0x4f4d('0x10')],_0x27d0d7['id'],_0x1aea02['id']),'method':'POST'});case _0x4f4d('0x57'):logger[_0x4f4d('0x18')](_0x4f4d('0x4c'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util['format'](_0x4f4d('0x58'),_0xb9986[_0x4f4d('0x47')]),_0x4f4d('0x59'),{'uri':util[_0x4f4d('0xe')](_0x4f4d('0x5a'),_0x2808e5['remoteUri'][_0x4f4d('0x5b')](_0x4f4d('0x5c'),''),_0x1aea02['id'])});break;default:logger[_0x4f4d('0x5d')](_0x4f4d('0x4c'),'Zendesk\x20account\x20type\x20not\x20recognized');}}})['catch'](function(_0x1ca0c1){logger[_0x4f4d('0x5d')]('[QUEUE]\x20Error\x20running\x20Zendesk\x20integration',util['inspect'](_0x1ca0c1,{'showHidden':!![],'depth':null}));});};exports[_0x4f4d('0x5e')]=function(_0x205318,_0x2f2c09,_0x3e6024,_0xc539e1,_0x4063a4,_0x126099,_0x11487a){var _0x2698aa,_0x102ee3;_0x126099['remoteUri']=intUtil[_0x4f4d('0x49')](_0x126099['remoteUri']);_0x126099[_0x4f4d('0x4a')]=intUtil['stripTrailingSlash'](_0x126099[_0x4f4d('0x4a')]);if(_0x11487a&&_0x11487a[_0x4f4d('0x5f')]&&_0x11487a[_0x4f4d('0x5f')]!==_0x4f4d('0x60')){logger[_0x4f4d('0x18')](_0x4f4d('0x61'),_0x4f4d('0x62'));_0x2f2c09[_0x4f4d('0x4f')]=util['format'](_0x4f4d('0x4d'),_0x126099[_0x4f4d('0x4a')],_0x2f2c09[_0x4f4d('0x4e')],md5(_0x2f2c09[_0x4f4d('0x4e')]));}headers['Authorization']=getAuth(_0x126099);return getUser(_0x126099,_0xc539e1[_0x4f4d('0x51')])[_0x4f4d('0x17')](function(_0xefa50d){_0x2698aa=_0xefa50d;logger[_0x4f4d('0x18')](_0x4f4d('0x63'),_0x2698aa['id']);return getEndUser(_0x126099,_0x2f2c09['destcalleridname'],_0x2f2c09[_0x4f4d('0x64')]);})['then'](function(_0x5d4f74){_0x102ee3=_0x5d4f74;logger[_0x4f4d('0x18')]('The\x20Enduser\x20ID\x20is:',_0x102ee3['id']);return getTicket(_0x126099,_0x2698aa,_0x102ee3,_0x3e6024,_0x2f2c09);})[_0x4f4d('0x17')](function(_0x4383ed){if(_0x4383ed){logger['info'](_0x4f4d('0x55'),_0x4383ed['id']);switch(_0x126099['type']){case _0x4f4d('0x56'):logger[_0x4f4d('0x18')](_0x4f4d('0x61'),_0x4f4d('0x65'));return request({'uri':util[_0x4f4d('0xe')](_0x4f4d('0x66'),_0x126099['remoteUri'],_0x2698aa['id'],_0x4383ed['id']),'method':_0x4f4d('0x11')});case _0x4f4d('0x57'):logger['info']('[OUTBOUND]',_0x4f4d('0x67'));emit(util[_0x4f4d('0xe')](_0x4f4d('0x58'),_0xc539e1[_0x4f4d('0x47')]),_0x4f4d('0x59'),{'uri':util[_0x4f4d('0xe')](_0x4f4d('0x5a'),_0x126099['remoteUri'][_0x4f4d('0x5b')](_0x4f4d('0x5c'),''),_0x4383ed['id'])});break;default:logger[_0x4f4d('0x5d')](_0x4f4d('0x61'),'Zendesk\x20account\x20type\x20not\x20recognized');}}})['catch'](function(_0x45de1f){logger[_0x4f4d('0x5d')](_0x4f4d('0x68'),util[_0x4f4d('0x69')](_0x45de1f,{'showHidden':!![],'depth':null}));});};exports[_0x4f4d('0x6a')]=function(_0xc9747,_0x24d5fa,_0x4680ae,_0x30c0c0,_0x4808e3,_0x10dd53){var _0x46fa56,_0x5a2784;_0x10dd53['remoteUri']=intUtil['stripTrailingSlash'](_0x10dd53[_0x4f4d('0x10')]);_0x10dd53['serverUrl']=intUtil[_0x4f4d('0x49')](_0x10dd53[_0x4f4d('0x4a')]);if(_0x4808e3&&_0x4808e3[_0x4f4d('0x4b')]){logger['info']('['+_0x24d5fa['lastevent'][_0x4f4d('0x6b')]()+']',_0x4f4d('0x62'));_0x24d5fa['recordingURL']=util[_0x4f4d('0xe')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x10dd53[_0x4f4d('0x4a')],_0x24d5fa['uniqueid'],md5(_0x24d5fa['uniqueid']));}else{_0x24d5fa[_0x4f4d('0x4f')]='';}headers[_0x4f4d('0x50')]=getAuth(_0x10dd53);return getUser(_0x10dd53)[_0x4f4d('0x17')](function(_0x40a238){_0x46fa56=_0x40a238;logger['info'](_0x4f4d('0x63'),_0x46fa56['id']);return getEndUser(_0x10dd53,_0x24d5fa[_0x4f4d('0x52')],_0x24d5fa[_0x4f4d('0x53')]);})[_0x4f4d('0x17')](function(_0x3b604c){_0x5a2784=_0x3b604c;logger[_0x4f4d('0x18')]('The\x20Enduser\x20ID\x20is:',_0x5a2784['id']);return getTicket(_0x10dd53,_0x46fa56,_0x5a2784,_0x4680ae,_0x24d5fa);})[_0x4f4d('0x17')](function(_0x331c86){if(_0x331c86){logger['info'](_0x4f4d('0x55'),_0x331c86['id']);}})[_0x4f4d('0x6c')](function(_0x540905){logger[_0x4f4d('0x5d')]('['+_0x24d5fa[_0x4f4d('0x6d')][_0x4f4d('0x6b')]()+']'+_0x4f4d('0x6e'),util[_0x4f4d('0x69')](_0x540905,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x1913=['newTab','user:%s','%s/agent/tickets/%s','replace','error','catch','outbound','recordingFormat','none','[OUTBOUND]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','email','destcalleridname','destcalleridnum','The\x20Enduser\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','inspect','unmanaged','monitor_format','lastevent','toUpperCase','calleridname','The\x20Ticket\x20ID\x20is:','\x20Error\x20running\x20Zendesk\x20integration','lodash','request-promise','md5','util','ioredis','./util','../../../../config/environment','redis','localhost','socket.io-emitter','emit','application/json','info','format','POST','merge','Tags','name','getString','Descriptions','then','Ticket\x20created!','ticket','validateEmail','Getting\x20agent\x20with\x20email','remoteUri','type:user\x20role:agent\x20email:%s','count','Agent\x20found!','find','results','agent','%s/users/me.json','Admin\x20account\x20selected.','user','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','%s/search.json','type:user\x20role:end-user\x20phone:%s','end-user','length','first','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/users.json','Caller\x20-\x20%s','Enduser\x20created.','authType','username','password','token','%s/token:%s','Basic\x20%s','toString','[HTTP]','stringify','GET','map','forEach','includes','string','picklist','nameField','toLowerCase','type','idField','customField','custom_fields','push','content','variable','variableName','customVariable','Variable','serverUrl','stripTrailingSlash','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','uniqueid','The\x20User\x20ID\x20is:','calleridnum','integrationTab','Displaying\x20ticket\x20to\x20agent...','%s/channels/voice/agents/%d/tickets/%d/display.json'];(function(_0x33816a,_0x41d881){var _0x26e24e=function(_0x5ec8d3){while(--_0x5ec8d3){_0x33816a['push'](_0x33816a['shift']());}};_0x26e24e(++_0x41d881);}(_0x1913,0xf8));var _0x3191=function(_0x59b7c8,_0x415f4a){_0x59b7c8=_0x59b7c8-0x0;var _0x327783=_0x1913[_0x59b7c8];return _0x327783;};'use strict';var _=require(_0x3191('0x0'));var rp=require(_0x3191('0x1'));var md5=require(_0x3191('0x2'));var util=require(_0x3191('0x3'));var Redis=require(_0x3191('0x4'));var intUtil=require(_0x3191('0x5'));var config=require(_0x3191('0x6'));var logger=require('../../../../config/logger')('zendesk');config[_0x3191('0x7')]=_['defaults'](config[_0x3191('0x7')],{'host':_0x3191('0x8'),'port':0x18eb});var io=require(_0x3191('0x9'))(new Redis(config['redis']));function emit(_0x4c5f50,_0x183db3,_0x38533b){io['to'](_0x4c5f50)[_0x3191('0xa')](_0x183db3,_0x38533b);}var headers={'Content-Type':_0x3191('0xb'),'Accept':_0x3191('0xb')};function getTicket(_0x30610c,_0x3d8050,_0x71e76f,_0x3d9d35,_0x34192c){logger[_0x3191('0xc')]('Creating\x20new\x20ticket...');return request({'uri':util[_0x3191('0xd')]('%s/tickets.json',_0x30610c['remoteUri']),'method':_0x3191('0xe'),'body':{'ticket':_[_0x3191('0xf')]({'requester_id':_0x71e76f['id'],'submitter_id':_0x3d8050?_0x3d8050['id']:undefined,'assignee_id':_0x3d8050?_0x3d8050['id']:undefined,'tags':getTags(_0x3d9d35[_0x3191('0x10')],_0x3191('0x11')),'subject':intUtil['getString'](_0x3d9d35['Subjects'],_0x34192c,'\x20'),'description':intUtil[_0x3191('0x12')](_0x3d9d35[_0x3191('0x13')],_0x34192c,'\x0a'),'comment':{'public':![],'body':intUtil[_0x3191('0x12')](_0x3d9d35[_0x3191('0x13')],_0x34192c,'\x0a')}},getCustomFields(_0x3d9d35['Fields'],_0x34192c))}})[_0x3191('0x14')](function(_0xc8ca16){logger['info'](_0x3191('0x15'));return _0xc8ca16[_0x3191('0x16')];});}function getUser(_0x5d535d,_0x63c91b){if(intUtil[_0x3191('0x17')](_0x63c91b)){logger[_0x3191('0xc')](_0x3191('0x18'),_0x63c91b);return request({'uri':util[_0x3191('0xd')]('%s/search.json',_0x5d535d[_0x3191('0x19')]),'qs':{'query':util[_0x3191('0xd')](_0x3191('0x1a'),_0x63c91b)}})[_0x3191('0x14')](function(_0x279f8e){if(_0x279f8e[_0x3191('0x1b')]){logger[_0x3191('0xc')](_0x3191('0x1c'));return _[_0x3191('0x1d')](_0x279f8e[_0x3191('0x1e')],{'email':_0x63c91b,'role':_0x3191('0x1f')});}else{logger['info']('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0x3191('0xd')](_0x3191('0x20'),_0x5d535d['remoteUri'])})[_0x3191('0x14')](function(_0x38cf42){logger[_0x3191('0xc')](_0x3191('0x21'));return _0x38cf42[_0x3191('0x22')];});}});}else{logger[_0x3191('0xc')](_0x3191('0x23'));return request({'uri':util[_0x3191('0xd')](_0x3191('0x20'),_0x5d535d[_0x3191('0x19')])})[_0x3191('0x14')](function(_0x3de7d6){logger[_0x3191('0xc')](_0x3191('0x21'));return _0x3de7d6[_0x3191('0x22')];});}}function getEndUser(_0x17731a,_0x5a9f61,_0x4b77e1){logger[_0x3191('0xc')](_0x3191('0x24'),_0x4b77e1);return request({'uri':util[_0x3191('0xd')](_0x3191('0x25'),_0x17731a[_0x3191('0x19')]),'qs':{'query':util[_0x3191('0xd')](_0x3191('0x26'),_0x4b77e1)}})[_0x3191('0x14')](function(_0x3ea739){var _0x4634f3;if(_0x3ea739['results']['length']){_0x3ea739[_0x3191('0x1e')]=_['filter'](_0x3ea739[_0x3191('0x1e')],{'suspended':![],'role':_0x3191('0x27')});if(_0x3ea739[_0x3191('0x1e')][_0x3191('0x28')]){_0x4634f3=_[_0x3191('0x29')](_0x3ea739[_0x3191('0x1e')]);}}if(_0x4634f3){logger[_0x3191('0xc')](_0x3191('0x2a'));return _0x4634f3;}else{logger[_0x3191('0xc')](_0x3191('0x2b'));return request({'uri':util[_0x3191('0xd')](_0x3191('0x2c'),_0x17731a[_0x3191('0x19')]),'method':_0x3191('0xe'),'body':{'user':{'role':_0x3191('0x27'),'name':util[_0x3191('0xd')](_0x3191('0x2d'),_0x5a9f61||_0x4b77e1),'phone':_0x4b77e1}}})[_0x3191('0x14')](function(_0x4bb9bc){logger[_0x3191('0xc')](_0x3191('0x2e'));return _0x4bb9bc[_0x3191('0x22')];});}});}function getAuth(_0x5255b5){var _0x513ffe;if(_0x5255b5[_0x3191('0x2f')]==='password'){_0x513ffe=util['format']('%s:%s',_0x5255b5[_0x3191('0x30')],_0x5255b5[_0x3191('0x31')]);}else if(_0x5255b5[_0x3191('0x2f')]===_0x3191('0x32')){_0x513ffe=util[_0x3191('0xd')](_0x3191('0x33'),_0x5255b5['username'],_0x5255b5[_0x3191('0x32')]);}return util[_0x3191('0xd')](_0x3191('0x34'),new Buffer(_0x513ffe)[_0x3191('0x35')]('base64'));}function request(_0x27e087){logger['debug'](_0x3191('0x36'),JSON[_0x3191('0x37')](_0x27e087));return rp(_['defaults'](_0x27e087,{'method':_0x3191('0x38'),'headers':headers,'json':!![]}));}function getTags(_0x10e494,_0x1f20b0){var _0x1e846f=[];if(_0x10e494&&_0x10e494[_0x3191('0x28')]>0x0){_0x1e846f=_[_0x3191('0x39')](_0x10e494,_0x1f20b0);}return _0x1e846f;}function getCustomFields(_0x42e6a2,_0x36a635){var _0x275a9=[];var _0x36a137={'custom_fields':[]};if(_0x42e6a2[_0x3191('0x28')]>0x0){_[_0x3191('0x3a')](_0x42e6a2,function(_0x513928){if(_[_0x3191('0x3b')]([_0x3191('0x3c'),_0x3191('0x3d')],_0x513928['type'])&&_0x513928[_0x3191('0x3e')]&&!_0x513928['customField']){_0x36a137[_0x513928[_0x3191('0x3e')][_0x3191('0x3f')]()]=_0x513928['content'][_0x3191('0x35')]();}else if(_[_0x3191('0x3b')]([_0x3191('0x3c'),_0x3191('0x3d')],_0x513928[_0x3191('0x40')])&&_0x513928[_0x3191('0x41')]&&_0x513928[_0x3191('0x42')]){_0x36a137[_0x3191('0x43')][_0x3191('0x44')]({'id':_0x513928[_0x3191('0x41')],'value':_0x513928[_0x3191('0x45')][_0x3191('0x35')]()});}else if(_0x513928[_0x3191('0x40')]===_0x3191('0x46')&&_0x513928['variableName']&&_0x513928['idField']&&_0x513928[_0x3191('0x42')]){_0x36a635[_0x513928[_0x3191('0x47')]]&&_0x36a137['custom_fields'][_0x3191('0x44')]({'id':_0x513928[_0x3191('0x41')],'value':_0x36a635[_0x513928[_0x3191('0x47')]][_0x3191('0x35')]()});}else if(_0x513928['type']===_0x3191('0x48')&&_0x513928[_0x3191('0x49')]&&_0x513928[_0x3191('0x49')][_0x3191('0x11')]&&_0x513928[_0x3191('0x41')]&&_0x513928[_0x3191('0x42')]){_0x36a635[_0x513928[_0x3191('0x49')]['name'][_0x3191('0x3f')]()]&&_0x36a137[_0x3191('0x43')]['push']({'id':_0x513928[_0x3191('0x41')],'value':_0x36a635[_0x513928['Variable']['name'][_0x3191('0x3f')]()][_0x3191('0x35')]()});}});}return _0x36a137;}exports['queue']=function(_0x29931e,_0x425855,_0x3ea887,_0x3fdad3,_0x17dee0,_0x546832){var _0x55dd33,_0x447a57;_0x546832['remoteUri']=intUtil['stripTrailingSlash'](_0x546832[_0x3191('0x19')]);_0x546832[_0x3191('0x4a')]=intUtil[_0x3191('0x4b')](_0x546832['serverUrl']);if(_0x17dee0&&_0x17dee0['monitor_format']){logger['info'](_0x3191('0x4c'),_0x3191('0x4d'));_0x425855[_0x3191('0x4e')]=util[_0x3191('0xd')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x546832[_0x3191('0x4a')],_0x425855[_0x3191('0x4f')],md5(_0x425855['uniqueid']));}else{_0x425855[_0x3191('0x4e')]='';}headers['Authorization']=getAuth(_0x546832);return getUser(_0x546832,_0x3fdad3['email'])['then'](function(_0x24c791){_0x55dd33=_0x24c791;logger[_0x3191('0xc')](_0x3191('0x50'),_0x55dd33['id']);return getEndUser(_0x546832,_0x425855['calleridname'],_0x425855[_0x3191('0x51')]);})[_0x3191('0x14')](function(_0x37c89e){_0x447a57=_0x37c89e;logger['info']('The\x20Enduser\x20ID\x20is:',_0x447a57['id']);return getTicket(_0x546832,_0x55dd33,_0x447a57,_0x3ea887,_0x425855);})['then'](function(_0x310ebc){if(_0x310ebc){logger['info']('The\x20Ticket\x20ID\x20is:',_0x310ebc['id']);switch(_0x546832['type']){case _0x3191('0x52'):logger[_0x3191('0xc')](_0x3191('0x4c'),_0x3191('0x53'));return request({'uri':util[_0x3191('0xd')](_0x3191('0x54'),_0x546832[_0x3191('0x19')],_0x55dd33['id'],_0x310ebc['id']),'method':_0x3191('0xe')});case _0x3191('0x55'):logger[_0x3191('0xc')](_0x3191('0x4c'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x3191('0xd')](_0x3191('0x56'),_0x3fdad3[_0x3191('0x11')]),'trigger:browser:url',{'uri':util[_0x3191('0xd')](_0x3191('0x57'),_0x546832[_0x3191('0x19')][_0x3191('0x58')]('/api/v2',''),_0x310ebc['id'])});break;default:logger[_0x3191('0x59')](_0x3191('0x4c'),'Zendesk\x20account\x20type\x20not\x20recognized');}}})[_0x3191('0x5a')](function(_0x30785b){logger[_0x3191('0x59')]('[QUEUE]\x20Error\x20running\x20Zendesk\x20integration',util['inspect'](_0x30785b,{'showHidden':!![],'depth':null}));});};exports[_0x3191('0x5b')]=function(_0x4d68c7,_0xbce55a,_0x12df91,_0x2f4001,_0x530385,_0x5917f6,_0x558080){var _0x3fddbf,_0x2d7fb1;_0x5917f6[_0x3191('0x19')]=intUtil['stripTrailingSlash'](_0x5917f6[_0x3191('0x19')]);_0x5917f6[_0x3191('0x4a')]=intUtil[_0x3191('0x4b')](_0x5917f6['serverUrl']);if(_0x558080&&_0x558080[_0x3191('0x5c')]&&_0x558080[_0x3191('0x5c')]!==_0x3191('0x5d')){logger[_0x3191('0xc')](_0x3191('0x5e'),_0x3191('0x4d'));_0xbce55a[_0x3191('0x4e')]=util[_0x3191('0xd')](_0x3191('0x5f'),_0x5917f6[_0x3191('0x4a')],_0xbce55a[_0x3191('0x4f')],md5(_0xbce55a['uniqueid']));}headers['Authorization']=getAuth(_0x5917f6);return getUser(_0x5917f6,_0x2f4001[_0x3191('0x60')])[_0x3191('0x14')](function(_0xd2d3d9){_0x3fddbf=_0xd2d3d9;logger[_0x3191('0xc')]('The\x20User\x20ID\x20is:',_0x3fddbf['id']);return getEndUser(_0x5917f6,_0xbce55a[_0x3191('0x61')],_0xbce55a[_0x3191('0x62')]);})['then'](function(_0x431bd1){_0x2d7fb1=_0x431bd1;logger[_0x3191('0xc')](_0x3191('0x63'),_0x2d7fb1['id']);return getTicket(_0x5917f6,_0x3fddbf,_0x2d7fb1,_0x12df91,_0xbce55a);})[_0x3191('0x14')](function(_0x885922){if(_0x885922){logger[_0x3191('0xc')]('The\x20Ticket\x20ID\x20is:',_0x885922['id']);switch(_0x5917f6[_0x3191('0x40')]){case _0x3191('0x52'):logger[_0x3191('0xc')]('[OUTBOUND]','Displaying\x20ticket\x20to\x20agent...');return request({'uri':util['format'](_0x3191('0x54'),_0x5917f6[_0x3191('0x19')],_0x3fddbf['id'],_0x885922['id']),'method':_0x3191('0xe')});case _0x3191('0x55'):logger[_0x3191('0xc')](_0x3191('0x5e'),_0x3191('0x64'));emit(util[_0x3191('0xd')](_0x3191('0x56'),_0x2f4001[_0x3191('0x11')]),_0x3191('0x65'),{'uri':util[_0x3191('0xd')]('%s/agent/tickets/%s',_0x5917f6[_0x3191('0x19')][_0x3191('0x58')]('/api/v2',''),_0x885922['id'])});break;default:logger[_0x3191('0x59')](_0x3191('0x5e'),'Zendesk\x20account\x20type\x20not\x20recognized');}}})['catch'](function(_0x55d809){logger[_0x3191('0x59')](_0x3191('0x66'),util[_0x3191('0x67')](_0x55d809,{'showHidden':!![],'depth':null}));});};exports[_0x3191('0x68')]=function(_0x3489a9,_0x114250,_0x510e6e,_0x2824a3,_0x31fbc8,_0x173871){var _0x153257,_0x3475fc;_0x173871[_0x3191('0x19')]=intUtil['stripTrailingSlash'](_0x173871['remoteUri']);_0x173871[_0x3191('0x4a')]=intUtil[_0x3191('0x4b')](_0x173871[_0x3191('0x4a')]);if(_0x31fbc8&&_0x31fbc8[_0x3191('0x69')]){logger['info']('['+_0x114250[_0x3191('0x6a')][_0x3191('0x6b')]()+']','Recording\x20is\x20enabled!');_0x114250[_0x3191('0x4e')]=util[_0x3191('0xd')](_0x3191('0x5f'),_0x173871[_0x3191('0x4a')],_0x114250[_0x3191('0x4f')],md5(_0x114250[_0x3191('0x4f')]));}else{_0x114250[_0x3191('0x4e')]='';}headers['Authorization']=getAuth(_0x173871);return getUser(_0x173871)[_0x3191('0x14')](function(_0x298830){_0x153257=_0x298830;logger['info'](_0x3191('0x50'),_0x153257['id']);return getEndUser(_0x173871,_0x114250[_0x3191('0x6c')],_0x114250[_0x3191('0x51')]);})['then'](function(_0x542d5a){_0x3475fc=_0x542d5a;logger['info'](_0x3191('0x63'),_0x3475fc['id']);return getTicket(_0x173871,_0x153257,_0x3475fc,_0x510e6e,_0x114250);})[_0x3191('0x14')](function(_0xc1ae97){if(_0xc1ae97){logger[_0x3191('0xc')](_0x3191('0x6d'),_0xc1ae97['id']);}})[_0x3191('0x5a')](function(_0x4f50d3){logger[_0x3191('0x59')]('['+_0x114250[_0x3191('0x6a')][_0x3191('0x6b')]()+']'+_0x3191('0x6e'),util[_0x3191('0x67')](_0x4f50d3,{'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 574a6c0..84c6560 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 _0x8fe3=['First_Name','What_Id','Last_Name','$se_module','talktime','Call_Duration','mm:ss','answertime','endtime','utc','starttime','YYYY-MM-DDTHH:mm:ss','lastevent','called','Call_Result','Called','connect','rejected','Rejected','abandoned','Abandoned','Timeout','outbound','Call_Type','Inbound','merge','Fields','Call\x20created!','err','queue','host','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','recordingURL','/api/voice/recordings/','uniqueid','zoho.eu','The\x20User\x20ID\x20is:','calleridnum','The\x20Call\x20ID\x20is:','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','/crm/EntityInfo.do?module=Calls&id=','recordingFormat','[OUTBOUND]','com','destcalleridname','destcalleridnum','Outbound','https://crm.','unmanaged','Recording\x20is\x20enabled!','/downloads?type=uniqueid&token=','calleridname','lodash','request-promise','util','moment','ioredis','../../../../config/environment','../../../../config/logger','redis','defaults','localhost','socket.io-emitter','debug','[HTTP]','length','includes','string','type','idField','variable','variableName','toString','customVariable','Variable','name','toLowerCase','indexOf','split','isNil','access_token','isBefore','expires_in','zone','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','then','seconds','catch','error','Failing\x20creating\x20the\x20access_token','stack','info','format','https://www.zohoapis.%s/crm/v2/users','ActiveUsers','Zoho-oauthtoken\x20','users','isArrayLikeObject','findIndex','email','Agent\x20found!','Using\x20the\x20admin\x20account!','profile','Administrator','user','The\x20failing\x20result\x20is','stringify','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','enduserType','https://www.zohoapis.','/crm/v2/','startCase','moduleCreate','role','first_name','last_name','data','code','SUCCESS','details','Error:\x20','log','moduleSearch','contact_lead','uri','/crm/v2/Contacts/search?criteria=((Phone:equals:','Contacts','/crm/v2/Leads/search?criteria=((Phone:equals:','Leads','nothing','Creating\x20new\x20call...','administrator','getString','Subjects','Who_Id','Full_Name'];(function(_0x9b2e44,_0x114d0f){var _0x1c50fe=function(_0xa0bc7f){while(--_0xa0bc7f){_0x9b2e44['push'](_0x9b2e44['shift']());}};_0x1c50fe(++_0x114d0f);}(_0x8fe3,0x163));var _0x38fe=function(_0x53d0a7,_0x259ab6){_0x53d0a7=_0x53d0a7-0x0;var _0x5e469c=_0x8fe3[_0x53d0a7];return _0x5e469c;};'use strict';var _=require(_0x38fe('0x0'));var rp=require(_0x38fe('0x1'));var md5=require('md5');var util=require(_0x38fe('0x2'));var intUtil=require('./util');var moment=require(_0x38fe('0x3'));var Redis=require(_0x38fe('0x4'));var BPromise=require('bluebird');var config=require(_0x38fe('0x5'));var logger=require(_0x38fe('0x6'))('zoho');config[_0x38fe('0x7')]=_[_0x38fe('0x8')](config['redis'],{'host':_0x38fe('0x9'),'port':0x18eb});var io=require(_0x38fe('0xa'))(new Redis(config[_0x38fe('0x7')]));function emit(_0x1c26e2,_0x4ee3cf,_0x17c321){io['to'](_0x1c26e2)['emit'](_0x4ee3cf,_0x17c321);}function request(_0xffba97){logger[_0x38fe('0xb')](_0x38fe('0xc'),JSON['stringify'](_0xffba97));return rp(_0xffba97);}function getCustomFields(_0x3335bc,_0x121a9f){var _0x2a3999={};if(_0x3335bc[_0x38fe('0xd')]>0x0){_['forEach'](_0x3335bc,function(_0x4d76b0){if(_[_0x38fe('0xe')]([_0x38fe('0xf'),'picklist'],_0x4d76b0[_0x38fe('0x10')])&&_0x4d76b0[_0x38fe('0x11')]){_0x2a3999[_0x4d76b0[_0x38fe('0x11')]]=_0x4d76b0['content']['toString']();}else if(_0x4d76b0[_0x38fe('0x10')]===_0x38fe('0x12')&&_0x4d76b0['variableName']&&_0x4d76b0[_0x38fe('0x11')]&&_0x121a9f[_0x4d76b0[_0x38fe('0x13')]]){_0x2a3999[_0x4d76b0['idField']]=_0x121a9f[_0x4d76b0['variableName']][_0x38fe('0x14')]();}else if(_0x4d76b0[_0x38fe('0x10')]===_0x38fe('0x15')&&_0x4d76b0[_0x38fe('0x16')]&&_0x4d76b0[_0x38fe('0x16')][_0x38fe('0x17')]&&_0x4d76b0[_0x38fe('0x11')]&&_0x121a9f[_0x4d76b0[_0x38fe('0x16')][_0x38fe('0x17')][_0x38fe('0x18')]()]){_0x2a3999[_0x4d76b0[_0x38fe('0x11')]]=_0x121a9f[_0x4d76b0['Variable'][_0x38fe('0x17')]['toLowerCase']()][_0x38fe('0x14')]();}});}return _0x2a3999;}function getName(_0x132a4a){if(_0x132a4a[_0x38fe('0x19')]('\x20')>0x0){var _0x397eae=_0x132a4a[_0x38fe('0x1a')](/ (.+)/);if(_0x397eae[0x1]){return _0x397eae;}}return[_0x132a4a,_0x132a4a];}var accountsTokens={};function getAccessToken(_0x2bfd81){return new Promise(function(_0x42a842,_0x2820de){if(!_[_0x38fe('0x1b')](accountsTokens[_0x2bfd81['id']])&&!_[_0x38fe('0x1b')](accountsTokens[_0x2bfd81['id']][_0x38fe('0x1c')])){if(moment()[_0x38fe('0x1d')](accountsTokens[_0x2bfd81['id']][_0x38fe('0x1e')])){_0x42a842(accountsTokens[_0x2bfd81['id']][_0x38fe('0x1c')]);}}var _0x52c4af;switch(_0x2bfd81[_0x38fe('0x1f')]){case'US':_0x52c4af='https://accounts.zoho.com';break;case'AU':_0x52c4af=_0x38fe('0x20');break;case'EU':_0x52c4af='https://accounts.zoho.eu';break;case'IN':_0x52c4af=_0x38fe('0x21');break;case'CN':_0x52c4af=_0x38fe('0x22');break;default:_0x52c4af=_0x38fe('0x23');break;}var _0x50020c={'method':_0x38fe('0x24'),'uri':_0x52c4af+_0x38fe('0x25'),'qs':{'refresh_token':_0x2bfd81[_0x38fe('0x26')],'client_id':_0x2bfd81[_0x38fe('0x27')],'client_secret':_0x2bfd81[_0x38fe('0x28')],'grant_type':'refresh_token'},'json':!![]};return rp(_0x50020c)[_0x38fe('0x29')](function(_0x2b9a05){accountsTokens[_0x2bfd81['id']]={'access_token':_0x2b9a05[_0x38fe('0x1c')],'expires_in':moment()['add'](_0x2b9a05[_0x38fe('0x1e')],_0x38fe('0x2a'))};_0x42a842(_0x2b9a05[_0x38fe('0x1c')]);})[_0x38fe('0x2b')](function(_0x3e507d){logger[_0x38fe('0x2c')](_0x38fe('0x2d'),_0x3e507d[_0x38fe('0x2e')]);_0x2820de(_0x3e507d);});});}function getUser(_0x1a2889,_0x18b087,_0x245176,_0xfbc8d3){logger[_0x38fe('0x2f')]('Search\x20user');return request({'method':'GET','uri':util[_0x38fe('0x30')](_0x38fe('0x31'),_0x18b087),'qs':{'type':_0x38fe('0x32')},'headers':{'Authorization':_0x38fe('0x33')+_0x1a2889},'json':!![]})[_0x38fe('0x29')](function(_0x20a05e){if(_0x20a05e[_0x38fe('0x34')]){var _0x74ce94=-0x1;if(_[_0x38fe('0x35')](_0x20a05e[_0x38fe('0x34')])){if(!_[_0x38fe('0x1b')](_0xfbc8d3)){_0x74ce94=_[_0x38fe('0x36')](_0x20a05e[_0x38fe('0x34')],function(_0x5aabc7){return _0x5aabc7[_0x38fe('0x37')]===_0xfbc8d3;});}if(_0x74ce94>=0x0){logger[_0x38fe('0x2f')](_0x38fe('0x38'));}else{logger[_0x38fe('0x2f')](_0x38fe('0x39'));_0x74ce94=_['findIndex'](_0x20a05e[_0x38fe('0x34')],function(_0x364553){return _0x364553[_0x38fe('0x3a')][_0x38fe('0x17')]===_0x38fe('0x3b');});}return _0x20a05e[_0x38fe('0x34')][_0x74ce94];}else{if(_0x20a05e[_0x38fe('0x3c')][_0x38fe('0x3a')][_0x38fe('0x17')]===_0x38fe('0x3b')){logger[_0x38fe('0x2f')](_0x38fe('0x39'));user=_0x20a05e[_0x38fe('0x3c')];return user;}else{logger[_0x38fe('0x2c')](_0x38fe('0x3d'),JSON[_0x38fe('0x3e')](_0x20a05e));throw new Error(_0x38fe('0x3f')+JSON[_0x38fe('0x3e')](_0x20a05e));}}}else{logger['error'](_0x38fe('0x3d'),JSON[_0x38fe('0x3e')](_0x20a05e));throw new Error('Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20'+JSON[_0x38fe('0x3e')](_0x20a05e));}})['catch'](function(_0x3a6e3f){console[_0x38fe('0x2c')](_0x3a6e3f);});}function getZohoUser(_0x2160cb,_0x764d69){return new BPromise(function(_0x40db8e,_0x333561){request(_0x2160cb)['then'](function(_0x452953){var _0x13ddbd=null;if(_0x452953){_0x13ddbd=_0x452953['data'][0x0];_0x13ddbd[_0x38fe('0x40')]=_0x764d69;}_0x40db8e(_0x13ddbd);})[_0x38fe('0x2b')](function(_0x30c889){_0x333561(_0x30c889);});});}function createEndUser(_0x4a9cf8,_0x46f490,_0x148c50,_0x591485,_0x36d2f8,_0x2b81fe){var _0x148c50=getName(_0x148c50);return request({'method':_0x38fe('0x24'),'uri':_0x38fe('0x41')+_0x46f490+_0x38fe('0x42')+_[_0x38fe('0x43')](_0x2b81fe[_0x38fe('0x44')])+'s','body':{'data':[{'Last_Name':_0x148c50[0x1],'First_Name':_0x148c50[0x0],'Phone':_0x591485,'Owner':{'name':!_['isNil'](_0x36d2f8['role'][_0x38fe('0x17')])?_0x36d2f8[_0x38fe('0x45')][_0x38fe('0x17')]:!_['isNil'](_0x36d2f8['first_name'])?_0x36d2f8[_0x38fe('0x46')]+'\x20'+_0x36d2f8[_0x38fe('0x47')]:_0x36d2f8[_0x38fe('0x47')],'id':_0x36d2f8['id']}}]},'headers':{'Authorization':_0x38fe('0x33')+_0x4a9cf8},'json':!![]})['then'](function(_0x37bdaf){if(_0x37bdaf&&_0x37bdaf[_0x38fe('0x48')][0x0][_0x38fe('0x49')]===_0x38fe('0x4a')){var _0x1918fa=_0x37bdaf[_0x38fe('0x48')][0x0][_0x38fe('0x4b')];_0x1918fa[_0x38fe('0x40')]=_[_0x38fe('0x43')](_0x2b81fe['moduleCreate'])+'s';return _0x1918fa;}logger['error'](_0x38fe('0x3d'),JSON[_0x38fe('0x3e')](data));throw new Error(_0x38fe('0x4c')+JSON['stringify'](data));})['catch'](function(_0x5db578){console[_0x38fe('0x4d')]('CREATE\x20ERROR',_0x5db578);});}function getEndUser(_0x271d35,_0x4ae961,_0x22f65c,_0x3787e8,_0x288a28,_0x104499,_0x243202){var _0x420260={'method':'GET','uri':'','headers':{'Authorization':_0x38fe('0x33')+_0x271d35},'json':!![]};switch(_0x243202[_0x38fe('0x4e')]){case _0x38fe('0x4f'):_0x420260[_0x38fe('0x50')]='https://www.zohoapis.'+_0x4ae961+_0x38fe('0x51')+_0x288a28+'))';return getZohoUser(_0x420260,_0x38fe('0x52'))[_0x38fe('0x29')](function(_0x1de907){if(_0x1de907)return _0x1de907;_0x420260[_0x38fe('0x50')]=_0x38fe('0x41')+_0x4ae961+_0x38fe('0x53')+_0x288a28+'))';return getZohoUser(_0x420260,_0x38fe('0x54'))[_0x38fe('0x29')](function(_0x241cd5){if(_0x241cd5)return _0x241cd5;if(_0x243202['moduleCreate']!=_0x38fe('0x55')){return createEndUser(_0x271d35,_0x4ae961,_0x3787e8,_0x288a28,_0x104499,_0x243202);}else{return{};}});});break;case'contact':_0x420260[_0x38fe('0x50')]=_0x38fe('0x41')+_0x4ae961+'/crm/v2/Contacts/search?criteria=((Phone:equals:'+_0x288a28+'))';return getZohoUser(_0x420260,_0x38fe('0x52'))['then'](function(_0x3bd16b){if(_0x3bd16b)return _0x3bd16b;if(_0x243202[_0x38fe('0x44')]!=_0x38fe('0x55')){return createEndUser(_0x271d35,_0x4ae961,_0x3787e8,_0x288a28,_0x104499,_0x243202);}else{return{};}});break;case'lead':_0x420260['uri']=_0x38fe('0x41')+_0x4ae961+_0x38fe('0x53')+_0x288a28+'))';return getZohoUser(_0x420260,_0x38fe('0x54'))[_0x38fe('0x29')](function(_0x461d0f){if(_0x461d0f)return _0x461d0f;if(_0x243202[_0x38fe('0x44')]!=_0x38fe('0x55')){return createEndUser(_0x271d35,_0x4ae961,_0x3787e8,_0x288a28,_0x104499,_0x243202);}else{return{};}});break;}}function getCall(_0xf136c,_0x7e6f33,_0x51aa9d,_0x2a6d59,_0x5729d8,_0x181fdc,_0x29cb57,_0x45cbe9){logger['info'](_0x38fe('0x56'));var _0x21d6f2={};_0x21d6f2['Owner']={'name':!_[_0x38fe('0x1b')](_0x2a6d59[_0x38fe('0x45')][_0x38fe('0x17')])&&!_[_0x38fe('0x1b')](_0x2a6d59[_0x38fe('0x3a')][_0x38fe('0x17')])&&_0x2a6d59[_0x38fe('0x3a')]['name']===_0x38fe('0x57')?_0x2a6d59[_0x38fe('0x45')][_0x38fe('0x17')]:!_[_0x38fe('0x1b')](_0x2a6d59[_0x38fe('0x46')])?_0x2a6d59[_0x38fe('0x46')]+'\x20'+_0x2a6d59[_0x38fe('0x47')]:_0x2a6d59[_0x38fe('0x47')],'id':_0x2a6d59['id']};_0x21d6f2['Subject']=intUtil[_0x38fe('0x58')](_0x181fdc[_0x38fe('0x59')],_0x29cb57,'\x20');_0x21d6f2['Description']=intUtil[_0x38fe('0x58')](_0x181fdc['Descriptions'],_0x29cb57,'\x0a');if(_0x5729d8[_0x38fe('0x40')]===_0x38fe('0x52')){_0x21d6f2[_0x38fe('0x5a')]={'name':!_[_0x38fe('0x1b')](_0x5729d8[_0x38fe('0x5b')])?_0x5729d8['Full_Name']:!_['isNil'](_0x5729d8[_0x38fe('0x5c')])?_0x5729d8[_0x38fe('0x5c')]+'\x20'+_0x5729d8['Last_Name']:_0x5729d8['Last_Name'],'id':_0x5729d8['id']};}if(_0x5729d8['enduserType']==='Leads'){_0x21d6f2[_0x38fe('0x5d')]={'name':!_[_0x38fe('0x1b')](_0x5729d8[_0x38fe('0x5b')])?_0x5729d8[_0x38fe('0x5b')]:!_[_0x38fe('0x1b')](_0x5729d8[_0x38fe('0x5c')])?_0x5729d8[_0x38fe('0x5c')]+'\x20'+_0x5729d8[_0x38fe('0x5e')]:_0x5729d8[_0x38fe('0x5e')],'id':_0x5729d8['id']};_0x21d6f2[_0x38fe('0x5f')]=_[_0x38fe('0x43')](_0x5729d8[_0x38fe('0x40')]);}if(_0x29cb57[_0x38fe('0x60')]){_0x21d6f2[_0x38fe('0x61')]=moment['utc'](parseInt(_0x29cb57[_0x38fe('0x60')])*0x3e8)[_0x38fe('0x30')](_0x38fe('0x62'));}else if(_0x29cb57[_0x38fe('0x63')]&&_0x29cb57[_0x38fe('0x64')]){_0x21d6f2[_0x38fe('0x61')]=moment[_0x38fe('0x65')](moment(_0x29cb57[_0x38fe('0x64')],'YYYY-MM-DDTHH:mm:ss')['diff'](moment(_0x29cb57[_0x38fe('0x66')],_0x38fe('0x67'))))[_0x38fe('0x30')](_0x38fe('0x62'));}switch(_0x29cb57[_0x38fe('0x68')]){case _0x38fe('0x69'):_0x21d6f2[_0x38fe('0x6a')]=_0x38fe('0x6b');break;case'complete':case _0x38fe('0x6c'):_0x21d6f2[_0x38fe('0x6a')]='Answered';break;case _0x38fe('0x6d'):_0x21d6f2[_0x38fe('0x6a')]=_0x38fe('0x6e');break;case _0x38fe('0x6f'):_0x21d6f2['Call_Result']=_0x38fe('0x70');break;case'timeout':_0x21d6f2[_0x38fe('0x6a')]=_0x38fe('0x71');default:}_0x21d6f2['Call_Start_Time']=(_0x45cbe9===_0x38fe('0x72')?moment(_0x29cb57[_0x38fe('0x66')])[_0x38fe('0x30')](_0x38fe('0x67')):moment(_0x29cb57['agentcalledAt'])[_0x38fe('0x30')](_0x38fe('0x67')))||moment()['format'](_0x38fe('0x67'));_0x21d6f2[_0x38fe('0x73')]=_0x45cbe9||_0x38fe('0x74');_0x21d6f2=_[_0x38fe('0x75')](_0x21d6f2,getCustomFields(_0x181fdc[_0x38fe('0x76')],_0x29cb57));return request({'method':_0x38fe('0x24'),'uri':_0x38fe('0x41')+_0x7e6f33+'/crm/v2/Calls','headers':{'Authorization':_0x38fe('0x33')+_0xf136c},'body':{'data':[_0x21d6f2]},'json':!![]})[_0x38fe('0x29')](function(_0x2cc8f2){if(_0x2cc8f2&&_0x2cc8f2['data'][0x0][_0x38fe('0x49')]===_0x38fe('0x4a')){logger[_0x38fe('0x2f')](_0x38fe('0x77'));return{'id':_0x2cc8f2[_0x38fe('0x48')][0x0][_0x38fe('0x4b')]['id']};}})['catch'](function(_0x4d5a08){logger[_0x38fe('0x2f')](_0x38fe('0x78'),_0x4d5a08['stack']);console['log'](_0x38fe('0x78'),_0x4d5a08);});}exports[_0x38fe('0x79')]=function(_0x220919,_0x2ec29d,_0x35cd7c,_0x19de22,_0x381932,_0x5e8856){var _0x52e80e,_0x469b26,_0x63b68c;_0x5e8856[_0x38fe('0x7a')]=intUtil[_0x38fe('0x7b')](_0x5e8856[_0x38fe('0x7a')]);_0x5e8856[_0x38fe('0x7c')]=intUtil[_0x38fe('0x7b')](_0x5e8856[_0x38fe('0x7c')]);if(_0x381932&&_0x381932[_0x38fe('0x7d')]){logger['info'](_0x38fe('0x7e'),'Recording\x20is\x20enabled!');_0x2ec29d[_0x38fe('0x7f')]=_0x5e8856[_0x38fe('0x7c')]+_0x38fe('0x80')+_0x2ec29d[_0x38fe('0x81')]+'/downloads?type=uniqueid&token='+md5(_0x2ec29d[_0x38fe('0x81')]);}else{_0x2ec29d[_0x38fe('0x7f')]='';}var _0x128d2a=_0x5e8856[_0x38fe('0x7a')]===_0x38fe('0x82')?'eu':'com';return getAccessToken(_0x5e8856)[_0x38fe('0x29')](function(_0x32b93b){_0x63b68c=_0x32b93b;return getUser(_0x63b68c,_0x128d2a,_0x5e8856,_0x19de22[_0x38fe('0x37')]);})[_0x38fe('0x29')](function(_0x1c7592){_0x52e80e=_0x1c7592;logger['info'](_0x38fe('0x83'),_0x52e80e['id']);return getEndUser(_0x63b68c,_0x128d2a,_0x5e8856,_0x2ec29d['calleridname'],_0x2ec29d[_0x38fe('0x84')],_0x52e80e,_0x35cd7c);})[_0x38fe('0x29')](function(_0x5ca621){_0x469b26=_0x5ca621;return getCall(_0x63b68c,_0x128d2a,_0x5e8856,_0x52e80e,_0x469b26,_0x35cd7c,_0x2ec29d,_0x38fe('0x74'));})[_0x38fe('0x29')](function(_0x40ce7d){if(_0x40ce7d){logger[_0x38fe('0x2f')](_0x38fe('0x85'),_0x40ce7d['id']);logger[_0x38fe('0x2f')](_0x38fe('0x7e'),_0x38fe('0x86'));emit(util[_0x38fe('0x30')](_0x38fe('0x87'),_0x19de22[_0x38fe('0x17')]),_0x38fe('0x88'),{'uri':'https://crm.'+_0x5e8856['host']+_0x38fe('0x89')+_0x40ce7d['id']});}})[_0x38fe('0x2b')](function(_0x5f12b5){logger[_0x38fe('0x2c')](_0x38fe('0x7e'),JSON[_0x38fe('0x3e')](_0x5f12b5));});};exports[_0x38fe('0x72')]=function(_0x1e1d53,_0x50adde,_0x1c6159,_0x5f4d8f,_0x5c0450,_0x3f64fd,_0x176674){var _0x4f7204,_0x1fc5db,_0x12e393;_0x3f64fd[_0x38fe('0x7a')]=intUtil[_0x38fe('0x7b')](_0x3f64fd['host']);_0x3f64fd['serverUrl']=intUtil['stripTrailingSlash'](_0x3f64fd[_0x38fe('0x7c')]);if(_0x176674&&_0x176674[_0x38fe('0x8a')]&&_0x176674[_0x38fe('0x8a')]!=='none'){logger[_0x38fe('0x2f')](_0x38fe('0x8b'),'Recording\x20is\x20enabled!');_0x50adde[_0x38fe('0x7f')]=_0x3f64fd['serverUrl']+_0x38fe('0x80')+_0x50adde[_0x38fe('0x81')]+'/downloads?type=uniqueid&token='+md5(_0x50adde[_0x38fe('0x81')]);}var _0x3132f9=_0x3f64fd[_0x38fe('0x7a')]==='zoho.eu'?'eu':_0x38fe('0x8c');return getAccessToken(_0x3f64fd)[_0x38fe('0x29')](function(_0x38788c){_0x12e393=_0x38788c;return getUser(_0x12e393,_0x3132f9,_0x3f64fd,_0x5f4d8f[_0x38fe('0x37')]);})[_0x38fe('0x29')](function(_0x158abf){_0x4f7204=_0x158abf;logger[_0x38fe('0x2f')](_0x38fe('0x83'),_0x4f7204['id']);return getEndUser(_0x12e393,_0x3132f9,_0x3f64fd,_0x50adde[_0x38fe('0x8d')],_0x50adde[_0x38fe('0x8e')],_0x4f7204,_0x1c6159);})['then'](function(_0x16c998){_0x1fc5db=_0x16c998;return getCall(_0x12e393,_0x3132f9,_0x3f64fd,_0x4f7204,_0x1fc5db,_0x1c6159,_0x50adde,_0x38fe('0x8f'));})['then'](function(_0x4fbf49){if(_0x4fbf49){logger[_0x38fe('0x2f')](_0x38fe('0x85'),_0x4fbf49['id']);logger[_0x38fe('0x2f')](_0x38fe('0x8b'),_0x38fe('0x86'));emit(util[_0x38fe('0x30')](_0x38fe('0x87'),_0x5f4d8f[_0x38fe('0x17')]),_0x38fe('0x88'),{'uri':_0x38fe('0x90')+_0x3f64fd['host']+_0x38fe('0x89')+_0x4fbf49['id']});}})['catch'](function(_0x3b5d3b){logger[_0x38fe('0x2c')]('[OUTBOUND]',JSON[_0x38fe('0x3e')](_0x3b5d3b));});};exports[_0x38fe('0x91')]=function(_0xf7c300,_0x9dbf8a,_0x547a82,_0x392037,_0x4d3056,_0x823460){var _0x5a46e2,_0x15581a,_0x3ed8a6;_0x823460[_0x38fe('0x7a')]=intUtil[_0x38fe('0x7b')](_0x823460['host']);_0x823460[_0x38fe('0x7c')]=intUtil[_0x38fe('0x7b')](_0x823460[_0x38fe('0x7c')]);if(_0x4d3056&&_0x4d3056[_0x38fe('0x7d')]){logger['info']('['+_0x9dbf8a[_0x38fe('0x68')]['toUpperCase']()+']',_0x38fe('0x92'));_0x9dbf8a[_0x38fe('0x7f')]=_0x823460[_0x38fe('0x7c')]+_0x38fe('0x80')+_0x9dbf8a[_0x38fe('0x81')]+_0x38fe('0x93')+md5(_0x9dbf8a['uniqueid']);}else{_0x9dbf8a[_0x38fe('0x7f')]='';}var _0x19c4a6=_0x823460[_0x38fe('0x7a')]==='zoho.eu'?'eu':'com';return getAccessToken(_0x823460)[_0x38fe('0x29')](function(_0x55b4c0){_0x3ed8a6=_0x55b4c0;return getUser(_0x3ed8a6,_0x19c4a6,_0x823460);})['then'](function(_0x5c3200){_0x5a46e2=_0x5c3200;logger[_0x38fe('0x2f')](_0x38fe('0x83'),_0x5a46e2['id']);return getEndUser(_0x3ed8a6,_0x19c4a6,_0x823460,_0x9dbf8a[_0x38fe('0x94')],_0x9dbf8a[_0x38fe('0x84')],_0x5a46e2,_0x547a82);})[_0x38fe('0x29')](function(_0x342ee1){_0x15581a=_0x342ee1;return getCall(_0x3ed8a6,_0x19c4a6,_0x823460,_0x5a46e2,_0x15581a,_0x547a82,_0x9dbf8a,_0x38fe('0x74'));})[_0x38fe('0x29')](function(_0xa690cb){if(_0xa690cb){logger[_0x38fe('0x2f')]('The\x20Call\x20ID\x20is:',_0xa690cb['id']);}})['catch'](function(_0xbe3b2d){logger[_0x38fe('0x2c')]('['+_0x9dbf8a[_0x38fe('0x68')]['toUpperCase']()+']',JSON[_0x38fe('0x3e')](_0xbe3b2d));});}; \ No newline at end of file +var _0x24f0=['Call_Duration','diff','starttime','YYYY-MM-DDTHH:mm:ss','lastevent','called','Called','Call_Result','Answered','rejected','Rejected','abandoned','Abandoned','Timeout','Call_Start_Time','outbound','agentcalledAt','Fields','/crm/v2/Calls','Call\x20created!','err','stripTrailingSlash','host','serverUrl','monitor_format','[QUEUE]','recordingURL','/api/voice/recordings/','uniqueid','/downloads?type=uniqueid&token=','zoho.eu','com','The\x20User\x20ID\x20is:','Inbound','The\x20Call\x20ID\x20is:','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','https://crm.','/crm/EntityInfo.do?module=Calls&id=','recordingFormat','none','Recording\x20is\x20enabled!','destcalleridname','[OUTBOUND]','toUpperCase','util','./util','moment','zoho','redis','defaults','localhost','socket.io-emitter','debug','[HTTP]','length','forEach','includes','string','picklist','type','idField','content','toString','variable','variableName','customVariable','Variable','name','toLowerCase','split','isNil','access_token','isBefore','expires_in','zone','https://accounts.zoho.eu','https://accounts.zoho.in','https://accounts.zoho.com.cn','POST','refreshToken','clientId','then','add','seconds','catch','Failing\x20creating\x20the\x20access_token','stack','info','GET','https://www.zohoapis.%s/crm/v2/users','ActiveUsers','Zoho-oauthtoken\x20','users','isArrayLikeObject','findIndex','email','Using\x20the\x20admin\x20account!','profile','Administrator','user','The\x20failing\x20result\x20is','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','stringify','error','data','enduserType','/crm/v2/','moduleCreate','role','first_name','last_name','code','SUCCESS','details','startCase','log','contact_lead','/crm/v2/Contacts/search?criteria=((Phone:equals:','Contacts','uri','https://www.zohoapis.','Leads','nothing','lead','/crm/v2/Leads/search?criteria=((Phone:equals:','Owner','administrator','Subject','Subjects','Description','getString','Descriptions','Who_Id','Full_Name','First_Name','Last_Name','$se_module','utc','talktime','format','mm:ss','endtime'];(function(_0x572e6f,_0x5b359a){var _0xd6332d=function(_0x453e45){while(--_0x453e45){_0x572e6f['push'](_0x572e6f['shift']());}};_0xd6332d(++_0x5b359a);}(_0x24f0,0xbe));var _0x024f=function(_0x47021f,_0xee5bce){_0x47021f=_0x47021f-0x0;var _0xd535b6=_0x24f0[_0x47021f];return _0xd535b6;};'use strict';var _=require('lodash');var rp=require('request-promise');var md5=require('md5');var util=require(_0x024f('0x0'));var intUtil=require(_0x024f('0x1'));var moment=require(_0x024f('0x2'));var Redis=require('ioredis');var BPromise=require('bluebird');var config=require('../../../../config/environment');var logger=require('../../../../config/logger')(_0x024f('0x3'));config[_0x024f('0x4')]=_[_0x024f('0x5')](config[_0x024f('0x4')],{'host':_0x024f('0x6'),'port':0x18eb});var io=require(_0x024f('0x7'))(new Redis(config[_0x024f('0x4')]));function emit(_0x5202ae,_0x1ecb50,_0x2b3ec9){io['to'](_0x5202ae)['emit'](_0x1ecb50,_0x2b3ec9);}function request(_0x5492ce){logger[_0x024f('0x8')](_0x024f('0x9'),JSON['stringify'](_0x5492ce));return rp(_0x5492ce);}function getCustomFields(_0x4b78a2,_0x356183){var _0x587355={};if(_0x4b78a2[_0x024f('0xa')]>0x0){_[_0x024f('0xb')](_0x4b78a2,function(_0x43e28){if(_[_0x024f('0xc')]([_0x024f('0xd'),_0x024f('0xe')],_0x43e28[_0x024f('0xf')])&&_0x43e28[_0x024f('0x10')]){_0x587355[_0x43e28['idField']]=_0x43e28[_0x024f('0x11')][_0x024f('0x12')]();}else if(_0x43e28['type']===_0x024f('0x13')&&_0x43e28['variableName']&&_0x43e28['idField']&&_0x356183[_0x43e28['variableName']]){_0x587355[_0x43e28['idField']]=_0x356183[_0x43e28[_0x024f('0x14')]][_0x024f('0x12')]();}else if(_0x43e28[_0x024f('0xf')]===_0x024f('0x15')&&_0x43e28[_0x024f('0x16')]&&_0x43e28[_0x024f('0x16')][_0x024f('0x17')]&&_0x43e28[_0x024f('0x10')]&&_0x356183[_0x43e28['Variable']['name']['toLowerCase']()]){_0x587355[_0x43e28[_0x024f('0x10')]]=_0x356183[_0x43e28[_0x024f('0x16')][_0x024f('0x17')][_0x024f('0x18')]()][_0x024f('0x12')]();}});}return _0x587355;}function getName(_0x53d85e){if(_0x53d85e['indexOf']('\x20')>0x0){var _0x535d50=_0x53d85e[_0x024f('0x19')](/ (.+)/);if(_0x535d50[0x1]){return _0x535d50;}}return[_0x53d85e,_0x53d85e];}var accountsTokens={};function getAccessToken(_0x13d966){return new Promise(function(_0x514250,_0x53d04c){if(!_[_0x024f('0x1a')](accountsTokens[_0x13d966['id']])&&!_[_0x024f('0x1a')](accountsTokens[_0x13d966['id']][_0x024f('0x1b')])){if(moment()[_0x024f('0x1c')](accountsTokens[_0x13d966['id']][_0x024f('0x1d')])){_0x514250(accountsTokens[_0x13d966['id']][_0x024f('0x1b')]);}}var _0x4b3018;switch(_0x13d966[_0x024f('0x1e')]){case'US':_0x4b3018='https://accounts.zoho.com';break;case'AU':_0x4b3018='https://accounts.zoho.com.au';break;case'EU':_0x4b3018=_0x024f('0x1f');break;case'IN':_0x4b3018=_0x024f('0x20');break;case'CN':_0x4b3018=_0x024f('0x21');break;default:_0x4b3018=_0x024f('0x1f');break;}var _0x259e48={'method':_0x024f('0x22'),'uri':_0x4b3018+'/oauth/v2/token','qs':{'refresh_token':_0x13d966[_0x024f('0x23')],'client_id':_0x13d966[_0x024f('0x24')],'client_secret':_0x13d966['clientSecret'],'grant_type':'refresh_token'},'json':!![]};return rp(_0x259e48)[_0x024f('0x25')](function(_0x5f2608){accountsTokens[_0x13d966['id']]={'access_token':_0x5f2608[_0x024f('0x1b')],'expires_in':moment()[_0x024f('0x26')](_0x5f2608['expires_in'],_0x024f('0x27'))};_0x514250(_0x5f2608[_0x024f('0x1b')]);})[_0x024f('0x28')](function(_0x175127){logger['error'](_0x024f('0x29'),_0x175127[_0x024f('0x2a')]);_0x53d04c(_0x175127);});});}function getUser(_0x2a674f,_0x2ab8fd,_0x21d297,_0x5c23fc){logger[_0x024f('0x2b')]('Search\x20user');return request({'method':_0x024f('0x2c'),'uri':util['format'](_0x024f('0x2d'),_0x2ab8fd),'qs':{'type':_0x024f('0x2e')},'headers':{'Authorization':_0x024f('0x2f')+_0x2a674f},'json':!![]})['then'](function(_0x3afdbd){if(_0x3afdbd[_0x024f('0x30')]){var _0x563dde=-0x1;if(_[_0x024f('0x31')](_0x3afdbd[_0x024f('0x30')])){if(!_[_0x024f('0x1a')](_0x5c23fc)){_0x563dde=_[_0x024f('0x32')](_0x3afdbd['users'],function(_0x4f4c2b){return _0x4f4c2b[_0x024f('0x33')]===_0x5c23fc;});}if(_0x563dde>=0x0){logger['info']('Agent\x20found!');}else{logger[_0x024f('0x2b')](_0x024f('0x34'));_0x563dde=_['findIndex'](_0x3afdbd[_0x024f('0x30')],function(_0x140c48){return _0x140c48[_0x024f('0x35')][_0x024f('0x17')]===_0x024f('0x36');});}return _0x3afdbd['users'][_0x563dde];}else{if(_0x3afdbd['user'][_0x024f('0x35')]['name']==='Administrator'){logger['info'](_0x024f('0x34'));user=_0x3afdbd[_0x024f('0x37')];return user;}else{logger['error'](_0x024f('0x38'),JSON['stringify'](_0x3afdbd));throw new Error(_0x024f('0x39')+JSON[_0x024f('0x3a')](_0x3afdbd));}}}else{logger[_0x024f('0x3b')]('The\x20failing\x20result\x20is',JSON[_0x024f('0x3a')](_0x3afdbd));throw new Error(_0x024f('0x39')+JSON[_0x024f('0x3a')](_0x3afdbd));}})[_0x024f('0x28')](function(_0x24c362){console['error'](_0x24c362);});}function getZohoUser(_0x70ef70,_0xefa7ea){return new BPromise(function(_0x228e7c,_0x507a0f){request(_0x70ef70)[_0x024f('0x25')](function(_0x52e25e){var _0x272e5b=null;if(_0x52e25e){_0x272e5b=_0x52e25e[_0x024f('0x3c')][0x0];_0x272e5b[_0x024f('0x3d')]=_0xefa7ea;}_0x228e7c(_0x272e5b);})[_0x024f('0x28')](function(_0xfafeb1){_0x507a0f(_0xfafeb1);});});}function createEndUser(_0x3d6234,_0x116388,_0x48d9a9,_0x1ecc98,_0x248192,_0x1247c8){var _0x48d9a9=getName(_0x48d9a9);return request({'method':_0x024f('0x22'),'uri':'https://www.zohoapis.'+_0x116388+_0x024f('0x3e')+_['startCase'](_0x1247c8[_0x024f('0x3f')])+'s','body':{'data':[{'Last_Name':_0x48d9a9[0x1],'First_Name':_0x48d9a9[0x0],'Phone':_0x1ecc98,'Owner':{'name':!_[_0x024f('0x1a')](_0x248192[_0x024f('0x40')][_0x024f('0x17')])?_0x248192[_0x024f('0x40')]['name']:!_[_0x024f('0x1a')](_0x248192[_0x024f('0x41')])?_0x248192[_0x024f('0x41')]+'\x20'+_0x248192[_0x024f('0x42')]:_0x248192[_0x024f('0x42')],'id':_0x248192['id']}}]},'headers':{'Authorization':_0x024f('0x2f')+_0x3d6234},'json':!![]})['then'](function(_0x51328b){if(_0x51328b&&_0x51328b['data'][0x0][_0x024f('0x43')]===_0x024f('0x44')){var _0x5d0617=_0x51328b['data'][0x0][_0x024f('0x45')];_0x5d0617['enduserType']=_[_0x024f('0x46')](_0x1247c8['moduleCreate'])+'s';return _0x5d0617;}logger[_0x024f('0x3b')](_0x024f('0x38'),JSON['stringify'](data));throw new Error('Error:\x20'+JSON[_0x024f('0x3a')](data));})[_0x024f('0x28')](function(_0x5e12ee){console[_0x024f('0x47')]('CREATE\x20ERROR',_0x5e12ee);});}function getEndUser(_0x44868d,_0x286106,_0x12b78a,_0x5e4a23,_0x278982,_0x488aec,_0x194698){var _0x3eb624={'method':_0x024f('0x2c'),'uri':'','headers':{'Authorization':_0x024f('0x2f')+_0x44868d},'json':!![]};switch(_0x194698['moduleSearch']){case _0x024f('0x48'):_0x3eb624['uri']='https://www.zohoapis.'+_0x286106+_0x024f('0x49')+_0x278982+'))';return getZohoUser(_0x3eb624,_0x024f('0x4a'))[_0x024f('0x25')](function(_0x37a95a){if(_0x37a95a)return _0x37a95a;_0x3eb624[_0x024f('0x4b')]=_0x024f('0x4c')+_0x286106+'/crm/v2/Leads/search?criteria=((Phone:equals:'+_0x278982+'))';return getZohoUser(_0x3eb624,_0x024f('0x4d'))['then'](function(_0x11aa70){if(_0x11aa70)return _0x11aa70;if(_0x194698[_0x024f('0x3f')]!=_0x024f('0x4e')){return createEndUser(_0x44868d,_0x286106,_0x5e4a23,_0x278982,_0x488aec,_0x194698);}else{return{};}});});break;case'contact':_0x3eb624[_0x024f('0x4b')]=_0x024f('0x4c')+_0x286106+_0x024f('0x49')+_0x278982+'))';return getZohoUser(_0x3eb624,'Contacts')[_0x024f('0x25')](function(_0x4a9b38){if(_0x4a9b38)return _0x4a9b38;if(_0x194698[_0x024f('0x3f')]!=_0x024f('0x4e')){return createEndUser(_0x44868d,_0x286106,_0x5e4a23,_0x278982,_0x488aec,_0x194698);}else{return{};}});break;case _0x024f('0x4f'):_0x3eb624[_0x024f('0x4b')]=_0x024f('0x4c')+_0x286106+_0x024f('0x50')+_0x278982+'))';return getZohoUser(_0x3eb624,_0x024f('0x4d'))[_0x024f('0x25')](function(_0x391bd4){if(_0x391bd4)return _0x391bd4;if(_0x194698[_0x024f('0x3f')]!=_0x024f('0x4e')){return createEndUser(_0x44868d,_0x286106,_0x5e4a23,_0x278982,_0x488aec,_0x194698);}else{return{};}});break;}}function getCall(_0x2925ec,_0x59f4b7,_0x27f73d,_0x3d5b21,_0x143648,_0x83c583,_0xcf2bcc,_0x55394b){logger[_0x024f('0x2b')]('Creating\x20new\x20call...');var _0x3e2b4f={};_0x3e2b4f[_0x024f('0x51')]={'name':!_[_0x024f('0x1a')](_0x3d5b21[_0x024f('0x40')][_0x024f('0x17')])&&!_[_0x024f('0x1a')](_0x3d5b21[_0x024f('0x35')]['name'])&&_0x3d5b21['profile'][_0x024f('0x17')]===_0x024f('0x52')?_0x3d5b21['role'][_0x024f('0x17')]:!_[_0x024f('0x1a')](_0x3d5b21[_0x024f('0x41')])?_0x3d5b21[_0x024f('0x41')]+'\x20'+_0x3d5b21[_0x024f('0x42')]:_0x3d5b21[_0x024f('0x42')],'id':_0x3d5b21['id']};_0x3e2b4f[_0x024f('0x53')]=intUtil['getString'](_0x83c583[_0x024f('0x54')],_0xcf2bcc,'\x20');_0x3e2b4f[_0x024f('0x55')]=intUtil[_0x024f('0x56')](_0x83c583[_0x024f('0x57')],_0xcf2bcc,'\x0a');if(_0x143648[_0x024f('0x3d')]===_0x024f('0x4a')){_0x3e2b4f[_0x024f('0x58')]={'name':!_['isNil'](_0x143648['Full_Name'])?_0x143648[_0x024f('0x59')]:!_['isNil'](_0x143648[_0x024f('0x5a')])?_0x143648[_0x024f('0x5a')]+'\x20'+_0x143648[_0x024f('0x5b')]:_0x143648[_0x024f('0x5b')],'id':_0x143648['id']};}if(_0x143648[_0x024f('0x3d')]===_0x024f('0x4d')){_0x3e2b4f['What_Id']={'name':!_[_0x024f('0x1a')](_0x143648[_0x024f('0x59')])?_0x143648[_0x024f('0x59')]:!_[_0x024f('0x1a')](_0x143648[_0x024f('0x5a')])?_0x143648[_0x024f('0x5a')]+'\x20'+_0x143648[_0x024f('0x5b')]:_0x143648[_0x024f('0x5b')],'id':_0x143648['id']};_0x3e2b4f[_0x024f('0x5c')]=_['startCase'](_0x143648[_0x024f('0x3d')]);}if(_0xcf2bcc['talktime']){_0x3e2b4f['Call_Duration']=moment[_0x024f('0x5d')](parseInt(_0xcf2bcc[_0x024f('0x5e')])*0x3e8)[_0x024f('0x5f')](_0x024f('0x60'));}else if(_0xcf2bcc['answertime']&&_0xcf2bcc[_0x024f('0x61')]){_0x3e2b4f[_0x024f('0x62')]=moment[_0x024f('0x5d')](moment(_0xcf2bcc[_0x024f('0x61')],'YYYY-MM-DDTHH:mm:ss')[_0x024f('0x63')](moment(_0xcf2bcc[_0x024f('0x64')],_0x024f('0x65'))))[_0x024f('0x5f')](_0x024f('0x60'));}switch(_0xcf2bcc[_0x024f('0x66')]){case _0x024f('0x67'):_0x3e2b4f['Call_Result']=_0x024f('0x68');break;case'complete':case'connect':_0x3e2b4f[_0x024f('0x69')]=_0x024f('0x6a');break;case _0x024f('0x6b'):_0x3e2b4f[_0x024f('0x69')]=_0x024f('0x6c');break;case _0x024f('0x6d'):_0x3e2b4f[_0x024f('0x69')]=_0x024f('0x6e');break;case'timeout':_0x3e2b4f[_0x024f('0x69')]=_0x024f('0x6f');default:}_0x3e2b4f[_0x024f('0x70')]=(_0x55394b===_0x024f('0x71')?moment(_0xcf2bcc[_0x024f('0x64')])[_0x024f('0x5f')](_0x024f('0x65')):moment(_0xcf2bcc[_0x024f('0x72')])[_0x024f('0x5f')]('YYYY-MM-DDTHH:mm:ss'))||moment()['format']('YYYY-MM-DDTHH:mm:ss');_0x3e2b4f['Call_Type']=_0x55394b||'Inbound';_0x3e2b4f=_['merge'](_0x3e2b4f,getCustomFields(_0x83c583[_0x024f('0x73')],_0xcf2bcc));return request({'method':_0x024f('0x22'),'uri':_0x024f('0x4c')+_0x59f4b7+_0x024f('0x74'),'headers':{'Authorization':_0x024f('0x2f')+_0x2925ec},'body':{'data':[_0x3e2b4f]},'json':!![]})[_0x024f('0x25')](function(_0x2b9424){if(_0x2b9424&&_0x2b9424[_0x024f('0x3c')][0x0][_0x024f('0x43')]===_0x024f('0x44')){logger[_0x024f('0x2b')](_0x024f('0x75'));return{'id':_0x2b9424[_0x024f('0x3c')][0x0]['details']['id']};}})[_0x024f('0x28')](function(_0x5837af){logger[_0x024f('0x2b')](_0x024f('0x76'),_0x5837af[_0x024f('0x2a')]);console['log'](_0x024f('0x76'),_0x5837af);});}exports['queue']=function(_0x169f0b,_0x3ee9e0,_0x27f66a,_0x5437e7,_0x40a0a8,_0x48b1cc){var _0x472117,_0x3e8401,_0x16d8c7;_0x48b1cc['host']=intUtil[_0x024f('0x77')](_0x48b1cc[_0x024f('0x78')]);_0x48b1cc[_0x024f('0x79')]=intUtil['stripTrailingSlash'](_0x48b1cc[_0x024f('0x79')]);if(_0x40a0a8&&_0x40a0a8[_0x024f('0x7a')]){logger[_0x024f('0x2b')](_0x024f('0x7b'),'Recording\x20is\x20enabled!');_0x3ee9e0[_0x024f('0x7c')]=_0x48b1cc['serverUrl']+_0x024f('0x7d')+_0x3ee9e0[_0x024f('0x7e')]+_0x024f('0x7f')+md5(_0x3ee9e0['uniqueid']);}else{_0x3ee9e0[_0x024f('0x7c')]='';}var _0x37bc6c=_0x48b1cc['host']===_0x024f('0x80')?'eu':_0x024f('0x81');return getAccessToken(_0x48b1cc)['then'](function(_0x2e1080){_0x16d8c7=_0x2e1080;return getUser(_0x16d8c7,_0x37bc6c,_0x48b1cc,_0x5437e7[_0x024f('0x33')]);})[_0x024f('0x25')](function(_0x348595){_0x472117=_0x348595;logger[_0x024f('0x2b')](_0x024f('0x82'),_0x472117['id']);return getEndUser(_0x16d8c7,_0x37bc6c,_0x48b1cc,_0x3ee9e0['calleridname'],_0x3ee9e0['calleridnum'],_0x472117,_0x27f66a);})[_0x024f('0x25')](function(_0x544b27){_0x3e8401=_0x544b27;return getCall(_0x16d8c7,_0x37bc6c,_0x48b1cc,_0x472117,_0x3e8401,_0x27f66a,_0x3ee9e0,_0x024f('0x83'));})[_0x024f('0x25')](function(_0x284eef){if(_0x284eef){logger[_0x024f('0x2b')](_0x024f('0x84'),_0x284eef['id']);logger['info'](_0x024f('0x7b'),_0x024f('0x85'));emit(util[_0x024f('0x5f')](_0x024f('0x86'),_0x5437e7['name']),_0x024f('0x87'),{'uri':_0x024f('0x88')+_0x48b1cc[_0x024f('0x78')]+_0x024f('0x89')+_0x284eef['id']});}})[_0x024f('0x28')](function(_0x3634d5){logger[_0x024f('0x3b')](_0x024f('0x7b'),JSON[_0x024f('0x3a')](_0x3634d5));});};exports['outbound']=function(_0x5191b1,_0x5b0a28,_0x31963e,_0x3d774d,_0x5509ad,_0x4e1001,_0x29ef66){var _0x2c3a4f,_0x30fee0,_0x21d901;_0x4e1001[_0x024f('0x78')]=intUtil['stripTrailingSlash'](_0x4e1001[_0x024f('0x78')]);_0x4e1001['serverUrl']=intUtil[_0x024f('0x77')](_0x4e1001[_0x024f('0x79')]);if(_0x29ef66&&_0x29ef66[_0x024f('0x8a')]&&_0x29ef66['recordingFormat']!==_0x024f('0x8b')){logger[_0x024f('0x2b')]('[OUTBOUND]',_0x024f('0x8c'));_0x5b0a28['recordingURL']=_0x4e1001[_0x024f('0x79')]+_0x024f('0x7d')+_0x5b0a28[_0x024f('0x7e')]+'/downloads?type=uniqueid&token='+md5(_0x5b0a28[_0x024f('0x7e')]);}var _0xdffd7c=_0x4e1001['host']==='zoho.eu'?'eu':_0x024f('0x81');return getAccessToken(_0x4e1001)[_0x024f('0x25')](function(_0x8c8811){_0x21d901=_0x8c8811;return getUser(_0x21d901,_0xdffd7c,_0x4e1001,_0x3d774d[_0x024f('0x33')]);})[_0x024f('0x25')](function(_0x446006){_0x2c3a4f=_0x446006;logger[_0x024f('0x2b')]('The\x20User\x20ID\x20is:',_0x2c3a4f['id']);return getEndUser(_0x21d901,_0xdffd7c,_0x4e1001,_0x5b0a28[_0x024f('0x8d')],_0x5b0a28['destcalleridnum'],_0x2c3a4f,_0x31963e);})[_0x024f('0x25')](function(_0x15252d){_0x30fee0=_0x15252d;return getCall(_0x21d901,_0xdffd7c,_0x4e1001,_0x2c3a4f,_0x30fee0,_0x31963e,_0x5b0a28,'Outbound');})[_0x024f('0x25')](function(_0x249e1a){if(_0x249e1a){logger['info']('The\x20Call\x20ID\x20is:',_0x249e1a['id']);logger['info'](_0x024f('0x8e'),'Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util['format'](_0x024f('0x86'),_0x3d774d['name']),_0x024f('0x87'),{'uri':_0x024f('0x88')+_0x4e1001[_0x024f('0x78')]+'/crm/EntityInfo.do?module=Calls&id='+_0x249e1a['id']});}})[_0x024f('0x28')](function(_0x186e98){logger[_0x024f('0x3b')](_0x024f('0x8e'),JSON[_0x024f('0x3a')](_0x186e98));});};exports['unmanaged']=function(_0x982f6,_0x1adbe9,_0x1f8ee7,_0x55bf41,_0x3db78d,_0x42626c){var _0x4c834e,_0x546941,_0x3ea83f;_0x42626c[_0x024f('0x78')]=intUtil[_0x024f('0x77')](_0x42626c[_0x024f('0x78')]);_0x42626c['serverUrl']=intUtil[_0x024f('0x77')](_0x42626c[_0x024f('0x79')]);if(_0x3db78d&&_0x3db78d[_0x024f('0x7a')]){logger[_0x024f('0x2b')]('['+_0x1adbe9[_0x024f('0x66')][_0x024f('0x8f')]()+']',_0x024f('0x8c'));_0x1adbe9[_0x024f('0x7c')]=_0x42626c[_0x024f('0x79')]+_0x024f('0x7d')+_0x1adbe9[_0x024f('0x7e')]+_0x024f('0x7f')+md5(_0x1adbe9[_0x024f('0x7e')]);}else{_0x1adbe9[_0x024f('0x7c')]='';}var _0x135a92=_0x42626c[_0x024f('0x78')]===_0x024f('0x80')?'eu':'com';return getAccessToken(_0x42626c)[_0x024f('0x25')](function(_0x49ce01){_0x3ea83f=_0x49ce01;return getUser(_0x3ea83f,_0x135a92,_0x42626c);})[_0x024f('0x25')](function(_0x424034){_0x4c834e=_0x424034;logger[_0x024f('0x2b')]('The\x20User\x20ID\x20is:',_0x4c834e['id']);return getEndUser(_0x3ea83f,_0x135a92,_0x42626c,_0x1adbe9['calleridname'],_0x1adbe9['calleridnum'],_0x4c834e,_0x1f8ee7);})['then'](function(_0x41513a){_0x546941=_0x41513a;return getCall(_0x3ea83f,_0x135a92,_0x42626c,_0x4c834e,_0x546941,_0x1f8ee7,_0x1adbe9,_0x024f('0x83'));})['then'](function(_0x4e4675){if(_0x4e4675){logger[_0x024f('0x2b')](_0x024f('0x84'),_0x4e4675['id']);}})[_0x024f('0x28')](function(_0x2144a1){logger[_0x024f('0x3b')]('['+_0x1adbe9[_0x024f('0x66')][_0x024f('0x8f')]()+']',JSON['stringify'](_0x2144a1));});}; \ 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 aad3979..16b63f4 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 _0x0cc3=['../../../../config/logger','trigger','exec','data2','render','format','info','%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s','util','shelljs','mustache'];(function(_0x44a2fc,_0x2c9b25){var _0x5b7176=function(_0x10a3b1){while(--_0x10a3b1){_0x44a2fc['push'](_0x44a2fc['shift']());}};_0x5b7176(++_0x2c9b25);}(_0x0cc3,0x168));var _0x30cc=function(_0x27fb76,_0x445ace){_0x27fb76=_0x27fb76-0x0;var _0x403370=_0x0cc3[_0x27fb76];return _0x403370;};'use strict';var util=require(_0x30cc('0x0'));var sh=require(_0x30cc('0x1'));var Mustache=require(_0x30cc('0x2'));var logger=require(_0x30cc('0x3'))(_0x30cc('0x4'));exports[_0x30cc('0x5')]=function(_0x498f12,_0x7e3a90){var _0x1e3f83=_0x498f12['data2']?_0x498f12[_0x30cc('0x6')]:'Script';var _0x105db7=_0x498f12['data3']?Mustache[_0x30cc('0x7')](_0x498f12['data3'],_0x7e3a90):_0x7e3a90;sh['exec'](_0x105db7,function(_0x3fe09b,_0x5a08c8,_0x47670d){if(_0x3fe09b!==0x0){logger['error'](util[_0x30cc('0x8')]('%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s',_0x1e3f83,_0x105db7,_0x3fe09b,_0x47670d));}else{logger[_0x30cc('0x9')](util[_0x30cc('0x8')](_0x30cc('0xa'),_0x1e3f83,_0x105db7,_0x5a08c8));}});}; \ No newline at end of file +var _0x8594=['render','error','format','%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s','shelljs','mustache','../../../../config/logger','trigger','exec','data2','Script','data3'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x8594,0x1cc));var _0x4859=function(_0x5db2ef,_0x26debe){_0x5db2ef=_0x5db2ef-0x0;var _0x1b3391=_0x8594[_0x5db2ef];return _0x1b3391;};'use strict';var util=require('util');var sh=require(_0x4859('0x0'));var Mustache=require(_0x4859('0x1'));var logger=require(_0x4859('0x2'))(_0x4859('0x3'));exports[_0x4859('0x4')]=function(_0x3f3489,_0x4bf0de){var _0x4423b9=_0x3f3489['data2']?_0x3f3489[_0x4859('0x5')]:_0x4859('0x6');var _0x53cc89=_0x3f3489[_0x4859('0x7')]?Mustache[_0x4859('0x8')](_0x3f3489[_0x4859('0x7')],_0x4bf0de):_0x4bf0de;sh[_0x4859('0x4')](_0x53cc89,function(_0x408b66,_0x5e37f9,_0xd781c4){if(_0x408b66!==0x0){logger[_0x4859('0x9')](util[_0x4859('0xa')]('%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s',_0x4423b9,_0x53cc89,_0x408b66,_0xd781c4));}else{logger['info'](util['format'](_0x4859('0xb'),_0x4423b9,_0x53cc89,_0x5e37f9));}});}; \ 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 83cd631..016ce4d 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 _0x76d1=['../../../../config/logger','exec','data1','toUpperCase','render','data2','data5','headers','data6','parse','error','stack','GET','DELETE','PUT','data7','body','info','format','%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s','stringify','then','isNil',',\x20request\x20body:\x20','object','%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s','statusCode','catch','%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s','message','request-promise','lodash','mustache'];(function(_0x5a94f4,_0x45a65c){var _0x414a6a=function(_0x48d933){while(--_0x48d933){_0x5a94f4['push'](_0x5a94f4['shift']());}};_0x414a6a(++_0x45a65c);}(_0x76d1,0x147));var _0x176d=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x76d1[_0x19950b];return _0x3c6b41;};'use strict';var rp=require(_0x176d('0x0'));var util=require('util');var _=require(_0x176d('0x1'));var Mustache=require(_0x176d('0x2'));var logger=require(_0x176d('0x3'))('trigger');exports[_0x176d('0x4')]=function(_0xd548b7,_0x4cacee){var _0x5b0197,_0x5e7b92;var _0x3b6994={'method':_0xd548b7[_0x176d('0x5')][_0x176d('0x6')](),'uri':Mustache[_0x176d('0x7')](_0xd548b7[_0x176d('0x8')],_0x4cacee),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0xd548b7[_0x176d('0x9')])==='number'&&parseInt(_0xd548b7[_0x176d('0x9')])>=0x1&&parseInt(_0xd548b7[_0x176d('0x9')])<=0xa?parseInt(_0xd548b7[_0x176d('0x9')])*0x3e8:0x5*0x3e8};try{_0x3b6994[_0x176d('0xa')]=_0xd548b7[_0x176d('0xb')]?JSON[_0x176d('0xc')](Mustache['render'](_0xd548b7[_0x176d('0xb')],_0x4cacee)):{};}catch(_0x506cb0){logger[_0x176d('0xd')](_0x506cb0[_0x176d('0xe')]);}switch(_0xd548b7[_0x176d('0x5')][_0x176d('0x6')]()){case _0x176d('0xf'):case _0x176d('0x10'):_0x5b0197=null;_0x3b6994['qs']=_0x4cacee;break;case'POST':case _0x176d('0x11'):if(_0xd548b7['data7']){try{_0x5b0197=JSON[_0x176d('0xc')](Mustache['render'](_0xd548b7[_0x176d('0x12')],_0x4cacee));_0x3b6994[_0x176d('0x13')]=_0x5b0197;}catch(_0x3d7736){logger['error'](_0x3d7736[_0x176d('0xe')]);logger[_0x176d('0xd')]('body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format');}}else{_0x5b0197=_0x4cacee;_0x3b6994['body']=_0x5b0197;}break;}logger[_0x176d('0x14')](util[_0x176d('0x15')](_0x176d('0x16'),_0xd548b7[_0x176d('0x5')],_0xd548b7[_0x176d('0x8')],JSON[_0x176d('0x17')](_0x3b6994)));rp(_0x3b6994)[_0x176d('0x18')](function(_0x5d97ba){_0x5b0197=!_[_0x176d('0x19')](_0x5b0197)?_0x176d('0x1a')+_0x5b0197:'';_0x5e7b92=typeof _0x5d97ba[_0x176d('0x13')]===_0x176d('0x1b')?JSON[_0x176d('0x17')](_0x5d97ba['body']):_0x5d97ba[_0x176d('0x13')];logger['info'](util[_0x176d('0x15')](_0x176d('0x1c'),_0xd548b7[_0x176d('0x5')],_0xd548b7['data2'],_0x5d97ba[_0x176d('0x1d')],_0x5e7b92));})[_0x176d('0x1e')](function(_0x29b8ed){logger[_0x176d('0xd')](util[_0x176d('0x15')](_0x176d('0x1f'),_0xd548b7[_0x176d('0x5')],_0xd548b7['data2'],_0x29b8ed['statusCode'],_0x29b8ed['name'],_0x29b8ed[_0x176d('0x20')]));});}; \ No newline at end of file +var _0x23ae=[',\x20request\x20body:\x20','stringify','info','%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s','statusCode','catch','%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s','name','request-promise','util','lodash','mustache','trigger','exec','data1','toUpperCase','number','data5','headers','render','data6','error','GET','DELETE','POST','PUT','data7','parse','body','stack','body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format','format','%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s','data2','isNil'];(function(_0x87cb2b,_0x33c1a6){var _0x152d0d=function(_0x26357e){while(--_0x26357e){_0x87cb2b['push'](_0x87cb2b['shift']());}};_0x152d0d(++_0x33c1a6);}(_0x23ae,0x1cf));var _0xe23a=function(_0x16aa10,_0xc22da3){_0x16aa10=_0x16aa10-0x0;var _0x3bc706=_0x23ae[_0x16aa10];return _0x3bc706;};'use strict';var rp=require(_0xe23a('0x0'));var util=require(_0xe23a('0x1'));var _=require(_0xe23a('0x2'));var Mustache=require(_0xe23a('0x3'));var logger=require('../../../../config/logger')(_0xe23a('0x4'));exports[_0xe23a('0x5')]=function(_0x35de2f,_0xf674a6){var _0x2434fa,_0x29754e;var _0x549b6f={'method':_0x35de2f[_0xe23a('0x6')][_0xe23a('0x7')](),'uri':Mustache['render'](_0x35de2f['data2'],_0xf674a6),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x35de2f['data5'])===_0xe23a('0x8')&&parseInt(_0x35de2f[_0xe23a('0x9')])>=0x1&&parseInt(_0x35de2f[_0xe23a('0x9')])<=0xa?parseInt(_0x35de2f[_0xe23a('0x9')])*0x3e8:0x5*0x3e8};try{_0x549b6f[_0xe23a('0xa')]=_0x35de2f['data6']?JSON['parse'](Mustache[_0xe23a('0xb')](_0x35de2f[_0xe23a('0xc')],_0xf674a6)):{};}catch(_0x57546b){logger[_0xe23a('0xd')](_0x57546b['stack']);}switch(_0x35de2f['data1'][_0xe23a('0x7')]()){case _0xe23a('0xe'):case _0xe23a('0xf'):_0x2434fa=null;_0x549b6f['qs']=_0xf674a6;break;case _0xe23a('0x10'):case _0xe23a('0x11'):if(_0x35de2f[_0xe23a('0x12')]){try{_0x2434fa=JSON[_0xe23a('0x13')](Mustache[_0xe23a('0xb')](_0x35de2f[_0xe23a('0x12')],_0xf674a6));_0x549b6f[_0xe23a('0x14')]=_0x2434fa;}catch(_0x327573){logger['error'](_0x327573[_0xe23a('0x15')]);logger[_0xe23a('0xd')](_0xe23a('0x16'));}}else{_0x2434fa=_0xf674a6;_0x549b6f[_0xe23a('0x14')]=_0x2434fa;}break;}logger['info'](util[_0xe23a('0x17')](_0xe23a('0x18'),_0x35de2f[_0xe23a('0x6')],_0x35de2f[_0xe23a('0x19')],JSON['stringify'](_0x549b6f)));rp(_0x549b6f)['then'](function(_0x2db33d){_0x2434fa=!_[_0xe23a('0x1a')](_0x2434fa)?_0xe23a('0x1b')+_0x2434fa:'';_0x29754e=typeof _0x2db33d[_0xe23a('0x14')]==='object'?JSON[_0xe23a('0x1c')](_0x2db33d['body']):_0x2db33d[_0xe23a('0x14')];logger[_0xe23a('0x1d')](util['format'](_0xe23a('0x1e'),_0x35de2f[_0xe23a('0x6')],_0x35de2f[_0xe23a('0x19')],_0x2db33d[_0xe23a('0x1f')],_0x29754e));})[_0xe23a('0x20')](function(_0x379f3e){logger[_0xe23a('0xd')](util[_0xe23a('0x17')](_0xe23a('0x21'),_0x35de2f[_0xe23a('0x6')],_0x35de2f['data2'],_0x379f3e[_0xe23a('0x1f')],_0x379f3e[_0xe23a('0x22')],_0x379f3e['message']));});}; \ No newline at end of file diff --git a/server/services/email/client.js b/server/services/email/client.js index 518c280..2002556 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 _0xa0eb=['routing','client','http','Request','request','then','debug','rpc','error','message','catch','exports','bluebird','../../config/logger'];(function(_0x4dee14,_0x3d6aba){var _0x4daacb=function(_0x194cb3){while(--_0x194cb3){_0x4dee14['push'](_0x4dee14['shift']());}};_0x4daacb(++_0x3d6aba);}(_0xa0eb,0x6e));var _0xba0e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa0eb[_0x3dd15e];return _0x231fd0;};'use strict';var jayson=require('jayson/promise');var BPromise=require(_0xba0e('0x0'));var logger=require(_0xba0e('0x1'))(_0xba0e('0x2'));var client=jayson[_0xba0e('0x3')][_0xba0e('0x4')]({'port':0x2329});client[_0xba0e('0x5')]=function(_0xcc9e5d,_0x2155b0){return new BPromise(function(_0x46764d,_0x51bca4){return client[_0xba0e('0x6')](_0xcc9e5d,_0x2155b0)[_0xba0e('0x7')](function(_0x52098e){logger[_0xba0e('0x8')](_0xba0e('0x9'),_0xba0e('0x2'),_0xcc9e5d,_0x2155b0,_0x52098e);if(_0x52098e['error']){logger[_0xba0e('0xa')](_0xba0e('0x9'),_0xba0e('0x2'),_0xcc9e5d,_0x52098e[_0xba0e('0xa')]['message'],_0x2155b0);return _0x51bca4(_0x52098e[_0xba0e('0xa')][_0xba0e('0xb')]);}else{return _0x46764d(_0x52098e['result']);}})[_0xba0e('0xc')](function(_0x59a6fb){logger[_0xba0e('0xa')]('rpc',_0xba0e('0x2'),_0xcc9e5d,_0x59a6fb,_0x2155b0);return _0x51bca4(_0x59a6fb);});});};module[_0xba0e('0xd')]=client; \ No newline at end of file +var _0x6c30=['jayson/promise','bluebird','../../config/logger','routing','client','request','then','rpc','error','message','result','exports'];(function(_0x5943ef,_0x29f683){var _0x46a9cd=function(_0x2ca703){while(--_0x2ca703){_0x5943ef['push'](_0x5943ef['shift']());}};_0x46a9cd(++_0x29f683);}(_0x6c30,0x1e0));var _0x06c3=function(_0x2330a1,_0x4bb8d3){_0x2330a1=_0x2330a1-0x0;var _0x32c0a6=_0x6c30[_0x2330a1];return _0x32c0a6;};'use strict';var jayson=require(_0x06c3('0x0'));var BPromise=require(_0x06c3('0x1'));var logger=require(_0x06c3('0x2'))(_0x06c3('0x3'));var client=jayson[_0x06c3('0x4')]['http']({'port':0x2329});client['Request']=function(_0x1321ec,_0x572aca){return new BPromise(function(_0x2eca23,_0x515498){return client[_0x06c3('0x5')](_0x1321ec,_0x572aca)[_0x06c3('0x6')](function(_0x58838d){logger['debug'](_0x06c3('0x7'),_0x06c3('0x3'),_0x1321ec,_0x572aca,_0x58838d);if(_0x58838d['error']){logger[_0x06c3('0x8')](_0x06c3('0x7'),_0x06c3('0x3'),_0x1321ec,_0x58838d[_0x06c3('0x8')][_0x06c3('0x9')],_0x572aca);return _0x515498(_0x58838d[_0x06c3('0x8')][_0x06c3('0x9')]);}else{return _0x2eca23(_0x58838d[_0x06c3('0xa')]);}})['catch'](function(_0x2a3449){logger[_0x06c3('0x8')](_0x06c3('0x7'),'routing',_0x1321ec,_0x2a3449,_0x572aca);return _0x515498(_0x2a3449);});});};module[_0x06c3('0xb')]=client; \ No newline at end of file diff --git a/server/services/email/index.js b/server/services/email/index.js index 4ddb5de..da74802 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 _0x4173=['./lib/email','./rpc/mailAccount','./rpc/setting','then','getMailAccounts','mailAccounts','listen','loginMailFrequency','catch','log','bluebird','./server','./realtime'];(function(_0x4714c3,_0x22fc83){var _0x46e55a=function(_0x58eb20){while(--_0x58eb20){_0x4714c3['push'](_0x4714c3['shift']());}};_0x46e55a(++_0x22fc83);}(_0x4173,0x101));var _0x3417=function(_0x261fee,_0x46a708){_0x261fee=_0x261fee-0x0;var _0x26f7b4=_0x4173[_0x261fee];return _0x26f7b4;};'use strict';var BPromise=require(_0x3417('0x0'));var server=require(_0x3417('0x1'));var Realtime=require(_0x3417('0x2'));var EmailChannel=require(_0x3417('0x3'));var mailAccount=require(_0x3417('0x4'));var setting=require(_0x3417('0x5'));var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return BPromise['resolve']()[_0x3417('0x6')](mailAccount[_0x3417('0x7')]())[_0x3417('0x6')](realtime['initMailAccounts']())['then'](function(){email['refresh'](realtime[_0x3417('0x8')]);return realtime;});}function main(){return server[_0x3417('0x9')](realtime,email)[_0x3417('0x6')](function(){return initRealtime();})[_0x3417('0x6')](function(){return setting['getSettings']();})[_0x3417('0x6')](function(_0x4cf637){return setInterval(initRealtime,_0x4cf637[_0x3417('0xa')]*0x3e8);})[_0x3417('0xb')](function(_0x430c38){console[_0x3417('0xc')](_0x430c38);});}main(); \ No newline at end of file +var _0xb4b3=['getSettings','loginMailFrequency','log','./server','./realtime','./lib/email','./rpc/mailAccount','./rpc/setting','resolve','then','getMailAccounts','initMailAccounts','refresh','mailAccounts','listen'];(function(_0x3f7868,_0x5a638d){var _0x4b7931=function(_0x49d46d){while(--_0x49d46d){_0x3f7868['push'](_0x3f7868['shift']());}};_0x4b7931(++_0x5a638d);}(_0xb4b3,0x1e3));var _0x3b4b=function(_0x549b63,_0x520899){_0x549b63=_0x549b63-0x0;var _0x210c5e=_0xb4b3[_0x549b63];return _0x210c5e;};'use strict';var BPromise=require('bluebird');var server=require(_0x3b4b('0x0'));var Realtime=require(_0x3b4b('0x1'));var EmailChannel=require(_0x3b4b('0x2'));var mailAccount=require(_0x3b4b('0x3'));var setting=require(_0x3b4b('0x4'));var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return BPromise[_0x3b4b('0x5')]()[_0x3b4b('0x6')](mailAccount[_0x3b4b('0x7')]())[_0x3b4b('0x6')](realtime[_0x3b4b('0x8')]())[_0x3b4b('0x6')](function(){email[_0x3b4b('0x9')](realtime[_0x3b4b('0xa')]);return realtime;});}function main(){return server[_0x3b4b('0xb')](realtime,email)[_0x3b4b('0x6')](function(){return initRealtime();})['then'](function(){return setting[_0x3b4b('0xc')]();})[_0x3b4b('0x6')](function(_0x184ffe){return setInterval(initRealtime,_0x184ffe[_0x3b4b('0xd')]*0x3e8);})['catch'](function(_0xca323f){console[_0x3b4b('0xe')](_0xca323f);});}main(); \ No newline at end of file diff --git a/server/services/email/lib/email.js b/server/services/email/lib/email.js index 6169693..23c9e9f 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 _0x124f=['handleImapEnd','handleImapError','isNil','status','disabled','messageStatus','handleImapEmail','New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s','firstName','lastName','Mail\x20not\x20accepted\x20from\x20routing\x20%s','lastSync','error','sendMail','smtp','Smtp','verify','then','verified','catch','exports','lodash','moment','md5','ioredis','email','redis','localhost','socket.io-emitter','./imap','./smtp','../rpc/mailAccount','info','start\x20email\x20channel','mailAccounts','imapAccounts','prototype','name','key','Imap','total','stringify','emit','refresh','hasOwnProperty','active','box','handleImapBox','bind','end'];(function(_0x50b5e8,_0x41d1ed){var _0x44a125=function(_0xb9fa5c){while(--_0xb9fa5c){_0x50b5e8['push'](_0x50b5e8['shift']());}};_0x44a125(++_0x41d1ed);}(_0x124f,0xdd));var _0xf124=function(_0x1cdbbe,_0x4e9f94){_0x1cdbbe=_0x1cdbbe-0x0;var _0x417567=_0x124f[_0x1cdbbe];return _0x417567;};'use strict';var _=require(_0xf124('0x0'));var moment=require(_0xf124('0x1'));var BPromise=require('bluebird');var md5=require(_0xf124('0x2'));var Redis=require(_0xf124('0x3'));var config=require('../../../config/environment');var logger=require('../../../config/logger')(_0xf124('0x4'));config[_0xf124('0x5')]=_['defaults'](config[_0xf124('0x5')],{'host':_0xf124('0x6'),'port':0x18eb});var io=require(_0xf124('0x7'))(new Redis(config[_0xf124('0x5')]));var EmailImap=require(_0xf124('0x8'));var EmailSmtp=require(_0xf124('0x9'));var mailAccount=require(_0xf124('0xa'));var md5Accounts={};function EmailChannel(_0x51053e){logger[_0xf124('0xb')](_0xf124('0xc'));this[_0xf124('0xd')]=_0x51053e[_0xf124('0xd')];this[_0xf124('0xe')]={};this['smtp']=new EmailSmtp();}EmailChannel[_0xf124('0xf')]['emit']=function(_0x1c2b77){var _0x2b1303=this[_0xf124('0xd')][_0x1c2b77];var _0x2cb56d={'id':_0x2b1303['id'],'name':_0x2b1303[_0xf124('0x10')],'key':_0x2b1303[_0xf124('0x11')],'active':_0x2b1303['active'],'Imap':{'status':_0x2b1303['Imap']['status'],'messageStatus':_0x2b1303[_0xf124('0x12')]['messageStatus'],'total':_0x2b1303[_0xf124('0x12')][_0xf124('0x13')]}};if(_['isNil'](md5Accounts[_0x1c2b77])){md5Accounts[_0x1c2b77]={};}var _0x3df7ed=md5(JSON[_0xf124('0x14')](_0x2cb56d));if(md5Accounts[_0x1c2b77][_0xf124('0x2')]!==_0x3df7ed){md5Accounts[_0x1c2b77][_0xf124('0x2')]=_0x3df7ed;io[_0xf124('0x15')]('mailAccount:update',_0x2cb56d);}};EmailChannel[_0xf124('0xf')][_0xf124('0x16')]=function(_0x40a5c3){for(var _0x5c73cc in _0x40a5c3){if(_0x40a5c3[_0xf124('0x17')](_0x5c73cc)){if(_0x40a5c3[_0x5c73cc][_0xf124('0x12')]&&_0x40a5c3[_0x5c73cc][_0xf124('0x18')]){var _0x280a74=_0x40a5c3[_0x5c73cc][_0xf124('0x12')];if(!this[_0xf124('0xe')]['hasOwnProperty'](_0x280a74['id'])){this[_0xf124('0xe')][_0x280a74['id']]=new EmailImap(_0x280a74,_0x40a5c3[_0x5c73cc][_0xf124('0x4')]);this[_0xf124('0xe')][_0x280a74['id']]['on'](_0xf124('0x19'),this[_0xf124('0x1a')][_0xf124('0x1b')](this,_0x5c73cc));this[_0xf124('0xe')][_0x280a74['id']]['on'](_0xf124('0x4'),this['handleImapEmail'][_0xf124('0x1b')](this,_0x5c73cc));this['imapAccounts'][_0x280a74['id']]['on'](_0xf124('0x1c'),this[_0xf124('0x1d')][_0xf124('0x1b')](this,_0x5c73cc));this[_0xf124('0xe')][_0x280a74['id']]['on']('error',this[_0xf124('0x1e')][_0xf124('0x1b')](this,_0x5c73cc));}}else{if(_[_0xf124('0x1f')](this['mailAccounts'][_0x5c73cc]['Imap'])){this[_0xf124('0xd')][_0x5c73cc][_0xf124('0x12')]={};}this[_0xf124('0xd')][_0x5c73cc][_0xf124('0x12')][_0xf124('0x20')]=_0xf124('0x21');this[_0xf124('0xd')][_0x5c73cc][_0xf124('0x12')][_0xf124('0x22')]='';this['emit'](_0x5c73cc);}}}};EmailChannel[_0xf124('0xf')]['handleImapBox']=function(_0xf6b13b,_0x1af873){if(this[_0xf124('0xd')][_0xf6b13b]){this[_0xf124('0xd')][_0xf6b13b][_0xf124('0x12')][_0xf124('0x20')]='connected';this[_0xf124('0xd')][_0xf6b13b][_0xf124('0x12')][_0xf124('0x22')]=_0x1af873[_0xf124('0x10')];if(_0x1af873['messages']){this[_0xf124('0xd')][_0xf6b13b][_0xf124('0x12')][_0xf124('0x13')]=_0x1af873['messages']['total'];}return this[_0xf124('0x15')](_0xf6b13b);}};EmailChannel[_0xf124('0xf')][_0xf124('0x23')]=function(_0x43b09d,_0x25ec97){logger[_0xf124('0xb')](_0xf124('0x24'),_0x25ec97[_0xf124('0x25')],_0x25ec97[_0xf124('0x26')],_0x25ec97['from'],_0x43b09d);if(this[_0xf124('0xd')][_0x43b09d]){return mailAccount['notify'](_0x43b09d,_0x25ec97)['then'](function(_0x488670){if(_0x488670){logger[_0xf124('0xb')]('Mail\x20accepted\x20from\x20routing');}})['catch'](function(_0x1679a6){logger['error'](_0xf124('0x27'),JSON[_0xf124('0x14')](_0x1679a6));});}};EmailChannel['prototype'][_0xf124('0x1d')]=function(_0x3887b0){if(this['mailAccounts'][_0x3887b0]&&this[_0xf124('0xd')][_0x3887b0][_0xf124('0x12')]){if(this[_0xf124('0xe')][this['mailAccounts'][_0x3887b0]['Imap']['id']]){delete this['imapAccounts'][this[_0xf124('0xd')][_0x3887b0]['Imap']['id']];}this[_0xf124('0xd')][_0x3887b0]['Imap'][_0xf124('0x28')]=moment();this[_0xf124('0x15')](_0x3887b0);}};EmailChannel[_0xf124('0xf')][_0xf124('0x1e')]=function(_0x1ce4a8,_0x18403f){if(this[_0xf124('0xd')][_0x1ce4a8]){this[_0xf124('0xd')][_0x1ce4a8][_0xf124('0x12')][_0xf124('0x20')]=_0xf124('0x29');this[_0xf124('0xd')][_0x1ce4a8]['Imap']['messageStatus']=_0x18403f;return this[_0xf124('0x15')](_0x1ce4a8);}};EmailChannel[_0xf124('0xf')][_0xf124('0x2a')]=function(_0x3f21f5,_0x38ac29){return this[_0xf124('0x2b')]['send'](_0x3f21f5,_0x38ac29);};EmailChannel[_0xf124('0xf')]['verifySmtp']=function(_0x2b6915){var _0xda9f2d=this;if(this[_0xf124('0xd')][_0x2b6915['id']]){if(_[_0xf124('0x1f')](this[_0xf124('0xd')][_0x2b6915['id']][_0xf124('0x2c')])){this[_0xf124('0xd')][_0x2b6915['id']][_0xf124('0x2c')]={};}this[_0xf124('0xd')][_0x2b6915['id']][_0xf124('0x2c')][_0xf124('0x28')]=moment();return new BPromise(function(_0x1db024,_0x27361b){return _0xda9f2d[_0xf124('0x2b')][_0xf124('0x2d')](_0x2b6915)[_0xf124('0x2e')](function(_0x319be0){_0xda9f2d['mailAccounts'][_0x2b6915['id']][_0xf124('0x2c')][_0xf124('0x20')]=_0xf124('0x2f');_0xda9f2d[_0xf124('0xd')][_0x2b6915['id']]['Smtp'][_0xf124('0x22')]='';_0xda9f2d[_0xf124('0x15')](_0x2b6915['id']);_0x1db024(_0x319be0);})[_0xf124('0x30')](function(_0x19a7d0){_0xda9f2d[_0xf124('0xd')][_0x2b6915['id']][_0xf124('0x2c')]['status']=_0xf124('0x29');_0xda9f2d['mailAccounts'][_0x2b6915['id']]['Smtp'][_0xf124('0x22')]=_0x19a7d0;_0xda9f2d[_0xf124('0x15')](_0x2b6915['id']);_0x27361b(_0x19a7d0);});});}return this['smtp'][_0xf124('0x2d')](_0x2b6915);};module[_0xf124('0x31')]=EmailChannel; \ No newline at end of file +var _0x8144=['start\x20email\x20channel','mailAccounts','smtp','prototype','emit','name','key','active','Imap','messageStatus','total','stringify','hasOwnProperty','imapAccounts','bind','handleImapEmail','end','handleImapEnd','error','handleImapError','isNil','status','connected','messages','info','New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s','lastName','notify','Mail\x20accepted\x20from\x20routing','catch','Mail\x20not\x20accepted\x20from\x20routing\x20%s','lastSync','sendMail','send','verifySmtp','Smtp','then','verified','verify','exports','moment','md5','../../../config/environment','email','redis','localhost','socket.io-emitter','./imap'];(function(_0x1a8518,_0x4fde78){var _0x1ac19c=function(_0x31106f){while(--_0x31106f){_0x1a8518['push'](_0x1a8518['shift']());}};_0x1ac19c(++_0x4fde78);}(_0x8144,0x88));var _0x4814=function(_0x2bfc66,_0x2b382c){_0x2bfc66=_0x2bfc66-0x0;var _0x407db9=_0x8144[_0x2bfc66];return _0x407db9;};'use strict';var _=require('lodash');var moment=require(_0x4814('0x0'));var BPromise=require('bluebird');var md5=require(_0x4814('0x1'));var Redis=require('ioredis');var config=require(_0x4814('0x2'));var logger=require('../../../config/logger')(_0x4814('0x3'));config[_0x4814('0x4')]=_['defaults'](config[_0x4814('0x4')],{'host':_0x4814('0x5'),'port':0x18eb});var io=require(_0x4814('0x6'))(new Redis(config['redis']));var EmailImap=require(_0x4814('0x7'));var EmailSmtp=require('./smtp');var mailAccount=require('../rpc/mailAccount');var md5Accounts={};function EmailChannel(_0x3d7d0a){logger['info'](_0x4814('0x8'));this[_0x4814('0x9')]=_0x3d7d0a[_0x4814('0x9')];this['imapAccounts']={};this[_0x4814('0xa')]=new EmailSmtp();}EmailChannel[_0x4814('0xb')][_0x4814('0xc')]=function(_0x472d1c){var _0x26ffa9=this[_0x4814('0x9')][_0x472d1c];var _0x28ae62={'id':_0x26ffa9['id'],'name':_0x26ffa9[_0x4814('0xd')],'key':_0x26ffa9[_0x4814('0xe')],'active':_0x26ffa9[_0x4814('0xf')],'Imap':{'status':_0x26ffa9[_0x4814('0x10')]['status'],'messageStatus':_0x26ffa9['Imap'][_0x4814('0x11')],'total':_0x26ffa9['Imap'][_0x4814('0x12')]}};if(_['isNil'](md5Accounts[_0x472d1c])){md5Accounts[_0x472d1c]={};}var _0x2e6389=md5(JSON[_0x4814('0x13')](_0x28ae62));if(md5Accounts[_0x472d1c]['md5']!==_0x2e6389){md5Accounts[_0x472d1c][_0x4814('0x1')]=_0x2e6389;io[_0x4814('0xc')]('mailAccount:update',_0x28ae62);}};EmailChannel['prototype']['refresh']=function(_0x1de731){for(var _0xbafe86 in _0x1de731){if(_0x1de731[_0x4814('0x14')](_0xbafe86)){if(_0x1de731[_0xbafe86][_0x4814('0x10')]&&_0x1de731[_0xbafe86][_0x4814('0xf')]){var _0x6aee33=_0x1de731[_0xbafe86][_0x4814('0x10')];if(!this['imapAccounts'][_0x4814('0x14')](_0x6aee33['id'])){this['imapAccounts'][_0x6aee33['id']]=new EmailImap(_0x6aee33,_0x1de731[_0xbafe86][_0x4814('0x3')]);this[_0x4814('0x15')][_0x6aee33['id']]['on']('box',this['handleImapBox'][_0x4814('0x16')](this,_0xbafe86));this[_0x4814('0x15')][_0x6aee33['id']]['on']('email',this[_0x4814('0x17')][_0x4814('0x16')](this,_0xbafe86));this[_0x4814('0x15')][_0x6aee33['id']]['on'](_0x4814('0x18'),this[_0x4814('0x19')]['bind'](this,_0xbafe86));this[_0x4814('0x15')][_0x6aee33['id']]['on'](_0x4814('0x1a'),this[_0x4814('0x1b')][_0x4814('0x16')](this,_0xbafe86));}}else{if(_[_0x4814('0x1c')](this['mailAccounts'][_0xbafe86][_0x4814('0x10')])){this[_0x4814('0x9')][_0xbafe86]['Imap']={};}this[_0x4814('0x9')][_0xbafe86][_0x4814('0x10')][_0x4814('0x1d')]='disabled';this[_0x4814('0x9')][_0xbafe86][_0x4814('0x10')][_0x4814('0x11')]='';this[_0x4814('0xc')](_0xbafe86);}}}};EmailChannel[_0x4814('0xb')]['handleImapBox']=function(_0x2cbe9a,_0xadbfd1){if(this[_0x4814('0x9')][_0x2cbe9a]){this[_0x4814('0x9')][_0x2cbe9a]['Imap'][_0x4814('0x1d')]=_0x4814('0x1e');this['mailAccounts'][_0x2cbe9a][_0x4814('0x10')]['messageStatus']=_0xadbfd1[_0x4814('0xd')];if(_0xadbfd1[_0x4814('0x1f')]){this[_0x4814('0x9')][_0x2cbe9a][_0x4814('0x10')][_0x4814('0x12')]=_0xadbfd1[_0x4814('0x1f')][_0x4814('0x12')];}return this[_0x4814('0xc')](_0x2cbe9a);}};EmailChannel['prototype']['handleImapEmail']=function(_0x351eb7,_0x2a83ec){logger[_0x4814('0x20')](_0x4814('0x21'),_0x2a83ec['firstName'],_0x2a83ec[_0x4814('0x22')],_0x2a83ec['from'],_0x351eb7);if(this[_0x4814('0x9')][_0x351eb7]){return mailAccount[_0x4814('0x23')](_0x351eb7,_0x2a83ec)['then'](function(_0x52a526){if(_0x52a526){logger[_0x4814('0x20')](_0x4814('0x24'));}})[_0x4814('0x25')](function(_0x239c71){logger['error'](_0x4814('0x26'),JSON[_0x4814('0x13')](_0x239c71));});}};EmailChannel['prototype']['handleImapEnd']=function(_0x532e86){if(this[_0x4814('0x9')][_0x532e86]&&this[_0x4814('0x9')][_0x532e86][_0x4814('0x10')]){if(this['imapAccounts'][this[_0x4814('0x9')][_0x532e86][_0x4814('0x10')]['id']]){delete this[_0x4814('0x15')][this[_0x4814('0x9')][_0x532e86][_0x4814('0x10')]['id']];}this['mailAccounts'][_0x532e86][_0x4814('0x10')][_0x4814('0x27')]=moment();this[_0x4814('0xc')](_0x532e86);}};EmailChannel[_0x4814('0xb')][_0x4814('0x1b')]=function(_0x17fd0b,_0x209060){if(this[_0x4814('0x9')][_0x17fd0b]){this['mailAccounts'][_0x17fd0b][_0x4814('0x10')][_0x4814('0x1d')]=_0x4814('0x1a');this[_0x4814('0x9')][_0x17fd0b][_0x4814('0x10')]['messageStatus']=_0x209060;return this['emit'](_0x17fd0b);}};EmailChannel[_0x4814('0xb')][_0x4814('0x28')]=function(_0xdd45f9,_0x262457){return this[_0x4814('0xa')][_0x4814('0x29')](_0xdd45f9,_0x262457);};EmailChannel[_0x4814('0xb')][_0x4814('0x2a')]=function(_0x4d89aa){var _0x4e1b71=this;if(this[_0x4814('0x9')][_0x4d89aa['id']]){if(_[_0x4814('0x1c')](this[_0x4814('0x9')][_0x4d89aa['id']][_0x4814('0x2b')])){this[_0x4814('0x9')][_0x4d89aa['id']]['Smtp']={};}this['mailAccounts'][_0x4d89aa['id']][_0x4814('0x2b')][_0x4814('0x27')]=moment();return new BPromise(function(_0x28bed8,_0x22d522){return _0x4e1b71['smtp']['verify'](_0x4d89aa)[_0x4814('0x2c')](function(_0x41b3cf){_0x4e1b71['mailAccounts'][_0x4d89aa['id']][_0x4814('0x2b')][_0x4814('0x1d')]=_0x4814('0x2d');_0x4e1b71['mailAccounts'][_0x4d89aa['id']][_0x4814('0x2b')][_0x4814('0x11')]='';_0x4e1b71['emit'](_0x4d89aa['id']);_0x28bed8(_0x41b3cf);})['catch'](function(_0x2bb2f7){_0x4e1b71['mailAccounts'][_0x4d89aa['id']]['Smtp']['status']=_0x4814('0x1a');_0x4e1b71[_0x4814('0x9')][_0x4d89aa['id']][_0x4814('0x2b')]['messageStatus']=_0x2bb2f7;_0x4e1b71[_0x4814('0xc')](_0x4d89aa['id']);_0x22d522(_0x2bb2f7);});});}return this[_0x4814('0xa')][_0x4814('0x2e')](_0x4d89aa);};module[_0x4814('0x2f')]=EmailChannel; \ No newline at end of file diff --git a/server/services/email/lib/imap.js b/server/services/email/lib/imap.js index 554a8c3..09804de 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 _0x938c=['INBOX','imap','once','ready','handleReady','bind','end','handleError','inherits','prototype','authTimeout','isNil','service','authentication','user','password','host','port','tls','autotls','required','getHost','anonymous@xcally.com','mailbox','handleOpenBox','emit','readUnseen','handleCloseBox','search','UNSEEN','handleReadUnseen','length','fetch','handleFetchMessage','error','handleFetchError','handleFetchEnd','closeBox','body','handleMessageBody','attributes','handleMessageAttributes','handleMessageEnd','parser','account','handleEnd','stringify','textCode','hasOwnProperty','path','util','lodash','randomstring','simpleParser','iconv','Iconv','events','EventEmitter','./utils','email'];(function(_0x23e6bb,_0x5c2d69){var _0x1e3b4c=function(_0x1afc46){while(--_0x1afc46){_0x23e6bb['push'](_0x23e6bb['shift']());}};_0x1e3b4c(++_0x5c2d69);}(_0x938c,0x1d5));var _0xc938=function(_0x39dc89,_0xc3391f){_0x39dc89=_0x39dc89-0x0;var _0x54b5dc=_0x938c[_0x39dc89];return _0x54b5dc;};'use strict';var fs=require('fs');var path=require(_0xc938('0x0'));var util=require(_0xc938('0x1'));var Imap=require('imap');var _=require(_0xc938('0x2'));var rs=require(_0xc938('0x3'));var simpleParser=require('mailparser')[_0xc938('0x4')];var Iconv=require(_0xc938('0x5'))[_0xc938('0x6')];var EventEmitter=require(_0xc938('0x7'))[_0xc938('0x8')];var utils=require(_0xc938('0x9'));var logger=require('../../../config/logger')(_0xc938('0xa'));function EmailImap(_0x22821d,_0x5f040b){this['mailbox']=_0xc938('0xb');this['account']=this['getAccount'](_0x22821d,_0x5f040b);this['imap']=new Imap(this['account']);this[_0xc938('0xc')][_0xc938('0xd')](_0xc938('0xe'),this[_0xc938('0xf')][_0xc938('0x10')](this));this[_0xc938('0xc')]['once'](_0xc938('0x11'),this['handleEnd'][_0xc938('0x10')](this));this[_0xc938('0xc')]['on']('error',this[_0xc938('0x12')][_0xc938('0x10')](this));this['imap']['connect']();}util[_0xc938('0x13')](EmailImap,EventEmitter);EmailImap[_0xc938('0x14')]['getAccount']=function(_0x101bbe,_0x3d8826){var _0x5ca58c={'connTimeout':_0x101bbe['connTimeout']?_0x101bbe['connTimeout']*0x3e8:0x2710,'authTimeout':_0x101bbe[_0xc938('0x15')]?_0x101bbe['authTimeout']*0x3e8:0x1388};if(_[_0xc938('0x16')](_0x101bbe[_0xc938('0x17')])){if(_0x101bbe[_0xc938('0x18')]){_0x5ca58c[_0xc938('0x19')]=_0x101bbe[_0xc938('0x19')];_0x5ca58c[_0xc938('0x1a')]=_0x101bbe['password'];}_0x5ca58c[_0xc938('0x1b')]=_0x101bbe['host'];_0x5ca58c[_0xc938('0x1c')]=_0x101bbe[_0xc938('0x1c')]||0x3e1;if(_0x101bbe[_0xc938('0x1d')]){_0x5ca58c['tls']=!![];}else{_0x5ca58c[_0xc938('0x1d')]=![];_0x5ca58c[_0xc938('0x1e')]=_0xc938('0x1f');}}else{_0x5ca58c['user']=_0x101bbe[_0xc938('0x19')];_0x5ca58c[_0xc938('0x1a')]=_0x101bbe[_0xc938('0x1a')];_0x5ca58c[_0xc938('0x1b')]=utils[_0xc938('0x20')](_0x101bbe[_0xc938('0x17')]);_0x5ca58c['port']=0x3e1;_0x5ca58c[_0xc938('0x1d')]=!![];}_0x5ca58c[_0xc938('0xa')]=_0x3d8826||_0x101bbe[_0xc938('0x19')]||_0xc938('0x21');return _0x5ca58c;};EmailImap[_0xc938('0x14')]['handleReady']=function(){this[_0xc938('0xc')]['openBox'](this[_0xc938('0x22')],![],this[_0xc938('0x23')][_0xc938('0x10')](this));};EmailImap[_0xc938('0x14')][_0xc938('0x23')]=function(_0x53c8e4,_0x3c33c7){if(_0x53c8e4){this[_0xc938('0x12')](_0x53c8e4,!![]);}else{this[_0xc938('0x24')]('box',_0x3c33c7);this[_0xc938('0x25')]();}};EmailImap[_0xc938('0x14')][_0xc938('0x26')]=function(_0x56d081){if(_0x56d081){this[_0xc938('0x12')](_0x56d081,!![]);}else{this[_0xc938('0xc')]['end']();}};EmailImap[_0xc938('0x14')][_0xc938('0x25')]=function(){this['imap'][_0xc938('0x27')]([_0xc938('0x28')],this[_0xc938('0x29')][_0xc938('0x10')](this));};EmailImap[_0xc938('0x14')][_0xc938('0x29')]=function(_0x14c892,_0x237c77){if(_0x14c892){this[_0xc938('0x12')](_0x14c892,!![]);}else{if(_0x237c77[_0xc938('0x2a')]){try{var _0x2ca269=this[_0xc938('0xc')][_0xc938('0x2b')](_0x237c77,{'bodies':'','markSeen':!![]});_0x2ca269['on']('message',this[_0xc938('0x2c')][_0xc938('0x10')](this));_0x2ca269[_0xc938('0xd')](_0xc938('0x2d'),this[_0xc938('0x2e')][_0xc938('0x10')](this));_0x2ca269[_0xc938('0xd')](_0xc938('0x11'),this[_0xc938('0x2f')]['bind'](this));}catch(_0x442e5f){logger['error'](_0x442e5f);}}else{this[_0xc938('0xc')][_0xc938('0x30')](!![],this[_0xc938('0x26')][_0xc938('0x10')](this));}}};EmailImap['prototype'][_0xc938('0x2c')]=function(_0x288911,_0x4c0668){_0x288911['on'](_0xc938('0x31'),this[_0xc938('0x32')]['bind'](this));_0x288911[_0xc938('0xd')](_0xc938('0x33'),this[_0xc938('0x34')][_0xc938('0x10')](this));_0x288911[_0xc938('0xd')]('end',this[_0xc938('0x35')][_0xc938('0x10')](this));};EmailImap[_0xc938('0x14')]['handleMessageBody']=function(_0x56c9be,_0x54f728){simpleParser(_0x56c9be,{'Iconv':Iconv},this['handleSimpleParser'][_0xc938('0x10')](this));};EmailImap[_0xc938('0x14')][_0xc938('0x34')]=function(_0x37e075){};EmailImap['prototype'][_0xc938('0x35')]=function(){};EmailImap['prototype']['handleSimpleParser']=function(_0x42baeb,_0x13663e){if(_0x42baeb){logger['error'](_0x42baeb);}else{var _0x54f9cd=this;utils[_0xc938('0x36')](this[_0xc938('0x37')],_0x13663e,function(_0x103464){_0x54f9cd[_0xc938('0x24')](_0xc938('0xa'),_0x103464);});}};EmailImap[_0xc938('0x14')]['handleFetchEnd']=function(){this[_0xc938('0xc')]['closeBox'](!![],this['handleCloseBox'][_0xc938('0x10')](this));};EmailImap[_0xc938('0x14')][_0xc938('0x2e')]=function(_0x30dc74){this[_0xc938('0x12')](_0x30dc74);this[_0xc938('0xc')]['closeBox'](!![],this[_0xc938('0x26')][_0xc938('0x10')](this));};EmailImap[_0xc938('0x14')][_0xc938('0x38')]=function(){this[_0xc938('0x24')](_0xc938('0x11'));};EmailImap[_0xc938('0x14')][_0xc938('0x12')]=function(_0x2a3dca,_0x58eaea){logger[_0xc938('0x2d')]('handleError',this[_0xc938('0x37')]['email'],JSON[_0xc938('0x39')](_0x2a3dca));var _0x3280a0='';if(_0x2a3dca){if(_0x2a3dca[_0xc938('0x3a')]){_0x3280a0=_0x2a3dca[_0xc938('0x3a')];}else{for(var _0x99bcc in _0x2a3dca){if(_0x2a3dca[_0xc938('0x3b')](_0x99bcc)){_0x3280a0+=_['upperFirst'](_0x99bcc)+':\x20'+_0x2a3dca[_0x99bcc]+'\x0a';}}}}if(_0x58eaea){this[_0xc938('0xc')]['end']();}else{this['emit'](_0xc938('0x2d'),_0x3280a0);this[_0xc938('0x24')](_0xc938('0x11'));}};module['exports']=EmailImap; \ No newline at end of file +var _0x8ce3=['path','util','lodash','randomstring','mailparser','simpleParser','iconv','Iconv','events','EventEmitter','../../../config/logger','email','mailbox','INBOX','getAccount','account','once','ready','handleReady','bind','imap','end','handleEnd','error','handleError','connect','inherits','connTimeout','authTimeout','isNil','authentication','user','password','host','port','tls','autotls','required','getHost','service','anonymous@xcally.com','prototype','openBox','handleOpenBox','emit','box','readUnseen','handleCloseBox','search','UNSEEN','length','fetch','message','handleFetchMessage','handleFetchError','handleFetchEnd','closeBox','handleMessageBody','attributes','handleMessageAttributes','handleMessageEnd','handleSimpleParser','stringify','textCode','hasOwnProperty'];(function(_0xdf1275,_0x4e033a){var _0x2e928a=function(_0x22c323){while(--_0x22c323){_0xdf1275['push'](_0xdf1275['shift']());}};_0x2e928a(++_0x4e033a);}(_0x8ce3,0xc3));var _0x38ce=function(_0x31991b,_0xaf75d2){_0x31991b=_0x31991b-0x0;var _0x307304=_0x8ce3[_0x31991b];return _0x307304;};'use strict';var fs=require('fs');var path=require(_0x38ce('0x0'));var util=require(_0x38ce('0x1'));var Imap=require('imap');var _=require(_0x38ce('0x2'));var rs=require(_0x38ce('0x3'));var simpleParser=require(_0x38ce('0x4'))[_0x38ce('0x5')];var Iconv=require(_0x38ce('0x6'))[_0x38ce('0x7')];var EventEmitter=require(_0x38ce('0x8'))[_0x38ce('0x9')];var utils=require('./utils');var logger=require(_0x38ce('0xa'))(_0x38ce('0xb'));function EmailImap(_0x58074c,_0x262b13){this[_0x38ce('0xc')]=_0x38ce('0xd');this['account']=this[_0x38ce('0xe')](_0x58074c,_0x262b13);this['imap']=new Imap(this[_0x38ce('0xf')]);this['imap'][_0x38ce('0x10')](_0x38ce('0x11'),this[_0x38ce('0x12')][_0x38ce('0x13')](this));this[_0x38ce('0x14')][_0x38ce('0x10')](_0x38ce('0x15'),this[_0x38ce('0x16')][_0x38ce('0x13')](this));this[_0x38ce('0x14')]['on'](_0x38ce('0x17'),this[_0x38ce('0x18')][_0x38ce('0x13')](this));this[_0x38ce('0x14')][_0x38ce('0x19')]();}util[_0x38ce('0x1a')](EmailImap,EventEmitter);EmailImap['prototype']['getAccount']=function(_0x3c4d7f,_0x2aabd8){var _0x2369f3={'connTimeout':_0x3c4d7f['connTimeout']?_0x3c4d7f[_0x38ce('0x1b')]*0x3e8:0x2710,'authTimeout':_0x3c4d7f['authTimeout']?_0x3c4d7f[_0x38ce('0x1c')]*0x3e8:0x1388};if(_[_0x38ce('0x1d')](_0x3c4d7f['service'])){if(_0x3c4d7f[_0x38ce('0x1e')]){_0x2369f3[_0x38ce('0x1f')]=_0x3c4d7f[_0x38ce('0x1f')];_0x2369f3['password']=_0x3c4d7f[_0x38ce('0x20')];}_0x2369f3[_0x38ce('0x21')]=_0x3c4d7f[_0x38ce('0x21')];_0x2369f3[_0x38ce('0x22')]=_0x3c4d7f[_0x38ce('0x22')]||0x3e1;if(_0x3c4d7f[_0x38ce('0x23')]){_0x2369f3[_0x38ce('0x23')]=!![];}else{_0x2369f3['tls']=![];_0x2369f3[_0x38ce('0x24')]=_0x38ce('0x25');}}else{_0x2369f3[_0x38ce('0x1f')]=_0x3c4d7f[_0x38ce('0x1f')];_0x2369f3[_0x38ce('0x20')]=_0x3c4d7f[_0x38ce('0x20')];_0x2369f3[_0x38ce('0x21')]=utils[_0x38ce('0x26')](_0x3c4d7f[_0x38ce('0x27')]);_0x2369f3[_0x38ce('0x22')]=0x3e1;_0x2369f3[_0x38ce('0x23')]=!![];}_0x2369f3['email']=_0x2aabd8||_0x3c4d7f[_0x38ce('0x1f')]||_0x38ce('0x28');return _0x2369f3;};EmailImap[_0x38ce('0x29')][_0x38ce('0x12')]=function(){this['imap'][_0x38ce('0x2a')](this[_0x38ce('0xc')],![],this['handleOpenBox'][_0x38ce('0x13')](this));};EmailImap[_0x38ce('0x29')][_0x38ce('0x2b')]=function(_0x5b330c,_0x4a7e8e){if(_0x5b330c){this[_0x38ce('0x18')](_0x5b330c,!![]);}else{this[_0x38ce('0x2c')](_0x38ce('0x2d'),_0x4a7e8e);this[_0x38ce('0x2e')]();}};EmailImap[_0x38ce('0x29')][_0x38ce('0x2f')]=function(_0x13e2fc){if(_0x13e2fc){this[_0x38ce('0x18')](_0x13e2fc,!![]);}else{this[_0x38ce('0x14')][_0x38ce('0x15')]();}};EmailImap[_0x38ce('0x29')][_0x38ce('0x2e')]=function(){this['imap'][_0x38ce('0x30')]([_0x38ce('0x31')],this['handleReadUnseen'][_0x38ce('0x13')](this));};EmailImap[_0x38ce('0x29')]['handleReadUnseen']=function(_0xd96d33,_0x282ee4){if(_0xd96d33){this['handleError'](_0xd96d33,!![]);}else{if(_0x282ee4[_0x38ce('0x32')]){try{var _0x53f2c9=this[_0x38ce('0x14')][_0x38ce('0x33')](_0x282ee4,{'bodies':'','markSeen':!![]});_0x53f2c9['on'](_0x38ce('0x34'),this[_0x38ce('0x35')][_0x38ce('0x13')](this));_0x53f2c9[_0x38ce('0x10')](_0x38ce('0x17'),this[_0x38ce('0x36')]['bind'](this));_0x53f2c9['once'](_0x38ce('0x15'),this[_0x38ce('0x37')][_0x38ce('0x13')](this));}catch(_0x34cb97){logger[_0x38ce('0x17')](_0x34cb97);}}else{this['imap'][_0x38ce('0x38')](!![],this[_0x38ce('0x2f')][_0x38ce('0x13')](this));}}};EmailImap[_0x38ce('0x29')][_0x38ce('0x35')]=function(_0x231268,_0x3d7f64){_0x231268['on']('body',this[_0x38ce('0x39')][_0x38ce('0x13')](this));_0x231268['once'](_0x38ce('0x3a'),this[_0x38ce('0x3b')][_0x38ce('0x13')](this));_0x231268[_0x38ce('0x10')](_0x38ce('0x15'),this[_0x38ce('0x3c')][_0x38ce('0x13')](this));};EmailImap[_0x38ce('0x29')]['handleMessageBody']=function(_0x3d2c8c,_0x185e8f){simpleParser(_0x3d2c8c,{'Iconv':Iconv},this[_0x38ce('0x3d')][_0x38ce('0x13')](this));};EmailImap['prototype'][_0x38ce('0x3b')]=function(_0x54a15a){};EmailImap[_0x38ce('0x29')][_0x38ce('0x3c')]=function(){};EmailImap[_0x38ce('0x29')][_0x38ce('0x3d')]=function(_0x43d629,_0x1b9601){if(_0x43d629){logger['error'](_0x43d629);}else{var _0x1c3fd5=this;utils['parser'](this[_0x38ce('0xf')],_0x1b9601,function(_0x986a18){_0x1c3fd5[_0x38ce('0x2c')](_0x38ce('0xb'),_0x986a18);});}};EmailImap[_0x38ce('0x29')][_0x38ce('0x37')]=function(){this['imap'][_0x38ce('0x38')](!![],this[_0x38ce('0x2f')][_0x38ce('0x13')](this));};EmailImap[_0x38ce('0x29')][_0x38ce('0x36')]=function(_0x467d3e){this['handleError'](_0x467d3e);this['imap'][_0x38ce('0x38')](!![],this[_0x38ce('0x2f')][_0x38ce('0x13')](this));};EmailImap[_0x38ce('0x29')][_0x38ce('0x16')]=function(){this[_0x38ce('0x2c')](_0x38ce('0x15'));};EmailImap['prototype'][_0x38ce('0x18')]=function(_0x30cfe3,_0x5a689b){logger[_0x38ce('0x17')](_0x38ce('0x18'),this[_0x38ce('0xf')]['email'],JSON[_0x38ce('0x3e')](_0x30cfe3));var _0xd95bc8='';if(_0x30cfe3){if(_0x30cfe3[_0x38ce('0x3f')]){_0xd95bc8=_0x30cfe3[_0x38ce('0x3f')];}else{for(var _0x24cf78 in _0x30cfe3){if(_0x30cfe3[_0x38ce('0x40')](_0x24cf78)){_0xd95bc8+=_['upperFirst'](_0x24cf78)+':\x20'+_0x30cfe3[_0x24cf78]+'\x0a';}}}}if(_0x5a689b){this[_0x38ce('0x14')][_0x38ce('0x15')]();}else{this[_0x38ce('0x2c')](_0x38ce('0x17'),_0xd95bc8);this[_0x38ce('0x2c')](_0x38ce('0x15'));}};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 38206f2..ce1d215 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 _0xa9e5=['Not\x20verifired','exports','nodemailer','bluebird','nodemailer-plugin-inline-base64','prototype','send','createTransport','compile','sendMail','toString','verify'];(function(_0x217aca,_0x468ed6){var _0x432d5a=function(_0x3e9654){while(--_0x3e9654){_0x217aca['push'](_0x217aca['shift']());}};_0x432d5a(++_0x468ed6);}(_0xa9e5,0xb6));var _0x5a9e=function(_0x19561b,_0x213b5b){_0x19561b=_0x19561b-0x0;var _0x45f6ec=_0xa9e5[_0x19561b];return _0x45f6ec;};'use strict';var nodemailer=require(_0x5a9e('0x0'));var BPromise=require(_0x5a9e('0x1'));var inlineBase64=require(_0x5a9e('0x2'));function EmailSmtp(){}EmailSmtp[_0x5a9e('0x3')][_0x5a9e('0x4')]=function(_0x1b9bec,_0x428957){return new BPromise(function(_0x2ce9ca,_0x22fd0a){var _0x3d800b=nodemailer[_0x5a9e('0x5')](_0x1b9bec);_0x3d800b['use'](_0x5a9e('0x6'),inlineBase64());_0x3d800b[_0x5a9e('0x7')](_0x428957,function(_0x12982e,_0x41ae25){if(_0x12982e){_0x22fd0a(_0x12982e[_0x5a9e('0x8')]());}else{_0x2ce9ca(_0x41ae25);}});});};EmailSmtp[_0x5a9e('0x3')][_0x5a9e('0x9')]=function(_0x556d46){return new BPromise(function(_0x40112b,_0x14113e){var _0x5e4eec=nodemailer['createTransport'](_0x556d46);_0x5e4eec[_0x5a9e('0x9')](function(_0x42b1d8,_0x7466b5){if(_0x42b1d8){_0x14113e(_0x42b1d8[_0x5a9e('0x8')]());}else{if(_0x7466b5){_0x40112b(_0x7466b5);}else{_0x14113e(_0x5a9e('0xa'));}}});});};module[_0x5a9e('0xb')]=EmailSmtp; \ No newline at end of file +var _0x9c12=['sendMail','toString','verify','Not\x20verifired','exports','nodemailer','nodemailer-plugin-inline-base64','send','createTransport','use','compile'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x9c12,0x10d));var _0x29c1=function(_0x4d613c,_0x55f220){_0x4d613c=_0x4d613c-0x0;var _0x301fe3=_0x9c12[_0x4d613c];return _0x301fe3;};'use strict';var nodemailer=require(_0x29c1('0x0'));var BPromise=require('bluebird');var inlineBase64=require(_0x29c1('0x1'));function EmailSmtp(){}EmailSmtp['prototype'][_0x29c1('0x2')]=function(_0x4cda42,_0x4c491e){return new BPromise(function(_0x5be96b,_0x6281ff){var _0x2399cf=nodemailer[_0x29c1('0x3')](_0x4cda42);_0x2399cf[_0x29c1('0x4')](_0x29c1('0x5'),inlineBase64());_0x2399cf[_0x29c1('0x6')](_0x4c491e,function(_0x138203,_0x5072df){if(_0x138203){_0x6281ff(_0x138203[_0x29c1('0x7')]());}else{_0x5be96b(_0x5072df);}});});};EmailSmtp['prototype'][_0x29c1('0x8')]=function(_0x291d3d){return new BPromise(function(_0x1c437b,_0x197958){var _0x562566=nodemailer['createTransport'](_0x291d3d);_0x562566[_0x29c1('0x8')](function(_0x3a9050,_0x581da1){if(_0x3a9050){_0x197958(_0x3a9050['toString']());}else{if(_0x581da1){_0x1c437b(_0x581da1);}else{_0x197958(_0x29c1('0x9'));}}});});};module[_0x29c1('0xa')]=EmailSmtp; \ No newline at end of file diff --git a/server/services/email/lib/utils.js b/server/services/email/lib/utils.js index e6a8aa7..38cf5d0 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 _0xa5aa=['forEach','push','filename','_IMG','\x20[Attachment:\x20','body','textAsHtml','message','originTo','originCc','includes','bcc','attach','type','attachment','attachment-','format','root','content','contentType','headerLines','Auto-Submitted:\x20auto-replied','X-Auto-Response-Suppress:\x20All','Precedence:\x20auto_reply','indexOf','from','messageId','inReplyTo','date','YYYY-MM-DD\x20HH:mm:ss','filter','application/ms-tnef','info','Email\x20message\x20%s\x20is\x20in\x20TNEF\x20format:\x20message\x20content\x20will\x20be\x20converted\x20by\x20the\x20system','parseBuffer','BodyHTML','

Empty\x20message

','Attachments','getHost','gmail','imap.gmail.com','yahoo','imap.mail.yahoo.com','hotmail','imap-mail.outlook.com','outlook365','outlook.office365.com','127.0.0.1','lodash','moment','path','util','node-tnef','../../../config/logger','email','../../../config/environment','head','value','anonymous','generate','name','address','substring','split','length','slice','join','Anonymous','pop','isEmpty','@xcally.com','html','test','replace','0x1?_0x7dc4c2[_0xaa5a('0x11')](0x0,-0x1)[_0xaa5a('0x12')]('\x20'):_0x1c4893[_0xaa5a('0xc')];}return _0xaa5a('0x13');}function getLastName(_0x2fee02){var _0x773260=_[_0xaa5a('0x8')](_0x2fee02[_0xaa5a('0x9')]);if(_0x773260&&_0x773260['name']){var _0x2d931c=_0x773260[_0xaa5a('0xc')][_0xaa5a('0xf')](/\s+/);return _0x2d931c['length']>0x1?_0x2d931c[_0xaa5a('0x14')]():'';}return'';}function getMails(_0x10ba31,_0x286f17){var _0x2b6fd0='';for(var _0x8e1dde=0x0;_0x8e1dde<_0x286f17[_0xaa5a('0x9')][_0xaa5a('0x10')];_0x8e1dde+=0x1){if(_0x286f17[_0xaa5a('0x9')][_0x8e1dde][_0xaa5a('0xd')]!==_0x10ba31){if(!_[_0xaa5a('0x15')](_0x2b6fd0)){_0x2b6fd0+=',';}_0x2b6fd0+=_0x286f17[_0xaa5a('0x9')][_0x8e1dde][_0xaa5a('0xc')]||_0x286f17[_0xaa5a('0x9')][_0x8e1dde][_0xaa5a('0xd')]||'';_0x2b6fd0+='\x20<';_0x2b6fd0+=_0x286f17[_0xaa5a('0x9')][_0x8e1dde][_0xaa5a('0xd')]?_0x286f17[_0xaa5a('0x9')][_0x8e1dde]['address']:_0xaa5a('0xa')+random[_0xaa5a('0xb')](0x6)+_0xaa5a('0x16');_0x2b6fd0+='>';}}return _0x2b6fd0;}function parseEmail(_0x379da2,_0x5af50f,_0x3af4dc){if(_0x5af50f[_0xaa5a('0x17')]){var _0x399b12=/)<[^<]*)*<\/script>/gi;while(_0x399b12[_0xaa5a('0x18')](_0x5af50f[_0xaa5a('0x17')])){_0x5af50f[_0xaa5a('0x17')]=_0x5af50f[_0xaa5a('0x17')][_0xaa5a('0x19')](_0x399b12,'');}if(_0x5af50f[_0xaa5a('0x17')]['includes'](_0xaa5a('0x1a'))){var _0x4c9035=[];_0x5af50f[_0xaa5a('0x1b')][_0xaa5a('0x1c')](_0x17d454=>{_0x4c9035[_0xaa5a('0x1d')](_0x17d454[_0xaa5a('0x1e')]);});var _0x47cdcf=/]+>/g;var _0x36a491=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0x319ba9=_0x5af50f['html'][_0xaa5a('0x19')](_0x36a491,'_SRC');var _0x36582e=_0x319ba9[_0xaa5a('0x19')](_0x47cdcf,_0xaa5a('0x1f'));for(let _0x27fe53=0x0;_0x27fe53<_0x4c9035[_0xaa5a('0x10')];_0x27fe53++){var _0x10208d=_0x36582e['replace'](_0xaa5a('0x1f'),_0xaa5a('0x20')+_0x4c9035[_0x27fe53]+'\x20]');_0x36582e=_0x10208d;}_0x5af50f[_0xaa5a('0x17')]=_0x36582e;}_0x3af4dc[_0xaa5a('0x21')]=_0x5af50f['html'];}else{_0x3af4dc[_0xaa5a('0x21')]=_0x5af50f[_0xaa5a('0x22')];}if(_0x3af4dc[_0xaa5a('0x21')]){_0x3af4dc[_0xaa5a('0x21')]=_0x3af4dc[_0xaa5a('0x21')][_0xaa5a('0x19')](/0x0){var _0x5e5b09=[_0xaa5a('0x31'),_0xaa5a('0x32'),_0xaa5a('0x33')];for(var _0x37c931=0x0;_0x37c931<_0x5af50f[_0xaa5a('0x30')][_0xaa5a('0x10')];_0x37c931++){var _0x1bdaa5=_[_0xaa5a('0x34')](_0x5e5b09,_0x5af50f[_0xaa5a('0x30')][_0x37c931]['line']);if(_0x1bdaa5>=0x0){_0x3af4dc['isAutoreply']=!![];}}}return _0x3af4dc;}exports['parser']=function(_0x4d9d16,_0x232a29,_0x2cb855){var _0x37f840={'from':getAddress(_0x232a29[_0xaa5a('0x35')]),'firstName':getFirstName(_0x232a29[_0xaa5a('0x35')]),'lastName':getLastName(_0x232a29[_0xaa5a('0x35')]),'mapKey':_0xaa5a('0x6'),'message':{'from':getMails(_0x4d9d16[_0xaa5a('0x6')],_0x232a29[_0xaa5a('0x35')]),'to':_0x4d9d16[_0xaa5a('0x6')],'cc':'','subject':_0x232a29['subject']||'','messageId':_0x232a29[_0xaa5a('0x36')],'inReplyTo':_0x232a29[_0xaa5a('0x37')],'sentAt':moment(_0x232a29[_0xaa5a('0x38')])[_0xaa5a('0x2c')](_0xaa5a('0x39')),'attach':![],'attachments':[]}};if(!_0x232a29[_0xaa5a('0x17')]&&!_0x232a29[_0xaa5a('0x22')]){var _0x4980ac=_[_0xaa5a('0x3a')](_0x232a29[_0xaa5a('0x1b')],{'contentType':_0xaa5a('0x3b')});if(_0x4980ac[_0xaa5a('0x10')]){logger[_0xaa5a('0x3c')](util[_0xaa5a('0x2c')](_0xaa5a('0x3d'),_0x232a29[_0xaa5a('0x36')]));tnef[_0xaa5a('0x3e')](_['first'](_0x4980ac)['content'],function(_0xfe206a,_0x339b36){if(_0x339b36){_0x232a29[_0xaa5a('0x17')]=_0x339b36[_0xaa5a('0x3f')]||_0xaa5a('0x40');if(_0x339b36[_0xaa5a('0x41')]){for(var _0x3bb555=0x0;_0x3bb555<_0x339b36['Attachments'][_0xaa5a('0x10')];_0x3bb555++){var _0x77eb02=_0x339b36[_0xaa5a('0x41')][_0x3bb555];_0x37f840[_0xaa5a('0x23')][_0xaa5a('0x1b')]['push']({'filename':_0x77eb02['Title'],'content':Buffer['from'](_0x77eb02['Data'])});}}}_0x2cb855(parseEmail(_0x4d9d16,_0x232a29,_0x37f840));});}else{_0x232a29[_0xaa5a('0x17')]=_0xaa5a('0x40');_0x2cb855(parseEmail(_0x4d9d16,_0x232a29,_0x37f840));}}else{_0x2cb855(parseEmail(_0x4d9d16,_0x232a29,_0x37f840));}};exports[_0xaa5a('0x42')]=function(_0x217337){switch(_0x217337){case _0xaa5a('0x43'):return _0xaa5a('0x44');case _0xaa5a('0x45'):return _0xaa5a('0x46');case _0xaa5a('0x47'):return _0xaa5a('0x48');case _0xaa5a('0x49'):return _0xaa5a('0x4a');}return _0xaa5a('0x4b');}; \ No newline at end of file +var _0x556a=['messageId','inReplyTo','YYYY-MM-DD\x20HH:mm:ss','filter','application/ms-tnef','info','first','BodyHTML','

Empty\x20message

','Attachments','Title','Data','getHost','gmail','yahoo','imap.mail.yahoo.com','hotmail','imap-mail.outlook.com','outlook365','outlook.office365.com','127.0.0.1','lodash','moment','randomstring','path','util','node-tnef','../../../config/logger','email','../../../config/environment','head','value','address','generate','@xcally.com','name','substring','indexOf','length','Anonymous','split','isEmpty','anonymous','html','replace','includes','\x20[Attachment:\x20','\x20]','body','textAsHtml','0x1?_0x5771ec['slice'](0x0,-0x1)['join']('\x20'):_0x41eabd[_0xa556('0xe')];}return _0xa556('0x12');}function getLastName(_0x6c1794){var _0x2c332a=_['head'](_0x6c1794[_0xa556('0xa')]);if(_0x2c332a&&_0x2c332a[_0xa556('0xe')]){var _0x30e70a=_0x2c332a[_0xa556('0xe')][_0xa556('0x13')](/\s+/);return _0x30e70a['length']>0x1?_0x30e70a['pop']():'';}return'';}function getMails(_0xbdb988,_0x25b94f){var _0x48e045='';for(var _0x3f8bd7=0x0;_0x3f8bd7<_0x25b94f['value']['length'];_0x3f8bd7+=0x1){if(_0x25b94f[_0xa556('0xa')][_0x3f8bd7][_0xa556('0xb')]!==_0xbdb988){if(!_[_0xa556('0x14')](_0x48e045)){_0x48e045+=',';}_0x48e045+=_0x25b94f[_0xa556('0xa')][_0x3f8bd7][_0xa556('0xe')]||_0x25b94f[_0xa556('0xa')][_0x3f8bd7]['address']||'';_0x48e045+='\x20<';_0x48e045+=_0x25b94f[_0xa556('0xa')][_0x3f8bd7][_0xa556('0xb')]?_0x25b94f[_0xa556('0xa')][_0x3f8bd7]['address']:_0xa556('0x15')+random[_0xa556('0xc')](0x6)+'@xcally.com';_0x48e045+='>';}}return _0x48e045;}function parseEmail(_0x5f4e24,_0x31c8c6,_0x102584){if(_0x31c8c6['html']){var _0x22e9d0=/)<[^<]*)*<\/script>/gi;while(_0x22e9d0['test'](_0x31c8c6[_0xa556('0x16')])){_0x31c8c6[_0xa556('0x16')]=_0x31c8c6[_0xa556('0x16')][_0xa556('0x17')](_0x22e9d0,'');}if(_0x31c8c6[_0xa556('0x16')][_0xa556('0x18')](_0xa556('0x19'))){var _0x26a28a=[];_0x31c8c6[_0xa556('0x1a')][_0xa556('0x1b')](_0x23b758=>{_0x26a28a[_0xa556('0x1c')](_0x23b758['filename']);});var _0x2ca8b6=/]+>/g;var _0x1193a3=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0x518557=_0x31c8c6[_0xa556('0x16')][_0xa556('0x17')](_0x1193a3,'_SRC');var _0x3855af=_0x518557[_0xa556('0x17')](_0x2ca8b6,_0xa556('0x1d'));for(let _0x5d573f=0x0;_0x5d573f<_0x26a28a[_0xa556('0x11')];_0x5d573f++){var _0x3503db=_0x3855af[_0xa556('0x17')]('_IMG',_0xa556('0x1e')+_0x26a28a[_0x5d573f]+_0xa556('0x1f'));_0x3855af=_0x3503db;}_0x31c8c6[_0xa556('0x16')]=_0x3855af;}_0x102584[_0xa556('0x20')]=_0x31c8c6[_0xa556('0x16')];}else{_0x102584[_0xa556('0x20')]=_0x31c8c6[_0xa556('0x21')];}if(_0x102584['body']){_0x102584[_0xa556('0x20')]=_0x102584['body'][_0xa556('0x17')](/0x0){var _0x5eda71=[_0xa556('0x34'),_0xa556('0x35'),'Precedence:\x20auto_reply'];for(var _0x4ef87b=0x0;_0x4ef87b<_0x31c8c6[_0xa556('0x33')]['length'];_0x4ef87b++){var _0x143908=_['indexOf'](_0x5eda71,_0x31c8c6[_0xa556('0x33')][_0x4ef87b]['line']);if(_0x143908>=0x0){_0x102584['isAutoreply']=!![];}}}return _0x102584;}exports['parser']=function(_0x5b405c,_0x3c700e,_0x21a384){var _0x59df54={'from':getAddress(_0x3c700e[_0xa556('0x36')]),'firstName':getFirstName(_0x3c700e[_0xa556('0x36')]),'lastName':getLastName(_0x3c700e['from']),'mapKey':'email','message':{'from':getMails(_0x5b405c[_0xa556('0x7')],_0x3c700e['from']),'to':_0x5b405c['email'],'cc':'','subject':_0x3c700e['subject']||'','messageId':_0x3c700e[_0xa556('0x37')],'inReplyTo':_0x3c700e[_0xa556('0x38')],'sentAt':moment(_0x3c700e['date'])[_0xa556('0x2b')](_0xa556('0x39')),'attach':![],'attachments':[]}};if(!_0x3c700e[_0xa556('0x16')]&&!_0x3c700e['textAsHtml']){var _0x4e001b=_[_0xa556('0x3a')](_0x3c700e[_0xa556('0x1a')],{'contentType':_0xa556('0x3b')});if(_0x4e001b[_0xa556('0x11')]){logger[_0xa556('0x3c')](util[_0xa556('0x2b')]('Email\x20message\x20%s\x20is\x20in\x20TNEF\x20format:\x20message\x20content\x20will\x20be\x20converted\x20by\x20the\x20system',_0x3c700e['messageId']));tnef['parseBuffer'](_[_0xa556('0x3d')](_0x4e001b)[_0xa556('0x31')],function(_0x529f2b,_0x21bb80){if(_0x21bb80){_0x3c700e['html']=_0x21bb80[_0xa556('0x3e')]||_0xa556('0x3f');if(_0x21bb80[_0xa556('0x40')]){for(var _0x3cd157=0x0;_0x3cd157<_0x21bb80['Attachments'][_0xa556('0x11')];_0x3cd157++){var _0xd22b9d=_0x21bb80[_0xa556('0x40')][_0x3cd157];_0x59df54[_0xa556('0x23')][_0xa556('0x1a')][_0xa556('0x1c')]({'filename':_0xd22b9d[_0xa556('0x41')],'content':Buffer['from'](_0xd22b9d[_0xa556('0x42')])});}}}_0x21a384(parseEmail(_0x5b405c,_0x3c700e,_0x59df54));});}else{_0x3c700e[_0xa556('0x16')]='

Empty\x20message

';_0x21a384(parseEmail(_0x5b405c,_0x3c700e,_0x59df54));}}else{_0x21a384(parseEmail(_0x5b405c,_0x3c700e,_0x59df54));}};exports[_0xa556('0x43')]=function(_0x369c49){switch(_0x369c49){case _0xa556('0x44'):return'imap.gmail.com';case _0xa556('0x45'):return _0xa556('0x46');case _0xa556('0x47'):return _0xa556('0x48');case _0xa556('0x49'):return _0xa556('0x4a');}return _0xa556('0x4b');}; \ No newline at end of file diff --git a/server/services/email/model/mailAccount.js b/server/services/email/model/mailAccount.js index 356c303..008abc2 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 _0x30d5=['Imap','Smtp','exports','name','key','active'];(function(_0x3aacb3,_0x1422be){var _0x387f83=function(_0x1b9d63){while(--_0x1b9d63){_0x3aacb3['push'](_0x3aacb3['shift']());}};_0x387f83(++_0x1422be);}(_0x30d5,0x141));var _0x530d=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x30d5[_0x40a045];return _0x1a687c;};'use strict';var _=require('lodash');function MailAccount(_0x2d1adc){this['id']=_0x2d1adc['id']||0x0;this[_0x530d('0x0')]=_0x2d1adc[_0x530d('0x0')]||'Service';this[_0x530d('0x1')]=_0x2d1adc['key']||'SERV';this['active']=_0x2d1adc[_0x530d('0x2')]||![];this[_0x530d('0x3')]=_0x2d1adc[_0x530d('0x3')]||[];this[_0x530d('0x4')]=_0x2d1adc['Smtp']||[];}module[_0x530d('0x5')]=MailAccount; \ No newline at end of file +var _0x2b39=['lodash','name','key','SERV','active','Imap','Smtp','exports'];(function(_0x3af55b,_0x3d8d88){var _0x199daf=function(_0x490661){while(--_0x490661){_0x3af55b['push'](_0x3af55b['shift']());}};_0x199daf(++_0x3d8d88);}(_0x2b39,0x68));var _0x92b3=function(_0x6b1c9e,_0x322a1){_0x6b1c9e=_0x6b1c9e-0x0;var _0x4fb0d5=_0x2b39[_0x6b1c9e];return _0x4fb0d5;};'use strict';var _=require(_0x92b3('0x0'));function MailAccount(_0x21ccd6){this['id']=_0x21ccd6['id']||0x0;this['name']=_0x21ccd6[_0x92b3('0x1')]||'Service';this[_0x92b3('0x2')]=_0x21ccd6['key']||_0x92b3('0x3');this[_0x92b3('0x4')]=_0x21ccd6[_0x92b3('0x4')]||![];this[_0x92b3('0x5')]=_0x21ccd6[_0x92b3('0x5')]||[];this[_0x92b3('0x6')]=_0x21ccd6[_0x92b3('0x6')]||[];}module[_0x92b3('0x7')]=MailAccount; \ No newline at end of file diff --git a/server/services/email/realtime/index.js b/server/services/email/realtime/index.js index 4ba9aca..f32125f 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 _0xb28e=['exports','lodash','../model/mailAccount','mailAccounts','mapKeys','hasOwnProperty','prototype','mergeFromDatabase','length','isUndefined','merge'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xb28e,0x16c));var _0xeb28=function(_0x550224,_0x4610e0){_0x550224=_0x550224-0x0;var _0x582237=_0xb28e[_0x550224];return _0x582237;};'use strict';var _=require(_0xeb28('0x0'));var MailAccount=require(_0xeb28('0x1'));var Realtime=function(){this[_0xeb28('0x2')]={};};function freeIsNotKey(_0x4b903a,_0x2e13c2,_0x1c4a26){var _0x2c955e=_[_0xeb28('0x3')](_0x4b903a,function(_0x260a16,_0x4693d4){return _0x260a16[_0x1c4a26];});for(var _0x2a0dba in _0x2e13c2){if(_0x2e13c2[_0xeb28('0x4')](_0x2a0dba)){if(!_0x2c955e[_0x2a0dba]){delete _0x2e13c2[_0x2a0dba];}}}}Realtime[_0xeb28('0x5')][_0xeb28('0x6')]=function(_0xbe4318,_0x412ea3){for(var _0x3ed43b in _0x412ea3){if(_0xbe4318[_0xeb28('0x4')](_0x3ed43b)){_0xbe4318[_0x3ed43b]=_0x412ea3[_0x3ed43b];}}};Realtime['prototype']['initMailAccounts']=function(){var _0x415cd7=this;return function(_0x1a6449){if(_0x1a6449){freeIsNotKey(_0x1a6449,_0x415cd7[_0xeb28('0x2')],'id');for(var _0x5a59a6=0x0,_0x4b2d6c={},_0x59fff6={};_0x5a59a6<_0x1a6449[_0xeb28('0x7')];_0x5a59a6+=0x1){_0x4b2d6c=_0x1a6449[_0x5a59a6];if(_[_0xeb28('0x8')](_0x415cd7[_0xeb28('0x2')][_0x4b2d6c['id']])){_0x415cd7[_0xeb28('0x2')][_0x4b2d6c['id']]=new MailAccount(_0x4b2d6c);}else{_[_0xeb28('0x9')](_0x415cd7['mailAccounts'][_0x4b2d6c['id']],_0x4b2d6c);}}}return _0x415cd7[_0xeb28('0x2')];};};module[_0xeb28('0xa')]=Realtime; \ No newline at end of file +var _0xa1b9=['merge','exports','lodash','mailAccounts','mapKeys','hasOwnProperty','prototype','initMailAccounts','length'];(function(_0x2bafde,_0x39326c){var _0x5733dc=function(_0x3aa9a6){while(--_0x3aa9a6){_0x2bafde['push'](_0x2bafde['shift']());}};_0x5733dc(++_0x39326c);}(_0xa1b9,0xb6));var _0x9a1b=function(_0x411add,_0x1aed38){_0x411add=_0x411add-0x0;var _0x238242=_0xa1b9[_0x411add];return _0x238242;};'use strict';var _=require(_0x9a1b('0x0'));var MailAccount=require('../model/mailAccount');var Realtime=function(){this[_0x9a1b('0x1')]={};};function freeIsNotKey(_0xd9ba01,_0x33980f,_0x235486){var _0x5b9f94=_[_0x9a1b('0x2')](_0xd9ba01,function(_0x480ee0,_0x5f1e6b){return _0x480ee0[_0x235486];});for(var _0x4c7d89 in _0x33980f){if(_0x33980f[_0x9a1b('0x3')](_0x4c7d89)){if(!_0x5b9f94[_0x4c7d89]){delete _0x33980f[_0x4c7d89];}}}}Realtime[_0x9a1b('0x4')]['mergeFromDatabase']=function(_0x266007,_0x33ef04){for(var _0x3552bd in _0x33ef04){if(_0x266007[_0x9a1b('0x3')](_0x3552bd)){_0x266007[_0x3552bd]=_0x33ef04[_0x3552bd];}}};Realtime[_0x9a1b('0x4')][_0x9a1b('0x5')]=function(){var _0x2633ff=this;return function(_0x5f23b0){if(_0x5f23b0){freeIsNotKey(_0x5f23b0,_0x2633ff[_0x9a1b('0x1')],'id');for(var _0x3de139=0x0,_0x51481a={},_0x26c23a={};_0x3de139<_0x5f23b0[_0x9a1b('0x6')];_0x3de139+=0x1){_0x51481a=_0x5f23b0[_0x3de139];if(_['isUndefined'](_0x2633ff[_0x9a1b('0x1')][_0x51481a['id']])){_0x2633ff[_0x9a1b('0x1')][_0x51481a['id']]=new MailAccount(_0x51481a);}else{_[_0x9a1b('0x7')](_0x2633ff[_0x9a1b('0x1')][_0x51481a['id']],_0x51481a);}}}return _0x2633ff[_0x9a1b('0x1')];};};module[_0x9a1b('0x8')]=Realtime; \ No newline at end of file diff --git a/server/services/email/rpc/mailAccount.js b/server/services/email/rpc/mailAccount.js index dfb2297..4563cef 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 _0x1a2a=['MailServerOut','getMailAccount','NotifyMailAccount','../client','getMailAccounts','Request','GetMailAccount','service','email','key','ListId','TemplateId','MailServerIn'];(function(_0x23f97b,_0x416706){var _0x45d628=function(_0x8e02d3){while(--_0x8e02d3){_0x23f97b['push'](_0x23f97b['shift']());}};_0x45d628(++_0x416706);}(_0x1a2a,0xd3));var _0xa1a2=function(_0x31c81b,_0x4a2b1c){_0x31c81b=_0x31c81b-0x0;var _0x52ab34=_0x1a2a[_0x31c81b];return _0x52ab34;};'use strict';var client=require(_0xa1a2('0x0'));exports[_0xa1a2('0x1')]=function(){return function(){return client[_0xa1a2('0x2')](_0xa1a2('0x3'),{'options':{'attributes':['id','name',_0xa1a2('0x4'),_0xa1a2('0x5'),'active',_0xa1a2('0x6'),_0xa1a2('0x7'),_0xa1a2('0x8')],'raw':![],'include':[{'model':_0xa1a2('0x9'),'as':'Imap'},{'model':_0xa1a2('0xa'),'as':'Smtp'}]},'log':_0xa1a2('0xb')});};};exports['notify']=function(_0x4e2de1,_0x35fca6){return client[_0xa1a2('0x2')](_0xa1a2('0xc'),{'account':{'id':_0x4e2de1},'body':_0x35fca6,'log':_0xa1a2('0xc')});}; \ No newline at end of file +var _0xd1ca=['active','ListId','Imap','MailServerOut','Smtp','notify','Request','NotifyMailAccount','../client','getMailAccounts','service','email'];(function(_0x5c2c7c,_0xa7d3b1){var _0xea7ffe=function(_0x471f17){while(--_0x471f17){_0x5c2c7c['push'](_0x5c2c7c['shift']());}};_0xea7ffe(++_0xa7d3b1);}(_0xd1ca,0x140));var _0xad1c=function(_0x160c73,_0x2ee678){_0x160c73=_0x160c73-0x0;var _0xd9302=_0xd1ca[_0x160c73];return _0xd9302;};'use strict';var client=require(_0xad1c('0x0'));exports[_0xad1c('0x1')]=function(){return function(){return client['Request']('GetMailAccount',{'options':{'attributes':['id','name',_0xad1c('0x2'),_0xad1c('0x3'),_0xad1c('0x4'),'key',_0xad1c('0x5'),'TemplateId'],'raw':![],'include':[{'model':'MailServerIn','as':_0xad1c('0x6')},{'model':_0xad1c('0x7'),'as':_0xad1c('0x8')}]},'log':'getMailAccount'});};};exports[_0xad1c('0x9')]=function(_0x51b05c,_0x45bfc8){return client[_0xad1c('0xa')](_0xad1c('0xb'),{'account':{'id':_0x51b05c},'body':_0x45bfc8,'log':_0xad1c('0xb')});}; \ No newline at end of file diff --git a/server/services/email/rpc/setting.js b/server/services/email/rpc/setting.js index 3c42476..c09bc96 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 _0x8a0d=['loginMailFrequency','GetSettings','../client','Request','ShowSetting'];(function(_0x4ed9d9,_0x26ab89){var _0x3d681a=function(_0x10f853){while(--_0x10f853){_0x4ed9d9['push'](_0x4ed9d9['shift']());}};_0x3d681a(++_0x26ab89);}(_0x8a0d,0x11f));var _0xd8a0=function(_0x13670f,_0x57fcba){_0x13670f=_0x13670f-0x0;var _0x2deca7=_0x8a0d[_0x13670f];return _0x2deca7;};'use strict';var client=require(_0xd8a0('0x0'));exports['getSettings']=function(){return client[_0xd8a0('0x1')](_0xd8a0('0x2'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0xd8a0('0x3')]},'log':_0xd8a0('0x4')});}; \ No newline at end of file +var _0xdbdf=['getSettings','ShowSetting','loginMailFrequency','GetSettings','../client'];(function(_0xc4a180,_0x4c217f){var _0x2049a2=function(_0x62e559){while(--_0x62e559){_0xc4a180['push'](_0xc4a180['shift']());}};_0x2049a2(++_0x4c217f);}(_0xdbdf,0x9f));var _0xfdbd=function(_0x311d3b,_0x2ac1d8){_0x311d3b=_0x311d3b-0x0;var _0x56e801=_0xdbdf[_0x311d3b];return _0x56e801;};'use strict';var client=require(_0xfdbd('0x0'));exports[_0xfdbd('0x1')]=function(){return client['Request'](_0xfdbd('0x2'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0xfdbd('0x3')]},'log':_0xfdbd('0x4')});}; \ No newline at end of file diff --git a/server/services/email/server/index.js b/server/services/email/server/index.js index 86d6be0..0a92f5c 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(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xa9e0,0x123));var _0x0a9e=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0xa9e0[_0xbca1b1];return _0x4e1686;};'use strict';var jayson=require(_0x0a9e('0x0'));var BPromise=require(_0x0a9e('0x1'));var _=require(_0x0a9e('0x2'));var logger=require('../../../config/logger')('email');exports[_0x0a9e('0x3')]=function(_0x4ce2f1,_0x333808){return new BPromise(function(_0x432180,_0x2ab90b){var _0x991246={'SendMail':function(_0x981158){var _0x57b080=this;return new Promise(function(_0x219af0,_0x441e3a){_0x333808[_0x0a9e('0x4')](_0x981158['account'],_0x981158['message'])[_0x0a9e('0x5')](function(_0x56465b){_0x219af0({'code':0xc8,'message':_0x56465b});})['catch'](function(_0x39753a){_0x441e3a(_0x57b080[_0x0a9e('0x6')](0x1f4,_0x39753a));});});},'VerifySmtp':function(_0x307b3e){var _0x3ab53f=this;return new Promise(function(_0xfeb75b,_0xbd1168){_0x333808['verifySmtp'](_0x307b3e['account'])['then'](function(_0x4cfe67){_0xfeb75b({'code':0xc8,'message':_0x0a9e('0x7')});})[_0x0a9e('0x8')](function(_0xd5b662){_0xbd1168(_0x3ab53f[_0x0a9e('0x6')](0x1f4,_0xd5b662));});});},'MailAccounts':function(_0x32d742){return new Promise(function(_0x69aeb7,_0x5db4b0){var _0x4283ce=_[_0x0a9e('0x9')](_0x4ce2f1[_0x0a9e('0xa')]);for(var _0x281129=0x0;_0x281129<_0x4283ce[_0x0a9e('0xb')];_0x281129+=0x1){if(_0x4283ce[_0x281129][_0x0a9e('0xc')]&&_0x4283ce[_0x281129]['Imap'][_0x0a9e('0xd')]){delete _0x4283ce[_0x281129]['Imap'][_0x0a9e('0xd')];}if(_0x4283ce[_0x281129]['Smtp']&&_0x4283ce[_0x281129][_0x0a9e('0xe')][_0x0a9e('0xf')]){delete _0x4283ce[_0x281129]['Smtp'][_0x0a9e('0xf')];}}_0x69aeb7({'count':_0x4283ce['length'],'rows':_0x4283ce});});}};var _0x459eb1=jayson[_0x0a9e('0x10')](_0x991246)[_0x0a9e('0x11')]();_0x459eb1['on'](_0x0a9e('0x6'),function(_0x31b1ca){logger[_0x0a9e('0x6')](JSON[_0x0a9e('0x12')](_0x31b1ca));return _0x2ab90b(_0x31b1ca);});_0x459eb1[_0x0a9e('0x3')](0x232b,_0x0a9e('0x13'),function(){console[_0x0a9e('0x14')](_0x0a9e('0x15'),0x232b);return _0x432180(_0x0a9e('0x16')+0x232b);});});}; \ No newline at end of file +var _0xa9e0=['catch','values','mailAccounts','length','Imap','password','Smtp','pass','server','http','stringify','127.0.0.1','log','Email\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','jayson/promise','bluebird','lodash','listen','sendMail','then','error','Verified'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x433a86,_0x175b5c){_0x433a86=_0x433a86-0x0;var _0x23000c=_0xa9e0[_0x433a86];return _0x23000c;};'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 f1de9fb..25a6f06 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 _0xfca6=['listen','port','socket.io','websocket','defaults','redis','localhost','adapter','../../config/triggers','default','../../config/socketio','../../config/express','../../routes','once','listening','log','Express\x20server\x20listening\x20on\x20port\x20%d!','exports','lodash','http','sticky-session','../../config/environment'];(function(_0x4b7b62,_0x4920a9){var _0x2280df=function(_0x21e1f8){while(--_0x21e1f8){_0x4b7b62['push'](_0x4b7b62['shift']());}};_0x2280df(++_0x4920a9);}(_0xfca6,0x80));var _0x6fca=function(_0xb199dc,_0xdffcbe){_0xb199dc=_0xb199dc-0x0;var _0x2dfb55=_0xfca6[_0xb199dc];return _0x2dfb55;};'use strict';var _=require(_0x6fca('0x0'));var http=require(_0x6fca('0x1'));var express=require('express');var sticky=require(_0x6fca('0x2'));var Redis=require('ioredis');var config=require(_0x6fca('0x3'));var app=express();var server=http['createServer'](app);server['timeout']=0xdbba0;if(sticky[_0x6fca('0x4')](server,config[_0x6fca('0x5')])){var socketio=require(_0x6fca('0x6'))(server,{'transports':[_0x6fca('0x7'),'polling']});config['redis']=_[_0x6fca('0x8')](config[_0x6fca('0x9')],{'host':_0x6fca('0xa'),'port':0x18eb});socketio[_0x6fca('0xb')](require('socket.io-redis')({'pubClient':new Redis(config['redis']),'subClient':new Redis(config[_0x6fca('0x9')])}));require(_0x6fca('0xc'))[_0x6fca('0xd')]();require(_0x6fca('0xe'))['default'](socketio);require(_0x6fca('0xf'))[_0x6fca('0xd')](app);require(_0x6fca('0x10'))[_0x6fca('0xd')](app);}else{server[_0x6fca('0x11')](_0x6fca('0x12'),function(){console[_0x6fca('0x13')](_0x6fca('0x14'),config[_0x6fca('0x5')]);});}exports=module[_0x6fca('0x15')]=app; \ No newline at end of file +var _0x285e=['adapter','socket.io-redis','default','../../config/socketio','../../config/express','once','listening','Express\x20server\x20listening\x20on\x20port\x20%d!','lodash','http','express','ioredis','createServer','timeout','listen','port','socket.io','websocket','redis','defaults','localhost'];(function(_0x4a325a,_0x2c154c){var _0x2597a1=function(_0x437af3){while(--_0x437af3){_0x4a325a['push'](_0x4a325a['shift']());}};_0x2597a1(++_0x2c154c);}(_0x285e,0x119));var _0xe285=function(_0x59d89e,_0x55edf5){_0x59d89e=_0x59d89e-0x0;var _0x554e93=_0x285e[_0x59d89e];return _0x554e93;};'use strict';var _=require(_0xe285('0x0'));var http=require(_0xe285('0x1'));var express=require(_0xe285('0x2'));var sticky=require('sticky-session');var Redis=require(_0xe285('0x3'));var config=require('../../config/environment');var app=express();var server=http[_0xe285('0x4')](app);server[_0xe285('0x5')]=0xdbba0;if(sticky[_0xe285('0x6')](server,config[_0xe285('0x7')])){var socketio=require(_0xe285('0x8'))(server,{'transports':[_0xe285('0x9'),'polling']});config[_0xe285('0xa')]=_[_0xe285('0xb')](config[_0xe285('0xa')],{'host':_0xe285('0xc'),'port':0x18eb});socketio[_0xe285('0xd')](require(_0xe285('0xe'))({'pubClient':new Redis(config[_0xe285('0xa')]),'subClient':new Redis(config['redis'])}));require('../../config/triggers')[_0xe285('0xf')]();require(_0xe285('0x10'))[_0xe285('0xf')](socketio);require(_0xe285('0x11'))['default'](app);require('../../routes')[_0xe285('0xf')](app);}else{server[_0xe285('0x12')](_0xe285('0x13'),function(){console['log'](_0xe285('0x14'),config[_0xe285('0x7')]);});}exports=module['exports']=app; \ No newline at end of file diff --git a/server/services/routing/client.js b/server/services/routing/client.js index 496683f..2e2d01d 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 _0xc096=['../../config/logger','routing','client','Request','then','debug','error','rpc','message','catch','exports','jayson/promise','bluebird'];(function(_0x18fb16,_0x45edbc){var _0x147b0d=function(_0x5b1b00){while(--_0x5b1b00){_0x18fb16['push'](_0x18fb16['shift']());}};_0x147b0d(++_0x45edbc);}(_0xc096,0x9a));var _0x6c09=function(_0xb1cf84,_0x813740){_0xb1cf84=_0xb1cf84-0x0;var _0x4bad2e=_0xc096[_0xb1cf84];return _0x4bad2e;};'use strict';var jayson=require(_0x6c09('0x0'));var BPromise=require(_0x6c09('0x1'));var logger=require(_0x6c09('0x2'))(_0x6c09('0x3'));var client=jayson[_0x6c09('0x4')]['http']({'port':0x2329});client[_0x6c09('0x5')]=function(_0x1fb80d,_0x132ebf){return new BPromise(function(_0x33230c,_0x5a623d){return client['request'](_0x1fb80d,_0x132ebf)[_0x6c09('0x6')](function(_0x14ad3a){logger[_0x6c09('0x7')]('rpc',_0x6c09('0x3'),_0x1fb80d,_0x132ebf,_0x14ad3a);if(_0x14ad3a[_0x6c09('0x8')]){logger[_0x6c09('0x8')](_0x6c09('0x9'),_0x6c09('0x3'),_0x1fb80d,_0x14ad3a[_0x6c09('0x8')][_0x6c09('0xa')],_0x132ebf);return _0x5a623d(_0x14ad3a[_0x6c09('0x8')][_0x6c09('0xa')]);}else{return _0x33230c(_0x14ad3a['result']);}})[_0x6c09('0xb')](function(_0x4d9abc){logger[_0x6c09('0x8')](_0x6c09('0x9'),_0x6c09('0x3'),_0x1fb80d,_0x4d9abc,_0x132ebf);return _0x5a623d(_0x4d9abc);});});};module[_0x6c09('0xc')]=client; \ No newline at end of file +var _0x1917=['rpc','error','message','result','catch','exports','jayson/promise','bluebird','../../config/logger','routing','http','Request','debug'];(function(_0x22f8ab,_0x15d8ff){var _0x2a70e5=function(_0x5e6895){while(--_0x5e6895){_0x22f8ab['push'](_0x22f8ab['shift']());}};_0x2a70e5(++_0x15d8ff);}(_0x1917,0xaf));var _0x7191=function(_0xe6aa87,_0x2bc577){_0xe6aa87=_0xe6aa87-0x0;var _0x1997e8=_0x1917[_0xe6aa87];return _0x1997e8;};'use strict';var jayson=require(_0x7191('0x0'));var BPromise=require(_0x7191('0x1'));var logger=require(_0x7191('0x2'))(_0x7191('0x3'));var client=jayson['client'][_0x7191('0x4')]({'port':0x2329});client[_0x7191('0x5')]=function(_0x3b76d6,_0x514b3c){return new BPromise(function(_0x2888be,_0x614f86){return client['request'](_0x3b76d6,_0x514b3c)['then'](function(_0x4475e3){logger[_0x7191('0x6')]('rpc',_0x7191('0x3'),_0x3b76d6,_0x514b3c,_0x4475e3);if(_0x4475e3['error']){logger['error'](_0x7191('0x7'),_0x7191('0x3'),_0x3b76d6,_0x4475e3[_0x7191('0x8')]['message'],_0x514b3c);return _0x614f86(_0x4475e3['error'][_0x7191('0x9')]);}else{return _0x2888be(_0x4475e3[_0x7191('0xa')]);}})[_0x7191('0xb')](function(_0x1a205c){logger['error'](_0x7191('0x7'),_0x7191('0x3'),_0x3b76d6,_0x1a205c,_0x514b3c);return _0x614f86(_0x1a205c);});});};module[_0x7191('0xc')]=client; \ No newline at end of file diff --git a/server/services/routing/index.js b/server/services/routing/index.js index 2aefc56..dee43cf 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 _0xc0fb=['./rpc/whatsappQueue','resolve','getAgents','then','initAgents','initIntervals','getOpenchannelQueues','initOpenchannelQueues','getChatQueues','initChatQueues','getSmsQueues','getMailQueues','getWhatsappQueues','initWhatsappQueues','catch','log','bluebird','./server','./realtime','./rpc/interval','./rpc/openchannelQueue','./rpc/chatQueue','./rpc/smsQueue','./rpc/mailQueue','./rpc/faxQueue'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xc0fb,0x13c));var _0xbc0f=function(_0x16ea30,_0x21262b){_0x16ea30=_0x16ea30-0x0;var _0x163cc3=_0xc0fb[_0x16ea30];return _0x163cc3;};'use strict';var BPromise=require(_0xbc0f('0x0'));var server=require(_0xbc0f('0x1'));var Realtime=require(_0xbc0f('0x2'));var user=require('./rpc/user');var interval=require(_0xbc0f('0x3'));var openchannelQueue=require(_0xbc0f('0x4'));var chatQueue=require(_0xbc0f('0x5'));var smsQueue=require(_0xbc0f('0x6'));var mailQueue=require(_0xbc0f('0x7'));var faxQueue=require(_0xbc0f('0x8'));var whatsappQueue=require(_0xbc0f('0x9'));var realtime=new Realtime();function initRealtime(){return BPromise[_0xbc0f('0xa')]()['then'](user[_0xbc0f('0xb')]())[_0xbc0f('0xc')](realtime[_0xbc0f('0xd')]())[_0xbc0f('0xc')](interval['getIntervals']())['then'](realtime[_0xbc0f('0xe')]())[_0xbc0f('0xc')](openchannelQueue[_0xbc0f('0xf')]())['then'](realtime[_0xbc0f('0x10')]())[_0xbc0f('0xc')](chatQueue[_0xbc0f('0x11')]())['then'](realtime[_0xbc0f('0x12')]())[_0xbc0f('0xc')](smsQueue[_0xbc0f('0x13')]())[_0xbc0f('0xc')](realtime['initSmsQueues']())['then'](mailQueue[_0xbc0f('0x14')]())[_0xbc0f('0xc')](realtime['initMailQueues']())[_0xbc0f('0xc')](faxQueue['getFaxQueues']())[_0xbc0f('0xc')](realtime['initFaxQueues']())[_0xbc0f('0xc')](whatsappQueue[_0xbc0f('0x15')]())['then'](realtime[_0xbc0f('0x16')]())[_0xbc0f('0xc')](function(){return realtime;});}function main(){return server['listen'](realtime)[_0xbc0f('0xc')](function(_0xcafbbc){return initRealtime();})[_0xbc0f('0xc')](function(_0x4f3b31){return setInterval(initRealtime,0x1388);})[_0xbc0f('0x17')](function(_0x8c53bd){console[_0xbc0f('0x18')](_0x8c53bd);});}main(); \ No newline at end of file +var _0x0f7a=['getAgents','initAgents','getOpenchannelQueues','initOpenchannelQueues','initChatQueues','getSmsQueues','initSmsQueues','getMailQueues','initMailQueues','getFaxQueues','initFaxQueues','getWhatsappQueues','initWhatsappQueues','catch','log','bluebird','./server','./rpc/user','./rpc/interval','./rpc/chatQueue','./rpc/smsQueue','./rpc/mailQueue','./rpc/faxQueue','resolve','then'];(function(_0x101373,_0x2ff37a){var _0x3b4550=function(_0x326e9f){while(--_0x326e9f){_0x101373['push'](_0x101373['shift']());}};_0x3b4550(++_0x2ff37a);}(_0x0f7a,0x109));var _0xa0f7=function(_0x9ed916,_0x559a29){_0x9ed916=_0x9ed916-0x0;var _0x57b7a5=_0x0f7a[_0x9ed916];return _0x57b7a5;};'use strict';var BPromise=require(_0xa0f7('0x0'));var server=require(_0xa0f7('0x1'));var Realtime=require('./realtime');var user=require(_0xa0f7('0x2'));var interval=require(_0xa0f7('0x3'));var openchannelQueue=require('./rpc/openchannelQueue');var chatQueue=require(_0xa0f7('0x4'));var smsQueue=require(_0xa0f7('0x5'));var mailQueue=require(_0xa0f7('0x6'));var faxQueue=require(_0xa0f7('0x7'));var whatsappQueue=require('./rpc/whatsappQueue');var realtime=new Realtime();function initRealtime(){return BPromise[_0xa0f7('0x8')]()[_0xa0f7('0x9')](user[_0xa0f7('0xa')]())[_0xa0f7('0x9')](realtime[_0xa0f7('0xb')]())[_0xa0f7('0x9')](interval['getIntervals']())[_0xa0f7('0x9')](realtime['initIntervals']())[_0xa0f7('0x9')](openchannelQueue[_0xa0f7('0xc')]())['then'](realtime[_0xa0f7('0xd')]())['then'](chatQueue['getChatQueues']())[_0xa0f7('0x9')](realtime[_0xa0f7('0xe')]())[_0xa0f7('0x9')](smsQueue[_0xa0f7('0xf')]())[_0xa0f7('0x9')](realtime[_0xa0f7('0x10')]())[_0xa0f7('0x9')](mailQueue[_0xa0f7('0x11')]())[_0xa0f7('0x9')](realtime[_0xa0f7('0x12')]())[_0xa0f7('0x9')](faxQueue[_0xa0f7('0x13')]())['then'](realtime[_0xa0f7('0x14')]())[_0xa0f7('0x9')](whatsappQueue[_0xa0f7('0x15')]())[_0xa0f7('0x9')](realtime[_0xa0f7('0x16')]())[_0xa0f7('0x9')](function(){return realtime;});}function main(){return server['listen'](realtime)[_0xa0f7('0x9')](function(_0x3b63b5){return initRealtime();})[_0xa0f7('0x9')](function(_0x26fd49){return setInterval(initRealtime,0x1388);})[_0xa0f7('0x17')](function(_0x108e63){console[_0xa0f7('0x18')](_0x108e63);});}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 985bc5f..c57e403 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(_0x4e4bd1,_0x5be909){var _0x61faa=function(_0xa179fd){while(--_0xa179fd){_0x4e4bd1['push'](_0x4e4bd1['shift']());}};_0x61faa(++_0x5be909);}(_0xe14b,0x93));var _0xbe14=function(_0x22c70d,_0x2c96f8){_0x22c70d=_0x22c70d-0x0;var _0x16f6b0=_0xe14b[_0x22c70d];return _0x16f6b0;};'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 _0x7a54=['turn','prioritize','priority','toJSON','map','toString','fromJSON','isString','object','exports','lodash','util','events','isNil','register','ignoreFactChanges','inherits','init','rules','activeRules','concat','prototype','sync','filter','orderBy','asc','execute','clone','consequence','ruleRef','name','index_','nextTick','push','call','isEqual','restart','length','condition','matchPath','noop','findRules'];(function(_0x2821c8,_0x568150){var _0x226df6=function(_0x1d2023){while(--_0x1d2023){_0x2821c8['push'](_0x2821c8['shift']());}};_0x226df6(++_0x568150);}(_0x7a54,0x106));var _0x47a5=function(_0x1b271f,_0x223fcd){_0x1b271f=_0x1b271f-0x0;var _0x3833f3=_0x7a54[_0x1b271f];return _0x3833f3;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var EventEmitter=require(_0x47a5('0x2'))['EventEmitter'];function RuleEngine(_0x1d33e,_0x4086cd){this['init']();if(!_[_0x47a5('0x3')](_0x1d33e)){this[_0x47a5('0x4')](_0x1d33e);}if(_0x4086cd){this[_0x47a5('0x5')]=_0x4086cd[_0x47a5('0x5')];}return this;}util[_0x47a5('0x6')](RuleEngine,EventEmitter);RuleEngine['prototype'][_0x47a5('0x7')]=function(_0x59199c){this[_0x47a5('0x8')]=[];this[_0x47a5('0x9')]=[];};RuleEngine['prototype'][_0x47a5('0x4')]=function(_0x5077f3){if(Array['isArray'](_0x5077f3)){this['rules']=this[_0x47a5('0x8')][_0x47a5('0xa')](_0x5077f3);}else if(_0x5077f3!==null&&_['isObject'](_0x5077f3)){this[_0x47a5('0x8')]['push'](_0x5077f3);}this['sync']();};RuleEngine[_0x47a5('0xb')][_0x47a5('0xc')]=function(){this[_0x47a5('0x9')]=this[_0x47a5('0x8')][_0x47a5('0xd')](function(_0xd308b8){if(_[_0x47a5('0x3')](_0xd308b8['on'])){_0xd308b8['on']=!![];}if(_0xd308b8['on']===!![]){return _0xd308b8;}});this['activeRules']=_[_0x47a5('0xe')](this[_0x47a5('0x9')],['p'],[_0x47a5('0xf')]);};RuleEngine[_0x47a5('0xb')][_0x47a5('0x10')]=function(_0x620ee9,_0x3c6c46){var _0x190faa=![];_0x620ee9['result']=!![];var _0x362359=_[_0x47a5('0x11')](_0x620ee9);var _0x3b001e=_[_0x47a5('0x11')](_0x620ee9);var _0x1ef44c=this['activeRules'];var _0x549de3=[];var _0x138bc0=this['ignoreFactChanges'];(function FnRuleLoop(_0x5247fd){var _0x423a81={'rules':function(){return _0x1ef44c;},'rule':function(){return _0x1ef44c[_0x5247fd];},'when':function(_0xaf70a6){if(_0xaf70a6){var _0x2ce454=_0x1ef44c[_0x5247fd][_0x47a5('0x12')];_0x2ce454[_0x47a5('0x13')]=_0x1ef44c[_0x5247fd]['id']||_0x1ef44c[_0x5247fd][_0x47a5('0x14')]||_0x47a5('0x15')+_0x5247fd;process[_0x47a5('0x16')](function(){_0x549de3[_0x47a5('0x17')](_0x2ce454['ruleRef']);_0x2ce454[_0x47a5('0x18')](_0x362359,_0x423a81);});}else{process[_0x47a5('0x16')](function(){_0x423a81['next']();});}},'restart':function(){return FnRuleLoop(0x0);},'stop':function(){_0x190faa=!![];return FnRuleLoop(0x0);},'next':function(_0x2b0360){if(!_0x138bc0&&!_[_0x47a5('0x19')](_0x3b001e,_0x362359)){_0x3b001e=_[_0x47a5('0x11')](_0x362359);process['nextTick'](function(){_0x423a81[_0x47a5('0x1a')]();});}else{process[_0x47a5('0x16')](function(){if(_[_0x47a5('0x3')](_0x2b0360)){return FnRuleLoop(_0x5247fd+0x1);}else{return FnRuleLoop(_0x2b0360);}});}}};if(_0x5247fd<_0x1ef44c[_0x47a5('0x1b')]&&_0x190faa===![]){var _0x5ef1b1=_0x1ef44c[_0x5247fd][_0x47a5('0x1c')];_0x5ef1b1[_0x47a5('0x18')](_0x362359,_0x423a81);}else{process['nextTick'](function(){_0x362359[_0x47a5('0x1d')]=_0x549de3;return _0x3c6c46?_0x3c6c46(_0x362359):_[_0x47a5('0x1e')]();});}}(0x0));};RuleEngine[_0x47a5('0xb')][_0x47a5('0x1f')]=function(_0x3abd6a){if(_['isNil'](_0x3abd6a)){return this['rules'];}else{var _0x136745=_['matches'](_0x3abd6a);return _[_0x47a5('0xd')](this['rules'],_0x136745);}};RuleEngine[_0x47a5('0xb')][_0x47a5('0x20')]=function(_0x36ad34,_0x1dac65){var _0x21f296=_0x36ad34==='on'||_0x36ad34==='ON'?!![]:![];var _0x3ba0b7=this[_0x47a5('0x1f')](_0x1dac65);for(var _0x136b14=0x0,_0x16631f=_0x3ba0b7[_0x47a5('0x1b')];_0x136b14<_0x16631f;_0x136b14+=0x1){_0x3ba0b7[_0x136b14]['on']=_0x21f296;}this[_0x47a5('0xc')]();};RuleEngine[_0x47a5('0xb')][_0x47a5('0x21')]=function(_0x528582,_0x243210){_0x528582=parseInt(_0x528582,0xa);var _0x51833b=this[_0x47a5('0x1f')](_0x243210);for(var _0x9ac908=0x0,_0x16901f=_0x51833b['length'];_0x9ac908<_0x16901f;_0x9ac908+=0x1){_0x51833b[_0x9ac908][_0x47a5('0x22')]=_0x528582;}this[_0x47a5('0xc')]();};RuleEngine[_0x47a5('0xb')][_0x47a5('0x23')]=function(){var _0x51cc81=this['rules'];if(_0x51cc81 instanceof Array){_0x51cc81=_0x51cc81[_0x47a5('0x24')](function(_0xfb5ddb){_0xfb5ddb['condition']=_0xfb5ddb['condition'][_0x47a5('0x25')]();_0xfb5ddb[_0x47a5('0x12')]=_0xfb5ddb['consequence'][_0x47a5('0x25')]();return _0xfb5ddb;});}else if(!_['isNil'](_0x51cc81)){_0x51cc81[_0x47a5('0x1c')]=_0x51cc81[_0x47a5('0x1c')]['toString']();_0x51cc81['consequence']=_0x51cc81[_0x47a5('0x12')]['toString']();}return _0x51cc81;};RuleEngine[_0x47a5('0xb')][_0x47a5('0x26')]=function(_0xf269a8){this['init']();if(_[_0x47a5('0x27')](_0xf269a8)){_0xf269a8=JSON['parse'](_0xf269a8);}if(_0xf269a8 instanceof Array){_0xf269a8=_0xf269a8['map'](function(_0x65542e){_0x65542e['condition']=eval('('+_0x65542e[_0x47a5('0x1c')]+')');_0x65542e['consequence']=eval('('+_0x65542e[_0x47a5('0x12')]+')');return _0x65542e;});}else if(_0xf269a8!==null&&typeof _0xf269a8==_0x47a5('0x28')){_0xf269a8[_0x47a5('0x1c')]=eval('('+_0xf269a8[_0x47a5('0x1c')]+')');_0xf269a8[_0x47a5('0x12')]=eval('('+_0xf269a8[_0x47a5('0x12')]+')');}this[_0x47a5('0x4')](_0xf269a8);};module[_0x47a5('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 d373c05..d7a1cdb 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 _0x9cc9=['message','result','catch','sendMailMessage','SendMail','jayson/promise','http','request','then','error'];(function(_0x1547bb,_0x3c12cc){var _0x551458=function(_0xb3b309){while(--_0xb3b309){_0x1547bb['push'](_0x1547bb['shift']());}};_0x551458(++_0x3c12cc);}(_0x9cc9,0x131));var _0x99cc=function(_0x146367,_0x20baf8){_0x146367=_0x146367-0x0;var _0x1edd25=_0x9cc9[_0x146367];return _0x1edd25;};'use strict';var BPromise=require('bluebird');var jayson=require(_0x99cc('0x0'));var client=jayson['client'][_0x99cc('0x1')]({'port':0x232b});function request(_0xb7fbd4,_0x501c51){return new BPromise(function(_0x50ae36,_0x3ee208){return client[_0x99cc('0x2')](_0xb7fbd4,_0x501c51)[_0x99cc('0x3')](function(_0x57bb3f){if(_0x57bb3f[_0x99cc('0x4')]){return _0x3ee208(_0x57bb3f[_0x99cc('0x4')][_0x99cc('0x5')]);}else{return _0x50ae36(_0x57bb3f[_0x99cc('0x6')]);}})[_0x99cc('0x7')](function(_0x5c3760){return _0x3ee208(_0x5c3760);});});}exports[_0x99cc('0x8')]=function(_0x4d240b,_0x93132e){return request(_0x99cc('0x9'),{'account':_0x4d240b,'message':_0x93132e});}; \ No newline at end of file +var _0x4e4a=['SendMail','client','request','then','error','result','sendMailMessage'];(function(_0x3337eb,_0x2bdc39){var _0x22e3f0=function(_0x4d2d19){while(--_0x4d2d19){_0x3337eb['push'](_0x3337eb['shift']());}};_0x22e3f0(++_0x2bdc39);}(_0x4e4a,0x158));var _0xa4e4=function(_0x42701a,_0x5abb61){_0x42701a=_0x42701a-0x0;var _0x292676=_0x4e4a[_0x42701a];return _0x292676;};'use strict';var BPromise=require('bluebird');var jayson=require('jayson/promise');var client=jayson[_0xa4e4('0x0')]['http']({'port':0x232b});function request(_0x5948c2,_0xb169c5){return new BPromise(function(_0x1680ed,_0x3cc9e0){return client[_0xa4e4('0x1')](_0x5948c2,_0xb169c5)[_0xa4e4('0x2')](function(_0x35ddeb){if(_0x35ddeb[_0xa4e4('0x3')]){return _0x3cc9e0(_0x35ddeb[_0xa4e4('0x3')]['message']);}else{return _0x1680ed(_0x35ddeb[_0xa4e4('0x4')]);}})['catch'](function(_0x7c31d6){return _0x3cc9e0(_0x7c31d6);});});}exports[_0xa4e4('0x5')]=function(_0x449d3a,_0x342db0){return request(_0xa4e4('0x6'),{'account':_0x449d3a,'message':_0x342db0});}; \ No newline at end of file diff --git a/server/services/routing/model/agent.js b/server/services/routing/model/agent.js index 000113a..5764f1b 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 _0x3acd=['online','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','chatStatus','unknown','chatStatusTime','chatCapacity','chatCurrentCapacity','mailCapacity','faxStatus','faxStatusTime','faxCapacity','faxCurrentCapacity','smsStatus','smsStatusTime','smsCapacity','smsCurrentCapacity','whatsappCurrentCapacity','openchannelStatus','openchannelStatusTime','openchannelCapacity','openchannelCurrentCapacity','busy','busyQueue','prototype','getChannelStatus','Capacity','CurrentCapacity','maxcapacity','updateRealtime','chat','fax','sms','whatsapp','length','Status','format','mailStatus','mailStatusTime','whatsappStatus','whatsappStatusTime','emit','user:save','exports','lodash','moment','md5','ioredis','redis','defaults','localhost','socket.io-emitter','name'];(function(_0xb2c841,_0x5ccf11){var _0x1dd8f3=function(_0x205536){while(--_0x205536){_0xb2c841['push'](_0xb2c841['shift']());}};_0x1dd8f3(++_0x5ccf11);}(_0x3acd,0x69));var _0xd3ac=function(_0x71c964,_0x196b27){_0x71c964=_0x71c964-0x0;var _0x450c33=_0x3acd[_0x71c964];return _0x450c33;};'use strict';var _=require(_0xd3ac('0x0'));var moment=require(_0xd3ac('0x1'));var md5=require(_0xd3ac('0x2'));var Redis=require(_0xd3ac('0x3'));var config=require('../../../config/environment');config[_0xd3ac('0x4')]=_[_0xd3ac('0x5')](config[_0xd3ac('0x4')],{'host':_0xd3ac('0x6'),'port':0x18eb});var io=require(_0xd3ac('0x7'))(new Redis(config[_0xd3ac('0x4')]));function Agent(_0x29895b){this['id']=_0x29895b['id']||0x0;this[_0xd3ac('0x8')]=_0x29895b['name']||'';this[_0xd3ac('0x9')]=_0x29895b['online']||!![];this[_0xd3ac('0xa')]=_0x29895b[_0xd3ac('0xa')]||![];this[_0xd3ac('0xb')]=_0x29895b['chatPause']||![];this['mailPause']=_0x29895b[_0xd3ac('0xc')]||![];this[_0xd3ac('0xd')]=_0x29895b[_0xd3ac('0xd')]||![];this[_0xd3ac('0xe')]=_0x29895b['smsPause']||![];this[_0xd3ac('0xf')]=_0x29895b[_0xd3ac('0xf')]||![];this[_0xd3ac('0x10')]=_0xd3ac('0x11');this[_0xd3ac('0x12')]=0x0;this[_0xd3ac('0x13')]=_0x29895b[_0xd3ac('0x13')]||0x0;this[_0xd3ac('0x14')]=0x0;this['mailStatus']='unknown';this['mailStatusTime']=0x0;this[_0xd3ac('0x15')]=_0x29895b['mailCapacity']||0x0;this['mailCurrentCapacity']=0x0;this[_0xd3ac('0x16')]=_0xd3ac('0x11');this[_0xd3ac('0x17')]=0x0;this[_0xd3ac('0x18')]=_0x29895b[_0xd3ac('0x18')]||0x0;this[_0xd3ac('0x19')]=0x0;this[_0xd3ac('0x1a')]=_0xd3ac('0x11');this[_0xd3ac('0x1b')]=0x0;this[_0xd3ac('0x1c')]=_0x29895b[_0xd3ac('0x1c')]||0x0;this[_0xd3ac('0x1d')]=0x0;this['whatsappStatus']=_0xd3ac('0x11');this['whatsappStatusTime']=0x0;this['whatsappCapacity']=_0x29895b['whatsappCapacity']||0x0;this[_0xd3ac('0x1e')]=0x0;this[_0xd3ac('0x1f')]='unknown';this[_0xd3ac('0x20')]=0x0;this[_0xd3ac('0x21')]=_0x29895b[_0xd3ac('0x21')]||0x0;this[_0xd3ac('0x22')]=0x0;this[_0xd3ac('0x23')]=![];this[_0xd3ac('0x24')]=undefined;this[_0xd3ac('0x2')]='';this['updateRealtime']();}Agent[_0xd3ac('0x25')][_0xd3ac('0x26')]=function(_0x4a81cc){if(this[_0x4a81cc+'CurrentCapacity']>0x0){if(this[_0x4a81cc+_0xd3ac('0x27')]>0x0&&this[_0x4a81cc+_0xd3ac('0x28')]>=this[_0x4a81cc+_0xd3ac('0x27')]){return _0xd3ac('0x29');}else{return'working';}}else{return'idle';}};Agent[_0xd3ac('0x25')][_0xd3ac('0x2a')]=function(){var _0x371ed5=['mail',_0xd3ac('0x2b'),'openchannel',_0xd3ac('0x2c'),_0xd3ac('0x2d'),_0xd3ac('0x2e')];for(var _0x62ec1b=0x0;_0x62ec1b<_0x371ed5[_0xd3ac('0x2f')];_0x62ec1b+=0x1){var _0x19f2a0=this[_0xd3ac('0x26')](_0x371ed5[_0x62ec1b]);if(this[_0x371ed5[_0x62ec1b]+_0xd3ac('0x30')]!==_0x19f2a0){this[_0x371ed5[_0x62ec1b]+'StatusTime']=_['toNumber'](moment()[_0xd3ac('0x31')]('x'));}this[_0x371ed5[_0x62ec1b]+_0xd3ac('0x30')]=_0x19f2a0;}var _0x384600={'id':this['id'],'name':this['name'],'online':this['online'],'voicePause':this[_0xd3ac('0xa')],'chatPause':this[_0xd3ac('0xb')],'mailPause':this['mailPause'],'smsPause':this[_0xd3ac('0xe')],'faxPause':this[_0xd3ac('0xd')],'openchannelPause':this[_0xd3ac('0xf')],'chatStatus':this[_0xd3ac('0x10')],'chatStatusTime':this['chatStatusTime'],'chatCapacity':this['chatCapacity'],'chatCurrentCapacity':this[_0xd3ac('0x14')],'mailStatus':this[_0xd3ac('0x32')],'mailStatusTime':this[_0xd3ac('0x33')],'mailCapacity':this[_0xd3ac('0x15')],'mailCurrentCapacity':this['mailCurrentCapacity'],'faxStatus':this['faxStatus'],'faxStatusTime':this[_0xd3ac('0x17')],'faxCapacity':this['faxCapacity'],'faxCurrentCapacity':this['faxCurrentCapacity'],'smsStatus':this[_0xd3ac('0x1a')],'smsStatusTime':this[_0xd3ac('0x1b')],'smsCapacity':this[_0xd3ac('0x1c')],'smsCurrentCapacity':this[_0xd3ac('0x1d')],'whatsappStatus':this[_0xd3ac('0x34')],'whatsappStatusTime':this[_0xd3ac('0x35')],'whatsappCapacity':this['whatsappCapacity'],'whatsappCurrentCapacity':this[_0xd3ac('0x1e')],'openchannelStatus':this[_0xd3ac('0x1f')],'openchannelStatusTime':this[_0xd3ac('0x20')],'openchannelCapacity':this['openchannelCapacity'],'openchannelCurrentCapacity':this['openchannelCurrentCapacity'],'busy':this[_0xd3ac('0x23')],'busyQueue':this['busyQueue']};var _0x15234f=md5(JSON['stringify'](_0x384600));if(this[_0xd3ac('0x2')]!==_0x15234f){this['md5']=_0x15234f;io[_0xd3ac('0x36')](_0xd3ac('0x37'),_0x384600);}};module[_0xd3ac('0x38')]=Agent; \ No newline at end of file +var _0x21de=['mailStatusTime','mailCapacity','faxCapacity','faxCurrentCapacity','smsStatus','smsCapacity','whatsappStatus','whatsappStatusTime','whatsappCapacity','whatsappCurrentCapacity','openchannelStatus','openchannelStatusTime','openchannelCapacity','openchannelCurrentCapacity','busy','busyQueue','updateRealtime','prototype','getChannelStatus','CurrentCapacity','maxcapacity','working','idle','mail','chat','openchannel','fax','sms','whatsapp','length','Status','StatusTime','toNumber','format','faxStatusTime','smsStatusTime','smsCurrentCapacity','stringify','md5','user:save','exports','lodash','moment','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','online','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','chatStatus','chatStatusTime','chatCapacity','chatCurrentCapacity','mailStatus','unknown'];(function(_0xf0bf3f,_0x393fbc){var _0x55b329=function(_0x64ce2b){while(--_0x64ce2b){_0xf0bf3f['push'](_0xf0bf3f['shift']());}};_0x55b329(++_0x393fbc);}(_0x21de,0x68));var _0xe21d=function(_0x2480ac,_0x120b3f){_0x2480ac=_0x2480ac-0x0;var _0x175200=_0x21de[_0x2480ac];return _0x175200;};'use strict';var _=require(_0xe21d('0x0'));var moment=require(_0xe21d('0x1'));var md5=require('md5');var Redis=require(_0xe21d('0x2'));var config=require(_0xe21d('0x3'));config[_0xe21d('0x4')]=_[_0xe21d('0x5')](config[_0xe21d('0x4')],{'host':_0xe21d('0x6'),'port':0x18eb});var io=require(_0xe21d('0x7'))(new Redis(config[_0xe21d('0x4')]));function Agent(_0x2cf816){this['id']=_0x2cf816['id']||0x0;this[_0xe21d('0x8')]=_0x2cf816[_0xe21d('0x8')]||'';this[_0xe21d('0x9')]=_0x2cf816['online']||!![];this[_0xe21d('0xa')]=_0x2cf816[_0xe21d('0xa')]||![];this[_0xe21d('0xb')]=_0x2cf816[_0xe21d('0xb')]||![];this[_0xe21d('0xc')]=_0x2cf816[_0xe21d('0xc')]||![];this[_0xe21d('0xd')]=_0x2cf816[_0xe21d('0xd')]||![];this[_0xe21d('0xe')]=_0x2cf816[_0xe21d('0xe')]||![];this[_0xe21d('0xf')]=_0x2cf816['openchannelPause']||![];this[_0xe21d('0x10')]='unknown';this[_0xe21d('0x11')]=0x0;this['chatCapacity']=_0x2cf816[_0xe21d('0x12')]||0x0;this[_0xe21d('0x13')]=0x0;this[_0xe21d('0x14')]=_0xe21d('0x15');this[_0xe21d('0x16')]=0x0;this[_0xe21d('0x17')]=_0x2cf816['mailCapacity']||0x0;this['mailCurrentCapacity']=0x0;this['faxStatus']=_0xe21d('0x15');this['faxStatusTime']=0x0;this[_0xe21d('0x18')]=_0x2cf816[_0xe21d('0x18')]||0x0;this[_0xe21d('0x19')]=0x0;this[_0xe21d('0x1a')]=_0xe21d('0x15');this['smsStatusTime']=0x0;this[_0xe21d('0x1b')]=_0x2cf816[_0xe21d('0x1b')]||0x0;this['smsCurrentCapacity']=0x0;this[_0xe21d('0x1c')]=_0xe21d('0x15');this[_0xe21d('0x1d')]=0x0;this[_0xe21d('0x1e')]=_0x2cf816[_0xe21d('0x1e')]||0x0;this[_0xe21d('0x1f')]=0x0;this[_0xe21d('0x20')]=_0xe21d('0x15');this[_0xe21d('0x21')]=0x0;this[_0xe21d('0x22')]=_0x2cf816[_0xe21d('0x22')]||0x0;this[_0xe21d('0x23')]=0x0;this[_0xe21d('0x24')]=![];this[_0xe21d('0x25')]=undefined;this['md5']='';this[_0xe21d('0x26')]();}Agent[_0xe21d('0x27')][_0xe21d('0x28')]=function(_0x52f940){if(this[_0x52f940+_0xe21d('0x29')]>0x0){if(this[_0x52f940+'Capacity']>0x0&&this[_0x52f940+_0xe21d('0x29')]>=this[_0x52f940+'Capacity']){return _0xe21d('0x2a');}else{return _0xe21d('0x2b');}}else{return _0xe21d('0x2c');}};Agent[_0xe21d('0x27')][_0xe21d('0x26')]=function(){var _0x16faf5=[_0xe21d('0x2d'),_0xe21d('0x2e'),_0xe21d('0x2f'),_0xe21d('0x30'),_0xe21d('0x31'),_0xe21d('0x32')];for(var _0x29c8a7=0x0;_0x29c8a7<_0x16faf5[_0xe21d('0x33')];_0x29c8a7+=0x1){var _0x28c26a=this[_0xe21d('0x28')](_0x16faf5[_0x29c8a7]);if(this[_0x16faf5[_0x29c8a7]+_0xe21d('0x34')]!==_0x28c26a){this[_0x16faf5[_0x29c8a7]+_0xe21d('0x35')]=_[_0xe21d('0x36')](moment()[_0xe21d('0x37')]('x'));}this[_0x16faf5[_0x29c8a7]+_0xe21d('0x34')]=_0x28c26a;}var _0x17654c={'id':this['id'],'name':this[_0xe21d('0x8')],'online':this[_0xe21d('0x9')],'voicePause':this[_0xe21d('0xa')],'chatPause':this[_0xe21d('0xb')],'mailPause':this['mailPause'],'smsPause':this[_0xe21d('0xe')],'faxPause':this['faxPause'],'openchannelPause':this[_0xe21d('0xf')],'chatStatus':this[_0xe21d('0x10')],'chatStatusTime':this[_0xe21d('0x11')],'chatCapacity':this[_0xe21d('0x12')],'chatCurrentCapacity':this['chatCurrentCapacity'],'mailStatus':this[_0xe21d('0x14')],'mailStatusTime':this[_0xe21d('0x16')],'mailCapacity':this['mailCapacity'],'mailCurrentCapacity':this['mailCurrentCapacity'],'faxStatus':this['faxStatus'],'faxStatusTime':this[_0xe21d('0x38')],'faxCapacity':this[_0xe21d('0x18')],'faxCurrentCapacity':this[_0xe21d('0x19')],'smsStatus':this['smsStatus'],'smsStatusTime':this[_0xe21d('0x39')],'smsCapacity':this['smsCapacity'],'smsCurrentCapacity':this[_0xe21d('0x3a')],'whatsappStatus':this[_0xe21d('0x1c')],'whatsappStatusTime':this[_0xe21d('0x1d')],'whatsappCapacity':this[_0xe21d('0x1e')],'whatsappCurrentCapacity':this[_0xe21d('0x1f')],'openchannelStatus':this[_0xe21d('0x20')],'openchannelStatusTime':this[_0xe21d('0x21')],'openchannelCapacity':this[_0xe21d('0x22')],'openchannelCurrentCapacity':this[_0xe21d('0x23')],'busy':this[_0xe21d('0x24')],'busyQueue':this[_0xe21d('0x25')]};var _0xac0723=md5(JSON[_0xe21d('0x3b')](_0x17654c));if(this[_0xe21d('0x3c')]!==_0xac0723){this[_0xe21d('0x3c')]=_0xac0723;io['emit'](_0xe21d('0x3d'),_0x17654c);}};module[_0xe21d('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 0a220b9..ccd0809 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 _0xe257=['lodash','md5','util','ioredis','../../../config/environment','redis','localhost','socket.io-emitter','name','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','prototype','_rr','loggedIn','paused','length','chatPause','available','stringify','format','chat:queue:%s','emit','chat_queue:save','exports'];(function(_0x2f191a,_0x21d3f2){var _0x25e839=function(_0x1b1f1b){while(--_0x1b1f1b){_0x2f191a['push'](_0x2f191a['shift']());}};_0x25e839(++_0x21d3f2);}(_0xe257,0x8c));var _0x7e25=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0xe257[_0x42cae2];return _0x5f256f;};'use strict';var _=require(_0x7e25('0x0'));var md5=require(_0x7e25('0x1'));var util=require(_0x7e25('0x2'));var Redis=require(_0x7e25('0x3'));var config=require(_0x7e25('0x4'));config[_0x7e25('0x5')]=_['defaults'](config[_0x7e25('0x5')],{'host':_0x7e25('0x6'),'port':0x18eb});var io=require(_0x7e25('0x7'))(new Redis(config['redis']));function ChatQueue(_0x389019){this['id']=_0x389019['id']||0x0;this[_0x7e25('0x8')]=_0x389019[_0x7e25('0x8')]||'';this['timeout']=_0x389019['timeout']||0xa;this[_0x7e25('0x9')]=_0x389019[_0x7e25('0x9')]||_0x7e25('0xa');this[_0x7e25('0xb')]=_0x389019['Agents'];this[_0x7e25('0xc')]={};this[_0x7e25('0xd')]=0x0;this[_0x7e25('0x1')]='';this[_0x7e25('0xe')]();this['updateRealtime']();}ChatQueue[_0x7e25('0xf')][_0x7e25('0xe')]=function(){var _0x2ba569=this['mapAgentsId'][_0x7e25('0x10')];this[_0x7e25('0xc')]=_['map'](this[_0x7e25('0xb')],'id');this[_0x7e25('0xc')][_0x7e25('0x10')]=_0x2ba569;};ChatQueue[_0x7e25('0xf')]['updateRealtime']=function(){this[_0x7e25('0x11')]=0x0;this[_0x7e25('0x12')]=0x0;for(var _0x1739d0=0x0;_0x1739d0=0x0?this[_0x7e25('0x15')]:0x0;var _0x36f621={'id':this['id'],'available':this[_0x7e25('0x15')],'loggedIn':this[_0x7e25('0x11')],'name':this[_0x7e25('0x8')],'paused':this[_0x7e25('0x12')],'waiting':this[_0x7e25('0xd')]};var _0x5866b9=md5(JSON[_0x7e25('0x16')](_0x36f621));if(this[_0x7e25('0x1')]!==_0x5866b9){this[_0x7e25('0x1')]=_0x5866b9;io['to'](util[_0x7e25('0x17')](_0x7e25('0x18'),_0x36f621[_0x7e25('0x8')]))[_0x7e25('0x19')](_0x7e25('0x1a'),_0x36f621);}};module[_0x7e25('0x1b')]=ChatQueue; \ No newline at end of file +var _0x8c18=['format','chat:queue:%s','emit','exports','lodash','md5','util','ioredis','../../../config/environment','defaults','redis','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','_rr','map','paused','length','online','loggedIn','chatPause','available','stringify'];(function(_0x1646fa,_0x4e5bd7){var _0x5a47a5=function(_0x2db820){while(--_0x2db820){_0x1646fa['push'](_0x1646fa['shift']());}};_0x5a47a5(++_0x4e5bd7);}(_0x8c18,0xe4));var _0x88c1=function(_0x3eee1b,_0x224318){_0x3eee1b=_0x3eee1b-0x0;var _0x18130b=_0x8c18[_0x3eee1b];return _0x18130b;};'use strict';var _=require(_0x88c1('0x0'));var md5=require(_0x88c1('0x1'));var util=require(_0x88c1('0x2'));var Redis=require(_0x88c1('0x3'));var config=require(_0x88c1('0x4'));config['redis']=_[_0x88c1('0x5')](config[_0x88c1('0x6')],{'host':_0x88c1('0x7'),'port':0x18eb});var io=require(_0x88c1('0x8'))(new Redis(config[_0x88c1('0x6')]));function ChatQueue(_0x27d8b9){this['id']=_0x27d8b9['id']||0x0;this[_0x88c1('0x9')]=_0x27d8b9[_0x88c1('0x9')]||'';this[_0x88c1('0xa')]=_0x27d8b9[_0x88c1('0xa')]||0xa;this[_0x88c1('0xb')]=_0x27d8b9[_0x88c1('0xb')]||_0x88c1('0xc');this['Agents']=_0x27d8b9[_0x88c1('0xd')];this[_0x88c1('0xe')]={};this[_0x88c1('0xf')]=0x0;this[_0x88c1('0x1')]='';this[_0x88c1('0x10')]();this[_0x88c1('0x11')]();}ChatQueue[_0x88c1('0x12')][_0x88c1('0x10')]=function(){var _0x2a6959=this[_0x88c1('0xe')][_0x88c1('0x13')];this[_0x88c1('0xe')]=_[_0x88c1('0x14')](this[_0x88c1('0xd')],'id');this[_0x88c1('0xe')][_0x88c1('0x13')]=_0x2a6959;};ChatQueue['prototype']['updateRealtime']=function(){this['loggedIn']=0x0;this[_0x88c1('0x15')]=0x0;for(var _0x1c3838=0x0;_0x1c3838=0x0?this[_0x88c1('0x1a')]:0x0;var _0x10549f={'id':this['id'],'available':this['available'],'loggedIn':this[_0x88c1('0x18')],'name':this[_0x88c1('0x9')],'paused':this[_0x88c1('0x15')],'waiting':this[_0x88c1('0xf')]};var _0x4c3b95=md5(JSON[_0x88c1('0x1b')](_0x10549f));if(this['md5']!==_0x4c3b95){this[_0x88c1('0x1')]=_0x4c3b95;io['to'](util[_0x88c1('0x1c')](_0x88c1('0x1d'),_0x10549f[_0x88c1('0x9')]))[_0x88c1('0x1e')]('chat_queue:save',_0x10549f);}};module[_0x88c1('0x1f')]=ChatQueue; \ No newline at end of file diff --git a/server/services/routing/model/faxQueue.js b/server/services/routing/model/faxQueue.js index 8a889b4..083d571 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 _0x579e=['fax_queue:save','exports','md5','util','../../../config/environment','defaults','socket.io-emitter','redis','name','timeout','strategy','Agents','mapAgentsId','waiting','updateRealtime','prototype','updateRouting','_rr','loggedIn','paused','length','online','available','stringify','format','fax:queue:%s'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x579e,0x84));var _0xe579=function(_0x552ffc,_0x58d0cb){_0x552ffc=_0x552ffc-0x0;var _0x5d145f=_0x579e[_0x552ffc];return _0x5d145f;};'use strict';var _=require('lodash');var md5=require(_0xe579('0x0'));var util=require(_0xe579('0x1'));var Redis=require('ioredis');var config=require(_0xe579('0x2'));config['redis']=_[_0xe579('0x3')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0xe579('0x4'))(new Redis(config[_0xe579('0x5')]));function FaxQueue(_0x4ce7c8){this['id']=_0x4ce7c8['id']||0x0;this['name']=_0x4ce7c8[_0xe579('0x6')]||'';this[_0xe579('0x7')]=_0x4ce7c8[_0xe579('0x7')]||0xa;this[_0xe579('0x8')]=_0x4ce7c8[_0xe579('0x8')]||'beepall';this[_0xe579('0x9')]=_0x4ce7c8[_0xe579('0x9')];this[_0xe579('0xa')]={};this[_0xe579('0xb')]=0x0;this['md5']='';this['updateRouting']();this[_0xe579('0xc')]();}FaxQueue[_0xe579('0xd')][_0xe579('0xe')]=function(){var _0x25e8a6=this[_0xe579('0xa')][_0xe579('0xf')];this['mapAgentsId']=_['map'](this[_0xe579('0x9')],'id');this[_0xe579('0xa')][_0xe579('0xf')]=_0x25e8a6;};FaxQueue['prototype'][_0xe579('0xc')]=function(){this[_0xe579('0x10')]=0x0;this[_0xe579('0x11')]=0x0;for(var _0x13d1c2=0x0;_0x13d1c2=0x0?this['available']:0x0;var _0x4fdd33={'id':this['id'],'available':this[_0xe579('0x14')],'loggedIn':this[_0xe579('0x10')],'name':this['name'],'paused':this[_0xe579('0x11')],'waiting':this['waiting']};var _0x74bdb9=md5(JSON[_0xe579('0x15')](_0x4fdd33));if(this[_0xe579('0x0')]!==_0x74bdb9){this[_0xe579('0x0')]=_0x74bdb9;io['to'](util[_0xe579('0x16')](_0xe579('0x17'),_0x4fdd33['name']))['emit'](_0xe579('0x18'),_0x4fdd33);}};module[_0xe579('0x19')]=FaxQueue; \ No newline at end of file +var _0xc34c=['beepall','Agents','mapAgentsId','updateRealtime','prototype','updateRouting','map','_rr','loggedIn','length','faxPause','paused','available','waiting','format','emit','lodash','md5','util','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy'];(function(_0x21a5af,_0x4a404c){var _0x2f8d3f=function(_0x365be8){while(--_0x365be8){_0x21a5af['push'](_0x21a5af['shift']());}};_0x2f8d3f(++_0x4a404c);}(_0xc34c,0x10c));var _0xcc34=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0xc34c[_0x40a045];return _0x1a687c;};'use strict';var _=require(_0xcc34('0x0'));var md5=require(_0xcc34('0x1'));var util=require(_0xcc34('0x2'));var Redis=require(_0xcc34('0x3'));var config=require(_0xcc34('0x4'));config[_0xcc34('0x5')]=_[_0xcc34('0x6')](config[_0xcc34('0x5')],{'host':_0xcc34('0x7'),'port':0x18eb});var io=require(_0xcc34('0x8'))(new Redis(config[_0xcc34('0x5')]));function FaxQueue(_0x66700e){this['id']=_0x66700e['id']||0x0;this['name']=_0x66700e[_0xcc34('0x9')]||'';this[_0xcc34('0xa')]=_0x66700e[_0xcc34('0xa')]||0xa;this[_0xcc34('0xb')]=_0x66700e['strategy']||_0xcc34('0xc');this['Agents']=_0x66700e[_0xcc34('0xd')];this[_0xcc34('0xe')]={};this['waiting']=0x0;this[_0xcc34('0x1')]='';this['updateRouting']();this[_0xcc34('0xf')]();}FaxQueue[_0xcc34('0x10')][_0xcc34('0x11')]=function(){var _0x1e3483=this['mapAgentsId']['_rr'];this['mapAgentsId']=_[_0xcc34('0x12')](this[_0xcc34('0xd')],'id');this[_0xcc34('0xe')][_0xcc34('0x13')]=_0x1e3483;};FaxQueue[_0xcc34('0x10')]['updateRealtime']=function(){this[_0xcc34('0x14')]=0x0;this['paused']=0x0;for(var _0x330d01=0x0;_0x330d01=0x0?this[_0xcc34('0x18')]:0x0;var _0x16630e={'id':this['id'],'available':this[_0xcc34('0x18')],'loggedIn':this[_0xcc34('0x14')],'name':this[_0xcc34('0x9')],'paused':this[_0xcc34('0x17')],'waiting':this[_0xcc34('0x19')]};var _0x4f36db=md5(JSON['stringify'](_0x16630e));if(this[_0xcc34('0x1')]!==_0x4f36db){this[_0xcc34('0x1')]=_0x4f36db;io['to'](util[_0xcc34('0x1a')]('fax:queue:%s',_0x16630e[_0xcc34('0x9')]))[_0xcc34('0x1b')]('fax_queue:save',_0x16630e);}};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 385ad20..93d055c 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 _0x20aa=['name','Intervals'];(function(_0x2527bc,_0x250222){var _0x3a8d81=function(_0xd7fd30){while(--_0xd7fd30){_0x2527bc['push'](_0x2527bc['shift']());}};_0x3a8d81(++_0x250222);}(_0x20aa,0x1e6));var _0xa20a=function(_0x1f1579,_0xbd7e0b){_0x1f1579=_0x1f1579-0x0;var _0x3dfffe=_0x20aa[_0x1f1579];return _0x3dfffe;};'use strict';function Interval(_0x278b95){this['id']=_0x278b95['id']||0x0;this[_0xa20a('0x0')]=_0x278b95[_0xa20a('0x0')]||'';this[_0xa20a('0x1')]=_0x278b95[_0xa20a('0x1')]||{};}module['exports']=Interval; \ No newline at end of file +var _0xc9e7=['Intervals','exports','name'];(function(_0x258b05,_0x256ef5){var _0x38f1ec=function(_0x29c4f9){while(--_0x29c4f9){_0x258b05['push'](_0x258b05['shift']());}};_0x38f1ec(++_0x256ef5);}(_0xc9e7,0x188));var _0x7c9e=function(_0xaf542e,_0x47ee6e){_0xaf542e=_0xaf542e-0x0;var _0x33e09b=_0xc9e7[_0xaf542e];return _0x33e09b;};'use strict';function Interval(_0xc1aab1){this['id']=_0xc1aab1['id']||0x0;this[_0x7c9e('0x0')]=_0xc1aab1['name']||'';this[_0x7c9e('0x1')]=_0xc1aab1[_0x7c9e('0x1')]||{};}module[_0x7c9e('0x2')]=Interval; \ No newline at end of file diff --git a/server/services/routing/model/mailQueue.js b/server/services/routing/model/mailQueue.js index b42e26c..0cf0d67 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 _0x0661=['md5','ioredis','../../../config/environment','defaults','redis','localhost','socket.io-emitter','name','timeout','strategy','Agents','mapAgentsId','waiting','updateRouting','prototype','_rr','loggedIn','paused','length','online','mailPause','available','stringify','mail:queue:%s','emit','lodash'];(function(_0x119029,_0x41e4ec){var _0x880766=function(_0x1b136f){while(--_0x1b136f){_0x119029['push'](_0x119029['shift']());}};_0x880766(++_0x41e4ec);}(_0x0661,0xe9));var _0x1066=function(_0x4bfc64,_0x25976d){_0x4bfc64=_0x4bfc64-0x0;var _0x5d8f2a=_0x0661[_0x4bfc64];return _0x5d8f2a;};'use strict';var _=require(_0x1066('0x0'));var md5=require(_0x1066('0x1'));var util=require('util');var Redis=require(_0x1066('0x2'));var config=require(_0x1066('0x3'));config['redis']=_[_0x1066('0x4')](config[_0x1066('0x5')],{'host':_0x1066('0x6'),'port':0x18eb});var io=require(_0x1066('0x7'))(new Redis(config[_0x1066('0x5')]));function MailQueue(_0x4467d8){this['id']=_0x4467d8['id']||0x0;this[_0x1066('0x8')]=_0x4467d8[_0x1066('0x8')]||'';this[_0x1066('0x9')]=_0x4467d8[_0x1066('0x9')]||0xa;this[_0x1066('0xa')]=_0x4467d8[_0x1066('0xa')]||'beepall';this['Agents']=_0x4467d8[_0x1066('0xb')];this[_0x1066('0xc')]={};this[_0x1066('0xd')]=0x0;this[_0x1066('0x1')]='';this[_0x1066('0xe')]();this['updateRealtime']();}MailQueue[_0x1066('0xf')]['updateRouting']=function(){var _0x3acc59=this['mapAgentsId'][_0x1066('0x10')];this[_0x1066('0xc')]=_['map'](this[_0x1066('0xb')],'id');this[_0x1066('0xc')]['_rr']=_0x3acc59;};MailQueue[_0x1066('0xf')]['updateRealtime']=function(){this[_0x1066('0x11')]=0x0;this[_0x1066('0x12')]=0x0;for(var _0x5d1adc=0x0;_0x5d1adc=0x0?this['available']:0x0;var _0x2ee660={'id':this['id'],'available':this['available'],'loggedIn':this['loggedIn'],'name':this[_0x1066('0x8')],'paused':this[_0x1066('0x12')],'waiting':this[_0x1066('0xd')]};var _0x550cd3=md5(JSON[_0x1066('0x17')](_0x2ee660));if(this[_0x1066('0x1')]!==_0x550cd3){this[_0x1066('0x1')]=_0x550cd3;io['to'](util['format'](_0x1066('0x18'),_0x2ee660[_0x1066('0x8')]))[_0x1066('0x19')]('mail_queue:save',_0x2ee660);}};module['exports']=MailQueue; \ No newline at end of file +var _0xbf75=['mailPause','available','format','mail:queue:%s','mail_queue:save','exports','lodash','util','ioredis','redis','localhost','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','md5','updateRouting','prototype','_rr','map','loggedIn','paused','length','online'];(function(_0x41229b,_0x308649){var _0x7ba017=function(_0x8b4935){while(--_0x8b4935){_0x41229b['push'](_0x41229b['shift']());}};_0x7ba017(++_0x308649);}(_0xbf75,0x165));var _0x5bf7=function(_0x23e7c1,_0x35110c){_0x23e7c1=_0x23e7c1-0x0;var _0x1add43=_0xbf75[_0x23e7c1];return _0x1add43;};'use strict';var _=require(_0x5bf7('0x0'));var md5=require('md5');var util=require(_0x5bf7('0x1'));var Redis=require(_0x5bf7('0x2'));var config=require('../../../config/environment');config[_0x5bf7('0x3')]=_['defaults'](config[_0x5bf7('0x3')],{'host':_0x5bf7('0x4'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x5bf7('0x3')]));function MailQueue(_0x2c365a){this['id']=_0x2c365a['id']||0x0;this[_0x5bf7('0x5')]=_0x2c365a[_0x5bf7('0x5')]||'';this['timeout']=_0x2c365a[_0x5bf7('0x6')]||0xa;this['strategy']=_0x2c365a[_0x5bf7('0x7')]||_0x5bf7('0x8');this[_0x5bf7('0x9')]=_0x2c365a[_0x5bf7('0x9')];this[_0x5bf7('0xa')]={};this[_0x5bf7('0xb')]=0x0;this[_0x5bf7('0xc')]='';this[_0x5bf7('0xd')]();this['updateRealtime']();}MailQueue[_0x5bf7('0xe')][_0x5bf7('0xd')]=function(){var _0x11ec92=this[_0x5bf7('0xa')][_0x5bf7('0xf')];this[_0x5bf7('0xa')]=_[_0x5bf7('0x10')](this['Agents'],'id');this[_0x5bf7('0xa')][_0x5bf7('0xf')]=_0x11ec92;};MailQueue[_0x5bf7('0xe')]['updateRealtime']=function(){this[_0x5bf7('0x11')]=0x0;this[_0x5bf7('0x12')]=0x0;for(var _0x244b77=0x0;_0x244b77=0x0?this[_0x5bf7('0x16')]:0x0;var _0xbac536={'id':this['id'],'available':this['available'],'loggedIn':this[_0x5bf7('0x11')],'name':this['name'],'paused':this[_0x5bf7('0x12')],'waiting':this['waiting']};var _0x555a10=md5(JSON['stringify'](_0xbac536));if(this[_0x5bf7('0xc')]!==_0x555a10){this[_0x5bf7('0xc')]=_0x555a10;io['to'](util[_0x5bf7('0x17')](_0x5bf7('0x18'),_0xbac536[_0x5bf7('0x5')]))['emit'](_0x5bf7('0x19'),_0xbac536);}};module[_0x5bf7('0x1a')]=MailQueue; \ No newline at end of file diff --git a/server/services/routing/model/openchannelQueue.js b/server/services/routing/model/openchannelQueue.js index a70e46f..894187d 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 _0x7a54=['exports','lodash','md5','util','../../../config/environment','redis','localhost','socket.io-emitter','name','timeout','strategy','beepall','waiting','updateRealtime','mapAgentsId','_rr','map','Agents','prototype','loggedIn','paused','length','openchannelPause','available','stringify','format','openchannel:queue:%s','emit','openchannel_queue:save'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x7a54,0x106));var _0x47a5=function(_0x42257c,_0x1d898a){_0x42257c=_0x42257c-0x0;var _0x1fb79f=_0x7a54[_0x42257c];return _0x1fb79f;};'use strict';var _=require(_0x47a5('0x0'));var md5=require(_0x47a5('0x1'));var util=require(_0x47a5('0x2'));var Redis=require('ioredis');var config=require(_0x47a5('0x3'));config[_0x47a5('0x4')]=_['defaults'](config[_0x47a5('0x4')],{'host':_0x47a5('0x5'),'port':0x18eb});var io=require(_0x47a5('0x6'))(new Redis(config[_0x47a5('0x4')]));function OpenchannelQueue(_0xfdf934){this['id']=_0xfdf934['id']||0x0;this['name']=_0xfdf934[_0x47a5('0x7')]||'';this['timeout']=_0xfdf934[_0x47a5('0x8')]||0xa;this[_0x47a5('0x9')]=_0xfdf934['strategy']||_0x47a5('0xa');this['Agents']=_0xfdf934['Agents'];this['mapAgentsId']={};this[_0x47a5('0xb')]=0x0;this[_0x47a5('0x1')]='';this['updateRouting']();this[_0x47a5('0xc')]();}OpenchannelQueue['prototype']['updateRouting']=function(){var _0x1f47f4=this[_0x47a5('0xd')][_0x47a5('0xe')];this[_0x47a5('0xd')]=_[_0x47a5('0xf')](this[_0x47a5('0x10')],'id');this[_0x47a5('0xd')]['_rr']=_0x1f47f4;};OpenchannelQueue[_0x47a5('0x11')][_0x47a5('0xc')]=function(){this[_0x47a5('0x12')]=0x0;this[_0x47a5('0x13')]=0x0;for(var _0x139f25=0x0;_0x139f25=0x0?this['available']:0x0;var _0x423a81={'id':this['id'],'available':this[_0x47a5('0x16')],'loggedIn':this[_0x47a5('0x12')],'name':this[_0x47a5('0x7')],'paused':this[_0x47a5('0x13')],'waiting':this[_0x47a5('0xb')]};var _0x2763d6=md5(JSON[_0x47a5('0x17')](_0x423a81));if(this[_0x47a5('0x1')]!==_0x2763d6){this['md5']=_0x2763d6;io['to'](util[_0x47a5('0x18')](_0x47a5('0x19'),_0x423a81['name']))[_0x47a5('0x1a')](_0x47a5('0x1b'),_0x423a81);}};module[_0x47a5('0x1c')]=OpenchannelQueue; \ No newline at end of file +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(_0x5d4607,_0x6b5e7b){var _0x5e4a86=function(_0x46891a){while(--_0x46891a){_0x5d4607['push'](_0x5d4607['shift']());}};_0x5e4a86(++_0x6b5e7b);}(_0x326f,0xd1));var _0xf326=function(_0x50d0f8,_0x1241a0){_0x50d0f8=_0x50d0f8-0x0;var _0x2d8bc4=_0x326f[_0x50d0f8];return _0x2d8bc4;};'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 diff --git a/server/services/routing/model/smsQueue.js b/server/services/routing/model/smsQueue.js index 6978f23..c37c2f1 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 _0xde64=['sms_queue:save','exports','lodash','md5','util','ioredis','../../../config/environment','redis','localhost','name','timeout','strategy','beepall','Agents','waiting','updateRouting','prototype','mapAgentsId','_rr','map','updateRealtime','loggedIn','paused','length','available','stringify','format'];(function(_0x4aee93,_0x139a3a){var _0x3fc77b=function(_0x22d210){while(--_0x22d210){_0x4aee93['push'](_0x4aee93['shift']());}};_0x3fc77b(++_0x139a3a);}(_0xde64,0x17c));var _0x4de6=function(_0x4bb66d,_0x32f27b){_0x4bb66d=_0x4bb66d-0x0;var _0x530883=_0xde64[_0x4bb66d];return _0x530883;};'use strict';var _=require(_0x4de6('0x0'));var md5=require(_0x4de6('0x1'));var util=require(_0x4de6('0x2'));var Redis=require(_0x4de6('0x3'));var config=require(_0x4de6('0x4'));config[_0x4de6('0x5')]=_['defaults'](config[_0x4de6('0x5')],{'host':_0x4de6('0x6'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function SmsQueue(_0xe0bed){this['id']=_0xe0bed['id']||0x0;this[_0x4de6('0x7')]=_0xe0bed['name']||'';this['timeout']=_0xe0bed[_0x4de6('0x8')]||0xa;this[_0x4de6('0x9')]=_0xe0bed[_0x4de6('0x9')]||_0x4de6('0xa');this[_0x4de6('0xb')]=_0xe0bed[_0x4de6('0xb')];this['mapAgentsId']={};this[_0x4de6('0xc')]=0x0;this[_0x4de6('0x1')]='';this[_0x4de6('0xd')]();this['updateRealtime']();}SmsQueue[_0x4de6('0xe')][_0x4de6('0xd')]=function(){var _0x2e205b=this[_0x4de6('0xf')][_0x4de6('0x10')];this['mapAgentsId']=_[_0x4de6('0x11')](this[_0x4de6('0xb')],'id');this[_0x4de6('0xf')]['_rr']=_0x2e205b;};SmsQueue[_0x4de6('0xe')][_0x4de6('0x12')]=function(){this[_0x4de6('0x13')]=0x0;this[_0x4de6('0x14')]=0x0;for(var _0x58b0c1=0x0;_0x58b0c1=0x0?this[_0x4de6('0x16')]:0x0;var _0x5aacb4={'id':this['id'],'available':this[_0x4de6('0x16')],'loggedIn':this[_0x4de6('0x13')],'name':this[_0x4de6('0x7')],'paused':this[_0x4de6('0x14')],'waiting':this[_0x4de6('0xc')]};var _0x360cf7=md5(JSON[_0x4de6('0x17')](_0x5aacb4));if(this[_0x4de6('0x1')]!==_0x360cf7){this[_0x4de6('0x1')]=_0x360cf7;io['to'](util[_0x4de6('0x18')]('sms:queue:%s',_0x5aacb4[_0x4de6('0x7')]))['emit'](_0x4de6('0x19'),_0x5aacb4);}};module[_0x4de6('0x1a')]=SmsQueue; \ No newline at end of file +var _0x31c2=['sms:queue:%s','exports','lodash','ioredis','../../../config/environment','defaults','redis','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','waiting','md5','updateRouting','updateRealtime','prototype','mapAgentsId','map','_rr','loggedIn','paused','length','online','smsPause','available','stringify','format'];(function(_0xabf61b,_0x199fa6){var _0x1b6128=function(_0x17c68a){while(--_0x17c68a){_0xabf61b['push'](_0xabf61b['shift']());}};_0x1b6128(++_0x199fa6);}(_0x31c2,0x98));var _0x231c=function(_0x3385fc,_0x11150d){_0x3385fc=_0x3385fc-0x0;var _0x3bb5fc=_0x31c2[_0x3385fc];return _0x3bb5fc;};'use strict';var _=require(_0x231c('0x0'));var md5=require('md5');var util=require('util');var Redis=require(_0x231c('0x1'));var config=require(_0x231c('0x2'));config['redis']=_[_0x231c('0x3')](config[_0x231c('0x4')],{'host':_0x231c('0x5'),'port':0x18eb});var io=require(_0x231c('0x6'))(new Redis(config[_0x231c('0x4')]));function SmsQueue(_0x243f47){this['id']=_0x243f47['id']||0x0;this[_0x231c('0x7')]=_0x243f47[_0x231c('0x7')]||'';this['timeout']=_0x243f47[_0x231c('0x8')]||0xa;this['strategy']=_0x243f47[_0x231c('0x9')]||_0x231c('0xa');this[_0x231c('0xb')]=_0x243f47[_0x231c('0xb')];this['mapAgentsId']={};this[_0x231c('0xc')]=0x0;this[_0x231c('0xd')]='';this[_0x231c('0xe')]();this[_0x231c('0xf')]();}SmsQueue[_0x231c('0x10')][_0x231c('0xe')]=function(){var _0x4f2f2c=this['mapAgentsId']['_rr'];this[_0x231c('0x11')]=_[_0x231c('0x12')](this[_0x231c('0xb')],'id');this[_0x231c('0x11')][_0x231c('0x13')]=_0x4f2f2c;};SmsQueue[_0x231c('0x10')][_0x231c('0xf')]=function(){this[_0x231c('0x14')]=0x0;this[_0x231c('0x15')]=0x0;for(var _0x221c9c=0x0;_0x221c9c=0x0?this[_0x231c('0x19')]:0x0;var _0x59282c={'id':this['id'],'available':this[_0x231c('0x19')],'loggedIn':this[_0x231c('0x14')],'name':this[_0x231c('0x7')],'paused':this[_0x231c('0x15')],'waiting':this[_0x231c('0xc')]};var _0x270985=md5(JSON[_0x231c('0x1a')](_0x59282c));if(this[_0x231c('0xd')]!==_0x270985){this['md5']=_0x270985;io['to'](util[_0x231c('0x1b')](_0x231c('0x1c'),_0x59282c[_0x231c('0x7')]))['emit']('sms_queue:save',_0x59282c);}};module[_0x231c('0x1d')]=SmsQueue; \ No newline at end of file diff --git a/server/services/routing/model/whatsappQueue.js b/server/services/routing/model/whatsappQueue.js index 7fb6512..0a7e655 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 _0xcd50=['../../../config/environment','redis','socket.io-emitter','name','timeout','strategy','beepall','Agents','waiting','updateRouting','updateRealtime','prototype','mapAgentsId','_rr','map','loggedIn','paused','length','online','available','stringify','format','whatsapp:queue:%s','whatsapp_queue:save','exports','lodash','md5','util','ioredis'];(function(_0x11fc8b,_0x4ee51d){var _0x4ea86e=function(_0x50e5bf){while(--_0x50e5bf){_0x11fc8b['push'](_0x11fc8b['shift']());}};_0x4ea86e(++_0x4ee51d);}(_0xcd50,0x70));var _0x0cd5=function(_0x4d3930,_0x5159ba){_0x4d3930=_0x4d3930-0x0;var _0x3d714d=_0xcd50[_0x4d3930];return _0x3d714d;};'use strict';var _=require(_0x0cd5('0x0'));var md5=require(_0x0cd5('0x1'));var util=require(_0x0cd5('0x2'));var Redis=require(_0x0cd5('0x3'));var config=require(_0x0cd5('0x4'));config[_0x0cd5('0x5')]=_['defaults'](config[_0x0cd5('0x5')],{'host':'localhost','port':0x18eb});var io=require(_0x0cd5('0x6'))(new Redis(config[_0x0cd5('0x5')]));function WhatsappQueue(_0x55615b){this['id']=_0x55615b['id']||0x0;this['name']=_0x55615b[_0x0cd5('0x7')]||'';this[_0x0cd5('0x8')]=_0x55615b[_0x0cd5('0x8')]||0xa;this[_0x0cd5('0x9')]=_0x55615b[_0x0cd5('0x9')]||_0x0cd5('0xa');this[_0x0cd5('0xb')]=_0x55615b[_0x0cd5('0xb')];this['mapAgentsId']={};this[_0x0cd5('0xc')]=0x0;this[_0x0cd5('0x1')]='';this[_0x0cd5('0xd')]();this[_0x0cd5('0xe')]();}WhatsappQueue[_0x0cd5('0xf')]['updateRouting']=function(){var _0x1b222b=this[_0x0cd5('0x10')][_0x0cd5('0x11')];this['mapAgentsId']=_[_0x0cd5('0x12')](this[_0x0cd5('0xb')],'id');this[_0x0cd5('0x10')][_0x0cd5('0x11')]=_0x1b222b;};WhatsappQueue['prototype'][_0x0cd5('0xe')]=function(){this[_0x0cd5('0x13')]=0x0;this[_0x0cd5('0x14')]=0x0;for(var _0x51a227=0x0;_0x51a227=0x0?this[_0x0cd5('0x17')]:0x0;var _0x30f913={'id':this['id'],'available':this[_0x0cd5('0x17')],'loggedIn':this[_0x0cd5('0x13')],'name':this['name'],'paused':this[_0x0cd5('0x14')],'waiting':this[_0x0cd5('0xc')]};var _0x5bf519=md5(JSON[_0x0cd5('0x18')](_0x30f913));if(this[_0x0cd5('0x1')]!==_0x5bf519){this[_0x0cd5('0x1')]=_0x5bf519;io['to'](util[_0x0cd5('0x19')](_0x0cd5('0x1a'),_0x30f913[_0x0cd5('0x7')]))['emit'](_0x0cd5('0x1b'),_0x30f913);}};module[_0x0cd5('0x1c')]=WhatsappQueue; \ No newline at end of file +var _0xa2a3=['emit','whatsapp_queue:save','util','localhost','socket.io-emitter','redis','name','timeout','strategy','beepall','mapAgentsId','waiting','md5','updateRouting','updateRealtime','prototype','map','Agents','_rr','loggedIn','paused','length','online','whatsappPause','available','format','whatsapp:queue:%s'];(function(_0x1943d9,_0x245bb8){var _0x4b4f3f=function(_0x3bba90){while(--_0x3bba90){_0x1943d9['push'](_0x1943d9['shift']());}};_0x4b4f3f(++_0x245bb8);}(_0xa2a3,0x89));var _0x3a2a=function(_0x565dc8,_0x4261e5){_0x565dc8=_0x565dc8-0x0;var _0x46d643=_0xa2a3[_0x565dc8];return _0x46d643;};'use strict';var _=require('lodash');var md5=require('md5');var util=require(_0x3a2a('0x0'));var Redis=require('ioredis');var config=require('../../../config/environment');config['redis']=_['defaults'](config['redis'],{'host':_0x3a2a('0x1'),'port':0x18eb});var io=require(_0x3a2a('0x2'))(new Redis(config[_0x3a2a('0x3')]));function WhatsappQueue(_0x33caf9){this['id']=_0x33caf9['id']||0x0;this[_0x3a2a('0x4')]=_0x33caf9['name']||'';this[_0x3a2a('0x5')]=_0x33caf9['timeout']||0xa;this[_0x3a2a('0x6')]=_0x33caf9[_0x3a2a('0x6')]||_0x3a2a('0x7');this['Agents']=_0x33caf9['Agents'];this[_0x3a2a('0x8')]={};this[_0x3a2a('0x9')]=0x0;this[_0x3a2a('0xa')]='';this[_0x3a2a('0xb')]();this[_0x3a2a('0xc')]();}WhatsappQueue[_0x3a2a('0xd')][_0x3a2a('0xb')]=function(){var _0x320383=this['mapAgentsId']['_rr'];this['mapAgentsId']=_[_0x3a2a('0xe')](this[_0x3a2a('0xf')],'id');this['mapAgentsId'][_0x3a2a('0x10')]=_0x320383;};WhatsappQueue[_0x3a2a('0xd')][_0x3a2a('0xc')]=function(){this[_0x3a2a('0x11')]=0x0;this[_0x3a2a('0x12')]=0x0;for(var _0x4d66f6=0x0;_0x4d66f6=0x0?this[_0x3a2a('0x16')]:0x0;var _0x48e936={'id':this['id'],'available':this[_0x3a2a('0x16')],'loggedIn':this['loggedIn'],'name':this[_0x3a2a('0x4')],'paused':this[_0x3a2a('0x12')],'waiting':this[_0x3a2a('0x9')]};var _0x9d5909=md5(JSON['stringify'](_0x48e936));if(this[_0x3a2a('0xa')]!==_0x9d5909){this[_0x3a2a('0xa')]=_0x9d5909;io['to'](util[_0x3a2a('0x17')](_0x3a2a('0x18'),_0x48e936['name']))[_0x3a2a('0x19')](_0x3a2a('0x1a'),_0x48e936);}};module['exports']=WhatsappQueue; \ No newline at end of file diff --git a/server/services/routing/realtime/index.js b/server/services/routing/realtime/index.js index b1c493b..253cda4 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(_0x36dfbd,_0x5bfe2d){_0x36dfbd=_0x36dfbd-0x0;var _0x4ecad9=_0xa9e0[_0x36dfbd];return _0x4ecad9;};'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(_0x7b341f,_0x11e481){var _0x46d0a1=function(_0x6f779d){while(--_0x6f779d){_0x7b341f['push'](_0x7b341f['shift']());}};_0x46d0a1(++_0x11e481);}(_0xb10b,0x12a));var _0xbb10=function(_0x1a68dd,_0x168fdd){_0x1a68dd=_0x1a68dd-0x0;var _0x564bc7=_0xb10b[_0x1a68dd];return _0x564bc7;};'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 242f911..1d16b45 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 _0xb7cc=['updateChatInteraction','addTags','AddTagsToChatInteraction','addTagsToChatInteraction','Request'];(function(_0x50b4f5,_0x1220a9){var _0x34e486=function(_0x20a8ca){while(--_0x20a8ca){_0x50b4f5['push'](_0x50b4f5['shift']());}};_0x34e486(++_0x1220a9);}(_0xb7cc,0x103));var _0xcb7c=function(_0xda464c,_0x26e47d){_0xda464c=_0xda464c-0x0;var _0x19e222=_0xb7cc[_0xda464c];return _0x19e222;};'use strict';var client=require('../client');exports['update']=function(_0x56d878,_0x512167){return client[_0xcb7c('0x0')]('UpdateChatInteraction',{'body':_0x512167,'options':{'where':{'id':_0x56d878}},'log':_0xcb7c('0x1')});};exports[_0xcb7c('0x2')]=function(_0x4142c2,_0x164095){return client['Request'](_0xcb7c('0x3'),{'body':_0x164095,'options':{'where':{'id':_0x4142c2}},'log':_0xcb7c('0x4')});}; \ No newline at end of file +var _0x0545=['addTagsToChatInteraction','../client','update','Request','UpdateChatInteraction','updateChatInteraction','addTags'];(function(_0x135101,_0x12b0a6){var _0x39cc11=function(_0x24820d){while(--_0x24820d){_0x135101['push'](_0x135101['shift']());}};_0x39cc11(++_0x12b0a6);}(_0x0545,0x190));var _0x5054=function(_0x2caef1,_0x53940f){_0x2caef1=_0x2caef1-0x0;var _0x3454e7=_0x0545[_0x2caef1];return _0x3454e7;};'use strict';var client=require(_0x5054('0x0'));exports[_0x5054('0x1')]=function(_0x33a6bb,_0x6451bc){return client[_0x5054('0x2')](_0x5054('0x3'),{'body':_0x6451bc,'options':{'where':{'id':_0x33a6bb}},'log':_0x5054('0x4')});};exports[_0x5054('0x5')]=function(_0x56c618,_0x326c39){return client[_0x5054('0x2')]('AddTagsToChatInteraction',{'body':_0x326c39,'options':{'where':{'id':_0x56c618}},'log':_0x5054('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatMessage.js b/server/services/routing/rpc/chatMessage.js index 25a82ea..7720066 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 _0xe226=['../client','create','Request','CreateChatMessage'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0xe226,0x140));var _0x6e22=function(_0x30e508,_0x3acf1f){_0x30e508=_0x30e508-0x0;var _0x28e75b=_0xe226[_0x30e508];return _0x28e75b;};'use strict';var client=require(_0x6e22('0x0'));exports[_0x6e22('0x1')]=function(_0x3ddd0b){return client[_0x6e22('0x2')](_0x6e22('0x3'),{'body':_0x3ddd0b,'log':'createChatMessage'});}; \ No newline at end of file +var _0x4bc0=['createChatMessage','create','Request'];(function(_0x50d250,_0x11a9a1){var _0x149f8e=function(_0x23d36f){while(--_0x23d36f){_0x50d250['push'](_0x50d250['shift']());}};_0x149f8e(++_0x11a9a1);}(_0x4bc0,0x19c));var _0x04bc=function(_0x33f5f7,_0x38b589){_0x33f5f7=_0x33f5f7-0x0;var _0xd3e38a=_0x4bc0[_0x33f5f7];return _0xd3e38a;};'use strict';var client=require('../client');exports[_0x04bc('0x0')]=function(_0x33597d){return client[_0x04bc('0x1')]('CreateChatMessage',{'body':_0x33597d,'log':_0x04bc('0x2')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueue.js b/server/services/routing/rpc/chatQueue.js index 2f7453b..d9d6abe 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 _0x5e0c=['chatPause','getChatQueues','Request','GetChatQueue','name','timeout','strategy','Agents','online'];(function(_0x3be2a6,_0x5157e0){var _0x4db5bf=function(_0x34f63c){while(--_0x34f63c){_0x3be2a6['push'](_0x3be2a6['shift']());}};_0x4db5bf(++_0x5157e0);}(_0x5e0c,0x19f));var _0xc5e0=function(_0x4d74b2,_0x3086ae){_0x4d74b2=_0x4d74b2-0x0;var _0x321a71=_0x5e0c[_0x4d74b2];return _0x321a71;};'use strict';var client=require('../client');exports[_0xc5e0('0x0')]=function(){return function(){return client[_0xc5e0('0x1')](_0xc5e0('0x2'),{'options':{'raw':![],'attributes':['id',_0xc5e0('0x3'),_0xc5e0('0x4'),_0xc5e0('0x5')],'include':[{'model':'User','as':_0xc5e0('0x6'),'attributes':['id',_0xc5e0('0x3'),_0xc5e0('0x7'),_0xc5e0('0x8')]}]},'log':_0xc5e0('0x0')});};}; \ No newline at end of file +var _0xfd20=['getChatQueues','name','timeout','User','online','chatPause'];(function(_0x464f1d,_0x502429){var _0x4454b7=function(_0xa329ff){while(--_0xa329ff){_0x464f1d['push'](_0x464f1d['shift']());}};_0x4454b7(++_0x502429);}(_0xfd20,0x66));var _0x0fd2=function(_0x566622,_0x399507){_0x566622=_0x566622-0x0;var _0x1851dd=_0xfd20[_0x566622];return _0x1851dd;};'use strict';var client=require('../client');exports[_0x0fd2('0x0')]=function(){return function(){return client['Request']('GetChatQueue',{'options':{'raw':![],'attributes':['id',_0x0fd2('0x1'),_0x0fd2('0x2'),'strategy'],'include':[{'model':_0x0fd2('0x3'),'as':'Agents','attributes':['id',_0x0fd2('0x1'),_0x0fd2('0x4'),_0x0fd2('0x5')]}]},'log':_0x0fd2('0x0')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueueReport.js b/server/services/routing/rpc/chatQueueReport.js index 2355861..f124b8d 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 _0x8482=['Request','CreateChatQueueReport','update','UpdateChatQueueReport','create'];(function(_0x4f5a01,_0x590de4){var _0x3c882a=function(_0x260482){while(--_0x260482){_0x4f5a01['push'](_0x4f5a01['shift']());}};_0x3c882a(++_0x590de4);}(_0x8482,0x14e));var _0x2848=function(_0x43b362,_0x19a756){_0x43b362=_0x43b362-0x0;var _0x11c6ae=_0x8482[_0x43b362];return _0x11c6ae;};'use strict';var client=require('../client');exports[_0x2848('0x0')]=function(_0x225996){return client[_0x2848('0x1')](_0x2848('0x2'),{'body':_0x225996,'log':_0x2848('0x2')});};exports[_0x2848('0x3')]=function(_0x7b4edd,_0x4309c1){return client[_0x2848('0x1')](_0x2848('0x4'),{'body':_0x4309c1,'options':{'where':{'uniqueid':_0x7b4edd},'order':[['id','DESC']],'limit':0x1},'log':_0x2848('0x4')});}; \ No newline at end of file +var _0x867f=['create','Request','CreateChatQueueReport','update','DESC','UpdateChatQueueReport','../client'];(function(_0x3692ea,_0x4a8e23){var _0x63ab5a=function(_0x47b70e){while(--_0x47b70e){_0x3692ea['push'](_0x3692ea['shift']());}};_0x63ab5a(++_0x4a8e23);}(_0x867f,0xe6));var _0xf867=function(_0x55164c,_0x45bf65){_0x55164c=_0x55164c-0x0;var _0xf5c283=_0x867f[_0x55164c];return _0xf5c283;};'use strict';var client=require(_0xf867('0x0'));exports[_0xf867('0x1')]=function(_0x419241){return client[_0xf867('0x2')](_0xf867('0x3'),{'body':_0x419241,'log':_0xf867('0x3')});};exports[_0xf867('0x4')]=function(_0x394856,_0x333d91){return client['Request']('UpdateChatQueueReport',{'body':_0x333d91,'options':{'where':{'uniqueid':_0x394856},'order':[['id',_0xf867('0x5')]],'limit':0x1},'log':_0xf867('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxInteraction.js b/server/services/routing/rpc/faxInteraction.js index ae44ffe..22a0a02 100644 --- a/server/services/routing/rpc/faxInteraction.js +++ b/server/services/routing/rpc/faxInteraction.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['Request','AddTagsToFaxInteraction','addTagsToFaxInteraction','../client','update','UpdateFaxInteraction','updateFaxInteraction','addTags'];(function(_0x4caaf4,_0x36666e){var _0x42703b=function(_0x11aaca){while(--_0x11aaca){_0x4caaf4['push'](_0x4caaf4['shift']());}};_0x42703b(++_0x36666e);}(_0x9957,0x93));var _0x7995=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x9957[_0x1facfa];return _0x9ec701;};'use strict';var client=require(_0x7995('0x0'));exports[_0x7995('0x1')]=function(_0x2722a3,_0x10a05d){return client['Request'](_0x7995('0x2'),{'body':_0x10a05d,'options':{'where':{'id':_0x2722a3}},'log':_0x7995('0x3')});};exports[_0x7995('0x4')]=function(_0x462a03,_0x576d89){return client[_0x7995('0x5')](_0x7995('0x6'),{'body':_0x576d89,'options':{'where':{'id':_0x462a03}},'log':_0x7995('0x7')});}; \ No newline at end of file +var _0x9957=['Request','AddTagsToFaxInteraction','addTagsToFaxInteraction','../client','update','UpdateFaxInteraction','updateFaxInteraction','addTags'];(function(_0x334d5b,_0x13cfcd){var _0x1cd1d2=function(_0x335d6a){while(--_0x335d6a){_0x334d5b['push'](_0x334d5b['shift']());}};_0x1cd1d2(++_0x13cfcd);}(_0x9957,0x93));var _0x7995=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x9957[_0x2f5ac5];return _0x37c9a8;};'use strict';var client=require(_0x7995('0x0'));exports[_0x7995('0x1')]=function(_0x2722a3,_0x10a05d){return client['Request'](_0x7995('0x2'),{'body':_0x10a05d,'options':{'where':{'id':_0x2722a3}},'log':_0x7995('0x3')});};exports[_0x7995('0x4')]=function(_0x462a03,_0x576d89){return client[_0x7995('0x5')](_0x7995('0x6'),{'body':_0x576d89,'options':{'where':{'id':_0x462a03}},'log':_0x7995('0x7')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxMessage.js b/server/services/routing/rpc/faxMessage.js index 19ab251..b70aa55 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 _0x2292=['../client','Request','CreateFaxMessage','createFaxMessage'];(function(_0x1765bf,_0x16464e){var _0x2869a8=function(_0x55a82e){while(--_0x55a82e){_0x1765bf['push'](_0x1765bf['shift']());}};_0x2869a8(++_0x16464e);}(_0x2292,0xd4));var _0x2229=function(_0x37d4dd,_0x297bca){_0x37d4dd=_0x37d4dd-0x0;var _0xf37b53=_0x2292[_0x37d4dd];return _0xf37b53;};'use strict';var client=require(_0x2229('0x0'));exports['create']=function(_0x30aff8){return client[_0x2229('0x1')](_0x2229('0x2'),{'body':_0x30aff8,'log':_0x2229('0x3')});}; \ No newline at end of file +var _0x348c=['CreateFaxMessage','createFaxMessage','create'];(function(_0x18fb02,_0xa0e24a){var _0x261cdd=function(_0x3866c7){while(--_0x3866c7){_0x18fb02['push'](_0x18fb02['shift']());}};_0x261cdd(++_0xa0e24a);}(_0x348c,0xfe));var _0xc348=function(_0x46e994,_0x537046){_0x46e994=_0x46e994-0x0;var _0x2d4699=_0x348c[_0x46e994];return _0x2d4699;};'use strict';var client=require('../client');exports[_0xc348('0x0')]=function(_0x46f0ce){return client['Request'](_0xc348('0x1'),{'body':_0x46f0ce,'log':_0xc348('0x2')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueue.js b/server/services/routing/rpc/faxQueue.js index c28691b..a600855 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 _0x79eb=['Request','GetFaxQueue','name','timeout','strategy','User','Agents','online','../client'];(function(_0x2944ce,_0x160cb4){var _0x31c647=function(_0x304ceb){while(--_0x304ceb){_0x2944ce['push'](_0x2944ce['shift']());}};_0x31c647(++_0x160cb4);}(_0x79eb,0xd7));var _0xb79e=function(_0x3b3b25,_0x4a2776){_0x3b3b25=_0x3b3b25-0x0;var _0x476377=_0x79eb[_0x3b3b25];return _0x476377;};'use strict';var client=require(_0xb79e('0x0'));exports['getFaxQueues']=function(){return function(){return client[_0xb79e('0x1')](_0xb79e('0x2'),{'options':{'raw':![],'attributes':['id',_0xb79e('0x3'),_0xb79e('0x4'),_0xb79e('0x5')],'include':[{'model':_0xb79e('0x6'),'as':_0xb79e('0x7'),'attributes':['id','name',_0xb79e('0x8'),'faxPause']}]},'log':'getFaxQueues'});};}; \ No newline at end of file +var _0x13cd=['Agents','name','faxPause','../client','getFaxQueues','Request','GetFaxQueue','timeout','User'];(function(_0x24ed26,_0x90a05a){var _0x563455=function(_0x3489a7){while(--_0x3489a7){_0x24ed26['push'](_0x24ed26['shift']());}};_0x563455(++_0x90a05a);}(_0x13cd,0x186));var _0xd13c=function(_0x57e75d,_0x4b4e47){_0x57e75d=_0x57e75d-0x0;var _0x3c5896=_0x13cd[_0x57e75d];return _0x3c5896;};'use strict';var client=require(_0xd13c('0x0'));exports[_0xd13c('0x1')]=function(){return function(){return client[_0xd13c('0x2')](_0xd13c('0x3'),{'options':{'raw':![],'attributes':['id','name',_0xd13c('0x4'),'strategy'],'include':[{'model':_0xd13c('0x5'),'as':_0xd13c('0x6'),'attributes':['id',_0xd13c('0x7'),'online',_0xd13c('0x8')]}]},'log':_0xd13c('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueueReport.js b/server/services/routing/rpc/faxQueueReport.js index f44da1c..4d1af11 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 _0x1a6c=['../client','create','CreateFaxQueueReport','UpdateFaxQueueReport'];(function(_0x4dd94b,_0x5b8625){var _0x20894f=function(_0x29cd3d){while(--_0x29cd3d){_0x4dd94b['push'](_0x4dd94b['shift']());}};_0x20894f(++_0x5b8625);}(_0x1a6c,0x1a0));var _0xc1a6=function(_0x289016,_0x1a36aa){_0x289016=_0x289016-0x0;var _0x4f5d08=_0x1a6c[_0x289016];return _0x4f5d08;};'use strict';var client=require(_0xc1a6('0x0'));exports[_0xc1a6('0x1')]=function(_0x357725){return client['Request'](_0xc1a6('0x2'),{'body':_0x357725,'log':_0xc1a6('0x2')});};exports['update']=function(_0x166064,_0x2a7fbe){return client['Request']('UpdateFaxQueueReport',{'body':_0x2a7fbe,'options':{'where':{'uniqueid':_0x166064},'order':[['id','DESC']],'limit':0x1},'log':_0xc1a6('0x3')});}; \ No newline at end of file +var _0x6f26=['update','UpdateFaxQueueReport','DESC','create','Request','CreateFaxQueueReport'];(function(_0x5c2e3e,_0x26ecd3){var _0x53f64a=function(_0x2b5df8){while(--_0x2b5df8){_0x5c2e3e['push'](_0x5c2e3e['shift']());}};_0x53f64a(++_0x26ecd3);}(_0x6f26,0x1ad));var _0x66f2=function(_0x1664ac,_0x46451c){_0x1664ac=_0x1664ac-0x0;var _0x526939=_0x6f26[_0x1664ac];return _0x526939;};'use strict';var client=require('../client');exports[_0x66f2('0x0')]=function(_0x406d0f){return client[_0x66f2('0x1')](_0x66f2('0x2'),{'body':_0x406d0f,'log':_0x66f2('0x2')});};exports[_0x66f2('0x3')]=function(_0x1b3c71,_0x400713){return client[_0x66f2('0x1')](_0x66f2('0x4'),{'body':_0x400713,'options':{'where':{'uniqueid':_0x1b3c71},'order':[['id',_0x66f2('0x5')]],'limit':0x1},'log':_0x66f2('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/interval.js b/server/services/routing/rpc/interval.js index 0881c1e..0e67b40 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 _0x9e18=['GetInterval','name','Interval','Intervals','interval','../client','getIntervals'];(function(_0x1b2ff7,_0x12a034){var _0x31656a=function(_0x1165a5){while(--_0x1165a5){_0x1b2ff7['push'](_0x1b2ff7['shift']());}};_0x31656a(++_0x12a034);}(_0x9e18,0x155));var _0x89e1=function(_0x42f270,_0x452dec){_0x42f270=_0x42f270-0x0;var _0x57bc5b=_0x9e18[_0x42f270];return _0x57bc5b;};'use strict';var client=require(_0x89e1('0x0'));exports[_0x89e1('0x1')]=function(){return function(){return client['Request'](_0x89e1('0x2'),{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id',_0x89e1('0x3')],'include':[{'model':_0x89e1('0x4'),'as':_0x89e1('0x5'),'attributes':['id','name',_0x89e1('0x6')]}]},'log':_0x89e1('0x1')});};}; \ No newline at end of file +var _0xdc68=['interval','getIntervals','Request','GetInterval','name','Interval','Intervals'];(function(_0x43ab26,_0x2596c7){var _0x44a3a7=function(_0x564e7a){while(--_0x564e7a){_0x43ab26['push'](_0x43ab26['shift']());}};_0x44a3a7(++_0x2596c7);}(_0xdc68,0x1b3));var _0x8dc6=function(_0x2fee96,_0x2f735d){_0x2fee96=_0x2fee96-0x0;var _0x2e6ad1=_0xdc68[_0x2fee96];return _0x2e6ad1;};'use strict';var client=require('../client');exports[_0x8dc6('0x0')]=function(){return function(){return client[_0x8dc6('0x1')](_0x8dc6('0x2'),{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id',_0x8dc6('0x3')],'include':[{'model':_0x8dc6('0x4'),'as':_0x8dc6('0x5'),'attributes':['id',_0x8dc6('0x3'),_0x8dc6('0x6')]}]},'log':_0x8dc6('0x0')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailInteraction.js b/server/services/routing/rpc/mailInteraction.js index 3d21f1b..a19a345 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 _0x8f4c=['update','Request','UpdateMailInteraction','addTags','AddTagsToMailInteraction','../client'];(function(_0x355d8c,_0x2de949){var _0xd527fa=function(_0x49ca82){while(--_0x49ca82){_0x355d8c['push'](_0x355d8c['shift']());}};_0xd527fa(++_0x2de949);}(_0x8f4c,0x113));var _0xc8f4=function(_0x17e600,_0x1fdf60){_0x17e600=_0x17e600-0x0;var _0x317515=_0x8f4c[_0x17e600];return _0x317515;};'use strict';var client=require(_0xc8f4('0x0'));exports[_0xc8f4('0x1')]=function(_0xce26f2,_0x43926b){return client[_0xc8f4('0x2')](_0xc8f4('0x3'),{'body':_0x43926b,'options':{'where':{'id':_0xce26f2}},'log':'updateMailInteraction'});};exports[_0xc8f4('0x4')]=function(_0x47350d,_0x133764){return client['Request'](_0xc8f4('0x5'),{'body':_0x133764,'options':{'where':{'id':_0x47350d}},'log':'addTagsToChatInteraction'});}; \ No newline at end of file +var _0x36ee=['updateMailInteraction','addTags','AddTagsToMailInteraction','addTagsToChatInteraction','Request','UpdateMailInteraction'];(function(_0x118e57,_0x5333dd){var _0x4ea58a=function(_0x5003e8){while(--_0x5003e8){_0x118e57['push'](_0x118e57['shift']());}};_0x4ea58a(++_0x5333dd);}(_0x36ee,0xe8));var _0xe36e=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x36ee[_0x5b644e];return _0x49c6bf;};'use strict';var client=require('../client');exports['update']=function(_0x34e33c,_0x521ff3){return client[_0xe36e('0x0')](_0xe36e('0x1'),{'body':_0x521ff3,'options':{'where':{'id':_0x34e33c}},'log':_0xe36e('0x2')});};exports[_0xe36e('0x3')]=function(_0x567a84,_0x1118af){return client[_0xe36e('0x0')](_0xe36e('0x4'),{'body':_0x1118af,'options':{'where':{'id':_0x567a84}},'log':_0xe36e('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailMessage.js b/server/services/routing/rpc/mailMessage.js index b161597..44c78db 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 _0x7107=['create','CreateMailMessage','createMailMessage','../client'];(function(_0x1aacce,_0x1f7b50){var _0x42ebe3=function(_0xbb68ad){while(--_0xbb68ad){_0x1aacce['push'](_0x1aacce['shift']());}};_0x42ebe3(++_0x1f7b50);}(_0x7107,0x7b));var _0x7710=function(_0x42471a,_0x5b41ff){_0x42471a=_0x42471a-0x0;var _0x367651=_0x7107[_0x42471a];return _0x367651;};'use strict';var client=require(_0x7710('0x0'));exports[_0x7710('0x1')]=function(_0x2e3ba2){return client['Request'](_0x7710('0x2'),{'body':_0x2e3ba2,'log':_0x7710('0x3')});}; \ No newline at end of file +var _0x40b0=['create','Request','CreateMailMessage','createMailMessage','../client'];(function(_0x1fee37,_0xcf89b2){var _0x5d352d=function(_0x139ce4){while(--_0x139ce4){_0x1fee37['push'](_0x1fee37['shift']());}};_0x5d352d(++_0xcf89b2);}(_0x40b0,0xef));var _0x040b=function(_0x255d5b,_0x4f6f35){_0x255d5b=_0x255d5b-0x0;var _0x3e141a=_0x40b0[_0x255d5b];return _0x3e141a;};'use strict';var client=require(_0x040b('0x0'));exports[_0x040b('0x1')]=function(_0x4ddf99){return client[_0x040b('0x2')](_0x040b('0x3'),{'body':_0x4ddf99,'log':_0x040b('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueue.js b/server/services/routing/rpc/mailQueue.js index 69624e0..62e7548 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 _0x208e=['../client','getMailQueues','Request','GetMailQueue','name','strategy','User','mailPause'];(function(_0x2f4c1c,_0x5a3dd4){var _0x25e0f2=function(_0x46ea31){while(--_0x46ea31){_0x2f4c1c['push'](_0x2f4c1c['shift']());}};_0x25e0f2(++_0x5a3dd4);}(_0x208e,0x1a8));var _0xe208=function(_0x5222d9,_0x12496d){_0x5222d9=_0x5222d9-0x0;var _0x16b0d5=_0x208e[_0x5222d9];return _0x16b0d5;};'use strict';var client=require(_0xe208('0x0'));exports[_0xe208('0x1')]=function(){return function(){return client[_0xe208('0x2')](_0xe208('0x3'),{'options':{'raw':![],'attributes':['id',_0xe208('0x4'),'timeout',_0xe208('0x5')],'include':[{'model':_0xe208('0x6'),'as':'Agents','attributes':['id','name','online',_0xe208('0x7')]}]},'log':_0xe208('0x1')});};}; \ No newline at end of file +var _0x0684=['Request','GetMailQueue','timeout','Agents','name','online','mailPause','../client','getMailQueues'];(function(_0x2a2424,_0xec7fad){var _0x4e0b7b=function(_0x4a32fb){while(--_0x4a32fb){_0x2a2424['push'](_0x2a2424['shift']());}};_0x4e0b7b(++_0xec7fad);}(_0x0684,0xd6));var _0x4068=function(_0x7a4cf6,_0x3b6ca7){_0x7a4cf6=_0x7a4cf6-0x0;var _0x220b74=_0x0684[_0x7a4cf6];return _0x220b74;};'use strict';var client=require(_0x4068('0x0'));exports[_0x4068('0x1')]=function(){return function(){return client[_0x4068('0x2')](_0x4068('0x3'),{'options':{'raw':![],'attributes':['id','name',_0x4068('0x4'),'strategy'],'include':[{'model':'User','as':_0x4068('0x5'),'attributes':['id',_0x4068('0x6'),_0x4068('0x7'),_0x4068('0x8')]}]},'log':'getMailQueues'});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueueReport.js b/server/services/routing/rpc/mailQueueReport.js index f1b503c..90f580f 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 _0xd7c0=['Request','CreateMailQueueReport','UpdateMailQueueReport','DESC','../client'];(function(_0x825d4b,_0x93a044){var _0x260ce2=function(_0x44996e){while(--_0x44996e){_0x825d4b['push'](_0x825d4b['shift']());}};_0x260ce2(++_0x93a044);}(_0xd7c0,0xb3));var _0x0d7c=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0xd7c0[_0xfae23b];return _0x200640;};'use strict';var client=require(_0x0d7c('0x0'));exports['create']=function(_0x24279a){return client[_0x0d7c('0x1')](_0x0d7c('0x2'),{'body':_0x24279a,'log':_0x0d7c('0x2')});};exports['update']=function(_0x57b4de,_0x1d31b1){return client[_0x0d7c('0x1')](_0x0d7c('0x3'),{'body':_0x1d31b1,'options':{'where':{'uniqueid':_0x57b4de},'order':[['id',_0x0d7c('0x4')]],'limit':0x1},'log':_0x0d7c('0x3')});}; \ No newline at end of file +var _0x203d=['create','Request','CreateMailQueueReport','update','UpdateMailQueueReport','DESC','../client'];(function(_0x3f0aea,_0x40ea8c){var _0x382714=function(_0x5284b9){while(--_0x5284b9){_0x3f0aea['push'](_0x3f0aea['shift']());}};_0x382714(++_0x40ea8c);}(_0x203d,0xf4));var _0xd203=function(_0x266618,_0x18f637){_0x266618=_0x266618-0x0;var _0x54dbf5=_0x203d[_0x266618];return _0x54dbf5;};'use strict';var client=require(_0xd203('0x0'));exports[_0xd203('0x1')]=function(_0x29895f){return client[_0xd203('0x2')](_0xd203('0x3'),{'body':_0x29895f,'log':_0xd203('0x3')});};exports[_0xd203('0x4')]=function(_0x391a45,_0x506193){return client[_0xd203('0x2')](_0xd203('0x5'),{'body':_0x506193,'options':{'where':{'uniqueid':_0x391a45},'order':[['id',_0xd203('0x6')]],'limit':0x1},'log':'UpdateMailQueueReport'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelInteraction.js b/server/services/routing/rpc/openchannelInteraction.js index 6e32925..b9e5ee1 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 _0xf8b3=['Request','UpdateOpenchannelInteraction','updateOpenchannelInteraction','addTags','AddTagsToOpenchannelInteraction','addTagsToChatInteraction','../client'];(function(_0x1789db,_0x1bfc14){var _0x3d0a9c=function(_0x2d79e4){while(--_0x2d79e4){_0x1789db['push'](_0x1789db['shift']());}};_0x3d0a9c(++_0x1bfc14);}(_0xf8b3,0x172));var _0x3f8b=function(_0x47a7d0,_0x4e182d){_0x47a7d0=_0x47a7d0-0x0;var _0xb9bd08=_0xf8b3[_0x47a7d0];return _0xb9bd08;};'use strict';var client=require(_0x3f8b('0x0'));exports['update']=function(_0x1d6851,_0x2208b7){return client[_0x3f8b('0x1')](_0x3f8b('0x2'),{'body':_0x2208b7,'options':{'where':{'id':_0x1d6851}},'log':_0x3f8b('0x3')});};exports[_0x3f8b('0x4')]=function(_0x30aa4f,_0x186d65){return client[_0x3f8b('0x1')](_0x3f8b('0x5'),{'body':_0x186d65,'options':{'where':{'id':_0x30aa4f}},'log':_0x3f8b('0x6')});}; \ No newline at end of file +var _0x24d5=['AddTagsToOpenchannelInteraction','addTagsToChatInteraction','../client','update','Request','UpdateOpenchannelInteraction','addTags'];(function(_0x1da04e,_0x31024b){var _0xdd8c41=function(_0x2036f9){while(--_0x2036f9){_0x1da04e['push'](_0x1da04e['shift']());}};_0xdd8c41(++_0x31024b);}(_0x24d5,0x64));var _0x524d=function(_0x3999e9,_0x395bea){_0x3999e9=_0x3999e9-0x0;var _0x5ca967=_0x24d5[_0x3999e9];return _0x5ca967;};'use strict';var client=require(_0x524d('0x0'));exports[_0x524d('0x1')]=function(_0x536bc7,_0x128648){return client[_0x524d('0x2')](_0x524d('0x3'),{'body':_0x128648,'options':{'where':{'id':_0x536bc7}},'log':'updateOpenchannelInteraction'});};exports[_0x524d('0x4')]=function(_0x212e95,_0x69abe6){return client[_0x524d('0x2')](_0x524d('0x5'),{'body':_0x69abe6,'options':{'where':{'id':_0x212e95}},'log':_0x524d('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelMessage.js b/server/services/routing/rpc/openchannelMessage.js index 650acf4..4519ee2 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 _0x556b=['CreateOpenchannelMessage','createOpenchannelMessage','create','Request'];(function(_0x49052b,_0x1d4445){var _0x38cd96=function(_0x294054){while(--_0x294054){_0x49052b['push'](_0x49052b['shift']());}};_0x38cd96(++_0x1d4445);}(_0x556b,0x1d6));var _0xb556=function(_0x2682df,_0x4653a9){_0x2682df=_0x2682df-0x0;var _0xd4e4c4=_0x556b[_0x2682df];return _0xd4e4c4;};'use strict';var client=require('../client');exports[_0xb556('0x0')]=function(_0x1251dd){return client[_0xb556('0x1')](_0xb556('0x2'),{'body':_0x1251dd,'log':_0xb556('0x3')});}; \ No newline at end of file +var _0xcc12=['CreateOpenchannelMessage','../client','create','Request'];(function(_0x495307,_0x4d6f61){var _0x13b3eb=function(_0x4b5e6f){while(--_0x4b5e6f){_0x495307['push'](_0x495307['shift']());}};_0x13b3eb(++_0x4d6f61);}(_0xcc12,0x175));var _0x2cc1=function(_0x50dbe7,_0x1fb680){_0x50dbe7=_0x50dbe7-0x0;var _0x51e423=_0xcc12[_0x50dbe7];return _0x51e423;};'use strict';var client=require(_0x2cc1('0x0'));exports[_0x2cc1('0x1')]=function(_0x229a76){return client[_0x2cc1('0x2')](_0x2cc1('0x3'),{'body':_0x229a76,'log':'createOpenchannelMessage'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueue.js b/server/services/routing/rpc/openchannelQueue.js index 6f8f10d..1be48af 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 _0x8bfc=['openchannelPause','getOpenchannelQueues','Request','name','timeout','strategy','User','Agents','online'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x8bfc,0x9a));var _0xc8bf=function(_0x3da832,_0x2133f1){_0x3da832=_0x3da832-0x0;var _0xe602f2=_0x8bfc[_0x3da832];return _0xe602f2;};'use strict';var client=require('../client');exports[_0xc8bf('0x0')]=function(){return function(){return client[_0xc8bf('0x1')]('GetOpenchannelQueue',{'options':{'raw':![],'attributes':['id',_0xc8bf('0x2'),_0xc8bf('0x3'),_0xc8bf('0x4')],'include':[{'model':_0xc8bf('0x5'),'as':_0xc8bf('0x6'),'attributes':['id',_0xc8bf('0x2'),_0xc8bf('0x7'),_0xc8bf('0x8')]}]},'log':_0xc8bf('0x0')});};}; \ No newline at end of file +var _0xe968=['online','openchannelPause','../client','getOpenchannelQueues','Request','GetOpenchannelQueue','name','timeout','Agents'];(function(_0xb867a8,_0x926a63){var _0x1e5dcd=function(_0x1f3c72){while(--_0x1f3c72){_0xb867a8['push'](_0xb867a8['shift']());}};_0x1e5dcd(++_0x926a63);}(_0xe968,0x110));var _0x8e96=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xe968[_0x2dafbe];return _0x58a45a;};'use strict';var client=require(_0x8e96('0x0'));exports[_0x8e96('0x1')]=function(){return function(){return client[_0x8e96('0x2')](_0x8e96('0x3'),{'options':{'raw':![],'attributes':['id',_0x8e96('0x4'),_0x8e96('0x5'),'strategy'],'include':[{'model':'User','as':_0x8e96('0x6'),'attributes':['id',_0x8e96('0x4'),_0x8e96('0x7'),_0x8e96('0x8')]}]},'log':_0x8e96('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueueReport.js b/server/services/routing/rpc/openchannelQueueReport.js index e5c18d9..587d018 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 _0x1912=['update','UpdateOpenchannelQueueReport','DESC','../client','create','Request','CreateOpenchannelQueueReport'];(function(_0x39589b,_0x20f8a8){var _0x589229=function(_0x1d676a){while(--_0x1d676a){_0x39589b['push'](_0x39589b['shift']());}};_0x589229(++_0x20f8a8);}(_0x1912,0x192));var _0x2191=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x1912[_0x42cae2];return _0x5f256f;};'use strict';var client=require(_0x2191('0x0'));exports[_0x2191('0x1')]=function(_0x39a33e){return client[_0x2191('0x2')]('CreateOpenchannelQueueReport',{'body':_0x39a33e,'log':_0x2191('0x3')});};exports[_0x2191('0x4')]=function(_0x433c4f,_0x5002){return client['Request'](_0x2191('0x5'),{'body':_0x5002,'options':{'where':{'uniqueid':_0x433c4f},'order':[['id',_0x2191('0x6')]],'limit':0x1},'log':_0x2191('0x5')});}; \ No newline at end of file +var _0xcf5c=['update','Request','../client','create'];(function(_0x4aaa17,_0x5946ec){var _0x2a219b=function(_0x3a1dbe){while(--_0x3a1dbe){_0x4aaa17['push'](_0x4aaa17['shift']());}};_0x2a219b(++_0x5946ec);}(_0xcf5c,0x14e));var _0xccf5=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0xcf5c[_0x3bf83f];return _0x22c4a9;};'use strict';var client=require(_0xccf5('0x0'));exports[_0xccf5('0x1')]=function(_0x5c086f){return client['Request']('CreateOpenchannelQueueReport',{'body':_0x5c086f,'log':'CreateOpenchannelQueueReport'});};exports[_0xccf5('0x2')]=function(_0x519c9e,_0x5a1ed3){return client[_0xccf5('0x3')]('UpdateOpenchannelQueueReport',{'body':_0x5a1ed3,'options':{'where':{'uniqueid':_0x519c9e},'order':[['id','DESC']],'limit':0x1},'log':'UpdateOpenchannelQueueReport'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsInteraction.js b/server/services/routing/rpc/smsInteraction.js index bacc13f..cf6da7a 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 _0xc818=['../client','update','UpdateSmsInteraction','updateSmsInteraction','addTags','Request','AddTagsToSmsInteraction'];(function(_0x4ce04c,_0x186919){var _0x1b8dbe=function(_0x4aecc2){while(--_0x4aecc2){_0x4ce04c['push'](_0x4ce04c['shift']());}};_0x1b8dbe(++_0x186919);}(_0xc818,0x1e3));var _0x8c81=function(_0x3ea30b,_0x11287d){_0x3ea30b=_0x3ea30b-0x0;var _0x1170e3=_0xc818[_0x3ea30b];return _0x1170e3;};'use strict';var client=require(_0x8c81('0x0'));exports[_0x8c81('0x1')]=function(_0x2ebf7a,_0x42192c){return client['Request'](_0x8c81('0x2'),{'body':_0x42192c,'options':{'where':{'id':_0x2ebf7a}},'log':_0x8c81('0x3')});};exports[_0x8c81('0x4')]=function(_0x7e329f,_0x1a61ab){return client[_0x8c81('0x5')](_0x8c81('0x6'),{'body':_0x1a61ab,'options':{'where':{'id':_0x7e329f}},'log':'addTagsToSmsInteraction'});}; \ No newline at end of file +var _0x72b1=['AddTagsToSmsInteraction','addTagsToSmsInteraction','../client','Request','UpdateSmsInteraction','updateSmsInteraction','addTags'];(function(_0x45d80e,_0x459f24){var _0x277d8c=function(_0x55c935){while(--_0x55c935){_0x45d80e['push'](_0x45d80e['shift']());}};_0x277d8c(++_0x459f24);}(_0x72b1,0x16e));var _0x172b=function(_0x26dab6,_0x46c1d9){_0x26dab6=_0x26dab6-0x0;var _0x546225=_0x72b1[_0x26dab6];return _0x546225;};'use strict';var client=require(_0x172b('0x0'));exports['update']=function(_0x368075,_0x29189f){return client[_0x172b('0x1')](_0x172b('0x2'),{'body':_0x29189f,'options':{'where':{'id':_0x368075}},'log':_0x172b('0x3')});};exports[_0x172b('0x4')]=function(_0x2c1d6e,_0x558038){return client[_0x172b('0x1')](_0x172b('0x5'),{'body':_0x558038,'options':{'where':{'id':_0x2c1d6e}},'log':_0x172b('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsMessage.js b/server/services/routing/rpc/smsMessage.js index b37fead..a06add7 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 _0x0379=['Request','CreateSmsMessage','createSmsMessage','create'];(function(_0x18eeaa,_0x4380b6){var _0x23d240=function(_0x864c98){while(--_0x864c98){_0x18eeaa['push'](_0x18eeaa['shift']());}};_0x23d240(++_0x4380b6);}(_0x0379,0xdb));var _0x9037=function(_0xf85bbd,_0x5d52e8){_0xf85bbd=_0xf85bbd-0x0;var _0x5d4411=_0x0379[_0xf85bbd];return _0x5d4411;};'use strict';var client=require('../client');exports[_0x9037('0x0')]=function(_0x268a2f){return client[_0x9037('0x1')](_0x9037('0x2'),{'body':_0x268a2f,'log':_0x9037('0x3')});}; \ No newline at end of file +var _0x545c=['create','CreateSmsMessage'];(function(_0x827f28,_0x4b8f71){var _0x5ac046=function(_0x1416d4){while(--_0x1416d4){_0x827f28['push'](_0x827f28['shift']());}};_0x5ac046(++_0x4b8f71);}(_0x545c,0xc0));var _0xc545=function(_0x172747,_0x1732bd){_0x172747=_0x172747-0x0;var _0x509692=_0x545c[_0x172747];return _0x509692;};'use strict';var client=require('../client');exports[_0xc545('0x0')]=function(_0x5bda4b){return client['Request'](_0xc545('0x1'),{'body':_0x5bda4b,'log':'createSmsMessage'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsQueue.js b/server/services/routing/rpc/smsQueue.js index 5a2c47a..cafa9b0 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(_0x347be3,_0x418925){var _0x383683=function(_0x42ddae){while(--_0x42ddae){_0x347be3['push'](_0x347be3['shift']());}};_0x383683(++_0x418925);}(_0xe706,0xa3));var _0x6e70=function(_0xe0b81f,_0x1fb734){_0xe0b81f=_0xe0b81f-0x0;var _0x290e5e=_0xe706[_0xe0b81f];return _0x290e5e;};'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 _0xd8b0=['timeout','strategy','User','Agents','name','../client','getSmsQueues'];(function(_0x2ce60c,_0x33c3b6){var _0x3f0e21=function(_0x34eab8){while(--_0x34eab8){_0x2ce60c['push'](_0x2ce60c['shift']());}};_0x3f0e21(++_0x33c3b6);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var client=require(_0x0d8b('0x0'));exports[_0x0d8b('0x1')]=function(){return function(){return client['Request']('GetSmsQueue',{'options':{'raw':![],'attributes':['id','name',_0x0d8b('0x2'),_0x0d8b('0x3')],'include':[{'model':_0x0d8b('0x4'),'as':_0x0d8b('0x5'),'attributes':['id',_0x0d8b('0x6'),'online','smsPause']}]},'log':_0x0d8b('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsQueueReport.js b/server/services/routing/rpc/smsQueueReport.js index 9396a46..0f86610 100644 --- a/server/services/routing/rpc/smsQueueReport.js +++ b/server/services/routing/rpc/smsQueueReport.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x34e8=['create','Request','CreateSmsQueueReport','update','UpdateSmsQueueReport','DESC','../client'];(function(_0x2103ec,_0x1d428a){var _0x31ba73=function(_0x500f21){while(--_0x500f21){_0x2103ec['push'](_0x2103ec['shift']());}};_0x31ba73(++_0x1d428a);}(_0x34e8,0x12c));var _0x834e=function(_0x341052,_0x4a1130){_0x341052=_0x341052-0x0;var _0x4e5d31=_0x34e8[_0x341052];return _0x4e5d31;};'use strict';var client=require(_0x834e('0x0'));exports[_0x834e('0x1')]=function(_0x8b339){return client[_0x834e('0x2')]('CreateSmsQueueReport',{'body':_0x8b339,'log':_0x834e('0x3')});};exports[_0x834e('0x4')]=function(_0x472111,_0x31bf20){return client[_0x834e('0x2')](_0x834e('0x5'),{'body':_0x31bf20,'options':{'where':{'uniqueid':_0x472111},'order':[['id',_0x834e('0x6')]],'limit':0x1},'log':'UpdateSmsQueueReport'});}; \ No newline at end of file +var _0x34e8=['create','Request','CreateSmsQueueReport','update','UpdateSmsQueueReport','DESC','../client'];(function(_0x481707,_0xed06cd){var _0x23411e=function(_0xc45f8d){while(--_0xc45f8d){_0x481707['push'](_0x481707['shift']());}};_0x23411e(++_0xed06cd);}(_0x34e8,0x12c));var _0x834e=function(_0xd84c05,_0x2ffc76){_0xd84c05=_0xd84c05-0x0;var _0xabca02=_0x34e8[_0xd84c05];return _0xabca02;};'use strict';var client=require(_0x834e('0x0'));exports[_0x834e('0x1')]=function(_0x8b339){return client[_0x834e('0x2')]('CreateSmsQueueReport',{'body':_0x8b339,'log':_0x834e('0x3')});};exports[_0x834e('0x4')]=function(_0x472111,_0x31bf20){return client[_0x834e('0x2')](_0x834e('0x5'),{'body':_0x31bf20,'options':{'where':{'uniqueid':_0x472111},'order':[['id',_0x834e('0x6')]],'limit':0x1},'log':'UpdateSmsQueueReport'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/user.js b/server/services/routing/rpc/user.js index 2d82263..98c9798 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(_0x32e685,_0x3bcb0d){var _0x49652f=function(_0x17a7e6){while(--_0x17a7e6){_0x32e685['push'](_0x32e685['shift']());}};_0x49652f(++_0x3bcb0d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3054be,_0x1bdc8b){_0x3054be=_0x3054be-0x0;var _0x3df150=_0xa9e0[_0x3054be];return _0x3df150;};'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(_0x14f4b7,_0xd86c92){var _0x3a3c23=function(_0x1cbcd6){while(--_0x1cbcd6){_0x14f4b7['push'](_0x14f4b7['shift']());}};_0x3a3c23(++_0xd86c92);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0xa9e0[_0x4cf98e];return _0x1623ac;};'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 abacbbb..262b545 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 _0x9536=['update','UpdateWhatsappInteraction','addTags','Request','AddTagsToWhatsappInteraction','../client'];(function(_0x5052a8,_0x58e1f0){var _0x403f4a=function(_0x26c95e){while(--_0x26c95e){_0x5052a8['push'](_0x5052a8['shift']());}};_0x403f4a(++_0x58e1f0);}(_0x9536,0x179));var _0x6953=function(_0x1cec84,_0x101ec2){_0x1cec84=_0x1cec84-0x0;var _0x12b7d3=_0x9536[_0x1cec84];return _0x12b7d3;};'use strict';var client=require(_0x6953('0x0'));exports[_0x6953('0x1')]=function(_0x1a1c4e,_0x40b3c3){return client['Request'](_0x6953('0x2'),{'body':_0x40b3c3,'options':{'where':{'id':_0x1a1c4e}},'log':'updateWhatsappInteraction'});};exports[_0x6953('0x3')]=function(_0x3c32c7,_0x1dee7c){return client[_0x6953('0x4')](_0x6953('0x5'),{'body':_0x1dee7c,'options':{'where':{'id':_0x3c32c7}},'log':'addTagsToWhatsappInteraction'});}; \ No newline at end of file +var _0xf06c=['addTags','AddTagsToWhatsappInteraction','addTagsToWhatsappInteraction','../client','update','Request','updateWhatsappInteraction'];(function(_0x63e4d0,_0xd63831){var _0x1eb43d=function(_0x58361f){while(--_0x58361f){_0x63e4d0['push'](_0x63e4d0['shift']());}};_0x1eb43d(++_0xd63831);}(_0xf06c,0xc7));var _0xcf06=function(_0x451e4b,_0x278f62){_0x451e4b=_0x451e4b-0x0;var _0x141ed2=_0xf06c[_0x451e4b];return _0x141ed2;};'use strict';var client=require(_0xcf06('0x0'));exports[_0xcf06('0x1')]=function(_0x3a0fc6,_0x429b1c){return client[_0xcf06('0x2')]('UpdateWhatsappInteraction',{'body':_0x429b1c,'options':{'where':{'id':_0x3a0fc6}},'log':_0xcf06('0x3')});};exports[_0xcf06('0x4')]=function(_0x1d0c26,_0x49218b){return client[_0xcf06('0x2')](_0xcf06('0x5'),{'body':_0x49218b,'options':{'where':{'id':_0x1d0c26}},'log':_0xcf06('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappMessage.js b/server/services/routing/rpc/whatsappMessage.js index eb53d44..2d286b5 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 _0x45b9=['create','Request','CreateWhatsappMessage','createWhatsappMessage','../client'];(function(_0x5758c9,_0x3e7929){var _0x46892f=function(_0x314d05){while(--_0x314d05){_0x5758c9['push'](_0x5758c9['shift']());}};_0x46892f(++_0x3e7929);}(_0x45b9,0x121));var _0x945b=function(_0x16bf26,_0x224b74){_0x16bf26=_0x16bf26-0x0;var _0x377e93=_0x45b9[_0x16bf26];return _0x377e93;};'use strict';var client=require(_0x945b('0x0'));exports[_0x945b('0x1')]=function(_0x5a3d21){return client[_0x945b('0x2')](_0x945b('0x3'),{'body':_0x5a3d21,'log':_0x945b('0x4')});}; \ No newline at end of file +var _0xd85f=['create','Request','CreateWhatsappMessage','createWhatsappMessage'];(function(_0x154575,_0x3fc7db){var _0x2866f7=function(_0x1c0639){while(--_0x1c0639){_0x154575['push'](_0x154575['shift']());}};_0x2866f7(++_0x3fc7db);}(_0xd85f,0x10c));var _0xfd85=function(_0x4d6471,_0x4feab9){_0x4d6471=_0x4d6471-0x0;var _0x37caf8=_0xd85f[_0x4d6471];return _0x37caf8;};'use strict';var client=require('../client');exports[_0xfd85('0x0')]=function(_0x2a3f0d){return client[_0xfd85('0x1')](_0xfd85('0x2'),{'body':_0x2a3f0d,'log':_0xfd85('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappQueue.js b/server/services/routing/rpc/whatsappQueue.js index e9fc506..f2fc3de 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 _0xd1eb=['Agents','online','whatsappPause','getWhatsappQueues','Request','GetWhatsappQueue','name','User'];(function(_0x42cc1f,_0xe9eb20){var _0x175df5=function(_0x2f3e22){while(--_0x2f3e22){_0x42cc1f['push'](_0x42cc1f['shift']());}};_0x175df5(++_0xe9eb20);}(_0xd1eb,0x123));var _0xbd1e=function(_0x31e484,_0x4cdd87){_0x31e484=_0x31e484-0x0;var _0xebaaa2=_0xd1eb[_0x31e484];return _0xebaaa2;};'use strict';var client=require('../client');exports[_0xbd1e('0x0')]=function(){return function(){return client[_0xbd1e('0x1')](_0xbd1e('0x2'),{'options':{'raw':![],'attributes':['id',_0xbd1e('0x3'),'timeout','strategy'],'include':[{'model':_0xbd1e('0x4'),'as':_0xbd1e('0x5'),'attributes':['id',_0xbd1e('0x3'),_0xbd1e('0x6'),_0xbd1e('0x7')]}]},'log':_0xbd1e('0x0')});};}; \ No newline at end of file +var _0xde24=['Request','GetWhatsappQueue','name','timeout','User','Agents','online','whatsappPause','../client','getWhatsappQueues'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xde24,0x1e8));var _0x4de2=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xde24[_0xa464c9];return _0x3d73c4;};'use strict';var client=require(_0x4de2('0x0'));exports[_0x4de2('0x1')]=function(){return function(){return client[_0x4de2('0x2')](_0x4de2('0x3'),{'options':{'raw':![],'attributes':['id',_0x4de2('0x4'),_0x4de2('0x5'),'strategy'],'include':[{'model':_0x4de2('0x6'),'as':_0x4de2('0x7'),'attributes':['id',_0x4de2('0x4'),_0x4de2('0x8'),_0x4de2('0x9')]}]},'log':_0x4de2('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappQueueReport.js b/server/services/routing/rpc/whatsappQueueReport.js index 6e4a602..adad76b 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 _0xe5ff=['DESC','UpdateWhatsappQueueReport','../client','create','Request','CreateWhatsappQueueReport'];(function(_0x19a49f,_0x444d74){var _0x5351ae=function(_0x58b1ed){while(--_0x58b1ed){_0x19a49f['push'](_0x19a49f['shift']());}};_0x5351ae(++_0x444d74);}(_0xe5ff,0x1dc));var _0xfe5f=function(_0x24c19a,_0x413df0){_0x24c19a=_0x24c19a-0x0;var _0x4cb82d=_0xe5ff[_0x24c19a];return _0x4cb82d;};'use strict';var client=require(_0xfe5f('0x0'));exports[_0xfe5f('0x1')]=function(_0x225646){return client[_0xfe5f('0x2')](_0xfe5f('0x3'),{'body':_0x225646,'log':_0xfe5f('0x3')});};exports['update']=function(_0xca4ad4,_0x2d8a3a){return client['Request']('UpdateWhatsappQueueReport',{'body':_0x2d8a3a,'options':{'where':{'uniqueid':_0xca4ad4},'order':[['id',_0xfe5f('0x4')]],'limit':0x1},'log':_0xfe5f('0x5')});}; \ No newline at end of file +var _0x8d82=['Request','update','UpdateWhatsappQueueReport','DESC','../client'];(function(_0x1c1a3f,_0x5ee76d){var _0x345f75=function(_0x64b650){while(--_0x64b650){_0x1c1a3f['push'](_0x1c1a3f['shift']());}};_0x345f75(++_0x5ee76d);}(_0x8d82,0x6d));var _0x28d8=function(_0x57223b,_0x3f305c){_0x57223b=_0x57223b-0x0;var _0x261079=_0x8d82[_0x57223b];return _0x261079;};'use strict';var client=require(_0x28d8('0x0'));exports['create']=function(_0x2e7dfe){return client[_0x28d8('0x1')]('CreateWhatsappQueueReport',{'body':_0x2e7dfe,'log':'CreateWhatsappQueueReport'});};exports[_0x28d8('0x2')]=function(_0x4503b,_0x32dd16){return client['Request'](_0x28d8('0x3'),{'body':_0x32dd16,'options':{'where':{'uniqueid':_0x4503b},'order':[['id',_0x28d8('0x4')]],'limit':0x1},'log':_0x28d8('0x3')});}; \ 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 5e750da..9c3c279 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 _0xebe9=['name','toLowerCase','consequence','length','[%s][AGENT]\x20%s','map','message','join','stop','find','agents','timeout','rules','end','close','complete','next','agent','error','log','stack','validate','lodash','util','seq-queue','routing','./strategy','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number','info','format','[%s][AGENT][NAME:%s][STATUS:%s]'];(function(_0x145e9e,_0x2e6dd4){var _0x2264c2=function(_0x57d209){while(--_0x57d209){_0x145e9e['push'](_0x145e9e['shift']());}};_0x2264c2(++_0x2e6dd4);}(_0xebe9,0x18b));var _0x9ebe=function(_0x2b53aa,_0x37e02a){_0x2b53aa=_0x2b53aa-0x0;var _0x33791e=_0xebe9[_0x2b53aa];return _0x33791e;};'use strict';var schema=require(_0x9ebe('0x0'));var _=require(_0x9ebe('0x1'));var util=require(_0x9ebe('0x2'));var seqqueue=require(_0x9ebe('0x3'));var logger=require('../../../../config/logger')(_0x9ebe('0x4'));var strategy=require(_0x9ebe('0x5'));var queue=schema({'name':{'type':_0x9ebe('0x6'),'required':!![],'message':_0x9ebe('0x7')},'timeout':{'type':_0x9ebe('0x8'),'message':_0x9ebe('0x9')}});function writeLog(_0x32d621,_0xa784a5,_0x291528){return logger[_0x9ebe('0xa')](util[_0x9ebe('0xb')](_0x9ebe('0xc'),_0x32d621,_0xa784a5['name'],_0x291528));}function handleFindAgent(_0x2dbf37){return function(_0x38e1d5){return _0x38e1d5[_0x9ebe('0xd')][_0x9ebe('0xe')]()===_0x2dbf37['toLowerCase']();};}exports[_0x9ebe('0xf')]=function(_0x5a6f0e,_0xbd0b8d,_0x855092,_0x53720d){return function(_0x386467){try{var _0x35d0ab={'name':_0xbd0b8d[0x0],'timeout':_0xbd0b8d[0x1]};var _0x4a2289=queue[_0x9ebe('0x0')](_0x35d0ab,{'typecast':!![]});if(_0x4a2289[_0x9ebe('0x10')]){logger['error'](_0x9ebe('0x11'),_0x5a6f0e,_[_0x9ebe('0x12')](_0x4a2289,_0x9ebe('0x13'))[_0x9ebe('0x14')](',\x20'));_0x386467[_0x9ebe('0x15')]();}else{var _0x58edef=_[_0x9ebe('0x16')](_0x855092[_0x9ebe('0x17')],handleFindAgent(_0x35d0ab[_0x9ebe('0xd')]));if(_0x58edef){var _0x3623ea=(_0x35d0ab[_0x9ebe('0x18')]||0xa)*0x3e8;var _0x237ded,_0x55f9f6;var _0x59e6ad=seqqueue['createQueue'](_0x3623ea);_0x59e6ad['id']=_0x5a6f0e;_0x59e6ad['atimeout']=_0x3623ea;_0x59e6ad['channel']=_0x53720d['channel'];writeLog(_0x5a6f0e,_0x58edef,util[_0x9ebe('0xb')]('START:%s',_0x3623ea));_0x855092[_0x9ebe('0x19')][_0x5a6f0e]['on'](_0x9ebe('0x1a'),function(){logger[_0x9ebe('0xa')]('[%s][AGENT]\x20ROUTING\x20STOPPED',_0x5a6f0e);clearTimeout(_0x55f9f6);_0x55f9f6=undefined;_0x59e6ad[_0x9ebe('0x1b')]();if(_0x855092[_0x9ebe('0x19')][_0x5a6f0e]){delete _0x855092[_0x9ebe('0x19')][_0x5a6f0e];}_0x386467[_0x9ebe('0x15')]();});_0x855092[_0x9ebe('0x19')][_0x5a6f0e]['on'](_0x9ebe('0x1c'),function(){if(_0x855092[_0x9ebe('0x19')][_0x5a6f0e]){delete _0x855092[_0x9ebe('0x19')][_0x5a6f0e];}});_0x55f9f6=setTimeout(function(){logger['info']('[%s][AGENT]\x20ROUTING\x20END',_0x5a6f0e);clearTimeout(_0x55f9f6);_0x59e6ad[_0x9ebe('0x1b')]();_0x386467[_0x9ebe('0x1d')]();},_0x3623ea);strategy[_0x9ebe('0x1e')](_0x59e6ad,_0x58edef,_0x855092,_0x53720d);}else{logger[_0x9ebe('0x1f')]('[%s][AGENT]\x20agent\x20not\x20found\x20%s',_0x5a6f0e,_0x35d0ab[_0x9ebe('0xd')]);_0x386467[_0x9ebe('0x15')]();}}}catch(_0x478348){console[_0x9ebe('0x20')](_0x478348);logger[_0x9ebe('0x1f')]('[%s][QUEUE]\x20%s',_0x5a6f0e,_0x478348[_0x9ebe('0x21')]);_0x386467[_0x9ebe('0x15')]();}};}; \ No newline at end of file +var _0x943a=['join','find','agents','timeout','channel','START:%s','rules','end','[%s][AGENT]\x20ROUTING\x20STOPPED','close','complete','next','agent','error','[%s][AGENT]\x20agent\x20not\x20found\x20%s','stop','log','[%s][QUEUE]\x20%s','stack','lodash','seq-queue','../../../../config/logger','routing','./strategy','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number','info','format','name','toLowerCase','validate','length','[%s][AGENT]\x20%s','map'];(function(_0x2df10c,_0x29460a){var _0x360f6d=function(_0x24a21d){while(--_0x24a21d){_0x2df10c['push'](_0x2df10c['shift']());}};_0x360f6d(++_0x29460a);}(_0x943a,0x10f));var _0xa943=function(_0x4885af,_0x1853c7){_0x4885af=_0x4885af-0x0;var _0x4a0358=_0x943a[_0x4885af];return _0x4a0358;};'use strict';var schema=require('validate');var _=require(_0xa943('0x0'));var util=require('util');var seqqueue=require(_0xa943('0x1'));var logger=require(_0xa943('0x2'))(_0xa943('0x3'));var strategy=require(_0xa943('0x4'));var queue=schema({'name':{'type':_0xa943('0x5'),'required':!![],'message':_0xa943('0x6')},'timeout':{'type':_0xa943('0x7'),'message':_0xa943('0x8')}});function writeLog(_0x261413,_0x3ec5e5,_0x5a33c8){return logger[_0xa943('0x9')](util[_0xa943('0xa')]('[%s][AGENT][NAME:%s][STATUS:%s]',_0x261413,_0x3ec5e5[_0xa943('0xb')],_0x5a33c8));}function handleFindAgent(_0x7f9ed){return function(_0x1893b4){return _0x1893b4[_0xa943('0xb')][_0xa943('0xc')]()===_0x7f9ed[_0xa943('0xc')]();};}exports['consequence']=function(_0x50dab8,_0xa10f6,_0x1ece39,_0xb77279){return function(_0x25e69a){try{var _0x212604={'name':_0xa10f6[0x0],'timeout':_0xa10f6[0x1]};var _0x1bbf11=queue[_0xa943('0xd')](_0x212604,{'typecast':!![]});if(_0x1bbf11[_0xa943('0xe')]){logger['error'](_0xa943('0xf'),_0x50dab8,_[_0xa943('0x10')](_0x1bbf11,'message')[_0xa943('0x11')](',\x20'));_0x25e69a['stop']();}else{var _0x44febf=_[_0xa943('0x12')](_0x1ece39[_0xa943('0x13')],handleFindAgent(_0x212604['name']));if(_0x44febf){var _0x5f5797=(_0x212604[_0xa943('0x14')]||0xa)*0x3e8;var _0x28f658,_0x348e38;var _0x4c513a=seqqueue['createQueue'](_0x5f5797);_0x4c513a['id']=_0x50dab8;_0x4c513a['atimeout']=_0x5f5797;_0x4c513a[_0xa943('0x15')]=_0xb77279[_0xa943('0x15')];writeLog(_0x50dab8,_0x44febf,util[_0xa943('0xa')](_0xa943('0x16'),_0x5f5797));_0x1ece39[_0xa943('0x17')][_0x50dab8]['on'](_0xa943('0x18'),function(){logger[_0xa943('0x9')](_0xa943('0x19'),_0x50dab8);clearTimeout(_0x348e38);_0x348e38=undefined;_0x4c513a[_0xa943('0x1a')]();if(_0x1ece39[_0xa943('0x17')][_0x50dab8]){delete _0x1ece39[_0xa943('0x17')][_0x50dab8];}_0x25e69a['stop']();});_0x1ece39[_0xa943('0x17')][_0x50dab8]['on'](_0xa943('0x1b'),function(){if(_0x1ece39[_0xa943('0x17')][_0x50dab8]){delete _0x1ece39[_0xa943('0x17')][_0x50dab8];}});_0x348e38=setTimeout(function(){logger[_0xa943('0x9')]('[%s][AGENT]\x20ROUTING\x20END',_0x50dab8);clearTimeout(_0x348e38);_0x4c513a[_0xa943('0x1a')]();_0x25e69a[_0xa943('0x1c')]();},_0x5f5797);strategy[_0xa943('0x1d')](_0x4c513a,_0x44febf,_0x1ece39,_0xb77279);}else{logger[_0xa943('0x1e')](_0xa943('0x1f'),_0x50dab8,_0x212604[_0xa943('0xb')]);_0x25e69a[_0xa943('0x20')]();}}}catch(_0x310d0e){console[_0xa943('0x21')](_0x310d0e);logger[_0xa943('0x1e')](_0xa943('0x22'),_0x50dab8,_0x310d0e[_0xa943('0x23')]);_0x25e69a['stop']();}};}; \ 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 07bfb35..87f3207 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 _0x8cc5=['AccountId','InteractionId','created','isEmpty','body','getMustacheRender','Message','create','then','info','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','LexRuntime','$LATEST','message','toString','postText','next','amazonlex','providerName','providerResponse','Failed','moment','aws-sdk','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','isNil','UserId','[%s][AMAZONLEX]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','contact','YYYY-MM-DD\x20HH:mm:ss','out','channel','sms','whatsapp','phone','interaction','chat','account','upperFirst'];(function(_0x365a63,_0x42141c){var _0x78624f=function(_0x4727d2){while(--_0x4727d2){_0x365a63['push'](_0x365a63['shift']());}};_0x78624f(++_0x42141c);}(_0x8cc5,0xb7));var _0x58cc=function(_0x1e4f2d,_0x22e2bb){_0x1e4f2d=_0x1e4f2d-0x0;var _0xd05ce5=_0x8cc5[_0x1e4f2d];return _0xd05ce5;};'use strict';var _=require('lodash');var moment=require(_0x58cc('0x0'));var AWS=require(_0x58cc('0x1'));var utils=require('./utils');var logger=require('../../../../config/logger')(_0x58cc('0x2'));var rpc={'chatMessage':require(_0x58cc('0x3')),'openchannelMessage':require(_0x58cc('0x4')),'mailMessage':require(_0x58cc('0x5')),'smsMessage':require(_0x58cc('0x6')),'faxMessage':require(_0x58cc('0x7')),'whatsappMessage':require(_0x58cc('0x8'))};exports[_0x58cc('0x9')]=function(_0x4f2074,_0x3a727d){return function(_0xc8af43){try{if(!_[_0x58cc('0xa')](this['interaction'][_0x58cc('0xb')])){logger['info'](_0x58cc('0xc'),_0x4f2074,_0x58cc('0xd'));return _0xc8af43['next']();}var _0x6757e={'ContactId':this[_0x58cc('0xe')]['id'],'sentAt':moment()['format'](_0x58cc('0xf')),'direction':_0x58cc('0x10')};if(this[_0x58cc('0x11')]===_0x58cc('0x12')||this[_0x58cc('0x11')]===_0x58cc('0x13')){_0x6757e[_0x58cc('0x14')]=this[_0x58cc('0x15')]['phone'];}var _0x4da3d9=this[_0x58cc('0x11')];if(_0x4da3d9===_0x58cc('0x16')){_0x6757e['ChatWebsiteId']=this[_0x58cc('0x17')]['id'];}else{_0x6757e[_[_0x58cc('0x18')](_0x4da3d9)+_0x58cc('0x19')]=this['account']['id'];}_0x6757e[_[_0x58cc('0x18')](_0x4da3d9)+_0x58cc('0x1a')]=this['interaction']['id'];if(this[_0x58cc('0x15')][_0x58cc('0x1b')]){var _0xe9b047=_0x3a727d[0x4];if(!_[_0x58cc('0x1c')](_0xe9b047)){_0x6757e[_0x58cc('0x1d')]=utils[_0x58cc('0x1e')](_0xe9b047,this);return rpc[_0x4da3d9+_0x58cc('0x1f')][_0x58cc('0x20')](_0x6757e)[_0x58cc('0x21')](function(_0x4b3654){logger[_0x58cc('0x22')](_0x58cc('0xc'),_0x4f2074,_0x6757e['body']);})[_0x58cc('0x23')](function(_0x4930c4){logger[_0x58cc('0x24')](_0x58cc('0xc'),_0x4f2074,JSON[_0x58cc('0x25')](_0x4930c4));})[_0x58cc('0x26')](function(){logger['info'](_0x58cc('0x27'),_0x4f2074);_0xc8af43['stop']();});}else{logger['info'](_0x58cc('0x28'),_0x4f2074);_0xc8af43[_0x58cc('0x29')]();}}else{var _0x344c9b=this;var _0x283b97=new AWS[(_0x58cc('0x2a'))]({'accessKeyId':_0x3a727d[0x0],'secretAccessKey':_0x3a727d[0x1],'region':_0x3a727d[0x2]});var _0x1cae0c={'botAlias':_0x58cc('0x2b'),'botName':_0x3a727d[0x3],'inputText':this[_0x58cc('0x2c')][_0x58cc('0x1d')],'userId':this[_0x58cc('0x11')]+':'+this['interaction']['id'][_0x58cc('0x2d')]()};_0x283b97[_0x58cc('0x2e')](_0x1cae0c,function(_0x56c819,_0x1631e9){if(_0x56c819){logger['error']('[%s][AMAZONLEX]\x20%s',_0x4f2074,_0x56c819[_0x58cc('0x2c')]);_0xc8af43[_0x58cc('0x2f')]();}else if(_0x1631e9&&_0x1631e9[_0x58cc('0x2c')]){_0x344c9b[_0x58cc('0x1d')][_0x58cc('0x30')]=_0x1631e9;_0x6757e[_0x58cc('0x1d')]=_0x1631e9[_0x58cc('0x2c')];_0x6757e[_0x58cc('0x31')]=_0x58cc('0x30');_0x6757e[_0x58cc('0x32')]=JSON[_0x58cc('0x25')](_0x1631e9);return rpc[_0x4da3d9+_0x58cc('0x1f')]['create'](_0x6757e)[_0x58cc('0x21')](function(_0x299126){logger[_0x58cc('0x22')]('[%s][AMAZONLEX]\x20%s',_0x4f2074,_0x6757e[_0x58cc('0x1d')]);if(_0x1631e9['dialogState']==_0x58cc('0x33')){_0xc8af43[_0x58cc('0x2f')]();}else{_0xc8af43['stop']();}})[_0x58cc('0x23')](function(_0x4bb656){logger[_0x58cc('0x24')]('[%s][AMAZONLEX]\x20%s',_0x4f2074,JSON['stringify'](_0x4bb656));_0xc8af43['next']();});}else{_0xc8af43[_0x58cc('0x2f')]();}});}}catch(_0x466a1e){logger[_0x58cc('0x24')](_0x58cc('0xc'),_0x4f2074,JSON[_0x58cc('0x25')](_0x466a1e));_0xc8af43[_0x58cc('0x29')]();}};}; \ No newline at end of file +var _0xfd2e=['isNil','interaction','UserId','info','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','contact','YYYY-MM-DD\x20HH:mm:ss','out','sms','channel','whatsapp','chat','upperFirst','AccountId','account','InteractionId','created','isEmpty','body','getMustacheRender','create','then','[%s][AMAZONLEX]\x20%s','catch','error','stringify','finally','stop','message','toString','postText','next','amazonlex','Message','dialogState','lodash','./utils','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage'];(function(_0x5d3d26,_0x517133){var _0x436598=function(_0x5a3802){while(--_0x5a3802){_0x5d3d26['push'](_0x5d3d26['shift']());}};_0x436598(++_0x517133);}(_0xfd2e,0xa1));var _0xefd2=function(_0x59d544,_0x52fb1c){_0x59d544=_0x59d544-0x0;var _0x3a17e3=_0xfd2e[_0x59d544];return _0x3a17e3;};'use strict';var _=require(_0xefd2('0x0'));var moment=require('moment');var AWS=require('aws-sdk');var utils=require(_0xefd2('0x1'));var logger=require('../../../../config/logger')('routing');var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require(_0xefd2('0x2')),'mailMessage':require(_0xefd2('0x3')),'smsMessage':require(_0xefd2('0x4')),'faxMessage':require(_0xefd2('0x5')),'whatsappMessage':require(_0xefd2('0x6'))};exports['consequence']=function(_0x2f4862,_0x55f3c5){return function(_0x499e95){try{if(!_[_0xefd2('0x7')](this[_0xefd2('0x8')][_0xefd2('0x9')])){logger[_0xefd2('0xa')]('[%s][AMAZONLEX]\x20%s',_0x2f4862,_0xefd2('0xb'));return _0x499e95['next']();}var _0x1e960b={'ContactId':this[_0xefd2('0xc')]['id'],'sentAt':moment()['format'](_0xefd2('0xd')),'direction':_0xefd2('0xe')};if(this['channel']===_0xefd2('0xf')||this[_0xefd2('0x10')]===_0xefd2('0x11')){_0x1e960b['phone']=this[_0xefd2('0x8')]['phone'];}var _0x2913b7=this[_0xefd2('0x10')];if(_0x2913b7===_0xefd2('0x12')){_0x1e960b['ChatWebsiteId']=this['account']['id'];}else{_0x1e960b[_[_0xefd2('0x13')](_0x2913b7)+_0xefd2('0x14')]=this[_0xefd2('0x15')]['id'];}_0x1e960b[_[_0xefd2('0x13')](_0x2913b7)+_0xefd2('0x16')]=this[_0xefd2('0x8')]['id'];if(this['interaction'][_0xefd2('0x17')]){var _0x117851=_0x55f3c5[0x4];if(!_[_0xefd2('0x18')](_0x117851)){_0x1e960b[_0xefd2('0x19')]=utils[_0xefd2('0x1a')](_0x117851,this);return rpc[_0x2913b7+'Message'][_0xefd2('0x1b')](_0x1e960b)[_0xefd2('0x1c')](function(_0x329513){logger['info'](_0xefd2('0x1d'),_0x2f4862,_0x1e960b[_0xefd2('0x19')]);})[_0xefd2('0x1e')](function(_0xaa7a23){logger[_0xefd2('0x1f')](_0xefd2('0x1d'),_0x2f4862,JSON[_0xefd2('0x20')](_0xaa7a23));})[_0xefd2('0x21')](function(){logger[_0xefd2('0xa')]('[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!',_0x2f4862);_0x499e95['stop']();});}else{logger[_0xefd2('0xa')]('[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!',_0x2f4862);_0x499e95[_0xefd2('0x22')]();}}else{var _0x398fc5=this;var _0xd63410=new AWS['LexRuntime']({'accessKeyId':_0x55f3c5[0x0],'secretAccessKey':_0x55f3c5[0x1],'region':_0x55f3c5[0x2]});var _0x4cdeb1={'botAlias':'$LATEST','botName':_0x55f3c5[0x3],'inputText':this[_0xefd2('0x23')]['body'],'userId':this[_0xefd2('0x10')]+':'+this['interaction']['id'][_0xefd2('0x24')]()};_0xd63410[_0xefd2('0x25')](_0x4cdeb1,function(_0x7cf08,_0x63b097){if(_0x7cf08){logger['error']('[%s][AMAZONLEX]\x20%s',_0x2f4862,_0x7cf08['message']);_0x499e95[_0xefd2('0x26')]();}else if(_0x63b097&&_0x63b097[_0xefd2('0x23')]){_0x398fc5['body'][_0xefd2('0x27')]=_0x63b097;_0x1e960b['body']=_0x63b097[_0xefd2('0x23')];_0x1e960b['providerName']=_0xefd2('0x27');_0x1e960b['providerResponse']=JSON[_0xefd2('0x20')](_0x63b097);return rpc[_0x2913b7+_0xefd2('0x28')]['create'](_0x1e960b)['then'](function(_0x4f8f5a){logger['info'](_0xefd2('0x1d'),_0x2f4862,_0x1e960b[_0xefd2('0x19')]);if(_0x63b097[_0xefd2('0x29')]=='Failed'){_0x499e95[_0xefd2('0x26')]();}else{_0x499e95['stop']();}})['catch'](function(_0x3535a9){logger['error'](_0xefd2('0x1d'),_0x2f4862,JSON['stringify'](_0x3535a9));_0x499e95[_0xefd2('0x26')]();});}else{_0x499e95[_0xefd2('0x26')]();}});}}catch(_0x2cf28d){logger[_0xefd2('0x1f')](_0xefd2('0x1d'),_0x2f4862,JSON['stringify'](_0x2cf28d));_0x499e95[_0xefd2('0x22')]();}};}; \ 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 e54c1f0..4b7d00f 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 _0xb7fd=['One\x20Time\x20already\x20sent','contact','mail','body','getMustacheRender','message','from','read','subject','Re:','Re:\x20','chat','account','upperFirst','InteractionId','Message','service','Smtp','host','secure','authentication','auth','user','pass','inReplyTo','messageId','html','replace','','headers','auto-replied','All','then','[%s][AUTOREPLY]\x20SMTP\x20SENT','create','stringify','catch','error','finally','resolve','Interaction','update','[%s][AUTOREPLY][autoreplyExecuted]\x20%s','[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s','lodash','moment','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/whatsappInteraction','consequence','channel','isAutoreply','info','next','isNil','created','interaction','[%s][AUTOREPLY]\x20%s','Autoreply\x20already\x20sent','autoreplyExecuted'];(function(_0x2ad353,_0x37b155){var _0x47f95c=function(_0x21b986){while(--_0x21b986){_0x2ad353['push'](_0x2ad353['shift']());}};_0x47f95c(++_0x37b155);}(_0xb7fd,0xf9));var _0xdb7f=function(_0x47a4f5,_0x262a3d){_0x47a4f5=_0x47a4f5-0x0;var _0x5cdb8e=_0xb7fd[_0x47a4f5];return _0x5cdb8e;};'use strict';var _=require(_0xdb7f('0x0'));var moment=require(_0xdb7f('0x1'));var utils=require('./utils');var logger=require(_0xdb7f('0x2'))(_0xdb7f('0x3'));var rpc={'chatMessage':require(_0xdb7f('0x4')),'openchannelMessage':require(_0xdb7f('0x5')),'mailMessage':require(_0xdb7f('0x6')),'smsMessage':require(_0xdb7f('0x7')),'faxMessage':require(_0xdb7f('0x8')),'whatsappMessage':require('../../rpc/whatsappMessage'),'chatInteraction':require(_0xdb7f('0x9')),'openchannelInteraction':require(_0xdb7f('0xa')),'mailInteraction':require('../../rpc/mailInteraction'),'smsInteraction':require('../../rpc/smsInteraction'),'faxInteraction':require('../../rpc/faxInteraction'),'whatsappInteraction':require(_0xdb7f('0xb'))};var mailRpc=require('../../mailRpc');exports[_0xdb7f('0xc')]=function(_0xcb27fd,_0x2505d8,_0x1fc952,_0x1469b1){return function(_0x1d2112){try{var _0xb4af2b=this[_0xdb7f('0xd')];if(_0xb4af2b==='mail'&&_0x1469b1['body'][_0xdb7f('0xe')]){logger[_0xdb7f('0xf')]('[%s][AUTOREPLY]\x20%s',_0xcb27fd,'Autoreply\x20not\x20executed\x20(message\x20is\x20autoreply)');return _0x1d2112[_0xdb7f('0x10')]();}if(_0x2505d8[0x0]==='1'&&(_[_0xdb7f('0x11')](this['interaction'][_0xdb7f('0x12')])||!this[_0xdb7f('0x13')]['created'])){logger[_0xdb7f('0xf')](_0xdb7f('0x14'),_0xcb27fd,_0xdb7f('0x15'));return _0x1d2112[_0xdb7f('0x10')]();}if(_0x2505d8[0x0]==='2'&&this[_0xdb7f('0x13')][_0xdb7f('0x16')]){logger[_0xdb7f('0xf')]('[%s][AUTOREPLY][autoreplyExecuted]\x20%s',_0xcb27fd,_0xdb7f('0x17'));return _0x1d2112[_0xdb7f('0x10')]();}var _0x4bfe24={'ContactId':this[_0xdb7f('0x18')]['id'],'sentAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'direction':'out'};if(this[_0xdb7f('0xd')]===_0xdb7f('0x19')){_0x4bfe24[_0xdb7f('0x1a')]=utils['getMustacheRender'](_0x2505d8[0x2],this);}else{_0x4bfe24[_0xdb7f('0x1a')]=utils[_0xdb7f('0x1b')](_0x2505d8[0x1],this);}if(this[_0xdb7f('0x1c')]){_0x4bfe24['to']=this[_0xdb7f('0x1c')][_0xdb7f('0x1d')]||'';if(this[_0xdb7f('0xd')]===_0xdb7f('0x19')&&_0x2505d8[0x1]==='1'){_0x4bfe24['cc']=this[_0xdb7f('0x1c')]['cc']||'';}_0x4bfe24[_0xdb7f('0x1d')]=this[_0xdb7f('0x1c')]['to']||'';_0x4bfe24['phone']=this['message']['phone']||'';_0x4bfe24[_0xdb7f('0x1e')]=!![];if(this[_0xdb7f('0x1c')]['subject']){_0x4bfe24[_0xdb7f('0x1f')]='';_0x4bfe24['subject']+=_['startsWith'](this[_0xdb7f('0x1c')][_0xdb7f('0x1f')],_0xdb7f('0x20'))?'':_0xdb7f('0x21');_0x4bfe24[_0xdb7f('0x1f')]+=this[_0xdb7f('0x1c')][_0xdb7f('0x1f')];}}if(this[_0xdb7f('0xd')]===_0xdb7f('0x22')){_0x4bfe24['ChatWebsiteId']=this[_0xdb7f('0x23')]['id'];}else{_0x4bfe24[_[_0xdb7f('0x24')](this['channel'])+'AccountId']=this[_0xdb7f('0x23')]['id'];}_0x4bfe24[_[_0xdb7f('0x24')](this[_0xdb7f('0xd')])+_0xdb7f('0x25')]=this['interaction']['id'];var _0x3f8d12=this[_0xdb7f('0x13')];if(rpc[this[_0xdb7f('0xd')]+_0xdb7f('0x26')]){if(this['channel']===_0xdb7f('0x19')){var _0x5e28c9={'tls':{'rejectUnauthorized':![]}};if(this['account']['Smtp']['service']){_0x5e28c9[_0xdb7f('0x27')]=this[_0xdb7f('0x23')]['Smtp']['service'];}else{_0x5e28c9['host']=this[_0xdb7f('0x23')][_0xdb7f('0x28')][_0xdb7f('0x29')];_0x5e28c9['port']=this[_0xdb7f('0x23')][_0xdb7f('0x28')]['port'];_0x5e28c9['secure']=this['account'][_0xdb7f('0x28')][_0xdb7f('0x2a')];}if(this[_0xdb7f('0x23')]['Smtp'][_0xdb7f('0x2b')]){_0x5e28c9[_0xdb7f('0x2c')]={'user':this[_0xdb7f('0x23')][_0xdb7f('0x28')][_0xdb7f('0x2d')],'pass':this[_0xdb7f('0x23')][_0xdb7f('0x28')][_0xdb7f('0x2e')]};}_0x4bfe24[_0xdb7f('0x2f')]=this[_0xdb7f('0x1c')][_0xdb7f('0x30')];_0x4bfe24[_0xdb7f('0x31')]=''+_[_0xdb7f('0x32')](_0x4bfe24[_0xdb7f('0x1a')],'','replace','';_0xdd82a5[_0x60b7('0x36')]={'Auto-Submitted':_0x60b7('0x37'),'X-Auto-Response-Suppress':'All','Precedence':_0x60b7('0x38')};return mailRpc[_0x60b7('0x39')](_0x4c3aa5,_0xdd82a5)[_0x60b7('0x3a')](function(_0x4f3896){logger['info']('[%s][AUTOREPLY]\x20SMTP\x20SENT',_0x2f48ac);_0xdd82a5[_0x60b7('0x30')]=_0x4f3896[_0x60b7('0x1c')][_0x60b7('0x30')];return rpc[_0x461e53+_0x60b7('0x3b')][_0x60b7('0x3c')](_0xdd82a5);})[_0x60b7('0x3a')](function(_0x5cebd4){logger[_0x60b7('0x11')]('[%s][AUTOREPLY]\x20%s',_0x2f48ac,JSON['stringify'](_0x5cebd4));})[_0x60b7('0x3d')](function(_0x2e91d4){logger[_0x60b7('0x3e')]('[RPC][%s][AUTOREPLY]\x20%s',_0x2f48ac,JSON['stringify'](_0x2e91d4));})['finally'](function(){Promise[_0x60b7('0x3f')]()['then'](function(){if(_0x15e23f[0x0]!=='2'||_0x138103[_0x60b7('0x17')])return;return rpc[_0x461e53+'Interaction'][_0x60b7('0x40')](_0x138103['id'],{'autoreplyExecuted':!![]})['then'](function(_0x5f54e8){logger[_0x60b7('0x11')]('[%s][AUTOREPLY][autoreplyExecuted]\x20%s',_0x2f48ac,JSON['stringify'](_0x5f54e8));})['catch'](function(_0x368ef3){logger['error'](_0x60b7('0x41'),_0x2f48ac,JSON[_0x60b7('0x42')](_0x368ef3));});})[_0x60b7('0x3a')](function(){_0x5d08e1[_0x60b7('0x14')]();});});}else{return rpc[this[_0x60b7('0xe')]+'Message'][_0x60b7('0x3c')](_0xdd82a5)[_0x60b7('0x3a')](function(_0x1698c9){logger['info'](_0x60b7('0x12'),_0x2f48ac,_0xdd82a5[_0x60b7('0xf')]);})[_0x60b7('0x3d')](function(_0x3341fa){logger[_0x60b7('0x3e')]('[%s][AUTOREPLY]\x20%s',_0x2f48ac,JSON[_0x60b7('0x42')](_0x3341fa));})['finally'](function(){Promise[_0x60b7('0x3f')]()['then'](function(){if(_0x15e23f[0x0]!=='2'||_0x138103['autoreplyExecuted'])return;return rpc[_0x461e53+_0x60b7('0x43')][_0x60b7('0x40')](_0x138103['id'],{'autoreplyExecuted':!![]})['then'](function(_0x252f6c){logger['info']('[%s][AUTOREPLY][autoreplyExecuted]\x20%s',_0x2f48ac,JSON[_0x60b7('0x42')](_0x252f6c));})[_0x60b7('0x3d')](function(_0x2b00fb){logger[_0x60b7('0x3e')](_0x60b7('0x41'),_0x2f48ac,JSON[_0x60b7('0x42')](_0x2b00fb));});})[_0x60b7('0x3a')](function(){_0x5d08e1['next']();});});}}}catch(_0x4aa970){logger[_0x60b7('0x3e')]('[%s][AUTOREPLY]\x20%s',_0x2f48ac,JSON[_0x60b7('0x42')](_0x4aa970));_0x5d08e1[_0x60b7('0x44')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/close.js b/server/services/routing/server/applications/close.js index e4be2a7..a919513 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 _0x139d=['system','channel','Interaction','update','interaction','then','[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!','catch','error','[%s][CLOSE]\x20%s','stringify','finally','stop','moment','../../../../config/logger','routing','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/whatsappInteraction','consequence','info','[%s][CLOSE]\x20reason\x20%s'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x139d,0x1ed));var _0xd139=function(_0x3e3a61,_0x145534){_0x3e3a61=_0x3e3a61-0x0;var _0x3c7638=_0x139d[_0x3e3a61];return _0x3c7638;};'use strict';var moment=require(_0xd139('0x0'));var logger=require(_0xd139('0x1'))(_0xd139('0x2'));var rpc={'chatInteraction':require(_0xd139('0x3')),'openchannelInteraction':require(_0xd139('0x4')),'smsInteraction':require(_0xd139('0x5')),'mailInteraction':require(_0xd139('0x6')),'faxInteraction':require('../../rpc/faxInteraction'),'whatsappInteraction':require(_0xd139('0x7'))};exports[_0xd139('0x8')]=function(_0x492b34,_0x13d3ee,_0x2dcc90,_0x3e31db){return function(_0x15cc67){try{logger[_0xd139('0x9')](_0xd139('0xa'),_0x492b34,_0x13d3ee[0x0]);var _0x48eccc={'closed':0x1,'closedAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'closeReason':_0xd139('0xb'),'disposition':_0x13d3ee[0x0]};if(rpc[_0x3e31db[_0xd139('0xc')]+_0xd139('0xd')]){rpc[_0x3e31db[_0xd139('0xc')]+_0xd139('0xd')][_0xd139('0xe')](_0x3e31db[_0xd139('0xf')]['id'],_0x48eccc)[_0xd139('0x10')](function(_0x3aa2e0){logger[_0xd139('0x9')](_0xd139('0x11'),_0x492b34,_0x3e31db['interaction']['id']);})[_0xd139('0x12')](function(_0x3cd090){logger[_0xd139('0x13')](_0xd139('0x14'),_0x492b34,JSON[_0xd139('0x15')](_0x3cd090));})[_0xd139('0x16')](function(){_0x15cc67['stop']();});}}catch(_0x29759e){logger[_0xd139('0x13')](_0xd139('0x14'),_0x492b34,JSON[_0xd139('0x15')](_0x29759e));_0x15cc67[_0xd139('0x17')]();}};}; \ No newline at end of file +var _0x8ec4=['info','[%s][CLOSE]\x20reason\x20%s','format','YYYY-MM-DD\x20HH:mm:ss','system','channel','Interaction','update','interaction','then','catch','error','[%s][CLOSE]\x20%s','stringify','finally','stop','moment','../../../../config/logger','routing','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','consequence'];(function(_0x35e08a,_0x27c739){var _0x2ead21=function(_0x59e6b8){while(--_0x59e6b8){_0x35e08a['push'](_0x35e08a['shift']());}};_0x2ead21(++_0x27c739);}(_0x8ec4,0x13c));var _0x48ec=function(_0x1600bc,_0x19550b){_0x1600bc=_0x1600bc-0x0;var _0x2dd4f9=_0x8ec4[_0x1600bc];return _0x2dd4f9;};'use strict';var moment=require(_0x48ec('0x0'));var logger=require(_0x48ec('0x1'))(_0x48ec('0x2'));var rpc={'chatInteraction':require(_0x48ec('0x3')),'openchannelInteraction':require(_0x48ec('0x4')),'smsInteraction':require(_0x48ec('0x5')),'mailInteraction':require(_0x48ec('0x6')),'faxInteraction':require(_0x48ec('0x7')),'whatsappInteraction':require('../../rpc/whatsappInteraction')};exports[_0x48ec('0x8')]=function(_0x32b6b3,_0x3d48a8,_0x666eb7,_0x5a809f){return function(_0x3e7c9d){try{logger[_0x48ec('0x9')](_0x48ec('0xa'),_0x32b6b3,_0x3d48a8[0x0]);var _0xd41c8d={'closed':0x1,'closedAt':moment()[_0x48ec('0xb')](_0x48ec('0xc')),'closeReason':_0x48ec('0xd'),'disposition':_0x3d48a8[0x0]};if(rpc[_0x5a809f[_0x48ec('0xe')]+_0x48ec('0xf')]){rpc[_0x5a809f[_0x48ec('0xe')]+_0x48ec('0xf')][_0x48ec('0x10')](_0x5a809f[_0x48ec('0x11')]['id'],_0xd41c8d)[_0x48ec('0x12')](function(_0x5f0943){logger[_0x48ec('0x9')]('[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!',_0x32b6b3,_0x5a809f[_0x48ec('0x11')]['id']);})[_0x48ec('0x13')](function(_0x2c15d5){logger[_0x48ec('0x14')](_0x48ec('0x15'),_0x32b6b3,JSON[_0x48ec('0x16')](_0x2c15d5));})[_0x48ec('0x17')](function(){_0x3e7c9d[_0x48ec('0x18')]();});}}catch(_0x50898e){logger[_0x48ec('0x14')](_0x48ec('0x15'),_0x32b6b3,JSON['stringify'](_0x50898e));_0x3e7c9d[_0x48ec('0x18')]();}};}; \ 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 780769e..7b9fe58 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 _0x1cb9=['contact','format','YYYY-MM-DD\x20HH:mm:ss','out','channel','sms','whatsapp','phone','chat','upperFirst','AccountId','InteractionId','interaction','isEmpty','getMustacheRender','Message','create','then','info','catch','stringify','stop','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','textRequest','message','body','dialogflow','result','fulfillment','speech','providerResponse','metadata','endConversation','error','lodash','apiai-promise','md5','./utils','../../../../config/logger','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','isNil','UserId','[%s][DIALOGFLOW]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next'];(function(_0xc79303,_0x1dbf29){var _0x1e193d=function(_0x53692a){while(--_0x53692a){_0xc79303['push'](_0xc79303['shift']());}};_0x1e193d(++_0x1dbf29);}(_0x1cb9,0x14e));var _0x91cb=function(_0x36c2c9,_0x2caaff){_0x36c2c9=_0x36c2c9-0x0;var _0x2f5df9=_0x1cb9[_0x36c2c9];return _0x2f5df9;};'use strict';var _=require(_0x91cb('0x0'));var moment=require('moment');var apiai=require(_0x91cb('0x1'));var md5=require(_0x91cb('0x2'));var utils=require(_0x91cb('0x3'));var logger=require(_0x91cb('0x4'))('routing');var rpc={'chatMessage':require(_0x91cb('0x5')),'openchannelMessage':require(_0x91cb('0x6')),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require(_0x91cb('0x7')),'faxMessage':require(_0x91cb('0x8')),'whatsappMessage':require(_0x91cb('0x9'))};exports[_0x91cb('0xa')]=function(_0x3b9d98,_0x8f8a3b){return function(_0x4c1f56){try{if(!_[_0x91cb('0xb')](this['interaction'][_0x91cb('0xc')])){logger['info'](_0x91cb('0xd'),_0x3b9d98,_0x91cb('0xe'));return _0x4c1f56[_0x91cb('0xf')]();}var _0x4a631d={'ContactId':this[_0x91cb('0x10')]['id'],'sentAt':moment()[_0x91cb('0x11')](_0x91cb('0x12')),'direction':_0x91cb('0x13')};if(this[_0x91cb('0x14')]===_0x91cb('0x15')||this['channel']===_0x91cb('0x16')){_0x4a631d[_0x91cb('0x17')]=this['interaction'][_0x91cb('0x17')];}var _0x3ea707=this[_0x91cb('0x14')];if(_0x3ea707===_0x91cb('0x18')){_0x4a631d['ChatWebsiteId']=this['account']['id'];}else{_0x4a631d[_[_0x91cb('0x19')](_0x3ea707)+_0x91cb('0x1a')]=this['account']['id'];}_0x4a631d[_['upperFirst'](_0x3ea707)+_0x91cb('0x1b')]=this[_0x91cb('0x1c')]['id'];if(this[_0x91cb('0x1c')]['created']){var _0x238f11=_0x8f8a3b[0x2];if(!_[_0x91cb('0x1d')](_0x238f11)){_0x4a631d['body']=utils[_0x91cb('0x1e')](_0x238f11,this);return rpc[_0x3ea707+_0x91cb('0x1f')][_0x91cb('0x20')](_0x4a631d)[_0x91cb('0x21')](function(_0x5cc1c3){logger[_0x91cb('0x22')](_0x91cb('0xd'),_0x3b9d98,_0x4a631d['body']);})[_0x91cb('0x23')](function(_0x4c9fb2){logger['error'](_0x91cb('0xd'),_0x3b9d98,JSON[_0x91cb('0x24')](_0x4c9fb2));})['finally'](function(){logger['info']('[%s][DIALOGFLOW]\x20Welcome\x20Message\x20has\x20been\x20sent!',_0x3b9d98);_0x4c1f56[_0x91cb('0x25')]();});}else{logger[_0x91cb('0x22')](_0x91cb('0x26'),_0x3b9d98);_0x4c1f56[_0x91cb('0x25')]();}}else{var _0x5c6a15=this;var _0x45c4b3=apiai(_0x8f8a3b[0x0],{'language':_0x8f8a3b[0x1]||'en'});return _0x45c4b3[_0x91cb('0x27')](this[_0x91cb('0x28')]['body'],{'sessionId':md5(this[_0x91cb('0x1c')]['id'])})[_0x91cb('0x21')](function(_0x2447e7){_0x5c6a15[_0x91cb('0x29')][_0x91cb('0x2a')]=_0x2447e7;_0x4a631d[_0x91cb('0x29')]=_0x2447e7[_0x91cb('0x2b')][_0x91cb('0x2c')][_0x91cb('0x2d')];_0x4a631d['providerName']='dialogflow';_0x4a631d[_0x91cb('0x2e')]=JSON['stringify'](_0x2447e7);return rpc[_0x3ea707+_0x91cb('0x1f')][_0x91cb('0x20')](_0x4a631d)[_0x91cb('0x21')](function(_0x5595c5){logger[_0x91cb('0x22')]('[%s][DIALOGFLOW]\x20%s',_0x3b9d98,_0x4a631d[_0x91cb('0x29')]);if(_0x2447e7[_0x91cb('0x2b')][_0x91cb('0x2f')][_0x91cb('0x30')]){_0x4c1f56[_0x91cb('0xf')]();}else{_0x4c1f56['stop']();}})[_0x91cb('0x23')](function(_0x52670a){logger[_0x91cb('0x31')](_0x91cb('0xd'),_0x3b9d98,JSON[_0x91cb('0x24')](_0x52670a));_0x4c1f56['next']();});})[_0x91cb('0x23')](function(_0x146e1f){logger[_0x91cb('0x31')](_0x91cb('0xd'),_0x3b9d98,_0x146e1f[_0x91cb('0x28')]);_0x4c1f56[_0x91cb('0xf')]();});}}catch(_0x1e5bf1){logger[_0x91cb('0x31')](_0x91cb('0xd'),_0x3b9d98,JSON['stringify'](_0x1e5bf1));_0x4c1f56[_0x91cb('0x25')]();}};}; \ No newline at end of file +var _0xeae8=['Message','metadata','endConversation','message','lodash','moment','apiai-promise','./utils','routing','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','isNil','interaction','[%s][DIALOGFLOW]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','channel','sms','whatsapp','phone','chat','account','upperFirst','AccountId','InteractionId','created','getMustacheRender','create','then','info','body','catch','error','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','textRequest','dialogflow','result','fulfillment','speech','providerName','providerResponse','stringify'];(function(_0x269ee8,_0x477226){var _0x4d98bd=function(_0x20d4c4){while(--_0x20d4c4){_0x269ee8['push'](_0x269ee8['shift']());}};_0x4d98bd(++_0x477226);}(_0xeae8,0x66));var _0x8eae=function(_0x1976e4,_0x2998c5){_0x1976e4=_0x1976e4-0x0;var _0x4aaf10=_0xeae8[_0x1976e4];return _0x4aaf10;};'use strict';var _=require(_0x8eae('0x0'));var moment=require(_0x8eae('0x1'));var apiai=require(_0x8eae('0x2'));var md5=require('md5');var utils=require(_0x8eae('0x3'));var logger=require('../../../../config/logger')(_0x8eae('0x4'));var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require(_0x8eae('0x5')),'mailMessage':require(_0x8eae('0x6')),'smsMessage':require(_0x8eae('0x7')),'faxMessage':require(_0x8eae('0x8')),'whatsappMessage':require(_0x8eae('0x9'))};exports[_0x8eae('0xa')]=function(_0x32c67f,_0xd2b0){return function(_0x2dcd90){try{if(!_[_0x8eae('0xb')](this[_0x8eae('0xc')]['UserId'])){logger['info'](_0x8eae('0xd'),_0x32c67f,_0x8eae('0xe'));return _0x2dcd90[_0x8eae('0xf')]();}var _0x329b64={'ContactId':this[_0x8eae('0x10')]['id'],'sentAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'direction':'out'};if(this[_0x8eae('0x11')]===_0x8eae('0x12')||this['channel']===_0x8eae('0x13')){_0x329b64['phone']=this[_0x8eae('0xc')][_0x8eae('0x14')];}var _0x8d335b=this[_0x8eae('0x11')];if(_0x8d335b===_0x8eae('0x15')){_0x329b64['ChatWebsiteId']=this[_0x8eae('0x16')]['id'];}else{_0x329b64[_[_0x8eae('0x17')](_0x8d335b)+_0x8eae('0x18')]=this[_0x8eae('0x16')]['id'];}_0x329b64[_[_0x8eae('0x17')](_0x8d335b)+_0x8eae('0x19')]=this[_0x8eae('0xc')]['id'];if(this[_0x8eae('0xc')][_0x8eae('0x1a')]){var _0x5324e3=_0xd2b0[0x2];if(!_['isEmpty'](_0x5324e3)){_0x329b64['body']=utils[_0x8eae('0x1b')](_0x5324e3,this);return rpc[_0x8d335b+'Message'][_0x8eae('0x1c')](_0x329b64)[_0x8eae('0x1d')](function(_0x386a97){logger[_0x8eae('0x1e')](_0x8eae('0xd'),_0x32c67f,_0x329b64[_0x8eae('0x1f')]);})[_0x8eae('0x20')](function(_0x42e734){logger[_0x8eae('0x21')](_0x8eae('0xd'),_0x32c67f,JSON['stringify'](_0x42e734));})['finally'](function(){logger[_0x8eae('0x1e')](_0x8eae('0x22'),_0x32c67f);_0x2dcd90[_0x8eae('0x23')]();});}else{logger['info'](_0x8eae('0x24'),_0x32c67f);_0x2dcd90[_0x8eae('0x23')]();}}else{var _0x51fa34=this;var _0x1dc612=apiai(_0xd2b0[0x0],{'language':_0xd2b0[0x1]||'en'});return _0x1dc612[_0x8eae('0x25')](this['message'][_0x8eae('0x1f')],{'sessionId':md5(this[_0x8eae('0xc')]['id'])})[_0x8eae('0x1d')](function(_0x282fa5){_0x51fa34[_0x8eae('0x1f')][_0x8eae('0x26')]=_0x282fa5;_0x329b64[_0x8eae('0x1f')]=_0x282fa5[_0x8eae('0x27')][_0x8eae('0x28')][_0x8eae('0x29')];_0x329b64[_0x8eae('0x2a')]='dialogflow';_0x329b64[_0x8eae('0x2b')]=JSON[_0x8eae('0x2c')](_0x282fa5);return rpc[_0x8d335b+_0x8eae('0x2d')][_0x8eae('0x1c')](_0x329b64)[_0x8eae('0x1d')](function(_0x13a80a){logger[_0x8eae('0x1e')]('[%s][DIALOGFLOW]\x20%s',_0x32c67f,_0x329b64[_0x8eae('0x1f')]);if(_0x282fa5['result'][_0x8eae('0x2e')][_0x8eae('0x2f')]){_0x2dcd90[_0x8eae('0xf')]();}else{_0x2dcd90[_0x8eae('0x23')]();}})[_0x8eae('0x20')](function(_0x541448){logger['error'](_0x8eae('0xd'),_0x32c67f,JSON[_0x8eae('0x2c')](_0x541448));_0x2dcd90[_0x8eae('0xf')]();});})[_0x8eae('0x20')](function(_0x547eea){logger[_0x8eae('0x21')](_0x8eae('0xd'),_0x32c67f,_0x547eea[_0x8eae('0x30')]);_0x2dcd90[_0x8eae('0xf')]();});}}catch(_0x2f92d0){logger[_0x8eae('0x21')](_0x8eae('0xd'),_0x32c67f,JSON[_0x8eae('0x2c')](_0x2f92d0));_0x2dcd90[_0x8eae('0x23')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/dialogflowV2.js b/server/services/routing/server/applications/dialogflowV2.js index 19fe23e..4c86eb7 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 _0x3435=['stringify','isNil','UserId','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','channel','sms','phone','interaction','chat','ChatWebsiteId','account','upperFirst','AccountId','InteractionId','created','isEmpty','body','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','replace','length','dialogflowV2','queryResult','diagnosticInfo','fields','end_conversation','boolValue','DIALOGFLOWV2_ACTION','DIALOGFLOWV2_ALLREQUIREDPARAMSPRESENT','allRequiredParamsPresent','DIALOGFLOWV2_ENDCONVERSATION','intent','name','DIALOGFLOWV2_INTENTDISPLAYNAME','DIALOGFLOWV2_ISFALLBACKINTENT','isFallback','DIALOGFLOWV2_LANGUAGECODE','queryText','DIALOGFLOWV2_SCORE','intentDetectionConfidence','providerName','providerResponse','fulfillmentText','next','message','lodash','dialogflow','md5','moment','bluebird','../../../../config/logger','./utils','../../rpc/chatMessage','../../rpc/smsMessage','../../rpc/faxMessage','clone','Message','create','then','info','[%s][DIALOGFLOWV2]\x20%s','catch','error'];(function(_0x4005fe,_0x1fc3c1){var _0x50022d=function(_0x2ce718){while(--_0x2ce718){_0x4005fe['push'](_0x4005fe['shift']());}};_0x50022d(++_0x1fc3c1);}(_0x3435,0xfa));var _0x5343=function(_0x5eef05,_0x1be989){_0x5eef05=_0x5eef05-0x0;var _0x56d4b8=_0x3435[_0x5eef05];return _0x56d4b8;};'use strict';var _=require(_0x5343('0x0'));var dialogflow=require(_0x5343('0x1'));var md5=require(_0x5343('0x2'));var moment=require(_0x5343('0x3'));var Promise=require(_0x5343('0x4'));var logger=require(_0x5343('0x5'))('routing');var utils=require(_0x5343('0x6'));var rpc={'chatMessage':require(_0x5343('0x7')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require(_0x5343('0x8')),'faxMessage':require(_0x5343('0x9')),'whatsappMessage':require('../../rpc/whatsappMessage')};function createMessage(_0x544b29,_0x13641f,_0x1e1911,_0x9ea9b6){return new Promise(function(_0x245034,_0x41673f){var _0x5e1147=_[_0x5343('0xa')](_0x1e1911);_0x5e1147['body']=_0x9ea9b6;return rpc[_0x13641f+_0x5343('0xb')][_0x5343('0xc')](_0x5e1147)[_0x5343('0xd')](function(){logger[_0x5343('0xe')](_0x5343('0xf'),_0x544b29,_0x5e1147['body']);_0x245034();})[_0x5343('0x10')](function(_0x1eab36){logger[_0x5343('0x11')]('[%s][DIALOGFLOWV2]\x20%s',_0x544b29,JSON[_0x5343('0x12')](_0x1eab36));_0x41673f(_0x1eab36);});});}exports['consequence']=function(_0x82074d,_0x432158){return function(_0x58419f){try{if(!_[_0x5343('0x13')](this['interaction'][_0x5343('0x14')])){logger[_0x5343('0xe')](_0x5343('0xf'),_0x82074d,_0x5343('0x15'));return _0x58419f['next']();}var _0x446e90={'ContactId':this[_0x5343('0x16')]['id'],'sentAt':moment()[_0x5343('0x17')](_0x5343('0x18')),'direction':_0x5343('0x19')};if(this[_0x5343('0x1a')]===_0x5343('0x1b')||this[_0x5343('0x1a')]==='whatsapp'){_0x446e90[_0x5343('0x1c')]=this[_0x5343('0x1d')][_0x5343('0x1c')];}var _0x489e1c=this[_0x5343('0x1a')];if(_0x489e1c===_0x5343('0x1e')){_0x446e90[_0x5343('0x1f')]=this[_0x5343('0x20')]['id'];}else{_0x446e90[_[_0x5343('0x21')](_0x489e1c)+_0x5343('0x22')]=this[_0x5343('0x20')]['id'];}_0x446e90[_[_0x5343('0x21')](_0x489e1c)+_0x5343('0x23')]=this['interaction']['id'];if(this[_0x5343('0x1d')][_0x5343('0x24')]){var _0x5c2d6f=_0x432158[0x4];if(!_[_0x5343('0x25')](_0x5c2d6f)){_0x446e90[_0x5343('0x26')]=utils['getMustacheRender'](_0x5c2d6f,this);return rpc[_0x489e1c+_0x5343('0xb')][_0x5343('0xc')](_0x446e90)[_0x5343('0xd')](function(_0x380aae){logger[_0x5343('0xe')]('[%s][DIALOGFLOWV2]\x20%s',_0x82074d,_0x446e90[_0x5343('0x26')]);})[_0x5343('0x10')](function(_0x584034){logger[_0x5343('0x11')](_0x5343('0xf'),_0x82074d,JSON[_0x5343('0x12')](_0x584034));})['finally'](function(){logger['info'](_0x5343('0x27'),_0x82074d);_0x58419f['stop']();});}else{logger[_0x5343('0xe')]('[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!',_0x82074d);_0x58419f[_0x5343('0x28')]();}}else{var _0x55ab94=this;var _0x50c584=_0x432158[0x2][_0x5343('0x29')](/\\n/g,'\x0a');var _0x4cb858={'credentials':{'private_key':_0x50c584,'client_email':_0x432158[0x1]}};var _0x551bf4=new dialogflow['SessionsClient'](_0x4cb858);var _0x1202bb=_0x551bf4['sessionPath'](_0x432158[0x0],md5(_0x55ab94[_0x5343('0x1d')]['id']));var _0x47d49a={'session':_0x1202bb,'queryInput':{'text':{'text':_0x55ab94['message'][_0x5343('0x26')],'languageCode':_0x432158[0x3]||'en'}}};return _0x551bf4['detectIntent'](_0x47d49a)['then'](function(_0x125e4c){if(_0x125e4c&&_0x125e4c[_0x5343('0x2a')]){_0x55ab94[_0x5343('0x26')][_0x5343('0x2b')]=_0x125e4c;var _0x4a31e8=_0x125e4c[0x0];var _0x5b3380=_0x4a31e8[_0x5343('0x2c')][_0x5343('0x2d')]&&_0x4a31e8[_0x5343('0x2c')][_0x5343('0x2d')][_0x5343('0x2e')]?_0x4a31e8[_0x5343('0x2c')][_0x5343('0x2d')][_0x5343('0x2e')][_0x5343('0x2f')][_0x5343('0x30')]:![];_0x55ab94[_0x5343('0x26')][_0x5343('0x31')]=_0x4a31e8['queryResult']['action'];_0x55ab94[_0x5343('0x26')][_0x5343('0x32')]=_0x4a31e8['queryResult'][_0x5343('0x33')];_0x55ab94['body'][_0x5343('0x34')]=_0x4a31e8[_0x5343('0x2c')][_0x5343('0x2d')]&&_0x4a31e8[_0x5343('0x2c')]['diagnosticInfo']['fields']?_0x4a31e8[_0x5343('0x2c')]['diagnosticInfo'][_0x5343('0x2e')][_0x5343('0x2f')]['boolValue']:![];_0x55ab94[_0x5343('0x26')]['DIALOGFLOWV2_INTENTNAME']=_0x4a31e8['queryResult'][_0x5343('0x35')][_0x5343('0x36')];_0x55ab94[_0x5343('0x26')][_0x5343('0x37')]=_0x4a31e8['queryResult']['intent']['displayName'];_0x55ab94['body'][_0x5343('0x38')]=_0x4a31e8[_0x5343('0x2c')][_0x5343('0x35')][_0x5343('0x39')];_0x55ab94[_0x5343('0x26')][_0x5343('0x3a')]=_0x4a31e8[_0x5343('0x2c')]['languageCode'];_0x55ab94[_0x5343('0x26')]['DIALOGFLOWV2_QUERYTEXT']=_0x4a31e8[_0x5343('0x2c')][_0x5343('0x3b')];_0x55ab94[_0x5343('0x26')][_0x5343('0x3c')]=_0x4a31e8[_0x5343('0x2c')][_0x5343('0x3d')];_0x446e90[_0x5343('0x3e')]='dialogflowV2';_0x446e90[_0x5343('0x3f')]=JSON['stringify'](_0x125e4c);var _0x28c274=[];for(var _0x46f97d=0x0;_0x46f97d<_0x125e4c[_0x5343('0x2a')];_0x46f97d++){var _0x32b3ec=_0x125e4c[_0x46f97d];if(_0x32b3ec&&_0x32b3ec[_0x5343('0x2c')]&&_0x32b3ec[_0x5343('0x2c')][_0x5343('0x40')]){_0x28c274['push'](createMessage(_0x82074d,_0x489e1c,_0x446e90,_0x32b3ec[_0x5343('0x2c')][_0x5343('0x40')]));}}return Promise['all'](_0x28c274)[_0x5343('0xd')](function(){if(_0x5b3380){_0x58419f[_0x5343('0x41')]();}else{_0x58419f['stop']();}})['catch'](function(_0x3ec252){logger[_0x5343('0x11')](_0x5343('0xf'),_0x82074d,JSON['stringify'](_0x3ec252));_0x58419f[_0x5343('0x41')]();});}})[_0x5343('0x10')](function(_0x4c6f59){logger[_0x5343('0x11')](_0x5343('0xf'),_0x82074d,_0x4c6f59[_0x5343('0x42')]);_0x58419f[_0x5343('0x41')]();});}}catch(_0x55ecb3){logger[_0x5343('0x11')](_0x5343('0xf'),_0x82074d,JSON[_0x5343('0x12')](_0x55ecb3));_0x58419f[_0x5343('0x28')]();}};}; \ No newline at end of file +var _0x5640=['Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','channel','sms','phone','interaction','ChatWebsiteId','account','upperFirst','AccountId','InteractionId','created','getMustacheRender','catch','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','length','dialogflowV2','queryResult','diagnosticInfo','fields','DIALOGFLOWV2_ACTION','DIALOGFLOWV2_ALLREQUIREDPARAMSPRESENT','allRequiredParamsPresent','DIALOGFLOWV2_ENDCONVERSATION','end_conversation','boolValue','DIALOGFLOWV2_INTENTNAME','intent','name','DIALOGFLOWV2_INTENTDISPLAYNAME','displayName','DIALOGFLOWV2_ISFALLBACKINTENT','DIALOGFLOWV2_LANGUAGECODE','languageCode','DIALOGFLOWV2_QUERYTEXT','queryText','DIALOGFLOWV2_SCORE','intentDetectionConfidence','providerName','fulfillmentText','push','all','error','lodash','dialogflow','md5','moment','bluebird','../../../../config/logger','routing','./utils','../../rpc/mailMessage','../../rpc/faxMessage','clone','body','Message','create','then','[%s][DIALOGFLOWV2]\x20%s','stringify','consequence','isNil','UserId','info'];(function(_0xed4881,_0x45771c){var _0x7fcbd5=function(_0x36b960){while(--_0x36b960){_0xed4881['push'](_0xed4881['shift']());}};_0x7fcbd5(++_0x45771c);}(_0x5640,0x7f));var _0x0564=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x5640[_0x2c91e9];return _0x13f0ff;};'use strict';var _=require(_0x0564('0x0'));var dialogflow=require(_0x0564('0x1'));var md5=require(_0x0564('0x2'));var moment=require(_0x0564('0x3'));var Promise=require(_0x0564('0x4'));var logger=require(_0x0564('0x5'))(_0x0564('0x6'));var utils=require(_0x0564('0x7'));var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0x0564('0x8')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0x0564('0x9')),'whatsappMessage':require('../../rpc/whatsappMessage')};function createMessage(_0x2100ce,_0xd6e218,_0x289f2e,_0x2636e8){return new Promise(function(_0x1e1c3d,_0x462193){var _0x57b378=_[_0x0564('0xa')](_0x289f2e);_0x57b378[_0x0564('0xb')]=_0x2636e8;return rpc[_0xd6e218+_0x0564('0xc')][_0x0564('0xd')](_0x57b378)[_0x0564('0xe')](function(){logger['info'](_0x0564('0xf'),_0x2100ce,_0x57b378[_0x0564('0xb')]);_0x1e1c3d();})['catch'](function(_0x5948c8){logger['error']('[%s][DIALOGFLOWV2]\x20%s',_0x2100ce,JSON[_0x0564('0x10')](_0x5948c8));_0x462193(_0x5948c8);});});}exports[_0x0564('0x11')]=function(_0xf9c4c,_0x35b1f6){return function(_0x1cdd5e){try{if(!_[_0x0564('0x12')](this['interaction'][_0x0564('0x13')])){logger[_0x0564('0x14')](_0x0564('0xf'),_0xf9c4c,_0x0564('0x15'));return _0x1cdd5e[_0x0564('0x16')]();}var _0x5ec12d={'ContactId':this[_0x0564('0x17')]['id'],'sentAt':moment()[_0x0564('0x18')](_0x0564('0x19')),'direction':_0x0564('0x1a')};if(this[_0x0564('0x1b')]===_0x0564('0x1c')||this[_0x0564('0x1b')]==='whatsapp'){_0x5ec12d[_0x0564('0x1d')]=this[_0x0564('0x1e')]['phone'];}var _0x199c5f=this['channel'];if(_0x199c5f==='chat'){_0x5ec12d[_0x0564('0x1f')]=this[_0x0564('0x20')]['id'];}else{_0x5ec12d[_[_0x0564('0x21')](_0x199c5f)+_0x0564('0x22')]=this[_0x0564('0x20')]['id'];}_0x5ec12d[_['upperFirst'](_0x199c5f)+_0x0564('0x23')]=this[_0x0564('0x1e')]['id'];if(this[_0x0564('0x1e')][_0x0564('0x24')]){var _0x34032f=_0x35b1f6[0x4];if(!_['isEmpty'](_0x34032f)){_0x5ec12d[_0x0564('0xb')]=utils[_0x0564('0x25')](_0x34032f,this);return rpc[_0x199c5f+_0x0564('0xc')][_0x0564('0xd')](_0x5ec12d)[_0x0564('0xe')](function(_0x2a2fbf){logger[_0x0564('0x14')](_0x0564('0xf'),_0xf9c4c,_0x5ec12d[_0x0564('0xb')]);})[_0x0564('0x26')](function(_0x4278d1){logger['error']('[%s][DIALOGFLOWV2]\x20%s',_0xf9c4c,JSON[_0x0564('0x10')](_0x4278d1));})[_0x0564('0x27')](function(){logger[_0x0564('0x14')](_0x0564('0x28'),_0xf9c4c);_0x1cdd5e['stop']();});}else{logger[_0x0564('0x14')](_0x0564('0x29'),_0xf9c4c);_0x1cdd5e[_0x0564('0x2a')]();}}else{var _0x1ecb7b=this;var _0x3c1e8e=_0x35b1f6[0x2][_0x0564('0x2b')](/\\n/g,'\x0a');var _0x3e33f9={'credentials':{'private_key':_0x3c1e8e,'client_email':_0x35b1f6[0x1]}};var _0x5000e7=new dialogflow['SessionsClient'](_0x3e33f9);var _0x548ede=_0x5000e7[_0x0564('0x2c')](_0x35b1f6[0x0],md5(_0x1ecb7b['interaction']['id']));var _0x482cf1={'session':_0x548ede,'queryInput':{'text':{'text':_0x1ecb7b['message'][_0x0564('0xb')],'languageCode':_0x35b1f6[0x3]||'en'}}};return _0x5000e7[_0x0564('0x2d')](_0x482cf1)[_0x0564('0xe')](function(_0x170594){if(_0x170594&&_0x170594[_0x0564('0x2e')]){_0x1ecb7b['body'][_0x0564('0x2f')]=_0x170594;var _0x467093=_0x170594[0x0];var _0x1a3629=_0x467093[_0x0564('0x30')]['diagnosticInfo']&&_0x467093[_0x0564('0x30')][_0x0564('0x31')][_0x0564('0x32')]?_0x467093['queryResult'][_0x0564('0x31')]['fields']['end_conversation']['boolValue']:![];_0x1ecb7b['body'][_0x0564('0x33')]=_0x467093[_0x0564('0x30')]['action'];_0x1ecb7b['body'][_0x0564('0x34')]=_0x467093[_0x0564('0x30')][_0x0564('0x35')];_0x1ecb7b[_0x0564('0xb')][_0x0564('0x36')]=_0x467093[_0x0564('0x30')][_0x0564('0x31')]&&_0x467093['queryResult'][_0x0564('0x31')]['fields']?_0x467093[_0x0564('0x30')][_0x0564('0x31')][_0x0564('0x32')][_0x0564('0x37')][_0x0564('0x38')]:![];_0x1ecb7b[_0x0564('0xb')][_0x0564('0x39')]=_0x467093[_0x0564('0x30')][_0x0564('0x3a')][_0x0564('0x3b')];_0x1ecb7b[_0x0564('0xb')][_0x0564('0x3c')]=_0x467093[_0x0564('0x30')][_0x0564('0x3a')][_0x0564('0x3d')];_0x1ecb7b['body'][_0x0564('0x3e')]=_0x467093[_0x0564('0x30')][_0x0564('0x3a')]['isFallback'];_0x1ecb7b[_0x0564('0xb')][_0x0564('0x3f')]=_0x467093['queryResult'][_0x0564('0x40')];_0x1ecb7b['body'][_0x0564('0x41')]=_0x467093[_0x0564('0x30')][_0x0564('0x42')];_0x1ecb7b['body'][_0x0564('0x43')]=_0x467093[_0x0564('0x30')][_0x0564('0x44')];_0x5ec12d[_0x0564('0x45')]='dialogflowV2';_0x5ec12d['providerResponse']=JSON[_0x0564('0x10')](_0x170594);var _0x3b154b=[];for(var _0x39ea72=0x0;_0x39ea72<_0x170594[_0x0564('0x2e')];_0x39ea72++){var _0x447243=_0x170594[_0x39ea72];if(_0x447243&&_0x447243['queryResult']&&_0x447243[_0x0564('0x30')][_0x0564('0x46')]){_0x3b154b[_0x0564('0x47')](createMessage(_0xf9c4c,_0x199c5f,_0x5ec12d,_0x447243['queryResult'][_0x0564('0x46')]));}}return Promise[_0x0564('0x48')](_0x3b154b)[_0x0564('0xe')](function(){if(_0x1a3629){_0x1cdd5e[_0x0564('0x16')]();}else{_0x1cdd5e[_0x0564('0x2a')]();}})[_0x0564('0x26')](function(_0x1944f8){logger[_0x0564('0x49')](_0x0564('0xf'),_0xf9c4c,JSON['stringify'](_0x1944f8));_0x1cdd5e[_0x0564('0x16')]();});}})[_0x0564('0x26')](function(_0x3822f0){logger[_0x0564('0x49')](_0x0564('0xf'),_0xf9c4c,_0x3822f0['message']);_0x1cdd5e[_0x0564('0x16')]();});}}catch(_0x526cda){logger['error'](_0x0564('0xf'),_0xf9c4c,JSON[_0x0564('0x10')](_0x526cda));_0x1cdd5e['stop']();}};}; \ 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 05d9fb9..7c7ba37 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 _0x0ee5=['[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','[%s][GOTOIF]\x20priority\x20%s\x20not\x20found','error','stringify','validate','html-to-text','./utils','../../../../config/logger','routing','string','number','priority\x20true\x20is\x20a\x20number','priority\x20false\x20is\x20a\x20number','consequence','getMustacheRender','replace','length','[%s][GOTOIF]\x20%s','map','message','join','stop','condition','priorityTrue','info','[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s','next'];(function(_0x3f5f68,_0xa3bc8f){var _0x412342=function(_0x29c50d){while(--_0x29c50d){_0x3f5f68['push'](_0x3f5f68['shift']());}};_0x412342(++_0xa3bc8f);}(_0x0ee5,0x163));var _0x50ee=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x0ee5[_0x57b54c];return _0x59cc19;};'use strict';var schema=require(_0x50ee('0x0'));var _=require('lodash');var htmlToText=require(_0x50ee('0x1'));var utils=require(_0x50ee('0x2'));var logger=require(_0x50ee('0x3'))(_0x50ee('0x4'));var gotoif=schema({'condition':{'type':_0x50ee('0x5'),'required':!![],'message':'condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'priorityTrue':{'type':_0x50ee('0x6'),'message':_0x50ee('0x7')},'priorityFalse':{'type':_0x50ee('0x6'),'message':_0x50ee('0x8')}});exports[_0x50ee('0x9')]=function(_0x415b5d,_0x1a4284){return function(_0x4472cf){try{var _0x75fa54={'condition':htmlToText['fromString'](utils[_0x50ee('0xa')](_0x1a4284[0x0],this),{'wordwrap':![]})[_0x50ee('0xb')](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x1a4284[0x1],'priorityFalse':_0x1a4284[0x2]};var _0x43c668=gotoif[_0x50ee('0x0')](_0x75fa54,{'typecast':!![]});if(_0x43c668[_0x50ee('0xc')]){logger['error'](_0x50ee('0xd'),_0x415b5d,_[_0x50ee('0xe')](_0x43c668,_0x50ee('0xf'))[_0x50ee('0x10')](',\x20'));_0x4472cf[_0x50ee('0x11')]();}else{try{var _0x214a31=eval('('+_0x75fa54[_0x50ee('0x12')]+')');var _0x14865d=_0x214a31?_0x75fa54[_0x50ee('0x13')]:_0x75fa54['priorityFalse'];logger[_0x50ee('0x14')](_0x50ee('0x15'),_0x415b5d,_0x75fa54[_0x50ee('0x12')],_0x214a31,_0x14865d||_0x50ee('0x16'));if(_0x14865d){var _0xc51ae9=_['findIndex'](_0x4472cf['rules'](),{'p':_0x14865d});if(_0xc51ae9>=0x0){logger[_0x50ee('0x14')](_0x50ee('0x17'),_0x415b5d,_0x14865d||'next',_0xc51ae9);_0x4472cf['next'](_0xc51ae9);}else{logger[_0x50ee('0x14')](_0x50ee('0x18'),_0x415b5d,_0x14865d||'next');_0x4472cf['stop']();}}else{_0x4472cf[_0x50ee('0x16')]();}}catch(_0x328d89){logger[_0x50ee('0x19')]('[%s][GOTOIF]\x20eval\x20error:\x20%s',_0x415b5d,_0x328d89['message']);_0x4472cf[_0x50ee('0x11')]();}}}catch(_0x245d2b){logger['error'](_0x50ee('0xd'),_0x415b5d,JSON[_0x50ee('0x1a')](_0x245d2b));_0x4472cf[_0x50ee('0x11')]();}};}; \ No newline at end of file +var _0x3fa2=['priorityTrue','priorityFalse','info','[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s','next','findIndex','[%s][GOTOIF]\x20priority\x20%s\x20not\x20found','stop','[%s][GOTOIF]\x20eval\x20error:\x20%s','[%s][GOTOIF]\x20%s','stringify','lodash','html-to-text','./utils','routing','number','priority\x20true\x20is\x20a\x20number','priority\x20false\x20is\x20a\x20number','fromString','getMustacheRender','replace','validate','error','map','message','join','condition'];(function(_0x5b5da8,_0x217c1a){var _0x37abbd=function(_0x54c949){while(--_0x54c949){_0x5b5da8['push'](_0x5b5da8['shift']());}};_0x37abbd(++_0x217c1a);}(_0x3fa2,0xad));var _0x23fa=function(_0x1bfc2d,_0x181462){_0x1bfc2d=_0x1bfc2d-0x0;var _0x501195=_0x3fa2[_0x1bfc2d];return _0x501195;};'use strict';var schema=require('validate');var _=require(_0x23fa('0x0'));var htmlToText=require(_0x23fa('0x1'));var utils=require(_0x23fa('0x2'));var logger=require('../../../../config/logger')(_0x23fa('0x3'));var gotoif=schema({'condition':{'type':'string','required':!![],'message':'condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'priorityTrue':{'type':_0x23fa('0x4'),'message':_0x23fa('0x5')},'priorityFalse':{'type':_0x23fa('0x4'),'message':_0x23fa('0x6')}});exports['consequence']=function(_0x522ccf,_0x322468){return function(_0x295ce5){try{var _0x3d5ac2={'condition':htmlToText[_0x23fa('0x7')](utils[_0x23fa('0x8')](_0x322468[0x0],this),{'wordwrap':![]})[_0x23fa('0x9')](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x322468[0x1],'priorityFalse':_0x322468[0x2]};var _0x5605de=gotoif[_0x23fa('0xa')](_0x3d5ac2,{'typecast':!![]});if(_0x5605de['length']){logger[_0x23fa('0xb')]('[%s][GOTOIF]\x20%s',_0x522ccf,_[_0x23fa('0xc')](_0x5605de,_0x23fa('0xd'))[_0x23fa('0xe')](',\x20'));_0x295ce5['stop']();}else{try{var _0x23f714=eval('('+_0x3d5ac2[_0x23fa('0xf')]+')');var _0x53655d=_0x23f714?_0x3d5ac2[_0x23fa('0x10')]:_0x3d5ac2[_0x23fa('0x11')];logger[_0x23fa('0x12')](_0x23fa('0x13'),_0x522ccf,_0x3d5ac2[_0x23fa('0xf')],_0x23f714,_0x53655d||_0x23fa('0x14'));if(_0x53655d){var _0x328398=_[_0x23fa('0x15')](_0x295ce5['rules'](),{'p':_0x53655d});if(_0x328398>=0x0){logger[_0x23fa('0x12')]('[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s',_0x522ccf,_0x53655d||_0x23fa('0x14'),_0x328398);_0x295ce5['next'](_0x328398);}else{logger[_0x23fa('0x12')](_0x23fa('0x16'),_0x522ccf,_0x53655d||_0x23fa('0x14'));_0x295ce5[_0x23fa('0x17')]();}}else{_0x295ce5[_0x23fa('0x14')]();}}catch(_0x1af050){logger[_0x23fa('0xb')](_0x23fa('0x18'),_0x522ccf,_0x1af050[_0x23fa('0xd')]);_0x295ce5[_0x23fa('0x17')]();}}}catch(_0x505d1f){logger['error'](_0x23fa('0x19'),_0x522ccf,JSON[_0x23fa('0x1a')](_0x505d1f));_0x295ce5['stop']();}};}; \ 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 c9d816e..3cb06f6 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 _0x2596=['priority','next','[%s][GOTOP]\x20priority\x20%s\x20not\x20found','stop','stringify','validate','../../../../config/logger','routing','priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','consequence','length','error','[%s][GOTOP]\x20%s','map','message','join','info','rules'];(function(_0x26fd83,_0x18ea5a){var _0x5a0d82=function(_0x11e190){while(--_0x11e190){_0x26fd83['push'](_0x26fd83['shift']());}};_0x5a0d82(++_0x18ea5a);}(_0x2596,0x113));var _0x6259=function(_0x3367eb,_0x2b7fb4){_0x3367eb=_0x3367eb-0x0;var _0x4ebc73=_0x2596[_0x3367eb];return _0x4ebc73;};'use strict';var schema=require(_0x6259('0x0'));var _=require('lodash');var logger=require(_0x6259('0x1'))(_0x6259('0x2'));var gotop=schema({'priority':{'type':'number','required':!![],'message':_0x6259('0x3')}});exports[_0x6259('0x4')]=function(_0x184ef6,_0x15f6c2){return function(_0x3041db){try{var _0x48d8d9={'priority':_0x15f6c2[0x0]};var _0x193f56=gotop[_0x6259('0x0')](_0x48d8d9,{'typecast':!![]});if(_0x193f56[_0x6259('0x5')]){logger[_0x6259('0x6')](_0x6259('0x7'),_0x184ef6,_[_0x6259('0x8')](_0x193f56,_0x6259('0x9'))[_0x6259('0xa')](',\x20'));_0x3041db['stop']();}else{logger[_0x6259('0xb')]('[%s][GOTOP]\x20priority\x20%s',_0x184ef6,_0x48d8d9['priority']);if(_0x48d8d9['priority']){var _0x42b854=_['findIndex'](_0x3041db[_0x6259('0xc')](),{'p':_0x48d8d9[_0x6259('0xd')]});if(_0x42b854>=0x0){logger['info']('[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s',_0x184ef6,_0x48d8d9[_0x6259('0xd')]||_0x6259('0xe'),_0x42b854);_0x3041db[_0x6259('0xe')](_0x42b854);}else{logger[_0x6259('0xb')](_0x6259('0xf'),_0x184ef6,_0x48d8d9['priority']||'next');_0x3041db[_0x6259('0x10')]();}}else{_0x3041db['next']();}}}catch(_0x19e73a){logger['error'](_0x6259('0x7'),_0x184ef6,JSON[_0x6259('0x11')](_0x19e73a));_0x3041db['stop']();}};}; \ No newline at end of file +var _0x67c2=['[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','[%s][GOTOP]\x20priority\x20%s\x20not\x20found','stop','validate','lodash','../../../../config/logger','number','priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','consequence','length','error','join','info','[%s][GOTOP]\x20priority\x20%s','priority','rules'];(function(_0x2dfcdc,_0x5cc462){var _0x48d2c7=function(_0x5e11d1){while(--_0x5e11d1){_0x2dfcdc['push'](_0x2dfcdc['shift']());}};_0x48d2c7(++_0x5cc462);}(_0x67c2,0x1be));var _0x267c=function(_0x8d537b,_0x2c0c28){_0x8d537b=_0x8d537b-0x0;var _0x137878=_0x67c2[_0x8d537b];return _0x137878;};'use strict';var schema=require(_0x267c('0x0'));var _=require(_0x267c('0x1'));var logger=require(_0x267c('0x2'))('routing');var gotop=schema({'priority':{'type':_0x267c('0x3'),'required':!![],'message':_0x267c('0x4')}});exports[_0x267c('0x5')]=function(_0x4f5180,_0x3984cb){return function(_0x55c6f8){try{var _0x30e3bd={'priority':_0x3984cb[0x0]};var _0x5b92e5=gotop['validate'](_0x30e3bd,{'typecast':!![]});if(_0x5b92e5[_0x267c('0x6')]){logger[_0x267c('0x7')]('[%s][GOTOP]\x20%s',_0x4f5180,_['map'](_0x5b92e5,'message')[_0x267c('0x8')](',\x20'));_0x55c6f8['stop']();}else{logger[_0x267c('0x9')](_0x267c('0xa'),_0x4f5180,_0x30e3bd[_0x267c('0xb')]);if(_0x30e3bd[_0x267c('0xb')]){var _0x5ddf1a=_['findIndex'](_0x55c6f8[_0x267c('0xc')](),{'p':_0x30e3bd[_0x267c('0xb')]});if(_0x5ddf1a>=0x0){logger['info'](_0x267c('0xd'),_0x4f5180,_0x30e3bd[_0x267c('0xb')]||'next',_0x5ddf1a);_0x55c6f8[_0x267c('0xe')](_0x5ddf1a);}else{logger[_0x267c('0x9')](_0x267c('0xf'),_0x4f5180,_0x30e3bd[_0x267c('0xb')]||_0x267c('0xe'));_0x55c6f8[_0x267c('0x10')]();}}else{_0x55c6f8[_0x267c('0xe')]();}}}catch(_0x152acb){logger['error']('[%s][GOTOP]\x20%s',_0x4f5180,JSON['stringify'](_0x152acb));_0x55c6f8['stop']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/message.js b/server/services/routing/server/applications/message.js index 9b211ce..1d2b8cc 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 _0xaf5c=['stop','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/whatsappMessage','getMustacheRender','contact','upperFirst','channel','AccountId','InteractionId','Message','then','info','body','catch','error','[%s][MESSAGE]\x20%s','stringify'];(function(_0x5ac84c,_0x287781){var _0x3c53d2=function(_0x40cde0){while(--_0x40cde0){_0x5ac84c['push'](_0x5ac84c['shift']());}};_0x3c53d2(++_0x287781);}(_0xaf5c,0x161));var _0xcaf5=function(_0x5d7874,_0x32d516){_0x5d7874=_0x5d7874-0x0;var _0x3cba5d=_0xaf5c[_0x5d7874];return _0x3cba5d;};'use strict';var _=require('lodash');var utils=require(_0xcaf5('0x0'));var logger=require(_0xcaf5('0x1'))(_0xcaf5('0x2'));var rpc={'chatMessage':require(_0xcaf5('0x3')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0xcaf5('0x4')),'smsMessage':require(_0xcaf5('0x5')),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require(_0xcaf5('0x6'))};exports['consequence']=function(_0x1fd2d7,_0x118558){return function(_0x3695d5){try{var _0x17c418={'body':utils[_0xcaf5('0x7')](_0x118558[0x0],this),'ContactId':this[_0xcaf5('0x8')]['id']};if(this['channel']==='chat'){_0x17c418['ChatWebsiteId']=this['account']['id'];}else{_0x17c418[_[_0xcaf5('0x9')](this[_0xcaf5('0xa')])+_0xcaf5('0xb')]=this['account']['id'];}_0x17c418[_[_0xcaf5('0x9')](this[_0xcaf5('0xa')])+_0xcaf5('0xc')]=this['interaction']['id'];if(rpc[this['channel']+'Message']){return rpc[this[_0xcaf5('0xa')]+_0xcaf5('0xd')]['create'](_0x17c418)[_0xcaf5('0xe')](function(_0x121296){logger[_0xcaf5('0xf')]('[%s][MESSAGE]\x20%s',_0x1fd2d7,_0x17c418[_0xcaf5('0x10')]);_0x3695d5['next']();})[_0xcaf5('0x11')](function(_0x44df7e){logger[_0xcaf5('0x12')](_0xcaf5('0x13'),_0x1fd2d7,JSON[_0xcaf5('0x14')](_0x44df7e));_0x3695d5[_0xcaf5('0x15')]();});}}catch(_0x124a58){logger[_0xcaf5('0x12')](_0xcaf5('0x13'),_0x1fd2d7,JSON[_0xcaf5('0x14')](_0x124a58));_0x3695d5[_0xcaf5('0x15')]();}};}; \ No newline at end of file +var _0xaf6e=['stringify','stop','lodash','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','contact','chat','account','upperFirst','channel','AccountId','InteractionId','interaction','Message','create','then','info','[%s][MESSAGE]\x20%s','body','next','error'];(function(_0x246cbe,_0x19305c){var _0x855b0=function(_0x2c8d0d){while(--_0x2c8d0d){_0x246cbe['push'](_0x246cbe['shift']());}};_0x855b0(++_0x19305c);}(_0xaf6e,0x16e));var _0xeaf6=function(_0x286dc9,_0x158056){_0x286dc9=_0x286dc9-0x0;var _0x4125b1=_0xaf6e[_0x286dc9];return _0x4125b1;};'use strict';var _=require(_0xeaf6('0x0'));var utils=require('./utils');var logger=require('../../../../config/logger')(_0xeaf6('0x1'));var rpc={'chatMessage':require(_0xeaf6('0x2')),'openchannelMessage':require(_0xeaf6('0x3')),'mailMessage':require(_0xeaf6('0x4')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0xeaf6('0x5')),'whatsappMessage':require(_0xeaf6('0x6'))};exports[_0xeaf6('0x7')]=function(_0x3bb1f0,_0x284ffc){return function(_0x4c8814){try{var _0x595fc8={'body':utils['getMustacheRender'](_0x284ffc[0x0],this),'ContactId':this[_0xeaf6('0x8')]['id']};if(this['channel']===_0xeaf6('0x9')){_0x595fc8['ChatWebsiteId']=this[_0xeaf6('0xa')]['id'];}else{_0x595fc8[_[_0xeaf6('0xb')](this[_0xeaf6('0xc')])+_0xeaf6('0xd')]=this[_0xeaf6('0xa')]['id'];}_0x595fc8[_[_0xeaf6('0xb')](this[_0xeaf6('0xc')])+_0xeaf6('0xe')]=this[_0xeaf6('0xf')]['id'];if(rpc[this[_0xeaf6('0xc')]+_0xeaf6('0x10')]){return rpc[this['channel']+_0xeaf6('0x10')][_0xeaf6('0x11')](_0x595fc8)[_0xeaf6('0x12')](function(_0x1c550b){logger[_0xeaf6('0x13')](_0xeaf6('0x14'),_0x3bb1f0,_0x595fc8[_0xeaf6('0x15')]);_0x4c8814[_0xeaf6('0x16')]();})['catch'](function(_0x4a7e50){logger[_0xeaf6('0x17')](_0xeaf6('0x14'),_0x3bb1f0,JSON[_0xeaf6('0x18')](_0x4a7e50));_0x4c8814[_0xeaf6('0x19')]();});}}catch(_0xd862fb){logger['error'](_0xeaf6('0x14'),_0x3bb1f0,JSON[_0xeaf6('0x18')](_0xd862fb));_0x4c8814[_0xeaf6('0x19')]();}};}; \ 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 3c00521..931d321 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 _0xff14=['consequence','getMustacheRender','next','error','stop','../../../../config/logger','routing'];(function(_0x49c1b0,_0x35b033){var _0x5be831=function(_0x1ae2a4){while(--_0x1ae2a4){_0x49c1b0['push'](_0x49c1b0['shift']());}};_0x5be831(++_0x35b033);}(_0xff14,0x186));var _0x4ff1=function(_0x3f453f,_0x548371){_0x3f453f=_0x3f453f-0x0;var _0x325aa2=_0xff14[_0x3f453f];return _0x325aa2;};'use strict';var utils=require('./utils');var logger=require(_0x4ff1('0x0'))(_0x4ff1('0x1'));exports[_0x4ff1('0x2')]=function(_0x1409ba,_0x2d9e7c){return function(_0x4dde59){try{logger['info']('[%s][NOOP]\x20%s',_0x1409ba,utils[_0x4ff1('0x3')](_0x2d9e7c[0x0],this));_0x4dde59[_0x4ff1('0x4')]();}catch(_0x4b6b60){logger[_0x4ff1('0x5')]('[%s][NOOP]\x20%s',_0x1409ba,JSON['stringify'](_0x4b6b60));_0x4dde59[_0x4ff1('0x6')]();}};}; \ No newline at end of file +var _0xcad6=['../../../../config/logger','info','[%s][NOOP]\x20%s','getMustacheRender','next','error','stringify','stop','./utils'];(function(_0x178110,_0x14a5ea){var _0x2ad52f=function(_0x47f995){while(--_0x47f995){_0x178110['push'](_0x178110['shift']());}};_0x2ad52f(++_0x14a5ea);}(_0xcad6,0x1b8));var _0x6cad=function(_0x272f67,_0x1db689){_0x272f67=_0x272f67-0x0;var _0xcb4733=_0xcad6[_0x272f67];return _0xcb4733;};'use strict';var utils=require(_0x6cad('0x0'));var logger=require(_0x6cad('0x1'))('routing');exports['consequence']=function(_0x2539c6,_0x191a93){return function(_0x43953c){try{logger[_0x6cad('0x2')](_0x6cad('0x3'),_0x2539c6,utils[_0x6cad('0x4')](_0x191a93[0x0],this));_0x43953c[_0x6cad('0x5')]();}catch(_0x48aaaa){logger[_0x6cad('0x6')](_0x6cad('0x3'),_0x2539c6,JSON[_0x6cad('0x7')](_0x48aaaa));_0x43953c[_0x6cad('0x8')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/queue.js b/server/services/routing/server/applications/queue.js index e57ec40..875f24b 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 _0xa8cc=['create','catch','error','create\x20queue\x20report','accepted','body','update','update\x20queue\x20report','waiting','timeout','[%s][END:QUEUE][NAME:%s]','toLowerCase','length','[%s][QUEUE]\x20%s','join','stop','find','Queues','atimeout','qtimeout','rules','end','[%s][QUEUE]\x20ROUTING\x20STOPPED','close','complete','[%s][QUEUE]\x20APPLICATION\x20END','rrmemory','beepall','log','lodash','util','seq-queue','moment','ioredis','../../../../config/environment','../../../../config/logger','redis','defaults','socket.io-emitter','queue_id','account','queue','from','joinAt','emit','format','%sQueuesWaitingInteractions','pick','%s:queue:%s','%s_queue_waiting_interaction:%s','save','remove','../../rpc/mailQueueReport','../../rpc/faxQueueReport','../../rpc/whatsappQueueReport','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number','YYYY-MM-DD\x20HH:mm:ss','contact','list','upperFirst','channel','InteractionId','MessageId','message','AccountId','WebsiteId','info','[%s][START:QUEUE][NAME:%s]','name','QueueReport'];(function(_0x555ebb,_0x4b1b68){var _0x3c0a4a=function(_0x312e2f){while(--_0x312e2f){_0x555ebb['push'](_0x555ebb['shift']());}};_0x3c0a4a(++_0x4b1b68);}(_0xa8cc,0xf8));var _0xca8c=function(_0x449394,_0x23871b){_0x449394=_0x449394-0x0;var _0x3ea621=_0xa8cc[_0x449394];return _0x3ea621;};'use strict';var schema=require('validate');var _=require(_0xca8c('0x0'));var util=require(_0xca8c('0x1'));var seqqueue=require(_0xca8c('0x2'));var moment=require(_0xca8c('0x3'));var Redis=require(_0xca8c('0x4'));var config=require(_0xca8c('0x5'));var logger=require(_0xca8c('0x6'))('routing');var strategy=require('./strategy');config[_0xca8c('0x7')]=_[_0xca8c('0x8')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0xca8c('0x9'))(new Redis(config[_0xca8c('0x7')]));var attributes=['id',_0xca8c('0xa'),_0xca8c('0xb'),_0xca8c('0xc'),_0xca8c('0xd'),_0xca8c('0xe')];function emit(_0x4976a2,_0x2d4b45,_0x376f3b){io['to'](_0x4976a2)[_0xca8c('0xf')](_0x2d4b45,_0x376f3b);}function emitChannelQueueInteraction(_0x4eac85,_0x166f3b,_0x466f01,_0x4dce58,_0x95f1e2,_0x3b9f2c,_0x30e748,_0x50ac55){var _0x4abb33=_['clone'](_0x466f01);_0x4abb33['queue_id']=_0x50ac55;_0x4abb33['queue']=_0x166f3b;_0x4abb33[_0xca8c('0xb')]=_0x4dce58;_0x4abb33['id']=_0x95f1e2;if(_0x3b9f2c){_0x30e748[util[_0xca8c('0x10')](_0xca8c('0x11'),_0x4eac85)][_0x95f1e2]=_[_0xca8c('0x12')](_0x4abb33,attributes);}else{delete _0x30e748[util[_0xca8c('0x10')](_0xca8c('0x11'),_0x4eac85)][_0x95f1e2];}emit(util[_0xca8c('0x10')](_0xca8c('0x13'),_0x4eac85,_0x166f3b),util['format'](_0xca8c('0x14'),_0x4eac85,_0x3b9f2c?_0xca8c('0x15'):_0xca8c('0x16')),_[_0xca8c('0x12')](_0x4abb33,attributes));}var rpc={'openchannelQueueReport':require('../../rpc/openchannelQueueReport'),'mailQueueReport':require(_0xca8c('0x17')),'chatQueueReport':require('../../rpc/chatQueueReport'),'smsQueueReport':require('../../rpc/smsQueueReport'),'faxQueueReport':require(_0xca8c('0x18')),'whatsappQueueReport':require(_0xca8c('0x19'))};var queue=schema({'name':{'type':_0xca8c('0x1a'),'required':!![],'message':_0xca8c('0x1b')},'timeout':{'type':_0xca8c('0x1c'),'message':_0xca8c('0x1d')}});function startRouting(_0x1264d6,_0x142e70,_0x33e2c5,_0x10a12d){if(_0x1264d6&&_0x142e70&&_0x33e2c5){_0x142e70['waiting']+=0x1;var _0x2eeb56={'uniqueid':_0x1264d6,'from':_0x33e2c5['body']?_0x33e2c5['body'][_0xca8c('0xd')]:'','joinAt':moment()[_0xca8c('0x10')](_0xca8c('0x1e')),'ContactId':_0x33e2c5['contact']?_0x33e2c5[_0xca8c('0x1f')]['id']:null,'ListId':_0x33e2c5[_0xca8c('0x20')]?_0x33e2c5[_0xca8c('0x20')]['id']:null};_0x2eeb56[_[_0xca8c('0x21')](_0x33e2c5[_0xca8c('0x22')])+'QueueId']=_0x142e70['id']||null;_0x2eeb56[_[_0xca8c('0x21')](_0x33e2c5[_0xca8c('0x22')])+_0xca8c('0x23')]=_0x33e2c5['interaction']?_0x33e2c5['interaction']['id']:null;_0x2eeb56[_[_0xca8c('0x21')](_0x33e2c5[_0xca8c('0x22')])+_0xca8c('0x24')]=_0x33e2c5['message']?_0x33e2c5[_0xca8c('0x25')]['id']:null;_0x2eeb56[_['upperFirst'](_0x33e2c5[_0xca8c('0x22')])+(_0x33e2c5['channel']!=='chat'?_0xca8c('0x26'):_0xca8c('0x27'))]=_0x33e2c5[_0xca8c('0xb')]?_0x33e2c5['account']['id']:null;logger[_0xca8c('0x28')](util[_0xca8c('0x10')](_0xca8c('0x29'),_0x1264d6,_0x142e70[_0xca8c('0x2a')]));emitChannelQueueInteraction(_0x33e2c5[_0xca8c('0x22')],_0x142e70['name'],_0x2eeb56,_0x33e2c5['account'][_0xca8c('0x2a')],_0x33e2c5[_0xca8c('0x25')]['id'],!![],_0x10a12d,_0x142e70['id']);if(rpc[_0x33e2c5['channel']+_0xca8c('0x2b')]){return rpc[_0x33e2c5[_0xca8c('0x22')]+_0xca8c('0x2b')][_0xca8c('0x2c')](_0x2eeb56)[_0xca8c('0x2d')](function(_0x41e48d){logger[_0xca8c('0x2e')](_0xca8c('0x2f'));});}}}function stopRouting(_0x3ca151,_0x295015,_0x3855c9,_0x46287c){if(_0x3ca151&&_0x295015){_0x295015['waiting']-=0x1;var _0x18ac66={'leaveAt':moment()[_0xca8c('0x10')](_0xca8c('0x1e')),'acceptAt':moment()['format'](_0xca8c('0x1e')),'reason':_0xca8c('0x30')};logger[_0xca8c('0x28')](util['format']('[%s][STOP:QUEUE][NAME:%s]',_0x3ca151,_0x295015['name']));emitChannelQueueInteraction(_0x3855c9[_0xca8c('0x22')],_0x295015[_0xca8c('0x2a')],_0x3855c9[_0xca8c('0x31')],_0x3855c9[_0xca8c('0xb')]['name'],_0x3855c9[_0xca8c('0x25')]['id'],![],_0x46287c,_0x295015['id']);if(rpc[_0x3855c9[_0xca8c('0x22')]+_0xca8c('0x2b')]){return rpc[_0x3855c9['channel']+'QueueReport'][_0xca8c('0x32')](_0x3ca151,_0x18ac66)['catch'](function(_0x4c3b8a){logger[_0xca8c('0x2e')](_0xca8c('0x33'));});}}}function endRouting(_0x13925e,_0x4f0302,_0xe1fbf4,_0x293034){if(_0x13925e&&_0x4f0302){_0x4f0302[_0xca8c('0x34')]-=0x1;var _0x3ec712={'leaveAt':moment()[_0xca8c('0x10')]('YYYY-MM-DD\x20HH:mm:ss'),'exitAt':moment()[_0xca8c('0x10')](_0xca8c('0x1e')),'reason':_0xca8c('0x35')};logger[_0xca8c('0x28')](util[_0xca8c('0x10')](_0xca8c('0x36'),_0x13925e,_0x4f0302[_0xca8c('0x2a')]));emitChannelQueueInteraction(_0xe1fbf4[_0xca8c('0x22')],_0x4f0302[_0xca8c('0x2a')],_0xe1fbf4[_0xca8c('0x31')],_0xe1fbf4[_0xca8c('0xb')][_0xca8c('0x2a')],_0xe1fbf4[_0xca8c('0x25')]['id'],![],_0x293034);if(rpc[_0xe1fbf4[_0xca8c('0x22')]+_0xca8c('0x2b')]){return rpc[_0xe1fbf4[_0xca8c('0x22')]+_0xca8c('0x2b')][_0xca8c('0x32')](_0x13925e,_0x3ec712)[_0xca8c('0x2d')](function(_0x5e0266){logger[_0xca8c('0x2e')](_0xca8c('0x33'));});}}}function handleFindQueue(_0x5a11c6){return function(_0x321b1b){return _0x321b1b[_0xca8c('0x2a')]['toLowerCase']()===_0x5a11c6[_0xca8c('0x37')]();};}exports['consequence']=function(_0x3f67ea,_0x28c062,_0x2be142,_0x505a5b){return function(_0x314c13){try{var _0x5e36f1={'name':_0x28c062[0x0],'timeout':_0x28c062[0x1]};var _0x246ea2=queue['validate'](_0x5e36f1,{'typecast':!![]});if(_0x246ea2[_0xca8c('0x38')]){logger[_0xca8c('0x2e')](_0xca8c('0x39'),_0x3f67ea,_['map'](_0x246ea2,_0xca8c('0x25'))[_0xca8c('0x3a')](',\x20'));_0x314c13[_0xca8c('0x3b')]();}else{var _0x39ef47=_[_0xca8c('0x3c')](_0x2be142[_0x505a5b['channel']+_0xca8c('0x3d')],handleFindQueue(_0x5e36f1[_0xca8c('0x2a')]));if(_0x39ef47){startRouting(_0x3f67ea,_0x39ef47,_0x505a5b,_0x2be142);var _0x15788f=(_0x39ef47[_0xca8c('0x35')]||0xa)*0x3e8;var _0x37faf5=(_0x5e36f1['timeout']||0x14)*0x3e8;var _0x397620,_0x353152;if(_0x15788f>_0x37faf5){_0x37faf5=_0x15788f;}var _0x14a7ee=seqqueue['createQueue'](_0x15788f);_0x14a7ee['id']=_0x3f67ea;_0x14a7ee[_0xca8c('0x3e')]=_0x15788f;_0x14a7ee[_0xca8c('0x3f')]=_0x37faf5;_0x14a7ee[_0xca8c('0x22')]=_0x505a5b[_0xca8c('0x22')];_0x2be142[_0xca8c('0x40')][_0x3f67ea]['on'](_0xca8c('0x41'),function(){logger[_0xca8c('0x28')](_0xca8c('0x42'),_0x3f67ea);stopRouting(_0x3f67ea,_0x39ef47,_0x505a5b,_0x2be142);clearTimeout(_0x397620);_0x397620=undefined;_0x14a7ee[_0xca8c('0x43')](!![]);if(_0x2be142[_0xca8c('0x40')][_0x3f67ea]){delete _0x2be142[_0xca8c('0x40')][_0x3f67ea];}_0x314c13[_0xca8c('0x3b')]();});_0x2be142['rules'][_0x3f67ea]['on'](_0xca8c('0x44'),function(){if(_0x2be142[_0xca8c('0x40')][_0x3f67ea]){delete _0x2be142[_0xca8c('0x40')][_0x3f67ea];}});_0x397620=setTimeout(function(){logger['info'](_0xca8c('0x45'),_0x3f67ea);endRouting(_0x3f67ea,_0x39ef47,_0x505a5b,_0x2be142);clearTimeout(_0x397620);_0x14a7ee[_0xca8c('0x43')](!![]);_0x314c13['next']();},_0x37faf5);switch(_0x39ef47['strategy']){case'rrmemory':strategy[_0xca8c('0x46')](_0x14a7ee,_0x39ef47,_0x2be142,_0x505a5b);break;default:strategy[_0xca8c('0x47')](_0x14a7ee,_0x39ef47,_0x2be142,_0x505a5b);}}else{logger[_0xca8c('0x2e')]('[%s][QUEUE]\x20queue\x20not\x20found\x20%s',_0x3f67ea,_0x5e36f1[_0xca8c('0x2a')]);_0x314c13[_0xca8c('0x3b')]();}}}catch(_0x2b3c3b){console[_0xca8c('0x48')](_0x2b3c3b);logger[_0xca8c('0x2e')]('[%s][QUEUE]\x20%s',_0x3f67ea,_0x2b3c3b['stack']);_0x314c13['stop']();}};}; \ No newline at end of file +var _0x9472=['join','find','Queues','createQueue','atimeout','qtimeout','rules','end','info','[%s][QUEUE]\x20ROUTING\x20STOPPED','stop','complete','[%s][QUEUE]\x20APPLICATION\x20END','close','next','strategy','beepall','stack','validate','lodash','util','seq-queue','moment','ioredis','../../../../config/environment','routing','redis','localhost','socket.io-emitter','queue_id','queue','from','joinAt','emit','clone','format','%sQueuesWaitingInteractions','pick','%s:queue:%s','%s_queue_waiting_interaction:%s','save','../../rpc/openchannelQueueReport','../../rpc/mailQueueReport','../../rpc/chatQueueReport','../../rpc/smsQueueReport','../../rpc/faxQueueReport','../../rpc/whatsappQueueReport','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','waiting','body','YYYY-MM-DD\x20HH:mm:ss','list','upperFirst','channel','QueueId','InteractionId','interaction','MessageId','message','chat','AccountId','WebsiteId','account','QueueReport','create','catch','error','create\x20queue\x20report','accepted','[%s][STOP:QUEUE][NAME:%s]','name','update','update\x20queue\x20report','timeout','toLowerCase','consequence','length','[%s][QUEUE]\x20%s'];(function(_0x3eae2a,_0x14891c){var _0x1edc10=function(_0x34781f){while(--_0x34781f){_0x3eae2a['push'](_0x3eae2a['shift']());}};_0x1edc10(++_0x14891c);}(_0x9472,0xff));var _0x2947=function(_0x573d10,_0x2a1909){_0x573d10=_0x573d10-0x0;var _0x1f3dd4=_0x9472[_0x573d10];return _0x1f3dd4;};'use strict';var schema=require(_0x2947('0x0'));var _=require(_0x2947('0x1'));var util=require(_0x2947('0x2'));var seqqueue=require(_0x2947('0x3'));var moment=require(_0x2947('0x4'));var Redis=require(_0x2947('0x5'));var config=require(_0x2947('0x6'));var logger=require('../../../../config/logger')(_0x2947('0x7'));var strategy=require('./strategy');config[_0x2947('0x8')]=_['defaults'](config['redis'],{'host':_0x2947('0x9'),'port':0x18eb});var io=require(_0x2947('0xa'))(new Redis(config[_0x2947('0x8')]));var attributes=['id',_0x2947('0xb'),'account',_0x2947('0xc'),_0x2947('0xd'),_0x2947('0xe')];function emit(_0x4d0a2f,_0x55c559,_0x14b3e2){io['to'](_0x4d0a2f)[_0x2947('0xf')](_0x55c559,_0x14b3e2);}function emitChannelQueueInteraction(_0x5a3318,_0x1f168c,_0x20b7fd,_0x42ff4c,_0x1d38c3,_0x5ade08,_0x122ac1,_0x57c31a){var _0xfb2751=_[_0x2947('0x10')](_0x20b7fd);_0xfb2751[_0x2947('0xb')]=_0x57c31a;_0xfb2751[_0x2947('0xc')]=_0x1f168c;_0xfb2751['account']=_0x42ff4c;_0xfb2751['id']=_0x1d38c3;if(_0x5ade08){_0x122ac1[util[_0x2947('0x11')](_0x2947('0x12'),_0x5a3318)][_0x1d38c3]=_[_0x2947('0x13')](_0xfb2751,attributes);}else{delete _0x122ac1[util[_0x2947('0x11')]('%sQueuesWaitingInteractions',_0x5a3318)][_0x1d38c3];}emit(util[_0x2947('0x11')](_0x2947('0x14'),_0x5a3318,_0x1f168c),util[_0x2947('0x11')](_0x2947('0x15'),_0x5a3318,_0x5ade08?_0x2947('0x16'):'remove'),_[_0x2947('0x13')](_0xfb2751,attributes));}var rpc={'openchannelQueueReport':require(_0x2947('0x17')),'mailQueueReport':require(_0x2947('0x18')),'chatQueueReport':require(_0x2947('0x19')),'smsQueueReport':require(_0x2947('0x1a')),'faxQueueReport':require(_0x2947('0x1b')),'whatsappQueueReport':require(_0x2947('0x1c'))};var queue=schema({'name':{'type':_0x2947('0x1d'),'required':!![],'message':_0x2947('0x1e')},'timeout':{'type':'number','message':'timeout\x20is\x20a\x20number'}});function startRouting(_0x5a3c28,_0x1aea62,_0x1314dd,_0x40e5ea){if(_0x5a3c28&&_0x1aea62&&_0x1314dd){_0x1aea62[_0x2947('0x1f')]+=0x1;var _0x5d51b4={'uniqueid':_0x5a3c28,'from':_0x1314dd['body']?_0x1314dd[_0x2947('0x20')][_0x2947('0xd')]:'','joinAt':moment()[_0x2947('0x11')](_0x2947('0x21')),'ContactId':_0x1314dd['contact']?_0x1314dd['contact']['id']:null,'ListId':_0x1314dd[_0x2947('0x22')]?_0x1314dd[_0x2947('0x22')]['id']:null};_0x5d51b4[_[_0x2947('0x23')](_0x1314dd[_0x2947('0x24')])+_0x2947('0x25')]=_0x1aea62['id']||null;_0x5d51b4[_[_0x2947('0x23')](_0x1314dd[_0x2947('0x24')])+_0x2947('0x26')]=_0x1314dd['interaction']?_0x1314dd[_0x2947('0x27')]['id']:null;_0x5d51b4[_[_0x2947('0x23')](_0x1314dd[_0x2947('0x24')])+_0x2947('0x28')]=_0x1314dd[_0x2947('0x29')]?_0x1314dd['message']['id']:null;_0x5d51b4[_['upperFirst'](_0x1314dd[_0x2947('0x24')])+(_0x1314dd[_0x2947('0x24')]!==_0x2947('0x2a')?_0x2947('0x2b'):_0x2947('0x2c'))]=_0x1314dd[_0x2947('0x2d')]?_0x1314dd['account']['id']:null;logger['info'](util[_0x2947('0x11')]('[%s][START:QUEUE][NAME:%s]',_0x5a3c28,_0x1aea62['name']));emitChannelQueueInteraction(_0x1314dd[_0x2947('0x24')],_0x1aea62['name'],_0x5d51b4,_0x1314dd[_0x2947('0x2d')]['name'],_0x1314dd[_0x2947('0x29')]['id'],!![],_0x40e5ea,_0x1aea62['id']);if(rpc[_0x1314dd[_0x2947('0x24')]+_0x2947('0x2e')]){return rpc[_0x1314dd[_0x2947('0x24')]+_0x2947('0x2e')][_0x2947('0x2f')](_0x5d51b4)[_0x2947('0x30')](function(_0x42b96f){logger[_0x2947('0x31')](_0x2947('0x32'));});}}}function stopRouting(_0x5dd378,_0x235eb1,_0x37ca64,_0x1911cf){if(_0x5dd378&&_0x235eb1){_0x235eb1['waiting']-=0x1;var _0x57fac7={'leaveAt':moment()[_0x2947('0x11')](_0x2947('0x21')),'acceptAt':moment()[_0x2947('0x11')]('YYYY-MM-DD\x20HH:mm:ss'),'reason':_0x2947('0x33')};logger['info'](util[_0x2947('0x11')](_0x2947('0x34'),_0x5dd378,_0x235eb1[_0x2947('0x35')]));emitChannelQueueInteraction(_0x37ca64[_0x2947('0x24')],_0x235eb1[_0x2947('0x35')],_0x37ca64[_0x2947('0x20')],_0x37ca64[_0x2947('0x2d')][_0x2947('0x35')],_0x37ca64['message']['id'],![],_0x1911cf,_0x235eb1['id']);if(rpc[_0x37ca64[_0x2947('0x24')]+'QueueReport']){return rpc[_0x37ca64['channel']+_0x2947('0x2e')][_0x2947('0x36')](_0x5dd378,_0x57fac7)[_0x2947('0x30')](function(_0x2c98f9){logger[_0x2947('0x31')](_0x2947('0x37'));});}}}function endRouting(_0x3b0fdd,_0x2a7e86,_0x403bd7,_0x5274f6){if(_0x3b0fdd&&_0x2a7e86){_0x2a7e86[_0x2947('0x1f')]-=0x1;var _0x31ea39={'leaveAt':moment()['format'](_0x2947('0x21')),'exitAt':moment()[_0x2947('0x11')]('YYYY-MM-DD\x20HH:mm:ss'),'reason':_0x2947('0x38')};logger['info'](util[_0x2947('0x11')]('[%s][END:QUEUE][NAME:%s]',_0x3b0fdd,_0x2a7e86[_0x2947('0x35')]));emitChannelQueueInteraction(_0x403bd7[_0x2947('0x24')],_0x2a7e86[_0x2947('0x35')],_0x403bd7[_0x2947('0x20')],_0x403bd7[_0x2947('0x2d')][_0x2947('0x35')],_0x403bd7[_0x2947('0x29')]['id'],![],_0x5274f6);if(rpc[_0x403bd7[_0x2947('0x24')]+_0x2947('0x2e')]){return rpc[_0x403bd7['channel']+_0x2947('0x2e')][_0x2947('0x36')](_0x3b0fdd,_0x31ea39)[_0x2947('0x30')](function(_0x143cbf){logger[_0x2947('0x31')](_0x2947('0x37'));});}}}function handleFindQueue(_0x383a01){return function(_0x98220e){return _0x98220e[_0x2947('0x35')][_0x2947('0x39')]()===_0x383a01[_0x2947('0x39')]();};}exports[_0x2947('0x3a')]=function(_0x400e13,_0x37fb5e,_0x4e31ba,_0x3d909e){return function(_0x3ab737){try{var _0x37606e={'name':_0x37fb5e[0x0],'timeout':_0x37fb5e[0x1]};var _0x3ec5a6=queue['validate'](_0x37606e,{'typecast':!![]});if(_0x3ec5a6[_0x2947('0x3b')]){logger[_0x2947('0x31')](_0x2947('0x3c'),_0x400e13,_['map'](_0x3ec5a6,_0x2947('0x29'))[_0x2947('0x3d')](',\x20'));_0x3ab737['stop']();}else{var _0x4fb6d5=_[_0x2947('0x3e')](_0x4e31ba[_0x3d909e[_0x2947('0x24')]+_0x2947('0x3f')],handleFindQueue(_0x37606e[_0x2947('0x35')]));if(_0x4fb6d5){startRouting(_0x400e13,_0x4fb6d5,_0x3d909e,_0x4e31ba);var _0x283199=(_0x4fb6d5[_0x2947('0x38')]||0xa)*0x3e8;var _0x50c940=(_0x37606e[_0x2947('0x38')]||0x14)*0x3e8;var _0x4d20ee,_0x3917ee;if(_0x283199>_0x50c940){_0x50c940=_0x283199;}var _0x13ad62=seqqueue[_0x2947('0x40')](_0x283199);_0x13ad62['id']=_0x400e13;_0x13ad62[_0x2947('0x41')]=_0x283199;_0x13ad62[_0x2947('0x42')]=_0x50c940;_0x13ad62[_0x2947('0x24')]=_0x3d909e[_0x2947('0x24')];_0x4e31ba[_0x2947('0x43')][_0x400e13]['on'](_0x2947('0x44'),function(){logger[_0x2947('0x45')](_0x2947('0x46'),_0x400e13);stopRouting(_0x400e13,_0x4fb6d5,_0x3d909e,_0x4e31ba);clearTimeout(_0x4d20ee);_0x4d20ee=undefined;_0x13ad62['close'](!![]);if(_0x4e31ba[_0x2947('0x43')][_0x400e13]){delete _0x4e31ba['rules'][_0x400e13];}_0x3ab737[_0x2947('0x47')]();});_0x4e31ba['rules'][_0x400e13]['on'](_0x2947('0x48'),function(){if(_0x4e31ba[_0x2947('0x43')][_0x400e13]){delete _0x4e31ba[_0x2947('0x43')][_0x400e13];}});_0x4d20ee=setTimeout(function(){logger[_0x2947('0x45')](_0x2947('0x49'),_0x400e13);endRouting(_0x400e13,_0x4fb6d5,_0x3d909e,_0x4e31ba);clearTimeout(_0x4d20ee);_0x13ad62[_0x2947('0x4a')](!![]);_0x3ab737[_0x2947('0x4b')]();},_0x50c940);switch(_0x4fb6d5[_0x2947('0x4c')]){case'rrmemory':strategy['rrmemory'](_0x13ad62,_0x4fb6d5,_0x4e31ba,_0x3d909e);break;default:strategy[_0x2947('0x4d')](_0x13ad62,_0x4fb6d5,_0x4e31ba,_0x3d909e);}}else{logger[_0x2947('0x31')]('[%s][QUEUE]\x20queue\x20not\x20found\x20%s',_0x400e13,_0x37606e[_0x2947('0x35')]);_0x3ab737['stop']();}}}catch(_0x34a3c4){console['log'](_0x34a3c4);logger['error']('[%s][QUEUE]\x20%s',_0x400e13,_0x34a3c4[_0x2947('0x4e')]);_0x3ab737['stop']();}};}; \ 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 22f37cd..f2153c5 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 _0xd101=[':FORCED','[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available','isNil','[%s][AGENT]\x20timeout\x20with\x20%s','STOP','TIMEOUT','exports','lodash','uuid','./util','../../../../../config/logger','routing','notificationId','squeue','agent','realtime','push','handleRun','timeout','handleTimeout','bind','handleDrained','prototype','info','agents','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','forcedOwnership','isAgentAvailable','channel','busy','busyQueue','writeLog','RINGING'];(function(_0x3836ae,_0x33dcdb){var _0x4d4a64=function(_0x58810e){while(--_0x58810e){_0x3836ae['push'](_0x3836ae['shift']());}};_0x4d4a64(++_0x33dcdb);}(_0xd101,0x1b4));var _0x1d10=function(_0x595b65,_0x285960){_0x595b65=_0x595b65-0x0;var _0x5bd8b9=_0xd101[_0x595b65];return _0x5bd8b9;};'use strict';var _=require(_0x1d10('0x0'));var uuid=require(_0x1d10('0x1'));var util=require(_0x1d10('0x2'));var logger=require(_0x1d10('0x3'))(_0x1d10('0x4'));var Agent=function(_0x16eb31,_0x37289f,_0x2b3951,_0x3fca2){this[_0x1d10('0x5')]=uuid['v4']();this[_0x1d10('0x6')]=_0x16eb31;this[_0x1d10('0x7')]=_0x37289f;this[_0x1d10('0x8')]=_0x2b3951;this[_0x1d10('0x4')]=_0x3fca2;this[_0x1d10('0x6')][_0x1d10('0x9')](this[_0x1d10('0xa')]['bind'](this),this['handleTimeout']['bind'](this));this[_0x1d10('0x6')]['on'](_0x1d10('0xb'),this[_0x1d10('0xc')][_0x1d10('0xd')](this));this['squeue']['on']('drained',this[_0x1d10('0xe')][_0x1d10('0xd')](this));};Agent[_0x1d10('0xf')][_0x1d10('0x9')]=function(){this[_0x1d10('0x6')][_0x1d10('0x9')](this['handleRun'][_0x1d10('0xd')](this),this[_0x1d10('0xc')][_0x1d10('0xd')](this));};Agent['prototype'][_0x1d10('0xe')]=function(){this[_0x1d10('0xc')](!![]);};Agent['prototype']['handleRun']=function(_0x28569b){logger[_0x1d10('0x10')]('[%s][AGENT]\x20try\x20with\x20%s',this[_0x1d10('0x6')]['id'],this[_0x1d10('0x7')]['id']);if(_['isNil'](this[_0x1d10('0x8')][_0x1d10('0x11')][this[_0x1d10('0x7')]['id']])){logger[_0x1d10('0x10')](_0x1d10('0x12'),this['squeue']['id'],this['agent']['id']);setTimeout(this['push'][_0x1d10('0xd')](this),0x3e8);}else{if(this['routing'][_0x1d10('0x13')]||util[_0x1d10('0x14')](this[_0x1d10('0x6')]['id'],this[_0x1d10('0x8')][_0x1d10('0x11')][this[_0x1d10('0x7')]['id']],this[_0x1d10('0x6')][_0x1d10('0x15')],![])){this[_0x1d10('0x8')][_0x1d10('0x11')][this[_0x1d10('0x7')]['id']][_0x1d10('0x16')]=!![];this[_0x1d10('0x8')][_0x1d10('0x11')][this['agent']['id']][_0x1d10('0x17')]=undefined;util['showNotification'](this[_0x1d10('0x5')],this[_0x1d10('0x6')]['id'],this[_0x1d10('0x8')][_0x1d10('0x11')][this[_0x1d10('0x7')]['id']],null,this[_0x1d10('0x4')]);util[_0x1d10('0x18')](this['squeue']['id'],this[_0x1d10('0x8')]['agents'][this[_0x1d10('0x7')]['id']],_0x1d10('0x19')+(this[_0x1d10('0x4')][_0x1d10('0x13')]?_0x1d10('0x1a'):''));}else{logger['info'](_0x1d10('0x1b'),this[_0x1d10('0x6')]['id'],this[_0x1d10('0x7')]['id']);setTimeout(this[_0x1d10('0x9')]['bind'](this),0x3e8);}}};Agent['prototype']['handleTimeout']=function(_0x386f48){if(_[_0x1d10('0x1c')](this[_0x1d10('0x8')]['agents'][this[_0x1d10('0x7')]['id']])){return logger[_0x1d10('0x10')](_0x1d10('0x12'),this[_0x1d10('0x6')]['id'],this[_0x1d10('0x7')]['id']);}else{logger[_0x1d10('0x10')](_0x1d10('0x1d'),this['squeue']['id'],this[_0x1d10('0x7')]['id']);util['hideNotification'](this[_0x1d10('0x5')],this[_0x1d10('0x6')]['id'],this[_0x1d10('0x8')][_0x1d10('0x11')][this[_0x1d10('0x7')]['id']],null,this['routing']);this[_0x1d10('0x8')][_0x1d10('0x11')][this[_0x1d10('0x7')]['id']][_0x1d10('0x16')]=![];this[_0x1d10('0x8')][_0x1d10('0x11')][this[_0x1d10('0x7')]['id']][_0x1d10('0x17')]=undefined;util[_0x1d10('0x18')](this['squeue']['id'],this[_0x1d10('0x8')][_0x1d10('0x11')][this[_0x1d10('0x7')]['id']],_0x386f48?_0x1d10('0x1e'):_0x1d10('0x1f'));}if(!_0x386f48){setTimeout(this['push'][_0x1d10('0xd')](this),0x3e8);}};function agent(_0x2d5c2c,_0x47f658,_0x2d727b,_0x53b957){return new Agent(_0x2d5c2c,_0x47f658,_0x2d727b,_0x53b957);}module[_0x1d10('0x20')]=agent; \ No newline at end of file +var _0xa455=['agent','realtime','handleRun','handleTimeout','bind','timeout','drained','prototype','push','handleDrained','info','[%s][AGENT]\x20try\x20with\x20%s','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','forcedOwnership','isAgentAvailable','channel','agents','busy','busyQueue','showNotification','writeLog','RINGING',':FORCED','[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available','[%s][AGENT]\x20timeout\x20with\x20%s','hideNotification','STOP','TIMEOUT','exports','uuid','./util','routing','notificationId','squeue'];(function(_0x37bd26,_0x5ad346){var _0xe83dc4=function(_0x1ac229){while(--_0x1ac229){_0x37bd26['push'](_0x37bd26['shift']());}};_0xe83dc4(++_0x5ad346);}(_0xa455,0x193));var _0x5a45=function(_0x2d4b1a,_0x376e57){_0x2d4b1a=_0x2d4b1a-0x0;var _0x2e53e0=_0xa455[_0x2d4b1a];return _0x2e53e0;};'use strict';var _=require('lodash');var uuid=require(_0x5a45('0x0'));var util=require(_0x5a45('0x1'));var logger=require('../../../../../config/logger')(_0x5a45('0x2'));var Agent=function(_0x42e41a,_0x30acf0,_0x4dd1b7,_0x1c561b){this[_0x5a45('0x3')]=uuid['v4']();this[_0x5a45('0x4')]=_0x42e41a;this[_0x5a45('0x5')]=_0x30acf0;this[_0x5a45('0x6')]=_0x4dd1b7;this[_0x5a45('0x2')]=_0x1c561b;this['squeue']['push'](this[_0x5a45('0x7')]['bind'](this),this[_0x5a45('0x8')][_0x5a45('0x9')](this));this['squeue']['on'](_0x5a45('0xa'),this['handleTimeout'][_0x5a45('0x9')](this));this[_0x5a45('0x4')]['on'](_0x5a45('0xb'),this['handleDrained'][_0x5a45('0x9')](this));};Agent[_0x5a45('0xc')][_0x5a45('0xd')]=function(){this['squeue'][_0x5a45('0xd')](this['handleRun']['bind'](this),this[_0x5a45('0x8')]['bind'](this));};Agent[_0x5a45('0xc')][_0x5a45('0xe')]=function(){this[_0x5a45('0x8')](!![]);};Agent[_0x5a45('0xc')][_0x5a45('0x7')]=function(_0x5be7da){logger[_0x5a45('0xf')](_0x5a45('0x10'),this['squeue']['id'],this[_0x5a45('0x5')]['id']);if(_['isNil'](this[_0x5a45('0x6')]['agents'][this[_0x5a45('0x5')]['id']])){logger[_0x5a45('0xf')](_0x5a45('0x11'),this[_0x5a45('0x4')]['id'],this[_0x5a45('0x5')]['id']);setTimeout(this['push'][_0x5a45('0x9')](this),0x3e8);}else{if(this['routing'][_0x5a45('0x12')]||util[_0x5a45('0x13')](this[_0x5a45('0x4')]['id'],this[_0x5a45('0x6')]['agents'][this[_0x5a45('0x5')]['id']],this[_0x5a45('0x4')][_0x5a45('0x14')],![])){this[_0x5a45('0x6')][_0x5a45('0x15')][this[_0x5a45('0x5')]['id']][_0x5a45('0x16')]=!![];this[_0x5a45('0x6')][_0x5a45('0x15')][this['agent']['id']][_0x5a45('0x17')]=undefined;util[_0x5a45('0x18')](this[_0x5a45('0x3')],this[_0x5a45('0x4')]['id'],this['realtime'][_0x5a45('0x15')][this[_0x5a45('0x5')]['id']],null,this[_0x5a45('0x2')]);util[_0x5a45('0x19')](this[_0x5a45('0x4')]['id'],this['realtime'][_0x5a45('0x15')][this[_0x5a45('0x5')]['id']],_0x5a45('0x1a')+(this['routing'][_0x5a45('0x12')]?_0x5a45('0x1b'):''));}else{logger[_0x5a45('0xf')](_0x5a45('0x1c'),this[_0x5a45('0x4')]['id'],this[_0x5a45('0x5')]['id']);setTimeout(this[_0x5a45('0xd')][_0x5a45('0x9')](this),0x3e8);}}};Agent['prototype'][_0x5a45('0x8')]=function(_0x7204e3){if(_['isNil'](this['realtime'][_0x5a45('0x15')][this[_0x5a45('0x5')]['id']])){return logger['info']('[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s',this[_0x5a45('0x4')]['id'],this[_0x5a45('0x5')]['id']);}else{logger[_0x5a45('0xf')](_0x5a45('0x1d'),this[_0x5a45('0x4')]['id'],this[_0x5a45('0x5')]['id']);util[_0x5a45('0x1e')](this[_0x5a45('0x3')],this[_0x5a45('0x4')]['id'],this[_0x5a45('0x6')]['agents'][this['agent']['id']],null,this[_0x5a45('0x2')]);this[_0x5a45('0x6')][_0x5a45('0x15')][this[_0x5a45('0x5')]['id']][_0x5a45('0x16')]=![];this['realtime']['agents'][this[_0x5a45('0x5')]['id']][_0x5a45('0x17')]=undefined;util[_0x5a45('0x19')](this['squeue']['id'],this[_0x5a45('0x6')][_0x5a45('0x15')][this[_0x5a45('0x5')]['id']],_0x7204e3?_0x5a45('0x1f'):_0x5a45('0x20'));}if(!_0x7204e3){setTimeout(this[_0x5a45('0xd')][_0x5a45('0x9')](this),0x3e8);}};function agent(_0x2cca51,_0x4eb218,_0x5ac1d9,_0x53f638){return new Agent(_0x2cca51,_0x4eb218,_0x5ac1d9,_0x53f638);}module[_0x5a45('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 a1812f6..232512a 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 _0x86f4=['drained','handleDrained','prototype','isNil','Agents','length','agents','info','[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s','isAgentAvailable','channel','writeLog','RINGING','busy','busyQueue','name','showNotification','[%s][QUEUE]\x20ALL\x20AGENTS\x20ARE\x20BUSY','STOP','TIMEOUT','lodash','uuid','./util','../../../../../config/logger','routing','notificationId','queue','realtime','squeue','push','handleRun','handleTimeout','bind','timeout'];(function(_0x346cbe,_0x42914b){var _0x5e86d0=function(_0x588627){while(--_0x588627){_0x346cbe['push'](_0x346cbe['shift']());}};_0x5e86d0(++_0x42914b);}(_0x86f4,0x18a));var _0x486f=function(_0xa5fd92,_0x456b4c){_0xa5fd92=_0xa5fd92-0x0;var _0x32ed17=_0x86f4[_0xa5fd92];return _0x32ed17;};'use strict';var _=require(_0x486f('0x0'));var uuid=require(_0x486f('0x1'));var util=require(_0x486f('0x2'));var logger=require(_0x486f('0x3'))(_0x486f('0x4'));var Beepall=function(_0x10339c,_0x45067a,_0x53305d,_0xf8d50f){this[_0x486f('0x5')]=uuid['v4']();this['squeue']=_0x10339c;this[_0x486f('0x6')]=_0x45067a;this[_0x486f('0x7')]=_0x53305d;this[_0x486f('0x4')]=_0xf8d50f;this[_0x486f('0x8')][_0x486f('0x9')](this[_0x486f('0xa')]['bind'](this),this[_0x486f('0xb')][_0x486f('0xc')](this));this[_0x486f('0x8')]['on'](_0x486f('0xd'),this[_0x486f('0xb')][_0x486f('0xc')](this));this[_0x486f('0x8')]['on'](_0x486f('0xe'),this[_0x486f('0xf')][_0x486f('0xc')](this));};Beepall[_0x486f('0x10')][_0x486f('0x9')]=function(){this[_0x486f('0x8')][_0x486f('0x9')](this[_0x486f('0xa')][_0x486f('0xc')](this),this[_0x486f('0xb')]['bind'](this));};Beepall[_0x486f('0x10')]['handleDrained']=function(_0x46d0a9){this[_0x486f('0xb')](!![]);};Beepall[_0x486f('0x10')]['handleRun']=function(_0x5721ad){var _0x11c2af=!![];if(!_[_0x486f('0x11')](this['queue'])&&!_[_0x486f('0x11')](this[_0x486f('0x6')][_0x486f('0x12')])&&this['queue']['Agents'][_0x486f('0x13')]>0x0){for(var _0x3eeae0=0x0,_0x360cb7;_0x3eeae00x0){for(var _0x4778d5=0x0,_0x5a6e04;_0x4778d50x0&&_0x3525e8[_0x43c845+'CurrentCapacity']>=_0x3525e8[_0x43c845+'Capacity']){writeLog(_0x3d2943,_0x3525e8,_0x43c845[_0x477d('0x24')]()+_0x477d('0x25'));return![];}}return!![];};exports[_0x477d('0x26')]=function(_0x5c8ef1,_0x254141,_0x297d15,_0x74ebb4,_0xe4dd40){return sendNotification(!![],_0x5c8ef1,_0x254141,_0x297d15,_0x74ebb4,_0xe4dd40);};exports[_0x477d('0x27')]=function(_0x537fc4,_0x2fc959,_0xeb02f5,_0x17dd16,_0x25a329){return sendNotification(![],_0x537fc4,_0x2fc959,_0xeb02f5,_0x17dd16,_0x25a329);};exports[_0x477d('0x28')]=writeLog; \ No newline at end of file +var _0x4819=['format','notification:%s','remove','info','[%s][QUEUE][AGENT:%s][STATUS:%s]','busy','online','OFFLINE','hasOwnProperty','Capacity','CurrentCapacity','\x20MAXCAPACITY','showNotification','hideNotification','writeLog','util','../utils','mustache','ioredis','../../../../../config/environment','../../../../../config/logger','routing','redis','defaults','socket.io-emitter','emit','user:%s','name','user:save','split','\x20interaction','notificationSound','account','notificationShake','body','queue','msg','notificationTemplate'];(function(_0x14a513,_0x3239f){var _0x47236c=function(_0x394191){while(--_0x394191){_0x14a513['push'](_0x14a513['shift']());}};_0x47236c(++_0x3239f);}(_0x4819,0xcd));var _0x9481=function(_0x2eeed4,_0x28dc98){_0x2eeed4=_0x2eeed4-0x0;var _0x56099d=_0x4819[_0x2eeed4];return _0x56099d;};'use strict';var _=require('lodash');var util=require(_0x9481('0x0'));var utils=require(_0x9481('0x1'));var Mustache=require(_0x9481('0x2'));var Redis=require(_0x9481('0x3'));var config=require(_0x9481('0x4'));var logger=require(_0x9481('0x5'))(_0x9481('0x6'));config[_0x9481('0x7')]=_[_0x9481('0x8')](config[_0x9481('0x7')],{'host':'localhost','port':0x18eb});var io=require(_0x9481('0x9'))(new Redis(config['redis']));function emit(_0x54cc78,_0x14e05a,_0x6c6a08){io['to'](_0x54cc78)[_0x9481('0xa')](_0x14e05a,_0x6c6a08);}function sendNotification(_0x3278ff,_0x15d895,_0x4c7d9c,_0x1818cf,_0x521d18,_0x2fabf1){io['to'](util['format'](_0x9481('0xb'),_0x1818cf[_0x9481('0xc')]))[_0x9481('0xa')](_0x9481('0xd'),_0x1818cf);var _0xe84f77=_0x2fabf1||{};var _0x29515a=_0x4c7d9c[_0x9481('0xe')]('.');var _0xe410c3={'uniqueid':_0x15d895,'channel':_0x29515a[0x0],'id':_0x29515a[0x1],'title':_0x29515a[0x0]+_0x9481('0xf'),'interactionId':_0x29515a[0x2],'queue':_0x521d18?_0x521d18['name']:null,'sound':_0xe84f77['account'][_0x9481('0x10')],'shake':_0xe84f77[_0x9481('0x11')][_0x9481('0x12')]};try{if(!_0xe84f77[_0x9481('0x13')]){_0xe84f77[_0x9481('0x13')]={};}if(_0x521d18){_0xe84f77[_0x9481('0x13')][_0x9481('0x14')]=_0x521d18;}else if(_0xe84f77['body'][_0x9481('0x14')]){delete _0xe84f77[_0x9481('0x13')]['queue'];}_0xe410c3[_0x9481('0x15')]=utils['getMustacheRender'](_0xe84f77[_0x9481('0x11')][_0x9481('0x16')],_0xe84f77);}catch(_0x2bc12a){_0xe410c3[_0x9481('0x15')]='I\x20can\x27t\x20render\x20your\x20template';logger['error'](util[_0x9481('0x17')]('[%s][QUEUE]\x20%s',_0x15d895,_0x2bc12a['message']));}io['to'](util[_0x9481('0x17')](_0x9481('0xb'),_0x1818cf[_0x9481('0xc')]))[_0x9481('0xa')](util[_0x9481('0x17')](_0x9481('0x18'),_0x3278ff?'save':_0x9481('0x19')),_0xe410c3);}function writeLog(_0x272a84,_0x45f9df,_0x615e02){return logger[_0x9481('0x1a')](util['format'](_0x9481('0x1b'),_0x272a84,_0x45f9df[_0x9481('0xc')],_0x615e02));}exports['isAgentAvailable']=function(_0x2bcf37,_0xd1cd1a,_0x352b3a,_0x1809d2){if(_0xd1cd1a[_0x9481('0x1c')]){writeLog(_0x2bcf37,_0xd1cd1a,'BUSY');return![];}if(!_0xd1cd1a[_0x9481('0x1d')]){writeLog(_0x2bcf37,_0xd1cd1a,_0x9481('0x1e'));return![];}if(_0xd1cd1a[_0x352b3a+'Pause']){writeLog(_0x2bcf37,_0xd1cd1a,'PAUSE');return![];}if(_0x1809d2&&_0xd1cd1a[_0x9481('0x1f')](_0x352b3a+_0x9481('0x20'))&&_0xd1cd1a['hasOwnProperty'](_0x352b3a+_0x9481('0x21'))){if(_0xd1cd1a[_0x352b3a+_0x9481('0x20')]>0x0&&_0xd1cd1a[_0x352b3a+_0x9481('0x21')]>=_0xd1cd1a[_0x352b3a+_0x9481('0x20')]){writeLog(_0x2bcf37,_0xd1cd1a,_0x352b3a['toUpperCase']()+_0x9481('0x22'));return![];}}return!![];};exports[_0x9481('0x23')]=function(_0x3c2585,_0x587706,_0x1791b2,_0x56e944,_0x2e1eff){return sendNotification(!![],_0x3c2585,_0x587706,_0x1791b2,_0x56e944,_0x2e1eff);};exports[_0x9481('0x24')]=function(_0x22ab26,_0x13ef93,_0x2e5e63,_0x53560d,_0x2aa9ff){return sendNotification(![],_0x22ab26,_0x13ef93,_0x2e5e63,_0x53560d,_0x2aa9ff);};exports[_0x9481('0x25')]=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 4ae9e39..4320b89 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 _0xf897=['[%s][SYSTEM]\x20commnad:\x20%s','exec','trim','replace','isNil','[%s][SYSTEM]\x20no\x20variable','body','[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s','error','[%s][SYSTEM]\x20%s','isObject','stringify','validate','shelljs','lodash','./utils','../../../../config/logger','routing','string','command\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','length','message','join','info','next','getMustacheRender'];(function(_0x396466,_0xe9857b){var _0x5e9ab4=function(_0x362f66){while(--_0x362f66){_0x396466['push'](_0x396466['shift']());}};_0x5e9ab4(++_0xe9857b);}(_0xf897,0xe4));var _0x7f89=function(_0x5a46cb,_0x414e9e){_0x5a46cb=_0x5a46cb-0x0;var _0x463733=_0xf897[_0x5a46cb];return _0x463733;};'use strict';var schema=require(_0x7f89('0x0'));var sh=require(_0x7f89('0x1'));var _=require(_0x7f89('0x2'));var utils=require(_0x7f89('0x3'));var logger=require(_0x7f89('0x4'))(_0x7f89('0x5'));var system=schema({'command':{'type':_0x7f89('0x6'),'required':!![],'message':_0x7f89('0x7')}});exports[_0x7f89('0x8')]=function(_0x3b5e37,_0xc085b8){return function(_0x2f8e94){try{var _0x338dae={'command':_0xc085b8[0x0]};var _0x47f87d=system[_0x7f89('0x0')](_0x338dae,{'typecast':!![]});if(_0x47f87d[_0x7f89('0x9')]){logger['error']('[%s][SYSTEM]\x20%s',_0x3b5e37,_['map'](_0x47f87d,_0x7f89('0xa'))[_0x7f89('0xb')](',\x20'));logger[_0x7f89('0xc')]('[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next',_0x3b5e37);_0x2f8e94[_0x7f89('0xd')]();}else{var _0x1fff5c=this;var _0xdb1f8b=utils[_0x7f89('0xe')](_0xc085b8[0x0],this);logger[_0x7f89('0xc')](_0x7f89('0xf'),_0x3b5e37,_0xdb1f8b);sh[_0x7f89('0x10')](_[_0x7f89('0x11')](_0xdb1f8b),function(_0x4c9aa2,_0x46de80){logger[_0x7f89('0xc')]('[%s][SYSTEM]\x20result\x20code:\x20%s',_0x3b5e37,_0x4c9aa2);if(_0x4c9aa2==0x0){var _0x72616d=_0x46de80[_0x7f89('0x12')](/(\r\n|\n|\r)/gm,'');if(_[_0x7f89('0x13')](_0xc085b8[0x1])||_['isEmpty'](_0xc085b8[0x1])){logger['info'](_0x7f89('0x14'),_0x3b5e37);_0x1fff5c[_0x7f89('0x15')][_0xc085b8[0x1]]=_0x72616d;}else{logger[_0x7f89('0xc')](_0x7f89('0x16'),_0x3b5e37,_0xc085b8[0x1],_0x72616d);_0x1fff5c['body'][_0xc085b8[0x1]]=_0x72616d;}}_0x2f8e94['next']();});}}catch(_0x59c0b5){logger[_0x7f89('0x17')](_0x7f89('0x18'),_0x3b5e37,_[_0x7f89('0x19')](_0x59c0b5)?JSON[_0x7f89('0x1a')](_0x59c0b5):_0x59c0b5);logger[_0x7f89('0xc')]('[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next',_0x3b5e37);_0x2f8e94[_0x7f89('0xd')]();}};}; \ No newline at end of file +var _0x3fc6=['isNil','isEmpty','[%s][SYSTEM]\x20no\x20variable','[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s','body','isObject','stringify','validate','shelljs','lodash','../../../../config/logger','routing','string','command\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','error','[%s][SYSTEM]\x20%s','message','join','info','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','next','getMustacheRender','[%s][SYSTEM]\x20commnad:\x20%s','trim','replace'];(function(_0x190200,_0x1c5ec8){var _0x45988a=function(_0x1ef3d7){while(--_0x1ef3d7){_0x190200['push'](_0x190200['shift']());}};_0x45988a(++_0x1c5ec8);}(_0x3fc6,0x159));var _0x63fc=function(_0x4ce0a7,_0x247a61){_0x4ce0a7=_0x4ce0a7-0x0;var _0x3debf5=_0x3fc6[_0x4ce0a7];return _0x3debf5;};'use strict';var schema=require(_0x63fc('0x0'));var sh=require(_0x63fc('0x1'));var _=require(_0x63fc('0x2'));var utils=require('./utils');var logger=require(_0x63fc('0x3'))(_0x63fc('0x4'));var system=schema({'command':{'type':_0x63fc('0x5'),'required':!![],'message':_0x63fc('0x6')}});exports[_0x63fc('0x7')]=function(_0x13c33d,_0x4e6030){return function(_0x519c27){try{var _0xdb65b8={'command':_0x4e6030[0x0]};var _0x7d24f=system[_0x63fc('0x0')](_0xdb65b8,{'typecast':!![]});if(_0x7d24f['length']){logger[_0x63fc('0x8')](_0x63fc('0x9'),_0x13c33d,_['map'](_0x7d24f,_0x63fc('0xa'))[_0x63fc('0xb')](',\x20'));logger[_0x63fc('0xc')](_0x63fc('0xd'),_0x13c33d);_0x519c27[_0x63fc('0xe')]();}else{var _0x2b5926=this;var _0x17cf03=utils[_0x63fc('0xf')](_0x4e6030[0x0],this);logger[_0x63fc('0xc')](_0x63fc('0x10'),_0x13c33d,_0x17cf03);sh['exec'](_[_0x63fc('0x11')](_0x17cf03),function(_0x2f0e45,_0x227884){logger['info']('[%s][SYSTEM]\x20result\x20code:\x20%s',_0x13c33d,_0x2f0e45);if(_0x2f0e45==0x0){var _0x293c4c=_0x227884[_0x63fc('0x12')](/(\r\n|\n|\r)/gm,'');if(_[_0x63fc('0x13')](_0x4e6030[0x1])||_[_0x63fc('0x14')](_0x4e6030[0x1])){logger[_0x63fc('0xc')](_0x63fc('0x15'),_0x13c33d);_0x2b5926['body'][_0x4e6030[0x1]]=_0x293c4c;}else{logger[_0x63fc('0xc')](_0x63fc('0x16'),_0x13c33d,_0x4e6030[0x1],_0x293c4c);_0x2b5926[_0x63fc('0x17')][_0x4e6030[0x1]]=_0x293c4c;}}_0x519c27[_0x63fc('0xe')]();});}}catch(_0x5c4c72){logger[_0x63fc('0x8')]('[%s][SYSTEM]\x20%s',_0x13c33d,_[_0x63fc('0x18')](_0x5c4c72)?JSON[_0x63fc('0x19')](_0x5c4c72):_0x5c4c72);logger[_0x63fc('0xc')](_0x63fc('0xd'),_0x13c33d);_0x519c27[_0x63fc('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 fc8c3f7..4e79ed9 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 _0x37ad=['TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','validate','length','error','[%s][TAG]\x20%s','map','join','info','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','Interaction','addTags','then','channel','interaction','catch','stringify','finally','next','lodash','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','../../../../config/logger','routing','number'];(function(_0x152136,_0x4f14f1){var _0x20df44=function(_0x362877){while(--_0x362877){_0x152136['push'](_0x152136['shift']());}};_0x20df44(++_0x4f14f1);}(_0x37ad,0x152));var _0xd37a=function(_0x581511,_0x5306ec){_0x581511=_0x581511-0x0;var _0x40ae96=_0x37ad[_0x581511];return _0x40ae96;};'use strict';var schema=require('validate');var _=require(_0xd37a('0x0'));var rpc={'chatInteraction':require(_0xd37a('0x1')),'openchannelInteraction':require(_0xd37a('0x2')),'smsInteraction':require(_0xd37a('0x3')),'mailInteraction':require(_0xd37a('0x4')),'faxInteraction':require(_0xd37a('0x5')),'whatsappInteraction':require(_0xd37a('0x6'))};var logger=require(_0xd37a('0x7'))(_0xd37a('0x8'));var tag=schema({'tag':{'type':_0xd37a('0x9'),'required':!![],'message':_0xd37a('0xa')}});exports[_0xd37a('0xb')]=function(_0x522fcc,_0xb1ea59,_0x5b6c99,_0x168bb8){return function(_0x2b2ba8){try{var _0x168995={'tag':_0xb1ea59[0x0]};var _0x2f0b44=tag[_0xd37a('0xc')](_0x168995,{'typecast':!![]});if(_0x2f0b44[_0xd37a('0xd')]){logger[_0xd37a('0xe')](_0xd37a('0xf'),_0x522fcc,_[_0xd37a('0x10')](_0x2f0b44,'message')[_0xd37a('0x11')](',\x20'));logger[_0xd37a('0x12')](_0xd37a('0x13'),_0x522fcc);_0x2b2ba8['next']();}else{var _0x6f5cd1={'ids':[_0xb1ea59[0x0]]};if(rpc[_0x168bb8['channel']+_0xd37a('0x14')]){rpc[_0x168bb8['channel']+'Interaction'][_0xd37a('0x15')](_0x168bb8['interaction']['id'],_0x6f5cd1)[_0xd37a('0x16')](function(_0x3be213){logger['info']('[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s',_0x522fcc,_0xb1ea59[0x1],_0x168bb8[_0xd37a('0x17')],_0x168bb8[_0xd37a('0x18')]['id']);})[_0xd37a('0x19')](function(_0x2deb5a){logger[_0xd37a('0xe')](_0xd37a('0xf'),_0x522fcc,JSON[_0xd37a('0x1a')](_0x2deb5a));logger[_0xd37a('0x12')]('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0x522fcc);})[_0xd37a('0x1b')](function(){_0x2b2ba8[_0xd37a('0x1c')]();});}}}catch(_0x5c5333){logger['error'](_0xd37a('0xf'),_0x522fcc,_['isObject'](_0x5c5333)?JSON[_0xd37a('0x1a')](_0x5c5333):_0x5c5333);logger[_0xd37a('0x12')]('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0x522fcc);_0x2b2ba8[_0xd37a('0x1c')]();}};}; \ No newline at end of file +var _0x5b03=['message','join','info','Interaction','channel','interaction','then','[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s','catch','[%s][TAG]\x20%s','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','finally','next','isObject','stringify','validate','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/whatsappInteraction','routing','number','TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','length','error','map'];(function(_0x42bfc8,_0x199cb3){var _0x6d51f0=function(_0x1c7b07){while(--_0x1c7b07){_0x42bfc8['push'](_0x42bfc8['shift']());}};_0x6d51f0(++_0x199cb3);}(_0x5b03,0xb7));var _0x35b0=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x5b03[_0x321bb2];return _0x9c12ed;};'use strict';var schema=require(_0x35b0('0x0'));var _=require('lodash');var rpc={'chatInteraction':require(_0x35b0('0x1')),'openchannelInteraction':require(_0x35b0('0x2')),'smsInteraction':require(_0x35b0('0x3')),'mailInteraction':require(_0x35b0('0x4')),'faxInteraction':require('../../rpc/faxInteraction'),'whatsappInteraction':require(_0x35b0('0x5'))};var logger=require('../../../../config/logger')(_0x35b0('0x6'));var tag=schema({'tag':{'type':_0x35b0('0x7'),'required':!![],'message':_0x35b0('0x8')}});exports[_0x35b0('0x9')]=function(_0x12e124,_0x49e84b,_0x1d046f,_0xcec408){return function(_0x5ae008){try{var _0x5cf560={'tag':_0x49e84b[0x0]};var _0x5369b4=tag[_0x35b0('0x0')](_0x5cf560,{'typecast':!![]});if(_0x5369b4[_0x35b0('0xa')]){logger[_0x35b0('0xb')]('[%s][TAG]\x20%s',_0x12e124,_[_0x35b0('0xc')](_0x5369b4,_0x35b0('0xd'))[_0x35b0('0xe')](',\x20'));logger[_0x35b0('0xf')]('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0x12e124);_0x5ae008['next']();}else{var _0x4f0b82={'ids':[_0x49e84b[0x0]]};if(rpc[_0xcec408['channel']+_0x35b0('0x10')]){rpc[_0xcec408[_0x35b0('0x11')]+_0x35b0('0x10')]['addTags'](_0xcec408[_0x35b0('0x12')]['id'],_0x4f0b82)[_0x35b0('0x13')](function(_0x1c2acf){logger[_0x35b0('0xf')](_0x35b0('0x14'),_0x12e124,_0x49e84b[0x1],_0xcec408['channel'],_0xcec408['interaction']['id']);})[_0x35b0('0x15')](function(_0x56c04a){logger[_0x35b0('0xb')](_0x35b0('0x16'),_0x12e124,JSON['stringify'](_0x56c04a));logger['info'](_0x35b0('0x17'),_0x12e124);})[_0x35b0('0x18')](function(){_0x5ae008[_0x35b0('0x19')]();});}}}catch(_0x36b85a){logger[_0x35b0('0xb')](_0x35b0('0x16'),_0x12e124,_[_0x35b0('0x1a')](_0x36b85a)?JSON[_0x35b0('0x1b')](_0x36b85a):_0x36b85a);logger[_0x35b0('0xf')]('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0x12e124);_0x5ae008[_0x35b0('0x19')]();}};}; \ 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 13b55b0..429dd72 100644 --- a/server/services/routing/server/applications/utils.js +++ b/server/services/routing/server/applications/utils.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe706=['exports','render','merge','body','contact','message','account','interaction','list','mustache','lodash'];(function(_0x492987,_0x3fc2d5){var _0x4ee1a8=function(_0x3fe27b){while(--_0x3fe27b){_0x492987['push'](_0x492987['shift']());}};_0x4ee1a8(++_0x3fc2d5);}(_0xe706,0xa3));var _0x6e70=function(_0x1c5968,_0x68d40c){_0x1c5968=_0x1c5968-0x0;var _0x290441=_0xe706[_0x1c5968];return _0x290441;};'use strict';var Mustache=require(_0x6e70('0x0'));var _=require(_0x6e70('0x1'));module[_0x6e70('0x2')]={'getMustacheRender':function(_0x5e8446,_0x2cae77){return Mustache[_0x6e70('0x3')](_0x5e8446,_[_0x6e70('0x4')](_0x2cae77[_0x6e70('0x5')],{'contact':_0x2cae77[_0x6e70('0x6')],'message':_0x2cae77[_0x6e70('0x7')],'account':_0x2cae77[_0x6e70('0x8')],'interaction':_0x2cae77[_0x6e70('0x9')],'list':_0x2cae77[_0x6e70('0xa')]}))||'';}}; \ No newline at end of file +var _0xd8b0=['merge','body','contact','message','list','mustache','lodash','render'];(function(_0x46b80c,_0x5ede8f){var _0x1b7a8f=function(_0x5d154a){while(--_0x5d154a){_0x46b80c['push'](_0x46b80c['shift']());}};_0x1b7a8f(++_0x5ede8f);}(_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 8297f33..f007b4e 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 _0xbc72=['dialogflow','dialogflowv2','amazonlex','tag','TagId','appdata','%s:%s:%s','condition','intervals','consequence','priority','info','on\x20interval','error','.js','stringify','matchPath','stack','routing\x20is\x20empty','agent','agents','busy','message','emit','end','update','busyQueue','message\x20is\x20empty','hasOwnProperty','capacity','CurrentCapacity','updateRealtime','values','chatQueues','available','loggedIn','name','paused','waiting','mailQueues','openchannelQueues','smsQueues','faxQueues','whatsappQueues','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','server','http','127.0.0.1','log','Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','lodash','util','path','bluebird','uuid','../../../config/environment','../../../config/logger','../rpc/openchannelQueueReport','../rpc/mailQueueReport','../rpc/whatsappQueueReport','../lib/rule-engine','%s.%s.%s','isNil','map','Intervals','interval','listen','rules','channel','interaction','applications','length','join','app','toLowerCase','split','push','slice'];(function(_0x294e59,_0x1f3262){var _0x232b9d=function(_0x4aef5c){while(--_0x4aef5c){_0x294e59['push'](_0x294e59['shift']());}};_0x232b9d(++_0x1f3262);}(_0xbc72,0x8a));var _0x2bc7=function(_0xd905dc,_0x34e74d){_0xd905dc=_0xd905dc-0x0;var _0x4dd61d=_0xbc72[_0xd905dc];return _0x4dd61d;};'use strict';var _=require(_0x2bc7('0x0'));var util=require(_0x2bc7('0x1'));var path=require(_0x2bc7('0x2'));var fs=require('fs');var jayson=require('jayson/promise');var BPromise=require(_0x2bc7('0x3'));var uuid=require(_0x2bc7('0x4'));var config=require(_0x2bc7('0x5'));var logger=require(_0x2bc7('0x6'))('routing');var rpc={'openchannelQueueReport':require(_0x2bc7('0x7')),'mailQueueReport':require(_0x2bc7('0x8')),'chatQueueReport':require('../rpc/chatQueueReport'),'smsQueueReport':require('../rpc/smsQueueReport'),'faxQueueReport':require('../rpc/faxQueueReport'),'whatsappQueueReport':require(_0x2bc7('0x9'))};var RuleEngine=require(_0x2bc7('0xa'));function getId(_0x2dd455,_0x44148b,_0x3c1e97){return util['format'](_0x2bc7('0xb'),_0x2dd455,_0x44148b||0x0,_0x3c1e97||0x0);}function getIntervals(_0x2fb208,_0x45d2c0){var _0x1a39b2=[];if(!_[_0x2bc7('0xc')](_0x45d2c0['IntervalId'])&&!_['isNil'](_0x2fb208[_0x45d2c0['IntervalId']])&&!_[_0x2bc7('0xc')](_0x2fb208[_0x45d2c0['IntervalId']]['Intervals'])){_0x1a39b2=_[_0x2bc7('0xd')](_0x2fb208[_0x45d2c0['IntervalId']][_0x2bc7('0xe')],_0x2bc7('0xf'));}else if(!_[_0x2bc7('0xc')](_0x45d2c0[_0x2bc7('0xf')])){_0x1a39b2=[_0x45d2c0[_0x2bc7('0xf')]];}return _0x1a39b2;}exports[_0x2bc7('0x10')]=function(_0x2af1ce){_0x2af1ce[_0x2bc7('0x11')]={};return new BPromise(function(_0x49918a,_0x7264da){var _0x4050f9={'Start':function(_0x2dda4b){var _0x4ec97c=this;return new Promise(function(_0x3c9119,_0xf15e4b){if(_0x2dda4b){try{var _0x3eadc2=[];var _0x35fe47=getId(_0x2dda4b[_0x2bc7('0x12')],_0x2dda4b['message']?_0x2dda4b['message']['id']:0x0,_0x2dda4b[_0x2bc7('0x13')]?_0x2dda4b['interaction']['id']:0x0);if(_0x2dda4b[_0x2bc7('0x14')]&&_['isArray'](_0x2dda4b[_0x2bc7('0x14')])&&_0x2dda4b['applications']['length']){for(var _0x4f6ec2=0x0;_0x4f6ec2<_0x2dda4b['applications'][_0x2bc7('0x15')];_0x4f6ec2+=0x1){var _0x5f0f2e=_0x2dda4b[_0x2bc7('0x14')][_0x4f6ec2];if(fs['existsSync'](path[_0x2bc7('0x16')](__dirname,'applications',_0x5f0f2e[_0x2bc7('0x17')]+'.js'))){var _0x2d0419=[];switch(_0x5f0f2e[_0x2bc7('0x17')][_0x2bc7('0x18')]()){case'autoreply':var _0xcd0eb9=_0x5f0f2e['appdata'][_0x2bc7('0x19')](',');if(_0x2dda4b[_0x2bc7('0x12')]==='mail'){_0x2d0419[_0x2bc7('0x1a')](_0xcd0eb9[0x0]);_0x2d0419['push'](_0xcd0eb9[0x1]);_0x2d0419[_0x2bc7('0x1a')](_0xcd0eb9[_0x2bc7('0x1b')](0x2,_0xcd0eb9[_0x2bc7('0x15')])[_0x2bc7('0x16')](','));}else{_0x2d0419['push'](_0xcd0eb9[0x0]);_0x2d0419['push'](_0xcd0eb9[_0x2bc7('0x1b')](0x1,_0xcd0eb9[_0x2bc7('0x15')])[_0x2bc7('0x16')](','));}break;case _0x2bc7('0x1c'):var _0x1a961f=_0x5f0f2e['appdata'][_0x2bc7('0x19')](',');_0x2d0419[_0x2bc7('0x1a')](_0x1a961f[0x0]);_0x2d0419[_0x2bc7('0x1a')](_0x1a961f[0x1]);_0x2d0419['push'](_0x1a961f[_0x2bc7('0x1b')](0x2,_0x1a961f[_0x2bc7('0x15')])['join'](','));break;case _0x2bc7('0x1d'):var _0x41bc3c=_0x5f0f2e['appdata'][_0x2bc7('0x19')](',');_0x2d0419['push'](_0x41bc3c[0x0]);_0x2d0419[_0x2bc7('0x1a')](_0x41bc3c[0x1]);_0x2d0419['push'](_0x41bc3c[0x2]);_0x2d0419[_0x2bc7('0x1a')](_0x41bc3c[0x3]);_0x2d0419[_0x2bc7('0x1a')](_0x41bc3c[_0x2bc7('0x1b')](0x4,_0x41bc3c[_0x2bc7('0x15')])['join'](','));break;case _0x2bc7('0x1e'):var _0x4f54de=_0x5f0f2e['appdata']['split'](',');_0x2d0419[_0x2bc7('0x1a')](_0x4f54de[0x0]);_0x2d0419[_0x2bc7('0x1a')](_0x4f54de[0x1]);_0x2d0419[_0x2bc7('0x1a')](_0x4f54de[0x2]);_0x2d0419[_0x2bc7('0x1a')](_0x4f54de[0x3]);_0x2d0419[_0x2bc7('0x1a')](_0x4f54de[_0x2bc7('0x1b')](0x4,_0x4f54de[_0x2bc7('0x15')])[_0x2bc7('0x16')](','));break;case'message':_0x2d0419[_0x2bc7('0x1a')](_0x5f0f2e['appdata']);break;case _0x2bc7('0x1f'):_0x2d0419[_0x2bc7('0x1a')](_0x5f0f2e[_0x2bc7('0x20')]);_0x2d0419['push'](_0x5f0f2e[_0x2bc7('0x21')]);break;default:_0x2d0419=_[_0x2bc7('0xc')](_0x5f0f2e[_0x2bc7('0x21')])?[]:_0x5f0f2e[_0x2bc7('0x21')][_0x2bc7('0x19')](',');}var _0x56a35c={'id':util['format'](_0x2bc7('0x22'),_0x35fe47,_0x5f0f2e['id'],_0x5f0f2e[_0x2bc7('0x17')]),'condition':require('./interval')[_0x2bc7('0x23')](_0x35fe47,getIntervals(_0x2af1ce[_0x2bc7('0x24')],_0x5f0f2e),_0x2af1ce),'consequence':require('./applications/'+_0x5f0f2e['app'])[_0x2bc7('0x25')](_0x35fe47,_0x2d0419,_0x2af1ce,_0x2dda4b),'p':_0x5f0f2e[_0x2bc7('0x26')]||0x0};logger[_0x2bc7('0x27')]('Push\x20new\x20rule',_0x56a35c['id'],_0x2bc7('0x28'),getIntervals(_0x2af1ce[_0x2bc7('0x24')],_0x5f0f2e)['join']('\x20|\x20'));_0x3eadc2[_0x2bc7('0x1a')](_0x56a35c);}else{logger[_0x2bc7('0x29')]('Please\x20create\x20a\x20new\x20file\x20under',path['join'](__dirname,_0x2bc7('0x14'),_0x5f0f2e[_0x2bc7('0x17')]+_0x2bc7('0x2a')));}}_0x2af1ce[_0x2bc7('0x11')][_0x35fe47]=new RuleEngine(_0x3eadc2);_0x2af1ce[_0x2bc7('0x11')][_0x35fe47]['execute'](_0x2dda4b,function(_0x12cd2e){logger[_0x2bc7('0x27')]('Applications\x20executed',JSON[_0x2bc7('0x2b')](_0x12cd2e[_0x2bc7('0x2c')]));if(_0x2af1ce[_0x2bc7('0x11')][_0x35fe47]){_0x2af1ce[_0x2bc7('0x11')][_0x35fe47]['emit']('complete');}});return _0x3c9119({'code':0xc8,'message':_0x2dda4b});}else{logger['info']('No\x20applications\x20to\x20execute');return _0x3c9119({'code':0xc8,'message':_0x2dda4b});}}catch(_0x3d69ef){logger[_0x2bc7('0x29')](_0x3d69ef[_0x2bc7('0x2d')]);return _0xf15e4b(_0x4ec97c['error'](0x1f4,_0x3d69ef));}}return _0xf15e4b(_0x2bc7('0x2e'));});},'AcceptMessage':function(_0x3d8268){var _0x382799=this;return new Promise(function(_0x315b6d,_0xebaf50){if(_0x3d8268[_0x2bc7('0x2f')]&&_0x3d8268[_0x2bc7('0x2f')]['id']){if(_0x2af1ce[_0x2bc7('0x30')][_0x3d8268[_0x2bc7('0x2f')]['id']]){_0x2af1ce[_0x2bc7('0x30')][_0x3d8268['agent']['id']][_0x2bc7('0x31')]=![];_0x2af1ce[_0x2bc7('0x30')][_0x3d8268[_0x2bc7('0x2f')]['id']]['busyQueue']=undefined;}}if(_0x3d8268['message']&&_0x3d8268['message']['id']){try{var _0x51fb10=getId(_0x3d8268['channel'],_0x3d8268[_0x2bc7('0x32')]?_0x3d8268['message']['id']:0x0,_0x3d8268['interaction']?_0x3d8268[_0x2bc7('0x13')]['id']:0x0);if(_0x2af1ce[_0x2bc7('0x11')][_0x51fb10]){_0x2af1ce[_0x2bc7('0x11')][_0x51fb10][_0x2bc7('0x33')](_0x2bc7('0x34'));if(rpc[_0x3d8268[_0x2bc7('0x12')]+'QueueReport']){rpc[_0x3d8268[_0x2bc7('0x12')]+'QueueReport'][_0x2bc7('0x35')](_0x51fb10,{'UserId':_0x3d8268[_0x2bc7('0x32')]['UserId']})['catch'](function(_0x4974cd){logger[_0x2bc7('0x29')]('error\x20update\x20queue\x20report');});}}return _0x315b6d({'code':0xc8,'message':_0x3d8268});}catch(_0x5a28e0){logger['error'](_0x5a28e0[_0x2bc7('0x2d')]);return _0xebaf50(_0x382799['error'](0x1f4,_0x5a28e0));}}logger[_0x2bc7('0x29')]('message\x20is\x20empty');return _0xebaf50(_0x382799[_0x2bc7('0x29')](0x1f4,'message\x20is\x20empty'));});},'RejectMessage':function(_0x2fc24c){var _0x3d42b9=this;return new Promise(function(_0x3c5815,_0x205744){if(_0x2fc24c[_0x2bc7('0x2f')]&&_0x2fc24c[_0x2bc7('0x2f')]['id']){try{if(_0x2af1ce[_0x2bc7('0x30')][_0x2fc24c[_0x2bc7('0x2f')]['id']]){_0x2af1ce[_0x2bc7('0x30')][_0x2fc24c[_0x2bc7('0x2f')]['id']][_0x2bc7('0x31')]=![];_0x2af1ce[_0x2bc7('0x30')][_0x2fc24c[_0x2bc7('0x2f')]['id']][_0x2bc7('0x36')]=undefined;}return _0x3c5815({'code':0xc8,'message':_0x2fc24c});}catch(_0x4cdde7){logger[_0x2bc7('0x29')](_0x4cdde7['stack']);return _0x205744(_0x3d42b9['error'](0x1f4,_0x4cdde7));}}logger[_0x2bc7('0x29')](_0x2bc7('0x37'));return _0x205744(_0x3d42b9[_0x2bc7('0x29')](0x1f4,_0x2bc7('0x37')));});},'AbandonInteraction':function(_0x11eb0f){var _0x4e9562=this;return new Promise(function(_0x39103b,_0x1a150f){if(_0x11eb0f[_0x2bc7('0x12')]&&_0x11eb0f[_0x2bc7('0x13')]&&_0x11eb0f['interaction']['id']){try{var _0x1b2d19=getId(_0x11eb0f[_0x2bc7('0x12')],_0x11eb0f[_0x2bc7('0x32')]?_0x11eb0f[_0x2bc7('0x32')]['id']:0x0,_0x11eb0f[_0x2bc7('0x13')]?_0x11eb0f[_0x2bc7('0x13')]['id']:0x0);if(_0x2af1ce[_0x2bc7('0x11')][_0x1b2d19]){_0x2af1ce['rules'][_0x1b2d19]['emit'](_0x2bc7('0x34'));}return _0x39103b({'code':0xc8,'message':_0x11eb0f});}catch(_0x140890){logger[_0x2bc7('0x29')](_0x140890['stack']);return _0x1a150f(_0x4e9562['error'](0x1f4,_0x140890));}}logger[_0x2bc7('0x29')](_0x2bc7('0x37'));return _0x1a150f(_0x4e9562[_0x2bc7('0x29')](0x1f4,_0x2bc7('0x37')));});},'AgentCapacity':function(_0x5a22c3){var _0x31bb03=this;return new Promise(function(_0x51435e,_0xf1490a){if(_0x2af1ce[_0x2bc7('0x30')][_0x2bc7('0x38')](_0x5a22c3['id'])){for(var _0x42d5a5 in _0x5a22c3[_0x2bc7('0x39')]){if(_0x5a22c3[_0x2bc7('0x39')][_0x2bc7('0x38')](_0x42d5a5)){if(_0x2af1ce[_0x2bc7('0x30')][_0x5a22c3['id']]['hasOwnProperty'](_0x42d5a5+_0x2bc7('0x3a'))){_0x2af1ce['agents'][_0x5a22c3['id']][_0x42d5a5+_0x2bc7('0x3a')]=parseInt(_0x5a22c3[_0x2bc7('0x39')][_0x42d5a5],0xa);}}}_0x2af1ce['agents'][_0x5a22c3['id']][_0x2bc7('0x3b')]();return _0x51435e({'code':0xc8,'message':_0x2af1ce[_0x2bc7('0x30')][_0x5a22c3['id']]});}else{return _0xf1490a(_0x31bb03[_0x2bc7('0x29')](0x1f4,'agent\x20not\x20found'));}});},'Agents':function(_0x2c76ab){return new Promise(function(_0x521625,_0x1103c1){var _0xaca226=_[_0x2bc7('0x3c')](_0x2af1ce[_0x2bc7('0x30')]);_0x521625({'count':_0xaca226[_0x2bc7('0x15')],'rows':_0xaca226});});},'ChatQueues':function(_0x38756d){return new Promise(function(_0x819395,_0x1e0e2c){var _0x281a4c=[];for(var _0x5225d4 in _0x2af1ce[_0x2bc7('0x3d')]){if(_0x2af1ce[_0x2bc7('0x3d')][_0x2bc7('0x38')](_0x5225d4)){var _0x58e099=_0x2af1ce[_0x2bc7('0x3d')][_0x5225d4];var _0xc8c9ab={'id':_0x58e099['id'],'available':_0x58e099[_0x2bc7('0x3e')],'loggedIn':_0x58e099[_0x2bc7('0x3f')],'name':_0x58e099[_0x2bc7('0x40')],'paused':_0x58e099[_0x2bc7('0x41')],'waiting':_0x58e099[_0x2bc7('0x42')]};_0x281a4c[_0x2bc7('0x1a')](_0xc8c9ab);}}_0x819395({'count':_0x281a4c['length'],'rows':_0x281a4c});});},'MailQueues':function(_0xd5ad06){return new Promise(function(_0x4d56d0,_0x50736b){var _0x14e293=[];for(var _0x1fc0e4 in _0x2af1ce['mailQueues']){if(_0x2af1ce['mailQueues'][_0x2bc7('0x38')](_0x1fc0e4)){var _0x3f94cd=_0x2af1ce[_0x2bc7('0x43')][_0x1fc0e4];var _0xc06c29={'id':_0x3f94cd['id'],'available':_0x3f94cd['available'],'loggedIn':_0x3f94cd[_0x2bc7('0x3f')],'name':_0x3f94cd[_0x2bc7('0x40')],'paused':_0x3f94cd[_0x2bc7('0x41')],'waiting':_0x3f94cd[_0x2bc7('0x42')]};_0x14e293['push'](_0xc06c29);}}_0x4d56d0({'count':_0x14e293[_0x2bc7('0x15')],'rows':_0x14e293});});},'OpenchannelQueues':function(_0x417eb8){return new Promise(function(_0x57e8fb,_0x2d9691){var _0x2767d2=[];for(var _0x8e8fad in _0x2af1ce[_0x2bc7('0x44')]){if(_0x2af1ce[_0x2bc7('0x44')]['hasOwnProperty'](_0x8e8fad)){var _0x676ffb=_0x2af1ce['openchannelQueues'][_0x8e8fad];var _0x4b268f={'id':_0x676ffb['id'],'available':_0x676ffb[_0x2bc7('0x3e')],'loggedIn':_0x676ffb['loggedIn'],'name':_0x676ffb[_0x2bc7('0x40')],'paused':_0x676ffb[_0x2bc7('0x41')],'waiting':_0x676ffb[_0x2bc7('0x42')]};_0x2767d2[_0x2bc7('0x1a')](_0x4b268f);}}_0x57e8fb({'count':_0x2767d2[_0x2bc7('0x15')],'rows':_0x2767d2});});},'SmsQueues':function(_0xfd33e8){return new Promise(function(_0x1bc819,_0x1ac1e2){var _0x5970ae=[];for(var _0x53a68d in _0x2af1ce[_0x2bc7('0x45')]){if(_0x2af1ce[_0x2bc7('0x45')][_0x2bc7('0x38')](_0x53a68d)){var _0x5a1fc1=_0x2af1ce['smsQueues'][_0x53a68d];var _0x3bd3c6={'id':_0x5a1fc1['id'],'available':_0x5a1fc1['available'],'loggedIn':_0x5a1fc1[_0x2bc7('0x3f')],'name':_0x5a1fc1['name'],'paused':_0x5a1fc1[_0x2bc7('0x41')],'waiting':_0x5a1fc1['waiting']};_0x5970ae[_0x2bc7('0x1a')](_0x3bd3c6);}}_0x1bc819({'count':_0x5970ae[_0x2bc7('0x15')],'rows':_0x5970ae});});},'FaxQueues':function(_0x28e6a6){return new Promise(function(_0x51b606,_0x5a2dfc){var _0x499b5c=[];for(var _0x2b0e3e in _0x2af1ce[_0x2bc7('0x46')]){if(_0x2af1ce[_0x2bc7('0x46')][_0x2bc7('0x38')](_0x2b0e3e)){var _0x2165dd=_0x2af1ce[_0x2bc7('0x46')][_0x2b0e3e];var _0x17d49b={'id':_0x2165dd['id'],'available':_0x2165dd[_0x2bc7('0x3e')],'loggedIn':_0x2165dd[_0x2bc7('0x3f')],'name':_0x2165dd['name'],'paused':_0x2165dd[_0x2bc7('0x41')],'waiting':_0x2165dd[_0x2bc7('0x42')]};_0x499b5c[_0x2bc7('0x1a')](_0x17d49b);}}_0x51b606({'count':_0x499b5c['length'],'rows':_0x499b5c});});},'WhatsappQueues':function(_0x560201){return new Promise(function(_0x478ac3,_0x251b6d){var _0x82cd5=[];for(var _0x21b612 in _0x2af1ce[_0x2bc7('0x47')]){if(_0x2af1ce[_0x2bc7('0x47')][_0x2bc7('0x38')](_0x21b612)){var _0x225b7b=_0x2af1ce[_0x2bc7('0x47')][_0x21b612];var _0x4cd730={'id':_0x225b7b['id'],'available':_0x225b7b[_0x2bc7('0x3e')],'loggedIn':_0x225b7b[_0x2bc7('0x3f')],'name':_0x225b7b[_0x2bc7('0x40')],'paused':_0x225b7b[_0x2bc7('0x41')],'waiting':_0x225b7b[_0x2bc7('0x42')]};_0x82cd5[_0x2bc7('0x1a')](_0x4cd730);}}_0x478ac3({'count':_0x82cd5[_0x2bc7('0x15')],'rows':_0x82cd5});});},'ChatQueuesWaitingInteractions':function(_0x4bdf96){return new Promise(function(_0x21eee1,_0x34daaa){var _0xfd74af=_['values'](_0x2af1ce['chatQueuesWaitingInteractions']);_0x21eee1({'count':_0xfd74af[_0x2bc7('0x15')],'rows':_0xfd74af});});},'MailQueuesWaitingInteractions':function(_0x389d36){return new Promise(function(_0x3a1354,_0x28a8b5){var _0x5577aa=_[_0x2bc7('0x3c')](_0x2af1ce[_0x2bc7('0x48')]);_0x3a1354({'count':_0x5577aa[_0x2bc7('0x15')],'rows':_0x5577aa});});},'OpenchannelQueuesWaitingInteractions':function(_0x4ecbd7){return new Promise(function(_0x406a08,_0x3465bc){var _0x483a37=_[_0x2bc7('0x3c')](_0x2af1ce[_0x2bc7('0x49')]);_0x406a08({'count':_0x483a37[_0x2bc7('0x15')],'rows':_0x483a37});});},'SmsQueuesWaitingInteractions':function(_0x146056){return new Promise(function(_0x161304,_0x3bc528){var _0x50372f=_['values'](_0x2af1ce[_0x2bc7('0x4a')]);_0x161304({'count':_0x50372f[_0x2bc7('0x15')],'rows':_0x50372f});});},'FaxQueuesWaitingInteractions':function(_0x77cbc7){return new Promise(function(_0x34f4fd,_0x41030c){var _0x4a60d7=_[_0x2bc7('0x3c')](_0x2af1ce[_0x2bc7('0x4b')]);_0x34f4fd({'count':_0x4a60d7[_0x2bc7('0x15')],'rows':_0x4a60d7});});},'WhatsappQueuesWaitingInteractions':function(_0x1597ac){return new Promise(function(_0x3dbf03,_0x3940f4){var _0x59a330=_[_0x2bc7('0x3c')](_0x2af1ce[_0x2bc7('0x4c')]);_0x3dbf03({'count':_0x59a330[_0x2bc7('0x15')],'rows':_0x59a330});});}};var _0x45215b=jayson[_0x2bc7('0x4d')](_0x4050f9)[_0x2bc7('0x4e')]();_0x45215b['on'](_0x2bc7('0x29'),function(_0x3497d0){logger[_0x2bc7('0x29')](JSON[_0x2bc7('0x2b')](_0x3497d0));return _0x7264da(_0x3497d0);});_0x45215b[_0x2bc7('0x10')](0x232c,_0x2bc7('0x4f'),function(){console[_0x2bc7('0x50')](_0x2bc7('0x51'),0x232c);return _0x49918a(_0x2bc7('0x52')+0x232c);});});}; \ No newline at end of file +var _0xc800=['join','app','.js','toLowerCase','appdata','split','mail','push','slice','dialogflow','dialogflowv2','amazonlex','tag','%s:%s:%s','./interval','condition','./applications/','on\x20interval','intervals','\x20|\x20','error','Please\x20create\x20a\x20new\x20file\x20under','execute','info','Applications\x20executed','emit','No\x20applications\x20to\x20execute','stack','routing\x20is\x20empty','agent','agents','busy','busyQueue','QueueReport','update','UserId','catch','error\x20update\x20queue\x20report','message\x20is\x20empty','capacity','hasOwnProperty','CurrentCapacity','updateRealtime','agent\x20not\x20found','chatQueues','loggedIn','waiting','mailQueues','available','name','openchannelQueues','paused','smsQueues','faxQueues','whatsappQueues','values','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','server','stringify','127.0.0.1','log','Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','lodash','util','path','jayson/promise','bluebird','uuid','../../../config/environment','../../../config/logger','routing','../rpc/mailQueueReport','../rpc/smsQueueReport','../rpc/faxQueueReport','../rpc/whatsappQueueReport','format','%s.%s.%s','IntervalId','isNil','Intervals','map','interval','listen','rules','channel','message','interaction','applications','isArray','length'];(function(_0x47f99,_0x523f3e){var _0x406c70=function(_0x5541c5){while(--_0x5541c5){_0x47f99['push'](_0x47f99['shift']());}};_0x406c70(++_0x523f3e);}(_0xc800,0x104));var _0x0c80=function(_0x54a2e4,_0x1ff92c){_0x54a2e4=_0x54a2e4-0x0;var _0x4742d0=_0xc800[_0x54a2e4];return _0x4742d0;};'use strict';var _=require(_0x0c80('0x0'));var util=require(_0x0c80('0x1'));var path=require(_0x0c80('0x2'));var fs=require('fs');var jayson=require(_0x0c80('0x3'));var BPromise=require(_0x0c80('0x4'));var uuid=require(_0x0c80('0x5'));var config=require(_0x0c80('0x6'));var logger=require(_0x0c80('0x7'))(_0x0c80('0x8'));var rpc={'openchannelQueueReport':require('../rpc/openchannelQueueReport'),'mailQueueReport':require(_0x0c80('0x9')),'chatQueueReport':require('../rpc/chatQueueReport'),'smsQueueReport':require(_0x0c80('0xa')),'faxQueueReport':require(_0x0c80('0xb')),'whatsappQueueReport':require(_0x0c80('0xc'))};var RuleEngine=require('../lib/rule-engine');function getId(_0x35fe42,_0x16c98e,_0x26f493){return util[_0x0c80('0xd')](_0x0c80('0xe'),_0x35fe42,_0x16c98e||0x0,_0x26f493||0x0);}function getIntervals(_0x502b85,_0x341f9e){var _0x30430b=[];if(!_['isNil'](_0x341f9e[_0x0c80('0xf')])&&!_['isNil'](_0x502b85[_0x341f9e[_0x0c80('0xf')]])&&!_[_0x0c80('0x10')](_0x502b85[_0x341f9e[_0x0c80('0xf')]][_0x0c80('0x11')])){_0x30430b=_[_0x0c80('0x12')](_0x502b85[_0x341f9e[_0x0c80('0xf')]]['Intervals'],_0x0c80('0x13'));}else if(!_[_0x0c80('0x10')](_0x341f9e[_0x0c80('0x13')])){_0x30430b=[_0x341f9e[_0x0c80('0x13')]];}return _0x30430b;}exports[_0x0c80('0x14')]=function(_0x5a044c){_0x5a044c[_0x0c80('0x15')]={};return new BPromise(function(_0x1cb85f,_0x33e962){var _0x87eed8={'Start':function(_0x2c83ae){var _0x26c92c=this;return new Promise(function(_0xd0ba72,_0x1882db){if(_0x2c83ae){try{var _0x1e36d5=[];var _0x1399af=getId(_0x2c83ae[_0x0c80('0x16')],_0x2c83ae[_0x0c80('0x17')]?_0x2c83ae[_0x0c80('0x17')]['id']:0x0,_0x2c83ae[_0x0c80('0x18')]?_0x2c83ae[_0x0c80('0x18')]['id']:0x0);if(_0x2c83ae[_0x0c80('0x19')]&&_[_0x0c80('0x1a')](_0x2c83ae[_0x0c80('0x19')])&&_0x2c83ae[_0x0c80('0x19')][_0x0c80('0x1b')]){for(var _0x4d810a=0x0;_0x4d810a<_0x2c83ae[_0x0c80('0x19')][_0x0c80('0x1b')];_0x4d810a+=0x1){var _0x344e28=_0x2c83ae[_0x0c80('0x19')][_0x4d810a];if(fs['existsSync'](path[_0x0c80('0x1c')](__dirname,_0x0c80('0x19'),_0x344e28[_0x0c80('0x1d')]+_0x0c80('0x1e')))){var _0x4ff581=[];switch(_0x344e28[_0x0c80('0x1d')][_0x0c80('0x1f')]()){case'autoreply':var _0x402c4e=_0x344e28[_0x0c80('0x20')][_0x0c80('0x21')](',');if(_0x2c83ae[_0x0c80('0x16')]===_0x0c80('0x22')){_0x4ff581['push'](_0x402c4e[0x0]);_0x4ff581['push'](_0x402c4e[0x1]);_0x4ff581[_0x0c80('0x23')](_0x402c4e[_0x0c80('0x24')](0x2,_0x402c4e['length'])[_0x0c80('0x1c')](','));}else{_0x4ff581[_0x0c80('0x23')](_0x402c4e[0x0]);_0x4ff581['push'](_0x402c4e['slice'](0x1,_0x402c4e['length'])[_0x0c80('0x1c')](','));}break;case _0x0c80('0x25'):var _0x3ced10=_0x344e28[_0x0c80('0x20')][_0x0c80('0x21')](',');_0x4ff581['push'](_0x3ced10[0x0]);_0x4ff581[_0x0c80('0x23')](_0x3ced10[0x1]);_0x4ff581[_0x0c80('0x23')](_0x3ced10[_0x0c80('0x24')](0x2,_0x3ced10['length'])[_0x0c80('0x1c')](','));break;case _0x0c80('0x26'):var _0x1b9139=_0x344e28['appdata'][_0x0c80('0x21')](',');_0x4ff581[_0x0c80('0x23')](_0x1b9139[0x0]);_0x4ff581[_0x0c80('0x23')](_0x1b9139[0x1]);_0x4ff581[_0x0c80('0x23')](_0x1b9139[0x2]);_0x4ff581['push'](_0x1b9139[0x3]);_0x4ff581['push'](_0x1b9139[_0x0c80('0x24')](0x4,_0x1b9139[_0x0c80('0x1b')])[_0x0c80('0x1c')](','));break;case _0x0c80('0x27'):var _0x7a9a84=_0x344e28[_0x0c80('0x20')]['split'](',');_0x4ff581[_0x0c80('0x23')](_0x7a9a84[0x0]);_0x4ff581[_0x0c80('0x23')](_0x7a9a84[0x1]);_0x4ff581[_0x0c80('0x23')](_0x7a9a84[0x2]);_0x4ff581['push'](_0x7a9a84[0x3]);_0x4ff581[_0x0c80('0x23')](_0x7a9a84[_0x0c80('0x24')](0x4,_0x7a9a84[_0x0c80('0x1b')])[_0x0c80('0x1c')](','));break;case'message':_0x4ff581['push'](_0x344e28['appdata']);break;case _0x0c80('0x28'):_0x4ff581[_0x0c80('0x23')](_0x344e28['TagId']);_0x4ff581['push'](_0x344e28[_0x0c80('0x20')]);break;default:_0x4ff581=_[_0x0c80('0x10')](_0x344e28['appdata'])?[]:_0x344e28[_0x0c80('0x20')][_0x0c80('0x21')](',');}var _0x4af10c={'id':util[_0x0c80('0xd')](_0x0c80('0x29'),_0x1399af,_0x344e28['id'],_0x344e28[_0x0c80('0x1d')]),'condition':require(_0x0c80('0x2a'))[_0x0c80('0x2b')](_0x1399af,getIntervals(_0x5a044c['intervals'],_0x344e28),_0x5a044c),'consequence':require(_0x0c80('0x2c')+_0x344e28[_0x0c80('0x1d')])['consequence'](_0x1399af,_0x4ff581,_0x5a044c,_0x2c83ae),'p':_0x344e28['priority']||0x0};logger['info']('Push\x20new\x20rule',_0x4af10c['id'],_0x0c80('0x2d'),getIntervals(_0x5a044c[_0x0c80('0x2e')],_0x344e28)[_0x0c80('0x1c')](_0x0c80('0x2f')));_0x1e36d5[_0x0c80('0x23')](_0x4af10c);}else{logger[_0x0c80('0x30')](_0x0c80('0x31'),path[_0x0c80('0x1c')](__dirname,_0x0c80('0x19'),_0x344e28[_0x0c80('0x1d')]+'.js'));}}_0x5a044c[_0x0c80('0x15')][_0x1399af]=new RuleEngine(_0x1e36d5);_0x5a044c[_0x0c80('0x15')][_0x1399af][_0x0c80('0x32')](_0x2c83ae,function(_0x450f34){logger[_0x0c80('0x33')](_0x0c80('0x34'),JSON['stringify'](_0x450f34['matchPath']));if(_0x5a044c[_0x0c80('0x15')][_0x1399af]){_0x5a044c[_0x0c80('0x15')][_0x1399af][_0x0c80('0x35')]('complete');}});return _0xd0ba72({'code':0xc8,'message':_0x2c83ae});}else{logger['info'](_0x0c80('0x36'));return _0xd0ba72({'code':0xc8,'message':_0x2c83ae});}}catch(_0x3c3ccb){logger[_0x0c80('0x30')](_0x3c3ccb[_0x0c80('0x37')]);return _0x1882db(_0x26c92c['error'](0x1f4,_0x3c3ccb));}}return _0x1882db(_0x0c80('0x38'));});},'AcceptMessage':function(_0x2eb3e6){var _0x2b2c10=this;return new Promise(function(_0x5c51f7,_0x10b9de){if(_0x2eb3e6['agent']&&_0x2eb3e6[_0x0c80('0x39')]['id']){if(_0x5a044c['agents'][_0x2eb3e6[_0x0c80('0x39')]['id']]){_0x5a044c[_0x0c80('0x3a')][_0x2eb3e6[_0x0c80('0x39')]['id']][_0x0c80('0x3b')]=![];_0x5a044c[_0x0c80('0x3a')][_0x2eb3e6[_0x0c80('0x39')]['id']][_0x0c80('0x3c')]=undefined;}}if(_0x2eb3e6['message']&&_0x2eb3e6[_0x0c80('0x17')]['id']){try{var _0x10a15f=getId(_0x2eb3e6[_0x0c80('0x16')],_0x2eb3e6[_0x0c80('0x17')]?_0x2eb3e6['message']['id']:0x0,_0x2eb3e6['interaction']?_0x2eb3e6[_0x0c80('0x18')]['id']:0x0);if(_0x5a044c['rules'][_0x10a15f]){_0x5a044c[_0x0c80('0x15')][_0x10a15f][_0x0c80('0x35')]('end');if(rpc[_0x2eb3e6['channel']+_0x0c80('0x3d')]){rpc[_0x2eb3e6[_0x0c80('0x16')]+'QueueReport'][_0x0c80('0x3e')](_0x10a15f,{'UserId':_0x2eb3e6[_0x0c80('0x17')][_0x0c80('0x3f')]})[_0x0c80('0x40')](function(_0x308a88){logger[_0x0c80('0x30')](_0x0c80('0x41'));});}}return _0x5c51f7({'code':0xc8,'message':_0x2eb3e6});}catch(_0x5df5c5){logger[_0x0c80('0x30')](_0x5df5c5['stack']);return _0x10b9de(_0x2b2c10['error'](0x1f4,_0x5df5c5));}}logger[_0x0c80('0x30')]('message\x20is\x20empty');return _0x10b9de(_0x2b2c10[_0x0c80('0x30')](0x1f4,_0x0c80('0x42')));});},'RejectMessage':function(_0x2834d2){var _0x271f38=this;return new Promise(function(_0x1c94ed,_0x29e1ca){if(_0x2834d2[_0x0c80('0x39')]&&_0x2834d2[_0x0c80('0x39')]['id']){try{if(_0x5a044c[_0x0c80('0x3a')][_0x2834d2[_0x0c80('0x39')]['id']]){_0x5a044c[_0x0c80('0x3a')][_0x2834d2['agent']['id']][_0x0c80('0x3b')]=![];_0x5a044c[_0x0c80('0x3a')][_0x2834d2[_0x0c80('0x39')]['id']][_0x0c80('0x3c')]=undefined;}return _0x1c94ed({'code':0xc8,'message':_0x2834d2});}catch(_0x1ef1d3){logger['error'](_0x1ef1d3[_0x0c80('0x37')]);return _0x29e1ca(_0x271f38[_0x0c80('0x30')](0x1f4,_0x1ef1d3));}}logger[_0x0c80('0x30')](_0x0c80('0x42'));return _0x29e1ca(_0x271f38[_0x0c80('0x30')](0x1f4,_0x0c80('0x42')));});},'AbandonInteraction':function(_0x431e6b){var _0x18bfef=this;return new Promise(function(_0x323316,_0x100f89){if(_0x431e6b[_0x0c80('0x16')]&&_0x431e6b[_0x0c80('0x18')]&&_0x431e6b[_0x0c80('0x18')]['id']){try{var _0x5d5ff1=getId(_0x431e6b['channel'],_0x431e6b[_0x0c80('0x17')]?_0x431e6b['message']['id']:0x0,_0x431e6b[_0x0c80('0x18')]?_0x431e6b[_0x0c80('0x18')]['id']:0x0);if(_0x5a044c[_0x0c80('0x15')][_0x5d5ff1]){_0x5a044c['rules'][_0x5d5ff1][_0x0c80('0x35')]('end');}return _0x323316({'code':0xc8,'message':_0x431e6b});}catch(_0xb90901){logger[_0x0c80('0x30')](_0xb90901[_0x0c80('0x37')]);return _0x100f89(_0x18bfef[_0x0c80('0x30')](0x1f4,_0xb90901));}}logger[_0x0c80('0x30')](_0x0c80('0x42'));return _0x100f89(_0x18bfef[_0x0c80('0x30')](0x1f4,_0x0c80('0x42')));});},'AgentCapacity':function(_0x1ff7ea){var _0x2cac91=this;return new Promise(function(_0x17ad2f,_0x214b04){if(_0x5a044c[_0x0c80('0x3a')]['hasOwnProperty'](_0x1ff7ea['id'])){for(var _0x2cd3ec in _0x1ff7ea[_0x0c80('0x43')]){if(_0x1ff7ea[_0x0c80('0x43')][_0x0c80('0x44')](_0x2cd3ec)){if(_0x5a044c[_0x0c80('0x3a')][_0x1ff7ea['id']][_0x0c80('0x44')](_0x2cd3ec+_0x0c80('0x45'))){_0x5a044c[_0x0c80('0x3a')][_0x1ff7ea['id']][_0x2cd3ec+_0x0c80('0x45')]=parseInt(_0x1ff7ea[_0x0c80('0x43')][_0x2cd3ec],0xa);}}}_0x5a044c['agents'][_0x1ff7ea['id']][_0x0c80('0x46')]();return _0x17ad2f({'code':0xc8,'message':_0x5a044c[_0x0c80('0x3a')][_0x1ff7ea['id']]});}else{return _0x214b04(_0x2cac91[_0x0c80('0x30')](0x1f4,_0x0c80('0x47')));}});},'Agents':function(_0x4946fc){return new Promise(function(_0x278e95,_0x4653e3){var _0x65f259=_['values'](_0x5a044c[_0x0c80('0x3a')]);_0x278e95({'count':_0x65f259['length'],'rows':_0x65f259});});},'ChatQueues':function(_0x301d1b){return new Promise(function(_0x21e618,_0x4c02f6){var _0x1d5da7=[];for(var _0x328961 in _0x5a044c[_0x0c80('0x48')]){if(_0x5a044c['chatQueues'][_0x0c80('0x44')](_0x328961)){var _0xc5ec6b=_0x5a044c[_0x0c80('0x48')][_0x328961];var _0x26c684={'id':_0xc5ec6b['id'],'available':_0xc5ec6b['available'],'loggedIn':_0xc5ec6b[_0x0c80('0x49')],'name':_0xc5ec6b['name'],'paused':_0xc5ec6b['paused'],'waiting':_0xc5ec6b[_0x0c80('0x4a')]};_0x1d5da7[_0x0c80('0x23')](_0x26c684);}}_0x21e618({'count':_0x1d5da7['length'],'rows':_0x1d5da7});});},'MailQueues':function(_0x233c12){return new Promise(function(_0x40a399,_0x15d6f9){var _0x3ea862=[];for(var _0x480ad2 in _0x5a044c[_0x0c80('0x4b')]){if(_0x5a044c[_0x0c80('0x4b')][_0x0c80('0x44')](_0x480ad2)){var _0x483940=_0x5a044c[_0x0c80('0x4b')][_0x480ad2];var _0x4e6ea6={'id':_0x483940['id'],'available':_0x483940[_0x0c80('0x4c')],'loggedIn':_0x483940[_0x0c80('0x49')],'name':_0x483940[_0x0c80('0x4d')],'paused':_0x483940['paused'],'waiting':_0x483940[_0x0c80('0x4a')]};_0x3ea862[_0x0c80('0x23')](_0x4e6ea6);}}_0x40a399({'count':_0x3ea862[_0x0c80('0x1b')],'rows':_0x3ea862});});},'OpenchannelQueues':function(_0x351057){return new Promise(function(_0x46e8b3,_0x84b463){var _0x3b579c=[];for(var _0x5a46c7 in _0x5a044c['openchannelQueues']){if(_0x5a044c[_0x0c80('0x4e')]['hasOwnProperty'](_0x5a46c7)){var _0x116f3f=_0x5a044c[_0x0c80('0x4e')][_0x5a46c7];var _0x54aea3={'id':_0x116f3f['id'],'available':_0x116f3f['available'],'loggedIn':_0x116f3f[_0x0c80('0x49')],'name':_0x116f3f[_0x0c80('0x4d')],'paused':_0x116f3f[_0x0c80('0x4f')],'waiting':_0x116f3f[_0x0c80('0x4a')]};_0x3b579c[_0x0c80('0x23')](_0x54aea3);}}_0x46e8b3({'count':_0x3b579c[_0x0c80('0x1b')],'rows':_0x3b579c});});},'SmsQueues':function(_0x3895cd){return new Promise(function(_0x1500bc,_0x45f39b){var _0x50418c=[];for(var _0x451394 in _0x5a044c[_0x0c80('0x50')]){if(_0x5a044c[_0x0c80('0x50')][_0x0c80('0x44')](_0x451394)){var _0x11128d=_0x5a044c[_0x0c80('0x50')][_0x451394];var _0x17de0f={'id':_0x11128d['id'],'available':_0x11128d['available'],'loggedIn':_0x11128d[_0x0c80('0x49')],'name':_0x11128d[_0x0c80('0x4d')],'paused':_0x11128d[_0x0c80('0x4f')],'waiting':_0x11128d[_0x0c80('0x4a')]};_0x50418c[_0x0c80('0x23')](_0x17de0f);}}_0x1500bc({'count':_0x50418c[_0x0c80('0x1b')],'rows':_0x50418c});});},'FaxQueues':function(_0x4cab91){return new Promise(function(_0x489242,_0x5cb13c){var _0x1b4ee2=[];for(var _0x14fb8b in _0x5a044c[_0x0c80('0x51')]){if(_0x5a044c[_0x0c80('0x51')]['hasOwnProperty'](_0x14fb8b)){var _0x512135=_0x5a044c[_0x0c80('0x51')][_0x14fb8b];var _0x4d2570={'id':_0x512135['id'],'available':_0x512135[_0x0c80('0x4c')],'loggedIn':_0x512135[_0x0c80('0x49')],'name':_0x512135[_0x0c80('0x4d')],'paused':_0x512135[_0x0c80('0x4f')],'waiting':_0x512135[_0x0c80('0x4a')]};_0x1b4ee2[_0x0c80('0x23')](_0x4d2570);}}_0x489242({'count':_0x1b4ee2[_0x0c80('0x1b')],'rows':_0x1b4ee2});});},'WhatsappQueues':function(_0x1bd02f){return new Promise(function(_0x57bfad,_0x404896){var _0x3a4a7d=[];for(var _0x47ff0f in _0x5a044c[_0x0c80('0x52')]){if(_0x5a044c[_0x0c80('0x52')]['hasOwnProperty'](_0x47ff0f)){var _0x56ec51=_0x5a044c[_0x0c80('0x52')][_0x47ff0f];var _0x503f01={'id':_0x56ec51['id'],'available':_0x56ec51[_0x0c80('0x4c')],'loggedIn':_0x56ec51[_0x0c80('0x49')],'name':_0x56ec51['name'],'paused':_0x56ec51[_0x0c80('0x4f')],'waiting':_0x56ec51[_0x0c80('0x4a')]};_0x3a4a7d[_0x0c80('0x23')](_0x503f01);}}_0x57bfad({'count':_0x3a4a7d[_0x0c80('0x1b')],'rows':_0x3a4a7d});});},'ChatQueuesWaitingInteractions':function(_0x431b97){return new Promise(function(_0x375557,_0x17ba03){var _0x12a7d1=_[_0x0c80('0x53')](_0x5a044c[_0x0c80('0x54')]);_0x375557({'count':_0x12a7d1['length'],'rows':_0x12a7d1});});},'MailQueuesWaitingInteractions':function(_0x5ba9b3){return new Promise(function(_0x192dab,_0x3f9864){var _0x3e7707=_[_0x0c80('0x53')](_0x5a044c[_0x0c80('0x55')]);_0x192dab({'count':_0x3e7707[_0x0c80('0x1b')],'rows':_0x3e7707});});},'OpenchannelQueuesWaitingInteractions':function(_0x2c97d0){return new Promise(function(_0x8b991a,_0x29a4da){var _0x1f7413=_[_0x0c80('0x53')](_0x5a044c[_0x0c80('0x56')]);_0x8b991a({'count':_0x1f7413[_0x0c80('0x1b')],'rows':_0x1f7413});});},'SmsQueuesWaitingInteractions':function(_0x29cd74){return new Promise(function(_0x4a0a9c,_0x4381d6){var _0x48ee60=_['values'](_0x5a044c[_0x0c80('0x57')]);_0x4a0a9c({'count':_0x48ee60[_0x0c80('0x1b')],'rows':_0x48ee60});});},'FaxQueuesWaitingInteractions':function(_0x37a57d){return new Promise(function(_0x55165e,_0x1070b7){var _0x2abb2e=_[_0x0c80('0x53')](_0x5a044c[_0x0c80('0x58')]);_0x55165e({'count':_0x2abb2e[_0x0c80('0x1b')],'rows':_0x2abb2e});});},'WhatsappQueuesWaitingInteractions':function(_0xe15137){return new Promise(function(_0x5e6e60,_0x9ef758){var _0xc97af7=_['values'](_0x5a044c[_0x0c80('0x59')]);_0x5e6e60({'count':_0xc97af7[_0x0c80('0x1b')],'rows':_0xc97af7});});}};var _0x4a5811=jayson[_0x0c80('0x5a')](_0x87eed8)['http']();_0x4a5811['on'](_0x0c80('0x30'),function(_0x47c5e4){logger[_0x0c80('0x30')](JSON[_0x0c80('0x5b')](_0x47c5e4));return _0x33e962(_0x47c5e4);});_0x4a5811[_0x0c80('0x14')](0x232c,_0x0c80('0x5c'),function(){console[_0x0c80('0x5d')](_0x0c80('0x5e'),0x232c);return _0x1cb85f(_0x0c80('0x5f')+0x232c);});});}; \ No newline at end of file diff --git a/server/services/routing/server/interval.js b/server/services/routing/server/interval.js index 6298338..b6d7b01 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 _0x0685=['request','then','error','message','result','condition','rules','info','[%s][INTERVAL]\x20ROUTING\x20STOPPED','stop','length','push','Command','iftime\x20%s','indexOf','true','catch','[%s][INTERVAL]\x20%s','all','some','[%s][INTERVAL]\x20%s\x20%s','join','\x20|\x20','when','log','bluebird','../../../config/logger','routing','client'];(function(_0x8f5104,_0x115396){var _0x215479=function(_0x323edb){while(--_0x323edb){_0x8f5104['push'](_0x8f5104['shift']());}};_0x215479(++_0x115396);}(_0x0685,0x1cc));var _0x5068=function(_0x4e676e,_0x2a7c6d){_0x4e676e=_0x4e676e-0x0;var _0x336a3c=_0x0685[_0x4e676e];return _0x336a3c;};'use strict';var util=require('util');var BPromise=require(_0x5068('0x0'));var jayson=require('jayson/promise');var _=require('lodash');var logger=require(_0x5068('0x1'))(_0x5068('0x2'));var client=jayson[_0x5068('0x3')]['http']({'port':0x232a});function request(_0x52b126,_0x20213c){return new BPromise(function(_0x13d0c0,_0xa05eeb){return client[_0x5068('0x4')](_0x52b126,_0x20213c)[_0x5068('0x5')](function(_0x4e6509){if(_0x4e6509[_0x5068('0x6')]){return _0xa05eeb(_0x4e6509['error'][_0x5068('0x7')]);}else{return _0x13d0c0(_0x4e6509[_0x5068('0x8')]);}})['catch'](function(_0x33cb7b){return _0xa05eeb(_0x33cb7b);});});}exports[_0x5068('0x9')]=function(_0x591143,_0x5bb2de,_0x207310){return function(_0x2c874b){if(_0x207310[_0x5068('0xa')]&&!_0x207310['rules'][_0x591143]){logger[_0x5068('0xb')](_0x5068('0xc'),_0x591143);return _0x2c874b[_0x5068('0xd')]();}var _0x5751f4=[];for(var _0x2f7761=0x0;_0x2f7761<_0x5bb2de[_0x5068('0xe')];_0x2f7761+=0x1){_0x5751f4[_0x5068('0xf')](request(_0x5068('0x10'),{'command':util['format'](_0x5068('0x11'),_0x5bb2de[_0x2f7761])})[_0x5068('0x5')](function(_0x457457){return _0x457457&&_0x457457[_0x5068('0x7')]&&_0x457457['message'][_0x5068('0x12')](_0x5068('0x13'))>=0x0?!![]:![];})[_0x5068('0x14')](function(_0x2f1f63){logger[_0x5068('0x6')](_0x5068('0x15'),_0x591143,_0x5bb2de[_0x2f7761]);}));}BPromise[_0x5068('0x16')](_0x5751f4)[_0x5068('0x5')](function(_0xdb79eb){var _0x3de48c=_[_0x5068('0x17')](_0xdb79eb);logger['info'](_0x5068('0x18'),_0x591143,_0x5bb2de[_0x5068('0x19')](_0x5068('0x1a')),_0x3de48c);_0x2c874b[_0x5068('0x1b')](_0x3de48c);})[_0x5068('0x14')](function(_0x43de14){console[_0x5068('0x1c')](_0x43de14);logger[_0x5068('0x6')](_0x5068('0x18'),_0x591143,_0x5bb2de[_0x5068('0x19')]('\x20|\x20'),_0x43de14['stack']);_0x2c874b[_0x5068('0xd')]();});};}; \ No newline at end of file +var _0xfcd6=['stop','length','push','iftime\x20%s','true','[%s][INTERVAL]\x20%s','all','some','[%s][INTERVAL]\x20%s\x20%s','\x20|\x20','when','join','util','bluebird','jayson/promise','lodash','../../../config/logger','routing','http','request','then','error','message','result','catch','condition','rules','info','[%s][INTERVAL]\x20ROUTING\x20STOPPED'];(function(_0xed8302,_0x352dc1){var _0x1f83f8=function(_0x4abdf4){while(--_0x4abdf4){_0xed8302['push'](_0xed8302['shift']());}};_0x1f83f8(++_0x352dc1);}(_0xfcd6,0x1bf));var _0x6fcd=function(_0xa0854d,_0x40550b){_0xa0854d=_0xa0854d-0x0;var _0x3a5908=_0xfcd6[_0xa0854d];return _0x3a5908;};'use strict';var util=require(_0x6fcd('0x0'));var BPromise=require(_0x6fcd('0x1'));var jayson=require(_0x6fcd('0x2'));var _=require(_0x6fcd('0x3'));var logger=require(_0x6fcd('0x4'))(_0x6fcd('0x5'));var client=jayson['client'][_0x6fcd('0x6')]({'port':0x232a});function request(_0x21d0b8,_0x9d47f4){return new BPromise(function(_0x26049b,_0x28b611){return client[_0x6fcd('0x7')](_0x21d0b8,_0x9d47f4)[_0x6fcd('0x8')](function(_0x23a967){if(_0x23a967[_0x6fcd('0x9')]){return _0x28b611(_0x23a967[_0x6fcd('0x9')][_0x6fcd('0xa')]);}else{return _0x26049b(_0x23a967[_0x6fcd('0xb')]);}})[_0x6fcd('0xc')](function(_0x22979a){return _0x28b611(_0x22979a);});});}exports[_0x6fcd('0xd')]=function(_0x55c928,_0x1ac5b1,_0x256d36){return function(_0x1f83bb){if(_0x256d36[_0x6fcd('0xe')]&&!_0x256d36[_0x6fcd('0xe')][_0x55c928]){logger[_0x6fcd('0xf')](_0x6fcd('0x10'),_0x55c928);return _0x1f83bb[_0x6fcd('0x11')]();}var _0x13da2a=[];for(var _0x51927a=0x0;_0x51927a<_0x1ac5b1[_0x6fcd('0x12')];_0x51927a+=0x1){_0x13da2a[_0x6fcd('0x13')](request('Command',{'command':util['format'](_0x6fcd('0x14'),_0x1ac5b1[_0x51927a])})[_0x6fcd('0x8')](function(_0x1f4e7d){return _0x1f4e7d&&_0x1f4e7d['message']&&_0x1f4e7d[_0x6fcd('0xa')]['indexOf'](_0x6fcd('0x15'))>=0x0?!![]:![];})['catch'](function(_0x4cbfca){logger['error'](_0x6fcd('0x16'),_0x55c928,_0x1ac5b1[_0x51927a]);}));}BPromise[_0x6fcd('0x17')](_0x13da2a)['then'](function(_0x3b8c4d){var _0x50f406=_[_0x6fcd('0x18')](_0x3b8c4d);logger[_0x6fcd('0xf')](_0x6fcd('0x19'),_0x55c928,_0x1ac5b1['join'](_0x6fcd('0x1a')),_0x50f406);_0x1f83bb[_0x6fcd('0x1b')](_0x50f406);})[_0x6fcd('0xc')](function(_0x3bcb26){console['log'](_0x3bcb26);logger[_0x6fcd('0x9')]('[%s][INTERVAL]\x20%s\x20%s',_0x55c928,_0x1ac5b1[_0x6fcd('0x1c')]('\x20|\x20'),_0x3bcb26['stack']);_0x1f83bb[_0x6fcd('0x11')]();});};}; \ No newline at end of file diff --git a/server/services/xdr/agents.controller.js b/server/services/xdr/agents.controller.js index 3a5685b..8deb794 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 _0x39cb=['util','./utils','info','[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','uniqueid','channel','queue','membername','calleridnum','connectedlinenum','lastevent','then','type','acwtime','agentacw','acwTimeout','request','CreateVoiceAgentReport','agentcalled','debug','[%s][agents][agentcalled]','destuniqueid','agentcalledAt','now','called','connectedlinename','format','[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','error','agentringnoanswer','isNil','agentringnoanswerAt','timeout','reason','holdtime','ringtime','talktime','[%s][agents][agentringnoanswer]','includes','[%s][agents][queuecallerabandon]','[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','abandoned','agentconnect','[%s][agents][agentconnect]','[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','agentconnectAt','connect','forIn','answered_elsewhere','answeredelsewheredestinationuniqueid','answeredelsewheremembername','[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','diffTime','agentcompleteAt','complete','[%s][agents][agentcomplete]','blindtransfer','transfereruniqueid','[%s][agents][blindtransfer]','[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s','transfertype','blind','extension','attendedtransfer','origtransfereruniqueid','origtransfererlinkedid','secondtransfereruniqueid','transfer','ATTENDED','transferexten','origtransfererexten','transferuniqueid','transfereeuniqueid','agententerreason','calleridname','secondtransfererlinkedid','[%s][agents][attendedtransfer]\x20agent:%s','transfertargetuniqueid','clone','[%s][agents][attendedtransfer]','hangup','[%s][agents][hangup]','cause','rejected','[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','indexOf','splice','agentcomplete','agent'];(function(_0x362a0c,_0x4e77b5){var _0x372dab=function(_0x378f2d){while(--_0x378f2d){_0x362a0c['push'](_0x362a0c['shift']());}};_0x372dab(++_0x4e77b5);}(_0x39cb,0x1bd));var _0xb39c=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x39cb[_0x3ab51d];return _0x29a04e;};'use strict';var _=require('lodash');var util=require(_0xb39c('0x0'));var utils=require(_0xb39c('0x1'));var agents={};var transfers={};var unanswered=[];function writeDB(_0x5ddb79,_0x266bb4){utils[_0xb39c('0x2')](util['format'](_0xb39c('0x3'),_0x5ddb79[_0xb39c('0x4')],_0x5ddb79[_0xb39c('0x5')],_0x5ddb79[_0xb39c('0x6')],_0x5ddb79[_0xb39c('0x7')],_0x5ddb79['interface'],_0x5ddb79[_0xb39c('0x8')],_0x5ddb79[_0xb39c('0x9')],_0x5ddb79[_0xb39c('0xa')]));if(_0x5ddb79[_0xb39c('0x6')]){utils['getVoiceQueueByName'](_0x5ddb79['queue'])[_0xb39c('0xb')](function(_0x7aa397){if(_0x7aa397){_0x5ddb79[_0xb39c('0xc')]=_0x7aa397[_0xb39c('0xc')];_0x5ddb79['agentacw']=_0x5ddb79['agentcomplete']?_0x7aa397['acw']:![];_0x5ddb79[_0xb39c('0xd')]=_0x5ddb79[_0xb39c('0xe')]?_0x7aa397[_0xb39c('0xf')]:0x0;}utils[_0xb39c('0x10')](_0xb39c('0x11'),_0x5ddb79);});}else{utils[_0xb39c('0x10')](_0xb39c('0x11'),_0x5ddb79);}if(_0x266bb4){delete transfers[_0x5ddb79[_0xb39c('0x4')]];}else{delete agents[_0x5ddb79['destuniqueid']];}}exports[_0xb39c('0x12')]=function(_0x468995){try{utils[_0xb39c('0x13')](util['format'](_0xb39c('0x14'),_0x468995[_0xb39c('0x4')]),_0x468995);agents[_0x468995[_0xb39c('0x15')]]=_0x468995;agents[_0x468995[_0xb39c('0x15')]][_0xb39c('0x16')]=utils[_0xb39c('0x17')]();agents[_0x468995[_0xb39c('0x15')]]['lastevent']=_0xb39c('0x18');agents[_0x468995[_0xb39c('0x15')]][_0xb39c('0x9')]=null;agents[_0x468995[_0xb39c('0x15')]][_0xb39c('0x19')]=null;utils[_0xb39c('0x2')](util[_0xb39c('0x1a')](_0xb39c('0x1b'),_0x468995[_0xb39c('0x4')],agents[_0x468995[_0xb39c('0x15')]]['membername'],_0x468995[_0xb39c('0x15')]));}catch(_0x1a8e12){utils[_0xb39c('0x1c')](util[_0xb39c('0x1a')]('[%s][agents][agentcalled]',_0x468995[_0xb39c('0x4')]),_0x1a8e12);}};exports[_0xb39c('0x1d')]=function(_0x5e4a0b){try{if(!_[_0xb39c('0x1e')](agents[_0x5e4a0b[_0xb39c('0x15')]])){utils[_0xb39c('0x13')](util['format']('[%s][agents][agentringnoanswer]',_0x5e4a0b[_0xb39c('0x4')]),_0x5e4a0b);utils[_0xb39c('0x2')](util[_0xb39c('0x1a')]('[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout',_0x5e4a0b[_0xb39c('0x4')],agents[_0x5e4a0b[_0xb39c('0x15')]][_0xb39c('0x7')],_0x5e4a0b[_0xb39c('0x15')]));agents[_0x5e4a0b[_0xb39c('0x15')]]['agentringnoanswer']=!![];agents[_0x5e4a0b[_0xb39c('0x15')]][_0xb39c('0x1f')]=utils['now']();agents[_0x5e4a0b[_0xb39c('0x15')]][_0xb39c('0xa')]=_0xb39c('0x20');agents[_0x5e4a0b[_0xb39c('0x15')]][_0xb39c('0x21')]='timeout';agents[_0x5e4a0b[_0xb39c('0x15')]][_0xb39c('0x22')]=_0x5e4a0b[_0xb39c('0x23')]?parseInt(_0x5e4a0b['ringtime'])/0x3e8:0x0;agents[_0x5e4a0b[_0xb39c('0x15')]][_0xb39c('0x24')]=0x0;unanswered['push'](_0x5e4a0b[_0xb39c('0x15')]);}}catch(_0x4b4458){utils[_0xb39c('0x1c')](util['format'](_0xb39c('0x25'),_0x5e4a0b[_0xb39c('0x4')]),_0x4b4458);}};exports['queuecallerabandon']=function(_0x2bc742){try{_['forIn'](agents,function(_0x8e2d7,_0x2d2743){if(_0x8e2d7[_0xb39c('0x4')]==_0x2bc742[_0xb39c('0x4')]&&!_[_0xb39c('0x26')](unanswered,_0x8e2d7['destuniqueid'])){utils[_0xb39c('0x13')](util['format'](_0xb39c('0x27'),_0x2bc742['uniqueid']),_0x2bc742);utils[_0xb39c('0x2')](util[_0xb39c('0x1a')](_0xb39c('0x28'),_0x2bc742[_0xb39c('0x4')],_0x8e2d7['membername'],_0x8e2d7['destuniqueid']));_0x8e2d7[_0xb39c('0x1d')]=!![];_0x8e2d7[_0xb39c('0x1f')]=utils['now']();_0x8e2d7[_0xb39c('0xa')]=_0xb39c('0x29');_0x8e2d7[_0xb39c('0x21')]=_0xb39c('0x29');_0x8e2d7[_0xb39c('0x22')]=_0x2bc742[_0xb39c('0x22')];_0x8e2d7[_0xb39c('0x24')]=0x0;writeDB(_0x8e2d7);}});}catch(_0x45e700){utils[_0xb39c('0x1c')](util[_0xb39c('0x1a')](_0xb39c('0x27'),_0x2bc742[_0xb39c('0x4')]),_0x45e700);}};exports[_0xb39c('0x2a')]=function(_0x2f6b5a){try{if(agents[_0x2f6b5a[_0xb39c('0x15')]]){utils[_0xb39c('0x13')](util[_0xb39c('0x1a')](_0xb39c('0x2b'),_0x2f6b5a[_0xb39c('0x4')]),_0x2f6b5a);utils['info'](util[_0xb39c('0x1a')](_0xb39c('0x2c'),_0x2f6b5a['uniqueid'],agents[_0x2f6b5a['destuniqueid']]['membername'],_0x2f6b5a[_0xb39c('0x15')]));agents[_0x2f6b5a[_0xb39c('0x15')]][_0xb39c('0x2d')]=utils['now']();agents[_0x2f6b5a[_0xb39c('0x15')]][_0xb39c('0x9')]=_0x2f6b5a[_0xb39c('0x9')];agents[_0x2f6b5a[_0xb39c('0x15')]][_0xb39c('0x19')]=_0x2f6b5a['connectedlinename'];agents[_0x2f6b5a[_0xb39c('0x15')]][_0xb39c('0x22')]=_0x2f6b5a['ringtime'];agents[_0x2f6b5a[_0xb39c('0x15')]]['lastevent']=_0xb39c('0x2e');_[_0xb39c('0x2f')](agents,function(_0x3eaf96,_0x4c043a){if(_0x3eaf96[_0xb39c('0x15')]!=_0x2f6b5a[_0xb39c('0x15')]&&_0x3eaf96[_0xb39c('0x4')]==_0x2f6b5a[_0xb39c('0x4')]){_0x3eaf96[_0xb39c('0x24')]=0x0;_0x3eaf96[_0xb39c('0x22')]=_0x2f6b5a[_0xb39c('0x23')];_0x3eaf96[_0xb39c('0x1d')]=!![];_0x3eaf96[_0xb39c('0x1f')]=utils[_0xb39c('0x17')]();_0x3eaf96[_0xb39c('0xa')]=_0xb39c('0x30');_0x3eaf96['reason']=_0xb39c('0x30');_0x3eaf96[_0xb39c('0x31')]=_0x2f6b5a[_0xb39c('0x15')];_0x3eaf96[_0xb39c('0x32')]=_0x2f6b5a[_0xb39c('0x7')];writeDB(_0x3eaf96);}});}}catch(_0x390cd7){utils[_0xb39c('0x1c')](util[_0xb39c('0x1a')](_0xb39c('0x2b'),_0x2f6b5a['uniqueid']),_0x390cd7);}};exports['agentcomplete']=function(_0x2f88c9){try{if(!_[_0xb39c('0x1e')](agents[_0x2f88c9['destuniqueid']])){utils['debug'](util[_0xb39c('0x1a')]('[%s][agents][agentcomplete]',_0x2f88c9[_0xb39c('0x4')]),_0x2f88c9);utils[_0xb39c('0x2')](util[_0xb39c('0x1a')](_0xb39c('0x33'),_0x2f88c9[_0xb39c('0x4')],agents[_0x2f88c9['destuniqueid']][_0xb39c('0x7')],_0x2f88c9[_0xb39c('0x15')]));agents[_0x2f88c9['destuniqueid']]['agentcomplete']=!![];agents[_0x2f88c9[_0xb39c('0x15')]]['agentcompleteAt']=utils['now']();agents[_0x2f88c9[_0xb39c('0x15')]][_0xb39c('0x24')]=utils[_0xb39c('0x34')](agents[_0x2f88c9[_0xb39c('0x15')]][_0xb39c('0x35')],agents[_0x2f88c9[_0xb39c('0x15')]][_0xb39c('0x2d')]);agents[_0x2f88c9[_0xb39c('0x15')]][_0xb39c('0x21')]=_0x2f88c9[_0xb39c('0x21')];agents[_0x2f88c9['destuniqueid']][_0xb39c('0xa')]=_0xb39c('0x36');writeDB(agents[_0x2f88c9[_0xb39c('0x15')]]);}}catch(_0x2f790e){utils[_0xb39c('0x1c')](util[_0xb39c('0x1a')](_0xb39c('0x37'),_0x2f88c9[_0xb39c('0x4')]),_0x2f790e);}};exports[_0xb39c('0x38')]=function(_0x1ae2cb){try{if(!_[_0xb39c('0x1e')](agents[_0x1ae2cb[_0xb39c('0x39')]])){utils[_0xb39c('0x13')](util[_0xb39c('0x1a')](_0xb39c('0x3a'),_0x1ae2cb[_0xb39c('0x4')]),_0x1ae2cb);utils['info'](util[_0xb39c('0x1a')](_0xb39c('0x3b'),_0x1ae2cb[_0xb39c('0x4')],agents[_0x1ae2cb[_0xb39c('0x39')]][_0xb39c('0x7')],agents[_0x1ae2cb[_0xb39c('0x39')]][_0xb39c('0x4')]));agents[_0x1ae2cb[_0xb39c('0x39')]]['transfer']=!![];agents[_0x1ae2cb['transfereruniqueid']][_0xb39c('0x3c')]=_0xb39c('0x3d');agents[_0x1ae2cb['transfereruniqueid']]['transferexten']=_0x1ae2cb[_0xb39c('0x3e')];agents[_0x1ae2cb[_0xb39c('0x39')]]['transferuniqueid']=agents[_0x1ae2cb[_0xb39c('0x39')]]['uniqueid'];}}catch(_0x5e367e){utils[_0xb39c('0x1c')](util['format'](_0xb39c('0x3a'),_0x1ae2cb[_0xb39c('0x4')]),_0x5e367e);}};exports[_0xb39c('0x3f')]=function(_0x3fd353){try{utils[_0xb39c('0x13')](util[_0xb39c('0x1a')]('[%s][agents][attendedtransfer]',_0x3fd353[_0xb39c('0x40')]),_0x3fd353);if(_0x3fd353[_0xb39c('0x40')]==_0x3fd353[_0xb39c('0x41')]){if(!_[_0xb39c('0x1e')](agents[_0x3fd353[_0xb39c('0x42')]])){utils['info'](util[_0xb39c('0x1a')]('[%s][agents][attendedtransfer]\x20agent:%s',_0x3fd353[_0xb39c('0x40')],agents[_0x3fd353[_0xb39c('0x42')]][_0xb39c('0x7')]));agents[_0x3fd353[_0xb39c('0x42')]][_0xb39c('0x43')]=!![];agents[_0x3fd353[_0xb39c('0x42')]][_0xb39c('0x3c')]=_0xb39c('0x44');agents[_0x3fd353[_0xb39c('0x42')]][_0xb39c('0x45')]=_0x3fd353[_0xb39c('0x46')];agents[_0x3fd353[_0xb39c('0x42')]][_0xb39c('0x47')]=_0x3fd353[_0xb39c('0x40')];}if(_0x3fd353[_0xb39c('0x48')]&&agents[_0x3fd353[_0xb39c('0x48')]]){agents[_0x3fd353[_0xb39c('0x48')]][_0xb39c('0x49')]=0x1;transfers[_0x3fd353[_0xb39c('0x48')]]=_['clone'](agents[_0x3fd353['transfereeuniqueid']]);transfers[_0x3fd353[_0xb39c('0x48')]][_0xb39c('0x8')]=agents[_0x3fd353['secondtransfereruniqueid']][_0xb39c('0x8')];transfers[_0x3fd353[_0xb39c('0x48')]]['calleridname']=agents[_0x3fd353[_0xb39c('0x42')]][_0xb39c('0x4a')];transfers[_0x3fd353[_0xb39c('0x48')]][_0xb39c('0x16')]=utils[_0xb39c('0x17')]();transfers[_0x3fd353[_0xb39c('0x48')]]['agentconnectAt']=utils[_0xb39c('0x17')]();transfers[_0x3fd353[_0xb39c('0x48')]][_0xb39c('0x22')]=0x0;transfers[_0x3fd353[_0xb39c('0x48')]][_0xb39c('0x49')]=0x2;}}else if(_0x3fd353[_0xb39c('0x42')]==_0x3fd353[_0xb39c('0x4b')]){if(!_['isNil'](agents[_0x3fd353[_0xb39c('0x40')]])){utils[_0xb39c('0x2')](util[_0xb39c('0x1a')](_0xb39c('0x4c'),_0x3fd353[_0xb39c('0x40')],agents[_0x3fd353['origtransfereruniqueid']]['membername']));agents[_0x3fd353[_0xb39c('0x40')]][_0xb39c('0x43')]=!![];agents[_0x3fd353[_0xb39c('0x40')]]['transfertype']=_0xb39c('0x44');agents[_0x3fd353['origtransfereruniqueid']][_0xb39c('0x45')]=_0x3fd353['secondtransfererexten'];agents[_0x3fd353[_0xb39c('0x40')]][_0xb39c('0x47')]=_0x3fd353[_0xb39c('0x42')];}if(_0x3fd353['transfertargetuniqueid']&&agents[_0x3fd353[_0xb39c('0x4d')]]){agents[_0x3fd353[_0xb39c('0x4d')]][_0xb39c('0x49')]=0x1;transfers[_0x3fd353[_0xb39c('0x4d')]]=_[_0xb39c('0x4e')](agents[_0x3fd353[_0xb39c('0x4d')]]);transfers[_0x3fd353[_0xb39c('0x4d')]][_0xb39c('0x8')]=agents[_0x3fd353[_0xb39c('0x40')]][_0xb39c('0x8')];transfers[_0x3fd353[_0xb39c('0x4d')]][_0xb39c('0x4a')]=agents[_0x3fd353[_0xb39c('0x40')]][_0xb39c('0x4a')];transfers[_0x3fd353[_0xb39c('0x4d')]][_0xb39c('0x16')]=utils[_0xb39c('0x17')]();transfers[_0x3fd353['transfertargetuniqueid']][_0xb39c('0x2d')]=utils[_0xb39c('0x17')]();transfers[_0x3fd353[_0xb39c('0x4d')]]['holdtime']=0x0;transfers[_0x3fd353[_0xb39c('0x4d')]]['agententerreason']=0x2;}}}catch(_0x4f1dcc){utils[_0xb39c('0x1c')](util[_0xb39c('0x1a')](_0xb39c('0x4f'),_0x3fd353[_0xb39c('0x40')]),_0x4f1dcc);}};exports[_0xb39c('0x50')]=function(_0x48dd96){try{utils['debug'](util[_0xb39c('0x1a')](_0xb39c('0x51'),_0x48dd96['uniqueid']),_0x48dd96);if(agents[_0x48dd96[_0xb39c('0x4')]]&&agents[_0x48dd96[_0xb39c('0x4')]][_0xb39c('0x21')]===_0xb39c('0x20')){if(_0x48dd96[_0xb39c('0x52')]==='21'){agents[_0x48dd96[_0xb39c('0x4')]][_0xb39c('0x21')]=_0xb39c('0x53');agents[_0x48dd96[_0xb39c('0x4')]][_0xb39c('0xa')]=_0xb39c('0x53');}utils[_0xb39c('0x2')](util[_0xb39c('0x1a')](_0xb39c('0x54'),_0x48dd96[_0xb39c('0x4')],agents[_0x48dd96['uniqueid']][_0xb39c('0x7')],agents[_0x48dd96['uniqueid']][_0xb39c('0x21')],agents[_0x48dd96[_0xb39c('0x4')]]['lastevent']));writeDB(agents[_0x48dd96[_0xb39c('0x4')]]);var _0x391361=unanswered[_0xb39c('0x55')](_0x48dd96[_0xb39c('0x4')]);if(_0x391361>-0x1){unanswered[_0xb39c('0x56')](_0x391361,0x1);}}if(transfers[_0x48dd96[_0xb39c('0x4')]]){transfers[_0x48dd96['uniqueid']][_0xb39c('0x57')]=!![];transfers[_0x48dd96[_0xb39c('0x4')]][_0xb39c('0x35')]=utils[_0xb39c('0x17')]();transfers[_0x48dd96[_0xb39c('0x4')]][_0xb39c('0x24')]=utils[_0xb39c('0x34')](transfers[_0x48dd96[_0xb39c('0x4')]][_0xb39c('0x35')],transfers[_0x48dd96['uniqueid']][_0xb39c('0x2d')]);transfers[_0x48dd96[_0xb39c('0x4')]][_0xb39c('0x21')]=_0xb39c('0x58');transfers[_0x48dd96[_0xb39c('0x4')]][_0xb39c('0xa')]=_0xb39c('0x36');utils['info'](util[_0xb39c('0x1a')](_0xb39c('0x54'),_0x48dd96[_0xb39c('0x4')],transfers[_0x48dd96[_0xb39c('0x4')]][_0xb39c('0x7')],transfers[_0x48dd96[_0xb39c('0x4')]][_0xb39c('0x21')],transfers[_0x48dd96[_0xb39c('0x4')]]['lastevent']));writeDB(transfers[_0x48dd96[_0xb39c('0x4')]],!![]);}if(agents[_0x48dd96['uniqueid']]&&agents[_0x48dd96[_0xb39c('0x4')]][_0xb39c('0x2d')]){agents[_0x48dd96[_0xb39c('0x4')]][_0xb39c('0x57')]=!![];agents[_0x48dd96[_0xb39c('0x4')]][_0xb39c('0x35')]=utils[_0xb39c('0x17')]();agents[_0x48dd96[_0xb39c('0x4')]]['talktime']=utils[_0xb39c('0x34')](agents[_0x48dd96[_0xb39c('0x4')]][_0xb39c('0x35')],agents[_0x48dd96[_0xb39c('0x4')]][_0xb39c('0x2d')]);agents[_0x48dd96[_0xb39c('0x4')]][_0xb39c('0x21')]=agents[_0x48dd96[_0xb39c('0x4')]][_0xb39c('0x43')]?_0xb39c('0x43'):_0xb39c('0x58');agents[_0x48dd96[_0xb39c('0x4')]][_0xb39c('0xa')]=_0xb39c('0x36');utils[_0xb39c('0x2')](util[_0xb39c('0x1a')]('[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s',_0x48dd96['uniqueid'],agents[_0x48dd96[_0xb39c('0x4')]][_0xb39c('0x7')],agents[_0x48dd96[_0xb39c('0x4')]]['reason'],agents[_0x48dd96[_0xb39c('0x4')]][_0xb39c('0xa')]));writeDB(agents[_0x48dd96[_0xb39c('0x4')]]);}}catch(_0x1dae6){utils[_0xb39c('0x1c')](util[_0xb39c('0x1a')](_0xb39c('0x51'),_0x48dd96['uniqueid']),_0x1dae6);}}; \ No newline at end of file +var _0x3c81=['CreateVoiceAgentReport','destuniqueid','agentcalled','debug','[%s][agents][agentcalled]','agentcalledAt','called','connectedlinename','info','format','[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','uniqueid','error','agentringnoanswer','[%s][agents][agentringnoanswer]','[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout','now','reason','holdtime','talktime','push','queuecallerabandon','forIn','[%s][agents][queuecallerabandon]','[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','agentringnoanswerAt','abandoned','agentconnect','[%s][agents][agentconnect]','[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','agentconnectAt','ringtime','connect','answered_elsewhere','answeredelsewheredestinationuniqueid','answeredelsewheremembername','[%s][agents][agentcomplete]','[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','agentcompleteAt','diffTime','complete','blindtransfer','transfereruniqueid','[%s][agents][blindtransfer]','[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s','transfer','transfertype','blind','transferexten','extension','attendedtransfer','[%s][agents][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid','secondtransfereruniqueid','[%s][agents][attendedtransfer]\x20agent:%s','origtransfererexten','transferuniqueid','transfereeuniqueid','clone','calleridname','agententerreason','secondtransfererlinkedid','isNil','ATTENDED','secondtransfererexten','transfertargetuniqueid','[%s][agents][hangup]','timeout','cause','rejected','[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','splice','agent','lodash','util','channel','queue','membername','interface','calleridnum','connectedlinenum','lastevent','getVoiceQueueByName','then','type','agentacw','agentcomplete','acw','acwtime','acwTimeout','request'];(function(_0x4fb464,_0x532408){var _0x576e42=function(_0x3ec4fa){while(--_0x3ec4fa){_0x4fb464['push'](_0x4fb464['shift']());}};_0x576e42(++_0x532408);}(_0x3c81,0x102));var _0x13c8=function(_0x573994,_0x15a9f2){_0x573994=_0x573994-0x0;var _0x1e848d=_0x3c81[_0x573994];return _0x1e848d;};'use strict';var _=require(_0x13c8('0x0'));var util=require(_0x13c8('0x1'));var utils=require('./utils');var agents={};var transfers={};var unanswered=[];function writeDB(_0x252f26,_0x131d0b){utils['info'](util['format']('[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s',_0x252f26['uniqueid'],_0x252f26[_0x13c8('0x2')],_0x252f26[_0x13c8('0x3')],_0x252f26[_0x13c8('0x4')],_0x252f26[_0x13c8('0x5')],_0x252f26[_0x13c8('0x6')],_0x252f26[_0x13c8('0x7')],_0x252f26[_0x13c8('0x8')]));if(_0x252f26['queue']){utils[_0x13c8('0x9')](_0x252f26['queue'])[_0x13c8('0xa')](function(_0x296463){if(_0x296463){_0x252f26[_0x13c8('0xb')]=_0x296463[_0x13c8('0xb')];_0x252f26[_0x13c8('0xc')]=_0x252f26[_0x13c8('0xd')]?_0x296463[_0x13c8('0xe')]:![];_0x252f26[_0x13c8('0xf')]=_0x252f26[_0x13c8('0xc')]?_0x296463[_0x13c8('0x10')]:0x0;}utils[_0x13c8('0x11')](_0x13c8('0x12'),_0x252f26);});}else{utils[_0x13c8('0x11')](_0x13c8('0x12'),_0x252f26);}if(_0x131d0b){delete transfers[_0x252f26['uniqueid']];}else{delete agents[_0x252f26[_0x13c8('0x13')]];}}exports[_0x13c8('0x14')]=function(_0x2304b5){try{utils[_0x13c8('0x15')](util['format'](_0x13c8('0x16'),_0x2304b5['uniqueid']),_0x2304b5);agents[_0x2304b5['destuniqueid']]=_0x2304b5;agents[_0x2304b5['destuniqueid']][_0x13c8('0x17')]=utils['now']();agents[_0x2304b5[_0x13c8('0x13')]][_0x13c8('0x8')]=_0x13c8('0x18');agents[_0x2304b5[_0x13c8('0x13')]]['connectedlinenum']=null;agents[_0x2304b5[_0x13c8('0x13')]][_0x13c8('0x19')]=null;utils[_0x13c8('0x1a')](util[_0x13c8('0x1b')](_0x13c8('0x1c'),_0x2304b5[_0x13c8('0x1d')],agents[_0x2304b5[_0x13c8('0x13')]][_0x13c8('0x4')],_0x2304b5[_0x13c8('0x13')]));}catch(_0x31d122){utils[_0x13c8('0x1e')](util['format'](_0x13c8('0x16'),_0x2304b5[_0x13c8('0x1d')]),_0x31d122);}};exports[_0x13c8('0x1f')]=function(_0x313ea3){try{if(!_['isNil'](agents[_0x313ea3[_0x13c8('0x13')]])){utils[_0x13c8('0x15')](util[_0x13c8('0x1b')](_0x13c8('0x20'),_0x313ea3[_0x13c8('0x1d')]),_0x313ea3);utils[_0x13c8('0x1a')](util['format'](_0x13c8('0x21'),_0x313ea3[_0x13c8('0x1d')],agents[_0x313ea3[_0x13c8('0x13')]][_0x13c8('0x4')],_0x313ea3['destuniqueid']));agents[_0x313ea3[_0x13c8('0x13')]][_0x13c8('0x1f')]=!![];agents[_0x313ea3['destuniqueid']]['agentringnoanswerAt']=utils[_0x13c8('0x22')]();agents[_0x313ea3[_0x13c8('0x13')]]['lastevent']='timeout';agents[_0x313ea3[_0x13c8('0x13')]][_0x13c8('0x23')]='timeout';agents[_0x313ea3['destuniqueid']][_0x13c8('0x24')]=_0x313ea3['ringtime']?parseInt(_0x313ea3['ringtime'])/0x3e8:0x0;agents[_0x313ea3[_0x13c8('0x13')]][_0x13c8('0x25')]=0x0;unanswered[_0x13c8('0x26')](_0x313ea3['destuniqueid']);}}catch(_0x5ef2f7){utils[_0x13c8('0x1e')](util[_0x13c8('0x1b')](_0x13c8('0x20'),_0x313ea3[_0x13c8('0x1d')]),_0x5ef2f7);}};exports[_0x13c8('0x27')]=function(_0x220d40){try{_[_0x13c8('0x28')](agents,function(_0x4a1b9c,_0x109cb8){if(_0x4a1b9c[_0x13c8('0x1d')]==_0x220d40['uniqueid']&&!_['includes'](unanswered,_0x4a1b9c[_0x13c8('0x13')])){utils[_0x13c8('0x15')](util['format'](_0x13c8('0x29'),_0x220d40[_0x13c8('0x1d')]),_0x220d40);utils['info'](util[_0x13c8('0x1b')](_0x13c8('0x2a'),_0x220d40[_0x13c8('0x1d')],_0x4a1b9c[_0x13c8('0x4')],_0x4a1b9c[_0x13c8('0x13')]));_0x4a1b9c[_0x13c8('0x1f')]=!![];_0x4a1b9c[_0x13c8('0x2b')]=utils[_0x13c8('0x22')]();_0x4a1b9c['lastevent']='abandoned';_0x4a1b9c[_0x13c8('0x23')]=_0x13c8('0x2c');_0x4a1b9c['holdtime']=_0x220d40[_0x13c8('0x24')];_0x4a1b9c['talktime']=0x0;writeDB(_0x4a1b9c);}});}catch(_0x1fdf7d){utils['error'](util[_0x13c8('0x1b')](_0x13c8('0x29'),_0x220d40[_0x13c8('0x1d')]),_0x1fdf7d);}};exports[_0x13c8('0x2d')]=function(_0x2039e7){try{if(agents[_0x2039e7[_0x13c8('0x13')]]){utils[_0x13c8('0x15')](util['format'](_0x13c8('0x2e'),_0x2039e7[_0x13c8('0x1d')]),_0x2039e7);utils['info'](util[_0x13c8('0x1b')](_0x13c8('0x2f'),_0x2039e7[_0x13c8('0x1d')],agents[_0x2039e7['destuniqueid']]['membername'],_0x2039e7['destuniqueid']));agents[_0x2039e7[_0x13c8('0x13')]][_0x13c8('0x30')]=utils[_0x13c8('0x22')]();agents[_0x2039e7[_0x13c8('0x13')]][_0x13c8('0x7')]=_0x2039e7[_0x13c8('0x7')];agents[_0x2039e7[_0x13c8('0x13')]][_0x13c8('0x19')]=_0x2039e7[_0x13c8('0x19')];agents[_0x2039e7['destuniqueid']]['holdtime']=_0x2039e7[_0x13c8('0x31')];agents[_0x2039e7[_0x13c8('0x13')]][_0x13c8('0x8')]=_0x13c8('0x32');_['forIn'](agents,function(_0x35e1e7,_0x4bd627){if(_0x35e1e7[_0x13c8('0x13')]!=_0x2039e7[_0x13c8('0x13')]&&_0x35e1e7[_0x13c8('0x1d')]==_0x2039e7[_0x13c8('0x1d')]){_0x35e1e7[_0x13c8('0x25')]=0x0;_0x35e1e7[_0x13c8('0x24')]=_0x2039e7[_0x13c8('0x31')];_0x35e1e7[_0x13c8('0x1f')]=!![];_0x35e1e7[_0x13c8('0x2b')]=utils[_0x13c8('0x22')]();_0x35e1e7[_0x13c8('0x8')]=_0x13c8('0x33');_0x35e1e7[_0x13c8('0x23')]=_0x13c8('0x33');_0x35e1e7[_0x13c8('0x34')]=_0x2039e7[_0x13c8('0x13')];_0x35e1e7[_0x13c8('0x35')]=_0x2039e7[_0x13c8('0x4')];writeDB(_0x35e1e7);}});}}catch(_0xc5eb86){utils[_0x13c8('0x1e')](util[_0x13c8('0x1b')](_0x13c8('0x2e'),_0x2039e7[_0x13c8('0x1d')]),_0xc5eb86);}};exports[_0x13c8('0xd')]=function(_0x44ee66){try{if(!_['isNil'](agents[_0x44ee66[_0x13c8('0x13')]])){utils[_0x13c8('0x15')](util[_0x13c8('0x1b')](_0x13c8('0x36'),_0x44ee66[_0x13c8('0x1d')]),_0x44ee66);utils['info'](util['format'](_0x13c8('0x37'),_0x44ee66[_0x13c8('0x1d')],agents[_0x44ee66[_0x13c8('0x13')]]['membername'],_0x44ee66['destuniqueid']));agents[_0x44ee66['destuniqueid']][_0x13c8('0xd')]=!![];agents[_0x44ee66['destuniqueid']][_0x13c8('0x38')]=utils['now']();agents[_0x44ee66[_0x13c8('0x13')]][_0x13c8('0x25')]=utils[_0x13c8('0x39')](agents[_0x44ee66[_0x13c8('0x13')]][_0x13c8('0x38')],agents[_0x44ee66[_0x13c8('0x13')]]['agentconnectAt']);agents[_0x44ee66[_0x13c8('0x13')]][_0x13c8('0x23')]=_0x44ee66['reason'];agents[_0x44ee66[_0x13c8('0x13')]][_0x13c8('0x8')]=_0x13c8('0x3a');writeDB(agents[_0x44ee66[_0x13c8('0x13')]]);}}catch(_0x38486a){utils['error'](util[_0x13c8('0x1b')](_0x13c8('0x36'),_0x44ee66[_0x13c8('0x1d')]),_0x38486a);}};exports[_0x13c8('0x3b')]=function(_0x185d18){try{if(!_['isNil'](agents[_0x185d18[_0x13c8('0x3c')]])){utils[_0x13c8('0x15')](util[_0x13c8('0x1b')](_0x13c8('0x3d'),_0x185d18[_0x13c8('0x1d')]),_0x185d18);utils[_0x13c8('0x1a')](util[_0x13c8('0x1b')](_0x13c8('0x3e'),_0x185d18[_0x13c8('0x1d')],agents[_0x185d18[_0x13c8('0x3c')]][_0x13c8('0x4')],agents[_0x185d18['transfereruniqueid']][_0x13c8('0x1d')]));agents[_0x185d18[_0x13c8('0x3c')]][_0x13c8('0x3f')]=!![];agents[_0x185d18[_0x13c8('0x3c')]][_0x13c8('0x40')]=_0x13c8('0x41');agents[_0x185d18['transfereruniqueid']][_0x13c8('0x42')]=_0x185d18[_0x13c8('0x43')];agents[_0x185d18[_0x13c8('0x3c')]]['transferuniqueid']=agents[_0x185d18['transfereruniqueid']][_0x13c8('0x1d')];}}catch(_0x14a738){utils['error'](util[_0x13c8('0x1b')](_0x13c8('0x3d'),_0x185d18['uniqueid']),_0x14a738);}};exports[_0x13c8('0x44')]=function(_0x554792){try{utils[_0x13c8('0x15')](util[_0x13c8('0x1b')](_0x13c8('0x45'),_0x554792['origtransfereruniqueid']),_0x554792);if(_0x554792[_0x13c8('0x46')]==_0x554792[_0x13c8('0x47')]){if(!_['isNil'](agents[_0x554792[_0x13c8('0x48')]])){utils['info'](util[_0x13c8('0x1b')](_0x13c8('0x49'),_0x554792[_0x13c8('0x46')],agents[_0x554792[_0x13c8('0x48')]][_0x13c8('0x4')]));agents[_0x554792['secondtransfereruniqueid']][_0x13c8('0x3f')]=!![];agents[_0x554792['secondtransfereruniqueid']]['transfertype']='ATTENDED';agents[_0x554792['secondtransfereruniqueid']]['transferexten']=_0x554792[_0x13c8('0x4a')];agents[_0x554792[_0x13c8('0x48')]][_0x13c8('0x4b')]=_0x554792[_0x13c8('0x46')];}if(_0x554792[_0x13c8('0x4c')]&&agents[_0x554792[_0x13c8('0x4c')]]){agents[_0x554792[_0x13c8('0x4c')]]['agententerreason']=0x1;transfers[_0x554792['transfereeuniqueid']]=_[_0x13c8('0x4d')](agents[_0x554792[_0x13c8('0x4c')]]);transfers[_0x554792[_0x13c8('0x4c')]][_0x13c8('0x6')]=agents[_0x554792[_0x13c8('0x48')]][_0x13c8('0x6')];transfers[_0x554792[_0x13c8('0x4c')]][_0x13c8('0x4e')]=agents[_0x554792['secondtransfereruniqueid']][_0x13c8('0x4e')];transfers[_0x554792[_0x13c8('0x4c')]]['agentcalledAt']=utils[_0x13c8('0x22')]();transfers[_0x554792[_0x13c8('0x4c')]][_0x13c8('0x30')]=utils[_0x13c8('0x22')]();transfers[_0x554792[_0x13c8('0x4c')]][_0x13c8('0x24')]=0x0;transfers[_0x554792[_0x13c8('0x4c')]][_0x13c8('0x4f')]=0x2;}}else if(_0x554792[_0x13c8('0x48')]==_0x554792[_0x13c8('0x50')]){if(!_[_0x13c8('0x51')](agents[_0x554792[_0x13c8('0x46')]])){utils[_0x13c8('0x1a')](util[_0x13c8('0x1b')](_0x13c8('0x49'),_0x554792[_0x13c8('0x46')],agents[_0x554792['origtransfereruniqueid']][_0x13c8('0x4')]));agents[_0x554792['origtransfereruniqueid']][_0x13c8('0x3f')]=!![];agents[_0x554792[_0x13c8('0x46')]]['transfertype']=_0x13c8('0x52');agents[_0x554792[_0x13c8('0x46')]]['transferexten']=_0x554792[_0x13c8('0x53')];agents[_0x554792[_0x13c8('0x46')]][_0x13c8('0x4b')]=_0x554792[_0x13c8('0x48')];}if(_0x554792[_0x13c8('0x54')]&&agents[_0x554792[_0x13c8('0x54')]]){agents[_0x554792[_0x13c8('0x54')]][_0x13c8('0x4f')]=0x1;transfers[_0x554792[_0x13c8('0x54')]]=_[_0x13c8('0x4d')](agents[_0x554792[_0x13c8('0x54')]]);transfers[_0x554792['transfertargetuniqueid']][_0x13c8('0x6')]=agents[_0x554792[_0x13c8('0x46')]][_0x13c8('0x6')];transfers[_0x554792[_0x13c8('0x54')]][_0x13c8('0x4e')]=agents[_0x554792[_0x13c8('0x46')]]['calleridname'];transfers[_0x554792[_0x13c8('0x54')]][_0x13c8('0x17')]=utils[_0x13c8('0x22')]();transfers[_0x554792['transfertargetuniqueid']][_0x13c8('0x30')]=utils[_0x13c8('0x22')]();transfers[_0x554792[_0x13c8('0x54')]][_0x13c8('0x24')]=0x0;transfers[_0x554792[_0x13c8('0x54')]][_0x13c8('0x4f')]=0x2;}}}catch(_0x55e5ba){utils[_0x13c8('0x1e')](util[_0x13c8('0x1b')](_0x13c8('0x45'),_0x554792[_0x13c8('0x46')]),_0x55e5ba);}};exports['hangup']=function(_0x16b409){try{utils[_0x13c8('0x15')](util[_0x13c8('0x1b')](_0x13c8('0x55'),_0x16b409[_0x13c8('0x1d')]),_0x16b409);if(agents[_0x16b409[_0x13c8('0x1d')]]&&agents[_0x16b409[_0x13c8('0x1d')]]['reason']===_0x13c8('0x56')){if(_0x16b409[_0x13c8('0x57')]==='21'){agents[_0x16b409[_0x13c8('0x1d')]]['reason']=_0x13c8('0x58');agents[_0x16b409[_0x13c8('0x1d')]]['lastevent']='rejected';}utils[_0x13c8('0x1a')](util['format'](_0x13c8('0x59'),_0x16b409['uniqueid'],agents[_0x16b409[_0x13c8('0x1d')]][_0x13c8('0x4')],agents[_0x16b409[_0x13c8('0x1d')]][_0x13c8('0x23')],agents[_0x16b409[_0x13c8('0x1d')]]['lastevent']));writeDB(agents[_0x16b409[_0x13c8('0x1d')]]);var _0x2d8dfe=unanswered['indexOf'](_0x16b409[_0x13c8('0x1d')]);if(_0x2d8dfe>-0x1){unanswered[_0x13c8('0x5a')](_0x2d8dfe,0x1);}}if(transfers[_0x16b409[_0x13c8('0x1d')]]){transfers[_0x16b409[_0x13c8('0x1d')]][_0x13c8('0xd')]=!![];transfers[_0x16b409[_0x13c8('0x1d')]][_0x13c8('0x38')]=utils[_0x13c8('0x22')]();transfers[_0x16b409[_0x13c8('0x1d')]][_0x13c8('0x25')]=utils['diffTime'](transfers[_0x16b409[_0x13c8('0x1d')]][_0x13c8('0x38')],transfers[_0x16b409['uniqueid']]['agentconnectAt']);transfers[_0x16b409[_0x13c8('0x1d')]][_0x13c8('0x23')]=_0x13c8('0x5b');transfers[_0x16b409[_0x13c8('0x1d')]][_0x13c8('0x8')]=_0x13c8('0x3a');utils['info'](util[_0x13c8('0x1b')](_0x13c8('0x59'),_0x16b409[_0x13c8('0x1d')],transfers[_0x16b409[_0x13c8('0x1d')]][_0x13c8('0x4')],transfers[_0x16b409['uniqueid']][_0x13c8('0x23')],transfers[_0x16b409[_0x13c8('0x1d')]]['lastevent']));writeDB(transfers[_0x16b409[_0x13c8('0x1d')]],!![]);}if(agents[_0x16b409[_0x13c8('0x1d')]]&&agents[_0x16b409['uniqueid']][_0x13c8('0x30')]){agents[_0x16b409['uniqueid']][_0x13c8('0xd')]=!![];agents[_0x16b409['uniqueid']][_0x13c8('0x38')]=utils[_0x13c8('0x22')]();agents[_0x16b409[_0x13c8('0x1d')]]['talktime']=utils[_0x13c8('0x39')](agents[_0x16b409['uniqueid']]['agentcompleteAt'],agents[_0x16b409[_0x13c8('0x1d')]][_0x13c8('0x30')]);agents[_0x16b409[_0x13c8('0x1d')]][_0x13c8('0x23')]=agents[_0x16b409['uniqueid']]['transfer']?_0x13c8('0x3f'):'agent';agents[_0x16b409['uniqueid']][_0x13c8('0x8')]=_0x13c8('0x3a');utils[_0x13c8('0x1a')](util[_0x13c8('0x1b')]('[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s',_0x16b409[_0x13c8('0x1d')],agents[_0x16b409['uniqueid']]['membername'],agents[_0x16b409[_0x13c8('0x1d')]][_0x13c8('0x23')],agents[_0x16b409[_0x13c8('0x1d')]][_0x13c8('0x8')]));writeDB(agents[_0x16b409[_0x13c8('0x1d')]]);}}catch(_0x551563){utils[_0x13c8('0x1e')](util['format'](_0x13c8('0x55'),_0x16b409['uniqueid']),_0x551563);}}; \ No newline at end of file diff --git a/server/services/xdr/calls.controller.js b/server/services/xdr/calls.controller.js index 26c2f2a..41e0c95 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 _0x1c0f=['cdr','split','substring','lastIndexOf','includes','noop','execif','set','lodash','util','./utils','./transfers.controller','NO\x20ANSWER','FAILED','ANSWERED','BUSY','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','accountcode','getUserByInternal','then','request','CreateVoiceCallReport','newchannel','[%s][calls][newchannel]','linkedid','OutgoingSpoolFailed','info','[%s][calls][newchannel]\x20context:%s\x20exten:%s','context','now','DOCUMENTATION','debug','[%s][calls][newstate]','isNil','channelstate','[%s][calls][newstate]\x20context:%s\x20channel:%s','systemanswertime','transfer','[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','destinationchannel','toNumber','hangup','[%s][calls][hangup]','callerid','cause-txt','endtime','duration','diffTime','starttime','answertime','error','[%s][calls][attendedtransfer]','origtransfereruniqueid','localtwolinkedid','transfereechannel','[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s','secondtransfererchannel','_attended','transfertargetchannel','userfield','musiconholdstart','musiconholdstartAt','[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s','[%s][calls][musiconholdstart]','mohtime','[%s][calls][musiconholdstop]\x20mohtime:%s','varset','[%s][calls][varset]','variable','xmd-originatecalleridnum','[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','source','value','xmd-phone','[%s][calls][varset]\x20variable:xmd-phone\x20value:%s','destination','\x22\x20<','xmd-callerid-preview','xmd-callerid','[%s][calls][varset]\x20variable:%s\x20value:%s','xmd-queue','xmcs-queue','lastapplication','Queue','lastdata','[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s','ContactId','xmd-cdrtype','outboundrouteid','[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s','routeid','[%s][calls][varset]\x20variable:sipcallid\x20value:%s','sipcallid','newexten','[%s][calls][newexten]','appdata','application','toLowerCase'];(function(_0x36dfbd,_0x5bfe2d){var _0x4ecad9=function(_0x5230da){while(--_0x5230da){_0x36dfbd['push'](_0x36dfbd['shift']());}};_0x4ecad9(++_0x5bfe2d);}(_0x1c0f,0x14c));var _0xf1c0=function(_0x280c69,_0x51f7e2){_0x280c69=_0x280c69-0x0;var _0x475ad0=_0x1c0f[_0x280c69];return _0x475ad0;};'use strict';var _=require(_0xf1c0('0x0'));var util=require(_0xf1c0('0x1'));var utils=require(_0xf1c0('0x2'));var transfers=require(_0xf1c0('0x3'));var dispositions=[_0xf1c0('0x4'),_0xf1c0('0x5'),'FAILED',_0xf1c0('0x4'),_0xf1c0('0x4'),'NO\x20ANSWER',_0xf1c0('0x6'),_0xf1c0('0x7'),_0xf1c0('0x5'),_0xf1c0('0x5'),'FAILED'];var channels={};function writeDB(_0x150fd8){var _0x410c9a;if(transfers[_0xf1c0('0x8')][_0x150fd8[_0xf1c0('0x9')]]){_0x410c9a=_0x150fd8[_0xf1c0('0x9')];_0x150fd8[_0xf1c0('0x9')]=transfers[_0xf1c0('0x8')][_0x150fd8[_0xf1c0('0x9')]][_0xf1c0('0xa')];}utils['info'](util[_0xf1c0('0xb')](_0xf1c0('0xc'),_0x150fd8[_0xf1c0('0x9')],_0x150fd8[_0xf1c0('0xd')],_0x150fd8[_0xf1c0('0xe')],_0x150fd8[_0xf1c0('0xf')],_0x150fd8[_0xf1c0('0x10')],_0x150fd8[_0xf1c0('0x11')],_0x150fd8[_0xf1c0('0x12')],_0x150fd8['lastevent']));if(_0x150fd8[_0xf1c0('0x13')]){utils[_0xf1c0('0x14')](_0x150fd8[_0xf1c0('0x13')])[_0xf1c0('0x15')](function(_0x2c5388){if(_0x2c5388){_0x150fd8['UserId']=_0x2c5388['id'];}utils[_0xf1c0('0x16')](_0xf1c0('0x17'),_0x150fd8);});}else{utils[_0xf1c0('0x16')](_0xf1c0('0x17'),_0x150fd8);}if(channels[_0x150fd8[_0xf1c0('0x9')]]){delete channels[_0x150fd8[_0xf1c0('0x9')]];}else if(_0x410c9a&&channels[_0x410c9a]){delete transfers[_0xf1c0('0x8')][_0x410c9a];delete channels[_0x410c9a];}}exports[_0xf1c0('0x18')]=function(_0x2c43f0){try{utils['debug'](util['format'](_0xf1c0('0x19'),_0x2c43f0[_0xf1c0('0x9')]),_0x2c43f0);if(_0x2c43f0[_0xf1c0('0x9')]==_0x2c43f0[_0xf1c0('0x1a')]&&_0x2c43f0[_0xf1c0('0xd')]!=_0xf1c0('0x1b')){utils[_0xf1c0('0x1c')](util[_0xf1c0('0xb')](_0xf1c0('0x1d'),_0x2c43f0[_0xf1c0('0x9')],_0x2c43f0[_0xf1c0('0x1e')],_0x2c43f0['exten']));channels[_0x2c43f0['uniqueid']]={'uniqueid':_0x2c43f0[_0xf1c0('0x9')],'accountcode':_0x2c43f0['accountcode'],'source':_0x2c43f0[_0xf1c0('0x11')],'destination':_0x2c43f0['exten'],'destinationcontext':_0x2c43f0[_0xf1c0('0x1e')],'channel':_0x2c43f0[_0xf1c0('0xd')],'starttime':utils[_0xf1c0('0x1f')](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':'NO\x20ANSWER','amaflags':_0xf1c0('0x20')};}}catch(_0x4c6037){utils['error'](util[_0xf1c0('0xb')](_0xf1c0('0x19'),_0x2c43f0[_0xf1c0('0x9')]),_0x4c6037);}};exports['newstate']=function(_0x2e5688){try{utils[_0xf1c0('0x21')](util[_0xf1c0('0xb')](_0xf1c0('0x22'),_0x2e5688[_0xf1c0('0x9')]),_0x2e5688);if(!_[_0xf1c0('0x23')](channels[_0x2e5688['uniqueid']])&&_0x2e5688[_0xf1c0('0x24')]==0x6){utils[_0xf1c0('0x1c')](util[_0xf1c0('0xb')](_0xf1c0('0x25'),_0x2e5688['uniqueid'],_0x2e5688[_0xf1c0('0x1e')],_0x2e5688[_0xf1c0('0xd')]));if(_[_0xf1c0('0x23')](channels[_0x2e5688['uniqueid']][_0xf1c0('0x26')])){channels[_0x2e5688[_0xf1c0('0x9')]]['systemanswertime']=utils['now']();}}else if(!_[_0xf1c0('0x23')](channels[_0x2e5688['linkedid']])&&_0x2e5688[_0xf1c0('0x24')]==0x6&&_0x2e5688[_0xf1c0('0x1e')]!=_0xf1c0('0x27')){utils[_0xf1c0('0x1c')](util[_0xf1c0('0xb')](_0xf1c0('0x28'),_0x2e5688[_0xf1c0('0x9')],_0x2e5688[_0xf1c0('0x1a')],_0x2e5688[_0xf1c0('0x1e')],_0x2e5688[_0xf1c0('0xd')]));channels[_0x2e5688[_0xf1c0('0x1a')]][_0xf1c0('0x13')]=_0x2e5688[_0xf1c0('0x13')];channels[_0x2e5688['linkedid']][_0xf1c0('0x29')]=_0x2e5688[_0xf1c0('0xd')];if(_[_0xf1c0('0x23')](channels[_0x2e5688['linkedid']]['answertime'])){channels[_0x2e5688[_0xf1c0('0x1a')]]['answertime']=utils['now']();}channels[_0x2e5688[_0xf1c0('0x1a')]]['disposition']=dispositions[_[_0xf1c0('0x2a')](_0x2e5688[_0xf1c0('0x24')])]||_0xf1c0('0x6');}}catch(_0x76ae0e){utils['error'](util[_0xf1c0('0xb')](_0xf1c0('0x22'),_0x2e5688[_0xf1c0('0x9')]),_0x76ae0e);}};exports[_0xf1c0('0x2b')]=function(_0xeb62b6){try{if(!_[_0xf1c0('0x23')](channels[_0xeb62b6[_0xf1c0('0x9')]])){utils[_0xf1c0('0x21')](util[_0xf1c0('0xb')](_0xf1c0('0x2c'),_0xeb62b6['uniqueid']),_0xeb62b6);if(_[_0xf1c0('0x23')](channels[_0xeb62b6[_0xf1c0('0x9')]][_0xf1c0('0x2d')])){channels[_0xeb62b6['uniqueid']]['callerid']=_0xeb62b6['calleridname']+'\x20<'+_0xeb62b6[_0xf1c0('0x11')]+'>';}utils[_0xf1c0('0x1c')](util[_0xf1c0('0xb')]('[%s][calls][hangup]\x20callerid:%s\x20reason:%s',_0xeb62b6['uniqueid'],channels[_0xeb62b6[_0xf1c0('0x9')]][_0xf1c0('0x2d')],_0xeb62b6[_0xf1c0('0x2e')]));channels[_0xeb62b6[_0xf1c0('0x9')]][_0xf1c0('0x2f')]=utils['now']();channels[_0xeb62b6[_0xf1c0('0x9')]][_0xf1c0('0x30')]=utils[_0xf1c0('0x31')](channels[_0xeb62b6[_0xf1c0('0x9')]]['endtime'],channels[_0xeb62b6[_0xf1c0('0x9')]][_0xf1c0('0x32')]);channels[_0xeb62b6['uniqueid']]['billableseconds']=channels[_0xeb62b6[_0xf1c0('0x9')]][_0xf1c0('0x33')]?utils[_0xf1c0('0x31')](channels[_0xeb62b6[_0xf1c0('0x9')]][_0xf1c0('0x2f')],channels[_0xeb62b6[_0xf1c0('0x9')]][_0xf1c0('0x33')]):0x0;writeDB(channels[_0xeb62b6[_0xf1c0('0x9')]]);}}catch(_0x23f1a4){utils[_0xf1c0('0x34')](util[_0xf1c0('0xb')](_0xf1c0('0x2c'),_0xeb62b6['uniqueid']),_0x23f1a4);}};exports['attendedtransfer']=function(_0x18581a){try{if(!_[_0xf1c0('0x23')](channels[_0x18581a['localtwolinkedid']])){utils[_0xf1c0('0x21')](util[_0xf1c0('0xb')](_0xf1c0('0x35'),_0x18581a[_0xf1c0('0x36')]),_0x18581a);if(channels[_0x18581a[_0xf1c0('0x37')]]['channel']==_0x18581a[_0xf1c0('0x38')]){utils[_0xf1c0('0x1c')](util[_0xf1c0('0xb')](_0xf1c0('0x39'),_0x18581a[_0xf1c0('0x36')],_0x18581a[_0xf1c0('0x37')],_0x18581a[_0xf1c0('0x3a')]));channels[_0x18581a[_0xf1c0('0x37')]]['destinationchannel']=_0x18581a[_0xf1c0('0x3a')];channels[_0x18581a[_0xf1c0('0x37')]]['userfield']=_0xf1c0('0x3b');}else if(channels[_0x18581a[_0xf1c0('0x37')]][_0xf1c0('0xd')]=_0x18581a[_0xf1c0('0x3c')]){utils[_0xf1c0('0x1c')](util[_0xf1c0('0xb')](_0xf1c0('0x39'),_0x18581a[_0xf1c0('0x36')],_0x18581a['localtwolinkedid'],_0x18581a['origtransfererchannel']));channels[_0x18581a[_0xf1c0('0x37')]][_0xf1c0('0x29')]=_0x18581a['origtransfererchannel'];channels[_0x18581a[_0xf1c0('0x37')]][_0xf1c0('0x3d')]='_attended';}}}catch(_0x2081aa){utils[_0xf1c0('0x34')](util[_0xf1c0('0xb')]('[%s][calls][attendedtransfer]',_0x18581a[_0xf1c0('0x36')]),_0x2081aa);}};exports[_0xf1c0('0x3e')]=function(_0x257dc4){try{if(!_[_0xf1c0('0x23')](channels[_0x257dc4['uniqueid']])){utils['debug'](util['format']('[%s][calls][musiconholdstart]',_0x257dc4['uniqueid']),_0x257dc4);channels[_0x257dc4[_0xf1c0('0x9')]][_0xf1c0('0x3f')]=utils[_0xf1c0('0x1f')]();utils['info'](util[_0xf1c0('0xb')](_0xf1c0('0x40'),_0x257dc4['uniqueid'],channels[_0x257dc4[_0xf1c0('0x9')]][_0xf1c0('0x3f')]));}}catch(_0x10f663){utils[_0xf1c0('0x34')](util['format'](_0xf1c0('0x41'),_0x257dc4[_0xf1c0('0x9')]),_0x10f663);}};exports['musiconholdstop']=function(_0x16794e){try{if(!_[_0xf1c0('0x23')](channels[_0x16794e[_0xf1c0('0x9')]])){utils[_0xf1c0('0x21')](util[_0xf1c0('0xb')]('[%s][calls][musiconholdstop]',_0x16794e[_0xf1c0('0x9')]),_0x16794e);if(!_['isNil'](channels[_0x16794e[_0xf1c0('0x9')]][_0xf1c0('0x3f')])){channels[_0x16794e[_0xf1c0('0x9')]][_0xf1c0('0x42')]+=utils[_0xf1c0('0x31')](utils[_0xf1c0('0x1f')](),channels[_0x16794e['uniqueid']][_0xf1c0('0x3f')]);utils[_0xf1c0('0x1c')](util[_0xf1c0('0xb')](_0xf1c0('0x43'),_0x16794e[_0xf1c0('0x9')],channels[_0x16794e[_0xf1c0('0x9')]][_0xf1c0('0x42')]));delete channels[_0x16794e[_0xf1c0('0x9')]][_0xf1c0('0x3f')];}}}catch(_0x3ba138){utils[_0xf1c0('0x34')](util['format']('[%s][calls][musiconholdstop]',_0x16794e[_0xf1c0('0x9')]),_0x3ba138);}};exports[_0xf1c0('0x44')]=function(_0x3f5c68){try{if(!_[_0xf1c0('0x23')](channels[_0x3f5c68[_0xf1c0('0x9')]])){utils[_0xf1c0('0x21')](util[_0xf1c0('0xb')](_0xf1c0('0x45'),_0x3f5c68[_0xf1c0('0x9')]),_0x3f5c68);if(!_[_0xf1c0('0x23')](_0x3f5c68[_0xf1c0('0x46')][_0xf1c0('0x47')])){utils[_0xf1c0('0x1c')](util[_0xf1c0('0xb')](_0xf1c0('0x48'),_0x3f5c68[_0xf1c0('0x9')],_0x3f5c68['value']));channels[_0x3f5c68[_0xf1c0('0x9')]][_0xf1c0('0x49')]=_0x3f5c68[_0xf1c0('0x4a')];}if(!_[_0xf1c0('0x23')](_0x3f5c68['variable'][_0xf1c0('0x4b')])){utils['info'](util['format'](_0xf1c0('0x4c'),_0x3f5c68[_0xf1c0('0x9')],_0x3f5c68[_0xf1c0('0x4a')]));channels[_0x3f5c68[_0xf1c0('0x9')]][_0xf1c0('0x4d')]=_0x3f5c68[_0xf1c0('0x4a')];channels[_0x3f5c68[_0xf1c0('0x9')]]['callerid']='\x22'+_0x3f5c68[_0xf1c0('0x4a')]+_0xf1c0('0x4e')+_0x3f5c68['value']+'>';}if(!_[_0xf1c0('0x23')](_0x3f5c68[_0xf1c0('0x46')][_0xf1c0('0x4f')])||!_[_0xf1c0('0x23')](_0x3f5c68['variable'][_0xf1c0('0x50')])){utils[_0xf1c0('0x1c')](util['format'](_0xf1c0('0x51'),_0x3f5c68[_0xf1c0('0x9')],!_['isNil'](_0x3f5c68[_0xf1c0('0x46')]['xmd-callerid-preview'])?_0xf1c0('0x4f'):_0xf1c0('0x50'),_0x3f5c68[_0xf1c0('0x4a')]));channels[_0x3f5c68['uniqueid']][_0xf1c0('0x2d')]=_0x3f5c68['value'];}if(!_['isNil'](_0x3f5c68[_0xf1c0('0x46')][_0xf1c0('0x52')])||!_[_0xf1c0('0x23')](_0x3f5c68['variable'][_0xf1c0('0x53')])){utils[_0xf1c0('0x1c')](util[_0xf1c0('0xb')](_0xf1c0('0x51'),_0x3f5c68['uniqueid'],!_[_0xf1c0('0x23')](_0x3f5c68[_0xf1c0('0x46')][_0xf1c0('0x52')])?'xmd-queue':_0xf1c0('0x53'),_0x3f5c68[_0xf1c0('0x4a')]));channels[_0x3f5c68[_0xf1c0('0x9')]][_0xf1c0('0x54')]=_0xf1c0('0x55');channels[_0x3f5c68[_0xf1c0('0x9')]][_0xf1c0('0x56')]=_0x3f5c68[_0xf1c0('0x4a')];channels[_0x3f5c68[_0xf1c0('0x9')]][_0xf1c0('0xe')]=!![];}if(!_[_0xf1c0('0x23')](_0x3f5c68[_0xf1c0('0x46')]['xmd-contactid'])){utils[_0xf1c0('0x1c')](util[_0xf1c0('0xb')](_0xf1c0('0x57'),_0x3f5c68['uniqueid'],_0x3f5c68[_0xf1c0('0x4a')]));channels[_0x3f5c68[_0xf1c0('0x9')]][_0xf1c0('0x58')]=_0x3f5c68[_0xf1c0('0x4a')];}if(!_[_0xf1c0('0x23')](_0x3f5c68[_0xf1c0('0x46')][_0xf1c0('0x59')])){utils['info'](util[_0xf1c0('0xb')]('[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s',_0x3f5c68[_0xf1c0('0x9')],_0x3f5c68[_0xf1c0('0x4a')]));channels[_0x3f5c68[_0xf1c0('0x9')]]['type']=_0x3f5c68['value'];}if(!_['isNil'](_0x3f5c68[_0xf1c0('0x46')][_0xf1c0('0x5a')])){utils['info'](util[_0xf1c0('0xb')](_0xf1c0('0x5b'),_0x3f5c68[_0xf1c0('0x9')],_0x3f5c68[_0xf1c0('0x4a')]));channels[_0x3f5c68[_0xf1c0('0x9')]][_0xf1c0('0x5c')]=_0x3f5c68[_0xf1c0('0x4a')];}if(!_['isNil'](_0x3f5c68[_0xf1c0('0x46')]['sipcallid'])){utils[_0xf1c0('0x1c')](util[_0xf1c0('0xb')](_0xf1c0('0x5d'),_0x3f5c68[_0xf1c0('0x9')],_0x3f5c68[_0xf1c0('0x4a')]));channels[_0x3f5c68[_0xf1c0('0x9')]][_0xf1c0('0x5e')]=_0x3f5c68['value'];}}}catch(_0x4c4bb8){utils[_0xf1c0('0x34')](util[_0xf1c0('0xb')](_0xf1c0('0x45'),_0x3f5c68['uniqueid']),_0x4c4bb8);}};exports[_0xf1c0('0x5f')]=function(_0x363d99){try{if(!_['isNil'](channels[_0x363d99[_0xf1c0('0x9')]])){utils[_0xf1c0('0x21')](util[_0xf1c0('0xb')](_0xf1c0('0x60'),_0x363d99['uniqueid']),_0x363d99);utils[_0xf1c0('0x1c')](util[_0xf1c0('0xb')]('[%s][calls][newexten]\x20application:%s\x20appdata:%s',_0x363d99[_0xf1c0('0x9')],_0x363d99['application'],_0x363d99[_0xf1c0('0x61')]));if(_0x363d99[_0xf1c0('0x62')][_0xf1c0('0x63')]()=='set'&&_['startsWith'](_0x363d99[_0xf1c0('0x61')][_0xf1c0('0x63')](),_0xf1c0('0x64'))){var _0x4070e0=_0x363d99[_0xf1c0('0x61')][_0xf1c0('0x65')]('=');var _0x1dd98a=_0x4070e0[0x0][_0xf1c0('0x66')](_0x4070e0[0x0][_0xf1c0('0x67')]('(')+0x1,_0x4070e0[0x0]['lastIndexOf'](')'));var _0x219f06=_0x4070e0[0x1];channels[_0x363d99[_0xf1c0('0x9')]][_0x1dd98a]=_0x219f06;}if(!_[_0xf1c0('0x68')]([_0xf1c0('0x2b'),_0xf1c0('0x69'),_0xf1c0('0x6a'),_0xf1c0('0x6b'),'gotoif'],_0x363d99[_0xf1c0('0x62')][_0xf1c0('0x63')]())){channels[_0x363d99[_0xf1c0('0x9')]][_0xf1c0('0x54')]=_0x363d99[_0xf1c0('0x62')];channels[_0x363d99[_0xf1c0('0x9')]][_0xf1c0('0x56')]=_0x363d99[_0xf1c0('0x61')];}}}catch(_0x32fd1a){utils[_0xf1c0('0x34')](util[_0xf1c0('0xb')]('[%s][calls][newexten]',_0x363d99[_0xf1c0('0x9')]),_0x32fd1a);}}; \ No newline at end of file +var _0x442a=['outboundrouteid','[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s','routeid','sipcallid','[%s][calls][varset]\x20variable:sipcallid\x20value:%s','newexten','[%s][calls][newexten]\x20application:%s\x20appdata:%s','application','appdata','toLowerCase','startsWith','split','substring','lastIndexOf','includes','noop','set','gotoif','[%s][calls][newexten]','util','./utils','./transfers.controller','NO\x20ANSWER','FAILED','BUSY','blinds','uniqueid','format','[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','interface','calleridnum','connectedlinenum','lastevent','accountcode','getUserByInternal','then','CreateVoiceCallReport','request','[%s][calls][newchannel]','linkedid','channel','OutgoingSpoolFailed','info','context','exten','error','newstate','debug','isNil','[%s][calls][newstate]\x20context:%s\x20channel:%s','systemanswertime','now','channelstate','transfer','[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','destinationchannel','answertime','disposition','ANSWERED','[%s][calls][newstate]','hangup','[%s][calls][hangup]','callerid','[%s][calls][hangup]\x20callerid:%s\x20reason:%s','cause-txt','duration','diffTime','billableseconds','endtime','attendedtransfer','[%s][calls][attendedtransfer]','origtransfereruniqueid','localtwolinkedid','transfereechannel','secondtransfererchannel','userfield','_attended','transfertargetchannel','[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s','origtransfererchannel','[%s][calls][musiconholdstart]','musiconholdstartAt','musiconholdstop','mohtime','[%s][calls][musiconholdstop]','varset','[%s][calls][varset]','variable','xmd-originatecalleridnum','value','source','xmd-phone','[%s][calls][varset]\x20variable:xmd-phone\x20value:%s','destination','xmd-callerid','[%s][calls][varset]\x20variable:%s\x20value:%s','xmd-callerid-preview','xmd-queue','xmcs-queue','lastapplication','Queue','lastdata','queue','[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s','ContactId','xmd-cdrtype'];(function(_0x97c90e,_0xf0dcfd){var _0x28e133=function(_0x2b6eba){while(--_0x2b6eba){_0x97c90e['push'](_0x97c90e['shift']());}};_0x28e133(++_0xf0dcfd);}(_0x442a,0x1bb));var _0xa442=function(_0x1cbcf1,_0x3f9fd9){_0x1cbcf1=_0x1cbcf1-0x0;var _0x3a06f0=_0x442a[_0x1cbcf1];return _0x3a06f0;};'use strict';var _=require('lodash');var util=require(_0xa442('0x0'));var utils=require(_0xa442('0x1'));var transfers=require(_0xa442('0x2'));var dispositions=[_0xa442('0x3'),_0xa442('0x4'),_0xa442('0x4'),_0xa442('0x3'),_0xa442('0x3'),_0xa442('0x3'),'ANSWERED',_0xa442('0x5'),_0xa442('0x4'),_0xa442('0x4'),_0xa442('0x4')];var channels={};function writeDB(_0x4f9ab0){var _0x493070;if(transfers[_0xa442('0x6')][_0x4f9ab0[_0xa442('0x7')]]){_0x493070=_0x4f9ab0['uniqueid'];_0x4f9ab0[_0xa442('0x7')]=transfers['blinds'][_0x4f9ab0[_0xa442('0x7')]]['transfereeuniqueid'];}utils['info'](util[_0xa442('0x8')](_0xa442('0x9'),_0x4f9ab0[_0xa442('0x7')],_0x4f9ab0['channel'],_0x4f9ab0['queue'],_0x4f9ab0['membername'],_0x4f9ab0[_0xa442('0xa')],_0x4f9ab0[_0xa442('0xb')],_0x4f9ab0[_0xa442('0xc')],_0x4f9ab0[_0xa442('0xd')]));if(_0x4f9ab0[_0xa442('0xe')]){utils[_0xa442('0xf')](_0x4f9ab0[_0xa442('0xe')])[_0xa442('0x10')](function(_0x92cce9){if(_0x92cce9){_0x4f9ab0['UserId']=_0x92cce9['id'];}utils['request'](_0xa442('0x11'),_0x4f9ab0);});}else{utils[_0xa442('0x12')](_0xa442('0x11'),_0x4f9ab0);}if(channels[_0x4f9ab0[_0xa442('0x7')]]){delete channels[_0x4f9ab0['uniqueid']];}else if(_0x493070&&channels[_0x493070]){delete transfers[_0xa442('0x6')][_0x493070];delete channels[_0x493070];}}exports['newchannel']=function(_0x2384e8){try{utils['debug'](util['format'](_0xa442('0x13'),_0x2384e8[_0xa442('0x7')]),_0x2384e8);if(_0x2384e8[_0xa442('0x7')]==_0x2384e8[_0xa442('0x14')]&&_0x2384e8[_0xa442('0x15')]!=_0xa442('0x16')){utils[_0xa442('0x17')](util[_0xa442('0x8')]('[%s][calls][newchannel]\x20context:%s\x20exten:%s',_0x2384e8[_0xa442('0x7')],_0x2384e8[_0xa442('0x18')],_0x2384e8[_0xa442('0x19')]));channels[_0x2384e8[_0xa442('0x7')]]={'uniqueid':_0x2384e8[_0xa442('0x7')],'accountcode':_0x2384e8['accountcode'],'source':_0x2384e8[_0xa442('0xb')],'destination':_0x2384e8[_0xa442('0x19')],'destinationcontext':_0x2384e8['context'],'channel':_0x2384e8[_0xa442('0x15')],'starttime':utils['now'](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':_0xa442('0x3'),'amaflags':'DOCUMENTATION'};}}catch(_0x9190dc){utils[_0xa442('0x1a')](util[_0xa442('0x8')](_0xa442('0x13'),_0x2384e8[_0xa442('0x7')]),_0x9190dc);}};exports[_0xa442('0x1b')]=function(_0x10bcbc){try{utils[_0xa442('0x1c')](util[_0xa442('0x8')]('[%s][calls][newstate]',_0x10bcbc[_0xa442('0x7')]),_0x10bcbc);if(!_[_0xa442('0x1d')](channels[_0x10bcbc[_0xa442('0x7')]])&&_0x10bcbc['channelstate']==0x6){utils[_0xa442('0x17')](util[_0xa442('0x8')](_0xa442('0x1e'),_0x10bcbc[_0xa442('0x7')],_0x10bcbc[_0xa442('0x18')],_0x10bcbc['channel']));if(_[_0xa442('0x1d')](channels[_0x10bcbc['uniqueid']][_0xa442('0x1f')])){channels[_0x10bcbc['uniqueid']][_0xa442('0x1f')]=utils[_0xa442('0x20')]();}}else if(!_['isNil'](channels[_0x10bcbc[_0xa442('0x14')]])&&_0x10bcbc[_0xa442('0x21')]==0x6&&_0x10bcbc[_0xa442('0x18')]!=_0xa442('0x22')){utils[_0xa442('0x17')](util[_0xa442('0x8')](_0xa442('0x23'),_0x10bcbc[_0xa442('0x7')],_0x10bcbc[_0xa442('0x14')],_0x10bcbc['context'],_0x10bcbc['channel']));channels[_0x10bcbc['linkedid']]['accountcode']=_0x10bcbc[_0xa442('0xe')];channels[_0x10bcbc[_0xa442('0x14')]][_0xa442('0x24')]=_0x10bcbc[_0xa442('0x15')];if(_['isNil'](channels[_0x10bcbc[_0xa442('0x14')]]['answertime'])){channels[_0x10bcbc[_0xa442('0x14')]][_0xa442('0x25')]=utils['now']();}channels[_0x10bcbc[_0xa442('0x14')]][_0xa442('0x26')]=dispositions[_['toNumber'](_0x10bcbc[_0xa442('0x21')])]||_0xa442('0x27');}}catch(_0xfc9d66){utils[_0xa442('0x1a')](util[_0xa442('0x8')](_0xa442('0x28'),_0x10bcbc[_0xa442('0x7')]),_0xfc9d66);}};exports[_0xa442('0x29')]=function(_0x4ccde6){try{if(!_['isNil'](channels[_0x4ccde6[_0xa442('0x7')]])){utils['debug'](util[_0xa442('0x8')](_0xa442('0x2a'),_0x4ccde6[_0xa442('0x7')]),_0x4ccde6);if(_[_0xa442('0x1d')](channels[_0x4ccde6[_0xa442('0x7')]][_0xa442('0x2b')])){channels[_0x4ccde6['uniqueid']][_0xa442('0x2b')]=_0x4ccde6['calleridname']+'\x20<'+_0x4ccde6['calleridnum']+'>';}utils[_0xa442('0x17')](util[_0xa442('0x8')](_0xa442('0x2c'),_0x4ccde6['uniqueid'],channels[_0x4ccde6[_0xa442('0x7')]]['callerid'],_0x4ccde6[_0xa442('0x2d')]));channels[_0x4ccde6[_0xa442('0x7')]]['endtime']=utils['now']();channels[_0x4ccde6['uniqueid']][_0xa442('0x2e')]=utils[_0xa442('0x2f')](channels[_0x4ccde6['uniqueid']]['endtime'],channels[_0x4ccde6[_0xa442('0x7')]]['starttime']);channels[_0x4ccde6[_0xa442('0x7')]][_0xa442('0x30')]=channels[_0x4ccde6['uniqueid']][_0xa442('0x25')]?utils[_0xa442('0x2f')](channels[_0x4ccde6[_0xa442('0x7')]][_0xa442('0x31')],channels[_0x4ccde6[_0xa442('0x7')]][_0xa442('0x25')]):0x0;writeDB(channels[_0x4ccde6[_0xa442('0x7')]]);}}catch(_0x852552){utils['error'](util[_0xa442('0x8')](_0xa442('0x2a'),_0x4ccde6[_0xa442('0x7')]),_0x852552);}};exports[_0xa442('0x32')]=function(_0x2f0a9c){try{if(!_[_0xa442('0x1d')](channels[_0x2f0a9c['localtwolinkedid']])){utils['debug'](util[_0xa442('0x8')](_0xa442('0x33'),_0x2f0a9c[_0xa442('0x34')]),_0x2f0a9c);if(channels[_0x2f0a9c[_0xa442('0x35')]][_0xa442('0x15')]==_0x2f0a9c[_0xa442('0x36')]){utils[_0xa442('0x17')](util[_0xa442('0x8')]('[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s',_0x2f0a9c[_0xa442('0x34')],_0x2f0a9c['localtwolinkedid'],_0x2f0a9c[_0xa442('0x37')]));channels[_0x2f0a9c[_0xa442('0x35')]]['destinationchannel']=_0x2f0a9c[_0xa442('0x37')];channels[_0x2f0a9c[_0xa442('0x35')]][_0xa442('0x38')]=_0xa442('0x39');}else if(channels[_0x2f0a9c['localtwolinkedid']][_0xa442('0x15')]=_0x2f0a9c[_0xa442('0x3a')]){utils[_0xa442('0x17')](util[_0xa442('0x8')](_0xa442('0x3b'),_0x2f0a9c[_0xa442('0x34')],_0x2f0a9c[_0xa442('0x35')],_0x2f0a9c[_0xa442('0x3c')]));channels[_0x2f0a9c[_0xa442('0x35')]]['destinationchannel']=_0x2f0a9c[_0xa442('0x3c')];channels[_0x2f0a9c[_0xa442('0x35')]][_0xa442('0x38')]=_0xa442('0x39');}}}catch(_0x591880){utils[_0xa442('0x1a')](util[_0xa442('0x8')](_0xa442('0x33'),_0x2f0a9c[_0xa442('0x34')]),_0x591880);}};exports['musiconholdstart']=function(_0x404b86){try{if(!_[_0xa442('0x1d')](channels[_0x404b86['uniqueid']])){utils[_0xa442('0x1c')](util[_0xa442('0x8')](_0xa442('0x3d'),_0x404b86[_0xa442('0x7')]),_0x404b86);channels[_0x404b86[_0xa442('0x7')]][_0xa442('0x3e')]=utils[_0xa442('0x20')]();utils[_0xa442('0x17')](util[_0xa442('0x8')]('[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s',_0x404b86['uniqueid'],channels[_0x404b86['uniqueid']][_0xa442('0x3e')]));}}catch(_0x5428a2){utils[_0xa442('0x1a')](util[_0xa442('0x8')](_0xa442('0x3d'),_0x404b86[_0xa442('0x7')]),_0x5428a2);}};exports[_0xa442('0x3f')]=function(_0x301678){try{if(!_[_0xa442('0x1d')](channels[_0x301678[_0xa442('0x7')]])){utils['debug'](util[_0xa442('0x8')]('[%s][calls][musiconholdstop]',_0x301678[_0xa442('0x7')]),_0x301678);if(!_[_0xa442('0x1d')](channels[_0x301678[_0xa442('0x7')]][_0xa442('0x3e')])){channels[_0x301678['uniqueid']][_0xa442('0x40')]+=utils[_0xa442('0x2f')](utils['now'](),channels[_0x301678['uniqueid']]['musiconholdstartAt']);utils['info'](util[_0xa442('0x8')]('[%s][calls][musiconholdstop]\x20mohtime:%s',_0x301678[_0xa442('0x7')],channels[_0x301678[_0xa442('0x7')]]['mohtime']));delete channels[_0x301678[_0xa442('0x7')]][_0xa442('0x3e')];}}}catch(_0x2333e5){utils[_0xa442('0x1a')](util[_0xa442('0x8')](_0xa442('0x41'),_0x301678[_0xa442('0x7')]),_0x2333e5);}};exports[_0xa442('0x42')]=function(_0x2879fe){try{if(!_[_0xa442('0x1d')](channels[_0x2879fe[_0xa442('0x7')]])){utils[_0xa442('0x1c')](util['format'](_0xa442('0x43'),_0x2879fe[_0xa442('0x7')]),_0x2879fe);if(!_[_0xa442('0x1d')](_0x2879fe[_0xa442('0x44')][_0xa442('0x45')])){utils[_0xa442('0x17')](util[_0xa442('0x8')]('[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s',_0x2879fe['uniqueid'],_0x2879fe[_0xa442('0x46')]));channels[_0x2879fe[_0xa442('0x7')]][_0xa442('0x47')]=_0x2879fe[_0xa442('0x46')];}if(!_[_0xa442('0x1d')](_0x2879fe[_0xa442('0x44')][_0xa442('0x48')])){utils[_0xa442('0x17')](util[_0xa442('0x8')](_0xa442('0x49'),_0x2879fe[_0xa442('0x7')],_0x2879fe[_0xa442('0x46')]));channels[_0x2879fe[_0xa442('0x7')]][_0xa442('0x4a')]=_0x2879fe['value'];channels[_0x2879fe['uniqueid']][_0xa442('0x2b')]='\x22'+_0x2879fe[_0xa442('0x46')]+'\x22\x20<'+_0x2879fe[_0xa442('0x46')]+'>';}if(!_[_0xa442('0x1d')](_0x2879fe[_0xa442('0x44')]['xmd-callerid-preview'])||!_['isNil'](_0x2879fe[_0xa442('0x44')][_0xa442('0x4b')])){utils[_0xa442('0x17')](util[_0xa442('0x8')](_0xa442('0x4c'),_0x2879fe[_0xa442('0x7')],!_[_0xa442('0x1d')](_0x2879fe[_0xa442('0x44')][_0xa442('0x4d')])?_0xa442('0x4d'):'xmd-callerid',_0x2879fe['value']));channels[_0x2879fe['uniqueid']][_0xa442('0x2b')]=_0x2879fe[_0xa442('0x46')];}if(!_[_0xa442('0x1d')](_0x2879fe[_0xa442('0x44')][_0xa442('0x4e')])||!_[_0xa442('0x1d')](_0x2879fe[_0xa442('0x44')][_0xa442('0x4f')])){utils[_0xa442('0x17')](util['format'](_0xa442('0x4c'),_0x2879fe[_0xa442('0x7')],!_['isNil'](_0x2879fe[_0xa442('0x44')][_0xa442('0x4e')])?_0xa442('0x4e'):_0xa442('0x4f'),_0x2879fe['value']));channels[_0x2879fe[_0xa442('0x7')]][_0xa442('0x50')]=_0xa442('0x51');channels[_0x2879fe[_0xa442('0x7')]][_0xa442('0x52')]=_0x2879fe['value'];channels[_0x2879fe['uniqueid']][_0xa442('0x53')]=!![];}if(!_[_0xa442('0x1d')](_0x2879fe[_0xa442('0x44')]['xmd-contactid'])){utils['info'](util['format'](_0xa442('0x54'),_0x2879fe['uniqueid'],_0x2879fe[_0xa442('0x46')]));channels[_0x2879fe[_0xa442('0x7')]][_0xa442('0x55')]=_0x2879fe[_0xa442('0x46')];}if(!_[_0xa442('0x1d')](_0x2879fe[_0xa442('0x44')][_0xa442('0x56')])){utils['info'](util[_0xa442('0x8')]('[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s',_0x2879fe[_0xa442('0x7')],_0x2879fe['value']));channels[_0x2879fe['uniqueid']]['type']=_0x2879fe['value'];}if(!_[_0xa442('0x1d')](_0x2879fe[_0xa442('0x44')][_0xa442('0x57')])){utils['info'](util['format'](_0xa442('0x58'),_0x2879fe['uniqueid'],_0x2879fe['value']));channels[_0x2879fe[_0xa442('0x7')]][_0xa442('0x59')]=_0x2879fe[_0xa442('0x46')];}if(!_[_0xa442('0x1d')](_0x2879fe[_0xa442('0x44')][_0xa442('0x5a')])){utils['info'](util['format'](_0xa442('0x5b'),_0x2879fe['uniqueid'],_0x2879fe[_0xa442('0x46')]));channels[_0x2879fe[_0xa442('0x7')]][_0xa442('0x5a')]=_0x2879fe[_0xa442('0x46')];}}}catch(_0x10fa6e){utils['error'](util[_0xa442('0x8')](_0xa442('0x43'),_0x2879fe[_0xa442('0x7')]),_0x10fa6e);}};exports[_0xa442('0x5c')]=function(_0x497f25){try{if(!_['isNil'](channels[_0x497f25['uniqueid']])){utils[_0xa442('0x1c')](util[_0xa442('0x8')]('[%s][calls][newexten]',_0x497f25['uniqueid']),_0x497f25);utils[_0xa442('0x17')](util[_0xa442('0x8')](_0xa442('0x5d'),_0x497f25[_0xa442('0x7')],_0x497f25[_0xa442('0x5e')],_0x497f25[_0xa442('0x5f')]));if(_0x497f25[_0xa442('0x5e')][_0xa442('0x60')]()=='set'&&_[_0xa442('0x61')](_0x497f25[_0xa442('0x5f')][_0xa442('0x60')](),'cdr')){var _0x4aaffd=_0x497f25[_0xa442('0x5f')][_0xa442('0x62')]('=');var _0x24b4c5=_0x4aaffd[0x0][_0xa442('0x63')](_0x4aaffd[0x0]['lastIndexOf']('(')+0x1,_0x4aaffd[0x0][_0xa442('0x64')](')'));var _0x8681f0=_0x4aaffd[0x1];channels[_0x497f25[_0xa442('0x7')]][_0x24b4c5]=_0x8681f0;}if(!_[_0xa442('0x65')]([_0xa442('0x29'),_0xa442('0x66'),'execif',_0xa442('0x67'),_0xa442('0x68')],_0x497f25[_0xa442('0x5e')][_0xa442('0x60')]())){channels[_0x497f25[_0xa442('0x7')]][_0xa442('0x50')]=_0x497f25[_0xa442('0x5e')];channels[_0x497f25[_0xa442('0x7')]][_0xa442('0x52')]=_0x497f25[_0xa442('0x5f')];}}}catch(_0x204945){utils['error'](util['format'](_0xa442('0x69'),_0x497f25[_0xa442('0x7')]),_0x204945);}}; \ No newline at end of file diff --git a/server/services/xdr/core.controller.js b/server/services/xdr/core.controller.js index cc3ef80..8671b43 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 _0xbf6b=['shutdown','[core]\x20shutdown','fullybooted','[core]\x20fullybooted','error','[core]\x20error','close','[core]\x20close','managerevent','./utils','connect','info','[core]\x20connected'];(function(_0x5c020d,_0x3821f1){var _0xa4b779=function(_0x31264e){while(--_0x31264e){_0x5c020d['push'](_0x5c020d['shift']());}};_0xa4b779(++_0x3821f1);}(_0xbf6b,0x168));var _0xbbf6=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0xbf6b[_0x4a9fb1];return _0x348672;};'use strict';var utils=require(_0xbbf6('0x0'));exports[_0xbbf6('0x1')]=function(){utils[_0xbbf6('0x2')](_0xbbf6('0x3'));};exports[_0xbbf6('0x4')]=function(){utils['info'](_0xbbf6('0x5'));};exports[_0xbbf6('0x6')]=function(){utils[_0xbbf6('0x2')](_0xbbf6('0x7'));};exports[_0xbbf6('0x8')]=function(_0x1e9664){utils[_0xbbf6('0x8')](_0xbbf6('0x9'),_0x1e9664);};exports[_0xbbf6('0xa')]=function(){utils[_0xbbf6('0x2')](_0xbbf6('0xb'));};exports[_0xbbf6('0xc')]=function(_0x4ccdbc){}; \ No newline at end of file +var _0x70fd=['info','[core]\x20connected','fullybooted','error','[core]\x20close','./utils','connect'];(function(_0x2cdb10,_0x58ce30){var _0x213e93=function(_0x40d0f4){while(--_0x40d0f4){_0x2cdb10['push'](_0x2cdb10['shift']());}};_0x213e93(++_0x58ce30);}(_0x70fd,0x16a));var _0xd70f=function(_0x942eca,_0x1d0181){_0x942eca=_0x942eca-0x0;var _0x589c16=_0x70fd[_0x942eca];return _0x589c16;};'use strict';var utils=require(_0xd70f('0x0'));exports[_0xd70f('0x1')]=function(){utils[_0xd70f('0x2')](_0xd70f('0x3'));};exports['shutdown']=function(){utils['info']('[core]\x20shutdown');};exports[_0xd70f('0x4')]=function(){utils[_0xd70f('0x2')]('[core]\x20fullybooted');};exports['error']=function(_0x7da2cf){utils[_0xd70f('0x5')]('[core]\x20error',_0x7da2cf);};exports['close']=function(){utils[_0xd70f('0x2')](_0xd70f('0x6'));};exports['managerevent']=function(_0x44745a){}; \ No newline at end of file diff --git a/server/services/xdr/dials.controller.js b/server/services/xdr/dials.controller.js index 8a7c1da..b1a544c 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 _0x7e60=['[%s][dials][newexten]\x20application:%s\x20appdata:%s','application','appdata','toLowerCase','set','startsWith','cdr(routeid)','isNil','variable','outboundrouteid','[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s','value','error','[%s][dials][dialbegin]','assign','starttime','now','called','[%s][dials][hangup]\x20starttime:%s\x20lastevent:called','dialend','[%s][dials][dialend]','ANSWER','answertime','lastevent','connect','[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect','hangup','[%s][dials][hangup]','[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s','calleridnum','cause-txt','complete','duration','diffTime','endtime','holdtime','lodash','util','info','format','[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s','uniqueid','channel','dialstring','connectedlinenum','dialstatus','request','CreateVoiceDialReport','newexten','debug','[%s][dials][newexten]'];(function(_0x41c0cf,_0x1a2c6a){var _0x320636=function(_0x1c70db){while(--_0x1c70db){_0x41c0cf['push'](_0x41c0cf['shift']());}};_0x320636(++_0x1a2c6a);}(_0x7e60,0xf0));var _0x07e6=function(_0x536c8,_0x4cea7){_0x536c8=_0x536c8-0x0;var _0x38d500=_0x7e60[_0x536c8];return _0x38d500;};'use strict';var _=require(_0x07e6('0x0'));var util=require(_0x07e6('0x1'));var utils=require('./utils');var dials={};function writeDB(_0x5b20c8){utils[_0x07e6('0x2')](util[_0x07e6('0x3')](_0x07e6('0x4'),_0x5b20c8[_0x07e6('0x5')],_0x5b20c8[_0x07e6('0x6')],_0x5b20c8[_0x07e6('0x7')],_0x5b20c8['calleridnum'],_0x5b20c8[_0x07e6('0x8')],_0x5b20c8[_0x07e6('0x9')]));utils[_0x07e6('0xa')](_0x07e6('0xb'),_0x5b20c8);delete dials[_0x5b20c8[_0x07e6('0x5')]];}exports[_0x07e6('0xc')]=function(_0x3dd6f3){try{utils[_0x07e6('0xd')](util[_0x07e6('0x3')](_0x07e6('0xe'),_0x3dd6f3[_0x07e6('0x5')]),_0x3dd6f3);utils[_0x07e6('0x2')](util[_0x07e6('0x3')](_0x07e6('0xf'),_0x3dd6f3[_0x07e6('0x5')],_0x3dd6f3[_0x07e6('0x10')],_0x3dd6f3[_0x07e6('0x11')]));if(_0x3dd6f3[_0x07e6('0x10')][_0x07e6('0x12')]()==_0x07e6('0x13')&&_[_0x07e6('0x14')](_0x3dd6f3[_0x07e6('0x11')][_0x07e6('0x12')](),_0x07e6('0x15'))){var _0x342440=_0x3dd6f3[_0x07e6('0x11')]['split']('=');dials[_0x3dd6f3[_0x07e6('0x5')]]={'routeId':_0x342440[0x1]};}}catch(_0x46edc3){utils['error'](util['format'](_0x07e6('0xe'),_0x3dd6f3['uniqueid']),_0x46edc3);}};exports['varset']=function(_0x5ca2f1){try{utils[_0x07e6('0xd')](util[_0x07e6('0x3')]('[%s][dials][varset]',_0x5ca2f1[_0x07e6('0x5')]),_0x5ca2f1);if(!_[_0x07e6('0x16')](_0x5ca2f1[_0x07e6('0x17')][_0x07e6('0x18')])){utils['info'](util['format'](_0x07e6('0x19'),_0x5ca2f1[_0x07e6('0x5')],_0x5ca2f1[_0x07e6('0x1a')]));dials[_0x5ca2f1[_0x07e6('0x5')]]={'routeId':_0x5ca2f1[_0x07e6('0x1a')]};}}catch(_0x496fc0){utils[_0x07e6('0x1b')](util[_0x07e6('0x3')]('[%s][dials][varset]',_0x5ca2f1[_0x07e6('0x5')]),_0x496fc0);}};exports['dialbegin']=function(_0x55d916){try{if(!_['isNil'](dials[_0x55d916[_0x07e6('0x5')]])){utils[_0x07e6('0xd')](util[_0x07e6('0x3')](_0x07e6('0x1c'),_0x55d916[_0x07e6('0x5')]),_0x55d916);dials[_0x55d916[_0x07e6('0x5')]]=_[_0x07e6('0x1d')](dials[_0x55d916[_0x07e6('0x5')]],_0x55d916);dials[_0x55d916[_0x07e6('0x5')]][_0x07e6('0x1e')]=utils[_0x07e6('0x1f')]();dials[_0x55d916[_0x07e6('0x5')]]['lastevent']=_0x07e6('0x20');utils[_0x07e6('0x2')](util[_0x07e6('0x3')](_0x07e6('0x21'),_0x55d916[_0x07e6('0x5')],dials[_0x55d916['uniqueid']][_0x07e6('0x1e')]));}}catch(_0x37e0f6){utils[_0x07e6('0x1b')](util[_0x07e6('0x3')]('[%s][dials][dialbegin]',_0x55d916['uniqueid']),_0x37e0f6);}};exports[_0x07e6('0x22')]=function(_0x5cb574){try{if(!_[_0x07e6('0x16')](dials[_0x5cb574[_0x07e6('0x5')]])){utils[_0x07e6('0xd')](util[_0x07e6('0x3')](_0x07e6('0x23'),_0x5cb574[_0x07e6('0x5')]),_0x5cb574);dials[_0x5cb574[_0x07e6('0x5')]][_0x07e6('0x9')]=_0x5cb574[_0x07e6('0x9')];if(_0x5cb574[_0x07e6('0x9')]==_0x07e6('0x24')){dials[_0x5cb574[_0x07e6('0x5')]]=_[_0x07e6('0x1d')](dials[_0x5cb574['uniqueid']],_0x5cb574);dials[_0x5cb574[_0x07e6('0x5')]][_0x07e6('0x25')]=utils[_0x07e6('0x1f')]();dials[_0x5cb574[_0x07e6('0x5')]][_0x07e6('0x26')]=_0x07e6('0x27');utils[_0x07e6('0x2')](util['format'](_0x07e6('0x28'),_0x5cb574['uniqueid'],_0x5cb574[_0x07e6('0x9')],dials[_0x5cb574[_0x07e6('0x5')]]['answertime']));}else{utils[_0x07e6('0x2')](util[_0x07e6('0x3')]('[%s][dials][dialend]\x20dialstatus:%s',_0x5cb574['uniqueid'],_0x5cb574[_0x07e6('0x9')]));}}}catch(_0x5ed949){utils['error'](util[_0x07e6('0x3')]('[%s][dials][dialend]',_0x5cb574[_0x07e6('0x5')]),_0x5ed949);}};exports[_0x07e6('0x29')]=function(_0x3d1daa){try{if(!_['isNil'](dials[_0x3d1daa[_0x07e6('0x5')]])){utils[_0x07e6('0xd')](util[_0x07e6('0x3')](_0x07e6('0x2a'),_0x3d1daa[_0x07e6('0x5')]),_0x3d1daa);utils[_0x07e6('0x2')](util['format'](_0x07e6('0x2b'),_0x3d1daa[_0x07e6('0x5')],_0x3d1daa[_0x07e6('0x2c')],_0x3d1daa['calleridname'],_0x3d1daa[_0x07e6('0x2d')]));dials[_0x3d1daa['uniqueid']]=_[_0x07e6('0x1d')](dials[_0x3d1daa[_0x07e6('0x5')]],{'endtime':utils[_0x07e6('0x1f')](),'lastevent':_0x07e6('0x2e')});dials[_0x3d1daa[_0x07e6('0x5')]][_0x07e6('0x2f')]=utils[_0x07e6('0x30')](dials[_0x3d1daa[_0x07e6('0x5')]][_0x07e6('0x31')],dials[_0x3d1daa['uniqueid']][_0x07e6('0x1e')]);dials[_0x3d1daa[_0x07e6('0x5')]][_0x07e6('0x32')]=utils[_0x07e6('0x30')](dials[_0x3d1daa['uniqueid']]['answertime']||dials[_0x3d1daa[_0x07e6('0x5')]][_0x07e6('0x31')],dials[_0x3d1daa[_0x07e6('0x5')]][_0x07e6('0x1e')]);dials[_0x3d1daa[_0x07e6('0x5')]]['billableseconds']=dials[_0x3d1daa['uniqueid']][_0x07e6('0x25')]?utils[_0x07e6('0x30')](dials[_0x3d1daa[_0x07e6('0x5')]][_0x07e6('0x31')],dials[_0x3d1daa[_0x07e6('0x5')]][_0x07e6('0x25')]):0x0;writeDB(dials[_0x3d1daa[_0x07e6('0x5')]]);}}catch(_0xf0dca0){utils[_0x07e6('0x1b')](util[_0x07e6('0x3')]('[%s][dials][hangup]',_0x3d1daa[_0x07e6('0x5')]),_0xf0dca0);}}; \ No newline at end of file +var _0x5b19=['lodash','./utils','info','format','uniqueid','dialstring','calleridnum','connectedlinenum','dialstatus','request','CreateVoiceDialReport','newexten','debug','[%s][dials][newexten]','[%s][dials][newexten]\x20application:%s\x20appdata:%s','application','appdata','toLowerCase','set','cdr(routeid)','split','error','varset','variable','outboundrouteid','[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s','value','[%s][dials][varset]','dialbegin','isNil','[%s][dials][dialbegin]','assign','starttime','lastevent','[%s][dials][hangup]\x20starttime:%s\x20lastevent:called','dialend','[%s][dials][dialend]','now','connect','[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect','answertime','[%s][dials][dialend]\x20dialstatus:%s','hangup','[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s','diffTime','endtime','holdtime','[%s][dials][hangup]'];(function(_0x172b7a,_0xead108){var _0x42c484=function(_0x3ff909){while(--_0x3ff909){_0x172b7a['push'](_0x172b7a['shift']());}};_0x42c484(++_0xead108);}(_0x5b19,0x120));var _0x95b1=function(_0x3a45db,_0x571848){_0x3a45db=_0x3a45db-0x0;var _0x4ec9d4=_0x5b19[_0x3a45db];return _0x4ec9d4;};'use strict';var _=require(_0x95b1('0x0'));var util=require('util');var utils=require(_0x95b1('0x1'));var dials={};function writeDB(_0x233257){utils[_0x95b1('0x2')](util[_0x95b1('0x3')]('[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s',_0x233257[_0x95b1('0x4')],_0x233257['channel'],_0x233257[_0x95b1('0x5')],_0x233257[_0x95b1('0x6')],_0x233257[_0x95b1('0x7')],_0x233257[_0x95b1('0x8')]));utils[_0x95b1('0x9')](_0x95b1('0xa'),_0x233257);delete dials[_0x233257[_0x95b1('0x4')]];}exports[_0x95b1('0xb')]=function(_0x3577eb){try{utils[_0x95b1('0xc')](util['format'](_0x95b1('0xd'),_0x3577eb[_0x95b1('0x4')]),_0x3577eb);utils['info'](util[_0x95b1('0x3')](_0x95b1('0xe'),_0x3577eb['uniqueid'],_0x3577eb[_0x95b1('0xf')],_0x3577eb[_0x95b1('0x10')]));if(_0x3577eb[_0x95b1('0xf')][_0x95b1('0x11')]()==_0x95b1('0x12')&&_['startsWith'](_0x3577eb[_0x95b1('0x10')]['toLowerCase'](),_0x95b1('0x13'))){var _0x5a697b=_0x3577eb[_0x95b1('0x10')][_0x95b1('0x14')]('=');dials[_0x3577eb['uniqueid']]={'routeId':_0x5a697b[0x1]};}}catch(_0x3074d4){utils[_0x95b1('0x15')](util['format'](_0x95b1('0xd'),_0x3577eb[_0x95b1('0x4')]),_0x3074d4);}};exports[_0x95b1('0x16')]=function(_0x2fbad9){try{utils[_0x95b1('0xc')](util[_0x95b1('0x3')]('[%s][dials][varset]',_0x2fbad9['uniqueid']),_0x2fbad9);if(!_['isNil'](_0x2fbad9[_0x95b1('0x17')][_0x95b1('0x18')])){utils['info'](util[_0x95b1('0x3')](_0x95b1('0x19'),_0x2fbad9['uniqueid'],_0x2fbad9[_0x95b1('0x1a')]));dials[_0x2fbad9[_0x95b1('0x4')]]={'routeId':_0x2fbad9[_0x95b1('0x1a')]};}}catch(_0x5ebbe3){utils[_0x95b1('0x15')](util['format'](_0x95b1('0x1b'),_0x2fbad9[_0x95b1('0x4')]),_0x5ebbe3);}};exports[_0x95b1('0x1c')]=function(_0x3bd3ad){try{if(!_[_0x95b1('0x1d')](dials[_0x3bd3ad[_0x95b1('0x4')]])){utils[_0x95b1('0xc')](util[_0x95b1('0x3')](_0x95b1('0x1e'),_0x3bd3ad[_0x95b1('0x4')]),_0x3bd3ad);dials[_0x3bd3ad[_0x95b1('0x4')]]=_[_0x95b1('0x1f')](dials[_0x3bd3ad[_0x95b1('0x4')]],_0x3bd3ad);dials[_0x3bd3ad['uniqueid']][_0x95b1('0x20')]=utils['now']();dials[_0x3bd3ad[_0x95b1('0x4')]][_0x95b1('0x21')]='called';utils['info'](util[_0x95b1('0x3')](_0x95b1('0x22'),_0x3bd3ad['uniqueid'],dials[_0x3bd3ad[_0x95b1('0x4')]][_0x95b1('0x20')]));}}catch(_0xdd6d53){utils[_0x95b1('0x15')](util[_0x95b1('0x3')](_0x95b1('0x1e'),_0x3bd3ad[_0x95b1('0x4')]),_0xdd6d53);}};exports[_0x95b1('0x23')]=function(_0x21418f){try{if(!_['isNil'](dials[_0x21418f[_0x95b1('0x4')]])){utils[_0x95b1('0xc')](util[_0x95b1('0x3')](_0x95b1('0x24'),_0x21418f[_0x95b1('0x4')]),_0x21418f);dials[_0x21418f[_0x95b1('0x4')]][_0x95b1('0x8')]=_0x21418f[_0x95b1('0x8')];if(_0x21418f[_0x95b1('0x8')]=='ANSWER'){dials[_0x21418f[_0x95b1('0x4')]]=_[_0x95b1('0x1f')](dials[_0x21418f[_0x95b1('0x4')]],_0x21418f);dials[_0x21418f['uniqueid']]['answertime']=utils[_0x95b1('0x25')]();dials[_0x21418f['uniqueid']][_0x95b1('0x21')]=_0x95b1('0x26');utils[_0x95b1('0x2')](util['format'](_0x95b1('0x27'),_0x21418f[_0x95b1('0x4')],_0x21418f['dialstatus'],dials[_0x21418f[_0x95b1('0x4')]][_0x95b1('0x28')]));}else{utils[_0x95b1('0x2')](util[_0x95b1('0x3')](_0x95b1('0x29'),_0x21418f[_0x95b1('0x4')],_0x21418f[_0x95b1('0x8')]));}}}catch(_0x3add7d){utils['error'](util[_0x95b1('0x3')]('[%s][dials][dialend]',_0x21418f[_0x95b1('0x4')]),_0x3add7d);}};exports[_0x95b1('0x2a')]=function(_0x50f5ce){try{if(!_[_0x95b1('0x1d')](dials[_0x50f5ce[_0x95b1('0x4')]])){utils[_0x95b1('0xc')](util[_0x95b1('0x3')]('[%s][dials][hangup]',_0x50f5ce[_0x95b1('0x4')]),_0x50f5ce);utils['info'](util[_0x95b1('0x3')](_0x95b1('0x2b'),_0x50f5ce[_0x95b1('0x4')],_0x50f5ce['calleridnum'],_0x50f5ce['calleridname'],_0x50f5ce['cause-txt']));dials[_0x50f5ce[_0x95b1('0x4')]]=_['assign'](dials[_0x50f5ce['uniqueid']],{'endtime':utils[_0x95b1('0x25')](),'lastevent':'complete'});dials[_0x50f5ce[_0x95b1('0x4')]]['duration']=utils[_0x95b1('0x2c')](dials[_0x50f5ce['uniqueid']][_0x95b1('0x2d')],dials[_0x50f5ce[_0x95b1('0x4')]][_0x95b1('0x20')]);dials[_0x50f5ce[_0x95b1('0x4')]][_0x95b1('0x2e')]=utils['diffTime'](dials[_0x50f5ce[_0x95b1('0x4')]][_0x95b1('0x28')]||dials[_0x50f5ce['uniqueid']][_0x95b1('0x2d')],dials[_0x50f5ce[_0x95b1('0x4')]][_0x95b1('0x20')]);dials[_0x50f5ce[_0x95b1('0x4')]]['billableseconds']=dials[_0x50f5ce[_0x95b1('0x4')]][_0x95b1('0x28')]?utils['diffTime'](dials[_0x50f5ce[_0x95b1('0x4')]]['endtime'],dials[_0x50f5ce[_0x95b1('0x4')]][_0x95b1('0x28')]):0x0;writeDB(dials[_0x50f5ce[_0x95b1('0x4')]]);}}catch(_0x558541){utils[_0x95b1('0x15')](util['format'](_0x95b1('0x2f'),_0x50f5ce[_0x95b1('0x4')]),_0x558541);}}; \ No newline at end of file diff --git a/server/services/xdr/index.js b/server/services/xdr/index.js index 26610e7..75ddf00 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 _0xd058=['[%s][index][newstate]','hangup','[%s][index][hangup]','cdr','[%s][index][cdr]','blindtransfer','[%s][index][blindtransfer]','attendedtransfer','[%s][index][attendedtransfer]','origtransfereruniqueid','varset','[%s][index][varset]','[%s][index][newexten]','newexten','newchannel','[%s][index][newchannel]','[%s][index][dialbegin]','dialbegin','[%s]dialbegin','dialend','[%s][index][dialend]','asterisk-manager','../../config/environment','./utils','util','asterisk','port','password','xdr','info','XDR\x20DISABLED','./agents.controller','./calls.controller','./recordings.controller','./members.controller','./dials.controller','./transfers.controller','./core.controller','connect','shutdown','fullybooted','error','close','managerevent','devicestatechange','debug','format','[%s][index][devicestatechange]','device','agentcalled','[%s][index][agentcalled]','uniqueid','agentringnoanswer','[%s][index][agentringnoanswer]','agentconnect','[%s][index][agentconnect]','[%s][index][agentcomplete]','agentcomplete','[%s][index][queuecallerabandon]','queuecallerabandon','[%s][index][queuecallerjoin]','queuecallerjoin','[%s][index][queuecallerleave]','queuecallerleave','musiconholdstart','[%s][index][musiconholdstart]','musiconholdstop','[%s][index][musiconholdstop]','newstate'];(function(_0x278757,_0x4d6e3f){var _0x1a59a7=function(_0x35d5e6){while(--_0x35d5e6){_0x278757['push'](_0x278757['shift']());}};_0x1a59a7(++_0x4d6e3f);}(_0xd058,0x16e));var _0x8d05=function(_0x528497,_0x147e87){_0x528497=_0x528497-0x0;var _0x392d59=_0xd058[_0x528497];return _0x392d59;};var AsteriskManager=require(_0x8d05('0x0'));var config=require(_0x8d05('0x1'));var utils=require(_0x8d05('0x2'));var util=require(_0x8d05('0x3'));var ami=new AsteriskManager(config[_0x8d05('0x4')][_0x8d05('0x5')],config[_0x8d05('0x4')]['ip'],config[_0x8d05('0x4')]['username'],config[_0x8d05('0x4')][_0x8d05('0x6')],!![]);ami['keepConnected']();if(config[_0x8d05('0x7')]&&config[_0x8d05('0x7')]['disabled']){utils[_0x8d05('0x8')](_0x8d05('0x9'));}else{var agents=require(_0x8d05('0xa'));var calls=require(_0x8d05('0xb'));var queues=require('./queues.controller');var recordings=require(_0x8d05('0xc'));var members=require(_0x8d05('0xd'));var dials=require(_0x8d05('0xe'));var transfers=require(_0x8d05('0xf'));var core=require(_0x8d05('0x10'));ami['on']('connect',core[_0x8d05('0x11')]);ami['on'](_0x8d05('0x12'),core[_0x8d05('0x12')]);ami['on'](_0x8d05('0x13'),core['fullybooted']);ami['on'](_0x8d05('0x14'),core[_0x8d05('0x14')]);ami['on'](_0x8d05('0x15'),core['close']);ami['on'](_0x8d05('0x16'),core[_0x8d05('0x16')]);ami['on'](_0x8d05('0x17'),function(_0x5579ee){try{utils[_0x8d05('0x18')](util[_0x8d05('0x19')](_0x8d05('0x1a'),_0x5579ee[_0x8d05('0x1b')]),_0x5579ee);members[_0x8d05('0x17')](_0x5579ee);}catch(_0xfd0d37){utils[_0x8d05('0x14')](util[_0x8d05('0x19')](_0x8d05('0x1a'),_0x5579ee[_0x8d05('0x1b')]),_0xfd0d37);}});ami['on'](_0x8d05('0x1c'),function(_0x501fb4){try{utils['debug'](util[_0x8d05('0x19')](_0x8d05('0x1d'),_0x501fb4[_0x8d05('0x1e')]),_0x501fb4);agents['agentcalled'](_0x501fb4);}catch(_0x35c7b7){utils[_0x8d05('0x14')](util[_0x8d05('0x19')](_0x8d05('0x1d'),_0x501fb4[_0x8d05('0x1e')]),_0x35c7b7);}});ami['on'](_0x8d05('0x1f'),function(_0x308150){try{utils['debug'](util['format'](_0x8d05('0x20'),_0x308150[_0x8d05('0x1e')]),_0x308150);agents[_0x8d05('0x1f')](_0x308150);}catch(_0x5bf0d4){utils[_0x8d05('0x14')](util[_0x8d05('0x19')](_0x8d05('0x20'),_0x308150[_0x8d05('0x1e')]),_0x5bf0d4);}});ami['on'](_0x8d05('0x21'),function(_0x3dacc7){try{utils[_0x8d05('0x18')](util[_0x8d05('0x19')](_0x8d05('0x22'),_0x3dacc7[_0x8d05('0x1e')]),_0x3dacc7);agents['agentconnect'](_0x3dacc7);queues['agentconnect'](_0x3dacc7);}catch(_0x28812c){utils[_0x8d05('0x14')](util['format'](_0x8d05('0x22'),_0x3dacc7['uniqueid']),_0x28812c);}});ami['on']('agentcomplete',function(_0x5f383b){try{utils['debug'](util[_0x8d05('0x19')](_0x8d05('0x23'),_0x5f383b[_0x8d05('0x1e')]),_0x5f383b);agents['agentcomplete'](_0x5f383b);queues['agentcomplete'](_0x5f383b);members[_0x8d05('0x24')](_0x5f383b);}catch(_0x51d3a9){utils[_0x8d05('0x14')](util[_0x8d05('0x19')](_0x8d05('0x23'),_0x5f383b[_0x8d05('0x1e')]),_0x51d3a9);}});ami['on']('queuecallerabandon',function(_0x4b6a06){try{utils['debug'](util[_0x8d05('0x19')](_0x8d05('0x25'),_0x4b6a06[_0x8d05('0x1e')]),_0x4b6a06);agents[_0x8d05('0x26')](_0x4b6a06);queues[_0x8d05('0x26')](_0x4b6a06);}catch(_0x2f110c){utils[_0x8d05('0x14')](util[_0x8d05('0x19')](_0x8d05('0x25'),_0x4b6a06['uniqueid']),_0x2f110c);}});ami['on']('queuecallerjoin',function(_0x4c21be){try{utils[_0x8d05('0x18')](util['format'](_0x8d05('0x27'),_0x4c21be[_0x8d05('0x1e')]),_0x4c21be);queues[_0x8d05('0x28')](_0x4c21be);recordings[_0x8d05('0x28')](_0x4c21be);}catch(_0x16f02b){utils[_0x8d05('0x14')](util[_0x8d05('0x19')](_0x8d05('0x27'),_0x4c21be[_0x8d05('0x1e')]),_0x16f02b);}});ami['on']('queuecallerleave',function(_0x361ecb){try{utils['debug'](util['format'](_0x8d05('0x29'),_0x361ecb[_0x8d05('0x1e')]),_0x361ecb);queues[_0x8d05('0x2a')](_0x361ecb);}catch(_0x2d0597){utils['error'](util['format'](_0x8d05('0x29'),_0x361ecb[_0x8d05('0x1e')]),_0x2d0597);}});ami['on'](_0x8d05('0x2b'),function(_0x3499f4){try{utils[_0x8d05('0x18')](util[_0x8d05('0x19')](_0x8d05('0x2c'),_0x3499f4[_0x8d05('0x1e')]),_0x3499f4);queues[_0x8d05('0x2b')](_0x3499f4);calls[_0x8d05('0x2b')](_0x3499f4);}catch(_0x3dabeb){utils[_0x8d05('0x14')](util[_0x8d05('0x19')]('[%s][index][musiconholdstart]',_0x3499f4[_0x8d05('0x1e')]),_0x3dabeb);}});ami['on'](_0x8d05('0x2d'),function(_0x1402dd){try{utils[_0x8d05('0x18')](util[_0x8d05('0x19')](_0x8d05('0x2e'),_0x1402dd[_0x8d05('0x1e')]),_0x1402dd);queues[_0x8d05('0x2d')](_0x1402dd);calls[_0x8d05('0x2d')](_0x1402dd);}catch(_0x5376ac){utils['error'](util[_0x8d05('0x19')](_0x8d05('0x2e'),_0x1402dd[_0x8d05('0x1e')]),_0x5376ac);}});ami['on'](_0x8d05('0x2f'),function(_0x379de7){try{utils[_0x8d05('0x18')](util[_0x8d05('0x19')]('[%s][index][newstate]',_0x379de7[_0x8d05('0x1e')]),_0x379de7);calls[_0x8d05('0x2f')](_0x379de7);recordings[_0x8d05('0x2f')](_0x379de7);}catch(_0x386bc4){utils[_0x8d05('0x14')](util[_0x8d05('0x19')](_0x8d05('0x30'),_0x379de7['uniqueid']),_0x386bc4);}});ami['on']('hangup',function(_0x36f891){try{utils['debug'](util[_0x8d05('0x19')]('[%s][index][hangup]',_0x36f891['uniqueid']),_0x36f891);calls[_0x8d05('0x31')](_0x36f891);recordings[_0x8d05('0x31')](_0x36f891);dials['hangup'](_0x36f891);agents[_0x8d05('0x31')](_0x36f891);queues[_0x8d05('0x31')](_0x36f891);}catch(_0x76fbee){utils[_0x8d05('0x14')](util[_0x8d05('0x19')](_0x8d05('0x32'),_0x36f891[_0x8d05('0x1e')]),_0x76fbee);}});ami['on'](_0x8d05('0x33'),function(_0x199001){try{utils[_0x8d05('0x18')](util['format'](_0x8d05('0x34'),_0x199001['uniqueid']),_0x199001);members[_0x8d05('0x33')](_0x199001);}catch(_0x5f3c92){utils[_0x8d05('0x14')](util[_0x8d05('0x19')](_0x8d05('0x34'),_0x199001[_0x8d05('0x1e')]),_0x5f3c92);}});ami['on'](_0x8d05('0x35'),function(_0xd450d2){try{utils[_0x8d05('0x18')](util[_0x8d05('0x19')](_0x8d05('0x36'),_0xd450d2[_0x8d05('0x1e')]),_0xd450d2);queues['blindtransfer'](_0xd450d2);agents[_0x8d05('0x35')](_0xd450d2);transfers[_0x8d05('0x35')](_0xd450d2);}catch(_0x48bb3b){utils['error'](util[_0x8d05('0x19')]('[%s][index][blindtransfer]',_0xd450d2[_0x8d05('0x1e')]),_0x48bb3b);}});ami['on'](_0x8d05('0x37'),function(_0x32ebbc){try{utils[_0x8d05('0x18')](util[_0x8d05('0x19')](_0x8d05('0x38'),_0x32ebbc[_0x8d05('0x39')]),_0x32ebbc);queues['attendedtransfer'](_0x32ebbc);transfers[_0x8d05('0x37')](_0x32ebbc);agents['attendedtransfer'](_0x32ebbc);calls[_0x8d05('0x37')](_0x32ebbc);}catch(_0x2a2834){utils[_0x8d05('0x14')](util[_0x8d05('0x19')](_0x8d05('0x38'),_0x32ebbc[_0x8d05('0x39')]),_0x2a2834);}});ami['on'](_0x8d05('0x3a'),function(_0x2bf74){try{utils[_0x8d05('0x18')](util[_0x8d05('0x19')](_0x8d05('0x3b'),_0x2bf74[_0x8d05('0x1e')]),_0x2bf74);queues[_0x8d05('0x3a')](_0x2bf74);recordings['varset'](_0x2bf74);calls[_0x8d05('0x3a')](_0x2bf74);dials[_0x8d05('0x3a')](_0x2bf74);}catch(_0x32fc60){utils[_0x8d05('0x14')](util['format'](_0x8d05('0x3b'),_0x2bf74[_0x8d05('0x1e')]),_0x32fc60);}});ami['on']('newexten',function(_0x57de32){try{utils['debug'](util['format'](_0x8d05('0x3c'),_0x57de32[_0x8d05('0x1e')]),_0x57de32);calls['newexten'](_0x57de32);recordings[_0x8d05('0x3d')](_0x57de32);dials['newexten'](_0x57de32);}catch(_0x1cf9fe){utils[_0x8d05('0x14')](util[_0x8d05('0x19')](_0x8d05('0x3c'),_0x57de32[_0x8d05('0x1e')]),_0x1cf9fe);}});ami['on'](_0x8d05('0x3e'),function(_0x28c345){try{utils[_0x8d05('0x18')](util[_0x8d05('0x19')](_0x8d05('0x3f'),_0x28c345[_0x8d05('0x1e')]),_0x28c345);calls[_0x8d05('0x3e')](_0x28c345);recordings[_0x8d05('0x3e')](_0x28c345);}catch(_0x339b49){utils['error'](util[_0x8d05('0x19')](_0x8d05('0x3f'),_0x28c345['uniqueid']),_0x339b49);}});ami['on']('dialbegin',function(_0xe1a8a0){try{utils[_0x8d05('0x18')](util[_0x8d05('0x19')](_0x8d05('0x40'),_0xe1a8a0['uniqueid']),_0xe1a8a0);dials[_0x8d05('0x41')](_0xe1a8a0);}catch(_0x38ab45){utils['error'](util[_0x8d05('0x19')](_0x8d05('0x42'),_0xe1a8a0[_0x8d05('0x1e')]),_0x38ab45);}});ami['on'](_0x8d05('0x43'),function(_0x2ee481){try{utils[_0x8d05('0x18')](util[_0x8d05('0x19')](_0x8d05('0x44'),_0x2ee481[_0x8d05('0x1e')]),_0x2ee481);dials[_0x8d05('0x43')](_0x2ee481);}catch(_0x209a5f){utils[_0x8d05('0x14')](util[_0x8d05('0x19')](_0x8d05('0x44'),_0x2ee481[_0x8d05('0x1e')]),_0x209a5f);}});} \ No newline at end of file +var _0xa2da=['./utils','asterisk','port','username','password','keepConnected','xdr','disabled','info','./calls.controller','./recordings.controller','./dials.controller','./transfers.controller','./core.controller','connect','shutdown','fullybooted','error','close','managerevent','devicestatechange','debug','[%s][index][devicestatechange]','device','format','agentcalled','[%s][index][agentcalled]','uniqueid','agentringnoanswer','[%s][index][agentringnoanswer]','[%s][index][agentconnect]','agentconnect','agentcomplete','[%s][index][agentcomplete]','[%s][index][queuecallerabandon]','queuecallerabandon','queuecallerjoin','[%s][index][queuecallerjoin]','queuecallerleave','[%s][index][queuecallerleave]','musiconholdstart','[%s][index][musiconholdstart]','musiconholdstop','[%s][index][musiconholdstop]','newstate','[%s][index][newstate]','[%s][index][hangup]','hangup','[%s][index][cdr]','cdr','blindtransfer','[%s][index][blindtransfer]','attendedtransfer','origtransfereruniqueid','[%s][index][attendedtransfer]','varset','[%s][index][varset]','newexten','[%s][index][newexten]','newchannel','[%s][index][newchannel]','dialbegin','[%s]dialbegin','dialend','[%s][index][dialend]','asterisk-manager'];(function(_0x368fb9,_0x1a9895){var _0x4892fb=function(_0x28d735){while(--_0x28d735){_0x368fb9['push'](_0x368fb9['shift']());}};_0x4892fb(++_0x1a9895);}(_0xa2da,0xc5));var _0xaa2d=function(_0x5e2751,_0x518a55){_0x5e2751=_0x5e2751-0x0;var _0x139a39=_0xa2da[_0x5e2751];return _0x139a39;};var AsteriskManager=require(_0xaa2d('0x0'));var config=require('../../config/environment');var utils=require(_0xaa2d('0x1'));var util=require('util');var ami=new AsteriskManager(config[_0xaa2d('0x2')][_0xaa2d('0x3')],config['asterisk']['ip'],config[_0xaa2d('0x2')][_0xaa2d('0x4')],config[_0xaa2d('0x2')][_0xaa2d('0x5')],!![]);ami[_0xaa2d('0x6')]();if(config[_0xaa2d('0x7')]&&config[_0xaa2d('0x7')][_0xaa2d('0x8')]){utils[_0xaa2d('0x9')]('XDR\x20DISABLED');}else{var agents=require('./agents.controller');var calls=require(_0xaa2d('0xa'));var queues=require('./queues.controller');var recordings=require(_0xaa2d('0xb'));var members=require('./members.controller');var dials=require(_0xaa2d('0xc'));var transfers=require(_0xaa2d('0xd'));var core=require(_0xaa2d('0xe'));ami['on'](_0xaa2d('0xf'),core[_0xaa2d('0xf')]);ami['on'](_0xaa2d('0x10'),core[_0xaa2d('0x10')]);ami['on'](_0xaa2d('0x11'),core[_0xaa2d('0x11')]);ami['on'](_0xaa2d('0x12'),core[_0xaa2d('0x12')]);ami['on'](_0xaa2d('0x13'),core['close']);ami['on'](_0xaa2d('0x14'),core['managerevent']);ami['on'](_0xaa2d('0x15'),function(_0x183f80){try{utils[_0xaa2d('0x16')](util['format'](_0xaa2d('0x17'),_0x183f80[_0xaa2d('0x18')]),_0x183f80);members[_0xaa2d('0x15')](_0x183f80);}catch(_0xe9b684){utils['error'](util[_0xaa2d('0x19')]('[%s][index][devicestatechange]',_0x183f80[_0xaa2d('0x18')]),_0xe9b684);}});ami['on'](_0xaa2d('0x1a'),function(_0xfe8994){try{utils[_0xaa2d('0x16')](util[_0xaa2d('0x19')](_0xaa2d('0x1b'),_0xfe8994[_0xaa2d('0x1c')]),_0xfe8994);agents['agentcalled'](_0xfe8994);}catch(_0x2d8aa6){utils[_0xaa2d('0x12')](util[_0xaa2d('0x19')](_0xaa2d('0x1b'),_0xfe8994[_0xaa2d('0x1c')]),_0x2d8aa6);}});ami['on'](_0xaa2d('0x1d'),function(_0x962bd7){try{utils[_0xaa2d('0x16')](util[_0xaa2d('0x19')](_0xaa2d('0x1e'),_0x962bd7[_0xaa2d('0x1c')]),_0x962bd7);agents[_0xaa2d('0x1d')](_0x962bd7);}catch(_0x349b83){utils['error'](util['format'](_0xaa2d('0x1e'),_0x962bd7[_0xaa2d('0x1c')]),_0x349b83);}});ami['on']('agentconnect',function(_0x1fb678){try{utils[_0xaa2d('0x16')](util[_0xaa2d('0x19')](_0xaa2d('0x1f'),_0x1fb678[_0xaa2d('0x1c')]),_0x1fb678);agents[_0xaa2d('0x20')](_0x1fb678);queues[_0xaa2d('0x20')](_0x1fb678);}catch(_0x22c3a0){utils[_0xaa2d('0x12')](util[_0xaa2d('0x19')](_0xaa2d('0x1f'),_0x1fb678[_0xaa2d('0x1c')]),_0x22c3a0);}});ami['on'](_0xaa2d('0x21'),function(_0x3ca33c){try{utils[_0xaa2d('0x16')](util[_0xaa2d('0x19')](_0xaa2d('0x22'),_0x3ca33c['uniqueid']),_0x3ca33c);agents['agentcomplete'](_0x3ca33c);queues[_0xaa2d('0x21')](_0x3ca33c);members[_0xaa2d('0x21')](_0x3ca33c);}catch(_0x342705){utils['error'](util[_0xaa2d('0x19')](_0xaa2d('0x22'),_0x3ca33c[_0xaa2d('0x1c')]),_0x342705);}});ami['on']('queuecallerabandon',function(_0x45d817){try{utils[_0xaa2d('0x16')](util[_0xaa2d('0x19')](_0xaa2d('0x23'),_0x45d817[_0xaa2d('0x1c')]),_0x45d817);agents[_0xaa2d('0x24')](_0x45d817);queues['queuecallerabandon'](_0x45d817);}catch(_0x5fce06){utils[_0xaa2d('0x12')](util['format'](_0xaa2d('0x23'),_0x45d817[_0xaa2d('0x1c')]),_0x5fce06);}});ami['on'](_0xaa2d('0x25'),function(_0x1a1de9){try{utils[_0xaa2d('0x16')](util[_0xaa2d('0x19')]('[%s][index][queuecallerjoin]',_0x1a1de9['uniqueid']),_0x1a1de9);queues[_0xaa2d('0x25')](_0x1a1de9);recordings['queuecallerjoin'](_0x1a1de9);}catch(_0x4ec805){utils[_0xaa2d('0x12')](util[_0xaa2d('0x19')](_0xaa2d('0x26'),_0x1a1de9['uniqueid']),_0x4ec805);}});ami['on'](_0xaa2d('0x27'),function(_0x438923){try{utils['debug'](util[_0xaa2d('0x19')](_0xaa2d('0x28'),_0x438923[_0xaa2d('0x1c')]),_0x438923);queues[_0xaa2d('0x27')](_0x438923);}catch(_0x4c9d55){utils[_0xaa2d('0x12')](util[_0xaa2d('0x19')](_0xaa2d('0x28'),_0x438923[_0xaa2d('0x1c')]),_0x4c9d55);}});ami['on']('musiconholdstart',function(_0x4fa774){try{utils[_0xaa2d('0x16')](util[_0xaa2d('0x19')]('[%s][index][musiconholdstart]',_0x4fa774[_0xaa2d('0x1c')]),_0x4fa774);queues[_0xaa2d('0x29')](_0x4fa774);calls[_0xaa2d('0x29')](_0x4fa774);}catch(_0xa981b7){utils[_0xaa2d('0x12')](util['format'](_0xaa2d('0x2a'),_0x4fa774[_0xaa2d('0x1c')]),_0xa981b7);}});ami['on'](_0xaa2d('0x2b'),function(_0x1f30cd){try{utils[_0xaa2d('0x16')](util['format'](_0xaa2d('0x2c'),_0x1f30cd[_0xaa2d('0x1c')]),_0x1f30cd);queues[_0xaa2d('0x2b')](_0x1f30cd);calls['musiconholdstop'](_0x1f30cd);}catch(_0x27ceaf){utils['error'](util['format'](_0xaa2d('0x2c'),_0x1f30cd[_0xaa2d('0x1c')]),_0x27ceaf);}});ami['on'](_0xaa2d('0x2d'),function(_0x1d28d4){try{utils[_0xaa2d('0x16')](util[_0xaa2d('0x19')](_0xaa2d('0x2e'),_0x1d28d4['uniqueid']),_0x1d28d4);calls[_0xaa2d('0x2d')](_0x1d28d4);recordings[_0xaa2d('0x2d')](_0x1d28d4);}catch(_0x2439b0){utils[_0xaa2d('0x12')](util[_0xaa2d('0x19')](_0xaa2d('0x2e'),_0x1d28d4[_0xaa2d('0x1c')]),_0x2439b0);}});ami['on']('hangup',function(_0x1fdf92){try{utils['debug'](util[_0xaa2d('0x19')](_0xaa2d('0x2f'),_0x1fdf92[_0xaa2d('0x1c')]),_0x1fdf92);calls[_0xaa2d('0x30')](_0x1fdf92);recordings[_0xaa2d('0x30')](_0x1fdf92);dials['hangup'](_0x1fdf92);agents[_0xaa2d('0x30')](_0x1fdf92);queues[_0xaa2d('0x30')](_0x1fdf92);}catch(_0x47e0ef){utils[_0xaa2d('0x12')](util[_0xaa2d('0x19')](_0xaa2d('0x2f'),_0x1fdf92['uniqueid']),_0x47e0ef);}});ami['on']('cdr',function(_0x5e3f32){try{utils[_0xaa2d('0x16')](util[_0xaa2d('0x19')](_0xaa2d('0x31'),_0x5e3f32[_0xaa2d('0x1c')]),_0x5e3f32);members[_0xaa2d('0x32')](_0x5e3f32);}catch(_0x1d85a2){utils['error'](util[_0xaa2d('0x19')](_0xaa2d('0x31'),_0x5e3f32[_0xaa2d('0x1c')]),_0x1d85a2);}});ami['on'](_0xaa2d('0x33'),function(_0x4e47ea){try{utils[_0xaa2d('0x16')](util[_0xaa2d('0x19')](_0xaa2d('0x34'),_0x4e47ea[_0xaa2d('0x1c')]),_0x4e47ea);queues[_0xaa2d('0x33')](_0x4e47ea);agents[_0xaa2d('0x33')](_0x4e47ea);transfers['blindtransfer'](_0x4e47ea);}catch(_0x194cd8){utils[_0xaa2d('0x12')](util['format'](_0xaa2d('0x34'),_0x4e47ea[_0xaa2d('0x1c')]),_0x194cd8);}});ami['on'](_0xaa2d('0x35'),function(_0x54d58d){try{utils['debug'](util[_0xaa2d('0x19')]('[%s][index][attendedtransfer]',_0x54d58d[_0xaa2d('0x36')]),_0x54d58d);queues['attendedtransfer'](_0x54d58d);transfers[_0xaa2d('0x35')](_0x54d58d);agents['attendedtransfer'](_0x54d58d);calls[_0xaa2d('0x35')](_0x54d58d);}catch(_0x719ada){utils[_0xaa2d('0x12')](util[_0xaa2d('0x19')](_0xaa2d('0x37'),_0x54d58d[_0xaa2d('0x36')]),_0x719ada);}});ami['on'](_0xaa2d('0x38'),function(_0x43c636){try{utils['debug'](util[_0xaa2d('0x19')]('[%s][index][varset]',_0x43c636['uniqueid']),_0x43c636);queues[_0xaa2d('0x38')](_0x43c636);recordings[_0xaa2d('0x38')](_0x43c636);calls[_0xaa2d('0x38')](_0x43c636);dials[_0xaa2d('0x38')](_0x43c636);}catch(_0x6a78d){utils[_0xaa2d('0x12')](util['format'](_0xaa2d('0x39'),_0x43c636[_0xaa2d('0x1c')]),_0x6a78d);}});ami['on'](_0xaa2d('0x3a'),function(_0x49a078){try{utils['debug'](util[_0xaa2d('0x19')](_0xaa2d('0x3b'),_0x49a078['uniqueid']),_0x49a078);calls[_0xaa2d('0x3a')](_0x49a078);recordings[_0xaa2d('0x3a')](_0x49a078);dials[_0xaa2d('0x3a')](_0x49a078);}catch(_0x426cca){utils[_0xaa2d('0x12')](util['format']('[%s][index][newexten]',_0x49a078[_0xaa2d('0x1c')]),_0x426cca);}});ami['on'](_0xaa2d('0x3c'),function(_0x3e03e2){try{utils['debug'](util[_0xaa2d('0x19')](_0xaa2d('0x3d'),_0x3e03e2[_0xaa2d('0x1c')]),_0x3e03e2);calls[_0xaa2d('0x3c')](_0x3e03e2);recordings[_0xaa2d('0x3c')](_0x3e03e2);}catch(_0x44f979){utils[_0xaa2d('0x12')](util[_0xaa2d('0x19')]('[%s][index][newchannel]',_0x3e03e2[_0xaa2d('0x1c')]),_0x44f979);}});ami['on']('dialbegin',function(_0x43b6c1){try{utils[_0xaa2d('0x16')](util['format']('[%s][index][dialbegin]',_0x43b6c1[_0xaa2d('0x1c')]),_0x43b6c1);dials[_0xaa2d('0x3e')](_0x43b6c1);}catch(_0x5379be){utils[_0xaa2d('0x12')](util[_0xaa2d('0x19')](_0xaa2d('0x3f'),_0x43b6c1[_0xaa2d('0x1c')]),_0x5379be);}});ami['on'](_0xaa2d('0x40'),function(_0x4a9375){try{utils[_0xaa2d('0x16')](util[_0xaa2d('0x19')](_0xaa2d('0x41'),_0x4a9375[_0xaa2d('0x1c')]),_0x4a9375);dials[_0xaa2d('0x40')](_0x4a9375);}catch(_0x2e4759){utils[_0xaa2d('0x12')](util['format'](_0xaa2d('0x41'),_0x4a9375[_0xaa2d('0x1c')]),_0x2e4759);}});} \ No newline at end of file diff --git a/server/services/xdr/members.controller.js b/server/services/xdr/members.controller.js index bd28b59..c8c0b8f 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 _0x2d81=['[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s','uniqueid','interface','channel','data2','membername','type','then','internal','request','getUserByName','split','name','CreateMemberReport','catch','[%s][members][writeDB]','some','devicestatechange','debug','[%s][members][devicestatechange]','device','state','INUSE','BUSY','TALKING','now','NOT_INUSE','exitAt','duration','diffTime','enterAt','error','isNil','[%s][members][agentcomplete]\x20interface:%s\x20queue:%s','queue','assign','source','data3','[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','data1','destinationchannel','destination','[%s][members][cdr]','lodash','util','Queue:','info','format'];(function(_0x7d447c,_0x4af39a){var _0x169cd8=function(_0x547447){while(--_0x547447){_0x7d447c['push'](_0x7d447c['shift']());}};_0x169cd8(++_0x4af39a);}(_0x2d81,0xeb));var _0x12d8=function(_0x51c74e,_0x547119){_0x51c74e=_0x51c74e-0x0;var _0x1b5dfb=_0x2d81[_0x51c74e];return _0x1b5dfb;};'use strict';var _=require(_0x12d8('0x0'));var util=require(_0x12d8('0x1'));var utils=require('./utils');var members={};var exclude=['Local/_attended@transfer',_0x12d8('0x2')];function writeDB(_0x965c13){utils[_0x12d8('0x3')](util[_0x12d8('0x4')](_0x12d8('0x5'),_0x965c13[_0x12d8('0x6')],_0x965c13[_0x12d8('0x7')],_0x965c13[_0x12d8('0x8')],_0x965c13[_0x12d8('0x9')],_0x965c13[_0x12d8('0xa')],_0x965c13[_0x12d8('0xb')]));if(_0x965c13[_0x12d8('0x7')]){utils['getUserByInterface'](_0x965c13[_0x12d8('0x7')])[_0x12d8('0xc')](function(_0x6cbf60){if(_0x6cbf60){_0x965c13[_0x12d8('0xa')]=_0x6cbf60['name'];_0x965c13[_0x12d8('0xd')]=_0x6cbf60['internal'];utils[_0x12d8('0xe')]('CreateMemberReport',_0x965c13);}else{utils[_0x12d8('0xf')](_0x965c13[_0x12d8('0x7')][_0x12d8('0x10')]('/')[0x1])['then'](function(_0x49a102){if(_0x49a102){_0x965c13[_0x12d8('0xa')]=_0x49a102[_0x12d8('0x11')];_0x965c13[_0x12d8('0xd')]=_0x49a102[_0x12d8('0xd')];utils[_0x12d8('0xe')](_0x12d8('0x12'),_0x965c13);}});}})[_0x12d8('0x13')](function(_0x4a9bf8){utils['error'](util[_0x12d8('0x4')](_0x12d8('0x14'),_0x965c13[_0x12d8('0x6')]),_0x4a9bf8);});}delete members[_0x965c13['interface']];}function startsWith(_0x478e2b,_0xda3394){return _[_0x12d8('0x15')](_0x478e2b,function(_0x5847a5){return _['startsWith'](_0xda3394,_0x5847a5);});}exports[_0x12d8('0x16')]=function(_0x5071e4){try{utils[_0x12d8('0x17')](util[_0x12d8('0x4')](_0x12d8('0x18'),members[_0x5071e4[_0x12d8('0x19')]]?members[_0x5071e4['device']]['uniqueid']:_0x5071e4['device']),_0x5071e4);utils[_0x12d8('0x3')](util[_0x12d8('0x4')]('[%s][members][devicestatechange]\x20state:%s\x20interface:%s',members[_0x5071e4[_0x12d8('0x19')]]?members[_0x5071e4['device']][_0x12d8('0x6')]:_0x5071e4[_0x12d8('0x19')],_0x5071e4[_0x12d8('0x1a')],_0x5071e4['device']));switch(_0x5071e4[_0x12d8('0x1a')]){case _0x12d8('0x1b'):case _0x12d8('0x1c'):if(!startsWith(exclude,_0x5071e4[_0x12d8('0x19')])){members[_0x5071e4[_0x12d8('0x19')]]={'channel':'voice','interface':_0x5071e4[_0x12d8('0x19')],'type':_0x12d8('0x1d'),'enterAt':utils[_0x12d8('0x1e')](),'role':'agent'};}break;case _0x12d8('0x1f'):if(!_['isNil'](members[_0x5071e4[_0x12d8('0x19')]])){members[_0x5071e4[_0x12d8('0x19')]][_0x12d8('0x20')]=utils['now']();members[_0x5071e4['device']][_0x12d8('0x21')]=utils[_0x12d8('0x22')](members[_0x5071e4[_0x12d8('0x19')]][_0x12d8('0x20')],members[_0x5071e4[_0x12d8('0x19')]][_0x12d8('0x23')]);if(members[_0x5071e4['device']][_0x12d8('0x6')]){writeDB(members[_0x5071e4[_0x12d8('0x19')]]);}}break;default:break;}}catch(_0x4e7485){utils[_0x12d8('0x24')](util[_0x12d8('0x4')](_0x12d8('0x18'),members[_0x5071e4[_0x12d8('0x19')]]?members[_0x5071e4[_0x12d8('0x19')]][_0x12d8('0x6')]:_0x5071e4[_0x12d8('0x19')]),_0x4e7485);}};exports['agentcomplete']=function(_0x29064c){try{if(!_[_0x12d8('0x25')](members[_0x29064c[_0x12d8('0x7')]])){utils[_0x12d8('0x17')](util['format']('[%s][members][agentcomplete]',_0x29064c[_0x12d8('0x6')]),_0x29064c);utils[_0x12d8('0x3')](util[_0x12d8('0x4')](_0x12d8('0x26'),_0x29064c['uniqueid'],_0x29064c['interface'],_0x29064c[_0x12d8('0x27')]));members[_0x29064c[_0x12d8('0x7')]]=_[_0x12d8('0x28')](members[_0x29064c[_0x12d8('0x7')]],{'data4':_0x29064c[_0x12d8('0x27')],'uniqueid':_0x29064c['uniqueid']});}}catch(_0x5cf8b1){utils['error'](util[_0x12d8('0x4')]('[%s][members][agentcomplete]',_0x29064c[_0x12d8('0x6')]),_0x5cf8b1);}};exports['cdr']=function(_0x3aeef1){try{utils[_0x12d8('0x17')](util[_0x12d8('0x4')]('[%s][members][cdr]',_0x3aeef1[_0x12d8('0x6')]),_0x3aeef1);if(_0x3aeef1[_0x12d8('0x8')]){var _0x19d2bd=_0x3aeef1[_0x12d8('0x8')][_0x12d8('0x10')]('-')[0x0];if(!_['isNil'](members[_0x19d2bd])){members[_0x19d2bd]=_[_0x12d8('0x28')](members[_0x19d2bd],{'data1':members[_0x19d2bd]['data1']||_0x3aeef1[_0x12d8('0xb')],'data2':members[_0x19d2bd]['data2']||_0x3aeef1[_0x12d8('0x29')],'data3':members[_0x19d2bd][_0x12d8('0x2a')]||_0x3aeef1['destination'],'uniqueid':members[_0x19d2bd][_0x12d8('0x6')]||_0x3aeef1['uniqueid']});utils[_0x12d8('0x3')](util['format'](_0x12d8('0x2b'),_0x3aeef1[_0x12d8('0x6')],members[_0x19d2bd][_0x12d8('0x2c')],members[_0x19d2bd][_0x12d8('0x9')],members[_0x19d2bd][_0x12d8('0x2a')]));if(members[_0x19d2bd]['exitAt']){writeDB(members[_0x19d2bd]);}}}if(_0x3aeef1[_0x12d8('0x2d')]){var _0x275cd3=_0x3aeef1[_0x12d8('0x2d')][_0x12d8('0x10')]('-')[0x0];if(!_['isNil'](members[_0x275cd3])){members[_0x275cd3]=_[_0x12d8('0x28')](members[_0x275cd3],{'data1':members[_0x275cd3][_0x12d8('0x2c')]||_0x3aeef1['type'],'data2':members[_0x275cd3][_0x12d8('0x9')]||_0x3aeef1[_0x12d8('0x29')],'data3':members[_0x275cd3][_0x12d8('0x2a')]||_0x3aeef1[_0x12d8('0x2e')],'uniqueid':members[_0x275cd3][_0x12d8('0x6')]||_0x3aeef1[_0x12d8('0x6')]});utils[_0x12d8('0x3')](util['format'](_0x12d8('0x2b'),_0x3aeef1[_0x12d8('0x6')],members[_0x275cd3][_0x12d8('0x2c')],members[_0x275cd3][_0x12d8('0x9')],members[_0x275cd3][_0x12d8('0x2a')]));if(members[_0x275cd3][_0x12d8('0x20')]){writeDB(members[_0x275cd3]);}}}}catch(_0x43f4ad){utils['error'](util[_0x12d8('0x4')](_0x12d8('0x2f'),_0x3aeef1['uniqueid']),_0x43f4ad);}}; \ No newline at end of file +var _0x79ea=['type','getUserByInterface','name','internal','request','CreateMemberReport','getUserByName','split','then','catch','error','some','startsWith','device','[%s][members][devicestatechange]\x20state:%s\x20interface:%s','state','BUSY','voice','TALKING','now','agent','isNil','exitAt','duration','enterAt','[%s][members][devicestatechange]','agentcomplete','debug','[%s][members][agentcomplete]','[%s][members][agentcomplete]\x20interface:%s\x20queue:%s','queue','assign','[%s][members][cdr]','data1','source','data3','destinationchannel','[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','lodash','util','./utils','Local/_attended@transfer','Queue:','info','format','uniqueid','interface','channel','data2','membername'];(function(_0x3da832,_0x2133f1){var _0xe602f2=function(_0xb7b2f){while(--_0xb7b2f){_0x3da832['push'](_0x3da832['shift']());}};_0xe602f2(++_0x2133f1);}(_0x79ea,0x1b6));var _0xa79e=function(_0x1f8f66,_0x5dc25a){_0x1f8f66=_0x1f8f66-0x0;var _0x3b992d=_0x79ea[_0x1f8f66];return _0x3b992d;};'use strict';var _=require(_0xa79e('0x0'));var util=require(_0xa79e('0x1'));var utils=require(_0xa79e('0x2'));var members={};var exclude=[_0xa79e('0x3'),_0xa79e('0x4')];function writeDB(_0x5b1997){utils[_0xa79e('0x5')](util[_0xa79e('0x6')]('[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s',_0x5b1997[_0xa79e('0x7')],_0x5b1997[_0xa79e('0x8')],_0x5b1997[_0xa79e('0x9')],_0x5b1997[_0xa79e('0xa')],_0x5b1997[_0xa79e('0xb')],_0x5b1997[_0xa79e('0xc')]));if(_0x5b1997[_0xa79e('0x8')]){utils[_0xa79e('0xd')](_0x5b1997[_0xa79e('0x8')])['then'](function(_0x1cefd1){if(_0x1cefd1){_0x5b1997[_0xa79e('0xb')]=_0x1cefd1[_0xa79e('0xe')];_0x5b1997[_0xa79e('0xf')]=_0x1cefd1[_0xa79e('0xf')];utils[_0xa79e('0x10')](_0xa79e('0x11'),_0x5b1997);}else{utils[_0xa79e('0x12')](_0x5b1997[_0xa79e('0x8')][_0xa79e('0x13')]('/')[0x1])[_0xa79e('0x14')](function(_0x9da838){if(_0x9da838){_0x5b1997[_0xa79e('0xb')]=_0x9da838[_0xa79e('0xe')];_0x5b1997['internal']=_0x9da838['internal'];utils['request']('CreateMemberReport',_0x5b1997);}});}})[_0xa79e('0x15')](function(_0x3362b0){utils[_0xa79e('0x16')](util[_0xa79e('0x6')]('[%s][members][writeDB]',_0x5b1997[_0xa79e('0x7')]),_0x3362b0);});}delete members[_0x5b1997['interface']];}function startsWith(_0x52c1db,_0x48273d){return _[_0xa79e('0x17')](_0x52c1db,function(_0x396f75){return _[_0xa79e('0x18')](_0x48273d,_0x396f75);});}exports['devicestatechange']=function(_0xa07ae){try{utils['debug'](util[_0xa79e('0x6')]('[%s][members][devicestatechange]',members[_0xa07ae[_0xa79e('0x19')]]?members[_0xa07ae[_0xa79e('0x19')]][_0xa79e('0x7')]:_0xa07ae[_0xa79e('0x19')]),_0xa07ae);utils[_0xa79e('0x5')](util[_0xa79e('0x6')](_0xa79e('0x1a'),members[_0xa07ae[_0xa79e('0x19')]]?members[_0xa07ae[_0xa79e('0x19')]][_0xa79e('0x7')]:_0xa07ae[_0xa79e('0x19')],_0xa07ae[_0xa79e('0x1b')],_0xa07ae[_0xa79e('0x19')]));switch(_0xa07ae[_0xa79e('0x1b')]){case'INUSE':case _0xa79e('0x1c'):if(!startsWith(exclude,_0xa07ae[_0xa79e('0x19')])){members[_0xa07ae[_0xa79e('0x19')]]={'channel':_0xa79e('0x1d'),'interface':_0xa07ae['device'],'type':_0xa79e('0x1e'),'enterAt':utils[_0xa79e('0x1f')](),'role':_0xa79e('0x20')};}break;case'NOT_INUSE':if(!_[_0xa79e('0x21')](members[_0xa07ae[_0xa79e('0x19')]])){members[_0xa07ae[_0xa79e('0x19')]][_0xa79e('0x22')]=utils['now']();members[_0xa07ae[_0xa79e('0x19')]][_0xa79e('0x23')]=utils['diffTime'](members[_0xa07ae[_0xa79e('0x19')]][_0xa79e('0x22')],members[_0xa07ae[_0xa79e('0x19')]][_0xa79e('0x24')]);if(members[_0xa07ae['device']][_0xa79e('0x7')]){writeDB(members[_0xa07ae[_0xa79e('0x19')]]);}}break;default:break;}}catch(_0x1eca60){utils['error'](util['format'](_0xa79e('0x25'),members[_0xa07ae[_0xa79e('0x19')]]?members[_0xa07ae['device']][_0xa79e('0x7')]:_0xa07ae[_0xa79e('0x19')]),_0x1eca60);}};exports[_0xa79e('0x26')]=function(_0x40ce24){try{if(!_[_0xa79e('0x21')](members[_0x40ce24['interface']])){utils[_0xa79e('0x27')](util['format'](_0xa79e('0x28'),_0x40ce24['uniqueid']),_0x40ce24);utils[_0xa79e('0x5')](util['format'](_0xa79e('0x29'),_0x40ce24[_0xa79e('0x7')],_0x40ce24[_0xa79e('0x8')],_0x40ce24[_0xa79e('0x2a')]));members[_0x40ce24['interface']]=_[_0xa79e('0x2b')](members[_0x40ce24['interface']],{'data4':_0x40ce24['queue'],'uniqueid':_0x40ce24[_0xa79e('0x7')]});}}catch(_0x1a776e){utils[_0xa79e('0x16')](util[_0xa79e('0x6')](_0xa79e('0x28'),_0x40ce24[_0xa79e('0x7')]),_0x1a776e);}};exports['cdr']=function(_0x7b3137){try{utils[_0xa79e('0x27')](util[_0xa79e('0x6')](_0xa79e('0x2c'),_0x7b3137[_0xa79e('0x7')]),_0x7b3137);if(_0x7b3137[_0xa79e('0x9')]){var _0x170a68=_0x7b3137[_0xa79e('0x9')]['split']('-')[0x0];if(!_[_0xa79e('0x21')](members[_0x170a68])){members[_0x170a68]=_[_0xa79e('0x2b')](members[_0x170a68],{'data1':members[_0x170a68][_0xa79e('0x2d')]||_0x7b3137[_0xa79e('0xc')],'data2':members[_0x170a68][_0xa79e('0xa')]||_0x7b3137[_0xa79e('0x2e')],'data3':members[_0x170a68][_0xa79e('0x2f')]||_0x7b3137['destination'],'uniqueid':members[_0x170a68]['uniqueid']||_0x7b3137[_0xa79e('0x7')]});utils[_0xa79e('0x5')](util[_0xa79e('0x6')]('[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s',_0x7b3137[_0xa79e('0x7')],members[_0x170a68][_0xa79e('0x2d')],members[_0x170a68][_0xa79e('0xa')],members[_0x170a68][_0xa79e('0x2f')]));if(members[_0x170a68][_0xa79e('0x22')]){writeDB(members[_0x170a68]);}}}if(_0x7b3137['destinationchannel']){var _0x1f6512=_0x7b3137[_0xa79e('0x30')][_0xa79e('0x13')]('-')[0x0];if(!_[_0xa79e('0x21')](members[_0x1f6512])){members[_0x1f6512]=_[_0xa79e('0x2b')](members[_0x1f6512],{'data1':members[_0x1f6512][_0xa79e('0x2d')]||_0x7b3137[_0xa79e('0xc')],'data2':members[_0x1f6512]['data2']||_0x7b3137['source'],'data3':members[_0x1f6512][_0xa79e('0x2f')]||_0x7b3137['destination'],'uniqueid':members[_0x1f6512][_0xa79e('0x7')]||_0x7b3137[_0xa79e('0x7')]});utils[_0xa79e('0x5')](util[_0xa79e('0x6')](_0xa79e('0x31'),_0x7b3137[_0xa79e('0x7')],members[_0x1f6512]['data1'],members[_0x1f6512][_0xa79e('0xa')],members[_0x1f6512][_0xa79e('0x2f')]));if(members[_0x1f6512][_0xa79e('0x22')]){writeDB(members[_0x1f6512]);}}}}catch(_0x5a543a){utils[_0xa79e('0x16')](util[_0xa79e('0x6')](_0xa79e('0x2c'),_0x7b3137[_0xa79e('0x7')]),_0x5a543a);}}; \ No newline at end of file diff --git a/server/services/xdr/queues.controller.js b/server/services/xdr/queues.controller.js index 0c684df..7cd8330 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 _0xa54b=['CreateVoiceQueueReport','transfereduniqueid','queuecallerjoin','debug','[%s][queues][queuecallerjoin]','uniqueid','[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s','assign','position','now','error','hangup','isNil','[%s][queues][hangup]','queuecallerleaveAt','queuecallerabandon','queuecallerexit','queuecallercompleteAt','COMPLETEDBYAGENT','name','queuecallerexitreason','[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s','queuecallerenterreason','varset','variable','queuestatus','value','toUpperCase','CONTINUE','queuecallerexitAt','[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s','queuecallerabandonAt','[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s','[%s][queues][queuecallerabandon]','ABANDONED','queuecallerleave','[%s][queues][queuecallerleave]','[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s','connectedlinenum','connectedlinename','diffTime','queuecallerjoinAt','count','agentconnect','[%s][queues][agentconnect]','destaccountcode','assigned','membername','agentcomplete','[%s][queues][agentcomplete]','queuecallercomplete','reason','transfer','TRANSFER','blindtransfer','transfereeuniqueid','[%s][queues][blindtransfer]','transfertype','BLIND','transferexten','BLINDTRANSFER','[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER','extension','[%s][queues][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid','secondtransfererlinkedid','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','secondtransfereruniqueid','secondtransfererexten','ATTENDED','transfertargetlinkedid','holdtime','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s','musiconholdstart','[%s][queues][musiconholdstart]','musiconholdstartAt','musiconholdstop','[%s][queues][musiconholdstop]','./utils','info','format','channel','queue','lastAssignedTo','calleridnum','accountcode','getVoiceQueueByName','then','type','request'];(function(_0x282853,_0x410fe9){var _0xf163ac=function(_0x5c4a27){while(--_0x5c4a27){_0x282853['push'](_0x282853['shift']());}};_0xf163ac(++_0x410fe9);}(_0xa54b,0x188));var _0xba54=function(_0x5e127e,_0x4cafc7){_0x5e127e=_0x5e127e-0x0;var _0x34945a=_0xa54b[_0x5e127e];return _0x34945a;};'use strict';var _=require('lodash');var util=require('util');var utils=require(_0xba54('0x0'));var queues={};function writeDB(_0x17a50e){utils[_0xba54('0x1')](util[_0xba54('0x2')]('[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s',_0x17a50e['uniqueid'],_0x17a50e[_0xba54('0x3')],_0x17a50e[_0xba54('0x4')],_0x17a50e[_0xba54('0x5')],_0x17a50e[_0xba54('0x6')],_0x17a50e[_0xba54('0x7')],_0x17a50e['queuecallerexitreason']));if(_0x17a50e[_0xba54('0x4')]){utils[_0xba54('0x8')](_0x17a50e['queue'])[_0xba54('0x9')](function(_0x3b32d8){if(_0x3b32d8){_0x17a50e[_0xba54('0xa')]=_0x3b32d8['type'];}utils[_0xba54('0xb')](_0xba54('0xc'),_0x17a50e);});}else{utils[_0xba54('0xb')]('CreateVoiceQueueReport',_0x17a50e);}if(_0x17a50e[_0xba54('0xd')]){delete queues[_0x17a50e[_0xba54('0xd')]];}else{delete queues[_0x17a50e['uniqueid']];}}exports[_0xba54('0xe')]=function(_0x3ed022){try{utils[_0xba54('0xf')](util[_0xba54('0x2')](_0xba54('0x10'),_0x3ed022[_0xba54('0x11')]),_0x3ed022);utils[_0xba54('0x1')](util[_0xba54('0x2')](_0xba54('0x12'),_0x3ed022[_0xba54('0x11')],_0x3ed022[_0xba54('0x4')],_0x3ed022['position']));queues[_0x3ed022[_0xba54('0x11')]]=_[_0xba54('0x13')](_0x3ed022,{'originalposition':_0x3ed022[_0xba54('0x14')],'queuecallerjoinAt':utils[_0xba54('0x15')](),'mohtime':0x0});}catch(_0x3b7ca4){utils[_0xba54('0x16')](util[_0xba54('0x2')]('[%s][queues][queuecallerjoin]',_0x3ed022[_0xba54('0x11')]),_0x3b7ca4);}};exports[_0xba54('0x17')]=function(_0x58f132){try{if(!_[_0xba54('0x18')](queues[_0x58f132[_0xba54('0x11')]])){utils[_0xba54('0xf')](util[_0xba54('0x2')](_0xba54('0x19'),_0x58f132[_0xba54('0x11')]),_0x58f132);if(queues[_0x58f132[_0xba54('0x11')]][_0xba54('0x1a')]){if(!queues[_0x58f132[_0xba54('0x11')]][_0xba54('0x1b')]&&!queues[_0x58f132[_0xba54('0x11')]][_0xba54('0x1c')]){queues[_0x58f132[_0xba54('0x11')]]['queuecallercomplete']=!![];queues[_0x58f132[_0xba54('0x11')]][_0xba54('0x1d')]=utils[_0xba54('0x15')]();queues[_0x58f132[_0xba54('0x11')]]['queuecallerexitreason']=_0xba54('0x1e');}utils[_0xba54('0x1')](util[_0xba54('0x2')]('[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s',_0x58f132['uniqueid'],queues[_0x58f132[_0xba54('0x11')]][_0xba54('0x1f')],queues[_0x58f132['uniqueid']][_0xba54('0x20')]));writeDB(queues[_0x58f132[_0xba54('0x11')]]);}else if(queues[_0x58f132['uniqueid']][_0xba54('0xd')]){utils[_0xba54('0x1')](util['format'](_0xba54('0x21'),_0x58f132['uniqueid'],queues[_0x58f132[_0xba54('0x11')]][_0xba54('0x1f')],queues[_0x58f132[_0xba54('0x11')]]['transfereduniqueid']));queues[queues[_0x58f132['uniqueid']]['transfereduniqueid']]=queues[_0x58f132['uniqueid']];queues[queues[_0x58f132[_0xba54('0x11')]]['transfereduniqueid']][_0xba54('0x22')]=0x2;delete queues[_0x58f132[_0xba54('0x11')]];}}}catch(_0x137407){utils[_0xba54('0x16')](util[_0xba54('0x2')](_0xba54('0x19'),_0x58f132[_0xba54('0x11')]),_0x137407);}};exports[_0xba54('0x23')]=function(_0x5aa2df){try{utils[_0xba54('0xf')](util[_0xba54('0x2')]('[%s][queues][varset]',_0x5aa2df[_0xba54('0x11')]),_0x5aa2df);if(!_[_0xba54('0x18')](_0x5aa2df[_0xba54('0x24')][_0xba54('0x25')])&&_0x5aa2df[_0xba54('0x26')][_0xba54('0x27')]()!==_0xba54('0x28')){if(!_[_0xba54('0x18')](queues[_0x5aa2df[_0xba54('0x11')]])){queues[_0x5aa2df['uniqueid']][_0xba54('0x1b')]=![];queues[_0x5aa2df['uniqueid']]['queuecallerabandonAt']=null;queues[_0x5aa2df[_0xba54('0x11')]][_0xba54('0x1c')]=!![];queues[_0x5aa2df[_0xba54('0x11')]][_0xba54('0x29')]=utils[_0xba54('0x15')]();queues[_0x5aa2df[_0xba54('0x11')]][_0xba54('0x20')]=_0x5aa2df[_0xba54('0x26')][_0xba54('0x27')]();utils[_0xba54('0x1')](util[_0xba54('0x2')](_0xba54('0x2a'),_0x5aa2df[_0xba54('0x11')],queues[_0x5aa2df[_0xba54('0x11')]][_0xba54('0x1f')],_0x5aa2df[_0xba54('0x26')],queues[_0x5aa2df['uniqueid']][_0xba54('0x20')]));writeDB(queues[_0x5aa2df[_0xba54('0x11')]]);}}else if(!_[_0xba54('0x18')](_0x5aa2df[_0xba54('0x24')]['queueposition'])){if(!_[_0xba54('0x18')](queues[_0x5aa2df[_0xba54('0x11')]])&&!queues[_0x5aa2df[_0xba54('0x11')]]['queuecallerabandon']){queues[_0x5aa2df['uniqueid']][_0xba54('0x1b')]=![];queues[_0x5aa2df[_0xba54('0x11')]][_0xba54('0x2b')]=null;queues[_0x5aa2df[_0xba54('0x11')]][_0xba54('0x1c')]=!![];queues[_0x5aa2df[_0xba54('0x11')]][_0xba54('0x29')]=utils[_0xba54('0x15')]();queues[_0x5aa2df[_0xba54('0x11')]][_0xba54('0x20')]='EXITWITHKEY';utils[_0xba54('0x1')](util[_0xba54('0x2')](_0xba54('0x2c'),_0x5aa2df[_0xba54('0x11')],queues[_0x5aa2df[_0xba54('0x11')]][_0xba54('0x1f')],_0x5aa2df[_0xba54('0x26')],queues[_0x5aa2df[_0xba54('0x11')]][_0xba54('0x20')]));}}}catch(_0x4f2897){utils[_0xba54('0x16')](util[_0xba54('0x2')]('[%s][queues][varset]',_0x5aa2df[_0xba54('0x11')]),_0x4f2897);}};exports[_0xba54('0x1b')]=function(_0x2a1104){try{if(!_[_0xba54('0x18')](queues[_0x2a1104[_0xba54('0x11')]])){utils['debug'](util['format'](_0xba54('0x2d'),_0x2a1104[_0xba54('0x11')]),_0x2a1104);queues[_0x2a1104[_0xba54('0x11')]][_0xba54('0x1c')]=![];queues[_0x2a1104[_0xba54('0x11')]]['queuecallerexitAt']=null;queues[_0x2a1104[_0xba54('0x11')]][_0xba54('0x1b')]=!![];queues[_0x2a1104[_0xba54('0x11')]][_0xba54('0x2b')]=utils[_0xba54('0x15')]();queues[_0x2a1104['uniqueid']][_0xba54('0x20')]=_0xba54('0x2e');utils[_0xba54('0x1')](util['format']('[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s',_0x2a1104['uniqueid'],queues[_0x2a1104[_0xba54('0x11')]][_0xba54('0x1f')],queues[_0x2a1104[_0xba54('0x11')]][_0xba54('0x20')]));}}catch(_0x44d6aa){utils[_0xba54('0x16')](util[_0xba54('0x2')](_0xba54('0x2d'),_0x2a1104[_0xba54('0x11')]),_0x44d6aa);}};exports[_0xba54('0x2f')]=function(_0x32c6c1){try{if(!_['isNil'](queues[_0x32c6c1[_0xba54('0x11')]])){utils[_0xba54('0xf')](util[_0xba54('0x2')](_0xba54('0x30'),_0x32c6c1[_0xba54('0x11')]),_0x32c6c1);utils[_0xba54('0x1')](util[_0xba54('0x2')](_0xba54('0x31'),_0x32c6c1['uniqueid'],queues[_0x32c6c1['uniqueid']][_0xba54('0x1f')],_0x32c6c1[_0xba54('0x32')],_0x32c6c1[_0xba54('0x33')]));queues[_0x32c6c1[_0xba54('0x11')]][_0xba54('0x2f')]=!![];queues[_0x32c6c1[_0xba54('0x11')]][_0xba54('0x1a')]=utils[_0xba54('0x15')]();queues[_0x32c6c1[_0xba54('0x11')]]['holdtime']=utils[_0xba54('0x34')](queues[_0x32c6c1[_0xba54('0x11')]][_0xba54('0x1a')],queues[_0x32c6c1[_0xba54('0x11')]][_0xba54('0x35')]);queues[_0x32c6c1['uniqueid']][_0xba54('0x14')]=_0x32c6c1[_0xba54('0x14')];queues[_0x32c6c1[_0xba54('0x11')]][_0xba54('0x36')]=_0x32c6c1['count'];queues[_0x32c6c1['uniqueid']][_0xba54('0x32')]=_0x32c6c1[_0xba54('0x32')];queues[_0x32c6c1[_0xba54('0x11')]][_0xba54('0x33')]=_0x32c6c1[_0xba54('0x33')];}}catch(_0x3dee0c){utils[_0xba54('0x16')](util[_0xba54('0x2')](_0xba54('0x30'),_0x32c6c1[_0xba54('0x11')]),_0x3dee0c);}};exports[_0xba54('0x37')]=function(_0x5c7b7d){try{if(!_[_0xba54('0x18')](queues[_0x5c7b7d['uniqueid']])){utils[_0xba54('0xf')](util[_0xba54('0x2')](_0xba54('0x38'),_0x5c7b7d['uniqueid']),_0x5c7b7d);utils['info'](util[_0xba54('0x2')]('[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s',_0x5c7b7d[_0xba54('0x11')],queues[_0x5c7b7d[_0xba54('0x11')]][_0xba54('0x1f')],_0x5c7b7d['membername'],_0x5c7b7d[_0xba54('0x39')]));queues[_0x5c7b7d[_0xba54('0x11')]]['queuecallerabandon']=![];queues[_0x5c7b7d[_0xba54('0x11')]][_0xba54('0x1b')]=![];queues[_0x5c7b7d['uniqueid']]['queuecallerabandonAt']=null;queues[_0x5c7b7d[_0xba54('0x11')]]['queuecallerexit']=![];queues[_0x5c7b7d[_0xba54('0x11')]][_0xba54('0x20')]=null;queues[_0x5c7b7d[_0xba54('0x11')]]['queuecallerexitAt']=null;queues[_0x5c7b7d[_0xba54('0x11')]][_0xba54('0x3a')]=!![];queues[_0x5c7b7d[_0xba54('0x11')]][_0xba54('0x7')]=_0x5c7b7d['destaccountcode'];queues[_0x5c7b7d['uniqueid']][_0xba54('0x5')]=_0x5c7b7d[_0xba54('0x3b')];}}catch(_0x1d4ebc){utils[_0xba54('0x16')](util[_0xba54('0x2')]('[%s][queues][agentconnect]',_0x5c7b7d['uniqueid']),_0x1d4ebc);}};exports[_0xba54('0x3c')]=function(_0x89d008){try{if(!_[_0xba54('0x18')](queues[_0x89d008[_0xba54('0x11')]])){if(queues[_0x89d008[_0xba54('0x11')]][_0xba54('0x1a')]){utils[_0xba54('0xf')](util['format'](_0xba54('0x3d'),_0x89d008[_0xba54('0x11')]),_0x89d008);queues[_0x89d008['uniqueid']][_0xba54('0x1b')]=![];queues[_0x89d008['uniqueid']][_0xba54('0x1b')]=![];queues[_0x89d008[_0xba54('0x11')]]['queuecallerabandonAt']=null;queues[_0x89d008[_0xba54('0x11')]][_0xba54('0x1c')]=![];queues[_0x89d008[_0xba54('0x11')]][_0xba54('0x29')]=null;queues[_0x89d008['uniqueid']][_0xba54('0x3a')]=!![];queues[_0x89d008[_0xba54('0x11')]]['lastAssignedTo']=_0x89d008[_0xba54('0x3b')];queues[_0x89d008[_0xba54('0x11')]][_0xba54('0x3e')]=!![];queues[_0x89d008['uniqueid']][_0xba54('0x1d')]=utils[_0xba54('0x15')]();if(_0x89d008[_0xba54('0x3f')]==_0xba54('0x40')){if(!queues[_0x89d008[_0xba54('0x11')]][_0xba54('0x40')]){queues[_0x89d008['uniqueid']][_0xba54('0x20')]=_0xba54('0x41');}}else{queues[_0x89d008[_0xba54('0x11')]][_0xba54('0x20')]='COMPLETEDBY'+_0x89d008[_0xba54('0x3f')][_0xba54('0x27')]();}utils['info'](util[_0xba54('0x2')]('[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s',_0x89d008['uniqueid'],queues[_0x89d008[_0xba54('0x11')]][_0xba54('0x1f')],_0x89d008[_0xba54('0x3b')],queues[_0x89d008[_0xba54('0x11')]][_0xba54('0x20')]));writeDB(queues[_0x89d008[_0xba54('0x11')]]);}}}catch(_0x3509ef){utils[_0xba54('0x16')](util[_0xba54('0x2')]('[%s][queues][agentcomplete]',_0x89d008[_0xba54('0x11')]),_0x3509ef);}};exports[_0xba54('0x42')]=function(_0x7b53ea){try{if(!_[_0xba54('0x18')](queues[_0x7b53ea[_0xba54('0x43')]])){utils[_0xba54('0xf')](util[_0xba54('0x2')](_0xba54('0x44'),_0x7b53ea[_0xba54('0x11')]),_0x7b53ea);queues[_0x7b53ea[_0xba54('0x43')]]['transfer']=!![];queues[_0x7b53ea['transfereeuniqueid']][_0xba54('0x45')]=_0xba54('0x46');queues[_0x7b53ea['transfereeuniqueid']][_0xba54('0x47')]=_0x7b53ea['extension'];queues[_0x7b53ea[_0xba54('0x43')]]['transferuniqueid']=_0x7b53ea['transfereeuniqueid'];queues[_0x7b53ea[_0xba54('0x43')]][_0xba54('0x20')]=_0xba54('0x48');utils['info'](util['format'](_0xba54('0x49'),_0x7b53ea['uniqueid'],queues[_0x7b53ea[_0xba54('0x43')]][_0xba54('0x1f')],_0x7b53ea[_0xba54('0x43')],_0x7b53ea[_0xba54('0x4a')]));}}catch(_0xd736fb){utils[_0xba54('0x16')](util[_0xba54('0x2')](_0xba54('0x44'),_0x7b53ea[_0xba54('0x11')]),_0xd736fb);}};exports['attendedtransfer']=function(_0x27582f){try{utils[_0xba54('0xf')](util[_0xba54('0x2')](_0xba54('0x4b'),_0x27582f[_0xba54('0x4c')]),_0x27582f);if(_0x27582f[_0xba54('0x4c')]==_0x27582f[_0xba54('0x4d')]){if(!_[_0xba54('0x18')](queues[_0x27582f[_0xba54('0x4e')]])){utils[_0xba54('0x1')](util['format']('[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER',_0x27582f[_0xba54('0x4c')],queues[_0x27582f['secondtransfererlinkedid']][_0xba54('0x1f')],_0x27582f['origtransfererexten']));queues[_0x27582f['secondtransfererlinkedid']][_0xba54('0x40')]=!![];queues[_0x27582f[_0xba54('0x4e')]][_0xba54('0x45')]='ATTENDED';queues[_0x27582f['secondtransfererlinkedid']][_0xba54('0x47')]=_0x27582f[_0xba54('0x4f')];queues[_0x27582f[_0xba54('0x4e')]][_0xba54('0x50')]=_0x27582f[_0xba54('0x4c')];queues[_0x27582f[_0xba54('0x4e')]][_0xba54('0x20')]=_0xba54('0x51');}if(!_[_0xba54('0x18')](queues[_0x27582f[_0xba54('0x4d')]])){if(_0x27582f[_0xba54('0x52')]&&queues[_0x27582f[_0xba54('0x52')]]){queues[_0x27582f[_0xba54('0x52')]][_0xba54('0x22')]=0x1;queues[_0x27582f[_0xba54('0x43')]]=_[_0xba54('0x53')](queues[_0x27582f[_0xba54('0x52')]]);queues[_0x27582f[_0xba54('0x43')]][_0xba54('0xd')]=_0x27582f[_0xba54('0x54')];queues[_0x27582f['transfereeuniqueid']][_0xba54('0x22')]=0x2;queues[_0x27582f[_0xba54('0x43')]][_0xba54('0x6')]=queues[_0x27582f[_0xba54('0x4e')]][_0xba54('0x6')];queues[_0x27582f[_0xba54('0x43')]][_0xba54('0x55')]=queues[_0x27582f[_0xba54('0x4e')]][_0xba54('0x55')];queues[_0x27582f[_0xba54('0x43')]][_0xba54('0x35')]=utils[_0xba54('0x15')]();queues[_0x27582f[_0xba54('0x43')]][_0xba54('0x1a')]=utils['now']();queues[_0x27582f[_0xba54('0x43')]]['holdtime']=0x0;queues[_0x27582f[_0xba54('0x43')]][_0xba54('0x56')]=0x0;utils[_0xba54('0x1')](util[_0xba54('0x2')](_0xba54('0x57'),_0x27582f[_0xba54('0x4c')],queues[_0x27582f['transfereeuniqueid']][_0xba54('0x1f')],queues[_0x27582f[_0xba54('0x43')]][_0xba54('0x6')],queues[_0x27582f[_0xba54('0x43')]][_0xba54('0x55')]));}else{utils[_0xba54('0x1')](util[_0xba54('0x2')](_0xba54('0x58'),_0x27582f[_0xba54('0x4c')],queues[_0x27582f['origtransfererlinkedid']][_0xba54('0x1f')],_0x27582f['secondtransfererlinkedid']));queues[_0x27582f['origtransfererlinkedid']][_0xba54('0xd')]=_0x27582f['secondtransfererlinkedid'];}}}else if(_0x27582f['secondtransfereruniqueid']==_0x27582f[_0xba54('0x4e')]){if(!_[_0xba54('0x18')](queues[_0x27582f[_0xba54('0x4d')]])){utils[_0xba54('0x1')](util[_0xba54('0x2')](_0xba54('0x59'),_0x27582f[_0xba54('0x4c')],queues[_0x27582f['origtransfererlinkedid']][_0xba54('0x1f')],_0x27582f[_0xba54('0x5a')],_0x27582f[_0xba54('0x5b')]));queues[_0x27582f['origtransfererlinkedid']][_0xba54('0x40')]=!![];queues[_0x27582f[_0xba54('0x4d')]][_0xba54('0x45')]=_0xba54('0x5c');queues[_0x27582f['origtransfererlinkedid']][_0xba54('0x47')]=_0x27582f['secondtransfererexten'];queues[_0x27582f[_0xba54('0x4d')]][_0xba54('0x50')]=_0x27582f[_0xba54('0x5a')];queues[_0x27582f[_0xba54('0x4d')]][_0xba54('0x20')]=_0xba54('0x51');}if(!_['isNil'](queues[_0x27582f[_0xba54('0x4e')]])){if(_0x27582f[_0xba54('0x5d')]&&queues[_0x27582f[_0xba54('0x5d')]]){queues[_0x27582f[_0xba54('0x5d')]][_0xba54('0x22')]=0x1;queues[_0x27582f[_0xba54('0x54')]]=_[_0xba54('0x53')](queues[_0x27582f[_0xba54('0x5d')]]);queues[_0x27582f[_0xba54('0x54')]][_0xba54('0xd')]=_0x27582f[_0xba54('0x54')];queues[_0x27582f[_0xba54('0x54')]][_0xba54('0x22')]=0x2;queues[_0x27582f['transfertargetuniqueid']][_0xba54('0x6')]=queues[_0x27582f['origtransfererlinkedid']][_0xba54('0x6')];queues[_0x27582f[_0xba54('0x54')]][_0xba54('0x55')]=queues[_0x27582f[_0xba54('0x4d')]][_0xba54('0x55')];queues[_0x27582f[_0xba54('0x54')]][_0xba54('0x35')]=utils['now']();queues[_0x27582f[_0xba54('0x54')]][_0xba54('0x1a')]=utils[_0xba54('0x15')]();queues[_0x27582f[_0xba54('0x54')]][_0xba54('0x5e')]=0x0;queues[_0x27582f[_0xba54('0x54')]]['mohtime']=0x0;utils[_0xba54('0x1')](util[_0xba54('0x2')](_0xba54('0x5f'),_0x27582f[_0xba54('0x4c')],queues[_0x27582f[_0xba54('0x54')]][_0xba54('0x1f')],queues[_0x27582f[_0xba54('0x54')]][_0xba54('0xd')],queues[_0x27582f[_0xba54('0x54')]]['calleridnum'],queues[_0x27582f['transfertargetuniqueid']]['calleridname']));}else{utils[_0xba54('0x1')](util['format'](_0xba54('0x58'),_0x27582f[_0xba54('0x4c')],queues[_0x27582f[_0xba54('0x4e')]][_0xba54('0x1f')],_0x27582f[_0xba54('0x4d')]));queues[_0x27582f[_0xba54('0x4e')]][_0xba54('0xd')]=_0x27582f[_0xba54('0x4d')];}}}}catch(_0xe44e77){utils[_0xba54('0x16')](util['format'](_0xba54('0x4b'),_0x27582f['origtransfereruniqueid']),_0xe44e77);}};exports[_0xba54('0x60')]=function(_0x5cefb6){try{if(!_['isNil'](queues[_0x5cefb6[_0xba54('0x11')]])){utils['debug'](util['format'](_0xba54('0x61'),_0x5cefb6[_0xba54('0x11')]),_0x5cefb6);queues[_0x5cefb6[_0xba54('0x11')]][_0xba54('0x62')]=utils[_0xba54('0x15')]();utils[_0xba54('0x1')](util['format']('[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s',_0x5cefb6['uniqueid'],queues[_0x5cefb6[_0xba54('0x11')]]['name'],queues[_0x5cefb6[_0xba54('0x11')]]['musiconholdstartAt']));}}catch(_0x3e483d){utils['error'](util[_0xba54('0x2')](_0xba54('0x61'),_0x5cefb6[_0xba54('0x11')]),_0x3e483d);}};exports[_0xba54('0x63')]=function(_0x5e3d63){try{if(!_[_0xba54('0x18')](queues[_0x5e3d63[_0xba54('0x11')]])){if(!_[_0xba54('0x18')](queues[_0x5e3d63[_0xba54('0x11')]][_0xba54('0x62')])){utils[_0xba54('0xf')](util[_0xba54('0x2')](_0xba54('0x64'),_0x5e3d63['uniqueid']),_0x5e3d63);queues[_0x5e3d63[_0xba54('0x11')]][_0xba54('0x56')]+=utils[_0xba54('0x34')](utils[_0xba54('0x15')](),queues[_0x5e3d63[_0xba54('0x11')]]['musiconholdstartAt']);utils[_0xba54('0x1')](util['format']('[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s',_0x5e3d63[_0xba54('0x11')],queues[_0x5e3d63[_0xba54('0x11')]]['name'],queues[_0x5e3d63[_0xba54('0x11')]][_0xba54('0x56')]));delete queues[_0x5e3d63[_0xba54('0x11')]][_0xba54('0x62')];}}}catch(_0xa77f28){utils[_0xba54('0x16')](util['format'](_0xba54('0x64'),_0x5e3d63[_0xba54('0x11')]),_0xa77f28);}}; \ No newline at end of file +var _0xb43a=['[%s][queues][musiconholdstart]','musiconholdstartAt','musiconholdstop','[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s','[%s][queues][musiconholdstop]','lodash','util','./utils','info','format','uniqueid','queue','lastAssignedTo','accountcode','getVoiceQueueByName','then','type','CreateVoiceQueueReport','request','transfereduniqueid','queuecallerjoin','debug','[%s][queues][queuecallerjoin]','[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s','position','assign','error','hangup','isNil','queuecallerexit','queuecallercomplete','queuecallercompleteAt','now','queuecallerexitreason','[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s','name','[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s','varset','[%s][queues][varset]','variable','value','toUpperCase','queuecallerabandon','queuecallerexitAt','[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s','queuecallerabandonAt','EXITWITHKEY','[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s','[%s][queues][queuecallerabandon]','ABANDONED','[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s','connectedlinenum','connectedlinename','queuecallerleaveAt','diffTime','queuecallerjoinAt','count','[%s][queues][queuecallerleave]','agentconnect','[%s][queues][agentconnect]','[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s','membername','destaccountcode','agentcomplete','[%s][queues][agentcomplete]','TRANSFER','COMPLETEDBY','reason','[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s','blindtransfer','[%s][queues][blindtransfer]','transfereeuniqueid','transfer','transfertype','BLIND','transferexten','extension','transferuniqueid','BLINDTRANSFER','[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER','attendedtransfer','[%s][queues][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid','secondtransfererlinkedid','[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','origtransfererexten','ATTENDED','ATTENDEDTRANSFER','transfereelinkedid','clone','transfertargetuniqueid','queuecallerenterreason','calleridnum','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','musiconholdstart'];(function(_0x50b66a,_0x2dcb6f){var _0x4ea135=function(_0x46328f){while(--_0x46328f){_0x50b66a['push'](_0x50b66a['shift']());}};_0x4ea135(++_0x2dcb6f);}(_0xb43a,0xd7));var _0xab43=function(_0x383dbb,_0x17d41b){_0x383dbb=_0x383dbb-0x0;var _0x6e8bde=_0xb43a[_0x383dbb];return _0x6e8bde;};'use strict';var _=require(_0xab43('0x0'));var util=require(_0xab43('0x1'));var utils=require(_0xab43('0x2'));var queues={};function writeDB(_0x1233b9){utils[_0xab43('0x3')](util[_0xab43('0x4')]('[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s',_0x1233b9[_0xab43('0x5')],_0x1233b9['channel'],_0x1233b9[_0xab43('0x6')],_0x1233b9[_0xab43('0x7')],_0x1233b9['calleridnum'],_0x1233b9[_0xab43('0x8')],_0x1233b9['queuecallerexitreason']));if(_0x1233b9[_0xab43('0x6')]){utils[_0xab43('0x9')](_0x1233b9[_0xab43('0x6')])[_0xab43('0xa')](function(_0x177c3a){if(_0x177c3a){_0x1233b9[_0xab43('0xb')]=_0x177c3a[_0xab43('0xb')];}utils['request'](_0xab43('0xc'),_0x1233b9);});}else{utils[_0xab43('0xd')]('CreateVoiceQueueReport',_0x1233b9);}if(_0x1233b9['transfereduniqueid']){delete queues[_0x1233b9[_0xab43('0xe')]];}else{delete queues[_0x1233b9[_0xab43('0x5')]];}}exports[_0xab43('0xf')]=function(_0x5bc1ae){try{utils[_0xab43('0x10')](util['format'](_0xab43('0x11'),_0x5bc1ae[_0xab43('0x5')]),_0x5bc1ae);utils[_0xab43('0x3')](util['format'](_0xab43('0x12'),_0x5bc1ae[_0xab43('0x5')],_0x5bc1ae[_0xab43('0x6')],_0x5bc1ae[_0xab43('0x13')]));queues[_0x5bc1ae['uniqueid']]=_[_0xab43('0x14')](_0x5bc1ae,{'originalposition':_0x5bc1ae['position'],'queuecallerjoinAt':utils['now'](),'mohtime':0x0});}catch(_0x3987b3){utils[_0xab43('0x15')](util['format'](_0xab43('0x11'),_0x5bc1ae[_0xab43('0x5')]),_0x3987b3);}};exports[_0xab43('0x16')]=function(_0x2c7f9d){try{if(!_[_0xab43('0x17')](queues[_0x2c7f9d[_0xab43('0x5')]])){utils['debug'](util[_0xab43('0x4')]('[%s][queues][hangup]',_0x2c7f9d[_0xab43('0x5')]),_0x2c7f9d);if(queues[_0x2c7f9d['uniqueid']]['queuecallerleaveAt']){if(!queues[_0x2c7f9d[_0xab43('0x5')]]['queuecallerabandon']&&!queues[_0x2c7f9d[_0xab43('0x5')]][_0xab43('0x18')]){queues[_0x2c7f9d[_0xab43('0x5')]][_0xab43('0x19')]=!![];queues[_0x2c7f9d['uniqueid']][_0xab43('0x1a')]=utils[_0xab43('0x1b')]();queues[_0x2c7f9d[_0xab43('0x5')]][_0xab43('0x1c')]='COMPLETEDBYAGENT';}utils[_0xab43('0x3')](util[_0xab43('0x4')](_0xab43('0x1d'),_0x2c7f9d['uniqueid'],queues[_0x2c7f9d[_0xab43('0x5')]][_0xab43('0x1e')],queues[_0x2c7f9d[_0xab43('0x5')]][_0xab43('0x1c')]));writeDB(queues[_0x2c7f9d[_0xab43('0x5')]]);}else if(queues[_0x2c7f9d[_0xab43('0x5')]][_0xab43('0xe')]){utils[_0xab43('0x3')](util[_0xab43('0x4')](_0xab43('0x1f'),_0x2c7f9d['uniqueid'],queues[_0x2c7f9d[_0xab43('0x5')]][_0xab43('0x1e')],queues[_0x2c7f9d[_0xab43('0x5')]]['transfereduniqueid']));queues[queues[_0x2c7f9d[_0xab43('0x5')]]['transfereduniqueid']]=queues[_0x2c7f9d['uniqueid']];queues[queues[_0x2c7f9d[_0xab43('0x5')]][_0xab43('0xe')]]['queuecallerenterreason']=0x2;delete queues[_0x2c7f9d[_0xab43('0x5')]];}}}catch(_0x313242){utils[_0xab43('0x15')](util['format']('[%s][queues][hangup]',_0x2c7f9d['uniqueid']),_0x313242);}};exports[_0xab43('0x20')]=function(_0x375599){try{utils[_0xab43('0x10')](util[_0xab43('0x4')](_0xab43('0x21'),_0x375599[_0xab43('0x5')]),_0x375599);if(!_['isNil'](_0x375599[_0xab43('0x22')]['queuestatus'])&&_0x375599[_0xab43('0x23')][_0xab43('0x24')]()!=='CONTINUE'){if(!_[_0xab43('0x17')](queues[_0x375599[_0xab43('0x5')]])){queues[_0x375599[_0xab43('0x5')]][_0xab43('0x25')]=![];queues[_0x375599[_0xab43('0x5')]]['queuecallerabandonAt']=null;queues[_0x375599['uniqueid']][_0xab43('0x18')]=!![];queues[_0x375599[_0xab43('0x5')]][_0xab43('0x26')]=utils['now']();queues[_0x375599[_0xab43('0x5')]][_0xab43('0x1c')]=_0x375599[_0xab43('0x23')][_0xab43('0x24')]();utils[_0xab43('0x3')](util[_0xab43('0x4')](_0xab43('0x27'),_0x375599[_0xab43('0x5')],queues[_0x375599[_0xab43('0x5')]]['name'],_0x375599[_0xab43('0x23')],queues[_0x375599[_0xab43('0x5')]]['queuecallerexitreason']));writeDB(queues[_0x375599[_0xab43('0x5')]]);}}else if(!_[_0xab43('0x17')](_0x375599[_0xab43('0x22')]['queueposition'])){if(!_[_0xab43('0x17')](queues[_0x375599['uniqueid']])&&!queues[_0x375599[_0xab43('0x5')]][_0xab43('0x25')]){queues[_0x375599['uniqueid']][_0xab43('0x25')]=![];queues[_0x375599[_0xab43('0x5')]][_0xab43('0x28')]=null;queues[_0x375599[_0xab43('0x5')]][_0xab43('0x18')]=!![];queues[_0x375599[_0xab43('0x5')]][_0xab43('0x26')]=utils['now']();queues[_0x375599[_0xab43('0x5')]][_0xab43('0x1c')]=_0xab43('0x29');utils[_0xab43('0x3')](util[_0xab43('0x4')](_0xab43('0x2a'),_0x375599[_0xab43('0x5')],queues[_0x375599['uniqueid']]['name'],_0x375599['value'],queues[_0x375599[_0xab43('0x5')]]['queuecallerexitreason']));}}}catch(_0x516260){utils[_0xab43('0x15')](util['format']('[%s][queues][varset]',_0x375599[_0xab43('0x5')]),_0x516260);}};exports[_0xab43('0x25')]=function(_0x4cf32b){try{if(!_[_0xab43('0x17')](queues[_0x4cf32b['uniqueid']])){utils[_0xab43('0x10')](util[_0xab43('0x4')](_0xab43('0x2b'),_0x4cf32b[_0xab43('0x5')]),_0x4cf32b);queues[_0x4cf32b[_0xab43('0x5')]][_0xab43('0x18')]=![];queues[_0x4cf32b[_0xab43('0x5')]][_0xab43('0x26')]=null;queues[_0x4cf32b[_0xab43('0x5')]][_0xab43('0x25')]=!![];queues[_0x4cf32b[_0xab43('0x5')]][_0xab43('0x28')]=utils[_0xab43('0x1b')]();queues[_0x4cf32b[_0xab43('0x5')]][_0xab43('0x1c')]=_0xab43('0x2c');utils[_0xab43('0x3')](util[_0xab43('0x4')]('[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s',_0x4cf32b[_0xab43('0x5')],queues[_0x4cf32b[_0xab43('0x5')]][_0xab43('0x1e')],queues[_0x4cf32b[_0xab43('0x5')]][_0xab43('0x1c')]));}}catch(_0x2cb6a1){utils['error'](util[_0xab43('0x4')]('[%s][queues][queuecallerabandon]',_0x4cf32b[_0xab43('0x5')]),_0x2cb6a1);}};exports['queuecallerleave']=function(_0x163f32){try{if(!_[_0xab43('0x17')](queues[_0x163f32[_0xab43('0x5')]])){utils[_0xab43('0x10')](util[_0xab43('0x4')]('[%s][queues][queuecallerleave]',_0x163f32[_0xab43('0x5')]),_0x163f32);utils[_0xab43('0x3')](util[_0xab43('0x4')](_0xab43('0x2d'),_0x163f32[_0xab43('0x5')],queues[_0x163f32[_0xab43('0x5')]][_0xab43('0x1e')],_0x163f32[_0xab43('0x2e')],_0x163f32[_0xab43('0x2f')]));queues[_0x163f32[_0xab43('0x5')]]['queuecallerleave']=!![];queues[_0x163f32['uniqueid']][_0xab43('0x30')]=utils[_0xab43('0x1b')]();queues[_0x163f32['uniqueid']]['holdtime']=utils[_0xab43('0x31')](queues[_0x163f32[_0xab43('0x5')]][_0xab43('0x30')],queues[_0x163f32['uniqueid']][_0xab43('0x32')]);queues[_0x163f32[_0xab43('0x5')]][_0xab43('0x13')]=_0x163f32['position'];queues[_0x163f32[_0xab43('0x5')]][_0xab43('0x33')]=_0x163f32[_0xab43('0x33')];queues[_0x163f32['uniqueid']][_0xab43('0x2e')]=_0x163f32[_0xab43('0x2e')];queues[_0x163f32[_0xab43('0x5')]][_0xab43('0x2f')]=_0x163f32[_0xab43('0x2f')];}}catch(_0x49e247){utils['error'](util['format'](_0xab43('0x34'),_0x163f32['uniqueid']),_0x49e247);}};exports[_0xab43('0x35')]=function(_0x246657){try{if(!_[_0xab43('0x17')](queues[_0x246657['uniqueid']])){utils['debug'](util['format'](_0xab43('0x36'),_0x246657[_0xab43('0x5')]),_0x246657);utils[_0xab43('0x3')](util['format'](_0xab43('0x37'),_0x246657[_0xab43('0x5')],queues[_0x246657[_0xab43('0x5')]][_0xab43('0x1e')],_0x246657[_0xab43('0x38')],_0x246657[_0xab43('0x39')]));queues[_0x246657[_0xab43('0x5')]][_0xab43('0x25')]=![];queues[_0x246657['uniqueid']][_0xab43('0x25')]=![];queues[_0x246657['uniqueid']]['queuecallerabandonAt']=null;queues[_0x246657[_0xab43('0x5')]][_0xab43('0x18')]=![];queues[_0x246657['uniqueid']][_0xab43('0x1c')]=null;queues[_0x246657[_0xab43('0x5')]][_0xab43('0x26')]=null;queues[_0x246657[_0xab43('0x5')]]['assigned']=!![];queues[_0x246657['uniqueid']]['accountcode']=_0x246657[_0xab43('0x39')];queues[_0x246657[_0xab43('0x5')]][_0xab43('0x7')]=_0x246657[_0xab43('0x38')];}}catch(_0x4825ae){utils[_0xab43('0x15')](util[_0xab43('0x4')](_0xab43('0x36'),_0x246657[_0xab43('0x5')]),_0x4825ae);}};exports[_0xab43('0x3a')]=function(_0x14e6aa){try{if(!_[_0xab43('0x17')](queues[_0x14e6aa[_0xab43('0x5')]])){if(queues[_0x14e6aa[_0xab43('0x5')]][_0xab43('0x30')]){utils[_0xab43('0x10')](util[_0xab43('0x4')](_0xab43('0x3b'),_0x14e6aa['uniqueid']),_0x14e6aa);queues[_0x14e6aa[_0xab43('0x5')]][_0xab43('0x25')]=![];queues[_0x14e6aa[_0xab43('0x5')]][_0xab43('0x25')]=![];queues[_0x14e6aa[_0xab43('0x5')]][_0xab43('0x28')]=null;queues[_0x14e6aa['uniqueid']][_0xab43('0x18')]=![];queues[_0x14e6aa[_0xab43('0x5')]][_0xab43('0x26')]=null;queues[_0x14e6aa['uniqueid']]['assigned']=!![];queues[_0x14e6aa[_0xab43('0x5')]][_0xab43('0x7')]=_0x14e6aa['membername'];queues[_0x14e6aa['uniqueid']][_0xab43('0x19')]=!![];queues[_0x14e6aa[_0xab43('0x5')]][_0xab43('0x1a')]=utils['now']();if(_0x14e6aa['reason']=='transfer'){if(!queues[_0x14e6aa[_0xab43('0x5')]]['transfer']){queues[_0x14e6aa['uniqueid']][_0xab43('0x1c')]=_0xab43('0x3c');}}else{queues[_0x14e6aa['uniqueid']][_0xab43('0x1c')]=_0xab43('0x3d')+_0x14e6aa[_0xab43('0x3e')][_0xab43('0x24')]();}utils[_0xab43('0x3')](util[_0xab43('0x4')](_0xab43('0x3f'),_0x14e6aa[_0xab43('0x5')],queues[_0x14e6aa[_0xab43('0x5')]]['name'],_0x14e6aa[_0xab43('0x38')],queues[_0x14e6aa['uniqueid']]['queuecallerexitreason']));writeDB(queues[_0x14e6aa[_0xab43('0x5')]]);}}}catch(_0x48b540){utils[_0xab43('0x15')](util[_0xab43('0x4')](_0xab43('0x3b'),_0x14e6aa[_0xab43('0x5')]),_0x48b540);}};exports[_0xab43('0x40')]=function(_0x4baeb4){try{if(!_[_0xab43('0x17')](queues[_0x4baeb4['transfereeuniqueid']])){utils[_0xab43('0x10')](util[_0xab43('0x4')](_0xab43('0x41'),_0x4baeb4[_0xab43('0x5')]),_0x4baeb4);queues[_0x4baeb4[_0xab43('0x42')]][_0xab43('0x43')]=!![];queues[_0x4baeb4['transfereeuniqueid']][_0xab43('0x44')]=_0xab43('0x45');queues[_0x4baeb4[_0xab43('0x42')]][_0xab43('0x46')]=_0x4baeb4[_0xab43('0x47')];queues[_0x4baeb4[_0xab43('0x42')]][_0xab43('0x48')]=_0x4baeb4['transfereeuniqueid'];queues[_0x4baeb4[_0xab43('0x42')]]['queuecallerexitreason']=_0xab43('0x49');utils[_0xab43('0x3')](util[_0xab43('0x4')](_0xab43('0x4a'),_0x4baeb4['uniqueid'],queues[_0x4baeb4[_0xab43('0x42')]][_0xab43('0x1e')],_0x4baeb4[_0xab43('0x42')],_0x4baeb4[_0xab43('0x47')]));}}catch(_0x38b046){utils['error'](util[_0xab43('0x4')](_0xab43('0x41'),_0x4baeb4[_0xab43('0x5')]),_0x38b046);}};exports[_0xab43('0x4b')]=function(_0x15922b){try{utils[_0xab43('0x10')](util[_0xab43('0x4')](_0xab43('0x4c'),_0x15922b[_0xab43('0x4d')]),_0x15922b);if(_0x15922b['origtransfereruniqueid']==_0x15922b[_0xab43('0x4e')]){if(!_[_0xab43('0x17')](queues[_0x15922b[_0xab43('0x4f')]])){utils[_0xab43('0x3')](util['format'](_0xab43('0x50'),_0x15922b[_0xab43('0x4d')],queues[_0x15922b[_0xab43('0x4f')]][_0xab43('0x1e')],_0x15922b[_0xab43('0x51')]));queues[_0x15922b[_0xab43('0x4f')]]['transfer']=!![];queues[_0x15922b[_0xab43('0x4f')]][_0xab43('0x44')]=_0xab43('0x52');queues[_0x15922b[_0xab43('0x4f')]][_0xab43('0x46')]=_0x15922b[_0xab43('0x51')];queues[_0x15922b[_0xab43('0x4f')]]['transferuniqueid']=_0x15922b[_0xab43('0x4d')];queues[_0x15922b[_0xab43('0x4f')]][_0xab43('0x1c')]=_0xab43('0x53');}if(!_[_0xab43('0x17')](queues[_0x15922b['origtransfererlinkedid']])){if(_0x15922b[_0xab43('0x54')]&&queues[_0x15922b[_0xab43('0x54')]]){queues[_0x15922b['transfereelinkedid']]['queuecallerenterreason']=0x1;queues[_0x15922b[_0xab43('0x42')]]=_[_0xab43('0x55')](queues[_0x15922b[_0xab43('0x54')]]);queues[_0x15922b[_0xab43('0x42')]][_0xab43('0xe')]=_0x15922b[_0xab43('0x56')];queues[_0x15922b[_0xab43('0x42')]][_0xab43('0x57')]=0x2;queues[_0x15922b[_0xab43('0x42')]][_0xab43('0x58')]=queues[_0x15922b[_0xab43('0x4f')]][_0xab43('0x58')];queues[_0x15922b[_0xab43('0x42')]][_0xab43('0x59')]=queues[_0x15922b[_0xab43('0x4f')]]['calleridname'];queues[_0x15922b[_0xab43('0x42')]][_0xab43('0x32')]=utils[_0xab43('0x1b')]();queues[_0x15922b['transfereeuniqueid']][_0xab43('0x30')]=utils[_0xab43('0x1b')]();queues[_0x15922b[_0xab43('0x42')]][_0xab43('0x5a')]=0x0;queues[_0x15922b[_0xab43('0x42')]][_0xab43('0x5b')]=0x0;utils[_0xab43('0x3')](util[_0xab43('0x4')](_0xab43('0x5c'),_0x15922b[_0xab43('0x4d')],queues[_0x15922b[_0xab43('0x42')]]['name'],queues[_0x15922b[_0xab43('0x42')]]['calleridnum'],queues[_0x15922b['transfereeuniqueid']]['calleridname']));}else{utils[_0xab43('0x3')](util[_0xab43('0x4')](_0xab43('0x5d'),_0x15922b[_0xab43('0x4d')],queues[_0x15922b['origtransfererlinkedid']][_0xab43('0x1e')],_0x15922b[_0xab43('0x4f')]));queues[_0x15922b[_0xab43('0x4e')]]['transfereduniqueid']=_0x15922b[_0xab43('0x4f')];}}}else if(_0x15922b[_0xab43('0x5e')]==_0x15922b['secondtransfererlinkedid']){if(!_[_0xab43('0x17')](queues[_0x15922b[_0xab43('0x4e')]])){utils[_0xab43('0x3')](util[_0xab43('0x4')](_0xab43('0x5f'),_0x15922b[_0xab43('0x4d')],queues[_0x15922b[_0xab43('0x4e')]][_0xab43('0x1e')],_0x15922b[_0xab43('0x5e')],_0x15922b[_0xab43('0x60')]));queues[_0x15922b[_0xab43('0x4e')]][_0xab43('0x43')]=!![];queues[_0x15922b[_0xab43('0x4e')]][_0xab43('0x44')]=_0xab43('0x52');queues[_0x15922b[_0xab43('0x4e')]]['transferexten']=_0x15922b[_0xab43('0x60')];queues[_0x15922b['origtransfererlinkedid']][_0xab43('0x48')]=_0x15922b[_0xab43('0x5e')];queues[_0x15922b['origtransfererlinkedid']][_0xab43('0x1c')]=_0xab43('0x53');}if(!_['isNil'](queues[_0x15922b[_0xab43('0x4f')]])){if(_0x15922b[_0xab43('0x61')]&&queues[_0x15922b[_0xab43('0x61')]]){queues[_0x15922b['transfertargetlinkedid']][_0xab43('0x57')]=0x1;queues[_0x15922b['transfertargetuniqueid']]=_['clone'](queues[_0x15922b[_0xab43('0x61')]]);queues[_0x15922b[_0xab43('0x56')]]['transfereduniqueid']=_0x15922b[_0xab43('0x56')];queues[_0x15922b[_0xab43('0x56')]][_0xab43('0x57')]=0x2;queues[_0x15922b[_0xab43('0x56')]][_0xab43('0x58')]=queues[_0x15922b[_0xab43('0x4e')]][_0xab43('0x58')];queues[_0x15922b['transfertargetuniqueid']]['calleridname']=queues[_0x15922b['origtransfererlinkedid']][_0xab43('0x59')];queues[_0x15922b[_0xab43('0x56')]][_0xab43('0x32')]=utils[_0xab43('0x1b')]();queues[_0x15922b[_0xab43('0x56')]]['queuecallerleaveAt']=utils[_0xab43('0x1b')]();queues[_0x15922b[_0xab43('0x56')]][_0xab43('0x5a')]=0x0;queues[_0x15922b['transfertargetuniqueid']]['mohtime']=0x0;utils[_0xab43('0x3')](util[_0xab43('0x4')](_0xab43('0x62'),_0x15922b['origtransfereruniqueid'],queues[_0x15922b[_0xab43('0x56')]]['name'],queues[_0x15922b[_0xab43('0x56')]][_0xab43('0xe')],queues[_0x15922b[_0xab43('0x56')]][_0xab43('0x58')],queues[_0x15922b[_0xab43('0x56')]][_0xab43('0x59')]));}else{utils[_0xab43('0x3')](util[_0xab43('0x4')](_0xab43('0x5d'),_0x15922b[_0xab43('0x4d')],queues[_0x15922b[_0xab43('0x4f')]][_0xab43('0x1e')],_0x15922b[_0xab43('0x4e')]));queues[_0x15922b[_0xab43('0x4f')]][_0xab43('0xe')]=_0x15922b[_0xab43('0x4e')];}}}}catch(_0x46d62e){utils[_0xab43('0x15')](util[_0xab43('0x4')](_0xab43('0x4c'),_0x15922b['origtransfereruniqueid']),_0x46d62e);}};exports[_0xab43('0x63')]=function(_0x2edf76){try{if(!_[_0xab43('0x17')](queues[_0x2edf76['uniqueid']])){utils[_0xab43('0x10')](util[_0xab43('0x4')](_0xab43('0x64'),_0x2edf76[_0xab43('0x5')]),_0x2edf76);queues[_0x2edf76['uniqueid']]['musiconholdstartAt']=utils[_0xab43('0x1b')]();utils[_0xab43('0x3')](util['format']('[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s',_0x2edf76[_0xab43('0x5')],queues[_0x2edf76[_0xab43('0x5')]][_0xab43('0x1e')],queues[_0x2edf76[_0xab43('0x5')]][_0xab43('0x65')]));}}catch(_0x15de2f){utils[_0xab43('0x15')](util[_0xab43('0x4')](_0xab43('0x64'),_0x2edf76[_0xab43('0x5')]),_0x15de2f);}};exports[_0xab43('0x66')]=function(_0x3c41fe){try{if(!_['isNil'](queues[_0x3c41fe[_0xab43('0x5')]])){if(!_[_0xab43('0x17')](queues[_0x3c41fe[_0xab43('0x5')]]['musiconholdstartAt'])){utils['debug'](util[_0xab43('0x4')]('[%s][queues][musiconholdstop]',_0x3c41fe[_0xab43('0x5')]),_0x3c41fe);queues[_0x3c41fe['uniqueid']]['mohtime']+=utils[_0xab43('0x31')](utils['now'](),queues[_0x3c41fe[_0xab43('0x5')]][_0xab43('0x65')]);utils[_0xab43('0x3')](util[_0xab43('0x4')](_0xab43('0x67'),_0x3c41fe[_0xab43('0x5')],queues[_0x3c41fe[_0xab43('0x5')]][_0xab43('0x1e')],queues[_0x3c41fe[_0xab43('0x5')]][_0xab43('0x5b')]));delete queues[_0x3c41fe[_0xab43('0x5')]]['musiconholdstartAt'];}}}catch(_0x1b6159){utils[_0xab43('0x15')](util[_0xab43('0x4')](_0xab43('0x68'),_0x3c41fe[_0xab43('0x5')]),_0x1b6159);}}; \ No newline at end of file diff --git a/server/services/xdr/recordings.controller.js b/server/services/xdr/recordings.controller.js index 4f1f4ff..8551b85 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 _0x2b30=['monitors','push','[%s][recordings][varset]','[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s','calleridnum','calleridname','cause-txt','connectedlinenum','connectedlinename','outbound','clone','[%s][recordings][hangup]','newexten','[%s][recordings][newexten]','[%s][recordings][newexten]\x20application:%s\x20appdata:%s','application','appdata','toLowerCase','set','cdr','split','substring','lastIndexOf','queuecallerjoin','[%s][recordings][queuecallerjoin]','[%s][recordings][queuecallerjoin]\x20queue:%s','queue','util','./utils','format','uniqueid','accountcode','getUserByInternal','then','request','CreateVoiceRecording','newchannel','debug','[%s][recordings][newchannel]','info','[%s][recordings][newchannel]\x20context:%s\x20exten:%s','context','exten','error','newstate','[%s][recordings][newstate]','channelstate','channel','isNil','linkedid','transfer','[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','varset','mixmonitor_filename','[%s][recordings][varset]\x20variable:%s\x20value:%s','variable','value','endsWith','.wav49','find'];(function(_0x1fca6c,_0x2fe522){var _0xadf36d=function(_0x873ebf){while(--_0x873ebf){_0x1fca6c['push'](_0x1fca6c['shift']());}};_0xadf36d(++_0x2fe522);}(_0x2b30,0x10b));var _0x02b3=function(_0x52b0ae,_0x9307d7){_0x52b0ae=_0x52b0ae-0x0;var _0x4adf82=_0x2b30[_0x52b0ae];return _0x4adf82;};'use strict';var _=require('lodash');var util=require(_0x02b3('0x0'));var utils=require(_0x02b3('0x1'));var recordings={};function writeDB(_0x197635){utils['info'](util[_0x02b3('0x2')]('[%s][recordings][writeDB]',_0x197635[_0x02b3('0x3')]));if(_0x197635[_0x02b3('0x4')]){utils[_0x02b3('0x5')](_0x197635['accountcode'])[_0x02b3('0x6')](function(_0x1b5bb1){if(_0x1b5bb1){_0x197635['membername']=_0x1b5bb1['name'];_0x197635['UserId']=_0x1b5bb1['id'];}utils[_0x02b3('0x7')](_0x02b3('0x8'),_0x197635);});}else{utils[_0x02b3('0x7')](_0x02b3('0x8'),_0x197635);}}exports[_0x02b3('0x9')]=function(_0x51fb8f){try{utils[_0x02b3('0xa')](util[_0x02b3('0x2')](_0x02b3('0xb'),_0x51fb8f['uniqueid']),_0x51fb8f);if(_0x51fb8f[_0x02b3('0x3')]==_0x51fb8f['linkedid']){utils[_0x02b3('0xc')](util[_0x02b3('0x2')](_0x02b3('0xd'),_0x51fb8f[_0x02b3('0x3')],_0x51fb8f[_0x02b3('0xe')],_0x51fb8f[_0x02b3('0xf')]));recordings[_0x51fb8f['uniqueid']]={'uniqueid':_0x51fb8f[_0x02b3('0x3')],'accountcode':_0x51fb8f['accountcode'],'exten':_0x51fb8f[_0x02b3('0xf')],'context':_0x51fb8f['context'],'channel':_0x51fb8f['channel'],'monitors':[]};}}catch(_0x5210f0){utils[_0x02b3('0x10')](util['format'](_0x02b3('0xb'),_0x51fb8f[_0x02b3('0x3')]),_0x5210f0);}};exports[_0x02b3('0x11')]=function(_0x2136bb){try{utils[_0x02b3('0xa')](util[_0x02b3('0x2')](_0x02b3('0x12'),_0x2136bb[_0x02b3('0x3')]),_0x2136bb);if(!_['isNil'](recordings[_0x2136bb[_0x02b3('0x3')]])&&_0x2136bb[_0x02b3('0x13')]==0x6){utils[_0x02b3('0xc')](util['format']('[%s][recordings][newstate]\x20context:%s\x20channel:%s',_0x2136bb[_0x02b3('0x3')],_0x2136bb['context'],_0x2136bb[_0x02b3('0x14')]));}else if(!_[_0x02b3('0x15')](recordings[_0x2136bb[_0x02b3('0x16')]])&&_0x2136bb['channelstate']==0x6&&_0x2136bb['context']!=_0x02b3('0x17')){utils[_0x02b3('0xc')](util['format'](_0x02b3('0x18'),_0x2136bb[_0x02b3('0x3')],_0x2136bb[_0x02b3('0x16')],_0x2136bb[_0x02b3('0xe')],_0x2136bb[_0x02b3('0x14')]));recordings[_0x2136bb[_0x02b3('0x16')]][_0x02b3('0x4')]=_0x2136bb[_0x02b3('0x4')];}}catch(_0xa210c8){utils[_0x02b3('0x10')](util[_0x02b3('0x2')](_0x02b3('0x12'),_0x2136bb[_0x02b3('0x3')]),_0xa210c8);}};exports[_0x02b3('0x19')]=function(_0xa9cfab){try{if(!_[_0x02b3('0x15')](_0xa9cfab['variable'])&&!_[_0x02b3('0x15')](_0xa9cfab['variable'][_0x02b3('0x1a')])){utils['debug'](util[_0x02b3('0x2')]('[%s][recordings][varset]',_0xa9cfab[_0x02b3('0x3')]),_0xa9cfab);utils[_0x02b3('0xc')](util['format'](_0x02b3('0x1b'),_0xa9cfab[_0x02b3('0x3')],_0xa9cfab[_0x02b3('0x1c')],_0xa9cfab[_0x02b3('0x1d')]));if(_[_0x02b3('0x1e')](_0xa9cfab[_0x02b3('0x1d')],_0x02b3('0x1f'))){_0xa9cfab[_0x02b3('0x1d')]=_0xa9cfab['value']['replace'](_0x02b3('0x1f'),'.WAV');}if(recordings[_0xa9cfab[_0x02b3('0x16')]]){var _0x567328=_[_0x02b3('0x20')](recordings[_0xa9cfab['linkedid']][_0x02b3('0x21')],{'value':_0xa9cfab[_0x02b3('0x1d')]});if(_[_0x02b3('0x15')](_0x567328)){recordings[_0xa9cfab[_0x02b3('0x16')]][_0x02b3('0x21')][_0x02b3('0x22')]({'value':_0xa9cfab[_0x02b3('0x1d')]});}}}}catch(_0x547b5b){utils['error'](util[_0x02b3('0x2')](_0x02b3('0x23'),_0xa9cfab[_0x02b3('0x3')]),_0x547b5b);}};exports['hangup']=function(_0x1b4a70){try{if(!_[_0x02b3('0x15')](recordings[_0x1b4a70[_0x02b3('0x3')]])){utils[_0x02b3('0xa')](util[_0x02b3('0x2')]('[%s][recordings][hangup]',_0x1b4a70['uniqueid']),_0x1b4a70);utils[_0x02b3('0xc')](util['format'](_0x02b3('0x24'),_0x1b4a70[_0x02b3('0x3')],_0x1b4a70[_0x02b3('0x25')],_0x1b4a70[_0x02b3('0x26')],_0x1b4a70[_0x02b3('0x27')]));recordings[_0x1b4a70[_0x02b3('0x3')]][_0x02b3('0x25')]=_0x1b4a70[_0x02b3('0x25')];recordings[_0x1b4a70[_0x02b3('0x3')]][_0x02b3('0x26')]=_0x1b4a70[_0x02b3('0x26')];recordings[_0x1b4a70['uniqueid']][_0x02b3('0x28')]=_0x1b4a70['connectedlinenum'];recordings[_0x1b4a70[_0x02b3('0x3')]][_0x02b3('0x29')]=_0x1b4a70[_0x02b3('0x29')];if(recordings[_0x1b4a70[_0x02b3('0x3')]]['type']==_0x02b3('0x2a')&&recordings[_0x1b4a70[_0x02b3('0x3')]][_0x02b3('0x4')]){recordings[_0x1b4a70[_0x02b3('0x3')]][_0x02b3('0x28')]=recordings[_0x1b4a70['uniqueid']]['accountcode'];recordings[_0x1b4a70[_0x02b3('0x3')]][_0x02b3('0x29')]='';}recordings[_0x1b4a70[_0x02b3('0x3')]][_0x02b3('0x21')]['forEach'](function(_0x412523){var _0x48d31d=_[_0x02b3('0x2b')](recordings[_0x1b4a70[_0x02b3('0x3')]]);_0x48d31d[_0x02b3('0x1d')]=_0x412523['value'];writeDB(_0x48d31d);});delete recordings[_0x1b4a70['uniqueid']];}}catch(_0x217f3c){utils[_0x02b3('0x10')](util[_0x02b3('0x2')](_0x02b3('0x2c'),_0x1b4a70['uniqueid']),_0x217f3c);}};exports[_0x02b3('0x2d')]=function(_0x38d9ec){try{if(!_[_0x02b3('0x15')](recordings[_0x38d9ec[_0x02b3('0x3')]])){utils[_0x02b3('0xa')](util['format'](_0x02b3('0x2e'),_0x38d9ec[_0x02b3('0x3')]),_0x38d9ec);utils[_0x02b3('0xc')](util[_0x02b3('0x2')](_0x02b3('0x2f'),_0x38d9ec[_0x02b3('0x3')],_0x38d9ec[_0x02b3('0x30')],_0x38d9ec[_0x02b3('0x31')]));if(_0x38d9ec[_0x02b3('0x30')][_0x02b3('0x32')]()==_0x02b3('0x33')&&_['startsWith'](_0x38d9ec['appdata'][_0x02b3('0x32')](),_0x02b3('0x34'))){var _0x27bf3e=_0x38d9ec[_0x02b3('0x31')][_0x02b3('0x35')]('=');var _0x2b3822=_0x27bf3e[0x0][_0x02b3('0x36')](_0x27bf3e[0x0]['lastIndexOf']('(')+0x1,_0x27bf3e[0x0][_0x02b3('0x37')](')'));var _0x407461=_0x27bf3e[0x1];recordings[_0x38d9ec[_0x02b3('0x3')]][_0x2b3822]=_0x407461;}}}catch(_0x57f091){utils['error'](util[_0x02b3('0x2')](_0x02b3('0x2e'),_0x38d9ec[_0x02b3('0x3')]),_0x57f091);}};exports[_0x02b3('0x38')]=function(_0x8fcdb6){try{if(!_[_0x02b3('0x15')](recordings[_0x8fcdb6[_0x02b3('0x3')]])){utils[_0x02b3('0xa')](util['format'](_0x02b3('0x39'),_0x8fcdb6['uniqueid']),_0x8fcdb6);utils[_0x02b3('0xc')](util[_0x02b3('0x2')](_0x02b3('0x3a'),_0x8fcdb6[_0x02b3('0x3')],_0x8fcdb6[_0x02b3('0x3b')]));recordings[_0x8fcdb6[_0x02b3('0x3')]]['queue']=_0x8fcdb6[_0x02b3('0x3b')];}}catch(_0x40c3e5){utils[_0x02b3('0x10')](util['format'](_0x02b3('0x39'),_0x8fcdb6[_0x02b3('0x3')]),_0x40c3e5);}}; \ No newline at end of file +var _0x6cb8=['newexten','[%s][recordings][newexten]','[%s][recordings][newexten]\x20application:%s\x20appdata:%s','application','appdata','toLowerCase','set','lastIndexOf','[%s][recordings][queuecallerjoin]','queue','util','format','uniqueid','accountcode','getUserByInternal','then','name','UserId','CreateVoiceRecording','request','newchannel','[%s][recordings][newchannel]','context','exten','channel','error','newstate','debug','[%s][recordings][newstate]','channelstate','[%s][recordings][newstate]\x20context:%s\x20channel:%s','isNil','[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','linkedid','varset','variable','[%s][recordings][varset]','info','[%s][recordings][varset]\x20variable:%s\x20value:%s','value','endsWith','find','monitors','push','hangup','calleridname','cause-txt','calleridnum','connectedlinenum','type','outbound','connectedlinename','clone','[%s][recordings][hangup]'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6cb8,0x118));var _0x86cb=function(_0x49138a,_0x1bb94c){_0x49138a=_0x49138a-0x0;var _0x3a2a06=_0x6cb8[_0x49138a];return _0x3a2a06;};'use strict';var _=require('lodash');var util=require(_0x86cb('0x0'));var utils=require('./utils');var recordings={};function writeDB(_0x3933de){utils['info'](util[_0x86cb('0x1')]('[%s][recordings][writeDB]',_0x3933de[_0x86cb('0x2')]));if(_0x3933de[_0x86cb('0x3')]){utils[_0x86cb('0x4')](_0x3933de[_0x86cb('0x3')])[_0x86cb('0x5')](function(_0x5bae04){if(_0x5bae04){_0x3933de['membername']=_0x5bae04[_0x86cb('0x6')];_0x3933de[_0x86cb('0x7')]=_0x5bae04['id'];}utils['request'](_0x86cb('0x8'),_0x3933de);});}else{utils[_0x86cb('0x9')]('CreateVoiceRecording',_0x3933de);}}exports[_0x86cb('0xa')]=function(_0x283f9c){try{utils['debug'](util[_0x86cb('0x1')](_0x86cb('0xb'),_0x283f9c[_0x86cb('0x2')]),_0x283f9c);if(_0x283f9c['uniqueid']==_0x283f9c['linkedid']){utils['info'](util['format']('[%s][recordings][newchannel]\x20context:%s\x20exten:%s',_0x283f9c[_0x86cb('0x2')],_0x283f9c[_0x86cb('0xc')],_0x283f9c['exten']));recordings[_0x283f9c[_0x86cb('0x2')]]={'uniqueid':_0x283f9c[_0x86cb('0x2')],'accountcode':_0x283f9c['accountcode'],'exten':_0x283f9c[_0x86cb('0xd')],'context':_0x283f9c[_0x86cb('0xc')],'channel':_0x283f9c[_0x86cb('0xe')],'monitors':[]};}}catch(_0x2f7da8){utils[_0x86cb('0xf')](util[_0x86cb('0x1')](_0x86cb('0xb'),_0x283f9c[_0x86cb('0x2')]),_0x2f7da8);}};exports[_0x86cb('0x10')]=function(_0x175ad6){try{utils[_0x86cb('0x11')](util[_0x86cb('0x1')](_0x86cb('0x12'),_0x175ad6[_0x86cb('0x2')]),_0x175ad6);if(!_['isNil'](recordings[_0x175ad6['uniqueid']])&&_0x175ad6[_0x86cb('0x13')]==0x6){utils['info'](util[_0x86cb('0x1')](_0x86cb('0x14'),_0x175ad6['uniqueid'],_0x175ad6['context'],_0x175ad6['channel']));}else if(!_[_0x86cb('0x15')](recordings[_0x175ad6['linkedid']])&&_0x175ad6[_0x86cb('0x13')]==0x6&&_0x175ad6['context']!='transfer'){utils['info'](util[_0x86cb('0x1')](_0x86cb('0x16'),_0x175ad6['uniqueid'],_0x175ad6[_0x86cb('0x17')],_0x175ad6[_0x86cb('0xc')],_0x175ad6[_0x86cb('0xe')]));recordings[_0x175ad6[_0x86cb('0x17')]]['accountcode']=_0x175ad6[_0x86cb('0x3')];}}catch(_0x19bbbb){utils[_0x86cb('0xf')](util[_0x86cb('0x1')](_0x86cb('0x12'),_0x175ad6[_0x86cb('0x2')]),_0x19bbbb);}};exports[_0x86cb('0x18')]=function(_0x3fd13){try{if(!_[_0x86cb('0x15')](_0x3fd13['variable'])&&!_['isNil'](_0x3fd13[_0x86cb('0x19')]['mixmonitor_filename'])){utils[_0x86cb('0x11')](util[_0x86cb('0x1')](_0x86cb('0x1a'),_0x3fd13[_0x86cb('0x2')]),_0x3fd13);utils[_0x86cb('0x1b')](util[_0x86cb('0x1')](_0x86cb('0x1c'),_0x3fd13[_0x86cb('0x2')],_0x3fd13[_0x86cb('0x19')],_0x3fd13[_0x86cb('0x1d')]));if(_[_0x86cb('0x1e')](_0x3fd13[_0x86cb('0x1d')],'.wav49')){_0x3fd13[_0x86cb('0x1d')]=_0x3fd13[_0x86cb('0x1d')]['replace']('.wav49','.WAV');}if(recordings[_0x3fd13[_0x86cb('0x17')]]){var _0x755088=_[_0x86cb('0x1f')](recordings[_0x3fd13[_0x86cb('0x17')]][_0x86cb('0x20')],{'value':_0x3fd13[_0x86cb('0x1d')]});if(_['isNil'](_0x755088)){recordings[_0x3fd13[_0x86cb('0x17')]][_0x86cb('0x20')][_0x86cb('0x21')]({'value':_0x3fd13[_0x86cb('0x1d')]});}}}}catch(_0x513913){utils[_0x86cb('0xf')](util[_0x86cb('0x1')]('[%s][recordings][varset]',_0x3fd13[_0x86cb('0x2')]),_0x513913);}};exports[_0x86cb('0x22')]=function(_0x519c40){try{if(!_[_0x86cb('0x15')](recordings[_0x519c40[_0x86cb('0x2')]])){utils[_0x86cb('0x11')](util[_0x86cb('0x1')]('[%s][recordings][hangup]',_0x519c40[_0x86cb('0x2')]),_0x519c40);utils[_0x86cb('0x1b')](util[_0x86cb('0x1')]('[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s',_0x519c40[_0x86cb('0x2')],_0x519c40['calleridnum'],_0x519c40[_0x86cb('0x23')],_0x519c40[_0x86cb('0x24')]));recordings[_0x519c40[_0x86cb('0x2')]][_0x86cb('0x25')]=_0x519c40['calleridnum'];recordings[_0x519c40[_0x86cb('0x2')]][_0x86cb('0x23')]=_0x519c40[_0x86cb('0x23')];recordings[_0x519c40[_0x86cb('0x2')]][_0x86cb('0x26')]=_0x519c40[_0x86cb('0x26')];recordings[_0x519c40[_0x86cb('0x2')]]['connectedlinename']=_0x519c40['connectedlinename'];if(recordings[_0x519c40[_0x86cb('0x2')]][_0x86cb('0x27')]==_0x86cb('0x28')&&recordings[_0x519c40['uniqueid']]['accountcode']){recordings[_0x519c40[_0x86cb('0x2')]]['connectedlinenum']=recordings[_0x519c40[_0x86cb('0x2')]][_0x86cb('0x3')];recordings[_0x519c40[_0x86cb('0x2')]][_0x86cb('0x29')]='';}recordings[_0x519c40[_0x86cb('0x2')]]['monitors']['forEach'](function(_0x5156ad){var _0x287442=_[_0x86cb('0x2a')](recordings[_0x519c40[_0x86cb('0x2')]]);_0x287442['value']=_0x5156ad[_0x86cb('0x1d')];writeDB(_0x287442);});delete recordings[_0x519c40[_0x86cb('0x2')]];}}catch(_0x3930a0){utils['error'](util[_0x86cb('0x1')](_0x86cb('0x2b'),_0x519c40[_0x86cb('0x2')]),_0x3930a0);}};exports[_0x86cb('0x2c')]=function(_0x1a5fd9){try{if(!_[_0x86cb('0x15')](recordings[_0x1a5fd9['uniqueid']])){utils[_0x86cb('0x11')](util[_0x86cb('0x1')](_0x86cb('0x2d'),_0x1a5fd9[_0x86cb('0x2')]),_0x1a5fd9);utils[_0x86cb('0x1b')](util['format'](_0x86cb('0x2e'),_0x1a5fd9['uniqueid'],_0x1a5fd9[_0x86cb('0x2f')],_0x1a5fd9[_0x86cb('0x30')]));if(_0x1a5fd9[_0x86cb('0x2f')][_0x86cb('0x31')]()==_0x86cb('0x32')&&_['startsWith'](_0x1a5fd9[_0x86cb('0x30')][_0x86cb('0x31')](),'cdr')){var _0x18bc0c=_0x1a5fd9[_0x86cb('0x30')]['split']('=');var _0x46696b=_0x18bc0c[0x0]['substring'](_0x18bc0c[0x0][_0x86cb('0x33')]('(')+0x1,_0x18bc0c[0x0][_0x86cb('0x33')](')'));var _0x2afdab=_0x18bc0c[0x1];recordings[_0x1a5fd9[_0x86cb('0x2')]][_0x46696b]=_0x2afdab;}}}catch(_0x1cbaae){utils[_0x86cb('0xf')](util[_0x86cb('0x1')]('[%s][recordings][newexten]',_0x1a5fd9[_0x86cb('0x2')]),_0x1cbaae);}};exports['queuecallerjoin']=function(_0x22c16c){try{if(!_['isNil'](recordings[_0x22c16c['uniqueid']])){utils[_0x86cb('0x11')](util['format'](_0x86cb('0x34'),_0x22c16c[_0x86cb('0x2')]),_0x22c16c);utils['info'](util['format']('[%s][recordings][queuecallerjoin]\x20queue:%s',_0x22c16c[_0x86cb('0x2')],_0x22c16c[_0x86cb('0x35')]));recordings[_0x22c16c['uniqueid']][_0x86cb('0x35')]=_0x22c16c['queue'];}}catch(_0x45a923){utils['error'](util['format'](_0x86cb('0x34'),_0x22c16c['uniqueid']),_0x45a923);}}; \ No newline at end of file diff --git a/server/services/xdr/transfers.controller.js b/server/services/xdr/transfers.controller.js index 39712ef..84845b0 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 _0x6ea5=['assign','origtransfererchannel','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','secondtransfererexten','origtransfererlinkedid','origtransferercontext','origtransfererexten','transfereechannel','transfertargetchannel','transfertargetaccountcode','transfertargetcontext','transfertargetexten','transfertargetlinkedid','[%s][transfers][attendedtransfer]','lodash','util','info','type','attended','origtransfereruniqueid','uniqueid','request','CreateVoiceTransferReport','blinds','debug','format','[%s][transfers][blindtransfer]','[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridnum','transferercalleridname','transfereecalleridnum','blind','transfereruniqueid','error','[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','origtransferercalleridnum','origtransferercalleridname','transfertargetcalleridnum','transfertargetcalleridname'];(function(_0x3e3f71,_0x556471){var _0x48b8dd=function(_0x53abc1){while(--_0x53abc1){_0x3e3f71['push'](_0x3e3f71['shift']());}};_0x48b8dd(++_0x556471);}(_0x6ea5,0xb4));var _0x56ea=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x6ea5[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x56ea('0x0'));var util=require(_0x56ea('0x1'));var utils=require('./utils');function writeDB(_0x5e3dfe){utils[_0x56ea('0x2')](util['format']('[%s][transfers][writeDB]\x20type:%s',_0x5e3dfe[_0x56ea('0x3')]===_0x56ea('0x4')?_0x5e3dfe[_0x56ea('0x5')]:_0x5e3dfe[_0x56ea('0x6')],_0x5e3dfe[_0x56ea('0x3')]));utils[_0x56ea('0x7')](_0x56ea('0x8'),_0x5e3dfe);}exports[_0x56ea('0x9')]={};exports['blindtransfer']=function(_0x2dd297){try{utils[_0x56ea('0xa')](util[_0x56ea('0xb')](_0x56ea('0xc'),_0x2dd297[_0x56ea('0x6')]),_0x2dd297);utils[_0x56ea('0x2')](util[_0x56ea('0xb')](_0x56ea('0xd'),_0x2dd297[_0x56ea('0x6')],_0x2dd297[_0x56ea('0xe')],_0x2dd297[_0x56ea('0xf')],_0x2dd297[_0x56ea('0x10')],_0x2dd297['transfereecalleridname']));_0x2dd297['type']=_0x56ea('0x11');exports[_0x56ea('0x9')][_0x2dd297[_0x56ea('0x12')]]=_0x2dd297;writeDB(_0x2dd297);}catch(_0x13947d){utils[_0x56ea('0x13')](util[_0x56ea('0xb')](_0x56ea('0xc'),_0x2dd297[_0x56ea('0x6')]),_0x13947d);}};exports['attendedtransfer']=function(_0x14d94b){try{utils['debug'](util[_0x56ea('0xb')]('[%s][transfers][attendedtransfer]',_0x14d94b[_0x56ea('0x5')]),_0x14d94b);utils[_0x56ea('0x2')](util['format'](_0x56ea('0x14'),_0x14d94b[_0x56ea('0x5')],_0x14d94b[_0x56ea('0x15')],_0x14d94b[_0x56ea('0x16')],_0x14d94b[_0x56ea('0x17')],_0x14d94b[_0x56ea('0x18')]));_0x14d94b=_[_0x56ea('0x19')](_0x14d94b,{'transfererchannel':_0x14d94b[_0x56ea('0x1a')],'transferercalleridnum':_0x14d94b[_0x56ea('0x15')],'transferercalleridname':_0x14d94b['origtransferercalleridname'],'transfererconnectedlinenum':_0x14d94b['secondtransfererconnectedlinenum'],'transfererconnectedlinename':_0x14d94b[_0x56ea('0x1b')],'transfereraccountcode':_0x14d94b[_0x56ea('0x1c')],'transferercontext':_0x14d94b[_0x56ea('0x1d')],'transfererexten':_0x14d94b[_0x56ea('0x1e')],'transfererlinkedid':_0x14d94b[_0x56ea('0x1f')],'context':_0x14d94b[_0x56ea('0x20')],'extension':_0x14d94b[_0x56ea('0x21')],'type':_0x56ea('0x4')});if(_['isNil'](_0x14d94b[_0x56ea('0x22')])){_0x14d94b=_[_0x56ea('0x19')](_0x14d94b,{'transfereechannel':_0x14d94b[_0x56ea('0x23')],'transfereecalleridnum':_0x14d94b[_0x56ea('0x17')],'transfereecalleridname':_0x14d94b[_0x56ea('0x18')],'transfereeconnectedlinenum':_0x14d94b['transfertargetconnectedlinenum'],'transfereeconnectedlinename':_0x14d94b['transfertargetconnectedlinename'],'transfereeaccountcode':_0x14d94b[_0x56ea('0x24')],'transfereecontext':_0x14d94b[_0x56ea('0x25')],'transfereeexten':_0x14d94b[_0x56ea('0x26')],'transfereelinkedid':_0x14d94b[_0x56ea('0x27')]});}writeDB(_0x14d94b);}catch(_0x7074c1){utils['error'](util[_0x56ea('0xb')](_0x56ea('0x28'),_0x14d94b['origtransfereruniqueid']),_0x7074c1);}}; \ No newline at end of file +var _0x8594=['blind','blinds','transfereruniqueid','error','[%s][transfers][attendedtransfer]','[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','origtransferercalleridnum','origtransferercalleridname','transfertargetcalleridnum','assign','origtransfererchannel','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','secondtransfererexten','origtransfererlinkedid','origtransferercontext','origtransfererexten','isNil','transfereechannel','transfertargetconnectedlinenum','transfertargetaccountcode','transfertargetcontext','transfertargetexten','transfertargetlinkedid','lodash','util','./utils','info','format','type','attended','origtransfereruniqueid','blindtransfer','debug','[%s][transfers][blindtransfer]','uniqueid','[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridname','transfereecalleridname'];(function(_0x369742,_0x40978d){var _0x20fed4=function(_0x322ad4){while(--_0x322ad4){_0x369742['push'](_0x369742['shift']());}};_0x20fed4(++_0x40978d);}(_0x8594,0x181));var _0x4859=function(_0x33cdbb,_0x4a43ff){_0x33cdbb=_0x33cdbb-0x0;var _0x2da588=_0x8594[_0x33cdbb];return _0x2da588;};'use strict';var _=require(_0x4859('0x0'));var util=require(_0x4859('0x1'));var utils=require(_0x4859('0x2'));function writeDB(_0x522eaa){utils[_0x4859('0x3')](util[_0x4859('0x4')]('[%s][transfers][writeDB]\x20type:%s',_0x522eaa[_0x4859('0x5')]===_0x4859('0x6')?_0x522eaa[_0x4859('0x7')]:_0x522eaa['uniqueid'],_0x522eaa[_0x4859('0x5')]));utils['request']('CreateVoiceTransferReport',_0x522eaa);}exports['blinds']={};exports[_0x4859('0x8')]=function(_0x4006b6){try{utils[_0x4859('0x9')](util[_0x4859('0x4')](_0x4859('0xa'),_0x4006b6[_0x4859('0xb')]),_0x4006b6);utils[_0x4859('0x3')](util['format'](_0x4859('0xc'),_0x4006b6[_0x4859('0xb')],_0x4006b6['transferercalleridnum'],_0x4006b6[_0x4859('0xd')],_0x4006b6['transfereecalleridnum'],_0x4006b6[_0x4859('0xe')]));_0x4006b6[_0x4859('0x5')]=_0x4859('0xf');exports[_0x4859('0x10')][_0x4006b6[_0x4859('0x11')]]=_0x4006b6;writeDB(_0x4006b6);}catch(_0x487fd0){utils[_0x4859('0x12')](util[_0x4859('0x4')](_0x4859('0xa'),_0x4006b6['uniqueid']),_0x487fd0);}};exports['attendedtransfer']=function(_0x1f8bd7){try{utils[_0x4859('0x9')](util[_0x4859('0x4')](_0x4859('0x13'),_0x1f8bd7[_0x4859('0x7')]),_0x1f8bd7);utils[_0x4859('0x3')](util[_0x4859('0x4')](_0x4859('0x14'),_0x1f8bd7[_0x4859('0x7')],_0x1f8bd7[_0x4859('0x15')],_0x1f8bd7[_0x4859('0x16')],_0x1f8bd7[_0x4859('0x17')],_0x1f8bd7['transfertargetcalleridname']));_0x1f8bd7=_[_0x4859('0x18')](_0x1f8bd7,{'transfererchannel':_0x1f8bd7[_0x4859('0x19')],'transferercalleridnum':_0x1f8bd7[_0x4859('0x15')],'transferercalleridname':_0x1f8bd7['origtransferercalleridname'],'transfererconnectedlinenum':_0x1f8bd7['secondtransfererconnectedlinenum'],'transfererconnectedlinename':_0x1f8bd7[_0x4859('0x1a')],'transfereraccountcode':_0x1f8bd7[_0x4859('0x1b')],'transferercontext':_0x1f8bd7[_0x4859('0x1c')],'transfererexten':_0x1f8bd7[_0x4859('0x1d')],'transfererlinkedid':_0x1f8bd7[_0x4859('0x1e')],'context':_0x1f8bd7[_0x4859('0x1f')],'extension':_0x1f8bd7[_0x4859('0x20')],'type':_0x4859('0x6')});if(_[_0x4859('0x21')](_0x1f8bd7[_0x4859('0x22')])){_0x1f8bd7=_[_0x4859('0x18')](_0x1f8bd7,{'transfereechannel':_0x1f8bd7['transfertargetchannel'],'transfereecalleridnum':_0x1f8bd7[_0x4859('0x17')],'transfereecalleridname':_0x1f8bd7['transfertargetcalleridname'],'transfereeconnectedlinenum':_0x1f8bd7[_0x4859('0x23')],'transfereeconnectedlinename':_0x1f8bd7['transfertargetconnectedlinename'],'transfereeaccountcode':_0x1f8bd7[_0x4859('0x24')],'transfereecontext':_0x1f8bd7[_0x4859('0x25')],'transfereeexten':_0x1f8bd7[_0x4859('0x26')],'transfereelinkedid':_0x1f8bd7[_0x4859('0x27')]});}writeDB(_0x1f8bd7);}catch(_0x465a3d){utils[_0x4859('0x12')](util[_0x4859('0x4')]('[%s][transfers][attendedtransfer]',_0x1f8bd7[_0x4859('0x7')]),_0x465a3d);}}; \ No newline at end of file diff --git a/server/services/xdr/utils.js b/server/services/xdr/utils.js index 3768bd6..4c33ff6 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 _0x789f=['getVoiceQueueByName','GetVoiceQueue','type','acw','acwTimeout','[utils][getVoiceQueueByName]','format','subtractTime','seconds','YYYY-MM-DD\x20HH:mm:ss','diffTime','diff','sumTime','now','isAfter','isBefore','moment','util','client','http','xdr','info','inspect','debug','error','request','[utils][request]\x20name:%s','catch','internal','name','interface','then','[utils][getUser]\x20where:%s','stringify','result','length','[utils][getUserByInternal]\x20internal:%s\x20%s','found','notfound','[utils][getUserByInternal]','[utils][getUserByInterface]\x20interface:%s\x20%s','[utils][getUserByName]'];(function(_0x48431f,_0x23a62d){var _0x49c558=function(_0xff7a49){while(--_0xff7a49){_0x48431f['push'](_0x48431f['shift']());}};_0x49c558(++_0x23a62d);}(_0x789f,0x10c));var _0xf789=function(_0x555069,_0x23d66a){_0x555069=_0x555069-0x0;var _0x100af7=_0x789f[_0x555069];return _0x100af7;};'use strict';var BPromise=require('bluebird');var jayson=require('jayson/promise');var moment=require(_0xf789('0x0'));var util=require(_0xf789('0x1'));var client=jayson[_0xf789('0x2')][_0xf789('0x3')]({'port':0x2329});var logger=require('../../config/logger')(_0xf789('0x4'));exports[_0xf789('0x5')]=function(_0x20b4b5,_0x36d99f){logger['info'](_0x20b4b5,_0x36d99f?util[_0xf789('0x6')](_0x36d99f,{'showHidden':![],'depth':null}):'');};exports[_0xf789('0x7')]=function(_0x55303d,_0x5414da){logger[_0xf789('0x7')](_0x55303d,_0x5414da?util[_0xf789('0x6')](_0x5414da,{'showHidden':![],'depth':null}):'');};exports[_0xf789('0x8')]=function(_0x2cfe5c,_0x329ff5){logger[_0xf789('0x8')](_0x2cfe5c,_0x329ff5?util[_0xf789('0x6')](_0x329ff5,{'showHidden':![],'depth':null}):'');};exports[_0xf789('0x9')]=function(_0x12acdb,_0x18c6db){return client[_0xf789('0x9')](_0x12acdb,{'body':_0x18c6db})['then'](function(_0xcd813e){logger[_0xf789('0x7')](_0xf789('0xa'),_0x12acdb,_0xcd813e?util[_0xf789('0x6')](_0xcd813e,{'showHidden':![],'depth':null}):'');})[_0xf789('0xb')](function(_0x523411){logger['error']('[utils][request]\x20name:%s',_0x12acdb,_0x523411?util['inspect'](_0x523411,{'showHidden':![],'depth':null}):'');});};function getUser(_0x49c0a2){return client[_0xf789('0x9')]('GetUser',{'options':{'raw':!![],'attributes':['id',_0xf789('0xc'),_0xf789('0xd'),_0xf789('0xe')],'where':_0x49c0a2,'limit':0x1}})[_0xf789('0xf')](function(_0x185265){logger[_0xf789('0x7')](_0xf789('0x10'),JSON[_0xf789('0x11')](_0x49c0a2),_0x185265?util[_0xf789('0x6')](_0x185265,{'showHidden':![],'depth':null}):'');return _0x185265[_0xf789('0x12')][_0xf789('0x13')]?_0x185265['result'][0x0]:null;});}exports['getUserByInternal']=function(_0x54f343){return new BPromise(function(_0x69269e,_0x545f3e){if(_0x54f343){return getUser({'internal':_0x54f343})[_0xf789('0xf')](function(_0x46188b){logger['info'](_0xf789('0x14'),_0x54f343,_0x46188b?_0xf789('0x15'):_0xf789('0x16'));return _0x69269e(_0x46188b);})[_0xf789('0xb')](function(_0x19ec25){logger[_0xf789('0x8')](_0xf789('0x17'),_0x19ec25?util[_0xf789('0x6')](_0x19ec25,{'showHidden':![],'depth':null}):'');return _0x69269e(null);});}return _0x69269e(null);});};exports['getUserByInterface']=function(_0x500819){return new BPromise(function(_0xc7a43,_0x136e5a){if(_0x500819){return getUser({'interface':_0x500819})[_0xf789('0xf')](function(_0x2e384e){logger[_0xf789('0x5')](_0xf789('0x18'),_0x500819,_0x2e384e?_0xf789('0x15'):_0xf789('0x16'));return _0xc7a43(_0x2e384e);})[_0xf789('0xb')](function(_0x2b7b80){logger[_0xf789('0x8')]('[utils][getUserByInterface]',_0x2b7b80?util[_0xf789('0x6')](_0x2b7b80,{'showHidden':![],'depth':null}):'');return _0xc7a43(null);});}return _0xc7a43(null);});};exports['getUserByName']=function(_0xe7e3b8){return new BPromise(function(_0x2aee81,_0x432205){if(_0xe7e3b8){return getUser({'name':_0xe7e3b8})[_0xf789('0xf')](function(_0x287b05){logger[_0xf789('0x5')]('[utils][getUserByName]\x20name:%s\x20%s',_0xe7e3b8,_0x287b05?_0xf789('0x15'):_0xf789('0x16'));return _0x2aee81(_0x287b05);})['catch'](function(_0xc501e1){logger['error'](_0xf789('0x19'),_0xc501e1?util[_0xf789('0x6')](_0xc501e1,{'showHidden':![],'depth':null}):'');return _0x2aee81(null);});}return _0x2aee81(null);});};exports[_0xf789('0x1a')]=function(_0x39935b){return new BPromise(function(_0x37cd92,_0x1699c6){if(_0x39935b){return client['request'](_0xf789('0x1b'),{'options':{'raw':!![],'attributes':['id',_0xf789('0xd'),_0xf789('0x1c'),_0xf789('0x1d'),_0xf789('0x1e')],'where':{'name':_0x39935b},'limit':0x1}})[_0xf789('0xf')](function(_0x551445){logger[_0xf789('0x7')]('[utils][getVoiceQueueByName]\x20name:%s',_0x39935b,_0x551445?util[_0xf789('0x6')](_0x551445,{'showHidden':![],'depth':null}):'');logger['info']('[utils][getVoiceQueueByName]\x20name:%s\x20%s',_0x39935b,_0x551445?_0xf789('0x15'):'notfound');return _0x37cd92(_0x551445[_0xf789('0x12')][_0xf789('0x13')]?_0x551445[_0xf789('0x12')][0x0]:null);})['catch'](function(_0x3cd6e0){logger[_0xf789('0x8')](_0xf789('0x1f'),_0x3cd6e0?util[_0xf789('0x6')](_0x3cd6e0,{'showHidden':![],'depth':null}):'');return _0x37cd92(null);});}return _0x37cd92(null);});};exports['addTime']=function(_0xa6d11a,_0x556f13){return moment(_0xa6d11a)['add'](_0x556f13,'seconds')[_0xf789('0x20')]('YYYY-MM-DD\x20HH:mm:ss');};exports[_0xf789('0x21')]=function(_0xbdf21a,_0x573372){return moment(_0xbdf21a)['subtract'](_0x573372,_0xf789('0x22'))[_0xf789('0x20')](_0xf789('0x23'));};exports[_0xf789('0x24')]=function(_0x203001,_0x1cffb3){return moment(_0x203001)[_0xf789('0x25')](moment(_0x1cffb3),_0xf789('0x22'));};exports[_0xf789('0x26')]=function(_0x5513bb,_0x5b9a32){return parseInt(_0x5513bb,0xa)+parseInt(_0x5b9a32,0xa);};exports[_0xf789('0x27')]=function(){return moment()[_0xf789('0x20')](_0xf789('0x23'));};exports['isAfter']=function(_0x200e54,_0x4defa0){if(_0x4defa0){return moment(_0x200e54)[_0xf789('0x28')](_0x4defa0);}return!![];};exports[_0xf789('0x29')]=function(_0x5a17f7,_0x3e3fcb){if(_0x3e3fcb){return moment(_0x5a17f7)['isBefore'](_0x3e3fcb);}else if(_0x5a17f7){return!![];}return![];}; \ No newline at end of file +var _0x0a9f=['GetVoiceQueue','type','acw','acwTimeout','[utils][getVoiceQueueByName]\x20name:%s','[utils][getVoiceQueueByName]','add','format','YYYY-MM-DD\x20HH:mm:ss','subtractTime','subtract','seconds','diffTime','diff','sumTime','now','isAfter','isBefore','bluebird','jayson/promise','util','client','../../config/logger','info','inspect','debug','error','request','then','[utils][request]\x20name:%s','catch','GetUser','internal','name','interface','[utils][getUser]\x20where:%s','stringify','result','length','getUserByInternal','[utils][getUserByInternal]\x20internal:%s\x20%s','found','notfound','getUserByInterface','[utils][getUserByInterface]\x20interface:%s\x20%s','[utils][getUserByInterface]','getUserByName','[utils][getUserByName]\x20name:%s\x20%s','getVoiceQueueByName'];(function(_0xfccb84,_0x47ae9d){var _0x5edf30=function(_0x197cb1){while(--_0x197cb1){_0xfccb84['push'](_0xfccb84['shift']());}};_0x5edf30(++_0x47ae9d);}(_0x0a9f,0x169));var _0xf0a9=function(_0x3c6310,_0x13601d){_0x3c6310=_0x3c6310-0x0;var _0x320122=_0x0a9f[_0x3c6310];return _0x320122;};'use strict';var BPromise=require(_0xf0a9('0x0'));var jayson=require(_0xf0a9('0x1'));var moment=require('moment');var util=require(_0xf0a9('0x2'));var client=jayson[_0xf0a9('0x3')]['http']({'port':0x2329});var logger=require(_0xf0a9('0x4'))('xdr');exports['info']=function(_0x5994bf,_0x2d1954){logger[_0xf0a9('0x5')](_0x5994bf,_0x2d1954?util[_0xf0a9('0x6')](_0x2d1954,{'showHidden':![],'depth':null}):'');};exports[_0xf0a9('0x7')]=function(_0x3ab3d3,_0x2a09e3){logger['debug'](_0x3ab3d3,_0x2a09e3?util[_0xf0a9('0x6')](_0x2a09e3,{'showHidden':![],'depth':null}):'');};exports['error']=function(_0x1f43b9,_0x161349){logger[_0xf0a9('0x8')](_0x1f43b9,_0x161349?util[_0xf0a9('0x6')](_0x161349,{'showHidden':![],'depth':null}):'');};exports[_0xf0a9('0x9')]=function(_0x379ecf,_0x121372){return client['request'](_0x379ecf,{'body':_0x121372})[_0xf0a9('0xa')](function(_0x13ad92){logger[_0xf0a9('0x7')](_0xf0a9('0xb'),_0x379ecf,_0x13ad92?util['inspect'](_0x13ad92,{'showHidden':![],'depth':null}):'');})[_0xf0a9('0xc')](function(_0x18e3de){logger[_0xf0a9('0x8')]('[utils][request]\x20name:%s',_0x379ecf,_0x18e3de?util[_0xf0a9('0x6')](_0x18e3de,{'showHidden':![],'depth':null}):'');});};function getUser(_0x57c09c){return client['request'](_0xf0a9('0xd'),{'options':{'raw':!![],'attributes':['id',_0xf0a9('0xe'),_0xf0a9('0xf'),_0xf0a9('0x10')],'where':_0x57c09c,'limit':0x1}})['then'](function(_0x1bb15b){logger[_0xf0a9('0x7')](_0xf0a9('0x11'),JSON[_0xf0a9('0x12')](_0x57c09c),_0x1bb15b?util[_0xf0a9('0x6')](_0x1bb15b,{'showHidden':![],'depth':null}):'');return _0x1bb15b[_0xf0a9('0x13')][_0xf0a9('0x14')]?_0x1bb15b['result'][0x0]:null;});}exports[_0xf0a9('0x15')]=function(_0x44214f){return new BPromise(function(_0x765a36,_0x5550b5){if(_0x44214f){return getUser({'internal':_0x44214f})[_0xf0a9('0xa')](function(_0x11cbd0){logger[_0xf0a9('0x5')](_0xf0a9('0x16'),_0x44214f,_0x11cbd0?_0xf0a9('0x17'):_0xf0a9('0x18'));return _0x765a36(_0x11cbd0);})[_0xf0a9('0xc')](function(_0x1d0220){logger[_0xf0a9('0x8')]('[utils][getUserByInternal]',_0x1d0220?util[_0xf0a9('0x6')](_0x1d0220,{'showHidden':![],'depth':null}):'');return _0x765a36(null);});}return _0x765a36(null);});};exports[_0xf0a9('0x19')]=function(_0x56f08a){return new BPromise(function(_0x45c323,_0x5d8615){if(_0x56f08a){return getUser({'interface':_0x56f08a})['then'](function(_0x3f4916){logger[_0xf0a9('0x5')](_0xf0a9('0x1a'),_0x56f08a,_0x3f4916?_0xf0a9('0x17'):_0xf0a9('0x18'));return _0x45c323(_0x3f4916);})[_0xf0a9('0xc')](function(_0x3dd01d){logger['error'](_0xf0a9('0x1b'),_0x3dd01d?util[_0xf0a9('0x6')](_0x3dd01d,{'showHidden':![],'depth':null}):'');return _0x45c323(null);});}return _0x45c323(null);});};exports[_0xf0a9('0x1c')]=function(_0x361627){return new BPromise(function(_0x1bb070,_0x137012){if(_0x361627){return getUser({'name':_0x361627})[_0xf0a9('0xa')](function(_0x428b78){logger['info'](_0xf0a9('0x1d'),_0x361627,_0x428b78?_0xf0a9('0x17'):_0xf0a9('0x18'));return _0x1bb070(_0x428b78);})[_0xf0a9('0xc')](function(_0x37ceaf){logger[_0xf0a9('0x8')]('[utils][getUserByName]',_0x37ceaf?util[_0xf0a9('0x6')](_0x37ceaf,{'showHidden':![],'depth':null}):'');return _0x1bb070(null);});}return _0x1bb070(null);});};exports[_0xf0a9('0x1e')]=function(_0x2b7413){return new BPromise(function(_0x24d4b8,_0x1f2477){if(_0x2b7413){return client[_0xf0a9('0x9')](_0xf0a9('0x1f'),{'options':{'raw':!![],'attributes':['id',_0xf0a9('0xf'),_0xf0a9('0x20'),_0xf0a9('0x21'),_0xf0a9('0x22')],'where':{'name':_0x2b7413},'limit':0x1}})[_0xf0a9('0xa')](function(_0x5897e8){logger['debug'](_0xf0a9('0x23'),_0x2b7413,_0x5897e8?util[_0xf0a9('0x6')](_0x5897e8,{'showHidden':![],'depth':null}):'');logger[_0xf0a9('0x5')]('[utils][getVoiceQueueByName]\x20name:%s\x20%s',_0x2b7413,_0x5897e8?_0xf0a9('0x17'):'notfound');return _0x24d4b8(_0x5897e8[_0xf0a9('0x13')][_0xf0a9('0x14')]?_0x5897e8[_0xf0a9('0x13')][0x0]:null);})[_0xf0a9('0xc')](function(_0x5c3902){logger[_0xf0a9('0x8')](_0xf0a9('0x24'),_0x5c3902?util[_0xf0a9('0x6')](_0x5c3902,{'showHidden':![],'depth':null}):'');return _0x24d4b8(null);});}return _0x24d4b8(null);});};exports['addTime']=function(_0x4aebd6,_0x3ab52b){return moment(_0x4aebd6)[_0xf0a9('0x25')](_0x3ab52b,'seconds')[_0xf0a9('0x26')](_0xf0a9('0x27'));};exports[_0xf0a9('0x28')]=function(_0x12be27,_0x329528){return moment(_0x12be27)[_0xf0a9('0x29')](_0x329528,_0xf0a9('0x2a'))['format'](_0xf0a9('0x27'));};exports[_0xf0a9('0x2b')]=function(_0x301b61,_0x125998){return moment(_0x301b61)[_0xf0a9('0x2c')](moment(_0x125998),_0xf0a9('0x2a'));};exports[_0xf0a9('0x2d')]=function(_0x229409,_0x58ee6c){return parseInt(_0x229409,0xa)+parseInt(_0x58ee6c,0xa);};exports[_0xf0a9('0x2e')]=function(){return moment()[_0xf0a9('0x26')](_0xf0a9('0x27'));};exports[_0xf0a9('0x2f')]=function(_0x4abae0,_0x223c9e){if(_0x223c9e){return moment(_0x4abae0)[_0xf0a9('0x2f')](_0x223c9e);}return!![];};exports[_0xf0a9('0x30')]=function(_0x1e151b,_0x53cda5){if(_0x53cda5){return moment(_0x1e151b)[_0xf0a9('0x30')](_0x53cda5);}else if(_0x1e151b){return!![];}return![];}; \ No newline at end of file